{
  "version": 3,
  "sources": ["../../node_modules/mersenne-twister/src/mersenne-twister.js", "../../node_modules/urijs/src/punycode.js", "../../node_modules/urijs/src/IPv6.js", "../../node_modules/urijs/src/SecondLevelDomains.js", "../../node_modules/urijs/src/URI.js", "../../node_modules/dompurify/src/utils.js", "../../node_modules/dompurify/src/tags.js", "../../node_modules/dompurify/src/attrs.js", "../../node_modules/dompurify/src/regexp.js", "../../node_modules/dompurify/src/purify.js", "../../node_modules/meshoptimizer/meshopt_encoder.js", "../../node_modules/meshoptimizer/meshopt_decoder.js", "../../node_modules/meshoptimizer/meshopt_simplifier.js", "../../node_modules/meshoptimizer/index.js", "../../node_modules/bitmap-sdf/index.js", "../../node_modules/grapheme-splitter/index.js", "../../node_modules/earcut/src/earcut.js", "../../node_modules/rbush/rbush.js", "../../node_modules/topojson-client/dist/topojson-client.js", "../../node_modules/autolinker/src/version.ts", "../../node_modules/autolinker/src/utils.ts", "../../node_modules/autolinker/src/regex-lib.ts", "../../node_modules/autolinker/src/html-tag.ts", "../../node_modules/autolinker/src/truncate/truncate-smart.ts", "../../node_modules/autolinker/src/truncate/truncate-middle.ts", "../../node_modules/autolinker/src/truncate/truncate-end.ts", "../../node_modules/autolinker/src/anchor-tag-builder.ts", "../../node_modules/tslib/tslib.es6.mjs", "../../node_modules/autolinker/src/match/abstract-match.ts", "../../node_modules/autolinker/src/parser/tld-regex.ts", "../../node_modules/autolinker/src/parser/uri-utils.ts", "../../node_modules/autolinker/src/match/url-match.ts", "../../node_modules/autolinker/src/parser/email-utils.ts", "../../node_modules/autolinker/src/match/email-match.ts", "../../node_modules/autolinker/src/parser/hashtag-utils.ts", "../../node_modules/autolinker/src/match/hashtag-match.ts", "../../node_modules/autolinker/src/parser/mention-utils.ts", "../../node_modules/autolinker/src/match/mention-match.ts", "../../node_modules/autolinker/src/parser/phone-number-utils.ts", "../../node_modules/autolinker/src/match/phone-match.ts", "../../node_modules/autolinker/src/parser/parse-matches.ts", "../../node_modules/autolinker/src/htmlParser/parse-html.ts", "../../node_modules/autolinker/src/autolinker.ts", "../../node_modules/autolinker/dist/commonjs/match/match.js", "../../node_modules/autolinker/src/match/index.ts", "../../node_modules/autolinker/src/parser/index.ts", "../../node_modules/autolinker/src/index.ts", "../../node_modules/protobufjs/dist/minimal/lib/prelude.js", "../../node_modules/protobufjs/dist/node_modules/@protobufjs/aspromise/index.js", "../../node_modules/protobufjs/dist/node_modules/@protobufjs/base64/index.js", "../../node_modules/protobufjs/dist/node_modules/@protobufjs/eventemitter/index.js", "../../node_modules/protobufjs/dist/node_modules/@protobufjs/float/index.js", "../../node_modules/protobufjs/dist/node_modules/@protobufjs/inquire/index.js", "../../node_modules/protobufjs/dist/node_modules/@protobufjs/pool/index.js", "../../node_modules/protobufjs/dist/node_modules/@protobufjs/utf8/index.js", "../../node_modules/protobufjs/dist/src/index-minimal", "../../node_modules/protobufjs/dist/src/reader.js", "../../node_modules/protobufjs/dist/src/reader_buffer.js", "../../node_modules/protobufjs/dist/src/roots.js", "../../node_modules/protobufjs/dist/src/rpc.js", "../../node_modules/protobufjs/dist/src/rpc/service.js", "../../node_modules/protobufjs/dist/src/util/longbits.js", "../../node_modules/protobufjs/dist/src/util/minimal.js", "../../node_modules/protobufjs/dist/src/writer.js", "../../node_modules/protobufjs/dist/src/writer_buffer.js", "../../node_modules/lerc/LercDecode.js", "../../node_modules/nosleep.js/dist/NoSleep.min.js", "../../Source/Cesium.js", "../../packages/engine/Source/Core/defined.js", "../../packages/engine/Source/Core/DeveloperError.js", "../../packages/engine/Source/Core/Check.js", "../../packages/engine/Source/Core/defaultValue.js", "../../packages/engine/Source/Core/Math.js", "../../packages/engine/Source/Core/Cartesian3.js", "../../packages/engine/Source/Core/Cartesian4.js", "../../packages/engine/Source/Core/Matrix3.js", "../../packages/engine/Source/Core/RuntimeError.js", "../../packages/engine/Source/Core/Matrix4.js", "../../packages/engine/Source/Core/WebGLConstants.js", "../../packages/engine/Source/Renderer/AutomaticUniforms.js", "../../packages/engine/Source/Core/createGuid.js", "../../packages/engine/Source/Core/destroyObject.js", "../../packages/engine/Source/Core/IndexDatatype.js", "../../packages/engine/Source/Renderer/BufferUsage.js", "../../packages/engine/Source/Renderer/Buffer.js", "../../packages/engine/Source/Core/Fullscreen.js", "../../packages/engine/Source/Core/FeatureDetection.js", "../../packages/engine/Source/Core/Color.js", "../../packages/engine/Source/Renderer/ClearCommand.js", "../../packages/engine/Source/Renderer/Pass.js", "../../packages/engine/Source/Renderer/ComputeCommand.js", "../../packages/engine/Source/Core/Cartesian2.js", "../../packages/engine/Source/Core/scaleToGeodeticSurface.js", "../../packages/engine/Source/Core/Cartographic.js", "../../packages/engine/Source/Core/Ellipsoid.js", "../../packages/engine/Source/Core/GeographicProjection.js", "../../packages/engine/Source/Core/Intersect.js", "../../packages/engine/Source/Core/Rectangle.js", "../../packages/engine/Source/Core/BoundingRectangle.js", "../../packages/engine/Source/Core/PrimitiveType.js", "../../packages/engine/Source/Shaders/ViewportQuadVS.js", "../../packages/engine/Source/Renderer/DrawCommand.js", "../../packages/engine/Source/Renderer/PixelDatatype.js", "../../packages/engine/Source/Core/PixelFormat.js", "../../packages/engine/Source/Renderer/ContextLimits.js", "../../packages/engine/Source/Renderer/Framebuffer.js", "../../packages/engine/Source/Core/WindingOrder.js", "../../packages/engine/Source/Renderer/freezeRenderState.js", "../../packages/engine/Source/Renderer/RenderState.js", "../../packages/engine/Source/Core/Matrix2.js", "../../packages/engine/Source/Renderer/createUniform.js", "../../packages/engine/Source/Renderer/createUniformArray.js", "../../packages/engine/Source/Renderer/ShaderProgram.js", "../../packages/engine/Source/Renderer/ComputeEngine.js", "../../packages/engine/Source/Core/ComponentDatatype.js", "../../packages/engine/Source/Core/oneTimeWarning.js", "../../packages/engine/Source/Core/deprecationWarning.js", "../../packages/engine/Source/Core/GeometryType.js", "../../packages/engine/Source/Core/Quaternion.js", "../../packages/engine/Source/Core/binarySearch.js", "../../packages/engine/Source/Core/EarthOrientationParametersSample.js", "../../packages/engine/Source/Core/GregorianDate.js", "../../packages/engine/Source/Core/isLeapYear.js", "../../packages/engine/Source/Core/LeapSecond.js", "../../packages/engine/Source/Core/TimeConstants.js", "../../packages/engine/Source/Core/TimeStandard.js", "../../packages/engine/Source/Core/JulianDate.js", "../../packages/engine/Source/Core/Resource.js", "../../packages/engine/Source/Core/appendForwardSlash.js", "../../packages/engine/Source/Core/clone.js", "../../packages/engine/Source/Core/combine.js", "../../packages/engine/Source/Core/defer.js", "../../packages/engine/Source/Core/getAbsoluteUri.js", "../../packages/engine/Source/Core/getBaseUri.js", "../../packages/engine/Source/Core/getExtensionFromUri.js", "../../packages/engine/Source/Core/getImagePixels.js", "../../packages/engine/Source/Core/isBlobUri.js", "../../packages/engine/Source/Core/isCrossOriginUrl.js", "../../packages/engine/Source/Core/isDataUri.js", "../../packages/engine/Source/Core/loadAndExecuteScript.js", "../../packages/engine/Source/Core/objectToQuery.js", "../../packages/engine/Source/Core/queryToObject.js", "../../packages/engine/Source/Core/RequestState.js", "../../packages/engine/Source/Core/RequestType.js", "../../packages/engine/Source/Core/Request.js", "../../packages/engine/Source/Core/parseResponseHeaders.js", "../../packages/engine/Source/Core/RequestErrorEvent.js", "../../packages/engine/Source/Core/RequestScheduler.js", "../../packages/engine/Source/Core/Event.js", "../../packages/engine/Source/Core/Heap.js", "../../packages/engine/Source/Core/TrustedServers.js", "../../packages/engine/Source/Core/EarthOrientationParameters.js", "../../packages/engine/Source/Core/HeadingPitchRoll.js", "../../packages/engine/Source/Core/buildModuleUrl.js", "../../packages/engine/Source/Core/Iau2006XysSample.js", "../../packages/engine/Source/Core/Iau2006XysData.js", "../../packages/engine/Source/Core/Transforms.js", "../../packages/engine/Source/Core/Geometry.js", "../../packages/engine/Source/Core/GeometryAttribute.js", "../../packages/engine/Source/Core/CompressedTextureBuffer.js", "../../packages/engine/Source/Core/TaskProcessor.js", "../../packages/engine/Source/Core/KTX2Transcoder.js", "../../packages/engine/Source/Core/loadKTX2.js", "../../packages/engine/Source/Renderer/CubeMapFace.js", "../../packages/engine/Source/Renderer/MipmapHint.js", "../../packages/engine/Source/Renderer/TextureMagnificationFilter.js", "../../packages/engine/Source/Renderer/TextureMinificationFilter.js", "../../packages/engine/Source/Renderer/TextureWrap.js", "../../packages/engine/Source/Renderer/Sampler.js", "../../packages/engine/Source/Renderer/CubeMap.js", "../../packages/engine/Source/Renderer/PassState.js", "../../packages/engine/Source/Shaders/Builtin/Constants/degreesPerRadian.js", "../../packages/engine/Source/Shaders/Builtin/Constants/depthRange.js", "../../packages/engine/Source/Shaders/Builtin/Constants/epsilon1.js", "../../packages/engine/Source/Shaders/Builtin/Constants/epsilon2.js", "../../packages/engine/Source/Shaders/Builtin/Constants/epsilon3.js", "../../packages/engine/Source/Shaders/Builtin/Constants/epsilon4.js", "../../packages/engine/Source/Shaders/Builtin/Constants/epsilon5.js", "../../packages/engine/Source/Shaders/Builtin/Constants/epsilon6.js", "../../packages/engine/Source/Shaders/Builtin/Constants/epsilon7.js", "../../packages/engine/Source/Shaders/Builtin/Constants/infinity.js", "../../packages/engine/Source/Shaders/Builtin/Constants/oneOverPi.js", "../../packages/engine/Source/Shaders/Builtin/Constants/oneOverTwoPi.js", "../../packages/engine/Source/Shaders/Builtin/Constants/passCesium3DTile.js", "../../packages/engine/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js", "../../packages/engine/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js", "../../packages/engine/Source/Shaders/Builtin/Constants/passClassification.js", "../../packages/engine/Source/Shaders/Builtin/Constants/passCompute.js", "../../packages/engine/Source/Shaders/Builtin/Constants/passEnvironment.js", "../../packages/engine/Source/Shaders/Builtin/Constants/passGlobe.js", "../../packages/engine/Source/Shaders/Builtin/Constants/passOpaque.js", "../../packages/engine/Source/Shaders/Builtin/Constants/passOverlay.js", "../../packages/engine/Source/Shaders/Builtin/Constants/passTerrainClassification.js", "../../packages/engine/Source/Shaders/Builtin/Constants/passTranslucent.js", "../../packages/engine/Source/Shaders/Builtin/Constants/passVoxels.js", "../../packages/engine/Source/Shaders/Builtin/Constants/pi.js", "../../packages/engine/Source/Shaders/Builtin/Constants/piOverFour.js", "../../packages/engine/Source/Shaders/Builtin/Constants/piOverSix.js", "../../packages/engine/Source/Shaders/Builtin/Constants/piOverThree.js", "../../packages/engine/Source/Shaders/Builtin/Constants/piOverTwo.js", "../../packages/engine/Source/Shaders/Builtin/Constants/radiansPerDegree.js", "../../packages/engine/Source/Shaders/Builtin/Constants/sceneMode2D.js", "../../packages/engine/Source/Shaders/Builtin/Constants/sceneMode3D.js", "../../packages/engine/Source/Shaders/Builtin/Constants/sceneModeColumbusView.js", "../../packages/engine/Source/Shaders/Builtin/Constants/sceneModeMorphing.js", "../../packages/engine/Source/Shaders/Builtin/Constants/solarRadius.js", "../../packages/engine/Source/Shaders/Builtin/Constants/threePiOver2.js", "../../packages/engine/Source/Shaders/Builtin/Constants/twoPi.js", "../../packages/engine/Source/Shaders/Builtin/Constants/webMercatorMaxLatitude.js", "../../packages/engine/Source/Shaders/Builtin/Structs/depthRangeStruct.js", "../../packages/engine/Source/Shaders/Builtin/Structs/material.js", "../../packages/engine/Source/Shaders/Builtin/Structs/materialInput.js", "../../packages/engine/Source/Shaders/Builtin/Structs/modelMaterial.js", "../../packages/engine/Source/Shaders/Builtin/Structs/modelVertexOutput.js", "../../packages/engine/Source/Shaders/Builtin/Structs/pbrParameters.js", "../../packages/engine/Source/Shaders/Builtin/Structs/ray.js", "../../packages/engine/Source/Shaders/Builtin/Structs/raySegment.js", "../../packages/engine/Source/Shaders/Builtin/Structs/shadowParameters.js", "../../packages/engine/Source/Shaders/Builtin/Functions/HSBToRGB.js", "../../packages/engine/Source/Shaders/Builtin/Functions/HSLToRGB.js", "../../packages/engine/Source/Shaders/Builtin/Functions/RGBToHSB.js", "../../packages/engine/Source/Shaders/Builtin/Functions/RGBToHSL.js", "../../packages/engine/Source/Shaders/Builtin/Functions/RGBToXYZ.js", "../../packages/engine/Source/Shaders/Builtin/Functions/XYZToRGB.js", "../../packages/engine/Source/Shaders/Builtin/Functions/acesTonemapping.js", "../../packages/engine/Source/Shaders/Builtin/Functions/alphaWeight.js", "../../packages/engine/Source/Shaders/Builtin/Functions/antialias.js", "../../packages/engine/Source/Shaders/Builtin/Functions/approximateSphericalCoordinates.js", "../../packages/engine/Source/Shaders/Builtin/Functions/backFacing.js", "../../packages/engine/Source/Shaders/Builtin/Functions/branchFreeTernary.js", "../../packages/engine/Source/Shaders/Builtin/Functions/cascadeColor.js", "../../packages/engine/Source/Shaders/Builtin/Functions/cascadeDistance.js", "../../packages/engine/Source/Shaders/Builtin/Functions/cascadeMatrix.js", "../../packages/engine/Source/Shaders/Builtin/Functions/cascadeWeights.js", "../../packages/engine/Source/Shaders/Builtin/Functions/columbusViewMorph.js", "../../packages/engine/Source/Shaders/Builtin/Functions/computePosition.js", "../../packages/engine/Source/Shaders/Builtin/Functions/cosineAndSine.js", "../../packages/engine/Source/Shaders/Builtin/Functions/decompressTextureCoordinates.js", "../../packages/engine/Source/Shaders/Builtin/Functions/defaultPbrMaterial.js", "../../packages/engine/Source/Shaders/Builtin/Functions/depthClamp.js", "../../packages/engine/Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.js", "../../packages/engine/Source/Shaders/Builtin/Functions/ellipsoidContainsPoint.js", "../../packages/engine/Source/Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates.js", "../../packages/engine/Source/Shaders/Builtin/Functions/equalsEpsilon.js", "../../packages/engine/Source/Shaders/Builtin/Functions/eyeOffset.js", "../../packages/engine/Source/Shaders/Builtin/Functions/eyeToWindowCoordinates.js", "../../packages/engine/Source/Shaders/Builtin/Functions/fastApproximateAtan.js", "../../packages/engine/Source/Shaders/Builtin/Functions/fog.js", "../../packages/engine/Source/Shaders/Builtin/Functions/gammaCorrect.js", "../../packages/engine/Source/Shaders/Builtin/Functions/geodeticSurfaceNormal.js", "../../packages/engine/Source/Shaders/Builtin/Functions/getDefaultMaterial.js", "../../packages/engine/Source/Shaders/Builtin/Functions/getLambertDiffuse.js", "../../packages/engine/Source/Shaders/Builtin/Functions/getSpecular.js", "../../packages/engine/Source/Shaders/Builtin/Functions/getWaterNoise.js", "../../packages/engine/Source/Shaders/Builtin/Functions/hue.js", "../../packages/engine/Source/Shaders/Builtin/Functions/inverseGamma.js", "../../packages/engine/Source/Shaders/Builtin/Functions/isEmpty.js", "../../packages/engine/Source/Shaders/Builtin/Functions/isFull.js", "../../packages/engine/Source/Shaders/Builtin/Functions/latitudeToWebMercatorFraction.js", "../../packages/engine/Source/Shaders/Builtin/Functions/lineDistance.js", "../../packages/engine/Source/Shaders/Builtin/Functions/linearToSrgb.js", "../../packages/engine/Source/Shaders/Builtin/Functions/luminance.js", "../../packages/engine/Source/Shaders/Builtin/Functions/metersPerPixel.js", "../../packages/engine/Source/Shaders/Builtin/Functions/modelToWindowCoordinates.js", "../../packages/engine/Source/Shaders/Builtin/Functions/multiplyWithColorBalance.js", "../../packages/engine/Source/Shaders/Builtin/Functions/nearFarScalar.js", "../../packages/engine/Source/Shaders/Builtin/Functions/octDecode.js", "../../packages/engine/Source/Shaders/Builtin/Functions/packDepth.js", "../../packages/engine/Source/Shaders/Builtin/Functions/pbrLighting.js", "../../packages/engine/Source/Shaders/Builtin/Functions/pbrMetallicRoughnessMaterial.js", "../../packages/engine/Source/Shaders/Builtin/Functions/pbrSpecularGlossinessMaterial.js", "../../packages/engine/Source/Shaders/Builtin/Functions/phong.js", "../../packages/engine/Source/Shaders/Builtin/Functions/planeDistance.js", "../../packages/engine/Source/Shaders/Builtin/Functions/pointAlongRay.js", "../../packages/engine/Source/Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval.js", "../../packages/engine/Source/Shaders/Builtin/Functions/raySphereIntersectionInterval.js", "../../packages/engine/Source/Shaders/Builtin/Functions/readDepth.js", "../../packages/engine/Source/Shaders/Builtin/Functions/readNonPerspective.js", "../../packages/engine/Source/Shaders/Builtin/Functions/reverseLogDepth.js", "../../packages/engine/Source/Shaders/Builtin/Functions/round.js", "../../packages/engine/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.js", "../../packages/engine/Source/Shaders/Builtin/Functions/saturation.js", "../../packages/engine/Source/Shaders/Builtin/Functions/shadowDepthCompare.js", "../../packages/engine/Source/Shaders/Builtin/Functions/shadowVisibility.js", "../../packages/engine/Source/Shaders/Builtin/Functions/signNotZero.js", "../../packages/engine/Source/Shaders/Builtin/Functions/sphericalHarmonics.js", "../../packages/engine/Source/Shaders/Builtin/Functions/srgbToLinear.js", "../../packages/engine/Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.js", "../../packages/engine/Source/Shaders/Builtin/Functions/textureCube.js", "../../packages/engine/Source/Shaders/Builtin/Functions/transformPlane.js", "../../packages/engine/Source/Shaders/Builtin/Functions/translateRelativeToEye.js", "../../packages/engine/Source/Shaders/Builtin/Functions/translucentPhong.js", "../../packages/engine/Source/Shaders/Builtin/Functions/transpose.js", "../../packages/engine/Source/Shaders/Builtin/Functions/unpackDepth.js", "../../packages/engine/Source/Shaders/Builtin/Functions/unpackFloat.js", "../../packages/engine/Source/Shaders/Builtin/Functions/unpackUint.js", "../../packages/engine/Source/Shaders/Builtin/Functions/valueTransform.js", "../../packages/engine/Source/Shaders/Builtin/Functions/vertexLogDepth.js", "../../packages/engine/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.js", "../../packages/engine/Source/Shaders/Builtin/Functions/writeDepthClamp.js", "../../packages/engine/Source/Shaders/Builtin/Functions/writeLogDepth.js", "../../packages/engine/Source/Shaders/Builtin/Functions/writeNonPerspective.js", "../../packages/engine/Source/Shaders/Builtin/CzmBuiltins.js", "../../packages/engine/Source/Renderer/demodernizeShader.js", "../../packages/engine/Source/Renderer/ShaderSource.js", "../../packages/engine/Source/Renderer/ShaderCache.js", "../../packages/engine/Source/Renderer/Texture.js", "../../packages/engine/Source/Renderer/TextureCache.js", "../../packages/engine/Source/Core/EncodedCartesian3.js", "../../packages/engine/Source/Core/Plane.js", "../../packages/engine/Source/Core/CullingVolume.js", "../../packages/engine/Source/Core/OrthographicOffCenterFrustum.js", "../../packages/engine/Source/Core/OrthographicFrustum.js", "../../packages/engine/Source/Core/Simon1994PlanetaryPositions.js", "../../packages/engine/Source/Scene/SceneMode.js", "../../packages/engine/Source/Scene/SunLight.js", "../../packages/engine/Source/Renderer/UniformState.js", "../../packages/engine/Source/Renderer/VertexArray.js", "../../packages/engine/Source/Renderer/Context.js", "../../packages/engine/Source/Renderer/MultisampleFramebuffer.js", "../../packages/engine/Source/Renderer/RenderbufferFormat.js", "../../packages/engine/Source/Renderer/Renderbuffer.js", "../../packages/engine/Source/Renderer/FramebufferManager.js", "../../packages/engine/Source/Renderer/ShaderDestination.js", "../../packages/engine/Source/Renderer/ShaderStruct.js", "../../packages/engine/Source/Renderer/ShaderFunction.js", "../../packages/engine/Source/Renderer/ShaderBuilder.js", "../../packages/engine/Source/Renderer/VertexArrayFacade.js", "../../packages/engine/Source/Renderer/loadCubeMap.js", "../../packages/engine/Source/DataSources/ConstantProperty.js", "../../packages/engine/Source/DataSources/createPropertyDescriptor.js", "../../packages/engine/Source/DataSources/BillboardGraphics.js", "../../packages/engine/Source/Core/AssociativeArray.js", "../../packages/engine/Source/Core/DistanceDisplayCondition.js", "../../packages/engine/Source/Core/NearFarScalar.js", "../../packages/engine/Source/Scene/HeightReference.js", "../../packages/engine/Source/Scene/HorizontalOrigin.js", "../../packages/engine/Source/Scene/VerticalOrigin.js", "../../packages/engine/Source/DataSources/BoundingSphereState.js", "../../packages/engine/Source/DataSources/Property.js", "../../packages/engine/Source/DataSources/BillboardVisualizer.js", "../../packages/engine/Source/Core/Interval.js", "../../packages/engine/Source/Core/BoundingSphere.js", "../../packages/engine/Source/Core/GeometryAttributes.js", "../../packages/engine/Source/Core/GeometryOffsetAttribute.js", "../../packages/engine/Source/Core/VertexFormat.js", "../../packages/engine/Source/Core/BoxGeometry.js", "../../packages/engine/Source/Core/BoxOutlineGeometry.js", "../../packages/engine/Source/Core/ColorGeometryInstanceAttribute.js", "../../packages/engine/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js", "../../packages/engine/Source/Core/GeometryInstance.js", "../../packages/engine/Source/Core/TimeInterval.js", "../../packages/engine/Source/Core/Iso8601.js", "../../packages/engine/Source/Core/OffsetGeometryInstanceAttribute.js", "../../packages/engine/Source/Core/ShowGeometryInstanceAttribute.js", "../../packages/engine/Source/Shaders/Appearances/AllMaterialAppearanceFS.js", "../../packages/engine/Source/Shaders/Appearances/AllMaterialAppearanceVS.js", "../../packages/engine/Source/Shaders/Appearances/BasicMaterialAppearanceFS.js", "../../packages/engine/Source/Shaders/Appearances/BasicMaterialAppearanceVS.js", "../../packages/engine/Source/Shaders/Appearances/TexturedMaterialAppearanceFS.js", "../../packages/engine/Source/Shaders/Appearances/TexturedMaterialAppearanceVS.js", "../../packages/engine/Source/Scene/BlendEquation.js", "../../packages/engine/Source/Scene/BlendFunction.js", "../../packages/engine/Source/Scene/BlendingState.js", "../../packages/engine/Source/Scene/CullFace.js", "../../packages/engine/Source/Scene/Appearance.js", "../../packages/engine/Source/Shaders/Materials/AspectRampMaterial.js", "../../packages/engine/Source/Shaders/Materials/BumpMapMaterial.js", "../../packages/engine/Source/Shaders/Materials/CheckerboardMaterial.js", "../../packages/engine/Source/Shaders/Materials/DotMaterial.js", "../../packages/engine/Source/Shaders/Materials/ElevationBandMaterial.js", "../../packages/engine/Source/Shaders/Materials/ElevationContourMaterial.js", "../../packages/engine/Source/Shaders/Materials/ElevationRampMaterial.js", "../../packages/engine/Source/Shaders/Materials/FadeMaterial.js", "../../packages/engine/Source/Shaders/Materials/GridMaterial.js", "../../packages/engine/Source/Shaders/Materials/NormalMapMaterial.js", "../../packages/engine/Source/Shaders/Materials/PolylineArrowMaterial.js", "../../packages/engine/Source/Shaders/Materials/PolylineDashMaterial.js", "../../packages/engine/Source/Shaders/Materials/PolylineGlowMaterial.js", "../../packages/engine/Source/Shaders/Materials/PolylineOutlineMaterial.js", "../../packages/engine/Source/Shaders/Materials/RimLightingMaterial.js", "../../packages/engine/Source/Shaders/Materials/SlopeRampMaterial.js", "../../packages/engine/Source/Shaders/Materials/StripeMaterial.js", "../../packages/engine/Source/Shaders/Materials/Water.js", "../../packages/engine/Source/Scene/Material.js", "../../packages/engine/Source/Scene/MaterialAppearance.js", "../../packages/engine/Source/Shaders/Appearances/PerInstanceColorAppearanceFS.js", "../../packages/engine/Source/Shaders/Appearances/PerInstanceColorAppearanceVS.js", "../../packages/engine/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js", "../../packages/engine/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.js", "../../packages/engine/Source/Scene/PerInstanceColorAppearance.js", "../../packages/engine/Source/DataSources/ColorMaterialProperty.js", "../../packages/engine/Source/Core/GeographicTilingScheme.js", "../../packages/engine/Source/Core/ApproximateTerrainHeights.js", "../../packages/engine/Source/Core/AxisAlignedBoundingBox.js", "../../packages/engine/Source/Core/QuadraticRealPolynomial.js", "../../packages/engine/Source/Core/CubicRealPolynomial.js", "../../packages/engine/Source/Core/QuarticRealPolynomial.js", "../../packages/engine/Source/Core/Ray.js", "../../packages/engine/Source/Core/IntersectionTests.js", "../../packages/engine/Source/Core/EllipsoidTangentPlane.js", "../../packages/engine/Source/Core/OrientedBoundingBox.js", "../../packages/engine/Source/Core/VerticalExaggeration.js", "../../packages/engine/Source/Shaders/ShadowVolumeAppearanceVS.js", "../../packages/engine/Source/Shaders/ShadowVolumeFS.js", "../../packages/engine/Source/Scene/ClassificationType.js", "../../packages/engine/Source/Scene/DepthFunction.js", "../../packages/engine/Source/Core/subdivideArray.js", "../../packages/engine/Source/Scene/BatchTable.js", "../../packages/engine/Source/Scene/AttributeType.js", "../../packages/engine/Source/Core/AttributeCompression.js", "../../packages/engine/Source/Core/barycentricCoordinates.js", "../../packages/engine/Source/Core/Tipsify.js", "../../packages/engine/Source/Core/GeometryPipeline.js", "../../packages/engine/Source/Core/WebMercatorProjection.js", "../../packages/engine/Source/Scene/PrimitivePipeline.js", "../../packages/engine/Source/Scene/PrimitiveState.js", "../../packages/engine/Source/Scene/ShadowMode.js", "../../packages/engine/Source/Scene/Primitive.js", "../../packages/engine/Source/Core/GeometryInstanceAttribute.js", "../../packages/engine/Source/Shaders/ShadowVolumeAppearanceFS.js", "../../packages/engine/Source/Scene/ShadowVolumeAppearance.js", "../../packages/engine/Source/Scene/StencilFunction.js", "../../packages/engine/Source/Scene/StencilOperation.js", "../../packages/engine/Source/Scene/StencilConstants.js", "../../packages/engine/Source/Scene/ClassificationPrimitive.js", "../../packages/engine/Source/Scene/GroundPrimitive.js", "../../packages/engine/Source/DataSources/MaterialProperty.js", "../../packages/engine/Source/DataSources/DynamicGeometryUpdater.js", "../../packages/engine/Source/Core/ArcType.js", "../../packages/engine/Source/Core/arrayRemoveDuplicates.js", "../../packages/engine/Source/Core/EllipsoidGeodesic.js", "../../packages/engine/Source/Core/EllipsoidRhumbLine.js", "../../packages/engine/Source/Core/GroundPolylineGeometry.js", "../../packages/engine/Source/Shaders/PolylineShadowVolumeFS.js", "../../packages/engine/Source/Shaders/PolylineShadowVolumeMorphFS.js", "../../packages/engine/Source/Shaders/PolylineShadowVolumeMorphVS.js", "../../packages/engine/Source/Shaders/PolylineShadowVolumeVS.js", "../../packages/engine/Source/Shaders/Appearances/PolylineColorAppearanceVS.js", "../../packages/engine/Source/Shaders/PolylineCommon.js", "../../packages/engine/Source/Scene/PolylineColorAppearance.js", "../../packages/engine/Source/Shaders/Appearances/PolylineMaterialAppearanceVS.js", "../../packages/engine/Source/Shaders/PolylineFS.js", "../../packages/engine/Source/Scene/PolylineMaterialAppearance.js", "../../packages/engine/Source/Scene/GroundPolylinePrimitive.js", "../../packages/engine/Source/DataSources/ImageMaterialProperty.js", "../../packages/engine/Source/DataSources/createMaterialPropertyDescriptor.js", "../../packages/engine/Source/DataSources/BoxGraphics.js", "../../packages/engine/Source/Core/ReferenceFrame.js", "../../packages/engine/Source/DataSources/PositionProperty.js", "../../packages/engine/Source/DataSources/ConstantPositionProperty.js", "../../packages/engine/Source/DataSources/CorridorGraphics.js", "../../packages/engine/Source/DataSources/createRawPropertyDescriptor.js", "../../packages/engine/Source/DataSources/CylinderGraphics.js", "../../packages/engine/Source/DataSources/EllipseGraphics.js", "../../packages/engine/Source/DataSources/EllipsoidGraphics.js", "../../packages/engine/Source/DataSources/LabelGraphics.js", "../../packages/engine/Source/Core/TranslationRotationScale.js", "../../packages/engine/Source/DataSources/NodeTransformationProperty.js", "../../packages/engine/Source/DataSources/PropertyBag.js", "../../packages/engine/Source/DataSources/ModelGraphics.js", "../../packages/engine/Source/DataSources/Cesium3DTilesetGraphics.js", "../../packages/engine/Source/DataSources/PathGraphics.js", "../../packages/engine/Source/DataSources/PlaneGraphics.js", "../../packages/engine/Source/DataSources/PointGraphics.js", "../../packages/engine/Source/Core/PolygonHierarchy.js", "../../packages/engine/Source/DataSources/PolygonGraphics.js", "../../packages/engine/Source/DataSources/PolylineGraphics.js", "../../packages/engine/Source/DataSources/PolylineVolumeGraphics.js", "../../packages/engine/Source/DataSources/RectangleGraphics.js", "../../packages/engine/Source/DataSources/WallGraphics.js", "../../packages/engine/Source/DataSources/Entity.js", "../../packages/engine/Source/DataSources/GeometryUpdater.js", "../../packages/engine/Source/DataSources/CallbackProperty.js", "../../packages/engine/Source/DataSources/TerrainOffsetProperty.js", "../../packages/engine/Source/DataSources/heightReferenceOnEntityPropertyChanged.js", "../../packages/engine/Source/DataSources/BoxGeometryUpdater.js", "../../packages/engine/Source/Core/Credit.js", "../../packages/engine/Source/Shaders/OctahedralProjectionAtlasFS.js", "../../packages/engine/Source/Shaders/OctahedralProjectionFS.js", "../../packages/engine/Source/Shaders/OctahedralProjectionVS.js", "../../packages/engine/Source/Scene/OctahedralProjectedCubeMap.js", "../../packages/engine/Source/Scene/ImageBasedLighting.js", "../../packages/engine/Source/Core/IonResource.js", "../../packages/engine/Source/Core/Ion.js", "../../packages/engine/Source/Core/ManagedArray.js", "../../packages/engine/Source/Scene/Axis.js", "../../packages/engine/Source/Scene/Cesium3DContentGroup.js", "../../packages/engine/Source/Core/getStringFromTypedArray.js", "../../packages/engine/Source/Core/getMagic.js", "../../packages/engine/Source/Scene/Composite3DTileContent.js", "../../packages/engine/Source/Core/getJsonFromTypedArray.js", "../../packages/engine/Source/Scene/BatchTexture.js", "../../packages/engine/Source/Scene/getBinaryAccessor.js", "../../packages/engine/Source/Scene/BatchTableHierarchy.js", "../../packages/engine/Source/Scene/Cesium3DTileColorBlendMode.js", "../../packages/engine/Source/Scene/Cesium3DTileBatchTable.js", "../../packages/engine/Source/Scene/Vector3DTileBatch.js", "../../packages/engine/Source/Shaders/VectorTileVS.js", "../../packages/engine/Source/Scene/Cesium3DTileFeature.js", "../../node_modules/jsep/dist/jsep.js", "../../packages/engine/Source/Scene/ExpressionNodeType.js", "../../packages/engine/Source/Scene/Expression.js", "../../packages/engine/Source/Scene/Vector3DTilePrimitive.js", "../../packages/engine/Source/Scene/Vector3DTileGeometry.js", "../../packages/engine/Source/Scene/Geometry3DTileContent.js", "../../packages/engine/Source/Core/HilbertOrder.js", "../../packages/engine/Source/Core/S2Cell.js", "../../packages/engine/Source/Scene/hasExtension.js", "../../packages/engine/Source/Scene/ImplicitAvailabilityBitstream.js", "../../packages/engine/Source/Scene/ImplicitMetadataView.js", "../../packages/engine/Source/Scene/ImplicitSubdivisionScheme.js", "../../packages/engine/Source/Scene/MetadataEntity.js", "../../packages/engine/Source/Scene/ImplicitSubtreeMetadata.js", "../../packages/engine/Source/Scene/MetadataComponentType.js", "../../packages/engine/Source/Scene/MetadataType.js", "../../packages/engine/Source/Scene/MetadataClassProperty.js", "../../packages/engine/Source/Scene/MetadataTableProperty.js", "../../packages/engine/Source/Scene/MetadataTable.js", "../../packages/engine/Source/Scene/ResourceLoader.js", "../../packages/engine/Source/Scene/ResourceLoaderState.js", "../../packages/engine/Source/Scene/BufferLoader.js", "../../packages/engine/Source/Scene/GltfBufferViewLoader.js", "../../packages/engine/Source/Scene/DracoLoader.js", "../../packages/engine/Source/Scene/GltfDracoLoader.js", "../../packages/engine/Source/Core/loadImageFromTypedArray.js", "../../packages/engine/Source/Scene/GltfImageLoader.js", "../../packages/engine/Source/Scene/JobType.js", "../../packages/engine/Source/Scene/GltfIndexBufferLoader.js", "../../packages/engine/Source/Scene/GltfPipeline/addToArray.js", "../../packages/engine/Source/Scene/GltfPipeline/usesExtension.js", "../../packages/engine/Source/Scene/GltfPipeline/ForEach.js", "../../packages/engine/Source/Scene/GltfPipeline/numberOfComponentsForType.js", "../../packages/engine/Source/Scene/GltfPipeline/getAccessorByteStride.js", "../../packages/engine/Source/Scene/GltfPipeline/addDefaults.js", "../../packages/engine/Source/Scene/GltfPipeline/addPipelineExtras.js", "../../packages/engine/Source/Scene/GltfPipeline/removeExtensionsRequired.js", "../../packages/engine/Source/Scene/GltfPipeline/removeExtensionsUsed.js", "../../packages/engine/Source/Scene/GltfPipeline/parseGlb.js", "../../packages/engine/Source/Scene/GltfPipeline/removePipelineExtras.js", "../../packages/engine/Source/Scene/GltfPipeline/addExtensionsUsed.js", "../../packages/engine/Source/Scene/GltfPipeline/getComponentReader.js", "../../packages/engine/Source/Scene/GltfPipeline/findAccessorMinMax.js", "../../packages/engine/Source/Scene/GltfPipeline/moveTechniqueRenderStates.js", "../../packages/engine/Source/Scene/GltfPipeline/addExtensionsRequired.js", "../../packages/engine/Source/Scene/GltfPipeline/moveTechniquesToExtension.js", "../../packages/engine/Source/Scene/GltfPipeline/forEachTextureInMaterial.js", "../../packages/engine/Source/Scene/GltfPipeline/removeUnusedElements.js", "../../packages/engine/Source/Scene/GltfPipeline/addBuffer.js", "../../packages/engine/Source/Scene/GltfPipeline/readAccessorPacked.js", "../../packages/engine/Source/Scene/GltfPipeline/updateAccessorComponentTypes.js", "../../packages/engine/Source/Scene/GltfPipeline/removeExtension.js", "../../packages/engine/Source/Scene/GltfPipeline/updateVersion.js", "../../packages/engine/Source/Scene/VertexAttributeSemantic.js", "../../packages/engine/Source/Scene/Model/ModelUtility.js", "../../packages/engine/Source/Scene/GltfJsonLoader.js", "../../packages/engine/Source/Scene/AlphaMode.js", "../../packages/engine/Source/Scene/ModelComponents.js", "../../packages/engine/Source/Scene/GltfLoaderUtil.js", "../../packages/engine/Source/Core/resizeImageToNextPowerOfTwo.js", "../../packages/engine/Source/Scene/GltfTextureLoader.js", "../../packages/engine/Source/Scene/GltfVertexBufferLoader.js", "../../packages/engine/Source/Scene/MetadataClass.js", "../../packages/engine/Source/Scene/MetadataEnumValue.js", "../../packages/engine/Source/Scene/MetadataEnum.js", "../../packages/engine/Source/Scene/MetadataSchema.js", "../../packages/engine/Source/Scene/MetadataSchemaLoader.js", "../../packages/engine/Source/Scene/ResourceCacheKey.js", "../../packages/engine/Source/Scene/ResourceCacheStatistics.js", "../../packages/engine/Source/Scene/ResourceCache.js", "../../packages/engine/Source/Scene/ImplicitSubtree.js", "../../packages/engine/Source/Scene/MetadataSemantic.js", "../../packages/engine/Source/Scene/BoundingVolumeSemantics.js", "../../packages/engine/Source/Scene/Implicit3DTileContent.js", "../../packages/engine/Source/Scene/ModelAnimationLoop.js", "../../packages/engine/Source/Scene/ClippingPlane.js", "../../packages/engine/Source/Scene/ClippingPlaneCollection.js", "../../packages/engine/Source/Scene/ColorBlendMode.js", "../../packages/engine/Source/Core/ArticulationStageType.js", "../../packages/engine/Source/Core/InterpolationType.js", "../../packages/engine/Source/Scene/JsonMetadataTable.js", "../../packages/engine/Source/Scene/PropertyTable.js", "../../packages/engine/Source/Scene/PropertyTextureProperty.js", "../../packages/engine/Source/Scene/PropertyTexture.js", "../../packages/engine/Source/Scene/PropertyAttributeProperty.js", "../../packages/engine/Source/Scene/PropertyAttribute.js", "../../packages/engine/Source/Scene/StructuralMetadata.js", "../../packages/engine/Source/Scene/parseStructuralMetadata.js", "../../packages/engine/Source/Scene/parseFeatureMetadataLegacy.js", "../../packages/engine/Source/Scene/GltfStructuralMetadataLoader.js", "../../packages/engine/Source/Scene/InstanceAttributeSemantic.js", "../../packages/engine/Source/Scene/Model/PrimitiveOutlineGenerator.js", "../../packages/engine/Source/Scene/PrimitiveLoadPlan.js", "../../packages/engine/Source/Scene/SupportedImageFormats.js", "../../packages/engine/Source/Scene/GltfLoader.js", "../../packages/engine/Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.js", "../../packages/engine/Source/Scene/PointCloudEyeDomeLighting.js", "../../packages/engine/Source/Scene/PointCloudShading.js", "../../packages/engine/Source/Scene/SceneTransforms.js", "../../packages/engine/Source/Scene/SplitDirection.js", "../../packages/engine/Source/Scene/B3dmParser.js", "../../packages/engine/Source/Scene/Cesium3DTileFeatureTable.js", "../../packages/engine/Source/Scene/parseBatchTable.js", "../../packages/engine/Source/Scene/Model/B3dmLoader.js", "../../packages/engine/Source/Scene/Model/GeoJsonLoader.js", "../../packages/engine/Source/Scene/I3dmParser.js", "../../packages/engine/Source/Scene/Model/I3dmLoader.js", "../../packages/engine/Source/Scene/ModelAnimationState.js", "../../packages/engine/Source/Core/Spline.js", "../../packages/engine/Source/Core/ConstantSpline.js", "../../packages/engine/Source/Core/LinearSpline.js", "../../packages/engine/Source/Core/TridiagonalSystemSolver.js", "../../packages/engine/Source/Core/HermiteSpline.js", "../../packages/engine/Source/Core/SteppedSpline.js", "../../packages/engine/Source/Core/QuaternionSpline.js", "../../packages/engine/Source/Scene/Model/ModelAnimationChannel.js", "../../packages/engine/Source/Scene/Model/ModelAnimation.js", "../../packages/engine/Source/Scene/Model/ModelAnimationCollection.js", "../../packages/engine/Source/Scene/Model/ModelFeature.js", "../../packages/engine/Source/Scene/Model/StyleCommandsNeeded.js", "../../packages/engine/Source/Scene/Model/ModelType.js", "../../packages/engine/Source/Scene/Model/ModelFeatureTable.js", "../../packages/engine/Source/Shaders/Model/ModelFS.js", "../../packages/engine/Source/Shaders/Model/ModelVS.js", "../../packages/engine/Source/Scene/Model/ClassificationModelDrawCommand.js", "../../packages/engine/Source/Scene/Model/ModelDrawCommand.js", "../../packages/engine/Source/Scene/Model/buildDrawCommand.js", "../../packages/engine/Source/Scene/Model/TilesetPipelineStage.js", "../../packages/engine/Source/Shaders/Model/ImageBasedLightingStageFS.js", "../../packages/engine/Source/Scene/Model/ImageBasedLightingPipelineStage.js", "../../packages/engine/Source/Scene/Model/ModelArticulationStage.js", "../../packages/engine/Source/Scene/Model/ModelArticulation.js", "../../packages/engine/Source/Shaders/Model/ModelColorStageFS.js", "../../packages/engine/Source/Scene/Model/ModelColorPipelineStage.js", "../../packages/engine/Source/Shaders/Model/ModelClippingPlanesStageFS.js", "../../packages/engine/Source/Scene/Model/ModelClippingPlanesPipelineStage.js", "../../packages/engine/Source/Scene/Model/ModelNode.js", "../../packages/engine/Source/Shaders/Model/InstancingStageCommon.js", "../../packages/engine/Source/Shaders/Model/InstancingStageVS.js", "../../packages/engine/Source/Shaders/Model/LegacyInstancingStageVS.js", "../../packages/engine/Source/Scene/Model/InstancingPipelineStage.js", "../../packages/engine/Source/Scene/Model/ModelMatrixUpdateStage.js", "../../packages/engine/Source/Scene/Model/NodeStatisticsPipelineStage.js", "../../packages/engine/Source/Scene/Model/ModelRuntimeNode.js", "../../packages/engine/Source/Scene/Model/AlphaPipelineStage.js", "../../packages/engine/Source/Scene/Model/BatchTexturePipelineStage.js", "../../packages/engine/Source/Scene/Model/ClassificationPipelineStage.js", "../../packages/engine/Source/Shaders/Model/CPUStylingStageVS.js", "../../packages/engine/Source/Shaders/Model/CPUStylingStageFS.js", "../../packages/engine/Source/Scene/Model/CPUStylingPipelineStage.js", "../../packages/engine/Source/Scene/Model/CustomShaderMode.js", "../../packages/engine/Source/Shaders/Model/CustomShaderStageVS.js", "../../packages/engine/Source/Shaders/Model/CustomShaderStageFS.js", "../../packages/engine/Source/Shaders/Model/FeatureIdStageFS.js", "../../packages/engine/Source/Shaders/Model/FeatureIdStageVS.js", "../../packages/engine/Source/Scene/Model/FeatureIdPipelineStage.js", "../../packages/engine/Source/Shaders/Model/MetadataStageFS.js", "../../packages/engine/Source/Shaders/Model/MetadataStageVS.js", "../../packages/engine/Source/Scene/Model/MetadataPipelineStage.js", "../../packages/engine/Source/Scene/Model/CustomShaderTranslucencyMode.js", "../../packages/engine/Source/Scene/Model/CustomShaderPipelineStage.js", "../../packages/engine/Source/Scene/Model/DequantizationPipelineStage.js", "../../packages/engine/Source/Shaders/Model/GeometryStageFS.js", "../../packages/engine/Source/Shaders/Model/GeometryStageVS.js", "../../packages/engine/Source/Shaders/Model/SelectedFeatureIdStageCommon.js", "../../packages/engine/Source/Scene/Model/SelectedFeatureIdPipelineStage.js", "../../packages/engine/Source/Scene/Model/GeometryPipelineStage.js", "../../packages/engine/Source/Shaders/Model/LightingStageFS.js", "../../packages/engine/Source/Scene/Model/LightingModel.js", "../../packages/engine/Source/Scene/Model/LightingPipelineStage.js", "../../packages/engine/Source/Shaders/Model/MaterialStageFS.js", "../../packages/engine/Source/Scene/Model/MaterialPipelineStage.js", "../../packages/engine/Source/Shaders/Model/MorphTargetsStageVS.js", "../../packages/engine/Source/Scene/Model/MorphTargetsPipelineStage.js", "../../packages/engine/Source/Scene/Model/PickingPipelineStage.js", "../../packages/engine/Source/Scene/Cesium3DTileRefine.js", "../../packages/engine/Source/Shaders/Model/PointCloudStylingStageVS.js", "../../packages/engine/Source/Scene/Model/PointCloudStylingPipelineStage.js", "../../packages/engine/Source/Shaders/Model/PrimitiveOutlineStageVS.js", "../../packages/engine/Source/Shaders/Model/PrimitiveOutlineStageFS.js", "../../packages/engine/Source/Scene/Model/PrimitiveOutlinePipelineStage.js", "../../packages/engine/Source/Scene/Model/PrimitiveStatisticsPipelineStage.js", "../../packages/engine/Source/Scene/Model/SceneMode2DPipelineStage.js", "../../packages/engine/Source/Shaders/Model/SkinningStageVS.js", "../../packages/engine/Source/Scene/Model/SkinningPipelineStage.js", "../../packages/engine/Source/Shaders/Model/VerticalExaggerationStageVS.js", "../../packages/engine/Source/Scene/Model/VerticalExaggerationPipelineStage.js", "../../packages/engine/Source/Core/WireframeIndexGenerator.js", "../../packages/engine/Source/Scene/Model/WireframePipelineStage.js", "../../packages/engine/Source/Scene/Model/ModelRuntimePrimitive.js", "../../packages/engine/Source/Scene/Model/ModelSkin.js", "../../packages/engine/Source/Scene/Model/ModelAlphaOptions.js", "../../packages/engine/Source/Scene/Model/ModelRenderResources.js", "../../packages/engine/Source/Shaders/Model/ModelSilhouetteStageFS.js", "../../packages/engine/Source/Shaders/Model/ModelSilhouetteStageVS.js", "../../packages/engine/Source/Scene/Model/ModelSilhouettePipelineStage.js", "../../packages/engine/Source/Shaders/Model/ModelSplitterStageFS.js", "../../packages/engine/Source/Scene/Model/ModelSplitterPipelineStage.js", "../../packages/engine/Source/Scene/Model/NodeRenderResources.js", "../../packages/engine/Source/Scene/Model/ModelLightingOptions.js", "../../packages/engine/Source/Scene/Model/PrimitiveRenderResources.js", "../../packages/engine/Source/Scene/Model/ModelSceneGraph.js", "../../packages/engine/Source/Scene/Model/ModelStatistics.js", "../../packages/engine/Source/Scene/Model/PntsLoader.js", "../../packages/engine/Source/Scene/PntsParser.js", "../../packages/engine/Source/Scene/Model/Model.js", "../../packages/engine/Source/Scene/Model/Model3DTileContent.js", "../../packages/engine/Source/Scene/Tileset3DTileContent.js", "../../packages/engine/Source/Shaders/BillboardCollectionFS.js", "../../packages/engine/Source/Shaders/BillboardCollectionVS.js", "../../packages/engine/Source/Scene/Billboard.js", "../../packages/engine/Source/Scene/BlendOption.js", "../../packages/engine/Source/Scene/SDFSettings.js", "../../packages/engine/Source/Scene/TextureAtlas.js", "../../packages/engine/Source/Scene/BillboardCollection.js", "../../packages/engine/Source/Scene/createBillboardPointCallback.js", "../../packages/engine/Source/Scene/Cesium3DTilePointFeature.js", "../../packages/engine/Source/Core/writeTextToCanvas.js", "../../packages/engine/Source/Scene/LabelCollection.js", "../../packages/engine/Source/Scene/LabelStyle.js", "../../packages/engine/Source/Scene/Label.js", "../../packages/engine/Source/Shaders/PolylineVS.js", "../../packages/engine/Source/Core/PolylinePipeline.js", "../../packages/engine/Source/Scene/Polyline.js", "../../packages/engine/Source/Scene/PolylineCollection.js", "../../packages/engine/Source/Scene/Vector3DTilePoints.js", "../../packages/engine/Source/Scene/Vector3DTilePolygons.js", "../../packages/engine/Source/Shaders/Vector3DTilePolylinesVS.js", "../../packages/engine/Source/Scene/Vector3DTilePolylines.js", "../../packages/engine/Source/Shaders/Vector3DTileClampedPolylinesVS.js", "../../packages/engine/Source/Shaders/Vector3DTileClampedPolylinesFS.js", "../../packages/engine/Source/Scene/Vector3DTileClampedPolylines.js", "../../packages/engine/Source/Core/decodeVectorPolylinePositions.js", "../../packages/engine/Source/Scene/Vector3DTileContent.js", "../../packages/engine/Source/Scene/Cesium3DTileContentFactory.js", "../../packages/engine/Source/Scene/Cesium3DTileContentState.js", "../../packages/engine/Source/Scene/Cesium3DTileContentType.js", "../../packages/engine/Source/Scene/Cesium3DTileOptimizationHint.js", "../../packages/engine/Source/Scene/Cesium3DTilePass.js", "../../packages/engine/Source/Scene/Empty3DTileContent.js", "../../packages/engine/Source/Scene/ContentMetadata.js", "../../packages/engine/Source/Scene/findContentMetadata.js", "../../packages/engine/Source/Scene/findGroupMetadata.js", "../../packages/engine/Source/Scene/TileMetadata.js", "../../packages/engine/Source/Scene/findTileMetadata.js", "../../packages/engine/Source/Scene/preprocess3DTileContent.js", "../../packages/engine/Source/Scene/Multiple3DTileContent.js", "../../packages/engine/Source/Core/PolygonPipeline.js", "../../packages/engine/Source/Core/RectangleGeometryLibrary.js", "../../packages/engine/Source/Core/RectangleOutlineGeometry.js", "../../packages/engine/Source/Scene/TileBoundingRegion.js", "../../packages/engine/Source/Core/CoplanarPolygonGeometryLibrary.js", "../../packages/engine/Source/Core/Queue.js", "../../packages/engine/Source/Core/PolygonGeometryLibrary.js", "../../packages/engine/Source/Core/CoplanarPolygonOutlineGeometry.js", "../../packages/engine/Source/Scene/TileBoundingS2Cell.js", "../../packages/engine/Source/Core/EllipsoidOutlineGeometry.js", "../../packages/engine/Source/Core/SphereOutlineGeometry.js", "../../packages/engine/Source/Scene/TileBoundingSphere.js", "../../packages/engine/Source/Scene/TileOrientedBoundingBox.js", "../../packages/engine/Source/Scene/Cesium3DTile.js", "../../packages/engine/Source/Scene/GroupMetadata.js", "../../packages/engine/Source/Scene/TilesetMetadata.js", "../../packages/engine/Source/Scene/Cesium3DTilesetMetadata.js", "../../packages/engine/Source/Scene/Cesium3DTileOptimizations.js", "../../packages/engine/Source/Core/DoublyLinkedList.js", "../../packages/engine/Source/Scene/Cesium3DTilesetCache.js", "../../packages/engine/Source/Scene/Cesium3DTilesetHeatmap.js", "../../packages/engine/Source/Scene/Cesium3DTilesetStatistics.js", "../../packages/engine/Source/Scene/Cesium3DTileStyleEngine.js", "../../packages/engine/Source/Scene/ImplicitTileset.js", "../../packages/engine/Source/Core/MortonOrder.js", "../../packages/engine/Source/Scene/ImplicitTileCoordinates.js", "../../packages/engine/Source/Scene/Cesium3DTilesetTraversal.js", "../../packages/engine/Source/Scene/Cesium3DTilesetMostDetailedTraversal.js", "../../packages/engine/Source/Scene/Cesium3DTilesetBaseTraversal.js", "../../packages/engine/Source/Scene/Cesium3DTilesetSkipTraversal.js", "../../packages/engine/Source/Scene/Cesium3DTileset.js", "../../packages/engine/Source/DataSources/Cesium3DTilesetVisualizer.js", "../../packages/engine/Source/DataSources/CheckerboardMaterialProperty.js", "../../packages/engine/Source/DataSources/EntityCollection.js", "../../packages/engine/Source/DataSources/CompositeEntityCollection.js", "../../packages/engine/Source/Core/EventHelper.js", "../../packages/engine/Source/Core/TimeIntervalCollection.js", "../../packages/engine/Source/DataSources/CompositeProperty.js", "../../packages/engine/Source/DataSources/CompositeMaterialProperty.js", "../../packages/engine/Source/DataSources/CompositePositionProperty.js", "../../packages/engine/Source/Core/CornerType.js", "../../packages/engine/Source/Core/PolylineVolumeGeometryLibrary.js", "../../packages/engine/Source/Core/CorridorGeometryLibrary.js", "../../packages/engine/Source/Core/CorridorGeometry.js", "../../packages/engine/Source/Core/CorridorOutlineGeometry.js", "../../packages/engine/Source/DataSources/GroundGeometryUpdater.js", "../../packages/engine/Source/DataSources/CorridorGeometryUpdater.js", "../../packages/engine/Source/DataSources/DataSource.js", "../../packages/engine/Source/Core/EllipsoidalOccluder.js", "../../packages/engine/Source/Scene/PointPrimitive.js", "../../packages/engine/Source/Shaders/PointPrimitiveCollectionFS.js", "../../packages/engine/Source/Shaders/PointPrimitiveCollectionVS.js", "../../packages/engine/Source/Scene/PointPrimitiveCollection.js", "../../node_modules/kdbush/index.js", "../../packages/engine/Source/DataSources/EntityCluster.js", "../../packages/engine/Source/DataSources/CustomDataSource.js", "../../packages/engine/Source/Core/CylinderGeometryLibrary.js", "../../packages/engine/Source/Core/CylinderGeometry.js", "../../packages/engine/Source/Core/CylinderOutlineGeometry.js", "../../packages/engine/Source/DataSources/CylinderGeometryUpdater.js", "../../packages/engine/Source/Core/ClockRange.js", "../../packages/engine/Source/Core/ClockStep.js", "../../packages/engine/Source/Core/ExtrapolationType.js", "../../packages/engine/Source/Core/getFilenameFromUri.js", "../../packages/engine/Source/Core/HermitePolynomialApproximation.js", "../../packages/engine/Source/Core/LagrangePolynomialApproximation.js", "../../packages/engine/Source/Core/LinearApproximation.js", "../../packages/engine/Source/Core/Spherical.js", "../../packages/engine/Source/DataSources/CzmlDataSource.js", "../../packages/engine/Source/Core/getTimestamp.js", "../../packages/engine/Source/Core/Clock.js", "../../packages/engine/Source/DataSources/DataSourceClock.js", "../../packages/engine/Source/DataSources/GridMaterialProperty.js", "../../packages/engine/Source/DataSources/PolylineArrowMaterialProperty.js", "../../packages/engine/Source/DataSources/PolylineDashMaterialProperty.js", "../../packages/engine/Source/DataSources/PolylineGlowMaterialProperty.js", "../../packages/engine/Source/DataSources/PolylineOutlineMaterialProperty.js", "../../packages/engine/Source/DataSources/PositionPropertyArray.js", "../../packages/engine/Source/DataSources/PropertyArray.js", "../../packages/engine/Source/DataSources/ReferenceProperty.js", "../../packages/engine/Source/DataSources/Rotation.js", "../../packages/engine/Source/DataSources/SampledProperty.js", "../../packages/engine/Source/DataSources/SampledPositionProperty.js", "../../packages/engine/Source/DataSources/StripeOrientation.js", "../../packages/engine/Source/DataSources/StripeMaterialProperty.js", "../../packages/engine/Source/DataSources/TimeIntervalCollectionPositionProperty.js", "../../packages/engine/Source/DataSources/TimeIntervalCollectionProperty.js", "../../packages/engine/Source/DataSources/VelocityVectorProperty.js", "../../packages/engine/Source/DataSources/VelocityOrientationProperty.js", "../../packages/engine/Source/DataSources/DataSourceCollection.js", "../../packages/engine/Source/Scene/PrimitiveCollection.js", "../../packages/engine/Source/Scene/OrderedGroundPrimitiveCollection.js", "../../packages/engine/Source/DataSources/DynamicGeometryBatch.js", "../../packages/engine/Source/Core/EllipseGeometryLibrary.js", "../../packages/engine/Source/Core/EllipseGeometry.js", "../../packages/engine/Source/Core/EllipseOutlineGeometry.js", "../../packages/engine/Source/DataSources/EllipseGeometryUpdater.js", "../../packages/engine/Source/Core/EllipsoidGeometry.js", "../../packages/engine/Source/DataSources/EllipsoidGeometryUpdater.js", "../../packages/engine/Source/Core/PlaneGeometry.js", "../../packages/engine/Source/Core/PlaneOutlineGeometry.js", "../../packages/engine/Source/DataSources/PlaneGeometryUpdater.js", "../../packages/engine/Source/Core/CoplanarPolygonGeometry.js", "../../packages/engine/Source/Core/Stereographic.js", "../../packages/engine/Source/Core/PolygonGeometry.js", "../../packages/engine/Source/Core/PolygonOutlineGeometry.js", "../../packages/engine/Source/DataSources/PolygonGeometryUpdater.js", "../../packages/engine/Source/Core/PolylineVolumeGeometry.js", "../../packages/engine/Source/Core/PolylineVolumeOutlineGeometry.js", "../../packages/engine/Source/DataSources/PolylineVolumeGeometryUpdater.js", "../../packages/engine/Source/Core/RectangleGeometry.js", "../../packages/engine/Source/DataSources/RectangleGeometryUpdater.js", "../../packages/engine/Source/DataSources/StaticGeometryColorBatch.js", "../../packages/engine/Source/DataSources/StaticGeometryPerMaterialBatch.js", "../../packages/engine/Source/Core/RectangleCollisionChecker.js", "../../packages/engine/Source/DataSources/StaticGroundGeometryColorBatch.js", "../../packages/engine/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js", "../../packages/engine/Source/DataSources/StaticOutlineGeometryBatch.js", "../../packages/engine/Source/Core/WallGeometryLibrary.js", "../../packages/engine/Source/Core/WallGeometry.js", "../../packages/engine/Source/Core/WallOutlineGeometry.js", "../../packages/engine/Source/DataSources/WallGeometryUpdater.js", "../../packages/engine/Source/DataSources/GeometryVisualizer.js", "../../packages/engine/Source/DataSources/LabelVisualizer.js", "../../packages/engine/Source/Core/sampleTerrain.js", "../../packages/engine/Source/Core/sampleTerrainMostDetailed.js", "../../packages/engine/Source/DataSources/ModelVisualizer.js", "../../packages/engine/Source/DataSources/ScaledPositionProperty.js", "../../packages/engine/Source/DataSources/PathVisualizer.js", "../../packages/engine/Source/DataSources/PointVisualizer.js", "../../packages/engine/Source/Core/PolylineGeometry.js", "../../packages/engine/Source/DataSources/PolylineGeometryUpdater.js", "../../packages/engine/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js", "../../packages/engine/Source/DataSources/PolylineVisualizer.js", "../../packages/engine/Source/DataSources/DataSourceDisplay.js", "../../packages/engine/Source/Core/HeadingPitchRange.js", "../../packages/engine/Source/DataSources/EntityView.js", "../../packages/engine/Source/Core/PinBuilder.js", "../../packages/engine/Source/DataSources/GeoJsonDataSource.js", "../../packages/engine/Source/DataSources/GpxDataSource.js", "../../packages/engine/Source/DataSources/KmlCamera.js", "../../packages/engine/Source/DataSources/KmlDataSource.js", "../../node_modules/@zip.js/zip.js/lib/core/codecs/deflate.js", "../../node_modules/@zip.js/zip.js/lib/core/codecs/inflate.js", "../../node_modules/@zip.js/zip.js/lib/core/configuration.js", "../../node_modules/@zip.js/zip.js/lib/core/codecs/crc32.js", "../../node_modules/@zip.js/zip.js/lib/core/util/encode-text.js", "../../node_modules/@zip.js/zip.js/lib/core/codecs/sjcl.js", "../../node_modules/@zip.js/zip.js/lib/core/codecs/aes-crypto.js", "../../node_modules/@zip.js/zip.js/lib/core/codecs/zip-crypto.js", "../../node_modules/@zip.js/zip.js/lib/core/codecs/codec.js", "../../node_modules/@zip.js/zip.js/lib/core/codecs/codec-pool-worker.js", "../../node_modules/@zip.js/zip.js/lib/core/codecs/codec-pool.js", "../../node_modules/@zip.js/zip.js/lib/core/engine.js", "../../node_modules/@zip.js/zip.js/lib/core/io.js", "../../node_modules/@zip.js/zip.js/lib/core/constants.js", "../../node_modules/@zip.js/zip.js/lib/core/util/cp437-decode.js", "../../node_modules/@zip.js/zip.js/lib/core/util/decode-text.js", "../../node_modules/@zip.js/zip.js/lib/core/zip-entry.js", "../../node_modules/@zip.js/zip.js/lib/core/zip-reader.js", "../../node_modules/@zip.js/zip.js/lib/core/zip-writer.js", "../../node_modules/@zip.js/zip.js/lib/zip-no-worker.js", "../../packages/engine/Source/DataSources/getElement.js", "../../packages/engine/Source/DataSources/KmlLookAt.js", "../../packages/engine/Source/DataSources/KmlTour.js", "../../node_modules/@tweenjs/tween.js/dist/tween.esm.js", "../../packages/engine/Source/Core/EasingFunction.js", "../../packages/engine/Source/DataSources/KmlTourFlyTo.js", "../../packages/engine/Source/DataSources/KmlTourWait.js", "../../packages/engine/Source/DataSources/Visualizer.js", "../../packages/engine/Source/DataSources/exportKml.js", "../../packages/engine/Source/Core/formatError.js", "../../packages/engine/Source/Core/HeightmapEncoding.js", "../../packages/engine/Source/Core/TerrainQuantization.js", "../../packages/engine/Source/Core/TerrainEncoding.js", "../../packages/engine/Source/Core/HeightmapTessellator.js", "../../packages/engine/Source/Core/TerrainData.js", "../../packages/engine/Source/Core/TerrainMesh.js", "../../packages/engine/Source/Core/TerrainProvider.js", "../../packages/engine/Source/Core/HeightmapTerrainData.js", "../../packages/engine/Source/Core/EllipsoidTerrainProvider.js", "../../packages/engine/Source/Shaders/GlobeFS.js", "../../packages/engine/Source/Shaders/GlobeVS.js", "../../packages/engine/Source/Shaders/AtmosphereCommon.js", "../../packages/engine/Source/Shaders/GroundAtmosphere.js", "../../packages/engine/Source/Scene/getClippingFunction.js", "../../packages/engine/Source/Scene/GlobeSurfaceShaderSet.js", "../../packages/engine/Source/Core/Visibility.js", "../../packages/engine/Source/Core/TileProviderError.js", "../../packages/engine/Source/Scene/ImageryState.js", "../../packages/engine/Source/Scene/QuadtreeTileLoadState.js", "../../packages/engine/Source/Scene/TerrainState.js", "../../packages/engine/Source/Scene/GlobeSurfaceTile.js", "../../packages/engine/Source/Core/WebMercatorTilingScheme.js", "../../packages/engine/Source/Scene/ArcGisMapService.js", "../../packages/engine/Source/Scene/DiscardMissingTileImagePolicy.js", "../../packages/engine/Source/Scene/ImageryLayerFeatureInfo.js", "../../packages/engine/Source/Scene/ImageryProvider.js", "../../packages/engine/Source/Scene/ArcGisBaseMapType.js", "../../packages/engine/Source/Scene/ArcGisMapServerImageryProvider.js", "../../packages/engine/Source/Scene/BingMapsStyle.js", "../../packages/engine/Source/Scene/DiscardEmptyTileImagePolicy.js", "../../packages/engine/Source/Scene/BingMapsImageryProvider.js", "../../packages/engine/Source/Scene/UrlTemplateImageryProvider.js", "../../packages/engine/Source/Scene/TileMapServiceImageryProvider.js", "../../packages/engine/Source/Scene/GoogleEarthEnterpriseMapsProvider.js", "../../packages/engine/Source/Scene/MapboxImageryProvider.js", "../../packages/engine/Source/Scene/SingleTileImageryProvider.js", "../../packages/engine/Source/Scene/GetFeatureInfoFormat.js", "../../packages/engine/Source/Scene/TimeDynamicImagery.js", "../../packages/engine/Source/Scene/WebMapServiceImageryProvider.js", "../../packages/engine/Source/Scene/WebMapTileServiceImageryProvider.js", "../../packages/engine/Source/Scene/IonImageryProvider.js", "../../packages/engine/Source/Scene/IonWorldImageryStyle.js", "../../packages/engine/Source/Scene/createWorldImageryAsync.js", "../../packages/engine/Source/Shaders/ReprojectWebMercatorFS.js", "../../packages/engine/Source/Shaders/ReprojectWebMercatorVS.js", "../../packages/engine/Source/Scene/Imagery.js", "../../packages/engine/Source/Scene/TileImagery.js", "../../packages/engine/Source/Scene/ImageryLayer.js", "../../packages/engine/Source/Core/TileEdge.js", "../../packages/engine/Source/Scene/TileSelectionResult.js", "../../packages/engine/Source/Scene/TerrainFillMesh.js", "../../packages/engine/Source/Scene/GlobeSurfaceTileProvider.js", "../../packages/engine/Source/Scene/GlobeTranslucency.js", "../../packages/engine/Source/Scene/ImageryLayerCollection.js", "../../packages/engine/Source/Scene/QuadtreeOccluders.js", "../../packages/engine/Source/Scene/QuadtreeTile.js", "../../packages/engine/Source/Scene/TileReplacementQueue.js", "../../packages/engine/Source/Scene/QuadtreePrimitive.js", "../../packages/engine/Source/Scene/Globe.js", "../../packages/engine/Source/Core/IauOrientationParameters.js", "../../packages/engine/Source/Core/Iau2000Orientation.js", "../../packages/engine/Source/Core/IauOrientationAxes.js", "../../packages/engine/Source/Shaders/EllipsoidFS.js", "../../packages/engine/Source/Shaders/EllipsoidVS.js", "../../packages/engine/Source/Scene/EllipsoidPrimitive.js", "../../packages/engine/Source/Scene/Moon.js", "../../packages/engine/Source/Core/mergeSort.js", "../../packages/engine/Source/Core/Occluder.js", "../../packages/engine/Source/Core/PerspectiveOffCenterFrustum.js", "../../packages/engine/Source/Core/PerspectiveFrustum.js", "../../packages/engine/Source/Shaders/BrdfLutGeneratorFS.js", "../../packages/engine/Source/Scene/BrdfLutGenerator.js", "../../packages/engine/Source/Scene/CameraFlightPath.js", "../../packages/engine/Source/Scene/MapMode2D.js", "../../packages/engine/Source/Scene/Camera.js", "../../packages/engine/Source/Scene/Cesium3DTilePassState.js", "../../packages/engine/Source/Scene/CreditDisplay.js", "../../packages/engine/Source/Core/FrustumGeometry.js", "../../packages/engine/Source/Core/FrustumOutlineGeometry.js", "../../packages/engine/Source/Scene/DebugCameraPrimitive.js", "../../packages/engine/Source/Shaders/DepthPlaneFS.js", "../../packages/engine/Source/Shaders/DepthPlaneVS.js", "../../packages/engine/Source/Scene/DepthPlane.js", "../../packages/engine/Source/Scene/DerivedCommand.js", "../../packages/engine/Source/Scene/DeviceOrientationCameraController.js", "../../packages/engine/Source/Scene/Fog.js", "../../packages/engine/Source/Scene/FrameState.js", "../../packages/engine/Source/Scene/GlobeTranslucencyState.js", "../../packages/engine/Source/Shaders/PostProcessStages/PassThrough.js", "../../packages/engine/Source/Scene/InvertClassification.js", "../../packages/engine/Source/Scene/JobScheduler.js", "../../packages/engine/Source/Scene/PerformanceDisplay.js", "../../packages/engine/Source/Scene/PickDepth.js", "../../packages/engine/Source/Scene/FrustumCommands.js", "../../packages/engine/Source/Shaders/PostProcessStages/PassThroughDepth.js", "../../packages/engine/Source/Scene/GlobeDepth.js", "../../packages/engine/Source/Scene/GlobeTranslucencyFramebuffer.js", "../../packages/engine/Source/Shaders/AdjustTranslucentFS.js", "../../packages/engine/Source/Shaders/CompositeOITFS.js", "../../packages/engine/Source/Scene/OIT.js", "../../packages/engine/Source/Scene/PickDepthFramebuffer.js", "../../packages/engine/Source/Scene/PickFramebuffer.js", "../../packages/engine/Source/Scene/SceneFramebuffer.js", "../../packages/engine/Source/Scene/ShadowMapShader.js", "../../packages/engine/Source/Scene/ShadowMap.js", "../../packages/engine/Source/Shaders/CompareAndPackTranslucentDepth.js", "../../packages/engine/Source/Shaders/PostProcessStages/CompositeTranslucentClassification.js", "../../packages/engine/Source/Scene/TranslucentTileClassification.js", "../../packages/engine/Source/Scene/View.js", "../../packages/engine/Source/Scene/Picking.js", "../../packages/engine/Source/Shaders/PostProcessStages/AcesTonemappingStage.js", "../../packages/engine/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js", "../../packages/engine/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.js", "../../packages/engine/Source/Shaders/PostProcessStages/BlackAndWhite.js", "../../packages/engine/Source/Shaders/PostProcessStages/BloomComposite.js", "../../packages/engine/Source/Shaders/PostProcessStages/Brightness.js", "../../packages/engine/Source/Shaders/PostProcessStages/ContrastBias.js", "../../packages/engine/Source/Shaders/PostProcessStages/DepthOfField.js", "../../packages/engine/Source/Shaders/PostProcessStages/DepthView.js", "../../packages/engine/Source/Shaders/PostProcessStages/EdgeDetection.js", "../../packages/engine/Source/Shaders/PostProcessStages/FilmicTonemapping.js", "../../packages/engine/Source/Shaders/PostProcessStages/FXAA.js", "../../packages/engine/Source/Shaders/PostProcessStages/GaussianBlur1D.js", "../../packages/engine/Source/Shaders/PostProcessStages/LensFlare.js", "../../packages/engine/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.js", "../../packages/engine/Source/Shaders/PostProcessStages/NightVision.js", "../../packages/engine/Source/Shaders/PostProcessStages/ReinhardTonemapping.js", "../../packages/engine/Source/Shaders/PostProcessStages/Silhouette.js", "../../packages/engine/Source/Shaders/FXAA3_11.js", "../../packages/engine/Source/Scene/AutoExposure.js", "../../packages/engine/Source/Scene/PostProcessStageSampleMode.js", "../../packages/engine/Source/Scene/PostProcessStage.js", "../../packages/engine/Source/Scene/PostProcessStageComposite.js", "../../packages/engine/Source/Scene/PostProcessStageLibrary.js", "../../packages/engine/Source/Scene/PostProcessStageTextureCache.js", "../../packages/engine/Source/Scene/Tonemapper.js", "../../packages/engine/Source/Scene/PostProcessStageCollection.js", "../../packages/engine/Source/Core/KeyboardEventModifier.js", "../../packages/engine/Source/Core/ScreenSpaceEventType.js", "../../packages/engine/Source/Core/ScreenSpaceEventHandler.js", "../../packages/engine/Source/Scene/SceneTransitioner.js", "../../packages/engine/Source/Scene/CameraEventType.js", "../../packages/engine/Source/Scene/CameraEventAggregator.js", "../../packages/engine/Source/Scene/TweenCollection.js", "../../packages/engine/Source/Scene/ScreenSpaceCameraController.js", "../../packages/engine/Source/Shaders/PostProcessStages/AdditiveBlend.js", "../../packages/engine/Source/Shaders/PostProcessStages/BrightPass.js", "../../packages/engine/Source/Scene/SunPostProcess.js", "../../packages/engine/Source/Scene/DebugInspector.js", "../../packages/engine/Source/Scene/Scene.js", "../../packages/engine/Source/Shaders/SkyAtmosphereCommon.js", "../../packages/engine/Source/Shaders/SkyAtmosphereFS.js", "../../packages/engine/Source/Shaders/SkyAtmosphereVS.js", "../../packages/engine/Source/Scene/SkyAtmosphere.js", "../../packages/engine/Source/Shaders/SkyBoxFS.js", "../../packages/engine/Source/Shaders/SkyBoxVS.js", "../../packages/engine/Source/Scene/SkyBox.js", "../../packages/engine/Source/Shaders/SunFS.js", "../../packages/engine/Source/Shaders/SunTextureFS.js", "../../packages/engine/Source/Shaders/SunVS.js", "../../packages/engine/Source/Scene/Sun.js", "../../packages/engine/Source/Widget/CesiumWidget.js", "../../packages/engine/Source/Shaders/CloudCollectionFS.js", "../../packages/engine/Source/Shaders/CloudCollectionVS.js", "../../packages/engine/Source/Shaders/CloudNoiseFS.js", "../../packages/engine/Source/Shaders/CloudNoiseVS.js", "../../packages/engine/Source/Shaders/ViewportQuadFS.js", "../../packages/engine/Source/Core/TileAvailability.js", "../../packages/engine/Source/Core/ArcGISTiledElevationTerrainProvider.js", "../../packages/engine/Source/Core/BingMapsGeocoderService.js", "../../packages/engine/Source/Core/CartographicGeocoderService.js", "../../packages/engine/Source/Core/CatmullRomSpline.js", "../../packages/engine/Source/Core/Intersections2D.js", "../../packages/engine/Source/Core/QuantizedMeshTerrainData.js", "../../packages/engine/Source/Core/CesiumTerrainProvider.js", "../../packages/engine/Source/Core/CircleGeometry.js", "../../packages/engine/Source/Core/CircleOutlineGeometry.js", "../../packages/engine/Source/Core/CustomHeightmapTerrainProvider.js", "../../packages/engine/Source/Core/DefaultProxy.js", "../../packages/engine/Source/Core/DoubleEndedPriorityQueue.js", "../../packages/engine/Source/Core/GeocodeType.js", "../../packages/engine/Source/Core/GeocoderService.js", "../../packages/engine/Source/Core/GeometryFactory.js", "../../packages/engine/Source/Core/GoogleEarthEnterpriseMetadata.js", "../../packages/engine/Source/Core/isBitSet.js", "../../packages/engine/Source/Core/GoogleEarthEnterpriseTileInformation.js", "../../packages/engine/Source/Core/GoogleEarthEnterpriseTerrainData.js", "../../packages/engine/Source/Core/GoogleEarthEnterpriseTerrainProvider.js", "../../packages/engine/Source/Core/GoogleMaps.js", "../../packages/engine/Source/Core/InterpolationAlgorithm.js", "../../packages/engine/Source/Core/PeliasGeocoderService.js", "../../packages/engine/Source/Core/IonGeocoderService.js", "../../packages/engine/Source/Core/MapProjection.js", "../../packages/engine/Source/Core/MorphWeightSpline.js", "../../packages/engine/Source/Core/OpenCageGeocoderService.js", "../../packages/engine/Source/Core/Packable.js", "../../packages/engine/Source/Core/PackableForInterpolation.js", "../../packages/engine/Source/Core/Proxy.js", "../../packages/engine/Source/Core/SimplePolylineGeometry.js", "../../packages/engine/Source/Core/SphereGeometry.js", "../../packages/engine/Source/Core/TilingScheme.js", "../../packages/engine/Source/Core/VRTheWorldTerrainProvider.js", "../../packages/engine/Source/Core/VideoSynchronizer.js", "../../packages/engine/Source/Core/VulkanConstants.js", "../../packages/engine/Source/Core/createWorldTerrainAsync.js", "../../packages/engine/Source/Core/decodeGoogleEarthEnterpriseData.js", "../../packages/engine/Source/Core/getImageFromTypedArray.js", "../../packages/engine/Source/Core/pointInsideTriangle.js", "../../packages/engine/Source/Core/webGLConstantToGlslType.js", "../../packages/engine/Source/Core/wrapFunction.js", "../../packages/engine/Source/Scene/BoxEmitter.js", "../../packages/engine/Source/Scene/Cesium3DTileContent.js", "../../packages/engine/Source/Scene/ConditionsExpression.js", "../../packages/engine/Source/Scene/Cesium3DTileStyle.js", "../../packages/engine/Source/Scene/ImplicitSubtreeCache.js", "../../packages/engine/Source/Scene/VoxelBoxShape.js", "../../packages/engine/Source/Scene/VoxelContent.js", "../../packages/engine/Source/Scene/VoxelCylinderShape.js", "../../packages/engine/Source/Scene/VoxelEllipsoidShape.js", "../../packages/engine/Source/Scene/VoxelShapeType.js", "../../packages/engine/Source/Scene/Cesium3DTilesVoxelProvider.js", "../../packages/engine/Source/Scene/CircleEmitter.js", "../../packages/engine/Source/Scene/CloudType.js", "../../packages/engine/Source/Scene/CumulusCloud.js", "../../packages/engine/Source/Scene/CloudCollection.js", "../../packages/engine/Source/Scene/ConeEmitter.js", "../../packages/engine/Source/Scene/DebugAppearance.js", "../../packages/engine/Source/Scene/DebugModelMatrixPrimitive.js", "../../packages/engine/Source/Scene/DirectionalLight.js", "../../packages/engine/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.js", "../../packages/engine/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceVS.js", "../../packages/engine/Source/Scene/EllipsoidSurfaceAppearance.js", "../../packages/engine/Source/Scene/FrameRateMonitor.js", "../../packages/engine/Source/Scene/GoogleEarthEnterpriseImageryProvider.js", "../../packages/engine/Source/Scene/GridImageryProvider.js", "../../packages/engine/Source/Scene/I3SDecoder.js", "../../packages/engine/Source/Scene/I3SFeature.js", "../../packages/engine/Source/Scene/I3SField.js", "../../packages/engine/Source/Scene/I3SGeometry.js", "../../packages/engine/Source/Scene/I3SNode.js", "../../packages/engine/Source/Scene/I3SLayer.js", "../../packages/engine/Source/Scene/I3SDataProvider.js", "../../packages/engine/Source/Scene/KeyframeNode.js", "../../packages/engine/Source/Scene/Light.js", "../../packages/engine/Source/Scene/MapboxStyleImageryProvider.js", "../../packages/engine/Source/Scene/Megatexture.js", "../../packages/engine/Source/Scene/NeverTileDiscardPolicy.js", "../../packages/engine/Source/Scene/OpenStreetMapImageryProvider.js", "../../packages/engine/Source/Scene/Particle.js", "../../packages/engine/Source/Scene/ParticleBurst.js", "../../packages/engine/Source/Scene/ParticleEmitter.js", "../../packages/engine/Source/Scene/ParticleSystem.js", "../../packages/engine/Source/Scene/PointCloud.js", "../../packages/engine/Source/Scene/getClipAndStyleCode.js", "../../packages/engine/Source/Scene/Splitter.js", "../../packages/engine/Source/Scene/QuadtreeTileProvider.js", "../../packages/engine/Source/Scene/SpatialNode.js", "../../packages/engine/Source/Scene/SphereEmitter.js", "../../packages/engine/Source/Scene/StyleExpression.js", "../../packages/engine/Source/Scene/Terrain.js", "../../packages/engine/Source/Scene/TileBoundingVolume.js", "../../packages/engine/Source/Scene/TileCoordinatesImageryProvider.js", "../../packages/engine/Source/Scene/TileDiscardPolicy.js", "../../packages/engine/Source/Scene/TileState.js", "../../packages/engine/Source/Scene/TimeDynamicPointCloud.js", "../../packages/engine/Source/Scene/ViewportQuad.js", "../../packages/engine/Source/Shaders/Voxels/VoxelFS.js", "../../packages/engine/Source/Shaders/Voxels/VoxelVS.js", "../../packages/engine/Source/Shaders/Voxels/IntersectionUtils.js", "../../packages/engine/Source/Shaders/Voxels/IntersectDepth.js", "../../packages/engine/Source/Shaders/Voxels/IntersectClippingPlanes.js", "../../packages/engine/Source/Shaders/Voxels/IntersectBox.js", "../../packages/engine/Source/Shaders/Voxels/IntersectCylinder.js", "../../packages/engine/Source/Shaders/Voxels/IntersectEllipsoid.js", "../../packages/engine/Source/Shaders/Voxels/Intersection.js", "../../packages/engine/Source/Shaders/Voxels/convertUvToBox.js", "../../packages/engine/Source/Shaders/Voxels/convertUvToCylinder.js", "../../packages/engine/Source/Shaders/Voxels/convertUvToEllipsoid.js", "../../packages/engine/Source/Shaders/Voxels/Octree.js", "../../packages/engine/Source/Shaders/Voxels/Megatexture.js", "../../packages/engine/Source/Scene/VoxelRenderResources.js", "../../packages/engine/Source/Scene/processVoxelProperties.js", "../../packages/engine/Source/Scene/buildVoxelDrawCommands.js", "../../packages/engine/Source/Scene/VoxelTraversal.js", "../../packages/engine/Source/Scene/Model/UniformType.js", "../../packages/engine/Source/Scene/Model/TextureManager.js", "../../packages/engine/Source/Scene/Model/CustomShader.js", "../../packages/engine/Source/Scene/VoxelPrimitive.js", "../../packages/engine/Source/Scene/VoxelProvider.js", "../../packages/engine/Source/Scene/VoxelShape.js", "../../packages/engine/Source/Scene/computeFlyToLocationForRectangle.js", "../../packages/engine/Source/Scene/createElevationBandMaterial.js", "../../packages/engine/Source/Scene/createGooglePhotorealistic3DTileset.js", "../../packages/engine/Source/Scene/createOsmBuildingsAsync.js", "../../packages/engine/Source/Scene/createTangentSpaceDebugPrimitive.js", "../../packages/engine/Source/Shaders/PostProcessStages/DepthViewPacked.js", "../../packages/engine/Source/Scene/Model/TextureUniform.js", "../../packages/engine/Source/Scene/Model/VaryingType.js", "../../packages/engine/Source/Workers/createTaskProcessorWorker.js", "../../packages/engine/index.js", "../../packages/widgets/Source/ThirdParty/knockout-3.5.1.js", "../../packages/widgets/Source/ThirdParty/knockout-es5.js", "../../packages/widgets/Source/SvgPathBindingHandler.js", "../../packages/widgets/Source/ThirdParty/knockout.js", "../../packages/widgets/Source/ClockViewModel.js", "../../packages/widgets/Source/Command.js", "../../packages/widgets/Source/InspectorShared.js", "../../packages/widgets/Source/ToggleButtonViewModel.js", "../../packages/widgets/Source/createCommand.js", "../../packages/widgets/Source/subscribeAndEvaluate.js", "../../packages/widgets/Source/Animation/Animation.js", "../../packages/widgets/Source/Animation/AnimationViewModel.js", "../../packages/widgets/Source/CesiumInspector/CesiumInspectorViewModel.js", "../../packages/widgets/Source/CesiumInspector/CesiumInspector.js", "../../packages/widgets/Source/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js", "../../packages/widgets/Source/Cesium3DTilesInspector/Cesium3DTilesInspector.js", "../../packages/widgets/Source/BaseLayerPicker/BaseLayerPickerViewModel.js", "../../packages/widgets/Source/BaseLayerPicker/BaseLayerPicker.js", "../../packages/widgets/Source/BaseLayerPicker/ProviderViewModel.js", "../../packages/widgets/Source/BaseLayerPicker/createDefaultImageryProviderViewModels.js", "../../packages/widgets/Source/BaseLayerPicker/createDefaultTerrainProviderViewModels.js", "../../packages/widgets/Source/FullscreenButton/FullscreenButtonViewModel.js", "../../packages/widgets/Source/FullscreenButton/FullscreenButton.js", "../../packages/widgets/Source/Geocoder/GeocoderViewModel.js", "../../packages/widgets/Source/Geocoder/Geocoder.js", "../../packages/widgets/Source/HomeButton/HomeButtonViewModel.js", "../../packages/widgets/Source/HomeButton/HomeButton.js", "../../packages/widgets/Source/InfoBox/InfoBoxViewModel.js", "../../packages/widgets/Source/InfoBox/InfoBox.js", "../../packages/widgets/Source/NavigationHelpButton/NavigationHelpButtonViewModel.js", "../../packages/widgets/Source/NavigationHelpButton/NavigationHelpButton.js", "../../packages/widgets/Source/PerformanceWatchdog/PerformanceWatchdogViewModel.js", "../../packages/widgets/Source/PerformanceWatchdog/PerformanceWatchdog.js", "../../packages/widgets/Source/ProjectionPicker/ProjectionPickerViewModel.js", "../../packages/widgets/Source/ProjectionPicker/ProjectionPicker.js", "../../packages/widgets/Source/SceneModePicker/SceneModePickerViewModel.js", "../../packages/widgets/Source/SceneModePicker/SceneModePicker.js", "../../packages/widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js", "../../packages/widgets/Source/SelectionIndicator/SelectionIndicator.js", "../../packages/widgets/Source/Timeline/TimelineHighlightRange.js", "../../packages/widgets/Source/Timeline/TimelineTrack.js", "../../packages/widgets/Source/Timeline/Timeline.js", "../../packages/widgets/Source/VRButton/VRButtonViewModel.js", "../../packages/widgets/Source/VRButton/VRButton.js", "../../packages/widgets/Source/Viewer/Viewer.js", "../../packages/widgets/Source/Viewer/viewerCesium3DTilesInspectorMixin.js", "../../packages/widgets/Source/Viewer/viewerCesiumInspectorMixin.js", "../../packages/widgets/Source/Viewer/viewerDragDropMixin.js", "../../packages/widgets/Source/Viewer/viewerPerformanceWatchdogMixin.js", "../../packages/widgets/Source/VoxelInspector/VoxelInspectorViewModel.js", "../../packages/widgets/Source/VoxelInspector/VoxelInspector.js", "../../packages/widgets/Source/Viewer/viewerVoxelInspectorMixin.js", "../../packages/widgets/index.js"],
  "sourcesContent": ["/*\n  https://github.com/banksean wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace\n  so it's better encapsulated. Now you can have multiple random number generators\n  and they won't stomp all over eachother's state.\n\n  If you want to use this as a substitute for Math.random(), use the random()\n  method like so:\n\n  var m = new MersenneTwister();\n  var randomNumber = m.random();\n\n  You can also call the other genrand_{foo}() methods on the instance.\n\n  If you want to use a specific seed in order to get a repeatable random\n  sequence, pass an integer into the constructor:\n\n  var m = new MersenneTwister(123);\n\n  and that will always produce the same random sequence.\n\n  Sean McCullough (banksean@gmail.com)\n*/\n\n/*\n   A C-program for MT19937, with initialization improved 2002/1/26.\n   Coded by Takuji Nishimura and Makoto Matsumoto.\n\n   Before using, initialize the state by using init_seed(seed)\n   or init_by_array(init_key, key_length).\n\n   Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n   All rights reserved.\n\n   Redistribution and use in source and binary forms, with or without\n   modification, are permitted provided that the following conditions\n   are met:\n\n     1. Redistributions of source code must retain the above copyright\n        notice, this list of conditions and the following disclaimer.\n\n     2. Redistributions in binary form must reproduce the above copyright\n        notice, this list of conditions and the following disclaimer in the\n        documentation and/or other materials provided with the distribution.\n\n     3. The names of its contributors may not be used to endorse or promote\n        products derived from this software without specific prior written\n        permission.\n\n   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n   Any feedback is very welcome.\n   http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\n   email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)\n*/\n\nvar MersenneTwister = function(seed) {\n\tif (seed == undefined) {\n\t\tseed = new Date().getTime();\n\t}\n\n\t/* Period parameters */\n\tthis.N = 624;\n\tthis.M = 397;\n\tthis.MATRIX_A = 0x9908b0df;   /* constant vector a */\n\tthis.UPPER_MASK = 0x80000000; /* most significant w-r bits */\n\tthis.LOWER_MASK = 0x7fffffff; /* least significant r bits */\n\n\tthis.mt = new Array(this.N); /* the array for the state vector */\n\tthis.mti=this.N+1; /* mti==N+1 means mt[N] is not initialized */\n\n\tif (seed.constructor == Array) {\n\t\tthis.init_by_array(seed, seed.length);\n\t}\n\telse {\n\t\tthis.init_seed(seed);\n\t}\n}\n\n/* initializes mt[N] with a seed */\n/* origin name init_genrand */\nMersenneTwister.prototype.init_seed = function(s) {\n\tthis.mt[0] = s >>> 0;\n\tfor (this.mti=1; this.mti<this.N; this.mti++) {\n\t\tvar s = this.mt[this.mti-1] ^ (this.mt[this.mti-1] >>> 30);\n\t\tthis.mt[this.mti] = (((((s & 0xffff0000) >>> 16) * 1812433253) << 16) + (s & 0x0000ffff) * 1812433253)\n\t\t+ this.mti;\n\t\t/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */\n\t\t/* In the previous versions, MSBs of the seed affect   */\n\t\t/* only MSBs of the array mt[].                        */\n\t\t/* 2002/01/09 modified by Makoto Matsumoto             */\n\t\tthis.mt[this.mti] >>>= 0;\n\t\t/* for >32 bit machines */\n\t}\n}\n\n/* initialize by an array with array-length */\n/* init_key is the array for initializing keys */\n/* key_length is its length */\n/* slight change for C++, 2004/2/26 */\nMersenneTwister.prototype.init_by_array = function(init_key, key_length) {\n\tvar i, j, k;\n\tthis.init_seed(19650218);\n\ti=1; j=0;\n\tk = (this.N>key_length ? this.N : key_length);\n\tfor (; k; k--) {\n\t\tvar s = this.mt[i-1] ^ (this.mt[i-1] >>> 30)\n\t\tthis.mt[i] = (this.mt[i] ^ (((((s & 0xffff0000) >>> 16) * 1664525) << 16) + ((s & 0x0000ffff) * 1664525)))\n\t\t+ init_key[j] + j; /* non linear */\n\t\tthis.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n\t\ti++; j++;\n\t\tif (i>=this.N) { this.mt[0] = this.mt[this.N-1]; i=1; }\n\t\tif (j>=key_length) j=0;\n\t}\n\tfor (k=this.N-1; k; k--) {\n\t\tvar s = this.mt[i-1] ^ (this.mt[i-1] >>> 30);\n\t\tthis.mt[i] = (this.mt[i] ^ (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) + (s & 0x0000ffff) * 1566083941))\n\t\t- i; /* non linear */\n\t\tthis.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n\t\ti++;\n\t\tif (i>=this.N) { this.mt[0] = this.mt[this.N-1]; i=1; }\n\t}\n\n\tthis.mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */\n}\n\n/* generates a random number on [0,0xffffffff]-interval */\n/* origin name genrand_int32 */\nMersenneTwister.prototype.random_int = function() {\n\tvar y;\n\tvar mag01 = new Array(0x0, this.MATRIX_A);\n\t/* mag01[x] = x * MATRIX_A  for x=0,1 */\n\n\tif (this.mti >= this.N) { /* generate N words at one time */\n\t\tvar kk;\n\n\t\tif (this.mti == this.N+1)  /* if init_seed() has not been called, */\n\t\t\tthis.init_seed(5489);  /* a default initial seed is used */\n\n\t\tfor (kk=0;kk<this.N-this.M;kk++) {\n\t\t\ty = (this.mt[kk]&this.UPPER_MASK)|(this.mt[kk+1]&this.LOWER_MASK);\n\t\t\tthis.mt[kk] = this.mt[kk+this.M] ^ (y >>> 1) ^ mag01[y & 0x1];\n\t\t}\n\t\tfor (;kk<this.N-1;kk++) {\n\t\t\ty = (this.mt[kk]&this.UPPER_MASK)|(this.mt[kk+1]&this.LOWER_MASK);\n\t\t\tthis.mt[kk] = this.mt[kk+(this.M-this.N)] ^ (y >>> 1) ^ mag01[y & 0x1];\n\t\t}\n\t\ty = (this.mt[this.N-1]&this.UPPER_MASK)|(this.mt[0]&this.LOWER_MASK);\n\t\tthis.mt[this.N-1] = this.mt[this.M-1] ^ (y >>> 1) ^ mag01[y & 0x1];\n\n\t\tthis.mti = 0;\n\t}\n\n\ty = this.mt[this.mti++];\n\n\t/* Tempering */\n\ty ^= (y >>> 11);\n\ty ^= (y << 7) & 0x9d2c5680;\n\ty ^= (y << 15) & 0xefc60000;\n\ty ^= (y >>> 18);\n\n\treturn y >>> 0;\n}\n\n/* generates a random number on [0,0x7fffffff]-interval */\n/* origin name genrand_int31 */\nMersenneTwister.prototype.random_int31 = function() {\n\treturn (this.random_int()>>>1);\n}\n\n/* generates a random number on [0,1]-real-interval */\n/* origin name genrand_real1 */\nMersenneTwister.prototype.random_incl = function() {\n\treturn this.random_int()*(1.0/4294967295.0);\n\t/* divided by 2^32-1 */\n}\n\n/* generates a random number on [0,1)-real-interval */\nMersenneTwister.prototype.random = function() {\n\treturn this.random_int()*(1.0/4294967296.0);\n\t/* divided by 2^32 */\n}\n\n/* generates a random number on (0,1)-real-interval */\n/* origin name genrand_real3 */\nMersenneTwister.prototype.random_excl = function() {\n\treturn (this.random_int() + 0.5)*(1.0/4294967296.0);\n\t/* divided by 2^32 */\n}\n\n/* generates a random number on [0,1) with 53-bit resolution*/\n/* origin name genrand_res53 */\nMersenneTwister.prototype.random_long = function() {\n\tvar a=this.random_int()>>>5, b=this.random_int()>>>6;\n\treturn(a*67108864.0+b)*(1.0/9007199254740992.0);\n}\n\n/* These real versions are due to Isaku Wada, 2002/01/09 added */\n\nmodule.exports = MersenneTwister;\n", "/*! https://mths.be/punycode v1.4.0 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = typeof module == 'object' && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow new RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t    counter = 0,\n\t\t    length = string.length,\n\t\t    value,\n\t\t    extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t//  0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * https://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t    inputLength = input.length,\n\t\t    out,\n\t\t    i = 0,\n\t\t    n = initialN,\n\t\t    bias = initialBias,\n\t\t    basic,\n\t\t    j,\n\t\t    index,\n\t\t    oldi,\n\t\t    w,\n\t\t    k,\n\t\t    digit,\n\t\t    t,\n\t\t    /** Cached calculation results */\n\t\t    baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t    delta,\n\t\t    handledCPCount,\n\t\t    basicLength,\n\t\t    bias,\n\t\t    j,\n\t\t    m,\n\t\t    q,\n\t\t    k,\n\t\t    t,\n\t\t    currentValue,\n\t\t    output = [],\n\t\t    /** `inputLength` will hold the number of code points in `input`. */\n\t\t    inputLength,\n\t\t    /** Cached calculation results */\n\t\t    handledCPCountPlusOne,\n\t\t    baseMinusT,\n\t\t    qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.3.2',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine('punycode', function() {\n\t\t\treturn punycode;\n\t\t});\n\t} else if (freeExports && freeModule) {\n\t\tif (module.exports == freeExports) {\n\t\t\t// in Node.js, io.js, or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = punycode;\n\t\t} else {\n\t\t\t// in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (key in punycode) {\n\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// in Rhino or a web browser\n\t\troot.punycode = punycode;\n\t}\n\n}(this));\n", "/*!\n * URI.js - Mutating URLs\n * IPv6 Support\n *\n * Version: 1.19.11\n *\n * Author: Rodney Rehm\n * Web: http://medialize.github.io/URI.js/\n *\n * Licensed under\n *   MIT License http://www.opensource.org/licenses/mit-license\n *\n */\n\n(function (root, factory) {\n  'use strict';\n  // https://github.com/umdjs/umd/blob/master/returnExports.js\n  if (typeof module === 'object' && module.exports) {\n    // Node\n    module.exports = factory();\n  } else if (typeof define === 'function' && define.amd) {\n    // AMD. Register as an anonymous module.\n    define(factory);\n  } else {\n    // Browser globals (root is window)\n    root.IPv6 = factory(root);\n  }\n}(this, function (root) {\n  'use strict';\n\n  /*\n  var _in = \"fe80:0000:0000:0000:0204:61ff:fe9d:f156\";\n  var _out = IPv6.best(_in);\n  var _expected = \"fe80::204:61ff:fe9d:f156\";\n\n  console.log(_in, _out, _expected, _out === _expected);\n  */\n\n  // save current IPv6 variable, if any\n  var _IPv6 = root && root.IPv6;\n\n  function bestPresentation(address) {\n    // based on:\n    // Javascript to test an IPv6 address for proper format, and to\n    // present the \"best text representation\" according to IETF Draft RFC at\n    // http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04\n    // 8 Feb 2010 Rich Brown, Dartware, LLC\n    // Please feel free to use this code as long as you provide a link to\n    // http://www.intermapper.com\n    // http://intermapper.com/support/tools/IPV6-Validator.aspx\n    // http://download.dartware.com/thirdparty/ipv6validator.js\n\n    var _address = address.toLowerCase();\n    var segments = _address.split(':');\n    var length = segments.length;\n    var total = 8;\n\n    // trim colons (:: or ::a:b:c\u2026 or \u2026a:b:c::)\n    if (segments[0] === '' && segments[1] === '' && segments[2] === '') {\n      // must have been ::\n      // remove first two items\n      segments.shift();\n      segments.shift();\n    } else if (segments[0] === '' && segments[1] === '') {\n      // must have been ::xxxx\n      // remove the first item\n      segments.shift();\n    } else if (segments[length - 1] === '' && segments[length - 2] === '') {\n      // must have been xxxx::\n      segments.pop();\n    }\n\n    length = segments.length;\n\n    // adjust total segments for IPv4 trailer\n    if (segments[length - 1].indexOf('.') !== -1) {\n      // found a \".\" which means IPv4\n      total = 7;\n    }\n\n    // fill empty segments them with \"0000\"\n    var pos;\n    for (pos = 0; pos < length; pos++) {\n      if (segments[pos] === '') {\n        break;\n      }\n    }\n\n    if (pos < total) {\n      segments.splice(pos, 1, '0000');\n      while (segments.length < total) {\n        segments.splice(pos, 0, '0000');\n      }\n    }\n\n    // strip leading zeros\n    var _segments;\n    for (var i = 0; i < total; i++) {\n      _segments = segments[i].split('');\n      for (var j = 0; j < 3 ; j++) {\n        if (_segments[0] === '0' && _segments.length > 1) {\n          _segments.splice(0,1);\n        } else {\n          break;\n        }\n      }\n\n      segments[i] = _segments.join('');\n    }\n\n    // find longest sequence of zeroes and coalesce them into one segment\n    var best = -1;\n    var _best = 0;\n    var _current = 0;\n    var current = -1;\n    var inzeroes = false;\n    // i; already declared\n\n    for (i = 0; i < total; i++) {\n      if (inzeroes) {\n        if (segments[i] === '0') {\n          _current += 1;\n        } else {\n          inzeroes = false;\n          if (_current > _best) {\n            best = current;\n            _best = _current;\n          }\n        }\n      } else {\n        if (segments[i] === '0') {\n          inzeroes = true;\n          current = i;\n          _current = 1;\n        }\n      }\n    }\n\n    if (_current > _best) {\n      best = current;\n      _best = _current;\n    }\n\n    if (_best > 1) {\n      segments.splice(best, _best, '');\n    }\n\n    length = segments.length;\n\n    // assemble remaining segments\n    var result = '';\n    if (segments[0] === '')  {\n      result = ':';\n    }\n\n    for (i = 0; i < length; i++) {\n      result += segments[i];\n      if (i === length - 1) {\n        break;\n      }\n\n      result += ':';\n    }\n\n    if (segments[length - 1] === '') {\n      result += ':';\n    }\n\n    return result;\n  }\n\n  function noConflict() {\n    /*jshint validthis: true */\n    if (root.IPv6 === this) {\n      root.IPv6 = _IPv6;\n    }\n\n    return this;\n  }\n\n  return {\n    best: bestPresentation,\n    noConflict: noConflict\n  };\n}));\n", "/*!\n * URI.js - Mutating URLs\n * Second Level Domain (SLD) Support\n *\n * Version: 1.19.11\n *\n * Author: Rodney Rehm\n * Web: http://medialize.github.io/URI.js/\n *\n * Licensed under\n *   MIT License http://www.opensource.org/licenses/mit-license\n *\n */\n\n(function (root, factory) {\n  'use strict';\n  // https://github.com/umdjs/umd/blob/master/returnExports.js\n  if (typeof module === 'object' && module.exports) {\n    // Node\n    module.exports = factory();\n  } else if (typeof define === 'function' && define.amd) {\n    // AMD. Register as an anonymous module.\n    define(factory);\n  } else {\n    // Browser globals (root is window)\n    root.SecondLevelDomains = factory(root);\n  }\n}(this, function (root) {\n  'use strict';\n\n  // save current SecondLevelDomains variable, if any\n  var _SecondLevelDomains = root && root.SecondLevelDomains;\n\n  var SLD = {\n    // list of known Second Level Domains\n    // converted list of SLDs from https://github.com/gavingmiller/second-level-domains\n    // ----\n    // publicsuffix.org is more current and actually used by a couple of browsers internally.\n    // downside is it also contains domains like \"dyndns.org\" - which is fine for the security\n    // issues browser have to deal with (SOP for cookies, etc) - but is way overboard for URI.js\n    // ----\n    list: {\n      'ac':' com gov mil net org ',\n      'ae':' ac co gov mil name net org pro sch ',\n      'af':' com edu gov net org ',\n      'al':' com edu gov mil net org ',\n      'ao':' co ed gv it og pb ',\n      'ar':' com edu gob gov int mil net org tur ',\n      'at':' ac co gv or ',\n      'au':' asn com csiro edu gov id net org ',\n      'ba':' co com edu gov mil net org rs unbi unmo unsa untz unze ',\n      'bb':' biz co com edu gov info net org store tv ',\n      'bh':' biz cc com edu gov info net org ',\n      'bn':' com edu gov net org ',\n      'bo':' com edu gob gov int mil net org tv ',\n      'br':' adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ',\n      'bs':' com edu gov net org ',\n      'bz':' du et om ov rg ',\n      'ca':' ab bc mb nb nf nl ns nt nu on pe qc sk yk ',\n      'ck':' biz co edu gen gov info net org ',\n      'cn':' ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ',\n      'co':' com edu gov mil net nom org ',\n      'cr':' ac c co ed fi go or sa ',\n      'cy':' ac biz com ekloges gov ltd name net org parliament press pro tm ',\n      'do':' art com edu gob gov mil net org sld web ',\n      'dz':' art asso com edu gov net org pol ',\n      'ec':' com edu fin gov info med mil net org pro ',\n      'eg':' com edu eun gov mil name net org sci ',\n      'er':' com edu gov ind mil net org rochest w ',\n      'es':' com edu gob nom org ',\n      'et':' biz com edu gov info name net org ',\n      'fj':' ac biz com info mil name net org pro ',\n      'fk':' ac co gov net nom org ',\n      'fr':' asso com f gouv nom prd presse tm ',\n      'gg':' co net org ',\n      'gh':' com edu gov mil org ',\n      'gn':' ac com gov net org ',\n      'gr':' com edu gov mil net org ',\n      'gt':' com edu gob ind mil net org ',\n      'gu':' com edu gov net org ',\n      'hk':' com edu gov idv net org ',\n      'hu':' 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ',\n      'id':' ac co go mil net or sch web ',\n      'il':' ac co gov idf k12 muni net org ',\n      'in':' ac co edu ernet firm gen gov i ind mil net nic org res ',\n      'iq':' com edu gov i mil net org ',\n      'ir':' ac co dnssec gov i id net org sch ',\n      'it':' edu gov ',\n      'je':' co net org ',\n      'jo':' com edu gov mil name net org sch ',\n      'jp':' ac ad co ed go gr lg ne or ',\n      'ke':' ac co go info me mobi ne or sc ',\n      'kh':' com edu gov mil net org per ',\n      'ki':' biz com de edu gov info mob net org tel ',\n      'km':' asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ',\n      'kn':' edu gov net org ',\n      'kr':' ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ',\n      'kw':' com edu gov net org ',\n      'ky':' com edu gov net org ',\n      'kz':' com edu gov mil net org ',\n      'lb':' com edu gov net org ',\n      'lk':' assn com edu gov grp hotel int ltd net ngo org sch soc web ',\n      'lr':' com edu gov net org ',\n      'lv':' asn com conf edu gov id mil net org ',\n      'ly':' com edu gov id med net org plc sch ',\n      'ma':' ac co gov m net org press ',\n      'mc':' asso tm ',\n      'me':' ac co edu gov its net org priv ',\n      'mg':' com edu gov mil nom org prd tm ',\n      'mk':' com edu gov inf name net org pro ',\n      'ml':' com edu gov net org presse ',\n      'mn':' edu gov org ',\n      'mo':' com edu gov net org ',\n      'mt':' com edu gov net org ',\n      'mv':' aero biz com coop edu gov info int mil museum name net org pro ',\n      'mw':' ac co com coop edu gov int museum net org ',\n      'mx':' com edu gob net org ',\n      'my':' com edu gov mil name net org sch ',\n      'nf':' arts com firm info net other per rec store web ',\n      'ng':' biz com edu gov mil mobi name net org sch ',\n      'ni':' ac co com edu gob mil net nom org ',\n      'np':' com edu gov mil net org ',\n      'nr':' biz com edu gov info net org ',\n      'om':' ac biz co com edu gov med mil museum net org pro sch ',\n      'pe':' com edu gob mil net nom org sld ',\n      'ph':' com edu gov i mil net ngo org ',\n      'pk':' biz com edu fam gob gok gon gop gos gov net org web ',\n      'pl':' art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ',\n      'pr':' ac biz com edu est gov info isla name net org pro prof ',\n      'ps':' com edu gov net org plo sec ',\n      'pw':' belau co ed go ne or ',\n      'ro':' arts com firm info nom nt org rec store tm www ',\n      'rs':' ac co edu gov in org ',\n      'sb':' com edu gov net org ',\n      'sc':' com edu gov net org ',\n      'sh':' co com edu gov net nom org ',\n      'sl':' com edu gov net org ',\n      'st':' co com consulado edu embaixada gov mil net org principe saotome store ',\n      'sv':' com edu gob org red ',\n      'sz':' ac co org ',\n      'tr':' av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ',\n      'tt':' aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ',\n      'tw':' club com ebiz edu game gov idv mil net org ',\n      'mu':' ac co com gov net or org ',\n      'mz':' ac co edu gov org ',\n      'na':' co com ',\n      'nz':' ac co cri geek gen govt health iwi maori mil net org parliament school ',\n      'pa':' abo ac com edu gob ing med net nom org sld ',\n      'pt':' com edu gov int net nome org publ ',\n      'py':' com edu gov mil net org ',\n      'qa':' com edu gov mil net org ',\n      're':' asso com nom ',\n      'ru':' ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ',\n      'rw':' ac co com edu gouv gov int mil net ',\n      'sa':' com edu gov med net org pub sch ',\n      'sd':' com edu gov info med net org tv ',\n      'se':' a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ',\n      'sg':' com edu gov idn net org per ',\n      'sn':' art com edu gouv org perso univ ',\n      'sy':' com edu gov mil net news org ',\n      'th':' ac co go in mi net or ',\n      'tj':' ac biz co com edu go gov info int mil name net nic org test web ',\n      'tn':' agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ',\n      'tz':' ac co go ne or ',\n      'ua':' biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ',\n      'ug':' ac co go ne or org sc ',\n      'uk':' ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ',\n      'us':' dni fed isa kids nsn ',\n      'uy':' com edu gub mil net org ',\n      've':' co com edu gob info mil net org web ',\n      'vi':' co com k12 net org ',\n      'vn':' ac biz com edu gov health info int name net org pro ',\n      'ye':' co com gov ltd me net org plc ',\n      'yu':' ac co edu gov org ',\n      'za':' ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ',\n      'zm':' ac co com edu gov net org sch ',\n      // https://en.wikipedia.org/wiki/CentralNic#Second-level_domains\n      'com': 'ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ',\n      'net': 'gb jp se uk ',\n      'org': 'ae',\n      'de': 'com '\n    },\n    // gorhill 2013-10-25: Using indexOf() instead Regexp(). Significant boost\n    // in both performance and memory footprint. No initialization required.\n    // http://jsperf.com/uri-js-sld-regex-vs-binary-search/4\n    // Following methods use lastIndexOf() rather than array.split() in order\n    // to avoid any memory allocations.\n    has: function(domain) {\n      var tldOffset = domain.lastIndexOf('.');\n      if (tldOffset <= 0 || tldOffset >= (domain.length-1)) {\n        return false;\n      }\n      var sldOffset = domain.lastIndexOf('.', tldOffset-1);\n      if (sldOffset <= 0 || sldOffset >= (tldOffset-1)) {\n        return false;\n      }\n      var sldList = SLD.list[domain.slice(tldOffset+1)];\n      if (!sldList) {\n        return false;\n      }\n      return sldList.indexOf(' ' + domain.slice(sldOffset+1, tldOffset) + ' ') >= 0;\n    },\n    is: function(domain) {\n      var tldOffset = domain.lastIndexOf('.');\n      if (tldOffset <= 0 || tldOffset >= (domain.length-1)) {\n        return false;\n      }\n      var sldOffset = domain.lastIndexOf('.', tldOffset-1);\n      if (sldOffset >= 0) {\n        return false;\n      }\n      var sldList = SLD.list[domain.slice(tldOffset+1)];\n      if (!sldList) {\n        return false;\n      }\n      return sldList.indexOf(' ' + domain.slice(0, tldOffset) + ' ') >= 0;\n    },\n    get: function(domain) {\n      var tldOffset = domain.lastIndexOf('.');\n      if (tldOffset <= 0 || tldOffset >= (domain.length-1)) {\n        return null;\n      }\n      var sldOffset = domain.lastIndexOf('.', tldOffset-1);\n      if (sldOffset <= 0 || sldOffset >= (tldOffset-1)) {\n        return null;\n      }\n      var sldList = SLD.list[domain.slice(tldOffset+1)];\n      if (!sldList) {\n        return null;\n      }\n      if (sldList.indexOf(' ' + domain.slice(sldOffset+1, tldOffset) + ' ') < 0) {\n        return null;\n      }\n      return domain.slice(sldOffset+1);\n    },\n    noConflict: function(){\n      if (root.SecondLevelDomains === this) {\n        root.SecondLevelDomains = _SecondLevelDomains;\n      }\n      return this;\n    }\n  };\n\n  return SLD;\n}));\n", "/*!\n * URI.js - Mutating URLs\n *\n * Version: 1.19.11\n *\n * Author: Rodney Rehm\n * Web: http://medialize.github.io/URI.js/\n *\n * Licensed under\n *   MIT License http://www.opensource.org/licenses/mit-license\n *\n */\n(function (root, factory) {\n  'use strict';\n  // https://github.com/umdjs/umd/blob/master/returnExports.js\n  if (typeof module === 'object' && module.exports) {\n    // Node\n    module.exports = factory(require('./punycode'), require('./IPv6'), require('./SecondLevelDomains'));\n  } else if (typeof define === 'function' && define.amd) {\n    // AMD. Register as an anonymous module.\n    define(['./punycode', './IPv6', './SecondLevelDomains'], factory);\n  } else {\n    // Browser globals (root is window)\n    root.URI = factory(root.punycode, root.IPv6, root.SecondLevelDomains, root);\n  }\n}(this, function (punycode, IPv6, SLD, root) {\n  'use strict';\n  /*global location, escape, unescape */\n  // FIXME: v2.0.0 renamce non-camelCase properties to uppercase\n  /*jshint camelcase: false */\n\n  // save current URI variable, if any\n  var _URI = root && root.URI;\n\n  function URI(url, base) {\n    var _urlSupplied = arguments.length >= 1;\n    var _baseSupplied = arguments.length >= 2;\n\n    // Allow instantiation without the 'new' keyword\n    if (!(this instanceof URI)) {\n      if (_urlSupplied) {\n        if (_baseSupplied) {\n          return new URI(url, base);\n        }\n\n        return new URI(url);\n      }\n\n      return new URI();\n    }\n\n    if (url === undefined) {\n      if (_urlSupplied) {\n        throw new TypeError('undefined is not a valid argument for URI');\n      }\n\n      if (typeof location !== 'undefined') {\n        url = location.href + '';\n      } else {\n        url = '';\n      }\n    }\n\n    if (url === null) {\n      if (_urlSupplied) {\n        throw new TypeError('null is not a valid argument for URI');\n      }\n    }\n\n    this.href(url);\n\n    // resolve to base according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#constructor\n    if (base !== undefined) {\n      return this.absoluteTo(base);\n    }\n\n    return this;\n  }\n\n  function isInteger(value) {\n    return /^[0-9]+$/.test(value);\n  }\n\n  URI.version = '1.19.11';\n\n  var p = URI.prototype;\n  var hasOwn = Object.prototype.hasOwnProperty;\n\n  function escapeRegEx(string) {\n    // https://github.com/medialize/URI.js/commit/85ac21783c11f8ccab06106dba9735a31a86924d#commitcomment-821963\n    return string.replace(/([.*+?^=!:${}()|[\\]\\/\\\\])/g, '\\\\$1');\n  }\n\n  function getType(value) {\n    // IE8 doesn't return [Object Undefined] but [Object Object] for undefined value\n    if (value === undefined) {\n      return 'Undefined';\n    }\n\n    return String(Object.prototype.toString.call(value)).slice(8, -1);\n  }\n\n  function isArray(obj) {\n    return getType(obj) === 'Array';\n  }\n\n  function filterArrayValues(data, value) {\n    var lookup = {};\n    var i, length;\n\n    if (getType(value) === 'RegExp') {\n      lookup = null;\n    } else if (isArray(value)) {\n      for (i = 0, length = value.length; i < length; i++) {\n        lookup[value[i]] = true;\n      }\n    } else {\n      lookup[value] = true;\n    }\n\n    for (i = 0, length = data.length; i < length; i++) {\n      /*jshint laxbreak: true */\n      var _match = lookup && lookup[data[i]] !== undefined\n        || !lookup && value.test(data[i]);\n      /*jshint laxbreak: false */\n      if (_match) {\n        data.splice(i, 1);\n        length--;\n        i--;\n      }\n    }\n\n    return data;\n  }\n\n  function arrayContains(list, value) {\n    var i, length;\n\n    // value may be string, number, array, regexp\n    if (isArray(value)) {\n      // Note: this can be optimized to O(n) (instead of current O(m * n))\n      for (i = 0, length = value.length; i < length; i++) {\n        if (!arrayContains(list, value[i])) {\n          return false;\n        }\n      }\n\n      return true;\n    }\n\n    var _type = getType(value);\n    for (i = 0, length = list.length; i < length; i++) {\n      if (_type === 'RegExp') {\n        if (typeof list[i] === 'string' && list[i].match(value)) {\n          return true;\n        }\n      } else if (list[i] === value) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  function arraysEqual(one, two) {\n    if (!isArray(one) || !isArray(two)) {\n      return false;\n    }\n\n    // arrays can't be equal if they have different amount of content\n    if (one.length !== two.length) {\n      return false;\n    }\n\n    one.sort();\n    two.sort();\n\n    for (var i = 0, l = one.length; i < l; i++) {\n      if (one[i] !== two[i]) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  function trimSlashes(text) {\n    var trim_expression = /^\\/+|\\/+$/g;\n    return text.replace(trim_expression, '');\n  }\n\n  URI._parts = function() {\n    return {\n      protocol: null,\n      username: null,\n      password: null,\n      hostname: null,\n      urn: null,\n      port: null,\n      path: null,\n      query: null,\n      fragment: null,\n      // state\n      preventInvalidHostname: URI.preventInvalidHostname,\n      duplicateQueryParameters: URI.duplicateQueryParameters,\n      escapeQuerySpace: URI.escapeQuerySpace\n    };\n  };\n  // state: throw on invalid hostname\n  // see https://github.com/medialize/URI.js/pull/345\n  // and https://github.com/medialize/URI.js/issues/354\n  URI.preventInvalidHostname = false;\n  // state: allow duplicate query parameters (a=1&a=1)\n  URI.duplicateQueryParameters = false;\n  // state: replaces + with %20 (space in query strings)\n  URI.escapeQuerySpace = true;\n  // static properties\n  URI.protocol_expression = /^[a-z][a-z0-9.+-]*$/i;\n  URI.idn_expression = /[^a-z0-9\\._-]/i;\n  URI.punycode_expression = /(xn--)/i;\n  // well, 333.444.555.666 matches, but it sure ain't no IPv4 - do we care?\n  URI.ip4_expression = /^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/;\n  // credits to Rich Brown\n  // source: http://forums.intermapper.com/viewtopic.php?p=1096#1096\n  // specification: http://www.ietf.org/rfc/rfc4291.txt\n  URI.ip6_expression = /^\\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*$/;\n  // expression used is \"gruber revised\" (@gruber v2) determined to be the\n  // best solution in a regex-golf we did a couple of ages ago at\n  // * http://mathiasbynens.be/demo/url-regex\n  // * http://rodneyrehm.de/t/url-regex.html\n  URI.find_uri_expression = /\\b((?:[a-z][\\w-]+:(?:\\/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?\u00AB\u00BB\u201C\u201D\u2018\u2019]))/ig;\n  URI.findUri = {\n    // valid \"scheme://\" or \"www.\"\n    start: /\\b(?:([a-z][a-z0-9.+-]*:\\/\\/)|www\\.)/gi,\n    // everything up to the next whitespace\n    end: /[\\s\\r\\n]|$/,\n    // trim trailing punctuation captured by end RegExp\n    trim: /[`!()\\[\\]{};:'\".,<>?\u00AB\u00BB\u201C\u201D\u201E\u2018\u2019]+$/,\n    // balanced parens inclusion (), [], {}, <>\n    parens: /(\\([^\\)]*\\)|\\[[^\\]]*\\]|\\{[^}]*\\}|<[^>]*>)/g,\n  };\n  URI.leading_whitespace_expression = /^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/\n  // https://infra.spec.whatwg.org/#ascii-tab-or-newline\n  URI.ascii_tab_whitespace = /[\\u0009\\u000A\\u000D]+/g\n  // http://www.iana.org/assignments/uri-schemes.html\n  // http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#Well-known_ports\n  URI.defaultPorts = {\n    http: '80',\n    https: '443',\n    ftp: '21',\n    gopher: '70',\n    ws: '80',\n    wss: '443'\n  };\n  // list of protocols which always require a hostname\n  URI.hostProtocols = [\n    'http',\n    'https'\n  ];\n\n  // allowed hostname characters according to RFC 3986\n  // ALPHA DIGIT \"-\" \".\" \"_\" \"~\" \"!\" \"$\" \"&\" \"'\" \"(\" \")\" \"*\" \"+\" \",\" \";\" \"=\" %encoded\n  // I've never seen a (non-IDN) hostname other than: ALPHA DIGIT . - _\n  URI.invalid_hostname_characters = /[^a-zA-Z0-9\\.\\-:_]/;\n  // map DOM Elements to their URI attribute\n  URI.domAttributes = {\n    'a': 'href',\n    'blockquote': 'cite',\n    'link': 'href',\n    'base': 'href',\n    'script': 'src',\n    'form': 'action',\n    'img': 'src',\n    'area': 'href',\n    'iframe': 'src',\n    'embed': 'src',\n    'source': 'src',\n    'track': 'src',\n    'input': 'src', // but only if type=\"image\"\n    'audio': 'src',\n    'video': 'src'\n  };\n  URI.getDomAttribute = function(node) {\n    if (!node || !node.nodeName) {\n      return undefined;\n    }\n\n    var nodeName = node.nodeName.toLowerCase();\n    // <input> should only expose src for type=\"image\"\n    if (nodeName === 'input' && node.type !== 'image') {\n      return undefined;\n    }\n\n    return URI.domAttributes[nodeName];\n  };\n\n  function escapeForDumbFirefox36(value) {\n    // https://github.com/medialize/URI.js/issues/91\n    return escape(value);\n  }\n\n  // encoding / decoding according to RFC3986\n  function strictEncodeURIComponent(string) {\n    // see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURIComponent\n    return encodeURIComponent(string)\n      .replace(/[!'()*]/g, escapeForDumbFirefox36)\n      .replace(/\\*/g, '%2A');\n  }\n  URI.encode = strictEncodeURIComponent;\n  URI.decode = decodeURIComponent;\n  URI.iso8859 = function() {\n    URI.encode = escape;\n    URI.decode = unescape;\n  };\n  URI.unicode = function() {\n    URI.encode = strictEncodeURIComponent;\n    URI.decode = decodeURIComponent;\n  };\n  URI.characters = {\n    pathname: {\n      encode: {\n        // RFC3986 2.1: For consistency, URI producers and normalizers should\n        // use uppercase hexadecimal digits for all percent-encodings.\n        expression: /%(24|26|2B|2C|3B|3D|3A|40)/ig,\n        map: {\n          // -._~!'()*\n          '%24': '$',\n          '%26': '&',\n          '%2B': '+',\n          '%2C': ',',\n          '%3B': ';',\n          '%3D': '=',\n          '%3A': ':',\n          '%40': '@'\n        }\n      },\n      decode: {\n        expression: /[\\/\\?#]/g,\n        map: {\n          '/': '%2F',\n          '?': '%3F',\n          '#': '%23'\n        }\n      }\n    },\n    reserved: {\n      encode: {\n        // RFC3986 2.1: For consistency, URI producers and normalizers should\n        // use uppercase hexadecimal digits for all percent-encodings.\n        expression: /%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,\n        map: {\n          // gen-delims\n          '%3A': ':',\n          '%2F': '/',\n          '%3F': '?',\n          '%23': '#',\n          '%5B': '[',\n          '%5D': ']',\n          '%40': '@',\n          // sub-delims\n          '%21': '!',\n          '%24': '$',\n          '%26': '&',\n          '%27': '\\'',\n          '%28': '(',\n          '%29': ')',\n          '%2A': '*',\n          '%2B': '+',\n          '%2C': ',',\n          '%3B': ';',\n          '%3D': '='\n        }\n      }\n    },\n    urnpath: {\n      // The characters under `encode` are the characters called out by RFC 2141 as being acceptable\n      // for usage in a URN. RFC2141 also calls out \"-\", \".\", and \"_\" as acceptable characters, but\n      // these aren't encoded by encodeURIComponent, so we don't have to call them out here. Also\n      // note that the colon character is not featured in the encoding map; this is because URI.js\n      // gives the colons in URNs semantic meaning as the delimiters of path segements, and so it\n      // should not appear unencoded in a segment itself.\n      // See also the note above about RFC3986 and capitalalized hex digits.\n      encode: {\n        expression: /%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,\n        map: {\n          '%21': '!',\n          '%24': '$',\n          '%27': '\\'',\n          '%28': '(',\n          '%29': ')',\n          '%2A': '*',\n          '%2B': '+',\n          '%2C': ',',\n          '%3B': ';',\n          '%3D': '=',\n          '%40': '@'\n        }\n      },\n      // These characters are the characters called out by RFC2141 as \"reserved\" characters that\n      // should never appear in a URN, plus the colon character (see note above).\n      decode: {\n        expression: /[\\/\\?#:]/g,\n        map: {\n          '/': '%2F',\n          '?': '%3F',\n          '#': '%23',\n          ':': '%3A'\n        }\n      }\n    }\n  };\n  URI.encodeQuery = function(string, escapeQuerySpace) {\n    var escaped = URI.encode(string + '');\n    if (escapeQuerySpace === undefined) {\n      escapeQuerySpace = URI.escapeQuerySpace;\n    }\n\n    return escapeQuerySpace ? escaped.replace(/%20/g, '+') : escaped;\n  };\n  URI.decodeQuery = function(string, escapeQuerySpace) {\n    string += '';\n    if (escapeQuerySpace === undefined) {\n      escapeQuerySpace = URI.escapeQuerySpace;\n    }\n\n    try {\n      return URI.decode(escapeQuerySpace ? string.replace(/\\+/g, '%20') : string);\n    } catch(e) {\n      // we're not going to mess with weird encodings,\n      // give up and return the undecoded original string\n      // see https://github.com/medialize/URI.js/issues/87\n      // see https://github.com/medialize/URI.js/issues/92\n      return string;\n    }\n  };\n  // generate encode/decode path functions\n  var _parts = {'encode':'encode', 'decode':'decode'};\n  var _part;\n  var generateAccessor = function(_group, _part) {\n    return function(string) {\n      try {\n        return URI[_part](string + '').replace(URI.characters[_group][_part].expression, function(c) {\n          return URI.characters[_group][_part].map[c];\n        });\n      } catch (e) {\n        // we're not going to mess with weird encodings,\n        // give up and return the undecoded original string\n        // see https://github.com/medialize/URI.js/issues/87\n        // see https://github.com/medialize/URI.js/issues/92\n        return string;\n      }\n    };\n  };\n\n  for (_part in _parts) {\n    URI[_part + 'PathSegment'] = generateAccessor('pathname', _parts[_part]);\n    URI[_part + 'UrnPathSegment'] = generateAccessor('urnpath', _parts[_part]);\n  }\n\n  var generateSegmentedPathFunction = function(_sep, _codingFuncName, _innerCodingFuncName) {\n    return function(string) {\n      // Why pass in names of functions, rather than the function objects themselves? The\n      // definitions of some functions (but in particular, URI.decode) will occasionally change due\n      // to URI.js having ISO8859 and Unicode modes. Passing in the name and getting it will ensure\n      // that the functions we use here are \"fresh\".\n      var actualCodingFunc;\n      if (!_innerCodingFuncName) {\n        actualCodingFunc = URI[_codingFuncName];\n      } else {\n        actualCodingFunc = function(string) {\n          return URI[_codingFuncName](URI[_innerCodingFuncName](string));\n        };\n      }\n\n      var segments = (string + '').split(_sep);\n\n      for (var i = 0, length = segments.length; i < length; i++) {\n        segments[i] = actualCodingFunc(segments[i]);\n      }\n\n      return segments.join(_sep);\n    };\n  };\n\n  // This takes place outside the above loop because we don't want, e.g., encodeUrnPath functions.\n  URI.decodePath = generateSegmentedPathFunction('/', 'decodePathSegment');\n  URI.decodeUrnPath = generateSegmentedPathFunction(':', 'decodeUrnPathSegment');\n  URI.recodePath = generateSegmentedPathFunction('/', 'encodePathSegment', 'decode');\n  URI.recodeUrnPath = generateSegmentedPathFunction(':', 'encodeUrnPathSegment', 'decode');\n\n  URI.encodeReserved = generateAccessor('reserved', 'encode');\n\n  URI.parse = function(string, parts) {\n    var pos;\n    if (!parts) {\n      parts = {\n        preventInvalidHostname: URI.preventInvalidHostname\n      };\n    }\n\n    string = string.replace(URI.leading_whitespace_expression, '')\n    // https://infra.spec.whatwg.org/#ascii-tab-or-newline\n    string = string.replace(URI.ascii_tab_whitespace, '')\n\n    // [protocol\"://\"[username[\":\"password]\"@\"]hostname[\":\"port]\"/\"?][path][\"?\"querystring][\"#\"fragment]\n\n    // extract fragment\n    pos = string.indexOf('#');\n    if (pos > -1) {\n      // escaping?\n      parts.fragment = string.substring(pos + 1) || null;\n      string = string.substring(0, pos);\n    }\n\n    // extract query\n    pos = string.indexOf('?');\n    if (pos > -1) {\n      // escaping?\n      parts.query = string.substring(pos + 1) || null;\n      string = string.substring(0, pos);\n    }\n\n    // slashes and backslashes have lost all meaning for the web protocols (https, http, wss, ws)\n    string = string.replace(/^(https?|ftp|wss?)?:+[/\\\\]*/i, '$1://');\n    // slashes and backslashes have lost all meaning for scheme relative URLs\n    string = string.replace(/^[/\\\\]{2,}/i, '//');\n\n    // extract protocol\n    if (string.substring(0, 2) === '//') {\n      // relative-scheme\n      parts.protocol = null;\n      string = string.substring(2);\n      // extract \"user:pass@host:port\"\n      string = URI.parseAuthority(string, parts);\n    } else {\n      pos = string.indexOf(':');\n      if (pos > -1) {\n        parts.protocol = string.substring(0, pos) || null;\n        if (parts.protocol && !parts.protocol.match(URI.protocol_expression)) {\n          // : may be within the path\n          parts.protocol = undefined;\n        } else if (string.substring(pos + 1, pos + 3).replace(/\\\\/g, '/') === '//') {\n          string = string.substring(pos + 3);\n\n          // extract \"user:pass@host:port\"\n          string = URI.parseAuthority(string, parts);\n        } else {\n          string = string.substring(pos + 1);\n          parts.urn = true;\n        }\n      }\n    }\n\n    // what's left must be the path\n    parts.path = string;\n\n    // and we're done\n    return parts;\n  };\n  URI.parseHost = function(string, parts) {\n    if (!string) {\n      string = '';\n    }\n\n    // Copy chrome, IE, opera backslash-handling behavior.\n    // Back slashes before the query string get converted to forward slashes\n    // See: https://github.com/joyent/node/blob/386fd24f49b0e9d1a8a076592a404168faeecc34/lib/url.js#L115-L124\n    // See: https://code.google.com/p/chromium/issues/detail?id=25916\n    // https://github.com/medialize/URI.js/pull/233\n    string = string.replace(/\\\\/g, '/');\n\n    // extract host:port\n    var pos = string.indexOf('/');\n    var bracketPos;\n    var t;\n\n    if (pos === -1) {\n      pos = string.length;\n    }\n\n    if (string.charAt(0) === '[') {\n      // IPv6 host - http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04#section-6\n      // I claim most client software breaks on IPv6 anyways. To simplify things, URI only accepts\n      // IPv6+port in the format [2001:db8::1]:80 (for the time being)\n      bracketPos = string.indexOf(']');\n      parts.hostname = string.substring(1, bracketPos) || null;\n      parts.port = string.substring(bracketPos + 2, pos) || null;\n      if (parts.port === '/') {\n        parts.port = null;\n      }\n    } else {\n      var firstColon = string.indexOf(':');\n      var firstSlash = string.indexOf('/');\n      var nextColon = string.indexOf(':', firstColon + 1);\n      if (nextColon !== -1 && (firstSlash === -1 || nextColon < firstSlash)) {\n        // IPv6 host contains multiple colons - but no port\n        // this notation is actually not allowed by RFC 3986, but we're a liberal parser\n        parts.hostname = string.substring(0, pos) || null;\n        parts.port = null;\n      } else {\n        t = string.substring(0, pos).split(':');\n        parts.hostname = t[0] || null;\n        parts.port = t[1] || null;\n      }\n    }\n\n    if (parts.hostname && string.substring(pos).charAt(0) !== '/') {\n      pos++;\n      string = '/' + string;\n    }\n\n    if (parts.preventInvalidHostname) {\n      URI.ensureValidHostname(parts.hostname, parts.protocol);\n    }\n\n    if (parts.port) {\n      URI.ensureValidPort(parts.port);\n    }\n\n    return string.substring(pos) || '/';\n  };\n  URI.parseAuthority = function(string, parts) {\n    string = URI.parseUserinfo(string, parts);\n    return URI.parseHost(string, parts);\n  };\n  URI.parseUserinfo = function(string, parts) {\n    // extract username:password\n    var _string = string\n    var firstBackSlash = string.indexOf('\\\\');\n    if (firstBackSlash !== -1) {\n      string = string.replace(/\\\\/g, '/')\n    }\n    var firstSlash = string.indexOf('/');\n    var pos = string.lastIndexOf('@', firstSlash > -1 ? firstSlash : string.length - 1);\n    var t;\n\n    // authority@ must come before /path or \\path\n    if (pos > -1 && (firstSlash === -1 || pos < firstSlash)) {\n      t = string.substring(0, pos).split(':');\n      parts.username = t[0] ? URI.decode(t[0]) : null;\n      t.shift();\n      parts.password = t[0] ? URI.decode(t.join(':')) : null;\n      string = _string.substring(pos + 1);\n    } else {\n      parts.username = null;\n      parts.password = null;\n    }\n\n    return string;\n  };\n  URI.parseQuery = function(string, escapeQuerySpace) {\n    if (!string) {\n      return {};\n    }\n\n    // throw out the funky business - \"?\"[name\"=\"value\"&\"]+\n    string = string.replace(/&+/g, '&').replace(/^\\?*&*|&+$/g, '');\n\n    if (!string) {\n      return {};\n    }\n\n    var items = {};\n    var splits = string.split('&');\n    var length = splits.length;\n    var v, name, value;\n\n    for (var i = 0; i < length; i++) {\n      v = splits[i].split('=');\n      name = URI.decodeQuery(v.shift(), escapeQuerySpace);\n      // no \"=\" is null according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#collect-url-parameters\n      value = v.length ? URI.decodeQuery(v.join('='), escapeQuerySpace) : null;\n\n      if (name === '__proto__') {\n        // ignore attempt at exploiting JavaScript internals\n        continue;\n      } else if (hasOwn.call(items, name)) {\n        if (typeof items[name] === 'string' || items[name] === null) {\n          items[name] = [items[name]];\n        }\n\n        items[name].push(value);\n      } else {\n        items[name] = value;\n      }\n    }\n\n    return items;\n  };\n\n  URI.build = function(parts) {\n    var t = '';\n    var requireAbsolutePath = false\n\n    if (parts.protocol) {\n      t += parts.protocol + ':';\n    }\n\n    if (!parts.urn && (t || parts.hostname)) {\n      t += '//';\n      requireAbsolutePath = true\n    }\n\n    t += (URI.buildAuthority(parts) || '');\n\n    if (typeof parts.path === 'string') {\n      if (parts.path.charAt(0) !== '/' && requireAbsolutePath) {\n        t += '/';\n      }\n\n      t += parts.path;\n    }\n\n    if (typeof parts.query === 'string' && parts.query) {\n      t += '?' + parts.query;\n    }\n\n    if (typeof parts.fragment === 'string' && parts.fragment) {\n      t += '#' + parts.fragment;\n    }\n    return t;\n  };\n  URI.buildHost = function(parts) {\n    var t = '';\n\n    if (!parts.hostname) {\n      return '';\n    } else if (URI.ip6_expression.test(parts.hostname)) {\n      t += '[' + parts.hostname + ']';\n    } else {\n      t += parts.hostname;\n    }\n\n    if (parts.port) {\n      t += ':' + parts.port;\n    }\n\n    return t;\n  };\n  URI.buildAuthority = function(parts) {\n    return URI.buildUserinfo(parts) + URI.buildHost(parts);\n  };\n  URI.buildUserinfo = function(parts) {\n    var t = '';\n\n    if (parts.username) {\n      t += URI.encode(parts.username);\n    }\n\n    if (parts.password) {\n      t += ':' + URI.encode(parts.password);\n    }\n\n    if (t) {\n      t += '@';\n    }\n\n    return t;\n  };\n  URI.buildQuery = function(data, duplicateQueryParameters, escapeQuerySpace) {\n    // according to http://tools.ietf.org/html/rfc3986 or http://labs.apache.org/webarch/uri/rfc/rfc3986.html\n    // being \u00BB-._~!$&'()*+,;=:@/?\u00AB %HEX and alnum are allowed\n    // the RFC explicitly states ?/foo being a valid use case, no mention of parameter syntax!\n    // URI.js treats the query string as being application/x-www-form-urlencoded\n    // see http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type\n\n    var t = '';\n    var unique, key, i, length;\n    for (key in data) {\n      if (key === '__proto__') {\n        // ignore attempt at exploiting JavaScript internals\n        continue;\n      } else if (hasOwn.call(data, key)) {\n        if (isArray(data[key])) {\n          unique = {};\n          for (i = 0, length = data[key].length; i < length; i++) {\n            if (data[key][i] !== undefined && unique[data[key][i] + ''] === undefined) {\n              t += '&' + URI.buildQueryParameter(key, data[key][i], escapeQuerySpace);\n              if (duplicateQueryParameters !== true) {\n                unique[data[key][i] + ''] = true;\n              }\n            }\n          }\n        } else if (data[key] !== undefined) {\n          t += '&' + URI.buildQueryParameter(key, data[key], escapeQuerySpace);\n        }\n      }\n    }\n\n    return t.substring(1);\n  };\n  URI.buildQueryParameter = function(name, value, escapeQuerySpace) {\n    // http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type -- application/x-www-form-urlencoded\n    // don't append \"=\" for null values, according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#url-parameter-serialization\n    return URI.encodeQuery(name, escapeQuerySpace) + (value !== null ? '=' + URI.encodeQuery(value, escapeQuerySpace) : '');\n  };\n\n  URI.addQuery = function(data, name, value) {\n    if (typeof name === 'object') {\n      for (var key in name) {\n        if (hasOwn.call(name, key)) {\n          URI.addQuery(data, key, name[key]);\n        }\n      }\n    } else if (typeof name === 'string') {\n      if (data[name] === undefined) {\n        data[name] = value;\n        return;\n      } else if (typeof data[name] === 'string') {\n        data[name] = [data[name]];\n      }\n\n      if (!isArray(value)) {\n        value = [value];\n      }\n\n      data[name] = (data[name] || []).concat(value);\n    } else {\n      throw new TypeError('URI.addQuery() accepts an object, string as the name parameter');\n    }\n  };\n\n  URI.setQuery = function(data, name, value) {\n    if (typeof name === 'object') {\n      for (var key in name) {\n        if (hasOwn.call(name, key)) {\n          URI.setQuery(data, key, name[key]);\n        }\n      }\n    } else if (typeof name === 'string') {\n      data[name] = value === undefined ? null : value;\n    } else {\n      throw new TypeError('URI.setQuery() accepts an object, string as the name parameter');\n    }\n  };\n\n  URI.removeQuery = function(data, name, value) {\n    var i, length, key;\n\n    if (isArray(name)) {\n      for (i = 0, length = name.length; i < length; i++) {\n        data[name[i]] = undefined;\n      }\n    } else if (getType(name) === 'RegExp') {\n      for (key in data) {\n        if (name.test(key)) {\n          data[key] = undefined;\n        }\n      }\n    } else if (typeof name === 'object') {\n      for (key in name) {\n        if (hasOwn.call(name, key)) {\n          URI.removeQuery(data, key, name[key]);\n        }\n      }\n    } else if (typeof name === 'string') {\n      if (value !== undefined) {\n        if (getType(value) === 'RegExp') {\n          if (!isArray(data[name]) && value.test(data[name])) {\n            data[name] = undefined;\n          } else {\n            data[name] = filterArrayValues(data[name], value);\n          }\n        } else if (data[name] === String(value) && (!isArray(value) || value.length === 1)) {\n          data[name] = undefined;\n        } else if (isArray(data[name])) {\n          data[name] = filterArrayValues(data[name], value);\n        }\n      } else {\n        data[name] = undefined;\n      }\n    } else {\n      throw new TypeError('URI.removeQuery() accepts an object, string, RegExp as the first parameter');\n    }\n  };\n  URI.hasQuery = function(data, name, value, withinArray) {\n    switch (getType(name)) {\n      case 'String':\n        // Nothing to do here\n        break;\n\n      case 'RegExp':\n        for (var key in data) {\n          if (hasOwn.call(data, key)) {\n            if (name.test(key) && (value === undefined || URI.hasQuery(data, key, value))) {\n              return true;\n            }\n          }\n        }\n\n        return false;\n\n      case 'Object':\n        for (var _key in name) {\n          if (hasOwn.call(name, _key)) {\n            if (!URI.hasQuery(data, _key, name[_key])) {\n              return false;\n            }\n          }\n        }\n\n        return true;\n\n      default:\n        throw new TypeError('URI.hasQuery() accepts a string, regular expression or object as the name parameter');\n    }\n\n    switch (getType(value)) {\n      case 'Undefined':\n        // true if exists (but may be empty)\n        return name in data; // data[name] !== undefined;\n\n      case 'Boolean':\n        // true if exists and non-empty\n        var _booly = Boolean(isArray(data[name]) ? data[name].length : data[name]);\n        return value === _booly;\n\n      case 'Function':\n        // allow complex comparison\n        return !!value(data[name], name, data);\n\n      case 'Array':\n        if (!isArray(data[name])) {\n          return false;\n        }\n\n        var op = withinArray ? arrayContains : arraysEqual;\n        return op(data[name], value);\n\n      case 'RegExp':\n        if (!isArray(data[name])) {\n          return Boolean(data[name] && data[name].match(value));\n        }\n\n        if (!withinArray) {\n          return false;\n        }\n\n        return arrayContains(data[name], value);\n\n      case 'Number':\n        value = String(value);\n        /* falls through */\n      case 'String':\n        if (!isArray(data[name])) {\n          return data[name] === value;\n        }\n\n        if (!withinArray) {\n          return false;\n        }\n\n        return arrayContains(data[name], value);\n\n      default:\n        throw new TypeError('URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter');\n    }\n  };\n\n\n  URI.joinPaths = function() {\n    var input = [];\n    var segments = [];\n    var nonEmptySegments = 0;\n\n    for (var i = 0; i < arguments.length; i++) {\n      var url = new URI(arguments[i]);\n      input.push(url);\n      var _segments = url.segment();\n      for (var s = 0; s < _segments.length; s++) {\n        if (typeof _segments[s] === 'string') {\n          segments.push(_segments[s]);\n        }\n\n        if (_segments[s]) {\n          nonEmptySegments++;\n        }\n      }\n    }\n\n    if (!segments.length || !nonEmptySegments) {\n      return new URI('');\n    }\n\n    var uri = new URI('').segment(segments);\n\n    if (input[0].path() === '' || input[0].path().slice(0, 1) === '/') {\n      uri.path('/' + uri.path());\n    }\n\n    return uri.normalize();\n  };\n\n  URI.commonPath = function(one, two) {\n    var length = Math.min(one.length, two.length);\n    var pos;\n\n    // find first non-matching character\n    for (pos = 0; pos < length; pos++) {\n      if (one.charAt(pos) !== two.charAt(pos)) {\n        pos--;\n        break;\n      }\n    }\n\n    if (pos < 1) {\n      return one.charAt(0) === two.charAt(0) && one.charAt(0) === '/' ? '/' : '';\n    }\n\n    // revert to last /\n    if (one.charAt(pos) !== '/' || two.charAt(pos) !== '/') {\n      pos = one.substring(0, pos).lastIndexOf('/');\n    }\n\n    return one.substring(0, pos + 1);\n  };\n\n  URI.withinString = function(string, callback, options) {\n    options || (options = {});\n    var _start = options.start || URI.findUri.start;\n    var _end = options.end || URI.findUri.end;\n    var _trim = options.trim || URI.findUri.trim;\n    var _parens = options.parens || URI.findUri.parens;\n    var _attributeOpen = /[a-z0-9-]=[\"']?$/i;\n\n    _start.lastIndex = 0;\n    while (true) {\n      var match = _start.exec(string);\n      if (!match) {\n        break;\n      }\n\n      var start = match.index;\n      if (options.ignoreHtml) {\n        // attribut(e=[\"']?$)\n        var attributeOpen = string.slice(Math.max(start - 3, 0), start);\n        if (attributeOpen && _attributeOpen.test(attributeOpen)) {\n          continue;\n        }\n      }\n\n      var end = start + string.slice(start).search(_end);\n      var slice = string.slice(start, end);\n      // make sure we include well balanced parens\n      var parensEnd = -1;\n      while (true) {\n        var parensMatch = _parens.exec(slice);\n        if (!parensMatch) {\n          break;\n        }\n\n        var parensMatchEnd = parensMatch.index + parensMatch[0].length;\n        parensEnd = Math.max(parensEnd, parensMatchEnd);\n      }\n\n      if (parensEnd > -1) {\n        slice = slice.slice(0, parensEnd) + slice.slice(parensEnd).replace(_trim, '');\n      } else {\n        slice = slice.replace(_trim, '');\n      }\n\n      if (slice.length <= match[0].length) {\n        // the extract only contains the starting marker of a URI,\n        // e.g. \"www\" or \"http://\"\n        continue;\n      }\n\n      if (options.ignore && options.ignore.test(slice)) {\n        continue;\n      }\n\n      end = start + slice.length;\n      var result = callback(slice, start, end, string);\n      if (result === undefined) {\n        _start.lastIndex = end;\n        continue;\n      }\n\n      result = String(result);\n      string = string.slice(0, start) + result + string.slice(end);\n      _start.lastIndex = start + result.length;\n    }\n\n    _start.lastIndex = 0;\n    return string;\n  };\n\n  URI.ensureValidHostname = function(v, protocol) {\n    // Theoretically URIs allow percent-encoding in Hostnames (according to RFC 3986)\n    // they are not part of DNS and therefore ignored by URI.js\n\n    var hasHostname = !!v; // not null and not an empty string\n    var hasProtocol = !!protocol;\n    var rejectEmptyHostname = false;\n\n    if (hasProtocol) {\n      rejectEmptyHostname = arrayContains(URI.hostProtocols, protocol);\n    }\n\n    if (rejectEmptyHostname && !hasHostname) {\n      throw new TypeError('Hostname cannot be empty, if protocol is ' + protocol);\n    } else if (v && v.match(URI.invalid_hostname_characters)) {\n      // test punycode\n      if (!punycode) {\n        throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');\n      }\n      if (punycode.toASCII(v).match(URI.invalid_hostname_characters)) {\n        throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-:_]');\n      }\n    }\n  };\n\n  URI.ensureValidPort = function (v) {\n    if (!v) {\n      return;\n    }\n\n    var port = Number(v);\n    if (isInteger(port) && (port > 0) && (port < 65536)) {\n      return;\n    }\n\n    throw new TypeError('Port \"' + v + '\" is not a valid port');\n  };\n\n  // noConflict\n  URI.noConflict = function(removeAll) {\n    if (removeAll) {\n      var unconflicted = {\n        URI: this.noConflict()\n      };\n\n      if (root.URITemplate && typeof root.URITemplate.noConflict === 'function') {\n        unconflicted.URITemplate = root.URITemplate.noConflict();\n      }\n\n      if (root.IPv6 && typeof root.IPv6.noConflict === 'function') {\n        unconflicted.IPv6 = root.IPv6.noConflict();\n      }\n\n      if (root.SecondLevelDomains && typeof root.SecondLevelDomains.noConflict === 'function') {\n        unconflicted.SecondLevelDomains = root.SecondLevelDomains.noConflict();\n      }\n\n      return unconflicted;\n    } else if (root.URI === this) {\n      root.URI = _URI;\n    }\n\n    return this;\n  };\n\n  p.build = function(deferBuild) {\n    if (deferBuild === true) {\n      this._deferred_build = true;\n    } else if (deferBuild === undefined || this._deferred_build) {\n      this._string = URI.build(this._parts);\n      this._deferred_build = false;\n    }\n\n    return this;\n  };\n\n  p.clone = function() {\n    return new URI(this);\n  };\n\n  p.valueOf = p.toString = function() {\n    return this.build(false)._string;\n  };\n\n\n  function generateSimpleAccessor(_part){\n    return function(v, build) {\n      if (v === undefined) {\n        return this._parts[_part] || '';\n      } else {\n        this._parts[_part] = v || null;\n        this.build(!build);\n        return this;\n      }\n    };\n  }\n\n  function generatePrefixAccessor(_part, _key){\n    return function(v, build) {\n      if (v === undefined) {\n        return this._parts[_part] || '';\n      } else {\n        if (v !== null) {\n          v = v + '';\n          if (v.charAt(0) === _key) {\n            v = v.substring(1);\n          }\n        }\n\n        this._parts[_part] = v;\n        this.build(!build);\n        return this;\n      }\n    };\n  }\n\n  p.protocol = generateSimpleAccessor('protocol');\n  p.username = generateSimpleAccessor('username');\n  p.password = generateSimpleAccessor('password');\n  p.hostname = generateSimpleAccessor('hostname');\n  p.port = generateSimpleAccessor('port');\n  p.query = generatePrefixAccessor('query', '?');\n  p.fragment = generatePrefixAccessor('fragment', '#');\n\n  p.search = function(v, build) {\n    var t = this.query(v, build);\n    return typeof t === 'string' && t.length ? ('?' + t) : t;\n  };\n  p.hash = function(v, build) {\n    var t = this.fragment(v, build);\n    return typeof t === 'string' && t.length ? ('#' + t) : t;\n  };\n\n  p.pathname = function(v, build) {\n    if (v === undefined || v === true) {\n      var res = this._parts.path || (this._parts.hostname ? '/' : '');\n      return v ? (this._parts.urn ? URI.decodeUrnPath : URI.decodePath)(res) : res;\n    } else {\n      if (this._parts.urn) {\n        this._parts.path = v ? URI.recodeUrnPath(v) : '';\n      } else {\n        this._parts.path = v ? URI.recodePath(v) : '/';\n      }\n      this.build(!build);\n      return this;\n    }\n  };\n  p.path = p.pathname;\n  p.href = function(href, build) {\n    var key;\n\n    if (href === undefined) {\n      return this.toString();\n    }\n\n    this._string = '';\n    this._parts = URI._parts();\n\n    var _URI = href instanceof URI;\n    var _object = typeof href === 'object' && (href.hostname || href.path || href.pathname);\n    if (href.nodeName) {\n      var attribute = URI.getDomAttribute(href);\n      href = href[attribute] || '';\n      _object = false;\n    }\n\n    // window.location is reported to be an object, but it's not the sort\n    // of object we're looking for:\n    // * location.protocol ends with a colon\n    // * location.query != object.search\n    // * location.hash != object.fragment\n    // simply serializing the unknown object should do the trick\n    // (for location, not for everything...)\n    if (!_URI && _object && href.pathname !== undefined) {\n      href = href.toString();\n    }\n\n    if (typeof href === 'string' || href instanceof String) {\n      this._parts = URI.parse(String(href), this._parts);\n    } else if (_URI || _object) {\n      var src = _URI ? href._parts : href;\n      for (key in src) {\n        if (key === 'query') { continue; }\n        if (hasOwn.call(this._parts, key)) {\n          this._parts[key] = src[key];\n        }\n      }\n      if (src.query) {\n        this.query(src.query, false);\n      }\n    } else {\n      throw new TypeError('invalid input');\n    }\n\n    this.build(!build);\n    return this;\n  };\n\n  // identification accessors\n  p.is = function(what) {\n    var ip = false;\n    var ip4 = false;\n    var ip6 = false;\n    var name = false;\n    var sld = false;\n    var idn = false;\n    var punycode = false;\n    var relative = !this._parts.urn;\n\n    if (this._parts.hostname) {\n      relative = false;\n      ip4 = URI.ip4_expression.test(this._parts.hostname);\n      ip6 = URI.ip6_expression.test(this._parts.hostname);\n      ip = ip4 || ip6;\n      name = !ip;\n      sld = name && SLD && SLD.has(this._parts.hostname);\n      idn = name && URI.idn_expression.test(this._parts.hostname);\n      punycode = name && URI.punycode_expression.test(this._parts.hostname);\n    }\n\n    switch (what.toLowerCase()) {\n      case 'relative':\n        return relative;\n\n      case 'absolute':\n        return !relative;\n\n      // hostname identification\n      case 'domain':\n      case 'name':\n        return name;\n\n      case 'sld':\n        return sld;\n\n      case 'ip':\n        return ip;\n\n      case 'ip4':\n      case 'ipv4':\n      case 'inet4':\n        return ip4;\n\n      case 'ip6':\n      case 'ipv6':\n      case 'inet6':\n        return ip6;\n\n      case 'idn':\n        return idn;\n\n      case 'url':\n        return !this._parts.urn;\n\n      case 'urn':\n        return !!this._parts.urn;\n\n      case 'punycode':\n        return punycode;\n    }\n\n    return null;\n  };\n\n  // component specific input validation\n  var _protocol = p.protocol;\n  var _port = p.port;\n  var _hostname = p.hostname;\n\n  p.protocol = function(v, build) {\n    if (v) {\n      // accept trailing ://\n      v = v.replace(/:(\\/\\/)?$/, '');\n\n      if (!v.match(URI.protocol_expression)) {\n        throw new TypeError('Protocol \"' + v + '\" contains characters other than [A-Z0-9.+-] or doesn\\'t start with [A-Z]');\n      }\n    }\n\n    return _protocol.call(this, v, build);\n  };\n  p.scheme = p.protocol;\n  p.port = function(v, build) {\n    if (this._parts.urn) {\n      return v === undefined ? '' : this;\n    }\n\n    if (v !== undefined) {\n      if (v === 0) {\n        v = null;\n      }\n\n      if (v) {\n        v += '';\n        if (v.charAt(0) === ':') {\n          v = v.substring(1);\n        }\n\n        URI.ensureValidPort(v);\n      }\n    }\n    return _port.call(this, v, build);\n  };\n  p.hostname = function(v, build) {\n    if (this._parts.urn) {\n      return v === undefined ? '' : this;\n    }\n\n    if (v !== undefined) {\n      var x = { preventInvalidHostname: this._parts.preventInvalidHostname };\n      var res = URI.parseHost(v, x);\n      if (res !== '/') {\n        throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-]');\n      }\n\n      v = x.hostname;\n      if (this._parts.preventInvalidHostname) {\n        URI.ensureValidHostname(v, this._parts.protocol);\n      }\n    }\n\n    return _hostname.call(this, v, build);\n  };\n\n  // compound accessors\n  p.origin = function(v, build) {\n    if (this._parts.urn) {\n      return v === undefined ? '' : this;\n    }\n\n    if (v === undefined) {\n      var protocol = this.protocol();\n      var authority = this.authority();\n      if (!authority) {\n        return '';\n      }\n\n      return (protocol ? protocol + '://' : '') + this.authority();\n    } else {\n      var origin = URI(v);\n      this\n        .protocol(origin.protocol())\n        .authority(origin.authority())\n        .build(!build);\n      return this;\n    }\n  };\n  p.host = function(v, build) {\n    if (this._parts.urn) {\n      return v === undefined ? '' : this;\n    }\n\n    if (v === undefined) {\n      return this._parts.hostname ? URI.buildHost(this._parts) : '';\n    } else {\n      var res = URI.parseHost(v, this._parts);\n      if (res !== '/') {\n        throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-]');\n      }\n\n      this.build(!build);\n      return this;\n    }\n  };\n  p.authority = function(v, build) {\n    if (this._parts.urn) {\n      return v === undefined ? '' : this;\n    }\n\n    if (v === undefined) {\n      return this._parts.hostname ? URI.buildAuthority(this._parts) : '';\n    } else {\n      var res = URI.parseAuthority(v, this._parts);\n      if (res !== '/') {\n        throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-]');\n      }\n\n      this.build(!build);\n      return this;\n    }\n  };\n  p.userinfo = function(v, build) {\n    if (this._parts.urn) {\n      return v === undefined ? '' : this;\n    }\n\n    if (v === undefined) {\n      var t = URI.buildUserinfo(this._parts);\n      return t ? t.substring(0, t.length -1) : t;\n    } else {\n      if (v[v.length-1] !== '@') {\n        v += '@';\n      }\n\n      URI.parseUserinfo(v, this._parts);\n      this.build(!build);\n      return this;\n    }\n  };\n  p.resource = function(v, build) {\n    var parts;\n\n    if (v === undefined) {\n      return this.path() + this.search() + this.hash();\n    }\n\n    parts = URI.parse(v);\n    this._parts.path = parts.path;\n    this._parts.query = parts.query;\n    this._parts.fragment = parts.fragment;\n    this.build(!build);\n    return this;\n  };\n\n  // fraction accessors\n  p.subdomain = function(v, build) {\n    if (this._parts.urn) {\n      return v === undefined ? '' : this;\n    }\n\n    // convenience, return \"www\" from \"www.example.org\"\n    if (v === undefined) {\n      if (!this._parts.hostname || this.is('IP')) {\n        return '';\n      }\n\n      // grab domain and add another segment\n      var end = this._parts.hostname.length - this.domain().length - 1;\n      return this._parts.hostname.substring(0, end) || '';\n    } else {\n      var e = this._parts.hostname.length - this.domain().length;\n      var sub = this._parts.hostname.substring(0, e);\n      var replace = new RegExp('^' + escapeRegEx(sub));\n\n      if (v && v.charAt(v.length - 1) !== '.') {\n        v += '.';\n      }\n\n      if (v.indexOf(':') !== -1) {\n        throw new TypeError('Domains cannot contain colons');\n      }\n\n      if (v) {\n        URI.ensureValidHostname(v, this._parts.protocol);\n      }\n\n      this._parts.hostname = this._parts.hostname.replace(replace, v);\n      this.build(!build);\n      return this;\n    }\n  };\n  p.domain = function(v, build) {\n    if (this._parts.urn) {\n      return v === undefined ? '' : this;\n    }\n\n    if (typeof v === 'boolean') {\n      build = v;\n      v = undefined;\n    }\n\n    // convenience, return \"example.org\" from \"www.example.org\"\n    if (v === undefined) {\n      if (!this._parts.hostname || this.is('IP')) {\n        return '';\n      }\n\n      // if hostname consists of 1 or 2 segments, it must be the domain\n      var t = this._parts.hostname.match(/\\./g);\n      if (t && t.length < 2) {\n        return this._parts.hostname;\n      }\n\n      // grab tld and add another segment\n      var end = this._parts.hostname.length - this.tld(build).length - 1;\n      end = this._parts.hostname.lastIndexOf('.', end -1) + 1;\n      return this._parts.hostname.substring(end) || '';\n    } else {\n      if (!v) {\n        throw new TypeError('cannot set domain empty');\n      }\n\n      if (v.indexOf(':') !== -1) {\n        throw new TypeError('Domains cannot contain colons');\n      }\n\n      URI.ensureValidHostname(v, this._parts.protocol);\n\n      if (!this._parts.hostname || this.is('IP')) {\n        this._parts.hostname = v;\n      } else {\n        var replace = new RegExp(escapeRegEx(this.domain()) + '$');\n        this._parts.hostname = this._parts.hostname.replace(replace, v);\n      }\n\n      this.build(!build);\n      return this;\n    }\n  };\n  p.tld = function(v, build) {\n    if (this._parts.urn) {\n      return v === undefined ? '' : this;\n    }\n\n    if (typeof v === 'boolean') {\n      build = v;\n      v = undefined;\n    }\n\n    // return \"org\" from \"www.example.org\"\n    if (v === undefined) {\n      if (!this._parts.hostname || this.is('IP')) {\n        return '';\n      }\n\n      var pos = this._parts.hostname.lastIndexOf('.');\n      var tld = this._parts.hostname.substring(pos + 1);\n\n      if (build !== true && SLD && SLD.list[tld.toLowerCase()]) {\n        return SLD.get(this._parts.hostname) || tld;\n      }\n\n      return tld;\n    } else {\n      var replace;\n\n      if (!v) {\n        throw new TypeError('cannot set TLD empty');\n      } else if (v.match(/[^a-zA-Z0-9-]/)) {\n        if (SLD && SLD.is(v)) {\n          replace = new RegExp(escapeRegEx(this.tld()) + '$');\n          this._parts.hostname = this._parts.hostname.replace(replace, v);\n        } else {\n          throw new TypeError('TLD \"' + v + '\" contains characters other than [A-Z0-9]');\n        }\n      } else if (!this._parts.hostname || this.is('IP')) {\n        throw new ReferenceError('cannot set TLD on non-domain host');\n      } else {\n        replace = new RegExp(escapeRegEx(this.tld()) + '$');\n        this._parts.hostname = this._parts.hostname.replace(replace, v);\n      }\n\n      this.build(!build);\n      return this;\n    }\n  };\n  p.directory = function(v, build) {\n    if (this._parts.urn) {\n      return v === undefined ? '' : this;\n    }\n\n    if (v === undefined || v === true) {\n      if (!this._parts.path && !this._parts.hostname) {\n        return '';\n      }\n\n      if (this._parts.path === '/') {\n        return '/';\n      }\n\n      var end = this._parts.path.length - this.filename().length - 1;\n      var res = this._parts.path.substring(0, end) || (this._parts.hostname ? '/' : '');\n\n      return v ? URI.decodePath(res) : res;\n\n    } else {\n      var e = this._parts.path.length - this.filename().length;\n      var directory = this._parts.path.substring(0, e);\n      var replace = new RegExp('^' + escapeRegEx(directory));\n\n      // fully qualifier directories begin with a slash\n      if (!this.is('relative')) {\n        if (!v) {\n          v = '/';\n        }\n\n        if (v.charAt(0) !== '/') {\n          v = '/' + v;\n        }\n      }\n\n      // directories always end with a slash\n      if (v && v.charAt(v.length - 1) !== '/') {\n        v += '/';\n      }\n\n      v = URI.recodePath(v);\n      this._parts.path = this._parts.path.replace(replace, v);\n      this.build(!build);\n      return this;\n    }\n  };\n  p.filename = function(v, build) {\n    if (this._parts.urn) {\n      return v === undefined ? '' : this;\n    }\n\n    if (typeof v !== 'string') {\n      if (!this._parts.path || this._parts.path === '/') {\n        return '';\n      }\n\n      var pos = this._parts.path.lastIndexOf('/');\n      var res = this._parts.path.substring(pos+1);\n\n      return v ? URI.decodePathSegment(res) : res;\n    } else {\n      var mutatedDirectory = false;\n\n      if (v.charAt(0) === '/') {\n        v = v.substring(1);\n      }\n\n      if (v.match(/\\.?\\//)) {\n        mutatedDirectory = true;\n      }\n\n      var replace = new RegExp(escapeRegEx(this.filename()) + '$');\n      v = URI.recodePath(v);\n      this._parts.path = this._parts.path.replace(replace, v);\n\n      if (mutatedDirectory) {\n        this.normalizePath(build);\n      } else {\n        this.build(!build);\n      }\n\n      return this;\n    }\n  };\n  p.suffix = function(v, build) {\n    if (this._parts.urn) {\n      return v === undefined ? '' : this;\n    }\n\n    if (v === undefined || v === true) {\n      if (!this._parts.path || this._parts.path === '/') {\n        return '';\n      }\n\n      var filename = this.filename();\n      var pos = filename.lastIndexOf('.');\n      var s, res;\n\n      if (pos === -1) {\n        return '';\n      }\n\n      // suffix may only contain alnum characters (yup, I made this up.)\n      s = filename.substring(pos+1);\n      res = (/^[a-z0-9%]+$/i).test(s) ? s : '';\n      return v ? URI.decodePathSegment(res) : res;\n    } else {\n      if (v.charAt(0) === '.') {\n        v = v.substring(1);\n      }\n\n      var suffix = this.suffix();\n      var replace;\n\n      if (!suffix) {\n        if (!v) {\n          return this;\n        }\n\n        this._parts.path += '.' + URI.recodePath(v);\n      } else if (!v) {\n        replace = new RegExp(escapeRegEx('.' + suffix) + '$');\n      } else {\n        replace = new RegExp(escapeRegEx(suffix) + '$');\n      }\n\n      if (replace) {\n        v = URI.recodePath(v);\n        this._parts.path = this._parts.path.replace(replace, v);\n      }\n\n      this.build(!build);\n      return this;\n    }\n  };\n  p.segment = function(segment, v, build) {\n    var separator = this._parts.urn ? ':' : '/';\n    var path = this.path();\n    var absolute = path.substring(0, 1) === '/';\n    var segments = path.split(separator);\n\n    if (segment !== undefined && typeof segment !== 'number') {\n      build = v;\n      v = segment;\n      segment = undefined;\n    }\n\n    if (segment !== undefined && typeof segment !== 'number') {\n      throw new Error('Bad segment \"' + segment + '\", must be 0-based integer');\n    }\n\n    if (absolute) {\n      segments.shift();\n    }\n\n    if (segment < 0) {\n      // allow negative indexes to address from the end\n      segment = Math.max(segments.length + segment, 0);\n    }\n\n    if (v === undefined) {\n      /*jshint laxbreak: true */\n      return segment === undefined\n        ? segments\n        : segments[segment];\n      /*jshint laxbreak: false */\n    } else if (segment === null || segments[segment] === undefined) {\n      if (isArray(v)) {\n        segments = [];\n        // collapse empty elements within array\n        for (var i=0, l=v.length; i < l; i++) {\n          if (!v[i].length && (!segments.length || !segments[segments.length -1].length)) {\n            continue;\n          }\n\n          if (segments.length && !segments[segments.length -1].length) {\n            segments.pop();\n          }\n\n          segments.push(trimSlashes(v[i]));\n        }\n      } else if (v || typeof v === 'string') {\n        v = trimSlashes(v);\n        if (segments[segments.length -1] === '') {\n          // empty trailing elements have to be overwritten\n          // to prevent results such as /foo//bar\n          segments[segments.length -1] = v;\n        } else {\n          segments.push(v);\n        }\n      }\n    } else {\n      if (v) {\n        segments[segment] = trimSlashes(v);\n      } else {\n        segments.splice(segment, 1);\n      }\n    }\n\n    if (absolute) {\n      segments.unshift('');\n    }\n\n    return this.path(segments.join(separator), build);\n  };\n  p.segmentCoded = function(segment, v, build) {\n    var segments, i, l;\n\n    if (typeof segment !== 'number') {\n      build = v;\n      v = segment;\n      segment = undefined;\n    }\n\n    if (v === undefined) {\n      segments = this.segment(segment, v, build);\n      if (!isArray(segments)) {\n        segments = segments !== undefined ? URI.decode(segments) : undefined;\n      } else {\n        for (i = 0, l = segments.length; i < l; i++) {\n          segments[i] = URI.decode(segments[i]);\n        }\n      }\n\n      return segments;\n    }\n\n    if (!isArray(v)) {\n      v = (typeof v === 'string' || v instanceof String) ? URI.encode(v) : v;\n    } else {\n      for (i = 0, l = v.length; i < l; i++) {\n        v[i] = URI.encode(v[i]);\n      }\n    }\n\n    return this.segment(segment, v, build);\n  };\n\n  // mutating query string\n  var q = p.query;\n  p.query = function(v, build) {\n    if (v === true) {\n      return URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n    } else if (typeof v === 'function') {\n      var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n      var result = v.call(this, data);\n      this._parts.query = URI.buildQuery(result || data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n      this.build(!build);\n      return this;\n    } else if (v !== undefined && typeof v !== 'string') {\n      this._parts.query = URI.buildQuery(v, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n      this.build(!build);\n      return this;\n    } else {\n      return q.call(this, v, build);\n    }\n  };\n  p.setQuery = function(name, value, build) {\n    var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n\n    if (typeof name === 'string' || name instanceof String) {\n      data[name] = value !== undefined ? value : null;\n    } else if (typeof name === 'object') {\n      for (var key in name) {\n        if (hasOwn.call(name, key)) {\n          data[key] = name[key];\n        }\n      }\n    } else {\n      throw new TypeError('URI.addQuery() accepts an object, string as the name parameter');\n    }\n\n    this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n    if (typeof name !== 'string') {\n      build = value;\n    }\n\n    this.build(!build);\n    return this;\n  };\n  p.addQuery = function(name, value, build) {\n    var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n    URI.addQuery(data, name, value === undefined ? null : value);\n    this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n    if (typeof name !== 'string') {\n      build = value;\n    }\n\n    this.build(!build);\n    return this;\n  };\n  p.removeQuery = function(name, value, build) {\n    var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n    URI.removeQuery(data, name, value);\n    this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n    if (typeof name !== 'string') {\n      build = value;\n    }\n\n    this.build(!build);\n    return this;\n  };\n  p.hasQuery = function(name, value, withinArray) {\n    var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n    return URI.hasQuery(data, name, value, withinArray);\n  };\n  p.setSearch = p.setQuery;\n  p.addSearch = p.addQuery;\n  p.removeSearch = p.removeQuery;\n  p.hasSearch = p.hasQuery;\n\n  // sanitizing URLs\n  p.normalize = function() {\n    if (this._parts.urn) {\n      return this\n        .normalizeProtocol(false)\n        .normalizePath(false)\n        .normalizeQuery(false)\n        .normalizeFragment(false)\n        .build();\n    }\n\n    return this\n      .normalizeProtocol(false)\n      .normalizeHostname(false)\n      .normalizePort(false)\n      .normalizePath(false)\n      .normalizeQuery(false)\n      .normalizeFragment(false)\n      .build();\n  };\n  p.normalizeProtocol = function(build) {\n    if (typeof this._parts.protocol === 'string') {\n      this._parts.protocol = this._parts.protocol.toLowerCase();\n      this.build(!build);\n    }\n\n    return this;\n  };\n  p.normalizeHostname = function(build) {\n    if (this._parts.hostname) {\n      if (this.is('IDN') && punycode) {\n        this._parts.hostname = punycode.toASCII(this._parts.hostname);\n      } else if (this.is('IPv6') && IPv6) {\n        this._parts.hostname = IPv6.best(this._parts.hostname);\n      }\n\n      this._parts.hostname = this._parts.hostname.toLowerCase();\n      this.build(!build);\n    }\n\n    return this;\n  };\n  p.normalizePort = function(build) {\n    // remove port of it's the protocol's default\n    if (typeof this._parts.protocol === 'string' && this._parts.port === URI.defaultPorts[this._parts.protocol]) {\n      this._parts.port = null;\n      this.build(!build);\n    }\n\n    return this;\n  };\n  p.normalizePath = function(build) {\n    var _path = this._parts.path;\n    if (!_path) {\n      return this;\n    }\n\n    if (this._parts.urn) {\n      this._parts.path = URI.recodeUrnPath(this._parts.path);\n      this.build(!build);\n      return this;\n    }\n\n    if (this._parts.path === '/') {\n      return this;\n    }\n\n    _path = URI.recodePath(_path);\n\n    var _was_relative;\n    var _leadingParents = '';\n    var _parent, _pos;\n\n    // handle relative paths\n    if (_path.charAt(0) !== '/') {\n      _was_relative = true;\n      _path = '/' + _path;\n    }\n\n    // handle relative files (as opposed to directories)\n    if (_path.slice(-3) === '/..' || _path.slice(-2) === '/.') {\n      _path += '/';\n    }\n\n    // resolve simples\n    _path = _path\n      .replace(/(\\/(\\.\\/)+)|(\\/\\.$)/g, '/')\n      .replace(/\\/{2,}/g, '/');\n\n    // remember leading parents\n    if (_was_relative) {\n      _leadingParents = _path.substring(1).match(/^(\\.\\.\\/)+/) || '';\n      if (_leadingParents) {\n        _leadingParents = _leadingParents[0];\n      }\n    }\n\n    // resolve parents\n    while (true) {\n      _parent = _path.search(/\\/\\.\\.(\\/|$)/);\n      if (_parent === -1) {\n        // no more ../ to resolve\n        break;\n      } else if (_parent === 0) {\n        // top level cannot be relative, skip it\n        _path = _path.substring(3);\n        continue;\n      }\n\n      _pos = _path.substring(0, _parent).lastIndexOf('/');\n      if (_pos === -1) {\n        _pos = _parent;\n      }\n      _path = _path.substring(0, _pos) + _path.substring(_parent + 3);\n    }\n\n    // revert to relative\n    if (_was_relative && this.is('relative')) {\n      _path = _leadingParents + _path.substring(1);\n    }\n\n    this._parts.path = _path;\n    this.build(!build);\n    return this;\n  };\n  p.normalizePathname = p.normalizePath;\n  p.normalizeQuery = function(build) {\n    if (typeof this._parts.query === 'string') {\n      if (!this._parts.query.length) {\n        this._parts.query = null;\n      } else {\n        this.query(URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace));\n      }\n\n      this.build(!build);\n    }\n\n    return this;\n  };\n  p.normalizeFragment = function(build) {\n    if (!this._parts.fragment) {\n      this._parts.fragment = null;\n      this.build(!build);\n    }\n\n    return this;\n  };\n  p.normalizeSearch = p.normalizeQuery;\n  p.normalizeHash = p.normalizeFragment;\n\n  p.iso8859 = function() {\n    // expect unicode input, iso8859 output\n    var e = URI.encode;\n    var d = URI.decode;\n\n    URI.encode = escape;\n    URI.decode = decodeURIComponent;\n    try {\n      this.normalize();\n    } finally {\n      URI.encode = e;\n      URI.decode = d;\n    }\n    return this;\n  };\n\n  p.unicode = function() {\n    // expect iso8859 input, unicode output\n    var e = URI.encode;\n    var d = URI.decode;\n\n    URI.encode = strictEncodeURIComponent;\n    URI.decode = unescape;\n    try {\n      this.normalize();\n    } finally {\n      URI.encode = e;\n      URI.decode = d;\n    }\n    return this;\n  };\n\n  p.readable = function() {\n    var uri = this.clone();\n    // removing username, password, because they shouldn't be displayed according to RFC 3986\n    uri.username('').password('').normalize();\n    var t = '';\n    if (uri._parts.protocol) {\n      t += uri._parts.protocol + '://';\n    }\n\n    if (uri._parts.hostname) {\n      if (uri.is('punycode') && punycode) {\n        t += punycode.toUnicode(uri._parts.hostname);\n        if (uri._parts.port) {\n          t += ':' + uri._parts.port;\n        }\n      } else {\n        t += uri.host();\n      }\n    }\n\n    if (uri._parts.hostname && uri._parts.path && uri._parts.path.charAt(0) !== '/') {\n      t += '/';\n    }\n\n    t += uri.path(true);\n    if (uri._parts.query) {\n      var q = '';\n      for (var i = 0, qp = uri._parts.query.split('&'), l = qp.length; i < l; i++) {\n        var kv = (qp[i] || '').split('=');\n        q += '&' + URI.decodeQuery(kv[0], this._parts.escapeQuerySpace)\n          .replace(/&/g, '%26');\n\n        if (kv[1] !== undefined) {\n          q += '=' + URI.decodeQuery(kv[1], this._parts.escapeQuerySpace)\n            .replace(/&/g, '%26');\n        }\n      }\n      t += '?' + q.substring(1);\n    }\n\n    t += URI.decodeQuery(uri.hash(), true);\n    return t;\n  };\n\n  // resolving relative and absolute URLs\n  p.absoluteTo = function(base) {\n    var resolved = this.clone();\n    var properties = ['protocol', 'username', 'password', 'hostname', 'port'];\n    var basedir, i, p;\n\n    if (this._parts.urn) {\n      throw new Error('URNs do not have any generally defined hierarchical components');\n    }\n\n    if (!(base instanceof URI)) {\n      base = new URI(base);\n    }\n\n    if (resolved._parts.protocol) {\n      // Directly returns even if this._parts.hostname is empty.\n      return resolved;\n    } else {\n      resolved._parts.protocol = base._parts.protocol;\n    }\n\n    if (this._parts.hostname) {\n      return resolved;\n    }\n\n    for (i = 0; (p = properties[i]); i++) {\n      resolved._parts[p] = base._parts[p];\n    }\n\n    if (!resolved._parts.path) {\n      resolved._parts.path = base._parts.path;\n      if (!resolved._parts.query) {\n        resolved._parts.query = base._parts.query;\n      }\n    } else {\n      if (resolved._parts.path.substring(-2) === '..') {\n        resolved._parts.path += '/';\n      }\n\n      if (resolved.path().charAt(0) !== '/') {\n        basedir = base.directory();\n        basedir = basedir ? basedir : base.path().indexOf('/') === 0 ? '/' : '';\n        resolved._parts.path = (basedir ? (basedir + '/') : '') + resolved._parts.path;\n        resolved.normalizePath();\n      }\n    }\n\n    resolved.build();\n    return resolved;\n  };\n  p.relativeTo = function(base) {\n    var relative = this.clone().normalize();\n    var relativeParts, baseParts, common, relativePath, basePath;\n\n    if (relative._parts.urn) {\n      throw new Error('URNs do not have any generally defined hierarchical components');\n    }\n\n    base = new URI(base).normalize();\n    relativeParts = relative._parts;\n    baseParts = base._parts;\n    relativePath = relative.path();\n    basePath = base.path();\n\n    if (relativePath.charAt(0) !== '/') {\n      throw new Error('URI is already relative');\n    }\n\n    if (basePath.charAt(0) !== '/') {\n      throw new Error('Cannot calculate a URI relative to another relative URI');\n    }\n\n    if (relativeParts.protocol === baseParts.protocol) {\n      relativeParts.protocol = null;\n    }\n\n    if (relativeParts.username !== baseParts.username || relativeParts.password !== baseParts.password) {\n      return relative.build();\n    }\n\n    if (relativeParts.protocol !== null || relativeParts.username !== null || relativeParts.password !== null) {\n      return relative.build();\n    }\n\n    if (relativeParts.hostname === baseParts.hostname && relativeParts.port === baseParts.port) {\n      relativeParts.hostname = null;\n      relativeParts.port = null;\n    } else {\n      return relative.build();\n    }\n\n    if (relativePath === basePath) {\n      relativeParts.path = '';\n      return relative.build();\n    }\n\n    // determine common sub path\n    common = URI.commonPath(relativePath, basePath);\n\n    // If the paths have nothing in common, return a relative URL with the absolute path.\n    if (!common) {\n      return relative.build();\n    }\n\n    var parents = baseParts.path\n      .substring(common.length)\n      .replace(/[^\\/]*$/, '')\n      .replace(/.*?\\//g, '../');\n\n    relativeParts.path = (parents + relativeParts.path.substring(common.length)) || './';\n\n    return relative.build();\n  };\n\n  // comparing URIs\n  p.equals = function(uri) {\n    var one = this.clone();\n    var two = new URI(uri);\n    var one_map = {};\n    var two_map = {};\n    var checked = {};\n    var one_query, two_query, key;\n\n    one.normalize();\n    two.normalize();\n\n    // exact match\n    if (one.toString() === two.toString()) {\n      return true;\n    }\n\n    // extract query string\n    one_query = one.query();\n    two_query = two.query();\n    one.query('');\n    two.query('');\n\n    // definitely not equal if not even non-query parts match\n    if (one.toString() !== two.toString()) {\n      return false;\n    }\n\n    // query parameters have the same length, even if they're permuted\n    if (one_query.length !== two_query.length) {\n      return false;\n    }\n\n    one_map = URI.parseQuery(one_query, this._parts.escapeQuerySpace);\n    two_map = URI.parseQuery(two_query, this._parts.escapeQuerySpace);\n\n    for (key in one_map) {\n      if (hasOwn.call(one_map, key)) {\n        if (!isArray(one_map[key])) {\n          if (one_map[key] !== two_map[key]) {\n            return false;\n          }\n        } else if (!arraysEqual(one_map[key], two_map[key])) {\n          return false;\n        }\n\n        checked[key] = true;\n      }\n    }\n\n    for (key in two_map) {\n      if (hasOwn.call(two_map, key)) {\n        if (!checked[key]) {\n          // two contains a parameter not present in one\n          return false;\n        }\n      }\n    }\n\n    return true;\n  };\n\n  // state\n  p.preventInvalidHostname = function(v) {\n    this._parts.preventInvalidHostname = !!v;\n    return this;\n  };\n\n  p.duplicateQueryParameters = function(v) {\n    this._parts.duplicateQueryParameters = !!v;\n    return this;\n  };\n\n  p.escapeQuerySpace = function(v) {\n    this._parts.escapeQuerySpace = !!v;\n    return this;\n  };\n\n  return URI;\n}));\n", "const {\n  entries,\n  setPrototypeOf,\n  isFrozen,\n  getPrototypeOf,\n  getOwnPropertyDescriptor,\n} = Object;\n\nlet { freeze, seal, create } = Object; // eslint-disable-line import/no-mutable-exports\nlet { apply, construct } = typeof Reflect !== 'undefined' && Reflect;\n\nif (!freeze) {\n  freeze = function (x) {\n    return x;\n  };\n}\n\nif (!seal) {\n  seal = function (x) {\n    return x;\n  };\n}\n\nif (!apply) {\n  apply = function (fun, thisValue, args) {\n    return fun.apply(thisValue, args);\n  };\n}\n\nif (!construct) {\n  construct = function (Func, args) {\n    return new Func(...args);\n  };\n}\n\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayIndexOf = unapply(Array.prototype.indexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySlice = unapply(Array.prototype.slice);\n\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\n\nconst regExpTest = unapply(RegExp.prototype.test);\n\nconst typeErrorCreate = unconstruct(TypeError);\n\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n  return (thisArg, ...args) => apply(func, thisArg, args);\n}\n\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(func) {\n  return (...args) => construct(func, args);\n}\n\n/**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\nfunction addToSet(set, array, transformCaseFunc = stringToLowerCase) {\n  if (setPrototypeOf) {\n    // Make 'in' and truthy checks like Boolean(set.constructor)\n    // independent of any properties defined on Object.prototype.\n    // Prevent prototype setters from intercepting set as a this value.\n    setPrototypeOf(set, null);\n  }\n\n  let l = array.length;\n  while (l--) {\n    let element = array[l];\n    if (typeof element === 'string') {\n      const lcElement = transformCaseFunc(element);\n      if (lcElement !== element) {\n        // Config presets (e.g. tags.js, attrs.js) are immutable.\n        if (!isFrozen(array)) {\n          array[l] = lcElement;\n        }\n\n        element = lcElement;\n      }\n    }\n\n    set[element] = true;\n  }\n\n  return set;\n}\n\n/**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\nexport function clone(object) {\n  const newObject = create(null);\n\n  for (const [property, value] of entries(object)) {\n    if (getOwnPropertyDescriptor(object, property) !== undefined) {\n      newObject[property] = value;\n    }\n  }\n\n  return newObject;\n}\n\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n  while (object !== null) {\n    const desc = getOwnPropertyDescriptor(object, prop);\n\n    if (desc) {\n      if (desc.get) {\n        return unapply(desc.get);\n      }\n\n      if (typeof desc.value === 'function') {\n        return unapply(desc.value);\n      }\n    }\n\n    object = getPrototypeOf(object);\n  }\n\n  function fallbackValue(element) {\n    console.warn('fallback value for', element);\n    return null;\n  }\n\n  return fallbackValue;\n}\n\nexport {\n  // Array\n  arrayForEach,\n  arrayIndexOf,\n  arrayPop,\n  arrayPush,\n  arraySlice,\n  // Object\n  entries,\n  freeze,\n  getPrototypeOf,\n  getOwnPropertyDescriptor,\n  isFrozen,\n  setPrototypeOf,\n  seal,\n  create,\n  // RegExp\n  regExpTest,\n  // String\n  stringIndexOf,\n  stringMatch,\n  stringReplace,\n  stringToLowerCase,\n  stringToString,\n  stringTrim,\n  // Errors\n  typeErrorCreate,\n  // Other\n  lookupGetter,\n  addToSet,\n  // Reflect\n  unapply,\n  unconstruct,\n};\n", "import { freeze } from './utils.js';\n\nexport const html = freeze([\n  'a',\n  'abbr',\n  'acronym',\n  'address',\n  'area',\n  'article',\n  'aside',\n  'audio',\n  'b',\n  'bdi',\n  'bdo',\n  'big',\n  'blink',\n  'blockquote',\n  'body',\n  'br',\n  'button',\n  'canvas',\n  'caption',\n  'center',\n  'cite',\n  'code',\n  'col',\n  'colgroup',\n  'content',\n  'data',\n  'datalist',\n  'dd',\n  'decorator',\n  'del',\n  'details',\n  'dfn',\n  'dialog',\n  'dir',\n  'div',\n  'dl',\n  'dt',\n  'element',\n  'em',\n  'fieldset',\n  'figcaption',\n  'figure',\n  'font',\n  'footer',\n  'form',\n  'h1',\n  'h2',\n  'h3',\n  'h4',\n  'h5',\n  'h6',\n  'head',\n  'header',\n  'hgroup',\n  'hr',\n  'html',\n  'i',\n  'img',\n  'input',\n  'ins',\n  'kbd',\n  'label',\n  'legend',\n  'li',\n  'main',\n  'map',\n  'mark',\n  'marquee',\n  'menu',\n  'menuitem',\n  'meter',\n  'nav',\n  'nobr',\n  'ol',\n  'optgroup',\n  'option',\n  'output',\n  'p',\n  'picture',\n  'pre',\n  'progress',\n  'q',\n  'rp',\n  'rt',\n  'ruby',\n  's',\n  'samp',\n  'section',\n  'select',\n  'shadow',\n  'small',\n  'source',\n  'spacer',\n  'span',\n  'strike',\n  'strong',\n  'style',\n  'sub',\n  'summary',\n  'sup',\n  'table',\n  'tbody',\n  'td',\n  'template',\n  'textarea',\n  'tfoot',\n  'th',\n  'thead',\n  'time',\n  'tr',\n  'track',\n  'tt',\n  'u',\n  'ul',\n  'var',\n  'video',\n  'wbr',\n]);\n\n// SVG\nexport const svg = freeze([\n  'svg',\n  'a',\n  'altglyph',\n  'altglyphdef',\n  'altglyphitem',\n  'animatecolor',\n  'animatemotion',\n  'animatetransform',\n  'circle',\n  'clippath',\n  'defs',\n  'desc',\n  'ellipse',\n  'filter',\n  'font',\n  'g',\n  'glyph',\n  'glyphref',\n  'hkern',\n  'image',\n  'line',\n  'lineargradient',\n  'marker',\n  'mask',\n  'metadata',\n  'mpath',\n  'path',\n  'pattern',\n  'polygon',\n  'polyline',\n  'radialgradient',\n  'rect',\n  'stop',\n  'style',\n  'switch',\n  'symbol',\n  'text',\n  'textpath',\n  'title',\n  'tref',\n  'tspan',\n  'view',\n  'vkern',\n]);\n\nexport const svgFilters = freeze([\n  'feBlend',\n  'feColorMatrix',\n  'feComponentTransfer',\n  'feComposite',\n  'feConvolveMatrix',\n  'feDiffuseLighting',\n  'feDisplacementMap',\n  'feDistantLight',\n  'feDropShadow',\n  'feFlood',\n  'feFuncA',\n  'feFuncB',\n  'feFuncG',\n  'feFuncR',\n  'feGaussianBlur',\n  'feImage',\n  'feMerge',\n  'feMergeNode',\n  'feMorphology',\n  'feOffset',\n  'fePointLight',\n  'feSpecularLighting',\n  'feSpotLight',\n  'feTile',\n  'feTurbulence',\n]);\n\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nexport const svgDisallowed = freeze([\n  'animate',\n  'color-profile',\n  'cursor',\n  'discard',\n  'font-face',\n  'font-face-format',\n  'font-face-name',\n  'font-face-src',\n  'font-face-uri',\n  'foreignobject',\n  'hatch',\n  'hatchpath',\n  'mesh',\n  'meshgradient',\n  'meshpatch',\n  'meshrow',\n  'missing-glyph',\n  'script',\n  'set',\n  'solidcolor',\n  'unknown',\n  'use',\n]);\n\nexport const mathMl = freeze([\n  'math',\n  'menclose',\n  'merror',\n  'mfenced',\n  'mfrac',\n  'mglyph',\n  'mi',\n  'mlabeledtr',\n  'mmultiscripts',\n  'mn',\n  'mo',\n  'mover',\n  'mpadded',\n  'mphantom',\n  'mroot',\n  'mrow',\n  'ms',\n  'mspace',\n  'msqrt',\n  'mstyle',\n  'msub',\n  'msup',\n  'msubsup',\n  'mtable',\n  'mtd',\n  'mtext',\n  'mtr',\n  'munder',\n  'munderover',\n  'mprescripts',\n]);\n\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nexport const mathMlDisallowed = freeze([\n  'maction',\n  'maligngroup',\n  'malignmark',\n  'mlongdiv',\n  'mscarries',\n  'mscarry',\n  'msgroup',\n  'mstack',\n  'msline',\n  'msrow',\n  'semantics',\n  'annotation',\n  'annotation-xml',\n  'mprescripts',\n  'none',\n]);\n\nexport const text = freeze(['#text']);\n", "import { freeze } from './utils.js';\n\nexport const html = freeze([\n  'accept',\n  'action',\n  'align',\n  'alt',\n  'autocapitalize',\n  'autocomplete',\n  'autopictureinpicture',\n  'autoplay',\n  'background',\n  'bgcolor',\n  'border',\n  'capture',\n  'cellpadding',\n  'cellspacing',\n  'checked',\n  'cite',\n  'class',\n  'clear',\n  'color',\n  'cols',\n  'colspan',\n  'controls',\n  'controlslist',\n  'coords',\n  'crossorigin',\n  'datetime',\n  'decoding',\n  'default',\n  'dir',\n  'disabled',\n  'disablepictureinpicture',\n  'disableremoteplayback',\n  'download',\n  'draggable',\n  'enctype',\n  'enterkeyhint',\n  'face',\n  'for',\n  'headers',\n  'height',\n  'hidden',\n  'high',\n  'href',\n  'hreflang',\n  'id',\n  'inputmode',\n  'integrity',\n  'ismap',\n  'kind',\n  'label',\n  'lang',\n  'list',\n  'loading',\n  'loop',\n  'low',\n  'max',\n  'maxlength',\n  'media',\n  'method',\n  'min',\n  'minlength',\n  'multiple',\n  'muted',\n  'name',\n  'nonce',\n  'noshade',\n  'novalidate',\n  'nowrap',\n  'open',\n  'optimum',\n  'pattern',\n  'placeholder',\n  'playsinline',\n  'poster',\n  'preload',\n  'pubdate',\n  'radiogroup',\n  'readonly',\n  'rel',\n  'required',\n  'rev',\n  'reversed',\n  'role',\n  'rows',\n  'rowspan',\n  'spellcheck',\n  'scope',\n  'selected',\n  'shape',\n  'size',\n  'sizes',\n  'span',\n  'srclang',\n  'start',\n  'src',\n  'srcset',\n  'step',\n  'style',\n  'summary',\n  'tabindex',\n  'title',\n  'translate',\n  'type',\n  'usemap',\n  'valign',\n  'value',\n  'width',\n  'xmlns',\n  'slot',\n]);\n\nexport const svg = freeze([\n  'accent-height',\n  'accumulate',\n  'additive',\n  'alignment-baseline',\n  'ascent',\n  'attributename',\n  'attributetype',\n  'azimuth',\n  'basefrequency',\n  'baseline-shift',\n  'begin',\n  'bias',\n  'by',\n  'class',\n  'clip',\n  'clippathunits',\n  'clip-path',\n  'clip-rule',\n  'color',\n  'color-interpolation',\n  'color-interpolation-filters',\n  'color-profile',\n  'color-rendering',\n  'cx',\n  'cy',\n  'd',\n  'dx',\n  'dy',\n  'diffuseconstant',\n  'direction',\n  'display',\n  'divisor',\n  'dur',\n  'edgemode',\n  'elevation',\n  'end',\n  'fill',\n  'fill-opacity',\n  'fill-rule',\n  'filter',\n  'filterunits',\n  'flood-color',\n  'flood-opacity',\n  'font-family',\n  'font-size',\n  'font-size-adjust',\n  'font-stretch',\n  'font-style',\n  'font-variant',\n  'font-weight',\n  'fx',\n  'fy',\n  'g1',\n  'g2',\n  'glyph-name',\n  'glyphref',\n  'gradientunits',\n  'gradienttransform',\n  'height',\n  'href',\n  'id',\n  'image-rendering',\n  'in',\n  'in2',\n  'k',\n  'k1',\n  'k2',\n  'k3',\n  'k4',\n  'kerning',\n  'keypoints',\n  'keysplines',\n  'keytimes',\n  'lang',\n  'lengthadjust',\n  'letter-spacing',\n  'kernelmatrix',\n  'kernelunitlength',\n  'lighting-color',\n  'local',\n  'marker-end',\n  'marker-mid',\n  'marker-start',\n  'markerheight',\n  'markerunits',\n  'markerwidth',\n  'maskcontentunits',\n  'maskunits',\n  'max',\n  'mask',\n  'media',\n  'method',\n  'mode',\n  'min',\n  'name',\n  'numoctaves',\n  'offset',\n  'operator',\n  'opacity',\n  'order',\n  'orient',\n  'orientation',\n  'origin',\n  'overflow',\n  'paint-order',\n  'path',\n  'pathlength',\n  'patterncontentunits',\n  'patterntransform',\n  'patternunits',\n  'points',\n  'preservealpha',\n  'preserveaspectratio',\n  'primitiveunits',\n  'r',\n  'rx',\n  'ry',\n  'radius',\n  'refx',\n  'refy',\n  'repeatcount',\n  'repeatdur',\n  'restart',\n  'result',\n  'rotate',\n  'scale',\n  'seed',\n  'shape-rendering',\n  'specularconstant',\n  'specularexponent',\n  'spreadmethod',\n  'startoffset',\n  'stddeviation',\n  'stitchtiles',\n  'stop-color',\n  'stop-opacity',\n  'stroke-dasharray',\n  'stroke-dashoffset',\n  'stroke-linecap',\n  'stroke-linejoin',\n  'stroke-miterlimit',\n  'stroke-opacity',\n  'stroke',\n  'stroke-width',\n  'style',\n  'surfacescale',\n  'systemlanguage',\n  'tabindex',\n  'targetx',\n  'targety',\n  'transform',\n  'transform-origin',\n  'text-anchor',\n  'text-decoration',\n  'text-rendering',\n  'textlength',\n  'type',\n  'u1',\n  'u2',\n  'unicode',\n  'values',\n  'viewbox',\n  'visibility',\n  'version',\n  'vert-adv-y',\n  'vert-origin-x',\n  'vert-origin-y',\n  'width',\n  'word-spacing',\n  'wrap',\n  'writing-mode',\n  'xchannelselector',\n  'ychannelselector',\n  'x',\n  'x1',\n  'x2',\n  'xmlns',\n  'y',\n  'y1',\n  'y2',\n  'z',\n  'zoomandpan',\n]);\n\nexport const mathMl = freeze([\n  'accent',\n  'accentunder',\n  'align',\n  'bevelled',\n  'close',\n  'columnsalign',\n  'columnlines',\n  'columnspan',\n  'denomalign',\n  'depth',\n  'dir',\n  'display',\n  'displaystyle',\n  'encoding',\n  'fence',\n  'frame',\n  'height',\n  'href',\n  'id',\n  'largeop',\n  'length',\n  'linethickness',\n  'lspace',\n  'lquote',\n  'mathbackground',\n  'mathcolor',\n  'mathsize',\n  'mathvariant',\n  'maxsize',\n  'minsize',\n  'movablelimits',\n  'notation',\n  'numalign',\n  'open',\n  'rowalign',\n  'rowlines',\n  'rowspacing',\n  'rowspan',\n  'rspace',\n  'rquote',\n  'scriptlevel',\n  'scriptminsize',\n  'scriptsizemultiplier',\n  'selection',\n  'separator',\n  'separators',\n  'stretchy',\n  'subscriptshift',\n  'supscriptshift',\n  'symmetric',\n  'voffset',\n  'width',\n  'xmlns',\n]);\n\nexport const xml = freeze([\n  'xlink:href',\n  'xml:id',\n  'xlink:title',\n  'xml:space',\n  'xmlns:xlink',\n]);\n", "import { seal } from './utils.js';\n\n// eslint-disable-next-line unicorn/better-regex\nexport const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nexport const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nexport const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\nexport const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\nexport const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nexport const IS_ALLOWED_URI = seal(\n  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nexport const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nexport const ATTR_WHITESPACE = seal(\n  /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nexport const DOCTYPE_NAME = seal(/^html$/i);\n", "import * as TAGS from './tags.js';\nimport * as ATTRS from './attrs.js';\nimport * as EXPRESSIONS from './regexp.js';\nimport {\n  addToSet,\n  clone,\n  entries,\n  freeze,\n  arrayForEach,\n  arrayPop,\n  arrayPush,\n  stringMatch,\n  stringReplace,\n  stringToLowerCase,\n  stringToString,\n  stringIndexOf,\n  stringTrim,\n  regExpTest,\n  typeErrorCreate,\n  lookupGetter,\n  create,\n} from './utils.js';\n\nconst getGlobal = function () {\n  return typeof window === 'undefined' ? null : window;\n};\n\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function (trustedTypes, purifyHostElement) {\n  if (\n    typeof trustedTypes !== 'object' ||\n    typeof trustedTypes.createPolicy !== 'function'\n  ) {\n    return null;\n  }\n\n  // Allow the callers to control the unique policy name\n  // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n  // Policy creation with duplicate names throws in Trusted Types.\n  let suffix = null;\n  const ATTR_NAME = 'data-tt-policy-suffix';\n  if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n    suffix = purifyHostElement.getAttribute(ATTR_NAME);\n  }\n\n  const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n\n  try {\n    return trustedTypes.createPolicy(policyName, {\n      createHTML(html) {\n        return html;\n      },\n      createScriptURL(scriptUrl) {\n        return scriptUrl;\n      },\n    });\n  } catch (_) {\n    // Policy creation failed (most likely another DOMPurify script has\n    // already run). Skip creating the policy, as this will only cause errors\n    // if TT are enforced.\n    console.warn(\n      'TrustedTypes policy ' + policyName + ' could not be created.'\n    );\n    return null;\n  }\n};\n\nfunction createDOMPurify(window = getGlobal()) {\n  const DOMPurify = (root) => createDOMPurify(root);\n\n  /**\n   * Version label, exposed for easier checks\n   * if DOMPurify is up to date or not\n   */\n  DOMPurify.version = VERSION;\n\n  /**\n   * Array of elements that DOMPurify removed during sanitation.\n   * Empty if nothing was removed.\n   */\n  DOMPurify.removed = [];\n\n  if (!window || !window.document || window.document.nodeType !== 9) {\n    // Not running in a browser, provide a factory function\n    // so that you can pass your own Window\n    DOMPurify.isSupported = false;\n\n    return DOMPurify;\n  }\n\n  let { document } = window;\n\n  const originalDocument = document;\n  const currentScript = originalDocument.currentScript;\n  const {\n    DocumentFragment,\n    HTMLTemplateElement,\n    Node,\n    Element,\n    NodeFilter,\n    NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n    HTMLFormElement,\n    DOMParser,\n    trustedTypes,\n  } = window;\n\n  const ElementPrototype = Element.prototype;\n\n  const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n  const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n  const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n  const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n  // As per issue #47, the web-components registry is inherited by a\n  // new document created via createHTMLDocument. As per the spec\n  // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n  // a new empty registry is used when creating a template contents owner\n  // document, so we use that as our parent document to ensure nothing\n  // is inherited.\n  if (typeof HTMLTemplateElement === 'function') {\n    const template = document.createElement('template');\n    if (template.content && template.content.ownerDocument) {\n      document = template.content.ownerDocument;\n    }\n  }\n\n  let trustedTypesPolicy;\n  let emptyHTML = '';\n\n  const {\n    implementation,\n    createNodeIterator,\n    createDocumentFragment,\n    getElementsByTagName,\n  } = document;\n  const { importNode } = originalDocument;\n\n  let hooks = {};\n\n  /**\n   * Expose whether this browser supports running the full DOMPurify.\n   */\n  DOMPurify.isSupported =\n    typeof entries === 'function' &&\n    typeof getParentNode === 'function' &&\n    implementation &&\n    implementation.createHTMLDocument !== undefined;\n\n  const {\n    MUSTACHE_EXPR,\n    ERB_EXPR,\n    TMPLIT_EXPR,\n    DATA_ATTR,\n    ARIA_ATTR,\n    IS_SCRIPT_OR_DATA,\n    ATTR_WHITESPACE,\n  } = EXPRESSIONS;\n\n  let { IS_ALLOWED_URI } = EXPRESSIONS;\n\n  /**\n   * We consider the elements and attributes below to be safe. Ideally\n   * don't add any new ones but feel free to remove unwanted ones.\n   */\n\n  /* allowed element names */\n  let ALLOWED_TAGS = null;\n  const DEFAULT_ALLOWED_TAGS = addToSet({}, [\n    ...TAGS.html,\n    ...TAGS.svg,\n    ...TAGS.svgFilters,\n    ...TAGS.mathMl,\n    ...TAGS.text,\n  ]);\n\n  /* Allowed attribute names */\n  let ALLOWED_ATTR = null;\n  const DEFAULT_ALLOWED_ATTR = addToSet({}, [\n    ...ATTRS.html,\n    ...ATTRS.svg,\n    ...ATTRS.mathMl,\n    ...ATTRS.xml,\n  ]);\n\n  /*\n   * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n   * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n   * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n   * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n   */\n  let CUSTOM_ELEMENT_HANDLING = Object.seal(\n    create(null, {\n      tagNameCheck: {\n        writable: true,\n        configurable: false,\n        enumerable: true,\n        value: null,\n      },\n      attributeNameCheck: {\n        writable: true,\n        configurable: false,\n        enumerable: true,\n        value: null,\n      },\n      allowCustomizedBuiltInElements: {\n        writable: true,\n        configurable: false,\n        enumerable: true,\n        value: false,\n      },\n    })\n  );\n\n  /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n  let FORBID_TAGS = null;\n\n  /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n  let FORBID_ATTR = null;\n\n  /* Decide if ARIA attributes are okay */\n  let ALLOW_ARIA_ATTR = true;\n\n  /* Decide if custom data attributes are okay */\n  let ALLOW_DATA_ATTR = true;\n\n  /* Decide if unknown protocols are okay */\n  let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n  /* Decide if self-closing tags in attributes are allowed.\n   * Usually removed due to a mXSS issue in jQuery 3.0 */\n  let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n  /* Output should be safe for common template engines.\n   * This means, DOMPurify removes data attributes, mustaches and ERB\n   */\n  let SAFE_FOR_TEMPLATES = false;\n\n  /* Decide if document with <html>... should be returned */\n  let WHOLE_DOCUMENT = false;\n\n  /* Track whether config is already set on this instance of DOMPurify. */\n  let SET_CONFIG = false;\n\n  /* Decide if all elements (e.g. style, script) must be children of\n   * document.body. By default, browsers might move them to document.head */\n  let FORCE_BODY = false;\n\n  /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n   * string (or a TrustedHTML object if Trusted Types are supported).\n   * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n   */\n  let RETURN_DOM = false;\n\n  /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n   * string  (or a TrustedHTML object if Trusted Types are supported) */\n  let RETURN_DOM_FRAGMENT = false;\n\n  /* Try to return a Trusted Type object instead of a string, return a string in\n   * case Trusted Types are not supported  */\n  let RETURN_TRUSTED_TYPE = false;\n\n  /* Output should be free from DOM clobbering attacks?\n   * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n   */\n  let SANITIZE_DOM = true;\n\n  /* Achieve full DOM Clobbering protection by isolating the namespace of named\n   * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n   *\n   * HTML/DOM spec rules that enable DOM Clobbering:\n   *   - Named Access on Window (§7.3.3)\n   *   - DOM Tree Accessors (§3.1.5)\n   *   - Form Element Parent-Child Relations (§4.10.3)\n   *   - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n   *   - HTMLCollection (§4.2.10.2)\n   *\n   * Namespace isolation is implemented by prefixing `id` and `name` attributes\n   * with a constant string, i.e., `user-content-`\n   */\n  let SANITIZE_NAMED_PROPS = false;\n  const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n  /* Keep element content when removing element? */\n  let KEEP_CONTENT = true;\n\n  /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n   * of importing it into a new Document and returning a sanitized copy */\n  let IN_PLACE = false;\n\n  /* Allow usage of profiles like html, svg and mathMl */\n  let USE_PROFILES = {};\n\n  /* Tags to ignore content of when KEEP_CONTENT is true */\n  let FORBID_CONTENTS = null;\n  const DEFAULT_FORBID_CONTENTS = addToSet({}, [\n    'annotation-xml',\n    'audio',\n    'colgroup',\n    'desc',\n    'foreignobject',\n    'head',\n    'iframe',\n    'math',\n    'mi',\n    'mn',\n    'mo',\n    'ms',\n    'mtext',\n    'noembed',\n    'noframes',\n    'noscript',\n    'plaintext',\n    'script',\n    'style',\n    'svg',\n    'template',\n    'thead',\n    'title',\n    'video',\n    'xmp',\n  ]);\n\n  /* Tags that are safe for data: URIs */\n  let DATA_URI_TAGS = null;\n  const DEFAULT_DATA_URI_TAGS = addToSet({}, [\n    'audio',\n    'video',\n    'img',\n    'source',\n    'image',\n    'track',\n  ]);\n\n  /* Attributes safe for values like \"javascript:\" */\n  let URI_SAFE_ATTRIBUTES = null;\n  const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [\n    'alt',\n    'class',\n    'for',\n    'id',\n    'label',\n    'name',\n    'pattern',\n    'placeholder',\n    'role',\n    'summary',\n    'title',\n    'value',\n    'style',\n    'xmlns',\n  ]);\n\n  const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n  const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n  const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n  /* Document namespace */\n  let NAMESPACE = HTML_NAMESPACE;\n  let IS_EMPTY_INPUT = false;\n\n  /* Allowed XHTML+XML namespaces */\n  let ALLOWED_NAMESPACES = null;\n  const DEFAULT_ALLOWED_NAMESPACES = addToSet(\n    {},\n    [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE],\n    stringToString\n  );\n\n  /* Parsing of strict XHTML documents */\n  let PARSER_MEDIA_TYPE = null;\n  const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n  const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n  let transformCaseFunc = null;\n\n  /* Keep a reference to config to pass to hooks */\n  let CONFIG = null;\n\n  /* Ideally, do not touch anything below this line */\n  /* ______________________________________________ */\n\n  const formElement = document.createElement('form');\n\n  const isRegexOrFunction = function (testValue) {\n    return testValue instanceof RegExp || testValue instanceof Function;\n  };\n\n  /**\n   * _parseConfig\n   *\n   * @param  {Object} cfg optional config literal\n   */\n  // eslint-disable-next-line complexity\n  const _parseConfig = function (cfg = {}) {\n    if (CONFIG && CONFIG === cfg) {\n      return;\n    }\n\n    /* Shield configuration object from tampering */\n    if (!cfg || typeof cfg !== 'object') {\n      cfg = {};\n    }\n\n    /* Shield configuration object from prototype pollution */\n    cfg = clone(cfg);\n\n    PARSER_MEDIA_TYPE =\n      // eslint-disable-next-line unicorn/prefer-includes\n      SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1\n        ? (PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE)\n        : (PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE);\n\n    // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n    transformCaseFunc =\n      PARSER_MEDIA_TYPE === 'application/xhtml+xml'\n        ? stringToString\n        : stringToLowerCase;\n\n    /* Set configuration parameters */\n    ALLOWED_TAGS =\n      'ALLOWED_TAGS' in cfg\n        ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc)\n        : DEFAULT_ALLOWED_TAGS;\n    ALLOWED_ATTR =\n      'ALLOWED_ATTR' in cfg\n        ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc)\n        : DEFAULT_ALLOWED_ATTR;\n    ALLOWED_NAMESPACES =\n      'ALLOWED_NAMESPACES' in cfg\n        ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString)\n        : DEFAULT_ALLOWED_NAMESPACES;\n    URI_SAFE_ATTRIBUTES =\n      'ADD_URI_SAFE_ATTR' in cfg\n        ? addToSet(\n            clone(DEFAULT_URI_SAFE_ATTRIBUTES), // eslint-disable-line indent\n            cfg.ADD_URI_SAFE_ATTR, // eslint-disable-line indent\n            transformCaseFunc // eslint-disable-line indent\n          ) // eslint-disable-line indent\n        : DEFAULT_URI_SAFE_ATTRIBUTES;\n    DATA_URI_TAGS =\n      'ADD_DATA_URI_TAGS' in cfg\n        ? addToSet(\n            clone(DEFAULT_DATA_URI_TAGS), // eslint-disable-line indent\n            cfg.ADD_DATA_URI_TAGS, // eslint-disable-line indent\n            transformCaseFunc // eslint-disable-line indent\n          ) // eslint-disable-line indent\n        : DEFAULT_DATA_URI_TAGS;\n    FORBID_CONTENTS =\n      'FORBID_CONTENTS' in cfg\n        ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc)\n        : DEFAULT_FORBID_CONTENTS;\n    FORBID_TAGS =\n      'FORBID_TAGS' in cfg\n        ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc)\n        : {};\n    FORBID_ATTR =\n      'FORBID_ATTR' in cfg\n        ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc)\n        : {};\n    USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;\n    ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n    ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n    ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n    ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n    SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n    WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n    RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n    RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n    RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n    FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n    SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n    SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n    KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n    IN_PLACE = cfg.IN_PLACE || false; // Default false\n    IS_ALLOWED_URI = cfg.ALLOWED_URI_REGEXP || EXPRESSIONS.IS_ALLOWED_URI;\n    NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n    CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n    if (\n      cfg.CUSTOM_ELEMENT_HANDLING &&\n      isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)\n    ) {\n      CUSTOM_ELEMENT_HANDLING.tagNameCheck =\n        cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n    }\n\n    if (\n      cfg.CUSTOM_ELEMENT_HANDLING &&\n      isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)\n    ) {\n      CUSTOM_ELEMENT_HANDLING.attributeNameCheck =\n        cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n    }\n\n    if (\n      cfg.CUSTOM_ELEMENT_HANDLING &&\n      typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements ===\n        'boolean'\n    ) {\n      CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements =\n        cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n    }\n\n    if (SAFE_FOR_TEMPLATES) {\n      ALLOW_DATA_ATTR = false;\n    }\n\n    if (RETURN_DOM_FRAGMENT) {\n      RETURN_DOM = true;\n    }\n\n    /* Parse profile info */\n    if (USE_PROFILES) {\n      ALLOWED_TAGS = addToSet({}, [...TAGS.text]);\n      ALLOWED_ATTR = [];\n      if (USE_PROFILES.html === true) {\n        addToSet(ALLOWED_TAGS, TAGS.html);\n        addToSet(ALLOWED_ATTR, ATTRS.html);\n      }\n\n      if (USE_PROFILES.svg === true) {\n        addToSet(ALLOWED_TAGS, TAGS.svg);\n        addToSet(ALLOWED_ATTR, ATTRS.svg);\n        addToSet(ALLOWED_ATTR, ATTRS.xml);\n      }\n\n      if (USE_PROFILES.svgFilters === true) {\n        addToSet(ALLOWED_TAGS, TAGS.svgFilters);\n        addToSet(ALLOWED_ATTR, ATTRS.svg);\n        addToSet(ALLOWED_ATTR, ATTRS.xml);\n      }\n\n      if (USE_PROFILES.mathMl === true) {\n        addToSet(ALLOWED_TAGS, TAGS.mathMl);\n        addToSet(ALLOWED_ATTR, ATTRS.mathMl);\n        addToSet(ALLOWED_ATTR, ATTRS.xml);\n      }\n    }\n\n    /* Merge configuration parameters */\n    if (cfg.ADD_TAGS) {\n      if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n        ALLOWED_TAGS = clone(ALLOWED_TAGS);\n      }\n\n      addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n    }\n\n    if (cfg.ADD_ATTR) {\n      if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n        ALLOWED_ATTR = clone(ALLOWED_ATTR);\n      }\n\n      addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n    }\n\n    if (cfg.ADD_URI_SAFE_ATTR) {\n      addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n    }\n\n    if (cfg.FORBID_CONTENTS) {\n      if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n        FORBID_CONTENTS = clone(FORBID_CONTENTS);\n      }\n\n      addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n    }\n\n    /* Add #text in case KEEP_CONTENT is set to true */\n    if (KEEP_CONTENT) {\n      ALLOWED_TAGS['#text'] = true;\n    }\n\n    /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n    if (WHOLE_DOCUMENT) {\n      addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n    }\n\n    /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n    if (ALLOWED_TAGS.table) {\n      addToSet(ALLOWED_TAGS, ['tbody']);\n      delete FORBID_TAGS.tbody;\n    }\n\n    if (cfg.TRUSTED_TYPES_POLICY) {\n      if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n        throw typeErrorCreate(\n          'TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.'\n        );\n      }\n\n      if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n        throw typeErrorCreate(\n          'TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.'\n        );\n      }\n\n      // Overwrite existing TrustedTypes policy.\n      trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n      // Sign local variables required by `sanitize`.\n      emptyHTML = trustedTypesPolicy.createHTML('');\n    } else {\n      // Uninitialized policy, attempt to initialize the internal dompurify policy.\n      if (trustedTypesPolicy === undefined) {\n        trustedTypesPolicy = _createTrustedTypesPolicy(\n          trustedTypes,\n          currentScript\n        );\n      }\n\n      // If creating the internal policy succeeded sign internal variables.\n      if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n        emptyHTML = trustedTypesPolicy.createHTML('');\n      }\n    }\n\n    // Prevent further manipulation of configuration.\n    // Not available in IE8, Safari 5, etc.\n    if (freeze) {\n      freeze(cfg);\n    }\n\n    CONFIG = cfg;\n  };\n\n  const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, [\n    'mi',\n    'mo',\n    'mn',\n    'ms',\n    'mtext',\n  ]);\n\n  const HTML_INTEGRATION_POINTS = addToSet({}, [\n    'foreignobject',\n    'desc',\n    'title',\n    'annotation-xml',\n  ]);\n\n  // Certain elements are allowed in both SVG and HTML\n  // namespace. We need to specify them explicitly\n  // so that they don't get erroneously deleted from\n  // HTML namespace.\n  const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [\n    'title',\n    'style',\n    'font',\n    'a',\n    'script',\n  ]);\n\n  /* Keep track of all possible SVG and MathML tags\n   * so that we can perform the namespace checks\n   * correctly. */\n  const ALL_SVG_TAGS = addToSet({}, TAGS.svg);\n  addToSet(ALL_SVG_TAGS, TAGS.svgFilters);\n  addToSet(ALL_SVG_TAGS, TAGS.svgDisallowed);\n\n  const ALL_MATHML_TAGS = addToSet({}, TAGS.mathMl);\n  addToSet(ALL_MATHML_TAGS, TAGS.mathMlDisallowed);\n\n  /**\n   * @param  {Element} element a DOM element whose namespace is being checked\n   * @returns {boolean} Return false if the element has a\n   *  namespace that a spec-compliant parser would never\n   *  return. Return true otherwise.\n   */\n  const _checkValidNamespace = function (element) {\n    let parent = getParentNode(element);\n\n    // In JSDOM, if we're inside shadow DOM, then parentNode\n    // can be null. We just simulate parent in this case.\n    if (!parent || !parent.tagName) {\n      parent = {\n        namespaceURI: NAMESPACE,\n        tagName: 'template',\n      };\n    }\n\n    const tagName = stringToLowerCase(element.tagName);\n    const parentTagName = stringToLowerCase(parent.tagName);\n\n    if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n      return false;\n    }\n\n    if (element.namespaceURI === SVG_NAMESPACE) {\n      // The only way to switch from HTML namespace to SVG\n      // is via <svg>. If it happens via any other tag, then\n      // it should be killed.\n      if (parent.namespaceURI === HTML_NAMESPACE) {\n        return tagName === 'svg';\n      }\n\n      // The only way to switch from MathML to SVG is via`\n      // svg if parent is either <annotation-xml> or MathML\n      // text integration points.\n      if (parent.namespaceURI === MATHML_NAMESPACE) {\n        return (\n          tagName === 'svg' &&\n          (parentTagName === 'annotation-xml' ||\n            MATHML_TEXT_INTEGRATION_POINTS[parentTagName])\n        );\n      }\n\n      // We only allow elements that are defined in SVG\n      // spec. All others are disallowed in SVG namespace.\n      return Boolean(ALL_SVG_TAGS[tagName]);\n    }\n\n    if (element.namespaceURI === MATHML_NAMESPACE) {\n      // The only way to switch from HTML namespace to MathML\n      // is via <math>. If it happens via any other tag, then\n      // it should be killed.\n      if (parent.namespaceURI === HTML_NAMESPACE) {\n        return tagName === 'math';\n      }\n\n      // The only way to switch from SVG to MathML is via\n      // <math> and HTML integration points\n      if (parent.namespaceURI === SVG_NAMESPACE) {\n        return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n      }\n\n      // We only allow elements that are defined in MathML\n      // spec. All others are disallowed in MathML namespace.\n      return Boolean(ALL_MATHML_TAGS[tagName]);\n    }\n\n    if (element.namespaceURI === HTML_NAMESPACE) {\n      // The only way to switch from SVG to HTML is via\n      // HTML integration points, and from MathML to HTML\n      // is via MathML text integration points\n      if (\n        parent.namespaceURI === SVG_NAMESPACE &&\n        !HTML_INTEGRATION_POINTS[parentTagName]\n      ) {\n        return false;\n      }\n\n      if (\n        parent.namespaceURI === MATHML_NAMESPACE &&\n        !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]\n      ) {\n        return false;\n      }\n\n      // We disallow tags that are specific for MathML\n      // or SVG and should never appear in HTML namespace\n      return (\n        !ALL_MATHML_TAGS[tagName] &&\n        (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName])\n      );\n    }\n\n    // For XHTML and XML documents that support custom namespaces\n    if (\n      PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n      ALLOWED_NAMESPACES[element.namespaceURI]\n    ) {\n      return true;\n    }\n\n    // The code should never reach this place (this means\n    // that the element somehow got namespace that is not\n    // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n    // Return false just in case.\n    return false;\n  };\n\n  /**\n   * _forceRemove\n   *\n   * @param  {Node} node a DOM node\n   */\n  const _forceRemove = function (node) {\n    arrayPush(DOMPurify.removed, { element: node });\n    try {\n      // eslint-disable-next-line unicorn/prefer-dom-node-remove\n      node.parentNode.removeChild(node);\n    } catch (_) {\n      node.remove();\n    }\n  };\n\n  /**\n   * _removeAttribute\n   *\n   * @param  {String} name an Attribute name\n   * @param  {Node} node a DOM node\n   */\n  const _removeAttribute = function (name, node) {\n    try {\n      arrayPush(DOMPurify.removed, {\n        attribute: node.getAttributeNode(name),\n        from: node,\n      });\n    } catch (_) {\n      arrayPush(DOMPurify.removed, {\n        attribute: null,\n        from: node,\n      });\n    }\n\n    node.removeAttribute(name);\n\n    // We void attribute values for unremovable \"is\"\" attributes\n    if (name === 'is' && !ALLOWED_ATTR[name]) {\n      if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n        try {\n          _forceRemove(node);\n        } catch (_) {}\n      } else {\n        try {\n          node.setAttribute(name, '');\n        } catch (_) {}\n      }\n    }\n  };\n\n  /**\n   * _initDocument\n   *\n   * @param  {String} dirty a string of dirty markup\n   * @return {Document} a DOM, filled with the dirty markup\n   */\n  const _initDocument = function (dirty) {\n    /* Create a HTML document */\n    let doc = null;\n    let leadingWhitespace = null;\n\n    if (FORCE_BODY) {\n      dirty = '<remove></remove>' + dirty;\n    } else {\n      /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n      const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n      leadingWhitespace = matches && matches[0];\n    }\n\n    if (\n      PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n      NAMESPACE === HTML_NAMESPACE\n    ) {\n      // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n      dirty =\n        '<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>' +\n        dirty +\n        '</body></html>';\n    }\n\n    const dirtyPayload = trustedTypesPolicy\n      ? trustedTypesPolicy.createHTML(dirty)\n      : dirty;\n    /*\n     * Use the DOMParser API by default, fallback later if needs be\n     * DOMParser not work for svg when has multiple root element.\n     */\n    if (NAMESPACE === HTML_NAMESPACE) {\n      try {\n        doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n      } catch (_) {}\n    }\n\n    /* Use createHTMLDocument in case DOMParser is not available */\n    if (!doc || !doc.documentElement) {\n      doc = implementation.createDocument(NAMESPACE, 'template', null);\n      try {\n        doc.documentElement.innerHTML = IS_EMPTY_INPUT\n          ? emptyHTML\n          : dirtyPayload;\n      } catch (_) {\n        // Syntax error if dirtyPayload is invalid xml\n      }\n    }\n\n    const body = doc.body || doc.documentElement;\n\n    if (dirty && leadingWhitespace) {\n      body.insertBefore(\n        document.createTextNode(leadingWhitespace),\n        body.childNodes[0] || null\n      );\n    }\n\n    /* Work on whole document or just its body */\n    if (NAMESPACE === HTML_NAMESPACE) {\n      return getElementsByTagName.call(\n        doc,\n        WHOLE_DOCUMENT ? 'html' : 'body'\n      )[0];\n    }\n\n    return WHOLE_DOCUMENT ? doc.documentElement : body;\n  };\n\n  /**\n   * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n   *\n   * @param  {Node} root The root element or node to start traversing on.\n   * @return {NodeIterator} The created NodeIterator\n   */\n  const _createNodeIterator = function (root) {\n    return createNodeIterator.call(\n      root.ownerDocument || root,\n      root,\n      // eslint-disable-next-line no-bitwise\n      NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT,\n      null\n    );\n  };\n\n  /**\n   * _isClobbered\n   *\n   * @param  {Node} elm element to check for clobbering attacks\n   * @return {Boolean} true if clobbered, false if safe\n   */\n  const _isClobbered = function (elm) {\n    return (\n      elm instanceof HTMLFormElement &&\n      (typeof elm.nodeName !== 'string' ||\n        typeof elm.textContent !== 'string' ||\n        typeof elm.removeChild !== 'function' ||\n        !(elm.attributes instanceof NamedNodeMap) ||\n        typeof elm.removeAttribute !== 'function' ||\n        typeof elm.setAttribute !== 'function' ||\n        typeof elm.namespaceURI !== 'string' ||\n        typeof elm.insertBefore !== 'function' ||\n        typeof elm.hasChildNodes !== 'function')\n    );\n  };\n\n  /**\n   * Checks whether the given object is a DOM node.\n   *\n   * @param  {Node} object object to check whether it's a DOM node\n   * @return {Boolean} true is object is a DOM node\n   */\n  const _isNode = function (object) {\n    return typeof Node === 'function' && object instanceof Node;\n  };\n\n  /**\n   * _executeHook\n   * Execute user configurable hooks\n   *\n   * @param  {String} entryPoint  Name of the hook's entry point\n   * @param  {Node} currentNode node to work on with the hook\n   * @param  {Object} data additional hook parameters\n   */\n  const _executeHook = function (entryPoint, currentNode, data) {\n    if (!hooks[entryPoint]) {\n      return;\n    }\n\n    arrayForEach(hooks[entryPoint], (hook) => {\n      hook.call(DOMPurify, currentNode, data, CONFIG);\n    });\n  };\n\n  /**\n   * _sanitizeElements\n   *\n   * @protect nodeName\n   * @protect textContent\n   * @protect removeChild\n   *\n   * @param   {Node} currentNode to check for permission to exist\n   * @return  {Boolean} true if node was killed, false if left alive\n   */\n  const _sanitizeElements = function (currentNode) {\n    let content = null;\n\n    /* Execute a hook if present */\n    _executeHook('beforeSanitizeElements', currentNode, null);\n\n    /* Check if element is clobbered or can clobber */\n    if (_isClobbered(currentNode)) {\n      _forceRemove(currentNode);\n      return true;\n    }\n\n    /* Now let's check the element's type and name */\n    const tagName = transformCaseFunc(currentNode.nodeName);\n\n    /* Execute a hook if present */\n    _executeHook('uponSanitizeElement', currentNode, {\n      tagName,\n      allowedTags: ALLOWED_TAGS,\n    });\n\n    /* Detect mXSS attempts abusing namespace confusion */\n    if (\n      currentNode.hasChildNodes() &&\n      !_isNode(currentNode.firstElementChild) &&\n      regExpTest(/<[/\\w]/g, currentNode.innerHTML) &&\n      regExpTest(/<[/\\w]/g, currentNode.textContent)\n    ) {\n      _forceRemove(currentNode);\n      return true;\n    }\n\n    /* Remove element if anything forbids its presence */\n    if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n      /* Check if we have a custom element to handle */\n      if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n        if (\n          CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n          regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)\n        ) {\n          return false;\n        }\n\n        if (\n          CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n          CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)\n        ) {\n          return false;\n        }\n      }\n\n      /* Keep content except for bad-listed elements */\n      if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n        const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n        const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n\n        if (childNodes && parentNode) {\n          const childCount = childNodes.length;\n\n          for (let i = childCount - 1; i >= 0; --i) {\n            parentNode.insertBefore(\n              cloneNode(childNodes[i], true),\n              getNextSibling(currentNode)\n            );\n          }\n        }\n      }\n\n      _forceRemove(currentNode);\n      return true;\n    }\n\n    /* Check whether element has a valid namespace */\n    if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n      _forceRemove(currentNode);\n      return true;\n    }\n\n    /* Make sure that older browsers don't get fallback-tag mXSS */\n    if (\n      (tagName === 'noscript' ||\n        tagName === 'noembed' ||\n        tagName === 'noframes') &&\n      regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)\n    ) {\n      _forceRemove(currentNode);\n      return true;\n    }\n\n    /* Sanitize element content to be template-safe */\n    if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n      /* Get the element's text content */\n      content = currentNode.textContent;\n\n      arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr) => {\n        content = stringReplace(content, expr, ' ');\n      });\n\n      if (currentNode.textContent !== content) {\n        arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n        currentNode.textContent = content;\n      }\n    }\n\n    /* Execute a hook if present */\n    _executeHook('afterSanitizeElements', currentNode, null);\n\n    return false;\n  };\n\n  /**\n   * _isValidAttribute\n   *\n   * @param  {string} lcTag Lowercase tag name of containing element.\n   * @param  {string} lcName Lowercase attribute name.\n   * @param  {string} value Attribute value.\n   * @return {Boolean} Returns true if `value` is valid, otherwise false.\n   */\n  // eslint-disable-next-line complexity\n  const _isValidAttribute = function (lcTag, lcName, value) {\n    /* Make sure attribute cannot clobber */\n    if (\n      SANITIZE_DOM &&\n      (lcName === 'id' || lcName === 'name') &&\n      (value in document || value in formElement)\n    ) {\n      return false;\n    }\n\n    /* Allow valid data-* attributes: At least one character after \"-\"\n        (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n        XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n        We don't need to check the value; it's always URI safe. */\n    if (\n      ALLOW_DATA_ATTR &&\n      !FORBID_ATTR[lcName] &&\n      regExpTest(DATA_ATTR, lcName)\n    ) {\n      // This attribute is safe\n    } else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) {\n      // This attribute is safe\n      /* Otherwise, check the name is permitted */\n    } else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n      if (\n        // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n        // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n        // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n        (_isBasicCustomElement(lcTag) &&\n          ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n            regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag)) ||\n            (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n              CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag))) &&\n          ((CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp &&\n            regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName)) ||\n            (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function &&\n              CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)))) ||\n        // Alternative, second condition checks if it's an `is`-attribute, AND\n        // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n        (lcName === 'is' &&\n          CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements &&\n          ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n            regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value)) ||\n            (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n              CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))))\n      ) {\n        // If user has supplied a regexp or function in CUSTOM_ELEMENT_HANDLING.tagNameCheck, we need to also allow derived custom elements using the same tagName test.\n        // Additionally, we need to allow attributes passing the CUSTOM_ELEMENT_HANDLING.attributeNameCheck user has configured, as custom elements can define these at their own discretion.\n      } else {\n        return false;\n      }\n      /* Check value is safe. First, is attr inert? If so, is safe */\n    } else if (URI_SAFE_ATTRIBUTES[lcName]) {\n      // This attribute is safe\n      /* Check no script, data or unknown possibly unsafe URI\n        unless we know URI values are safe for that attribute */\n    } else if (\n      regExpTest(IS_ALLOWED_URI, stringReplace(value, ATTR_WHITESPACE, ''))\n    ) {\n      // This attribute is safe\n      /* Keep image data URIs alive if src/xlink:href is allowed */\n      /* Further prevent gadget XSS for dynamically built script tags */\n    } else if (\n      (lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') &&\n      lcTag !== 'script' &&\n      stringIndexOf(value, 'data:') === 0 &&\n      DATA_URI_TAGS[lcTag]\n    ) {\n      // This attribute is safe\n      /* Allow unknown protocols: This provides support for links that\n        are handled by protocol handlers which may be unknown ahead of\n        time, e.g. fb:, spotify: */\n    } else if (\n      ALLOW_UNKNOWN_PROTOCOLS &&\n      !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))\n    ) {\n      // This attribute is safe\n      /* Check for binary attributes */\n    } else if (value) {\n      return false;\n    } else {\n      // Binary attributes are safe at this point\n      /* Anything else, presume unsafe, do not add it back */\n    }\n\n    return true;\n  };\n\n  /**\n   * _isBasicCustomElement\n   * checks if at least one dash is included in tagName, and it's not the first char\n   * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n   *\n   * @param {string} tagName name of the tag of the node to sanitize\n   * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n   */\n  const _isBasicCustomElement = function (tagName) {\n    return tagName.indexOf('-') > 0;\n  };\n\n  /**\n   * _sanitizeAttributes\n   *\n   * @protect attributes\n   * @protect nodeName\n   * @protect removeAttribute\n   * @protect setAttribute\n   *\n   * @param  {Node} currentNode to sanitize\n   */\n  const _sanitizeAttributes = function (currentNode) {\n    /* Execute a hook if present */\n    _executeHook('beforeSanitizeAttributes', currentNode, null);\n\n    const { attributes } = currentNode;\n\n    /* Check if we have attributes; if not we might have a text node */\n    if (!attributes) {\n      return;\n    }\n\n    const hookEvent = {\n      attrName: '',\n      attrValue: '',\n      keepAttr: true,\n      allowedAttributes: ALLOWED_ATTR,\n    };\n    let l = attributes.length;\n\n    /* Go backwards over all attributes; safely remove bad ones */\n    while (l--) {\n      const attr = attributes[l];\n      const { name, namespaceURI, value: attrValue } = attr;\n      const lcName = transformCaseFunc(name);\n\n      let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n      /* Execute a hook if present */\n      hookEvent.attrName = lcName;\n      hookEvent.attrValue = value;\n      hookEvent.keepAttr = true;\n      hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n      _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n      value = hookEvent.attrValue;\n      /* Did the hooks approve of the attribute? */\n      if (hookEvent.forceKeepAttr) {\n        continue;\n      }\n\n      /* Remove attribute */\n      _removeAttribute(name, currentNode);\n\n      /* Did the hooks approve of the attribute? */\n      if (!hookEvent.keepAttr) {\n        continue;\n      }\n\n      /* Work around a security issue in jQuery 3.0 */\n      if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n        _removeAttribute(name, currentNode);\n        continue;\n      }\n\n      /* Sanitize attribute content to be template-safe */\n      if (SAFE_FOR_TEMPLATES) {\n        arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr) => {\n          value = stringReplace(value, expr, ' ');\n        });\n      }\n\n      /* Is `value` valid for this attribute? */\n      const lcTag = transformCaseFunc(currentNode.nodeName);\n      if (!_isValidAttribute(lcTag, lcName, value)) {\n        continue;\n      }\n\n      /* Full DOM Clobbering protection via namespace isolation,\n       * Prefix id and name attributes with `user-content-`\n       */\n      if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n        // Remove the attribute with this value\n        _removeAttribute(name, currentNode);\n\n        // Prefix the value and later re-create the attribute with the sanitized value\n        value = SANITIZE_NAMED_PROPS_PREFIX + value;\n      }\n\n      /* Handle attributes that require Trusted Types */\n      if (\n        trustedTypesPolicy &&\n        typeof trustedTypes === 'object' &&\n        typeof trustedTypes.getAttributeType === 'function'\n      ) {\n        if (namespaceURI) {\n          /* Namespaces are not yet supported, see https://bugs.chromium.org/p/chromium/issues/detail?id=1305293 */\n        } else {\n          switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n            case 'TrustedHTML': {\n              value = trustedTypesPolicy.createHTML(value);\n              break;\n            }\n\n            case 'TrustedScriptURL': {\n              value = trustedTypesPolicy.createScriptURL(value);\n              break;\n            }\n\n            default: {\n              break;\n            }\n          }\n        }\n      }\n\n      /* Handle invalid data-* attribute set by try-catching it */\n      try {\n        if (namespaceURI) {\n          currentNode.setAttributeNS(namespaceURI, name, value);\n        } else {\n          /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n          currentNode.setAttribute(name, value);\n        }\n\n        arrayPop(DOMPurify.removed);\n      } catch (_) {}\n    }\n\n    /* Execute a hook if present */\n    _executeHook('afterSanitizeAttributes', currentNode, null);\n  };\n\n  /**\n   * _sanitizeShadowDOM\n   *\n   * @param  {DocumentFragment} fragment to iterate over recursively\n   */\n  const _sanitizeShadowDOM = function (fragment) {\n    let shadowNode = null;\n    const shadowIterator = _createNodeIterator(fragment);\n\n    /* Execute a hook if present */\n    _executeHook('beforeSanitizeShadowDOM', fragment, null);\n\n    while ((shadowNode = shadowIterator.nextNode())) {\n      /* Execute a hook if present */\n      _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n      /* Sanitize tags and elements */\n      if (_sanitizeElements(shadowNode)) {\n        continue;\n      }\n\n      /* Deep shadow DOM detected */\n      if (shadowNode.content instanceof DocumentFragment) {\n        _sanitizeShadowDOM(shadowNode.content);\n      }\n\n      /* Check attributes, sanitize if necessary */\n      _sanitizeAttributes(shadowNode);\n    }\n\n    /* Execute a hook if present */\n    _executeHook('afterSanitizeShadowDOM', fragment, null);\n  };\n\n  /**\n   * Sanitize\n   * Public method providing core sanitation functionality\n   *\n   * @param {String|Node} dirty string or DOM node\n   * @param {Object} cfg object\n   */\n  // eslint-disable-next-line complexity\n  DOMPurify.sanitize = function (dirty, cfg = {}) {\n    let body = null;\n    let importedNode = null;\n    let currentNode = null;\n    let returnNode = null;\n    /* Make sure we have a string to sanitize.\n      DO NOT return early, as this will return the wrong type if\n      the user has requested a DOM object rather than a string */\n    IS_EMPTY_INPUT = !dirty;\n    if (IS_EMPTY_INPUT) {\n      dirty = '<!-->';\n    }\n\n    /* Stringify, in case dirty is an object */\n    if (typeof dirty !== 'string' && !_isNode(dirty)) {\n      if (typeof dirty.toString === 'function') {\n        dirty = dirty.toString();\n        if (typeof dirty !== 'string') {\n          throw typeErrorCreate('dirty is not a string, aborting');\n        }\n      } else {\n        throw typeErrorCreate('toString is not a function');\n      }\n    }\n\n    /* Return dirty HTML if DOMPurify cannot run */\n    if (!DOMPurify.isSupported) {\n      return dirty;\n    }\n\n    /* Assign config vars */\n    if (!SET_CONFIG) {\n      _parseConfig(cfg);\n    }\n\n    /* Clean up removed elements */\n    DOMPurify.removed = [];\n\n    /* Check if dirty is correctly typed for IN_PLACE */\n    if (typeof dirty === 'string') {\n      IN_PLACE = false;\n    }\n\n    if (IN_PLACE) {\n      /* Do some early pre-sanitization to avoid unsafe root nodes */\n      if (dirty.nodeName) {\n        const tagName = transformCaseFunc(dirty.nodeName);\n        if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n          throw typeErrorCreate(\n            'root node is forbidden and cannot be sanitized in-place'\n          );\n        }\n      }\n    } else if (dirty instanceof Node) {\n      /* If dirty is a DOM element, append to an empty document to avoid\n         elements being stripped by the parser */\n      body = _initDocument('<!---->');\n      importedNode = body.ownerDocument.importNode(dirty, true);\n      if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n        /* Node is already a body, use as is */\n        body = importedNode;\n      } else if (importedNode.nodeName === 'HTML') {\n        body = importedNode;\n      } else {\n        // eslint-disable-next-line unicorn/prefer-dom-node-append\n        body.appendChild(importedNode);\n      }\n    } else {\n      /* Exit directly if we have nothing to do */\n      if (\n        !RETURN_DOM &&\n        !SAFE_FOR_TEMPLATES &&\n        !WHOLE_DOCUMENT &&\n        // eslint-disable-next-line unicorn/prefer-includes\n        dirty.indexOf('<') === -1\n      ) {\n        return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n          ? trustedTypesPolicy.createHTML(dirty)\n          : dirty;\n      }\n\n      /* Initialize the document to work on */\n      body = _initDocument(dirty);\n\n      /* Check we have a DOM node from the data */\n      if (!body) {\n        return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n      }\n    }\n\n    /* Remove first element node (ours) if FORCE_BODY is set */\n    if (body && FORCE_BODY) {\n      _forceRemove(body.firstChild);\n    }\n\n    /* Get node iterator */\n    const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n    /* Now start iterating over the created document */\n    while ((currentNode = nodeIterator.nextNode())) {\n      /* Sanitize tags and elements */\n      if (_sanitizeElements(currentNode)) {\n        continue;\n      }\n\n      /* Shadow DOM detected, sanitize it */\n      if (currentNode.content instanceof DocumentFragment) {\n        _sanitizeShadowDOM(currentNode.content);\n      }\n\n      /* Check attributes, sanitize if necessary */\n      _sanitizeAttributes(currentNode);\n    }\n\n    /* If we sanitized `dirty` in-place, return it. */\n    if (IN_PLACE) {\n      return dirty;\n    }\n\n    /* Return sanitized string or DOM */\n    if (RETURN_DOM) {\n      if (RETURN_DOM_FRAGMENT) {\n        returnNode = createDocumentFragment.call(body.ownerDocument);\n\n        while (body.firstChild) {\n          // eslint-disable-next-line unicorn/prefer-dom-node-append\n          returnNode.appendChild(body.firstChild);\n        }\n      } else {\n        returnNode = body;\n      }\n\n      if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n        /*\n          AdoptNode() is not used because internal state is not reset\n          (e.g. the past names map of a HTMLFormElement), this is safe\n          in theory but we would rather not risk another attack vector.\n          The state that is cloned by importNode() is explicitly defined\n          by the specs.\n        */\n        returnNode = importNode.call(originalDocument, returnNode, true);\n      }\n\n      return returnNode;\n    }\n\n    let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n    /* Serialize doctype if allowed */\n    if (\n      WHOLE_DOCUMENT &&\n      ALLOWED_TAGS['!doctype'] &&\n      body.ownerDocument &&\n      body.ownerDocument.doctype &&\n      body.ownerDocument.doctype.name &&\n      regExpTest(EXPRESSIONS.DOCTYPE_NAME, body.ownerDocument.doctype.name)\n    ) {\n      serializedHTML =\n        '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\\n' + serializedHTML;\n    }\n\n    /* Sanitize final string template-safe */\n    if (SAFE_FOR_TEMPLATES) {\n      arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr) => {\n        serializedHTML = stringReplace(serializedHTML, expr, ' ');\n      });\n    }\n\n    return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n      ? trustedTypesPolicy.createHTML(serializedHTML)\n      : serializedHTML;\n  };\n\n  /**\n   * Public method to set the configuration once\n   * setConfig\n   *\n   * @param {Object} cfg configuration object\n   */\n  DOMPurify.setConfig = function (cfg = {}) {\n    _parseConfig(cfg);\n    SET_CONFIG = true;\n  };\n\n  /**\n   * Public method to remove the configuration\n   * clearConfig\n   *\n   */\n  DOMPurify.clearConfig = function () {\n    CONFIG = null;\n    SET_CONFIG = false;\n  };\n\n  /**\n   * Public method to check if an attribute value is valid.\n   * Uses last set config, if any. Otherwise, uses config defaults.\n   * isValidAttribute\n   *\n   * @param  {String} tag Tag name of containing element.\n   * @param  {String} attr Attribute name.\n   * @param  {String} value Attribute value.\n   * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n   */\n  DOMPurify.isValidAttribute = function (tag, attr, value) {\n    /* Initialize shared config vars if necessary. */\n    if (!CONFIG) {\n      _parseConfig({});\n    }\n\n    const lcTag = transformCaseFunc(tag);\n    const lcName = transformCaseFunc(attr);\n    return _isValidAttribute(lcTag, lcName, value);\n  };\n\n  /**\n   * AddHook\n   * Public method to add DOMPurify hooks\n   *\n   * @param {String} entryPoint entry point for the hook to add\n   * @param {Function} hookFunction function to execute\n   */\n  DOMPurify.addHook = function (entryPoint, hookFunction) {\n    if (typeof hookFunction !== 'function') {\n      return;\n    }\n\n    hooks[entryPoint] = hooks[entryPoint] || [];\n    arrayPush(hooks[entryPoint], hookFunction);\n  };\n\n  /**\n   * RemoveHook\n   * Public method to remove a DOMPurify hook at a given entryPoint\n   * (pops it from the stack of hooks if more are present)\n   *\n   * @param {String} entryPoint entry point for the hook to remove\n   * @return {Function} removed(popped) hook\n   */\n  DOMPurify.removeHook = function (entryPoint) {\n    if (hooks[entryPoint]) {\n      return arrayPop(hooks[entryPoint]);\n    }\n  };\n\n  /**\n   * RemoveHooks\n   * Public method to remove all DOMPurify hooks at a given entryPoint\n   *\n   * @param  {String} entryPoint entry point for the hooks to remove\n   */\n  DOMPurify.removeHooks = function (entryPoint) {\n    if (hooks[entryPoint]) {\n      hooks[entryPoint] = [];\n    }\n  };\n\n  /**\n   * RemoveAllHooks\n   * Public method to remove all DOMPurify hooks\n   */\n  DOMPurify.removeAllHooks = function () {\n    hooks = {};\n  };\n\n  return DOMPurify;\n}\n\nexport default createDOMPurify();\n", "// This file is part of meshoptimizer library and is distributed under the terms of MIT License.\n// Copyright (C) 2016-2023, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)\nvar MeshoptEncoder = (function() {\n\t\"use strict\";\n\t// Built with clang version 16.0.0\n\t// Built from meshoptimizer 0.20\n\tvar wasm = \"b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiKLdilevlevlooroowwvwbDDbelve9Weiiviebeoweuec:W;kekr;RiOo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbzK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbHl79IV9RbODwebcekdQXq:g9sLdbk;3keYu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRb:S:kjjbc:GeV86bbavcjdfcbcjdzNjjjb8AdnaiTmbavcjdfadalz:tjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0EzNjjjb8Aavavcjdfalz:tjjjbhDcj;abal9UhodndndndndnalTmbaoc;WFbGgecjdaecjd6Ehqcbhkdninakai9pmiaDcjlfcbcjdzNjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndndndnaec9WGgsTmbcbhzcehHaPhOawhAxekdnaxTmbcbhAcehHaPhCinaDaAfRbbhXaDcjlfheaChoaxhQinaeaoRbbgLaX9RgXcetaX;acr4786bbaoalfhoaecefheaLhXaQcufgQmbkaraw9Ram6miawcbamzNjjjbgeTmiaCcefhCaeamfhwaAcefgAal6hHaAal9hmbxvkkaraw9Ram6mvawcbamzNjjjb8AceheinawgXamfhwalaegoSmldnaraw9Ram6mbaocefheawcbamzNjjjb8AaXmekkaoal6hHxekindnaxTmbaDazfRbbhXaDcjlfheaOhoaxhQinaeaoRbbgLaX9RgXcetaX;acr4786bbaoalfhoaecefheaLhXaQcufgQmbkkaraA9Ram6mearaAcbamzNjjjbgKamfgw9RcK6mdcbhYaDcjlfhAinaDcjlfaYfh8AcwhCczhLcehQindndnaQce9hmbcuhoa8ARbbmecbhodninaogecsSmeaecefhoaAaefcefRbbTmbkkcucbaecs6EhoxekaQcetc;:FFFeGhocuaQtcu7cFeGhXcbheinaoaXaAaefRbb9nfhoaecefgecz9hmbkkaoaLaoaL6geEhLaQaCaeEhCaQcetgQcw6mbkdndndndnaCcufPdiebkaKaYco4fgeaeRbbcdciaCclSEaYci4coGtV86bbaCcw9hmeawa8A8Pbb83bbawcwfa8Acwf8Pbb83bbawczfhwxdkaKaYco4fgeaeRbbceaYci4coGtV86bbkdncwaC9TgEmbinawcb86bbawcefhwxbkkcuaCtcu7h8Acbh3aAh5ina5heaEhQcbhoinaeRbbgLa8AcFeGgXaLaX6EaoaCtVhoaecefheaQcufgQmbkawao86bba5aEfh5awcefhwa3aEfg3cz6mbkcbheindnaAaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaYczfgYas9pmbaAczfhAaraw9RcL0mekkaYas6meawTmeaOcefhOazcefgzal6hHawhAazalSmixbkkcbhwaHceGTmexikcbhwaHceGmdkaDaPaxcufal2falz:tjjjb8AaxakfhkawmbkcbhoxokcbhoxvkaiTmekcbhoaraw9Ralcaalca0E6mialc8F9nmexdkcbhoaecufca6mdkawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9Rhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBd:S:kjjbk;rse3u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:C:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgoydbhLaocwfydbhKaoclfydbhYcbh8Adndninalc;abfavcsGcitfgoydlhEdndndnaoydbgoaL9hmbaEaYSmekdnaoaY9hmbaEaK9hmba8Acefh8AxekaoaK9hmeaEaL9hmea8Acdfh8Aka8Ac870mdaXcufhvada8AciGcx2goc:y1jjbfydbaCfcdtfydbhEadaocN1jjbfydbaCfcdtfydbhKadaoc:q1jjbfydbaCfcdtfydbhLcbhodnindnalavcsGcdtfydbaE9hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaEaOSgvaYce9iaYaH9oVgoGh3dndndndndncbcsavEaYaoEgvcs9hmbarce9imbaEaEaAaEcefaASgvEgAcefSmecmcsavEhvkasava8Acdtc;WeGV86bbavcs9hmeaEaA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbkaEhAxdkcPhvasa8AcdtcPV86bbaEhAkavTmbavaH9imekalaXcdtfaEBdbaXcefcsGhXkaOa3fhOalc;abfaQcitfgvaKBdlavaEBdbalc;abfaQcefcsGgvcitfgoaEBdlaoaLBdbavcefhoxikavcufhva8Aclfg8Ac;ab9hmbkkdnadceaKaOScetaYaOSEcx2gvc:q1jjbfydbaCfcdtfydbgLTadavcN1jjbfydbaCfcdtfydbg8AceSGadavc:y1jjbfydbaCfcdtfydbgYcdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhKxdkcuhKaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydbaY9hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaLaOSg8Efh3dndnaKcm0mbaKcefhKxekcbcsa8Aa3SgvEhKa3avfh3kdndnaEcm0mbaEcefhExekcbcsaYa3SgvEhEa3avfh3kc9:cua8EEh8FaEaKcltVhocbhvdndndninavcj1jjbfRbbaocFeGSmeavcefgvcz9hmbxdkka5aLaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeao86bbaecefhekdna8EmbaLaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaLhAkdnaKcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmbaYaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaYhAkalaXcdtfaLBdbaXcefcsGhvdndnaKPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfaYBdbavcefcsGhvkalc;abfaQcitfgoaLBdlaoa8ABdbalc;abfaQcefcsGcitfgoa8ABdlaoaYBdbalc;abfaQcdfcsGcitfgoaYBdlaoaLBdbaQcifhoavhXa3hOkascefhsaocsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:C:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:C:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;klld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicdfciGcdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk:Hvdxue998Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6mearcearce0EhwaohDinaDc:CuBdbaDclfhDawcufgwmbkaeTmiadcl6mdarcearce0EhqarcdthkalhxcbhminaohDaxhwaqhPinaDaDydbgsawydbgzcL4cFeGc:cufcbazEgzasaz9kEBdbawclfhwaDclfhDaPcufgPmbkaxakfhxamcefgmae9hmbkkaeTmdxekaeTmekavcb9hadcl6gqVhHarcearce0Ehkarcdthrceai9Rhmcbhdindndndnavce9hmbaqmdc:CuhwalhDakhPinawaDydbgscL4cFeGc:cufcbasEgsawas9kEhwaDclfhDaPcufgPmbxdkkc:CuhwaHmbaohDalhPakhsinaDaPydbgzcL4cFeGgxc8Aaxc8A9kEc:cufcbazEBdbaPclfhPaDclfhDascufgsmbkkaqmbcbhDakhsinawhPdnavceSmbaoaDfydbhPkdndnalaDfIdbgOcjjj;8iamaPfgPcLt9R::NJbbbZJbbb:;aOJbbbb9GEMgO:lJbbb9p9DTmbaO:Ohzxekcjjjj94hzkabaDfazcFFFrGaPcKtVBdbaDclfhDascufgsmbkkabarfhbalarfhladcefgdae9hmbkkaocjdf8KjjjjbkFkdCui998Jjjjjbc:Gd9Rgv8Kjjjjbavc:4efcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgoadcFFFFi0Ecbyd:K:kjjbHjjjjbbgeBd:4eavceBd:ydaeabaoz:tjjjb8Akavc:OefcwfcbBdbav9cb83i:Oeavc:Oefaeadaiavc:4efz:njjjbcuaicdtgraicFFFFi0Egwcbyd:K:kjjbHjjjjbbhoavc:4efavyd:ydgDcdtfaoBdbavaDcefgqBd:ydaoavyd:Oegkarz:tjjjbhxavc:4efaqcdtfadci9Ugmcbyd:K:kjjbHjjjjbbgoBdbavaDcdfgrBd:ydaocbamzNjjjbhPavc:4efarcdtfawcbyd:K:kjjbHjjjjbbgsBdbavaDcifgqBd:ydaxhoashrinaralIdbalaoydbgwcwawcw6Ecdtfc;ebfIdbMUdbaoclfhoarclfhraicufgimbkavc:4efaqcdtfcuamcdtadcFFFF970Ecbyd:K:kjjbHjjjjbbgqBdbavaDclfBd:yddnadci6mbamceamce0EhiaehoaqhrinarasaoydbcdtfIdbasaoclfydbcdtfIdbMasaocwfydbcdtfIdbMUdbaocxfhoarclfhraicufgimbkkavc;qbfhzavhoavyd:SehHavyd:WehOcbhwcbhrcbhAcehCinaohXcihQaearci2gLcdtfgocwfydbhdaoydbhDabaAcx2fgiclfaoclfydbgKBdbaiaDBdbaicwfadBdbaParfce86bbazadBdwazaKBdlazaDBdbaqarcdtfcbBdbdnawTmbcihQaXhiinazaQcdtfaiydbgoBdbaQaoaD9haoaK9hGaoad9hGfhQaiclfhiawcufgwmbkkaAcefhAaxaDcdtfgoaoydbcufBdbaxaKcdtfgoaoydbcufBdbaxadcdtfgoaoydbcufBdbcbhwinaOaHaeawaLfcdtfydbcdtgifydbcdtfgKhoakaifgDydbgdhidnadTmbdninaoydbarSmeaoclfhoaicufgiTmdxbkkaoadcdtaKfc98fydbBdbaDaDydbcufBdbkawcefgwci9hmbkdndndnaQTmbcuhrJbbbbhYcbhDavyd:SehKavyd:WehLindndnakazaDcdtfydbcdtgofydbgimbaDcefhDxekaDcs0hwasaofgdIdbh8AadalcbaDcefgDawEcdtfIdbalaxaofydbgwcwawcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEaicdthiaLaKaofydbcdtfhoinaqaoydbgwcdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYawaradEhraoclfhoaic98fgimbkkaDaQ9hmbkarcu9hmekaCam9pmeindnaPaCfRbbmbaChrxdkamaCcefgC9hmbxdkkaQczaQcz6EhwazhoaXhzarcu9hmekkavyd:ydhokaocdtavc:4effc98fhrdninaoTmearydbcbyd:G:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:Gdf8Kjjjjbk;UlevucuaicdtgvaicFFFFi0Egocbyd:K:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:K:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:K:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhwdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbawceawce0EhDabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;:kivuo99lu8Jjjjjbcj;Hb9Rgl8Kjjjjbcbhvalc1;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:K:kjjbHjjjjbbgrBd19GalceBd;O9Galcwfcbyd:m:kjjbBdbalcb8Pd:e:kjjb83ibalc;W;Gbfcwfcbyd:y:kjjbBdbalcb8Pd:q:kjjb83i;W9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;W;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;49GhDalIdlhkalId;09GhxalIdbhmalId;W9GhPkdndnadTmbJbbbbJbbjZaPam:tJbbbb:xgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;GbzNjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;GbzNjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhialaocbyd:K:kjjbHjjjjbbgzBd:m9GdnadTmbabhHinaHaiBdbaHclfhHadaicefgi9hmbkadTmbabhiadhHinalaraiydbgecdtfydbcFrGcx2fgvavydbgvcefBdbazavcdtfaeBdbaiclfhiaHcufgHmbkazhiadhHinalaraiydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaiclfhiaHcufgHmbkabhiadhHinalaraiydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwazavcdtfaeBdbaiclfhiaHcufgHmbkadTmbcbhiinabazydbcdtfaiBdbazclfhzadaicefgi9hmbkkclhidninaic98Smealc1;Gbfaifydbcbyd:G:kjjbH:bjjjbbaic98fhixbkkalcj;Hbf8Kjjjjbk9teiucbcbyd:O:kjjbgeabcifc98GfgbBd:O:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:O:kjjbgeabcrfc94GfgbBd:O:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:O:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:O:kjjbfgdBd:O:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:6ddbcjwk:Cdb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:FFuuFFuuFFuuFFuFFFuFFFuFbc:Cqkzebbbebbbdbbb8WWbb\";\n\n\tvar wasmpack = new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);\n\n\tif (typeof WebAssembly !== 'object') {\n\t\treturn {\n\t\t\tsupported: false,\n\t\t};\n\t}\n\n\tvar instance;\n\n\tvar ready =\n\t\tWebAssembly.instantiate(unpack(wasm), {})\n\t\t.then(function(result) {\n\t\t\tinstance = result.instance;\n\t\t\tinstance.exports.__wasm_call_ctors();\n\t\t\tinstance.exports.meshopt_encodeVertexVersion(0);\n\t\t\tinstance.exports.meshopt_encodeIndexVersion(1);\n\t\t});\n\n\tfunction unpack(data) {\n\t\tvar result = new Uint8Array(data.length);\n\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\tvar ch = data.charCodeAt(i);\n\t\t\tresult[i] = ch > 96 ? ch - 97 : ch > 64 ? ch - 39 : ch + 4;\n\t\t}\n\t\tvar write = 0;\n\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\tresult[write++] = (result[i] < 60) ? wasmpack[result[i]] : (result[i] - 60) * 64 + result[++i];\n\t\t}\n\t\treturn result.buffer.slice(0, write);\n\t}\n\n\tfunction assert(cond) {\n\t\tif (!cond) {\n\t\t\tthrow new Error(\"Assertion failed\");\n\t\t}\n\t}\n\n\tfunction bytes(view) {\n\t\treturn new Uint8Array(view.buffer, view.byteOffset, view.byteLength);\n\t}\n\n\tfunction reorder(fun, indices, vertices, optf) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar ip = sbrk(indices.length * 4);\n\t\tvar rp = sbrk(vertices * 4);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\tvar indices8 = bytes(indices);\n\t\theap.set(indices8, ip);\n\t\tif (optf) {\n\t\t\toptf(ip, ip, indices.length, vertices);\n\t\t}\n\t\tvar unique = fun(rp, ip, indices.length, vertices);\n\t\t// heap may have grown\n\t\theap = new Uint8Array(instance.exports.memory.buffer);\n\t\tvar remap = new Uint32Array(vertices);\n\t\tnew Uint8Array(remap.buffer).set(heap.subarray(rp, rp + vertices * 4));\n\t\tindices8.set(heap.subarray(ip, ip + indices.length * 4));\n\t\tsbrk(ip - sbrk(0));\n\n\t\tfor (var i = 0; i < indices.length; ++i)\n\t\t\tindices[i] = remap[indices[i]];\n\n\t\treturn [remap, unique];\n\t}\n\n\tfunction spatialsort(fun, positions, count, stride) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar ip = sbrk(count * 4);\n\t\tvar sp = sbrk(count * stride);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\theap.set(bytes(positions), sp);\n\t\tfun(ip, sp, count, stride);\n\t\t// heap may have grown\n\t\theap = new Uint8Array(instance.exports.memory.buffer);\n\t\tvar remap = new Uint32Array(count);\n\t\tnew Uint8Array(remap.buffer).set(heap.subarray(ip, ip + count * 4));\n\t\tsbrk(ip - sbrk(0));\n\t\treturn remap;\n\t}\n\n\tfunction encode(fun, bound, source, count, size) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar tp = sbrk(bound);\n\t\tvar sp = sbrk(count * size);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\theap.set(bytes(source), sp);\n\t\tvar res = fun(tp, bound, sp, count, size);\n\t\tvar target = new Uint8Array(res);\n\t\ttarget.set(heap.subarray(tp, tp + res));\n\t\tsbrk(tp - sbrk(0));\n\t\treturn target;\n\t}\n\n\tfunction maxindex(source) {\n\t\tvar result = 0;\n\t\tfor (var i = 0; i < source.length; ++i) {\n\t\t\tvar index = source[i];\n\t\t\tresult = result < index ? index : result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction index32(source, size) {\n\t\tassert(size == 2 || size == 4);\n\t\tif (size == 4) {\n\t\t\treturn new Uint32Array(source.buffer, source.byteOffset, source.byteLength / 4);\n\t\t} else {\n\t\t\tvar view = new Uint16Array(source.buffer, source.byteOffset, source.byteLength / 2);\n\t\t\treturn new Uint32Array(view); // copies each element\n\t\t}\n\t}\n\n\tfunction filter(fun, source, count, stride, bits, insize, mode) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar tp = sbrk(count * stride);\n\t\tvar sp = sbrk(count * insize);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\theap.set(bytes(source), sp);\n\t\tfun(tp, count, stride, bits, sp, mode);\n\t\tvar target = new Uint8Array(count * stride);\n\t\ttarget.set(heap.subarray(tp, tp + count * stride));\n\t\tsbrk(tp - sbrk(0));\n\t\treturn target;\n\t}\n\n\treturn {\n\t\tready: ready,\n\t\tsupported: true,\n\t\treorderMesh: function(indices, triangles, optsize) {\n\t\t\tvar optf = triangles ? (optsize ? instance.exports.meshopt_optimizeVertexCacheStrip : instance.exports.meshopt_optimizeVertexCache) : undefined;\n\t\t\treturn reorder(instance.exports.meshopt_optimizeVertexFetchRemap, indices, maxindex(indices) + 1, optf);\n\t\t},\n\t\treorderPoints: function(positions, positions_stride) {\n\t\t\tassert(positions instanceof Float32Array);\n\t\t\tassert(positions.length % positions_stride == 0);\n\t\t\tassert(positions_stride >= 3);\n\t\t\treturn spatialsort(instance.exports.meshopt_spatialSortRemap, positions, positions.length / positions_stride, positions_stride * 4);\n\t\t},\n\t\tencodeVertexBuffer: function(source, count, size) {\n\t\t\tassert(size > 0 && size <= 256);\n\t\t\tassert(size % 4 == 0);\n\t\t\tvar bound = instance.exports.meshopt_encodeVertexBufferBound(count, size);\n\t\t\treturn encode(instance.exports.meshopt_encodeVertexBuffer, bound, source, count, size);\n\t\t},\n\t\tencodeIndexBuffer: function(source, count, size) {\n\t\t\tassert(size == 2 || size == 4);\n\t\t\tassert(count % 3 == 0);\n\t\t\tvar indices = index32(source, size);\n\t\t\tvar bound = instance.exports.meshopt_encodeIndexBufferBound(count, maxindex(indices) + 1);\n\t\t\treturn encode(instance.exports.meshopt_encodeIndexBuffer, bound, indices, count, 4);\n\t\t},\n\t\tencodeIndexSequence: function(source, count, size) {\n\t\t\tassert(size == 2 || size == 4);\n\t\t\tvar indices = index32(source, size);\n\t\t\tvar bound = instance.exports.meshopt_encodeIndexSequenceBound(count, maxindex(indices) + 1);\n\t\t\treturn encode(instance.exports.meshopt_encodeIndexSequence, bound, indices, count, 4);\n\t\t},\n\t\tencodeGltfBuffer: function(source, count, size, mode) {\n\t\t\tvar table = {\n\t\t\t\tATTRIBUTES: this.encodeVertexBuffer,\n\t\t\t\tTRIANGLES: this.encodeIndexBuffer,\n\t\t\t\tINDICES: this.encodeIndexSequence,\n\t\t\t};\n\t\t\tassert(table[mode]);\n\t\t\treturn table[mode](source, count, size);\n\t\t},\n\t\tencodeFilterOct: function(source, count, stride, bits) {\n\t\t\tassert(stride == 4 || stride == 8);\n\t\t\tassert(bits >= 1 && bits <= 16);\n\t\t\treturn filter(instance.exports.meshopt_encodeFilterOct, source, count, stride, bits, 16);\n\t\t},\n\t\tencodeFilterQuat: function(source, count, stride, bits) {\n\t\t\tassert(stride == 8);\n\t\t\tassert(bits >= 4 && bits <= 16);\n\t\t\treturn filter(instance.exports.meshopt_encodeFilterQuat, source, count, stride, bits, 16);\n\t\t},\n\t\tencodeFilterExp: function(source, count, stride, bits, mode) {\n\t\t\tassert(stride > 0 && stride % 4 == 0);\n\t\t\tassert(bits >= 1 && bits <= 24);\n\t\t\tvar table = {\n\t\t\t\tSeparate: 0,\n\t\t\t\tSharedVector: 1,\n\t\t\t\tSharedComponent: 2,\n\t\t\t};\n\t\t\treturn filter(instance.exports.meshopt_encodeFilterExp, source, count, stride, bits, stride, mode ? table[mode] : 1);\n\t\t},\n\t};\n})();\n\n// UMD-style export for MeshoptEncoder\nif (typeof exports === 'object' && typeof module === 'object')\n\tmodule.exports = MeshoptEncoder;\nelse if (typeof define === 'function' && define['amd'])\n\tdefine([], function() {\n\t\treturn MeshoptEncoder;\n\t});\nelse if (typeof exports === 'object')\n\texports[\"MeshoptEncoder\"] = MeshoptEncoder;\nelse\n\t(typeof self !== 'undefined' ? self : this).MeshoptEncoder = MeshoptEncoder;\n", "// This file is part of meshoptimizer library and is distributed under the terms of MIT License.\n// Copyright (C) 2016-2023, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)\nvar MeshoptDecoder = (function() {\n\t\"use strict\";\n\t// Built with clang version 16.0.0\n\t// Built from meshoptimizer 0.20\n\tvar wasm_base = \"b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;d8Yqdbk:yzeHu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlcbhOinalgic9WfgAawcj;cbffhldndndndndnaHaAco4fRbbaOcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgAco4gCaCciSgCE86bbawcj;cbfaifglcGfaoclfaCfgCRbbaAcl4ciGgXaXciSgXE86bbalcVfaCaXfgCRbbaAcd4ciGgXaXciSgXE86bbalc7faCaXfgCRbbaAciGgAaAciSgAE86bbalctfaCaAfgCRbbaoRbegAco4gXaXciSgXE86bbalc91faCaXfgCRbbaAcl4ciGgXaXciSgXE86bbalc4faCaXfgCRbbaAcd4ciGgXaXciSgXE86bbalc93faCaXfgCRbbaAciGgAaAciSgAE86bbalc94faCaAfgCRbbaoRbdgAco4gXaXciSgXE86bbalc95faCaXfgCRbbaAcl4ciGgXaXciSgXE86bbalc96faCaXfgCRbbaAcd4ciGgXaXciSgXE86bbalc97faCaXfgCRbbaAciGgAaAciSgAE86bbalc98faCaAfgARbbaoRbigoco4gCaCciSgCE86bbalc99faAaCfgARbbaocl4ciGgCaCciSgCE86bbalc9:faAaCfgARbbaocd4ciGgCaCciSgCE86bbalcufaAaCfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgAcl4gCaCcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgCRbbaAcsGgAaAcsSgAE86bbalcVfaCaAfgARbbaoRbegCcl4gXaXcsSgXE86bbalc7faAaXfgARbbaCcsGgCaCcsSgCE86bbalctfaAaCfgARbbaoRbdgCcl4gXaXcsSgXE86bbalc91faAaXfgARbbaCcsGgCaCcsSgCE86bbalc4faAaCfgARbbaoRbigCcl4gXaXcsSgXE86bbalc93faAaXfgARbbaCcsGgCaCcsSgCE86bbalc94faAaCfgARbbaoRblgCcl4gXaXcsSgXE86bbalc95faAaXfgARbbaCcsGgCaCcsSgCE86bbalc96faAaCfgARbbaoRbvgCcl4gXaXcsSgXE86bbalc97faAaXfgARbbaCcsGgCaCcsSgCE86bbalc98faAaCfgARbbaoRbogCcl4gXaXcsSgXE86bbalc99faAaXfgARbbaCcsGgCaCcsSgCE86bbalc9:faAaCfgARbbaoRbrgocl4gCaCcsSgCE86bbalcufaAaCfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaOcdfhOaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhAinaialRbbgHce4cbaHceG9R7aOfgO86bbaiadfhialcefhlaAcufgAmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhXdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhAinaialRbbgHce4cbaHceG9R7aOfgO86bbaiadfhialcefhlaAcufgAmbkaCcefhCamcefgmad6hsamad9hmbkaXhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaXhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabaiavcdfciGfcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabaiavcufciGfcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabaiavciGfcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb\";\n\tvar wasm_simd = \"b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;b9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;e8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincbhHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAcd0hHalhOaAcefgAclSmdxekkcbhlaHceGTmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;tzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb\";\n\n\tvar detector = new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);\n\tvar wasmpack = new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);\n\n\tif (typeof WebAssembly !== 'object') {\n\t\treturn {\n\t\t\tsupported: false,\n\t\t};\n\t}\n\n\tvar wasm = WebAssembly.validate(detector) ? wasm_simd : wasm_base;\n\n\tvar instance;\n\n\tvar ready =\n\t\tWebAssembly.instantiate(unpack(wasm), {})\n\t\t.then(function(result) {\n\t\t\tinstance = result.instance;\n\t\t\tinstance.exports.__wasm_call_ctors();\n\t\t});\n\n\tfunction unpack(data) {\n\t\tvar result = new Uint8Array(data.length);\n\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\tvar ch = data.charCodeAt(i);\n\t\t\tresult[i] = ch > 96 ? ch - 97 : ch > 64 ? ch - 39 : ch + 4;\n\t\t}\n\t\tvar write = 0;\n\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\tresult[write++] = (result[i] < 60) ? wasmpack[result[i]] : (result[i] - 60) * 64 + result[++i];\n\t\t}\n\t\treturn result.buffer.slice(0, write);\n\t}\n\n\tfunction decode(instance, fun, target, count, size, source, filter) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar count4 = (count + 3) & ~3;\n\t\tvar tp = sbrk(count4 * size);\n\t\tvar sp = sbrk(source.length);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\theap.set(source, sp);\n\t\tvar res = fun(tp, count, size, sp, source.length);\n\t\tif (res == 0 && filter) {\n\t\t\tfilter(tp, count4, size);\n\t\t}\n\t\ttarget.set(heap.subarray(tp, tp + count * size));\n\t\tsbrk(tp - sbrk(0));\n\t\tif (res != 0) {\n\t\t\tthrow new Error(\"Malformed buffer data: \" + res);\n\t\t}\n\t}\n\n\tvar filters = {\n\t\tNONE: \"\",\n\t\tOCTAHEDRAL: \"meshopt_decodeFilterOct\",\n\t\tQUATERNION: \"meshopt_decodeFilterQuat\",\n\t\tEXPONENTIAL: \"meshopt_decodeFilterExp\",\n\t};\n\n\tvar decoders = {\n\t\tATTRIBUTES: \"meshopt_decodeVertexBuffer\",\n\t\tTRIANGLES: \"meshopt_decodeIndexBuffer\",\n\t\tINDICES: \"meshopt_decodeIndexSequence\",\n\t};\n\n\tvar workers = [];\n\tvar requestId = 0;\n\n\tfunction createWorker(url) {\n\t\tvar worker = {\n\t\t\tobject: new Worker(url),\n\t\t\tpending: 0,\n\t\t\trequests: {}\n\t\t};\n\n\t\tworker.object.onmessage = function(event) {\n\t\t\tvar data = event.data;\n\n\t\t\tworker.pending -= data.count;\n\t\t\tworker.requests[data.id][data.action](data.value);\n\t\t\tdelete worker.requests[data.id];\n\t\t};\n\n\t\treturn worker;\n\t}\n\n\tfunction initWorkers(count) {\n\t\tvar source =\n\t\t\t\"self.ready = WebAssembly.instantiate(new Uint8Array([\" + new Uint8Array(unpack(wasm)) + \"]), {})\" +\n\t\t\t\".then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });\" +\n\t\t\t\"self.onmessage = \" + workerProcess.name + \";\" + decode.toString() + workerProcess.toString();\n\n\t\tvar blob = new Blob([source], {type: 'text/javascript'});\n\t\tvar url = URL.createObjectURL(blob);\n\n\t\tfor (var i = workers.length; i < count; ++i) {\n\t\t\tworkers[i] = createWorker(url);\n\t\t}\n\n\t\tfor (var i = count; i < workers.length; ++i) {\n\t\t\tworkers[i].object.postMessage({});\n\t\t}\n\n\t\tworkers.length = count;\n\n\t\tURL.revokeObjectURL(url);\n\t}\n\n\tfunction decodeWorker(count, size, source, mode, filter) {\n\t\tvar worker = workers[0];\n\n\t\tfor (var i = 1; i < workers.length; ++i) {\n\t\t\tif (workers[i].pending < worker.pending) {\n\t\t\t\tworker = workers[i];\n\t\t\t}\n\t\t}\n\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\tvar data = new Uint8Array(source);\n\t\t\tvar id = ++requestId;\n\n\t\t\tworker.pending += count;\n\t\t\tworker.requests[id] = { resolve: resolve, reject: reject };\n\t\t\tworker.object.postMessage({ id: id, count: count, size: size, source: data, mode: mode, filter: filter }, [ data.buffer ]);\n\t\t});\n\t}\n\n\tfunction workerProcess(event) {\n\t\tvar data = event.data;\n\t\tif (!data.id) {\n\t\t\treturn self.close();\n\t\t}\n\t\tself.ready.then(function(instance) {\n\t\t\ttry {\n\t\t\t\tvar target = new Uint8Array(data.count * data.size);\n\t\t\t\tdecode(instance, instance.exports[data.mode], target, data.count, data.size, data.source, instance.exports[data.filter]);\n\t\t\t\tself.postMessage({ id: data.id, count: data.count, action: \"resolve\", value: target }, [ target.buffer ]);\n\t\t\t} catch (error) {\n\t\t\t\tself.postMessage({ id: data.id, count: data.count, action: \"reject\", value: error });\n\t\t\t}\n\t\t});\n\t}\n\n\treturn {\n\t\tready: ready,\n\t\tsupported: true,\n\t\tuseWorkers: function(count) {\n\t\t\tinitWorkers(count);\n\t\t},\n\t\tdecodeVertexBuffer: function(target, count, size, source, filter) {\n\t\t\tdecode(instance, instance.exports.meshopt_decodeVertexBuffer, target, count, size, source, instance.exports[filters[filter]]);\n\t\t},\n\t\tdecodeIndexBuffer: function(target, count, size, source) {\n\t\t\tdecode(instance, instance.exports.meshopt_decodeIndexBuffer, target, count, size, source);\n\t\t},\n\t\tdecodeIndexSequence: function(target, count, size, source) {\n\t\t\tdecode(instance, instance.exports.meshopt_decodeIndexSequence, target, count, size, source);\n\t\t},\n\t\tdecodeGltfBuffer: function(target, count, size, source, mode, filter) {\n\t\t\tdecode(instance, instance.exports[decoders[mode]], target, count, size, source, instance.exports[filters[filter]]);\n\t\t},\n\t\tdecodeGltfBufferAsync: function(count, size, source, mode, filter) {\n\t\t\tif (workers.length > 0) {\n\t\t\t\treturn decodeWorker(count, size, source, decoders[mode], filters[filter]);\n\t\t\t}\n\n\t\t\treturn ready.then(function() {\n\t\t\t\tvar target = new Uint8Array(count * size);\n\t\t\t\tdecode(instance, instance.exports[decoders[mode]], target, count, size, source, instance.exports[filters[filter]]);\n\t\t\t\treturn target;\n\t\t\t});\n\t\t}\n\t};\n})();\n\n// UMD-style export\nif (typeof exports === 'object' && typeof module === 'object')\n\tmodule.exports = MeshoptDecoder;\nelse if (typeof define === 'function' && define['amd'])\n\tdefine([], function() {\n\t\treturn MeshoptDecoder;\n\t});\nelse if (typeof exports === 'object')\n\texports[\"MeshoptDecoder\"] = MeshoptDecoder;\nelse\n\t(typeof self !== 'undefined' ? self : this).MeshoptDecoder = MeshoptDecoder;\n", "// This file is part of meshoptimizer library and is distributed under the terms of MIT License.\n// Copyright (C) 2016-2023, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)\nvar MeshoptSimplifier = (function() {\n\t\"use strict\";\n\t// Built with clang version 16.0.0\n\t// Built from meshoptimizer 0.20\n\tvar wasm = \"b9H79Tebbbe9Ek9Geueu9Geub9Gbb9GPuuuuuuuuuuu99uueu9Gvuuuuub9Gluuuub9Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuec:G;jekr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdxmq::9Usdbk;i6iKuY99Ou8Jjjjjbc;W;ab9RgP8KjjjjbaPcwfcbc;Kbz:ljjjb8AaPcualcefgscdtascFFFFi0Ecbyd1:jjjbHjjjjbbgzBdwaPceBd9OaPazBdbaPcuadcitadcFFFFe0Ecbyd1:jjjbHjjjjbbgHBdxaPcdBd9OaPaHBdlaPaeadalcbz:cjjjbaPcualcdtgOalcFFFFi0EgAcbyd1:jjjbHjjjjbbgCBdzaPciBd9OaPaAcbyd1:jjjbHjjjjbbgXBdCaPclBd9Oalcd4alfhQcehLinaLgscethLasaQ6mbkcbhKaPcuascdtgLascFFFFi0Ecbyd1:jjjbHjjjjbbgQBdKaPcvBd9OaQcFeaLz:ljjjbhYdnalTmbavcd4h8AascufhEinaiaKa8A2cdtfg3ydlgscH4as7c:F:b:DD2a3ydbgscH4as7c;D;O:B8J27a3ydwgscH4as7c:3F;N8N27hQcbhsdndninaYaQaEGgQcdtfg5ydbgLcuSmeaiaLa8A2cdtfa3cxz:ojjjbTmdascefgsaQfhQasaE9nmbxdkka5aKBdbaKhLkaCaKcdtfaLBdbaKcefgKal9hmbkcbhsaXhLinaLasBdbaLclfhLalascefgs9hmbkcbhsaChLaXhQindnasaLydbgESmbaQaXaEcdtfgEydbBdbaEasBdbkaLclfhLaQclfhQalascefgs9hmbkkcbh8EaYcbyd:m:jjjbH:bjjjbbaPclBd9OaPalcbyd1:jjjbHjjjjbbgEBdKaPcvBd9OaPaAcbyd1:jjjbHjjjjbbgsBd3aPcoBd9OaPaAcbyd1:jjjbHjjjjbbgLBdaaPcrBd9OascFeaOz:ljjjbh8FaLcFeaOz:ljjjbhadnalTmbaHcwfhhindnaza8EgQcefg8Ecdtfydbg3azaQcdtgsfydbgLSmba3aL9RhOaHaLcitfhgaaasfh8Ja8FasfhKcbh8Aindndnaga8Acitfydbg5aQ9hmbaKaQBdba8JaQBdbxekdnaza5cdtg8KfgsclfydbgLasydbgsSmbaHascitg3fydbaQSmeaLas9Rh8Lascu7aLfhYaha3fhLcbhsinaYasSmeascefhsaLydbh3aLcwfhLa3aQ9hmbkasa8L6mekaaa8KfgsaQa5asydbcuSEBdbaKa5aQaKydbcuSEBdbka8Acefg8AaO9hmbkka8Eal9hmbkaChLaXhQaah3a8Fh8AcbhsindndnasaLydbg59hmbdnasaQydbg59hmba8Aydbh5dna3ydbgYcu9hmba5cu9hmbaEasfcb86bbxikaEasfhKdnasaYSmbasa5SmbaKce86bbxikaKcl86bbxdkdnasaXa5cdtgYfydb9hmbdna3ydbgKcuSmbasaKSmba8AydbgOcuSmbasaOSmbaaaYfydbggcuSmbaga5Smba8FaYfydbgYcuSmbaYa5SmbdnaCaKcdtfydbaCaYcdtfydb9hmbaCaOcdtfydbaCagcdtfydb9hmbaEasfcd86bbxlkaEasfcl86bbxikaEasfcl86bbxdkaEasfcl86bbxekaEasfaEa5fRbb86bbkaLclfhLaQclfhQa3clfh3a8Aclfh8Aalascefgs9hmbkaxceGTmbaEhsalhLindnasRbbce9hmbascl86bbkascefhsaLcufgLmbkkcualcx2alc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbh8JaPcwfaPyd9Ogscdtfa8JBdbaPascefgOBd9Oa8Jaialavz:djjjbdndnaDmbcbhvxekcbh5aPcwfaOcdtfcuaDal2gLcdtaLcFFFFi0Ecbyd1:jjjbHjjjjbbgvBdbaPascdfgOBd9OalTmbarcd4cdthYaDcdthKavh8AinaohsawhLa8AhQaDh3inaQasIdbaLIdbNUdbasclfhsaLclfhLaQclfhQa3cufg3mbkaoaYfhoa8AaKfh8Aa5cefg5al9hmbkkaPcwfaOcdtfcualc8S2gsalc;D;O;f8U0EgQcbyd1:jjjbHjjjjbbgLBdbaPaOcefg3Bd9OaLcbasz:ljjjbh8EdndndnaDTmbaPcwfa3cdtfaQcbyd1:jjjbHjjjjbbgoBdbaPaOcdfgLBd9Oaocbasz:ljjjb8AaPcwfaLcdtfcuaDal2gscltgLascFFFFb0Ecbyd1:jjjbHjjjjbbgwBdbaPaOcifBd9OawcbaLz:ljjjb8AadmexdkcbhocbhwadTmekcbh8AaehLindna8JaLclfydbg5cx2fgsIdba8JaLydbgYcx2fgQIdbg8M:tg8Na8JaLcwfydbgKcx2fg3IdlaQIdlgy:tg8PNa3Idba8M:tgIasIdlay:tg8RN:tg8Sa8SNa8Ra3IdwaQIdwgR:tg8UNa8PasIdwaR:tg8RN:tg8Pa8PNa8RaINa8Ua8NN:tg8Na8NNMM:rgIJbbbb9ETmba8SaI:vh8Sa8NaI:vh8Na8PaI:vh8Pka8EaCaYcdtfydbc8S2fgsa8PaI:rgIa8PNNg8RasIdbMUdbasa8NaIa8NNg8VNg8UasIdlMUdlasa8SaIa8SNg8WNg8XasIdwMUdwasa8Va8PNg8VasIdxMUdxasa8Wa8PNg8YasIdzMUdzasa8Wa8NNg8WasIdCMUdCasa8PaIa8SaRNa8Pa8MNaya8NNMM:mgyNg8MNg8PasIdKMUdKasa8Na8MNg8NasId3MUd3asa8Sa8MNg8SasIdaMUdaasa8MayNg8MasId8KMUd8KasaIasIdyMUdya8EaCa5cdtfydbc8S2fgsa8RasIdbMUdbasa8UasIdlMUdlasa8XasIdwMUdwasa8VasIdxMUdxasa8YasIdzMUdzasa8WasIdCMUdCasa8PasIdKMUdKasa8NasId3MUd3asa8SasIdaMUdaasa8MasId8KMUd8KasaIasIdyMUdya8EaCaKcdtfydbc8S2fgsa8RasIdbMUdbasa8UasIdlMUdlasa8XasIdwMUdwasa8VasIdxMUdxasa8YasIdzMUdzasa8WasIdCMUdCasa8PasIdKMUdKasa8NasId3MUd3asa8SasIdaMUdaasa8MasId8KMUd8KasaIasIdyMUdyaLcxfhLa8Acifg8Aad6mbkcbh5aehYincbhLinaEaeaLc:G1jjbfydba5fcdtfydbgQfRbbhsdndnaEaYaLfydbg3fRbbg8Ac99fcFeGcpe0mbasceSmbascd9hmekdna8AcufcFeGce0mba8Fa3cdtfydbaQ9hmekdnascufcFeGce0mbaaaQcdtfydba39hmekdna8Acv2asfc:W1jjbfRbbTmbaCaQcdtfydbaCa3cdtfydb0mekJbbacJbbjZasceSEhIa8AceShOa8JaeaLc:K1jjbfydba5fcdtfydbcx2fhsdna8JaQcx2fg8AIdwa8Ja3cx2fgKIdwgy:tg8Pa8PNa8AIdbaKIdbgR:tg8Na8NNa8AIdlaKIdlg8R:tg8Sa8SNMM:rg8MJbbbb9ETmba8Pa8M:v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UdaasaRasId8KMUd8Kasa8PasIdyMUdyawaLaD2cltfh5cbhLaDh3ina5aLfgsaPc;WbfaLfgQIdbasIdbMUdbasclfg8AaQclfIdba8AIdbMUdbascwfg8AaQcwfIdba8AIdbMUdbascxfgsaQcxfIdbasIdbMUdbaLczfhLa3cufg3mbkawaKaD2cltfh5cbhLaDh3ina5aLfgsaPc;WbfaLfgQIdbasIdbMUdbasclfg8AaQclfIdba8AIdbMUdbascwfg8AaQcwfIdba8AIdbMUdbascxfgsaQcxfIdbasIdbMUdbaLczfhLa3cufg3mbkawaOaD2cltfh5cbhLaDh3ina5aLfgsaPc;WbfaLfgQIdbasIdbMUdbasclfg8AaQclfIdba8AIdbMUdbascwfg8AaQcwfIdba8AIdbMUdbascxfgsaQcxfIdbasIdbMUdbaLczfhLa3cufg3mbkaYcifgYad6mbkkdnabaeSmbabaeadcdtz:kjjjb8AkaPydbhZcbhsdnalTmbaZclfhsaZydbh3aEhLalh8AcbhQincbasydbg5a39RaLRbbcpeGEaQfhQaLcefhLasclfhsa5h3a8Acufg8AmbkaQce4hskcuadas9Rcifgrcx2arc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbh8LaPcwfaPyd9Ogscdtfa8LBdbaPascefgLBd9OaPcwfaLcdtfcuarcdtarcFFFFi0Ecbyd1:jjjbHjjjjbbgxBdbaPascdfgLBd9OaPcwfaLcdtfaAcbyd1:jjjbHjjjjbbgHBdbaPascifgLBd9OaPcwfaLcdtfalcbyd1:jjjbHjjjjbbgnBdbaPasclfBd9OJbbbbh8Ydnadaq9nmbdnarci6mbakakNh8VaDclthca8Lcwfh9cJbbbbh8YinaPabadghalaCz:cjjjbabhOcbhzcbhKincbhsindnaCaOasfydbgQcdtgYfydbg8AaCabasc;m1jjbfydbaKfcdtfydbgLcdtfydbg5SmbaEaLfRbbgecv2aEaQfRbbg3fc;G1jjbfRbbg8Ka3cv2aefggc;G1jjbfRbbgiVcFeGTmbdnagc:W1jjbfRbbTmba5a8A0mekdna3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ea9nc8S2g8AfgLIdbasIdbMUdbasaLIdlasIdlMUdlasaLIdwasIdwMUdwasaLIdxasIdxMUdxasaLIdzasIdzMUdzasaLIdCasIdCMUdCasaLIdKasIdKMUdKasaLId3asId3MUd3asaLIdaasIdaMUdaasaLId8KasId8KMUd8KasaLIdyasIdyMUdydnaDTmbaoaQfgsaoa8AfgLIdbasIdbMUdbasaLIdlasIdlMUdlasaLIdwasIdwMUdwasaLIdxasIdxMUdxasaLIdzasIdzMUdzasaLIdCasIdCMUdCasaLIdKasIdKMUdKasaLId3asId3MUd3asaLIdaasIdaMUdaasaLId8KasId8KMUd8KasaLIdyasIdyMUdyaca9n2heaca32hYawhLaDh8AinaLaYfgsaLaefgQIdbasIdbMUdbasclfg5aQclfIdba5IdbMUdbascwfg5aQcwfIdba5IdbMUdbascxfgsaQcxfIdbasIdbMUdbaLczfhLa8Acufg8AmbkkaOcwfhLdndndndnaEaKfgQRbbc9:fPdebdkaKhsinaHascdtgsfa3BdbaXasfydbgsaK9hmbxikkaXa9kfydbhsaXa9mfydbhKaHa9mfa6Bdbash6kaHaKcdtfa6Bdbka9oce86bba0ce86bbaLIdbg8Pa8Ya8Ya8P9DEh8Ya9ecefh9ececdaQRbbceSEaifhikagcefggaz9hmbkkdna9embahhdxikdnalTmbcbhLa8FhsindnasydbgQcuSmbdnaLaHaQcdtg3fydbgQ9hmba8Fa3fydbhQkasaQBdbkasclfhsalaLcefgL9hmbkcbhLaahsindnasydbgQcuSmbdnaLaHaQcdtg3fydbgQ9hmbaaa3fydbhQkasaQBdbkasclfhsalaLcefgL9hmbkkcbhdabhscbh8AindnaHasydbcdtfydbgLaHasclfydbcdtfydbgQSmbaLaHascwfydbcdtfydbg3SmbaQa3Smbabadcdtfg5aLBdba5clfaQBdba5cwfa3Bdbadcifhdkascxfhsa8Acifg8Aah6mbkadaq9nmdxbkkaPabadalaCz:cjjjbkdnamTmbama8Y:rUdbkaPyd9OgscdtaPcwffc98fhCdninasTmeaCydbcbyd:m:jjjbH:bjjjbbaCc98fhCascufhsxbkkaPc;W;abf8Kjjjjbadk;:ieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbarcearce0EhdinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfheadcufgdmbkkabydbcbBdbk:Zldouv998Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdnadTmbaicd4hvdnabTmbavcdthocbhraehwinabarcx2fgiaearav2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinalczfaifgDawaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawaofhwarcefgrad9hmbxdkkavcdthrcbhwincbhiinalczfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbkkdnabTmbadTmbJbbbbJbbjZalIdbalIdzgk:tJbbbb:xgqalIdlalIdCgx:tgmamaq9DEgqalIdwalIdKgm:tgPaPaq9DEgq:vaqJbbbb9BEhqinabaqabIdbak:tNUdbabclfgiaqaiIdbax:tNUdbabcwfgiaqaiIdbam:tNUdbabcxfhbadcufgdmbkkk8KbabaeadaialavcbcbcbcbaoarawaDz:bjjjbk8KbabaeadaialavaoarawaDaqakaxamz:bjjjbk;lOowud99wue99iul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcwfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbgqBdwawceBd9Oaqaeadaiz:djjjbawcuadcdtadcFFFFi0Egkcbyd1:jjjbHjjjjbbgxBdxawcdBd9Oadcd4adfhmceheinaegicetheaiam6mbkcbhmawcuaicdtgPaicFFFFi0Ecbyd1:jjjbHjjjjbbgsBdzawciBd9Odndnar:Zgz:rJbbbZMgH:lJbbb9p9DTmbaH:Ohexekcjjjj94hekaicufhOc:bwhAcbhCcbhXadhQinaChLaeaAgKcufaeaK9iEamgDcefaeaD9kEhYdndnadTmbaYcuf:YhHaqhiaxheadhmindndnaiIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhAxekcjjjj94hAkaAcCthAdndnaiclfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcqtaAVhAdndnaicwfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaeaAaCVBdbaicxfhiaeclfheamcufgmmbkascFeaPz:ljjjbhEcbh3cbh5indnaEaxa5cdtfydbgAcm4aA7c:v;t;h;Ev2gics4ai7aOGgmcdtfgCydbgecuSmbaeaASmbcehiinaEamaifaOGgmcdtfgCydbgecuSmeaicefhiaeaA9hmbkkaCaABdba3aecuSfh3a5cefg5ad9hmbxdkkascFeaPz:ljjjb8Acbh3kaDaYa3ar0giEhmaLa3aiEhCdna3arSmbaYaKaiEgAam9Rcd9imbdndnaXcl0mbdnaQ:ZgHaL:Zg8A:taY:Yg8EaD:Y:tg8Fa8EaK:Y:tgaa3:Zghaz:tNNNaHaz:taaNa8Aah:tNa8Aaz:ta8FNahaH:tNM:va8EMJbbbZMgH:lJbbb9p9DTmbaH:Ohexdkcjjjj94hexekamaAfcd9Theka3aQaiEhQaXcefgXcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd1:jjjbHjjjjbbg5BdCawclBd9OdndnadTmbamcuf:YhHaqhiaxheadhmindndnaiIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhAxekcjjjj94hAkaAcCthAdndnaiclfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcqtaAVhAdndnaicwfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaeaAaCVBdbaicxfhiaeclfheamcufgmmbkascFeaPz:ljjjbhEcbhDcbh3inaxa3cdtgYfydbgAcm4aA7c:v;t;h;Ev2gics4ai7hecbhidndninaEaeaOGgmcdtfgCydbgecuSmednaxaecdtgCfydbaASmbaicefgiamfheaiaO9nmekka5aCfydbhixekaCa3BdbaDhiaDcefhDka5aYfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekascFeaPz:ljjjb8AcbhDcbhekawaecbyd1:jjjbHjjjjbbgeBdKawcvBd9Oaecbaiz:ljjjbhOavcd4hxdnadTmbaxcdth3a5hmalhAaqheadhEinaOamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaAc;81jjbalEgCIdbaiIdxMUdxaiaCIdlaiIdzMUdzaiaCIdwaiIdCMUdCaiaiIdKJbbjZMUdKamclfhmaAa3fhAaecxfheaEcufgEmbkkdnaDTmbaOcxfhiaDheinaictfgmamIdbJbbbbJbbjZaicxfIdbgH:vaHJbbbb9BEgHNUdbaic94fgmaHamIdbNUdbaic98fgmaHamIdbNUdbaiaHaiIdbNUdbaiclfgmaHamIdbNUdbaicwfgmaHamIdbNUdbaic3fhiaecufgembkkcbhAawcuaDcdtgYaDcFFFFi0Egicbyd1:jjjbHjjjjbbgeBd3awcoBd9Oawaicbyd1:jjjbHjjjjbbgEBdaaecFeaYz:ljjjbh3dnadTmbaoaoNh8Aaxcdthxalheina8Aaec;81jjbalEgmIdwaOa5ydbgCc32fgiIdC:tgHaHNamIdbaiIdx:tgHaHNamIdlaiIdz:tgHaHNMMNaqcwfIdbaiIdw:tgHaHNaqIdbaiIdb:tgHaHNaqclfIdbaiIdl:tgHaHNMMMhHdndna3aCcdtgifgmydbcuSmbaEaifIdbaH9ETmekamaABdbaEaifaHUdbka5clfh5aeaxfheaqcxfhqadaAcefgA9hmbkkaba3aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcwffydbcbyd:m:jjjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Qdidui99ducbhi8Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgoaDIdbgrarao9EEUdbaladfgDaoaDIdbgrarao9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkavJbbbb:xgvaoaoav9DEgoararao9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd:q:jjjbgeabcifc98GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:jjjbgeabcrfc94GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:jjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:jjjbfgdBd:q:jjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:Iedbcjwk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbeeebeebebbeeebebbbbbebebbbbbebbbdbbbbbbbbbbbbbbbeeeeebebbbbbebbbbbeebbbbbbbbbbbbbbbbbbbbbc1Dkxebbbdbbb:G9Kbb\";\n\n\tvar wasmpack = new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);\n\n\tif (typeof WebAssembly !== 'object') {\n\t\treturn {\n\t\t\tsupported: false,\n\t\t};\n\t}\n\n\tvar instance;\n\n\tvar ready =\n\t\tWebAssembly.instantiate(unpack(wasm), {})\n\t\t.then(function(result) {\n\t\t\tinstance = result.instance;\n\t\t\tinstance.exports.__wasm_call_ctors();\n\t\t});\n\n\tfunction unpack(data) {\n\t\tvar result = new Uint8Array(data.length);\n\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\tvar ch = data.charCodeAt(i);\n\t\t\tresult[i] = ch > 96 ? ch - 97 : ch > 64 ? ch - 39 : ch + 4;\n\t\t}\n\t\tvar write = 0;\n\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\tresult[write++] = (result[i] < 60) ? wasmpack[result[i]] : (result[i] - 60) * 64 + result[++i];\n\t\t}\n\t\treturn result.buffer.slice(0, write);\n\t}\n\n\tfunction assert(cond) {\n\t\tif (!cond) {\n\t\t\tthrow new Error(\"Assertion failed\");\n\t\t}\n\t}\n\n\tfunction bytes(view) {\n\t\treturn new Uint8Array(view.buffer, view.byteOffset, view.byteLength);\n\t}\n\n\tfunction reorder(fun, indices, vertices) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar ip = sbrk(indices.length * 4);\n\t\tvar rp = sbrk(vertices * 4);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\tvar indices8 = bytes(indices);\n\t\theap.set(indices8, ip);\n\t\tvar unique = fun(rp, ip, indices.length, vertices);\n\t\t// heap may have grown\n\t\theap = new Uint8Array(instance.exports.memory.buffer);\n\t\tvar remap = new Uint32Array(vertices);\n\t\tnew Uint8Array(remap.buffer).set(heap.subarray(rp, rp + vertices * 4));\n\t\tindices8.set(heap.subarray(ip, ip + indices.length * 4));\n\t\tsbrk(ip - sbrk(0));\n\n\t\tfor (var i = 0; i < indices.length; ++i)\n\t\t\tindices[i] = remap[indices[i]];\n\n\t\treturn [remap, unique];\n\t}\n\n\tfunction maxindex(source) {\n\t\tvar result = 0;\n\t\tfor (var i = 0; i < source.length; ++i) {\n\t\t\tvar index = source[i];\n\t\t\tresult = result < index ? index : result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction simplify(fun, indices, index_count, vertex_positions, vertex_count, vertex_positions_stride, target_index_count, target_error, options) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar te = sbrk(4);\n\t\tvar ti = sbrk(index_count * 4);\n\t\tvar sp = sbrk(vertex_count * vertex_positions_stride);\n\t\tvar si = sbrk(index_count * 4);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\theap.set(bytes(vertex_positions), sp);\n\t\theap.set(bytes(indices), si);\n\t\tvar result = fun(ti, si, index_count, sp, vertex_count, vertex_positions_stride, target_index_count, target_error, options, te);\n\t\t// heap may have grown\n\t\theap = new Uint8Array(instance.exports.memory.buffer);\n\t\tvar target = new Uint32Array(result);\n\t\tbytes(target).set(heap.subarray(ti, ti + result * 4));\n\t\tvar error = new Float32Array(1);\n\t\tbytes(error).set(heap.subarray(te, te + 4));\n\t\tsbrk(te - sbrk(0));\n\t\treturn [target, error[0]];\n\t}\n\n\tfunction simplifyAttr(fun, indices, index_count, vertex_positions, vertex_count, vertex_positions_stride, vertex_attributes, vertex_attributes_stride, attribute_weights, target_index_count, target_error, options) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar te = sbrk(4);\n\t\tvar ti = sbrk(index_count * 4);\n\t\tvar sp = sbrk(vertex_count * vertex_positions_stride);\n\t\tvar sa = sbrk(vertex_count * vertex_attributes_stride);\n\t\tvar sw = sbrk(attribute_weights.length * 4);\n\t\tvar si = sbrk(index_count * 4);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\theap.set(bytes(vertex_positions), sp);\n\t\theap.set(bytes(vertex_attributes), sa);\n\t\theap.set(bytes(attribute_weights), sw);\n\t\theap.set(bytes(indices), si);\n\t\tvar result = fun(ti, si, index_count, sp, vertex_count, vertex_positions_stride, sa, vertex_attributes_stride, sw, attribute_weights.length, target_index_count, target_error, options, te);\n\t\t// heap may have grown\n\t\theap = new Uint8Array(instance.exports.memory.buffer);\n\t\tvar target = new Uint32Array(result);\n\t\tbytes(target).set(heap.subarray(ti, ti + result * 4));\n\t\tvar error = new Float32Array(1);\n\t\tbytes(error).set(heap.subarray(te, te + 4));\n\t\tsbrk(te - sbrk(0));\n\t\treturn [target, error[0]];\n\t}\n\n\tfunction simplifyScale(fun, vertex_positions, vertex_count, vertex_positions_stride) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar sp = sbrk(vertex_count * vertex_positions_stride);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\theap.set(bytes(vertex_positions), sp);\n\t\tvar result = fun(sp, vertex_count, vertex_positions_stride);\n\t\tsbrk(sp - sbrk(0));\n\t\treturn result;\n\t}\n\n\tfunction simplifyPoints(fun, vertex_positions, vertex_count, vertex_positions_stride, vertex_colors, vertex_colors_stride, color_weight, target_vertex_count) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar ti = sbrk(target_vertex_count * 4);\n\t\tvar sp = sbrk(vertex_count * vertex_positions_stride);\n\t\tvar sc = sbrk(vertex_count * vertex_colors_stride);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\theap.set(bytes(vertex_positions), sp);\n\t\tif (vertex_colors) {\n\t\t\theap.set(bytes(vertex_colors), sc);\n\t\t}\n\t\tvar result = fun(ti, sp, vertex_count, vertex_positions_stride, sc, vertex_colors_stride, color_weight, target_vertex_count);\n\t\t// heap may have grown\n\t\theap = new Uint8Array(instance.exports.memory.buffer);\n\t\tvar target = new Uint32Array(result);\n\t\tbytes(target).set(heap.subarray(ti, ti + result * 4));\n\t\tsbrk(ti - sbrk(0));\n\t\treturn target;\n\t}\n\n\tvar simplifyOptions = {\n\t\tLockBorder: 1,\n\t};\n\n\treturn {\n\t\tready: ready,\n\t\tsupported: true,\n\n\t\t// set this to true to be able to use simplifyPoints and simplifyWithAttributes\n\t\t// note that these functions are experimental and may change interface/behavior in a way that will require revising calling code\n\t\tuseExperimentalFeatures: false,\n\n\t\tcompactMesh: function(indices) {\n\t\t\tassert(indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array);\n\t\t\tassert(indices.length % 3 == 0);\n\n\t\t\tvar indices32 = indices.BYTES_PER_ELEMENT == 4 ? indices : new Uint32Array(indices);\n\t\t\treturn reorder(instance.exports.meshopt_optimizeVertexFetchRemap, indices32, maxindex(indices) + 1);\n\t\t},\n\n\t\tsimplify: function(indices, vertex_positions, vertex_positions_stride, target_index_count, target_error, flags) {\n\t\t\tassert(indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array);\n\t\t\tassert(indices.length % 3 == 0);\n\t\t\tassert(vertex_positions instanceof Float32Array);\n\t\t\tassert(vertex_positions.length % vertex_positions_stride == 0);\n\t\t\tassert(vertex_positions_stride >= 3);\n\t\t\tassert(target_index_count >= 0 && target_index_count <= indices.length);\n\t\t\tassert(target_index_count % 3 == 0);\n\t\t\tassert(target_error >= 0 && target_error <= 1);\n\n\t\t\tvar options = 0;\n\t\t\tfor (var i = 0; i < (flags ? flags.length : 0); ++i) {\n\t\t\t\toptions |= simplifyOptions[flags[i]];\n\t\t\t}\n\n\t\t\tvar indices32 = indices.BYTES_PER_ELEMENT == 4 ? indices : new Uint32Array(indices);\n\t\t\tvar result = simplify(instance.exports.meshopt_simplify, indices32, indices.length, vertex_positions, vertex_positions.length / vertex_positions_stride, vertex_positions_stride * 4, target_index_count, target_error, options);\n\t\t\tresult[0] = (indices instanceof Uint32Array) ? result[0] : new indices.constructor(result[0]);\n\n\t\t\treturn result;\n\t\t},\n\n\t\tsimplifyWithAttributes: function(indices, vertex_positions, vertex_positions_stride, vertex_attributes, vertex_attributes_stride, attribute_weights, target_index_count, target_error, flags) {\n\t\t\tassert(this.useExperimentalFeatures); // set useExperimentalFeatures to use this; note that this function is experimental and may change interface in a way that will require revising calling code\n\t\t\tassert(indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array);\n\t\t\tassert(indices.length % 3 == 0);\n\t\t\tassert(vertex_positions instanceof Float32Array);\n\t\t\tassert(vertex_positions.length % vertex_positions_stride == 0);\n\t\t\tassert(vertex_positions_stride >= 3);\n\t\t\tassert(vertex_attributes instanceof Float32Array);\n\t\t\tassert(vertex_attributes.length % vertex_attributes_stride == 0);\n\t\t\tassert(vertex_attributes_stride >= 0);\n\t\t\tassert(target_index_count >= 0 && target_index_count <= indices.length);\n\t\t\tassert(target_index_count % 3 == 0);\n\t\t\tassert(target_error >= 0 && target_error <= 1);\n\t\t\tassert(Array.isArray(attribute_weights));\n\t\t\tassert(vertex_attributes_stride >= attribute_weights.length);\n\t\t\tassert(attribute_weights.length <= 16);\n\n\t\t\tvar options = 0;\n\t\t\tfor (var i = 0; i < (flags ? flags.length : 0); ++i) {\n\t\t\t\toptions |= simplifyOptions[flags[i]];\n\t\t\t}\n\n\t\t\tvar indices32 = indices.BYTES_PER_ELEMENT == 4 ? indices : new Uint32Array(indices);\n\t\t\tvar result = simplifyAttr(instance.exports.meshopt_simplifyWithAttributes, indices32, indices.length, vertex_positions, vertex_positions.length / vertex_positions_stride, vertex_positions_stride * 4, vertex_attributes, vertex_attributes_stride * 4, new Float32Array(attribute_weights), target_index_count, target_error, options);\n\t\t\tresult[0] = (indices instanceof Uint32Array) ? result[0] : new indices.constructor(result[0]);\n\n\t\t\treturn result;\n\t\t},\n\n\t\tgetScale: function(vertex_positions, vertex_positions_stride) {\n\t\t\tassert(vertex_positions instanceof Float32Array);\n\t\t\tassert(vertex_positions.length % vertex_positions_stride == 0);\n\t\t\tassert(vertex_positions_stride >= 3);\n\t\t\treturn simplifyScale(instance.exports.meshopt_simplifyScale, vertex_positions, vertex_positions.length / vertex_positions_stride, vertex_positions_stride * 4);\n\t\t},\n\n\t\tsimplifyPoints: function(vertex_positions, vertex_positions_stride, target_vertex_count, vertex_colors, vertex_colors_stride, color_weight) {\n\t\t\tassert(this.useExperimentalFeatures); // set useExperimentalFeatures to use this; note that this function is experimental and may change interface in a way that will require revising calling code\n\t\t\tassert(vertex_positions instanceof Float32Array);\n\t\t\tassert(vertex_positions.length % vertex_positions_stride == 0);\n\t\t\tassert(vertex_positions_stride >= 3);\n\t\t\tassert(target_vertex_count >= 0 && target_vertex_count <= vertex_positions.length / vertex_positions_stride);\n\t\t\tif (vertex_colors) {\n\t\t\t\tassert(vertex_colors instanceof Float32Array);\n\t\t\t\tassert(vertex_colors.length % vertex_colors_stride == 0);\n\t\t\t\tassert(vertex_colors_stride >= 3);\n\t\t\t\tassert(vertex_positions.length / vertex_positions_stride == vertex_colors.length / vertex_colors_stride);\n\t\t\t\treturn simplifyPoints(instance.exports.meshopt_simplifyPoints, vertex_positions, vertex_positions.length / vertex_positions_stride, vertex_positions_stride * 4, vertex_colors, vertex_colors_stride * 4, color_weight, target_vertex_count);\n\t\t\t} else {\n\t\t\t\treturn simplifyPoints(instance.exports.meshopt_simplifyPoints, vertex_positions, vertex_positions.length / vertex_positions_stride, vertex_positions_stride * 4, undefined, 0, 0, target_vertex_count);\n\t\t\t}\n\t\t},\n\t};\n})();\n\n// UMD-style export for MeshoptSimplifier\nif (typeof exports === 'object' && typeof module === 'object')\n\tmodule.exports = MeshoptSimplifier;\nelse if (typeof define === 'function' && define['amd'])\n\tdefine([], function() {\n\t\treturn MeshoptSimplifier;\n\t});\nelse if (typeof exports === 'object')\n\texports[\"MeshoptSimplifier\"] = MeshoptSimplifier;\nelse\n\t(typeof self !== 'undefined' ? self : this).MeshoptSimplifier = MeshoptSimplifier;\n", "const MeshoptEncoder = require('./meshopt_encoder.js');\nconst MeshoptDecoder = require('./meshopt_decoder.js');\nconst MeshoptSimplifier = require('./meshopt_simplifier.js');\n\nmodule.exports = {MeshoptEncoder, MeshoptDecoder, MeshoptSimplifier};\n", "'use strict'\r\n\r\nmodule.exports = calcSDF\r\n\r\nvar INF = 1e20\r\n\r\nfunction calcSDF(src, options) {\r\n    if (!options) options = {}\r\n\r\n    var cutoff = options.cutoff == null ? 0.25 : options.cutoff\r\n    var radius = options.radius == null ? 8 : options.radius\r\n    var channel = options.channel || 0\r\n    var w, h, size, data, intData, stride, ctx, canvas, imgData, i, l\r\n\r\n    // handle image container\r\n    if (ArrayBuffer.isView(src) || Array.isArray(src)) {\r\n        if (!options.width || !options.height) throw Error('For raw data width and height should be provided by options')\r\n        w = options.width, h = options.height\r\n        data = src\r\n\r\n        if (!options.stride) stride = Math.floor(src.length / w / h)\r\n        else stride = options.stride\r\n    }\r\n    else {\r\n        if (window.HTMLCanvasElement && src instanceof window.HTMLCanvasElement) {\r\n            canvas = src\r\n            ctx = canvas.getContext('2d')\r\n            w = canvas.width, h = canvas.height\r\n            imgData = ctx.getImageData(0, 0, w, h)\r\n            data = imgData.data\r\n            stride = 4\r\n        }\r\n        else if (window.CanvasRenderingContext2D && src instanceof window.CanvasRenderingContext2D) {\r\n            canvas = src.canvas\r\n            ctx = src\r\n            w = canvas.width, h = canvas.height\r\n            imgData = ctx.getImageData(0, 0, w, h)\r\n            data = imgData.data\r\n            stride = 4\r\n        }\r\n        else if (window.ImageData && src instanceof window.ImageData) {\r\n            imgData = src\r\n            w = src.width, h = src.height\r\n            data = imgData.data\r\n            stride = 4\r\n        }\r\n    }\r\n\r\n    size = Math.max(w, h)\r\n\r\n    //convert int data to floats\r\n    if ((window.Uint8ClampedArray && data instanceof window.Uint8ClampedArray) || (window.Uint8Array && data instanceof window.Uint8Array)) {\r\n        intData = data\r\n        data = Array(w*h)\r\n\r\n        for (i = 0, l = Math.floor(intData.length / stride); i < l; i++) {\r\n            data[i] = intData[i*stride + channel] / 255\r\n        }\r\n    }\r\n    else {\r\n        if (stride !== 1) throw Error('Raw data can have only 1 value per pixel')\r\n    }\r\n\r\n    // temporary arrays for the distance transform\r\n    var gridOuter = Array(w * h)\r\n    var gridInner = Array(w * h)\r\n    var f = Array(size)\r\n    var d = Array(size)\r\n    var z = Array(size + 1)\r\n    var v = Array(size)\r\n\r\n    for (i = 0, l = w * h; i < l; i++) {\r\n        var a = data[i]\r\n        gridOuter[i] = a === 1 ? 0 : a === 0 ? INF : Math.pow(Math.max(0, 0.5 - a), 2)\r\n        gridInner[i] = a === 1 ? INF : a === 0 ? 0 : Math.pow(Math.max(0, a - 0.5), 2)\r\n    }\r\n\r\n    edt(gridOuter, w, h, f, d, v, z)\r\n    edt(gridInner, w, h, f, d, v, z)\r\n\r\n    var dist = window.Float32Array ? new Float32Array(w * h) : new Array(w * h)\r\n\r\n    for (i = 0, l = w*h; i < l; i++) {\r\n        dist[i] = Math.min(Math.max(1 - ( (gridOuter[i] - gridInner[i]) / radius + cutoff), 0), 1)\r\n    }\r\n\r\n    return dist\r\n}\r\n\r\n// 2D Euclidean distance transform by Felzenszwalb & Huttenlocher https://cs.brown.edu/~pff/dt/\r\nfunction edt(data, width, height, f, d, v, z) {\r\n    for (var x = 0; x < width; x++) {\r\n        for (var y = 0; y < height; y++) {\r\n            f[y] = data[y * width + x]\r\n        }\r\n        edt1d(f, d, v, z, height)\r\n        for (y = 0; y < height; y++) {\r\n            data[y * width + x] = d[y]\r\n        }\r\n    }\r\n    for (y = 0; y < height; y++) {\r\n        for (x = 0; x < width; x++) {\r\n            f[x] = data[y * width + x]\r\n        }\r\n        edt1d(f, d, v, z, width)\r\n        for (x = 0; x < width; x++) {\r\n            data[y * width + x] = Math.sqrt(d[x])\r\n        }\r\n    }\r\n}\r\n\r\n// 1D squared distance transform\r\nfunction edt1d(f, d, v, z, n) {\r\n    v[0] = 0;\r\n    z[0] = -INF\r\n    z[1] = +INF\r\n\r\n    for (var q = 1, k = 0; q < n; q++) {\r\n        var s = ((f[q] + q * q) - (f[v[k]] + v[k] * v[k])) / (2 * q - 2 * v[k])\r\n        while (s <= z[k]) {\r\n            k--\r\n            s = ((f[q] + q * q) - (f[v[k]] + v[k] * v[k])) / (2 * q - 2 * v[k])\r\n        }\r\n        k++\r\n        v[k] = q\r\n        z[k] = s\r\n        z[k + 1] = +INF\r\n    }\r\n\r\n    for (q = 0, k = 0; q < n; q++) {\r\n        while (z[k + 1] < q) k++\r\n        d[q] = (q - v[k]) * (q - v[k]) + f[v[k]]\r\n    }\r\n}\r\n", "/*\r\nBreaks a Javascript string into individual user-perceived \"characters\" \r\ncalled extended grapheme clusters by implementing the Unicode UAX-29 standard, version 10.0.0\r\n\r\nUsage:\r\nvar splitter = new GraphemeSplitter();\r\n//returns an array of strings, one string for each grapheme cluster\r\nvar graphemes = splitter.splitGraphemes(string); \r\n\r\n*/\r\nfunction GraphemeSplitter(){\r\n\tvar CR = 0,\r\n\t\tLF = 1,\r\n\t\tControl = 2,\r\n\t\tExtend = 3,\r\n\t\tRegional_Indicator = 4,\r\n\t\tSpacingMark = 5,\r\n\t\tL = 6,\r\n\t\tV = 7,\r\n\t\tT = 8,\r\n\t\tLV = 9,\r\n\t\tLVT = 10,\r\n\t\tOther = 11,\r\n\t\tPrepend = 12,\r\n\t\tE_Base = 13,\r\n\t\tE_Modifier = 14,\r\n\t\tZWJ = 15,\r\n\t\tGlue_After_Zwj = 16,\r\n\t\tE_Base_GAZ = 17;\r\n\t\t\r\n\t// BreakTypes\r\n\tvar NotBreak = 0,\r\n\t\tBreakStart = 1,\r\n\t\tBreak = 2,\r\n\t\tBreakLastRegional = 3,\r\n\t\tBreakPenultimateRegional = 4;\r\n\t\t\r\n\tfunction isSurrogate(str, pos) {\r\n\t\treturn  0xd800 <= str.charCodeAt(pos) && str.charCodeAt(pos) <= 0xdbff && \r\n\t\t\t\t0xdc00 <= str.charCodeAt(pos + 1) && str.charCodeAt(pos + 1) <= 0xdfff;\r\n\t}\r\n\t\t\r\n\t// Private function, gets a Unicode code point from a JavaScript UTF-16 string\r\n\t// handling surrogate pairs appropriately\r\n\tfunction codePointAt(str, idx){\r\n\t\tif(idx === undefined){\r\n\t\t\tidx = 0;\r\n\t\t}\r\n\t\tvar code = str.charCodeAt(idx);\r\n\r\n\t\t// if a high surrogate\r\n\t\tif (0xD800 <= code && code <= 0xDBFF && \r\n\t\t\tidx < str.length - 1){\r\n\t\t\tvar hi = code;\r\n\t\t\tvar low = str.charCodeAt(idx + 1);\r\n\t\t\tif (0xDC00 <= low && low <= 0xDFFF){\r\n\t\t\t\treturn ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;\r\n\t\t\t}\r\n\t\t\treturn hi;\r\n\t\t}\r\n\t\t\r\n\t\t// if a low surrogate\r\n\t\tif (0xDC00 <= code && code <= 0xDFFF &&\r\n\t\t\tidx >= 1){\r\n\t\t\tvar hi = str.charCodeAt(idx - 1);\r\n\t\t\tvar low = code;\r\n\t\t\tif (0xD800 <= hi && hi <= 0xDBFF){\r\n\t\t\t\treturn ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;\r\n\t\t\t}\r\n\t\t\treturn low;\r\n\t\t}\r\n\t\t\r\n\t\t//just return the char if an unmatched surrogate half or a \r\n\t\t//single-char codepoint\r\n\t\treturn code;\r\n\t}\r\n\t\r\n\t// Private function, returns whether a break is allowed between the \r\n\t// two given grapheme breaking classes\r\n\tfunction shouldBreak(start, mid, end){\r\n\t\tvar all = [start].concat(mid).concat([end]);\r\n\t\tvar previous = all[all.length - 2]\r\n\t\tvar next = end\r\n\t\t\r\n\t\t// Lookahead termintor for:\r\n\t\t// GB10. (E_Base | EBG) Extend* ?\tE_Modifier\r\n\t\tvar eModifierIndex = all.lastIndexOf(E_Modifier)\r\n\t\tif(eModifierIndex > 1 &&\r\n\t\t\tall.slice(1, eModifierIndex).every(function(c){return c == Extend}) &&\r\n\t\t\t[Extend, E_Base, E_Base_GAZ].indexOf(start) == -1){\r\n\t\t\treturn Break\r\n\t\t}\r\n\r\n\t\t// Lookahead termintor for:\r\n\t\t// GB12. ^ (RI RI)* RI\t?\tRI\r\n\t\t// GB13. [^RI] (RI RI)* RI\t?\tRI\r\n\t\tvar rIIndex = all.lastIndexOf(Regional_Indicator)\r\n\t\tif(rIIndex > 0 &&\r\n\t\t\tall.slice(1, rIIndex).every(function(c){return c == Regional_Indicator}) &&\r\n\t\t\t[Prepend, Regional_Indicator].indexOf(previous) == -1) { \r\n\t\t\tif(all.filter(function(c){return c == Regional_Indicator}).length % 2 == 1) {\r\n\t\t\t\treturn BreakLastRegional\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn BreakPenultimateRegional\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// GB3. CR X LF\r\n\t\tif(previous == CR && next == LF){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t// GB4. (Control|CR|LF) \u00F7\r\n\t\telse if(previous == Control || previous == CR || previous == LF){\r\n\t\t\tif(next == E_Modifier && mid.every(function(c){return c == Extend})){\r\n\t\t\t\treturn Break\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn BreakStart\r\n\t\t\t}\r\n\t\t}\r\n\t\t// GB5. \u00F7 (Control|CR|LF)\r\n\t\telse if(next == Control || next == CR || next == LF){\r\n\t\t\treturn BreakStart;\r\n\t\t}\r\n\t\t// GB6. L X (L|V|LV|LVT)\r\n\t\telse if(previous == L && \r\n\t\t\t(next == L || next == V || next == LV || next == LVT)){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t// GB7. (LV|V) X (V|T)\r\n\t\telse if((previous == LV || previous == V) && \r\n\t\t\t(next == V || next == T)){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t// GB8. (LVT|T) X (T)\r\n\t\telse if((previous == LVT || previous == T) && \r\n\t\t\tnext == T){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t// GB9. X (Extend|ZWJ)\r\n\t\telse if (next == Extend || next == ZWJ){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t// GB9a. X SpacingMark\r\n\t\telse if(next == SpacingMark){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t// GB9b. Prepend X\r\n\t\telse if (previous == Prepend){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t\r\n\t\t// GB10. (E_Base | EBG) Extend* ?\tE_Modifier\r\n\t\tvar previousNonExtendIndex = all.indexOf(Extend) != -1 ? all.lastIndexOf(Extend) - 1 : all.length - 2;\r\n\t\tif([E_Base, E_Base_GAZ].indexOf(all[previousNonExtendIndex]) != -1 &&\r\n\t\t\tall.slice(previousNonExtendIndex + 1, -1).every(function(c){return c == Extend}) &&\r\n\t\t\tnext == E_Modifier){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t\r\n\t\t// GB11. ZWJ ? (Glue_After_Zwj | EBG)\r\n\t\tif(previous == ZWJ && [Glue_After_Zwj, E_Base_GAZ].indexOf(next) != -1) {\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\r\n\t\t// GB12. ^ (RI RI)* RI ? RI\r\n\t\t// GB13. [^RI] (RI RI)* RI ? RI\r\n\t\tif(mid.indexOf(Regional_Indicator) != -1) { \r\n\t\t\treturn Break;\r\n\t\t}\r\n\t\tif(previous == Regional_Indicator && next == Regional_Indicator) {\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\r\n\t\t// GB999. Any ? Any\r\n\t\treturn BreakStart;\r\n\t}\r\n\t\r\n\t// Returns the next grapheme break in the string after the given index\r\n\tthis.nextBreak = function(string, index){\r\n\t\tif(index === undefined){\r\n\t\t\tindex = 0;\r\n\t\t}\r\n\t\tif(index < 0){\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(index >= string.length - 1){\r\n\t\t\treturn string.length;\r\n\t\t}\r\n\t\tvar prev = getGraphemeBreakProperty(codePointAt(string, index));\r\n\t\tvar mid = []\r\n\t\tfor (var i = index + 1; i < string.length; i++) {\r\n\t\t\t// check for already processed low surrogates\r\n\t\t\tif(isSurrogate(string, i - 1)){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\r\n\t\t\tvar next = getGraphemeBreakProperty(codePointAt(string, i));\r\n\t\t\tif(shouldBreak(prev, mid, next)){\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmid.push(next);\r\n\t\t}\r\n\t\treturn string.length;\r\n\t};\r\n\t\r\n\t// Breaks the given string into an array of grapheme cluster strings\r\n\tthis.splitGraphemes = function(str){\r\n\t\tvar res = [];\r\n\t\tvar index = 0;\r\n\t\tvar brk;\r\n\t\twhile((brk = this.nextBreak(str, index)) < str.length){\r\n\t\t\tres.push(str.slice(index, brk));\r\n\t\t\tindex = brk;\r\n\t\t}\r\n\t\tif(index < str.length){\r\n\t\t\tres.push(str.slice(index));\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\t// Returns the iterator of grapheme clusters there are in the given string\r\n\tthis.iterateGraphemes = function(str) {\r\n\t\tvar index = 0;\r\n\t\tvar res = {\r\n\t\t\tnext: (function() {\r\n\t\t\t\tvar value;\r\n\t\t\t\tvar brk;\r\n\t\t\t\tif ((brk = this.nextBreak(str, index)) < str.length) {\r\n\t\t\t\t\tvalue = str.slice(index, brk);\r\n\t\t\t\t\tindex = brk;\r\n\t\t\t\t\treturn { value: value, done: false };\r\n\t\t\t\t}\r\n\t\t\t\tif (index < str.length) {\r\n\t\t\t\t\tvalue = str.slice(index);\r\n\t\t\t\t\tindex = str.length;\r\n\t\t\t\t\treturn { value: value, done: false };\r\n\t\t\t\t}\r\n\t\t\t\treturn { value: undefined, done: true };\r\n\t\t\t}).bind(this)\r\n\t\t};\r\n\t\t// ES2015 @@iterator method (iterable) for spread syntax and for...of statement\r\n\t\tif (typeof Symbol !== 'undefined' && Symbol.iterator) {\r\n\t\t\tres[Symbol.iterator] = function() {return res};\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\t// Returns the number of grapheme clusters there are in the given string\r\n\tthis.countGraphemes = function(str){\r\n\t\tvar count = 0;\r\n\t\tvar index = 0;\r\n\t\tvar brk;\r\n\t\twhile((brk = this.nextBreak(str, index)) < str.length){\r\n\t\t\tindex = brk;\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tif(index < str.length){\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\treturn count;\r\n\t};\r\n\t\r\n\t//given a Unicode code point, determines this symbol's grapheme break property\r\n\tfunction getGraphemeBreakProperty(code){\r\n\t\t\r\n\t\t//grapheme break property for Unicode 10.0.0, \r\n\t\t//taken from http://www.unicode.org/Public/10.0.0/ucd/auxiliary/GraphemeBreakProperty.txt\r\n\t\t//and adapted to JavaScript rules\r\n\t\t\r\n\t\tif(\t\t\r\n\t\t(0x0600 <= code && code <= 0x0605) || // Cf   [6] ARABIC NUMBER SIGN..ARABIC NUMBER MARK ABOVE\r\n\t\t0x06DD == code || // Cf       ARABIC END OF AYAH\r\n\t\t0x070F == code || // Cf       SYRIAC ABBREVIATION MARK\r\n\t\t0x08E2 == code || // Cf       ARABIC DISPUTED END OF AYAH\r\n\t\t0x0D4E == code || // Lo       MALAYALAM LETTER DOT REPH\r\n\t\t0x110BD == code || // Cf       KAITHI NUMBER SIGN\r\n\t\t(0x111C2 <= code && code <= 0x111C3) || // Lo   [2] SHARADA SIGN JIHVAMULIYA..SHARADA SIGN UPADHMANIYA\r\n\t\t0x11A3A == code || // Lo       ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA\r\n\t\t(0x11A86 <= code && code <= 0x11A89) || // Lo   [4] SOYOMBO CLUSTER-INITIAL LETTER RA..SOYOMBO CLUSTER-INITIAL LETTER SA\r\n\t\t0x11D46 == code // Lo       MASARAM GONDI REPHA\r\n\t\t){\r\n\t\t\treturn Prepend;\r\n\t\t}\r\n\t\tif(\r\n\t\t0x000D == code // Cc       <control-000D>\r\n\t\t){\r\n\t\t\treturn CR;\r\n\t\t}\r\n\t\t\r\n\t\tif(\r\n\t\t0x000A == code // Cc       <control-000A>\r\n\t\t){\r\n\t\t\treturn LF;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(\r\n\t\t(0x0000 <= code && code <= 0x0009) || // Cc  [10] <control-0000>..<control-0009>\r\n\t\t(0x000B <= code && code <= 0x000C) || // Cc   [2] <control-000B>..<control-000C>\r\n\t\t(0x000E <= code && code <= 0x001F) || // Cc  [18] <control-000E>..<control-001F>\r\n\t\t(0x007F <= code && code <= 0x009F) || // Cc  [33] <control-007F>..<control-009F>\r\n\t\t0x00AD == code || // Cf       SOFT HYPHEN\r\n\t\t0x061C == code || // Cf       ARABIC LETTER MARK\r\n\t\r\n\t\t0x180E == code || // Cf       MONGOLIAN VOWEL SEPARATOR\r\n\t\t0x200B == code || // Cf       ZERO WIDTH SPACE\r\n\t\t(0x200E <= code && code <= 0x200F) || // Cf   [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK\r\n\t\t0x2028 == code || // Zl       LINE SEPARATOR\r\n\t\t0x2029 == code || // Zp       PARAGRAPH SEPARATOR\r\n\t\t(0x202A <= code && code <= 0x202E) || // Cf   [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE\r\n\t\t(0x2060 <= code && code <= 0x2064) || // Cf   [5] WORD JOINER..INVISIBLE PLUS\r\n\t\t0x2065 == code || // Cn       <reserved-2065>\r\n\t\t(0x2066 <= code && code <= 0x206F) || // Cf  [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES\r\n\t\t(0xD800 <= code && code <= 0xDFFF) || // Cs [2048] <surrogate-D800>..<surrogate-DFFF>\r\n\t\t0xFEFF == code || // Cf       ZERO WIDTH NO-BREAK SPACE\r\n\t\t(0xFFF0 <= code && code <= 0xFFF8) || // Cn   [9] <reserved-FFF0>..<reserved-FFF8>\r\n\t\t(0xFFF9 <= code && code <= 0xFFFB) || // Cf   [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR\r\n\t\t(0x1BCA0 <= code && code <= 0x1BCA3) || // Cf   [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP\r\n\t\t(0x1D173 <= code && code <= 0x1D17A) || // Cf   [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE\r\n\t\t0xE0000 == code || // Cn       <reserved-E0000>\r\n\t\t0xE0001 == code || // Cf       LANGUAGE TAG\r\n\t\t(0xE0002 <= code && code <= 0xE001F) || // Cn  [30] <reserved-E0002>..<reserved-E001F>\r\n\t\t(0xE0080 <= code && code <= 0xE00FF) || // Cn [128] <reserved-E0080>..<reserved-E00FF>\r\n\t\t(0xE01F0 <= code && code <= 0xE0FFF) // Cn [3600] <reserved-E01F0>..<reserved-E0FFF>\r\n\t\t){\r\n\t\t\treturn Control;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(\r\n\t\t(0x0300 <= code && code <= 0x036F) || // Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X\r\n\t\t(0x0483 <= code && code <= 0x0487) || // Mn   [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE\r\n\t\t(0x0488 <= code && code <= 0x0489) || // Me   [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN\r\n\t\t(0x0591 <= code && code <= 0x05BD) || // Mn  [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG\r\n\t\t0x05BF == code || // Mn       HEBREW POINT RAFE\r\n\t\t(0x05C1 <= code && code <= 0x05C2) || // Mn   [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT\r\n\t\t(0x05C4 <= code && code <= 0x05C5) || // Mn   [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT\r\n\t\t0x05C7 == code || // Mn       HEBREW POINT QAMATS QATAN\r\n\t\t(0x0610 <= code && code <= 0x061A) || // Mn  [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA\r\n\t\t(0x064B <= code && code <= 0x065F) || // Mn  [21] ARABIC FATHATAN..ARABIC WAVY HAMZA BELOW\r\n\t\t0x0670 == code || // Mn       ARABIC LETTER SUPERSCRIPT ALEF\r\n\t\t(0x06D6 <= code && code <= 0x06DC) || // Mn   [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN\r\n\t\t(0x06DF <= code && code <= 0x06E4) || // Mn   [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA\r\n\t\t(0x06E7 <= code && code <= 0x06E8) || // Mn   [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON\r\n\t\t(0x06EA <= code && code <= 0x06ED) || // Mn   [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM\r\n\t\t0x0711 == code || // Mn       SYRIAC LETTER SUPERSCRIPT ALAPH\r\n\t\t(0x0730 <= code && code <= 0x074A) || // Mn  [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH\r\n\t\t(0x07A6 <= code && code <= 0x07B0) || // Mn  [11] THAANA ABAFILI..THAANA SUKUN\r\n\t\t(0x07EB <= code && code <= 0x07F3) || // Mn   [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE\r\n\t\t(0x0816 <= code && code <= 0x0819) || // Mn   [4] SAMARITAN MARK IN..SAMARITAN MARK DAGESH\r\n\t\t(0x081B <= code && code <= 0x0823) || // Mn   [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A\r\n\t\t(0x0825 <= code && code <= 0x0827) || // Mn   [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U\r\n\t\t(0x0829 <= code && code <= 0x082D) || // Mn   [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA\r\n\t\t(0x0859 <= code && code <= 0x085B) || // Mn   [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK\r\n\t\t(0x08D4 <= code && code <= 0x08E1) || // Mn  [14] ARABIC SMALL HIGH WORD AR-RUB..ARABIC SMALL HIGH SIGN SAFHA\r\n\t\t(0x08E3 <= code && code <= 0x0902) || // Mn  [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA\r\n\t\t0x093A == code || // Mn       DEVANAGARI VOWEL SIGN OE\r\n\t\t0x093C == code || // Mn       DEVANAGARI SIGN NUKTA\r\n\t\t(0x0941 <= code && code <= 0x0948) || // Mn   [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI\r\n\t\t0x094D == code || // Mn       DEVANAGARI SIGN VIRAMA\r\n\t\t(0x0951 <= code && code <= 0x0957) || // Mn   [7] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI VOWEL SIGN UUE\r\n\t\t(0x0962 <= code && code <= 0x0963) || // Mn   [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL\r\n\t\t0x0981 == code || // Mn       BENGALI SIGN CANDRABINDU\r\n\t\t0x09BC == code || // Mn       BENGALI SIGN NUKTA\r\n\t\t0x09BE == code || // Mc       BENGALI VOWEL SIGN AA\r\n\t\t(0x09C1 <= code && code <= 0x09C4) || // Mn   [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR\r\n\t\t0x09CD == code || // Mn       BENGALI SIGN VIRAMA\r\n\t\t0x09D7 == code || // Mc       BENGALI AU LENGTH MARK\r\n\t\t(0x09E2 <= code && code <= 0x09E3) || // Mn   [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL\r\n\t\t(0x0A01 <= code && code <= 0x0A02) || // Mn   [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI\r\n\t\t0x0A3C == code || // Mn       GURMUKHI SIGN NUKTA\r\n\t\t(0x0A41 <= code && code <= 0x0A42) || // Mn   [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU\r\n\t\t(0x0A47 <= code && code <= 0x0A48) || // Mn   [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI\r\n\t\t(0x0A4B <= code && code <= 0x0A4D) || // Mn   [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA\r\n\t\t0x0A51 == code || // Mn       GURMUKHI SIGN UDAAT\r\n\t\t(0x0A70 <= code && code <= 0x0A71) || // Mn   [2] GURMUKHI TIPPI..GURMUKHI ADDAK\r\n\t\t0x0A75 == code || // Mn       GURMUKHI SIGN YAKASH\r\n\t\t(0x0A81 <= code && code <= 0x0A82) || // Mn   [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA\r\n\t\t0x0ABC == code || // Mn       GUJARATI SIGN NUKTA\r\n\t\t(0x0AC1 <= code && code <= 0x0AC5) || // Mn   [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E\r\n\t\t(0x0AC7 <= code && code <= 0x0AC8) || // Mn   [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI\r\n\t\t0x0ACD == code || // Mn       GUJARATI SIGN VIRAMA\r\n\t\t(0x0AE2 <= code && code <= 0x0AE3) || // Mn   [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL\r\n\t\t(0x0AFA <= code && code <= 0x0AFF) || // Mn   [6] GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE\r\n\t\t0x0B01 == code || // Mn       ORIYA SIGN CANDRABINDU\r\n\t\t0x0B3C == code || // Mn       ORIYA SIGN NUKTA\r\n\t\t0x0B3E == code || // Mc       ORIYA VOWEL SIGN AA\r\n\t\t0x0B3F == code || // Mn       ORIYA VOWEL SIGN I\r\n\t\t(0x0B41 <= code && code <= 0x0B44) || // Mn   [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR\r\n\t\t0x0B4D == code || // Mn       ORIYA SIGN VIRAMA\r\n\t\t0x0B56 == code || // Mn       ORIYA AI LENGTH MARK\r\n\t\t0x0B57 == code || // Mc       ORIYA AU LENGTH MARK\r\n\t\t(0x0B62 <= code && code <= 0x0B63) || // Mn   [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL\r\n\t\t0x0B82 == code || // Mn       TAMIL SIGN ANUSVARA\r\n\t\t0x0BBE == code || // Mc       TAMIL VOWEL SIGN AA\r\n\t\t0x0BC0 == code || // Mn       TAMIL VOWEL SIGN II\r\n\t\t0x0BCD == code || // Mn       TAMIL SIGN VIRAMA\r\n\t\t0x0BD7 == code || // Mc       TAMIL AU LENGTH MARK\r\n\t\t0x0C00 == code || // Mn       TELUGU SIGN COMBINING CANDRABINDU ABOVE\r\n\t\t(0x0C3E <= code && code <= 0x0C40) || // Mn   [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II\r\n\t\t(0x0C46 <= code && code <= 0x0C48) || // Mn   [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI\r\n\t\t(0x0C4A <= code && code <= 0x0C4D) || // Mn   [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA\r\n\t\t(0x0C55 <= code && code <= 0x0C56) || // Mn   [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK\r\n\t\t(0x0C62 <= code && code <= 0x0C63) || // Mn   [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL\r\n\t\t0x0C81 == code || // Mn       KANNADA SIGN CANDRABINDU\r\n\t\t0x0CBC == code || // Mn       KANNADA SIGN NUKTA\r\n\t\t0x0CBF == code || // Mn       KANNADA VOWEL SIGN I\r\n\t\t0x0CC2 == code || // Mc       KANNADA VOWEL SIGN UU\r\n\t\t0x0CC6 == code || // Mn       KANNADA VOWEL SIGN E\r\n\t\t(0x0CCC <= code && code <= 0x0CCD) || // Mn   [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA\r\n\t\t(0x0CD5 <= code && code <= 0x0CD6) || // Mc   [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK\r\n\t\t(0x0CE2 <= code && code <= 0x0CE3) || // Mn   [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL\r\n\t\t(0x0D00 <= code && code <= 0x0D01) || // Mn   [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU\r\n\t\t(0x0D3B <= code && code <= 0x0D3C) || // Mn   [2] MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA\r\n\t\t0x0D3E == code || // Mc       MALAYALAM VOWEL SIGN AA\r\n\t\t(0x0D41 <= code && code <= 0x0D44) || // Mn   [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR\r\n\t\t0x0D4D == code || // Mn       MALAYALAM SIGN VIRAMA\r\n\t\t0x0D57 == code || // Mc       MALAYALAM AU LENGTH MARK\r\n\t\t(0x0D62 <= code && code <= 0x0D63) || // Mn   [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL\r\n\t\t0x0DCA == code || // Mn       SINHALA SIGN AL-LAKUNA\r\n\t\t0x0DCF == code || // Mc       SINHALA VOWEL SIGN AELA-PILLA\r\n\t\t(0x0DD2 <= code && code <= 0x0DD4) || // Mn   [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA\r\n\t\t0x0DD6 == code || // Mn       SINHALA VOWEL SIGN DIGA PAA-PILLA\r\n\t\t0x0DDF == code || // Mc       SINHALA VOWEL SIGN GAYANUKITTA\r\n\t\t0x0E31 == code || // Mn       THAI CHARACTER MAI HAN-AKAT\r\n\t\t(0x0E34 <= code && code <= 0x0E3A) || // Mn   [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU\r\n\t\t(0x0E47 <= code && code <= 0x0E4E) || // Mn   [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN\r\n\t\t0x0EB1 == code || // Mn       LAO VOWEL SIGN MAI KAN\r\n\t\t(0x0EB4 <= code && code <= 0x0EB9) || // Mn   [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU\r\n\t\t(0x0EBB <= code && code <= 0x0EBC) || // Mn   [2] LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL SIGN LO\r\n\t\t(0x0EC8 <= code && code <= 0x0ECD) || // Mn   [6] LAO TONE MAI EK..LAO NIGGAHITA\r\n\t\t(0x0F18 <= code && code <= 0x0F19) || // Mn   [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS\r\n\t\t0x0F35 == code || // Mn       TIBETAN MARK NGAS BZUNG NYI ZLA\r\n\t\t0x0F37 == code || // Mn       TIBETAN MARK NGAS BZUNG SGOR RTAGS\r\n\t\t0x0F39 == code || // Mn       TIBETAN MARK TSA -PHRU\r\n\t\t(0x0F71 <= code && code <= 0x0F7E) || // Mn  [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO\r\n\t\t(0x0F80 <= code && code <= 0x0F84) || // Mn   [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA\r\n\t\t(0x0F86 <= code && code <= 0x0F87) || // Mn   [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS\r\n\t\t(0x0F8D <= code && code <= 0x0F97) || // Mn  [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA\r\n\t\t(0x0F99 <= code && code <= 0x0FBC) || // Mn  [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA\r\n\t\t0x0FC6 == code || // Mn       TIBETAN SYMBOL PADMA GDAN\r\n\t\t(0x102D <= code && code <= 0x1030) || // Mn   [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU\r\n\t\t(0x1032 <= code && code <= 0x1037) || // Mn   [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW\r\n\t\t(0x1039 <= code && code <= 0x103A) || // Mn   [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT\r\n\t\t(0x103D <= code && code <= 0x103E) || // Mn   [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA\r\n\t\t(0x1058 <= code && code <= 0x1059) || // Mn   [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL\r\n\t\t(0x105E <= code && code <= 0x1060) || // Mn   [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA\r\n\t\t(0x1071 <= code && code <= 0x1074) || // Mn   [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE\r\n\t\t0x1082 == code || // Mn       MYANMAR CONSONANT SIGN SHAN MEDIAL WA\r\n\t\t(0x1085 <= code && code <= 0x1086) || // Mn   [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y\r\n\t\t0x108D == code || // Mn       MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE\r\n\t\t0x109D == code || // Mn       MYANMAR VOWEL SIGN AITON AI\r\n\t\t(0x135D <= code && code <= 0x135F) || // Mn   [3] ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK..ETHIOPIC COMBINING GEMINATION MARK\r\n\t\t(0x1712 <= code && code <= 0x1714) || // Mn   [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA\r\n\t\t(0x1732 <= code && code <= 0x1734) || // Mn   [3] HANUNOO VOWEL SIGN I..HANUNOO SIGN PAMUDPOD\r\n\t\t(0x1752 <= code && code <= 0x1753) || // Mn   [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U\r\n\t\t(0x1772 <= code && code <= 0x1773) || // Mn   [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U\r\n\t\t(0x17B4 <= code && code <= 0x17B5) || // Mn   [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA\r\n\t\t(0x17B7 <= code && code <= 0x17BD) || // Mn   [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA\r\n\t\t0x17C6 == code || // Mn       KHMER SIGN NIKAHIT\r\n\t\t(0x17C9 <= code && code <= 0x17D3) || // Mn  [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT\r\n\t\t0x17DD == code || // Mn       KHMER SIGN ATTHACAN\r\n\t\t(0x180B <= code && code <= 0x180D) || // Mn   [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE\r\n\t\t(0x1885 <= code && code <= 0x1886) || // Mn   [2] MONGOLIAN LETTER ALI GALI BALUDA..MONGOLIAN LETTER ALI GALI THREE BALUDA\r\n\t\t0x18A9 == code || // Mn       MONGOLIAN LETTER ALI GALI DAGALGA\r\n\t\t(0x1920 <= code && code <= 0x1922) || // Mn   [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U\r\n\t\t(0x1927 <= code && code <= 0x1928) || // Mn   [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O\r\n\t\t0x1932 == code || // Mn       LIMBU SMALL LETTER ANUSVARA\r\n\t\t(0x1939 <= code && code <= 0x193B) || // Mn   [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I\r\n\t\t(0x1A17 <= code && code <= 0x1A18) || // Mn   [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U\r\n\t\t0x1A1B == code || // Mn       BUGINESE VOWEL SIGN AE\r\n\t\t0x1A56 == code || // Mn       TAI THAM CONSONANT SIGN MEDIAL LA\r\n\t\t(0x1A58 <= code && code <= 0x1A5E) || // Mn   [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA\r\n\t\t0x1A60 == code || // Mn       TAI THAM SIGN SAKOT\r\n\t\t0x1A62 == code || // Mn       TAI THAM VOWEL SIGN MAI SAT\r\n\t\t(0x1A65 <= code && code <= 0x1A6C) || // Mn   [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW\r\n\t\t(0x1A73 <= code && code <= 0x1A7C) || // Mn  [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN\r\n\t\t0x1A7F == code || // Mn       TAI THAM COMBINING CRYPTOGRAMMIC DOT\r\n\t\t(0x1AB0 <= code && code <= 0x1ABD) || // Mn  [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW\r\n\t\t0x1ABE == code || // Me       COMBINING PARENTHESES OVERLAY\r\n\t\t(0x1B00 <= code && code <= 0x1B03) || // Mn   [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG\r\n\t\t0x1B34 == code || // Mn       BALINESE SIGN REREKAN\r\n\t\t(0x1B36 <= code && code <= 0x1B3A) || // Mn   [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA\r\n\t\t0x1B3C == code || // Mn       BALINESE VOWEL SIGN LA LENGA\r\n\t\t0x1B42 == code || // Mn       BALINESE VOWEL SIGN PEPET\r\n\t\t(0x1B6B <= code && code <= 0x1B73) || // Mn   [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG\r\n\t\t(0x1B80 <= code && code <= 0x1B81) || // Mn   [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR\r\n\t\t(0x1BA2 <= code && code <= 0x1BA5) || // Mn   [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU\r\n\t\t(0x1BA8 <= code && code <= 0x1BA9) || // Mn   [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG\r\n\t\t(0x1BAB <= code && code <= 0x1BAD) || // Mn   [3] SUNDANESE SIGN VIRAMA..SUNDANESE CONSONANT SIGN PASANGAN WA\r\n\t\t0x1BE6 == code || // Mn       BATAK SIGN TOMPI\r\n\t\t(0x1BE8 <= code && code <= 0x1BE9) || // Mn   [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE\r\n\t\t0x1BED == code || // Mn       BATAK VOWEL SIGN KARO O\r\n\t\t(0x1BEF <= code && code <= 0x1BF1) || // Mn   [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H\r\n\t\t(0x1C2C <= code && code <= 0x1C33) || // Mn   [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T\r\n\t\t(0x1C36 <= code && code <= 0x1C37) || // Mn   [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA\r\n\t\t(0x1CD0 <= code && code <= 0x1CD2) || // Mn   [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA\r\n\t\t(0x1CD4 <= code && code <= 0x1CE0) || // Mn  [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA\r\n\t\t(0x1CE2 <= code && code <= 0x1CE8) || // Mn   [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL\r\n\t\t0x1CED == code || // Mn       VEDIC SIGN TIRYAK\r\n\t\t0x1CF4 == code || // Mn       VEDIC TONE CANDRA ABOVE\r\n\t\t(0x1CF8 <= code && code <= 0x1CF9) || // Mn   [2] VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE\r\n\t\t(0x1DC0 <= code && code <= 0x1DF9) || // Mn  [58] COMBINING DOTTED GRAVE ACCENT..COMBINING WIDE INVERTED BRIDGE BELOW\r\n\t\t(0x1DFB <= code && code <= 0x1DFF) || // Mn   [5] COMBINING DELETION MARK..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW\r\n\t\t0x200C == code || // Cf       ZERO WIDTH NON-JOINER\r\n\t\t(0x20D0 <= code && code <= 0x20DC) || // Mn  [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE\r\n\t\t(0x20DD <= code && code <= 0x20E0) || // Me   [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH\r\n\t\t0x20E1 == code || // Mn       COMBINING LEFT RIGHT ARROW ABOVE\r\n\t\t(0x20E2 <= code && code <= 0x20E4) || // Me   [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE\r\n\t\t(0x20E5 <= code && code <= 0x20F0) || // Mn  [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE\r\n\t\t(0x2CEF <= code && code <= 0x2CF1) || // Mn   [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS\r\n\t\t0x2D7F == code || // Mn       TIFINAGH CONSONANT JOINER\r\n\t\t(0x2DE0 <= code && code <= 0x2DFF) || // Mn  [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS\r\n\t\t(0x302A <= code && code <= 0x302D) || // Mn   [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENTERING TONE MARK\r\n\t\t(0x302E <= code && code <= 0x302F) || // Mc   [2] HANGUL SINGLE DOT TONE MARK..HANGUL DOUBLE DOT TONE MARK\r\n\t\t(0x3099 <= code && code <= 0x309A) || // Mn   [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK\r\n\t\t0xA66F == code || // Mn       COMBINING CYRILLIC VZMET\r\n\t\t(0xA670 <= code && code <= 0xA672) || // Me   [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN\r\n\t\t(0xA674 <= code && code <= 0xA67D) || // Mn  [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK\r\n\t\t(0xA69E <= code && code <= 0xA69F) || // Mn   [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E\r\n\t\t(0xA6F0 <= code && code <= 0xA6F1) || // Mn   [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS\r\n\t\t0xA802 == code || // Mn       SYLOTI NAGRI SIGN DVISVARA\r\n\t\t0xA806 == code || // Mn       SYLOTI NAGRI SIGN HASANTA\r\n\t\t0xA80B == code || // Mn       SYLOTI NAGRI SIGN ANUSVARA\r\n\t\t(0xA825 <= code && code <= 0xA826) || // Mn   [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E\r\n\t\t(0xA8C4 <= code && code <= 0xA8C5) || // Mn   [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA SIGN CANDRABINDU\r\n\t\t(0xA8E0 <= code && code <= 0xA8F1) || // Mn  [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA\r\n\t\t(0xA926 <= code && code <= 0xA92D) || // Mn   [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU\r\n\t\t(0xA947 <= code && code <= 0xA951) || // Mn  [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R\r\n\t\t(0xA980 <= code && code <= 0xA982) || // Mn   [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR\r\n\t\t0xA9B3 == code || // Mn       JAVANESE SIGN CECAK TELU\r\n\t\t(0xA9B6 <= code && code <= 0xA9B9) || // Mn   [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT\r\n\t\t0xA9BC == code || // Mn       JAVANESE VOWEL SIGN PEPET\r\n\t\t0xA9E5 == code || // Mn       MYANMAR SIGN SHAN SAW\r\n\t\t(0xAA29 <= code && code <= 0xAA2E) || // Mn   [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE\r\n\t\t(0xAA31 <= code && code <= 0xAA32) || // Mn   [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE\r\n\t\t(0xAA35 <= code && code <= 0xAA36) || // Mn   [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA\r\n\t\t0xAA43 == code || // Mn       CHAM CONSONANT SIGN FINAL NG\r\n\t\t0xAA4C == code || // Mn       CHAM CONSONANT SIGN FINAL M\r\n\t\t0xAA7C == code || // Mn       MYANMAR SIGN TAI LAING TONE-2\r\n\t\t0xAAB0 == code || // Mn       TAI VIET MAI KANG\r\n\t\t(0xAAB2 <= code && code <= 0xAAB4) || // Mn   [3] TAI VIET VOWEL I..TAI VIET VOWEL U\r\n\t\t(0xAAB7 <= code && code <= 0xAAB8) || // Mn   [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA\r\n\t\t(0xAABE <= code && code <= 0xAABF) || // Mn   [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK\r\n\t\t0xAAC1 == code || // Mn       TAI VIET TONE MAI THO\r\n\t\t(0xAAEC <= code && code <= 0xAAED) || // Mn   [2] MEETEI MAYEK VOWEL SIGN UU..MEETEI MAYEK VOWEL SIGN AAI\r\n\t\t0xAAF6 == code || // Mn       MEETEI MAYEK VIRAMA\r\n\t\t0xABE5 == code || // Mn       MEETEI MAYEK VOWEL SIGN ANAP\r\n\t\t0xABE8 == code || // Mn       MEETEI MAYEK VOWEL SIGN UNAP\r\n\t\t0xABED == code || // Mn       MEETEI MAYEK APUN IYEK\r\n\t\t0xFB1E == code || // Mn       HEBREW POINT JUDEO-SPANISH VARIKA\r\n\t\t(0xFE00 <= code && code <= 0xFE0F) || // Mn  [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16\r\n\t\t(0xFE20 <= code && code <= 0xFE2F) || // Mn  [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF\r\n\t\t(0xFF9E <= code && code <= 0xFF9F) || // Lm   [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK\r\n\t\t0x101FD == code || // Mn       PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE\r\n\t\t0x102E0 == code || // Mn       COPTIC EPACT THOUSANDS MARK\r\n\t\t(0x10376 <= code && code <= 0x1037A) || // Mn   [5] COMBINING OLD PERMIC LETTER AN..COMBINING OLD PERMIC LETTER SII\r\n\t\t(0x10A01 <= code && code <= 0x10A03) || // Mn   [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R\r\n\t\t(0x10A05 <= code && code <= 0x10A06) || // Mn   [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O\r\n\t\t(0x10A0C <= code && code <= 0x10A0F) || // Mn   [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA\r\n\t\t(0x10A38 <= code && code <= 0x10A3A) || // Mn   [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW\r\n\t\t0x10A3F == code || // Mn       KHAROSHTHI VIRAMA\r\n\t\t(0x10AE5 <= code && code <= 0x10AE6) || // Mn   [2] MANICHAEAN ABBREVIATION MARK ABOVE..MANICHAEAN ABBREVIATION MARK BELOW\r\n\t\t0x11001 == code || // Mn       BRAHMI SIGN ANUSVARA\r\n\t\t(0x11038 <= code && code <= 0x11046) || // Mn  [15] BRAHMI VOWEL SIGN AA..BRAHMI VIRAMA\r\n\t\t(0x1107F <= code && code <= 0x11081) || // Mn   [3] BRAHMI NUMBER JOINER..KAITHI SIGN ANUSVARA\r\n\t\t(0x110B3 <= code && code <= 0x110B6) || // Mn   [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI\r\n\t\t(0x110B9 <= code && code <= 0x110BA) || // Mn   [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA\r\n\t\t(0x11100 <= code && code <= 0x11102) || // Mn   [3] CHAKMA SIGN CANDRABINDU..CHAKMA SIGN VISARGA\r\n\t\t(0x11127 <= code && code <= 0x1112B) || // Mn   [5] CHAKMA VOWEL SIGN A..CHAKMA VOWEL SIGN UU\r\n\t\t(0x1112D <= code && code <= 0x11134) || // Mn   [8] CHAKMA VOWEL SIGN AI..CHAKMA MAAYYAA\r\n\t\t0x11173 == code || // Mn       MAHAJANI SIGN NUKTA\r\n\t\t(0x11180 <= code && code <= 0x11181) || // Mn   [2] SHARADA SIGN CANDRABINDU..SHARADA SIGN ANUSVARA\r\n\t\t(0x111B6 <= code && code <= 0x111BE) || // Mn   [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O\r\n\t\t(0x111CA <= code && code <= 0x111CC) || // Mn   [3] SHARADA SIGN NUKTA..SHARADA EXTRA SHORT VOWEL MARK\r\n\t\t(0x1122F <= code && code <= 0x11231) || // Mn   [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI\r\n\t\t0x11234 == code || // Mn       KHOJKI SIGN ANUSVARA\r\n\t\t(0x11236 <= code && code <= 0x11237) || // Mn   [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA\r\n\t\t0x1123E == code || // Mn       KHOJKI SIGN SUKUN\r\n\t\t0x112DF == code || // Mn       KHUDAWADI SIGN ANUSVARA\r\n\t\t(0x112E3 <= code && code <= 0x112EA) || // Mn   [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA\r\n\t\t(0x11300 <= code && code <= 0x11301) || // Mn   [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU\r\n\t\t0x1133C == code || // Mn       GRANTHA SIGN NUKTA\r\n\t\t0x1133E == code || // Mc       GRANTHA VOWEL SIGN AA\r\n\t\t0x11340 == code || // Mn       GRANTHA VOWEL SIGN II\r\n\t\t0x11357 == code || // Mc       GRANTHA AU LENGTH MARK\r\n\t\t(0x11366 <= code && code <= 0x1136C) || // Mn   [7] COMBINING GRANTHA DIGIT ZERO..COMBINING GRANTHA DIGIT SIX\r\n\t\t(0x11370 <= code && code <= 0x11374) || // Mn   [5] COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER PA\r\n\t\t(0x11438 <= code && code <= 0x1143F) || // Mn   [8] NEWA VOWEL SIGN U..NEWA VOWEL SIGN AI\r\n\t\t(0x11442 <= code && code <= 0x11444) || // Mn   [3] NEWA SIGN VIRAMA..NEWA SIGN ANUSVARA\r\n\t\t0x11446 == code || // Mn       NEWA SIGN NUKTA\r\n\t\t0x114B0 == code || // Mc       TIRHUTA VOWEL SIGN AA\r\n\t\t(0x114B3 <= code && code <= 0x114B8) || // Mn   [6] TIRHUTA VOWEL SIGN U..TIRHUTA VOWEL SIGN VOCALIC LL\r\n\t\t0x114BA == code || // Mn       TIRHUTA VOWEL SIGN SHORT E\r\n\t\t0x114BD == code || // Mc       TIRHUTA VOWEL SIGN SHORT O\r\n\t\t(0x114BF <= code && code <= 0x114C0) || // Mn   [2] TIRHUTA SIGN CANDRABINDU..TIRHUTA SIGN ANUSVARA\r\n\t\t(0x114C2 <= code && code <= 0x114C3) || // Mn   [2] TIRHUTA SIGN VIRAMA..TIRHUTA SIGN NUKTA\r\n\t\t0x115AF == code || // Mc       SIDDHAM VOWEL SIGN AA\r\n\t\t(0x115B2 <= code && code <= 0x115B5) || // Mn   [4] SIDDHAM VOWEL SIGN U..SIDDHAM VOWEL SIGN VOCALIC RR\r\n\t\t(0x115BC <= code && code <= 0x115BD) || // Mn   [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA\r\n\t\t(0x115BF <= code && code <= 0x115C0) || // Mn   [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA\r\n\t\t(0x115DC <= code && code <= 0x115DD) || // Mn   [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU\r\n\t\t(0x11633 <= code && code <= 0x1163A) || // Mn   [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI\r\n\t\t0x1163D == code || // Mn       MODI SIGN ANUSVARA\r\n\t\t(0x1163F <= code && code <= 0x11640) || // Mn   [2] MODI SIGN VIRAMA..MODI SIGN ARDHACANDRA\r\n\t\t0x116AB == code || // Mn       TAKRI SIGN ANUSVARA\r\n\t\t0x116AD == code || // Mn       TAKRI VOWEL SIGN AA\r\n\t\t(0x116B0 <= code && code <= 0x116B5) || // Mn   [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU\r\n\t\t0x116B7 == code || // Mn       TAKRI SIGN NUKTA\r\n\t\t(0x1171D <= code && code <= 0x1171F) || // Mn   [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA\r\n\t\t(0x11722 <= code && code <= 0x11725) || // Mn   [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU\r\n\t\t(0x11727 <= code && code <= 0x1172B) || // Mn   [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER\r\n\t\t(0x11A01 <= code && code <= 0x11A06) || // Mn   [6] ZANABAZAR SQUARE VOWEL SIGN I..ZANABAZAR SQUARE VOWEL SIGN O\r\n\t\t(0x11A09 <= code && code <= 0x11A0A) || // Mn   [2] ZANABAZAR SQUARE VOWEL SIGN REVERSED I..ZANABAZAR SQUARE VOWEL LENGTH MARK\r\n\t\t(0x11A33 <= code && code <= 0x11A38) || // Mn   [6] ZANABAZAR SQUARE FINAL CONSONANT MARK..ZANABAZAR SQUARE SIGN ANUSVARA\r\n\t\t(0x11A3B <= code && code <= 0x11A3E) || // Mn   [4] ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA..ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA\r\n\t\t0x11A47 == code || // Mn       ZANABAZAR SQUARE SUBJOINER\r\n\t\t(0x11A51 <= code && code <= 0x11A56) || // Mn   [6] SOYOMBO VOWEL SIGN I..SOYOMBO VOWEL SIGN OE\r\n\t\t(0x11A59 <= code && code <= 0x11A5B) || // Mn   [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK\r\n\t\t(0x11A8A <= code && code <= 0x11A96) || // Mn  [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA\r\n\t\t(0x11A98 <= code && code <= 0x11A99) || // Mn   [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER\r\n\t\t(0x11C30 <= code && code <= 0x11C36) || // Mn   [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L\r\n\t\t(0x11C38 <= code && code <= 0x11C3D) || // Mn   [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA\r\n\t\t0x11C3F == code || // Mn       BHAIKSUKI SIGN VIRAMA\r\n\t\t(0x11C92 <= code && code <= 0x11CA7) || // Mn  [22] MARCHEN SUBJOINED LETTER KA..MARCHEN SUBJOINED LETTER ZA\r\n\t\t(0x11CAA <= code && code <= 0x11CB0) || // Mn   [7] MARCHEN SUBJOINED LETTER RA..MARCHEN VOWEL SIGN AA\r\n\t\t(0x11CB2 <= code && code <= 0x11CB3) || // Mn   [2] MARCHEN VOWEL SIGN U..MARCHEN VOWEL SIGN E\r\n\t\t(0x11CB5 <= code && code <= 0x11CB6) || // Mn   [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU\r\n\t\t(0x11D31 <= code && code <= 0x11D36) || // Mn   [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI VOWEL SIGN VOCALIC R\r\n\t\t0x11D3A == code || // Mn       MASARAM GONDI VOWEL SIGN E\r\n\t\t(0x11D3C <= code && code <= 0x11D3D) || // Mn   [2] MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O\r\n\t\t(0x11D3F <= code && code <= 0x11D45) || // Mn   [7] MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI VIRAMA\r\n\t\t0x11D47 == code || // Mn       MASARAM GONDI RA-KARA\r\n\t\t(0x16AF0 <= code && code <= 0x16AF4) || // Mn   [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE\r\n\t\t(0x16B30 <= code && code <= 0x16B36) || // Mn   [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM\r\n\t\t(0x16F8F <= code && code <= 0x16F92) || // Mn   [4] MIAO TONE RIGHT..MIAO TONE BELOW\r\n\t\t(0x1BC9D <= code && code <= 0x1BC9E) || // Mn   [2] DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK\r\n\t\t0x1D165 == code || // Mc       MUSICAL SYMBOL COMBINING STEM\r\n\t\t(0x1D167 <= code && code <= 0x1D169) || // Mn   [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3\r\n\t\t(0x1D16E <= code && code <= 0x1D172) || // Mc   [5] MUSICAL SYMBOL COMBINING FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5\r\n\t\t(0x1D17B <= code && code <= 0x1D182) || // Mn   [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE\r\n\t\t(0x1D185 <= code && code <= 0x1D18B) || // Mn   [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE\r\n\t\t(0x1D1AA <= code && code <= 0x1D1AD) || // Mn   [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO\r\n\t\t(0x1D242 <= code && code <= 0x1D244) || // Mn   [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME\r\n\t\t(0x1DA00 <= code && code <= 0x1DA36) || // Mn  [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN\r\n\t\t(0x1DA3B <= code && code <= 0x1DA6C) || // Mn  [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT\r\n\t\t0x1DA75 == code || // Mn       SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS\r\n\t\t0x1DA84 == code || // Mn       SIGNWRITING LOCATION HEAD NECK\r\n\t\t(0x1DA9B <= code && code <= 0x1DA9F) || // Mn   [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6\r\n\t\t(0x1DAA1 <= code && code <= 0x1DAAF) || // Mn  [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16\r\n\t\t(0x1E000 <= code && code <= 0x1E006) || // Mn   [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE\r\n\t\t(0x1E008 <= code && code <= 0x1E018) || // Mn  [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU\r\n\t\t(0x1E01B <= code && code <= 0x1E021) || // Mn   [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI\r\n\t\t(0x1E023 <= code && code <= 0x1E024) || // Mn   [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS\r\n\t\t(0x1E026 <= code && code <= 0x1E02A) || // Mn   [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA\r\n\t\t(0x1E8D0 <= code && code <= 0x1E8D6) || // Mn   [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS\r\n\t\t(0x1E944 <= code && code <= 0x1E94A) || // Mn   [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA\r\n\t\t(0xE0020 <= code && code <= 0xE007F) || // Cf  [96] TAG SPACE..CANCEL TAG\r\n\t\t(0xE0100 <= code && code <= 0xE01EF) // Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256\r\n\t\t){\r\n\t\t\treturn Extend;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(\r\n\t\t(0x1F1E6 <= code && code <= 0x1F1FF) // So  [26] REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z\r\n\t\t){\r\n\t\t\treturn Regional_Indicator;\r\n\t\t}\r\n\t\t\r\n\t\tif(\r\n\t\t0x0903 == code || // Mc       DEVANAGARI SIGN VISARGA\r\n\t\t0x093B == code || // Mc       DEVANAGARI VOWEL SIGN OOE\r\n\t\t(0x093E <= code && code <= 0x0940) || // Mc   [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II\r\n\t\t(0x0949 <= code && code <= 0x094C) || // Mc   [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU\r\n\t\t(0x094E <= code && code <= 0x094F) || // Mc   [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW\r\n\t\t(0x0982 <= code && code <= 0x0983) || // Mc   [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA\r\n\t\t(0x09BF <= code && code <= 0x09C0) || // Mc   [2] BENGALI VOWEL SIGN I..BENGALI VOWEL SIGN II\r\n\t\t(0x09C7 <= code && code <= 0x09C8) || // Mc   [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI\r\n\t\t(0x09CB <= code && code <= 0x09CC) || // Mc   [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU\r\n\t\t0x0A03 == code || // Mc       GURMUKHI SIGN VISARGA\r\n\t\t(0x0A3E <= code && code <= 0x0A40) || // Mc   [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II\r\n\t\t0x0A83 == code || // Mc       GUJARATI SIGN VISARGA\r\n\t\t(0x0ABE <= code && code <= 0x0AC0) || // Mc   [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II\r\n\t\t0x0AC9 == code || // Mc       GUJARATI VOWEL SIGN CANDRA O\r\n\t\t(0x0ACB <= code && code <= 0x0ACC) || // Mc   [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU\r\n\t\t(0x0B02 <= code && code <= 0x0B03) || // Mc   [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA\r\n\t\t0x0B40 == code || // Mc       ORIYA VOWEL SIGN II\r\n\t\t(0x0B47 <= code && code <= 0x0B48) || // Mc   [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI\r\n\t\t(0x0B4B <= code && code <= 0x0B4C) || // Mc   [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU\r\n\t\t0x0BBF == code || // Mc       TAMIL VOWEL SIGN I\r\n\t\t(0x0BC1 <= code && code <= 0x0BC2) || // Mc   [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU\r\n\t\t(0x0BC6 <= code && code <= 0x0BC8) || // Mc   [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI\r\n\t\t(0x0BCA <= code && code <= 0x0BCC) || // Mc   [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU\r\n\t\t(0x0C01 <= code && code <= 0x0C03) || // Mc   [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA\r\n\t\t(0x0C41 <= code && code <= 0x0C44) || // Mc   [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR\r\n\t\t(0x0C82 <= code && code <= 0x0C83) || // Mc   [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA\r\n\t\t0x0CBE == code || // Mc       KANNADA VOWEL SIGN AA\r\n\t\t(0x0CC0 <= code && code <= 0x0CC1) || // Mc   [2] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN U\r\n\t\t(0x0CC3 <= code && code <= 0x0CC4) || // Mc   [2] KANNADA VOWEL SIGN VOCALIC R..KANNADA VOWEL SIGN VOCALIC RR\r\n\t\t(0x0CC7 <= code && code <= 0x0CC8) || // Mc   [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI\r\n\t\t(0x0CCA <= code && code <= 0x0CCB) || // Mc   [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO\r\n\t\t(0x0D02 <= code && code <= 0x0D03) || // Mc   [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA\r\n\t\t(0x0D3F <= code && code <= 0x0D40) || // Mc   [2] MALAYALAM VOWEL SIGN I..MALAYALAM VOWEL SIGN II\r\n\t\t(0x0D46 <= code && code <= 0x0D48) || // Mc   [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI\r\n\t\t(0x0D4A <= code && code <= 0x0D4C) || // Mc   [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU\r\n\t\t(0x0D82 <= code && code <= 0x0D83) || // Mc   [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA\r\n\t\t(0x0DD0 <= code && code <= 0x0DD1) || // Mc   [2] SINHALA VOWEL SIGN KETTI AEDA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA\r\n\t\t(0x0DD8 <= code && code <= 0x0DDE) || // Mc   [7] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA\r\n\t\t(0x0DF2 <= code && code <= 0x0DF3) || // Mc   [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA\r\n\t\t0x0E33 == code || // Lo       THAI CHARACTER SARA AM\r\n\t\t0x0EB3 == code || // Lo       LAO VOWEL SIGN AM\r\n\t\t(0x0F3E <= code && code <= 0x0F3F) || // Mc   [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES\r\n\t\t0x0F7F == code || // Mc       TIBETAN SIGN RNAM BCAD\r\n\t\t0x1031 == code || // Mc       MYANMAR VOWEL SIGN E\r\n\t\t(0x103B <= code && code <= 0x103C) || // Mc   [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA\r\n\t\t(0x1056 <= code && code <= 0x1057) || // Mc   [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR\r\n\t\t0x1084 == code || // Mc       MYANMAR VOWEL SIGN SHAN E\r\n\t\t0x17B6 == code || // Mc       KHMER VOWEL SIGN AA\r\n\t\t(0x17BE <= code && code <= 0x17C5) || // Mc   [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU\r\n\t\t(0x17C7 <= code && code <= 0x17C8) || // Mc   [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU\r\n\t\t(0x1923 <= code && code <= 0x1926) || // Mc   [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU\r\n\t\t(0x1929 <= code && code <= 0x192B) || // Mc   [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA\r\n\t\t(0x1930 <= code && code <= 0x1931) || // Mc   [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA\r\n\t\t(0x1933 <= code && code <= 0x1938) || // Mc   [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA\r\n\t\t(0x1A19 <= code && code <= 0x1A1A) || // Mc   [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O\r\n\t\t0x1A55 == code || // Mc       TAI THAM CONSONANT SIGN MEDIAL RA\r\n\t\t0x1A57 == code || // Mc       TAI THAM CONSONANT SIGN LA TANG LAI\r\n\t\t(0x1A6D <= code && code <= 0x1A72) || // Mc   [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI\r\n\t\t0x1B04 == code || // Mc       BALINESE SIGN BISAH\r\n\t\t0x1B35 == code || // Mc       BALINESE VOWEL SIGN TEDUNG\r\n\t\t0x1B3B == code || // Mc       BALINESE VOWEL SIGN RA REPA TEDUNG\r\n\t\t(0x1B3D <= code && code <= 0x1B41) || // Mc   [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG\r\n\t\t(0x1B43 <= code && code <= 0x1B44) || // Mc   [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG\r\n\t\t0x1B82 == code || // Mc       SUNDANESE SIGN PANGWISAD\r\n\t\t0x1BA1 == code || // Mc       SUNDANESE CONSONANT SIGN PAMINGKAL\r\n\t\t(0x1BA6 <= code && code <= 0x1BA7) || // Mc   [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG\r\n\t\t0x1BAA == code || // Mc       SUNDANESE SIGN PAMAAEH\r\n\t\t0x1BE7 == code || // Mc       BATAK VOWEL SIGN E\r\n\t\t(0x1BEA <= code && code <= 0x1BEC) || // Mc   [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O\r\n\t\t0x1BEE == code || // Mc       BATAK VOWEL SIGN U\r\n\t\t(0x1BF2 <= code && code <= 0x1BF3) || // Mc   [2] BATAK PANGOLAT..BATAK PANONGONAN\r\n\t\t(0x1C24 <= code && code <= 0x1C2B) || // Mc   [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU\r\n\t\t(0x1C34 <= code && code <= 0x1C35) || // Mc   [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG\r\n\t\t0x1CE1 == code || // Mc       VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA\r\n\t\t(0x1CF2 <= code && code <= 0x1CF3) || // Mc   [2] VEDIC SIGN ARDHAVISARGA..VEDIC SIGN ROTATED ARDHAVISARGA\r\n\t\t0x1CF7 == code || // Mc       VEDIC SIGN ATIKRAMA\r\n\t\t(0xA823 <= code && code <= 0xA824) || // Mc   [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I\r\n\t\t0xA827 == code || // Mc       SYLOTI NAGRI VOWEL SIGN OO\r\n\t\t(0xA880 <= code && code <= 0xA881) || // Mc   [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA\r\n\t\t(0xA8B4 <= code && code <= 0xA8C3) || // Mc  [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU\r\n\t\t(0xA952 <= code && code <= 0xA953) || // Mc   [2] REJANG CONSONANT SIGN H..REJANG VIRAMA\r\n\t\t0xA983 == code || // Mc       JAVANESE SIGN WIGNYAN\r\n\t\t(0xA9B4 <= code && code <= 0xA9B5) || // Mc   [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG\r\n\t\t(0xA9BA <= code && code <= 0xA9BB) || // Mc   [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE\r\n\t\t(0xA9BD <= code && code <= 0xA9C0) || // Mc   [4] JAVANESE CONSONANT SIGN KERET..JAVANESE PANGKON\r\n\t\t(0xAA2F <= code && code <= 0xAA30) || // Mc   [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI\r\n\t\t(0xAA33 <= code && code <= 0xAA34) || // Mc   [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA\r\n\t\t0xAA4D == code || // Mc       CHAM CONSONANT SIGN FINAL H\r\n\t\t0xAAEB == code || // Mc       MEETEI MAYEK VOWEL SIGN II\r\n\t\t(0xAAEE <= code && code <= 0xAAEF) || // Mc   [2] MEETEI MAYEK VOWEL SIGN AU..MEETEI MAYEK VOWEL SIGN AAU\r\n\t\t0xAAF5 == code || // Mc       MEETEI MAYEK VOWEL SIGN VISARGA\r\n\t\t(0xABE3 <= code && code <= 0xABE4) || // Mc   [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP\r\n\t\t(0xABE6 <= code && code <= 0xABE7) || // Mc   [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP\r\n\t\t(0xABE9 <= code && code <= 0xABEA) || // Mc   [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG\r\n\t\t0xABEC == code || // Mc       MEETEI MAYEK LUM IYEK\r\n\t\t0x11000 == code || // Mc       BRAHMI SIGN CANDRABINDU\r\n\t\t0x11002 == code || // Mc       BRAHMI SIGN VISARGA\r\n\t\t0x11082 == code || // Mc       KAITHI SIGN VISARGA\r\n\t\t(0x110B0 <= code && code <= 0x110B2) || // Mc   [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II\r\n\t\t(0x110B7 <= code && code <= 0x110B8) || // Mc   [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU\r\n\t\t0x1112C == code || // Mc       CHAKMA VOWEL SIGN E\r\n\t\t0x11182 == code || // Mc       SHARADA SIGN VISARGA\r\n\t\t(0x111B3 <= code && code <= 0x111B5) || // Mc   [3] SHARADA VOWEL SIGN AA..SHARADA VOWEL SIGN II\r\n\t\t(0x111BF <= code && code <= 0x111C0) || // Mc   [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA\r\n\t\t(0x1122C <= code && code <= 0x1122E) || // Mc   [3] KHOJKI VOWEL SIGN AA..KHOJKI VOWEL SIGN II\r\n\t\t(0x11232 <= code && code <= 0x11233) || // Mc   [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU\r\n\t\t0x11235 == code || // Mc       KHOJKI SIGN VIRAMA\r\n\t\t(0x112E0 <= code && code <= 0x112E2) || // Mc   [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II\r\n\t\t(0x11302 <= code && code <= 0x11303) || // Mc   [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA\r\n\t\t0x1133F == code || // Mc       GRANTHA VOWEL SIGN I\r\n\t\t(0x11341 <= code && code <= 0x11344) || // Mc   [4] GRANTHA VOWEL SIGN U..GRANTHA VOWEL SIGN VOCALIC RR\r\n\t\t(0x11347 <= code && code <= 0x11348) || // Mc   [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI\r\n\t\t(0x1134B <= code && code <= 0x1134D) || // Mc   [3] GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA\r\n\t\t(0x11362 <= code && code <= 0x11363) || // Mc   [2] GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL\r\n\t\t(0x11435 <= code && code <= 0x11437) || // Mc   [3] NEWA VOWEL SIGN AA..NEWA VOWEL SIGN II\r\n\t\t(0x11440 <= code && code <= 0x11441) || // Mc   [2] NEWA VOWEL SIGN O..NEWA VOWEL SIGN AU\r\n\t\t0x11445 == code || // Mc       NEWA SIGN VISARGA\r\n\t\t(0x114B1 <= code && code <= 0x114B2) || // Mc   [2] TIRHUTA VOWEL SIGN I..TIRHUTA VOWEL SIGN II\r\n\t\t0x114B9 == code || // Mc       TIRHUTA VOWEL SIGN E\r\n\t\t(0x114BB <= code && code <= 0x114BC) || // Mc   [2] TIRHUTA VOWEL SIGN AI..TIRHUTA VOWEL SIGN O\r\n\t\t0x114BE == code || // Mc       TIRHUTA VOWEL SIGN AU\r\n\t\t0x114C1 == code || // Mc       TIRHUTA SIGN VISARGA\r\n\t\t(0x115B0 <= code && code <= 0x115B1) || // Mc   [2] SIDDHAM VOWEL SIGN I..SIDDHAM VOWEL SIGN II\r\n\t\t(0x115B8 <= code && code <= 0x115BB) || // Mc   [4] SIDDHAM VOWEL SIGN E..SIDDHAM VOWEL SIGN AU\r\n\t\t0x115BE == code || // Mc       SIDDHAM SIGN VISARGA\r\n\t\t(0x11630 <= code && code <= 0x11632) || // Mc   [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II\r\n\t\t(0x1163B <= code && code <= 0x1163C) || // Mc   [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU\r\n\t\t0x1163E == code || // Mc       MODI SIGN VISARGA\r\n\t\t0x116AC == code || // Mc       TAKRI SIGN VISARGA\r\n\t\t(0x116AE <= code && code <= 0x116AF) || // Mc   [2] TAKRI VOWEL SIGN I..TAKRI VOWEL SIGN II\r\n\t\t0x116B6 == code || // Mc       TAKRI SIGN VIRAMA\r\n\t\t(0x11720 <= code && code <= 0x11721) || // Mc   [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA\r\n\t\t0x11726 == code || // Mc       AHOM VOWEL SIGN E\r\n\t\t(0x11A07 <= code && code <= 0x11A08) || // Mc   [2] ZANABAZAR SQUARE VOWEL SIGN AI..ZANABAZAR SQUARE VOWEL SIGN AU\r\n\t\t0x11A39 == code || // Mc       ZANABAZAR SQUARE SIGN VISARGA\r\n\t\t(0x11A57 <= code && code <= 0x11A58) || // Mc   [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU\r\n\t\t0x11A97 == code || // Mc       SOYOMBO SIGN VISARGA\r\n\t\t0x11C2F == code || // Mc       BHAIKSUKI VOWEL SIGN AA\r\n\t\t0x11C3E == code || // Mc       BHAIKSUKI SIGN VISARGA\r\n\t\t0x11CA9 == code || // Mc       MARCHEN SUBJOINED LETTER YA\r\n\t\t0x11CB1 == code || // Mc       MARCHEN VOWEL SIGN I\r\n\t\t0x11CB4 == code || // Mc       MARCHEN VOWEL SIGN O\r\n\t\t(0x16F51 <= code && code <= 0x16F7E) || // Mc  [46] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN NG\r\n\t\t0x1D166 == code || // Mc       MUSICAL SYMBOL COMBINING SPRECHGESANG STEM\r\n\t\t0x1D16D == code // Mc       MUSICAL SYMBOL COMBINING AUGMENTATION DOT\r\n\t\t){\r\n\t\t\treturn SpacingMark;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(\r\n\t\t(0x1100 <= code && code <= 0x115F) || // Lo  [96] HANGUL CHOSEONG KIYEOK..HANGUL CHOSEONG FILLER\r\n\t\t(0xA960 <= code && code <= 0xA97C) // Lo  [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH\r\n\t\t){\r\n\t\t\treturn L;\r\n\t\t}\r\n\t\t\r\n\t\tif(\r\n\t\t(0x1160 <= code && code <= 0x11A7) || // Lo  [72] HANGUL JUNGSEONG FILLER..HANGUL JUNGSEONG O-YAE\r\n\t\t(0xD7B0 <= code && code <= 0xD7C6) // Lo  [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E\r\n\t\t){\r\n\t\t\treturn V;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(\r\n\t\t(0x11A8 <= code && code <= 0x11FF) || // Lo  [88] HANGUL JONGSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN\r\n\t\t(0xD7CB <= code && code <= 0xD7FB) // Lo  [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH\r\n\t\t){\r\n\t\t\treturn T;\r\n\t\t}\r\n\t\t\r\n\t\tif(\r\n\t\t0xAC00 == code || // Lo       HANGUL SYLLABLE GA\r\n\t\t0xAC1C == code || // Lo       HANGUL SYLLABLE GAE\r\n\t\t0xAC38 == code || // Lo       HANGUL SYLLABLE GYA\r\n\t\t0xAC54 == code || // Lo       HANGUL SYLLABLE GYAE\r\n\t\t0xAC70 == code || // Lo       HANGUL SYLLABLE GEO\r\n\t\t0xAC8C == code || // Lo       HANGUL SYLLABLE GE\r\n\t\t0xACA8 == code || // Lo       HANGUL SYLLABLE GYEO\r\n\t\t0xACC4 == code || // Lo       HANGUL SYLLABLE GYE\r\n\t\t0xACE0 == code || // Lo       HANGUL SYLLABLE GO\r\n\t\t0xACFC == code || // Lo       HANGUL SYLLABLE GWA\r\n\t\t0xAD18 == code || // Lo       HANGUL SYLLABLE GWAE\r\n\t\t0xAD34 == code || // Lo       HANGUL SYLLABLE GOE\r\n\t\t0xAD50 == code || // Lo       HANGUL SYLLABLE GYO\r\n\t\t0xAD6C == code || // Lo       HANGUL SYLLABLE GU\r\n\t\t0xAD88 == code || // Lo       HANGUL SYLLABLE GWEO\r\n\t\t0xADA4 == code || // Lo       HANGUL SYLLABLE GWE\r\n\t\t0xADC0 == code || // Lo       HANGUL SYLLABLE GWI\r\n\t\t0xADDC == code || // Lo       HANGUL SYLLABLE GYU\r\n\t\t0xADF8 == code || // Lo       HANGUL SYLLABLE GEU\r\n\t\t0xAE14 == code || // Lo       HANGUL SYLLABLE GYI\r\n\t\t0xAE30 == code || // Lo       HANGUL SYLLABLE GI\r\n\t\t0xAE4C == code || // Lo       HANGUL SYLLABLE GGA\r\n\t\t0xAE68 == code || // Lo       HANGUL SYLLABLE GGAE\r\n\t\t0xAE84 == code || // Lo       HANGUL SYLLABLE GGYA\r\n\t\t0xAEA0 == code || // Lo       HANGUL SYLLABLE GGYAE\r\n\t\t0xAEBC == code || // Lo       HANGUL SYLLABLE GGEO\r\n\t\t0xAED8 == code || // Lo       HANGUL SYLLABLE GGE\r\n\t\t0xAEF4 == code || // Lo       HANGUL SYLLABLE GGYEO\r\n\t\t0xAF10 == code || // Lo       HANGUL SYLLABLE GGYE\r\n\t\t0xAF2C == code || // Lo       HANGUL SYLLABLE GGO\r\n\t\t0xAF48 == code || // Lo       HANGUL SYLLABLE GGWA\r\n\t\t0xAF64 == code || // Lo       HANGUL SYLLABLE GGWAE\r\n\t\t0xAF80 == code || // Lo       HANGUL SYLLABLE GGOE\r\n\t\t0xAF9C == code || // Lo       HANGUL SYLLABLE GGYO\r\n\t\t0xAFB8 == code || // Lo       HANGUL SYLLABLE GGU\r\n\t\t0xAFD4 == code || // Lo       HANGUL SYLLABLE GGWEO\r\n\t\t0xAFF0 == code || // Lo       HANGUL SYLLABLE GGWE\r\n\t\t0xB00C == code || // Lo       HANGUL SYLLABLE GGWI\r\n\t\t0xB028 == code || // Lo       HANGUL SYLLABLE GGYU\r\n\t\t0xB044 == code || // Lo       HANGUL SYLLABLE GGEU\r\n\t\t0xB060 == code || // Lo       HANGUL SYLLABLE GGYI\r\n\t\t0xB07C == code || // Lo       HANGUL SYLLABLE GGI\r\n\t\t0xB098 == code || // Lo       HANGUL SYLLABLE NA\r\n\t\t0xB0B4 == code || // Lo       HANGUL SYLLABLE NAE\r\n\t\t0xB0D0 == code || // Lo       HANGUL SYLLABLE NYA\r\n\t\t0xB0EC == code || // Lo       HANGUL SYLLABLE NYAE\r\n\t\t0xB108 == code || // Lo       HANGUL SYLLABLE NEO\r\n\t\t0xB124 == code || // Lo       HANGUL SYLLABLE NE\r\n\t\t0xB140 == code || // Lo       HANGUL SYLLABLE NYEO\r\n\t\t0xB15C == code || // Lo       HANGUL SYLLABLE NYE\r\n\t\t0xB178 == code || // Lo       HANGUL SYLLABLE NO\r\n\t\t0xB194 == code || // Lo       HANGUL SYLLABLE NWA\r\n\t\t0xB1B0 == code || // Lo       HANGUL SYLLABLE NWAE\r\n\t\t0xB1CC == code || // Lo       HANGUL SYLLABLE NOE\r\n\t\t0xB1E8 == code || // Lo       HANGUL SYLLABLE NYO\r\n\t\t0xB204 == code || // Lo       HANGUL SYLLABLE NU\r\n\t\t0xB220 == code || // Lo       HANGUL SYLLABLE NWEO\r\n\t\t0xB23C == code || // Lo       HANGUL SYLLABLE NWE\r\n\t\t0xB258 == code || // Lo       HANGUL SYLLABLE NWI\r\n\t\t0xB274 == code || // Lo       HANGUL SYLLABLE NYU\r\n\t\t0xB290 == code || // Lo       HANGUL SYLLABLE NEU\r\n\t\t0xB2AC == code || // Lo       HANGUL SYLLABLE NYI\r\n\t\t0xB2C8 == code || // Lo       HANGUL SYLLABLE NI\r\n\t\t0xB2E4 == code || // Lo       HANGUL SYLLABLE DA\r\n\t\t0xB300 == code || // Lo       HANGUL SYLLABLE DAE\r\n\t\t0xB31C == code || // Lo       HANGUL SYLLABLE DYA\r\n\t\t0xB338 == code || // Lo       HANGUL SYLLABLE DYAE\r\n\t\t0xB354 == code || // Lo       HANGUL SYLLABLE DEO\r\n\t\t0xB370 == code || // Lo       HANGUL SYLLABLE DE\r\n\t\t0xB38C == code || // Lo       HANGUL SYLLABLE DYEO\r\n\t\t0xB3A8 == code || // Lo       HANGUL SYLLABLE DYE\r\n\t\t0xB3C4 == code || // Lo       HANGUL SYLLABLE DO\r\n\t\t0xB3E0 == code || // Lo       HANGUL SYLLABLE DWA\r\n\t\t0xB3FC == code || // Lo       HANGUL SYLLABLE DWAE\r\n\t\t0xB418 == code || // Lo       HANGUL SYLLABLE DOE\r\n\t\t0xB434 == code || // Lo       HANGUL SYLLABLE DYO\r\n\t\t0xB450 == code || // Lo       HANGUL SYLLABLE DU\r\n\t\t0xB46C == code || // Lo       HANGUL SYLLABLE DWEO\r\n\t\t0xB488 == code || // Lo       HANGUL SYLLABLE DWE\r\n\t\t0xB4A4 == code || // Lo       HANGUL SYLLABLE DWI\r\n\t\t0xB4C0 == code || // Lo       HANGUL SYLLABLE DYU\r\n\t\t0xB4DC == code || // Lo       HANGUL SYLLABLE DEU\r\n\t\t0xB4F8 == code || // Lo       HANGUL SYLLABLE DYI\r\n\t\t0xB514 == code || // Lo       HANGUL SYLLABLE DI\r\n\t\t0xB530 == code || // Lo       HANGUL SYLLABLE DDA\r\n\t\t0xB54C == code || // Lo       HANGUL SYLLABLE DDAE\r\n\t\t0xB568 == code || // Lo       HANGUL SYLLABLE DDYA\r\n\t\t0xB584 == code || // Lo       HANGUL SYLLABLE DDYAE\r\n\t\t0xB5A0 == code || // Lo       HANGUL SYLLABLE DDEO\r\n\t\t0xB5BC == code || // Lo       HANGUL SYLLABLE DDE\r\n\t\t0xB5D8 == code || // Lo       HANGUL SYLLABLE DDYEO\r\n\t\t0xB5F4 == code || // Lo       HANGUL SYLLABLE DDYE\r\n\t\t0xB610 == code || // Lo       HANGUL SYLLABLE DDO\r\n\t\t0xB62C == code || // Lo       HANGUL SYLLABLE DDWA\r\n\t\t0xB648 == code || // Lo       HANGUL SYLLABLE DDWAE\r\n\t\t0xB664 == code || // Lo       HANGUL SYLLABLE DDOE\r\n\t\t0xB680 == code || // Lo       HANGUL SYLLABLE DDYO\r\n\t\t0xB69C == code || // Lo       HANGUL SYLLABLE DDU\r\n\t\t0xB6B8 == code || // Lo       HANGUL SYLLABLE DDWEO\r\n\t\t0xB6D4 == code || // Lo       HANGUL SYLLABLE DDWE\r\n\t\t0xB6F0 == code || // Lo       HANGUL SYLLABLE DDWI\r\n\t\t0xB70C == code || // Lo       HANGUL SYLLABLE DDYU\r\n\t\t0xB728 == code || // Lo       HANGUL SYLLABLE DDEU\r\n\t\t0xB744 == code || // Lo       HANGUL SYLLABLE DDYI\r\n\t\t0xB760 == code || // Lo       HANGUL SYLLABLE DDI\r\n\t\t0xB77C == code || // Lo       HANGUL SYLLABLE RA\r\n\t\t0xB798 == code || // Lo       HANGUL SYLLABLE RAE\r\n\t\t0xB7B4 == code || // Lo       HANGUL SYLLABLE RYA\r\n\t\t0xB7D0 == code || // Lo       HANGUL SYLLABLE RYAE\r\n\t\t0xB7EC == code || // Lo       HANGUL SYLLABLE REO\r\n\t\t0xB808 == code || // Lo       HANGUL SYLLABLE RE\r\n\t\t0xB824 == code || // Lo       HANGUL SYLLABLE RYEO\r\n\t\t0xB840 == code || // Lo       HANGUL SYLLABLE RYE\r\n\t\t0xB85C == code || // Lo       HANGUL SYLLABLE RO\r\n\t\t0xB878 == code || // Lo       HANGUL SYLLABLE RWA\r\n\t\t0xB894 == code || // Lo       HANGUL SYLLABLE RWAE\r\n\t\t0xB8B0 == code || // Lo       HANGUL SYLLABLE ROE\r\n\t\t0xB8CC == code || // Lo       HANGUL SYLLABLE RYO\r\n\t\t0xB8E8 == code || // Lo       HANGUL SYLLABLE RU\r\n\t\t0xB904 == code || // Lo       HANGUL SYLLABLE RWEO\r\n\t\t0xB920 == code || // Lo       HANGUL SYLLABLE RWE\r\n\t\t0xB93C == code || // Lo       HANGUL SYLLABLE RWI\r\n\t\t0xB958 == code || // Lo       HANGUL SYLLABLE RYU\r\n\t\t0xB974 == code || // Lo       HANGUL SYLLABLE REU\r\n\t\t0xB990 == code || // Lo       HANGUL SYLLABLE RYI\r\n\t\t0xB9AC == code || // Lo       HANGUL SYLLABLE RI\r\n\t\t0xB9C8 == code || // Lo       HANGUL SYLLABLE MA\r\n\t\t0xB9E4 == code || // Lo       HANGUL SYLLABLE MAE\r\n\t\t0xBA00 == code || // Lo       HANGUL SYLLABLE MYA\r\n\t\t0xBA1C == code || // Lo       HANGUL SYLLABLE MYAE\r\n\t\t0xBA38 == code || // Lo       HANGUL SYLLABLE MEO\r\n\t\t0xBA54 == code || // Lo       HANGUL SYLLABLE ME\r\n\t\t0xBA70 == code || // Lo       HANGUL SYLLABLE MYEO\r\n\t\t0xBA8C == code || // Lo       HANGUL SYLLABLE MYE\r\n\t\t0xBAA8 == code || // Lo       HANGUL SYLLABLE MO\r\n\t\t0xBAC4 == code || // Lo       HANGUL SYLLABLE MWA\r\n\t\t0xBAE0 == code || // Lo       HANGUL SYLLABLE MWAE\r\n\t\t0xBAFC == code || // Lo       HANGUL SYLLABLE MOE\r\n\t\t0xBB18 == code || // Lo       HANGUL SYLLABLE MYO\r\n\t\t0xBB34 == code || // Lo       HANGUL SYLLABLE MU\r\n\t\t0xBB50 == code || // Lo       HANGUL SYLLABLE MWEO\r\n\t\t0xBB6C == code || // Lo       HANGUL SYLLABLE MWE\r\n\t\t0xBB88 == code || // Lo       HANGUL SYLLABLE MWI\r\n\t\t0xBBA4 == code || // Lo       HANGUL SYLLABLE MYU\r\n\t\t0xBBC0 == code || // Lo       HANGUL SYLLABLE MEU\r\n\t\t0xBBDC == code || // Lo       HANGUL SYLLABLE MYI\r\n\t\t0xBBF8 == code || // Lo       HANGUL SYLLABLE MI\r\n\t\t0xBC14 == code || // Lo       HANGUL SYLLABLE BA\r\n\t\t0xBC30 == code || // Lo       HANGUL SYLLABLE BAE\r\n\t\t0xBC4C == code || // Lo       HANGUL SYLLABLE BYA\r\n\t\t0xBC68 == code || // Lo       HANGUL SYLLABLE BYAE\r\n\t\t0xBC84 == code || // Lo       HANGUL SYLLABLE BEO\r\n\t\t0xBCA0 == code || // Lo       HANGUL SYLLABLE BE\r\n\t\t0xBCBC == code || // Lo       HANGUL SYLLABLE BYEO\r\n\t\t0xBCD8 == code || // Lo       HANGUL SYLLABLE BYE\r\n\t\t0xBCF4 == code || // Lo       HANGUL SYLLABLE BO\r\n\t\t0xBD10 == code || // Lo       HANGUL SYLLABLE BWA\r\n\t\t0xBD2C == code || // Lo       HANGUL SYLLABLE BWAE\r\n\t\t0xBD48 == code || // Lo       HANGUL SYLLABLE BOE\r\n\t\t0xBD64 == code || // Lo       HANGUL SYLLABLE BYO\r\n\t\t0xBD80 == code || // Lo       HANGUL SYLLABLE BU\r\n\t\t0xBD9C == code || // Lo       HANGUL SYLLABLE BWEO\r\n\t\t0xBDB8 == code || // Lo       HANGUL SYLLABLE BWE\r\n\t\t0xBDD4 == code || // Lo       HANGUL SYLLABLE BWI\r\n\t\t0xBDF0 == code || // Lo       HANGUL SYLLABLE BYU\r\n\t\t0xBE0C == code || // Lo       HANGUL SYLLABLE BEU\r\n\t\t0xBE28 == code || // Lo       HANGUL SYLLABLE BYI\r\n\t\t0xBE44 == code || // Lo       HANGUL SYLLABLE BI\r\n\t\t0xBE60 == code || // Lo       HANGUL SYLLABLE BBA\r\n\t\t0xBE7C == code || // Lo       HANGUL SYLLABLE BBAE\r\n\t\t0xBE98 == code || // Lo       HANGUL SYLLABLE BBYA\r\n\t\t0xBEB4 == code || // Lo       HANGUL SYLLABLE BBYAE\r\n\t\t0xBED0 == code || // Lo       HANGUL SYLLABLE BBEO\r\n\t\t0xBEEC == code || // Lo       HANGUL SYLLABLE BBE\r\n\t\t0xBF08 == code || // Lo       HANGUL SYLLABLE BBYEO\r\n\t\t0xBF24 == code || // Lo       HANGUL SYLLABLE BBYE\r\n\t\t0xBF40 == code || // Lo       HANGUL SYLLABLE BBO\r\n\t\t0xBF5C == code || // Lo       HANGUL SYLLABLE BBWA\r\n\t\t0xBF78 == code || // Lo       HANGUL SYLLABLE BBWAE\r\n\t\t0xBF94 == code || // Lo       HANGUL SYLLABLE BBOE\r\n\t\t0xBFB0 == code || // Lo       HANGUL SYLLABLE BBYO\r\n\t\t0xBFCC == code || // Lo       HANGUL SYLLABLE BBU\r\n\t\t0xBFE8 == code || // Lo       HANGUL SYLLABLE BBWEO\r\n\t\t0xC004 == code || // Lo       HANGUL SYLLABLE BBWE\r\n\t\t0xC020 == code || // Lo       HANGUL SYLLABLE BBWI\r\n\t\t0xC03C == code || // Lo       HANGUL SYLLABLE BBYU\r\n\t\t0xC058 == code || // Lo       HANGUL SYLLABLE BBEU\r\n\t\t0xC074 == code || // Lo       HANGUL SYLLABLE BBYI\r\n\t\t0xC090 == code || // Lo       HANGUL SYLLABLE BBI\r\n\t\t0xC0AC == code || // Lo       HANGUL SYLLABLE SA\r\n\t\t0xC0C8 == code || // Lo       HANGUL SYLLABLE SAE\r\n\t\t0xC0E4 == code || // Lo       HANGUL SYLLABLE SYA\r\n\t\t0xC100 == code || // Lo       HANGUL SYLLABLE SYAE\r\n\t\t0xC11C == code || // Lo       HANGUL SYLLABLE SEO\r\n\t\t0xC138 == code || // Lo       HANGUL SYLLABLE SE\r\n\t\t0xC154 == code || // Lo       HANGUL SYLLABLE SYEO\r\n\t\t0xC170 == code || // Lo       HANGUL SYLLABLE SYE\r\n\t\t0xC18C == code || // Lo       HANGUL SYLLABLE SO\r\n\t\t0xC1A8 == code || // Lo       HANGUL SYLLABLE SWA\r\n\t\t0xC1C4 == code || // Lo       HANGUL SYLLABLE SWAE\r\n\t\t0xC1E0 == code || // Lo       HANGUL SYLLABLE SOE\r\n\t\t0xC1FC == code || // Lo       HANGUL SYLLABLE SYO\r\n\t\t0xC218 == code || // Lo       HANGUL SYLLABLE SU\r\n\t\t0xC234 == code || // Lo       HANGUL SYLLABLE SWEO\r\n\t\t0xC250 == code || // Lo       HANGUL SYLLABLE SWE\r\n\t\t0xC26C == code || // Lo       HANGUL SYLLABLE SWI\r\n\t\t0xC288 == code || // Lo       HANGUL SYLLABLE SYU\r\n\t\t0xC2A4 == code || // Lo       HANGUL SYLLABLE SEU\r\n\t\t0xC2C0 == code || // Lo       HANGUL SYLLABLE SYI\r\n\t\t0xC2DC == code || // Lo       HANGUL SYLLABLE SI\r\n\t\t0xC2F8 == code || // Lo       HANGUL SYLLABLE SSA\r\n\t\t0xC314 == code || // Lo       HANGUL SYLLABLE SSAE\r\n\t\t0xC330 == code || // Lo       HANGUL SYLLABLE SSYA\r\n\t\t0xC34C == code || // Lo       HANGUL SYLLABLE SSYAE\r\n\t\t0xC368 == code || // Lo       HANGUL SYLLABLE SSEO\r\n\t\t0xC384 == code || // Lo       HANGUL SYLLABLE SSE\r\n\t\t0xC3A0 == code || // Lo       HANGUL SYLLABLE SSYEO\r\n\t\t0xC3BC == code || // Lo       HANGUL SYLLABLE SSYE\r\n\t\t0xC3D8 == code || // Lo       HANGUL SYLLABLE SSO\r\n\t\t0xC3F4 == code || // Lo       HANGUL SYLLABLE SSWA\r\n\t\t0xC410 == code || // Lo       HANGUL SYLLABLE SSWAE\r\n\t\t0xC42C == code || // Lo       HANGUL SYLLABLE SSOE\r\n\t\t0xC448 == code || // Lo       HANGUL SYLLABLE SSYO\r\n\t\t0xC464 == code || // Lo       HANGUL SYLLABLE SSU\r\n\t\t0xC480 == code || // Lo       HANGUL SYLLABLE SSWEO\r\n\t\t0xC49C == code || // Lo       HANGUL SYLLABLE SSWE\r\n\t\t0xC4B8 == code || // Lo       HANGUL SYLLABLE SSWI\r\n\t\t0xC4D4 == code || // Lo       HANGUL SYLLABLE SSYU\r\n\t\t0xC4F0 == code || // Lo       HANGUL SYLLABLE SSEU\r\n\t\t0xC50C == code || // Lo       HANGUL SYLLABLE SSYI\r\n\t\t0xC528 == code || // Lo       HANGUL SYLLABLE SSI\r\n\t\t0xC544 == code || // Lo       HANGUL SYLLABLE A\r\n\t\t0xC560 == code || // Lo       HANGUL SYLLABLE AE\r\n\t\t0xC57C == code || // Lo       HANGUL SYLLABLE YA\r\n\t\t0xC598 == code || // Lo       HANGUL SYLLABLE YAE\r\n\t\t0xC5B4 == code || // Lo       HANGUL SYLLABLE EO\r\n\t\t0xC5D0 == code || // Lo       HANGUL SYLLABLE E\r\n\t\t0xC5EC == code || // Lo       HANGUL SYLLABLE YEO\r\n\t\t0xC608 == code || // Lo       HANGUL SYLLABLE YE\r\n\t\t0xC624 == code || // Lo       HANGUL SYLLABLE O\r\n\t\t0xC640 == code || // Lo       HANGUL SYLLABLE WA\r\n\t\t0xC65C == code || // Lo       HANGUL SYLLABLE WAE\r\n\t\t0xC678 == code || // Lo       HANGUL SYLLABLE OE\r\n\t\t0xC694 == code || // Lo       HANGUL SYLLABLE YO\r\n\t\t0xC6B0 == code || // Lo       HANGUL SYLLABLE U\r\n\t\t0xC6CC == code || // Lo       HANGUL SYLLABLE WEO\r\n\t\t0xC6E8 == code || // Lo       HANGUL SYLLABLE WE\r\n\t\t0xC704 == code || // Lo       HANGUL SYLLABLE WI\r\n\t\t0xC720 == code || // Lo       HANGUL SYLLABLE YU\r\n\t\t0xC73C == code || // Lo       HANGUL SYLLABLE EU\r\n\t\t0xC758 == code || // Lo       HANGUL SYLLABLE YI\r\n\t\t0xC774 == code || // Lo       HANGUL SYLLABLE I\r\n\t\t0xC790 == code || // Lo       HANGUL SYLLABLE JA\r\n\t\t0xC7AC == code || // Lo       HANGUL SYLLABLE JAE\r\n\t\t0xC7C8 == code || // Lo       HANGUL SYLLABLE JYA\r\n\t\t0xC7E4 == code || // Lo       HANGUL SYLLABLE JYAE\r\n\t\t0xC800 == code || // Lo       HANGUL SYLLABLE JEO\r\n\t\t0xC81C == code || // Lo       HANGUL SYLLABLE JE\r\n\t\t0xC838 == code || // Lo       HANGUL SYLLABLE JYEO\r\n\t\t0xC854 == code || // Lo       HANGUL SYLLABLE JYE\r\n\t\t0xC870 == code || // Lo       HANGUL SYLLABLE JO\r\n\t\t0xC88C == code || // Lo       HANGUL SYLLABLE JWA\r\n\t\t0xC8A8 == code || // Lo       HANGUL SYLLABLE JWAE\r\n\t\t0xC8C4 == code || // Lo       HANGUL SYLLABLE JOE\r\n\t\t0xC8E0 == code || // Lo       HANGUL SYLLABLE JYO\r\n\t\t0xC8FC == code || // Lo       HANGUL SYLLABLE JU\r\n\t\t0xC918 == code || // Lo       HANGUL SYLLABLE JWEO\r\n\t\t0xC934 == code || // Lo       HANGUL SYLLABLE JWE\r\n\t\t0xC950 == code || // Lo       HANGUL SYLLABLE JWI\r\n\t\t0xC96C == code || // Lo       HANGUL SYLLABLE JYU\r\n\t\t0xC988 == code || // Lo       HANGUL SYLLABLE JEU\r\n\t\t0xC9A4 == code || // Lo       HANGUL SYLLABLE JYI\r\n\t\t0xC9C0 == code || // Lo       HANGUL SYLLABLE JI\r\n\t\t0xC9DC == code || // Lo       HANGUL SYLLABLE JJA\r\n\t\t0xC9F8 == code || // Lo       HANGUL SYLLABLE JJAE\r\n\t\t0xCA14 == code || // Lo       HANGUL SYLLABLE JJYA\r\n\t\t0xCA30 == code || // Lo       HANGUL SYLLABLE JJYAE\r\n\t\t0xCA4C == code || // Lo       HANGUL SYLLABLE JJEO\r\n\t\t0xCA68 == code || // Lo       HANGUL SYLLABLE JJE\r\n\t\t0xCA84 == code || // Lo       HANGUL SYLLABLE JJYEO\r\n\t\t0xCAA0 == code || // Lo       HANGUL SYLLABLE JJYE\r\n\t\t0xCABC == code || // Lo       HANGUL SYLLABLE JJO\r\n\t\t0xCAD8 == code || // Lo       HANGUL SYLLABLE JJWA\r\n\t\t0xCAF4 == code || // Lo       HANGUL SYLLABLE JJWAE\r\n\t\t0xCB10 == code || // Lo       HANGUL SYLLABLE JJOE\r\n\t\t0xCB2C == code || // Lo       HANGUL SYLLABLE JJYO\r\n\t\t0xCB48 == code || // Lo       HANGUL SYLLABLE JJU\r\n\t\t0xCB64 == code || // Lo       HANGUL SYLLABLE JJWEO\r\n\t\t0xCB80 == code || // Lo       HANGUL SYLLABLE JJWE\r\n\t\t0xCB9C == code || // Lo       HANGUL SYLLABLE JJWI\r\n\t\t0xCBB8 == code || // Lo       HANGUL SYLLABLE JJYU\r\n\t\t0xCBD4 == code || // Lo       HANGUL SYLLABLE JJEU\r\n\t\t0xCBF0 == code || // Lo       HANGUL SYLLABLE JJYI\r\n\t\t0xCC0C == code || // Lo       HANGUL SYLLABLE JJI\r\n\t\t0xCC28 == code || // Lo       HANGUL SYLLABLE CA\r\n\t\t0xCC44 == code || // Lo       HANGUL SYLLABLE CAE\r\n\t\t0xCC60 == code || // Lo       HANGUL SYLLABLE CYA\r\n\t\t0xCC7C == code || // Lo       HANGUL SYLLABLE CYAE\r\n\t\t0xCC98 == code || // Lo       HANGUL SYLLABLE CEO\r\n\t\t0xCCB4 == code || // Lo       HANGUL SYLLABLE CE\r\n\t\t0xCCD0 == code || // Lo       HANGUL SYLLABLE CYEO\r\n\t\t0xCCEC == code || // Lo       HANGUL SYLLABLE CYE\r\n\t\t0xCD08 == code || // Lo       HANGUL SYLLABLE CO\r\n\t\t0xCD24 == code || // Lo       HANGUL SYLLABLE CWA\r\n\t\t0xCD40 == code || // Lo       HANGUL SYLLABLE CWAE\r\n\t\t0xCD5C == code || // Lo       HANGUL SYLLABLE COE\r\n\t\t0xCD78 == code || // Lo       HANGUL SYLLABLE CYO\r\n\t\t0xCD94 == code || // Lo       HANGUL SYLLABLE CU\r\n\t\t0xCDB0 == code || // Lo       HANGUL SYLLABLE CWEO\r\n\t\t0xCDCC == code || // Lo       HANGUL SYLLABLE CWE\r\n\t\t0xCDE8 == code || // Lo       HANGUL SYLLABLE CWI\r\n\t\t0xCE04 == code || // Lo       HANGUL SYLLABLE CYU\r\n\t\t0xCE20 == code || // Lo       HANGUL SYLLABLE CEU\r\n\t\t0xCE3C == code || // Lo       HANGUL SYLLABLE CYI\r\n\t\t0xCE58 == code || // Lo       HANGUL SYLLABLE CI\r\n\t\t0xCE74 == code || // Lo       HANGUL SYLLABLE KA\r\n\t\t0xCE90 == code || // Lo       HANGUL SYLLABLE KAE\r\n\t\t0xCEAC == code || // Lo       HANGUL SYLLABLE KYA\r\n\t\t0xCEC8 == code || // Lo       HANGUL SYLLABLE KYAE\r\n\t\t0xCEE4 == code || // Lo       HANGUL SYLLABLE KEO\r\n\t\t0xCF00 == code || // Lo       HANGUL SYLLABLE KE\r\n\t\t0xCF1C == code || // Lo       HANGUL SYLLABLE KYEO\r\n\t\t0xCF38 == code || // Lo       HANGUL SYLLABLE KYE\r\n\t\t0xCF54 == code || // Lo       HANGUL SYLLABLE KO\r\n\t\t0xCF70 == code || // Lo       HANGUL SYLLABLE KWA\r\n\t\t0xCF8C == code || // Lo       HANGUL SYLLABLE KWAE\r\n\t\t0xCFA8 == code || // Lo       HANGUL SYLLABLE KOE\r\n\t\t0xCFC4 == code || // Lo       HANGUL SYLLABLE KYO\r\n\t\t0xCFE0 == code || // Lo       HANGUL SYLLABLE KU\r\n\t\t0xCFFC == code || // Lo       HANGUL SYLLABLE KWEO\r\n\t\t0xD018 == code || // Lo       HANGUL SYLLABLE KWE\r\n\t\t0xD034 == code || // Lo       HANGUL SYLLABLE KWI\r\n\t\t0xD050 == code || // Lo       HANGUL SYLLABLE KYU\r\n\t\t0xD06C == code || // Lo       HANGUL SYLLABLE KEU\r\n\t\t0xD088 == code || // Lo       HANGUL SYLLABLE KYI\r\n\t\t0xD0A4 == code || // Lo       HANGUL SYLLABLE KI\r\n\t\t0xD0C0 == code || // Lo       HANGUL SYLLABLE TA\r\n\t\t0xD0DC == code || // Lo       HANGUL SYLLABLE TAE\r\n\t\t0xD0F8 == code || // Lo       HANGUL SYLLABLE TYA\r\n\t\t0xD114 == code || // Lo       HANGUL SYLLABLE TYAE\r\n\t\t0xD130 == code || // Lo       HANGUL SYLLABLE TEO\r\n\t\t0xD14C == code || // Lo       HANGUL SYLLABLE TE\r\n\t\t0xD168 == code || // Lo       HANGUL SYLLABLE TYEO\r\n\t\t0xD184 == code || // Lo       HANGUL SYLLABLE TYE\r\n\t\t0xD1A0 == code || // Lo       HANGUL SYLLABLE TO\r\n\t\t0xD1BC == code || // Lo       HANGUL SYLLABLE TWA\r\n\t\t0xD1D8 == code || // Lo       HANGUL SYLLABLE TWAE\r\n\t\t0xD1F4 == code || // Lo       HANGUL SYLLABLE TOE\r\n\t\t0xD210 == code || // Lo       HANGUL SYLLABLE TYO\r\n\t\t0xD22C == code || // Lo       HANGUL SYLLABLE TU\r\n\t\t0xD248 == code || // Lo       HANGUL SYLLABLE TWEO\r\n\t\t0xD264 == code || // Lo       HANGUL SYLLABLE TWE\r\n\t\t0xD280 == code || // Lo       HANGUL SYLLABLE TWI\r\n\t\t0xD29C == code || // Lo       HANGUL SYLLABLE TYU\r\n\t\t0xD2B8 == code || // Lo       HANGUL SYLLABLE TEU\r\n\t\t0xD2D4 == code || // Lo       HANGUL SYLLABLE TYI\r\n\t\t0xD2F0 == code || // Lo       HANGUL SYLLABLE TI\r\n\t\t0xD30C == code || // Lo       HANGUL SYLLABLE PA\r\n\t\t0xD328 == code || // Lo       HANGUL SYLLABLE PAE\r\n\t\t0xD344 == code || // Lo       HANGUL SYLLABLE PYA\r\n\t\t0xD360 == code || // Lo       HANGUL SYLLABLE PYAE\r\n\t\t0xD37C == code || // Lo       HANGUL SYLLABLE PEO\r\n\t\t0xD398 == code || // Lo       HANGUL SYLLABLE PE\r\n\t\t0xD3B4 == code || // Lo       HANGUL SYLLABLE PYEO\r\n\t\t0xD3D0 == code || // Lo       HANGUL SYLLABLE PYE\r\n\t\t0xD3EC == code || // Lo       HANGUL SYLLABLE PO\r\n\t\t0xD408 == code || // Lo       HANGUL SYLLABLE PWA\r\n\t\t0xD424 == code || // Lo       HANGUL SYLLABLE PWAE\r\n\t\t0xD440 == code || // Lo       HANGUL SYLLABLE POE\r\n\t\t0xD45C == code || // Lo       HANGUL SYLLABLE PYO\r\n\t\t0xD478 == code || // Lo       HANGUL SYLLABLE PU\r\n\t\t0xD494 == code || // Lo       HANGUL SYLLABLE PWEO\r\n\t\t0xD4B0 == code || // Lo       HANGUL SYLLABLE PWE\r\n\t\t0xD4CC == code || // Lo       HANGUL SYLLABLE PWI\r\n\t\t0xD4E8 == code || // Lo       HANGUL SYLLABLE PYU\r\n\t\t0xD504 == code || // Lo       HANGUL SYLLABLE PEU\r\n\t\t0xD520 == code || // Lo       HANGUL SYLLABLE PYI\r\n\t\t0xD53C == code || // Lo       HANGUL SYLLABLE PI\r\n\t\t0xD558 == code || // Lo       HANGUL SYLLABLE HA\r\n\t\t0xD574 == code || // Lo       HANGUL SYLLABLE HAE\r\n\t\t0xD590 == code || // Lo       HANGUL SYLLABLE HYA\r\n\t\t0xD5AC == code || // Lo       HANGUL SYLLABLE HYAE\r\n\t\t0xD5C8 == code || // Lo       HANGUL SYLLABLE HEO\r\n\t\t0xD5E4 == code || // Lo       HANGUL SYLLABLE HE\r\n\t\t0xD600 == code || // Lo       HANGUL SYLLABLE HYEO\r\n\t\t0xD61C == code || // Lo       HANGUL SYLLABLE HYE\r\n\t\t0xD638 == code || // Lo       HANGUL SYLLABLE HO\r\n\t\t0xD654 == code || // Lo       HANGUL SYLLABLE HWA\r\n\t\t0xD670 == code || // Lo       HANGUL SYLLABLE HWAE\r\n\t\t0xD68C == code || // Lo       HANGUL SYLLABLE HOE\r\n\t\t0xD6A8 == code || // Lo       HANGUL SYLLABLE HYO\r\n\t\t0xD6C4 == code || // Lo       HANGUL SYLLABLE HU\r\n\t\t0xD6E0 == code || // Lo       HANGUL SYLLABLE HWEO\r\n\t\t0xD6FC == code || // Lo       HANGUL SYLLABLE HWE\r\n\t\t0xD718 == code || // Lo       HANGUL SYLLABLE HWI\r\n\t\t0xD734 == code || // Lo       HANGUL SYLLABLE HYU\r\n\t\t0xD750 == code || // Lo       HANGUL SYLLABLE HEU\r\n\t\t0xD76C == code || // Lo       HANGUL SYLLABLE HYI\r\n\t\t0xD788 == code // Lo       HANGUL SYLLABLE HI\r\n\t\t){\r\n\t\t\treturn LV;\r\n\t\t}\r\n\t\t\r\n\t\tif(\r\n\t\t(0xAC01 <= code && code <= 0xAC1B) || // Lo  [27] HANGUL SYLLABLE GAG..HANGUL SYLLABLE GAH\r\n\t\t(0xAC1D <= code && code <= 0xAC37) || // Lo  [27] HANGUL SYLLABLE GAEG..HANGUL SYLLABLE GAEH\r\n\t\t(0xAC39 <= code && code <= 0xAC53) || // Lo  [27] HANGUL SYLLABLE GYAG..HANGUL SYLLABLE GYAH\r\n\t\t(0xAC55 <= code && code <= 0xAC6F) || // Lo  [27] HANGUL SYLLABLE GYAEG..HANGUL SYLLABLE GYAEH\r\n\t\t(0xAC71 <= code && code <= 0xAC8B) || // Lo  [27] HANGUL SYLLABLE GEOG..HANGUL SYLLABLE GEOH\r\n\t\t(0xAC8D <= code && code <= 0xACA7) || // Lo  [27] HANGUL SYLLABLE GEG..HANGUL SYLLABLE GEH\r\n\t\t(0xACA9 <= code && code <= 0xACC3) || // Lo  [27] HANGUL SYLLABLE GYEOG..HANGUL SYLLABLE GYEOH\r\n\t\t(0xACC5 <= code && code <= 0xACDF) || // Lo  [27] HANGUL SYLLABLE GYEG..HANGUL SYLLABLE GYEH\r\n\t\t(0xACE1 <= code && code <= 0xACFB) || // Lo  [27] HANGUL SYLLABLE GOG..HANGUL SYLLABLE GOH\r\n\t\t(0xACFD <= code && code <= 0xAD17) || // Lo  [27] HANGUL SYLLABLE GWAG..HANGUL SYLLABLE GWAH\r\n\t\t(0xAD19 <= code && code <= 0xAD33) || // Lo  [27] HANGUL SYLLABLE GWAEG..HANGUL SYLLABLE GWAEH\r\n\t\t(0xAD35 <= code && code <= 0xAD4F) || // Lo  [27] HANGUL SYLLABLE GOEG..HANGUL SYLLABLE GOEH\r\n\t\t(0xAD51 <= code && code <= 0xAD6B) || // Lo  [27] HANGUL SYLLABLE GYOG..HANGUL SYLLABLE GYOH\r\n\t\t(0xAD6D <= code && code <= 0xAD87) || // Lo  [27] HANGUL SYLLABLE GUG..HANGUL SYLLABLE GUH\r\n\t\t(0xAD89 <= code && code <= 0xADA3) || // Lo  [27] HANGUL SYLLABLE GWEOG..HANGUL SYLLABLE GWEOH\r\n\t\t(0xADA5 <= code && code <= 0xADBF) || // Lo  [27] HANGUL SYLLABLE GWEG..HANGUL SYLLABLE GWEH\r\n\t\t(0xADC1 <= code && code <= 0xADDB) || // Lo  [27] HANGUL SYLLABLE GWIG..HANGUL SYLLABLE GWIH\r\n\t\t(0xADDD <= code && code <= 0xADF7) || // Lo  [27] HANGUL SYLLABLE GYUG..HANGUL SYLLABLE GYUH\r\n\t\t(0xADF9 <= code && code <= 0xAE13) || // Lo  [27] HANGUL SYLLABLE GEUG..HANGUL SYLLABLE GEUH\r\n\t\t(0xAE15 <= code && code <= 0xAE2F) || // Lo  [27] HANGUL SYLLABLE GYIG..HANGUL SYLLABLE GYIH\r\n\t\t(0xAE31 <= code && code <= 0xAE4B) || // Lo  [27] HANGUL SYLLABLE GIG..HANGUL SYLLABLE GIH\r\n\t\t(0xAE4D <= code && code <= 0xAE67) || // Lo  [27] HANGUL SYLLABLE GGAG..HANGUL SYLLABLE GGAH\r\n\t\t(0xAE69 <= code && code <= 0xAE83) || // Lo  [27] HANGUL SYLLABLE GGAEG..HANGUL SYLLABLE GGAEH\r\n\t\t(0xAE85 <= code && code <= 0xAE9F) || // Lo  [27] HANGUL SYLLABLE GGYAG..HANGUL SYLLABLE GGYAH\r\n\t\t(0xAEA1 <= code && code <= 0xAEBB) || // Lo  [27] HANGUL SYLLABLE GGYAEG..HANGUL SYLLABLE GGYAEH\r\n\t\t(0xAEBD <= code && code <= 0xAED7) || // Lo  [27] HANGUL SYLLABLE GGEOG..HANGUL SYLLABLE GGEOH\r\n\t\t(0xAED9 <= code && code <= 0xAEF3) || // Lo  [27] HANGUL SYLLABLE GGEG..HANGUL SYLLABLE GGEH\r\n\t\t(0xAEF5 <= code && code <= 0xAF0F) || // Lo  [27] HANGUL SYLLABLE GGYEOG..HANGUL SYLLABLE GGYEOH\r\n\t\t(0xAF11 <= code && code <= 0xAF2B) || // Lo  [27] HANGUL SYLLABLE GGYEG..HANGUL SYLLABLE GGYEH\r\n\t\t(0xAF2D <= code && code <= 0xAF47) || // Lo  [27] HANGUL SYLLABLE GGOG..HANGUL SYLLABLE GGOH\r\n\t\t(0xAF49 <= code && code <= 0xAF63) || // Lo  [27] HANGUL SYLLABLE GGWAG..HANGUL SYLLABLE GGWAH\r\n\t\t(0xAF65 <= code && code <= 0xAF7F) || // Lo  [27] HANGUL SYLLABLE GGWAEG..HANGUL SYLLABLE GGWAEH\r\n\t\t(0xAF81 <= code && code <= 0xAF9B) || // Lo  [27] HANGUL SYLLABLE GGOEG..HANGUL SYLLABLE GGOEH\r\n\t\t(0xAF9D <= code && code <= 0xAFB7) || // Lo  [27] HANGUL SYLLABLE GGYOG..HANGUL SYLLABLE GGYOH\r\n\t\t(0xAFB9 <= code && code <= 0xAFD3) || // Lo  [27] HANGUL SYLLABLE GGUG..HANGUL SYLLABLE GGUH\r\n\t\t(0xAFD5 <= code && code <= 0xAFEF) || // Lo  [27] HANGUL SYLLABLE GGWEOG..HANGUL SYLLABLE GGWEOH\r\n\t\t(0xAFF1 <= code && code <= 0xB00B) || // Lo  [27] HANGUL SYLLABLE GGWEG..HANGUL SYLLABLE GGWEH\r\n\t\t(0xB00D <= code && code <= 0xB027) || // Lo  [27] HANGUL SYLLABLE GGWIG..HANGUL SYLLABLE GGWIH\r\n\t\t(0xB029 <= code && code <= 0xB043) || // Lo  [27] HANGUL SYLLABLE GGYUG..HANGUL SYLLABLE GGYUH\r\n\t\t(0xB045 <= code && code <= 0xB05F) || // Lo  [27] HANGUL SYLLABLE GGEUG..HANGUL SYLLABLE GGEUH\r\n\t\t(0xB061 <= code && code <= 0xB07B) || // Lo  [27] HANGUL SYLLABLE GGYIG..HANGUL SYLLABLE GGYIH\r\n\t\t(0xB07D <= code && code <= 0xB097) || // Lo  [27] HANGUL SYLLABLE GGIG..HANGUL SYLLABLE GGIH\r\n\t\t(0xB099 <= code && code <= 0xB0B3) || // Lo  [27] HANGUL SYLLABLE NAG..HANGUL SYLLABLE NAH\r\n\t\t(0xB0B5 <= code && code <= 0xB0CF) || // Lo  [27] HANGUL SYLLABLE NAEG..HANGUL SYLLABLE NAEH\r\n\t\t(0xB0D1 <= code && code <= 0xB0EB) || // Lo  [27] HANGUL SYLLABLE NYAG..HANGUL SYLLABLE NYAH\r\n\t\t(0xB0ED <= code && code <= 0xB107) || // Lo  [27] HANGUL SYLLABLE NYAEG..HANGUL SYLLABLE NYAEH\r\n\t\t(0xB109 <= code && code <= 0xB123) || // Lo  [27] HANGUL SYLLABLE NEOG..HANGUL SYLLABLE NEOH\r\n\t\t(0xB125 <= code && code <= 0xB13F) || // Lo  [27] HANGUL SYLLABLE NEG..HANGUL SYLLABLE NEH\r\n\t\t(0xB141 <= code && code <= 0xB15B) || // Lo  [27] HANGUL SYLLABLE NYEOG..HANGUL SYLLABLE NYEOH\r\n\t\t(0xB15D <= code && code <= 0xB177) || // Lo  [27] HANGUL SYLLABLE NYEG..HANGUL SYLLABLE NYEH\r\n\t\t(0xB179 <= code && code <= 0xB193) || // Lo  [27] HANGUL SYLLABLE NOG..HANGUL SYLLABLE NOH\r\n\t\t(0xB195 <= code && code <= 0xB1AF) || // Lo  [27] HANGUL SYLLABLE NWAG..HANGUL SYLLABLE NWAH\r\n\t\t(0xB1B1 <= code && code <= 0xB1CB) || // Lo  [27] HANGUL SYLLABLE NWAEG..HANGUL SYLLABLE NWAEH\r\n\t\t(0xB1CD <= code && code <= 0xB1E7) || // Lo  [27] HANGUL SYLLABLE NOEG..HANGUL SYLLABLE NOEH\r\n\t\t(0xB1E9 <= code && code <= 0xB203) || // Lo  [27] HANGUL SYLLABLE NYOG..HANGUL SYLLABLE NYOH\r\n\t\t(0xB205 <= code && code <= 0xB21F) || // Lo  [27] HANGUL SYLLABLE NUG..HANGUL SYLLABLE NUH\r\n\t\t(0xB221 <= code && code <= 0xB23B) || // Lo  [27] HANGUL SYLLABLE NWEOG..HANGUL SYLLABLE NWEOH\r\n\t\t(0xB23D <= code && code <= 0xB257) || // Lo  [27] HANGUL SYLLABLE NWEG..HANGUL SYLLABLE NWEH\r\n\t\t(0xB259 <= code && code <= 0xB273) || // Lo  [27] HANGUL SYLLABLE NWIG..HANGUL SYLLABLE NWIH\r\n\t\t(0xB275 <= code && code <= 0xB28F) || // Lo  [27] HANGUL SYLLABLE NYUG..HANGUL SYLLABLE NYUH\r\n\t\t(0xB291 <= code && code <= 0xB2AB) || // Lo  [27] HANGUL SYLLABLE NEUG..HANGUL SYLLABLE NEUH\r\n\t\t(0xB2AD <= code && code <= 0xB2C7) || // Lo  [27] HANGUL SYLLABLE NYIG..HANGUL SYLLABLE NYIH\r\n\t\t(0xB2C9 <= code && code <= 0xB2E3) || // Lo  [27] HANGUL SYLLABLE NIG..HANGUL SYLLABLE NIH\r\n\t\t(0xB2E5 <= code && code <= 0xB2FF) || // Lo  [27] HANGUL SYLLABLE DAG..HANGUL SYLLABLE DAH\r\n\t\t(0xB301 <= code && code <= 0xB31B) || // Lo  [27] HANGUL SYLLABLE DAEG..HANGUL SYLLABLE DAEH\r\n\t\t(0xB31D <= code && code <= 0xB337) || // Lo  [27] HANGUL SYLLABLE DYAG..HANGUL SYLLABLE DYAH\r\n\t\t(0xB339 <= code && code <= 0xB353) || // Lo  [27] HANGUL SYLLABLE DYAEG..HANGUL SYLLABLE DYAEH\r\n\t\t(0xB355 <= code && code <= 0xB36F) || // Lo  [27] HANGUL SYLLABLE DEOG..HANGUL SYLLABLE DEOH\r\n\t\t(0xB371 <= code && code <= 0xB38B) || // Lo  [27] HANGUL SYLLABLE DEG..HANGUL SYLLABLE DEH\r\n\t\t(0xB38D <= code && code <= 0xB3A7) || // Lo  [27] HANGUL SYLLABLE DYEOG..HANGUL SYLLABLE DYEOH\r\n\t\t(0xB3A9 <= code && code <= 0xB3C3) || // Lo  [27] HANGUL SYLLABLE DYEG..HANGUL SYLLABLE DYEH\r\n\t\t(0xB3C5 <= code && code <= 0xB3DF) || // Lo  [27] HANGUL SYLLABLE DOG..HANGUL SYLLABLE DOH\r\n\t\t(0xB3E1 <= code && code <= 0xB3FB) || // Lo  [27] HANGUL SYLLABLE DWAG..HANGUL SYLLABLE DWAH\r\n\t\t(0xB3FD <= code && code <= 0xB417) || // Lo  [27] HANGUL SYLLABLE DWAEG..HANGUL SYLLABLE DWAEH\r\n\t\t(0xB419 <= code && code <= 0xB433) || // Lo  [27] HANGUL SYLLABLE DOEG..HANGUL SYLLABLE DOEH\r\n\t\t(0xB435 <= code && code <= 0xB44F) || // Lo  [27] HANGUL SYLLABLE DYOG..HANGUL SYLLABLE DYOH\r\n\t\t(0xB451 <= code && code <= 0xB46B) || // Lo  [27] HANGUL SYLLABLE DUG..HANGUL SYLLABLE DUH\r\n\t\t(0xB46D <= code && code <= 0xB487) || // Lo  [27] HANGUL SYLLABLE DWEOG..HANGUL SYLLABLE DWEOH\r\n\t\t(0xB489 <= code && code <= 0xB4A3) || // Lo  [27] HANGUL SYLLABLE DWEG..HANGUL SYLLABLE DWEH\r\n\t\t(0xB4A5 <= code && code <= 0xB4BF) || // Lo  [27] HANGUL SYLLABLE DWIG..HANGUL SYLLABLE DWIH\r\n\t\t(0xB4C1 <= code && code <= 0xB4DB) || // Lo  [27] HANGUL SYLLABLE DYUG..HANGUL SYLLABLE DYUH\r\n\t\t(0xB4DD <= code && code <= 0xB4F7) || // Lo  [27] HANGUL SYLLABLE DEUG..HANGUL SYLLABLE DEUH\r\n\t\t(0xB4F9 <= code && code <= 0xB513) || // Lo  [27] HANGUL SYLLABLE DYIG..HANGUL SYLLABLE DYIH\r\n\t\t(0xB515 <= code && code <= 0xB52F) || // Lo  [27] HANGUL SYLLABLE DIG..HANGUL SYLLABLE DIH\r\n\t\t(0xB531 <= code && code <= 0xB54B) || // Lo  [27] HANGUL SYLLABLE DDAG..HANGUL SYLLABLE DDAH\r\n\t\t(0xB54D <= code && code <= 0xB567) || // Lo  [27] HANGUL SYLLABLE DDAEG..HANGUL SYLLABLE DDAEH\r\n\t\t(0xB569 <= code && code <= 0xB583) || // Lo  [27] HANGUL SYLLABLE DDYAG..HANGUL SYLLABLE DDYAH\r\n\t\t(0xB585 <= code && code <= 0xB59F) || // Lo  [27] HANGUL SYLLABLE DDYAEG..HANGUL SYLLABLE DDYAEH\r\n\t\t(0xB5A1 <= code && code <= 0xB5BB) || // Lo  [27] HANGUL SYLLABLE DDEOG..HANGUL SYLLABLE DDEOH\r\n\t\t(0xB5BD <= code && code <= 0xB5D7) || // Lo  [27] HANGUL SYLLABLE DDEG..HANGUL SYLLABLE DDEH\r\n\t\t(0xB5D9 <= code && code <= 0xB5F3) || // Lo  [27] HANGUL SYLLABLE DDYEOG..HANGUL SYLLABLE DDYEOH\r\n\t\t(0xB5F5 <= code && code <= 0xB60F) || // Lo  [27] HANGUL SYLLABLE DDYEG..HANGUL SYLLABLE DDYEH\r\n\t\t(0xB611 <= code && code <= 0xB62B) || // Lo  [27] HANGUL SYLLABLE DDOG..HANGUL SYLLABLE DDOH\r\n\t\t(0xB62D <= code && code <= 0xB647) || // Lo  [27] HANGUL SYLLABLE DDWAG..HANGUL SYLLABLE DDWAH\r\n\t\t(0xB649 <= code && code <= 0xB663) || // Lo  [27] HANGUL SYLLABLE DDWAEG..HANGUL SYLLABLE DDWAEH\r\n\t\t(0xB665 <= code && code <= 0xB67F) || // Lo  [27] HANGUL SYLLABLE DDOEG..HANGUL SYLLABLE DDOEH\r\n\t\t(0xB681 <= code && code <= 0xB69B) || // Lo  [27] HANGUL SYLLABLE DDYOG..HANGUL SYLLABLE DDYOH\r\n\t\t(0xB69D <= code && code <= 0xB6B7) || // Lo  [27] HANGUL SYLLABLE DDUG..HANGUL SYLLABLE DDUH\r\n\t\t(0xB6B9 <= code && code <= 0xB6D3) || // Lo  [27] HANGUL SYLLABLE DDWEOG..HANGUL SYLLABLE DDWEOH\r\n\t\t(0xB6D5 <= code && code <= 0xB6EF) || // Lo  [27] HANGUL SYLLABLE DDWEG..HANGUL SYLLABLE DDWEH\r\n\t\t(0xB6F1 <= code && code <= 0xB70B) || // Lo  [27] HANGUL SYLLABLE DDWIG..HANGUL SYLLABLE DDWIH\r\n\t\t(0xB70D <= code && code <= 0xB727) || // Lo  [27] HANGUL SYLLABLE DDYUG..HANGUL SYLLABLE DDYUH\r\n\t\t(0xB729 <= code && code <= 0xB743) || // Lo  [27] HANGUL SYLLABLE DDEUG..HANGUL SYLLABLE DDEUH\r\n\t\t(0xB745 <= code && code <= 0xB75F) || // Lo  [27] HANGUL SYLLABLE DDYIG..HANGUL SYLLABLE DDYIH\r\n\t\t(0xB761 <= code && code <= 0xB77B) || // Lo  [27] HANGUL SYLLABLE DDIG..HANGUL SYLLABLE DDIH\r\n\t\t(0xB77D <= code && code <= 0xB797) || // Lo  [27] HANGUL SYLLABLE RAG..HANGUL SYLLABLE RAH\r\n\t\t(0xB799 <= code && code <= 0xB7B3) || // Lo  [27] HANGUL SYLLABLE RAEG..HANGUL SYLLABLE RAEH\r\n\t\t(0xB7B5 <= code && code <= 0xB7CF) || // Lo  [27] HANGUL SYLLABLE RYAG..HANGUL SYLLABLE RYAH\r\n\t\t(0xB7D1 <= code && code <= 0xB7EB) || // Lo  [27] HANGUL SYLLABLE RYAEG..HANGUL SYLLABLE RYAEH\r\n\t\t(0xB7ED <= code && code <= 0xB807) || // Lo  [27] HANGUL SYLLABLE REOG..HANGUL SYLLABLE REOH\r\n\t\t(0xB809 <= code && code <= 0xB823) || // Lo  [27] HANGUL SYLLABLE REG..HANGUL SYLLABLE REH\r\n\t\t(0xB825 <= code && code <= 0xB83F) || // Lo  [27] HANGUL SYLLABLE RYEOG..HANGUL SYLLABLE RYEOH\r\n\t\t(0xB841 <= code && code <= 0xB85B) || // Lo  [27] HANGUL SYLLABLE RYEG..HANGUL SYLLABLE RYEH\r\n\t\t(0xB85D <= code && code <= 0xB877) || // Lo  [27] HANGUL SYLLABLE ROG..HANGUL SYLLABLE ROH\r\n\t\t(0xB879 <= code && code <= 0xB893) || // Lo  [27] HANGUL SYLLABLE RWAG..HANGUL SYLLABLE RWAH\r\n\t\t(0xB895 <= code && code <= 0xB8AF) || // Lo  [27] HANGUL SYLLABLE RWAEG..HANGUL SYLLABLE RWAEH\r\n\t\t(0xB8B1 <= code && code <= 0xB8CB) || // Lo  [27] HANGUL SYLLABLE ROEG..HANGUL SYLLABLE ROEH\r\n\t\t(0xB8CD <= code && code <= 0xB8E7) || // Lo  [27] HANGUL SYLLABLE RYOG..HANGUL SYLLABLE RYOH\r\n\t\t(0xB8E9 <= code && code <= 0xB903) || // Lo  [27] HANGUL SYLLABLE RUG..HANGUL SYLLABLE RUH\r\n\t\t(0xB905 <= code && code <= 0xB91F) || // Lo  [27] HANGUL SYLLABLE RWEOG..HANGUL SYLLABLE RWEOH\r\n\t\t(0xB921 <= code && code <= 0xB93B) || // Lo  [27] HANGUL SYLLABLE RWEG..HANGUL SYLLABLE RWEH\r\n\t\t(0xB93D <= code && code <= 0xB957) || // Lo  [27] HANGUL SYLLABLE RWIG..HANGUL SYLLABLE RWIH\r\n\t\t(0xB959 <= code && code <= 0xB973) || // Lo  [27] HANGUL SYLLABLE RYUG..HANGUL SYLLABLE RYUH\r\n\t\t(0xB975 <= code && code <= 0xB98F) || // Lo  [27] HANGUL SYLLABLE REUG..HANGUL SYLLABLE REUH\r\n\t\t(0xB991 <= code && code <= 0xB9AB) || // Lo  [27] HANGUL SYLLABLE RYIG..HANGUL SYLLABLE RYIH\r\n\t\t(0xB9AD <= code && code <= 0xB9C7) || // Lo  [27] HANGUL SYLLABLE RIG..HANGUL SYLLABLE RIH\r\n\t\t(0xB9C9 <= code && code <= 0xB9E3) || // Lo  [27] HANGUL SYLLABLE MAG..HANGUL SYLLABLE MAH\r\n\t\t(0xB9E5 <= code && code <= 0xB9FF) || // Lo  [27] HANGUL SYLLABLE MAEG..HANGUL SYLLABLE MAEH\r\n\t\t(0xBA01 <= code && code <= 0xBA1B) || // Lo  [27] HANGUL SYLLABLE MYAG..HANGUL SYLLABLE MYAH\r\n\t\t(0xBA1D <= code && code <= 0xBA37) || // Lo  [27] HANGUL SYLLABLE MYAEG..HANGUL SYLLABLE MYAEH\r\n\t\t(0xBA39 <= code && code <= 0xBA53) || // Lo  [27] HANGUL SYLLABLE MEOG..HANGUL SYLLABLE MEOH\r\n\t\t(0xBA55 <= code && code <= 0xBA6F) || // Lo  [27] HANGUL SYLLABLE MEG..HANGUL SYLLABLE MEH\r\n\t\t(0xBA71 <= code && code <= 0xBA8B) || // Lo  [27] HANGUL SYLLABLE MYEOG..HANGUL SYLLABLE MYEOH\r\n\t\t(0xBA8D <= code && code <= 0xBAA7) || // Lo  [27] HANGUL SYLLABLE MYEG..HANGUL SYLLABLE MYEH\r\n\t\t(0xBAA9 <= code && code <= 0xBAC3) || // Lo  [27] HANGUL SYLLABLE MOG..HANGUL SYLLABLE MOH\r\n\t\t(0xBAC5 <= code && code <= 0xBADF) || // Lo  [27] HANGUL SYLLABLE MWAG..HANGUL SYLLABLE MWAH\r\n\t\t(0xBAE1 <= code && code <= 0xBAFB) || // Lo  [27] HANGUL SYLLABLE MWAEG..HANGUL SYLLABLE MWAEH\r\n\t\t(0xBAFD <= code && code <= 0xBB17) || // Lo  [27] HANGUL SYLLABLE MOEG..HANGUL SYLLABLE MOEH\r\n\t\t(0xBB19 <= code && code <= 0xBB33) || // Lo  [27] HANGUL SYLLABLE MYOG..HANGUL SYLLABLE MYOH\r\n\t\t(0xBB35 <= code && code <= 0xBB4F) || // Lo  [27] HANGUL SYLLABLE MUG..HANGUL SYLLABLE MUH\r\n\t\t(0xBB51 <= code && code <= 0xBB6B) || // Lo  [27] HANGUL SYLLABLE MWEOG..HANGUL SYLLABLE MWEOH\r\n\t\t(0xBB6D <= code && code <= 0xBB87) || // Lo  [27] HANGUL SYLLABLE MWEG..HANGUL SYLLABLE MWEH\r\n\t\t(0xBB89 <= code && code <= 0xBBA3) || // Lo  [27] HANGUL SYLLABLE MWIG..HANGUL SYLLABLE MWIH\r\n\t\t(0xBBA5 <= code && code <= 0xBBBF) || // Lo  [27] HANGUL SYLLABLE MYUG..HANGUL SYLLABLE MYUH\r\n\t\t(0xBBC1 <= code && code <= 0xBBDB) || // Lo  [27] HANGUL SYLLABLE MEUG..HANGUL SYLLABLE MEUH\r\n\t\t(0xBBDD <= code && code <= 0xBBF7) || // Lo  [27] HANGUL SYLLABLE MYIG..HANGUL SYLLABLE MYIH\r\n\t\t(0xBBF9 <= code && code <= 0xBC13) || // Lo  [27] HANGUL SYLLABLE MIG..HANGUL SYLLABLE MIH\r\n\t\t(0xBC15 <= code && code <= 0xBC2F) || // Lo  [27] HANGUL SYLLABLE BAG..HANGUL SYLLABLE BAH\r\n\t\t(0xBC31 <= code && code <= 0xBC4B) || // Lo  [27] HANGUL SYLLABLE BAEG..HANGUL SYLLABLE BAEH\r\n\t\t(0xBC4D <= code && code <= 0xBC67) || // Lo  [27] HANGUL SYLLABLE BYAG..HANGUL SYLLABLE BYAH\r\n\t\t(0xBC69 <= code && code <= 0xBC83) || // Lo  [27] HANGUL SYLLABLE BYAEG..HANGUL SYLLABLE BYAEH\r\n\t\t(0xBC85 <= code && code <= 0xBC9F) || // Lo  [27] HANGUL SYLLABLE BEOG..HANGUL SYLLABLE BEOH\r\n\t\t(0xBCA1 <= code && code <= 0xBCBB) || // Lo  [27] HANGUL SYLLABLE BEG..HANGUL SYLLABLE BEH\r\n\t\t(0xBCBD <= code && code <= 0xBCD7) || // Lo  [27] HANGUL SYLLABLE BYEOG..HANGUL SYLLABLE BYEOH\r\n\t\t(0xBCD9 <= code && code <= 0xBCF3) || // Lo  [27] HANGUL SYLLABLE BYEG..HANGUL SYLLABLE BYEH\r\n\t\t(0xBCF5 <= code && code <= 0xBD0F) || // Lo  [27] HANGUL SYLLABLE BOG..HANGUL SYLLABLE BOH\r\n\t\t(0xBD11 <= code && code <= 0xBD2B) || // Lo  [27] HANGUL SYLLABLE BWAG..HANGUL SYLLABLE BWAH\r\n\t\t(0xBD2D <= code && code <= 0xBD47) || // Lo  [27] HANGUL SYLLABLE BWAEG..HANGUL SYLLABLE BWAEH\r\n\t\t(0xBD49 <= code && code <= 0xBD63) || // Lo  [27] HANGUL SYLLABLE BOEG..HANGUL SYLLABLE BOEH\r\n\t\t(0xBD65 <= code && code <= 0xBD7F) || // Lo  [27] HANGUL SYLLABLE BYOG..HANGUL SYLLABLE BYOH\r\n\t\t(0xBD81 <= code && code <= 0xBD9B) || // Lo  [27] HANGUL SYLLABLE BUG..HANGUL SYLLABLE BUH\r\n\t\t(0xBD9D <= code && code <= 0xBDB7) || // Lo  [27] HANGUL SYLLABLE BWEOG..HANGUL SYLLABLE BWEOH\r\n\t\t(0xBDB9 <= code && code <= 0xBDD3) || // Lo  [27] HANGUL SYLLABLE BWEG..HANGUL SYLLABLE BWEH\r\n\t\t(0xBDD5 <= code && code <= 0xBDEF) || // Lo  [27] HANGUL SYLLABLE BWIG..HANGUL SYLLABLE BWIH\r\n\t\t(0xBDF1 <= code && code <= 0xBE0B) || // Lo  [27] HANGUL SYLLABLE BYUG..HANGUL SYLLABLE BYUH\r\n\t\t(0xBE0D <= code && code <= 0xBE27) || // Lo  [27] HANGUL SYLLABLE BEUG..HANGUL SYLLABLE BEUH\r\n\t\t(0xBE29 <= code && code <= 0xBE43) || // Lo  [27] HANGUL SYLLABLE BYIG..HANGUL SYLLABLE BYIH\r\n\t\t(0xBE45 <= code && code <= 0xBE5F) || // Lo  [27] HANGUL SYLLABLE BIG..HANGUL SYLLABLE BIH\r\n\t\t(0xBE61 <= code && code <= 0xBE7B) || // Lo  [27] HANGUL SYLLABLE BBAG..HANGUL SYLLABLE BBAH\r\n\t\t(0xBE7D <= code && code <= 0xBE97) || // Lo  [27] HANGUL SYLLABLE BBAEG..HANGUL SYLLABLE BBAEH\r\n\t\t(0xBE99 <= code && code <= 0xBEB3) || // Lo  [27] HANGUL SYLLABLE BBYAG..HANGUL SYLLABLE BBYAH\r\n\t\t(0xBEB5 <= code && code <= 0xBECF) || // Lo  [27] HANGUL SYLLABLE BBYAEG..HANGUL SYLLABLE BBYAEH\r\n\t\t(0xBED1 <= code && code <= 0xBEEB) || // Lo  [27] HANGUL SYLLABLE BBEOG..HANGUL SYLLABLE BBEOH\r\n\t\t(0xBEED <= code && code <= 0xBF07) || // Lo  [27] HANGUL SYLLABLE BBEG..HANGUL SYLLABLE BBEH\r\n\t\t(0xBF09 <= code && code <= 0xBF23) || // Lo  [27] HANGUL SYLLABLE BBYEOG..HANGUL SYLLABLE BBYEOH\r\n\t\t(0xBF25 <= code && code <= 0xBF3F) || // Lo  [27] HANGUL SYLLABLE BBYEG..HANGUL SYLLABLE BBYEH\r\n\t\t(0xBF41 <= code && code <= 0xBF5B) || // Lo  [27] HANGUL SYLLABLE BBOG..HANGUL SYLLABLE BBOH\r\n\t\t(0xBF5D <= code && code <= 0xBF77) || // Lo  [27] HANGUL SYLLABLE BBWAG..HANGUL SYLLABLE BBWAH\r\n\t\t(0xBF79 <= code && code <= 0xBF93) || // Lo  [27] HANGUL SYLLABLE BBWAEG..HANGUL SYLLABLE BBWAEH\r\n\t\t(0xBF95 <= code && code <= 0xBFAF) || // Lo  [27] HANGUL SYLLABLE BBOEG..HANGUL SYLLABLE BBOEH\r\n\t\t(0xBFB1 <= code && code <= 0xBFCB) || // Lo  [27] HANGUL SYLLABLE BBYOG..HANGUL SYLLABLE BBYOH\r\n\t\t(0xBFCD <= code && code <= 0xBFE7) || // Lo  [27] HANGUL SYLLABLE BBUG..HANGUL SYLLABLE BBUH\r\n\t\t(0xBFE9 <= code && code <= 0xC003) || // Lo  [27] HANGUL SYLLABLE BBWEOG..HANGUL SYLLABLE BBWEOH\r\n\t\t(0xC005 <= code && code <= 0xC01F) || // Lo  [27] HANGUL SYLLABLE BBWEG..HANGUL SYLLABLE BBWEH\r\n\t\t(0xC021 <= code && code <= 0xC03B) || // Lo  [27] HANGUL SYLLABLE BBWIG..HANGUL SYLLABLE BBWIH\r\n\t\t(0xC03D <= code && code <= 0xC057) || // Lo  [27] HANGUL SYLLABLE BBYUG..HANGUL SYLLABLE BBYUH\r\n\t\t(0xC059 <= code && code <= 0xC073) || // Lo  [27] HANGUL SYLLABLE BBEUG..HANGUL SYLLABLE BBEUH\r\n\t\t(0xC075 <= code && code <= 0xC08F) || // Lo  [27] HANGUL SYLLABLE BBYIG..HANGUL SYLLABLE BBYIH\r\n\t\t(0xC091 <= code && code <= 0xC0AB) || // Lo  [27] HANGUL SYLLABLE BBIG..HANGUL SYLLABLE BBIH\r\n\t\t(0xC0AD <= code && code <= 0xC0C7) || // Lo  [27] HANGUL SYLLABLE SAG..HANGUL SYLLABLE SAH\r\n\t\t(0xC0C9 <= code && code <= 0xC0E3) || // Lo  [27] HANGUL SYLLABLE SAEG..HANGUL SYLLABLE SAEH\r\n\t\t(0xC0E5 <= code && code <= 0xC0FF) || // Lo  [27] HANGUL SYLLABLE SYAG..HANGUL SYLLABLE SYAH\r\n\t\t(0xC101 <= code && code <= 0xC11B) || // Lo  [27] HANGUL SYLLABLE SYAEG..HANGUL SYLLABLE SYAEH\r\n\t\t(0xC11D <= code && code <= 0xC137) || // Lo  [27] HANGUL SYLLABLE SEOG..HANGUL SYLLABLE SEOH\r\n\t\t(0xC139 <= code && code <= 0xC153) || // Lo  [27] HANGUL SYLLABLE SEG..HANGUL SYLLABLE SEH\r\n\t\t(0xC155 <= code && code <= 0xC16F) || // Lo  [27] HANGUL SYLLABLE SYEOG..HANGUL SYLLABLE SYEOH\r\n\t\t(0xC171 <= code && code <= 0xC18B) || // Lo  [27] HANGUL SYLLABLE SYEG..HANGUL SYLLABLE SYEH\r\n\t\t(0xC18D <= code && code <= 0xC1A7) || // Lo  [27] HANGUL SYLLABLE SOG..HANGUL SYLLABLE SOH\r\n\t\t(0xC1A9 <= code && code <= 0xC1C3) || // Lo  [27] HANGUL SYLLABLE SWAG..HANGUL SYLLABLE SWAH\r\n\t\t(0xC1C5 <= code && code <= 0xC1DF) || // Lo  [27] HANGUL SYLLABLE SWAEG..HANGUL SYLLABLE SWAEH\r\n\t\t(0xC1E1 <= code && code <= 0xC1FB) || // Lo  [27] HANGUL SYLLABLE SOEG..HANGUL SYLLABLE SOEH\r\n\t\t(0xC1FD <= code && code <= 0xC217) || // Lo  [27] HANGUL SYLLABLE SYOG..HANGUL SYLLABLE SYOH\r\n\t\t(0xC219 <= code && code <= 0xC233) || // Lo  [27] HANGUL SYLLABLE SUG..HANGUL SYLLABLE SUH\r\n\t\t(0xC235 <= code && code <= 0xC24F) || // Lo  [27] HANGUL SYLLABLE SWEOG..HANGUL SYLLABLE SWEOH\r\n\t\t(0xC251 <= code && code <= 0xC26B) || // Lo  [27] HANGUL SYLLABLE SWEG..HANGUL SYLLABLE SWEH\r\n\t\t(0xC26D <= code && code <= 0xC287) || // Lo  [27] HANGUL SYLLABLE SWIG..HANGUL SYLLABLE SWIH\r\n\t\t(0xC289 <= code && code <= 0xC2A3) || // Lo  [27] HANGUL SYLLABLE SYUG..HANGUL SYLLABLE SYUH\r\n\t\t(0xC2A5 <= code && code <= 0xC2BF) || // Lo  [27] HANGUL SYLLABLE SEUG..HANGUL SYLLABLE SEUH\r\n\t\t(0xC2C1 <= code && code <= 0xC2DB) || // Lo  [27] HANGUL SYLLABLE SYIG..HANGUL SYLLABLE SYIH\r\n\t\t(0xC2DD <= code && code <= 0xC2F7) || // Lo  [27] HANGUL SYLLABLE SIG..HANGUL SYLLABLE SIH\r\n\t\t(0xC2F9 <= code && code <= 0xC313) || // Lo  [27] HANGUL SYLLABLE SSAG..HANGUL SYLLABLE SSAH\r\n\t\t(0xC315 <= code && code <= 0xC32F) || // Lo  [27] HANGUL SYLLABLE SSAEG..HANGUL SYLLABLE SSAEH\r\n\t\t(0xC331 <= code && code <= 0xC34B) || // Lo  [27] HANGUL SYLLABLE SSYAG..HANGUL SYLLABLE SSYAH\r\n\t\t(0xC34D <= code && code <= 0xC367) || // Lo  [27] HANGUL SYLLABLE SSYAEG..HANGUL SYLLABLE SSYAEH\r\n\t\t(0xC369 <= code && code <= 0xC383) || // Lo  [27] HANGUL SYLLABLE SSEOG..HANGUL SYLLABLE SSEOH\r\n\t\t(0xC385 <= code && code <= 0xC39F) || // Lo  [27] HANGUL SYLLABLE SSEG..HANGUL SYLLABLE SSEH\r\n\t\t(0xC3A1 <= code && code <= 0xC3BB) || // Lo  [27] HANGUL SYLLABLE SSYEOG..HANGUL SYLLABLE SSYEOH\r\n\t\t(0xC3BD <= code && code <= 0xC3D7) || // Lo  [27] HANGUL SYLLABLE SSYEG..HANGUL SYLLABLE SSYEH\r\n\t\t(0xC3D9 <= code && code <= 0xC3F3) || // Lo  [27] HANGUL SYLLABLE SSOG..HANGUL SYLLABLE SSOH\r\n\t\t(0xC3F5 <= code && code <= 0xC40F) || // Lo  [27] HANGUL SYLLABLE SSWAG..HANGUL SYLLABLE SSWAH\r\n\t\t(0xC411 <= code && code <= 0xC42B) || // Lo  [27] HANGUL SYLLABLE SSWAEG..HANGUL SYLLABLE SSWAEH\r\n\t\t(0xC42D <= code && code <= 0xC447) || // Lo  [27] HANGUL SYLLABLE SSOEG..HANGUL SYLLABLE SSOEH\r\n\t\t(0xC449 <= code && code <= 0xC463) || // Lo  [27] HANGUL SYLLABLE SSYOG..HANGUL SYLLABLE SSYOH\r\n\t\t(0xC465 <= code && code <= 0xC47F) || // Lo  [27] HANGUL SYLLABLE SSUG..HANGUL SYLLABLE SSUH\r\n\t\t(0xC481 <= code && code <= 0xC49B) || // Lo  [27] HANGUL SYLLABLE SSWEOG..HANGUL SYLLABLE SSWEOH\r\n\t\t(0xC49D <= code && code <= 0xC4B7) || // Lo  [27] HANGUL SYLLABLE SSWEG..HANGUL SYLLABLE SSWEH\r\n\t\t(0xC4B9 <= code && code <= 0xC4D3) || // Lo  [27] HANGUL SYLLABLE SSWIG..HANGUL SYLLABLE SSWIH\r\n\t\t(0xC4D5 <= code && code <= 0xC4EF) || // Lo  [27] HANGUL SYLLABLE SSYUG..HANGUL SYLLABLE SSYUH\r\n\t\t(0xC4F1 <= code && code <= 0xC50B) || // Lo  [27] HANGUL SYLLABLE SSEUG..HANGUL SYLLABLE SSEUH\r\n\t\t(0xC50D <= code && code <= 0xC527) || // Lo  [27] HANGUL SYLLABLE SSYIG..HANGUL SYLLABLE SSYIH\r\n\t\t(0xC529 <= code && code <= 0xC543) || // Lo  [27] HANGUL SYLLABLE SSIG..HANGUL SYLLABLE SSIH\r\n\t\t(0xC545 <= code && code <= 0xC55F) || // Lo  [27] HANGUL SYLLABLE AG..HANGUL SYLLABLE AH\r\n\t\t(0xC561 <= code && code <= 0xC57B) || // Lo  [27] HANGUL SYLLABLE AEG..HANGUL SYLLABLE AEH\r\n\t\t(0xC57D <= code && code <= 0xC597) || // Lo  [27] HANGUL SYLLABLE YAG..HANGUL SYLLABLE YAH\r\n\t\t(0xC599 <= code && code <= 0xC5B3) || // Lo  [27] HANGUL SYLLABLE YAEG..HANGUL SYLLABLE YAEH\r\n\t\t(0xC5B5 <= code && code <= 0xC5CF) || // Lo  [27] HANGUL SYLLABLE EOG..HANGUL SYLLABLE EOH\r\n\t\t(0xC5D1 <= code && code <= 0xC5EB) || // Lo  [27] HANGUL SYLLABLE EG..HANGUL SYLLABLE EH\r\n\t\t(0xC5ED <= code && code <= 0xC607) || // Lo  [27] HANGUL SYLLABLE YEOG..HANGUL SYLLABLE YEOH\r\n\t\t(0xC609 <= code && code <= 0xC623) || // Lo  [27] HANGUL SYLLABLE YEG..HANGUL SYLLABLE YEH\r\n\t\t(0xC625 <= code && code <= 0xC63F) || // Lo  [27] HANGUL SYLLABLE OG..HANGUL SYLLABLE OH\r\n\t\t(0xC641 <= code && code <= 0xC65B) || // Lo  [27] HANGUL SYLLABLE WAG..HANGUL SYLLABLE WAH\r\n\t\t(0xC65D <= code && code <= 0xC677) || // Lo  [27] HANGUL SYLLABLE WAEG..HANGUL SYLLABLE WAEH\r\n\t\t(0xC679 <= code && code <= 0xC693) || // Lo  [27] HANGUL SYLLABLE OEG..HANGUL SYLLABLE OEH\r\n\t\t(0xC695 <= code && code <= 0xC6AF) || // Lo  [27] HANGUL SYLLABLE YOG..HANGUL SYLLABLE YOH\r\n\t\t(0xC6B1 <= code && code <= 0xC6CB) || // Lo  [27] HANGUL SYLLABLE UG..HANGUL SYLLABLE UH\r\n\t\t(0xC6CD <= code && code <= 0xC6E7) || // Lo  [27] HANGUL SYLLABLE WEOG..HANGUL SYLLABLE WEOH\r\n\t\t(0xC6E9 <= code && code <= 0xC703) || // Lo  [27] HANGUL SYLLABLE WEG..HANGUL SYLLABLE WEH\r\n\t\t(0xC705 <= code && code <= 0xC71F) || // Lo  [27] HANGUL SYLLABLE WIG..HANGUL SYLLABLE WIH\r\n\t\t(0xC721 <= code && code <= 0xC73B) || // Lo  [27] HANGUL SYLLABLE YUG..HANGUL SYLLABLE YUH\r\n\t\t(0xC73D <= code && code <= 0xC757) || // Lo  [27] HANGUL SYLLABLE EUG..HANGUL SYLLABLE EUH\r\n\t\t(0xC759 <= code && code <= 0xC773) || // Lo  [27] HANGUL SYLLABLE YIG..HANGUL SYLLABLE YIH\r\n\t\t(0xC775 <= code && code <= 0xC78F) || // Lo  [27] HANGUL SYLLABLE IG..HANGUL SYLLABLE IH\r\n\t\t(0xC791 <= code && code <= 0xC7AB) || // Lo  [27] HANGUL SYLLABLE JAG..HANGUL SYLLABLE JAH\r\n\t\t(0xC7AD <= code && code <= 0xC7C7) || // Lo  [27] HANGUL SYLLABLE JAEG..HANGUL SYLLABLE JAEH\r\n\t\t(0xC7C9 <= code && code <= 0xC7E3) || // Lo  [27] HANGUL SYLLABLE JYAG..HANGUL SYLLABLE JYAH\r\n\t\t(0xC7E5 <= code && code <= 0xC7FF) || // Lo  [27] HANGUL SYLLABLE JYAEG..HANGUL SYLLABLE JYAEH\r\n\t\t(0xC801 <= code && code <= 0xC81B) || // Lo  [27] HANGUL SYLLABLE JEOG..HANGUL SYLLABLE JEOH\r\n\t\t(0xC81D <= code && code <= 0xC837) || // Lo  [27] HANGUL SYLLABLE JEG..HANGUL SYLLABLE JEH\r\n\t\t(0xC839 <= code && code <= 0xC853) || // Lo  [27] HANGUL SYLLABLE JYEOG..HANGUL SYLLABLE JYEOH\r\n\t\t(0xC855 <= code && code <= 0xC86F) || // Lo  [27] HANGUL SYLLABLE JYEG..HANGUL SYLLABLE JYEH\r\n\t\t(0xC871 <= code && code <= 0xC88B) || // Lo  [27] HANGUL SYLLABLE JOG..HANGUL SYLLABLE JOH\r\n\t\t(0xC88D <= code && code <= 0xC8A7) || // Lo  [27] HANGUL SYLLABLE JWAG..HANGUL SYLLABLE JWAH\r\n\t\t(0xC8A9 <= code && code <= 0xC8C3) || // Lo  [27] HANGUL SYLLABLE JWAEG..HANGUL SYLLABLE JWAEH\r\n\t\t(0xC8C5 <= code && code <= 0xC8DF) || // Lo  [27] HANGUL SYLLABLE JOEG..HANGUL SYLLABLE JOEH\r\n\t\t(0xC8E1 <= code && code <= 0xC8FB) || // Lo  [27] HANGUL SYLLABLE JYOG..HANGUL SYLLABLE JYOH\r\n\t\t(0xC8FD <= code && code <= 0xC917) || // Lo  [27] HANGUL SYLLABLE JUG..HANGUL SYLLABLE JUH\r\n\t\t(0xC919 <= code && code <= 0xC933) || // Lo  [27] HANGUL SYLLABLE JWEOG..HANGUL SYLLABLE JWEOH\r\n\t\t(0xC935 <= code && code <= 0xC94F) || // Lo  [27] HANGUL SYLLABLE JWEG..HANGUL SYLLABLE JWEH\r\n\t\t(0xC951 <= code && code <= 0xC96B) || // Lo  [27] HANGUL SYLLABLE JWIG..HANGUL SYLLABLE JWIH\r\n\t\t(0xC96D <= code && code <= 0xC987) || // Lo  [27] HANGUL SYLLABLE JYUG..HANGUL SYLLABLE JYUH\r\n\t\t(0xC989 <= code && code <= 0xC9A3) || // Lo  [27] HANGUL SYLLABLE JEUG..HANGUL SYLLABLE JEUH\r\n\t\t(0xC9A5 <= code && code <= 0xC9BF) || // Lo  [27] HANGUL SYLLABLE JYIG..HANGUL SYLLABLE JYIH\r\n\t\t(0xC9C1 <= code && code <= 0xC9DB) || // Lo  [27] HANGUL SYLLABLE JIG..HANGUL SYLLABLE JIH\r\n\t\t(0xC9DD <= code && code <= 0xC9F7) || // Lo  [27] HANGUL SYLLABLE JJAG..HANGUL SYLLABLE JJAH\r\n\t\t(0xC9F9 <= code && code <= 0xCA13) || // Lo  [27] HANGUL SYLLABLE JJAEG..HANGUL SYLLABLE JJAEH\r\n\t\t(0xCA15 <= code && code <= 0xCA2F) || // Lo  [27] HANGUL SYLLABLE JJYAG..HANGUL SYLLABLE JJYAH\r\n\t\t(0xCA31 <= code && code <= 0xCA4B) || // Lo  [27] HANGUL SYLLABLE JJYAEG..HANGUL SYLLABLE JJYAEH\r\n\t\t(0xCA4D <= code && code <= 0xCA67) || // Lo  [27] HANGUL SYLLABLE JJEOG..HANGUL SYLLABLE JJEOH\r\n\t\t(0xCA69 <= code && code <= 0xCA83) || // Lo  [27] HANGUL SYLLABLE JJEG..HANGUL SYLLABLE JJEH\r\n\t\t(0xCA85 <= code && code <= 0xCA9F) || // Lo  [27] HANGUL SYLLABLE JJYEOG..HANGUL SYLLABLE JJYEOH\r\n\t\t(0xCAA1 <= code && code <= 0xCABB) || // Lo  [27] HANGUL SYLLABLE JJYEG..HANGUL SYLLABLE JJYEH\r\n\t\t(0xCABD <= code && code <= 0xCAD7) || // Lo  [27] HANGUL SYLLABLE JJOG..HANGUL SYLLABLE JJOH\r\n\t\t(0xCAD9 <= code && code <= 0xCAF3) || // Lo  [27] HANGUL SYLLABLE JJWAG..HANGUL SYLLABLE JJWAH\r\n\t\t(0xCAF5 <= code && code <= 0xCB0F) || // Lo  [27] HANGUL SYLLABLE JJWAEG..HANGUL SYLLABLE JJWAEH\r\n\t\t(0xCB11 <= code && code <= 0xCB2B) || // Lo  [27] HANGUL SYLLABLE JJOEG..HANGUL SYLLABLE JJOEH\r\n\t\t(0xCB2D <= code && code <= 0xCB47) || // Lo  [27] HANGUL SYLLABLE JJYOG..HANGUL SYLLABLE JJYOH\r\n\t\t(0xCB49 <= code && code <= 0xCB63) || // Lo  [27] HANGUL SYLLABLE JJUG..HANGUL SYLLABLE JJUH\r\n\t\t(0xCB65 <= code && code <= 0xCB7F) || // Lo  [27] HANGUL SYLLABLE JJWEOG..HANGUL SYLLABLE JJWEOH\r\n\t\t(0xCB81 <= code && code <= 0xCB9B) || // Lo  [27] HANGUL SYLLABLE JJWEG..HANGUL SYLLABLE JJWEH\r\n\t\t(0xCB9D <= code && code <= 0xCBB7) || // Lo  [27] HANGUL SYLLABLE JJWIG..HANGUL SYLLABLE JJWIH\r\n\t\t(0xCBB9 <= code && code <= 0xCBD3) || // Lo  [27] HANGUL SYLLABLE JJYUG..HANGUL SYLLABLE JJYUH\r\n\t\t(0xCBD5 <= code && code <= 0xCBEF) || // Lo  [27] HANGUL SYLLABLE JJEUG..HANGUL SYLLABLE JJEUH\r\n\t\t(0xCBF1 <= code && code <= 0xCC0B) || // Lo  [27] HANGUL SYLLABLE JJYIG..HANGUL SYLLABLE JJYIH\r\n\t\t(0xCC0D <= code && code <= 0xCC27) || // Lo  [27] HANGUL SYLLABLE JJIG..HANGUL SYLLABLE JJIH\r\n\t\t(0xCC29 <= code && code <= 0xCC43) || // Lo  [27] HANGUL SYLLABLE CAG..HANGUL SYLLABLE CAH\r\n\t\t(0xCC45 <= code && code <= 0xCC5F) || // Lo  [27] HANGUL SYLLABLE CAEG..HANGUL SYLLABLE CAEH\r\n\t\t(0xCC61 <= code && code <= 0xCC7B) || // Lo  [27] HANGUL SYLLABLE CYAG..HANGUL SYLLABLE CYAH\r\n\t\t(0xCC7D <= code && code <= 0xCC97) || // Lo  [27] HANGUL SYLLABLE CYAEG..HANGUL SYLLABLE CYAEH\r\n\t\t(0xCC99 <= code && code <= 0xCCB3) || // Lo  [27] HANGUL SYLLABLE CEOG..HANGUL SYLLABLE CEOH\r\n\t\t(0xCCB5 <= code && code <= 0xCCCF) || // Lo  [27] HANGUL SYLLABLE CEG..HANGUL SYLLABLE CEH\r\n\t\t(0xCCD1 <= code && code <= 0xCCEB) || // Lo  [27] HANGUL SYLLABLE CYEOG..HANGUL SYLLABLE CYEOH\r\n\t\t(0xCCED <= code && code <= 0xCD07) || // Lo  [27] HANGUL SYLLABLE CYEG..HANGUL SYLLABLE CYEH\r\n\t\t(0xCD09 <= code && code <= 0xCD23) || // Lo  [27] HANGUL SYLLABLE COG..HANGUL SYLLABLE COH\r\n\t\t(0xCD25 <= code && code <= 0xCD3F) || // Lo  [27] HANGUL SYLLABLE CWAG..HANGUL SYLLABLE CWAH\r\n\t\t(0xCD41 <= code && code <= 0xCD5B) || // Lo  [27] HANGUL SYLLABLE CWAEG..HANGUL SYLLABLE CWAEH\r\n\t\t(0xCD5D <= code && code <= 0xCD77) || // Lo  [27] HANGUL SYLLABLE COEG..HANGUL SYLLABLE COEH\r\n\t\t(0xCD79 <= code && code <= 0xCD93) || // Lo  [27] HANGUL SYLLABLE CYOG..HANGUL SYLLABLE CYOH\r\n\t\t(0xCD95 <= code && code <= 0xCDAF) || // Lo  [27] HANGUL SYLLABLE CUG..HANGUL SYLLABLE CUH\r\n\t\t(0xCDB1 <= code && code <= 0xCDCB) || // Lo  [27] HANGUL SYLLABLE CWEOG..HANGUL SYLLABLE CWEOH\r\n\t\t(0xCDCD <= code && code <= 0xCDE7) || // Lo  [27] HANGUL SYLLABLE CWEG..HANGUL SYLLABLE CWEH\r\n\t\t(0xCDE9 <= code && code <= 0xCE03) || // Lo  [27] HANGUL SYLLABLE CWIG..HANGUL SYLLABLE CWIH\r\n\t\t(0xCE05 <= code && code <= 0xCE1F) || // Lo  [27] HANGUL SYLLABLE CYUG..HANGUL SYLLABLE CYUH\r\n\t\t(0xCE21 <= code && code <= 0xCE3B) || // Lo  [27] HANGUL SYLLABLE CEUG..HANGUL SYLLABLE CEUH\r\n\t\t(0xCE3D <= code && code <= 0xCE57) || // Lo  [27] HANGUL SYLLABLE CYIG..HANGUL SYLLABLE CYIH\r\n\t\t(0xCE59 <= code && code <= 0xCE73) || // Lo  [27] HANGUL SYLLABLE CIG..HANGUL SYLLABLE CIH\r\n\t\t(0xCE75 <= code && code <= 0xCE8F) || // Lo  [27] HANGUL SYLLABLE KAG..HANGUL SYLLABLE KAH\r\n\t\t(0xCE91 <= code && code <= 0xCEAB) || // Lo  [27] HANGUL SYLLABLE KAEG..HANGUL SYLLABLE KAEH\r\n\t\t(0xCEAD <= code && code <= 0xCEC7) || // Lo  [27] HANGUL SYLLABLE KYAG..HANGUL SYLLABLE KYAH\r\n\t\t(0xCEC9 <= code && code <= 0xCEE3) || // Lo  [27] HANGUL SYLLABLE KYAEG..HANGUL SYLLABLE KYAEH\r\n\t\t(0xCEE5 <= code && code <= 0xCEFF) || // Lo  [27] HANGUL SYLLABLE KEOG..HANGUL SYLLABLE KEOH\r\n\t\t(0xCF01 <= code && code <= 0xCF1B) || // Lo  [27] HANGUL SYLLABLE KEG..HANGUL SYLLABLE KEH\r\n\t\t(0xCF1D <= code && code <= 0xCF37) || // Lo  [27] HANGUL SYLLABLE KYEOG..HANGUL SYLLABLE KYEOH\r\n\t\t(0xCF39 <= code && code <= 0xCF53) || // Lo  [27] HANGUL SYLLABLE KYEG..HANGUL SYLLABLE KYEH\r\n\t\t(0xCF55 <= code && code <= 0xCF6F) || // Lo  [27] HANGUL SYLLABLE KOG..HANGUL SYLLABLE KOH\r\n\t\t(0xCF71 <= code && code <= 0xCF8B) || // Lo  [27] HANGUL SYLLABLE KWAG..HANGUL SYLLABLE KWAH\r\n\t\t(0xCF8D <= code && code <= 0xCFA7) || // Lo  [27] HANGUL SYLLABLE KWAEG..HANGUL SYLLABLE KWAEH\r\n\t\t(0xCFA9 <= code && code <= 0xCFC3) || // Lo  [27] HANGUL SYLLABLE KOEG..HANGUL SYLLABLE KOEH\r\n\t\t(0xCFC5 <= code && code <= 0xCFDF) || // Lo  [27] HANGUL SYLLABLE KYOG..HANGUL SYLLABLE KYOH\r\n\t\t(0xCFE1 <= code && code <= 0xCFFB) || // Lo  [27] HANGUL SYLLABLE KUG..HANGUL SYLLABLE KUH\r\n\t\t(0xCFFD <= code && code <= 0xD017) || // Lo  [27] HANGUL SYLLABLE KWEOG..HANGUL SYLLABLE KWEOH\r\n\t\t(0xD019 <= code && code <= 0xD033) || // Lo  [27] HANGUL SYLLABLE KWEG..HANGUL SYLLABLE KWEH\r\n\t\t(0xD035 <= code && code <= 0xD04F) || // Lo  [27] HANGUL SYLLABLE KWIG..HANGUL SYLLABLE KWIH\r\n\t\t(0xD051 <= code && code <= 0xD06B) || // Lo  [27] HANGUL SYLLABLE KYUG..HANGUL SYLLABLE KYUH\r\n\t\t(0xD06D <= code && code <= 0xD087) || // Lo  [27] HANGUL SYLLABLE KEUG..HANGUL SYLLABLE KEUH\r\n\t\t(0xD089 <= code && code <= 0xD0A3) || // Lo  [27] HANGUL SYLLABLE KYIG..HANGUL SYLLABLE KYIH\r\n\t\t(0xD0A5 <= code && code <= 0xD0BF) || // Lo  [27] HANGUL SYLLABLE KIG..HANGUL SYLLABLE KIH\r\n\t\t(0xD0C1 <= code && code <= 0xD0DB) || // Lo  [27] HANGUL SYLLABLE TAG..HANGUL SYLLABLE TAH\r\n\t\t(0xD0DD <= code && code <= 0xD0F7) || // Lo  [27] HANGUL SYLLABLE TAEG..HANGUL SYLLABLE TAEH\r\n\t\t(0xD0F9 <= code && code <= 0xD113) || // Lo  [27] HANGUL SYLLABLE TYAG..HANGUL SYLLABLE TYAH\r\n\t\t(0xD115 <= code && code <= 0xD12F) || // Lo  [27] HANGUL SYLLABLE TYAEG..HANGUL SYLLABLE TYAEH\r\n\t\t(0xD131 <= code && code <= 0xD14B) || // Lo  [27] HANGUL SYLLABLE TEOG..HANGUL SYLLABLE TEOH\r\n\t\t(0xD14D <= code && code <= 0xD167) || // Lo  [27] HANGUL SYLLABLE TEG..HANGUL SYLLABLE TEH\r\n\t\t(0xD169 <= code && code <= 0xD183) || // Lo  [27] HANGUL SYLLABLE TYEOG..HANGUL SYLLABLE TYEOH\r\n\t\t(0xD185 <= code && code <= 0xD19F) || // Lo  [27] HANGUL SYLLABLE TYEG..HANGUL SYLLABLE TYEH\r\n\t\t(0xD1A1 <= code && code <= 0xD1BB) || // Lo  [27] HANGUL SYLLABLE TOG..HANGUL SYLLABLE TOH\r\n\t\t(0xD1BD <= code && code <= 0xD1D7) || // Lo  [27] HANGUL SYLLABLE TWAG..HANGUL SYLLABLE TWAH\r\n\t\t(0xD1D9 <= code && code <= 0xD1F3) || // Lo  [27] HANGUL SYLLABLE TWAEG..HANGUL SYLLABLE TWAEH\r\n\t\t(0xD1F5 <= code && code <= 0xD20F) || // Lo  [27] HANGUL SYLLABLE TOEG..HANGUL SYLLABLE TOEH\r\n\t\t(0xD211 <= code && code <= 0xD22B) || // Lo  [27] HANGUL SYLLABLE TYOG..HANGUL SYLLABLE TYOH\r\n\t\t(0xD22D <= code && code <= 0xD247) || // Lo  [27] HANGUL SYLLABLE TUG..HANGUL SYLLABLE TUH\r\n\t\t(0xD249 <= code && code <= 0xD263) || // Lo  [27] HANGUL SYLLABLE TWEOG..HANGUL SYLLABLE TWEOH\r\n\t\t(0xD265 <= code && code <= 0xD27F) || // Lo  [27] HANGUL SYLLABLE TWEG..HANGUL SYLLABLE TWEH\r\n\t\t(0xD281 <= code && code <= 0xD29B) || // Lo  [27] HANGUL SYLLABLE TWIG..HANGUL SYLLABLE TWIH\r\n\t\t(0xD29D <= code && code <= 0xD2B7) || // Lo  [27] HANGUL SYLLABLE TYUG..HANGUL SYLLABLE TYUH\r\n\t\t(0xD2B9 <= code && code <= 0xD2D3) || // Lo  [27] HANGUL SYLLABLE TEUG..HANGUL SYLLABLE TEUH\r\n\t\t(0xD2D5 <= code && code <= 0xD2EF) || // Lo  [27] HANGUL SYLLABLE TYIG..HANGUL SYLLABLE TYIH\r\n\t\t(0xD2F1 <= code && code <= 0xD30B) || // Lo  [27] HANGUL SYLLABLE TIG..HANGUL SYLLABLE TIH\r\n\t\t(0xD30D <= code && code <= 0xD327) || // Lo  [27] HANGUL SYLLABLE PAG..HANGUL SYLLABLE PAH\r\n\t\t(0xD329 <= code && code <= 0xD343) || // Lo  [27] HANGUL SYLLABLE PAEG..HANGUL SYLLABLE PAEH\r\n\t\t(0xD345 <= code && code <= 0xD35F) || // Lo  [27] HANGUL SYLLABLE PYAG..HANGUL SYLLABLE PYAH\r\n\t\t(0xD361 <= code && code <= 0xD37B) || // Lo  [27] HANGUL SYLLABLE PYAEG..HANGUL SYLLABLE PYAEH\r\n\t\t(0xD37D <= code && code <= 0xD397) || // Lo  [27] HANGUL SYLLABLE PEOG..HANGUL SYLLABLE PEOH\r\n\t\t(0xD399 <= code && code <= 0xD3B3) || // Lo  [27] HANGUL SYLLABLE PEG..HANGUL SYLLABLE PEH\r\n\t\t(0xD3B5 <= code && code <= 0xD3CF) || // Lo  [27] HANGUL SYLLABLE PYEOG..HANGUL SYLLABLE PYEOH\r\n\t\t(0xD3D1 <= code && code <= 0xD3EB) || // Lo  [27] HANGUL SYLLABLE PYEG..HANGUL SYLLABLE PYEH\r\n\t\t(0xD3ED <= code && code <= 0xD407) || // Lo  [27] HANGUL SYLLABLE POG..HANGUL SYLLABLE POH\r\n\t\t(0xD409 <= code && code <= 0xD423) || // Lo  [27] HANGUL SYLLABLE PWAG..HANGUL SYLLABLE PWAH\r\n\t\t(0xD425 <= code && code <= 0xD43F) || // Lo  [27] HANGUL SYLLABLE PWAEG..HANGUL SYLLABLE PWAEH\r\n\t\t(0xD441 <= code && code <= 0xD45B) || // Lo  [27] HANGUL SYLLABLE POEG..HANGUL SYLLABLE POEH\r\n\t\t(0xD45D <= code && code <= 0xD477) || // Lo  [27] HANGUL SYLLABLE PYOG..HANGUL SYLLABLE PYOH\r\n\t\t(0xD479 <= code && code <= 0xD493) || // Lo  [27] HANGUL SYLLABLE PUG..HANGUL SYLLABLE PUH\r\n\t\t(0xD495 <= code && code <= 0xD4AF) || // Lo  [27] HANGUL SYLLABLE PWEOG..HANGUL SYLLABLE PWEOH\r\n\t\t(0xD4B1 <= code && code <= 0xD4CB) || // Lo  [27] HANGUL SYLLABLE PWEG..HANGUL SYLLABLE PWEH\r\n\t\t(0xD4CD <= code && code <= 0xD4E7) || // Lo  [27] HANGUL SYLLABLE PWIG..HANGUL SYLLABLE PWIH\r\n\t\t(0xD4E9 <= code && code <= 0xD503) || // Lo  [27] HANGUL SYLLABLE PYUG..HANGUL SYLLABLE PYUH\r\n\t\t(0xD505 <= code && code <= 0xD51F) || // Lo  [27] HANGUL SYLLABLE PEUG..HANGUL SYLLABLE PEUH\r\n\t\t(0xD521 <= code && code <= 0xD53B) || // Lo  [27] HANGUL SYLLABLE PYIG..HANGUL SYLLABLE PYIH\r\n\t\t(0xD53D <= code && code <= 0xD557) || // Lo  [27] HANGUL SYLLABLE PIG..HANGUL SYLLABLE PIH\r\n\t\t(0xD559 <= code && code <= 0xD573) || // Lo  [27] HANGUL SYLLABLE HAG..HANGUL SYLLABLE HAH\r\n\t\t(0xD575 <= code && code <= 0xD58F) || // Lo  [27] HANGUL SYLLABLE HAEG..HANGUL SYLLABLE HAEH\r\n\t\t(0xD591 <= code && code <= 0xD5AB) || // Lo  [27] HANGUL SYLLABLE HYAG..HANGUL SYLLABLE HYAH\r\n\t\t(0xD5AD <= code && code <= 0xD5C7) || // Lo  [27] HANGUL SYLLABLE HYAEG..HANGUL SYLLABLE HYAEH\r\n\t\t(0xD5C9 <= code && code <= 0xD5E3) || // Lo  [27] HANGUL SYLLABLE HEOG..HANGUL SYLLABLE HEOH\r\n\t\t(0xD5E5 <= code && code <= 0xD5FF) || // Lo  [27] HANGUL SYLLABLE HEG..HANGUL SYLLABLE HEH\r\n\t\t(0xD601 <= code && code <= 0xD61B) || // Lo  [27] HANGUL SYLLABLE HYEOG..HANGUL SYLLABLE HYEOH\r\n\t\t(0xD61D <= code && code <= 0xD637) || // Lo  [27] HANGUL SYLLABLE HYEG..HANGUL SYLLABLE HYEH\r\n\t\t(0xD639 <= code && code <= 0xD653) || // Lo  [27] HANGUL SYLLABLE HOG..HANGUL SYLLABLE HOH\r\n\t\t(0xD655 <= code && code <= 0xD66F) || // Lo  [27] HANGUL SYLLABLE HWAG..HANGUL SYLLABLE HWAH\r\n\t\t(0xD671 <= code && code <= 0xD68B) || // Lo  [27] HANGUL SYLLABLE HWAEG..HANGUL SYLLABLE HWAEH\r\n\t\t(0xD68D <= code && code <= 0xD6A7) || // Lo  [27] HANGUL SYLLABLE HOEG..HANGUL SYLLABLE HOEH\r\n\t\t(0xD6A9 <= code && code <= 0xD6C3) || // Lo  [27] HANGUL SYLLABLE HYOG..HANGUL SYLLABLE HYOH\r\n\t\t(0xD6C5 <= code && code <= 0xD6DF) || // Lo  [27] HANGUL SYLLABLE HUG..HANGUL SYLLABLE HUH\r\n\t\t(0xD6E1 <= code && code <= 0xD6FB) || // Lo  [27] HANGUL SYLLABLE HWEOG..HANGUL SYLLABLE HWEOH\r\n\t\t(0xD6FD <= code && code <= 0xD717) || // Lo  [27] HANGUL SYLLABLE HWEG..HANGUL SYLLABLE HWEH\r\n\t\t(0xD719 <= code && code <= 0xD733) || // Lo  [27] HANGUL SYLLABLE HWIG..HANGUL SYLLABLE HWIH\r\n\t\t(0xD735 <= code && code <= 0xD74F) || // Lo  [27] HANGUL SYLLABLE HYUG..HANGUL SYLLABLE HYUH\r\n\t\t(0xD751 <= code && code <= 0xD76B) || // Lo  [27] HANGUL SYLLABLE HEUG..HANGUL SYLLABLE HEUH\r\n\t\t(0xD76D <= code && code <= 0xD787) || // Lo  [27] HANGUL SYLLABLE HYIG..HANGUL SYLLABLE HYIH\r\n\t\t(0xD789 <= code && code <= 0xD7A3) // Lo  [27] HANGUL SYLLABLE HIG..HANGUL SYLLABLE HIH\r\n\t\t){\r\n\t\t\treturn LVT;\r\n\t\t}\r\n\t\t\r\n\t\tif(\r\n\t\t0x261D == code || // So       WHITE UP POINTING INDEX\r\n\t\t0x26F9 == code || // So       PERSON WITH BALL\r\n\t\t(0x270A <= code && code <= 0x270D) || // So   [4] RAISED FIST..WRITING HAND\r\n\t\t0x1F385 == code || // So       FATHER CHRISTMAS\r\n\t\t(0x1F3C2 <= code && code <= 0x1F3C4) || // So   [3] SNOWBOARDER..SURFER\r\n\t\t0x1F3C7 == code || // So       HORSE RACING\r\n\t\t(0x1F3CA <= code && code <= 0x1F3CC) || // So   [3] SWIMMER..GOLFER\r\n\t\t(0x1F442 <= code && code <= 0x1F443) || // So   [2] EAR..NOSE\r\n\t\t(0x1F446 <= code && code <= 0x1F450) || // So  [11] WHITE UP POINTING BACKHAND INDEX..OPEN HANDS SIGN\r\n\t\t0x1F46E == code || // So       POLICE OFFICER\r\n\t\t(0x1F470 <= code && code <= 0x1F478) || // So   [9] BRIDE WITH VEIL..PRINCESS\r\n\t\t0x1F47C == code || // So       BABY ANGEL\r\n\t\t(0x1F481 <= code && code <= 0x1F483) || // So   [3] INFORMATION DESK PERSON..DANCER\r\n\t\t(0x1F485 <= code && code <= 0x1F487) || // So   [3] NAIL POLISH..HAIRCUT\r\n\t\t0x1F4AA == code || // So       FLEXED BICEPS\r\n\t\t(0x1F574 <= code && code <= 0x1F575) || // So   [2] MAN IN BUSINESS SUIT LEVITATING..SLEUTH OR SPY\r\n\t\t0x1F57A == code || // So       MAN DANCING\r\n\t\t0x1F590 == code || // So       RAISED HAND WITH FINGERS SPLAYED\r\n\t\t(0x1F595 <= code && code <= 0x1F596) || // So   [2] REVERSED HAND WITH MIDDLE FINGER EXTENDED..RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS\r\n\t\t(0x1F645 <= code && code <= 0x1F647) || // So   [3] FACE WITH NO GOOD GESTURE..PERSON BOWING DEEPLY\r\n\t\t(0x1F64B <= code && code <= 0x1F64F) || // So   [5] HAPPY PERSON RAISING ONE HAND..PERSON WITH FOLDED HANDS\r\n\t\t0x1F6A3 == code || // So       ROWBOAT\r\n\t\t(0x1F6B4 <= code && code <= 0x1F6B6) || // So   [3] BICYCLIST..PEDESTRIAN\r\n\t\t0x1F6C0 == code || // So       BATH\r\n\t\t0x1F6CC == code || // So       SLEEPING ACCOMMODATION\r\n\t\t(0x1F918 <= code && code <= 0x1F91C) || // So   [5] SIGN OF THE HORNS..RIGHT-FACING FIST\r\n\t\t(0x1F91E <= code && code <= 0x1F91F) || // So   [2] HAND WITH INDEX AND MIDDLE FINGERS CROSSED..I LOVE YOU HAND SIGN\r\n\t\t0x1F926 == code || // So       FACE PALM\r\n\t\t(0x1F930 <= code && code <= 0x1F939) || // So  [10] PREGNANT WOMAN..JUGGLING\r\n\t\t(0x1F93D <= code && code <= 0x1F93E) || // So   [2] WATER POLO..HANDBALL\r\n\t\t(0x1F9D1 <= code && code <= 0x1F9DD) // So  [13] ADULT..ELF\r\n\t\t){\r\n\t\t\treturn E_Base;\r\n\t\t}\r\n\r\n\t\tif(\r\n\t\t(0x1F3FB <= code && code <= 0x1F3FF) // Sk   [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6\r\n\t\t){\r\n\t\t\treturn E_Modifier;\r\n\t\t}\r\n\r\n\t\tif(\r\n\t\t0x200D == code // Cf       ZERO WIDTH JOINER\r\n\t\t){\r\n\t\t\treturn ZWJ;\r\n\t\t}\r\n\r\n\t\tif(\r\n\t\t0x2640 == code || // So       FEMALE SIGN\r\n\t\t0x2642 == code || // So       MALE SIGN\r\n\t\t(0x2695 <= code && code <= 0x2696) || // So   [2] STAFF OF AESCULAPIUS..SCALES\r\n\t\t0x2708 == code || // So       AIRPLANE\r\n\t\t0x2764 == code || // So       HEAVY BLACK HEART\r\n\t\t0x1F308 == code || // So       RAINBOW\r\n\t\t0x1F33E == code || // So       EAR OF RICE\r\n\t\t0x1F373 == code || // So       COOKING\r\n\t\t0x1F393 == code || // So       GRADUATION CAP\r\n\t\t0x1F3A4 == code || // So       MICROPHONE\r\n\t\t0x1F3A8 == code || // So       ARTIST PALETTE\r\n\t\t0x1F3EB == code || // So       SCHOOL\r\n\t\t0x1F3ED == code || // So       FACTORY\r\n\t\t0x1F48B == code || // So       KISS MARK\r\n\t\t(0x1F4BB <= code && code <= 0x1F4BC) || // So   [2] PERSONAL COMPUTER..BRIEFCASE\r\n\t\t0x1F527 == code || // So       WRENCH\r\n\t\t0x1F52C == code || // So       MICROSCOPE\r\n\t\t0x1F5E8 == code || // So       LEFT SPEECH BUBBLE\r\n\t\t0x1F680 == code || // So       ROCKET\r\n\t\t0x1F692 == code // So       FIRE ENGINE\r\n\t\t){\r\n\t\t\treturn Glue_After_Zwj;\r\n\t\t}\r\n\r\n\t\tif(\r\n\t\t(0x1F466 <= code && code <= 0x1F469) // So   [4] BOY..WOMAN\r\n\t\t){\r\n\t\t\treturn E_Base_GAZ;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//all unlisted characters have a grapheme break property of \"Other\"\r\n\t\treturn Other;\r\n\t}\r\n\treturn this;\r\n}\r\n\r\nif (typeof module != 'undefined' && module.exports) {\r\n    module.exports = GraphemeSplitter;\r\n}\r\n", "'use strict';\n\nmodule.exports = earcut;\nmodule.exports.default = earcut;\n\nfunction earcut(data, holeIndices, dim) {\n\n    dim = dim || 2;\n\n    var hasHoles = holeIndices && holeIndices.length,\n        outerLen = hasHoles ? holeIndices[0] * dim : data.length,\n        outerNode = linkedList(data, 0, outerLen, dim, true),\n        triangles = [];\n\n    if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n    var minX, minY, maxX, maxY, x, y, invSize;\n\n    if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n    // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n    if (data.length > 80 * dim) {\n        minX = maxX = data[0];\n        minY = maxY = data[1];\n\n        for (var i = dim; i < outerLen; i += dim) {\n            x = data[i];\n            y = data[i + 1];\n            if (x < minX) minX = x;\n            if (y < minY) minY = y;\n            if (x > maxX) maxX = x;\n            if (y > maxY) maxY = y;\n        }\n\n        // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n        invSize = Math.max(maxX - minX, maxY - minY);\n        invSize = invSize !== 0 ? 32767 / invSize : 0;\n    }\n\n    earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);\n\n    return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n    var i, last;\n\n    if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n        for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n    } else {\n        for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n    }\n\n    if (last && equals(last, last.next)) {\n        removeNode(last);\n        last = last.next;\n    }\n\n    return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n    if (!start) return start;\n    if (!end) end = start;\n\n    var p = start,\n        again;\n    do {\n        again = false;\n\n        if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n            removeNode(p);\n            p = end = p.prev;\n            if (p === p.next) break;\n            again = true;\n\n        } else {\n            p = p.next;\n        }\n    } while (again || p !== end);\n\n    return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n    if (!ear) return;\n\n    // interlink polygon nodes in z-order\n    if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n    var stop = ear,\n        prev, next;\n\n    // iterate through ears, slicing them one by one\n    while (ear.prev !== ear.next) {\n        prev = ear.prev;\n        next = ear.next;\n\n        if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n            // cut off the triangle\n            triangles.push(prev.i / dim | 0);\n            triangles.push(ear.i / dim | 0);\n            triangles.push(next.i / dim | 0);\n\n            removeNode(ear);\n\n            // skipping the next vertex leads to less sliver triangles\n            ear = next.next;\n            stop = next.next;\n\n            continue;\n        }\n\n        ear = next;\n\n        // if we looped through the whole remaining polygon and can't find any more ears\n        if (ear === stop) {\n            // try filtering points and slicing again\n            if (!pass) {\n                earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n            // if this didn't work, try curing all small self-intersections locally\n            } else if (pass === 1) {\n                ear = cureLocalIntersections(filterPoints(ear), triangles, dim);\n                earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n            // as a last resort, try splitting the remaining polygon into two\n            } else if (pass === 2) {\n                splitEarcut(ear, triangles, dim, minX, minY, invSize);\n            }\n\n            break;\n        }\n    }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n    var a = ear.prev,\n        b = ear,\n        c = ear.next;\n\n    if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n    // now make sure we don't have other points inside the potential ear\n    var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n    // triangle bbox; min & max are calculated like this for speed\n    var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n        y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n        x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n        y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n    var p = c.next;\n    while (p !== a) {\n        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&\n            pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) &&\n            area(p.prev, p, p.next) >= 0) return false;\n        p = p.next;\n    }\n\n    return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n    var a = ear.prev,\n        b = ear,\n        c = ear.next;\n\n    if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n    var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n    // triangle bbox; min & max are calculated like this for speed\n    var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n        y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n        x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n        y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n    // z-order range for the current triangle bbox;\n    var minZ = zOrder(x0, y0, minX, minY, invSize),\n        maxZ = zOrder(x1, y1, minX, minY, invSize);\n\n    var p = ear.prevZ,\n        n = ear.nextZ;\n\n    // look for points inside the triangle in both directions\n    while (p && p.z >= minZ && n && n.z <= maxZ) {\n        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n            pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n        p = p.prevZ;\n\n        if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n            pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n        n = n.nextZ;\n    }\n\n    // look for remaining points in decreasing z-order\n    while (p && p.z >= minZ) {\n        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n            pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n        p = p.prevZ;\n    }\n\n    // look for remaining points in increasing z-order\n    while (n && n.z <= maxZ) {\n        if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n            pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n        n = n.nextZ;\n    }\n\n    return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles, dim) {\n    var p = start;\n    do {\n        var a = p.prev,\n            b = p.next.next;\n\n        if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n            triangles.push(a.i / dim | 0);\n            triangles.push(p.i / dim | 0);\n            triangles.push(b.i / dim | 0);\n\n            // remove two nodes involved\n            removeNode(p);\n            removeNode(p.next);\n\n            p = start = b;\n        }\n        p = p.next;\n    } while (p !== start);\n\n    return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n    // look for a valid diagonal that divides the polygon into two\n    var a = start;\n    do {\n        var b = a.next.next;\n        while (b !== a.prev) {\n            if (a.i !== b.i && isValidDiagonal(a, b)) {\n                // split the polygon in two by the diagonal\n                var c = splitPolygon(a, b);\n\n                // filter colinear points around the cuts\n                a = filterPoints(a, a.next);\n                c = filterPoints(c, c.next);\n\n                // run earcut on each half\n                earcutLinked(a, triangles, dim, minX, minY, invSize, 0);\n                earcutLinked(c, triangles, dim, minX, minY, invSize, 0);\n                return;\n            }\n            b = b.next;\n        }\n        a = a.next;\n    } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n    var queue = [],\n        i, len, start, end, list;\n\n    for (i = 0, len = holeIndices.length; i < len; i++) {\n        start = holeIndices[i] * dim;\n        end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n        list = linkedList(data, start, end, dim, false);\n        if (list === list.next) list.steiner = true;\n        queue.push(getLeftmost(list));\n    }\n\n    queue.sort(compareX);\n\n    // process holes from left to right\n    for (i = 0; i < queue.length; i++) {\n        outerNode = eliminateHole(queue[i], outerNode);\n    }\n\n    return outerNode;\n}\n\nfunction compareX(a, b) {\n    return a.x - b.x;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n    var bridge = findHoleBridge(hole, outerNode);\n    if (!bridge) {\n        return outerNode;\n    }\n\n    var bridgeReverse = splitPolygon(bridge, hole);\n\n    // filter collinear points around the cuts\n    filterPoints(bridgeReverse, bridgeReverse.next);\n    return filterPoints(bridge, bridge.next);\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n    var p = outerNode,\n        hx = hole.x,\n        hy = hole.y,\n        qx = -Infinity,\n        m;\n\n    // find a segment intersected by a ray from the hole's leftmost point to the left;\n    // segment's endpoint with lesser x will be potential connection point\n    do {\n        if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n            var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n            if (x <= hx && x > qx) {\n                qx = x;\n                m = p.x < p.next.x ? p : p.next;\n                if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint\n            }\n        }\n        p = p.next;\n    } while (p !== outerNode);\n\n    if (!m) return null;\n\n    // look for points inside the triangle of hole point, segment intersection and endpoint;\n    // if there are no points found, we have a valid connection;\n    // otherwise choose the point of the minimum angle with the ray as connection point\n\n    var stop = m,\n        mx = m.x,\n        my = m.y,\n        tanMin = Infinity,\n        tan;\n\n    p = m;\n\n    do {\n        if (hx >= p.x && p.x >= mx && hx !== p.x &&\n                pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n            tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n            if (locallyInside(p, hole) &&\n                (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n                m = p;\n                tanMin = tan;\n            }\n        }\n\n        p = p.next;\n    } while (p !== stop);\n\n    return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n    return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n    var p = start;\n    do {\n        if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n        p.prevZ = p.prev;\n        p.nextZ = p.next;\n        p = p.next;\n    } while (p !== start);\n\n    p.prevZ.nextZ = null;\n    p.prevZ = null;\n\n    sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n    var i, p, q, e, tail, numMerges, pSize, qSize,\n        inSize = 1;\n\n    do {\n        p = list;\n        list = null;\n        tail = null;\n        numMerges = 0;\n\n        while (p) {\n            numMerges++;\n            q = p;\n            pSize = 0;\n            for (i = 0; i < inSize; i++) {\n                pSize++;\n                q = q.nextZ;\n                if (!q) break;\n            }\n            qSize = inSize;\n\n            while (pSize > 0 || (qSize > 0 && q)) {\n\n                if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n                    e = p;\n                    p = p.nextZ;\n                    pSize--;\n                } else {\n                    e = q;\n                    q = q.nextZ;\n                    qSize--;\n                }\n\n                if (tail) tail.nextZ = e;\n                else list = e;\n\n                e.prevZ = tail;\n                tail = e;\n            }\n\n            p = q;\n        }\n\n        tail.nextZ = null;\n        inSize *= 2;\n\n    } while (numMerges > 1);\n\n    return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n    // coords are transformed into non-negative 15-bit integer range\n    x = (x - minX) * invSize | 0;\n    y = (y - minY) * invSize | 0;\n\n    x = (x | (x << 8)) & 0x00FF00FF;\n    x = (x | (x << 4)) & 0x0F0F0F0F;\n    x = (x | (x << 2)) & 0x33333333;\n    x = (x | (x << 1)) & 0x55555555;\n\n    y = (y | (y << 8)) & 0x00FF00FF;\n    y = (y | (y << 4)) & 0x0F0F0F0F;\n    y = (y | (y << 2)) & 0x33333333;\n    y = (y | (y << 1)) & 0x55555555;\n\n    return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n    var p = start,\n        leftmost = start;\n    do {\n        if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n        p = p.next;\n    } while (p !== start);\n\n    return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n    return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&\n           (ax - px) * (by - py) >= (bx - px) * (ay - py) &&\n           (bx - px) * (cy - py) >= (cx - px) * (by - py);\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n    return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges\n           (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n            (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n            equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n    return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n    return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n    var o1 = sign(area(p1, q1, p2));\n    var o2 = sign(area(p1, q1, q2));\n    var o3 = sign(area(p2, q2, p1));\n    var o4 = sign(area(p2, q2, q1));\n\n    if (o1 !== o2 && o3 !== o4) return true; // general case\n\n    if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n    if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n    if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n    if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n    return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n    return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n    return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n    var p = a;\n    do {\n        if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n                intersects(p, p.next, a, b)) return true;\n        p = p.next;\n    } while (p !== a);\n\n    return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n    return area(a.prev, a, a.next) < 0 ?\n        area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n        area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n    var p = a,\n        inside = false,\n        px = (a.x + b.x) / 2,\n        py = (a.y + b.y) / 2;\n    do {\n        if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n                (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n            inside = !inside;\n        p = p.next;\n    } while (p !== a);\n\n    return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n    var a2 = new Node(a.i, a.x, a.y),\n        b2 = new Node(b.i, b.x, b.y),\n        an = a.next,\n        bp = b.prev;\n\n    a.next = b;\n    b.prev = a;\n\n    a2.next = an;\n    an.prev = a2;\n\n    b2.next = a2;\n    a2.prev = b2;\n\n    bp.next = b2;\n    b2.prev = bp;\n\n    return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n    var p = new Node(i, x, y);\n\n    if (!last) {\n        p.prev = p;\n        p.next = p;\n\n    } else {\n        p.next = last.next;\n        p.prev = last;\n        last.next.prev = p;\n        last.next = p;\n    }\n    return p;\n}\n\nfunction removeNode(p) {\n    p.next.prev = p.prev;\n    p.prev.next = p.next;\n\n    if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n    if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction Node(i, x, y) {\n    // vertex index in coordinates array\n    this.i = i;\n\n    // vertex coordinates\n    this.x = x;\n    this.y = y;\n\n    // previous and next vertex nodes in a polygon ring\n    this.prev = null;\n    this.next = null;\n\n    // z-order curve value\n    this.z = 0;\n\n    // previous and next nodes in z-order\n    this.prevZ = null;\n    this.nextZ = null;\n\n    // indicates whether this is a steiner point\n    this.steiner = false;\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nearcut.deviation = function (data, holeIndices, dim, triangles) {\n    var hasHoles = holeIndices && holeIndices.length;\n    var outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n    var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n    if (hasHoles) {\n        for (var i = 0, len = holeIndices.length; i < len; i++) {\n            var start = holeIndices[i] * dim;\n            var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n            polygonArea -= Math.abs(signedArea(data, start, end, dim));\n        }\n    }\n\n    var trianglesArea = 0;\n    for (i = 0; i < triangles.length; i += 3) {\n        var a = triangles[i] * dim;\n        var b = triangles[i + 1] * dim;\n        var c = triangles[i + 2] * dim;\n        trianglesArea += Math.abs(\n            (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n            (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n    }\n\n    return polygonArea === 0 && trianglesArea === 0 ? 0 :\n        Math.abs((trianglesArea - polygonArea) / polygonArea);\n};\n\nfunction signedArea(data, start, end, dim) {\n    var sum = 0;\n    for (var i = start, j = end - dim; i < end; i += dim) {\n        sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n        j = i;\n    }\n    return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nearcut.flatten = function (data) {\n    var dim = data[0][0].length,\n        result = {vertices: [], holes: [], dimensions: dim},\n        holeIndex = 0;\n\n    for (var i = 0; i < data.length; i++) {\n        for (var j = 0; j < data[i].length; j++) {\n            for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);\n        }\n        if (i > 0) {\n            holeIndex += data[i - 1].length;\n            result.holes.push(holeIndex);\n        }\n    }\n    return result;\n};\n", "(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\ntypeof define === 'function' && define.amd ? define(factory) :\n(global = global || self, global.RBush = factory());\n}(this, function () { 'use strict';\n\nfunction quickselect(arr, k, left, right, compare) {\n    quickselectStep(arr, k, left || 0, right || (arr.length - 1), compare || defaultCompare);\n}\n\nfunction quickselectStep(arr, k, left, right, compare) {\n\n    while (right > left) {\n        if (right - left > 600) {\n            var n = right - left + 1;\n            var m = k - left + 1;\n            var z = Math.log(n);\n            var s = 0.5 * Math.exp(2 * z / 3);\n            var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n            var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n            var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n            quickselectStep(arr, k, newLeft, newRight, compare);\n        }\n\n        var t = arr[k];\n        var i = left;\n        var j = right;\n\n        swap(arr, left, k);\n        if (compare(arr[right], t) > 0) { swap(arr, left, right); }\n\n        while (i < j) {\n            swap(arr, i, j);\n            i++;\n            j--;\n            while (compare(arr[i], t) < 0) { i++; }\n            while (compare(arr[j], t) > 0) { j--; }\n        }\n\n        if (compare(arr[left], t) === 0) { swap(arr, left, j); }\n        else {\n            j++;\n            swap(arr, j, right);\n        }\n\n        if (j <= k) { left = j + 1; }\n        if (k <= j) { right = j - 1; }\n    }\n}\n\nfunction swap(arr, i, j) {\n    var tmp = arr[i];\n    arr[i] = arr[j];\n    arr[j] = tmp;\n}\n\nfunction defaultCompare(a, b) {\n    return a < b ? -1 : a > b ? 1 : 0;\n}\n\nvar RBush = function RBush(maxEntries) {\n    if ( maxEntries === void 0 ) maxEntries = 9;\n\n    // max entries in a node is 9 by default; min node fill is 40% for best performance\n    this._maxEntries = Math.max(4, maxEntries);\n    this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));\n    this.clear();\n};\n\nRBush.prototype.all = function all () {\n    return this._all(this.data, []);\n};\n\nRBush.prototype.search = function search (bbox) {\n    var node = this.data;\n    var result = [];\n\n    if (!intersects(bbox, node)) { return result; }\n\n    var toBBox = this.toBBox;\n    var nodesToSearch = [];\n\n    while (node) {\n        for (var i = 0; i < node.children.length; i++) {\n            var child = node.children[i];\n            var childBBox = node.leaf ? toBBox(child) : child;\n\n            if (intersects(bbox, childBBox)) {\n                if (node.leaf) { result.push(child); }\n                else if (contains(bbox, childBBox)) { this._all(child, result); }\n                else { nodesToSearch.push(child); }\n            }\n        }\n        node = nodesToSearch.pop();\n    }\n\n    return result;\n};\n\nRBush.prototype.collides = function collides (bbox) {\n    var node = this.data;\n\n    if (!intersects(bbox, node)) { return false; }\n\n    var nodesToSearch = [];\n    while (node) {\n        for (var i = 0; i < node.children.length; i++) {\n            var child = node.children[i];\n            var childBBox = node.leaf ? this.toBBox(child) : child;\n\n            if (intersects(bbox, childBBox)) {\n                if (node.leaf || contains(bbox, childBBox)) { return true; }\n                nodesToSearch.push(child);\n            }\n        }\n        node = nodesToSearch.pop();\n    }\n\n    return false;\n};\n\nRBush.prototype.load = function load (data) {\n    if (!(data && data.length)) { return this; }\n\n    if (data.length < this._minEntries) {\n        for (var i = 0; i < data.length; i++) {\n            this.insert(data[i]);\n        }\n        return this;\n    }\n\n    // recursively build the tree with the given data from scratch using OMT algorithm\n    var node = this._build(data.slice(), 0, data.length - 1, 0);\n\n    if (!this.data.children.length) {\n        // save as is if tree is empty\n        this.data = node;\n\n    } else if (this.data.height === node.height) {\n        // split root if trees have the same height\n        this._splitRoot(this.data, node);\n\n    } else {\n        if (this.data.height < node.height) {\n            // swap trees if inserted one is bigger\n            var tmpNode = this.data;\n            this.data = node;\n            node = tmpNode;\n        }\n\n        // insert the small tree into the large tree at appropriate level\n        this._insert(node, this.data.height - node.height - 1, true);\n    }\n\n    return this;\n};\n\nRBush.prototype.insert = function insert (item) {\n    if (item) { this._insert(item, this.data.height - 1); }\n    return this;\n};\n\nRBush.prototype.clear = function clear () {\n    this.data = createNode([]);\n    return this;\n};\n\nRBush.prototype.remove = function remove (item, equalsFn) {\n    if (!item) { return this; }\n\n    var node = this.data;\n    var bbox = this.toBBox(item);\n    var path = [];\n    var indexes = [];\n    var i, parent, goingUp;\n\n    // depth-first iterative tree traversal\n    while (node || path.length) {\n\n        if (!node) { // go up\n            node = path.pop();\n            parent = path[path.length - 1];\n            i = indexes.pop();\n            goingUp = true;\n        }\n\n        if (node.leaf) { // check current node\n            var index = findItem(item, node.children, equalsFn);\n\n            if (index !== -1) {\n                // item found, remove the item and condense tree upwards\n                node.children.splice(index, 1);\n                path.push(node);\n                this._condense(path);\n                return this;\n            }\n        }\n\n        if (!goingUp && !node.leaf && contains(node, bbox)) { // go down\n            path.push(node);\n            indexes.push(i);\n            i = 0;\n            parent = node;\n            node = node.children[0];\n\n        } else if (parent) { // go right\n            i++;\n            node = parent.children[i];\n            goingUp = false;\n\n        } else { node = null; } // nothing found\n    }\n\n    return this;\n};\n\nRBush.prototype.toBBox = function toBBox (item) { return item; };\n\nRBush.prototype.compareMinX = function compareMinX (a, b) { return a.minX - b.minX; };\nRBush.prototype.compareMinY = function compareMinY (a, b) { return a.minY - b.minY; };\n\nRBush.prototype.toJSON = function toJSON () { return this.data; };\n\nRBush.prototype.fromJSON = function fromJSON (data) {\n    this.data = data;\n    return this;\n};\n\nRBush.prototype._all = function _all (node, result) {\n    var nodesToSearch = [];\n    while (node) {\n        if (node.leaf) { result.push.apply(result, node.children); }\n        else { nodesToSearch.push.apply(nodesToSearch, node.children); }\n\n        node = nodesToSearch.pop();\n    }\n    return result;\n};\n\nRBush.prototype._build = function _build (items, left, right, height) {\n\n    var N = right - left + 1;\n    var M = this._maxEntries;\n    var node;\n\n    if (N <= M) {\n        // reached leaf level; return leaf\n        node = createNode(items.slice(left, right + 1));\n        calcBBox(node, this.toBBox);\n        return node;\n    }\n\n    if (!height) {\n        // target height of the bulk-loaded tree\n        height = Math.ceil(Math.log(N) / Math.log(M));\n\n        // target number of root entries to maximize storage utilization\n        M = Math.ceil(N / Math.pow(M, height - 1));\n    }\n\n    node = createNode([]);\n    node.leaf = false;\n    node.height = height;\n\n    // split the items into M mostly square tiles\n\n    var N2 = Math.ceil(N / M);\n    var N1 = N2 * Math.ceil(Math.sqrt(M));\n\n    multiSelect(items, left, right, N1, this.compareMinX);\n\n    for (var i = left; i <= right; i += N1) {\n\n        var right2 = Math.min(i + N1 - 1, right);\n\n        multiSelect(items, i, right2, N2, this.compareMinY);\n\n        for (var j = i; j <= right2; j += N2) {\n\n            var right3 = Math.min(j + N2 - 1, right2);\n\n            // pack each entry recursively\n            node.children.push(this._build(items, j, right3, height - 1));\n        }\n    }\n\n    calcBBox(node, this.toBBox);\n\n    return node;\n};\n\nRBush.prototype._chooseSubtree = function _chooseSubtree (bbox, node, level, path) {\n    while (true) {\n        path.push(node);\n\n        if (node.leaf || path.length - 1 === level) { break; }\n\n        var minArea = Infinity;\n        var minEnlargement = Infinity;\n        var targetNode = (void 0);\n\n        for (var i = 0; i < node.children.length; i++) {\n            var child = node.children[i];\n            var area = bboxArea(child);\n            var enlargement = enlargedArea(bbox, child) - area;\n\n            // choose entry with the least area enlargement\n            if (enlargement < minEnlargement) {\n                minEnlargement = enlargement;\n                minArea = area < minArea ? area : minArea;\n                targetNode = child;\n\n            } else if (enlargement === minEnlargement) {\n                // otherwise choose one with the smallest area\n                if (area < minArea) {\n                    minArea = area;\n                    targetNode = child;\n                }\n            }\n        }\n\n        node = targetNode || node.children[0];\n    }\n\n    return node;\n};\n\nRBush.prototype._insert = function _insert (item, level, isNode) {\n    var bbox = isNode ? item : this.toBBox(item);\n    var insertPath = [];\n\n    // find the best node for accommodating the item, saving all nodes along the path too\n    var node = this._chooseSubtree(bbox, this.data, level, insertPath);\n\n    // put the item into the node\n    node.children.push(item);\n    extend(node, bbox);\n\n    // split on node overflow; propagate upwards if necessary\n    while (level >= 0) {\n        if (insertPath[level].children.length > this._maxEntries) {\n            this._split(insertPath, level);\n            level--;\n        } else { break; }\n    }\n\n    // adjust bboxes along the insertion path\n    this._adjustParentBBoxes(bbox, insertPath, level);\n};\n\n// split overflowed node into two\nRBush.prototype._split = function _split (insertPath, level) {\n    var node = insertPath[level];\n    var M = node.children.length;\n    var m = this._minEntries;\n\n    this._chooseSplitAxis(node, m, M);\n\n    var splitIndex = this._chooseSplitIndex(node, m, M);\n\n    var newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));\n    newNode.height = node.height;\n    newNode.leaf = node.leaf;\n\n    calcBBox(node, this.toBBox);\n    calcBBox(newNode, this.toBBox);\n\n    if (level) { insertPath[level - 1].children.push(newNode); }\n    else { this._splitRoot(node, newNode); }\n};\n\nRBush.prototype._splitRoot = function _splitRoot (node, newNode) {\n    // split root node\n    this.data = createNode([node, newNode]);\n    this.data.height = node.height + 1;\n    this.data.leaf = false;\n    calcBBox(this.data, this.toBBox);\n};\n\nRBush.prototype._chooseSplitIndex = function _chooseSplitIndex (node, m, M) {\n    var index;\n    var minOverlap = Infinity;\n    var minArea = Infinity;\n\n    for (var i = m; i <= M - m; i++) {\n        var bbox1 = distBBox(node, 0, i, this.toBBox);\n        var bbox2 = distBBox(node, i, M, this.toBBox);\n\n        var overlap = intersectionArea(bbox1, bbox2);\n        var area = bboxArea(bbox1) + bboxArea(bbox2);\n\n        // choose distribution with minimum overlap\n        if (overlap < minOverlap) {\n            minOverlap = overlap;\n            index = i;\n\n            minArea = area < minArea ? area : minArea;\n\n        } else if (overlap === minOverlap) {\n            // otherwise choose distribution with minimum area\n            if (area < minArea) {\n                minArea = area;\n                index = i;\n            }\n        }\n    }\n\n    return index || M - m;\n};\n\n// sorts node children by the best axis for split\nRBush.prototype._chooseSplitAxis = function _chooseSplitAxis (node, m, M) {\n    var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX;\n    var compareMinY = node.leaf ? this.compareMinY : compareNodeMinY;\n    var xMargin = this._allDistMargin(node, m, M, compareMinX);\n    var yMargin = this._allDistMargin(node, m, M, compareMinY);\n\n    // if total distributions margin value is minimal for x, sort by minX,\n    // otherwise it's already sorted by minY\n    if (xMargin < yMargin) { node.children.sort(compareMinX); }\n};\n\n// total margin of all possible split distributions where each node is at least m full\nRBush.prototype._allDistMargin = function _allDistMargin (node, m, M, compare) {\n    node.children.sort(compare);\n\n    var toBBox = this.toBBox;\n    var leftBBox = distBBox(node, 0, m, toBBox);\n    var rightBBox = distBBox(node, M - m, M, toBBox);\n    var margin = bboxMargin(leftBBox) + bboxMargin(rightBBox);\n\n    for (var i = m; i < M - m; i++) {\n        var child = node.children[i];\n        extend(leftBBox, node.leaf ? toBBox(child) : child);\n        margin += bboxMargin(leftBBox);\n    }\n\n    for (var i$1 = M - m - 1; i$1 >= m; i$1--) {\n        var child$1 = node.children[i$1];\n        extend(rightBBox, node.leaf ? toBBox(child$1) : child$1);\n        margin += bboxMargin(rightBBox);\n    }\n\n    return margin;\n};\n\nRBush.prototype._adjustParentBBoxes = function _adjustParentBBoxes (bbox, path, level) {\n    // adjust bboxes along the given tree path\n    for (var i = level; i >= 0; i--) {\n        extend(path[i], bbox);\n    }\n};\n\nRBush.prototype._condense = function _condense (path) {\n    // go through the path, removing empty nodes and updating bboxes\n    for (var i = path.length - 1, siblings = (void 0); i >= 0; i--) {\n        if (path[i].children.length === 0) {\n            if (i > 0) {\n                siblings = path[i - 1].children;\n                siblings.splice(siblings.indexOf(path[i]), 1);\n\n            } else { this.clear(); }\n\n        } else { calcBBox(path[i], this.toBBox); }\n    }\n};\n\nfunction findItem(item, items, equalsFn) {\n    if (!equalsFn) { return items.indexOf(item); }\n\n    for (var i = 0; i < items.length; i++) {\n        if (equalsFn(item, items[i])) { return i; }\n    }\n    return -1;\n}\n\n// calculate node's bbox from bboxes of its children\nfunction calcBBox(node, toBBox) {\n    distBBox(node, 0, node.children.length, toBBox, node);\n}\n\n// min bounding rectangle of node children from k to p-1\nfunction distBBox(node, k, p, toBBox, destNode) {\n    if (!destNode) { destNode = createNode(null); }\n    destNode.minX = Infinity;\n    destNode.minY = Infinity;\n    destNode.maxX = -Infinity;\n    destNode.maxY = -Infinity;\n\n    for (var i = k; i < p; i++) {\n        var child = node.children[i];\n        extend(destNode, node.leaf ? toBBox(child) : child);\n    }\n\n    return destNode;\n}\n\nfunction extend(a, b) {\n    a.minX = Math.min(a.minX, b.minX);\n    a.minY = Math.min(a.minY, b.minY);\n    a.maxX = Math.max(a.maxX, b.maxX);\n    a.maxY = Math.max(a.maxY, b.maxY);\n    return a;\n}\n\nfunction compareNodeMinX(a, b) { return a.minX - b.minX; }\nfunction compareNodeMinY(a, b) { return a.minY - b.minY; }\n\nfunction bboxArea(a)   { return (a.maxX - a.minX) * (a.maxY - a.minY); }\nfunction bboxMargin(a) { return (a.maxX - a.minX) + (a.maxY - a.minY); }\n\nfunction enlargedArea(a, b) {\n    return (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) *\n           (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY));\n}\n\nfunction intersectionArea(a, b) {\n    var minX = Math.max(a.minX, b.minX);\n    var minY = Math.max(a.minY, b.minY);\n    var maxX = Math.min(a.maxX, b.maxX);\n    var maxY = Math.min(a.maxY, b.maxY);\n\n    return Math.max(0, maxX - minX) *\n           Math.max(0, maxY - minY);\n}\n\nfunction contains(a, b) {\n    return a.minX <= b.minX &&\n           a.minY <= b.minY &&\n           b.maxX <= a.maxX &&\n           b.maxY <= a.maxY;\n}\n\nfunction intersects(a, b) {\n    return b.minX <= a.maxX &&\n           b.minY <= a.maxY &&\n           b.maxX >= a.minX &&\n           b.maxY >= a.minY;\n}\n\nfunction createNode(children) {\n    return {\n        children: children,\n        height: 1,\n        leaf: true,\n        minX: Infinity,\n        minY: Infinity,\n        maxX: -Infinity,\n        maxY: -Infinity\n    };\n}\n\n// sort an array so that items come in groups of n unsorted items, with groups sorted between each other;\n// combines selection algorithm with binary divide & conquer approach\n\nfunction multiSelect(arr, left, right, n, compare) {\n    var stack = [left, right];\n\n    while (stack.length) {\n        right = stack.pop();\n        left = stack.pop();\n\n        if (right - left <= n) { continue; }\n\n        var mid = left + Math.ceil((right - left) / n / 2) * n;\n        quickselect(arr, mid, left, right, compare);\n\n        stack.push(left, mid, mid, right);\n    }\n}\n\nreturn RBush;\n\n}));\n", "// https://github.com/topojson/topojson-client v3.1.0 Copyright 2019 Mike Bostock\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\ntypeof define === 'function' && define.amd ? define(['exports'], factory) :\n(global = global || self, factory(global.topojson = global.topojson || {}));\n}(this, function (exports) { 'use strict';\n\nfunction identity(x) {\n  return x;\n}\n\nfunction transform(transform) {\n  if (transform == null) return identity;\n  var x0,\n      y0,\n      kx = transform.scale[0],\n      ky = transform.scale[1],\n      dx = transform.translate[0],\n      dy = transform.translate[1];\n  return function(input, i) {\n    if (!i) x0 = y0 = 0;\n    var j = 2, n = input.length, output = new Array(n);\n    output[0] = (x0 += input[0]) * kx + dx;\n    output[1] = (y0 += input[1]) * ky + dy;\n    while (j < n) output[j] = input[j], ++j;\n    return output;\n  };\n}\n\nfunction bbox(topology) {\n  var t = transform(topology.transform), key,\n      x0 = Infinity, y0 = x0, x1 = -x0, y1 = -x0;\n\n  function bboxPoint(p) {\n    p = t(p);\n    if (p[0] < x0) x0 = p[0];\n    if (p[0] > x1) x1 = p[0];\n    if (p[1] < y0) y0 = p[1];\n    if (p[1] > y1) y1 = p[1];\n  }\n\n  function bboxGeometry(o) {\n    switch (o.type) {\n      case \"GeometryCollection\": o.geometries.forEach(bboxGeometry); break;\n      case \"Point\": bboxPoint(o.coordinates); break;\n      case \"MultiPoint\": o.coordinates.forEach(bboxPoint); break;\n    }\n  }\n\n  topology.arcs.forEach(function(arc) {\n    var i = -1, n = arc.length, p;\n    while (++i < n) {\n      p = t(arc[i], i);\n      if (p[0] < x0) x0 = p[0];\n      if (p[0] > x1) x1 = p[0];\n      if (p[1] < y0) y0 = p[1];\n      if (p[1] > y1) y1 = p[1];\n    }\n  });\n\n  for (key in topology.objects) {\n    bboxGeometry(topology.objects[key]);\n  }\n\n  return [x0, y0, x1, y1];\n}\n\nfunction reverse(array, n) {\n  var t, j = array.length, i = j - n;\n  while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;\n}\n\nfunction feature(topology, o) {\n  if (typeof o === \"string\") o = topology.objects[o];\n  return o.type === \"GeometryCollection\"\n      ? {type: \"FeatureCollection\", features: o.geometries.map(function(o) { return feature$1(topology, o); })}\n      : feature$1(topology, o);\n}\n\nfunction feature$1(topology, o) {\n  var id = o.id,\n      bbox = o.bbox,\n      properties = o.properties == null ? {} : o.properties,\n      geometry = object(topology, o);\n  return id == null && bbox == null ? {type: \"Feature\", properties: properties, geometry: geometry}\n      : bbox == null ? {type: \"Feature\", id: id, properties: properties, geometry: geometry}\n      : {type: \"Feature\", id: id, bbox: bbox, properties: properties, geometry: geometry};\n}\n\nfunction object(topology, o) {\n  var transformPoint = transform(topology.transform),\n      arcs = topology.arcs;\n\n  function arc(i, points) {\n    if (points.length) points.pop();\n    for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length; k < n; ++k) {\n      points.push(transformPoint(a[k], k));\n    }\n    if (i < 0) reverse(points, n);\n  }\n\n  function point(p) {\n    return transformPoint(p);\n  }\n\n  function line(arcs) {\n    var points = [];\n    for (var i = 0, n = arcs.length; i < n; ++i) arc(arcs[i], points);\n    if (points.length < 2) points.push(points[0]); // This should never happen per the specification.\n    return points;\n  }\n\n  function ring(arcs) {\n    var points = line(arcs);\n    while (points.length < 4) points.push(points[0]); // This may happen if an arc has only two points.\n    return points;\n  }\n\n  function polygon(arcs) {\n    return arcs.map(ring);\n  }\n\n  function geometry(o) {\n    var type = o.type, coordinates;\n    switch (type) {\n      case \"GeometryCollection\": return {type: type, geometries: o.geometries.map(geometry)};\n      case \"Point\": coordinates = point(o.coordinates); break;\n      case \"MultiPoint\": coordinates = o.coordinates.map(point); break;\n      case \"LineString\": coordinates = line(o.arcs); break;\n      case \"MultiLineString\": coordinates = o.arcs.map(line); break;\n      case \"Polygon\": coordinates = polygon(o.arcs); break;\n      case \"MultiPolygon\": coordinates = o.arcs.map(polygon); break;\n      default: return null;\n    }\n    return {type: type, coordinates: coordinates};\n  }\n\n  return geometry(o);\n}\n\nfunction stitch(topology, arcs) {\n  var stitchedArcs = {},\n      fragmentByStart = {},\n      fragmentByEnd = {},\n      fragments = [],\n      emptyIndex = -1;\n\n  // Stitch empty arcs first, since they may be subsumed by other arcs.\n  arcs.forEach(function(i, j) {\n    var arc = topology.arcs[i < 0 ? ~i : i], t;\n    if (arc.length < 3 && !arc[1][0] && !arc[1][1]) {\n      t = arcs[++emptyIndex], arcs[emptyIndex] = i, arcs[j] = t;\n    }\n  });\n\n  arcs.forEach(function(i) {\n    var e = ends(i),\n        start = e[0],\n        end = e[1],\n        f, g;\n\n    if (f = fragmentByEnd[start]) {\n      delete fragmentByEnd[f.end];\n      f.push(i);\n      f.end = end;\n      if (g = fragmentByStart[end]) {\n        delete fragmentByStart[g.start];\n        var fg = g === f ? f : f.concat(g);\n        fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.end] = fg;\n      } else {\n        fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n      }\n    } else if (f = fragmentByStart[end]) {\n      delete fragmentByStart[f.start];\n      f.unshift(i);\n      f.start = start;\n      if (g = fragmentByEnd[start]) {\n        delete fragmentByEnd[g.end];\n        var gf = g === f ? f : g.concat(f);\n        fragmentByStart[gf.start = g.start] = fragmentByEnd[gf.end = f.end] = gf;\n      } else {\n        fragmentByStart[f.start] = fragmentByEnd[f.end] = f;\n      }\n    } else {\n      f = [i];\n      fragmentByStart[f.start = start] = fragmentByEnd[f.end = end] = f;\n    }\n  });\n\n  function ends(i) {\n    var arc = topology.arcs[i < 0 ? ~i : i], p0 = arc[0], p1;\n    if (topology.transform) p1 = [0, 0], arc.forEach(function(dp) { p1[0] += dp[0], p1[1] += dp[1]; });\n    else p1 = arc[arc.length - 1];\n    return i < 0 ? [p1, p0] : [p0, p1];\n  }\n\n  function flush(fragmentByEnd, fragmentByStart) {\n    for (var k in fragmentByEnd) {\n      var f = fragmentByEnd[k];\n      delete fragmentByStart[f.start];\n      delete f.start;\n      delete f.end;\n      f.forEach(function(i) { stitchedArcs[i < 0 ? ~i : i] = 1; });\n      fragments.push(f);\n    }\n  }\n\n  flush(fragmentByEnd, fragmentByStart);\n  flush(fragmentByStart, fragmentByEnd);\n  arcs.forEach(function(i) { if (!stitchedArcs[i < 0 ? ~i : i]) fragments.push([i]); });\n\n  return fragments;\n}\n\nfunction mesh(topology) {\n  return object(topology, meshArcs.apply(this, arguments));\n}\n\nfunction meshArcs(topology, object, filter) {\n  var arcs, i, n;\n  if (arguments.length > 1) arcs = extractArcs(topology, object, filter);\n  else for (i = 0, arcs = new Array(n = topology.arcs.length); i < n; ++i) arcs[i] = i;\n  return {type: \"MultiLineString\", arcs: stitch(topology, arcs)};\n}\n\nfunction extractArcs(topology, object, filter) {\n  var arcs = [],\n      geomsByArc = [],\n      geom;\n\n  function extract0(i) {\n    var j = i < 0 ? ~i : i;\n    (geomsByArc[j] || (geomsByArc[j] = [])).push({i: i, g: geom});\n  }\n\n  function extract1(arcs) {\n    arcs.forEach(extract0);\n  }\n\n  function extract2(arcs) {\n    arcs.forEach(extract1);\n  }\n\n  function extract3(arcs) {\n    arcs.forEach(extract2);\n  }\n\n  function geometry(o) {\n    switch (geom = o, o.type) {\n      case \"GeometryCollection\": o.geometries.forEach(geometry); break;\n      case \"LineString\": extract1(o.arcs); break;\n      case \"MultiLineString\": case \"Polygon\": extract2(o.arcs); break;\n      case \"MultiPolygon\": extract3(o.arcs); break;\n    }\n  }\n\n  geometry(object);\n\n  geomsByArc.forEach(filter == null\n      ? function(geoms) { arcs.push(geoms[0].i); }\n      : function(geoms) { if (filter(geoms[0].g, geoms[geoms.length - 1].g)) arcs.push(geoms[0].i); });\n\n  return arcs;\n}\n\nfunction planarRingArea(ring) {\n  var i = -1, n = ring.length, a, b = ring[n - 1], area = 0;\n  while (++i < n) a = b, b = ring[i], area += a[0] * b[1] - a[1] * b[0];\n  return Math.abs(area); // Note: doubled area!\n}\n\nfunction merge(topology) {\n  return object(topology, mergeArcs.apply(this, arguments));\n}\n\nfunction mergeArcs(topology, objects) {\n  var polygonsByArc = {},\n      polygons = [],\n      groups = [];\n\n  objects.forEach(geometry);\n\n  function geometry(o) {\n    switch (o.type) {\n      case \"GeometryCollection\": o.geometries.forEach(geometry); break;\n      case \"Polygon\": extract(o.arcs); break;\n      case \"MultiPolygon\": o.arcs.forEach(extract); break;\n    }\n  }\n\n  function extract(polygon) {\n    polygon.forEach(function(ring) {\n      ring.forEach(function(arc) {\n        (polygonsByArc[arc = arc < 0 ? ~arc : arc] || (polygonsByArc[arc] = [])).push(polygon);\n      });\n    });\n    polygons.push(polygon);\n  }\n\n  function area(ring) {\n    return planarRingArea(object(topology, {type: \"Polygon\", arcs: [ring]}).coordinates[0]);\n  }\n\n  polygons.forEach(function(polygon) {\n    if (!polygon._) {\n      var group = [],\n          neighbors = [polygon];\n      polygon._ = 1;\n      groups.push(group);\n      while (polygon = neighbors.pop()) {\n        group.push(polygon);\n        polygon.forEach(function(ring) {\n          ring.forEach(function(arc) {\n            polygonsByArc[arc < 0 ? ~arc : arc].forEach(function(polygon) {\n              if (!polygon._) {\n                polygon._ = 1;\n                neighbors.push(polygon);\n              }\n            });\n          });\n        });\n      }\n    }\n  });\n\n  polygons.forEach(function(polygon) {\n    delete polygon._;\n  });\n\n  return {\n    type: \"MultiPolygon\",\n    arcs: groups.map(function(polygons) {\n      var arcs = [], n;\n\n      // Extract the exterior (unique) arcs.\n      polygons.forEach(function(polygon) {\n        polygon.forEach(function(ring) {\n          ring.forEach(function(arc) {\n            if (polygonsByArc[arc < 0 ? ~arc : arc].length < 2) {\n              arcs.push(arc);\n            }\n          });\n        });\n      });\n\n      // Stitch the arcs into one or more rings.\n      arcs = stitch(topology, arcs);\n\n      // If more than one ring is returned,\n      // at most one of these rings can be the exterior;\n      // choose the one with the greatest absolute area.\n      if ((n = arcs.length) > 1) {\n        for (var i = 1, k = area(arcs[0]), ki, t; i < n; ++i) {\n          if ((ki = area(arcs[i])) > k) {\n            t = arcs[0], arcs[0] = arcs[i], arcs[i] = t, k = ki;\n          }\n        }\n      }\n\n      return arcs;\n    }).filter(function(arcs) {\n      return arcs.length > 0;\n    })\n  };\n}\n\nfunction bisect(a, x) {\n  var lo = 0, hi = a.length;\n  while (lo < hi) {\n    var mid = lo + hi >>> 1;\n    if (a[mid] < x) lo = mid + 1;\n    else hi = mid;\n  }\n  return lo;\n}\n\nfunction neighbors(objects) {\n  var indexesByArc = {}, // arc index -> array of object indexes\n      neighbors = objects.map(function() { return []; });\n\n  function line(arcs, i) {\n    arcs.forEach(function(a) {\n      if (a < 0) a = ~a;\n      var o = indexesByArc[a];\n      if (o) o.push(i);\n      else indexesByArc[a] = [i];\n    });\n  }\n\n  function polygon(arcs, i) {\n    arcs.forEach(function(arc) { line(arc, i); });\n  }\n\n  function geometry(o, i) {\n    if (o.type === \"GeometryCollection\") o.geometries.forEach(function(o) { geometry(o, i); });\n    else if (o.type in geometryType) geometryType[o.type](o.arcs, i);\n  }\n\n  var geometryType = {\n    LineString: line,\n    MultiLineString: polygon,\n    Polygon: polygon,\n    MultiPolygon: function(arcs, i) { arcs.forEach(function(arc) { polygon(arc, i); }); }\n  };\n\n  objects.forEach(geometry);\n\n  for (var i in indexesByArc) {\n    for (var indexes = indexesByArc[i], m = indexes.length, j = 0; j < m; ++j) {\n      for (var k = j + 1; k < m; ++k) {\n        var ij = indexes[j], ik = indexes[k], n;\n        if ((n = neighbors[ij])[i = bisect(n, ik)] !== ik) n.splice(i, 0, ik);\n        if ((n = neighbors[ik])[i = bisect(n, ij)] !== ij) n.splice(i, 0, ij);\n      }\n    }\n  }\n\n  return neighbors;\n}\n\nfunction untransform(transform) {\n  if (transform == null) return identity;\n  var x0,\n      y0,\n      kx = transform.scale[0],\n      ky = transform.scale[1],\n      dx = transform.translate[0],\n      dy = transform.translate[1];\n  return function(input, i) {\n    if (!i) x0 = y0 = 0;\n    var j = 2,\n        n = input.length,\n        output = new Array(n),\n        x1 = Math.round((input[0] - dx) / kx),\n        y1 = Math.round((input[1] - dy) / ky);\n    output[0] = x1 - x0, x0 = x1;\n    output[1] = y1 - y0, y0 = y1;\n    while (j < n) output[j] = input[j], ++j;\n    return output;\n  };\n}\n\nfunction quantize(topology, transform) {\n  if (topology.transform) throw new Error(\"already quantized\");\n\n  if (!transform || !transform.scale) {\n    if (!((n = Math.floor(transform)) >= 2)) throw new Error(\"n must be \u22652\");\n    box = topology.bbox || bbox(topology);\n    var x0 = box[0], y0 = box[1], x1 = box[2], y1 = box[3], n;\n    transform = {scale: [x1 - x0 ? (x1 - x0) / (n - 1) : 1, y1 - y0 ? (y1 - y0) / (n - 1) : 1], translate: [x0, y0]};\n  } else {\n    box = topology.bbox;\n  }\n\n  var t = untransform(transform), box, key, inputs = topology.objects, outputs = {};\n\n  function quantizePoint(point) {\n    return t(point);\n  }\n\n  function quantizeGeometry(input) {\n    var output;\n    switch (input.type) {\n      case \"GeometryCollection\": output = {type: \"GeometryCollection\", geometries: input.geometries.map(quantizeGeometry)}; break;\n      case \"Point\": output = {type: \"Point\", coordinates: quantizePoint(input.coordinates)}; break;\n      case \"MultiPoint\": output = {type: \"MultiPoint\", coordinates: input.coordinates.map(quantizePoint)}; break;\n      default: return input;\n    }\n    if (input.id != null) output.id = input.id;\n    if (input.bbox != null) output.bbox = input.bbox;\n    if (input.properties != null) output.properties = input.properties;\n    return output;\n  }\n\n  function quantizeArc(input) {\n    var i = 0, j = 1, n = input.length, p, output = new Array(n); // pessimistic\n    output[0] = t(input[0], 0);\n    while (++i < n) if ((p = t(input[i], i))[0] || p[1]) output[j++] = p; // non-coincident points\n    if (j === 1) output[j++] = [0, 0]; // an arc must have at least two points\n    output.length = j;\n    return output;\n  }\n\n  for (key in inputs) outputs[key] = quantizeGeometry(inputs[key]);\n\n  return {\n    type: \"Topology\",\n    bbox: box,\n    transform: transform,\n    objects: outputs,\n    arcs: topology.arcs.map(quantizeArc)\n  };\n}\n\nexports.bbox = bbox;\nexports.feature = feature;\nexports.merge = merge;\nexports.mergeArcs = mergeArcs;\nexports.mesh = mesh;\nexports.meshArcs = meshArcs;\nexports.neighbors = neighbors;\nexports.quantize = quantize;\nexports.transform = transform;\nexports.untransform = untransform;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n}));\n", null, null, null, null, null, null, null, null, "/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n  extendStatics = Object.setPrototypeOf ||\n      ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n      function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n  return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n  if (typeof b !== \"function\" && b !== null)\n      throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n  extendStatics(d, b);\n  function __() { this.constructor = d; }\n  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n  __assign = Object.assign || function __assign(t) {\n      for (var s, i = 1, n = arguments.length; i < n; i++) {\n          s = arguments[i];\n          for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n      }\n      return t;\n  }\n  return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n      t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n      for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n          if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n              t[p[i]] = s[p[i]];\n      }\n  return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n  if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n  return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n  return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n  function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n  var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n  var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n  var _, done = false;\n  for (var i = decorators.length - 1; i >= 0; i--) {\n      var context = {};\n      for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n      for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n      context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n      var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n      if (kind === \"accessor\") {\n          if (result === void 0) continue;\n          if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n          if (_ = accept(result.get)) descriptor.get = _;\n          if (_ = accept(result.set)) descriptor.set = _;\n          if (_ = accept(result.init)) initializers.unshift(_);\n      }\n      else if (_ = accept(result)) {\n          if (kind === \"field\") initializers.unshift(_);\n          else descriptor[key] = _;\n      }\n  }\n  if (target) Object.defineProperty(target, contextIn.name, descriptor);\n  done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n  var useValue = arguments.length > 2;\n  for (var i = 0; i < initializers.length; i++) {\n      value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n  }\n  return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n  return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n  if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n  return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n  if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n  return new (P || (P = Promise))(function (resolve, reject) {\n      function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n      function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n      function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n      step((generator = generator.apply(thisArg, _arguments || [])).next());\n  });\n}\n\nexport function __generator(thisArg, body) {\n  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n  return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n  function verb(n) { return function (v) { return step([n, v]); }; }\n  function step(op) {\n      if (f) throw new TypeError(\"Generator is already executing.\");\n      while (g && (g = 0, op[0] && (_ = 0)), _) try {\n          if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n          if (y = 0, t) op = [op[0] & 2, t.value];\n          switch (op[0]) {\n              case 0: case 1: t = op; break;\n              case 4: _.label++; return { value: op[1], done: false };\n              case 5: _.label++; y = op[1]; op = [0]; continue;\n              case 7: op = _.ops.pop(); _.trys.pop(); continue;\n              default:\n                  if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n                  if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n                  if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n                  if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n                  if (t[2]) _.ops.pop();\n                  _.trys.pop(); continue;\n          }\n          op = body.call(thisArg, _);\n      } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n      if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n  }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n  }\n  Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n  var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n  if (m) return m.call(o);\n  if (o && typeof o.length === \"number\") return {\n      next: function () {\n          if (o && i >= o.length) o = void 0;\n          return { value: o && o[i++], done: !o };\n      }\n  };\n  throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n  var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n  if (!m) return o;\n  var i = m.call(o), r, ar = [], e;\n  try {\n      while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n  }\n  catch (error) { e = { error: error }; }\n  finally {\n      try {\n          if (r && !r.done && (m = i[\"return\"])) m.call(i);\n      }\n      finally { if (e) throw e.error; }\n  }\n  return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n  for (var ar = [], i = 0; i < arguments.length; i++)\n      ar = ar.concat(__read(arguments[i]));\n  return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n  for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n  for (var r = Array(s), k = 0, i = 0; i < il; i++)\n      for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n          r[k] = a[j];\n  return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n      if (ar || !(i in from)) {\n          if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n          ar[i] = from[i];\n      }\n  }\n  return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n  return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n  if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n  var g = generator.apply(thisArg, _arguments || []), i, q = [];\n  return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n  function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n  function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n  function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n  function fulfill(value) { resume(\"next\", value); }\n  function reject(value) { resume(\"throw\", value); }\n  function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n  var i, p;\n  return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n  function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n  if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n  var m = o[Symbol.asyncIterator], i;\n  return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n  function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n  if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n  return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n  Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n  o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n  if (mod && mod.__esModule) return mod;\n  var result = {};\n  if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n  __setModuleDefault(result, mod);\n  return result;\n}\n\nexport function __importDefault(mod) {\n  return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n  if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n  if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n  return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n  if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n  if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n  if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n  return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n  if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n  return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n  if (value !== null && value !== void 0) {\n    if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n    var dispose;\n    if (async) {\n        if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n        dispose = value[Symbol.asyncDispose];\n    }\n    if (dispose === void 0) {\n        if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n        dispose = value[Symbol.dispose];\n    }\n    if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n    env.stack.push({ value: value, dispose: dispose, async: async });\n  }\n  else if (async) {\n    env.stack.push({ async: true });\n  }\n  return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n  var e = new Error(message);\n  return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n  function fail(e) {\n    env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n    env.hasError = true;\n  }\n  function next() {\n    while (env.stack.length) {\n      var rec = env.stack.pop();\n      try {\n        var result = rec.dispose && rec.dispose.call(rec.value);\n        if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n      }\n      catch (e) {\n          fail(e);\n      }\n    }\n    if (env.hasError) throw env.error;\n  }\n  return next();\n}\n\nexport default {\n  __extends,\n  __assign,\n  __rest,\n  __decorate,\n  __param,\n  __metadata,\n  __awaiter,\n  __generator,\n  __createBinding,\n  __exportStar,\n  __values,\n  __read,\n  __spread,\n  __spreadArrays,\n  __spreadArray,\n  __await,\n  __asyncGenerator,\n  __asyncDelegator,\n  __asyncValues,\n  __makeTemplateObject,\n  __importStar,\n  __importDefault,\n  __classPrivateFieldGet,\n  __classPrivateFieldSet,\n  __classPrivateFieldIn,\n  __addDisposableResource,\n  __disposeResources,\n};\n", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=match.js.map", null, null, null, "(function prelude(modules, cache, entries) {\n\n    // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n    // sources through a conflict-free require shim and is again wrapped within an iife that\n    // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\n    // so that minification can remove the directives of each module.\n\n    function $require(name) {\n        var $module = cache[name];\n        if (!$module)\n            modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n        return $module.exports;\n    }\n\n    var protobuf = $require(entries[0]);\n\n    // Expose globally\n    protobuf.util.global.protobuf = protobuf;\n\n    // Be nice to AMD\n    if (typeof define === \"function\" && define.amd)\n        define([\"long\"], function(Long) {\n            if (Long && Long.isLong) {\n                protobuf.util.Long = Long;\n                protobuf.configure();\n            }\n            return protobuf;\n        });\n\n    // Be nice to CommonJS\n    if (typeof module === \"object\" && module && module.exports)\n        module.exports = protobuf;\n\n})/* end of prelude */", "\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n    var params  = new Array(arguments.length - 1),\r\n        offset  = 0,\r\n        index   = 2,\r\n        pending = true;\r\n    while (index < arguments.length)\r\n        params[offset++] = arguments[index++];\r\n    return new Promise(function executor(resolve, reject) {\r\n        params[offset] = function callback(err/*, varargs */) {\r\n            if (pending) {\r\n                pending = false;\r\n                if (err)\r\n                    reject(err);\r\n                else {\r\n                    var params = new Array(arguments.length - 1),\r\n                        offset = 0;\r\n                    while (offset < params.length)\r\n                        params[offset++] = arguments[offset];\r\n                    resolve.apply(null, params);\r\n                }\r\n            }\r\n        };\r\n        try {\r\n            fn.apply(ctx || null, params);\r\n        } catch (err) {\r\n            if (pending) {\r\n                pending = false;\r\n                reject(err);\r\n            }\r\n        }\r\n    });\r\n}\r\n", "\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n    var p = string.length;\r\n    if (!p)\r\n        return 0;\r\n    var n = 0;\r\n    while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n        ++n;\r\n    return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n    s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n    var parts = null,\r\n        chunk = [];\r\n    var i = 0, // output index\r\n        j = 0, // goto index\r\n        t;     // temporary\r\n    while (start < end) {\r\n        var b = buffer[start++];\r\n        switch (j) {\r\n            case 0:\r\n                chunk[i++] = b64[b >> 2];\r\n                t = (b & 3) << 4;\r\n                j = 1;\r\n                break;\r\n            case 1:\r\n                chunk[i++] = b64[t | b >> 4];\r\n                t = (b & 15) << 2;\r\n                j = 2;\r\n                break;\r\n            case 2:\r\n                chunk[i++] = b64[t | b >> 6];\r\n                chunk[i++] = b64[b & 63];\r\n                j = 0;\r\n                break;\r\n        }\r\n        if (i > 8191) {\r\n            (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n            i = 0;\r\n        }\r\n    }\r\n    if (j) {\r\n        chunk[i++] = b64[t];\r\n        chunk[i++] = 61;\r\n        if (j === 1)\r\n            chunk[i++] = 61;\r\n    }\r\n    if (parts) {\r\n        if (i)\r\n            parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n        return parts.join(\"\");\r\n    }\r\n    return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n    var start = offset;\r\n    var j = 0, // goto index\r\n        t;     // temporary\r\n    for (var i = 0; i < string.length;) {\r\n        var c = string.charCodeAt(i++);\r\n        if (c === 61 && j > 1)\r\n            break;\r\n        if ((c = s64[c]) === undefined)\r\n            throw Error(invalidEncoding);\r\n        switch (j) {\r\n            case 0:\r\n                t = c;\r\n                j = 1;\r\n                break;\r\n            case 1:\r\n                buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n                t = c;\r\n                j = 2;\r\n                break;\r\n            case 2:\r\n                buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n                t = c;\r\n                j = 3;\r\n                break;\r\n            case 3:\r\n                buffer[offset++] = (t & 3) << 6 | c;\r\n                j = 0;\r\n                break;\r\n        }\r\n    }\r\n    if (j === 1)\r\n        throw Error(invalidEncoding);\r\n    return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n    return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n", "\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n    /**\r\n     * Registered listeners.\r\n     * @type {Object.<string,*>}\r\n     * @private\r\n     */\r\n    this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n    (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n        fn  : fn,\r\n        ctx : ctx || this\r\n    });\r\n    return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n    if (evt === undefined)\r\n        this._listeners = {};\r\n    else {\r\n        if (fn === undefined)\r\n            this._listeners[evt] = [];\r\n        else {\r\n            var listeners = this._listeners[evt];\r\n            for (var i = 0; i < listeners.length;)\r\n                if (listeners[i].fn === fn)\r\n                    listeners.splice(i, 1);\r\n                else\r\n                    ++i;\r\n        }\r\n    }\r\n    return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n    var listeners = this._listeners[evt];\r\n    if (listeners) {\r\n        var args = [],\r\n            i = 1;\r\n        for (; i < arguments.length;)\r\n            args.push(arguments[i++]);\r\n        for (i = 0; i < listeners.length;)\r\n            listeners[i].fn.apply(listeners[i++].ctx, args);\r\n    }\r\n    return this;\r\n};\r\n", "\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n    // float: typed array\r\n    if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n        var f32 = new Float32Array([ -0 ]),\r\n            f8b = new Uint8Array(f32.buffer),\r\n            le  = f8b[3] === 128;\r\n\r\n        function writeFloat_f32_cpy(val, buf, pos) {\r\n            f32[0] = val;\r\n            buf[pos    ] = f8b[0];\r\n            buf[pos + 1] = f8b[1];\r\n            buf[pos + 2] = f8b[2];\r\n            buf[pos + 3] = f8b[3];\r\n        }\r\n\r\n        function writeFloat_f32_rev(val, buf, pos) {\r\n            f32[0] = val;\r\n            buf[pos    ] = f8b[3];\r\n            buf[pos + 1] = f8b[2];\r\n            buf[pos + 2] = f8b[1];\r\n            buf[pos + 3] = f8b[0];\r\n        }\r\n\r\n        /* istanbul ignore next */\r\n        exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n        /* istanbul ignore next */\r\n        exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n        function readFloat_f32_cpy(buf, pos) {\r\n            f8b[0] = buf[pos    ];\r\n            f8b[1] = buf[pos + 1];\r\n            f8b[2] = buf[pos + 2];\r\n            f8b[3] = buf[pos + 3];\r\n            return f32[0];\r\n        }\r\n\r\n        function readFloat_f32_rev(buf, pos) {\r\n            f8b[3] = buf[pos    ];\r\n            f8b[2] = buf[pos + 1];\r\n            f8b[1] = buf[pos + 2];\r\n            f8b[0] = buf[pos + 3];\r\n            return f32[0];\r\n        }\r\n\r\n        /* istanbul ignore next */\r\n        exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n        /* istanbul ignore next */\r\n        exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n    // float: ieee754\r\n    })(); else (function() {\r\n\r\n        function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n            var sign = val < 0 ? 1 : 0;\r\n            if (sign)\r\n                val = -val;\r\n            if (val === 0)\r\n                writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n            else if (isNaN(val))\r\n                writeUint(2143289344, buf, pos);\r\n            else if (val > 3.4028234663852886e+38) // +-Infinity\r\n                writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n            else if (val < 1.1754943508222875e-38) // denormal\r\n                writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n            else {\r\n                var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n                    mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n                writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n            }\r\n        }\r\n\r\n        exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n        exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n        function readFloat_ieee754(readUint, buf, pos) {\r\n            var uint = readUint(buf, pos),\r\n                sign = (uint >> 31) * 2 + 1,\r\n                exponent = uint >>> 23 & 255,\r\n                mantissa = uint & 8388607;\r\n            return exponent === 255\r\n                ? mantissa\r\n                ? NaN\r\n                : sign * Infinity\r\n                : exponent === 0 // denormal\r\n                ? sign * 1.401298464324817e-45 * mantissa\r\n                : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n        }\r\n\r\n        exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n        exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n    })();\r\n\r\n    // double: typed array\r\n    if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n        var f64 = new Float64Array([-0]),\r\n            f8b = new Uint8Array(f64.buffer),\r\n            le  = f8b[7] === 128;\r\n\r\n        function writeDouble_f64_cpy(val, buf, pos) {\r\n            f64[0] = val;\r\n            buf[pos    ] = f8b[0];\r\n            buf[pos + 1] = f8b[1];\r\n            buf[pos + 2] = f8b[2];\r\n            buf[pos + 3] = f8b[3];\r\n            buf[pos + 4] = f8b[4];\r\n            buf[pos + 5] = f8b[5];\r\n            buf[pos + 6] = f8b[6];\r\n            buf[pos + 7] = f8b[7];\r\n        }\r\n\r\n        function writeDouble_f64_rev(val, buf, pos) {\r\n            f64[0] = val;\r\n            buf[pos    ] = f8b[7];\r\n            buf[pos + 1] = f8b[6];\r\n            buf[pos + 2] = f8b[5];\r\n            buf[pos + 3] = f8b[4];\r\n            buf[pos + 4] = f8b[3];\r\n            buf[pos + 5] = f8b[2];\r\n            buf[pos + 6] = f8b[1];\r\n            buf[pos + 7] = f8b[0];\r\n        }\r\n\r\n        /* istanbul ignore next */\r\n        exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n        /* istanbul ignore next */\r\n        exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n        function readDouble_f64_cpy(buf, pos) {\r\n            f8b[0] = buf[pos    ];\r\n            f8b[1] = buf[pos + 1];\r\n            f8b[2] = buf[pos + 2];\r\n            f8b[3] = buf[pos + 3];\r\n            f8b[4] = buf[pos + 4];\r\n            f8b[5] = buf[pos + 5];\r\n            f8b[6] = buf[pos + 6];\r\n            f8b[7] = buf[pos + 7];\r\n            return f64[0];\r\n        }\r\n\r\n        function readDouble_f64_rev(buf, pos) {\r\n            f8b[7] = buf[pos    ];\r\n            f8b[6] = buf[pos + 1];\r\n            f8b[5] = buf[pos + 2];\r\n            f8b[4] = buf[pos + 3];\r\n            f8b[3] = buf[pos + 4];\r\n            f8b[2] = buf[pos + 5];\r\n            f8b[1] = buf[pos + 6];\r\n            f8b[0] = buf[pos + 7];\r\n            return f64[0];\r\n        }\r\n\r\n        /* istanbul ignore next */\r\n        exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n        /* istanbul ignore next */\r\n        exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n    // double: ieee754\r\n    })(); else (function() {\r\n\r\n        function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n            var sign = val < 0 ? 1 : 0;\r\n            if (sign)\r\n                val = -val;\r\n            if (val === 0) {\r\n                writeUint(0, buf, pos + off0);\r\n                writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n            } else if (isNaN(val)) {\r\n                writeUint(0, buf, pos + off0);\r\n                writeUint(2146959360, buf, pos + off1);\r\n            } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n                writeUint(0, buf, pos + off0);\r\n                writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n            } else {\r\n                var mantissa;\r\n                if (val < 2.2250738585072014e-308) { // denormal\r\n                    mantissa = val / 5e-324;\r\n                    writeUint(mantissa >>> 0, buf, pos + off0);\r\n                    writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n                } else {\r\n                    var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n                    if (exponent === 1024)\r\n                        exponent = 1023;\r\n                    mantissa = val * Math.pow(2, -exponent);\r\n                    writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n                    writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n                }\r\n            }\r\n        }\r\n\r\n        exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n        exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n        function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n            var lo = readUint(buf, pos + off0),\r\n                hi = readUint(buf, pos + off1);\r\n            var sign = (hi >> 31) * 2 + 1,\r\n                exponent = hi >>> 20 & 2047,\r\n                mantissa = 4294967296 * (hi & 1048575) + lo;\r\n            return exponent === 2047\r\n                ? mantissa\r\n                ? NaN\r\n                : sign * Infinity\r\n                : exponent === 0 // denormal\r\n                ? sign * 5e-324 * mantissa\r\n                : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n        }\r\n\r\n        exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n        exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n    })();\r\n\r\n    return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n    buf[pos    ] =  val        & 255;\r\n    buf[pos + 1] =  val >>> 8  & 255;\r\n    buf[pos + 2] =  val >>> 16 & 255;\r\n    buf[pos + 3] =  val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n    buf[pos    ] =  val >>> 24;\r\n    buf[pos + 1] =  val >>> 16 & 255;\r\n    buf[pos + 2] =  val >>> 8  & 255;\r\n    buf[pos + 3] =  val        & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n    return (buf[pos    ]\r\n          | buf[pos + 1] << 8\r\n          | buf[pos + 2] << 16\r\n          | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n    return (buf[pos    ] << 24\r\n          | buf[pos + 1] << 16\r\n          | buf[pos + 2] << 8\r\n          | buf[pos + 3]) >>> 0;\r\n}\r\n", "\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n    try {\r\n        var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n        if (mod && (mod.length || Object.keys(mod).length))\r\n            return mod;\r\n    } catch (e) {} // eslint-disable-line no-empty\r\n    return null;\r\n}\r\n", "\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n    var SIZE   = size || 8192;\r\n    var MAX    = SIZE >>> 1;\r\n    var slab   = null;\r\n    var offset = SIZE;\r\n    return function pool_alloc(size) {\r\n        if (size < 1 || size > MAX)\r\n            return alloc(size);\r\n        if (offset + size > SIZE) {\r\n            slab = alloc(SIZE);\r\n            offset = 0;\r\n        }\r\n        var buf = slice.call(slab, offset, offset += size);\r\n        if (offset & 7) // align to 32 bit\r\n            offset = (offset | 7) + 1;\r\n        return buf;\r\n    };\r\n}\r\n", "\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n    var len = 0,\r\n        c = 0;\r\n    for (var i = 0; i < string.length; ++i) {\r\n        c = string.charCodeAt(i);\r\n        if (c < 128)\r\n            len += 1;\r\n        else if (c < 2048)\r\n            len += 2;\r\n        else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n            ++i;\r\n            len += 4;\r\n        } else\r\n            len += 3;\r\n    }\r\n    return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n    var len = end - start;\r\n    if (len < 1)\r\n        return \"\";\r\n    var parts = null,\r\n        chunk = [],\r\n        i = 0, // char offset\r\n        t;     // temporary\r\n    while (start < end) {\r\n        t = buffer[start++];\r\n        if (t < 128)\r\n            chunk[i++] = t;\r\n        else if (t > 191 && t < 224)\r\n            chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n        else if (t > 239 && t < 365) {\r\n            t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n            chunk[i++] = 0xD800 + (t >> 10);\r\n            chunk[i++] = 0xDC00 + (t & 1023);\r\n        } else\r\n            chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n        if (i > 8191) {\r\n            (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n            i = 0;\r\n        }\r\n    }\r\n    if (parts) {\r\n        if (i)\r\n            parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n        return parts.join(\"\");\r\n    }\r\n    return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n    var start = offset,\r\n        c1, // character 1\r\n        c2; // character 2\r\n    for (var i = 0; i < string.length; ++i) {\r\n        c1 = string.charCodeAt(i);\r\n        if (c1 < 128) {\r\n            buffer[offset++] = c1;\r\n        } else if (c1 < 2048) {\r\n            buffer[offset++] = c1 >> 6       | 192;\r\n            buffer[offset++] = c1       & 63 | 128;\r\n        } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n            c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n            ++i;\r\n            buffer[offset++] = c1 >> 18      | 240;\r\n            buffer[offset++] = c1 >> 12 & 63 | 128;\r\n            buffer[offset++] = c1 >> 6  & 63 | 128;\r\n            buffer[offset++] = c1       & 63 | 128;\r\n        } else {\r\n            buffer[offset++] = c1 >> 12      | 224;\r\n            buffer[offset++] = c1 >> 6  & 63 | 128;\r\n            buffer[offset++] = c1       & 63 | 128;\r\n        }\r\n    }\r\n    return offset - start;\r\n};\r\n", "\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer       = require(16);\nprotobuf.BufferWriter = require(17);\nprotobuf.Reader       = require(9);\nprotobuf.BufferReader = require(10);\n\n// Utility\nprotobuf.util         = require(15);\nprotobuf.rpc          = require(12);\nprotobuf.roots        = require(11);\nprotobuf.configure    = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n    protobuf.util._configure();\n    protobuf.Writer._configure(protobuf.BufferWriter);\n    protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n", "\"use strict\";\nmodule.exports = Reader;\n\nvar util      = require(15);\n\nvar BufferReader; // cyclic\n\nvar LongBits  = util.LongBits,\n    utf8      = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n    return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n    /**\n     * Read buffer.\n     * @type {Uint8Array}\n     */\n    this.buf = buffer;\n\n    /**\n     * Read buffer position.\n     * @type {number}\n     */\n    this.pos = 0;\n\n    /**\n     * Read buffer length.\n     * @type {number}\n     */\n    this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n    ? function create_typed_array(buffer) {\n        if (buffer instanceof Uint8Array || Array.isArray(buffer))\n            return new Reader(buffer);\n        throw Error(\"illegal buffer\");\n    }\n    /* istanbul ignore next */\n    : function create_array(buffer) {\n        if (Array.isArray(buffer))\n            return new Reader(buffer);\n        throw Error(\"illegal buffer\");\n    };\n\nvar create = function create() {\n    return util.Buffer\n        ? function create_buffer_setup(buffer) {\n            return (Reader.create = function create_buffer(buffer) {\n                return util.Buffer.isBuffer(buffer)\n                    ? new BufferReader(buffer)\n                    /* istanbul ignore next */\n                    : create_array(buffer);\n            })(buffer);\n        }\n        /* istanbul ignore next */\n        : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n    var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n    return function read_uint32() {\n        value = (         this.buf[this.pos] & 127       ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n        value = (value | (this.buf[this.pos] & 127) <<  7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n        value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n        value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n        value = (value | (this.buf[this.pos] &  15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n        /* istanbul ignore if */\n        if ((this.pos += 5) > this.len) {\n            this.pos = this.len;\n            throw indexOutOfRange(this, 10);\n        }\n        return value;\n    };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n    return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n    var value = this.uint32();\n    return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n    // tends to deopt with local vars for octet etc.\n    var bits = new LongBits(0, 0);\n    var i = 0;\n    if (this.len - this.pos > 4) { // fast route (lo)\n        for (; i < 4; ++i) {\n            // 1st..4th\n            bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n            if (this.buf[this.pos++] < 128)\n                return bits;\n        }\n        // 5th\n        bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n        bits.hi = (bits.hi | (this.buf[this.pos] & 127) >>  4) >>> 0;\n        if (this.buf[this.pos++] < 128)\n            return bits;\n        i = 0;\n    } else {\n        for (; i < 3; ++i) {\n            /* istanbul ignore if */\n            if (this.pos >= this.len)\n                throw indexOutOfRange(this);\n            // 1st..3th\n            bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n            if (this.buf[this.pos++] < 128)\n                return bits;\n        }\n        // 4th\n        bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n        return bits;\n    }\n    if (this.len - this.pos > 4) { // fast route (hi)\n        for (; i < 5; ++i) {\n            // 6th..10th\n            bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n            if (this.buf[this.pos++] < 128)\n                return bits;\n        }\n    } else {\n        for (; i < 5; ++i) {\n            /* istanbul ignore if */\n            if (this.pos >= this.len)\n                throw indexOutOfRange(this);\n            // 6th..10th\n            bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n            if (this.buf[this.pos++] < 128)\n                return bits;\n        }\n    }\n    /* istanbul ignore next */\n    throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n    return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n    return (buf[end - 4]\n          | buf[end - 3] << 8\n          | buf[end - 2] << 16\n          | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n    /* istanbul ignore if */\n    if (this.pos + 4 > this.len)\n        throw indexOutOfRange(this, 4);\n\n    return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n    /* istanbul ignore if */\n    if (this.pos + 4 > this.len)\n        throw indexOutOfRange(this, 4);\n\n    return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n    /* istanbul ignore if */\n    if (this.pos + 8 > this.len)\n        throw indexOutOfRange(this, 8);\n\n    return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n    /* istanbul ignore if */\n    if (this.pos + 4 > this.len)\n        throw indexOutOfRange(this, 4);\n\n    var value = util.float.readFloatLE(this.buf, this.pos);\n    this.pos += 4;\n    return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n    /* istanbul ignore if */\n    if (this.pos + 8 > this.len)\n        throw indexOutOfRange(this, 4);\n\n    var value = util.float.readDoubleLE(this.buf, this.pos);\n    this.pos += 8;\n    return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n    var length = this.uint32(),\n        start  = this.pos,\n        end    = this.pos + length;\n\n    /* istanbul ignore if */\n    if (end > this.len)\n        throw indexOutOfRange(this, length);\n\n    this.pos += length;\n    if (Array.isArray(this.buf)) // plain array\n        return this.buf.slice(start, end);\n\n    if (start === end) { // fix for IE 10/Win8 and others' subarray returning array of size 1\n        var nativeBuffer = util.Buffer;\n        return nativeBuffer\n            ? nativeBuffer.alloc(0)\n            : new this.buf.constructor(0);\n    }\n    return this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n    var bytes = this.bytes();\n    return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n    if (typeof length === \"number\") {\n        /* istanbul ignore if */\n        if (this.pos + length > this.len)\n            throw indexOutOfRange(this, length);\n        this.pos += length;\n    } else {\n        do {\n            /* istanbul ignore if */\n            if (this.pos >= this.len)\n                throw indexOutOfRange(this);\n        } while (this.buf[this.pos++] & 128);\n    }\n    return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n    switch (wireType) {\n        case 0:\n            this.skip();\n            break;\n        case 1:\n            this.skip(8);\n            break;\n        case 2:\n            this.skip(this.uint32());\n            break;\n        case 3:\n            while ((wireType = this.uint32() & 7) !== 4) {\n                this.skipType(wireType);\n            }\n            break;\n        case 5:\n            this.skip(4);\n            break;\n\n        /* istanbul ignore next */\n        default:\n            throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n    }\n    return this;\n};\n\nReader._configure = function(BufferReader_) {\n    BufferReader = BufferReader_;\n    Reader.create = create();\n    BufferReader._configure();\n\n    var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n    util.merge(Reader.prototype, {\n\n        int64: function read_int64() {\n            return readLongVarint.call(this)[fn](false);\n        },\n\n        uint64: function read_uint64() {\n            return readLongVarint.call(this)[fn](true);\n        },\n\n        sint64: function read_sint64() {\n            return readLongVarint.call(this).zzDecode()[fn](false);\n        },\n\n        fixed64: function read_fixed64() {\n            return readFixed64.call(this)[fn](true);\n        },\n\n        sfixed64: function read_sfixed64() {\n            return readFixed64.call(this)[fn](false);\n        }\n\n    });\n};\n", "\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(9);\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(15);\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n    Reader.call(this, buffer);\n\n    /**\n     * Read buffer.\n     * @name BufferReader#buf\n     * @type {Buffer}\n     */\n}\n\nBufferReader._configure = function () {\n    /* istanbul ignore else */\n    if (util.Buffer)\n        BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n    var len = this.uint32(); // modifies pos\n    return this.buf.utf8Slice\n        ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n        : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n", "\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available across modules.\n * @name roots\n * @type {Object.<string,Root>}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n", "\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod<Message<{}>,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n *     if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n *         throw Error(\"no such method\");\n *     asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n *         callback(err, responseData);\n *     });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(13);\n", "\"use strict\";\nmodule.exports = Service;\n\nvar util = require(15);\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message<TRes>\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message<TReq>\n * @template TRes extends Message<TRes>\n * @type {function}\n * @param {TReq|Properties<TReq>} request Request message or plain object\n * @param {rpc.ServiceMethodCallback<TRes>} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise<Message<TRes>>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n    if (typeof rpcImpl !== \"function\")\n        throw TypeError(\"rpcImpl must be a function\");\n\n    util.EventEmitter.call(this);\n\n    /**\n     * RPC implementation. Becomes `null` once the service is ended.\n     * @type {RPCImpl|null}\n     */\n    this.rpcImpl = rpcImpl;\n\n    /**\n     * Whether requests are length-delimited.\n     * @type {boolean}\n     */\n    this.requestDelimited = Boolean(requestDelimited);\n\n    /**\n     * Whether responses are length-delimited.\n     * @type {boolean}\n     */\n    this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod<TReq,TRes>} method Reflected or static method\n * @param {Constructor<TReq>} requestCtor Request constructor\n * @param {Constructor<TRes>} responseCtor Response constructor\n * @param {TReq|Properties<TReq>} request Request message or plain object\n * @param {rpc.ServiceMethodCallback<TRes>} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message<TReq>\n * @template TRes extends Message<TRes>\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n    if (!request)\n        throw TypeError(\"request must be specified\");\n\n    var self = this;\n    if (!callback)\n        return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n    if (!self.rpcImpl) {\n        setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n        return undefined;\n    }\n\n    try {\n        return self.rpcImpl(\n            method,\n            requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n            function rpcCallback(err, response) {\n\n                if (err) {\n                    self.emit(\"error\", err, method);\n                    return callback(err);\n                }\n\n                if (response === null) {\n                    self.end(/* endedByRPC */ true);\n                    return undefined;\n                }\n\n                if (!(response instanceof responseCtor)) {\n                    try {\n                        response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n                    } catch (err) {\n                        self.emit(\"error\", err, method);\n                        return callback(err);\n                    }\n                }\n\n                self.emit(\"data\", response, method);\n                return callback(null, response);\n            }\n        );\n    } catch (err) {\n        self.emit(\"error\", err, method);\n        setTimeout(function() { callback(err); }, 0);\n        return undefined;\n    }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n    if (this.rpcImpl) {\n        if (!endedByRPC) // signal end to rpcImpl\n            this.rpcImpl(null, null, null);\n        this.rpcImpl = null;\n        this.emit(\"end\").off();\n    }\n    return this;\n};\n", "\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(15);\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n    // note that the casts below are theoretically unnecessary as of today, but older statically\n    // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n    /**\n     * Low bits.\n     * @type {number}\n     */\n    this.lo = lo >>> 0;\n\n    /**\n     * High bits.\n     * @type {number}\n     */\n    this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n    if (value === 0)\n        return zero;\n    var sign = value < 0;\n    if (sign)\n        value = -value;\n    var lo = value >>> 0,\n        hi = (value - lo) / 4294967296 >>> 0;\n    if (sign) {\n        hi = ~hi >>> 0;\n        lo = ~lo >>> 0;\n        if (++lo > 4294967295) {\n            lo = 0;\n            if (++hi > 4294967295)\n                hi = 0;\n        }\n    }\n    return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n    if (typeof value === \"number\")\n        return LongBits.fromNumber(value);\n    if (util.isString(value)) {\n        /* istanbul ignore else */\n        if (util.Long)\n            value = util.Long.fromString(value);\n        else\n            return LongBits.fromNumber(parseInt(value, 10));\n    }\n    return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n    if (!unsigned && this.hi >>> 31) {\n        var lo = ~this.lo + 1 >>> 0,\n            hi = ~this.hi     >>> 0;\n        if (!lo)\n            hi = hi + 1 >>> 0;\n        return -(lo + hi * 4294967296);\n    }\n    return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n    return util.Long\n        ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n        /* istanbul ignore next */\n        : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n    if (hash === zeroHash)\n        return zero;\n    return new LongBits(\n        ( charCodeAt.call(hash, 0)\n        | charCodeAt.call(hash, 1) << 8\n        | charCodeAt.call(hash, 2) << 16\n        | charCodeAt.call(hash, 3) << 24) >>> 0\n    ,\n        ( charCodeAt.call(hash, 4)\n        | charCodeAt.call(hash, 5) << 8\n        | charCodeAt.call(hash, 6) << 16\n        | charCodeAt.call(hash, 7) << 24) >>> 0\n    );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n    return String.fromCharCode(\n        this.lo        & 255,\n        this.lo >>> 8  & 255,\n        this.lo >>> 16 & 255,\n        this.lo >>> 24      ,\n        this.hi        & 255,\n        this.hi >>> 8  & 255,\n        this.hi >>> 16 & 255,\n        this.hi >>> 24\n    );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n    var mask =   this.hi >> 31;\n    this.hi  = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n    this.lo  = ( this.lo << 1                   ^ mask) >>> 0;\n    return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n    var mask = -(this.lo & 1);\n    this.lo  = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n    this.hi  = ( this.hi >>> 1                  ^ mask) >>> 0;\n    return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n    var part0 =  this.lo,\n        part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n        part2 =  this.hi >>> 24;\n    return part2 === 0\n         ? part1 === 0\n           ? part0 < 16384\n             ? part0 < 128 ? 1 : 2\n             : part0 < 2097152 ? 3 : 4\n           : part1 < 16384\n             ? part1 < 128 ? 5 : 6\n             : part1 < 2097152 ? 7 : 8\n         : part2 < 128 ? 9 : 10;\n};\n", "\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(1);\n\n// converts to / from base64 encoded strings\nutil.base64 = require(2);\n\n// base class of rpc.Service\nutil.EventEmitter = require(3);\n\n// float handling accross browsers\nutil.float = require(4);\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(5);\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(7);\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(6);\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(14);\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n                   && global\n                   && global.process\n                   && global.process.versions\n                   && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n           || typeof window !== \"undefined\" && window\n           || typeof self   !== \"undefined\" && self\n           || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n    return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n    return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n    return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n    var value = obj[prop];\n    if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n        return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n    return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor<Buffer>}\n */\nutil.Buffer = (function() {\n    try {\n        var Buffer = util.inquire(\"buffer\").Buffer;\n        // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n        return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n    } catch (e) {\n        /* istanbul ignore next */\n        return null;\n    }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n    /* istanbul ignore next */\n    return typeof sizeOrArray === \"number\"\n        ? util.Buffer\n            ? util._Buffer_allocUnsafe(sizeOrArray)\n            : new util.Array(sizeOrArray)\n        : util.Buffer\n            ? util._Buffer_from(sizeOrArray)\n            : typeof Uint8Array === \"undefined\"\n                ? sizeOrArray\n                : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor<Uint8Array>}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor<Long>}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n         || /* istanbul ignore next */ util.global.Long\n         || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n    return value\n        ? util.LongBits.from(value).toHash()\n        : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n    var bits = util.LongBits.fromHash(hash);\n    if (util.Long)\n        return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n    return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.<string,*>} dst Destination object\n * @param {Object.<string,*>} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.<string,*>} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n    for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n        if (dst[keys[i]] === undefined || !ifNotSet)\n            dst[keys[i]] = src[keys[i]];\n    return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n    return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor<Error>} Custom error constructor\n */\nfunction newError(name) {\n\n    function CustomError(message, properties) {\n\n        if (!(this instanceof CustomError))\n            return new CustomError(message, properties);\n\n        // Error.call(this, message);\n        // ^ just returns a new error instance because the ctor can be called as a function\n\n        Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n        /* istanbul ignore next */\n        if (Error.captureStackTrace) // node\n            Error.captureStackTrace(this, CustomError);\n        else\n            Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n        if (properties)\n            merge(this, properties);\n    }\n\n    CustomError.prototype = Object.create(Error.prototype, {\n        constructor: {\n            value: CustomError,\n            writable: true,\n            enumerable: false,\n            configurable: true,\n        },\n        name: {\n            get: function get() { return name; },\n            set: undefined,\n            enumerable: false,\n            // configurable: false would accurately preserve the behavior of\n            // the original, but I'm guessing that was not intentional.\n            // For an actual error subclass, this property would\n            // be configurable.\n            configurable: true,\n        },\n        toString: {\n            value: function value() { return this.name + \": \" + this.message; },\n            writable: true,\n            enumerable: false,\n            configurable: true,\n        },\n    });\n\n    return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message<T>\n * @constructor\n * @param {string} message Error message\n * @param {Object.<string,*>} [properties] Additional properties\n * @example\n * try {\n *     MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n *     if (e instanceof ProtocolError && e.instance)\n *         console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message<T>}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n    var fieldMap = {};\n    for (var i = 0; i < fieldNames.length; ++i)\n        fieldMap[fieldNames[i]] = 1;\n\n    /**\n     * @returns {string|undefined} Set field name, if any\n     * @this Object\n     * @ignore\n     */\n    return function() { // eslint-disable-line consistent-return\n        for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n            if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n                return keys[i];\n    };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n    /**\n     * @param {string} name Field name\n     * @returns {undefined}\n     * @this Object\n     * @ignore\n     */\n    return function(name) {\n        for (var i = 0; i < fieldNames.length; ++i)\n            if (fieldNames[i] !== name)\n                delete this[fieldNames[i]];\n    };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n    longs: String,\n    enums: String,\n    bytes: String,\n    json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n    var Buffer = util.Buffer;\n    /* istanbul ignore if */\n    if (!Buffer) {\n        util._Buffer_from = util._Buffer_allocUnsafe = null;\n        return;\n    }\n    // because node 4.x buffers are incompatible & immutable\n    // see: https://github.com/dcodeIO/protobuf.js/pull/665\n    util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n        /* istanbul ignore next */\n        function Buffer_from(value, encoding) {\n            return new Buffer(value, encoding);\n        };\n    util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n        /* istanbul ignore next */\n        function Buffer_allocUnsafe(size) {\n            return new Buffer(size);\n        };\n};\n", "\"use strict\";\nmodule.exports = Writer;\n\nvar util      = require(15);\n\nvar BufferWriter; // cyclic\n\nvar LongBits  = util.LongBits,\n    base64    = util.base64,\n    utf8      = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n    /**\n     * Function to call.\n     * @type {function(Uint8Array, number, *)}\n     */\n    this.fn = fn;\n\n    /**\n     * Value byte length.\n     * @type {number}\n     */\n    this.len = len;\n\n    /**\n     * Next operation.\n     * @type {Writer.Op|undefined}\n     */\n    this.next = undefined;\n\n    /**\n     * Value to write.\n     * @type {*}\n     */\n    this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n    /**\n     * Current head.\n     * @type {Writer.Op}\n     */\n    this.head = writer.head;\n\n    /**\n     * Current tail.\n     * @type {Writer.Op}\n     */\n    this.tail = writer.tail;\n\n    /**\n     * Current buffer length.\n     * @type {number}\n     */\n    this.len = writer.len;\n\n    /**\n     * Next state.\n     * @type {State|null}\n     */\n    this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n    /**\n     * Current length.\n     * @type {number}\n     */\n    this.len = 0;\n\n    /**\n     * Operations head.\n     * @type {Object}\n     */\n    this.head = new Op(noop, 0, 0);\n\n    /**\n     * Operations tail\n     * @type {Object}\n     */\n    this.tail = this.head;\n\n    /**\n     * Linked forked states.\n     * @type {Object|null}\n     */\n    this.states = null;\n\n    // When a value is written, the writer calculates its byte length and puts it into a linked\n    // list of operations to perform when finish() is called. This both allows us to allocate\n    // buffers of the exact required size and reduces the amount of work we have to do compared\n    // to first calculating over objects and then encoding over objects. In our case, the encoding\n    // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n    return util.Buffer\n        ? function create_buffer_setup() {\n            return (Writer.create = function create_buffer() {\n                return new BufferWriter();\n            })();\n        }\n        /* istanbul ignore next */\n        : function create_array() {\n            return new Writer();\n        };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n    return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n    Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n    this.tail = this.tail.next = new Op(fn, len, val);\n    this.len += len;\n    return this;\n};\n\nfunction writeByte(val, buf, pos) {\n    buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n    while (val > 127) {\n        buf[pos++] = val & 127 | 128;\n        val >>>= 7;\n    }\n    buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n    this.len = len;\n    this.next = undefined;\n    this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n    // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n    // uint32 is by far the most frequently used operation and benefits significantly from this.\n    this.len += (this.tail = this.tail.next = new VarintOp(\n        (value = value >>> 0)\n                < 128       ? 1\n        : value < 16384     ? 2\n        : value < 2097152   ? 3\n        : value < 268435456 ? 4\n        :                     5,\n    value)).len;\n    return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n    return value < 0\n        ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n        : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n    return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n    while (val.hi) {\n        buf[pos++] = val.lo & 127 | 128;\n        val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n        val.hi >>>= 7;\n    }\n    while (val.lo > 127) {\n        buf[pos++] = val.lo & 127 | 128;\n        val.lo = val.lo >>> 7;\n    }\n    buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n    var bits = LongBits.from(value);\n    return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n    var bits = LongBits.from(value).zzEncode();\n    return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n    return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n    buf[pos    ] =  val         & 255;\n    buf[pos + 1] =  val >>> 8   & 255;\n    buf[pos + 2] =  val >>> 16  & 255;\n    buf[pos + 3] =  val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n    return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n    var bits = LongBits.from(value);\n    return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n    return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n    return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n    ? function writeBytes_set(val, buf, pos) {\n        buf.set(val, pos); // also works for plain array values\n    }\n    /* istanbul ignore next */\n    : function writeBytes_for(val, buf, pos) {\n        for (var i = 0; i < val.length; ++i)\n            buf[pos + i] = val[i];\n    };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n    var len = value.length >>> 0;\n    if (!len)\n        return this._push(writeByte, 1, 0);\n    if (util.isString(value)) {\n        var buf = Writer.alloc(len = base64.length(value));\n        base64.decode(value, buf, 0);\n        value = buf;\n    }\n    return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n    var len = utf8.length(value);\n    return len\n        ? this.uint32(len)._push(utf8.write, len, value)\n        : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n    this.states = new State(this);\n    this.head = this.tail = new Op(noop, 0, 0);\n    this.len = 0;\n    return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n    if (this.states) {\n        this.head   = this.states.head;\n        this.tail   = this.states.tail;\n        this.len    = this.states.len;\n        this.states = this.states.next;\n    } else {\n        this.head = this.tail = new Op(noop, 0, 0);\n        this.len  = 0;\n    }\n    return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n    var head = this.head,\n        tail = this.tail,\n        len  = this.len;\n    this.reset().uint32(len);\n    if (len) {\n        this.tail.next = head.next; // skip noop\n        this.tail = tail;\n        this.len += len;\n    }\n    return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n    var head = this.head.next, // skip noop\n        buf  = this.constructor.alloc(this.len),\n        pos  = 0;\n    while (head) {\n        head.fn(head.val, buf, pos);\n        pos += head.len;\n        head = head.next;\n    }\n    // this.head = this.tail = null;\n    return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n    BufferWriter = BufferWriter_;\n    Writer.create = create();\n    BufferWriter._configure();\n};\n", "\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(16);\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(15);\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n    Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n    /**\n     * Allocates a buffer of the specified size.\n     * @function\n     * @param {number} size Buffer size\n     * @returns {Buffer} Buffer\n     */\n    BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n    BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n        ? function writeBytesBuffer_set(val, buf, pos) {\n          buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n          // also works for plain array values\n        }\n        /* istanbul ignore next */\n        : function writeBytesBuffer_copy(val, buf, pos) {\n          if (val.copy) // Buffer values\n            val.copy(buf, pos, 0, val.length);\n          else for (var i = 0; i < val.length;) // plain array values\n            buf[pos++] = val[i++];\n        };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n    if (util.isString(value))\n        value = util._Buffer_from(value, \"base64\");\n    var len = value.length >>> 0;\n    this.uint32(len);\n    if (len)\n        this._push(BufferWriter.writeBytesBuffer, len, value);\n    return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n    if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n        util.utf8.write(val, buf, pos);\n    else if (buf.utf8Write)\n        buf.utf8Write(val, pos);\n    else\n        buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n    var len = util.Buffer.byteLength(value);\n    this.uint32(len);\n    if (len)\n        this._push(writeStringBuffer, len, value);\n    return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n", "/* jshint forin: false, bitwise: false */\n/*\nCopyright 2015-2018 Esri\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\nA copy of the license and additional notices are located with the\nsource distribution at:\n\nhttp://github.com/Esri/lerc/\n\nContributors:  Johannes Schmid, (LERC v1)\n               Chayanika Khatua, (LERC v1)\n               Wenxue Ju (LERC v1, v2.x)\n*/\n\n/* Copyright 2015-2018 Esri. 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 @preserve */\n\n/**\n * a module for decoding LERC blobs\n * @module Lerc\n */\n(function() {\n  //the original LercDecode for Version 1\n  var LercDecode = (function() {\n\n    // WARNING: This decoder version can only read old version 1 Lerc blobs. Use with caution.\n\n    // Note: currently, this module only has an implementation for decoding LERC data, not encoding. The name of\n    // the class was chosen to be future proof.\n\n    var CntZImage = {};\n\n    CntZImage.defaultNoDataValue = -3.4027999387901484e+38; // smallest Float32 value\n\n    /**\n     * Decode a LERC byte stream and return an object containing the pixel data and some required and optional\n     * information about it, such as the image's width and height.\n     *\n     * @param {ArrayBuffer} input The LERC input byte stream\n     * @param {object} [options] Decoding options, containing any of the following properties:\n     * @config {number} [inputOffset = 0]\n     *        Skip the first inputOffset bytes of the input byte stream. A valid LERC file is expected at that position.\n     * @config {Uint8Array} [encodedMask = null]\n     *        If specified, the decoder will not read mask information from the input and use the specified encoded\n     *        mask data instead. Mask header/data must not be present in the LERC byte stream in this case.\n     * @config {number} [noDataValue = LercCode.defaultNoDataValue]\n     *        Pixel value to use for masked pixels.\n     * @config {ArrayBufferView|Array} [pixelType = Float32Array]\n     *        The desired type of the pixelData array in the return value. Note that it is the caller's responsibility to\n     *        provide an appropriate noDataValue if the default pixelType is overridden.\n     * @config {boolean} [returnMask = false]\n     *        If true, the return value will contain a maskData property of type Uint8Array which has one element per\n     *        pixel, the value of which is 1 or 0 depending on whether that pixel's data is present or masked. If the\n     *        input LERC data does not contain a mask, maskData will not be returned.\n     * @config {boolean} [returnEncodedMask = false]\n     *        If true, the return value will contain a encodedMaskData property, which can be passed into encode() as\n     *        encodedMask.\n     * @config {boolean} [returnFileInfo = false]\n     *        If true, the return value will have a fileInfo property that contains metadata obtained from the\n     *        LERC headers and the decoding process.\n     * @config {boolean} [computeUsedBitDepths = false]\n     *        If true, the fileInfo property in the return value will contain the set of all block bit depths\n     *        encountered during decoding. Will only have an effect if returnFileInfo option is true.\n     * @returns {{width, height, pixelData, minValue, maxValue, noDataValue, maskData, encodedMaskData, fileInfo}}\n     */\n    CntZImage.decode = function(input, options) {\n      options = options || {};\n\n      var skipMask = options.encodedMaskData || (options.encodedMaskData === null);\n      var parsedData = parse(input, options.inputOffset || 0, skipMask);\n\n      var noDataValue = (options.noDataValue !== null) ? options.noDataValue : CntZImage.defaultNoDataValue;\n\n      var uncompressedData = uncompressPixelValues(parsedData, options.pixelType || Float32Array,\n        options.encodedMaskData, noDataValue, options.returnMask);\n\n      var result = {\n        width: parsedData.width,\n        height: parsedData.height,\n        pixelData: uncompressedData.resultPixels,\n        minValue: uncompressedData.minValue,\n        maxValue: parsedData.pixels.maxValue,\n        noDataValue: noDataValue\n      };\n\n      if (uncompressedData.resultMask) {\n        result.maskData = uncompressedData.resultMask;\n      }\n\n      if (options.returnEncodedMask && parsedData.mask) {\n        result.encodedMaskData = parsedData.mask.bitset ? parsedData.mask.bitset : null;\n      }\n\n      if (options.returnFileInfo) {\n        result.fileInfo = formatFileInfo(parsedData);\n        if (options.computeUsedBitDepths) {\n          result.fileInfo.bitDepths = computeUsedBitDepths(parsedData);\n        }\n      }\n\n      return result;\n    };\n\n    var uncompressPixelValues = function(data, TypedArrayClass, maskBitset, noDataValue, storeDecodedMask) {\n      var blockIdx = 0;\n      var numX = data.pixels.numBlocksX;\n      var numY = data.pixels.numBlocksY;\n      var blockWidth = Math.floor(data.width / numX);\n      var blockHeight = Math.floor(data.height / numY);\n      var scale = 2 * data.maxZError;\n      var minValue = Number.MAX_VALUE, currentValue;\n      maskBitset = maskBitset || ((data.mask) ? data.mask.bitset : null);\n\n      var resultPixels, resultMask;\n      resultPixels = new TypedArrayClass(data.width * data.height);\n      if (storeDecodedMask && maskBitset) {\n        resultMask = new Uint8Array(data.width * data.height);\n      }\n      var blockDataBuffer = new Float32Array(blockWidth * blockHeight);\n\n      var xx, yy;\n      for (var y = 0; y <= numY; y++) {\n        var thisBlockHeight = (y !== numY) ? blockHeight : (data.height % numY);\n        if (thisBlockHeight === 0) {\n          continue;\n        }\n        for (var x = 0; x <= numX; x++) {\n          var thisBlockWidth = (x !== numX) ? blockWidth : (data.width % numX);\n          if (thisBlockWidth === 0) {\n            continue;\n          }\n\n          var outPtr = y * data.width * blockHeight + x * blockWidth;\n          var outStride = data.width - thisBlockWidth;\n\n          var block = data.pixels.blocks[blockIdx];\n\n          var blockData, blockPtr, constValue;\n          if (block.encoding < 2) {\n            // block is either uncompressed or bit-stuffed (encodings 0 and 1)\n            if (block.encoding === 0) {\n              // block is uncompressed\n              blockData = block.rawData;\n            } else {\n              // block is bit-stuffed\n              unstuff(block.stuffedData, block.bitsPerPixel, block.numValidPixels, block.offset, scale, blockDataBuffer, data.pixels.maxValue);\n              blockData = blockDataBuffer;\n            }\n            blockPtr = 0;\n          }\n          else if (block.encoding === 2) {\n            // block is all 0\n            constValue = 0;\n          }\n          else {\n            // block has constant value (encoding === 3)\n            constValue = block.offset;\n          }\n\n          var maskByte;\n          if (maskBitset) {\n            for (yy = 0; yy < thisBlockHeight; yy++) {\n              if (outPtr & 7) {\n                //\n                maskByte = maskBitset[outPtr >> 3];\n                maskByte <<= outPtr & 7;\n              }\n              for (xx = 0; xx < thisBlockWidth; xx++) {\n                if (!(outPtr & 7)) {\n                  // read next byte from mask\n                  maskByte = maskBitset[outPtr >> 3];\n                }\n                if (maskByte & 128) {\n                  // pixel data present\n                  if (resultMask) {\n                    resultMask[outPtr] = 1;\n                  }\n                  currentValue = (block.encoding < 2) ? blockData[blockPtr++] : constValue;\n                  minValue = minValue > currentValue ? currentValue : minValue;\n                  resultPixels[outPtr++] = currentValue;\n                } else {\n                  // pixel data not present\n                  if (resultMask) {\n                    resultMask[outPtr] = 0;\n                  }\n                  resultPixels[outPtr++] = noDataValue;\n                }\n                maskByte <<= 1;\n              }\n              outPtr += outStride;\n            }\n          } else {\n            // mask not present, simply copy block over\n            if (block.encoding < 2) {\n              // duplicating this code block for performance reasons\n              // blockData case:\n              for (yy = 0; yy < thisBlockHeight; yy++) {\n                for (xx = 0; xx < thisBlockWidth; xx++) {\n                  currentValue = blockData[blockPtr++];\n                  minValue = minValue > currentValue ? currentValue : minValue;\n                  resultPixels[outPtr++] = currentValue;\n                }\n                outPtr += outStride;\n              }\n            }\n            else {\n              // constValue case:\n              minValue = minValue > constValue ? constValue : minValue;\n              for (yy = 0; yy < thisBlockHeight; yy++) {\n                for (xx = 0; xx < thisBlockWidth; xx++) {\n                  resultPixels[outPtr++] = constValue;\n                }\n                outPtr += outStride;\n              }\n            }\n          }\n          if ((block.encoding === 1) && (blockPtr !== block.numValidPixels)) {\n            throw \"Block and Mask do not match\";\n          }\n          blockIdx++;\n        }\n      }\n\n      return {\n        resultPixels: resultPixels,\n        resultMask: resultMask,\n        minValue: minValue\n      };\n    };\n\n    var formatFileInfo = function(data) {\n      return {\n        \"fileIdentifierString\": data.fileIdentifierString,\n        \"fileVersion\": data.fileVersion,\n        \"imageType\": data.imageType,\n        \"height\": data.height,\n        \"width\": data.width,\n        \"maxZError\": data.maxZError,\n        \"eofOffset\": data.eofOffset,\n        \"mask\": data.mask ? {\n          \"numBlocksX\": data.mask.numBlocksX,\n          \"numBlocksY\": data.mask.numBlocksY,\n          \"numBytes\": data.mask.numBytes,\n          \"maxValue\": data.mask.maxValue\n        } : null,\n        \"pixels\": {\n          \"numBlocksX\": data.pixels.numBlocksX,\n          \"numBlocksY\": data.pixels.numBlocksY,\n          \"numBytes\": data.pixels.numBytes,\n          \"maxValue\": data.pixels.maxValue,\n          \"noDataValue\": data.noDataValue\n        }\n      };\n    };\n\n    var computeUsedBitDepths = function(data) {\n      var numBlocks = data.pixels.numBlocksX * data.pixels.numBlocksY;\n      var bitDepths = {};\n      for (var i = 0; i < numBlocks; i++) {\n        var block = data.pixels.blocks[i];\n        if (block.encoding === 0) {\n          bitDepths.float32 = true;\n        } else if (block.encoding === 1) {\n          bitDepths[block.bitsPerPixel] = true;\n        } else {\n          bitDepths[0] = true;\n        }\n      }\n\n      return Object.keys(bitDepths);\n    };\n\n    var parse = function(input, fp, skipMask) {\n      var data = {};\n\n      // File header\n      var fileIdView = new Uint8Array(input, fp, 10);\n      data.fileIdentifierString = String.fromCharCode.apply(null, fileIdView);\n      if (data.fileIdentifierString.trim() !== \"CntZImage\") {\n        throw \"Unexpected file identifier string: \" + data.fileIdentifierString;\n      }\n      fp += 10;\n      var view = new DataView(input, fp, 24);\n      data.fileVersion = view.getInt32(0, true);\n      data.imageType = view.getInt32(4, true);\n      data.height = view.getUint32(8, true);\n      data.width = view.getUint32(12, true);\n      data.maxZError = view.getFloat64(16, true);\n      fp += 24;\n\n      // Mask Header\n      if (!skipMask) {\n        view = new DataView(input, fp, 16);\n        data.mask = {};\n        data.mask.numBlocksY = view.getUint32(0, true);\n        data.mask.numBlocksX = view.getUint32(4, true);\n        data.mask.numBytes = view.getUint32(8, true);\n        data.mask.maxValue = view.getFloat32(12, true);\n        fp += 16;\n\n        // Mask Data\n        if (data.mask.numBytes > 0) {\n          var bitset = new Uint8Array(Math.ceil(data.width * data.height / 8));\n          view = new DataView(input, fp, data.mask.numBytes);\n          var cnt = view.getInt16(0, true);\n          var ip = 2, op = 0;\n          do {\n            if (cnt > 0) {\n              while (cnt--) { bitset[op++] = view.getUint8(ip++); }\n            } else {\n              var val = view.getUint8(ip++);\n              cnt = -cnt;\n              while (cnt--) { bitset[op++] = val; }\n            }\n            cnt = view.getInt16(ip, true);\n            ip += 2;\n          } while (ip < data.mask.numBytes);\n          if ((cnt !== -32768) || (op < bitset.length)) {\n            throw \"Unexpected end of mask RLE encoding\";\n          }\n          data.mask.bitset = bitset;\n          fp += data.mask.numBytes;\n        }\n        else if ((data.mask.numBytes | data.mask.numBlocksY | data.mask.maxValue) === 0) {  // Special case, all nodata\n          data.mask.bitset = new Uint8Array(Math.ceil(data.width * data.height / 8));\n        }\n      }\n\n      // Pixel Header\n      view = new DataView(input, fp, 16);\n      data.pixels = {};\n      data.pixels.numBlocksY = view.getUint32(0, true);\n      data.pixels.numBlocksX = view.getUint32(4, true);\n      data.pixels.numBytes = view.getUint32(8, true);\n      data.pixels.maxValue = view.getFloat32(12, true);\n      fp += 16;\n\n      var numBlocksX = data.pixels.numBlocksX;\n      var numBlocksY = data.pixels.numBlocksY;\n      // the number of blocks specified in the header does not take into account the blocks at the end of\n      // each row/column with a special width/height that make the image complete in case the width is not\n      // evenly divisible by the number of blocks.\n      var actualNumBlocksX = numBlocksX + ((data.width % numBlocksX) > 0 ? 1 : 0);\n      var actualNumBlocksY = numBlocksY + ((data.height % numBlocksY) > 0 ? 1 : 0);\n      data.pixels.blocks = new Array(actualNumBlocksX * actualNumBlocksY);\n      var blockI = 0;\n      for (var blockY = 0; blockY < actualNumBlocksY; blockY++) {\n        for (var blockX = 0; blockX < actualNumBlocksX; blockX++) {\n\n          // Block\n          var size = 0;\n          var bytesLeft = input.byteLength - fp;\n          view = new DataView(input, fp, Math.min(10, bytesLeft));\n          var block = {};\n          data.pixels.blocks[blockI++] = block;\n          var headerByte = view.getUint8(0); size++;\n          block.encoding = headerByte & 63;\n          if (block.encoding > 3) {\n            throw \"Invalid block encoding (\" + block.encoding + \")\";\n          }\n          if (block.encoding === 2) {\n            fp++;\n            continue;\n          }\n          if ((headerByte !== 0) && (headerByte !== 2)) {\n            headerByte >>= 6;\n            block.offsetType = headerByte;\n            if (headerByte === 2) {\n              block.offset = view.getInt8(1); size++;\n            } else if (headerByte === 1) {\n              block.offset = view.getInt16(1, true); size += 2;\n            } else if (headerByte === 0) {\n              block.offset = view.getFloat32(1, true); size += 4;\n            } else {\n              throw \"Invalid block offset type\";\n            }\n\n            if (block.encoding === 1) {\n              headerByte = view.getUint8(size); size++;\n              block.bitsPerPixel = headerByte & 63;\n              headerByte >>= 6;\n              block.numValidPixelsType = headerByte;\n              if (headerByte === 2) {\n                block.numValidPixels = view.getUint8(size); size++;\n              } else if (headerByte === 1) {\n                block.numValidPixels = view.getUint16(size, true); size += 2;\n              } else if (headerByte === 0) {\n                block.numValidPixels = view.getUint32(size, true); size += 4;\n              } else {\n                throw \"Invalid valid pixel count type\";\n              }\n            }\n          }\n          fp += size;\n\n          if (block.encoding === 3) {\n            continue;\n          }\n\n          var arrayBuf, store8;\n          if (block.encoding === 0) {\n            var numPixels = (data.pixels.numBytes - 1) / 4;\n            if (numPixels !== Math.floor(numPixels)) {\n              throw \"uncompressed block has invalid length\";\n            }\n            arrayBuf = new ArrayBuffer(numPixels * 4);\n            store8 = new Uint8Array(arrayBuf);\n            store8.set(new Uint8Array(input, fp, numPixels * 4));\n            var rawData = new Float32Array(arrayBuf);\n            block.rawData = rawData;\n            fp += numPixels * 4;\n          } else if (block.encoding === 1) {\n            var dataBytes = Math.ceil(block.numValidPixels * block.bitsPerPixel / 8);\n            var dataWords = Math.ceil(dataBytes / 4);\n            arrayBuf = new ArrayBuffer(dataWords * 4);\n            store8 = new Uint8Array(arrayBuf);\n            store8.set(new Uint8Array(input, fp, dataBytes));\n            block.stuffedData = new Uint32Array(arrayBuf);\n            fp += dataBytes;\n          }\n        }\n      }\n      data.eofOffset = fp;\n      return data;\n    };\n\n    var unstuff = function(src, bitsPerPixel, numPixels, offset, scale, dest, maxValue) {\n      var bitMask = (1 << bitsPerPixel) - 1;\n      var i = 0, o;\n      var bitsLeft = 0;\n      var n, buffer;\n      var nmax = Math.ceil((maxValue - offset) / scale);\n      // get rid of trailing bytes that are already part of next block\n      var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);\n      src[src.length - 1] <<= 8 * numInvalidTailBytes;\n\n      for (o = 0; o < numPixels; o++) {\n        if (bitsLeft === 0) {\n          buffer = src[i++];\n          bitsLeft = 32;\n        }\n        if (bitsLeft >= bitsPerPixel) {\n          n = (buffer >>> (bitsLeft - bitsPerPixel)) & bitMask;\n          bitsLeft -= bitsPerPixel;\n        } else {\n          var missingBits = (bitsPerPixel - bitsLeft);\n          n = ((buffer & bitMask) << missingBits) & bitMask;\n          buffer = src[i++];\n          bitsLeft = 32 - missingBits;\n          n += (buffer >>> bitsLeft);\n        }\n        //pixel values may exceed max due to quantization\n        dest[o] = n < nmax ? offset + n * scale : maxValue;\n      }\n      return dest;\n    };\n\n    return CntZImage;\n  })();\n\n  //version 2. Supports 2.1, 2.2, 2.3\n  var Lerc2Decode = (function() {\n    \"use strict\";\n    // Note: currently, this module only has an implementation for decoding LERC data, not encoding. The name of\n    // the class was chosen to be future proof, following LercDecode.\n\n    /*****************************************\n    * private static class bitsutffer used by Lerc2Decode\n    *******************************************/\n    var BitStuffer = {\n      //methods ending with 2 are for the new byte order used by Lerc2.3 and above.\n      //originalUnstuff is used to unpack Huffman code table. code is duplicated to unstuffx for performance reasons.\n      unstuff: function(src, dest, bitsPerPixel, numPixels, lutArr, offset, scale, maxValue) {\n        var bitMask = (1 << bitsPerPixel) - 1;\n        var i = 0, o;\n        var bitsLeft = 0;\n        var n, buffer, missingBits, nmax;\n\n        // get rid of trailing bytes that are already part of next block\n        var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);\n        src[src.length - 1] <<= 8 * numInvalidTailBytes;\n        if (lutArr) {\n          for (o = 0; o < numPixels; o++) {\n            if (bitsLeft === 0) {\n              buffer = src[i++];\n              bitsLeft = 32;\n            }\n            if (bitsLeft >= bitsPerPixel) {\n              n = (buffer >>> (bitsLeft - bitsPerPixel)) & bitMask;\n              bitsLeft -= bitsPerPixel;\n            }\n            else {\n              missingBits = (bitsPerPixel - bitsLeft);\n              n = ((buffer & bitMask) << missingBits) & bitMask;\n              buffer = src[i++];\n              bitsLeft = 32 - missingBits;\n              n += (buffer >>> bitsLeft);\n            }\n            dest[o] = lutArr[n];//offset + lutArr[n] * scale;\n          }\n        }\n        else {\n          nmax = Math.ceil((maxValue - offset) / scale);\n          for (o = 0; o < numPixels; o++) {\n            if (bitsLeft === 0) {\n              buffer = src[i++];\n              bitsLeft = 32;\n            }\n            if (bitsLeft >= bitsPerPixel) {\n              n = (buffer >>> (bitsLeft - bitsPerPixel)) & bitMask;\n              bitsLeft -= bitsPerPixel;\n            }\n            else {\n              missingBits = (bitsPerPixel - bitsLeft);\n              n = ((buffer & bitMask) << missingBits) & bitMask;\n              buffer = src[i++];\n              bitsLeft = 32 - missingBits;\n              n += (buffer >>> bitsLeft);\n            }\n            //pixel values may exceed max due to quantization\n            dest[o] = n < nmax ? offset + n * scale : maxValue;\n          }\n        }\n      },\n\n      unstuffLUT: function(src, bitsPerPixel, numPixels, offset, scale, maxValue) {\n        var bitMask = (1 << bitsPerPixel) - 1;\n        var i = 0, o = 0, missingBits = 0, bitsLeft = 0, n = 0;\n        var buffer;\n        var dest = [];\n\n        // get rid of trailing bytes that are already part of next block\n        var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);\n        src[src.length - 1] <<= 8 * numInvalidTailBytes;\n\n        var nmax = Math.ceil((maxValue - offset) / scale);\n        for (o = 0; o < numPixels; o++) {\n          if (bitsLeft === 0) {\n            buffer = src[i++];\n            bitsLeft = 32;\n          }\n          if (bitsLeft >= bitsPerPixel) {\n            n = (buffer >>> (bitsLeft - bitsPerPixel)) & bitMask;\n            bitsLeft -= bitsPerPixel;\n          } else {\n            missingBits = (bitsPerPixel - bitsLeft);\n            n = ((buffer & bitMask) << missingBits) & bitMask;\n            buffer = src[i++];\n            bitsLeft = 32 - missingBits;\n            n += (buffer >>> bitsLeft);\n          }\n          //dest.push(n);\n          dest[o] = n < nmax ? offset + n * scale : maxValue;\n        }\n        dest.unshift(offset);//1st one\n        return dest;\n      },\n\n      unstuff2: function(src, dest, bitsPerPixel, numPixels, lutArr, offset, scale, maxValue) {\n        var bitMask = (1 << bitsPerPixel) - 1;\n        var i = 0, o;\n        var bitsLeft = 0, bitPos = 0;\n        var n, buffer, missingBits;\n        if (lutArr) {\n          for (o = 0; o < numPixels; o++) {\n            if (bitsLeft === 0) {\n              buffer = src[i++];\n              bitsLeft = 32;\n              bitPos = 0;\n            }\n            if (bitsLeft >= bitsPerPixel) {\n              n = ((buffer >>> bitPos) & bitMask);\n              bitsLeft -= bitsPerPixel;\n              bitPos += bitsPerPixel;\n            } else {\n              missingBits = (bitsPerPixel - bitsLeft);\n              n = (buffer >>> bitPos) & bitMask;\n              buffer = src[i++];\n              bitsLeft = 32 - missingBits;\n              n |= (buffer & ((1 << missingBits) - 1)) << (bitsPerPixel - missingBits);\n              bitPos = missingBits;\n            }\n            dest[o] = lutArr[n];\n          }\n        }\n        else {\n          var nmax = Math.ceil((maxValue - offset) / scale);\n          for (o = 0; o < numPixels; o++) {\n            if (bitsLeft === 0) {\n              buffer = src[i++];\n              bitsLeft = 32;\n              bitPos = 0;\n            }\n            if (bitsLeft >= bitsPerPixel) {\n              //no unsigned left shift\n              n = ((buffer >>> bitPos) & bitMask);\n              bitsLeft -= bitsPerPixel;\n              bitPos += bitsPerPixel;\n            } else {\n              missingBits = (bitsPerPixel - bitsLeft);\n              n = (buffer >>> bitPos) & bitMask;//((buffer & bitMask) << missingBits) & bitMask;\n              buffer = src[i++];\n              bitsLeft = 32 - missingBits;\n              n |= (buffer & ((1 << missingBits) - 1)) << (bitsPerPixel - missingBits);\n              bitPos = missingBits;\n            }\n            //pixel values may exceed max due to quantization\n            dest[o] = n < nmax ? offset + n * scale : maxValue;\n          }\n        }\n        return dest;\n      },\n\n      unstuffLUT2: function(src, bitsPerPixel, numPixels, offset, scale, maxValue) {\n        var bitMask = (1 << bitsPerPixel) - 1;\n        var i = 0, o = 0, missingBits = 0, bitsLeft = 0, n = 0, bitPos = 0;\n        var buffer;\n        var dest = [];\n        var nmax = Math.ceil((maxValue - offset) / scale);\n        for (o = 0; o < numPixels; o++) {\n          if (bitsLeft === 0) {\n            buffer = src[i++];\n            bitsLeft = 32;\n            bitPos = 0;\n          }\n          if (bitsLeft >= bitsPerPixel) {\n            //no unsigned left shift\n            n = ((buffer >>> bitPos) & bitMask);\n            bitsLeft -= bitsPerPixel;\n            bitPos += bitsPerPixel;\n          } else {\n            missingBits = (bitsPerPixel - bitsLeft);\n            n = (buffer >>> bitPos) & bitMask;//((buffer & bitMask) << missingBits) & bitMask;\n            buffer = src[i++];\n            bitsLeft = 32 - missingBits;\n            n |= (buffer & ((1 << missingBits) - 1)) << (bitsPerPixel - missingBits);\n            bitPos = missingBits;\n          }\n          //dest.push(n);\n          dest[o] = n < nmax ? offset + n * scale : maxValue;\n        }\n        dest.unshift(offset);\n        return dest;\n      },\n\n      originalUnstuff: function(src, dest, bitsPerPixel, numPixels) {\n        var bitMask = (1 << bitsPerPixel) - 1;\n        var i = 0, o;\n        var bitsLeft = 0;\n        var n, buffer, missingBits;\n\n        // get rid of trailing bytes that are already part of next block\n        var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);\n        src[src.length - 1] <<= 8 * numInvalidTailBytes;\n\n        for (o = 0; o < numPixels; o++) {\n          if (bitsLeft === 0) {\n            buffer = src[i++];\n            bitsLeft = 32;\n          }\n          if (bitsLeft >= bitsPerPixel) {\n            n = (buffer >>> (bitsLeft - bitsPerPixel)) & bitMask;\n            bitsLeft -= bitsPerPixel;\n          }\n          else {\n            missingBits = (bitsPerPixel - bitsLeft);\n            n = ((buffer & bitMask) << missingBits) & bitMask;\n            buffer = src[i++];\n            bitsLeft = 32 - missingBits;\n            n += (buffer >>> bitsLeft);\n          }\n          dest[o] = n;\n        }\n        return dest;\n      },\n\n      originalUnstuff2: function(src, dest, bitsPerPixel, numPixels) {\n        var bitMask = (1 << bitsPerPixel) - 1;\n        var i = 0, o;\n        var bitsLeft = 0, bitPos = 0;\n        var n, buffer, missingBits;\n        //micro-optimizations\n        for (o = 0; o < numPixels; o++) {\n          if (bitsLeft === 0) {\n            buffer = src[i++];\n            bitsLeft = 32;\n            bitPos = 0;\n          }\n          if (bitsLeft >= bitsPerPixel) {\n            //no unsigned left shift\n            n = ((buffer >>> bitPos) & bitMask);\n            bitsLeft -= bitsPerPixel;\n            bitPos += bitsPerPixel;\n          } else {\n            missingBits = (bitsPerPixel - bitsLeft);\n            n = (buffer >>> bitPos) & bitMask;//((buffer & bitMask) << missingBits) & bitMask;\n            buffer = src[i++];\n            bitsLeft = 32 - missingBits;\n            n |= (buffer & ((1 << missingBits) - 1)) << (bitsPerPixel - missingBits);\n            bitPos = missingBits;\n          }\n          dest[o] = n;\n        }\n        return dest;\n      }\n    };\n\n    /*****************************************\n    *private static class used by Lerc2Decode\n    ******************************************/\n    var Lerc2Helpers = {\n      HUFFMAN_LUT_BITS_MAX: 12, //use 2^12 lut, treat it like constant\n      computeChecksumFletcher32: function(input) {\n\n        var sum1 = 0xffff, sum2 = 0xffff;\n        var len = input.length;\n        var words = Math.floor(len / 2);\n        var i = 0;\n        while (words) {\n          var tlen = (words >= 359) ? 359 : words;\n          words -= tlen;\n          do {\n            sum1 += (input[i++] << 8);\n            sum2 += sum1 += input[i++];\n          } while (--tlen);\n\n          sum1 = (sum1 & 0xffff) + (sum1 >>> 16);\n          sum2 = (sum2 & 0xffff) + (sum2 >>> 16);\n        }\n\n        // add the straggler byte if it exists\n        if (len & 1) {\n          sum2 += sum1 += (input[i] << 8);\n        }\n        // second reduction step to reduce sums to 16 bits\n        sum1 = (sum1 & 0xffff) + (sum1 >>> 16);\n        sum2 = (sum2 & 0xffff) + (sum2 >>> 16);\n\n        return (sum2 << 16 | sum1) >>> 0;\n      },\n\n      readHeaderInfo: function(input, data) {\n        var ptr = data.ptr;\n        var fileIdView = new Uint8Array(input, ptr, 6);\n        var headerInfo = {};\n        headerInfo.fileIdentifierString = String.fromCharCode.apply(null, fileIdView);\n        if (headerInfo.fileIdentifierString.lastIndexOf(\"Lerc2\", 0) !== 0) {\n          throw \"Unexpected file identifier string (expect Lerc2 ): \" + headerInfo.fileIdentifierString;\n        }\n        ptr += 6;\n        var view = new DataView(input, ptr, 8);\n        var fileVersion = view.getInt32(0, true);\n        headerInfo.fileVersion = fileVersion;\n        ptr += 4;\n        if (fileVersion >= 3) {\n          headerInfo.checksum = view.getUint32(4, true); //nrows\n          ptr += 4;\n        }\n\n        //keys start from here\n        view = new DataView(input, ptr, 12);\n        headerInfo.height = view.getUint32(0, true); //nrows\n        headerInfo.width = view.getUint32(4, true); //ncols\n        ptr += 8;\n        if (fileVersion >= 4) {\n          headerInfo.numDims = view.getUint32(8, true);\n          ptr += 4;\n        }\n        else {\n          headerInfo.numDims = 1;\n        }\n\n        view = new DataView(input, ptr, 40);\n        headerInfo.numValidPixel = view.getUint32(0, true);\n        headerInfo.microBlockSize = view.getInt32(4, true);\n        headerInfo.blobSize = view.getInt32(8, true);\n        headerInfo.imageType = view.getInt32(12, true);\n\n        headerInfo.maxZError = view.getFloat64(16, true);\n        headerInfo.zMin = view.getFloat64(24, true);\n        headerInfo.zMax = view.getFloat64(32, true);\n        ptr += 40;\n        data.headerInfo = headerInfo;\n        data.ptr = ptr;\n\n        var checksum, keyLength;\n        if (fileVersion >= 3) {\n          keyLength = fileVersion >= 4 ? 52 : 48;\n          checksum = this.computeChecksumFletcher32(new Uint8Array(input, ptr - keyLength, headerInfo.blobSize - 14));\n          if (checksum !== headerInfo.checksum) {\n            throw \"Checksum failed.\";\n          }\n        }\n        return true;\n      },\n\n      checkMinMaxRanges: function(input, data) {\n        var headerInfo = data.headerInfo;\n        var OutPixelTypeArray = this.getDataTypeArray(headerInfo.imageType);\n        var rangeBytes = headerInfo.numDims * this.getDataTypeSize(headerInfo.imageType);\n        var minValues = this.readSubArray(input, data.ptr, OutPixelTypeArray, rangeBytes);\n        var maxValues = this.readSubArray(input, data.ptr + rangeBytes, OutPixelTypeArray, rangeBytes);\n        data.ptr += (2 * rangeBytes);\n        var i, equal = true;\n        for (i = 0; i < headerInfo.numDims; i++) {\n          if (minValues[i] !== maxValues[i]) {\n            equal = false;\n            break;\n          }\n        }\n        headerInfo.minValues = minValues;\n        headerInfo.maxValues = maxValues;\n        return equal;\n      },\n\n      readSubArray: function(input, ptr, OutPixelTypeArray, numBytes) {\n        var rawData;\n        if (OutPixelTypeArray === Uint8Array) {\n          rawData = new Uint8Array(input, ptr, numBytes);\n        }\n        else {\n          var arrayBuf = new ArrayBuffer(numBytes);\n          var store8 = new Uint8Array(arrayBuf);\n          store8.set(new Uint8Array(input, ptr, numBytes));\n          rawData = new OutPixelTypeArray(arrayBuf);\n        }\n        return rawData;\n      },\n\n      readMask: function(input, data) {\n        var ptr = data.ptr;\n        var headerInfo = data.headerInfo;\n        var numPixels = headerInfo.width * headerInfo.height;\n        var numValidPixel = headerInfo.numValidPixel;\n\n        var view = new DataView(input, ptr, 4);\n        var mask = {};\n        mask.numBytes = view.getUint32(0, true);\n        ptr += 4;\n\n        // Mask Data\n        if ((0 === numValidPixel || numPixels === numValidPixel) && 0 !== mask.numBytes) {\n          throw (\"invalid mask\");\n        }\n        var bitset, resultMask;\n        if (numValidPixel === 0) {\n          bitset = new Uint8Array(Math.ceil(numPixels / 8));\n          mask.bitset = bitset;\n          resultMask = new Uint8Array(numPixels);\n          data.pixels.resultMask = resultMask;\n          ptr += mask.numBytes;\n        }// ????? else if (data.mask.numBytes > 0 && data.mask.numBytes< data.numValidPixel) {\n        else if (mask.numBytes > 0) {\n          bitset = new Uint8Array(Math.ceil(numPixels / 8));\n          view = new DataView(input, ptr, mask.numBytes);\n          var cnt = view.getInt16(0, true);\n          var ip = 2, op = 0, val = 0;\n          do {\n            if (cnt > 0) {\n              while (cnt--) { bitset[op++] = view.getUint8(ip++); }\n            } else {\n              val = view.getUint8(ip++);\n              cnt = -cnt;\n              while (cnt--) { bitset[op++] = val; }\n            }\n            cnt = view.getInt16(ip, true);\n            ip += 2;\n          } while (ip < mask.numBytes);\n          if ((cnt !== -32768) || (op < bitset.length)) {\n            throw \"Unexpected end of mask RLE encoding\";\n          }\n\n          resultMask = new Uint8Array(numPixels);\n          var mb = 0, k = 0;\n\n          for (k = 0; k < numPixels; k++) {\n            if (k & 7) {\n              mb = bitset[k >> 3];\n              mb <<= k & 7;\n            }\n            else {\n              mb = bitset[k >> 3];\n            }\n            if (mb & 128) {\n              resultMask[k] = 1;\n            }\n          }\n          data.pixels.resultMask = resultMask;\n\n          mask.bitset = bitset;\n          ptr += mask.numBytes;\n        }\n        data.ptr = ptr;\n        data.mask = mask;\n        return true;\n      },\n\n      readDataOneSweep: function(input, data, OutPixelTypeArray) {\n        var ptr = data.ptr;\n        var headerInfo = data.headerInfo;\n        var numDims = headerInfo.numDims;\n        var numPixels = headerInfo.width * headerInfo.height;\n        var imageType = headerInfo.imageType;\n        var numBytes = headerInfo.numValidPixel * Lerc2Helpers.getDataTypeSize(imageType) * numDims;\n        //data.pixels.numBytes = numBytes;\n        var rawData;\n        var mask = data.pixels.resultMask;\n        if (OutPixelTypeArray === Uint8Array) {\n          rawData = new Uint8Array(input, ptr, numBytes);\n        }\n        else {\n          var arrayBuf = new ArrayBuffer(numBytes);\n          var store8 = new Uint8Array(arrayBuf);\n          store8.set(new Uint8Array(input, ptr, numBytes));\n          rawData = new OutPixelTypeArray(arrayBuf);\n        }\n        if (rawData.length === numPixels * numDims) {\n          data.pixels.resultPixels = rawData;\n        }\n        else  //mask\n        {\n          data.pixels.resultPixels = new OutPixelTypeArray(numPixels * numDims);\n          var z = 0, k = 0, i = 0, nStart = 0;\n          if (numDims > 1) {\n            for (i=0; i < numDims; i++) {\n              nStart = i * numPixels;\n              for (k = 0; k < numPixels; k++) {\n                if (mask[k]) {\n                  data.pixels.resultPixels[nStart + k] = rawData[z++];\n                }\n              }\n            }\n          }\n          else {\n            for (k = 0; k < numPixels; k++) {\n              if (mask[k]) {\n                data.pixels.resultPixels[k] = rawData[z++];\n              }\n            }\n          }\n        }\n        ptr += numBytes;\n        data.ptr = ptr;       //return data;\n        return true;\n      },\n\n      readHuffmanTree: function(input, data) {\n        var BITS_MAX = this.HUFFMAN_LUT_BITS_MAX; //8 is slow for the large test image\n        //var size_max = 1 << BITS_MAX;\n        /* ************************\n         * reading code table\n         *************************/\n        var view = new DataView(input, data.ptr, 16);\n        data.ptr += 16;\n        var version = view.getInt32(0, true);\n        if (version < 2) {\n          throw \"unsupported Huffman version\";\n        }\n        var size = view.getInt32(4, true);\n        var i0 = view.getInt32(8, true);\n        var i1 = view.getInt32(12, true);\n        if (i0 >= i1) {\n          return false;\n        }\n        var blockDataBuffer = new Uint32Array(i1 - i0);\n        Lerc2Helpers.decodeBits(input, data, blockDataBuffer);\n        var codeTable = []; //size\n        var i, j, k, len;\n\n        for (i = i0; i < i1; i++) {\n          j = i - (i < size ? 0 : size);//wrap around\n          codeTable[j] = { first: blockDataBuffer[i - i0], second: null };\n        }\n\n        var dataBytes = input.byteLength - data.ptr;\n        var dataWords = Math.ceil(dataBytes / 4);\n        var arrayBuf = new ArrayBuffer(dataWords * 4);\n        var store8 = new Uint8Array(arrayBuf);\n        store8.set(new Uint8Array(input, data.ptr, dataBytes));\n        var stuffedData = new Uint32Array(arrayBuf); //must start from x*4\n        var bitPos = 0, word, srcPtr = 0;\n        word = stuffedData[0];\n        for (i = i0; i < i1; i++) {\n          j = i - (i < size ? 0 : size);//wrap around\n          len = codeTable[j].first;\n          if (len > 0) {\n            codeTable[j].second = (word << bitPos) >>> (32 - len);\n\n            if (32 - bitPos >= len) {\n              bitPos += len;\n              if (bitPos === 32) {\n                bitPos = 0;\n                srcPtr++;\n                word = stuffedData[srcPtr];\n              }\n            }\n            else {\n              bitPos += len - 32;\n              srcPtr++;\n              word = stuffedData[srcPtr];\n              codeTable[j].second |= word >>> (32 - bitPos);\n            }\n          }\n        }\n\n        //finished reading code table\n\n        /* ************************\n         * building lut\n         *************************/\n        var numBitsLUT = 0, numBitsLUTQick = 0;\n        var tree = new TreeNode();\n        for (i = 0; i < codeTable.length; i++) {\n          if (codeTable[i] !== undefined) {\n            numBitsLUT = Math.max(numBitsLUT, codeTable[i].first);\n          }\n        }\n        if (numBitsLUT >= BITS_MAX) {\n          numBitsLUTQick = BITS_MAX;\n        }\n        else {\n          numBitsLUTQick = numBitsLUT;\n        }\n        if (numBitsLUT >= 30) {\n          console.log(\"WARning, large NUM LUT BITS IS \" + numBitsLUT);\n        }\n        var decodeLut = [], entry, code, numEntries, jj, currentBit, node;\n        for (i = i0; i < i1; i++) {\n          j = i - (i < size ? 0 : size);//wrap around\n          len = codeTable[j].first;\n          if (len > 0) {\n            entry = [len, j];\n            if (len <= numBitsLUTQick) {\n              code = codeTable[j].second << (numBitsLUTQick - len);\n              numEntries = 1 << (numBitsLUTQick - len);\n              for (k = 0; k < numEntries; k++) {\n                decodeLut[code | k] = entry;\n              }\n            }\n            else {\n              //build tree\n              code = codeTable[j].second;\n              node = tree;\n              for (jj = len - 1; jj >= 0; jj--) {\n                currentBit = code >>> jj & 1; //no left shift as length could be 30,31\n                if (currentBit) {\n                  if (!node.right) {\n                    node.right = new TreeNode();\n                  }\n                  node = node.right;\n                }\n                else {\n                  if (!node.left) {\n                    node.left = new TreeNode();\n                  }\n                  node = node.left;\n                }\n                if (jj === 0 && !node.val) {\n                  node.val = entry[1];\n                }\n              }\n            }\n          }\n        }\n        return {\n          decodeLut: decodeLut,\n          numBitsLUTQick: numBitsLUTQick,\n          numBitsLUT: numBitsLUT,\n          tree: tree,\n          stuffedData: stuffedData,\n          srcPtr: srcPtr,\n          bitPos: bitPos\n        };\n      },\n\n      readHuffman: function(input, data, OutPixelTypeArray) {\n        var headerInfo = data.headerInfo;\n        var numDims = headerInfo.numDims;\n        var height = data.headerInfo.height;\n        var width = data.headerInfo.width;\n        var numPixels = width * height;\n        //var size_max = 1 << BITS_MAX;\n        /* ************************\n         * reading huffman structure info\n         *************************/\n        var huffmanInfo = this.readHuffmanTree(input, data);\n        var decodeLut = huffmanInfo.decodeLut;\n        var tree = huffmanInfo.tree;\n        //stuffedData includes huffman headers\n        var stuffedData = huffmanInfo.stuffedData;\n        var srcPtr = huffmanInfo.srcPtr;\n        var bitPos = huffmanInfo.bitPos;\n        var numBitsLUTQick = huffmanInfo.numBitsLUTQick;\n        var numBitsLUT = huffmanInfo.numBitsLUT;\n        var offset = data.headerInfo.imageType === 0 ? 128 : 0;\n        /*************************\n        *  decode\n        ***************************/\n        var node, val, delta, mask = data.pixels.resultMask, valTmp, valTmpQuick, currentBit;\n        var i, j, k, ii;\n        var prevVal = 0;\n        if (bitPos > 0) {\n          srcPtr++;\n          bitPos = 0;\n        }\n        var word = stuffedData[srcPtr];\n        var deltaEncode = data.encodeMode === 1;\n        var resultPixelsAllDim = new OutPixelTypeArray(numPixels * numDims);\n        var resultPixels = resultPixelsAllDim;\n        var iDim;\n        for (iDim = 0; iDim < headerInfo.numDims; iDim++) {\n          if (numDims > 1) {\n            //get the mem block of current dimension\n            resultPixels = new OutPixelTypeArray(resultPixelsAllDim.buffer, numPixels * iDim, numPixels);\n            prevVal = 0;\n          }\n          if (data.headerInfo.numValidPixel === width * height) { //all valid\n            for (k = 0, i = 0; i < height; i++) {\n              for (j = 0; j < width; j++, k++) {\n                val = 0;\n                valTmp = (word << bitPos) >>> (32 - numBitsLUTQick);\n                valTmpQuick = valTmp;// >>> deltaBits;\n                if (32 - bitPos < numBitsLUTQick) {\n                  valTmp |= ((stuffedData[srcPtr + 1]) >>> (64 - bitPos - numBitsLUTQick));\n                  valTmpQuick = valTmp;// >>> deltaBits;\n                }\n                if (decodeLut[valTmpQuick])    // if there, move the correct number of bits and done\n                {\n                  val = decodeLut[valTmpQuick][1];\n                  bitPos += decodeLut[valTmpQuick][0];\n                }\n                else {\n                  valTmp = (word << bitPos) >>> (32 - numBitsLUT);\n                  valTmpQuick = valTmp;// >>> deltaBits;\n                  if (32 - bitPos < numBitsLUT) {\n                    valTmp |= ((stuffedData[srcPtr + 1]) >>> (64 - bitPos - numBitsLUT));\n                    valTmpQuick = valTmp;// >>> deltaBits;\n                  }\n                  node = tree;\n                  for (ii = 0; ii < numBitsLUT; ii++) {\n                    currentBit = valTmp >>> (numBitsLUT - ii - 1) & 1;\n                    node = currentBit ? node.right : node.left;\n                    if (!(node.left || node.right)) {\n                      val = node.val;\n                      bitPos = bitPos + ii + 1;\n                      break;\n                    }\n                  }\n                }\n\n                if (bitPos >= 32) {\n                  bitPos -= 32;\n                  srcPtr++;\n                  word = stuffedData[srcPtr];\n                }\n\n                delta = val - offset;\n                if (deltaEncode) {\n                  if (j > 0) {\n                    delta += prevVal;    // use overflow\n                  }\n                  else if (i > 0) {\n                    delta += resultPixels[k - width];\n                  }\n                  else {\n                    delta += prevVal;\n                  }\n                  delta &= 0xFF; //overflow\n                  resultPixels[k] = delta;//overflow\n                  prevVal = delta;\n                }\n                else {\n                  resultPixels[k] = delta;\n                }\n              }\n            }\n          }\n          else { //not all valid, use mask\n            for (k = 0, i = 0; i < height; i++) {\n              for (j = 0; j < width; j++, k++) {\n                if (mask[k]) {\n                  val = 0;\n                  valTmp = (word << bitPos) >>> (32 - numBitsLUTQick);\n                  valTmpQuick = valTmp;// >>> deltaBits;\n                  if (32 - bitPos < numBitsLUTQick) {\n                    valTmp |= ((stuffedData[srcPtr + 1]) >>> (64 - bitPos - numBitsLUTQick));\n                    valTmpQuick = valTmp;// >>> deltaBits;\n                  }\n                  if (decodeLut[valTmpQuick])    // if there, move the correct number of bits and done\n                  {\n                    val = decodeLut[valTmpQuick][1];\n                    bitPos += decodeLut[valTmpQuick][0];\n                  }\n                  else {\n                    valTmp = (word << bitPos) >>> (32 - numBitsLUT);\n                    valTmpQuick = valTmp;// >>> deltaBits;\n                    if (32 - bitPos < numBitsLUT) {\n                      valTmp |= ((stuffedData[srcPtr + 1]) >>> (64 - bitPos - numBitsLUT));\n                      valTmpQuick = valTmp;// >>> deltaBits;\n                    }\n                    node = tree;\n                    for (ii = 0; ii < numBitsLUT; ii++) {\n                      currentBit = valTmp >>> (numBitsLUT - ii - 1) & 1;\n                      node = currentBit ? node.right : node.left;\n                      if (!(node.left || node.right)) {\n                        val = node.val;\n                        bitPos = bitPos + ii + 1;\n                        break;\n                      }\n                    }\n                  }\n\n                  if (bitPos >= 32) {\n                    bitPos -= 32;\n                    srcPtr++;\n                    word = stuffedData[srcPtr];\n                  }\n\n                  delta = val - offset;\n                  if (deltaEncode) {\n                    if (j > 0 && mask[k - 1]) {\n                      delta += prevVal;    // use overflow\n                    }\n                    else if (i > 0 && mask[k - width]) {\n                      delta += resultPixels[k - width];\n                    }\n                    else {\n                      delta += prevVal;\n                    }\n\n                    delta &= 0xFF; //overflow\n                    resultPixels[k] = delta;//overflow\n                    prevVal = delta;\n                  }\n                  else {\n                    resultPixels[k] = delta;\n                  }\n                }\n              }\n            }\n          }\n          data.ptr = data.ptr + (srcPtr + 1) * 4 + (bitPos > 0 ? 4 : 0);\n        }\n        data.pixels.resultPixels = resultPixelsAllDim;\n      },\n\n      decodeBits: function(input, data, blockDataBuffer, offset, iDim) {\n        {\n          //bitstuff encoding is 3\n          var headerInfo = data.headerInfo;\n          var fileVersion = headerInfo.fileVersion;\n          //var block = {};\n          var blockPtr = 0;\n          var view = new DataView(input, data.ptr, 5);//to do\n          var headerByte = view.getUint8(0);\n          blockPtr++;\n          var bits67 = headerByte >> 6;\n          var n = (bits67 === 0) ? 4 : 3 - bits67;\n          var doLut = (headerByte & 32) > 0 ? true : false;//5th bit\n          var numBits = headerByte & 31;\n          var numElements = 0;\n          if (n === 1) {\n            numElements = view.getUint8(blockPtr); blockPtr++;\n          } else if (n === 2) {\n            numElements = view.getUint16(blockPtr, true); blockPtr += 2;\n          } else if (n === 4) {\n            numElements = view.getUint32(blockPtr, true); blockPtr += 4;\n          } else {\n            throw \"Invalid valid pixel count type\";\n          }\n          //fix: huffman codes are bit stuffed, but not bound by data's max value, so need to use originalUnstuff\n          //offset = offset || 0;\n          var scale = 2 * headerInfo.maxZError;\n          var stuffedData, arrayBuf, store8, dataBytes, dataWords;\n          var lutArr, lutData, lutBytes, lutBitsPerElement, bitsPerPixel;\n          var zMax = headerInfo.numDims > 1 ? headerInfo.maxValues[iDim] : headerInfo.zMax;\n          if (doLut) {\n            data.counter.lut++;\n            lutBytes = view.getUint8(blockPtr);\n            lutBitsPerElement = numBits;\n            blockPtr++;\n            dataBytes = Math.ceil((lutBytes - 1) * numBits / 8);\n            dataWords = Math.ceil(dataBytes / 4);\n            arrayBuf = new ArrayBuffer(dataWords * 4);\n            store8 = new Uint8Array(arrayBuf);\n\n            data.ptr += blockPtr;\n            store8.set(new Uint8Array(input, data.ptr, dataBytes));\n\n            lutData = new Uint32Array(arrayBuf);\n            data.ptr += dataBytes;\n\n            bitsPerPixel = 0;\n            while ((lutBytes - 1) >>> bitsPerPixel) {\n              bitsPerPixel++;\n            }\n            dataBytes = Math.ceil(numElements * bitsPerPixel / 8);\n            dataWords = Math.ceil(dataBytes / 4);\n            arrayBuf = new ArrayBuffer(dataWords * 4);\n            store8 = new Uint8Array(arrayBuf);\n            store8.set(new Uint8Array(input, data.ptr, dataBytes));\n            stuffedData = new Uint32Array(arrayBuf);\n            data.ptr += dataBytes;\n            if (fileVersion >= 3) {\n              lutArr = BitStuffer.unstuffLUT2(lutData, numBits, lutBytes - 1, offset, scale, zMax);\n            }\n            else {\n              lutArr = BitStuffer.unstuffLUT(lutData, numBits, lutBytes - 1, offset, scale, zMax);\n            }\n            //lutArr.unshift(0);\n            if (fileVersion >= 3) {\n              //BitStuffer.unstuff2(block, blockDataBuffer, headerInfo.zMax);\n              BitStuffer.unstuff2(stuffedData, blockDataBuffer, bitsPerPixel, numElements, lutArr);\n            }\n            else {\n              BitStuffer.unstuff(stuffedData, blockDataBuffer, bitsPerPixel, numElements, lutArr);\n            }\n          }\n          else {\n            //console.debug(\"bitstuffer\");\n            data.counter.bitstuffer++;\n            bitsPerPixel = numBits;\n            data.ptr += blockPtr;\n            if (bitsPerPixel > 0) {\n              dataBytes = Math.ceil(numElements * bitsPerPixel / 8);\n              dataWords = Math.ceil(dataBytes / 4);\n              arrayBuf = new ArrayBuffer(dataWords * 4);\n              store8 = new Uint8Array(arrayBuf);\n              store8.set(new Uint8Array(input, data.ptr, dataBytes));\n              stuffedData = new Uint32Array(arrayBuf);\n              data.ptr += dataBytes;\n              if (fileVersion >= 3) {\n                if (offset == null) {\n                  BitStuffer.originalUnstuff2(stuffedData, blockDataBuffer, bitsPerPixel, numElements);\n                }\n                else {\n                  BitStuffer.unstuff2(stuffedData, blockDataBuffer, bitsPerPixel, numElements, false, offset, scale, zMax);\n                }\n              }\n              else {\n                if (offset == null) {\n                  BitStuffer.originalUnstuff(stuffedData, blockDataBuffer, bitsPerPixel, numElements);\n                }\n                else {\n                  BitStuffer.unstuff(stuffedData, blockDataBuffer, bitsPerPixel, numElements, false, offset, scale, zMax);\n                }\n              }\n            }\n          }\n        }\n\n      },\n\n      readTiles: function(input, data, OutPixelTypeArray) {\n        var headerInfo = data.headerInfo;\n        var width = headerInfo.width;\n        var height = headerInfo.height;\n        var microBlockSize = headerInfo.microBlockSize;\n        var imageType = headerInfo.imageType;\n        var dataTypeSize = Lerc2Helpers.getDataTypeSize(imageType);\n        var numBlocksX = Math.ceil(width / microBlockSize);\n        var numBlocksY = Math.ceil(height / microBlockSize);\n        data.pixels.numBlocksY = numBlocksY;\n        data.pixels.numBlocksX = numBlocksX;\n        data.pixels.ptr = 0;\n        var row = 0, col = 0, blockY = 0, blockX = 0, thisBlockHeight = 0, thisBlockWidth = 0, bytesLeft = 0, headerByte = 0, bits67 = 0, testCode = 0, outPtr = 0, outStride = 0, numBytes = 0, bytesleft = 0, z = 0, blockPtr = 0;\n        var view, block, arrayBuf, store8, rawData;\n        var blockEncoding;\n        var blockDataBuffer = new OutPixelTypeArray(microBlockSize * microBlockSize);\n        var lastBlockHeight = (height % microBlockSize) || microBlockSize;\n        var lastBlockWidth = (width % microBlockSize) || microBlockSize;\n        var offsetType, offset;\n        var numDims = headerInfo.numDims, iDim;\n        var mask = data.pixels.resultMask;\n        var resultPixels = data.pixels.resultPixels;\n        for (blockY = 0; blockY < numBlocksY; blockY++) {\n          thisBlockHeight = (blockY !== numBlocksY - 1) ? microBlockSize : lastBlockHeight;\n          for (blockX = 0; blockX < numBlocksX; blockX++) {\n            //console.debug(\"y\" + blockY + \" x\" + blockX);\n            thisBlockWidth = (blockX !== numBlocksX - 1) ? microBlockSize : lastBlockWidth;\n\n            outPtr = blockY * width * microBlockSize + blockX * microBlockSize;\n            outStride = width - thisBlockWidth;\n\n\n            for (iDim = 0; iDim < numDims; iDim++) {\n              if (numDims > 1) {\n                resultPixels = new OutPixelTypeArray(data.pixels.resultPixels.buffer, width * height * iDim * dataTypeSize, width * height);\n              }\n              bytesLeft = input.byteLength - data.ptr;\n              view = new DataView(input, data.ptr, Math.min(10, bytesLeft));\n              block = {};\n              blockPtr = 0;\n              headerByte = view.getUint8(0);\n              blockPtr++;\n              bits67 = (headerByte >> 6) & 0xFF;\n              testCode = (headerByte >> 2) & 15;    // use bits 2345 for integrity check\n              if (testCode !== (((blockX * microBlockSize) >> 3) & 15)) {\n                throw \"integrity issue\";\n                //return false;\n              }\n\n              blockEncoding = headerByte & 3;\n              if (blockEncoding > 3) {\n                data.ptr += blockPtr;\n                throw \"Invalid block encoding (\" + blockEncoding + \")\";\n              }\n              else if (blockEncoding === 2) { //constant 0\n                data.counter.constant++;\n                data.ptr += blockPtr;\n                continue;\n              }\n              else if (blockEncoding === 0) {  //uncompressed\n                data.counter.uncompressed++;\n                data.ptr += blockPtr;\n                numBytes = thisBlockHeight * thisBlockWidth * dataTypeSize;\n                bytesleft = input.byteLength - data.ptr;\n                numBytes = numBytes < bytesleft ? numBytes : bytesleft;\n                //bit alignment\n                arrayBuf = new ArrayBuffer((numBytes % dataTypeSize) === 0 ? numBytes : (numBytes + dataTypeSize - numBytes % dataTypeSize));\n                store8 = new Uint8Array(arrayBuf);\n                store8.set(new Uint8Array(input, data.ptr, numBytes));\n                rawData = new OutPixelTypeArray(arrayBuf);\n                z = 0;\n                if (mask) {\n                  for (row = 0; row < thisBlockHeight; row++) {\n                    for (col = 0; col < thisBlockWidth; col++) {\n                      if (mask[outPtr]) {\n                        resultPixels[outPtr] = rawData[z++];\n                      }\n                      outPtr++;\n                    }\n                    outPtr += outStride;\n                  }\n                }\n                else {//all valid\n                  for (row = 0; row < thisBlockHeight; row++) {\n                    for (col = 0; col < thisBlockWidth; col++) {\n                      resultPixels[outPtr++] = rawData[z++];\n                    }\n                    outPtr += outStride;\n                  }\n                }\n                data.ptr += z * dataTypeSize;\n              }\n              else { //1 or 3\n                offsetType = Lerc2Helpers.getDataTypeUsed(imageType, bits67);\n                offset = Lerc2Helpers.getOnePixel(block, blockPtr, offsetType, view);\n                blockPtr += Lerc2Helpers.getDataTypeSize(offsetType);\n                if (blockEncoding === 3) //constant offset value\n                {\n                  data.ptr += blockPtr;\n                  data.counter.constantoffset++;\n                  //you can delete the following resultMask case in favor of performance because val is constant and users use nodata mask, otherwise nodatavalue post processing handles it too.\n                  //while the above statement is true, we're not doing it as we want to keep invalid pixel value at 0 rather than arbitrary values\n                  if (mask) {\n                    for (row = 0; row < thisBlockHeight; row++) {\n                      for (col = 0; col < thisBlockWidth; col++) {\n                        if (mask[outPtr]) {\n                          resultPixels[outPtr] = offset;\n                        }\n                        outPtr++;\n                      }\n                      outPtr += outStride;\n                    }\n                  }\n                  else {\n                    for (row = 0; row < thisBlockHeight; row++) {\n                      for (col = 0; col < thisBlockWidth; col++) {\n                        resultPixels[outPtr++] = offset;\n                      }\n                      outPtr += outStride;\n                    }\n                  }\n                }\n                else { //bitstuff encoding is 3\n                  data.ptr += blockPtr;\n                  //heavy lifting\n                  Lerc2Helpers.decodeBits(input, data, blockDataBuffer, offset, iDim);\n                  blockPtr = 0;\n                  if (mask) {\n                    for (row = 0; row < thisBlockHeight; row++) {\n                      for (col = 0; col < thisBlockWidth; col++) {\n                        if (mask[outPtr]) {\n                          resultPixels[outPtr] = blockDataBuffer[blockPtr++];\n                        }\n                        outPtr++;\n                      }\n                      outPtr += outStride;\n                    }\n                  }\n                  else {\n                    for (row = 0; row < thisBlockHeight; row++) {\n                      for (col = 0; col < thisBlockWidth; col++) {\n                        resultPixels[outPtr++] = blockDataBuffer[blockPtr++];\n                      }\n                      outPtr += outStride;\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      },\n\n      /*****************\n      *  private methods (helper methods)\n      *****************/\n\n      formatFileInfo: function(data) {\n        return {\n          \"fileIdentifierString\": data.headerInfo.fileIdentifierString,\n          \"fileVersion\": data.headerInfo.fileVersion,\n          \"imageType\": data.headerInfo.imageType,\n          \"height\": data.headerInfo.height,\n          \"width\": data.headerInfo.width,\n          \"numValidPixel\": data.headerInfo.numValidPixel,\n          \"microBlockSize\": data.headerInfo.microBlockSize,\n          \"blobSize\": data.headerInfo.blobSize,\n          \"maxZError\": data.headerInfo.maxZError,\n          \"pixelType\": Lerc2Helpers.getPixelType(data.headerInfo.imageType),\n          \"eofOffset\": data.eofOffset,\n          \"mask\": data.mask ? {\n            \"numBytes\": data.mask.numBytes\n          } : null,\n          \"pixels\": {\n            \"numBlocksX\": data.pixels.numBlocksX,\n            \"numBlocksY\": data.pixels.numBlocksY,\n            //\"numBytes\": data.pixels.numBytes,\n            \"maxValue\": data.headerInfo.zMax,\n            \"minValue\": data.headerInfo.zMin,\n            \"noDataValue\": data.noDataValue\n          }\n        };\n      },\n\n      constructConstantSurface: function(data) {\n        var val = data.headerInfo.zMax;\n        var numDims =  data.headerInfo.numDims;\n        var numPixels = data.headerInfo.height * data.headerInfo.width;\n        var numPixelAllDims = numPixels * numDims;\n        var i=0, k = 0, nStart=0;\n        var mask = data.pixels.resultMask;\n        if (mask) {\n          if (numDims > 1) {\n            for (i=0; i < numDims; i++) {\n              nStart = i * numPixels;\n              for (k = 0; k < numPixels; k++) {\n                if (mask[k]) {\n                  data.pixels.resultPixels[nStart + k] = val;\n                }\n              }\n            }\n          }\n          else {\n            for (k = 0; k < numPixels; k++) {\n              if (mask[k]) {\n                data.pixels.resultPixels[k] = val;\n              }\n            }\n          }\n        }\n        else {\n          if (data.pixels.resultPixels.fill) {\n            data.pixels.resultPixels.fill(val);\n          }\n          else {\n            for (k = 0; k < numPixelAllDims; k++) {\n              data.pixels.resultPixels[k] = val;\n            }\n          }\n        }\n        return;\n      },\n\n      getDataTypeArray: function(t) {\n        var tp;\n        switch (t) {\n          case 0: //char\n            tp = Int8Array;\n            break;\n          case 1: //byte\n            tp = Uint8Array;\n            break;\n          case 2: //short\n            tp = Int16Array;\n            break;\n          case 3: //ushort\n            tp = Uint16Array;\n            break;\n          case 4:\n            tp = Int32Array;\n            break;\n          case 5:\n            tp = Uint32Array;\n            break;\n          case 6:\n            tp = Float32Array;\n            break;\n          case 7:\n            tp = Float64Array;\n            break;\n          default:\n            tp = Float32Array;\n        }\n        return tp;\n      },\n\n      getPixelType: function(t) {\n        var tp;\n        switch (t) {\n          case 0: //char\n            tp = \"S8\";\n            break;\n          case 1: //byte\n            tp = \"U8\";\n            break;\n          case 2: //short\n            tp = \"S16\";\n            break;\n          case 3: //ushort\n            tp = \"U16\";\n            break;\n          case 4:\n            tp = \"S32\";\n            break;\n          case 5:\n            tp = \"U32\";\n            break;\n          case 6:\n            tp = \"F32\";\n            break;\n          case 7:\n            tp = \"F64\"; //not supported\n            break;\n          default:\n            tp = \"F32\";\n        }\n        return tp;\n      },\n\n      isValidPixelValue: function(t, val) {\n        if (val == null) {\n          return false;\n        }\n        var isValid;\n        switch (t) {\n          case 0: //char\n            isValid = val >= -128 && val <= 127;\n            break;\n          case 1: //byte  (unsigned char)\n            isValid = val >= 0 && val <= 255;\n            break;\n          case 2: //short\n            isValid = val >= -32768 && val <= 32767;\n            break;\n          case 3: //ushort\n            isValid = val >= 0 && val <= 65536;\n            break;\n          case 4: //int 32\n            isValid = val >= -2147483648 && val <= 2147483647;\n            break;\n          case 5: //uinit 32\n            isValid = val >= 0 && val <= 4294967296;\n            break;\n          case 6:\n            isValid = val >= -3.4027999387901484e+38 && val <= 3.4027999387901484e+38;\n            break;\n          case 7:\n            isValid = val >= 5e-324 && val <= 1.7976931348623157e+308;\n            break;\n          default:\n            isValid = false;\n        }\n        return isValid;\n      },\n\n      getDataTypeSize: function(t) {\n        var s = 0;\n        switch (t) {\n          case 0: //ubyte\n          case 1: //byte\n            s = 1;\n            break;\n          case 2: //short\n          case 3: //ushort\n            s = 2;\n            break;\n          case 4:\n          case 5:\n          case 6:\n            s = 4;\n            break;\n          case 7:\n            s = 8;\n            break;\n          default:\n            s = t;\n        }\n        return s;\n      },\n\n      getDataTypeUsed: function(dt, tc) {\n        var t = dt;\n        switch (dt) {\n          case 2: //short\n          case 4: //long\n            t = dt - tc;\n            break;\n          case 3: //ushort\n          case 5: //ulong\n            t = dt - 2 * tc;\n            break;\n          case 6: //float\n            if (0 === tc) {\n              t = dt;\n            }\n            else if (1 === tc) {\n              t = 2;\n            }\n            else {\n              t = 1;//byte\n            }\n            break;\n          case 7: //double\n            if (0 === tc) {\n              t = dt;\n            }\n            else {\n              t = dt - 2 * tc + 1;\n            }\n            break;\n          default:\n            t = dt;\n            break;\n        }\n        return t;\n      },\n\n      getOnePixel: function(block, blockPtr, offsetType, view) {\n        var temp = 0;\n        switch (offsetType) {\n          case 0: //char\n            temp = view.getInt8(blockPtr);\n            break;\n          case 1: //byte\n            temp = view.getUint8(blockPtr);\n            break;\n          case 2:\n            temp = view.getInt16(blockPtr, true);\n            break;\n          case 3:\n            temp = view.getUint16(blockPtr, true);\n            break;\n          case 4:\n            temp = view.getInt32(blockPtr, true);\n            break;\n          case 5:\n            temp = view.getUInt32(blockPtr, true);\n            break;\n          case 6:\n            temp = view.getFloat32(blockPtr, true);\n            break;\n          case 7:\n            //temp = view.getFloat64(blockPtr, true);\n            //blockPtr += 8;\n            //lerc2 encoding doesnt handle float 64, force to float32???\n            temp = view.getFloat64(blockPtr, true);\n            break;\n          default:\n            throw (\"the decoder does not understand this pixel type\");\n        }\n        return temp;\n      }\n    };\n\n    /***************************************************\n    *private class for a tree node. Huffman code is in Lerc2Helpers\n    ****************************************************/\n    var TreeNode = function(val, left, right) {\n      this.val = val;\n      this.left = left;\n      this.right = right;\n    };\n\n    var Lerc2Decode = {\n      /*\n      * ********removed options compared to LERC1. We can bring some of them back if needed.\n       * removed pixel type. LERC2 is typed and doesn't require user to give pixel type\n       * changed encodedMaskData to maskData. LERC2 's js version make it faster to use maskData directly.\n       * removed returnMask. mask is used by LERC2 internally and is cost free. In case of user input mask, it's returned as well and has neglible cost.\n       * removed nodatavalue. Because LERC2 pixels are typed, nodatavalue will sacrify a useful value for many types (8bit, 16bit) etc,\n       *       user has to be knowledgable enough about raster and their data to avoid usability issues. so nodata value is simply removed now.\n       *       We can add it back later if their's a clear requirement.\n       * removed encodedMask. This option was not implemented in LercDecode. It can be done after decoding (less efficient)\n       * removed computeUsedBitDepths.\n       *\n       *\n       * response changes compared to LERC1\n       * 1. encodedMaskData is not available\n       * 2. noDataValue is optional (returns only if user's noDataValue is with in the valid data type range)\n       * 3. maskData is always available\n      */\n      /*****************\n      *  public properties\n      ******************/\n      //HUFFMAN_LUT_BITS_MAX: 12, //use 2^12 lut, not configurable\n\n      /*****************\n      *  public methods\n      *****************/\n\n      /**\n       * Decode a LERC2 byte stream and return an object containing the pixel data and optional metadata.\n       *\n       * @param {ArrayBuffer} input The LERC input byte stream\n       * @param {object} [options] options Decoding options\n       * @param {number} [options.inputOffset] The number of bytes to skip in the input byte stream. A valid LERC file is expected at that position\n       * @param {boolean} [options.returnFileInfo] If true, the return value will have a fileInfo property that contains metadata obtained from the LERC headers and the decoding process\n       */\n      decode: function(/*byte array*/ input, /*object*/ options) {\n        //currently there's a bug in the sparse array, so please do not set to false\n        options = options || {};\n        var noDataValue = options.noDataValue;\n\n        //initialize\n        var i = 0, data = {};\n        data.ptr = options.inputOffset || 0;\n        data.pixels = {};\n\n        // File header\n        if (!Lerc2Helpers.readHeaderInfo(input, data)) {\n          return;\n        }\n        var headerInfo = data.headerInfo;\n        var fileVersion = headerInfo.fileVersion;\n        var OutPixelTypeArray = Lerc2Helpers.getDataTypeArray(headerInfo.imageType);\n\n        // Mask Header\n        Lerc2Helpers.readMask(input, data);\n        if (headerInfo.numValidPixel !== headerInfo.width * headerInfo.height && !data.pixels.resultMask) {\n          data.pixels.resultMask = options.maskData;\n        }\n\n        var numPixels = headerInfo.width * headerInfo.height;\n        data.pixels.resultPixels = new OutPixelTypeArray(numPixels * headerInfo.numDims);\n\n        data.counter = {\n          onesweep: 0,\n          uncompressed: 0,\n          lut: 0,\n          bitstuffer: 0,\n          constant: 0,\n          constantoffset: 0\n        };\n        if (headerInfo.numValidPixel !== 0) {\n          //not tested\n          if (headerInfo.zMax === headerInfo.zMin) //constant surface\n          {\n            Lerc2Helpers.constructConstantSurface(data);\n          }\n          else if (fileVersion >= 4 && Lerc2Helpers.checkMinMaxRanges(input, data)) {\n            Lerc2Helpers.constructConstantSurface(data);\n          }\n          else {\n            var view = new DataView(input, data.ptr, 2);\n            var bReadDataOneSweep = view.getUint8(0);\n            data.ptr++;\n            if (bReadDataOneSweep) {\n              //console.debug(\"OneSweep\");\n              Lerc2Helpers.readDataOneSweep(input, data, OutPixelTypeArray);\n            }\n            else {\n              //lerc2.1: //bitstuffing + lut\n              //lerc2.2: //bitstuffing + lut + huffman\n              //lerc2.3: new bitstuffer\n              if (fileVersion > 1 && headerInfo.imageType <= 1 && Math.abs(headerInfo.maxZError - 0.5) < 0.00001) {\n                //this is 2.x plus 8 bit (unsigned and signed) data, possiblity of Huffman\n                var flagHuffman = view.getUint8(1);\n                data.ptr++;\n                data.encodeMode = flagHuffman;\n                if (flagHuffman > 2 || (fileVersion < 4 && flagHuffman > 1)) {\n                  throw \"Invalid Huffman flag \" + flagHuffman;\n                }\n                if (flagHuffman) {//1 - delta Huffman, 2 - Huffman\n                  //console.log(\"Huffman\");\n                  Lerc2Helpers.readHuffman(input, data, OutPixelTypeArray);\n                }\n                else {\n                  //console.log(\"Tiles\");\n                  Lerc2Helpers.readTiles(input, data, OutPixelTypeArray);\n                }\n              }\n              else { //lerc2.x non-8 bit data\n                //console.log(\"Tiles\");\n                Lerc2Helpers.readTiles(input, data, OutPixelTypeArray);\n              }\n            }\n          }\n        }\n\n        data.eofOffset = data.ptr;\n        var diff;\n        if (options.inputOffset) {\n          diff = data.headerInfo.blobSize + options.inputOffset - data.ptr;\n          if (Math.abs(diff) >= 1) {\n            //console.debug(\"incorrect eof: dataptr \" + data.ptr + \" offset \" + options.inputOffset + \" blobsize \" + data.headerInfo.blobSize + \" diff: \" + diff);\n            data.eofOffset = options.inputOffset + data.headerInfo.blobSize;\n          }\n        }\n        else {\n          diff = data.headerInfo.blobSize - data.ptr;\n          if (Math.abs(diff) >= 1) {\n            //console.debug(\"incorrect first band eof: dataptr \" + data.ptr + \" blobsize \" + data.headerInfo.blobSize + \" diff: \" + diff);\n            data.eofOffset = data.headerInfo.blobSize;\n          }\n        }\n\n        var result = {\n          width: headerInfo.width,\n          height: headerInfo.height,\n          pixelData: data.pixels.resultPixels,\n          minValue: headerInfo.zMin,\n          maxValue: headerInfo.zMax,\n          validPixelCount: headerInfo.numValidPixel,\n          dimCount: headerInfo.numDims,\n          dimStats: {\n            minValues: headerInfo.minValues,\n            maxValues: headerInfo.maxValues\n          },\n          maskData: data.pixels.resultMask\n          //noDataValue: noDataValue\n        };\n\n        //we should remove this if there's no existing client\n        //optional noDataValue processing, it's user's responsiblity\n        if (data.pixels.resultMask && Lerc2Helpers.isValidPixelValue(headerInfo.imageType, noDataValue)) {\n          var mask = data.pixels.resultMask;\n          for (i = 0; i < numPixels; i++) {\n            if (!mask[i]) {\n              result.pixelData[i] = noDataValue;\n            }\n          }\n          result.noDataValue = noDataValue;\n        }\n        data.noDataValue = noDataValue;\n        if (options.returnFileInfo) {\n          result.fileInfo = Lerc2Helpers.formatFileInfo(data);\n        }\n        return result;\n      },\n\n      getBandCount: function(/*byte array*/ input) {\n        var count = 0;\n        var i = 0;\n        var temp = {};\n        temp.ptr = 0;\n        temp.pixels = {};\n        while (i < input.byteLength - 58) {\n          Lerc2Helpers.readHeaderInfo(input, temp);\n          i += temp.headerInfo.blobSize;\n          count++;\n          temp.ptr = i;\n        }\n        return count;\n      }\n    };\n\n    return Lerc2Decode;\n  })();\n\n  var isPlatformLittleEndian = (function() {\n    var a = new ArrayBuffer(4);\n    var b = new Uint8Array(a);\n    var c = new Uint32Array(a);\n    c[0] = 1;\n    return b[0] === 1;\n  })();\n\n  var Lerc = {\n    /************wrapper**********************************************/\n    /**\n     * A wrapper for decoding both LERC1 and LERC2 byte streams capable of handling multiband pixel blocks for various pixel types.\n     *\n     * @alias module:Lerc\n     * @param {ArrayBuffer} input The LERC input byte stream\n     * @param {object} [options] The decoding options below are optional.\n     * @param {number} [options.inputOffset] The number of bytes to skip in the input byte stream. A valid Lerc file is expected at that position.\n     * @param {string} [options.pixelType] (LERC1 only) Default value is F32. Valid pixel types for input are U8/S8/S16/U16/S32/U32/F32.\n     * @param {number} [options.noDataValue] (LERC1 only). It is recommended to use the returned mask instead of setting this value.\n     * @returns {{width, height, pixels, pixelType, mask, statistics}}\n       * @property {number} width Width of decoded image.\n       * @property {number} height Height of decoded image.\n       * @property {array} pixels [band1, band2, \u2026] Each band is a typed array of width*height.\n       * @property {string} pixelType The type of pixels represented in the output.\n       * @property {mask} mask Typed array with a size of width*height, or null if all pixels are valid.\n       * @property {array} statistics [statistics_band1, statistics_band2, \u2026] Each element is a statistics object representing min and max values\n    **/\n    decode: function(encodedData, options) {\n      if (!isPlatformLittleEndian) {\n        throw \"Big endian system is not supported.\";\n      }\n      options = options || {};\n      var inputOffset = options.inputOffset || 0;\n      var fileIdView = new Uint8Array(encodedData, inputOffset, 10);\n      var fileIdentifierString = String.fromCharCode.apply(null, fileIdView);\n      var lerc, majorVersion;\n      if (fileIdentifierString.trim() === \"CntZImage\") {\n        lerc = LercDecode;\n        majorVersion = 1;\n      }\n      else if (fileIdentifierString.substring(0, 5) === \"Lerc2\") {\n        lerc = Lerc2Decode;\n        majorVersion = 2;\n      }\n      else {\n        throw \"Unexpected file identifier string: \" + fileIdentifierString;\n      }\n\n      var iPlane = 0, eof = encodedData.byteLength - 10, encodedMaskData, bandMasks = [], bandMask, maskData;\n      var decodedPixelBlock = {\n        width: 0,\n        height: 0,\n        pixels: [],\n        pixelType: options.pixelType,\n        mask: null,\n        statistics: []\n      };\n\n      while (inputOffset < eof) {\n        var result = lerc.decode(encodedData, {\n          inputOffset: inputOffset,//for both lerc1 and lerc2\n          encodedMaskData: encodedMaskData,//lerc1 only\n          maskData: maskData,//lerc2 only\n          returnMask: iPlane === 0 ? true : false,//lerc1 only\n          returnEncodedMask: iPlane === 0 ? true : false,//lerc1 only\n          returnFileInfo: true,//for both lerc1 and lerc2\n          pixelType: options.pixelType || null,//lerc1 only\n          noDataValue: options.noDataValue || null//lerc1 only\n        });\n\n        inputOffset = result.fileInfo.eofOffset;\n        if (iPlane === 0) {\n          encodedMaskData = result.encodedMaskData;//lerc1\n          maskData = result.maskData;//lerc2\n          decodedPixelBlock.width = result.width;\n          decodedPixelBlock.height = result.height;\n          decodedPixelBlock.dimCount = result.dimCount || 1;\n          //decodedPixelBlock.dimStats = decodedPixelBlock.dimStats;\n          decodedPixelBlock.pixelType = result.pixelType || result.fileInfo.pixelType;\n          decodedPixelBlock.mask = result.maskData;\n        }\n        if (majorVersion >1 && result.fileInfo.mask && result.fileInfo.mask.numBytes > 0) {\n          bandMasks.push(result.maskData);\n        }\n\n        iPlane++;\n        decodedPixelBlock.pixels.push(result.pixelData);\n        decodedPixelBlock.statistics.push({\n          minValue: result.minValue,\n          maxValue: result.maxValue,\n          noDataValue: result.noDataValue,\n          dimStats: result.dimStats\n        });\n      }\n      var i, j, numPixels;\n      if (majorVersion > 1 && bandMasks.length > 1) {\n        numPixels = decodedPixelBlock.width * decodedPixelBlock.height;\n        decodedPixelBlock.bandMasks = bandMasks;\n        maskData = new Uint8Array(numPixels);\n        maskData.set(bandMasks[0]);\n        for (i = 1; i < bandMasks.length; i++) {\n          bandMask = bandMasks[i];\n          for (j = 0; j < numPixels; j++) {\n            maskData[j] = maskData[j] & bandMask[j];\n          }\n        }\n        decodedPixelBlock.maskData = maskData;\n      }\n\n      return decodedPixelBlock;\n    }\n  };\n\n  if (typeof define === \"function\" && define.amd) {/* jshint ignore:line */\n    //amd loaders such as dojo and requireJS\n    //http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition\n    define([], function() { return Lerc; });/* jshint ignore:line */\n  }\n  else if (typeof module !== \"undefined\" && module.exports) {/* jshint ignore:line */\n    //commonJS module 1.0/1.1/1.1.1 systems, such as nodeJS\n    //http://wiki.commonjs.org/wiki/Modules\n    module.exports = Lerc;/* jshint ignore:line */\n  }\n  else {\n    //assign to this, most likely window\n    this.Lerc = Lerc;\n  }\n\n})();\n", "/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */\n!function(A,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.NoSleep=e():A.NoSleep=e()}(this,(function(){return function(A){var e={};function B(g){if(e[g])return e[g].exports;var o=e[g]={i:g,l:!1,exports:{}};return A[g].call(o.exports,o,o.exports,B),o.l=!0,o.exports}return B.m=A,B.c=e,B.d=function(A,e,g){B.o(A,e)||Object.defineProperty(A,e,{enumerable:!0,get:g})},B.r=function(A){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(A,\"__esModule\",{value:!0})},B.t=function(A,e){if(1&e&&(A=B(A)),8&e)return A;if(4&e&&\"object\"==typeof A&&A&&A.__esModule)return A;var g=Object.create(null);if(B.r(g),Object.defineProperty(g,\"default\",{enumerable:!0,value:A}),2&e&&\"string\"!=typeof A)for(var o in A)B.d(g,o,function(e){return A[e]}.bind(null,o));return g},B.n=function(A){var e=A&&A.__esModule?function(){return A.default}:function(){return A};return B.d(e,\"a\",e),e},B.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},B.p=\"\",B(B.s=0)}([function(A,e,B){\"use strict\";var g=function(){function A(A,e){for(var B=0;B<e.length;B++){var g=e[B];g.enumerable=g.enumerable||!1,g.configurable=!0,\"value\"in g&&(g.writable=!0),Object.defineProperty(A,g.key,g)}}return function(e,B,g){return B&&A(e.prototype,B),g&&A(e,g),e}}();var o=B(1),E=o.webm,n=o.mp4,C=function(){return\"undefined\"!=typeof navigator&&parseFloat((\"\"+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,\"\"])[1]).replace(\"undefined\",\"3_2\").replace(\"_\",\".\").replace(\"_\",\"\"))<10&&!window.MSStream},Q=function(){return\"wakeLock\"in navigator},i=function(){function A(){var e=this;if(function(A,e){if(!(A instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,A),this.enabled=!1,Q()){this._wakeLock=null;var B=function(){null!==e._wakeLock&&\"visible\"===document.visibilityState&&e.enable()};document.addEventListener(\"visibilitychange\",B),document.addEventListener(\"fullscreenchange\",B)}else C()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement(\"video\"),this.noSleepVideo.setAttribute(\"title\",\"No Sleep\"),this.noSleepVideo.setAttribute(\"playsinline\",\"\"),this._addSourceToVideo(this.noSleepVideo,\"webm\",E),this._addSourceToVideo(this.noSleepVideo,\"mp4\",n),this.noSleepVideo.addEventListener(\"loadedmetadata\",(function(){e.noSleepVideo.duration<=1?e.noSleepVideo.setAttribute(\"loop\",\"\"):e.noSleepVideo.addEventListener(\"timeupdate\",(function(){e.noSleepVideo.currentTime>.5&&(e.noSleepVideo.currentTime=Math.random())}))})))}return g(A,[{key:\"_addSourceToVideo\",value:function(A,e,B){var g=document.createElement(\"source\");g.src=B,g.type=\"video/\"+e,A.appendChild(g)}},{key:\"enable\",value:function(){var A=this;return Q()?navigator.wakeLock.request(\"screen\").then((function(e){A._wakeLock=e,A.enabled=!0,console.log(\"Wake Lock active.\"),A._wakeLock.addEventListener(\"release\",(function(){console.log(\"Wake Lock released.\")}))})).catch((function(e){throw A.enabled=!1,console.error(e.name+\", \"+e.message),e})):C()?(this.disable(),console.warn(\"\\n        NoSleep enabled for older iOS devices. This can interrupt\\n        active or long-running network requests from completing successfully.\\n        See https://github.com/richtr/NoSleep.js/issues/15 for more details.\\n      \"),this.noSleepTimer=window.setInterval((function(){document.hidden||(window.location.href=window.location.href.split(\"#\")[0],window.setTimeout(window.stop,0))}),15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then((function(e){return A.enabled=!0,e})).catch((function(e){throw A.enabled=!1,e}))}},{key:\"disable\",value:function(){Q()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):C()?this.noSleepTimer&&(console.warn(\"\\n          NoSleep now disabled for older iOS devices.\\n        \"),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}},{key:\"isEnabled\",get:function(){return this.enabled}}]),A}();A.exports=i},function(A,e,B){\"use strict\";A.exports={webm:\"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1Y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DChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJ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AAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw\"}}])}));", "export const VERSION = '1.113';\nexport { AutomaticUniforms } from '@cesium/engine';\nexport { Buffer } from '@cesium/engine';\nexport { BufferUsage } from '@cesium/engine';\nexport { ClearCommand } from '@cesium/engine';\nexport { ComputeCommand } from '@cesium/engine';\nexport { ComputeEngine } from '@cesium/engine';\nexport { Context } from '@cesium/engine';\nexport { ContextLimits } from '@cesium/engine';\nexport { CubeMap } from '@cesium/engine';\nexport { CubeMapFace } from '@cesium/engine';\nexport { DrawCommand } from '@cesium/engine';\nexport { Framebuffer } from '@cesium/engine';\nexport { FramebufferManager } from '@cesium/engine';\nexport { MipmapHint } from '@cesium/engine';\nexport { MultisampleFramebuffer } from '@cesium/engine';\nexport { Pass } from '@cesium/engine';\nexport { PassState } from '@cesium/engine';\nexport { PixelDatatype } from '@cesium/engine';\nexport { RenderState } from '@cesium/engine';\nexport { Renderbuffer } from '@cesium/engine';\nexport { RenderbufferFormat } from '@cesium/engine';\nexport { Sampler } from '@cesium/engine';\nexport { ShaderBuilder } from '@cesium/engine';\nexport { ShaderCache } from '@cesium/engine';\nexport { ShaderDestination } from '@cesium/engine';\nexport { ShaderFunction } from '@cesium/engine';\nexport { ShaderProgram } from '@cesium/engine';\nexport { ShaderSource } from '@cesium/engine';\nexport { ShaderStruct } from '@cesium/engine';\nexport { Texture } from '@cesium/engine';\nexport { TextureCache } from '@cesium/engine';\nexport { TextureMagnificationFilter } from '@cesium/engine';\nexport { TextureMinificationFilter } from '@cesium/engine';\nexport { TextureWrap } from '@cesium/engine';\nexport { UniformState } from '@cesium/engine';\nexport { VertexArray } from '@cesium/engine';\nexport { VertexArrayFacade } from '@cesium/engine';\nexport { createUniform } from '@cesium/engine';\nexport { createUniformArray } from '@cesium/engine';\nexport { demodernizeShader } from '@cesium/engine';\nexport { freezeRenderState } from '@cesium/engine';\nexport { loadCubeMap } from '@cesium/engine';\nexport { BillboardGraphics } from '@cesium/engine';\nexport { BillboardVisualizer } from '@cesium/engine';\nexport { BoundingSphereState } from '@cesium/engine';\nexport { BoxGeometryUpdater } from '@cesium/engine';\nexport { BoxGraphics } from '@cesium/engine';\nexport { CallbackProperty } from '@cesium/engine';\nexport { Cesium3DTilesetGraphics } from '@cesium/engine';\nexport { Cesium3DTilesetVisualizer } from '@cesium/engine';\nexport { CheckerboardMaterialProperty } from '@cesium/engine';\nexport { ColorMaterialProperty } from '@cesium/engine';\nexport { CompositeEntityCollection } from '@cesium/engine';\nexport { CompositeMaterialProperty } from '@cesium/engine';\nexport { CompositePositionProperty } from '@cesium/engine';\nexport { CompositeProperty } from '@cesium/engine';\nexport { ConstantPositionProperty } from '@cesium/engine';\nexport { ConstantProperty } from '@cesium/engine';\nexport { CorridorGeometryUpdater } from '@cesium/engine';\nexport { CorridorGraphics } from '@cesium/engine';\nexport { CustomDataSource } from '@cesium/engine';\nexport { CylinderGeometryUpdater } from '@cesium/engine';\nexport { CylinderGraphics } from '@cesium/engine';\nexport { CzmlDataSource } from '@cesium/engine';\nexport { DataSource } from '@cesium/engine';\nexport { DataSourceClock } from '@cesium/engine';\nexport { DataSourceCollection } from '@cesium/engine';\nexport { DataSourceDisplay } from '@cesium/engine';\nexport { DynamicGeometryBatch } from '@cesium/engine';\nexport { DynamicGeometryUpdater } from '@cesium/engine';\nexport { EllipseGeometryUpdater } from '@cesium/engine';\nexport { EllipseGraphics } from '@cesium/engine';\nexport { EllipsoidGeometryUpdater } from '@cesium/engine';\nexport { EllipsoidGraphics } from '@cesium/engine';\nexport { Entity } from '@cesium/engine';\nexport { EntityCluster } from '@cesium/engine';\nexport { EntityCollection } from '@cesium/engine';\nexport { EntityView } from '@cesium/engine';\nexport { GeoJsonDataSource } from '@cesium/engine';\nexport { GeometryUpdater } from '@cesium/engine';\nexport { GeometryVisualizer } from '@cesium/engine';\nexport { GpxDataSource } from '@cesium/engine';\nexport { GridMaterialProperty } from '@cesium/engine';\nexport { GroundGeometryUpdater } from '@cesium/engine';\nexport { ImageMaterialProperty } from '@cesium/engine';\nexport { KmlCamera } from '@cesium/engine';\nexport { KmlDataSource } from '@cesium/engine';\nexport { KmlLookAt } from '@cesium/engine';\nexport { KmlTour } from '@cesium/engine';\nexport { KmlTourFlyTo } from '@cesium/engine';\nexport { KmlTourWait } from '@cesium/engine';\nexport { LabelGraphics } from '@cesium/engine';\nexport { LabelVisualizer } from '@cesium/engine';\nexport { MaterialProperty } from '@cesium/engine';\nexport { ModelGraphics } from '@cesium/engine';\nexport { ModelVisualizer } from '@cesium/engine';\nexport { NodeTransformationProperty } from '@cesium/engine';\nexport { PathGraphics } from '@cesium/engine';\nexport { PathVisualizer } from '@cesium/engine';\nexport { PlaneGeometryUpdater } from '@cesium/engine';\nexport { PlaneGraphics } from '@cesium/engine';\nexport { PointGraphics } from '@cesium/engine';\nexport { PointVisualizer } from '@cesium/engine';\nexport { PolygonGeometryUpdater } from '@cesium/engine';\nexport { PolygonGraphics } from '@cesium/engine';\nexport { PolylineArrowMaterialProperty } from '@cesium/engine';\nexport { PolylineDashMaterialProperty } from '@cesium/engine';\nexport { PolylineGeometryUpdater } from '@cesium/engine';\nexport { PolylineGlowMaterialProperty } from '@cesium/engine';\nexport { PolylineGraphics } from '@cesium/engine';\nexport { PolylineOutlineMaterialProperty } from '@cesium/engine';\nexport { PolylineVisualizer } from '@cesium/engine';\nexport { PolylineVolumeGeometryUpdater } from '@cesium/engine';\nexport { PolylineVolumeGraphics } from '@cesium/engine';\nexport { PositionProperty } from '@cesium/engine';\nexport { PositionPropertyArray } from '@cesium/engine';\nexport { Property } from '@cesium/engine';\nexport { PropertyArray } from '@cesium/engine';\nexport { PropertyBag } from '@cesium/engine';\nexport { RectangleGeometryUpdater } from '@cesium/engine';\nexport { RectangleGraphics } from '@cesium/engine';\nexport { ReferenceProperty } from '@cesium/engine';\nexport { Rotation } from '@cesium/engine';\nexport { SampledPositionProperty } from '@cesium/engine';\nexport { SampledProperty } from '@cesium/engine';\nexport { ScaledPositionProperty } from '@cesium/engine';\nexport { StaticGeometryColorBatch } from '@cesium/engine';\nexport { StaticGeometryPerMaterialBatch } from '@cesium/engine';\nexport { StaticGroundGeometryColorBatch } from '@cesium/engine';\nexport { StaticGroundGeometryPerMaterialBatch } from '@cesium/engine';\nexport { StaticGroundPolylinePerMaterialBatch } from '@cesium/engine';\nexport { StaticOutlineGeometryBatch } from '@cesium/engine';\nexport { StripeMaterialProperty } from '@cesium/engine';\nexport { StripeOrientation } from '@cesium/engine';\nexport { TerrainOffsetProperty } from '@cesium/engine';\nexport { TimeIntervalCollectionPositionProperty } from '@cesium/engine';\nexport { TimeIntervalCollectionProperty } from '@cesium/engine';\nexport { VelocityOrientationProperty } from '@cesium/engine';\nexport { VelocityVectorProperty } from '@cesium/engine';\nexport { Visualizer } from '@cesium/engine';\nexport { WallGeometryUpdater } from '@cesium/engine';\nexport { WallGraphics } from '@cesium/engine';\nexport { createMaterialPropertyDescriptor } from '@cesium/engine';\nexport { createPropertyDescriptor } from '@cesium/engine';\nexport { createRawPropertyDescriptor } from '@cesium/engine';\nexport { exportKml } from '@cesium/engine';\nexport { getElement } from '@cesium/engine';\nexport { heightReferenceOnEntityPropertyChanged } from '@cesium/engine';\nexport { CesiumWidget } from '@cesium/engine';\nexport { _shadersAdjustTranslucentFS } from '@cesium/engine';\nexport { _shadersAtmosphereCommon } from '@cesium/engine';\nexport { _shadersBillboardCollectionFS } from '@cesium/engine';\nexport { _shadersBillboardCollectionVS } from '@cesium/engine';\nexport { _shadersBrdfLutGeneratorFS } from '@cesium/engine';\nexport { _shadersCloudCollectionFS } from '@cesium/engine';\nexport { _shadersCloudCollectionVS } from '@cesium/engine';\nexport { _shadersCloudNoiseFS } from '@cesium/engine';\nexport { _shadersCloudNoiseVS } from '@cesium/engine';\nexport { _shadersCompareAndPackTranslucentDepth } from '@cesium/engine';\nexport { _shadersCompositeOITFS } from '@cesium/engine';\nexport { _shadersDepthPlaneFS } from '@cesium/engine';\nexport { _shadersDepthPlaneVS } from '@cesium/engine';\nexport { _shadersEllipsoidFS } from '@cesium/engine';\nexport { _shadersEllipsoidVS } from '@cesium/engine';\nexport { _shadersFXAA3_11 } from '@cesium/engine';\nexport { _shadersGlobeFS } from '@cesium/engine';\nexport { _shadersGlobeVS } from '@cesium/engine';\nexport { _shadersGroundAtmosphere } from '@cesium/engine';\nexport { _shadersOctahedralProjectionAtlasFS } from '@cesium/engine';\nexport { _shadersOctahedralProjectionFS } from '@cesium/engine';\nexport { _shadersOctahedralProjectionVS } from '@cesium/engine';\nexport { _shadersPointPrimitiveCollectionFS } from '@cesium/engine';\nexport { _shadersPointPrimitiveCollectionVS } from '@cesium/engine';\nexport { _shadersPolylineCommon } from '@cesium/engine';\nexport { _shadersPolylineFS } from '@cesium/engine';\nexport { _shadersPolylineShadowVolumeFS } from '@cesium/engine';\nexport { _shadersPolylineShadowVolumeMorphFS } from '@cesium/engine';\nexport { _shadersPolylineShadowVolumeMorphVS } from '@cesium/engine';\nexport { _shadersPolylineShadowVolumeVS } from '@cesium/engine';\nexport { _shadersPolylineVS } from '@cesium/engine';\nexport { _shadersReprojectWebMercatorFS } from '@cesium/engine';\nexport { _shadersReprojectWebMercatorVS } from '@cesium/engine';\nexport { _shadersShadowVolumeAppearanceFS } from '@cesium/engine';\nexport { _shadersShadowVolumeAppearanceVS } from '@cesium/engine';\nexport { _shadersShadowVolumeFS } from '@cesium/engine';\nexport { _shadersSkyAtmosphereCommon } from '@cesium/engine';\nexport { _shadersSkyAtmosphereFS } from '@cesium/engine';\nexport { _shadersSkyAtmosphereVS } from '@cesium/engine';\nexport { _shadersSkyBoxFS } from '@cesium/engine';\nexport { _shadersSkyBoxVS } from '@cesium/engine';\nexport { _shadersSunFS } from '@cesium/engine';\nexport { _shadersSunTextureFS } from '@cesium/engine';\nexport { _shadersSunVS } from '@cesium/engine';\nexport { _shadersVector3DTileClampedPolylinesFS } from '@cesium/engine';\nexport { _shadersVector3DTileClampedPolylinesVS } from '@cesium/engine';\nexport { _shadersVector3DTilePolylinesVS } from '@cesium/engine';\nexport { _shadersVectorTileVS } from '@cesium/engine';\nexport { _shadersViewportQuadFS } from '@cesium/engine';\nexport { _shadersViewportQuadVS } from '@cesium/engine';\nexport { ApproximateTerrainHeights } from '@cesium/engine';\nexport { ArcGISTiledElevationTerrainProvider } from '@cesium/engine';\nexport { ArcType } from '@cesium/engine';\nexport { ArticulationStageType } from '@cesium/engine';\nexport { AssociativeArray } from '@cesium/engine';\nexport { AttributeCompression } from '@cesium/engine';\nexport { AxisAlignedBoundingBox } from '@cesium/engine';\nexport { BingMapsGeocoderService } from '@cesium/engine';\nexport { BoundingRectangle } from '@cesium/engine';\nexport { BoundingSphere } from '@cesium/engine';\nexport { BoxGeometry } from '@cesium/engine';\nexport { BoxOutlineGeometry } from '@cesium/engine';\nexport { Cartesian2 } from '@cesium/engine';\nexport { Cartesian3 } from '@cesium/engine';\nexport { Cartesian4 } from '@cesium/engine';\nexport { Cartographic } from '@cesium/engine';\nexport { CartographicGeocoderService } from '@cesium/engine';\nexport { CatmullRomSpline } from '@cesium/engine';\nexport { CesiumTerrainProvider } from '@cesium/engine';\nexport { Check } from '@cesium/engine';\nexport { CircleGeometry } from '@cesium/engine';\nexport { CircleOutlineGeometry } from '@cesium/engine';\nexport { Clock } from '@cesium/engine';\nexport { ClockRange } from '@cesium/engine';\nexport { ClockStep } from '@cesium/engine';\nexport { Color } from '@cesium/engine';\nexport { ColorGeometryInstanceAttribute } from '@cesium/engine';\nexport { ComponentDatatype } from '@cesium/engine';\nexport { CompressedTextureBuffer } from '@cesium/engine';\nexport { ConstantSpline } from '@cesium/engine';\nexport { CoplanarPolygonGeometry } from '@cesium/engine';\nexport { CoplanarPolygonGeometryLibrary } from '@cesium/engine';\nexport { CoplanarPolygonOutlineGeometry } from '@cesium/engine';\nexport { CornerType } from '@cesium/engine';\nexport { CorridorGeometry } from '@cesium/engine';\nexport { CorridorGeometryLibrary } from '@cesium/engine';\nexport { CorridorOutlineGeometry } from '@cesium/engine';\nexport { Credit } from '@cesium/engine';\nexport { CubicRealPolynomial } from '@cesium/engine';\nexport { CullingVolume } from '@cesium/engine';\nexport { CustomHeightmapTerrainProvider } from '@cesium/engine';\nexport { CylinderGeometry } from '@cesium/engine';\nexport { CylinderGeometryLibrary } from '@cesium/engine';\nexport { CylinderOutlineGeometry } from '@cesium/engine';\nexport { DefaultProxy } from '@cesium/engine';\nexport { DeveloperError } from '@cesium/engine';\nexport { DistanceDisplayCondition } from '@cesium/engine';\nexport { DistanceDisplayConditionGeometryInstanceAttribute } from '@cesium/engine';\nexport { DoubleEndedPriorityQueue } from '@cesium/engine';\nexport { DoublyLinkedList } from '@cesium/engine';\nexport { EarthOrientationParameters } from '@cesium/engine';\nexport { EarthOrientationParametersSample } from '@cesium/engine';\nexport { EasingFunction } from '@cesium/engine';\nexport { EllipseGeometry } from '@cesium/engine';\nexport { EllipseGeometryLibrary } from '@cesium/engine';\nexport { EllipseOutlineGeometry } from '@cesium/engine';\nexport { Ellipsoid } from '@cesium/engine';\nexport { EllipsoidGeodesic } from '@cesium/engine';\nexport { EllipsoidGeometry } from '@cesium/engine';\nexport { EllipsoidOutlineGeometry } from '@cesium/engine';\nexport { EllipsoidRhumbLine } from '@cesium/engine';\nexport { EllipsoidTangentPlane } from '@cesium/engine';\nexport { EllipsoidTerrainProvider } from '@cesium/engine';\nexport { EllipsoidalOccluder } from '@cesium/engine';\nexport { EncodedCartesian3 } from '@cesium/engine';\nexport { Event } from '@cesium/engine';\nexport { EventHelper } from '@cesium/engine';\nexport { ExtrapolationType } from '@cesium/engine';\nexport { FeatureDetection } from '@cesium/engine';\nexport { FrustumGeometry } from '@cesium/engine';\nexport { FrustumOutlineGeometry } from '@cesium/engine';\nexport { Fullscreen } from '@cesium/engine';\nexport { GeocodeType } from '@cesium/engine';\nexport { GeocoderService } from '@cesium/engine';\nexport { GeographicProjection } from '@cesium/engine';\nexport { GeographicTilingScheme } from '@cesium/engine';\nexport { Geometry } from '@cesium/engine';\nexport { GeometryAttribute } from '@cesium/engine';\nexport { GeometryAttributes } from '@cesium/engine';\nexport { GeometryFactory } from '@cesium/engine';\nexport { GeometryInstance } from '@cesium/engine';\nexport { GeometryInstanceAttribute } from '@cesium/engine';\nexport { GeometryOffsetAttribute } from '@cesium/engine';\nexport { GeometryPipeline } from '@cesium/engine';\nexport { GeometryType } from '@cesium/engine';\nexport { GoogleEarthEnterpriseMetadata } from '@cesium/engine';\nexport { GoogleEarthEnterpriseTerrainData } from '@cesium/engine';\nexport { GoogleEarthEnterpriseTerrainProvider } from '@cesium/engine';\nexport { GoogleEarthEnterpriseTileInformation } from '@cesium/engine';\nexport { GoogleMaps } from '@cesium/engine';\nexport { GregorianDate } from '@cesium/engine';\nexport { GroundPolylineGeometry } from '@cesium/engine';\nexport { HeadingPitchRange } from '@cesium/engine';\nexport { HeadingPitchRoll } from '@cesium/engine';\nexport { Heap } from '@cesium/engine';\nexport { HeightmapEncoding } from '@cesium/engine';\nexport { HeightmapTerrainData } from '@cesium/engine';\nexport { HeightmapTessellator } from '@cesium/engine';\nexport { HermitePolynomialApproximation } from '@cesium/engine';\nexport { HermiteSpline } from '@cesium/engine';\nexport { HilbertOrder } from '@cesium/engine';\nexport { Iau2000Orientation } from '@cesium/engine';\nexport { Iau2006XysData } from '@cesium/engine';\nexport { Iau2006XysSample } from '@cesium/engine';\nexport { IauOrientationAxes } from '@cesium/engine';\nexport { IauOrientationParameters } from '@cesium/engine';\nexport { IndexDatatype } from '@cesium/engine';\nexport { InterpolationAlgorithm } from '@cesium/engine';\nexport { InterpolationType } from '@cesium/engine';\nexport { Intersect } from '@cesium/engine';\nexport { IntersectionTests } from '@cesium/engine';\nexport { Intersections2D } from '@cesium/engine';\nexport { Interval } from '@cesium/engine';\nexport { Ion } from '@cesium/engine';\nexport { IonGeocoderService } from '@cesium/engine';\nexport { IonResource } from '@cesium/engine';\nexport { Iso8601 } from '@cesium/engine';\nexport { JulianDate } from '@cesium/engine';\nexport { KTX2Transcoder } from '@cesium/engine';\nexport { KeyboardEventModifier } from '@cesium/engine';\nexport { LagrangePolynomialApproximation } from '@cesium/engine';\nexport { LeapSecond } from '@cesium/engine';\nexport { LinearApproximation } from '@cesium/engine';\nexport { LinearSpline } from '@cesium/engine';\nexport { ManagedArray } from '@cesium/engine';\nexport { MapProjection } from '@cesium/engine';\nexport { Math } from '@cesium/engine';\nexport { Matrix2 } from '@cesium/engine';\nexport { Matrix3 } from '@cesium/engine';\nexport { Matrix4 } from '@cesium/engine';\nexport { MorphWeightSpline } from '@cesium/engine';\nexport { MortonOrder } from '@cesium/engine';\nexport { NearFarScalar } from '@cesium/engine';\nexport { Occluder } from '@cesium/engine';\nexport { OffsetGeometryInstanceAttribute } from '@cesium/engine';\nexport { OpenCageGeocoderService } from '@cesium/engine';\nexport { OrientedBoundingBox } from '@cesium/engine';\nexport { OrthographicFrustum } from '@cesium/engine';\nexport { OrthographicOffCenterFrustum } from '@cesium/engine';\nexport { Packable } from '@cesium/engine';\nexport { PackableForInterpolation } from '@cesium/engine';\nexport { PeliasGeocoderService } from '@cesium/engine';\nexport { PerspectiveFrustum } from '@cesium/engine';\nexport { PerspectiveOffCenterFrustum } from '@cesium/engine';\nexport { PinBuilder } from '@cesium/engine';\nexport { PixelFormat } from '@cesium/engine';\nexport { Plane } from '@cesium/engine';\nexport { PlaneGeometry } from '@cesium/engine';\nexport { PlaneOutlineGeometry } from '@cesium/engine';\nexport { PolygonGeometry } from '@cesium/engine';\nexport { PolygonGeometryLibrary } from '@cesium/engine';\nexport { PolygonHierarchy } from '@cesium/engine';\nexport { PolygonOutlineGeometry } from '@cesium/engine';\nexport { PolygonPipeline } from '@cesium/engine';\nexport { PolylineGeometry } from '@cesium/engine';\nexport { PolylinePipeline } from '@cesium/engine';\nexport { PolylineVolumeGeometry } from '@cesium/engine';\nexport { PolylineVolumeGeometryLibrary } from '@cesium/engine';\nexport { PolylineVolumeOutlineGeometry } from '@cesium/engine';\nexport { PrimitiveType } from '@cesium/engine';\nexport { Proxy } from '@cesium/engine';\nexport { QuadraticRealPolynomial } from '@cesium/engine';\nexport { QuantizedMeshTerrainData } from '@cesium/engine';\nexport { QuarticRealPolynomial } from '@cesium/engine';\nexport { Quaternion } from '@cesium/engine';\nexport { QuaternionSpline } from '@cesium/engine';\nexport { Queue } from '@cesium/engine';\nexport { Ray } from '@cesium/engine';\nexport { Rectangle } from '@cesium/engine';\nexport { RectangleCollisionChecker } from '@cesium/engine';\nexport { RectangleGeometry } from '@cesium/engine';\nexport { RectangleGeometryLibrary } from '@cesium/engine';\nexport { RectangleOutlineGeometry } from '@cesium/engine';\nexport { ReferenceFrame } from '@cesium/engine';\nexport { Request } from '@cesium/engine';\nexport { RequestErrorEvent } from '@cesium/engine';\nexport { RequestScheduler } from '@cesium/engine';\nexport { RequestState } from '@cesium/engine';\nexport { RequestType } from '@cesium/engine';\nexport { Resource } from '@cesium/engine';\nexport { RuntimeError } from '@cesium/engine';\nexport { S2Cell } from '@cesium/engine';\nexport { ScreenSpaceEventHandler } from '@cesium/engine';\nexport { ScreenSpaceEventType } from '@cesium/engine';\nexport { ShowGeometryInstanceAttribute } from '@cesium/engine';\nexport { Simon1994PlanetaryPositions } from '@cesium/engine';\nexport { SimplePolylineGeometry } from '@cesium/engine';\nexport { SphereGeometry } from '@cesium/engine';\nexport { SphereOutlineGeometry } from '@cesium/engine';\nexport { Spherical } from '@cesium/engine';\nexport { Spline } from '@cesium/engine';\nexport { SteppedSpline } from '@cesium/engine';\nexport { Stereographic } from '@cesium/engine';\nexport { TaskProcessor } from '@cesium/engine';\nexport { TerrainData } from '@cesium/engine';\nexport { TerrainEncoding } from '@cesium/engine';\nexport { TerrainMesh } from '@cesium/engine';\nexport { TerrainProvider } from '@cesium/engine';\nexport { TerrainQuantization } from '@cesium/engine';\nexport { TileAvailability } from '@cesium/engine';\nexport { TileEdge } from '@cesium/engine';\nexport { TileProviderError } from '@cesium/engine';\nexport { TilingScheme } from '@cesium/engine';\nexport { TimeConstants } from '@cesium/engine';\nexport { TimeInterval } from '@cesium/engine';\nexport { TimeIntervalCollection } from '@cesium/engine';\nexport { TimeStandard } from '@cesium/engine';\nexport { Tipsify } from '@cesium/engine';\nexport { Transforms } from '@cesium/engine';\nexport { TranslationRotationScale } from '@cesium/engine';\nexport { TridiagonalSystemSolver } from '@cesium/engine';\nexport { TrustedServers } from '@cesium/engine';\nexport { VRTheWorldTerrainProvider } from '@cesium/engine';\nexport { VertexFormat } from '@cesium/engine';\nexport { VerticalExaggeration } from '@cesium/engine';\nexport { VideoSynchronizer } from '@cesium/engine';\nexport { Visibility } from '@cesium/engine';\nexport { VulkanConstants } from '@cesium/engine';\nexport { WallGeometry } from '@cesium/engine';\nexport { WallGeometryLibrary } from '@cesium/engine';\nexport { WallOutlineGeometry } from '@cesium/engine';\nexport { WebGLConstants } from '@cesium/engine';\nexport { WebMercatorProjection } from '@cesium/engine';\nexport { WebMercatorTilingScheme } from '@cesium/engine';\nexport { WindingOrder } from '@cesium/engine';\nexport { WireframeIndexGenerator } from '@cesium/engine';\nexport { appendForwardSlash } from '@cesium/engine';\nexport { arrayRemoveDuplicates } from '@cesium/engine';\nexport { barycentricCoordinates } from '@cesium/engine';\nexport { binarySearch } from '@cesium/engine';\nexport { buildModuleUrl } from '@cesium/engine';\nexport { clone } from '@cesium/engine';\nexport { combine } from '@cesium/engine';\nexport { createGuid } from '@cesium/engine';\nexport { createWorldTerrainAsync } from '@cesium/engine';\nexport { decodeGoogleEarthEnterpriseData } from '@cesium/engine';\nexport { decodeVectorPolylinePositions } from '@cesium/engine';\nexport { defaultValue } from '@cesium/engine';\nexport { defer } from '@cesium/engine';\nexport { defined } from '@cesium/engine';\nexport { deprecationWarning } from '@cesium/engine';\nexport { destroyObject } from '@cesium/engine';\nexport { formatError } from '@cesium/engine';\nexport { getAbsoluteUri } from '@cesium/engine';\nexport { getBaseUri } from '@cesium/engine';\nexport { getExtensionFromUri } from '@cesium/engine';\nexport { getFilenameFromUri } from '@cesium/engine';\nexport { getImageFromTypedArray } from '@cesium/engine';\nexport { getImagePixels } from '@cesium/engine';\nexport { getJsonFromTypedArray } from '@cesium/engine';\nexport { getMagic } from '@cesium/engine';\nexport { getStringFromTypedArray } from '@cesium/engine';\nexport { getTimestamp } from '@cesium/engine';\nexport { isBitSet } from '@cesium/engine';\nexport { isBlobUri } from '@cesium/engine';\nexport { isCrossOriginUrl } from '@cesium/engine';\nexport { isDataUri } from '@cesium/engine';\nexport { isLeapYear } from '@cesium/engine';\nexport { loadAndExecuteScript } from '@cesium/engine';\nexport { loadImageFromTypedArray } from '@cesium/engine';\nexport { loadKTX2 } from '@cesium/engine';\nexport { mergeSort } from '@cesium/engine';\nexport { objectToQuery } from '@cesium/engine';\nexport { oneTimeWarning } from '@cesium/engine';\nexport { parseResponseHeaders } from '@cesium/engine';\nexport { pointInsideTriangle } from '@cesium/engine';\nexport { queryToObject } from '@cesium/engine';\nexport { resizeImageToNextPowerOfTwo } from '@cesium/engine';\nexport { sampleTerrain } from '@cesium/engine';\nexport { sampleTerrainMostDetailed } from '@cesium/engine';\nexport { scaleToGeodeticSurface } from '@cesium/engine';\nexport { subdivideArray } from '@cesium/engine';\nexport { webGLConstantToGlslType } from '@cesium/engine';\nexport { wrapFunction } from '@cesium/engine';\nexport { writeTextToCanvas } from '@cesium/engine';\nexport { AlphaMode } from '@cesium/engine';\nexport { Appearance } from '@cesium/engine';\nexport { ArcGisBaseMapType } from '@cesium/engine';\nexport { ArcGisMapServerImageryProvider } from '@cesium/engine';\nexport { ArcGisMapService } from '@cesium/engine';\nexport { AttributeType } from '@cesium/engine';\nexport { AutoExposure } from '@cesium/engine';\nexport { Axis } from '@cesium/engine';\nexport { B3dmParser } from '@cesium/engine';\nexport { BatchTable } from '@cesium/engine';\nexport { BatchTableHierarchy } from '@cesium/engine';\nexport { BatchTexture } from '@cesium/engine';\nexport { Billboard } from '@cesium/engine';\nexport { BillboardCollection } from '@cesium/engine';\nexport { BingMapsImageryProvider } from '@cesium/engine';\nexport { BingMapsStyle } from '@cesium/engine';\nexport { BlendEquation } from '@cesium/engine';\nexport { BlendFunction } from '@cesium/engine';\nexport { BlendOption } from '@cesium/engine';\nexport { BlendingState } from '@cesium/engine';\nexport { BoundingVolumeSemantics } from '@cesium/engine';\nexport { BoxEmitter } from '@cesium/engine';\nexport { BrdfLutGenerator } from '@cesium/engine';\nexport { BufferLoader } from '@cesium/engine';\nexport { Camera } from '@cesium/engine';\nexport { CameraEventAggregator } from '@cesium/engine';\nexport { CameraEventType } from '@cesium/engine';\nexport { CameraFlightPath } from '@cesium/engine';\nexport { Cesium3DContentGroup } from '@cesium/engine';\nexport { Cesium3DTile } from '@cesium/engine';\nexport { Cesium3DTileBatchTable } from '@cesium/engine';\nexport { Cesium3DTileColorBlendMode } from '@cesium/engine';\nexport { Cesium3DTileContent } from '@cesium/engine';\nexport { Cesium3DTileContentFactory } from '@cesium/engine';\nexport { Cesium3DTileContentState } from '@cesium/engine';\nexport { Cesium3DTileContentType } from '@cesium/engine';\nexport { Cesium3DTileFeature } from '@cesium/engine';\nexport { Cesium3DTileFeatureTable } from '@cesium/engine';\nexport { Cesium3DTileOptimizationHint } from '@cesium/engine';\nexport { Cesium3DTileOptimizations } from '@cesium/engine';\nexport { Cesium3DTilePass } from '@cesium/engine';\nexport { Cesium3DTilePassState } from '@cesium/engine';\nexport { Cesium3DTilePointFeature } from '@cesium/engine';\nexport { Cesium3DTileRefine } from '@cesium/engine';\nexport { Cesium3DTileStyle } from '@cesium/engine';\nexport { Cesium3DTileStyleEngine } from '@cesium/engine';\nexport { Cesium3DTilesVoxelProvider } from '@cesium/engine';\nexport { Cesium3DTileset } from '@cesium/engine';\nexport { Cesium3DTilesetBaseTraversal } from '@cesium/engine';\nexport { Cesium3DTilesetCache } from '@cesium/engine';\nexport { Cesium3DTilesetHeatmap } from '@cesium/engine';\nexport { Cesium3DTilesetMetadata } from '@cesium/engine';\nexport { Cesium3DTilesetMostDetailedTraversal } from '@cesium/engine';\nexport { Cesium3DTilesetSkipTraversal } from '@cesium/engine';\nexport { Cesium3DTilesetStatistics } from '@cesium/engine';\nexport { Cesium3DTilesetTraversal } from '@cesium/engine';\nexport { CircleEmitter } from '@cesium/engine';\nexport { ClassificationPrimitive } from '@cesium/engine';\nexport { ClassificationType } from '@cesium/engine';\nexport { ClippingPlane } from '@cesium/engine';\nexport { ClippingPlaneCollection } from '@cesium/engine';\nexport { CloudCollection } from '@cesium/engine';\nexport { CloudType } from '@cesium/engine';\nexport { ColorBlendMode } from '@cesium/engine';\nexport { Composite3DTileContent } from '@cesium/engine';\nexport { ConditionsExpression } from '@cesium/engine';\nexport { ConeEmitter } from '@cesium/engine';\nexport { ContentMetadata } from '@cesium/engine';\nexport { CreditDisplay } from '@cesium/engine';\nexport { CullFace } from '@cesium/engine';\nexport { CumulusCloud } from '@cesium/engine';\nexport { DebugAppearance } from '@cesium/engine';\nexport { DebugCameraPrimitive } from '@cesium/engine';\nexport { DebugInspector } from '@cesium/engine';\nexport { DebugModelMatrixPrimitive } from '@cesium/engine';\nexport { DepthFunction } from '@cesium/engine';\nexport { DepthPlane } from '@cesium/engine';\nexport { DerivedCommand } from '@cesium/engine';\nexport { DeviceOrientationCameraController } from '@cesium/engine';\nexport { DirectionalLight } from '@cesium/engine';\nexport { DiscardEmptyTileImagePolicy } from '@cesium/engine';\nexport { DiscardMissingTileImagePolicy } from '@cesium/engine';\nexport { DracoLoader } from '@cesium/engine';\nexport { EllipsoidPrimitive } from '@cesium/engine';\nexport { EllipsoidSurfaceAppearance } from '@cesium/engine';\nexport { Empty3DTileContent } from '@cesium/engine';\nexport { Expression } from '@cesium/engine';\nexport { ExpressionNodeType } from '@cesium/engine';\nexport { Fog } from '@cesium/engine';\nexport { FrameRateMonitor } from '@cesium/engine';\nexport { FrameState } from '@cesium/engine';\nexport { FrustumCommands } from '@cesium/engine';\nexport { Geometry3DTileContent } from '@cesium/engine';\nexport { GetFeatureInfoFormat } from '@cesium/engine';\nexport { Globe } from '@cesium/engine';\nexport { GlobeDepth } from '@cesium/engine';\nexport { GlobeSurfaceShaderSet } from '@cesium/engine';\nexport { GlobeSurfaceTile } from '@cesium/engine';\nexport { GlobeSurfaceTileProvider } from '@cesium/engine';\nexport { GlobeTranslucency } from '@cesium/engine';\nexport { GlobeTranslucencyFramebuffer } from '@cesium/engine';\nexport { GlobeTranslucencyState } from '@cesium/engine';\nexport { GltfBufferViewLoader } from '@cesium/engine';\nexport { GltfDracoLoader } from '@cesium/engine';\nexport { GltfImageLoader } from '@cesium/engine';\nexport { GltfIndexBufferLoader } from '@cesium/engine';\nexport { GltfJsonLoader } from '@cesium/engine';\nexport { GltfLoader } from '@cesium/engine';\nexport { GltfLoaderUtil } from '@cesium/engine';\nexport { GltfStructuralMetadataLoader } from '@cesium/engine';\nexport { GltfTextureLoader } from '@cesium/engine';\nexport { GltfVertexBufferLoader } from '@cesium/engine';\nexport { GoogleEarthEnterpriseImageryProvider } from '@cesium/engine';\nexport { GoogleEarthEnterpriseMapsProvider } from '@cesium/engine';\nexport { GridImageryProvider } from '@cesium/engine';\nexport { GroundPolylinePrimitive } from '@cesium/engine';\nexport { GroundPrimitive } from '@cesium/engine';\nexport { GroupMetadata } from '@cesium/engine';\nexport { HeightReference } from '@cesium/engine';\nexport { HorizontalOrigin } from '@cesium/engine';\nexport { I3SDataProvider } from '@cesium/engine';\nexport { I3SDecoder } from '@cesium/engine';\nexport { I3SFeature } from '@cesium/engine';\nexport { I3SField } from '@cesium/engine';\nexport { I3SGeometry } from '@cesium/engine';\nexport { I3SLayer } from '@cesium/engine';\nexport { I3SNode } from '@cesium/engine';\nexport { I3dmParser } from '@cesium/engine';\nexport { ImageBasedLighting } from '@cesium/engine';\nexport { Imagery } from '@cesium/engine';\nexport { ImageryLayer } from '@cesium/engine';\nexport { ImageryLayerCollection } from '@cesium/engine';\nexport { ImageryLayerFeatureInfo } from '@cesium/engine';\nexport { ImageryProvider } from '@cesium/engine';\nexport { ImageryState } from '@cesium/engine';\nexport { Implicit3DTileContent } from '@cesium/engine';\nexport { ImplicitAvailabilityBitstream } from '@cesium/engine';\nexport { ImplicitMetadataView } from '@cesium/engine';\nexport { ImplicitSubdivisionScheme } from '@cesium/engine';\nexport { ImplicitSubtree } from '@cesium/engine';\nexport { ImplicitSubtreeCache } from '@cesium/engine';\nexport { ImplicitSubtreeMetadata } from '@cesium/engine';\nexport { ImplicitTileCoordinates } from '@cesium/engine';\nexport { ImplicitTileset } from '@cesium/engine';\nexport { InstanceAttributeSemantic } from '@cesium/engine';\nexport { InvertClassification } from '@cesium/engine';\nexport { IonImageryProvider } from '@cesium/engine';\nexport { IonWorldImageryStyle } from '@cesium/engine';\nexport { JobScheduler } from '@cesium/engine';\nexport { JobType } from '@cesium/engine';\nexport { JsonMetadataTable } from '@cesium/engine';\nexport { KeyframeNode } from '@cesium/engine';\nexport { Label } from '@cesium/engine';\nexport { LabelCollection } from '@cesium/engine';\nexport { LabelStyle } from '@cesium/engine';\nexport { Light } from '@cesium/engine';\nexport { MapMode2D } from '@cesium/engine';\nexport { MapboxImageryProvider } from '@cesium/engine';\nexport { MapboxStyleImageryProvider } from '@cesium/engine';\nexport { Material } from '@cesium/engine';\nexport { MaterialAppearance } from '@cesium/engine';\nexport { Megatexture } from '@cesium/engine';\nexport { MetadataClass } from '@cesium/engine';\nexport { MetadataClassProperty } from '@cesium/engine';\nexport { MetadataComponentType } from '@cesium/engine';\nexport { MetadataEntity } from '@cesium/engine';\nexport { MetadataEnum } from '@cesium/engine';\nexport { MetadataEnumValue } from '@cesium/engine';\nexport { MetadataSchema } from '@cesium/engine';\nexport { MetadataSchemaLoader } from '@cesium/engine';\nexport { MetadataSemantic } from '@cesium/engine';\nexport { MetadataTable } from '@cesium/engine';\nexport { MetadataTableProperty } from '@cesium/engine';\nexport { MetadataType } from '@cesium/engine';\nexport { ModelAnimationLoop } from '@cesium/engine';\nexport { ModelAnimationState } from '@cesium/engine';\nexport { ModelComponents } from '@cesium/engine';\nexport { Moon } from '@cesium/engine';\nexport { Multiple3DTileContent } from '@cesium/engine';\nexport { NeverTileDiscardPolicy } from '@cesium/engine';\nexport { OIT } from '@cesium/engine';\nexport { OctahedralProjectedCubeMap } from '@cesium/engine';\nexport { OpenStreetMapImageryProvider } from '@cesium/engine';\nexport { OrderedGroundPrimitiveCollection } from '@cesium/engine';\nexport { Particle } from '@cesium/engine';\nexport { ParticleBurst } from '@cesium/engine';\nexport { ParticleEmitter } from '@cesium/engine';\nexport { ParticleSystem } from '@cesium/engine';\nexport { PerInstanceColorAppearance } from '@cesium/engine';\nexport { PerformanceDisplay } from '@cesium/engine';\nexport { PickDepth } from '@cesium/engine';\nexport { PickDepthFramebuffer } from '@cesium/engine';\nexport { PickFramebuffer } from '@cesium/engine';\nexport { Picking } from '@cesium/engine';\nexport { PntsParser } from '@cesium/engine';\nexport { PointCloud } from '@cesium/engine';\nexport { PointCloudEyeDomeLighting } from '@cesium/engine';\nexport { PointCloudShading } from '@cesium/engine';\nexport { PointPrimitive } from '@cesium/engine';\nexport { PointPrimitiveCollection } from '@cesium/engine';\nexport { Polyline } from '@cesium/engine';\nexport { PolylineCollection } from '@cesium/engine';\nexport { PolylineColorAppearance } from '@cesium/engine';\nexport { PolylineMaterialAppearance } from '@cesium/engine';\nexport { PostProcessStage } from '@cesium/engine';\nexport { PostProcessStageCollection } from '@cesium/engine';\nexport { PostProcessStageComposite } from '@cesium/engine';\nexport { PostProcessStageLibrary } from '@cesium/engine';\nexport { PostProcessStageSampleMode } from '@cesium/engine';\nexport { PostProcessStageTextureCache } from '@cesium/engine';\nexport { Primitive } from '@cesium/engine';\nexport { PrimitiveCollection } from '@cesium/engine';\nexport { PrimitiveLoadPlan } from '@cesium/engine';\nexport { PrimitivePipeline } from '@cesium/engine';\nexport { PrimitiveState } from '@cesium/engine';\nexport { PropertyAttribute } from '@cesium/engine';\nexport { PropertyAttributeProperty } from '@cesium/engine';\nexport { PropertyTable } from '@cesium/engine';\nexport { PropertyTexture } from '@cesium/engine';\nexport { PropertyTextureProperty } from '@cesium/engine';\nexport { QuadtreeOccluders } from '@cesium/engine';\nexport { QuadtreePrimitive } from '@cesium/engine';\nexport { QuadtreeTile } from '@cesium/engine';\nexport { QuadtreeTileLoadState } from '@cesium/engine';\nexport { QuadtreeTileProvider } from '@cesium/engine';\nexport { ResourceCache } from '@cesium/engine';\nexport { ResourceCacheKey } from '@cesium/engine';\nexport { ResourceCacheStatistics } from '@cesium/engine';\nexport { ResourceLoader } from '@cesium/engine';\nexport { ResourceLoaderState } from '@cesium/engine';\nexport { SDFSettings } from '@cesium/engine';\nexport { Scene } from '@cesium/engine';\nexport { SceneFramebuffer } from '@cesium/engine';\nexport { SceneMode } from '@cesium/engine';\nexport { SceneTransforms } from '@cesium/engine';\nexport { SceneTransitioner } from '@cesium/engine';\nexport { ScreenSpaceCameraController } from '@cesium/engine';\nexport { ShadowMap } from '@cesium/engine';\nexport { ShadowMapShader } from '@cesium/engine';\nexport { ShadowMode } from '@cesium/engine';\nexport { ShadowVolumeAppearance } from '@cesium/engine';\nexport { SingleTileImageryProvider } from '@cesium/engine';\nexport { SkyAtmosphere } from '@cesium/engine';\nexport { SkyBox } from '@cesium/engine';\nexport { SpatialNode } from '@cesium/engine';\nexport { SphereEmitter } from '@cesium/engine';\nexport { SplitDirection } from '@cesium/engine';\nexport { Splitter } from '@cesium/engine';\nexport { StencilConstants } from '@cesium/engine';\nexport { StencilFunction } from '@cesium/engine';\nexport { StencilOperation } from '@cesium/engine';\nexport { StructuralMetadata } from '@cesium/engine';\nexport { StyleExpression } from '@cesium/engine';\nexport { Sun } from '@cesium/engine';\nexport { SunLight } from '@cesium/engine';\nexport { SunPostProcess } from '@cesium/engine';\nexport { SupportedImageFormats } from '@cesium/engine';\nexport { Terrain } from '@cesium/engine';\nexport { TerrainFillMesh } from '@cesium/engine';\nexport { TerrainState } from '@cesium/engine';\nexport { TextureAtlas } from '@cesium/engine';\nexport { TileBoundingRegion } from '@cesium/engine';\nexport { TileBoundingS2Cell } from '@cesium/engine';\nexport { TileBoundingSphere } from '@cesium/engine';\nexport { TileBoundingVolume } from '@cesium/engine';\nexport { TileCoordinatesImageryProvider } from '@cesium/engine';\nexport { TileDiscardPolicy } from '@cesium/engine';\nexport { TileImagery } from '@cesium/engine';\nexport { TileMapServiceImageryProvider } from '@cesium/engine';\nexport { TileMetadata } from '@cesium/engine';\nexport { TileOrientedBoundingBox } from '@cesium/engine';\nexport { TileReplacementQueue } from '@cesium/engine';\nexport { TileSelectionResult } from '@cesium/engine';\nexport { TileState } from '@cesium/engine';\nexport { Tileset3DTileContent } from '@cesium/engine';\nexport { TilesetMetadata } from '@cesium/engine';\nexport { TimeDynamicImagery } from '@cesium/engine';\nexport { TimeDynamicPointCloud } from '@cesium/engine';\nexport { Tonemapper } from '@cesium/engine';\nexport { TranslucentTileClassification } from '@cesium/engine';\nexport { TweenCollection } from '@cesium/engine';\nexport { UrlTemplateImageryProvider } from '@cesium/engine';\nexport { Vector3DTileBatch } from '@cesium/engine';\nexport { Vector3DTileClampedPolylines } from '@cesium/engine';\nexport { Vector3DTileContent } from '@cesium/engine';\nexport { Vector3DTileGeometry } from '@cesium/engine';\nexport { Vector3DTilePoints } from '@cesium/engine';\nexport { Vector3DTilePolygons } from '@cesium/engine';\nexport { Vector3DTilePolylines } from '@cesium/engine';\nexport { Vector3DTilePrimitive } from '@cesium/engine';\nexport { VertexAttributeSemantic } from '@cesium/engine';\nexport { VerticalOrigin } from '@cesium/engine';\nexport { View } from '@cesium/engine';\nexport { ViewportQuad } from '@cesium/engine';\nexport { VoxelBoxShape } from '@cesium/engine';\nexport { VoxelContent } from '@cesium/engine';\nexport { VoxelCylinderShape } from '@cesium/engine';\nexport { VoxelEllipsoidShape } from '@cesium/engine';\nexport { VoxelPrimitive } from '@cesium/engine';\nexport { VoxelProvider } from '@cesium/engine';\nexport { VoxelRenderResources } from '@cesium/engine';\nexport { VoxelShape } from '@cesium/engine';\nexport { VoxelShapeType } from '@cesium/engine';\nexport { VoxelTraversal } from '@cesium/engine';\nexport { WebMapServiceImageryProvider } from '@cesium/engine';\nexport { WebMapTileServiceImageryProvider } from '@cesium/engine';\nexport { buildVoxelDrawCommands } from '@cesium/engine';\nexport { computeFlyToLocationForRectangle } from '@cesium/engine';\nexport { createBillboardPointCallback } from '@cesium/engine';\nexport { createElevationBandMaterial } from '@cesium/engine';\nexport { createGooglePhotorealistic3DTileset } from '@cesium/engine';\nexport { createOsmBuildingsAsync } from '@cesium/engine';\nexport { createTangentSpaceDebugPrimitive } from '@cesium/engine';\nexport { createWorldImageryAsync } from '@cesium/engine';\nexport { findContentMetadata } from '@cesium/engine';\nexport { findGroupMetadata } from '@cesium/engine';\nexport { findTileMetadata } from '@cesium/engine';\nexport { getBinaryAccessor } from '@cesium/engine';\nexport { getClipAndStyleCode } from '@cesium/engine';\nexport { getClippingFunction } from '@cesium/engine';\nexport { hasExtension } from '@cesium/engine';\nexport { parseBatchTable } from '@cesium/engine';\nexport { parseFeatureMetadataLegacy } from '@cesium/engine';\nexport { parseStructuralMetadata } from '@cesium/engine';\nexport { preprocess3DTileContent } from '@cesium/engine';\nexport { processVoxelProperties } from '@cesium/engine';\nexport { _shadersAllMaterialAppearanceFS } from '@cesium/engine';\nexport { _shadersAllMaterialAppearanceVS } from '@cesium/engine';\nexport { _shadersBasicMaterialAppearanceFS } from '@cesium/engine';\nexport { _shadersBasicMaterialAppearanceVS } from '@cesium/engine';\nexport { _shadersEllipsoidSurfaceAppearanceFS } from '@cesium/engine';\nexport { _shadersEllipsoidSurfaceAppearanceVS } from '@cesium/engine';\nexport { _shadersPerInstanceColorAppearanceFS } from '@cesium/engine';\nexport { _shadersPerInstanceColorAppearanceVS } from '@cesium/engine';\nexport { _shadersPerInstanceFlatColorAppearanceFS } from '@cesium/engine';\nexport { _shadersPerInstanceFlatColorAppearanceVS } from '@cesium/engine';\nexport { _shadersPolylineColorAppearanceVS } from '@cesium/engine';\nexport { _shadersPolylineMaterialAppearanceVS } from '@cesium/engine';\nexport { _shadersTexturedMaterialAppearanceFS } from '@cesium/engine';\nexport { _shadersTexturedMaterialAppearanceVS } from '@cesium/engine';\nexport { _shadersCzmBuiltins } from '@cesium/engine';\nexport { _shadersAspectRampMaterial } from '@cesium/engine';\nexport { _shadersBumpMapMaterial } from '@cesium/engine';\nexport { _shadersCheckerboardMaterial } from '@cesium/engine';\nexport { _shadersDotMaterial } from '@cesium/engine';\nexport { _shadersElevationBandMaterial } from '@cesium/engine';\nexport { _shadersElevationContourMaterial } from '@cesium/engine';\nexport { _shadersElevationRampMaterial } from '@cesium/engine';\nexport { _shadersFadeMaterial } from '@cesium/engine';\nexport { _shadersGridMaterial } from '@cesium/engine';\nexport { _shadersNormalMapMaterial } from '@cesium/engine';\nexport { _shadersPolylineArrowMaterial } from '@cesium/engine';\nexport { _shadersPolylineDashMaterial } from '@cesium/engine';\nexport { _shadersPolylineGlowMaterial } from '@cesium/engine';\nexport { _shadersPolylineOutlineMaterial } from '@cesium/engine';\nexport { _shadersRimLightingMaterial } from '@cesium/engine';\nexport { _shadersSlopeRampMaterial } from '@cesium/engine';\nexport { _shadersStripeMaterial } from '@cesium/engine';\nexport { _shadersWater } from '@cesium/engine';\nexport { _shadersCPUStylingStageFS } from '@cesium/engine';\nexport { _shadersCPUStylingStageVS } from '@cesium/engine';\nexport { _shadersCustomShaderStageFS } from '@cesium/engine';\nexport { _shadersCustomShaderStageVS } from '@cesium/engine';\nexport { _shadersFeatureIdStageFS } from '@cesium/engine';\nexport { _shadersFeatureIdStageVS } from '@cesium/engine';\nexport { _shadersGeometryStageFS } from '@cesium/engine';\nexport { _shadersGeometryStageVS } from '@cesium/engine';\nexport { _shadersImageBasedLightingStageFS } from '@cesium/engine';\nexport { _shadersInstancingStageCommon } from '@cesium/engine';\nexport { _shadersInstancingStageVS } from '@cesium/engine';\nexport { _shadersLegacyInstancingStageVS } from '@cesium/engine';\nexport { _shadersLightingStageFS } from '@cesium/engine';\nexport { _shadersMaterialStageFS } from '@cesium/engine';\nexport { _shadersMetadataStageFS } from '@cesium/engine';\nexport { _shadersMetadataStageVS } from '@cesium/engine';\nexport { _shadersModelClippingPlanesStageFS } from '@cesium/engine';\nexport { _shadersModelColorStageFS } from '@cesium/engine';\nexport { _shadersModelFS } from '@cesium/engine';\nexport { _shadersModelSilhouetteStageFS } from '@cesium/engine';\nexport { _shadersModelSilhouetteStageVS } from '@cesium/engine';\nexport { _shadersModelSplitterStageFS } from '@cesium/engine';\nexport { _shadersModelVS } from '@cesium/engine';\nexport { _shadersMorphTargetsStageVS } from '@cesium/engine';\nexport { _shadersPointCloudStylingStageVS } from '@cesium/engine';\nexport { _shadersPrimitiveOutlineStageFS } from '@cesium/engine';\nexport { _shadersPrimitiveOutlineStageVS } from '@cesium/engine';\nexport { _shadersSelectedFeatureIdStageCommon } from '@cesium/engine';\nexport { _shadersSkinningStageVS } from '@cesium/engine';\nexport { _shadersVerticalExaggerationStageVS } from '@cesium/engine';\nexport { _shadersAcesTonemappingStage } from '@cesium/engine';\nexport { _shadersAdditiveBlend } from '@cesium/engine';\nexport { _shadersAmbientOcclusionGenerate } from '@cesium/engine';\nexport { _shadersAmbientOcclusionModulate } from '@cesium/engine';\nexport { _shadersBlackAndWhite } from '@cesium/engine';\nexport { _shadersBloomComposite } from '@cesium/engine';\nexport { _shadersBrightPass } from '@cesium/engine';\nexport { _shadersBrightness } from '@cesium/engine';\nexport { _shadersCompositeTranslucentClassification } from '@cesium/engine';\nexport { _shadersContrastBias } from '@cesium/engine';\nexport { _shadersDepthOfField } from '@cesium/engine';\nexport { _shadersDepthView } from '@cesium/engine';\nexport { _shadersDepthViewPacked } from '@cesium/engine';\nexport { _shadersEdgeDetection } from '@cesium/engine';\nexport { _shadersFXAA } from '@cesium/engine';\nexport { _shadersFilmicTonemapping } from '@cesium/engine';\nexport { _shadersGaussianBlur1D } from '@cesium/engine';\nexport { _shadersLensFlare } from '@cesium/engine';\nexport { _shadersModifiedReinhardTonemapping } from '@cesium/engine';\nexport { _shadersNightVision } from '@cesium/engine';\nexport { _shadersPassThrough } from '@cesium/engine';\nexport { _shadersPassThroughDepth } from '@cesium/engine';\nexport { _shadersPointCloudEyeDomeLighting } from '@cesium/engine';\nexport { _shadersReinhardTonemapping } from '@cesium/engine';\nexport { _shadersSilhouette } from '@cesium/engine';\nexport { _shadersIntersectBox } from '@cesium/engine';\nexport { _shadersIntersectClippingPlanes } from '@cesium/engine';\nexport { _shadersIntersectCylinder } from '@cesium/engine';\nexport { _shadersIntersectDepth } from '@cesium/engine';\nexport { _shadersIntersectEllipsoid } from '@cesium/engine';\nexport { _shadersIntersection } from '@cesium/engine';\nexport { _shadersIntersectionUtils } from '@cesium/engine';\nexport { _shadersMegatexture } from '@cesium/engine';\nexport { _shadersOctree } from '@cesium/engine';\nexport { _shadersVoxelFS } from '@cesium/engine';\nexport { _shadersVoxelVS } from '@cesium/engine';\nexport { _shadersconvertUvToBox } from '@cesium/engine';\nexport { _shadersconvertUvToCylinder } from '@cesium/engine';\nexport { _shadersconvertUvToEllipsoid } from '@cesium/engine';\nexport { ForEach } from '@cesium/engine';\nexport { addBuffer } from '@cesium/engine';\nexport { addDefaults } from '@cesium/engine';\nexport { addExtensionsRequired } from '@cesium/engine';\nexport { addExtensionsUsed } from '@cesium/engine';\nexport { addPipelineExtras } from '@cesium/engine';\nexport { addToArray } from '@cesium/engine';\nexport { findAccessorMinMax } from '@cesium/engine';\nexport { forEachTextureInMaterial } from '@cesium/engine';\nexport { getAccessorByteStride } from '@cesium/engine';\nexport { getComponentReader } from '@cesium/engine';\nexport { moveTechniqueRenderStates } from '@cesium/engine';\nexport { moveTechniquesToExtension } from '@cesium/engine';\nexport { numberOfComponentsForType } from '@cesium/engine';\nexport { parseGlb } from '@cesium/engine';\nexport { readAccessorPacked } from '@cesium/engine';\nexport { removeExtension } from '@cesium/engine';\nexport { removeExtensionsRequired } from '@cesium/engine';\nexport { removeExtensionsUsed } from '@cesium/engine';\nexport { removePipelineExtras } from '@cesium/engine';\nexport { removeUnusedElements } from '@cesium/engine';\nexport { updateAccessorComponentTypes } from '@cesium/engine';\nexport { updateVersion } from '@cesium/engine';\nexport { usesExtension } from '@cesium/engine';\nexport { AlphaPipelineStage } from '@cesium/engine';\nexport { B3dmLoader } from '@cesium/engine';\nexport { BatchTexturePipelineStage } from '@cesium/engine';\nexport { CPUStylingPipelineStage } from '@cesium/engine';\nexport { ClassificationModelDrawCommand } from '@cesium/engine';\nexport { ClassificationPipelineStage } from '@cesium/engine';\nexport { CustomShader } from '@cesium/engine';\nexport { CustomShaderMode } from '@cesium/engine';\nexport { CustomShaderPipelineStage } from '@cesium/engine';\nexport { CustomShaderTranslucencyMode } from '@cesium/engine';\nexport { DequantizationPipelineStage } from '@cesium/engine';\nexport { FeatureIdPipelineStage } from '@cesium/engine';\nexport { GeoJsonLoader } from '@cesium/engine';\nexport { GeometryPipelineStage } from '@cesium/engine';\nexport { I3dmLoader } from '@cesium/engine';\nexport { ImageBasedLightingPipelineStage } from '@cesium/engine';\nexport { InstancingPipelineStage } from '@cesium/engine';\nexport { LightingModel } from '@cesium/engine';\nexport { LightingPipelineStage } from '@cesium/engine';\nexport { MaterialPipelineStage } from '@cesium/engine';\nexport { MetadataPipelineStage } from '@cesium/engine';\nexport { Model } from '@cesium/engine';\nexport { Model3DTileContent } from '@cesium/engine';\nexport { ModelAlphaOptions } from '@cesium/engine';\nexport { ModelAnimation } from '@cesium/engine';\nexport { ModelAnimationChannel } from '@cesium/engine';\nexport { ModelAnimationCollection } from '@cesium/engine';\nexport { ModelArticulation } from '@cesium/engine';\nexport { ModelArticulationStage } from '@cesium/engine';\nexport { ModelClippingPlanesPipelineStage } from '@cesium/engine';\nexport { ModelColorPipelineStage } from '@cesium/engine';\nexport { ModelDrawCommand } from '@cesium/engine';\nexport { ModelFeature } from '@cesium/engine';\nexport { ModelFeatureTable } from '@cesium/engine';\nexport { ModelLightingOptions } from '@cesium/engine';\nexport { ModelMatrixUpdateStage } from '@cesium/engine';\nexport { ModelNode } from '@cesium/engine';\nexport { ModelRenderResources } from '@cesium/engine';\nexport { ModelRuntimeNode } from '@cesium/engine';\nexport { ModelRuntimePrimitive } from '@cesium/engine';\nexport { ModelSceneGraph } from '@cesium/engine';\nexport { ModelSilhouettePipelineStage } from '@cesium/engine';\nexport { ModelSkin } from '@cesium/engine';\nexport { ModelSplitterPipelineStage } from '@cesium/engine';\nexport { ModelStatistics } from '@cesium/engine';\nexport { ModelType } from '@cesium/engine';\nexport { ModelUtility } from '@cesium/engine';\nexport { MorphTargetsPipelineStage } from '@cesium/engine';\nexport { NodeRenderResources } from '@cesium/engine';\nexport { NodeStatisticsPipelineStage } from '@cesium/engine';\nexport { PickingPipelineStage } from '@cesium/engine';\nexport { PntsLoader } from '@cesium/engine';\nexport { PointCloudStylingPipelineStage } from '@cesium/engine';\nexport { PrimitiveOutlineGenerator } from '@cesium/engine';\nexport { PrimitiveOutlinePipelineStage } from '@cesium/engine';\nexport { PrimitiveRenderResources } from '@cesium/engine';\nexport { PrimitiveStatisticsPipelineStage } from '@cesium/engine';\nexport { SceneMode2DPipelineStage } from '@cesium/engine';\nexport { SelectedFeatureIdPipelineStage } from '@cesium/engine';\nexport { SkinningPipelineStage } from '@cesium/engine';\nexport { StyleCommandsNeeded } from '@cesium/engine';\nexport { TextureManager } from '@cesium/engine';\nexport { TextureUniform } from '@cesium/engine';\nexport { TilesetPipelineStage } from '@cesium/engine';\nexport { UniformType } from '@cesium/engine';\nexport { VaryingType } from '@cesium/engine';\nexport { VerticalExaggerationPipelineStage } from '@cesium/engine';\nexport { WireframePipelineStage } from '@cesium/engine';\nexport { buildDrawCommand } from '@cesium/engine';\nexport { _shadersdegreesPerRadian } from '@cesium/engine';\nexport { _shadersdepthRange } from '@cesium/engine';\nexport { _shadersepsilon1 } from '@cesium/engine';\nexport { _shadersepsilon2 } from '@cesium/engine';\nexport { _shadersepsilon3 } from '@cesium/engine';\nexport { _shadersepsilon4 } from '@cesium/engine';\nexport { _shadersepsilon5 } from '@cesium/engine';\nexport { _shadersepsilon6 } from '@cesium/engine';\nexport { _shadersepsilon7 } from '@cesium/engine';\nexport { _shadersinfinity } from '@cesium/engine';\nexport { _shadersoneOverPi } from '@cesium/engine';\nexport { _shadersoneOverTwoPi } from '@cesium/engine';\nexport { _shaderspassCesium3DTile } from '@cesium/engine';\nexport { _shaderspassCesium3DTileClassification } from '@cesium/engine';\nexport { _shaderspassCesium3DTileClassificationIgnoreShow } from '@cesium/engine';\nexport { _shaderspassClassification } from '@cesium/engine';\nexport { _shaderspassCompute } from '@cesium/engine';\nexport { _shaderspassEnvironment } from '@cesium/engine';\nexport { _shaderspassGlobe } from '@cesium/engine';\nexport { _shaderspassOpaque } from '@cesium/engine';\nexport { _shaderspassOverlay } from '@cesium/engine';\nexport { _shaderspassTerrainClassification } from '@cesium/engine';\nexport { _shaderspassTranslucent } from '@cesium/engine';\nexport { _shaderspassVoxels } from '@cesium/engine';\nexport { _shaderspi } from '@cesium/engine';\nexport { _shaderspiOverFour } from '@cesium/engine';\nexport { _shaderspiOverSix } from '@cesium/engine';\nexport { _shaderspiOverThree } from '@cesium/engine';\nexport { _shaderspiOverTwo } from '@cesium/engine';\nexport { _shadersradiansPerDegree } from '@cesium/engine';\nexport { _shaderssceneMode2D } from '@cesium/engine';\nexport { _shaderssceneMode3D } from '@cesium/engine';\nexport { _shaderssceneModeColumbusView } from '@cesium/engine';\nexport { _shaderssceneModeMorphing } from '@cesium/engine';\nexport { _shaderssolarRadius } from '@cesium/engine';\nexport { _shadersthreePiOver2 } from '@cesium/engine';\nexport { _shaderstwoPi } from '@cesium/engine';\nexport { _shaderswebMercatorMaxLatitude } from '@cesium/engine';\nexport { _shadersHSBToRGB } from '@cesium/engine';\nexport { _shadersHSLToRGB } from '@cesium/engine';\nexport { _shadersRGBToHSB } from '@cesium/engine';\nexport { _shadersRGBToHSL } from '@cesium/engine';\nexport { _shadersRGBToXYZ } from '@cesium/engine';\nexport { _shadersXYZToRGB } from '@cesium/engine';\nexport { _shadersacesTonemapping } from '@cesium/engine';\nexport { _shadersalphaWeight } from '@cesium/engine';\nexport { _shadersantialias } from '@cesium/engine';\nexport { _shadersapproximateSphericalCoordinates } from '@cesium/engine';\nexport { _shadersbackFacing } from '@cesium/engine';\nexport { _shadersbranchFreeTernary } from '@cesium/engine';\nexport { _shaderscascadeColor } from '@cesium/engine';\nexport { _shaderscascadeDistance } from '@cesium/engine';\nexport { _shaderscascadeMatrix } from '@cesium/engine';\nexport { _shaderscascadeWeights } from '@cesium/engine';\nexport { _shaderscolumbusViewMorph } from '@cesium/engine';\nexport { _shaderscomputePosition } from '@cesium/engine';\nexport { _shaderscosineAndSine } from '@cesium/engine';\nexport { _shadersdecompressTextureCoordinates } from '@cesium/engine';\nexport { _shadersdefaultPbrMaterial } from '@cesium/engine';\nexport { _shadersdepthClamp } from '@cesium/engine';\nexport { _shaderseastNorthUpToEyeCoordinates } from '@cesium/engine';\nexport { _shadersellipsoidContainsPoint } from '@cesium/engine';\nexport { _shadersellipsoidWgs84TextureCoordinates } from '@cesium/engine';\nexport { _shadersequalsEpsilon } from '@cesium/engine';\nexport { _shaderseyeOffset } from '@cesium/engine';\nexport { _shaderseyeToWindowCoordinates } from '@cesium/engine';\nexport { _shadersfastApproximateAtan } from '@cesium/engine';\nexport { _shadersfog } from '@cesium/engine';\nexport { _shadersgammaCorrect } from '@cesium/engine';\nexport { _shadersgeodeticSurfaceNormal } from '@cesium/engine';\nexport { _shadersgetDefaultMaterial } from '@cesium/engine';\nexport { _shadersgetLambertDiffuse } from '@cesium/engine';\nexport { _shadersgetSpecular } from '@cesium/engine';\nexport { _shadersgetWaterNoise } from '@cesium/engine';\nexport { _shadershue } from '@cesium/engine';\nexport { _shadersinverseGamma } from '@cesium/engine';\nexport { _shadersisEmpty } from '@cesium/engine';\nexport { _shadersisFull } from '@cesium/engine';\nexport { _shaderslatitudeToWebMercatorFraction } from '@cesium/engine';\nexport { _shaderslineDistance } from '@cesium/engine';\nexport { _shaderslinearToSrgb } from '@cesium/engine';\nexport { _shadersluminance } from '@cesium/engine';\nexport { _shadersmetersPerPixel } from '@cesium/engine';\nexport { _shadersmodelToWindowCoordinates } from '@cesium/engine';\nexport { _shadersmultiplyWithColorBalance } from '@cesium/engine';\nexport { _shadersnearFarScalar } from '@cesium/engine';\nexport { _shadersoctDecode } from '@cesium/engine';\nexport { _shaderspackDepth } from '@cesium/engine';\nexport { _shaderspbrLighting } from '@cesium/engine';\nexport { _shaderspbrMetallicRoughnessMaterial } from '@cesium/engine';\nexport { _shaderspbrSpecularGlossinessMaterial } from '@cesium/engine';\nexport { _shadersphong } from '@cesium/engine';\nexport { _shadersplaneDistance } from '@cesium/engine';\nexport { _shaderspointAlongRay } from '@cesium/engine';\nexport { _shadersrayEllipsoidIntersectionInterval } from '@cesium/engine';\nexport { _shadersraySphereIntersectionInterval } from '@cesium/engine';\nexport { _shadersreadDepth } from '@cesium/engine';\nexport { _shadersreadNonPerspective } from '@cesium/engine';\nexport { _shadersreverseLogDepth } from '@cesium/engine';\nexport { _shadersround } from '@cesium/engine';\nexport { _shaderssampleOctahedralProjection } from '@cesium/engine';\nexport { _shaderssaturation } from '@cesium/engine';\nexport { _shadersshadowDepthCompare } from '@cesium/engine';\nexport { _shadersshadowVisibility } from '@cesium/engine';\nexport { _shaderssignNotZero } from '@cesium/engine';\nexport { _shaderssphericalHarmonics } from '@cesium/engine';\nexport { _shaderssrgbToLinear } from '@cesium/engine';\nexport { _shaderstangentToEyeSpaceMatrix } from '@cesium/engine';\nexport { _shaderstextureCube } from '@cesium/engine';\nexport { _shaderstransformPlane } from '@cesium/engine';\nexport { _shaderstranslateRelativeToEye } from '@cesium/engine';\nexport { _shaderstranslucentPhong } from '@cesium/engine';\nexport { _shaderstranspose } from '@cesium/engine';\nexport { _shadersunpackDepth } from '@cesium/engine';\nexport { _shadersunpackFloat } from '@cesium/engine';\nexport { _shadersunpackUint } from '@cesium/engine';\nexport { _shadersvalueTransform } from '@cesium/engine';\nexport { _shadersvertexLogDepth } from '@cesium/engine';\nexport { _shaderswindowToEyeCoordinates } from '@cesium/engine';\nexport { _shaderswriteDepthClamp } from '@cesium/engine';\nexport { _shaderswriteLogDepth } from '@cesium/engine';\nexport { _shaderswriteNonPerspective } from '@cesium/engine';\nexport { _shadersdepthRangeStruct } from '@cesium/engine';\nexport { _shadersmaterial } from '@cesium/engine';\nexport { _shadersmaterialInput } from '@cesium/engine';\nexport { _shadersmodelMaterial } from '@cesium/engine';\nexport { _shadersmodelVertexOutput } from '@cesium/engine';\nexport { _shaderspbrParameters } from '@cesium/engine';\nexport { _shadersray } from '@cesium/engine';\nexport { _shadersraySegment } from '@cesium/engine';\nexport { _shadersshadowParameters } from '@cesium/engine';\nexport { createTaskProcessorWorker } from '@cesium/engine';\nexport { ClockViewModel } from '@cesium/widgets';\nexport { Command } from '@cesium/widgets';\nexport { InspectorShared } from '@cesium/widgets';\nexport { SvgPathBindingHandler } from '@cesium/widgets';\nexport { ToggleButtonViewModel } from '@cesium/widgets';\nexport { createCommand } from '@cesium/widgets';\nexport { subscribeAndEvaluate } from '@cesium/widgets';\nexport { Cesium3DTilesInspector } from '@cesium/widgets';\nexport { Cesium3DTilesInspectorViewModel } from '@cesium/widgets';\nexport { CesiumInspector } from '@cesium/widgets';\nexport { CesiumInspectorViewModel } from '@cesium/widgets';\nexport { Animation } from '@cesium/widgets';\nexport { AnimationViewModel } from '@cesium/widgets';\nexport { BaseLayerPicker } from '@cesium/widgets';\nexport { BaseLayerPickerViewModel } from '@cesium/widgets';\nexport { ProviderViewModel } from '@cesium/widgets';\nexport { createDefaultImageryProviderViewModels } from '@cesium/widgets';\nexport { createDefaultTerrainProviderViewModels } from '@cesium/widgets';\nexport { FullscreenButton } from '@cesium/widgets';\nexport { FullscreenButtonViewModel } from '@cesium/widgets';\nexport { HomeButton } from '@cesium/widgets';\nexport { HomeButtonViewModel } from '@cesium/widgets';\nexport { Geocoder } from '@cesium/widgets';\nexport { GeocoderViewModel } from '@cesium/widgets';\nexport { InfoBox } from '@cesium/widgets';\nexport { InfoBoxViewModel } from '@cesium/widgets';\nexport { NavigationHelpButton } from '@cesium/widgets';\nexport { NavigationHelpButtonViewModel } from '@cesium/widgets';\nexport { PerformanceWatchdog } from '@cesium/widgets';\nexport { PerformanceWatchdogViewModel } from '@cesium/widgets';\nexport { ProjectionPicker } from '@cesium/widgets';\nexport { ProjectionPickerViewModel } from '@cesium/widgets';\nexport { SceneModePicker } from '@cesium/widgets';\nexport { SceneModePickerViewModel } from '@cesium/widgets';\nexport { SelectionIndicator } from '@cesium/widgets';\nexport { SelectionIndicatorViewModel } from '@cesium/widgets';\nexport { knockout_3_5_1 } from '@cesium/widgets';\nexport { knockout_es5 } from '@cesium/widgets';\nexport { knockout } from '@cesium/widgets';\nexport { Timeline } from '@cesium/widgets';\nexport { TimelineHighlightRange } from '@cesium/widgets';\nexport { TimelineTrack } from '@cesium/widgets';\nexport { VRButton } from '@cesium/widgets';\nexport { VRButtonViewModel } from '@cesium/widgets';\nexport { Viewer } from '@cesium/widgets';\nexport { viewerCesium3DTilesInspectorMixin } from '@cesium/widgets';\nexport { viewerCesiumInspectorMixin } from '@cesium/widgets';\nexport { viewerDragDropMixin } from '@cesium/widgets';\nexport { viewerPerformanceWatchdogMixin } from '@cesium/widgets';\nexport { viewerVoxelInspectorMixin } from '@cesium/widgets';\nexport { VoxelInspector } from '@cesium/widgets';\nexport { VoxelInspectorViewModel } from '@cesium/widgets';\n", "/**\n * @function\n *\n * @param {*} value The object.\n * @returns {boolean} Returns true if the object is defined, returns false otherwise.\n *\n * @example\n * if (Cesium.defined(positions)) {\n *      doSomething();\n * } else {\n *      doSomethingElse();\n * }\n */\nfunction defined(value) {\n  return value !== undefined && value !== null;\n}\nexport default defined;\n", "import defined from \"./defined.js\";\n\n/**\n * Constructs an exception object that is thrown due to a developer error, e.g., invalid argument,\n * argument out of range, etc.  This exception should only be thrown during development;\n * it usually indicates a bug in the calling code.  This exception should never be\n * caught; instead the calling code should strive not to generate it.\n * <br /><br />\n * On the other hand, a {@link RuntimeError} indicates an exception that may\n * be thrown at runtime, e.g., out of memory, that the calling code should be prepared\n * to catch.\n *\n * @alias DeveloperError\n * @constructor\n * @extends Error\n *\n * @param {string} [message] The error message for this exception.\n *\n * @see RuntimeError\n */\nfunction DeveloperError(message) {\n  /**\n   * 'DeveloperError' indicating that this exception was thrown due to a developer error.\n   * @type {string}\n   * @readonly\n   */\n  this.name = \"DeveloperError\";\n\n  /**\n   * The explanation for why this exception was thrown.\n   * @type {string}\n   * @readonly\n   */\n  this.message = message;\n\n  //Browsers such as IE don't have a stack property until you actually throw the error.\n  let stack;\n  try {\n    throw new Error();\n  } catch (e) {\n    stack = e.stack;\n  }\n\n  /**\n   * The stack trace of this exception, if available.\n   * @type {string}\n   * @readonly\n   */\n  this.stack = stack;\n}\n\nif (defined(Object.create)) {\n  DeveloperError.prototype = Object.create(Error.prototype);\n  DeveloperError.prototype.constructor = DeveloperError;\n}\n\nDeveloperError.prototype.toString = function () {\n  let str = `${this.name}: ${this.message}`;\n\n  if (defined(this.stack)) {\n    str += `\\n${this.stack.toString()}`;\n  }\n\n  return str;\n};\n\n/**\n * @private\n */\nDeveloperError.throwInstantiationError = function () {\n  throw new DeveloperError(\n    \"This function defines an interface and should not be called directly.\"\n  );\n};\nexport default DeveloperError;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Contains functions for checking that supplied arguments are of a specified type\n * or meet specified conditions\n * @private\n */\nconst Check = {};\n\n/**\n * Contains type checking functions, all using the typeof operator\n */\nCheck.typeOf = {};\n\nfunction getUndefinedErrorMessage(name) {\n  return `${name} is required, actual value was undefined`;\n}\n\nfunction getFailedTypeErrorMessage(actual, expected, name) {\n  return `Expected ${name} to be typeof ${expected}, actual typeof was ${actual}`;\n}\n\n/**\n * Throws if test is not defined\n *\n * @param {string} name The name of the variable being tested\n * @param {*} test The value that is to be checked\n * @exception {DeveloperError} test must be defined\n */\nCheck.defined = function (name, test) {\n  if (!defined(test)) {\n    throw new DeveloperError(getUndefinedErrorMessage(name));\n  }\n};\n\n/**\n * Throws if test is not typeof 'function'\n *\n * @param {string} name The name of the variable being tested\n * @param {*} test The value to test\n * @exception {DeveloperError} test must be typeof 'function'\n */\nCheck.typeOf.func = function (name, test) {\n  if (typeof test !== \"function\") {\n    throw new DeveloperError(\n      getFailedTypeErrorMessage(typeof test, \"function\", name)\n    );\n  }\n};\n\n/**\n * Throws if test is not typeof 'string'\n *\n * @param {string} name The name of the variable being tested\n * @param {*} test The value to test\n * @exception {DeveloperError} test must be typeof 'string'\n */\nCheck.typeOf.string = function (name, test) {\n  if (typeof test !== \"string\") {\n    throw new DeveloperError(\n      getFailedTypeErrorMessage(typeof test, \"string\", name)\n    );\n  }\n};\n\n/**\n * Throws if test is not typeof 'number'\n *\n * @param {string} name The name of the variable being tested\n * @param {*} test The value to test\n * @exception {DeveloperError} test must be typeof 'number'\n */\nCheck.typeOf.number = function (name, test) {\n  if (typeof test !== \"number\") {\n    throw new DeveloperError(\n      getFailedTypeErrorMessage(typeof test, \"number\", name)\n    );\n  }\n};\n\n/**\n * Throws if test is not typeof 'number' and less than limit\n *\n * @param {string} name The name of the variable being tested\n * @param {*} test The value to test\n * @param {number} limit The limit value to compare against\n * @exception {DeveloperError} test must be typeof 'number' and less than limit\n */\nCheck.typeOf.number.lessThan = function (name, test, limit) {\n  Check.typeOf.number(name, test);\n  if (test >= limit) {\n    throw new DeveloperError(\n      `Expected ${name} to be less than ${limit}, actual value was ${test}`\n    );\n  }\n};\n\n/**\n * Throws if test is not typeof 'number' and less than or equal to limit\n *\n * @param {string} name The name of the variable being tested\n * @param {*} test The value to test\n * @param {number} limit The limit value to compare against\n * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit\n */\nCheck.typeOf.number.lessThanOrEquals = function (name, test, limit) {\n  Check.typeOf.number(name, test);\n  if (test > limit) {\n    throw new DeveloperError(\n      `Expected ${name} to be less than or equal to ${limit}, actual value was ${test}`\n    );\n  }\n};\n\n/**\n * Throws if test is not typeof 'number' and greater than limit\n *\n * @param {string} name The name of the variable being tested\n * @param {*} test The value to test\n * @param {number} limit The limit value to compare against\n * @exception {DeveloperError} test must be typeof 'number' and greater than limit\n */\nCheck.typeOf.number.greaterThan = function (name, test, limit) {\n  Check.typeOf.number(name, test);\n  if (test <= limit) {\n    throw new DeveloperError(\n      `Expected ${name} to be greater than ${limit}, actual value was ${test}`\n    );\n  }\n};\n\n/**\n * Throws if test is not typeof 'number' and greater than or equal to limit\n *\n * @param {string} name The name of the variable being tested\n * @param {*} test The value to test\n * @param {number} limit The limit value to compare against\n * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit\n */\nCheck.typeOf.number.greaterThanOrEquals = function (name, test, limit) {\n  Check.typeOf.number(name, test);\n  if (test < limit) {\n    throw new DeveloperError(\n      `Expected ${name} to be greater than or equal to ${limit}, actual value was ${test}`\n    );\n  }\n};\n\n/**\n * Throws if test is not typeof 'object'\n *\n * @param {string} name The name of the variable being tested\n * @param {*} test The value to test\n * @exception {DeveloperError} test must be typeof 'object'\n */\nCheck.typeOf.object = function (name, test) {\n  if (typeof test !== \"object\") {\n    throw new DeveloperError(\n      getFailedTypeErrorMessage(typeof test, \"object\", name)\n    );\n  }\n};\n\n/**\n * Throws if test is not typeof 'boolean'\n *\n * @param {string} name The name of the variable being tested\n * @param {*} test The value to test\n * @exception {DeveloperError} test must be typeof 'boolean'\n */\nCheck.typeOf.bool = function (name, test) {\n  if (typeof test !== \"boolean\") {\n    throw new DeveloperError(\n      getFailedTypeErrorMessage(typeof test, \"boolean\", name)\n    );\n  }\n};\n\n/**\n * Throws if test is not typeof 'bigint'\n *\n * @param {string} name The name of the variable being tested\n * @param {*} test The value to test\n * @exception {DeveloperError} test must be typeof 'bigint'\n */\nCheck.typeOf.bigint = function (name, test) {\n  if (typeof test !== \"bigint\") {\n    throw new DeveloperError(\n      getFailedTypeErrorMessage(typeof test, \"bigint\", name)\n    );\n  }\n};\n\n/**\n * Throws if test1 and test2 is not typeof 'number' and not equal in value\n *\n * @param {string} name1 The name of the first variable being tested\n * @param {string} name2 The name of the second variable being tested against\n * @param {*} test1 The value to test\n * @param {*} test2 The value to test against\n * @exception {DeveloperError} test1 and test2 should be type of 'number' and be equal in value\n */\nCheck.typeOf.number.equals = function (name1, name2, test1, test2) {\n  Check.typeOf.number(name1, test1);\n  Check.typeOf.number(name2, test2);\n  if (test1 !== test2) {\n    throw new DeveloperError(\n      `${name1} must be equal to ${name2}, the actual values are ${test1} and ${test2}`\n    );\n  }\n};\nexport default Check;\n", "/**\n * Returns the first parameter if not undefined, otherwise the second parameter.\n * Useful for setting a default value for a parameter.\n *\n * @function\n *\n * @param {*} a\n * @param {*} b\n * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter.\n *\n * @example\n * param = Cesium.defaultValue(param, 'default');\n */\nfunction defaultValue(a, b) {\n  if (a !== undefined && a !== null) {\n    return a;\n  }\n  return b;\n}\n\n/**\n * A frozen empty object that can be used as the default value for options passed as\n * an object literal.\n * @type {object}\n * @memberof defaultValue\n */\ndefaultValue.EMPTY_OBJECT = Object.freeze({});\n\nexport default defaultValue;\n", "import MersenneTwister from \"mersenne-twister\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Math functions.\n *\n * @exports CesiumMath\n * @alias Math\n */\nconst CesiumMath = {};\n\n/**\n * 0.1\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON1 = 0.1;\n\n/**\n * 0.01\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON2 = 0.01;\n\n/**\n * 0.001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON3 = 0.001;\n\n/**\n * 0.0001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON4 = 0.0001;\n\n/**\n * 0.00001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON5 = 0.00001;\n\n/**\n * 0.000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON6 = 0.000001;\n\n/**\n * 0.0000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON7 = 0.0000001;\n\n/**\n * 0.00000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON8 = 0.00000001;\n\n/**\n * 0.000000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON9 = 0.000000001;\n\n/**\n * 0.0000000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON10 = 0.0000000001;\n\n/**\n * 0.00000000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON11 = 0.00000000001;\n\n/**\n * 0.000000000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON12 = 0.000000000001;\n\n/**\n * 0.0000000000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON13 = 0.0000000000001;\n\n/**\n * 0.00000000000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON14 = 0.00000000000001;\n\n/**\n * 0.000000000000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON15 = 0.000000000000001;\n\n/**\n * 0.0000000000000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON16 = 0.0000000000000001;\n\n/**\n * 0.00000000000000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON17 = 0.00000000000000001;\n\n/**\n * 0.000000000000000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON18 = 0.000000000000000001;\n\n/**\n * 0.0000000000000000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON19 = 0.0000000000000000001;\n\n/**\n * 0.00000000000000000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON20 = 0.00000000000000000001;\n\n/**\n * 0.000000000000000000001\n * @type {number}\n * @constant\n */\nCesiumMath.EPSILON21 = 0.000000000000000000001;\n\n/**\n * The gravitational parameter of the Earth in meters cubed\n * per second squared as defined by the WGS84 model: 3.986004418e14\n * @type {number}\n * @constant\n */\nCesiumMath.GRAVITATIONALPARAMETER = 3.986004418e14;\n\n/**\n * Radius of the sun in meters: 6.955e8\n * @type {number}\n * @constant\n */\nCesiumMath.SOLAR_RADIUS = 6.955e8;\n\n/**\n * The mean radius of the moon, according to the \"Report of the IAU/IAG Working Group on\n * Cartographic Coordinates and Rotational Elements of the Planets and satellites: 2000\",\n * Celestial Mechanics 82: 83-110, 2002.\n * @type {number}\n * @constant\n */\nCesiumMath.LUNAR_RADIUS = 1737400.0;\n\n/**\n * 64 * 1024\n * @type {number}\n * @constant\n */\nCesiumMath.SIXTY_FOUR_KILOBYTES = 64 * 1024;\n\n/**\n * 4 * 1024 * 1024 * 1024\n * @type {number}\n * @constant\n */\nCesiumMath.FOUR_GIGABYTES = 4 * 1024 * 1024 * 1024;\n\n/**\n * Returns the sign of the value; 1 if the value is positive, -1 if the value is\n * negative, or 0 if the value is 0.\n *\n * @function\n * @param {number} value The value to return the sign of.\n * @returns {number} The sign of value.\n */\n// eslint-disable-next-line es/no-math-sign\nCesiumMath.sign = defaultValue(Math.sign, function sign(value) {\n  value = +value; // coerce to number\n  if (value === 0 || value !== value) {\n    // zero or NaN\n    return value;\n  }\n  return value > 0 ? 1 : -1;\n});\n\n/**\n * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.\n * This is similar to {@link CesiumMath#sign} except that returns 1.0 instead of\n * 0.0 when the input value is 0.0.\n * @param {number} value The value to return the sign of.\n * @returns {number} The sign of value.\n */\nCesiumMath.signNotZero = function (value) {\n  return value < 0.0 ? -1.0 : 1.0;\n};\n\n/**\n * Converts a scalar value in the range [-1.0, 1.0] to a SNORM in the range [0, rangeMaximum]\n * @param {number} value The scalar value in the range [-1.0, 1.0]\n * @param {number} [rangeMaximum=255] The maximum value in the mapped range, 255 by default.\n * @returns {number} A SNORM value, where 0 maps to -1.0 and rangeMaximum maps to 1.0.\n *\n * @see CesiumMath.fromSNorm\n */\nCesiumMath.toSNorm = function (value, rangeMaximum) {\n  rangeMaximum = defaultValue(rangeMaximum, 255);\n  return Math.round(\n    (CesiumMath.clamp(value, -1.0, 1.0) * 0.5 + 0.5) * rangeMaximum\n  );\n};\n\n/**\n * Converts a SNORM value in the range [0, rangeMaximum] to a scalar in the range [-1.0, 1.0].\n * @param {number} value SNORM value in the range [0, rangeMaximum]\n * @param {number} [rangeMaximum=255] The maximum value in the SNORM range, 255 by default.\n * @returns {number} Scalar in the range [-1.0, 1.0].\n *\n * @see CesiumMath.toSNorm\n */\nCesiumMath.fromSNorm = function (value, rangeMaximum) {\n  rangeMaximum = defaultValue(rangeMaximum, 255);\n  return (\n    (CesiumMath.clamp(value, 0.0, rangeMaximum) / rangeMaximum) * 2.0 - 1.0\n  );\n};\n\n/**\n * Converts a scalar value in the range [rangeMinimum, rangeMaximum] to a scalar in the range [0.0, 1.0]\n * @param {number} value The scalar value in the range [rangeMinimum, rangeMaximum]\n * @param {number} rangeMinimum The minimum value in the mapped range.\n * @param {number} rangeMaximum The maximum value in the mapped range.\n * @returns {number} A scalar value, where rangeMinimum maps to 0.0 and rangeMaximum maps to 1.0.\n */\nCesiumMath.normalize = function (value, rangeMinimum, rangeMaximum) {\n  rangeMaximum = Math.max(rangeMaximum - rangeMinimum, 0.0);\n  return rangeMaximum === 0.0\n    ? 0.0\n    : CesiumMath.clamp((value - rangeMinimum) / rangeMaximum, 0.0, 1.0);\n};\n\n/**\n * Returns the hyperbolic sine of a number.\n * The hyperbolic sine of <em>value</em> is defined to be\n * (<em>e<sup>x</sup>&nbsp;-&nbsp;e<sup>-x</sup></em>)/2.0\n * where <i>e</i> is Euler's number, approximately 2.71828183.\n *\n * <p>Special cases:\n *   <ul>\n *     <li>If the argument is NaN, then the result is NaN.</li>\n *\n *     <li>If the argument is infinite, then the result is an infinity\n *     with the same sign as the argument.</li>\n *\n *     <li>If the argument is zero, then the result is a zero with the\n *     same sign as the argument.</li>\n *   </ul>\n *</p>\n *\n * @function\n * @param {number} value The number whose hyperbolic sine is to be returned.\n * @returns {number} The hyperbolic sine of <code>value</code>.\n */\n// eslint-disable-next-line es/no-math-sinh\nCesiumMath.sinh = defaultValue(Math.sinh, function sinh(value) {\n  return (Math.exp(value) - Math.exp(-value)) / 2.0;\n});\n\n/**\n * Returns the hyperbolic cosine of a number.\n * The hyperbolic cosine of <strong>value</strong> is defined to be\n * (<em>e<sup>x</sup>&nbsp;+&nbsp;e<sup>-x</sup></em>)/2.0\n * where <i>e</i> is Euler's number, approximately 2.71828183.\n *\n * <p>Special cases:\n *   <ul>\n *     <li>If the argument is NaN, then the result is NaN.</li>\n *\n *     <li>If the argument is infinite, then the result is positive infinity.</li>\n *\n *     <li>If the argument is zero, then the result is 1.0.</li>\n *   </ul>\n *</p>\n *\n * @function\n * @param {number} value The number whose hyperbolic cosine is to be returned.\n * @returns {number} The hyperbolic cosine of <code>value</code>.\n */\n// eslint-disable-next-line es/no-math-cosh\nCesiumMath.cosh = defaultValue(Math.cosh, function cosh(value) {\n  return (Math.exp(value) + Math.exp(-value)) / 2.0;\n});\n\n/**\n * Computes the linear interpolation of two values.\n *\n * @param {number} p The start value to interpolate.\n * @param {number} q The end value to interpolate.\n * @param {number} time The time of interpolation generally in the range <code>[0.0, 1.0]</code>.\n * @returns {number} The linearly interpolated value.\n *\n * @example\n * const n = Cesium.Math.lerp(0.0, 2.0, 0.5); // returns 1.0\n */\nCesiumMath.lerp = function (p, q, time) {\n  return (1.0 - time) * p + time * q;\n};\n\n/**\n * pi\n *\n * @type {number}\n * @constant\n */\nCesiumMath.PI = Math.PI;\n\n/**\n * 1/pi\n *\n * @type {number}\n * @constant\n */\nCesiumMath.ONE_OVER_PI = 1.0 / Math.PI;\n\n/**\n * pi/2\n *\n * @type {number}\n * @constant\n */\nCesiumMath.PI_OVER_TWO = Math.PI / 2.0;\n\n/**\n * pi/3\n *\n * @type {number}\n * @constant\n */\nCesiumMath.PI_OVER_THREE = Math.PI / 3.0;\n\n/**\n * pi/4\n *\n * @type {number}\n * @constant\n */\nCesiumMath.PI_OVER_FOUR = Math.PI / 4.0;\n\n/**\n * pi/6\n *\n * @type {number}\n * @constant\n */\nCesiumMath.PI_OVER_SIX = Math.PI / 6.0;\n\n/**\n * 3pi/2\n *\n * @type {number}\n * @constant\n */\nCesiumMath.THREE_PI_OVER_TWO = (3.0 * Math.PI) / 2.0;\n\n/**\n * 2pi\n *\n * @type {number}\n * @constant\n */\nCesiumMath.TWO_PI = 2.0 * Math.PI;\n\n/**\n * 1/2pi\n *\n * @type {number}\n * @constant\n */\nCesiumMath.ONE_OVER_TWO_PI = 1.0 / (2.0 * Math.PI);\n\n/**\n * The number of radians in a degree.\n *\n * @type {number}\n * @constant\n */\nCesiumMath.RADIANS_PER_DEGREE = Math.PI / 180.0;\n\n/**\n * The number of degrees in a radian.\n *\n * @type {number}\n * @constant\n */\nCesiumMath.DEGREES_PER_RADIAN = 180.0 / Math.PI;\n\n/**\n * The number of radians in an arc second.\n *\n * @type {number}\n * @constant\n */\nCesiumMath.RADIANS_PER_ARCSECOND = CesiumMath.RADIANS_PER_DEGREE / 3600.0;\n\n/**\n * Converts degrees to radians.\n * @param {number} degrees The angle to convert in degrees.\n * @returns {number} The corresponding angle in radians.\n */\nCesiumMath.toRadians = function (degrees) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(degrees)) {\n    throw new DeveloperError(\"degrees is required.\");\n  }\n  //>>includeEnd('debug');\n  return degrees * CesiumMath.RADIANS_PER_DEGREE;\n};\n\n/**\n * Converts radians to degrees.\n * @param {number} radians The angle to convert in radians.\n * @returns {number} The corresponding angle in degrees.\n */\nCesiumMath.toDegrees = function (radians) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(radians)) {\n    throw new DeveloperError(\"radians is required.\");\n  }\n  //>>includeEnd('debug');\n  return radians * CesiumMath.DEGREES_PER_RADIAN;\n};\n\n/**\n * Converts a longitude value, in radians, to the range [<code>-Math.PI</code>, <code>Math.PI</code>).\n *\n * @param {number} angle The longitude value, in radians, to convert to the range [<code>-Math.PI</code>, <code>Math.PI</code>).\n * @returns {number} The equivalent longitude value in the range [<code>-Math.PI</code>, <code>Math.PI</code>).\n *\n * @example\n * // Convert 270 degrees to -90 degrees longitude\n * const longitude = Cesium.Math.convertLongitudeRange(Cesium.Math.toRadians(270.0));\n */\nCesiumMath.convertLongitudeRange = function (angle) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(angle)) {\n    throw new DeveloperError(\"angle is required.\");\n  }\n  //>>includeEnd('debug');\n  const twoPi = CesiumMath.TWO_PI;\n\n  const simplified = angle - Math.floor(angle / twoPi) * twoPi;\n\n  if (simplified < -Math.PI) {\n    return simplified + twoPi;\n  }\n  if (simplified >= Math.PI) {\n    return simplified - twoPi;\n  }\n\n  return simplified;\n};\n\n/**\n * Convenience function that clamps a latitude value, in radians, to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).\n * Useful for sanitizing data before use in objects requiring correct range.\n *\n * @param {number} angle The latitude value, in radians, to clamp to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).\n * @returns {number} The latitude value clamped to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).\n *\n * @example\n * // Clamp 108 degrees latitude to 90 degrees latitude\n * const latitude = Cesium.Math.clampToLatitudeRange(Cesium.Math.toRadians(108.0));\n */\nCesiumMath.clampToLatitudeRange = function (angle) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(angle)) {\n    throw new DeveloperError(\"angle is required.\");\n  }\n  //>>includeEnd('debug');\n\n  return CesiumMath.clamp(\n    angle,\n    -1 * CesiumMath.PI_OVER_TWO,\n    CesiumMath.PI_OVER_TWO\n  );\n};\n\n/**\n * Produces an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle.\n *\n * @param {number} angle in radians\n * @returns {number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>].\n */\nCesiumMath.negativePiToPi = function (angle) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(angle)) {\n    throw new DeveloperError(\"angle is required.\");\n  }\n  //>>includeEnd('debug');\n  if (angle >= -CesiumMath.PI && angle <= CesiumMath.PI) {\n    // Early exit if the input is already inside the range. This avoids\n    // unnecessary math which could introduce floating point error.\n    return angle;\n  }\n  return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI;\n};\n\n/**\n * Produces an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle.\n *\n * @param {number} angle in radians\n * @returns {number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>].\n */\nCesiumMath.zeroToTwoPi = function (angle) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(angle)) {\n    throw new DeveloperError(\"angle is required.\");\n  }\n  //>>includeEnd('debug');\n  if (angle >= 0 && angle <= CesiumMath.TWO_PI) {\n    // Early exit if the input is already inside the range. This avoids\n    // unnecessary math which could introduce floating point error.\n    return angle;\n  }\n  const mod = CesiumMath.mod(angle, CesiumMath.TWO_PI);\n  if (\n    Math.abs(mod) < CesiumMath.EPSILON14 &&\n    Math.abs(angle) > CesiumMath.EPSILON14\n  ) {\n    return CesiumMath.TWO_PI;\n  }\n  return mod;\n};\n\n/**\n * The modulo operation that also works for negative dividends.\n *\n * @param {number} m The dividend.\n * @param {number} n The divisor.\n * @returns {number} The remainder.\n */\nCesiumMath.mod = function (m, n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(m)) {\n    throw new DeveloperError(\"m is required.\");\n  }\n  if (!defined(n)) {\n    throw new DeveloperError(\"n is required.\");\n  }\n  if (n === 0.0) {\n    throw new DeveloperError(\"divisor cannot be 0.\");\n  }\n  //>>includeEnd('debug');\n  if (CesiumMath.sign(m) === CesiumMath.sign(n) && Math.abs(m) < Math.abs(n)) {\n    // Early exit if the input does not need to be modded. This avoids\n    // unnecessary math which could introduce floating point error.\n    return m;\n  }\n\n  return ((m % n) + n) % n;\n};\n\n/**\n * Determines if two values are equal using an absolute or relative tolerance test. This is useful\n * to avoid problems due to roundoff error when comparing floating-point values directly. The values are\n * first compared using an absolute tolerance test. If that fails, a relative tolerance test is performed.\n * Use this test if you are unsure of the magnitudes of left and right.\n *\n * @param {number} left The first value to compare.\n * @param {number} right The other value to compare.\n * @param {number} [relativeEpsilon=0] The maximum inclusive delta between <code>left</code> and <code>right</code> for the relative tolerance test.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The maximum inclusive delta between <code>left</code> and <code>right</code> for the absolute tolerance test.\n * @returns {boolean} <code>true</code> if the values are equal within the epsilon; otherwise, <code>false</code>.\n *\n * @example\n * const a = Cesium.Math.equalsEpsilon(0.0, 0.01, Cesium.Math.EPSILON2); // true\n * const b = Cesium.Math.equalsEpsilon(0.0, 0.1, Cesium.Math.EPSILON2);  // false\n * const c = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON7); // true\n * const d = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON9); // false\n */\nCesiumMath.equalsEpsilon = function (\n  left,\n  right,\n  relativeEpsilon,\n  absoluteEpsilon\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(left)) {\n    throw new DeveloperError(\"left is required.\");\n  }\n  if (!defined(right)) {\n    throw new DeveloperError(\"right is required.\");\n  }\n  //>>includeEnd('debug');\n\n  relativeEpsilon = defaultValue(relativeEpsilon, 0.0);\n  absoluteEpsilon = defaultValue(absoluteEpsilon, relativeEpsilon);\n  const absDiff = Math.abs(left - right);\n  return (\n    absDiff <= absoluteEpsilon ||\n    absDiff <= relativeEpsilon * Math.max(Math.abs(left), Math.abs(right))\n  );\n};\n\n/**\n * Determines if the left value is less than the right value. If the two values are within\n * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.\n *\n * @param {number} left The first number to compare.\n * @param {number} right The second number to compare.\n * @param {number} absoluteEpsilon The absolute epsilon to use in comparison.\n * @returns {boolean} <code>true</code> if <code>left</code> is less than <code>right</code> by more than\n *          <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is greater or if the two\n *          values are nearly equal.\n */\nCesiumMath.lessThan = function (left, right, absoluteEpsilon) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(left)) {\n    throw new DeveloperError(\"first is required.\");\n  }\n  if (!defined(right)) {\n    throw new DeveloperError(\"second is required.\");\n  }\n  if (!defined(absoluteEpsilon)) {\n    throw new DeveloperError(\"absoluteEpsilon is required.\");\n  }\n  //>>includeEnd('debug');\n  return left - right < -absoluteEpsilon;\n};\n\n/**\n * Determines if the left value is less than or equal to the right value. If the two values are within\n * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.\n *\n * @param {number} left The first number to compare.\n * @param {number} right The second number to compare.\n * @param {number} absoluteEpsilon The absolute epsilon to use in comparison.\n * @returns {boolean} <code>true</code> if <code>left</code> is less than <code>right</code> or if the\n *          the values are nearly equal.\n */\nCesiumMath.lessThanOrEquals = function (left, right, absoluteEpsilon) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(left)) {\n    throw new DeveloperError(\"first is required.\");\n  }\n  if (!defined(right)) {\n    throw new DeveloperError(\"second is required.\");\n  }\n  if (!defined(absoluteEpsilon)) {\n    throw new DeveloperError(\"absoluteEpsilon is required.\");\n  }\n  //>>includeEnd('debug');\n  return left - right < absoluteEpsilon;\n};\n\n/**\n * Determines if the left value is greater the right value. If the two values are within\n * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.\n *\n * @param {number} left The first number to compare.\n * @param {number} right The second number to compare.\n * @param {number} absoluteEpsilon The absolute epsilon to use in comparison.\n * @returns {boolean} <code>true</code> if <code>left</code> is greater than <code>right</code> by more than\n *          <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is less or if the two\n *          values are nearly equal.\n */\nCesiumMath.greaterThan = function (left, right, absoluteEpsilon) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(left)) {\n    throw new DeveloperError(\"first is required.\");\n  }\n  if (!defined(right)) {\n    throw new DeveloperError(\"second is required.\");\n  }\n  if (!defined(absoluteEpsilon)) {\n    throw new DeveloperError(\"absoluteEpsilon is required.\");\n  }\n  //>>includeEnd('debug');\n  return left - right > absoluteEpsilon;\n};\n\n/**\n * Determines if the left value is greater than or equal to the right value. If the two values are within\n * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.\n *\n * @param {number} left The first number to compare.\n * @param {number} right The second number to compare.\n * @param {number} absoluteEpsilon The absolute epsilon to use in comparison.\n * @returns {boolean} <code>true</code> if <code>left</code> is greater than <code>right</code> or if the\n *          the values are nearly equal.\n */\nCesiumMath.greaterThanOrEquals = function (left, right, absoluteEpsilon) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(left)) {\n    throw new DeveloperError(\"first is required.\");\n  }\n  if (!defined(right)) {\n    throw new DeveloperError(\"second is required.\");\n  }\n  if (!defined(absoluteEpsilon)) {\n    throw new DeveloperError(\"absoluteEpsilon is required.\");\n  }\n  //>>includeEnd('debug');\n  return left - right > -absoluteEpsilon;\n};\n\nconst factorials = [1];\n\n/**\n * Computes the factorial of the provided number.\n *\n * @param {number} n The number whose factorial is to be computed.\n * @returns {number} The factorial of the provided number or undefined if the number is less than 0.\n *\n * @exception {DeveloperError} A number greater than or equal to 0 is required.\n *\n *\n * @example\n * //Compute 7!, which is equal to 5040\n * const computedFactorial = Cesium.Math.factorial(7);\n *\n * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia}\n */\nCesiumMath.factorial = function (n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof n !== \"number\" || n < 0) {\n    throw new DeveloperError(\n      \"A number greater than or equal to 0 is required.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const length = factorials.length;\n  if (n >= length) {\n    let sum = factorials[length - 1];\n    for (let i = length; i <= n; i++) {\n      const next = sum * i;\n      factorials.push(next);\n      sum = next;\n    }\n  }\n  return factorials[n];\n};\n\n/**\n * Increments a number with a wrapping to a minimum value if the number exceeds the maximum value.\n *\n * @param {number} [n] The number to be incremented.\n * @param {number} [maximumValue] The maximum incremented value before rolling over to the minimum value.\n * @param {number} [minimumValue=0.0] The number reset to after the maximum value has been exceeded.\n * @returns {number} The incremented number.\n *\n * @exception {DeveloperError} Maximum value must be greater than minimum value.\n *\n * @example\n * const n = Cesium.Math.incrementWrap(5, 10, 0); // returns 6\n * const m = Cesium.Math.incrementWrap(10, 10, 0); // returns 0\n */\nCesiumMath.incrementWrap = function (n, maximumValue, minimumValue) {\n  minimumValue = defaultValue(minimumValue, 0.0);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(n)) {\n    throw new DeveloperError(\"n is required.\");\n  }\n  if (maximumValue <= minimumValue) {\n    throw new DeveloperError(\"maximumValue must be greater than minimumValue.\");\n  }\n  //>>includeEnd('debug');\n\n  ++n;\n  if (n > maximumValue) {\n    n = minimumValue;\n  }\n  return n;\n};\n\n/**\n * Determines if a non-negative integer is a power of two.\n * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.\n *\n * @param {number} n The integer to test in the range [0, (2^32)-1].\n * @returns {boolean} <code>true</code> if the number if a power of two; otherwise, <code>false</code>.\n *\n * @exception {DeveloperError} A number between 0 and (2^32)-1 is required.\n *\n * @example\n * const t = Cesium.Math.isPowerOfTwo(16); // true\n * const f = Cesium.Math.isPowerOfTwo(20); // false\n */\nCesiumMath.isPowerOfTwo = function (n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof n !== \"number\" || n < 0 || n > 4294967295) {\n    throw new DeveloperError(\"A number between 0 and (2^32)-1 is required.\");\n  }\n  //>>includeEnd('debug');\n\n  return n !== 0 && (n & (n - 1)) === 0;\n};\n\n/**\n * Computes the next power-of-two integer greater than or equal to the provided non-negative integer.\n * The maximum allowed input is 2^31 due to 32-bit bitwise operator limitation in Javascript.\n *\n * @param {number} n The integer to test in the range [0, 2^31].\n * @returns {number} The next power-of-two integer.\n *\n * @exception {DeveloperError} A number between 0 and 2^31 is required.\n *\n * @example\n * const n = Cesium.Math.nextPowerOfTwo(29); // 32\n * const m = Cesium.Math.nextPowerOfTwo(32); // 32\n */\nCesiumMath.nextPowerOfTwo = function (n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof n !== \"number\" || n < 0 || n > 2147483648) {\n    throw new DeveloperError(\"A number between 0 and 2^31 is required.\");\n  }\n  //>>includeEnd('debug');\n\n  // From http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2\n  --n;\n  n |= n >> 1;\n  n |= n >> 2;\n  n |= n >> 4;\n  n |= n >> 8;\n  n |= n >> 16;\n  ++n;\n\n  return n;\n};\n\n/**\n * Computes the previous power-of-two integer less than or equal to the provided non-negative integer.\n * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.\n *\n * @param {number} n The integer to test in the range [0, (2^32)-1].\n * @returns {number} The previous power-of-two integer.\n *\n * @exception {DeveloperError} A number between 0 and (2^32)-1 is required.\n *\n * @example\n * const n = Cesium.Math.previousPowerOfTwo(29); // 16\n * const m = Cesium.Math.previousPowerOfTwo(32); // 32\n */\nCesiumMath.previousPowerOfTwo = function (n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof n !== \"number\" || n < 0 || n > 4294967295) {\n    throw new DeveloperError(\"A number between 0 and (2^32)-1 is required.\");\n  }\n  //>>includeEnd('debug');\n\n  n |= n >> 1;\n  n |= n >> 2;\n  n |= n >> 4;\n  n |= n >> 8;\n  n |= n >> 16;\n  n |= n >> 32;\n\n  // The previous bitwise operations implicitly convert to signed 32-bit. Use `>>>` to convert to unsigned\n  n = (n >>> 0) - (n >>> 1);\n\n  return n;\n};\n\n/**\n * Constraint a value to lie between two values.\n *\n * @param {number} value The value to clamp.\n * @param {number} min The minimum value.\n * @param {number} max The maximum value.\n * @returns {number} The clamped value such that min <= result <= max.\n */\nCesiumMath.clamp = function (value, min, max) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"value\", value);\n  Check.typeOf.number(\"min\", min);\n  Check.typeOf.number(\"max\", max);\n  //>>includeEnd('debug');\n\n  return value < min ? min : value > max ? max : value;\n};\n\nlet randomNumberGenerator = new MersenneTwister();\n\n/**\n * Sets the seed used by the random number generator\n * in {@link CesiumMath#nextRandomNumber}.\n *\n * @param {number} seed An integer used as the seed.\n */\nCesiumMath.setRandomNumberSeed = function (seed) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(seed)) {\n    throw new DeveloperError(\"seed is required.\");\n  }\n  //>>includeEnd('debug');\n\n  randomNumberGenerator = new MersenneTwister(seed);\n};\n\n/**\n * Generates a random floating point number in the range of [0.0, 1.0)\n * using a Mersenne twister.\n *\n * @returns {number} A random number in the range of [0.0, 1.0).\n *\n * @see CesiumMath.setRandomNumberSeed\n * @see {@link http://en.wikipedia.org/wiki/Mersenne_twister|Mersenne twister on Wikipedia}\n */\nCesiumMath.nextRandomNumber = function () {\n  return randomNumberGenerator.random();\n};\n\n/**\n * Generates a random number between two numbers.\n *\n * @param {number} min The minimum value.\n * @param {number} max The maximum value.\n * @returns {number} A random number between the min and max.\n */\nCesiumMath.randomBetween = function (min, max) {\n  return CesiumMath.nextRandomNumber() * (max - min) + min;\n};\n\n/**\n * Computes <code>Math.acos(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]\n * so that the function will never return NaN.\n *\n * @param {number} value The value for which to compute acos.\n * @returns {number} The acos of the value if the value is in the range [-1.0, 1.0], or the acos of -1.0 or 1.0,\n *          whichever is closer, if the value is outside the range.\n */\nCesiumMath.acosClamped = function (value) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required.\");\n  }\n  //>>includeEnd('debug');\n  return Math.acos(CesiumMath.clamp(value, -1.0, 1.0));\n};\n\n/**\n * Computes <code>Math.asin(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]\n * so that the function will never return NaN.\n *\n * @param {number} value The value for which to compute asin.\n * @returns {number} The asin of the value if the value is in the range [-1.0, 1.0], or the asin of -1.0 or 1.0,\n *          whichever is closer, if the value is outside the range.\n */\nCesiumMath.asinClamped = function (value) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required.\");\n  }\n  //>>includeEnd('debug');\n  return Math.asin(CesiumMath.clamp(value, -1.0, 1.0));\n};\n\n/**\n * Finds the chord length between two points given the circle's radius and the angle between the points.\n *\n * @param {number} angle The angle between the two points.\n * @param {number} radius The radius of the circle.\n * @returns {number} The chord length.\n */\nCesiumMath.chordLength = function (angle, radius) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(angle)) {\n    throw new DeveloperError(\"angle is required.\");\n  }\n  if (!defined(radius)) {\n    throw new DeveloperError(\"radius is required.\");\n  }\n  //>>includeEnd('debug');\n  return 2.0 * radius * Math.sin(angle * 0.5);\n};\n\n/**\n * Finds the logarithm of a number to a base.\n *\n * @param {number} number The number.\n * @param {number} base The base.\n * @returns {number} The result.\n */\nCesiumMath.logBase = function (number, base) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(number)) {\n    throw new DeveloperError(\"number is required.\");\n  }\n  if (!defined(base)) {\n    throw new DeveloperError(\"base is required.\");\n  }\n  //>>includeEnd('debug');\n  return Math.log(number) / Math.log(base);\n};\n\n/**\n * Finds the cube root of a number.\n * Returns NaN if <code>number</code> is not provided.\n *\n * @function\n * @param {number} [number] The number.\n * @returns {number} The result.\n */\n// eslint-disable-next-line es/no-math-cbrt\nCesiumMath.cbrt = defaultValue(Math.cbrt, function cbrt(number) {\n  const result = Math.pow(Math.abs(number), 1.0 / 3.0);\n  return number < 0.0 ? -result : result;\n});\n\n/**\n * Finds the base 2 logarithm of a number.\n *\n * @function\n * @param {number} number The number.\n * @returns {number} The result.\n */\n// eslint-disable-next-line es/no-math-log2\nCesiumMath.log2 = defaultValue(Math.log2, function log2(number) {\n  return Math.log(number) * Math.LOG2E;\n});\n\n/**\n * @private\n */\nCesiumMath.fog = function (distanceToCamera, density) {\n  const scalar = distanceToCamera * density;\n  return 1.0 - Math.exp(-(scalar * scalar));\n};\n\n/**\n * Computes a fast approximation of Atan for input in the range [-1, 1].\n *\n * Based on Michal Drobot's approximation from ShaderFastLibs,\n * which in turn is based on \"Efficient approximations for the arctangent function,\"\n * Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.\n * Adapted from ShaderFastLibs under MIT License.\n *\n * @param {number} x An input number in the range [-1, 1]\n * @returns {number} An approximation of atan(x)\n */\nCesiumMath.fastApproximateAtan = function (x) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"x\", x);\n  //>>includeEnd('debug');\n\n  return x * (-0.1784 * Math.abs(x) - 0.0663 * x * x + 1.0301);\n};\n\n/**\n * Computes a fast approximation of Atan2(x, y) for arbitrary input scalars.\n *\n * Range reduction math based on nvidia's cg reference implementation: http://developer.download.nvidia.com/cg/atan2.html\n *\n * @param {number} x An input number that isn't zero if y is zero.\n * @param {number} y An input number that isn't zero if x is zero.\n * @returns {number} An approximation of atan2(x, y)\n */\nCesiumMath.fastApproximateAtan2 = function (x, y) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"x\", x);\n  Check.typeOf.number(\"y\", y);\n  //>>includeEnd('debug');\n\n  // atan approximations are usually only reliable over [-1, 1]\n  // So reduce the range by flipping whether x or y is on top based on which is bigger.\n  let opposite;\n  let t = Math.abs(x); // t used as swap and atan result.\n  opposite = Math.abs(y);\n  const adjacent = Math.max(t, opposite);\n  opposite = Math.min(t, opposite);\n\n  const oppositeOverAdjacent = opposite / adjacent;\n  //>>includeStart('debug', pragmas.debug);\n  if (isNaN(oppositeOverAdjacent)) {\n    throw new DeveloperError(\"either x or y must be nonzero\");\n  }\n  //>>includeEnd('debug');\n  t = CesiumMath.fastApproximateAtan(oppositeOverAdjacent);\n\n  // Undo range reduction\n  t = Math.abs(y) > Math.abs(x) ? CesiumMath.PI_OVER_TWO - t : t;\n  t = x < 0.0 ? CesiumMath.PI - t : t;\n  t = y < 0.0 ? -t : t;\n  return t;\n};\nexport default CesiumMath;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A 3D Cartesian point.\n * @alias Cartesian3\n * @constructor\n *\n * @param {number} [x=0.0] The X component.\n * @param {number} [y=0.0] The Y component.\n * @param {number} [z=0.0] The Z component.\n *\n * @see Cartesian2\n * @see Cartesian4\n * @see Packable\n */\nfunction Cartesian3(x, y, z) {\n  /**\n   * The X component.\n   * @type {number}\n   * @default 0.0\n   */\n  this.x = defaultValue(x, 0.0);\n\n  /**\n   * The Y component.\n   * @type {number}\n   * @default 0.0\n   */\n  this.y = defaultValue(y, 0.0);\n\n  /**\n   * The Z component.\n   * @type {number}\n   * @default 0.0\n   */\n  this.z = defaultValue(z, 0.0);\n}\n\n/**\n * Converts the provided Spherical into Cartesian3 coordinates.\n *\n * @param {Spherical} spherical The Spherical to be converted to Cartesian3.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\n */\nCartesian3.fromSpherical = function (spherical, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"spherical\", spherical);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  const clock = spherical.clock;\n  const cone = spherical.cone;\n  const magnitude = defaultValue(spherical.magnitude, 1.0);\n  const radial = magnitude * Math.sin(cone);\n  result.x = radial * Math.cos(clock);\n  result.y = radial * Math.sin(clock);\n  result.z = magnitude * Math.cos(cone);\n  return result;\n};\n\n/**\n * Creates a Cartesian3 instance from x, y and z coordinates.\n *\n * @param {number} x The x coordinate.\n * @param {number} y The y coordinate.\n * @param {number} z The z coordinate.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\n */\nCartesian3.fromElements = function (x, y, z, result) {\n  if (!defined(result)) {\n    return new Cartesian3(x, y, z);\n  }\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  return result;\n};\n\n/**\n * Duplicates a Cartesian3 instance.\n *\n * @param {Cartesian3} cartesian The Cartesian to duplicate.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. (Returns undefined if cartesian is undefined)\n */\nCartesian3.clone = function (cartesian, result) {\n  if (!defined(cartesian)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    return new Cartesian3(cartesian.x, cartesian.y, cartesian.z);\n  }\n\n  result.x = cartesian.x;\n  result.y = cartesian.y;\n  result.z = cartesian.z;\n  return result;\n};\n\n/**\n * Creates a Cartesian3 instance from an existing Cartesian4.  This simply takes the\n * x, y, and z properties of the Cartesian4 and drops w.\n * @function\n *\n * @param {Cartesian4} cartesian The Cartesian4 instance to create a Cartesian3 instance from.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\n */\nCartesian3.fromCartesian4 = Cartesian3.clone;\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nCartesian3.packedLength = 3;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Cartesian3} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nCartesian3.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  array[startingIndex++] = value.x;\n  array[startingIndex++] = value.y;\n  array[startingIndex] = value.z;\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Cartesian3} [result] The object into which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\n */\nCartesian3.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n  result.x = array[startingIndex++];\n  result.y = array[startingIndex++];\n  result.z = array[startingIndex];\n  return result;\n};\n\n/**\n * Flattens an array of Cartesian3s into an array of components.\n *\n * @param {Cartesian3[]} array The array of cartesians to pack.\n * @param {number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 3 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 3) elements.\n * @returns {number[]} The packed array.\n */\nCartesian3.packArray = function (array, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  const length = array.length;\n  const resultLength = length * 3;\n  if (!defined(result)) {\n    result = new Array(resultLength);\n  } else if (!Array.isArray(result) && result.length !== resultLength) {\n    //>>includeStart('debug', pragmas.debug);\n    throw new DeveloperError(\n      \"If result is a typed array, it must have exactly array.length * 3 elements\"\n    );\n    //>>includeEnd('debug');\n  } else if (result.length !== resultLength) {\n    result.length = resultLength;\n  }\n\n  for (let i = 0; i < length; ++i) {\n    Cartesian3.pack(array[i], result, i * 3);\n  }\n  return result;\n};\n\n/**\n * Unpacks an array of cartesian components into an array of Cartesian3s.\n *\n * @param {number[]} array The array of components to unpack.\n * @param {Cartesian3[]} [result] The array onto which to store the result.\n * @returns {Cartesian3[]} The unpacked array.\n */\nCartesian3.unpackArray = function (array, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  Check.typeOf.number.greaterThanOrEquals(\"array.length\", array.length, 3);\n  if (array.length % 3 !== 0) {\n    throw new DeveloperError(\"array length must be a multiple of 3.\");\n  }\n  //>>includeEnd('debug');\n\n  const length = array.length;\n  if (!defined(result)) {\n    result = new Array(length / 3);\n  } else {\n    result.length = length / 3;\n  }\n\n  for (let i = 0; i < length; i += 3) {\n    const index = i / 3;\n    result[index] = Cartesian3.unpack(array, i, result[index]);\n  }\n  return result;\n};\n\n/**\n * Creates a Cartesian3 from three consecutive elements in an array.\n * @function\n *\n * @param {number[]} array The array whose three consecutive elements correspond to the x, y, and z components, respectively.\n * @param {number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\n *\n * @example\n * // Create a Cartesian3 with (1.0, 2.0, 3.0)\n * const v = [1.0, 2.0, 3.0];\n * const p = Cesium.Cartesian3.fromArray(v);\n *\n * // Create a Cartesian3 with (1.0, 2.0, 3.0) using an offset into an array\n * const v2 = [0.0, 0.0, 1.0, 2.0, 3.0];\n * const p2 = Cesium.Cartesian3.fromArray(v2, 2);\n */\nCartesian3.fromArray = Cartesian3.unpack;\n\n/**\n * Computes the value of the maximum component for the supplied Cartesian.\n *\n * @param {Cartesian3} cartesian The cartesian to use.\n * @returns {number} The value of the maximum component.\n */\nCartesian3.maximumComponent = function (cartesian) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  return Math.max(cartesian.x, cartesian.y, cartesian.z);\n};\n\n/**\n * Computes the value of the minimum component for the supplied Cartesian.\n *\n * @param {Cartesian3} cartesian The cartesian to use.\n * @returns {number} The value of the minimum component.\n */\nCartesian3.minimumComponent = function (cartesian) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  return Math.min(cartesian.x, cartesian.y, cartesian.z);\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.\n *\n * @param {Cartesian3} first A cartesian to compare.\n * @param {Cartesian3} second A cartesian to compare.\n * @param {Cartesian3} result The object into which to store the result.\n * @returns {Cartesian3} A cartesian with the minimum components.\n */\nCartesian3.minimumByComponent = function (first, second, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"first\", first);\n  Check.typeOf.object(\"second\", second);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = Math.min(first.x, second.x);\n  result.y = Math.min(first.y, second.y);\n  result.z = Math.min(first.z, second.z);\n\n  return result;\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.\n *\n * @param {Cartesian3} first A cartesian to compare.\n * @param {Cartesian3} second A cartesian to compare.\n * @param {Cartesian3} result The object into which to store the result.\n * @returns {Cartesian3} A cartesian with the maximum components.\n */\nCartesian3.maximumByComponent = function (first, second, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"first\", first);\n  Check.typeOf.object(\"second\", second);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = Math.max(first.x, second.x);\n  result.y = Math.max(first.y, second.y);\n  result.z = Math.max(first.z, second.z);\n  return result;\n};\n\n/**\n * Constrain a value to lie between two values.\n *\n * @param {Cartesian3} cartesian The value to clamp.\n * @param {Cartesian3} min The minimum bound.\n * @param {Cartesian3} max The maximum bound.\n * @param {Cartesian3} result The object into which to store the result.\n * @returns {Cartesian3} The clamped value such that min <= value <= max.\n */\nCartesian3.clamp = function (value, min, max, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.typeOf.object(\"min\", min);\n  Check.typeOf.object(\"max\", max);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const x = CesiumMath.clamp(value.x, min.x, max.x);\n  const y = CesiumMath.clamp(value.y, min.y, max.y);\n  const z = CesiumMath.clamp(value.z, min.z, max.z);\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n\n  return result;\n};\n\n/**\n * Computes the provided Cartesian's squared magnitude.\n *\n * @param {Cartesian3} cartesian The Cartesian instance whose squared magnitude is to be computed.\n * @returns {number} The squared magnitude.\n */\nCartesian3.magnitudeSquared = function (cartesian) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  return (\n    cartesian.x * cartesian.x +\n    cartesian.y * cartesian.y +\n    cartesian.z * cartesian.z\n  );\n};\n\n/**\n * Computes the Cartesian's magnitude (length).\n *\n * @param {Cartesian3} cartesian The Cartesian instance whose magnitude is to be computed.\n * @returns {number} The magnitude.\n */\nCartesian3.magnitude = function (cartesian) {\n  return Math.sqrt(Cartesian3.magnitudeSquared(cartesian));\n};\n\nconst distanceScratch = new Cartesian3();\n\n/**\n * Computes the distance between two points.\n *\n * @param {Cartesian3} left The first point to compute the distance from.\n * @param {Cartesian3} right The second point to compute the distance to.\n * @returns {number} The distance between two points.\n *\n * @example\n * // Returns 1.0\n * const d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0));\n */\nCartesian3.distance = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  Cartesian3.subtract(left, right, distanceScratch);\n  return Cartesian3.magnitude(distanceScratch);\n};\n\n/**\n * Computes the squared distance between two points.  Comparing squared distances\n * using this function is more efficient than comparing distances using {@link Cartesian3#distance}.\n *\n * @param {Cartesian3} left The first point to compute the distance from.\n * @param {Cartesian3} right The second point to compute the distance to.\n * @returns {number} The distance between two points.\n *\n * @example\n * // Returns 4.0, not 2.0\n * const d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0));\n */\nCartesian3.distanceSquared = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  Cartesian3.subtract(left, right, distanceScratch);\n  return Cartesian3.magnitudeSquared(distanceScratch);\n};\n\n/**\n * Computes the normalized form of the supplied Cartesian.\n *\n * @param {Cartesian3} cartesian The Cartesian to be normalized.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.normalize = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const magnitude = Cartesian3.magnitude(cartesian);\n\n  result.x = cartesian.x / magnitude;\n  result.y = cartesian.y / magnitude;\n  result.z = cartesian.z / magnitude;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (isNaN(result.x) || isNaN(result.y) || isNaN(result.z)) {\n    throw new DeveloperError(\"normalized result is not a number\");\n  }\n  //>>includeEnd('debug');\n\n  return result;\n};\n\n/**\n * Computes the dot (scalar) product of two Cartesians.\n *\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @returns {number} The dot product.\n */\nCartesian3.dot = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  return left.x * right.x + left.y * right.y + left.z * right.z;\n};\n\n/**\n * Computes the componentwise product of two Cartesians.\n *\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.multiplyComponents = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = left.x * right.x;\n  result.y = left.y * right.y;\n  result.z = left.z * right.z;\n  return result;\n};\n\n/**\n * Computes the componentwise quotient of two Cartesians.\n *\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.divideComponents = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = left.x / right.x;\n  result.y = left.y / right.y;\n  result.z = left.z / right.z;\n  return result;\n};\n\n/**\n * Computes the componentwise sum of two Cartesians.\n *\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.add = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = left.x + right.x;\n  result.y = left.y + right.y;\n  result.z = left.z + right.z;\n  return result;\n};\n\n/**\n * Computes the componentwise difference of two Cartesians.\n *\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.subtract = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = left.x - right.x;\n  result.y = left.y - right.y;\n  result.z = left.z - right.z;\n  return result;\n};\n\n/**\n * Multiplies the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian3} cartesian The Cartesian to be scaled.\n * @param {number} scalar The scalar to multiply with.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.multiplyByScalar = function (cartesian, scalar, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.number(\"scalar\", scalar);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = cartesian.x * scalar;\n  result.y = cartesian.y * scalar;\n  result.z = cartesian.z * scalar;\n  return result;\n};\n\n/**\n * Divides the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian3} cartesian The Cartesian to be divided.\n * @param {number} scalar The scalar to divide by.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.divideByScalar = function (cartesian, scalar, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.number(\"scalar\", scalar);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = cartesian.x / scalar;\n  result.y = cartesian.y / scalar;\n  result.z = cartesian.z / scalar;\n  return result;\n};\n\n/**\n * Negates the provided Cartesian.\n *\n * @param {Cartesian3} cartesian The Cartesian to be negated.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.negate = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = -cartesian.x;\n  result.y = -cartesian.y;\n  result.z = -cartesian.z;\n  return result;\n};\n\n/**\n * Computes the absolute value of the provided Cartesian.\n *\n * @param {Cartesian3} cartesian The Cartesian whose absolute value is to be computed.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.abs = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = Math.abs(cartesian.x);\n  result.y = Math.abs(cartesian.y);\n  result.z = Math.abs(cartesian.z);\n  return result;\n};\n\nconst lerpScratch = new Cartesian3();\n/**\n * Computes the linear interpolation or extrapolation at t using the provided cartesians.\n *\n * @param {Cartesian3} start The value corresponding to t at 0.0.\n * @param {Cartesian3} end The value corresponding to t at 1.0.\n * @param {number} t The point along t at which to interpolate.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.lerp = function (start, end, t, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"start\", start);\n  Check.typeOf.object(\"end\", end);\n  Check.typeOf.number(\"t\", t);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  Cartesian3.multiplyByScalar(end, t, lerpScratch);\n  result = Cartesian3.multiplyByScalar(start, 1.0 - t, result);\n  return Cartesian3.add(lerpScratch, result, result);\n};\n\nconst angleBetweenScratch = new Cartesian3();\nconst angleBetweenScratch2 = new Cartesian3();\n/**\n * Returns the angle, in radians, between the provided Cartesians.\n *\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @returns {number} The angle between the Cartesians.\n */\nCartesian3.angleBetween = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  Cartesian3.normalize(left, angleBetweenScratch);\n  Cartesian3.normalize(right, angleBetweenScratch2);\n  const cosine = Cartesian3.dot(angleBetweenScratch, angleBetweenScratch2);\n  const sine = Cartesian3.magnitude(\n    Cartesian3.cross(\n      angleBetweenScratch,\n      angleBetweenScratch2,\n      angleBetweenScratch\n    )\n  );\n  return Math.atan2(sine, cosine);\n};\n\nconst mostOrthogonalAxisScratch = new Cartesian3();\n/**\n * Returns the axis that is most orthogonal to the provided Cartesian.\n *\n * @param {Cartesian3} cartesian The Cartesian on which to find the most orthogonal axis.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The most orthogonal axis.\n */\nCartesian3.mostOrthogonalAxis = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch);\n  Cartesian3.abs(f, f);\n\n  if (f.x <= f.y) {\n    if (f.x <= f.z) {\n      result = Cartesian3.clone(Cartesian3.UNIT_X, result);\n    } else {\n      result = Cartesian3.clone(Cartesian3.UNIT_Z, result);\n    }\n  } else if (f.y <= f.z) {\n    result = Cartesian3.clone(Cartesian3.UNIT_Y, result);\n  } else {\n    result = Cartesian3.clone(Cartesian3.UNIT_Z, result);\n  }\n\n  return result;\n};\n\n/**\n * Projects vector a onto vector b\n * @param {Cartesian3} a The vector that needs projecting\n * @param {Cartesian3} b The vector to project onto\n * @param {Cartesian3} result The result cartesian\n * @returns {Cartesian3} The modified result parameter\n */\nCartesian3.projectVector = function (a, b, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"a\", a);\n  Check.defined(\"b\", b);\n  Check.defined(\"result\", result);\n  //>>includeEnd('debug');\n\n  const scalar = Cartesian3.dot(a, b) / Cartesian3.dot(b, b);\n  return Cartesian3.multiplyByScalar(b, scalar, result);\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartesian3} [left] The first Cartesian.\n * @param {Cartesian3} [right] The second Cartesian.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCartesian3.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left.x === right.x &&\n      left.y === right.y &&\n      left.z === right.z)\n  );\n};\n\n/**\n * @private\n */\nCartesian3.equalsArray = function (cartesian, array, offset) {\n  return (\n    cartesian.x === array[offset] &&\n    cartesian.y === array[offset + 1] &&\n    cartesian.z === array[offset + 2]\n  );\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {Cartesian3} [left] The first Cartesian.\n * @param {Cartesian3} [right] The second Cartesian.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nCartesian3.equalsEpsilon = function (\n  left,\n  right,\n  relativeEpsilon,\n  absoluteEpsilon\n) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      CesiumMath.equalsEpsilon(\n        left.x,\n        right.x,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        left.y,\n        right.y,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        left.z,\n        right.z,\n        relativeEpsilon,\n        absoluteEpsilon\n      ))\n  );\n};\n\n/**\n * Computes the cross (outer) product of two Cartesians.\n *\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The cross product.\n */\nCartesian3.cross = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const leftX = left.x;\n  const leftY = left.y;\n  const leftZ = left.z;\n  const rightX = right.x;\n  const rightY = right.y;\n  const rightZ = right.z;\n\n  const x = leftY * rightZ - leftZ * rightY;\n  const y = leftZ * rightX - leftX * rightZ;\n  const z = leftX * rightY - leftY * rightX;\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  return result;\n};\n\n/**\n * Computes the midpoint between the right and left Cartesian.\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The midpoint.\n */\nCartesian3.midpoint = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = (left.x + right.x) * 0.5;\n  result.y = (left.y + right.y) * 0.5;\n  result.z = (left.z + right.z) * 0.5;\n\n  return result;\n};\n\n/**\n * Returns a Cartesian3 position from longitude and latitude values given in degrees.\n *\n * @param {number} longitude The longitude, in degrees\n * @param {number} latitude The latitude, in degrees\n * @param {number} [height=0.0] The height, in meters, above the ellipsoid.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The position\n *\n * @example\n * const position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0);\n */\nCartesian3.fromDegrees = function (\n  longitude,\n  latitude,\n  height,\n  ellipsoid,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"longitude\", longitude);\n  Check.typeOf.number(\"latitude\", latitude);\n  //>>includeEnd('debug');\n\n  longitude = CesiumMath.toRadians(longitude);\n  latitude = CesiumMath.toRadians(latitude);\n  return Cartesian3.fromRadians(longitude, latitude, height, ellipsoid, result);\n};\n\nlet scratchN = new Cartesian3();\nlet scratchK = new Cartesian3();\nconst wgs84RadiiSquared = new Cartesian3(\n  6378137.0 * 6378137.0,\n  6378137.0 * 6378137.0,\n  6356752.3142451793 * 6356752.3142451793\n);\n\n/**\n * Returns a Cartesian3 position from longitude and latitude values given in radians.\n *\n * @param {number} longitude The longitude, in radians\n * @param {number} latitude The latitude, in radians\n * @param {number} [height=0.0] The height, in meters, above the ellipsoid.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The position\n *\n * @example\n * const position = Cesium.Cartesian3.fromRadians(-2.007, 0.645);\n */\nCartesian3.fromRadians = function (\n  longitude,\n  latitude,\n  height,\n  ellipsoid,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"longitude\", longitude);\n  Check.typeOf.number(\"latitude\", latitude);\n  //>>includeEnd('debug');\n\n  height = defaultValue(height, 0.0);\n  const radiiSquared = defined(ellipsoid)\n    ? ellipsoid.radiiSquared\n    : wgs84RadiiSquared;\n\n  const cosLatitude = Math.cos(latitude);\n  scratchN.x = cosLatitude * Math.cos(longitude);\n  scratchN.y = cosLatitude * Math.sin(longitude);\n  scratchN.z = Math.sin(latitude);\n  scratchN = Cartesian3.normalize(scratchN, scratchN);\n\n  Cartesian3.multiplyComponents(radiiSquared, scratchN, scratchK);\n  const gamma = Math.sqrt(Cartesian3.dot(scratchN, scratchK));\n  scratchK = Cartesian3.divideByScalar(scratchK, gamma, scratchK);\n  scratchN = Cartesian3.multiplyByScalar(scratchN, height, scratchN);\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n  return Cartesian3.add(scratchK, scratchN, result);\n};\n\n/**\n * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in degrees.\n *\n * @param {number[]} coordinates A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the coordinates lie.\n * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.\n * @returns {Cartesian3[]} The array of positions.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]);\n */\nCartesian3.fromDegreesArray = function (coordinates, ellipsoid, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"coordinates\", coordinates);\n  if (coordinates.length < 2 || coordinates.length % 2 !== 0) {\n    throw new DeveloperError(\n      \"the number of coordinates must be a multiple of 2 and at least 2\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const length = coordinates.length;\n  if (!defined(result)) {\n    result = new Array(length / 2);\n  } else {\n    result.length = length / 2;\n  }\n\n  for (let i = 0; i < length; i += 2) {\n    const longitude = coordinates[i];\n    const latitude = coordinates[i + 1];\n    const index = i / 2;\n    result[index] = Cartesian3.fromDegrees(\n      longitude,\n      latitude,\n      0,\n      ellipsoid,\n      result[index]\n    );\n  }\n\n  return result;\n};\n\n/**\n * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in radians.\n *\n * @param {number[]} coordinates A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the coordinates lie.\n * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.\n * @returns {Cartesian3[]} The array of positions.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]);\n */\nCartesian3.fromRadiansArray = function (coordinates, ellipsoid, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"coordinates\", coordinates);\n  if (coordinates.length < 2 || coordinates.length % 2 !== 0) {\n    throw new DeveloperError(\n      \"the number of coordinates must be a multiple of 2 and at least 2\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const length = coordinates.length;\n  if (!defined(result)) {\n    result = new Array(length / 2);\n  } else {\n    result.length = length / 2;\n  }\n\n  for (let i = 0; i < length; i += 2) {\n    const longitude = coordinates[i];\n    const latitude = coordinates[i + 1];\n    const index = i / 2;\n    result[index] = Cartesian3.fromRadians(\n      longitude,\n      latitude,\n      0,\n      ellipsoid,\n      result[index]\n    );\n  }\n\n  return result;\n};\n\n/**\n * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in degrees.\n *\n * @param {number[]} coordinates A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\n * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.\n * @returns {Cartesian3[]} The array of positions.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]);\n */\nCartesian3.fromDegreesArrayHeights = function (coordinates, ellipsoid, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"coordinates\", coordinates);\n  if (coordinates.length < 3 || coordinates.length % 3 !== 0) {\n    throw new DeveloperError(\n      \"the number of coordinates must be a multiple of 3 and at least 3\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const length = coordinates.length;\n  if (!defined(result)) {\n    result = new Array(length / 3);\n  } else {\n    result.length = length / 3;\n  }\n\n  for (let i = 0; i < length; i += 3) {\n    const longitude = coordinates[i];\n    const latitude = coordinates[i + 1];\n    const height = coordinates[i + 2];\n    const index = i / 3;\n    result[index] = Cartesian3.fromDegrees(\n      longitude,\n      latitude,\n      height,\n      ellipsoid,\n      result[index]\n    );\n  }\n\n  return result;\n};\n\n/**\n * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in radians.\n *\n * @param {number[]} coordinates A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\n * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.\n * @returns {Cartesian3[]} The array of positions.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]);\n */\nCartesian3.fromRadiansArrayHeights = function (coordinates, ellipsoid, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"coordinates\", coordinates);\n  if (coordinates.length < 3 || coordinates.length % 3 !== 0) {\n    throw new DeveloperError(\n      \"the number of coordinates must be a multiple of 3 and at least 3\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const length = coordinates.length;\n  if (!defined(result)) {\n    result = new Array(length / 3);\n  } else {\n    result.length = length / 3;\n  }\n\n  for (let i = 0; i < length; i += 3) {\n    const longitude = coordinates[i];\n    const latitude = coordinates[i + 1];\n    const height = coordinates[i + 2];\n    const index = i / 3;\n    result[index] = Cartesian3.fromRadians(\n      longitude,\n      latitude,\n      height,\n      ellipsoid,\n      result[index]\n    );\n  }\n\n  return result;\n};\n\n/**\n * An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0).\n *\n * @type {Cartesian3}\n * @constant\n */\nCartesian3.ZERO = Object.freeze(new Cartesian3(0.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian3 instance initialized to (1.0, 1.0, 1.0).\n *\n * @type {Cartesian3}\n * @constant\n */\nCartesian3.ONE = Object.freeze(new Cartesian3(1.0, 1.0, 1.0));\n\n/**\n * An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).\n *\n * @type {Cartesian3}\n * @constant\n */\nCartesian3.UNIT_X = Object.freeze(new Cartesian3(1.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).\n *\n * @type {Cartesian3}\n * @constant\n */\nCartesian3.UNIT_Y = Object.freeze(new Cartesian3(0.0, 1.0, 0.0));\n\n/**\n * An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).\n *\n * @type {Cartesian3}\n * @constant\n */\nCartesian3.UNIT_Z = Object.freeze(new Cartesian3(0.0, 0.0, 1.0));\n\n/**\n * Duplicates this Cartesian3 instance.\n *\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\n */\nCartesian3.prototype.clone = function (result) {\n  return Cartesian3.clone(this, result);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartesian3} [right] The right hand side Cartesian.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nCartesian3.prototype.equals = function (right) {\n  return Cartesian3.equals(this, right);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {Cartesian3} [right] The right hand side Cartesian.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nCartesian3.prototype.equalsEpsilon = function (\n  right,\n  relativeEpsilon,\n  absoluteEpsilon\n) {\n  return Cartesian3.equalsEpsilon(\n    this,\n    right,\n    relativeEpsilon,\n    absoluteEpsilon\n  );\n};\n\n/**\n * Creates a string representing this Cartesian in the format '(x, y, z)'.\n *\n * @returns {string} A string representing this Cartesian in the format '(x, y, z)'.\n */\nCartesian3.prototype.toString = function () {\n  return `(${this.x}, ${this.y}, ${this.z})`;\n};\nexport default Cartesian3;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A 4D Cartesian point.\n * @alias Cartesian4\n * @constructor\n *\n * @param {number} [x=0.0] The X component.\n * @param {number} [y=0.0] The Y component.\n * @param {number} [z=0.0] The Z component.\n * @param {number} [w=0.0] The W component.\n *\n * @see Cartesian2\n * @see Cartesian3\n * @see Packable\n */\nfunction Cartesian4(x, y, z, w) {\n  /**\n   * The X component.\n   * @type {number}\n   * @default 0.0\n   */\n  this.x = defaultValue(x, 0.0);\n\n  /**\n   * The Y component.\n   * @type {number}\n   * @default 0.0\n   */\n  this.y = defaultValue(y, 0.0);\n\n  /**\n   * The Z component.\n   * @type {number}\n   * @default 0.0\n   */\n  this.z = defaultValue(z, 0.0);\n\n  /**\n   * The W component.\n   * @type {number}\n   * @default 0.0\n   */\n  this.w = defaultValue(w, 0.0);\n}\n\n/**\n * Creates a Cartesian4 instance from x, y, z and w coordinates.\n *\n * @param {number} x The x coordinate.\n * @param {number} y The y coordinate.\n * @param {number} z The z coordinate.\n * @param {number} w The w coordinate.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.fromElements = function (x, y, z, w, result) {\n  if (!defined(result)) {\n    return new Cartesian4(x, y, z, w);\n  }\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  result.w = w;\n  return result;\n};\n\n/**\n * Creates a Cartesian4 instance from a {@link Color}. <code>red</code>, <code>green</code>, <code>blue</code>,\n * and <code>alpha</code> map to <code>x</code>, <code>y</code>, <code>z</code>, and <code>w</code>, respectively.\n *\n * @param {Color} color The source color.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.fromColor = function (color, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"color\", color);\n  //>>includeEnd('debug');\n  if (!defined(result)) {\n    return new Cartesian4(color.red, color.green, color.blue, color.alpha);\n  }\n\n  result.x = color.red;\n  result.y = color.green;\n  result.z = color.blue;\n  result.w = color.alpha;\n  return result;\n};\n\n/**\n * Duplicates a Cartesian4 instance.\n *\n * @param {Cartesian4} cartesian The Cartesian to duplicate.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined)\n */\nCartesian4.clone = function (cartesian, result) {\n  if (!defined(cartesian)) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    return new Cartesian4(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n  }\n\n  result.x = cartesian.x;\n  result.y = cartesian.y;\n  result.z = cartesian.z;\n  result.w = cartesian.w;\n  return result;\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nCartesian4.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Cartesian4} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nCartesian4.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  array[startingIndex++] = value.x;\n  array[startingIndex++] = value.y;\n  array[startingIndex++] = value.z;\n  array[startingIndex] = value.w;\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Cartesian4} [result] The object into which to store the result.\n * @returns {Cartesian4}  The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new Cartesian4();\n  }\n  result.x = array[startingIndex++];\n  result.y = array[startingIndex++];\n  result.z = array[startingIndex++];\n  result.w = array[startingIndex];\n  return result;\n};\n\n/**\n * Flattens an array of Cartesian4s into an array of components.\n *\n * @param {Cartesian4[]} array The array of cartesians to pack.\n * @param {number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 4 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 4) elements.\n * @returns {number[]} The packed array.\n */\nCartesian4.packArray = function (array, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  const length = array.length;\n  const resultLength = length * 4;\n  if (!defined(result)) {\n    result = new Array(resultLength);\n  } else if (!Array.isArray(result) && result.length !== resultLength) {\n    //>>includeStart('debug', pragmas.debug);\n    throw new DeveloperError(\n      \"If result is a typed array, it must have exactly array.length * 4 elements\"\n    );\n    //>>includeEnd('debug');\n  } else if (result.length !== resultLength) {\n    result.length = resultLength;\n  }\n\n  for (let i = 0; i < length; ++i) {\n    Cartesian4.pack(array[i], result, i * 4);\n  }\n  return result;\n};\n\n/**\n * Unpacks an array of cartesian components into an array of Cartesian4s.\n *\n * @param {number[]} array The array of components to unpack.\n * @param {Cartesian4[]} [result] The array onto which to store the result.\n * @returns {Cartesian4[]} The unpacked array.\n */\nCartesian4.unpackArray = function (array, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  Check.typeOf.number.greaterThanOrEquals(\"array.length\", array.length, 4);\n  if (array.length % 4 !== 0) {\n    throw new DeveloperError(\"array length must be a multiple of 4.\");\n  }\n  //>>includeEnd('debug');\n\n  const length = array.length;\n  if (!defined(result)) {\n    result = new Array(length / 4);\n  } else {\n    result.length = length / 4;\n  }\n\n  for (let i = 0; i < length; i += 4) {\n    const index = i / 4;\n    result[index] = Cartesian4.unpack(array, i, result[index]);\n  }\n  return result;\n};\n\n/**\n * Creates a Cartesian4 from four consecutive elements in an array.\n * @function\n *\n * @param {number[]} array The array whose four consecutive elements correspond to the x, y, z, and w components, respectively.\n * @param {number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4}  The modified result parameter or a new Cartesian4 instance if one was not provided.\n *\n * @example\n * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)\n * const v = [1.0, 2.0, 3.0, 4.0];\n * const p = Cesium.Cartesian4.fromArray(v);\n *\n * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array\n * const v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0];\n * const p2 = Cesium.Cartesian4.fromArray(v2, 2);\n */\nCartesian4.fromArray = Cartesian4.unpack;\n\n/**\n * Computes the value of the maximum component for the supplied Cartesian.\n *\n * @param {Cartesian4} cartesian The cartesian to use.\n * @returns {number} The value of the maximum component.\n */\nCartesian4.maximumComponent = function (cartesian) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n};\n\n/**\n * Computes the value of the minimum component for the supplied Cartesian.\n *\n * @param {Cartesian4} cartesian The cartesian to use.\n * @returns {number} The value of the minimum component.\n */\nCartesian4.minimumComponent = function (cartesian) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.\n *\n * @param {Cartesian4} first A cartesian to compare.\n * @param {Cartesian4} second A cartesian to compare.\n * @param {Cartesian4} result The object into which to store the result.\n * @returns {Cartesian4} A cartesian with the minimum components.\n */\nCartesian4.minimumByComponent = function (first, second, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"first\", first);\n  Check.typeOf.object(\"second\", second);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = Math.min(first.x, second.x);\n  result.y = Math.min(first.y, second.y);\n  result.z = Math.min(first.z, second.z);\n  result.w = Math.min(first.w, second.w);\n\n  return result;\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.\n *\n * @param {Cartesian4} first A cartesian to compare.\n * @param {Cartesian4} second A cartesian to compare.\n * @param {Cartesian4} result The object into which to store the result.\n * @returns {Cartesian4} A cartesian with the maximum components.\n */\nCartesian4.maximumByComponent = function (first, second, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"first\", first);\n  Check.typeOf.object(\"second\", second);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = Math.max(first.x, second.x);\n  result.y = Math.max(first.y, second.y);\n  result.z = Math.max(first.z, second.z);\n  result.w = Math.max(first.w, second.w);\n\n  return result;\n};\n\n/**\n * Constrain a value to lie between two values.\n *\n * @param {Cartesian4} value The value to clamp.\n * @param {Cartesian4} min The minimum bound.\n * @param {Cartesian4} max The maximum bound.\n * @param {Cartesian4} result The object into which to store the result.\n * @returns {Cartesian4} The clamped value such that min <= result <= max.\n */\nCartesian4.clamp = function (value, min, max, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.typeOf.object(\"min\", min);\n  Check.typeOf.object(\"max\", max);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const x = CesiumMath.clamp(value.x, min.x, max.x);\n  const y = CesiumMath.clamp(value.y, min.y, max.y);\n  const z = CesiumMath.clamp(value.z, min.z, max.z);\n  const w = CesiumMath.clamp(value.w, min.w, max.w);\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  result.w = w;\n\n  return result;\n};\n\n/**\n * Computes the provided Cartesian's squared magnitude.\n *\n * @param {Cartesian4} cartesian The Cartesian instance whose squared magnitude is to be computed.\n * @returns {number} The squared magnitude.\n */\nCartesian4.magnitudeSquared = function (cartesian) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  return (\n    cartesian.x * cartesian.x +\n    cartesian.y * cartesian.y +\n    cartesian.z * cartesian.z +\n    cartesian.w * cartesian.w\n  );\n};\n\n/**\n * Computes the Cartesian's magnitude (length).\n *\n * @param {Cartesian4} cartesian The Cartesian instance whose magnitude is to be computed.\n * @returns {number} The magnitude.\n */\nCartesian4.magnitude = function (cartesian) {\n  return Math.sqrt(Cartesian4.magnitudeSquared(cartesian));\n};\n\nconst distanceScratch = new Cartesian4();\n\n/**\n * Computes the 4-space distance between two points.\n *\n * @param {Cartesian4} left The first point to compute the distance from.\n * @param {Cartesian4} right The second point to compute the distance to.\n * @returns {number} The distance between two points.\n *\n * @example\n * // Returns 1.0\n * const d = Cesium.Cartesian4.distance(\n *   new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),\n *   new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0));\n */\nCartesian4.distance = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  Cartesian4.subtract(left, right, distanceScratch);\n  return Cartesian4.magnitude(distanceScratch);\n};\n\n/**\n * Computes the squared distance between two points.  Comparing squared distances\n * using this function is more efficient than comparing distances using {@link Cartesian4#distance}.\n *\n * @param {Cartesian4} left The first point to compute the distance from.\n * @param {Cartesian4} right The second point to compute the distance to.\n * @returns {number} The distance between two points.\n *\n * @example\n * // Returns 4.0, not 2.0\n * const d = Cesium.Cartesian4.distance(\n *   new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),\n *   new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0));\n */\nCartesian4.distanceSquared = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  Cartesian4.subtract(left, right, distanceScratch);\n  return Cartesian4.magnitudeSquared(distanceScratch);\n};\n\n/**\n * Computes the normalized form of the supplied Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian to be normalized.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.normalize = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const magnitude = Cartesian4.magnitude(cartesian);\n\n  result.x = cartesian.x / magnitude;\n  result.y = cartesian.y / magnitude;\n  result.z = cartesian.z / magnitude;\n  result.w = cartesian.w / magnitude;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    isNaN(result.x) ||\n    isNaN(result.y) ||\n    isNaN(result.z) ||\n    isNaN(result.w)\n  ) {\n    throw new DeveloperError(\"normalized result is not a number\");\n  }\n  //>>includeEnd('debug');\n\n  return result;\n};\n\n/**\n * Computes the dot (scalar) product of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @returns {number} The dot product.\n */\nCartesian4.dot = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  return (\n    left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w\n  );\n};\n\n/**\n * Computes the componentwise product of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.multiplyComponents = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = left.x * right.x;\n  result.y = left.y * right.y;\n  result.z = left.z * right.z;\n  result.w = left.w * right.w;\n  return result;\n};\n\n/**\n * Computes the componentwise quotient of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.divideComponents = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = left.x / right.x;\n  result.y = left.y / right.y;\n  result.z = left.z / right.z;\n  result.w = left.w / right.w;\n  return result;\n};\n\n/**\n * Computes the componentwise sum of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.add = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = left.x + right.x;\n  result.y = left.y + right.y;\n  result.z = left.z + right.z;\n  result.w = left.w + right.w;\n  return result;\n};\n\n/**\n * Computes the componentwise difference of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.subtract = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = left.x - right.x;\n  result.y = left.y - right.y;\n  result.z = left.z - right.z;\n  result.w = left.w - right.w;\n  return result;\n};\n\n/**\n * Multiplies the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian4} cartesian The Cartesian to be scaled.\n * @param {number} scalar The scalar to multiply with.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.multiplyByScalar = function (cartesian, scalar, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.number(\"scalar\", scalar);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = cartesian.x * scalar;\n  result.y = cartesian.y * scalar;\n  result.z = cartesian.z * scalar;\n  result.w = cartesian.w * scalar;\n  return result;\n};\n\n/**\n * Divides the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian4} cartesian The Cartesian to be divided.\n * @param {number} scalar The scalar to divide by.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.divideByScalar = function (cartesian, scalar, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.number(\"scalar\", scalar);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = cartesian.x / scalar;\n  result.y = cartesian.y / scalar;\n  result.z = cartesian.z / scalar;\n  result.w = cartesian.w / scalar;\n  return result;\n};\n\n/**\n * Negates the provided Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian to be negated.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.negate = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = -cartesian.x;\n  result.y = -cartesian.y;\n  result.z = -cartesian.z;\n  result.w = -cartesian.w;\n  return result;\n};\n\n/**\n * Computes the absolute value of the provided Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian whose absolute value is to be computed.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.abs = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = Math.abs(cartesian.x);\n  result.y = Math.abs(cartesian.y);\n  result.z = Math.abs(cartesian.z);\n  result.w = Math.abs(cartesian.w);\n  return result;\n};\n\nconst lerpScratch = new Cartesian4();\n/**\n * Computes the linear interpolation or extrapolation at t using the provided cartesians.\n *\n * @param {Cartesian4} start The value corresponding to t at 0.0.\n * @param {Cartesian4}end The value corresponding to t at 1.0.\n * @param {number} t The point along t at which to interpolate.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.lerp = function (start, end, t, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"start\", start);\n  Check.typeOf.object(\"end\", end);\n  Check.typeOf.number(\"t\", t);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  Cartesian4.multiplyByScalar(end, t, lerpScratch);\n  result = Cartesian4.multiplyByScalar(start, 1.0 - t, result);\n  return Cartesian4.add(lerpScratch, result, result);\n};\n\nconst mostOrthogonalAxisScratch = new Cartesian4();\n/**\n * Returns the axis that is most orthogonal to the provided Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian on which to find the most orthogonal axis.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The most orthogonal axis.\n */\nCartesian4.mostOrthogonalAxis = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch);\n  Cartesian4.abs(f, f);\n\n  if (f.x <= f.y) {\n    if (f.x <= f.z) {\n      if (f.x <= f.w) {\n        result = Cartesian4.clone(Cartesian4.UNIT_X, result);\n      } else {\n        result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n      }\n    } else if (f.z <= f.w) {\n      result = Cartesian4.clone(Cartesian4.UNIT_Z, result);\n    } else {\n      result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n    }\n  } else if (f.y <= f.z) {\n    if (f.y <= f.w) {\n      result = Cartesian4.clone(Cartesian4.UNIT_Y, result);\n    } else {\n      result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n    }\n  } else if (f.z <= f.w) {\n    result = Cartesian4.clone(Cartesian4.UNIT_Z, result);\n  } else {\n    result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n  }\n\n  return result;\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartesian4} [left] The first Cartesian.\n * @param {Cartesian4} [right] The second Cartesian.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCartesian4.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left.x === right.x &&\n      left.y === right.y &&\n      left.z === right.z &&\n      left.w === right.w)\n  );\n};\n\n/**\n * @private\n */\nCartesian4.equalsArray = function (cartesian, array, offset) {\n  return (\n    cartesian.x === array[offset] &&\n    cartesian.y === array[offset + 1] &&\n    cartesian.z === array[offset + 2] &&\n    cartesian.w === array[offset + 3]\n  );\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {Cartesian4} [left] The first Cartesian.\n * @param {Cartesian4} [right] The second Cartesian.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nCartesian4.equalsEpsilon = function (\n  left,\n  right,\n  relativeEpsilon,\n  absoluteEpsilon\n) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      CesiumMath.equalsEpsilon(\n        left.x,\n        right.x,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        left.y,\n        right.y,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        left.z,\n        right.z,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        left.w,\n        right.w,\n        relativeEpsilon,\n        absoluteEpsilon\n      ))\n  );\n};\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.ZERO = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (1.0, 1.0, 1.0, 1.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.ONE = Object.freeze(new Cartesian4(1.0, 1.0, 1.0, 1.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_X = Object.freeze(new Cartesian4(1.0, 0.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_Y = Object.freeze(new Cartesian4(0.0, 1.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_Z = Object.freeze(new Cartesian4(0.0, 0.0, 1.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_W = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 1.0));\n\n/**\n * Duplicates this Cartesian4 instance.\n *\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.prototype.clone = function (result) {\n  return Cartesian4.clone(this, result);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartesian4} [right] The right hand side Cartesian.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nCartesian4.prototype.equals = function (right) {\n  return Cartesian4.equals(this, right);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {Cartesian4} [right] The right hand side Cartesian.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nCartesian4.prototype.equalsEpsilon = function (\n  right,\n  relativeEpsilon,\n  absoluteEpsilon\n) {\n  return Cartesian4.equalsEpsilon(\n    this,\n    right,\n    relativeEpsilon,\n    absoluteEpsilon\n  );\n};\n\n/**\n * Creates a string representing this Cartesian in the format '(x, y, z, w)'.\n *\n * @returns {string} A string representing the provided Cartesian in the format '(x, y, z, w)'.\n */\nCartesian4.prototype.toString = function () {\n  return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;\n};\n\n// scratchU8Array and scratchF32Array are views into the same buffer\nconst scratchF32Array = new Float32Array(1);\nconst scratchU8Array = new Uint8Array(scratchF32Array.buffer);\n\nconst testU32 = new Uint32Array([0x11223344]);\nconst testU8 = new Uint8Array(testU32.buffer);\nconst littleEndian = testU8[0] === 0x44;\n\n/**\n * Packs an arbitrary floating point value to 4 values representable using uint8.\n *\n * @param {number} value A floating point number.\n * @param {Cartesian4} [result] The Cartesian4 that will contain the packed float.\n * @returns {Cartesian4} A Cartesian4 representing the float packed to values in x, y, z, and w.\n */\nCartesian4.packFloat = function (value, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"value\", value);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian4();\n  }\n\n  // scratchU8Array and scratchF32Array are views into the same buffer\n  scratchF32Array[0] = value;\n\n  if (littleEndian) {\n    result.x = scratchU8Array[0];\n    result.y = scratchU8Array[1];\n    result.z = scratchU8Array[2];\n    result.w = scratchU8Array[3];\n  } else {\n    // convert from big-endian to little-endian\n    result.x = scratchU8Array[3];\n    result.y = scratchU8Array[2];\n    result.z = scratchU8Array[1];\n    result.w = scratchU8Array[0];\n  }\n  return result;\n};\n\n/**\n * Unpacks a float packed using Cartesian4.packFloat.\n *\n * @param {Cartesian4} packedFloat A Cartesian4 containing a float packed to 4 values representable using uint8.\n * @returns {number} The unpacked float.\n * @private\n */\nCartesian4.unpackFloat = function (packedFloat) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"packedFloat\", packedFloat);\n  //>>includeEnd('debug');\n\n  // scratchU8Array and scratchF32Array are views into the same buffer\n  if (littleEndian) {\n    scratchU8Array[0] = packedFloat.x;\n    scratchU8Array[1] = packedFloat.y;\n    scratchU8Array[2] = packedFloat.z;\n    scratchU8Array[3] = packedFloat.w;\n  } else {\n    // convert from little-endian to big-endian\n    scratchU8Array[0] = packedFloat.w;\n    scratchU8Array[1] = packedFloat.z;\n    scratchU8Array[2] = packedFloat.y;\n    scratchU8Array[3] = packedFloat.x;\n  }\n  return scratchF32Array[0];\n};\nexport default Cartesian4;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A 3x3 matrix, indexable as a column-major order array.\n * Constructor parameters are in row-major order for code readability.\n * @alias Matrix3\n * @constructor\n * @implements {ArrayLike<number>}\n *\n * @param {number} [column0Row0=0.0] The value for column 0, row 0.\n * @param {number} [column1Row0=0.0] The value for column 1, row 0.\n * @param {number} [column2Row0=0.0] The value for column 2, row 0.\n * @param {number} [column0Row1=0.0] The value for column 0, row 1.\n * @param {number} [column1Row1=0.0] The value for column 1, row 1.\n * @param {number} [column2Row1=0.0] The value for column 2, row 1.\n * @param {number} [column0Row2=0.0] The value for column 0, row 2.\n * @param {number} [column1Row2=0.0] The value for column 1, row 2.\n * @param {number} [column2Row2=0.0] The value for column 2, row 2.\n *\n * @see Matrix3.fromArray\n * @see Matrix3.fromColumnMajorArray\n * @see Matrix3.fromRowMajorArray\n * @see Matrix3.fromQuaternion\n * @see Matrix3.fromHeadingPitchRoll\n * @see Matrix3.fromScale\n * @see Matrix3.fromUniformScale\n * @see Matrix3.fromCrossProduct\n * @see Matrix3.fromRotationX\n * @see Matrix3.fromRotationY\n * @see Matrix3.fromRotationZ\n * @see Matrix2\n * @see Matrix4\n */\nfunction Matrix3(\n  column0Row0,\n  column1Row0,\n  column2Row0,\n  column0Row1,\n  column1Row1,\n  column2Row1,\n  column0Row2,\n  column1Row2,\n  column2Row2\n) {\n  this[0] = defaultValue(column0Row0, 0.0);\n  this[1] = defaultValue(column0Row1, 0.0);\n  this[2] = defaultValue(column0Row2, 0.0);\n  this[3] = defaultValue(column1Row0, 0.0);\n  this[4] = defaultValue(column1Row1, 0.0);\n  this[5] = defaultValue(column1Row2, 0.0);\n  this[6] = defaultValue(column2Row0, 0.0);\n  this[7] = defaultValue(column2Row1, 0.0);\n  this[8] = defaultValue(column2Row2, 0.0);\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nMatrix3.packedLength = 9;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Matrix3} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nMatrix3.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  array[startingIndex++] = value[0];\n  array[startingIndex++] = value[1];\n  array[startingIndex++] = value[2];\n  array[startingIndex++] = value[3];\n  array[startingIndex++] = value[4];\n  array[startingIndex++] = value[5];\n  array[startingIndex++] = value[6];\n  array[startingIndex++] = value[7];\n  array[startingIndex++] = value[8];\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Matrix3} [result] The object into which to store the result.\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided.\n */\nMatrix3.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new Matrix3();\n  }\n\n  result[0] = array[startingIndex++];\n  result[1] = array[startingIndex++];\n  result[2] = array[startingIndex++];\n  result[3] = array[startingIndex++];\n  result[4] = array[startingIndex++];\n  result[5] = array[startingIndex++];\n  result[6] = array[startingIndex++];\n  result[7] = array[startingIndex++];\n  result[8] = array[startingIndex++];\n  return result;\n};\n\n/**\n * Flattens an array of Matrix3s into an array of components. The components\n * are stored in column-major order.\n *\n * @param {Matrix3[]} array The array of matrices to pack.\n * @param {number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 9 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 9) elements.\n * @returns {number[]} The packed array.\n */\nMatrix3.packArray = function (array, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  const length = array.length;\n  const resultLength = length * 9;\n  if (!defined(result)) {\n    result = new Array(resultLength);\n  } else if (!Array.isArray(result) && result.length !== resultLength) {\n    //>>includeStart('debug', pragmas.debug);\n    throw new DeveloperError(\n      \"If result is a typed array, it must have exactly array.length * 9 elements\"\n    );\n    //>>includeEnd('debug');\n  } else if (result.length !== resultLength) {\n    result.length = resultLength;\n  }\n\n  for (let i = 0; i < length; ++i) {\n    Matrix3.pack(array[i], result, i * 9);\n  }\n  return result;\n};\n\n/**\n * Unpacks an array of column-major matrix components into an array of Matrix3s.\n *\n * @param {number[]} array The array of components to unpack.\n * @param {Matrix3[]} [result] The array onto which to store the result.\n * @returns {Matrix3[]} The unpacked array.\n */\nMatrix3.unpackArray = function (array, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  Check.typeOf.number.greaterThanOrEquals(\"array.length\", array.length, 9);\n  if (array.length % 9 !== 0) {\n    throw new DeveloperError(\"array length must be a multiple of 9.\");\n  }\n  //>>includeEnd('debug');\n\n  const length = array.length;\n  if (!defined(result)) {\n    result = new Array(length / 9);\n  } else {\n    result.length = length / 9;\n  }\n\n  for (let i = 0; i < length; i += 9) {\n    const index = i / 9;\n    result[index] = Matrix3.unpack(array, i, result[index]);\n  }\n  return result;\n};\n\n/**\n * Duplicates a Matrix3 instance.\n *\n * @param {Matrix3} matrix The matrix to duplicate.\n * @param {Matrix3} [result] The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined)\n */\nMatrix3.clone = function (matrix, result) {\n  if (!defined(matrix)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    return new Matrix3(\n      matrix[0],\n      matrix[3],\n      matrix[6],\n      matrix[1],\n      matrix[4],\n      matrix[7],\n      matrix[2],\n      matrix[5],\n      matrix[8]\n    );\n  }\n  result[0] = matrix[0];\n  result[1] = matrix[1];\n  result[2] = matrix[2];\n  result[3] = matrix[3];\n  result[4] = matrix[4];\n  result[5] = matrix[5];\n  result[6] = matrix[6];\n  result[7] = matrix[7];\n  result[8] = matrix[8];\n  return result;\n};\n\n/**\n * Creates a Matrix3 from 9 consecutive elements in an array.\n *\n * @function\n * @param {number[]} array The array whose 9 consecutive elements correspond to the positions of the matrix.  Assumes column-major order.\n * @param {number} [startingIndex=0] The offset into the array of the first element, which corresponds to first column first row position in the matrix.\n * @param {Matrix3} [result] The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided.\n *\n * @example\n * // Create the Matrix3:\n * // [1.0, 2.0, 3.0]\n * // [1.0, 2.0, 3.0]\n * // [1.0, 2.0, 3.0]\n *\n * const v = [1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];\n * const m = Cesium.Matrix3.fromArray(v);\n *\n * // Create same Matrix3 with using an offset into an array\n * const v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];\n * const m2 = Cesium.Matrix3.fromArray(v2, 2);\n */\nMatrix3.fromArray = Matrix3.unpack;\n\n/**\n * Creates a Matrix3 instance from a column-major order array.\n *\n * @param {number[]} values The column-major order array.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n */\nMatrix3.fromColumnMajorArray = function (values, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"values\", values);\n  //>>includeEnd('debug');\n\n  return Matrix3.clone(values, result);\n};\n\n/**\n * Creates a Matrix3 instance from a row-major order array.\n * The resulting matrix will be in column-major order.\n *\n * @param {number[]} values The row-major order array.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n */\nMatrix3.fromRowMajorArray = function (values, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"values\", values);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Matrix3(\n      values[0],\n      values[1],\n      values[2],\n      values[3],\n      values[4],\n      values[5],\n      values[6],\n      values[7],\n      values[8]\n    );\n  }\n  result[0] = values[0];\n  result[1] = values[3];\n  result[2] = values[6];\n  result[3] = values[1];\n  result[4] = values[4];\n  result[5] = values[7];\n  result[6] = values[2];\n  result[7] = values[5];\n  result[8] = values[8];\n  return result;\n};\n\n/**\n * Computes a 3x3 rotation matrix from the provided quaternion.\n *\n * @param {Quaternion} quaternion the quaternion to use.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The 3x3 rotation matrix from this quaternion.\n */\nMatrix3.fromQuaternion = function (quaternion, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"quaternion\", quaternion);\n  //>>includeEnd('debug');\n\n  const x2 = quaternion.x * quaternion.x;\n  const xy = quaternion.x * quaternion.y;\n  const xz = quaternion.x * quaternion.z;\n  const xw = quaternion.x * quaternion.w;\n  const y2 = quaternion.y * quaternion.y;\n  const yz = quaternion.y * quaternion.z;\n  const yw = quaternion.y * quaternion.w;\n  const z2 = quaternion.z * quaternion.z;\n  const zw = quaternion.z * quaternion.w;\n  const w2 = quaternion.w * quaternion.w;\n\n  const m00 = x2 - y2 - z2 + w2;\n  const m01 = 2.0 * (xy - zw);\n  const m02 = 2.0 * (xz + yw);\n\n  const m10 = 2.0 * (xy + zw);\n  const m11 = -x2 + y2 - z2 + w2;\n  const m12 = 2.0 * (yz - xw);\n\n  const m20 = 2.0 * (xz - yw);\n  const m21 = 2.0 * (yz + xw);\n  const m22 = -x2 - y2 + z2 + w2;\n\n  if (!defined(result)) {\n    return new Matrix3(m00, m01, m02, m10, m11, m12, m20, m21, m22);\n  }\n  result[0] = m00;\n  result[1] = m10;\n  result[2] = m20;\n  result[3] = m01;\n  result[4] = m11;\n  result[5] = m21;\n  result[6] = m02;\n  result[7] = m12;\n  result[8] = m22;\n  return result;\n};\n\n/**\n * Computes a 3x3 rotation matrix from the provided headingPitchRoll. (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )\n *\n * @param {HeadingPitchRoll} headingPitchRoll the headingPitchRoll to use.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll.\n */\nMatrix3.fromHeadingPitchRoll = function (headingPitchRoll, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"headingPitchRoll\", headingPitchRoll);\n  //>>includeEnd('debug');\n\n  const cosTheta = Math.cos(-headingPitchRoll.pitch);\n  const cosPsi = Math.cos(-headingPitchRoll.heading);\n  const cosPhi = Math.cos(headingPitchRoll.roll);\n  const sinTheta = Math.sin(-headingPitchRoll.pitch);\n  const sinPsi = Math.sin(-headingPitchRoll.heading);\n  const sinPhi = Math.sin(headingPitchRoll.roll);\n\n  const m00 = cosTheta * cosPsi;\n  const m01 = -cosPhi * sinPsi + sinPhi * sinTheta * cosPsi;\n  const m02 = sinPhi * sinPsi + cosPhi * sinTheta * cosPsi;\n\n  const m10 = cosTheta * sinPsi;\n  const m11 = cosPhi * cosPsi + sinPhi * sinTheta * sinPsi;\n  const m12 = -sinPhi * cosPsi + cosPhi * sinTheta * sinPsi;\n\n  const m20 = -sinTheta;\n  const m21 = sinPhi * cosTheta;\n  const m22 = cosPhi * cosTheta;\n\n  if (!defined(result)) {\n    return new Matrix3(m00, m01, m02, m10, m11, m12, m20, m21, m22);\n  }\n  result[0] = m00;\n  result[1] = m10;\n  result[2] = m20;\n  result[3] = m01;\n  result[4] = m11;\n  result[5] = m21;\n  result[6] = m02;\n  result[7] = m12;\n  result[8] = m22;\n  return result;\n};\n\n/**\n * Computes a Matrix3 instance representing a non-uniform scale.\n *\n * @param {Cartesian3} scale The x, y, and z scale factors.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n *\n * @example\n * // Creates\n * //   [7.0, 0.0, 0.0]\n * //   [0.0, 8.0, 0.0]\n * //   [0.0, 0.0, 9.0]\n * const m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));\n */\nMatrix3.fromScale = function (scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"scale\", scale);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Matrix3(scale.x, 0.0, 0.0, 0.0, scale.y, 0.0, 0.0, 0.0, scale.z);\n  }\n\n  result[0] = scale.x;\n  result[1] = 0.0;\n  result[2] = 0.0;\n  result[3] = 0.0;\n  result[4] = scale.y;\n  result[5] = 0.0;\n  result[6] = 0.0;\n  result[7] = 0.0;\n  result[8] = scale.z;\n  return result;\n};\n\n/**\n * Computes a Matrix3 instance representing a uniform scale.\n *\n * @param {number} scale The uniform scale factor.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n *\n * @example\n * // Creates\n * //   [2.0, 0.0, 0.0]\n * //   [0.0, 2.0, 0.0]\n * //   [0.0, 0.0, 2.0]\n * const m = Cesium.Matrix3.fromUniformScale(2.0);\n */\nMatrix3.fromUniformScale = function (scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"scale\", scale);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Matrix3(scale, 0.0, 0.0, 0.0, scale, 0.0, 0.0, 0.0, scale);\n  }\n\n  result[0] = scale;\n  result[1] = 0.0;\n  result[2] = 0.0;\n  result[3] = 0.0;\n  result[4] = scale;\n  result[5] = 0.0;\n  result[6] = 0.0;\n  result[7] = 0.0;\n  result[8] = scale;\n  return result;\n};\n\n/**\n * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector.\n *\n * @param {Cartesian3} vector the vector on the left hand side of the cross product operation.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n *\n * @example\n * // Creates\n * //   [0.0, -9.0,  8.0]\n * //   [9.0,  0.0, -7.0]\n * //   [-8.0, 7.0,  0.0]\n * const m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0));\n */\nMatrix3.fromCrossProduct = function (vector, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"vector\", vector);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Matrix3(\n      0.0,\n      -vector.z,\n      vector.y,\n      vector.z,\n      0.0,\n      -vector.x,\n      -vector.y,\n      vector.x,\n      0.0\n    );\n  }\n\n  result[0] = 0.0;\n  result[1] = vector.z;\n  result[2] = -vector.y;\n  result[3] = -vector.z;\n  result[4] = 0.0;\n  result[5] = vector.x;\n  result[6] = vector.y;\n  result[7] = -vector.x;\n  result[8] = 0.0;\n  return result;\n};\n\n/**\n * Creates a rotation matrix around the x-axis.\n *\n * @param {number} angle The angle, in radians, of the rotation.  Positive angles are counterclockwise.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n *\n * @example\n * // Rotate a point 45 degrees counterclockwise around the x-axis.\n * const p = new Cesium.Cartesian3(5, 6, 7);\n * const m = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(45.0));\n * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());\n */\nMatrix3.fromRotationX = function (angle, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"angle\", angle);\n  //>>includeEnd('debug');\n\n  const cosAngle = Math.cos(angle);\n  const sinAngle = Math.sin(angle);\n\n  if (!defined(result)) {\n    return new Matrix3(\n      1.0,\n      0.0,\n      0.0,\n      0.0,\n      cosAngle,\n      -sinAngle,\n      0.0,\n      sinAngle,\n      cosAngle\n    );\n  }\n\n  result[0] = 1.0;\n  result[1] = 0.0;\n  result[2] = 0.0;\n  result[3] = 0.0;\n  result[4] = cosAngle;\n  result[5] = sinAngle;\n  result[6] = 0.0;\n  result[7] = -sinAngle;\n  result[8] = cosAngle;\n\n  return result;\n};\n\n/**\n * Creates a rotation matrix around the y-axis.\n *\n * @param {number} angle The angle, in radians, of the rotation.  Positive angles are counterclockwise.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n *\n * @example\n * // Rotate a point 45 degrees counterclockwise around the y-axis.\n * const p = new Cesium.Cartesian3(5, 6, 7);\n * const m = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(45.0));\n * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());\n */\nMatrix3.fromRotationY = function (angle, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"angle\", angle);\n  //>>includeEnd('debug');\n\n  const cosAngle = Math.cos(angle);\n  const sinAngle = Math.sin(angle);\n\n  if (!defined(result)) {\n    return new Matrix3(\n      cosAngle,\n      0.0,\n      sinAngle,\n      0.0,\n      1.0,\n      0.0,\n      -sinAngle,\n      0.0,\n      cosAngle\n    );\n  }\n\n  result[0] = cosAngle;\n  result[1] = 0.0;\n  result[2] = -sinAngle;\n  result[3] = 0.0;\n  result[4] = 1.0;\n  result[5] = 0.0;\n  result[6] = sinAngle;\n  result[7] = 0.0;\n  result[8] = cosAngle;\n\n  return result;\n};\n\n/**\n * Creates a rotation matrix around the z-axis.\n *\n * @param {number} angle The angle, in radians, of the rotation.  Positive angles are counterclockwise.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n *\n * @example\n * // Rotate a point 45 degrees counterclockwise around the z-axis.\n * const p = new Cesium.Cartesian3(5, 6, 7);\n * const m = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45.0));\n * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());\n */\nMatrix3.fromRotationZ = function (angle, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"angle\", angle);\n  //>>includeEnd('debug');\n\n  const cosAngle = Math.cos(angle);\n  const sinAngle = Math.sin(angle);\n\n  if (!defined(result)) {\n    return new Matrix3(\n      cosAngle,\n      -sinAngle,\n      0.0,\n      sinAngle,\n      cosAngle,\n      0.0,\n      0.0,\n      0.0,\n      1.0\n    );\n  }\n\n  result[0] = cosAngle;\n  result[1] = sinAngle;\n  result[2] = 0.0;\n  result[3] = -sinAngle;\n  result[4] = cosAngle;\n  result[5] = 0.0;\n  result[6] = 0.0;\n  result[7] = 0.0;\n  result[8] = 1.0;\n\n  return result;\n};\n\n/**\n * Creates an Array from the provided Matrix3 instance.\n * The array will be in column-major order.\n *\n * @param {Matrix3} matrix The matrix to use..\n * @param {number[]} [result] The Array onto which to store the result.\n * @returns {number[]} The modified Array parameter or a new Array instance if one was not provided.\n */\nMatrix3.toArray = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return [\n      matrix[0],\n      matrix[1],\n      matrix[2],\n      matrix[3],\n      matrix[4],\n      matrix[5],\n      matrix[6],\n      matrix[7],\n      matrix[8],\n    ];\n  }\n  result[0] = matrix[0];\n  result[1] = matrix[1];\n  result[2] = matrix[2];\n  result[3] = matrix[3];\n  result[4] = matrix[4];\n  result[5] = matrix[5];\n  result[6] = matrix[6];\n  result[7] = matrix[7];\n  result[8] = matrix[8];\n  return result;\n};\n\n/**\n * Computes the array index of the element at the provided row and column.\n *\n * @param {number} column The zero-based index of the column.\n * @param {number} row The zero-based index of the row.\n * @returns {number} The index of the element at the provided row and column.\n *\n * @exception {DeveloperError} row must be 0, 1, or 2.\n * @exception {DeveloperError} column must be 0, 1, or 2.\n *\n * @example\n * const myMatrix = new Cesium.Matrix3();\n * const column1Row0Index = Cesium.Matrix3.getElementIndex(1, 0);\n * const column1Row0 = myMatrix[column1Row0Index]\n * myMatrix[column1Row0Index] = 10.0;\n */\nMatrix3.getElementIndex = function (column, row) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThanOrEquals(\"row\", row, 0);\n  Check.typeOf.number.lessThanOrEquals(\"row\", row, 2);\n  Check.typeOf.number.greaterThanOrEquals(\"column\", column, 0);\n  Check.typeOf.number.lessThanOrEquals(\"column\", column, 2);\n  //>>includeEnd('debug');\n\n  return column * 3 + row;\n};\n\n/**\n * Retrieves a copy of the matrix column at the provided index as a Cartesian3 instance.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @param {number} index The zero-based index of the column to retrieve.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, or 2.\n */\nMatrix3.getColumn = function (matrix, index, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\n  Check.typeOf.number.lessThanOrEquals(\"index\", index, 2);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const startIndex = index * 3;\n  const x = matrix[startIndex];\n  const y = matrix[startIndex + 1];\n  const z = matrix[startIndex + 2];\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  return result;\n};\n\n/**\n * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian3 instance.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @param {number} index The zero-based index of the column to set.\n * @param {Cartesian3} cartesian The Cartesian whose values will be assigned to the specified column.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, or 2.\n */\nMatrix3.setColumn = function (matrix, index, cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\n  Check.typeOf.number.lessThanOrEquals(\"index\", index, 2);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result = Matrix3.clone(matrix, result);\n  const startIndex = index * 3;\n  result[startIndex] = cartesian.x;\n  result[startIndex + 1] = cartesian.y;\n  result[startIndex + 2] = cartesian.z;\n  return result;\n};\n\n/**\n * Retrieves a copy of the matrix row at the provided index as a Cartesian3 instance.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @param {number} index The zero-based index of the row to retrieve.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, or 2.\n */\nMatrix3.getRow = function (matrix, index, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\n  Check.typeOf.number.lessThanOrEquals(\"index\", index, 2);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const x = matrix[index];\n  const y = matrix[index + 3];\n  const z = matrix[index + 6];\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  return result;\n};\n\n/**\n * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian3 instance.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @param {number} index The zero-based index of the row to set.\n * @param {Cartesian3} cartesian The Cartesian whose values will be assigned to the specified row.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, or 2.\n */\nMatrix3.setRow = function (matrix, index, cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\n  Check.typeOf.number.lessThanOrEquals(\"index\", index, 2);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result = Matrix3.clone(matrix, result);\n  result[index] = cartesian.x;\n  result[index + 3] = cartesian.y;\n  result[index + 6] = cartesian.z;\n  return result;\n};\n\nconst scaleScratch1 = new Cartesian3();\n\n/**\n * Computes a new matrix that replaces the scale with the provided scale.\n * This assumes the matrix is an affine transformation.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @param {Cartesian3} scale The scale that replaces the scale of the provided matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @see Matrix3.setUniformScale\n * @see Matrix3.fromScale\n * @see Matrix3.fromUniformScale\n * @see Matrix3.multiplyByScale\n * @see Matrix3.multiplyByUniformScale\n * @see Matrix3.getScale\n */\nMatrix3.setScale = function (matrix, scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"scale\", scale);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const existingScale = Matrix3.getScale(matrix, scaleScratch1);\n  const scaleRatioX = scale.x / existingScale.x;\n  const scaleRatioY = scale.y / existingScale.y;\n  const scaleRatioZ = scale.z / existingScale.z;\n\n  result[0] = matrix[0] * scaleRatioX;\n  result[1] = matrix[1] * scaleRatioX;\n  result[2] = matrix[2] * scaleRatioX;\n  result[3] = matrix[3] * scaleRatioY;\n  result[4] = matrix[4] * scaleRatioY;\n  result[5] = matrix[5] * scaleRatioY;\n  result[6] = matrix[6] * scaleRatioZ;\n  result[7] = matrix[7] * scaleRatioZ;\n  result[8] = matrix[8] * scaleRatioZ;\n\n  return result;\n};\n\nconst scaleScratch2 = new Cartesian3();\n\n/**\n * Computes a new matrix that replaces the scale with the provided uniform scale.\n * This assumes the matrix is an affine transformation.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @param {number} scale The uniform scale that replaces the scale of the provided matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @see Matrix3.setScale\n * @see Matrix3.fromScale\n * @see Matrix3.fromUniformScale\n * @see Matrix3.multiplyByScale\n * @see Matrix3.multiplyByUniformScale\n * @see Matrix3.getScale\n */\nMatrix3.setUniformScale = function (matrix, scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.number(\"scale\", scale);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const existingScale = Matrix3.getScale(matrix, scaleScratch2);\n  const scaleRatioX = scale / existingScale.x;\n  const scaleRatioY = scale / existingScale.y;\n  const scaleRatioZ = scale / existingScale.z;\n\n  result[0] = matrix[0] * scaleRatioX;\n  result[1] = matrix[1] * scaleRatioX;\n  result[2] = matrix[2] * scaleRatioX;\n  result[3] = matrix[3] * scaleRatioY;\n  result[4] = matrix[4] * scaleRatioY;\n  result[5] = matrix[5] * scaleRatioY;\n  result[6] = matrix[6] * scaleRatioZ;\n  result[7] = matrix[7] * scaleRatioZ;\n  result[8] = matrix[8] * scaleRatioZ;\n\n  return result;\n};\n\nconst scratchColumn = new Cartesian3();\n\n/**\n * Extracts the non-uniform scale assuming the matrix is an affine transformation.\n *\n * @param {Matrix3} matrix The matrix.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @see Matrix3.multiplyByScale\n * @see Matrix3.multiplyByUniformScale\n * @see Matrix3.fromScale\n * @see Matrix3.fromUniformScale\n * @see Matrix3.setScale\n * @see Matrix3.setUniformScale\n */\nMatrix3.getScale = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = Cartesian3.magnitude(\n    Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)\n  );\n  result.y = Cartesian3.magnitude(\n    Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)\n  );\n  result.z = Cartesian3.magnitude(\n    Cartesian3.fromElements(matrix[6], matrix[7], matrix[8], scratchColumn)\n  );\n  return result;\n};\n\nconst scaleScratch3 = new Cartesian3();\n\n/**\n * Computes the maximum scale assuming the matrix is an affine transformation.\n * The maximum scale is the maximum length of the column vectors.\n *\n * @param {Matrix3} matrix The matrix.\n * @returns {number} The maximum scale.\n */\nMatrix3.getMaximumScale = function (matrix) {\n  Matrix3.getScale(matrix, scaleScratch3);\n  return Cartesian3.maximumComponent(scaleScratch3);\n};\n\nconst scaleScratch4 = new Cartesian3();\n\n/**\n * Sets the rotation assuming the matrix is an affine transformation.\n *\n * @param {Matrix3} matrix The matrix.\n * @param {Matrix3} rotation The rotation matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @see Matrix3.getRotation\n */\nMatrix3.setRotation = function (matrix, rotation, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const scale = Matrix3.getScale(matrix, scaleScratch4);\n\n  result[0] = rotation[0] * scale.x;\n  result[1] = rotation[1] * scale.x;\n  result[2] = rotation[2] * scale.x;\n  result[3] = rotation[3] * scale.y;\n  result[4] = rotation[4] * scale.y;\n  result[5] = rotation[5] * scale.y;\n  result[6] = rotation[6] * scale.z;\n  result[7] = rotation[7] * scale.z;\n  result[8] = rotation[8] * scale.z;\n\n  return result;\n};\n\nconst scaleScratch5 = new Cartesian3();\n\n/**\n * Extracts the rotation matrix assuming the matrix is an affine transformation.\n *\n * @param {Matrix3} matrix The matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @see Matrix3.setRotation\n */\nMatrix3.getRotation = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const scale = Matrix3.getScale(matrix, scaleScratch5);\n\n  result[0] = matrix[0] / scale.x;\n  result[1] = matrix[1] / scale.x;\n  result[2] = matrix[2] / scale.x;\n  result[3] = matrix[3] / scale.y;\n  result[4] = matrix[4] / scale.y;\n  result[5] = matrix[5] / scale.y;\n  result[6] = matrix[6] / scale.z;\n  result[7] = matrix[7] / scale.z;\n  result[8] = matrix[8] / scale.z;\n\n  return result;\n};\n\n/**\n * Computes the product of two matrices.\n *\n * @param {Matrix3} left The first matrix.\n * @param {Matrix3} right The second matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.multiply = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const column0Row0 =\n    left[0] * right[0] + left[3] * right[1] + left[6] * right[2];\n  const column0Row1 =\n    left[1] * right[0] + left[4] * right[1] + left[7] * right[2];\n  const column0Row2 =\n    left[2] * right[0] + left[5] * right[1] + left[8] * right[2];\n\n  const column1Row0 =\n    left[0] * right[3] + left[3] * right[4] + left[6] * right[5];\n  const column1Row1 =\n    left[1] * right[3] + left[4] * right[4] + left[7] * right[5];\n  const column1Row2 =\n    left[2] * right[3] + left[5] * right[4] + left[8] * right[5];\n\n  const column2Row0 =\n    left[0] * right[6] + left[3] * right[7] + left[6] * right[8];\n  const column2Row1 =\n    left[1] * right[6] + left[4] * right[7] + left[7] * right[8];\n  const column2Row2 =\n    left[2] * right[6] + left[5] * right[7] + left[8] * right[8];\n\n  result[0] = column0Row0;\n  result[1] = column0Row1;\n  result[2] = column0Row2;\n  result[3] = column1Row0;\n  result[4] = column1Row1;\n  result[5] = column1Row2;\n  result[6] = column2Row0;\n  result[7] = column2Row1;\n  result[8] = column2Row2;\n  return result;\n};\n\n/**\n * Computes the sum of two matrices.\n *\n * @param {Matrix3} left The first matrix.\n * @param {Matrix3} right The second matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.add = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = left[0] + right[0];\n  result[1] = left[1] + right[1];\n  result[2] = left[2] + right[2];\n  result[3] = left[3] + right[3];\n  result[4] = left[4] + right[4];\n  result[5] = left[5] + right[5];\n  result[6] = left[6] + right[6];\n  result[7] = left[7] + right[7];\n  result[8] = left[8] + right[8];\n  return result;\n};\n\n/**\n * Computes the difference of two matrices.\n *\n * @param {Matrix3} left The first matrix.\n * @param {Matrix3} right The second matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.subtract = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = left[0] - right[0];\n  result[1] = left[1] - right[1];\n  result[2] = left[2] - right[2];\n  result[3] = left[3] - right[3];\n  result[4] = left[4] - right[4];\n  result[5] = left[5] - right[5];\n  result[6] = left[6] - right[6];\n  result[7] = left[7] - right[7];\n  result[8] = left[8] - right[8];\n  return result;\n};\n\n/**\n * Computes the product of a matrix and a column vector.\n *\n * @param {Matrix3} matrix The matrix.\n * @param {Cartesian3} cartesian The column.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nMatrix3.multiplyByVector = function (matrix, cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const vX = cartesian.x;\n  const vY = cartesian.y;\n  const vZ = cartesian.z;\n\n  const x = matrix[0] * vX + matrix[3] * vY + matrix[6] * vZ;\n  const y = matrix[1] * vX + matrix[4] * vY + matrix[7] * vZ;\n  const z = matrix[2] * vX + matrix[5] * vY + matrix[8] * vZ;\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  return result;\n};\n\n/**\n * Computes the product of a matrix and a scalar.\n *\n * @param {Matrix3} matrix The matrix.\n * @param {number} scalar The number to multiply by.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.multiplyByScalar = function (matrix, scalar, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.number(\"scalar\", scalar);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = matrix[0] * scalar;\n  result[1] = matrix[1] * scalar;\n  result[2] = matrix[2] * scalar;\n  result[3] = matrix[3] * scalar;\n  result[4] = matrix[4] * scalar;\n  result[5] = matrix[5] * scalar;\n  result[6] = matrix[6] * scalar;\n  result[7] = matrix[7] * scalar;\n  result[8] = matrix[8] * scalar;\n  return result;\n};\n\n/**\n * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.\n *\n * @param {Matrix3} matrix The matrix on the left-hand side.\n * @param {Cartesian3} scale The non-uniform scale on the right-hand side.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n *\n * @example\n * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromScale(scale), m);\n * Cesium.Matrix3.multiplyByScale(m, scale, m);\n *\n * @see Matrix3.multiplyByUniformScale\n * @see Matrix3.fromScale\n * @see Matrix3.fromUniformScale\n * @see Matrix3.setScale\n * @see Matrix3.setUniformScale\n * @see Matrix3.getScale\n */\nMatrix3.multiplyByScale = function (matrix, scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"scale\", scale);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = matrix[0] * scale.x;\n  result[1] = matrix[1] * scale.x;\n  result[2] = matrix[2] * scale.x;\n  result[3] = matrix[3] * scale.y;\n  result[4] = matrix[4] * scale.y;\n  result[5] = matrix[5] * scale.y;\n  result[6] = matrix[6] * scale.z;\n  result[7] = matrix[7] * scale.z;\n  result[8] = matrix[8] * scale.z;\n\n  return result;\n};\n\n/**\n * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.\n *\n * @param {Matrix3} matrix The matrix on the left-hand side.\n * @param {number} scale The uniform scale on the right-hand side.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromUniformScale(scale), m);\n * Cesium.Matrix3.multiplyByUniformScale(m, scale, m);\n *\n * @see Matrix3.multiplyByScale\n * @see Matrix3.fromScale\n * @see Matrix3.fromUniformScale\n * @see Matrix3.setScale\n * @see Matrix3.setUniformScale\n * @see Matrix3.getScale\n */\nMatrix3.multiplyByUniformScale = function (matrix, scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.number(\"scale\", scale);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = matrix[0] * scale;\n  result[1] = matrix[1] * scale;\n  result[2] = matrix[2] * scale;\n  result[3] = matrix[3] * scale;\n  result[4] = matrix[4] * scale;\n  result[5] = matrix[5] * scale;\n  result[6] = matrix[6] * scale;\n  result[7] = matrix[7] * scale;\n  result[8] = matrix[8] * scale;\n\n  return result;\n};\n\n/**\n * Creates a negated copy of the provided matrix.\n *\n * @param {Matrix3} matrix The matrix to negate.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.negate = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = -matrix[0];\n  result[1] = -matrix[1];\n  result[2] = -matrix[2];\n  result[3] = -matrix[3];\n  result[4] = -matrix[4];\n  result[5] = -matrix[5];\n  result[6] = -matrix[6];\n  result[7] = -matrix[7];\n  result[8] = -matrix[8];\n  return result;\n};\n\n/**\n * Computes the transpose of the provided matrix.\n *\n * @param {Matrix3} matrix The matrix to transpose.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.transpose = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const column0Row0 = matrix[0];\n  const column0Row1 = matrix[3];\n  const column0Row2 = matrix[6];\n  const column1Row0 = matrix[1];\n  const column1Row1 = matrix[4];\n  const column1Row2 = matrix[7];\n  const column2Row0 = matrix[2];\n  const column2Row1 = matrix[5];\n  const column2Row2 = matrix[8];\n\n  result[0] = column0Row0;\n  result[1] = column0Row1;\n  result[2] = column0Row2;\n  result[3] = column1Row0;\n  result[4] = column1Row1;\n  result[5] = column1Row2;\n  result[6] = column2Row0;\n  result[7] = column2Row1;\n  result[8] = column2Row2;\n  return result;\n};\n\nfunction computeFrobeniusNorm(matrix) {\n  let norm = 0.0;\n  for (let i = 0; i < 9; ++i) {\n    const temp = matrix[i];\n    norm += temp * temp;\n  }\n\n  return Math.sqrt(norm);\n}\n\nconst rowVal = [1, 0, 0];\nconst colVal = [2, 2, 1];\n\nfunction offDiagonalFrobeniusNorm(matrix) {\n  // Computes the \"off-diagonal\" Frobenius norm.\n  // Assumes matrix is symmetric.\n\n  let norm = 0.0;\n  for (let i = 0; i < 3; ++i) {\n    const temp = matrix[Matrix3.getElementIndex(colVal[i], rowVal[i])];\n    norm += 2.0 * temp * temp;\n  }\n\n  return Math.sqrt(norm);\n}\n\nfunction shurDecomposition(matrix, result) {\n  // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan,\n  // section 8.4.2 The 2by2 Symmetric Schur Decomposition.\n  //\n  // The routine takes a matrix, which is assumed to be symmetric, and\n  // finds the largest off-diagonal term, and then creates\n  // a matrix (result) which can be used to help reduce it\n\n  const tolerance = CesiumMath.EPSILON15;\n\n  let maxDiagonal = 0.0;\n  let rotAxis = 1;\n\n  // find pivot (rotAxis) based on max diagonal of matrix\n  for (let i = 0; i < 3; ++i) {\n    const temp = Math.abs(\n      matrix[Matrix3.getElementIndex(colVal[i], rowVal[i])]\n    );\n    if (temp > maxDiagonal) {\n      rotAxis = i;\n      maxDiagonal = temp;\n    }\n  }\n\n  let c = 1.0;\n  let s = 0.0;\n\n  const p = rowVal[rotAxis];\n  const q = colVal[rotAxis];\n\n  if (Math.abs(matrix[Matrix3.getElementIndex(q, p)]) > tolerance) {\n    const qq = matrix[Matrix3.getElementIndex(q, q)];\n    const pp = matrix[Matrix3.getElementIndex(p, p)];\n    const qp = matrix[Matrix3.getElementIndex(q, p)];\n\n    const tau = (qq - pp) / 2.0 / qp;\n    let t;\n\n    if (tau < 0.0) {\n      t = -1.0 / (-tau + Math.sqrt(1.0 + tau * tau));\n    } else {\n      t = 1.0 / (tau + Math.sqrt(1.0 + tau * tau));\n    }\n\n    c = 1.0 / Math.sqrt(1.0 + t * t);\n    s = t * c;\n  }\n\n  result = Matrix3.clone(Matrix3.IDENTITY, result);\n\n  result[Matrix3.getElementIndex(p, p)] = result[\n    Matrix3.getElementIndex(q, q)\n  ] = c;\n  result[Matrix3.getElementIndex(q, p)] = s;\n  result[Matrix3.getElementIndex(p, q)] = -s;\n\n  return result;\n}\n\nconst jMatrix = new Matrix3();\nconst jMatrixTranspose = new Matrix3();\n\n/**\n * Computes the eigenvectors and eigenvalues of a symmetric matrix.\n * <p>\n * Returns a diagonal matrix and unitary matrix such that:\n * <code>matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)</code>\n * </p>\n * <p>\n * The values along the diagonal of the diagonal matrix are the eigenvalues. The columns\n * of the unitary matrix are the corresponding eigenvectors.\n * </p>\n *\n * @param {Matrix3} matrix The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.\n * @param {object} [result] An object with unitary and diagonal properties which are matrices onto which to store the result.\n * @returns {object} An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.\n *\n * @example\n * const a = //... symetric matrix\n * const result = {\n *     unitary : new Cesium.Matrix3(),\n *     diagonal : new Cesium.Matrix3()\n * };\n * Cesium.Matrix3.computeEigenDecomposition(a, result);\n *\n * const unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3());\n * const b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3());\n * Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a\n *\n * const lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x;  // first eigenvalue\n * const v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3());          // first eigenvector\n * const c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3());        // equal to Cesium.Matrix3.multiplyByVector(a, v)\n */\nMatrix3.computeEigenDecomposition = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  //>>includeEnd('debug');\n\n  // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan,\n  // section 8.4.3 The Classical Jacobi Algorithm\n\n  const tolerance = CesiumMath.EPSILON20;\n  const maxSweeps = 10;\n\n  let count = 0;\n  let sweep = 0;\n\n  if (!defined(result)) {\n    result = {};\n  }\n\n  const unitaryMatrix = (result.unitary = Matrix3.clone(\n    Matrix3.IDENTITY,\n    result.unitary\n  ));\n  const diagMatrix = (result.diagonal = Matrix3.clone(matrix, result.diagonal));\n\n  const epsilon = tolerance * computeFrobeniusNorm(diagMatrix);\n\n  while (sweep < maxSweeps && offDiagonalFrobeniusNorm(diagMatrix) > epsilon) {\n    shurDecomposition(diagMatrix, jMatrix);\n    Matrix3.transpose(jMatrix, jMatrixTranspose);\n    Matrix3.multiply(diagMatrix, jMatrix, diagMatrix);\n    Matrix3.multiply(jMatrixTranspose, diagMatrix, diagMatrix);\n    Matrix3.multiply(unitaryMatrix, jMatrix, unitaryMatrix);\n\n    if (++count > 2) {\n      ++sweep;\n      count = 0;\n    }\n  }\n\n  return result;\n};\n\n/**\n * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.\n *\n * @param {Matrix3} matrix The matrix with signed elements.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.abs = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = Math.abs(matrix[0]);\n  result[1] = Math.abs(matrix[1]);\n  result[2] = Math.abs(matrix[2]);\n  result[3] = Math.abs(matrix[3]);\n  result[4] = Math.abs(matrix[4]);\n  result[5] = Math.abs(matrix[5]);\n  result[6] = Math.abs(matrix[6]);\n  result[7] = Math.abs(matrix[7]);\n  result[8] = Math.abs(matrix[8]);\n\n  return result;\n};\n\n/**\n * Computes the determinant of the provided matrix.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @returns {number} The value of the determinant of the matrix.\n */\nMatrix3.determinant = function (matrix) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  //>>includeEnd('debug');\n\n  const m11 = matrix[0];\n  const m21 = matrix[3];\n  const m31 = matrix[6];\n  const m12 = matrix[1];\n  const m22 = matrix[4];\n  const m32 = matrix[7];\n  const m13 = matrix[2];\n  const m23 = matrix[5];\n  const m33 = matrix[8];\n\n  return (\n    m11 * (m22 * m33 - m23 * m32) +\n    m12 * (m23 * m31 - m21 * m33) +\n    m13 * (m21 * m32 - m22 * m31)\n  );\n};\n\n/**\n * Computes the inverse of the provided matrix.\n *\n * @param {Matrix3} matrix The matrix to invert.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @exception {DeveloperError} matrix is not invertible.\n */\nMatrix3.inverse = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const m11 = matrix[0];\n  const m21 = matrix[1];\n  const m31 = matrix[2];\n  const m12 = matrix[3];\n  const m22 = matrix[4];\n  const m32 = matrix[5];\n  const m13 = matrix[6];\n  const m23 = matrix[7];\n  const m33 = matrix[8];\n\n  const determinant = Matrix3.determinant(matrix);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (Math.abs(determinant) <= CesiumMath.EPSILON15) {\n    throw new DeveloperError(\"matrix is not invertible\");\n  }\n  //>>includeEnd('debug');\n\n  result[0] = m22 * m33 - m23 * m32;\n  result[1] = m23 * m31 - m21 * m33;\n  result[2] = m21 * m32 - m22 * m31;\n  result[3] = m13 * m32 - m12 * m33;\n  result[4] = m11 * m33 - m13 * m31;\n  result[5] = m12 * m31 - m11 * m32;\n  result[6] = m12 * m23 - m13 * m22;\n  result[7] = m13 * m21 - m11 * m23;\n  result[8] = m11 * m22 - m12 * m21;\n\n  const scale = 1.0 / determinant;\n  return Matrix3.multiplyByScalar(result, scale, result);\n};\n\nconst scratchTransposeMatrix = new Matrix3();\n\n/**\n * Computes the inverse transpose of a matrix.\n *\n * @param {Matrix3} matrix The matrix to transpose and invert.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.inverseTranspose = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  return Matrix3.inverse(\n    Matrix3.transpose(matrix, scratchTransposeMatrix),\n    result\n  );\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Matrix3} [left] The first matrix.\n * @param {Matrix3} [right] The second matrix.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nMatrix3.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left[0] === right[0] &&\n      left[1] === right[1] &&\n      left[2] === right[2] &&\n      left[3] === right[3] &&\n      left[4] === right[4] &&\n      left[5] === right[5] &&\n      left[6] === right[6] &&\n      left[7] === right[7] &&\n      left[8] === right[8])\n  );\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Matrix3} [left] The first matrix.\n * @param {Matrix3} [right] The second matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nMatrix3.equalsEpsilon = function (left, right, epsilon) {\n  epsilon = defaultValue(epsilon, 0);\n\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      Math.abs(left[0] - right[0]) <= epsilon &&\n      Math.abs(left[1] - right[1]) <= epsilon &&\n      Math.abs(left[2] - right[2]) <= epsilon &&\n      Math.abs(left[3] - right[3]) <= epsilon &&\n      Math.abs(left[4] - right[4]) <= epsilon &&\n      Math.abs(left[5] - right[5]) <= epsilon &&\n      Math.abs(left[6] - right[6]) <= epsilon &&\n      Math.abs(left[7] - right[7]) <= epsilon &&\n      Math.abs(left[8] - right[8]) <= epsilon)\n  );\n};\n\n/**\n * An immutable Matrix3 instance initialized to the identity matrix.\n *\n * @type {Matrix3}\n * @constant\n */\nMatrix3.IDENTITY = Object.freeze(\n  new Matrix3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0)\n);\n\n/**\n * An immutable Matrix3 instance initialized to the zero matrix.\n *\n * @type {Matrix3}\n * @constant\n */\nMatrix3.ZERO = Object.freeze(\n  new Matrix3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)\n);\n\n/**\n * The index into Matrix3 for column 0, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN0ROW0 = 0;\n\n/**\n * The index into Matrix3 for column 0, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN0ROW1 = 1;\n\n/**\n * The index into Matrix3 for column 0, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN0ROW2 = 2;\n\n/**\n * The index into Matrix3 for column 1, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN1ROW0 = 3;\n\n/**\n * The index into Matrix3 for column 1, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN1ROW1 = 4;\n\n/**\n * The index into Matrix3 for column 1, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN1ROW2 = 5;\n\n/**\n * The index into Matrix3 for column 2, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN2ROW0 = 6;\n\n/**\n * The index into Matrix3 for column 2, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN2ROW1 = 7;\n\n/**\n * The index into Matrix3 for column 2, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix3.COLUMN2ROW2 = 8;\n\nObject.defineProperties(Matrix3.prototype, {\n  /**\n   * Gets the number of items in the collection.\n   * @memberof Matrix3.prototype\n   *\n   * @type {number}\n   */\n  length: {\n    get: function () {\n      return Matrix3.packedLength;\n    },\n  },\n});\n\n/**\n * Duplicates the provided Matrix3 instance.\n *\n * @param {Matrix3} [result] The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided.\n */\nMatrix3.prototype.clone = function (result) {\n  return Matrix3.clone(this, result);\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Matrix3} [right] The right hand side matrix.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nMatrix3.prototype.equals = function (right) {\n  return Matrix3.equals(this, right);\n};\n\n/**\n * @private\n */\nMatrix3.equalsArray = function (matrix, array, offset) {\n  return (\n    matrix[0] === array[offset] &&\n    matrix[1] === array[offset + 1] &&\n    matrix[2] === array[offset + 2] &&\n    matrix[3] === array[offset + 3] &&\n    matrix[4] === array[offset + 4] &&\n    matrix[5] === array[offset + 5] &&\n    matrix[6] === array[offset + 6] &&\n    matrix[7] === array[offset + 7] &&\n    matrix[8] === array[offset + 8]\n  );\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Matrix3} [right] The right hand side matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nMatrix3.prototype.equalsEpsilon = function (right, epsilon) {\n  return Matrix3.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Creates a string representing this Matrix with each row being\n * on a separate line and in the format '(column0, column1, column2)'.\n *\n * @returns {string} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'.\n */\nMatrix3.prototype.toString = function () {\n  return (\n    `(${this[0]}, ${this[3]}, ${this[6]})\\n` +\n    `(${this[1]}, ${this[4]}, ${this[7]})\\n` +\n    `(${this[2]}, ${this[5]}, ${this[8]})`\n  );\n};\nexport default Matrix3;\n", "import defined from \"./defined.js\";\n\n/**\n * Constructs an exception object that is thrown due to an error that can occur at runtime, e.g.,\n * out of memory, could not compile shader, etc.  If a function may throw this\n * exception, the calling code should be prepared to catch it.\n * <br /><br />\n * On the other hand, a {@link DeveloperError} indicates an exception due\n * to a developer error, e.g., invalid argument, that usually indicates a bug in the\n * calling code.\n *\n * @alias RuntimeError\n * @constructor\n * @extends Error\n *\n * @param {string} [message] The error message for this exception.\n *\n * @see DeveloperError\n */\nfunction RuntimeError(message) {\n  /**\n   * 'RuntimeError' indicating that this exception was thrown due to a runtime error.\n   * @type {string}\n   * @readonly\n   */\n  this.name = \"RuntimeError\";\n\n  /**\n   * The explanation for why this exception was thrown.\n   * @type {string}\n   * @readonly\n   */\n  this.message = message;\n\n  //Browsers such as IE don't have a stack property until you actually throw the error.\n  let stack;\n  try {\n    throw new Error();\n  } catch (e) {\n    stack = e.stack;\n  }\n\n  /**\n   * The stack trace of this exception, if available.\n   * @type {string}\n   * @readonly\n   */\n  this.stack = stack;\n}\n\nif (defined(Object.create)) {\n  RuntimeError.prototype = Object.create(Error.prototype);\n  RuntimeError.prototype.constructor = RuntimeError;\n}\n\nRuntimeError.prototype.toString = function () {\n  let str = `${this.name}: ${this.message}`;\n\n  if (defined(this.stack)) {\n    str += `\\n${this.stack.toString()}`;\n  }\n\n  return str;\n};\nexport default RuntimeError;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport RuntimeError from \"./RuntimeError.js\";\n\n/**\n * A 4x4 matrix, indexable as a column-major order array.\n * Constructor parameters are in row-major order for code readability.\n * @alias Matrix4\n * @constructor\n * @implements {ArrayLike<number>}\n *\n * @param {number} [column0Row0=0.0] The value for column 0, row 0.\n * @param {number} [column1Row0=0.0] The value for column 1, row 0.\n * @param {number} [column2Row0=0.0] The value for column 2, row 0.\n * @param {number} [column3Row0=0.0] The value for column 3, row 0.\n * @param {number} [column0Row1=0.0] The value for column 0, row 1.\n * @param {number} [column1Row1=0.0] The value for column 1, row 1.\n * @param {number} [column2Row1=0.0] The value for column 2, row 1.\n * @param {number} [column3Row1=0.0] The value for column 3, row 1.\n * @param {number} [column0Row2=0.0] The value for column 0, row 2.\n * @param {number} [column1Row2=0.0] The value for column 1, row 2.\n * @param {number} [column2Row2=0.0] The value for column 2, row 2.\n * @param {number} [column3Row2=0.0] The value for column 3, row 2.\n * @param {number} [column0Row3=0.0] The value for column 0, row 3.\n * @param {number} [column1Row3=0.0] The value for column 1, row 3.\n * @param {number} [column2Row3=0.0] The value for column 2, row 3.\n * @param {number} [column3Row3=0.0] The value for column 3, row 3.\n *\n * @see Matrix4.fromArray\n * @see Matrix4.fromColumnMajorArray\n * @see Matrix4.fromRowMajorArray\n * @see Matrix4.fromRotationTranslation\n * @see Matrix4.fromTranslationQuaternionRotationScale\n * @see Matrix4.fromTranslationRotationScale\n * @see Matrix4.fromTranslation\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.fromRotation\n * @see Matrix4.fromCamera\n * @see Matrix4.computePerspectiveFieldOfView\n * @see Matrix4.computeOrthographicOffCenter\n * @see Matrix4.computePerspectiveOffCenter\n * @see Matrix4.computeInfinitePerspectiveOffCenter\n * @see Matrix4.computeViewportTransformation\n * @see Matrix4.computeView\n * @see Matrix2\n * @see Matrix3\n * @see Packable\n */\nfunction Matrix4(\n  column0Row0,\n  column1Row0,\n  column2Row0,\n  column3Row0,\n  column0Row1,\n  column1Row1,\n  column2Row1,\n  column3Row1,\n  column0Row2,\n  column1Row2,\n  column2Row2,\n  column3Row2,\n  column0Row3,\n  column1Row3,\n  column2Row3,\n  column3Row3\n) {\n  this[0] = defaultValue(column0Row0, 0.0);\n  this[1] = defaultValue(column0Row1, 0.0);\n  this[2] = defaultValue(column0Row2, 0.0);\n  this[3] = defaultValue(column0Row3, 0.0);\n  this[4] = defaultValue(column1Row0, 0.0);\n  this[5] = defaultValue(column1Row1, 0.0);\n  this[6] = defaultValue(column1Row2, 0.0);\n  this[7] = defaultValue(column1Row3, 0.0);\n  this[8] = defaultValue(column2Row0, 0.0);\n  this[9] = defaultValue(column2Row1, 0.0);\n  this[10] = defaultValue(column2Row2, 0.0);\n  this[11] = defaultValue(column2Row3, 0.0);\n  this[12] = defaultValue(column3Row0, 0.0);\n  this[13] = defaultValue(column3Row1, 0.0);\n  this[14] = defaultValue(column3Row2, 0.0);\n  this[15] = defaultValue(column3Row3, 0.0);\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nMatrix4.packedLength = 16;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Matrix4} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nMatrix4.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  array[startingIndex++] = value[0];\n  array[startingIndex++] = value[1];\n  array[startingIndex++] = value[2];\n  array[startingIndex++] = value[3];\n  array[startingIndex++] = value[4];\n  array[startingIndex++] = value[5];\n  array[startingIndex++] = value[6];\n  array[startingIndex++] = value[7];\n  array[startingIndex++] = value[8];\n  array[startingIndex++] = value[9];\n  array[startingIndex++] = value[10];\n  array[startingIndex++] = value[11];\n  array[startingIndex++] = value[12];\n  array[startingIndex++] = value[13];\n  array[startingIndex++] = value[14];\n  array[startingIndex] = value[15];\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Matrix4} [result] The object into which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.\n */\nMatrix4.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new Matrix4();\n  }\n\n  result[0] = array[startingIndex++];\n  result[1] = array[startingIndex++];\n  result[2] = array[startingIndex++];\n  result[3] = array[startingIndex++];\n  result[4] = array[startingIndex++];\n  result[5] = array[startingIndex++];\n  result[6] = array[startingIndex++];\n  result[7] = array[startingIndex++];\n  result[8] = array[startingIndex++];\n  result[9] = array[startingIndex++];\n  result[10] = array[startingIndex++];\n  result[11] = array[startingIndex++];\n  result[12] = array[startingIndex++];\n  result[13] = array[startingIndex++];\n  result[14] = array[startingIndex++];\n  result[15] = array[startingIndex];\n  return result;\n};\n\n/**\n * Flattens an array of Matrix4s into an array of components. The components\n * are stored in column-major order.\n *\n * @param {Matrix4[]} array The array of matrices to pack.\n * @param {number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 16 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 16) elements.\n * @returns {number[]} The packed array.\n */\nMatrix4.packArray = function (array, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  const length = array.length;\n  const resultLength = length * 16;\n  if (!defined(result)) {\n    result = new Array(resultLength);\n  } else if (!Array.isArray(result) && result.length !== resultLength) {\n    //>>includeStart('debug', pragmas.debug);\n    throw new DeveloperError(\n      \"If result is a typed array, it must have exactly array.length * 16 elements\"\n    );\n    //>>includeEnd('debug');\n  } else if (result.length !== resultLength) {\n    result.length = resultLength;\n  }\n\n  for (let i = 0; i < length; ++i) {\n    Matrix4.pack(array[i], result, i * 16);\n  }\n  return result;\n};\n\n/**\n * Unpacks an array of column-major matrix components into an array of Matrix4s.\n *\n * @param {number[]} array The array of components to unpack.\n * @param {Matrix4[]} [result] The array onto which to store the result.\n * @returns {Matrix4[]} The unpacked array.\n */\nMatrix4.unpackArray = function (array, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  Check.typeOf.number.greaterThanOrEquals(\"array.length\", array.length, 16);\n  if (array.length % 16 !== 0) {\n    throw new DeveloperError(\"array length must be a multiple of 16.\");\n  }\n  //>>includeEnd('debug');\n\n  const length = array.length;\n  if (!defined(result)) {\n    result = new Array(length / 16);\n  } else {\n    result.length = length / 16;\n  }\n\n  for (let i = 0; i < length; i += 16) {\n    const index = i / 16;\n    result[index] = Matrix4.unpack(array, i, result[index]);\n  }\n  return result;\n};\n\n/**\n * Duplicates a Matrix4 instance.\n *\n * @param {Matrix4} matrix The matrix to duplicate.\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. (Returns undefined if matrix is undefined)\n */\nMatrix4.clone = function (matrix, result) {\n  if (!defined(matrix)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    return new Matrix4(\n      matrix[0],\n      matrix[4],\n      matrix[8],\n      matrix[12],\n      matrix[1],\n      matrix[5],\n      matrix[9],\n      matrix[13],\n      matrix[2],\n      matrix[6],\n      matrix[10],\n      matrix[14],\n      matrix[3],\n      matrix[7],\n      matrix[11],\n      matrix[15]\n    );\n  }\n  result[0] = matrix[0];\n  result[1] = matrix[1];\n  result[2] = matrix[2];\n  result[3] = matrix[3];\n  result[4] = matrix[4];\n  result[5] = matrix[5];\n  result[6] = matrix[6];\n  result[7] = matrix[7];\n  result[8] = matrix[8];\n  result[9] = matrix[9];\n  result[10] = matrix[10];\n  result[11] = matrix[11];\n  result[12] = matrix[12];\n  result[13] = matrix[13];\n  result[14] = matrix[14];\n  result[15] = matrix[15];\n  return result;\n};\n\n/**\n * Creates a Matrix4 from 16 consecutive elements in an array.\n * @function\n *\n * @param {number[]} array The array whose 16 consecutive elements correspond to the positions of the matrix.  Assumes column-major order.\n * @param {number} [startingIndex=0] The offset into the array of the first element, which corresponds to first column first row position in the matrix.\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.\n *\n * @example\n * // Create the Matrix4:\n * // [1.0, 2.0, 3.0, 4.0]\n * // [1.0, 2.0, 3.0, 4.0]\n * // [1.0, 2.0, 3.0, 4.0]\n * // [1.0, 2.0, 3.0, 4.0]\n *\n * const v = [1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];\n * const m = Cesium.Matrix4.fromArray(v);\n *\n * // Create same Matrix4 with using an offset into an array\n * const v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];\n * const m2 = Cesium.Matrix4.fromArray(v2, 2);\n */\nMatrix4.fromArray = Matrix4.unpack;\n\n/**\n * Computes a Matrix4 instance from a column-major order array.\n *\n * @param {number[]} values The column-major order array.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n */\nMatrix4.fromColumnMajorArray = function (values, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"values\", values);\n  //>>includeEnd('debug');\n\n  return Matrix4.clone(values, result);\n};\n\n/**\n * Computes a Matrix4 instance from a row-major order array.\n * The resulting matrix will be in column-major order.\n *\n * @param {number[]} values The row-major order array.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n */\nMatrix4.fromRowMajorArray = function (values, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"values\", values);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Matrix4(\n      values[0],\n      values[1],\n      values[2],\n      values[3],\n      values[4],\n      values[5],\n      values[6],\n      values[7],\n      values[8],\n      values[9],\n      values[10],\n      values[11],\n      values[12],\n      values[13],\n      values[14],\n      values[15]\n    );\n  }\n  result[0] = values[0];\n  result[1] = values[4];\n  result[2] = values[8];\n  result[3] = values[12];\n  result[4] = values[1];\n  result[5] = values[5];\n  result[6] = values[9];\n  result[7] = values[13];\n  result[8] = values[2];\n  result[9] = values[6];\n  result[10] = values[10];\n  result[11] = values[14];\n  result[12] = values[3];\n  result[13] = values[7];\n  result[14] = values[11];\n  result[15] = values[15];\n  return result;\n};\n\n/**\n * Computes a Matrix4 instance from a Matrix3 representing the rotation\n * and a Cartesian3 representing the translation.\n *\n * @param {Matrix3} rotation The upper left portion of the matrix representing the rotation.\n * @param {Cartesian3} [translation=Cartesian3.ZERO] The upper right portion of the matrix representing the translation.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n */\nMatrix4.fromRotationTranslation = function (rotation, translation, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rotation\", rotation);\n  //>>includeEnd('debug');\n\n  translation = defaultValue(translation, Cartesian3.ZERO);\n\n  if (!defined(result)) {\n    return new Matrix4(\n      rotation[0],\n      rotation[3],\n      rotation[6],\n      translation.x,\n      rotation[1],\n      rotation[4],\n      rotation[7],\n      translation.y,\n      rotation[2],\n      rotation[5],\n      rotation[8],\n      translation.z,\n      0.0,\n      0.0,\n      0.0,\n      1.0\n    );\n  }\n\n  result[0] = rotation[0];\n  result[1] = rotation[1];\n  result[2] = rotation[2];\n  result[3] = 0.0;\n  result[4] = rotation[3];\n  result[5] = rotation[4];\n  result[6] = rotation[5];\n  result[7] = 0.0;\n  result[8] = rotation[6];\n  result[9] = rotation[7];\n  result[10] = rotation[8];\n  result[11] = 0.0;\n  result[12] = translation.x;\n  result[13] = translation.y;\n  result[14] = translation.z;\n  result[15] = 1.0;\n  return result;\n};\n\n/**\n * Computes a Matrix4 instance from a translation, rotation, and scale (TRS)\n * representation with the rotation represented as a quaternion.\n *\n * @param {Cartesian3} translation The translation transformation.\n * @param {Quaternion} rotation The rotation transformation.\n * @param {Cartesian3} scale The non-uniform scale transformation.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n *\n * @example\n * const result = Cesium.Matrix4.fromTranslationQuaternionRotationScale(\n *   new Cesium.Cartesian3(1.0, 2.0, 3.0), // translation\n *   Cesium.Quaternion.IDENTITY,           // rotation\n *   new Cesium.Cartesian3(7.0, 8.0, 9.0), // scale\n *   result);\n */\nMatrix4.fromTranslationQuaternionRotationScale = function (\n  translation,\n  rotation,\n  scale,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"translation\", translation);\n  Check.typeOf.object(\"rotation\", rotation);\n  Check.typeOf.object(\"scale\", scale);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Matrix4();\n  }\n\n  const scaleX = scale.x;\n  const scaleY = scale.y;\n  const scaleZ = scale.z;\n\n  const x2 = rotation.x * rotation.x;\n  const xy = rotation.x * rotation.y;\n  const xz = rotation.x * rotation.z;\n  const xw = rotation.x * rotation.w;\n  const y2 = rotation.y * rotation.y;\n  const yz = rotation.y * rotation.z;\n  const yw = rotation.y * rotation.w;\n  const z2 = rotation.z * rotation.z;\n  const zw = rotation.z * rotation.w;\n  const w2 = rotation.w * rotation.w;\n\n  const m00 = x2 - y2 - z2 + w2;\n  const m01 = 2.0 * (xy - zw);\n  const m02 = 2.0 * (xz + yw);\n\n  const m10 = 2.0 * (xy + zw);\n  const m11 = -x2 + y2 - z2 + w2;\n  const m12 = 2.0 * (yz - xw);\n\n  const m20 = 2.0 * (xz - yw);\n  const m21 = 2.0 * (yz + xw);\n  const m22 = -x2 - y2 + z2 + w2;\n\n  result[0] = m00 * scaleX;\n  result[1] = m10 * scaleX;\n  result[2] = m20 * scaleX;\n  result[3] = 0.0;\n  result[4] = m01 * scaleY;\n  result[5] = m11 * scaleY;\n  result[6] = m21 * scaleY;\n  result[7] = 0.0;\n  result[8] = m02 * scaleZ;\n  result[9] = m12 * scaleZ;\n  result[10] = m22 * scaleZ;\n  result[11] = 0.0;\n  result[12] = translation.x;\n  result[13] = translation.y;\n  result[14] = translation.z;\n  result[15] = 1.0;\n\n  return result;\n};\n\n/**\n * Creates a Matrix4 instance from a {@link TranslationRotationScale} instance.\n *\n * @param {TranslationRotationScale} translationRotationScale The instance.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n */\nMatrix4.fromTranslationRotationScale = function (\n  translationRotationScale,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"translationRotationScale\", translationRotationScale);\n  //>>includeEnd('debug');\n\n  return Matrix4.fromTranslationQuaternionRotationScale(\n    translationRotationScale.translation,\n    translationRotationScale.rotation,\n    translationRotationScale.scale,\n    result\n  );\n};\n\n/**\n * Creates a Matrix4 instance from a Cartesian3 representing the translation.\n *\n * @param {Cartesian3} translation The upper right portion of the matrix representing the translation.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n *\n * @see Matrix4.multiplyByTranslation\n */\nMatrix4.fromTranslation = function (translation, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"translation\", translation);\n  //>>includeEnd('debug');\n\n  return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result);\n};\n\n/**\n * Computes a Matrix4 instance representing a non-uniform scale.\n *\n * @param {Cartesian3} scale The x, y, and z scale factors.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n *\n * @example\n * // Creates\n * //   [7.0, 0.0, 0.0, 0.0]\n * //   [0.0, 8.0, 0.0, 0.0]\n * //   [0.0, 0.0, 9.0, 0.0]\n * //   [0.0, 0.0, 0.0, 1.0]\n * const m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));\n */\nMatrix4.fromScale = function (scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"scale\", scale);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Matrix4(\n      scale.x,\n      0.0,\n      0.0,\n      0.0,\n      0.0,\n      scale.y,\n      0.0,\n      0.0,\n      0.0,\n      0.0,\n      scale.z,\n      0.0,\n      0.0,\n      0.0,\n      0.0,\n      1.0\n    );\n  }\n\n  result[0] = scale.x;\n  result[1] = 0.0;\n  result[2] = 0.0;\n  result[3] = 0.0;\n  result[4] = 0.0;\n  result[5] = scale.y;\n  result[6] = 0.0;\n  result[7] = 0.0;\n  result[8] = 0.0;\n  result[9] = 0.0;\n  result[10] = scale.z;\n  result[11] = 0.0;\n  result[12] = 0.0;\n  result[13] = 0.0;\n  result[14] = 0.0;\n  result[15] = 1.0;\n  return result;\n};\n\n/**\n * Computes a Matrix4 instance representing a uniform scale.\n *\n * @param {number} scale The uniform scale factor.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n *\n * @example\n * // Creates\n * //   [2.0, 0.0, 0.0, 0.0]\n * //   [0.0, 2.0, 0.0, 0.0]\n * //   [0.0, 0.0, 2.0, 0.0]\n * //   [0.0, 0.0, 0.0, 1.0]\n * const m = Cesium.Matrix4.fromUniformScale(2.0);\n */\nMatrix4.fromUniformScale = function (scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"scale\", scale);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Matrix4(\n      scale,\n      0.0,\n      0.0,\n      0.0,\n      0.0,\n      scale,\n      0.0,\n      0.0,\n      0.0,\n      0.0,\n      scale,\n      0.0,\n      0.0,\n      0.0,\n      0.0,\n      1.0\n    );\n  }\n\n  result[0] = scale;\n  result[1] = 0.0;\n  result[2] = 0.0;\n  result[3] = 0.0;\n  result[4] = 0.0;\n  result[5] = scale;\n  result[6] = 0.0;\n  result[7] = 0.0;\n  result[8] = 0.0;\n  result[9] = 0.0;\n  result[10] = scale;\n  result[11] = 0.0;\n  result[12] = 0.0;\n  result[13] = 0.0;\n  result[14] = 0.0;\n  result[15] = 1.0;\n  return result;\n};\n\n/**\n * Creates a rotation matrix.\n *\n * @param {Matrix3} rotation The rotation matrix.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n */\nMatrix4.fromRotation = function (rotation, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rotation\", rotation);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Matrix4();\n  }\n  result[0] = rotation[0];\n  result[1] = rotation[1];\n  result[2] = rotation[2];\n  result[3] = 0.0;\n\n  result[4] = rotation[3];\n  result[5] = rotation[4];\n  result[6] = rotation[5];\n  result[7] = 0.0;\n\n  result[8] = rotation[6];\n  result[9] = rotation[7];\n  result[10] = rotation[8];\n  result[11] = 0.0;\n\n  result[12] = 0.0;\n  result[13] = 0.0;\n  result[14] = 0.0;\n  result[15] = 1.0;\n\n  return result;\n};\n\nconst fromCameraF = new Cartesian3();\nconst fromCameraR = new Cartesian3();\nconst fromCameraU = new Cartesian3();\n\n/**\n * Computes a Matrix4 instance from a Camera.\n *\n * @param {Camera} camera The camera to use.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n */\nMatrix4.fromCamera = function (camera, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"camera\", camera);\n  //>>includeEnd('debug');\n\n  const position = camera.position;\n  const direction = camera.direction;\n  const up = camera.up;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"camera.position\", position);\n  Check.typeOf.object(\"camera.direction\", direction);\n  Check.typeOf.object(\"camera.up\", up);\n  //>>includeEnd('debug');\n\n  Cartesian3.normalize(direction, fromCameraF);\n  Cartesian3.normalize(\n    Cartesian3.cross(fromCameraF, up, fromCameraR),\n    fromCameraR\n  );\n  Cartesian3.normalize(\n    Cartesian3.cross(fromCameraR, fromCameraF, fromCameraU),\n    fromCameraU\n  );\n\n  const sX = fromCameraR.x;\n  const sY = fromCameraR.y;\n  const sZ = fromCameraR.z;\n  const fX = fromCameraF.x;\n  const fY = fromCameraF.y;\n  const fZ = fromCameraF.z;\n  const uX = fromCameraU.x;\n  const uY = fromCameraU.y;\n  const uZ = fromCameraU.z;\n  const positionX = position.x;\n  const positionY = position.y;\n  const positionZ = position.z;\n  const t0 = sX * -positionX + sY * -positionY + sZ * -positionZ;\n  const t1 = uX * -positionX + uY * -positionY + uZ * -positionZ;\n  const t2 = fX * positionX + fY * positionY + fZ * positionZ;\n\n  // The code below this comment is an optimized\n  // version of the commented lines.\n  // Rather that create two matrices and then multiply,\n  // we just bake in the multiplcation as part of creation.\n  // const rotation = new Matrix4(\n  //                 sX,  sY,  sZ, 0.0,\n  //                 uX,  uY,  uZ, 0.0,\n  //                -fX, -fY, -fZ, 0.0,\n  //                 0.0,  0.0,  0.0, 1.0);\n  // const translation = new Matrix4(\n  //                 1.0, 0.0, 0.0, -position.x,\n  //                 0.0, 1.0, 0.0, -position.y,\n  //                 0.0, 0.0, 1.0, -position.z,\n  //                 0.0, 0.0, 0.0, 1.0);\n  // return rotation.multiply(translation);\n  if (!defined(result)) {\n    return new Matrix4(\n      sX,\n      sY,\n      sZ,\n      t0,\n      uX,\n      uY,\n      uZ,\n      t1,\n      -fX,\n      -fY,\n      -fZ,\n      t2,\n      0.0,\n      0.0,\n      0.0,\n      1.0\n    );\n  }\n  result[0] = sX;\n  result[1] = uX;\n  result[2] = -fX;\n  result[3] = 0.0;\n  result[4] = sY;\n  result[5] = uY;\n  result[6] = -fY;\n  result[7] = 0.0;\n  result[8] = sZ;\n  result[9] = uZ;\n  result[10] = -fZ;\n  result[11] = 0.0;\n  result[12] = t0;\n  result[13] = t1;\n  result[14] = t2;\n  result[15] = 1.0;\n  return result;\n};\n\n/**\n * Computes a Matrix4 instance representing a perspective transformation matrix.\n *\n * @param {number} fovY The field of view along the Y axis in radians.\n * @param {number} aspectRatio The aspect ratio.\n * @param {number} near The distance to the near plane in meters.\n * @param {number} far The distance to the far plane in meters.\n * @param {Matrix4} result The object in which the result will be stored.\n * @returns {Matrix4} The modified result parameter.\n *\n * @exception {DeveloperError} fovY must be in (0, PI].\n * @exception {DeveloperError} aspectRatio must be greater than zero.\n * @exception {DeveloperError} near must be greater than zero.\n * @exception {DeveloperError} far must be greater than zero.\n */\nMatrix4.computePerspectiveFieldOfView = function (\n  fovY,\n  aspectRatio,\n  near,\n  far,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThan(\"fovY\", fovY, 0.0);\n  Check.typeOf.number.lessThan(\"fovY\", fovY, Math.PI);\n  Check.typeOf.number.greaterThan(\"near\", near, 0.0);\n  Check.typeOf.number.greaterThan(\"far\", far, 0.0);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const bottom = Math.tan(fovY * 0.5);\n\n  const column1Row1 = 1.0 / bottom;\n  const column0Row0 = column1Row1 / aspectRatio;\n  const column2Row2 = (far + near) / (near - far);\n  const column3Row2 = (2.0 * far * near) / (near - far);\n\n  result[0] = column0Row0;\n  result[1] = 0.0;\n  result[2] = 0.0;\n  result[3] = 0.0;\n  result[4] = 0.0;\n  result[5] = column1Row1;\n  result[6] = 0.0;\n  result[7] = 0.0;\n  result[8] = 0.0;\n  result[9] = 0.0;\n  result[10] = column2Row2;\n  result[11] = -1.0;\n  result[12] = 0.0;\n  result[13] = 0.0;\n  result[14] = column3Row2;\n  result[15] = 0.0;\n  return result;\n};\n\n/**\n * Computes a Matrix4 instance representing an orthographic transformation matrix.\n *\n * @param {number} left The number of meters to the left of the camera that will be in view.\n * @param {number} right The number of meters to the right of the camera that will be in view.\n * @param {number} bottom The number of meters below of the camera that will be in view.\n * @param {number} top The number of meters above of the camera that will be in view.\n * @param {number} near The distance to the near plane in meters.\n * @param {number} far The distance to the far plane in meters.\n * @param {Matrix4} result The object in which the result will be stored.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.computeOrthographicOffCenter = function (\n  left,\n  right,\n  bottom,\n  top,\n  near,\n  far,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"left\", left);\n  Check.typeOf.number(\"right\", right);\n  Check.typeOf.number(\"bottom\", bottom);\n  Check.typeOf.number(\"top\", top);\n  Check.typeOf.number(\"near\", near);\n  Check.typeOf.number(\"far\", far);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  let a = 1.0 / (right - left);\n  let b = 1.0 / (top - bottom);\n  let c = 1.0 / (far - near);\n\n  const tx = -(right + left) * a;\n  const ty = -(top + bottom) * b;\n  const tz = -(far + near) * c;\n  a *= 2.0;\n  b *= 2.0;\n  c *= -2.0;\n\n  result[0] = a;\n  result[1] = 0.0;\n  result[2] = 0.0;\n  result[3] = 0.0;\n  result[4] = 0.0;\n  result[5] = b;\n  result[6] = 0.0;\n  result[7] = 0.0;\n  result[8] = 0.0;\n  result[9] = 0.0;\n  result[10] = c;\n  result[11] = 0.0;\n  result[12] = tx;\n  result[13] = ty;\n  result[14] = tz;\n  result[15] = 1.0;\n  return result;\n};\n\n/**\n * Computes a Matrix4 instance representing an off center perspective transformation.\n *\n * @param {number} left The number of meters to the left of the camera that will be in view.\n * @param {number} right The number of meters to the right of the camera that will be in view.\n * @param {number} bottom The number of meters below of the camera that will be in view.\n * @param {number} top The number of meters above of the camera that will be in view.\n * @param {number} near The distance to the near plane in meters.\n * @param {number} far The distance to the far plane in meters.\n * @param {Matrix4} result The object in which the result will be stored.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.computePerspectiveOffCenter = function (\n  left,\n  right,\n  bottom,\n  top,\n  near,\n  far,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"left\", left);\n  Check.typeOf.number(\"right\", right);\n  Check.typeOf.number(\"bottom\", bottom);\n  Check.typeOf.number(\"top\", top);\n  Check.typeOf.number(\"near\", near);\n  Check.typeOf.number(\"far\", far);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const column0Row0 = (2.0 * near) / (right - left);\n  const column1Row1 = (2.0 * near) / (top - bottom);\n  const column2Row0 = (right + left) / (right - left);\n  const column2Row1 = (top + bottom) / (top - bottom);\n  const column2Row2 = -(far + near) / (far - near);\n  const column2Row3 = -1.0;\n  const column3Row2 = (-2.0 * far * near) / (far - near);\n\n  result[0] = column0Row0;\n  result[1] = 0.0;\n  result[2] = 0.0;\n  result[3] = 0.0;\n  result[4] = 0.0;\n  result[5] = column1Row1;\n  result[6] = 0.0;\n  result[7] = 0.0;\n  result[8] = column2Row0;\n  result[9] = column2Row1;\n  result[10] = column2Row2;\n  result[11] = column2Row3;\n  result[12] = 0.0;\n  result[13] = 0.0;\n  result[14] = column3Row2;\n  result[15] = 0.0;\n  return result;\n};\n\n/**\n * Computes a Matrix4 instance representing an infinite off center perspective transformation.\n *\n * @param {number} left The number of meters to the left of the camera that will be in view.\n * @param {number} right The number of meters to the right of the camera that will be in view.\n * @param {number} bottom The number of meters below of the camera that will be in view.\n * @param {number} top The number of meters above of the camera that will be in view.\n * @param {number} near The distance to the near plane in meters.\n * @param {Matrix4} result The object in which the result will be stored.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.computeInfinitePerspectiveOffCenter = function (\n  left,\n  right,\n  bottom,\n  top,\n  near,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"left\", left);\n  Check.typeOf.number(\"right\", right);\n  Check.typeOf.number(\"bottom\", bottom);\n  Check.typeOf.number(\"top\", top);\n  Check.typeOf.number(\"near\", near);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const column0Row0 = (2.0 * near) / (right - left);\n  const column1Row1 = (2.0 * near) / (top - bottom);\n  const column2Row0 = (right + left) / (right - left);\n  const column2Row1 = (top + bottom) / (top - bottom);\n  const column2Row2 = -1.0;\n  const column2Row3 = -1.0;\n  const column3Row2 = -2.0 * near;\n\n  result[0] = column0Row0;\n  result[1] = 0.0;\n  result[2] = 0.0;\n  result[3] = 0.0;\n  result[4] = 0.0;\n  result[5] = column1Row1;\n  result[6] = 0.0;\n  result[7] = 0.0;\n  result[8] = column2Row0;\n  result[9] = column2Row1;\n  result[10] = column2Row2;\n  result[11] = column2Row3;\n  result[12] = 0.0;\n  result[13] = 0.0;\n  result[14] = column3Row2;\n  result[15] = 0.0;\n  return result;\n};\n\n/**\n * Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates.\n *\n * @param {object} [viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] The viewport's corners as shown in Example 1.\n * @param {number} [nearDepthRange=0.0] The near plane distance in window coordinates.\n * @param {number} [farDepthRange=1.0] The far plane distance in window coordinates.\n * @param {Matrix4} [result] The object in which the result will be stored.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Create viewport transformation using an explicit viewport and depth range.\n * const m = Cesium.Matrix4.computeViewportTransformation({\n *     x : 0.0,\n *     y : 0.0,\n *     width : 1024.0,\n *     height : 768.0\n * }, 0.0, 1.0, new Cesium.Matrix4());\n */\nMatrix4.computeViewportTransformation = function (\n  viewport,\n  nearDepthRange,\n  farDepthRange,\n  result\n) {\n  if (!defined(result)) {\n    result = new Matrix4();\n  }\n\n  viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT);\n  const x = defaultValue(viewport.x, 0.0);\n  const y = defaultValue(viewport.y, 0.0);\n  const width = defaultValue(viewport.width, 0.0);\n  const height = defaultValue(viewport.height, 0.0);\n  nearDepthRange = defaultValue(nearDepthRange, 0.0);\n  farDepthRange = defaultValue(farDepthRange, 1.0);\n\n  const halfWidth = width * 0.5;\n  const halfHeight = height * 0.5;\n  const halfDepth = (farDepthRange - nearDepthRange) * 0.5;\n\n  const column0Row0 = halfWidth;\n  const column1Row1 = halfHeight;\n  const column2Row2 = halfDepth;\n  const column3Row0 = x + halfWidth;\n  const column3Row1 = y + halfHeight;\n  const column3Row2 = nearDepthRange + halfDepth;\n  const column3Row3 = 1.0;\n\n  result[0] = column0Row0;\n  result[1] = 0.0;\n  result[2] = 0.0;\n  result[3] = 0.0;\n  result[4] = 0.0;\n  result[5] = column1Row1;\n  result[6] = 0.0;\n  result[7] = 0.0;\n  result[8] = 0.0;\n  result[9] = 0.0;\n  result[10] = column2Row2;\n  result[11] = 0.0;\n  result[12] = column3Row0;\n  result[13] = column3Row1;\n  result[14] = column3Row2;\n  result[15] = column3Row3;\n\n  return result;\n};\n\n/**\n * Computes a Matrix4 instance that transforms from world space to view space.\n *\n * @param {Cartesian3} position The position of the camera.\n * @param {Cartesian3} direction The forward direction.\n * @param {Cartesian3} up The up direction.\n * @param {Cartesian3} right The right direction.\n * @param {Matrix4} result The object in which the result will be stored.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.computeView = function (position, direction, up, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"position\", position);\n  Check.typeOf.object(\"direction\", direction);\n  Check.typeOf.object(\"up\", up);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = right.x;\n  result[1] = up.x;\n  result[2] = -direction.x;\n  result[3] = 0.0;\n  result[4] = right.y;\n  result[5] = up.y;\n  result[6] = -direction.y;\n  result[7] = 0.0;\n  result[8] = right.z;\n  result[9] = up.z;\n  result[10] = -direction.z;\n  result[11] = 0.0;\n  result[12] = -Cartesian3.dot(right, position);\n  result[13] = -Cartesian3.dot(up, position);\n  result[14] = Cartesian3.dot(direction, position);\n  result[15] = 1.0;\n  return result;\n};\n\n/**\n * Computes an Array from the provided Matrix4 instance.\n * The array will be in column-major order.\n *\n * @param {Matrix4} matrix The matrix to use..\n * @param {number[]} [result] The Array onto which to store the result.\n * @returns {number[]} The modified Array parameter or a new Array instance if one was not provided.\n *\n * @example\n * //create an array from an instance of Matrix4\n * // m = [10.0, 14.0, 18.0, 22.0]\n * //     [11.0, 15.0, 19.0, 23.0]\n * //     [12.0, 16.0, 20.0, 24.0]\n * //     [13.0, 17.0, 21.0, 25.0]\n * const a = Cesium.Matrix4.toArray(m);\n *\n * // m remains the same\n * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0]\n */\nMatrix4.toArray = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return [\n      matrix[0],\n      matrix[1],\n      matrix[2],\n      matrix[3],\n      matrix[4],\n      matrix[5],\n      matrix[6],\n      matrix[7],\n      matrix[8],\n      matrix[9],\n      matrix[10],\n      matrix[11],\n      matrix[12],\n      matrix[13],\n      matrix[14],\n      matrix[15],\n    ];\n  }\n  result[0] = matrix[0];\n  result[1] = matrix[1];\n  result[2] = matrix[2];\n  result[3] = matrix[3];\n  result[4] = matrix[4];\n  result[5] = matrix[5];\n  result[6] = matrix[6];\n  result[7] = matrix[7];\n  result[8] = matrix[8];\n  result[9] = matrix[9];\n  result[10] = matrix[10];\n  result[11] = matrix[11];\n  result[12] = matrix[12];\n  result[13] = matrix[13];\n  result[14] = matrix[14];\n  result[15] = matrix[15];\n  return result;\n};\n\n/**\n * Computes the array index of the element at the provided row and column.\n *\n * @param {number} row The zero-based index of the row.\n * @param {number} column The zero-based index of the column.\n * @returns {number} The index of the element at the provided row and column.\n *\n * @exception {DeveloperError} row must be 0, 1, 2, or 3.\n * @exception {DeveloperError} column must be 0, 1, 2, or 3.\n *\n * @example\n * const myMatrix = new Cesium.Matrix4();\n * const column1Row0Index = Cesium.Matrix4.getElementIndex(1, 0);\n * const column1Row0 = myMatrix[column1Row0Index];\n * myMatrix[column1Row0Index] = 10.0;\n */\nMatrix4.getElementIndex = function (column, row) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThanOrEquals(\"row\", row, 0);\n  Check.typeOf.number.lessThanOrEquals(\"row\", row, 3);\n\n  Check.typeOf.number.greaterThanOrEquals(\"column\", column, 0);\n  Check.typeOf.number.lessThanOrEquals(\"column\", column, 3);\n  //>>includeEnd('debug');\n\n  return column * 4 + row;\n};\n\n/**\n * Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {number} index The zero-based index of the column to retrieve.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, 2, or 3.\n *\n * @example\n * //returns a Cartesian4 instance with values from the specified column\n * // m = [10.0, 11.0, 12.0, 13.0]\n * //     [14.0, 15.0, 16.0, 17.0]\n * //     [18.0, 19.0, 20.0, 21.0]\n * //     [22.0, 23.0, 24.0, 25.0]\n *\n * //Example 1: Creates an instance of Cartesian\n * const a = Cesium.Matrix4.getColumn(m, 2, new Cesium.Cartesian4());\n *\n * @example\n * //Example 2: Sets values for Cartesian instance\n * const a = new Cesium.Cartesian4();\n * Cesium.Matrix4.getColumn(m, 2, a);\n *\n * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0;\n */\nMatrix4.getColumn = function (matrix, index, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n\n  Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\n  Check.typeOf.number.lessThanOrEquals(\"index\", index, 3);\n\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const startIndex = index * 4;\n  const x = matrix[startIndex];\n  const y = matrix[startIndex + 1];\n  const z = matrix[startIndex + 2];\n  const w = matrix[startIndex + 3];\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  result.w = w;\n  return result;\n};\n\n/**\n * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian4 instance.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {number} index The zero-based index of the column to set.\n * @param {Cartesian4} cartesian The Cartesian whose values will be assigned to the specified column.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, 2, or 3.\n *\n * @example\n * //creates a new Matrix4 instance with new column values from the Cartesian4 instance\n * // m = [10.0, 11.0, 12.0, 13.0]\n * //     [14.0, 15.0, 16.0, 17.0]\n * //     [18.0, 19.0, 20.0, 21.0]\n * //     [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.setColumn(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [10.0, 11.0, 99.0, 13.0]\n * //     [14.0, 15.0, 98.0, 17.0]\n * //     [18.0, 19.0, 97.0, 21.0]\n * //     [22.0, 23.0, 96.0, 25.0]\n */\nMatrix4.setColumn = function (matrix, index, cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n\n  Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\n  Check.typeOf.number.lessThanOrEquals(\"index\", index, 3);\n\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result = Matrix4.clone(matrix, result);\n  const startIndex = index * 4;\n  result[startIndex] = cartesian.x;\n  result[startIndex + 1] = cartesian.y;\n  result[startIndex + 2] = cartesian.z;\n  result[startIndex + 3] = cartesian.w;\n  return result;\n};\n\n/**\n * Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {number} index The zero-based index of the row to retrieve.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, 2, or 3.\n *\n * @example\n * //returns a Cartesian4 instance with values from the specified column\n * // m = [10.0, 11.0, 12.0, 13.0]\n * //     [14.0, 15.0, 16.0, 17.0]\n * //     [18.0, 19.0, 20.0, 21.0]\n * //     [22.0, 23.0, 24.0, 25.0]\n *\n * //Example 1: Returns an instance of Cartesian\n * const a = Cesium.Matrix4.getRow(m, 2, new Cesium.Cartesian4());\n *\n * @example\n * //Example 2: Sets values for a Cartesian instance\n * const a = new Cesium.Cartesian4();\n * Cesium.Matrix4.getRow(m, 2, a);\n *\n * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0;\n */\nMatrix4.getRow = function (matrix, index, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n\n  Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\n  Check.typeOf.number.lessThanOrEquals(\"index\", index, 3);\n\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const x = matrix[index];\n  const y = matrix[index + 4];\n  const z = matrix[index + 8];\n  const w = matrix[index + 12];\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  result.w = w;\n  return result;\n};\n\n/**\n * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian4 instance.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {number} index The zero-based index of the row to set.\n * @param {Cartesian4} cartesian The Cartesian whose values will be assigned to the specified row.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, 2, or 3.\n *\n * @example\n * //create a new Matrix4 instance with new row values from the Cartesian4 instance\n * // m = [10.0, 11.0, 12.0, 13.0]\n * //     [14.0, 15.0, 16.0, 17.0]\n * //     [18.0, 19.0, 20.0, 21.0]\n * //     [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.setRow(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [10.0, 11.0, 12.0, 13.0]\n * //     [14.0, 15.0, 16.0, 17.0]\n * //     [99.0, 98.0, 97.0, 96.0]\n * //     [22.0, 23.0, 24.0, 25.0]\n */\nMatrix4.setRow = function (matrix, index, cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n\n  Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\n  Check.typeOf.number.lessThanOrEquals(\"index\", index, 3);\n\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result = Matrix4.clone(matrix, result);\n  result[index] = cartesian.x;\n  result[index + 4] = cartesian.y;\n  result[index + 8] = cartesian.z;\n  result[index + 12] = cartesian.w;\n  return result;\n};\n\n/**\n * Computes a new matrix that replaces the translation in the rightmost column of the provided\n * matrix with the provided translation. This assumes the matrix is an affine transformation.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Cartesian3} translation The translation that replaces the translation of the provided matrix.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.setTranslation = function (matrix, translation, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"translation\", translation);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = matrix[0];\n  result[1] = matrix[1];\n  result[2] = matrix[2];\n  result[3] = matrix[3];\n\n  result[4] = matrix[4];\n  result[5] = matrix[5];\n  result[6] = matrix[6];\n  result[7] = matrix[7];\n\n  result[8] = matrix[8];\n  result[9] = matrix[9];\n  result[10] = matrix[10];\n  result[11] = matrix[11];\n\n  result[12] = translation.x;\n  result[13] = translation.y;\n  result[14] = translation.z;\n  result[15] = matrix[15];\n\n  return result;\n};\n\nconst scaleScratch1 = new Cartesian3();\n\n/**\n * Computes a new matrix that replaces the scale with the provided scale.\n * This assumes the matrix is an affine transformation.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Cartesian3} scale The scale that replaces the scale of the provided matrix.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @see Matrix4.setUniformScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.multiplyByScale\n * @see Matrix4.multiplyByUniformScale\n * @see Matrix4.getScale\n */\nMatrix4.setScale = function (matrix, scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"scale\", scale);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const existingScale = Matrix4.getScale(matrix, scaleScratch1);\n  const scaleRatioX = scale.x / existingScale.x;\n  const scaleRatioY = scale.y / existingScale.y;\n  const scaleRatioZ = scale.z / existingScale.z;\n\n  result[0] = matrix[0] * scaleRatioX;\n  result[1] = matrix[1] * scaleRatioX;\n  result[2] = matrix[2] * scaleRatioX;\n  result[3] = matrix[3];\n\n  result[4] = matrix[4] * scaleRatioY;\n  result[5] = matrix[5] * scaleRatioY;\n  result[6] = matrix[6] * scaleRatioY;\n  result[7] = matrix[7];\n\n  result[8] = matrix[8] * scaleRatioZ;\n  result[9] = matrix[9] * scaleRatioZ;\n  result[10] = matrix[10] * scaleRatioZ;\n  result[11] = matrix[11];\n\n  result[12] = matrix[12];\n  result[13] = matrix[13];\n  result[14] = matrix[14];\n  result[15] = matrix[15];\n\n  return result;\n};\n\nconst scaleScratch2 = new Cartesian3();\n\n/**\n * Computes a new matrix that replaces the scale with the provided uniform scale.\n * This assumes the matrix is an affine transformation.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {number} scale The uniform scale that replaces the scale of the provided matrix.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @see Matrix4.setScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.multiplyByScale\n * @see Matrix4.multiplyByUniformScale\n * @see Matrix4.getScale\n */\nMatrix4.setUniformScale = function (matrix, scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.number(\"scale\", scale);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const existingScale = Matrix4.getScale(matrix, scaleScratch2);\n  const scaleRatioX = scale / existingScale.x;\n  const scaleRatioY = scale / existingScale.y;\n  const scaleRatioZ = scale / existingScale.z;\n\n  result[0] = matrix[0] * scaleRatioX;\n  result[1] = matrix[1] * scaleRatioX;\n  result[2] = matrix[2] * scaleRatioX;\n  result[3] = matrix[3];\n\n  result[4] = matrix[4] * scaleRatioY;\n  result[5] = matrix[5] * scaleRatioY;\n  result[6] = matrix[6] * scaleRatioY;\n  result[7] = matrix[7];\n\n  result[8] = matrix[8] * scaleRatioZ;\n  result[9] = matrix[9] * scaleRatioZ;\n  result[10] = matrix[10] * scaleRatioZ;\n  result[11] = matrix[11];\n\n  result[12] = matrix[12];\n  result[13] = matrix[13];\n  result[14] = matrix[14];\n  result[15] = matrix[15];\n\n  return result;\n};\n\nconst scratchColumn = new Cartesian3();\n\n/**\n * Extracts the non-uniform scale assuming the matrix is an affine transformation.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter\n *\n * @see Matrix4.multiplyByScale\n * @see Matrix4.multiplyByUniformScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.setScale\n * @see Matrix4.setUniformScale\n */\nMatrix4.getScale = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = Cartesian3.magnitude(\n    Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)\n  );\n  result.y = Cartesian3.magnitude(\n    Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)\n  );\n  result.z = Cartesian3.magnitude(\n    Cartesian3.fromElements(matrix[8], matrix[9], matrix[10], scratchColumn)\n  );\n  return result;\n};\n\nconst scaleScratch3 = new Cartesian3();\n\n/**\n * Computes the maximum scale assuming the matrix is an affine transformation.\n * The maximum scale is the maximum length of the column vectors in the upper-left\n * 3x3 matrix.\n *\n * @param {Matrix4} matrix The matrix.\n * @returns {number} The maximum scale.\n */\nMatrix4.getMaximumScale = function (matrix) {\n  Matrix4.getScale(matrix, scaleScratch3);\n  return Cartesian3.maximumComponent(scaleScratch3);\n};\n\nconst scaleScratch4 = new Cartesian3();\n\n/**\n * Sets the rotation assuming the matrix is an affine transformation.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Matrix3} rotation The rotation matrix.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @see Matrix4.fromRotation\n * @see Matrix4.getRotation\n */\nMatrix4.setRotation = function (matrix, rotation, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const scale = Matrix4.getScale(matrix, scaleScratch4);\n\n  result[0] = rotation[0] * scale.x;\n  result[1] = rotation[1] * scale.x;\n  result[2] = rotation[2] * scale.x;\n  result[3] = matrix[3];\n\n  result[4] = rotation[3] * scale.y;\n  result[5] = rotation[4] * scale.y;\n  result[6] = rotation[5] * scale.y;\n  result[7] = matrix[7];\n\n  result[8] = rotation[6] * scale.z;\n  result[9] = rotation[7] * scale.z;\n  result[10] = rotation[8] * scale.z;\n  result[11] = matrix[11];\n\n  result[12] = matrix[12];\n  result[13] = matrix[13];\n  result[14] = matrix[14];\n  result[15] = matrix[15];\n\n  return result;\n};\n\nconst scaleScratch5 = new Cartesian3();\n\n/**\n * Extracts the rotation matrix assuming the matrix is an affine transformation.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @see Matrix4.setRotation\n * @see Matrix4.fromRotation\n */\nMatrix4.getRotation = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const scale = Matrix4.getScale(matrix, scaleScratch5);\n\n  result[0] = matrix[0] / scale.x;\n  result[1] = matrix[1] / scale.x;\n  result[2] = matrix[2] / scale.x;\n\n  result[3] = matrix[4] / scale.y;\n  result[4] = matrix[5] / scale.y;\n  result[5] = matrix[6] / scale.y;\n\n  result[6] = matrix[8] / scale.z;\n  result[7] = matrix[9] / scale.z;\n  result[8] = matrix[10] / scale.z;\n\n  return result;\n};\n\n/**\n * Computes the product of two matrices.\n *\n * @param {Matrix4} left The first matrix.\n * @param {Matrix4} right The second matrix.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.multiply = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const left0 = left[0];\n  const left1 = left[1];\n  const left2 = left[2];\n  const left3 = left[3];\n  const left4 = left[4];\n  const left5 = left[5];\n  const left6 = left[6];\n  const left7 = left[7];\n  const left8 = left[8];\n  const left9 = left[9];\n  const left10 = left[10];\n  const left11 = left[11];\n  const left12 = left[12];\n  const left13 = left[13];\n  const left14 = left[14];\n  const left15 = left[15];\n\n  const right0 = right[0];\n  const right1 = right[1];\n  const right2 = right[2];\n  const right3 = right[3];\n  const right4 = right[4];\n  const right5 = right[5];\n  const right6 = right[6];\n  const right7 = right[7];\n  const right8 = right[8];\n  const right9 = right[9];\n  const right10 = right[10];\n  const right11 = right[11];\n  const right12 = right[12];\n  const right13 = right[13];\n  const right14 = right[14];\n  const right15 = right[15];\n\n  const column0Row0 =\n    left0 * right0 + left4 * right1 + left8 * right2 + left12 * right3;\n  const column0Row1 =\n    left1 * right0 + left5 * right1 + left9 * right2 + left13 * right3;\n  const column0Row2 =\n    left2 * right0 + left6 * right1 + left10 * right2 + left14 * right3;\n  const column0Row3 =\n    left3 * right0 + left7 * right1 + left11 * right2 + left15 * right3;\n\n  const column1Row0 =\n    left0 * right4 + left4 * right5 + left8 * right6 + left12 * right7;\n  const column1Row1 =\n    left1 * right4 + left5 * right5 + left9 * right6 + left13 * right7;\n  const column1Row2 =\n    left2 * right4 + left6 * right5 + left10 * right6 + left14 * right7;\n  const column1Row3 =\n    left3 * right4 + left7 * right5 + left11 * right6 + left15 * right7;\n\n  const column2Row0 =\n    left0 * right8 + left4 * right9 + left8 * right10 + left12 * right11;\n  const column2Row1 =\n    left1 * right8 + left5 * right9 + left9 * right10 + left13 * right11;\n  const column2Row2 =\n    left2 * right8 + left6 * right9 + left10 * right10 + left14 * right11;\n  const column2Row3 =\n    left3 * right8 + left7 * right9 + left11 * right10 + left15 * right11;\n\n  const column3Row0 =\n    left0 * right12 + left4 * right13 + left8 * right14 + left12 * right15;\n  const column3Row1 =\n    left1 * right12 + left5 * right13 + left9 * right14 + left13 * right15;\n  const column3Row2 =\n    left2 * right12 + left6 * right13 + left10 * right14 + left14 * right15;\n  const column3Row3 =\n    left3 * right12 + left7 * right13 + left11 * right14 + left15 * right15;\n\n  result[0] = column0Row0;\n  result[1] = column0Row1;\n  result[2] = column0Row2;\n  result[3] = column0Row3;\n  result[4] = column1Row0;\n  result[5] = column1Row1;\n  result[6] = column1Row2;\n  result[7] = column1Row3;\n  result[8] = column2Row0;\n  result[9] = column2Row1;\n  result[10] = column2Row2;\n  result[11] = column2Row3;\n  result[12] = column3Row0;\n  result[13] = column3Row1;\n  result[14] = column3Row2;\n  result[15] = column3Row3;\n  return result;\n};\n\n/**\n * Computes the sum of two matrices.\n *\n * @param {Matrix4} left The first matrix.\n * @param {Matrix4} right The second matrix.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.add = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = left[0] + right[0];\n  result[1] = left[1] + right[1];\n  result[2] = left[2] + right[2];\n  result[3] = left[3] + right[3];\n  result[4] = left[4] + right[4];\n  result[5] = left[5] + right[5];\n  result[6] = left[6] + right[6];\n  result[7] = left[7] + right[7];\n  result[8] = left[8] + right[8];\n  result[9] = left[9] + right[9];\n  result[10] = left[10] + right[10];\n  result[11] = left[11] + right[11];\n  result[12] = left[12] + right[12];\n  result[13] = left[13] + right[13];\n  result[14] = left[14] + right[14];\n  result[15] = left[15] + right[15];\n  return result;\n};\n\n/**\n * Computes the difference of two matrices.\n *\n * @param {Matrix4} left The first matrix.\n * @param {Matrix4} right The second matrix.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.subtract = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = left[0] - right[0];\n  result[1] = left[1] - right[1];\n  result[2] = left[2] - right[2];\n  result[3] = left[3] - right[3];\n  result[4] = left[4] - right[4];\n  result[5] = left[5] - right[5];\n  result[6] = left[6] - right[6];\n  result[7] = left[7] - right[7];\n  result[8] = left[8] - right[8];\n  result[9] = left[9] - right[9];\n  result[10] = left[10] - right[10];\n  result[11] = left[11] - right[11];\n  result[12] = left[12] - right[12];\n  result[13] = left[13] - right[13];\n  result[14] = left[14] - right[14];\n  result[15] = left[15] - right[15];\n  return result;\n};\n\n/**\n * Computes the product of two matrices assuming the matrices are affine transformation matrices,\n * where the upper left 3x3 elements are any matrix, and\n * the upper three elements in the fourth column are the translation.\n * The bottom row is assumed to be [0, 0, 0, 1].\n * The matrix is not verified to be in the proper form.\n * This method is faster than computing the product for general 4x4\n * matrices using {@link Matrix4.multiply}.\n *\n * @param {Matrix4} left The first matrix.\n * @param {Matrix4} right The second matrix.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * const m1 = new Cesium.Matrix4(1.0, 6.0, 7.0, 0.0, 2.0, 5.0, 8.0, 0.0, 3.0, 4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0);\n * const m2 = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(1.0, 1.0, 1.0));\n * const m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4());\n */\nMatrix4.multiplyTransformation = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const left0 = left[0];\n  const left1 = left[1];\n  const left2 = left[2];\n  const left4 = left[4];\n  const left5 = left[5];\n  const left6 = left[6];\n  const left8 = left[8];\n  const left9 = left[9];\n  const left10 = left[10];\n  const left12 = left[12];\n  const left13 = left[13];\n  const left14 = left[14];\n\n  const right0 = right[0];\n  const right1 = right[1];\n  const right2 = right[2];\n  const right4 = right[4];\n  const right5 = right[5];\n  const right6 = right[6];\n  const right8 = right[8];\n  const right9 = right[9];\n  const right10 = right[10];\n  const right12 = right[12];\n  const right13 = right[13];\n  const right14 = right[14];\n\n  const column0Row0 = left0 * right0 + left4 * right1 + left8 * right2;\n  const column0Row1 = left1 * right0 + left5 * right1 + left9 * right2;\n  const column0Row2 = left2 * right0 + left6 * right1 + left10 * right2;\n\n  const column1Row0 = left0 * right4 + left4 * right5 + left8 * right6;\n  const column1Row1 = left1 * right4 + left5 * right5 + left9 * right6;\n  const column1Row2 = left2 * right4 + left6 * right5 + left10 * right6;\n\n  const column2Row0 = left0 * right8 + left4 * right9 + left8 * right10;\n  const column2Row1 = left1 * right8 + left5 * right9 + left9 * right10;\n  const column2Row2 = left2 * right8 + left6 * right9 + left10 * right10;\n\n  const column3Row0 =\n    left0 * right12 + left4 * right13 + left8 * right14 + left12;\n  const column3Row1 =\n    left1 * right12 + left5 * right13 + left9 * right14 + left13;\n  const column3Row2 =\n    left2 * right12 + left6 * right13 + left10 * right14 + left14;\n\n  result[0] = column0Row0;\n  result[1] = column0Row1;\n  result[2] = column0Row2;\n  result[3] = 0.0;\n  result[4] = column1Row0;\n  result[5] = column1Row1;\n  result[6] = column1Row2;\n  result[7] = 0.0;\n  result[8] = column2Row0;\n  result[9] = column2Row1;\n  result[10] = column2Row2;\n  result[11] = 0.0;\n  result[12] = column3Row0;\n  result[13] = column3Row1;\n  result[14] = column3Row2;\n  result[15] = 1.0;\n  return result;\n};\n\n/**\n * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)\n * by a 3x3 rotation matrix.  This is an optimization\n * for <code>Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m);</code> with less allocations and arithmetic operations.\n *\n * @param {Matrix4} matrix The matrix on the left-hand side.\n * @param {Matrix3} rotation The 3x3 rotation matrix on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m);\n * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m);\n */\nMatrix4.multiplyByMatrix3 = function (matrix, rotation, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"rotation\", rotation);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const left0 = matrix[0];\n  const left1 = matrix[1];\n  const left2 = matrix[2];\n  const left4 = matrix[4];\n  const left5 = matrix[5];\n  const left6 = matrix[6];\n  const left8 = matrix[8];\n  const left9 = matrix[9];\n  const left10 = matrix[10];\n\n  const right0 = rotation[0];\n  const right1 = rotation[1];\n  const right2 = rotation[2];\n  const right4 = rotation[3];\n  const right5 = rotation[4];\n  const right6 = rotation[5];\n  const right8 = rotation[6];\n  const right9 = rotation[7];\n  const right10 = rotation[8];\n\n  const column0Row0 = left0 * right0 + left4 * right1 + left8 * right2;\n  const column0Row1 = left1 * right0 + left5 * right1 + left9 * right2;\n  const column0Row2 = left2 * right0 + left6 * right1 + left10 * right2;\n\n  const column1Row0 = left0 * right4 + left4 * right5 + left8 * right6;\n  const column1Row1 = left1 * right4 + left5 * right5 + left9 * right6;\n  const column1Row2 = left2 * right4 + left6 * right5 + left10 * right6;\n\n  const column2Row0 = left0 * right8 + left4 * right9 + left8 * right10;\n  const column2Row1 = left1 * right8 + left5 * right9 + left9 * right10;\n  const column2Row2 = left2 * right8 + left6 * right9 + left10 * right10;\n\n  result[0] = column0Row0;\n  result[1] = column0Row1;\n  result[2] = column0Row2;\n  result[3] = 0.0;\n  result[4] = column1Row0;\n  result[5] = column1Row1;\n  result[6] = column1Row2;\n  result[7] = 0.0;\n  result[8] = column2Row0;\n  result[9] = column2Row1;\n  result[10] = column2Row2;\n  result[11] = 0.0;\n  result[12] = matrix[12];\n  result[13] = matrix[13];\n  result[14] = matrix[14];\n  result[15] = matrix[15];\n  return result;\n};\n\n/**\n * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)\n * by an implicit translation matrix defined by a {@link Cartesian3}.  This is an optimization\n * for <code>Matrix4.multiply(m, Matrix4.fromTranslation(position), m);</code> with less allocations and arithmetic operations.\n *\n * @param {Matrix4} matrix The matrix on the left-hand side.\n * @param {Cartesian3} translation The translation on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m);\n * Cesium.Matrix4.multiplyByTranslation(m, position, m);\n */\nMatrix4.multiplyByTranslation = function (matrix, translation, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"translation\", translation);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const x = translation.x;\n  const y = translation.y;\n  const z = translation.z;\n\n  const tx = x * matrix[0] + y * matrix[4] + z * matrix[8] + matrix[12];\n  const ty = x * matrix[1] + y * matrix[5] + z * matrix[9] + matrix[13];\n  const tz = x * matrix[2] + y * matrix[6] + z * matrix[10] + matrix[14];\n\n  result[0] = matrix[0];\n  result[1] = matrix[1];\n  result[2] = matrix[2];\n  result[3] = matrix[3];\n  result[4] = matrix[4];\n  result[5] = matrix[5];\n  result[6] = matrix[6];\n  result[7] = matrix[7];\n  result[8] = matrix[8];\n  result[9] = matrix[9];\n  result[10] = matrix[10];\n  result[11] = matrix[11];\n  result[12] = tx;\n  result[13] = ty;\n  result[14] = tz;\n  result[15] = matrix[15];\n  return result;\n};\n\n/**\n * Multiplies an affine transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)\n * by an implicit non-uniform scale matrix. This is an optimization\n * for <code>Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);</code>, where\n * <code>m</code> must be an affine matrix.\n * This function performs fewer allocations and arithmetic operations.\n *\n * @param {Matrix4} matrix The affine matrix on the left-hand side.\n * @param {Cartesian3} scale The non-uniform scale on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m);\n * Cesium.Matrix4.multiplyByScale(m, scale, m);\n *\n * @see Matrix4.multiplyByUniformScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.setScale\n * @see Matrix4.setUniformScale\n * @see Matrix4.getScale\n */\nMatrix4.multiplyByScale = function (matrix, scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"scale\", scale);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const scaleX = scale.x;\n  const scaleY = scale.y;\n  const scaleZ = scale.z;\n\n  // Faster than Cartesian3.equals\n  if (scaleX === 1.0 && scaleY === 1.0 && scaleZ === 1.0) {\n    return Matrix4.clone(matrix, result);\n  }\n\n  result[0] = scaleX * matrix[0];\n  result[1] = scaleX * matrix[1];\n  result[2] = scaleX * matrix[2];\n  result[3] = matrix[3];\n\n  result[4] = scaleY * matrix[4];\n  result[5] = scaleY * matrix[5];\n  result[6] = scaleY * matrix[6];\n  result[7] = matrix[7];\n\n  result[8] = scaleZ * matrix[8];\n  result[9] = scaleZ * matrix[9];\n  result[10] = scaleZ * matrix[10];\n  result[11] = matrix[11];\n\n  result[12] = matrix[12];\n  result[13] = matrix[13];\n  result[14] = matrix[14];\n  result[15] = matrix[15];\n\n  return result;\n};\n\n/**\n * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.\n *\n * @param {Matrix4} matrix The matrix on the left-hand side.\n * @param {number} scale The uniform scale on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m);\n * Cesium.Matrix4.multiplyByUniformScale(m, scale, m);\n *\n * @see Matrix4.multiplyByScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.setScale\n * @see Matrix4.setUniformScale\n * @see Matrix4.getScale\n */\nMatrix4.multiplyByUniformScale = function (matrix, scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.number(\"scale\", scale);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = matrix[0] * scale;\n  result[1] = matrix[1] * scale;\n  result[2] = matrix[2] * scale;\n  result[3] = matrix[3];\n\n  result[4] = matrix[4] * scale;\n  result[5] = matrix[5] * scale;\n  result[6] = matrix[6] * scale;\n  result[7] = matrix[7];\n\n  result[8] = matrix[8] * scale;\n  result[9] = matrix[9] * scale;\n  result[10] = matrix[10] * scale;\n  result[11] = matrix[11];\n\n  result[12] = matrix[12];\n  result[13] = matrix[13];\n  result[14] = matrix[14];\n  result[15] = matrix[15];\n\n  return result;\n};\n\n/**\n * Computes the product of a matrix and a column vector.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian4} cartesian The vector.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nMatrix4.multiplyByVector = function (matrix, cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const vX = cartesian.x;\n  const vY = cartesian.y;\n  const vZ = cartesian.z;\n  const vW = cartesian.w;\n\n  const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12] * vW;\n  const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13] * vW;\n  const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14] * vW;\n  const w = matrix[3] * vX + matrix[7] * vY + matrix[11] * vZ + matrix[15] * vW;\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  result.w = w;\n  return result;\n};\n\n/**\n * Computes the product of a matrix and a {@link Cartesian3}.  This is equivalent to calling {@link Matrix4.multiplyByVector}\n * with a {@link Cartesian4} with a <code>w</code> component of zero.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian3} cartesian The point.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @example\n * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);\n * const result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3());\n * // A shortcut for\n * //   Cartesian3 p = ...\n * //   Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result);\n */\nMatrix4.multiplyByPointAsVector = function (matrix, cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const vX = cartesian.x;\n  const vY = cartesian.y;\n  const vZ = cartesian.z;\n\n  const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ;\n  const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ;\n  const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ;\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  return result;\n};\n\n/**\n * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}\n * with a {@link Cartesian4} with a <code>w</code> component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian3} cartesian The point.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @example\n * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);\n * const result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3());\n */\nMatrix4.multiplyByPoint = function (matrix, cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const vX = cartesian.x;\n  const vY = cartesian.y;\n  const vZ = cartesian.z;\n\n  const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12];\n  const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13];\n  const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14];\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  return result;\n};\n\n/**\n * Computes the product of a matrix and a scalar.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {number} scalar The number to multiply by.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * //create a Matrix4 instance which is a scaled version of the supplied Matrix4\n * // m = [10.0, 11.0, 12.0, 13.0]\n * //     [14.0, 15.0, 16.0, 17.0]\n * //     [18.0, 19.0, 20.0, 21.0]\n * //     [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [-20.0, -22.0, -24.0, -26.0]\n * //     [-28.0, -30.0, -32.0, -34.0]\n * //     [-36.0, -38.0, -40.0, -42.0]\n * //     [-44.0, -46.0, -48.0, -50.0]\n */\nMatrix4.multiplyByScalar = function (matrix, scalar, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.number(\"scalar\", scalar);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = matrix[0] * scalar;\n  result[1] = matrix[1] * scalar;\n  result[2] = matrix[2] * scalar;\n  result[3] = matrix[3] * scalar;\n  result[4] = matrix[4] * scalar;\n  result[5] = matrix[5] * scalar;\n  result[6] = matrix[6] * scalar;\n  result[7] = matrix[7] * scalar;\n  result[8] = matrix[8] * scalar;\n  result[9] = matrix[9] * scalar;\n  result[10] = matrix[10] * scalar;\n  result[11] = matrix[11] * scalar;\n  result[12] = matrix[12] * scalar;\n  result[13] = matrix[13] * scalar;\n  result[14] = matrix[14] * scalar;\n  result[15] = matrix[15] * scalar;\n  return result;\n};\n\n/**\n * Computes a negated copy of the provided matrix.\n *\n * @param {Matrix4} matrix The matrix to negate.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * //create a new Matrix4 instance which is a negation of a Matrix4\n * // m = [10.0, 11.0, 12.0, 13.0]\n * //     [14.0, 15.0, 16.0, 17.0]\n * //     [18.0, 19.0, 20.0, 21.0]\n * //     [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.negate(m, new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [-10.0, -11.0, -12.0, -13.0]\n * //     [-14.0, -15.0, -16.0, -17.0]\n * //     [-18.0, -19.0, -20.0, -21.0]\n * //     [-22.0, -23.0, -24.0, -25.0]\n */\nMatrix4.negate = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = -matrix[0];\n  result[1] = -matrix[1];\n  result[2] = -matrix[2];\n  result[3] = -matrix[3];\n  result[4] = -matrix[4];\n  result[5] = -matrix[5];\n  result[6] = -matrix[6];\n  result[7] = -matrix[7];\n  result[8] = -matrix[8];\n  result[9] = -matrix[9];\n  result[10] = -matrix[10];\n  result[11] = -matrix[11];\n  result[12] = -matrix[12];\n  result[13] = -matrix[13];\n  result[14] = -matrix[14];\n  result[15] = -matrix[15];\n  return result;\n};\n\n/**\n * Computes the transpose of the provided matrix.\n *\n * @param {Matrix4} matrix The matrix to transpose.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * //returns transpose of a Matrix4\n * // m = [10.0, 11.0, 12.0, 13.0]\n * //     [14.0, 15.0, 16.0, 17.0]\n * //     [18.0, 19.0, 20.0, 21.0]\n * //     [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [10.0, 14.0, 18.0, 22.0]\n * //     [11.0, 15.0, 19.0, 23.0]\n * //     [12.0, 16.0, 20.0, 24.0]\n * //     [13.0, 17.0, 21.0, 25.0]\n */\nMatrix4.transpose = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const matrix1 = matrix[1];\n  const matrix2 = matrix[2];\n  const matrix3 = matrix[3];\n  const matrix6 = matrix[6];\n  const matrix7 = matrix[7];\n  const matrix11 = matrix[11];\n\n  result[0] = matrix[0];\n  result[1] = matrix[4];\n  result[2] = matrix[8];\n  result[3] = matrix[12];\n  result[4] = matrix1;\n  result[5] = matrix[5];\n  result[6] = matrix[9];\n  result[7] = matrix[13];\n  result[8] = matrix2;\n  result[9] = matrix6;\n  result[10] = matrix[10];\n  result[11] = matrix[14];\n  result[12] = matrix3;\n  result[13] = matrix7;\n  result[14] = matrix11;\n  result[15] = matrix[15];\n  return result;\n};\n\n/**\n * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.\n *\n * @param {Matrix4} matrix The matrix with signed elements.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.abs = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = Math.abs(matrix[0]);\n  result[1] = Math.abs(matrix[1]);\n  result[2] = Math.abs(matrix[2]);\n  result[3] = Math.abs(matrix[3]);\n  result[4] = Math.abs(matrix[4]);\n  result[5] = Math.abs(matrix[5]);\n  result[6] = Math.abs(matrix[6]);\n  result[7] = Math.abs(matrix[7]);\n  result[8] = Math.abs(matrix[8]);\n  result[9] = Math.abs(matrix[9]);\n  result[10] = Math.abs(matrix[10]);\n  result[11] = Math.abs(matrix[11]);\n  result[12] = Math.abs(matrix[12]);\n  result[13] = Math.abs(matrix[13]);\n  result[14] = Math.abs(matrix[14]);\n  result[15] = Math.abs(matrix[15]);\n\n  return result;\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Matrix4} [left] The first matrix.\n * @param {Matrix4} [right] The second matrix.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n *\n * @example\n * //compares two Matrix4 instances\n *\n * // a = [10.0, 14.0, 18.0, 22.0]\n * //     [11.0, 15.0, 19.0, 23.0]\n * //     [12.0, 16.0, 20.0, 24.0]\n * //     [13.0, 17.0, 21.0, 25.0]\n *\n * // b = [10.0, 14.0, 18.0, 22.0]\n * //     [11.0, 15.0, 19.0, 23.0]\n * //     [12.0, 16.0, 20.0, 24.0]\n * //     [13.0, 17.0, 21.0, 25.0]\n *\n * if(Cesium.Matrix4.equals(a,b)) {\n *      console.log(\"Both matrices are equal\");\n * } else {\n *      console.log(\"They are not equal\");\n * }\n *\n * //Prints \"Both matrices are equal\" on the console\n */\nMatrix4.equals = function (left, right) {\n  // Given that most matrices will be transformation matrices, the elements\n  // are tested in order such that the test is likely to fail as early\n  // as possible.  I _think_ this is just as friendly to the L1 cache\n  // as testing in index order.  It is certainty faster in practice.\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      // Translation\n      left[12] === right[12] &&\n      left[13] === right[13] &&\n      left[14] === right[14] &&\n      // Rotation/scale\n      left[0] === right[0] &&\n      left[1] === right[1] &&\n      left[2] === right[2] &&\n      left[4] === right[4] &&\n      left[5] === right[5] &&\n      left[6] === right[6] &&\n      left[8] === right[8] &&\n      left[9] === right[9] &&\n      left[10] === right[10] &&\n      // Bottom row\n      left[3] === right[3] &&\n      left[7] === right[7] &&\n      left[11] === right[11] &&\n      left[15] === right[15])\n  );\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Matrix4} [left] The first matrix.\n * @param {Matrix4} [right] The second matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n *\n * @example\n * //compares two Matrix4 instances\n *\n * // a = [10.5, 14.5, 18.5, 22.5]\n * //     [11.5, 15.5, 19.5, 23.5]\n * //     [12.5, 16.5, 20.5, 24.5]\n * //     [13.5, 17.5, 21.5, 25.5]\n *\n * // b = [10.0, 14.0, 18.0, 22.0]\n * //     [11.0, 15.0, 19.0, 23.0]\n * //     [12.0, 16.0, 20.0, 24.0]\n * //     [13.0, 17.0, 21.0, 25.0]\n *\n * if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){\n *      console.log(\"Difference between both the matrices is less than 0.1\");\n * } else {\n *      console.log(\"Difference between both the matrices is not less than 0.1\");\n * }\n *\n * //Prints \"Difference between both the matrices is not less than 0.1\" on the console\n */\nMatrix4.equalsEpsilon = function (left, right, epsilon) {\n  epsilon = defaultValue(epsilon, 0);\n\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      Math.abs(left[0] - right[0]) <= epsilon &&\n      Math.abs(left[1] - right[1]) <= epsilon &&\n      Math.abs(left[2] - right[2]) <= epsilon &&\n      Math.abs(left[3] - right[3]) <= epsilon &&\n      Math.abs(left[4] - right[4]) <= epsilon &&\n      Math.abs(left[5] - right[5]) <= epsilon &&\n      Math.abs(left[6] - right[6]) <= epsilon &&\n      Math.abs(left[7] - right[7]) <= epsilon &&\n      Math.abs(left[8] - right[8]) <= epsilon &&\n      Math.abs(left[9] - right[9]) <= epsilon &&\n      Math.abs(left[10] - right[10]) <= epsilon &&\n      Math.abs(left[11] - right[11]) <= epsilon &&\n      Math.abs(left[12] - right[12]) <= epsilon &&\n      Math.abs(left[13] - right[13]) <= epsilon &&\n      Math.abs(left[14] - right[14]) <= epsilon &&\n      Math.abs(left[15] - right[15]) <= epsilon)\n  );\n};\n\n/**\n * Gets the translation portion of the provided matrix, assuming the matrix is an affine transformation matrix.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nMatrix4.getTranslation = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = matrix[12];\n  result.y = matrix[13];\n  result.z = matrix[14];\n  return result;\n};\n\n/**\n * Gets the upper left 3x3 matrix of the provided matrix.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @example\n * // returns a Matrix3 instance from a Matrix4 instance\n *\n * // m = [10.0, 14.0, 18.0, 22.0]\n * //     [11.0, 15.0, 19.0, 23.0]\n * //     [12.0, 16.0, 20.0, 24.0]\n * //     [13.0, 17.0, 21.0, 25.0]\n *\n * const b = new Cesium.Matrix3();\n * Cesium.Matrix4.getMatrix3(m,b);\n *\n * // b = [10.0, 14.0, 18.0]\n * //     [11.0, 15.0, 19.0]\n * //     [12.0, 16.0, 20.0]\n */\nMatrix4.getMatrix3 = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = matrix[0];\n  result[1] = matrix[1];\n  result[2] = matrix[2];\n  result[3] = matrix[4];\n  result[4] = matrix[5];\n  result[5] = matrix[6];\n  result[6] = matrix[8];\n  result[7] = matrix[9];\n  result[8] = matrix[10];\n  return result;\n};\n\nconst scratchInverseRotation = new Matrix3();\nconst scratchMatrix3Zero = new Matrix3();\nconst scratchBottomRow = new Cartesian4();\nconst scratchExpectedBottomRow = new Cartesian4(0.0, 0.0, 0.0, 1.0);\n\n/**\n * Computes the inverse of the provided matrix using Cramers Rule.\n * If the determinant is zero, the matrix can not be inverted, and an exception is thrown.\n * If the matrix is a proper rigid transformation, it is more efficient\n * to invert it with {@link Matrix4.inverseTransformation}.\n *\n * @param {Matrix4} matrix The matrix to invert.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @exception {RuntimeError} matrix is not invertible because its determinate is zero.\n */\nMatrix4.inverse = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n  //\n  // Ported from:\n  //   ftp://download.intel.com/design/PentiumIII/sml/24504301.pdf\n  //\n  const src0 = matrix[0];\n  const src1 = matrix[4];\n  const src2 = matrix[8];\n  const src3 = matrix[12];\n  const src4 = matrix[1];\n  const src5 = matrix[5];\n  const src6 = matrix[9];\n  const src7 = matrix[13];\n  const src8 = matrix[2];\n  const src9 = matrix[6];\n  const src10 = matrix[10];\n  const src11 = matrix[14];\n  const src12 = matrix[3];\n  const src13 = matrix[7];\n  const src14 = matrix[11];\n  const src15 = matrix[15];\n\n  // calculate pairs for first 8 elements (cofactors)\n  let tmp0 = src10 * src15;\n  let tmp1 = src11 * src14;\n  let tmp2 = src9 * src15;\n  let tmp3 = src11 * src13;\n  let tmp4 = src9 * src14;\n  let tmp5 = src10 * src13;\n  let tmp6 = src8 * src15;\n  let tmp7 = src11 * src12;\n  let tmp8 = src8 * src14;\n  let tmp9 = src10 * src12;\n  let tmp10 = src8 * src13;\n  let tmp11 = src9 * src12;\n\n  // calculate first 8 elements (cofactors)\n  const dst0 =\n    tmp0 * src5 +\n    tmp3 * src6 +\n    tmp4 * src7 -\n    (tmp1 * src5 + tmp2 * src6 + tmp5 * src7);\n  const dst1 =\n    tmp1 * src4 +\n    tmp6 * src6 +\n    tmp9 * src7 -\n    (tmp0 * src4 + tmp7 * src6 + tmp8 * src7);\n  const dst2 =\n    tmp2 * src4 +\n    tmp7 * src5 +\n    tmp10 * src7 -\n    (tmp3 * src4 + tmp6 * src5 + tmp11 * src7);\n  const dst3 =\n    tmp5 * src4 +\n    tmp8 * src5 +\n    tmp11 * src6 -\n    (tmp4 * src4 + tmp9 * src5 + tmp10 * src6);\n  const dst4 =\n    tmp1 * src1 +\n    tmp2 * src2 +\n    tmp5 * src3 -\n    (tmp0 * src1 + tmp3 * src2 + tmp4 * src3);\n  const dst5 =\n    tmp0 * src0 +\n    tmp7 * src2 +\n    tmp8 * src3 -\n    (tmp1 * src0 + tmp6 * src2 + tmp9 * src3);\n  const dst6 =\n    tmp3 * src0 +\n    tmp6 * src1 +\n    tmp11 * src3 -\n    (tmp2 * src0 + tmp7 * src1 + tmp10 * src3);\n  const dst7 =\n    tmp4 * src0 +\n    tmp9 * src1 +\n    tmp10 * src2 -\n    (tmp5 * src0 + tmp8 * src1 + tmp11 * src2);\n\n  // calculate pairs for second 8 elements (cofactors)\n  tmp0 = src2 * src7;\n  tmp1 = src3 * src6;\n  tmp2 = src1 * src7;\n  tmp3 = src3 * src5;\n  tmp4 = src1 * src6;\n  tmp5 = src2 * src5;\n  tmp6 = src0 * src7;\n  tmp7 = src3 * src4;\n  tmp8 = src0 * src6;\n  tmp9 = src2 * src4;\n  tmp10 = src0 * src5;\n  tmp11 = src1 * src4;\n\n  // calculate second 8 elements (cofactors)\n  const dst8 =\n    tmp0 * src13 +\n    tmp3 * src14 +\n    tmp4 * src15 -\n    (tmp1 * src13 + tmp2 * src14 + tmp5 * src15);\n  const dst9 =\n    tmp1 * src12 +\n    tmp6 * src14 +\n    tmp9 * src15 -\n    (tmp0 * src12 + tmp7 * src14 + tmp8 * src15);\n  const dst10 =\n    tmp2 * src12 +\n    tmp7 * src13 +\n    tmp10 * src15 -\n    (tmp3 * src12 + tmp6 * src13 + tmp11 * src15);\n  const dst11 =\n    tmp5 * src12 +\n    tmp8 * src13 +\n    tmp11 * src14 -\n    (tmp4 * src12 + tmp9 * src13 + tmp10 * src14);\n  const dst12 =\n    tmp2 * src10 +\n    tmp5 * src11 +\n    tmp1 * src9 -\n    (tmp4 * src11 + tmp0 * src9 + tmp3 * src10);\n  const dst13 =\n    tmp8 * src11 +\n    tmp0 * src8 +\n    tmp7 * src10 -\n    (tmp6 * src10 + tmp9 * src11 + tmp1 * src8);\n  const dst14 =\n    tmp6 * src9 +\n    tmp11 * src11 +\n    tmp3 * src8 -\n    (tmp10 * src11 + tmp2 * src8 + tmp7 * src9);\n  const dst15 =\n    tmp10 * src10 +\n    tmp4 * src8 +\n    tmp9 * src9 -\n    (tmp8 * src9 + tmp11 * src10 + tmp5 * src8);\n\n  // calculate determinant\n  let det = src0 * dst0 + src1 * dst1 + src2 * dst2 + src3 * dst3;\n\n  if (Math.abs(det) < CesiumMath.EPSILON21) {\n    // Special case for a zero scale matrix that can occur, for example,\n    // when a model's node has a [0, 0, 0] scale.\n    if (\n      Matrix3.equalsEpsilon(\n        Matrix4.getMatrix3(matrix, scratchInverseRotation),\n        scratchMatrix3Zero,\n        CesiumMath.EPSILON7\n      ) &&\n      Cartesian4.equals(\n        Matrix4.getRow(matrix, 3, scratchBottomRow),\n        scratchExpectedBottomRow\n      )\n    ) {\n      result[0] = 0.0;\n      result[1] = 0.0;\n      result[2] = 0.0;\n      result[3] = 0.0;\n      result[4] = 0.0;\n      result[5] = 0.0;\n      result[6] = 0.0;\n      result[7] = 0.0;\n      result[8] = 0.0;\n      result[9] = 0.0;\n      result[10] = 0.0;\n      result[11] = 0.0;\n      result[12] = -matrix[12];\n      result[13] = -matrix[13];\n      result[14] = -matrix[14];\n      result[15] = 1.0;\n      return result;\n    }\n\n    throw new RuntimeError(\n      \"matrix is not invertible because its determinate is zero.\"\n    );\n  }\n\n  // calculate matrix inverse\n  det = 1.0 / det;\n\n  result[0] = dst0 * det;\n  result[1] = dst1 * det;\n  result[2] = dst2 * det;\n  result[3] = dst3 * det;\n  result[4] = dst4 * det;\n  result[5] = dst5 * det;\n  result[6] = dst6 * det;\n  result[7] = dst7 * det;\n  result[8] = dst8 * det;\n  result[9] = dst9 * det;\n  result[10] = dst10 * det;\n  result[11] = dst11 * det;\n  result[12] = dst12 * det;\n  result[13] = dst13 * det;\n  result[14] = dst14 * det;\n  result[15] = dst15 * det;\n  return result;\n};\n\n/**\n * Computes the inverse of the provided matrix assuming it is a proper rigid matrix,\n * where the upper left 3x3 elements are a rotation matrix,\n * and the upper three elements in the fourth column are the translation.\n * The bottom row is assumed to be [0, 0, 0, 1].\n * The matrix is not verified to be in the proper form.\n * This method is faster than computing the inverse for a general 4x4\n * matrix using {@link Matrix4.inverse}.\n *\n * @param {Matrix4} matrix The matrix to invert.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.inverseTransformation = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  //This function is an optimized version of the below 4 lines.\n  //const rT = Matrix3.transpose(Matrix4.getMatrix3(matrix));\n  //const rTN = Matrix3.negate(rT);\n  //const rTT = Matrix3.multiplyByVector(rTN, Matrix4.getTranslation(matrix));\n  //return Matrix4.fromRotationTranslation(rT, rTT, result);\n\n  const matrix0 = matrix[0];\n  const matrix1 = matrix[1];\n  const matrix2 = matrix[2];\n  const matrix4 = matrix[4];\n  const matrix5 = matrix[5];\n  const matrix6 = matrix[6];\n  const matrix8 = matrix[8];\n  const matrix9 = matrix[9];\n  const matrix10 = matrix[10];\n\n  const vX = matrix[12];\n  const vY = matrix[13];\n  const vZ = matrix[14];\n\n  const x = -matrix0 * vX - matrix1 * vY - matrix2 * vZ;\n  const y = -matrix4 * vX - matrix5 * vY - matrix6 * vZ;\n  const z = -matrix8 * vX - matrix9 * vY - matrix10 * vZ;\n\n  result[0] = matrix0;\n  result[1] = matrix4;\n  result[2] = matrix8;\n  result[3] = 0.0;\n  result[4] = matrix1;\n  result[5] = matrix5;\n  result[6] = matrix9;\n  result[7] = 0.0;\n  result[8] = matrix2;\n  result[9] = matrix6;\n  result[10] = matrix10;\n  result[11] = 0.0;\n  result[12] = x;\n  result[13] = y;\n  result[14] = z;\n  result[15] = 1.0;\n  return result;\n};\n\nconst scratchTransposeMatrix = new Matrix4();\n\n/**\n * Computes the inverse transpose of a matrix.\n *\n * @param {Matrix4} matrix The matrix to transpose and invert.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.inverseTranspose = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  return Matrix4.inverse(\n    Matrix4.transpose(matrix, scratchTransposeMatrix),\n    result\n  );\n};\n\n/**\n * An immutable Matrix4 instance initialized to the identity matrix.\n *\n * @type {Matrix4}\n * @constant\n */\nMatrix4.IDENTITY = Object.freeze(\n  new Matrix4(\n    1.0,\n    0.0,\n    0.0,\n    0.0,\n    0.0,\n    1.0,\n    0.0,\n    0.0,\n    0.0,\n    0.0,\n    1.0,\n    0.0,\n    0.0,\n    0.0,\n    0.0,\n    1.0\n  )\n);\n\n/**\n * An immutable Matrix4 instance initialized to the zero matrix.\n *\n * @type {Matrix4}\n * @constant\n */\nMatrix4.ZERO = Object.freeze(\n  new Matrix4(\n    0.0,\n    0.0,\n    0.0,\n    0.0,\n    0.0,\n    0.0,\n    0.0,\n    0.0,\n    0.0,\n    0.0,\n    0.0,\n    0.0,\n    0.0,\n    0.0,\n    0.0,\n    0.0\n  )\n);\n\n/**\n * The index into Matrix4 for column 0, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN0ROW0 = 0;\n\n/**\n * The index into Matrix4 for column 0, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN0ROW1 = 1;\n\n/**\n * The index into Matrix4 for column 0, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN0ROW2 = 2;\n\n/**\n * The index into Matrix4 for column 0, row 3.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN0ROW3 = 3;\n\n/**\n * The index into Matrix4 for column 1, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN1ROW0 = 4;\n\n/**\n * The index into Matrix4 for column 1, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN1ROW1 = 5;\n\n/**\n * The index into Matrix4 for column 1, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN1ROW2 = 6;\n\n/**\n * The index into Matrix4 for column 1, row 3.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN1ROW3 = 7;\n\n/**\n * The index into Matrix4 for column 2, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN2ROW0 = 8;\n\n/**\n * The index into Matrix4 for column 2, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN2ROW1 = 9;\n\n/**\n * The index into Matrix4 for column 2, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN2ROW2 = 10;\n\n/**\n * The index into Matrix4 for column 2, row 3.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN2ROW3 = 11;\n\n/**\n * The index into Matrix4 for column 3, row 0.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN3ROW0 = 12;\n\n/**\n * The index into Matrix4 for column 3, row 1.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN3ROW1 = 13;\n\n/**\n * The index into Matrix4 for column 3, row 2.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN3ROW2 = 14;\n\n/**\n * The index into Matrix4 for column 3, row 3.\n *\n * @type {number}\n * @constant\n */\nMatrix4.COLUMN3ROW3 = 15;\n\nObject.defineProperties(Matrix4.prototype, {\n  /**\n   * Gets the number of items in the collection.\n   * @memberof Matrix4.prototype\n   *\n   * @type {number}\n   */\n  length: {\n    get: function () {\n      return Matrix4.packedLength;\n    },\n  },\n});\n\n/**\n * Duplicates the provided Matrix4 instance.\n *\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.\n */\nMatrix4.prototype.clone = function (result) {\n  return Matrix4.clone(this, result);\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Matrix4} [right] The right hand side matrix.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nMatrix4.prototype.equals = function (right) {\n  return Matrix4.equals(this, right);\n};\n\n/**\n * @private\n */\nMatrix4.equalsArray = function (matrix, array, offset) {\n  return (\n    matrix[0] === array[offset] &&\n    matrix[1] === array[offset + 1] &&\n    matrix[2] === array[offset + 2] &&\n    matrix[3] === array[offset + 3] &&\n    matrix[4] === array[offset + 4] &&\n    matrix[5] === array[offset + 5] &&\n    matrix[6] === array[offset + 6] &&\n    matrix[7] === array[offset + 7] &&\n    matrix[8] === array[offset + 8] &&\n    matrix[9] === array[offset + 9] &&\n    matrix[10] === array[offset + 10] &&\n    matrix[11] === array[offset + 11] &&\n    matrix[12] === array[offset + 12] &&\n    matrix[13] === array[offset + 13] &&\n    matrix[14] === array[offset + 14] &&\n    matrix[15] === array[offset + 15]\n  );\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Matrix4} [right] The right hand side matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nMatrix4.prototype.equalsEpsilon = function (right, epsilon) {\n  return Matrix4.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Computes a string representing this Matrix with each row being\n * on a separate line and in the format '(column0, column1, column2, column3)'.\n *\n * @returns {string} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.\n */\nMatrix4.prototype.toString = function () {\n  return (\n    `(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})\\n` +\n    `(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})\\n` +\n    `(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})\\n` +\n    `(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`\n  );\n};\nexport default Matrix4;\n", "/**\n * Enum containing WebGL Constant values by name.\n * for use without an active WebGL context, or in cases where certain constants are unavailable using the WebGL context\n * (For example, in [Safari 9]{@link https://github.com/CesiumGS/cesium/issues/2989}).\n *\n * These match the constants from the [WebGL 1.0]{@link https://www.khronos.org/registry/webgl/specs/latest/1.0/}\n * and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/}\n * specifications.\n *\n * @enum {number}\n */\nconst WebGLConstants = {\n  DEPTH_BUFFER_BIT: 0x00000100,\n  STENCIL_BUFFER_BIT: 0x00000400,\n  COLOR_BUFFER_BIT: 0x00004000,\n  POINTS: 0x0000,\n  LINES: 0x0001,\n  LINE_LOOP: 0x0002,\n  LINE_STRIP: 0x0003,\n  TRIANGLES: 0x0004,\n  TRIANGLE_STRIP: 0x0005,\n  TRIANGLE_FAN: 0x0006,\n  ZERO: 0,\n  ONE: 1,\n  SRC_COLOR: 0x0300,\n  ONE_MINUS_SRC_COLOR: 0x0301,\n  SRC_ALPHA: 0x0302,\n  ONE_MINUS_SRC_ALPHA: 0x0303,\n  DST_ALPHA: 0x0304,\n  ONE_MINUS_DST_ALPHA: 0x0305,\n  DST_COLOR: 0x0306,\n  ONE_MINUS_DST_COLOR: 0x0307,\n  SRC_ALPHA_SATURATE: 0x0308,\n  FUNC_ADD: 0x8006,\n  BLEND_EQUATION: 0x8009,\n  BLEND_EQUATION_RGB: 0x8009, // same as BLEND_EQUATION\n  BLEND_EQUATION_ALPHA: 0x883d,\n  FUNC_SUBTRACT: 0x800a,\n  FUNC_REVERSE_SUBTRACT: 0x800b,\n  BLEND_DST_RGB: 0x80c8,\n  BLEND_SRC_RGB: 0x80c9,\n  BLEND_DST_ALPHA: 0x80ca,\n  BLEND_SRC_ALPHA: 0x80cb,\n  CONSTANT_COLOR: 0x8001,\n  ONE_MINUS_CONSTANT_COLOR: 0x8002,\n  CONSTANT_ALPHA: 0x8003,\n  ONE_MINUS_CONSTANT_ALPHA: 0x8004,\n  BLEND_COLOR: 0x8005,\n  ARRAY_BUFFER: 0x8892,\n  ELEMENT_ARRAY_BUFFER: 0x8893,\n  ARRAY_BUFFER_BINDING: 0x8894,\n  ELEMENT_ARRAY_BUFFER_BINDING: 0x8895,\n  STREAM_DRAW: 0x88e0,\n  STATIC_DRAW: 0x88e4,\n  DYNAMIC_DRAW: 0x88e8,\n  BUFFER_SIZE: 0x8764,\n  BUFFER_USAGE: 0x8765,\n  CURRENT_VERTEX_ATTRIB: 0x8626,\n  FRONT: 0x0404,\n  BACK: 0x0405,\n  FRONT_AND_BACK: 0x0408,\n  CULL_FACE: 0x0b44,\n  BLEND: 0x0be2,\n  DITHER: 0x0bd0,\n  STENCIL_TEST: 0x0b90,\n  DEPTH_TEST: 0x0b71,\n  SCISSOR_TEST: 0x0c11,\n  POLYGON_OFFSET_FILL: 0x8037,\n  SAMPLE_ALPHA_TO_COVERAGE: 0x809e,\n  SAMPLE_COVERAGE: 0x80a0,\n  NO_ERROR: 0,\n  INVALID_ENUM: 0x0500,\n  INVALID_VALUE: 0x0501,\n  INVALID_OPERATION: 0x0502,\n  OUT_OF_MEMORY: 0x0505,\n  CW: 0x0900,\n  CCW: 0x0901,\n  LINE_WIDTH: 0x0b21,\n  ALIASED_POINT_SIZE_RANGE: 0x846d,\n  ALIASED_LINE_WIDTH_RANGE: 0x846e,\n  CULL_FACE_MODE: 0x0b45,\n  FRONT_FACE: 0x0b46,\n  DEPTH_RANGE: 0x0b70,\n  DEPTH_WRITEMASK: 0x0b72,\n  DEPTH_CLEAR_VALUE: 0x0b73,\n  DEPTH_FUNC: 0x0b74,\n  STENCIL_CLEAR_VALUE: 0x0b91,\n  STENCIL_FUNC: 0x0b92,\n  STENCIL_FAIL: 0x0b94,\n  STENCIL_PASS_DEPTH_FAIL: 0x0b95,\n  STENCIL_PASS_DEPTH_PASS: 0x0b96,\n  STENCIL_REF: 0x0b97,\n  STENCIL_VALUE_MASK: 0x0b93,\n  STENCIL_WRITEMASK: 0x0b98,\n  STENCIL_BACK_FUNC: 0x8800,\n  STENCIL_BACK_FAIL: 0x8801,\n  STENCIL_BACK_PASS_DEPTH_FAIL: 0x8802,\n  STENCIL_BACK_PASS_DEPTH_PASS: 0x8803,\n  STENCIL_BACK_REF: 0x8ca3,\n  STENCIL_BACK_VALUE_MASK: 0x8ca4,\n  STENCIL_BACK_WRITEMASK: 0x8ca5,\n  VIEWPORT: 0x0ba2,\n  SCISSOR_BOX: 0x0c10,\n  COLOR_CLEAR_VALUE: 0x0c22,\n  COLOR_WRITEMASK: 0x0c23,\n  UNPACK_ALIGNMENT: 0x0cf5,\n  PACK_ALIGNMENT: 0x0d05,\n  MAX_TEXTURE_SIZE: 0x0d33,\n  MAX_VIEWPORT_DIMS: 0x0d3a,\n  SUBPIXEL_BITS: 0x0d50,\n  RED_BITS: 0x0d52,\n  GREEN_BITS: 0x0d53,\n  BLUE_BITS: 0x0d54,\n  ALPHA_BITS: 0x0d55,\n  DEPTH_BITS: 0x0d56,\n  STENCIL_BITS: 0x0d57,\n  POLYGON_OFFSET_UNITS: 0x2a00,\n  POLYGON_OFFSET_FACTOR: 0x8038,\n  TEXTURE_BINDING_2D: 0x8069,\n  SAMPLE_BUFFERS: 0x80a8,\n  SAMPLES: 0x80a9,\n  SAMPLE_COVERAGE_VALUE: 0x80aa,\n  SAMPLE_COVERAGE_INVERT: 0x80ab,\n  COMPRESSED_TEXTURE_FORMATS: 0x86a3,\n  DONT_CARE: 0x1100,\n  FASTEST: 0x1101,\n  NICEST: 0x1102,\n  GENERATE_MIPMAP_HINT: 0x8192,\n  BYTE: 0x1400,\n  UNSIGNED_BYTE: 0x1401,\n  SHORT: 0x1402,\n  UNSIGNED_SHORT: 0x1403,\n  INT: 0x1404,\n  UNSIGNED_INT: 0x1405,\n  FLOAT: 0x1406,\n  DEPTH_COMPONENT: 0x1902,\n  ALPHA: 0x1906,\n  RGB: 0x1907,\n  RGBA: 0x1908,\n  LUMINANCE: 0x1909,\n  LUMINANCE_ALPHA: 0x190a,\n  UNSIGNED_SHORT_4_4_4_4: 0x8033,\n  UNSIGNED_SHORT_5_5_5_1: 0x8034,\n  UNSIGNED_SHORT_5_6_5: 0x8363,\n  FRAGMENT_SHADER: 0x8b30,\n  VERTEX_SHADER: 0x8b31,\n  MAX_VERTEX_ATTRIBS: 0x8869,\n  MAX_VERTEX_UNIFORM_VECTORS: 0x8dfb,\n  MAX_VARYING_VECTORS: 0x8dfc,\n  MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0x8b4d,\n  MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0x8b4c,\n  MAX_TEXTURE_IMAGE_UNITS: 0x8872,\n  MAX_FRAGMENT_UNIFORM_VECTORS: 0x8dfd,\n  SHADER_TYPE: 0x8b4f,\n  DELETE_STATUS: 0x8b80,\n  LINK_STATUS: 0x8b82,\n  VALIDATE_STATUS: 0x8b83,\n  ATTACHED_SHADERS: 0x8b85,\n  ACTIVE_UNIFORMS: 0x8b86,\n  ACTIVE_ATTRIBUTES: 0x8b89,\n  SHADING_LANGUAGE_VERSION: 0x8b8c,\n  CURRENT_PROGRAM: 0x8b8d,\n  NEVER: 0x0200,\n  LESS: 0x0201,\n  EQUAL: 0x0202,\n  LEQUAL: 0x0203,\n  GREATER: 0x0204,\n  NOTEQUAL: 0x0205,\n  GEQUAL: 0x0206,\n  ALWAYS: 0x0207,\n  KEEP: 0x1e00,\n  REPLACE: 0x1e01,\n  INCR: 0x1e02,\n  DECR: 0x1e03,\n  INVERT: 0x150a,\n  INCR_WRAP: 0x8507,\n  DECR_WRAP: 0x8508,\n  VENDOR: 0x1f00,\n  RENDERER: 0x1f01,\n  VERSION: 0x1f02,\n  NEAREST: 0x2600,\n  LINEAR: 0x2601,\n  NEAREST_MIPMAP_NEAREST: 0x2700,\n  LINEAR_MIPMAP_NEAREST: 0x2701,\n  NEAREST_MIPMAP_LINEAR: 0x2702,\n  LINEAR_MIPMAP_LINEAR: 0x2703,\n  TEXTURE_MAG_FILTER: 0x2800,\n  TEXTURE_MIN_FILTER: 0x2801,\n  TEXTURE_WRAP_S: 0x2802,\n  TEXTURE_WRAP_T: 0x2803,\n  TEXTURE_2D: 0x0de1,\n  TEXTURE: 0x1702,\n  TEXTURE_CUBE_MAP: 0x8513,\n  TEXTURE_BINDING_CUBE_MAP: 0x8514,\n  TEXTURE_CUBE_MAP_POSITIVE_X: 0x8515,\n  TEXTURE_CUBE_MAP_NEGATIVE_X: 0x8516,\n  TEXTURE_CUBE_MAP_POSITIVE_Y: 0x8517,\n  TEXTURE_CUBE_MAP_NEGATIVE_Y: 0x8518,\n  TEXTURE_CUBE_MAP_POSITIVE_Z: 0x8519,\n  TEXTURE_CUBE_MAP_NEGATIVE_Z: 0x851a,\n  MAX_CUBE_MAP_TEXTURE_SIZE: 0x851c,\n  TEXTURE0: 0x84c0,\n  TEXTURE1: 0x84c1,\n  TEXTURE2: 0x84c2,\n  TEXTURE3: 0x84c3,\n  TEXTURE4: 0x84c4,\n  TEXTURE5: 0x84c5,\n  TEXTURE6: 0x84c6,\n  TEXTURE7: 0x84c7,\n  TEXTURE8: 0x84c8,\n  TEXTURE9: 0x84c9,\n  TEXTURE10: 0x84ca,\n  TEXTURE11: 0x84cb,\n  TEXTURE12: 0x84cc,\n  TEXTURE13: 0x84cd,\n  TEXTURE14: 0x84ce,\n  TEXTURE15: 0x84cf,\n  TEXTURE16: 0x84d0,\n  TEXTURE17: 0x84d1,\n  TEXTURE18: 0x84d2,\n  TEXTURE19: 0x84d3,\n  TEXTURE20: 0x84d4,\n  TEXTURE21: 0x84d5,\n  TEXTURE22: 0x84d6,\n  TEXTURE23: 0x84d7,\n  TEXTURE24: 0x84d8,\n  TEXTURE25: 0x84d9,\n  TEXTURE26: 0x84da,\n  TEXTURE27: 0x84db,\n  TEXTURE28: 0x84dc,\n  TEXTURE29: 0x84dd,\n  TEXTURE30: 0x84de,\n  TEXTURE31: 0x84df,\n  ACTIVE_TEXTURE: 0x84e0,\n  REPEAT: 0x2901,\n  CLAMP_TO_EDGE: 0x812f,\n  MIRRORED_REPEAT: 0x8370,\n  FLOAT_VEC2: 0x8b50,\n  FLOAT_VEC3: 0x8b51,\n  FLOAT_VEC4: 0x8b52,\n  INT_VEC2: 0x8b53,\n  INT_VEC3: 0x8b54,\n  INT_VEC4: 0x8b55,\n  BOOL: 0x8b56,\n  BOOL_VEC2: 0x8b57,\n  BOOL_VEC3: 0x8b58,\n  BOOL_VEC4: 0x8b59,\n  FLOAT_MAT2: 0x8b5a,\n  FLOAT_MAT3: 0x8b5b,\n  FLOAT_MAT4: 0x8b5c,\n  SAMPLER_2D: 0x8b5e,\n  SAMPLER_CUBE: 0x8b60,\n  VERTEX_ATTRIB_ARRAY_ENABLED: 0x8622,\n  VERTEX_ATTRIB_ARRAY_SIZE: 0x8623,\n  VERTEX_ATTRIB_ARRAY_STRIDE: 0x8624,\n  VERTEX_ATTRIB_ARRAY_TYPE: 0x8625,\n  VERTEX_ATTRIB_ARRAY_NORMALIZED: 0x886a,\n  VERTEX_ATTRIB_ARRAY_POINTER: 0x8645,\n  VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: 0x889f,\n  IMPLEMENTATION_COLOR_READ_TYPE: 0x8b9a,\n  IMPLEMENTATION_COLOR_READ_FORMAT: 0x8b9b,\n  COMPILE_STATUS: 0x8b81,\n  LOW_FLOAT: 0x8df0,\n  MEDIUM_FLOAT: 0x8df1,\n  HIGH_FLOAT: 0x8df2,\n  LOW_INT: 0x8df3,\n  MEDIUM_INT: 0x8df4,\n  HIGH_INT: 0x8df5,\n  FRAMEBUFFER: 0x8d40,\n  RENDERBUFFER: 0x8d41,\n  RGBA4: 0x8056,\n  RGB5_A1: 0x8057,\n  RGB565: 0x8d62,\n  DEPTH_COMPONENT16: 0x81a5,\n  STENCIL_INDEX: 0x1901,\n  STENCIL_INDEX8: 0x8d48,\n  DEPTH_STENCIL: 0x84f9,\n  RENDERBUFFER_WIDTH: 0x8d42,\n  RENDERBUFFER_HEIGHT: 0x8d43,\n  RENDERBUFFER_INTERNAL_FORMAT: 0x8d44,\n  RENDERBUFFER_RED_SIZE: 0x8d50,\n  RENDERBUFFER_GREEN_SIZE: 0x8d51,\n  RENDERBUFFER_BLUE_SIZE: 0x8d52,\n  RENDERBUFFER_ALPHA_SIZE: 0x8d53,\n  RENDERBUFFER_DEPTH_SIZE: 0x8d54,\n  RENDERBUFFER_STENCIL_SIZE: 0x8d55,\n  FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: 0x8cd0,\n  FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: 0x8cd1,\n  FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: 0x8cd2,\n  FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: 0x8cd3,\n  COLOR_ATTACHMENT0: 0x8ce0,\n  DEPTH_ATTACHMENT: 0x8d00,\n  STENCIL_ATTACHMENT: 0x8d20,\n  DEPTH_STENCIL_ATTACHMENT: 0x821a,\n  NONE: 0,\n  FRAMEBUFFER_COMPLETE: 0x8cd5,\n  FRAMEBUFFER_INCOMPLETE_ATTACHMENT: 0x8cd6,\n  FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: 0x8cd7,\n  FRAMEBUFFER_INCOMPLETE_DIMENSIONS: 0x8cd9,\n  FRAMEBUFFER_UNSUPPORTED: 0x8cdd,\n  FRAMEBUFFER_BINDING: 0x8ca6,\n  RENDERBUFFER_BINDING: 0x8ca7,\n  MAX_RENDERBUFFER_SIZE: 0x84e8,\n  INVALID_FRAMEBUFFER_OPERATION: 0x0506,\n  UNPACK_FLIP_Y_WEBGL: 0x9240,\n  UNPACK_PREMULTIPLY_ALPHA_WEBGL: 0x9241,\n  CONTEXT_LOST_WEBGL: 0x9242,\n  UNPACK_COLORSPACE_CONVERSION_WEBGL: 0x9243,\n  BROWSER_DEFAULT_WEBGL: 0x9244,\n\n  // WEBGL_compressed_texture_s3tc\n  COMPRESSED_RGB_S3TC_DXT1_EXT: 0x83f0,\n  COMPRESSED_RGBA_S3TC_DXT1_EXT: 0x83f1,\n  COMPRESSED_RGBA_S3TC_DXT3_EXT: 0x83f2,\n  COMPRESSED_RGBA_S3TC_DXT5_EXT: 0x83f3,\n\n  // WEBGL_compressed_texture_pvrtc\n  COMPRESSED_RGB_PVRTC_4BPPV1_IMG: 0x8c00,\n  COMPRESSED_RGB_PVRTC_2BPPV1_IMG: 0x8c01,\n  COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: 0x8c02,\n  COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: 0x8c03,\n\n  // WEBGL_compressed_texture_astc\n  COMPRESSED_RGBA_ASTC_4x4_WEBGL: 0x93b0,\n\n  // WEBGL_compressed_texture_etc1\n  COMPRESSED_RGB_ETC1_WEBGL: 0x8d64,\n\n  // EXT_texture_compression_bptc\n  COMPRESSED_RGBA_BPTC_UNORM: 0x8e8c,\n\n  // EXT_color_buffer_half_float\n  HALF_FLOAT_OES: 0x8d61,\n\n  // Desktop OpenGL\n  DOUBLE: 0x140a,\n\n  // WebGL 2\n  READ_BUFFER: 0x0c02,\n  UNPACK_ROW_LENGTH: 0x0cf2,\n  UNPACK_SKIP_ROWS: 0x0cf3,\n  UNPACK_SKIP_PIXELS: 0x0cf4,\n  PACK_ROW_LENGTH: 0x0d02,\n  PACK_SKIP_ROWS: 0x0d03,\n  PACK_SKIP_PIXELS: 0x0d04,\n  COLOR: 0x1800,\n  DEPTH: 0x1801,\n  STENCIL: 0x1802,\n  RED: 0x1903,\n  RGB8: 0x8051,\n  RGBA8: 0x8058,\n  RGB10_A2: 0x8059,\n  TEXTURE_BINDING_3D: 0x806a,\n  UNPACK_SKIP_IMAGES: 0x806d,\n  UNPACK_IMAGE_HEIGHT: 0x806e,\n  TEXTURE_3D: 0x806f,\n  TEXTURE_WRAP_R: 0x8072,\n  MAX_3D_TEXTURE_SIZE: 0x8073,\n  UNSIGNED_INT_2_10_10_10_REV: 0x8368,\n  MAX_ELEMENTS_VERTICES: 0x80e8,\n  MAX_ELEMENTS_INDICES: 0x80e9,\n  TEXTURE_MIN_LOD: 0x813a,\n  TEXTURE_MAX_LOD: 0x813b,\n  TEXTURE_BASE_LEVEL: 0x813c,\n  TEXTURE_MAX_LEVEL: 0x813d,\n  MIN: 0x8007,\n  MAX: 0x8008,\n  DEPTH_COMPONENT24: 0x81a6,\n  MAX_TEXTURE_LOD_BIAS: 0x84fd,\n  TEXTURE_COMPARE_MODE: 0x884c,\n  TEXTURE_COMPARE_FUNC: 0x884d,\n  CURRENT_QUERY: 0x8865,\n  QUERY_RESULT: 0x8866,\n  QUERY_RESULT_AVAILABLE: 0x8867,\n  STREAM_READ: 0x88e1,\n  STREAM_COPY: 0x88e2,\n  STATIC_READ: 0x88e5,\n  STATIC_COPY: 0x88e6,\n  DYNAMIC_READ: 0x88e9,\n  DYNAMIC_COPY: 0x88ea,\n  MAX_DRAW_BUFFERS: 0x8824,\n  DRAW_BUFFER0: 0x8825,\n  DRAW_BUFFER1: 0x8826,\n  DRAW_BUFFER2: 0x8827,\n  DRAW_BUFFER3: 0x8828,\n  DRAW_BUFFER4: 0x8829,\n  DRAW_BUFFER5: 0x882a,\n  DRAW_BUFFER6: 0x882b,\n  DRAW_BUFFER7: 0x882c,\n  DRAW_BUFFER8: 0x882d,\n  DRAW_BUFFER9: 0x882e,\n  DRAW_BUFFER10: 0x882f,\n  DRAW_BUFFER11: 0x8830,\n  DRAW_BUFFER12: 0x8831,\n  DRAW_BUFFER13: 0x8832,\n  DRAW_BUFFER14: 0x8833,\n  DRAW_BUFFER15: 0x8834,\n  MAX_FRAGMENT_UNIFORM_COMPONENTS: 0x8b49,\n  MAX_VERTEX_UNIFORM_COMPONENTS: 0x8b4a,\n  SAMPLER_3D: 0x8b5f,\n  SAMPLER_2D_SHADOW: 0x8b62,\n  FRAGMENT_SHADER_DERIVATIVE_HINT: 0x8b8b,\n  PIXEL_PACK_BUFFER: 0x88eb,\n  PIXEL_UNPACK_BUFFER: 0x88ec,\n  PIXEL_PACK_BUFFER_BINDING: 0x88ed,\n  PIXEL_UNPACK_BUFFER_BINDING: 0x88ef,\n  FLOAT_MAT2x3: 0x8b65,\n  FLOAT_MAT2x4: 0x8b66,\n  FLOAT_MAT3x2: 0x8b67,\n  FLOAT_MAT3x4: 0x8b68,\n  FLOAT_MAT4x2: 0x8b69,\n  FLOAT_MAT4x3: 0x8b6a,\n  SRGB: 0x8c40,\n  SRGB8: 0x8c41,\n  SRGB8_ALPHA8: 0x8c43,\n  COMPARE_REF_TO_TEXTURE: 0x884e,\n  RGBA32F: 0x8814,\n  RGB32F: 0x8815,\n  RGBA16F: 0x881a,\n  RGB16F: 0x881b,\n  VERTEX_ATTRIB_ARRAY_INTEGER: 0x88fd,\n  MAX_ARRAY_TEXTURE_LAYERS: 0x88ff,\n  MIN_PROGRAM_TEXEL_OFFSET: 0x8904,\n  MAX_PROGRAM_TEXEL_OFFSET: 0x8905,\n  MAX_VARYING_COMPONENTS: 0x8b4b,\n  TEXTURE_2D_ARRAY: 0x8c1a,\n  TEXTURE_BINDING_2D_ARRAY: 0x8c1d,\n  R11F_G11F_B10F: 0x8c3a,\n  UNSIGNED_INT_10F_11F_11F_REV: 0x8c3b,\n  RGB9_E5: 0x8c3d,\n  UNSIGNED_INT_5_9_9_9_REV: 0x8c3e,\n  TRANSFORM_FEEDBACK_BUFFER_MODE: 0x8c7f,\n  MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: 0x8c80,\n  TRANSFORM_FEEDBACK_VARYINGS: 0x8c83,\n  TRANSFORM_FEEDBACK_BUFFER_START: 0x8c84,\n  TRANSFORM_FEEDBACK_BUFFER_SIZE: 0x8c85,\n  TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: 0x8c88,\n  RASTERIZER_DISCARD: 0x8c89,\n  MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: 0x8c8a,\n  MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: 0x8c8b,\n  INTERLEAVED_ATTRIBS: 0x8c8c,\n  SEPARATE_ATTRIBS: 0x8c8d,\n  TRANSFORM_FEEDBACK_BUFFER: 0x8c8e,\n  TRANSFORM_FEEDBACK_BUFFER_BINDING: 0x8c8f,\n  RGBA32UI: 0x8d70,\n  RGB32UI: 0x8d71,\n  RGBA16UI: 0x8d76,\n  RGB16UI: 0x8d77,\n  RGBA8UI: 0x8d7c,\n  RGB8UI: 0x8d7d,\n  RGBA32I: 0x8d82,\n  RGB32I: 0x8d83,\n  RGBA16I: 0x8d88,\n  RGB16I: 0x8d89,\n  RGBA8I: 0x8d8e,\n  RGB8I: 0x8d8f,\n  RED_INTEGER: 0x8d94,\n  RGB_INTEGER: 0x8d98,\n  RGBA_INTEGER: 0x8d99,\n  SAMPLER_2D_ARRAY: 0x8dc1,\n  SAMPLER_2D_ARRAY_SHADOW: 0x8dc4,\n  SAMPLER_CUBE_SHADOW: 0x8dc5,\n  UNSIGNED_INT_VEC2: 0x8dc6,\n  UNSIGNED_INT_VEC3: 0x8dc7,\n  UNSIGNED_INT_VEC4: 0x8dc8,\n  INT_SAMPLER_2D: 0x8dca,\n  INT_SAMPLER_3D: 0x8dcb,\n  INT_SAMPLER_CUBE: 0x8dcc,\n  INT_SAMPLER_2D_ARRAY: 0x8dcf,\n  UNSIGNED_INT_SAMPLER_2D: 0x8dd2,\n  UNSIGNED_INT_SAMPLER_3D: 0x8dd3,\n  UNSIGNED_INT_SAMPLER_CUBE: 0x8dd4,\n  UNSIGNED_INT_SAMPLER_2D_ARRAY: 0x8dd7,\n  DEPTH_COMPONENT32F: 0x8cac,\n  DEPTH32F_STENCIL8: 0x8cad,\n  FLOAT_32_UNSIGNED_INT_24_8_REV: 0x8dad,\n  FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: 0x8210,\n  FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: 0x8211,\n  FRAMEBUFFER_ATTACHMENT_RED_SIZE: 0x8212,\n  FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: 0x8213,\n  FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: 0x8214,\n  FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: 0x8215,\n  FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: 0x8216,\n  FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: 0x8217,\n  FRAMEBUFFER_DEFAULT: 0x8218,\n  UNSIGNED_INT_24_8: 0x84fa,\n  DEPTH24_STENCIL8: 0x88f0,\n  UNSIGNED_NORMALIZED: 0x8c17,\n  DRAW_FRAMEBUFFER_BINDING: 0x8ca6, // Same as FRAMEBUFFER_BINDING\n  READ_FRAMEBUFFER: 0x8ca8,\n  DRAW_FRAMEBUFFER: 0x8ca9,\n  READ_FRAMEBUFFER_BINDING: 0x8caa,\n  RENDERBUFFER_SAMPLES: 0x8cab,\n  FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: 0x8cd4,\n  MAX_COLOR_ATTACHMENTS: 0x8cdf,\n  COLOR_ATTACHMENT1: 0x8ce1,\n  COLOR_ATTACHMENT2: 0x8ce2,\n  COLOR_ATTACHMENT3: 0x8ce3,\n  COLOR_ATTACHMENT4: 0x8ce4,\n  COLOR_ATTACHMENT5: 0x8ce5,\n  COLOR_ATTACHMENT6: 0x8ce6,\n  COLOR_ATTACHMENT7: 0x8ce7,\n  COLOR_ATTACHMENT8: 0x8ce8,\n  COLOR_ATTACHMENT9: 0x8ce9,\n  COLOR_ATTACHMENT10: 0x8cea,\n  COLOR_ATTACHMENT11: 0x8ceb,\n  COLOR_ATTACHMENT12: 0x8cec,\n  COLOR_ATTACHMENT13: 0x8ced,\n  COLOR_ATTACHMENT14: 0x8cee,\n  COLOR_ATTACHMENT15: 0x8cef,\n  FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: 0x8d56,\n  MAX_SAMPLES: 0x8d57,\n  HALF_FLOAT: 0x140b,\n  RG: 0x8227,\n  RG_INTEGER: 0x8228,\n  R8: 0x8229,\n  RG8: 0x822b,\n  R16F: 0x822d,\n  R32F: 0x822e,\n  RG16F: 0x822f,\n  RG32F: 0x8230,\n  R8I: 0x8231,\n  R8UI: 0x8232,\n  R16I: 0x8233,\n  R16UI: 0x8234,\n  R32I: 0x8235,\n  R32UI: 0x8236,\n  RG8I: 0x8237,\n  RG8UI: 0x8238,\n  RG16I: 0x8239,\n  RG16UI: 0x823a,\n  RG32I: 0x823b,\n  RG32UI: 0x823c,\n  VERTEX_ARRAY_BINDING: 0x85b5,\n  R8_SNORM: 0x8f94,\n  RG8_SNORM: 0x8f95,\n  RGB8_SNORM: 0x8f96,\n  RGBA8_SNORM: 0x8f97,\n  SIGNED_NORMALIZED: 0x8f9c,\n  COPY_READ_BUFFER: 0x8f36,\n  COPY_WRITE_BUFFER: 0x8f37,\n  COPY_READ_BUFFER_BINDING: 0x8f36, // Same as COPY_READ_BUFFER\n  COPY_WRITE_BUFFER_BINDING: 0x8f37, // Same as COPY_WRITE_BUFFER\n  UNIFORM_BUFFER: 0x8a11,\n  UNIFORM_BUFFER_BINDING: 0x8a28,\n  UNIFORM_BUFFER_START: 0x8a29,\n  UNIFORM_BUFFER_SIZE: 0x8a2a,\n  MAX_VERTEX_UNIFORM_BLOCKS: 0x8a2b,\n  MAX_FRAGMENT_UNIFORM_BLOCKS: 0x8a2d,\n  MAX_COMBINED_UNIFORM_BLOCKS: 0x8a2e,\n  MAX_UNIFORM_BUFFER_BINDINGS: 0x8a2f,\n  MAX_UNIFORM_BLOCK_SIZE: 0x8a30,\n  MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: 0x8a31,\n  MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: 0x8a33,\n  UNIFORM_BUFFER_OFFSET_ALIGNMENT: 0x8a34,\n  ACTIVE_UNIFORM_BLOCKS: 0x8a36,\n  UNIFORM_TYPE: 0x8a37,\n  UNIFORM_SIZE: 0x8a38,\n  UNIFORM_BLOCK_INDEX: 0x8a3a,\n  UNIFORM_OFFSET: 0x8a3b,\n  UNIFORM_ARRAY_STRIDE: 0x8a3c,\n  UNIFORM_MATRIX_STRIDE: 0x8a3d,\n  UNIFORM_IS_ROW_MAJOR: 0x8a3e,\n  UNIFORM_BLOCK_BINDING: 0x8a3f,\n  UNIFORM_BLOCK_DATA_SIZE: 0x8a40,\n  UNIFORM_BLOCK_ACTIVE_UNIFORMS: 0x8a42,\n  UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: 0x8a43,\n  UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: 0x8a44,\n  UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: 0x8a46,\n  INVALID_INDEX: 0xffffffff,\n  MAX_VERTEX_OUTPUT_COMPONENTS: 0x9122,\n  MAX_FRAGMENT_INPUT_COMPONENTS: 0x9125,\n  MAX_SERVER_WAIT_TIMEOUT: 0x9111,\n  OBJECT_TYPE: 0x9112,\n  SYNC_CONDITION: 0x9113,\n  SYNC_STATUS: 0x9114,\n  SYNC_FLAGS: 0x9115,\n  SYNC_FENCE: 0x9116,\n  SYNC_GPU_COMMANDS_COMPLETE: 0x9117,\n  UNSIGNALED: 0x9118,\n  SIGNALED: 0x9119,\n  ALREADY_SIGNALED: 0x911a,\n  TIMEOUT_EXPIRED: 0x911b,\n  CONDITION_SATISFIED: 0x911c,\n  WAIT_FAILED: 0x911d,\n  SYNC_FLUSH_COMMANDS_BIT: 0x00000001,\n  VERTEX_ATTRIB_ARRAY_DIVISOR: 0x88fe,\n  ANY_SAMPLES_PASSED: 0x8c2f,\n  ANY_SAMPLES_PASSED_CONSERVATIVE: 0x8d6a,\n  SAMPLER_BINDING: 0x8919,\n  RGB10_A2UI: 0x906f,\n  INT_2_10_10_10_REV: 0x8d9f,\n  TRANSFORM_FEEDBACK: 0x8e22,\n  TRANSFORM_FEEDBACK_PAUSED: 0x8e23,\n  TRANSFORM_FEEDBACK_ACTIVE: 0x8e24,\n  TRANSFORM_FEEDBACK_BINDING: 0x8e25,\n  COMPRESSED_R11_EAC: 0x9270,\n  COMPRESSED_SIGNED_R11_EAC: 0x9271,\n  COMPRESSED_RG11_EAC: 0x9272,\n  COMPRESSED_SIGNED_RG11_EAC: 0x9273,\n  COMPRESSED_RGB8_ETC2: 0x9274,\n  COMPRESSED_SRGB8_ETC2: 0x9275,\n  COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9276,\n  COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9277,\n  COMPRESSED_RGBA8_ETC2_EAC: 0x9278,\n  COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: 0x9279,\n  TEXTURE_IMMUTABLE_FORMAT: 0x912f,\n  MAX_ELEMENT_INDEX: 0x8d6b,\n  TEXTURE_IMMUTABLE_LEVELS: 0x82df,\n\n  // Extensions\n  MAX_TEXTURE_MAX_ANISOTROPY_EXT: 0x84ff,\n};\nexport default Object.freeze(WebGLConstants);\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\n\nconst viewerPositionWCScratch = new Cartesian3();\n\nfunction AutomaticUniform(options) {\n  this._size = options.size;\n  this._datatype = options.datatype;\n  this.getValue = options.getValue;\n}\n\nconst datatypeToGlsl = {};\ndatatypeToGlsl[WebGLConstants.FLOAT] = \"float\";\ndatatypeToGlsl[WebGLConstants.FLOAT_VEC2] = \"vec2\";\ndatatypeToGlsl[WebGLConstants.FLOAT_VEC3] = \"vec3\";\ndatatypeToGlsl[WebGLConstants.FLOAT_VEC4] = \"vec4\";\ndatatypeToGlsl[WebGLConstants.INT] = \"int\";\ndatatypeToGlsl[WebGLConstants.INT_VEC2] = \"ivec2\";\ndatatypeToGlsl[WebGLConstants.INT_VEC3] = \"ivec3\";\ndatatypeToGlsl[WebGLConstants.INT_VEC4] = \"ivec4\";\ndatatypeToGlsl[WebGLConstants.BOOL] = \"bool\";\ndatatypeToGlsl[WebGLConstants.BOOL_VEC2] = \"bvec2\";\ndatatypeToGlsl[WebGLConstants.BOOL_VEC3] = \"bvec3\";\ndatatypeToGlsl[WebGLConstants.BOOL_VEC4] = \"bvec4\";\ndatatypeToGlsl[WebGLConstants.FLOAT_MAT2] = \"mat2\";\ndatatypeToGlsl[WebGLConstants.FLOAT_MAT3] = \"mat3\";\ndatatypeToGlsl[WebGLConstants.FLOAT_MAT4] = \"mat4\";\ndatatypeToGlsl[WebGLConstants.SAMPLER_2D] = \"sampler2D\";\ndatatypeToGlsl[WebGLConstants.SAMPLER_CUBE] = \"samplerCube\";\n\nAutomaticUniform.prototype.getDeclaration = function (name) {\n  let declaration = `uniform ${datatypeToGlsl[this._datatype]} ${name}`;\n\n  const size = this._size;\n  if (size === 1) {\n    declaration += \";\";\n  } else {\n    declaration += `[${size.toString()}];`;\n  }\n\n  return declaration;\n};\n\n/**\n * @private\n */\nconst AutomaticUniforms = {\n  /**\n   * An automatic GLSL uniform containing the viewport's <code>x</code>, <code>y</code>, <code>width</code>,\n   * and <code>height</code> properties in an <code>vec4</code>'s <code>x</code>, <code>y</code>, <code>z</code>,\n   * and <code>w</code> components, respectively.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec4 czm_viewport;\n   *\n   * // Scale the window coordinate components to [0, 1] by dividing\n   * // by the viewport's width and height.\n   * vec2 v = gl_FragCoord.xy / czm_viewport.zw;\n   *\n   * @see Context#getViewport\n   */\n  czm_viewport: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC4,\n    getValue: function (uniformState) {\n      return uniformState.viewportCartesian4;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 orthographic projection matrix that\n   * transforms window coordinates to clip coordinates.  Clip coordinates is the\n   * coordinate system for a vertex shader's <code>gl_Position</code> output.\n   * <br /><br />\n   * This transform is useful when a vertex shader inputs or manipulates window coordinates\n   * as done by {@link BillboardCollection}.\n   * <br /><br />\n   * Do not confuse {@link czm_viewportTransformation} with <code>czm_viewportOrthographic</code>.\n   * The former transforms from normalized device coordinates to window coordinates; the later transforms\n   * from window coordinates to clip coordinates, and is often used to assign to <code>gl_Position</code>.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_viewportOrthographic;\n   *\n   * // Example\n   * gl_Position = czm_viewportOrthographic * vec4(windowPosition, 0.0, 1.0);\n   *\n   * @see UniformState#viewportOrthographic\n   * @see czm_viewport\n   * @see czm_viewportTransformation\n   * @see BillboardCollection\n   */\n  czm_viewportOrthographic: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.viewportOrthographic;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 transformation matrix that\n   * transforms normalized device coordinates to window coordinates.  The context's\n   * full viewport is used, and the depth range is assumed to be <code>near = 0</code>\n   * and <code>far = 1</code>.\n   * <br /><br />\n   * This transform is useful when there is a need to manipulate window coordinates\n   * in a vertex shader as done by {@link BillboardCollection}.  In many cases,\n   * this matrix will not be used directly; instead, {@link czm_modelToWindowCoordinates}\n   * will be used to transform directly from model to window coordinates.\n   * <br /><br />\n   * Do not confuse <code>czm_viewportTransformation</code> with {@link czm_viewportOrthographic}.\n   * The former transforms from normalized device coordinates to window coordinates; the later transforms\n   * from window coordinates to clip coordinates, and is often used to assign to <code>gl_Position</code>.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_viewportTransformation;\n   *\n   * // Use czm_viewportTransformation as part of the\n   * // transform from model to window coordinates.\n   * vec4 q = czm_modelViewProjection * positionMC;               // model to clip coordinates\n   * q.xyz /= q.w;                                                // clip to normalized device coordinates (ndc)\n   * q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // ndc to window coordinates\n   *\n   * @see UniformState#viewportTransformation\n   * @see czm_viewport\n   * @see czm_viewportOrthographic\n   * @see czm_modelToWindowCoordinates\n   * @see BillboardCollection\n   */\n  czm_viewportTransformation: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.viewportTransformation;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the depth of the scene\n   * after the globe pass and then updated after the 3D Tiles pass.\n   * The depth is packed into an RGBA texture.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform sampler2D czm_globeDepthTexture;\n   *\n   * // Get the depth at the current fragment\n   * vec2 coords = gl_FragCoord.xy / czm_viewport.zw;\n   * float depth = czm_unpackDepth(texture(czm_globeDepthTexture, coords));\n   */\n  czm_globeDepthTexture: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.SAMPLER_2D,\n    getValue: function (uniformState) {\n      return uniformState.globeDepthTexture;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 model transformation matrix that\n   * transforms model coordinates to world coordinates.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_model;\n   *\n   * // Example\n   * vec4 worldPosition = czm_model * modelPosition;\n   *\n   * @see UniformState#model\n   * @see czm_inverseModel\n   * @see czm_modelView\n   * @see czm_modelViewProjection\n   */\n  czm_model: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.model;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 model transformation matrix that\n   * transforms world coordinates to model coordinates.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_inverseModel;\n   *\n   * // Example\n   * vec4 modelPosition = czm_inverseModel * worldPosition;\n   *\n   * @see UniformState#inverseModel\n   * @see czm_model\n   * @see czm_inverseModelView\n   */\n  czm_inverseModel: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.inverseModel;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 view transformation matrix that\n   * transforms world coordinates to eye coordinates.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_view;\n   *\n   * // Example\n   * vec4 eyePosition = czm_view * worldPosition;\n   *\n   * @see UniformState#view\n   * @see czm_viewRotation\n   * @see czm_modelView\n   * @see czm_viewProjection\n   * @see czm_modelViewProjection\n   * @see czm_inverseView\n   */\n  czm_view: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.view;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 view transformation matrix that\n   * transforms 3D world coordinates to eye coordinates.  In 3D mode, this is identical to\n   * {@link czm_view}, but in 2D and Columbus View it represents the view matrix\n   * as if the camera were at an equivalent location in 3D mode.  This is useful for lighting\n   * 2D and Columbus View in the same way that 3D is lit.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_view3D;\n   *\n   * // Example\n   * vec4 eyePosition3D = czm_view3D * worldPosition3D;\n   *\n   * @see UniformState#view3D\n   * @see czm_view\n   */\n  czm_view3D: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.view3D;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 3x3 view rotation matrix that\n   * transforms vectors in world coordinates to eye coordinates.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat3 czm_viewRotation;\n   *\n   * // Example\n   * vec3 eyeVector = czm_viewRotation * worldVector;\n   *\n   * @see UniformState#viewRotation\n   * @see czm_view\n   * @see czm_inverseView\n   * @see czm_inverseViewRotation\n   */\n  czm_viewRotation: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT3,\n    getValue: function (uniformState) {\n      return uniformState.viewRotation;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 3x3 view rotation matrix that\n   * transforms vectors in 3D world coordinates to eye coordinates.  In 3D mode, this is identical to\n   * {@link czm_viewRotation}, but in 2D and Columbus View it represents the view matrix\n   * as if the camera were at an equivalent location in 3D mode.  This is useful for lighting\n   * 2D and Columbus View in the same way that 3D is lit.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat3 czm_viewRotation3D;\n   *\n   * // Example\n   * vec3 eyeVector = czm_viewRotation3D * worldVector;\n   *\n   * @see UniformState#viewRotation3D\n   * @see czm_viewRotation\n   */\n  czm_viewRotation3D: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT3,\n    getValue: function (uniformState) {\n      return uniformState.viewRotation3D;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 transformation matrix that\n   * transforms from eye coordinates to world coordinates.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_inverseView;\n   *\n   * // Example\n   * vec4 worldPosition = czm_inverseView * eyePosition;\n   *\n   * @see UniformState#inverseView\n   * @see czm_view\n   * @see czm_inverseNormal\n   */\n  czm_inverseView: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.inverseView;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 transformation matrix that\n   * transforms from 3D eye coordinates to world coordinates.  In 3D mode, this is identical to\n   * {@link czm_inverseView}, but in 2D and Columbus View it represents the inverse view matrix\n   * as if the camera were at an equivalent location in 3D mode.  This is useful for lighting\n   * 2D and Columbus View in the same way that 3D is lit.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_inverseView3D;\n   *\n   * // Example\n   * vec4 worldPosition = czm_inverseView3D * eyePosition;\n   *\n   * @see UniformState#inverseView3D\n   * @see czm_inverseView\n   */\n  czm_inverseView3D: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.inverseView3D;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 3x3 rotation matrix that\n   * transforms vectors from eye coordinates to world coordinates.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat3 czm_inverseViewRotation;\n   *\n   * // Example\n   * vec4 worldVector = czm_inverseViewRotation * eyeVector;\n   *\n   * @see UniformState#inverseView\n   * @see czm_view\n   * @see czm_viewRotation\n   * @see czm_inverseViewRotation\n   */\n  czm_inverseViewRotation: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT3,\n    getValue: function (uniformState) {\n      return uniformState.inverseViewRotation;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 3x3 rotation matrix that\n   * transforms vectors from 3D eye coordinates to world coordinates.  In 3D mode, this is identical to\n   * {@link czm_inverseViewRotation}, but in 2D and Columbus View it represents the inverse view matrix\n   * as if the camera were at an equivalent location in 3D mode.  This is useful for lighting\n   * 2D and Columbus View in the same way that 3D is lit.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat3 czm_inverseViewRotation3D;\n   *\n   * // Example\n   * vec4 worldVector = czm_inverseViewRotation3D * eyeVector;\n   *\n   * @see UniformState#inverseView3D\n   * @see czm_inverseViewRotation\n   */\n  czm_inverseViewRotation3D: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT3,\n    getValue: function (uniformState) {\n      return uniformState.inverseViewRotation3D;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 projection transformation matrix that\n   * transforms eye coordinates to clip coordinates.  Clip coordinates is the\n   * coordinate system for a vertex shader's <code>gl_Position</code> output.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_projection;\n   *\n   * // Example\n   * gl_Position = czm_projection * eyePosition;\n   *\n   * @see UniformState#projection\n   * @see czm_viewProjection\n   * @see czm_modelViewProjection\n   * @see czm_infiniteProjection\n   */\n  czm_projection: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.projection;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 inverse projection transformation matrix that\n   * transforms from clip coordinates to eye coordinates. Clip coordinates is the\n   * coordinate system for a vertex shader's <code>gl_Position</code> output.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_inverseProjection;\n   *\n   * // Example\n   * vec4 eyePosition = czm_inverseProjection * clipPosition;\n   *\n   * @see UniformState#inverseProjection\n   * @see czm_projection\n   */\n  czm_inverseProjection: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.inverseProjection;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 projection transformation matrix with the far plane at infinity,\n   * that transforms eye coordinates to clip coordinates.  Clip coordinates is the\n   * coordinate system for a vertex shader's <code>gl_Position</code> output.  An infinite far plane is used\n   * in algorithms like shadow volumes and GPU ray casting with proxy geometry to ensure that triangles\n   * are not clipped by the far plane.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_infiniteProjection;\n   *\n   * // Example\n   * gl_Position = czm_infiniteProjection * eyePosition;\n   *\n   * @see UniformState#infiniteProjection\n   * @see czm_projection\n   * @see czm_modelViewInfiniteProjection\n   */\n  czm_infiniteProjection: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.infiniteProjection;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 model-view transformation matrix that\n   * transforms model coordinates to eye coordinates.\n   * <br /><br />\n   * Positions should be transformed to eye coordinates using <code>czm_modelView</code> and\n   * normals should be transformed using {@link czm_normal}.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_modelView;\n   *\n   * // Example\n   * vec4 eyePosition = czm_modelView * modelPosition;\n   *\n   * // The above is equivalent to, but more efficient than:\n   * vec4 eyePosition = czm_view * czm_model * modelPosition;\n   *\n   * @see UniformState#modelView\n   * @see czm_model\n   * @see czm_view\n   * @see czm_modelViewProjection\n   * @see czm_normal\n   */\n  czm_modelView: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.modelView;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 model-view transformation matrix that\n   * transforms 3D model coordinates to eye coordinates.  In 3D mode, this is identical to\n   * {@link czm_modelView}, but in 2D and Columbus View it represents the model-view matrix\n   * as if the camera were at an equivalent location in 3D mode.  This is useful for lighting\n   * 2D and Columbus View in the same way that 3D is lit.\n   * <br /><br />\n   * Positions should be transformed to eye coordinates using <code>czm_modelView3D</code> and\n   * normals should be transformed using {@link czm_normal3D}.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_modelView3D;\n   *\n   * // Example\n   * vec4 eyePosition = czm_modelView3D * modelPosition;\n   *\n   * // The above is equivalent to, but more efficient than:\n   * vec4 eyePosition = czm_view3D * czm_model * modelPosition;\n   *\n   * @see UniformState#modelView3D\n   * @see czm_modelView\n   */\n  czm_modelView3D: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.modelView3D;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 model-view transformation matrix that\n   * transforms model coordinates, relative to the eye, to eye coordinates.  This is used\n   * in conjunction with {@link czm_translateRelativeToEye}.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_modelViewRelativeToEye;\n   *\n   * // Example\n   * attribute vec3 positionHigh;\n   * attribute vec3 positionLow;\n   *\n   * void main()\n   * {\n   *   vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\n   *   gl_Position = czm_projection * (czm_modelViewRelativeToEye * p);\n   * }\n   *\n   * @see czm_modelViewProjectionRelativeToEye\n   * @see czm_translateRelativeToEye\n   * @see EncodedCartesian3\n   */\n  czm_modelViewRelativeToEye: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.modelViewRelativeToEye;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 transformation matrix that\n   * transforms from eye coordinates to model coordinates.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_inverseModelView;\n   *\n   * // Example\n   * vec4 modelPosition = czm_inverseModelView * eyePosition;\n   *\n   * @see UniformState#inverseModelView\n   * @see czm_modelView\n   */\n  czm_inverseModelView: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.inverseModelView;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 transformation matrix that\n   * transforms from eye coordinates to 3D model coordinates.  In 3D mode, this is identical to\n   * {@link czm_inverseModelView}, but in 2D and Columbus View it represents the inverse model-view matrix\n   * as if the camera were at an equivalent location in 3D mode.  This is useful for lighting\n   * 2D and Columbus View in the same way that 3D is lit.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_inverseModelView3D;\n   *\n   * // Example\n   * vec4 modelPosition = czm_inverseModelView3D * eyePosition;\n   *\n   * @see UniformState#inverseModelView\n   * @see czm_inverseModelView\n   * @see czm_modelView3D\n   */\n  czm_inverseModelView3D: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.inverseModelView3D;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 view-projection transformation matrix that\n   * transforms world coordinates to clip coordinates.  Clip coordinates is the\n   * coordinate system for a vertex shader's <code>gl_Position</code> output.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_viewProjection;\n   *\n   * // Example\n   * vec4 gl_Position = czm_viewProjection * czm_model * modelPosition;\n   *\n   * // The above is equivalent to, but more efficient than:\n   * gl_Position = czm_projection * czm_view * czm_model * modelPosition;\n   *\n   * @see UniformState#viewProjection\n   * @see czm_view\n   * @see czm_projection\n   * @see czm_modelViewProjection\n   * @see czm_inverseViewProjection\n   */\n  czm_viewProjection: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.viewProjection;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 view-projection transformation matrix that\n   * transforms clip coordinates to world coordinates.  Clip coordinates is the\n   * coordinate system for a vertex shader's <code>gl_Position</code> output.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_inverseViewProjection;\n   *\n   * // Example\n   * vec4 worldPosition = czm_inverseViewProjection * clipPosition;\n   *\n   * @see UniformState#inverseViewProjection\n   * @see czm_viewProjection\n   */\n  czm_inverseViewProjection: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.inverseViewProjection;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 model-view-projection transformation matrix that\n   * transforms model coordinates to clip coordinates.  Clip coordinates is the\n   * coordinate system for a vertex shader's <code>gl_Position</code> output.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_modelViewProjection;\n   *\n   * // Example\n   * vec4 gl_Position = czm_modelViewProjection * modelPosition;\n   *\n   * // The above is equivalent to, but more efficient than:\n   * gl_Position = czm_projection * czm_view * czm_model * modelPosition;\n   *\n   * @see UniformState#modelViewProjection\n   * @see czm_model\n   * @see czm_view\n   * @see czm_projection\n   * @see czm_modelView\n   * @see czm_viewProjection\n   * @see czm_modelViewInfiniteProjection\n   * @see czm_inverseModelViewProjection\n   */\n  czm_modelViewProjection: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.modelViewProjection;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 inverse model-view-projection transformation matrix that\n   * transforms clip coordinates to model coordinates.  Clip coordinates is the\n   * coordinate system for a vertex shader's <code>gl_Position</code> output.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_inverseModelViewProjection;\n   *\n   * // Example\n   * vec4 modelPosition = czm_inverseModelViewProjection * clipPosition;\n   *\n   * @see UniformState#modelViewProjection\n   * @see czm_modelViewProjection\n   */\n  czm_inverseModelViewProjection: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.inverseModelViewProjection;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 model-view-projection transformation matrix that\n   * transforms model coordinates, relative to the eye, to clip coordinates.  Clip coordinates is the\n   * coordinate system for a vertex shader's <code>gl_Position</code> output.  This is used in\n   * conjunction with {@link czm_translateRelativeToEye}.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_modelViewProjectionRelativeToEye;\n   *\n   * // Example\n   * attribute vec3 positionHigh;\n   * attribute vec3 positionLow;\n   *\n   * void main()\n   * {\n   *   vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\n   *   gl_Position = czm_modelViewProjectionRelativeToEye * p;\n   * }\n   *\n   * @see czm_modelViewRelativeToEye\n   * @see czm_translateRelativeToEye\n   * @see EncodedCartesian3\n   */\n  czm_modelViewProjectionRelativeToEye: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.modelViewProjectionRelativeToEye;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 4x4 model-view-projection transformation matrix that\n   * transforms model coordinates to clip coordinates.  Clip coordinates is the\n   * coordinate system for a vertex shader's <code>gl_Position</code> output.  The projection matrix places\n   * the far plane at infinity.  This is useful in algorithms like shadow volumes and GPU ray casting with\n   * proxy geometry to ensure that triangles are not clipped by the far plane.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat4 czm_modelViewInfiniteProjection;\n   *\n   * // Example\n   * vec4 gl_Position = czm_modelViewInfiniteProjection * modelPosition;\n   *\n   * // The above is equivalent to, but more efficient than:\n   * gl_Position = czm_infiniteProjection * czm_view * czm_model * modelPosition;\n   *\n   * @see UniformState#modelViewInfiniteProjection\n   * @see czm_model\n   * @see czm_view\n   * @see czm_infiniteProjection\n   * @see czm_modelViewProjection\n   */\n  czm_modelViewInfiniteProjection: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.modelViewInfiniteProjection;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform that indicates if the current camera is orthographic in 3D.\n   *\n   * @see UniformState#orthographicIn3D\n   */\n  czm_orthographicIn3D: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.orthographicIn3D ? 1 : 0;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 3x3 normal transformation matrix that\n   * transforms normal vectors in model coordinates to eye coordinates.\n   * <br /><br />\n   * Positions should be transformed to eye coordinates using {@link czm_modelView} and\n   * normals should be transformed using <code>czm_normal</code>.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat3 czm_normal;\n   *\n   * // Example\n   * vec3 eyeNormal = czm_normal * normal;\n   *\n   * @see UniformState#normal\n   * @see czm_inverseNormal\n   * @see czm_modelView\n   */\n  czm_normal: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT3,\n    getValue: function (uniformState) {\n      return uniformState.normal;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 3x3 normal transformation matrix that\n   * transforms normal vectors in 3D model coordinates to eye coordinates.\n   * In 3D mode, this is identical to\n   * {@link czm_normal}, but in 2D and Columbus View it represents the normal transformation\n   * matrix as if the camera were at an equivalent location in 3D mode.  This is useful for lighting\n   * 2D and Columbus View in the same way that 3D is lit.\n   * <br /><br />\n   * Positions should be transformed to eye coordinates using {@link czm_modelView3D} and\n   * normals should be transformed using <code>czm_normal3D</code>.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat3 czm_normal3D;\n   *\n   * // Example\n   * vec3 eyeNormal = czm_normal3D * normal;\n   *\n   * @see UniformState#normal3D\n   * @see czm_normal\n   */\n  czm_normal3D: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT3,\n    getValue: function (uniformState) {\n      return uniformState.normal3D;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 3x3 normal transformation matrix that\n   * transforms normal vectors in eye coordinates to model coordinates.  This is\n   * the opposite of the transform provided by {@link czm_normal}.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat3 czm_inverseNormal;\n   *\n   * // Example\n   * vec3 normalMC = czm_inverseNormal * normalEC;\n   *\n   * @see UniformState#inverseNormal\n   * @see czm_normal\n   * @see czm_modelView\n   * @see czm_inverseView\n   */\n  czm_inverseNormal: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT3,\n    getValue: function (uniformState) {\n      return uniformState.inverseNormal;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 3x3 normal transformation matrix that\n   * transforms normal vectors in eye coordinates to 3D model coordinates.  This is\n   * the opposite of the transform provided by {@link czm_normal}.\n   * In 3D mode, this is identical to\n   * {@link czm_inverseNormal}, but in 2D and Columbus View it represents the inverse normal transformation\n   * matrix as if the camera were at an equivalent location in 3D mode.  This is useful for lighting\n   * 2D and Columbus View in the same way that 3D is lit.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat3 czm_inverseNormal3D;\n   *\n   * // Example\n   * vec3 normalMC = czm_inverseNormal3D * normalEC;\n   *\n   * @see UniformState#inverseNormal3D\n   * @see czm_inverseNormal\n   */\n  czm_inverseNormal3D: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT3,\n    getValue: function (uniformState) {\n      return uniformState.inverseNormal3D;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform containing the height in meters of the\n   * eye (camera) above or below the ellipsoid.\n   *\n   * @see UniformState#eyeHeight\n   */\n  czm_eyeHeight: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.eyeHeight;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform containing height (<code>x</code>) and height squared (<code>y</code>)\n   * in meters of the eye (camera) above the 2D world plane. This uniform is only valid\n   * when the {@link SceneMode} is <code>SCENE2D</code>.\n   *\n   * @see UniformState#eyeHeight2D\n   */\n  czm_eyeHeight2D: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC2,\n    getValue: function (uniformState) {\n      return uniformState.eyeHeight2D;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform containing the ellipsoid surface normal\n   * at the position below the eye (camera), in eye coordinates.\n   * This uniform is only valid when the {@link SceneMode} is <code>SCENE3D</code>.\n   */\n  czm_eyeEllipsoidNormalEC: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return uniformState.eyeEllipsoidNormalEC;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform containing the ellipsoid radii of curvature at the camera position.\n   * The .x component is the prime vertical radius, .y is the meridional.\n   * This uniform is only valid when the {@link SceneMode} is <code>SCENE3D</code>.\n   */\n  czm_eyeEllipsoidCurvature: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC2,\n    getValue: function (uniformState) {\n      return uniformState.eyeEllipsoidCurvature;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform containing the transform from model coordinates\n   * to an east-north-up coordinate system centered at the position on the\n   * ellipsoid below the camera.\n   * This uniform is only valid when the {@link SceneMode} is <code>SCENE3D</code>.\n   */\n  czm_modelToEnu: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.modelToEnu;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform containing the the inverse of\n   * {@link AutomaticUniforms.czm_modelToEnu}.\n   * This uniform is only valid when the {@link SceneMode} is <code>SCENE3D</code>.\n   */\n  czm_enuToModel: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT4,\n    getValue: function (uniformState) {\n      return uniformState.enuToModel;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform containing the near distance (<code>x</code>) and the far distance (<code>y</code>)\n   * of the frustum defined by the camera.  This is the largest possible frustum, not an individual\n   * frustum used for multi-frustum rendering.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec2 czm_entireFrustum;\n   *\n   * // Example\n   * float frustumLength = czm_entireFrustum.y - czm_entireFrustum.x;\n   *\n   * @see UniformState#entireFrustum\n   * @see czm_currentFrustum\n   */\n  czm_entireFrustum: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC2,\n    getValue: function (uniformState) {\n      return uniformState.entireFrustum;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform containing the near distance (<code>x</code>) and the far distance (<code>y</code>)\n   * of the frustum defined by the camera.  This is the individual\n   * frustum used for multi-frustum rendering.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec2 czm_currentFrustum;\n   *\n   * // Example\n   * float frustumLength = czm_currentFrustum.y - czm_currentFrustum.x;\n   *\n   * @see UniformState#currentFrustum\n   * @see czm_entireFrustum\n   */\n  czm_currentFrustum: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC2,\n    getValue: function (uniformState) {\n      return uniformState.currentFrustum;\n    },\n  }),\n\n  /**\n   * The distances to the frustum planes. The top, bottom, left and right distances are\n   * the x, y, z, and w components, respectively.\n   */\n  czm_frustumPlanes: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC4,\n    getValue: function (uniformState) {\n      return uniformState.frustumPlanes;\n    },\n  }),\n\n  /**\n   * Gets the far plane's distance from the near plane, plus 1.0.\n   */\n  czm_farDepthFromNearPlusOne: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.farDepthFromNearPlusOne;\n    },\n  }),\n\n  /**\n   * Gets the log2 of {@link AutomaticUniforms#czm_farDepthFromNearPlusOne}.\n   */\n  czm_log2FarDepthFromNearPlusOne: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.log2FarDepthFromNearPlusOne;\n    },\n  }),\n\n  /**\n   * Gets 1.0 divided by {@link AutomaticUniforms#czm_log2FarDepthFromNearPlusOne}.\n   */\n  czm_oneOverLog2FarDepthFromNearPlusOne: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.oneOverLog2FarDepthFromNearPlusOne;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the sun position in world coordinates.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec3 czm_sunPositionWC;\n   *\n   * @see UniformState#sunPositionWC\n   * @see czm_sunPositionColumbusView\n   * @see czm_sunDirectionWC\n   */\n  czm_sunPositionWC: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return uniformState.sunPositionWC;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the sun position in Columbus view world coordinates.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec3 czm_sunPositionColumbusView;\n   *\n   * @see UniformState#sunPositionColumbusView\n   * @see czm_sunPositionWC\n   */\n  czm_sunPositionColumbusView: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return uniformState.sunPositionColumbusView;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the normalized direction to the sun in eye coordinates.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec3 czm_sunDirectionEC;\n   *\n   * // Example\n   * float diffuse = max(dot(czm_sunDirectionEC, normalEC), 0.0);\n   *\n   * @see UniformState#sunDirectionEC\n   * @see czm_moonDirectionEC\n   * @see czm_sunDirectionWC\n   */\n  czm_sunDirectionEC: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return uniformState.sunDirectionEC;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the normalized direction to the sun in world coordinates.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec3 czm_sunDirectionWC;\n   *\n   * // Example\n   * float diffuse = max(dot(czm_sunDirectionWC, normalWC), 0.0);\n   *\n   * @see UniformState#sunDirectionWC\n   * @see czm_sunPositionWC\n   * @see czm_sunDirectionEC\n   */\n  czm_sunDirectionWC: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return uniformState.sunDirectionWC;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the normalized direction to the moon in eye coordinates.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec3 czm_moonDirectionEC;\n   *\n   * // Example\n   * float diffuse = max(dot(czm_moonDirectionEC, normalEC), 0.0);\n   *\n   * @see UniformState#moonDirectionEC\n   * @see czm_sunDirectionEC\n   */\n  czm_moonDirectionEC: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return uniformState.moonDirectionEC;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the normalized direction to the scene's light source in eye coordinates.\n   * This is commonly used for directional lighting computations.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec3 czm_lightDirectionEC;\n   *\n   * // Example\n   * float diffuse = max(dot(czm_lightDirectionEC, normalEC), 0.0);\n   *\n   * @see UniformState#lightDirectionEC\n   * @see czm_lightDirectionWC\n   */\n  czm_lightDirectionEC: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return uniformState.lightDirectionEC;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the normalized direction to the scene's light source in world coordinates.\n   * This is commonly used for directional lighting computations.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec3 czm_lightDirectionWC;\n   *\n   * // Example\n   * float diffuse = max(dot(czm_lightDirectionWC, normalWC), 0.0);\n   *\n   * @see UniformState#lightDirectionWC\n   * @see czm_lightDirectionEC\n   */\n  czm_lightDirectionWC: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return uniformState.lightDirectionWC;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform that represents the color of light emitted by the scene's light source. This\n   * is equivalent to the light color multiplied by the light intensity limited to a maximum luminance of 1.0\n   * suitable for non-HDR lighting.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec3 czm_lightColor;\n   *\n   * // Example\n   * vec3 diffuseColor = czm_lightColor * max(dot(czm_lightDirectionWC, normalWC), 0.0);\n   *\n   * @see UniformState#lightColor\n   * @see czm_lightColorHdr\n   */\n  czm_lightColor: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return uniformState.lightColor;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform that represents the high dynamic range color of light emitted by the scene's light\n   * source. This is equivalent to the light color multiplied by the light intensity suitable for HDR lighting.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec3 czm_lightColorHdr;\n   *\n   * // Example\n   * vec3 diffuseColor = czm_lightColorHdr * max(dot(czm_lightDirectionWC, normalWC), 0.0);\n   *\n   * @see UniformState#lightColorHdr\n   * @see czm_lightColor\n   */\n  czm_lightColorHdr: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return uniformState.lightColorHdr;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the high bits of the camera position in model\n   * coordinates.  This is used for GPU RTE to eliminate jittering artifacts when rendering\n   * as described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec3 czm_encodedCameraPositionMCHigh;\n   *\n   * @see czm_encodedCameraPositionMCLow\n   * @see czm_modelViewRelativeToEye\n   * @see czm_modelViewProjectionRelativeToEye\n   */\n  czm_encodedCameraPositionMCHigh: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return uniformState.encodedCameraPositionMCHigh;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the low bits of the camera position in model\n   * coordinates.  This is used for GPU RTE to eliminate jittering artifacts when rendering\n   * as described in {@linkhttp://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec3 czm_encodedCameraPositionMCLow;\n   *\n   * @see czm_encodedCameraPositionMCHigh\n   * @see czm_modelViewRelativeToEye\n   * @see czm_modelViewProjectionRelativeToEye\n   */\n  czm_encodedCameraPositionMCLow: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return uniformState.encodedCameraPositionMCLow;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the position of the viewer (camera) in world coordinates.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec3 czm_viewerPositionWC;\n   */\n  czm_viewerPositionWC: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return Matrix4.getTranslation(\n        uniformState.inverseView,\n        viewerPositionWCScratch\n      );\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the frame number. This uniform is automatically incremented\n   * every frame.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform float czm_frameNumber;\n   */\n  czm_frameNumber: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.frameState.frameNumber;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the current morph transition time between\n   * 2D/Columbus View and 3D, with 0.0 being 2D or Columbus View and 1.0 being 3D.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform float czm_morphTime;\n   *\n   * // Example\n   * vec4 p = czm_columbusViewMorph(position2D, position3D, czm_morphTime);\n   */\n  czm_morphTime: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.frameState.morphTime;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the current {@link SceneMode}, expressed\n   * as a float.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform float czm_sceneMode;\n   *\n   * // Example\n   * if (czm_sceneMode == czm_sceneMode2D)\n   * {\n   *     eyeHeightSq = czm_eyeHeight2D.y;\n   * }\n   *\n   * @see czm_sceneMode2D\n   * @see czm_sceneModeColumbusView\n   * @see czm_sceneMode3D\n   * @see czm_sceneModeMorphing\n   */\n  czm_sceneMode: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.frameState.mode;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the current rendering pass.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform float czm_pass;\n   *\n   * // Example\n   * if ((czm_pass == czm_passTranslucent) && isOpaque())\n   * {\n   *     gl_Position *= 0.0; // Cull opaque geometry in the translucent pass\n   * }\n   */\n  czm_pass: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.pass;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the current scene background color.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec4 czm_backgroundColor;\n   *\n   * // Example: If the given color's RGB matches the background color, invert it.\n   * vec4 adjustColorForContrast(vec4 color)\n   * {\n   *     if (czm_backgroundColor.rgb == color.rgb)\n   *     {\n   *         color.rgb = vec3(1.0) - color.rgb;\n   *     }\n   *\n   *     return color;\n   * }\n   */\n  czm_backgroundColor: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC4,\n    getValue: function (uniformState) {\n      return uniformState.backgroundColor;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform containing the BRDF look up texture used for image-based lighting computations.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform sampler2D czm_brdfLut;\n   *\n   * // Example: For a given roughness and NdotV value, find the material's BRDF information in the red and green channels\n   * float roughness = 0.5;\n   * float NdotV = dot(normal, view);\n   * vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, 1.0 - roughness)).rg;\n   */\n  czm_brdfLut: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.SAMPLER_2D,\n    getValue: function (uniformState) {\n      return uniformState.brdfLut;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform containing the environment map used within the scene.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform samplerCube czm_environmentMap;\n   *\n   * // Example: Create a perfect reflection of the environment map on a  model\n   * float reflected = reflect(view, normal);\n   * vec4 reflectedColor = texture(czm_environmentMap, reflected);\n   */\n  czm_environmentMap: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.SAMPLER_CUBE,\n    getValue: function (uniformState) {\n      return uniformState.environmentMap;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform containing the specular environment map atlas used within the scene.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform sampler2D czm_specularEnvironmentMaps;\n   */\n  czm_specularEnvironmentMaps: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.SAMPLER_2D,\n    getValue: function (uniformState) {\n      return uniformState.specularEnvironmentMaps;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform containing the size of the specular environment map atlas used within the scene.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec2 czm_specularEnvironmentMapSize;\n   */\n  czm_specularEnvironmentMapSize: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC2,\n    getValue: function (uniformState) {\n      return uniformState.specularEnvironmentMapsDimensions;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform containing the maximum level-of-detail of the specular environment map atlas used within the scene.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform float czm_specularEnvironmentMapsMaximumLOD;\n   */\n  czm_specularEnvironmentMapsMaximumLOD: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.specularEnvironmentMapsMaximumLOD;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform containing the spherical harmonic coefficients used within the scene.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform vec3[9] czm_sphericalHarmonicCoefficients;\n   */\n  czm_sphericalHarmonicCoefficients: new AutomaticUniform({\n    size: 9,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return uniformState.sphericalHarmonicCoefficients;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing a 3x3 rotation matrix that transforms\n   * from True Equator Mean Equinox (TEME) axes to the pseudo-fixed axes at the current scene time.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform mat3 czm_temeToPseudoFixed;\n   *\n   * // Example\n   * vec3 pseudoFixed = czm_temeToPseudoFixed * teme;\n   *\n   * @see UniformState#temeToPseudoFixedMatrix\n   * @see Transforms.computeTemeToPseudoFixedMatrix\n   */\n  czm_temeToPseudoFixed: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_MAT3,\n    getValue: function (uniformState) {\n      return uniformState.temeToPseudoFixedMatrix;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the ratio of canvas coordinate space to canvas pixel space.\n   *\n   * @example\n   * uniform float czm_pixelRatio;\n   */\n  czm_pixelRatio: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.pixelRatio;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform scalar used to mix a color with the fog color based on the distance to the camera.\n   *\n   * @see czm_fog\n   */\n  czm_fogDensity: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.fogDensity;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the splitter position to use when rendering with a splitter.\n   * This will be in pixel coordinates relative to the canvas.\n   *\n   * @example\n   * // GLSL declaration\n   * uniform float czm_splitPosition;\n   */\n  czm_splitPosition: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.splitPosition;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform scalar representing the geometric tolerance per meter\n   */\n  czm_geometricToleranceOverMeter: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.geometricToleranceOverMeter;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform representing the distance from the camera at which to disable the depth test of billboards, labels and points\n   * to, for example, prevent clipping against terrain. When set to zero, the depth test should always be applied. When less than zero,\n   * the depth test should never be applied.\n   */\n  czm_minimumDisableDepthTestDistance: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.minimumDisableDepthTestDistance;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform that will be the highlight color of unclassified 3D Tiles.\n   */\n  czm_invertClassificationColor: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC4,\n    getValue: function (uniformState) {\n      return uniformState.invertClassificationColor;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform that is used for gamma correction.\n   */\n  czm_gamma: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT,\n    getValue: function (uniformState) {\n      return uniformState.gamma;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform that stores the ellipsoid radii.\n   */\n  czm_ellipsoidRadii: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return uniformState.ellipsoid.radii;\n    },\n  }),\n\n  /**\n   * An automatic GLSL uniform that stores the ellipsoid inverse radii.\n   */\n  czm_ellipsoidInverseRadii: new AutomaticUniform({\n    size: 1,\n    datatype: WebGLConstants.FLOAT_VEC3,\n    getValue: function (uniformState) {\n      return uniformState.ellipsoid.oneOverRadii;\n    },\n  }),\n};\nexport default AutomaticUniforms;\n", "/**\n * Creates a Globally unique identifier (GUID) string.  A GUID is 128 bits long, and can guarantee uniqueness across space and time.\n *\n * @function\n *\n * @returns {string}\n *\n *\n * @example\n * this.guid = Cesium.createGuid();\n *\n * @see {@link http://www.ietf.org/rfc/rfc4122.txt|RFC 4122 A Universally Unique IDentifier (UUID) URN Namespace}\n */\nfunction createGuid() {\n  // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript\n  return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n    const r = (Math.random() * 16) | 0;\n    const v = c === \"x\" ? r : (r & 0x3) | 0x8;\n    return v.toString(16);\n  });\n}\nexport default createGuid;\n", "import defaultValue from \"./defaultValue.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\nfunction returnTrue() {\n  return true;\n}\n\n/**\n * Destroys an object.  Each of the object's functions, including functions in its prototype,\n * is replaced with a function that throws a {@link DeveloperError}, except for the object's\n * <code>isDestroyed</code> function, which is set to a function that returns <code>true</code>.\n * The object's properties are removed with <code>delete</code>.\n * <br /><br />\n * This function is used by objects that hold native resources, e.g., WebGL resources, which\n * need to be explicitly released.  Client code calls an object's <code>destroy</code> function,\n * which then releases the native resource and calls <code>destroyObject</code> to put itself\n * in a destroyed state.\n *\n * @function\n *\n * @param {object} object The object to destroy.\n * @param {string} [message] The message to include in the exception that is thrown if\n *                           a destroyed object's function is called.\n *\n *\n * @example\n * // How a texture would destroy itself.\n * this.destroy = function () {\n *     _gl.deleteTexture(_texture);\n *     return Cesium.destroyObject(this);\n * };\n *\n * @see DeveloperError\n */\nfunction destroyObject(object, message) {\n  message = defaultValue(\n    message,\n    \"This object was destroyed, i.e., destroy() was called.\"\n  );\n\n  function throwOnDestroyed() {\n    //>>includeStart('debug', pragmas.debug);\n    throw new DeveloperError(message);\n    //>>includeEnd('debug');\n  }\n\n  for (const key in object) {\n    if (typeof object[key] === \"function\") {\n      object[key] = throwOnDestroyed;\n    }\n  }\n\n  object.isDestroyed = returnTrue;\n\n  return undefined;\n}\nexport default destroyObject;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport WebGLConstants from \"./WebGLConstants.js\";\n\n/**\n * Constants for WebGL index datatypes.  These corresponds to the\n * <code>type</code> parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}.\n *\n * @enum {number}\n */\nconst IndexDatatype = {\n  /**\n   * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type\n   * of an element in <code>Uint8Array</code>.\n   *\n   * @type {number}\n   * @constant\n   */\n  UNSIGNED_BYTE: WebGLConstants.UNSIGNED_BYTE,\n\n  /**\n   * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type\n   * of an element in <code>Uint16Array</code>.\n   *\n   * @type {number}\n   * @constant\n   */\n  UNSIGNED_SHORT: WebGLConstants.UNSIGNED_SHORT,\n\n  /**\n   * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type\n   * of an element in <code>Uint32Array</code>.\n   *\n   * @type {number}\n   * @constant\n   */\n  UNSIGNED_INT: WebGLConstants.UNSIGNED_INT,\n};\n\n/**\n * Returns the size, in bytes, of the corresponding datatype.\n *\n * @param {IndexDatatype} indexDatatype The index datatype to get the size of.\n * @returns {number} The size in bytes.\n *\n * @example\n * // Returns 2\n * const size = Cesium.IndexDatatype.getSizeInBytes(Cesium.IndexDatatype.UNSIGNED_SHORT);\n */\nIndexDatatype.getSizeInBytes = function (indexDatatype) {\n  switch (indexDatatype) {\n    case IndexDatatype.UNSIGNED_BYTE:\n      return Uint8Array.BYTES_PER_ELEMENT;\n    case IndexDatatype.UNSIGNED_SHORT:\n      return Uint16Array.BYTES_PER_ELEMENT;\n    case IndexDatatype.UNSIGNED_INT:\n      return Uint32Array.BYTES_PER_ELEMENT;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  throw new DeveloperError(\n    \"indexDatatype is required and must be a valid IndexDatatype constant.\"\n  );\n  //>>includeEnd('debug');\n};\n\n/**\n * Gets the datatype with a given size in bytes.\n *\n * @param {number} sizeInBytes The size of a single index in bytes.\n * @returns {IndexDatatype} The index datatype with the given size.\n */\nIndexDatatype.fromSizeInBytes = function (sizeInBytes) {\n  switch (sizeInBytes) {\n    case 2:\n      return IndexDatatype.UNSIGNED_SHORT;\n    case 4:\n      return IndexDatatype.UNSIGNED_INT;\n    case 1:\n      return IndexDatatype.UNSIGNED_BYTE;\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\n        \"Size in bytes cannot be mapped to an IndexDatatype\"\n      );\n    //>>includeEnd('debug');\n  }\n};\n\n/**\n * Validates that the provided index datatype is a valid {@link IndexDatatype}.\n *\n * @param {IndexDatatype} indexDatatype The index datatype to validate.\n * @returns {boolean} <code>true</code> if the provided index datatype is a valid value; otherwise, <code>false</code>.\n *\n * @example\n * if (!Cesium.IndexDatatype.validate(indexDatatype)) {\n *   throw new Cesium.DeveloperError('indexDatatype must be a valid value.');\n * }\n */\nIndexDatatype.validate = function (indexDatatype) {\n  return (\n    defined(indexDatatype) &&\n    (indexDatatype === IndexDatatype.UNSIGNED_BYTE ||\n      indexDatatype === IndexDatatype.UNSIGNED_SHORT ||\n      indexDatatype === IndexDatatype.UNSIGNED_INT)\n  );\n};\n\n/**\n * Creates a typed array that will store indices, using either <code><Uint16Array</code>\n * or <code>Uint32Array</code> depending on the number of vertices.\n *\n * @param {number} numberOfVertices Number of vertices that the indices will reference.\n * @param {number|Array} indicesLengthOrArray Passed through to the typed array constructor.\n * @returns {Uint16Array|Uint32Array} A <code>Uint16Array</code> or <code>Uint32Array</code> constructed with <code>indicesLengthOrArray</code>.\n *\n * @example\n * this.indices = Cesium.IndexDatatype.createTypedArray(positions.length / 3, numberOfIndices);\n */\nIndexDatatype.createTypedArray = function (\n  numberOfVertices,\n  indicesLengthOrArray\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(numberOfVertices)) {\n    throw new DeveloperError(\"numberOfVertices is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (numberOfVertices >= CesiumMath.SIXTY_FOUR_KILOBYTES) {\n    return new Uint32Array(indicesLengthOrArray);\n  }\n\n  return new Uint16Array(indicesLengthOrArray);\n};\n\n/**\n * Creates a typed array from a source array buffer.  The resulting typed array will store indices, using either <code><Uint16Array</code>\n * or <code>Uint32Array</code> depending on the number of vertices.\n *\n * @param {number} numberOfVertices Number of vertices that the indices will reference.\n * @param {ArrayBuffer} sourceArray Passed through to the typed array constructor.\n * @param {number} byteOffset Passed through to the typed array constructor.\n * @param {number} length Passed through to the typed array constructor.\n * @returns {Uint16Array|Uint32Array} A <code>Uint16Array</code> or <code>Uint32Array</code> constructed with <code>sourceArray</code>, <code>byteOffset</code>, and <code>length</code>.\n *\n */\nIndexDatatype.createTypedArrayFromArrayBuffer = function (\n  numberOfVertices,\n  sourceArray,\n  byteOffset,\n  length\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(numberOfVertices)) {\n    throw new DeveloperError(\"numberOfVertices is required.\");\n  }\n  if (!defined(sourceArray)) {\n    throw new DeveloperError(\"sourceArray is required.\");\n  }\n  if (!defined(byteOffset)) {\n    throw new DeveloperError(\"byteOffset is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (numberOfVertices >= CesiumMath.SIXTY_FOUR_KILOBYTES) {\n    return new Uint32Array(sourceArray, byteOffset, length);\n  }\n\n  return new Uint16Array(sourceArray, byteOffset, length);\n};\n\n/**\n * Gets the {@link IndexDatatype} for the provided TypedArray instance.\n *\n * @param {Uint8Array|Uint16Array|Uint32Array} array The typed array.\n * @returns {IndexDatatype} The IndexDatatype for the provided array, or undefined if the array is not a Uint8Array, Uint16Array, or Uint32Array.\n */\nIndexDatatype.fromTypedArray = function (array) {\n  if (array instanceof Uint8Array) {\n    return IndexDatatype.UNSIGNED_BYTE;\n  }\n  if (array instanceof Uint16Array) {\n    return IndexDatatype.UNSIGNED_SHORT;\n  }\n  if (array instanceof Uint32Array) {\n    return IndexDatatype.UNSIGNED_INT;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  throw new DeveloperError(\n    \"array must be a Uint8Array, Uint16Array, or Uint32Array.\"\n  );\n  //>>includeEnd('debug');\n};\n\nexport default Object.freeze(IndexDatatype);\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * @private\n */\nconst BufferUsage = {\n  STREAM_DRAW: WebGLConstants.STREAM_DRAW,\n  STATIC_DRAW: WebGLConstants.STATIC_DRAW,\n  DYNAMIC_DRAW: WebGLConstants.DYNAMIC_DRAW,\n\n  validate: function (bufferUsage) {\n    return (\n      bufferUsage === BufferUsage.STREAM_DRAW ||\n      bufferUsage === BufferUsage.STATIC_DRAW ||\n      bufferUsage === BufferUsage.DYNAMIC_DRAW\n    );\n  },\n};\nexport default Object.freeze(BufferUsage);\n", "import Check from \"../Core/Check.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\nimport BufferUsage from \"./BufferUsage.js\";\n\n/**\n * @private\n */\nfunction Buffer(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.context\", options.context);\n\n  if (!defined(options.typedArray) && !defined(options.sizeInBytes)) {\n    throw new DeveloperError(\n      \"Either options.sizeInBytes or options.typedArray is required.\"\n    );\n  }\n\n  if (defined(options.typedArray) && defined(options.sizeInBytes)) {\n    throw new DeveloperError(\n      \"Cannot pass in both options.sizeInBytes and options.typedArray.\"\n    );\n  }\n\n  if (defined(options.typedArray)) {\n    Check.typeOf.object(\"options.typedArray\", options.typedArray);\n    Check.typeOf.number(\n      \"options.typedArray.byteLength\",\n      options.typedArray.byteLength\n    );\n  }\n\n  if (!BufferUsage.validate(options.usage)) {\n    throw new DeveloperError(\"usage is invalid.\");\n  }\n  //>>includeEnd('debug');\n\n  const gl = options.context._gl;\n  const bufferTarget = options.bufferTarget;\n  const typedArray = options.typedArray;\n  let sizeInBytes = options.sizeInBytes;\n  const usage = options.usage;\n  const hasArray = defined(typedArray);\n\n  if (hasArray) {\n    sizeInBytes = typedArray.byteLength;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThan(\"sizeInBytes\", sizeInBytes, 0);\n  //>>includeEnd('debug');\n\n  const buffer = gl.createBuffer();\n  gl.bindBuffer(bufferTarget, buffer);\n  gl.bufferData(bufferTarget, hasArray ? typedArray : sizeInBytes, usage);\n  gl.bindBuffer(bufferTarget, null);\n\n  this._id = createGuid();\n  this._gl = gl;\n  this._webgl2 = options.context._webgl2;\n  this._bufferTarget = bufferTarget;\n  this._sizeInBytes = sizeInBytes;\n  this._usage = usage;\n  this._buffer = buffer;\n  this.vertexArrayDestroyable = true;\n}\n\n/**\n * Creates a vertex buffer, which contains untyped vertex data in GPU-controlled memory.\n * <br /><br />\n * A vertex array defines the actual makeup of a vertex, e.g., positions, normals, texture coordinates,\n * etc., by interpreting the raw data in one or more vertex buffers.\n *\n * @param {object} options An object containing the following properties:\n * @param {Context} options.context The context in which to create the buffer\n * @param {ArrayBufferView} [options.typedArray] A typed array containing the data to copy to the buffer.\n * @param {number} [options.sizeInBytes] A <code>Number</code> defining the size of the buffer in bytes. Required if options.typedArray is not given.\n * @param {BufferUsage} options.usage Specifies the expected usage pattern of the buffer. On some GL implementations, this can significantly affect performance. See {@link BufferUsage}.\n * @returns {VertexBuffer} The vertex buffer, ready to be attached to a vertex array.\n *\n * @exception {DeveloperError} Must specify either <options.typedArray> or <options.sizeInBytes>, but not both.\n * @exception {DeveloperError} The buffer size must be greater than zero.\n * @exception {DeveloperError} Invalid <code>usage</code>.\n *\n *\n * @example\n * // Example 1. Create a dynamic vertex buffer 16 bytes in size.\n * const buffer = Buffer.createVertexBuffer({\n *     context : context,\n *     sizeInBytes : 16,\n *     usage : BufferUsage.DYNAMIC_DRAW\n * });\n *\n * @example\n * // Example 2. Create a dynamic vertex buffer from three floating-point values.\n * // The data copied to the vertex buffer is considered raw bytes until it is\n * // interpreted as vertices using a vertex array.\n * const positionBuffer = buffer.createVertexBuffer({\n *     context : context,\n *     typedArray : new Float32Array([0, 0, 0]),\n *     usage : BufferUsage.STATIC_DRAW\n * });\n *\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGenBuffer.xml|glGenBuffer}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glBindBuffer.xml|glBindBuffer} with <code>ARRAY_BUFFER</code>\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glBufferData.xml|glBufferData} with <code>ARRAY_BUFFER</code>\n */\nBuffer.createVertexBuffer = function (options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.context\", options.context);\n  //>>includeEnd('debug');\n\n  return new Buffer({\n    context: options.context,\n    bufferTarget: WebGLConstants.ARRAY_BUFFER,\n    typedArray: options.typedArray,\n    sizeInBytes: options.sizeInBytes,\n    usage: options.usage,\n  });\n};\n\n/**\n * Creates an index buffer, which contains typed indices in GPU-controlled memory.\n * <br /><br />\n * An index buffer can be attached to a vertex array to select vertices for rendering.\n * <code>Context.draw</code> can render using the entire index buffer or a subset\n * of the index buffer defined by an offset and count.\n *\n * @param {object} options An object containing the following properties:\n * @param {Context} options.context The context in which to create the buffer\n * @param {ArrayBufferView} [options.typedArray] A typed array containing the data to copy to the buffer.\n * @param {number} [options.sizeInBytes] A <code>Number</code> defining the size of the buffer in bytes. Required if options.typedArray is not given.\n * @param {BufferUsage} options.usage Specifies the expected usage pattern of the buffer. On some GL implementations, this can significantly affect performance. See {@link BufferUsage}.\n * @param {IndexDatatype} options.indexDatatype The datatype of indices in the buffer.\n * @returns {IndexBuffer} The index buffer, ready to be attached to a vertex array.\n *\n * @exception {DeveloperError} Must specify either <options.typedArray> or <options.sizeInBytes>, but not both.\n * @exception {DeveloperError} IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.\n * @exception {DeveloperError} The size in bytes must be greater than zero.\n * @exception {DeveloperError} Invalid <code>usage</code>.\n * @exception {DeveloperError} Invalid <code>indexDatatype</code>.\n *\n *\n * @example\n * // Example 1. Create a stream index buffer of unsigned shorts that is\n * // 16 bytes in size.\n * const buffer = Buffer.createIndexBuffer({\n *     context : context,\n *     sizeInBytes : 16,\n *     usage : BufferUsage.STREAM_DRAW,\n *     indexDatatype : IndexDatatype.UNSIGNED_SHORT\n * });\n *\n * @example\n * // Example 2. Create a static index buffer containing three unsigned shorts.\n * const buffer = Buffer.createIndexBuffer({\n *     context : context,\n *     typedArray : new Uint16Array([0, 1, 2]),\n *     usage : BufferUsage.STATIC_DRAW,\n *     indexDatatype : IndexDatatype.UNSIGNED_SHORT\n * });\n *\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGenBuffer.xml|glGenBuffer}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glBindBuffer.xml|glBindBuffer} with <code>ELEMENT_ARRAY_BUFFER</code>\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glBufferData.xml|glBufferData} with <code>ELEMENT_ARRAY_BUFFER</code>\n */\nBuffer.createIndexBuffer = function (options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.context\", options.context);\n\n  if (!IndexDatatype.validate(options.indexDatatype)) {\n    throw new DeveloperError(\"Invalid indexDatatype.\");\n  }\n\n  if (\n    options.indexDatatype === IndexDatatype.UNSIGNED_INT &&\n    !options.context.elementIndexUint\n  ) {\n    throw new DeveloperError(\n      \"IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system.  Check context.elementIndexUint.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const context = options.context;\n  const indexDatatype = options.indexDatatype;\n\n  const bytesPerIndex = IndexDatatype.getSizeInBytes(indexDatatype);\n  const buffer = new Buffer({\n    context: context,\n    bufferTarget: WebGLConstants.ELEMENT_ARRAY_BUFFER,\n    typedArray: options.typedArray,\n    sizeInBytes: options.sizeInBytes,\n    usage: options.usage,\n  });\n\n  const numberOfIndices = buffer.sizeInBytes / bytesPerIndex;\n\n  Object.defineProperties(buffer, {\n    indexDatatype: {\n      get: function () {\n        return indexDatatype;\n      },\n    },\n    bytesPerIndex: {\n      get: function () {\n        return bytesPerIndex;\n      },\n    },\n    numberOfIndices: {\n      get: function () {\n        return numberOfIndices;\n      },\n    },\n  });\n\n  return buffer;\n};\n\nObject.defineProperties(Buffer.prototype, {\n  sizeInBytes: {\n    get: function () {\n      return this._sizeInBytes;\n    },\n  },\n\n  usage: {\n    get: function () {\n      return this._usage;\n    },\n  },\n});\n\nBuffer.prototype._getBuffer = function () {\n  return this._buffer;\n};\n\nBuffer.prototype.copyFromArrayView = function (arrayView, offsetInBytes) {\n  offsetInBytes = defaultValue(offsetInBytes, 0);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"arrayView\", arrayView);\n  Check.typeOf.number.lessThanOrEquals(\n    \"offsetInBytes + arrayView.byteLength\",\n    offsetInBytes + arrayView.byteLength,\n    this._sizeInBytes\n  );\n  //>>includeEnd('debug');\n\n  const gl = this._gl;\n  const target = this._bufferTarget;\n  gl.bindBuffer(target, this._buffer);\n  gl.bufferSubData(target, offsetInBytes, arrayView);\n  gl.bindBuffer(target, null);\n};\n\nBuffer.prototype.copyFromBuffer = function (\n  readBuffer,\n  readOffset,\n  writeOffset,\n  sizeInBytes\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!this._webgl2) {\n    throw new DeveloperError(\"A WebGL 2 context is required.\");\n  }\n  if (!defined(readBuffer)) {\n    throw new DeveloperError(\"readBuffer must be defined.\");\n  }\n  if (!defined(sizeInBytes) || sizeInBytes <= 0) {\n    throw new DeveloperError(\n      \"sizeInBytes must be defined and be greater than zero.\"\n    );\n  }\n  if (\n    !defined(readOffset) ||\n    readOffset < 0 ||\n    readOffset + sizeInBytes > readBuffer._sizeInBytes\n  ) {\n    throw new DeveloperError(\n      \"readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.\"\n    );\n  }\n  if (\n    !defined(writeOffset) ||\n    writeOffset < 0 ||\n    writeOffset + sizeInBytes > this._sizeInBytes\n  ) {\n    throw new DeveloperError(\n      \"writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes.\"\n    );\n  }\n  if (\n    this._buffer === readBuffer._buffer &&\n    ((writeOffset >= readOffset && writeOffset < readOffset + sizeInBytes) ||\n      (readOffset > writeOffset && readOffset < writeOffset + sizeInBytes))\n  ) {\n    throw new DeveloperError(\n      \"When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap.\"\n    );\n  }\n  if (\n    (this._bufferTarget === WebGLConstants.ELEMENT_ARRAY_BUFFER &&\n      readBuffer._bufferTarget !== WebGLConstants.ELEMENT_ARRAY_BUFFER) ||\n    (this._bufferTarget !== WebGLConstants.ELEMENT_ARRAY_BUFFER &&\n      readBuffer._bufferTarget === WebGLConstants.ELEMENT_ARRAY_BUFFER)\n  ) {\n    throw new DeveloperError(\n      \"Can not copy an index buffer into another buffer type.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const readTarget = WebGLConstants.COPY_READ_BUFFER;\n  const writeTarget = WebGLConstants.COPY_WRITE_BUFFER;\n\n  const gl = this._gl;\n  gl.bindBuffer(writeTarget, this._buffer);\n  gl.bindBuffer(readTarget, readBuffer._buffer);\n  gl.copyBufferSubData(\n    readTarget,\n    writeTarget,\n    readOffset,\n    writeOffset,\n    sizeInBytes\n  );\n  gl.bindBuffer(writeTarget, null);\n  gl.bindBuffer(readTarget, null);\n};\n\nBuffer.prototype.getBufferData = function (\n  arrayView,\n  sourceOffset,\n  destinationOffset,\n  length\n) {\n  sourceOffset = defaultValue(sourceOffset, 0);\n  destinationOffset = defaultValue(destinationOffset, 0);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!this._webgl2) {\n    throw new DeveloperError(\"A WebGL 2 context is required.\");\n  }\n  if (!defined(arrayView)) {\n    throw new DeveloperError(\"arrayView is required.\");\n  }\n\n  let copyLength;\n  let elementSize;\n  let arrayLength = arrayView.byteLength;\n  if (!defined(length)) {\n    if (defined(arrayLength)) {\n      copyLength = arrayLength - destinationOffset;\n      elementSize = 1;\n    } else {\n      arrayLength = arrayView.length;\n      copyLength = arrayLength - destinationOffset;\n      elementSize = arrayView.BYTES_PER_ELEMENT;\n    }\n  } else {\n    copyLength = length;\n    if (defined(arrayLength)) {\n      elementSize = 1;\n    } else {\n      arrayLength = arrayView.length;\n      elementSize = arrayView.BYTES_PER_ELEMENT;\n    }\n  }\n\n  if (destinationOffset < 0 || destinationOffset > arrayLength) {\n    throw new DeveloperError(\n      \"destinationOffset must be greater than zero and less than the arrayView length.\"\n    );\n  }\n  if (destinationOffset + copyLength > arrayLength) {\n    throw new DeveloperError(\n      \"destinationOffset + length must be less than or equal to the arrayViewLength.\"\n    );\n  }\n  if (sourceOffset < 0 || sourceOffset > this._sizeInBytes) {\n    throw new DeveloperError(\n      \"sourceOffset must be greater than zero and less than the buffers size.\"\n    );\n  }\n  if (sourceOffset + copyLength * elementSize > this._sizeInBytes) {\n    throw new DeveloperError(\n      \"sourceOffset + length must be less than the buffers size.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const gl = this._gl;\n  const target = WebGLConstants.COPY_READ_BUFFER;\n  gl.bindBuffer(target, this._buffer);\n  gl.getBufferSubData(\n    target,\n    sourceOffset,\n    arrayView,\n    destinationOffset,\n    length\n  );\n  gl.bindBuffer(target, null);\n};\n\nBuffer.prototype.isDestroyed = function () {\n  return false;\n};\n\nBuffer.prototype.destroy = function () {\n  this._gl.deleteBuffer(this._buffer);\n  return destroyObject(this);\n};\nexport default Buffer;\n", "import defined from \"./defined.js\";\n\nlet _supportsFullscreen;\nconst _names = {\n  requestFullscreen: undefined,\n  exitFullscreen: undefined,\n  fullscreenEnabled: undefined,\n  fullscreenElement: undefined,\n  fullscreenchange: undefined,\n  fullscreenerror: undefined,\n};\n\n/**\n * Browser-independent functions for working with the standard fullscreen API.\n *\n * @namespace Fullscreen\n *\n * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification}\n */\nconst Fullscreen = {};\n\nObject.defineProperties(Fullscreen, {\n  /**\n   * The element that is currently fullscreen, if any.  To simply check if the\n   * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.\n   * @memberof Fullscreen\n   * @type {object}\n   * @readonly\n   */\n  element: {\n    get: function () {\n      if (!Fullscreen.supportsFullscreen()) {\n        return undefined;\n      }\n\n      return document[_names.fullscreenElement];\n    },\n  },\n\n  /**\n   * The name of the event on the document that is fired when fullscreen is\n   * entered or exited.  This event name is intended for use with addEventListener.\n   * In your event handler, to determine if the browser is in fullscreen mode or not,\n   * use {@link Fullscreen#fullscreen}.\n   * @memberof Fullscreen\n   * @type {string}\n   * @readonly\n   */\n  changeEventName: {\n    get: function () {\n      if (!Fullscreen.supportsFullscreen()) {\n        return undefined;\n      }\n\n      return _names.fullscreenchange;\n    },\n  },\n\n  /**\n   * The name of the event that is fired when a fullscreen error\n   * occurs.  This event name is intended for use with addEventListener.\n   * @memberof Fullscreen\n   * @type {string}\n   * @readonly\n   */\n  errorEventName: {\n    get: function () {\n      if (!Fullscreen.supportsFullscreen()) {\n        return undefined;\n      }\n\n      return _names.fullscreenerror;\n    },\n  },\n\n  /**\n   * Determine whether the browser will allow an element to be made fullscreen, or not.\n   * For example, by default, iframes cannot go fullscreen unless the containing page\n   * adds an \"allowfullscreen\" attribute (or prefixed equivalent).\n   * @memberof Fullscreen\n   * @type {boolean}\n   * @readonly\n   */\n  enabled: {\n    get: function () {\n      if (!Fullscreen.supportsFullscreen()) {\n        return undefined;\n      }\n\n      return document[_names.fullscreenEnabled];\n    },\n  },\n\n  /**\n   * Determines if the browser is currently in fullscreen mode.\n   * @memberof Fullscreen\n   * @type {boolean}\n   * @readonly\n   */\n  fullscreen: {\n    get: function () {\n      if (!Fullscreen.supportsFullscreen()) {\n        return undefined;\n      }\n\n      return Fullscreen.element !== null;\n    },\n  },\n});\n\n/**\n * Detects whether the browser supports the standard fullscreen API.\n *\n * @returns {boolean} <code>true</code> if the browser supports the standard fullscreen API,\n * <code>false</code> otherwise.\n */\nFullscreen.supportsFullscreen = function () {\n  if (defined(_supportsFullscreen)) {\n    return _supportsFullscreen;\n  }\n\n  _supportsFullscreen = false;\n\n  const body = document.body;\n  if (typeof body.requestFullscreen === \"function\") {\n    // go with the unprefixed, standard set of names\n    _names.requestFullscreen = \"requestFullscreen\";\n    _names.exitFullscreen = \"exitFullscreen\";\n    _names.fullscreenEnabled = \"fullscreenEnabled\";\n    _names.fullscreenElement = \"fullscreenElement\";\n    _names.fullscreenchange = \"fullscreenchange\";\n    _names.fullscreenerror = \"fullscreenerror\";\n    _supportsFullscreen = true;\n    return _supportsFullscreen;\n  }\n\n  //check for the correct combination of prefix plus the various names that browsers use\n  const prefixes = [\"webkit\", \"moz\", \"o\", \"ms\", \"khtml\"];\n  let name;\n  for (let i = 0, len = prefixes.length; i < len; ++i) {\n    const prefix = prefixes[i];\n\n    // casing of Fullscreen differs across browsers\n    name = `${prefix}RequestFullscreen`;\n    if (typeof body[name] === \"function\") {\n      _names.requestFullscreen = name;\n      _supportsFullscreen = true;\n    } else {\n      name = `${prefix}RequestFullScreen`;\n      if (typeof body[name] === \"function\") {\n        _names.requestFullscreen = name;\n        _supportsFullscreen = true;\n      }\n    }\n\n    // disagreement about whether it's \"exit\" as per spec, or \"cancel\"\n    name = `${prefix}ExitFullscreen`;\n    if (typeof document[name] === \"function\") {\n      _names.exitFullscreen = name;\n    } else {\n      name = `${prefix}CancelFullScreen`;\n      if (typeof document[name] === \"function\") {\n        _names.exitFullscreen = name;\n      }\n    }\n\n    // casing of Fullscreen differs across browsers\n    name = `${prefix}FullscreenEnabled`;\n    if (document[name] !== undefined) {\n      _names.fullscreenEnabled = name;\n    } else {\n      name = `${prefix}FullScreenEnabled`;\n      if (document[name] !== undefined) {\n        _names.fullscreenEnabled = name;\n      }\n    }\n\n    // casing of Fullscreen differs across browsers\n    name = `${prefix}FullscreenElement`;\n    if (document[name] !== undefined) {\n      _names.fullscreenElement = name;\n    } else {\n      name = `${prefix}FullScreenElement`;\n      if (document[name] !== undefined) {\n        _names.fullscreenElement = name;\n      }\n    }\n\n    // thankfully, event names are all lowercase per spec\n    name = `${prefix}fullscreenchange`;\n    // event names do not have 'on' in the front, but the property on the document does\n    if (document[`on${name}`] !== undefined) {\n      //except on IE\n      if (prefix === \"ms\") {\n        name = \"MSFullscreenChange\";\n      }\n      _names.fullscreenchange = name;\n    }\n\n    name = `${prefix}fullscreenerror`;\n    if (document[`on${name}`] !== undefined) {\n      //except on IE\n      if (prefix === \"ms\") {\n        name = \"MSFullscreenError\";\n      }\n      _names.fullscreenerror = name;\n    }\n  }\n\n  return _supportsFullscreen;\n};\n\n/**\n * Asynchronously requests the browser to enter fullscreen mode on the given element.\n * If fullscreen mode is not supported by the browser, does nothing.\n *\n * @param {object} element The HTML element which will be placed into fullscreen mode.\n * @param {object} [vrDevice] The HMDVRDevice device.\n *\n * @example\n * // Put the entire page into fullscreen.\n * Cesium.Fullscreen.requestFullscreen(document.body)\n *\n * // Place only the Cesium canvas into fullscreen.\n * Cesium.Fullscreen.requestFullscreen(scene.canvas)\n */\nFullscreen.requestFullscreen = function (element, vrDevice) {\n  if (!Fullscreen.supportsFullscreen()) {\n    return;\n  }\n\n  element[_names.requestFullscreen]({ vrDisplay: vrDevice });\n};\n\n/**\n * Asynchronously exits fullscreen mode.  If the browser is not currently\n * in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.\n */\nFullscreen.exitFullscreen = function () {\n  if (!Fullscreen.supportsFullscreen()) {\n    return;\n  }\n\n  document[_names.exitFullscreen]();\n};\n\n//For unit tests\nFullscreen._names = _names;\nexport default Fullscreen;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Fullscreen from \"./Fullscreen.js\";\n\nlet theNavigator;\nif (typeof navigator !== \"undefined\") {\n  theNavigator = navigator;\n} else {\n  theNavigator = {};\n}\n\nfunction extractVersion(versionString) {\n  const parts = versionString.split(\".\");\n  for (let i = 0, len = parts.length; i < len; ++i) {\n    parts[i] = parseInt(parts[i], 10);\n  }\n  return parts;\n}\n\nlet isChromeResult;\nlet chromeVersionResult;\nfunction isChrome() {\n  if (!defined(isChromeResult)) {\n    isChromeResult = false;\n    // Edge contains Chrome in the user agent too\n    if (!isEdge()) {\n      const fields = / Chrome\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n      if (fields !== null) {\n        isChromeResult = true;\n        chromeVersionResult = extractVersion(fields[1]);\n      }\n    }\n  }\n\n  return isChromeResult;\n}\n\nfunction chromeVersion() {\n  return isChrome() && chromeVersionResult;\n}\n\nlet isSafariResult;\nlet safariVersionResult;\nfunction isSafari() {\n  if (!defined(isSafariResult)) {\n    isSafariResult = false;\n\n    // Chrome and Edge contain Safari in the user agent too\n    if (\n      !isChrome() &&\n      !isEdge() &&\n      / Safari\\/[\\.0-9]+/.test(theNavigator.userAgent)\n    ) {\n      const fields = / Version\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n      if (fields !== null) {\n        isSafariResult = true;\n        safariVersionResult = extractVersion(fields[1]);\n      }\n    }\n  }\n\n  return isSafariResult;\n}\n\nfunction safariVersion() {\n  return isSafari() && safariVersionResult;\n}\n\nlet isWebkitResult;\nlet webkitVersionResult;\nfunction isWebkit() {\n  if (!defined(isWebkitResult)) {\n    isWebkitResult = false;\n\n    const fields = / AppleWebKit\\/([\\.0-9]+)(\\+?)/.exec(theNavigator.userAgent);\n    if (fields !== null) {\n      isWebkitResult = true;\n      webkitVersionResult = extractVersion(fields[1]);\n      webkitVersionResult.isNightly = !!fields[2];\n    }\n  }\n\n  return isWebkitResult;\n}\n\nfunction webkitVersion() {\n  return isWebkit() && webkitVersionResult;\n}\n\nlet isInternetExplorerResult;\nlet internetExplorerVersionResult;\nfunction isInternetExplorer() {\n  if (!defined(isInternetExplorerResult)) {\n    isInternetExplorerResult = false;\n\n    let fields;\n    if (theNavigator.appName === \"Microsoft Internet Explorer\") {\n      fields = /MSIE ([0-9]{1,}[\\.0-9]{0,})/.exec(theNavigator.userAgent);\n      if (fields !== null) {\n        isInternetExplorerResult = true;\n        internetExplorerVersionResult = extractVersion(fields[1]);\n      }\n    } else if (theNavigator.appName === \"Netscape\") {\n      fields = /Trident\\/.*rv:([0-9]{1,}[\\.0-9]{0,})/.exec(\n        theNavigator.userAgent\n      );\n      if (fields !== null) {\n        isInternetExplorerResult = true;\n        internetExplorerVersionResult = extractVersion(fields[1]);\n      }\n    }\n  }\n  return isInternetExplorerResult;\n}\n\nfunction internetExplorerVersion() {\n  return isInternetExplorer() && internetExplorerVersionResult;\n}\n\nlet isEdgeResult;\nlet edgeVersionResult;\nfunction isEdge() {\n  if (!defined(isEdgeResult)) {\n    isEdgeResult = false;\n    const fields = / Edg\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n    if (fields !== null) {\n      isEdgeResult = true;\n      edgeVersionResult = extractVersion(fields[1]);\n    }\n  }\n  return isEdgeResult;\n}\n\nfunction edgeVersion() {\n  return isEdge() && edgeVersionResult;\n}\n\nlet isFirefoxResult;\nlet firefoxVersionResult;\nfunction isFirefox() {\n  if (!defined(isFirefoxResult)) {\n    isFirefoxResult = false;\n\n    const fields = /Firefox\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n    if (fields !== null) {\n      isFirefoxResult = true;\n      firefoxVersionResult = extractVersion(fields[1]);\n    }\n  }\n  return isFirefoxResult;\n}\n\nlet isWindowsResult;\nfunction isWindows() {\n  if (!defined(isWindowsResult)) {\n    isWindowsResult = /Windows/i.test(theNavigator.appVersion);\n  }\n  return isWindowsResult;\n}\n\nlet isIPadOrIOSResult;\nfunction isIPadOrIOS() {\n  if (!defined(isIPadOrIOSResult)) {\n    isIPadOrIOSResult =\n      navigator.platform === \"iPhone\" ||\n      navigator.platform === \"iPod\" ||\n      navigator.platform === \"iPad\";\n  }\n\n  return isIPadOrIOSResult;\n}\n\nfunction firefoxVersion() {\n  return isFirefox() && firefoxVersionResult;\n}\n\nlet hasPointerEvents;\nfunction supportsPointerEvents() {\n  if (!defined(hasPointerEvents)) {\n    //While navigator.pointerEnabled is deprecated in the W3C specification\n    //we still need to use it if it exists in order to support browsers\n    //that rely on it, such as the Windows WebBrowser control which defines\n    //PointerEvent but sets navigator.pointerEnabled to false.\n\n    //Firefox disabled because of https://github.com/CesiumGS/cesium/issues/6372\n    hasPointerEvents =\n      !isFirefox() &&\n      typeof PointerEvent !== \"undefined\" &&\n      (!defined(theNavigator.pointerEnabled) || theNavigator.pointerEnabled);\n  }\n  return hasPointerEvents;\n}\n\nlet imageRenderingValueResult;\nlet supportsImageRenderingPixelatedResult;\nfunction supportsImageRenderingPixelated() {\n  if (!defined(supportsImageRenderingPixelatedResult)) {\n    const canvas = document.createElement(\"canvas\");\n    canvas.setAttribute(\n      \"style\",\n      \"image-rendering: -moz-crisp-edges;\" + \"image-rendering: pixelated;\"\n    );\n    //canvas.style.imageRendering will be undefined, null or an empty string on unsupported browsers.\n    const tmp = canvas.style.imageRendering;\n    supportsImageRenderingPixelatedResult = defined(tmp) && tmp !== \"\";\n    if (supportsImageRenderingPixelatedResult) {\n      imageRenderingValueResult = tmp;\n    }\n  }\n  return supportsImageRenderingPixelatedResult;\n}\n\nfunction imageRenderingValue() {\n  return supportsImageRenderingPixelated()\n    ? imageRenderingValueResult\n    : undefined;\n}\n\nfunction supportsWebP() {\n  //>>includeStart('debug', pragmas.debug);\n  if (!supportsWebP.initialized) {\n    throw new DeveloperError(\n      \"You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP\"\n    );\n  }\n  //>>includeEnd('debug');\n  return supportsWebP._result;\n}\nsupportsWebP._promise = undefined;\nsupportsWebP._result = undefined;\nsupportsWebP.initialize = function () {\n  // From https://developers.google.com/speed/webp/faq#how_can_i_detect_browser_support_for_webp\n  if (defined(supportsWebP._promise)) {\n    return supportsWebP._promise;\n  }\n\n  supportsWebP._promise = new Promise((resolve) => {\n    const image = new Image();\n    image.onload = function () {\n      supportsWebP._result = image.width > 0 && image.height > 0;\n      resolve(supportsWebP._result);\n    };\n\n    image.onerror = function () {\n      supportsWebP._result = false;\n      resolve(supportsWebP._result);\n    };\n    image.src =\n      \"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA\";\n  });\n\n  return supportsWebP._promise;\n};\nObject.defineProperties(supportsWebP, {\n  initialized: {\n    get: function () {\n      return defined(supportsWebP._result);\n    },\n  },\n});\n\nconst typedArrayTypes = [];\nif (typeof ArrayBuffer !== \"undefined\") {\n  typedArrayTypes.push(\n    Int8Array,\n    Uint8Array,\n    Int16Array,\n    Uint16Array,\n    Int32Array,\n    Uint32Array,\n    Float32Array,\n    Float64Array\n  );\n\n  if (typeof Uint8ClampedArray !== \"undefined\") {\n    typedArrayTypes.push(Uint8ClampedArray);\n  }\n\n  if (typeof Uint8ClampedArray !== \"undefined\") {\n    typedArrayTypes.push(Uint8ClampedArray);\n  }\n\n  if (typeof BigInt64Array !== \"undefined\") {\n    // eslint-disable-next-line no-undef\n    typedArrayTypes.push(BigInt64Array);\n  }\n\n  if (typeof BigUint64Array !== \"undefined\") {\n    // eslint-disable-next-line no-undef\n    typedArrayTypes.push(BigUint64Array);\n  }\n}\n\n/**\n * A set of functions to detect whether the current browser supports\n * various features.\n *\n * @namespace FeatureDetection\n */\nconst FeatureDetection = {\n  isChrome: isChrome,\n  chromeVersion: chromeVersion,\n  isSafari: isSafari,\n  safariVersion: safariVersion,\n  isWebkit: isWebkit,\n  webkitVersion: webkitVersion,\n  isInternetExplorer: isInternetExplorer,\n  internetExplorerVersion: internetExplorerVersion,\n  isEdge: isEdge,\n  edgeVersion: edgeVersion,\n  isFirefox: isFirefox,\n  firefoxVersion: firefoxVersion,\n  isWindows: isWindows,\n  isIPadOrIOS: isIPadOrIOS,\n  hardwareConcurrency: defaultValue(theNavigator.hardwareConcurrency, 3),\n  supportsPointerEvents: supportsPointerEvents,\n  supportsImageRenderingPixelated: supportsImageRenderingPixelated,\n  supportsWebP: supportsWebP,\n  imageRenderingValue: imageRenderingValue,\n  typedArrayTypes: typedArrayTypes,\n};\n\n/**\n * Detects whether the current browser supports Basis Universal textures and the web assembly modules needed to transcode them.\n *\n * @param {Scene} scene\n * @returns {boolean} true if the browser supports web assembly modules and the scene supports Basis Universal textures, false if not.\n */\nFeatureDetection.supportsBasis = function (scene) {\n  return FeatureDetection.supportsWebAssembly() && scene.context.supportsBasis;\n};\n\n/**\n * Detects whether the current browser supports the full screen standard.\n *\n * @returns {boolean} true if the browser supports the full screen standard, false if not.\n *\n * @see Fullscreen\n * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification}\n */\nFeatureDetection.supportsFullscreen = function () {\n  return Fullscreen.supportsFullscreen();\n};\n\n/**\n * Detects whether the current browser supports typed arrays.\n *\n * @returns {boolean} true if the browser supports typed arrays, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\n */\nFeatureDetection.supportsTypedArrays = function () {\n  return typeof ArrayBuffer !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports BigInt64Array typed arrays.\n *\n * @returns {boolean} true if the browser supports BigInt64Array typed arrays, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\n */\nFeatureDetection.supportsBigInt64Array = function () {\n  return typeof BigInt64Array !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports BigUint64Array typed arrays.\n *\n * @returns {boolean} true if the browser supports BigUint64Array typed arrays, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\n */\nFeatureDetection.supportsBigUint64Array = function () {\n  return typeof BigUint64Array !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports BigInt.\n *\n * @returns {boolean} true if the browser supports BigInt, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-bigint-objects|BigInt Specification}\n */\nFeatureDetection.supportsBigInt = function () {\n  return typeof BigInt !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports Web Workers.\n *\n * @returns {boolean} true if the browsers supports Web Workers, false if not.\n *\n * @see {@link http://www.w3.org/TR/workers/}\n */\nFeatureDetection.supportsWebWorkers = function () {\n  return typeof Worker !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports Web Assembly.\n *\n * @returns {boolean} true if the browsers supports Web Assembly, false if not.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/WebAssembly}\n */\nFeatureDetection.supportsWebAssembly = function () {\n  return typeof WebAssembly !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports a WebGL2 rendering context for the specified scene.\n *\n * @param {Scene} scene the Cesium scene specifying the rendering context\n * @returns {boolean} true if the browser supports a WebGL2 rendering context, false if not.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext|WebGL2RenderingContext}\n */\nFeatureDetection.supportsWebgl2 = function (scene) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"scene\", scene);\n  //>>includeEnd('debug');\n\n  return scene.context.webgl2;\n};\n\n/**\n * Detects whether the current browser supports ECMAScript modules in web workers.\n * @returns {boolean} true if the browser supports ECMAScript modules in web workers.\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Worker|Worker}\n */\nFeatureDetection.supportsEsmWebWorkers = function () {\n  return !isFirefox() || parseInt(firefoxVersionResult) >= 114;\n};\n\nexport default FeatureDetection;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport FeatureDetection from \"./FeatureDetection.js\";\nimport CesiumMath from \"./Math.js\";\n\nfunction hue2rgb(m1, m2, h) {\n  if (h < 0) {\n    h += 1;\n  }\n  if (h > 1) {\n    h -= 1;\n  }\n  if (h * 6 < 1) {\n    return m1 + (m2 - m1) * 6 * h;\n  }\n  if (h * 2 < 1) {\n    return m2;\n  }\n  if (h * 3 < 2) {\n    return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n  }\n  return m1;\n}\n\n/**\n * A color, specified using red, green, blue, and alpha values,\n * which range from <code>0</code> (no intensity) to <code>1.0</code> (full intensity).\n * @param {number} [red=1.0] The red component.\n * @param {number} [green=1.0] The green component.\n * @param {number} [blue=1.0] The blue component.\n * @param {number} [alpha=1.0] The alpha component.\n *\n * @constructor\n * @alias Color\n *\n * @see Packable\n */\nfunction Color(red, green, blue, alpha) {\n  /**\n   * The red component.\n   * @type {number}\n   * @default 1.0\n   */\n  this.red = defaultValue(red, 1.0);\n  /**\n   * The green component.\n   * @type {number}\n   * @default 1.0\n   */\n  this.green = defaultValue(green, 1.0);\n  /**\n   * The blue component.\n   * @type {number}\n   * @default 1.0\n   */\n  this.blue = defaultValue(blue, 1.0);\n  /**\n   * The alpha component.\n   * @type {number}\n   * @default 1.0\n   */\n  this.alpha = defaultValue(alpha, 1.0);\n}\n\n/**\n * Creates a Color instance from a {@link Cartesian4}. <code>x</code>, <code>y</code>, <code>z</code>,\n * and <code>w</code> map to <code>red</code>, <code>green</code>, <code>blue</code>, and <code>alpha</code>, respectively.\n *\n * @param {Cartesian4} cartesian The source cartesian.\n * @param {Color} [result] The object onto which to store the result.\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n */\nColor.fromCartesian4 = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Color(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n  }\n\n  result.red = cartesian.x;\n  result.green = cartesian.y;\n  result.blue = cartesian.z;\n  result.alpha = cartesian.w;\n  return result;\n};\n\n/**\n * Creates a new Color specified using red, green, blue, and alpha values\n * that are in the range of 0 to 255, converting them internally to a range of 0.0 to 1.0.\n *\n * @param {number} [red=255] The red component.\n * @param {number} [green=255] The green component.\n * @param {number} [blue=255] The blue component.\n * @param {number} [alpha=255] The alpha component.\n * @param {Color} [result] The object onto which to store the result.\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n */\nColor.fromBytes = function (red, green, blue, alpha, result) {\n  red = Color.byteToFloat(defaultValue(red, 255.0));\n  green = Color.byteToFloat(defaultValue(green, 255.0));\n  blue = Color.byteToFloat(defaultValue(blue, 255.0));\n  alpha = Color.byteToFloat(defaultValue(alpha, 255.0));\n\n  if (!defined(result)) {\n    return new Color(red, green, blue, alpha);\n  }\n\n  result.red = red;\n  result.green = green;\n  result.blue = blue;\n  result.alpha = alpha;\n  return result;\n};\n\n/**\n * Creates a new Color that has the same red, green, and blue components\n * of the specified color, but with the specified alpha value.\n *\n * @param {Color} color The base color\n * @param {number} alpha The new alpha component.\n * @param {Color} [result] The object onto which to store the result.\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n *\n * @example const translucentRed = Cesium.Color.fromAlpha(Cesium.Color.RED, 0.9);\n */\nColor.fromAlpha = function (color, alpha, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"color\", color);\n  Check.typeOf.number(\"alpha\", alpha);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Color(color.red, color.green, color.blue, alpha);\n  }\n\n  result.red = color.red;\n  result.green = color.green;\n  result.blue = color.blue;\n  result.alpha = alpha;\n  return result;\n};\n\nlet scratchArrayBuffer;\nlet scratchUint32Array;\nlet scratchUint8Array;\nif (FeatureDetection.supportsTypedArrays()) {\n  scratchArrayBuffer = new ArrayBuffer(4);\n  scratchUint32Array = new Uint32Array(scratchArrayBuffer);\n  scratchUint8Array = new Uint8Array(scratchArrayBuffer);\n}\n\n/**\n * Creates a new Color from a single numeric unsigned 32-bit RGBA value, using the endianness\n * of the system.\n *\n * @param {number} rgba A single numeric unsigned 32-bit RGBA value.\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\n * @returns {Color} The color object.\n *\n * @example\n * const color = Cesium.Color.fromRgba(0x67ADDFFF);\n *\n * @see Color#toRgba\n */\nColor.fromRgba = function (rgba, result) {\n  // scratchUint32Array and scratchUint8Array share an underlying array buffer\n  scratchUint32Array[0] = rgba;\n  return Color.fromBytes(\n    scratchUint8Array[0],\n    scratchUint8Array[1],\n    scratchUint8Array[2],\n    scratchUint8Array[3],\n    result\n  );\n};\n\n/**\n * Creates a Color instance from hue, saturation, and lightness.\n *\n * @param {number} [hue=0] The hue angle 0...1\n * @param {number} [saturation=0] The saturation value 0...1\n * @param {number} [lightness=0] The lightness value 0...1\n * @param {number} [alpha=1.0] The alpha component 0...1\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\n * @returns {Color} The color object.\n *\n * @see {@link http://www.w3.org/TR/css3-color/#hsl-color|CSS color values}\n */\nColor.fromHsl = function (hue, saturation, lightness, alpha, result) {\n  hue = defaultValue(hue, 0.0) % 1.0;\n  saturation = defaultValue(saturation, 0.0);\n  lightness = defaultValue(lightness, 0.0);\n  alpha = defaultValue(alpha, 1.0);\n\n  let red = lightness;\n  let green = lightness;\n  let blue = lightness;\n\n  if (saturation !== 0) {\n    let m2;\n    if (lightness < 0.5) {\n      m2 = lightness * (1 + saturation);\n    } else {\n      m2 = lightness + saturation - lightness * saturation;\n    }\n\n    const m1 = 2.0 * lightness - m2;\n    red = hue2rgb(m1, m2, hue + 1 / 3);\n    green = hue2rgb(m1, m2, hue);\n    blue = hue2rgb(m1, m2, hue - 1 / 3);\n  }\n\n  if (!defined(result)) {\n    return new Color(red, green, blue, alpha);\n  }\n\n  result.red = red;\n  result.green = green;\n  result.blue = blue;\n  result.alpha = alpha;\n  return result;\n};\n\n/**\n * Creates a random color using the provided options. For reproducible random colors, you should\n * call {@link CesiumMath#setRandomNumberSeed} once at the beginning of your application.\n *\n * @param {object} [options] Object with the following properties:\n * @param {number} [options.red] If specified, the red component to use instead of a randomized value.\n * @param {number} [options.minimumRed=0.0] The maximum red value to generate if none was specified.\n * @param {number} [options.maximumRed=1.0] The minimum red value to generate if none was specified.\n * @param {number} [options.green] If specified, the green component to use instead of a randomized value.\n * @param {number} [options.minimumGreen=0.0] The maximum green value to generate if none was specified.\n * @param {number} [options.maximumGreen=1.0] The minimum green value to generate if none was specified.\n * @param {number} [options.blue] If specified, the blue component to use instead of a randomized value.\n * @param {number} [options.minimumBlue=0.0] The maximum blue value to generate if none was specified.\n * @param {number} [options.maximumBlue=1.0] The minimum blue value to generate if none was specified.\n * @param {number} [options.alpha] If specified, the alpha component to use instead of a randomized value.\n * @param {number} [options.minimumAlpha=0.0] The maximum alpha value to generate if none was specified.\n * @param {number} [options.maximumAlpha=1.0] The minimum alpha value to generate if none was specified.\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\n * @returns {Color} The modified result parameter or a new instance if result was undefined.\n *\n * @exception {DeveloperError} minimumRed must be less than or equal to maximumRed.\n * @exception {DeveloperError} minimumGreen must be less than or equal to maximumGreen.\n * @exception {DeveloperError} minimumBlue must be less than or equal to maximumBlue.\n * @exception {DeveloperError} minimumAlpha must be less than or equal to maximumAlpha.\n *\n * @example\n * //Create a completely random color\n * const color = Cesium.Color.fromRandom();\n *\n * //Create a random shade of yellow.\n * const color1 = Cesium.Color.fromRandom({\n *     red : 1.0,\n *     green : 1.0,\n *     alpha : 1.0\n * });\n *\n * //Create a random bright color.\n * const color2 = Cesium.Color.fromRandom({\n *     minimumRed : 0.75,\n *     minimumGreen : 0.75,\n *     minimumBlue : 0.75,\n *     alpha : 1.0\n * });\n */\nColor.fromRandom = function (options, result) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  let red = options.red;\n  if (!defined(red)) {\n    const minimumRed = defaultValue(options.minimumRed, 0);\n    const maximumRed = defaultValue(options.maximumRed, 1.0);\n\n    //>>includeStart('debug', pragmas.debug);\n    Check.typeOf.number.lessThanOrEquals(\"minimumRed\", minimumRed, maximumRed);\n    //>>includeEnd('debug');\n\n    red =\n      minimumRed + CesiumMath.nextRandomNumber() * (maximumRed - minimumRed);\n  }\n\n  let green = options.green;\n  if (!defined(green)) {\n    const minimumGreen = defaultValue(options.minimumGreen, 0);\n    const maximumGreen = defaultValue(options.maximumGreen, 1.0);\n\n    //>>includeStart('debug', pragmas.debug);\n    Check.typeOf.number.lessThanOrEquals(\n      \"minimumGreen\",\n      minimumGreen,\n      maximumGreen\n    );\n    //>>includeEnd('debug');\n    green =\n      minimumGreen +\n      CesiumMath.nextRandomNumber() * (maximumGreen - minimumGreen);\n  }\n\n  let blue = options.blue;\n  if (!defined(blue)) {\n    const minimumBlue = defaultValue(options.minimumBlue, 0);\n    const maximumBlue = defaultValue(options.maximumBlue, 1.0);\n\n    //>>includeStart('debug', pragmas.debug);\n    Check.typeOf.number.lessThanOrEquals(\n      \"minimumBlue\",\n      minimumBlue,\n      maximumBlue\n    );\n    //>>includeEnd('debug');\n\n    blue =\n      minimumBlue + CesiumMath.nextRandomNumber() * (maximumBlue - minimumBlue);\n  }\n\n  let alpha = options.alpha;\n  if (!defined(alpha)) {\n    const minimumAlpha = defaultValue(options.minimumAlpha, 0);\n    const maximumAlpha = defaultValue(options.maximumAlpha, 1.0);\n\n    //>>includeStart('debug', pragmas.debug);\n    Check.typeOf.number.lessThanOrEquals(\n      \"minumumAlpha\",\n      minimumAlpha,\n      maximumAlpha\n    );\n    //>>includeEnd('debug');\n\n    alpha =\n      minimumAlpha +\n      CesiumMath.nextRandomNumber() * (maximumAlpha - minimumAlpha);\n  }\n\n  if (!defined(result)) {\n    return new Color(red, green, blue, alpha);\n  }\n\n  result.red = red;\n  result.green = green;\n  result.blue = blue;\n  result.alpha = alpha;\n  return result;\n};\n\n//#rgba\nconst rgbaMatcher = /^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i;\n//#rrggbbaa\nconst rrggbbaaMatcher = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i;\n//rgb(), rgba(), or rgb%()\nconst rgbParenthesesMatcher = /^rgba?\\s*\\(\\s*([0-9.]+%?)\\s*[,\\s]+\\s*([0-9.]+%?)\\s*[,\\s]+\\s*([0-9.]+%?)(?:\\s*[,\\s/]+\\s*([0-9.]+))?\\s*\\)$/i;\n//hsl() or hsla()\nconst hslParenthesesMatcher = /^hsla?\\s*\\(\\s*([0-9.]+)\\s*[,\\s]+\\s*([0-9.]+%)\\s*[,\\s]+\\s*([0-9.]+%)(?:\\s*[,\\s/]+\\s*([0-9.]+))?\\s*\\)$/i;\n\n/**\n * Creates a Color instance from a CSS color value.\n *\n * @param {string} color The CSS color value in #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), or hsla() format.\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\n * @returns {Color} The color object, or undefined if the string was not a valid CSS color.\n *\n *\n * @example\n * const cesiumBlue = Cesium.Color.fromCssColorString('#67ADDF');\n * const green = Cesium.Color.fromCssColorString('green');\n *\n * @see {@link http://www.w3.org/TR/css3-color|CSS color values}\n */\nColor.fromCssColorString = function (color, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"color\", color);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Color();\n  }\n\n  // Remove all surrounding whitespaces from the color string\n  color = color.trim();\n\n  const namedColor = Color[color.toUpperCase()];\n  if (defined(namedColor)) {\n    Color.clone(namedColor, result);\n    return result;\n  }\n\n  let matches = rgbaMatcher.exec(color);\n  if (matches !== null) {\n    result.red = parseInt(matches[1], 16) / 15;\n    result.green = parseInt(matches[2], 16) / 15.0;\n    result.blue = parseInt(matches[3], 16) / 15.0;\n    result.alpha = parseInt(defaultValue(matches[4], \"f\"), 16) / 15.0;\n    return result;\n  }\n\n  matches = rrggbbaaMatcher.exec(color);\n  if (matches !== null) {\n    result.red = parseInt(matches[1], 16) / 255.0;\n    result.green = parseInt(matches[2], 16) / 255.0;\n    result.blue = parseInt(matches[3], 16) / 255.0;\n    result.alpha = parseInt(defaultValue(matches[4], \"ff\"), 16) / 255.0;\n    return result;\n  }\n\n  matches = rgbParenthesesMatcher.exec(color);\n  if (matches !== null) {\n    result.red =\n      parseFloat(matches[1]) / (\"%\" === matches[1].substr(-1) ? 100.0 : 255.0);\n    result.green =\n      parseFloat(matches[2]) / (\"%\" === matches[2].substr(-1) ? 100.0 : 255.0);\n    result.blue =\n      parseFloat(matches[3]) / (\"%\" === matches[3].substr(-1) ? 100.0 : 255.0);\n    result.alpha = parseFloat(defaultValue(matches[4], \"1.0\"));\n    return result;\n  }\n\n  matches = hslParenthesesMatcher.exec(color);\n  if (matches !== null) {\n    return Color.fromHsl(\n      parseFloat(matches[1]) / 360.0,\n      parseFloat(matches[2]) / 100.0,\n      parseFloat(matches[3]) / 100.0,\n      parseFloat(defaultValue(matches[4], \"1.0\")),\n      result\n    );\n  }\n\n  result = undefined;\n  return result;\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nColor.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Color} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nColor.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n  array[startingIndex++] = value.red;\n  array[startingIndex++] = value.green;\n  array[startingIndex++] = value.blue;\n  array[startingIndex] = value.alpha;\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Color} [result] The object into which to store the result.\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n */\nColor.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n  if (!defined(result)) {\n    result = new Color();\n  }\n  result.red = array[startingIndex++];\n  result.green = array[startingIndex++];\n  result.blue = array[startingIndex++];\n  result.alpha = array[startingIndex];\n  return result;\n};\n\n/**\n * Converts a 'byte' color component in the range of 0 to 255 into\n * a 'float' color component in the range of 0 to 1.0.\n *\n * @param {number} number The number to be converted.\n * @returns {number} The converted number.\n */\nColor.byteToFloat = function (number) {\n  return number / 255.0;\n};\n\n/**\n * Converts a 'float' color component in the range of 0 to 1.0 into\n * a 'byte' color component in the range of 0 to 255.\n *\n * @param {number} number The number to be converted.\n * @returns {number} The converted number.\n */\nColor.floatToByte = function (number) {\n  return number === 1.0 ? 255.0 : (number * 256.0) | 0;\n};\n\n/**\n * Duplicates a Color.\n *\n * @param {Color} color The Color to duplicate.\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\n * @returns {Color} The modified result parameter or a new instance if result was undefined. (Returns undefined if color is undefined)\n */\nColor.clone = function (color, result) {\n  if (!defined(color)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    return new Color(color.red, color.green, color.blue, color.alpha);\n  }\n  result.red = color.red;\n  result.green = color.green;\n  result.blue = color.blue;\n  result.alpha = color.alpha;\n  return result;\n};\n\n/**\n * Returns true if the first Color equals the second color.\n *\n * @param {Color} left The first Color to compare for equality.\n * @param {Color} right The second Color to compare for equality.\n * @returns {boolean} <code>true</code> if the Colors are equal; otherwise, <code>false</code>.\n */\nColor.equals = function (left, right) {\n  return (\n    left === right || //\n    (defined(left) && //\n      defined(right) && //\n      left.red === right.red && //\n      left.green === right.green && //\n      left.blue === right.blue && //\n      left.alpha === right.alpha)\n  );\n};\n\n/**\n * @private\n */\nColor.equalsArray = function (color, array, offset) {\n  return (\n    color.red === array[offset] &&\n    color.green === array[offset + 1] &&\n    color.blue === array[offset + 2] &&\n    color.alpha === array[offset + 3]\n  );\n};\n\n/**\n * Returns a duplicate of a Color instance.\n *\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\n * @returns {Color} The modified result parameter or a new instance if result was undefined.\n */\nColor.prototype.clone = function (result) {\n  return Color.clone(this, result);\n};\n\n/**\n * Returns true if this Color equals other.\n *\n * @param {Color} other The Color to compare for equality.\n * @returns {boolean} <code>true</code> if the Colors are equal; otherwise, <code>false</code>.\n */\nColor.prototype.equals = function (other) {\n  return Color.equals(this, other);\n};\n\n/**\n * Returns <code>true</code> if this Color equals other componentwise within the specified epsilon.\n *\n * @param {Color} other The Color to compare for equality.\n * @param {number} [epsilon=0.0] The epsilon to use for equality testing.\n * @returns {boolean} <code>true</code> if the Colors are equal within the specified epsilon; otherwise, <code>false</code>.\n */\nColor.prototype.equalsEpsilon = function (other, epsilon) {\n  return (\n    this === other || //\n    (defined(other) && //\n      Math.abs(this.red - other.red) <= epsilon && //\n      Math.abs(this.green - other.green) <= epsilon && //\n      Math.abs(this.blue - other.blue) <= epsilon && //\n      Math.abs(this.alpha - other.alpha) <= epsilon)\n  );\n};\n\n/**\n * Creates a string representing this Color in the format '(red, green, blue, alpha)'.\n *\n * @returns {string} A string representing this Color in the format '(red, green, blue, alpha)'.\n */\nColor.prototype.toString = function () {\n  return `(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;\n};\n\n/**\n * Creates a string containing the CSS color value for this color.\n *\n * @returns {string} The CSS equivalent of this color.\n *\n * @see {@link http://www.w3.org/TR/css3-color/#rgba-color|CSS RGB or RGBA color values}\n */\nColor.prototype.toCssColorString = function () {\n  const red = Color.floatToByte(this.red);\n  const green = Color.floatToByte(this.green);\n  const blue = Color.floatToByte(this.blue);\n  if (this.alpha === 1) {\n    return `rgb(${red},${green},${blue})`;\n  }\n  return `rgba(${red},${green},${blue},${this.alpha})`;\n};\n\n/**\n * Creates a string containing CSS hex string color value for this color.\n *\n * @returns {string} The CSS hex string equivalent of this color.\n */\nColor.prototype.toCssHexString = function () {\n  let r = Color.floatToByte(this.red).toString(16);\n  if (r.length < 2) {\n    r = `0${r}`;\n  }\n  let g = Color.floatToByte(this.green).toString(16);\n  if (g.length < 2) {\n    g = `0${g}`;\n  }\n  let b = Color.floatToByte(this.blue).toString(16);\n  if (b.length < 2) {\n    b = `0${b}`;\n  }\n  if (this.alpha < 1) {\n    let hexAlpha = Color.floatToByte(this.alpha).toString(16);\n    if (hexAlpha.length < 2) {\n      hexAlpha = `0${hexAlpha}`;\n    }\n    return `#${r}${g}${b}${hexAlpha}`;\n  }\n  return `#${r}${g}${b}`;\n};\n\n/**\n * Converts this color to an array of red, green, blue, and alpha values\n * that are in the range of 0 to 255.\n *\n * @param {number[]} [result] The array to store the result in, if undefined a new instance will be created.\n * @returns {number[]} The modified result parameter or a new instance if result was undefined.\n */\nColor.prototype.toBytes = function (result) {\n  const red = Color.floatToByte(this.red);\n  const green = Color.floatToByte(this.green);\n  const blue = Color.floatToByte(this.blue);\n  const alpha = Color.floatToByte(this.alpha);\n\n  if (!defined(result)) {\n    return [red, green, blue, alpha];\n  }\n  result[0] = red;\n  result[1] = green;\n  result[2] = blue;\n  result[3] = alpha;\n  return result;\n};\n\n/**\n * Converts this color to a single numeric unsigned 32-bit RGBA value, using the endianness\n * of the system.\n *\n * @returns {number} A single numeric unsigned 32-bit RGBA value.\n *\n *\n * @example\n * const rgba = Cesium.Color.BLUE.toRgba();\n *\n * @see Color.fromRgba\n */\nColor.prototype.toRgba = function () {\n  // scratchUint32Array and scratchUint8Array share an underlying array buffer\n  scratchUint8Array[0] = Color.floatToByte(this.red);\n  scratchUint8Array[1] = Color.floatToByte(this.green);\n  scratchUint8Array[2] = Color.floatToByte(this.blue);\n  scratchUint8Array[3] = Color.floatToByte(this.alpha);\n  return scratchUint32Array[0];\n};\n\n/**\n * Brightens this color by the provided magnitude.\n *\n * @param {number} magnitude A positive number indicating the amount to brighten.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n *\n * @example\n * const brightBlue = Cesium.Color.BLUE.brighten(0.5, new Cesium.Color());\n */\nColor.prototype.brighten = function (magnitude, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"magnitude\", magnitude);\n  Check.typeOf.number.greaterThanOrEquals(\"magnitude\", magnitude, 0.0);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  magnitude = 1.0 - magnitude;\n  result.red = 1.0 - (1.0 - this.red) * magnitude;\n  result.green = 1.0 - (1.0 - this.green) * magnitude;\n  result.blue = 1.0 - (1.0 - this.blue) * magnitude;\n  result.alpha = this.alpha;\n  return result;\n};\n\n/**\n * Darkens this color by the provided magnitude.\n *\n * @param {number} magnitude A positive number indicating the amount to darken.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n *\n * @example\n * const darkBlue = Cesium.Color.BLUE.darken(0.5, new Cesium.Color());\n */\nColor.prototype.darken = function (magnitude, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"magnitude\", magnitude);\n  Check.typeOf.number.greaterThanOrEquals(\"magnitude\", magnitude, 0.0);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  magnitude = 1.0 - magnitude;\n  result.red = this.red * magnitude;\n  result.green = this.green * magnitude;\n  result.blue = this.blue * magnitude;\n  result.alpha = this.alpha;\n  return result;\n};\n\n/**\n * Creates a new Color that has the same red, green, and blue components\n * as this Color, but with the specified alpha value.\n *\n * @param {number} alpha The new alpha component.\n * @param {Color} [result] The object onto which to store the result.\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n *\n * @example const translucentRed = Cesium.Color.RED.withAlpha(0.9);\n */\nColor.prototype.withAlpha = function (alpha, result) {\n  return Color.fromAlpha(this, alpha, result);\n};\n\n/**\n * Computes the componentwise sum of two Colors.\n *\n * @param {Color} left The first Color.\n * @param {Color} right The second Color.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.add = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.red = left.red + right.red;\n  result.green = left.green + right.green;\n  result.blue = left.blue + right.blue;\n  result.alpha = left.alpha + right.alpha;\n  return result;\n};\n\n/**\n * Computes the componentwise difference of two Colors.\n *\n * @param {Color} left The first Color.\n * @param {Color} right The second Color.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.subtract = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.red = left.red - right.red;\n  result.green = left.green - right.green;\n  result.blue = left.blue - right.blue;\n  result.alpha = left.alpha - right.alpha;\n  return result;\n};\n\n/**\n * Computes the componentwise product of two Colors.\n *\n * @param {Color} left The first Color.\n * @param {Color} right The second Color.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.multiply = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.red = left.red * right.red;\n  result.green = left.green * right.green;\n  result.blue = left.blue * right.blue;\n  result.alpha = left.alpha * right.alpha;\n  return result;\n};\n\n/**\n * Computes the componentwise quotient of two Colors.\n *\n * @param {Color} left The first Color.\n * @param {Color} right The second Color.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.divide = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.red = left.red / right.red;\n  result.green = left.green / right.green;\n  result.blue = left.blue / right.blue;\n  result.alpha = left.alpha / right.alpha;\n  return result;\n};\n\n/**\n * Computes the componentwise modulus of two Colors.\n *\n * @param {Color} left The first Color.\n * @param {Color} right The second Color.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.mod = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.red = left.red % right.red;\n  result.green = left.green % right.green;\n  result.blue = left.blue % right.blue;\n  result.alpha = left.alpha % right.alpha;\n  return result;\n};\n\n/**\n * Computes the linear interpolation or extrapolation at t between the provided colors.\n *\n * @param {Color} start The color corresponding to t at 0.0.\n * @param {Color} end The color corresponding to t at 1.0.\n * @param {number} t The point along t at which to interpolate.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.lerp = function (start, end, t, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"start\", start);\n  Check.typeOf.object(\"end\", end);\n  Check.typeOf.number(\"t\", t);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.red = CesiumMath.lerp(start.red, end.red, t);\n  result.green = CesiumMath.lerp(start.green, end.green, t);\n  result.blue = CesiumMath.lerp(start.blue, end.blue, t);\n  result.alpha = CesiumMath.lerp(start.alpha, end.alpha, t);\n  return result;\n};\n\n/**\n * Multiplies the provided Color componentwise by the provided scalar.\n *\n * @param {Color} color The Color to be scaled.\n * @param {number} scalar The scalar to multiply with.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.multiplyByScalar = function (color, scalar, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"color\", color);\n  Check.typeOf.number(\"scalar\", scalar);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.red = color.red * scalar;\n  result.green = color.green * scalar;\n  result.blue = color.blue * scalar;\n  result.alpha = color.alpha * scalar;\n  return result;\n};\n\n/**\n * Divides the provided Color componentwise by the provided scalar.\n *\n * @param {Color} color The Color to be divided.\n * @param {number} scalar The scalar to divide with.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.divideByScalar = function (color, scalar, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"color\", color);\n  Check.typeOf.number(\"scalar\", scalar);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.red = color.red / scalar;\n  result.green = color.green / scalar;\n  result.blue = color.blue / scalar;\n  result.alpha = color.alpha / scalar;\n  return result;\n};\n\n/**\n * An immutable Color instance initialized to CSS color #F0F8FF\n * <span class=\"colorSwath\" style=\"background: #F0F8FF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.ALICEBLUE = Object.freeze(Color.fromCssColorString(\"#F0F8FF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FAEBD7\n * <span class=\"colorSwath\" style=\"background: #FAEBD7;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.ANTIQUEWHITE = Object.freeze(Color.fromCssColorString(\"#FAEBD7\"));\n\n/**\n * An immutable Color instance initialized to CSS color #00FFFF\n * <span class=\"colorSwath\" style=\"background: #00FFFF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.AQUA = Object.freeze(Color.fromCssColorString(\"#00FFFF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #7FFFD4\n * <span class=\"colorSwath\" style=\"background: #7FFFD4;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.AQUAMARINE = Object.freeze(Color.fromCssColorString(\"#7FFFD4\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F0FFFF\n * <span class=\"colorSwath\" style=\"background: #F0FFFF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.AZURE = Object.freeze(Color.fromCssColorString(\"#F0FFFF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F5F5DC\n * <span class=\"colorSwath\" style=\"background: #F5F5DC;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BEIGE = Object.freeze(Color.fromCssColorString(\"#F5F5DC\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFE4C4\n * <span class=\"colorSwath\" style=\"background: #FFE4C4;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BISQUE = Object.freeze(Color.fromCssColorString(\"#FFE4C4\"));\n\n/**\n * An immutable Color instance initialized to CSS color #000000\n * <span class=\"colorSwath\" style=\"background: #000000;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BLACK = Object.freeze(Color.fromCssColorString(\"#000000\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFEBCD\n * <span class=\"colorSwath\" style=\"background: #FFEBCD;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BLANCHEDALMOND = Object.freeze(Color.fromCssColorString(\"#FFEBCD\"));\n\n/**\n * An immutable Color instance initialized to CSS color #0000FF\n * <span class=\"colorSwath\" style=\"background: #0000FF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BLUE = Object.freeze(Color.fromCssColorString(\"#0000FF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #8A2BE2\n * <span class=\"colorSwath\" style=\"background: #8A2BE2;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BLUEVIOLET = Object.freeze(Color.fromCssColorString(\"#8A2BE2\"));\n\n/**\n * An immutable Color instance initialized to CSS color #A52A2A\n * <span class=\"colorSwath\" style=\"background: #A52A2A;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BROWN = Object.freeze(Color.fromCssColorString(\"#A52A2A\"));\n\n/**\n * An immutable Color instance initialized to CSS color #DEB887\n * <span class=\"colorSwath\" style=\"background: #DEB887;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BURLYWOOD = Object.freeze(Color.fromCssColorString(\"#DEB887\"));\n\n/**\n * An immutable Color instance initialized to CSS color #5F9EA0\n * <span class=\"colorSwath\" style=\"background: #5F9EA0;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CADETBLUE = Object.freeze(Color.fromCssColorString(\"#5F9EA0\"));\n/**\n * An immutable Color instance initialized to CSS color #7FFF00\n * <span class=\"colorSwath\" style=\"background: #7FFF00;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CHARTREUSE = Object.freeze(Color.fromCssColorString(\"#7FFF00\"));\n\n/**\n * An immutable Color instance initialized to CSS color #D2691E\n * <span class=\"colorSwath\" style=\"background: #D2691E;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CHOCOLATE = Object.freeze(Color.fromCssColorString(\"#D2691E\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF7F50\n * <span class=\"colorSwath\" style=\"background: #FF7F50;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CORAL = Object.freeze(Color.fromCssColorString(\"#FF7F50\"));\n\n/**\n * An immutable Color instance initialized to CSS color #6495ED\n * <span class=\"colorSwath\" style=\"background: #6495ED;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CORNFLOWERBLUE = Object.freeze(Color.fromCssColorString(\"#6495ED\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFF8DC\n * <span class=\"colorSwath\" style=\"background: #FFF8DC;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CORNSILK = Object.freeze(Color.fromCssColorString(\"#FFF8DC\"));\n\n/**\n * An immutable Color instance initialized to CSS color #DC143C\n * <span class=\"colorSwath\" style=\"background: #DC143C;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CRIMSON = Object.freeze(Color.fromCssColorString(\"#DC143C\"));\n\n/**\n * An immutable Color instance initialized to CSS color #00FFFF\n * <span class=\"colorSwath\" style=\"background: #00FFFF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CYAN = Object.freeze(Color.fromCssColorString(\"#00FFFF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #00008B\n * <span class=\"colorSwath\" style=\"background: #00008B;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKBLUE = Object.freeze(Color.fromCssColorString(\"#00008B\"));\n\n/**\n * An immutable Color instance initialized to CSS color #008B8B\n * <span class=\"colorSwath\" style=\"background: #008B8B;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKCYAN = Object.freeze(Color.fromCssColorString(\"#008B8B\"));\n\n/**\n * An immutable Color instance initialized to CSS color #B8860B\n * <span class=\"colorSwath\" style=\"background: #B8860B;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKGOLDENROD = Object.freeze(Color.fromCssColorString(\"#B8860B\"));\n\n/**\n * An immutable Color instance initialized to CSS color #A9A9A9\n * <span class=\"colorSwath\" style=\"background: #A9A9A9;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKGRAY = Object.freeze(Color.fromCssColorString(\"#A9A9A9\"));\n\n/**\n * An immutable Color instance initialized to CSS color #006400\n * <span class=\"colorSwath\" style=\"background: #006400;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKGREEN = Object.freeze(Color.fromCssColorString(\"#006400\"));\n\n/**\n * An immutable Color instance initialized to CSS color #A9A9A9\n * <span class=\"colorSwath\" style=\"background: #A9A9A9;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKGREY = Color.DARKGRAY;\n\n/**\n * An immutable Color instance initialized to CSS color #BDB76B\n * <span class=\"colorSwath\" style=\"background: #BDB76B;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKKHAKI = Object.freeze(Color.fromCssColorString(\"#BDB76B\"));\n\n/**\n * An immutable Color instance initialized to CSS color #8B008B\n * <span class=\"colorSwath\" style=\"background: #8B008B;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKMAGENTA = Object.freeze(Color.fromCssColorString(\"#8B008B\"));\n\n/**\n * An immutable Color instance initialized to CSS color #556B2F\n * <span class=\"colorSwath\" style=\"background: #556B2F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKOLIVEGREEN = Object.freeze(Color.fromCssColorString(\"#556B2F\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF8C00\n * <span class=\"colorSwath\" style=\"background: #FF8C00;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKORANGE = Object.freeze(Color.fromCssColorString(\"#FF8C00\"));\n\n/**\n * An immutable Color instance initialized to CSS color #9932CC\n * <span class=\"colorSwath\" style=\"background: #9932CC;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKORCHID = Object.freeze(Color.fromCssColorString(\"#9932CC\"));\n\n/**\n * An immutable Color instance initialized to CSS color #8B0000\n * <span class=\"colorSwath\" style=\"background: #8B0000;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKRED = Object.freeze(Color.fromCssColorString(\"#8B0000\"));\n\n/**\n * An immutable Color instance initialized to CSS color #E9967A\n * <span class=\"colorSwath\" style=\"background: #E9967A;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKSALMON = Object.freeze(Color.fromCssColorString(\"#E9967A\"));\n\n/**\n * An immutable Color instance initialized to CSS color #8FBC8F\n * <span class=\"colorSwath\" style=\"background: #8FBC8F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKSEAGREEN = Object.freeze(Color.fromCssColorString(\"#8FBC8F\"));\n\n/**\n * An immutable Color instance initialized to CSS color #483D8B\n * <span class=\"colorSwath\" style=\"background: #483D8B;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKSLATEBLUE = Object.freeze(Color.fromCssColorString(\"#483D8B\"));\n\n/**\n * An immutable Color instance initialized to CSS color #2F4F4F\n * <span class=\"colorSwath\" style=\"background: #2F4F4F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKSLATEGRAY = Object.freeze(Color.fromCssColorString(\"#2F4F4F\"));\n\n/**\n * An immutable Color instance initialized to CSS color #2F4F4F\n * <span class=\"colorSwath\" style=\"background: #2F4F4F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKSLATEGREY = Color.DARKSLATEGRAY;\n\n/**\n * An immutable Color instance initialized to CSS color #00CED1\n * <span class=\"colorSwath\" style=\"background: #00CED1;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKTURQUOISE = Object.freeze(Color.fromCssColorString(\"#00CED1\"));\n\n/**\n * An immutable Color instance initialized to CSS color #9400D3\n * <span class=\"colorSwath\" style=\"background: #9400D3;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKVIOLET = Object.freeze(Color.fromCssColorString(\"#9400D3\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF1493\n * <span class=\"colorSwath\" style=\"background: #FF1493;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DEEPPINK = Object.freeze(Color.fromCssColorString(\"#FF1493\"));\n\n/**\n * An immutable Color instance initialized to CSS color #00BFFF\n * <span class=\"colorSwath\" style=\"background: #00BFFF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DEEPSKYBLUE = Object.freeze(Color.fromCssColorString(\"#00BFFF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #696969\n * <span class=\"colorSwath\" style=\"background: #696969;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DIMGRAY = Object.freeze(Color.fromCssColorString(\"#696969\"));\n\n/**\n * An immutable Color instance initialized to CSS color #696969\n * <span class=\"colorSwath\" style=\"background: #696969;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DIMGREY = Color.DIMGRAY;\n\n/**\n * An immutable Color instance initialized to CSS color #1E90FF\n * <span class=\"colorSwath\" style=\"background: #1E90FF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DODGERBLUE = Object.freeze(Color.fromCssColorString(\"#1E90FF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #B22222\n * <span class=\"colorSwath\" style=\"background: #B22222;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.FIREBRICK = Object.freeze(Color.fromCssColorString(\"#B22222\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFFAF0\n * <span class=\"colorSwath\" style=\"background: #FFFAF0;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.FLORALWHITE = Object.freeze(Color.fromCssColorString(\"#FFFAF0\"));\n\n/**\n * An immutable Color instance initialized to CSS color #228B22\n * <span class=\"colorSwath\" style=\"background: #228B22;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.FORESTGREEN = Object.freeze(Color.fromCssColorString(\"#228B22\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF00FF\n * <span class=\"colorSwath\" style=\"background: #FF00FF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.FUCHSIA = Object.freeze(Color.fromCssColorString(\"#FF00FF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #DCDCDC\n * <span class=\"colorSwath\" style=\"background: #DCDCDC;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GAINSBORO = Object.freeze(Color.fromCssColorString(\"#DCDCDC\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F8F8FF\n * <span class=\"colorSwath\" style=\"background: #F8F8FF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GHOSTWHITE = Object.freeze(Color.fromCssColorString(\"#F8F8FF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFD700\n * <span class=\"colorSwath\" style=\"background: #FFD700;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GOLD = Object.freeze(Color.fromCssColorString(\"#FFD700\"));\n\n/**\n * An immutable Color instance initialized to CSS color #DAA520\n * <span class=\"colorSwath\" style=\"background: #DAA520;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GOLDENROD = Object.freeze(Color.fromCssColorString(\"#DAA520\"));\n\n/**\n * An immutable Color instance initialized to CSS color #808080\n * <span class=\"colorSwath\" style=\"background: #808080;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GRAY = Object.freeze(Color.fromCssColorString(\"#808080\"));\n\n/**\n * An immutable Color instance initialized to CSS color #008000\n * <span class=\"colorSwath\" style=\"background: #008000;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GREEN = Object.freeze(Color.fromCssColorString(\"#008000\"));\n\n/**\n * An immutable Color instance initialized to CSS color #ADFF2F\n * <span class=\"colorSwath\" style=\"background: #ADFF2F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GREENYELLOW = Object.freeze(Color.fromCssColorString(\"#ADFF2F\"));\n\n/**\n * An immutable Color instance initialized to CSS color #808080\n * <span class=\"colorSwath\" style=\"background: #808080;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GREY = Color.GRAY;\n\n/**\n * An immutable Color instance initialized to CSS color #F0FFF0\n * <span class=\"colorSwath\" style=\"background: #F0FFF0;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.HONEYDEW = Object.freeze(Color.fromCssColorString(\"#F0FFF0\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF69B4\n * <span class=\"colorSwath\" style=\"background: #FF69B4;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.HOTPINK = Object.freeze(Color.fromCssColorString(\"#FF69B4\"));\n\n/**\n * An immutable Color instance initialized to CSS color #CD5C5C\n * <span class=\"colorSwath\" style=\"background: #CD5C5C;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.INDIANRED = Object.freeze(Color.fromCssColorString(\"#CD5C5C\"));\n\n/**\n * An immutable Color instance initialized to CSS color #4B0082\n * <span class=\"colorSwath\" style=\"background: #4B0082;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.INDIGO = Object.freeze(Color.fromCssColorString(\"#4B0082\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFFFF0\n * <span class=\"colorSwath\" style=\"background: #FFFFF0;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.IVORY = Object.freeze(Color.fromCssColorString(\"#FFFFF0\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F0E68C\n * <span class=\"colorSwath\" style=\"background: #F0E68C;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.KHAKI = Object.freeze(Color.fromCssColorString(\"#F0E68C\"));\n\n/**\n * An immutable Color instance initialized to CSS color #E6E6FA\n * <span class=\"colorSwath\" style=\"background: #E6E6FA;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LAVENDER = Object.freeze(Color.fromCssColorString(\"#E6E6FA\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFF0F5\n * <span class=\"colorSwath\" style=\"background: #FFF0F5;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LAVENDAR_BLUSH = Object.freeze(Color.fromCssColorString(\"#FFF0F5\"));\n\n/**\n * An immutable Color instance initialized to CSS color #7CFC00\n * <span class=\"colorSwath\" style=\"background: #7CFC00;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LAWNGREEN = Object.freeze(Color.fromCssColorString(\"#7CFC00\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFFACD\n * <span class=\"colorSwath\" style=\"background: #FFFACD;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LEMONCHIFFON = Object.freeze(Color.fromCssColorString(\"#FFFACD\"));\n\n/**\n * An immutable Color instance initialized to CSS color #ADD8E6\n * <span class=\"colorSwath\" style=\"background: #ADD8E6;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTBLUE = Object.freeze(Color.fromCssColorString(\"#ADD8E6\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F08080\n * <span class=\"colorSwath\" style=\"background: #F08080;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTCORAL = Object.freeze(Color.fromCssColorString(\"#F08080\"));\n\n/**\n * An immutable Color instance initialized to CSS color #E0FFFF\n * <span class=\"colorSwath\" style=\"background: #E0FFFF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTCYAN = Object.freeze(Color.fromCssColorString(\"#E0FFFF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FAFAD2\n * <span class=\"colorSwath\" style=\"background: #FAFAD2;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTGOLDENRODYELLOW = Object.freeze(Color.fromCssColorString(\"#FAFAD2\"));\n\n/**\n * An immutable Color instance initialized to CSS color #D3D3D3\n * <span class=\"colorSwath\" style=\"background: #D3D3D3;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTGRAY = Object.freeze(Color.fromCssColorString(\"#D3D3D3\"));\n\n/**\n * An immutable Color instance initialized to CSS color #90EE90\n * <span class=\"colorSwath\" style=\"background: #90EE90;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTGREEN = Object.freeze(Color.fromCssColorString(\"#90EE90\"));\n\n/**\n * An immutable Color instance initialized to CSS color #D3D3D3\n * <span class=\"colorSwath\" style=\"background: #D3D3D3;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTGREY = Color.LIGHTGRAY;\n\n/**\n * An immutable Color instance initialized to CSS color #FFB6C1\n * <span class=\"colorSwath\" style=\"background: #FFB6C1;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTPINK = Object.freeze(Color.fromCssColorString(\"#FFB6C1\"));\n\n/**\n * An immutable Color instance initialized to CSS color #20B2AA\n * <span class=\"colorSwath\" style=\"background: #20B2AA;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTSEAGREEN = Object.freeze(Color.fromCssColorString(\"#20B2AA\"));\n\n/**\n * An immutable Color instance initialized to CSS color #87CEFA\n * <span class=\"colorSwath\" style=\"background: #87CEFA;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTSKYBLUE = Object.freeze(Color.fromCssColorString(\"#87CEFA\"));\n\n/**\n * An immutable Color instance initialized to CSS color #778899\n * <span class=\"colorSwath\" style=\"background: #778899;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTSLATEGRAY = Object.freeze(Color.fromCssColorString(\"#778899\"));\n\n/**\n * An immutable Color instance initialized to CSS color #778899\n * <span class=\"colorSwath\" style=\"background: #778899;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTSLATEGREY = Color.LIGHTSLATEGRAY;\n\n/**\n * An immutable Color instance initialized to CSS color #B0C4DE\n * <span class=\"colorSwath\" style=\"background: #B0C4DE;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTSTEELBLUE = Object.freeze(Color.fromCssColorString(\"#B0C4DE\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFFFE0\n * <span class=\"colorSwath\" style=\"background: #FFFFE0;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTYELLOW = Object.freeze(Color.fromCssColorString(\"#FFFFE0\"));\n\n/**\n * An immutable Color instance initialized to CSS color #00FF00\n * <span class=\"colorSwath\" style=\"background: #00FF00;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIME = Object.freeze(Color.fromCssColorString(\"#00FF00\"));\n\n/**\n * An immutable Color instance initialized to CSS color #32CD32\n * <span class=\"colorSwath\" style=\"background: #32CD32;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIMEGREEN = Object.freeze(Color.fromCssColorString(\"#32CD32\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FAF0E6\n * <span class=\"colorSwath\" style=\"background: #FAF0E6;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LINEN = Object.freeze(Color.fromCssColorString(\"#FAF0E6\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF00FF\n * <span class=\"colorSwath\" style=\"background: #FF00FF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MAGENTA = Object.freeze(Color.fromCssColorString(\"#FF00FF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #800000\n * <span class=\"colorSwath\" style=\"background: #800000;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MAROON = Object.freeze(Color.fromCssColorString(\"#800000\"));\n\n/**\n * An immutable Color instance initialized to CSS color #66CDAA\n * <span class=\"colorSwath\" style=\"background: #66CDAA;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMAQUAMARINE = Object.freeze(Color.fromCssColorString(\"#66CDAA\"));\n\n/**\n * An immutable Color instance initialized to CSS color #0000CD\n * <span class=\"colorSwath\" style=\"background: #0000CD;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMBLUE = Object.freeze(Color.fromCssColorString(\"#0000CD\"));\n\n/**\n * An immutable Color instance initialized to CSS color #BA55D3\n * <span class=\"colorSwath\" style=\"background: #BA55D3;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMORCHID = Object.freeze(Color.fromCssColorString(\"#BA55D3\"));\n\n/**\n * An immutable Color instance initialized to CSS color #9370DB\n * <span class=\"colorSwath\" style=\"background: #9370DB;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMPURPLE = Object.freeze(Color.fromCssColorString(\"#9370DB\"));\n\n/**\n * An immutable Color instance initialized to CSS color #3CB371\n * <span class=\"colorSwath\" style=\"background: #3CB371;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMSEAGREEN = Object.freeze(Color.fromCssColorString(\"#3CB371\"));\n\n/**\n * An immutable Color instance initialized to CSS color #7B68EE\n * <span class=\"colorSwath\" style=\"background: #7B68EE;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMSLATEBLUE = Object.freeze(Color.fromCssColorString(\"#7B68EE\"));\n\n/**\n * An immutable Color instance initialized to CSS color #00FA9A\n * <span class=\"colorSwath\" style=\"background: #00FA9A;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMSPRINGGREEN = Object.freeze(Color.fromCssColorString(\"#00FA9A\"));\n\n/**\n * An immutable Color instance initialized to CSS color #48D1CC\n * <span class=\"colorSwath\" style=\"background: #48D1CC;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMTURQUOISE = Object.freeze(Color.fromCssColorString(\"#48D1CC\"));\n\n/**\n * An immutable Color instance initialized to CSS color #C71585\n * <span class=\"colorSwath\" style=\"background: #C71585;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMVIOLETRED = Object.freeze(Color.fromCssColorString(\"#C71585\"));\n\n/**\n * An immutable Color instance initialized to CSS color #191970\n * <span class=\"colorSwath\" style=\"background: #191970;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MIDNIGHTBLUE = Object.freeze(Color.fromCssColorString(\"#191970\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F5FFFA\n * <span class=\"colorSwath\" style=\"background: #F5FFFA;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MINTCREAM = Object.freeze(Color.fromCssColorString(\"#F5FFFA\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFE4E1\n * <span class=\"colorSwath\" style=\"background: #FFE4E1;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MISTYROSE = Object.freeze(Color.fromCssColorString(\"#FFE4E1\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFE4B5\n * <span class=\"colorSwath\" style=\"background: #FFE4B5;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MOCCASIN = Object.freeze(Color.fromCssColorString(\"#FFE4B5\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFDEAD\n * <span class=\"colorSwath\" style=\"background: #FFDEAD;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.NAVAJOWHITE = Object.freeze(Color.fromCssColorString(\"#FFDEAD\"));\n\n/**\n * An immutable Color instance initialized to CSS color #000080\n * <span class=\"colorSwath\" style=\"background: #000080;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.NAVY = Object.freeze(Color.fromCssColorString(\"#000080\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FDF5E6\n * <span class=\"colorSwath\" style=\"background: #FDF5E6;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.OLDLACE = Object.freeze(Color.fromCssColorString(\"#FDF5E6\"));\n\n/**\n * An immutable Color instance initialized to CSS color #808000\n * <span class=\"colorSwath\" style=\"background: #808000;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.OLIVE = Object.freeze(Color.fromCssColorString(\"#808000\"));\n\n/**\n * An immutable Color instance initialized to CSS color #6B8E23\n * <span class=\"colorSwath\" style=\"background: #6B8E23;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.OLIVEDRAB = Object.freeze(Color.fromCssColorString(\"#6B8E23\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFA500\n * <span class=\"colorSwath\" style=\"background: #FFA500;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.ORANGE = Object.freeze(Color.fromCssColorString(\"#FFA500\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF4500\n * <span class=\"colorSwath\" style=\"background: #FF4500;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.ORANGERED = Object.freeze(Color.fromCssColorString(\"#FF4500\"));\n\n/**\n * An immutable Color instance initialized to CSS color #DA70D6\n * <span class=\"colorSwath\" style=\"background: #DA70D6;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.ORCHID = Object.freeze(Color.fromCssColorString(\"#DA70D6\"));\n\n/**\n * An immutable Color instance initialized to CSS color #EEE8AA\n * <span class=\"colorSwath\" style=\"background: #EEE8AA;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PALEGOLDENROD = Object.freeze(Color.fromCssColorString(\"#EEE8AA\"));\n\n/**\n * An immutable Color instance initialized to CSS color #98FB98\n * <span class=\"colorSwath\" style=\"background: #98FB98;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PALEGREEN = Object.freeze(Color.fromCssColorString(\"#98FB98\"));\n\n/**\n * An immutable Color instance initialized to CSS color #AFEEEE\n * <span class=\"colorSwath\" style=\"background: #AFEEEE;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PALETURQUOISE = Object.freeze(Color.fromCssColorString(\"#AFEEEE\"));\n\n/**\n * An immutable Color instance initialized to CSS color #DB7093\n * <span class=\"colorSwath\" style=\"background: #DB7093;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PALEVIOLETRED = Object.freeze(Color.fromCssColorString(\"#DB7093\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFEFD5\n * <span class=\"colorSwath\" style=\"background: #FFEFD5;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PAPAYAWHIP = Object.freeze(Color.fromCssColorString(\"#FFEFD5\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFDAB9\n * <span class=\"colorSwath\" style=\"background: #FFDAB9;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PEACHPUFF = Object.freeze(Color.fromCssColorString(\"#FFDAB9\"));\n\n/**\n * An immutable Color instance initialized to CSS color #CD853F\n * <span class=\"colorSwath\" style=\"background: #CD853F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PERU = Object.freeze(Color.fromCssColorString(\"#CD853F\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFC0CB\n * <span class=\"colorSwath\" style=\"background: #FFC0CB;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PINK = Object.freeze(Color.fromCssColorString(\"#FFC0CB\"));\n\n/**\n * An immutable Color instance initialized to CSS color #DDA0DD\n * <span class=\"colorSwath\" style=\"background: #DDA0DD;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PLUM = Object.freeze(Color.fromCssColorString(\"#DDA0DD\"));\n\n/**\n * An immutable Color instance initialized to CSS color #B0E0E6\n * <span class=\"colorSwath\" style=\"background: #B0E0E6;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.POWDERBLUE = Object.freeze(Color.fromCssColorString(\"#B0E0E6\"));\n\n/**\n * An immutable Color instance initialized to CSS color #800080\n * <span class=\"colorSwath\" style=\"background: #800080;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PURPLE = Object.freeze(Color.fromCssColorString(\"#800080\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF0000\n * <span class=\"colorSwath\" style=\"background: #FF0000;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.RED = Object.freeze(Color.fromCssColorString(\"#FF0000\"));\n\n/**\n * An immutable Color instance initialized to CSS color #BC8F8F\n * <span class=\"colorSwath\" style=\"background: #BC8F8F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.ROSYBROWN = Object.freeze(Color.fromCssColorString(\"#BC8F8F\"));\n\n/**\n * An immutable Color instance initialized to CSS color #4169E1\n * <span class=\"colorSwath\" style=\"background: #4169E1;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.ROYALBLUE = Object.freeze(Color.fromCssColorString(\"#4169E1\"));\n\n/**\n * An immutable Color instance initialized to CSS color #8B4513\n * <span class=\"colorSwath\" style=\"background: #8B4513;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SADDLEBROWN = Object.freeze(Color.fromCssColorString(\"#8B4513\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FA8072\n * <span class=\"colorSwath\" style=\"background: #FA8072;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SALMON = Object.freeze(Color.fromCssColorString(\"#FA8072\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F4A460\n * <span class=\"colorSwath\" style=\"background: #F4A460;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SANDYBROWN = Object.freeze(Color.fromCssColorString(\"#F4A460\"));\n\n/**\n * An immutable Color instance initialized to CSS color #2E8B57\n * <span class=\"colorSwath\" style=\"background: #2E8B57;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SEAGREEN = Object.freeze(Color.fromCssColorString(\"#2E8B57\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFF5EE\n * <span class=\"colorSwath\" style=\"background: #FFF5EE;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SEASHELL = Object.freeze(Color.fromCssColorString(\"#FFF5EE\"));\n\n/**\n * An immutable Color instance initialized to CSS color #A0522D\n * <span class=\"colorSwath\" style=\"background: #A0522D;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SIENNA = Object.freeze(Color.fromCssColorString(\"#A0522D\"));\n\n/**\n * An immutable Color instance initialized to CSS color #C0C0C0\n * <span class=\"colorSwath\" style=\"background: #C0C0C0;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SILVER = Object.freeze(Color.fromCssColorString(\"#C0C0C0\"));\n\n/**\n * An immutable Color instance initialized to CSS color #87CEEB\n * <span class=\"colorSwath\" style=\"background: #87CEEB;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SKYBLUE = Object.freeze(Color.fromCssColorString(\"#87CEEB\"));\n\n/**\n * An immutable Color instance initialized to CSS color #6A5ACD\n * <span class=\"colorSwath\" style=\"background: #6A5ACD;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SLATEBLUE = Object.freeze(Color.fromCssColorString(\"#6A5ACD\"));\n\n/**\n * An immutable Color instance initialized to CSS color #708090\n * <span class=\"colorSwath\" style=\"background: #708090;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SLATEGRAY = Object.freeze(Color.fromCssColorString(\"#708090\"));\n\n/**\n * An immutable Color instance initialized to CSS color #708090\n * <span class=\"colorSwath\" style=\"background: #708090;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SLATEGREY = Color.SLATEGRAY;\n\n/**\n * An immutable Color instance initialized to CSS color #FFFAFA\n * <span class=\"colorSwath\" style=\"background: #FFFAFA;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SNOW = Object.freeze(Color.fromCssColorString(\"#FFFAFA\"));\n\n/**\n * An immutable Color instance initialized to CSS color #00FF7F\n * <span class=\"colorSwath\" style=\"background: #00FF7F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SPRINGGREEN = Object.freeze(Color.fromCssColorString(\"#00FF7F\"));\n\n/**\n * An immutable Color instance initialized to CSS color #4682B4\n * <span class=\"colorSwath\" style=\"background: #4682B4;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.STEELBLUE = Object.freeze(Color.fromCssColorString(\"#4682B4\"));\n\n/**\n * An immutable Color instance initialized to CSS color #D2B48C\n * <span class=\"colorSwath\" style=\"background: #D2B48C;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.TAN = Object.freeze(Color.fromCssColorString(\"#D2B48C\"));\n\n/**\n * An immutable Color instance initialized to CSS color #008080\n * <span class=\"colorSwath\" style=\"background: #008080;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.TEAL = Object.freeze(Color.fromCssColorString(\"#008080\"));\n\n/**\n * An immutable Color instance initialized to CSS color #D8BFD8\n * <span class=\"colorSwath\" style=\"background: #D8BFD8;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.THISTLE = Object.freeze(Color.fromCssColorString(\"#D8BFD8\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF6347\n * <span class=\"colorSwath\" style=\"background: #FF6347;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.TOMATO = Object.freeze(Color.fromCssColorString(\"#FF6347\"));\n\n/**\n * An immutable Color instance initialized to CSS color #40E0D0\n * <span class=\"colorSwath\" style=\"background: #40E0D0;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.TURQUOISE = Object.freeze(Color.fromCssColorString(\"#40E0D0\"));\n\n/**\n * An immutable Color instance initialized to CSS color #EE82EE\n * <span class=\"colorSwath\" style=\"background: #EE82EE;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.VIOLET = Object.freeze(Color.fromCssColorString(\"#EE82EE\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F5DEB3\n * <span class=\"colorSwath\" style=\"background: #F5DEB3;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.WHEAT = Object.freeze(Color.fromCssColorString(\"#F5DEB3\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFFFFF\n * <span class=\"colorSwath\" style=\"background: #FFFFFF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.WHITE = Object.freeze(Color.fromCssColorString(\"#FFFFFF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F5F5F5\n * <span class=\"colorSwath\" style=\"background: #F5F5F5;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.WHITESMOKE = Object.freeze(Color.fromCssColorString(\"#F5F5F5\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFFF00\n * <span class=\"colorSwath\" style=\"background: #FFFF00;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.YELLOW = Object.freeze(Color.fromCssColorString(\"#FFFF00\"));\n\n/**\n * An immutable Color instance initialized to CSS color #9ACD32\n * <span class=\"colorSwath\" style=\"background: #9ACD32;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.YELLOWGREEN = Object.freeze(Color.fromCssColorString(\"#9ACD32\"));\n\n/**\n * An immutable Color instance initialized to CSS transparent.\n * <span class=\"colorSwath\" style=\"background: transparent;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.TRANSPARENT = Object.freeze(new Color(0, 0, 0, 0));\nexport default Color;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\n\n/**\n * Represents a command to the renderer for clearing a framebuffer.\n *\n * @private\n * @constructor\n */\nfunction ClearCommand(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * The value to clear the color buffer to.  When <code>undefined</code>, the color buffer is not cleared.\n   *\n   * @type {Color}\n   *\n   * @default undefined\n   */\n  this.color = options.color;\n\n  /**\n   * The value to clear the depth buffer to.  When <code>undefined</code>, the depth buffer is not cleared.\n   *\n   * @type {number}\n   *\n   * @default undefined\n   */\n  this.depth = options.depth;\n\n  /**\n   * The value to clear the stencil buffer to.  When <code>undefined</code>, the stencil buffer is not cleared.\n   *\n   * @type {number}\n   *\n   * @default undefined\n   */\n  this.stencil = options.stencil;\n\n  /**\n   * The render state to apply when executing the clear command.  The following states affect clearing:\n   * scissor test, color mask, depth mask, and stencil mask.  When the render state is\n   * <code>undefined</code>, the default render state is used.\n   *\n   * @type {RenderState}\n   *\n   * @default undefined\n   */\n  this.renderState = options.renderState;\n\n  /**\n   * The framebuffer to clear.\n   *\n   * @type {Framebuffer}\n   *\n   * @default undefined\n   */\n  this.framebuffer = options.framebuffer;\n\n  /**\n   * The object who created this command.  This is useful for debugging command\n   * execution; it allows you to see who created a command when you only have a\n   * reference to the command, and can be used to selectively execute commands\n   * with {@link Scene#debugCommandFilter}.\n   *\n   * @type {object}\n   *\n   * @default undefined\n   *\n   * @see Scene#debugCommandFilter\n   */\n  this.owner = options.owner;\n\n  /**\n   * The pass in which to run this command.\n   *\n   * @type {Pass}\n   *\n   * @default undefined\n   */\n  this.pass = options.pass;\n}\n\n/**\n * Clears color to (0.0, 0.0, 0.0, 0.0); depth to 1.0; and stencil to 0.\n *\n * @type {ClearCommand}\n *\n * @constant\n */\nClearCommand.ALL = Object.freeze(\n  new ClearCommand({\n    color: new Color(0.0, 0.0, 0.0, 0.0),\n    depth: 1.0,\n    stencil: 0.0,\n  })\n);\n\nClearCommand.prototype.execute = function (context, passState) {\n  context.clear(this, passState);\n};\nexport default ClearCommand;\n", "/**\n * The render pass for a command.\n *\n * @private\n */\nconst Pass = {\n  // If you add/modify/remove Pass constants, also change the automatic GLSL constants\n  // that start with 'czm_pass'\n  //\n  // Commands are executed in order by pass up to the translucent pass.\n  // Translucent geometry needs special handling (sorting/OIT). The compute pass\n  // is executed first and the overlay pass is executed last. Both are not sorted\n  // by frustum.\n  ENVIRONMENT: 0,\n  COMPUTE: 1,\n  GLOBE: 2,\n  TERRAIN_CLASSIFICATION: 3,\n  CESIUM_3D_TILE: 4,\n  CESIUM_3D_TILE_CLASSIFICATION: 5,\n  CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW: 6,\n  OPAQUE: 7,\n  TRANSLUCENT: 8,\n  VOXELS: 9,\n  OVERLAY: 10,\n  NUMBER_OF_PASSES: 11,\n};\nexport default Object.freeze(Pass);\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport Pass from \"./Pass.js\";\n\n/**\n * Represents a command to the renderer for GPU Compute (using old-school GPGPU).\n *\n * @private\n * @constructor\n */\nfunction ComputeCommand(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * The vertex array. If none is provided, a viewport quad will be used.\n   *\n   * @type {VertexArray}\n   * @default undefined\n   */\n  this.vertexArray = options.vertexArray;\n\n  /**\n   * The fragment shader source. The default vertex shader is ViewportQuadVS.\n   *\n   * @type {ShaderSource}\n   * @default undefined\n   */\n  this.fragmentShaderSource = options.fragmentShaderSource;\n\n  /**\n   * The shader program to apply.\n   *\n   * @type {ShaderProgram}\n   * @default undefined\n   */\n  this.shaderProgram = options.shaderProgram;\n\n  /**\n   * An object with functions whose names match the uniforms in the shader program\n   * and return values to set those uniforms.\n   *\n   * @type {object}\n   * @default undefined\n   */\n  this.uniformMap = options.uniformMap;\n\n  /**\n   * Texture to use for offscreen rendering.\n   *\n   * @type {Texture}\n   * @default undefined\n   */\n  this.outputTexture = options.outputTexture;\n\n  /**\n   * Function that is called immediately before the ComputeCommand is executed. Used to\n   * update any renderer resources. Takes the ComputeCommand as its single argument.\n   *\n   * @type {Function}\n   * @default undefined\n   */\n  this.preExecute = options.preExecute;\n\n  /**\n   * Function that is called after the ComputeCommand is executed. Takes the output\n   * texture as its single argument.\n   *\n   * @type {Function}\n   * @default undefined\n   */\n  this.postExecute = options.postExecute;\n\n  /**\n   * Function that is called when the command is canceled\n   *\n   * @type {Function}\n   * @default undefined\n   */\n  this.canceled = options.canceled;\n\n  /**\n   * Whether the renderer resources will persist beyond this call. If not, they\n   * will be destroyed after completion.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.persists = defaultValue(options.persists, false);\n\n  /**\n   * The pass when to render. Always compute pass.\n   *\n   * @type {Pass}\n   * @default Pass.COMPUTE;\n   */\n  this.pass = Pass.COMPUTE;\n\n  /**\n   * The object who created this command.  This is useful for debugging command\n   * execution; it allows us to see who created a command when we only have a\n   * reference to the command, and can be used to selectively execute commands\n   * with {@link Scene#debugCommandFilter}.\n   *\n   * @type {object}\n   * @default undefined\n   *\n   * @see Scene#debugCommandFilter\n   */\n  this.owner = options.owner;\n}\n\n/**\n * Executes the compute command.\n *\n * @param {ComputeEngine} computeEngine The context that processes the compute command.\n */\nComputeCommand.prototype.execute = function (computeEngine) {\n  computeEngine.execute(this);\n};\nexport default ComputeCommand;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A 2D Cartesian point.\n * @alias Cartesian2\n * @constructor\n *\n * @param {number} [x=0.0] The X component.\n * @param {number} [y=0.0] The Y component.\n *\n * @see Cartesian3\n * @see Cartesian4\n * @see Packable\n */\nfunction Cartesian2(x, y) {\n  /**\n   * The X component.\n   * @type {number}\n   * @default 0.0\n   */\n  this.x = defaultValue(x, 0.0);\n\n  /**\n   * The Y component.\n   * @type {number}\n   * @default 0.0\n   */\n  this.y = defaultValue(y, 0.0);\n}\n\n/**\n * Creates a Cartesian2 instance from x and y coordinates.\n *\n * @param {number} x The x coordinate.\n * @param {number} y The y coordinate.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\n */\nCartesian2.fromElements = function (x, y, result) {\n  if (!defined(result)) {\n    return new Cartesian2(x, y);\n  }\n\n  result.x = x;\n  result.y = y;\n  return result;\n};\n\n/**\n * Duplicates a Cartesian2 instance.\n *\n * @param {Cartesian2} cartesian The Cartesian to duplicate.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. (Returns undefined if cartesian is undefined)\n */\nCartesian2.clone = function (cartesian, result) {\n  if (!defined(cartesian)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    return new Cartesian2(cartesian.x, cartesian.y);\n  }\n\n  result.x = cartesian.x;\n  result.y = cartesian.y;\n  return result;\n};\n\n/**\n * Creates a Cartesian2 instance from an existing Cartesian3.  This simply takes the\n * x and y properties of the Cartesian3 and drops z.\n * @function\n *\n * @param {Cartesian3} cartesian The Cartesian3 instance to create a Cartesian2 instance from.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\n */\nCartesian2.fromCartesian3 = Cartesian2.clone;\n\n/**\n * Creates a Cartesian2 instance from an existing Cartesian4.  This simply takes the\n * x and y properties of the Cartesian4 and drops z and w.\n * @function\n *\n * @param {Cartesian4} cartesian The Cartesian4 instance to create a Cartesian2 instance from.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\n */\nCartesian2.fromCartesian4 = Cartesian2.clone;\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nCartesian2.packedLength = 2;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Cartesian2} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nCartesian2.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  array[startingIndex++] = value.x;\n  array[startingIndex] = value.y;\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Cartesian2} [result] The object into which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\n */\nCartesian2.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new Cartesian2();\n  }\n  result.x = array[startingIndex++];\n  result.y = array[startingIndex];\n  return result;\n};\n\n/**\n * Flattens an array of Cartesian2s into an array of components.\n *\n * @param {Cartesian2[]} array The array of cartesians to pack.\n * @param {number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 2 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 2) elements.\n * @returns {number[]} The packed array.\n */\nCartesian2.packArray = function (array, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  const length = array.length;\n  const resultLength = length * 2;\n  if (!defined(result)) {\n    result = new Array(resultLength);\n  } else if (!Array.isArray(result) && result.length !== resultLength) {\n    //>>includeStart('debug', pragmas.debug);\n    throw new DeveloperError(\n      \"If result is a typed array, it must have exactly array.length * 2 elements\"\n    );\n    //>>includeEnd('debug');\n  } else if (result.length !== resultLength) {\n    result.length = resultLength;\n  }\n\n  for (let i = 0; i < length; ++i) {\n    Cartesian2.pack(array[i], result, i * 2);\n  }\n  return result;\n};\n\n/**\n * Unpacks an array of cartesian components into an array of Cartesian2s.\n *\n * @param {number[]} array The array of components to unpack.\n * @param {Cartesian2[]} [result] The array onto which to store the result.\n * @returns {Cartesian2[]} The unpacked array.\n */\nCartesian2.unpackArray = function (array, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  Check.typeOf.number.greaterThanOrEquals(\"array.length\", array.length, 2);\n  if (array.length % 2 !== 0) {\n    throw new DeveloperError(\"array length must be a multiple of 2.\");\n  }\n  //>>includeEnd('debug');\n\n  const length = array.length;\n  if (!defined(result)) {\n    result = new Array(length / 2);\n  } else {\n    result.length = length / 2;\n  }\n\n  for (let i = 0; i < length; i += 2) {\n    const index = i / 2;\n    result[index] = Cartesian2.unpack(array, i, result[index]);\n  }\n  return result;\n};\n\n/**\n * Creates a Cartesian2 from two consecutive elements in an array.\n * @function\n *\n * @param {number[]} array The array whose two consecutive elements correspond to the x and y components, respectively.\n * @param {number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\n *\n * @example\n * // Create a Cartesian2 with (1.0, 2.0)\n * const v = [1.0, 2.0];\n * const p = Cesium.Cartesian2.fromArray(v);\n *\n * // Create a Cartesian2 with (1.0, 2.0) using an offset into an array\n * const v2 = [0.0, 0.0, 1.0, 2.0];\n * const p2 = Cesium.Cartesian2.fromArray(v2, 2);\n */\nCartesian2.fromArray = Cartesian2.unpack;\n\n/**\n * Computes the value of the maximum component for the supplied Cartesian.\n *\n * @param {Cartesian2} cartesian The cartesian to use.\n * @returns {number} The value of the maximum component.\n */\nCartesian2.maximumComponent = function (cartesian) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  return Math.max(cartesian.x, cartesian.y);\n};\n\n/**\n * Computes the value of the minimum component for the supplied Cartesian.\n *\n * @param {Cartesian2} cartesian The cartesian to use.\n * @returns {number} The value of the minimum component.\n */\nCartesian2.minimumComponent = function (cartesian) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  return Math.min(cartesian.x, cartesian.y);\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.\n *\n * @param {Cartesian2} first A cartesian to compare.\n * @param {Cartesian2} second A cartesian to compare.\n * @param {Cartesian2} result The object into which to store the result.\n * @returns {Cartesian2} A cartesian with the minimum components.\n */\nCartesian2.minimumByComponent = function (first, second, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"first\", first);\n  Check.typeOf.object(\"second\", second);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = Math.min(first.x, second.x);\n  result.y = Math.min(first.y, second.y);\n\n  return result;\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.\n *\n * @param {Cartesian2} first A cartesian to compare.\n * @param {Cartesian2} second A cartesian to compare.\n * @param {Cartesian2} result The object into which to store the result.\n * @returns {Cartesian2} A cartesian with the maximum components.\n */\nCartesian2.maximumByComponent = function (first, second, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"first\", first);\n  Check.typeOf.object(\"second\", second);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = Math.max(first.x, second.x);\n  result.y = Math.max(first.y, second.y);\n  return result;\n};\n\n/**\n * Constrain a value to lie between two values.\n *\n * @param {Cartesian2} value The value to clamp.\n * @param {Cartesian2} min The minimum bound.\n * @param {Cartesian2} max The maximum bound.\n * @param {Cartesian2} result The object into which to store the result.\n * @returns {Cartesian2} The clamped value such that min <= result <= max.\n */\nCartesian2.clamp = function (value, min, max, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.typeOf.object(\"min\", min);\n  Check.typeOf.object(\"max\", max);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const x = CesiumMath.clamp(value.x, min.x, max.x);\n  const y = CesiumMath.clamp(value.y, min.y, max.y);\n\n  result.x = x;\n  result.y = y;\n\n  return result;\n};\n\n/**\n * Computes the provided Cartesian's squared magnitude.\n *\n * @param {Cartesian2} cartesian The Cartesian instance whose squared magnitude is to be computed.\n * @returns {number} The squared magnitude.\n */\nCartesian2.magnitudeSquared = function (cartesian) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  return cartesian.x * cartesian.x + cartesian.y * cartesian.y;\n};\n\n/**\n * Computes the Cartesian's magnitude (length).\n *\n * @param {Cartesian2} cartesian The Cartesian instance whose magnitude is to be computed.\n * @returns {number} The magnitude.\n */\nCartesian2.magnitude = function (cartesian) {\n  return Math.sqrt(Cartesian2.magnitudeSquared(cartesian));\n};\n\nconst distanceScratch = new Cartesian2();\n\n/**\n * Computes the distance between two points.\n *\n * @param {Cartesian2} left The first point to compute the distance from.\n * @param {Cartesian2} right The second point to compute the distance to.\n * @returns {number} The distance between two points.\n *\n * @example\n * // Returns 1.0\n * const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(2.0, 0.0));\n */\nCartesian2.distance = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  Cartesian2.subtract(left, right, distanceScratch);\n  return Cartesian2.magnitude(distanceScratch);\n};\n\n/**\n * Computes the squared distance between two points.  Comparing squared distances\n * using this function is more efficient than comparing distances using {@link Cartesian2#distance}.\n *\n * @param {Cartesian2} left The first point to compute the distance from.\n * @param {Cartesian2} right The second point to compute the distance to.\n * @returns {number} The distance between two points.\n *\n * @example\n * // Returns 4.0, not 2.0\n * const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(3.0, 0.0));\n */\nCartesian2.distanceSquared = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  Cartesian2.subtract(left, right, distanceScratch);\n  return Cartesian2.magnitudeSquared(distanceScratch);\n};\n\n/**\n * Computes the normalized form of the supplied Cartesian.\n *\n * @param {Cartesian2} cartesian The Cartesian to be normalized.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.normalize = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const magnitude = Cartesian2.magnitude(cartesian);\n\n  result.x = cartesian.x / magnitude;\n  result.y = cartesian.y / magnitude;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (isNaN(result.x) || isNaN(result.y)) {\n    throw new DeveloperError(\"normalized result is not a number\");\n  }\n  //>>includeEnd('debug');\n\n  return result;\n};\n\n/**\n * Computes the dot (scalar) product of two Cartesians.\n *\n * @param {Cartesian2} left The first Cartesian.\n * @param {Cartesian2} right The second Cartesian.\n * @returns {number} The dot product.\n */\nCartesian2.dot = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  return left.x * right.x + left.y * right.y;\n};\n\n/**\n * Computes the magnitude of the cross product that would result from implicitly setting the Z coordinate of the input vectors to 0\n *\n * @param {Cartesian2} left The first Cartesian.\n * @param {Cartesian2} right The second Cartesian.\n * @returns {number} The cross product.\n */\nCartesian2.cross = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  return left.x * right.y - left.y * right.x;\n};\n\n/**\n * Computes the componentwise product of two Cartesians.\n *\n * @param {Cartesian2} left The first Cartesian.\n * @param {Cartesian2} right The second Cartesian.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.multiplyComponents = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = left.x * right.x;\n  result.y = left.y * right.y;\n  return result;\n};\n\n/**\n * Computes the componentwise quotient of two Cartesians.\n *\n * @param {Cartesian2} left The first Cartesian.\n * @param {Cartesian2} right The second Cartesian.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.divideComponents = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = left.x / right.x;\n  result.y = left.y / right.y;\n  return result;\n};\n\n/**\n * Computes the componentwise sum of two Cartesians.\n *\n * @param {Cartesian2} left The first Cartesian.\n * @param {Cartesian2} right The second Cartesian.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.add = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = left.x + right.x;\n  result.y = left.y + right.y;\n  return result;\n};\n\n/**\n * Computes the componentwise difference of two Cartesians.\n *\n * @param {Cartesian2} left The first Cartesian.\n * @param {Cartesian2} right The second Cartesian.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.subtract = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = left.x - right.x;\n  result.y = left.y - right.y;\n  return result;\n};\n\n/**\n * Multiplies the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian2} cartesian The Cartesian to be scaled.\n * @param {number} scalar The scalar to multiply with.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.multiplyByScalar = function (cartesian, scalar, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.number(\"scalar\", scalar);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = cartesian.x * scalar;\n  result.y = cartesian.y * scalar;\n  return result;\n};\n\n/**\n * Divides the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian2} cartesian The Cartesian to be divided.\n * @param {number} scalar The scalar to divide by.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.divideByScalar = function (cartesian, scalar, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.number(\"scalar\", scalar);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = cartesian.x / scalar;\n  result.y = cartesian.y / scalar;\n  return result;\n};\n\n/**\n * Negates the provided Cartesian.\n *\n * @param {Cartesian2} cartesian The Cartesian to be negated.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.negate = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = -cartesian.x;\n  result.y = -cartesian.y;\n  return result;\n};\n\n/**\n * Computes the absolute value of the provided Cartesian.\n *\n * @param {Cartesian2} cartesian The Cartesian whose absolute value is to be computed.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.abs = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = Math.abs(cartesian.x);\n  result.y = Math.abs(cartesian.y);\n  return result;\n};\n\nconst lerpScratch = new Cartesian2();\n/**\n * Computes the linear interpolation or extrapolation at t using the provided cartesians.\n *\n * @param {Cartesian2} start The value corresponding to t at 0.0.\n * @param {Cartesian2} end The value corresponding to t at 1.0.\n * @param {number} t The point along t at which to interpolate.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.lerp = function (start, end, t, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"start\", start);\n  Check.typeOf.object(\"end\", end);\n  Check.typeOf.number(\"t\", t);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  Cartesian2.multiplyByScalar(end, t, lerpScratch);\n  result = Cartesian2.multiplyByScalar(start, 1.0 - t, result);\n  return Cartesian2.add(lerpScratch, result, result);\n};\n\nconst angleBetweenScratch = new Cartesian2();\nconst angleBetweenScratch2 = new Cartesian2();\n/**\n * Returns the angle, in radians, between the provided Cartesians.\n *\n * @param {Cartesian2} left The first Cartesian.\n * @param {Cartesian2} right The second Cartesian.\n * @returns {number} The angle between the Cartesians.\n */\nCartesian2.angleBetween = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  Cartesian2.normalize(left, angleBetweenScratch);\n  Cartesian2.normalize(right, angleBetweenScratch2);\n  return CesiumMath.acosClamped(\n    Cartesian2.dot(angleBetweenScratch, angleBetweenScratch2)\n  );\n};\n\nconst mostOrthogonalAxisScratch = new Cartesian2();\n/**\n * Returns the axis that is most orthogonal to the provided Cartesian.\n *\n * @param {Cartesian2} cartesian The Cartesian on which to find the most orthogonal axis.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The most orthogonal axis.\n */\nCartesian2.mostOrthogonalAxis = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch);\n  Cartesian2.abs(f, f);\n\n  if (f.x <= f.y) {\n    result = Cartesian2.clone(Cartesian2.UNIT_X, result);\n  } else {\n    result = Cartesian2.clone(Cartesian2.UNIT_Y, result);\n  }\n\n  return result;\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartesian2} [left] The first Cartesian.\n * @param {Cartesian2} [right] The second Cartesian.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCartesian2.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left.x === right.x &&\n      left.y === right.y)\n  );\n};\n\n/**\n * @private\n */\nCartesian2.equalsArray = function (cartesian, array, offset) {\n  return cartesian.x === array[offset] && cartesian.y === array[offset + 1];\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {Cartesian2} [left] The first Cartesian.\n * @param {Cartesian2} [right] The second Cartesian.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nCartesian2.equalsEpsilon = function (\n  left,\n  right,\n  relativeEpsilon,\n  absoluteEpsilon\n) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      CesiumMath.equalsEpsilon(\n        left.x,\n        right.x,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        left.y,\n        right.y,\n        relativeEpsilon,\n        absoluteEpsilon\n      ))\n  );\n};\n\n/**\n * An immutable Cartesian2 instance initialized to (0.0, 0.0).\n *\n * @type {Cartesian2}\n * @constant\n */\nCartesian2.ZERO = Object.freeze(new Cartesian2(0.0, 0.0));\n\n/**\n * An immutable Cartesian2 instance initialized to (1.0, 1.0).\n *\n * @type {Cartesian2}\n * @constant\n */\nCartesian2.ONE = Object.freeze(new Cartesian2(1.0, 1.0));\n\n/**\n * An immutable Cartesian2 instance initialized to (1.0, 0.0).\n *\n * @type {Cartesian2}\n * @constant\n */\nCartesian2.UNIT_X = Object.freeze(new Cartesian2(1.0, 0.0));\n\n/**\n * An immutable Cartesian2 instance initialized to (0.0, 1.0).\n *\n * @type {Cartesian2}\n * @constant\n */\nCartesian2.UNIT_Y = Object.freeze(new Cartesian2(0.0, 1.0));\n\n/**\n * Duplicates this Cartesian2 instance.\n *\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\n */\nCartesian2.prototype.clone = function (result) {\n  return Cartesian2.clone(this, result);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartesian2} [right] The right hand side Cartesian.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nCartesian2.prototype.equals = function (right) {\n  return Cartesian2.equals(this, right);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {Cartesian2} [right] The right hand side Cartesian.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nCartesian2.prototype.equalsEpsilon = function (\n  right,\n  relativeEpsilon,\n  absoluteEpsilon\n) {\n  return Cartesian2.equalsEpsilon(\n    this,\n    right,\n    relativeEpsilon,\n    absoluteEpsilon\n  );\n};\n\n/**\n * Creates a string representing this Cartesian in the format '(x, y)'.\n *\n * @returns {string} A string representing the provided Cartesian in the format '(x, y)'.\n */\nCartesian2.prototype.toString = function () {\n  return `(${this.x}, ${this.y})`;\n};\nexport default Cartesian2;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\nconst scaleToGeodeticSurfaceIntersection = new Cartesian3();\nconst scaleToGeodeticSurfaceGradient = new Cartesian3();\n\n/**\n * Scales the provided Cartesian position along the geodetic surface normal\n * so that it is on the surface of this ellipsoid.  If the position is\n * at the center of the ellipsoid, this function returns undefined.\n *\n * @param {Cartesian3} cartesian The Cartesian position to scale.\n * @param {Cartesian3} oneOverRadii One over radii of the ellipsoid.\n * @param {Cartesian3} oneOverRadiiSquared One over radii squared of the ellipsoid.\n * @param {number} centerToleranceSquared Tolerance for closeness to the center.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.\n *\n * @function scaleToGeodeticSurface\n *\n * @private\n */\nfunction scaleToGeodeticSurface(\n  cartesian,\n  oneOverRadii,\n  oneOverRadiiSquared,\n  centerToleranceSquared,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(cartesian)) {\n    throw new DeveloperError(\"cartesian is required.\");\n  }\n  if (!defined(oneOverRadii)) {\n    throw new DeveloperError(\"oneOverRadii is required.\");\n  }\n  if (!defined(oneOverRadiiSquared)) {\n    throw new DeveloperError(\"oneOverRadiiSquared is required.\");\n  }\n  if (!defined(centerToleranceSquared)) {\n    throw new DeveloperError(\"centerToleranceSquared is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const positionX = cartesian.x;\n  const positionY = cartesian.y;\n  const positionZ = cartesian.z;\n\n  const oneOverRadiiX = oneOverRadii.x;\n  const oneOverRadiiY = oneOverRadii.y;\n  const oneOverRadiiZ = oneOverRadii.z;\n\n  const x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX;\n  const y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY;\n  const z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ;\n\n  // Compute the squared ellipsoid norm.\n  const squaredNorm = x2 + y2 + z2;\n  const ratio = Math.sqrt(1.0 / squaredNorm);\n\n  // As an initial approximation, assume that the radial intersection is the projection point.\n  const intersection = Cartesian3.multiplyByScalar(\n    cartesian,\n    ratio,\n    scaleToGeodeticSurfaceIntersection\n  );\n\n  // If the position is near the center, the iteration will not converge.\n  if (squaredNorm < centerToleranceSquared) {\n    return !isFinite(ratio)\n      ? undefined\n      : Cartesian3.clone(intersection, result);\n  }\n\n  const oneOverRadiiSquaredX = oneOverRadiiSquared.x;\n  const oneOverRadiiSquaredY = oneOverRadiiSquared.y;\n  const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;\n\n  // Use the gradient at the intersection point in place of the true unit normal.\n  // The difference in magnitude will be absorbed in the multiplier.\n  const gradient = scaleToGeodeticSurfaceGradient;\n  gradient.x = intersection.x * oneOverRadiiSquaredX * 2.0;\n  gradient.y = intersection.y * oneOverRadiiSquaredY * 2.0;\n  gradient.z = intersection.z * oneOverRadiiSquaredZ * 2.0;\n\n  // Compute the initial guess at the normal vector multiplier, lambda.\n  let lambda =\n    ((1.0 - ratio) * Cartesian3.magnitude(cartesian)) /\n    (0.5 * Cartesian3.magnitude(gradient));\n  let correction = 0.0;\n\n  let func;\n  let denominator;\n  let xMultiplier;\n  let yMultiplier;\n  let zMultiplier;\n  let xMultiplier2;\n  let yMultiplier2;\n  let zMultiplier2;\n  let xMultiplier3;\n  let yMultiplier3;\n  let zMultiplier3;\n\n  do {\n    lambda -= correction;\n\n    xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX);\n    yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY);\n    zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ);\n\n    xMultiplier2 = xMultiplier * xMultiplier;\n    yMultiplier2 = yMultiplier * yMultiplier;\n    zMultiplier2 = zMultiplier * zMultiplier;\n\n    xMultiplier3 = xMultiplier2 * xMultiplier;\n    yMultiplier3 = yMultiplier2 * yMultiplier;\n    zMultiplier3 = zMultiplier2 * zMultiplier;\n\n    func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0;\n\n    // \"denominator\" here refers to the use of this expression in the velocity and acceleration\n    // computations in the sections to follow.\n    denominator =\n      x2 * xMultiplier3 * oneOverRadiiSquaredX +\n      y2 * yMultiplier3 * oneOverRadiiSquaredY +\n      z2 * zMultiplier3 * oneOverRadiiSquaredZ;\n\n    const derivative = -2.0 * denominator;\n\n    correction = func / derivative;\n  } while (Math.abs(func) > CesiumMath.EPSILON12);\n\n  if (!defined(result)) {\n    return new Cartesian3(\n      positionX * xMultiplier,\n      positionY * yMultiplier,\n      positionZ * zMultiplier\n    );\n  }\n  result.x = positionX * xMultiplier;\n  result.y = positionY * yMultiplier;\n  result.z = positionZ * zMultiplier;\n  return result;\n}\nexport default scaleToGeodeticSurface;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport CesiumMath from \"./Math.js\";\nimport scaleToGeodeticSurface from \"./scaleToGeodeticSurface.js\";\n\n/**\n * A position defined by longitude, latitude, and height.\n * @alias Cartographic\n * @constructor\n *\n * @param {number} [longitude=0.0] The longitude, in radians.\n * @param {number} [latitude=0.0] The latitude, in radians.\n * @param {number} [height=0.0] The height, in meters, above the ellipsoid.\n *\n * @see Ellipsoid\n */\nfunction Cartographic(longitude, latitude, height) {\n  /**\n   * The longitude, in radians.\n   * @type {number}\n   * @default 0.0\n   */\n  this.longitude = defaultValue(longitude, 0.0);\n\n  /**\n   * The latitude, in radians.\n   * @type {number}\n   * @default 0.0\n   */\n  this.latitude = defaultValue(latitude, 0.0);\n\n  /**\n   * The height, in meters, above the ellipsoid.\n   * @type {number}\n   * @default 0.0\n   */\n  this.height = defaultValue(height, 0.0);\n}\n\n/**\n * Creates a new Cartographic instance from longitude and latitude\n * specified in radians.\n *\n * @param {number} longitude The longitude, in radians.\n * @param {number} latitude The latitude, in radians.\n * @param {number} [height=0.0] The height, in meters, above the ellipsoid.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\n */\nCartographic.fromRadians = function (longitude, latitude, height, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"longitude\", longitude);\n  Check.typeOf.number(\"latitude\", latitude);\n  //>>includeEnd('debug');\n\n  height = defaultValue(height, 0.0);\n\n  if (!defined(result)) {\n    return new Cartographic(longitude, latitude, height);\n  }\n\n  result.longitude = longitude;\n  result.latitude = latitude;\n  result.height = height;\n  return result;\n};\n\n/**\n * Creates a new Cartographic instance from longitude and latitude\n * specified in degrees.  The values in the resulting object will\n * be in radians.\n *\n * @param {number} longitude The longitude, in degrees.\n * @param {number} latitude The latitude, in degrees.\n * @param {number} [height=0.0] The height, in meters, above the ellipsoid.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\n */\nCartographic.fromDegrees = function (longitude, latitude, height, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"longitude\", longitude);\n  Check.typeOf.number(\"latitude\", latitude);\n  //>>includeEnd('debug');\n  longitude = CesiumMath.toRadians(longitude);\n  latitude = CesiumMath.toRadians(latitude);\n\n  return Cartographic.fromRadians(longitude, latitude, height, result);\n};\n\nconst cartesianToCartographicN = new Cartesian3();\nconst cartesianToCartographicP = new Cartesian3();\nconst cartesianToCartographicH = new Cartesian3();\nconst wgs84OneOverRadii = new Cartesian3(\n  1.0 / 6378137.0,\n  1.0 / 6378137.0,\n  1.0 / 6356752.3142451793\n);\nconst wgs84OneOverRadiiSquared = new Cartesian3(\n  1.0 / (6378137.0 * 6378137.0),\n  1.0 / (6378137.0 * 6378137.0),\n  1.0 / (6356752.3142451793 * 6356752.3142451793)\n);\nconst wgs84CenterToleranceSquared = CesiumMath.EPSILON1;\n\n/**\n * Creates a new Cartographic instance from a Cartesian position. The values in the\n * resulting object will be in radians.\n *\n * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.\n */\nCartographic.fromCartesian = function (cartesian, ellipsoid, result) {\n  const oneOverRadii = defined(ellipsoid)\n    ? ellipsoid.oneOverRadii\n    : wgs84OneOverRadii;\n  const oneOverRadiiSquared = defined(ellipsoid)\n    ? ellipsoid.oneOverRadiiSquared\n    : wgs84OneOverRadiiSquared;\n  const centerToleranceSquared = defined(ellipsoid)\n    ? ellipsoid._centerToleranceSquared\n    : wgs84CenterToleranceSquared;\n\n  //`cartesian is required.` is thrown from scaleToGeodeticSurface\n  const p = scaleToGeodeticSurface(\n    cartesian,\n    oneOverRadii,\n    oneOverRadiiSquared,\n    centerToleranceSquared,\n    cartesianToCartographicP\n  );\n\n  if (!defined(p)) {\n    return undefined;\n  }\n\n  let n = Cartesian3.multiplyComponents(\n    p,\n    oneOverRadiiSquared,\n    cartesianToCartographicN\n  );\n  n = Cartesian3.normalize(n, n);\n\n  const h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH);\n\n  const longitude = Math.atan2(n.y, n.x);\n  const latitude = Math.asin(n.z);\n  const height =\n    CesiumMath.sign(Cartesian3.dot(h, cartesian)) * Cartesian3.magnitude(h);\n\n  if (!defined(result)) {\n    return new Cartographic(longitude, latitude, height);\n  }\n  result.longitude = longitude;\n  result.latitude = latitude;\n  result.height = height;\n  return result;\n};\n\n/**\n * Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted\n * object should be in radians.\n *\n * @param {Cartographic} cartographic Input to be converted into a Cartesian3 output.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The position\n */\nCartographic.toCartesian = function (cartographic, ellipsoid, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartographic\", cartographic);\n  //>>includeEnd('debug');\n\n  return Cartesian3.fromRadians(\n    cartographic.longitude,\n    cartographic.latitude,\n    cartographic.height,\n    ellipsoid,\n    result\n  );\n};\n\n/**\n * Duplicates a Cartographic instance.\n *\n * @param {Cartographic} cartographic The cartographic to duplicate.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided. (Returns undefined if cartographic is undefined)\n */\nCartographic.clone = function (cartographic, result) {\n  if (!defined(cartographic)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    return new Cartographic(\n      cartographic.longitude,\n      cartographic.latitude,\n      cartographic.height\n    );\n  }\n  result.longitude = cartographic.longitude;\n  result.latitude = cartographic.latitude;\n  result.height = cartographic.height;\n  return result;\n};\n\n/**\n * Compares the provided cartographics componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartographic} [left] The first cartographic.\n * @param {Cartographic} [right] The second cartographic.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCartographic.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left.longitude === right.longitude &&\n      left.latitude === right.latitude &&\n      left.height === right.height)\n  );\n};\n\n/**\n * Compares the provided cartographics componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Cartographic} [left] The first cartographic.\n * @param {Cartographic} [right] The second cartographic.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nCartographic.equalsEpsilon = function (left, right, epsilon) {\n  epsilon = defaultValue(epsilon, 0);\n\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      Math.abs(left.longitude - right.longitude) <= epsilon &&\n      Math.abs(left.latitude - right.latitude) <= epsilon &&\n      Math.abs(left.height - right.height) <= epsilon)\n  );\n};\n\n/**\n * An immutable Cartographic instance initialized to (0.0, 0.0, 0.0).\n *\n * @type {Cartographic}\n * @constant\n */\nCartographic.ZERO = Object.freeze(new Cartographic(0.0, 0.0, 0.0));\n\n/**\n * Duplicates this instance.\n *\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\n */\nCartographic.prototype.clone = function (result) {\n  return Cartographic.clone(this, result);\n};\n\n/**\n * Compares the provided against this cartographic componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartographic} [right] The second cartographic.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCartographic.prototype.equals = function (right) {\n  return Cartographic.equals(this, right);\n};\n\n/**\n * Compares the provided against this cartographic componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Cartographic} [right] The second cartographic.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nCartographic.prototype.equalsEpsilon = function (right, epsilon) {\n  return Cartographic.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Creates a string representing this cartographic in the format '(longitude, latitude, height)'.\n *\n * @returns {string} A string representing the provided cartographic in the format '(longitude, latitude, height)'.\n */\nCartographic.prototype.toString = function () {\n  return `(${this.longitude}, ${this.latitude}, ${this.height})`;\n};\nexport default Cartographic;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport scaleToGeodeticSurface from \"./scaleToGeodeticSurface.js\";\n\nfunction initialize(ellipsoid, x, y, z) {\n  x = defaultValue(x, 0.0);\n  y = defaultValue(y, 0.0);\n  z = defaultValue(z, 0.0);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThanOrEquals(\"x\", x, 0.0);\n  Check.typeOf.number.greaterThanOrEquals(\"y\", y, 0.0);\n  Check.typeOf.number.greaterThanOrEquals(\"z\", z, 0.0);\n  //>>includeEnd('debug');\n\n  ellipsoid._radii = new Cartesian3(x, y, z);\n\n  ellipsoid._radiiSquared = new Cartesian3(x * x, y * y, z * z);\n\n  ellipsoid._radiiToTheFourth = new Cartesian3(\n    x * x * x * x,\n    y * y * y * y,\n    z * z * z * z\n  );\n\n  ellipsoid._oneOverRadii = new Cartesian3(\n    x === 0.0 ? 0.0 : 1.0 / x,\n    y === 0.0 ? 0.0 : 1.0 / y,\n    z === 0.0 ? 0.0 : 1.0 / z\n  );\n\n  ellipsoid._oneOverRadiiSquared = new Cartesian3(\n    x === 0.0 ? 0.0 : 1.0 / (x * x),\n    y === 0.0 ? 0.0 : 1.0 / (y * y),\n    z === 0.0 ? 0.0 : 1.0 / (z * z)\n  );\n\n  ellipsoid._minimumRadius = Math.min(x, y, z);\n\n  ellipsoid._maximumRadius = Math.max(x, y, z);\n\n  ellipsoid._centerToleranceSquared = CesiumMath.EPSILON1;\n\n  if (ellipsoid._radiiSquared.z !== 0) {\n    ellipsoid._squaredXOverSquaredZ =\n      ellipsoid._radiiSquared.x / ellipsoid._radiiSquared.z;\n  }\n}\n\n/**\n * A quadratic surface defined in Cartesian coordinates by the equation\n * <code>(x / a)^2 + (y / b)^2 + (z / c)^2 = 1</code>.  Primarily used\n * by Cesium to represent the shape of planetary bodies.\n *\n * Rather than constructing this object directly, one of the provided\n * constants is normally used.\n * @alias Ellipsoid\n * @constructor\n *\n * @param {number} [x=0] The radius in the x direction.\n * @param {number} [y=0] The radius in the y direction.\n * @param {number} [z=0] The radius in the z direction.\n *\n * @exception {DeveloperError} All radii components must be greater than or equal to zero.\n *\n * @see Ellipsoid.fromCartesian3\n * @see Ellipsoid.WGS84\n * @see Ellipsoid.UNIT_SPHERE\n */\nfunction Ellipsoid(x, y, z) {\n  this._radii = undefined;\n  this._radiiSquared = undefined;\n  this._radiiToTheFourth = undefined;\n  this._oneOverRadii = undefined;\n  this._oneOverRadiiSquared = undefined;\n  this._minimumRadius = undefined;\n  this._maximumRadius = undefined;\n  this._centerToleranceSquared = undefined;\n  this._squaredXOverSquaredZ = undefined;\n\n  initialize(this, x, y, z);\n}\n\nObject.defineProperties(Ellipsoid.prototype, {\n  /**\n   * Gets the radii of the ellipsoid.\n   * @memberof Ellipsoid.prototype\n   * @type {Cartesian3}\n   * @readonly\n   */\n  radii: {\n    get: function () {\n      return this._radii;\n    },\n  },\n  /**\n   * Gets the squared radii of the ellipsoid.\n   * @memberof Ellipsoid.prototype\n   * @type {Cartesian3}\n   * @readonly\n   */\n  radiiSquared: {\n    get: function () {\n      return this._radiiSquared;\n    },\n  },\n  /**\n   * Gets the radii of the ellipsoid raise to the fourth power.\n   * @memberof Ellipsoid.prototype\n   * @type {Cartesian3}\n   * @readonly\n   */\n  radiiToTheFourth: {\n    get: function () {\n      return this._radiiToTheFourth;\n    },\n  },\n  /**\n   * Gets one over the radii of the ellipsoid.\n   * @memberof Ellipsoid.prototype\n   * @type {Cartesian3}\n   * @readonly\n   */\n  oneOverRadii: {\n    get: function () {\n      return this._oneOverRadii;\n    },\n  },\n  /**\n   * Gets one over the squared radii of the ellipsoid.\n   * @memberof Ellipsoid.prototype\n   * @type {Cartesian3}\n   * @readonly\n   */\n  oneOverRadiiSquared: {\n    get: function () {\n      return this._oneOverRadiiSquared;\n    },\n  },\n  /**\n   * Gets the minimum radius of the ellipsoid.\n   * @memberof Ellipsoid.prototype\n   * @type {number}\n   * @readonly\n   */\n  minimumRadius: {\n    get: function () {\n      return this._minimumRadius;\n    },\n  },\n  /**\n   * Gets the maximum radius of the ellipsoid.\n   * @memberof Ellipsoid.prototype\n   * @type {number}\n   * @readonly\n   */\n  maximumRadius: {\n    get: function () {\n      return this._maximumRadius;\n    },\n  },\n});\n\n/**\n * Duplicates an Ellipsoid instance.\n *\n * @param {Ellipsoid} ellipsoid The ellipsoid to duplicate.\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\n *                    instance should be created.\n * @returns {Ellipsoid} The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)\n */\nEllipsoid.clone = function (ellipsoid, result) {\n  if (!defined(ellipsoid)) {\n    return undefined;\n  }\n  const radii = ellipsoid._radii;\n\n  if (!defined(result)) {\n    return new Ellipsoid(radii.x, radii.y, radii.z);\n  }\n\n  Cartesian3.clone(radii, result._radii);\n  Cartesian3.clone(ellipsoid._radiiSquared, result._radiiSquared);\n  Cartesian3.clone(ellipsoid._radiiToTheFourth, result._radiiToTheFourth);\n  Cartesian3.clone(ellipsoid._oneOverRadii, result._oneOverRadii);\n  Cartesian3.clone(ellipsoid._oneOverRadiiSquared, result._oneOverRadiiSquared);\n  result._minimumRadius = ellipsoid._minimumRadius;\n  result._maximumRadius = ellipsoid._maximumRadius;\n  result._centerToleranceSquared = ellipsoid._centerToleranceSquared;\n\n  return result;\n};\n\n/**\n * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.\n *\n * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions.\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\n *                    instance should be created.\n * @returns {Ellipsoid} A new Ellipsoid instance.\n *\n * @exception {DeveloperError} All radii components must be greater than or equal to zero.\n *\n * @see Ellipsoid.WGS84\n * @see Ellipsoid.UNIT_SPHERE\n */\nEllipsoid.fromCartesian3 = function (cartesian, result) {\n  if (!defined(result)) {\n    result = new Ellipsoid();\n  }\n\n  if (!defined(cartesian)) {\n    return result;\n  }\n\n  initialize(result, cartesian.x, cartesian.y, cartesian.z);\n  return result;\n};\n\n/**\n * An Ellipsoid instance initialized to the WGS84 standard.\n *\n * @type {Ellipsoid}\n * @constant\n */\nEllipsoid.WGS84 = Object.freeze(\n  new Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793)\n);\n\n/**\n * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).\n *\n * @type {Ellipsoid}\n * @constant\n */\nEllipsoid.UNIT_SPHERE = Object.freeze(new Ellipsoid(1.0, 1.0, 1.0));\n\n/**\n * An Ellipsoid instance initialized to a sphere with the lunar radius.\n *\n * @type {Ellipsoid}\n * @constant\n */\nEllipsoid.MOON = Object.freeze(\n  new Ellipsoid(\n    CesiumMath.LUNAR_RADIUS,\n    CesiumMath.LUNAR_RADIUS,\n    CesiumMath.LUNAR_RADIUS\n  )\n);\n\n/**\n * Duplicates an Ellipsoid instance.\n *\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\n *                    instance should be created.\n * @returns {Ellipsoid} The cloned Ellipsoid.\n */\nEllipsoid.prototype.clone = function (result) {\n  return Ellipsoid.clone(this, result);\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nEllipsoid.packedLength = Cartesian3.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Ellipsoid} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nEllipsoid.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  Cartesian3.pack(value._radii, array, startingIndex);\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Ellipsoid} [result] The object into which to store the result.\n * @returns {Ellipsoid} The modified result parameter or a new Ellipsoid instance if one was not provided.\n */\nEllipsoid.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const radii = Cartesian3.unpack(array, startingIndex);\n  return Ellipsoid.fromCartesian3(radii, result);\n};\n\n/**\n * Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.\n * @function\n *\n * @param {Cartesian3} cartesian The Cartesian for which to to determine the geocentric normal.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */\nEllipsoid.prototype.geocentricSurfaceNormal = Cartesian3.normalize;\n\n/**\n * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.\n *\n * @param {Cartographic} cartographic The cartographic position for which to to determine the geodetic normal.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */\nEllipsoid.prototype.geodeticSurfaceNormalCartographic = function (\n  cartographic,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartographic\", cartographic);\n  //>>includeEnd('debug');\n\n  const longitude = cartographic.longitude;\n  const latitude = cartographic.latitude;\n  const cosLatitude = Math.cos(latitude);\n\n  const x = cosLatitude * Math.cos(longitude);\n  const y = cosLatitude * Math.sin(longitude);\n  const z = Math.sin(latitude);\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  return Cartesian3.normalize(result, result);\n};\n\n/**\n * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.\n *\n * @param {Cartesian3} cartesian The Cartesian position for which to to determine the surface normal.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.\n */\nEllipsoid.prototype.geodeticSurfaceNormal = function (cartesian, result) {\n  if (\n    Cartesian3.equalsEpsilon(cartesian, Cartesian3.ZERO, CesiumMath.EPSILON14)\n  ) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n  result = Cartesian3.multiplyComponents(\n    cartesian,\n    this._oneOverRadiiSquared,\n    result\n  );\n  return Cartesian3.normalize(result, result);\n};\n\nconst cartographicToCartesianNormal = new Cartesian3();\nconst cartographicToCartesianK = new Cartesian3();\n\n/**\n * Converts the provided cartographic to Cartesian representation.\n *\n * @param {Cartographic} cartographic The cartographic position.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n *\n * @example\n * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.\n * const position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);\n * const cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);\n */\nEllipsoid.prototype.cartographicToCartesian = function (cartographic, result) {\n  //`cartographic is required` is thrown from geodeticSurfaceNormalCartographic.\n  const n = cartographicToCartesianNormal;\n  const k = cartographicToCartesianK;\n  this.geodeticSurfaceNormalCartographic(cartographic, n);\n  Cartesian3.multiplyComponents(this._radiiSquared, n, k);\n  const gamma = Math.sqrt(Cartesian3.dot(n, k));\n  Cartesian3.divideByScalar(k, gamma, k);\n  Cartesian3.multiplyByScalar(n, cartographic.height, n);\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n  return Cartesian3.add(k, n, result);\n};\n\n/**\n * Converts the provided array of cartographics to an array of Cartesians.\n *\n * @param {Cartographic[]} cartographics An array of cartographic positions.\n * @param {Cartesian3[]} [result] The object onto which to store the result.\n * @returns {Cartesian3[]} The modified result parameter or a new Array instance if none was provided.\n *\n * @example\n * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.\n * const positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),\n *                  new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),\n *                  new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];\n * const cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);\n */\nEllipsoid.prototype.cartographicArrayToCartesianArray = function (\n  cartographics,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartographics\", cartographics);\n  //>>includeEnd('debug')\n\n  const length = cartographics.length;\n  if (!defined(result)) {\n    result = new Array(length);\n  } else {\n    result.length = length;\n  }\n  for (let i = 0; i < length; i++) {\n    result[i] = this.cartographicToCartesian(cartographics[i], result[i]);\n  }\n  return result;\n};\n\nconst cartesianToCartographicN = new Cartesian3();\nconst cartesianToCartographicP = new Cartesian3();\nconst cartesianToCartographicH = new Cartesian3();\n\n/**\n * Converts the provided cartesian to cartographic representation.\n * The cartesian is undefined at the center of the ellipsoid.\n *\n * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.\n *\n * @example\n * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.\n * const position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);\n * const cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);\n */\nEllipsoid.prototype.cartesianToCartographic = function (cartesian, result) {\n  //`cartesian is required.` is thrown from scaleToGeodeticSurface\n  const p = this.scaleToGeodeticSurface(cartesian, cartesianToCartographicP);\n\n  if (!defined(p)) {\n    return undefined;\n  }\n\n  const n = this.geodeticSurfaceNormal(p, cartesianToCartographicN);\n  const h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH);\n\n  const longitude = Math.atan2(n.y, n.x);\n  const latitude = Math.asin(n.z);\n  const height =\n    CesiumMath.sign(Cartesian3.dot(h, cartesian)) * Cartesian3.magnitude(h);\n\n  if (!defined(result)) {\n    return new Cartographic(longitude, latitude, height);\n  }\n  result.longitude = longitude;\n  result.latitude = latitude;\n  result.height = height;\n  return result;\n};\n\n/**\n * Converts the provided array of cartesians to an array of cartographics.\n *\n * @param {Cartesian3[]} cartesians An array of Cartesian positions.\n * @param {Cartographic[]} [result] The object onto which to store the result.\n * @returns {Cartographic[]} The modified result parameter or a new Array instance if none was provided.\n *\n * @example\n * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.\n * const positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),\n *                  new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),\n *                  new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]\n * const cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);\n */\nEllipsoid.prototype.cartesianArrayToCartographicArray = function (\n  cartesians,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartesians\", cartesians);\n  //>>includeEnd('debug');\n\n  const length = cartesians.length;\n  if (!defined(result)) {\n    result = new Array(length);\n  } else {\n    result.length = length;\n  }\n  for (let i = 0; i < length; ++i) {\n    result[i] = this.cartesianToCartographic(cartesians[i], result[i]);\n  }\n  return result;\n};\n\n/**\n * Scales the provided Cartesian position along the geodetic surface normal\n * so that it is on the surface of this ellipsoid.  If the position is\n * at the center of the ellipsoid, this function returns undefined.\n *\n * @param {Cartesian3} cartesian The Cartesian position to scale.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.\n */\nEllipsoid.prototype.scaleToGeodeticSurface = function (cartesian, result) {\n  return scaleToGeodeticSurface(\n    cartesian,\n    this._oneOverRadii,\n    this._oneOverRadiiSquared,\n    this._centerToleranceSquared,\n    result\n  );\n};\n\n/**\n * Scales the provided Cartesian position along the geocentric surface normal\n * so that it is on the surface of this ellipsoid.\n *\n * @param {Cartesian3} cartesian The Cartesian position to scale.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */\nEllipsoid.prototype.scaleToGeocentricSurface = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  const positionX = cartesian.x;\n  const positionY = cartesian.y;\n  const positionZ = cartesian.z;\n  const oneOverRadiiSquared = this._oneOverRadiiSquared;\n\n  const beta =\n    1.0 /\n    Math.sqrt(\n      positionX * positionX * oneOverRadiiSquared.x +\n        positionY * positionY * oneOverRadiiSquared.y +\n        positionZ * positionZ * oneOverRadiiSquared.z\n    );\n\n  return Cartesian3.multiplyByScalar(cartesian, beta, result);\n};\n\n/**\n * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying\n * its components by the result of {@link Ellipsoid#oneOverRadii}.\n *\n * @param {Cartesian3} position The position to transform.\n * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and\n *        return a new instance.\n * @returns {Cartesian3} The position expressed in the scaled space.  The returned instance is the\n *          one passed as the result parameter if it is not undefined, or a new instance of it is.\n */\nEllipsoid.prototype.transformPositionToScaledSpace = function (\n  position,\n  result\n) {\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  return Cartesian3.multiplyComponents(position, this._oneOverRadii, result);\n};\n\n/**\n * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying\n * its components by the result of {@link Ellipsoid#radii}.\n *\n * @param {Cartesian3} position The position to transform.\n * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and\n *        return a new instance.\n * @returns {Cartesian3} The position expressed in the unscaled space.  The returned instance is the\n *          one passed as the result parameter if it is not undefined, or a new instance of it is.\n */\nEllipsoid.prototype.transformPositionFromScaledSpace = function (\n  position,\n  result\n) {\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  return Cartesian3.multiplyComponents(position, this._radii, result);\n};\n\n/**\n * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Ellipsoid} [right] The other Ellipsoid.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nEllipsoid.prototype.equals = function (right) {\n  return (\n    this === right ||\n    (defined(right) && Cartesian3.equals(this._radii, right._radii))\n  );\n};\n\n/**\n * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.\n *\n * @returns {string} A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.\n */\nEllipsoid.prototype.toString = function () {\n  return this._radii.toString();\n};\n\n/**\n * Computes a point which is the intersection of the surface normal with the z-axis.\n *\n * @param {Cartesian3} position the position. must be on the surface of the ellipsoid.\n * @param {number} [buffer = 0.0] A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.\n *                                In earth case, with common earth datums, there is no need for this buffer since the intersection point is always (relatively) very close to the center.\n *                                In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).\n *                                Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2\n * @param {Cartesian3} [result] The cartesian to which to copy the result, or undefined to create and\n *        return a new instance.\n * @returns {Cartesian3 | undefined} the intersection point if it's inside the ellipsoid, undefined otherwise\n *\n * @exception {DeveloperError} position is required.\n * @exception {DeveloperError} Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y).\n * @exception {DeveloperError} Ellipsoid.radii.z must be greater than 0.\n */\nEllipsoid.prototype.getSurfaceNormalIntersectionWithZAxis = function (\n  position,\n  buffer,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"position\", position);\n\n  if (\n    !CesiumMath.equalsEpsilon(\n      this._radii.x,\n      this._radii.y,\n      CesiumMath.EPSILON15\n    )\n  ) {\n    throw new DeveloperError(\n      \"Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)\"\n    );\n  }\n\n  Check.typeOf.number.greaterThan(\"Ellipsoid.radii.z\", this._radii.z, 0);\n  //>>includeEnd('debug');\n\n  buffer = defaultValue(buffer, 0.0);\n\n  const squaredXOverSquaredZ = this._squaredXOverSquaredZ;\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  result.x = 0.0;\n  result.y = 0.0;\n  result.z = position.z * (1 - squaredXOverSquaredZ);\n\n  if (Math.abs(result.z) >= this._radii.z - buffer) {\n    return undefined;\n  }\n\n  return result;\n};\n\nconst scratchEndpoint = new Cartesian3();\n\n/**\n * Computes the ellipsoid curvatures at a given position on the surface.\n *\n * @param {Cartesian3} surfacePosition The position on the ellipsoid surface where curvatures will be calculated.\n * @param {Cartesian2} [result] The cartesian to which to copy the result, or undefined to create and return a new instance.\n * @returns {Cartesian2} The local curvature of the ellipsoid surface at the provided position, in east and north directions.\n *\n * @exception {DeveloperError} position is required.\n */\nEllipsoid.prototype.getLocalCurvature = function (surfacePosition, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"surfacePosition\", surfacePosition);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian2();\n  }\n\n  const primeVerticalEndpoint = this.getSurfaceNormalIntersectionWithZAxis(\n    surfacePosition,\n    0.0,\n    scratchEndpoint\n  );\n  const primeVerticalRadius = Cartesian3.distance(\n    surfacePosition,\n    primeVerticalEndpoint\n  );\n  // meridional radius = (1 - e^2) * primeVerticalRadius^3 / a^2\n  // where 1 - e^2 = b^2 / a^2,\n  // so meridional = b^2 * primeVerticalRadius^3 / a^4\n  //   = (b * primeVerticalRadius / a^2)^2 * primeVertical\n  const radiusRatio =\n    (this.minimumRadius * primeVerticalRadius) / this.maximumRadius ** 2;\n  const meridionalRadius = primeVerticalRadius * radiusRatio ** 2;\n\n  return Cartesian2.fromElements(\n    1.0 / primeVerticalRadius,\n    1.0 / meridionalRadius,\n    result\n  );\n};\n\nconst abscissas = [\n  0.14887433898163,\n  0.43339539412925,\n  0.67940956829902,\n  0.86506336668898,\n  0.97390652851717,\n  0.0,\n];\nconst weights = [\n  0.29552422471475,\n  0.26926671930999,\n  0.21908636251598,\n  0.14945134915058,\n  0.066671344308684,\n  0.0,\n];\n\n/**\n * Compute the 10th order Gauss-Legendre Quadrature of the given definite integral.\n *\n * @param {number} a The lower bound for the integration.\n * @param {number} b The upper bound for the integration.\n * @param {Ellipsoid~RealValuedScalarFunction} func The function to integrate.\n * @returns {number} The value of the integral of the given function over the given domain.\n *\n * @private\n */\nfunction gaussLegendreQuadrature(a, b, func) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"a\", a);\n  Check.typeOf.number(\"b\", b);\n  Check.typeOf.func(\"func\", func);\n  //>>includeEnd('debug');\n\n  // The range is half of the normal range since the five weights add to one (ten weights add to two).\n  // The values of the abscissas are multiplied by two to account for this.\n  const xMean = 0.5 * (b + a);\n  const xRange = 0.5 * (b - a);\n\n  let sum = 0.0;\n  for (let i = 0; i < 5; i++) {\n    const dx = xRange * abscissas[i];\n    sum += weights[i] * (func(xMean + dx) + func(xMean - dx));\n  }\n\n  // Scale the sum to the range of x.\n  sum *= xRange;\n  return sum;\n}\n\n/**\n * A real valued scalar function.\n * @callback Ellipsoid~RealValuedScalarFunction\n *\n * @param {number} x The value used to evaluate the function.\n * @returns {number} The value of the function at x.\n *\n * @private\n */\n\n/**\n * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using\n * Gauss-Legendre 10th order quadrature.\n *\n * @param {Rectangle} rectangle The rectangle used for computing the surface area.\n * @returns {number} The approximate area of the rectangle on the surface of this ellipsoid.\n */\nEllipsoid.prototype.surfaceArea = function (rectangle) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  //>>includeEnd('debug');\n  const minLongitude = rectangle.west;\n  let maxLongitude = rectangle.east;\n  const minLatitude = rectangle.south;\n  const maxLatitude = rectangle.north;\n\n  while (maxLongitude < minLongitude) {\n    maxLongitude += CesiumMath.TWO_PI;\n  }\n\n  const radiiSquared = this._radiiSquared;\n  const a2 = radiiSquared.x;\n  const b2 = radiiSquared.y;\n  const c2 = radiiSquared.z;\n  const a2b2 = a2 * b2;\n  return gaussLegendreQuadrature(minLatitude, maxLatitude, function (lat) {\n    // phi represents the angle measured from the north pole\n    // sin(phi) = sin(pi / 2 - lat) = cos(lat), cos(phi) is similar\n    const sinPhi = Math.cos(lat);\n    const cosPhi = Math.sin(lat);\n    return (\n      Math.cos(lat) *\n      gaussLegendreQuadrature(minLongitude, maxLongitude, function (lon) {\n        const cosTheta = Math.cos(lon);\n        const sinTheta = Math.sin(lon);\n        return Math.sqrt(\n          a2b2 * cosPhi * cosPhi +\n            c2 *\n              (b2 * cosTheta * cosTheta + a2 * sinTheta * sinTheta) *\n              sinPhi *\n              sinPhi\n        );\n      })\n    );\n  });\n};\n\nexport default Ellipsoid;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\n\n/**\n * A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying\n * them by the {@link Ellipsoid#maximumRadius}.  This projection\n * is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carr\u00E9e.  It\n * is also known as EPSG:4326.\n *\n * @alias GeographicProjection\n * @constructor\n *\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid.\n *\n * @see WebMercatorProjection\n */\nfunction GeographicProjection(ellipsoid) {\n  this._ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n  this._semimajorAxis = this._ellipsoid.maximumRadius;\n  this._oneOverSemimajorAxis = 1.0 / this._semimajorAxis;\n}\n\nObject.defineProperties(GeographicProjection.prototype, {\n  /**\n   * Gets the {@link Ellipsoid}.\n   *\n   * @memberof GeographicProjection.prototype\n   *\n   * @type {Ellipsoid}\n   * @readonly\n   */\n  ellipsoid: {\n    get: function () {\n      return this._ellipsoid;\n    },\n  },\n});\n\n/**\n * Projects a set of {@link Cartographic} coordinates, in radians, to map coordinates, in meters.\n * X and Y are the longitude and latitude, respectively, multiplied by the maximum radius of the\n * ellipsoid.  Z is the unmodified height.\n *\n * @param {Cartographic} cartographic The coordinates to project.\n * @param {Cartesian3} [result] An instance into which to copy the result.  If this parameter is\n *        undefined, a new instance is created and returned.\n * @returns {Cartesian3} The projected coordinates.  If the result parameter is not undefined, the\n *          coordinates are copied there and that instance is returned.  Otherwise, a new instance is\n *          created and returned.\n */\nGeographicProjection.prototype.project = function (cartographic, result) {\n  // Actually this is the special case of equidistant cylindrical called the plate carree\n  const semimajorAxis = this._semimajorAxis;\n  const x = cartographic.longitude * semimajorAxis;\n  const y = cartographic.latitude * semimajorAxis;\n  const z = cartographic.height;\n\n  if (!defined(result)) {\n    return new Cartesian3(x, y, z);\n  }\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  return result;\n};\n\n/**\n * Unprojects a set of projected {@link Cartesian3} coordinates, in meters, to {@link Cartographic}\n * coordinates, in radians.  Longitude and Latitude are the X and Y coordinates, respectively,\n * divided by the maximum radius of the ellipsoid.  Height is the unmodified Z coordinate.\n *\n * @param {Cartesian3} cartesian The Cartesian position to unproject with height (z) in meters.\n * @param {Cartographic} [result] An instance into which to copy the result.  If this parameter is\n *        undefined, a new instance is created and returned.\n * @returns {Cartographic} The unprojected coordinates.  If the result parameter is not undefined, the\n *          coordinates are copied there and that instance is returned.  Otherwise, a new instance is\n *          created and returned.\n */\nGeographicProjection.prototype.unproject = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(cartesian)) {\n    throw new DeveloperError(\"cartesian is required\");\n  }\n  //>>includeEnd('debug');\n\n  const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;\n  const longitude = cartesian.x * oneOverEarthSemimajorAxis;\n  const latitude = cartesian.y * oneOverEarthSemimajorAxis;\n  const height = cartesian.z;\n\n  if (!defined(result)) {\n    return new Cartographic(longitude, latitude, height);\n  }\n\n  result.longitude = longitude;\n  result.latitude = latitude;\n  result.height = height;\n  return result;\n};\nexport default GeographicProjection;\n", "/**\n * This enumerated type is used in determining where, relative to the frustum, an\n * object is located. The object can either be fully contained within the frustum (INSIDE),\n * partially inside the frustum and partially outside (INTERSECTING), or somewhere entirely\n * outside of the frustum's 6 planes (OUTSIDE).\n *\n * @enum {number}\n */\nconst Intersect = {\n  /**\n   * Represents that an object is not contained within the frustum.\n   *\n   * @type {number}\n   * @constant\n   */\n  OUTSIDE: -1,\n\n  /**\n   * Represents that an object intersects one of the frustum's planes.\n   *\n   * @type {number}\n   * @constant\n   */\n  INTERSECTING: 0,\n\n  /**\n   * Represents that an object is fully within the frustum.\n   *\n   * @type {number}\n   * @constant\n   */\n  INSIDE: 1,\n};\nexport default Object.freeze(Intersect);\n", "import Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A two dimensional region specified as longitude and latitude coordinates.\n *\n * @alias Rectangle\n * @constructor\n *\n * @param {number} [west=0.0] The westernmost longitude, in radians, in the range [-Pi, Pi].\n * @param {number} [south=0.0] The southernmost latitude, in radians, in the range [-Pi/2, Pi/2].\n * @param {number} [east=0.0] The easternmost longitude, in radians, in the range [-Pi, Pi].\n * @param {number} [north=0.0] The northernmost latitude, in radians, in the range [-Pi/2, Pi/2].\n *\n * @see Packable\n */\nfunction Rectangle(west, south, east, north) {\n  /**\n   * The westernmost longitude in radians in the range [-Pi, Pi].\n   *\n   * @type {number}\n   * @default 0.0\n   */\n  this.west = defaultValue(west, 0.0);\n\n  /**\n   * The southernmost latitude in radians in the range [-Pi/2, Pi/2].\n   *\n   * @type {number}\n   * @default 0.0\n   */\n  this.south = defaultValue(south, 0.0);\n\n  /**\n   * The easternmost longitude in radians in the range [-Pi, Pi].\n   *\n   * @type {number}\n   * @default 0.0\n   */\n  this.east = defaultValue(east, 0.0);\n\n  /**\n   * The northernmost latitude in radians in the range [-Pi/2, Pi/2].\n   *\n   * @type {number}\n   * @default 0.0\n   */\n  this.north = defaultValue(north, 0.0);\n}\n\nObject.defineProperties(Rectangle.prototype, {\n  /**\n   * Gets the width of the rectangle in radians.\n   * @memberof Rectangle.prototype\n   * @type {number}\n   * @readonly\n   */\n  width: {\n    get: function () {\n      return Rectangle.computeWidth(this);\n    },\n  },\n\n  /**\n   * Gets the height of the rectangle in radians.\n   * @memberof Rectangle.prototype\n   * @type {number}\n   * @readonly\n   */\n  height: {\n    get: function () {\n      return Rectangle.computeHeight(this);\n    },\n  },\n});\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nRectangle.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Rectangle} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nRectangle.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  array[startingIndex++] = value.west;\n  array[startingIndex++] = value.south;\n  array[startingIndex++] = value.east;\n  array[startingIndex] = value.north;\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Rectangle} [result] The object into which to store the result.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided.\n */\nRectangle.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new Rectangle();\n  }\n\n  result.west = array[startingIndex++];\n  result.south = array[startingIndex++];\n  result.east = array[startingIndex++];\n  result.north = array[startingIndex];\n  return result;\n};\n\n/**\n * Computes the width of a rectangle in radians.\n * @param {Rectangle} rectangle The rectangle to compute the width of.\n * @returns {number} The width.\n */\nRectangle.computeWidth = function (rectangle) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  //>>includeEnd('debug');\n  let east = rectangle.east;\n  const west = rectangle.west;\n  if (east < west) {\n    east += CesiumMath.TWO_PI;\n  }\n  return east - west;\n};\n\n/**\n * Computes the height of a rectangle in radians.\n * @param {Rectangle} rectangle The rectangle to compute the height of.\n * @returns {number} The height.\n */\nRectangle.computeHeight = function (rectangle) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  //>>includeEnd('debug');\n  return rectangle.north - rectangle.south;\n};\n\n/**\n * Creates a rectangle given the boundary longitude and latitude in degrees.\n *\n * @param {number} [west=0.0] The westernmost longitude in degrees in the range [-180.0, 180.0].\n * @param {number} [south=0.0] The southernmost latitude in degrees in the range [-90.0, 90.0].\n * @param {number} [east=0.0] The easternmost longitude in degrees in the range [-180.0, 180.0].\n * @param {number} [north=0.0] The northernmost latitude in degrees in the range [-90.0, 90.0].\n * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\n *\n * @example\n * const rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);\n */\nRectangle.fromDegrees = function (west, south, east, north, result) {\n  west = CesiumMath.toRadians(defaultValue(west, 0.0));\n  south = CesiumMath.toRadians(defaultValue(south, 0.0));\n  east = CesiumMath.toRadians(defaultValue(east, 0.0));\n  north = CesiumMath.toRadians(defaultValue(north, 0.0));\n\n  if (!defined(result)) {\n    return new Rectangle(west, south, east, north);\n  }\n\n  result.west = west;\n  result.south = south;\n  result.east = east;\n  result.north = north;\n\n  return result;\n};\n\n/**\n * Creates a rectangle given the boundary longitude and latitude in radians.\n *\n * @param {number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI].\n * @param {number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].\n * @param {number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI].\n * @param {number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].\n * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\n *\n * @example\n * const rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4);\n */\nRectangle.fromRadians = function (west, south, east, north, result) {\n  if (!defined(result)) {\n    return new Rectangle(west, south, east, north);\n  }\n\n  result.west = defaultValue(west, 0.0);\n  result.south = defaultValue(south, 0.0);\n  result.east = defaultValue(east, 0.0);\n  result.north = defaultValue(north, 0.0);\n\n  return result;\n};\n\n/**\n * Creates the smallest possible Rectangle that encloses all positions in the provided array.\n *\n * @param {Cartographic[]} cartographics The list of Cartographic instances.\n * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\n */\nRectangle.fromCartographicArray = function (cartographics, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartographics\", cartographics);\n  //>>includeEnd('debug');\n\n  let west = Number.MAX_VALUE;\n  let east = -Number.MAX_VALUE;\n  let westOverIDL = Number.MAX_VALUE;\n  let eastOverIDL = -Number.MAX_VALUE;\n  let south = Number.MAX_VALUE;\n  let north = -Number.MAX_VALUE;\n\n  for (let i = 0, len = cartographics.length; i < len; i++) {\n    const position = cartographics[i];\n    west = Math.min(west, position.longitude);\n    east = Math.max(east, position.longitude);\n    south = Math.min(south, position.latitude);\n    north = Math.max(north, position.latitude);\n\n    const lonAdjusted =\n      position.longitude >= 0\n        ? position.longitude\n        : position.longitude + CesiumMath.TWO_PI;\n    westOverIDL = Math.min(westOverIDL, lonAdjusted);\n    eastOverIDL = Math.max(eastOverIDL, lonAdjusted);\n  }\n\n  if (east - west > eastOverIDL - westOverIDL) {\n    west = westOverIDL;\n    east = eastOverIDL;\n\n    if (east > CesiumMath.PI) {\n      east = east - CesiumMath.TWO_PI;\n    }\n    if (west > CesiumMath.PI) {\n      west = west - CesiumMath.TWO_PI;\n    }\n  }\n\n  if (!defined(result)) {\n    return new Rectangle(west, south, east, north);\n  }\n\n  result.west = west;\n  result.south = south;\n  result.east = east;\n  result.north = north;\n  return result;\n};\n\n/**\n * Creates the smallest possible Rectangle that encloses all positions in the provided array.\n *\n * @param {Cartesian3[]} cartesians The list of Cartesian instances.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid the cartesians are on.\n * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\n */\nRectangle.fromCartesianArray = function (cartesians, ellipsoid, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartesians\", cartesians);\n  //>>includeEnd('debug');\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n  let west = Number.MAX_VALUE;\n  let east = -Number.MAX_VALUE;\n  let westOverIDL = Number.MAX_VALUE;\n  let eastOverIDL = -Number.MAX_VALUE;\n  let south = Number.MAX_VALUE;\n  let north = -Number.MAX_VALUE;\n\n  for (let i = 0, len = cartesians.length; i < len; i++) {\n    const position = ellipsoid.cartesianToCartographic(cartesians[i]);\n    west = Math.min(west, position.longitude);\n    east = Math.max(east, position.longitude);\n    south = Math.min(south, position.latitude);\n    north = Math.max(north, position.latitude);\n\n    const lonAdjusted =\n      position.longitude >= 0\n        ? position.longitude\n        : position.longitude + CesiumMath.TWO_PI;\n    westOverIDL = Math.min(westOverIDL, lonAdjusted);\n    eastOverIDL = Math.max(eastOverIDL, lonAdjusted);\n  }\n\n  if (east - west > eastOverIDL - westOverIDL) {\n    west = westOverIDL;\n    east = eastOverIDL;\n\n    if (east > CesiumMath.PI) {\n      east = east - CesiumMath.TWO_PI;\n    }\n    if (west > CesiumMath.PI) {\n      west = west - CesiumMath.TWO_PI;\n    }\n  }\n\n  if (!defined(result)) {\n    return new Rectangle(west, south, east, north);\n  }\n\n  result.west = west;\n  result.south = south;\n  result.east = east;\n  result.north = north;\n  return result;\n};\n\n/**\n * Duplicates a Rectangle.\n *\n * @param {Rectangle} rectangle The rectangle to clone.\n * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. (Returns undefined if rectangle is undefined)\n */\nRectangle.clone = function (rectangle, result) {\n  if (!defined(rectangle)) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    return new Rectangle(\n      rectangle.west,\n      rectangle.south,\n      rectangle.east,\n      rectangle.north\n    );\n  }\n\n  result.west = rectangle.west;\n  result.south = rectangle.south;\n  result.east = rectangle.east;\n  result.north = rectangle.north;\n  return result;\n};\n\n/**\n * Compares the provided Rectangles componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {Rectangle} [left] The first Rectangle.\n * @param {Rectangle} [right] The second Rectangle.\n * @param {number} [absoluteEpsilon=0] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nRectangle.equalsEpsilon = function (left, right, absoluteEpsilon) {\n  absoluteEpsilon = defaultValue(absoluteEpsilon, 0);\n\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      Math.abs(left.west - right.west) <= absoluteEpsilon &&\n      Math.abs(left.south - right.south) <= absoluteEpsilon &&\n      Math.abs(left.east - right.east) <= absoluteEpsilon &&\n      Math.abs(left.north - right.north) <= absoluteEpsilon)\n  );\n};\n\n/**\n * Duplicates this Rectangle.\n *\n * @param {Rectangle} [result] The object onto which to store the result.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\n */\nRectangle.prototype.clone = function (result) {\n  return Rectangle.clone(this, result);\n};\n\n/**\n * Compares the provided Rectangle with this Rectangle componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Rectangle} [other] The Rectangle to compare.\n * @returns {boolean} <code>true</code> if the Rectangles are equal, <code>false</code> otherwise.\n */\nRectangle.prototype.equals = function (other) {\n  return Rectangle.equals(this, other);\n};\n\n/**\n * Compares the provided rectangles and returns <code>true</code> if they are equal,\n * <code>false</code> otherwise.\n *\n * @param {Rectangle} [left] The first Rectangle.\n * @param {Rectangle} [right] The second Rectangle.\n * @returns {boolean} <code>true</code> if left and right are equal; otherwise <code>false</code>.\n */\nRectangle.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left.west === right.west &&\n      left.south === right.south &&\n      left.east === right.east &&\n      left.north === right.north)\n  );\n};\n\n/**\n * Compares the provided Rectangle with this Rectangle componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Rectangle} [other] The Rectangle to compare.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise.\n */\nRectangle.prototype.equalsEpsilon = function (other, epsilon) {\n  return Rectangle.equalsEpsilon(this, other, epsilon);\n};\n\n/**\n * Checks a Rectangle's properties and throws if they are not in valid ranges.\n *\n * @param {Rectangle} rectangle The rectangle to validate\n *\n * @exception {DeveloperError} <code>north</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].\n * @exception {DeveloperError} <code>south</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].\n * @exception {DeveloperError} <code>east</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].\n * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].\n */\nRectangle.validate = function (rectangle) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n\n  const north = rectangle.north;\n  Check.typeOf.number.greaterThanOrEquals(\n    \"north\",\n    north,\n    -CesiumMath.PI_OVER_TWO\n  );\n  Check.typeOf.number.lessThanOrEquals(\"north\", north, CesiumMath.PI_OVER_TWO);\n\n  const south = rectangle.south;\n  Check.typeOf.number.greaterThanOrEquals(\n    \"south\",\n    south,\n    -CesiumMath.PI_OVER_TWO\n  );\n  Check.typeOf.number.lessThanOrEquals(\"south\", south, CesiumMath.PI_OVER_TWO);\n\n  const west = rectangle.west;\n  Check.typeOf.number.greaterThanOrEquals(\"west\", west, -Math.PI);\n  Check.typeOf.number.lessThanOrEquals(\"west\", west, Math.PI);\n\n  const east = rectangle.east;\n  Check.typeOf.number.greaterThanOrEquals(\"east\", east, -Math.PI);\n  Check.typeOf.number.lessThanOrEquals(\"east\", east, Math.PI);\n  //>>includeEnd('debug');\n};\n\n/**\n * Computes the southwest corner of a rectangle.\n *\n * @param {Rectangle} rectangle The rectangle for which to find the corner\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.\n */\nRectangle.southwest = function (rectangle, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Cartographic(rectangle.west, rectangle.south);\n  }\n  result.longitude = rectangle.west;\n  result.latitude = rectangle.south;\n  result.height = 0.0;\n  return result;\n};\n\n/**\n * Computes the northwest corner of a rectangle.\n *\n * @param {Rectangle} rectangle The rectangle for which to find the corner\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.\n */\nRectangle.northwest = function (rectangle, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Cartographic(rectangle.west, rectangle.north);\n  }\n  result.longitude = rectangle.west;\n  result.latitude = rectangle.north;\n  result.height = 0.0;\n  return result;\n};\n\n/**\n * Computes the northeast corner of a rectangle.\n *\n * @param {Rectangle} rectangle The rectangle for which to find the corner\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.\n */\nRectangle.northeast = function (rectangle, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Cartographic(rectangle.east, rectangle.north);\n  }\n  result.longitude = rectangle.east;\n  result.latitude = rectangle.north;\n  result.height = 0.0;\n  return result;\n};\n\n/**\n * Computes the southeast corner of a rectangle.\n *\n * @param {Rectangle} rectangle The rectangle for which to find the corner\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.\n */\nRectangle.southeast = function (rectangle, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Cartographic(rectangle.east, rectangle.south);\n  }\n  result.longitude = rectangle.east;\n  result.latitude = rectangle.south;\n  result.height = 0.0;\n  return result;\n};\n\n/**\n * Computes the center of a rectangle.\n *\n * @param {Rectangle} rectangle The rectangle for which to find the center\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.\n */\nRectangle.center = function (rectangle, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  //>>includeEnd('debug');\n\n  let east = rectangle.east;\n  const west = rectangle.west;\n\n  if (east < west) {\n    east += CesiumMath.TWO_PI;\n  }\n\n  const longitude = CesiumMath.negativePiToPi((west + east) * 0.5);\n  const latitude = (rectangle.south + rectangle.north) * 0.5;\n\n  if (!defined(result)) {\n    return new Cartographic(longitude, latitude);\n  }\n\n  result.longitude = longitude;\n  result.latitude = latitude;\n  result.height = 0.0;\n  return result;\n};\n\n/**\n * Computes the intersection of two rectangles.  This function assumes that the rectangle's coordinates are\n * latitude and longitude in radians and produces a correct intersection, taking into account the fact that\n * the same angle can be represented with multiple values as well as the wrapping of longitude at the\n * anti-meridian.  For a simple intersection that ignores these factors and can be used with projected\n * coordinates, see {@link Rectangle.simpleIntersection}.\n *\n * @param {Rectangle} rectangle On rectangle to find an intersection\n * @param {Rectangle} otherRectangle Another rectangle to find an intersection\n * @param {Rectangle} [result] The object onto which to store the result.\n * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.\n */\nRectangle.intersection = function (rectangle, otherRectangle, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  Check.typeOf.object(\"otherRectangle\", otherRectangle);\n  //>>includeEnd('debug');\n\n  let rectangleEast = rectangle.east;\n  let rectangleWest = rectangle.west;\n\n  let otherRectangleEast = otherRectangle.east;\n  let otherRectangleWest = otherRectangle.west;\n\n  if (rectangleEast < rectangleWest && otherRectangleEast > 0.0) {\n    rectangleEast += CesiumMath.TWO_PI;\n  } else if (otherRectangleEast < otherRectangleWest && rectangleEast > 0.0) {\n    otherRectangleEast += CesiumMath.TWO_PI;\n  }\n\n  if (rectangleEast < rectangleWest && otherRectangleWest < 0.0) {\n    otherRectangleWest += CesiumMath.TWO_PI;\n  } else if (otherRectangleEast < otherRectangleWest && rectangleWest < 0.0) {\n    rectangleWest += CesiumMath.TWO_PI;\n  }\n\n  const west = CesiumMath.negativePiToPi(\n    Math.max(rectangleWest, otherRectangleWest)\n  );\n  const east = CesiumMath.negativePiToPi(\n    Math.min(rectangleEast, otherRectangleEast)\n  );\n\n  if (\n    (rectangle.west < rectangle.east ||\n      otherRectangle.west < otherRectangle.east) &&\n    east <= west\n  ) {\n    return undefined;\n  }\n\n  const south = Math.max(rectangle.south, otherRectangle.south);\n  const north = Math.min(rectangle.north, otherRectangle.north);\n\n  if (south >= north) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    return new Rectangle(west, south, east, north);\n  }\n  result.west = west;\n  result.south = south;\n  result.east = east;\n  result.north = north;\n  return result;\n};\n\n/**\n * Computes a simple intersection of two rectangles.  Unlike {@link Rectangle.intersection}, this function\n * does not attempt to put the angular coordinates into a consistent range or to account for crossing the\n * anti-meridian.  As such, it can be used for rectangles where the coordinates are not simply latitude\n * and longitude (i.e. projected coordinates).\n *\n * @param {Rectangle} rectangle On rectangle to find an intersection\n * @param {Rectangle} otherRectangle Another rectangle to find an intersection\n * @param {Rectangle} [result] The object onto which to store the result.\n * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.\n */\nRectangle.simpleIntersection = function (rectangle, otherRectangle, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  Check.typeOf.object(\"otherRectangle\", otherRectangle);\n  //>>includeEnd('debug');\n\n  const west = Math.max(rectangle.west, otherRectangle.west);\n  const south = Math.max(rectangle.south, otherRectangle.south);\n  const east = Math.min(rectangle.east, otherRectangle.east);\n  const north = Math.min(rectangle.north, otherRectangle.north);\n\n  if (south >= north || west >= east) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    return new Rectangle(west, south, east, north);\n  }\n\n  result.west = west;\n  result.south = south;\n  result.east = east;\n  result.north = north;\n  return result;\n};\n\n/**\n * Computes a rectangle that is the union of two rectangles.\n *\n * @param {Rectangle} rectangle A rectangle to enclose in rectangle.\n * @param {Rectangle} otherRectangle A rectangle to enclose in a rectangle.\n * @param {Rectangle} [result] The object onto which to store the result.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\n */\nRectangle.union = function (rectangle, otherRectangle, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  Check.typeOf.object(\"otherRectangle\", otherRectangle);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Rectangle();\n  }\n\n  let rectangleEast = rectangle.east;\n  let rectangleWest = rectangle.west;\n\n  let otherRectangleEast = otherRectangle.east;\n  let otherRectangleWest = otherRectangle.west;\n\n  if (rectangleEast < rectangleWest && otherRectangleEast > 0.0) {\n    rectangleEast += CesiumMath.TWO_PI;\n  } else if (otherRectangleEast < otherRectangleWest && rectangleEast > 0.0) {\n    otherRectangleEast += CesiumMath.TWO_PI;\n  }\n\n  if (rectangleEast < rectangleWest && otherRectangleWest < 0.0) {\n    otherRectangleWest += CesiumMath.TWO_PI;\n  } else if (otherRectangleEast < otherRectangleWest && rectangleWest < 0.0) {\n    rectangleWest += CesiumMath.TWO_PI;\n  }\n\n  const west = CesiumMath.negativePiToPi(\n    Math.min(rectangleWest, otherRectangleWest)\n  );\n  const east = CesiumMath.negativePiToPi(\n    Math.max(rectangleEast, otherRectangleEast)\n  );\n\n  result.west = west;\n  result.south = Math.min(rectangle.south, otherRectangle.south);\n  result.east = east;\n  result.north = Math.max(rectangle.north, otherRectangle.north);\n\n  return result;\n};\n\n/**\n * Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic.\n *\n * @param {Rectangle} rectangle A rectangle to expand.\n * @param {Cartographic} cartographic A cartographic to enclose in a rectangle.\n * @param {Rectangle} [result] The object onto which to store the result.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided.\n */\nRectangle.expand = function (rectangle, cartographic, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  Check.typeOf.object(\"cartographic\", cartographic);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Rectangle();\n  }\n\n  result.west = Math.min(rectangle.west, cartographic.longitude);\n  result.south = Math.min(rectangle.south, cartographic.latitude);\n  result.east = Math.max(rectangle.east, cartographic.longitude);\n  result.north = Math.max(rectangle.north, cartographic.latitude);\n\n  return result;\n};\n\n/**\n * Returns true if the cartographic is on or inside the rectangle, false otherwise.\n *\n * @param {Rectangle} rectangle The rectangle\n * @param {Cartographic} cartographic The cartographic to test.\n * @returns {boolean} true if the provided cartographic is inside the rectangle, false otherwise.\n */\nRectangle.contains = function (rectangle, cartographic) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  Check.typeOf.object(\"cartographic\", cartographic);\n  //>>includeEnd('debug');\n\n  let longitude = cartographic.longitude;\n  const latitude = cartographic.latitude;\n\n  const west = rectangle.west;\n  let east = rectangle.east;\n\n  if (east < west) {\n    east += CesiumMath.TWO_PI;\n    if (longitude < 0.0) {\n      longitude += CesiumMath.TWO_PI;\n    }\n  }\n  return (\n    (longitude > west ||\n      CesiumMath.equalsEpsilon(longitude, west, CesiumMath.EPSILON14)) &&\n    (longitude < east ||\n      CesiumMath.equalsEpsilon(longitude, east, CesiumMath.EPSILON14)) &&\n    latitude >= rectangle.south &&\n    latitude <= rectangle.north\n  );\n};\n\nconst subsampleLlaScratch = new Cartographic();\n/**\n * Samples a rectangle so that it includes a list of Cartesian points suitable for passing to\n * {@link BoundingSphere#fromPoints}.  Sampling is necessary to account\n * for rectangles that cover the poles or cross the equator.\n *\n * @param {Rectangle} rectangle The rectangle to subsample.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.\n * @param {number} [surfaceHeight=0.0] The height of the rectangle above the ellipsoid.\n * @param {Cartesian3[]} [result] The array of Cartesians onto which to store the result.\n * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided.\n */\nRectangle.subsample = function (rectangle, ellipsoid, surfaceHeight, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  //>>includeEnd('debug');\n\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n  surfaceHeight = defaultValue(surfaceHeight, 0.0);\n\n  if (!defined(result)) {\n    result = [];\n  }\n  let length = 0;\n\n  const north = rectangle.north;\n  const south = rectangle.south;\n  const east = rectangle.east;\n  const west = rectangle.west;\n\n  const lla = subsampleLlaScratch;\n  lla.height = surfaceHeight;\n\n  lla.longitude = west;\n  lla.latitude = north;\n  result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\n  length++;\n\n  lla.longitude = east;\n  result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\n  length++;\n\n  lla.latitude = south;\n  result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\n  length++;\n\n  lla.longitude = west;\n  result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\n  length++;\n\n  if (north < 0.0) {\n    lla.latitude = north;\n  } else if (south > 0.0) {\n    lla.latitude = south;\n  } else {\n    lla.latitude = 0.0;\n  }\n\n  for (let i = 1; i < 8; ++i) {\n    lla.longitude = -Math.PI + i * CesiumMath.PI_OVER_TWO;\n    if (Rectangle.contains(rectangle, lla)) {\n      result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\n      length++;\n    }\n  }\n\n  if (lla.latitude === 0.0) {\n    lla.longitude = west;\n    result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\n    length++;\n    lla.longitude = east;\n    result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\n    length++;\n  }\n  result.length = length;\n  return result;\n};\n\n/**\n * Computes a subsection of a rectangle from normalized coordinates in the range [0.0, 1.0].\n *\n * @param {Rectangle} rectangle The rectangle to subsection.\n * @param {number} westLerp The west interpolation factor in the range [0.0, 1.0]. Must be less than or equal to eastLerp.\n * @param {number} southLerp The south interpolation factor in the range [0.0, 1.0]. Must be less than or equal to northLerp.\n * @param {number} eastLerp The east interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to westLerp.\n * @param {number} northLerp The north interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to southLerp.\n * @param {Rectangle} [result] The object onto which to store the result.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\n */\nRectangle.subsection = function (\n  rectangle,\n  westLerp,\n  southLerp,\n  eastLerp,\n  northLerp,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  Check.typeOf.number.greaterThanOrEquals(\"westLerp\", westLerp, 0.0);\n  Check.typeOf.number.lessThanOrEquals(\"westLerp\", westLerp, 1.0);\n  Check.typeOf.number.greaterThanOrEquals(\"southLerp\", southLerp, 0.0);\n  Check.typeOf.number.lessThanOrEquals(\"southLerp\", southLerp, 1.0);\n  Check.typeOf.number.greaterThanOrEquals(\"eastLerp\", eastLerp, 0.0);\n  Check.typeOf.number.lessThanOrEquals(\"eastLerp\", eastLerp, 1.0);\n  Check.typeOf.number.greaterThanOrEquals(\"northLerp\", northLerp, 0.0);\n  Check.typeOf.number.lessThanOrEquals(\"northLerp\", northLerp, 1.0);\n\n  Check.typeOf.number.lessThanOrEquals(\"westLerp\", westLerp, eastLerp);\n  Check.typeOf.number.lessThanOrEquals(\"southLerp\", southLerp, northLerp);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Rectangle();\n  }\n\n  // This function doesn't use CesiumMath.lerp because it has floating point precision problems\n  // when the start and end values are the same but the t changes.\n\n  if (rectangle.west <= rectangle.east) {\n    const width = rectangle.east - rectangle.west;\n    result.west = rectangle.west + westLerp * width;\n    result.east = rectangle.west + eastLerp * width;\n  } else {\n    const width = CesiumMath.TWO_PI + rectangle.east - rectangle.west;\n    result.west = CesiumMath.negativePiToPi(rectangle.west + westLerp * width);\n    result.east = CesiumMath.negativePiToPi(rectangle.west + eastLerp * width);\n  }\n  const height = rectangle.north - rectangle.south;\n  result.south = rectangle.south + southLerp * height;\n  result.north = rectangle.south + northLerp * height;\n\n  // Fix floating point precision problems when t = 1\n  if (westLerp === 1.0) {\n    result.west = rectangle.east;\n  }\n  if (eastLerp === 1.0) {\n    result.east = rectangle.east;\n  }\n  if (southLerp === 1.0) {\n    result.south = rectangle.north;\n  }\n  if (northLerp === 1.0) {\n    result.north = rectangle.north;\n  }\n\n  return result;\n};\n\n/**\n * The largest possible rectangle.\n *\n * @type {Rectangle}\n * @constant\n */\nRectangle.MAX_VALUE = Object.freeze(\n  new Rectangle(\n    -Math.PI,\n    -CesiumMath.PI_OVER_TWO,\n    Math.PI,\n    CesiumMath.PI_OVER_TWO\n  )\n);\nexport default Rectangle;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport Intersect from \"./Intersect.js\";\nimport Rectangle from \"./Rectangle.js\";\n\n/**\n * A bounding rectangle given by a corner, width and height.\n * @alias BoundingRectangle\n * @constructor\n *\n * @param {number} [x=0.0] The x coordinate of the rectangle.\n * @param {number} [y=0.0] The y coordinate of the rectangle.\n * @param {number} [width=0.0] The width of the rectangle.\n * @param {number} [height=0.0] The height of the rectangle.\n *\n * @see BoundingSphere\n * @see Packable\n */\nfunction BoundingRectangle(x, y, width, height) {\n  /**\n   * The x coordinate of the rectangle.\n   * @type {number}\n   * @default 0.0\n   */\n  this.x = defaultValue(x, 0.0);\n\n  /**\n   * The y coordinate of the rectangle.\n   * @type {number}\n   * @default 0.0\n   */\n  this.y = defaultValue(y, 0.0);\n\n  /**\n   * The width of the rectangle.\n   * @type {number}\n   * @default 0.0\n   */\n  this.width = defaultValue(width, 0.0);\n\n  /**\n   * The height of the rectangle.\n   * @type {number}\n   * @default 0.0\n   */\n  this.height = defaultValue(height, 0.0);\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nBoundingRectangle.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {BoundingRectangle} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nBoundingRectangle.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  array[startingIndex++] = value.x;\n  array[startingIndex++] = value.y;\n  array[startingIndex++] = value.width;\n  array[startingIndex] = value.height;\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {BoundingRectangle} [result] The object into which to store the result.\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\n */\nBoundingRectangle.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new BoundingRectangle();\n  }\n  result.x = array[startingIndex++];\n  result.y = array[startingIndex++];\n  result.width = array[startingIndex++];\n  result.height = array[startingIndex];\n  return result;\n};\n\n/**\n * Computes a bounding rectangle enclosing the list of 2D points.\n * The rectangle is oriented with the corner at the bottom left.\n *\n * @param {Cartesian2[]} positions List of points that the bounding rectangle will enclose.  Each point must have <code>x</code> and <code>y</code> properties.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\n */\nBoundingRectangle.fromPoints = function (positions, result) {\n  if (!defined(result)) {\n    result = new BoundingRectangle();\n  }\n\n  if (!defined(positions) || positions.length === 0) {\n    result.x = 0;\n    result.y = 0;\n    result.width = 0;\n    result.height = 0;\n    return result;\n  }\n\n  const length = positions.length;\n\n  let minimumX = positions[0].x;\n  let minimumY = positions[0].y;\n\n  let maximumX = positions[0].x;\n  let maximumY = positions[0].y;\n\n  for (let i = 1; i < length; i++) {\n    const p = positions[i];\n    const x = p.x;\n    const y = p.y;\n\n    minimumX = Math.min(x, minimumX);\n    maximumX = Math.max(x, maximumX);\n    minimumY = Math.min(y, minimumY);\n    maximumY = Math.max(y, maximumY);\n  }\n\n  result.x = minimumX;\n  result.y = minimumY;\n  result.width = maximumX - minimumX;\n  result.height = maximumY - minimumY;\n  return result;\n};\n\nconst defaultProjection = new GeographicProjection();\nconst fromRectangleLowerLeft = new Cartographic();\nconst fromRectangleUpperRight = new Cartographic();\n/**\n * Computes a bounding rectangle from a rectangle.\n *\n * @param {Rectangle} rectangle The valid rectangle used to create a bounding rectangle.\n * @param {object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\n */\nBoundingRectangle.fromRectangle = function (rectangle, projection, result) {\n  if (!defined(result)) {\n    result = new BoundingRectangle();\n  }\n\n  if (!defined(rectangle)) {\n    result.x = 0;\n    result.y = 0;\n    result.width = 0;\n    result.height = 0;\n    return result;\n  }\n\n  projection = defaultValue(projection, defaultProjection);\n\n  const lowerLeft = projection.project(\n    Rectangle.southwest(rectangle, fromRectangleLowerLeft)\n  );\n  const upperRight = projection.project(\n    Rectangle.northeast(rectangle, fromRectangleUpperRight)\n  );\n\n  Cartesian2.subtract(upperRight, lowerLeft, upperRight);\n\n  result.x = lowerLeft.x;\n  result.y = lowerLeft.y;\n  result.width = upperRight.x;\n  result.height = upperRight.y;\n  return result;\n};\n\n/**\n * Duplicates a BoundingRectangle instance.\n *\n * @param {BoundingRectangle} rectangle The bounding rectangle to duplicate.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined)\n */\nBoundingRectangle.clone = function (rectangle, result) {\n  if (!defined(rectangle)) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    return new BoundingRectangle(\n      rectangle.x,\n      rectangle.y,\n      rectangle.width,\n      rectangle.height\n    );\n  }\n\n  result.x = rectangle.x;\n  result.y = rectangle.y;\n  result.width = rectangle.width;\n  result.height = rectangle.height;\n  return result;\n};\n\n/**\n * Computes a bounding rectangle that is the union of the left and right bounding rectangles.\n *\n * @param {BoundingRectangle} left A rectangle to enclose in bounding rectangle.\n * @param {BoundingRectangle} right A rectangle to enclose in a bounding rectangle.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\n */\nBoundingRectangle.union = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new BoundingRectangle();\n  }\n\n  const lowerLeftX = Math.min(left.x, right.x);\n  const lowerLeftY = Math.min(left.y, right.y);\n  const upperRightX = Math.max(left.x + left.width, right.x + right.width);\n  const upperRightY = Math.max(left.y + left.height, right.y + right.height);\n\n  result.x = lowerLeftX;\n  result.y = lowerLeftY;\n  result.width = upperRightX - lowerLeftX;\n  result.height = upperRightY - lowerLeftY;\n  return result;\n};\n\n/**\n * Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.\n *\n * @param {BoundingRectangle} rectangle A rectangle to expand.\n * @param {Cartesian2} point A point to enclose in a bounding rectangle.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\n */\nBoundingRectangle.expand = function (rectangle, point, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  Check.typeOf.object(\"point\", point);\n  //>>includeEnd('debug');\n\n  result = BoundingRectangle.clone(rectangle, result);\n\n  const width = point.x - result.x;\n  const height = point.y - result.y;\n\n  if (width > result.width) {\n    result.width = width;\n  } else if (width < 0) {\n    result.width -= width;\n    result.x = point.x;\n  }\n\n  if (height > result.height) {\n    result.height = height;\n  } else if (height < 0) {\n    result.height -= height;\n    result.y = point.y;\n  }\n\n  return result;\n};\n\n/**\n * Determines if two rectangles intersect.\n *\n * @param {BoundingRectangle} left A rectangle to check for intersection.\n * @param {BoundingRectangle} right The other rectangle to check for intersection.\n * @returns {Intersect} <code>Intersect.INTERSECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.\n */\nBoundingRectangle.intersect = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  const leftX = left.x;\n  const leftY = left.y;\n  const rightX = right.x;\n  const rightY = right.y;\n  if (\n    !(\n      leftX > rightX + right.width ||\n      leftX + left.width < rightX ||\n      leftY + left.height < rightY ||\n      leftY > rightY + right.height\n    )\n  ) {\n    return Intersect.INTERSECTING;\n  }\n\n  return Intersect.OUTSIDE;\n};\n\n/**\n * Compares the provided BoundingRectangles componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {BoundingRectangle} [left] The first BoundingRectangle.\n * @param {BoundingRectangle} [right] The second BoundingRectangle.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nBoundingRectangle.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left.x === right.x &&\n      left.y === right.y &&\n      left.width === right.width &&\n      left.height === right.height)\n  );\n};\n\n/**\n * Duplicates this BoundingRectangle instance.\n *\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\n */\nBoundingRectangle.prototype.clone = function (result) {\n  return BoundingRectangle.clone(this, result);\n};\n\n/**\n * Determines if this rectangle intersects with another.\n *\n * @param {BoundingRectangle} right A rectangle to check for intersection.\n * @returns {Intersect} <code>Intersect.INTERSECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.\n */\nBoundingRectangle.prototype.intersect = function (right) {\n  return BoundingRectangle.intersect(this, right);\n};\n\n/**\n * Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {BoundingRectangle} [right] The right hand side BoundingRectangle.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nBoundingRectangle.prototype.equals = function (right) {\n  return BoundingRectangle.equals(this, right);\n};\nexport default BoundingRectangle;\n", "import WebGLConstants from \"./WebGLConstants.js\";\n\n/**\n * The type of a geometric primitive, i.e., points, lines, and triangles.\n *\n * @enum {number}\n */\nconst PrimitiveType = {\n  /**\n   * Points primitive where each vertex (or index) is a separate point.\n   *\n   * @type {number}\n   * @constant\n   */\n  POINTS: WebGLConstants.POINTS,\n\n  /**\n   * Lines primitive where each two vertices (or indices) is a line segment.  Line segments are not necessarily connected.\n   *\n   * @type {number}\n   * @constant\n   */\n  LINES: WebGLConstants.LINES,\n\n  /**\n   * Line loop primitive where each vertex (or index) after the first connects a line to\n   * the previous vertex, and the last vertex implicitly connects to the first.\n   *\n   * @type {number}\n   * @constant\n   */\n  LINE_LOOP: WebGLConstants.LINE_LOOP,\n\n  /**\n   * Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex.\n   *\n   * @type {number}\n   * @constant\n   */\n  LINE_STRIP: WebGLConstants.LINE_STRIP,\n\n  /**\n   * Triangles primitive where each three vertices (or indices) is a triangle.  Triangles do not necessarily share edges.\n   *\n   * @type {number}\n   * @constant\n   */\n  TRIANGLES: WebGLConstants.TRIANGLES,\n\n  /**\n   * Triangle strip primitive where each vertex (or index) after the first two connect to\n   * the previous two vertices forming a triangle.  For example, this can be used to model a wall.\n   *\n   * @type {number}\n   * @constant\n   */\n  TRIANGLE_STRIP: WebGLConstants.TRIANGLE_STRIP,\n\n  /**\n   * Triangle fan primitive where each vertex (or index) after the first two connect to\n   * the previous vertex and the first vertex forming a triangle.  For example, this can be used\n   * to model a cone or circle.\n   *\n   * @type {number}\n   * @constant\n   */\n  TRIANGLE_FAN: WebGLConstants.TRIANGLE_FAN,\n};\n\n/**\n * @private\n */\nPrimitiveType.isLines = function (primitiveType) {\n  return (\n    primitiveType === PrimitiveType.LINES ||\n    primitiveType === PrimitiveType.LINE_LOOP ||\n    primitiveType === PrimitiveType.LINE_STRIP\n  );\n};\n\n/**\n * @private\n */\nPrimitiveType.isTriangles = function (primitiveType) {\n  return (\n    primitiveType === PrimitiveType.TRIANGLES ||\n    primitiveType === PrimitiveType.TRIANGLE_STRIP ||\n    primitiveType === PrimitiveType.TRIANGLE_FAN\n  );\n};\n\n/**\n * @private\n */\nPrimitiveType.validate = function (primitiveType) {\n  return (\n    primitiveType === PrimitiveType.POINTS ||\n    primitiveType === PrimitiveType.LINES ||\n    primitiveType === PrimitiveType.LINE_LOOP ||\n    primitiveType === PrimitiveType.LINE_STRIP ||\n    primitiveType === PrimitiveType.TRIANGLES ||\n    primitiveType === PrimitiveType.TRIANGLE_STRIP ||\n    primitiveType === PrimitiveType.TRIANGLE_FAN\n  );\n};\n\nexport default Object.freeze(PrimitiveType);\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec4 position;\\n\\\nin vec2 textureCoordinates;\\n\\\n\\n\\\nout vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main() \\n\\\n{\\n\\\n    gl_Position = position;\\n\\\n    v_textureCoordinates = textureCoordinates;\\n\\\n}\\n\\\n\";\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\n\nconst Flags = {\n  CULL: 1,\n  OCCLUDE: 2,\n  EXECUTE_IN_CLOSEST_FRUSTUM: 4,\n  DEBUG_SHOW_BOUNDING_VOLUME: 8,\n  CAST_SHADOWS: 16,\n  RECEIVE_SHADOWS: 32,\n  PICK_ONLY: 64,\n  DEPTH_FOR_TRANSLUCENT_CLASSIFICATION: 128,\n};\n\n/**\n * Represents a command to the renderer for drawing.\n *\n * @private\n */\nfunction DrawCommand(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._boundingVolume = options.boundingVolume;\n  this._orientedBoundingBox = options.orientedBoundingBox;\n  this._modelMatrix = options.modelMatrix;\n  this._primitiveType = defaultValue(\n    options.primitiveType,\n    PrimitiveType.TRIANGLES\n  );\n  this._vertexArray = options.vertexArray;\n  this._count = options.count;\n  this._offset = defaultValue(options.offset, 0);\n  this._instanceCount = defaultValue(options.instanceCount, 0);\n  this._shaderProgram = options.shaderProgram;\n  this._uniformMap = options.uniformMap;\n  this._renderState = options.renderState;\n  this._framebuffer = options.framebuffer;\n  this._pass = options.pass;\n  this._owner = options.owner;\n  this._debugOverlappingFrustums = 0;\n  this._pickId = options.pickId;\n\n  // Set initial flags.\n  this._flags = 0;\n  this.cull = defaultValue(options.cull, true);\n  this.occlude = defaultValue(options.occlude, true);\n  this.executeInClosestFrustum = defaultValue(\n    options.executeInClosestFrustum,\n    false\n  );\n  this.debugShowBoundingVolume = defaultValue(\n    options.debugShowBoundingVolume,\n    false\n  );\n  this.castShadows = defaultValue(options.castShadows, false);\n  this.receiveShadows = defaultValue(options.receiveShadows, false);\n  this.pickOnly = defaultValue(options.pickOnly, false);\n  this.depthForTranslucentClassification = defaultValue(\n    options.depthForTranslucentClassification,\n    false\n  );\n\n  this.dirty = true;\n  this.lastDirtyTime = 0;\n\n  /**\n   * @private\n   */\n  this.derivedCommands = {};\n}\n\nfunction hasFlag(command, flag) {\n  return (command._flags & flag) === flag;\n}\n\nfunction setFlag(command, flag, value) {\n  if (value) {\n    command._flags |= flag;\n  } else {\n    command._flags &= ~flag;\n  }\n}\n\nObject.defineProperties(DrawCommand.prototype, {\n  /**\n   * The bounding volume of the geometry in world space.  This is used for culling and frustum selection.\n   * <p>\n   * For best rendering performance, use the tightest possible bounding volume.  Although\n   * <code>undefined</code> is allowed, always try to provide a bounding volume to\n   * allow the tightest possible near and far planes to be computed for the scene, and\n   * minimize the number of frustums needed.\n   * </p>\n   *\n   * @memberof DrawCommand.prototype\n   * @type {object}\n   * @default undefined\n   *\n   * @see DrawCommand#debugShowBoundingVolume\n   */\n  boundingVolume: {\n    get: function () {\n      return this._boundingVolume;\n    },\n    set: function (value) {\n      if (this._boundingVolume !== value) {\n        this._boundingVolume = value;\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * The oriented bounding box of the geometry in world space. If this is defined, it is used instead of\n   * {@link DrawCommand#boundingVolume} for plane intersection testing.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {OrientedBoundingBox}\n   * @default undefined\n   *\n   * @see DrawCommand#debugShowBoundingVolume\n   */\n  orientedBoundingBox: {\n    get: function () {\n      return this._orientedBoundingBox;\n    },\n    set: function (value) {\n      if (this._orientedBoundingBox !== value) {\n        this._orientedBoundingBox = value;\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * When <code>true</code>, the renderer frustum and horizon culls the command based on its {@link DrawCommand#boundingVolume}.\n   * If the command was already culled, set this to <code>false</code> for a performance improvement.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {boolean}\n   * @default true\n   */\n  cull: {\n    get: function () {\n      return hasFlag(this, Flags.CULL);\n    },\n    set: function (value) {\n      if (hasFlag(this, Flags.CULL) !== value) {\n        setFlag(this, Flags.CULL, value);\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * When <code>true</code>, the horizon culls the command based on its {@link DrawCommand#boundingVolume}.\n   * {@link DrawCommand#cull} must also be <code>true</code> in order for the command to be culled.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {boolean}\n   * @default true\n   */\n  occlude: {\n    get: function () {\n      return hasFlag(this, Flags.OCCLUDE);\n    },\n    set: function (value) {\n      if (hasFlag(this, Flags.OCCLUDE) !== value) {\n        setFlag(this, Flags.OCCLUDE, value);\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * The transformation from the geometry in model space to world space.\n   * <p>\n   * When <code>undefined</code>, the geometry is assumed to be defined in world space.\n   * </p>\n   *\n   * @memberof DrawCommand.prototype\n   * @type {Matrix4}\n   * @default undefined\n   */\n  modelMatrix: {\n    get: function () {\n      return this._modelMatrix;\n    },\n    set: function (value) {\n      if (this._modelMatrix !== value) {\n        this._modelMatrix = value;\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * The type of geometry in the vertex array.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {PrimitiveType}\n   * @default PrimitiveType.TRIANGLES\n   */\n  primitiveType: {\n    get: function () {\n      return this._primitiveType;\n    },\n    set: function (value) {\n      if (this._primitiveType !== value) {\n        this._primitiveType = value;\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * The vertex array.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {VertexArray}\n   * @default undefined\n   */\n  vertexArray: {\n    get: function () {\n      return this._vertexArray;\n    },\n    set: function (value) {\n      if (this._vertexArray !== value) {\n        this._vertexArray = value;\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * The number of vertices to draw in the vertex array.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {number}\n   * @default undefined\n   */\n  count: {\n    get: function () {\n      return this._count;\n    },\n    set: function (value) {\n      if (this._count !== value) {\n        this._count = value;\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * The offset to start drawing in the vertex array.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {number}\n   * @default 0\n   */\n  offset: {\n    get: function () {\n      return this._offset;\n    },\n    set: function (value) {\n      if (this._offset !== value) {\n        this._offset = value;\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * The number of instances to draw.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {number}\n   * @default 0\n   */\n  instanceCount: {\n    get: function () {\n      return this._instanceCount;\n    },\n    set: function (value) {\n      if (this._instanceCount !== value) {\n        this._instanceCount = value;\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * The shader program to apply.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {ShaderProgram}\n   * @default undefined\n   */\n  shaderProgram: {\n    get: function () {\n      return this._shaderProgram;\n    },\n    set: function (value) {\n      if (this._shaderProgram !== value) {\n        this._shaderProgram = value;\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * Whether this command should cast shadows when shadowing is enabled.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {boolean}\n   * @default false\n   */\n  castShadows: {\n    get: function () {\n      return hasFlag(this, Flags.CAST_SHADOWS);\n    },\n    set: function (value) {\n      if (hasFlag(this, Flags.CAST_SHADOWS) !== value) {\n        setFlag(this, Flags.CAST_SHADOWS, value);\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * Whether this command should receive shadows when shadowing is enabled.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {boolean}\n   * @default false\n   */\n  receiveShadows: {\n    get: function () {\n      return hasFlag(this, Flags.RECEIVE_SHADOWS);\n    },\n    set: function (value) {\n      if (hasFlag(this, Flags.RECEIVE_SHADOWS) !== value) {\n        setFlag(this, Flags.RECEIVE_SHADOWS, value);\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * An object with functions whose names match the uniforms in the shader program\n   * and return values to set those uniforms.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {object}\n   * @default undefined\n   */\n  uniformMap: {\n    get: function () {\n      return this._uniformMap;\n    },\n    set: function (value) {\n      if (this._uniformMap !== value) {\n        this._uniformMap = value;\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * The render state.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {RenderState}\n   * @default undefined\n   */\n  renderState: {\n    get: function () {\n      return this._renderState;\n    },\n    set: function (value) {\n      if (this._renderState !== value) {\n        this._renderState = value;\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * The framebuffer to draw to.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {Framebuffer}\n   * @default undefined\n   */\n  framebuffer: {\n    get: function () {\n      return this._framebuffer;\n    },\n    set: function (value) {\n      if (this._framebuffer !== value) {\n        this._framebuffer = value;\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * The pass when to render.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {Pass}\n   * @default undefined\n   */\n  pass: {\n    get: function () {\n      return this._pass;\n    },\n    set: function (value) {\n      if (this._pass !== value) {\n        this._pass = value;\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * Specifies if this command is only to be executed in the frustum closest\n   * to the eye containing the bounding volume. Defaults to <code>false</code>.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {boolean}\n   * @default false\n   */\n  executeInClosestFrustum: {\n    get: function () {\n      return hasFlag(this, Flags.EXECUTE_IN_CLOSEST_FRUSTUM);\n    },\n    set: function (value) {\n      if (hasFlag(this, Flags.EXECUTE_IN_CLOSEST_FRUSTUM) !== value) {\n        setFlag(this, Flags.EXECUTE_IN_CLOSEST_FRUSTUM, value);\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * The object who created this command.  This is useful for debugging command\n   * execution; it allows us to see who created a command when we only have a\n   * reference to the command, and can be used to selectively execute commands\n   * with {@link Scene#debugCommandFilter}.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {object}\n   * @default undefined\n   *\n   * @see Scene#debugCommandFilter\n   */\n  owner: {\n    get: function () {\n      return this._owner;\n    },\n    set: function (value) {\n      if (this._owner !== value) {\n        this._owner = value;\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the {@link DrawCommand#boundingVolume} for this command, assuming it is a sphere, when the command executes.\n   * </p>\n   *\n   * @memberof DrawCommand.prototype\n   * @type {boolean}\n   * @default false\n   *\n   * @see DrawCommand#boundingVolume\n   */\n  debugShowBoundingVolume: {\n    get: function () {\n      return hasFlag(this, Flags.DEBUG_SHOW_BOUNDING_VOLUME);\n    },\n    set: function (value) {\n      if (hasFlag(this, Flags.DEBUG_SHOW_BOUNDING_VOLUME) !== value) {\n        setFlag(this, Flags.DEBUG_SHOW_BOUNDING_VOLUME, value);\n        this.dirty = true;\n      }\n    },\n  },\n\n  /**\n   * Used to implement Scene.debugShowFrustums.\n   * @private\n   */\n  debugOverlappingFrustums: {\n    get: function () {\n      return this._debugOverlappingFrustums;\n    },\n    set: function (value) {\n      if (this._debugOverlappingFrustums !== value) {\n        this._debugOverlappingFrustums = value;\n        this.dirty = true;\n      }\n    },\n  },\n  /**\n   * A GLSL string that will evaluate to a pick id. When <code>undefined</code>, the command will only draw depth\n   * during the pick pass.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {string}\n   * @default undefined\n   */\n  pickId: {\n    get: function () {\n      return this._pickId;\n    },\n    set: function (value) {\n      if (this._pickId !== value) {\n        this._pickId = value;\n        this.dirty = true;\n      }\n    },\n  },\n  /**\n   * Whether this command should be executed in the pick pass only.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {boolean}\n   * @default false\n   */\n  pickOnly: {\n    get: function () {\n      return hasFlag(this, Flags.PICK_ONLY);\n    },\n    set: function (value) {\n      if (hasFlag(this, Flags.PICK_ONLY) !== value) {\n        setFlag(this, Flags.PICK_ONLY, value);\n        this.dirty = true;\n      }\n    },\n  },\n  /**\n   * Whether this command should be derived to draw depth for classification of translucent primitives.\n   *\n   * @memberof DrawCommand.prototype\n   * @type {boolean}\n   * @default false\n   */\n  depthForTranslucentClassification: {\n    get: function () {\n      return hasFlag(this, Flags.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION);\n    },\n    set: function (value) {\n      if (hasFlag(this, Flags.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION) !== value) {\n        setFlag(this, Flags.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION, value);\n        this.dirty = true;\n      }\n    },\n  },\n});\n\n/**\n * @private\n */\nDrawCommand.shallowClone = function (command, result) {\n  if (!defined(command)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    result = new DrawCommand();\n  }\n\n  result._boundingVolume = command._boundingVolume;\n  result._orientedBoundingBox = command._orientedBoundingBox;\n  result._modelMatrix = command._modelMatrix;\n  result._primitiveType = command._primitiveType;\n  result._vertexArray = command._vertexArray;\n  result._count = command._count;\n  result._offset = command._offset;\n  result._instanceCount = command._instanceCount;\n  result._shaderProgram = command._shaderProgram;\n  result._uniformMap = command._uniformMap;\n  result._renderState = command._renderState;\n  result._framebuffer = command._framebuffer;\n  result._pass = command._pass;\n  result._owner = command._owner;\n  result._debugOverlappingFrustums = command._debugOverlappingFrustums;\n  result._pickId = command._pickId;\n  result._flags = command._flags;\n\n  result.dirty = true;\n  result.lastDirtyTime = 0;\n\n  return result;\n};\n\n/**\n * Executes the draw command.\n *\n * @param {Context} context The renderer context in which to draw.\n * @param {PassState} [passState] The state for the current render pass.\n */\nDrawCommand.prototype.execute = function (context, passState) {\n  context.draw(this, passState);\n};\nexport default DrawCommand;\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * The data type of a pixel.\n *\n * @enum {number}\n * @see PostProcessStage\n */\nconst PixelDatatype = {\n  UNSIGNED_BYTE: WebGLConstants.UNSIGNED_BYTE,\n  UNSIGNED_SHORT: WebGLConstants.UNSIGNED_SHORT,\n  UNSIGNED_INT: WebGLConstants.UNSIGNED_INT,\n  FLOAT: WebGLConstants.FLOAT,\n  HALF_FLOAT: WebGLConstants.HALF_FLOAT_OES,\n  UNSIGNED_INT_24_8: WebGLConstants.UNSIGNED_INT_24_8,\n  UNSIGNED_SHORT_4_4_4_4: WebGLConstants.UNSIGNED_SHORT_4_4_4_4,\n  UNSIGNED_SHORT_5_5_5_1: WebGLConstants.UNSIGNED_SHORT_5_5_5_1,\n  UNSIGNED_SHORT_5_6_5: WebGLConstants.UNSIGNED_SHORT_5_6_5,\n};\n\n/**\n  @private\n*/\nPixelDatatype.toWebGLConstant = function (pixelDatatype, context) {\n  switch (pixelDatatype) {\n    case PixelDatatype.UNSIGNED_BYTE:\n      return WebGLConstants.UNSIGNED_BYTE;\n    case PixelDatatype.UNSIGNED_SHORT:\n      return WebGLConstants.UNSIGNED_SHORT;\n    case PixelDatatype.UNSIGNED_INT:\n      return WebGLConstants.UNSIGNED_INT;\n    case PixelDatatype.FLOAT:\n      return WebGLConstants.FLOAT;\n    case PixelDatatype.HALF_FLOAT:\n      return context.webgl2\n        ? WebGLConstants.HALF_FLOAT\n        : WebGLConstants.HALF_FLOAT_OES;\n    case PixelDatatype.UNSIGNED_INT_24_8:\n      return WebGLConstants.UNSIGNED_INT_24_8;\n    case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:\n      return WebGLConstants.UNSIGNED_SHORT_4_4_4_4;\n    case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:\n      return WebGLConstants.UNSIGNED_SHORT_5_5_5_1;\n    case PixelDatatype.UNSIGNED_SHORT_5_6_5:\n      return PixelDatatype.UNSIGNED_SHORT_5_6_5;\n  }\n};\n\n/**\n  @private\n*/\nPixelDatatype.isPacked = function (pixelDatatype) {\n  return (\n    pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 ||\n    pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 ||\n    pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 ||\n    pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5\n  );\n};\n\n/**\n  @private\n*/\nPixelDatatype.sizeInBytes = function (pixelDatatype) {\n  switch (pixelDatatype) {\n    case PixelDatatype.UNSIGNED_BYTE:\n      return 1;\n    case PixelDatatype.UNSIGNED_SHORT:\n    case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:\n    case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:\n    case PixelDatatype.UNSIGNED_SHORT_5_6_5:\n    case PixelDatatype.HALF_FLOAT:\n      return 2;\n    case PixelDatatype.UNSIGNED_INT:\n    case PixelDatatype.FLOAT:\n    case PixelDatatype.UNSIGNED_INT_24_8:\n      return 4;\n  }\n};\n\n/**\n  @private\n*/\nPixelDatatype.validate = function (pixelDatatype) {\n  return (\n    pixelDatatype === PixelDatatype.UNSIGNED_BYTE ||\n    pixelDatatype === PixelDatatype.UNSIGNED_SHORT ||\n    pixelDatatype === PixelDatatype.UNSIGNED_INT ||\n    pixelDatatype === PixelDatatype.FLOAT ||\n    pixelDatatype === PixelDatatype.HALF_FLOAT ||\n    pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 ||\n    pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 ||\n    pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 ||\n    pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5\n  );\n};\n\nexport default Object.freeze(PixelDatatype);\n", "import PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport WebGLConstants from \"./WebGLConstants.js\";\n\n/**\n * The format of a pixel, i.e., the number of components it has and what they represent.\n *\n * @enum {number}\n */\nconst PixelFormat = {\n  /**\n   * A pixel format containing a depth value.\n   *\n   * @type {number}\n   * @constant\n   */\n  DEPTH_COMPONENT: WebGLConstants.DEPTH_COMPONENT,\n\n  /**\n   * A pixel format containing a depth and stencil value, most often used with {@link PixelDatatype.UNSIGNED_INT_24_8}.\n   *\n   * @type {number}\n   * @constant\n   */\n  DEPTH_STENCIL: WebGLConstants.DEPTH_STENCIL,\n\n  /**\n   * A pixel format containing an alpha channel.\n   *\n   * @type {number}\n   * @constant\n   */\n  ALPHA: WebGLConstants.ALPHA,\n\n  /**\n   * A pixel format containing a red channel\n   *\n   * @type {number}\n   * @constant\n   */\n  RED: WebGLConstants.RED,\n\n  /**\n   * A pixel format containing red and green channels.\n   *\n   * @type {number}\n   * @constant\n   */\n  RG: WebGLConstants.RG,\n\n  /**\n   * A pixel format containing red, green, and blue channels.\n   *\n   * @type {number}\n   * @constant\n   */\n  RGB: WebGLConstants.RGB,\n\n  /**\n   * A pixel format containing red, green, blue, and alpha channels.\n   *\n   * @type {number}\n   * @constant\n   */\n  RGBA: WebGLConstants.RGBA,\n\n  /**\n   * A pixel format containing a luminance (intensity) channel.\n   *\n   * @type {number}\n   * @constant\n   */\n  LUMINANCE: WebGLConstants.LUMINANCE,\n\n  /**\n   * A pixel format containing luminance (intensity) and alpha channels.\n   *\n   * @type {number}\n   * @constant\n   */\n  LUMINANCE_ALPHA: WebGLConstants.LUMINANCE_ALPHA,\n\n  /**\n   * A pixel format containing red, green, and blue channels that is DXT1 compressed.\n   *\n   * @type {number}\n   * @constant\n   */\n  RGB_DXT1: WebGLConstants.COMPRESSED_RGB_S3TC_DXT1_EXT,\n\n  /**\n   * A pixel format containing red, green, blue, and alpha channels that is DXT1 compressed.\n   *\n   * @type {number}\n   * @constant\n   */\n  RGBA_DXT1: WebGLConstants.COMPRESSED_RGBA_S3TC_DXT1_EXT,\n\n  /**\n   * A pixel format containing red, green, blue, and alpha channels that is DXT3 compressed.\n   *\n   * @type {number}\n   * @constant\n   */\n  RGBA_DXT3: WebGLConstants.COMPRESSED_RGBA_S3TC_DXT3_EXT,\n\n  /**\n   * A pixel format containing red, green, blue, and alpha channels that is DXT5 compressed.\n   *\n   * @type {number}\n   * @constant\n   */\n  RGBA_DXT5: WebGLConstants.COMPRESSED_RGBA_S3TC_DXT5_EXT,\n\n  /**\n   * A pixel format containing red, green, and blue channels that is PVR 4bpp compressed.\n   *\n   * @type {number}\n   * @constant\n   */\n  RGB_PVRTC_4BPPV1: WebGLConstants.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,\n\n  /**\n   * A pixel format containing red, green, and blue channels that is PVR 2bpp compressed.\n   *\n   * @type {number}\n   * @constant\n   */\n  RGB_PVRTC_2BPPV1: WebGLConstants.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,\n\n  /**\n   * A pixel format containing red, green, blue, and alpha channels that is PVR 4bpp compressed.\n   *\n   * @type {number}\n   * @constant\n   */\n  RGBA_PVRTC_4BPPV1: WebGLConstants.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,\n\n  /**\n   * A pixel format containing red, green, blue, and alpha channels that is PVR 2bpp compressed.\n   *\n   * @type {number}\n   * @constant\n   */\n  RGBA_PVRTC_2BPPV1: WebGLConstants.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,\n\n  /**\n   * A pixel format containing red, green, blue, and alpha channels that is ASTC compressed.\n   *\n   * @type {number}\n   * @constant\n   */\n  RGBA_ASTC: WebGLConstants.COMPRESSED_RGBA_ASTC_4x4_WEBGL,\n\n  /**\n   * A pixel format containing red, green, and blue channels that is ETC1 compressed.\n   *\n   * @type {number}\n   * @constant\n   */\n  RGB_ETC1: WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL,\n\n  /**\n   * A pixel format containing red, green, and blue channels that is ETC2 compressed.\n   *\n   * @type {number}\n   * @constant\n   */\n  RGB8_ETC2: WebGLConstants.COMPRESSED_RGB8_ETC2,\n\n  /**\n   * A pixel format containing red, green, blue, and alpha channels that is ETC2 compressed.\n   *\n   * @type {number}\n   * @constant\n   */\n  RGBA8_ETC2_EAC: WebGLConstants.COMPRESSED_RGBA8_ETC2_EAC,\n\n  /**\n   * A pixel format containing red, green, blue, and alpha channels that is BC7 compressed.\n   *\n   * @type {number}\n   * @constant\n   */\n  RGBA_BC7: WebGLConstants.COMPRESSED_RGBA_BPTC_UNORM,\n};\n\n/**\n * @private\n */\nPixelFormat.componentsLength = function (pixelFormat) {\n  switch (pixelFormat) {\n    case PixelFormat.RGB:\n      return 3;\n    case PixelFormat.RGBA:\n      return 4;\n    case PixelFormat.LUMINANCE_ALPHA:\n    case PixelFormat.RG:\n      return 2;\n    case PixelFormat.ALPHA:\n    case PixelFormat.RED:\n    case PixelFormat.LUMINANCE:\n      return 1;\n    default:\n      return 1;\n  }\n};\n\n/**\n * @private\n */\nPixelFormat.validate = function (pixelFormat) {\n  return (\n    pixelFormat === PixelFormat.DEPTH_COMPONENT ||\n    pixelFormat === PixelFormat.DEPTH_STENCIL ||\n    pixelFormat === PixelFormat.ALPHA ||\n    pixelFormat === PixelFormat.RED ||\n    pixelFormat === PixelFormat.RG ||\n    pixelFormat === PixelFormat.RGB ||\n    pixelFormat === PixelFormat.RGBA ||\n    pixelFormat === PixelFormat.LUMINANCE ||\n    pixelFormat === PixelFormat.LUMINANCE_ALPHA ||\n    pixelFormat === PixelFormat.RGB_DXT1 ||\n    pixelFormat === PixelFormat.RGBA_DXT1 ||\n    pixelFormat === PixelFormat.RGBA_DXT3 ||\n    pixelFormat === PixelFormat.RGBA_DXT5 ||\n    pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 ||\n    pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 ||\n    pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 ||\n    pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 ||\n    pixelFormat === PixelFormat.RGBA_ASTC ||\n    pixelFormat === PixelFormat.RGB_ETC1 ||\n    pixelFormat === PixelFormat.RGB8_ETC2 ||\n    pixelFormat === PixelFormat.RGBA8_ETC2_EAC ||\n    pixelFormat === PixelFormat.RGBA_BC7\n  );\n};\n\n/**\n * @private\n */\nPixelFormat.isColorFormat = function (pixelFormat) {\n  return (\n    pixelFormat === PixelFormat.ALPHA ||\n    pixelFormat === PixelFormat.RGB ||\n    pixelFormat === PixelFormat.RGBA ||\n    pixelFormat === PixelFormat.LUMINANCE ||\n    pixelFormat === PixelFormat.LUMINANCE_ALPHA\n  );\n};\n\n/**\n * @private\n */\nPixelFormat.isDepthFormat = function (pixelFormat) {\n  return (\n    pixelFormat === PixelFormat.DEPTH_COMPONENT ||\n    pixelFormat === PixelFormat.DEPTH_STENCIL\n  );\n};\n\n/**\n * @private\n */\nPixelFormat.isCompressedFormat = function (pixelFormat) {\n  return (\n    pixelFormat === PixelFormat.RGB_DXT1 ||\n    pixelFormat === PixelFormat.RGBA_DXT1 ||\n    pixelFormat === PixelFormat.RGBA_DXT3 ||\n    pixelFormat === PixelFormat.RGBA_DXT5 ||\n    pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 ||\n    pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 ||\n    pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 ||\n    pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 ||\n    pixelFormat === PixelFormat.RGBA_ASTC ||\n    pixelFormat === PixelFormat.RGB_ETC1 ||\n    pixelFormat === PixelFormat.RGB8_ETC2 ||\n    pixelFormat === PixelFormat.RGBA8_ETC2_EAC ||\n    pixelFormat === PixelFormat.RGBA_BC7\n  );\n};\n\n/**\n * @private\n */\nPixelFormat.isDXTFormat = function (pixelFormat) {\n  return (\n    pixelFormat === PixelFormat.RGB_DXT1 ||\n    pixelFormat === PixelFormat.RGBA_DXT1 ||\n    pixelFormat === PixelFormat.RGBA_DXT3 ||\n    pixelFormat === PixelFormat.RGBA_DXT5\n  );\n};\n\n/**\n * @private\n */\nPixelFormat.isPVRTCFormat = function (pixelFormat) {\n  return (\n    pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 ||\n    pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 ||\n    pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 ||\n    pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1\n  );\n};\n\n/**\n * @private\n */\nPixelFormat.isASTCFormat = function (pixelFormat) {\n  return pixelFormat === PixelFormat.RGBA_ASTC;\n};\n\n/**\n * @private\n */\nPixelFormat.isETC1Format = function (pixelFormat) {\n  return pixelFormat === PixelFormat.RGB_ETC1;\n};\n\n/**\n * @private\n */\nPixelFormat.isETC2Format = function (pixelFormat) {\n  return (\n    pixelFormat === PixelFormat.RGB8_ETC2 ||\n    pixelFormat === PixelFormat.RGBA8_ETC2_EAC\n  );\n};\n\n/**\n * @private\n */\nPixelFormat.isBC7Format = function (pixelFormat) {\n  return pixelFormat === PixelFormat.RGBA_BC7;\n};\n\n/**\n * @private\n */\nPixelFormat.compressedTextureSizeInBytes = function (\n  pixelFormat,\n  width,\n  height\n) {\n  switch (pixelFormat) {\n    case PixelFormat.RGB_DXT1:\n    case PixelFormat.RGBA_DXT1:\n    case PixelFormat.RGB_ETC1:\n    case PixelFormat.RGB8_ETC2:\n      return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;\n\n    case PixelFormat.RGBA_DXT3:\n    case PixelFormat.RGBA_DXT5:\n    case PixelFormat.RGBA_ASTC:\n    case PixelFormat.RGBA8_ETC2_EAC:\n      return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16;\n\n    case PixelFormat.RGB_PVRTC_4BPPV1:\n    case PixelFormat.RGBA_PVRTC_4BPPV1:\n      return Math.floor((Math.max(width, 8) * Math.max(height, 8) * 4 + 7) / 8);\n\n    case PixelFormat.RGB_PVRTC_2BPPV1:\n    case PixelFormat.RGBA_PVRTC_2BPPV1:\n      return Math.floor(\n        (Math.max(width, 16) * Math.max(height, 8) * 2 + 7) / 8\n      );\n\n    case PixelFormat.RGBA_BC7:\n      return Math.ceil(width / 4) * Math.ceil(height / 4) * 16;\n\n    default:\n      return 0;\n  }\n};\n\n/**\n * @private\n */\nPixelFormat.textureSizeInBytes = function (\n  pixelFormat,\n  pixelDatatype,\n  width,\n  height\n) {\n  let componentsLength = PixelFormat.componentsLength(pixelFormat);\n  if (PixelDatatype.isPacked(pixelDatatype)) {\n    componentsLength = 1;\n  }\n  return (\n    componentsLength * PixelDatatype.sizeInBytes(pixelDatatype) * width * height\n  );\n};\n\n/**\n * @private\n */\nPixelFormat.alignmentInBytes = function (pixelFormat, pixelDatatype, width) {\n  const mod =\n    PixelFormat.textureSizeInBytes(pixelFormat, pixelDatatype, width, 1) % 4;\n  return mod === 0 ? 4 : mod === 2 ? 2 : 1;\n};\n\n/**\n * @private\n */\nPixelFormat.createTypedArray = function (\n  pixelFormat,\n  pixelDatatype,\n  width,\n  height\n) {\n  let constructor;\n  const sizeInBytes = PixelDatatype.sizeInBytes(pixelDatatype);\n  if (sizeInBytes === Uint8Array.BYTES_PER_ELEMENT) {\n    constructor = Uint8Array;\n  } else if (sizeInBytes === Uint16Array.BYTES_PER_ELEMENT) {\n    constructor = Uint16Array;\n  } else if (\n    sizeInBytes === Float32Array.BYTES_PER_ELEMENT &&\n    pixelDatatype === PixelDatatype.FLOAT\n  ) {\n    constructor = Float32Array;\n  } else {\n    constructor = Uint32Array;\n  }\n\n  const size = PixelFormat.componentsLength(pixelFormat) * width * height;\n  return new constructor(size);\n};\n\n/**\n * @private\n */\nPixelFormat.flipY = function (\n  bufferView,\n  pixelFormat,\n  pixelDatatype,\n  width,\n  height\n) {\n  if (height === 1) {\n    return bufferView;\n  }\n  const flipped = PixelFormat.createTypedArray(\n    pixelFormat,\n    pixelDatatype,\n    width,\n    height\n  );\n  const numberOfComponents = PixelFormat.componentsLength(pixelFormat);\n  const textureWidth = width * numberOfComponents;\n  for (let i = 0; i < height; ++i) {\n    const row = i * width * numberOfComponents;\n    const flippedRow = (height - i - 1) * width * numberOfComponents;\n    for (let j = 0; j < textureWidth; ++j) {\n      flipped[flippedRow + j] = bufferView[row + j];\n    }\n  }\n  return flipped;\n};\n\n/**\n * @private\n */\nPixelFormat.toInternalFormat = function (pixelFormat, pixelDatatype, context) {\n  // WebGL 1 require internalFormat to be the same as PixelFormat\n  if (!context.webgl2) {\n    return pixelFormat;\n  }\n\n  // Convert pixelFormat to correct internalFormat for WebGL 2\n  if (pixelFormat === PixelFormat.DEPTH_STENCIL) {\n    return WebGLConstants.DEPTH24_STENCIL8;\n  }\n\n  if (pixelFormat === PixelFormat.DEPTH_COMPONENT) {\n    if (pixelDatatype === PixelDatatype.UNSIGNED_SHORT) {\n      return WebGLConstants.DEPTH_COMPONENT16;\n    } else if (pixelDatatype === PixelDatatype.UNSIGNED_INT) {\n      return WebGLConstants.DEPTH_COMPONENT24;\n    }\n  }\n\n  if (pixelDatatype === PixelDatatype.FLOAT) {\n    switch (pixelFormat) {\n      case PixelFormat.RGBA:\n        return WebGLConstants.RGBA32F;\n      case PixelFormat.RGB:\n        return WebGLConstants.RGB32F;\n      case PixelFormat.RG:\n        return WebGLConstants.RG32F;\n      case PixelFormat.RED:\n        return WebGLConstants.R32F;\n    }\n  }\n\n  if (pixelDatatype === PixelDatatype.HALF_FLOAT) {\n    switch (pixelFormat) {\n      case PixelFormat.RGBA:\n        return WebGLConstants.RGBA16F;\n      case PixelFormat.RGB:\n        return WebGLConstants.RGB16F;\n      case PixelFormat.RG:\n        return WebGLConstants.RG16F;\n      case PixelFormat.RED:\n        return WebGLConstants.R16F;\n    }\n  }\n\n  return pixelFormat;\n};\n\nexport default Object.freeze(PixelFormat);\n", "/**\n * @private\n */\nconst ContextLimits = {\n  _maximumCombinedTextureImageUnits: 0,\n  _maximumCubeMapSize: 0,\n  _maximumFragmentUniformVectors: 0,\n  _maximumTextureImageUnits: 0,\n  _maximumRenderbufferSize: 0,\n  _maximumTextureSize: 0,\n  _maximumVaryingVectors: 0,\n  _maximumVertexAttributes: 0,\n  _maximumVertexTextureImageUnits: 0,\n  _maximumVertexUniformVectors: 0,\n  _minimumAliasedLineWidth: 0,\n  _maximumAliasedLineWidth: 0,\n  _minimumAliasedPointSize: 0,\n  _maximumAliasedPointSize: 0,\n  _maximumViewportWidth: 0,\n  _maximumViewportHeight: 0,\n  _maximumTextureFilterAnisotropy: 0,\n  _maximumDrawBuffers: 0,\n  _maximumColorAttachments: 0,\n  _maximumSamples: 0,\n  _highpFloatSupported: false,\n  _highpIntSupported: false,\n};\n\nObject.defineProperties(ContextLimits, {\n  /**\n   * The maximum number of texture units that can be used from the vertex and fragment\n   * shader with this WebGL implementation.  The minimum is eight.  If both shaders access the\n   * same texture unit, this counts as two texture units.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_COMBINED_TEXTURE_IMAGE_UNITS</code>.\n   */\n  maximumCombinedTextureImageUnits: {\n    get: function () {\n      return ContextLimits._maximumCombinedTextureImageUnits;\n    },\n  },\n\n  /**\n   * The approximate maximum cube mape width and height supported by this WebGL implementation.\n   * The minimum is 16, but most desktop and laptop implementations will support much larger sizes like 8,192.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_CUBE_MAP_TEXTURE_SIZE</code>.\n   */\n  maximumCubeMapSize: {\n    get: function () {\n      return ContextLimits._maximumCubeMapSize;\n    },\n  },\n\n  /**\n   * The maximum number of <code>vec4</code>, <code>ivec4</code>, and <code>bvec4</code>\n   * uniforms that can be used by a fragment shader with this WebGL implementation.  The minimum is 16.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_FRAGMENT_UNIFORM_VECTORS</code>.\n   */\n  maximumFragmentUniformVectors: {\n    get: function () {\n      return ContextLimits._maximumFragmentUniformVectors;\n    },\n  },\n\n  /**\n   * The maximum number of texture units that can be used from the fragment shader with this WebGL implementation.  The minimum is eight.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_TEXTURE_IMAGE_UNITS</code>.\n   */\n  maximumTextureImageUnits: {\n    get: function () {\n      return ContextLimits._maximumTextureImageUnits;\n    },\n  },\n\n  /**\n   * The maximum renderbuffer width and height supported by this WebGL implementation.\n   * The minimum is 16, but most desktop and laptop implementations will support much larger sizes like 8,192.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_RENDERBUFFER_SIZE</code>.\n   */\n  maximumRenderbufferSize: {\n    get: function () {\n      return ContextLimits._maximumRenderbufferSize;\n    },\n  },\n\n  /**\n   * The approximate maximum texture width and height supported by this WebGL implementation.\n   * The minimum is 64, but most desktop and laptop implementations will support much larger sizes like 8,192.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_TEXTURE_SIZE</code>.\n   */\n  maximumTextureSize: {\n    get: function () {\n      return ContextLimits._maximumTextureSize;\n    },\n  },\n\n  /**\n   * The maximum number of <code>vec4</code> varying variables supported by this WebGL implementation.\n   * The minimum is eight.  Matrices and arrays count as multiple <code>vec4</code>s.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_VARYING_VECTORS</code>.\n   */\n  maximumVaryingVectors: {\n    get: function () {\n      return ContextLimits._maximumVaryingVectors;\n    },\n  },\n\n  /**\n   * The maximum number of <code>vec4</code> vertex attributes supported by this WebGL implementation.  The minimum is eight.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_VERTEX_ATTRIBS</code>.\n   */\n  maximumVertexAttributes: {\n    get: function () {\n      return ContextLimits._maximumVertexAttributes;\n    },\n  },\n\n  /**\n   * The maximum number of texture units that can be used from the vertex shader with this WebGL implementation.\n   * The minimum is zero, which means the GL does not support vertex texture fetch.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_VERTEX_TEXTURE_IMAGE_UNITS</code>.\n   */\n  maximumVertexTextureImageUnits: {\n    get: function () {\n      return ContextLimits._maximumVertexTextureImageUnits;\n    },\n  },\n\n  /**\n   * The maximum number of <code>vec4</code>, <code>ivec4</code>, and <code>bvec4</code>\n   * uniforms that can be used by a vertex shader with this WebGL implementation.  The minimum is 16.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_VERTEX_UNIFORM_VECTORS</code>.\n   */\n  maximumVertexUniformVectors: {\n    get: function () {\n      return ContextLimits._maximumVertexUniformVectors;\n    },\n  },\n\n  /**\n   * The minimum aliased line width, in pixels, supported by this WebGL implementation.  It will be at most one.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALIASED_LINE_WIDTH_RANGE</code>.\n   */\n  minimumAliasedLineWidth: {\n    get: function () {\n      return ContextLimits._minimumAliasedLineWidth;\n    },\n  },\n\n  /**\n   * The maximum aliased line width, in pixels, supported by this WebGL implementation.  It will be at least one.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALIASED_LINE_WIDTH_RANGE</code>.\n   */\n  maximumAliasedLineWidth: {\n    get: function () {\n      return ContextLimits._maximumAliasedLineWidth;\n    },\n  },\n\n  /**\n   * The minimum aliased point size, in pixels, supported by this WebGL implementation.  It will be at most one.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALIASED_POINT_SIZE_RANGE</code>.\n   */\n  minimumAliasedPointSize: {\n    get: function () {\n      return ContextLimits._minimumAliasedPointSize;\n    },\n  },\n\n  /**\n   * The maximum aliased point size, in pixels, supported by this WebGL implementation.  It will be at least one.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALIASED_POINT_SIZE_RANGE</code>.\n   */\n  maximumAliasedPointSize: {\n    get: function () {\n      return ContextLimits._maximumAliasedPointSize;\n    },\n  },\n\n  /**\n   * The maximum supported width of the viewport.  It will be at least as large as the visible width of the associated canvas.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_VIEWPORT_DIMS</code>.\n   */\n  maximumViewportWidth: {\n    get: function () {\n      return ContextLimits._maximumViewportWidth;\n    },\n  },\n\n  /**\n   * The maximum supported height of the viewport.  It will be at least as large as the visible height of the associated canvas.\n   * @memberof ContextLimits\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_VIEWPORT_DIMS</code>.\n   */\n  maximumViewportHeight: {\n    get: function () {\n      return ContextLimits._maximumViewportHeight;\n    },\n  },\n\n  /**\n   * The maximum degree of anisotropy for texture filtering\n   * @memberof ContextLimits\n   * @type {number}\n   */\n  maximumTextureFilterAnisotropy: {\n    get: function () {\n      return ContextLimits._maximumTextureFilterAnisotropy;\n    },\n  },\n\n  /**\n   * The maximum number of simultaneous outputs that may be written in a fragment shader.\n   * @memberof ContextLimits\n   * @type {number}\n   */\n  maximumDrawBuffers: {\n    get: function () {\n      return ContextLimits._maximumDrawBuffers;\n    },\n  },\n\n  /**\n   * The maximum number of color attachments supported.\n   * @memberof ContextLimits\n   * @type {number}\n   */\n  maximumColorAttachments: {\n    get: function () {\n      return ContextLimits._maximumColorAttachments;\n    },\n  },\n\n  /**\n   * The maximum number of samples supported for multisampling.\n   * @memberof ContextLimits\n   * @type {number}\n   */\n  maximumSamples: {\n    get: function () {\n      return ContextLimits._maximumSamples;\n    },\n  },\n\n  /**\n   * High precision float supported (<code>highp</code>) in fragment shaders.\n   * @memberof ContextLimits\n   * @type {boolean}\n   */\n  highpFloatSupported: {\n    get: function () {\n      return ContextLimits._highpFloatSupported;\n    },\n  },\n\n  /**\n   * High precision int supported (<code>highp</code>) in fragment shaders.\n   * @memberof ContextLimits\n   * @type {boolean}\n   */\n  highpIntSupported: {\n    get: function () {\n      return ContextLimits._highpIntSupported;\n    },\n  },\n});\nexport default ContextLimits;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport ContextLimits from \"./ContextLimits.js\";\nimport PixelDatatype from \"./PixelDatatype.js\";\n\nfunction attachTexture(framebuffer, attachment, texture) {\n  const gl = framebuffer._gl;\n  gl.framebufferTexture2D(\n    gl.FRAMEBUFFER,\n    attachment,\n    texture._target,\n    texture._texture,\n    0\n  );\n}\n\nfunction attachRenderbuffer(framebuffer, attachment, renderbuffer) {\n  const gl = framebuffer._gl;\n  gl.framebufferRenderbuffer(\n    gl.FRAMEBUFFER,\n    attachment,\n    gl.RENDERBUFFER,\n    renderbuffer._getRenderbuffer()\n  );\n}\n\n/**\n * Creates a framebuffer with optional initial color, depth, and stencil attachments.\n * Framebuffers are used for render-to-texture effects; they allow us to render to\n * textures in one pass, and read from it in a later pass.\n *\n * @param {object} options The initial framebuffer attachments as shown in the example below. <code>context</code> is required. The possible properties are <code>colorTextures</code>, <code>colorRenderbuffers</code>, <code>depthTexture</code>, <code>depthRenderbuffer</code>, <code>stencilRenderbuffer</code>, <code>depthStencilTexture</code>, <code>depthStencilRenderbuffer</code>, and <code>destroyAttachments</code>.\n *\n * @exception {DeveloperError} Cannot have both color texture and color renderbuffer attachments.\n * @exception {DeveloperError} Cannot have both a depth texture and depth renderbuffer attachment.\n * @exception {DeveloperError} Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.\n * @exception {DeveloperError} Cannot have both a depth and depth-stencil renderbuffer.\n * @exception {DeveloperError} Cannot have both a stencil and depth-stencil renderbuffer.\n * @exception {DeveloperError} Cannot have both a depth and stencil renderbuffer.\n * @exception {DeveloperError} The color-texture pixel-format must be a color format.\n * @exception {DeveloperError} The depth-texture pixel-format must be DEPTH_COMPONENT.\n * @exception {DeveloperError} The depth-stencil-texture pixel-format must be DEPTH_STENCIL.\n * @exception {DeveloperError} The number of color attachments exceeds the number supported.\n * @exception {DeveloperError} The color-texture pixel datatype is HALF_FLOAT and the WebGL implementation does not support the EXT_color_buffer_half_float extension.\n * @exception {DeveloperError} The color-texture pixel datatype is FLOAT and the WebGL implementation does not support the EXT_color_buffer_float or WEBGL_color_buffer_float extensions.\n *\n * @example\n * // Create a framebuffer with color and depth texture attachments.\n * const width = context.canvas.clientWidth;\n * const height = context.canvas.clientHeight;\n * const framebuffer = new Framebuffer({\n *   context : context,\n *   colorTextures : [new Texture({\n *     context : context,\n *     width : width,\n *     height : height,\n *     pixelFormat : PixelFormat.RGBA\n *   })],\n *   depthTexture : new Texture({\n *     context : context,\n *     width : width,\n *     height : height,\n *     pixelFormat : PixelFormat.DEPTH_COMPONENT,\n *     pixelDatatype : PixelDatatype.UNSIGNED_SHORT\n *   })\n * });\n *\n * @private\n * @constructor\n */\nfunction Framebuffer(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const context = options.context;\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.context\", context);\n  //>>includeEnd('debug');\n\n  const gl = context._gl;\n  const maximumColorAttachments = ContextLimits.maximumColorAttachments;\n\n  this._gl = gl;\n  this._framebuffer = gl.createFramebuffer();\n\n  this._colorTextures = [];\n  this._colorRenderbuffers = [];\n  this._activeColorAttachments = [];\n\n  this._depthTexture = undefined;\n  this._depthRenderbuffer = undefined;\n  this._stencilRenderbuffer = undefined;\n  this._depthStencilTexture = undefined;\n  this._depthStencilRenderbuffer = undefined;\n\n  /**\n   * When true, the framebuffer owns its attachments so they will be destroyed when\n   * {@link Framebuffer#destroy} is called or when a new attachment is assigned\n   * to an attachment point.\n   *\n   * @type {boolean}\n   * @default true\n   *\n   * @see Framebuffer#destroy\n   */\n  this.destroyAttachments = defaultValue(options.destroyAttachments, true);\n\n  // Throw if a texture and renderbuffer are attached to the same point.  This won't\n  // cause a WebGL error (because only one will be attached), but is likely a developer error.\n\n  //>>includeStart('debug', pragmas.debug);\n  if (defined(options.colorTextures) && defined(options.colorRenderbuffers)) {\n    throw new DeveloperError(\n      \"Cannot have both color texture and color renderbuffer attachments.\"\n    );\n  }\n  if (defined(options.depthTexture) && defined(options.depthRenderbuffer)) {\n    throw new DeveloperError(\n      \"Cannot have both a depth texture and depth renderbuffer attachment.\"\n    );\n  }\n  if (\n    defined(options.depthStencilTexture) &&\n    defined(options.depthStencilRenderbuffer)\n  ) {\n    throw new DeveloperError(\n      \"Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  // Avoid errors defined in Section 6.5 of the WebGL spec\n  const depthAttachment =\n    defined(options.depthTexture) || defined(options.depthRenderbuffer);\n  const depthStencilAttachment =\n    defined(options.depthStencilTexture) ||\n    defined(options.depthStencilRenderbuffer);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (depthAttachment && depthStencilAttachment) {\n    throw new DeveloperError(\n      \"Cannot have both a depth and depth-stencil attachment.\"\n    );\n  }\n  if (defined(options.stencilRenderbuffer) && depthStencilAttachment) {\n    throw new DeveloperError(\n      \"Cannot have both a stencil and depth-stencil attachment.\"\n    );\n  }\n  if (depthAttachment && defined(options.stencilRenderbuffer)) {\n    throw new DeveloperError(\n      \"Cannot have both a depth and stencil attachment.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  ///////////////////////////////////////////////////////////////////\n\n  this._bind();\n\n  let texture;\n  let renderbuffer;\n  let i;\n  let length;\n  let attachmentEnum;\n\n  if (defined(options.colorTextures)) {\n    const textures = options.colorTextures;\n    length = this._colorTextures.length = this._activeColorAttachments.length =\n      textures.length;\n\n    //>>includeStart('debug', pragmas.debug);\n    if (length > maximumColorAttachments) {\n      throw new DeveloperError(\n        \"The number of color attachments exceeds the number supported.\"\n      );\n    }\n    //>>includeEnd('debug');\n\n    for (i = 0; i < length; ++i) {\n      texture = textures[i];\n\n      //>>includeStart('debug', pragmas.debug);\n      if (!PixelFormat.isColorFormat(texture.pixelFormat)) {\n        throw new DeveloperError(\n          \"The color-texture pixel-format must be a color format.\"\n        );\n      }\n      if (\n        texture.pixelDatatype === PixelDatatype.FLOAT &&\n        !context.colorBufferFloat\n      ) {\n        throw new DeveloperError(\n          \"The color texture pixel datatype is FLOAT and the WebGL implementation does not support the EXT_color_buffer_float or WEBGL_color_buffer_float extensions. See Context.colorBufferFloat.\"\n        );\n      }\n      if (\n        texture.pixelDatatype === PixelDatatype.HALF_FLOAT &&\n        !context.colorBufferHalfFloat\n      ) {\n        throw new DeveloperError(\n          \"The color texture pixel datatype is HALF_FLOAT and the WebGL implementation does not support the EXT_color_buffer_half_float extension. See Context.colorBufferHalfFloat.\"\n        );\n      }\n      //>>includeEnd('debug');\n\n      attachmentEnum = this._gl.COLOR_ATTACHMENT0 + i;\n      attachTexture(this, attachmentEnum, texture);\n      this._activeColorAttachments[i] = attachmentEnum;\n      this._colorTextures[i] = texture;\n    }\n  }\n\n  if (defined(options.colorRenderbuffers)) {\n    const renderbuffers = options.colorRenderbuffers;\n    length = this._colorRenderbuffers.length = this._activeColorAttachments.length =\n      renderbuffers.length;\n\n    //>>includeStart('debug', pragmas.debug);\n    if (length > maximumColorAttachments) {\n      throw new DeveloperError(\n        \"The number of color attachments exceeds the number supported.\"\n      );\n    }\n    //>>includeEnd('debug');\n\n    for (i = 0; i < length; ++i) {\n      renderbuffer = renderbuffers[i];\n      attachmentEnum = this._gl.COLOR_ATTACHMENT0 + i;\n      attachRenderbuffer(this, attachmentEnum, renderbuffer);\n      this._activeColorAttachments[i] = attachmentEnum;\n      this._colorRenderbuffers[i] = renderbuffer;\n    }\n  }\n\n  if (defined(options.depthTexture)) {\n    texture = options.depthTexture;\n\n    //>>includeStart('debug', pragmas.debug);\n    if (texture.pixelFormat !== PixelFormat.DEPTH_COMPONENT) {\n      throw new DeveloperError(\n        \"The depth-texture pixel-format must be DEPTH_COMPONENT.\"\n      );\n    }\n    //>>includeEnd('debug');\n\n    attachTexture(this, this._gl.DEPTH_ATTACHMENT, texture);\n    this._depthTexture = texture;\n  }\n\n  if (defined(options.depthRenderbuffer)) {\n    renderbuffer = options.depthRenderbuffer;\n    attachRenderbuffer(this, this._gl.DEPTH_ATTACHMENT, renderbuffer);\n    this._depthRenderbuffer = renderbuffer;\n  }\n\n  if (defined(options.stencilRenderbuffer)) {\n    renderbuffer = options.stencilRenderbuffer;\n    attachRenderbuffer(this, this._gl.STENCIL_ATTACHMENT, renderbuffer);\n    this._stencilRenderbuffer = renderbuffer;\n  }\n\n  if (defined(options.depthStencilTexture)) {\n    texture = options.depthStencilTexture;\n\n    //>>includeStart('debug', pragmas.debug);\n    if (texture.pixelFormat !== PixelFormat.DEPTH_STENCIL) {\n      throw new DeveloperError(\n        \"The depth-stencil pixel-format must be DEPTH_STENCIL.\"\n      );\n    }\n    //>>includeEnd('debug');\n\n    attachTexture(this, this._gl.DEPTH_STENCIL_ATTACHMENT, texture);\n    this._depthStencilTexture = texture;\n  }\n\n  if (defined(options.depthStencilRenderbuffer)) {\n    renderbuffer = options.depthStencilRenderbuffer;\n    attachRenderbuffer(this, this._gl.DEPTH_STENCIL_ATTACHMENT, renderbuffer);\n    this._depthStencilRenderbuffer = renderbuffer;\n  }\n\n  this._unBind();\n}\n\nObject.defineProperties(Framebuffer.prototype, {\n  /**\n   * The status of the framebuffer. If the status is not WebGLConstants.FRAMEBUFFER_COMPLETE,\n   * a {@link DeveloperError} will be thrown when attempting to render to the framebuffer.\n   * @memberof Framebuffer.prototype\n   * @type {number}\n   */\n  status: {\n    get: function () {\n      this._bind();\n      const status = this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);\n      this._unBind();\n      return status;\n    },\n  },\n  numberOfColorAttachments: {\n    get: function () {\n      return this._activeColorAttachments.length;\n    },\n  },\n  depthTexture: {\n    get: function () {\n      return this._depthTexture;\n    },\n  },\n  depthRenderbuffer: {\n    get: function () {\n      return this._depthRenderbuffer;\n    },\n  },\n  stencilRenderbuffer: {\n    get: function () {\n      return this._stencilRenderbuffer;\n    },\n  },\n  depthStencilTexture: {\n    get: function () {\n      return this._depthStencilTexture;\n    },\n  },\n  depthStencilRenderbuffer: {\n    get: function () {\n      return this._depthStencilRenderbuffer;\n    },\n  },\n\n  /**\n   * True if the framebuffer has a depth attachment.  Depth attachments include\n   * depth and depth-stencil textures, and depth and depth-stencil renderbuffers.  When\n   * rendering to a framebuffer, a depth attachment is required for the depth test to have effect.\n   * @memberof Framebuffer.prototype\n   * @type {boolean}\n   */\n  hasDepthAttachment: {\n    get: function () {\n      return !!(\n        this.depthTexture ||\n        this.depthRenderbuffer ||\n        this.depthStencilTexture ||\n        this.depthStencilRenderbuffer\n      );\n    },\n  },\n});\n\nFramebuffer.prototype._bind = function () {\n  const gl = this._gl;\n  gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer);\n};\n\nFramebuffer.prototype._unBind = function () {\n  const gl = this._gl;\n  gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n};\n\nFramebuffer.prototype.bindDraw = function () {\n  const gl = this._gl;\n  gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, this._framebuffer);\n};\n\nFramebuffer.prototype.bindRead = function () {\n  const gl = this._gl;\n  gl.bindFramebuffer(gl.READ_FRAMEBUFFER, this._framebuffer);\n};\n\nFramebuffer.prototype._getActiveColorAttachments = function () {\n  return this._activeColorAttachments;\n};\n\nFramebuffer.prototype.getColorTexture = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(index) || index < 0 || index >= this._colorTextures.length) {\n    throw new DeveloperError(\n      \"index is required, must be greater than or equal to zero and must be less than the number of color attachments.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  return this._colorTextures[index];\n};\n\nFramebuffer.prototype.getColorRenderbuffer = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    !defined(index) ||\n    index < 0 ||\n    index >= this._colorRenderbuffers.length\n  ) {\n    throw new DeveloperError(\n      \"index is required, must be greater than or equal to zero and must be less than the number of color attachments.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  return this._colorRenderbuffers[index];\n};\n\nFramebuffer.prototype.isDestroyed = function () {\n  return false;\n};\n\nFramebuffer.prototype.destroy = function () {\n  if (this.destroyAttachments) {\n    // If the color texture is a cube map face, it is owned by the cube map, and will not be destroyed.\n    let i = 0;\n    const textures = this._colorTextures;\n    let length = textures.length;\n    for (; i < length; ++i) {\n      const texture = textures[i];\n      if (defined(texture)) {\n        texture.destroy();\n      }\n    }\n\n    const renderbuffers = this._colorRenderbuffers;\n    length = renderbuffers.length;\n    for (i = 0; i < length; ++i) {\n      const renderbuffer = renderbuffers[i];\n      if (defined(renderbuffer)) {\n        renderbuffer.destroy();\n      }\n    }\n\n    this._depthTexture = this._depthTexture && this._depthTexture.destroy();\n    this._depthRenderbuffer =\n      this._depthRenderbuffer && this._depthRenderbuffer.destroy();\n    this._stencilRenderbuffer =\n      this._stencilRenderbuffer && this._stencilRenderbuffer.destroy();\n    this._depthStencilTexture =\n      this._depthStencilTexture && this._depthStencilTexture.destroy();\n    this._depthStencilRenderbuffer =\n      this._depthStencilRenderbuffer &&\n      this._depthStencilRenderbuffer.destroy();\n  }\n\n  this._gl.deleteFramebuffer(this._framebuffer);\n  return destroyObject(this);\n};\nexport default Framebuffer;\n", "import WebGLConstants from \"./WebGLConstants.js\";\n\n/**\n * Winding order defines the order of vertices for a triangle to be considered front-facing.\n *\n * @enum {number}\n */\nconst WindingOrder = {\n  /**\n   * Vertices are in clockwise order.\n   *\n   * @type {number}\n   * @constant\n   */\n  CLOCKWISE: WebGLConstants.CW,\n\n  /**\n   * Vertices are in counter-clockwise order.\n   *\n   * @type {number}\n   * @constant\n   */\n  COUNTER_CLOCKWISE: WebGLConstants.CCW,\n};\n\n/**\n * @private\n */\nWindingOrder.validate = function (windingOrder) {\n  return (\n    windingOrder === WindingOrder.CLOCKWISE ||\n    windingOrder === WindingOrder.COUNTER_CLOCKWISE\n  );\n};\n\nexport default Object.freeze(WindingOrder);\n", "/**\n * Returns frozen renderState as well as all of the object literal properties. This function is deep object freeze\n * function ignoring properties named \"_applyFunctions\".\n *\n * @private\n *\n * @param {object} renderState\n * @returns {object} Returns frozen renderState.\n *\n */\nfunction freezeRenderState(renderState) {\n  if (typeof renderState !== \"object\" || renderState === null) {\n    return renderState;\n  }\n\n  let propName;\n  const propNames = Object.keys(renderState);\n\n  for (let i = 0; i < propNames.length; i++) {\n    propName = propNames[i];\n    if (\n      renderState.hasOwnProperty(propName) &&\n      propName !== \"_applyFunctions\"\n    ) {\n      renderState[propName] = freezeRenderState(renderState[propName]);\n    }\n  }\n  return Object.freeze(renderState);\n}\nexport default freezeRenderState;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\nimport WindingOrder from \"../Core/WindingOrder.js\";\nimport ContextLimits from \"./ContextLimits.js\";\nimport freezeRenderState from \"./freezeRenderState.js\";\n\nfunction validateBlendEquation(blendEquation) {\n  return (\n    blendEquation === WebGLConstants.FUNC_ADD ||\n    blendEquation === WebGLConstants.FUNC_SUBTRACT ||\n    blendEquation === WebGLConstants.FUNC_REVERSE_SUBTRACT ||\n    blendEquation === WebGLConstants.MIN ||\n    blendEquation === WebGLConstants.MAX\n  );\n}\n\nfunction validateBlendFunction(blendFunction) {\n  return (\n    blendFunction === WebGLConstants.ZERO ||\n    blendFunction === WebGLConstants.ONE ||\n    blendFunction === WebGLConstants.SRC_COLOR ||\n    blendFunction === WebGLConstants.ONE_MINUS_SRC_COLOR ||\n    blendFunction === WebGLConstants.DST_COLOR ||\n    blendFunction === WebGLConstants.ONE_MINUS_DST_COLOR ||\n    blendFunction === WebGLConstants.SRC_ALPHA ||\n    blendFunction === WebGLConstants.ONE_MINUS_SRC_ALPHA ||\n    blendFunction === WebGLConstants.DST_ALPHA ||\n    blendFunction === WebGLConstants.ONE_MINUS_DST_ALPHA ||\n    blendFunction === WebGLConstants.CONSTANT_COLOR ||\n    blendFunction === WebGLConstants.ONE_MINUS_CONSTANT_COLOR ||\n    blendFunction === WebGLConstants.CONSTANT_ALPHA ||\n    blendFunction === WebGLConstants.ONE_MINUS_CONSTANT_ALPHA ||\n    blendFunction === WebGLConstants.SRC_ALPHA_SATURATE\n  );\n}\n\nfunction validateCullFace(cullFace) {\n  return (\n    cullFace === WebGLConstants.FRONT ||\n    cullFace === WebGLConstants.BACK ||\n    cullFace === WebGLConstants.FRONT_AND_BACK\n  );\n}\n\nfunction validateDepthFunction(depthFunction) {\n  return (\n    depthFunction === WebGLConstants.NEVER ||\n    depthFunction === WebGLConstants.LESS ||\n    depthFunction === WebGLConstants.EQUAL ||\n    depthFunction === WebGLConstants.LEQUAL ||\n    depthFunction === WebGLConstants.GREATER ||\n    depthFunction === WebGLConstants.NOTEQUAL ||\n    depthFunction === WebGLConstants.GEQUAL ||\n    depthFunction === WebGLConstants.ALWAYS\n  );\n}\n\nfunction validateStencilFunction(stencilFunction) {\n  return (\n    stencilFunction === WebGLConstants.NEVER ||\n    stencilFunction === WebGLConstants.LESS ||\n    stencilFunction === WebGLConstants.EQUAL ||\n    stencilFunction === WebGLConstants.LEQUAL ||\n    stencilFunction === WebGLConstants.GREATER ||\n    stencilFunction === WebGLConstants.NOTEQUAL ||\n    stencilFunction === WebGLConstants.GEQUAL ||\n    stencilFunction === WebGLConstants.ALWAYS\n  );\n}\n\nfunction validateStencilOperation(stencilOperation) {\n  return (\n    stencilOperation === WebGLConstants.ZERO ||\n    stencilOperation === WebGLConstants.KEEP ||\n    stencilOperation === WebGLConstants.REPLACE ||\n    stencilOperation === WebGLConstants.INCR ||\n    stencilOperation === WebGLConstants.DECR ||\n    stencilOperation === WebGLConstants.INVERT ||\n    stencilOperation === WebGLConstants.INCR_WRAP ||\n    stencilOperation === WebGLConstants.DECR_WRAP\n  );\n}\n\n/**\n * @private\n */\nfunction RenderState(renderState) {\n  const rs = defaultValue(renderState, defaultValue.EMPTY_OBJECT);\n  const cull = defaultValue(rs.cull, defaultValue.EMPTY_OBJECT);\n  const polygonOffset = defaultValue(\n    rs.polygonOffset,\n    defaultValue.EMPTY_OBJECT\n  );\n  const scissorTest = defaultValue(rs.scissorTest, defaultValue.EMPTY_OBJECT);\n  const scissorTestRectangle = defaultValue(\n    scissorTest.rectangle,\n    defaultValue.EMPTY_OBJECT\n  );\n  const depthRange = defaultValue(rs.depthRange, defaultValue.EMPTY_OBJECT);\n  const depthTest = defaultValue(rs.depthTest, defaultValue.EMPTY_OBJECT);\n  const colorMask = defaultValue(rs.colorMask, defaultValue.EMPTY_OBJECT);\n  const blending = defaultValue(rs.blending, defaultValue.EMPTY_OBJECT);\n  const blendingColor = defaultValue(blending.color, defaultValue.EMPTY_OBJECT);\n  const stencilTest = defaultValue(rs.stencilTest, defaultValue.EMPTY_OBJECT);\n  const stencilTestFrontOperation = defaultValue(\n    stencilTest.frontOperation,\n    defaultValue.EMPTY_OBJECT\n  );\n  const stencilTestBackOperation = defaultValue(\n    stencilTest.backOperation,\n    defaultValue.EMPTY_OBJECT\n  );\n  const sampleCoverage = defaultValue(\n    rs.sampleCoverage,\n    defaultValue.EMPTY_OBJECT\n  );\n  const viewport = rs.viewport;\n\n  this.frontFace = defaultValue(rs.frontFace, WindingOrder.COUNTER_CLOCKWISE);\n  this.cull = {\n    enabled: defaultValue(cull.enabled, false),\n    face: defaultValue(cull.face, WebGLConstants.BACK),\n  };\n  this.lineWidth = defaultValue(rs.lineWidth, 1.0);\n  this.polygonOffset = {\n    enabled: defaultValue(polygonOffset.enabled, false),\n    factor: defaultValue(polygonOffset.factor, 0),\n    units: defaultValue(polygonOffset.units, 0),\n  };\n  this.scissorTest = {\n    enabled: defaultValue(scissorTest.enabled, false),\n    rectangle: BoundingRectangle.clone(scissorTestRectangle),\n  };\n  this.depthRange = {\n    near: defaultValue(depthRange.near, 0),\n    far: defaultValue(depthRange.far, 1),\n  };\n  this.depthTest = {\n    enabled: defaultValue(depthTest.enabled, false),\n    func: defaultValue(depthTest.func, WebGLConstants.LESS), // func, because function is a JavaScript keyword\n  };\n  this.colorMask = {\n    red: defaultValue(colorMask.red, true),\n    green: defaultValue(colorMask.green, true),\n    blue: defaultValue(colorMask.blue, true),\n    alpha: defaultValue(colorMask.alpha, true),\n  };\n  this.depthMask = defaultValue(rs.depthMask, true);\n  this.stencilMask = defaultValue(rs.stencilMask, ~0);\n  this.blending = {\n    enabled: defaultValue(blending.enabled, false),\n    color: new Color(\n      defaultValue(blendingColor.red, 0.0),\n      defaultValue(blendingColor.green, 0.0),\n      defaultValue(blendingColor.blue, 0.0),\n      defaultValue(blendingColor.alpha, 0.0)\n    ),\n    equationRgb: defaultValue(blending.equationRgb, WebGLConstants.FUNC_ADD),\n    equationAlpha: defaultValue(\n      blending.equationAlpha,\n      WebGLConstants.FUNC_ADD\n    ),\n    functionSourceRgb: defaultValue(\n      blending.functionSourceRgb,\n      WebGLConstants.ONE\n    ),\n    functionSourceAlpha: defaultValue(\n      blending.functionSourceAlpha,\n      WebGLConstants.ONE\n    ),\n    functionDestinationRgb: defaultValue(\n      blending.functionDestinationRgb,\n      WebGLConstants.ZERO\n    ),\n    functionDestinationAlpha: defaultValue(\n      blending.functionDestinationAlpha,\n      WebGLConstants.ZERO\n    ),\n  };\n  this.stencilTest = {\n    enabled: defaultValue(stencilTest.enabled, false),\n    frontFunction: defaultValue(\n      stencilTest.frontFunction,\n      WebGLConstants.ALWAYS\n    ),\n    backFunction: defaultValue(stencilTest.backFunction, WebGLConstants.ALWAYS),\n    reference: defaultValue(stencilTest.reference, 0),\n    mask: defaultValue(stencilTest.mask, ~0),\n    frontOperation: {\n      fail: defaultValue(stencilTestFrontOperation.fail, WebGLConstants.KEEP),\n      zFail: defaultValue(stencilTestFrontOperation.zFail, WebGLConstants.KEEP),\n      zPass: defaultValue(stencilTestFrontOperation.zPass, WebGLConstants.KEEP),\n    },\n    backOperation: {\n      fail: defaultValue(stencilTestBackOperation.fail, WebGLConstants.KEEP),\n      zFail: defaultValue(stencilTestBackOperation.zFail, WebGLConstants.KEEP),\n      zPass: defaultValue(stencilTestBackOperation.zPass, WebGLConstants.KEEP),\n    },\n  };\n  this.sampleCoverage = {\n    enabled: defaultValue(sampleCoverage.enabled, false),\n    value: defaultValue(sampleCoverage.value, 1.0),\n    invert: defaultValue(sampleCoverage.invert, false),\n  };\n  this.viewport = defined(viewport)\n    ? new BoundingRectangle(\n        viewport.x,\n        viewport.y,\n        viewport.width,\n        viewport.height\n      )\n    : undefined;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    this.lineWidth < ContextLimits.minimumAliasedLineWidth ||\n    this.lineWidth > ContextLimits.maximumAliasedLineWidth\n  ) {\n    throw new DeveloperError(\n      \"renderState.lineWidth is out of range.  Check minimumAliasedLineWidth and maximumAliasedLineWidth.\"\n    );\n  }\n  if (!WindingOrder.validate(this.frontFace)) {\n    throw new DeveloperError(\"Invalid renderState.frontFace.\");\n  }\n  if (!validateCullFace(this.cull.face)) {\n    throw new DeveloperError(\"Invalid renderState.cull.face.\");\n  }\n  if (\n    this.scissorTest.rectangle.width < 0 ||\n    this.scissorTest.rectangle.height < 0\n  ) {\n    throw new DeveloperError(\n      \"renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.\"\n    );\n  }\n  if (this.depthRange.near > this.depthRange.far) {\n    // WebGL specific - not an error in GL ES\n    throw new DeveloperError(\n      \"renderState.depthRange.near can not be greater than renderState.depthRange.far.\"\n    );\n  }\n  if (this.depthRange.near < 0) {\n    // Would be clamped by GL\n    throw new DeveloperError(\n      \"renderState.depthRange.near must be greater than or equal to zero.\"\n    );\n  }\n  if (this.depthRange.far > 1) {\n    // Would be clamped by GL\n    throw new DeveloperError(\n      \"renderState.depthRange.far must be less than or equal to one.\"\n    );\n  }\n  if (!validateDepthFunction(this.depthTest.func)) {\n    throw new DeveloperError(\"Invalid renderState.depthTest.func.\");\n  }\n  if (\n    this.blending.color.red < 0.0 ||\n    this.blending.color.red > 1.0 ||\n    this.blending.color.green < 0.0 ||\n    this.blending.color.green > 1.0 ||\n    this.blending.color.blue < 0.0 ||\n    this.blending.color.blue > 1.0 ||\n    this.blending.color.alpha < 0.0 ||\n    this.blending.color.alpha > 1.0\n  ) {\n    // Would be clamped by GL\n    throw new DeveloperError(\n      \"renderState.blending.color components must be greater than or equal to zero and less than or equal to one.\"\n    );\n  }\n  if (!validateBlendEquation(this.blending.equationRgb)) {\n    throw new DeveloperError(\"Invalid renderState.blending.equationRgb.\");\n  }\n  if (!validateBlendEquation(this.blending.equationAlpha)) {\n    throw new DeveloperError(\"Invalid renderState.blending.equationAlpha.\");\n  }\n  if (!validateBlendFunction(this.blending.functionSourceRgb)) {\n    throw new DeveloperError(\"Invalid renderState.blending.functionSourceRgb.\");\n  }\n  if (!validateBlendFunction(this.blending.functionSourceAlpha)) {\n    throw new DeveloperError(\n      \"Invalid renderState.blending.functionSourceAlpha.\"\n    );\n  }\n  if (!validateBlendFunction(this.blending.functionDestinationRgb)) {\n    throw new DeveloperError(\n      \"Invalid renderState.blending.functionDestinationRgb.\"\n    );\n  }\n  if (!validateBlendFunction(this.blending.functionDestinationAlpha)) {\n    throw new DeveloperError(\n      \"Invalid renderState.blending.functionDestinationAlpha.\"\n    );\n  }\n  if (!validateStencilFunction(this.stencilTest.frontFunction)) {\n    throw new DeveloperError(\"Invalid renderState.stencilTest.frontFunction.\");\n  }\n  if (!validateStencilFunction(this.stencilTest.backFunction)) {\n    throw new DeveloperError(\"Invalid renderState.stencilTest.backFunction.\");\n  }\n  if (!validateStencilOperation(this.stencilTest.frontOperation.fail)) {\n    throw new DeveloperError(\n      \"Invalid renderState.stencilTest.frontOperation.fail.\"\n    );\n  }\n  if (!validateStencilOperation(this.stencilTest.frontOperation.zFail)) {\n    throw new DeveloperError(\n      \"Invalid renderState.stencilTest.frontOperation.zFail.\"\n    );\n  }\n  if (!validateStencilOperation(this.stencilTest.frontOperation.zPass)) {\n    throw new DeveloperError(\n      \"Invalid renderState.stencilTest.frontOperation.zPass.\"\n    );\n  }\n  if (!validateStencilOperation(this.stencilTest.backOperation.fail)) {\n    throw new DeveloperError(\n      \"Invalid renderState.stencilTest.backOperation.fail.\"\n    );\n  }\n  if (!validateStencilOperation(this.stencilTest.backOperation.zFail)) {\n    throw new DeveloperError(\n      \"Invalid renderState.stencilTest.backOperation.zFail.\"\n    );\n  }\n  if (!validateStencilOperation(this.stencilTest.backOperation.zPass)) {\n    throw new DeveloperError(\n      \"Invalid renderState.stencilTest.backOperation.zPass.\"\n    );\n  }\n\n  if (defined(this.viewport)) {\n    if (this.viewport.width < 0) {\n      throw new DeveloperError(\n        \"renderState.viewport.width must be greater than or equal to zero.\"\n      );\n    }\n    if (this.viewport.height < 0) {\n      throw new DeveloperError(\n        \"renderState.viewport.height must be greater than or equal to zero.\"\n      );\n    }\n\n    if (this.viewport.width > ContextLimits.maximumViewportWidth) {\n      throw new DeveloperError(\n        `renderState.viewport.width must be less than or equal to the maximum viewport width (${ContextLimits.maximumViewportWidth.toString()}).  Check maximumViewportWidth.`\n      );\n    }\n    if (this.viewport.height > ContextLimits.maximumViewportHeight) {\n      throw new DeveloperError(\n        `renderState.viewport.height must be less than or equal to the maximum viewport height (${ContextLimits.maximumViewportHeight.toString()}).  Check maximumViewportHeight.`\n      );\n    }\n  }\n  //>>includeEnd('debug');\n\n  this.id = 0;\n  this._applyFunctions = [];\n}\n\nlet nextRenderStateId = 0;\nlet renderStateCache = {};\n\n/**\n * Validates and then finds or creates an immutable render state, which defines the pipeline\n * state for a {@link DrawCommand} or {@link ClearCommand}.  All inputs states are optional.  Omitted states\n * use the defaults shown in the example below.\n *\n * @param {object} [renderState] The states defining the render state as shown in the example below.\n *\n * @exception {RuntimeError} renderState.lineWidth is out of range.\n * @exception {DeveloperError} Invalid renderState.frontFace.\n * @exception {DeveloperError} Invalid renderState.cull.face.\n * @exception {DeveloperError} scissorTest.rectangle.width and scissorTest.rectangle.height must be greater than or equal to zero.\n * @exception {DeveloperError} renderState.depthRange.near can't be greater than renderState.depthRange.far.\n * @exception {DeveloperError} renderState.depthRange.near must be greater than or equal to zero.\n * @exception {DeveloperError} renderState.depthRange.far must be less than or equal to zero.\n * @exception {DeveloperError} Invalid renderState.depthTest.func.\n * @exception {DeveloperError} renderState.blending.color components must be greater than or equal to zero and less than or equal to one\n * @exception {DeveloperError} Invalid renderState.blending.equationRgb.\n * @exception {DeveloperError} Invalid renderState.blending.equationAlpha.\n * @exception {DeveloperError} Invalid renderState.blending.functionSourceRgb.\n * @exception {DeveloperError} Invalid renderState.blending.functionSourceAlpha.\n * @exception {DeveloperError} Invalid renderState.blending.functionDestinationRgb.\n * @exception {DeveloperError} Invalid renderState.blending.functionDestinationAlpha.\n * @exception {DeveloperError} Invalid renderState.stencilTest.frontFunction.\n * @exception {DeveloperError} Invalid renderState.stencilTest.backFunction.\n * @exception {DeveloperError} Invalid renderState.stencilTest.frontOperation.fail.\n * @exception {DeveloperError} Invalid renderState.stencilTest.frontOperation.zFail.\n * @exception {DeveloperError} Invalid renderState.stencilTest.frontOperation.zPass.\n * @exception {DeveloperError} Invalid renderState.stencilTest.backOperation.fail.\n * @exception {DeveloperError} Invalid renderState.stencilTest.backOperation.zFail.\n * @exception {DeveloperError} Invalid renderState.stencilTest.backOperation.zPass.\n * @exception {DeveloperError} renderState.viewport.width must be greater than or equal to zero.\n * @exception {DeveloperError} renderState.viewport.width must be less than or equal to the maximum viewport width.\n * @exception {DeveloperError} renderState.viewport.height must be greater than or equal to zero.\n * @exception {DeveloperError} renderState.viewport.height must be less than or equal to the maximum viewport height.\n *\n *\n * @example\n * const defaults = {\n *     frontFace : WindingOrder.COUNTER_CLOCKWISE,\n *     cull : {\n *         enabled : false,\n *         face : CullFace.BACK\n *     },\n *     lineWidth : 1,\n *     polygonOffset : {\n *         enabled : false,\n *         factor : 0,\n *         units : 0\n *     },\n *     scissorTest : {\n *         enabled : false,\n *         rectangle : {\n *             x : 0,\n *             y : 0,\n *             width : 0,\n *             height : 0\n *         }\n *     },\n *     depthRange : {\n *         near : 0,\n *         far : 1\n *     },\n *     depthTest : {\n *         enabled : false,\n *         func : DepthFunction.LESS\n *      },\n *     colorMask : {\n *         red : true,\n *         green : true,\n *         blue : true,\n *         alpha : true\n *     },\n *     depthMask : true,\n *     stencilMask : ~0,\n *     blending : {\n *         enabled : false,\n *         color : {\n *             red : 0.0,\n *             green : 0.0,\n *             blue : 0.0,\n *             alpha : 0.0\n *         },\n *         equationRgb : BlendEquation.ADD,\n *         equationAlpha : BlendEquation.ADD,\n *         functionSourceRgb : BlendFunction.ONE,\n *         functionSourceAlpha : BlendFunction.ONE,\n *         functionDestinationRgb : BlendFunction.ZERO,\n *         functionDestinationAlpha : BlendFunction.ZERO\n *     },\n *     stencilTest : {\n *         enabled : false,\n *         frontFunction : StencilFunction.ALWAYS,\n *         backFunction : StencilFunction.ALWAYS,\n *         reference : 0,\n *         mask : ~0,\n *         frontOperation : {\n *             fail : StencilOperation.KEEP,\n *             zFail : StencilOperation.KEEP,\n *             zPass : StencilOperation.KEEP\n *         },\n *         backOperation : {\n *             fail : StencilOperation.KEEP,\n *             zFail : StencilOperation.KEEP,\n *             zPass : StencilOperation.KEEP\n *         }\n *     },\n *     sampleCoverage : {\n *         enabled : false,\n *         value : 1.0,\n *         invert : false\n *      }\n * };\n *\n * const rs = RenderState.fromCache(defaults);\n *\n * @see DrawCommand\n * @see ClearCommand\n *\n * @private\n */\nRenderState.fromCache = function (renderState) {\n  const partialKey = JSON.stringify(renderState);\n  let cachedState = renderStateCache[partialKey];\n  if (defined(cachedState)) {\n    ++cachedState.referenceCount;\n    return cachedState.state;\n  }\n\n  // Cache miss.  Fully define render state and try again.\n  let states = new RenderState(renderState);\n  const fullKey = JSON.stringify(states);\n  cachedState = renderStateCache[fullKey];\n  if (!defined(cachedState)) {\n    states.id = nextRenderStateId++;\n    //>>includeStart('debug', pragmas.debug);\n    states = freezeRenderState(states);\n    //>>includeEnd('debug');\n    cachedState = {\n      referenceCount: 0,\n      state: states,\n    };\n\n    // Cache full render state.  Multiple partially defined render states may map to this.\n    renderStateCache[fullKey] = cachedState;\n  }\n\n  ++cachedState.referenceCount;\n\n  // Cache partial render state so we can skip validation on a cache hit for a partially defined render state\n  renderStateCache[partialKey] = {\n    referenceCount: 1,\n    state: cachedState.state,\n  };\n\n  return cachedState.state;\n};\n\n/**\n * @private\n */\nRenderState.removeFromCache = function (renderState) {\n  const states = new RenderState(renderState);\n  const fullKey = JSON.stringify(states);\n  const fullCachedState = renderStateCache[fullKey];\n\n  // decrement partial key reference count\n  const partialKey = JSON.stringify(renderState);\n  const cachedState = renderStateCache[partialKey];\n  if (defined(cachedState)) {\n    --cachedState.referenceCount;\n\n    if (cachedState.referenceCount === 0) {\n      // remove partial key\n      delete renderStateCache[partialKey];\n\n      // decrement full key reference count\n      if (defined(fullCachedState)) {\n        --fullCachedState.referenceCount;\n      }\n    }\n  }\n\n  // remove full key if reference count is zero\n  if (defined(fullCachedState) && fullCachedState.referenceCount === 0) {\n    delete renderStateCache[fullKey];\n  }\n};\n\n/**\n * This function is for testing purposes only.\n * @private\n */\nRenderState.getCache = function () {\n  return renderStateCache;\n};\n\n/**\n * This function is for testing purposes only.\n * @private\n */\nRenderState.clearCache = function () {\n  renderStateCache = {};\n};\n\nfunction enableOrDisable(gl, glEnum, enable) {\n  if (enable) {\n    gl.enable(glEnum);\n  } else {\n    gl.disable(glEnum);\n  }\n}\n\nfunction applyFrontFace(gl, renderState) {\n  gl.frontFace(renderState.frontFace);\n}\n\nfunction applyCull(gl, renderState) {\n  const cull = renderState.cull;\n  const enabled = cull.enabled;\n\n  enableOrDisable(gl, gl.CULL_FACE, enabled);\n\n  if (enabled) {\n    gl.cullFace(cull.face);\n  }\n}\n\nfunction applyLineWidth(gl, renderState) {\n  gl.lineWidth(renderState.lineWidth);\n}\n\nfunction applyPolygonOffset(gl, renderState) {\n  const polygonOffset = renderState.polygonOffset;\n  const enabled = polygonOffset.enabled;\n\n  enableOrDisable(gl, gl.POLYGON_OFFSET_FILL, enabled);\n\n  if (enabled) {\n    gl.polygonOffset(polygonOffset.factor, polygonOffset.units);\n  }\n}\n\nfunction applyScissorTest(gl, renderState, passState) {\n  const scissorTest = renderState.scissorTest;\n  const enabled = defined(passState.scissorTest)\n    ? passState.scissorTest.enabled\n    : scissorTest.enabled;\n\n  enableOrDisable(gl, gl.SCISSOR_TEST, enabled);\n\n  if (enabled) {\n    const rectangle = defined(passState.scissorTest)\n      ? passState.scissorTest.rectangle\n      : scissorTest.rectangle;\n    gl.scissor(rectangle.x, rectangle.y, rectangle.width, rectangle.height);\n  }\n}\n\nfunction applyDepthRange(gl, renderState) {\n  const depthRange = renderState.depthRange;\n  gl.depthRange(depthRange.near, depthRange.far);\n}\n\nfunction applyDepthTest(gl, renderState) {\n  const depthTest = renderState.depthTest;\n  const enabled = depthTest.enabled;\n\n  enableOrDisable(gl, gl.DEPTH_TEST, enabled);\n\n  if (enabled) {\n    gl.depthFunc(depthTest.func);\n  }\n}\n\nfunction applyColorMask(gl, renderState) {\n  const colorMask = renderState.colorMask;\n  gl.colorMask(colorMask.red, colorMask.green, colorMask.blue, colorMask.alpha);\n}\n\nfunction applyDepthMask(gl, renderState) {\n  gl.depthMask(renderState.depthMask);\n}\n\nfunction applyStencilMask(gl, renderState) {\n  gl.stencilMask(renderState.stencilMask);\n}\n\nfunction applyBlendingColor(gl, color) {\n  gl.blendColor(color.red, color.green, color.blue, color.alpha);\n}\n\nfunction applyBlending(gl, renderState, passState) {\n  const blending = renderState.blending;\n  const enabled = defined(passState.blendingEnabled)\n    ? passState.blendingEnabled\n    : blending.enabled;\n\n  enableOrDisable(gl, gl.BLEND, enabled);\n\n  if (enabled) {\n    applyBlendingColor(gl, blending.color);\n    gl.blendEquationSeparate(blending.equationRgb, blending.equationAlpha);\n    gl.blendFuncSeparate(\n      blending.functionSourceRgb,\n      blending.functionDestinationRgb,\n      blending.functionSourceAlpha,\n      blending.functionDestinationAlpha\n    );\n  }\n}\n\nfunction applyStencilTest(gl, renderState) {\n  const stencilTest = renderState.stencilTest;\n  const enabled = stencilTest.enabled;\n\n  enableOrDisable(gl, gl.STENCIL_TEST, enabled);\n\n  if (enabled) {\n    const frontFunction = stencilTest.frontFunction;\n    const backFunction = stencilTest.backFunction;\n    const reference = stencilTest.reference;\n    const mask = stencilTest.mask;\n\n    // Section 6.8 of the WebGL spec requires the reference and masks to be the same for\n    // front- and back-face tests.  This call prevents invalid operation errors when calling\n    // stencilFuncSeparate on Firefox.  Perhaps they should delay validation to avoid requiring this.\n    gl.stencilFunc(frontFunction, reference, mask);\n    gl.stencilFuncSeparate(gl.BACK, backFunction, reference, mask);\n    gl.stencilFuncSeparate(gl.FRONT, frontFunction, reference, mask);\n\n    const frontOperation = stencilTest.frontOperation;\n    const frontOperationFail = frontOperation.fail;\n    const frontOperationZFail = frontOperation.zFail;\n    const frontOperationZPass = frontOperation.zPass;\n\n    gl.stencilOpSeparate(\n      gl.FRONT,\n      frontOperationFail,\n      frontOperationZFail,\n      frontOperationZPass\n    );\n\n    const backOperation = stencilTest.backOperation;\n    const backOperationFail = backOperation.fail;\n    const backOperationZFail = backOperation.zFail;\n    const backOperationZPass = backOperation.zPass;\n\n    gl.stencilOpSeparate(\n      gl.BACK,\n      backOperationFail,\n      backOperationZFail,\n      backOperationZPass\n    );\n  }\n}\n\nfunction applySampleCoverage(gl, renderState) {\n  const sampleCoverage = renderState.sampleCoverage;\n  const enabled = sampleCoverage.enabled;\n\n  enableOrDisable(gl, gl.SAMPLE_COVERAGE, enabled);\n\n  if (enabled) {\n    gl.sampleCoverage(sampleCoverage.value, sampleCoverage.invert);\n  }\n}\n\nconst scratchViewport = new BoundingRectangle();\n\nfunction applyViewport(gl, renderState, passState) {\n  let viewport = defaultValue(renderState.viewport, passState.viewport);\n  if (!defined(viewport)) {\n    viewport = scratchViewport;\n    viewport.width = passState.context.drawingBufferWidth;\n    viewport.height = passState.context.drawingBufferHeight;\n  }\n\n  passState.context.uniformState.viewport = viewport;\n  gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);\n}\n\nRenderState.apply = function (gl, renderState, passState) {\n  applyFrontFace(gl, renderState);\n  applyCull(gl, renderState);\n  applyLineWidth(gl, renderState);\n  applyPolygonOffset(gl, renderState);\n  applyDepthRange(gl, renderState);\n  applyDepthTest(gl, renderState);\n  applyColorMask(gl, renderState);\n  applyDepthMask(gl, renderState);\n  applyStencilMask(gl, renderState);\n  applyStencilTest(gl, renderState);\n  applySampleCoverage(gl, renderState);\n  applyScissorTest(gl, renderState, passState);\n  applyBlending(gl, renderState, passState);\n  applyViewport(gl, renderState, passState);\n};\n\nfunction createFuncs(previousState, nextState) {\n  const funcs = [];\n\n  if (previousState.frontFace !== nextState.frontFace) {\n    funcs.push(applyFrontFace);\n  }\n\n  if (\n    previousState.cull.enabled !== nextState.cull.enabled ||\n    previousState.cull.face !== nextState.cull.face\n  ) {\n    funcs.push(applyCull);\n  }\n\n  if (previousState.lineWidth !== nextState.lineWidth) {\n    funcs.push(applyLineWidth);\n  }\n\n  if (\n    previousState.polygonOffset.enabled !== nextState.polygonOffset.enabled ||\n    previousState.polygonOffset.factor !== nextState.polygonOffset.factor ||\n    previousState.polygonOffset.units !== nextState.polygonOffset.units\n  ) {\n    funcs.push(applyPolygonOffset);\n  }\n\n  if (\n    previousState.depthRange.near !== nextState.depthRange.near ||\n    previousState.depthRange.far !== nextState.depthRange.far\n  ) {\n    funcs.push(applyDepthRange);\n  }\n\n  if (\n    previousState.depthTest.enabled !== nextState.depthTest.enabled ||\n    previousState.depthTest.func !== nextState.depthTest.func\n  ) {\n    funcs.push(applyDepthTest);\n  }\n\n  if (\n    previousState.colorMask.red !== nextState.colorMask.red ||\n    previousState.colorMask.green !== nextState.colorMask.green ||\n    previousState.colorMask.blue !== nextState.colorMask.blue ||\n    previousState.colorMask.alpha !== nextState.colorMask.alpha\n  ) {\n    funcs.push(applyColorMask);\n  }\n\n  if (previousState.depthMask !== nextState.depthMask) {\n    funcs.push(applyDepthMask);\n  }\n\n  if (previousState.stencilMask !== nextState.stencilMask) {\n    funcs.push(applyStencilMask);\n  }\n\n  if (\n    previousState.stencilTest.enabled !== nextState.stencilTest.enabled ||\n    previousState.stencilTest.frontFunction !==\n      nextState.stencilTest.frontFunction ||\n    previousState.stencilTest.backFunction !==\n      nextState.stencilTest.backFunction ||\n    previousState.stencilTest.reference !== nextState.stencilTest.reference ||\n    previousState.stencilTest.mask !== nextState.stencilTest.mask ||\n    previousState.stencilTest.frontOperation.fail !==\n      nextState.stencilTest.frontOperation.fail ||\n    previousState.stencilTest.frontOperation.zFail !==\n      nextState.stencilTest.frontOperation.zFail ||\n    previousState.stencilTest.backOperation.fail !==\n      nextState.stencilTest.backOperation.fail ||\n    previousState.stencilTest.backOperation.zFail !==\n      nextState.stencilTest.backOperation.zFail ||\n    previousState.stencilTest.backOperation.zPass !==\n      nextState.stencilTest.backOperation.zPass\n  ) {\n    funcs.push(applyStencilTest);\n  }\n\n  if (\n    previousState.sampleCoverage.enabled !== nextState.sampleCoverage.enabled ||\n    previousState.sampleCoverage.value !== nextState.sampleCoverage.value ||\n    previousState.sampleCoverage.invert !== nextState.sampleCoverage.invert\n  ) {\n    funcs.push(applySampleCoverage);\n  }\n\n  return funcs;\n}\n\nRenderState.partialApply = function (\n  gl,\n  previousRenderState,\n  renderState,\n  previousPassState,\n  passState,\n  clear\n) {\n  if (previousRenderState !== renderState) {\n    // When a new render state is applied, instead of making WebGL calls for all the states or first\n    // comparing the states one-by-one with the previous state (basically a linear search), we take\n    // advantage of RenderState's immutability, and store a dynamically populated sparse data structure\n    // containing functions that make the minimum number of WebGL calls when transitioning from one state\n    // to the other.  In practice, this works well since state-to-state transitions generally only require a\n    // few WebGL calls, especially if commands are stored by state.\n    let funcs = renderState._applyFunctions[previousRenderState.id];\n    if (!defined(funcs)) {\n      funcs = createFuncs(previousRenderState, renderState);\n      renderState._applyFunctions[previousRenderState.id] = funcs;\n    }\n\n    const len = funcs.length;\n    for (let i = 0; i < len; ++i) {\n      funcs[i](gl, renderState);\n    }\n  }\n\n  const previousScissorTest = defined(previousPassState.scissorTest)\n    ? previousPassState.scissorTest\n    : previousRenderState.scissorTest;\n  const scissorTest = defined(passState.scissorTest)\n    ? passState.scissorTest\n    : renderState.scissorTest;\n\n  // Our scissor rectangle can get out of sync with the GL scissor rectangle on clears.\n  // Seems to be a problem only on ANGLE. See https://github.com/CesiumGS/cesium/issues/2994\n  if (previousScissorTest !== scissorTest || clear) {\n    applyScissorTest(gl, renderState, passState);\n  }\n\n  const previousBlendingEnabled = defined(previousPassState.blendingEnabled)\n    ? previousPassState.blendingEnabled\n    : previousRenderState.blending.enabled;\n  const blendingEnabled = defined(passState.blendingEnabled)\n    ? passState.blendingEnabled\n    : renderState.blending.enabled;\n  if (\n    previousBlendingEnabled !== blendingEnabled ||\n    (blendingEnabled && previousRenderState.blending !== renderState.blending)\n  ) {\n    applyBlending(gl, renderState, passState);\n  }\n\n  if (\n    previousRenderState !== renderState ||\n    previousPassState !== passState ||\n    previousPassState.context !== passState.context\n  ) {\n    applyViewport(gl, renderState, passState);\n  }\n};\n\nRenderState.getState = function (renderState) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(renderState)) {\n    throw new DeveloperError(\"renderState is required.\");\n  }\n  //>>includeEnd('debug');\n\n  return {\n    frontFace: renderState.frontFace,\n    cull: {\n      enabled: renderState.cull.enabled,\n      face: renderState.cull.face,\n    },\n    lineWidth: renderState.lineWidth,\n    polygonOffset: {\n      enabled: renderState.polygonOffset.enabled,\n      factor: renderState.polygonOffset.factor,\n      units: renderState.polygonOffset.units,\n    },\n    scissorTest: {\n      enabled: renderState.scissorTest.enabled,\n      rectangle: BoundingRectangle.clone(renderState.scissorTest.rectangle),\n    },\n    depthRange: {\n      near: renderState.depthRange.near,\n      far: renderState.depthRange.far,\n    },\n    depthTest: {\n      enabled: renderState.depthTest.enabled,\n      func: renderState.depthTest.func,\n    },\n    colorMask: {\n      red: renderState.colorMask.red,\n      green: renderState.colorMask.green,\n      blue: renderState.colorMask.blue,\n      alpha: renderState.colorMask.alpha,\n    },\n    depthMask: renderState.depthMask,\n    stencilMask: renderState.stencilMask,\n    blending: {\n      enabled: renderState.blending.enabled,\n      color: Color.clone(renderState.blending.color),\n      equationRgb: renderState.blending.equationRgb,\n      equationAlpha: renderState.blending.equationAlpha,\n      functionSourceRgb: renderState.blending.functionSourceRgb,\n      functionSourceAlpha: renderState.blending.functionSourceAlpha,\n      functionDestinationRgb: renderState.blending.functionDestinationRgb,\n      functionDestinationAlpha: renderState.blending.functionDestinationAlpha,\n    },\n    stencilTest: {\n      enabled: renderState.stencilTest.enabled,\n      frontFunction: renderState.stencilTest.frontFunction,\n      backFunction: renderState.stencilTest.backFunction,\n      reference: renderState.stencilTest.reference,\n      mask: renderState.stencilTest.mask,\n      frontOperation: {\n        fail: renderState.stencilTest.frontOperation.fail,\n        zFail: renderState.stencilTest.frontOperation.zFail,\n        zPass: renderState.stencilTest.frontOperation.zPass,\n      },\n      backOperation: {\n        fail: renderState.stencilTest.backOperation.fail,\n        zFail: renderState.stencilTest.backOperation.zFail,\n        zPass: renderState.stencilTest.backOperation.zPass,\n      },\n    },\n    sampleCoverage: {\n      enabled: renderState.sampleCoverage.enabled,\n      value: renderState.sampleCoverage.value,\n      invert: renderState.sampleCoverage.invert,\n    },\n    viewport: defined(renderState.viewport)\n      ? BoundingRectangle.clone(renderState.viewport)\n      : undefined,\n  };\n};\nexport default RenderState;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * A 2x2 matrix, indexable as a column-major order array.\n * Constructor parameters are in row-major order for code readability.\n * @alias Matrix2\n * @constructor\n * @implements {ArrayLike<number>}\n *\n * @param {number} [column0Row0=0.0] The value for column 0, row 0.\n * @param {number} [column1Row0=0.0] The value for column 1, row 0.\n * @param {number} [column0Row1=0.0] The value for column 0, row 1.\n * @param {number} [column1Row1=0.0] The value for column 1, row 1.\n *\n * @see Matrix2.fromArray\n * @see Matrix2.fromColumnMajorArray\n * @see Matrix2.fromRowMajorArray\n * @see Matrix2.fromScale\n * @see Matrix2.fromUniformScale\n * @see Matrix2.fromRotation\n * @see Matrix3\n * @see Matrix4\n */\nfunction Matrix2(column0Row0, column1Row0, column0Row1, column1Row1) {\n  this[0] = defaultValue(column0Row0, 0.0);\n  this[1] = defaultValue(column0Row1, 0.0);\n  this[2] = defaultValue(column1Row0, 0.0);\n  this[3] = defaultValue(column1Row1, 0.0);\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nMatrix2.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Matrix2} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nMatrix2.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  array[startingIndex++] = value[0];\n  array[startingIndex++] = value[1];\n  array[startingIndex++] = value[2];\n  array[startingIndex++] = value[3];\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Matrix2} [result] The object into which to store the result.\n * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided.\n */\nMatrix2.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new Matrix2();\n  }\n\n  result[0] = array[startingIndex++];\n  result[1] = array[startingIndex++];\n  result[2] = array[startingIndex++];\n  result[3] = array[startingIndex++];\n  return result;\n};\n\n/**\n * Flattens an array of Matrix2s into an array of components. The components\n * are stored in column-major order.\n *\n * @param {Matrix2[]} array The array of matrices to pack.\n * @param {number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 4 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 4) elements.\n * @returns {number[]} The packed array.\n */\nMatrix2.packArray = function (array, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  const length = array.length;\n  const resultLength = length * 4;\n  if (!defined(result)) {\n    result = new Array(resultLength);\n  } else if (!Array.isArray(result) && result.length !== resultLength) {\n    //>>includeStart('debug', pragmas.debug);\n    throw new DeveloperError(\n      \"If result is a typed array, it must have exactly array.length * 4 elements\"\n    );\n    //>>includeEnd('debug');\n  } else if (result.length !== resultLength) {\n    result.length = resultLength;\n  }\n\n  for (let i = 0; i < length; ++i) {\n    Matrix2.pack(array[i], result, i * 4);\n  }\n  return result;\n};\n\n/**\n * Unpacks an array of column-major matrix components into an array of Matrix2s.\n *\n * @param {number[]} array The array of components to unpack.\n * @param {Matrix2[]} [result] The array onto which to store the result.\n * @returns {Matrix2[]} The unpacked array.\n */\nMatrix2.unpackArray = function (array, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  Check.typeOf.number.greaterThanOrEquals(\"array.length\", array.length, 4);\n  if (array.length % 4 !== 0) {\n    throw new DeveloperError(\"array length must be a multiple of 4.\");\n  }\n  //>>includeEnd('debug');\n\n  const length = array.length;\n  if (!defined(result)) {\n    result = new Array(length / 4);\n  } else {\n    result.length = length / 4;\n  }\n\n  for (let i = 0; i < length; i += 4) {\n    const index = i / 4;\n    result[index] = Matrix2.unpack(array, i, result[index]);\n  }\n  return result;\n};\n\n/**\n * Duplicates a Matrix2 instance.\n *\n * @param {Matrix2} matrix The matrix to duplicate.\n * @param {Matrix2} [result] The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined)\n */\nMatrix2.clone = function (matrix, result) {\n  if (!defined(matrix)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    return new Matrix2(matrix[0], matrix[2], matrix[1], matrix[3]);\n  }\n  result[0] = matrix[0];\n  result[1] = matrix[1];\n  result[2] = matrix[2];\n  result[3] = matrix[3];\n  return result;\n};\n\n/**\n * Creates a Matrix2 from 4 consecutive elements in an array.\n *\n * @function\n * @param {number[]} array The array whose 4 consecutive elements correspond to the positions of the matrix.  Assumes column-major order.\n * @param {number} [startingIndex=0] The offset into the array of the first element, which corresponds to first column first row position in the matrix.\n * @param {Matrix2} [result] The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided.\n *\n * @example\n * // Create the Matrix2:\n * // [1.0, 2.0]\n * // [1.0, 2.0]\n *\n * const v = [1.0, 1.0, 2.0, 2.0];\n * const m = Cesium.Matrix2.fromArray(v);\n *\n * // Create same Matrix2 with using an offset into an array\n * const v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0];\n * const m2 = Cesium.Matrix2.fromArray(v2, 2);\n */\nMatrix2.fromArray = Matrix2.unpack;\n/**\n * Creates a Matrix2 instance from a column-major order array.\n *\n * @param {number[]} values The column-major order array.\n * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.\n */\nMatrix2.fromColumnMajorArray = function (values, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"values\", values);\n  //>>includeEnd('debug');\n\n  return Matrix2.clone(values, result);\n};\n\n/**\n * Creates a Matrix2 instance from a row-major order array.\n * The resulting matrix will be in column-major order.\n *\n * @param {number[]} values The row-major order array.\n * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.\n */\nMatrix2.fromRowMajorArray = function (values, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"values\", values);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Matrix2(values[0], values[1], values[2], values[3]);\n  }\n  result[0] = values[0];\n  result[1] = values[2];\n  result[2] = values[1];\n  result[3] = values[3];\n  return result;\n};\n\n/**\n * Computes a Matrix2 instance representing a non-uniform scale.\n *\n * @param {Cartesian2} scale The x and y scale factors.\n * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.\n *\n * @example\n * // Creates\n * //   [7.0, 0.0]\n * //   [0.0, 8.0]\n * const m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0));\n */\nMatrix2.fromScale = function (scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"scale\", scale);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Matrix2(scale.x, 0.0, 0.0, scale.y);\n  }\n\n  result[0] = scale.x;\n  result[1] = 0.0;\n  result[2] = 0.0;\n  result[3] = scale.y;\n  return result;\n};\n\n/**\n * Computes a Matrix2 instance representing a uniform scale.\n *\n * @param {number} scale The uniform scale factor.\n * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.\n *\n * @example\n * // Creates\n * //   [2.0, 0.0]\n * //   [0.0, 2.0]\n * const m = Cesium.Matrix2.fromUniformScale(2.0);\n */\nMatrix2.fromUniformScale = function (scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"scale\", scale);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Matrix2(scale, 0.0, 0.0, scale);\n  }\n\n  result[0] = scale;\n  result[1] = 0.0;\n  result[2] = 0.0;\n  result[3] = scale;\n  return result;\n};\n\n/**\n * Creates a rotation matrix.\n *\n * @param {number} angle The angle, in radians, of the rotation.  Positive angles are counterclockwise.\n * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.\n *\n * @example\n * // Rotate a point 45 degrees counterclockwise.\n * const p = new Cesium.Cartesian2(5, 6);\n * const m = Cesium.Matrix2.fromRotation(Cesium.Math.toRadians(45.0));\n * const rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2());\n */\nMatrix2.fromRotation = function (angle, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"angle\", angle);\n  //>>includeEnd('debug');\n\n  const cosAngle = Math.cos(angle);\n  const sinAngle = Math.sin(angle);\n\n  if (!defined(result)) {\n    return new Matrix2(cosAngle, -sinAngle, sinAngle, cosAngle);\n  }\n  result[0] = cosAngle;\n  result[1] = sinAngle;\n  result[2] = -sinAngle;\n  result[3] = cosAngle;\n  return result;\n};\n\n/**\n * Creates an Array from the provided Matrix2 instance.\n * The array will be in column-major order.\n *\n * @param {Matrix2} matrix The matrix to use..\n * @param {number[]} [result] The Array onto which to store the result.\n * @returns {number[]} The modified Array parameter or a new Array instance if one was not provided.\n */\nMatrix2.toArray = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return [matrix[0], matrix[1], matrix[2], matrix[3]];\n  }\n  result[0] = matrix[0];\n  result[1] = matrix[1];\n  result[2] = matrix[2];\n  result[3] = matrix[3];\n  return result;\n};\n\n/**\n * Computes the array index of the element at the provided row and column.\n *\n * @param {number} row The zero-based index of the row.\n * @param {number} column The zero-based index of the column.\n * @returns {number} The index of the element at the provided row and column.\n *\n * @exception {DeveloperError} row must be 0 or 1.\n * @exception {DeveloperError} column must be 0 or 1.\n *\n * @example\n * const myMatrix = new Cesium.Matrix2();\n * const column1Row0Index = Cesium.Matrix2.getElementIndex(1, 0);\n * const column1Row0 = myMatrix[column1Row0Index]\n * myMatrix[column1Row0Index] = 10.0;\n */\nMatrix2.getElementIndex = function (column, row) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThanOrEquals(\"row\", row, 0);\n  Check.typeOf.number.lessThanOrEquals(\"row\", row, 1);\n\n  Check.typeOf.number.greaterThanOrEquals(\"column\", column, 0);\n  Check.typeOf.number.lessThanOrEquals(\"column\", column, 1);\n  //>>includeEnd('debug');\n\n  return column * 2 + row;\n};\n\n/**\n * Retrieves a copy of the matrix column at the provided index as a Cartesian2 instance.\n *\n * @param {Matrix2} matrix The matrix to use.\n * @param {number} index The zero-based index of the column to retrieve.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0 or 1.\n */\nMatrix2.getColumn = function (matrix, index, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n\n  Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\n  Check.typeOf.number.lessThanOrEquals(\"index\", index, 1);\n\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const startIndex = index * 2;\n  const x = matrix[startIndex];\n  const y = matrix[startIndex + 1];\n\n  result.x = x;\n  result.y = y;\n  return result;\n};\n\n/**\n * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian2 instance.\n *\n * @param {Matrix2} matrix The matrix to use.\n * @param {number} index The zero-based index of the column to set.\n * @param {Cartesian2} cartesian The Cartesian whose values will be assigned to the specified column.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0 or 1.\n */\nMatrix2.setColumn = function (matrix, index, cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n\n  Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\n  Check.typeOf.number.lessThanOrEquals(\"index\", index, 1);\n\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result = Matrix2.clone(matrix, result);\n  const startIndex = index * 2;\n  result[startIndex] = cartesian.x;\n  result[startIndex + 1] = cartesian.y;\n  return result;\n};\n\n/**\n * Retrieves a copy of the matrix row at the provided index as a Cartesian2 instance.\n *\n * @param {Matrix2} matrix The matrix to use.\n * @param {number} index The zero-based index of the row to retrieve.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0 or 1.\n */\nMatrix2.getRow = function (matrix, index, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n\n  Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\n  Check.typeOf.number.lessThanOrEquals(\"index\", index, 1);\n\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const x = matrix[index];\n  const y = matrix[index + 2];\n\n  result.x = x;\n  result.y = y;\n  return result;\n};\n\n/**\n * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian2 instance.\n *\n * @param {Matrix2} matrix The matrix to use.\n * @param {number} index The zero-based index of the row to set.\n * @param {Cartesian2} cartesian The Cartesian whose values will be assigned to the specified row.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0 or 1.\n */\nMatrix2.setRow = function (matrix, index, cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n\n  Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\n  Check.typeOf.number.lessThanOrEquals(\"index\", index, 1);\n\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result = Matrix2.clone(matrix, result);\n  result[index] = cartesian.x;\n  result[index + 2] = cartesian.y;\n  return result;\n};\n\nconst scaleScratch1 = new Cartesian2();\n\n/**\n * Computes a new matrix that replaces the scale with the provided scale.\n * This assumes the matrix is an affine transformation.\n *\n * @param {Matrix2} matrix The matrix to use.\n * @param {Cartesian2} scale The scale that replaces the scale of the provided matrix.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n *\n * @see Matrix2.setUniformScale\n * @see Matrix2.fromScale\n * @see Matrix2.fromUniformScale\n * @see Matrix2.multiplyByScale\n * @see Matrix2.multiplyByUniformScale\n * @see Matrix2.getScale\n */\nMatrix2.setScale = function (matrix, scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"scale\", scale);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const existingScale = Matrix2.getScale(matrix, scaleScratch1);\n  const scaleRatioX = scale.x / existingScale.x;\n  const scaleRatioY = scale.y / existingScale.y;\n\n  result[0] = matrix[0] * scaleRatioX;\n  result[1] = matrix[1] * scaleRatioX;\n  result[2] = matrix[2] * scaleRatioY;\n  result[3] = matrix[3] * scaleRatioY;\n\n  return result;\n};\n\nconst scaleScratch2 = new Cartesian2();\n\n/**\n * Computes a new matrix that replaces the scale with the provided uniform scale.\n * This assumes the matrix is an affine transformation.\n *\n * @param {Matrix2} matrix The matrix to use.\n * @param {number} scale The uniform scale that replaces the scale of the provided matrix.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n *\n * @see Matrix2.setScale\n * @see Matrix2.fromScale\n * @see Matrix2.fromUniformScale\n * @see Matrix2.multiplyByScale\n * @see Matrix2.multiplyByUniformScale\n * @see Matrix2.getScale\n */\nMatrix2.setUniformScale = function (matrix, scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.number(\"scale\", scale);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const existingScale = Matrix2.getScale(matrix, scaleScratch2);\n  const scaleRatioX = scale / existingScale.x;\n  const scaleRatioY = scale / existingScale.y;\n\n  result[0] = matrix[0] * scaleRatioX;\n  result[1] = matrix[1] * scaleRatioX;\n  result[2] = matrix[2] * scaleRatioY;\n  result[3] = matrix[3] * scaleRatioY;\n\n  return result;\n};\n\nconst scratchColumn = new Cartesian2();\n\n/**\n * Extracts the non-uniform scale assuming the matrix is an affine transformation.\n *\n * @param {Matrix2} matrix The matrix.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n *\n * @see Matrix2.multiplyByScale\n * @see Matrix2.multiplyByUniformScale\n * @see Matrix2.fromScale\n * @see Matrix2.fromUniformScale\n * @see Matrix2.setScale\n * @see Matrix2.setUniformScale\n */\nMatrix2.getScale = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = Cartesian2.magnitude(\n    Cartesian2.fromElements(matrix[0], matrix[1], scratchColumn)\n  );\n  result.y = Cartesian2.magnitude(\n    Cartesian2.fromElements(matrix[2], matrix[3], scratchColumn)\n  );\n  return result;\n};\n\nconst scaleScratch3 = new Cartesian2();\n\n/**\n * Computes the maximum scale assuming the matrix is an affine transformation.\n * The maximum scale is the maximum length of the column vectors.\n *\n * @param {Matrix2} matrix The matrix.\n * @returns {number} The maximum scale.\n */\nMatrix2.getMaximumScale = function (matrix) {\n  Matrix2.getScale(matrix, scaleScratch3);\n  return Cartesian2.maximumComponent(scaleScratch3);\n};\n\nconst scaleScratch4 = new Cartesian2();\n\n/**\n * Sets the rotation assuming the matrix is an affine transformation.\n *\n * @param {Matrix2} matrix The matrix.\n * @param {Matrix2} rotation The rotation matrix.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n *\n * @see Matrix2.fromRotation\n * @see Matrix2.getRotation\n */\nMatrix2.setRotation = function (matrix, rotation, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const scale = Matrix2.getScale(matrix, scaleScratch4);\n\n  result[0] = rotation[0] * scale.x;\n  result[1] = rotation[1] * scale.x;\n  result[2] = rotation[2] * scale.y;\n  result[3] = rotation[3] * scale.y;\n\n  return result;\n};\n\nconst scaleScratch5 = new Cartesian2();\n\n/**\n * Extracts the rotation matrix assuming the matrix is an affine transformation.\n *\n * @param {Matrix2} matrix The matrix.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n *\n * @see Matrix2.setRotation\n * @see Matrix2.fromRotation\n */\nMatrix2.getRotation = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const scale = Matrix2.getScale(matrix, scaleScratch5);\n\n  result[0] = matrix[0] / scale.x;\n  result[1] = matrix[1] / scale.x;\n  result[2] = matrix[2] / scale.y;\n  result[3] = matrix[3] / scale.y;\n\n  return result;\n};\n\n/**\n * Computes the product of two matrices.\n *\n * @param {Matrix2} left The first matrix.\n * @param {Matrix2} right The second matrix.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n */\nMatrix2.multiply = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const column0Row0 = left[0] * right[0] + left[2] * right[1];\n  const column1Row0 = left[0] * right[2] + left[2] * right[3];\n  const column0Row1 = left[1] * right[0] + left[3] * right[1];\n  const column1Row1 = left[1] * right[2] + left[3] * right[3];\n\n  result[0] = column0Row0;\n  result[1] = column0Row1;\n  result[2] = column1Row0;\n  result[3] = column1Row1;\n  return result;\n};\n\n/**\n * Computes the sum of two matrices.\n *\n * @param {Matrix2} left The first matrix.\n * @param {Matrix2} right The second matrix.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n */\nMatrix2.add = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = left[0] + right[0];\n  result[1] = left[1] + right[1];\n  result[2] = left[2] + right[2];\n  result[3] = left[3] + right[3];\n  return result;\n};\n\n/**\n * Computes the difference of two matrices.\n *\n * @param {Matrix2} left The first matrix.\n * @param {Matrix2} right The second matrix.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n */\nMatrix2.subtract = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = left[0] - right[0];\n  result[1] = left[1] - right[1];\n  result[2] = left[2] - right[2];\n  result[3] = left[3] - right[3];\n  return result;\n};\n\n/**\n * Computes the product of a matrix and a column vector.\n *\n * @param {Matrix2} matrix The matrix.\n * @param {Cartesian2} cartesian The column.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nMatrix2.multiplyByVector = function (matrix, cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const x = matrix[0] * cartesian.x + matrix[2] * cartesian.y;\n  const y = matrix[1] * cartesian.x + matrix[3] * cartesian.y;\n\n  result.x = x;\n  result.y = y;\n  return result;\n};\n\n/**\n * Computes the product of a matrix and a scalar.\n *\n * @param {Matrix2} matrix The matrix.\n * @param {number} scalar The number to multiply by.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n */\nMatrix2.multiplyByScalar = function (matrix, scalar, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.number(\"scalar\", scalar);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = matrix[0] * scalar;\n  result[1] = matrix[1] * scalar;\n  result[2] = matrix[2] * scalar;\n  result[3] = matrix[3] * scalar;\n  return result;\n};\n\n/**\n * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.\n *\n * @param {Matrix2} matrix The matrix on the left-hand side.\n * @param {Cartesian2} scale The non-uniform scale on the right-hand side.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n *\n *\n * @example\n * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromScale(scale), m);\n * Cesium.Matrix2.multiplyByScale(m, scale, m);\n *\n * @see Matrix2.multiplyByUniformScale\n * @see Matrix2.fromScale\n * @see Matrix2.fromUniformScale\n * @see Matrix2.setScale\n * @see Matrix2.setUniformScale\n * @see Matrix2.getScale\n */\nMatrix2.multiplyByScale = function (matrix, scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"scale\", scale);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = matrix[0] * scale.x;\n  result[1] = matrix[1] * scale.x;\n  result[2] = matrix[2] * scale.y;\n  result[3] = matrix[3] * scale.y;\n\n  return result;\n};\n\n/**\n * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.\n *\n * @param {Matrix2} matrix The matrix on the left-hand side.\n * @param {number} scale The uniform scale on the right-hand side.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromUniformScale(scale), m);\n * Cesium.Matrix2.multiplyByUniformScale(m, scale, m);\n *\n * @see Matrix2.multiplyByScale\n * @see Matrix2.fromScale\n * @see Matrix2.fromUniformScale\n * @see Matrix2.setScale\n * @see Matrix2.setUniformScale\n * @see Matrix2.getScale\n */\nMatrix2.multiplyByUniformScale = function (matrix, scale, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.number(\"scale\", scale);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = matrix[0] * scale;\n  result[1] = matrix[1] * scale;\n  result[2] = matrix[2] * scale;\n  result[3] = matrix[3] * scale;\n\n  return result;\n};\n\n/**\n * Creates a negated copy of the provided matrix.\n *\n * @param {Matrix2} matrix The matrix to negate.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n */\nMatrix2.negate = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = -matrix[0];\n  result[1] = -matrix[1];\n  result[2] = -matrix[2];\n  result[3] = -matrix[3];\n  return result;\n};\n\n/**\n * Computes the transpose of the provided matrix.\n *\n * @param {Matrix2} matrix The matrix to transpose.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n */\nMatrix2.transpose = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const column0Row0 = matrix[0];\n  const column0Row1 = matrix[2];\n  const column1Row0 = matrix[1];\n  const column1Row1 = matrix[3];\n\n  result[0] = column0Row0;\n  result[1] = column0Row1;\n  result[2] = column1Row0;\n  result[3] = column1Row1;\n  return result;\n};\n\n/**\n * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.\n *\n * @param {Matrix2} matrix The matrix with signed elements.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n */\nMatrix2.abs = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result[0] = Math.abs(matrix[0]);\n  result[1] = Math.abs(matrix[1]);\n  result[2] = Math.abs(matrix[2]);\n  result[3] = Math.abs(matrix[3]);\n\n  return result;\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Matrix2} [left] The first matrix.\n * @param {Matrix2} [right] The second matrix.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nMatrix2.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left[0] === right[0] &&\n      left[1] === right[1] &&\n      left[2] === right[2] &&\n      left[3] === right[3])\n  );\n};\n\n/**\n * @private\n */\nMatrix2.equalsArray = function (matrix, array, offset) {\n  return (\n    matrix[0] === array[offset] &&\n    matrix[1] === array[offset + 1] &&\n    matrix[2] === array[offset + 2] &&\n    matrix[3] === array[offset + 3]\n  );\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Matrix2} [left] The first matrix.\n * @param {Matrix2} [right] The second matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nMatrix2.equalsEpsilon = function (left, right, epsilon) {\n  epsilon = defaultValue(epsilon, 0);\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      Math.abs(left[0] - right[0]) <= epsilon &&\n      Math.abs(left[1] - right[1]) <= epsilon &&\n      Math.abs(left[2] - right[2]) <= epsilon &&\n      Math.abs(left[3] - right[3]) <= epsilon)\n  );\n};\n\n/**\n * An immutable Matrix2 instance initialized to the identity matrix.\n *\n * @type {Matrix2}\n * @constant\n */\nMatrix2.IDENTITY = Object.freeze(new Matrix2(1.0, 0.0, 0.0, 1.0));\n\n/**\n * An immutable Matrix2 instance initialized to the zero matrix.\n *\n * @type {Matrix2}\n * @constant\n */\nMatrix2.ZERO = Object.freeze(new Matrix2(0.0, 0.0, 0.0, 0.0));\n\n/**\n * The index into Matrix2 for column 0, row 0.\n *\n * @type {number}\n * @constant\n *\n * @example\n * const matrix = new Cesium.Matrix2();\n * matrix[Cesium.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0\n */\nMatrix2.COLUMN0ROW0 = 0;\n\n/**\n * The index into Matrix2 for column 0, row 1.\n *\n * @type {number}\n * @constant\n *\n * @example\n * const matrix = new Cesium.Matrix2();\n * matrix[Cesium.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0\n */\nMatrix2.COLUMN0ROW1 = 1;\n\n/**\n * The index into Matrix2 for column 1, row 0.\n *\n * @type {number}\n * @constant\n *\n * @example\n * const matrix = new Cesium.Matrix2();\n * matrix[Cesium.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0\n */\nMatrix2.COLUMN1ROW0 = 2;\n\n/**\n * The index into Matrix2 for column 1, row 1.\n *\n * @type {number}\n * @constant\n *\n * @example\n * const matrix = new Cesium.Matrix2();\n * matrix[Cesium.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0\n */\nMatrix2.COLUMN1ROW1 = 3;\n\nObject.defineProperties(Matrix2.prototype, {\n  /**\n   * Gets the number of items in the collection.\n   * @memberof Matrix2.prototype\n   *\n   * @type {number}\n   */\n  length: {\n    get: function () {\n      return Matrix2.packedLength;\n    },\n  },\n});\n\n/**\n * Duplicates the provided Matrix2 instance.\n *\n * @param {Matrix2} [result] The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided.\n */\nMatrix2.prototype.clone = function (result) {\n  return Matrix2.clone(this, result);\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Matrix2} [right] The right hand side matrix.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nMatrix2.prototype.equals = function (right) {\n  return Matrix2.equals(this, right);\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Matrix2} [right] The right hand side matrix.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nMatrix2.prototype.equalsEpsilon = function (right, epsilon) {\n  return Matrix2.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Creates a string representing this Matrix with each row being\n * on a separate line and in the format '(column0, column1)'.\n *\n * @returns {string} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1)'.\n */\nMatrix2.prototype.toString = function () {\n  return `(${this[0]}, ${this[2]})\\n` + `(${this[1]}, ${this[3]})`;\n};\nexport default Matrix2;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix2 from \"../Core/Matrix2.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * @private\n * @constructor\n */\nfunction createUniform(gl, activeUniform, uniformName, location) {\n  switch (activeUniform.type) {\n    case gl.FLOAT:\n      return new UniformFloat(gl, activeUniform, uniformName, location);\n    case gl.FLOAT_VEC2:\n      return new UniformFloatVec2(gl, activeUniform, uniformName, location);\n    case gl.FLOAT_VEC3:\n      return new UniformFloatVec3(gl, activeUniform, uniformName, location);\n    case gl.FLOAT_VEC4:\n      return new UniformFloatVec4(gl, activeUniform, uniformName, location);\n    case gl.SAMPLER_2D:\n    case gl.SAMPLER_CUBE:\n      return new UniformSampler(gl, activeUniform, uniformName, location);\n    case gl.INT:\n    case gl.BOOL:\n      return new UniformInt(gl, activeUniform, uniformName, location);\n    case gl.INT_VEC2:\n    case gl.BOOL_VEC2:\n      return new UniformIntVec2(gl, activeUniform, uniformName, location);\n    case gl.INT_VEC3:\n    case gl.BOOL_VEC3:\n      return new UniformIntVec3(gl, activeUniform, uniformName, location);\n    case gl.INT_VEC4:\n    case gl.BOOL_VEC4:\n      return new UniformIntVec4(gl, activeUniform, uniformName, location);\n    case gl.FLOAT_MAT2:\n      return new UniformMat2(gl, activeUniform, uniformName, location);\n    case gl.FLOAT_MAT3:\n      return new UniformMat3(gl, activeUniform, uniformName, location);\n    case gl.FLOAT_MAT4:\n      return new UniformMat4(gl, activeUniform, uniformName, location);\n    default:\n      throw new RuntimeError(\n        `Unrecognized uniform type: ${activeUniform.type} for uniform \"${uniformName}\".`\n      );\n  }\n}\n\n/**\n * @private\n * @constructor\n */\nfunction UniformFloat(gl, activeUniform, uniformName, location) {\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = undefined;\n  this._value = 0.0;\n\n  this._gl = gl;\n  this._location = location;\n}\n\nUniformFloat.prototype.set = function () {\n  if (this.value !== this._value) {\n    this._value = this.value;\n    this._gl.uniform1f(this._location, this.value);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformFloatVec2(gl, activeUniform, uniformName, location) {\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = undefined;\n  this._value = new Cartesian2();\n\n  this._gl = gl;\n  this._location = location;\n}\n\nUniformFloatVec2.prototype.set = function () {\n  const v = this.value;\n  if (!Cartesian2.equals(v, this._value)) {\n    Cartesian2.clone(v, this._value);\n    this._gl.uniform2f(this._location, v.x, v.y);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformFloatVec3(gl, activeUniform, uniformName, location) {\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = undefined;\n  this._value = undefined;\n\n  this._gl = gl;\n  this._location = location;\n}\n\nUniformFloatVec3.prototype.set = function () {\n  const v = this.value;\n\n  if (defined(v.red)) {\n    if (!Color.equals(v, this._value)) {\n      this._value = Color.clone(v, this._value);\n      this._gl.uniform3f(this._location, v.red, v.green, v.blue);\n    }\n  } else if (defined(v.x)) {\n    if (!Cartesian3.equals(v, this._value)) {\n      this._value = Cartesian3.clone(v, this._value);\n      this._gl.uniform3f(this._location, v.x, v.y, v.z);\n    }\n  } else {\n    //>>includeStart('debug', pragmas.debug);\n    throw new DeveloperError(`Invalid vec3 value for uniform \"${this.name}\".`);\n    //>>includeEnd('debug');\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformFloatVec4(gl, activeUniform, uniformName, location) {\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = undefined;\n  this._value = undefined;\n\n  this._gl = gl;\n  this._location = location;\n}\n\nUniformFloatVec4.prototype.set = function () {\n  const v = this.value;\n\n  if (defined(v.red)) {\n    if (!Color.equals(v, this._value)) {\n      this._value = Color.clone(v, this._value);\n      this._gl.uniform4f(this._location, v.red, v.green, v.blue, v.alpha);\n    }\n  } else if (defined(v.x)) {\n    if (!Cartesian4.equals(v, this._value)) {\n      this._value = Cartesian4.clone(v, this._value);\n      this._gl.uniform4f(this._location, v.x, v.y, v.z, v.w);\n    }\n  } else {\n    //>>includeStart('debug', pragmas.debug);\n    throw new DeveloperError(`Invalid vec4 value for uniform \"${this.name}\".`);\n    //>>includeEnd('debug');\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformSampler(gl, activeUniform, uniformName, location) {\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = undefined;\n\n  this._gl = gl;\n  this._location = location;\n\n  this.textureUnitIndex = undefined;\n}\n\nUniformSampler.prototype.set = function () {\n  const gl = this._gl;\n  gl.activeTexture(gl.TEXTURE0 + this.textureUnitIndex);\n\n  const v = this.value;\n  gl.bindTexture(v._target, v._texture);\n};\n\nUniformSampler.prototype._setSampler = function (textureUnitIndex) {\n  this.textureUnitIndex = textureUnitIndex;\n  this._gl.uniform1i(this._location, textureUnitIndex);\n  return textureUnitIndex + 1;\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformInt(gl, activeUniform, uniformName, location) {\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = undefined;\n  this._value = 0.0;\n\n  this._gl = gl;\n  this._location = location;\n}\n\nUniformInt.prototype.set = function () {\n  if (this.value !== this._value) {\n    this._value = this.value;\n    this._gl.uniform1i(this._location, this.value);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n/**\n * @private\n * @constructor\n */\nfunction UniformIntVec2(gl, activeUniform, uniformName, location) {\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = undefined;\n  this._value = new Cartesian2();\n\n  this._gl = gl;\n  this._location = location;\n}\n\nUniformIntVec2.prototype.set = function () {\n  const v = this.value;\n  if (!Cartesian2.equals(v, this._value)) {\n    Cartesian2.clone(v, this._value);\n    this._gl.uniform2i(this._location, v.x, v.y);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n/**\n * @private\n * @constructor\n */\nfunction UniformIntVec3(gl, activeUniform, uniformName, location) {\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = undefined;\n  this._value = new Cartesian3();\n\n  this._gl = gl;\n  this._location = location;\n}\n\nUniformIntVec3.prototype.set = function () {\n  const v = this.value;\n  if (!Cartesian3.equals(v, this._value)) {\n    Cartesian3.clone(v, this._value);\n    this._gl.uniform3i(this._location, v.x, v.y, v.z);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n/**\n * @private\n * @constructor\n */\nfunction UniformIntVec4(gl, activeUniform, uniformName, location) {\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = undefined;\n  this._value = new Cartesian4();\n\n  this._gl = gl;\n  this._location = location;\n}\n\nUniformIntVec4.prototype.set = function () {\n  const v = this.value;\n  if (!Cartesian4.equals(v, this._value)) {\n    Cartesian4.clone(v, this._value);\n    this._gl.uniform4i(this._location, v.x, v.y, v.z, v.w);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\nconst scratchUniformArray = new Float32Array(4);\n/**\n * @private\n * @constructor\n */\nfunction UniformMat2(gl, activeUniform, uniformName, location) {\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = undefined;\n  this._value = new Matrix2();\n\n  this._gl = gl;\n  this._location = location;\n}\n\nUniformMat2.prototype.set = function () {\n  if (!Matrix2.equalsArray(this.value, this._value, 0)) {\n    Matrix2.clone(this.value, this._value);\n\n    const array = Matrix2.toArray(this.value, scratchUniformArray);\n    this._gl.uniformMatrix2fv(this._location, false, array);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\nconst scratchMat3Array = new Float32Array(9);\n/**\n * @private\n * @constructor\n */\nfunction UniformMat3(gl, activeUniform, uniformName, location) {\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = undefined;\n  this._value = new Matrix3();\n\n  this._gl = gl;\n  this._location = location;\n}\n\nUniformMat3.prototype.set = function () {\n  if (!Matrix3.equalsArray(this.value, this._value, 0)) {\n    Matrix3.clone(this.value, this._value);\n\n    const array = Matrix3.toArray(this.value, scratchMat3Array);\n    this._gl.uniformMatrix3fv(this._location, false, array);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\nconst scratchMat4Array = new Float32Array(16);\n/**\n * @private\n * @constructor\n */\nfunction UniformMat4(gl, activeUniform, uniformName, location) {\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = undefined;\n  this._value = new Matrix4();\n\n  this._gl = gl;\n  this._location = location;\n}\n\nUniformMat4.prototype.set = function () {\n  if (!Matrix4.equalsArray(this.value, this._value, 0)) {\n    Matrix4.clone(this.value, this._value);\n\n    const array = Matrix4.toArray(this.value, scratchMat4Array);\n    this._gl.uniformMatrix4fv(this._location, false, array);\n  }\n};\nexport default createUniform;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix2 from \"../Core/Matrix2.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * @private\n * @constructor\n */\nfunction createUniformArray(gl, activeUniform, uniformName, locations) {\n  switch (activeUniform.type) {\n    case gl.FLOAT:\n      return new UniformArrayFloat(gl, activeUniform, uniformName, locations);\n    case gl.FLOAT_VEC2:\n      return new UniformArrayFloatVec2(\n        gl,\n        activeUniform,\n        uniformName,\n        locations\n      );\n    case gl.FLOAT_VEC3:\n      return new UniformArrayFloatVec3(\n        gl,\n        activeUniform,\n        uniformName,\n        locations\n      );\n    case gl.FLOAT_VEC4:\n      return new UniformArrayFloatVec4(\n        gl,\n        activeUniform,\n        uniformName,\n        locations\n      );\n    case gl.SAMPLER_2D:\n    case gl.SAMPLER_CUBE:\n      return new UniformArraySampler(gl, activeUniform, uniformName, locations);\n    case gl.INT:\n    case gl.BOOL:\n      return new UniformArrayInt(gl, activeUniform, uniformName, locations);\n    case gl.INT_VEC2:\n    case gl.BOOL_VEC2:\n      return new UniformArrayIntVec2(gl, activeUniform, uniformName, locations);\n    case gl.INT_VEC3:\n    case gl.BOOL_VEC3:\n      return new UniformArrayIntVec3(gl, activeUniform, uniformName, locations);\n    case gl.INT_VEC4:\n    case gl.BOOL_VEC4:\n      return new UniformArrayIntVec4(gl, activeUniform, uniformName, locations);\n    case gl.FLOAT_MAT2:\n      return new UniformArrayMat2(gl, activeUniform, uniformName, locations);\n    case gl.FLOAT_MAT3:\n      return new UniformArrayMat3(gl, activeUniform, uniformName, locations);\n    case gl.FLOAT_MAT4:\n      return new UniformArrayMat4(gl, activeUniform, uniformName, locations);\n    default:\n      throw new RuntimeError(\n        `Unrecognized uniform type: ${activeUniform.type} for uniform \"${uniformName}\".`\n      );\n  }\n}\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayFloat(gl, activeUniform, uniformName, locations) {\n  const length = locations.length;\n\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = new Array(length);\n  this._value = new Float32Array(length);\n\n  this._gl = gl;\n  this._location = locations[0];\n}\n\nUniformArrayFloat.prototype.set = function () {\n  const value = this.value;\n  const length = value.length;\n  const arraybuffer = this._value;\n  let changed = false;\n\n  for (let i = 0; i < length; ++i) {\n    const v = value[i];\n\n    if (v !== arraybuffer[i]) {\n      arraybuffer[i] = v;\n      changed = true;\n    }\n  }\n\n  if (changed) {\n    this._gl.uniform1fv(this._location, arraybuffer);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayFloatVec2(gl, activeUniform, uniformName, locations) {\n  const length = locations.length;\n\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = new Array(length);\n  this._value = new Float32Array(length * 2);\n\n  this._gl = gl;\n  this._location = locations[0];\n}\n\nUniformArrayFloatVec2.prototype.set = function () {\n  const value = this.value;\n  const length = value.length;\n  const arraybuffer = this._value;\n  let changed = false;\n  let j = 0;\n\n  for (let i = 0; i < length; ++i) {\n    const v = value[i];\n\n    if (!Cartesian2.equalsArray(v, arraybuffer, j)) {\n      Cartesian2.pack(v, arraybuffer, j);\n      changed = true;\n    }\n    j += 2;\n  }\n\n  if (changed) {\n    this._gl.uniform2fv(this._location, arraybuffer);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayFloatVec3(gl, activeUniform, uniformName, locations) {\n  const length = locations.length;\n\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = new Array(length);\n  this._value = new Float32Array(length * 3);\n\n  this._gl = gl;\n  this._location = locations[0];\n}\n\nUniformArrayFloatVec3.prototype.set = function () {\n  const value = this.value;\n  const length = value.length;\n  const arraybuffer = this._value;\n  let changed = false;\n  let j = 0;\n\n  for (let i = 0; i < length; ++i) {\n    const v = value[i];\n\n    if (defined(v.red)) {\n      if (\n        v.red !== arraybuffer[j] ||\n        v.green !== arraybuffer[j + 1] ||\n        v.blue !== arraybuffer[j + 2]\n      ) {\n        arraybuffer[j] = v.red;\n        arraybuffer[j + 1] = v.green;\n        arraybuffer[j + 2] = v.blue;\n        changed = true;\n      }\n    } else if (defined(v.x)) {\n      if (!Cartesian3.equalsArray(v, arraybuffer, j)) {\n        Cartesian3.pack(v, arraybuffer, j);\n        changed = true;\n      }\n    } else {\n      //>>includeStart('debug', pragmas.debug);\n      throw new DeveloperError(\"Invalid vec3 value.\");\n      //>>includeEnd('debug');\n    }\n\n    j += 3;\n  }\n\n  if (changed) {\n    this._gl.uniform3fv(this._location, arraybuffer);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayFloatVec4(gl, activeUniform, uniformName, locations) {\n  const length = locations.length;\n\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = new Array(length);\n  this._value = new Float32Array(length * 4);\n\n  this._gl = gl;\n  this._location = locations[0];\n}\n\nUniformArrayFloatVec4.prototype.set = function () {\n  // PERFORMANCE_IDEA: if it is a common case that only a few elements\n  // in a uniform array change, we could use heuristics to determine\n  // when it is better to call uniform4f for each element that changed\n  // vs. call uniform4fv once to set the entire array.  This applies\n  // to all uniform array types, not just vec4.  We might not care\n  // once we have uniform buffers since that will be the fast path.\n\n  // PERFORMANCE_IDEA: Micro-optimization (I bet it works though):\n  // As soon as changed is true, break into a separate loop that\n  // does the copy without the equals check.\n\n  const value = this.value;\n  const length = value.length;\n  const arraybuffer = this._value;\n  let changed = false;\n  let j = 0;\n\n  for (let i = 0; i < length; ++i) {\n    const v = value[i];\n\n    if (defined(v.red)) {\n      if (!Color.equalsArray(v, arraybuffer, j)) {\n        Color.pack(v, arraybuffer, j);\n        changed = true;\n      }\n    } else if (defined(v.x)) {\n      if (!Cartesian4.equalsArray(v, arraybuffer, j)) {\n        Cartesian4.pack(v, arraybuffer, j);\n        changed = true;\n      }\n    } else {\n      //>>includeStart('debug', pragmas.debug);\n      throw new DeveloperError(\"Invalid vec4 value.\");\n      //>>includeEnd('debug');\n    }\n\n    j += 4;\n  }\n\n  if (changed) {\n    this._gl.uniform4fv(this._location, arraybuffer);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArraySampler(gl, activeUniform, uniformName, locations) {\n  const length = locations.length;\n\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = new Array(length);\n  this._value = new Float32Array(length);\n\n  this._gl = gl;\n  this._locations = locations;\n\n  this.textureUnitIndex = undefined;\n}\n\nUniformArraySampler.prototype.set = function () {\n  const gl = this._gl;\n  const textureUnitIndex = gl.TEXTURE0 + this.textureUnitIndex;\n\n  const value = this.value;\n  const length = value.length;\n  for (let i = 0; i < length; ++i) {\n    const v = value[i];\n    gl.activeTexture(textureUnitIndex + i);\n    gl.bindTexture(v._target, v._texture);\n  }\n};\n\nUniformArraySampler.prototype._setSampler = function (textureUnitIndex) {\n  this.textureUnitIndex = textureUnitIndex;\n\n  const locations = this._locations;\n  const length = locations.length;\n  for (let i = 0; i < length; ++i) {\n    const index = textureUnitIndex + i;\n    this._gl.uniform1i(locations[i], index);\n  }\n\n  return textureUnitIndex + length;\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayInt(gl, activeUniform, uniformName, locations) {\n  const length = locations.length;\n\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = new Array(length);\n  this._value = new Int32Array(length);\n\n  this._gl = gl;\n  this._location = locations[0];\n}\n\nUniformArrayInt.prototype.set = function () {\n  const value = this.value;\n  const length = value.length;\n  const arraybuffer = this._value;\n  let changed = false;\n\n  for (let i = 0; i < length; ++i) {\n    const v = value[i];\n\n    if (v !== arraybuffer[i]) {\n      arraybuffer[i] = v;\n      changed = true;\n    }\n  }\n\n  if (changed) {\n    this._gl.uniform1iv(this._location, arraybuffer);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayIntVec2(gl, activeUniform, uniformName, locations) {\n  const length = locations.length;\n\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = new Array(length);\n  this._value = new Int32Array(length * 2);\n\n  this._gl = gl;\n  this._location = locations[0];\n}\n\nUniformArrayIntVec2.prototype.set = function () {\n  const value = this.value;\n  const length = value.length;\n  const arraybuffer = this._value;\n  let changed = false;\n  let j = 0;\n\n  for (let i = 0; i < length; ++i) {\n    const v = value[i];\n\n    if (!Cartesian2.equalsArray(v, arraybuffer, j)) {\n      Cartesian2.pack(v, arraybuffer, j);\n      changed = true;\n    }\n    j += 2;\n  }\n\n  if (changed) {\n    this._gl.uniform2iv(this._location, arraybuffer);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayIntVec3(gl, activeUniform, uniformName, locations) {\n  const length = locations.length;\n\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = new Array(length);\n  this._value = new Int32Array(length * 3);\n\n  this._gl = gl;\n  this._location = locations[0];\n}\n\nUniformArrayIntVec3.prototype.set = function () {\n  const value = this.value;\n  const length = value.length;\n  const arraybuffer = this._value;\n  let changed = false;\n  let j = 0;\n\n  for (let i = 0; i < length; ++i) {\n    const v = value[i];\n\n    if (!Cartesian3.equalsArray(v, arraybuffer, j)) {\n      Cartesian3.pack(v, arraybuffer, j);\n      changed = true;\n    }\n    j += 3;\n  }\n\n  if (changed) {\n    this._gl.uniform3iv(this._location, arraybuffer);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayIntVec4(gl, activeUniform, uniformName, locations) {\n  const length = locations.length;\n\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = new Array(length);\n  this._value = new Int32Array(length * 4);\n\n  this._gl = gl;\n  this._location = locations[0];\n}\n\nUniformArrayIntVec4.prototype.set = function () {\n  const value = this.value;\n  const length = value.length;\n  const arraybuffer = this._value;\n  let changed = false;\n  let j = 0;\n\n  for (let i = 0; i < length; ++i) {\n    const v = value[i];\n\n    if (!Cartesian4.equalsArray(v, arraybuffer, j)) {\n      Cartesian4.pack(v, arraybuffer, j);\n      changed = true;\n    }\n    j += 4;\n  }\n\n  if (changed) {\n    this._gl.uniform4iv(this._location, arraybuffer);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayMat2(gl, activeUniform, uniformName, locations) {\n  const length = locations.length;\n\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = new Array(length);\n  this._value = new Float32Array(length * 4);\n\n  this._gl = gl;\n  this._location = locations[0];\n}\n\nUniformArrayMat2.prototype.set = function () {\n  const value = this.value;\n  const length = value.length;\n  const arraybuffer = this._value;\n  let changed = false;\n  let j = 0;\n\n  for (let i = 0; i < length; ++i) {\n    const v = value[i];\n\n    if (!Matrix2.equalsArray(v, arraybuffer, j)) {\n      Matrix2.pack(v, arraybuffer, j);\n      changed = true;\n    }\n    j += 4;\n  }\n\n  if (changed) {\n    this._gl.uniformMatrix2fv(this._location, false, arraybuffer);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayMat3(gl, activeUniform, uniformName, locations) {\n  const length = locations.length;\n\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = new Array(length);\n  this._value = new Float32Array(length * 9);\n\n  this._gl = gl;\n  this._location = locations[0];\n}\n\nUniformArrayMat3.prototype.set = function () {\n  const value = this.value;\n  const length = value.length;\n  const arraybuffer = this._value;\n  let changed = false;\n  let j = 0;\n\n  for (let i = 0; i < length; ++i) {\n    const v = value[i];\n\n    if (!Matrix3.equalsArray(v, arraybuffer, j)) {\n      Matrix3.pack(v, arraybuffer, j);\n      changed = true;\n    }\n    j += 9;\n  }\n\n  if (changed) {\n    this._gl.uniformMatrix3fv(this._location, false, arraybuffer);\n  }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayMat4(gl, activeUniform, uniformName, locations) {\n  const length = locations.length;\n\n  /**\n   * @type {string}\n   * @readonly\n   */\n  this.name = uniformName;\n\n  this.value = new Array(length);\n  this._value = new Float32Array(length * 16);\n\n  this._gl = gl;\n  this._location = locations[0];\n}\n\nUniformArrayMat4.prototype.set = function () {\n  const value = this.value;\n  const length = value.length;\n  const arraybuffer = this._value;\n  let changed = false;\n  let j = 0;\n\n  for (let i = 0; i < length; ++i) {\n    const v = value[i];\n\n    if (!Matrix4.equalsArray(v, arraybuffer, j)) {\n      Matrix4.pack(v, arraybuffer, j);\n      changed = true;\n    }\n    j += 16;\n  }\n\n  if (changed) {\n    this._gl.uniformMatrix4fv(this._location, false, arraybuffer);\n  }\n};\nexport default createUniformArray;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport AutomaticUniforms from \"./AutomaticUniforms.js\";\nimport ContextLimits from \"./ContextLimits.js\";\nimport createUniform from \"./createUniform.js\";\nimport createUniformArray from \"./createUniformArray.js\";\n\nlet nextShaderProgramId = 0;\n\n/**\n * @private\n */\nfunction ShaderProgram(options) {\n  let vertexShaderText = options.vertexShaderText;\n  let fragmentShaderText = options.fragmentShaderText;\n\n  if (typeof spector !== \"undefined\") {\n    // The #line statements common in Cesium shaders interfere with the ability of the\n    // SpectorJS to show errors on the correct line. So remove them when SpectorJS\n    // is active.\n    vertexShaderText = vertexShaderText.replace(/^#line/gm, \"//#line\");\n    fragmentShaderText = fragmentShaderText.replace(/^#line/gm, \"//#line\");\n  }\n\n  const modifiedFS = handleUniformPrecisionMismatches(\n    vertexShaderText,\n    fragmentShaderText\n  );\n\n  this._gl = options.gl;\n  this._logShaderCompilation = options.logShaderCompilation;\n  this._debugShaders = options.debugShaders;\n  this._attributeLocations = options.attributeLocations;\n\n  this._program = undefined;\n  this._numberOfVertexAttributes = undefined;\n  this._vertexAttributes = undefined;\n  this._uniformsByName = undefined;\n  this._uniforms = undefined;\n  this._automaticUniforms = undefined;\n  this._manualUniforms = undefined;\n  this._duplicateUniformNames = modifiedFS.duplicateUniformNames;\n  this._cachedShader = undefined; // Used by ShaderCache\n\n  /**\n   * @private\n   */\n  this.maximumTextureUnitIndex = undefined;\n\n  this._vertexShaderSource = options.vertexShaderSource;\n  this._vertexShaderText = options.vertexShaderText;\n  this._fragmentShaderSource = options.fragmentShaderSource;\n  this._fragmentShaderText = modifiedFS.fragmentShaderText;\n\n  /**\n   * @private\n   */\n  this.id = nextShaderProgramId++;\n}\n\nShaderProgram.fromCache = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.context\", options.context);\n  //>>includeEnd('debug');\n\n  return options.context.shaderCache.getShaderProgram(options);\n};\n\nShaderProgram.replaceCache = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.context\", options.context);\n  //>>includeEnd('debug');\n\n  return options.context.shaderCache.replaceShaderProgram(options);\n};\n\nObject.defineProperties(ShaderProgram.prototype, {\n  /**\n   * GLSL source for the shader program's vertex shader.\n   * @memberof ShaderProgram.prototype\n   *\n   * @type {ShaderSource}\n   * @readonly\n   */\n  vertexShaderSource: {\n    get: function () {\n      return this._vertexShaderSource;\n    },\n  },\n  /**\n   * GLSL source for the shader program's fragment shader.\n   * @memberof ShaderProgram.prototype\n   *\n   * @type {ShaderSource}\n   * @readonly\n   */\n  fragmentShaderSource: {\n    get: function () {\n      return this._fragmentShaderSource;\n    },\n  },\n  vertexAttributes: {\n    get: function () {\n      initialize(this);\n      return this._vertexAttributes;\n    },\n  },\n  numberOfVertexAttributes: {\n    get: function () {\n      initialize(this);\n      return this._numberOfVertexAttributes;\n    },\n  },\n  allUniforms: {\n    get: function () {\n      initialize(this);\n      return this._uniformsByName;\n    },\n  },\n});\n\nfunction extractUniforms(shaderText) {\n  const uniformNames = [];\n  const uniformLines = shaderText.match(/uniform.*?(?![^{]*})(?=[=\\[;])/g);\n  if (defined(uniformLines)) {\n    const len = uniformLines.length;\n    for (let i = 0; i < len; i++) {\n      const line = uniformLines[i].trim();\n      const name = line.slice(line.lastIndexOf(\" \") + 1);\n      uniformNames.push(name);\n    }\n  }\n  return uniformNames;\n}\n\nfunction handleUniformPrecisionMismatches(\n  vertexShaderText,\n  fragmentShaderText\n) {\n  // If a uniform exists in both the vertex and fragment shader but with different precision qualifiers,\n  // give the fragment shader uniform a different name. This fixes shader compilation errors on devices\n  // that only support mediump in the fragment shader.\n  const duplicateUniformNames = {};\n\n  if (!ContextLimits.highpFloatSupported || !ContextLimits.highpIntSupported) {\n    let i, j;\n    let uniformName;\n    let duplicateName;\n    const vertexShaderUniforms = extractUniforms(vertexShaderText);\n    const fragmentShaderUniforms = extractUniforms(fragmentShaderText);\n    const vertexUniformsCount = vertexShaderUniforms.length;\n    const fragmentUniformsCount = fragmentShaderUniforms.length;\n\n    for (i = 0; i < vertexUniformsCount; i++) {\n      for (j = 0; j < fragmentUniformsCount; j++) {\n        if (vertexShaderUniforms[i] === fragmentShaderUniforms[j]) {\n          uniformName = vertexShaderUniforms[i];\n          duplicateName = `czm_mediump_${uniformName}`;\n          // Update fragmentShaderText with renamed uniforms\n          const re = new RegExp(`${uniformName}\\\\b`, \"g\");\n          fragmentShaderText = fragmentShaderText.replace(re, duplicateName);\n          duplicateUniformNames[duplicateName] = uniformName;\n        }\n      }\n    }\n  }\n\n  return {\n    fragmentShaderText: fragmentShaderText,\n    duplicateUniformNames: duplicateUniformNames,\n  };\n}\n\nconst consolePrefix = \"[Cesium WebGL] \";\n\nfunction createAndLinkProgram(gl, shader) {\n  const vsSource = shader._vertexShaderText;\n  const fsSource = shader._fragmentShaderText;\n\n  const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n  gl.shaderSource(vertexShader, vsSource);\n  gl.compileShader(vertexShader);\n\n  const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n  gl.shaderSource(fragmentShader, fsSource);\n  gl.compileShader(fragmentShader);\n\n  const program = gl.createProgram();\n  gl.attachShader(program, vertexShader);\n  gl.attachShader(program, fragmentShader);\n\n  const attributeLocations = shader._attributeLocations;\n  if (defined(attributeLocations)) {\n    for (const attribute in attributeLocations) {\n      if (attributeLocations.hasOwnProperty(attribute)) {\n        gl.bindAttribLocation(\n          program,\n          attributeLocations[attribute],\n          attribute\n        );\n      }\n    }\n  }\n\n  gl.linkProgram(program);\n  let log;\n\n  // For performance: if linker succeeds, return without checking compile status\n  if (gl.getProgramParameter(program, gl.LINK_STATUS)) {\n    if (shader._logShaderCompilation) {\n      log = gl.getShaderInfoLog(vertexShader);\n      if (defined(log) && log.length > 0) {\n        console.log(`${consolePrefix}Vertex shader compile log: ${log}`);\n      }\n\n      log = gl.getShaderInfoLog(fragmentShader);\n      if (defined(log) && log.length > 0) {\n        console.log(`${consolePrefix}Fragment shader compile log: ${log}`);\n      }\n\n      log = gl.getProgramInfoLog(program);\n      if (defined(log) && log.length > 0) {\n        console.log(`${consolePrefix}Shader program link log: ${log}`);\n      }\n    }\n\n    gl.deleteShader(vertexShader);\n    gl.deleteShader(fragmentShader);\n\n    return program;\n  }\n\n  // Program failed to link. Try to find and report the reason\n  let errorMessage;\n  const debugShaders = shader._debugShaders;\n\n  if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {\n    log = gl.getShaderInfoLog(fragmentShader);\n    console.error(`${consolePrefix}Fragment shader compile log: ${log}`);\n    console.error(`${consolePrefix} Fragment shader source:\\n${fsSource}`);\n    errorMessage = `Fragment shader failed to compile.  Compile log: ${log}`;\n  } else if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {\n    log = gl.getShaderInfoLog(vertexShader);\n    console.error(`${consolePrefix}Vertex shader compile log: ${log}`);\n    console.error(`${consolePrefix} Vertex shader source:\\n${vsSource}`);\n    errorMessage = `Vertex shader failed to compile.  Compile log: ${log}`;\n  } else {\n    log = gl.getProgramInfoLog(program);\n    console.error(`${consolePrefix}Shader program link log: ${log}`);\n    logTranslatedSource(vertexShader, \"vertex\");\n    logTranslatedSource(fragmentShader, \"fragment\");\n    errorMessage = `Program failed to link.  Link log: ${log}`;\n  }\n\n  gl.deleteShader(vertexShader);\n  gl.deleteShader(fragmentShader);\n  gl.deleteProgram(program);\n  throw new RuntimeError(errorMessage);\n\n  function logTranslatedSource(compiledShader, name) {\n    if (!defined(debugShaders)) {\n      return;\n    }\n    const translation = debugShaders.getTranslatedShaderSource(compiledShader);\n    if (translation === \"\") {\n      console.error(`${consolePrefix}${name} shader translation failed.`);\n      return;\n    }\n    console.error(\n      `${consolePrefix}Translated ${name} shaderSource:\\n${translation}`\n    );\n  }\n}\n\nfunction findVertexAttributes(gl, program, numberOfAttributes) {\n  const attributes = {};\n  for (let i = 0; i < numberOfAttributes; ++i) {\n    const attr = gl.getActiveAttrib(program, i);\n    const location = gl.getAttribLocation(program, attr.name);\n\n    attributes[attr.name] = {\n      name: attr.name,\n      type: attr.type,\n      index: location,\n    };\n  }\n\n  return attributes;\n}\n\nfunction findUniforms(gl, program) {\n  const uniformsByName = {};\n  const uniforms = [];\n  const samplerUniforms = [];\n\n  const numberOfUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n\n  for (let i = 0; i < numberOfUniforms; ++i) {\n    const activeUniform = gl.getActiveUniform(program, i);\n    const suffix = \"[0]\";\n    const uniformName =\n      activeUniform.name.indexOf(\n        suffix,\n        activeUniform.name.length - suffix.length\n      ) !== -1\n        ? activeUniform.name.slice(0, activeUniform.name.length - 3)\n        : activeUniform.name;\n\n    // Ignore GLSL built-in uniforms returned in Firefox.\n    if (uniformName.indexOf(\"gl_\") !== 0) {\n      if (activeUniform.name.indexOf(\"[\") < 0) {\n        // Single uniform\n        const location = gl.getUniformLocation(program, uniformName);\n\n        // IE 11.0.9 needs this check since getUniformLocation can return null\n        // if the uniform is not active (e.g., it is optimized out).  Looks like\n        // getActiveUniform() above returns uniforms that are not actually active.\n        if (location !== null) {\n          const uniform = createUniform(\n            gl,\n            activeUniform,\n            uniformName,\n            location\n          );\n\n          uniformsByName[uniformName] = uniform;\n          uniforms.push(uniform);\n\n          if (uniform._setSampler) {\n            samplerUniforms.push(uniform);\n          }\n        }\n      } else {\n        // Uniform array\n\n        let uniformArray;\n        let locations;\n        let value;\n        let loc;\n\n        // On some platforms - Nexus 4 in Firefox for one - an array of sampler2D ends up being represented\n        // as separate uniforms, one for each array element.  Check for and handle that case.\n        const indexOfBracket = uniformName.indexOf(\"[\");\n        if (indexOfBracket >= 0) {\n          // We're assuming the array elements show up in numerical order - it seems to be true.\n          uniformArray = uniformsByName[uniformName.slice(0, indexOfBracket)];\n\n          // Nexus 4 with Android 4.3 needs this check, because it reports a uniform\n          // with the strange name webgl_3467e0265d05c3c1[1] in our globe surface shader.\n          if (!defined(uniformArray)) {\n            continue;\n          }\n\n          locations = uniformArray._locations;\n\n          // On the Nexus 4 in Chrome, we get one uniform per sampler, just like in Firefox,\n          // but the size is not 1 like it is in Firefox.  So if we push locations here,\n          // we'll end up adding too many locations.\n          if (locations.length <= 1) {\n            value = uniformArray.value;\n            loc = gl.getUniformLocation(program, uniformName);\n\n            // Workaround for IE 11.0.9.  See above.\n            if (loc !== null) {\n              locations.push(loc);\n              value.push(gl.getUniform(program, loc));\n            }\n          }\n        } else {\n          locations = [];\n          for (let j = 0; j < activeUniform.size; ++j) {\n            loc = gl.getUniformLocation(program, `${uniformName}[${j}]`);\n\n            // Workaround for IE 11.0.9.  See above.\n            if (loc !== null) {\n              locations.push(loc);\n            }\n          }\n          uniformArray = createUniformArray(\n            gl,\n            activeUniform,\n            uniformName,\n            locations\n          );\n\n          uniformsByName[uniformName] = uniformArray;\n          uniforms.push(uniformArray);\n\n          if (uniformArray._setSampler) {\n            samplerUniforms.push(uniformArray);\n          }\n        }\n      }\n    }\n  }\n\n  return {\n    uniformsByName: uniformsByName,\n    uniforms: uniforms,\n    samplerUniforms: samplerUniforms,\n  };\n}\n\nfunction partitionUniforms(shader, uniforms) {\n  const automaticUniforms = [];\n  const manualUniforms = [];\n\n  for (const uniform in uniforms) {\n    if (uniforms.hasOwnProperty(uniform)) {\n      const uniformObject = uniforms[uniform];\n      let uniformName = uniform;\n      // if it's a duplicate uniform, use its original name so it is updated correctly\n      const duplicateUniform = shader._duplicateUniformNames[uniformName];\n      if (defined(duplicateUniform)) {\n        uniformObject.name = duplicateUniform;\n        uniformName = duplicateUniform;\n      }\n      const automaticUniform = AutomaticUniforms[uniformName];\n      if (defined(automaticUniform)) {\n        automaticUniforms.push({\n          uniform: uniformObject,\n          automaticUniform: automaticUniform,\n        });\n      } else {\n        manualUniforms.push(uniformObject);\n      }\n    }\n  }\n\n  return {\n    automaticUniforms: automaticUniforms,\n    manualUniforms: manualUniforms,\n  };\n}\n\nfunction setSamplerUniforms(gl, program, samplerUniforms) {\n  gl.useProgram(program);\n\n  let textureUnitIndex = 0;\n  const length = samplerUniforms.length;\n  for (let i = 0; i < length; ++i) {\n    textureUnitIndex = samplerUniforms[i]._setSampler(textureUnitIndex);\n  }\n\n  gl.useProgram(null);\n\n  return textureUnitIndex;\n}\n\nfunction initialize(shader) {\n  if (defined(shader._program)) {\n    return;\n  }\n\n  reinitialize(shader);\n}\n\nfunction reinitialize(shader) {\n  const oldProgram = shader._program;\n\n  const gl = shader._gl;\n  const program = createAndLinkProgram(gl, shader, shader._debugShaders);\n  const numberOfVertexAttributes = gl.getProgramParameter(\n    program,\n    gl.ACTIVE_ATTRIBUTES\n  );\n  const uniforms = findUniforms(gl, program);\n  const partitionedUniforms = partitionUniforms(\n    shader,\n    uniforms.uniformsByName\n  );\n\n  shader._program = program;\n  shader._numberOfVertexAttributes = numberOfVertexAttributes;\n  shader._vertexAttributes = findVertexAttributes(\n    gl,\n    program,\n    numberOfVertexAttributes\n  );\n  shader._uniformsByName = uniforms.uniformsByName;\n  shader._uniforms = uniforms.uniforms;\n  shader._automaticUniforms = partitionedUniforms.automaticUniforms;\n  shader._manualUniforms = partitionedUniforms.manualUniforms;\n\n  shader.maximumTextureUnitIndex = setSamplerUniforms(\n    gl,\n    program,\n    uniforms.samplerUniforms\n  );\n\n  if (oldProgram) {\n    shader._gl.deleteProgram(oldProgram);\n  }\n\n  // If SpectorJS is active, add the hook to make the shader editor work.\n  // https://github.com/BabylonJS/Spector.js/blob/master/documentation/extension.md#shader-editor\n  if (typeof spector !== \"undefined\") {\n    shader._program.__SPECTOR_rebuildProgram = function (\n      vertexSourceCode, // The new vertex shader source\n      fragmentSourceCode, // The new fragment shader source\n      onCompiled, // Callback triggered by your engine when the compilation is successful. It needs to send back the new linked program.\n      onError // Callback triggered by your engine in case of error. It needs to send the WebGL error to allow the editor to display the error in the gutter.\n    ) {\n      const originalVS = shader._vertexShaderText;\n      const originalFS = shader._fragmentShaderText;\n\n      // SpectorJS likes to replace `!=` with `! =` for unknown reasons,\n      // and that causes glsl compile failures. So fix that up.\n      const regex = / ! = /g;\n      shader._vertexShaderText = vertexSourceCode.replace(regex, \" != \");\n      shader._fragmentShaderText = fragmentSourceCode.replace(regex, \" != \");\n\n      try {\n        reinitialize(shader);\n        onCompiled(shader._program);\n      } catch (e) {\n        shader._vertexShaderText = originalVS;\n        shader._fragmentShaderText = originalFS;\n\n        // Only pass on the WebGL error:\n        const errorMatcher = /(?:Compile|Link) error: ([^]*)/;\n        const match = errorMatcher.exec(e.message);\n        if (match) {\n          onError(match[1]);\n        } else {\n          onError(e.message);\n        }\n      }\n    };\n  }\n}\n\nShaderProgram.prototype._bind = function () {\n  initialize(this);\n  this._gl.useProgram(this._program);\n};\n\nShaderProgram.prototype._setUniforms = function (\n  uniformMap,\n  uniformState,\n  validate\n) {\n  let len;\n  let i;\n\n  if (defined(uniformMap)) {\n    const manualUniforms = this._manualUniforms;\n    len = manualUniforms.length;\n    for (i = 0; i < len; ++i) {\n      const mu = manualUniforms[i];\n      mu.value = uniformMap[mu.name]();\n    }\n  }\n\n  const automaticUniforms = this._automaticUniforms;\n  len = automaticUniforms.length;\n  for (i = 0; i < len; ++i) {\n    const au = automaticUniforms[i];\n    au.uniform.value = au.automaticUniform.getValue(uniformState);\n  }\n\n  ///////////////////////////////////////////////////////////////////\n\n  // It appears that assigning the uniform values above and then setting them here\n  // (which makes the GL calls) is faster than removing this loop and making\n  // the GL calls above.  I suspect this is because each GL call pollutes the\n  // L2 cache making our JavaScript and the browser/driver ping-pong cache lines.\n  const uniforms = this._uniforms;\n  len = uniforms.length;\n  for (i = 0; i < len; ++i) {\n    uniforms[i].set();\n  }\n\n  if (validate) {\n    const gl = this._gl;\n    const program = this._program;\n\n    gl.validateProgram(program);\n    //>>includeStart('debug', pragmas.debug);\n    if (!gl.getProgramParameter(program, gl.VALIDATE_STATUS)) {\n      throw new DeveloperError(\n        `Program validation failed.  Program info log: ${gl.getProgramInfoLog(\n          program\n        )}`\n      );\n    }\n    //>>includeEnd('debug');\n  }\n};\n\nShaderProgram.prototype.isDestroyed = function () {\n  return false;\n};\n\nShaderProgram.prototype.destroy = function () {\n  this._cachedShader.cache.releaseShaderProgram(this);\n  return undefined;\n};\n\nShaderProgram.prototype.finalDestroy = function () {\n  this._gl.deleteProgram(this._program);\n  return destroyObject(this);\n};\nexport default ShaderProgram;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport ViewportQuadVS from \"../Shaders/ViewportQuadVS.js\";\nimport ClearCommand from \"./ClearCommand.js\";\nimport DrawCommand from \"./DrawCommand.js\";\nimport Framebuffer from \"./Framebuffer.js\";\nimport RenderState from \"./RenderState.js\";\nimport ShaderProgram from \"./ShaderProgram.js\";\n\n/**\n * @private\n */\nfunction ComputeEngine(context) {\n  this._context = context;\n}\n\nlet renderStateScratch;\nconst drawCommandScratch = new DrawCommand({\n  primitiveType: PrimitiveType.TRIANGLES,\n});\nconst clearCommandScratch = new ClearCommand({\n  color: new Color(0.0, 0.0, 0.0, 0.0),\n});\n\nfunction createFramebuffer(context, outputTexture) {\n  return new Framebuffer({\n    context: context,\n    colorTextures: [outputTexture],\n    destroyAttachments: false,\n  });\n}\n\nfunction createViewportQuadShader(context, fragmentShaderSource) {\n  return ShaderProgram.fromCache({\n    context: context,\n    vertexShaderSource: ViewportQuadVS,\n    fragmentShaderSource: fragmentShaderSource,\n    attributeLocations: {\n      position: 0,\n      textureCoordinates: 1,\n    },\n  });\n}\n\nfunction createRenderState(width, height) {\n  if (\n    !defined(renderStateScratch) ||\n    renderStateScratch.viewport.width !== width ||\n    renderStateScratch.viewport.height !== height\n  ) {\n    renderStateScratch = RenderState.fromCache({\n      viewport: new BoundingRectangle(0, 0, width, height),\n    });\n  }\n  return renderStateScratch;\n}\n\nComputeEngine.prototype.execute = function (computeCommand) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"computeCommand\", computeCommand);\n  //>>includeEnd('debug');\n\n  // This may modify the command's resources, so do error checking afterwards\n  if (defined(computeCommand.preExecute)) {\n    computeCommand.preExecute(computeCommand);\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    !defined(computeCommand.fragmentShaderSource) &&\n    !defined(computeCommand.shaderProgram)\n  ) {\n    throw new DeveloperError(\n      \"computeCommand.fragmentShaderSource or computeCommand.shaderProgram is required.\"\n    );\n  }\n\n  Check.defined(\"computeCommand.outputTexture\", computeCommand.outputTexture);\n  //>>includeEnd('debug');\n\n  const outputTexture = computeCommand.outputTexture;\n  const width = outputTexture.width;\n  const height = outputTexture.height;\n\n  const context = this._context;\n  const vertexArray = defined(computeCommand.vertexArray)\n    ? computeCommand.vertexArray\n    : context.getViewportQuadVertexArray();\n  const shaderProgram = defined(computeCommand.shaderProgram)\n    ? computeCommand.shaderProgram\n    : createViewportQuadShader(context, computeCommand.fragmentShaderSource);\n  const framebuffer = createFramebuffer(context, outputTexture);\n  const renderState = createRenderState(width, height);\n  const uniformMap = computeCommand.uniformMap;\n\n  const clearCommand = clearCommandScratch;\n  clearCommand.framebuffer = framebuffer;\n  clearCommand.renderState = renderState;\n  clearCommand.execute(context);\n\n  const drawCommand = drawCommandScratch;\n  drawCommand.vertexArray = vertexArray;\n  drawCommand.renderState = renderState;\n  drawCommand.shaderProgram = shaderProgram;\n  drawCommand.uniformMap = uniformMap;\n  drawCommand.framebuffer = framebuffer;\n  drawCommand.execute(context);\n\n  framebuffer.destroy();\n\n  if (!computeCommand.persists) {\n    shaderProgram.destroy();\n    if (defined(computeCommand.vertexArray)) {\n      vertexArray.destroy();\n    }\n  }\n\n  if (defined(computeCommand.postExecute)) {\n    computeCommand.postExecute(outputTexture);\n  }\n};\n\nComputeEngine.prototype.isDestroyed = function () {\n  return false;\n};\n\nComputeEngine.prototype.destroy = function () {\n  return destroyObject(this);\n};\nexport default ComputeEngine;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport WebGLConstants from \"./WebGLConstants.js\";\n\n/**\n * WebGL component datatypes.  Components are intrinsics,\n * which form attributes, which form vertices.\n *\n * @enum {number}\n */\nconst ComponentDatatype = {\n  /**\n   * 8-bit signed byte corresponding to <code>gl.BYTE</code> and the type\n   * of an element in <code>Int8Array</code>.\n   *\n   * @type {number}\n   * @constant\n   */\n  BYTE: WebGLConstants.BYTE,\n\n  /**\n   * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type\n   * of an element in <code>Uint8Array</code>.\n   *\n   * @type {number}\n   * @constant\n   */\n  UNSIGNED_BYTE: WebGLConstants.UNSIGNED_BYTE,\n\n  /**\n   * 16-bit signed short corresponding to <code>SHORT</code> and the type\n   * of an element in <code>Int16Array</code>.\n   *\n   * @type {number}\n   * @constant\n   */\n  SHORT: WebGLConstants.SHORT,\n\n  /**\n   * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type\n   * of an element in <code>Uint16Array</code>.\n   *\n   * @type {number}\n   * @constant\n   */\n  UNSIGNED_SHORT: WebGLConstants.UNSIGNED_SHORT,\n\n  /**\n   * 32-bit signed int corresponding to <code>INT</code> and the type\n   * of an element in <code>Int32Array</code>.\n   *\n   * @memberOf ComponentDatatype\n   *\n   * @type {number}\n   * @constant\n   */\n  INT: WebGLConstants.INT,\n\n  /**\n   * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type\n   * of an element in <code>Uint32Array</code>.\n   *\n   * @memberOf ComponentDatatype\n   *\n   * @type {number}\n   * @constant\n   */\n  UNSIGNED_INT: WebGLConstants.UNSIGNED_INT,\n\n  /**\n   * 32-bit floating-point corresponding to <code>FLOAT</code> and the type\n   * of an element in <code>Float32Array</code>.\n   *\n   * @type {number}\n   * @constant\n   */\n  FLOAT: WebGLConstants.FLOAT,\n\n  /**\n   * 64-bit floating-point corresponding to <code>gl.DOUBLE</code> (in Desktop OpenGL;\n   * this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute})\n   * and the type of an element in <code>Float64Array</code>.\n   *\n   * @memberOf ComponentDatatype\n   *\n   * @type {number}\n   * @constant\n   * @default 0x140A\n   */\n  DOUBLE: WebGLConstants.DOUBLE,\n};\n\n/**\n * Returns the size, in bytes, of the corresponding datatype.\n *\n * @param {ComponentDatatype} componentDatatype The component datatype to get the size of.\n * @returns {number} The size in bytes.\n *\n * @exception {DeveloperError} componentDatatype is not a valid value.\n *\n * @example\n * // Returns Int8Array.BYTES_PER_ELEMENT\n * const size = Cesium.ComponentDatatype.getSizeInBytes(Cesium.ComponentDatatype.BYTE);\n */\nComponentDatatype.getSizeInBytes = function (componentDatatype) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(componentDatatype)) {\n    throw new DeveloperError(\"value is required.\");\n  }\n  //>>includeEnd('debug');\n\n  switch (componentDatatype) {\n    case ComponentDatatype.BYTE:\n      return Int8Array.BYTES_PER_ELEMENT;\n    case ComponentDatatype.UNSIGNED_BYTE:\n      return Uint8Array.BYTES_PER_ELEMENT;\n    case ComponentDatatype.SHORT:\n      return Int16Array.BYTES_PER_ELEMENT;\n    case ComponentDatatype.UNSIGNED_SHORT:\n      return Uint16Array.BYTES_PER_ELEMENT;\n    case ComponentDatatype.INT:\n      return Int32Array.BYTES_PER_ELEMENT;\n    case ComponentDatatype.UNSIGNED_INT:\n      return Uint32Array.BYTES_PER_ELEMENT;\n    case ComponentDatatype.FLOAT:\n      return Float32Array.BYTES_PER_ELEMENT;\n    case ComponentDatatype.DOUBLE:\n      return Float64Array.BYTES_PER_ELEMENT;\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\"componentDatatype is not a valid value.\");\n    //>>includeEnd('debug');\n  }\n};\n\n/**\n * Gets the {@link ComponentDatatype} for the provided TypedArray instance.\n *\n * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} array The typed array.\n * @returns {ComponentDatatype} The ComponentDatatype for the provided array, or undefined if the array is not a TypedArray.\n */\nComponentDatatype.fromTypedArray = function (array) {\n  if (array instanceof Int8Array) {\n    return ComponentDatatype.BYTE;\n  }\n  if (array instanceof Uint8Array) {\n    return ComponentDatatype.UNSIGNED_BYTE;\n  }\n  if (array instanceof Int16Array) {\n    return ComponentDatatype.SHORT;\n  }\n  if (array instanceof Uint16Array) {\n    return ComponentDatatype.UNSIGNED_SHORT;\n  }\n  if (array instanceof Int32Array) {\n    return ComponentDatatype.INT;\n  }\n  if (array instanceof Uint32Array) {\n    return ComponentDatatype.UNSIGNED_INT;\n  }\n  if (array instanceof Float32Array) {\n    return ComponentDatatype.FLOAT;\n  }\n  if (array instanceof Float64Array) {\n    return ComponentDatatype.DOUBLE;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  throw new DeveloperError(\n    \"array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.\"\n  );\n  //>>includeEnd('debug');\n};\n\n/**\n * Validates that the provided component datatype is a valid {@link ComponentDatatype}\n *\n * @param {ComponentDatatype} componentDatatype The component datatype to validate.\n * @returns {boolean} <code>true</code> if the provided component datatype is a valid value; otherwise, <code>false</code>.\n *\n * @example\n * if (!Cesium.ComponentDatatype.validate(componentDatatype)) {\n *   throw new Cesium.DeveloperError('componentDatatype must be a valid value.');\n * }\n */\nComponentDatatype.validate = function (componentDatatype) {\n  return (\n    defined(componentDatatype) &&\n    (componentDatatype === ComponentDatatype.BYTE ||\n      componentDatatype === ComponentDatatype.UNSIGNED_BYTE ||\n      componentDatatype === ComponentDatatype.SHORT ||\n      componentDatatype === ComponentDatatype.UNSIGNED_SHORT ||\n      componentDatatype === ComponentDatatype.INT ||\n      componentDatatype === ComponentDatatype.UNSIGNED_INT ||\n      componentDatatype === ComponentDatatype.FLOAT ||\n      componentDatatype === ComponentDatatype.DOUBLE)\n  );\n};\n\n/**\n * Creates a typed array corresponding to component data type.\n *\n * @param {ComponentDatatype} componentDatatype The component data type.\n * @param {number|Array} valuesOrLength The length of the array to create or an array.\n * @returns {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} A typed array.\n *\n * @exception {DeveloperError} componentDatatype is not a valid value.\n *\n * @example\n * // creates a Float32Array with length of 100\n * const typedArray = Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT, 100);\n */\nComponentDatatype.createTypedArray = function (\n  componentDatatype,\n  valuesOrLength\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(componentDatatype)) {\n    throw new DeveloperError(\"componentDatatype is required.\");\n  }\n  if (!defined(valuesOrLength)) {\n    throw new DeveloperError(\"valuesOrLength is required.\");\n  }\n  //>>includeEnd('debug');\n\n  switch (componentDatatype) {\n    case ComponentDatatype.BYTE:\n      return new Int8Array(valuesOrLength);\n    case ComponentDatatype.UNSIGNED_BYTE:\n      return new Uint8Array(valuesOrLength);\n    case ComponentDatatype.SHORT:\n      return new Int16Array(valuesOrLength);\n    case ComponentDatatype.UNSIGNED_SHORT:\n      return new Uint16Array(valuesOrLength);\n    case ComponentDatatype.INT:\n      return new Int32Array(valuesOrLength);\n    case ComponentDatatype.UNSIGNED_INT:\n      return new Uint32Array(valuesOrLength);\n    case ComponentDatatype.FLOAT:\n      return new Float32Array(valuesOrLength);\n    case ComponentDatatype.DOUBLE:\n      return new Float64Array(valuesOrLength);\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\"componentDatatype is not a valid value.\");\n    //>>includeEnd('debug');\n  }\n};\n\n/**\n * Creates a typed view of an array of bytes.\n *\n * @param {ComponentDatatype} componentDatatype The type of the view to create.\n * @param {ArrayBuffer} buffer The buffer storage to use for the view.\n * @param {number} [byteOffset] The offset, in bytes, to the first element in the view.\n * @param {number} [length] The number of elements in the view.\n * @returns {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} A typed array view of the buffer.\n *\n * @exception {DeveloperError} componentDatatype is not a valid value.\n */\nComponentDatatype.createArrayBufferView = function (\n  componentDatatype,\n  buffer,\n  byteOffset,\n  length\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(componentDatatype)) {\n    throw new DeveloperError(\"componentDatatype is required.\");\n  }\n  if (!defined(buffer)) {\n    throw new DeveloperError(\"buffer is required.\");\n  }\n  //>>includeEnd('debug');\n\n  byteOffset = defaultValue(byteOffset, 0);\n  length = defaultValue(\n    length,\n    (buffer.byteLength - byteOffset) /\n      ComponentDatatype.getSizeInBytes(componentDatatype)\n  );\n\n  switch (componentDatatype) {\n    case ComponentDatatype.BYTE:\n      return new Int8Array(buffer, byteOffset, length);\n    case ComponentDatatype.UNSIGNED_BYTE:\n      return new Uint8Array(buffer, byteOffset, length);\n    case ComponentDatatype.SHORT:\n      return new Int16Array(buffer, byteOffset, length);\n    case ComponentDatatype.UNSIGNED_SHORT:\n      return new Uint16Array(buffer, byteOffset, length);\n    case ComponentDatatype.INT:\n      return new Int32Array(buffer, byteOffset, length);\n    case ComponentDatatype.UNSIGNED_INT:\n      return new Uint32Array(buffer, byteOffset, length);\n    case ComponentDatatype.FLOAT:\n      return new Float32Array(buffer, byteOffset, length);\n    case ComponentDatatype.DOUBLE:\n      return new Float64Array(buffer, byteOffset, length);\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\"componentDatatype is not a valid value.\");\n    //>>includeEnd('debug');\n  }\n};\n\n/**\n * Get the ComponentDatatype from its name.\n *\n * @param {string} name The name of the ComponentDatatype.\n * @returns {ComponentDatatype} The ComponentDatatype.\n *\n * @exception {DeveloperError} name is not a valid value.\n */\nComponentDatatype.fromName = function (name) {\n  switch (name) {\n    case \"BYTE\":\n      return ComponentDatatype.BYTE;\n    case \"UNSIGNED_BYTE\":\n      return ComponentDatatype.UNSIGNED_BYTE;\n    case \"SHORT\":\n      return ComponentDatatype.SHORT;\n    case \"UNSIGNED_SHORT\":\n      return ComponentDatatype.UNSIGNED_SHORT;\n    case \"INT\":\n      return ComponentDatatype.INT;\n    case \"UNSIGNED_INT\":\n      return ComponentDatatype.UNSIGNED_INT;\n    case \"FLOAT\":\n      return ComponentDatatype.FLOAT;\n    case \"DOUBLE\":\n      return ComponentDatatype.DOUBLE;\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\"name is not a valid value.\");\n    //>>includeEnd('debug');\n  }\n};\nexport default Object.freeze(ComponentDatatype);\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\nconst warnings = {};\n\n/**\n * Logs a one time message to the console.  Use this function instead of\n * <code>console.log</code> directly since this does not log duplicate messages\n * unless it is called from multiple workers.\n *\n * @function oneTimeWarning\n *\n * @param {string} identifier The unique identifier for this warning.\n * @param {string} [message=identifier] The message to log to the console.\n *\n * @example\n * for(let i=0;i<foo.length;++i) {\n *    if (!defined(foo[i].bar)) {\n *       // Something that can be recovered from but may happen a lot\n *       oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.');\n *       foo[i].bar = 0;\n *       // ...\n *    }\n * }\n *\n * @private\n */\nfunction oneTimeWarning(identifier, message) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(identifier)) {\n    throw new DeveloperError(\"identifier is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(warnings[identifier])) {\n    warnings[identifier] = true;\n    console.warn(defaultValue(message, identifier));\n  }\n}\n\noneTimeWarning.geometryOutlines =\n  \"Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.\";\n\noneTimeWarning.geometryZIndex =\n  \"Entity geometry with zIndex are unsupported when height or extrudedHeight are defined.  zIndex will be ignored\";\n\noneTimeWarning.geometryHeightReference =\n  \"Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height.  heightReference will be ignored\";\noneTimeWarning.geometryExtrudedHeightReference =\n  \"Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight.  extrudedHeightReference will be ignored\";\nexport default oneTimeWarning;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport oneTimeWarning from \"./oneTimeWarning.js\";\n\n/**\n * Logs a deprecation message to the console.  Use this function instead of\n * <code>console.log</code> directly since this does not log duplicate messages\n * unless it is called from multiple workers.\n *\n * @function deprecationWarning\n *\n * @param {string} identifier The unique identifier for this deprecated API.\n * @param {string} message The message to log to the console.\n *\n * @example\n * // Deprecated function or class\n * function Foo() {\n *    deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01.  It will be removed in 1.03.  Use newFoo instead.');\n *    // ...\n * }\n *\n * // Deprecated function\n * Bar.prototype.func = function() {\n *    deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01.  It will be removed in 1.03.  Use Bar.newFunc() instead.');\n *    // ...\n * };\n *\n * // Deprecated property\n * Object.defineProperties(Bar.prototype, {\n *     prop : {\n *         get : function() {\n *             deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01.  It will be removed in 1.03.  Use Bar.newProp instead.');\n *             // ...\n *         },\n *         set : function(value) {\n *             deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01.  It will be removed in 1.03.  Use Bar.newProp instead.');\n *             // ...\n *         }\n *     }\n * });\n *\n * @private\n */\nfunction deprecationWarning(identifier, message) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(identifier) || !defined(message)) {\n    throw new DeveloperError(\"identifier and message are required.\");\n  }\n  //>>includeEnd('debug');\n\n  oneTimeWarning(identifier, message);\n}\nexport default deprecationWarning;\n", "/**\n * @private\n */\nconst GeometryType = {\n  NONE: 0,\n  TRIANGLES: 1,\n  LINES: 2,\n  POLYLINES: 3,\n};\nexport default Object.freeze(GeometryType);\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport FeatureDetection from \"./FeatureDetection.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\n\n/**\n * A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.\n * @alias Quaternion\n * @constructor\n *\n * @param {number} [x=0.0] The X component.\n * @param {number} [y=0.0] The Y component.\n * @param {number} [z=0.0] The Z component.\n * @param {number} [w=0.0] The W component.\n *\n * @see PackableForInterpolation\n */\nfunction Quaternion(x, y, z, w) {\n  /**\n   * The X component.\n   * @type {number}\n   * @default 0.0\n   */\n  this.x = defaultValue(x, 0.0);\n\n  /**\n   * The Y component.\n   * @type {number}\n   * @default 0.0\n   */\n  this.y = defaultValue(y, 0.0);\n\n  /**\n   * The Z component.\n   * @type {number}\n   * @default 0.0\n   */\n  this.z = defaultValue(z, 0.0);\n\n  /**\n   * The W component.\n   * @type {number}\n   * @default 0.0\n   */\n  this.w = defaultValue(w, 0.0);\n}\n\nlet fromAxisAngleScratch = new Cartesian3();\n\n/**\n * Computes a quaternion representing a rotation around an axis.\n *\n * @param {Cartesian3} axis The axis of rotation.\n * @param {number} angle The angle in radians to rotate around the axis.\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n */\nQuaternion.fromAxisAngle = function (axis, angle, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"axis\", axis);\n  Check.typeOf.number(\"angle\", angle);\n  //>>includeEnd('debug');\n\n  const halfAngle = angle / 2.0;\n  const s = Math.sin(halfAngle);\n  fromAxisAngleScratch = Cartesian3.normalize(axis, fromAxisAngleScratch);\n\n  const x = fromAxisAngleScratch.x * s;\n  const y = fromAxisAngleScratch.y * s;\n  const z = fromAxisAngleScratch.z * s;\n  const w = Math.cos(halfAngle);\n  if (!defined(result)) {\n    return new Quaternion(x, y, z, w);\n  }\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  result.w = w;\n  return result;\n};\n\nconst fromRotationMatrixNext = [1, 2, 0];\nconst fromRotationMatrixQuat = new Array(3);\n/**\n * Computes a Quaternion from the provided Matrix3 instance.\n *\n * @param {Matrix3} matrix The rotation matrix.\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n *\n * @see Matrix3.fromQuaternion\n */\nQuaternion.fromRotationMatrix = function (matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"matrix\", matrix);\n  //>>includeEnd('debug');\n\n  let root;\n  let x;\n  let y;\n  let z;\n  let w;\n\n  const m00 = matrix[Matrix3.COLUMN0ROW0];\n  const m11 = matrix[Matrix3.COLUMN1ROW1];\n  const m22 = matrix[Matrix3.COLUMN2ROW2];\n  const trace = m00 + m11 + m22;\n\n  if (trace > 0.0) {\n    // |w| > 1/2, may as well choose w > 1/2\n    root = Math.sqrt(trace + 1.0); // 2w\n    w = 0.5 * root;\n    root = 0.5 / root; // 1/(4w)\n\n    x = (matrix[Matrix3.COLUMN1ROW2] - matrix[Matrix3.COLUMN2ROW1]) * root;\n    y = (matrix[Matrix3.COLUMN2ROW0] - matrix[Matrix3.COLUMN0ROW2]) * root;\n    z = (matrix[Matrix3.COLUMN0ROW1] - matrix[Matrix3.COLUMN1ROW0]) * root;\n  } else {\n    // |w| <= 1/2\n    const next = fromRotationMatrixNext;\n\n    let i = 0;\n    if (m11 > m00) {\n      i = 1;\n    }\n    if (m22 > m00 && m22 > m11) {\n      i = 2;\n    }\n    const j = next[i];\n    const k = next[j];\n\n    root = Math.sqrt(\n      matrix[Matrix3.getElementIndex(i, i)] -\n        matrix[Matrix3.getElementIndex(j, j)] -\n        matrix[Matrix3.getElementIndex(k, k)] +\n        1.0\n    );\n\n    const quat = fromRotationMatrixQuat;\n    quat[i] = 0.5 * root;\n    root = 0.5 / root;\n    w =\n      (matrix[Matrix3.getElementIndex(k, j)] -\n        matrix[Matrix3.getElementIndex(j, k)]) *\n      root;\n    quat[j] =\n      (matrix[Matrix3.getElementIndex(j, i)] +\n        matrix[Matrix3.getElementIndex(i, j)]) *\n      root;\n    quat[k] =\n      (matrix[Matrix3.getElementIndex(k, i)] +\n        matrix[Matrix3.getElementIndex(i, k)]) *\n      root;\n\n    x = -quat[0];\n    y = -quat[1];\n    z = -quat[2];\n  }\n\n  if (!defined(result)) {\n    return new Quaternion(x, y, z, w);\n  }\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  result.w = w;\n  return result;\n};\n\nconst scratchHPRQuaternion = new Quaternion();\nlet scratchHeadingQuaternion = new Quaternion();\nlet scratchPitchQuaternion = new Quaternion();\nlet scratchRollQuaternion = new Quaternion();\n\n/**\n * Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the\n * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about\n * the positive x axis.\n *\n * @param {HeadingPitchRoll} headingPitchRoll The rotation expressed as a heading, pitch and roll.\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided.\n */\nQuaternion.fromHeadingPitchRoll = function (headingPitchRoll, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"headingPitchRoll\", headingPitchRoll);\n  //>>includeEnd('debug');\n\n  scratchRollQuaternion = Quaternion.fromAxisAngle(\n    Cartesian3.UNIT_X,\n    headingPitchRoll.roll,\n    scratchHPRQuaternion\n  );\n  scratchPitchQuaternion = Quaternion.fromAxisAngle(\n    Cartesian3.UNIT_Y,\n    -headingPitchRoll.pitch,\n    result\n  );\n  result = Quaternion.multiply(\n    scratchPitchQuaternion,\n    scratchRollQuaternion,\n    scratchPitchQuaternion\n  );\n  scratchHeadingQuaternion = Quaternion.fromAxisAngle(\n    Cartesian3.UNIT_Z,\n    -headingPitchRoll.heading,\n    scratchHPRQuaternion\n  );\n  return Quaternion.multiply(scratchHeadingQuaternion, result, result);\n};\n\nconst sampledQuaternionAxis = new Cartesian3();\nconst sampledQuaternionRotation = new Cartesian3();\nconst sampledQuaternionTempQuaternion = new Quaternion();\nconst sampledQuaternionQuaternion0 = new Quaternion();\nconst sampledQuaternionQuaternion0Conjugate = new Quaternion();\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nQuaternion.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Quaternion} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nQuaternion.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  array[startingIndex++] = value.x;\n  array[startingIndex++] = value.y;\n  array[startingIndex++] = value.z;\n  array[startingIndex] = value.w;\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Quaternion} [result] The object into which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n */\nQuaternion.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new Quaternion();\n  }\n  result.x = array[startingIndex];\n  result.y = array[startingIndex + 1];\n  result.z = array[startingIndex + 2];\n  result.w = array[startingIndex + 3];\n  return result;\n};\n\n/**\n * The number of elements used to store the object into an array in its interpolatable form.\n * @type {number}\n */\nQuaternion.packedInterpolationLength = 3;\n\n/**\n * Converts a packed array into a form suitable for interpolation.\n *\n * @param {number[]} packedArray The packed array.\n * @param {number} [startingIndex=0] The index of the first element to be converted.\n * @param {number} [lastIndex=packedArray.length] The index of the last element to be converted.\n * @param {number[]} [result] The object into which to store the result.\n */\nQuaternion.convertPackedArrayForInterpolation = function (\n  packedArray,\n  startingIndex,\n  lastIndex,\n  result\n) {\n  Quaternion.unpack(\n    packedArray,\n    lastIndex * 4,\n    sampledQuaternionQuaternion0Conjugate\n  );\n  Quaternion.conjugate(\n    sampledQuaternionQuaternion0Conjugate,\n    sampledQuaternionQuaternion0Conjugate\n  );\n\n  for (let i = 0, len = lastIndex - startingIndex + 1; i < len; i++) {\n    const offset = i * 3;\n    Quaternion.unpack(\n      packedArray,\n      (startingIndex + i) * 4,\n      sampledQuaternionTempQuaternion\n    );\n\n    Quaternion.multiply(\n      sampledQuaternionTempQuaternion,\n      sampledQuaternionQuaternion0Conjugate,\n      sampledQuaternionTempQuaternion\n    );\n\n    if (sampledQuaternionTempQuaternion.w < 0) {\n      Quaternion.negate(\n        sampledQuaternionTempQuaternion,\n        sampledQuaternionTempQuaternion\n      );\n    }\n\n    Quaternion.computeAxis(\n      sampledQuaternionTempQuaternion,\n      sampledQuaternionAxis\n    );\n    const angle = Quaternion.computeAngle(sampledQuaternionTempQuaternion);\n    if (!defined(result)) {\n      result = [];\n    }\n    result[offset] = sampledQuaternionAxis.x * angle;\n    result[offset + 1] = sampledQuaternionAxis.y * angle;\n    result[offset + 2] = sampledQuaternionAxis.z * angle;\n  }\n};\n\n/**\n * Retrieves an instance from a packed array converted with {@link convertPackedArrayForInterpolation}.\n *\n * @param {number[]} array The array previously packed for interpolation.\n * @param {number[]} sourceArray The original packed array.\n * @param {number} [firstIndex=0] The firstIndex used to convert the array.\n * @param {number} [lastIndex=packedArray.length] The lastIndex used to convert the array.\n * @param {Quaternion} [result] The object into which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n */\nQuaternion.unpackInterpolationResult = function (\n  array,\n  sourceArray,\n  firstIndex,\n  lastIndex,\n  result\n) {\n  if (!defined(result)) {\n    result = new Quaternion();\n  }\n  Cartesian3.fromArray(array, 0, sampledQuaternionRotation);\n  const magnitude = Cartesian3.magnitude(sampledQuaternionRotation);\n\n  Quaternion.unpack(sourceArray, lastIndex * 4, sampledQuaternionQuaternion0);\n\n  if (magnitude === 0) {\n    Quaternion.clone(Quaternion.IDENTITY, sampledQuaternionTempQuaternion);\n  } else {\n    Quaternion.fromAxisAngle(\n      sampledQuaternionRotation,\n      magnitude,\n      sampledQuaternionTempQuaternion\n    );\n  }\n\n  return Quaternion.multiply(\n    sampledQuaternionTempQuaternion,\n    sampledQuaternionQuaternion0,\n    result\n  );\n};\n\n/**\n * Duplicates a Quaternion instance.\n *\n * @param {Quaternion} quaternion The quaternion to duplicate.\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. (Returns undefined if quaternion is undefined)\n */\nQuaternion.clone = function (quaternion, result) {\n  if (!defined(quaternion)) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    return new Quaternion(\n      quaternion.x,\n      quaternion.y,\n      quaternion.z,\n      quaternion.w\n    );\n  }\n\n  result.x = quaternion.x;\n  result.y = quaternion.y;\n  result.z = quaternion.z;\n  result.w = quaternion.w;\n  return result;\n};\n\n/**\n * Computes the conjugate of the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to conjugate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.conjugate = function (quaternion, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"quaternion\", quaternion);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = -quaternion.x;\n  result.y = -quaternion.y;\n  result.z = -quaternion.z;\n  result.w = quaternion.w;\n  return result;\n};\n\n/**\n * Computes magnitude squared for the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to conjugate.\n * @returns {number} The magnitude squared.\n */\nQuaternion.magnitudeSquared = function (quaternion) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"quaternion\", quaternion);\n  //>>includeEnd('debug');\n\n  return (\n    quaternion.x * quaternion.x +\n    quaternion.y * quaternion.y +\n    quaternion.z * quaternion.z +\n    quaternion.w * quaternion.w\n  );\n};\n\n/**\n * Computes magnitude for the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to conjugate.\n * @returns {number} The magnitude.\n */\nQuaternion.magnitude = function (quaternion) {\n  return Math.sqrt(Quaternion.magnitudeSquared(quaternion));\n};\n\n/**\n * Computes the normalized form of the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to normalize.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.normalize = function (quaternion, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion);\n  const x = quaternion.x * inverseMagnitude;\n  const y = quaternion.y * inverseMagnitude;\n  const z = quaternion.z * inverseMagnitude;\n  const w = quaternion.w * inverseMagnitude;\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  result.w = w;\n  return result;\n};\n\n/**\n * Computes the inverse of the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to normalize.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.inverse = function (quaternion, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const magnitudeSquared = Quaternion.magnitudeSquared(quaternion);\n  result = Quaternion.conjugate(quaternion, result);\n  return Quaternion.multiplyByScalar(result, 1.0 / magnitudeSquared, result);\n};\n\n/**\n * Computes the componentwise sum of two quaternions.\n *\n * @param {Quaternion} left The first quaternion.\n * @param {Quaternion} right The second quaternion.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.add = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = left.x + right.x;\n  result.y = left.y + right.y;\n  result.z = left.z + right.z;\n  result.w = left.w + right.w;\n  return result;\n};\n\n/**\n * Computes the componentwise difference of two quaternions.\n *\n * @param {Quaternion} left The first quaternion.\n * @param {Quaternion} right The second quaternion.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.subtract = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = left.x - right.x;\n  result.y = left.y - right.y;\n  result.z = left.z - right.z;\n  result.w = left.w - right.w;\n  return result;\n};\n\n/**\n * Negates the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to be negated.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.negate = function (quaternion, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"quaternion\", quaternion);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = -quaternion.x;\n  result.y = -quaternion.y;\n  result.z = -quaternion.z;\n  result.w = -quaternion.w;\n  return result;\n};\n\n/**\n * Computes the dot (scalar) product of two quaternions.\n *\n * @param {Quaternion} left The first quaternion.\n * @param {Quaternion} right The second quaternion.\n * @returns {number} The dot product.\n */\nQuaternion.dot = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  return (\n    left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w\n  );\n};\n\n/**\n * Computes the product of two quaternions.\n *\n * @param {Quaternion} left The first quaternion.\n * @param {Quaternion} right The second quaternion.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.multiply = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const leftX = left.x;\n  const leftY = left.y;\n  const leftZ = left.z;\n  const leftW = left.w;\n\n  const rightX = right.x;\n  const rightY = right.y;\n  const rightZ = right.z;\n  const rightW = right.w;\n\n  const x = leftW * rightX + leftX * rightW + leftY * rightZ - leftZ * rightY;\n  const y = leftW * rightY - leftX * rightZ + leftY * rightW + leftZ * rightX;\n  const z = leftW * rightZ + leftX * rightY - leftY * rightX + leftZ * rightW;\n  const w = leftW * rightW - leftX * rightX - leftY * rightY - leftZ * rightZ;\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  result.w = w;\n  return result;\n};\n\n/**\n * Multiplies the provided quaternion componentwise by the provided scalar.\n *\n * @param {Quaternion} quaternion The quaternion to be scaled.\n * @param {number} scalar The scalar to multiply with.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.multiplyByScalar = function (quaternion, scalar, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"quaternion\", quaternion);\n  Check.typeOf.number(\"scalar\", scalar);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = quaternion.x * scalar;\n  result.y = quaternion.y * scalar;\n  result.z = quaternion.z * scalar;\n  result.w = quaternion.w * scalar;\n  return result;\n};\n\n/**\n * Divides the provided quaternion componentwise by the provided scalar.\n *\n * @param {Quaternion} quaternion The quaternion to be divided.\n * @param {number} scalar The scalar to divide by.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.divideByScalar = function (quaternion, scalar, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"quaternion\", quaternion);\n  Check.typeOf.number(\"scalar\", scalar);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  result.x = quaternion.x / scalar;\n  result.y = quaternion.y / scalar;\n  result.z = quaternion.z / scalar;\n  result.w = quaternion.w / scalar;\n  return result;\n};\n\n/**\n * Computes the axis of rotation of the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to use.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nQuaternion.computeAxis = function (quaternion, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"quaternion\", quaternion);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const w = quaternion.w;\n  if (\n    Math.abs(w - 1.0) < CesiumMath.EPSILON6 ||\n    Math.abs(w + 1.0) < CesiumMath.EPSILON6\n  ) {\n    result.x = 1;\n    result.y = result.z = 0;\n    return result;\n  }\n\n  const scalar = 1.0 / Math.sqrt(1.0 - w * w);\n\n  result.x = quaternion.x * scalar;\n  result.y = quaternion.y * scalar;\n  result.z = quaternion.z * scalar;\n  return result;\n};\n\n/**\n * Computes the angle of rotation of the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to use.\n * @returns {number} The angle of rotation.\n */\nQuaternion.computeAngle = function (quaternion) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"quaternion\", quaternion);\n  //>>includeEnd('debug');\n\n  if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) {\n    return 0.0;\n  }\n  return 2.0 * Math.acos(quaternion.w);\n};\n\nlet lerpScratch = new Quaternion();\n/**\n * Computes the linear interpolation or extrapolation at t using the provided quaternions.\n *\n * @param {Quaternion} start The value corresponding to t at 0.0.\n * @param {Quaternion} end The value corresponding to t at 1.0.\n * @param {number} t The point along t at which to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.lerp = function (start, end, t, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"start\", start);\n  Check.typeOf.object(\"end\", end);\n  Check.typeOf.number(\"t\", t);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch);\n  result = Quaternion.multiplyByScalar(start, 1.0 - t, result);\n  return Quaternion.add(lerpScratch, result, result);\n};\n\nlet slerpEndNegated = new Quaternion();\nlet slerpScaledP = new Quaternion();\nlet slerpScaledR = new Quaternion();\n/**\n * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.\n *\n * @param {Quaternion} start The value corresponding to t at 0.0.\n * @param {Quaternion} end The value corresponding to t at 1.0.\n * @param {number} t The point along t at which to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n * @see Quaternion#fastSlerp\n */\nQuaternion.slerp = function (start, end, t, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"start\", start);\n  Check.typeOf.object(\"end\", end);\n  Check.typeOf.number(\"t\", t);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  let dot = Quaternion.dot(start, end);\n\n  // The angle between start must be acute. Since q and -q represent\n  // the same rotation, negate q to get the acute angle.\n  let r = end;\n  if (dot < 0.0) {\n    dot = -dot;\n    r = slerpEndNegated = Quaternion.negate(end, slerpEndNegated);\n  }\n\n  // dot > 0, as the dot product approaches 1, the angle between the\n  // quaternions vanishes. use linear interpolation.\n  if (1.0 - dot < CesiumMath.EPSILON6) {\n    return Quaternion.lerp(start, r, t, result);\n  }\n\n  const theta = Math.acos(dot);\n  slerpScaledP = Quaternion.multiplyByScalar(\n    start,\n    Math.sin((1 - t) * theta),\n    slerpScaledP\n  );\n  slerpScaledR = Quaternion.multiplyByScalar(\n    r,\n    Math.sin(t * theta),\n    slerpScaledR\n  );\n  result = Quaternion.add(slerpScaledP, slerpScaledR, result);\n  return Quaternion.multiplyByScalar(result, 1.0 / Math.sin(theta), result);\n};\n\n/**\n * The logarithmic quaternion function.\n *\n * @param {Quaternion} quaternion The unit quaternion.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nQuaternion.log = function (quaternion, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"quaternion\", quaternion);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const theta = CesiumMath.acosClamped(quaternion.w);\n  let thetaOverSinTheta = 0.0;\n\n  if (theta !== 0.0) {\n    thetaOverSinTheta = theta / Math.sin(theta);\n  }\n\n  return Cartesian3.multiplyByScalar(quaternion, thetaOverSinTheta, result);\n};\n\n/**\n * The exponential quaternion function.\n *\n * @param {Cartesian3} cartesian The cartesian.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.exp = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const theta = Cartesian3.magnitude(cartesian);\n  let sinThetaOverTheta = 0.0;\n\n  if (theta !== 0.0) {\n    sinThetaOverTheta = Math.sin(theta) / theta;\n  }\n\n  result.x = cartesian.x * sinThetaOverTheta;\n  result.y = cartesian.y * sinThetaOverTheta;\n  result.z = cartesian.z * sinThetaOverTheta;\n  result.w = Math.cos(theta);\n\n  return result;\n};\n\nconst squadScratchCartesian0 = new Cartesian3();\nconst squadScratchCartesian1 = new Cartesian3();\nconst squadScratchQuaternion0 = new Quaternion();\nconst squadScratchQuaternion1 = new Quaternion();\n\n/**\n * Computes an inner quadrangle point.\n * <p>This will compute quaternions that ensure a squad curve is C<sup>1</sup>.</p>\n *\n * @param {Quaternion} q0 The first quaternion.\n * @param {Quaternion} q1 The second quaternion.\n * @param {Quaternion} q2 The third quaternion.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n * @see Quaternion#squad\n */\nQuaternion.computeInnerQuadrangle = function (q0, q1, q2, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"q0\", q0);\n  Check.typeOf.object(\"q1\", q1);\n  Check.typeOf.object(\"q2\", q2);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const qInv = Quaternion.conjugate(q1, squadScratchQuaternion0);\n  Quaternion.multiply(qInv, q2, squadScratchQuaternion1);\n  const cart0 = Quaternion.log(squadScratchQuaternion1, squadScratchCartesian0);\n\n  Quaternion.multiply(qInv, q0, squadScratchQuaternion1);\n  const cart1 = Quaternion.log(squadScratchQuaternion1, squadScratchCartesian1);\n\n  Cartesian3.add(cart0, cart1, cart0);\n  Cartesian3.multiplyByScalar(cart0, 0.25, cart0);\n  Cartesian3.negate(cart0, cart0);\n  Quaternion.exp(cart0, squadScratchQuaternion0);\n\n  return Quaternion.multiply(q1, squadScratchQuaternion0, result);\n};\n\n/**\n * Computes the spherical quadrangle interpolation between quaternions.\n *\n * @param {Quaternion} q0 The first quaternion.\n * @param {Quaternion} q1 The second quaternion.\n * @param {Quaternion} s0 The first inner quadrangle.\n * @param {Quaternion} s1 The second inner quadrangle.\n * @param {number} t The time in [0,1] used to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n *\n * @example\n * // 1. compute the squad interpolation between two quaternions on a curve\n * const s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion());\n * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion());\n * const q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion());\n *\n * // 2. compute the squad interpolation as above but where the first quaternion is a end point.\n * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion());\n * const q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion());\n *\n * @see Quaternion#computeInnerQuadrangle\n */\nQuaternion.squad = function (q0, q1, s0, s1, t, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"q0\", q0);\n  Check.typeOf.object(\"q1\", q1);\n  Check.typeOf.object(\"s0\", s0);\n  Check.typeOf.object(\"s1\", s1);\n  Check.typeOf.number(\"t\", t);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0);\n  const slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1);\n  return Quaternion.slerp(slerp0, slerp1, 2.0 * t * (1.0 - t), result);\n};\n\nconst fastSlerpScratchQuaternion = new Quaternion();\n// eslint-disable-next-line no-loss-of-precision\nconst opmu = 1.90110745351730037;\nconst u = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\nconst v = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\nconst bT = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\nconst bD = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\n\nfor (let i = 0; i < 7; ++i) {\n  const s = i + 1.0;\n  const t = 2.0 * s + 1.0;\n  u[i] = 1.0 / (s * t);\n  v[i] = s / t;\n}\n\nu[7] = opmu / (8.0 * 17.0);\nv[7] = (opmu * 8.0) / 17.0;\n\n/**\n * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.\n * This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10<sup>-6</sup>.\n *\n * @param {Quaternion} start The value corresponding to t at 0.0.\n * @param {Quaternion} end The value corresponding to t at 1.0.\n * @param {number} t The point along t at which to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n * @see Quaternion#slerp\n */\nQuaternion.fastSlerp = function (start, end, t, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"start\", start);\n  Check.typeOf.object(\"end\", end);\n  Check.typeOf.number(\"t\", t);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  let x = Quaternion.dot(start, end);\n\n  let sign;\n  if (x >= 0) {\n    sign = 1.0;\n  } else {\n    sign = -1.0;\n    x = -x;\n  }\n\n  const xm1 = x - 1.0;\n  const d = 1.0 - t;\n  const sqrT = t * t;\n  const sqrD = d * d;\n\n  for (let i = 7; i >= 0; --i) {\n    bT[i] = (u[i] * sqrT - v[i]) * xm1;\n    bD[i] = (u[i] * sqrD - v[i]) * xm1;\n  }\n\n  const cT =\n    sign *\n    t *\n    (1.0 +\n      bT[0] *\n        (1.0 +\n          bT[1] *\n            (1.0 +\n              bT[2] *\n                (1.0 +\n                  bT[3] *\n                    (1.0 +\n                      bT[4] *\n                        (1.0 + bT[5] * (1.0 + bT[6] * (1.0 + bT[7]))))))));\n  const cD =\n    d *\n    (1.0 +\n      bD[0] *\n        (1.0 +\n          bD[1] *\n            (1.0 +\n              bD[2] *\n                (1.0 +\n                  bD[3] *\n                    (1.0 +\n                      bD[4] *\n                        (1.0 + bD[5] * (1.0 + bD[6] * (1.0 + bD[7]))))))));\n\n  const temp = Quaternion.multiplyByScalar(\n    start,\n    cD,\n    fastSlerpScratchQuaternion\n  );\n  Quaternion.multiplyByScalar(end, cT, result);\n  return Quaternion.add(temp, result, result);\n};\n\n/**\n * Computes the spherical quadrangle interpolation between quaternions.\n * An implementation that is faster than {@link Quaternion#squad}, but less accurate.\n *\n * @param {Quaternion} q0 The first quaternion.\n * @param {Quaternion} q1 The second quaternion.\n * @param {Quaternion} s0 The first inner quadrangle.\n * @param {Quaternion} s1 The second inner quadrangle.\n * @param {number} t The time in [0,1] used to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new instance if none was provided.\n *\n * @see Quaternion#squad\n */\nQuaternion.fastSquad = function (q0, q1, s0, s1, t, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"q0\", q0);\n  Check.typeOf.object(\"q1\", q1);\n  Check.typeOf.object(\"s0\", s0);\n  Check.typeOf.object(\"s1\", s1);\n  Check.typeOf.number(\"t\", t);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0);\n  const slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1);\n  return Quaternion.fastSlerp(slerp0, slerp1, 2.0 * t * (1.0 - t), result);\n};\n\n/**\n * Compares the provided quaternions componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Quaternion} [left] The first quaternion.\n * @param {Quaternion} [right] The second quaternion.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nQuaternion.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left.x === right.x &&\n      left.y === right.y &&\n      left.z === right.z &&\n      left.w === right.w)\n  );\n};\n\n/**\n * Compares the provided quaternions componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Quaternion} [left] The first quaternion.\n * @param {Quaternion} [right] The second quaternion.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nQuaternion.equalsEpsilon = function (left, right, epsilon) {\n  epsilon = defaultValue(epsilon, 0);\n\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      Math.abs(left.x - right.x) <= epsilon &&\n      Math.abs(left.y - right.y) <= epsilon &&\n      Math.abs(left.z - right.z) <= epsilon &&\n      Math.abs(left.w - right.w) <= epsilon)\n  );\n};\n\n/**\n * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0).\n *\n * @type {Quaternion}\n * @constant\n */\nQuaternion.ZERO = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 0.0));\n\n/**\n * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).\n *\n * @type {Quaternion}\n * @constant\n */\nQuaternion.IDENTITY = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 1.0));\n\n/**\n * Duplicates this Quaternion instance.\n *\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n */\nQuaternion.prototype.clone = function (result) {\n  return Quaternion.clone(this, result);\n};\n\n/**\n * Compares this and the provided quaternion componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Quaternion} [right] The right hand side quaternion.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nQuaternion.prototype.equals = function (right) {\n  return Quaternion.equals(this, right);\n};\n\n/**\n * Compares this and the provided quaternion componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Quaternion} [right] The right hand side quaternion.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nQuaternion.prototype.equalsEpsilon = function (right, epsilon) {\n  return Quaternion.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Returns a string representing this quaternion in the format (x, y, z, w).\n *\n * @returns {string} A string representing this Quaternion.\n */\nQuaternion.prototype.toString = function () {\n  return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;\n};\nexport default Quaternion;\n", "import Check from \"./Check.js\";\n\n/**\n * Finds an item in a sorted array.\n *\n * @function\n * @param {Array} array The sorted array to search.\n * @param {*} itemToFind The item to find in the array.\n * @param {binarySearchComparator} comparator The function to use to compare the item to\n *        elements in the array.\n * @returns {number} The index of <code>itemToFind</code> in the array, if it exists.  If <code>itemToFind</code>\n *        does not exist, the return value is a negative number which is the bitwise complement (~)\n *        of the index before which the itemToFind should be inserted in order to maintain the\n *        sorted order of the array.\n *\n * @example\n * // Create a comparator function to search through an array of numbers.\n * function comparator(a, b) {\n *     return a - b;\n * };\n * const numbers = [0, 2, 4, 6, 8];\n * const index = Cesium.binarySearch(numbers, 6, comparator); // 3\n */\nfunction binarySearch(array, itemToFind, comparator) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  Check.defined(\"itemToFind\", itemToFind);\n  Check.defined(\"comparator\", comparator);\n  //>>includeEnd('debug');\n\n  let low = 0;\n  let high = array.length - 1;\n  let i;\n  let comparison;\n\n  while (low <= high) {\n    i = ~~((low + high) / 2);\n    comparison = comparator(array[i], itemToFind);\n    if (comparison < 0) {\n      low = i + 1;\n      continue;\n    }\n    if (comparison > 0) {\n      high = i - 1;\n      continue;\n    }\n    return i;\n  }\n  return ~(high + 1);\n}\n\n/**\n * A function used to compare two items while performing a binary search.\n * @callback binarySearchComparator\n *\n * @param {*} a An item in the array.\n * @param {*} b The item being searched for.\n * @returns {number} Returns a negative value if <code>a</code> is less than <code>b</code>,\n *          a positive value if <code>a</code> is greater than <code>b</code>, or\n *          0 if <code>a</code> is equal to <code>b</code>.\n *\n * @example\n * function compareNumbers(a, b) {\n *     return a - b;\n * }\n */\nexport default binarySearch;\n", "/**\n * A set of Earth Orientation Parameters (EOP) sampled at a time.\n *\n * @alias EarthOrientationParametersSample\n * @constructor\n *\n * @param {number} xPoleWander The pole wander about the X axis, in radians.\n * @param {number} yPoleWander The pole wander about the Y axis, in radians.\n * @param {number} xPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.\n * @param {number} yPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.\n * @param {number} ut1MinusUtc The difference in time standards, UT1 - UTC, in seconds.\n *\n * @private\n */\nfunction EarthOrientationParametersSample(\n  xPoleWander,\n  yPoleWander,\n  xPoleOffset,\n  yPoleOffset,\n  ut1MinusUtc\n) {\n  /**\n   * The pole wander about the X axis, in radians.\n   * @type {number}\n   */\n  this.xPoleWander = xPoleWander;\n\n  /**\n   * The pole wander about the Y axis, in radians.\n   * @type {number}\n   */\n  this.yPoleWander = yPoleWander;\n\n  /**\n   * The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.\n   * @type {number}\n   */\n  this.xPoleOffset = xPoleOffset;\n\n  /**\n   * The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.\n   * @type {number}\n   */\n  this.yPoleOffset = yPoleOffset;\n\n  /**\n   * The difference in time standards, UT1 - UTC, in seconds.\n   * @type {number}\n   */\n  this.ut1MinusUtc = ut1MinusUtc;\n}\nexport default EarthOrientationParametersSample;\n", "/**\n * Represents a Gregorian date in a more precise format than the JavaScript Date object.\n * In addition to submillisecond precision, this object can also represent leap seconds.\n * @alias GregorianDate\n * @constructor\n *\n * @param {number} [year] The year as a whole number.\n * @param {number} [month] The month as a whole number with range [1, 12].\n * @param {number} [day] The day of the month as a whole number starting at 1.\n * @param {number} [hour] The hour as a whole number with range [0, 23].\n * @param {number} [minute] The minute of the hour as a whole number with range [0, 59].\n * @param {number} [second] The second of the minute as a whole number with range [0, 60], with 60 representing a leap second.\n * @param {number} [millisecond] The millisecond of the second as a floating point number with range [0.0, 1000.0).\n * @param {boolean} [isLeapSecond] Whether this time is during a leap second.\n *\n * @see JulianDate#toGregorianDate\n */\nfunction GregorianDate(\n  year,\n  month,\n  day,\n  hour,\n  minute,\n  second,\n  millisecond,\n  isLeapSecond\n) {\n  /**\n   * Gets or sets the year as a whole number.\n   * @type {number}\n   */\n  this.year = year;\n  /**\n   * Gets or sets the month as a whole number with range [1, 12].\n   * @type {number}\n   */\n  this.month = month;\n  /**\n   * Gets or sets the day of the month as a whole number starting at 1.\n   * @type {number}\n   */\n  this.day = day;\n  /**\n   * Gets or sets the hour as a whole number with range [0, 23].\n   * @type {number}\n   */\n  this.hour = hour;\n  /**\n   * Gets or sets the minute of the hour as a whole number with range [0, 59].\n   * @type {number}\n   */\n  this.minute = minute;\n  /**\n   * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.\n   * @type {number}\n   */\n  this.second = second;\n  /**\n   * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).\n   * @type {number}\n   */\n  this.millisecond = millisecond;\n  /**\n   * Gets or sets whether this time is during a leap second.\n   * @type {boolean}\n   */\n  this.isLeapSecond = isLeapSecond;\n}\nexport default GregorianDate;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Determines if a given date is a leap year.\n *\n * @function isLeapYear\n *\n * @param {number} year The year to be tested.\n * @returns {boolean} True if <code>year</code> is a leap year.\n *\n * @example\n * const leapYear = Cesium.isLeapYear(2000); // true\n */\nfunction isLeapYear(year) {\n  //>>includeStart('debug', pragmas.debug);\n  if (year === null || isNaN(year)) {\n    throw new DeveloperError(\"year is required and must be a number.\");\n  }\n  //>>includeEnd('debug');\n\n  return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n}\nexport default isLeapYear;\n", "/**\n * Describes a single leap second, which is constructed from a {@link JulianDate} and a\n * numerical offset representing the number of seconds TAI is ahead of the UTC time standard.\n * @alias LeapSecond\n * @constructor\n *\n * @param {JulianDate} [date] A Julian date representing the time of the leap second.\n * @param {number} [offset] The cumulative number of seconds that TAI is ahead of UTC at the provided date.\n */\nfunction LeapSecond(date, offset) {\n  /**\n   * Gets or sets the date at which this leap second occurs.\n   * @type {JulianDate}\n   */\n  this.julianDate = date;\n\n  /**\n   * Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time\n   * of this leap second.\n   * @type {number}\n   */\n  this.offset = offset;\n}\nexport default LeapSecond;\n", "/**\n * Constants for time conversions like those done by {@link JulianDate}.\n *\n * @namespace TimeConstants\n *\n * @see JulianDate\n *\n * @private\n */\nconst TimeConstants = {\n  /**\n   * The number of seconds in one millisecond: <code>0.001</code>\n   * @type {number}\n   * @constant\n   */\n  SECONDS_PER_MILLISECOND: 0.001,\n\n  /**\n   * The number of seconds in one minute: <code>60</code>.\n   * @type {number}\n   * @constant\n   */\n  SECONDS_PER_MINUTE: 60.0,\n\n  /**\n   * The number of minutes in one hour: <code>60</code>.\n   * @type {number}\n   * @constant\n   */\n  MINUTES_PER_HOUR: 60.0,\n\n  /**\n   * The number of hours in one day: <code>24</code>.\n   * @type {number}\n   * @constant\n   */\n  HOURS_PER_DAY: 24.0,\n\n  /**\n   * The number of seconds in one hour: <code>3600</code>.\n   * @type {number}\n   * @constant\n   */\n  SECONDS_PER_HOUR: 3600.0,\n\n  /**\n   * The number of minutes in one day: <code>1440</code>.\n   * @type {number}\n   * @constant\n   */\n  MINUTES_PER_DAY: 1440.0,\n\n  /**\n   * The number of seconds in one day, ignoring leap seconds: <code>86400</code>.\n   * @type {number}\n   * @constant\n   */\n  SECONDS_PER_DAY: 86400.0,\n\n  /**\n   * The number of days in one Julian century: <code>36525</code>.\n   * @type {number}\n   * @constant\n   */\n  DAYS_PER_JULIAN_CENTURY: 36525.0,\n\n  /**\n   * One trillionth of a second.\n   * @type {number}\n   * @constant\n   */\n  PICOSECOND: 0.000000001,\n\n  /**\n   * The number of days to subtract from a Julian date to determine the\n   * modified Julian date, which gives the number of days since midnight\n   * on November 17, 1858.\n   * @type {number}\n   * @constant\n   */\n  MODIFIED_JULIAN_DATE_DIFFERENCE: 2400000.5,\n};\nexport default Object.freeze(TimeConstants);\n", "/**\n * Provides the type of time standards which JulianDate can take as input.\n *\n * @enum {number}\n *\n * @see JulianDate\n */\nconst TimeStandard = {\n  /**\n   * Represents the coordinated Universal Time (UTC) time standard.\n   *\n   * UTC is related to TAI according to the relationship\n   * <code>UTC = TAI - deltaT</code> where <code>deltaT</code> is the number of leap\n   * seconds which have been introduced as of the time in TAI.\n   *\n   * @type {number}\n   * @constant\n   */\n  UTC: 0,\n\n  /**\n   * Represents the International Atomic Time (TAI) time standard.\n   * TAI is the principal time standard to which the other time standards are related.\n   *\n   * @type {number}\n   * @constant\n   */\n  TAI: 1,\n};\nexport default Object.freeze(TimeStandard);\n", "import binarySearch from \"./binarySearch.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport GregorianDate from \"./GregorianDate.js\";\nimport isLeapYear from \"./isLeapYear.js\";\nimport LeapSecond from \"./LeapSecond.js\";\nimport TimeConstants from \"./TimeConstants.js\";\nimport TimeStandard from \"./TimeStandard.js\";\n\nconst gregorianDateScratch = new GregorianDate();\nconst daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst daysInLeapFeburary = 29;\n\nfunction compareLeapSecondDates(leapSecond, dateToFind) {\n  return JulianDate.compare(leapSecond.julianDate, dateToFind.julianDate);\n}\n\n// we don't really need a leap second instance, anything with a julianDate property will do\nconst binarySearchScratchLeapSecond = new LeapSecond();\n\nfunction convertUtcToTai(julianDate) {\n  //Even though julianDate is in UTC, we'll treat it as TAI and\n  //search the leap second table for it.\n  binarySearchScratchLeapSecond.julianDate = julianDate;\n  const leapSeconds = JulianDate.leapSeconds;\n  let index = binarySearch(\n    leapSeconds,\n    binarySearchScratchLeapSecond,\n    compareLeapSecondDates\n  );\n\n  if (index < 0) {\n    index = ~index;\n  }\n\n  if (index >= leapSeconds.length) {\n    index = leapSeconds.length - 1;\n  }\n\n  let offset = leapSeconds[index].offset;\n  if (index > 0) {\n    //Now we have the index of the closest leap second that comes on or after our UTC time.\n    //However, if the difference between the UTC date being converted and the TAI\n    //defined leap second is greater than the offset, we are off by one and need to use\n    //the previous leap second.\n    const difference = JulianDate.secondsDifference(\n      leapSeconds[index].julianDate,\n      julianDate\n    );\n    if (difference > offset) {\n      index--;\n      offset = leapSeconds[index].offset;\n    }\n  }\n\n  JulianDate.addSeconds(julianDate, offset, julianDate);\n}\n\nfunction convertTaiToUtc(julianDate, result) {\n  binarySearchScratchLeapSecond.julianDate = julianDate;\n  const leapSeconds = JulianDate.leapSeconds;\n  let index = binarySearch(\n    leapSeconds,\n    binarySearchScratchLeapSecond,\n    compareLeapSecondDates\n  );\n  if (index < 0) {\n    index = ~index;\n  }\n\n  //All times before our first leap second get the first offset.\n  if (index === 0) {\n    return JulianDate.addSeconds(julianDate, -leapSeconds[0].offset, result);\n  }\n\n  //All times after our leap second get the last offset.\n  if (index >= leapSeconds.length) {\n    return JulianDate.addSeconds(\n      julianDate,\n      -leapSeconds[index - 1].offset,\n      result\n    );\n  }\n\n  //Compute the difference between the found leap second and the time we are converting.\n  const difference = JulianDate.secondsDifference(\n    leapSeconds[index].julianDate,\n    julianDate\n  );\n\n  if (difference === 0) {\n    //The date is in our leap second table.\n    return JulianDate.addSeconds(\n      julianDate,\n      -leapSeconds[index].offset,\n      result\n    );\n  }\n\n  if (difference <= 1.0) {\n    //The requested date is during the moment of a leap second, then we cannot convert to UTC\n    return undefined;\n  }\n\n  //The time is in between two leap seconds, index is the leap second after the date\n  //we're converting, so we subtract one to get the correct LeapSecond instance.\n  return JulianDate.addSeconds(\n    julianDate,\n    -leapSeconds[--index].offset,\n    result\n  );\n}\n\nfunction setComponents(wholeDays, secondsOfDay, julianDate) {\n  const extraDays = (secondsOfDay / TimeConstants.SECONDS_PER_DAY) | 0;\n  wholeDays += extraDays;\n  secondsOfDay -= TimeConstants.SECONDS_PER_DAY * extraDays;\n\n  if (secondsOfDay < 0) {\n    wholeDays--;\n    secondsOfDay += TimeConstants.SECONDS_PER_DAY;\n  }\n\n  julianDate.dayNumber = wholeDays;\n  julianDate.secondsOfDay = secondsOfDay;\n  return julianDate;\n}\n\nfunction computeJulianDateComponents(\n  year,\n  month,\n  day,\n  hour,\n  minute,\n  second,\n  millisecond\n) {\n  // Algorithm from page 604 of the Explanatory Supplement to the\n  // Astronomical Almanac (Seidelmann 1992).\n\n  const a = ((month - 14) / 12) | 0;\n  const b = year + 4800 + a;\n  let dayNumber =\n    (((1461 * b) / 4) | 0) +\n    (((367 * (month - 2 - 12 * a)) / 12) | 0) -\n    (((3 * (((b + 100) / 100) | 0)) / 4) | 0) +\n    day -\n    32075;\n\n  // JulianDates are noon-based\n  hour = hour - 12;\n  if (hour < 0) {\n    hour += 24;\n  }\n\n  const secondsOfDay =\n    second +\n    (hour * TimeConstants.SECONDS_PER_HOUR +\n      minute * TimeConstants.SECONDS_PER_MINUTE +\n      millisecond * TimeConstants.SECONDS_PER_MILLISECOND);\n\n  if (secondsOfDay >= 43200.0) {\n    dayNumber -= 1;\n  }\n\n  return [dayNumber, secondsOfDay];\n}\n\n//Regular expressions used for ISO8601 date parsing.\n//YYYY\nconst matchCalendarYear = /^(\\d{4})$/;\n//YYYY-MM (YYYYMM is invalid)\nconst matchCalendarMonth = /^(\\d{4})-(\\d{2})$/;\n//YYYY-DDD or YYYYDDD\nconst matchOrdinalDate = /^(\\d{4})-?(\\d{3})$/;\n//YYYY-Www or YYYYWww or YYYY-Www-D or YYYYWwwD\nconst matchWeekDate = /^(\\d{4})-?W(\\d{2})-?(\\d{1})?$/;\n//YYYY-MM-DD or YYYYMMDD\nconst matchCalendarDate = /^(\\d{4})-?(\\d{2})-?(\\d{2})$/;\n// Match utc offset\nconst utcOffset = /([Z+\\-])?(\\d{2})?:?(\\d{2})?$/;\n// Match hours HH or HH.xxxxx\nconst matchHours = /^(\\d{2})(\\.\\d+)?/.source + utcOffset.source;\n// Match hours/minutes HH:MM HHMM.xxxxx\nconst matchHoursMinutes = /^(\\d{2}):?(\\d{2})(\\.\\d+)?/.source + utcOffset.source;\n// Match hours/minutes HH:MM:SS HHMMSS.xxxxx\nconst matchHoursMinutesSeconds =\n  /^(\\d{2}):?(\\d{2}):?(\\d{2})(\\.\\d+)?/.source + utcOffset.source;\n\nconst iso8601ErrorMessage = \"Invalid ISO 8601 date.\";\n\n/**\n * Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC).\n * For increased precision, this class stores the whole number part of the date and the seconds\n * part of the date in separate components.  In order to be safe for arithmetic and represent\n * leap seconds, the date is always stored in the International Atomic Time standard\n * {@link TimeStandard.TAI}.\n * @alias JulianDate\n * @constructor\n *\n * @param {number} [julianDayNumber=0.0] The Julian Day Number representing the number of whole days.  Fractional days will also be handled correctly.\n * @param {number} [secondsOfDay=0.0] The number of seconds into the current Julian Day Number.  Fractional seconds, negative seconds and seconds greater than a day will be handled correctly.\n * @param {TimeStandard} [timeStandard=TimeStandard.UTC] The time standard in which the first two parameters are defined.\n */\nfunction JulianDate(julianDayNumber, secondsOfDay, timeStandard) {\n  /**\n   * Gets or sets the number of whole days.\n   * @type {number}\n   */\n  this.dayNumber = undefined;\n\n  /**\n   * Gets or sets the number of seconds into the current day.\n   * @type {number}\n   */\n  this.secondsOfDay = undefined;\n\n  julianDayNumber = defaultValue(julianDayNumber, 0.0);\n  secondsOfDay = defaultValue(secondsOfDay, 0.0);\n  timeStandard = defaultValue(timeStandard, TimeStandard.UTC);\n\n  //If julianDayNumber is fractional, make it an integer and add the number of seconds the fraction represented.\n  const wholeDays = julianDayNumber | 0;\n  secondsOfDay =\n    secondsOfDay +\n    (julianDayNumber - wholeDays) * TimeConstants.SECONDS_PER_DAY;\n\n  setComponents(wholeDays, secondsOfDay, this);\n\n  if (timeStandard === TimeStandard.UTC) {\n    convertUtcToTai(this);\n  }\n}\n\n/**\n * Creates a new instance from a GregorianDate.\n *\n * @param {GregorianDate} date A GregorianDate.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n *\n * @exception {DeveloperError} date must be a valid GregorianDate.\n */\nJulianDate.fromGregorianDate = function (date, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!(date instanceof GregorianDate)) {\n    throw new DeveloperError(\"date must be a valid GregorianDate.\");\n  }\n  //>>includeEnd('debug');\n\n  const components = computeJulianDateComponents(\n    date.year,\n    date.month,\n    date.day,\n    date.hour,\n    date.minute,\n    date.second,\n    date.millisecond\n  );\n  if (!defined(result)) {\n    return new JulianDate(components[0], components[1], TimeStandard.UTC);\n  }\n  setComponents(components[0], components[1], result);\n  convertUtcToTai(result);\n  return result;\n};\n\n/**\n * Creates a new instance from a JavaScript Date.\n *\n * @param {Date} date A JavaScript Date.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n *\n * @exception {DeveloperError} date must be a valid JavaScript Date.\n */\nJulianDate.fromDate = function (date, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!(date instanceof Date) || isNaN(date.getTime())) {\n    throw new DeveloperError(\"date must be a valid JavaScript Date.\");\n  }\n  //>>includeEnd('debug');\n\n  const components = computeJulianDateComponents(\n    date.getUTCFullYear(),\n    date.getUTCMonth() + 1,\n    date.getUTCDate(),\n    date.getUTCHours(),\n    date.getUTCMinutes(),\n    date.getUTCSeconds(),\n    date.getUTCMilliseconds()\n  );\n  if (!defined(result)) {\n    return new JulianDate(components[0], components[1], TimeStandard.UTC);\n  }\n  setComponents(components[0], components[1], result);\n  convertUtcToTai(result);\n  return result;\n};\n\n/**\n * Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date.\n * This method is superior to <code>Date.parse</code> because it will handle all valid formats defined by the ISO 8601\n * specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations.\n *\n * @param {string} iso8601String An ISO 8601 date.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n *\n * @exception {DeveloperError} Invalid ISO 8601 date.\n */\nJulianDate.fromIso8601 = function (iso8601String, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof iso8601String !== \"string\") {\n    throw new DeveloperError(iso8601ErrorMessage);\n  }\n  //>>includeEnd('debug');\n\n  //Comma and decimal point both indicate a fractional number according to ISO 8601,\n  //start out by blanket replacing , with . which is the only valid such symbol in JS.\n  iso8601String = iso8601String.replace(\",\", \".\");\n\n  //Split the string into its date and time components, denoted by a mandatory T\n  let tokens = iso8601String.split(\"T\");\n  let year;\n  let month = 1;\n  let day = 1;\n  let hour = 0;\n  let minute = 0;\n  let second = 0;\n  let millisecond = 0;\n\n  //Lacking a time is okay, but a missing date is illegal.\n  const date = tokens[0];\n  const time = tokens[1];\n  let tmp;\n  let inLeapYear;\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(date)) {\n    throw new DeveloperError(iso8601ErrorMessage);\n  }\n\n  let dashCount;\n  //>>includeEnd('debug');\n\n  //First match the date against possible regular expressions.\n  tokens = date.match(matchCalendarDate);\n  if (tokens !== null) {\n    //>>includeStart('debug', pragmas.debug);\n    dashCount = date.split(\"-\").length - 1;\n    if (dashCount > 0 && dashCount !== 2) {\n      throw new DeveloperError(iso8601ErrorMessage);\n    }\n    //>>includeEnd('debug');\n    year = +tokens[1];\n    month = +tokens[2];\n    day = +tokens[3];\n  } else {\n    tokens = date.match(matchCalendarMonth);\n    if (tokens !== null) {\n      year = +tokens[1];\n      month = +tokens[2];\n    } else {\n      tokens = date.match(matchCalendarYear);\n      if (tokens !== null) {\n        year = +tokens[1];\n      } else {\n        //Not a year/month/day so it must be an ordinal date.\n        let dayOfYear;\n        tokens = date.match(matchOrdinalDate);\n        if (tokens !== null) {\n          year = +tokens[1];\n          dayOfYear = +tokens[2];\n          inLeapYear = isLeapYear(year);\n\n          //This validation is only applicable for this format.\n          //>>includeStart('debug', pragmas.debug);\n          if (\n            dayOfYear < 1 ||\n            (inLeapYear && dayOfYear > 366) ||\n            (!inLeapYear && dayOfYear > 365)\n          ) {\n            throw new DeveloperError(iso8601ErrorMessage);\n          }\n          //>>includeEnd('debug')\n        } else {\n          tokens = date.match(matchWeekDate);\n          if (tokens !== null) {\n            //ISO week date to ordinal date from\n            //http://en.wikipedia.org/w/index.php?title=ISO_week_date&oldid=474176775\n            year = +tokens[1];\n            const weekNumber = +tokens[2];\n            const dayOfWeek = +tokens[3] || 0;\n\n            //>>includeStart('debug', pragmas.debug);\n            dashCount = date.split(\"-\").length - 1;\n            if (\n              dashCount > 0 &&\n              ((!defined(tokens[3]) && dashCount !== 1) ||\n                (defined(tokens[3]) && dashCount !== 2))\n            ) {\n              throw new DeveloperError(iso8601ErrorMessage);\n            }\n            //>>includeEnd('debug')\n\n            const january4 = new Date(Date.UTC(year, 0, 4));\n            dayOfYear = weekNumber * 7 + dayOfWeek - january4.getUTCDay() - 3;\n          } else {\n            //None of our regular expressions succeeded in parsing the date properly.\n            //>>includeStart('debug', pragmas.debug);\n            throw new DeveloperError(iso8601ErrorMessage);\n            //>>includeEnd('debug')\n          }\n        }\n        //Split an ordinal date into month/day.\n        tmp = new Date(Date.UTC(year, 0, 1));\n        tmp.setUTCDate(dayOfYear);\n        month = tmp.getUTCMonth() + 1;\n        day = tmp.getUTCDate();\n      }\n    }\n  }\n\n  //Now that we have all of the date components, validate them to make sure nothing is out of range.\n  inLeapYear = isLeapYear(year);\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    month < 1 ||\n    month > 12 ||\n    day < 1 ||\n    ((month !== 2 || !inLeapYear) && day > daysInMonth[month - 1]) ||\n    (inLeapYear && month === 2 && day > daysInLeapFeburary)\n  ) {\n    throw new DeveloperError(iso8601ErrorMessage);\n  }\n  //>>includeEnd('debug')\n\n  //Now move onto the time string, which is much simpler.\n  //If no time is specified, it is considered the beginning of the day, UTC to match Javascript's implementation.\n  let offsetIndex;\n  if (defined(time)) {\n    tokens = time.match(matchHoursMinutesSeconds);\n    if (tokens !== null) {\n      //>>includeStart('debug', pragmas.debug);\n      dashCount = time.split(\":\").length - 1;\n      if (dashCount > 0 && dashCount !== 2 && dashCount !== 3) {\n        throw new DeveloperError(iso8601ErrorMessage);\n      }\n      //>>includeEnd('debug')\n\n      hour = +tokens[1];\n      minute = +tokens[2];\n      second = +tokens[3];\n      millisecond = +(tokens[4] || 0) * 1000.0;\n      offsetIndex = 5;\n    } else {\n      tokens = time.match(matchHoursMinutes);\n      if (tokens !== null) {\n        //>>includeStart('debug', pragmas.debug);\n        dashCount = time.split(\":\").length - 1;\n        if (dashCount > 2) {\n          throw new DeveloperError(iso8601ErrorMessage);\n        }\n        //>>includeEnd('debug')\n\n        hour = +tokens[1];\n        minute = +tokens[2];\n        second = +(tokens[3] || 0) * 60.0;\n        offsetIndex = 4;\n      } else {\n        tokens = time.match(matchHours);\n        if (tokens !== null) {\n          hour = +tokens[1];\n          minute = +(tokens[2] || 0) * 60.0;\n          offsetIndex = 3;\n        } else {\n          //>>includeStart('debug', pragmas.debug);\n          throw new DeveloperError(iso8601ErrorMessage);\n          //>>includeEnd('debug')\n        }\n      }\n    }\n\n    //Validate that all values are in proper range.  Minutes and hours have special cases at 60 and 24.\n    //>>includeStart('debug', pragmas.debug);\n    if (\n      minute >= 60 ||\n      second >= 61 ||\n      hour > 24 ||\n      (hour === 24 && (minute > 0 || second > 0 || millisecond > 0))\n    ) {\n      throw new DeveloperError(iso8601ErrorMessage);\n    }\n    //>>includeEnd('debug');\n\n    //Check the UTC offset value, if no value exists, use local time\n    //a Z indicates UTC, + or - are offsets.\n    const offset = tokens[offsetIndex];\n    const offsetHours = +tokens[offsetIndex + 1];\n    const offsetMinutes = +(tokens[offsetIndex + 2] || 0);\n    switch (offset) {\n      case \"+\":\n        hour = hour - offsetHours;\n        minute = minute - offsetMinutes;\n        break;\n      case \"-\":\n        hour = hour + offsetHours;\n        minute = minute + offsetMinutes;\n        break;\n      case \"Z\":\n        break;\n      default:\n        minute =\n          minute +\n          new Date(\n            Date.UTC(year, month - 1, day, hour, minute)\n          ).getTimezoneOffset();\n        break;\n    }\n  }\n\n  //ISO8601 denotes a leap second by any time having a seconds component of 60 seconds.\n  //If that's the case, we need to temporarily subtract a second in order to build a UTC date.\n  //Then we add it back in after converting to TAI.\n  const isLeapSecond = second === 60;\n  if (isLeapSecond) {\n    second--;\n  }\n\n  //Even if we successfully parsed the string into its components, after applying UTC offset or\n  //special cases like 24:00:00 denoting midnight, we need to normalize the data appropriately.\n\n  //milliseconds can never be greater than 1000, and seconds can't be above 60, so we start with minutes\n  while (minute >= 60) {\n    minute -= 60;\n    hour++;\n  }\n\n  while (hour >= 24) {\n    hour -= 24;\n    day++;\n  }\n\n  tmp = inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];\n  while (day > tmp) {\n    day -= tmp;\n    month++;\n\n    if (month > 12) {\n      month -= 12;\n      year++;\n    }\n\n    tmp =\n      inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];\n  }\n\n  //If UTC offset is at the beginning/end of the day, minutes can be negative.\n  while (minute < 0) {\n    minute += 60;\n    hour--;\n  }\n\n  while (hour < 0) {\n    hour += 24;\n    day--;\n  }\n\n  while (day < 1) {\n    month--;\n    if (month < 1) {\n      month += 12;\n      year--;\n    }\n\n    tmp =\n      inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];\n    day += tmp;\n  }\n\n  //Now create the JulianDate components from the Gregorian date and actually create our instance.\n  const components = computeJulianDateComponents(\n    year,\n    month,\n    day,\n    hour,\n    minute,\n    second,\n    millisecond\n  );\n\n  if (!defined(result)) {\n    result = new JulianDate(components[0], components[1], TimeStandard.UTC);\n  } else {\n    setComponents(components[0], components[1], result);\n    convertUtcToTai(result);\n  }\n\n  //If we were on a leap second, add it back.\n  if (isLeapSecond) {\n    JulianDate.addSeconds(result, 1, result);\n  }\n\n  return result;\n};\n\n/**\n * Creates a new instance that represents the current system time.\n * This is equivalent to calling <code>JulianDate.fromDate(new Date());</code>.\n *\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n */\nJulianDate.now = function (result) {\n  return JulianDate.fromDate(new Date(), result);\n};\n\nconst toGregorianDateScratch = new JulianDate(0, 0, TimeStandard.TAI);\n\n/**\n * Creates a {@link GregorianDate} from the provided instance.\n *\n * @param {JulianDate} julianDate The date to be converted.\n * @param {GregorianDate} [result] An existing instance to use for the result.\n * @returns {GregorianDate} The modified result parameter or a new instance if none was provided.\n */\nJulianDate.toGregorianDate = function (julianDate, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(julianDate)) {\n    throw new DeveloperError(\"julianDate is required.\");\n  }\n  //>>includeEnd('debug');\n\n  let isLeapSecond = false;\n  let thisUtc = convertTaiToUtc(julianDate, toGregorianDateScratch);\n  if (!defined(thisUtc)) {\n    //Conversion to UTC will fail if we are during a leap second.\n    //If that's the case, subtract a second and convert again.\n    //JavaScript doesn't support leap seconds, so this results in second 59 being repeated twice.\n    JulianDate.addSeconds(julianDate, -1, toGregorianDateScratch);\n    thisUtc = convertTaiToUtc(toGregorianDateScratch, toGregorianDateScratch);\n    isLeapSecond = true;\n  }\n\n  let julianDayNumber = thisUtc.dayNumber;\n  const secondsOfDay = thisUtc.secondsOfDay;\n\n  if (secondsOfDay >= 43200.0) {\n    julianDayNumber += 1;\n  }\n\n  // Algorithm from page 604 of the Explanatory Supplement to the\n  // Astronomical Almanac (Seidelmann 1992).\n  let L = (julianDayNumber + 68569) | 0;\n  const N = ((4 * L) / 146097) | 0;\n  L = (L - (((146097 * N + 3) / 4) | 0)) | 0;\n  const I = ((4000 * (L + 1)) / 1461001) | 0;\n  L = (L - (((1461 * I) / 4) | 0) + 31) | 0;\n  const J = ((80 * L) / 2447) | 0;\n  const day = (L - (((2447 * J) / 80) | 0)) | 0;\n  L = (J / 11) | 0;\n  const month = (J + 2 - 12 * L) | 0;\n  const year = (100 * (N - 49) + I + L) | 0;\n\n  let hour = (secondsOfDay / TimeConstants.SECONDS_PER_HOUR) | 0;\n  let remainingSeconds = secondsOfDay - hour * TimeConstants.SECONDS_PER_HOUR;\n  const minute = (remainingSeconds / TimeConstants.SECONDS_PER_MINUTE) | 0;\n  remainingSeconds =\n    remainingSeconds - minute * TimeConstants.SECONDS_PER_MINUTE;\n  let second = remainingSeconds | 0;\n  const millisecond =\n    (remainingSeconds - second) / TimeConstants.SECONDS_PER_MILLISECOND;\n\n  // JulianDates are noon-based\n  hour += 12;\n  if (hour > 23) {\n    hour -= 24;\n  }\n\n  //If we were on a leap second, add it back.\n  if (isLeapSecond) {\n    second += 1;\n  }\n\n  if (!defined(result)) {\n    return new GregorianDate(\n      year,\n      month,\n      day,\n      hour,\n      minute,\n      second,\n      millisecond,\n      isLeapSecond\n    );\n  }\n\n  result.year = year;\n  result.month = month;\n  result.day = day;\n  result.hour = hour;\n  result.minute = minute;\n  result.second = second;\n  result.millisecond = millisecond;\n  result.isLeapSecond = isLeapSecond;\n  return result;\n};\n\n/**\n * Creates a JavaScript Date from the provided instance.\n * Since JavaScript dates are only accurate to the nearest millisecond and\n * cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead.\n * If the provided JulianDate is during a leap second, the previous second is used.\n *\n * @param {JulianDate} julianDate The date to be converted.\n * @returns {Date} A new instance representing the provided date.\n */\nJulianDate.toDate = function (julianDate) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(julianDate)) {\n    throw new DeveloperError(\"julianDate is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const gDate = JulianDate.toGregorianDate(julianDate, gregorianDateScratch);\n  let second = gDate.second;\n  if (gDate.isLeapSecond) {\n    second -= 1;\n  }\n  return new Date(\n    Date.UTC(\n      gDate.year,\n      gDate.month - 1,\n      gDate.day,\n      gDate.hour,\n      gDate.minute,\n      second,\n      gDate.millisecond\n    )\n  );\n};\n\n/**\n * Creates an ISO8601 representation of the provided date.\n *\n * @param {JulianDate} julianDate The date to be converted.\n * @param {number} [precision] The number of fractional digits used to represent the seconds component.  By default, the most precise representation is used.\n * @returns {string} The ISO8601 representation of the provided date.\n */\nJulianDate.toIso8601 = function (julianDate, precision) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(julianDate)) {\n    throw new DeveloperError(\"julianDate is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const gDate = JulianDate.toGregorianDate(julianDate, gregorianDateScratch);\n  let year = gDate.year;\n  let month = gDate.month;\n  let day = gDate.day;\n  let hour = gDate.hour;\n  const minute = gDate.minute;\n  const second = gDate.second;\n  const millisecond = gDate.millisecond;\n\n  // special case - Iso8601.MAXIMUM_VALUE produces a string which we can't parse unless we adjust.\n  // 10000-01-01T00:00:00 is the same instant as 9999-12-31T24:00:00\n  if (\n    year === 10000 &&\n    month === 1 &&\n    day === 1 &&\n    hour === 0 &&\n    minute === 0 &&\n    second === 0 &&\n    millisecond === 0\n  ) {\n    year = 9999;\n    month = 12;\n    day = 31;\n    hour = 24;\n  }\n\n  let millisecondStr;\n\n  if (!defined(precision) && millisecond !== 0) {\n    //Forces milliseconds into a number with at least 3 digits to whatever the default toString() precision is.\n    millisecondStr = (millisecond * 0.01).toString().replace(\".\", \"\");\n    return `${year.toString().padStart(4, \"0\")}-${month\n      .toString()\n      .padStart(2, \"0\")}-${day\n      .toString()\n      .padStart(2, \"0\")}T${hour\n      .toString()\n      .padStart(2, \"0\")}:${minute\n      .toString()\n      .padStart(2, \"0\")}:${second\n      .toString()\n      .padStart(2, \"0\")}.${millisecondStr}Z`;\n  }\n\n  //Precision is either 0 or milliseconds is 0 with undefined precision, in either case, leave off milliseconds entirely\n  if (!defined(precision) || precision === 0) {\n    return `${year.toString().padStart(4, \"0\")}-${month\n      .toString()\n      .padStart(2, \"0\")}-${day\n      .toString()\n      .padStart(2, \"0\")}T${hour\n      .toString()\n      .padStart(2, \"0\")}:${minute\n      .toString()\n      .padStart(2, \"0\")}:${second.toString().padStart(2, \"0\")}Z`;\n  }\n\n  //Forces milliseconds into a number with at least 3 digits to whatever the specified precision is.\n  millisecondStr = (millisecond * 0.01)\n    .toFixed(precision)\n    .replace(\".\", \"\")\n    .slice(0, precision);\n  return `${year.toString().padStart(4, \"0\")}-${month\n    .toString()\n    .padStart(2, \"0\")}-${day\n    .toString()\n    .padStart(2, \"0\")}T${hour\n    .toString()\n    .padStart(2, \"0\")}:${minute\n    .toString()\n    .padStart(2, \"0\")}:${second\n    .toString()\n    .padStart(2, \"0\")}.${millisecondStr}Z`;\n};\n\n/**\n * Duplicates a JulianDate instance.\n *\n * @param {JulianDate} julianDate The date to duplicate.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined.\n */\nJulianDate.clone = function (julianDate, result) {\n  if (!defined(julianDate)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    return new JulianDate(\n      julianDate.dayNumber,\n      julianDate.secondsOfDay,\n      TimeStandard.TAI\n    );\n  }\n  result.dayNumber = julianDate.dayNumber;\n  result.secondsOfDay = julianDate.secondsOfDay;\n  return result;\n};\n\n/**\n * Compares two instances.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {number} A negative value if left is less than right, a positive value if left is greater than right, or zero if left and right are equal.\n */\nJulianDate.compare = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(left)) {\n    throw new DeveloperError(\"left is required.\");\n  }\n  if (!defined(right)) {\n    throw new DeveloperError(\"right is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const julianDayNumberDifference = left.dayNumber - right.dayNumber;\n  if (julianDayNumberDifference !== 0) {\n    return julianDayNumberDifference;\n  }\n  return left.secondsOfDay - right.secondsOfDay;\n};\n\n/**\n * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {JulianDate} [left] The first instance.\n * @param {JulianDate} [right] The second instance.\n * @returns {boolean} <code>true</code> if the dates are equal; otherwise, <code>false</code>.\n */\nJulianDate.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left.dayNumber === right.dayNumber &&\n      left.secondsOfDay === right.secondsOfDay)\n  );\n};\n\n/**\n * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of\n * each other.  That is, in order for the dates to be considered equal (and for\n * this function to return <code>true</code>), the absolute value of the difference between them, in\n * seconds, must be less than <code>epsilon</code>.\n *\n * @param {JulianDate} [left] The first instance.\n * @param {JulianDate} [right] The second instance.\n * @param {number} [epsilon=0] The maximum number of seconds that should separate the two instances.\n * @returns {boolean} <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.\n */\nJulianDate.equalsEpsilon = function (left, right, epsilon) {\n  epsilon = defaultValue(epsilon, 0);\n\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      Math.abs(JulianDate.secondsDifference(left, right)) <= epsilon)\n  );\n};\n\n/**\n * Computes the total number of whole and fractional days represented by the provided instance.\n *\n * @param {JulianDate} julianDate The date.\n * @returns {number} The Julian date as single floating point number.\n */\nJulianDate.totalDays = function (julianDate) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(julianDate)) {\n    throw new DeveloperError(\"julianDate is required.\");\n  }\n  //>>includeEnd('debug');\n  return (\n    julianDate.dayNumber +\n    julianDate.secondsOfDay / TimeConstants.SECONDS_PER_DAY\n  );\n};\n\n/**\n * Computes the difference in seconds between the provided instance.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {number} The difference, in seconds, when subtracting <code>right</code> from <code>left</code>.\n */\nJulianDate.secondsDifference = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(left)) {\n    throw new DeveloperError(\"left is required.\");\n  }\n  if (!defined(right)) {\n    throw new DeveloperError(\"right is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const dayDifference =\n    (left.dayNumber - right.dayNumber) * TimeConstants.SECONDS_PER_DAY;\n  return dayDifference + (left.secondsOfDay - right.secondsOfDay);\n};\n\n/**\n * Computes the difference in days between the provided instance.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {number} The difference, in days, when subtracting <code>right</code> from <code>left</code>.\n */\nJulianDate.daysDifference = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(left)) {\n    throw new DeveloperError(\"left is required.\");\n  }\n  if (!defined(right)) {\n    throw new DeveloperError(\"right is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const dayDifference = left.dayNumber - right.dayNumber;\n  const secondDifference =\n    (left.secondsOfDay - right.secondsOfDay) / TimeConstants.SECONDS_PER_DAY;\n  return dayDifference + secondDifference;\n};\n\n/**\n * Computes the number of seconds the provided instance is ahead of UTC.\n *\n * @param {JulianDate} julianDate The date.\n * @returns {number} The number of seconds the provided instance is ahead of UTC\n */\nJulianDate.computeTaiMinusUtc = function (julianDate) {\n  binarySearchScratchLeapSecond.julianDate = julianDate;\n  const leapSeconds = JulianDate.leapSeconds;\n  let index = binarySearch(\n    leapSeconds,\n    binarySearchScratchLeapSecond,\n    compareLeapSecondDates\n  );\n  if (index < 0) {\n    index = ~index;\n    --index;\n    if (index < 0) {\n      index = 0;\n    }\n  }\n  return leapSeconds[index].offset;\n};\n\n/**\n * Adds the provided number of seconds to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} seconds The number of seconds to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addSeconds = function (julianDate, seconds, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(julianDate)) {\n    throw new DeveloperError(\"julianDate is required.\");\n  }\n  if (!defined(seconds)) {\n    throw new DeveloperError(\"seconds is required.\");\n  }\n  if (!defined(result)) {\n    throw new DeveloperError(\"result is required.\");\n  }\n  //>>includeEnd('debug');\n\n  return setComponents(\n    julianDate.dayNumber,\n    julianDate.secondsOfDay + seconds,\n    result\n  );\n};\n\n/**\n * Adds the provided number of minutes to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} minutes The number of minutes to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addMinutes = function (julianDate, minutes, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(julianDate)) {\n    throw new DeveloperError(\"julianDate is required.\");\n  }\n  if (!defined(minutes)) {\n    throw new DeveloperError(\"minutes is required.\");\n  }\n  if (!defined(result)) {\n    throw new DeveloperError(\"result is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const newSecondsOfDay =\n    julianDate.secondsOfDay + minutes * TimeConstants.SECONDS_PER_MINUTE;\n  return setComponents(julianDate.dayNumber, newSecondsOfDay, result);\n};\n\n/**\n * Adds the provided number of hours to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} hours The number of hours to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addHours = function (julianDate, hours, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(julianDate)) {\n    throw new DeveloperError(\"julianDate is required.\");\n  }\n  if (!defined(hours)) {\n    throw new DeveloperError(\"hours is required.\");\n  }\n  if (!defined(result)) {\n    throw new DeveloperError(\"result is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const newSecondsOfDay =\n    julianDate.secondsOfDay + hours * TimeConstants.SECONDS_PER_HOUR;\n  return setComponents(julianDate.dayNumber, newSecondsOfDay, result);\n};\n\n/**\n * Adds the provided number of days to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {number} days The number of days to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addDays = function (julianDate, days, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(julianDate)) {\n    throw new DeveloperError(\"julianDate is required.\");\n  }\n  if (!defined(days)) {\n    throw new DeveloperError(\"days is required.\");\n  }\n  if (!defined(result)) {\n    throw new DeveloperError(\"result is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const newJulianDayNumber = julianDate.dayNumber + days;\n  return setComponents(newJulianDayNumber, julianDate.secondsOfDay, result);\n};\n\n/**\n * Compares the provided instances and returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.\n */\nJulianDate.lessThan = function (left, right) {\n  return JulianDate.compare(left, right) < 0;\n};\n\n/**\n * Compares the provided instances and returns <code>true</code> if <code>left</code> is earlier than or equal to <code>right</code>, <code>false</code> otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} <code>true</code> if <code>left</code> is earlier than or equal to <code>right</code>, <code>false</code> otherwise.\n */\nJulianDate.lessThanOrEquals = function (left, right) {\n  return JulianDate.compare(left, right) <= 0;\n};\n\n/**\n * Compares the provided instances and returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.\n */\nJulianDate.greaterThan = function (left, right) {\n  return JulianDate.compare(left, right) > 0;\n};\n\n/**\n * Compares the provided instances and returns <code>true</code> if <code>left</code> is later than or equal to <code>right</code>, <code>false</code> otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {boolean} <code>true</code> if <code>left</code> is later than or equal to <code>right</code>, <code>false</code> otherwise.\n */\nJulianDate.greaterThanOrEquals = function (left, right) {\n  return JulianDate.compare(left, right) >= 0;\n};\n\n/**\n * Duplicates this instance.\n *\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n */\nJulianDate.prototype.clone = function (result) {\n  return JulianDate.clone(this, result);\n};\n\n/**\n * Compares this and the provided instance and returns <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {JulianDate} [right] The second instance.\n * @returns {boolean} <code>true</code> if the dates are equal; otherwise, <code>false</code>.\n */\nJulianDate.prototype.equals = function (right) {\n  return JulianDate.equals(this, right);\n};\n\n/**\n * Compares this and the provided instance and returns <code>true</code> if they are within <code>epsilon</code> seconds of\n * each other.  That is, in order for the dates to be considered equal (and for\n * this function to return <code>true</code>), the absolute value of the difference between them, in\n * seconds, must be less than <code>epsilon</code>.\n *\n * @param {JulianDate} [right] The second instance.\n * @param {number} [epsilon=0] The maximum number of seconds that should separate the two instances.\n * @returns {boolean} <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.\n */\nJulianDate.prototype.equalsEpsilon = function (right, epsilon) {\n  return JulianDate.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Creates a string representing this date in ISO8601 format.\n *\n * @returns {string} A string representing this date in ISO8601 format.\n */\nJulianDate.prototype.toString = function () {\n  return JulianDate.toIso8601(this);\n};\n\n/**\n * Gets or sets the list of leap seconds used throughout Cesium.\n * @memberof JulianDate\n * @type {LeapSecond[]}\n */\nJulianDate.leapSeconds = [\n  new LeapSecond(new JulianDate(2441317, 43210.0, TimeStandard.TAI), 10), // January 1, 1972 00:00:00 UTC\n  new LeapSecond(new JulianDate(2441499, 43211.0, TimeStandard.TAI), 11), // July 1, 1972 00:00:00 UTC\n  new LeapSecond(new JulianDate(2441683, 43212.0, TimeStandard.TAI), 12), // January 1, 1973 00:00:00 UTC\n  new LeapSecond(new JulianDate(2442048, 43213.0, TimeStandard.TAI), 13), // January 1, 1974 00:00:00 UTC\n  new LeapSecond(new JulianDate(2442413, 43214.0, TimeStandard.TAI), 14), // January 1, 1975 00:00:00 UTC\n  new LeapSecond(new JulianDate(2442778, 43215.0, TimeStandard.TAI), 15), // January 1, 1976 00:00:00 UTC\n  new LeapSecond(new JulianDate(2443144, 43216.0, TimeStandard.TAI), 16), // January 1, 1977 00:00:00 UTC\n  new LeapSecond(new JulianDate(2443509, 43217.0, TimeStandard.TAI), 17), // January 1, 1978 00:00:00 UTC\n  new LeapSecond(new JulianDate(2443874, 43218.0, TimeStandard.TAI), 18), // January 1, 1979 00:00:00 UTC\n  new LeapSecond(new JulianDate(2444239, 43219.0, TimeStandard.TAI), 19), // January 1, 1980 00:00:00 UTC\n  new LeapSecond(new JulianDate(2444786, 43220.0, TimeStandard.TAI), 20), // July 1, 1981 00:00:00 UTC\n  new LeapSecond(new JulianDate(2445151, 43221.0, TimeStandard.TAI), 21), // July 1, 1982 00:00:00 UTC\n  new LeapSecond(new JulianDate(2445516, 43222.0, TimeStandard.TAI), 22), // July 1, 1983 00:00:00 UTC\n  new LeapSecond(new JulianDate(2446247, 43223.0, TimeStandard.TAI), 23), // July 1, 1985 00:00:00 UTC\n  new LeapSecond(new JulianDate(2447161, 43224.0, TimeStandard.TAI), 24), // January 1, 1988 00:00:00 UTC\n  new LeapSecond(new JulianDate(2447892, 43225.0, TimeStandard.TAI), 25), // January 1, 1990 00:00:00 UTC\n  new LeapSecond(new JulianDate(2448257, 43226.0, TimeStandard.TAI), 26), // January 1, 1991 00:00:00 UTC\n  new LeapSecond(new JulianDate(2448804, 43227.0, TimeStandard.TAI), 27), // July 1, 1992 00:00:00 UTC\n  new LeapSecond(new JulianDate(2449169, 43228.0, TimeStandard.TAI), 28), // July 1, 1993 00:00:00 UTC\n  new LeapSecond(new JulianDate(2449534, 43229.0, TimeStandard.TAI), 29), // July 1, 1994 00:00:00 UTC\n  new LeapSecond(new JulianDate(2450083, 43230.0, TimeStandard.TAI), 30), // January 1, 1996 00:00:00 UTC\n  new LeapSecond(new JulianDate(2450630, 43231.0, TimeStandard.TAI), 31), // July 1, 1997 00:00:00 UTC\n  new LeapSecond(new JulianDate(2451179, 43232.0, TimeStandard.TAI), 32), // January 1, 1999 00:00:00 UTC\n  new LeapSecond(new JulianDate(2453736, 43233.0, TimeStandard.TAI), 33), // January 1, 2006 00:00:00 UTC\n  new LeapSecond(new JulianDate(2454832, 43234.0, TimeStandard.TAI), 34), // January 1, 2009 00:00:00 UTC\n  new LeapSecond(new JulianDate(2456109, 43235.0, TimeStandard.TAI), 35), // July 1, 2012 00:00:00 UTC\n  new LeapSecond(new JulianDate(2457204, 43236.0, TimeStandard.TAI), 36), // July 1, 2015 00:00:00 UTC\n  new LeapSecond(new JulianDate(2457754, 43237.0, TimeStandard.TAI), 37), // January 1, 2017 00:00:00 UTC\n];\nexport default JulianDate;\n", "import Uri from \"urijs\";\nimport appendForwardSlash from \"./appendForwardSlash.js\";\nimport Check from \"./Check.js\";\nimport clone from \"./clone.js\";\nimport combine from \"./combine.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defer from \"./defer.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport getAbsoluteUri from \"./getAbsoluteUri.js\";\nimport getBaseUri from \"./getBaseUri.js\";\nimport getExtensionFromUri from \"./getExtensionFromUri.js\";\nimport getImagePixels from \"./getImagePixels.js\";\nimport isBlobUri from \"./isBlobUri.js\";\nimport isCrossOriginUrl from \"./isCrossOriginUrl.js\";\nimport isDataUri from \"./isDataUri.js\";\nimport loadAndExecuteScript from \"./loadAndExecuteScript.js\";\nimport CesiumMath from \"./Math.js\";\nimport objectToQuery from \"./objectToQuery.js\";\nimport queryToObject from \"./queryToObject.js\";\nimport Request from \"./Request.js\";\nimport RequestErrorEvent from \"./RequestErrorEvent.js\";\nimport RequestScheduler from \"./RequestScheduler.js\";\nimport RequestState from \"./RequestState.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TrustedServers from \"./TrustedServers.js\";\n\nconst xhrBlobSupported = (function () {\n  try {\n    const xhr = new XMLHttpRequest();\n    xhr.open(\"GET\", \"#\", true);\n    xhr.responseType = \"blob\";\n    return xhr.responseType === \"blob\";\n  } catch (e) {\n    return false;\n  }\n})();\n\n/**\n * @typedef {object} Resource.ConstructorOptions\n *\n * Initialization options for the Resource constructor\n *\n * @property {string} url The url of the resource.\n * @property {object} [queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @property {object} [templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @property {object} [headers={}] Additional HTTP headers that will be sent.\n * @property {Proxy} [proxy] A proxy to be used when loading the resource.\n * @property {Resource.RetryCallback} [retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @property {number} [retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @property {Request} [request] A Request object that will be used. Intended for internal use only.\n * @property {boolean} [parseUrl=true] If true, parse the url for query parameters; otherwise store the url without change\n */\n\n/**\n * A resource that includes the location and any other parameters we need to retrieve it or create derived resources. It also provides the ability to retry requests.\n *\n * @alias Resource\n * @constructor\n *\n * @param {string|Resource.ConstructorOptions} options A url or an object describing initialization options\n *\n * @example\n * function refreshTokenRetryCallback(resource, error) {\n *   if (error.statusCode === 403) {\n *     // 403 status code means a new token should be generated\n *     return getNewAccessToken()\n *       .then(function(token) {\n *         resource.queryParameters.access_token = token;\n *         return true;\n *       })\n *       .catch(function() {\n *         return false;\n *       });\n *   }\n *\n *   return false;\n * }\n *\n * const resource = new Resource({\n *    url: 'http://server.com/path/to/resource.json',\n *    proxy: new DefaultProxy('/proxy/'),\n *    headers: {\n *      'X-My-Header': 'valueOfHeader'\n *    },\n *    queryParameters: {\n *      'access_token': '123-435-456-000'\n *    },\n *    retryCallback: refreshTokenRetryCallback,\n *    retryAttempts: 1\n * });\n */\nfunction Resource(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  if (typeof options === \"string\") {\n    options = {\n      url: options,\n    };\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"options.url\", options.url);\n  //>>includeEnd('debug');\n\n  this._url = undefined;\n  this._templateValues = defaultClone(options.templateValues, {});\n  this._queryParameters = defaultClone(options.queryParameters, {});\n\n  /**\n   * Additional HTTP headers that will be sent with the request.\n   *\n   * @type {object}\n   */\n  this.headers = defaultClone(options.headers, {});\n\n  /**\n   * A Request object that will be used. Intended for internal use only.\n   *\n   * @type {Request}\n   */\n  this.request = defaultValue(options.request, new Request());\n\n  /**\n   * A proxy to be used when loading the resource.\n   *\n   * @type {Proxy}\n   */\n  this.proxy = options.proxy;\n\n  /**\n   * Function to call when a request for this resource fails. If it returns true or a Promise that resolves to true, the request will be retried.\n   *\n   * @type {Function}\n   */\n  this.retryCallback = options.retryCallback;\n\n  /**\n   * The number of times the retryCallback should be called before giving up.\n   *\n   * @type {number}\n   */\n  this.retryAttempts = defaultValue(options.retryAttempts, 0);\n  this._retryCount = 0;\n\n  const parseUrl = defaultValue(options.parseUrl, true);\n  if (parseUrl) {\n    this.parseUrl(options.url, true, true);\n  } else {\n    this._url = options.url;\n  }\n\n  this._credits = options.credits;\n}\n\n/**\n * Clones a value if it is defined, otherwise returns the default value\n *\n * @param {object} [value] The value to clone.\n * @param {object} [defaultValue] The default value.\n *\n * @returns {object} A clone of value or the defaultValue.\n *\n * @private\n */\nfunction defaultClone(value, defaultValue) {\n  return defined(value) ? clone(value) : defaultValue;\n}\n\n/**\n * A helper function to create a resource depending on whether we have a String or a Resource\n *\n * @param {Resource|string} resource A Resource or a String to use when creating a new Resource.\n *\n * @returns {Resource} If resource is a String, a Resource constructed with the url and options. Otherwise the resource parameter is returned.\n *\n * @private\n */\nResource.createIfNeeded = function (resource) {\n  if (resource instanceof Resource) {\n    // Keep existing request object. This function is used internally to duplicate a Resource, so that it can't\n    //  be modified outside of a class that holds it (eg. an imagery or terrain provider). Since the Request objects\n    //  are managed outside of the providers, by the tile loading code, we want to keep the request property the same so if it is changed\n    //  in the underlying tiling code the requests for this resource will use it.\n    return resource.getDerivedResource({\n      request: resource.request,\n    });\n  }\n\n  if (typeof resource !== \"string\") {\n    return resource;\n  }\n\n  return new Resource({\n    url: resource,\n  });\n};\n\nlet supportsImageBitmapOptionsPromise;\n/**\n * A helper function to check whether createImageBitmap supports passing ImageBitmapOptions.\n *\n * @returns {Promise<boolean>} A promise that resolves to true if this browser supports creating an ImageBitmap with options.\n *\n * @private\n */\nResource.supportsImageBitmapOptions = function () {\n  // Until the HTML folks figure out what to do about this, we need to actually try loading an image to\n  // know if this browser supports passing options to the createImageBitmap function.\n  // https://github.com/whatwg/html/pull/4248\n  //\n  // We also need to check whether the colorSpaceConversion option is supported.\n  // We do this by loading a PNG with an embedded color profile, first with\n  // colorSpaceConversion: \"none\" and then with colorSpaceConversion: \"default\".\n  // If the pixel color is different then we know the option is working.\n  // As of Webkit 17612.3.6.1.6 the createImageBitmap promise resolves but the\n  // option is not actually supported.\n  if (defined(supportsImageBitmapOptionsPromise)) {\n    return supportsImageBitmapOptionsPromise;\n  }\n\n  if (typeof createImageBitmap !== \"function\") {\n    supportsImageBitmapOptionsPromise = Promise.resolve(false);\n    return supportsImageBitmapOptionsPromise;\n  }\n\n  const imageDataUri =\n    \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC\";\n\n  supportsImageBitmapOptionsPromise = Resource.fetchBlob({\n    url: imageDataUri,\n  })\n    .then(function (blob) {\n      const imageBitmapOptions = {\n        imageOrientation: \"flipY\", // default is \"none\"\n        premultiplyAlpha: \"none\", // default is \"default\"\n        colorSpaceConversion: \"none\", // default is \"default\"\n      };\n      return Promise.all([\n        createImageBitmap(blob, imageBitmapOptions),\n        createImageBitmap(blob),\n      ]);\n    })\n    .then(function (imageBitmaps) {\n      // Check whether the colorSpaceConversion option had any effect on the green channel\n      const colorWithOptions = getImagePixels(imageBitmaps[0]);\n      const colorWithDefaults = getImagePixels(imageBitmaps[1]);\n      return colorWithOptions[1] !== colorWithDefaults[1];\n    })\n    .catch(function () {\n      return false;\n    });\n\n  return supportsImageBitmapOptionsPromise;\n};\n\nObject.defineProperties(Resource, {\n  /**\n   * Returns true if blobs are supported.\n   *\n   * @memberof Resource\n   * @type {boolean}\n   *\n   * @readonly\n   */\n  isBlobSupported: {\n    get: function () {\n      return xhrBlobSupported;\n    },\n  },\n});\n\nObject.defineProperties(Resource.prototype, {\n  /**\n   * Query parameters appended to the url.\n   *\n   * @memberof Resource.prototype\n   * @type {object}\n   *\n   * @readonly\n   */\n  queryParameters: {\n    get: function () {\n      return this._queryParameters;\n    },\n  },\n\n  /**\n   * The key/value pairs used to replace template parameters in the url.\n   *\n   * @memberof Resource.prototype\n   * @type {object}\n   *\n   * @readonly\n   */\n  templateValues: {\n    get: function () {\n      return this._templateValues;\n    },\n  },\n\n  /**\n   * The url to the resource with template values replaced, query string appended and encoded by proxy if one was set.\n   *\n   * @memberof Resource.prototype\n   * @type {string}\n   */\n  url: {\n    get: function () {\n      return this.getUrlComponent(true, true);\n    },\n    set: function (value) {\n      this.parseUrl(value, false, false);\n    },\n  },\n\n  /**\n   * The file extension of the resource.\n   *\n   * @memberof Resource.prototype\n   * @type {string}\n   *\n   * @readonly\n   */\n  extension: {\n    get: function () {\n      return getExtensionFromUri(this._url);\n    },\n  },\n\n  /**\n   * True if the Resource refers to a data URI.\n   *\n   * @memberof Resource.prototype\n   * @type {boolean}\n   */\n  isDataUri: {\n    get: function () {\n      return isDataUri(this._url);\n    },\n  },\n\n  /**\n   * True if the Resource refers to a blob URI.\n   *\n   * @memberof Resource.prototype\n   * @type {boolean}\n   */\n  isBlobUri: {\n    get: function () {\n      return isBlobUri(this._url);\n    },\n  },\n\n  /**\n   * True if the Resource refers to a cross origin URL.\n   *\n   * @memberof Resource.prototype\n   * @type {boolean}\n   */\n  isCrossOriginUrl: {\n    get: function () {\n      return isCrossOriginUrl(this._url);\n    },\n  },\n\n  /**\n   * True if the Resource has request headers. This is equivalent to checking if the headers property has any keys.\n   *\n   * @memberof Resource.prototype\n   * @type {boolean}\n   */\n  hasHeaders: {\n    get: function () {\n      return Object.keys(this.headers).length > 0;\n    },\n  },\n\n  /**\n   * Gets the credits required for attribution of an asset.\n   * @private\n   */\n  credits: {\n    get: function () {\n      return this._credits;\n    },\n  },\n});\n\n/**\n * Override Object#toString so that implicit string conversion gives the\n * complete URL represented by this Resource.\n *\n * @returns {string} The URL represented by this Resource\n */\nResource.prototype.toString = function () {\n  return this.getUrlComponent(true, true);\n};\n\n/**\n * Parse a url string, and store its info\n *\n * @param {string} url The input url string.\n * @param {boolean} merge If true, we'll merge with the resource's existing queryParameters. Otherwise they will be replaced.\n * @param {boolean} preserveQuery If true duplicate parameters will be concatenated into an array. If false, keys in url will take precedence.\n * @param {string} [baseUrl] If supplied, and input url is a relative url, it will be made absolute relative to baseUrl\n *\n * @private\n */\nResource.prototype.parseUrl = function (url, merge, preserveQuery, baseUrl) {\n  let uri = new Uri(url);\n  const query = parseQueryString(uri.query());\n\n  this._queryParameters = merge\n    ? combineQueryParameters(query, this.queryParameters, preserveQuery)\n    : query;\n\n  // Remove unneeded info from the Uri\n  uri.search(\"\");\n  uri.fragment(\"\");\n\n  if (defined(baseUrl) && uri.scheme() === \"\") {\n    uri = uri.absoluteTo(getAbsoluteUri(baseUrl));\n  }\n\n  this._url = uri.toString();\n};\n\n/**\n * Parses a query string and returns the object equivalent.\n *\n * @param {string} queryString The query string\n * @returns {object}\n *\n * @private\n */\nfunction parseQueryString(queryString) {\n  if (queryString.length === 0) {\n    return {};\n  }\n\n  // Special case where the querystring is just a string, not key/value pairs\n  if (queryString.indexOf(\"=\") === -1) {\n    return { [queryString]: undefined };\n  }\n\n  return queryToObject(queryString);\n}\n\n/**\n * This combines a map of query parameters.\n *\n * @param {object} q1 The first map of query parameters. Values in this map will take precedence if preserveQueryParameters is false.\n * @param {object} q2 The second map of query parameters.\n * @param {boolean} preserveQueryParameters If true duplicate parameters will be concatenated into an array. If false, keys in q1 will take precedence.\n *\n * @returns {object} The combined map of query parameters.\n *\n * @example\n * const q1 = {\n *   a: 1,\n *   b: 2\n * };\n * const q2 = {\n *   a: 3,\n *   c: 4\n * };\n * const q3 = {\n *   b: [5, 6],\n *   d: 7\n * }\n *\n * // Returns\n * // {\n * //   a: [1, 3],\n * //   b: 2,\n * //   c: 4\n * // };\n * combineQueryParameters(q1, q2, true);\n *\n * // Returns\n * // {\n * //   a: 1,\n * //   b: 2,\n * //   c: 4\n * // };\n * combineQueryParameters(q1, q2, false);\n *\n * // Returns\n * // {\n * //   a: 1,\n * //   b: [2, 5, 6],\n * //   d: 7\n * // };\n * combineQueryParameters(q1, q3, true);\n *\n * // Returns\n * // {\n * //   a: 1,\n * //   b: 2,\n * //   d: 7\n * // };\n * combineQueryParameters(q1, q3, false);\n *\n * @private\n */\nfunction combineQueryParameters(q1, q2, preserveQueryParameters) {\n  if (!preserveQueryParameters) {\n    return combine(q1, q2);\n  }\n\n  const result = clone(q1, true);\n  for (const param in q2) {\n    if (q2.hasOwnProperty(param)) {\n      let value = result[param];\n      const q2Value = q2[param];\n      if (defined(value)) {\n        if (!Array.isArray(value)) {\n          value = result[param] = [value];\n        }\n\n        result[param] = value.concat(q2Value);\n      } else {\n        result[param] = Array.isArray(q2Value) ? q2Value.slice() : q2Value;\n      }\n    }\n  }\n\n  return result;\n}\n\n/**\n * Returns the url, optional with the query string and processed by a proxy.\n *\n * @param {boolean} [query=false] If true, the query string is included.\n * @param {boolean} [proxy=false] If true, the url is processed by the proxy object, if defined.\n *\n * @returns {string} The url with all the requested components.\n */\nResource.prototype.getUrlComponent = function (query, proxy) {\n  if (this.isDataUri) {\n    return this._url;\n  }\n\n  let url = this._url;\n  if (query) {\n    url = `${url}${stringifyQuery(this.queryParameters)}`;\n  }\n\n  // Restore the placeholders, which may have been escaped in objectToQuery or elsewhere\n  url = url.replace(/%7B/g, \"{\").replace(/%7D/g, \"}\");\n\n  const templateValues = this._templateValues;\n  if (Object.keys(templateValues).length > 0) {\n    url = url.replace(/{(.*?)}/g, function (match, key) {\n      const replacement = templateValues[key];\n      if (defined(replacement)) {\n        // use the replacement value from templateValues if there is one...\n        return encodeURIComponent(replacement);\n      }\n      // otherwise leave it unchanged\n      return match;\n    });\n  }\n\n  if (proxy && defined(this.proxy)) {\n    url = this.proxy.getURL(url);\n  }\n\n  return url;\n};\n\n/**\n * Converts a query object into a string.\n *\n * @param {object} queryObject The object with query parameters\n * @returns {string}\n *\n * @private\n */\nfunction stringifyQuery(queryObject) {\n  const keys = Object.keys(queryObject);\n\n  if (keys.length === 0) {\n    return \"\";\n  }\n  if (keys.length === 1 && !defined(queryObject[keys[0]])) {\n    // We have 1 key with an undefined value, so this is just a string, not key/value pairs\n    return `?${keys[0]}`;\n  }\n\n  return `?${objectToQuery(queryObject)}`;\n}\n\n/**\n * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,\n *  as opposed to adding them one at a time to the queryParameters property. If a value is already set, it will be replaced with the new value.\n *\n * @param {object} params The query parameters\n * @param {boolean} [useAsDefault=false] If true the params will be used as the default values, so they will only be set if they are undefined.\n */\nResource.prototype.setQueryParameters = function (params, useAsDefault) {\n  if (useAsDefault) {\n    this._queryParameters = combineQueryParameters(\n      this._queryParameters,\n      params,\n      false\n    );\n  } else {\n    this._queryParameters = combineQueryParameters(\n      params,\n      this._queryParameters,\n      false\n    );\n  }\n};\n\n/**\n * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,\n *  as opposed to adding them one at a time to the queryParameters property.\n *\n * @param {object} params The query parameters\n */\nResource.prototype.appendQueryParameters = function (params) {\n  this._queryParameters = combineQueryParameters(\n    params,\n    this._queryParameters,\n    true\n  );\n};\n\n/**\n * Combines the specified object and the existing template values. This allows you to add many values at once,\n *  as opposed to adding them one at a time to the templateValues property. If a value is already set, it will become an array and the new value will be appended.\n *\n * @param {object} template The template values\n * @param {boolean} [useAsDefault=false] If true the values will be used as the default values, so they will only be set if they are undefined.\n */\nResource.prototype.setTemplateValues = function (template, useAsDefault) {\n  if (useAsDefault) {\n    this._templateValues = combine(this._templateValues, template);\n  } else {\n    this._templateValues = combine(template, this._templateValues);\n  }\n};\n\n/**\n * Returns a resource relative to the current instance. All properties remain the same as the current instance unless overridden in options.\n *\n * @param {object} options An object with the following properties\n * @param {string} [options.url]  The url that will be resolved relative to the url of the current instance.\n * @param {object} [options.queryParameters] An object containing query parameters that will be combined with those of the current instance.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). These will be combined with those of the current instance.\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The function to call when loading the resource fails.\n * @param {number} [options.retryAttempts] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {boolean} [options.preserveQueryParameters=false] If true, this will keep all query parameters from the current resource and derived resource. If false, derived parameters will replace those of the current resource.\n *\n * @returns {Resource} The resource derived from the current one.\n */\nResource.prototype.getDerivedResource = function (options) {\n  const resource = this.clone();\n  resource._retryCount = 0;\n\n  if (defined(options.url)) {\n    const preserveQuery = defaultValue(options.preserveQueryParameters, false);\n    resource.parseUrl(options.url, true, preserveQuery, this._url);\n  }\n\n  if (defined(options.queryParameters)) {\n    resource._queryParameters = combine(\n      options.queryParameters,\n      resource.queryParameters\n    );\n  }\n  if (defined(options.templateValues)) {\n    resource._templateValues = combine(\n      options.templateValues,\n      resource.templateValues\n    );\n  }\n  if (defined(options.headers)) {\n    resource.headers = combine(options.headers, resource.headers);\n  }\n  if (defined(options.proxy)) {\n    resource.proxy = options.proxy;\n  }\n  if (defined(options.request)) {\n    resource.request = options.request;\n  }\n  if (defined(options.retryCallback)) {\n    resource.retryCallback = options.retryCallback;\n  }\n  if (defined(options.retryAttempts)) {\n    resource.retryAttempts = options.retryAttempts;\n  }\n\n  return resource;\n};\n\n/**\n * Called when a resource fails to load. This will call the retryCallback function if defined until retryAttempts is reached.\n *\n * @param {RequestErrorEvent} [error] The error that was encountered.\n *\n * @returns {Promise<boolean>} A promise to a boolean, that if true will cause the resource request to be retried.\n *\n * @private\n */\nResource.prototype.retryOnError = function (error) {\n  const retryCallback = this.retryCallback;\n  if (\n    typeof retryCallback !== \"function\" ||\n    this._retryCount >= this.retryAttempts\n  ) {\n    return Promise.resolve(false);\n  }\n\n  const that = this;\n  return Promise.resolve(retryCallback(this, error)).then(function (result) {\n    ++that._retryCount;\n\n    return result;\n  });\n};\n\n/**\n * Duplicates a Resource instance.\n *\n * @param {Resource} [result] The object onto which to store the result.\n *\n * @returns {Resource} The modified result parameter or a new Resource instance if one was not provided.\n */\nResource.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new Resource({\n      url: this._url,\n      queryParameters: this.queryParameters,\n      templateValues: this.templateValues,\n      headers: this.headers,\n      proxy: this.proxy,\n      retryCallback: this.retryCallback,\n      retryAttempts: this.retryAttempts,\n      request: this.request.clone(),\n      parseUrl: false,\n      credits: defined(this.credits) ? this.credits.slice() : undefined,\n    });\n  }\n\n  result._url = this._url;\n  result._queryParameters = clone(this._queryParameters);\n  result._templateValues = clone(this._templateValues);\n  result.headers = clone(this.headers);\n  result.proxy = this.proxy;\n  result.retryCallback = this.retryCallback;\n  result.retryAttempts = this.retryAttempts;\n  result._retryCount = 0;\n  result.request = this.request.clone();\n\n  return result;\n};\n\n/**\n * Returns the base path of the Resource.\n *\n * @param {boolean} [includeQuery = false] Whether or not to include the query string and fragment form the uri\n *\n * @returns {string} The base URI of the resource\n */\nResource.prototype.getBaseUri = function (includeQuery) {\n  return getBaseUri(this.getUrlComponent(includeQuery), includeQuery);\n};\n\n/**\n * Appends a forward slash to the URL.\n */\nResource.prototype.appendForwardSlash = function () {\n  this._url = appendForwardSlash(this._url);\n};\n\n/**\n * Asynchronously loads the resource as raw binary data.  Returns a promise that will resolve to\n * an ArrayBuffer once loaded, or reject if the resource failed to load.  The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promise<ArrayBuffer>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n * @example\n * // load a single URL asynchronously\n * resource.fetchArrayBuffer().then(function(arrayBuffer) {\n *     // use the data\n * }).catch(function(error) {\n *     // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchArrayBuffer = function () {\n  return this.fetch({\n    responseType: \"arraybuffer\",\n  });\n};\n\n/**\n * Creates a Resource and calls fetchArrayBuffer() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promise<ArrayBuffer>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetchArrayBuffer = function (options) {\n  const resource = new Resource(options);\n  return resource.fetchArrayBuffer();\n};\n\n/**\n * Asynchronously loads the given resource as a blob.  Returns a promise that will resolve to\n * a Blob once loaded, or reject if the resource failed to load.  The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promise<Blob>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n * @example\n * // load a single URL asynchronously\n * resource.fetchBlob().then(function(blob) {\n *     // use the data\n * }).catch(function(error) {\n *     // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchBlob = function () {\n  return this.fetch({\n    responseType: \"blob\",\n  });\n};\n\n/**\n * Creates a Resource and calls fetchBlob() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promise<Blob>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetchBlob = function (options) {\n  const resource = new Resource(options);\n  return resource.fetchBlob();\n};\n\n/**\n * Asynchronously loads the given image resource.  Returns a promise that will resolve to\n * an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if <code>preferImageBitmap</code> is true and the browser supports <code>createImageBitmap</code> or otherwise an\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.\n *\n * @param {object} [options] An object with the following properties.\n * @param {boolean} [options.preferBlob=false] If true, we will load the image via a blob.\n * @param {boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.\n * @param {boolean} [options.flipY=false] If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.\n * @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports <code>createImageBitmap</code>.\n * @returns {Promise<ImageBitmap|HTMLImageElement>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * // load a single image asynchronously\n * resource.fetchImage().then(function(image) {\n *     // use the loaded image\n * }).catch(function(error) {\n *     // an error occurred\n * });\n *\n * // load several images in parallel\n * Promise.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {\n *     // images is an array containing all the loaded images\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchImage = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const preferImageBitmap = defaultValue(options.preferImageBitmap, false);\n  const preferBlob = defaultValue(options.preferBlob, false);\n  const flipY = defaultValue(options.flipY, false);\n  const skipColorSpaceConversion = defaultValue(\n    options.skipColorSpaceConversion,\n    false\n  );\n\n  checkAndResetRequest(this.request);\n  // We try to load the image normally if\n  // 1. Blobs aren't supported\n  // 2. It's a data URI\n  // 3. It's a blob URI\n  // 4. It doesn't have request headers and we preferBlob is false\n  if (\n    !xhrBlobSupported ||\n    this.isDataUri ||\n    this.isBlobUri ||\n    (!this.hasHeaders && !preferBlob)\n  ) {\n    return fetchImage({\n      resource: this,\n      flipY: flipY,\n      skipColorSpaceConversion: skipColorSpaceConversion,\n      preferImageBitmap: preferImageBitmap,\n    });\n  }\n\n  const blobPromise = this.fetchBlob();\n  if (!defined(blobPromise)) {\n    return;\n  }\n\n  let supportsImageBitmap;\n  let useImageBitmap;\n  let generatedBlobResource;\n  let generatedBlob;\n  return Resource.supportsImageBitmapOptions()\n    .then(function (result) {\n      supportsImageBitmap = result;\n      useImageBitmap = supportsImageBitmap && preferImageBitmap;\n      return blobPromise;\n    })\n    .then(function (blob) {\n      if (!defined(blob)) {\n        return;\n      }\n      generatedBlob = blob;\n      if (useImageBitmap) {\n        return Resource.createImageBitmapFromBlob(blob, {\n          flipY: flipY,\n          premultiplyAlpha: false,\n          skipColorSpaceConversion: skipColorSpaceConversion,\n        });\n      }\n      const blobUrl = window.URL.createObjectURL(blob);\n      generatedBlobResource = new Resource({\n        url: blobUrl,\n      });\n\n      return fetchImage({\n        resource: generatedBlobResource,\n        flipY: flipY,\n        skipColorSpaceConversion: skipColorSpaceConversion,\n        preferImageBitmap: false,\n      });\n    })\n    .then(function (image) {\n      if (!defined(image)) {\n        return;\n      }\n\n      // The blob object may be needed for use by a TileDiscardPolicy,\n      // so attach it to the image.\n      image.blob = generatedBlob;\n\n      if (useImageBitmap) {\n        return image;\n      }\n\n      window.URL.revokeObjectURL(generatedBlobResource.url);\n      return image;\n    })\n    .catch(function (error) {\n      if (defined(generatedBlobResource)) {\n        window.URL.revokeObjectURL(generatedBlobResource.url);\n      }\n\n      // If the blob load succeeded but the image decode failed, attach the blob\n      // to the error object for use by a TileDiscardPolicy.\n      // In particular, BingMapsImageryProvider uses this to detect the\n      // zero-length response that is returned when a tile is not available.\n      error.blob = generatedBlob;\n\n      return Promise.reject(error);\n    });\n};\n\n/**\n * Fetches an image and returns a promise to it.\n *\n * @param {object} [options] An object with the following properties.\n * @param {Resource} [options.resource] Resource object that points to an image to fetch.\n * @param {boolean} [options.preferImageBitmap] If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.\n * @param {boolean} [options.flipY] If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.\n * @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports <code>createImageBitmap</code>.\n * @private\n */\nfunction fetchImage(options) {\n  const resource = options.resource;\n  const flipY = options.flipY;\n  const skipColorSpaceConversion = options.skipColorSpaceConversion;\n  const preferImageBitmap = options.preferImageBitmap;\n\n  const request = resource.request;\n  request.url = resource.url;\n  request.requestFunction = function () {\n    let crossOrigin = false;\n\n    // data URIs can't have crossorigin set.\n    if (!resource.isDataUri && !resource.isBlobUri) {\n      crossOrigin = resource.isCrossOriginUrl;\n    }\n\n    const deferred = defer();\n    Resource._Implementations.createImage(\n      request,\n      crossOrigin,\n      deferred,\n      flipY,\n      skipColorSpaceConversion,\n      preferImageBitmap\n    );\n\n    return deferred.promise;\n  };\n\n  const promise = RequestScheduler.request(request);\n  if (!defined(promise)) {\n    return;\n  }\n\n  return promise.catch(function (e) {\n    // Don't retry cancelled or otherwise aborted requests\n    if (request.state !== RequestState.FAILED) {\n      return Promise.reject(e);\n    }\n    return resource.retryOnError(e).then(function (retry) {\n      if (retry) {\n        // Reset request so it can try again\n        request.state = RequestState.UNISSUED;\n        request.deferred = undefined;\n\n        return fetchImage({\n          resource: resource,\n          flipY: flipY,\n          skipColorSpaceConversion: skipColorSpaceConversion,\n          preferImageBitmap: preferImageBitmap,\n        });\n      }\n      return Promise.reject(e);\n    });\n  });\n}\n\n/**\n * Creates a Resource and calls fetchImage() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {boolean} [options.flipY=false] Whether to vertically flip the image during fetch and decode. Only applies when requesting an image and the browser supports <code>createImageBitmap</code>.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {boolean} [options.preferBlob=false]  If true, we will load the image via a blob.\n * @param {boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.\n * @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies when requesting an image and the browser supports <code>createImageBitmap</code>.\n * @returns {Promise<ImageBitmap|HTMLImageElement>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetchImage = function (options) {\n  const resource = new Resource(options);\n  return resource.fetchImage({\n    flipY: options.flipY,\n    skipColorSpaceConversion: options.skipColorSpaceConversion,\n    preferBlob: options.preferBlob,\n    preferImageBitmap: options.preferImageBitmap,\n  });\n};\n\n/**\n * Asynchronously loads the given resource as text.  Returns a promise that will resolve to\n * a String once loaded, or reject if the resource failed to load.  The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promise<string>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n * @example\n * // load text from a URL, setting a custom header\n * const resource = new Resource({\n *   url: 'http://someUrl.com/someJson.txt',\n *   headers: {\n *     'X-Custom-Header' : 'some value'\n *   }\n * });\n * resource.fetchText().then(function(text) {\n *     // Do something with the text\n * }).catch(function(error) {\n *     // an error occurred\n * });\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest|XMLHttpRequest}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchText = function () {\n  return this.fetch({\n    responseType: \"text\",\n  });\n};\n\n/**\n * Creates a Resource and calls fetchText() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promise<string>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetchText = function (options) {\n  const resource = new Resource(options);\n  return resource.fetchText();\n};\n\n// note: &#42;&#47;&#42; below is */* but that ends the comment block early\n/**\n * Asynchronously loads the given resource as JSON.  Returns a promise that will resolve to\n * a JSON object once loaded, or reject if the resource failed to load.  The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function\n * adds 'Accept: application/json,&#42;&#47;&#42;;q=0.01' to the request headers, if not\n * already specified.\n *\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.fetchJson().then(function(jsonData) {\n *     // Do something with the JSON object\n * }).catch(function(error) {\n *     // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchJson = function () {\n  const promise = this.fetch({\n    responseType: \"text\",\n    headers: {\n      Accept: \"application/json,*/*;q=0.01\",\n    },\n  });\n\n  if (!defined(promise)) {\n    return undefined;\n  }\n\n  return promise.then(function (value) {\n    if (!defined(value)) {\n      return;\n    }\n    return JSON.parse(value);\n  });\n};\n\n/**\n * Creates a Resource and calls fetchJson() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetchJson = function (options) {\n  const resource = new Resource(options);\n  return resource.fetchJson();\n};\n\n/**\n * Asynchronously loads the given resource as XML.  Returns a promise that will resolve to\n * an XML Document once loaded, or reject if the resource failed to load.  The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promise<XMLDocument>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * // load XML from a URL, setting a custom header\n * Cesium.loadXML('http://someUrl.com/someXML.xml', {\n *   'X-Custom-Header' : 'some value'\n * }).then(function(document) {\n *     // Do something with the document\n * }).catch(function(error) {\n *     // an error occurred\n * });\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest|XMLHttpRequest}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchXML = function () {\n  return this.fetch({\n    responseType: \"document\",\n    overrideMimeType: \"text/xml\",\n  });\n};\n\n/**\n * Creates a Resource and calls fetchXML() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promise<XMLDocument>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetchXML = function (options) {\n  const resource = new Resource(options);\n  return resource.fetchXML();\n};\n\n/**\n * Requests a resource using JSONP.\n *\n * @param {string} [callbackParameterName='callback'] The callback parameter name that the server expects.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * // load a data asynchronously\n * resource.fetchJsonp().then(function(data) {\n *     // use the loaded data\n * }).catch(function(error) {\n *     // an error occurred\n * });\n *\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchJsonp = function (callbackParameterName) {\n  callbackParameterName = defaultValue(callbackParameterName, \"callback\");\n\n  checkAndResetRequest(this.request);\n\n  //generate a unique function name\n  let functionName;\n  do {\n    functionName = `loadJsonp${CesiumMath.nextRandomNumber()\n      .toString()\n      .substring(2, 8)}`;\n  } while (defined(window[functionName]));\n\n  return fetchJsonp(this, callbackParameterName, functionName);\n};\n\nfunction fetchJsonp(resource, callbackParameterName, functionName) {\n  const callbackQuery = {};\n  callbackQuery[callbackParameterName] = functionName;\n  resource.setQueryParameters(callbackQuery);\n\n  const request = resource.request;\n  const url = resource.url;\n  request.url = url;\n  request.requestFunction = function () {\n    const deferred = defer();\n\n    //assign a function with that name in the global scope\n    window[functionName] = function (data) {\n      deferred.resolve(data);\n\n      try {\n        delete window[functionName];\n      } catch (e) {\n        window[functionName] = undefined;\n      }\n    };\n\n    Resource._Implementations.loadAndExecuteScript(url, functionName, deferred);\n    return deferred.promise;\n  };\n\n  const promise = RequestScheduler.request(request);\n  if (!defined(promise)) {\n    return;\n  }\n\n  return promise.catch(function (e) {\n    if (request.state !== RequestState.FAILED) {\n      return Promise.reject(e);\n    }\n\n    return resource.retryOnError(e).then(function (retry) {\n      if (retry) {\n        // Reset request so it can try again\n        request.state = RequestState.UNISSUED;\n        request.deferred = undefined;\n\n        return fetchJsonp(resource, callbackParameterName, functionName);\n      }\n\n      return Promise.reject(e);\n    });\n  });\n}\n\n/**\n * Creates a Resource from a URL and calls fetchJsonp() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.callbackParameterName='callback'] The callback parameter name that the server expects.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetchJsonp = function (options) {\n  const resource = new Resource(options);\n  return resource.fetchJsonp(options.callbackParameterName);\n};\n\n/**\n * @private\n */\nResource.prototype._makeRequest = function (options) {\n  const resource = this;\n  checkAndResetRequest(resource.request);\n\n  const request = resource.request;\n  const url = resource.url;\n  request.url = url;\n\n  request.requestFunction = function () {\n    const responseType = options.responseType;\n    const headers = combine(options.headers, resource.headers);\n    const overrideMimeType = options.overrideMimeType;\n    const method = options.method;\n    const data = options.data;\n    const deferred = defer();\n    const xhr = Resource._Implementations.loadWithXhr(\n      url,\n      responseType,\n      method,\n      data,\n      headers,\n      deferred,\n      overrideMimeType\n    );\n    if (defined(xhr) && defined(xhr.abort)) {\n      request.cancelFunction = function () {\n        xhr.abort();\n      };\n    }\n    return deferred.promise;\n  };\n\n  const promise = RequestScheduler.request(request);\n  if (!defined(promise)) {\n    return;\n  }\n\n  return promise\n    .then(function (data) {\n      // explicitly set to undefined to ensure GC of request response data. See #8843\n      request.cancelFunction = undefined;\n      return data;\n    })\n    .catch(function (e) {\n      request.cancelFunction = undefined;\n      if (request.state !== RequestState.FAILED) {\n        return Promise.reject(e);\n      }\n\n      return resource.retryOnError(e).then(function (retry) {\n        if (retry) {\n          // Reset request so it can try again\n          request.state = RequestState.UNISSUED;\n          request.deferred = undefined;\n\n          return resource.fetch(options);\n        }\n\n        return Promise.reject(e);\n      });\n    });\n};\n\n/**\n * Checks to make sure the Resource isn't already being requested.\n *\n * @param {Request} request The request to check.\n *\n * @private\n */\nfunction checkAndResetRequest(request) {\n  if (\n    request.state === RequestState.ISSUED ||\n    request.state === RequestState.ACTIVE\n  ) {\n    throw new RuntimeError(\"The Resource is already being fetched.\");\n  }\n\n  request.state = RequestState.UNISSUED;\n  request.deferred = undefined;\n}\n\nconst dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/;\n\nfunction decodeDataUriText(isBase64, data) {\n  const result = decodeURIComponent(data);\n  if (isBase64) {\n    return atob(result);\n  }\n  return result;\n}\n\nfunction decodeDataUriArrayBuffer(isBase64, data) {\n  const byteString = decodeDataUriText(isBase64, data);\n  const buffer = new ArrayBuffer(byteString.length);\n  const view = new Uint8Array(buffer);\n  for (let i = 0; i < byteString.length; i++) {\n    view[i] = byteString.charCodeAt(i);\n  }\n  return buffer;\n}\n\nfunction decodeDataUri(dataUriRegexResult, responseType) {\n  responseType = defaultValue(responseType, \"\");\n  const mimeType = dataUriRegexResult[1];\n  const isBase64 = !!dataUriRegexResult[2];\n  const data = dataUriRegexResult[3];\n  let buffer;\n  let parser;\n\n  switch (responseType) {\n    case \"\":\n    case \"text\":\n      return decodeDataUriText(isBase64, data);\n    case \"arraybuffer\":\n      return decodeDataUriArrayBuffer(isBase64, data);\n    case \"blob\":\n      buffer = decodeDataUriArrayBuffer(isBase64, data);\n      return new Blob([buffer], {\n        type: mimeType,\n      });\n    case \"document\":\n      parser = new DOMParser();\n      return parser.parseFromString(\n        decodeDataUriText(isBase64, data),\n        mimeType\n      );\n    case \"json\":\n      return JSON.parse(decodeDataUriText(isBase64, data));\n    default:\n      //>>includeStart('debug', pragmas.debug);\n      throw new DeveloperError(`Unhandled responseType: ${responseType}`);\n    //>>includeEnd('debug');\n  }\n}\n\n/**\n * Asynchronously loads the given resource.  Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load.  The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use\n * the more specific functions eg. fetchJson, fetchBlob, etc.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response.  This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.fetch()\n *   .then(function(body) {\n *       // use the data\n *   }).catch(function(error) {\n *       // an error occurred\n *   });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetch = function (options) {\n  options = defaultClone(options, {});\n  options.method = \"GET\";\n\n  return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls fetch() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response.  This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetch = function (options) {\n  const resource = new Resource(options);\n  return resource.fetch({\n    // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n    responseType: options.responseType,\n    overrideMimeType: options.overrideMimeType,\n  });\n};\n\n/**\n * Asynchronously deletes the given resource.  Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load.  The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response.  This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.delete()\n *   .then(function(body) {\n *       // use the data\n *   }).catch(function(error) {\n *       // an error occurred\n *   });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.delete = function (options) {\n  options = defaultClone(options, {});\n  options.method = \"DELETE\";\n\n  return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls delete() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.data] Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response.  This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.delete = function (options) {\n  const resource = new Resource(options);\n  return resource.delete({\n    // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n    responseType: options.responseType,\n    overrideMimeType: options.overrideMimeType,\n    data: options.data,\n  });\n};\n\n/**\n * Asynchronously gets headers the given resource.  Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load.  The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response.  This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.head()\n *   .then(function(headers) {\n *       // use the data\n *   }).catch(function(error) {\n *       // an error occurred\n *   });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.head = function (options) {\n  options = defaultClone(options, {});\n  options.method = \"HEAD\";\n\n  return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls head() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response.  This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.head = function (options) {\n  const resource = new Resource(options);\n  return resource.head({\n    // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n    responseType: options.responseType,\n    overrideMimeType: options.overrideMimeType,\n  });\n};\n\n/**\n * Asynchronously gets options the given resource.  Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load.  The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response.  This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.options()\n *   .then(function(headers) {\n *       // use the data\n *   }).catch(function(error) {\n *       // an error occurred\n *   });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.options = function (options) {\n  options = defaultClone(options, {});\n  options.method = \"OPTIONS\";\n\n  return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls options() on it.\n *\n * @param {string|object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response.  This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.options = function (options) {\n  const resource = new Resource(options);\n  return resource.options({\n    // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n    responseType: options.responseType,\n    overrideMimeType: options.overrideMimeType,\n  });\n};\n\n/**\n * Asynchronously posts data to the given resource.  Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load.  The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} data Data that is posted with the resource.\n * @param {object} [options] Object with the following properties:\n * @param {object} [options.data] Data that is posted with the resource.\n * @param {string} [options.responseType] The type of response.  This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.post(data)\n *   .then(function(result) {\n *       // use the result\n *   }).catch(function(error) {\n *       // an error occurred\n *   });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.post = function (data, options) {\n  Check.defined(\"data\", data);\n\n  options = defaultClone(options, {});\n  options.method = \"POST\";\n  options.data = data;\n\n  return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls post() on it.\n *\n * @param {object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} options.data Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response.  This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.post = function (options) {\n  const resource = new Resource(options);\n  return resource.post(options.data, {\n    // Make copy of just the needed fields because headers can be passed to both the constructor and to post\n    responseType: options.responseType,\n    overrideMimeType: options.overrideMimeType,\n  });\n};\n\n/**\n * Asynchronously puts data to the given resource.  Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load.  The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} data Data that is posted with the resource.\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response.  This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.put(data)\n *   .then(function(result) {\n *       // use the result\n *   }).catch(function(error) {\n *       // an error occurred\n *   });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.put = function (data, options) {\n  Check.defined(\"data\", data);\n\n  options = defaultClone(options, {});\n  options.method = \"PUT\";\n  options.data = data;\n\n  return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls put() on it.\n *\n * @param {object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} options.data Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response.  This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.put = function (options) {\n  const resource = new Resource(options);\n  return resource.put(options.data, {\n    // Make copy of just the needed fields because headers can be passed to both the constructor and to post\n    responseType: options.responseType,\n    overrideMimeType: options.overrideMimeType,\n  });\n};\n\n/**\n * Asynchronously patches data to the given resource.  Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load.  The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {object} data Data that is posted with the resource.\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.responseType] The type of response.  This controls the type of item returned.\n * @param {object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.patch(data)\n *   .then(function(result) {\n *       // use the result\n *   }).catch(function(error) {\n *       // an error occurred\n *   });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.patch = function (data, options) {\n  Check.defined(\"data\", data);\n\n  options = defaultClone(options, {});\n  options.method = \"PATCH\";\n  options.data = data;\n\n  return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls patch() on it.\n *\n * @param {object} options A url or an object with the following properties\n * @param {string} options.url The url of the resource.\n * @param {object} options.data Data that is posted with the resource.\n * @param {object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {string} [options.responseType] The type of response.  This controls the type of item returned.\n * @param {string} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise<any>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.patch = function (options) {\n  const resource = new Resource(options);\n  return resource.patch(options.data, {\n    // Make copy of just the needed fields because headers can be passed to both the constructor and to post\n    responseType: options.responseType,\n    overrideMimeType: options.overrideMimeType,\n  });\n};\n\n/**\n * Contains implementations of functions that can be replaced for testing\n *\n * @private\n */\nResource._Implementations = {};\n\nResource._Implementations.loadImageElement = function (\n  url,\n  crossOrigin,\n  deferred\n) {\n  const image = new Image();\n\n  image.onload = function () {\n    // work-around a known issue with Firefox and dimensionless SVG, see:\n    //   - https://github.com/whatwg/html/issues/3510\n    //   - https://bugzilla.mozilla.org/show_bug.cgi?id=700533\n    if (\n      image.naturalWidth === 0 &&\n      image.naturalHeight === 0 &&\n      image.width === 0 &&\n      image.height === 0\n    ) {\n      // these values affect rasterization and will likely mar the content\n      // until Firefox takes a stance on the issue, marred content is better than no content\n      // Chromium uses a more refined heuristic about its choice given nil viewBox, and a better stance and solution is\n      // proposed later in the original issue thread:\n      //   - Chromium behavior: https://github.com/CesiumGS/cesium/issues/9188#issuecomment-704400825\n      //   - Cesium's stance/solve: https://github.com/CesiumGS/cesium/issues/9188#issuecomment-720645777\n      image.width = 300;\n      image.height = 150;\n    }\n    deferred.resolve(image);\n  };\n\n  image.onerror = function (e) {\n    deferred.reject(e);\n  };\n\n  if (crossOrigin) {\n    if (TrustedServers.contains(url)) {\n      image.crossOrigin = \"use-credentials\";\n    } else {\n      image.crossOrigin = \"\";\n    }\n  }\n\n  image.src = url;\n};\n\nResource._Implementations.createImage = function (\n  request,\n  crossOrigin,\n  deferred,\n  flipY,\n  skipColorSpaceConversion,\n  preferImageBitmap\n) {\n  const url = request.url;\n  // Passing an Image to createImageBitmap will force it to run on the main thread\n  // since DOM elements don't exist on workers. We convert it to a blob so it's non-blocking.\n  // See:\n  //    https://bugzilla.mozilla.org/show_bug.cgi?id=1044102#c38\n  //    https://bugs.chromium.org/p/chromium/issues/detail?id=580202#c10\n  Resource.supportsImageBitmapOptions()\n    .then(function (supportsImageBitmap) {\n      // We can only use ImageBitmap if we can flip on decode.\n      // See: https://github.com/CesiumGS/cesium/pull/7579#issuecomment-466146898\n      if (!(supportsImageBitmap && preferImageBitmap)) {\n        Resource._Implementations.loadImageElement(url, crossOrigin, deferred);\n        return;\n      }\n      const responseType = \"blob\";\n      const method = \"GET\";\n      const xhrDeferred = defer();\n      const xhr = Resource._Implementations.loadWithXhr(\n        url,\n        responseType,\n        method,\n        undefined,\n        undefined,\n        xhrDeferred,\n        undefined,\n        undefined,\n        undefined\n      );\n\n      if (defined(xhr) && defined(xhr.abort)) {\n        request.cancelFunction = function () {\n          xhr.abort();\n        };\n      }\n      return xhrDeferred.promise\n        .then(function (blob) {\n          if (!defined(blob)) {\n            deferred.reject(\n              new RuntimeError(\n                `Successfully retrieved ${url} but it contained no content.`\n              )\n            );\n            return;\n          }\n\n          return Resource.createImageBitmapFromBlob(blob, {\n            flipY: flipY,\n            premultiplyAlpha: false,\n            skipColorSpaceConversion: skipColorSpaceConversion,\n          });\n        })\n        .then(function (image) {\n          deferred.resolve(image);\n        });\n    })\n    .catch(function (e) {\n      deferred.reject(e);\n    });\n};\n\n/**\n * Wrapper for createImageBitmap\n *\n * @private\n */\nResource.createImageBitmapFromBlob = function (blob, options) {\n  Check.defined(\"options\", options);\n  Check.typeOf.bool(\"options.flipY\", options.flipY);\n  Check.typeOf.bool(\"options.premultiplyAlpha\", options.premultiplyAlpha);\n  Check.typeOf.bool(\n    \"options.skipColorSpaceConversion\",\n    options.skipColorSpaceConversion\n  );\n\n  return createImageBitmap(blob, {\n    imageOrientation: options.flipY ? \"flipY\" : \"none\",\n    premultiplyAlpha: options.premultiplyAlpha ? \"premultiply\" : \"none\",\n    colorSpaceConversion: options.skipColorSpaceConversion ? \"none\" : \"default\",\n  });\n};\n\nfunction decodeResponse(loadWithHttpResponse, responseType) {\n  switch (responseType) {\n    case \"text\":\n      return loadWithHttpResponse.toString(\"utf8\");\n    case \"json\":\n      return JSON.parse(loadWithHttpResponse.toString(\"utf8\"));\n    default:\n      return new Uint8Array(loadWithHttpResponse).buffer;\n  }\n}\n\nfunction loadWithHttpRequest(\n  url,\n  responseType,\n  method,\n  data,\n  headers,\n  deferred,\n  overrideMimeType\n) {\n  // Note: only the 'json' and 'text' responseTypes transforms the loaded buffer\n  let URL;\n  let zlib;\n  Promise.all([import(\"url\"), import(\"zlib\")])\n    .then(([urlImport, zlibImport]) => {\n      URL = urlImport.parse(url);\n      zlib = zlibImport;\n\n      return URL.protocol === \"https:\" ? import(\"https\") : import(\"http\");\n    })\n    .then((http) => {\n      const options = {\n        protocol: URL.protocol,\n        hostname: URL.hostname,\n        port: URL.port,\n        path: URL.path,\n        query: URL.query,\n        method: method,\n        headers: headers,\n      };\n      http\n        .request(options)\n        .on(\"response\", function (res) {\n          if (res.statusCode < 200 || res.statusCode >= 300) {\n            deferred.reject(\n              new RequestErrorEvent(res.statusCode, res, res.headers)\n            );\n            return;\n          }\n\n          const chunkArray = [];\n          res.on(\"data\", function (chunk) {\n            chunkArray.push(chunk);\n          });\n\n          res.on(\"end\", function () {\n            // eslint-disable-next-line no-undef\n            const result = Buffer.concat(chunkArray);\n            if (res.headers[\"content-encoding\"] === \"gzip\") {\n              zlib.gunzip(result, function (error, resultUnzipped) {\n                if (error) {\n                  deferred.reject(\n                    new RuntimeError(\"Error decompressing response.\")\n                  );\n                } else {\n                  deferred.resolve(\n                    decodeResponse(resultUnzipped, responseType)\n                  );\n                }\n              });\n            } else {\n              deferred.resolve(decodeResponse(result, responseType));\n            }\n          });\n        })\n        .on(\"error\", function (e) {\n          deferred.reject(new RequestErrorEvent());\n        })\n        .end();\n    });\n}\n\nconst noXMLHttpRequest = typeof XMLHttpRequest === \"undefined\";\nResource._Implementations.loadWithXhr = function (\n  url,\n  responseType,\n  method,\n  data,\n  headers,\n  deferred,\n  overrideMimeType\n) {\n  const dataUriRegexResult = dataUriRegex.exec(url);\n  if (dataUriRegexResult !== null) {\n    deferred.resolve(decodeDataUri(dataUriRegexResult, responseType));\n    return;\n  }\n\n  if (noXMLHttpRequest) {\n    loadWithHttpRequest(\n      url,\n      responseType,\n      method,\n      data,\n      headers,\n      deferred,\n      overrideMimeType\n    );\n    return;\n  }\n\n  const xhr = new XMLHttpRequest();\n\n  if (TrustedServers.contains(url)) {\n    xhr.withCredentials = true;\n  }\n\n  xhr.open(method, url, true);\n\n  if (defined(overrideMimeType) && defined(xhr.overrideMimeType)) {\n    xhr.overrideMimeType(overrideMimeType);\n  }\n\n  if (defined(headers)) {\n    for (const key in headers) {\n      if (headers.hasOwnProperty(key)) {\n        xhr.setRequestHeader(key, headers[key]);\n      }\n    }\n  }\n\n  if (defined(responseType)) {\n    xhr.responseType = responseType;\n  }\n\n  // While non-standard, file protocol always returns a status of 0 on success\n  let localFile = false;\n  if (typeof url === \"string\") {\n    localFile =\n      url.indexOf(\"file://\") === 0 ||\n      (typeof window !== \"undefined\" && window.location.origin === \"file://\");\n  }\n\n  xhr.onload = function () {\n    if (\n      (xhr.status < 200 || xhr.status >= 300) &&\n      !(localFile && xhr.status === 0)\n    ) {\n      deferred.reject(\n        new RequestErrorEvent(\n          xhr.status,\n          xhr.response,\n          xhr.getAllResponseHeaders()\n        )\n      );\n      return;\n    }\n\n    const response = xhr.response;\n    const browserResponseType = xhr.responseType;\n\n    if (method === \"HEAD\" || method === \"OPTIONS\") {\n      const responseHeaderString = xhr.getAllResponseHeaders();\n      const splitHeaders = responseHeaderString.trim().split(/[\\r\\n]+/);\n\n      const responseHeaders = {};\n      splitHeaders.forEach(function (line) {\n        const parts = line.split(\": \");\n        const header = parts.shift();\n        responseHeaders[header] = parts.join(\": \");\n      });\n\n      deferred.resolve(responseHeaders);\n      return;\n    }\n\n    //All modern browsers will go into either the first or second if block or last else block.\n    //Other code paths support older browsers that either do not support the supplied responseType\n    //or do not support the xhr.response property.\n    if (xhr.status === 204) {\n      // accept no content\n      deferred.resolve();\n    } else if (\n      defined(response) &&\n      (!defined(responseType) || browserResponseType === responseType)\n    ) {\n      deferred.resolve(response);\n    } else if (responseType === \"json\" && typeof response === \"string\") {\n      try {\n        deferred.resolve(JSON.parse(response));\n      } catch (e) {\n        deferred.reject(e);\n      }\n    } else if (\n      (browserResponseType === \"\" || browserResponseType === \"document\") &&\n      defined(xhr.responseXML) &&\n      xhr.responseXML.hasChildNodes()\n    ) {\n      deferred.resolve(xhr.responseXML);\n    } else if (\n      (browserResponseType === \"\" || browserResponseType === \"text\") &&\n      defined(xhr.responseText)\n    ) {\n      deferred.resolve(xhr.responseText);\n    } else {\n      deferred.reject(\n        new RuntimeError(\"Invalid XMLHttpRequest response type.\")\n      );\n    }\n  };\n\n  xhr.onerror = function (e) {\n    deferred.reject(new RequestErrorEvent());\n  };\n\n  xhr.send(data);\n\n  return xhr;\n};\n\nResource._Implementations.loadAndExecuteScript = function (\n  url,\n  functionName,\n  deferred\n) {\n  return loadAndExecuteScript(url, functionName).catch(function (e) {\n    deferred.reject(e);\n  });\n};\n\n/**\n * The default implementations\n *\n * @private\n */\nResource._DefaultImplementations = {};\nResource._DefaultImplementations.createImage =\n  Resource._Implementations.createImage;\nResource._DefaultImplementations.loadWithXhr =\n  Resource._Implementations.loadWithXhr;\nResource._DefaultImplementations.loadAndExecuteScript =\n  Resource._Implementations.loadAndExecuteScript;\n\n/**\n * A resource instance initialized to the current browser location\n *\n * @type {Resource}\n * @constant\n */\nResource.DEFAULT = Object.freeze(\n  new Resource({\n    url:\n      typeof document === \"undefined\"\n        ? \"\"\n        : document.location.href.split(\"?\")[0],\n  })\n);\n\n/**\n * A function that returns the value of the property.\n * @callback Resource.RetryCallback\n *\n * @param {Resource} [resource] The resource that failed to load.\n * @param {RequestErrorEvent} [error] The error that occurred during the loading of the resource.\n * @returns {boolean|Promise<boolean>} If true or a promise that resolved to true, the resource will be retried. Otherwise the failure will be returned.\n */\nexport default Resource;\n", "/**\n * @private\n */\nfunction appendForwardSlash(url) {\n  if (url.length === 0 || url[url.length - 1] !== \"/\") {\n    url = `${url}/`;\n  }\n  return url;\n}\nexport default appendForwardSlash;\n", "import defaultValue from \"./defaultValue.js\";\n\n/**\n * Clones an object, returning a new object containing the same properties.\n *\n * @function\n *\n * @param {object} object The object to clone.\n * @param {boolean} [deep=false] If true, all properties will be deep cloned recursively.\n * @returns {object} The cloned object.\n */\nfunction clone(object, deep) {\n  if (object === null || typeof object !== \"object\") {\n    return object;\n  }\n\n  deep = defaultValue(deep, false);\n\n  const result = new object.constructor();\n  for (const propertyName in object) {\n    if (object.hasOwnProperty(propertyName)) {\n      let value = object[propertyName];\n      if (deep) {\n        value = clone(value, deep);\n      }\n      result[propertyName] = value;\n    }\n  }\n\n  return result;\n}\nexport default clone;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\n\n/**\n * Merges two objects, copying their properties onto a new combined object. When two objects have the same\n * property, the value of the property on the first object is used.  If either object is undefined,\n * it will be treated as an empty object.\n *\n * @example\n * const object1 = {\n *     propOne : 1,\n *     propTwo : {\n *         value1 : 10\n *     }\n * }\n * const object2 = {\n *     propTwo : 2\n * }\n * const final = Cesium.combine(object1, object2);\n *\n * // final === {\n * //     propOne : 1,\n * //     propTwo : {\n * //         value1 : 10\n * //     }\n * // }\n *\n * @param {object} [object1] The first object to merge.\n * @param {object} [object2] The second object to merge.\n * @param {boolean} [deep=false] Perform a recursive merge.\n * @returns {object} The combined object containing all properties from both objects.\n *\n * @function\n */\nfunction combine(object1, object2, deep) {\n  deep = defaultValue(deep, false);\n\n  const result = {};\n\n  const object1Defined = defined(object1);\n  const object2Defined = defined(object2);\n  let property;\n  let object1Value;\n  let object2Value;\n  if (object1Defined) {\n    for (property in object1) {\n      if (object1.hasOwnProperty(property)) {\n        object1Value = object1[property];\n        if (\n          object2Defined &&\n          deep &&\n          typeof object1Value === \"object\" &&\n          object2.hasOwnProperty(property)\n        ) {\n          object2Value = object2[property];\n          if (typeof object2Value === \"object\") {\n            result[property] = combine(object1Value, object2Value, deep);\n          } else {\n            result[property] = object1Value;\n          }\n        } else {\n          result[property] = object1Value;\n        }\n      }\n    }\n  }\n  if (object2Defined) {\n    for (property in object2) {\n      if (\n        object2.hasOwnProperty(property) &&\n        !result.hasOwnProperty(property)\n      ) {\n        object2Value = object2[property];\n        result[property] = object2Value;\n      }\n    }\n  }\n  return result;\n}\nexport default combine;\n", "/**\n * A function used to resolve a promise upon completion .\n * @callback defer.resolve\n *\n * @param {*} value The resulting value.\n */\n\n/**\n * A function used to reject a promise upon failure.\n * @callback defer.reject\n *\n * @param {*} error The error.\n */\n\n/**\n * An object which contains a promise object, and functions to resolve or reject the promise.\n *\n * @typedef {object} defer.deferred\n * @property {defer.resolve} resolve Resolves the promise when called.\n * @property {defer.reject} reject Rejects the promise when called.\n * @property {Promise} promise Promise object.\n */\n\n/**\n * Creates a deferred object, containing a promise object, and functions to resolve or reject the promise.\n * @returns {defer.deferred}\n * @private\n */\nfunction defer() {\n  let resolve;\n  let reject;\n  const promise = new Promise(function (res, rej) {\n    resolve = res;\n    reject = rej;\n  });\n\n  return {\n    resolve: resolve,\n    reject: reject,\n    promise: promise,\n  };\n}\n\nexport default defer;\n", "import Uri from \"urijs\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri.\n * @function\n *\n * @param {string} relative The relative Uri.\n * @param {string} [base] The base Uri.\n * @returns {string} The absolute Uri of the given relative Uri.\n *\n * @example\n * //absolute Uri will be \"https://test.com/awesome.png\";\n * const absoluteUri = Cesium.getAbsoluteUri('awesome.png', 'https://test.com');\n */\nfunction getAbsoluteUri(relative, base) {\n  let documentObject;\n  if (typeof document !== \"undefined\") {\n    documentObject = document;\n  }\n\n  return getAbsoluteUri._implementation(relative, base, documentObject);\n}\n\ngetAbsoluteUri._implementation = function (relative, base, documentObject) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(relative)) {\n    throw new DeveloperError(\"relative uri is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(base)) {\n    if (typeof documentObject === \"undefined\") {\n      return relative;\n    }\n    base = defaultValue(documentObject.baseURI, documentObject.location.href);\n  }\n\n  const relativeUri = new Uri(relative);\n  if (relativeUri.scheme() !== \"\") {\n    return relativeUri.toString();\n  }\n  return relativeUri.absoluteTo(base).toString();\n};\nexport default getAbsoluteUri;\n", "import Uri from \"urijs\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Given a URI, returns the base path of the URI.\n * @function\n *\n * @param {string} uri The Uri.\n * @param {boolean} [includeQuery = false] Whether or not to include the query string and fragment form the uri\n * @returns {string} The base path of the Uri.\n *\n * @example\n * // basePath will be \"/Gallery/\";\n * const basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false');\n *\n * // basePath will be \"/Gallery/?value=true&example=false\";\n * const basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false', true);\n */\nfunction getBaseUri(uri, includeQuery) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(uri)) {\n    throw new DeveloperError(\"uri is required.\");\n  }\n  //>>includeEnd('debug');\n\n  let basePath = \"\";\n  const i = uri.lastIndexOf(\"/\");\n  if (i !== -1) {\n    basePath = uri.substring(0, i + 1);\n  }\n\n  if (!includeQuery) {\n    return basePath;\n  }\n\n  uri = new Uri(uri);\n  if (uri.query().length !== 0) {\n    basePath += `?${uri.query()}`;\n  }\n  if (uri.fragment().length !== 0) {\n    basePath += `#${uri.fragment()}`;\n  }\n\n  return basePath;\n}\nexport default getBaseUri;\n", "import Uri from \"urijs\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Given a URI, returns the extension of the URI.\n * @function getExtensionFromUri\n *\n * @param {string} uri The Uri.\n * @returns {string} The extension of the Uri.\n *\n * @example\n * //extension will be \"czml\";\n * const extension = Cesium.getExtensionFromUri('/Gallery/simple.czml?value=true&example=false');\n */\nfunction getExtensionFromUri(uri) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(uri)) {\n    throw new DeveloperError(\"uri is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const uriObject = new Uri(uri);\n  uriObject.normalize();\n  let path = uriObject.path();\n  let index = path.lastIndexOf(\"/\");\n  if (index !== -1) {\n    path = path.substr(index + 1);\n  }\n  index = path.lastIndexOf(\".\");\n  if (index === -1) {\n    path = \"\";\n  } else {\n    path = path.substr(index + 1);\n  }\n  return path;\n}\nexport default getExtensionFromUri;\n", "import defined from \"./defined.js\";\n\nconst context2DsByWidthAndHeight = {};\n\n/**\n * Extract a pixel array from a loaded image.  Draws the image\n * into a canvas so it can read the pixels back.\n *\n * @function getImagePixels\n *\n * @param {HTMLImageElement|ImageBitmap} image The image to extract pixels from.\n * @param {number} width The width of the image. If not defined, then image.width is assigned.\n * @param {number} height The height of the image. If not defined, then image.height is assigned.\n * @returns {ImageData} The pixels of the image.\n */\nfunction getImagePixels(image, width, height) {\n  if (!defined(width)) {\n    width = image.width;\n  }\n  if (!defined(height)) {\n    height = image.height;\n  }\n\n  let context2DsByHeight = context2DsByWidthAndHeight[width];\n  if (!defined(context2DsByHeight)) {\n    context2DsByHeight = {};\n    context2DsByWidthAndHeight[width] = context2DsByHeight;\n  }\n\n  let context2d = context2DsByHeight[height];\n  if (!defined(context2d)) {\n    const canvas = document.createElement(\"canvas\");\n    canvas.width = width;\n    canvas.height = height;\n    // Since we re-use contexts, use the willReadFrequently option \u2013 See https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently\n    context2d = canvas.getContext(\"2d\", { willReadFrequently: true });\n    context2d.globalCompositeOperation = \"copy\";\n    context2DsByHeight[height] = context2d;\n  }\n\n  context2d.drawImage(image, 0, 0, width, height);\n  return context2d.getImageData(0, 0, width, height).data;\n}\nexport default getImagePixels;\n", "import Check from \"./Check.js\";\n\nconst blobUriRegex = /^blob:/i;\n\n/**\n * Determines if the specified uri is a blob uri.\n *\n * @function isBlobUri\n *\n * @param {string} uri The uri to test.\n * @returns {boolean} true when the uri is a blob uri; otherwise, false.\n *\n * @private\n */\nfunction isBlobUri(uri) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"uri\", uri);\n  //>>includeEnd('debug');\n\n  return blobUriRegex.test(uri);\n}\nexport default isBlobUri;\n", "import defined from \"./defined.js\";\n\nlet a;\n\n/**\n * Given a URL, determine whether that URL is considered cross-origin to the current page.\n *\n * @private\n */\nfunction isCrossOriginUrl(url) {\n  if (!defined(a)) {\n    a = document.createElement(\"a\");\n  }\n\n  // copy window location into the anchor to get consistent results\n  // when the port is default for the protocol (e.g. 80 for HTTP)\n  a.href = window.location.href;\n\n  // host includes both hostname and port if the port is not standard\n  const host = a.host;\n  const protocol = a.protocol;\n\n  a.href = url;\n  // IE only absolutizes href on get, not set\n  // eslint-disable-next-line no-self-assign\n  a.href = a.href;\n\n  return protocol !== a.protocol || host !== a.host;\n}\nexport default isCrossOriginUrl;\n", "import Check from \"./Check.js\";\n\nconst dataUriRegex = /^data:/i;\n\n/**\n * Determines if the specified uri is a data uri.\n *\n * @function isDataUri\n *\n * @param {string} uri The uri to test.\n * @returns {boolean} true when the uri is a data uri; otherwise, false.\n *\n * @private\n */\nfunction isDataUri(uri) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"uri\", uri);\n  //>>includeEnd('debug');\n\n  return dataUriRegex.test(uri);\n}\nexport default isDataUri;\n", "/**\n * @private\n */\nfunction loadAndExecuteScript(url) {\n  const script = document.createElement(\"script\");\n  script.async = true;\n  script.src = url;\n\n  return new Promise((resolve, reject) => {\n    if (window.crossOriginIsolated) {\n      script.setAttribute(\"crossorigin\", \"anonymous\");\n    }\n\n    const head = document.getElementsByTagName(\"head\")[0];\n    script.onload = function () {\n      script.onload = undefined;\n      head.removeChild(script);\n      resolve();\n    };\n    script.onerror = function (e) {\n      reject(e);\n    };\n\n    head.appendChild(script);\n  });\n}\nexport default loadAndExecuteScript;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Converts an object representing a set of name/value pairs into a query string,\n * with names and values encoded properly for use in a URL.  Values that are arrays\n * will produce multiple values with the same name.\n * @function objectToQuery\n *\n * @param {object} obj The object containing data to encode.\n * @returns {string} An encoded query string.\n *\n *\n * @example\n * const str = Cesium.objectToQuery({\n *     key1 : 'some value',\n *     key2 : 'a/b',\n *     key3 : ['x', 'y']\n * });\n *\n * @see queryToObject\n * // str will be:\n * // 'key1=some%20value&key2=a%2Fb&key3=x&key3=y'\n */\nfunction objectToQuery(obj) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(obj)) {\n    throw new DeveloperError(\"obj is required.\");\n  }\n  //>>includeEnd('debug');\n\n  let result = \"\";\n  for (const propName in obj) {\n    if (obj.hasOwnProperty(propName)) {\n      const value = obj[propName];\n\n      const part = `${encodeURIComponent(propName)}=`;\n      if (Array.isArray(value)) {\n        for (let i = 0, len = value.length; i < len; ++i) {\n          result += `${part + encodeURIComponent(value[i])}&`;\n        }\n      } else {\n        result += `${part + encodeURIComponent(value)}&`;\n      }\n    }\n  }\n\n  // trim last &\n  result = result.slice(0, -1);\n\n  // This function used to replace %20 with + which is more compact and readable.\n  // However, some servers didn't properly handle + as a space.\n  // https://github.com/CesiumGS/cesium/issues/2192\n\n  return result;\n}\nexport default objectToQuery;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Parses a query string into an object, where the keys and values of the object are the\n * name/value pairs from the query string, decoded. If a name appears multiple times,\n * the value in the object will be an array of values.\n * @function queryToObject\n *\n * @param {string} queryString The query string.\n * @returns {object} An object containing the parameters parsed from the query string.\n *\n *\n * @example\n * const obj = Cesium.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y');\n * // obj will be:\n * // {\n * //   key1 : 'some value',\n * //   key2 : 'a/b',\n * //   key3 : ['x', 'y']\n * // }\n *\n * @see objectToQuery\n */\nfunction queryToObject(queryString) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(queryString)) {\n    throw new DeveloperError(\"queryString is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const result = {};\n  if (queryString === \"\") {\n    return result;\n  }\n  const parts = queryString.replace(/\\+/g, \"%20\").split(/[&;]/);\n  for (let i = 0, len = parts.length; i < len; ++i) {\n    const subparts = parts[i].split(\"=\");\n\n    const name = decodeURIComponent(subparts[0]);\n    let value = subparts[1];\n    if (defined(value)) {\n      value = decodeURIComponent(value);\n    } else {\n      value = \"\";\n    }\n\n    const resultValue = result[name];\n    if (typeof resultValue === \"string\") {\n      // expand the single value to an array\n      result[name] = [resultValue, value];\n    } else if (Array.isArray(resultValue)) {\n      resultValue.push(value);\n    } else {\n      result[name] = value;\n    }\n  }\n  return result;\n}\nexport default queryToObject;\n", "/**\n * State of the request.\n *\n * @enum {number}\n */\nconst RequestState = {\n  /**\n   * Initial unissued state.\n   *\n   * @type {number}\n   * @constant\n   */\n  UNISSUED: 0,\n\n  /**\n   * Issued but not yet active. Will become active when open slots are available.\n   *\n   * @type {number}\n   * @constant\n   */\n  ISSUED: 1,\n\n  /**\n   * Actual http request has been sent.\n   *\n   * @type {number}\n   * @constant\n   */\n  ACTIVE: 2,\n\n  /**\n   * Request completed successfully.\n   *\n   * @type {number}\n   * @constant\n   */\n  RECEIVED: 3,\n\n  /**\n   * Request was cancelled, either explicitly or automatically because of low priority.\n   *\n   * @type {number}\n   * @constant\n   */\n  CANCELLED: 4,\n\n  /**\n   * Request failed.\n   *\n   * @type {number}\n   * @constant\n   */\n  FAILED: 5,\n};\nexport default Object.freeze(RequestState);\n", "/**\n * An enum identifying the type of request. Used for finer grained logging and priority sorting.\n *\n * @enum {number}\n */\nconst RequestType = {\n  /**\n   * Terrain request.\n   *\n   * @type {number}\n   * @constant\n   */\n  TERRAIN: 0,\n\n  /**\n   * Imagery request.\n   *\n   * @type {number}\n   * @constant\n   */\n  IMAGERY: 1,\n\n  /**\n   * 3D Tiles request.\n   *\n   * @type {number}\n   * @constant\n   */\n  TILES3D: 2,\n\n  /**\n   * Other request.\n   *\n   * @type {number}\n   * @constant\n   */\n  OTHER: 3,\n};\nexport default Object.freeze(RequestType);\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport RequestState from \"./RequestState.js\";\nimport RequestType from \"./RequestType.js\";\n\n/**\n * Stores information for making a request. In general this does not need to be constructed directly.\n *\n * @alias Request\n * @constructor\n\n * @param {object} [options] An object with the following properties:\n * @param {string} [options.url] The url to request.\n * @param {Request.RequestCallback} [options.requestFunction] The function that makes the actual data request.\n * @param {Request.CancelCallback} [options.cancelFunction] The function that is called when the request is cancelled.\n * @param {Request.PriorityCallback} [options.priorityFunction] The function that is called to update the request's priority, which occurs once per frame.\n * @param {number} [options.priority=0.0] The initial priority of the request.\n * @param {boolean} [options.throttle=false] Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the request will be throttled and sent based on priority.\n * @param {boolean} [options.throttleByServer=false] Whether to throttle the request by server.\n * @param {RequestType} [options.type=RequestType.OTHER] The type of request.\n * @param {string} [options.serverKey] A key used to identify the server that a request is going to.\n */\nfunction Request(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const throttleByServer = defaultValue(options.throttleByServer, false);\n  const throttle = defaultValue(options.throttle, false);\n\n  /**\n   * The URL to request.\n   *\n   * @type {string}\n   */\n  this.url = options.url;\n\n  /**\n   * The function that makes the actual data request.\n   *\n   * @type {Request.RequestCallback}\n   */\n  this.requestFunction = options.requestFunction;\n\n  /**\n   * The function that is called when the request is cancelled.\n   *\n   * @type {Request.CancelCallback}\n   */\n  this.cancelFunction = options.cancelFunction;\n\n  /**\n   * The function that is called to update the request's priority, which occurs once per frame.\n   *\n   * @type {Request.PriorityCallback}\n   */\n  this.priorityFunction = options.priorityFunction;\n\n  /**\n   * Priority is a unit-less value where lower values represent higher priority.\n   * For world-based objects, this is usually the distance from the camera.\n   * A request that does not have a priority function defaults to a priority of 0.\n   *\n   * If priorityFunction is defined, this value is updated every frame with the result of that call.\n   *\n   * @type {number}\n   * @default 0.0\n   */\n  this.priority = defaultValue(options.priority, 0.0);\n\n  /**\n   * Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the\n   * request will be throttled and sent based on priority.\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  this.throttle = throttle;\n\n  /**\n   * Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections\n   * for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value\n   * to <code>true</code> is preferable for requests going through HTTP/1 servers.\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  this.throttleByServer = throttleByServer;\n\n  /**\n   * Type of request.\n   *\n   * @type {RequestType}\n   * @readonly\n   *\n   * @default RequestType.OTHER\n   */\n  this.type = defaultValue(options.type, RequestType.OTHER);\n\n  /**\n   * A key used to identify the server that a request is going to. It is derived from the url's authority and scheme.\n   *\n   * @type {string}\n   *\n   * @private\n   */\n  this.serverKey = options.serverKey;\n\n  /**\n   * The current state of the request.\n   *\n   * @type {RequestState}\n   * @readonly\n   */\n  this.state = RequestState.UNISSUED;\n\n  /**\n   * The requests's deferred promise.\n   *\n   * @type {object}\n   *\n   * @private\n   */\n  this.deferred = undefined;\n\n  /**\n   * Whether the request was explicitly cancelled.\n   *\n   * @type {boolean}\n   *\n   * @private\n   */\n  this.cancelled = false;\n}\n\n/**\n * Mark the request as cancelled.\n *\n * @private\n */\nRequest.prototype.cancel = function () {\n  this.cancelled = true;\n};\n\n/**\n * Duplicates a Request instance.\n *\n * @param {Request} [result] The object onto which to store the result.\n *\n * @returns {Request} The modified result parameter or a new Resource instance if one was not provided.\n */\nRequest.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new Request(this);\n  }\n\n  result.url = this.url;\n  result.requestFunction = this.requestFunction;\n  result.cancelFunction = this.cancelFunction;\n  result.priorityFunction = this.priorityFunction;\n  result.priority = this.priority;\n  result.throttle = this.throttle;\n  result.throttleByServer = this.throttleByServer;\n  result.type = this.type;\n  result.serverKey = this.serverKey;\n\n  // These get defaulted because the cloned request hasn't been issued\n  result.state = RequestState.UNISSUED;\n  result.deferred = undefined;\n  result.cancelled = false;\n\n  return result;\n};\n\n/**\n * The function that makes the actual data request.\n * @callback Request.RequestCallback\n * @returns {Promise<void>} A promise for the requested data.\n */\n\n/**\n * The function that is called when the request is cancelled.\n * @callback Request.CancelCallback\n */\n\n/**\n * The function that is called to update the request's priority, which occurs once per frame.\n * @callback Request.PriorityCallback\n * @returns {number} The updated priority value.\n */\nexport default Request;\n", "/**\n * Parses the result of XMLHttpRequest's getAllResponseHeaders() method into\n * a dictionary.\n *\n * @function parseResponseHeaders\n *\n * @param {string} headerString The header string returned by getAllResponseHeaders().  The format is\n *                 described here: http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders()-method\n * @returns {object} A dictionary of key/value pairs, where each key is the name of a header and the corresponding value\n *                   is that header's value.\n *\n * @private\n */\nfunction parseResponseHeaders(headerString) {\n  const headers = {};\n\n  if (!headerString) {\n    return headers;\n  }\n\n  const headerPairs = headerString.split(\"\\u000d\\u000a\");\n\n  for (let i = 0; i < headerPairs.length; ++i) {\n    const headerPair = headerPairs[i];\n    // Can't use split() here because it does the wrong thing\n    // if the header value has the string \": \" in it.\n    const index = headerPair.indexOf(\"\\u003a\\u0020\");\n    if (index > 0) {\n      const key = headerPair.substring(0, index);\n      const val = headerPair.substring(index + 2);\n      headers[key] = val;\n    }\n  }\n\n  return headers;\n}\nexport default parseResponseHeaders;\n", "import defined from \"./defined.js\";\nimport parseResponseHeaders from \"./parseResponseHeaders.js\";\n\n/**\n * An event that is raised when a request encounters an error.\n *\n * @constructor\n * @alias RequestErrorEvent\n *\n * @param {number} [statusCode] The HTTP error status code, such as 404.\n * @param {object} [response] The response included along with the error.\n * @param {string|object} [responseHeaders] The response headers, represented either as an object literal or as a\n *                        string in the format returned by XMLHttpRequest's getAllResponseHeaders() function.\n */\nfunction RequestErrorEvent(statusCode, response, responseHeaders) {\n  /**\n   * The HTTP error status code, such as 404.  If the error does not have a particular\n   * HTTP code, this property will be undefined.\n   *\n   * @type {number}\n   */\n  this.statusCode = statusCode;\n\n  /**\n   * The response included along with the error.  If the error does not include a response,\n   * this property will be undefined.\n   *\n   * @type {object}\n   */\n  this.response = response;\n\n  /**\n   * The headers included in the response, represented as an object literal of key/value pairs.\n   * If the error does not include any headers, this property will be undefined.\n   *\n   * @type {object}\n   */\n  this.responseHeaders = responseHeaders;\n\n  if (typeof this.responseHeaders === \"string\") {\n    this.responseHeaders = parseResponseHeaders(this.responseHeaders);\n  }\n}\n\n/**\n * Creates a string representing this RequestErrorEvent.\n * @memberof RequestErrorEvent\n *\n * @returns {string} A string representing the provided RequestErrorEvent.\n */\nRequestErrorEvent.prototype.toString = function () {\n  let str = \"Request has failed.\";\n  if (defined(this.statusCode)) {\n    str += ` Status Code: ${this.statusCode}`;\n  }\n  return str;\n};\nexport default RequestErrorEvent;\n", "import Uri from \"urijs\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defer from \"./defer.js\";\nimport defined from \"./defined.js\";\nimport Event from \"./Event.js\";\nimport Heap from \"./Heap.js\";\nimport isBlobUri from \"./isBlobUri.js\";\nimport isDataUri from \"./isDataUri.js\";\nimport RequestState from \"./RequestState.js\";\n\nfunction sortRequests(a, b) {\n  return a.priority - b.priority;\n}\n\nconst statistics = {\n  numberOfAttemptedRequests: 0,\n  numberOfActiveRequests: 0,\n  numberOfCancelledRequests: 0,\n  numberOfCancelledActiveRequests: 0,\n  numberOfFailedRequests: 0,\n  numberOfActiveRequestsEver: 0,\n  lastNumberOfActiveRequests: 0,\n};\n\nlet priorityHeapLength = 20;\nconst requestHeap = new Heap({\n  comparator: sortRequests,\n});\nrequestHeap.maximumLength = priorityHeapLength;\nrequestHeap.reserve(priorityHeapLength);\n\nconst activeRequests = [];\nlet numberOfActiveRequestsByServer = {};\n\nconst pageUri =\n  typeof document !== \"undefined\" ? new Uri(document.location.href) : new Uri();\n\nconst requestCompletedEvent = new Event();\n\n/**\n * The request scheduler is used to track and constrain the number of active requests in order to prioritize incoming requests. The ability\n * to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position,\n * a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the\n * number of requests so that newer requests wait in a shorter queue and don't have to compete for bandwidth with requests that have expired.\n *\n * @namespace RequestScheduler\n *\n */\nfunction RequestScheduler() {}\n\n/**\n * The maximum number of simultaneous active requests. Un-throttled requests do not observe this limit.\n * @type {number}\n * @default 50\n */\nRequestScheduler.maximumRequests = 50;\n\n/**\n * The maximum number of simultaneous active requests per server. Un-throttled requests or servers specifically\n * listed in {@link requestsByServer} do not observe this limit.\n * @type {number}\n * @default 18\n */\nRequestScheduler.maximumRequestsPerServer = 18;\n\n/**\n * A per server key list of overrides to use for throttling instead of <code>maximumRequestsPerServer</code>.\n * Useful when streaming data from a known HTTP/2 or HTTP/3 server.\n * @type {object}\n *\n * @example\n * RequestScheduler.requestsByServer[\"myserver.com:443\"] = 18;\n *\n * @example\n * RequestScheduler.requestsByServer = {\n *   \"api.cesium.com:443\": 18,\n *   \"assets.cesium.com:443\": 18,\n * };\n */\nRequestScheduler.requestsByServer = {};\n\n/**\n * Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control.\n * @type {boolean}\n * @default true\n */\nRequestScheduler.throttleRequests = true;\n\n/**\n * When true, log statistics to the console every frame\n * @type {boolean}\n * @default false\n * @private\n */\nRequestScheduler.debugShowStatistics = false;\n\n/**\n * An event that's raised when a request is completed.  Event handlers are passed\n * the error object if the request fails.\n *\n * @type {Event}\n * @default Event()\n * @private\n */\nRequestScheduler.requestCompletedEvent = requestCompletedEvent;\n\nObject.defineProperties(RequestScheduler, {\n  /**\n   * Returns the statistics used by the request scheduler.\n   *\n   * @memberof RequestScheduler\n   *\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  statistics: {\n    get: function () {\n      return statistics;\n    },\n  },\n\n  /**\n   * The maximum size of the priority heap. This limits the number of requests that are sorted by priority. Only applies to requests that are not yet active.\n   *\n   * @memberof RequestScheduler\n   *\n   * @type {number}\n   * @default 20\n   * @private\n   */\n  priorityHeapLength: {\n    get: function () {\n      return priorityHeapLength;\n    },\n    set: function (value) {\n      // If the new length shrinks the heap, need to cancel some of the requests.\n      // Since this value is not intended to be tweaked regularly it is fine to just cancel the high priority requests.\n      if (value < priorityHeapLength) {\n        while (requestHeap.length > value) {\n          const request = requestHeap.pop();\n          cancelRequest(request);\n        }\n      }\n      priorityHeapLength = value;\n      requestHeap.maximumLength = value;\n      requestHeap.reserve(value);\n    },\n  },\n});\n\nfunction updatePriority(request) {\n  if (defined(request.priorityFunction)) {\n    request.priority = request.priorityFunction();\n  }\n}\n\n/**\n * Check if there are open slots for a particular server key. If desiredRequests is greater than 1, this checks if the queue has room for scheduling multiple requests.\n * @param {string} serverKey The server key returned by {@link RequestScheduler.getServerKey}.\n * @param {number} [desiredRequests=1] How many requests the caller plans to request\n * @return {boolean} True if there are enough open slots for <code>desiredRequests</code> more requests.\n * @private\n */\nRequestScheduler.serverHasOpenSlots = function (serverKey, desiredRequests) {\n  desiredRequests = defaultValue(desiredRequests, 1);\n\n  const maxRequests = defaultValue(\n    RequestScheduler.requestsByServer[serverKey],\n    RequestScheduler.maximumRequestsPerServer\n  );\n  const hasOpenSlotsServer =\n    numberOfActiveRequestsByServer[serverKey] + desiredRequests <= maxRequests;\n\n  return hasOpenSlotsServer;\n};\n\n/**\n * Check if the priority heap has open slots, regardless of which server they\n * are from. This is used in {@link Multiple3DTileContent} for determining when\n * all requests can be scheduled\n * @param {number} desiredRequests The number of requests the caller intends to make\n * @return {boolean} <code>true</code> if the heap has enough available slots to meet the desiredRequests. <code>false</code> otherwise.\n *\n * @private\n */\nRequestScheduler.heapHasOpenSlots = function (desiredRequests) {\n  const hasOpenSlotsHeap =\n    requestHeap.length + desiredRequests <= priorityHeapLength;\n  return hasOpenSlotsHeap;\n};\n\nfunction issueRequest(request) {\n  if (request.state === RequestState.UNISSUED) {\n    request.state = RequestState.ISSUED;\n    request.deferred = defer();\n  }\n  return request.deferred.promise;\n}\n\nfunction getRequestReceivedFunction(request) {\n  return function (results) {\n    if (request.state === RequestState.CANCELLED) {\n      // If the data request comes back but the request is cancelled, ignore it.\n      return;\n    }\n    // explicitly set to undefined to ensure GC of request response data. See #8843\n    const deferred = request.deferred;\n\n    --statistics.numberOfActiveRequests;\n    --numberOfActiveRequestsByServer[request.serverKey];\n    requestCompletedEvent.raiseEvent();\n    request.state = RequestState.RECEIVED;\n    request.deferred = undefined;\n\n    deferred.resolve(results);\n  };\n}\n\nfunction getRequestFailedFunction(request) {\n  return function (error) {\n    if (request.state === RequestState.CANCELLED) {\n      // If the data request comes back but the request is cancelled, ignore it.\n      return;\n    }\n    ++statistics.numberOfFailedRequests;\n    --statistics.numberOfActiveRequests;\n    --numberOfActiveRequestsByServer[request.serverKey];\n    requestCompletedEvent.raiseEvent(error);\n    request.state = RequestState.FAILED;\n    request.deferred.reject(error);\n  };\n}\n\nfunction startRequest(request) {\n  const promise = issueRequest(request);\n  request.state = RequestState.ACTIVE;\n  activeRequests.push(request);\n  ++statistics.numberOfActiveRequests;\n  ++statistics.numberOfActiveRequestsEver;\n  ++numberOfActiveRequestsByServer[request.serverKey];\n  request\n    .requestFunction()\n    .then(getRequestReceivedFunction(request))\n    .catch(getRequestFailedFunction(request));\n  return promise;\n}\n\nfunction cancelRequest(request) {\n  const active = request.state === RequestState.ACTIVE;\n  request.state = RequestState.CANCELLED;\n  ++statistics.numberOfCancelledRequests;\n  // check that deferred has not been cleared since cancelRequest can be called\n  // on a finished request, e.g. by clearForSpecs during tests\n  if (defined(request.deferred)) {\n    const deferred = request.deferred;\n    request.deferred = undefined;\n    deferred.reject();\n  }\n\n  if (active) {\n    --statistics.numberOfActiveRequests;\n    --numberOfActiveRequestsByServer[request.serverKey];\n    ++statistics.numberOfCancelledActiveRequests;\n  }\n\n  if (defined(request.cancelFunction)) {\n    request.cancelFunction();\n  }\n}\n\n/**\n * Sort requests by priority and start requests.\n * @private\n */\nRequestScheduler.update = function () {\n  let i;\n  let request;\n\n  // Loop over all active requests. Cancelled, failed, or received requests are removed from the array to make room for new requests.\n  let removeCount = 0;\n  const activeLength = activeRequests.length;\n  for (i = 0; i < activeLength; ++i) {\n    request = activeRequests[i];\n    if (request.cancelled) {\n      // Request was explicitly cancelled\n      cancelRequest(request);\n    }\n    if (request.state !== RequestState.ACTIVE) {\n      // Request is no longer active, remove from array\n      ++removeCount;\n      continue;\n    }\n    if (removeCount > 0) {\n      // Shift back to fill in vacated slots from completed requests\n      activeRequests[i - removeCount] = request;\n    }\n  }\n  activeRequests.length -= removeCount;\n\n  // Update priority of issued requests and resort the heap\n  const issuedRequests = requestHeap.internalArray;\n  const issuedLength = requestHeap.length;\n  for (i = 0; i < issuedLength; ++i) {\n    updatePriority(issuedRequests[i]);\n  }\n  requestHeap.resort();\n\n  // Get the number of open slots and fill with the highest priority requests.\n  // Un-throttled requests are automatically added to activeRequests, so activeRequests.length may exceed maximumRequests\n  const openSlots = Math.max(\n    RequestScheduler.maximumRequests - activeRequests.length,\n    0\n  );\n  let filledSlots = 0;\n  while (filledSlots < openSlots && requestHeap.length > 0) {\n    // Loop until all open slots are filled or the heap becomes empty\n    request = requestHeap.pop();\n    if (request.cancelled) {\n      // Request was explicitly cancelled\n      cancelRequest(request);\n      continue;\n    }\n\n    if (\n      request.throttleByServer &&\n      !RequestScheduler.serverHasOpenSlots(request.serverKey)\n    ) {\n      // Open slots are available, but the request is throttled by its server. Cancel and try again later.\n      cancelRequest(request);\n      continue;\n    }\n\n    startRequest(request);\n    ++filledSlots;\n  }\n\n  updateStatistics();\n};\n\n/**\n * Get the server key from a given url.\n *\n * @param {string} url The url.\n * @returns {string} The server key.\n * @private\n */\nRequestScheduler.getServerKey = function (url) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"url\", url);\n  //>>includeEnd('debug');\n\n  let uri = new Uri(url);\n  if (uri.scheme() === \"\") {\n    uri = uri.absoluteTo(pageUri);\n    uri.normalize();\n  }\n\n  let serverKey = uri.authority();\n  if (!/:/.test(serverKey)) {\n    // If the authority does not contain a port number, add port 443 for https or port 80 for http\n    serverKey = `${serverKey}:${uri.scheme() === \"https\" ? \"443\" : \"80\"}`;\n  }\n\n  const length = numberOfActiveRequestsByServer[serverKey];\n  if (!defined(length)) {\n    numberOfActiveRequestsByServer[serverKey] = 0;\n  }\n\n  return serverKey;\n};\n\n/**\n * Issue a request. If request.throttle is false, the request is sent immediately. Otherwise the request will be\n * queued and sorted by priority before being sent.\n *\n * @param {Request} request The request object.\n *\n * @returns {Promise|undefined} A Promise for the requested data, or undefined if this request does not have high enough priority to be issued.\n *\n * @private\n */\nRequestScheduler.request = function (request) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"request\", request);\n  Check.typeOf.string(\"request.url\", request.url);\n  Check.typeOf.func(\"request.requestFunction\", request.requestFunction);\n  //>>includeEnd('debug');\n\n  if (isDataUri(request.url) || isBlobUri(request.url)) {\n    requestCompletedEvent.raiseEvent();\n    request.state = RequestState.RECEIVED;\n    return request.requestFunction();\n  }\n\n  ++statistics.numberOfAttemptedRequests;\n\n  if (!defined(request.serverKey)) {\n    request.serverKey = RequestScheduler.getServerKey(request.url);\n  }\n\n  if (\n    RequestScheduler.throttleRequests &&\n    request.throttleByServer &&\n    !RequestScheduler.serverHasOpenSlots(request.serverKey)\n  ) {\n    // Server is saturated. Try again later.\n    return undefined;\n  }\n\n  if (!RequestScheduler.throttleRequests || !request.throttle) {\n    return startRequest(request);\n  }\n\n  if (activeRequests.length >= RequestScheduler.maximumRequests) {\n    // Active requests are saturated. Try again later.\n    return undefined;\n  }\n\n  // Insert into the priority heap and see if a request was bumped off. If this request is the lowest\n  // priority it will be returned.\n  updatePriority(request);\n  const removedRequest = requestHeap.insert(request);\n\n  if (defined(removedRequest)) {\n    if (removedRequest === request) {\n      // Request does not have high enough priority to be issued\n      return undefined;\n    }\n    // A previously issued request has been bumped off the priority heap, so cancel it\n    cancelRequest(removedRequest);\n  }\n\n  return issueRequest(request);\n};\n\nfunction updateStatistics() {\n  if (!RequestScheduler.debugShowStatistics) {\n    return;\n  }\n\n  if (\n    statistics.numberOfActiveRequests === 0 &&\n    statistics.lastNumberOfActiveRequests > 0\n  ) {\n    if (statistics.numberOfAttemptedRequests > 0) {\n      console.log(\n        `Number of attempted requests: ${statistics.numberOfAttemptedRequests}`\n      );\n      statistics.numberOfAttemptedRequests = 0;\n    }\n\n    if (statistics.numberOfCancelledRequests > 0) {\n      console.log(\n        `Number of cancelled requests: ${statistics.numberOfCancelledRequests}`\n      );\n      statistics.numberOfCancelledRequests = 0;\n    }\n\n    if (statistics.numberOfCancelledActiveRequests > 0) {\n      console.log(\n        `Number of cancelled active requests: ${statistics.numberOfCancelledActiveRequests}`\n      );\n      statistics.numberOfCancelledActiveRequests = 0;\n    }\n\n    if (statistics.numberOfFailedRequests > 0) {\n      console.log(\n        `Number of failed requests: ${statistics.numberOfFailedRequests}`\n      );\n      statistics.numberOfFailedRequests = 0;\n    }\n  }\n\n  statistics.lastNumberOfActiveRequests = statistics.numberOfActiveRequests;\n}\n\n/**\n * For testing only. Clears any requests that may not have completed from previous tests.\n *\n * @private\n */\nRequestScheduler.clearForSpecs = function () {\n  while (requestHeap.length > 0) {\n    const request = requestHeap.pop();\n    cancelRequest(request);\n  }\n  const length = activeRequests.length;\n  for (let i = 0; i < length; ++i) {\n    cancelRequest(activeRequests[i]);\n  }\n  activeRequests.length = 0;\n  numberOfActiveRequestsByServer = {};\n\n  // Clear stats\n  statistics.numberOfAttemptedRequests = 0;\n  statistics.numberOfActiveRequests = 0;\n  statistics.numberOfCancelledRequests = 0;\n  statistics.numberOfCancelledActiveRequests = 0;\n  statistics.numberOfFailedRequests = 0;\n  statistics.numberOfActiveRequestsEver = 0;\n  statistics.lastNumberOfActiveRequests = 0;\n};\n\n/**\n * For testing only.\n *\n * @private\n */\nRequestScheduler.numberOfActiveRequestsByServer = function (serverKey) {\n  return numberOfActiveRequestsByServer[serverKey];\n};\n\n/**\n * For testing only.\n *\n * @private\n */\nRequestScheduler.requestHeap = requestHeap;\nexport default RequestScheduler;\n", "import Check from \"./Check.js\";\nimport defined from \"./defined.js\";\n\n/**\n * A generic utility class for managing subscribers for a particular event.\n * This class is usually instantiated inside of a container class and\n * exposed as a property for others to subscribe to.\n *\n * @alias Event\n * @template Listener extends (...args: any[]) => void = (...args: any[]) => void\n * @constructor\n * @example\n * MyObject.prototype.myListener = function(arg1, arg2) {\n *     this.myArg1Copy = arg1;\n *     this.myArg2Copy = arg2;\n * }\n *\n * const myObjectInstance = new MyObject();\n * const evt = new Cesium.Event();\n * evt.addEventListener(MyObject.prototype.myListener, myObjectInstance);\n * evt.raiseEvent('1', '2');\n * evt.removeEventListener(MyObject.prototype.myListener);\n */\nfunction Event() {\n  this._listeners = [];\n  this._scopes = [];\n  this._toRemove = [];\n  this._insideRaiseEvent = false;\n}\n\nObject.defineProperties(Event.prototype, {\n  /**\n   * The number of listeners currently subscribed to the event.\n   * @memberof Event.prototype\n   * @type {number}\n   * @readonly\n   */\n  numberOfListeners: {\n    get: function () {\n      return this._listeners.length - this._toRemove.length;\n    },\n  },\n});\n\n/**\n * Registers a callback function to be executed whenever the event is raised.\n * An optional scope can be provided to serve as the <code>this</code> pointer\n * in which the function will execute.\n *\n * @param {Listener} listener The function to be executed when the event is raised.\n * @param {object} [scope] An optional object scope to serve as the <code>this</code>\n *        pointer in which the listener function will execute.\n * @returns {Event.RemoveCallback} A function that will remove this event listener when invoked.\n *\n * @see Event#raiseEvent\n * @see Event#removeEventListener\n */\nEvent.prototype.addEventListener = function (listener, scope) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.func(\"listener\", listener);\n  //>>includeEnd('debug');\n\n  this._listeners.push(listener);\n  this._scopes.push(scope);\n\n  const event = this;\n  return function () {\n    event.removeEventListener(listener, scope);\n  };\n};\n\n/**\n * Unregisters a previously registered callback.\n *\n * @param {Listener} listener The function to be unregistered.\n * @param {object} [scope] The scope that was originally passed to addEventListener.\n * @returns {boolean} <code>true</code> if the listener was removed; <code>false</code> if the listener and scope are not registered with the event.\n *\n * @see Event#addEventListener\n * @see Event#raiseEvent\n */\nEvent.prototype.removeEventListener = function (listener, scope) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.func(\"listener\", listener);\n  //>>includeEnd('debug');\n\n  const listeners = this._listeners;\n  const scopes = this._scopes;\n\n  let index = -1;\n  for (let i = 0; i < listeners.length; i++) {\n    if (listeners[i] === listener && scopes[i] === scope) {\n      index = i;\n      break;\n    }\n  }\n\n  if (index !== -1) {\n    if (this._insideRaiseEvent) {\n      //In order to allow removing an event subscription from within\n      //a callback, we don't actually remove the items here.  Instead\n      //remember the index they are at and undefined their value.\n      this._toRemove.push(index);\n      listeners[index] = undefined;\n      scopes[index] = undefined;\n    } else {\n      listeners.splice(index, 1);\n      scopes.splice(index, 1);\n    }\n    return true;\n  }\n\n  return false;\n};\n\nfunction compareNumber(a, b) {\n  return b - a;\n}\n\n/**\n * Raises the event by calling each registered listener with all supplied arguments.\n *\n * @param {...Parameters<Listener>} arguments This method takes any number of parameters and passes them through to the listener functions.\n *\n * @see Event#addEventListener\n * @see Event#removeEventListener\n */\nEvent.prototype.raiseEvent = function () {\n  this._insideRaiseEvent = true;\n\n  let i;\n  const listeners = this._listeners;\n  const scopes = this._scopes;\n  let length = listeners.length;\n\n  for (i = 0; i < length; i++) {\n    const listener = listeners[i];\n    if (defined(listener)) {\n      listeners[i].apply(scopes[i], arguments);\n    }\n  }\n\n  //Actually remove items removed in removeEventListener.\n  const toRemove = this._toRemove;\n  length = toRemove.length;\n  if (length > 0) {\n    toRemove.sort(compareNumber);\n    for (i = 0; i < length; i++) {\n      const index = toRemove[i];\n      listeners.splice(index, 1);\n      scopes.splice(index, 1);\n    }\n    toRemove.length = 0;\n  }\n\n  this._insideRaiseEvent = false;\n};\n\n/**\n * A function that removes a listener.\n * @callback Event.RemoveCallback\n */\n\nexport default Event;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\n\n/**\n * Array implementation of a heap.\n *\n * @alias Heap\n * @constructor\n * @private\n *\n * @param {object} options Object with the following properties:\n * @param {Heap.ComparatorCallback} options.comparator The comparator to use for the heap. If comparator(a, b) is less than 0, sort a to a lower index than b, otherwise sort to a higher index.\n */\nfunction Heap(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options\", options);\n  Check.defined(\"options.comparator\", options.comparator);\n  //>>includeEnd('debug');\n\n  this._comparator = options.comparator;\n  this._array = [];\n  this._length = 0;\n  this._maximumLength = undefined;\n}\n\nObject.defineProperties(Heap.prototype, {\n  /**\n   * Gets the length of the heap.\n   *\n   * @memberof Heap.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  length: {\n    get: function () {\n      return this._length;\n    },\n  },\n\n  /**\n   * Gets the internal array.\n   *\n   * @memberof Heap.prototype\n   *\n   * @type {Array}\n   * @readonly\n   */\n  internalArray: {\n    get: function () {\n      return this._array;\n    },\n  },\n\n  /**\n   * Gets and sets the maximum length of the heap.\n   *\n   * @memberof Heap.prototype\n   *\n   * @type {number}\n   */\n  maximumLength: {\n    get: function () {\n      return this._maximumLength;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"maximumLength\", value, 0);\n      //>>includeEnd('debug');\n      const originalLength = this._length;\n      if (value < originalLength) {\n        const array = this._array;\n        // Remove trailing references\n        for (let i = value; i < originalLength; ++i) {\n          array[i] = undefined;\n        }\n        this._length = value;\n        array.length = value;\n      }\n      this._maximumLength = value;\n    },\n  },\n\n  /**\n   * The comparator to use for the heap. If comparator(a, b) is less than 0, sort a to a lower index than b, otherwise sort to a higher index.\n   *\n   * @memberof Heap.prototype\n   *\n   * @type {Heap.ComparatorCallback}\n   */\n  comparator: {\n    get: function () {\n      return this._comparator;\n    },\n  },\n});\n\nfunction swap(array, a, b) {\n  const temp = array[a];\n  array[a] = array[b];\n  array[b] = temp;\n}\n\n/**\n * Resizes the internal array of the heap.\n *\n * @param {number} [length] The length to resize internal array to. Defaults to the current length of the heap.\n */\nHeap.prototype.reserve = function (length) {\n  length = defaultValue(length, this._length);\n  this._array.length = length;\n};\n\n/**\n * Update the heap so that index and all descendants satisfy the heap property.\n *\n * @param {number} [index=0] The starting index to heapify from.\n */\nHeap.prototype.heapify = function (index) {\n  index = defaultValue(index, 0);\n  const length = this._length;\n  const comparator = this._comparator;\n  const array = this._array;\n  let candidate = -1;\n  let inserting = true;\n\n  while (inserting) {\n    const right = 2 * (index + 1);\n    const left = right - 1;\n\n    if (left < length && comparator(array[left], array[index]) < 0) {\n      candidate = left;\n    } else {\n      candidate = index;\n    }\n\n    if (right < length && comparator(array[right], array[candidate]) < 0) {\n      candidate = right;\n    }\n    if (candidate !== index) {\n      swap(array, candidate, index);\n      index = candidate;\n    } else {\n      inserting = false;\n    }\n  }\n};\n\n/**\n * Resort the heap.\n */\nHeap.prototype.resort = function () {\n  const length = this._length;\n  for (let i = Math.ceil(length / 2); i >= 0; --i) {\n    this.heapify(i);\n  }\n};\n\n/**\n * Insert an element into the heap. If the length would grow greater than maximumLength\n * of the heap, extra elements are removed.\n *\n * @param {*} element The element to insert\n *\n * @return {*} The element that was removed from the heap if the heap is at full capacity.\n */\nHeap.prototype.insert = function (element) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"element\", element);\n  //>>includeEnd('debug');\n\n  const array = this._array;\n  const comparator = this._comparator;\n  const maximumLength = this._maximumLength;\n\n  let index = this._length++;\n  if (index < array.length) {\n    array[index] = element;\n  } else {\n    array.push(element);\n  }\n\n  while (index !== 0) {\n    const parent = Math.floor((index - 1) / 2);\n    if (comparator(array[index], array[parent]) < 0) {\n      swap(array, index, parent);\n      index = parent;\n    } else {\n      break;\n    }\n  }\n\n  let removedElement;\n\n  if (defined(maximumLength) && this._length > maximumLength) {\n    removedElement = array[maximumLength];\n    this._length = maximumLength;\n  }\n\n  return removedElement;\n};\n\n/**\n * Remove the element specified by index from the heap and return it.\n *\n * @param {number} [index=0] The index to remove.\n * @returns {*} The specified element of the heap.\n */\nHeap.prototype.pop = function (index) {\n  index = defaultValue(index, 0);\n  if (this._length === 0) {\n    return undefined;\n  }\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.lessThan(\"index\", index, this._length);\n  //>>includeEnd('debug');\n\n  const array = this._array;\n  const root = array[index];\n  swap(array, index, --this._length);\n  this.heapify(index);\n  array[this._length] = undefined; // Remove trailing reference\n  return root;\n};\n\n/**\n * The comparator to use for the heap.\n * @callback Heap.ComparatorCallback\n * @param {*} a An element in the heap.\n * @param {*} b An element in the heap.\n * @returns {number} If the result of the comparison is less than 0, sort a to a lower index than b, otherwise sort to a higher index.\n */\nexport default Heap;\n", "import Uri from \"urijs\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * A singleton that contains all of the servers that are trusted. Credentials will be sent with\n * any requests to these servers.\n *\n * @namespace TrustedServers\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n */\nconst TrustedServers = {};\nlet _servers = {};\n\n/**\n * Adds a trusted server to the registry\n *\n * @param {string} host The host to be added.\n * @param {number} port The port used to access the host.\n *\n * @example\n * // Add a trusted server\n * TrustedServers.add('my.server.com', 80);\n */\nTrustedServers.add = function (host, port) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(host)) {\n    throw new DeveloperError(\"host is required.\");\n  }\n  if (!defined(port) || port <= 0) {\n    throw new DeveloperError(\"port is required to be greater than 0.\");\n  }\n  //>>includeEnd('debug');\n\n  const authority = `${host.toLowerCase()}:${port}`;\n  if (!defined(_servers[authority])) {\n    _servers[authority] = true;\n  }\n};\n\n/**\n * Removes a trusted server from the registry\n *\n * @param {string} host The host to be removed.\n * @param {number} port The port used to access the host.\n *\n * @example\n * // Remove a trusted server\n * TrustedServers.remove('my.server.com', 80);\n */\nTrustedServers.remove = function (host, port) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(host)) {\n    throw new DeveloperError(\"host is required.\");\n  }\n  if (!defined(port) || port <= 0) {\n    throw new DeveloperError(\"port is required to be greater than 0.\");\n  }\n  //>>includeEnd('debug');\n\n  const authority = `${host.toLowerCase()}:${port}`;\n  if (defined(_servers[authority])) {\n    delete _servers[authority];\n  }\n};\n\nfunction getAuthority(url) {\n  const uri = new Uri(url);\n  uri.normalize();\n\n  // Removes username:password@ so we just have host[:port]\n  let authority = uri.authority();\n  if (authority.length === 0) {\n    return undefined; // Relative URL\n  }\n  uri.authority(authority);\n\n  if (authority.indexOf(\"@\") !== -1) {\n    const parts = authority.split(\"@\");\n    authority = parts[1];\n  }\n\n  // If the port is missing add one based on the scheme\n  if (authority.indexOf(\":\") === -1) {\n    let scheme = uri.scheme();\n    if (scheme.length === 0) {\n      scheme = window.location.protocol;\n      scheme = scheme.substring(0, scheme.length - 1);\n    }\n    if (scheme === \"http\") {\n      authority += \":80\";\n    } else if (scheme === \"https\") {\n      authority += \":443\";\n    } else {\n      return undefined;\n    }\n  }\n\n  return authority;\n}\n\n/**\n * Tests whether a server is trusted or not. The server must have been added with the port if it is included in the url.\n *\n * @param {string} url The url to be tested against the trusted list\n *\n * @returns {boolean} Returns true if url is trusted, false otherwise.\n *\n * @example\n * // Add server\n * TrustedServers.add('my.server.com', 81);\n *\n * // Check if server is trusted\n * if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) {\n *     // my.server.com:81 is trusted\n * }\n * if (TrustedServers.contains('https://my.server.com/path/to/file.png')) {\n *     // my.server.com isn't trusted\n * }\n */\nTrustedServers.contains = function (url) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(url)) {\n    throw new DeveloperError(\"url is required.\");\n  }\n  //>>includeEnd('debug');\n  const authority = getAuthority(url);\n  if (defined(authority) && defined(_servers[authority])) {\n    return true;\n  }\n\n  return false;\n};\n\n/**\n * Clears the registry\n *\n * @example\n * // Remove a trusted server\n * TrustedServers.clear();\n */\nTrustedServers.clear = function () {\n  _servers = {};\n};\nexport default TrustedServers;\n", "import binarySearch from \"./binarySearch.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport EarthOrientationParametersSample from \"./EarthOrientationParametersSample.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport LeapSecond from \"./LeapSecond.js\";\nimport Resource from \"./Resource.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TimeConstants from \"./TimeConstants.js\";\nimport TimeStandard from \"./TimeStandard.js\";\n\n/**\n * Specifies Earth polar motion coordinates and the difference between UT1 and UTC.\n * These Earth Orientation Parameters (EOP) are primarily used in the transformation from\n * the International Celestial Reference Frame (ICRF) to the International Terrestrial\n * Reference Frame (ITRF).\n * This object is normally not instantiated directly, use {@link EarthOrientationParameters.fromUrl}.\n *\n * @alias EarthOrientationParameters\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {object} [options.data] The actual EOP data.  If neither this\n *                 parameter nor options.data is specified, all EOP values are assumed\n *                 to be 0.0.\n * @param {boolean} [options.addNewLeapSeconds=true] True if leap seconds that\n *                  are specified in the EOP data but not in {@link JulianDate.leapSeconds}\n *                  should be added to {@link JulianDate.leapSeconds}.  False if\n *                  new leap seconds should be handled correctly in the context\n *                  of the EOP data but otherwise ignored.\n *\n * @private\n */\nfunction EarthOrientationParameters(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._dates = undefined;\n  this._samples = undefined;\n\n  this._dateColumn = -1;\n  this._xPoleWanderRadiansColumn = -1;\n  this._yPoleWanderRadiansColumn = -1;\n  this._ut1MinusUtcSecondsColumn = -1;\n  this._xCelestialPoleOffsetRadiansColumn = -1;\n  this._yCelestialPoleOffsetRadiansColumn = -1;\n  this._taiMinusUtcSecondsColumn = -1;\n\n  this._columnCount = 0;\n  this._lastIndex = -1;\n\n  this._addNewLeapSeconds = defaultValue(options.addNewLeapSeconds, true);\n\n  if (defined(options.data)) {\n    // Use supplied EOP data.\n    onDataReady(this, options.data);\n  } else {\n    // Use all zeros for EOP data.\n    onDataReady(this, {\n      columnNames: [\n        \"dateIso8601\",\n        \"modifiedJulianDateUtc\",\n        \"xPoleWanderRadians\",\n        \"yPoleWanderRadians\",\n        \"ut1MinusUtcSeconds\",\n        \"lengthOfDayCorrectionSeconds\",\n        \"xCelestialPoleOffsetRadians\",\n        \"yCelestialPoleOffsetRadians\",\n        \"taiMinusUtcSeconds\",\n      ],\n      samples: [],\n    });\n  }\n}\n\n/**\n *\n * @param {Resource|string} [url] The URL from which to obtain EOP data.  If neither this\n *                 parameter nor options.data is specified, all EOP values are assumed\n *                 to be 0.0.  If options.data is specified, this parameter is\n *                 ignored.\n * @param {object} [options] Object with the following properties:\n * @param {boolean} [options.addNewLeapSeconds=true] True if leap seconds that\n *                  are specified in the EOP data but not in {@link JulianDate.leapSeconds}\n *                  should be added to {@link JulianDate.leapSeconds}.  False if\n *                  new leap seconds should be handled correctly in the context\n *                  of the EOP data but otherwise ignored.\n *\n * @example\n * // An example EOP data file, EOP.json:\n * {\n *   \"columnNames\" : [\"dateIso8601\",\"modifiedJulianDateUtc\",\"xPoleWanderRadians\",\"yPoleWanderRadians\",\"ut1MinusUtcSeconds\",\"lengthOfDayCorrectionSeconds\",\"xCelestialPoleOffsetRadians\",\"yCelestialPoleOffsetRadians\",\"taiMinusUtcSeconds\"],\n *   \"samples\" : [\n *      \"2011-07-01T00:00:00Z\",55743.0,2.117957047295119e-7,2.111518721609984e-6,-0.2908948,-2.956e-4,3.393695767766752e-11,3.3452143996557983e-10,34.0,\n *      \"2011-07-02T00:00:00Z\",55744.0,2.193297093339541e-7,2.115460256837405e-6,-0.29065,-1.824e-4,-8.241832578862112e-11,5.623838700870617e-10,34.0,\n *      \"2011-07-03T00:00:00Z\",55745.0,2.262286080161428e-7,2.1191157519929706e-6,-0.2905572,1.9e-6,-3.490658503988659e-10,6.981317007977318e-10,34.0\n *   ]\n * }\n *\n * @example\n * // Loading the EOP data\n * const eop = await Cesium.EarthOrientationParameters.fromUrl('Data/EOP.json');\n * Cesium.Transforms.earthOrientationParameters = eop;\n */\nEarthOrientationParameters.fromUrl = async function (url, options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"url\", url);\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const resource = Resource.createIfNeeded(url);\n\n  // Download EOP data.\n  let eopData;\n  try {\n    eopData = await resource.fetchJson();\n  } catch (e) {\n    throw new RuntimeError(\n      `An error occurred while retrieving the EOP data from the URL ${resource.url}.`\n    );\n  }\n\n  return new EarthOrientationParameters({\n    addNewLeapSeconds: options.addNewLeapSeconds,\n    data: eopData,\n  });\n};\n\n/**\n * A default {@link EarthOrientationParameters} instance that returns zero for all EOP values.\n */\nEarthOrientationParameters.NONE = Object.freeze({\n  compute: function (date, result) {\n    if (!defined(result)) {\n      result = new EarthOrientationParametersSample(0.0, 0.0, 0.0, 0.0, 0.0);\n    } else {\n      result.xPoleWander = 0.0;\n      result.yPoleWander = 0.0;\n      result.xPoleOffset = 0.0;\n      result.yPoleOffset = 0.0;\n      result.ut1MinusUtc = 0.0;\n    }\n    return result;\n  },\n});\n\n/**\n * Computes the Earth Orientation Parameters (EOP) for a given date by interpolating.\n * If the EOP data has not yet been download, this method returns undefined.\n *\n * @param {JulianDate} date The date for each to evaluate the EOP.\n * @param {EarthOrientationParametersSample} [result] The instance to which to copy the result.\n *        If this parameter is undefined, a new instance is created and returned.\n * @returns {EarthOrientationParametersSample} The EOP evaluated at the given date, or\n *          undefined if the data necessary to evaluate EOP at the date has not yet been\n *          downloaded.\n *\n * @exception {RuntimeError} The loaded EOP data has an error and cannot be used.\n *\n * @see EarthOrientationParameters#fromUrl\n */\nEarthOrientationParameters.prototype.compute = function (date, result) {\n  // We cannot compute until the samples are available.\n  if (!defined(this._samples)) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    result = new EarthOrientationParametersSample(0.0, 0.0, 0.0, 0.0, 0.0);\n  }\n\n  if (this._samples.length === 0) {\n    result.xPoleWander = 0.0;\n    result.yPoleWander = 0.0;\n    result.xPoleOffset = 0.0;\n    result.yPoleOffset = 0.0;\n    result.ut1MinusUtc = 0.0;\n    return result;\n  }\n\n  const dates = this._dates;\n  const lastIndex = this._lastIndex;\n\n  let before = 0;\n  let after = 0;\n  if (defined(lastIndex)) {\n    const previousIndexDate = dates[lastIndex];\n    const nextIndexDate = dates[lastIndex + 1];\n    const isAfterPrevious = JulianDate.lessThanOrEquals(\n      previousIndexDate,\n      date\n    );\n    const isAfterLastSample = !defined(nextIndexDate);\n    const isBeforeNext =\n      isAfterLastSample || JulianDate.greaterThanOrEquals(nextIndexDate, date);\n\n    if (isAfterPrevious && isBeforeNext) {\n      before = lastIndex;\n\n      if (!isAfterLastSample && nextIndexDate.equals(date)) {\n        ++before;\n      }\n      after = before + 1;\n\n      interpolate(this, dates, this._samples, date, before, after, result);\n      return result;\n    }\n  }\n\n  let index = binarySearch(dates, date, JulianDate.compare, this._dateColumn);\n  if (index >= 0) {\n    // If the next entry is the same date, use the later entry.  This way, if two entries\n    // describe the same moment, one before a leap second and the other after, then we will use\n    // the post-leap second data.\n    if (index < dates.length - 1 && dates[index + 1].equals(date)) {\n      ++index;\n    }\n    before = index;\n    after = index;\n  } else {\n    after = ~index;\n    before = after - 1;\n\n    // Use the first entry if the date requested is before the beginning of the data.\n    if (before < 0) {\n      before = 0;\n    }\n  }\n\n  this._lastIndex = before;\n\n  interpolate(this, dates, this._samples, date, before, after, result);\n  return result;\n};\n\nfunction compareLeapSecondDates(leapSecond, dateToFind) {\n  return JulianDate.compare(leapSecond.julianDate, dateToFind);\n}\n\nfunction onDataReady(eop, eopData) {\n  if (!defined(eopData.columnNames)) {\n    throw new RuntimeError(\n      \"Error in loaded EOP data: The columnNames property is required.\"\n    );\n  }\n\n  if (!defined(eopData.samples)) {\n    throw new RuntimeError(\n      \"Error in loaded EOP data: The samples property is required.\"\n    );\n  }\n\n  const dateColumn = eopData.columnNames.indexOf(\"modifiedJulianDateUtc\");\n  const xPoleWanderRadiansColumn = eopData.columnNames.indexOf(\n    \"xPoleWanderRadians\"\n  );\n  const yPoleWanderRadiansColumn = eopData.columnNames.indexOf(\n    \"yPoleWanderRadians\"\n  );\n  const ut1MinusUtcSecondsColumn = eopData.columnNames.indexOf(\n    \"ut1MinusUtcSeconds\"\n  );\n  const xCelestialPoleOffsetRadiansColumn = eopData.columnNames.indexOf(\n    \"xCelestialPoleOffsetRadians\"\n  );\n  const yCelestialPoleOffsetRadiansColumn = eopData.columnNames.indexOf(\n    \"yCelestialPoleOffsetRadians\"\n  );\n  const taiMinusUtcSecondsColumn = eopData.columnNames.indexOf(\n    \"taiMinusUtcSeconds\"\n  );\n\n  if (\n    dateColumn < 0 ||\n    xPoleWanderRadiansColumn < 0 ||\n    yPoleWanderRadiansColumn < 0 ||\n    ut1MinusUtcSecondsColumn < 0 ||\n    xCelestialPoleOffsetRadiansColumn < 0 ||\n    yCelestialPoleOffsetRadiansColumn < 0 ||\n    taiMinusUtcSecondsColumn < 0\n  ) {\n    throw new RuntimeError(\n      \"Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns\"\n    );\n  }\n\n  const samples = (eop._samples = eopData.samples);\n  const dates = (eop._dates = []);\n\n  eop._dateColumn = dateColumn;\n  eop._xPoleWanderRadiansColumn = xPoleWanderRadiansColumn;\n  eop._yPoleWanderRadiansColumn = yPoleWanderRadiansColumn;\n  eop._ut1MinusUtcSecondsColumn = ut1MinusUtcSecondsColumn;\n  eop._xCelestialPoleOffsetRadiansColumn = xCelestialPoleOffsetRadiansColumn;\n  eop._yCelestialPoleOffsetRadiansColumn = yCelestialPoleOffsetRadiansColumn;\n  eop._taiMinusUtcSecondsColumn = taiMinusUtcSecondsColumn;\n\n  eop._columnCount = eopData.columnNames.length;\n  eop._lastIndex = undefined;\n\n  let lastTaiMinusUtc;\n\n  const addNewLeapSeconds = eop._addNewLeapSeconds;\n\n  // Convert the ISO8601 dates to JulianDates.\n  for (let i = 0, len = samples.length; i < len; i += eop._columnCount) {\n    const mjd = samples[i + dateColumn];\n    const taiMinusUtc = samples[i + taiMinusUtcSecondsColumn];\n    const day = mjd + TimeConstants.MODIFIED_JULIAN_DATE_DIFFERENCE;\n    const date = new JulianDate(day, taiMinusUtc, TimeStandard.TAI);\n    dates.push(date);\n\n    if (addNewLeapSeconds) {\n      if (taiMinusUtc !== lastTaiMinusUtc && defined(lastTaiMinusUtc)) {\n        // We crossed a leap second boundary, so add the leap second\n        // if it does not already exist.\n        const leapSeconds = JulianDate.leapSeconds;\n        const leapSecondIndex = binarySearch(\n          leapSeconds,\n          date,\n          compareLeapSecondDates\n        );\n        if (leapSecondIndex < 0) {\n          const leapSecond = new LeapSecond(date, taiMinusUtc);\n          leapSeconds.splice(~leapSecondIndex, 0, leapSecond);\n        }\n      }\n      lastTaiMinusUtc = taiMinusUtc;\n    }\n  }\n}\n\nfunction fillResultFromIndex(eop, samples, index, columnCount, result) {\n  const start = index * columnCount;\n  result.xPoleWander = samples[start + eop._xPoleWanderRadiansColumn];\n  result.yPoleWander = samples[start + eop._yPoleWanderRadiansColumn];\n  result.xPoleOffset = samples[start + eop._xCelestialPoleOffsetRadiansColumn];\n  result.yPoleOffset = samples[start + eop._yCelestialPoleOffsetRadiansColumn];\n  result.ut1MinusUtc = samples[start + eop._ut1MinusUtcSecondsColumn];\n}\n\nfunction linearInterp(dx, y1, y2) {\n  return y1 + dx * (y2 - y1);\n}\n\nfunction interpolate(eop, dates, samples, date, before, after, result) {\n  const columnCount = eop._columnCount;\n\n  // First check the bounds on the EOP data\n  // If we are after the bounds of the data, return zeros.\n  // The 'before' index should never be less than zero.\n  if (after > dates.length - 1) {\n    result.xPoleWander = 0;\n    result.yPoleWander = 0;\n    result.xPoleOffset = 0;\n    result.yPoleOffset = 0;\n    result.ut1MinusUtc = 0;\n    return result;\n  }\n\n  const beforeDate = dates[before];\n  const afterDate = dates[after];\n  if (beforeDate.equals(afterDate) || date.equals(beforeDate)) {\n    fillResultFromIndex(eop, samples, before, columnCount, result);\n    return result;\n  } else if (date.equals(afterDate)) {\n    fillResultFromIndex(eop, samples, after, columnCount, result);\n    return result;\n  }\n\n  const factor =\n    JulianDate.secondsDifference(date, beforeDate) /\n    JulianDate.secondsDifference(afterDate, beforeDate);\n\n  const startBefore = before * columnCount;\n  const startAfter = after * columnCount;\n\n  // Handle UT1 leap second edge case\n  let beforeUt1MinusUtc = samples[startBefore + eop._ut1MinusUtcSecondsColumn];\n  let afterUt1MinusUtc = samples[startAfter + eop._ut1MinusUtcSecondsColumn];\n\n  const offsetDifference = afterUt1MinusUtc - beforeUt1MinusUtc;\n  if (offsetDifference > 0.5 || offsetDifference < -0.5) {\n    // The absolute difference between the values is more than 0.5, so we may have\n    // crossed a leap second.  Check if this is the case and, if so, adjust the\n    // afterValue to account for the leap second.  This way, our interpolation will\n    // produce reasonable results.\n    const beforeTaiMinusUtc =\n      samples[startBefore + eop._taiMinusUtcSecondsColumn];\n    const afterTaiMinusUtc =\n      samples[startAfter + eop._taiMinusUtcSecondsColumn];\n    if (beforeTaiMinusUtc !== afterTaiMinusUtc) {\n      if (afterDate.equals(date)) {\n        // If we are at the end of the leap second interval, take the second value\n        // Otherwise, the interpolation below will yield the wrong side of the\n        // discontinuity\n        // At the end of the leap second, we need to start accounting for the jump\n        beforeUt1MinusUtc = afterUt1MinusUtc;\n      } else {\n        // Otherwise, remove the leap second so that the interpolation is correct\n        afterUt1MinusUtc -= afterTaiMinusUtc - beforeTaiMinusUtc;\n      }\n    }\n  }\n\n  result.xPoleWander = linearInterp(\n    factor,\n    samples[startBefore + eop._xPoleWanderRadiansColumn],\n    samples[startAfter + eop._xPoleWanderRadiansColumn]\n  );\n  result.yPoleWander = linearInterp(\n    factor,\n    samples[startBefore + eop._yPoleWanderRadiansColumn],\n    samples[startAfter + eop._yPoleWanderRadiansColumn]\n  );\n  result.xPoleOffset = linearInterp(\n    factor,\n    samples[startBefore + eop._xCelestialPoleOffsetRadiansColumn],\n    samples[startAfter + eop._xCelestialPoleOffsetRadiansColumn]\n  );\n  result.yPoleOffset = linearInterp(\n    factor,\n    samples[startBefore + eop._yCelestialPoleOffsetRadiansColumn],\n    samples[startAfter + eop._yCelestialPoleOffsetRadiansColumn]\n  );\n  result.ut1MinusUtc = linearInterp(\n    factor,\n    beforeUt1MinusUtc,\n    afterUt1MinusUtc\n  );\n  return result;\n}\n\nexport default EarthOrientationParameters;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A rotation expressed as a heading, pitch, and roll. Heading is the rotation about the\n * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about\n * the positive x axis.\n * @alias HeadingPitchRoll\n * @constructor\n *\n * @param {number} [heading=0.0] The heading component in radians.\n * @param {number} [pitch=0.0] The pitch component in radians.\n * @param {number} [roll=0.0] The roll component in radians.\n */\nfunction HeadingPitchRoll(heading, pitch, roll) {\n  /**\n   * Gets or sets the heading.\n   * @type {number}\n   * @default 0.0\n   */\n  this.heading = defaultValue(heading, 0.0);\n  /**\n   * Gets or sets the pitch.\n   * @type {number}\n   * @default 0.0\n   */\n  this.pitch = defaultValue(pitch, 0.0);\n  /**\n   * Gets or sets the roll.\n   * @type {number}\n   * @default 0.0\n   */\n  this.roll = defaultValue(roll, 0.0);\n}\n\n/**\n * Computes the heading, pitch and roll from a quaternion (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )\n *\n * @param {Quaternion} quaternion The quaternion from which to retrieve heading, pitch, and roll, all expressed in radians.\n * @param {HeadingPitchRoll} [result] The object in which to store the result. If not provided, a new instance is created and returned.\n * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided.\n */\nHeadingPitchRoll.fromQuaternion = function (quaternion, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(quaternion)) {\n    throw new DeveloperError(\"quaternion is required\");\n  }\n  //>>includeEnd('debug');\n  if (!defined(result)) {\n    result = new HeadingPitchRoll();\n  }\n  const test = 2 * (quaternion.w * quaternion.y - quaternion.z * quaternion.x);\n  const denominatorRoll =\n    1 - 2 * (quaternion.x * quaternion.x + quaternion.y * quaternion.y);\n  const numeratorRoll =\n    2 * (quaternion.w * quaternion.x + quaternion.y * quaternion.z);\n  const denominatorHeading =\n    1 - 2 * (quaternion.y * quaternion.y + quaternion.z * quaternion.z);\n  const numeratorHeading =\n    2 * (quaternion.w * quaternion.z + quaternion.x * quaternion.y);\n  result.heading = -Math.atan2(numeratorHeading, denominatorHeading);\n  result.roll = Math.atan2(numeratorRoll, denominatorRoll);\n  result.pitch = -CesiumMath.asinClamped(test);\n  return result;\n};\n\n/**\n * Returns a new HeadingPitchRoll instance from angles given in degrees.\n *\n * @param {number} heading the heading in degrees\n * @param {number} pitch the pitch in degrees\n * @param {number} roll the heading in degrees\n * @param {HeadingPitchRoll} [result] The object in which to store the result. If not provided, a new instance is created and returned.\n * @returns {HeadingPitchRoll} A new HeadingPitchRoll instance\n */\nHeadingPitchRoll.fromDegrees = function (heading, pitch, roll, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(heading)) {\n    throw new DeveloperError(\"heading is required\");\n  }\n  if (!defined(pitch)) {\n    throw new DeveloperError(\"pitch is required\");\n  }\n  if (!defined(roll)) {\n    throw new DeveloperError(\"roll is required\");\n  }\n  //>>includeEnd('debug');\n  if (!defined(result)) {\n    result = new HeadingPitchRoll();\n  }\n  result.heading = heading * CesiumMath.RADIANS_PER_DEGREE;\n  result.pitch = pitch * CesiumMath.RADIANS_PER_DEGREE;\n  result.roll = roll * CesiumMath.RADIANS_PER_DEGREE;\n  return result;\n};\n\n/**\n * Duplicates a HeadingPitchRoll instance.\n *\n * @param {HeadingPitchRoll} headingPitchRoll The HeadingPitchRoll to duplicate.\n * @param {HeadingPitchRoll} [result] The object onto which to store the result.\n * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided. (Returns undefined if headingPitchRoll is undefined)\n */\nHeadingPitchRoll.clone = function (headingPitchRoll, result) {\n  if (!defined(headingPitchRoll)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    return new HeadingPitchRoll(\n      headingPitchRoll.heading,\n      headingPitchRoll.pitch,\n      headingPitchRoll.roll\n    );\n  }\n  result.heading = headingPitchRoll.heading;\n  result.pitch = headingPitchRoll.pitch;\n  result.roll = headingPitchRoll.roll;\n  return result;\n};\n\n/**\n * Compares the provided HeadingPitchRolls componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll.\n * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nHeadingPitchRoll.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left.heading === right.heading &&\n      left.pitch === right.pitch &&\n      left.roll === right.roll)\n  );\n};\n\n/**\n * Compares the provided HeadingPitchRolls componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll.\n * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nHeadingPitchRoll.equalsEpsilon = function (\n  left,\n  right,\n  relativeEpsilon,\n  absoluteEpsilon\n) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      CesiumMath.equalsEpsilon(\n        left.heading,\n        right.heading,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        left.pitch,\n        right.pitch,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        left.roll,\n        right.roll,\n        relativeEpsilon,\n        absoluteEpsilon\n      ))\n  );\n};\n\n/**\n * Duplicates this HeadingPitchRoll instance.\n *\n * @param {HeadingPitchRoll} [result] The object onto which to store the result.\n * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided.\n */\nHeadingPitchRoll.prototype.clone = function (result) {\n  return HeadingPitchRoll.clone(this, result);\n};\n\n/**\n * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nHeadingPitchRoll.prototype.equals = function (right) {\n  return HeadingPitchRoll.equals(this, right);\n};\n\n/**\n * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll.\n * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nHeadingPitchRoll.prototype.equalsEpsilon = function (\n  right,\n  relativeEpsilon,\n  absoluteEpsilon\n) {\n  return HeadingPitchRoll.equalsEpsilon(\n    this,\n    right,\n    relativeEpsilon,\n    absoluteEpsilon\n  );\n};\n\n/**\n * Creates a string representing this HeadingPitchRoll in the format '(heading, pitch, roll)' in radians.\n *\n * @returns {string} A string representing the provided HeadingPitchRoll in the format '(heading, pitch, roll)'.\n */\nHeadingPitchRoll.prototype.toString = function () {\n  return `(${this.heading}, ${this.pitch}, ${this.roll})`;\n};\nexport default HeadingPitchRoll;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport getAbsoluteUri from \"./getAbsoluteUri.js\";\nimport Resource from \"./Resource.js\";\n\n/*global CESIUM_BASE_URL,define,require*/\n\nconst cesiumScriptRegex = /((?:.*\\/)|^)Cesium\\.js(?:\\?|\\#|$)/;\nfunction getBaseUrlFromCesiumScript() {\n  const scripts = document.getElementsByTagName(\"script\");\n  for (let i = 0, len = scripts.length; i < len; ++i) {\n    const src = scripts[i].getAttribute(\"src\");\n    const result = cesiumScriptRegex.exec(src);\n    if (result !== null) {\n      return result[1];\n    }\n  }\n  return undefined;\n}\n\nlet a;\nfunction tryMakeAbsolute(url) {\n  if (typeof document === \"undefined\") {\n    // Node.js and Web Workers. In both cases, the URL will already be absolute.\n    return url;\n  }\n\n  if (!defined(a)) {\n    a = document.createElement(\"a\");\n  }\n  a.href = url;\n  return a.href;\n}\n\nlet baseResource;\nfunction getCesiumBaseUrl() {\n  if (defined(baseResource)) {\n    return baseResource;\n  }\n\n  let baseUrlString;\n  if (typeof CESIUM_BASE_URL !== \"undefined\") {\n    baseUrlString = CESIUM_BASE_URL;\n  } else if (defined(import.meta?.url)) {\n    // ESM\n    baseUrlString = getAbsoluteUri(\".\", import.meta.url);\n  } else if (\n    typeof define === \"object\" &&\n    defined(define.amd) &&\n    !define.amd.toUrlUndefined &&\n    defined(require.toUrl)\n  ) {\n    // RequireJS\n    baseUrlString = getAbsoluteUri(\n      \"..\",\n      buildModuleUrl(\"Core/buildModuleUrl.js\")\n    );\n  } else {\n    // IIFE\n    baseUrlString = getBaseUrlFromCesiumScript();\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(baseUrlString)) {\n    throw new DeveloperError(\n      \"Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  baseResource = new Resource({\n    url: tryMakeAbsolute(baseUrlString),\n  });\n  baseResource.appendForwardSlash();\n\n  return baseResource;\n}\n\nfunction buildModuleUrlFromRequireToUrl(moduleID) {\n  //moduleID will be non-relative, so require it relative to this module, in Core.\n  return tryMakeAbsolute(require.toUrl(`../${moduleID}`));\n}\n\nfunction buildModuleUrlFromBaseUrl(moduleID) {\n  const resource = getCesiumBaseUrl().getDerivedResource({\n    url: moduleID,\n  });\n  return resource.url;\n}\n\nlet implementation;\n\n/**\n * Given a relative URL under the Cesium base URL, returns an absolute URL.\n * @function\n *\n * @param {string} relativeUrl The relative path.\n * @returns {string} The absolutely URL representation of the provided path.\n *\n * @example\n * const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n *   baseLayer: Cesium.ImageryLayer.fromProviderAsync(\n *     Cesium.TileMapServiceImageryProvider.fromUrl(\n *       Cesium.buildModuleUrl(\"Assets/Textures/NaturalEarthII\"),\n *     )),\n *   baseLayerPicker: false,\n * });\n */\nfunction buildModuleUrl(relativeUrl) {\n  if (!defined(implementation)) {\n    //select implementation\n    if (\n      typeof define === \"object\" &&\n      defined(define.amd) &&\n      !define.amd.toUrlUndefined &&\n      defined(require.toUrl)\n    ) {\n      implementation = buildModuleUrlFromRequireToUrl;\n    } else {\n      implementation = buildModuleUrlFromBaseUrl;\n    }\n  }\n\n  const url = implementation(relativeUrl);\n  return url;\n}\n\n// exposed for testing\nbuildModuleUrl._cesiumScriptRegex = cesiumScriptRegex;\nbuildModuleUrl._buildModuleUrlFromBaseUrl = buildModuleUrlFromBaseUrl;\nbuildModuleUrl._clearBaseResource = function () {\n  baseResource = undefined;\n};\n\n/**\n * Sets the base URL for resolving modules.\n * @param {string} value The new base URL.\n */\nbuildModuleUrl.setBaseUrl = function (value) {\n  baseResource = Resource.DEFAULT.getDerivedResource({\n    url: value,\n  });\n};\n\n/**\n * Gets the base URL for resolving modules.\n *\n * @function\n * @returns {string} The configured base URL\n */\nbuildModuleUrl.getCesiumBaseUrl = getCesiumBaseUrl;\n\nexport default buildModuleUrl;\n", "/**\n * An IAU 2006 XYS value sampled at a particular time.\n *\n * @alias Iau2006XysSample\n * @constructor\n *\n * @param {number} x The X value.\n * @param {number} y The Y value.\n * @param {number} s The S value.\n *\n * @private\n */\nfunction Iau2006XysSample(x, y, s) {\n  /**\n   * The X value.\n   * @type {number}\n   */\n  this.x = x;\n\n  /**\n   * The Y value.\n   * @type {number}\n   */\n  this.y = y;\n\n  /**\n   * The S value.\n   * @type {number}\n   */\n  this.s = s;\n}\nexport default Iau2006XysSample;\n", "import buildModuleUrl from \"./buildModuleUrl.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Iau2006XysSample from \"./Iau2006XysSample.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport Resource from \"./Resource.js\";\nimport TimeStandard from \"./TimeStandard.js\";\n\n/**\n * A set of IAU2006 XYS data that is used to evaluate the transformation between the International\n * Celestial Reference Frame (ICRF) and the International Terrestrial Reference Frame (ITRF).\n *\n * @alias Iau2006XysData\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Resource|string} [options.xysFileUrlTemplate='Assets/IAU2006_XYS/IAU2006_XYS_{0}.json'] A template URL for obtaining the XYS data.  In the template,\n *                 `{0}` will be replaced with the file index.\n * @param {number} [options.interpolationOrder=9] The order of interpolation to perform on the XYS data.\n * @param {number} [options.sampleZeroJulianEphemerisDate=2442396.5] The Julian ephemeris date (JED) of the\n *                 first XYS sample.\n * @param {number} [options.stepSizeDays=1.0] The step size, in days, between successive XYS samples.\n * @param {number} [options.samplesPerXysFile=1000] The number of samples in each XYS file.\n * @param {number} [options.totalSamples=27426] The total number of samples in all XYS files.\n *\n * @private\n */\nfunction Iau2006XysData(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._xysFileUrlTemplate = Resource.createIfNeeded(\n    options.xysFileUrlTemplate\n  );\n  this._interpolationOrder = defaultValue(options.interpolationOrder, 9);\n  this._sampleZeroJulianEphemerisDate = defaultValue(\n    options.sampleZeroJulianEphemerisDate,\n    2442396.5\n  );\n  this._sampleZeroDateTT = new JulianDate(\n    this._sampleZeroJulianEphemerisDate,\n    0.0,\n    TimeStandard.TAI\n  );\n  this._stepSizeDays = defaultValue(options.stepSizeDays, 1.0);\n  this._samplesPerXysFile = defaultValue(options.samplesPerXysFile, 1000);\n  this._totalSamples = defaultValue(options.totalSamples, 27426);\n  this._samples = new Array(this._totalSamples * 3);\n  this._chunkDownloadsInProgress = [];\n\n  const order = this._interpolationOrder;\n\n  // Compute denominators and X values for interpolation.\n  const denom = (this._denominators = new Array(order + 1));\n  const xTable = (this._xTable = new Array(order + 1));\n\n  const stepN = Math.pow(this._stepSizeDays, order);\n\n  for (let i = 0; i <= order; ++i) {\n    denom[i] = stepN;\n    xTable[i] = i * this._stepSizeDays;\n\n    for (let j = 0; j <= order; ++j) {\n      if (j !== i) {\n        denom[i] *= i - j;\n      }\n    }\n\n    denom[i] = 1.0 / denom[i];\n  }\n\n  // Allocate scratch arrays for interpolation.\n  this._work = new Array(order + 1);\n  this._coef = new Array(order + 1);\n}\n\nconst julianDateScratch = new JulianDate(0, 0.0, TimeStandard.TAI);\n\nfunction getDaysSinceEpoch(xys, dayTT, secondTT) {\n  const dateTT = julianDateScratch;\n  dateTT.dayNumber = dayTT;\n  dateTT.secondsOfDay = secondTT;\n  return JulianDate.daysDifference(dateTT, xys._sampleZeroDateTT);\n}\n\n/**\n * Preloads XYS data for a specified date range.\n *\n * @param {number} startDayTT The Julian day number of the beginning of the interval to preload, expressed in\n *                 the Terrestrial Time (TT) time standard.\n * @param {number} startSecondTT The seconds past noon of the beginning of the interval to preload, expressed in\n *                 the Terrestrial Time (TT) time standard.\n * @param {number} stopDayTT The Julian day number of the end of the interval to preload, expressed in\n *                 the Terrestrial Time (TT) time standard.\n * @param {number} stopSecondTT The seconds past noon of the end of the interval to preload, expressed in\n *                 the Terrestrial Time (TT) time standard.\n * @returns {Promise<void>} A promise that, when resolved, indicates that the requested interval has been\n *                    preloaded.\n */\nIau2006XysData.prototype.preload = function (\n  startDayTT,\n  startSecondTT,\n  stopDayTT,\n  stopSecondTT\n) {\n  const startDaysSinceEpoch = getDaysSinceEpoch(\n    this,\n    startDayTT,\n    startSecondTT\n  );\n  const stopDaysSinceEpoch = getDaysSinceEpoch(this, stopDayTT, stopSecondTT);\n\n  let startIndex =\n    (startDaysSinceEpoch / this._stepSizeDays - this._interpolationOrder / 2) |\n    0;\n  if (startIndex < 0) {\n    startIndex = 0;\n  }\n\n  let stopIndex =\n    (stopDaysSinceEpoch / this._stepSizeDays - this._interpolationOrder / 2) |\n    (0 + this._interpolationOrder);\n  if (stopIndex >= this._totalSamples) {\n    stopIndex = this._totalSamples - 1;\n  }\n\n  const startChunk = (startIndex / this._samplesPerXysFile) | 0;\n  const stopChunk = (stopIndex / this._samplesPerXysFile) | 0;\n\n  const promises = [];\n  for (let i = startChunk; i <= stopChunk; ++i) {\n    promises.push(requestXysChunk(this, i));\n  }\n\n  return Promise.all(promises);\n};\n\n/**\n * Computes the XYS values for a given date by interpolating.  If the required data is not yet downloaded,\n * this method will return undefined.\n *\n * @param {number} dayTT The Julian day number for which to compute the XYS value, expressed in\n *                 the Terrestrial Time (TT) time standard.\n * @param {number} secondTT The seconds past noon of the date for which to compute the XYS value, expressed in\n *                 the Terrestrial Time (TT) time standard.\n * @param {Iau2006XysSample} [result] The instance to which to copy the interpolated result.  If this parameter\n *                           is undefined, a new instance is allocated and returned.\n * @returns {Iau2006XysSample} The interpolated XYS values, or undefined if the required data for this\n *                             computation has not yet been downloaded.\n *\n * @see Iau2006XysData#preload\n */\nIau2006XysData.prototype.computeXysRadians = function (\n  dayTT,\n  secondTT,\n  result\n) {\n  const daysSinceEpoch = getDaysSinceEpoch(this, dayTT, secondTT);\n  if (daysSinceEpoch < 0.0) {\n    // Can't evaluate prior to the epoch of the data.\n    return undefined;\n  }\n\n  const centerIndex = (daysSinceEpoch / this._stepSizeDays) | 0;\n  if (centerIndex >= this._totalSamples) {\n    // Can't evaluate after the last sample in the data.\n    return undefined;\n  }\n\n  const degree = this._interpolationOrder;\n\n  let firstIndex = centerIndex - ((degree / 2) | 0);\n  if (firstIndex < 0) {\n    firstIndex = 0;\n  }\n  let lastIndex = firstIndex + degree;\n  if (lastIndex >= this._totalSamples) {\n    lastIndex = this._totalSamples - 1;\n    firstIndex = lastIndex - degree;\n    if (firstIndex < 0) {\n      firstIndex = 0;\n    }\n  }\n\n  // Are all the samples we need present?\n  // We can assume so if the first and last are present\n  let isDataMissing = false;\n  const samples = this._samples;\n  if (!defined(samples[firstIndex * 3])) {\n    requestXysChunk(this, (firstIndex / this._samplesPerXysFile) | 0);\n    isDataMissing = true;\n  }\n\n  if (!defined(samples[lastIndex * 3])) {\n    requestXysChunk(this, (lastIndex / this._samplesPerXysFile) | 0);\n    isDataMissing = true;\n  }\n\n  if (isDataMissing) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    result = new Iau2006XysSample(0.0, 0.0, 0.0);\n  } else {\n    result.x = 0.0;\n    result.y = 0.0;\n    result.s = 0.0;\n  }\n\n  const x = daysSinceEpoch - firstIndex * this._stepSizeDays;\n\n  const work = this._work;\n  const denom = this._denominators;\n  const coef = this._coef;\n  const xTable = this._xTable;\n\n  let i, j;\n  for (i = 0; i <= degree; ++i) {\n    work[i] = x - xTable[i];\n  }\n\n  for (i = 0; i <= degree; ++i) {\n    coef[i] = 1.0;\n\n    for (j = 0; j <= degree; ++j) {\n      if (j !== i) {\n        coef[i] *= work[j];\n      }\n    }\n\n    coef[i] *= denom[i];\n\n    let sampleIndex = (firstIndex + i) * 3;\n    result.x += coef[i] * samples[sampleIndex++];\n    result.y += coef[i] * samples[sampleIndex++];\n    result.s += coef[i] * samples[sampleIndex];\n  }\n\n  return result;\n};\n\nfunction requestXysChunk(xysData, chunkIndex) {\n  if (xysData._chunkDownloadsInProgress[chunkIndex]) {\n    // Chunk has already been requested.\n    return xysData._chunkDownloadsInProgress[chunkIndex];\n  }\n\n  let chunkUrl;\n  const xysFileUrlTemplate = xysData._xysFileUrlTemplate;\n  if (defined(xysFileUrlTemplate)) {\n    chunkUrl = xysFileUrlTemplate.getDerivedResource({\n      templateValues: {\n        0: chunkIndex,\n      },\n    });\n  } else {\n    chunkUrl = new Resource({\n      url: buildModuleUrl(`Assets/IAU2006_XYS/IAU2006_XYS_${chunkIndex}.json`),\n    });\n  }\n\n  const promise = chunkUrl.fetchJson().then(function (chunk) {\n    xysData._chunkDownloadsInProgress[chunkIndex] = false;\n\n    const samples = xysData._samples;\n    const newSamples = chunk.samples;\n    const startIndex = chunkIndex * xysData._samplesPerXysFile * 3;\n\n    for (let i = 0, len = newSamples.length; i < len; ++i) {\n      samples[startIndex + i] = newSamples[i];\n    }\n  });\n  xysData._chunkDownloadsInProgress[chunkIndex] = promise;\n\n  return promise;\n}\nexport default Iau2006XysData;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport EarthOrientationParameters from \"./EarthOrientationParameters.js\";\nimport EarthOrientationParametersSample from \"./EarthOrientationParametersSample.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport HeadingPitchRoll from \"./HeadingPitchRoll.js\";\nimport Iau2006XysData from \"./Iau2006XysData.js\";\nimport Iau2006XysSample from \"./Iau2006XysSample.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport TimeConstants from \"./TimeConstants.js\";\n\n/**\n * Contains functions for transforming positions to various reference frames.\n *\n * @namespace Transforms\n */\nconst Transforms = {};\n\nconst vectorProductLocalFrame = {\n  up: {\n    south: \"east\",\n    north: \"west\",\n    west: \"south\",\n    east: \"north\",\n  },\n  down: {\n    south: \"west\",\n    north: \"east\",\n    west: \"north\",\n    east: \"south\",\n  },\n  south: {\n    up: \"west\",\n    down: \"east\",\n    west: \"down\",\n    east: \"up\",\n  },\n  north: {\n    up: \"east\",\n    down: \"west\",\n    west: \"up\",\n    east: \"down\",\n  },\n  west: {\n    up: \"north\",\n    down: \"south\",\n    north: \"down\",\n    south: \"up\",\n  },\n  east: {\n    up: \"south\",\n    down: \"north\",\n    north: \"up\",\n    south: \"down\",\n  },\n};\n\nconst degeneratePositionLocalFrame = {\n  north: [-1, 0, 0],\n  east: [0, 1, 0],\n  up: [0, 0, 1],\n  south: [1, 0, 0],\n  west: [0, -1, 0],\n  down: [0, 0, -1],\n};\n\nconst localFrameToFixedFrameCache = {};\n\nconst scratchCalculateCartesian = {\n  east: new Cartesian3(),\n  north: new Cartesian3(),\n  up: new Cartesian3(),\n  west: new Cartesian3(),\n  south: new Cartesian3(),\n  down: new Cartesian3(),\n};\nlet scratchFirstCartesian = new Cartesian3();\nlet scratchSecondCartesian = new Cartesian3();\nlet scratchThirdCartesian = new Cartesian3();\n/**\n * Generates a function that computes a 4x4 transformation matrix from a reference frame\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\n * @param  {string} firstAxis  name of the first axis of the local reference frame. Must be\n *  'east', 'north', 'up', 'west', 'south' or 'down'.\n * @param  {string} secondAxis  name of the second axis of the local reference frame. Must be\n *  'east', 'north', 'up', 'west', 'south' or 'down'.\n * @return {Transforms.LocalFrameToFixedFrame} The function that will computes a\n * 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters,\n */\nTransforms.localFrameToFixedFrameGenerator = function (firstAxis, secondAxis) {\n  if (\n    !vectorProductLocalFrame.hasOwnProperty(firstAxis) ||\n    !vectorProductLocalFrame[firstAxis].hasOwnProperty(secondAxis)\n  ) {\n    throw new DeveloperError(\n      \"firstAxis and secondAxis must be east, north, up, west, south or down.\"\n    );\n  }\n  const thirdAxis = vectorProductLocalFrame[firstAxis][secondAxis];\n\n  /**\n   * Computes a 4x4 transformation matrix from a reference frame\n   * centered at the provided origin to the provided ellipsoid's fixed reference frame.\n   * @callback Transforms.LocalFrameToFixedFrame\n   * @param {Cartesian3} origin The center point of the local reference frame.\n   * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n   * @param {Matrix4} [result] The object onto which to store the result.\n   * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\n   */\n  let resultat;\n  const hashAxis = firstAxis + secondAxis;\n  if (defined(localFrameToFixedFrameCache[hashAxis])) {\n    resultat = localFrameToFixedFrameCache[hashAxis];\n  } else {\n    resultat = function (origin, ellipsoid, result) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(origin)) {\n        throw new DeveloperError(\"origin is required.\");\n      }\n      //>>includeEnd('debug');\n      if (!defined(result)) {\n        result = new Matrix4();\n      }\n      if (\n        Cartesian3.equalsEpsilon(origin, Cartesian3.ZERO, CesiumMath.EPSILON14)\n      ) {\n        // If x, y, and z are zero, use the degenerate local frame, which is a special case\n        Cartesian3.unpack(\n          degeneratePositionLocalFrame[firstAxis],\n          0,\n          scratchFirstCartesian\n        );\n        Cartesian3.unpack(\n          degeneratePositionLocalFrame[secondAxis],\n          0,\n          scratchSecondCartesian\n        );\n        Cartesian3.unpack(\n          degeneratePositionLocalFrame[thirdAxis],\n          0,\n          scratchThirdCartesian\n        );\n      } else if (\n        CesiumMath.equalsEpsilon(origin.x, 0.0, CesiumMath.EPSILON14) &&\n        CesiumMath.equalsEpsilon(origin.y, 0.0, CesiumMath.EPSILON14)\n      ) {\n        // If x and y are zero, assume origin is at a pole, which is a special case.\n        const sign = CesiumMath.sign(origin.z);\n\n        Cartesian3.unpack(\n          degeneratePositionLocalFrame[firstAxis],\n          0,\n          scratchFirstCartesian\n        );\n        if (firstAxis !== \"east\" && firstAxis !== \"west\") {\n          Cartesian3.multiplyByScalar(\n            scratchFirstCartesian,\n            sign,\n            scratchFirstCartesian\n          );\n        }\n\n        Cartesian3.unpack(\n          degeneratePositionLocalFrame[secondAxis],\n          0,\n          scratchSecondCartesian\n        );\n        if (secondAxis !== \"east\" && secondAxis !== \"west\") {\n          Cartesian3.multiplyByScalar(\n            scratchSecondCartesian,\n            sign,\n            scratchSecondCartesian\n          );\n        }\n\n        Cartesian3.unpack(\n          degeneratePositionLocalFrame[thirdAxis],\n          0,\n          scratchThirdCartesian\n        );\n        if (thirdAxis !== \"east\" && thirdAxis !== \"west\") {\n          Cartesian3.multiplyByScalar(\n            scratchThirdCartesian,\n            sign,\n            scratchThirdCartesian\n          );\n        }\n      } else {\n        ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n        ellipsoid.geodeticSurfaceNormal(origin, scratchCalculateCartesian.up);\n\n        const up = scratchCalculateCartesian.up;\n        const east = scratchCalculateCartesian.east;\n        east.x = -origin.y;\n        east.y = origin.x;\n        east.z = 0.0;\n        Cartesian3.normalize(east, scratchCalculateCartesian.east);\n        Cartesian3.cross(up, east, scratchCalculateCartesian.north);\n\n        Cartesian3.multiplyByScalar(\n          scratchCalculateCartesian.up,\n          -1,\n          scratchCalculateCartesian.down\n        );\n        Cartesian3.multiplyByScalar(\n          scratchCalculateCartesian.east,\n          -1,\n          scratchCalculateCartesian.west\n        );\n        Cartesian3.multiplyByScalar(\n          scratchCalculateCartesian.north,\n          -1,\n          scratchCalculateCartesian.south\n        );\n\n        scratchFirstCartesian = scratchCalculateCartesian[firstAxis];\n        scratchSecondCartesian = scratchCalculateCartesian[secondAxis];\n        scratchThirdCartesian = scratchCalculateCartesian[thirdAxis];\n      }\n      result[0] = scratchFirstCartesian.x;\n      result[1] = scratchFirstCartesian.y;\n      result[2] = scratchFirstCartesian.z;\n      result[3] = 0.0;\n      result[4] = scratchSecondCartesian.x;\n      result[5] = scratchSecondCartesian.y;\n      result[6] = scratchSecondCartesian.z;\n      result[7] = 0.0;\n      result[8] = scratchThirdCartesian.x;\n      result[9] = scratchThirdCartesian.y;\n      result[10] = scratchThirdCartesian.z;\n      result[11] = 0.0;\n      result[12] = origin.x;\n      result[13] = origin.y;\n      result[14] = origin.z;\n      result[15] = 1.0;\n      return result;\n    };\n    localFrameToFixedFrameCache[hashAxis] = resultat;\n  }\n  return resultat;\n};\n\n/**\n * Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\n * The local axes are defined as:\n * <ul>\n * <li>The <code>x</code> axis points in the local east direction.</li>\n * <li>The <code>y</code> axis points in the local north direction.</li>\n * <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>\n * </ul>\n *\n * @function\n * @param {Cartesian3} origin The center point of the local reference frame.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\n *\n * @example\n * // Get the transform from local east-north-up at cartographic (0.0, 0.0) to Earth's fixed frame.\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);\n */\nTransforms.eastNorthUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator(\n  \"east\",\n  \"north\"\n);\n\n/**\n * Computes a 4x4 transformation matrix from a reference frame with an north-east-down axes\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\n * The local axes are defined as:\n * <ul>\n * <li>The <code>x</code> axis points in the local north direction.</li>\n * <li>The <code>y</code> axis points in the local east direction.</li>\n * <li>The <code>z</code> axis points in the opposite direction of the ellipsoid surface normal which passes through the position.</li>\n * </ul>\n *\n * @function\n * @param {Cartesian3} origin The center point of the local reference frame.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\n *\n * @example\n * // Get the transform from local north-east-down at cartographic (0.0, 0.0) to Earth's fixed frame.\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const transform = Cesium.Transforms.northEastDownToFixedFrame(center);\n */\nTransforms.northEastDownToFixedFrame = Transforms.localFrameToFixedFrameGenerator(\n  \"north\",\n  \"east\"\n);\n\n/**\n * Computes a 4x4 transformation matrix from a reference frame with an north-up-east axes\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\n * The local axes are defined as:\n * <ul>\n * <li>The <code>x</code> axis points in the local north direction.</li>\n * <li>The <code>y</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>\n * <li>The <code>z</code> axis points in the local east direction.</li>\n * </ul>\n *\n * @function\n * @param {Cartesian3} origin The center point of the local reference frame.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\n *\n * @example\n * // Get the transform from local north-up-east at cartographic (0.0, 0.0) to Earth's fixed frame.\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const transform = Cesium.Transforms.northUpEastToFixedFrame(center);\n */\nTransforms.northUpEastToFixedFrame = Transforms.localFrameToFixedFrameGenerator(\n  \"north\",\n  \"up\"\n);\n\n/**\n * Computes a 4x4 transformation matrix from a reference frame with an north-west-up axes\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\n * The local axes are defined as:\n * <ul>\n * <li>The <code>x</code> axis points in the local north direction.</li>\n * <li>The <code>y</code> axis points in the local west direction.</li>\n * <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>\n * </ul>\n *\n * @function\n * @param {Cartesian3} origin The center point of the local reference frame.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\n *\n * @example\n * // Get the transform from local north-West-Up at cartographic (0.0, 0.0) to Earth's fixed frame.\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const transform = Cesium.Transforms.northWestUpToFixedFrame(center);\n */\nTransforms.northWestUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator(\n  \"north\",\n  \"west\"\n);\n\nconst scratchHPRQuaternion = new Quaternion();\nconst scratchScale = new Cartesian3(1.0, 1.0, 1.0);\nconst scratchHPRMatrix4 = new Matrix4();\n\n/**\n * Computes a 4x4 transformation matrix from a reference frame with axes computed from the heading-pitch-roll angles\n * centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local north\n * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles\n * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.\n *\n * @param {Cartesian3} origin The center point of the local reference frame.\n * @param {HeadingPitchRoll} headingPitchRoll The heading, pitch, and roll.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation\n *  matrix from a reference frame to the provided ellipsoid's fixed reference frame\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\n *\n * @example\n * // Get the transform from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const heading = -Cesium.Math.PI_OVER_TWO;\n * const pitch = Cesium.Math.PI_OVER_FOUR;\n * const roll = 0.0;\n * const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);\n * const transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr);\n */\nTransforms.headingPitchRollToFixedFrame = function (\n  origin,\n  headingPitchRoll,\n  ellipsoid,\n  fixedFrameTransform,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"HeadingPitchRoll\", headingPitchRoll);\n  //>>includeEnd('debug');\n\n  fixedFrameTransform = defaultValue(\n    fixedFrameTransform,\n    Transforms.eastNorthUpToFixedFrame\n  );\n  const hprQuaternion = Quaternion.fromHeadingPitchRoll(\n    headingPitchRoll,\n    scratchHPRQuaternion\n  );\n  const hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(\n    Cartesian3.ZERO,\n    hprQuaternion,\n    scratchScale,\n    scratchHPRMatrix4\n  );\n  result = fixedFrameTransform(origin, ellipsoid, result);\n  return Matrix4.multiply(result, hprMatrix, result);\n};\n\nconst scratchENUMatrix4 = new Matrix4();\nconst scratchHPRMatrix3 = new Matrix3();\n\n/**\n * Computes a quaternion from a reference frame with axes computed from the heading-pitch-roll angles\n * centered at the provided origin. Heading is the rotation from the local north\n * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles\n * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.\n *\n * @param {Cartesian3} origin The center point of the local reference frame.\n * @param {HeadingPitchRoll} headingPitchRoll The heading, pitch, and roll.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation\n *  matrix from a reference frame to the provided ellipsoid's fixed reference frame\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided.\n *\n * @example\n * // Get the quaternion from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const heading = -Cesium.Math.PI_OVER_TWO;\n * const pitch = Cesium.Math.PI_OVER_FOUR;\n * const roll = 0.0;\n * const hpr = new HeadingPitchRoll(heading, pitch, roll);\n * const quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr);\n */\nTransforms.headingPitchRollQuaternion = function (\n  origin,\n  headingPitchRoll,\n  ellipsoid,\n  fixedFrameTransform,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"HeadingPitchRoll\", headingPitchRoll);\n  //>>includeEnd('debug');\n\n  const transform = Transforms.headingPitchRollToFixedFrame(\n    origin,\n    headingPitchRoll,\n    ellipsoid,\n    fixedFrameTransform,\n    scratchENUMatrix4\n  );\n  const rotation = Matrix4.getMatrix3(transform, scratchHPRMatrix3);\n  return Quaternion.fromRotationMatrix(rotation, result);\n};\n\nconst noScale = new Cartesian3(1.0, 1.0, 1.0);\nconst hprCenterScratch = new Cartesian3();\nconst ffScratch = new Matrix4();\nconst hprTransformScratch = new Matrix4();\nconst hprRotationScratch = new Matrix3();\nconst hprQuaternionScratch = new Quaternion();\n/**\n * Computes heading-pitch-roll angles from a transform in a particular reference frame. Heading is the rotation from the local north\n * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles\n * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.\n *\n * @param {Matrix4} transform The transform\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation\n *  matrix from a reference frame to the provided ellipsoid's fixed reference frame\n * @param {HeadingPitchRoll} [result] The object onto which to store the result.\n * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if none was provided.\n */\nTransforms.fixedFrameToHeadingPitchRoll = function (\n  transform,\n  ellipsoid,\n  fixedFrameTransform,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"transform\", transform);\n  //>>includeEnd('debug');\n\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n  fixedFrameTransform = defaultValue(\n    fixedFrameTransform,\n    Transforms.eastNorthUpToFixedFrame\n  );\n  if (!defined(result)) {\n    result = new HeadingPitchRoll();\n  }\n\n  const center = Matrix4.getTranslation(transform, hprCenterScratch);\n  if (Cartesian3.equals(center, Cartesian3.ZERO)) {\n    result.heading = 0;\n    result.pitch = 0;\n    result.roll = 0;\n    return result;\n  }\n  let toFixedFrame = Matrix4.inverseTransformation(\n    fixedFrameTransform(center, ellipsoid, ffScratch),\n    ffScratch\n  );\n  let transformCopy = Matrix4.setScale(transform, noScale, hprTransformScratch);\n  transformCopy = Matrix4.setTranslation(\n    transformCopy,\n    Cartesian3.ZERO,\n    transformCopy\n  );\n\n  toFixedFrame = Matrix4.multiply(toFixedFrame, transformCopy, toFixedFrame);\n  let quaternionRotation = Quaternion.fromRotationMatrix(\n    Matrix4.getMatrix3(toFixedFrame, hprRotationScratch),\n    hprQuaternionScratch\n  );\n  quaternionRotation = Quaternion.normalize(\n    quaternionRotation,\n    quaternionRotation\n  );\n\n  return HeadingPitchRoll.fromQuaternion(quaternionRotation, result);\n};\n\nconst gmstConstant0 = 6 * 3600 + 41 * 60 + 50.54841;\nconst gmstConstant1 = 8640184.812866;\nconst gmstConstant2 = 0.093104;\nconst gmstConstant3 = -6.2e-6;\nconst rateCoef = 1.1772758384668e-19;\nconst wgs84WRPrecessing = 7.2921158553e-5;\nconst twoPiOverSecondsInDay = CesiumMath.TWO_PI / 86400.0;\nlet dateInUtc = new JulianDate();\n\n/**\n * Computes a rotation matrix to transform a point or vector from True Equator Mean Equinox (TEME) axes to the\n * pseudo-fixed axes at a given time.  This method treats the UT1 time standard as equivalent to UTC.\n *\n * @param {JulianDate} date The time at which to compute the rotation matrix.\n * @param {Matrix3} [result] The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if none was provided.\n *\n * @example\n * //Set the view to the inertial frame.\n * scene.postUpdate.addEventListener(function(scene, time) {\n *    const now = Cesium.JulianDate.now();\n *    const offset = Cesium.Matrix4.multiplyByPoint(camera.transform, camera.position, new Cesium.Cartesian3());\n *    const transform = Cesium.Matrix4.fromRotationTranslation(Cesium.Transforms.computeTemeToPseudoFixedMatrix(now));\n *    const inverseTransform = Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4());\n *    Cesium.Matrix4.multiplyByPoint(inverseTransform, offset, offset);\n *    camera.lookAtTransform(transform, offset);\n * });\n */\nTransforms.computeTemeToPseudoFixedMatrix = function (date, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(date)) {\n    throw new DeveloperError(\"date is required.\");\n  }\n  //>>includeEnd('debug');\n\n  // GMST is actually computed using UT1.  We're using UTC as an approximation of UT1.\n  // We do not want to use the function like convertTaiToUtc in JulianDate because\n  // we explicitly do not want to fail when inside the leap second.\n\n  dateInUtc = JulianDate.addSeconds(\n    date,\n    -JulianDate.computeTaiMinusUtc(date),\n    dateInUtc\n  );\n  const utcDayNumber = dateInUtc.dayNumber;\n  const utcSecondsIntoDay = dateInUtc.secondsOfDay;\n\n  let t;\n  const diffDays = utcDayNumber - 2451545;\n  if (utcSecondsIntoDay >= 43200.0) {\n    t = (diffDays + 0.5) / TimeConstants.DAYS_PER_JULIAN_CENTURY;\n  } else {\n    t = (diffDays - 0.5) / TimeConstants.DAYS_PER_JULIAN_CENTURY;\n  }\n\n  const gmst0 =\n    gmstConstant0 +\n    t * (gmstConstant1 + t * (gmstConstant2 + t * gmstConstant3));\n  const angle = (gmst0 * twoPiOverSecondsInDay) % CesiumMath.TWO_PI;\n  const ratio = wgs84WRPrecessing + rateCoef * (utcDayNumber - 2451545.5);\n  const secondsSinceMidnight =\n    (utcSecondsIntoDay + TimeConstants.SECONDS_PER_DAY * 0.5) %\n    TimeConstants.SECONDS_PER_DAY;\n  const gha = angle + ratio * secondsSinceMidnight;\n  const cosGha = Math.cos(gha);\n  const sinGha = Math.sin(gha);\n\n  if (!defined(result)) {\n    return new Matrix3(\n      cosGha,\n      sinGha,\n      0.0,\n      -sinGha,\n      cosGha,\n      0.0,\n      0.0,\n      0.0,\n      1.0\n    );\n  }\n  result[0] = cosGha;\n  result[1] = -sinGha;\n  result[2] = 0.0;\n  result[3] = sinGha;\n  result[4] = cosGha;\n  result[5] = 0.0;\n  result[6] = 0.0;\n  result[7] = 0.0;\n  result[8] = 1.0;\n  return result;\n};\n\n/**\n * The source of IAU 2006 XYS data, used for computing the transformation between the\n * Fixed and ICRF axes.\n * @type {Iau2006XysData}\n *\n * @see Transforms.computeIcrfToFixedMatrix\n * @see Transforms.computeFixedToIcrfMatrix\n *\n * @private\n */\nTransforms.iau2006XysData = new Iau2006XysData();\n\n/**\n * The source of Earth Orientation Parameters (EOP) data, used for computing the transformation\n * between the Fixed and ICRF axes.  By default, zero values are used for all EOP values,\n * yielding a reasonable but not completely accurate representation of the ICRF axes.\n * @type {EarthOrientationParameters}\n *\n * @see Transforms.computeIcrfToFixedMatrix\n * @see Transforms.computeFixedToIcrfMatrix\n *\n * @private\n */\nTransforms.earthOrientationParameters = EarthOrientationParameters.NONE;\n\nconst ttMinusTai = 32.184;\nconst j2000ttDays = 2451545.0;\n\n/**\n * Preloads the data necessary to transform between the ICRF and Fixed axes, in either\n * direction, over a given interval.  This function returns a promise that, when resolved,\n * indicates that the preload has completed.\n *\n * @param {TimeInterval} timeInterval The interval to preload.\n * @returns {Promise<void>} A promise that, when resolved, indicates that the preload has completed\n *          and evaluation of the transformation between the fixed and ICRF axes will\n *          no longer return undefined for a time inside the interval.\n *\n *\n * @example\n * const interval = new Cesium.TimeInterval(...);\n * await Cesium.Transforms.preloadIcrfFixed(interval));\n * // the data is now loaded\n *\n * @see Transforms.computeIcrfToFixedMatrix\n * @see Transforms.computeFixedToIcrfMatrix\n */\nTransforms.preloadIcrfFixed = function (timeInterval) {\n  const startDayTT = timeInterval.start.dayNumber;\n  const startSecondTT = timeInterval.start.secondsOfDay + ttMinusTai;\n  const stopDayTT = timeInterval.stop.dayNumber;\n  const stopSecondTT = timeInterval.stop.secondsOfDay + ttMinusTai;\n\n  return Transforms.iau2006XysData.preload(\n    startDayTT,\n    startSecondTT,\n    stopDayTT,\n    stopSecondTT\n  );\n};\n\n/**\n * Computes a rotation matrix to transform a point or vector from the International Celestial\n * Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF)\n * at a given time.  This function may return undefined if the data necessary to\n * do the transformation is not yet loaded.\n *\n * @param {JulianDate} date The time at which to compute the rotation matrix.\n * @param {Matrix3} [result] The object onto which to store the result.  If this parameter is\n *                  not specified, a new instance is created and returned.\n * @returns {Matrix3} The rotation matrix, or undefined if the data necessary to do the\n *                   transformation is not yet loaded.\n *\n *\n * @example\n * scene.postUpdate.addEventListener(function(scene, time) {\n *   // View in ICRF.\n *   const icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time);\n *   if (Cesium.defined(icrfToFixed)) {\n *     const offset = Cesium.Cartesian3.clone(camera.position);\n *     const transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed);\n *     camera.lookAtTransform(transform, offset);\n *   }\n * });\n *\n * @see Transforms.preloadIcrfFixed\n */\nTransforms.computeIcrfToFixedMatrix = function (date, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(date)) {\n    throw new DeveloperError(\"date is required.\");\n  }\n  //>>includeEnd('debug');\n  if (!defined(result)) {\n    result = new Matrix3();\n  }\n\n  const fixedToIcrfMtx = Transforms.computeFixedToIcrfMatrix(date, result);\n  if (!defined(fixedToIcrfMtx)) {\n    return undefined;\n  }\n\n  return Matrix3.transpose(fixedToIcrfMtx, result);\n};\n\nconst xysScratch = new Iau2006XysSample(0.0, 0.0, 0.0);\nconst eopScratch = new EarthOrientationParametersSample(\n  0.0,\n  0.0,\n  0.0,\n  0.0,\n  0.0,\n  0.0\n);\nconst rotation1Scratch = new Matrix3();\nconst rotation2Scratch = new Matrix3();\n\n/**\n * Computes a rotation matrix to transform a point or vector from the Earth-Fixed frame axes (ITRF)\n * to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes\n * at a given time.  This function may return undefined if the data necessary to\n * do the transformation is not yet loaded.\n *\n * @param {JulianDate} date The time at which to compute the rotation matrix.\n * @param {Matrix3} [result] The object onto which to store the result.  If this parameter is\n *                  not specified, a new instance is created and returned.\n * @returns {Matrix3} The rotation matrix, or undefined if the data necessary to do the\n *                   transformation is not yet loaded.\n *\n *\n * @example\n * // Transform a point from the Fixed axes to the ICRF axes.\n * const now = Cesium.JulianDate.now();\n * const pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const fixedToIcrf = Cesium.Transforms.computeFixedToIcrfMatrix(now);\n * let pointInInertial = new Cesium.Cartesian3();\n * if (Cesium.defined(fixedToIcrf)) {\n *     pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial);\n * }\n *\n * @see Transforms.preloadIcrfFixed\n */\nTransforms.computeFixedToIcrfMatrix = function (date, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(date)) {\n    throw new DeveloperError(\"date is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Matrix3();\n  }\n\n  // Compute pole wander\n  const eop = Transforms.earthOrientationParameters.compute(date, eopScratch);\n  if (!defined(eop)) {\n    return undefined;\n  }\n\n  // There is no external conversion to Terrestrial Time (TT).\n  // So use International Atomic Time (TAI) and convert using offsets.\n  // Here we are assuming that dayTT and secondTT are positive\n  const dayTT = date.dayNumber;\n  // It's possible here that secondTT could roll over 86400\n  // This does not seem to affect the precision (unit tests check for this)\n  const secondTT = date.secondsOfDay + ttMinusTai;\n\n  const xys = Transforms.iau2006XysData.computeXysRadians(\n    dayTT,\n    secondTT,\n    xysScratch\n  );\n  if (!defined(xys)) {\n    return undefined;\n  }\n\n  const x = xys.x + eop.xPoleOffset;\n  const y = xys.y + eop.yPoleOffset;\n\n  // Compute XYS rotation\n  const a = 1.0 / (1.0 + Math.sqrt(1.0 - x * x - y * y));\n\n  const rotation1 = rotation1Scratch;\n  rotation1[0] = 1.0 - a * x * x;\n  rotation1[3] = -a * x * y;\n  rotation1[6] = x;\n  rotation1[1] = -a * x * y;\n  rotation1[4] = 1 - a * y * y;\n  rotation1[7] = y;\n  rotation1[2] = -x;\n  rotation1[5] = -y;\n  rotation1[8] = 1 - a * (x * x + y * y);\n\n  const rotation2 = Matrix3.fromRotationZ(-xys.s, rotation2Scratch);\n  const matrixQ = Matrix3.multiply(rotation1, rotation2, rotation1Scratch);\n\n  // Similar to TT conversions above\n  // It's possible here that secondTT could roll over 86400\n  // This does not seem to affect the precision (unit tests check for this)\n  const dateUt1day = date.dayNumber;\n  const dateUt1sec =\n    date.secondsOfDay - JulianDate.computeTaiMinusUtc(date) + eop.ut1MinusUtc;\n\n  // Compute Earth rotation angle\n  // The IERS standard for era is\n  //    era = 0.7790572732640 + 1.00273781191135448 * Tu\n  // where\n  //    Tu = JulianDateInUt1 - 2451545.0\n  // However, you get much more precision if you make the following simplification\n  //    era = a + (1 + b) * (JulianDayNumber + FractionOfDay - 2451545)\n  //    era = a + (JulianDayNumber - 2451545) + FractionOfDay + b (JulianDayNumber - 2451545 + FractionOfDay)\n  //    era = a + FractionOfDay + b (JulianDayNumber - 2451545 + FractionOfDay)\n  // since (JulianDayNumber - 2451545) represents an integer number of revolutions which will be discarded anyway.\n  const daysSinceJ2000 = dateUt1day - 2451545;\n  const fractionOfDay = dateUt1sec / TimeConstants.SECONDS_PER_DAY;\n  let era =\n    0.779057273264 +\n    fractionOfDay +\n    0.00273781191135448 * (daysSinceJ2000 + fractionOfDay);\n  era = (era % 1.0) * CesiumMath.TWO_PI;\n\n  const earthRotation = Matrix3.fromRotationZ(era, rotation2Scratch);\n\n  // pseudoFixed to ICRF\n  const pfToIcrf = Matrix3.multiply(matrixQ, earthRotation, rotation1Scratch);\n\n  // Compute pole wander matrix\n  const cosxp = Math.cos(eop.xPoleWander);\n  const cosyp = Math.cos(eop.yPoleWander);\n  const sinxp = Math.sin(eop.xPoleWander);\n  const sinyp = Math.sin(eop.yPoleWander);\n\n  let ttt = dayTT - j2000ttDays + secondTT / TimeConstants.SECONDS_PER_DAY;\n  ttt /= 36525.0;\n\n  // approximate sp value in rad\n  const sp = (-47.0e-6 * ttt * CesiumMath.RADIANS_PER_DEGREE) / 3600.0;\n  const cossp = Math.cos(sp);\n  const sinsp = Math.sin(sp);\n\n  const fToPfMtx = rotation2Scratch;\n  fToPfMtx[0] = cosxp * cossp;\n  fToPfMtx[1] = cosxp * sinsp;\n  fToPfMtx[2] = sinxp;\n  fToPfMtx[3] = -cosyp * sinsp + sinyp * sinxp * cossp;\n  fToPfMtx[4] = cosyp * cossp + sinyp * sinxp * sinsp;\n  fToPfMtx[5] = -sinyp * cosxp;\n  fToPfMtx[6] = -sinyp * sinsp - cosyp * sinxp * cossp;\n  fToPfMtx[7] = sinyp * cossp - cosyp * sinxp * sinsp;\n  fToPfMtx[8] = cosyp * cosxp;\n\n  return Matrix3.multiply(pfToIcrf, fToPfMtx, result);\n};\n\nconst pointToWindowCoordinatesTemp = new Cartesian4();\n\n/**\n * Transform a point from model coordinates to window coordinates.\n *\n * @param {Matrix4} modelViewProjectionMatrix The 4x4 model-view-projection matrix.\n * @param {Matrix4} viewportTransformation The 4x4 viewport transformation.\n * @param {Cartesian3} point The point to transform.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided.\n */\nTransforms.pointToWindowCoordinates = function (\n  modelViewProjectionMatrix,\n  viewportTransformation,\n  point,\n  result\n) {\n  result = Transforms.pointToGLWindowCoordinates(\n    modelViewProjectionMatrix,\n    viewportTransformation,\n    point,\n    result\n  );\n  result.y = 2.0 * viewportTransformation[5] - result.y;\n  return result;\n};\n\n/**\n * @private\n */\nTransforms.pointToGLWindowCoordinates = function (\n  modelViewProjectionMatrix,\n  viewportTransformation,\n  point,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(modelViewProjectionMatrix)) {\n    throw new DeveloperError(\"modelViewProjectionMatrix is required.\");\n  }\n\n  if (!defined(viewportTransformation)) {\n    throw new DeveloperError(\"viewportTransformation is required.\");\n  }\n\n  if (!defined(point)) {\n    throw new DeveloperError(\"point is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian2();\n  }\n\n  const tmp = pointToWindowCoordinatesTemp;\n\n  Matrix4.multiplyByVector(\n    modelViewProjectionMatrix,\n    Cartesian4.fromElements(point.x, point.y, point.z, 1, tmp),\n    tmp\n  );\n  Cartesian4.multiplyByScalar(tmp, 1.0 / tmp.w, tmp);\n  Matrix4.multiplyByVector(viewportTransformation, tmp, tmp);\n  return Cartesian2.fromCartesian4(tmp, result);\n};\n\nconst normalScratch = new Cartesian3();\nconst rightScratch = new Cartesian3();\nconst upScratch = new Cartesian3();\n\n/**\n * Transform a position and velocity to a rotation matrix.\n *\n * @param {Cartesian3} position The position to transform.\n * @param {Cartesian3} velocity The velocity vector to transform.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Matrix3} [result] The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if none was provided.\n */\nTransforms.rotationMatrixFromPositionVelocity = function (\n  position,\n  velocity,\n  ellipsoid,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(position)) {\n    throw new DeveloperError(\"position is required.\");\n  }\n\n  if (!defined(velocity)) {\n    throw new DeveloperError(\"velocity is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const normal = defaultValue(ellipsoid, Ellipsoid.WGS84).geodeticSurfaceNormal(\n    position,\n    normalScratch\n  );\n  let right = Cartesian3.cross(velocity, normal, rightScratch);\n\n  if (Cartesian3.equalsEpsilon(right, Cartesian3.ZERO, CesiumMath.EPSILON6)) {\n    right = Cartesian3.clone(Cartesian3.UNIT_X, right);\n  }\n\n  const up = Cartesian3.cross(right, velocity, upScratch);\n  Cartesian3.normalize(up, up);\n  Cartesian3.cross(velocity, up, right);\n  Cartesian3.negate(right, right);\n  Cartesian3.normalize(right, right);\n\n  if (!defined(result)) {\n    result = new Matrix3();\n  }\n\n  result[0] = velocity.x;\n  result[1] = velocity.y;\n  result[2] = velocity.z;\n  result[3] = right.x;\n  result[4] = right.y;\n  result[5] = right.z;\n  result[6] = up.x;\n  result[7] = up.y;\n  result[8] = up.z;\n\n  return result;\n};\n\nconst swizzleMatrix = new Matrix4(\n  0.0,\n  0.0,\n  1.0,\n  0.0,\n  1.0,\n  0.0,\n  0.0,\n  0.0,\n  0.0,\n  1.0,\n  0.0,\n  0.0,\n  0.0,\n  0.0,\n  0.0,\n  1.0\n);\n\nconst scratchCartographic = new Cartographic();\nconst scratchCartesian3Projection = new Cartesian3();\nconst scratchCenter = new Cartesian3();\nconst scratchRotation = new Matrix3();\nconst scratchFromENU = new Matrix4();\nconst scratchToENU = new Matrix4();\n\n/**\n * @private\n */\nTransforms.basisTo2D = function (projection, matrix, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(projection)) {\n    throw new DeveloperError(\"projection is required.\");\n  }\n  if (!defined(matrix)) {\n    throw new DeveloperError(\"matrix is required.\");\n  }\n  if (!defined(result)) {\n    throw new DeveloperError(\"result is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const rtcCenter = Matrix4.getTranslation(matrix, scratchCenter);\n  const ellipsoid = projection.ellipsoid;\n\n  // Get the 2D Center\n  const cartographic = ellipsoid.cartesianToCartographic(\n    rtcCenter,\n    scratchCartographic\n  );\n  const projectedPosition = projection.project(\n    cartographic,\n    scratchCartesian3Projection\n  );\n  Cartesian3.fromElements(\n    projectedPosition.z,\n    projectedPosition.x,\n    projectedPosition.y,\n    projectedPosition\n  );\n\n  // Assuming the instance are positioned in WGS84, invert the WGS84 transform to get the local transform and then convert to 2D\n  const fromENU = Transforms.eastNorthUpToFixedFrame(\n    rtcCenter,\n    ellipsoid,\n    scratchFromENU\n  );\n  const toENU = Matrix4.inverseTransformation(fromENU, scratchToENU);\n  const rotation = Matrix4.getMatrix3(matrix, scratchRotation);\n  const local = Matrix4.multiplyByMatrix3(toENU, rotation, result);\n  Matrix4.multiply(swizzleMatrix, local, result); // Swap x, y, z for 2D\n  Matrix4.setTranslation(result, projectedPosition, result); // Use the projected center\n\n  return result;\n};\n\n/**\n * @private\n */\nTransforms.wgs84To2DModelMatrix = function (projection, center, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(projection)) {\n    throw new DeveloperError(\"projection is required.\");\n  }\n  if (!defined(center)) {\n    throw new DeveloperError(\"center is required.\");\n  }\n  if (!defined(result)) {\n    throw new DeveloperError(\"result is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const ellipsoid = projection.ellipsoid;\n\n  const fromENU = Transforms.eastNorthUpToFixedFrame(\n    center,\n    ellipsoid,\n    scratchFromENU\n  );\n  const toENU = Matrix4.inverseTransformation(fromENU, scratchToENU);\n\n  const cartographic = ellipsoid.cartesianToCartographic(\n    center,\n    scratchCartographic\n  );\n  const projectedPosition = projection.project(\n    cartographic,\n    scratchCartesian3Projection\n  );\n  Cartesian3.fromElements(\n    projectedPosition.z,\n    projectedPosition.x,\n    projectedPosition.y,\n    projectedPosition\n  );\n\n  const translation = Matrix4.fromTranslation(\n    projectedPosition,\n    scratchFromENU\n  );\n  Matrix4.multiply(swizzleMatrix, toENU, result);\n  Matrix4.multiply(translation, result, result);\n\n  return result;\n};\nexport default Transforms;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport GeometryType from \"./GeometryType.js\";\nimport Matrix2 from \"./Matrix2.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Transforms from \"./Transforms.js\";\n\n/**\n * A geometry representation with attributes forming vertices and optional index data\n * defining primitives.  Geometries and an {@link Appearance}, which describes the shading,\n * can be assigned to a {@link Primitive} for visualization.  A <code>Primitive</code> can\n * be created from many heterogeneous - in many cases - geometries for performance.\n * <p>\n * Geometries can be transformed and optimized using functions in {@link GeometryPipeline}.\n * </p>\n *\n * @alias Geometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {GeometryAttributes} options.attributes Attributes, which make up the geometry's vertices.\n * @param {PrimitiveType} [options.primitiveType=PrimitiveType.TRIANGLES] The type of primitives in the geometry.\n * @param {Uint16Array|Uint32Array} [options.indices] Optional index data that determines the primitives in the geometry.\n * @param {BoundingSphere} [options.boundingSphere] An optional bounding sphere that fully enclosed the geometry.\n *\n * @see PolygonGeometry\n * @see RectangleGeometry\n * @see EllipseGeometry\n * @see CircleGeometry\n * @see WallGeometry\n * @see SimplePolylineGeometry\n * @see BoxGeometry\n * @see EllipsoidGeometry\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Geometry%20and%20Appearances.html|Geometry and Appearances Demo}\n *\n * @example\n * // Create geometry with a position attribute and indexed lines.\n * const positions = new Float64Array([\n *   0.0, 0.0, 0.0,\n *   7500000.0, 0.0, 0.0,\n *   0.0, 7500000.0, 0.0\n * ]);\n *\n * const geometry = new Cesium.Geometry({\n *   attributes : {\n *     position : new Cesium.GeometryAttribute({\n *       componentDatatype : Cesium.ComponentDatatype.DOUBLE,\n *       componentsPerAttribute : 3,\n *       values : positions\n *     })\n *   },\n *   indices : new Uint16Array([0, 1, 1, 2, 2, 0]),\n *   primitiveType : Cesium.PrimitiveType.LINES,\n *   boundingSphere : Cesium.BoundingSphere.fromVertices(positions)\n * });\n */\nfunction Geometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.attributes\", options.attributes);\n  //>>includeEnd('debug');\n\n  /**\n   * Attributes, which make up the geometry's vertices.  Each property in this object corresponds to a\n   * {@link GeometryAttribute} containing the attribute's data.\n   * <p>\n   * Attributes are always stored non-interleaved in a Geometry.\n   * </p>\n   * <p>\n   * There are reserved attribute names with well-known semantics.  The following attributes\n   * are created by a Geometry (depending on the provided {@link VertexFormat}.\n   * <ul>\n   *    <li><code>position</code> - 3D vertex position.  64-bit floating-point (for precision).  3 components per attribute.  See {@link VertexFormat#position}.</li>\n   *    <li><code>normal</code> - Normal (normalized), commonly used for lighting.  32-bit floating-point.  3 components per attribute.  See {@link VertexFormat#normal}.</li>\n   *    <li><code>st</code> - 2D texture coordinate.  32-bit floating-point.  2 components per attribute.  See {@link VertexFormat#st}.</li>\n   *    <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping.  32-bit floating-point.  3 components per attribute.  See {@link VertexFormat#bitangent}.</li>\n   *    <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping.  32-bit floating-point.  3 components per attribute.  See {@link VertexFormat#tangent}.</li>\n   * </ul>\n   * </p>\n   * <p>\n   * The following attribute names are generally not created by a Geometry, but are added\n   * to a Geometry by a {@link Primitive} or {@link GeometryPipeline} functions to prepare\n   * the geometry for rendering.\n   * <ul>\n   *    <li><code>position3DHigh</code> - High 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}.  32-bit floating-point.  4 components per attribute.</li>\n   *    <li><code>position3DLow</code> - Low 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}.  32-bit floating-point.  4 components per attribute.</li>\n   *    <li><code>position3DHigh</code> - High 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}.  32-bit floating-point.  4 components per attribute.</li>\n   *    <li><code>position2DLow</code> - Low 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}.  32-bit floating-point.  4 components per attribute.</li>\n   *    <li><code>color</code> - RGBA color (normalized) usually from {@link GeometryInstance#color}.  32-bit floating-point.  4 components per attribute.</li>\n   *    <li><code>pickColor</code> - RGBA color used for picking.  32-bit floating-point.  4 components per attribute.</li>\n   * </ul>\n   * </p>\n   *\n   * @type GeometryAttributes\n   *\n   * @default undefined\n   *\n   *\n   * @example\n   * geometry.attributes.position = new Cesium.GeometryAttribute({\n   *   componentDatatype : Cesium.ComponentDatatype.FLOAT,\n   *   componentsPerAttribute : 3,\n   *   values : new Float32Array(0)\n   * });\n   *\n   * @see GeometryAttribute\n   * @see VertexFormat\n   */\n  this.attributes = options.attributes;\n\n  /**\n   * Optional index data that - along with {@link Geometry#primitiveType} -\n   * determines the primitives in the geometry.\n   *\n   * @type {Array}\n   *\n   * @default undefined\n   */\n  this.indices = options.indices;\n\n  /**\n   * The type of primitives in the geometry.  This is most often {@link PrimitiveType.TRIANGLES},\n   * but can varying based on the specific geometry.\n   *\n   * @type PrimitiveType\n   *\n   * @default undefined\n   */\n  this.primitiveType = defaultValue(\n    options.primitiveType,\n    PrimitiveType.TRIANGLES\n  );\n\n  /**\n   * An optional bounding sphere that fully encloses the geometry.  This is\n   * commonly used for culling.\n   *\n   * @type BoundingSphere\n   *\n   * @default undefined\n   */\n  this.boundingSphere = options.boundingSphere;\n\n  /**\n   * @private\n   */\n  this.geometryType = defaultValue(options.geometryType, GeometryType.NONE);\n\n  /**\n   * @private\n   */\n  this.boundingSphereCV = options.boundingSphereCV;\n\n  /**\n   * Used for computing the bounding sphere for geometry using the applyOffset vertex attribute\n   * @private\n   */\n  this.offsetAttribute = options.offsetAttribute;\n}\n\n/**\n * Computes the number of vertices in a geometry.  The runtime is linear with\n * respect to the number of attributes in a vertex, not the number of vertices.\n *\n * @param {Geometry} geometry The geometry.\n * @returns {number} The number of vertices in the geometry.\n *\n * @example\n * const numVertices = Cesium.Geometry.computeNumberOfVertices(geometry);\n */\nGeometry.computeNumberOfVertices = function (geometry) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"geometry\", geometry);\n  //>>includeEnd('debug');\n\n  let numberOfVertices = -1;\n  for (const property in geometry.attributes) {\n    if (\n      geometry.attributes.hasOwnProperty(property) &&\n      defined(geometry.attributes[property]) &&\n      defined(geometry.attributes[property].values)\n    ) {\n      const attribute = geometry.attributes[property];\n      const num = attribute.values.length / attribute.componentsPerAttribute;\n      //>>includeStart('debug', pragmas.debug);\n      if (numberOfVertices !== num && numberOfVertices !== -1) {\n        throw new DeveloperError(\n          \"All attribute lists must have the same number of attributes.\"\n        );\n      }\n      //>>includeEnd('debug');\n      numberOfVertices = num;\n    }\n  }\n\n  return numberOfVertices;\n};\n\nconst rectangleCenterScratch = new Cartographic();\nconst enuCenterScratch = new Cartesian3();\nconst fixedFrameToEnuScratch = new Matrix4();\nconst boundingRectanglePointsCartographicScratch = [\n  new Cartographic(),\n  new Cartographic(),\n  new Cartographic(),\n];\nconst boundingRectanglePointsEnuScratch = [\n  new Cartesian2(),\n  new Cartesian2(),\n  new Cartesian2(),\n];\nconst points2DScratch = [new Cartesian2(), new Cartesian2(), new Cartesian2()];\nconst pointEnuScratch = new Cartesian3();\nconst enuRotationScratch = new Quaternion();\nconst enuRotationMatrixScratch = new Matrix4();\nconst rotation2DScratch = new Matrix2();\n\n/**\n * For remapping texture coordinates when rendering GroundPrimitives with materials.\n * GroundPrimitive texture coordinates are computed to align with the cartographic coordinate system on the globe.\n * However, EllipseGeometry, RectangleGeometry, and PolygonGeometry all bake rotations to per-vertex texture coordinates\n * using different strategies.\n *\n * This method is used by EllipseGeometry and PolygonGeometry to approximate the same visual effect.\n * We encapsulate rotation and scale by computing a \"transformed\" texture coordinate system and computing\n * a set of reference points from which \"cartographic\" texture coordinates can be remapped to the \"transformed\"\n * system using distances to lines in 2D.\n *\n * This approximation becomes less accurate as the covered area increases, especially for GroundPrimitives near the poles,\n * but is generally reasonable for polygons and ellipses around the size of USA states.\n *\n * RectangleGeometry has its own version of this method that computes remapping coordinates using cartographic space\n * as an intermediary instead of local ENU, which is more accurate for large-area rectangles.\n *\n * @param {Cartesian3[]} positions Array of positions outlining the geometry\n * @param {number} stRotation Texture coordinate rotation.\n * @param {Ellipsoid} ellipsoid Ellipsoid for projecting and generating local vectors.\n * @param {Rectangle} boundingRectangle Bounding rectangle around the positions.\n * @returns {number[]} An array of 6 numbers specifying [minimum point, u extent, v extent] as points in the \"cartographic\" system.\n * @private\n */\nGeometry._textureCoordinateRotationPoints = function (\n  positions,\n  stRotation,\n  ellipsoid,\n  boundingRectangle\n) {\n  let i;\n\n  // Create a local east-north-up coordinate system centered on the polygon's bounding rectangle.\n  // Project the southwest, northwest, and southeast corners of the bounding rectangle into the plane of ENU as 2D points.\n  // These are the equivalents of (0,0), (0,1), and (1,0) in the texture coordinate system computed in ShadowVolumeAppearanceFS,\n  // aka \"ENU texture space.\"\n  const rectangleCenter = Rectangle.center(\n    boundingRectangle,\n    rectangleCenterScratch\n  );\n  const enuCenter = Cartographic.toCartesian(\n    rectangleCenter,\n    ellipsoid,\n    enuCenterScratch\n  );\n  const enuToFixedFrame = Transforms.eastNorthUpToFixedFrame(\n    enuCenter,\n    ellipsoid,\n    fixedFrameToEnuScratch\n  );\n  const fixedFrameToEnu = Matrix4.inverse(\n    enuToFixedFrame,\n    fixedFrameToEnuScratch\n  );\n\n  const boundingPointsEnu = boundingRectanglePointsEnuScratch;\n  const boundingPointsCarto = boundingRectanglePointsCartographicScratch;\n\n  boundingPointsCarto[0].longitude = boundingRectangle.west;\n  boundingPointsCarto[0].latitude = boundingRectangle.south;\n\n  boundingPointsCarto[1].longitude = boundingRectangle.west;\n  boundingPointsCarto[1].latitude = boundingRectangle.north;\n\n  boundingPointsCarto[2].longitude = boundingRectangle.east;\n  boundingPointsCarto[2].latitude = boundingRectangle.south;\n\n  let posEnu = pointEnuScratch;\n\n  for (i = 0; i < 3; i++) {\n    Cartographic.toCartesian(boundingPointsCarto[i], ellipsoid, posEnu);\n    posEnu = Matrix4.multiplyByPointAsVector(fixedFrameToEnu, posEnu, posEnu);\n    boundingPointsEnu[i].x = posEnu.x;\n    boundingPointsEnu[i].y = posEnu.y;\n  }\n\n  // Rotate each point in the polygon around the up vector in the ENU by -stRotation and project into ENU as 2D.\n  // Compute the bounding box of these rotated points in the 2D ENU plane.\n  // Rotate the corners back by stRotation, then compute their equivalents in the ENU texture space using the corners computed earlier.\n  const rotation = Quaternion.fromAxisAngle(\n    Cartesian3.UNIT_Z,\n    -stRotation,\n    enuRotationScratch\n  );\n  const textureMatrix = Matrix3.fromQuaternion(\n    rotation,\n    enuRotationMatrixScratch\n  );\n\n  const positionsLength = positions.length;\n  let enuMinX = Number.POSITIVE_INFINITY;\n  let enuMinY = Number.POSITIVE_INFINITY;\n  let enuMaxX = Number.NEGATIVE_INFINITY;\n  let enuMaxY = Number.NEGATIVE_INFINITY;\n  for (i = 0; i < positionsLength; i++) {\n    posEnu = Matrix4.multiplyByPointAsVector(\n      fixedFrameToEnu,\n      positions[i],\n      posEnu\n    );\n    posEnu = Matrix3.multiplyByVector(textureMatrix, posEnu, posEnu);\n\n    enuMinX = Math.min(enuMinX, posEnu.x);\n    enuMinY = Math.min(enuMinY, posEnu.y);\n    enuMaxX = Math.max(enuMaxX, posEnu.x);\n    enuMaxY = Math.max(enuMaxY, posEnu.y);\n  }\n\n  const toDesiredInComputed = Matrix2.fromRotation(\n    stRotation,\n    rotation2DScratch\n  );\n\n  const points2D = points2DScratch;\n  points2D[0].x = enuMinX;\n  points2D[0].y = enuMinY;\n\n  points2D[1].x = enuMinX;\n  points2D[1].y = enuMaxY;\n\n  points2D[2].x = enuMaxX;\n  points2D[2].y = enuMinY;\n\n  const boundingEnuMin = boundingPointsEnu[0];\n  const boundingPointsWidth = boundingPointsEnu[2].x - boundingEnuMin.x;\n  const boundingPointsHeight = boundingPointsEnu[1].y - boundingEnuMin.y;\n\n  for (i = 0; i < 3; i++) {\n    const point2D = points2D[i];\n    // rotate back\n    Matrix2.multiplyByVector(toDesiredInComputed, point2D, point2D);\n\n    // Convert point into east-north texture coordinate space\n    point2D.x = (point2D.x - boundingEnuMin.x) / boundingPointsWidth;\n    point2D.y = (point2D.y - boundingEnuMin.y) / boundingPointsHeight;\n  }\n\n  const minXYCorner = points2D[0];\n  const maxYCorner = points2D[1];\n  const maxXCorner = points2D[2];\n  const result = new Array(6);\n  Cartesian2.pack(minXYCorner, result);\n  Cartesian2.pack(maxYCorner, result, 2);\n  Cartesian2.pack(maxXCorner, result, 4);\n\n  return result;\n};\nexport default Geometry;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Values and type information for geometry attributes.  A {@link Geometry}\n * generally contains one or more attributes.  All attributes together form\n * the geometry's vertices.\n *\n * @alias GeometryAttribute\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {ComponentDatatype} [options.componentDatatype] The datatype of each component in the attribute, e.g., individual elements in values.\n * @param {number} [options.componentsPerAttribute] A number between 1 and 4 that defines the number of components in an attributes.\n * @param {boolean} [options.normalize=false] When <code>true</code> and <code>componentDatatype</code> is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n * @param {number[]|Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} [options.values] The values for the attributes stored in a typed array.\n *\n * @exception {DeveloperError} options.componentsPerAttribute must be between 1 and 4.\n *\n *\n * @example\n * const geometry = new Cesium.Geometry({\n *   attributes : {\n *     position : new Cesium.GeometryAttribute({\n *       componentDatatype : Cesium.ComponentDatatype.FLOAT,\n *       componentsPerAttribute : 3,\n *       values : new Float32Array([\n *         0.0, 0.0, 0.0,\n *         7500000.0, 0.0, 0.0,\n *         0.0, 7500000.0, 0.0\n *       ])\n *     })\n *   },\n *   primitiveType : Cesium.PrimitiveType.LINE_LOOP\n * });\n *\n * @see Geometry\n */\nfunction GeometryAttribute(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options.componentDatatype)) {\n    throw new DeveloperError(\"options.componentDatatype is required.\");\n  }\n  if (!defined(options.componentsPerAttribute)) {\n    throw new DeveloperError(\"options.componentsPerAttribute is required.\");\n  }\n  if (\n    options.componentsPerAttribute < 1 ||\n    options.componentsPerAttribute > 4\n  ) {\n    throw new DeveloperError(\n      \"options.componentsPerAttribute must be between 1 and 4.\"\n    );\n  }\n  if (!defined(options.values)) {\n    throw new DeveloperError(\"options.values is required.\");\n  }\n  //>>includeEnd('debug');\n\n  /**\n   * The datatype of each component in the attribute, e.g., individual elements in\n   * {@link GeometryAttribute#values}.\n   *\n   * @type {ComponentDatatype}\n   *\n   * @default undefined\n   */\n  this.componentDatatype = options.componentDatatype;\n\n  /**\n   * A number between 1 and 4 that defines the number of components in an attributes.\n   * For example, a position attribute with x, y, and z components would have 3 as\n   * shown in the code example.\n   *\n   * @type {number}\n   *\n   * @default undefined\n   *\n   * @example\n   * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;\n   * attribute.componentsPerAttribute = 3;\n   * attribute.values = new Float32Array([\n   *   0.0, 0.0, 0.0,\n   *   7500000.0, 0.0, 0.0,\n   *   0.0, 7500000.0, 0.0\n   * ]);\n   */\n  this.componentsPerAttribute = options.componentsPerAttribute;\n\n  /**\n   * When <code>true</code> and <code>componentDatatype</code> is an integer format,\n   * indicate that the components should be mapped to the range [0, 1] (unsigned)\n   * or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n   * <p>\n   * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   *\n   * @example\n   * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;\n   * attribute.componentsPerAttribute = 4;\n   * attribute.normalize = true;\n   * attribute.values = new Uint8Array([\n   *   Cesium.Color.floatToByte(color.red),\n   *   Cesium.Color.floatToByte(color.green),\n   *   Cesium.Color.floatToByte(color.blue),\n   *   Cesium.Color.floatToByte(color.alpha)\n   * ]);\n   */\n  this.normalize = defaultValue(options.normalize, false);\n\n  /**\n   * The values for the attributes stored in a typed array.  In the code example,\n   * every three elements in <code>values</code> defines one attributes since\n   * <code>componentsPerAttribute</code> is 3.\n   *\n   * @type {number[]|Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array}\n   *\n   * @default undefined\n   *\n   * @example\n   * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;\n   * attribute.componentsPerAttribute = 3;\n   * attribute.values = new Float32Array([\n   *   0.0, 0.0, 0.0,\n   *   7500000.0, 0.0, 0.0,\n   *   0.0, 7500000.0, 0.0\n   * ]);\n   */\n  this.values = options.values;\n}\nexport default GeometryAttribute;\n", "import defined from \"./defined.js\";\n\n/**\n * Describes a compressed texture and contains a compressed texture buffer.\n * @alias CompressedTextureBuffer\n * @constructor\n *\n * @param {PixelFormat} internalFormat The pixel format of the compressed texture.\n * @param {PixelDatatype} pixelDatatype The pixel datatype of the compressed texture.\n * @param {number} width The width of the texture.\n * @param {number} height The height of the texture.\n * @param {Uint8Array} buffer The compressed texture buffer.\n */\nfunction CompressedTextureBuffer(\n  internalFormat,\n  pixelDatatype,\n  width,\n  height,\n  buffer\n) {\n  this._format = internalFormat;\n  this._datatype = pixelDatatype;\n  this._width = width;\n  this._height = height;\n  this._buffer = buffer;\n}\n\nObject.defineProperties(CompressedTextureBuffer.prototype, {\n  /**\n   * The format of the compressed texture.\n   * @type {PixelFormat}\n   * @readonly\n   * @memberof CompressedTextureBuffer.prototype\n   */\n  internalFormat: {\n    get: function () {\n      return this._format;\n    },\n  },\n  /**\n   * The datatype of the compressed texture.\n   * @type {PixelDatatype}\n   * @readonly\n   * @memberof CompressedTextureBuffer.prototype\n   */\n  pixelDatatype: {\n    get: function () {\n      return this._datatype;\n    },\n  },\n  /**\n   * The width of the texture.\n   * @type {number}\n   * @readonly\n   * @memberof CompressedTextureBuffer.prototype\n   */\n  width: {\n    get: function () {\n      return this._width;\n    },\n  },\n  /**\n   * The height of the texture.\n   * @type {number}\n   * @readonly\n   * @memberof CompressedTextureBuffer.prototype\n   */\n  height: {\n    get: function () {\n      return this._height;\n    },\n  },\n  /**\n   * The compressed texture buffer.\n   * @type {Uint8Array}\n   * @readonly\n   * @memberof CompressedTextureBuffer.prototype\n   */\n  bufferView: {\n    get: function () {\n      return this._buffer;\n    },\n  },\n});\n\n/**\n * Creates a shallow clone of a compressed texture buffer.\n *\n * @param {CompressedTextureBuffer} object The compressed texture buffer to be cloned.\n * @return {CompressedTextureBuffer} A shallow clone of the compressed texture buffer.\n */\nCompressedTextureBuffer.clone = function (object) {\n  if (!defined(object)) {\n    return undefined;\n  }\n\n  return new CompressedTextureBuffer(\n    object._format,\n    object._datatype,\n    object._width,\n    object._height,\n    object._buffer\n  );\n};\n\n/**\n * Creates a shallow clone of this compressed texture buffer.\n *\n * @return {CompressedTextureBuffer} A shallow clone of the compressed texture buffer.\n */\nCompressedTextureBuffer.prototype.clone = function () {\n  return CompressedTextureBuffer.clone(this);\n};\nexport default CompressedTextureBuffer;\n", "import Uri from \"urijs\";\nimport buildModuleUrl from \"./buildModuleUrl.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport destroyObject from \"./destroyObject.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Event from \"./Event.js\";\nimport FeatureDetection from \"./FeatureDetection.js\";\nimport isCrossOriginUrl from \"./isCrossOriginUrl.js\";\nimport Resource from \"./Resource.js\";\nimport RuntimeError from \"./RuntimeError.js\";\n\nfunction canTransferArrayBuffer() {\n  if (!defined(TaskProcessor._canTransferArrayBuffer)) {\n    const worker = createWorker(\"transferTypedArrayTest\");\n    worker.postMessage = defaultValue(\n      worker.webkitPostMessage,\n      worker.postMessage\n    );\n\n    const value = 99;\n    const array = new Int8Array([value]);\n\n    try {\n      // postMessage might fail with a DataCloneError\n      // if transferring array buffers is not supported.\n      worker.postMessage(\n        {\n          array: array,\n        },\n        [array.buffer]\n      );\n    } catch (e) {\n      TaskProcessor._canTransferArrayBuffer = false;\n      return TaskProcessor._canTransferArrayBuffer;\n    }\n\n    TaskProcessor._canTransferArrayBuffer = new Promise((resolve) => {\n      worker.onmessage = function (event) {\n        const array = event.data.array;\n\n        // some versions of Firefox silently fail to transfer typed arrays.\n        // https://bugzilla.mozilla.org/show_bug.cgi?id=841904\n        // Check to make sure the value round-trips successfully.\n        const result = defined(array) && array[0] === value;\n        resolve(result);\n\n        worker.terminate();\n\n        TaskProcessor._canTransferArrayBuffer = result;\n      };\n    });\n  }\n\n  return TaskProcessor._canTransferArrayBuffer;\n}\n\nconst taskCompletedEvent = new Event();\n\nfunction urlFromScript(script) {\n  let blob;\n  try {\n    blob = new Blob([script], {\n      type: \"application/javascript\",\n    });\n  } catch (e) {\n    const BlobBuilder =\n      window.BlobBuilder ||\n      window.WebKitBlobBuilder ||\n      window.MozBlobBuilder ||\n      window.MSBlobBuilder;\n    const blobBuilder = new BlobBuilder();\n    blobBuilder.append(script);\n    blob = blobBuilder.getBlob(\"application/javascript\");\n  }\n\n  const URL = window.URL || window.webkitURL;\n  return URL.createObjectURL(blob);\n}\n\nfunction createWorker(url) {\n  const uri = new Uri(url);\n  const isUri = uri.scheme().length !== 0 && uri.fragment().length === 0;\n\n  const options = {};\n  let workerPath;\n  if (isCrossOriginUrl(url)) {\n    // To load cross-origin, create a shim worker from a blob URL\n    const script = `importScripts(\"${url}\");`;\n    workerPath = urlFromScript(script);\n    return new Worker(workerPath, options);\n  }\n\n  const moduleID = url.replace(/\\.js$/, \"\");\n\n  /* global CESIUM_WORKERS */\n  if (!isUri && typeof CESIUM_WORKERS !== \"undefined\") {\n    // If the workers are embedded, create a shim worker from the embedded script data\n    const script = `\n      importScripts(\"${urlFromScript(CESIUM_WORKERS)}\");\n      CesiumWorkers[\"${moduleID}\"]();\n    `;\n    workerPath = urlFromScript(script);\n    return new Worker(workerPath, options);\n  }\n\n  workerPath = url;\n\n  if (!isUri) {\n    workerPath = buildModuleUrl(\n      `${TaskProcessor._workerModulePrefix + moduleID}.js`\n    );\n  }\n\n  if (!FeatureDetection.supportsEsmWebWorkers()) {\n    throw new RuntimeError(\n      \"This browser is not supported. Please update your browser to continue.\"\n    );\n  }\n\n  options.type = \"module\";\n\n  return new Worker(workerPath, options);\n}\n\nasync function getWebAssemblyLoaderConfig(processor, wasmOptions) {\n  const config = {\n    modulePath: undefined,\n    wasmBinaryFile: undefined,\n    wasmBinary: undefined,\n  };\n\n  // Web assembly not supported, use fallback js module if provided\n  if (!FeatureDetection.supportsWebAssembly()) {\n    if (!defined(wasmOptions.fallbackModulePath)) {\n      throw new RuntimeError(\n        `This browser does not support Web Assembly, and no backup module was provided for ${processor._workerPath}`\n      );\n    }\n\n    config.modulePath = buildModuleUrl(wasmOptions.fallbackModulePath);\n    return config;\n  }\n\n  config.wasmBinaryFile = buildModuleUrl(wasmOptions.wasmBinaryFile);\n\n  const arrayBuffer = await Resource.fetchArrayBuffer({\n    url: config.wasmBinaryFile,\n  });\n\n  config.wasmBinary = arrayBuffer;\n  return config;\n}\n\n/**\n * A wrapper around a web worker that allows scheduling tasks for a given worker,\n * returning results asynchronously via a promise.\n *\n * The Worker is not constructed until a task is scheduled.\n *\n * @alias TaskProcessor\n * @constructor\n *\n * @param {string} workerPath The Url to the worker. This can either be an absolute path or relative to the Cesium Workers folder.\n * @param {number} [maximumActiveTasks=Number.POSITIVE_INFINITY] The maximum number of active tasks.  Once exceeded,\n *                                        scheduleTask will not queue any more tasks, allowing\n *                                        work to be rescheduled in future frames.\n */\nfunction TaskProcessor(workerPath, maximumActiveTasks) {\n  this._workerPath = workerPath;\n  this._maximumActiveTasks = defaultValue(\n    maximumActiveTasks,\n    Number.POSITIVE_INFINITY\n  );\n  this._activeTasks = 0;\n  this._nextID = 0;\n  this._webAssemblyPromise = undefined;\n}\n\nconst createOnmessageHandler = (worker, id, resolve, reject) => {\n  const listener = ({ data }) => {\n    if (data.id !== id) {\n      return;\n    }\n\n    if (defined(data.error)) {\n      let error = data.error;\n      if (error.name === \"RuntimeError\") {\n        error = new RuntimeError(data.error.message);\n        error.stack = data.error.stack;\n      } else if (error.name === \"DeveloperError\") {\n        error = new DeveloperError(data.error.message);\n        error.stack = data.error.stack;\n      } else if (error.name === \"Error\") {\n        error = new Error(data.error.message);\n        error.stack = data.error.stack;\n      }\n      taskCompletedEvent.raiseEvent(error);\n      reject(error);\n    } else {\n      taskCompletedEvent.raiseEvent();\n      resolve(data.result);\n    }\n\n    worker.removeEventListener(\"message\", listener);\n  };\n\n  return listener;\n};\n\nconst emptyTransferableObjectArray = [];\nasync function runTask(processor, parameters, transferableObjects) {\n  const canTransfer = await Promise.resolve(canTransferArrayBuffer());\n  if (!defined(transferableObjects)) {\n    transferableObjects = emptyTransferableObjectArray;\n  } else if (!canTransfer) {\n    transferableObjects.length = 0;\n  }\n\n  const id = processor._nextID++;\n  const promise = new Promise((resolve, reject) => {\n    processor._worker.addEventListener(\n      \"message\",\n      createOnmessageHandler(processor._worker, id, resolve, reject)\n    );\n  });\n\n  processor._worker.postMessage(\n    {\n      id: id,\n      baseUrl: buildModuleUrl.getCesiumBaseUrl().url,\n      parameters: parameters,\n      canTransferArrayBuffer: canTransfer,\n    },\n    transferableObjects\n  );\n\n  return promise;\n}\n\nasync function scheduleTask(processor, parameters, transferableObjects) {\n  ++processor._activeTasks;\n\n  try {\n    const result = await runTask(processor, parameters, transferableObjects);\n    --processor._activeTasks;\n    return result;\n  } catch (error) {\n    --processor._activeTasks;\n    throw error;\n  }\n}\n\n/**\n * Schedule a task to be processed by the web worker asynchronously.  If there are currently more\n * tasks active than the maximum set by the constructor, will immediately return undefined.\n * Otherwise, returns a promise that will resolve to the result posted back by the worker when\n * finished.\n *\n * @param {object} parameters Any input data that will be posted to the worker.\n * @param {Object[]} [transferableObjects] An array of objects contained in parameters that should be\n *                                      transferred to the worker instead of copied.\n * @returns {Promise<object>|undefined} Either a promise that will resolve to the result when available, or undefined\n *                    if there are too many active tasks,\n *\n * @example\n * const taskProcessor = new Cesium.TaskProcessor('myWorkerPath');\n * const promise = taskProcessor.scheduleTask({\n *     someParameter : true,\n *     another : 'hello'\n * });\n * if (!Cesium.defined(promise)) {\n *     // too many active tasks - try again later\n * } else {\n *     promise.then(function(result) {\n *         // use the result of the task\n *     });\n * }\n */\nTaskProcessor.prototype.scheduleTask = function (\n  parameters,\n  transferableObjects\n) {\n  if (!defined(this._worker)) {\n    this._worker = createWorker(this._workerPath);\n  }\n\n  if (this._activeTasks >= this._maximumActiveTasks) {\n    return undefined;\n  }\n\n  return scheduleTask(this, parameters, transferableObjects);\n};\n\n/**\n * Posts a message to a web worker with configuration to initialize loading\n * and compiling a web assembly module asynchronously, as well as an optional\n * fallback JavaScript module to use if Web Assembly is not supported.\n *\n * @param {object} [webAssemblyOptions] An object with the following properties:\n * @param {string} [webAssemblyOptions.modulePath] The path of the web assembly JavaScript wrapper module.\n * @param {string} [webAssemblyOptions.wasmBinaryFile] The path of the web assembly binary file.\n * @param {string} [webAssemblyOptions.fallbackModulePath] The path of the fallback JavaScript module to use if web assembly is not supported.\n * @returns {Promise<*>} A promise that resolves to the result when the web worker has loaded and compiled the web assembly module and is ready to process tasks.\n *\n * @exception {RuntimeError} This browser does not support Web Assembly, and no backup module was provided\n */\nTaskProcessor.prototype.initWebAssemblyModule = async function (\n  webAssemblyOptions\n) {\n  if (defined(this._webAssemblyPromise)) {\n    return this._webAssemblyPromise;\n  }\n\n  const init = async () => {\n    const worker = (this._worker = createWorker(this._workerPath));\n    const wasmConfig = await getWebAssemblyLoaderConfig(\n      this,\n      webAssemblyOptions\n    );\n    const canTransfer = await Promise.resolve(canTransferArrayBuffer());\n    let transferableObjects;\n    const binary = wasmConfig.wasmBinary;\n    if (defined(binary) && canTransfer) {\n      transferableObjects = [binary];\n    }\n\n    const promise = new Promise((resolve, reject) => {\n      worker.onmessage = function ({ data }) {\n        if (defined(data)) {\n          resolve(data.result);\n        } else {\n          reject(new RuntimeError(\"Could not configure wasm module\"));\n        }\n      };\n    });\n\n    worker.postMessage(\n      {\n        canTransferArrayBuffer: canTransfer,\n        parameters: { webAssemblyConfig: wasmConfig },\n      },\n      transferableObjects\n    );\n\n    return promise;\n  };\n\n  this._webAssemblyPromise = init();\n  return this._webAssemblyPromise;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see TaskProcessor#destroy\n */\nTaskProcessor.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys this object.  This will immediately terminate the Worker.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n */\nTaskProcessor.prototype.destroy = function () {\n  if (defined(this._worker)) {\n    this._worker.terminate();\n  }\n  return destroyObject(this);\n};\n\n/**\n * An event that's raised when a task is completed successfully.  Event handlers are passed\n * the error object is a task fails.\n *\n * @type {Event}\n *\n * @private\n */\nTaskProcessor.taskCompletedEvent = taskCompletedEvent;\n\n// exposed for testing purposes\nTaskProcessor._defaultWorkerModulePrefix = \"Workers/\";\nTaskProcessor._workerModulePrefix = TaskProcessor._defaultWorkerModulePrefix;\nTaskProcessor._canTransferArrayBuffer = undefined;\nexport default TaskProcessor;\n", "import Check from \"./Check.js\";\nimport CompressedTextureBuffer from \"./CompressedTextureBuffer.js\";\nimport defined from \"./defined.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TaskProcessor from \"./TaskProcessor.js\";\n\n/**\n * Transcodes KTX2 textures using web workers.\n *\n * @private\n */\nfunction KTX2Transcoder() {}\n\nKTX2Transcoder._transcodeTaskProcessor = new TaskProcessor(\n  \"transcodeKTX2\",\n  Number.POSITIVE_INFINITY // KTX2 transcoding is used in place of Resource.fetchImage, so it can't reject as \"just soooo busy right now\"\n);\n\nKTX2Transcoder._readyPromise = undefined;\n\nfunction makeReadyPromise() {\n  const readyPromise = KTX2Transcoder._transcodeTaskProcessor\n    .initWebAssemblyModule({\n      wasmBinaryFile: \"ThirdParty/basis_transcoder.wasm\",\n    })\n    .then(function (result) {\n      if (result) {\n        return KTX2Transcoder._transcodeTaskProcessor;\n      }\n\n      throw new RuntimeError(\"KTX2 transcoder could not be initialized.\");\n    });\n  KTX2Transcoder._readyPromise = readyPromise;\n}\n\nKTX2Transcoder.transcode = function (ktx2Buffer, supportedTargetFormats) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"supportedTargetFormats\", supportedTargetFormats);\n  //>>includeEnd('debug');\n\n  if (!defined(KTX2Transcoder._readyPromise)) {\n    makeReadyPromise();\n  }\n\n  return KTX2Transcoder._readyPromise\n    .then(function (taskProcessor) {\n      let parameters;\n      if (ktx2Buffer instanceof ArrayBuffer) {\n        const view = new Uint8Array(ktx2Buffer);\n        parameters = {\n          supportedTargetFormats: supportedTargetFormats,\n          ktx2Buffer: view,\n        };\n        return taskProcessor.scheduleTask(parameters, [ktx2Buffer]);\n      }\n      parameters = {\n        supportedTargetFormats: supportedTargetFormats,\n        ktx2Buffer: ktx2Buffer,\n      };\n      return taskProcessor.scheduleTask(parameters, [ktx2Buffer.buffer]);\n    })\n    .then(function (result) {\n      const levelsLength = result.length;\n      const faceKeys = Object.keys(result[0]);\n      const faceKeysLength = faceKeys.length;\n\n      let i;\n      for (i = 0; i < levelsLength; i++) {\n        const faces = result[i];\n        for (let j = 0; j < faceKeysLength; j++) {\n          const face = faces[faceKeys[j]];\n          faces[faceKeys[j]] = new CompressedTextureBuffer(\n            face.internalFormat,\n            face.datatype,\n            face.width,\n            face.height,\n            face.levelBuffer\n          );\n        }\n      }\n\n      // Cleaning up parsed result if it's a single image\n      if (faceKeysLength === 1) {\n        for (i = 0; i < levelsLength; ++i) {\n          result[i] = result[i][faceKeys[0]];\n        }\n\n        if (levelsLength === 1) {\n          result = result[0];\n        }\n      }\n      return result;\n    })\n    .catch(function (error) {\n      throw error;\n    });\n};\n\nexport default KTX2Transcoder;\n", "import Check from \"./Check.js\";\nimport Resource from \"./Resource.js\";\nimport KTX2Transcoder from \"./KTX2Transcoder.js\";\n\n/**\n * Stores the supported formats that KTX2 can transcode to. Called during context creation.\n *\n * @param {boolean} s3tc Whether or not S3TC is supported\n * @param {boolean} pvrtc Whether or not PVRTC is supported\n * @param {boolean} astc Whether or not ASTC is supported\n * @param {boolean} etc Whether or not ETC is supported\n * @param {boolean} etc1 Whether or not ETC1 is supported\n * @param {boolean} bc7 Whether or not BC7 is supported\n * @private\n */\nlet supportedTranscoderFormats;\n\nloadKTX2.setKTX2SupportedFormats = function (\n  s3tc,\n  pvrtc,\n  astc,\n  etc,\n  etc1,\n  bc7\n) {\n  supportedTranscoderFormats = {\n    s3tc: s3tc,\n    pvrtc: pvrtc,\n    astc: astc,\n    etc: etc,\n    etc1: etc1,\n    bc7: bc7,\n  };\n};\n\n/**\n * Asynchronously loads and parses the given URL to a KTX2 file or parses the raw binary data of a KTX2 file.\n * Returns a promise that will resolve to an object containing the image buffer, width, height, and format once loaded,\n * or reject if the URL failed to load or failed to parse the data. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource sharing (CORS) headers enabled.\n * <p>\n * The following are part of the KTX2 format specification but are not supported:\n * <ul>\n *     <li>Metadata</li>\n *     <li>3D textures</li>\n *     <li>Texture Arrays</li>\n *     <li>Video</li>\n * </ul>\n * </p>\n *\n * @function loadKTX2\n *\n * @param {Resource|string|ArrayBuffer} resourceOrUrlOrBuffer The URL of the binary data or an ArrayBuffer.\n * @returns {Promise<CompressedTextureBuffer>|undefined} A promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n * @exception {RuntimeError} Invalid KTX2 file.\n * @exception {RuntimeError} KTX2 texture arrays are not supported.\n * @exception {RuntimeError} KTX2 3D textures are unsupported.\n * @exception {RuntimeError} No transcoding format target available for ETC1S compressed ktx2s.\n * @exception {RuntimeError} No transcoding format target available for UASTC compressed ktx2s.\n * @exception {RuntimeError} startTranscoding() failed.\n * @exception {RuntimeError} transcodeImage() failed.\n *\n * @example\n * // load a single URL asynchronously\n * Cesium.loadKTX2('some/url').then(function (ktx2Data) {\n *     const width = ktx2Data.width;\n *     const height = ktx2Data.height;\n *     const format = ktx2Data.internalFormat;\n *     const arrayBufferView = ktx2Data.bufferView;\n *     // use the data to create a texture\n * }).catch(function (error) {\n *     // an error occurred.\n * });\n *\n * @see {@link https://github.com/KhronosGroup/KTX-Specification|KTX file format}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n * @private\n */\nfunction loadKTX2(resourceOrUrlOrBuffer) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"resourceOrUrlOrBuffer\", resourceOrUrlOrBuffer);\n  //>>includeEnd('debug');\n\n  let loadPromise;\n  if (\n    resourceOrUrlOrBuffer instanceof ArrayBuffer ||\n    ArrayBuffer.isView(resourceOrUrlOrBuffer)\n  ) {\n    loadPromise = Promise.resolve(resourceOrUrlOrBuffer);\n  } else {\n    const resource = Resource.createIfNeeded(resourceOrUrlOrBuffer);\n    loadPromise = resource.fetchArrayBuffer();\n  }\n\n  // load module then return\n  return loadPromise.then(function (data) {\n    return KTX2Transcoder.transcode(data, supportedTranscoderFormats);\n  });\n}\n\nexport default loadKTX2;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport PixelDatatype from \"./PixelDatatype.js\";\n\n/**\n * @private\n */\nfunction CubeMapFace(\n  context,\n  texture,\n  textureTarget,\n  targetFace,\n  internalFormat,\n  pixelFormat,\n  pixelDatatype,\n  size,\n  preMultiplyAlpha,\n  flipY,\n  initialized\n) {\n  this._context = context;\n  this._texture = texture;\n  this._textureTarget = textureTarget;\n  this._targetFace = targetFace;\n  this._pixelDatatype = pixelDatatype;\n  this._internalFormat = internalFormat;\n  this._pixelFormat = pixelFormat;\n  this._size = size;\n  this._preMultiplyAlpha = preMultiplyAlpha;\n  this._flipY = flipY;\n  this._initialized = initialized;\n}\n\nObject.defineProperties(CubeMapFace.prototype, {\n  pixelFormat: {\n    get: function () {\n      return this._pixelFormat;\n    },\n  },\n  pixelDatatype: {\n    get: function () {\n      return this._pixelDatatype;\n    },\n  },\n  _target: {\n    get: function () {\n      return this._targetFace;\n    },\n  },\n});\n\n/**\n * Copies texels from the source to the cubemap's face.\n * @param {object} options Object with the following properties:\n * @param {object} options.source The source {@link ImageData}, {@link HTMLImageElement}, {@link HTMLCanvasElement}, {@link HTMLVideoElement},\n *                              or an object with a width, height, and arrayBufferView properties.\n * @param {number} [options.xOffset=0] An offset in the x direction in the cubemap where copying begins.\n * @param {number} [options.yOffset=0] An offset in the y direction in the cubemap where copying begins.\n * @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the texture will be ignored.\n * @exception {DeveloperError} xOffset must be greater than or equal to zero.\n * @exception {DeveloperError} yOffset must be greater than or equal to zero.\n * @exception {DeveloperError} xOffset + source.width must be less than or equal to width.\n * @exception {DeveloperError} yOffset + source.height must be less than or equal to height.\n * @exception {DeveloperError} This CubeMap was destroyed, i.e., destroy() was called.\n *\n * @example\n * // Create a cubemap with 1x1 faces, and make the +x face red.\n * const cubeMap = new CubeMap({\n *   context : context\n *   width : 1,\n *   height : 1\n * });\n * cubeMap.positiveX.copyFrom({\n *   source: {\n *     width : 1,\n *     height : 1,\n *     arrayBufferView : new Uint8Array([255, 0, 0, 255])\n *   }\n * });\n */\nCubeMapFace.prototype.copyFrom = function (options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options\", options);\n  //>>includeEnd('debug');\n\n  const xOffset = defaultValue(options.xOffset, 0);\n  const yOffset = defaultValue(options.yOffset, 0);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.source\", options.source);\n  Check.typeOf.number.greaterThanOrEquals(\"xOffset\", xOffset, 0);\n  Check.typeOf.number.greaterThanOrEquals(\"yOffset\", yOffset, 0);\n  if (xOffset + options.source.width > this._size) {\n    throw new DeveloperError(\n      \"xOffset + options.source.width must be less than or equal to width.\"\n    );\n  }\n  if (yOffset + options.source.height > this._size) {\n    throw new DeveloperError(\n      \"yOffset + options.source.height must be less than or equal to height.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const source = options.source;\n\n  const gl = this._context._gl;\n  const target = this._textureTarget;\n  const targetFace = this._targetFace;\n\n  gl.activeTexture(gl.TEXTURE0);\n  gl.bindTexture(target, this._texture);\n\n  const width = source.width;\n  const height = source.height;\n  let arrayBufferView = source.arrayBufferView;\n\n  const size = this._size;\n  const pixelFormat = this._pixelFormat;\n  const internalFormat = this._internalFormat;\n  const pixelDatatype = this._pixelDatatype;\n\n  const preMultiplyAlpha = this._preMultiplyAlpha;\n  const flipY = this._flipY;\n  const skipColorSpaceConversion = defaultValue(\n    options.skipColorSpaceConversion,\n    false\n  );\n\n  let unpackAlignment = 4;\n  if (defined(arrayBufferView)) {\n    unpackAlignment = PixelFormat.alignmentInBytes(\n      pixelFormat,\n      pixelDatatype,\n      width\n    );\n  }\n\n  gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);\n\n  if (skipColorSpaceConversion) {\n    gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);\n  } else {\n    gl.pixelStorei(\n      gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,\n      gl.BROWSER_DEFAULT_WEBGL\n    );\n  }\n\n  let uploaded = false;\n  if (!this._initialized) {\n    if (xOffset === 0 && yOffset === 0 && width === size && height === size) {\n      // initialize the entire texture\n      if (defined(arrayBufferView)) {\n        gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n        if (flipY) {\n          arrayBufferView = PixelFormat.flipY(\n            arrayBufferView,\n            pixelFormat,\n            pixelDatatype,\n            size,\n            size\n          );\n        }\n        gl.texImage2D(\n          targetFace,\n          0,\n          internalFormat,\n          size,\n          size,\n          0,\n          pixelFormat,\n          PixelDatatype.toWebGLConstant(pixelDatatype, this._context),\n          arrayBufferView\n        );\n      } else {\n        // Only valid for DOM-Element uploads\n        gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);\n        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);\n\n        gl.texImage2D(\n          targetFace,\n          0,\n          internalFormat,\n          pixelFormat,\n          PixelDatatype.toWebGLConstant(pixelDatatype, this._context),\n          source\n        );\n      }\n      uploaded = true;\n    } else {\n      gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n      gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n      // initialize the entire texture to zero\n      const bufferView = PixelFormat.createTypedArray(\n        pixelFormat,\n        pixelDatatype,\n        size,\n        size\n      );\n      gl.texImage2D(\n        targetFace,\n        0,\n        internalFormat,\n        size,\n        size,\n        0,\n        pixelFormat,\n        PixelDatatype.toWebGLConstant(pixelDatatype, this._context),\n        bufferView\n      );\n    }\n    this._initialized = true;\n  }\n\n  if (!uploaded) {\n    if (defined(arrayBufferView)) {\n      gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n      gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n      if (flipY) {\n        arrayBufferView = PixelFormat.flipY(\n          arrayBufferView,\n          pixelFormat,\n          pixelDatatype,\n          width,\n          height\n        );\n      }\n      gl.texSubImage2D(\n        targetFace,\n        0,\n        xOffset,\n        yOffset,\n        width,\n        height,\n        pixelFormat,\n        PixelDatatype.toWebGLConstant(pixelDatatype, this._context),\n        arrayBufferView\n      );\n    } else {\n      // Only valid for DOM-Element uploads\n      gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);\n      gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);\n\n      // Source: ImageData, HTMLImageElement, HTMLCanvasElement, or HTMLVideoElement\n      gl.texSubImage2D(\n        targetFace,\n        0,\n        xOffset,\n        yOffset,\n        pixelFormat,\n        PixelDatatype.toWebGLConstant(pixelDatatype, this._context),\n        source\n      );\n    }\n  }\n\n  gl.bindTexture(target, null);\n};\n\n/**\n * Copies texels from the framebuffer to the cubemap's face.\n *\n * @param {number} [xOffset=0] An offset in the x direction in the cubemap where copying begins.\n * @param {number} [yOffset=0] An offset in the y direction in the cubemap where copying begins.\n * @param {number} [framebufferXOffset=0] An offset in the x direction in the framebuffer where copying begins from.\n * @param {number} [framebufferYOffset=0] An offset in the y direction in the framebuffer where copying begins from.\n * @param {number} [width=CubeMap's width] The width of the subimage to copy.\n * @param {number} [height=CubeMap's height] The height of the subimage to copy.\n *\n * @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.\n * @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.\n * @exception {DeveloperError} This CubeMap was destroyed, i.e., destroy() was called.\n * @exception {DeveloperError} xOffset must be greater than or equal to zero.\n * @exception {DeveloperError} yOffset must be greater than or equal to zero.\n * @exception {DeveloperError} framebufferXOffset must be greater than or equal to zero.\n * @exception {DeveloperError} framebufferYOffset must be greater than or equal to zero.\n * @exception {DeveloperError} xOffset + source.width must be less than or equal to width.\n * @exception {DeveloperError} yOffset + source.height must be less than or equal to height.\n * @exception {DeveloperError} This CubeMap was destroyed, i.e., destroy() was called.\n *\n * @example\n * // Copy the framebuffer contents to the +x cube map face.\n * cubeMap.positiveX.copyFromFramebuffer();\n */\nCubeMapFace.prototype.copyFromFramebuffer = function (\n  xOffset,\n  yOffset,\n  framebufferXOffset,\n  framebufferYOffset,\n  width,\n  height\n) {\n  xOffset = defaultValue(xOffset, 0);\n  yOffset = defaultValue(yOffset, 0);\n  framebufferXOffset = defaultValue(framebufferXOffset, 0);\n  framebufferYOffset = defaultValue(framebufferYOffset, 0);\n  width = defaultValue(width, this._size);\n  height = defaultValue(height, this._size);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThanOrEquals(\"xOffset\", xOffset, 0);\n  Check.typeOf.number.greaterThanOrEquals(\"yOffset\", yOffset, 0);\n  Check.typeOf.number.greaterThanOrEquals(\n    \"framebufferXOffset\",\n    framebufferXOffset,\n    0\n  );\n  Check.typeOf.number.greaterThanOrEquals(\n    \"framebufferYOffset\",\n    framebufferYOffset,\n    0\n  );\n  if (xOffset + width > this._size) {\n    throw new DeveloperError(\n      \"xOffset + source.width must be less than or equal to width.\"\n    );\n  }\n  if (yOffset + height > this._size) {\n    throw new DeveloperError(\n      \"yOffset + source.height must be less than or equal to height.\"\n    );\n  }\n  if (this._pixelDatatype === PixelDatatype.FLOAT) {\n    throw new DeveloperError(\n      \"Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.\"\n    );\n  }\n  if (this._pixelDatatype === PixelDatatype.HALF_FLOAT) {\n    throw new DeveloperError(\n      \"Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const gl = this._context._gl;\n  const target = this._textureTarget;\n\n  gl.activeTexture(gl.TEXTURE0);\n  gl.bindTexture(target, this._texture);\n  gl.copyTexSubImage2D(\n    this._targetFace,\n    0,\n    xOffset,\n    yOffset,\n    framebufferXOffset,\n    framebufferYOffset,\n    width,\n    height\n  );\n  gl.bindTexture(target, null);\n  this._initialized = true;\n};\nexport default CubeMapFace;\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * @private\n */\nconst MipmapHint = {\n  DONT_CARE: WebGLConstants.DONT_CARE,\n  FASTEST: WebGLConstants.FASTEST,\n  NICEST: WebGLConstants.NICEST,\n\n  validate: function (mipmapHint) {\n    return (\n      mipmapHint === MipmapHint.DONT_CARE ||\n      mipmapHint === MipmapHint.FASTEST ||\n      mipmapHint === MipmapHint.NICEST\n    );\n  },\n};\nexport default Object.freeze(MipmapHint);\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Enumerates all possible filters used when magnifying WebGL textures.\n *\n * @enum {number}\n *\n * @see TextureMinificationFilter\n */\nconst TextureMagnificationFilter = {\n  /**\n   * Samples the texture by returning the closest pixel.\n   *\n   * @type {number}\n   * @constant\n   */\n  NEAREST: WebGLConstants.NEAREST,\n  /**\n   * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.\n   *\n   * @type {number}\n   * @constant\n   */\n  LINEAR: WebGLConstants.LINEAR,\n};\n\n/**\n * Validates the given <code>textureMinificationFilter</code> with respect to the possible enum values.\n * @param textureMagnificationFilter\n * @returns {boolean} <code>true</code> if <code>textureMagnificationFilter</code> is valid.\n *\n * @private\n */\nTextureMagnificationFilter.validate = function (textureMagnificationFilter) {\n  return (\n    textureMagnificationFilter === TextureMagnificationFilter.NEAREST ||\n    textureMagnificationFilter === TextureMagnificationFilter.LINEAR\n  );\n};\n\nexport default Object.freeze(TextureMagnificationFilter);\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Enumerates all possible filters used when minifying WebGL textures.\n *\n * @enum {number}\n *\n * @see TextureMagnificationFilter\n */\nconst TextureMinificationFilter = {\n  /**\n   * Samples the texture by returning the closest pixel.\n   *\n   * @type {number}\n   * @constant\n   */\n  NEAREST: WebGLConstants.NEAREST,\n  /**\n   * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.\n   *\n   * @type {number}\n   * @constant\n   */\n  LINEAR: WebGLConstants.LINEAR,\n  /**\n   * Selects the nearest mip level and applies nearest sampling within that level.\n   * <p>\n   * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.\n   * </p>\n   *\n   * @type {number}\n   * @constant\n   */\n  NEAREST_MIPMAP_NEAREST: WebGLConstants.NEAREST_MIPMAP_NEAREST,\n  /**\n   * Selects the nearest mip level and applies linear sampling within that level.\n   * <p>\n   * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.\n   * </p>\n   *\n   * @type {number}\n   * @constant\n   */\n  LINEAR_MIPMAP_NEAREST: WebGLConstants.LINEAR_MIPMAP_NEAREST,\n  /**\n   * Read texture values with nearest sampling from two adjacent mip levels and linearly interpolate the results.\n   * <p>\n   * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.\n   * </p>\n   * <p>\n   * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.\n   * </p>\n   *\n   * @type {number}\n   * @constant\n   */\n  NEAREST_MIPMAP_LINEAR: WebGLConstants.NEAREST_MIPMAP_LINEAR,\n  /**\n   * Read texture values with linear sampling from two adjacent mip levels and linearly interpolate the results.\n   * <p>\n   * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.\n   * </p>\n   * <p>\n   * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.\n   * </p>\n   * @type {number}\n   * @constant\n   */\n  LINEAR_MIPMAP_LINEAR: WebGLConstants.LINEAR_MIPMAP_LINEAR,\n};\n\n/**\n * Validates the given <code>textureMinificationFilter</code> with respect to the possible enum values.\n *\n * @private\n *\n * @param textureMinificationFilter\n * @returns {boolean} <code>true</code> if <code>textureMinificationFilter</code> is valid.\n */\nTextureMinificationFilter.validate = function (textureMinificationFilter) {\n  return (\n    textureMinificationFilter === TextureMinificationFilter.NEAREST ||\n    textureMinificationFilter === TextureMinificationFilter.LINEAR ||\n    textureMinificationFilter ===\n      TextureMinificationFilter.NEAREST_MIPMAP_NEAREST ||\n    textureMinificationFilter ===\n      TextureMinificationFilter.LINEAR_MIPMAP_NEAREST ||\n    textureMinificationFilter ===\n      TextureMinificationFilter.NEAREST_MIPMAP_LINEAR ||\n    textureMinificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_LINEAR\n  );\n};\n\nexport default Object.freeze(TextureMinificationFilter);\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * @private\n */\nconst TextureWrap = {\n  CLAMP_TO_EDGE: WebGLConstants.CLAMP_TO_EDGE,\n  REPEAT: WebGLConstants.REPEAT,\n  MIRRORED_REPEAT: WebGLConstants.MIRRORED_REPEAT,\n\n  validate: function (textureWrap) {\n    return (\n      textureWrap === TextureWrap.CLAMP_TO_EDGE ||\n      textureWrap === TextureWrap.REPEAT ||\n      textureWrap === TextureWrap.MIRRORED_REPEAT\n    );\n  },\n};\nexport default Object.freeze(TextureWrap);\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport TextureMagnificationFilter from \"./TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"./TextureMinificationFilter.js\";\nimport TextureWrap from \"./TextureWrap.js\";\n\n/**\n * @private\n */\nfunction Sampler(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const wrapS = defaultValue(options.wrapS, TextureWrap.CLAMP_TO_EDGE);\n  const wrapT = defaultValue(options.wrapT, TextureWrap.CLAMP_TO_EDGE);\n  const minificationFilter = defaultValue(\n    options.minificationFilter,\n    TextureMinificationFilter.LINEAR\n  );\n  const magnificationFilter = defaultValue(\n    options.magnificationFilter,\n    TextureMagnificationFilter.LINEAR\n  );\n  const maximumAnisotropy = defined(options.maximumAnisotropy)\n    ? options.maximumAnisotropy\n    : 1.0;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!TextureWrap.validate(wrapS)) {\n    throw new DeveloperError(\"Invalid sampler.wrapS.\");\n  }\n\n  if (!TextureWrap.validate(wrapT)) {\n    throw new DeveloperError(\"Invalid sampler.wrapT.\");\n  }\n\n  if (!TextureMinificationFilter.validate(minificationFilter)) {\n    throw new DeveloperError(\"Invalid sampler.minificationFilter.\");\n  }\n\n  if (!TextureMagnificationFilter.validate(magnificationFilter)) {\n    throw new DeveloperError(\"Invalid sampler.magnificationFilter.\");\n  }\n\n  Check.typeOf.number.greaterThanOrEquals(\n    \"maximumAnisotropy\",\n    maximumAnisotropy,\n    1.0\n  );\n  //>>includeEnd('debug');\n\n  this._wrapS = wrapS;\n  this._wrapT = wrapT;\n  this._minificationFilter = minificationFilter;\n  this._magnificationFilter = magnificationFilter;\n  this._maximumAnisotropy = maximumAnisotropy;\n}\n\nObject.defineProperties(Sampler.prototype, {\n  wrapS: {\n    get: function () {\n      return this._wrapS;\n    },\n  },\n  wrapT: {\n    get: function () {\n      return this._wrapT;\n    },\n  },\n  minificationFilter: {\n    get: function () {\n      return this._minificationFilter;\n    },\n  },\n  magnificationFilter: {\n    get: function () {\n      return this._magnificationFilter;\n    },\n  },\n  maximumAnisotropy: {\n    get: function () {\n      return this._maximumAnisotropy;\n    },\n  },\n});\n\nSampler.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left._wrapS === right._wrapS &&\n      left._wrapT === right._wrapT &&\n      left._minificationFilter === right._minificationFilter &&\n      left._magnificationFilter === right._magnificationFilter &&\n      left._maximumAnisotropy === right._maximumAnisotropy)\n  );\n};\n\nSampler.NEAREST = Object.freeze(\n  new Sampler({\n    wrapS: TextureWrap.CLAMP_TO_EDGE,\n    wrapT: TextureWrap.CLAMP_TO_EDGE,\n    minificationFilter: TextureMinificationFilter.NEAREST,\n    magnificationFilter: TextureMagnificationFilter.NEAREST,\n  })\n);\nexport default Sampler;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport ContextLimits from \"./ContextLimits.js\";\nimport CubeMapFace from \"./CubeMapFace.js\";\nimport MipmapHint from \"./MipmapHint.js\";\nimport PixelDatatype from \"./PixelDatatype.js\";\nimport Sampler from \"./Sampler.js\";\nimport TextureMagnificationFilter from \"./TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"./TextureMinificationFilter.js\";\n\n/**\n * @private\n */\nfunction CubeMap(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.context\", options.context);\n  //>>includeEnd('debug');\n\n  const context = options.context;\n  const source = options.source;\n  let width;\n  let height;\n\n  if (defined(source)) {\n    const faces = [\n      source.positiveX,\n      source.negativeX,\n      source.positiveY,\n      source.negativeY,\n      source.positiveZ,\n      source.negativeZ,\n    ];\n\n    //>>includeStart('debug', pragmas.debug);\n    if (\n      !faces[0] ||\n      !faces[1] ||\n      !faces[2] ||\n      !faces[3] ||\n      !faces[4] ||\n      !faces[5]\n    ) {\n      throw new DeveloperError(\n        \"options.source requires positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ faces.\"\n      );\n    }\n    //>>includeEnd('debug');\n\n    width = faces[0].width;\n    height = faces[0].height;\n\n    //>>includeStart('debug', pragmas.debug);\n    for (let i = 1; i < 6; ++i) {\n      if (\n        Number(faces[i].width) !== width ||\n        Number(faces[i].height) !== height\n      ) {\n        throw new DeveloperError(\n          \"Each face in options.source must have the same width and height.\"\n        );\n      }\n    }\n    //>>includeEnd('debug');\n  } else {\n    width = options.width;\n    height = options.height;\n  }\n\n  const size = width;\n  const pixelDatatype = defaultValue(\n    options.pixelDatatype,\n    PixelDatatype.UNSIGNED_BYTE\n  );\n  const pixelFormat = defaultValue(options.pixelFormat, PixelFormat.RGBA);\n  const internalFormat = PixelFormat.toInternalFormat(\n    pixelFormat,\n    pixelDatatype,\n    context\n  );\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(width) || !defined(height)) {\n    throw new DeveloperError(\n      \"options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.\"\n    );\n  }\n\n  if (width !== height) {\n    throw new DeveloperError(\"Width must equal height.\");\n  }\n\n  if (size <= 0) {\n    throw new DeveloperError(\"Width and height must be greater than zero.\");\n  }\n\n  if (size > ContextLimits.maximumCubeMapSize) {\n    throw new DeveloperError(\n      `Width and height must be less than or equal to the maximum cube map size (${ContextLimits.maximumCubeMapSize}).  Check maximumCubeMapSize.`\n    );\n  }\n\n  if (!PixelFormat.validate(pixelFormat)) {\n    throw new DeveloperError(\"Invalid options.pixelFormat.\");\n  }\n\n  if (PixelFormat.isDepthFormat(pixelFormat)) {\n    throw new DeveloperError(\n      \"options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.\"\n    );\n  }\n\n  if (!PixelDatatype.validate(pixelDatatype)) {\n    throw new DeveloperError(\"Invalid options.pixelDatatype.\");\n  }\n\n  if (pixelDatatype === PixelDatatype.FLOAT && !context.floatingPointTexture) {\n    throw new DeveloperError(\n      \"When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.\"\n    );\n  }\n\n  if (\n    pixelDatatype === PixelDatatype.HALF_FLOAT &&\n    !context.halfFloatingPointTexture\n  ) {\n    throw new DeveloperError(\n      \"When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const sizeInBytes =\n    PixelFormat.textureSizeInBytes(pixelFormat, pixelDatatype, size, size) * 6;\n\n  // Use premultiplied alpha for opaque textures should perform better on Chrome:\n  // http://media.tojicode.com/webglCamp4/#20\n  const preMultiplyAlpha =\n    options.preMultiplyAlpha ||\n    pixelFormat === PixelFormat.RGB ||\n    pixelFormat === PixelFormat.LUMINANCE;\n  const flipY = defaultValue(options.flipY, true);\n  const skipColorSpaceConversion = defaultValue(\n    options.skipColorSpaceConversion,\n    false\n  );\n\n  const gl = context._gl;\n  const textureTarget = gl.TEXTURE_CUBE_MAP;\n  const texture = gl.createTexture();\n\n  gl.activeTexture(gl.TEXTURE0);\n  gl.bindTexture(textureTarget, texture);\n\n  function createFace(\n    target,\n    sourceFace,\n    preMultiplyAlpha,\n    flipY,\n    skipColorSpaceConversion\n  ) {\n    let arrayBufferView = sourceFace.arrayBufferView;\n    if (!defined(arrayBufferView)) {\n      arrayBufferView = sourceFace.bufferView;\n    }\n\n    let unpackAlignment = 4;\n    if (defined(arrayBufferView)) {\n      unpackAlignment = PixelFormat.alignmentInBytes(\n        pixelFormat,\n        pixelDatatype,\n        width\n      );\n    }\n\n    gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);\n\n    if (skipColorSpaceConversion) {\n      gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);\n    } else {\n      gl.pixelStorei(\n        gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,\n        gl.BROWSER_DEFAULT_WEBGL\n      );\n    }\n\n    if (defined(arrayBufferView)) {\n      gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n      gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n      if (flipY) {\n        arrayBufferView = PixelFormat.flipY(\n          arrayBufferView,\n          pixelFormat,\n          pixelDatatype,\n          size,\n          size\n        );\n      }\n      gl.texImage2D(\n        target,\n        0,\n        internalFormat,\n        size,\n        size,\n        0,\n        pixelFormat,\n        PixelDatatype.toWebGLConstant(pixelDatatype, context),\n        arrayBufferView\n      );\n    } else {\n      // Only valid for DOM-Element uploads\n      gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);\n      gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);\n\n      // Source: ImageData, HTMLImageElement, HTMLCanvasElement, or HTMLVideoElement\n      gl.texImage2D(\n        target,\n        0,\n        internalFormat,\n        pixelFormat,\n        PixelDatatype.toWebGLConstant(pixelDatatype, context),\n        sourceFace\n      );\n    }\n  }\n\n  if (defined(source)) {\n    createFace(\n      gl.TEXTURE_CUBE_MAP_POSITIVE_X,\n      source.positiveX,\n      preMultiplyAlpha,\n      flipY,\n      skipColorSpaceConversion\n    );\n    createFace(\n      gl.TEXTURE_CUBE_MAP_NEGATIVE_X,\n      source.negativeX,\n      preMultiplyAlpha,\n      flipY,\n      skipColorSpaceConversion\n    );\n    createFace(\n      gl.TEXTURE_CUBE_MAP_POSITIVE_Y,\n      source.positiveY,\n      preMultiplyAlpha,\n      flipY,\n      skipColorSpaceConversion\n    );\n    createFace(\n      gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,\n      source.negativeY,\n      preMultiplyAlpha,\n      flipY,\n      skipColorSpaceConversion\n    );\n    createFace(\n      gl.TEXTURE_CUBE_MAP_POSITIVE_Z,\n      source.positiveZ,\n      preMultiplyAlpha,\n      flipY,\n      skipColorSpaceConversion\n    );\n    createFace(\n      gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,\n      source.negativeZ,\n      preMultiplyAlpha,\n      flipY,\n      skipColorSpaceConversion\n    );\n  } else {\n    gl.texImage2D(\n      gl.TEXTURE_CUBE_MAP_POSITIVE_X,\n      0,\n      internalFormat,\n      size,\n      size,\n      0,\n      pixelFormat,\n      PixelDatatype.toWebGLConstant(pixelDatatype, context),\n      null\n    );\n    gl.texImage2D(\n      gl.TEXTURE_CUBE_MAP_NEGATIVE_X,\n      0,\n      internalFormat,\n      size,\n      size,\n      0,\n      pixelFormat,\n      PixelDatatype.toWebGLConstant(pixelDatatype, context),\n      null\n    );\n    gl.texImage2D(\n      gl.TEXTURE_CUBE_MAP_POSITIVE_Y,\n      0,\n      internalFormat,\n      size,\n      size,\n      0,\n      pixelFormat,\n      PixelDatatype.toWebGLConstant(pixelDatatype, context),\n      null\n    );\n    gl.texImage2D(\n      gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,\n      0,\n      internalFormat,\n      size,\n      size,\n      0,\n      pixelFormat,\n      PixelDatatype.toWebGLConstant(pixelDatatype, context),\n      null\n    );\n    gl.texImage2D(\n      gl.TEXTURE_CUBE_MAP_POSITIVE_Z,\n      0,\n      internalFormat,\n      size,\n      size,\n      0,\n      pixelFormat,\n      PixelDatatype.toWebGLConstant(pixelDatatype, context),\n      null\n    );\n    gl.texImage2D(\n      gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,\n      0,\n      internalFormat,\n      size,\n      size,\n      0,\n      pixelFormat,\n      PixelDatatype.toWebGLConstant(pixelDatatype, context),\n      null\n    );\n  }\n  gl.bindTexture(textureTarget, null);\n\n  this._context = context;\n  this._textureFilterAnisotropic = context._textureFilterAnisotropic;\n  this._textureTarget = textureTarget;\n  this._texture = texture;\n  this._pixelFormat = pixelFormat;\n  this._pixelDatatype = pixelDatatype;\n  this._size = size;\n  this._hasMipmap = false;\n  this._sizeInBytes = sizeInBytes;\n  this._preMultiplyAlpha = preMultiplyAlpha;\n  this._flipY = flipY;\n  this._sampler = undefined;\n\n  const initialized = defined(source);\n  this._positiveX = new CubeMapFace(\n    context,\n    texture,\n    textureTarget,\n    gl.TEXTURE_CUBE_MAP_POSITIVE_X,\n    internalFormat,\n    pixelFormat,\n    pixelDatatype,\n    size,\n    preMultiplyAlpha,\n    flipY,\n    initialized\n  );\n  this._negativeX = new CubeMapFace(\n    context,\n    texture,\n    textureTarget,\n    gl.TEXTURE_CUBE_MAP_NEGATIVE_X,\n    internalFormat,\n    pixelFormat,\n    pixelDatatype,\n    size,\n    preMultiplyAlpha,\n    flipY,\n    initialized\n  );\n  this._positiveY = new CubeMapFace(\n    context,\n    texture,\n    textureTarget,\n    gl.TEXTURE_CUBE_MAP_POSITIVE_Y,\n    internalFormat,\n    pixelFormat,\n    pixelDatatype,\n    size,\n    preMultiplyAlpha,\n    flipY,\n    initialized\n  );\n  this._negativeY = new CubeMapFace(\n    context,\n    texture,\n    textureTarget,\n    gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,\n    internalFormat,\n    pixelFormat,\n    pixelDatatype,\n    size,\n    preMultiplyAlpha,\n    flipY,\n    initialized\n  );\n  this._positiveZ = new CubeMapFace(\n    context,\n    texture,\n    textureTarget,\n    gl.TEXTURE_CUBE_MAP_POSITIVE_Z,\n    internalFormat,\n    pixelFormat,\n    pixelDatatype,\n    size,\n    preMultiplyAlpha,\n    flipY,\n    initialized\n  );\n  this._negativeZ = new CubeMapFace(\n    context,\n    texture,\n    textureTarget,\n    gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,\n    internalFormat,\n    pixelFormat,\n    pixelDatatype,\n    size,\n    preMultiplyAlpha,\n    flipY,\n    initialized\n  );\n\n  this.sampler = defined(options.sampler) ? options.sampler : new Sampler();\n}\n\nObject.defineProperties(CubeMap.prototype, {\n  positiveX: {\n    get: function () {\n      return this._positiveX;\n    },\n  },\n  negativeX: {\n    get: function () {\n      return this._negativeX;\n    },\n  },\n  positiveY: {\n    get: function () {\n      return this._positiveY;\n    },\n  },\n  negativeY: {\n    get: function () {\n      return this._negativeY;\n    },\n  },\n  positiveZ: {\n    get: function () {\n      return this._positiveZ;\n    },\n  },\n  negativeZ: {\n    get: function () {\n      return this._negativeZ;\n    },\n  },\n  sampler: {\n    get: function () {\n      return this._sampler;\n    },\n    set: function (sampler) {\n      let minificationFilter = sampler.minificationFilter;\n      let magnificationFilter = sampler.magnificationFilter;\n\n      const mipmap =\n        minificationFilter ===\n          TextureMinificationFilter.NEAREST_MIPMAP_NEAREST ||\n        minificationFilter ===\n          TextureMinificationFilter.NEAREST_MIPMAP_LINEAR ||\n        minificationFilter ===\n          TextureMinificationFilter.LINEAR_MIPMAP_NEAREST ||\n        minificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_LINEAR;\n\n      const context = this._context;\n      const pixelDatatype = this._pixelDatatype;\n\n      // float textures only support nearest filtering unless the linear extensions are supported, so override the sampler's settings\n      if (\n        (pixelDatatype === PixelDatatype.FLOAT &&\n          !context.textureFloatLinear) ||\n        (pixelDatatype === PixelDatatype.HALF_FLOAT &&\n          !context.textureHalfFloatLinear)\n      ) {\n        minificationFilter = mipmap\n          ? TextureMinificationFilter.NEAREST_MIPMAP_NEAREST\n          : TextureMinificationFilter.NEAREST;\n        magnificationFilter = TextureMagnificationFilter.NEAREST;\n      }\n\n      const gl = context._gl;\n      const target = this._textureTarget;\n\n      gl.activeTexture(gl.TEXTURE0);\n      gl.bindTexture(target, this._texture);\n      gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, minificationFilter);\n      gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, magnificationFilter);\n      gl.texParameteri(target, gl.TEXTURE_WRAP_S, sampler.wrapS);\n      gl.texParameteri(target, gl.TEXTURE_WRAP_T, sampler.wrapT);\n      if (defined(this._textureFilterAnisotropic)) {\n        gl.texParameteri(\n          target,\n          this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,\n          sampler.maximumAnisotropy\n        );\n      }\n      gl.bindTexture(target, null);\n\n      this._sampler = sampler;\n    },\n  },\n  pixelFormat: {\n    get: function () {\n      return this._pixelFormat;\n    },\n  },\n  pixelDatatype: {\n    get: function () {\n      return this._pixelDatatype;\n    },\n  },\n  width: {\n    get: function () {\n      return this._size;\n    },\n  },\n  height: {\n    get: function () {\n      return this._size;\n    },\n  },\n  sizeInBytes: {\n    get: function () {\n      if (this._hasMipmap) {\n        return Math.floor((this._sizeInBytes * 4) / 3);\n      }\n      return this._sizeInBytes;\n    },\n  },\n  preMultiplyAlpha: {\n    get: function () {\n      return this._preMultiplyAlpha;\n    },\n  },\n  flipY: {\n    get: function () {\n      return this._flipY;\n    },\n  },\n\n  _target: {\n    get: function () {\n      return this._textureTarget;\n    },\n  },\n});\n\n/**\n * Generates a complete mipmap chain for each cubemap face.\n *\n * @param {MipmapHint} [hint=MipmapHint.DONT_CARE] A performance vs. quality hint.\n *\n * @exception {DeveloperError} hint is invalid.\n * @exception {DeveloperError} This CubeMap's width must be a power of two to call generateMipmap().\n * @exception {DeveloperError} This CubeMap's height must be a power of two to call generateMipmap().\n * @exception {DeveloperError} This CubeMap was destroyed, i.e., destroy() was called.\n *\n * @example\n * // Generate mipmaps, and then set the sampler so mipmaps are used for\n * // minification when the cube map is sampled.\n * cubeMap.generateMipmap();\n * cubeMap.sampler = new Sampler({\n *   minificationFilter : Cesium.TextureMinificationFilter.NEAREST_MIPMAP_LINEAR\n * });\n */\nCubeMap.prototype.generateMipmap = function (hint) {\n  hint = defaultValue(hint, MipmapHint.DONT_CARE);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (this._size > 1 && !CesiumMath.isPowerOfTwo(this._size)) {\n    throw new DeveloperError(\n      \"width and height must be a power of two to call generateMipmap().\"\n    );\n  }\n  if (!MipmapHint.validate(hint)) {\n    throw new DeveloperError(\"hint is invalid.\");\n  }\n  //>>includeEnd('debug');\n\n  this._hasMipmap = true;\n\n  const gl = this._context._gl;\n  const target = this._textureTarget;\n  gl.hint(gl.GENERATE_MIPMAP_HINT, hint);\n  gl.activeTexture(gl.TEXTURE0);\n  gl.bindTexture(target, this._texture);\n  gl.generateMipmap(target);\n  gl.bindTexture(target, null);\n};\n\nCubeMap.prototype.isDestroyed = function () {\n  return false;\n};\n\nCubeMap.prototype.destroy = function () {\n  this._context._gl.deleteTexture(this._texture);\n  this._positiveX = destroyObject(this._positiveX);\n  this._negativeX = destroyObject(this._negativeX);\n  this._positiveY = destroyObject(this._positiveY);\n  this._negativeY = destroyObject(this._negativeY);\n  this._positiveZ = destroyObject(this._positiveZ);\n  this._negativeZ = destroyObject(this._negativeZ);\n  return destroyObject(this);\n};\nexport default CubeMap;\n", "/**\n * The state for a particular rendering pass.  This is used to supplement the state\n * in a command being executed.\n *\n * @private\n * @constructor\n */\nfunction PassState(context) {\n  /**\n   * The context used to execute commands for this pass.\n   *\n   * @type {Context}\n   */\n  this.context = context;\n\n  /**\n   * The framebuffer to render to.  This framebuffer is used unless a {@link DrawCommand}\n   * or {@link ClearCommand} explicitly define a framebuffer, which is used for off-screen\n   * rendering.\n   *\n   * @type {Framebuffer}\n   * @default undefined\n   */\n  this.framebuffer = undefined;\n\n  /**\n   * When defined, this overrides the blending property of a {@link DrawCommand}'s render state.\n   * This is used to, for example, to allow the renderer to turn off blending during the picking pass.\n   * <p>\n   * When this is <code>undefined</code>, the {@link DrawCommand}'s property is used.\n   * </p>\n   *\n   * @type {boolean}\n   * @default undefined\n   */\n  this.blendingEnabled = undefined;\n\n  /**\n   * When defined, this overrides the scissor test property of a {@link DrawCommand}'s render state.\n   * This is used to, for example, to allow the renderer to scissor out the pick region during the picking pass.\n   * <p>\n   * When this is <code>undefined</code>, the {@link DrawCommand}'s property is used.\n   * </p>\n   *\n   * @type {object}\n   * @default undefined\n   */\n  this.scissorTest = undefined;\n\n  /**\n   * The viewport used when one is not defined by a {@link DrawCommand}'s render state.\n   * @type {BoundingRectangle}\n   * @default undefined\n   */\n  this.viewport = undefined;\n}\nexport default PassState;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * A built-in GLSL floating-point constant for converting radians to degrees.\\n\\\n *\\n\\\n * @alias czm_degreesPerRadian\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see CesiumMath.DEGREES_PER_RADIAN\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declaration\\n\\\n * const float czm_degreesPerRadian = ...;\\n\\\n *\\n\\\n * // Example\\n\\\n * float deg = czm_degreesPerRadian * rad;\\n\\\n */\\n\\\nconst float czm_degreesPerRadian = 57.29577951308232;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * A built-in GLSL vec2 constant for defining the depth range.\\n\\\n * This is a workaround to a bug where IE11 does not implement gl_DepthRange.\\n\\\n *\\n\\\n * @alias czm_depthRange\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declaration\\n\\\n * float depthRangeNear = czm_depthRange.near;\\n\\\n * float depthRangeFar = czm_depthRange.far;\\n\\\n *\\n\\\n */\\n\\\nconst czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * 0.1\\n\\\n *\\n\\\n * @name czm_epsilon1\\n\\\n * @glslConstant\\n\\\n */\\n\\\nconst float czm_epsilon1 = 0.1;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * 0.01\\n\\\n *\\n\\\n * @name czm_epsilon2\\n\\\n * @glslConstant\\n\\\n */\\n\\\nconst float czm_epsilon2 = 0.01;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * 0.001\\n\\\n *\\n\\\n * @name czm_epsilon3\\n\\\n * @glslConstant\\n\\\n */\\n\\\nconst float czm_epsilon3 = 0.001;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * 0.0001\\n\\\n *\\n\\\n * @name czm_epsilon4\\n\\\n * @glslConstant\\n\\\n */\\n\\\nconst float czm_epsilon4 = 0.0001;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * 0.00001\\n\\\n *\\n\\\n * @name czm_epsilon5\\n\\\n * @glslConstant\\n\\\n */\\n\\\nconst float czm_epsilon5 = 0.00001;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * 0.000001\\n\\\n *\\n\\\n * @name czm_epsilon6\\n\\\n * @glslConstant\\n\\\n */\\n\\\nconst float czm_epsilon6 = 0.000001;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * 0.0000001\\n\\\n *\\n\\\n * @name czm_epsilon7\\n\\\n * @glslConstant\\n\\\n */\\n\\\nconst float czm_epsilon7 = 0.0000001;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * DOC_TBA\\n\\\n *\\n\\\n * @name czm_infinity\\n\\\n * @glslConstant\\n\\\n */\\n\\\nconst float czm_infinity = 5906376272000.0;  // Distance from the Sun to Pluto in meters.  TODO: What is best given lowp, mediump, and highp?\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * A built-in GLSL floating-point constant for <code>1/pi</code>.\\n\\\n *\\n\\\n * @alias czm_oneOverPi\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see CesiumMath.ONE_OVER_PI\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declaration\\n\\\n * const float czm_oneOverPi = ...;\\n\\\n *\\n\\\n * // Example\\n\\\n * float pi = 1.0 / czm_oneOverPi;\\n\\\n */\\n\\\nconst float czm_oneOverPi = 0.3183098861837907;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * A built-in GLSL floating-point constant for <code>1/2pi</code>.\\n\\\n *\\n\\\n * @alias czm_oneOverTwoPi\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see CesiumMath.ONE_OVER_TWO_PI\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declaration\\n\\\n * const float czm_oneOverTwoPi = ...;\\n\\\n *\\n\\\n * // Example\\n\\\n * float pi = 2.0 * czm_oneOverTwoPi;\\n\\\n */\\n\\\nconst float czm_oneOverTwoPi = 0.15915494309189535;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}\\n\\\n *\\n\\\n * @name czm_passCesium3DTile\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see czm_pass\\n\\\n */\\n\\\nconst float czm_passCesium3DTile = 4.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION}\\n\\\n *\\n\\\n * @name czm_passCesium3DTileClassification\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see czm_pass\\n\\\n */\\n\\\nconst float czm_passCesium3DTileClassification = 5.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW}\\n\\\n *\\n\\\n * @name czm_passCesium3DTileClassificationIgnoreShow\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see czm_pass\\n\\\n */\\n\\\nconst float czm_passCesium3DTileClassificationIgnoreShow = 6.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The automatic GLSL constant for {@link Pass#CLASSIFICATION}\\n\\\n *\\n\\\n * @name czm_passClassification\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see czm_pass\\n\\\n */\\n\\\nconst float czm_passClassification = 7.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The automatic GLSL constant for {@link Pass#COMPUTE}\\n\\\n *\\n\\\n * @name czm_passCompute\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see czm_pass\\n\\\n */\\n\\\nconst float czm_passCompute = 1.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The automatic GLSL constant for {@link Pass#ENVIRONMENT}\\n\\\n *\\n\\\n * @name czm_passEnvironment\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see czm_pass\\n\\\n */\\n\\\nconst float czm_passEnvironment = 0.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The automatic GLSL constant for {@link Pass#GLOBE}\\n\\\n *\\n\\\n * @name czm_passGlobe\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see czm_pass\\n\\\n */\\n\\\nconst float czm_passGlobe = 2.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The automatic GLSL constant for {@link Pass#OPAQUE}\\n\\\n *\\n\\\n * @name czm_passOpaque\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see czm_pass\\n\\\n */\\n\\\nconst float czm_passOpaque = 7.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The automatic GLSL constant for {@link Pass#OVERLAY}\\n\\\n *\\n\\\n * @name czm_passOverlay\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see czm_pass\\n\\\n */\\n\\\nconst float czm_passOverlay = 10.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}\\n\\\n *\\n\\\n * @name czm_passTerrainClassification\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see czm_pass\\n\\\n */\\n\\\nconst float czm_passTerrainClassification = 3.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The automatic GLSL constant for {@link Pass#TRANSLUCENT}\\n\\\n *\\n\\\n * @name czm_passTranslucent\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see czm_pass\\n\\\n */\\n\\\nconst float czm_passTranslucent = 8.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The automatic GLSL constant for {@link Pass#VOXELS}\\n\\\n *\\n\\\n * @name czm_passVoxels\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see czm_pass\\n\\\n */\\n\\\nconst float czm_passVoxels = 9.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * A built-in GLSL floating-point constant for <code>Math.PI</code>.\\n\\\n *\\n\\\n * @alias czm_pi\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see CesiumMath.PI\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declaration\\n\\\n * const float czm_pi = ...;\\n\\\n *\\n\\\n * // Example\\n\\\n * float twoPi = 2.0 * czm_pi;\\n\\\n */\\n\\\nconst float czm_pi = 3.141592653589793;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * A built-in GLSL floating-point constant for <code>pi/4</code>.\\n\\\n *\\n\\\n * @alias czm_piOverFour\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see CesiumMath.PI_OVER_FOUR\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declaration\\n\\\n * const float czm_piOverFour = ...;\\n\\\n *\\n\\\n * // Example\\n\\\n * float pi = 4.0 * czm_piOverFour;\\n\\\n */\\n\\\nconst float czm_piOverFour = 0.7853981633974483;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * A built-in GLSL floating-point constant for <code>pi/6</code>.\\n\\\n *\\n\\\n * @alias czm_piOverSix\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see CesiumMath.PI_OVER_SIX\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declaration\\n\\\n * const float czm_piOverSix = ...;\\n\\\n *\\n\\\n * // Example\\n\\\n * float pi = 6.0 * czm_piOverSix;\\n\\\n */\\n\\\nconst float czm_piOverSix = 0.5235987755982988;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * A built-in GLSL floating-point constant for <code>pi/3</code>.\\n\\\n *\\n\\\n * @alias czm_piOverThree\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see CesiumMath.PI_OVER_THREE\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declaration\\n\\\n * const float czm_piOverThree = ...;\\n\\\n *\\n\\\n * // Example\\n\\\n * float pi = 3.0 * czm_piOverThree;\\n\\\n */\\n\\\nconst float czm_piOverThree = 1.0471975511965976;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * A built-in GLSL floating-point constant for <code>pi/2</code>.\\n\\\n *\\n\\\n * @alias czm_piOverTwo\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see CesiumMath.PI_OVER_TWO\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declaration\\n\\\n * const float czm_piOverTwo = ...;\\n\\\n *\\n\\\n * // Example\\n\\\n * float pi = 2.0 * czm_piOverTwo;\\n\\\n */\\n\\\nconst float czm_piOverTwo = 1.5707963267948966;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * A built-in GLSL floating-point constant for converting degrees to radians.\\n\\\n *\\n\\\n * @alias czm_radiansPerDegree\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see CesiumMath.RADIANS_PER_DEGREE\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declaration\\n\\\n * const float czm_radiansPerDegree = ...;\\n\\\n *\\n\\\n * // Example\\n\\\n * float rad = czm_radiansPerDegree * deg;\\n\\\n */\\n\\\nconst float czm_radiansPerDegree = 0.017453292519943295;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The constant identifier for the 2D {@link SceneMode}\\n\\\n *\\n\\\n * @name czm_sceneMode2D\\n\\\n * @glslConstant\\n\\\n * @see czm_sceneMode\\n\\\n * @see czm_sceneModeColumbusView\\n\\\n * @see czm_sceneMode3D\\n\\\n * @see czm_sceneModeMorphing\\n\\\n */\\n\\\nconst float czm_sceneMode2D = 2.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The constant identifier for the 3D {@link SceneMode}\\n\\\n *\\n\\\n * @name czm_sceneMode3D\\n\\\n * @glslConstant\\n\\\n * @see czm_sceneMode\\n\\\n * @see czm_sceneMode2D\\n\\\n * @see czm_sceneModeColumbusView\\n\\\n * @see czm_sceneModeMorphing\\n\\\n */\\n\\\nconst float czm_sceneMode3D = 3.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The constant identifier for the Columbus View {@link SceneMode}\\n\\\n *\\n\\\n * @name czm_sceneModeColumbusView\\n\\\n * @glslConstant\\n\\\n * @see czm_sceneMode\\n\\\n * @see czm_sceneMode2D\\n\\\n * @see czm_sceneMode3D\\n\\\n * @see czm_sceneModeMorphing\\n\\\n */\\n\\\nconst float czm_sceneModeColumbusView = 1.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The constant identifier for the Morphing {@link SceneMode}\\n\\\n *\\n\\\n * @name czm_sceneModeMorphing\\n\\\n * @glslConstant\\n\\\n * @see czm_sceneMode\\n\\\n * @see czm_sceneMode2D\\n\\\n * @see czm_sceneModeColumbusView\\n\\\n * @see czm_sceneMode3D\\n\\\n */\\n\\\nconst float czm_sceneModeMorphing = 0.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * A built-in GLSL floating-point constant for one solar radius.\\n\\\n *\\n\\\n * @alias czm_solarRadius\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see CesiumMath.SOLAR_RADIUS\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declaration\\n\\\n * const float czm_solarRadius = ...;\\n\\\n */\\n\\\nconst float czm_solarRadius = 695500000.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * A built-in GLSL floating-point constant for <code>3pi/2</code>.\\n\\\n *\\n\\\n * @alias czm_threePiOver2\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see CesiumMath.THREE_PI_OVER_TWO\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declaration\\n\\\n * const float czm_threePiOver2 = ...;\\n\\\n *\\n\\\n * // Example\\n\\\n * float pi = (2.0 / 3.0) * czm_threePiOver2;\\n\\\n */\\n\\\nconst float czm_threePiOver2 = 4.71238898038469;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * A built-in GLSL floating-point constant for <code>2pi</code>.\\n\\\n *\\n\\\n * @alias czm_twoPi\\n\\\n * @glslConstant\\n\\\n *\\n\\\n * @see CesiumMath.TWO_PI\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declaration\\n\\\n * const float czm_twoPi = ...;\\n\\\n *\\n\\\n * // Example\\n\\\n * float pi = czm_twoPi / 2.0;\\n\\\n */\\n\\\nconst float czm_twoPi = 6.283185307179586;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * The maximum latitude, in radians, both North and South, supported by a Web Mercator\\n\\\n * (EPSG:3857) projection.  Technically, the Mercator projection is defined\\n\\\n * for any latitude up to (but not including) 90 degrees, but it makes sense\\n\\\n * to cut it off sooner because it grows exponentially with increasing latitude.\\n\\\n * The logic behind this particular cutoff value, which is the one used by\\n\\\n * Google Maps, Bing Maps, and Esri, is that it makes the projection\\n\\\n * square.  That is, the rectangle is equal in the X and Y directions.\\n\\\n *\\n\\\n * The constant value is computed as follows:\\n\\\n *   czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi)))\\n\\\n *\\n\\\n * @name czm_webMercatorMaxLatitude\\n\\\n * @glslConstant\\n\\\n */\\n\\\nconst float czm_webMercatorMaxLatitude = 1.4844222297453324;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * @name czm_depthRangeStruct\\n\\\n * @glslStruct\\n\\\n */\\n\\\nstruct czm_depthRangeStruct\\n\\\n{\\n\\\n    float near;\\n\\\n    float far;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions.\\n\\\n *\\n\\\n * @name czm_material\\n\\\n * @glslStruct\\n\\\n *\\n\\\n * @property {vec3} diffuse Incoming light that scatters evenly in all directions.\\n\\\n * @property {float} specular Intensity of incoming light reflecting in a single direction.\\n\\\n * @property {float} shininess The sharpness of the specular reflection.  Higher values create a smaller, more focused specular highlight.\\n\\\n * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.\\n\\\n * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.\\n\\\n * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.\\n\\\n */\\n\\\nstruct czm_material\\n\\\n{\\n\\\n    vec3 diffuse;\\n\\\n    float specular;\\n\\\n    float shininess;\\n\\\n    vec3 normal;\\n\\\n    vec3 emission;\\n\\\n    float alpha;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Used as input to every material's czm_getMaterial function.\\n\\\n *\\n\\\n * @name czm_materialInput\\n\\\n * @glslStruct\\n\\\n *\\n\\\n * @property {float} s 1D texture coordinates.\\n\\\n * @property {vec2} st 2D texture coordinates.\\n\\\n * @property {vec3} str 3D texture coordinates.\\n\\\n * @property {vec3} normalEC Unperturbed surface normal in eye coordinates.\\n\\\n * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space.\\n\\\n * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates.  The magnitude is the distance in meters from the fragment to the eye.\\n\\\n * @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid.  Only available for globe materials.\\n\\\n * @property {float} slope The slope of the terrain in radians.  0 is flat; pi/2 is vertical.  Only available for globe materials.\\n\\\n * @property {float} aspect The aspect of the terrain in radians.  0 is East, pi/2 is North, pi is West, 3pi/2 is South.  Only available for globe materials.\\n\\\n */\\n\\\nstruct czm_materialInput\\n\\\n{\\n\\\n    float s;\\n\\\n    vec2 st;\\n\\\n    vec3 str;\\n\\\n    vec3 normalEC;\\n\\\n    mat3 tangentToEyeMatrix;\\n\\\n    vec3 positionToEyeEC;\\n\\\n    float height;\\n\\\n    float slope;\\n\\\n    float aspect;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Struct for representing a material for a {@link Model}. The model\\n\\\n * rendering pipeline will pass this struct between material, custom shaders,\\n\\\n * and lighting stages. This is not to be confused with {@link czm_material}\\n\\\n * which is used by the older Fabric materials system, although they are similar.\\n\\\n * <p>\\n\\\n * All color values (diffuse, specular, emissive) are in linear color space.\\n\\\n * </p>\\n\\\n *\\n\\\n * @name czm_modelMaterial\\n\\\n * @glslStruct\\n\\\n *\\n\\\n * @property {vec3} diffuse Incoming light that scatters evenly in all directions.\\n\\\n * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.\\n\\\n * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature.\\n\\\n * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces.\\n\\\n * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.\\n\\\n * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded.\\n\\\n * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.\\n\\\n */\\n\\\nstruct czm_modelMaterial {\\n\\\n    vec3 diffuse;\\n\\\n    float alpha;\\n\\\n    vec3 specular;\\n\\\n    float roughness;\\n\\\n    vec3 normalEC;\\n\\\n    float occlusion;\\n\\\n    vec3 emissive;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Struct for representing the output of a custom vertex shader.\\n\\\n * \\n\\\n * @name czm_modelVertexOutput\\n\\\n * @glslStruct\\n\\\n *\\n\\\n * @see {@link CustomShader}\\n\\\n * @see {@link Model}\\n\\\n *\\n\\\n * @property {vec3} positionMC The position of the vertex in model coordinates\\n\\\n * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives. \\n\\\n */\\n\\\nstruct czm_modelVertexOutput {\\n\\\n  vec3 positionMC;\\n\\\n  float pointSize;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Parameters for {@link czm_pbrLighting}\\n\\\n *\\n\\\n * @name czm_material\\n\\\n * @glslStruct\\n\\\n *\\n\\\n * @property {vec3} diffuseColor the diffuse color of the material for the lambert term of the rendering equation\\n\\\n * @property {float} roughness a value from 0.0 to 1.0 that indicates how rough the surface of the material is.\\n\\\n * @property {vec3} f0 The reflectance of the material at normal incidence\\n\\\n */\\n\\\nstruct czm_pbrParameters\\n\\\n{\\n\\\n    vec3 diffuseColor;\\n\\\n    float roughness;\\n\\\n    vec3 f0;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * DOC_TBA\\n\\\n *\\n\\\n * @name czm_ray\\n\\\n * @glslStruct\\n\\\n */\\n\\\nstruct czm_ray\\n\\\n{\\n\\\n    vec3 origin;\\n\\\n    vec3 direction;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * DOC_TBA\\n\\\n *\\n\\\n * @name czm_raySegment\\n\\\n * @glslStruct\\n\\\n */\\n\\\nstruct czm_raySegment\\n\\\n{\\n\\\n    float start;\\n\\\n    float stop;\\n\\\n};\\n\\\n\\n\\\n/**\\n\\\n * DOC_TBA\\n\\\n *\\n\\\n * @name czm_emptyRaySegment\\n\\\n * @glslConstant \\n\\\n */\\n\\\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\\n\\\n\\n\\\n/**\\n\\\n * DOC_TBA\\n\\\n *\\n\\\n * @name czm_fullRaySegment\\n\\\n * @glslConstant \\n\\\n */\\n\\\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"struct czm_shadowParameters\\n\\\n{\\n\\\n#ifdef USE_CUBE_MAP_SHADOW\\n\\\n    vec3 texCoords;\\n\\\n#else\\n\\\n    vec2 texCoords;\\n\\\n#endif\\n\\\n\\n\\\n    float depthBias;\\n\\\n    float depth;\\n\\\n    float nDotL;\\n\\\n    vec2 texelStepSize;\\n\\\n    float normalShadingSmooth;\\n\\\n    float darkness;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Converts an HSB color (hue, saturation, brightness) to RGB\\n\\\n * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}\\n\\\n *\\n\\\n * @name czm_HSBToRGB\\n\\\n * @glslFunction\\n\\\n * \\n\\\n * @param {vec3} hsb The color in HSB.\\n\\\n *\\n\\\n * @returns {vec3} The color in RGB.\\n\\\n *\\n\\\n * @example\\n\\\n * vec3 hsb = czm_RGBToHSB(rgb);\\n\\\n * hsb.z *= 0.1;\\n\\\n * rgb = czm_HSBToRGB(hsb);\\n\\\n */\\n\\\n\\n\\\nconst vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\\n\\\n\\n\\\nvec3 czm_HSBToRGB(vec3 hsb)\\n\\\n{\\n\\\n    vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\\n\\\n    return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Converts an HSL color (hue, saturation, lightness) to RGB\\n\\\n * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}\\n\\\n *\\n\\\n * @name czm_HSLToRGB\\n\\\n * @glslFunction\\n\\\n * \\n\\\n * @param {vec3} rgb The color in HSL.\\n\\\n *\\n\\\n * @returns {vec3} The color in RGB.\\n\\\n *\\n\\\n * @example\\n\\\n * vec3 hsl = czm_RGBToHSL(rgb);\\n\\\n * hsl.z *= 0.1;\\n\\\n * rgb = czm_HSLToRGB(hsl);\\n\\\n */\\n\\\n\\n\\\nvec3 hueToRGB(float hue)\\n\\\n{\\n\\\n    float r = abs(hue * 6.0 - 3.0) - 1.0;\\n\\\n    float g = 2.0 - abs(hue * 6.0 - 2.0);\\n\\\n    float b = 2.0 - abs(hue * 6.0 - 4.0);\\n\\\n    return clamp(vec3(r, g, b), 0.0, 1.0);\\n\\\n}\\n\\\n\\n\\\nvec3 czm_HSLToRGB(vec3 hsl)\\n\\\n{\\n\\\n    vec3 rgb = hueToRGB(hsl.x);\\n\\\n    float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;\\n\\\n    return (rgb - 0.5) * c + hsl.z;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Converts an RGB color to HSB (hue, saturation, brightness)\\n\\\n * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}\\n\\\n *\\n\\\n * @name czm_RGBToHSB\\n\\\n * @glslFunction\\n\\\n * \\n\\\n * @param {vec3} rgb The color in RGB.\\n\\\n *\\n\\\n * @returns {vec3} The color in HSB.\\n\\\n *\\n\\\n * @example\\n\\\n * vec3 hsb = czm_RGBToHSB(rgb);\\n\\\n * hsb.z *= 0.1;\\n\\\n * rgb = czm_HSBToRGB(hsb);\\n\\\n */\\n\\\n\\n\\\nconst vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\\n\\\n\\n\\\nvec3 czm_RGBToHSB(vec3 rgb)\\n\\\n{\\n\\\n    vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));\\n\\\n    vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));\\n\\\n\\n\\\n    float d = q.x - min(q.w, q.y);\\n\\\n    return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Converts an RGB color to HSL (hue, saturation, lightness)\\n\\\n * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}\\n\\\n *\\n\\\n * @name czm_RGBToHSL\\n\\\n * @glslFunction\\n\\\n * \\n\\\n * @param {vec3} rgb The color in RGB.\\n\\\n *\\n\\\n * @returns {vec3} The color in HSL.\\n\\\n *\\n\\\n * @example\\n\\\n * vec3 hsl = czm_RGBToHSL(rgb);\\n\\\n * hsl.z *= 0.1;\\n\\\n * rgb = czm_HSLToRGB(hsl);\\n\\\n */\\n\\\n \\n\\\nvec3 RGBtoHCV(vec3 rgb)\\n\\\n{\\n\\\n    // Based on work by Sam Hocevar and Emil Persson\\n\\\n    vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);\\n\\\n    vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);\\n\\\n    float c = q.x - min(q.w, q.y);\\n\\\n    float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);\\n\\\n    return vec3(h, c, q.x);\\n\\\n}\\n\\\n\\n\\\nvec3 czm_RGBToHSL(vec3 rgb)\\n\\\n{\\n\\\n    vec3 hcv = RGBtoHCV(rgb);\\n\\\n    float l = hcv.z - hcv.y * 0.5;\\n\\\n    float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);\\n\\\n    return vec3(hcv.x, s, l);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Converts an RGB color to CIE Yxy.\\n\\\n * <p>The conversion is described in\\n\\\n * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}\\n\\\n * </p>\\n\\\n * \\n\\\n * @name czm_RGBToXYZ\\n\\\n * @glslFunction\\n\\\n * \\n\\\n * @param {vec3} rgb The color in RGB.\\n\\\n *\\n\\\n * @returns {vec3} The color in CIE Yxy.\\n\\\n *\\n\\\n * @example\\n\\\n * vec3 xyz = czm_RGBToXYZ(rgb);\\n\\\n * xyz.x = max(xyz.x - luminanceThreshold, 0.0);\\n\\\n * rgb = czm_XYZToRGB(xyz);\\n\\\n */\\n\\\nvec3 czm_RGBToXYZ(vec3 rgb)\\n\\\n{\\n\\\n    const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\\n\\\n                              0.3576, 0.7152, 0.1192,\\n\\\n                              0.1805, 0.0722, 0.9505);\\n\\\n    vec3 xyz = RGB2XYZ * rgb;\\n\\\n    vec3 Yxy;\\n\\\n    Yxy.r = xyz.g;\\n\\\n    float temp = dot(vec3(1.0), xyz);\\n\\\n    Yxy.gb = xyz.rg / temp;\\n\\\n    return Yxy;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Converts a CIE Yxy color to RGB.\\n\\\n * <p>The conversion is described in\\n\\\n * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}\\n\\\n * </p>\\n\\\n * \\n\\\n * @name czm_XYZToRGB\\n\\\n * @glslFunction\\n\\\n * \\n\\\n * @param {vec3} Yxy The color in CIE Yxy.\\n\\\n *\\n\\\n * @returns {vec3} The color in RGB.\\n\\\n *\\n\\\n * @example\\n\\\n * vec3 xyz = czm_RGBToXYZ(rgb);\\n\\\n * xyz.x = max(xyz.x - luminanceThreshold, 0.0);\\n\\\n * rgb = czm_XYZToRGB(xyz);\\n\\\n */\\n\\\nvec3 czm_XYZToRGB(vec3 Yxy)\\n\\\n{\\n\\\n    const mat3 XYZ2RGB = mat3( 3.2405, -0.9693,  0.0556,\\n\\\n                              -1.5371,  1.8760, -0.2040,\\n\\\n                              -0.4985,  0.0416,  1.0572);\\n\\\n    vec3 xyz;\\n\\\n    xyz.r = Yxy.r * Yxy.g / Yxy.b;\\n\\\n    xyz.g = Yxy.r;\\n\\\n    xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\\n\\\n    \\n\\\n    return XYZ2RGB * xyz;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"// See:\\n\\\n//    https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/\\n\\\n\\n\\\nvec3 czm_acesTonemapping(vec3 color) {\\n\\\n    float g = 0.985;\\n\\\n    float a = 0.065;\\n\\\n    float b = 0.0001;\\n\\\n    float c = 0.433;\\n\\\n    float d = 0.238;\\n\\\n\\n\\\n    color = (color * (color + a) - b) / (color * (g * color + c) + d);\\n\\\n\\n\\\n    color = clamp(color, 0.0, 1.0);\\n\\\n\\n\\\n    return color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * @private\\n\\\n */\\n\\\nfloat czm_alphaWeight(float a)\\n\\\n{\\n\\\n    float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\\n\\\n\\n\\\n    // See Weighted Blended Order-Independent Transparency for examples of different weighting functions:\\n\\\n    // http://jcgt.org/published/0002/02/09/\\n\\\n    return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Procedural anti-aliasing by blurring two colors that meet at a sharp edge.\\n\\\n *\\n\\\n * @name czm_antialias\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec4} color1 The color on one side of the edge.\\n\\\n * @param {vec4} color2 The color on the other side of the edge.\\n\\\n * @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>.\\n\\\n * @param {float} dist The distance to the edge in texture coordinates.\\n\\\n * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors.\\n\\\n * @returns {vec4} The anti-aliased color.\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declarations\\n\\\n * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor);\\n\\\n * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist);\\n\\\n *\\n\\\n * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space\\n\\\n * float dist = abs(textureCoordinates.t - 0.5);\\n\\\n * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t));\\n\\\n * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1);\\n\\\n */\\n\\\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\\n\\\n{\\n\\\n    float val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\\n\\\n    float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\\n\\\n    val1 = val1 * (1.0 - val2);\\n\\\n    val1 = val1 * val1 * (3.0 - (2.0 * val1));\\n\\\n    val1 = pow(val1, 0.5); //makes the transition nicer\\n\\\n    \\n\\\n    vec4 midColor = (color1 + color2) * 0.5;\\n\\\n    return mix(midColor, currentColor, val1);\\n\\\n}\\n\\\n\\n\\\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\\n\\\n{\\n\\\n    return czm_antialias(color1, color2, currentColor, dist, 0.1);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Approximately computes spherical coordinates given a normal.\\n\\\n * Uses approximate inverse trigonometry for speed and consistency,\\n\\\n * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU.\\n\\\n *\\n\\\n * @name czm_approximateSphericalCoordinates\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} normal arbitrary-length normal.\\n\\\n *\\n\\\n * @returns {vec2} Approximate latitude and longitude spherical coordinates.\\n\\\n */\\n\\\nvec2 czm_approximateSphericalCoordinates(vec3 normal) {\\n\\\n    // Project into plane with vertical for latitude\\n\\\n    float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);\\n\\\n    float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);\\n\\\n    return vec2(latitudeApproximation, longitudeApproximation);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Determines if the fragment is back facing\\n\\\n *\\n\\\n * @name czm_backFacing\\n\\\n * @glslFunction \\n\\\n * \\n\\\n * @returns {bool} <code>true</code> if the fragment is back facing; otherwise, <code>false</code>.\\n\\\n */\\n\\\nbool czm_backFacing()\\n\\\n{\\n\\\n    // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494.\\n\\\n    return gl_FrontFacing == false;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Branchless ternary operator to be used when it's inexpensive to explicitly\\n\\\n * evaluate both possibilities for a float expression.\\n\\\n *\\n\\\n * @name czm_branchFreeTernary\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {bool} comparison A comparison statement\\n\\\n * @param {float} a Value to return if the comparison is true.\\n\\\n * @param {float} b Value to return if the comparison is false.\\n\\\n *\\n\\\n * @returns {float} equivalent of comparison ? a : b\\n\\\n */\\n\\\nfloat czm_branchFreeTernary(bool comparison, float a, float b) {\\n\\\n    float useA = float(comparison);\\n\\\n    return a * useA + b * (1.0 - useA);\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * Branchless ternary operator to be used when it's inexpensive to explicitly\\n\\\n * evaluate both possibilities for a vec2 expression.\\n\\\n *\\n\\\n * @name czm_branchFreeTernary\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {bool} comparison A comparison statement\\n\\\n * @param {vec2} a Value to return if the comparison is true.\\n\\\n * @param {vec2} b Value to return if the comparison is false.\\n\\\n *\\n\\\n * @returns {vec2} equivalent of comparison ? a : b\\n\\\n */\\n\\\nvec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {\\n\\\n    float useA = float(comparison);\\n\\\n    return a * useA + b * (1.0 - useA);\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * Branchless ternary operator to be used when it's inexpensive to explicitly\\n\\\n * evaluate both possibilities for a vec3 expression.\\n\\\n *\\n\\\n * @name czm_branchFreeTernary\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {bool} comparison A comparison statement\\n\\\n * @param {vec3} a Value to return if the comparison is true.\\n\\\n * @param {vec3} b Value to return if the comparison is false.\\n\\\n *\\n\\\n * @returns {vec3} equivalent of comparison ? a : b\\n\\\n */\\n\\\nvec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {\\n\\\n    float useA = float(comparison);\\n\\\n    return a * useA + b * (1.0 - useA);\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * Branchless ternary operator to be used when it's inexpensive to explicitly\\n\\\n * evaluate both possibilities for a vec4 expression.\\n\\\n *\\n\\\n * @name czm_branchFreeTernary\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {bool} comparison A comparison statement\\n\\\n * @param {vec3} a Value to return if the comparison is true.\\n\\\n * @param {vec3} b Value to return if the comparison is false.\\n\\\n *\\n\\\n * @returns {vec3} equivalent of comparison ? a : b\\n\\\n */\\n\\\nvec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {\\n\\\n    float useA = float(comparison);\\n\\\n    return a * useA + b * (1.0 - useA);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"\\n\\\nvec4 czm_cascadeColor(vec4 weights)\\n\\\n{\\n\\\n    return vec4(1.0, 0.0, 0.0, 1.0) * weights.x +\\n\\\n           vec4(0.0, 1.0, 0.0, 1.0) * weights.y +\\n\\\n           vec4(0.0, 0.0, 1.0, 1.0) * weights.z +\\n\\\n           vec4(1.0, 0.0, 1.0, 1.0) * weights.w;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"\\n\\\nuniform vec4 shadowMap_cascadeDistances;\\n\\\n\\n\\\nfloat czm_cascadeDistance(vec4 weights)\\n\\\n{\\n\\\n    return dot(shadowMap_cascadeDistances, weights);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"\\n\\\nuniform mat4 shadowMap_cascadeMatrices[4];\\n\\\n\\n\\\nmat4 czm_cascadeMatrix(vec4 weights)\\n\\\n{\\n\\\n    return shadowMap_cascadeMatrices[0] * weights.x +\\n\\\n           shadowMap_cascadeMatrices[1] * weights.y +\\n\\\n           shadowMap_cascadeMatrices[2] * weights.z +\\n\\\n           shadowMap_cascadeMatrices[3] * weights.w;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"\\n\\\nuniform vec4 shadowMap_cascadeSplits[2];\\n\\\n\\n\\\nvec4 czm_cascadeWeights(float depthEye)\\n\\\n{\\n\\\n    // One component is set to 1.0 and all others set to 0.0.\\n\\\n    vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));\\n\\\n    vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);\\n\\\n    return near * far;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * DOC_TBA\\n\\\n *\\n\\\n * @name czm_columbusViewMorph\\n\\\n * @glslFunction\\n\\\n */\\n\\\nvec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\\n\\\n{\\n\\\n    // Just linear for now.\\n\\\n    vec3 p = mix(position2D.xyz, position3D.xyz, time);\\n\\\n    return vec4(p, 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Returns a position in model coordinates relative to eye taking into\\n\\\n * account the current scene mode: 3D, 2D, or Columbus view.\\n\\\n * <p>\\n\\\n * This uses standard position attributes, <code>position3DHigh</code>, \\n\\\n * <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>, \\n\\\n * and should be used when writing a vertex shader for an {@link Appearance}.\\n\\\n * </p>\\n\\\n *\\n\\\n * @name czm_computePosition\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @returns {vec4} The position relative to eye.\\n\\\n *\\n\\\n * @example\\n\\\n * vec4 p = czm_computePosition();\\n\\\n * v_positionEC = (czm_modelViewRelativeToEye * p).xyz;\\n\\\n * gl_Position = czm_modelViewProjectionRelativeToEye * p;\\n\\\n *\\n\\\n * @see czm_translateRelativeToEye\\n\\\n */\\n\\\nvec4 czm_computePosition();\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * @private\\n\\\n */\\n\\\nvec2 cordic(float angle)\\n\\\n{\\n\\\n// Scale the vector by the appropriate factor for the 24 iterations to follow.\\n\\\n    vec2 vector = vec2(6.0725293500888267e-1, 0.0);\\n\\\n// Iteration 1\\n\\\n    float sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n //   float factor = sense * 1.0;  // 2^-0\\n\\\n    mat2 rotation = mat2(1.0, sense, -sense, 1.0);\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 7.8539816339744828e-1;  // atan(2^-0)\\n\\\n// Iteration 2\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    float factor = sense * 5.0e-1;  // 2^-1\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 4.6364760900080609e-1;  // atan(2^-1)\\n\\\n// Iteration 3\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 2.5e-1;  // 2^-2\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 2.4497866312686414e-1;  // atan(2^-2)\\n\\\n// Iteration 4\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 1.25e-1;  // 2^-3\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 1.2435499454676144e-1;  // atan(2^-3)\\n\\\n// Iteration 5\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 6.25e-2;  // 2^-4\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 6.2418809995957350e-2;  // atan(2^-4)\\n\\\n// Iteration 6\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 3.125e-2;  // 2^-5\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 3.1239833430268277e-2;  // atan(2^-5)\\n\\\n// Iteration 7\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 1.5625e-2;  // 2^-6\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 1.5623728620476831e-2;  // atan(2^-6)\\n\\\n// Iteration 8\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 7.8125e-3;  // 2^-7\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 7.8123410601011111e-3;  // atan(2^-7)\\n\\\n// Iteration 9\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 3.90625e-3;  // 2^-8\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 3.9062301319669718e-3;  // atan(2^-8)\\n\\\n// Iteration 10\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 1.953125e-3;  // 2^-9\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 1.9531225164788188e-3;  // atan(2^-9)\\n\\\n// Iteration 11\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 9.765625e-4;  // 2^-10\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 9.7656218955931946e-4;  // atan(2^-10)\\n\\\n// Iteration 12\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 4.8828125e-4;  // 2^-11\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 4.8828121119489829e-4;  // atan(2^-11)\\n\\\n// Iteration 13\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 2.44140625e-4;  // 2^-12\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 2.4414062014936177e-4;  // atan(2^-12)\\n\\\n// Iteration 14\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 1.220703125e-4;  // 2^-13\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 1.2207031189367021e-4;  // atan(2^-13)\\n\\\n// Iteration 15\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 6.103515625e-5;  // 2^-14\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 6.1035156174208773e-5;  // atan(2^-14)\\n\\\n// Iteration 16\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 3.0517578125e-5;  // 2^-15\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 3.0517578115526096e-5;  // atan(2^-15)\\n\\\n// Iteration 17\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 1.52587890625e-5;  // 2^-16\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 1.5258789061315762e-5;  // atan(2^-16)\\n\\\n// Iteration 18\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 7.62939453125e-6;  // 2^-17\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 7.6293945311019700e-6;  // atan(2^-17)\\n\\\n// Iteration 19\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 3.814697265625e-6;  // 2^-18\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 3.8146972656064961e-6;  // atan(2^-18)\\n\\\n// Iteration 20\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 1.9073486328125e-6;  // 2^-19\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 1.9073486328101870e-6;  // atan(2^-19)\\n\\\n// Iteration 21\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 9.5367431640625e-7;  // 2^-20\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 9.5367431640596084e-7;  // atan(2^-20)\\n\\\n// Iteration 22\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 4.76837158203125e-7;  // 2^-21\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 4.7683715820308884e-7;  // atan(2^-21)\\n\\\n// Iteration 23\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 2.384185791015625e-7;  // 2^-22\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n    angle -= sense * 2.3841857910155797e-7;  // atan(2^-22)\\n\\\n// Iteration 24\\n\\\n    sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\n    factor = sense * 1.1920928955078125e-7;  // 2^-23\\n\\\n    rotation[0][1] = factor;\\n\\\n    rotation[1][0] = -factor;\\n\\\n    vector = rotation * vector;\\n\\\n//    angle -= sense * 1.1920928955078068e-7;  // atan(2^-23)\\n\\\n\\n\\\n    return vector;\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * Computes the cosine and sine of the provided angle using the CORDIC algorithm.\\n\\\n *\\n\\\n * @name czm_cosineAndSine\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {float} angle The angle in radians.\\n\\\n *\\n\\\n * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate).\\n\\\n *\\n\\\n * @example\\n\\\n * vec2 v = czm_cosineAndSine(czm_piOverSix);\\n\\\n * float cosine = v.x;\\n\\\n * float sine = v.y;\\n\\\n */\\n\\\nvec2 czm_cosineAndSine(float angle)\\n\\\n{\\n\\\n    if (angle < -czm_piOverTwo || angle > czm_piOverTwo)\\n\\\n    {\\n\\\n        if (angle < 0.0)\\n\\\n        {\\n\\\n            return -cordic(angle + czm_pi);\\n\\\n        }\\n\\\n        else\\n\\\n        {\\n\\\n            return -cordic(angle - czm_pi);\\n\\\n        }\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        return cordic(angle);\\n\\\n    }\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Decompresses texture coordinates that were packed into a single float.\\n\\\n *\\n\\\n * @name czm_decompressTextureCoordinates\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {float} encoded The compressed texture coordinates.\\n\\\n * @returns {vec2} The decompressed texture coordinates.\\n\\\n */\\n\\\n vec2 czm_decompressTextureCoordinates(float encoded)\\n\\\n {\\n\\\n    float temp = encoded / 4096.0;\\n\\\n    float xZeroTo4095 = floor(temp);\\n\\\n    float stx = xZeroTo4095 / 4095.0;\\n\\\n    float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\\n\\\n    return vec2(stx, sty);\\n\\\n }\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Get default parameters for physically based rendering. These defaults\\n\\\n * describe a rough dielectric (non-metal) surface (e.g. rough plastic).\\n\\\n *\\n\\\n * @return {czm_pbrParameters} Default parameters for {@link czm_pbrLighting}\\n\\\n */\\n\\\nczm_pbrParameters czm_defaultPbrMaterial()\\n\\\n{\\n\\\n    czm_pbrParameters results;\\n\\\n    results.diffuseColor = vec3(1.0);\\n\\\n    results.roughness = 1.0;\\n\\\n\\n\\\n    const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);\\n\\\n    results.f0 = REFLECTANCE_DIELECTRIC;\\n\\\n    return results;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"// emulated noperspective\\n\\\n#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH)\\n\\\nout float v_WindowZ;\\n\\\n#endif\\n\\\n\\n\\\n/**\\n\\\n * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2.\\n\\\n * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes, \\n\\\n * capping the shadow volume. More information here: \\n\\\n * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt.\\n\\\n *\\n\\\n * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring \\n\\\n * no geometry gets clipped by setting the clip space z value to 0.0 and then\\n\\\n * sending the unaltered screen space z value (using emulated noperspective\\n\\\n * interpolation) to the frag shader where it is clamped to [0,1] and then\\n\\\n * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on:\\n\\\n * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv.\\n\\\n *\\n\\\n * When GL_EXT_frag_depth is not available, which is the case on some mobile \\n\\\n * devices, we must attempt to fix this only in the vertex shader. \\n\\\n * The approach is to clamp the z value to the far plane, which closes the \\n\\\n * shadow volume but also distorts the geometry, so there can still be artifacts\\n\\\n * on frustum seams.\\n\\\n *\\n\\\n * @name czm_depthClamp\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec4} coords The vertex in clip coordinates.\\n\\\n * @returns {vec4} The modified vertex.\\n\\\n *\\n\\\n * @example\\n\\\n * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0));\\n\\\n *\\n\\\n * @see czm_writeDepthClamp\\n\\\n */\\n\\\nvec4 czm_depthClamp(vec4 coords)\\n\\\n{\\n\\\n#ifndef LOG_DEPTH\\n\\\n#if __VERSION__ == 300 || defined(GL_EXT_frag_depth)\\n\\\n    v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;\\n\\\n    coords.z = 0.0;\\n\\\n#else\\n\\\n    coords.z = min(coords.z, coords.w);\\n\\\n#endif\\n\\\n#endif\\n\\\n    return coords;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system \\n\\\n * to eye coordinates.  In east-north-up coordinates, x points east, y points north, and z points along the \\n\\\n * surface normal.  East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping.\\n\\\n * <br /><br />\\n\\\n * The ellipsoid is assumed to be centered at the model coordinate's origin.\\n\\\n *\\n\\\n * @name czm_eastNorthUpToEyeCoordinates\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} positionMC The position on the ellipsoid in model coordinates.\\n\\\n * @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates.\\n\\\n *\\n\\\n * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates.\\n\\\n *\\n\\\n * @example\\n\\\n * // Transform a vector defined in the east-north-up coordinate \\n\\\n * // system, (0, 0, 1) which is the surface normal, to eye \\n\\\n * // coordinates.\\n\\\n * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\\n\\\n * vec3 normalEC = m * vec3(0.0, 0.0, 1.0);\\n\\\n */\\n\\\nmat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\\n\\\n{\\n\\\n    vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));  // normalized surface tangent in model coordinates\\n\\\n    vec3 tangentEC = normalize(czm_normal3D * tangentMC);                // normalized surface tangent in eye coordinates\\n\\\n    vec3 bitangentEC = normalize(cross(normalEC, tangentEC));            // normalized surface bitangent in eye coordinates\\n\\\n\\n\\\n    return mat3(\\n\\\n        tangentEC.x,   tangentEC.y,   tangentEC.z,\\n\\\n        bitangentEC.x, bitangentEC.y, bitangentEC.z,\\n\\\n        normalEC.x,    normalEC.y,    normalEC.z);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * DOC_TBA\\n\\\n *\\n\\\n * @name czm_ellipsoidContainsPoint\\n\\\n * @glslFunction\\n\\\n *\\n\\\n */\\n\\\nbool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)\\n\\\n{\\n\\\n    vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\\n\\\n    return (dot(scaled, scaled) <= 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * DOC_TBA\\n\\\n *\\n\\\n * @name czm_ellipsoidWgs84TextureCoordinates\\n\\\n * @glslFunction\\n\\\n */\\n\\\nvec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\\n\\\n{\\n\\\n    return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code>\\n\\\n * if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs\\n\\\n * <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s,\\n\\\n * <code>vec3</code>s, or <code>vec4</code>s.\\n\\\n *\\n\\\n * @name czm_equalsEpsilon\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {} left The first vector.\\n\\\n * @param {} right The second vector.\\n\\\n * @param {float} epsilon The epsilon to use for equality testing.\\n\\\n * @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise.\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declarations\\n\\\n * bool czm_equalsEpsilon(float left, float right, float epsilon);\\n\\\n * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon);\\n\\\n * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon);\\n\\\n * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon);\\n\\\n */\\n\\\nbool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\\n\\\n    return all(lessThanEqual(abs(left - right), vec4(epsilon)));\\n\\\n}\\n\\\n\\n\\\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\\n\\\n    return all(lessThanEqual(abs(left - right), vec3(epsilon)));\\n\\\n}\\n\\\n\\n\\\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\\n\\\n    return all(lessThanEqual(abs(left - right), vec2(epsilon)));\\n\\\n}\\n\\\n\\n\\\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\\n\\\n    return (abs(left - right) <= epsilon);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * DOC_TBA\\n\\\n *\\n\\\n * @name czm_eyeOffset\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec4} positionEC DOC_TBA.\\n\\\n * @param {vec3} eyeOffset DOC_TBA.\\n\\\n *\\n\\\n * @returns {vec4} DOC_TBA.\\n\\\n */\\n\\\nvec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\\n\\\n{\\n\\\n    // This equation is approximate in x and y.\\n\\\n    vec4 p = positionEC;\\n\\\n    vec4 zEyeOffset = normalize(p) * eyeOffset.z;\\n\\\n    p.xy += eyeOffset.xy + zEyeOffset.xy;\\n\\\n    p.z += zEyeOffset.z;\\n\\\n    return p;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Transforms a position from eye to window coordinates.  The transformation\\n\\\n * from eye to clip coordinates is done using {@link czm_projection}.\\n\\\n * The transform from normalized device coordinates to window coordinates is\\n\\\n * done using {@link czm_viewportTransformation}, which assumes a depth range\\n\\\n * of <code>near = 0</code> and <code>far = 1</code>.\\n\\\n * <br /><br />\\n\\\n * This transform is useful when there is a need to manipulate window coordinates\\n\\\n * in a vertex shader as done by {@link BillboardCollection}.\\n\\\n *\\n\\\n * @name czm_eyeToWindowCoordinates\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec4} position The position in eye coordinates to transform.\\n\\\n *\\n\\\n * @returns {vec4} The transformed position in window coordinates.\\n\\\n *\\n\\\n * @see czm_modelToWindowCoordinates\\n\\\n * @see czm_projection\\n\\\n * @see czm_viewportTransformation\\n\\\n * @see BillboardCollection\\n\\\n *\\n\\\n * @example\\n\\\n * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\\n\\\n */\\n\\\nvec4 czm_eyeToWindowCoordinates(vec4 positionEC)\\n\\\n{\\n\\\n    vec4 q = czm_projection * positionEC;                        // clip coordinates\\n\\\n    q.xyz /= q.w;                                                // normalized device coordinates\\n\\\n    q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates\\n\\\n    return q;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input.\\n\\\n *\\n\\\n * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on\\n\\\n * \\\"Efficient approximations for the arctangent function,\\\" Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.\\n\\\n * Adapted from ShaderFastLibs under MIT License.\\n\\\n *\\n\\\n * Chosen for the following characteristics over range [0, 1]:\\n\\\n * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan)\\n\\\n * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator)\\n\\\n *\\n\\\n * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301);\\n\\\n * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2.\\n\\\n *\\n\\\n * @name czm_fastApproximateAtan\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {float} x Value between 0 and 1 inclusive.\\n\\\n *\\n\\\n * @returns {float} Approximation of atan(x)\\n\\\n */\\n\\\nfloat czm_fastApproximateAtan(float x) {\\n\\\n    return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * Approximation of atan2.\\n\\\n *\\n\\\n * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html\\n\\\n * However, we replaced their atan curve with Michael Drobot's (see above).\\n\\\n *\\n\\\n * @name czm_fastApproximateAtan\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {float} x Value between -1 and 1 inclusive.\\n\\\n * @param {float} y Value between -1 and 1 inclusive.\\n\\\n *\\n\\\n * @returns {float} Approximation of atan2(x, y)\\n\\\n */\\n\\\nfloat czm_fastApproximateAtan(float x, float y) {\\n\\\n    // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications.\\n\\\n    // So range-reduce using abs and by flipping whether x or y is on top.\\n\\\n    float t = abs(x); // t used as swap and atan result.\\n\\\n    float opposite = abs(y);\\n\\\n    float adjacent = max(t, opposite);\\n\\\n    opposite = min(t, opposite);\\n\\\n\\n\\\n    t = czm_fastApproximateAtan(opposite / adjacent);\\n\\\n\\n\\\n    // Undo range reduction\\n\\\n    t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);\\n\\\n    t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);\\n\\\n    t = czm_branchFreeTernary(y < 0.0, -t, t);\\n\\\n    return t;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Gets the color with fog at a distance from the camera.\\n\\\n *\\n\\\n * @name czm_fog\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {float} distanceToCamera The distance to the camera in meters.\\n\\\n * @param {vec3} color The original color.\\n\\\n * @param {vec3} fogColor The color of the fog.\\n\\\n *\\n\\\n * @returns {vec3} The color adjusted for fog at the distance from the camera.\\n\\\n */\\n\\\nvec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\\n\\\n{\\n\\\n    float scalar = distanceToCamera * czm_fogDensity;\\n\\\n    float fog = 1.0 - exp(-(scalar * scalar));\\n\\\n    return mix(color, fogColor, fog);\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * Gets the color with fog at a distance from the camera.\\n\\\n *\\n\\\n * @name czm_fog\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {float} distanceToCamera The distance to the camera in meters.\\n\\\n * @param {vec3} color The original color.\\n\\\n * @param {vec3} fogColor The color of the fog.\\n\\\n * @param {float} fogModifierConstant A constant to modify the appearance of fog.\\n\\\n *\\n\\\n * @returns {vec3} The color adjusted for fog at the distance from the camera.\\n\\\n */\\n\\\nvec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)\\n\\\n{\\n\\\n    float scalar = distanceToCamera * czm_fogDensity;\\n\\\n    float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));\\n\\\n    return mix(color, fogColor, fog);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Converts a color from RGB space to linear space.\\n\\\n *\\n\\\n * @name czm_gammaCorrect\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} color The color in RGB space.\\n\\\n * @returns {vec3} The color in linear space.\\n\\\n */\\n\\\nvec3 czm_gammaCorrect(vec3 color) {\\n\\\n#ifdef HDR\\n\\\n    color = pow(color, vec3(czm_gamma));\\n\\\n#endif\\n\\\n    return color;\\n\\\n}\\n\\\n\\n\\\nvec4 czm_gammaCorrect(vec4 color) {\\n\\\n#ifdef HDR\\n\\\n    color.rgb = pow(color.rgb, vec3(czm_gamma));\\n\\\n#endif\\n\\\n    return color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * DOC_TBA\\n\\\n *\\n\\\n * @name czm_geodeticSurfaceNormal\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} positionOnEllipsoid DOC_TBA\\n\\\n * @param {vec3} ellipsoidCenter DOC_TBA\\n\\\n * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA\\n\\\n * \\n\\\n * @returns {vec3} DOC_TBA.\\n\\\n */\\n\\\nvec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\\n\\\n{\\n\\\n    return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * An czm_material with default values. Every material's czm_getMaterial\\n\\\n * should use this default material as a base for the material it returns.\\n\\\n * The default normal value is given by materialInput.normalEC.\\n\\\n *\\n\\\n * @name czm_getDefaultMaterial\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {czm_materialInput} input The input used to construct the default material.\\n\\\n *\\n\\\n * @returns {czm_material} The default material.\\n\\\n *\\n\\\n * @see czm_materialInput\\n\\\n * @see czm_material\\n\\\n * @see czm_getMaterial\\n\\\n */\\n\\\nczm_material czm_getDefaultMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material;\\n\\\n    material.diffuse = vec3(0.0);\\n\\\n    material.specular = 0.0;\\n\\\n    material.shininess = 1.0;\\n\\\n    material.normal = materialInput.normalEC;\\n\\\n    material.emission = vec3(0.0);\\n\\\n    material.alpha = 1.0;\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Calculates the intensity of diffusely reflected light.\\n\\\n *\\n\\\n * @name czm_getLambertDiffuse\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\\n\\\n * @param {vec3} normalEC The surface normal in eye coordinates.\\n\\\n *\\n\\\n * @returns {float} The intensity of the diffuse reflection.\\n\\\n *\\n\\\n * @see czm_phong\\n\\\n *\\n\\\n * @example\\n\\\n * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);\\n\\\n * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);\\n\\\n * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);\\n\\\n */\\n\\\nfloat czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\\n\\\n{\\n\\\n    return max(dot(lightDirectionEC, normalEC), 0.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Calculates the specular intensity of reflected light.\\n\\\n *\\n\\\n * @name czm_getSpecular\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\\n\\\n * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates.\\n\\\n * @param {vec3} normalEC The surface normal in eye coordinates.\\n\\\n * @param {float} shininess The sharpness of the specular reflection.  Higher values create a smaller, more focused specular highlight.\\n\\\n *\\n\\\n * @returns {float} The intensity of the specular highlight.\\n\\\n *\\n\\\n * @see czm_phong\\n\\\n *\\n\\\n * @example\\n\\\n * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);\\n\\\n * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);\\n\\\n * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);\\n\\\n */\\n\\\nfloat czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\\n\\\n{\\n\\\n    vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\\n\\\n    float specular = max(dot(toReflectedLight, toEyeEC), 0.0);\\n\\\n\\n\\\n    // pow has undefined behavior if both parameters <= 0.\\n\\\n    // Prevent this by making sure shininess is at least czm_epsilon2.\\n\\\n    return pow(specular, max(shininess, czm_epsilon2));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * @private\\n\\\n */\\n\\\nvec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\\n\\\n{\\n\\\n    float cosAngle = cos(angleInRadians);\\n\\\n    float sinAngle = sin(angleInRadians);\\n\\\n\\n\\\n    // time dependent sampling directions\\n\\\n    vec2 s0 = vec2(1.0/17.0, 0.0);\\n\\\n    vec2 s1 = vec2(-1.0/29.0, 0.0);\\n\\\n    vec2 s2 = vec2(1.0/101.0, 1.0/59.0);\\n\\\n    vec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\\n\\\n\\n\\\n    // rotate sampling direction by specified angle\\n\\\n    s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\\n\\\n    s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\\n\\\n    s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\\n\\\n    s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\\n\\\n\\n\\\n    vec2 uv0 = (uv/103.0) + (time * s0);\\n\\\n    vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\\n\\\n    vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\\n\\\n    vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\\n\\\n\\n\\\n    uv0 = fract(uv0);\\n\\\n    uv1 = fract(uv1);\\n\\\n    uv2 = fract(uv2);\\n\\\n    uv3 = fract(uv3);\\n\\\n    vec4 noise = (texture(normalMap, uv0)) +\\n\\\n                 (texture(normalMap, uv1)) +\\n\\\n                 (texture(normalMap, uv2)) +\\n\\\n                 (texture(normalMap, uv3));\\n\\\n\\n\\\n    // average and scale to between -1 and 1\\n\\\n    return ((noise / 4.0) - 0.5) * 2.0;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Adjusts the hue of a color.\\n\\\n * \\n\\\n * @name czm_hue\\n\\\n * @glslFunction\\n\\\n * \\n\\\n * @param {vec3} rgb The color.\\n\\\n * @param {float} adjustment The amount to adjust the hue of the color in radians.\\n\\\n *\\n\\\n * @returns {float} The color with the hue adjusted.\\n\\\n *\\n\\\n * @example\\n\\\n * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi)\\n\\\n */\\n\\\nvec3 czm_hue(vec3 rgb, float adjustment)\\n\\\n{\\n\\\n    const mat3 toYIQ = mat3(0.299,     0.587,     0.114,\\n\\\n                            0.595716, -0.274453, -0.321263,\\n\\\n                            0.211456, -0.522591,  0.311135);\\n\\\n    const mat3 toRGB = mat3(1.0,  0.9563,  0.6210,\\n\\\n                            1.0, -0.2721, -0.6474,\\n\\\n                            1.0, -1.107,   1.7046);\\n\\\n    \\n\\\n    vec3 yiq = toYIQ * rgb;\\n\\\n    float hue = atan(yiq.z, yiq.y) + adjustment;\\n\\\n    float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\\n\\\n    \\n\\\n    vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\\n\\\n    return toRGB * color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Converts a color in linear space to RGB space.\\n\\\n *\\n\\\n * @name czm_inverseGamma\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} color The color in linear space.\\n\\\n * @returns {vec3} The color in RGB space.\\n\\\n */\\n\\\nvec3 czm_inverseGamma(vec3 color) {\\n\\\n    return pow(color, vec3(1.0 / czm_gamma));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Determines if a time interval is empty.\\n\\\n *\\n\\\n * @name czm_isEmpty\\n\\\n * @glslFunction \\n\\\n * \\n\\\n * @param {czm_raySegment} interval The interval to test.\\n\\\n * \\n\\\n * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.\\n\\\n *\\n\\\n * @example\\n\\\n * bool b0 = czm_isEmpty(czm_emptyRaySegment);      // true\\n\\\n * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false\\n\\\n * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.\\n\\\n */\\n\\\nbool czm_isEmpty(czm_raySegment interval)\\n\\\n{\\n\\\n    return (interval.stop < 0.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Determines if a time interval is empty.\\n\\\n *\\n\\\n * @name czm_isFull\\n\\\n * @glslFunction \\n\\\n * \\n\\\n * @param {czm_raySegment} interval The interval to test.\\n\\\n * \\n\\\n * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.\\n\\\n *\\n\\\n * @example\\n\\\n * bool b0 = czm_isEmpty(czm_emptyRaySegment);      // true\\n\\\n * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false\\n\\\n * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.\\n\\\n */\\n\\\nbool czm_isFull(czm_raySegment interval)\\n\\\n{\\n\\\n    return (interval.start == 0.0 && interval.stop == czm_infinity);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located.\\n\\\n *\\n\\\n * @name czm_latitudeToWebMercatorFraction\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {float} latitude The geodetic latitude, in radians.\\n\\\n * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle.\\n\\\n * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates.\\n\\\n *\\n\\\n * @returns {float} The fraction of the rectangle at which the latitude occurs.  If the latitude is the southern\\n\\\n *          boundary of the rectangle, the return value will be zero.  If it is the northern boundary, the return\\n\\\n *          value will be 1.0.  Latitudes in between are mapped according to the Web Mercator projection.\\n\\\n */ \\n\\\nfloat czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\\n\\\n{\\n\\\n    float sinLatitude = sin(latitude);\\n\\\n    float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\\n\\\n    \\n\\\n    return (mercatorY - southMercatorY) * oneOverMercatorHeight;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Computes distance from an point in 2D to a line in 2D.\\n\\\n *\\n\\\n * @name czm_lineDistance\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * param {vec2} point1 A point along the line.\\n\\\n * param {vec2} point2 A point along the line.\\n\\\n * param {vec2} point A point that may or may not be on the line.\\n\\\n * returns {float} The distance from the point to the line.\\n\\\n */\\n\\\nfloat czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {\\n\\\n    return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Converts a linear RGB color to an sRGB color.\\n\\\n *\\n\\\n * @param {vec3|vec4} linearIn The color in linear color space.\\n\\\n * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input.\\n\\\n */\\n\\\nvec3 czm_linearToSrgb(vec3 linearIn) \\n\\\n{\\n\\\n    return pow(linearIn, vec3(1.0/2.2));\\n\\\n}\\n\\\n\\n\\\nvec4 czm_linearToSrgb(vec4 linearIn) \\n\\\n{\\n\\\n    vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2));\\n\\\n    return vec4(srgbOut, linearIn.a);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Computes the luminance of a color. \\n\\\n *\\n\\\n * @name czm_luminance\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} rgb The color.\\n\\\n * \\n\\\n * @returns {float} The luminance.\\n\\\n *\\n\\\n * @example\\n\\\n * float light = czm_luminance(vec3(0.0)); // 0.0\\n\\\n * float dark = czm_luminance(vec3(1.0));  // ~1.0 \\n\\\n */\\n\\\nfloat czm_luminance(vec3 rgb)\\n\\\n{\\n\\\n    // Algorithm from Chapter 10 of Graphics Shaders.\\n\\\n    const vec3 W = vec3(0.2125, 0.7154, 0.0721);\\n\\\n    return dot(rgb, W);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Computes the size of a pixel in meters at a distance from the eye.\\n\\\n * <p>\\n\\\n * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel.\\n\\\n * </p>\\n\\\n * @name czm_metersPerPixel\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.\\n\\\n * @param {float} pixelRatio The scaling factor from pixel space to coordinate space\\n\\\n *\\n\\\n * @returns {float} The meters per pixel at positionEC.\\n\\\n */\\n\\\nfloat czm_metersPerPixel(vec4 positionEC, float pixelRatio)\\n\\\n{\\n\\\n    float width = czm_viewport.z;\\n\\\n    float height = czm_viewport.w;\\n\\\n    float pixelWidth;\\n\\\n    float pixelHeight;\\n\\\n\\n\\\n    float top = czm_frustumPlanes.x;\\n\\\n    float bottom = czm_frustumPlanes.y;\\n\\\n    float left = czm_frustumPlanes.z;\\n\\\n    float right = czm_frustumPlanes.w;\\n\\\n\\n\\\n    if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)\\n\\\n    {\\n\\\n        float frustumWidth = right - left;\\n\\\n        float frustumHeight = top - bottom;\\n\\\n        pixelWidth = frustumWidth / width;\\n\\\n        pixelHeight = frustumHeight / height;\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        float distanceToPixel = -positionEC.z;\\n\\\n        float inverseNear = 1.0 / czm_currentFrustum.x;\\n\\\n        float tanTheta = top * inverseNear;\\n\\\n        pixelHeight = 2.0 * distanceToPixel * tanTheta / height;\\n\\\n        tanTheta = right * inverseNear;\\n\\\n        pixelWidth = 2.0 * distanceToPixel * tanTheta / width;\\n\\\n    }\\n\\\n\\n\\\n    return max(pixelWidth, pixelHeight) * pixelRatio;\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * Computes the size of a pixel in meters at a distance from the eye.\\n\\\n * <p>\\n\\\n * Use this version when scaling by pixel ratio.\\n\\\n * </p>\\n\\\n * @name czm_metersPerPixel\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.\\n\\\n *\\n\\\n * @returns {float} The meters per pixel at positionEC.\\n\\\n */\\n\\\nfloat czm_metersPerPixel(vec4 positionEC)\\n\\\n{\\n\\\n    return czm_metersPerPixel(positionEC, czm_pixelRatio);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Transforms a position from model to window coordinates.  The transformation\\n\\\n * from model to clip coordinates is done using {@link czm_modelViewProjection}.\\n\\\n * The transform from normalized device coordinates to window coordinates is\\n\\\n * done using {@link czm_viewportTransformation}, which assumes a depth range\\n\\\n * of <code>near = 0</code> and <code>far = 1</code>.\\n\\\n * <br /><br />\\n\\\n * This transform is useful when there is a need to manipulate window coordinates\\n\\\n * in a vertex shader as done by {@link BillboardCollection}.\\n\\\n * <br /><br />\\n\\\n * This function should not be confused with {@link czm_viewportOrthographic},\\n\\\n * which is an orthographic projection matrix that transforms from window \\n\\\n * coordinates to clip coordinates.\\n\\\n *\\n\\\n * @name czm_modelToWindowCoordinates\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec4} position The position in model coordinates to transform.\\n\\\n *\\n\\\n * @returns {vec4} The transformed position in window coordinates.\\n\\\n *\\n\\\n * @see czm_eyeToWindowCoordinates\\n\\\n * @see czm_modelViewProjection\\n\\\n * @see czm_viewportTransformation\\n\\\n * @see czm_viewportOrthographic\\n\\\n * @see BillboardCollection\\n\\\n *\\n\\\n * @example\\n\\\n * vec4 positionWC = czm_modelToWindowCoordinates(positionMC);\\n\\\n */\\n\\\nvec4 czm_modelToWindowCoordinates(vec4 position)\\n\\\n{\\n\\\n    vec4 q = czm_modelViewProjection * position;                // clip coordinates\\n\\\n    q.xyz /= q.w;                                                // normalized device coordinates\\n\\\n    q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates\\n\\\n    return q;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * DOC_TBA\\n\\\n *\\n\\\n * @name czm_multiplyWithColorBalance\\n\\\n * @glslFunction\\n\\\n */\\n\\\nvec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\\n\\\n{\\n\\\n    // Algorithm from Chapter 10 of Graphics Shaders.\\n\\\n    const vec3 W = vec3(0.2125, 0.7154, 0.0721);\\n\\\n    \\n\\\n    vec3 target = left * right;\\n\\\n    float leftLuminance = dot(left, W);\\n\\\n    float rightLuminance = dot(right, W);\\n\\\n    float targetLuminance = dot(target, W);\\n\\\n    \\n\\\n    return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Computes a value that scales with distance.  The scaling is clamped at the near and\\n\\\n * far distances, and does not extrapolate.  This function works with the\\n\\\n * {@link NearFarScalar} JavaScript class.\\n\\\n *\\n\\\n * @name czm_nearFarScalar\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w).\\n\\\n * @param {float} cameraDistSq The square of the current distance from the camera.\\n\\\n *\\n\\\n * @returns {float} The value at this distance.\\n\\\n */\\n\\\nfloat czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\\n\\\n{\\n\\\n    float valueAtMin = nearFarScalar.y;\\n\\\n    float valueAtMax = nearFarScalar.w;\\n\\\n    float nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\\n\\\n    float farDistanceSq = nearFarScalar.z * nearFarScalar.z;\\n\\\n\\n\\\n    float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\\n\\\n\\n\\\n    t = pow(clamp(t, 0.0, 1.0), 0.2);\\n\\\n\\n\\\n    return mix(valueAtMin, valueAtMax, t);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \" /**\\n\\\n  * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.\\n\\\n  * The 'oct' encoding is described in \\\"A Survey of Efficient Representations of Independent Unit Vectors\\\",\\n\\\n  * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/\\n\\\n  *\\n\\\n  * @name czm_octDecode\\n\\\n  * @param {vec2} encoded The oct-encoded, unit-length vector\\n\\\n  * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.\\n\\\n  * @returns {vec3} The decoded and normalized vector\\n\\\n  */\\n\\\n  vec3 czm_octDecode(vec2 encoded, float range)\\n\\\n  {\\n\\\n      if (encoded.x == 0.0 && encoded.y == 0.0) {\\n\\\n          return vec3(0.0, 0.0, 0.0);\\n\\\n      }\\n\\\n\\n\\\n     encoded = encoded / range * 2.0 - 1.0;\\n\\\n     vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\\n\\\n     if (v.z < 0.0)\\n\\\n     {\\n\\\n         v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\\n\\\n     }\\n\\\n\\n\\\n     return normalize(v);\\n\\\n  }\\n\\\n\\n\\\n/**\\n\\\n * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.\\n\\\n * The 'oct' encoding is described in \\\"A Survey of Efficient Representations of Independent Unit Vectors\\\",\\n\\\n * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/\\n\\\n *\\n\\\n * @name czm_octDecode\\n\\\n * @param {vec2} encoded The oct-encoded, unit-length vector\\n\\\n * @returns {vec3} The decoded and normalized vector\\n\\\n */\\n\\\n vec3 czm_octDecode(vec2 encoded)\\n\\\n {\\n\\\n    return czm_octDecode(encoded, 255.0);\\n\\\n }\\n\\\n\\n\\\n /**\\n\\\n * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector.\\n\\\n * The 'oct' encoding is described in \\\"A Survey of Efficient Representations of Independent Unit Vectors\\\",\\n\\\n * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/\\n\\\n *\\n\\\n * @name czm_octDecode\\n\\\n * @param {float} encoded The oct-encoded, unit-length vector\\n\\\n * @returns {vec3} The decoded and normalized vector\\n\\\n */\\n\\\n vec3 czm_octDecode(float encoded)\\n\\\n {\\n\\\n    float temp = encoded / 256.0;\\n\\\n    float x = floor(temp);\\n\\\n    float y = (temp - x) * 256.0;\\n\\\n    return czm_octDecode(vec2(x, y));\\n\\\n }\\n\\\n\\n\\\n/**\\n\\\n * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors.\\n\\\n * The 'oct' encoding is described in \\\"A Survey of Efficient Representations of Independent Unit Vectors\\\",\\n\\\n * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/\\n\\\n *\\n\\\n * @name czm_octDecode\\n\\\n * @param {vec2} encoded The packed oct-encoded, unit-length vectors.\\n\\\n * @param {vec3} vector1 One decoded and normalized vector.\\n\\\n * @param {vec3} vector2 One decoded and normalized vector.\\n\\\n * @param {vec3} vector3 One decoded and normalized vector.\\n\\\n */\\n\\\n  void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\\n\\\n {\\n\\\n    float temp = encoded.x / 65536.0;\\n\\\n    float x = floor(temp);\\n\\\n    float encodedFloat1 = (temp - x) * 65536.0;\\n\\\n\\n\\\n    temp = encoded.y / 65536.0;\\n\\\n    float y = floor(temp);\\n\\\n    float encodedFloat2 = (temp - y) * 65536.0;\\n\\\n\\n\\\n    vector1 = czm_octDecode(encodedFloat1);\\n\\\n    vector2 = czm_octDecode(encodedFloat2);\\n\\\n    vector3 = czm_octDecode(vec2(x, y));\\n\\\n }\\n\\\n\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Packs a depth value into a vec3 that can be represented by unsigned bytes.\\n\\\n *\\n\\\n * @name czm_packDepth\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {float} depth The floating-point depth.\\n\\\n * @returns {vec3} The packed depth.\\n\\\n */\\n\\\nvec4 czm_packDepth(float depth)\\n\\\n{\\n\\\n    // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA\\n\\\n    // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/\\n\\\n    vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\\n\\\n    enc = fract(enc);\\n\\\n    enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\\n\\\n    return enc;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 lambertianDiffuse(vec3 diffuseColor)\\n\\\n{\\n\\\n    return diffuseColor / czm_pi;\\n\\\n}\\n\\\n\\n\\\nvec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)\\n\\\n{\\n\\\n    return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\\n\\\n}\\n\\\n\\n\\\nfloat smithVisibilityG1(float NdotV, float roughness)\\n\\\n{\\n\\\n    // this is the k value for direct lighting.\\n\\\n    // for image based lighting it will be roughness^2 / 2\\n\\\n    float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\\n\\\n    return NdotV / (NdotV * (1.0 - k) + k);\\n\\\n}\\n\\\n\\n\\\nfloat smithVisibilityGGX(float roughness, float NdotL, float NdotV)\\n\\\n{\\n\\\n    return (\\n\\\n        smithVisibilityG1(NdotL, roughness) *\\n\\\n        smithVisibilityG1(NdotV, roughness)\\n\\\n    );\\n\\\n}\\n\\\n\\n\\\nfloat GGX(float roughness, float NdotH)\\n\\\n{\\n\\\n    float roughnessSquared = roughness * roughness;\\n\\\n    float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\\n\\\n    return roughnessSquared / (czm_pi * f * f);\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * Compute the diffuse and specular contributions using physically based\\n\\\n * rendering. This function only handles direct lighting.\\n\\\n * <p>\\n\\\n * This function only handles the lighting calculations. Metallic/roughness\\n\\\n * and specular/glossy must be handled separately. See {@czm_pbrMetallicRoughnessMaterial}, {@czm_pbrSpecularGlossinessMaterial} and {@czm_defaultPbrMaterial}\\n\\\n * </p>\\n\\\n *\\n\\\n * @name czm_pbrlighting\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} positionEC The position of the fragment in eye coordinates\\n\\\n * @param {vec3} normalEC The surface normal in eye coordinates\\n\\\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\\n\\\n * @param {vec3} lightColorHdr radiance of the light source. This is a HDR value.\\n\\\n * @param {czm_pbrParameters} The computed PBR parameters.\\n\\\n * @return {vec3} The computed HDR color\\n\\\n *\\n\\\n * @example\\n\\\n * czm_pbrParameters pbrParameters = czm_pbrMetallicRoughnessMaterial(\\n\\\n *  baseColor,\\n\\\n *  metallic,\\n\\\n *  roughness\\n\\\n * );\\n\\\n * vec3 color = czm_pbrlighting(\\n\\\n *  positionEC,\\n\\\n *  normalEC,\\n\\\n *  lightDirectionEC,\\n\\\n *  lightColorHdr,\\n\\\n *  pbrParameters);\\n\\\n */\\n\\\nvec3 czm_pbrLighting(\\n\\\n    vec3 positionEC,\\n\\\n    vec3 normalEC,\\n\\\n    vec3 lightDirectionEC,\\n\\\n    vec3 lightColorHdr,\\n\\\n    czm_pbrParameters pbrParameters\\n\\\n)\\n\\\n{\\n\\\n    vec3 v = -normalize(positionEC);\\n\\\n    vec3 l = normalize(lightDirectionEC);\\n\\\n    vec3 h = normalize(v + l);\\n\\\n    vec3 n = normalEC;\\n\\\n    float NdotL = clamp(dot(n, l), 0.001, 1.0);\\n\\\n    float NdotV = abs(dot(n, v)) + 0.001;\\n\\\n    float NdotH = clamp(dot(n, h), 0.0, 1.0);\\n\\\n    float LdotH = clamp(dot(l, h), 0.0, 1.0);\\n\\\n    float VdotH = clamp(dot(v, h), 0.0, 1.0);\\n\\\n\\n\\\n    vec3 f0 = pbrParameters.f0;\\n\\\n    float reflectance = max(max(f0.r, f0.g), f0.b);\\n\\\n    vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\\n\\\n    vec3 F = fresnelSchlick2(f0, f90, VdotH);\\n\\\n\\n\\\n    float alpha = pbrParameters.roughness;\\n\\\n    float G = smithVisibilityGGX(alpha, NdotL, NdotV);\\n\\\n    float D = GGX(alpha, NdotH);\\n\\\n    vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\\n\\\n\\n\\\n    vec3 diffuseColor = pbrParameters.diffuseColor;\\n\\\n    // F here represents the specular contribution\\n\\\n    vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\\n\\\n\\n\\\n    // Lo = (diffuse + specular) * Li * NdotL\\n\\\n    return (diffuseContribution + specularContribution) * NdotL * lightColorHdr;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Compute parameters for physically based rendering using the\\n\\\n * metallic/roughness workflow. All inputs are linear; sRGB texture values must\\n\\\n * be decoded beforehand\\n\\\n *\\n\\\n * @name czm_pbrMetallicRoughnessMaterial\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} baseColor For dielectrics, this is the base color. For metals, this is the f0 value (reflectance at normal incidence)\\n\\\n * @param {float} metallic 0.0 indicates dielectric. 1.0 indicates metal. Values in between are allowed (e.g. to model rust or dirt);\\n\\\n * @param {float} roughness A value between 0.0 and 1.0\\n\\\n * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting}\\n\\\n */\\n\\\nczm_pbrParameters czm_pbrMetallicRoughnessMaterial(\\n\\\n    vec3 baseColor,\\n\\\n    float metallic,\\n\\\n    float roughness\\n\\\n) \\n\\\n{\\n\\\n    czm_pbrParameters results;\\n\\\n\\n\\\n    // roughness is authored as perceptual roughness\\n\\\n    // square it to get material roughness\\n\\\n    roughness = clamp(roughness, 0.0, 1.0);\\n\\\n    results.roughness = roughness * roughness;\\n\\\n\\n\\\n    // dielectrics use f0 = 0.04, metals use albedo as f0\\n\\\n    metallic = clamp(metallic, 0.0, 1.0);\\n\\\n    const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);\\n\\\n    vec3 f0 = mix(REFLECTANCE_DIELECTRIC, baseColor, metallic);\\n\\\n    results.f0 = f0;\\n\\\n\\n\\\n    // diffuse only applies to dielectrics.\\n\\\n    results.diffuseColor = baseColor * (1.0 - f0) * (1.0 - metallic);\\n\\\n\\n\\\n    return results;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Compute parameters for physically based rendering using the\\n\\\n * specular/glossy workflow. All inputs are linear; sRGB texture values must\\n\\\n * be decoded beforehand\\n\\\n *\\n\\\n * @name czm_pbrSpecularGlossinessMaterial\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} diffuse The diffuse color for dielectrics (non-metals)\\n\\\n * @param {vec3} specular The reflectance at normal incidence (f0)\\n\\\n * @param {float} glossiness A number from 0.0 to 1.0 indicating how smooth the surface is.\\n\\\n * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting}\\n\\\n */\\n\\\nczm_pbrParameters czm_pbrSpecularGlossinessMaterial(\\n\\\n    vec3 diffuse,\\n\\\n    vec3 specular,\\n\\\n    float glossiness\\n\\\n) \\n\\\n{\\n\\\n    czm_pbrParameters results;\\n\\\n\\n\\\n    // glossiness is the opposite of roughness, but easier for artists to use.\\n\\\n    float roughness = 1.0 - glossiness;\\n\\\n    results.roughness = roughness * roughness;\\n\\\n\\n\\\n    results.diffuseColor = diffuse * (1.0 - max(max(specular.r, specular.g), specular.b));\\n\\\n    results.f0 = specular;\\n\\\n\\n\\\n    return results;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\\n\\\n{\\n\\\n    return czm_getLambertDiffuse(lightDirectionEC, material.normal);\\n\\\n}\\n\\\n\\n\\\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\\n\\\n{\\n\\\n    return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * Computes a color using the Phong lighting model.\\n\\\n *\\n\\\n * @name czm_phong\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates.\\n\\\n * @param {czm_material} material The fragment's material.\\n\\\n *\\n\\\n * @returns {vec4} The computed color.\\n\\\n *\\n\\\n * @example\\n\\\n * vec3 positionToEyeEC = // ...\\n\\\n * czm_material material = // ...\\n\\\n * vec3 lightDirectionEC = // ...\\n\\\n * out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC);\\n\\\n *\\n\\\n * @see czm_getMaterial\\n\\\n */\\n\\\nvec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\\n\\\n{\\n\\\n    // Diffuse from directional light sources at eye (for top-down)\\n\\\n    float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\\n\\\n    if (czm_sceneMode == czm_sceneMode3D) {\\n\\\n        // (and horizon views in 3D)\\n\\\n        diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\\n\\\n    }\\n\\\n\\n\\\n    float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\\n\\\n\\n\\\n    // Temporary workaround for adding ambient.\\n\\\n    vec3 materialDiffuse = material.diffuse * 0.5;\\n\\\n\\n\\\n    vec3 ambient = materialDiffuse;\\n\\\n    vec3 color = ambient + material.emission;\\n\\\n    color += materialDiffuse * diffuse * czm_lightColor;\\n\\\n    color += material.specular * specular * czm_lightColor;\\n\\\n\\n\\\n    return vec4(color, material.alpha);\\n\\\n}\\n\\\n\\n\\\nvec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\\n\\\n{\\n\\\n    float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);\\n\\\n    float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\\n\\\n\\n\\\n    vec3 ambient = vec3(0.0);\\n\\\n    vec3 color = ambient + material.emission;\\n\\\n    color += material.diffuse * diffuse * czm_lightColor;\\n\\\n    color += material.specular * specular * czm_lightColor;\\n\\\n\\n\\\n    return vec4(color, material.alpha);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Computes distance from a point to a plane.\\n\\\n *\\n\\\n * @name czm_planeDistance\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js\\n\\\n * param {vec3} point A point in the same space as the plane.\\n\\\n * returns {float} The distance from the point to the plane.\\n\\\n */\\n\\\nfloat czm_planeDistance(vec4 plane, vec3 point) {\\n\\\n    return (dot(plane.xyz, point) + plane.w);\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * Computes distance from a point to a plane.\\n\\\n *\\n\\\n * @name czm_planeDistance\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js\\n\\\n * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js\\n\\\n * param {vec3} point A point in the same space as the plane.\\n\\\n * returns {float} The distance from the point to the plane.\\n\\\n */\\n\\\nfloat czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {\\n\\\n    return (dot(planeNormal, point) + planeDistance);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Computes the point along a ray at the given time.  <code>time</code> can be positive, negative, or zero.\\n\\\n *\\n\\\n * @name czm_pointAlongRay\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {czm_ray} ray The ray to compute the point along.\\n\\\n * @param {float} time The time along the ray.\\n\\\n * \\n\\\n * @returns {vec3} The point along the ray at the given time.\\n\\\n * \\n\\\n * @example\\n\\\n * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction\\n\\\n * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0)\\n\\\n */\\n\\\nvec3 czm_pointAlongRay(czm_ray ray, float time)\\n\\\n{\\n\\\n    return ray.origin + (time * ray.direction);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * DOC_TBA\\n\\\n *\\n\\\n * @name czm_rayEllipsoidIntersectionInterval\\n\\\n * @glslFunction\\n\\\n */\\n\\\nczm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)\\n\\\n{\\n\\\n   // ray and ellipsoid center in eye coordinates.  radii in model coordinates.\\n\\\n    vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\\n\\\n    vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\\n\\\n\\n\\\n    q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;\\n\\\n\\n\\\n    float q2 = dot(q, q);\\n\\\n    float qw = dot(q, w);\\n\\\n\\n\\\n    if (q2 > 1.0) // Outside ellipsoid.\\n\\\n    {\\n\\\n        if (qw >= 0.0) // Looking outward or tangent (0 intersections).\\n\\\n        {\\n\\\n            return czm_emptyRaySegment;\\n\\\n        }\\n\\\n        else // qw < 0.0.\\n\\\n        {\\n\\\n            float qw2 = qw * qw;\\n\\\n            float difference = q2 - 1.0; // Positively valued.\\n\\\n            float w2 = dot(w, w);\\n\\\n            float product = w2 * difference;\\n\\\n\\n\\\n            if (qw2 < product) // Imaginary roots (0 intersections).\\n\\\n            {\\n\\\n                return czm_emptyRaySegment;\\n\\\n            }\\n\\\n            else if (qw2 > product) // Distinct roots (2 intersections).\\n\\\n            {\\n\\\n                float discriminant = qw * qw - product;\\n\\\n                float temp = -qw + sqrt(discriminant); // Avoid cancellation.\\n\\\n                float root0 = temp / w2;\\n\\\n                float root1 = difference / temp;\\n\\\n                if (root0 < root1)\\n\\\n                {\\n\\\n                    czm_raySegment i = czm_raySegment(root0, root1);\\n\\\n                    return i;\\n\\\n                }\\n\\\n                else\\n\\\n                {\\n\\\n                    czm_raySegment i = czm_raySegment(root1, root0);\\n\\\n                    return i;\\n\\\n                }\\n\\\n            }\\n\\\n            else // qw2 == product.  Repeated roots (2 intersections).\\n\\\n            {\\n\\\n                float root = sqrt(difference / w2);\\n\\\n                czm_raySegment i = czm_raySegment(root, root);\\n\\\n                return i;\\n\\\n            }\\n\\\n        }\\n\\\n    }\\n\\\n    else if (q2 < 1.0) // Inside ellipsoid (2 intersections).\\n\\\n    {\\n\\\n        float difference = q2 - 1.0; // Negatively valued.\\n\\\n        float w2 = dot(w, w);\\n\\\n        float product = w2 * difference; // Negatively valued.\\n\\\n        float discriminant = qw * qw - product;\\n\\\n        float temp = -qw + sqrt(discriminant); // Positively valued.\\n\\\n        czm_raySegment i = czm_raySegment(0.0, temp / w2);\\n\\\n        return i;\\n\\\n    }\\n\\\n    else // q2 == 1.0. On ellipsoid.\\n\\\n    {\\n\\\n        if (qw < 0.0) // Looking inward.\\n\\\n        {\\n\\\n            float w2 = dot(w, w);\\n\\\n            czm_raySegment i = czm_raySegment(0.0, -qw / w2);\\n\\\n            return i;\\n\\\n        }\\n\\\n        else // qw >= 0.0.  Looking outward or tangent.\\n\\\n        {\\n\\\n            return czm_emptyRaySegment;\\n\\\n        }\\n\\\n    }\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Compute the intersection interval of a ray with a sphere.\\n\\\n *\\n\\\n * @name czm_raySphereIntersectionInterval\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {czm_ray} ray The ray.\\n\\\n * @param {vec3} center The center of the sphere.\\n\\\n * @param {float} radius The radius of the sphere.\\n\\\n * @return {czm_raySegment} The intersection interval of the ray with the sphere.\\n\\\n */\\n\\\nczm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius)\\n\\\n{\\n\\\n    vec3 o = ray.origin;\\n\\\n    vec3 d = ray.direction;\\n\\\n\\n\\\n    vec3 oc = o - center;\\n\\\n\\n\\\n    float a = dot(d, d);\\n\\\n    float b = 2.0 * dot(d, oc);\\n\\\n    float c = dot(oc, oc) - (radius * radius);\\n\\\n\\n\\\n    float det = (b * b) - (4.0 * a * c);\\n\\\n\\n\\\n    if (det < 0.0) {\\n\\\n        return czm_emptyRaySegment;\\n\\\n    }\\n\\\n\\n\\\n    float sqrtDet = sqrt(det);\\n\\\n\\n\\\n    float t0 = (-b - sqrtDet) / (2.0 * a);\\n\\\n    float t1 = (-b + sqrtDet) / (2.0 * a);\\n\\\n\\n\\\n    czm_raySegment result = czm_raySegment(t0, t1);\\n\\\n    return result;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_readDepth(sampler2D depthTexture, vec2 texCoords)\\n\\\n{\\n\\\n    return czm_reverseLogDepth(texture(depthTexture, texCoords).r);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Reads a value previously transformed with {@link czm_writeNonPerspective}\\n\\\n * by dividing it by `w`, the value used in the perspective divide.\\n\\\n * This function is intended to be called in a fragment shader to access a\\n\\\n * `varying` that should not be subject to perspective interpolation.\\n\\\n * For example, screen-space texture coordinates. The value should have been\\n\\\n * previously written in the vertex shader with a call to\\n\\\n * {@link czm_writeNonPerspective}.\\n\\\n *\\n\\\n * @name czm_readNonPerspective\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {float|vec2|vec3|vec4} value The non-perspective value to be read.\\n\\\n * @param {float} oneOverW One over the perspective divide value, `w`. Usually this is simply `gl_FragCoord.w`.\\n\\\n * @returns {float|vec2|vec3|vec4} The usable value.\\n\\\n */\\n\\\nfloat czm_readNonPerspective(float value, float oneOverW) {\\n\\\n    return value * oneOverW;\\n\\\n}\\n\\\n\\n\\\nvec2 czm_readNonPerspective(vec2 value, float oneOverW) {\\n\\\n    return value * oneOverW;\\n\\\n}\\n\\\n\\n\\\nvec3 czm_readNonPerspective(vec3 value, float oneOverW) {\\n\\\n    return value * oneOverW;\\n\\\n}\\n\\\n\\n\\\nvec4 czm_readNonPerspective(vec4 value, float oneOverW) {\\n\\\n    return value * oneOverW;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_reverseLogDepth(float logZ)\\n\\\n{\\n\\\n#ifdef LOG_DEPTH\\n\\\n    float near = czm_currentFrustum.x;\\n\\\n    float far = czm_currentFrustum.y;\\n\\\n    float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;\\n\\\n    float depthFromNear = pow(2.0, log2Depth) - 1.0;\\n\\\n    return far * (1.0 - near / (depthFromNear + near)) / (far - near);\\n\\\n#endif\\n\\\n    return logZ;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Round a floating point value. This function exists because round() doesn't\\n\\\n * exist in GLSL 1.00. \\n\\\n *\\n\\\n * @param {float|vec2|vec3|vec4} value The value to round\\n\\\n * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input.\\n\\\n */\\n\\\nfloat czm_round(float value) {\\n\\\n  return floor(value + 0.5);\\n\\\n}\\n\\\n\\n\\\nvec2 czm_round(vec2 value) {\\n\\\n  return floor(value + 0.5);\\n\\\n}\\n\\\n\\n\\\nvec3 czm_round(vec3 value) {\\n\\\n  return floor(value + 0.5);\\n\\\n}\\n\\\n\\n\\\nvec4 czm_round(vec4 value) {\\n\\\n  return floor(value + 0.5);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Samples the 4 neighboring pixels and return the weighted average.\\n\\\n *\\n\\\n * @private\\n\\\n */\\n\\\nvec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod)\\n\\\n{\\n\\\n    direction /= dot(vec3(1.0), abs(direction));\\n\\\n    vec2 rev = abs(direction.zx) - vec2(1.0);\\n\\\n    vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x,\\n\\\n                    direction.z < 0.0 ? rev.y : -rev.y);\\n\\\n    vec2 uv = direction.y < 0.0 ? neg : direction.xz;\\n\\\n    vec2 coord = 0.5 * uv + vec2(0.5);\\n\\\n    vec2 pixel = 1.0 / textureSize;\\n\\\n\\n\\\n    if (lod > 0.0)\\n\\\n    {\\n\\\n        // Each subseqeuent mip level is half the size\\n\\\n        float scale = 1.0 / pow(2.0, lod);\\n\\\n        float offset = ((textureSize.y + 1.0) / textureSize.x);\\n\\\n\\n\\\n        coord.x *= offset;\\n\\\n        coord *= scale;\\n\\\n\\n\\\n        coord.x += offset + pixel.x;\\n\\\n        coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0;\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        coord.x *= (textureSize.y / textureSize.x);\\n\\\n    }\\n\\\n\\n\\\n    // Do bilinear filtering\\n\\\n    #ifndef OES_texture_float_linear\\n\\\n        vec3 color1 = texture(projectedMap, coord + vec2(0.0, pixel.y)).rgb;\\n\\\n        vec3 color2 = texture(projectedMap, coord + vec2(pixel.x, 0.0)).rgb;\\n\\\n        vec3 color3 = texture(projectedMap, coord + pixel).rgb;\\n\\\n        vec3 color4 = texture(projectedMap, coord).rgb;\\n\\\n\\n\\\n        vec2 texturePosition = coord * textureSize;\\n\\\n\\n\\\n        float fu = fract(texturePosition.x);\\n\\\n        float fv = fract(texturePosition.y);\\n\\\n\\n\\\n        vec3 average1 = mix(color4, color2, fu);\\n\\\n        vec3 average2 = mix(color1, color3, fu);\\n\\\n\\n\\\n        vec3 color = mix(average1, average2, fv);\\n\\\n    #else\\n\\\n        vec3 color = texture(projectedMap, coord).rgb;\\n\\\n    #endif\\n\\\n\\n\\\n    return color;\\n\\\n}\\n\\\n\\n\\\n\\n\\\n/**\\n\\\n * Samples from a cube map that has been projected using an octahedral projection from the given direction.\\n\\\n *\\n\\\n * @name czm_sampleOctahedralProjection\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {sampler2D} projectedMap The texture with the octahedral projected cube map.\\n\\\n * @param {vec2} textureSize The width and height dimensions in pixels of the projected map.\\n\\\n * @param {vec3} direction The normalized direction used to sample the cube map.\\n\\\n * @param {float} lod The level of detail to sample.\\n\\\n * @param {float} maxLod The maximum level of detail.\\n\\\n * @returns {vec3} The color of the cube map at the direction.\\n\\\n */\\n\\\nvec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) {\\n\\\n    float currentLod = floor(lod + 0.5);\\n\\\n    float nextLod = min(currentLod + 1.0, maxLod);\\n\\\n\\n\\\n    vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod);\\n\\\n    vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod);\\n\\\n\\n\\\n    return mix(colorNextLod, colorCurrentLod, nextLod - lod);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Adjusts the saturation of a color.\\n\\\n * \\n\\\n * @name czm_saturation\\n\\\n * @glslFunction\\n\\\n * \\n\\\n * @param {vec3} rgb The color.\\n\\\n * @param {float} adjustment The amount to adjust the saturation of the color.\\n\\\n *\\n\\\n * @returns {float} The color with the saturation adjusted.\\n\\\n *\\n\\\n * @example\\n\\\n * vec3 greyScale = czm_saturation(color, 0.0);\\n\\\n * vec3 doubleSaturation = czm_saturation(color, 2.0);\\n\\\n */\\n\\\nvec3 czm_saturation(vec3 rgb, float adjustment)\\n\\\n{\\n\\\n    // Algorithm from Chapter 16 of OpenGL Shading Language\\n\\\n    const vec3 W = vec3(0.2125, 0.7154, 0.0721);\\n\\\n    vec3 intensity = vec3(dot(rgb, W));\\n\\\n    return mix(intensity, rgb, adjustment);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"\\n\\\nfloat czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d)\\n\\\n{\\n\\\n    return czm_unpackDepth(czm_textureCube(shadowMap, d));\\n\\\n}\\n\\\n\\n\\\nfloat czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv)\\n\\\n{\\n\\\n#ifdef USE_SHADOW_DEPTH_TEXTURE\\n\\\n    return texture(shadowMap, uv).r;\\n\\\n#else\\n\\\n    return czm_unpackDepth(texture(shadowMap, uv));\\n\\\n#endif\\n\\\n}\\n\\\n\\n\\\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\\n\\\n{\\n\\\n    return step(depth, czm_sampleShadowMap(shadowMap, uv));\\n\\\n}\\n\\\n\\n\\\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\\n\\\n{\\n\\\n    return step(depth, czm_sampleShadowMap(shadowMap, uv));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"\\n\\\nfloat czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\\n\\\n{\\n\\\n#ifdef USE_NORMAL_SHADING\\n\\\n#ifdef USE_NORMAL_SHADING_SMOOTH\\n\\\n    float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\\n\\\n#else\\n\\\n    float strength = step(0.0, nDotL);\\n\\\n#endif\\n\\\n    visibility *= strength;\\n\\\n#endif\\n\\\n\\n\\\n    visibility = max(visibility, darkness);\\n\\\n    return visibility;\\n\\\n}\\n\\\n\\n\\\n#ifdef USE_CUBE_MAP_SHADOW\\n\\\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\\n\\\n{\\n\\\n    float depthBias = shadowParameters.depthBias;\\n\\\n    float depth = shadowParameters.depth;\\n\\\n    float nDotL = shadowParameters.nDotL;\\n\\\n    float normalShadingSmooth = shadowParameters.normalShadingSmooth;\\n\\\n    float darkness = shadowParameters.darkness;\\n\\\n    vec3 uvw = shadowParameters.texCoords;\\n\\\n\\n\\\n    depth -= depthBias;\\n\\\n    float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\\n\\\n    return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\\n\\\n}\\n\\\n#else\\n\\\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\\n\\\n{\\n\\\n    float depthBias = shadowParameters.depthBias;\\n\\\n    float depth = shadowParameters.depth;\\n\\\n    float nDotL = shadowParameters.nDotL;\\n\\\n    float normalShadingSmooth = shadowParameters.normalShadingSmooth;\\n\\\n    float darkness = shadowParameters.darkness;\\n\\\n    vec2 uv = shadowParameters.texCoords;\\n\\\n\\n\\\n    depth -= depthBias;\\n\\\n#ifdef USE_SOFT_SHADOWS\\n\\\n    vec2 texelStepSize = shadowParameters.texelStepSize;\\n\\\n    float radius = 1.0;\\n\\\n    float dx0 = -texelStepSize.x * radius;\\n\\\n    float dy0 = -texelStepSize.y * radius;\\n\\\n    float dx1 = texelStepSize.x * radius;\\n\\\n    float dy1 = texelStepSize.y * radius;\\n\\\n    float visibility = (\\n\\\n        czm_shadowDepthCompare(shadowMap, uv, depth) +\\n\\\n        czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\\n\\\n        czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\\n\\\n        czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\\n\\\n        czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\\n\\\n        czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\\n\\\n        czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\\n\\\n        czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\\n\\\n        czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\\n\\\n    ) * (1.0 / 9.0);\\n\\\n#else\\n\\\n    float visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\\n\\\n#endif\\n\\\n\\n\\\n    return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\\n\\\n}\\n\\\n#endif\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.  This is similar to the GLSL\\n\\\n * built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0.\\n\\\n * \\n\\\n * @name czm_signNotZero\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {} value The value for which to determine the sign.\\n\\\n * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative.\\n\\\n */\\n\\\nfloat czm_signNotZero(float value)\\n\\\n{\\n\\\n    return value >= 0.0 ? 1.0 : -1.0;\\n\\\n}\\n\\\n\\n\\\nvec2 czm_signNotZero(vec2 value)\\n\\\n{\\n\\\n    return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\\n\\\n}\\n\\\n\\n\\\nvec3 czm_signNotZero(vec3 value)\\n\\\n{\\n\\\n    return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\\n\\\n}\\n\\\n\\n\\\nvec4 czm_signNotZero(vec4 value)\\n\\\n{\\n\\\n    return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector.\\n\\\n * <p>\\n\\\n * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22].\\n\\\n * </p>\\n\\\n *\\n\\\n * @name czm_sphericalHarmonics\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} normal The normalized direction.\\n\\\n * @param {vec3[9]} coefficients The third order spherical harmonic coefficients.\\n\\\n * @returns {vec3} The color at the direction.\\n\\\n *\\n\\\n * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf\\n\\\n */\\n\\\nvec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])\\n\\\n{\\n\\\n    vec3 L00 = coefficients[0];\\n\\\n    vec3 L1_1 = coefficients[1];\\n\\\n    vec3 L10 = coefficients[2];\\n\\\n    vec3 L11 = coefficients[3];\\n\\\n    vec3 L2_2 = coefficients[4];\\n\\\n    vec3 L2_1 = coefficients[5];\\n\\\n    vec3 L20 = coefficients[6];\\n\\\n    vec3 L21 = coefficients[7];\\n\\\n    vec3 L22 = coefficients[8];\\n\\\n\\n\\\n    float x = normal.x;\\n\\\n    float y = normal.y;\\n\\\n    float z = normal.z;\\n\\\n\\n\\\n    return\\n\\\n          L00\\n\\\n        + L1_1 * y\\n\\\n        + L10 * z\\n\\\n        + L11 * x\\n\\\n        + L2_2 * (y * x)\\n\\\n        + L2_1 * (y * z)\\n\\\n        + L20 * (3.0 * z * z - 1.0)\\n\\\n        + L21 * (z * x)\\n\\\n        + L22 * (x * x - y * y);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Converts an sRGB color to a linear RGB color.\\n\\\n *\\n\\\n * @param {vec3|vec4} srgbIn The color in sRGB space\\n\\\n * @returns {vec3|vec4} The color in linear color space. The vector type matches the input.\\n\\\n */\\n\\\nvec3 czm_srgbToLinear(vec3 srgbIn)\\n\\\n{\\n\\\n    return pow(srgbIn, vec3(2.2));\\n\\\n}\\n\\\n\\n\\\nvec4 czm_srgbToLinear(vec4 srgbIn) \\n\\\n{\\n\\\n    vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\\n\\\n    return vec4(linearOut, srgbIn.a);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Creates a matrix that transforms vectors from tangent space to eye space.\\n\\\n *\\n\\\n * @name czm_tangentToEyeSpaceMatrix\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} normalEC The normal vector in eye coordinates.\\n\\\n * @param {vec3} tangentEC The tangent vector in eye coordinates.\\n\\\n * @param {vec3} bitangentEC The bitangent vector in eye coordinates.\\n\\\n *\\n\\\n * @returns {mat3} The matrix that transforms from tangent space to eye space.\\n\\\n *\\n\\\n * @example\\n\\\n * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC);\\n\\\n * vec3 normal = tangentToEye * texture(normalMap, st).xyz;\\n\\\n */\\n\\\nmat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)\\n\\\n{\\n\\\n    vec3 normal = normalize(normalEC);\\n\\\n    vec3 tangent = normalize(tangentEC);\\n\\\n    vec3 bitangent = normalize(bitangentEC);\\n\\\n    return mat3(tangent.x  , tangent.y  , tangent.z,\\n\\\n                bitangent.x, bitangent.y, bitangent.z,\\n\\\n                normal.x   , normal.y   , normal.z);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * A wrapper around the texture (WebGL2) / textureCube (WebGL1)\\n\\\n * function to allow for WebGL 1 support.\\n\\\n * \\n\\\n * @name czm_textureCube\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {samplerCube} sampler The sampler.\\n\\\n * @param {vec3} p The coordinates to sample the texture at.\\n\\\n */\\n\\\nvec4 czm_textureCube(samplerCube sampler, vec3 p) {\\n\\\n#if __VERSION__ == 300\\n\\\n    return texture(sampler, p);\\n\\\n#else  \\n\\\n    return textureCube(sampler, p);\\n\\\n#endif\\n\\\n}\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Transforms a plane.\\n\\\n * \\n\\\n * @name czm_transformPlane\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec4} plane The plane in Hessian Normal Form.\\n\\\n * @param {mat4} transform The inverse-transpose of a transformation matrix.\\n\\\n */\\n\\\nvec4 czm_transformPlane(vec4 plane, mat4 transform) {\\n\\\n    vec4 transformedPlane = transform * plane;\\n\\\n    // Convert the transformed plane to Hessian Normal Form\\n\\\n    float normalMagnitude = length(transformedPlane.xyz);\\n\\\n    return transformedPlane / normalMagnitude;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3},\\n\\\n * and then provided to the shader as separate <code>high</code> and <code>low</code> bits to\\n\\\n * be relative to the eye.  As shown in the example, the position can then be transformed in eye\\n\\\n * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye},\\n\\\n * respectively.\\n\\\n * <p>\\n\\\n * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as\\n\\\n * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\\n\\\n * </p>\\n\\\n *\\n\\\n * @name czm_translateRelativeToEye\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec3} high The position's high bits.\\n\\\n * @param {vec3} low The position's low bits.\\n\\\n * @returns {vec3} The position translated to be relative to the camera's position.\\n\\\n *\\n\\\n * @example\\n\\\n * in vec3 positionHigh;\\n\\\n * in vec3 positionLow;\\n\\\n *\\n\\\n * void main()\\n\\\n * {\\n\\\n *   vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\\n\\\n *   gl_Position = czm_modelViewProjectionRelativeToEye * p;\\n\\\n * }\\n\\\n *\\n\\\n * @see czm_modelViewRelativeToEye\\n\\\n * @see czm_modelViewProjectionRelativeToEye\\n\\\n * @see czm_computePosition\\n\\\n * @see EncodedCartesian3\\n\\\n */\\n\\\nvec4 czm_translateRelativeToEye(vec3 high, vec3 low)\\n\\\n{\\n\\\n    vec3 highDifference = high - czm_encodedCameraPositionMCHigh;\\n\\\n    vec3 lowDifference = low - czm_encodedCameraPositionMCLow;\\n\\\n\\n\\\n    return vec4(highDifference + lowDifference, 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * @private\\n\\\n */\\n\\\nvec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\\n\\\n{\\n\\\n    // Diffuse from directional light sources at eye (for top-down and horizon views)\\n\\\n    float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\\n\\\n\\n\\\n    if (czm_sceneMode == czm_sceneMode3D) {\\n\\\n        // (and horizon views in 3D)\\n\\\n        diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\\n\\\n    }\\n\\\n\\n\\\n    diffuse = clamp(diffuse, 0.0, 1.0);\\n\\\n\\n\\\n    float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);\\n\\\n\\n\\\n    // Temporary workaround for adding ambient.\\n\\\n    vec3 materialDiffuse = material.diffuse * 0.5;\\n\\\n\\n\\\n    vec3 ambient = materialDiffuse;\\n\\\n    vec3 color = ambient + material.emission;\\n\\\n    color += materialDiffuse * diffuse * czm_lightColor;\\n\\\n    color += material.specular * specular * czm_lightColor;\\n\\\n\\n\\\n    return vec4(color, material.alpha);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Returns the transpose of the matrix.  The input <code>matrix</code> can be\\n\\\n * a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>.\\n\\\n *\\n\\\n * @name czm_transpose\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {} matrix The matrix to transpose.\\n\\\n *\\n\\\n * @returns {} The transposed matrix.\\n\\\n *\\n\\\n * @example\\n\\\n * // GLSL declarations\\n\\\n * mat2 czm_transpose(mat2 matrix);\\n\\\n * mat3 czm_transpose(mat3 matrix);\\n\\\n * mat4 czm_transpose(mat4 matrix);\\n\\\n *\\n\\\n * // Transpose a 3x3 rotation matrix to find its inverse.\\n\\\n * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates(\\n\\\n *     positionMC, normalEC);\\n\\\n * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye);\\n\\\n */\\n\\\nmat2 czm_transpose(mat2 matrix)\\n\\\n{\\n\\\n    return mat2(\\n\\\n        matrix[0][0], matrix[1][0],\\n\\\n        matrix[0][1], matrix[1][1]);\\n\\\n}\\n\\\n\\n\\\nmat3 czm_transpose(mat3 matrix)\\n\\\n{\\n\\\n    return mat3(\\n\\\n        matrix[0][0], matrix[1][0], matrix[2][0],\\n\\\n        matrix[0][1], matrix[1][1], matrix[2][1],\\n\\\n        matrix[0][2], matrix[1][2], matrix[2][2]);\\n\\\n}\\n\\\n\\n\\\nmat4 czm_transpose(mat4 matrix)\\n\\\n{\\n\\\n    return mat4(\\n\\\n        matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\\n\\\n        matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\\n\\\n        matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\\n\\\n        matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Unpacks a vec4 depth value to a float in [0, 1) range.\\n\\\n *\\n\\\n * @name czm_unpackDepth\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec4} packedDepth The packed depth.\\n\\\n *\\n\\\n * @returns {float} The floating-point depth in [0, 1) range.\\n\\\n */\\n\\\n float czm_unpackDepth(vec4 packedDepth)\\n\\\n {\\n\\\n    // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA\\n\\\n    // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/\\n\\\n    return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\\n\\\n }\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4.\\n\\\n *\\n\\\n * @name czm_unpackFloat\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec4} packedFloat The packed float.\\n\\\n *\\n\\\n * @returns {float} The floating-point depth in arbitrary range.\\n\\\n */\\n\\\nfloat czm_unpackFloat(vec4 packedFloat)\\n\\\n{\\n\\\n    // Convert to [0.0, 255.0] and round to integer\\n\\\n    packedFloat = floor(packedFloat * 255.0 + 0.5);\\n\\\n    float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0;\\n\\\n    float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0;    \\n\\\n    if (exponent == -127.0)\\n\\\n    {\\n\\\n        return 0.0;\\n\\\n    }\\n\\\n    float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000);\\n\\\n    float result = sign * exp2(exponent - 23.0) * mantissa;\\n\\\n    return result;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type,\\n\\\n * so the return value is an int.\\n\\\n * <p>\\n\\\n * There are also precision limitations in WebGL 1. highp int is still limited\\n\\\n * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur.\\n\\\n * </p>\\n\\\n *\\n\\\n * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order.\\n\\\n *\\n\\\n * @return {int} The unpacked value.\\n\\\n */\\n\\\n int czm_unpackUint(float packedValue) {\\n\\\n   float rounded = czm_round(packedValue * 255.0);\\n\\\n   return int(rounded);\\n\\\n }\\n\\\n\\n\\\n int czm_unpackUint(vec2 packedValue) {\\n\\\n   vec2 rounded = czm_round(packedValue * 255.0);\\n\\\n   return int(dot(rounded, vec2(1.0, 256.0)));\\n\\\n }\\n\\\n\\n\\\n int czm_unpackUint(vec3 packedValue) {\\n\\\n   vec3 rounded = czm_round(packedValue * 255.0);\\n\\\n   return int(dot(rounded, vec3(1.0, 256.0, 65536.0)));\\n\\\n }\\n\\\n\\n\\\n int czm_unpackUint(vec4 packedValue) {\\n\\\n   vec4 rounded = czm_round(packedValue * 255.0);\\n\\\n   return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0)));\\n\\\n }\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Transform metadata values following the EXT_structural_metadata spec\\n\\\n * by multiplying by scale and adding the offset. Operations are always\\n\\\n * performed component-wise, even for matrices.\\n\\\n * \\n\\\n * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add\\n\\\n * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply\\n\\\n * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value.\\n\\\n *\\n\\\n * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input.\\n\\\n */\\n\\\nfloat czm_valueTransform(float offset, float scale, float value) {\\n\\\n  return scale * value + offset;\\n\\\n}\\n\\\n\\n\\\nvec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) {\\n\\\n  return scale * value + offset;\\n\\\n}\\n\\\n\\n\\\nvec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) {\\n\\\n  return scale * value + offset;\\n\\\n}\\n\\\n\\n\\\nvec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) {\\n\\\n  return scale * value + offset;\\n\\\n}\\n\\\n\\n\\\nmat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) {\\n\\\n  return matrixCompMult(scale, value) + offset;\\n\\\n}\\n\\\n\\n\\\nmat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) {\\n\\\n  return matrixCompMult(scale, value) + offset;\\n\\\n}\\n\\\n\\n\\\nmat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) {\\n\\\n  return matrixCompMult(scale, value) + offset;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef LOG_DEPTH\\n\\\n// 1.0 at the near plane, increasing linearly from there.\\n\\\nout float v_depthFromNearPlusOne;\\n\\\n#ifdef SHADOW_MAP\\n\\\nout vec3 v_logPositionEC;\\n\\\n#endif\\n\\\n#endif\\n\\\n\\n\\\nvec4 czm_updatePositionDepth(vec4 coords) {\\n\\\n#if defined(LOG_DEPTH)\\n\\\n\\n\\\n#ifdef SHADOW_MAP\\n\\\n    vec3 logPositionEC = (czm_inverseProjection * coords).xyz;\\n\\\n    v_logPositionEC = logPositionEC;\\n\\\n#endif\\n\\\n\\n\\\n    // With the very high far/near ratios used with the logarithmic depth\\n\\\n    // buffer, floating point rounding errors can cause linear depth values\\n\\\n    // to end up on the wrong side of the far plane, even for vertices that\\n\\\n    // are really nowhere near it. Since we always write a correct logarithmic\\n\\\n    // depth value in the fragment shader anyway, we just need to make sure\\n\\\n    // such errors don't cause the primitive to be clipped entirely before\\n\\\n    // we even get to the fragment shader.\\n\\\n    coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;\\n\\\n#endif\\n\\\n\\n\\\n    return coords;\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * Writes the logarithmic depth to gl_Position using the already computed gl_Position.\\n\\\n *\\n\\\n * @name czm_vertexLogDepth\\n\\\n * @glslFunction\\n\\\n */\\n\\\nvoid czm_vertexLogDepth()\\n\\\n{\\n\\\n#ifdef LOG_DEPTH\\n\\\n    v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;\\n\\\n    gl_Position = czm_updatePositionDepth(gl_Position);\\n\\\n#endif\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * Writes the logarithmic depth to gl_Position using the provided clip coordinates.\\n\\\n * <p>\\n\\\n * An example use case for this function would be moving the vertex in window coordinates\\n\\\n * before converting back to clip coordinates. Use the original vertex clip coordinates.\\n\\\n * </p>\\n\\\n * @name czm_vertexLogDepth\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec4} clipCoords The vertex in clip coordinates.\\n\\\n *\\n\\\n * @example\\n\\\n * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0));\\n\\\n */\\n\\\nvoid czm_vertexLogDepth(vec4 clipCoords)\\n\\\n{\\n\\\n#ifdef LOG_DEPTH\\n\\\n    v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;\\n\\\n    czm_updatePositionDepth(clipCoords);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate)\\n\\\n{\\n\\\n    // Reconstruct NDC coordinates\\n\\\n    float x = 2.0 * screenCoordinate.x - 1.0;\\n\\\n    float y = 2.0 * screenCoordinate.y - 1.0;\\n\\\n    float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\\n\\\n    vec4 q = vec4(x, y, z, 1.0);\\n\\\n\\n\\\n    // Reverse the perspective division to obtain clip coordinates.\\n\\\n    q /= screenCoordinate.w;\\n\\\n\\n\\\n    // Reverse the projection transformation to obtain eye coordinates.\\n\\\n    if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s\\n\\\n    {\\n\\\n        q = czm_inverseProjection * q;\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        float top = czm_frustumPlanes.x;\\n\\\n        float bottom = czm_frustumPlanes.y;\\n\\\n        float left = czm_frustumPlanes.z;\\n\\\n        float right = czm_frustumPlanes.w;\\n\\\n\\n\\\n        float near = czm_currentFrustum.x;\\n\\\n        float far = czm_currentFrustum.y;\\n\\\n\\n\\\n        q.x = (q.x * (right - left) + left + right) * 0.5;\\n\\\n        q.y = (q.y * (top - bottom) + bottom + top) * 0.5;\\n\\\n        q.z = (q.z * (near - far) - near - far) * 0.5;\\n\\\n        q.w = 1.0;\\n\\\n    }\\n\\\n\\n\\\n    return q;\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * Transforms a position from window to eye coordinates.\\n\\\n * The transform from window to normalized device coordinates is done using components\\n\\\n * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating\\n\\\n * the inverse of <code>czm_viewportTransformation</code>. The transformation from\\n\\\n * normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>,\\n\\\n * which is expected to be the scalar used in the perspective divide. The transformation\\n\\\n * from clip to eye coordinates is done using {@link czm_inverseProjection}.\\n\\\n *\\n\\\n * @name czm_windowToEyeCoordinates\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec4} fragmentCoordinate The position in window coordinates to transform.\\n\\\n *\\n\\\n * @returns {vec4} The transformed position in eye coordinates.\\n\\\n *\\n\\\n * @see czm_modelToWindowCoordinates\\n\\\n * @see czm_eyeToWindowCoordinates\\n\\\n * @see czm_inverseProjection\\n\\\n * @see czm_viewport\\n\\\n * @see czm_viewportTransformation\\n\\\n *\\n\\\n * @example\\n\\\n * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord);\\n\\\n */\\n\\\nvec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\\n\\\n{\\n\\\n    vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw;\\n\\\n    return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw));\\n\\\n}\\n\\\n\\n\\\nvec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth)\\n\\\n{\\n\\\n    // See reverseLogDepth.glsl. This is separate to re-use the pow.\\n\\\n#if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY)\\n\\\n    float near = czm_currentFrustum.x;\\n\\\n    float far = czm_currentFrustum.y;\\n\\\n    float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;\\n\\\n    float depthFromNear = pow(2.0, log2Depth) - 1.0;\\n\\\n    float depthFromCamera = depthFromNear + near;\\n\\\n    vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);\\n\\\n    vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);\\n\\\n    eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision\\n\\\n    return eyeCoordinate;\\n\\\n#else\\n\\\n    vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0);\\n\\\n    vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);\\n\\\n#endif\\n\\\n    return eyeCoordinate;\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates.\\n\\\n * This function produces more accurate results for window positions with log depth than\\n\\\n * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version\\n\\\n * of czm_windowToEyeCoordinates.\\n\\\n *\\n\\\n * @name czm_windowToEyeCoordinates\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform.\\n\\\n * @param {float} depthOrLogDepth A depth or log depth for the fragment.\\n\\\n *\\n\\\n * @see czm_modelToWindowCoordinates\\n\\\n * @see czm_eyeToWindowCoordinates\\n\\\n * @see czm_inverseProjection\\n\\\n * @see czm_viewport\\n\\\n * @see czm_viewportTransformation\\n\\\n *\\n\\\n * @returns {vec4} The transformed position in eye coordinates.\\n\\\n */\\n\\\nvec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)\\n\\\n{\\n\\\n    vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw;\\n\\\n    return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"// emulated noperspective\\n\\\n#if !defined(LOG_DEPTH)\\n\\\nin float v_WindowZ;\\n\\\n#endif\\n\\\n\\n\\\n/**\\n\\\n * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane\\n\\\n * by writing the fragment's depth. See czm_depthClamp for more details.\\n\\\n *\\n\\\n * @name czm_writeDepthClamp\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @example\\n\\\n * out_FragColor = color;\\n\\\n * czm_writeDepthClamp();\\n\\\n *\\n\\\n * @see czm_depthClamp\\n\\\n */\\n\\\nvoid czm_writeDepthClamp()\\n\\\n{\\n\\\n#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))\\n\\\n    gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef LOG_DEPTH\\n\\\nin float v_depthFromNearPlusOne;\\n\\\n\\n\\\n#ifdef POLYGON_OFFSET\\n\\\nuniform vec2 u_polygonOffset;\\n\\\n#endif\\n\\\n\\n\\\n#endif\\n\\\n\\n\\\n/**\\n\\\n * Writes the fragment depth to the logarithmic depth buffer.\\n\\\n * <p>\\n\\\n * Use this when the vertex shader does not call {@link czm_vertexlogDepth}, for example, when\\n\\\n * ray-casting geometry using a full screen quad.\\n\\\n * </p>\\n\\\n * @name czm_writeLogDepth\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {float} depth The depth coordinate, where 1.0 is on the near plane and\\n\\\n *                      depth increases in eye-space units from there\\n\\\n *\\n\\\n * @example\\n\\\n * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0);\\n\\\n */\\n\\\nvoid czm_writeLogDepth(float depth)\\n\\\n{\\n\\\n#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))\\n\\\n    // Discard the vertex if it's not between the near and far planes.\\n\\\n    // We allow a bit of epsilon on the near plane comparison because a 1.0\\n\\\n    // from the vertex shader (indicating the vertex should be _on_ the near\\n\\\n    // plane) will not necessarily come here as exactly 1.0.\\n\\\n    if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {\\n\\\n        discard;\\n\\\n    }\\n\\\n\\n\\\n#ifdef POLYGON_OFFSET\\n\\\n    // Polygon offset: m * factor + r * units\\n\\\n    float factor = u_polygonOffset[0];\\n\\\n    float units = u_polygonOffset[1];\\n\\\n\\n\\\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\\n\\\n    // This factor doesn't work in IE 10\\n\\\n    if (factor != 0.0) {\\n\\\n        // m = sqrt(dZdX^2 + dZdY^2);\\n\\\n        float x = dFdx(depth);\\n\\\n        float y = dFdy(depth);\\n\\\n        float m = sqrt(x * x + y * y);\\n\\\n\\n\\\n        // Apply the factor before computing the log depth.\\n\\\n        depth += m * factor;\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n#endif\\n\\\n\\n\\\n    gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;\\n\\\n\\n\\\n#ifdef POLYGON_OFFSET\\n\\\n    // Apply the units after the log depth.\\n\\\n    gl_FragDepth += czm_epsilon7 * units;\\n\\\n#endif\\n\\\n\\n\\\n#endif\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * Writes the fragment depth to the logarithmic depth buffer.\\n\\\n * <p>\\n\\\n * Use this when the vertex shader calls {@link czm_vertexlogDepth}.\\n\\\n * </p>\\n\\\n *\\n\\\n * @name czm_writeLogDepth\\n\\\n * @glslFunction\\n\\\n */\\n\\\nvoid czm_writeLogDepth() {\\n\\\n#ifdef LOG_DEPTH\\n\\\n    czm_writeLogDepth(v_depthFromNearPlusOne);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Transforms a value for non-perspective interpolation by multiplying\\n\\\n * it by w, the value used in the perspective divide. This function is\\n\\\n * intended to be called in a vertex shader to compute the value of a\\n\\\n * `varying` that should not be subject to perspective interpolation.\\n\\\n * For example, screen-space texture coordinates. The fragment shader\\n\\\n * must call {@link czm_readNonPerspective} to retrieve the final\\n\\\n * non-perspective value.\\n\\\n *\\n\\\n * @name czm_writeNonPerspective\\n\\\n * @glslFunction\\n\\\n *\\n\\\n * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective.\\n\\\n * @param {float} w The perspective divide value. Usually this is the computed `gl_Position.w`.\\n\\\n * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a `varying` and read in the\\n\\\n *          fragment shader with {@link czm_readNonPerspective}.\\n\\\n */\\n\\\nfloat czm_writeNonPerspective(float value, float w) {\\n\\\n    return value * w;\\n\\\n}\\n\\\n\\n\\\nvec2 czm_writeNonPerspective(vec2 value, float w) {\\n\\\n    return value * w;\\n\\\n}\\n\\\n\\n\\\nvec3 czm_writeNonPerspective(vec3 value, float w) {\\n\\\n    return value * w;\\n\\\n}\\n\\\n\\n\\\nvec4 czm_writeNonPerspective(vec4 value, float w) {\\n\\\n    return value * w;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nimport czm_degreesPerRadian from './Constants/degreesPerRadian.js'\nimport czm_depthRange from './Constants/depthRange.js'\nimport czm_epsilon1 from './Constants/epsilon1.js'\nimport czm_epsilon2 from './Constants/epsilon2.js'\nimport czm_epsilon3 from './Constants/epsilon3.js'\nimport czm_epsilon4 from './Constants/epsilon4.js'\nimport czm_epsilon5 from './Constants/epsilon5.js'\nimport czm_epsilon6 from './Constants/epsilon6.js'\nimport czm_epsilon7 from './Constants/epsilon7.js'\nimport czm_infinity from './Constants/infinity.js'\nimport czm_oneOverPi from './Constants/oneOverPi.js'\nimport czm_oneOverTwoPi from './Constants/oneOverTwoPi.js'\nimport czm_passCesium3DTile from './Constants/passCesium3DTile.js'\nimport czm_passCesium3DTileClassification from './Constants/passCesium3DTileClassification.js'\nimport czm_passCesium3DTileClassificationIgnoreShow from './Constants/passCesium3DTileClassificationIgnoreShow.js'\nimport czm_passClassification from './Constants/passClassification.js'\nimport czm_passCompute from './Constants/passCompute.js'\nimport czm_passEnvironment from './Constants/passEnvironment.js'\nimport czm_passGlobe from './Constants/passGlobe.js'\nimport czm_passOpaque from './Constants/passOpaque.js'\nimport czm_passOverlay from './Constants/passOverlay.js'\nimport czm_passTerrainClassification from './Constants/passTerrainClassification.js'\nimport czm_passTranslucent from './Constants/passTranslucent.js'\nimport czm_passVoxels from './Constants/passVoxels.js'\nimport czm_pi from './Constants/pi.js'\nimport czm_piOverFour from './Constants/piOverFour.js'\nimport czm_piOverSix from './Constants/piOverSix.js'\nimport czm_piOverThree from './Constants/piOverThree.js'\nimport czm_piOverTwo from './Constants/piOverTwo.js'\nimport czm_radiansPerDegree from './Constants/radiansPerDegree.js'\nimport czm_sceneMode2D from './Constants/sceneMode2D.js'\nimport czm_sceneMode3D from './Constants/sceneMode3D.js'\nimport czm_sceneModeColumbusView from './Constants/sceneModeColumbusView.js'\nimport czm_sceneModeMorphing from './Constants/sceneModeMorphing.js'\nimport czm_solarRadius from './Constants/solarRadius.js'\nimport czm_threePiOver2 from './Constants/threePiOver2.js'\nimport czm_twoPi from './Constants/twoPi.js'\nimport czm_webMercatorMaxLatitude from './Constants/webMercatorMaxLatitude.js'\nimport czm_depthRangeStruct from './Structs/depthRangeStruct.js'\nimport czm_material from './Structs/material.js'\nimport czm_materialInput from './Structs/materialInput.js'\nimport czm_modelMaterial from './Structs/modelMaterial.js'\nimport czm_modelVertexOutput from './Structs/modelVertexOutput.js'\nimport czm_pbrParameters from './Structs/pbrParameters.js'\nimport czm_ray from './Structs/ray.js'\nimport czm_raySegment from './Structs/raySegment.js'\nimport czm_shadowParameters from './Structs/shadowParameters.js'\nimport czm_HSBToRGB from './Functions/HSBToRGB.js'\nimport czm_HSLToRGB from './Functions/HSLToRGB.js'\nimport czm_RGBToHSB from './Functions/RGBToHSB.js'\nimport czm_RGBToHSL from './Functions/RGBToHSL.js'\nimport czm_RGBToXYZ from './Functions/RGBToXYZ.js'\nimport czm_XYZToRGB from './Functions/XYZToRGB.js'\nimport czm_acesTonemapping from './Functions/acesTonemapping.js'\nimport czm_alphaWeight from './Functions/alphaWeight.js'\nimport czm_antialias from './Functions/antialias.js'\nimport czm_approximateSphericalCoordinates from './Functions/approximateSphericalCoordinates.js'\nimport czm_backFacing from './Functions/backFacing.js'\nimport czm_branchFreeTernary from './Functions/branchFreeTernary.js'\nimport czm_cascadeColor from './Functions/cascadeColor.js'\nimport czm_cascadeDistance from './Functions/cascadeDistance.js'\nimport czm_cascadeMatrix from './Functions/cascadeMatrix.js'\nimport czm_cascadeWeights from './Functions/cascadeWeights.js'\nimport czm_columbusViewMorph from './Functions/columbusViewMorph.js'\nimport czm_computePosition from './Functions/computePosition.js'\nimport czm_cosineAndSine from './Functions/cosineAndSine.js'\nimport czm_decompressTextureCoordinates from './Functions/decompressTextureCoordinates.js'\nimport czm_defaultPbrMaterial from './Functions/defaultPbrMaterial.js'\nimport czm_depthClamp from './Functions/depthClamp.js'\nimport czm_eastNorthUpToEyeCoordinates from './Functions/eastNorthUpToEyeCoordinates.js'\nimport czm_ellipsoidContainsPoint from './Functions/ellipsoidContainsPoint.js'\nimport czm_ellipsoidWgs84TextureCoordinates from './Functions/ellipsoidWgs84TextureCoordinates.js'\nimport czm_equalsEpsilon from './Functions/equalsEpsilon.js'\nimport czm_eyeOffset from './Functions/eyeOffset.js'\nimport czm_eyeToWindowCoordinates from './Functions/eyeToWindowCoordinates.js'\nimport czm_fastApproximateAtan from './Functions/fastApproximateAtan.js'\nimport czm_fog from './Functions/fog.js'\nimport czm_gammaCorrect from './Functions/gammaCorrect.js'\nimport czm_geodeticSurfaceNormal from './Functions/geodeticSurfaceNormal.js'\nimport czm_getDefaultMaterial from './Functions/getDefaultMaterial.js'\nimport czm_getLambertDiffuse from './Functions/getLambertDiffuse.js'\nimport czm_getSpecular from './Functions/getSpecular.js'\nimport czm_getWaterNoise from './Functions/getWaterNoise.js'\nimport czm_hue from './Functions/hue.js'\nimport czm_inverseGamma from './Functions/inverseGamma.js'\nimport czm_isEmpty from './Functions/isEmpty.js'\nimport czm_isFull from './Functions/isFull.js'\nimport czm_latitudeToWebMercatorFraction from './Functions/latitudeToWebMercatorFraction.js'\nimport czm_lineDistance from './Functions/lineDistance.js'\nimport czm_linearToSrgb from './Functions/linearToSrgb.js'\nimport czm_luminance from './Functions/luminance.js'\nimport czm_metersPerPixel from './Functions/metersPerPixel.js'\nimport czm_modelToWindowCoordinates from './Functions/modelToWindowCoordinates.js'\nimport czm_multiplyWithColorBalance from './Functions/multiplyWithColorBalance.js'\nimport czm_nearFarScalar from './Functions/nearFarScalar.js'\nimport czm_octDecode from './Functions/octDecode.js'\nimport czm_packDepth from './Functions/packDepth.js'\nimport czm_pbrLighting from './Functions/pbrLighting.js'\nimport czm_pbrMetallicRoughnessMaterial from './Functions/pbrMetallicRoughnessMaterial.js'\nimport czm_pbrSpecularGlossinessMaterial from './Functions/pbrSpecularGlossinessMaterial.js'\nimport czm_phong from './Functions/phong.js'\nimport czm_planeDistance from './Functions/planeDistance.js'\nimport czm_pointAlongRay from './Functions/pointAlongRay.js'\nimport czm_rayEllipsoidIntersectionInterval from './Functions/rayEllipsoidIntersectionInterval.js'\nimport czm_raySphereIntersectionInterval from './Functions/raySphereIntersectionInterval.js'\nimport czm_readDepth from './Functions/readDepth.js'\nimport czm_readNonPerspective from './Functions/readNonPerspective.js'\nimport czm_reverseLogDepth from './Functions/reverseLogDepth.js'\nimport czm_round from './Functions/round.js'\nimport czm_sampleOctahedralProjection from './Functions/sampleOctahedralProjection.js'\nimport czm_saturation from './Functions/saturation.js'\nimport czm_shadowDepthCompare from './Functions/shadowDepthCompare.js'\nimport czm_shadowVisibility from './Functions/shadowVisibility.js'\nimport czm_signNotZero from './Functions/signNotZero.js'\nimport czm_sphericalHarmonics from './Functions/sphericalHarmonics.js'\nimport czm_srgbToLinear from './Functions/srgbToLinear.js'\nimport czm_tangentToEyeSpaceMatrix from './Functions/tangentToEyeSpaceMatrix.js'\nimport czm_textureCube from './Functions/textureCube.js'\nimport czm_transformPlane from './Functions/transformPlane.js'\nimport czm_translateRelativeToEye from './Functions/translateRelativeToEye.js'\nimport czm_translucentPhong from './Functions/translucentPhong.js'\nimport czm_transpose from './Functions/transpose.js'\nimport czm_unpackDepth from './Functions/unpackDepth.js'\nimport czm_unpackFloat from './Functions/unpackFloat.js'\nimport czm_unpackUint from './Functions/unpackUint.js'\nimport czm_valueTransform from './Functions/valueTransform.js'\nimport czm_vertexLogDepth from './Functions/vertexLogDepth.js'\nimport czm_windowToEyeCoordinates from './Functions/windowToEyeCoordinates.js'\nimport czm_writeDepthClamp from './Functions/writeDepthClamp.js'\nimport czm_writeLogDepth from './Functions/writeLogDepth.js'\nimport czm_writeNonPerspective from './Functions/writeNonPerspective.js'\n\nexport default {\n    czm_degreesPerRadian : czm_degreesPerRadian,\n    czm_depthRange : czm_depthRange,\n    czm_epsilon1 : czm_epsilon1,\n    czm_epsilon2 : czm_epsilon2,\n    czm_epsilon3 : czm_epsilon3,\n    czm_epsilon4 : czm_epsilon4,\n    czm_epsilon5 : czm_epsilon5,\n    czm_epsilon6 : czm_epsilon6,\n    czm_epsilon7 : czm_epsilon7,\n    czm_infinity : czm_infinity,\n    czm_oneOverPi : czm_oneOverPi,\n    czm_oneOverTwoPi : czm_oneOverTwoPi,\n    czm_passCesium3DTile : czm_passCesium3DTile,\n    czm_passCesium3DTileClassification : czm_passCesium3DTileClassification,\n    czm_passCesium3DTileClassificationIgnoreShow : czm_passCesium3DTileClassificationIgnoreShow,\n    czm_passClassification : czm_passClassification,\n    czm_passCompute : czm_passCompute,\n    czm_passEnvironment : czm_passEnvironment,\n    czm_passGlobe : czm_passGlobe,\n    czm_passOpaque : czm_passOpaque,\n    czm_passOverlay : czm_passOverlay,\n    czm_passTerrainClassification : czm_passTerrainClassification,\n    czm_passTranslucent : czm_passTranslucent,\n    czm_passVoxels : czm_passVoxels,\n    czm_pi : czm_pi,\n    czm_piOverFour : czm_piOverFour,\n    czm_piOverSix : czm_piOverSix,\n    czm_piOverThree : czm_piOverThree,\n    czm_piOverTwo : czm_piOverTwo,\n    czm_radiansPerDegree : czm_radiansPerDegree,\n    czm_sceneMode2D : czm_sceneMode2D,\n    czm_sceneMode3D : czm_sceneMode3D,\n    czm_sceneModeColumbusView : czm_sceneModeColumbusView,\n    czm_sceneModeMorphing : czm_sceneModeMorphing,\n    czm_solarRadius : czm_solarRadius,\n    czm_threePiOver2 : czm_threePiOver2,\n    czm_twoPi : czm_twoPi,\n    czm_webMercatorMaxLatitude : czm_webMercatorMaxLatitude,\n    czm_depthRangeStruct : czm_depthRangeStruct,\n    czm_material : czm_material,\n    czm_materialInput : czm_materialInput,\n    czm_modelMaterial : czm_modelMaterial,\n    czm_modelVertexOutput : czm_modelVertexOutput,\n    czm_pbrParameters : czm_pbrParameters,\n    czm_ray : czm_ray,\n    czm_raySegment : czm_raySegment,\n    czm_shadowParameters : czm_shadowParameters,\n    czm_HSBToRGB : czm_HSBToRGB,\n    czm_HSLToRGB : czm_HSLToRGB,\n    czm_RGBToHSB : czm_RGBToHSB,\n    czm_RGBToHSL : czm_RGBToHSL,\n    czm_RGBToXYZ : czm_RGBToXYZ,\n    czm_XYZToRGB : czm_XYZToRGB,\n    czm_acesTonemapping : czm_acesTonemapping,\n    czm_alphaWeight : czm_alphaWeight,\n    czm_antialias : czm_antialias,\n    czm_approximateSphericalCoordinates : czm_approximateSphericalCoordinates,\n    czm_backFacing : czm_backFacing,\n    czm_branchFreeTernary : czm_branchFreeTernary,\n    czm_cascadeColor : czm_cascadeColor,\n    czm_cascadeDistance : czm_cascadeDistance,\n    czm_cascadeMatrix : czm_cascadeMatrix,\n    czm_cascadeWeights : czm_cascadeWeights,\n    czm_columbusViewMorph : czm_columbusViewMorph,\n    czm_computePosition : czm_computePosition,\n    czm_cosineAndSine : czm_cosineAndSine,\n    czm_decompressTextureCoordinates : czm_decompressTextureCoordinates,\n    czm_defaultPbrMaterial : czm_defaultPbrMaterial,\n    czm_depthClamp : czm_depthClamp,\n    czm_eastNorthUpToEyeCoordinates : czm_eastNorthUpToEyeCoordinates,\n    czm_ellipsoidContainsPoint : czm_ellipsoidContainsPoint,\n    czm_ellipsoidWgs84TextureCoordinates : czm_ellipsoidWgs84TextureCoordinates,\n    czm_equalsEpsilon : czm_equalsEpsilon,\n    czm_eyeOffset : czm_eyeOffset,\n    czm_eyeToWindowCoordinates : czm_eyeToWindowCoordinates,\n    czm_fastApproximateAtan : czm_fastApproximateAtan,\n    czm_fog : czm_fog,\n    czm_gammaCorrect : czm_gammaCorrect,\n    czm_geodeticSurfaceNormal : czm_geodeticSurfaceNormal,\n    czm_getDefaultMaterial : czm_getDefaultMaterial,\n    czm_getLambertDiffuse : czm_getLambertDiffuse,\n    czm_getSpecular : czm_getSpecular,\n    czm_getWaterNoise : czm_getWaterNoise,\n    czm_hue : czm_hue,\n    czm_inverseGamma : czm_inverseGamma,\n    czm_isEmpty : czm_isEmpty,\n    czm_isFull : czm_isFull,\n    czm_latitudeToWebMercatorFraction : czm_latitudeToWebMercatorFraction,\n    czm_lineDistance : czm_lineDistance,\n    czm_linearToSrgb : czm_linearToSrgb,\n    czm_luminance : czm_luminance,\n    czm_metersPerPixel : czm_metersPerPixel,\n    czm_modelToWindowCoordinates : czm_modelToWindowCoordinates,\n    czm_multiplyWithColorBalance : czm_multiplyWithColorBalance,\n    czm_nearFarScalar : czm_nearFarScalar,\n    czm_octDecode : czm_octDecode,\n    czm_packDepth : czm_packDepth,\n    czm_pbrLighting : czm_pbrLighting,\n    czm_pbrMetallicRoughnessMaterial : czm_pbrMetallicRoughnessMaterial,\n    czm_pbrSpecularGlossinessMaterial : czm_pbrSpecularGlossinessMaterial,\n    czm_phong : czm_phong,\n    czm_planeDistance : czm_planeDistance,\n    czm_pointAlongRay : czm_pointAlongRay,\n    czm_rayEllipsoidIntersectionInterval : czm_rayEllipsoidIntersectionInterval,\n    czm_raySphereIntersectionInterval : czm_raySphereIntersectionInterval,\n    czm_readDepth : czm_readDepth,\n    czm_readNonPerspective : czm_readNonPerspective,\n    czm_reverseLogDepth : czm_reverseLogDepth,\n    czm_round : czm_round,\n    czm_sampleOctahedralProjection : czm_sampleOctahedralProjection,\n    czm_saturation : czm_saturation,\n    czm_shadowDepthCompare : czm_shadowDepthCompare,\n    czm_shadowVisibility : czm_shadowVisibility,\n    czm_signNotZero : czm_signNotZero,\n    czm_sphericalHarmonics : czm_sphericalHarmonics,\n    czm_srgbToLinear : czm_srgbToLinear,\n    czm_tangentToEyeSpaceMatrix : czm_tangentToEyeSpaceMatrix,\n    czm_textureCube : czm_textureCube,\n    czm_transformPlane : czm_transformPlane,\n    czm_translateRelativeToEye : czm_translateRelativeToEye,\n    czm_translucentPhong : czm_translucentPhong,\n    czm_transpose : czm_transpose,\n    czm_unpackDepth : czm_unpackDepth,\n    czm_unpackFloat : czm_unpackFloat,\n    czm_unpackUint : czm_unpackUint,\n    czm_valueTransform : czm_valueTransform,\n    czm_vertexLogDepth : czm_vertexLogDepth,\n    czm_windowToEyeCoordinates : czm_windowToEyeCoordinates,\n    czm_writeDepthClamp : czm_writeDepthClamp,\n    czm_writeLogDepth : czm_writeLogDepth,\n    czm_writeNonPerspective : czm_writeNonPerspective\n};\n", "/**\n * Transpiles a [GLSL 3.00]{@link https://registry.khronos.org/OpenGL/specs/es/3.0/GLSL_ES_Specification_3.00.pdf}\n * shader to a [GLSL 1.00]{@link https://registry.khronos.org/OpenGL/specs/es/2.0/GLSL_ES_Specification_1.00.pdf} shader.\n *\n * This function does not aim to provide a comprehensive transpilation from GLSL 3.00 to GLSL 1.00; only the functionality\n * used within the CesiumJS shaders is supported.\n *\n * @private\n *\n * @param {string} input The GLSL 3.00 shader.\n * @param {boolean} isFragmentShader True if the shader is a fragment shader.\n *\n * @return {string}\n */\nfunction demodernizeShader(input, isFragmentShader) {\n  let output = input;\n\n  // Remove version string got GLSL 3.00.\n  output = output.replaceAll(`version 300 es`, ``);\n\n  // Replace all texture calls with texture2D\n  output = output.replaceAll(\n    /(texture\\()/g,\n    `texture2D(` // Trailing ')' is included in the match group.\n  );\n\n  if (isFragmentShader) {\n    // Replace the in with varying.\n    output = output.replaceAll(/(in)\\s+(vec\\d|mat\\d|float)/g, `varying $2`);\n\n    if (/out_FragData_(\\d+)/.test(output)) {\n      output = `#extension GL_EXT_draw_buffers : enable\\n${output}`;\n\n      // Remove all layout declarations for out_FragData.\n      output = output.replaceAll(\n        /layout\\s+\\(location\\s*=\\s*\\d+\\)\\s*out\\s+vec4\\s+out_FragData_\\d+;/g,\n        ``\n      );\n\n      // Replace out_FragData with gl_FragData.\n      output = output.replaceAll(/out_FragData_(\\d+)/g, `gl_FragData[$1]`);\n    }\n\n    // Remove all layout declarations for out_FragColor.\n    output = output.replaceAll(\n      /layout\\s+\\(location\\s*=\\s*0\\)\\s*out\\s+vec4\\s+out_FragColor;/g,\n      ``\n    );\n\n    // Replace out_FragColor with gl_FragColor.\n    output = output.replaceAll(/out_FragColor/g, `gl_FragColor`);\n    output = output.replaceAll(/out_FragColor\\[(\\d+)\\]/g, `gl_FragColor[$1]`);\n\n    if (/gl_FragDepth/.test(output)) {\n      output = `#extension GL_EXT_frag_depth : enable\\n${output}`;\n      // Replace gl_FragDepth with gl_FragDepthEXT.\n      output = output.replaceAll(/gl_FragDepth/g, `gl_FragDepthEXT`);\n    }\n\n    // Enable the OES_standard_derivatives extension\n    output = `#ifdef GL_OES_standard_derivatives\\n#extension GL_OES_standard_derivatives : enable\\n#endif\\n${output}`;\n  } else {\n    // Replace the in with attribute.\n    output = output.replaceAll(/(in)\\s+(vec\\d|mat\\d|float)/g, `attribute $2`);\n\n    // Replace the out with varying.\n    output = output.replaceAll(\n      /(out)\\s+(vec\\d|mat\\d|float)\\s+([\\w]+);/g,\n      `varying $2 $3;`\n    );\n  }\n\n  // Add version string for GLSL 1.00.\n  output = `#version 100\\n${output}`;\n\n  return output;\n}\n\nexport default demodernizeShader;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CzmBuiltins from \"../Shaders/Builtin/CzmBuiltins.js\";\nimport AutomaticUniforms from \"./AutomaticUniforms.js\";\nimport demodernizeShader from \"./demodernizeShader.js\";\n\nfunction removeComments(source) {\n  // remove inline comments\n  source = source.replace(/\\/\\/.*/g, \"\");\n  // remove multiline comment block\n  return source.replace(/\\/\\*\\*[\\s\\S]*?\\*\\//gm, function (match) {\n    // preserve the number of lines in the comment block so the line numbers will be correct when debugging shaders\n    const numberOfLines = match.match(/\\n/gm).length;\n    let replacement = \"\";\n    for (let lineNumber = 0; lineNumber < numberOfLines; ++lineNumber) {\n      replacement += \"\\n\";\n    }\n    return replacement;\n  });\n}\n\nfunction getDependencyNode(name, glslSource, nodes) {\n  let dependencyNode;\n\n  // check if already loaded\n  for (let i = 0; i < nodes.length; ++i) {\n    if (nodes[i].name === name) {\n      dependencyNode = nodes[i];\n    }\n  }\n\n  if (!defined(dependencyNode)) {\n    // strip doc comments so we don't accidentally try to determine a dependency for something found\n    // in a comment\n    glslSource = removeComments(glslSource);\n\n    // create new node\n    dependencyNode = {\n      name: name,\n      glslSource: glslSource,\n      dependsOn: [],\n      requiredBy: [],\n      evaluated: false,\n    };\n    nodes.push(dependencyNode);\n  }\n\n  return dependencyNode;\n}\n\nfunction generateDependencies(currentNode, dependencyNodes) {\n  if (currentNode.evaluated) {\n    return;\n  }\n\n  currentNode.evaluated = true;\n\n  // identify all dependencies that are referenced from this glsl source code\n  let czmMatches = currentNode.glslSource.match(/\\bczm_[a-zA-Z0-9_]*/g);\n  if (defined(czmMatches) && czmMatches !== null) {\n    // remove duplicates\n    czmMatches = czmMatches.filter(function (elem, pos) {\n      return czmMatches.indexOf(elem) === pos;\n    });\n\n    czmMatches.forEach(function (element) {\n      if (\n        element !== currentNode.name &&\n        ShaderSource._czmBuiltinsAndUniforms.hasOwnProperty(element)\n      ) {\n        const referencedNode = getDependencyNode(\n          element,\n          ShaderSource._czmBuiltinsAndUniforms[element],\n          dependencyNodes\n        );\n        currentNode.dependsOn.push(referencedNode);\n        referencedNode.requiredBy.push(currentNode);\n\n        // recursive call to find any dependencies of the new node\n        generateDependencies(referencedNode, dependencyNodes);\n      }\n    });\n  }\n}\n\nfunction sortDependencies(dependencyNodes) {\n  const nodesWithoutIncomingEdges = [];\n  const allNodes = [];\n\n  while (dependencyNodes.length > 0) {\n    const node = dependencyNodes.pop();\n    allNodes.push(node);\n\n    if (node.requiredBy.length === 0) {\n      nodesWithoutIncomingEdges.push(node);\n    }\n  }\n\n  while (nodesWithoutIncomingEdges.length > 0) {\n    const currentNode = nodesWithoutIncomingEdges.shift();\n\n    dependencyNodes.push(currentNode);\n\n    for (let i = 0; i < currentNode.dependsOn.length; ++i) {\n      // remove the edge from the graph\n      const referencedNode = currentNode.dependsOn[i];\n      const index = referencedNode.requiredBy.indexOf(currentNode);\n      referencedNode.requiredBy.splice(index, 1);\n\n      // if referenced node has no more incoming edges, add to list\n      if (referencedNode.requiredBy.length === 0) {\n        nodesWithoutIncomingEdges.push(referencedNode);\n      }\n    }\n  }\n\n  // if there are any nodes left with incoming edges, then there was a circular dependency somewhere in the graph\n  const badNodes = [];\n  for (let j = 0; j < allNodes.length; ++j) {\n    if (allNodes[j].requiredBy.length !== 0) {\n      badNodes.push(allNodes[j]);\n    }\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (badNodes.length !== 0) {\n    let message =\n      \"A circular dependency was found in the following built-in functions/structs/constants: \\n\";\n    for (let k = 0; k < badNodes.length; ++k) {\n      message = `${message + badNodes[k].name}\\n`;\n    }\n    throw new DeveloperError(message);\n  }\n  //>>includeEnd('debug');\n}\n\nfunction getBuiltinsAndAutomaticUniforms(shaderSource) {\n  // generate a dependency graph for builtin functions\n  const dependencyNodes = [];\n  const root = getDependencyNode(\"main\", shaderSource, dependencyNodes);\n  generateDependencies(root, dependencyNodes);\n  sortDependencies(dependencyNodes);\n\n  // Concatenate the source code for the function dependencies.\n  // Iterate in reverse so that dependent items are declared before they are used.\n  let builtinsSource = \"\";\n  for (let i = dependencyNodes.length - 1; i >= 0; --i) {\n    builtinsSource = `${builtinsSource + dependencyNodes[i].glslSource}\\n`;\n  }\n\n  return builtinsSource.replace(root.glslSource, \"\");\n}\n\nfunction combineShader(shaderSource, isFragmentShader, context) {\n  let i;\n  let length;\n\n  // Combine shader sources, generally for pseudo-polymorphism, e.g., czm_getMaterial.\n  let combinedSources = \"\";\n  const sources = shaderSource.sources;\n  if (defined(sources)) {\n    for (i = 0, length = sources.length; i < length; ++i) {\n      // #line needs to be on its own line.\n      combinedSources += `\\n#line 0\\n${sources[i]}`;\n    }\n  }\n\n  combinedSources = removeComments(combinedSources);\n\n  // Extract existing shader version from sources\n  let version;\n  combinedSources = combinedSources.replace(/#version\\s+(.*?)\\n/gm, function (\n    match,\n    group1\n  ) {\n    //>>includeStart('debug', pragmas.debug);\n    if (defined(version) && version !== group1) {\n      throw new DeveloperError(\n        `inconsistent versions found: ${version} and ${group1}`\n      );\n    }\n    //>>includeEnd('debug');\n\n    // Extract #version to put at the top\n    version = group1;\n\n    // Replace original #version directive with a new line so the line numbers\n    // are not off by one.  There can be only one #version directive\n    // and it must appear at the top of the source, only preceded by\n    // whitespace and comments.\n    return \"\\n\";\n  });\n\n  // Extract shader extensions from sources\n  const extensions = [];\n  combinedSources = combinedSources.replace(/#extension.*\\n/gm, function (\n    match\n  ) {\n    // Extract extension to put at the top\n    extensions.push(match);\n\n    // Replace original #extension directive with a new line so the line numbers\n    // are not off by one.\n    return \"\\n\";\n  });\n\n  // Remove precision qualifier\n  combinedSources = combinedSources.replace(\n    /precision\\s(lowp|mediump|highp)\\s(float|int);/,\n    \"\"\n  );\n\n  // Replace main() for picked if desired.\n  const pickColorQualifier = shaderSource.pickColorQualifier;\n  if (defined(pickColorQualifier)) {\n    combinedSources = ShaderSource.createPickFragmentShaderSource(\n      combinedSources,\n      pickColorQualifier\n    );\n  }\n\n  // combine into single string\n  let result = \"\";\n\n  const extensionsLength = extensions.length;\n  for (i = 0; i < extensionsLength; i++) {\n    result += extensions[i];\n  }\n\n  if (isFragmentShader) {\n    // If high precision isn't support replace occurrences of highp with mediump\n    // The highp keyword is not always available on older mobile devices\n    // See https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices#In_WebGL_1_highp_float_support_is_optional_in_fragment_shaders\n    result +=\n      \"\\\n#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\\\n    precision highp float;\\n\\\n    precision highp int;\\n\\\n#else\\n\\\n    precision mediump float;\\n\\\n    precision mediump int;\\n\\\n    #define highp mediump\\n\\\n#endif\\n\\n\";\n  }\n\n  // Prepend #defines for uber-shaders\n  const defines = shaderSource.defines;\n  if (defined(defines)) {\n    for (i = 0, length = defines.length; i < length; ++i) {\n      const define = defines[i];\n      if (define.length !== 0) {\n        result += `#define ${define}\\n`;\n      }\n    }\n  }\n\n  // Define a constant for the OES_texture_float_linear extension since WebGL does not.\n  if (context.textureFloatLinear) {\n    result += \"#define OES_texture_float_linear\\n\\n\";\n  }\n\n  // Define a constant for the OES_texture_float extension since WebGL does not.\n  if (context.floatingPointTexture) {\n    result += \"#define OES_texture_float\\n\\n\";\n  }\n\n  // append built-ins\n  let builtinSources = \"\";\n  if (shaderSource.includeBuiltIns) {\n    builtinSources = getBuiltinsAndAutomaticUniforms(combinedSources);\n  }\n\n  // reset line number\n  result += \"\\n#line 0\\n\";\n\n  // append actual source\n  const combinedShader = builtinSources + combinedSources;\n  if (\n    context.webgl2 &&\n    isFragmentShader &&\n    !/layout\\s*\\(location\\s*=\\s*0\\)\\s*out\\s+vec4\\s+out_FragColor;/g.test(\n      combinedShader\n    ) &&\n    !/czm_out_FragColor/g.test(combinedShader) &&\n    /out_FragColor/g.test(combinedShader)\n  ) {\n    result += \"layout(location = 0) out vec4 out_FragColor;\\n\\n\";\n  }\n\n  result += builtinSources;\n  result += combinedSources;\n\n  // modernize the source\n  if (!context.webgl2) {\n    result = demodernizeShader(result, isFragmentShader);\n  } else {\n    result = `#version 300 es\\n${result}`;\n  }\n\n  return result;\n}\n\n/**\n * An object containing various inputs that will be combined to form a final GLSL shader string.\n *\n * @param {object} [options] Object with the following properties:\n * @param {string[]} [options.sources] An array of strings to combine containing GLSL code for the shader.\n * @param {string[]} [options.defines] An array of strings containing GLSL identifiers to <code>#define</code>.\n * @param {string} [options.pickColorQualifier] The GLSL qualifier, <code>uniform</code> or <code>in</code>, for the input <code>czm_pickColor</code>.  When defined, a pick fragment shader is generated.\n * @param {boolean} [options.includeBuiltIns=true] If true, referenced built-in functions will be included with the combined shader.  Set to false if this shader will become a source in another shader, to avoid duplicating functions.\n *\n * @exception {DeveloperError} options.pickColorQualifier must be 'uniform' or 'in'.\n *\n * @example\n * // 1. Prepend #defines to a shader\n * const source = new Cesium.ShaderSource({\n *   defines : ['WHITE'],\n *   sources : ['void main() { \\n#ifdef WHITE\\n out_FragColor = vec4(1.0); \\n#else\\n out_FragColor = vec4(0.0); \\n#endif\\n }']\n * });\n *\n * // 2. Modify a fragment shader for picking\n * const source2 = new Cesium.ShaderSource({\n *   sources : ['void main() { out_FragColor = vec4(1.0); }'],\n *   pickColorQualifier : 'uniform'\n * });\n *\n * @private\n */\nfunction ShaderSource(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const pickColorQualifier = options.pickColorQualifier;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    defined(pickColorQualifier) &&\n    pickColorQualifier !== \"uniform\" &&\n    pickColorQualifier !== \"in\"\n  ) {\n    throw new DeveloperError(\n      \"options.pickColorQualifier must be 'uniform' or 'in'.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this.defines = defined(options.defines) ? options.defines.slice(0) : [];\n  this.sources = defined(options.sources) ? options.sources.slice(0) : [];\n  this.pickColorQualifier = pickColorQualifier;\n  this.includeBuiltIns = defaultValue(options.includeBuiltIns, true);\n}\n\nShaderSource.prototype.clone = function () {\n  return new ShaderSource({\n    sources: this.sources,\n    defines: this.defines,\n    pickColorQualifier: this.pickColorQualifier,\n    includeBuiltIns: this.includeBuiltIns,\n  });\n};\n\nShaderSource.replaceMain = function (source, renamedMain) {\n  renamedMain = `void ${renamedMain}()`;\n  return source.replace(/void\\s+main\\s*\\(\\s*(?:void)?\\s*\\)/g, renamedMain);\n};\n\n/**\n * Since {@link ShaderSource#createCombinedVertexShader} and\n * {@link ShaderSource#createCombinedFragmentShader} are both expensive to\n * compute, create a simpler string key for lookups in the {@link ShaderCache}.\n *\n * @returns {string} A key for identifying this shader\n *\n * @private\n */\nShaderSource.prototype.getCacheKey = function () {\n  // Sort defines to make the key comparison deterministic\n  const sortedDefines = this.defines.slice().sort();\n  const definesKey = sortedDefines.join(\",\");\n  const pickKey = this.pickColorQualifier;\n  const builtinsKey = this.includeBuiltIns;\n  const sourcesKey = this.sources.join(\"\\n\");\n\n  return `${definesKey}:${pickKey}:${builtinsKey}:${sourcesKey}`;\n};\n\n/**\n * Create a single string containing the full, combined vertex shader with all dependencies and defines.\n *\n * @param {Context} context The current rendering context\n *\n * @returns {string} The combined shader string.\n */\nShaderSource.prototype.createCombinedVertexShader = function (context) {\n  return combineShader(this, false, context);\n};\n\n/**\n * Create a single string containing the full, combined fragment shader with all dependencies and defines.\n *\n * @param {Context} context The current rendering context\n *\n * @returns {string} The combined shader string.\n */\nShaderSource.prototype.createCombinedFragmentShader = function (context) {\n  return combineShader(this, true, context);\n};\n\n/**\n * For ShaderProgram testing\n * @private\n */\nShaderSource._czmBuiltinsAndUniforms = {};\n\n// combine automatic uniforms and Cesium built-ins\nfor (const builtinName in CzmBuiltins) {\n  if (CzmBuiltins.hasOwnProperty(builtinName)) {\n    ShaderSource._czmBuiltinsAndUniforms[builtinName] =\n      CzmBuiltins[builtinName];\n  }\n}\nfor (const uniformName in AutomaticUniforms) {\n  if (AutomaticUniforms.hasOwnProperty(uniformName)) {\n    const uniform = AutomaticUniforms[uniformName];\n    if (typeof uniform.getDeclaration === \"function\") {\n      ShaderSource._czmBuiltinsAndUniforms[\n        uniformName\n      ] = uniform.getDeclaration(uniformName);\n    }\n  }\n}\n\nShaderSource.createPickVertexShaderSource = function (vertexShaderSource) {\n  const renamedVS = ShaderSource.replaceMain(\n    vertexShaderSource,\n    \"czm_old_main\"\n  );\n  const pickMain =\n    \"in vec4 pickColor; \\n\" +\n    \"out vec4 czm_pickColor; \\n\" +\n    \"void main() \\n\" +\n    \"{ \\n\" +\n    \"    czm_old_main(); \\n\" +\n    \"    czm_pickColor = pickColor; \\n\" +\n    \"}\";\n\n  return `${renamedVS}\\n${pickMain}`;\n};\n\nShaderSource.createPickFragmentShaderSource = function (\n  fragmentShaderSource,\n  pickColorQualifier\n) {\n  const renamedFS = ShaderSource.replaceMain(\n    fragmentShaderSource,\n    \"czm_old_main\"\n  );\n  const pickMain =\n    `${pickColorQualifier} vec4 czm_pickColor; \\n` +\n    `void main() \\n` +\n    `{ \\n` +\n    `    czm_old_main(); \\n` +\n    `    if (out_FragColor.a == 0.0) { \\n` +\n    `       discard; \\n` +\n    `    } \\n` +\n    `    out_FragColor = czm_pickColor; \\n` +\n    `}`;\n\n  return `${renamedFS}\\n${pickMain}`;\n};\n\nfunction containsDefine(shaderSource, define) {\n  const defines = shaderSource.defines;\n  const definesLength = defines.length;\n  for (let i = 0; i < definesLength; ++i) {\n    if (defines[i] === define) {\n      return true;\n    }\n  }\n  return false;\n}\n\nfunction containsString(shaderSource, string) {\n  const sources = shaderSource.sources;\n  const sourcesLength = sources.length;\n  for (let i = 0; i < sourcesLength; ++i) {\n    if (sources[i].indexOf(string) !== -1) {\n      return true;\n    }\n  }\n  return false;\n}\n\nfunction findFirstString(shaderSource, strings) {\n  const stringsLength = strings.length;\n  for (let i = 0; i < stringsLength; ++i) {\n    const string = strings[i];\n    if (containsString(shaderSource, string)) {\n      return string;\n    }\n  }\n  return undefined;\n}\n\nconst normalVaryingNames = [\"v_normalEC\", \"v_normal\"];\n\nShaderSource.findNormalVarying = function (shaderSource) {\n  // Fix for Model: the shader text always has the word v_normalEC\n  // wrapped in an #ifdef so instead of looking for v_normalEC look for the define\n  if (containsString(shaderSource, \"#ifdef HAS_NORMALS\")) {\n    if (containsDefine(shaderSource, \"HAS_NORMALS\")) {\n      return \"v_normalEC\";\n    }\n    return undefined;\n  }\n\n  return findFirstString(shaderSource, normalVaryingNames);\n};\n\nconst positionVaryingNames = [\"v_positionEC\"];\n\nShaderSource.findPositionVarying = function (shaderSource) {\n  return findFirstString(shaderSource, positionVaryingNames);\n};\nexport default ShaderSource;\n", "import defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport ShaderProgram from \"./ShaderProgram.js\";\nimport ShaderSource from \"./ShaderSource.js\";\n\n/**\n * @private\n */\nfunction ShaderCache(context) {\n  this._context = context;\n  this._shaders = {};\n  this._numberOfShaders = 0;\n  this._shadersToRelease = {};\n}\n\nObject.defineProperties(ShaderCache.prototype, {\n  numberOfShaders: {\n    get: function () {\n      return this._numberOfShaders;\n    },\n  },\n});\n\n/**\n     * Returns a shader program from the cache, or creates and caches a new shader program,\n     * given the GLSL vertex and fragment shader source and attribute locations.\n     * <p>\n     * The difference between this and {@link ShaderCache#getShaderProgram}, is this is used to\n     * replace an existing reference to a shader program, which is passed as the first argument.\n     * </p>\n     *\n     * @param {object} options Object with the following properties:\n     * @param {ShaderProgram} [options.shaderProgram] The shader program that is being reassigned.\n     * @param {string|ShaderSource} options.vertexShaderSource The GLSL source for the vertex shader.\n     * @param {string|ShaderSource} options.fragmentShaderSource The GLSL source for the fragment shader.\n     * @param {object} options.attributeLocations Indices for the attribute inputs to the vertex shader.\n\n     * @returns {ShaderProgram} The cached or newly created shader program.\n     *\n     *\n     * @example\n     * this._shaderProgram = context.shaderCache.replaceShaderProgram({\n     *     shaderProgram : this._shaderProgram,\n     *     vertexShaderSource : vs,\n     *     fragmentShaderSource : fs,\n     *     attributeLocations : attributeLocations\n     * });\n     *\n     * @see ShaderCache#getShaderProgram\n     */\nShaderCache.prototype.replaceShaderProgram = function (options) {\n  if (defined(options.shaderProgram)) {\n    options.shaderProgram.destroy();\n  }\n\n  return this.getShaderProgram(options);\n};\n\nfunction toSortedJson(dictionary) {\n  const sortedKeys = Object.keys(dictionary).sort();\n  return JSON.stringify(dictionary, sortedKeys);\n}\n\n/**\n * Returns a shader program from the cache, or creates and caches a new shader program,\n * given the GLSL vertex and fragment shader source and attribute locations.\n *\n * @param {object} options Object with the following properties:\n * @param {string|ShaderSource} options.vertexShaderSource The GLSL source for the vertex shader.\n * @param {string|ShaderSource} options.fragmentShaderSource The GLSL source for the fragment shader.\n * @param {object} options.attributeLocations Indices for the attribute inputs to the vertex shader.\n *\n * @returns {ShaderProgram} The cached or newly created shader program.\n */\nShaderCache.prototype.getShaderProgram = function (options) {\n  // convert shaders which are provided as strings into ShaderSource objects\n  // because ShaderSource handles all the automatic including of built-in functions, etc.\n\n  let vertexShaderSource = options.vertexShaderSource;\n  let fragmentShaderSource = options.fragmentShaderSource;\n  const attributeLocations = options.attributeLocations;\n\n  if (typeof vertexShaderSource === \"string\") {\n    vertexShaderSource = new ShaderSource({\n      sources: [vertexShaderSource],\n    });\n  }\n\n  if (typeof fragmentShaderSource === \"string\") {\n    fragmentShaderSource = new ShaderSource({\n      sources: [fragmentShaderSource],\n    });\n  }\n\n  // Since ShaderSource.createCombinedXxxShader() can be expensive, use a\n  // simpler key for caching. This way, the function does not have to be called\n  // for each cache lookup.\n  const vertexShaderKey = vertexShaderSource.getCacheKey();\n  const fragmentShaderKey = fragmentShaderSource.getCacheKey();\n  // Sort the keys in the JSON to ensure a consistent order\n  const attributeLocationKey = defined(attributeLocations)\n    ? toSortedJson(attributeLocations)\n    : \"\";\n  const keyword = `${vertexShaderKey}:${fragmentShaderKey}:${attributeLocationKey}`;\n\n  let cachedShader;\n  if (defined(this._shaders[keyword])) {\n    cachedShader = this._shaders[keyword];\n\n    // No longer want to release this if it was previously released.\n    delete this._shadersToRelease[keyword];\n  } else {\n    const context = this._context;\n\n    const vertexShaderText = vertexShaderSource.createCombinedVertexShader(\n      context\n    );\n    const fragmentShaderText = fragmentShaderSource.createCombinedFragmentShader(\n      context\n    );\n\n    const shaderProgram = new ShaderProgram({\n      gl: context._gl,\n      logShaderCompilation: context.logShaderCompilation,\n      debugShaders: context.debugShaders,\n      vertexShaderSource: vertexShaderSource,\n      vertexShaderText: vertexShaderText,\n      fragmentShaderSource: fragmentShaderSource,\n      fragmentShaderText: fragmentShaderText,\n      attributeLocations: attributeLocations,\n    });\n\n    cachedShader = {\n      cache: this,\n      shaderProgram: shaderProgram,\n      keyword: keyword,\n      derivedKeywords: [],\n      count: 0,\n    };\n\n    // A shader can't be in more than one cache.\n    shaderProgram._cachedShader = cachedShader;\n    this._shaders[keyword] = cachedShader;\n    ++this._numberOfShaders;\n  }\n\n  ++cachedShader.count;\n  return cachedShader.shaderProgram;\n};\n\nShaderCache.prototype.replaceDerivedShaderProgram = function (\n  shaderProgram,\n  keyword,\n  options\n) {\n  const cachedShader = shaderProgram._cachedShader;\n  const derivedKeyword = keyword + cachedShader.keyword;\n  const cachedDerivedShader = this._shaders[derivedKeyword];\n  if (defined(cachedDerivedShader)) {\n    destroyShader(this, cachedDerivedShader);\n    const index = cachedShader.derivedKeywords.indexOf(keyword);\n    if (index > -1) {\n      cachedShader.derivedKeywords.splice(index, 1);\n    }\n  }\n\n  return this.createDerivedShaderProgram(shaderProgram, keyword, options);\n};\n\nShaderCache.prototype.getDerivedShaderProgram = function (\n  shaderProgram,\n  keyword\n) {\n  const cachedShader = shaderProgram._cachedShader;\n  const derivedKeyword = keyword + cachedShader.keyword;\n  const cachedDerivedShader = this._shaders[derivedKeyword];\n  if (!defined(cachedDerivedShader)) {\n    return undefined;\n  }\n\n  return cachedDerivedShader.shaderProgram;\n};\n\nShaderCache.prototype.createDerivedShaderProgram = function (\n  shaderProgram,\n  keyword,\n  options\n) {\n  const cachedShader = shaderProgram._cachedShader;\n  const derivedKeyword = keyword + cachedShader.keyword;\n\n  let vertexShaderSource = options.vertexShaderSource;\n  let fragmentShaderSource = options.fragmentShaderSource;\n  const attributeLocations = options.attributeLocations;\n\n  if (typeof vertexShaderSource === \"string\") {\n    vertexShaderSource = new ShaderSource({\n      sources: [vertexShaderSource],\n    });\n  }\n\n  if (typeof fragmentShaderSource === \"string\") {\n    fragmentShaderSource = new ShaderSource({\n      sources: [fragmentShaderSource],\n    });\n  }\n\n  const context = this._context;\n\n  const vertexShaderText = vertexShaderSource.createCombinedVertexShader(\n    context\n  );\n  const fragmentShaderText = fragmentShaderSource.createCombinedFragmentShader(\n    context\n  );\n\n  const derivedShaderProgram = new ShaderProgram({\n    gl: context._gl,\n    logShaderCompilation: context.logShaderCompilation,\n    debugShaders: context.debugShaders,\n    vertexShaderSource: vertexShaderSource,\n    vertexShaderText: vertexShaderText,\n    fragmentShaderSource: fragmentShaderSource,\n    fragmentShaderText: fragmentShaderText,\n    attributeLocations: attributeLocations,\n  });\n\n  const derivedCachedShader = {\n    cache: this,\n    shaderProgram: derivedShaderProgram,\n    keyword: derivedKeyword,\n    derivedKeywords: [],\n    count: 0,\n  };\n\n  cachedShader.derivedKeywords.push(keyword);\n  derivedShaderProgram._cachedShader = derivedCachedShader;\n  this._shaders[derivedKeyword] = derivedCachedShader;\n  return derivedShaderProgram;\n};\n\nfunction destroyShader(cache, cachedShader) {\n  const derivedKeywords = cachedShader.derivedKeywords;\n  const length = derivedKeywords.length;\n  for (let i = 0; i < length; ++i) {\n    const keyword = derivedKeywords[i] + cachedShader.keyword;\n    const derivedCachedShader = cache._shaders[keyword];\n    destroyShader(cache, derivedCachedShader);\n  }\n\n  delete cache._shaders[cachedShader.keyword];\n  cachedShader.shaderProgram.finalDestroy();\n}\n\nShaderCache.prototype.destroyReleasedShaderPrograms = function () {\n  const shadersToRelease = this._shadersToRelease;\n\n  for (const keyword in shadersToRelease) {\n    if (shadersToRelease.hasOwnProperty(keyword)) {\n      const cachedShader = shadersToRelease[keyword];\n      destroyShader(this, cachedShader);\n      --this._numberOfShaders;\n    }\n  }\n\n  this._shadersToRelease = {};\n};\n\nShaderCache.prototype.releaseShaderProgram = function (shaderProgram) {\n  if (defined(shaderProgram)) {\n    const cachedShader = shaderProgram._cachedShader;\n    if (cachedShader && --cachedShader.count === 0) {\n      this._shadersToRelease[cachedShader.keyword] = cachedShader;\n    }\n  }\n};\n\nShaderCache.prototype.isDestroyed = function () {\n  return false;\n};\n\nShaderCache.prototype.destroy = function () {\n  const shaders = this._shaders;\n  for (const keyword in shaders) {\n    if (shaders.hasOwnProperty(keyword)) {\n      shaders[keyword].shaderProgram.finalDestroy();\n    }\n  }\n  return destroyObject(this);\n};\nexport default ShaderCache;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Check from \"../Core/Check.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport ContextLimits from \"./ContextLimits.js\";\nimport MipmapHint from \"./MipmapHint.js\";\nimport PixelDatatype from \"./PixelDatatype.js\";\nimport Sampler from \"./Sampler.js\";\nimport TextureMagnificationFilter from \"./TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"./TextureMinificationFilter.js\";\n\n/**\n * @private\n */\nfunction Texture(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.context\", options.context);\n  //>>includeEnd('debug');\n\n  const context = options.context;\n  let width = options.width;\n  let height = options.height;\n  const source = options.source;\n\n  if (defined(source)) {\n    if (!defined(width)) {\n      width = defaultValue(source.videoWidth, source.width);\n    }\n    if (!defined(height)) {\n      height = defaultValue(source.videoHeight, source.height);\n    }\n  }\n\n  const pixelFormat = defaultValue(options.pixelFormat, PixelFormat.RGBA);\n  const pixelDatatype = defaultValue(\n    options.pixelDatatype,\n    PixelDatatype.UNSIGNED_BYTE\n  );\n  const internalFormat = PixelFormat.toInternalFormat(\n    pixelFormat,\n    pixelDatatype,\n    context\n  );\n\n  const isCompressed = PixelFormat.isCompressedFormat(internalFormat);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(width) || !defined(height)) {\n    throw new DeveloperError(\n      \"options requires a source field to create an initialized texture or width and height fields to create a blank texture.\"\n    );\n  }\n\n  Check.typeOf.number.greaterThan(\"width\", width, 0);\n\n  if (width > ContextLimits.maximumTextureSize) {\n    throw new DeveloperError(\n      `Width must be less than or equal to the maximum texture size (${ContextLimits.maximumTextureSize}).  Check maximumTextureSize.`\n    );\n  }\n\n  Check.typeOf.number.greaterThan(\"height\", height, 0);\n\n  if (height > ContextLimits.maximumTextureSize) {\n    throw new DeveloperError(\n      `Height must be less than or equal to the maximum texture size (${ContextLimits.maximumTextureSize}).  Check maximumTextureSize.`\n    );\n  }\n\n  if (!PixelFormat.validate(pixelFormat)) {\n    throw new DeveloperError(\"Invalid options.pixelFormat.\");\n  }\n\n  if (!isCompressed && !PixelDatatype.validate(pixelDatatype)) {\n    throw new DeveloperError(\"Invalid options.pixelDatatype.\");\n  }\n\n  if (\n    pixelFormat === PixelFormat.DEPTH_COMPONENT &&\n    pixelDatatype !== PixelDatatype.UNSIGNED_SHORT &&\n    pixelDatatype !== PixelDatatype.UNSIGNED_INT\n  ) {\n    throw new DeveloperError(\n      \"When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.\"\n    );\n  }\n\n  if (\n    pixelFormat === PixelFormat.DEPTH_STENCIL &&\n    pixelDatatype !== PixelDatatype.UNSIGNED_INT_24_8\n  ) {\n    throw new DeveloperError(\n      \"When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.\"\n    );\n  }\n\n  if (pixelDatatype === PixelDatatype.FLOAT && !context.floatingPointTexture) {\n    throw new DeveloperError(\n      \"When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.  Check context.floatingPointTexture.\"\n    );\n  }\n\n  if (\n    pixelDatatype === PixelDatatype.HALF_FLOAT &&\n    !context.halfFloatingPointTexture\n  ) {\n    throw new DeveloperError(\n      \"When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.\"\n    );\n  }\n\n  if (PixelFormat.isDepthFormat(pixelFormat)) {\n    if (defined(source)) {\n      throw new DeveloperError(\n        \"When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.\"\n      );\n    }\n\n    if (!context.depthTexture) {\n      throw new DeveloperError(\n        \"When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture.  Check context.depthTexture.\"\n      );\n    }\n  }\n\n  if (isCompressed) {\n    if (!defined(source) || !defined(source.arrayBufferView)) {\n      throw new DeveloperError(\n        \"When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.\"\n      );\n    }\n\n    if (PixelFormat.isDXTFormat(internalFormat) && !context.s3tc) {\n      throw new DeveloperError(\n        \"When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.\"\n      );\n    } else if (PixelFormat.isPVRTCFormat(internalFormat) && !context.pvrtc) {\n      throw new DeveloperError(\n        \"When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.\"\n      );\n    } else if (PixelFormat.isASTCFormat(internalFormat) && !context.astc) {\n      throw new DeveloperError(\n        \"When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.\"\n      );\n    } else if (PixelFormat.isETC2Format(internalFormat) && !context.etc) {\n      throw new DeveloperError(\n        \"When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.\"\n      );\n    } else if (PixelFormat.isETC1Format(internalFormat) && !context.etc1) {\n      throw new DeveloperError(\n        \"When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.\"\n      );\n    } else if (PixelFormat.isBC7Format(internalFormat) && !context.bc7) {\n      throw new DeveloperError(\n        \"When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.\"\n      );\n    }\n\n    if (\n      PixelFormat.compressedTextureSizeInBytes(\n        internalFormat,\n        width,\n        height\n      ) !== source.arrayBufferView.byteLength\n    ) {\n      throw new DeveloperError(\n        \"The byte length of the array buffer is invalid for the compressed texture with the given width and height.\"\n      );\n    }\n  }\n  //>>includeEnd('debug');\n\n  // Use premultiplied alpha for opaque textures should perform better on Chrome:\n  // http://media.tojicode.com/webglCamp4/#20\n  const preMultiplyAlpha =\n    options.preMultiplyAlpha ||\n    pixelFormat === PixelFormat.RGB ||\n    pixelFormat === PixelFormat.LUMINANCE;\n  const flipY = defaultValue(options.flipY, true);\n  const skipColorSpaceConversion = defaultValue(\n    options.skipColorSpaceConversion,\n    false\n  );\n\n  let initialized = true;\n\n  const gl = context._gl;\n  const textureTarget = gl.TEXTURE_2D;\n  const texture = gl.createTexture();\n\n  gl.activeTexture(gl.TEXTURE0);\n  gl.bindTexture(textureTarget, texture);\n\n  let unpackAlignment = 4;\n  if (defined(source) && defined(source.arrayBufferView) && !isCompressed) {\n    unpackAlignment = PixelFormat.alignmentInBytes(\n      pixelFormat,\n      pixelDatatype,\n      width\n    );\n  }\n\n  gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);\n\n  if (skipColorSpaceConversion) {\n    gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);\n  } else {\n    gl.pixelStorei(\n      gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,\n      gl.BROWSER_DEFAULT_WEBGL\n    );\n  }\n\n  if (defined(source)) {\n    if (defined(source.arrayBufferView)) {\n      gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n      gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n      // Source: typed array\n      let arrayBufferView = source.arrayBufferView;\n      let i, mipWidth, mipHeight;\n      if (isCompressed) {\n        gl.compressedTexImage2D(\n          textureTarget,\n          0,\n          internalFormat,\n          width,\n          height,\n          0,\n          arrayBufferView\n        );\n        if (defined(source.mipLevels)) {\n          mipWidth = width;\n          mipHeight = height;\n          for (i = 0; i < source.mipLevels.length; ++i) {\n            mipWidth = Math.floor(mipWidth / 2) | 0;\n            if (mipWidth < 1) {\n              mipWidth = 1;\n            }\n            mipHeight = Math.floor(mipHeight / 2) | 0;\n            if (mipHeight < 1) {\n              mipHeight = 1;\n            }\n            gl.compressedTexImage2D(\n              textureTarget,\n              i + 1,\n              internalFormat,\n              mipWidth,\n              mipHeight,\n              0,\n              source.mipLevels[i]\n            );\n          }\n        }\n      } else {\n        if (flipY) {\n          arrayBufferView = PixelFormat.flipY(\n            arrayBufferView,\n            pixelFormat,\n            pixelDatatype,\n            width,\n            height\n          );\n        }\n        gl.texImage2D(\n          textureTarget,\n          0,\n          internalFormat,\n          width,\n          height,\n          0,\n          pixelFormat,\n          PixelDatatype.toWebGLConstant(pixelDatatype, context),\n          arrayBufferView\n        );\n\n        if (defined(source.mipLevels)) {\n          mipWidth = width;\n          mipHeight = height;\n          for (i = 0; i < source.mipLevels.length; ++i) {\n            mipWidth = Math.floor(mipWidth / 2) | 0;\n            if (mipWidth < 1) {\n              mipWidth = 1;\n            }\n            mipHeight = Math.floor(mipHeight / 2) | 0;\n            if (mipHeight < 1) {\n              mipHeight = 1;\n            }\n            gl.texImage2D(\n              textureTarget,\n              i + 1,\n              internalFormat,\n              mipWidth,\n              mipHeight,\n              0,\n              pixelFormat,\n              PixelDatatype.toWebGLConstant(pixelDatatype, context),\n              source.mipLevels[i]\n            );\n          }\n        }\n      }\n    } else if (defined(source.framebuffer)) {\n      gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n      gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n      // Source: framebuffer\n      if (source.framebuffer !== context.defaultFramebuffer) {\n        source.framebuffer._bind();\n      }\n\n      gl.copyTexImage2D(\n        textureTarget,\n        0,\n        internalFormat,\n        source.xOffset,\n        source.yOffset,\n        width,\n        height,\n        0\n      );\n\n      if (source.framebuffer !== context.defaultFramebuffer) {\n        source.framebuffer._unBind();\n      }\n    } else {\n      // Only valid for DOM-Element uploads\n      gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);\n      gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);\n\n      // Source: ImageData, HTMLImageElement, HTMLCanvasElement, or HTMLVideoElement\n      gl.texImage2D(\n        textureTarget,\n        0,\n        internalFormat,\n        pixelFormat,\n        PixelDatatype.toWebGLConstant(pixelDatatype, context),\n        source\n      );\n    }\n  } else {\n    gl.texImage2D(\n      textureTarget,\n      0,\n      internalFormat,\n      width,\n      height,\n      0,\n      pixelFormat,\n      PixelDatatype.toWebGLConstant(pixelDatatype, context),\n      null\n    );\n    initialized = false;\n  }\n  gl.bindTexture(textureTarget, null);\n\n  let sizeInBytes;\n  if (isCompressed) {\n    sizeInBytes = PixelFormat.compressedTextureSizeInBytes(\n      pixelFormat,\n      width,\n      height\n    );\n  } else {\n    sizeInBytes = PixelFormat.textureSizeInBytes(\n      pixelFormat,\n      pixelDatatype,\n      width,\n      height\n    );\n  }\n\n  this._id = createGuid();\n  this._context = context;\n  this._textureFilterAnisotropic = context._textureFilterAnisotropic;\n  this._textureTarget = textureTarget;\n  this._texture = texture;\n  this._internalFormat = internalFormat;\n  this._pixelFormat = pixelFormat;\n  this._pixelDatatype = pixelDatatype;\n  this._width = width;\n  this._height = height;\n  this._dimensions = new Cartesian2(width, height);\n  this._hasMipmap = false;\n  this._sizeInBytes = sizeInBytes;\n  this._preMultiplyAlpha = preMultiplyAlpha;\n  this._flipY = flipY;\n  this._initialized = initialized;\n  this._sampler = undefined;\n\n  this.sampler = defined(options.sampler) ? options.sampler : new Sampler();\n}\n\n/**\n * This function is identical to using the Texture constructor except that it can be\n * replaced with a mock/spy in tests.\n * @private\n */\nTexture.create = function (options) {\n  return new Texture(options);\n};\n\n/**\n * Creates a texture, and copies a subimage of the framebuffer to it.  When called without arguments,\n * the texture is the same width and height as the framebuffer and contains its contents.\n *\n * @param {object} options Object with the following properties:\n * @param {Context} options.context The context in which the Texture gets created.\n * @param {PixelFormat} [options.pixelFormat=PixelFormat.RGB] The texture's internal pixel format.\n * @param {number} [options.framebufferXOffset=0] An offset in the x direction in the framebuffer where copying begins from.\n * @param {number} [options.framebufferYOffset=0] An offset in the y direction in the framebuffer where copying begins from.\n * @param {number} [options.width=canvas.clientWidth] The width of the texture in texels.\n * @param {number} [options.height=canvas.clientHeight] The height of the texture in texels.\n * @param {Framebuffer} [options.framebuffer=defaultFramebuffer] The framebuffer from which to create the texture.  If this\n *        parameter is not specified, the default framebuffer is used.\n * @returns {Texture} A texture with contents from the framebuffer.\n *\n * @exception {DeveloperError} Invalid pixelFormat.\n * @exception {DeveloperError} pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.\n * @exception {DeveloperError} framebufferXOffset must be greater than or equal to zero.\n * @exception {DeveloperError} framebufferYOffset must be greater than or equal to zero.\n * @exception {DeveloperError} framebufferXOffset + width must be less than or equal to canvas.clientWidth.\n * @exception {DeveloperError} framebufferYOffset + height must be less than or equal to canvas.clientHeight.\n *\n *\n * @example\n * // Create a texture with the contents of the framebuffer.\n * const t = Texture.fromFramebuffer({\n *     context : context\n * });\n *\n * @see Sampler\n *\n * @private\n */\nTexture.fromFramebuffer = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.context\", options.context);\n  //>>includeEnd('debug');\n\n  const context = options.context;\n  const gl = context._gl;\n\n  const pixelFormat = defaultValue(options.pixelFormat, PixelFormat.RGB);\n  const framebufferXOffset = defaultValue(options.framebufferXOffset, 0);\n  const framebufferYOffset = defaultValue(options.framebufferYOffset, 0);\n  const width = defaultValue(options.width, gl.drawingBufferWidth);\n  const height = defaultValue(options.height, gl.drawingBufferHeight);\n  const framebuffer = options.framebuffer;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!PixelFormat.validate(pixelFormat)) {\n    throw new DeveloperError(\"Invalid pixelFormat.\");\n  }\n  if (\n    PixelFormat.isDepthFormat(pixelFormat) ||\n    PixelFormat.isCompressedFormat(pixelFormat)\n  ) {\n    throw new DeveloperError(\n      \"pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.\"\n    );\n  }\n  Check.defined(\"options.context\", options.context);\n  Check.typeOf.number.greaterThanOrEquals(\n    \"framebufferXOffset\",\n    framebufferXOffset,\n    0\n  );\n  Check.typeOf.number.greaterThanOrEquals(\n    \"framebufferYOffset\",\n    framebufferYOffset,\n    0\n  );\n  if (framebufferXOffset + width > gl.drawingBufferWidth) {\n    throw new DeveloperError(\n      \"framebufferXOffset + width must be less than or equal to drawingBufferWidth\"\n    );\n  }\n  if (framebufferYOffset + height > gl.drawingBufferHeight) {\n    throw new DeveloperError(\n      \"framebufferYOffset + height must be less than or equal to drawingBufferHeight.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const texture = new Texture({\n    context: context,\n    width: width,\n    height: height,\n    pixelFormat: pixelFormat,\n    source: {\n      framebuffer: defined(framebuffer)\n        ? framebuffer\n        : context.defaultFramebuffer,\n      xOffset: framebufferXOffset,\n      yOffset: framebufferYOffset,\n      width: width,\n      height: height,\n    },\n  });\n\n  return texture;\n};\n\nObject.defineProperties(Texture.prototype, {\n  /**\n   * A unique id for the texture\n   * @memberof Texture.prototype\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n  /**\n   * The sampler to use when sampling this texture.\n   * Create a sampler by calling {@link Sampler}.  If this\n   * parameter is not specified, a default sampler is used.  The default sampler clamps texture\n   * coordinates in both directions, uses linear filtering for both magnification and minification,\n   * and uses a maximum anisotropy of 1.0.\n   * @memberof Texture.prototype\n   * @type {object}\n   */\n  sampler: {\n    get: function () {\n      return this._sampler;\n    },\n    set: function (sampler) {\n      let minificationFilter = sampler.minificationFilter;\n      let magnificationFilter = sampler.magnificationFilter;\n      const context = this._context;\n      const pixelFormat = this._pixelFormat;\n      const pixelDatatype = this._pixelDatatype;\n\n      const mipmap =\n        minificationFilter ===\n          TextureMinificationFilter.NEAREST_MIPMAP_NEAREST ||\n        minificationFilter ===\n          TextureMinificationFilter.NEAREST_MIPMAP_LINEAR ||\n        minificationFilter ===\n          TextureMinificationFilter.LINEAR_MIPMAP_NEAREST ||\n        minificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_LINEAR;\n\n      // float textures only support nearest filtering unless the linear extensions are supported, so override the sampler's settings\n      if (\n        (pixelDatatype === PixelDatatype.FLOAT &&\n          !context.textureFloatLinear) ||\n        (pixelDatatype === PixelDatatype.HALF_FLOAT &&\n          !context.textureHalfFloatLinear)\n      ) {\n        minificationFilter = mipmap\n          ? TextureMinificationFilter.NEAREST_MIPMAP_NEAREST\n          : TextureMinificationFilter.NEAREST;\n        magnificationFilter = TextureMagnificationFilter.NEAREST;\n      }\n\n      // WebGL 2 depth texture only support nearest filtering. See section 3.8.13 OpenGL ES 3 spec\n      if (context.webgl2) {\n        if (PixelFormat.isDepthFormat(pixelFormat)) {\n          minificationFilter = TextureMinificationFilter.NEAREST;\n          magnificationFilter = TextureMagnificationFilter.NEAREST;\n        }\n      }\n\n      const gl = context._gl;\n      const target = this._textureTarget;\n\n      gl.activeTexture(gl.TEXTURE0);\n      gl.bindTexture(target, this._texture);\n      gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, minificationFilter);\n      gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, magnificationFilter);\n      gl.texParameteri(target, gl.TEXTURE_WRAP_S, sampler.wrapS);\n      gl.texParameteri(target, gl.TEXTURE_WRAP_T, sampler.wrapT);\n      if (defined(this._textureFilterAnisotropic)) {\n        gl.texParameteri(\n          target,\n          this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,\n          sampler.maximumAnisotropy\n        );\n      }\n      gl.bindTexture(target, null);\n\n      this._sampler = sampler;\n    },\n  },\n  pixelFormat: {\n    get: function () {\n      return this._pixelFormat;\n    },\n  },\n  pixelDatatype: {\n    get: function () {\n      return this._pixelDatatype;\n    },\n  },\n  dimensions: {\n    get: function () {\n      return this._dimensions;\n    },\n  },\n  preMultiplyAlpha: {\n    get: function () {\n      return this._preMultiplyAlpha;\n    },\n  },\n  flipY: {\n    get: function () {\n      return this._flipY;\n    },\n  },\n  width: {\n    get: function () {\n      return this._width;\n    },\n  },\n  height: {\n    get: function () {\n      return this._height;\n    },\n  },\n  sizeInBytes: {\n    get: function () {\n      if (this._hasMipmap) {\n        return Math.floor((this._sizeInBytes * 4) / 3);\n      }\n      return this._sizeInBytes;\n    },\n  },\n  _target: {\n    get: function () {\n      return this._textureTarget;\n    },\n  },\n});\n\n/**\n * Copy new image data into this texture, from a source {@link ImageData}, {@link HTMLImageElement}, {@link HTMLCanvasElement}, or {@link HTMLVideoElement}.\n * or an object with width, height, and arrayBufferView properties.\n * @param {object} options Object with the following properties:\n * @param {object} options.source The source {@link ImageData}, {@link HTMLImageElement}, {@link HTMLCanvasElement}, or {@link HTMLVideoElement},\n *                        or an object with width, height, and arrayBufferView properties.\n * @param {number} [options.xOffset=0] The offset in the x direction within the texture to copy into.\n * @param {number} [options.yOffset=0] The offset in the y direction within the texture to copy into.\n * @param {boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the texture will be ignored.\n *\n * @exception {DeveloperError} Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.\n * @exception {DeveloperError} Cannot call copyFrom with a compressed texture pixel format.\n * @exception {DeveloperError} xOffset must be greater than or equal to zero.\n * @exception {DeveloperError} yOffset must be greater than or equal to zero.\n * @exception {DeveloperError} xOffset + source.width must be less than or equal to width.\n * @exception {DeveloperError} yOffset + source.height must be less than or equal to height.\n * @exception {DeveloperError} This texture was destroyed, i.e., destroy() was called.\n *\n * @example\n * texture.copyFrom({\n *  source: {\n *   width : 1,\n *   height : 1,\n *   arrayBufferView : new Uint8Array([255, 0, 0, 255])\n *  }\n * });\n */\nTexture.prototype.copyFrom = function (options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options\", options);\n  //>>includeEnd('debug');\n\n  const xOffset = defaultValue(options.xOffset, 0);\n  const yOffset = defaultValue(options.yOffset, 0);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.source\", options.source);\n  if (PixelFormat.isDepthFormat(this._pixelFormat)) {\n    throw new DeveloperError(\n      \"Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.\"\n    );\n  }\n  if (PixelFormat.isCompressedFormat(this._pixelFormat)) {\n    throw new DeveloperError(\n      \"Cannot call copyFrom with a compressed texture pixel format.\"\n    );\n  }\n  Check.typeOf.number.greaterThanOrEquals(\"xOffset\", xOffset, 0);\n  Check.typeOf.number.greaterThanOrEquals(\"yOffset\", yOffset, 0);\n  Check.typeOf.number.lessThanOrEquals(\n    \"xOffset + options.source.width\",\n    xOffset + options.source.width,\n    this._width\n  );\n  Check.typeOf.number.lessThanOrEquals(\n    \"yOffset + options.source.height\",\n    yOffset + options.source.height,\n    this._height\n  );\n  //>>includeEnd('debug');\n\n  const source = options.source;\n\n  const context = this._context;\n  const gl = context._gl;\n  const target = this._textureTarget;\n\n  gl.activeTexture(gl.TEXTURE0);\n  gl.bindTexture(target, this._texture);\n\n  const width = source.width;\n  const height = source.height;\n  let arrayBufferView = source.arrayBufferView;\n\n  const textureWidth = this._width;\n  const textureHeight = this._height;\n  const internalFormat = this._internalFormat;\n  const pixelFormat = this._pixelFormat;\n  const pixelDatatype = this._pixelDatatype;\n\n  const preMultiplyAlpha = this._preMultiplyAlpha;\n  const flipY = this._flipY;\n  const skipColorSpaceConversion = defaultValue(\n    options.skipColorSpaceConversion,\n    false\n  );\n\n  let unpackAlignment = 4;\n  if (defined(arrayBufferView)) {\n    unpackAlignment = PixelFormat.alignmentInBytes(\n      pixelFormat,\n      pixelDatatype,\n      width\n    );\n  }\n\n  gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);\n\n  if (skipColorSpaceConversion) {\n    gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);\n  } else {\n    gl.pixelStorei(\n      gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,\n      gl.BROWSER_DEFAULT_WEBGL\n    );\n  }\n\n  let uploaded = false;\n  if (!this._initialized) {\n    if (\n      xOffset === 0 &&\n      yOffset === 0 &&\n      width === textureWidth &&\n      height === textureHeight\n    ) {\n      // initialize the entire texture\n      if (defined(arrayBufferView)) {\n        gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n        if (flipY) {\n          arrayBufferView = PixelFormat.flipY(\n            arrayBufferView,\n            pixelFormat,\n            pixelDatatype,\n            textureWidth,\n            textureHeight\n          );\n        }\n        gl.texImage2D(\n          target,\n          0,\n          internalFormat,\n          textureWidth,\n          textureHeight,\n          0,\n          pixelFormat,\n          PixelDatatype.toWebGLConstant(pixelDatatype, context),\n          arrayBufferView\n        );\n      } else {\n        // Only valid for DOM-Element uploads\n        gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);\n        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);\n\n        gl.texImage2D(\n          target,\n          0,\n          internalFormat,\n          pixelFormat,\n          PixelDatatype.toWebGLConstant(pixelDatatype, context),\n          source\n        );\n      }\n      uploaded = true;\n    } else {\n      gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n      gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n      // initialize the entire texture to zero\n      const bufferView = PixelFormat.createTypedArray(\n        pixelFormat,\n        pixelDatatype,\n        textureWidth,\n        textureHeight\n      );\n      gl.texImage2D(\n        target,\n        0,\n        internalFormat,\n        textureWidth,\n        textureHeight,\n        0,\n        pixelFormat,\n        PixelDatatype.toWebGLConstant(pixelDatatype, context),\n        bufferView\n      );\n    }\n    this._initialized = true;\n  }\n\n  if (!uploaded) {\n    if (defined(arrayBufferView)) {\n      gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n      gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n      if (flipY) {\n        arrayBufferView = PixelFormat.flipY(\n          arrayBufferView,\n          pixelFormat,\n          pixelDatatype,\n          width,\n          height\n        );\n      }\n      gl.texSubImage2D(\n        target,\n        0,\n        xOffset,\n        yOffset,\n        width,\n        height,\n        pixelFormat,\n        PixelDatatype.toWebGLConstant(pixelDatatype, context),\n        arrayBufferView\n      );\n    } else {\n      // Only valid for DOM-Element uploads\n      gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);\n      gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);\n\n      gl.texSubImage2D(\n        target,\n        0,\n        xOffset,\n        yOffset,\n        pixelFormat,\n        PixelDatatype.toWebGLConstant(pixelDatatype, context),\n        source\n      );\n    }\n  }\n\n  gl.bindTexture(target, null);\n};\n\n/**\n * @param {number} [xOffset=0] The offset in the x direction within the texture to copy into.\n * @param {number} [yOffset=0] The offset in the y direction within the texture to copy into.\n * @param {number} [framebufferXOffset=0] optional\n * @param {number} [framebufferYOffset=0] optional\n * @param {number} [width=width] optional\n * @param {number} [height=height] optional\n *\n * @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.\n * @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.\n * @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.\n * @exception {DeveloperError} Cannot call copyFrom with a compressed texture pixel format.\n * @exception {DeveloperError} This texture was destroyed, i.e., destroy() was called.\n * @exception {DeveloperError} xOffset must be greater than or equal to zero.\n * @exception {DeveloperError} yOffset must be greater than or equal to zero.\n * @exception {DeveloperError} framebufferXOffset must be greater than or equal to zero.\n * @exception {DeveloperError} framebufferYOffset must be greater than or equal to zero.\n * @exception {DeveloperError} xOffset + width must be less than or equal to width.\n * @exception {DeveloperError} yOffset + height must be less than or equal to height.\n */\nTexture.prototype.copyFromFramebuffer = function (\n  xOffset,\n  yOffset,\n  framebufferXOffset,\n  framebufferYOffset,\n  width,\n  height\n) {\n  xOffset = defaultValue(xOffset, 0);\n  yOffset = defaultValue(yOffset, 0);\n  framebufferXOffset = defaultValue(framebufferXOffset, 0);\n  framebufferYOffset = defaultValue(framebufferYOffset, 0);\n  width = defaultValue(width, this._width);\n  height = defaultValue(height, this._height);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (PixelFormat.isDepthFormat(this._pixelFormat)) {\n    throw new DeveloperError(\n      \"Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.\"\n    );\n  }\n  if (this._pixelDatatype === PixelDatatype.FLOAT) {\n    throw new DeveloperError(\n      \"Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.\"\n    );\n  }\n  if (this._pixelDatatype === PixelDatatype.HALF_FLOAT) {\n    throw new DeveloperError(\n      \"Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.\"\n    );\n  }\n  if (PixelFormat.isCompressedFormat(this._pixelFormat)) {\n    throw new DeveloperError(\n      \"Cannot call copyFrom with a compressed texture pixel format.\"\n    );\n  }\n\n  Check.typeOf.number.greaterThanOrEquals(\"xOffset\", xOffset, 0);\n  Check.typeOf.number.greaterThanOrEquals(\"yOffset\", yOffset, 0);\n  Check.typeOf.number.greaterThanOrEquals(\n    \"framebufferXOffset\",\n    framebufferXOffset,\n    0\n  );\n  Check.typeOf.number.greaterThanOrEquals(\n    \"framebufferYOffset\",\n    framebufferYOffset,\n    0\n  );\n  Check.typeOf.number.lessThanOrEquals(\n    \"xOffset + width\",\n    xOffset + width,\n    this._width\n  );\n  Check.typeOf.number.lessThanOrEquals(\n    \"yOffset + height\",\n    yOffset + height,\n    this._height\n  );\n  //>>includeEnd('debug');\n\n  const gl = this._context._gl;\n  const target = this._textureTarget;\n\n  gl.activeTexture(gl.TEXTURE0);\n  gl.bindTexture(target, this._texture);\n  gl.copyTexSubImage2D(\n    target,\n    0,\n    xOffset,\n    yOffset,\n    framebufferXOffset,\n    framebufferYOffset,\n    width,\n    height\n  );\n  gl.bindTexture(target, null);\n  this._initialized = true;\n};\n\n/**\n * @param {MipmapHint} [hint=MipmapHint.DONT_CARE] optional.\n *\n * @exception {DeveloperError} Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.\n * @exception {DeveloperError} Cannot call generateMipmap when the texture pixel format is a compressed format.\n * @exception {DeveloperError} hint is invalid.\n * @exception {DeveloperError} This texture's width must be a power of two to call generateMipmap() in a WebGL1 context.\n * @exception {DeveloperError} This texture's height must be a power of two to call generateMipmap() in a WebGL1 context.\n * @exception {DeveloperError} This texture was destroyed, i.e., destroy() was called.\n */\nTexture.prototype.generateMipmap = function (hint) {\n  hint = defaultValue(hint, MipmapHint.DONT_CARE);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (PixelFormat.isDepthFormat(this._pixelFormat)) {\n    throw new DeveloperError(\n      \"Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.\"\n    );\n  }\n  if (PixelFormat.isCompressedFormat(this._pixelFormat)) {\n    throw new DeveloperError(\n      \"Cannot call generateMipmap with a compressed pixel format.\"\n    );\n  }\n  if (!this._context.webgl2) {\n    if (this._width > 1 && !CesiumMath.isPowerOfTwo(this._width)) {\n      throw new DeveloperError(\n        \"width must be a power of two to call generateMipmap() in a WebGL1 context.\"\n      );\n    }\n    if (this._height > 1 && !CesiumMath.isPowerOfTwo(this._height)) {\n      throw new DeveloperError(\n        \"height must be a power of two to call generateMipmap() in a WebGL1 context.\"\n      );\n    }\n  }\n  if (!MipmapHint.validate(hint)) {\n    throw new DeveloperError(\"hint is invalid.\");\n  }\n  //>>includeEnd('debug');\n\n  this._hasMipmap = true;\n\n  const gl = this._context._gl;\n  const target = this._textureTarget;\n\n  gl.hint(gl.GENERATE_MIPMAP_HINT, hint);\n  gl.activeTexture(gl.TEXTURE0);\n  gl.bindTexture(target, this._texture);\n  gl.generateMipmap(target);\n  gl.bindTexture(target, null);\n};\n\nTexture.prototype.isDestroyed = function () {\n  return false;\n};\n\nTexture.prototype.destroy = function () {\n  this._context._gl.deleteTexture(this._texture);\n  return destroyObject(this);\n};\nexport default Texture;\n", "import defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\n\n/**\n * @private\n */\nfunction TextureCache() {\n  this._textures = {};\n  this._numberOfTextures = 0;\n  this._texturesToRelease = {};\n}\n\nObject.defineProperties(TextureCache.prototype, {\n  numberOfTextures: {\n    get: function () {\n      return this._numberOfTextures;\n    },\n  },\n});\n\nTextureCache.prototype.getTexture = function (keyword) {\n  const cachedTexture = this._textures[keyword];\n  if (!defined(cachedTexture)) {\n    return undefined;\n  }\n\n  // No longer want to release this if it was previously released.\n  delete this._texturesToRelease[keyword];\n\n  ++cachedTexture.count;\n  return cachedTexture.texture;\n};\n\nTextureCache.prototype.addTexture = function (keyword, texture) {\n  const cachedTexture = {\n    texture: texture,\n    count: 1,\n  };\n\n  texture.finalDestroy = texture.destroy;\n\n  const that = this;\n  texture.destroy = function () {\n    if (--cachedTexture.count === 0) {\n      that._texturesToRelease[keyword] = cachedTexture;\n    }\n  };\n\n  this._textures[keyword] = cachedTexture;\n  ++this._numberOfTextures;\n};\n\nTextureCache.prototype.destroyReleasedTextures = function () {\n  const texturesToRelease = this._texturesToRelease;\n\n  for (const keyword in texturesToRelease) {\n    if (texturesToRelease.hasOwnProperty(keyword)) {\n      const cachedTexture = texturesToRelease[keyword];\n      delete this._textures[keyword];\n      cachedTexture.texture.finalDestroy();\n      --this._numberOfTextures;\n    }\n  }\n\n  this._texturesToRelease = {};\n};\n\nTextureCache.prototype.isDestroyed = function () {\n  return false;\n};\n\nTextureCache.prototype.destroy = function () {\n  const textures = this._textures;\n  for (const keyword in textures) {\n    if (textures.hasOwnProperty(keyword)) {\n      textures[keyword].texture.finalDestroy();\n    }\n  }\n  return destroyObject(this);\n};\nexport default TextureCache;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defined from \"./defined.js\";\n\n/**\n * A fixed-point encoding of a {@link Cartesian3} with 64-bit floating-point components, as two {@link Cartesian3}\n * values that, when converted to 32-bit floating-point and added, approximate the original input.\n * <p>\n * This is used to encode positions in vertex buffers for rendering without jittering artifacts\n * as described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\n * </p>\n *\n * @alias EncodedCartesian3\n * @constructor\n *\n * @private\n */\nfunction EncodedCartesian3() {\n  /**\n   * The high bits for each component.  Bits 0 to 22 store the whole value.  Bits 23 to 31 are not used.\n   *\n   * @type {Cartesian3}\n   * @default {@link Cartesian3.ZERO}\n   */\n  this.high = Cartesian3.clone(Cartesian3.ZERO);\n\n  /**\n   * The low bits for each component.  Bits 7 to 22 store the whole value, and bits 0 to 6 store the fraction.  Bits 23 to 31 are not used.\n   *\n   * @type {Cartesian3}\n   * @default {@link Cartesian3.ZERO}\n   */\n  this.low = Cartesian3.clone(Cartesian3.ZERO);\n}\n\n/**\n * Encodes a 64-bit floating-point value as two floating-point values that, when converted to\n * 32-bit floating-point and added, approximate the original input.  The returned object\n * has <code>high</code> and <code>low</code> properties for the high and low bits, respectively.\n * <p>\n * The fixed-point encoding follows {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\n * </p>\n *\n * @param {number} value The floating-point value to encode.\n * @param {object} [result] The object onto which to store the result.\n * @returns {object} The modified result parameter or a new instance if one was not provided.\n *\n * @example\n * const value = 1234567.1234567;\n * const splitValue = Cesium.EncodedCartesian3.encode(value);\n */\nEncodedCartesian3.encode = function (value, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"value\", value);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = {\n      high: 0.0,\n      low: 0.0,\n    };\n  }\n\n  let doubleHigh;\n  if (value >= 0.0) {\n    doubleHigh = Math.floor(value / 65536.0) * 65536.0;\n    result.high = doubleHigh;\n    result.low = value - doubleHigh;\n  } else {\n    doubleHigh = Math.floor(-value / 65536.0) * 65536.0;\n    result.high = -doubleHigh;\n    result.low = value + doubleHigh;\n  }\n\n  return result;\n};\n\nconst scratchEncode = {\n  high: 0.0,\n  low: 0.0,\n};\n\n/**\n * Encodes a {@link Cartesian3} with 64-bit floating-point components as two {@link Cartesian3}\n * values that, when converted to 32-bit floating-point and added, approximate the original input.\n * <p>\n * The fixed-point encoding follows {@link https://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\n * </p>\n *\n * @param {Cartesian3} cartesian The cartesian to encode.\n * @param {EncodedCartesian3} [result] The object onto which to store the result.\n * @returns {EncodedCartesian3} The modified result parameter or a new EncodedCartesian3 instance if one was not provided.\n *\n * @example\n * const cart = new Cesium.Cartesian3(-10000000.0, 0.0, 10000000.0);\n * const encoded = Cesium.EncodedCartesian3.fromCartesian(cart);\n */\nEncodedCartesian3.fromCartesian = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new EncodedCartesian3();\n  }\n\n  const high = result.high;\n  const low = result.low;\n\n  EncodedCartesian3.encode(cartesian.x, scratchEncode);\n  high.x = scratchEncode.high;\n  low.x = scratchEncode.low;\n\n  EncodedCartesian3.encode(cartesian.y, scratchEncode);\n  high.y = scratchEncode.high;\n  low.y = scratchEncode.low;\n\n  EncodedCartesian3.encode(cartesian.z, scratchEncode);\n  high.z = scratchEncode.high;\n  low.z = scratchEncode.low;\n\n  return result;\n};\n\nconst encodedP = new EncodedCartesian3();\n\n/**\n * Encodes the provided <code>cartesian</code>, and writes it to an array with <code>high</code>\n * components followed by <code>low</code> components, i.e. <code>[high.x, high.y, high.z, low.x, low.y, low.z]</code>.\n * <p>\n * This is used to create interleaved high-precision position vertex attributes.\n * </p>\n *\n * @param {Cartesian3} cartesian The cartesian to encode.\n * @param {number[]} cartesianArray The array to write to.\n * @param {number} index The index into the array to start writing.  Six elements will be written.\n *\n * @exception {DeveloperError} index must be a number greater than or equal to 0.\n *\n * @example\n * const positions = [\n *    new Cesium.Cartesian3(),\n *    // ...\n * ];\n * const encodedPositions = new Float32Array(2 * 3 * positions.length);\n * let j = 0;\n * for (let i = 0; i < positions.length; ++i) {\n *   Cesium.EncodedCartesian3.writeElement(positions[i], encodedPositions, j);\n *   j += 6;\n * }\n */\nEncodedCartesian3.writeElements = function (cartesian, cartesianArray, index) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartesianArray\", cartesianArray);\n  Check.typeOf.number(\"index\", index);\n  Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\n  //>>includeEnd('debug');\n\n  EncodedCartesian3.fromCartesian(cartesian, encodedP);\n  const high = encodedP.high;\n  const low = encodedP.low;\n\n  cartesianArray[index] = high.x;\n  cartesianArray[index + 1] = high.y;\n  cartesianArray[index + 2] = high.z;\n  cartesianArray[index + 3] = low.x;\n  cartesianArray[index + 4] = low.y;\n  cartesianArray[index + 5] = low.z;\n};\nexport default EncodedCartesian3;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Check from \"./Check.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix4 from \"./Matrix4.js\";\n\n/**\n * A plane in Hessian Normal Form defined by\n * <pre>\n * ax + by + cz + d = 0\n * </pre>\n * where (a, b, c) is the plane's <code>normal</code>, d is the signed\n * <code>distance</code> to the plane, and (x, y, z) is any point on\n * the plane.\n *\n * @alias Plane\n * @constructor\n *\n * @param {Cartesian3} normal The plane's normal (normalized).\n * @param {number} distance The shortest distance from the origin to the plane.  The sign of\n * <code>distance</code> determines which side of the plane the origin\n * is on.  If <code>distance</code> is positive, the origin is in the half-space\n * in the direction of the normal; if negative, the origin is in the half-space\n * opposite to the normal; if zero, the plane passes through the origin.\n *\n * @example\n * // The plane x=0\n * const plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0);\n *\n * @exception {DeveloperError} Normal must be normalized\n */\nfunction Plane(normal, distance) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"normal\", normal);\n  if (\n    !CesiumMath.equalsEpsilon(\n      Cartesian3.magnitude(normal),\n      1.0,\n      CesiumMath.EPSILON6\n    )\n  ) {\n    throw new DeveloperError(\"normal must be normalized.\");\n  }\n  Check.typeOf.number(\"distance\", distance);\n  //>>includeEnd('debug');\n\n  /**\n   * The plane's normal.\n   *\n   * @type {Cartesian3}\n   */\n  this.normal = Cartesian3.clone(normal);\n\n  /**\n   * The shortest distance from the origin to the plane.  The sign of\n   * <code>distance</code> determines which side of the plane the origin\n   * is on.  If <code>distance</code> is positive, the origin is in the half-space\n   * in the direction of the normal; if negative, the origin is in the half-space\n   * opposite to the normal; if zero, the plane passes through the origin.\n   *\n   * @type {number}\n   */\n  this.distance = distance;\n}\n\n/**\n * Creates a plane from a normal and a point on the plane.\n *\n * @param {Cartesian3} point The point on the plane.\n * @param {Cartesian3} normal The plane's normal (normalized).\n * @param {Plane} [result] The object onto which to store the result.\n * @returns {Plane} A new plane instance or the modified result parameter.\n *\n * @example\n * const point = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);\n * const normal = ellipsoid.geodeticSurfaceNormal(point);\n * const tangentPlane = Cesium.Plane.fromPointNormal(point, normal);\n *\n * @exception {DeveloperError} Normal must be normalized\n */\nPlane.fromPointNormal = function (point, normal, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"point\", point);\n  Check.typeOf.object(\"normal\", normal);\n  if (\n    !CesiumMath.equalsEpsilon(\n      Cartesian3.magnitude(normal),\n      1.0,\n      CesiumMath.EPSILON6\n    )\n  ) {\n    throw new DeveloperError(\"normal must be normalized.\");\n  }\n  //>>includeEnd('debug');\n\n  const distance = -Cartesian3.dot(normal, point);\n\n  if (!defined(result)) {\n    return new Plane(normal, distance);\n  }\n\n  Cartesian3.clone(normal, result.normal);\n  result.distance = distance;\n  return result;\n};\n\nconst scratchNormal = new Cartesian3();\n/**\n * Creates a plane from the general equation\n *\n * @param {Cartesian4} coefficients The plane's normal (normalized).\n * @param {Plane} [result] The object onto which to store the result.\n * @returns {Plane} A new plane instance or the modified result parameter.\n *\n * @exception {DeveloperError} Normal must be normalized\n */\nPlane.fromCartesian4 = function (coefficients, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"coefficients\", coefficients);\n  //>>includeEnd('debug');\n\n  const normal = Cartesian3.fromCartesian4(coefficients, scratchNormal);\n  const distance = coefficients.w;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    !CesiumMath.equalsEpsilon(\n      Cartesian3.magnitude(normal),\n      1.0,\n      CesiumMath.EPSILON6\n    )\n  ) {\n    throw new DeveloperError(\"normal must be normalized.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Plane(normal, distance);\n  }\n  Cartesian3.clone(normal, result.normal);\n  result.distance = distance;\n  return result;\n};\n\n/**\n * Computes the signed shortest distance of a point to a plane.\n * The sign of the distance determines which side of the plane the point\n * is on.  If the distance is positive, the point is in the half-space\n * in the direction of the normal; if negative, the point is in the half-space\n * opposite to the normal; if zero, the plane passes through the point.\n *\n * @param {Plane} plane The plane.\n * @param {Cartesian3} point The point.\n * @returns {number} The signed shortest distance of the point to the plane.\n */\nPlane.getPointDistance = function (plane, point) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"plane\", plane);\n  Check.typeOf.object(\"point\", point);\n  //>>includeEnd('debug');\n\n  return Cartesian3.dot(plane.normal, point) + plane.distance;\n};\n\nconst scratchCartesian = new Cartesian3();\n/**\n * Projects a point onto the plane.\n * @param {Plane} plane The plane to project the point onto\n * @param {Cartesian3} point The point to project onto the plane\n * @param {Cartesian3} [result] The result point.  If undefined, a new Cartesian3 will be created.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\n */\nPlane.projectPointOntoPlane = function (plane, point, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"plane\", plane);\n  Check.typeOf.object(\"point\", point);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  // projectedPoint = point - (normal.point + scale) * normal\n  const pointDistance = Plane.getPointDistance(plane, point);\n  const scaledNormal = Cartesian3.multiplyByScalar(\n    plane.normal,\n    pointDistance,\n    scratchCartesian\n  );\n\n  return Cartesian3.subtract(point, scaledNormal, result);\n};\n\nconst scratchInverseTranspose = new Matrix4();\nconst scratchPlaneCartesian4 = new Cartesian4();\nconst scratchTransformNormal = new Cartesian3();\n/**\n * Transforms the plane by the given transformation matrix.\n *\n * @param {Plane} plane The plane.\n * @param {Matrix4} transform The transformation matrix.\n * @param {Plane} [result] The object into which to store the result.\n * @returns {Plane} The plane transformed by the given transformation matrix.\n */\nPlane.transform = function (plane, transform, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"plane\", plane);\n  Check.typeOf.object(\"transform\", transform);\n  //>>includeEnd('debug');\n\n  const normal = plane.normal;\n  const distance = plane.distance;\n  const inverseTranspose = Matrix4.inverseTranspose(\n    transform,\n    scratchInverseTranspose\n  );\n  let planeAsCartesian4 = Cartesian4.fromElements(\n    normal.x,\n    normal.y,\n    normal.z,\n    distance,\n    scratchPlaneCartesian4\n  );\n  planeAsCartesian4 = Matrix4.multiplyByVector(\n    inverseTranspose,\n    planeAsCartesian4,\n    planeAsCartesian4\n  );\n\n  // Convert the transformed plane to Hessian Normal Form\n  const transformedNormal = Cartesian3.fromCartesian4(\n    planeAsCartesian4,\n    scratchTransformNormal\n  );\n\n  planeAsCartesian4 = Cartesian4.divideByScalar(\n    planeAsCartesian4,\n    Cartesian3.magnitude(transformedNormal),\n    planeAsCartesian4\n  );\n\n  return Plane.fromCartesian4(planeAsCartesian4, result);\n};\n\n/**\n * Duplicates a Plane instance.\n *\n * @param {Plane} plane The plane to duplicate.\n * @param {Plane} [result] The object onto which to store the result.\n * @returns {Plane} The modified result parameter or a new Plane instance if one was not provided.\n */\nPlane.clone = function (plane, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"plane\", plane);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Plane(plane.normal, plane.distance);\n  }\n\n  Cartesian3.clone(plane.normal, result.normal);\n  result.distance = plane.distance;\n\n  return result;\n};\n\n/**\n * Compares the provided Planes by normal and distance and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Plane} left The first plane.\n * @param {Plane} right The second plane.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPlane.equals = function (left, right) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  return (\n    left.distance === right.distance &&\n    Cartesian3.equals(left.normal, right.normal)\n  );\n};\n\n/**\n * A constant initialized to the XY plane passing through the origin, with normal in positive Z.\n *\n * @type {Plane}\n * @constant\n */\nPlane.ORIGIN_XY_PLANE = Object.freeze(new Plane(Cartesian3.UNIT_Z, 0.0));\n\n/**\n * A constant initialized to the YZ plane passing through the origin, with normal in positive X.\n *\n * @type {Plane}\n * @constant\n */\nPlane.ORIGIN_YZ_PLANE = Object.freeze(new Plane(Cartesian3.UNIT_X, 0.0));\n\n/**\n * A constant initialized to the ZX plane passing through the origin, with normal in positive Y.\n *\n * @type {Plane}\n * @constant\n */\nPlane.ORIGIN_ZX_PLANE = Object.freeze(new Plane(Cartesian3.UNIT_Y, 0.0));\nexport default Plane;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Intersect from \"./Intersect.js\";\nimport Plane from \"./Plane.js\";\n\n/**\n * The culling volume defined by planes.\n *\n * @alias CullingVolume\n * @constructor\n *\n * @param {Cartesian4[]} [planes] An array of clipping planes.\n */\nfunction CullingVolume(planes) {\n  /**\n   * Each plane is represented by a Cartesian4 object, where the x, y, and z components\n   * define the unit vector normal to the plane, and the w component is the distance of the\n   * plane from the origin.\n   * @type {Cartesian4[]}\n   * @default []\n   */\n  this.planes = defaultValue(planes, []);\n}\n\nconst faces = [new Cartesian3(), new Cartesian3(), new Cartesian3()];\nCartesian3.clone(Cartesian3.UNIT_X, faces[0]);\nCartesian3.clone(Cartesian3.UNIT_Y, faces[1]);\nCartesian3.clone(Cartesian3.UNIT_Z, faces[2]);\n\nconst scratchPlaneCenter = new Cartesian3();\nconst scratchPlaneNormal = new Cartesian3();\nconst scratchPlane = new Plane(new Cartesian3(1.0, 0.0, 0.0), 0.0);\n\n/**\n * Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere.\n * The planes are aligned to the x, y, and z axes in world coordinates.\n *\n * @param {BoundingSphere} boundingSphere The bounding sphere used to create the culling volume.\n * @param {CullingVolume} [result] The object onto which to store the result.\n * @returns {CullingVolume} The culling volume created from the bounding sphere.\n */\nCullingVolume.fromBoundingSphere = function (boundingSphere, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(boundingSphere)) {\n    throw new DeveloperError(\"boundingSphere is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new CullingVolume();\n  }\n\n  const length = faces.length;\n  const planes = result.planes;\n  planes.length = 2 * length;\n\n  const center = boundingSphere.center;\n  const radius = boundingSphere.radius;\n\n  let planeIndex = 0;\n\n  for (let i = 0; i < length; ++i) {\n    const faceNormal = faces[i];\n\n    let plane0 = planes[planeIndex];\n    let plane1 = planes[planeIndex + 1];\n\n    if (!defined(plane0)) {\n      plane0 = planes[planeIndex] = new Cartesian4();\n    }\n    if (!defined(plane1)) {\n      plane1 = planes[planeIndex + 1] = new Cartesian4();\n    }\n\n    Cartesian3.multiplyByScalar(faceNormal, -radius, scratchPlaneCenter);\n    Cartesian3.add(center, scratchPlaneCenter, scratchPlaneCenter);\n\n    plane0.x = faceNormal.x;\n    plane0.y = faceNormal.y;\n    plane0.z = faceNormal.z;\n    plane0.w = -Cartesian3.dot(faceNormal, scratchPlaneCenter);\n\n    Cartesian3.multiplyByScalar(faceNormal, radius, scratchPlaneCenter);\n    Cartesian3.add(center, scratchPlaneCenter, scratchPlaneCenter);\n\n    plane1.x = -faceNormal.x;\n    plane1.y = -faceNormal.y;\n    plane1.z = -faceNormal.z;\n    plane1.w = -Cartesian3.dot(\n      Cartesian3.negate(faceNormal, scratchPlaneNormal),\n      scratchPlaneCenter\n    );\n\n    planeIndex += 2;\n  }\n\n  return result;\n};\n\n/**\n * Determines whether a bounding volume intersects the culling volume.\n *\n * @param {object} boundingVolume The bounding volume whose intersection with the culling volume is to be tested.\n * @returns {Intersect}  Intersect.OUTSIDE, Intersect.INTERSECTING, or Intersect.INSIDE.\n */\nCullingVolume.prototype.computeVisibility = function (boundingVolume) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(boundingVolume)) {\n    throw new DeveloperError(\"boundingVolume is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const planes = this.planes;\n  let intersecting = false;\n  for (let k = 0, len = planes.length; k < len; ++k) {\n    const result = boundingVolume.intersectPlane(\n      Plane.fromCartesian4(planes[k], scratchPlane)\n    );\n    if (result === Intersect.OUTSIDE) {\n      return Intersect.OUTSIDE;\n    } else if (result === Intersect.INTERSECTING) {\n      intersecting = true;\n    }\n  }\n\n  return intersecting ? Intersect.INTERSECTING : Intersect.INSIDE;\n};\n\n/**\n * Determines whether a bounding volume intersects the culling volume.\n *\n * @param {object} boundingVolume The bounding volume whose intersection with the culling volume is to be tested.\n * @param {number} parentPlaneMask A bit mask from the boundingVolume's parent's check against the same culling\n *                                 volume, such that if (planeMask & (1 << planeIndex) === 0), for k < 31, then\n *                                 the parent (and therefore this) volume is completely inside plane[planeIndex]\n *                                 and that plane check can be skipped.\n * @returns {number} A plane mask as described above (which can be applied to this boundingVolume's children).\n *\n * @private\n */\nCullingVolume.prototype.computeVisibilityWithPlaneMask = function (\n  boundingVolume,\n  parentPlaneMask\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(boundingVolume)) {\n    throw new DeveloperError(\"boundingVolume is required.\");\n  }\n  if (!defined(parentPlaneMask)) {\n    throw new DeveloperError(\"parentPlaneMask is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (\n    parentPlaneMask === CullingVolume.MASK_OUTSIDE ||\n    parentPlaneMask === CullingVolume.MASK_INSIDE\n  ) {\n    // parent is completely outside or completely inside, so this child is as well.\n    return parentPlaneMask;\n  }\n\n  // Start with MASK_INSIDE (all zeros) so that after the loop, the return value can be compared with MASK_INSIDE.\n  // (Because if there are fewer than 31 planes, the upper bits wont be changed.)\n  let mask = CullingVolume.MASK_INSIDE;\n\n  const planes = this.planes;\n  for (let k = 0, len = planes.length; k < len; ++k) {\n    // For k greater than 31 (since 31 is the maximum number of INSIDE/INTERSECTING bits we can store), skip the optimization.\n    const flag = k < 31 ? 1 << k : 0;\n    if (k < 31 && (parentPlaneMask & flag) === 0) {\n      // boundingVolume is known to be INSIDE this plane.\n      continue;\n    }\n\n    const result = boundingVolume.intersectPlane(\n      Plane.fromCartesian4(planes[k], scratchPlane)\n    );\n    if (result === Intersect.OUTSIDE) {\n      return CullingVolume.MASK_OUTSIDE;\n    } else if (result === Intersect.INTERSECTING) {\n      mask |= flag;\n    }\n  }\n\n  return mask;\n};\n\n/**\n * For plane masks (as used in {@link CullingVolume#computeVisibilityWithPlaneMask}), this special value\n * represents the case where the object bounding volume is entirely outside the culling volume.\n *\n * @type {number}\n * @private\n */\nCullingVolume.MASK_OUTSIDE = 0xffffffff;\n\n/**\n * For plane masks (as used in {@link CullingVolume.prototype.computeVisibilityWithPlaneMask}), this value\n * represents the case where the object bounding volume is entirely inside the culling volume.\n *\n * @type {number}\n * @private\n */\nCullingVolume.MASK_INSIDE = 0x00000000;\n\n/**\n * For plane masks (as used in {@link CullingVolume.prototype.computeVisibilityWithPlaneMask}), this value\n * represents the case where the object bounding volume (may) intersect all planes of the culling volume.\n *\n * @type {number}\n * @private\n */\nCullingVolume.MASK_INDETERMINATE = 0x7fffffff;\nexport default CullingVolume;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport CullingVolume from \"./CullingVolume.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix4 from \"./Matrix4.js\";\n\n/**\n * The viewing frustum is defined by 6 planes.\n * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components\n * define the unit vector normal to the plane, and the w component is the distance of the\n * plane from the origin/camera position.\n *\n * @alias OrthographicOffCenterFrustum\n * @constructor\n *\n * @param {object} [options] An object with the following properties:\n * @param {number} [options.left] The left clipping plane distance.\n * @param {number} [options.right] The right clipping plane distance.\n * @param {number} [options.top] The top clipping plane distance.\n * @param {number} [options.bottom] The bottom clipping plane distance.\n * @param {number} [options.near=1.0] The near clipping plane distance.\n * @param {number} [options.far=500000000.0] The far clipping plane distance.\n *\n * @example\n * const maxRadii = ellipsoid.maximumRadius;\n *\n * const frustum = new Cesium.OrthographicOffCenterFrustum();\n * frustum.right = maxRadii * Cesium.Math.PI;\n * frustum.left = -c.frustum.right;\n * frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth);\n * frustum.bottom = -c.frustum.top;\n * frustum.near = 0.01 * maxRadii;\n * frustum.far = 50.0 * maxRadii;\n */\nfunction OrthographicOffCenterFrustum(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * The left clipping plane.\n   * @type {number}\n   * @default undefined\n   */\n  this.left = options.left;\n  this._left = undefined;\n\n  /**\n   * The right clipping plane.\n   * @type {number}\n   * @default undefined\n   */\n  this.right = options.right;\n  this._right = undefined;\n\n  /**\n   * The top clipping plane.\n   * @type {number}\n   * @default undefined\n   */\n  this.top = options.top;\n  this._top = undefined;\n\n  /**\n   * The bottom clipping plane.\n   * @type {number}\n   * @default undefined\n   */\n  this.bottom = options.bottom;\n  this._bottom = undefined;\n\n  /**\n   * The distance of the near plane.\n   * @type {number}\n   * @default 1.0\n   */\n  this.near = defaultValue(options.near, 1.0);\n  this._near = this.near;\n\n  /**\n   * The distance of the far plane.\n   * @type {number}\n   * @default 500000000.0;\n   */\n  this.far = defaultValue(options.far, 500000000.0);\n  this._far = this.far;\n\n  this._cullingVolume = new CullingVolume();\n  this._orthographicMatrix = new Matrix4();\n}\n\nfunction update(frustum) {\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    !defined(frustum.right) ||\n    !defined(frustum.left) ||\n    !defined(frustum.top) ||\n    !defined(frustum.bottom) ||\n    !defined(frustum.near) ||\n    !defined(frustum.far)\n  ) {\n    throw new DeveloperError(\n      \"right, left, top, bottom, near, or far parameters are not set.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  if (\n    frustum.top !== frustum._top ||\n    frustum.bottom !== frustum._bottom ||\n    frustum.left !== frustum._left ||\n    frustum.right !== frustum._right ||\n    frustum.near !== frustum._near ||\n    frustum.far !== frustum._far\n  ) {\n    //>>includeStart('debug', pragmas.debug);\n    if (frustum.left > frustum.right) {\n      throw new DeveloperError(\"right must be greater than left.\");\n    }\n    if (frustum.bottom > frustum.top) {\n      throw new DeveloperError(\"top must be greater than bottom.\");\n    }\n    if (frustum.near <= 0 || frustum.near > frustum.far) {\n      throw new DeveloperError(\n        \"near must be greater than zero and less than far.\"\n      );\n    }\n    //>>includeEnd('debug');\n\n    frustum._left = frustum.left;\n    frustum._right = frustum.right;\n    frustum._top = frustum.top;\n    frustum._bottom = frustum.bottom;\n    frustum._near = frustum.near;\n    frustum._far = frustum.far;\n    frustum._orthographicMatrix = Matrix4.computeOrthographicOffCenter(\n      frustum.left,\n      frustum.right,\n      frustum.bottom,\n      frustum.top,\n      frustum.near,\n      frustum.far,\n      frustum._orthographicMatrix\n    );\n  }\n}\n\nObject.defineProperties(OrthographicOffCenterFrustum.prototype, {\n  /**\n   * Gets the orthographic projection matrix computed from the view frustum.\n   * @memberof OrthographicOffCenterFrustum.prototype\n   * @type {Matrix4}\n   * @readonly\n   */\n  projectionMatrix: {\n    get: function () {\n      update(this);\n      return this._orthographicMatrix;\n    },\n  },\n});\n\nconst getPlanesRight = new Cartesian3();\nconst getPlanesNearCenter = new Cartesian3();\nconst getPlanesPoint = new Cartesian3();\nconst negateScratch = new Cartesian3();\n\n/**\n * Creates a culling volume for this frustum.\n *\n * @param {Cartesian3} position The eye position.\n * @param {Cartesian3} direction The view direction.\n * @param {Cartesian3} up The up direction.\n * @returns {CullingVolume} A culling volume at the given position and orientation.\n *\n * @example\n * // Check if a bounding volume intersects the frustum.\n * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);\n * const intersect = cullingVolume.computeVisibility(boundingVolume);\n */\nOrthographicOffCenterFrustum.prototype.computeCullingVolume = function (\n  position,\n  direction,\n  up\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(position)) {\n    throw new DeveloperError(\"position is required.\");\n  }\n  if (!defined(direction)) {\n    throw new DeveloperError(\"direction is required.\");\n  }\n  if (!defined(up)) {\n    throw new DeveloperError(\"up is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const planes = this._cullingVolume.planes;\n  const t = this.top;\n  const b = this.bottom;\n  const r = this.right;\n  const l = this.left;\n  const n = this.near;\n  const f = this.far;\n\n  const right = Cartesian3.cross(direction, up, getPlanesRight);\n  Cartesian3.normalize(right, right);\n  const nearCenter = getPlanesNearCenter;\n  Cartesian3.multiplyByScalar(direction, n, nearCenter);\n  Cartesian3.add(position, nearCenter, nearCenter);\n\n  const point = getPlanesPoint;\n\n  // Left plane\n  Cartesian3.multiplyByScalar(right, l, point);\n  Cartesian3.add(nearCenter, point, point);\n\n  let plane = planes[0];\n  if (!defined(plane)) {\n    plane = planes[0] = new Cartesian4();\n  }\n  plane.x = right.x;\n  plane.y = right.y;\n  plane.z = right.z;\n  plane.w = -Cartesian3.dot(right, point);\n\n  // Right plane\n  Cartesian3.multiplyByScalar(right, r, point);\n  Cartesian3.add(nearCenter, point, point);\n\n  plane = planes[1];\n  if (!defined(plane)) {\n    plane = planes[1] = new Cartesian4();\n  }\n  plane.x = -right.x;\n  plane.y = -right.y;\n  plane.z = -right.z;\n  plane.w = -Cartesian3.dot(Cartesian3.negate(right, negateScratch), point);\n\n  // Bottom plane\n  Cartesian3.multiplyByScalar(up, b, point);\n  Cartesian3.add(nearCenter, point, point);\n\n  plane = planes[2];\n  if (!defined(plane)) {\n    plane = planes[2] = new Cartesian4();\n  }\n  plane.x = up.x;\n  plane.y = up.y;\n  plane.z = up.z;\n  plane.w = -Cartesian3.dot(up, point);\n\n  // Top plane\n  Cartesian3.multiplyByScalar(up, t, point);\n  Cartesian3.add(nearCenter, point, point);\n\n  plane = planes[3];\n  if (!defined(plane)) {\n    plane = planes[3] = new Cartesian4();\n  }\n  plane.x = -up.x;\n  plane.y = -up.y;\n  plane.z = -up.z;\n  plane.w = -Cartesian3.dot(Cartesian3.negate(up, negateScratch), point);\n\n  // Near plane\n  plane = planes[4];\n  if (!defined(plane)) {\n    plane = planes[4] = new Cartesian4();\n  }\n  plane.x = direction.x;\n  plane.y = direction.y;\n  plane.z = direction.z;\n  plane.w = -Cartesian3.dot(direction, nearCenter);\n\n  // Far plane\n  Cartesian3.multiplyByScalar(direction, f, point);\n  Cartesian3.add(position, point, point);\n\n  plane = planes[5];\n  if (!defined(plane)) {\n    plane = planes[5] = new Cartesian4();\n  }\n  plane.x = -direction.x;\n  plane.y = -direction.y;\n  plane.z = -direction.z;\n  plane.w = -Cartesian3.dot(Cartesian3.negate(direction, negateScratch), point);\n\n  return this._cullingVolume;\n};\n\n/**\n * Returns the pixel's width and height in meters.\n *\n * @param {number} drawingBufferWidth The width of the drawing buffer.\n * @param {number} drawingBufferHeight The height of the drawing buffer.\n * @param {number} distance The distance to the near plane in meters.\n * @param {number} pixelRatio The scaling factor from pixel space to coordinate space.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.\n *\n * @exception {DeveloperError} drawingBufferWidth must be greater than zero.\n * @exception {DeveloperError} drawingBufferHeight must be greater than zero.\n * @exception {DeveloperError} pixelRatio must be greater than zero.\n *\n * @example\n * // Example 1\n * // Get the width and height of a pixel.\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());\n */\nOrthographicOffCenterFrustum.prototype.getPixelDimensions = function (\n  drawingBufferWidth,\n  drawingBufferHeight,\n  distance,\n  pixelRatio,\n  result\n) {\n  update(this);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(drawingBufferWidth) || !defined(drawingBufferHeight)) {\n    throw new DeveloperError(\n      \"Both drawingBufferWidth and drawingBufferHeight are required.\"\n    );\n  }\n  if (drawingBufferWidth <= 0) {\n    throw new DeveloperError(\"drawingBufferWidth must be greater than zero.\");\n  }\n  if (drawingBufferHeight <= 0) {\n    throw new DeveloperError(\"drawingBufferHeight must be greater than zero.\");\n  }\n  if (!defined(distance)) {\n    throw new DeveloperError(\"distance is required.\");\n  }\n  if (!defined(pixelRatio)) {\n    throw new DeveloperError(\"pixelRatio is required.\");\n  }\n  if (pixelRatio <= 0) {\n    throw new DeveloperError(\"pixelRatio must be greater than zero.\");\n  }\n  if (!defined(result)) {\n    throw new DeveloperError(\"A result object is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const frustumWidth = this.right - this.left;\n  const frustumHeight = this.top - this.bottom;\n  const pixelWidth = (pixelRatio * frustumWidth) / drawingBufferWidth;\n  const pixelHeight = (pixelRatio * frustumHeight) / drawingBufferHeight;\n\n  result.x = pixelWidth;\n  result.y = pixelHeight;\n  return result;\n};\n\n/**\n * Returns a duplicate of a OrthographicOffCenterFrustum instance.\n *\n * @param {OrthographicOffCenterFrustum} [result] The object onto which to store the result.\n * @returns {OrthographicOffCenterFrustum} The modified result parameter or a new OrthographicOffCenterFrustum instance if one was not provided.\n */\nOrthographicOffCenterFrustum.prototype.clone = function (result) {\n  if (!defined(result)) {\n    result = new OrthographicOffCenterFrustum();\n  }\n\n  result.left = this.left;\n  result.right = this.right;\n  result.top = this.top;\n  result.bottom = this.bottom;\n  result.near = this.near;\n  result.far = this.far;\n\n  // force update of clone to compute matrices\n  result._left = undefined;\n  result._right = undefined;\n  result._top = undefined;\n  result._bottom = undefined;\n  result._near = undefined;\n  result._far = undefined;\n\n  return result;\n};\n\n/**\n * Compares the provided OrthographicOffCenterFrustum componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {OrthographicOffCenterFrustum} [other] The right hand side OrthographicOffCenterFrustum.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nOrthographicOffCenterFrustum.prototype.equals = function (other) {\n  return (\n    defined(other) &&\n    other instanceof OrthographicOffCenterFrustum &&\n    this.right === other.right &&\n    this.left === other.left &&\n    this.top === other.top &&\n    this.bottom === other.bottom &&\n    this.near === other.near &&\n    this.far === other.far\n  );\n};\n\n/**\n * Compares the provided OrthographicOffCenterFrustum componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {OrthographicOffCenterFrustum} other The right hand side OrthographicOffCenterFrustum.\n * @param {number} relativeEpsilon The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.\n */\nOrthographicOffCenterFrustum.prototype.equalsEpsilon = function (\n  other,\n  relativeEpsilon,\n  absoluteEpsilon\n) {\n  return (\n    other === this ||\n    (defined(other) &&\n      other instanceof OrthographicOffCenterFrustum &&\n      CesiumMath.equalsEpsilon(\n        this.right,\n        other.right,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        this.left,\n        other.left,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        this.top,\n        other.top,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        this.bottom,\n        other.bottom,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        this.near,\n        other.near,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        this.far,\n        other.far,\n        relativeEpsilon,\n        absoluteEpsilon\n      ))\n  );\n};\nexport default OrthographicOffCenterFrustum;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport OrthographicOffCenterFrustum from \"./OrthographicOffCenterFrustum.js\";\n\n/**\n * The viewing frustum is defined by 6 planes.\n * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components\n * define the unit vector normal to the plane, and the w component is the distance of the\n * plane from the origin/camera position.\n *\n * @alias OrthographicFrustum\n * @constructor\n *\n * @param {object} [options] An object with the following properties:\n * @param {number} [options.width] The width of the frustum in meters.\n * @param {number} [options.aspectRatio] The aspect ratio of the frustum's width to it's height.\n * @param {number} [options.near=1.0] The distance of the near plane.\n * @param {number} [options.far=500000000.0] The distance of the far plane.\n *\n * @example\n * const maxRadii = ellipsoid.maximumRadius;\n *\n * const frustum = new Cesium.OrthographicFrustum();\n * frustum.near = 0.01 * maxRadii;\n * frustum.far = 50.0 * maxRadii;\n */\nfunction OrthographicFrustum(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._offCenterFrustum = new OrthographicOffCenterFrustum();\n\n  /**\n   * The horizontal width of the frustum in meters.\n   * @type {number}\n   * @default undefined\n   */\n  this.width = options.width;\n  this._width = undefined;\n\n  /**\n   * The aspect ratio of the frustum's width to it's height.\n   * @type {number}\n   * @default undefined\n   */\n  this.aspectRatio = options.aspectRatio;\n  this._aspectRatio = undefined;\n\n  /**\n   * The distance of the near plane.\n   * @type {number}\n   * @default 1.0\n   */\n  this.near = defaultValue(options.near, 1.0);\n  this._near = this.near;\n\n  /**\n   * The distance of the far plane.\n   * @type {number}\n   * @default 500000000.0;\n   */\n  this.far = defaultValue(options.far, 500000000.0);\n  this._far = this.far;\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nOrthographicFrustum.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {OrthographicFrustum} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nOrthographicFrustum.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  array[startingIndex++] = value.width;\n  array[startingIndex++] = value.aspectRatio;\n  array[startingIndex++] = value.near;\n  array[startingIndex] = value.far;\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {OrthographicFrustum} [result] The object into which to store the result.\n * @returns {OrthographicFrustum} The modified result parameter or a new OrthographicFrustum instance if one was not provided.\n */\nOrthographicFrustum.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new OrthographicFrustum();\n  }\n\n  result.width = array[startingIndex++];\n  result.aspectRatio = array[startingIndex++];\n  result.near = array[startingIndex++];\n  result.far = array[startingIndex];\n\n  return result;\n};\n\nfunction update(frustum) {\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    !defined(frustum.width) ||\n    !defined(frustum.aspectRatio) ||\n    !defined(frustum.near) ||\n    !defined(frustum.far)\n  ) {\n    throw new DeveloperError(\n      \"width, aspectRatio, near, or far parameters are not set.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const f = frustum._offCenterFrustum;\n\n  if (\n    frustum.width !== frustum._width ||\n    frustum.aspectRatio !== frustum._aspectRatio ||\n    frustum.near !== frustum._near ||\n    frustum.far !== frustum._far\n  ) {\n    //>>includeStart('debug', pragmas.debug);\n    if (frustum.aspectRatio < 0) {\n      throw new DeveloperError(\"aspectRatio must be positive.\");\n    }\n    if (frustum.near < 0 || frustum.near > frustum.far) {\n      throw new DeveloperError(\n        \"near must be greater than zero and less than far.\"\n      );\n    }\n    //>>includeEnd('debug');\n\n    frustum._aspectRatio = frustum.aspectRatio;\n    frustum._width = frustum.width;\n    frustum._near = frustum.near;\n    frustum._far = frustum.far;\n\n    const ratio = 1.0 / frustum.aspectRatio;\n    f.right = frustum.width * 0.5;\n    f.left = -f.right;\n    f.top = ratio * f.right;\n    f.bottom = -f.top;\n    f.near = frustum.near;\n    f.far = frustum.far;\n  }\n}\n\nObject.defineProperties(OrthographicFrustum.prototype, {\n  /**\n   * Gets the orthographic projection matrix computed from the view frustum.\n   * @memberof OrthographicFrustum.prototype\n   * @type {Matrix4}\n   * @readonly\n   */\n  projectionMatrix: {\n    get: function () {\n      update(this);\n      return this._offCenterFrustum.projectionMatrix;\n    },\n  },\n  /**\n   * Gets the orthographic projection matrix computed from the view frustum.\n   * @memberof OrthographicFrustum.prototype\n   * @type {OrthographicOffCenterFrustum}\n   * @readonly\n   * @private\n   */\n  offCenterFrustum: {\n    get: function () {\n      update(this);\n      return this._offCenterFrustum;\n    },\n  },\n});\n\n/**\n * Creates a culling volume for this frustum.\n *\n * @param {Cartesian3} position The eye position.\n * @param {Cartesian3} direction The view direction.\n * @param {Cartesian3} up The up direction.\n * @returns {CullingVolume} A culling volume at the given position and orientation.\n *\n * @example\n * // Check if a bounding volume intersects the frustum.\n * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);\n * const intersect = cullingVolume.computeVisibility(boundingVolume);\n */\nOrthographicFrustum.prototype.computeCullingVolume = function (\n  position,\n  direction,\n  up\n) {\n  update(this);\n  return this._offCenterFrustum.computeCullingVolume(position, direction, up);\n};\n\n/**\n * Returns the pixel's width and height in meters.\n *\n * @param {number} drawingBufferWidth The width of the drawing buffer.\n * @param {number} drawingBufferHeight The height of the drawing buffer.\n * @param {number} distance The distance to the near plane in meters.\n * @param {number} pixelRatio The scaling factor from pixel space to coordinate space.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.\n *\n * @exception {DeveloperError} drawingBufferWidth must be greater than zero.\n * @exception {DeveloperError} drawingBufferHeight must be greater than zero.\n * @exception {DeveloperError} pixelRatio must be greater than zero.\n *\n * @example\n * // Example 1\n * // Get the width and height of a pixel.\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());\n */\nOrthographicFrustum.prototype.getPixelDimensions = function (\n  drawingBufferWidth,\n  drawingBufferHeight,\n  distance,\n  pixelRatio,\n  result\n) {\n  update(this);\n  return this._offCenterFrustum.getPixelDimensions(\n    drawingBufferWidth,\n    drawingBufferHeight,\n    distance,\n    pixelRatio,\n    result\n  );\n};\n\n/**\n * Returns a duplicate of a OrthographicFrustum instance.\n *\n * @param {OrthographicFrustum} [result] The object onto which to store the result.\n * @returns {OrthographicFrustum} The modified result parameter or a new OrthographicFrustum instance if one was not provided.\n */\nOrthographicFrustum.prototype.clone = function (result) {\n  if (!defined(result)) {\n    result = new OrthographicFrustum();\n  }\n\n  result.aspectRatio = this.aspectRatio;\n  result.width = this.width;\n  result.near = this.near;\n  result.far = this.far;\n\n  // force update of clone to compute matrices\n  result._aspectRatio = undefined;\n  result._width = undefined;\n  result._near = undefined;\n  result._far = undefined;\n\n  this._offCenterFrustum.clone(result._offCenterFrustum);\n\n  return result;\n};\n\n/**\n * Compares the provided OrthographicFrustum componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {OrthographicFrustum} [other] The right hand side OrthographicFrustum.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nOrthographicFrustum.prototype.equals = function (other) {\n  if (!defined(other) || !(other instanceof OrthographicFrustum)) {\n    return false;\n  }\n\n  update(this);\n  update(other);\n\n  return (\n    this.width === other.width &&\n    this.aspectRatio === other.aspectRatio &&\n    this._offCenterFrustum.equals(other._offCenterFrustum)\n  );\n};\n\n/**\n * Compares the provided OrthographicFrustum componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {OrthographicFrustum} other The right hand side OrthographicFrustum.\n * @param {number} relativeEpsilon The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.\n */\nOrthographicFrustum.prototype.equalsEpsilon = function (\n  other,\n  relativeEpsilon,\n  absoluteEpsilon\n) {\n  if (!defined(other) || !(other instanceof OrthographicFrustum)) {\n    return false;\n  }\n\n  update(this);\n  update(other);\n\n  return (\n    CesiumMath.equalsEpsilon(\n      this.width,\n      other.width,\n      relativeEpsilon,\n      absoluteEpsilon\n    ) &&\n    CesiumMath.equalsEpsilon(\n      this.aspectRatio,\n      other.aspectRatio,\n      relativeEpsilon,\n      absoluteEpsilon\n    ) &&\n    this._offCenterFrustum.equalsEpsilon(\n      other._offCenterFrustum,\n      relativeEpsilon,\n      absoluteEpsilon\n    )\n  );\n};\nexport default OrthographicFrustum;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport TimeConstants from \"./TimeConstants.js\";\nimport TimeStandard from \"./TimeStandard.js\";\n\n/**\n * Contains functions for finding the Cartesian coordinates of the sun and the moon in the\n * Earth-centered inertial frame.\n *\n * @namespace Simon1994PlanetaryPositions\n */\nconst Simon1994PlanetaryPositions = {};\n\nfunction computeTdbMinusTtSpice(daysSinceJ2000InTerrestrialTime) {\n  /* STK Comments ------------------------------------------------------\n   * This function uses constants designed to be consistent with\n   * the SPICE Toolkit from JPL version N0051 (unitim.c)\n   * M0 = 6.239996\n   * M0Dot = 1.99096871e-7 rad/s = 0.01720197 rad/d\n   * EARTH_ECC = 1.671e-2\n   * TDB_AMPL = 1.657e-3 secs\n   *--------------------------------------------------------------------*/\n\n  //* Values taken as specified in STK Comments except: 0.01720197 rad/day = 1.99096871e-7 rad/sec\n  //* Here we use the more precise value taken from the SPICE value 1.99096871e-7 rad/sec converted to rad/day\n  //* All other constants are consistent with the SPICE implementation of the TDB conversion\n  //* except where we treat the independent time parameter to be in TT instead of TDB.\n  //* This is an approximation made to facilitate performance due to the higher prevalance of\n  //* the TT2TDB conversion over TDB2TT in order to avoid having to iterate when converting to TDB for the JPL ephemeris.\n  //* Days are used instead of seconds to provide a slight improvement in numerical precision.\n\n  //* For more information see:\n  //* http://www.cv.nrao.edu/~rfisher/Ephemerides/times.html#TDB\n  //* ftp://ssd.jpl.nasa.gov/pub/eph/planets/ioms/ExplSupplChap8.pdf\n\n  const g = 6.239996 + 0.0172019696544 * daysSinceJ2000InTerrestrialTime;\n  return 1.657e-3 * Math.sin(g + 1.671e-2 * Math.sin(g));\n}\n\nconst TdtMinusTai = 32.184;\nconst J2000d = 2451545;\nfunction taiToTdb(date, result) {\n  //Converts TAI to TT\n  result = JulianDate.addSeconds(date, TdtMinusTai, result);\n\n  //Converts TT to TDB\n  const days = JulianDate.totalDays(result) - J2000d;\n  result = JulianDate.addSeconds(result, computeTdbMinusTtSpice(days), result);\n\n  return result;\n}\n\nconst epoch = new JulianDate(2451545, 0, TimeStandard.TAI); //Actually TDB (not TAI)\nconst MetersPerKilometer = 1000.0;\nconst RadiansPerDegree = CesiumMath.RADIANS_PER_DEGREE;\nconst RadiansPerArcSecond = CesiumMath.RADIANS_PER_ARCSECOND;\nconst MetersPerAstronomicalUnit = 1.4959787e11; // IAU 1976 value\n\nconst perifocalToEquatorial = new Matrix3();\nfunction elementsToCartesian(\n  semimajorAxis,\n  eccentricity,\n  inclination,\n  longitudeOfPerigee,\n  longitudeOfNode,\n  meanLongitude,\n  result\n) {\n  if (inclination < 0.0) {\n    inclination = -inclination;\n    longitudeOfNode += CesiumMath.PI;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (inclination < 0 || inclination > CesiumMath.PI) {\n    throw new DeveloperError(\n      \"The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.\"\n    );\n  }\n  //>>includeEnd('debug')\n\n  const radiusOfPeriapsis = semimajorAxis * (1.0 - eccentricity);\n  const argumentOfPeriapsis = longitudeOfPerigee - longitudeOfNode;\n  const rightAscensionOfAscendingNode = longitudeOfNode;\n  const trueAnomaly = meanAnomalyToTrueAnomaly(\n    meanLongitude - longitudeOfPerigee,\n    eccentricity\n  );\n  const type = chooseOrbit(eccentricity, 0.0);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    type === \"Hyperbolic\" &&\n    Math.abs(CesiumMath.negativePiToPi(trueAnomaly)) >=\n      Math.acos(-1.0 / eccentricity)\n  ) {\n    throw new DeveloperError(\n      \"The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.\"\n    );\n  }\n  //>>includeEnd('debug')\n\n  perifocalToCartesianMatrix(\n    argumentOfPeriapsis,\n    inclination,\n    rightAscensionOfAscendingNode,\n    perifocalToEquatorial\n  );\n  const semilatus = radiusOfPeriapsis * (1.0 + eccentricity);\n  const costheta = Math.cos(trueAnomaly);\n  const sintheta = Math.sin(trueAnomaly);\n\n  const denom = 1.0 + eccentricity * costheta;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (denom <= CesiumMath.Epsilon10) {\n    throw new DeveloperError(\"elements cannot be converted to cartesian\");\n  }\n  //>>includeEnd('debug')\n\n  const radius = semilatus / denom;\n  if (!defined(result)) {\n    result = new Cartesian3(radius * costheta, radius * sintheta, 0.0);\n  } else {\n    result.x = radius * costheta;\n    result.y = radius * sintheta;\n    result.z = 0.0;\n  }\n\n  return Matrix3.multiplyByVector(perifocalToEquatorial, result, result);\n}\n\nfunction chooseOrbit(eccentricity, tolerance) {\n  //>>includeStart('debug', pragmas.debug);\n  if (eccentricity < 0) {\n    throw new DeveloperError(\"eccentricity cannot be negative.\");\n  }\n  //>>includeEnd('debug')\n\n  if (eccentricity <= tolerance) {\n    return \"Circular\";\n  } else if (eccentricity < 1.0 - tolerance) {\n    return \"Elliptical\";\n  } else if (eccentricity <= 1.0 + tolerance) {\n    return \"Parabolic\";\n  }\n  return \"Hyperbolic\";\n}\n\n// Calculates the true anomaly given the mean anomaly and the eccentricity.\nfunction meanAnomalyToTrueAnomaly(meanAnomaly, eccentricity) {\n  //>>includeStart('debug', pragmas.debug);\n  if (eccentricity < 0.0 || eccentricity >= 1.0) {\n    throw new DeveloperError(\"eccentricity out of range.\");\n  }\n  //>>includeEnd('debug')\n\n  const eccentricAnomaly = meanAnomalyToEccentricAnomaly(\n    meanAnomaly,\n    eccentricity\n  );\n  return eccentricAnomalyToTrueAnomaly(eccentricAnomaly, eccentricity);\n}\n\nconst maxIterationCount = 50;\nconst keplerEqConvergence = CesiumMath.EPSILON8;\n// Calculates the eccentric anomaly given the mean anomaly and the eccentricity.\nfunction meanAnomalyToEccentricAnomaly(meanAnomaly, eccentricity) {\n  //>>includeStart('debug', pragmas.debug);\n  if (eccentricity < 0.0 || eccentricity >= 1.0) {\n    throw new DeveloperError(\"eccentricity out of range.\");\n  }\n  //>>includeEnd('debug')\n\n  const revs = Math.floor(meanAnomaly / CesiumMath.TWO_PI);\n\n  // Find angle in current revolution\n  meanAnomaly -= revs * CesiumMath.TWO_PI;\n\n  // calculate starting value for iteration sequence\n  let iterationValue =\n    meanAnomaly +\n    (eccentricity * Math.sin(meanAnomaly)) /\n      (1.0 - Math.sin(meanAnomaly + eccentricity) + Math.sin(meanAnomaly));\n\n  // Perform Newton-Raphson iteration on Kepler's equation\n  let eccentricAnomaly = Number.MAX_VALUE;\n\n  let count;\n  for (\n    count = 0;\n    count < maxIterationCount &&\n    Math.abs(eccentricAnomaly - iterationValue) > keplerEqConvergence;\n    ++count\n  ) {\n    eccentricAnomaly = iterationValue;\n    const NRfunction =\n      eccentricAnomaly -\n      eccentricity * Math.sin(eccentricAnomaly) -\n      meanAnomaly;\n    const dNRfunction = 1 - eccentricity * Math.cos(eccentricAnomaly);\n    iterationValue = eccentricAnomaly - NRfunction / dNRfunction;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (count >= maxIterationCount) {\n    throw new DeveloperError(\"Kepler equation did not converge\");\n    // STK Components uses a numerical method to find the eccentric anomaly in the case that Kepler's\n    // equation does not converge. We don't expect that to ever be necessary for the reasonable orbits used here.\n  }\n  //>>includeEnd('debug')\n\n  eccentricAnomaly = iterationValue + revs * CesiumMath.TWO_PI;\n  return eccentricAnomaly;\n}\n\n// Calculates the true anomaly given the eccentric anomaly and the eccentricity.\nfunction eccentricAnomalyToTrueAnomaly(eccentricAnomaly, eccentricity) {\n  //>>includeStart('debug', pragmas.debug);\n  if (eccentricity < 0.0 || eccentricity >= 1.0) {\n    throw new DeveloperError(\"eccentricity out of range.\");\n  }\n  //>>includeEnd('debug')\n\n  // Calculate the number of previous revolutions\n  const revs = Math.floor(eccentricAnomaly / CesiumMath.TWO_PI);\n\n  // Find angle in current revolution\n  eccentricAnomaly -= revs * CesiumMath.TWO_PI;\n\n  // Calculate true anomaly from eccentric anomaly\n  const trueAnomalyX = Math.cos(eccentricAnomaly) - eccentricity;\n  const trueAnomalyY =\n    Math.sin(eccentricAnomaly) * Math.sqrt(1 - eccentricity * eccentricity);\n\n  let trueAnomaly = Math.atan2(trueAnomalyY, trueAnomalyX);\n\n  // Ensure the correct quadrant\n  trueAnomaly = CesiumMath.zeroToTwoPi(trueAnomaly);\n  if (eccentricAnomaly < 0) {\n    trueAnomaly -= CesiumMath.TWO_PI;\n  }\n\n  // Add on previous revolutions\n  trueAnomaly += revs * CesiumMath.TWO_PI;\n\n  return trueAnomaly;\n}\n\n// Calculates the transformation matrix to convert from the perifocal (PQW) coordinate\n// system to inertial cartesian coordinates.\nfunction perifocalToCartesianMatrix(\n  argumentOfPeriapsis,\n  inclination,\n  rightAscension,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (inclination < 0 || inclination > CesiumMath.PI) {\n    throw new DeveloperError(\"inclination out of range\");\n  }\n  //>>includeEnd('debug')\n\n  const cosap = Math.cos(argumentOfPeriapsis);\n  const sinap = Math.sin(argumentOfPeriapsis);\n\n  const cosi = Math.cos(inclination);\n  const sini = Math.sin(inclination);\n\n  const cosraan = Math.cos(rightAscension);\n  const sinraan = Math.sin(rightAscension);\n  if (!defined(result)) {\n    result = new Matrix3(\n      cosraan * cosap - sinraan * sinap * cosi,\n      -cosraan * sinap - sinraan * cosap * cosi,\n      sinraan * sini,\n\n      sinraan * cosap + cosraan * sinap * cosi,\n      -sinraan * sinap + cosraan * cosap * cosi,\n      -cosraan * sini,\n\n      sinap * sini,\n      cosap * sini,\n      cosi\n    );\n  } else {\n    result[0] = cosraan * cosap - sinraan * sinap * cosi;\n    result[1] = sinraan * cosap + cosraan * sinap * cosi;\n    result[2] = sinap * sini;\n    result[3] = -cosraan * sinap - sinraan * cosap * cosi;\n    result[4] = -sinraan * sinap + cosraan * cosap * cosi;\n    result[5] = cosap * sini;\n    result[6] = sinraan * sini;\n    result[7] = -cosraan * sini;\n    result[8] = cosi;\n  }\n  return result;\n}\n\n// From section 5.8\nconst semiMajorAxis0 = 1.0000010178 * MetersPerAstronomicalUnit;\nconst meanLongitude0 = 100.46645683 * RadiansPerDegree;\nconst meanLongitude1 = 1295977422.83429 * RadiansPerArcSecond;\n\n// From table 6\nconst p1u = 16002;\nconst p2u = 21863;\nconst p3u = 32004;\nconst p4u = 10931;\nconst p5u = 14529;\nconst p6u = 16368;\nconst p7u = 15318;\nconst p8u = 32794;\n\nconst Ca1 = 64 * 1e-7 * MetersPerAstronomicalUnit;\nconst Ca2 = -152 * 1e-7 * MetersPerAstronomicalUnit;\nconst Ca3 = 62 * 1e-7 * MetersPerAstronomicalUnit;\nconst Ca4 = -8 * 1e-7 * MetersPerAstronomicalUnit;\nconst Ca5 = 32 * 1e-7 * MetersPerAstronomicalUnit;\nconst Ca6 = -41 * 1e-7 * MetersPerAstronomicalUnit;\nconst Ca7 = 19 * 1e-7 * MetersPerAstronomicalUnit;\nconst Ca8 = -11 * 1e-7 * MetersPerAstronomicalUnit;\n\nconst Sa1 = -150 * 1e-7 * MetersPerAstronomicalUnit;\nconst Sa2 = -46 * 1e-7 * MetersPerAstronomicalUnit;\nconst Sa3 = 68 * 1e-7 * MetersPerAstronomicalUnit;\nconst Sa4 = 54 * 1e-7 * MetersPerAstronomicalUnit;\nconst Sa5 = 14 * 1e-7 * MetersPerAstronomicalUnit;\nconst Sa6 = 24 * 1e-7 * MetersPerAstronomicalUnit;\nconst Sa7 = -28 * 1e-7 * MetersPerAstronomicalUnit;\nconst Sa8 = 22 * 1e-7 * MetersPerAstronomicalUnit;\n\nconst q1u = 10;\nconst q2u = 16002;\nconst q3u = 21863;\nconst q4u = 10931;\nconst q5u = 1473;\nconst q6u = 32004;\nconst q7u = 4387;\nconst q8u = 73;\n\nconst Cl1 = -325 * 1e-7;\nconst Cl2 = -322 * 1e-7;\nconst Cl3 = -79 * 1e-7;\nconst Cl4 = 232 * 1e-7;\nconst Cl5 = -52 * 1e-7;\nconst Cl6 = 97 * 1e-7;\nconst Cl7 = 55 * 1e-7;\nconst Cl8 = -41 * 1e-7;\n\nconst Sl1 = -105 * 1e-7;\nconst Sl2 = -137 * 1e-7;\nconst Sl3 = 258 * 1e-7;\nconst Sl4 = 35 * 1e-7;\nconst Sl5 = -116 * 1e-7;\nconst Sl6 = -88 * 1e-7;\nconst Sl7 = -112 * 1e-7;\nconst Sl8 = -80 * 1e-7;\n\nconst scratchDate = new JulianDate(0, 0.0, TimeStandard.TAI);\n// Gets a point describing the motion of the Earth-Moon barycenter according to the equations described in section 6.\nfunction computeSimonEarthMoonBarycenter(date, result) {\n  // t is thousands of years from J2000 TDB\n  taiToTdb(date, scratchDate);\n  const x =\n    scratchDate.dayNumber -\n    epoch.dayNumber +\n    (scratchDate.secondsOfDay - epoch.secondsOfDay) /\n      TimeConstants.SECONDS_PER_DAY;\n  const t = x / (TimeConstants.DAYS_PER_JULIAN_CENTURY * 10.0);\n\n  const u = 0.3595362 * t;\n  const semimajorAxis =\n    semiMajorAxis0 +\n    Ca1 * Math.cos(p1u * u) +\n    Sa1 * Math.sin(p1u * u) +\n    Ca2 * Math.cos(p2u * u) +\n    Sa2 * Math.sin(p2u * u) +\n    Ca3 * Math.cos(p3u * u) +\n    Sa3 * Math.sin(p3u * u) +\n    Ca4 * Math.cos(p4u * u) +\n    Sa4 * Math.sin(p4u * u) +\n    Ca5 * Math.cos(p5u * u) +\n    Sa5 * Math.sin(p5u * u) +\n    Ca6 * Math.cos(p6u * u) +\n    Sa6 * Math.sin(p6u * u) +\n    Ca7 * Math.cos(p7u * u) +\n    Sa7 * Math.sin(p7u * u) +\n    Ca8 * Math.cos(p8u * u) +\n    Sa8 * Math.sin(p8u * u);\n  const meanLongitude =\n    meanLongitude0 +\n    meanLongitude1 * t +\n    Cl1 * Math.cos(q1u * u) +\n    Sl1 * Math.sin(q1u * u) +\n    Cl2 * Math.cos(q2u * u) +\n    Sl2 * Math.sin(q2u * u) +\n    Cl3 * Math.cos(q3u * u) +\n    Sl3 * Math.sin(q3u * u) +\n    Cl4 * Math.cos(q4u * u) +\n    Sl4 * Math.sin(q4u * u) +\n    Cl5 * Math.cos(q5u * u) +\n    Sl5 * Math.sin(q5u * u) +\n    Cl6 * Math.cos(q6u * u) +\n    Sl6 * Math.sin(q6u * u) +\n    Cl7 * Math.cos(q7u * u) +\n    Sl7 * Math.sin(q7u * u) +\n    Cl8 * Math.cos(q8u * u) +\n    Sl8 * Math.sin(q8u * u);\n\n  // All constants in this part are from section 5.8\n  const eccentricity = 0.0167086342 - 0.0004203654 * t;\n  const longitudeOfPerigee =\n    102.93734808 * RadiansPerDegree + 11612.3529 * RadiansPerArcSecond * t;\n  const inclination = 469.97289 * RadiansPerArcSecond * t;\n  const longitudeOfNode =\n    174.87317577 * RadiansPerDegree - 8679.27034 * RadiansPerArcSecond * t;\n\n  return elementsToCartesian(\n    semimajorAxis,\n    eccentricity,\n    inclination,\n    longitudeOfPerigee,\n    longitudeOfNode,\n    meanLongitude,\n    result\n  );\n}\n\n// Gets a point describing the position of the moon according to the equations described in section 4.\nfunction computeSimonMoon(date, result) {\n  taiToTdb(date, scratchDate);\n  const x =\n    scratchDate.dayNumber -\n    epoch.dayNumber +\n    (scratchDate.secondsOfDay - epoch.secondsOfDay) /\n      TimeConstants.SECONDS_PER_DAY;\n  const t = x / TimeConstants.DAYS_PER_JULIAN_CENTURY;\n  const t2 = t * t;\n  const t3 = t2 * t;\n  const t4 = t3 * t;\n\n  // Terms from section 3.4 (b.1)\n  let semimajorAxis = 383397.7725 + 0.004 * t;\n  let eccentricity = 0.055545526 - 0.000000016 * t;\n  const inclinationConstant = 5.15668983 * RadiansPerDegree;\n  let inclinationSecPart =\n    -0.00008 * t + 0.02966 * t2 - 0.000042 * t3 - 0.00000013 * t4;\n  const longitudeOfPerigeeConstant = 83.35324312 * RadiansPerDegree;\n  let longitudeOfPerigeeSecPart =\n    14643420.2669 * t - 38.2702 * t2 - 0.045047 * t3 + 0.00021301 * t4;\n  const longitudeOfNodeConstant = 125.04455501 * RadiansPerDegree;\n  let longitudeOfNodeSecPart =\n    -6967919.3631 * t + 6.3602 * t2 + 0.007625 * t3 - 0.00003586 * t4;\n  const meanLongitudeConstant = 218.31664563 * RadiansPerDegree;\n  let meanLongitudeSecPart =\n    1732559343.4847 * t - 6.391 * t2 + 0.006588 * t3 - 0.00003169 * t4;\n\n  // Delaunay arguments from section 3.5 b\n  const D =\n    297.85019547 * RadiansPerDegree +\n    RadiansPerArcSecond *\n      (1602961601.209 * t - 6.3706 * t2 + 0.006593 * t3 - 0.00003169 * t4);\n  const F =\n    93.27209062 * RadiansPerDegree +\n    RadiansPerArcSecond *\n      (1739527262.8478 * t - 12.7512 * t2 - 0.001037 * t3 + 0.00000417 * t4);\n  const l =\n    134.96340251 * RadiansPerDegree +\n    RadiansPerArcSecond *\n      (1717915923.2178 * t + 31.8792 * t2 + 0.051635 * t3 - 0.0002447 * t4);\n  const lprime =\n    357.52910918 * RadiansPerDegree +\n    RadiansPerArcSecond *\n      (129596581.0481 * t - 0.5532 * t2 + 0.000136 * t3 - 0.00001149 * t4);\n  const psi =\n    310.17137918 * RadiansPerDegree -\n    RadiansPerArcSecond *\n      (6967051.436 * t + 6.2068 * t2 + 0.007618 * t3 - 0.00003219 * t4);\n\n  // Add terms from Table 4\n  const twoD = 2.0 * D;\n  const fourD = 4.0 * D;\n  const sixD = 6.0 * D;\n  const twol = 2.0 * l;\n  const threel = 3.0 * l;\n  const fourl = 4.0 * l;\n  const twoF = 2.0 * F;\n  semimajorAxis +=\n    3400.4 * Math.cos(twoD) -\n    635.6 * Math.cos(twoD - l) -\n    235.6 * Math.cos(l) +\n    218.1 * Math.cos(twoD - lprime) +\n    181.0 * Math.cos(twoD + l);\n  eccentricity +=\n    0.014216 * Math.cos(twoD - l) +\n    0.008551 * Math.cos(twoD - twol) -\n    0.001383 * Math.cos(l) +\n    0.001356 * Math.cos(twoD + l) -\n    0.001147 * Math.cos(fourD - threel) -\n    0.000914 * Math.cos(fourD - twol) +\n    0.000869 * Math.cos(twoD - lprime - l) -\n    0.000627 * Math.cos(twoD) -\n    0.000394 * Math.cos(fourD - fourl) +\n    0.000282 * Math.cos(twoD - lprime - twol) -\n    0.000279 * Math.cos(D - l) -\n    0.000236 * Math.cos(twol) +\n    0.000231 * Math.cos(fourD) +\n    0.000229 * Math.cos(sixD - fourl) -\n    0.000201 * Math.cos(twol - twoF);\n  inclinationSecPart +=\n    486.26 * Math.cos(twoD - twoF) -\n    40.13 * Math.cos(twoD) +\n    37.51 * Math.cos(twoF) +\n    25.73 * Math.cos(twol - twoF) +\n    19.97 * Math.cos(twoD - lprime - twoF);\n  longitudeOfPerigeeSecPart +=\n    -55609 * Math.sin(twoD - l) -\n    34711 * Math.sin(twoD - twol) -\n    9792 * Math.sin(l) +\n    9385 * Math.sin(fourD - threel) +\n    7505 * Math.sin(fourD - twol) +\n    5318 * Math.sin(twoD + l) +\n    3484 * Math.sin(fourD - fourl) -\n    3417 * Math.sin(twoD - lprime - l) -\n    2530 * Math.sin(sixD - fourl) -\n    2376 * Math.sin(twoD) -\n    2075 * Math.sin(twoD - threel) -\n    1883 * Math.sin(twol) -\n    1736 * Math.sin(sixD - 5.0 * l) +\n    1626 * Math.sin(lprime) -\n    1370 * Math.sin(sixD - threel);\n  longitudeOfNodeSecPart +=\n    -5392 * Math.sin(twoD - twoF) -\n    540 * Math.sin(lprime) -\n    441 * Math.sin(twoD) +\n    423 * Math.sin(twoF) -\n    288 * Math.sin(twol - twoF);\n  meanLongitudeSecPart +=\n    -3332.9 * Math.sin(twoD) +\n    1197.4 * Math.sin(twoD - l) -\n    662.5 * Math.sin(lprime) +\n    396.3 * Math.sin(l) -\n    218.0 * Math.sin(twoD - lprime);\n\n  // Add terms from Table 5\n  const twoPsi = 2.0 * psi;\n  const threePsi = 3.0 * psi;\n  inclinationSecPart +=\n    46.997 * Math.cos(psi) * t -\n    0.614 * Math.cos(twoD - twoF + psi) * t +\n    0.614 * Math.cos(twoD - twoF - psi) * t -\n    0.0297 * Math.cos(twoPsi) * t2 -\n    0.0335 * Math.cos(psi) * t2 +\n    0.0012 * Math.cos(twoD - twoF + twoPsi) * t2 -\n    0.00016 * Math.cos(psi) * t3 +\n    0.00004 * Math.cos(threePsi) * t3 +\n    0.00004 * Math.cos(twoPsi) * t3;\n  const perigeeAndMean =\n    2.116 * Math.sin(psi) * t -\n    0.111 * Math.sin(twoD - twoF - psi) * t -\n    0.0015 * Math.sin(psi) * t2;\n  longitudeOfPerigeeSecPart += perigeeAndMean;\n  meanLongitudeSecPart += perigeeAndMean;\n  longitudeOfNodeSecPart +=\n    -520.77 * Math.sin(psi) * t +\n    13.66 * Math.sin(twoD - twoF + psi) * t +\n    1.12 * Math.sin(twoD - psi) * t -\n    1.06 * Math.sin(twoF - psi) * t +\n    0.66 * Math.sin(twoPsi) * t2 +\n    0.371 * Math.sin(psi) * t2 -\n    0.035 * Math.sin(twoD - twoF + twoPsi) * t2 -\n    0.015 * Math.sin(twoD - twoF + psi) * t2 +\n    0.0014 * Math.sin(psi) * t3 -\n    0.0011 * Math.sin(threePsi) * t3 -\n    0.0009 * Math.sin(twoPsi) * t3;\n\n  // Add constants and convert units\n  semimajorAxis *= MetersPerKilometer;\n  const inclination =\n    inclinationConstant + inclinationSecPart * RadiansPerArcSecond;\n  const longitudeOfPerigee =\n    longitudeOfPerigeeConstant +\n    longitudeOfPerigeeSecPart * RadiansPerArcSecond;\n  const meanLongitude =\n    meanLongitudeConstant + meanLongitudeSecPart * RadiansPerArcSecond;\n  const longitudeOfNode =\n    longitudeOfNodeConstant + longitudeOfNodeSecPart * RadiansPerArcSecond;\n\n  return elementsToCartesian(\n    semimajorAxis,\n    eccentricity,\n    inclination,\n    longitudeOfPerigee,\n    longitudeOfNode,\n    meanLongitude,\n    result\n  );\n}\n\n// Gets a point describing the motion of the Earth.  This point uses the Moon point and\n// the 1992 mu value (ratio between Moon and Earth masses) in Table 2 of the paper in order\n// to determine the position of the Earth relative to the Earth-Moon barycenter.\nconst moonEarthMassRatio = 0.012300034; // From 1992 mu value in Table 2\nconst factor = (moonEarthMassRatio / (moonEarthMassRatio + 1.0)) * -1;\nfunction computeSimonEarth(date, result) {\n  result = computeSimonMoon(date, result);\n  return Cartesian3.multiplyByScalar(result, factor, result);\n}\n\n// Values for the <code>axesTransformation</code> needed for the rotation were found using the STK Components\n// GreographicTransformer on the position of the sun center of mass point and the earth J2000 frame.\n\nconst axesTransformation = new Matrix3(\n  1.0000000000000002,\n  5.619723173785822e-16,\n  4.690511510146299e-19,\n  -5.154129427414611e-16,\n  0.9174820620691819,\n  -0.39777715593191376,\n  -2.23970096136568e-16,\n  0.39777715593191376,\n  0.9174820620691819\n);\nlet translation = new Cartesian3();\n/**\n * Computes the position of the Sun in the Earth-centered inertial frame\n *\n * @param {JulianDate} [julianDate] The time at which to compute the Sun's position, if not provided the current system time is used.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} Calculated sun position\n */\nSimon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame = function (\n  julianDate,\n  result\n) {\n  if (!defined(julianDate)) {\n    julianDate = JulianDate.now();\n  }\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  //first forward transformation\n  translation = computeSimonEarthMoonBarycenter(julianDate, translation);\n  result = Cartesian3.negate(translation, result);\n\n  //second forward transformation\n  computeSimonEarth(julianDate, translation);\n\n  Cartesian3.subtract(result, translation, result);\n  Matrix3.multiplyByVector(axesTransformation, result, result);\n\n  return result;\n};\n\n/**\n * Computes the position of the Moon in the Earth-centered inertial frame\n *\n * @param {JulianDate} [julianDate] The time at which to compute the Sun's position, if not provided the current system time is used.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} Calculated moon position\n */\nSimon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame = function (\n  julianDate,\n  result\n) {\n  if (!defined(julianDate)) {\n    julianDate = JulianDate.now();\n  }\n\n  result = computeSimonMoon(julianDate, result);\n  Matrix3.multiplyByVector(axesTransformation, result, result);\n\n  return result;\n};\nexport default Simon1994PlanetaryPositions;\n", "/**\n * Indicates if the scene is viewed in 3D, 2D, or 2.5D Columbus view.\n *\n * @enum {number}\n * @see Scene#mode\n */\nconst SceneMode = {\n  /**\n   * Morphing between mode, e.g., 3D to 2D.\n   *\n   * @type {number}\n   * @constant\n   */\n  MORPHING: 0,\n\n  /**\n   * Columbus View mode.  A 2.5D perspective view where the map is laid out\n   * flat and objects with non-zero height are drawn above it.\n   *\n   * @type {number}\n   * @constant\n   */\n  COLUMBUS_VIEW: 1,\n\n  /**\n   * 2D mode.  The map is viewed top-down with an orthographic projection.\n   *\n   * @type {number}\n   * @constant\n   */\n  SCENE2D: 2,\n\n  /**\n   * 3D mode.  A traditional 3D perspective view of the globe.\n   *\n   * @type {number}\n   * @constant\n   */\n  SCENE3D: 3,\n};\n\n/**\n * Returns the morph time for the given scene mode.\n *\n * @param {SceneMode} value The scene mode\n * @returns {number} The morph time\n */\nSceneMode.getMorphTime = function (value) {\n  if (value === SceneMode.SCENE3D) {\n    return 1.0;\n  } else if (value === SceneMode.MORPHING) {\n    return undefined;\n  }\n  return 0.0;\n};\nexport default Object.freeze(SceneMode);\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\n\n/**\n * A directional light source that originates from the Sun.\n *\n * @param {object} [options] Object with the following properties:\n * @param {Color} [options.color=Color.WHITE] The light's color.\n * @param {number} [options.intensity=2.0] The light's intensity.\n *\n * @alias SunLight\n * @constructor\n */\nfunction SunLight(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  /**\n   * The color of the light.\n   * @type {Color}\n   * @default Color.WHITE\n   */\n  this.color = Color.clone(defaultValue(options.color, Color.WHITE));\n\n  /**\n   * The intensity of the light.\n   * @type {number}\n   * @default 2.0\n   */\n  this.intensity = defaultValue(options.intensity, 2.0);\n}\n\nexport default SunLight;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport EncodedCartesian3 from \"../Core/EncodedCartesian3.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport Simon1994PlanetaryPositions from \"../Core/Simon1994PlanetaryPositions.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport SceneMode from \"../Scene/SceneMode.js\";\nimport SunLight from \"../Scene/SunLight.js\";\n\n/**\n * @private\n * @constructor\n */\nfunction UniformState() {\n  /**\n   * @type {Texture}\n   */\n  this.globeDepthTexture = undefined;\n  /**\n   * @type {number}\n   */\n  this.gamma = undefined;\n\n  this._viewport = new BoundingRectangle();\n  this._viewportCartesian4 = new Cartesian4();\n  this._viewportDirty = false;\n  this._viewportOrthographicMatrix = Matrix4.clone(Matrix4.IDENTITY);\n  this._viewportTransformation = Matrix4.clone(Matrix4.IDENTITY);\n\n  this._model = Matrix4.clone(Matrix4.IDENTITY);\n  this._view = Matrix4.clone(Matrix4.IDENTITY);\n  this._inverseView = Matrix4.clone(Matrix4.IDENTITY);\n  this._projection = Matrix4.clone(Matrix4.IDENTITY);\n  this._infiniteProjection = Matrix4.clone(Matrix4.IDENTITY);\n  this._entireFrustum = new Cartesian2();\n  this._currentFrustum = new Cartesian2();\n  this._frustumPlanes = new Cartesian4();\n  this._farDepthFromNearPlusOne = undefined;\n  this._log2FarDepthFromNearPlusOne = undefined;\n  this._oneOverLog2FarDepthFromNearPlusOne = undefined;\n\n  this._frameState = undefined;\n  this._temeToPseudoFixed = Matrix3.clone(Matrix4.IDENTITY);\n\n  // Derived members\n  this._view3DDirty = true;\n  this._view3D = new Matrix4();\n\n  this._inverseView3DDirty = true;\n  this._inverseView3D = new Matrix4();\n\n  this._inverseModelDirty = true;\n  this._inverseModel = new Matrix4();\n\n  this._inverseTransposeModelDirty = true;\n  this._inverseTransposeModel = new Matrix3();\n\n  this._viewRotation = new Matrix3();\n  this._inverseViewRotation = new Matrix3();\n\n  this._viewRotation3D = new Matrix3();\n  this._inverseViewRotation3D = new Matrix3();\n\n  this._inverseProjectionDirty = true;\n  this._inverseProjection = new Matrix4();\n\n  this._modelViewDirty = true;\n  this._modelView = new Matrix4();\n\n  this._modelView3DDirty = true;\n  this._modelView3D = new Matrix4();\n\n  this._modelViewRelativeToEyeDirty = true;\n  this._modelViewRelativeToEye = new Matrix4();\n\n  this._inverseModelViewDirty = true;\n  this._inverseModelView = new Matrix4();\n\n  this._inverseModelView3DDirty = true;\n  this._inverseModelView3D = new Matrix4();\n\n  this._viewProjectionDirty = true;\n  this._viewProjection = new Matrix4();\n\n  this._inverseViewProjectionDirty = true;\n  this._inverseViewProjection = new Matrix4();\n\n  this._modelViewProjectionDirty = true;\n  this._modelViewProjection = new Matrix4();\n\n  this._inverseModelViewProjectionDirty = true;\n  this._inverseModelViewProjection = new Matrix4();\n\n  this._modelViewProjectionRelativeToEyeDirty = true;\n  this._modelViewProjectionRelativeToEye = new Matrix4();\n\n  this._modelViewInfiniteProjectionDirty = true;\n  this._modelViewInfiniteProjection = new Matrix4();\n\n  this._normalDirty = true;\n  this._normal = new Matrix3();\n\n  this._normal3DDirty = true;\n  this._normal3D = new Matrix3();\n\n  this._inverseNormalDirty = true;\n  this._inverseNormal = new Matrix3();\n\n  this._inverseNormal3DDirty = true;\n  this._inverseNormal3D = new Matrix3();\n\n  this._encodedCameraPositionMCDirty = true;\n  this._encodedCameraPositionMC = new EncodedCartesian3();\n  this._cameraPosition = new Cartesian3();\n\n  this._sunPositionWC = new Cartesian3();\n  this._sunPositionColumbusView = new Cartesian3();\n  this._sunDirectionWC = new Cartesian3();\n  this._sunDirectionEC = new Cartesian3();\n  this._moonDirectionEC = new Cartesian3();\n\n  this._lightDirectionWC = new Cartesian3();\n  this._lightDirectionEC = new Cartesian3();\n  this._lightColor = new Cartesian3();\n  this._lightColorHdr = new Cartesian3();\n\n  this._pass = undefined;\n  this._mode = undefined;\n  this._mapProjection = undefined;\n  this._ellipsoid = undefined;\n  this._cameraDirection = new Cartesian3();\n  this._cameraRight = new Cartesian3();\n  this._cameraUp = new Cartesian3();\n  this._frustum2DWidth = 0.0;\n  this._eyeHeight = 0.0;\n  this._eyeHeight2D = new Cartesian2();\n  this._eyeEllipsoidNormalEC = new Cartesian3();\n  this._eyeEllipsoidCurvature = new Cartesian2();\n  this._modelToEnu = new Matrix4();\n  this._enuToModel = new Matrix4();\n  this._pixelRatio = 1.0;\n  this._orthographicIn3D = false;\n  this._backgroundColor = new Color();\n\n  this._brdfLut = undefined;\n  this._environmentMap = undefined;\n\n  this._sphericalHarmonicCoefficients = undefined;\n  this._specularEnvironmentMaps = undefined;\n  this._specularEnvironmentMapsDimensions = new Cartesian2();\n  this._specularEnvironmentMapsMaximumLOD = undefined;\n\n  this._fogDensity = undefined;\n\n  this._invertClassificationColor = undefined;\n\n  this._splitPosition = 0.0;\n  this._pixelSizePerMeter = undefined;\n  this._geometricToleranceOverMeter = undefined;\n\n  this._minimumDisableDepthTestDistance = undefined;\n}\n\nObject.defineProperties(UniformState.prototype, {\n  /**\n   * @memberof UniformState.prototype\n   * @type {FrameState}\n   * @readonly\n   */\n  frameState: {\n    get: function () {\n      return this._frameState;\n    },\n  },\n  /**\n   * @memberof UniformState.prototype\n   * @type {BoundingRectangle}\n   */\n  viewport: {\n    get: function () {\n      return this._viewport;\n    },\n    set: function (viewport) {\n      if (!BoundingRectangle.equals(viewport, this._viewport)) {\n        BoundingRectangle.clone(viewport, this._viewport);\n\n        const v = this._viewport;\n        const vc = this._viewportCartesian4;\n        vc.x = v.x;\n        vc.y = v.y;\n        vc.z = v.width;\n        vc.w = v.height;\n\n        this._viewportDirty = true;\n      }\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @private\n   */\n  viewportCartesian4: {\n    get: function () {\n      return this._viewportCartesian4;\n    },\n  },\n\n  viewportOrthographic: {\n    get: function () {\n      cleanViewport(this);\n      return this._viewportOrthographicMatrix;\n    },\n  },\n\n  viewportTransformation: {\n    get: function () {\n      cleanViewport(this);\n      return this._viewportTransformation;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  model: {\n    get: function () {\n      return this._model;\n    },\n    set: function (matrix) {\n      Matrix4.clone(matrix, this._model);\n\n      this._modelView3DDirty = true;\n      this._inverseModelView3DDirty = true;\n      this._inverseModelDirty = true;\n      this._inverseTransposeModelDirty = true;\n      this._modelViewDirty = true;\n      this._inverseModelViewDirty = true;\n      this._modelViewRelativeToEyeDirty = true;\n      this._inverseModelViewDirty = true;\n      this._modelViewProjectionDirty = true;\n      this._inverseModelViewProjectionDirty = true;\n      this._modelViewProjectionRelativeToEyeDirty = true;\n      this._modelViewInfiniteProjectionDirty = true;\n      this._normalDirty = true;\n      this._inverseNormalDirty = true;\n      this._normal3DDirty = true;\n      this._inverseNormal3DDirty = true;\n      this._encodedCameraPositionMCDirty = true;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  inverseModel: {\n    get: function () {\n      if (this._inverseModelDirty) {\n        this._inverseModelDirty = false;\n\n        Matrix4.inverse(this._model, this._inverseModel);\n      }\n\n      return this._inverseModel;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @private\n   */\n  inverseTransposeModel: {\n    get: function () {\n      const m = this._inverseTransposeModel;\n      if (this._inverseTransposeModelDirty) {\n        this._inverseTransposeModelDirty = false;\n\n        Matrix4.getMatrix3(this.inverseModel, m);\n        Matrix3.transpose(m, m);\n      }\n\n      return m;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  view: {\n    get: function () {\n      return this._view;\n    },\n  },\n\n  /**\n   * The 3D view matrix.  In 3D mode, this is identical to {@link UniformState#view},\n   * but in 2D and Columbus View it is a synthetic matrix based on the equivalent position\n   * of the camera in the 3D world.\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  view3D: {\n    get: function () {\n      updateView3D(this);\n      return this._view3D;\n    },\n  },\n\n  /**\n   * The 3x3 rotation matrix of the current view matrix ({@link UniformState#view}).\n   * @memberof UniformState.prototype\n   * @type {Matrix3}\n   */\n  viewRotation: {\n    get: function () {\n      updateView3D(this);\n      return this._viewRotation;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix3}\n   */\n  viewRotation3D: {\n    get: function () {\n      updateView3D(this);\n      return this._viewRotation3D;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  inverseView: {\n    get: function () {\n      return this._inverseView;\n    },\n  },\n\n  /**\n   * the 4x4 inverse-view matrix that transforms from eye to 3D world coordinates.  In 3D mode, this is\n   * identical to {@link UniformState#inverseView}, but in 2D and Columbus View it is a synthetic matrix\n   * based on the equivalent position of the camera in the 3D world.\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  inverseView3D: {\n    get: function () {\n      updateInverseView3D(this);\n      return this._inverseView3D;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix3}\n   */\n  inverseViewRotation: {\n    get: function () {\n      return this._inverseViewRotation;\n    },\n  },\n\n  /**\n   * The 3x3 rotation matrix of the current 3D inverse-view matrix ({@link UniformState#inverseView3D}).\n   * @memberof UniformState.prototype\n   * @type {Matrix3}\n   */\n  inverseViewRotation3D: {\n    get: function () {\n      updateInverseView3D(this);\n      return this._inverseViewRotation3D;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  projection: {\n    get: function () {\n      return this._projection;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  inverseProjection: {\n    get: function () {\n      cleanInverseProjection(this);\n      return this._inverseProjection;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  infiniteProjection: {\n    get: function () {\n      return this._infiniteProjection;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  modelView: {\n    get: function () {\n      cleanModelView(this);\n      return this._modelView;\n    },\n  },\n\n  /**\n   * The 3D model-view matrix.  In 3D mode, this is equivalent to {@link UniformState#modelView}.  In 2D and\n   * Columbus View, however, it is a synthetic matrix based on the equivalent position of the camera in the 3D world.\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  modelView3D: {\n    get: function () {\n      cleanModelView3D(this);\n      return this._modelView3D;\n    },\n  },\n\n  /**\n   * Model-view relative to eye matrix.\n   *\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  modelViewRelativeToEye: {\n    get: function () {\n      cleanModelViewRelativeToEye(this);\n      return this._modelViewRelativeToEye;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  inverseModelView: {\n    get: function () {\n      cleanInverseModelView(this);\n      return this._inverseModelView;\n    },\n  },\n\n  /**\n   * The inverse of the 3D model-view matrix.  In 3D mode, this is equivalent to {@link UniformState#inverseModelView}.\n   * In 2D and Columbus View, however, it is a synthetic matrix based on the equivalent position of the camera in the 3D world.\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  inverseModelView3D: {\n    get: function () {\n      cleanInverseModelView3D(this);\n      return this._inverseModelView3D;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  viewProjection: {\n    get: function () {\n      cleanViewProjection(this);\n      return this._viewProjection;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  inverseViewProjection: {\n    get: function () {\n      cleanInverseViewProjection(this);\n      return this._inverseViewProjection;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  modelViewProjection: {\n    get: function () {\n      cleanModelViewProjection(this);\n      return this._modelViewProjection;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  inverseModelViewProjection: {\n    get: function () {\n      cleanInverseModelViewProjection(this);\n      return this._inverseModelViewProjection;\n    },\n  },\n\n  /**\n   * Model-view-projection relative to eye matrix.\n   *\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  modelViewProjectionRelativeToEye: {\n    get: function () {\n      cleanModelViewProjectionRelativeToEye(this);\n      return this._modelViewProjectionRelativeToEye;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  modelViewInfiniteProjection: {\n    get: function () {\n      cleanModelViewInfiniteProjection(this);\n      return this._modelViewInfiniteProjection;\n    },\n  },\n\n  /**\n   * A 3x3 normal transformation matrix that transforms normal vectors in model coordinates to\n   * eye coordinates.\n   * @memberof UniformState.prototype\n   * @type {Matrix3}\n   */\n  normal: {\n    get: function () {\n      cleanNormal(this);\n      return this._normal;\n    },\n  },\n\n  /**\n   * A 3x3 normal transformation matrix that transforms normal vectors in 3D model\n   * coordinates to eye coordinates.  In 3D mode, this is identical to\n   * {@link UniformState#normal}, but in 2D and Columbus View it represents the normal transformation\n   * matrix as if the camera were at an equivalent location in 3D mode.\n   * @memberof UniformState.prototype\n   * @type {Matrix3}\n   */\n  normal3D: {\n    get: function () {\n      cleanNormal3D(this);\n      return this._normal3D;\n    },\n  },\n\n  /**\n   * An inverse 3x3 normal transformation matrix that transforms normal vectors in model coordinates\n   * to eye coordinates.\n   * @memberof UniformState.prototype\n   * @type {Matrix3}\n   */\n  inverseNormal: {\n    get: function () {\n      cleanInverseNormal(this);\n      return this._inverseNormal;\n    },\n  },\n\n  /**\n   * An inverse 3x3 normal transformation matrix that transforms normal vectors in eye coordinates\n   * to 3D model coordinates.  In 3D mode, this is identical to\n   * {@link UniformState#inverseNormal}, but in 2D and Columbus View it represents the normal transformation\n   * matrix as if the camera were at an equivalent location in 3D mode.\n   * @memberof UniformState.prototype\n   * @type {Matrix3}\n   */\n  inverseNormal3D: {\n    get: function () {\n      cleanInverseNormal3D(this);\n      return this._inverseNormal3D;\n    },\n  },\n\n  /**\n   * The near distance (<code>x</code>) and the far distance (<code>y</code>) of the frustum defined by the camera.\n   * This is the largest possible frustum, not an individual frustum used for multi-frustum rendering.\n   * @memberof UniformState.prototype\n   * @type {Cartesian2}\n   */\n  entireFrustum: {\n    get: function () {\n      return this._entireFrustum;\n    },\n  },\n\n  /**\n   * The near distance (<code>x</code>) and the far distance (<code>y</code>) of the frustum defined by the camera.\n   * This is the individual frustum used for multi-frustum rendering.\n   * @memberof UniformState.prototype\n   * @type {Cartesian2}\n   */\n  currentFrustum: {\n    get: function () {\n      return this._currentFrustum;\n    },\n  },\n\n  /**\n   * The distances to the frustum planes. The top, bottom, left and right distances are\n   * the x, y, z, and w components, respectively.\n   * @memberof UniformState.prototype\n   * @type {Cartesian4}\n   */\n  frustumPlanes: {\n    get: function () {\n      return this._frustumPlanes;\n    },\n  },\n\n  /**\n   * The far plane's distance from the near plane, plus 1.0.\n   *\n   * @memberof UniformState.prototype\n   * @type {number}\n   */\n  farDepthFromNearPlusOne: {\n    get: function () {\n      return this._farDepthFromNearPlusOne;\n    },\n  },\n\n  /**\n   * The log2 of {@link UniformState#farDepthFromNearPlusOne}.\n   *\n   * @memberof UniformState.prototype\n   * @type {number}\n   */\n  log2FarDepthFromNearPlusOne: {\n    get: function () {\n      return this._log2FarDepthFromNearPlusOne;\n    },\n  },\n\n  /**\n   * 1.0 divided by {@link UniformState#log2FarDepthFromNearPlusOne}.\n   *\n   * @memberof UniformState.prototype\n   * @type {number}\n   */\n  oneOverLog2FarDepthFromNearPlusOne: {\n    get: function () {\n      return this._oneOverLog2FarDepthFromNearPlusOne;\n    },\n  },\n\n  /**\n   * The height in meters of the eye (camera) above or below the ellipsoid.\n   * @memberof UniformState.prototype\n   * @type {number}\n   */\n  eyeHeight: {\n    get: function () {\n      return this._eyeHeight;\n    },\n  },\n\n  /**\n   * The height (<code>x</code>) and the height squared (<code>y</code>)\n   * in meters of the eye (camera) above the 2D world plane. This uniform is only valid\n   * when the {@link SceneMode} is <code>SCENE2D</code>.\n   * @memberof UniformState.prototype\n   * @type {Cartesian2}\n   */\n  eyeHeight2D: {\n    get: function () {\n      return this._eyeHeight2D;\n    },\n  },\n\n  /**\n   * The ellipsoid surface normal at the camera position, in model coordinates.\n   * @memberof UniformState.prototype\n   * @type {Cartesian3}\n   */\n  eyeEllipsoidNormalEC: {\n    get: function () {\n      return this._eyeEllipsoidNormalEC;\n    },\n  },\n\n  /**\n   * The ellipsoid radii of curvature at the camera position.\n   * The .x component is the prime vertical radius, .y is the meridional.\n   * @memberof UniformState.prototype\n   * @type {Cartesian2}\n   */\n  eyeEllipsoidCurvature: {\n    get: function () {\n      return this._eyeEllipsoidCurvature;\n    },\n  },\n\n  /**\n   * A transform from model coordinates to an east-north-up coordinate system\n   * centered at the position on the ellipsoid below the camera\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  modelToEnu: {\n    get: function () {\n      return this._modelToEnu;\n    },\n  },\n\n  /**\n   * The inverse of {@link UniformState.prototype.modelToEnu}\n   * @memberof UniformState.prototype\n   * @type {Matrix4}\n   */\n  enuToModel: {\n    get: function () {\n      return this._enuToModel;\n    },\n  },\n\n  /**\n   * The sun position in 3D world coordinates at the current scene time.\n   * @memberof UniformState.prototype\n   * @type {Cartesian3}\n   */\n  sunPositionWC: {\n    get: function () {\n      return this._sunPositionWC;\n    },\n  },\n\n  /**\n   * The sun position in 2D world coordinates at the current scene time.\n   * @memberof UniformState.prototype\n   * @type {Cartesian3}\n   */\n  sunPositionColumbusView: {\n    get: function () {\n      return this._sunPositionColumbusView;\n    },\n  },\n\n  /**\n   * A normalized vector to the sun in 3D world coordinates at the current scene time.  Even in 2D or\n   * Columbus View mode, this returns the direction to the sun in the 3D scene.\n   * @memberof UniformState.prototype\n   * @type {Cartesian3}\n   */\n  sunDirectionWC: {\n    get: function () {\n      return this._sunDirectionWC;\n    },\n  },\n\n  /**\n   * A normalized vector to the sun in eye coordinates at the current scene time.  In 3D mode, this\n   * returns the actual vector from the camera position to the sun position.  In 2D and Columbus View, it returns\n   * the vector from the equivalent 3D camera position to the position of the sun in the 3D scene.\n   * @memberof UniformState.prototype\n   * @type {Cartesian3}\n   */\n  sunDirectionEC: {\n    get: function () {\n      return this._sunDirectionEC;\n    },\n  },\n\n  /**\n   * A normalized vector to the moon in eye coordinates at the current scene time.  In 3D mode, this\n   * returns the actual vector from the camera position to the moon position.  In 2D and Columbus View, it returns\n   * the vector from the equivalent 3D camera position to the position of the moon in the 3D scene.\n   * @memberof UniformState.prototype\n   * @type {Cartesian3}\n   */\n  moonDirectionEC: {\n    get: function () {\n      return this._moonDirectionEC;\n    },\n  },\n\n  /**\n   * A normalized vector to the scene's light source in 3D world coordinates.  Even in 2D or\n   * Columbus View mode, this returns the direction to the light in the 3D scene.\n   * @memberof UniformState.prototype\n   * @type {Cartesian3}\n   */\n  lightDirectionWC: {\n    get: function () {\n      return this._lightDirectionWC;\n    },\n  },\n\n  /**\n   * A normalized vector to the scene's light source in eye coordinates.  In 3D mode, this\n   * returns the actual vector from the camera position to the light.  In 2D and Columbus View, it returns\n   * the vector from the equivalent 3D camera position in the 3D scene.\n   * @memberof UniformState.prototype\n   * @type {Cartesian3}\n   */\n  lightDirectionEC: {\n    get: function () {\n      return this._lightDirectionEC;\n    },\n  },\n\n  /**\n   * The color of light emitted by the scene's light source. This is equivalent to the light\n   * color multiplied by the light intensity limited to a maximum luminance of 1.0 suitable\n   * for non-HDR lighting.\n   * @memberof UniformState.prototype\n   * @type {Cartesian3}\n   */\n  lightColor: {\n    get: function () {\n      return this._lightColor;\n    },\n  },\n\n  /**\n   * The high dynamic range color of light emitted by the scene's light source. This is equivalent to\n   * the light color multiplied by the light intensity suitable for HDR lighting.\n   * @memberof UniformState.prototype\n   * @type {Cartesian3}\n   */\n  lightColorHdr: {\n    get: function () {\n      return this._lightColorHdr;\n    },\n  },\n\n  /**\n   * The high bits of the camera position.\n   * @memberof UniformState.prototype\n   * @type {Cartesian3}\n   */\n  encodedCameraPositionMCHigh: {\n    get: function () {\n      cleanEncodedCameraPositionMC(this);\n      return this._encodedCameraPositionMC.high;\n    },\n  },\n\n  /**\n   * The low bits of the camera position.\n   * @memberof UniformState.prototype\n   * @type {Cartesian3}\n   */\n  encodedCameraPositionMCLow: {\n    get: function () {\n      cleanEncodedCameraPositionMC(this);\n      return this._encodedCameraPositionMC.low;\n    },\n  },\n\n  /**\n   * A 3x3 matrix that transforms from True Equator Mean Equinox (TEME) axes to the\n   * pseudo-fixed axes at the Scene's current time.\n   * @memberof UniformState.prototype\n   * @type {Matrix3}\n   */\n  temeToPseudoFixedMatrix: {\n    get: function () {\n      return this._temeToPseudoFixed;\n    },\n  },\n\n  /**\n   * Gets the scaling factor for transforming from the canvas\n   * pixel space to canvas coordinate space.\n   * @memberof UniformState.prototype\n   * @type {number}\n   */\n  pixelRatio: {\n    get: function () {\n      return this._pixelRatio;\n    },\n  },\n\n  /**\n   * A scalar used to mix a color with the fog color based on the distance to the camera.\n   * @memberof UniformState.prototype\n   * @type {number}\n   */\n  fogDensity: {\n    get: function () {\n      return this._fogDensity;\n    },\n  },\n\n  /**\n   * A scalar that represents the geometric tolerance per meter\n   * @memberof UniformState.prototype\n   * @type {number}\n   */\n  geometricToleranceOverMeter: {\n    get: function () {\n      return this._geometricToleranceOverMeter;\n    },\n  },\n\n  /**\n   * @memberof UniformState.prototype\n   * @type {Pass}\n   */\n  pass: {\n    get: function () {\n      return this._pass;\n    },\n  },\n\n  /**\n   * The current background color\n   * @memberof UniformState.prototype\n   * @type {Color}\n   */\n  backgroundColor: {\n    get: function () {\n      return this._backgroundColor;\n    },\n  },\n\n  /**\n   * The look up texture used to find the BRDF for a material\n   * @memberof UniformState.prototype\n   * @type {Texture}\n   */\n  brdfLut: {\n    get: function () {\n      return this._brdfLut;\n    },\n  },\n\n  /**\n   * The environment map of the scene\n   * @memberof UniformState.prototype\n   * @type {CubeMap}\n   */\n  environmentMap: {\n    get: function () {\n      return this._environmentMap;\n    },\n  },\n\n  /**\n   * The spherical harmonic coefficients of the scene.\n   * @memberof UniformState.prototype\n   * @type {Cartesian3[]}\n   */\n  sphericalHarmonicCoefficients: {\n    get: function () {\n      return this._sphericalHarmonicCoefficients;\n    },\n  },\n\n  /**\n   * The specular environment map atlas of the scene.\n   * @memberof UniformState.prototype\n   * @type {Texture}\n   */\n  specularEnvironmentMaps: {\n    get: function () {\n      return this._specularEnvironmentMaps;\n    },\n  },\n\n  /**\n   * The dimensions of the specular environment map atlas of the scene.\n   * @memberof UniformState.prototype\n   * @type {Cartesian2}\n   */\n  specularEnvironmentMapsDimensions: {\n    get: function () {\n      return this._specularEnvironmentMapsDimensions;\n    },\n  },\n\n  /**\n   * The maximum level-of-detail of the specular environment map atlas of the scene.\n   * @memberof UniformState.prototype\n   * @type {number}\n   */\n  specularEnvironmentMapsMaximumLOD: {\n    get: function () {\n      return this._specularEnvironmentMapsMaximumLOD;\n    },\n  },\n\n  /**\n   * The splitter position to use when rendering with a splitter. This will be in pixel coordinates relative to the canvas.\n   * @memberof UniformState.prototype\n   * @type {number}\n   */\n  splitPosition: {\n    get: function () {\n      return this._splitPosition;\n    },\n  },\n\n  /**\n   * The distance from the camera at which to disable the depth test of billboards, labels and points\n   * to, for example, prevent clipping against terrain. When set to zero, the depth test should always\n   * be applied. When less than zero, the depth test should never be applied.\n   *\n   * @memberof UniformState.prototype\n   * @type {number}\n   */\n  minimumDisableDepthTestDistance: {\n    get: function () {\n      return this._minimumDisableDepthTestDistance;\n    },\n  },\n\n  /**\n   * The highlight color of unclassified 3D Tiles.\n   *\n   * @memberof UniformState.prototype\n   * @type {Color}\n   */\n  invertClassificationColor: {\n    get: function () {\n      return this._invertClassificationColor;\n    },\n  },\n\n  /**\n   * Whether or not the current projection is orthographic in 3D.\n   *\n   * @memberOf UniformState.prototype\n   * @type {boolean}\n   */\n  orthographicIn3D: {\n    get: function () {\n      return this._orthographicIn3D;\n    },\n  },\n\n  /**\n   * The current ellipsoid.\n   *\n   * @memberOf UniformState.prototype\n   * @type {Ellipsoid}\n   */\n  ellipsoid: {\n    get: function () {\n      return defaultValue(this._ellipsoid, Ellipsoid.WGS84);\n    },\n  },\n});\n\nfunction setView(uniformState, matrix) {\n  Matrix4.clone(matrix, uniformState._view);\n  Matrix4.getMatrix3(matrix, uniformState._viewRotation);\n\n  uniformState._view3DDirty = true;\n  uniformState._inverseView3DDirty = true;\n  uniformState._modelViewDirty = true;\n  uniformState._modelView3DDirty = true;\n  uniformState._modelViewRelativeToEyeDirty = true;\n  uniformState._inverseModelViewDirty = true;\n  uniformState._inverseModelView3DDirty = true;\n  uniformState._viewProjectionDirty = true;\n  uniformState._inverseViewProjectionDirty = true;\n  uniformState._modelViewProjectionDirty = true;\n  uniformState._modelViewProjectionRelativeToEyeDirty = true;\n  uniformState._modelViewInfiniteProjectionDirty = true;\n  uniformState._normalDirty = true;\n  uniformState._inverseNormalDirty = true;\n  uniformState._normal3DDirty = true;\n  uniformState._inverseNormal3DDirty = true;\n}\n\nfunction setInverseView(uniformState, matrix) {\n  Matrix4.clone(matrix, uniformState._inverseView);\n  Matrix4.getMatrix3(matrix, uniformState._inverseViewRotation);\n}\n\nfunction setProjection(uniformState, matrix) {\n  Matrix4.clone(matrix, uniformState._projection);\n\n  uniformState._inverseProjectionDirty = true;\n  uniformState._viewProjectionDirty = true;\n  uniformState._inverseViewProjectionDirty = true;\n  uniformState._modelViewProjectionDirty = true;\n  uniformState._modelViewProjectionRelativeToEyeDirty = true;\n}\n\nfunction setInfiniteProjection(uniformState, matrix) {\n  Matrix4.clone(matrix, uniformState._infiniteProjection);\n\n  uniformState._modelViewInfiniteProjectionDirty = true;\n}\n\nconst surfacePositionScratch = new Cartesian3();\nconst enuTransformScratch = new Matrix4();\n\nfunction setCamera(uniformState, camera) {\n  Cartesian3.clone(camera.positionWC, uniformState._cameraPosition);\n  Cartesian3.clone(camera.directionWC, uniformState._cameraDirection);\n  Cartesian3.clone(camera.rightWC, uniformState._cameraRight);\n  Cartesian3.clone(camera.upWC, uniformState._cameraUp);\n\n  const ellipsoid = uniformState._ellipsoid;\n  let surfacePosition;\n\n  const positionCartographic = camera.positionCartographic;\n  if (!defined(positionCartographic)) {\n    uniformState._eyeHeight = -ellipsoid.maximumRadius;\n    if (Cartesian3.magnitude(camera.positionWC) > 0.0) {\n      uniformState._eyeEllipsoidNormalEC = Cartesian3.normalize(\n        camera.positionWC,\n        uniformState._eyeEllipsoidNormalEC\n      );\n    }\n    surfacePosition = ellipsoid.scaleToGeodeticSurface(\n      camera.positionWC,\n      surfacePositionScratch\n    );\n  } else {\n    uniformState._eyeHeight = positionCartographic.height;\n    uniformState._eyeEllipsoidNormalEC = ellipsoid.geodeticSurfaceNormalCartographic(\n      positionCartographic,\n      uniformState._eyeEllipsoidNormalEC\n    );\n    surfacePosition = Cartesian3.fromRadians(\n      positionCartographic.longitude,\n      positionCartographic.latitude,\n      0.0,\n      ellipsoid,\n      surfacePositionScratch\n    );\n  }\n\n  uniformState._encodedCameraPositionMCDirty = true;\n\n  if (!defined(surfacePosition)) {\n    return;\n  }\n\n  uniformState._eyeEllipsoidNormalEC = Matrix3.multiplyByVector(\n    uniformState._viewRotation,\n    uniformState._eyeEllipsoidNormalEC,\n    uniformState._eyeEllipsoidNormalEC\n  );\n\n  const enuToWorld = Transforms.eastNorthUpToFixedFrame(\n    surfacePosition,\n    ellipsoid,\n    enuTransformScratch\n  );\n  uniformState._enuToModel = Matrix4.multiplyTransformation(\n    uniformState.inverseModel,\n    enuToWorld,\n    uniformState._enuToModel\n  );\n  uniformState._modelToEnu = Matrix4.inverseTransformation(\n    uniformState._enuToModel,\n    uniformState._modelToEnu\n  );\n\n  if (\n    !CesiumMath.equalsEpsilon(\n      ellipsoid._radii.x,\n      ellipsoid._radii.y,\n      CesiumMath.EPSILON15\n    )\n  ) {\n    // Ellipsoid curvature calculations assume radii.x === radii.y as is true for WGS84\n    return;\n  }\n\n  uniformState._eyeEllipsoidCurvature = ellipsoid.getLocalCurvature(\n    surfacePosition,\n    uniformState._eyeEllipsoidCurvature\n  );\n}\n\nlet transformMatrix = new Matrix3();\nconst sunCartographicScratch = new Cartographic();\nfunction setSunAndMoonDirections(uniformState, frameState) {\n  if (\n    !defined(\n      Transforms.computeIcrfToFixedMatrix(frameState.time, transformMatrix)\n    )\n  ) {\n    transformMatrix = Transforms.computeTemeToPseudoFixedMatrix(\n      frameState.time,\n      transformMatrix\n    );\n  }\n\n  let position = Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(\n    frameState.time,\n    uniformState._sunPositionWC\n  );\n  Matrix3.multiplyByVector(transformMatrix, position, position);\n\n  Cartesian3.normalize(position, uniformState._sunDirectionWC);\n\n  position = Matrix3.multiplyByVector(\n    uniformState.viewRotation3D,\n    position,\n    uniformState._sunDirectionEC\n  );\n  Cartesian3.normalize(position, position);\n\n  position = Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame(\n    frameState.time,\n    uniformState._moonDirectionEC\n  );\n  Matrix3.multiplyByVector(transformMatrix, position, position);\n  Matrix3.multiplyByVector(uniformState.viewRotation3D, position, position);\n  Cartesian3.normalize(position, position);\n\n  const projection = frameState.mapProjection;\n  const ellipsoid = projection.ellipsoid;\n  const sunCartographic = ellipsoid.cartesianToCartographic(\n    uniformState._sunPositionWC,\n    sunCartographicScratch\n  );\n  projection.project(sunCartographic, uniformState._sunPositionColumbusView);\n}\n\n/**\n * Synchronizes the frustum's state with the camera state.  This is called\n * by the {@link Scene} when rendering to ensure that automatic GLSL uniforms\n * are set to the right value.\n *\n * @param {object} camera The camera to synchronize with.\n */\nUniformState.prototype.updateCamera = function (camera) {\n  setView(this, camera.viewMatrix);\n  setInverseView(this, camera.inverseViewMatrix);\n  setCamera(this, camera);\n\n  this._entireFrustum.x = camera.frustum.near;\n  this._entireFrustum.y = camera.frustum.far;\n  this.updateFrustum(camera.frustum);\n\n  this._orthographicIn3D =\n    this._mode !== SceneMode.SCENE2D &&\n    camera.frustum instanceof OrthographicFrustum;\n};\n\n/**\n * Synchronizes the frustum's state with the uniform state.  This is called\n * by the {@link Scene} when rendering to ensure that automatic GLSL uniforms\n * are set to the right value.\n *\n * @param {object} frustum The frustum to synchronize with.\n */\nUniformState.prototype.updateFrustum = function (frustum) {\n  setProjection(this, frustum.projectionMatrix);\n  if (defined(frustum.infiniteProjectionMatrix)) {\n    setInfiniteProjection(this, frustum.infiniteProjectionMatrix);\n  }\n  this._currentFrustum.x = frustum.near;\n  this._currentFrustum.y = frustum.far;\n\n  this._farDepthFromNearPlusOne = frustum.far - frustum.near + 1.0;\n  this._log2FarDepthFromNearPlusOne = CesiumMath.log2(\n    this._farDepthFromNearPlusOne\n  );\n  this._oneOverLog2FarDepthFromNearPlusOne =\n    1.0 / this._log2FarDepthFromNearPlusOne;\n\n  const offCenterFrustum = frustum.offCenterFrustum;\n  if (defined(offCenterFrustum)) {\n    frustum = offCenterFrustum;\n  }\n\n  this._frustumPlanes.x = frustum.top;\n  this._frustumPlanes.y = frustum.bottom;\n  this._frustumPlanes.z = frustum.left;\n  this._frustumPlanes.w = frustum.right;\n};\n\nUniformState.prototype.updatePass = function (pass) {\n  this._pass = pass;\n};\n\nconst EMPTY_ARRAY = [];\nconst defaultLight = new SunLight();\n\n/**\n * Synchronizes frame state with the uniform state.  This is called\n * by the {@link Scene} when rendering to ensure that automatic GLSL uniforms\n * are set to the right value.\n *\n * @param {FrameState} frameState The frameState to synchronize with.\n */\nUniformState.prototype.update = function (frameState) {\n  this._mode = frameState.mode;\n  this._mapProjection = frameState.mapProjection;\n  this._ellipsoid = frameState.mapProjection.ellipsoid;\n  this._pixelRatio = frameState.pixelRatio;\n\n  const camera = frameState.camera;\n  this.updateCamera(camera);\n\n  if (frameState.mode === SceneMode.SCENE2D) {\n    this._frustum2DWidth = camera.frustum.right - camera.frustum.left;\n    this._eyeHeight2D.x = this._frustum2DWidth * 0.5;\n    this._eyeHeight2D.y = this._eyeHeight2D.x * this._eyeHeight2D.x;\n  } else {\n    this._frustum2DWidth = 0.0;\n    this._eyeHeight2D.x = 0.0;\n    this._eyeHeight2D.y = 0.0;\n  }\n\n  setSunAndMoonDirections(this, frameState);\n\n  const light = defaultValue(frameState.light, defaultLight);\n  if (light instanceof SunLight) {\n    this._lightDirectionWC = Cartesian3.clone(\n      this._sunDirectionWC,\n      this._lightDirectionWC\n    );\n    this._lightDirectionEC = Cartesian3.clone(\n      this._sunDirectionEC,\n      this._lightDirectionEC\n    );\n  } else {\n    this._lightDirectionWC = Cartesian3.normalize(\n      Cartesian3.negate(light.direction, this._lightDirectionWC),\n      this._lightDirectionWC\n    );\n    this._lightDirectionEC = Matrix3.multiplyByVector(\n      this.viewRotation3D,\n      this._lightDirectionWC,\n      this._lightDirectionEC\n    );\n  }\n\n  const lightColor = light.color;\n  let lightColorHdr = Cartesian3.fromElements(\n    lightColor.red,\n    lightColor.green,\n    lightColor.blue,\n    this._lightColorHdr\n  );\n  lightColorHdr = Cartesian3.multiplyByScalar(\n    lightColorHdr,\n    light.intensity,\n    lightColorHdr\n  );\n  const maximumComponent = Cartesian3.maximumComponent(lightColorHdr);\n  if (maximumComponent > 1.0) {\n    Cartesian3.divideByScalar(\n      lightColorHdr,\n      maximumComponent,\n      this._lightColor\n    );\n  } else {\n    Cartesian3.clone(lightColorHdr, this._lightColor);\n  }\n\n  const brdfLutGenerator = frameState.brdfLutGenerator;\n  const brdfLut = defined(brdfLutGenerator)\n    ? brdfLutGenerator.colorTexture\n    : undefined;\n  this._brdfLut = brdfLut;\n\n  this._environmentMap = defaultValue(\n    frameState.environmentMap,\n    frameState.context.defaultCubeMap\n  );\n\n  // IE 11 doesn't optimize out uniforms that are #ifdef'd out. So undefined values for the spherical harmonic\n  // coefficients and specular environment map atlas dimensions cause a crash.\n  this._sphericalHarmonicCoefficients = defaultValue(\n    frameState.sphericalHarmonicCoefficients,\n    EMPTY_ARRAY\n  );\n  this._specularEnvironmentMaps = frameState.specularEnvironmentMaps;\n  this._specularEnvironmentMapsMaximumLOD =\n    frameState.specularEnvironmentMapsMaximumLOD;\n\n  if (defined(this._specularEnvironmentMaps)) {\n    Cartesian2.clone(\n      this._specularEnvironmentMaps.dimensions,\n      this._specularEnvironmentMapsDimensions\n    );\n  }\n\n  this._fogDensity = frameState.fog.density;\n\n  this._invertClassificationColor = frameState.invertClassificationColor;\n\n  this._frameState = frameState;\n  this._temeToPseudoFixed = Transforms.computeTemeToPseudoFixedMatrix(\n    frameState.time,\n    this._temeToPseudoFixed\n  );\n\n  // Convert the relative splitPosition to absolute pixel coordinates\n  this._splitPosition =\n    frameState.splitPosition * frameState.context.drawingBufferWidth;\n  const fov = camera.frustum.fov;\n  const viewport = this._viewport;\n  let pixelSizePerMeter;\n  if (defined(fov)) {\n    if (viewport.height > viewport.width) {\n      pixelSizePerMeter = (Math.tan(0.5 * fov) * 2.0) / viewport.height;\n    } else {\n      pixelSizePerMeter = (Math.tan(0.5 * fov) * 2.0) / viewport.width;\n    }\n  } else {\n    pixelSizePerMeter = 1.0 / Math.max(viewport.width, viewport.height);\n  }\n\n  this._geometricToleranceOverMeter =\n    pixelSizePerMeter * frameState.maximumScreenSpaceError;\n  Color.clone(frameState.backgroundColor, this._backgroundColor);\n\n  this._minimumDisableDepthTestDistance =\n    frameState.minimumDisableDepthTestDistance;\n  this._minimumDisableDepthTestDistance *= this._minimumDisableDepthTestDistance;\n  if (this._minimumDisableDepthTestDistance === Number.POSITIVE_INFINITY) {\n    this._minimumDisableDepthTestDistance = -1.0;\n  }\n};\n\nfunction cleanViewport(uniformState) {\n  if (uniformState._viewportDirty) {\n    const v = uniformState._viewport;\n    Matrix4.computeOrthographicOffCenter(\n      v.x,\n      v.x + v.width,\n      v.y,\n      v.y + v.height,\n      0.0,\n      1.0,\n      uniformState._viewportOrthographicMatrix\n    );\n    Matrix4.computeViewportTransformation(\n      v,\n      0.0,\n      1.0,\n      uniformState._viewportTransformation\n    );\n    uniformState._viewportDirty = false;\n  }\n}\n\nfunction cleanInverseProjection(uniformState) {\n  if (uniformState._inverseProjectionDirty) {\n    uniformState._inverseProjectionDirty = false;\n\n    if (\n      uniformState._mode !== SceneMode.SCENE2D &&\n      uniformState._mode !== SceneMode.MORPHING &&\n      !uniformState._orthographicIn3D\n    ) {\n      Matrix4.inverse(\n        uniformState._projection,\n        uniformState._inverseProjection\n      );\n    } else {\n      Matrix4.clone(Matrix4.ZERO, uniformState._inverseProjection);\n    }\n  }\n}\n\n// Derived\nfunction cleanModelView(uniformState) {\n  if (uniformState._modelViewDirty) {\n    uniformState._modelViewDirty = false;\n\n    Matrix4.multiplyTransformation(\n      uniformState._view,\n      uniformState._model,\n      uniformState._modelView\n    );\n  }\n}\n\nfunction cleanModelView3D(uniformState) {\n  if (uniformState._modelView3DDirty) {\n    uniformState._modelView3DDirty = false;\n\n    Matrix4.multiplyTransformation(\n      uniformState.view3D,\n      uniformState._model,\n      uniformState._modelView3D\n    );\n  }\n}\n\nfunction cleanInverseModelView(uniformState) {\n  if (uniformState._inverseModelViewDirty) {\n    uniformState._inverseModelViewDirty = false;\n\n    Matrix4.inverse(uniformState.modelView, uniformState._inverseModelView);\n  }\n}\n\nfunction cleanInverseModelView3D(uniformState) {\n  if (uniformState._inverseModelView3DDirty) {\n    uniformState._inverseModelView3DDirty = false;\n\n    Matrix4.inverse(uniformState.modelView3D, uniformState._inverseModelView3D);\n  }\n}\n\nfunction cleanViewProjection(uniformState) {\n  if (uniformState._viewProjectionDirty) {\n    uniformState._viewProjectionDirty = false;\n\n    Matrix4.multiply(\n      uniformState._projection,\n      uniformState._view,\n      uniformState._viewProjection\n    );\n  }\n}\n\nfunction cleanInverseViewProjection(uniformState) {\n  if (uniformState._inverseViewProjectionDirty) {\n    uniformState._inverseViewProjectionDirty = false;\n\n    Matrix4.inverse(\n      uniformState.viewProjection,\n      uniformState._inverseViewProjection\n    );\n  }\n}\n\nfunction cleanModelViewProjection(uniformState) {\n  if (uniformState._modelViewProjectionDirty) {\n    uniformState._modelViewProjectionDirty = false;\n\n    Matrix4.multiply(\n      uniformState._projection,\n      uniformState.modelView,\n      uniformState._modelViewProjection\n    );\n  }\n}\n\nfunction cleanModelViewRelativeToEye(uniformState) {\n  if (uniformState._modelViewRelativeToEyeDirty) {\n    uniformState._modelViewRelativeToEyeDirty = false;\n\n    const mv = uniformState.modelView;\n    const mvRte = uniformState._modelViewRelativeToEye;\n    mvRte[0] = mv[0];\n    mvRte[1] = mv[1];\n    mvRte[2] = mv[2];\n    mvRte[3] = mv[3];\n    mvRte[4] = mv[4];\n    mvRte[5] = mv[5];\n    mvRte[6] = mv[6];\n    mvRte[7] = mv[7];\n    mvRte[8] = mv[8];\n    mvRte[9] = mv[9];\n    mvRte[10] = mv[10];\n    mvRte[11] = mv[11];\n    mvRte[12] = 0.0;\n    mvRte[13] = 0.0;\n    mvRte[14] = 0.0;\n    mvRte[15] = mv[15];\n  }\n}\n\nfunction cleanInverseModelViewProjection(uniformState) {\n  if (uniformState._inverseModelViewProjectionDirty) {\n    uniformState._inverseModelViewProjectionDirty = false;\n\n    Matrix4.inverse(\n      uniformState.modelViewProjection,\n      uniformState._inverseModelViewProjection\n    );\n  }\n}\n\nfunction cleanModelViewProjectionRelativeToEye(uniformState) {\n  if (uniformState._modelViewProjectionRelativeToEyeDirty) {\n    uniformState._modelViewProjectionRelativeToEyeDirty = false;\n\n    Matrix4.multiply(\n      uniformState._projection,\n      uniformState.modelViewRelativeToEye,\n      uniformState._modelViewProjectionRelativeToEye\n    );\n  }\n}\n\nfunction cleanModelViewInfiniteProjection(uniformState) {\n  if (uniformState._modelViewInfiniteProjectionDirty) {\n    uniformState._modelViewInfiniteProjectionDirty = false;\n\n    Matrix4.multiply(\n      uniformState._infiniteProjection,\n      uniformState.modelView,\n      uniformState._modelViewInfiniteProjection\n    );\n  }\n}\n\nfunction cleanNormal(uniformState) {\n  if (uniformState._normalDirty) {\n    uniformState._normalDirty = false;\n\n    const m = uniformState._normal;\n    Matrix4.getMatrix3(uniformState.inverseModelView, m);\n    Matrix3.transpose(m, m);\n  }\n}\n\nfunction cleanNormal3D(uniformState) {\n  if (uniformState._normal3DDirty) {\n    uniformState._normal3DDirty = false;\n\n    const m = uniformState._normal3D;\n    Matrix4.getMatrix3(uniformState.inverseModelView3D, m);\n    Matrix3.transpose(m, m);\n  }\n}\n\nfunction cleanInverseNormal(uniformState) {\n  if (uniformState._inverseNormalDirty) {\n    uniformState._inverseNormalDirty = false;\n\n    const m = uniformState._inverseNormal;\n    Matrix4.getMatrix3(uniformState.modelView, m);\n    Matrix3.transpose(m, m);\n  }\n}\n\nfunction cleanInverseNormal3D(uniformState) {\n  if (uniformState._inverseNormal3DDirty) {\n    uniformState._inverseNormal3DDirty = false;\n\n    const m = uniformState._inverseNormal3D;\n    Matrix4.getMatrix3(uniformState.modelView3D, m);\n    Matrix3.transpose(m, m);\n  }\n}\n\nconst cameraPositionMC = new Cartesian3();\n\nfunction cleanEncodedCameraPositionMC(uniformState) {\n  if (uniformState._encodedCameraPositionMCDirty) {\n    uniformState._encodedCameraPositionMCDirty = false;\n\n    Matrix4.multiplyByPoint(\n      uniformState.inverseModel,\n      uniformState._cameraPosition,\n      cameraPositionMC\n    );\n    EncodedCartesian3.fromCartesian(\n      cameraPositionMC,\n      uniformState._encodedCameraPositionMC\n    );\n  }\n}\n\nconst view2Dto3DPScratch = new Cartesian3();\nconst view2Dto3DRScratch = new Cartesian3();\nconst view2Dto3DUScratch = new Cartesian3();\nconst view2Dto3DDScratch = new Cartesian3();\nconst view2Dto3DCartographicScratch = new Cartographic();\nconst view2Dto3DCartesian3Scratch = new Cartesian3();\nconst view2Dto3DMatrix4Scratch = new Matrix4();\n\nfunction view2Dto3D(\n  position2D,\n  direction2D,\n  right2D,\n  up2D,\n  frustum2DWidth,\n  mode,\n  projection,\n  result\n) {\n  // The camera position and directions are expressed in the 2D coordinate system where the Y axis is to the East,\n  // the Z axis is to the North, and the X axis is out of the map.  Express them instead in the ENU axes where\n  // X is to the East, Y is to the North, and Z is out of the local horizontal plane.\n  const p = view2Dto3DPScratch;\n  p.x = position2D.y;\n  p.y = position2D.z;\n  p.z = position2D.x;\n\n  const r = view2Dto3DRScratch;\n  r.x = right2D.y;\n  r.y = right2D.z;\n  r.z = right2D.x;\n\n  const u = view2Dto3DUScratch;\n  u.x = up2D.y;\n  u.y = up2D.z;\n  u.z = up2D.x;\n\n  const d = view2Dto3DDScratch;\n  d.x = direction2D.y;\n  d.y = direction2D.z;\n  d.z = direction2D.x;\n\n  // In 2D, the camera height is always 12.7 million meters.\n  // The apparent height is equal to half the frustum width.\n  if (mode === SceneMode.SCENE2D) {\n    p.z = frustum2DWidth * 0.5;\n  }\n\n  // Compute the equivalent camera position in the real (3D) world.\n  // In 2D and Columbus View, the camera can travel outside the projection, and when it does so\n  // there's not really any corresponding location in the real world.  So clamp the unprojected\n  // longitude and latitude to their valid ranges.\n  const cartographic = projection.unproject(p, view2Dto3DCartographicScratch);\n  cartographic.longitude = CesiumMath.clamp(\n    cartographic.longitude,\n    -Math.PI,\n    Math.PI\n  );\n  cartographic.latitude = CesiumMath.clamp(\n    cartographic.latitude,\n    -CesiumMath.PI_OVER_TWO,\n    CesiumMath.PI_OVER_TWO\n  );\n  const ellipsoid = projection.ellipsoid;\n  const position3D = ellipsoid.cartographicToCartesian(\n    cartographic,\n    view2Dto3DCartesian3Scratch\n  );\n\n  // Compute the rotation from the local ENU at the real world camera position to the fixed axes.\n  const enuToFixed = Transforms.eastNorthUpToFixedFrame(\n    position3D,\n    ellipsoid,\n    view2Dto3DMatrix4Scratch\n  );\n\n  // Transform each camera direction to the fixed axes.\n  Matrix4.multiplyByPointAsVector(enuToFixed, r, r);\n  Matrix4.multiplyByPointAsVector(enuToFixed, u, u);\n  Matrix4.multiplyByPointAsVector(enuToFixed, d, d);\n\n  // Compute the view matrix based on the new fixed-frame camera position and directions.\n  if (!defined(result)) {\n    result = new Matrix4();\n  }\n\n  result[0] = r.x;\n  result[1] = u.x;\n  result[2] = -d.x;\n  result[3] = 0.0;\n  result[4] = r.y;\n  result[5] = u.y;\n  result[6] = -d.y;\n  result[7] = 0.0;\n  result[8] = r.z;\n  result[9] = u.z;\n  result[10] = -d.z;\n  result[11] = 0.0;\n  result[12] = -Cartesian3.dot(r, position3D);\n  result[13] = -Cartesian3.dot(u, position3D);\n  result[14] = Cartesian3.dot(d, position3D);\n  result[15] = 1.0;\n\n  return result;\n}\n\nfunction updateView3D(that) {\n  if (that._view3DDirty) {\n    if (that._mode === SceneMode.SCENE3D) {\n      Matrix4.clone(that._view, that._view3D);\n    } else {\n      view2Dto3D(\n        that._cameraPosition,\n        that._cameraDirection,\n        that._cameraRight,\n        that._cameraUp,\n        that._frustum2DWidth,\n        that._mode,\n        that._mapProjection,\n        that._view3D\n      );\n    }\n    Matrix4.getMatrix3(that._view3D, that._viewRotation3D);\n    that._view3DDirty = false;\n  }\n}\n\nfunction updateInverseView3D(that) {\n  if (that._inverseView3DDirty) {\n    Matrix4.inverseTransformation(that.view3D, that._inverseView3D);\n    Matrix4.getMatrix3(that._inverseView3D, that._inverseViewRotation3D);\n    that._inverseView3DDirty = false;\n  }\n}\nexport default UniformState;\n", "import Check from \"../Core/Check.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Geometry from \"../Core/Geometry.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Buffer from \"./Buffer.js\";\nimport BufferUsage from \"./BufferUsage.js\";\nimport ContextLimits from \"./ContextLimits.js\";\n\nfunction addAttribute(attributes, attribute, index, context) {\n  const hasVertexBuffer = defined(attribute.vertexBuffer);\n  const hasValue = defined(attribute.value);\n  const componentsPerAttribute = attribute.value\n    ? attribute.value.length\n    : attribute.componentsPerAttribute;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!hasVertexBuffer && !hasValue) {\n    throw new DeveloperError(\"attribute must have a vertexBuffer or a value.\");\n  }\n  if (hasVertexBuffer && hasValue) {\n    throw new DeveloperError(\n      \"attribute cannot have both a vertexBuffer and a value.  It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.\"\n    );\n  }\n  if (\n    componentsPerAttribute !== 1 &&\n    componentsPerAttribute !== 2 &&\n    componentsPerAttribute !== 3 &&\n    componentsPerAttribute !== 4\n  ) {\n    if (hasValue) {\n      throw new DeveloperError(\n        \"attribute.value.length must be in the range [1, 4].\"\n      );\n    }\n\n    throw new DeveloperError(\n      \"attribute.componentsPerAttribute must be in the range [1, 4].\"\n    );\n  }\n  if (\n    defined(attribute.componentDatatype) &&\n    !ComponentDatatype.validate(attribute.componentDatatype)\n  ) {\n    throw new DeveloperError(\n      \"attribute must have a valid componentDatatype or not specify it.\"\n    );\n  }\n  if (defined(attribute.strideInBytes) && attribute.strideInBytes > 255) {\n    // WebGL limit.  Not in GL ES.\n    throw new DeveloperError(\n      \"attribute must have a strideInBytes less than or equal to 255 or not specify it.\"\n    );\n  }\n  if (\n    defined(attribute.instanceDivisor) &&\n    attribute.instanceDivisor > 0 &&\n    !context.instancedArrays\n  ) {\n    throw new DeveloperError(\"instanced arrays is not supported\");\n  }\n  if (defined(attribute.instanceDivisor) && attribute.instanceDivisor < 0) {\n    throw new DeveloperError(\n      \"attribute must have an instanceDivisor greater than or equal to zero\"\n    );\n  }\n  if (defined(attribute.instanceDivisor) && hasValue) {\n    throw new DeveloperError(\n      \"attribute cannot have have an instanceDivisor if it is not backed by a buffer\"\n    );\n  }\n  if (\n    defined(attribute.instanceDivisor) &&\n    attribute.instanceDivisor > 0 &&\n    attribute.index === 0\n  ) {\n    throw new DeveloperError(\n      \"attribute zero cannot have an instanceDivisor greater than 0\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  // Shallow copy the attribute; we do not want to copy the vertex buffer.\n  const attr = {\n    index: defaultValue(attribute.index, index),\n    enabled: defaultValue(attribute.enabled, true),\n    vertexBuffer: attribute.vertexBuffer,\n    value: hasValue ? attribute.value.slice(0) : undefined,\n    componentsPerAttribute: componentsPerAttribute,\n    componentDatatype: defaultValue(\n      attribute.componentDatatype,\n      ComponentDatatype.FLOAT\n    ),\n    normalize: defaultValue(attribute.normalize, false),\n    offsetInBytes: defaultValue(attribute.offsetInBytes, 0),\n    strideInBytes: defaultValue(attribute.strideInBytes, 0),\n    instanceDivisor: defaultValue(attribute.instanceDivisor, 0),\n  };\n\n  if (hasVertexBuffer) {\n    // Common case: vertex buffer for per-vertex data\n    attr.vertexAttrib = function (gl) {\n      const index = this.index;\n      gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer._getBuffer());\n      gl.vertexAttribPointer(\n        index,\n        this.componentsPerAttribute,\n        this.componentDatatype,\n        this.normalize,\n        this.strideInBytes,\n        this.offsetInBytes\n      );\n      gl.enableVertexAttribArray(index);\n      if (this.instanceDivisor > 0) {\n        context.glVertexAttribDivisor(index, this.instanceDivisor);\n        context._vertexAttribDivisors[index] = this.instanceDivisor;\n        context._previousDrawInstanced = true;\n      }\n    };\n\n    attr.disableVertexAttribArray = function (gl) {\n      gl.disableVertexAttribArray(this.index);\n      if (this.instanceDivisor > 0) {\n        context.glVertexAttribDivisor(index, 0);\n      }\n    };\n  } else {\n    // Less common case: value array for the same data for each vertex\n    switch (attr.componentsPerAttribute) {\n      case 1:\n        attr.vertexAttrib = function (gl) {\n          gl.vertexAttrib1fv(this.index, this.value);\n        };\n        break;\n      case 2:\n        attr.vertexAttrib = function (gl) {\n          gl.vertexAttrib2fv(this.index, this.value);\n        };\n        break;\n      case 3:\n        attr.vertexAttrib = function (gl) {\n          gl.vertexAttrib3fv(this.index, this.value);\n        };\n        break;\n      case 4:\n        attr.vertexAttrib = function (gl) {\n          gl.vertexAttrib4fv(this.index, this.value);\n        };\n        break;\n    }\n\n    attr.disableVertexAttribArray = function (gl) {};\n  }\n\n  attributes.push(attr);\n}\n\nfunction bind(gl, attributes, indexBuffer) {\n  for (let i = 0; i < attributes.length; ++i) {\n    const attribute = attributes[i];\n    if (attribute.enabled) {\n      attribute.vertexAttrib(gl);\n    }\n  }\n\n  if (defined(indexBuffer)) {\n    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer._getBuffer());\n  }\n}\n\n/**\n * Creates a vertex array, which defines the attributes making up a vertex, and contains an optional index buffer\n * to select vertices for rendering.  Attributes are defined using object literals as shown in Example 1 below.\n *\n * @param {object} options Object with the following properties:\n * @param {Context} options.context The context in which the VertexArray gets created.\n * @param {Object[]} options.attributes An array of attributes.\n * @param {IndexBuffer} [options.indexBuffer] An optional index buffer.\n *\n * @returns {VertexArray} The vertex array, ready for use with drawing.\n *\n * @exception {DeveloperError} Attribute must have a <code>vertexBuffer</code>.\n * @exception {DeveloperError} Attribute must have a <code>componentsPerAttribute</code>.\n * @exception {DeveloperError} Attribute must have a valid <code>componentDatatype</code> or not specify it.\n * @exception {DeveloperError} Attribute must have a <code>strideInBytes</code> less than or equal to 255 or not specify it.\n * @exception {DeveloperError} Index n is used by more than one attribute.\n *\n *\n * @example\n * // Example 1. Create a vertex array with vertices made up of three floating point\n * // values, e.g., a position, from a single vertex buffer.  No index buffer is used.\n * const positionBuffer = Buffer.createVertexBuffer({\n *     context : context,\n *     sizeInBytes : 12,\n *     usage : BufferUsage.STATIC_DRAW\n * });\n * const attributes = [\n *     {\n *         index                  : 0,\n *         enabled                : true,\n *         vertexBuffer           : positionBuffer,\n *         componentsPerAttribute : 3,\n *         componentDatatype      : ComponentDatatype.FLOAT,\n *         normalize              : false,\n *         offsetInBytes          : 0,\n *         strideInBytes          : 0 // tightly packed\n *         instanceDivisor        : 0 // not instanced\n *     }\n * ];\n * const va = new VertexArray({\n *     context : context,\n *     attributes : attributes\n * });\n *\n * @example\n * // Example 2. Create a vertex array with vertices from two different vertex buffers.\n * // Each vertex has a three-component position and three-component normal.\n * const positionBuffer = Buffer.createVertexBuffer({\n *     context : context,\n *     sizeInBytes : 12,\n *     usage : BufferUsage.STATIC_DRAW\n * });\n * const normalBuffer = Buffer.createVertexBuffer({\n *     context : context,\n *     sizeInBytes : 12,\n *     usage : BufferUsage.STATIC_DRAW\n * });\n * const attributes = [\n *     {\n *         index                  : 0,\n *         vertexBuffer           : positionBuffer,\n *         componentsPerAttribute : 3,\n *         componentDatatype      : ComponentDatatype.FLOAT\n *     },\n *     {\n *         index                  : 1,\n *         vertexBuffer           : normalBuffer,\n *         componentsPerAttribute : 3,\n *         componentDatatype      : ComponentDatatype.FLOAT\n *     }\n * ];\n * const va = new VertexArray({\n *     context : context,\n *     attributes : attributes\n * });\n *\n * @example\n * // Example 3. Creates the same vertex layout as Example 2 using a single\n * // vertex buffer, instead of two.\n * const buffer = Buffer.createVertexBuffer({\n *     context : context,\n *     sizeInBytes : 24,\n *     usage : BufferUsage.STATIC_DRAW\n * });\n * const attributes = [\n *     {\n *         vertexBuffer           : buffer,\n *         componentsPerAttribute : 3,\n *         componentDatatype      : ComponentDatatype.FLOAT,\n *         offsetInBytes          : 0,\n *         strideInBytes          : 24\n *     },\n *     {\n *         vertexBuffer           : buffer,\n *         componentsPerAttribute : 3,\n *         componentDatatype      : ComponentDatatype.FLOAT,\n *         normalize              : true,\n *         offsetInBytes          : 12,\n *         strideInBytes          : 24\n *     }\n * ];\n * const va = new VertexArray({\n *     context : context,\n *     attributes : attributes\n * });\n *\n * @see Buffer#createVertexBuffer\n * @see Buffer#createIndexBuffer\n * @see Context#draw\n *\n * @private\n */\nfunction VertexArray(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.context\", options.context);\n  Check.defined(\"options.attributes\", options.attributes);\n  //>>includeEnd('debug');\n\n  const context = options.context;\n  const gl = context._gl;\n  const attributes = options.attributes;\n  const indexBuffer = options.indexBuffer;\n\n  let i;\n  const vaAttributes = [];\n  let numberOfVertices = 1; // if every attribute is backed by a single value\n  let hasInstancedAttributes = false;\n  let hasConstantAttributes = false;\n\n  let length = attributes.length;\n  for (i = 0; i < length; ++i) {\n    addAttribute(vaAttributes, attributes[i], i, context);\n  }\n\n  length = vaAttributes.length;\n  for (i = 0; i < length; ++i) {\n    const attribute = vaAttributes[i];\n\n    if (defined(attribute.vertexBuffer) && attribute.instanceDivisor === 0) {\n      // This assumes that each vertex buffer in the vertex array has the same number of vertices.\n      const bytes =\n        attribute.strideInBytes ||\n        attribute.componentsPerAttribute *\n          ComponentDatatype.getSizeInBytes(attribute.componentDatatype);\n      numberOfVertices = attribute.vertexBuffer.sizeInBytes / bytes;\n      break;\n    }\n  }\n\n  for (i = 0; i < length; ++i) {\n    if (vaAttributes[i].instanceDivisor > 0) {\n      hasInstancedAttributes = true;\n    }\n    if (defined(vaAttributes[i].value)) {\n      hasConstantAttributes = true;\n    }\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  // Verify all attribute names are unique\n  const uniqueIndices = {};\n  for (i = 0; i < length; ++i) {\n    const index = vaAttributes[i].index;\n    if (uniqueIndices[index]) {\n      throw new DeveloperError(\n        `Index ${index} is used by more than one attribute.`\n      );\n    }\n    uniqueIndices[index] = true;\n  }\n  //>>includeEnd('debug');\n\n  let vao;\n\n  // Setup VAO if supported\n  if (context.vertexArrayObject) {\n    vao = context.glCreateVertexArray();\n    context.glBindVertexArray(vao);\n    bind(gl, vaAttributes, indexBuffer);\n    context.glBindVertexArray(null);\n  }\n\n  this._numberOfVertices = numberOfVertices;\n  this._hasInstancedAttributes = hasInstancedAttributes;\n  this._hasConstantAttributes = hasConstantAttributes;\n  this._context = context;\n  this._gl = gl;\n  this._vao = vao;\n  this._attributes = vaAttributes;\n  this._indexBuffer = indexBuffer;\n}\n\nfunction computeNumberOfVertices(attribute) {\n  return attribute.values.length / attribute.componentsPerAttribute;\n}\n\nfunction computeAttributeSizeInBytes(attribute) {\n  return (\n    ComponentDatatype.getSizeInBytes(attribute.componentDatatype) *\n    attribute.componentsPerAttribute\n  );\n}\n\nfunction interleaveAttributes(attributes) {\n  let j;\n  let name;\n  let attribute;\n\n  // Extract attribute names.\n  const names = [];\n  for (name in attributes) {\n    // Attribute needs to have per-vertex values; not a constant value for all vertices.\n    if (\n      attributes.hasOwnProperty(name) &&\n      defined(attributes[name]) &&\n      defined(attributes[name].values)\n    ) {\n      names.push(name);\n\n      if (attributes[name].componentDatatype === ComponentDatatype.DOUBLE) {\n        attributes[name].componentDatatype = ComponentDatatype.FLOAT;\n        attributes[name].values = ComponentDatatype.createTypedArray(\n          ComponentDatatype.FLOAT,\n          attributes[name].values\n        );\n      }\n    }\n  }\n\n  // Validation.  Compute number of vertices.\n  let numberOfVertices;\n  const namesLength = names.length;\n\n  if (namesLength > 0) {\n    numberOfVertices = computeNumberOfVertices(attributes[names[0]]);\n\n    for (j = 1; j < namesLength; ++j) {\n      const currentNumberOfVertices = computeNumberOfVertices(\n        attributes[names[j]]\n      );\n\n      if (currentNumberOfVertices !== numberOfVertices) {\n        throw new RuntimeError(\n          `${\n            \"Each attribute list must have the same number of vertices.  \" +\n            \"Attribute \"\n          }${names[j]} has a different number of vertices ` +\n            `(${currentNumberOfVertices.toString()})` +\n            ` than attribute ${names[0]} (${numberOfVertices.toString()}).`\n        );\n      }\n    }\n  }\n\n  // Sort attributes by the size of their components.  From left to right, a vertex stores floats, shorts, and then bytes.\n  names.sort(function (left, right) {\n    return (\n      ComponentDatatype.getSizeInBytes(attributes[right].componentDatatype) -\n      ComponentDatatype.getSizeInBytes(attributes[left].componentDatatype)\n    );\n  });\n\n  // Compute sizes and strides.\n  let vertexSizeInBytes = 0;\n  const offsetsInBytes = {};\n\n  for (j = 0; j < namesLength; ++j) {\n    name = names[j];\n    attribute = attributes[name];\n\n    offsetsInBytes[name] = vertexSizeInBytes;\n    vertexSizeInBytes += computeAttributeSizeInBytes(attribute);\n  }\n\n  if (vertexSizeInBytes > 0) {\n    // Pad each vertex to be a multiple of the largest component datatype so each\n    // attribute can be addressed using typed arrays.\n    const maxComponentSizeInBytes = ComponentDatatype.getSizeInBytes(\n      attributes[names[0]].componentDatatype\n    ); // Sorted large to small\n    const remainder = vertexSizeInBytes % maxComponentSizeInBytes;\n    if (remainder !== 0) {\n      vertexSizeInBytes += maxComponentSizeInBytes - remainder;\n    }\n\n    // Total vertex buffer size in bytes, including per-vertex padding.\n    const vertexBufferSizeInBytes = numberOfVertices * vertexSizeInBytes;\n\n    // Create array for interleaved vertices.  Each attribute has a different view (pointer) into the array.\n    const buffer = new ArrayBuffer(vertexBufferSizeInBytes);\n    const views = {};\n\n    for (j = 0; j < namesLength; ++j) {\n      name = names[j];\n      const sizeInBytes = ComponentDatatype.getSizeInBytes(\n        attributes[name].componentDatatype\n      );\n\n      views[name] = {\n        pointer: ComponentDatatype.createTypedArray(\n          attributes[name].componentDatatype,\n          buffer\n        ),\n        index: offsetsInBytes[name] / sizeInBytes, // Offset in ComponentType\n        strideInComponentType: vertexSizeInBytes / sizeInBytes,\n      };\n    }\n\n    // Copy attributes into one interleaved array.\n    // PERFORMANCE_IDEA:  Can we optimize these loops?\n    for (j = 0; j < numberOfVertices; ++j) {\n      for (let n = 0; n < namesLength; ++n) {\n        name = names[n];\n        attribute = attributes[name];\n        const values = attribute.values;\n        const view = views[name];\n        const pointer = view.pointer;\n\n        const numberOfComponents = attribute.componentsPerAttribute;\n        for (let k = 0; k < numberOfComponents; ++k) {\n          pointer[view.index + k] = values[j * numberOfComponents + k];\n        }\n\n        view.index += view.strideInComponentType;\n      }\n    }\n\n    return {\n      buffer: buffer,\n      offsetsInBytes: offsetsInBytes,\n      vertexSizeInBytes: vertexSizeInBytes,\n    };\n  }\n\n  // No attributes to interleave.\n  return undefined;\n}\n\n/**\n * Creates a vertex array from a geometry.  A geometry contains vertex attributes and optional index data\n * in system memory, whereas a vertex array contains vertex buffers and an optional index buffer in WebGL\n * memory for use with rendering.\n * <br /><br />\n * The <code>geometry</code> argument should use the standard layout like the geometry returned by {@link BoxGeometry}.\n * <br /><br />\n * <code>options</code> can have four properties:\n * <ul>\n *   <li><code>geometry</code>:  The source geometry containing data used to create the vertex array.</li>\n *   <li><code>attributeLocations</code>:  An object that maps geometry attribute names to vertex shader attribute locations.</li>\n *   <li><code>bufferUsage</code>:  The expected usage pattern of the vertex array's buffers.  On some WebGL implementations, this can significantly affect performance.  See {@link BufferUsage}.  Default: <code>BufferUsage.DYNAMIC_DRAW</code>.</li>\n *   <li><code>interleave</code>:  Determines if all attributes are interleaved in a single vertex buffer or if each attribute is stored in a separate vertex buffer.  Default: <code>false</code>.</li>\n * </ul>\n * <br />\n * If <code>options</code> is not specified or the <code>geometry</code> contains no data, the returned vertex array is empty.\n *\n * @param {object} options An object defining the geometry, attribute indices, buffer usage, and vertex layout used to create the vertex array.\n *\n * @exception {RuntimeError} Each attribute list must have the same number of vertices.\n * @exception {DeveloperError} The geometry must have zero or one index lists.\n * @exception {DeveloperError} Index n is used by more than one attribute.\n *\n *\n * @example\n * // Example 1. Creates a vertex array for rendering a box.  The default dynamic draw\n * // usage is used for the created vertex and index buffer.  The attributes are not\n * // interleaved by default.\n * const geometry = new BoxGeometry();\n * const va = VertexArray.fromGeometry({\n *     context            : context,\n *     geometry           : geometry,\n *     attributeLocations : GeometryPipeline.createAttributeLocations(geometry),\n * });\n *\n * @example\n * // Example 2. Creates a vertex array with interleaved attributes in a\n * // single vertex buffer.  The vertex and index buffer have static draw usage.\n * const va = VertexArray.fromGeometry({\n *     context            : context,\n *     geometry           : geometry,\n *     attributeLocations : GeometryPipeline.createAttributeLocations(geometry),\n *     bufferUsage        : BufferUsage.STATIC_DRAW,\n *     interleave         : true\n * });\n *\n * @example\n * // Example 3.  When the caller destroys the vertex array, it also destroys the\n * // attached vertex buffer(s) and index buffer.\n * va = va.destroy();\n *\n * @see Buffer#createVertexBuffer\n * @see Buffer#createIndexBuffer\n * @see GeometryPipeline.createAttributeLocations\n * @see ShaderProgram\n */\nVertexArray.fromGeometry = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.context\", options.context);\n  //>>includeEnd('debug');\n\n  const context = options.context;\n  const geometry = defaultValue(options.geometry, defaultValue.EMPTY_OBJECT);\n\n  const bufferUsage = defaultValue(\n    options.bufferUsage,\n    BufferUsage.DYNAMIC_DRAW\n  );\n\n  const attributeLocations = defaultValue(\n    options.attributeLocations,\n    defaultValue.EMPTY_OBJECT\n  );\n  const interleave = defaultValue(options.interleave, false);\n  const createdVAAttributes = options.vertexArrayAttributes;\n\n  let name;\n  let attribute;\n  let vertexBuffer;\n  const vaAttributes = defined(createdVAAttributes) ? createdVAAttributes : [];\n  const attributes = geometry.attributes;\n\n  if (interleave) {\n    // Use a single vertex buffer with interleaved vertices.\n    const interleavedAttributes = interleaveAttributes(attributes);\n    if (defined(interleavedAttributes)) {\n      vertexBuffer = Buffer.createVertexBuffer({\n        context: context,\n        typedArray: interleavedAttributes.buffer,\n        usage: bufferUsage,\n      });\n      const offsetsInBytes = interleavedAttributes.offsetsInBytes;\n      const strideInBytes = interleavedAttributes.vertexSizeInBytes;\n\n      for (name in attributes) {\n        if (attributes.hasOwnProperty(name) && defined(attributes[name])) {\n          attribute = attributes[name];\n\n          if (defined(attribute.values)) {\n            // Common case: per-vertex attributes\n            vaAttributes.push({\n              index: attributeLocations[name],\n              vertexBuffer: vertexBuffer,\n              componentDatatype: attribute.componentDatatype,\n              componentsPerAttribute: attribute.componentsPerAttribute,\n              normalize: attribute.normalize,\n              offsetInBytes: offsetsInBytes[name],\n              strideInBytes: strideInBytes,\n            });\n          } else {\n            // Constant attribute for all vertices\n            vaAttributes.push({\n              index: attributeLocations[name],\n              value: attribute.value,\n              componentDatatype: attribute.componentDatatype,\n              normalize: attribute.normalize,\n            });\n          }\n        }\n      }\n    }\n  } else {\n    // One vertex buffer per attribute.\n    for (name in attributes) {\n      if (attributes.hasOwnProperty(name) && defined(attributes[name])) {\n        attribute = attributes[name];\n\n        let componentDatatype = attribute.componentDatatype;\n        if (componentDatatype === ComponentDatatype.DOUBLE) {\n          componentDatatype = ComponentDatatype.FLOAT;\n        }\n\n        vertexBuffer = undefined;\n        if (defined(attribute.values)) {\n          vertexBuffer = Buffer.createVertexBuffer({\n            context: context,\n            typedArray: ComponentDatatype.createTypedArray(\n              componentDatatype,\n              attribute.values\n            ),\n            usage: bufferUsage,\n          });\n        }\n\n        vaAttributes.push({\n          index: attributeLocations[name],\n          vertexBuffer: vertexBuffer,\n          value: attribute.value,\n          componentDatatype: componentDatatype,\n          componentsPerAttribute: attribute.componentsPerAttribute,\n          normalize: attribute.normalize,\n        });\n      }\n    }\n  }\n\n  let indexBuffer;\n  const indices = geometry.indices;\n  if (defined(indices)) {\n    if (\n      Geometry.computeNumberOfVertices(geometry) >=\n        CesiumMath.SIXTY_FOUR_KILOBYTES &&\n      context.elementIndexUint\n    ) {\n      indexBuffer = Buffer.createIndexBuffer({\n        context: context,\n        typedArray: new Uint32Array(indices),\n        usage: bufferUsage,\n        indexDatatype: IndexDatatype.UNSIGNED_INT,\n      });\n    } else {\n      indexBuffer = Buffer.createIndexBuffer({\n        context: context,\n        typedArray: new Uint16Array(indices),\n        usage: bufferUsage,\n        indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n      });\n    }\n  }\n\n  return new VertexArray({\n    context: context,\n    attributes: vaAttributes,\n    indexBuffer: indexBuffer,\n  });\n};\n\nObject.defineProperties(VertexArray.prototype, {\n  numberOfAttributes: {\n    get: function () {\n      return this._attributes.length;\n    },\n  },\n  numberOfVertices: {\n    get: function () {\n      return this._numberOfVertices;\n    },\n  },\n  indexBuffer: {\n    get: function () {\n      return this._indexBuffer;\n    },\n  },\n});\n\n/**\n * index is the location in the array of attributes, not the index property of an attribute.\n */\nVertexArray.prototype.getAttribute = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"index\", index);\n  //>>includeEnd('debug');\n\n  return this._attributes[index];\n};\n\n// Workaround for ANGLE, where the attribute divisor seems to be part of the global state instead\n// of the VAO state. This function is called when the vao is bound, and should be removed\n// once the ANGLE issue is resolved. Setting the divisor should normally happen in vertexAttrib and\n// disableVertexAttribArray.\nfunction setVertexAttribDivisor(vertexArray) {\n  const context = vertexArray._context;\n  const hasInstancedAttributes = vertexArray._hasInstancedAttributes;\n  if (!hasInstancedAttributes && !context._previousDrawInstanced) {\n    return;\n  }\n  context._previousDrawInstanced = hasInstancedAttributes;\n\n  const divisors = context._vertexAttribDivisors;\n  const attributes = vertexArray._attributes;\n  const maxAttributes = ContextLimits.maximumVertexAttributes;\n  let i;\n\n  if (hasInstancedAttributes) {\n    const length = attributes.length;\n    for (i = 0; i < length; ++i) {\n      const attribute = attributes[i];\n      if (attribute.enabled) {\n        const divisor = attribute.instanceDivisor;\n        const index = attribute.index;\n        if (divisor !== divisors[index]) {\n          context.glVertexAttribDivisor(index, divisor);\n          divisors[index] = divisor;\n        }\n      }\n    }\n  } else {\n    for (i = 0; i < maxAttributes; ++i) {\n      if (divisors[i] > 0) {\n        context.glVertexAttribDivisor(i, 0);\n        divisors[i] = 0;\n      }\n    }\n  }\n}\n\n// Vertex attributes backed by a constant value go through vertexAttrib[1234]f[v]\n// which is part of context state rather than VAO state.\nfunction setConstantAttributes(vertexArray, gl) {\n  const attributes = vertexArray._attributes;\n  const length = attributes.length;\n  for (let i = 0; i < length; ++i) {\n    const attribute = attributes[i];\n    if (attribute.enabled && defined(attribute.value)) {\n      attribute.vertexAttrib(gl);\n    }\n  }\n}\n\nVertexArray.prototype._bind = function () {\n  if (defined(this._vao)) {\n    this._context.glBindVertexArray(this._vao);\n    if (this._context.instancedArrays) {\n      setVertexAttribDivisor(this);\n    }\n    if (this._hasConstantAttributes) {\n      setConstantAttributes(this, this._gl);\n    }\n  } else {\n    bind(this._gl, this._attributes, this._indexBuffer);\n  }\n};\n\nVertexArray.prototype._unBind = function () {\n  if (defined(this._vao)) {\n    this._context.glBindVertexArray(null);\n  } else {\n    const attributes = this._attributes;\n    const gl = this._gl;\n\n    for (let i = 0; i < attributes.length; ++i) {\n      const attribute = attributes[i];\n      if (attribute.enabled) {\n        attribute.disableVertexAttribArray(gl);\n      }\n    }\n    if (this._indexBuffer) {\n      gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n    }\n  }\n};\n\nVertexArray.prototype.isDestroyed = function () {\n  return false;\n};\n\nVertexArray.prototype.destroy = function () {\n  const attributes = this._attributes;\n  for (let i = 0; i < attributes.length; ++i) {\n    const vertexBuffer = attributes[i].vertexBuffer;\n    if (\n      defined(vertexBuffer) &&\n      !vertexBuffer.isDestroyed() &&\n      vertexBuffer.vertexArrayDestroyable\n    ) {\n      vertexBuffer.destroy();\n    }\n  }\n\n  const indexBuffer = this._indexBuffer;\n  if (\n    defined(indexBuffer) &&\n    !indexBuffer.isDestroyed() &&\n    indexBuffer.vertexArrayDestroyable\n  ) {\n    indexBuffer.destroy();\n  }\n\n  if (defined(this._vao)) {\n    this._context.glDeleteVertexArray(this._vao);\n  }\n\n  return destroyObject(this);\n};\nexport default VertexArray;\n", "import Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Geometry from \"../Core/Geometry.js\";\nimport GeometryAttribute from \"../Core/GeometryAttribute.js\";\nimport loadKTX2 from \"../Core/loadKTX2.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\nimport ViewportQuadVS from \"../Shaders/ViewportQuadVS.js\";\nimport BufferUsage from \"./BufferUsage.js\";\nimport ClearCommand from \"./ClearCommand.js\";\nimport ContextLimits from \"./ContextLimits.js\";\nimport CubeMap from \"./CubeMap.js\";\nimport DrawCommand from \"./DrawCommand.js\";\nimport PassState from \"./PassState.js\";\nimport PixelDatatype from \"./PixelDatatype.js\";\nimport RenderState from \"./RenderState.js\";\nimport ShaderCache from \"./ShaderCache.js\";\nimport ShaderProgram from \"./ShaderProgram.js\";\nimport Texture from \"./Texture.js\";\nimport TextureCache from \"./TextureCache.js\";\nimport UniformState from \"./UniformState.js\";\nimport VertexArray from \"./VertexArray.js\";\n\n/**\n * @private\n * @constructor\n *\n * @param {HTMLCanvasElement} canvas The canvas element to which the context will be associated\n * @param {ContextOptions} [options] Options to control WebGL settings for the context\n */\nfunction Context(canvas, options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"canvas\", canvas);\n  //>>includeEnd('debug');\n\n  const {\n    getWebGLStub,\n    requestWebgl1,\n    webgl: webglOptions = {},\n    allowTextureFilterAnisotropic = true,\n  } = defaultValue(options, {});\n\n  // Override select WebGL defaults\n  webglOptions.alpha = defaultValue(webglOptions.alpha, false); // WebGL default is true\n  webglOptions.stencil = defaultValue(webglOptions.stencil, true); // WebGL default is false\n  webglOptions.powerPreference = defaultValue(\n    webglOptions.powerPreference,\n    \"high-performance\"\n  ); // WebGL default is \"default\"\n\n  const glContext = defined(getWebGLStub)\n    ? getWebGLStub(canvas, webglOptions)\n    : getWebGLContext(canvas, webglOptions, requestWebgl1);\n\n  // Get context type. instanceof will throw if WebGL2 is not supported\n  const webgl2Supported = typeof WebGL2RenderingContext !== \"undefined\";\n  const webgl2 = webgl2Supported && glContext instanceof WebGL2RenderingContext;\n\n  this._canvas = canvas;\n  this._originalGLContext = glContext;\n  this._gl = glContext;\n  this._webgl2 = webgl2;\n  this._id = createGuid();\n\n  // Validation and logging disabled by default for speed.\n  this.validateFramebuffer = false;\n  this.validateShaderProgram = false;\n  this.logShaderCompilation = false;\n\n  this._throwOnWebGLError = false;\n\n  this._shaderCache = new ShaderCache(this);\n  this._textureCache = new TextureCache();\n\n  const gl = glContext;\n\n  this._stencilBits = gl.getParameter(gl.STENCIL_BITS);\n\n  ContextLimits._maximumCombinedTextureImageUnits = gl.getParameter(\n    gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS\n  ); // min: 8\n  ContextLimits._maximumCubeMapSize = gl.getParameter(\n    gl.MAX_CUBE_MAP_TEXTURE_SIZE\n  ); // min: 16\n  ContextLimits._maximumFragmentUniformVectors = gl.getParameter(\n    gl.MAX_FRAGMENT_UNIFORM_VECTORS\n  ); // min: 16\n  ContextLimits._maximumTextureImageUnits = gl.getParameter(\n    gl.MAX_TEXTURE_IMAGE_UNITS\n  ); // min: 8\n  ContextLimits._maximumRenderbufferSize = gl.getParameter(\n    gl.MAX_RENDERBUFFER_SIZE\n  ); // min: 1\n  ContextLimits._maximumTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE); // min: 64\n  ContextLimits._maximumVaryingVectors = gl.getParameter(\n    gl.MAX_VARYING_VECTORS\n  ); // min: 8\n  ContextLimits._maximumVertexAttributes = gl.getParameter(\n    gl.MAX_VERTEX_ATTRIBS\n  ); // min: 8\n  ContextLimits._maximumVertexTextureImageUnits = gl.getParameter(\n    gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS\n  ); // min: 0\n  ContextLimits._maximumVertexUniformVectors = gl.getParameter(\n    gl.MAX_VERTEX_UNIFORM_VECTORS\n  ); // min: 128\n\n  ContextLimits._maximumSamples = this._webgl2\n    ? gl.getParameter(gl.MAX_SAMPLES)\n    : 0;\n\n  const aliasedLineWidthRange = gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE); // must include 1\n  ContextLimits._minimumAliasedLineWidth = aliasedLineWidthRange[0];\n  ContextLimits._maximumAliasedLineWidth = aliasedLineWidthRange[1];\n\n  const aliasedPointSizeRange = gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE); // must include 1\n  ContextLimits._minimumAliasedPointSize = aliasedPointSizeRange[0];\n  ContextLimits._maximumAliasedPointSize = aliasedPointSizeRange[1];\n\n  const maximumViewportDimensions = gl.getParameter(gl.MAX_VIEWPORT_DIMS);\n  ContextLimits._maximumViewportWidth = maximumViewportDimensions[0];\n  ContextLimits._maximumViewportHeight = maximumViewportDimensions[1];\n\n  const highpFloat = gl.getShaderPrecisionFormat(\n    gl.FRAGMENT_SHADER,\n    gl.HIGH_FLOAT\n  );\n  ContextLimits._highpFloatSupported = highpFloat.precision !== 0;\n  const highpInt = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT);\n  ContextLimits._highpIntSupported = highpInt.rangeMax !== 0;\n\n  this._antialias = gl.getContextAttributes().antialias;\n\n  // Query and initialize extensions\n  this._standardDerivatives = !!getExtension(gl, [\"OES_standard_derivatives\"]);\n  this._blendMinmax = !!getExtension(gl, [\"EXT_blend_minmax\"]);\n  this._elementIndexUint = !!getExtension(gl, [\"OES_element_index_uint\"]);\n  this._depthTexture = !!getExtension(gl, [\n    \"WEBGL_depth_texture\",\n    \"WEBKIT_WEBGL_depth_texture\",\n  ]);\n  this._fragDepth = !!getExtension(gl, [\"EXT_frag_depth\"]);\n  this._debugShaders = getExtension(gl, [\"WEBGL_debug_shaders\"]);\n\n  this._textureFloat = !!getExtension(gl, [\"OES_texture_float\"]);\n  this._textureHalfFloat = !!getExtension(gl, [\"OES_texture_half_float\"]);\n\n  this._textureFloatLinear = !!getExtension(gl, [\"OES_texture_float_linear\"]);\n  this._textureHalfFloatLinear = !!getExtension(gl, [\n    \"OES_texture_half_float_linear\",\n  ]);\n\n  this._colorBufferFloat = !!getExtension(gl, [\n    \"EXT_color_buffer_float\",\n    \"WEBGL_color_buffer_float\",\n  ]);\n  this._floatBlend = !!getExtension(gl, [\"EXT_float_blend\"]);\n  this._colorBufferHalfFloat = !!getExtension(gl, [\n    \"EXT_color_buffer_half_float\",\n  ]);\n\n  this._s3tc = !!getExtension(gl, [\n    \"WEBGL_compressed_texture_s3tc\",\n    \"MOZ_WEBGL_compressed_texture_s3tc\",\n    \"WEBKIT_WEBGL_compressed_texture_s3tc\",\n  ]);\n  this._pvrtc = !!getExtension(gl, [\n    \"WEBGL_compressed_texture_pvrtc\",\n    \"WEBKIT_WEBGL_compressed_texture_pvrtc\",\n  ]);\n  this._astc = !!getExtension(gl, [\"WEBGL_compressed_texture_astc\"]);\n  this._etc = !!getExtension(gl, [\"WEBG_compressed_texture_etc\"]);\n  this._etc1 = !!getExtension(gl, [\"WEBGL_compressed_texture_etc1\"]);\n  this._bc7 = !!getExtension(gl, [\"EXT_texture_compression_bptc\"]);\n\n  // It is necessary to pass supported formats to loadKTX2\n  // because imagery layers don't have access to the context.\n  loadKTX2.setKTX2SupportedFormats(\n    this._s3tc,\n    this._pvrtc,\n    this._astc,\n    this._etc,\n    this._etc1,\n    this._bc7\n  );\n\n  const textureFilterAnisotropic = allowTextureFilterAnisotropic\n    ? getExtension(gl, [\n        \"EXT_texture_filter_anisotropic\",\n        \"WEBKIT_EXT_texture_filter_anisotropic\",\n      ])\n    : undefined;\n  this._textureFilterAnisotropic = textureFilterAnisotropic;\n  ContextLimits._maximumTextureFilterAnisotropy = defined(\n    textureFilterAnisotropic\n  )\n    ? gl.getParameter(textureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)\n    : 1.0;\n\n  let glCreateVertexArray;\n  let glBindVertexArray;\n  let glDeleteVertexArray;\n\n  let glDrawElementsInstanced;\n  let glDrawArraysInstanced;\n  let glVertexAttribDivisor;\n\n  let glDrawBuffers;\n\n  let vertexArrayObject;\n  let instancedArrays;\n  let drawBuffers;\n\n  if (webgl2) {\n    const that = this;\n\n    glCreateVertexArray = function () {\n      return that._gl.createVertexArray();\n    };\n    glBindVertexArray = function (vao) {\n      that._gl.bindVertexArray(vao);\n    };\n    glDeleteVertexArray = function (vao) {\n      that._gl.deleteVertexArray(vao);\n    };\n\n    glDrawElementsInstanced = function (\n      mode,\n      count,\n      type,\n      offset,\n      instanceCount\n    ) {\n      gl.drawElementsInstanced(mode, count, type, offset, instanceCount);\n    };\n    glDrawArraysInstanced = function (mode, first, count, instanceCount) {\n      gl.drawArraysInstanced(mode, first, count, instanceCount);\n    };\n    glVertexAttribDivisor = function (index, divisor) {\n      gl.vertexAttribDivisor(index, divisor);\n    };\n\n    glDrawBuffers = function (buffers) {\n      gl.drawBuffers(buffers);\n    };\n  } else {\n    vertexArrayObject = getExtension(gl, [\"OES_vertex_array_object\"]);\n    if (defined(vertexArrayObject)) {\n      glCreateVertexArray = function () {\n        return vertexArrayObject.createVertexArrayOES();\n      };\n      glBindVertexArray = function (vertexArray) {\n        vertexArrayObject.bindVertexArrayOES(vertexArray);\n      };\n      glDeleteVertexArray = function (vertexArray) {\n        vertexArrayObject.deleteVertexArrayOES(vertexArray);\n      };\n    }\n\n    instancedArrays = getExtension(gl, [\"ANGLE_instanced_arrays\"]);\n    if (defined(instancedArrays)) {\n      glDrawElementsInstanced = function (\n        mode,\n        count,\n        type,\n        offset,\n        instanceCount\n      ) {\n        instancedArrays.drawElementsInstancedANGLE(\n          mode,\n          count,\n          type,\n          offset,\n          instanceCount\n        );\n      };\n      glDrawArraysInstanced = function (mode, first, count, instanceCount) {\n        instancedArrays.drawArraysInstancedANGLE(\n          mode,\n          first,\n          count,\n          instanceCount\n        );\n      };\n      glVertexAttribDivisor = function (index, divisor) {\n        instancedArrays.vertexAttribDivisorANGLE(index, divisor);\n      };\n    }\n\n    drawBuffers = getExtension(gl, [\"WEBGL_draw_buffers\"]);\n    if (defined(drawBuffers)) {\n      glDrawBuffers = function (buffers) {\n        drawBuffers.drawBuffersWEBGL(buffers);\n      };\n    }\n  }\n\n  this.glCreateVertexArray = glCreateVertexArray;\n  this.glBindVertexArray = glBindVertexArray;\n  this.glDeleteVertexArray = glDeleteVertexArray;\n\n  this.glDrawElementsInstanced = glDrawElementsInstanced;\n  this.glDrawArraysInstanced = glDrawArraysInstanced;\n  this.glVertexAttribDivisor = glVertexAttribDivisor;\n\n  this.glDrawBuffers = glDrawBuffers;\n\n  this._vertexArrayObject = !!vertexArrayObject;\n  this._instancedArrays = !!instancedArrays;\n  this._drawBuffers = !!drawBuffers;\n\n  ContextLimits._maximumDrawBuffers = this.drawBuffers\n    ? gl.getParameter(WebGLConstants.MAX_DRAW_BUFFERS)\n    : 1;\n  ContextLimits._maximumColorAttachments = this.drawBuffers\n    ? gl.getParameter(WebGLConstants.MAX_COLOR_ATTACHMENTS)\n    : 1;\n\n  this._clearColor = new Color(0.0, 0.0, 0.0, 0.0);\n  this._clearDepth = 1.0;\n  this._clearStencil = 0;\n\n  const us = new UniformState();\n  const ps = new PassState(this);\n  const rs = RenderState.fromCache();\n\n  this._defaultPassState = ps;\n  this._defaultRenderState = rs;\n  // default texture has a value of (1, 1, 1)\n  // default emissive texture has a value of (0, 0, 0)\n  // default normal texture is +z which is encoded as (0.5, 0.5, 1)\n  this._defaultTexture = undefined;\n  this._defaultEmissiveTexture = undefined;\n  this._defaultNormalTexture = undefined;\n  this._defaultCubeMap = undefined;\n\n  this._us = us;\n  this._currentRenderState = rs;\n  this._currentPassState = ps;\n  this._currentFramebuffer = undefined;\n  this._maxFrameTextureUnitIndex = 0;\n\n  // Vertex attribute divisor state cache. Workaround for ANGLE (also look at VertexArray.setVertexAttribDivisor)\n  this._vertexAttribDivisors = [];\n  this._previousDrawInstanced = false;\n  for (let i = 0; i < ContextLimits._maximumVertexAttributes; i++) {\n    this._vertexAttribDivisors.push(0);\n  }\n\n  this._pickObjects = {};\n  this._nextPickColor = new Uint32Array(1);\n\n  /**\n   * The options used to construct this context\n   *\n   * @type {ContextOptions}\n   */\n  this.options = {\n    getWebGLStub: getWebGLStub,\n    requestWebgl1: requestWebgl1,\n    webgl: webglOptions,\n    allowTextureFilterAnisotropic: allowTextureFilterAnisotropic,\n  };\n\n  /**\n   * A cache of objects tied to this context.  Just before the Context is destroyed,\n   * <code>destroy</code> will be invoked on each object in this object literal that has\n   * such a method.  This is useful for caching any objects that might otherwise\n   * be stored globally, except they're tied to a particular context, and to manage\n   * their lifetime.\n   *\n   * @type {object}\n   */\n  this.cache = {};\n\n  RenderState.apply(gl, rs, ps);\n}\n\n/**\n * @typedef {object} ContextOptions\n *\n * Options to control the setting up of a WebGL Context.\n * <p>\n * <code>allowTextureFilterAnisotropic</code> defaults to true, which enables\n * anisotropic texture filtering when the WebGL extension is supported.\n * Setting this to false will improve performance, but hurt visual quality,\n * especially for horizon views.\n * </p>\n *\n * @property {boolean} [requestWebgl1=false] If true and the browser supports it, use a WebGL 1 rendering context\n * @property {boolean} [allowTextureFilterAnisotropic=true] If true, use anisotropic filtering during texture sampling\n * @property {WebGLOptions} [webgl] WebGL options to be passed on to canvas.getContext\n * @property {Function} [getWebGLStub] A function to create a WebGL stub for testing\n */\n\n/**\n * @private\n * @param {HTMLCanvasElement} canvas The canvas element to which the context will be associated\n * @param {WebGLOptions} webglOptions WebGL options to be passed on to HTMLCanvasElement.getContext()\n * @param {boolean} requestWebgl1 Whether to request a WebGLRenderingContext or a WebGL2RenderingContext.\n * @returns {WebGLRenderingContext|WebGL2RenderingContext}\n */\nfunction getWebGLContext(canvas, webglOptions, requestWebgl1) {\n  if (typeof WebGLRenderingContext === \"undefined\") {\n    throw new RuntimeError(\n      \"The browser does not support WebGL.  Visit http://get.webgl.org.\"\n    );\n  }\n\n  // Ensure that WebGL 2 is supported when it is requested. Otherwise, fall back to WebGL 1.\n  const webgl2Supported = typeof WebGL2RenderingContext !== \"undefined\";\n  if (!requestWebgl1 && !webgl2Supported) {\n    requestWebgl1 = true;\n  }\n\n  const contextType = requestWebgl1 ? \"webgl\" : \"webgl2\";\n  const glContext = canvas.getContext(contextType, webglOptions);\n\n  if (!defined(glContext)) {\n    throw new RuntimeError(\n      \"The browser supports WebGL, but initialization failed.\"\n    );\n  }\n\n  return glContext;\n}\n\n/**\n * @typedef {object} WebGLOptions\n *\n * WebGL options to be passed on to HTMLCanvasElement.getContext().\n * See {@link https://registry.khronos.org/webgl/specs/latest/1.0/#5.2|WebGLContextAttributes}\n * but note the modified defaults for 'alpha', 'stencil', and 'powerPreference'\n *\n * <p>\n * <code>alpha</code> defaults to false, which can improve performance\n * compared to the standard WebGL default of true.  If an application needs\n * to composite Cesium above other HTML elements using alpha-blending, set\n * <code>alpha</code> to true.\n * </p>\n *\n * @property {boolean} [alpha=false]\n * @property {boolean} [depth=true]\n * @property {boolean} [stencil=false]\n * @property {boolean} [antialias=true]\n * @property {boolean} [premultipliedAlpha=true]\n * @property {boolean} [preserveDrawingBuffer=false]\n * @property {(\"default\"|\"low-power\"|\"high-performance\")} [powerPreference=\"high-performance\"]\n * @property {boolean} [failIfMajorPerformanceCaveat=false]\n */\n\nfunction errorToString(gl, error) {\n  let message = \"WebGL Error:  \";\n  switch (error) {\n    case gl.INVALID_ENUM:\n      message += \"INVALID_ENUM\";\n      break;\n    case gl.INVALID_VALUE:\n      message += \"INVALID_VALUE\";\n      break;\n    case gl.INVALID_OPERATION:\n      message += \"INVALID_OPERATION\";\n      break;\n    case gl.OUT_OF_MEMORY:\n      message += \"OUT_OF_MEMORY\";\n      break;\n    case gl.CONTEXT_LOST_WEBGL:\n      message += \"CONTEXT_LOST_WEBGL lost\";\n      break;\n    default:\n      message += `Unknown (${error})`;\n  }\n\n  return message;\n}\n\nfunction createErrorMessage(gl, glFunc, glFuncArguments, error) {\n  let message = `${errorToString(gl, error)}: ${glFunc.name}(`;\n\n  for (let i = 0; i < glFuncArguments.length; ++i) {\n    if (i !== 0) {\n      message += \", \";\n    }\n    message += glFuncArguments[i];\n  }\n  message += \");\";\n\n  return message;\n}\n\nfunction throwOnError(gl, glFunc, glFuncArguments) {\n  const error = gl.getError();\n  if (error !== gl.NO_ERROR) {\n    throw new RuntimeError(\n      createErrorMessage(gl, glFunc, glFuncArguments, error)\n    );\n  }\n}\n\nfunction makeGetterSetter(gl, propertyName, logFunction) {\n  return {\n    get: function () {\n      const value = gl[propertyName];\n      logFunction(gl, `get: ${propertyName}`, value);\n      return gl[propertyName];\n    },\n    set: function (value) {\n      gl[propertyName] = value;\n      logFunction(gl, `set: ${propertyName}`, value);\n    },\n  };\n}\n\nfunction wrapGL(gl, logFunction) {\n  if (!defined(logFunction)) {\n    return gl;\n  }\n\n  function wrapFunction(property) {\n    return function () {\n      const result = property.apply(gl, arguments);\n      logFunction(gl, property, arguments);\n      return result;\n    };\n  }\n\n  const glWrapper = {};\n\n  // JavaScript linters normally demand that a for..in loop must directly contain an if,\n  // but in our loop below, we actually intend to iterate all properties, including\n  // those in the prototype.\n  /*eslint-disable guard-for-in*/\n  for (const propertyName in gl) {\n    const property = gl[propertyName];\n\n    // wrap any functions we encounter, otherwise just copy the property to the wrapper.\n    if (property instanceof Function) {\n      glWrapper[propertyName] = wrapFunction(property);\n    } else {\n      Object.defineProperty(\n        glWrapper,\n        propertyName,\n        makeGetterSetter(gl, propertyName, logFunction)\n      );\n    }\n  }\n  /*eslint-enable guard-for-in*/\n\n  return glWrapper;\n}\n\nfunction getExtension(gl, names) {\n  const length = names.length;\n  for (let i = 0; i < length; ++i) {\n    const extension = gl.getExtension(names[i]);\n    if (extension) {\n      return extension;\n    }\n  }\n\n  return undefined;\n}\n\nconst defaultFramebufferMarker = {};\n\nObject.defineProperties(Context.prototype, {\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n  webgl2: {\n    get: function () {\n      return this._webgl2;\n    },\n  },\n  canvas: {\n    get: function () {\n      return this._canvas;\n    },\n  },\n  shaderCache: {\n    get: function () {\n      return this._shaderCache;\n    },\n  },\n  textureCache: {\n    get: function () {\n      return this._textureCache;\n    },\n  },\n  uniformState: {\n    get: function () {\n      return this._us;\n    },\n  },\n\n  /**\n   * The number of stencil bits per pixel in the default bound framebuffer.  The minimum is eight bits.\n   * @memberof Context.prototype\n   * @type {number}\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>STENCIL_BITS</code>.\n   */\n  stencilBits: {\n    get: function () {\n      return this._stencilBits;\n    },\n  },\n\n  /**\n   * <code>true</code> if the WebGL context supports stencil buffers.\n   * Stencil buffers are not supported by all systems.\n   * @memberof Context.prototype\n   * @type {boolean}\n   */\n  stencilBuffer: {\n    get: function () {\n      return this._stencilBits >= 8;\n    },\n  },\n\n  /**\n   * <code>true</code> if the WebGL context supports antialiasing.  By default\n   * antialiasing is requested, but it is not supported by all systems.\n   * @memberof Context.prototype\n   * @type {boolean}\n   */\n  antialias: {\n    get: function () {\n      return this._antialias;\n    },\n  },\n\n  /**\n   * <code>true</code> if the WebGL context supports multisample antialiasing. Requires\n   * WebGL2.\n   * @memberof Context.prototype\n   * @type {boolean}\n   */\n  msaa: {\n    get: function () {\n      return this._webgl2;\n    },\n  },\n\n  /**\n   * <code>true</code> if the OES_standard_derivatives extension is supported.  This\n   * extension provides access to <code>dFdx</code>, <code>dFdy</code>, and <code>fwidth</code>\n   * functions from GLSL.  A shader using these functions still needs to explicitly enable the\n   * extension with <code>#extension GL_OES_standard_derivatives : enable</code>.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link http://www.khronos.org/registry/gles/extensions/OES/OES_standard_derivatives.txt|OES_standard_derivatives}\n   */\n  standardDerivatives: {\n    get: function () {\n      return this._standardDerivatives || this._webgl2;\n    },\n  },\n\n  /**\n   * <code>true</code> if the EXT_float_blend extension is supported. This\n   * extension enables blending with 32-bit float values.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/EXT_float_blend/}\n   */\n  floatBlend: {\n    get: function () {\n      return this._floatBlend;\n    },\n  },\n\n  /**\n   * <code>true</code> if the EXT_blend_minmax extension is supported.  This\n   * extension extends blending capabilities by adding two new blend equations:\n   * the minimum or maximum color components of the source and destination colors.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/EXT_blend_minmax/}\n   */\n  blendMinmax: {\n    get: function () {\n      return this._blendMinmax || this._webgl2;\n    },\n  },\n\n  /**\n   * <code>true</code> if the OES_element_index_uint extension is supported.  This\n   * extension allows the use of unsigned int indices, which can improve performance by\n   * eliminating batch breaking caused by unsigned short indices.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link http://www.khronos.org/registry/webgl/extensions/OES_element_index_uint/|OES_element_index_uint}\n   */\n  elementIndexUint: {\n    get: function () {\n      return this._elementIndexUint || this._webgl2;\n    },\n  },\n\n  /**\n   * <code>true</code> if WEBGL_depth_texture is supported.  This extension provides\n   * access to depth textures that, for example, can be attached to framebuffers for shadow mapping.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/|WEBGL_depth_texture}\n   */\n  depthTexture: {\n    get: function () {\n      return this._depthTexture || this._webgl2;\n    },\n  },\n\n  /**\n   * <code>true</code> if OES_texture_float is supported. This extension provides\n   * access to floating point textures that, for example, can be attached to framebuffers for high dynamic range.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/OES_texture_float/}\n   */\n  floatingPointTexture: {\n    get: function () {\n      return this._webgl2 || this._textureFloat;\n    },\n  },\n\n  /**\n   * <code>true</code> if OES_texture_half_float is supported. This extension provides\n   * access to floating point textures that, for example, can be attached to framebuffers for high dynamic range.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float/}\n   */\n  halfFloatingPointTexture: {\n    get: function () {\n      return this._webgl2 || this._textureHalfFloat;\n    },\n  },\n\n  /**\n   * <code>true</code> if OES_texture_float_linear is supported. This extension provides\n   * access to linear sampling methods for minification and magnification filters of floating-point textures.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/OES_texture_float_linear/}\n   */\n  textureFloatLinear: {\n    get: function () {\n      return this._textureFloatLinear;\n    },\n  },\n\n  /**\n   * <code>true</code> if OES_texture_half_float_linear is supported. This extension provides\n   * access to linear sampling methods for minification and magnification filters of half floating-point textures.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float_linear/}\n   */\n  textureHalfFloatLinear: {\n    get: function () {\n      return (\n        (this._webgl2 && this._textureFloatLinear) ||\n        (!this._webgl2 && this._textureHalfFloatLinear)\n      );\n    },\n  },\n\n  /**\n   * <code>true</code> if EXT_texture_filter_anisotropic is supported. This extension provides\n   * access to anisotropic filtering for textured surfaces at an oblique angle from the viewer.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/}\n   */\n  textureFilterAnisotropic: {\n    get: function () {\n      return !!this._textureFilterAnisotropic;\n    },\n  },\n\n  /**\n   * <code>true</code> if WEBGL_compressed_texture_s3tc is supported.  This extension provides\n   * access to DXT compressed textures.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/}\n   */\n  s3tc: {\n    get: function () {\n      return this._s3tc;\n    },\n  },\n\n  /**\n   * <code>true</code> if WEBGL_compressed_texture_pvrtc is supported.  This extension provides\n   * access to PVR compressed textures.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/}\n   */\n  pvrtc: {\n    get: function () {\n      return this._pvrtc;\n    },\n  },\n\n  /**\n   * <code>true</code> if WEBGL_compressed_texture_astc is supported.  This extension provides\n   * access to ASTC compressed textures.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/}\n   */\n  astc: {\n    get: function () {\n      return this._astc;\n    },\n  },\n\n  /**\n   * <code>true</code> if WEBGL_compressed_texture_etc is supported.  This extension provides\n   * access to ETC compressed textures.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc/}\n   */\n  etc: {\n    get: function () {\n      return this._etc;\n    },\n  },\n\n  /**\n   * <code>true</code> if WEBGL_compressed_texture_etc1 is supported.  This extension provides\n   * access to ETC1 compressed textures.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc1/}\n   */\n  etc1: {\n    get: function () {\n      return this._etc1;\n    },\n  },\n\n  /**\n   * <code>true</code> if EXT_texture_compression_bptc is supported.  This extension provides\n   * access to BC7 compressed textures.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/EXT_texture_compression_bptc/}\n   */\n  bc7: {\n    get: function () {\n      return this._bc7;\n    },\n  },\n\n  /**\n   * <code>true</code> if S3TC, PVRTC, ASTC, ETC, ETC1, or BC7 compression is supported.\n   * @memberof Context.prototype\n   * @type {boolean}\n   */\n  supportsBasis: {\n    get: function () {\n      return (\n        this._s3tc ||\n        this._pvrtc ||\n        this._astc ||\n        this._etc ||\n        this._etc1 ||\n        this._bc7\n      );\n    },\n  },\n\n  /**\n   * <code>true</code> if the OES_vertex_array_object extension is supported.  This\n   * extension can improve performance by reducing the overhead of switching vertex arrays.\n   * When enabled, this extension is automatically used by {@link VertexArray}.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link http://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/|OES_vertex_array_object}\n   */\n  vertexArrayObject: {\n    get: function () {\n      return this._vertexArrayObject || this._webgl2;\n    },\n  },\n\n  /**\n   * <code>true</code> if the EXT_frag_depth extension is supported.  This\n   * extension provides access to the <code>gl_FragDepthEXT</code> built-in output variable\n   * from GLSL fragment shaders.  A shader using these functions still needs to explicitly enable the\n   * extension with <code>#extension GL_EXT_frag_depth : enable</code>.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link http://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/|EXT_frag_depth}\n   */\n  fragmentDepth: {\n    get: function () {\n      return this._fragDepth || this._webgl2;\n    },\n  },\n\n  /**\n   * <code>true</code> if the ANGLE_instanced_arrays extension is supported.  This\n   * extension provides access to instanced rendering.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays}\n   */\n  instancedArrays: {\n    get: function () {\n      return this._instancedArrays || this._webgl2;\n    },\n  },\n\n  /**\n   * <code>true</code> if the EXT_color_buffer_float extension is supported.  This\n   * extension makes the gl.RGBA32F format color renderable.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/WEBGL_color_buffer_float/}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_float/}\n   */\n  colorBufferFloat: {\n    get: function () {\n      return this._colorBufferFloat;\n    },\n  },\n\n  /**\n   * <code>true</code> if the EXT_color_buffer_half_float extension is supported.  This\n   * extension makes the format gl.RGBA16F format color renderable.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_half_float/}\n   * @see {@link https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_float/}\n   */\n  colorBufferHalfFloat: {\n    get: function () {\n      return (\n        (this._webgl2 && this._colorBufferFloat) ||\n        (!this._webgl2 && this._colorBufferHalfFloat)\n      );\n    },\n  },\n\n  /**\n   * <code>true</code> if the WEBGL_draw_buffers extension is supported. This\n   * extensions provides support for multiple render targets. The framebuffer object can have mutiple\n   * color attachments and the GLSL fragment shader can write to the built-in output array <code>gl_FragData</code>.\n   * A shader using this feature needs to explicitly enable the extension with\n   * <code>#extension GL_EXT_draw_buffers : enable</code>.\n   * @memberof Context.prototype\n   * @type {boolean}\n   * @see {@link http://www.khronos.org/registry/webgl/extensions/WEBGL_draw_buffers/|WEBGL_draw_buffers}\n   */\n  drawBuffers: {\n    get: function () {\n      return this._drawBuffers || this._webgl2;\n    },\n  },\n\n  debugShaders: {\n    get: function () {\n      return this._debugShaders;\n    },\n  },\n\n  throwOnWebGLError: {\n    get: function () {\n      return this._throwOnWebGLError;\n    },\n    set: function (value) {\n      this._throwOnWebGLError = value;\n      this._gl = wrapGL(\n        this._originalGLContext,\n        value ? throwOnError : undefined\n      );\n    },\n  },\n\n  /**\n   * A 1x1 RGBA texture initialized to [255, 255, 255, 255].  This can\n   * be used as a placeholder texture while other textures are downloaded.\n   * @memberof Context.prototype\n   * @type {Texture}\n   */\n  defaultTexture: {\n    get: function () {\n      if (this._defaultTexture === undefined) {\n        this._defaultTexture = new Texture({\n          context: this,\n          source: {\n            width: 1,\n            height: 1,\n            arrayBufferView: new Uint8Array([255, 255, 255, 255]),\n          },\n          flipY: false,\n        });\n      }\n\n      return this._defaultTexture;\n    },\n  },\n  /**\n   * A 1x1 RGB texture initialized to [0, 0, 0] representing a material that is\n   * not emissive. This can be used as a placeholder texture for emissive\n   * textures while other textures are downloaded.\n   * @memberof Context.prototype\n   * @type {Texture}\n   */\n  defaultEmissiveTexture: {\n    get: function () {\n      if (this._defaultEmissiveTexture === undefined) {\n        this._defaultEmissiveTexture = new Texture({\n          context: this,\n          pixelFormat: PixelFormat.RGB,\n          source: {\n            width: 1,\n            height: 1,\n            arrayBufferView: new Uint8Array([0, 0, 0]),\n          },\n          flipY: false,\n        });\n      }\n\n      return this._defaultEmissiveTexture;\n    },\n  },\n  /**\n   * A 1x1 RGBA texture initialized to [128, 128, 255] to encode a tangent\n   * space normal pointing in the +z direction, i.e. (0, 0, 1). This can\n   * be used as a placeholder normal texture while other textures are\n   * downloaded.\n   * @memberof Context.prototype\n   * @type {Texture}\n   */\n  defaultNormalTexture: {\n    get: function () {\n      if (this._defaultNormalTexture === undefined) {\n        this._defaultNormalTexture = new Texture({\n          context: this,\n          pixelFormat: PixelFormat.RGB,\n          source: {\n            width: 1,\n            height: 1,\n            arrayBufferView: new Uint8Array([128, 128, 255]),\n          },\n          flipY: false,\n        });\n      }\n\n      return this._defaultNormalTexture;\n    },\n  },\n\n  /**\n   * A cube map, where each face is a 1x1 RGBA texture initialized to\n   * [255, 255, 255, 255].  This can be used as a placeholder cube map while\n   * other cube maps are downloaded.\n   * @memberof Context.prototype\n   * @type {CubeMap}\n   */\n  defaultCubeMap: {\n    get: function () {\n      if (this._defaultCubeMap === undefined) {\n        const face = {\n          width: 1,\n          height: 1,\n          arrayBufferView: new Uint8Array([255, 255, 255, 255]),\n        };\n\n        this._defaultCubeMap = new CubeMap({\n          context: this,\n          source: {\n            positiveX: face,\n            negativeX: face,\n            positiveY: face,\n            negativeY: face,\n            positiveZ: face,\n            negativeZ: face,\n          },\n          flipY: false,\n        });\n      }\n\n      return this._defaultCubeMap;\n    },\n  },\n\n  /**\n   * The drawingBufferHeight of the underlying GL context.\n   * @memberof Context.prototype\n   * @type {number}\n   * @see {@link https://www.khronos.org/registry/webgl/specs/1.0/#DOM-WebGLRenderingContext-drawingBufferHeight|drawingBufferHeight}\n   */\n  drawingBufferHeight: {\n    get: function () {\n      return this._gl.drawingBufferHeight;\n    },\n  },\n\n  /**\n   * The drawingBufferWidth of the underlying GL context.\n   * @memberof Context.prototype\n   * @type {number}\n   * @see {@link https://www.khronos.org/registry/webgl/specs/1.0/#DOM-WebGLRenderingContext-drawingBufferWidth|drawingBufferWidth}\n   */\n  drawingBufferWidth: {\n    get: function () {\n      return this._gl.drawingBufferWidth;\n    },\n  },\n\n  /**\n   * Gets an object representing the currently bound framebuffer.  While this instance is not an actual\n   * {@link Framebuffer}, it is used to represent the default framebuffer in calls to\n   * {@link Texture.fromFramebuffer}.\n   * @memberof Context.prototype\n   * @type {object}\n   */\n  defaultFramebuffer: {\n    get: function () {\n      return defaultFramebufferMarker;\n    },\n  },\n});\n\n/**\n * Validates a framebuffer.\n * Available in debug builds only.\n * @private\n */\nfunction validateFramebuffer(context) {\n  //>>includeStart('debug', pragmas.debug);\n  if (context.validateFramebuffer) {\n    const gl = context._gl;\n    const status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\n\n    if (status !== gl.FRAMEBUFFER_COMPLETE) {\n      let message;\n\n      switch (status) {\n        case gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:\n          message =\n            \"Framebuffer is not complete.  Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached.  Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.\";\n          break;\n        case gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:\n          message =\n            \"Framebuffer is not complete.  Incomplete dimensions: not all attached images have the same width and height.\";\n          break;\n        case gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:\n          message =\n            \"Framebuffer is not complete.  Missing attachment: no images are attached to the framebuffer.\";\n          break;\n        case gl.FRAMEBUFFER_UNSUPPORTED:\n          message =\n            \"Framebuffer is not complete.  Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions.\";\n          break;\n      }\n\n      throw new DeveloperError(message);\n    }\n  }\n  //>>includeEnd('debug');\n}\n\nfunction applyRenderState(context, renderState, passState, clear) {\n  const previousRenderState = context._currentRenderState;\n  const previousPassState = context._currentPassState;\n  context._currentRenderState = renderState;\n  context._currentPassState = passState;\n  RenderState.partialApply(\n    context._gl,\n    previousRenderState,\n    renderState,\n    previousPassState,\n    passState,\n    clear\n  );\n}\n\nlet scratchBackBufferArray;\n// this check must use typeof, not defined, because defined doesn't work with undeclared variables.\nif (typeof WebGLRenderingContext !== \"undefined\") {\n  scratchBackBufferArray = [WebGLConstants.BACK];\n}\n\nfunction bindFramebuffer(context, framebuffer) {\n  if (framebuffer !== context._currentFramebuffer) {\n    context._currentFramebuffer = framebuffer;\n    let buffers = scratchBackBufferArray;\n\n    if (defined(framebuffer)) {\n      framebuffer._bind();\n      validateFramebuffer(context);\n\n      // TODO: Need a way for a command to give what draw buffers are active.\n      buffers = framebuffer._getActiveColorAttachments();\n    } else {\n      const gl = context._gl;\n      gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n    }\n\n    if (context.drawBuffers) {\n      context.glDrawBuffers(buffers);\n    }\n  }\n}\n\nconst defaultClearCommand = new ClearCommand();\n\nContext.prototype.clear = function (clearCommand, passState) {\n  clearCommand = defaultValue(clearCommand, defaultClearCommand);\n  passState = defaultValue(passState, this._defaultPassState);\n\n  const gl = this._gl;\n  let bitmask = 0;\n\n  const c = clearCommand.color;\n  const d = clearCommand.depth;\n  const s = clearCommand.stencil;\n\n  if (defined(c)) {\n    if (!Color.equals(this._clearColor, c)) {\n      Color.clone(c, this._clearColor);\n      gl.clearColor(c.red, c.green, c.blue, c.alpha);\n    }\n    bitmask |= gl.COLOR_BUFFER_BIT;\n  }\n\n  if (defined(d)) {\n    if (d !== this._clearDepth) {\n      this._clearDepth = d;\n      gl.clearDepth(d);\n    }\n    bitmask |= gl.DEPTH_BUFFER_BIT;\n  }\n\n  if (defined(s)) {\n    if (s !== this._clearStencil) {\n      this._clearStencil = s;\n      gl.clearStencil(s);\n    }\n    bitmask |= gl.STENCIL_BUFFER_BIT;\n  }\n\n  const rs = defaultValue(clearCommand.renderState, this._defaultRenderState);\n  applyRenderState(this, rs, passState, true);\n\n  // The command's framebuffer takes presidence over the pass' framebuffer, e.g., for off-screen rendering.\n  const framebuffer = defaultValue(\n    clearCommand.framebuffer,\n    passState.framebuffer\n  );\n  bindFramebuffer(this, framebuffer);\n\n  gl.clear(bitmask);\n};\n\nfunction beginDraw(\n  context,\n  framebuffer,\n  passState,\n  shaderProgram,\n  renderState\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (defined(framebuffer) && renderState.depthTest) {\n    if (renderState.depthTest.enabled && !framebuffer.hasDepthAttachment) {\n      throw new DeveloperError(\n        \"The depth test can not be enabled (drawCommand.renderState.depthTest.enabled) because the framebuffer (drawCommand.framebuffer) does not have a depth or depth-stencil renderbuffer.\"\n      );\n    }\n  }\n  //>>includeEnd('debug');\n\n  bindFramebuffer(context, framebuffer);\n  applyRenderState(context, renderState, passState, false);\n  shaderProgram._bind();\n  context._maxFrameTextureUnitIndex = Math.max(\n    context._maxFrameTextureUnitIndex,\n    shaderProgram.maximumTextureUnitIndex\n  );\n}\n\nfunction continueDraw(context, drawCommand, shaderProgram, uniformMap) {\n  const primitiveType = drawCommand._primitiveType;\n  const va = drawCommand._vertexArray;\n  let offset = drawCommand._offset;\n  let count = drawCommand._count;\n  const instanceCount = drawCommand.instanceCount;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!PrimitiveType.validate(primitiveType)) {\n    throw new DeveloperError(\n      \"drawCommand.primitiveType is required and must be valid.\"\n    );\n  }\n\n  Check.defined(\"drawCommand.vertexArray\", va);\n  Check.typeOf.number.greaterThanOrEquals(\"drawCommand.offset\", offset, 0);\n  if (defined(count)) {\n    Check.typeOf.number.greaterThanOrEquals(\"drawCommand.count\", count, 0);\n  }\n  Check.typeOf.number.greaterThanOrEquals(\n    \"drawCommand.instanceCount\",\n    instanceCount,\n    0\n  );\n  if (instanceCount > 0 && !context.instancedArrays) {\n    throw new DeveloperError(\"Instanced arrays extension is not supported\");\n  }\n  //>>includeEnd('debug');\n\n  context._us.model = defaultValue(drawCommand._modelMatrix, Matrix4.IDENTITY);\n  shaderProgram._setUniforms(\n    uniformMap,\n    context._us,\n    context.validateShaderProgram\n  );\n\n  va._bind();\n  const indexBuffer = va.indexBuffer;\n\n  if (defined(indexBuffer)) {\n    offset = offset * indexBuffer.bytesPerIndex; // offset in vertices to offset in bytes\n    if (defined(count)) {\n      count = Math.min(count, indexBuffer.numberOfIndices);\n    } else {\n      count = indexBuffer.numberOfIndices;\n    }\n    if (instanceCount === 0) {\n      context._gl.drawElements(\n        primitiveType,\n        count,\n        indexBuffer.indexDatatype,\n        offset\n      );\n    } else {\n      context.glDrawElementsInstanced(\n        primitiveType,\n        count,\n        indexBuffer.indexDatatype,\n        offset,\n        instanceCount\n      );\n    }\n  } else {\n    if (defined(count)) {\n      count = Math.min(count, va.numberOfVertices);\n    } else {\n      count = va.numberOfVertices;\n    }\n    if (instanceCount === 0) {\n      context._gl.drawArrays(primitiveType, offset, count);\n    } else {\n      context.glDrawArraysInstanced(\n        primitiveType,\n        offset,\n        count,\n        instanceCount\n      );\n    }\n  }\n\n  va._unBind();\n}\n\nContext.prototype.draw = function (\n  drawCommand,\n  passState,\n  shaderProgram,\n  uniformMap\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"drawCommand\", drawCommand);\n  Check.defined(\"drawCommand.shaderProgram\", drawCommand._shaderProgram);\n  //>>includeEnd('debug');\n\n  passState = defaultValue(passState, this._defaultPassState);\n  // The command's framebuffer takes presidence over the pass' framebuffer, e.g., for off-screen rendering.\n  const framebuffer = defaultValue(\n    drawCommand._framebuffer,\n    passState.framebuffer\n  );\n  const renderState = defaultValue(\n    drawCommand._renderState,\n    this._defaultRenderState\n  );\n  shaderProgram = defaultValue(shaderProgram, drawCommand._shaderProgram);\n  uniformMap = defaultValue(uniformMap, drawCommand._uniformMap);\n\n  beginDraw(this, framebuffer, passState, shaderProgram, renderState);\n  continueDraw(this, drawCommand, shaderProgram, uniformMap);\n};\n\nContext.prototype.endFrame = function () {\n  const gl = this._gl;\n  gl.useProgram(null);\n\n  this._currentFramebuffer = undefined;\n  gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n  const buffers = scratchBackBufferArray;\n  if (this.drawBuffers) {\n    this.glDrawBuffers(buffers);\n  }\n\n  const length = this._maxFrameTextureUnitIndex;\n  this._maxFrameTextureUnitIndex = 0;\n\n  for (let i = 0; i < length; ++i) {\n    gl.activeTexture(gl.TEXTURE0 + i);\n    gl.bindTexture(gl.TEXTURE_2D, null);\n    gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);\n  }\n};\n\nContext.prototype.readPixels = function (readState) {\n  const gl = this._gl;\n\n  readState = defaultValue(readState, defaultValue.EMPTY_OBJECT);\n  const x = Math.max(defaultValue(readState.x, 0), 0);\n  const y = Math.max(defaultValue(readState.y, 0), 0);\n  const width = defaultValue(readState.width, gl.drawingBufferWidth);\n  const height = defaultValue(readState.height, gl.drawingBufferHeight);\n  const framebuffer = readState.framebuffer;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThan(\"readState.width\", width, 0);\n  Check.typeOf.number.greaterThan(\"readState.height\", height, 0);\n  //>>includeEnd('debug');\n\n  let pixelDatatype = PixelDatatype.UNSIGNED_BYTE;\n  if (defined(framebuffer) && framebuffer.numberOfColorAttachments > 0) {\n    pixelDatatype = framebuffer.getColorTexture(0).pixelDatatype;\n  }\n\n  const pixels = PixelFormat.createTypedArray(\n    PixelFormat.RGBA,\n    pixelDatatype,\n    width,\n    height\n  );\n\n  bindFramebuffer(this, framebuffer);\n\n  gl.readPixels(\n    x,\n    y,\n    width,\n    height,\n    PixelFormat.RGBA,\n    PixelDatatype.toWebGLConstant(pixelDatatype, this),\n    pixels\n  );\n\n  return pixels;\n};\n\nconst viewportQuadAttributeLocations = {\n  position: 0,\n  textureCoordinates: 1,\n};\n\nContext.prototype.getViewportQuadVertexArray = function () {\n  // Per-context cache for viewport quads\n  let vertexArray = this.cache.viewportQuad_vertexArray;\n\n  if (!defined(vertexArray)) {\n    const geometry = new Geometry({\n      attributes: {\n        position: new GeometryAttribute({\n          componentDatatype: ComponentDatatype.FLOAT,\n          componentsPerAttribute: 2,\n          values: [-1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0],\n        }),\n\n        textureCoordinates: new GeometryAttribute({\n          componentDatatype: ComponentDatatype.FLOAT,\n          componentsPerAttribute: 2,\n          values: [0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0],\n        }),\n      },\n      // Workaround Internet Explorer 11.0.8 lack of TRIANGLE_FAN\n      indices: new Uint16Array([0, 1, 2, 0, 2, 3]),\n      primitiveType: PrimitiveType.TRIANGLES,\n    });\n\n    vertexArray = VertexArray.fromGeometry({\n      context: this,\n      geometry: geometry,\n      attributeLocations: viewportQuadAttributeLocations,\n      bufferUsage: BufferUsage.STATIC_DRAW,\n      interleave: true,\n    });\n\n    this.cache.viewportQuad_vertexArray = vertexArray;\n  }\n\n  return vertexArray;\n};\n\nContext.prototype.createViewportQuadCommand = function (\n  fragmentShaderSource,\n  overrides\n) {\n  overrides = defaultValue(overrides, defaultValue.EMPTY_OBJECT);\n\n  return new DrawCommand({\n    vertexArray: this.getViewportQuadVertexArray(),\n    primitiveType: PrimitiveType.TRIANGLES,\n    renderState: overrides.renderState,\n    shaderProgram: ShaderProgram.fromCache({\n      context: this,\n      vertexShaderSource: ViewportQuadVS,\n      fragmentShaderSource: fragmentShaderSource,\n      attributeLocations: viewportQuadAttributeLocations,\n    }),\n    uniformMap: overrides.uniformMap,\n    owner: overrides.owner,\n    framebuffer: overrides.framebuffer,\n    pass: overrides.pass,\n  });\n};\n\n/**\n * Gets the object associated with a pick color.\n *\n * @param {Color} pickColor The pick color.\n * @returns {object} The object associated with the pick color, or undefined if no object is associated with that color.\n *\n * @example\n * const object = context.getObjectByPickColor(pickColor);\n *\n * @see Context#createPickId\n */\nContext.prototype.getObjectByPickColor = function (pickColor) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"pickColor\", pickColor);\n  //>>includeEnd('debug');\n\n  return this._pickObjects[pickColor.toRgba()];\n};\n\nfunction PickId(pickObjects, key, color) {\n  this._pickObjects = pickObjects;\n  this.key = key;\n  this.color = color;\n}\n\nObject.defineProperties(PickId.prototype, {\n  object: {\n    get: function () {\n      return this._pickObjects[this.key];\n    },\n    set: function (value) {\n      this._pickObjects[this.key] = value;\n    },\n  },\n});\n\nPickId.prototype.destroy = function () {\n  delete this._pickObjects[this.key];\n  return undefined;\n};\n\n/**\n * Creates a unique ID associated with the input object for use with color-buffer picking.\n * The ID has an RGBA color value unique to this context.  You must call destroy()\n * on the pick ID when destroying the input object.\n *\n * @param {object} object The object to associate with the pick ID.\n * @returns {object} A PickId object with a <code>color</code> property.\n *\n * @exception {RuntimeError} Out of unique Pick IDs.\n *\n *\n * @example\n * this._pickId = context.createPickId({\n *   primitive : this,\n *   id : this.id\n * });\n *\n * @see Context#getObjectByPickColor\n */\nContext.prototype.createPickId = function (object) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"object\", object);\n  //>>includeEnd('debug');\n\n  // the increment and assignment have to be separate statements to\n  // actually detect overflow in the Uint32 value\n  ++this._nextPickColor[0];\n  const key = this._nextPickColor[0];\n  if (key === 0) {\n    // In case of overflow\n    throw new RuntimeError(\"Out of unique Pick IDs.\");\n  }\n\n  this._pickObjects[key] = object;\n  return new PickId(this._pickObjects, key, Color.fromRgba(key));\n};\n\nContext.prototype.isDestroyed = function () {\n  return false;\n};\n\nContext.prototype.destroy = function () {\n  // Destroy all objects in the cache that have a destroy method.\n  const cache = this.cache;\n  for (const property in cache) {\n    if (cache.hasOwnProperty(property)) {\n      const propertyValue = cache[property];\n      if (defined(propertyValue.destroy)) {\n        propertyValue.destroy();\n      }\n    }\n  }\n\n  this._shaderCache = this._shaderCache.destroy();\n  this._textureCache = this._textureCache.destroy();\n  this._defaultTexture = this._defaultTexture && this._defaultTexture.destroy();\n  this._defaultEmissiveTexture =\n    this._defaultEmissiveTexture && this._defaultEmissiveTexture.destroy();\n  this._defaultNormalTexture =\n    this._defaultNormalTexture && this._defaultNormalTexture.destroy();\n  this._defaultCubeMap = this._defaultCubeMap && this._defaultCubeMap.destroy();\n\n  return destroyObject(this);\n};\n\n// Used for specs.\nContext._deprecationWarning = deprecationWarning;\n\nexport default Context;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Framebuffer from \"./Framebuffer.js\";\n\n/**\n * Creates a multisampling wrapper around two framebuffers with optional initial\n * color and depth-stencil attachments. The first framebuffer has multisampled\n * renderbuffer attachments and is bound to READ_FRAMEBUFFER during the blit. The\n * second is bound to DRAW_FRAMEBUFFER during the blit, and has texture attachments\n * to store the copied pixels.\n *\n * @param {object} options The initial framebuffer attachments. <code>context</code>, <code>width</code>, and <code>height</code> are required. The possible properties are <code>colorTextures</code>, <code>colorRenderbuffers</code>, <code>depthStencilTexture</code>, <code>depthStencilRenderbuffer</code>, and <code>destroyAttachments</code>.\n *\n * @exception {DeveloperError} Both color renderbuffer and texture attachments must be provided.\n * @exception {DeveloperError} Both depth-stencil renderbuffer and texture attachments must be provided.\n *\n * @private\n * @constructor\n */\nfunction MultisampleFramebuffer(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const context = options.context;\n  const width = options.width;\n  const height = options.height;\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.context\", context);\n  Check.defined(\"options.width\", width);\n  Check.defined(\"options.height\", height);\n  //>>includeEnd('debug');\n  this._width = width;\n  this._height = height;\n\n  const colorRenderbuffers = options.colorRenderbuffers;\n  const colorTextures = options.colorTextures;\n  if (defined(colorRenderbuffers) !== defined(colorTextures)) {\n    throw new DeveloperError(\n      \"Both color renderbuffer and texture attachments must be provided.\"\n    );\n  }\n\n  const depthStencilRenderbuffer = options.depthStencilRenderbuffer;\n  const depthStencilTexture = options.depthStencilTexture;\n  if (defined(depthStencilRenderbuffer) !== defined(depthStencilTexture)) {\n    throw new DeveloperError(\n      \"Both depth-stencil renderbuffer and texture attachments must be provided.\"\n    );\n  }\n\n  this._renderFramebuffer = new Framebuffer({\n    context: context,\n    colorRenderbuffers: colorRenderbuffers,\n    depthStencilRenderbuffer: depthStencilRenderbuffer,\n    destroyAttachments: options.destroyAttachments,\n  });\n  this._colorFramebuffer = new Framebuffer({\n    context: context,\n    colorTextures: colorTextures,\n    depthStencilTexture: depthStencilTexture,\n    destroyAttachments: options.destroyAttachments,\n  });\n}\n\nMultisampleFramebuffer.prototype.getRenderFramebuffer = function () {\n  return this._renderFramebuffer;\n};\n\nMultisampleFramebuffer.prototype.getColorFramebuffer = function () {\n  return this._colorFramebuffer;\n};\n\nMultisampleFramebuffer.prototype.blitFramebuffers = function (\n  context,\n  blitStencil\n) {\n  this._renderFramebuffer.bindRead();\n  this._colorFramebuffer.bindDraw();\n  const gl = context._gl;\n  let mask = 0;\n  if (this._colorFramebuffer._colorTextures.length > 0) {\n    mask |= gl.COLOR_BUFFER_BIT;\n  }\n  if (defined(this._colorFramebuffer.depthStencilTexture)) {\n    mask |= gl.DEPTH_BUFFER_BIT | (blitStencil ? gl.STENCIL_BUFFER_BIT : 0);\n  }\n  gl.blitFramebuffer(\n    0,\n    0,\n    this._width,\n    this._height,\n    0,\n    0,\n    this._width,\n    this._height,\n    mask,\n    gl.NEAREST\n  );\n  gl.bindFramebuffer(gl.READ_FRAMEBUFFER, null);\n  gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null);\n};\n\nMultisampleFramebuffer.prototype.isDestroyed = function () {\n  return false;\n};\n\nMultisampleFramebuffer.prototype.destroy = function () {\n  this._renderFramebuffer.destroy();\n  this._colorFramebuffer.destroy();\n  return destroyObject(this);\n};\n\nexport default MultisampleFramebuffer;\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * @private\n */\nconst RenderbufferFormat = {\n  RGBA4: WebGLConstants.RGBA4,\n  RGBA8: WebGLConstants.RGBA8,\n  RGBA16F: WebGLConstants.RGBA16F,\n  RGBA32F: WebGLConstants.RGBA32F,\n  RGB5_A1: WebGLConstants.RGB5_A1,\n  RGB565: WebGLConstants.RGB565,\n  DEPTH_COMPONENT16: WebGLConstants.DEPTH_COMPONENT16,\n  STENCIL_INDEX8: WebGLConstants.STENCIL_INDEX8,\n  DEPTH_STENCIL: WebGLConstants.DEPTH_STENCIL,\n  DEPTH24_STENCIL8: WebGLConstants.DEPTH24_STENCIL8,\n\n  validate: function (renderbufferFormat) {\n    return (\n      renderbufferFormat === RenderbufferFormat.RGBA4 ||\n      renderbufferFormat === RenderbufferFormat.RGBA8 ||\n      renderbufferFormat === RenderbufferFormat.RGBA16F ||\n      renderbufferFormat === RenderbufferFormat.RGBA32F ||\n      renderbufferFormat === RenderbufferFormat.RGB5_A1 ||\n      renderbufferFormat === RenderbufferFormat.RGB565 ||\n      renderbufferFormat === RenderbufferFormat.DEPTH_COMPONENT16 ||\n      renderbufferFormat === RenderbufferFormat.STENCIL_INDEX8 ||\n      renderbufferFormat === RenderbufferFormat.DEPTH_STENCIL ||\n      renderbufferFormat === RenderbufferFormat.DEPTH24_STENCIL8\n    );\n  },\n\n  getColorFormat: function (datatype) {\n    if (datatype === WebGLConstants.FLOAT) {\n      return RenderbufferFormat.RGBA32F;\n    } else if (datatype === WebGLConstants.HALF_FLOAT_OES) {\n      return RenderbufferFormat.RGBA16F;\n    }\n    return RenderbufferFormat.RGBA8;\n  },\n};\nexport default Object.freeze(RenderbufferFormat);\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport ContextLimits from \"./ContextLimits.js\";\nimport RenderbufferFormat from \"./RenderbufferFormat.js\";\n\n/**\n * @private\n */\nfunction Renderbuffer(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.context\", options.context);\n  //>>includeEnd('debug');\n\n  const context = options.context;\n  const gl = context._gl;\n  const maximumRenderbufferSize = ContextLimits.maximumRenderbufferSize;\n\n  const format = defaultValue(options.format, RenderbufferFormat.RGBA4);\n  const width = defined(options.width) ? options.width : gl.drawingBufferWidth;\n  const height = defined(options.height)\n    ? options.height\n    : gl.drawingBufferHeight;\n  const numSamples = defaultValue(options.numSamples, 1);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!RenderbufferFormat.validate(format)) {\n    throw new DeveloperError(\"Invalid format.\");\n  }\n\n  Check.typeOf.number.greaterThan(\"width\", width, 0);\n\n  if (width > maximumRenderbufferSize) {\n    throw new DeveloperError(\n      `Width must be less than or equal to the maximum renderbuffer size (${maximumRenderbufferSize}).  Check maximumRenderbufferSize.`\n    );\n  }\n\n  Check.typeOf.number.greaterThan(\"height\", height, 0);\n\n  if (height > maximumRenderbufferSize) {\n    throw new DeveloperError(\n      `Height must be less than or equal to the maximum renderbuffer size (${maximumRenderbufferSize}).  Check maximumRenderbufferSize.`\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._gl = gl;\n  this._format = format;\n  this._width = width;\n  this._height = height;\n  this._renderbuffer = this._gl.createRenderbuffer();\n\n  gl.bindRenderbuffer(gl.RENDERBUFFER, this._renderbuffer);\n  if (numSamples > 1) {\n    gl.renderbufferStorageMultisample(\n      gl.RENDERBUFFER,\n      numSamples,\n      format,\n      width,\n      height\n    );\n  } else {\n    gl.renderbufferStorage(gl.RENDERBUFFER, format, width, height);\n  }\n  gl.bindRenderbuffer(gl.RENDERBUFFER, null);\n}\n\nObject.defineProperties(Renderbuffer.prototype, {\n  format: {\n    get: function () {\n      return this._format;\n    },\n  },\n  width: {\n    get: function () {\n      return this._width;\n    },\n  },\n  height: {\n    get: function () {\n      return this._height;\n    },\n  },\n});\n\nRenderbuffer.prototype._getRenderbuffer = function () {\n  return this._renderbuffer;\n};\n\nRenderbuffer.prototype.isDestroyed = function () {\n  return false;\n};\n\nRenderbuffer.prototype.destroy = function () {\n  this._gl.deleteRenderbuffer(this._renderbuffer);\n  return destroyObject(this);\n};\nexport default Renderbuffer;\n", "import Framebuffer from \"./Framebuffer.js\";\nimport MultisampleFramebuffer from \"./MultisampleFramebuffer.js\";\nimport PixelDatatype from \"./PixelDatatype.js\";\nimport Renderbuffer from \"./Renderbuffer.js\";\nimport RenderbufferFormat from \"./RenderbufferFormat.js\";\nimport Sampler from \"./Sampler.js\";\nimport Texture from \"./Texture.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\n\n/**\n * Creates a wrapper object around a framebuffer and its resources.\n *\n * @param {object} options Object with the following properties:\n * @param {number} [options.numSamples=1] The multisampling rate of the render targets. Requires a WebGL2 context.\n * @param {number} [options.colorAttachmentsLength=1] The number of color attachments this FramebufferManager will create.\n * @param {boolean} [options.color=true] Whether the FramebufferManager will use color attachments.\n * @param {boolean} [options.depth=false] Whether the FramebufferManager will use depth attachments.\n * @param {boolean} [options.depthStencil=false] Whether the FramebufferManager will use depth-stencil attachments.\n * @param {boolean} [options.supportsDepthTexture=false] Whether the FramebufferManager will create a depth texture when the extension is supported.\n * @param {boolean} [options.createColorAttachments=true] Whether the FramebufferManager will construct its own color attachments.\n * @param {boolean} [options.createDepthAttachments=true] Whether the FramebufferManager will construct its own depth attachments.\n * @param {PixelDatatype} [options.pixelDatatype=undefined] The default pixel datatype to use when creating color attachments.\n * @param {PixelFormat} [options.pixelFormat=undefined] The default pixel format to use when creating color attachments.\n *\n * @exception {DeveloperError} Must enable at least one type of framebuffer attachment.\n * @exception {DeveloperError} Cannot have both a depth and depth-stencil attachment.\n *\n * @private\n * @constructor\n */\nfunction FramebufferManager(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  this._numSamples = defaultValue(options.numSamples, 1);\n  this._colorAttachmentsLength = defaultValue(\n    options.colorAttachmentsLength,\n    1\n  );\n\n  this._color = defaultValue(options.color, true);\n  this._depth = defaultValue(options.depth, false);\n  this._depthStencil = defaultValue(options.depthStencil, false);\n  this._supportsDepthTexture = defaultValue(\n    options.supportsDepthTexture,\n    false\n  );\n  //>>includeStart('debug', pragmas.debug);\n  if (!this._color && !this._depth && !this._depthStencil) {\n    throw new DeveloperError(\n      \"Must enable at least one type of framebuffer attachment.\"\n    );\n  }\n  if (this._depth && this._depthStencil) {\n    throw new DeveloperError(\n      \"Cannot have both a depth and depth-stencil attachment.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._createColorAttachments = defaultValue(\n    options.createColorAttachments,\n    true\n  );\n  this._createDepthAttachments = defaultValue(\n    options.createDepthAttachments,\n    true\n  );\n\n  this._pixelDatatype = options.pixelDatatype;\n  this._pixelFormat = options.pixelFormat;\n\n  this._width = undefined;\n  this._height = undefined;\n\n  this._framebuffer = undefined;\n  this._multisampleFramebuffer = undefined;\n  this._colorTextures = undefined;\n  if (this._color) {\n    this._colorTextures = new Array(this._colorAttachmentsLength);\n    this._colorRenderbuffers = new Array(this._colorAttachmentsLength);\n  }\n  this._colorRenderbuffer = undefined;\n  this._depthStencilRenderbuffer = undefined;\n  this._depthStencilTexture = undefined;\n  this._depthRenderbuffer = undefined;\n  this._depthTexture = undefined;\n\n  this._attachmentsDirty = false;\n}\n\nObject.defineProperties(FramebufferManager.prototype, {\n  framebuffer: {\n    get: function () {\n      if (this._numSamples > 1) {\n        return this._multisampleFramebuffer.getRenderFramebuffer();\n      }\n      return this._framebuffer;\n    },\n  },\n  numSamples: {\n    get: function () {\n      return this._numSamples;\n    },\n  },\n  status: {\n    get: function () {\n      return this.framebuffer.status;\n    },\n  },\n});\n\nFramebufferManager.prototype.isDirty = function (\n  width,\n  height,\n  numSamples,\n  pixelDatatype,\n  pixelFormat\n) {\n  numSamples = defaultValue(numSamples, 1);\n  const dimensionChanged = this._width !== width || this._height !== height;\n  const samplesChanged = this._numSamples !== numSamples;\n  const pixelChanged =\n    (defined(pixelDatatype) && this._pixelDatatype !== pixelDatatype) ||\n    (defined(pixelFormat) && this._pixelFormat !== pixelFormat);\n  const framebufferDefined =\n    numSamples === 1\n      ? defined(this._framebuffer)\n      : defined(this._multisampleFramebuffer);\n\n  return (\n    this._attachmentsDirty ||\n    dimensionChanged ||\n    samplesChanged ||\n    pixelChanged ||\n    !framebufferDefined ||\n    (this._color && !defined(this._colorTextures[0]))\n  );\n};\n\nFramebufferManager.prototype.update = function (\n  context,\n  width,\n  height,\n  numSamples,\n  pixelDatatype,\n  pixelFormat\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(width) || !defined(height)) {\n    throw new DeveloperError(\"width and height must be defined.\");\n  }\n  //>>includeEnd('debug');\n  numSamples = context.msaa ? defaultValue(numSamples, 1) : 1;\n  pixelDatatype = defaultValue(\n    pixelDatatype,\n    this._color\n      ? defaultValue(this._pixelDatatype, PixelDatatype.UNSIGNED_BYTE)\n      : undefined\n  );\n  pixelFormat = defaultValue(\n    pixelFormat,\n    this._color ? defaultValue(this._pixelFormat, PixelFormat.RGBA) : undefined\n  );\n\n  if (this.isDirty(width, height, numSamples, pixelDatatype, pixelFormat)) {\n    this.destroy();\n    this._width = width;\n    this._height = height;\n    this._numSamples = numSamples;\n    this._pixelDatatype = pixelDatatype;\n    this._pixelFormat = pixelFormat;\n    this._attachmentsDirty = false;\n\n    // Create color texture\n    if (this._color && this._createColorAttachments) {\n      for (let i = 0; i < this._colorAttachmentsLength; ++i) {\n        this._colorTextures[i] = new Texture({\n          context: context,\n          width: width,\n          height: height,\n          pixelFormat: pixelFormat,\n          pixelDatatype: pixelDatatype,\n          sampler: Sampler.NEAREST,\n        });\n        if (this._numSamples > 1) {\n          const format = RenderbufferFormat.getColorFormat(pixelDatatype);\n          this._colorRenderbuffers[i] = new Renderbuffer({\n            context: context,\n            width: width,\n            height: height,\n            format: format,\n            numSamples: this._numSamples,\n          });\n        }\n      }\n    }\n\n    // Create depth stencil texture or renderbuffer\n    if (this._depthStencil && this._createDepthAttachments) {\n      if (this._supportsDepthTexture && context.depthTexture) {\n        this._depthStencilTexture = new Texture({\n          context: context,\n          width: width,\n          height: height,\n          pixelFormat: PixelFormat.DEPTH_STENCIL,\n          pixelDatatype: PixelDatatype.UNSIGNED_INT_24_8,\n          sampler: Sampler.NEAREST,\n        });\n        if (this._numSamples > 1) {\n          this._depthStencilRenderbuffer = new Renderbuffer({\n            context: context,\n            width: width,\n            height: height,\n            format: RenderbufferFormat.DEPTH24_STENCIL8,\n            numSamples: this._numSamples,\n          });\n        }\n      } else {\n        this._depthStencilRenderbuffer = new Renderbuffer({\n          context: context,\n          width: width,\n          height: height,\n          format: RenderbufferFormat.DEPTH_STENCIL,\n        });\n      }\n    }\n\n    // Create depth texture\n    if (this._depth && this._createDepthAttachments) {\n      if (this._supportsDepthTexture && context.depthTexture) {\n        this._depthTexture = new Texture({\n          context: context,\n          width: width,\n          height: height,\n          pixelFormat: PixelFormat.DEPTH_COMPONENT,\n          pixelDatatype: PixelDatatype.UNSIGNED_INT,\n          sampler: Sampler.NEAREST,\n        });\n      } else {\n        this._depthRenderbuffer = new Renderbuffer({\n          context: context,\n          width: width,\n          height: height,\n          format: RenderbufferFormat.DEPTH_COMPONENT16,\n        });\n      }\n    }\n\n    if (this._numSamples > 1) {\n      this._multisampleFramebuffer = new MultisampleFramebuffer({\n        context: context,\n        width: this._width,\n        height: this._height,\n        colorTextures: this._colorTextures,\n        colorRenderbuffers: this._colorRenderbuffers,\n        depthStencilTexture: this._depthStencilTexture,\n        depthStencilRenderbuffer: this._depthStencilRenderbuffer,\n        destroyAttachments: false,\n      });\n    } else {\n      this._framebuffer = new Framebuffer({\n        context: context,\n        colorTextures: this._colorTextures,\n        depthTexture: this._depthTexture,\n        depthRenderbuffer: this._depthRenderbuffer,\n        depthStencilTexture: this._depthStencilTexture,\n        depthStencilRenderbuffer: this._depthStencilRenderbuffer,\n        destroyAttachments: false,\n      });\n    }\n  }\n};\n\nFramebufferManager.prototype.getColorTexture = function (index) {\n  index = defaultValue(index, 0);\n  //>>includeStart('debug', pragmas.debug);\n  if (index >= this._colorAttachmentsLength) {\n    throw new DeveloperError(\n      \"index must be smaller than total number of color attachments.\"\n    );\n  }\n  //>>includeEnd('debug');\n  return this._colorTextures[index];\n};\n\nFramebufferManager.prototype.setColorTexture = function (texture, index) {\n  index = defaultValue(index, 0);\n  //>>includeStart('debug', pragmas.debug);\n  if (this._createColorAttachments) {\n    throw new DeveloperError(\n      \"createColorAttachments must be false if setColorTexture is called.\"\n    );\n  }\n  if (index >= this._colorAttachmentsLength) {\n    throw new DeveloperError(\n      \"index must be smaller than total number of color attachments.\"\n    );\n  }\n  //>>includeEnd('debug');\n  this._attachmentsDirty = texture !== this._colorTextures[index];\n  this._colorTextures[index] = texture;\n};\n\nFramebufferManager.prototype.getColorRenderbuffer = function (index) {\n  index = defaultValue(index, 0);\n  //>>includeStart('debug', pragmas.debug);\n  if (index >= this._colorAttachmentsLength) {\n    throw new DeveloperError(\n      \"index must be smaller than total number of color attachments.\"\n    );\n  }\n  //>>includeEnd('debug');\n  return this._colorRenderbuffers[index];\n};\n\nFramebufferManager.prototype.setColorRenderbuffer = function (\n  renderbuffer,\n  index\n) {\n  index = defaultValue(index, 0);\n  //>>includeStart('debug', pragmas.debug);\n  if (this._createColorAttachments) {\n    throw new DeveloperError(\n      \"createColorAttachments must be false if setColorRenderbuffer is called.\"\n    );\n  }\n  if (index >= this._colorAttachmentsLength) {\n    throw new DeveloperError(\n      \"index must be smaller than total number of color attachments.\"\n    );\n  }\n  //>>includeEnd('debug');\n  this._attachmentsDirty = renderbuffer !== this._colorRenderbuffers[index];\n  this._colorRenderbuffers[index] = renderbuffer;\n};\n\nFramebufferManager.prototype.getDepthRenderbuffer = function () {\n  return this._depthRenderbuffer;\n};\n\nFramebufferManager.prototype.setDepthRenderbuffer = function (renderbuffer) {\n  //>>includeStart('debug', pragmas.debug);\n  if (this._createDepthAttachments) {\n    throw new DeveloperError(\n      \"createDepthAttachments must be false if setDepthRenderbuffer is called.\"\n    );\n  }\n  //>>includeEnd('debug');\n  this._attachmentsDirty = renderbuffer !== this._depthRenderbuffer;\n  this._depthRenderbuffer = renderbuffer;\n};\n\nFramebufferManager.prototype.getDepthTexture = function () {\n  return this._depthTexture;\n};\n\nFramebufferManager.prototype.setDepthTexture = function (texture) {\n  //>>includeStart('debug', pragmas.debug);\n  if (this._createDepthAttachments) {\n    throw new DeveloperError(\n      \"createDepthAttachments must be false if setDepthTexture is called.\"\n    );\n  }\n  //>>includeEnd('debug');\n  this._attachmentsDirty = texture !== this._depthTexture;\n  this._depthTexture = texture;\n};\n\nFramebufferManager.prototype.getDepthStencilRenderbuffer = function () {\n  return this._depthStencilRenderbuffer;\n};\n\nFramebufferManager.prototype.setDepthStencilRenderbuffer = function (\n  renderbuffer\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (this._createDepthAttachments) {\n    throw new DeveloperError(\n      \"createDepthAttachments must be false if setDepthStencilRenderbuffer is called.\"\n    );\n  }\n  //>>includeEnd('debug');\n  this._attachmentsDirty = renderbuffer !== this._depthStencilRenderbuffer;\n  this._depthStencilRenderbuffer = renderbuffer;\n};\n\nFramebufferManager.prototype.getDepthStencilTexture = function () {\n  return this._depthStencilTexture;\n};\n\nFramebufferManager.prototype.setDepthStencilTexture = function (texture) {\n  //>>includeStart('debug', pragmas.debug);\n  if (this._createDepthAttachments) {\n    throw new DeveloperError(\n      \"createDepthAttachments must be false if setDepthStencilTexture is called.\"\n    );\n  }\n  //>>includeEnd('debug');\n  this._attachmentsDirty = texture !== this._depthStencilTexture;\n  this._depthStencilTexture = texture;\n};\n\nFramebufferManager.prototype.prepareTextures = function (context, blitStencil) {\n  if (this._numSamples > 1) {\n    this._multisampleFramebuffer.blitFramebuffers(context, blitStencil);\n  }\n};\n\nFramebufferManager.prototype.clear = function (\n  context,\n  clearCommand,\n  passState\n) {\n  const framebuffer = clearCommand.framebuffer;\n  clearCommand.framebuffer = this.framebuffer;\n  clearCommand.execute(context, passState);\n  clearCommand.framebuffer = framebuffer;\n};\n\nFramebufferManager.prototype.destroyFramebuffer = function () {\n  this._framebuffer = this._framebuffer && this._framebuffer.destroy();\n  this._multisampleFramebuffer =\n    this._multisampleFramebuffer && this._multisampleFramebuffer.destroy();\n};\n\nFramebufferManager.prototype.destroy = function () {\n  if (this._color) {\n    let i;\n    const length = this._colorTextures.length;\n    for (i = 0; i < length; ++i) {\n      const texture = this._colorTextures[i];\n      if (this._createColorAttachments) {\n        if (defined(texture) && !texture.isDestroyed()) {\n          this._colorTextures[i].destroy();\n          this._colorTextures[i] = undefined;\n        }\n      }\n      if (defined(texture) && texture.isDestroyed()) {\n        this._colorTextures[i] = undefined;\n      }\n      const renderbuffer = this._colorRenderbuffers[i];\n      if (this._createColorAttachments) {\n        if (defined(renderbuffer) && !renderbuffer.isDestroyed()) {\n          this._colorRenderbuffers[i].destroy();\n          this._colorRenderbuffers[i] = undefined;\n        }\n      }\n      if (defined(renderbuffer) && renderbuffer.isDestroyed()) {\n        this._colorRenderbuffers[i] = undefined;\n      }\n    }\n  }\n\n  if (this._depthStencil) {\n    if (this._createDepthAttachments) {\n      this._depthStencilTexture =\n        this._depthStencilTexture && this._depthStencilTexture.destroy();\n      this._depthStencilRenderbuffer =\n        this._depthStencilRenderbuffer &&\n        this._depthStencilRenderbuffer.destroy();\n    }\n    if (\n      defined(this._depthStencilTexture) &&\n      this._depthStencilTexture.isDestroyed()\n    ) {\n      this._depthStencilTexture = undefined;\n    }\n    if (\n      defined(this._depthStencilRenderbuffer) &&\n      this._depthStencilRenderbuffer.isDestroyed()\n    ) {\n      this._depthStencilRenderbuffer = undefined;\n    }\n  }\n\n  if (this._depth) {\n    if (this._createDepthAttachments) {\n      this._depthTexture = this._depthTexture && this._depthTexture.destroy();\n      this._depthRenderbuffer =\n        this._depthRenderbuffer && this._depthRenderbuffer.destroy();\n    }\n    if (defined(this._depthTexture) && this._depthTexture.isDestroyed()) {\n      this._depthTexture = undefined;\n    }\n    if (\n      defined(this._depthRenderbuffer) &&\n      this._depthRenderbuffer.isDestroyed()\n    ) {\n      this._depthRenderbuffer = undefined;\n    }\n  }\n\n  this.destroyFramebuffer();\n};\nexport default FramebufferManager;\n", "import Check from \"../Core/Check.js\";\n\n/**\n * An enum describing whether a variable should be added to the\n * vertex shader, the fragment shader, or both.\n *\n * @private\n */\nconst ShaderDestination = {\n  VERTEX: 0,\n  FRAGMENT: 1,\n  BOTH: 2,\n};\n\n/**\n * Check if a variable should be included in the vertex shader.\n *\n * @param {ShaderDestination} destination The ShaderDestination to check\n * @return {boolean} <code>true</code> if the variable appears in the vertex shader, or <code>false</code> otherwise\n * @private\n */\nShaderDestination.includesVertexShader = function (destination) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"destination\", destination);\n  //>>includeEnd('debug');\n\n  return (\n    destination === ShaderDestination.VERTEX ||\n    destination === ShaderDestination.BOTH\n  );\n};\n\n/**\n * Check if a variable should be included in the vertex shader.\n *\n * @param {ShaderDestination} destination The ShaderDestination to check\n * @return {boolean} <code>true</code> if the variable appears in the vertex shader, or <code>false</code> otherwise\n * @private\n */\nShaderDestination.includesFragmentShader = function (destination) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"destination\", destination);\n  //>>includeEnd('debug');\n  //\n  return (\n    destination === ShaderDestination.FRAGMENT ||\n    destination === ShaderDestination.BOTH\n  );\n};\n\nexport default Object.freeze(ShaderDestination);\n", "/**\n * A utility for dynamically-generating a GLSL struct.\n *\n * @alias ShaderStruct\n * @constructor\n *\n * @see {@link ShaderBuilder}\n * @param {string} name The name of the struct as it will appear in the shader.\n * @example\n * // Generate the struct:\n * //\n * // struct Attributes\n * // {\n * //     vec3 position;\n * //     vec3 normal;\n * //     vec2 texCoord;\n * // };\n * const struct = new ShaderStruct(\"Attributes\");\n * struct.addField(\"vec3\", \"position\");\n * struct.addField(\"vec3\", \"normal\");\n * struct.addField(\"vec2\", \"texCoord\");\n * const generatedLines = struct.generateGlslLines();\n *\n * @private\n */\nfunction ShaderStruct(name) {\n  this.name = name;\n  this.fields = [];\n}\n\n/**\n * Add a field to the struct\n * @param {string} type The type of the struct field\n * @param {string} identifier The identifier of the struct field\n */\nShaderStruct.prototype.addField = function (type, identifier) {\n  const field = `    ${type} ${identifier};`;\n  this.fields.push(field);\n};\n\n/**\n * Generate a list of lines of GLSL code for use with {@link ShaderBuilder}\n * @return {string[]} The generated GLSL code.\n */\nShaderStruct.prototype.generateGlslLines = function () {\n  let fields = this.fields;\n  if (fields.length === 0) {\n    // GLSL requires structs to have at least one field\n    fields = [\"    float _empty;\"];\n  }\n\n  return [].concat(`struct ${this.name}`, \"{\", fields, \"};\");\n};\n\nexport default ShaderStruct;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * A utility for dynamically-generating a GLSL function\n *\n * @alias ShaderFunction\n * @constructor\n *\n * @see {@link ShaderBuilder}\n * @param {string} signature The full signature of the function as it will appear in the shader. Do not include the curly braces.\n * @example\n * // generate the following function\n * //\n * // void assignVaryings(vec3 position)\n * // {\n * //    v_positionEC = (czm_modelView * vec4(a_position, 1.0)).xyz;\n * //    v_texCoord = a_texCoord;\n * // }\n * const signature = \"void assignVaryings(vec3 position)\";\n * const func = new ShaderFunction(signature);\n * func.addLine(\"v_positionEC = (czm_modelView * vec4(a_position, 1.0)).xyz;\");\n * func.addLine(\"v_texCoord = a_texCoord;\");\n * const generatedLines = func.generateGlslLines();\n *\n * @private\n */\nfunction ShaderFunction(signature) {\n  this.signature = signature;\n  this.body = [];\n}\n\n/**\n * Adds one or more lines to the body of the function\n * @param {string|string[]} lines One or more lines of GLSL code to add to the function body. Do not include any preceding or ending whitespace, but do include the semicolon for each line.\n */\nShaderFunction.prototype.addLines = function (lines) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof lines !== \"string\" && !Array.isArray(lines)) {\n    throw new DeveloperError(\n      `Expected lines to be a string or an array of strings, actual value was ${lines}`\n    );\n  }\n  //>>includeEnd('debug');\n  const body = this.body;\n\n  // Indent the body of the function by 4 spaces\n  if (Array.isArray(lines)) {\n    const length = lines.length;\n    for (let i = 0; i < length; i++) {\n      body.push(`    ${lines[i]}`);\n    }\n  } else {\n    // Single string case\n    body.push(`    ${lines}`);\n  }\n};\n\n/**\n * Generate lines of GLSL code for use with {@link ShaderBuilder}\n * @return {string[]}\n */\nShaderFunction.prototype.generateGlslLines = function () {\n  return [].concat(this.signature, \"{\", this.body, \"}\");\n};\n\nexport default ShaderFunction;\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport defined from \"../Core/defined.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport ShaderDestination from \"./ShaderDestination.js\";\nimport ShaderProgram from \"./ShaderProgram.js\";\nimport ShaderSource from \"./ShaderSource.js\";\nimport ShaderStruct from \"./ShaderStruct.js\";\nimport ShaderFunction from \"./ShaderFunction.js\";\n\n/**\n * An object that makes it easier to build the text of a {@link ShaderProgram}. This tracks GLSL code for both the vertex shader and the fragment shader.\n * <p>\n * For vertex shaders, the shader builder tracks a list of <code>#defines</code>,\n * a list of attributes, a list of uniforms, and a list of shader lines. It also\n * tracks the location of each attribute so the caller can easily build the {@link VertexArray}\n * </p>\n * <p>\n * For fragment shaders, the shader builder tracks a list of <code>#defines</code>,\n * a list of attributes, a list of uniforms, and a list of shader lines.\n * </p>\n *\n * @alias ShaderBuilder\n * @constructor\n *\n * @example\n * const shaderBuilder = new ShaderBuilder();\n * shaderBuilder.addDefine(\"SOLID_COLOR\", undefined, ShaderDestination.FRAGMENT);\n * shaderBuilder.addUniform(\"vec3\", \"u_color\", ShaderDestination.FRAGMENT);\n * shaderBuilder.addVarying(\"vec3\", v_color\");\n * // These locations can be used when creating the VertexArray\n * const positionLocation = shaderBuilder.addPositionAttribute(\"vec3\", \"a_position\");\n * const colorLocation = shaderBuilder.addAttribute(\"vec3\", \"a_color\");\n * shaderBuilder.addVertexLines([\n *  \"void main()\",\n *  \"{\",\n *  \"    v_color = a_color;\",\n *  \"    gl_Position = vec4(a_position, 1.0);\",\n *  \"}\"\n * ]);\n * shaderBuilder.addFragmentLines([\n *  \"void main()\",\n *  \"{\",\n *  \"    #ifdef SOLID_COLOR\",\n *  \"    out_FragColor = vec4(u_color, 1.0);\",\n *  \"    #else\",\n *  \"    out_FragColor = vec4(v_color, 1.0);\",\n *  \"    #endif\",\n *  \"}\"\n * ]);\n * const shaderProgram = shaderBuilder.build(context);\n *\n * @private\n */\nfunction ShaderBuilder() {\n  // Some WebGL implementations require attribute 0 to always\n  // be active, so the position attribute is tracked separately\n  this._positionAttributeLine = undefined;\n  this._nextAttributeLocation = 1;\n  this._attributeLocations = {};\n  this._attributeLines = [];\n\n  // Dynamically-generated structs and functions\n  // these are dictionaries of id -> ShaderStruct or ShaderFunction respectively\n  this._structs = {};\n  this._functions = {};\n\n  this._vertexShaderParts = {\n    defineLines: [],\n    uniformLines: [],\n    shaderLines: [],\n    varyingLines: [],\n    // identifiers of structs/functions to include, listed in insertion order\n    structIds: [],\n    functionIds: [],\n  };\n  this._fragmentShaderParts = {\n    defineLines: [],\n    uniformLines: [],\n    shaderLines: [],\n    varyingLines: [],\n    // identifiers of structs/functions to include, listed in insertion order\n    structIds: [],\n    functionIds: [],\n  };\n}\n\nObject.defineProperties(ShaderBuilder.prototype, {\n  /**\n   * Get a dictionary of attribute names to the integer location in\n   * the vertex shader.\n   *\n   * @memberof ShaderBuilder.prototype\n   * @type {Object<string, number>}\n   * @readonly\n   * @private\n   */\n  attributeLocations: {\n    get: function () {\n      return this._attributeLocations;\n    },\n  },\n});\n\n/**\n * Add a <code>#define</code> macro to one or both of the shaders. These lines\n * will appear at the top of the final shader source.\n *\n * @param {string} identifier An identifier for the macro. Identifiers must use uppercase letters with underscores to be consistent with Cesium's style guide.\n * @param {string} [value] The value of the macro. If undefined, the define will not include a value. The value will be converted to GLSL code via <code>toString()</code>\n * @param {ShaderDestination} [destination=ShaderDestination.BOTH] Whether the define appears in the vertex shader, the fragment shader, or both.\n *\n * @example\n * // creates the line \"#define ENABLE_LIGHTING\" in both shaders\n * shaderBuilder.addDefine(\"ENABLE_LIGHTING\");\n * // creates the line \"#define PI 3.141592\" in the fragment shader\n * shaderBuilder.addDefine(\"PI\", 3.141593, ShaderDestination.FRAGMENT);\n */\nShaderBuilder.prototype.addDefine = function (identifier, value, destination) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"identifier\", identifier);\n  //>>includeEnd('debug');\n\n  destination = defaultValue(destination, ShaderDestination.BOTH);\n\n  // The ShaderSource created in build() will add the #define part\n  let line = identifier;\n  if (defined(value)) {\n    line += ` ${value.toString()}`;\n  }\n\n  if (ShaderDestination.includesVertexShader(destination)) {\n    this._vertexShaderParts.defineLines.push(line);\n  }\n\n  if (ShaderDestination.includesFragmentShader(destination)) {\n    this._fragmentShaderParts.defineLines.push(line);\n  }\n};\n\n/**\n * Add a new dynamically-generated struct to the shader\n * @param {string} structId A unique ID to identify this struct in {@link ShaderBuilder#addStructField}\n * @param {string} structName The name of the struct as it will appear in the shader.\n * @param {ShaderDestination} destination Whether the struct will appear in the vertex shader, the fragment shader, or both.\n *\n * @example\n * // generates the following struct in the fragment shader\n * // struct TestStruct\n * // {\n * // };\n * shaderBuilder.addStruct(\"testStructId\", \"TestStruct\", ShaderDestination.FRAGMENT);\n */\nShaderBuilder.prototype.addStruct = function (\n  structId,\n  structName,\n  destination\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"structId\", structId);\n  Check.typeOf.string(\"structName\", structName);\n  Check.typeOf.number(\"destination\", destination);\n  //>>includeEnd('debug');\n  this._structs[structId] = new ShaderStruct(structName);\n  if (ShaderDestination.includesVertexShader(destination)) {\n    this._vertexShaderParts.structIds.push(structId);\n  }\n\n  if (ShaderDestination.includesFragmentShader(destination)) {\n    this._fragmentShaderParts.structIds.push(structId);\n  }\n};\n\n/**\n * Add a field to a dynamically-generated struct.\n * @param {string} structId The ID of the struct. This must be created first with {@link ShaderBuilder#addStruct}\n * @param {string} type The GLSL type of the field\n * @param {string} identifier The identifier of the field.\n *\n * @example\n * // generates the following struct in the fragment shader\n * // struct TestStruct\n * // {\n * //    float minimum;\n * //    float maximum;\n * // };\n * shaderBuilder.addStruct(\"testStructId\", \"TestStruct\", ShaderDestination.FRAGMENT);\n * shaderBuilder.addStructField(\"testStructId\", \"float\", \"maximum\");\n * shaderBuilder.addStructField(\"testStructId\", \"float\", \"minimum\");\n */\nShaderBuilder.prototype.addStructField = function (structId, type, identifier) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"structId\", structId);\n  Check.typeOf.string(\"type\", type);\n  Check.typeOf.string(\"identifier\", identifier);\n  //>>includeEnd('debug');\n  this._structs[structId].addField(type, identifier);\n};\n\n/**\n * Add a new dynamically-generated function to the shader.\n * @param {string} functionName The name of the function. This will be used to identify the function in {@link ShaderBuilder#addFunctionLines}.\n * @param {string} signature The full signature of the function as it will appear in the shader. Do not include the curly braces.\n * @param {ShaderDestination} destination Whether the struct will appear in the vertex shader, the fragment shader, or both.\n * @example\n * // generates the following function in the vertex shader\n * // vec3 testFunction(float parameter)\n * // {\n * // }\n * shaderBuilder.addStruct(\"testFunction\", \"vec3 testFunction(float parameter)\", ShaderDestination.VERTEX);\n */\nShaderBuilder.prototype.addFunction = function (\n  functionName,\n  signature,\n  destination\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"functionName\", functionName);\n  Check.typeOf.string(\"signature\", signature);\n  Check.typeOf.number(\"destination\", destination);\n  //>>includeEnd('debug');\n  this._functions[functionName] = new ShaderFunction(signature);\n\n  if (ShaderDestination.includesVertexShader(destination)) {\n    this._vertexShaderParts.functionIds.push(functionName);\n  }\n\n  if (ShaderDestination.includesFragmentShader(destination)) {\n    this._fragmentShaderParts.functionIds.push(functionName);\n  }\n};\n\n/**\n * Add lines to a dynamically-generated function\n * @param {string} functionName The name of the function. This must be created beforehand using {@link ShaderBuilder#addFunction}\n * @param {string|string[]} lines One or more lines of GLSL code to add to the function body. Do not include any preceding or ending whitespace, but do include the semicolon for each line.\n *\n * @example\n * // generates the following function in the vertex shader\n * // vec3 testFunction(float parameter)\n * // {\n * //   float signed = 2.0 * parameter - 1.0;\n * //   return vec3(signed, 0.0, 0.0);\n * // }\n * shaderBuilder.addStruct(\"testFunction\", \"vec3 testFunction(float parameter)\", ShaderDestination.VERTEX);\n * shaderBuilder.addFunctionLines(\"testFunction\", [\n *   \"float signed = 2.0 * parameter - 1.0;\",\n *   \"return vec3(parameter);\"\n * ]);\n */\nShaderBuilder.prototype.addFunctionLines = function (functionName, lines) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"functionName\", functionName);\n  if (typeof lines !== \"string\" && !Array.isArray(lines)) {\n    throw new DeveloperError(\n      `Expected lines to be a string or an array of strings, actual value was ${lines}`\n    );\n  }\n  //>>includeEnd('debug');\n  this._functions[functionName].addLines(lines);\n};\n\n/**\n * Add a uniform declaration to one or both of the shaders. These lines\n * will appear grouped near the top of the final shader source.\n *\n * @param {string} type The GLSL type of the uniform.\n * @param {string} identifier An identifier for the uniform. Identifiers must begin with <code>u_</code> to be consistent with Cesium's style guide.\n * @param {ShaderDestination} [destination=ShaderDestination.BOTH] Whether the uniform appears in the vertex shader, the fragment shader, or both.\n *\n * @example\n * // creates the line \"uniform vec3 u_resolution;\"\n * shaderBuilder.addUniform(\"vec3\", \"u_resolution\", ShaderDestination.FRAGMENT);\n * // creates the line \"uniform float u_time;\" in both shaders\n * shaderBuilder.addUniform(\"float\", \"u_time\", ShaderDestination.BOTH);\n */\nShaderBuilder.prototype.addUniform = function (type, identifier, destination) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"type\", type);\n  Check.typeOf.string(\"identifier\", identifier);\n  //>>includeEnd('debug');\n\n  destination = defaultValue(destination, ShaderDestination.BOTH);\n  const line = `uniform ${type} ${identifier};`;\n\n  if (ShaderDestination.includesVertexShader(destination)) {\n    this._vertexShaderParts.uniformLines.push(line);\n  }\n\n  if (ShaderDestination.includesFragmentShader(destination)) {\n    this._fragmentShaderParts.uniformLines.push(line);\n  }\n};\n\n/**\n * Add a position attribute declaration to the vertex shader. These lines\n * will appear grouped near the top of the final shader source.\n * <p>\n * Some WebGL implementations require attribute 0 to be enabled, so this is\n * reserved for the position attribute. For all other attributes, see\n * {@link ShaderBuilder#addAttribute}\n * </p>\n *\n * @param {string} type The GLSL type of the attribute\n * @param {string} identifier An identifier for the attribute. Identifiers must begin with <code>a_</code> to be consistent with Cesium's style guide.\n * @return {number} The integer location of the attribute. This location can be used when creating attributes for a {@link VertexArray}. This will always be 0.\n *\n * @example\n * // creates the line \"in vec3 a_position;\"\n * shaderBuilder.setPositionAttribute(\"vec3\", \"a_position\");\n */\nShaderBuilder.prototype.setPositionAttribute = function (type, identifier) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"type\", type);\n  Check.typeOf.string(\"identifier\", identifier);\n\n  if (defined(this._positionAttributeLine)) {\n    throw new DeveloperError(\n      \"setPositionAttribute() must be called exactly once for the attribute used for gl_Position. For other attributes, use addAttribute()\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._positionAttributeLine = `in ${type} ${identifier};`;\n\n  // Some WebGL implementations require attribute 0 to always be active, so\n  // this builder assumes the position will always go in location 0\n  this._attributeLocations[identifier] = 0;\n  return 0;\n};\n\n/**\n * Add an attribute declaration to the vertex shader. These lines\n * will appear grouped near the top of the final shader source.\n * <p>\n * Some WebGL implementations require attribute 0 to be enabled, so this is\n * reserved for the position attribute. See {@link ShaderBuilder#setPositionAttribute}\n * </p>\n *\n * @param {string} type The GLSL type of the attribute\n * @param {string} identifier An identifier for the attribute. Identifiers must begin with <code>a_</code> to be consistent with Cesium's style guide.\n * @return {number} The integer location of the attribute. This location can be used when creating attributes for a {@link VertexArray}\n *\n * @example\n * // creates the line \"in vec2 a_texCoord0;\" in the vertex shader\n * shaderBuilder.addAttribute(\"vec2\", \"a_texCoord0\");\n */\nShaderBuilder.prototype.addAttribute = function (type, identifier) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"type\", type);\n  Check.typeOf.string(\"identifier\", identifier);\n  //>>includeEnd('debug');\n\n  const line = `in ${type} ${identifier};`;\n  this._attributeLines.push(line);\n\n  const location = this._nextAttributeLocation;\n  this._attributeLocations[identifier] = location;\n\n  // Most attributes only require a single attribute location, but matrices\n  // require more.\n  this._nextAttributeLocation += getAttributeLocationCount(type);\n  return location;\n};\n\n/**\n * Add a varying declaration to both the vertex and fragment shaders.\n *\n * @param {string} type The GLSL type of the varying\n * @param {string} identifier An identifier for the varying. Identifiers must begin with <code>v_</code> to be consistent with Cesium's style guide.\n *\n * @example\n * // creates the line \"in vec3 v_color;\" in the vertex shader\n * // creates the line \"out vec3 v_color;\" in the fragment shader\n * shaderBuilder.addVarying(\"vec3\", \"v_color\");\n */\nShaderBuilder.prototype.addVarying = function (type, identifier) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"type\", type);\n  Check.typeOf.string(\"identifier\", identifier);\n  //>>includeEnd('debug');\n\n  const line = `${type} ${identifier};`;\n  this._vertexShaderParts.varyingLines.push(`out ${line}`);\n  this._fragmentShaderParts.varyingLines.push(`in ${line}`);\n};\n\n/**\n * Appends lines of GLSL code to the vertex shader\n *\n * @param {string|string[]} lines One or more lines to add to the end of the vertex shader source\n *\n * @example\n * shaderBuilder.addVertexLines([\n *  \"void main()\",\n *  \"{\",\n *  \"    v_color = a_color;\",\n *  \"    gl_Position = vec4(a_position, 1.0);\",\n *  \"}\"\n * ]);\n */\nShaderBuilder.prototype.addVertexLines = function (lines) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof lines !== \"string\" && !Array.isArray(lines)) {\n    throw new DeveloperError(\n      `Expected lines to be a string or an array of strings, actual value was ${lines}`\n    );\n  }\n  //>>includeEnd('debug');\n\n  const vertexLines = this._vertexShaderParts.shaderLines;\n  if (Array.isArray(lines)) {\n    vertexLines.push.apply(vertexLines, lines);\n  } else {\n    // Single string case\n    vertexLines.push(lines);\n  }\n};\n\n/**\n * Appends lines of GLSL code to the fragment shader\n *\n * @param {string[]} lines The lines to add to the end of the fragment shader source\n *\n * @example\n * shaderBuilder.addFragmentLines([\n *  \"void main()\",\n *  \"{\",\n *  \"    #ifdef SOLID_COLOR\",\n *  \"    out_FragColor = vec4(u_color, 1.0);\",\n *  \"    #else\",\n *  \"    out_FragColor = vec4(v_color, 1.0);\",\n *  \"    #endif\",\n *  \"}\"\n * ]);\n */\nShaderBuilder.prototype.addFragmentLines = function (lines) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof lines !== \"string\" && !Array.isArray(lines)) {\n    throw new DeveloperError(\n      `Expected lines to be a string or an array of strings, actual value was ${lines}`\n    );\n  }\n  //>>includeEnd('debug');\n\n  const fragmentLines = this._fragmentShaderParts.shaderLines;\n  if (Array.isArray(lines)) {\n    fragmentLines.push.apply(fragmentLines, lines);\n  } else {\n    // Single string case\n    fragmentLines.push(lines);\n  }\n};\n\n/**\n * Builds the {@link ShaderProgram} from the pieces added by the other methods.\n * Call this one time at the end of modifying the shader through the other\n * methods in this class.\n *\n * @param {Context} context The context to use for creating the shader.\n * @return {ShaderProgram} A shader program to use for rendering.\n *\n * @example\n * const shaderProgram = shaderBuilder.buildShaderProgram(context);\n */\nShaderBuilder.prototype.buildShaderProgram = function (context) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"context\", context);\n  //>>includeEnd('debug');\n\n  const positionAttribute = defined(this._positionAttributeLine)\n    ? [this._positionAttributeLine]\n    : [];\n\n  const structLines = generateStructLines(this);\n  const functionLines = generateFunctionLines(this);\n\n  // Lines are joined here so the ShaderSource\n  // generates a single #line 0 directive\n  const vertexLines = positionAttribute\n    .concat(\n      this._attributeLines,\n      this._vertexShaderParts.uniformLines,\n      this._vertexShaderParts.varyingLines,\n      structLines.vertexLines,\n      functionLines.vertexLines,\n      this._vertexShaderParts.shaderLines\n    )\n    .join(\"\\n\");\n  const vertexShaderSource = new ShaderSource({\n    defines: this._vertexShaderParts.defineLines,\n    sources: [vertexLines],\n  });\n\n  const fragmentLines = this._fragmentShaderParts.uniformLines\n    .concat(\n      this._fragmentShaderParts.varyingLines,\n      structLines.fragmentLines,\n      functionLines.fragmentLines,\n      this._fragmentShaderParts.shaderLines\n    )\n    .join(\"\\n\");\n  const fragmentShaderSource = new ShaderSource({\n    defines: this._fragmentShaderParts.defineLines,\n    sources: [fragmentLines],\n  });\n\n  return ShaderProgram.fromCache({\n    context: context,\n    vertexShaderSource: vertexShaderSource,\n    fragmentShaderSource: fragmentShaderSource,\n    attributeLocations: this._attributeLocations,\n  });\n};\n\nShaderBuilder.prototype.clone = function () {\n  return clone(this, true);\n};\n\nfunction generateStructLines(shaderBuilder) {\n  const vertexLines = [];\n  const fragmentLines = [];\n\n  let i;\n  let structIds = shaderBuilder._vertexShaderParts.structIds;\n  let structId;\n  let struct;\n  let structLines;\n  for (i = 0; i < structIds.length; i++) {\n    structId = structIds[i];\n    struct = shaderBuilder._structs[structId];\n    structLines = struct.generateGlslLines();\n    vertexLines.push.apply(vertexLines, structLines);\n  }\n\n  structIds = shaderBuilder._fragmentShaderParts.structIds;\n  for (i = 0; i < structIds.length; i++) {\n    structId = structIds[i];\n    struct = shaderBuilder._structs[structId];\n    structLines = struct.generateGlslLines();\n    fragmentLines.push.apply(fragmentLines, structLines);\n  }\n\n  return {\n    vertexLines: vertexLines,\n    fragmentLines: fragmentLines,\n  };\n}\n\nfunction getAttributeLocationCount(glslType) {\n  switch (glslType) {\n    case \"mat2\":\n      return 2;\n    case \"mat3\":\n      return 3;\n    case \"mat4\":\n      return 4;\n    default:\n      return 1;\n  }\n}\n\nfunction generateFunctionLines(shaderBuilder) {\n  const vertexLines = [];\n  const fragmentLines = [];\n\n  let i;\n  let functionIds = shaderBuilder._vertexShaderParts.functionIds;\n  let functionId;\n  let func;\n  let functionLines;\n  for (i = 0; i < functionIds.length; i++) {\n    functionId = functionIds[i];\n    func = shaderBuilder._functions[functionId];\n    functionLines = func.generateGlslLines();\n    vertexLines.push.apply(vertexLines, functionLines);\n  }\n\n  functionIds = shaderBuilder._fragmentShaderParts.functionIds;\n  for (i = 0; i < functionIds.length; i++) {\n    functionId = functionIds[i];\n    func = shaderBuilder._functions[functionId];\n    functionLines = func.generateGlslLines();\n    fragmentLines.push.apply(fragmentLines, functionLines);\n  }\n\n  return {\n    vertexLines: vertexLines,\n    fragmentLines: fragmentLines,\n  };\n}\n\nexport default ShaderBuilder;\n", "import Check from \"../Core/Check.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Buffer from \"./Buffer.js\";\nimport BufferUsage from \"./BufferUsage.js\";\nimport VertexArray from \"./VertexArray.js\";\n\n/**\n * @private\n */\nfunction VertexArrayFacade(context, attributes, sizeInVertices, instanced) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"context\", context);\n  if (!attributes || attributes.length === 0) {\n    throw new DeveloperError(\"At least one attribute is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const attrs = VertexArrayFacade._verifyAttributes(attributes);\n  sizeInVertices = defaultValue(sizeInVertices, 0);\n  const precreatedAttributes = [];\n  const attributesByUsage = {};\n  let attributesForUsage;\n  let usage;\n\n  // Bucket the attributes by usage.\n  const length = attrs.length;\n  for (let i = 0; i < length; ++i) {\n    const attribute = attrs[i];\n\n    // If the attribute already has a vertex buffer, we do not need\n    // to manage a vertex buffer or typed array for it.\n    if (attribute.vertexBuffer) {\n      precreatedAttributes.push(attribute);\n      continue;\n    }\n\n    usage = attribute.usage;\n    attributesForUsage = attributesByUsage[usage];\n    if (!defined(attributesForUsage)) {\n      attributesForUsage = attributesByUsage[usage] = [];\n    }\n\n    attributesForUsage.push(attribute);\n  }\n\n  // A function to sort attributes by the size of their components.  From left to right, a vertex\n  // stores floats, shorts, and then bytes.\n  function compare(left, right) {\n    return (\n      ComponentDatatype.getSizeInBytes(right.componentDatatype) -\n      ComponentDatatype.getSizeInBytes(left.componentDatatype)\n    );\n  }\n\n  this._allBuffers = [];\n\n  for (usage in attributesByUsage) {\n    if (attributesByUsage.hasOwnProperty(usage)) {\n      attributesForUsage = attributesByUsage[usage];\n\n      attributesForUsage.sort(compare);\n      const vertexSizeInBytes = VertexArrayFacade._vertexSizeInBytes(\n        attributesForUsage\n      );\n\n      const bufferUsage = attributesForUsage[0].usage;\n\n      const buffer = {\n        vertexSizeInBytes: vertexSizeInBytes,\n        vertexBuffer: undefined,\n        usage: bufferUsage,\n        needsCommit: false,\n        arrayBuffer: undefined,\n        arrayViews: VertexArrayFacade._createArrayViews(\n          attributesForUsage,\n          vertexSizeInBytes\n        ),\n      };\n\n      this._allBuffers.push(buffer);\n    }\n  }\n\n  this._size = 0;\n  this._instanced = defaultValue(instanced, false);\n\n  this._precreated = precreatedAttributes;\n  this._context = context;\n\n  this.writers = undefined;\n  this.va = undefined;\n\n  this.resize(sizeInVertices);\n}\nVertexArrayFacade._verifyAttributes = function (attributes) {\n  const attrs = [];\n\n  for (let i = 0; i < attributes.length; ++i) {\n    const attribute = attributes[i];\n\n    const attr = {\n      index: defaultValue(attribute.index, i),\n      enabled: defaultValue(attribute.enabled, true),\n      componentsPerAttribute: attribute.componentsPerAttribute,\n      componentDatatype: defaultValue(\n        attribute.componentDatatype,\n        ComponentDatatype.FLOAT\n      ),\n      normalize: defaultValue(attribute.normalize, false),\n\n      // There will be either a vertexBuffer or an [optional] usage.\n      vertexBuffer: attribute.vertexBuffer,\n      usage: defaultValue(attribute.usage, BufferUsage.STATIC_DRAW),\n    };\n    attrs.push(attr);\n\n    //>>includeStart('debug', pragmas.debug);\n    if (\n      attr.componentsPerAttribute !== 1 &&\n      attr.componentsPerAttribute !== 2 &&\n      attr.componentsPerAttribute !== 3 &&\n      attr.componentsPerAttribute !== 4\n    ) {\n      throw new DeveloperError(\n        \"attribute.componentsPerAttribute must be in the range [1, 4].\"\n      );\n    }\n\n    const datatype = attr.componentDatatype;\n    if (!ComponentDatatype.validate(datatype)) {\n      throw new DeveloperError(\n        \"Attribute must have a valid componentDatatype or not specify it.\"\n      );\n    }\n\n    if (!BufferUsage.validate(attr.usage)) {\n      throw new DeveloperError(\n        \"Attribute must have a valid usage or not specify it.\"\n      );\n    }\n    //>>includeEnd('debug');\n  }\n\n  // Verify all attribute names are unique.\n  const uniqueIndices = new Array(attrs.length);\n  for (let j = 0; j < attrs.length; ++j) {\n    const currentAttr = attrs[j];\n    const index = currentAttr.index;\n    //>>includeStart('debug', pragmas.debug);\n    if (uniqueIndices[index]) {\n      throw new DeveloperError(\n        `Index ${index} is used by more than one attribute.`\n      );\n    }\n    //>>includeEnd('debug');\n    uniqueIndices[index] = true;\n  }\n\n  return attrs;\n};\n\nVertexArrayFacade._vertexSizeInBytes = function (attributes) {\n  let sizeInBytes = 0;\n\n  const length = attributes.length;\n  for (let i = 0; i < length; ++i) {\n    const attribute = attributes[i];\n    sizeInBytes +=\n      attribute.componentsPerAttribute *\n      ComponentDatatype.getSizeInBytes(attribute.componentDatatype);\n  }\n\n  const maxComponentSizeInBytes =\n    length > 0\n      ? ComponentDatatype.getSizeInBytes(attributes[0].componentDatatype)\n      : 0; // Sorted by size\n  const remainder =\n    maxComponentSizeInBytes > 0 ? sizeInBytes % maxComponentSizeInBytes : 0;\n  const padding = remainder === 0 ? 0 : maxComponentSizeInBytes - remainder;\n  sizeInBytes += padding;\n\n  return sizeInBytes;\n};\n\nVertexArrayFacade._createArrayViews = function (attributes, vertexSizeInBytes) {\n  const views = [];\n  let offsetInBytes = 0;\n\n  const length = attributes.length;\n  for (let i = 0; i < length; ++i) {\n    const attribute = attributes[i];\n    const componentDatatype = attribute.componentDatatype;\n\n    views.push({\n      index: attribute.index,\n      enabled: attribute.enabled,\n      componentsPerAttribute: attribute.componentsPerAttribute,\n      componentDatatype: componentDatatype,\n      normalize: attribute.normalize,\n\n      offsetInBytes: offsetInBytes,\n      vertexSizeInComponentType:\n        vertexSizeInBytes / ComponentDatatype.getSizeInBytes(componentDatatype),\n\n      view: undefined,\n    });\n\n    offsetInBytes +=\n      attribute.componentsPerAttribute *\n      ComponentDatatype.getSizeInBytes(componentDatatype);\n  }\n\n  return views;\n};\n\n/**\n * Invalidates writers.  Can't render again until commit is called.\n */\nVertexArrayFacade.prototype.resize = function (sizeInVertices) {\n  this._size = sizeInVertices;\n\n  const allBuffers = this._allBuffers;\n  this.writers = [];\n\n  for (let i = 0, len = allBuffers.length; i < len; ++i) {\n    const buffer = allBuffers[i];\n\n    VertexArrayFacade._resize(buffer, this._size);\n\n    // Reserving invalidates the writers, so if client's cache them, they need to invalidate their cache.\n    VertexArrayFacade._appendWriters(this.writers, buffer);\n  }\n\n  // VAs are recreated next time commit is called.\n  destroyVA(this);\n};\n\nVertexArrayFacade._resize = function (buffer, size) {\n  if (buffer.vertexSizeInBytes > 0) {\n    // Create larger array buffer\n    const arrayBuffer = new ArrayBuffer(size * buffer.vertexSizeInBytes);\n\n    // Copy contents from previous array buffer\n    if (defined(buffer.arrayBuffer)) {\n      const destView = new Uint8Array(arrayBuffer);\n      const sourceView = new Uint8Array(buffer.arrayBuffer);\n      const sourceLength = sourceView.length;\n      for (let j = 0; j < sourceLength; ++j) {\n        destView[j] = sourceView[j];\n      }\n    }\n\n    // Create typed views into the new array buffer\n    const views = buffer.arrayViews;\n    const length = views.length;\n    for (let i = 0; i < length; ++i) {\n      const view = views[i];\n      view.view = ComponentDatatype.createArrayBufferView(\n        view.componentDatatype,\n        arrayBuffer,\n        view.offsetInBytes\n      );\n    }\n\n    buffer.arrayBuffer = arrayBuffer;\n  }\n};\n\nconst createWriters = [\n  // 1 component per attribute\n  function (buffer, view, vertexSizeInComponentType) {\n    return function (index, attribute) {\n      view[index * vertexSizeInComponentType] = attribute;\n      buffer.needsCommit = true;\n    };\n  },\n\n  // 2 component per attribute\n  function (buffer, view, vertexSizeInComponentType) {\n    return function (index, component0, component1) {\n      const i = index * vertexSizeInComponentType;\n      view[i] = component0;\n      view[i + 1] = component1;\n      buffer.needsCommit = true;\n    };\n  },\n\n  // 3 component per attribute\n  function (buffer, view, vertexSizeInComponentType) {\n    return function (index, component0, component1, component2) {\n      const i = index * vertexSizeInComponentType;\n      view[i] = component0;\n      view[i + 1] = component1;\n      view[i + 2] = component2;\n      buffer.needsCommit = true;\n    };\n  },\n\n  // 4 component per attribute\n  function (buffer, view, vertexSizeInComponentType) {\n    return function (index, component0, component1, component2, component3) {\n      const i = index * vertexSizeInComponentType;\n      view[i] = component0;\n      view[i + 1] = component1;\n      view[i + 2] = component2;\n      view[i + 3] = component3;\n      buffer.needsCommit = true;\n    };\n  },\n];\n\nVertexArrayFacade._appendWriters = function (writers, buffer) {\n  const arrayViews = buffer.arrayViews;\n  const length = arrayViews.length;\n  for (let i = 0; i < length; ++i) {\n    const arrayView = arrayViews[i];\n    writers[arrayView.index] = createWriters[\n      arrayView.componentsPerAttribute - 1\n    ](buffer, arrayView.view, arrayView.vertexSizeInComponentType);\n  }\n};\n\nVertexArrayFacade.prototype.commit = function (indexBuffer) {\n  let recreateVA = false;\n\n  const allBuffers = this._allBuffers;\n  let buffer;\n  let i;\n  let length;\n\n  for (i = 0, length = allBuffers.length; i < length; ++i) {\n    buffer = allBuffers[i];\n    recreateVA = commit(this, buffer) || recreateVA;\n  }\n\n  ///////////////////////////////////////////////////////////////////////\n\n  if (recreateVA || !defined(this.va)) {\n    destroyVA(this);\n    const va = (this.va = []);\n\n    const chunkSize = CesiumMath.SIXTY_FOUR_KILOBYTES - 4; // The 65535 index is reserved for primitive restart. Reserve the last 4 indices so that billboard quads are not broken up.\n    const numberOfVertexArrays =\n      defined(indexBuffer) && !this._instanced\n        ? Math.ceil(this._size / chunkSize)\n        : 1;\n    for (let k = 0; k < numberOfVertexArrays; ++k) {\n      let attributes = [];\n      for (i = 0, length = allBuffers.length; i < length; ++i) {\n        buffer = allBuffers[i];\n        const offset = k * (buffer.vertexSizeInBytes * chunkSize);\n        VertexArrayFacade._appendAttributes(\n          attributes,\n          buffer,\n          offset,\n          this._instanced\n        );\n      }\n\n      attributes = attributes.concat(this._precreated);\n\n      va.push({\n        va: new VertexArray({\n          context: this._context,\n          attributes: attributes,\n          indexBuffer: indexBuffer,\n        }),\n        indicesCount:\n          1.5 *\n          (k !== numberOfVertexArrays - 1 ? chunkSize : this._size % chunkSize),\n        // TODO: not hardcode 1.5, this assumes 6 indices per 4 vertices (as for Billboard quads).\n      });\n    }\n  }\n};\n\nfunction commit(vertexArrayFacade, buffer) {\n  if (buffer.needsCommit && buffer.vertexSizeInBytes > 0) {\n    buffer.needsCommit = false;\n\n    const vertexBuffer = buffer.vertexBuffer;\n    const vertexBufferSizeInBytes =\n      vertexArrayFacade._size * buffer.vertexSizeInBytes;\n    const vertexBufferDefined = defined(vertexBuffer);\n    if (\n      !vertexBufferDefined ||\n      vertexBuffer.sizeInBytes < vertexBufferSizeInBytes\n    ) {\n      if (vertexBufferDefined) {\n        vertexBuffer.destroy();\n      }\n      buffer.vertexBuffer = Buffer.createVertexBuffer({\n        context: vertexArrayFacade._context,\n        typedArray: buffer.arrayBuffer,\n        usage: buffer.usage,\n      });\n      buffer.vertexBuffer.vertexArrayDestroyable = false;\n\n      return true; // Created new vertex buffer\n    }\n\n    buffer.vertexBuffer.copyFromArrayView(buffer.arrayBuffer);\n  }\n\n  return false; // Did not create new vertex buffer\n}\n\nVertexArrayFacade._appendAttributes = function (\n  attributes,\n  buffer,\n  vertexBufferOffset,\n  instanced\n) {\n  const arrayViews = buffer.arrayViews;\n  const length = arrayViews.length;\n  for (let i = 0; i < length; ++i) {\n    const view = arrayViews[i];\n\n    attributes.push({\n      index: view.index,\n      enabled: view.enabled,\n      componentsPerAttribute: view.componentsPerAttribute,\n      componentDatatype: view.componentDatatype,\n      normalize: view.normalize,\n      vertexBuffer: buffer.vertexBuffer,\n      offsetInBytes: vertexBufferOffset + view.offsetInBytes,\n      strideInBytes: buffer.vertexSizeInBytes,\n      instanceDivisor: instanced ? 1 : 0,\n    });\n  }\n};\n\nVertexArrayFacade.prototype.subCommit = function (\n  offsetInVertices,\n  lengthInVertices\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (offsetInVertices < 0 || offsetInVertices >= this._size) {\n    throw new DeveloperError(\n      \"offsetInVertices must be greater than or equal to zero and less than the vertex array size.\"\n    );\n  }\n  if (offsetInVertices + lengthInVertices > this._size) {\n    throw new DeveloperError(\n      \"offsetInVertices + lengthInVertices cannot exceed the vertex array size.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const allBuffers = this._allBuffers;\n  for (let i = 0, len = allBuffers.length; i < len; ++i) {\n    subCommit(allBuffers[i], offsetInVertices, lengthInVertices);\n  }\n};\n\nfunction subCommit(buffer, offsetInVertices, lengthInVertices) {\n  if (buffer.needsCommit && buffer.vertexSizeInBytes > 0) {\n    const byteOffset = buffer.vertexSizeInBytes * offsetInVertices;\n    const byteLength = buffer.vertexSizeInBytes * lengthInVertices;\n\n    // PERFORMANCE_IDEA: If we want to get really crazy, we could consider updating\n    // individual attributes instead of the entire (sub-)vertex.\n    //\n    // PERFORMANCE_IDEA: Does creating the typed view add too much GC overhead?\n    buffer.vertexBuffer.copyFromArrayView(\n      new Uint8Array(buffer.arrayBuffer, byteOffset, byteLength),\n      byteOffset\n    );\n  }\n}\n\nVertexArrayFacade.prototype.endSubCommits = function () {\n  const allBuffers = this._allBuffers;\n\n  for (let i = 0, len = allBuffers.length; i < len; ++i) {\n    allBuffers[i].needsCommit = false;\n  }\n};\n\nfunction destroyVA(vertexArrayFacade) {\n  const va = vertexArrayFacade.va;\n  if (!defined(va)) {\n    return;\n  }\n\n  const length = va.length;\n  for (let i = 0; i < length; ++i) {\n    va[i].va.destroy();\n  }\n\n  vertexArrayFacade.va = undefined;\n}\n\nVertexArrayFacade.prototype.isDestroyed = function () {\n  return false;\n};\n\nVertexArrayFacade.prototype.destroy = function () {\n  const allBuffers = this._allBuffers;\n  for (let i = 0, len = allBuffers.length; i < len; ++i) {\n    const buffer = allBuffers[i];\n    buffer.vertexBuffer = buffer.vertexBuffer && buffer.vertexBuffer.destroy();\n  }\n\n  destroyVA(this);\n\n  return destroyObject(this);\n};\nexport default VertexArrayFacade;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Resource from \"../Core/Resource.js\";\nimport CubeMap from \"./CubeMap.js\";\n\n/**\n * Asynchronously loads six images and creates a cube map.  Returns a promise that\n * will resolve to a {@link CubeMap} once loaded, or reject if any image fails to load.\n *\n * @function loadCubeMap\n *\n * @param {Context} context The context to use to create the cube map.\n * @param {object} urls The source URL of each image.  See the example below.\n * @param {boolean} [skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the images will be ignored.\n * @returns {Promise<CubeMap>} a promise that will resolve to the requested {@link CubeMap} when loaded.\n *\n * @exception {DeveloperError} context is required.\n * @exception {DeveloperError} urls is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.\n *\n *\n * @example\n * Cesium.loadCubeMap(context, {\n *     positiveX : 'skybox_px.png',\n *     negativeX : 'skybox_nx.png',\n *     positiveY : 'skybox_py.png',\n *     negativeY : 'skybox_ny.png',\n *     positiveZ : 'skybox_pz.png',\n *     negativeZ : 'skybox_nz.png'\n * }).then(function(cubeMap) {\n *     // use the cubemap\n * }).catch(function(error) {\n *     // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n *\n * @private\n */\nfunction loadCubeMap(context, urls, skipColorSpaceConversion) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"context\", context);\n  if (\n    !defined(urls) ||\n    !defined(urls.positiveX) ||\n    !defined(urls.negativeX) ||\n    !defined(urls.positiveY) ||\n    !defined(urls.negativeY) ||\n    !defined(urls.positiveZ) ||\n    !defined(urls.negativeZ)\n  ) {\n    throw new DeveloperError(\n      \"urls is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  // PERFORMANCE_IDEA: Given the size of some cube maps, we should consider tiling them, which\n  // would prevent hiccups when uploading, for example, six 4096x4096 textures to the GPU.\n  //\n  // Also, it is perhaps acceptable to use the context here in the callbacks, but\n  // ideally, we would do it in the primitive's update function.\n  const flipOptions = {\n    flipY: true,\n    skipColorSpaceConversion: skipColorSpaceConversion,\n    preferImageBitmap: true,\n  };\n\n  const facePromises = [\n    Resource.createIfNeeded(urls.positiveX).fetchImage(flipOptions),\n    Resource.createIfNeeded(urls.negativeX).fetchImage(flipOptions),\n    Resource.createIfNeeded(urls.positiveY).fetchImage(flipOptions),\n    Resource.createIfNeeded(urls.negativeY).fetchImage(flipOptions),\n    Resource.createIfNeeded(urls.positiveZ).fetchImage(flipOptions),\n    Resource.createIfNeeded(urls.negativeZ).fetchImage(flipOptions),\n  ];\n\n  return Promise.all(facePromises).then(function (images) {\n    return new CubeMap({\n      context: context,\n      source: {\n        positiveX: images[0],\n        negativeX: images[1],\n        positiveY: images[2],\n        negativeY: images[3],\n        positiveZ: images[4],\n        negativeZ: images[5],\n      },\n    });\n  });\n}\nexport default loadCubeMap;\n", "import defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\n\n/**\n * A {@link Property} whose value does not change with respect to simulation time.\n *\n * @alias ConstantProperty\n * @constructor\n *\n * @param {*} [value] The property value.\n *\n * @see ConstantPositionProperty\n */\nfunction ConstantProperty(value) {\n  this._value = undefined;\n  this._hasClone = false;\n  this._hasEquals = false;\n  this._definitionChanged = new Event();\n  this.setValue(value);\n}\n\nObject.defineProperties(ConstantProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.\n   * This property always returns <code>true</code>.\n   * @memberof ConstantProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    value: true,\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is changed whenever setValue is called with data different\n   * than the current value.\n   * @memberof ConstantProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n});\n\n/**\n * Gets the value of the property.\n *\n * @param {JulianDate} [time] The time for which to retrieve the value.  This parameter is unused since the value does not change with respect to time.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nConstantProperty.prototype.getValue = function (time, result) {\n  return this._hasClone ? this._value.clone(result) : this._value;\n};\n\n/**\n * Sets the value of the property.\n *\n * @param {*} value The property value.\n */\nConstantProperty.prototype.setValue = function (value) {\n  const oldValue = this._value;\n  if (oldValue !== value) {\n    const isDefined = defined(value);\n    const hasClone = isDefined && typeof value.clone === \"function\";\n    const hasEquals = isDefined && typeof value.equals === \"function\";\n\n    const changed = !hasEquals || !value.equals(oldValue);\n    if (changed) {\n      this._hasClone = hasClone;\n      this._hasEquals = hasEquals;\n      this._value = !hasClone ? value : value.clone(this._value);\n      this._definitionChanged.raiseEvent(this);\n    }\n  }\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nConstantProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof ConstantProperty && //\n      ((!this._hasEquals && this._value === other._value) || //\n        (this._hasEquals && this._value.equals(other._value))))\n  );\n};\n\n/**\n * Gets this property's value.\n *\n * @returns {*} This property's value.\n */\nConstantProperty.prototype.valueOf = function () {\n  return this._value;\n};\n\n/**\n * Creates a string representing this property's value.\n *\n * @returns {string} A string representing the property's value.\n */\nConstantProperty.prototype.toString = function () {\n  return String(this._value);\n};\nexport default ConstantProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\n\nfunction createProperty(\n  name,\n  privateName,\n  subscriptionName,\n  configurable,\n  createPropertyCallback\n) {\n  return {\n    configurable: configurable,\n    get: function () {\n      return this[privateName];\n    },\n    set: function (value) {\n      const oldValue = this[privateName];\n      const subscription = this[subscriptionName];\n      if (defined(subscription)) {\n        subscription();\n        this[subscriptionName] = undefined;\n      }\n\n      const hasValue = value !== undefined;\n      if (\n        hasValue &&\n        (!defined(value) || !defined(value.getValue)) &&\n        defined(createPropertyCallback)\n      ) {\n        value = createPropertyCallback(value);\n      }\n\n      if (oldValue !== value) {\n        this[privateName] = value;\n        this._definitionChanged.raiseEvent(this, name, value, oldValue);\n      }\n\n      if (defined(value) && defined(value.definitionChanged)) {\n        this[subscriptionName] = value.definitionChanged.addEventListener(\n          function () {\n            this._definitionChanged.raiseEvent(this, name, value, value);\n          },\n          this\n        );\n      }\n    },\n  };\n}\n\nfunction createConstantProperty(value) {\n  return new ConstantProperty(value);\n}\n\n/**\n * Used to consistently define all DataSources graphics objects.\n * This is broken into two functions because the Chrome profiler does a better\n * job of optimizing lookups if it notices that the string is constant throughout the function.\n * @private\n */\nfunction createPropertyDescriptor(name, configurable, createPropertyCallback) {\n  //Safari 8.0.3 has a JavaScript bug that causes it to confuse two variables and treat them as the same.\n  //The two extra toString calls work around the issue.\n  return createProperty(\n    name,\n    `_${name.toString()}`,\n    `_${name.toString()}Subscription`,\n    defaultValue(configurable, false),\n    defaultValue(createPropertyCallback, createConstantProperty)\n  );\n}\nexport default createPropertyDescriptor;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {object} BillboardGraphics.ConstructorOptions\n *\n * Initialization options for the BillboardGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the billboard.\n * @property {Property | string | HTMLCanvasElement} [image] A Property specifying the Image, URI, or Canvas to use for the billboard.\n * @property {Property | number} [scale=1.0] A numeric Property specifying the scale to apply to the image size.\n * @property {Property | Cartesian2} [pixelOffset=Cartesian2.ZERO] A {@link Cartesian2} Property specifying the pixel offset.\n * @property {Property | Cartesian3} [eyeOffset=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the eye offset.\n * @property {Property | HorizontalOrigin} [horizontalOrigin=HorizontalOrigin.CENTER] A Property specifying the {@link HorizontalOrigin}.\n * @property {Property | VerticalOrigin} [verticalOrigin=VerticalOrigin.CENTER] A Property specifying the {@link VerticalOrigin}.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | Color} [color=Color.WHITE] A Property specifying the tint {@link Color} of the image.\n * @property {Property | number} [rotation=0] A numeric Property specifying the rotation about the alignedAxis.\n * @property {Property | Cartesian3} [alignedAxis=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the unit vector axis of rotation.\n * @property {Property | boolean} [sizeInMeters] A boolean Property specifying whether this billboard's size should be measured in meters.\n * @property {Property | number} [width] A numeric Property specifying the width of the billboard in pixels, overriding the native size.\n * @property {Property | number} [height] A numeric Property specifying the height of the billboard in pixels, overriding the native size.\n * @property {Property | NearFarScalar} [scaleByDistance] A {@link NearFarScalar} Property used to scale the point based on distance from the camera.\n * @property {Property | NearFarScalar} [translucencyByDistance] A {@link NearFarScalar} Property used to set translucency based on distance from the camera.\n * @property {Property | NearFarScalar} [pixelOffsetScaleByDistance] A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.\n * @property {Property | BoundingRectangle} [imageSubRegion] A Property specifying a {@link BoundingRectangle} that defines a sub-region of the image to use for the billboard, rather than the entire image, measured in pixels from the bottom-left.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this billboard will be displayed.\n * @property {Property | number} [disableDepthTestDistance] A Property specifying the distance from the camera at which to disable the depth test to.\n */\n\n/**\n * Describes a two dimensional icon located at the position of the containing {@link Entity}.\n * <p>\n * <div align='center'>\n * <img src='Images/Billboard.png' width='400' height='300' /><br />\n * Example billboards\n * </div>\n * </p>\n *\n * @alias BillboardGraphics\n * @constructor\n *\n * @param {BillboardGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Billboards.html|Cesium Sandcastle Billboard Demo}\n */\nfunction BillboardGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._image = undefined;\n  this._imageSubscription = undefined;\n  this._scale = undefined;\n  this._scaleSubscription = undefined;\n  this._pixelOffset = undefined;\n  this._pixelOffsetSubscription = undefined;\n  this._eyeOffset = undefined;\n  this._eyeOffsetSubscription = undefined;\n  this._horizontalOrigin = undefined;\n  this._horizontalOriginSubscription = undefined;\n  this._verticalOrigin = undefined;\n  this._verticalOriginSubscription = undefined;\n  this._heightReference = undefined;\n  this._heightReferenceSubscription = undefined;\n  this._color = undefined;\n  this._colorSubscription = undefined;\n  this._rotation = undefined;\n  this._rotationSubscription = undefined;\n  this._alignedAxis = undefined;\n  this._alignedAxisSubscription = undefined;\n  this._sizeInMeters = undefined;\n  this._sizeInMetersSubscription = undefined;\n  this._width = undefined;\n  this._widthSubscription = undefined;\n  this._height = undefined;\n  this._heightSubscription = undefined;\n  this._scaleByDistance = undefined;\n  this._scaleByDistanceSubscription = undefined;\n  this._translucencyByDistance = undefined;\n  this._translucencyByDistanceSubscription = undefined;\n  this._pixelOffsetScaleByDistance = undefined;\n  this._pixelOffsetScaleByDistanceSubscription = undefined;\n  this._imageSubRegion = undefined;\n  this._imageSubRegionSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distanceDisplayConditionSubscription = undefined;\n  this._disableDepthTestDistance = undefined;\n  this._disableDepthTestDistanceSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(BillboardGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof BillboardGraphics.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the billboard.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets the Property specifying the Image, URI, or Canvas to use for the billboard.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   */\n  image: createPropertyDescriptor(\"image\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the uniform scale to apply to the image.\n   * A scale greater than <code>1.0</code> enlarges the billboard while a scale less than <code>1.0</code> shrinks it.\n   * <p>\n   * <div align='center'>\n   * <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>\n   * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>, and <code>2.0</code>.\n   * </div>\n   * </p>\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  scale: createPropertyDescriptor(\"scale\"),\n\n  /**\n   * Gets or sets the {@link Cartesian2} Property specifying the billboard's pixel offset in screen space\n   * from the origin of this billboard.  This is commonly used to align multiple billboards and labels at\n   * the same position, e.g., an image and text.  The screen space origin is the top, left corner of the\n   * canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.\n   * <p>\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>\n   * <td align='center'><code>b.pixeloffset = new Cartesian2(50, 25);</code><br/><img src='Images/Billboard.setPixelOffset.x50y-25.png' width='250' height='188' /></td>\n   * </tr></table>\n   * The billboard's origin is indicated by the yellow point.\n   * </div>\n   * </p>\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   * @default Cartesian2.ZERO\n   */\n  pixelOffset: createPropertyDescriptor(\"pixelOffset\"),\n\n  /**\n   * Gets or sets the {@link Cartesian3} Property specifying the billboard's offset in eye coordinates.\n   * Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's\n   * right, <code>y</code> points up, and <code>z</code> points into the screen.\n   * <p>\n   * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to\n   * arrange a billboard above its corresponding 3D model.\n   * </p>\n   * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always\n   * appear on top of the Earth regardless of the viewer's or Earth's orientation.\n   * <p>\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>\n   * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>\n   * </tr></table>\n   * <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code>\n   * </div>\n   * </p>\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   * @default Cartesian3.ZERO\n   */\n  eyeOffset: createPropertyDescriptor(\"eyeOffset\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link HorizontalOrigin}.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   * @default HorizontalOrigin.CENTER\n   */\n  horizontalOrigin: createPropertyDescriptor(\"horizontalOrigin\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link VerticalOrigin}.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   * @default VerticalOrigin.CENTER\n   */\n  verticalOrigin: createPropertyDescriptor(\"verticalOrigin\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link HeightReference}.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   * @default HeightReference.NONE\n   */\n  heightReference: createPropertyDescriptor(\"heightReference\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} that is multiplied with the <code>image</code>.\n   * This has two common use cases.  First, the same white texture may be used by many different billboards,\n   * each with a different color, to create colored billboards. Second, the color's alpha component can be\n   * used to make the billboard translucent as shown below. An alpha of <code>0.0</code> makes the billboard\n   * transparent, and <code>1.0</code> makes the billboard opaque.\n   * <p>\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>\n   * <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>\n   * </tr></table>\n   * </div>\n   * </p>\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   * @default Color.WHITE\n   */\n  color: createPropertyDescriptor(\"color\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the rotation of the image\n   * counter clockwise from the <code>alignedAxis</code>.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0\n   */\n  rotation: createPropertyDescriptor(\"rotation\"),\n\n  /**\n   * Gets or sets the {@link Cartesian3} Property specifying the unit vector axis of rotation\n   * in the fixed frame. When set to Cartesian3.ZERO the rotation is from the top of the screen.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   * @default Cartesian3.ZERO\n   */\n  alignedAxis: createPropertyDescriptor(\"alignedAxis\"),\n\n  /**\n   * Gets or sets the boolean Property specifying if this billboard's size will be measured in meters.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   * @default false\n   */\n  sizeInMeters: createPropertyDescriptor(\"sizeInMeters\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the width of the billboard in pixels.\n   * When undefined, the native width is used.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   */\n  width: createPropertyDescriptor(\"width\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the height of the billboard in pixels.\n   * When undefined, the native height is used.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   */\n  height: createPropertyDescriptor(\"height\"),\n\n  /**\n   * Gets or sets {@link NearFarScalar} Property specifying the scale of the billboard based on the distance from the camera.\n   * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the billboard's scale remains clamped to the nearest bound.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   */\n  scaleByDistance: createPropertyDescriptor(\"scaleByDistance\"),\n\n  /**\n   * Gets or sets {@link NearFarScalar} Property specifying the translucency of the billboard based on the distance from the camera.\n   * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the billboard's translucency remains clamped to the nearest bound.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   */\n  translucencyByDistance: createPropertyDescriptor(\"translucencyByDistance\"),\n\n  /**\n   * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the billboard based on the distance from the camera.\n   * A billboard's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the billboard's pixel offset remains clamped to the nearest bound.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   */\n  pixelOffsetScaleByDistance: createPropertyDescriptor(\n    \"pixelOffsetScaleByDistance\"\n  ),\n\n  /**\n   * Gets or sets the Property specifying a {@link BoundingRectangle} that defines a\n   * sub-region of the <code>image</code> to use for the billboard, rather than the entire image,\n   * measured in pixels from the bottom-left.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   */\n  imageSubRegion: createPropertyDescriptor(\"imageSubRegion\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this billboard will be displayed.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n\n  /**\n   * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.\n   * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.\n   * @memberof BillboardGraphics.prototype\n   * @type {Property|undefined}\n   */\n  disableDepthTestDistance: createPropertyDescriptor(\n    \"disableDepthTestDistance\"\n  ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {BillboardGraphics} [result] The object onto which to store the result.\n * @returns {BillboardGraphics} The modified result parameter or a new instance if one was not provided.\n */\nBillboardGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new BillboardGraphics(this);\n  }\n  result.show = this._show;\n  result.image = this._image;\n  result.scale = this._scale;\n  result.pixelOffset = this._pixelOffset;\n  result.eyeOffset = this._eyeOffset;\n  result.horizontalOrigin = this._horizontalOrigin;\n  result.verticalOrigin = this._verticalOrigin;\n  result.heightReference = this._heightReference;\n  result.color = this._color;\n  result.rotation = this._rotation;\n  result.alignedAxis = this._alignedAxis;\n  result.sizeInMeters = this._sizeInMeters;\n  result.width = this._width;\n  result.height = this._height;\n  result.scaleByDistance = this._scaleByDistance;\n  result.translucencyByDistance = this._translucencyByDistance;\n  result.pixelOffsetScaleByDistance = this._pixelOffsetScaleByDistance;\n  result.imageSubRegion = this._imageSubRegion;\n  result.distanceDisplayCondition = this._distanceDisplayCondition;\n  result.disableDepthTestDistance = this._disableDepthTestDistance;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {BillboardGraphics} source The object to be merged into this object.\n */\nBillboardGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this._show, source.show);\n  this.image = defaultValue(this._image, source.image);\n  this.scale = defaultValue(this._scale, source.scale);\n  this.pixelOffset = defaultValue(this._pixelOffset, source.pixelOffset);\n  this.eyeOffset = defaultValue(this._eyeOffset, source.eyeOffset);\n  this.horizontalOrigin = defaultValue(\n    this._horizontalOrigin,\n    source.horizontalOrigin\n  );\n  this.verticalOrigin = defaultValue(\n    this._verticalOrigin,\n    source.verticalOrigin\n  );\n  this.heightReference = defaultValue(\n    this._heightReference,\n    source.heightReference\n  );\n  this.color = defaultValue(this._color, source.color);\n  this.rotation = defaultValue(this._rotation, source.rotation);\n  this.alignedAxis = defaultValue(this._alignedAxis, source.alignedAxis);\n  this.sizeInMeters = defaultValue(this._sizeInMeters, source.sizeInMeters);\n  this.width = defaultValue(this._width, source.width);\n  this.height = defaultValue(this._height, source.height);\n  this.scaleByDistance = defaultValue(\n    this._scaleByDistance,\n    source.scaleByDistance\n  );\n  this.translucencyByDistance = defaultValue(\n    this._translucencyByDistance,\n    source.translucencyByDistance\n  );\n  this.pixelOffsetScaleByDistance = defaultValue(\n    this._pixelOffsetScaleByDistance,\n    source.pixelOffsetScaleByDistance\n  );\n  this.imageSubRegion = defaultValue(\n    this._imageSubRegion,\n    source.imageSubRegion\n  );\n  this.distanceDisplayCondition = defaultValue(\n    this._distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n  this.disableDepthTestDistance = defaultValue(\n    this._disableDepthTestDistance,\n    source.disableDepthTestDistance\n  );\n};\nexport default BillboardGraphics;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * A collection of key-value pairs that is stored as a hash for easy\n * lookup but also provides an array for fast iteration.\n * @alias AssociativeArray\n * @constructor\n */\nfunction AssociativeArray() {\n  this._array = [];\n  this._hash = {};\n}\n\nObject.defineProperties(AssociativeArray.prototype, {\n  /**\n   * Gets the number of items in the collection.\n   * @memberof AssociativeArray.prototype\n   *\n   * @type {number}\n   */\n  length: {\n    get: function () {\n      return this._array.length;\n    },\n  },\n  /**\n   * Gets an unordered array of all values in the collection.\n   * This is a live array that will automatically reflect the values in the collection,\n   * it should not be modified directly.\n   * @memberof AssociativeArray.prototype\n   *\n   * @type {Array}\n   */\n  values: {\n    get: function () {\n      return this._array;\n    },\n  },\n});\n\n/**\n * Determines if the provided key is in the array.\n *\n * @param {string|number} key The key to check.\n * @returns {boolean} <code>true</code> if the key is in the array, <code>false</code> otherwise.\n */\nAssociativeArray.prototype.contains = function (key) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof key !== \"string\" && typeof key !== \"number\") {\n    throw new DeveloperError(\"key is required to be a string or number.\");\n  }\n  //>>includeEnd('debug');\n  return defined(this._hash[key]);\n};\n\n/**\n * Associates the provided key with the provided value.  If the key already\n * exists, it is overwritten with the new value.\n *\n * @param {string|number} key A unique identifier.\n * @param {*} value The value to associate with the provided key.\n */\nAssociativeArray.prototype.set = function (key, value) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof key !== \"string\" && typeof key !== \"number\") {\n    throw new DeveloperError(\"key is required to be a string or number.\");\n  }\n  //>>includeEnd('debug');\n\n  const oldValue = this._hash[key];\n  if (value !== oldValue) {\n    this.remove(key);\n    this._hash[key] = value;\n    this._array.push(value);\n  }\n};\n\n/**\n * Retrieves the value associated with the provided key.\n *\n * @param {string|number} key The key whose value is to be retrieved.\n * @returns {*} The associated value, or undefined if the key does not exist in the collection.\n */\nAssociativeArray.prototype.get = function (key) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof key !== \"string\" && typeof key !== \"number\") {\n    throw new DeveloperError(\"key is required to be a string or number.\");\n  }\n  //>>includeEnd('debug');\n  return this._hash[key];\n};\n\n/**\n * Removes a key-value pair from the collection.\n *\n * @param {string|number} key The key to be removed.\n * @returns {boolean} True if it was removed, false if the key was not in the collection.\n */\nAssociativeArray.prototype.remove = function (key) {\n  //>>includeStart('debug', pragmas.debug);\n  if (defined(key) && typeof key !== \"string\" && typeof key !== \"number\") {\n    throw new DeveloperError(\"key is required to be a string or number.\");\n  }\n  //>>includeEnd('debug');\n\n  const value = this._hash[key];\n  const hasValue = defined(value);\n  if (hasValue) {\n    const array = this._array;\n    array.splice(array.indexOf(value), 1);\n    delete this._hash[key];\n  }\n  return hasValue;\n};\n\n/**\n * Clears the collection.\n */\nAssociativeArray.prototype.removeAll = function () {\n  const array = this._array;\n  if (array.length > 0) {\n    this._hash = {};\n    array.length = 0;\n  }\n};\nexport default AssociativeArray;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Determines visibility based on the distance to the camera.\n *\n * @alias DistanceDisplayCondition\n * @constructor\n *\n * @param {number} [near=0.0] The smallest distance in the interval where the object is visible.\n * @param {number} [far=Number.MAX_VALUE] The largest distance in the interval where the object is visible.\n *\n * @example\n * // Make a billboard that is only visible when the distance to the camera is between 10 and 20 meters.\n * billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(10.0, 20.0);\n */\nfunction DistanceDisplayCondition(near, far) {\n  near = defaultValue(near, 0.0);\n  this._near = near;\n\n  far = defaultValue(far, Number.MAX_VALUE);\n  this._far = far;\n}\n\nObject.defineProperties(DistanceDisplayCondition.prototype, {\n  /**\n   * The smallest distance in the interval where the object is visible.\n   * @memberof DistanceDisplayCondition.prototype\n   * @type {number}\n   * @default 0.0\n   */\n  near: {\n    get: function () {\n      return this._near;\n    },\n    set: function (value) {\n      this._near = value;\n    },\n  },\n  /**\n   * The largest distance in the interval where the object is visible.\n   * @memberof DistanceDisplayCondition.prototype\n   * @type {number}\n   * @default Number.MAX_VALUE\n   */\n  far: {\n    get: function () {\n      return this._far;\n    },\n    set: function (value) {\n      this._far = value;\n    },\n  },\n});\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nDistanceDisplayCondition.packedLength = 2;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {DistanceDisplayCondition} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nDistanceDisplayCondition.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required\");\n  }\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  array[startingIndex++] = value.near;\n  array[startingIndex] = value.far;\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {DistanceDisplayCondition} [result] The object into which to store the result.\n * @returns {DistanceDisplayCondition} The modified result parameter or a new DistanceDisplayCondition instance if one was not provided.\n */\nDistanceDisplayCondition.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new DistanceDisplayCondition();\n  }\n  result.near = array[startingIndex++];\n  result.far = array[startingIndex];\n  return result;\n};\n\n/**\n * Determines if two distance display conditions are equal.\n *\n * @param {DistanceDisplayCondition} left A distance display condition.\n * @param {DistanceDisplayCondition} right Another distance display condition.\n * @return {boolean} Whether the two distance display conditions are equal.\n */\nDistanceDisplayCondition.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left.near === right.near &&\n      left.far === right.far)\n  );\n};\n\n/**\n * Duplicates a distance display condition instance.\n *\n * @param {DistanceDisplayCondition} [value] The distance display condition to duplicate.\n * @param {DistanceDisplayCondition} [result] The result onto which to store the result.\n * @return {DistanceDisplayCondition} The duplicated instance.\n */\nDistanceDisplayCondition.clone = function (value, result) {\n  if (!defined(value)) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    result = new DistanceDisplayCondition();\n  }\n\n  result.near = value.near;\n  result.far = value.far;\n  return result;\n};\n\n/**\n * Duplicates this instance.\n *\n * @param {DistanceDisplayCondition} [result] The result onto which to store the result.\n * @return {DistanceDisplayCondition} The duplicated instance.\n */\nDistanceDisplayCondition.prototype.clone = function (result) {\n  return DistanceDisplayCondition.clone(this, result);\n};\n\n/**\n * Determines if this distance display condition is equal to another.\n *\n * @param {DistanceDisplayCondition} other Another distance display condition.\n * @return {boolean} Whether this distance display condition is equal to the other.\n */\nDistanceDisplayCondition.prototype.equals = function (other) {\n  return DistanceDisplayCondition.equals(this, other);\n};\nexport default DistanceDisplayCondition;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Represents a scalar value's lower and upper bound at a near distance and far distance in eye space.\n * @alias NearFarScalar\n * @constructor\n *\n * @param {number} [near=0.0] The lower bound of the camera range.\n * @param {number} [nearValue=0.0] The value at the lower bound of the camera range.\n * @param {number} [far=1.0] The upper bound of the camera range.\n * @param {number} [farValue=0.0] The value at the upper bound of the camera range.\n *\n * @see Packable\n */\nfunction NearFarScalar(near, nearValue, far, farValue) {\n  /**\n   * The lower bound of the camera range.\n   * @type {number}\n   * @default 0.0\n   */\n  this.near = defaultValue(near, 0.0);\n  /**\n   * The value at the lower bound of the camera range.\n   * @type {number}\n   * @default 0.0\n   */\n  this.nearValue = defaultValue(nearValue, 0.0);\n  /**\n   * The upper bound of the camera range.\n   * @type {number}\n   * @default 1.0\n   */\n  this.far = defaultValue(far, 1.0);\n  /**\n   * The value at the upper bound of the camera range.\n   * @type {number}\n   * @default 0.0\n   */\n  this.farValue = defaultValue(farValue, 0.0);\n}\n\n/**\n * Duplicates a NearFarScalar instance.\n *\n * @param {NearFarScalar} nearFarScalar The NearFarScalar to duplicate.\n * @param {NearFarScalar} [result] The object onto which to store the result.\n * @returns {NearFarScalar} The modified result parameter or a new NearFarScalar instance if one was not provided. (Returns undefined if nearFarScalar is undefined)\n */\nNearFarScalar.clone = function (nearFarScalar, result) {\n  if (!defined(nearFarScalar)) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    return new NearFarScalar(\n      nearFarScalar.near,\n      nearFarScalar.nearValue,\n      nearFarScalar.far,\n      nearFarScalar.farValue\n    );\n  }\n\n  result.near = nearFarScalar.near;\n  result.nearValue = nearFarScalar.nearValue;\n  result.far = nearFarScalar.far;\n  result.farValue = nearFarScalar.farValue;\n  return result;\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nNearFarScalar.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {NearFarScalar} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nNearFarScalar.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required\");\n  }\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  array[startingIndex++] = value.near;\n  array[startingIndex++] = value.nearValue;\n  array[startingIndex++] = value.far;\n  array[startingIndex] = value.farValue;\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {NearFarScalar} [result] The object into which to store the result.\n * @returns {NearFarScalar} The modified result parameter or a new NearFarScalar instance if one was not provided.\n */\nNearFarScalar.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new NearFarScalar();\n  }\n  result.near = array[startingIndex++];\n  result.nearValue = array[startingIndex++];\n  result.far = array[startingIndex++];\n  result.farValue = array[startingIndex];\n  return result;\n};\n\n/**\n * Compares the provided NearFarScalar and returns <code>true</code> if they are equal,\n * <code>false</code> otherwise.\n *\n * @param {NearFarScalar} [left] The first NearFarScalar.\n * @param {NearFarScalar} [right] The second NearFarScalar.\n * @returns {boolean} <code>true</code> if left and right are equal; otherwise <code>false</code>.\n */\nNearFarScalar.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left.near === right.near &&\n      left.nearValue === right.nearValue &&\n      left.far === right.far &&\n      left.farValue === right.farValue)\n  );\n};\n\n/**\n * Duplicates this instance.\n *\n * @param {NearFarScalar} [result] The object onto which to store the result.\n * @returns {NearFarScalar} The modified result parameter or a new NearFarScalar instance if one was not provided.\n */\nNearFarScalar.prototype.clone = function (result) {\n  return NearFarScalar.clone(this, result);\n};\n\n/**\n * Compares this instance to the provided NearFarScalar and returns <code>true</code> if they are equal,\n * <code>false</code> otherwise.\n *\n * @param {NearFarScalar} [right] The right hand side NearFarScalar.\n * @returns {boolean} <code>true</code> if left and right are equal; otherwise <code>false</code>.\n */\nNearFarScalar.prototype.equals = function (right) {\n  return NearFarScalar.equals(this, right);\n};\nexport default NearFarScalar;\n", "/**\n * Represents the position relative to the terrain.\n *\n * @enum {number}\n */\nconst HeightReference = {\n  /**\n   * The position is absolute.\n   * @type {number}\n   * @constant\n   */\n  NONE: 0,\n\n  /**\n   * The position is clamped to the terrain.\n   * @type {number}\n   * @constant\n   */\n  CLAMP_TO_GROUND: 1,\n\n  /**\n   * The position height is the height above the terrain.\n   * @type {number}\n   * @constant\n   */\n  RELATIVE_TO_GROUND: 2,\n};\nexport default Object.freeze(HeightReference);\n", "/**\n * The horizontal location of an origin relative to an object, e.g., a {@link Billboard}\n * or {@link Label}.  For example, setting the horizontal origin to <code>LEFT</code>\n * or <code>RIGHT</code> will display a billboard to the left or right (in screen space)\n * of the anchor position.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />\n * </div>\n *\n * @enum {number}\n *\n * @see Billboard#horizontalOrigin\n * @see Label#horizontalOrigin\n */\nconst HorizontalOrigin = {\n  /**\n   * The origin is at the horizontal center of the object.\n   *\n   * @type {number}\n   * @constant\n   */\n  CENTER: 0,\n\n  /**\n   * The origin is on the left side of the object.\n   *\n   * @type {number}\n   * @constant\n   */\n  LEFT: 1,\n\n  /**\n   * The origin is on the right side of the object.\n   *\n   * @type {number}\n   * @constant\n   */\n  RIGHT: -1,\n};\nexport default Object.freeze(HorizontalOrigin);\n", "/**\n * The vertical location of an origin relative to an object, e.g., a {@link Billboard}\n * or {@link Label}.  For example, setting the vertical origin to <code>TOP</code>\n * or <code>BOTTOM</code> will display a billboard above or below (in screen space)\n * the anchor position.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />\n * </div>\n *\n * @enum {number}\n *\n * @see Billboard#verticalOrigin\n * @see Label#verticalOrigin\n */\nconst VerticalOrigin = {\n  /**\n   * The origin is at the vertical center between <code>BASELINE</code> and <code>TOP</code>.\n   *\n   * @type {number}\n   * @constant\n   */\n  CENTER: 0,\n\n  /**\n   * The origin is at the bottom of the object.\n   *\n   * @type {number}\n   * @constant\n   */\n  BOTTOM: 1,\n\n  /**\n   * If the object contains text, the origin is at the baseline of the text, else the origin is at the bottom of the object.\n   *\n   * @type {number}\n   * @constant\n   */\n  BASELINE: 2,\n\n  /**\n   * The origin is at the top of the object.\n   *\n   * @type {number}\n   * @constant\n   */\n  TOP: -1,\n};\nexport default Object.freeze(VerticalOrigin);\n", "/**\n * The state of a BoundingSphere computation being performed by a {@link Visualizer}.\n * @enum {number}\n * @private\n */\nconst BoundingSphereState = {\n  /**\n   * The BoundingSphere has been computed.\n   * @type BoundingSphereState\n   * @constant\n   */\n  DONE: 0,\n  /**\n   * The BoundingSphere is still being computed.\n   * @type BoundingSphereState\n   * @constant\n   */\n  PENDING: 1,\n  /**\n   * The BoundingSphere does not exist.\n   * @type BoundingSphereState\n   * @constant\n   */\n  FAILED: 2,\n};\nexport default Object.freeze(BoundingSphereState);\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * The interface for all properties, which represent a value that can optionally vary over time.\n * This type defines an interface and cannot be instantiated directly.\n *\n * @alias Property\n * @constructor\n * @abstract\n *\n * @see CompositeProperty\n * @see ConstantProperty\n * @see SampledProperty\n * @see TimeIntervalCollectionProperty\n * @see MaterialProperty\n * @see PositionProperty\n * @see ReferenceProperty\n */\nfunction Property() {\n  DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(Property.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof Property.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: DeveloperError.throwInstantiationError,\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof Property.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: DeveloperError.throwInstantiationError,\n  },\n});\n\n/**\n * Gets the value of the property at the provided time.\n * @function\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nProperty.prototype.getValue = DeveloperError.throwInstantiationError;\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n * @function\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nProperty.prototype.equals = DeveloperError.throwInstantiationError;\n\n/**\n * @private\n */\nProperty.equals = function (left, right) {\n  return left === right || (defined(left) && left.equals(right));\n};\n\n/**\n * @private\n */\nProperty.arrayEquals = function (left, right) {\n  if (left === right) {\n    return true;\n  }\n  if (!defined(left) || !defined(right) || left.length !== right.length) {\n    return false;\n  }\n  const length = left.length;\n  for (let i = 0; i < length; i++) {\n    if (!Property.equals(left[i], right[i])) {\n      return false;\n    }\n  }\n  return true;\n};\n\n/**\n * @private\n */\nProperty.isConstant = function (property) {\n  return !defined(property) || property.isConstant;\n};\n\n/**\n * @private\n */\nProperty.getValueOrUndefined = function (property, time, result) {\n  return defined(property) ? property.getValue(time, result) : undefined;\n};\n\n/**\n * @private\n */\nProperty.getValueOrDefault = function (property, time, valueDefault, result) {\n  return defined(property)\n    ? defaultValue(property.getValue(time, result), valueDefault)\n    : valueDefault;\n};\n\n/**\n * @private\n */\nProperty.getValueOrClonedDefault = function (\n  property,\n  time,\n  valueDefault,\n  result\n) {\n  let value;\n  if (defined(property)) {\n    value = property.getValue(time, result);\n  }\n  if (!defined(value)) {\n    value = valueDefault.clone(value);\n  }\n  return value;\n};\nexport default Property;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport HorizontalOrigin from \"../Scene/HorizontalOrigin.js\";\nimport VerticalOrigin from \"../Scene/VerticalOrigin.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport Property from \"./Property.js\";\n\nconst defaultColor = Color.WHITE;\nconst defaultEyeOffset = Cartesian3.ZERO;\nconst defaultHeightReference = HeightReference.NONE;\nconst defaultPixelOffset = Cartesian2.ZERO;\nconst defaultScale = 1.0;\nconst defaultRotation = 0.0;\nconst defaultAlignedAxis = Cartesian3.ZERO;\nconst defaultHorizontalOrigin = HorizontalOrigin.CENTER;\nconst defaultVerticalOrigin = VerticalOrigin.CENTER;\nconst defaultSizeInMeters = false;\n\nconst positionScratch = new Cartesian3();\nconst colorScratch = new Color();\nconst eyeOffsetScratch = new Cartesian3();\nconst pixelOffsetScratch = new Cartesian2();\nconst scaleByDistanceScratch = new NearFarScalar();\nconst translucencyByDistanceScratch = new NearFarScalar();\nconst pixelOffsetScaleByDistanceScratch = new NearFarScalar();\nconst boundingRectangleScratch = new BoundingRectangle();\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\n\nfunction EntityData(entity) {\n  this.entity = entity;\n  this.billboard = undefined;\n  this.textureValue = undefined;\n}\n\n/**\n * A {@link Visualizer} which maps {@link Entity#billboard} to a {@link Billboard}.\n * @alias BillboardVisualizer\n * @constructor\n *\n * @param {EntityCluster} entityCluster The entity cluster to manage the collection of billboards and optionally cluster with other entities.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n */\nfunction BillboardVisualizer(entityCluster, entityCollection) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(entityCluster)) {\n    throw new DeveloperError(\"entityCluster is required.\");\n  }\n  if (!defined(entityCollection)) {\n    throw new DeveloperError(\"entityCollection is required.\");\n  }\n  //>>includeEnd('debug');\n\n  entityCollection.collectionChanged.addEventListener(\n    BillboardVisualizer.prototype._onCollectionChanged,\n    this\n  );\n\n  this._cluster = entityCluster;\n  this._entityCollection = entityCollection;\n  this._items = new AssociativeArray();\n  this._onCollectionChanged(entityCollection, entityCollection.values, [], []);\n}\n\n/**\n * Updates the primitives created by this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {boolean} This function always returns true.\n */\nBillboardVisualizer.prototype.update = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const items = this._items.values;\n  const cluster = this._cluster;\n\n  for (let i = 0, len = items.length; i < len; i++) {\n    const item = items[i];\n    const entity = item.entity;\n    const billboardGraphics = entity._billboard;\n    let textureValue;\n    let billboard = item.billboard;\n    let show =\n      entity.isShowing &&\n      entity.isAvailable(time) &&\n      Property.getValueOrDefault(billboardGraphics._show, time, true);\n    let position;\n    if (show) {\n      position = Property.getValueOrUndefined(\n        entity._position,\n        time,\n        positionScratch\n      );\n      textureValue = Property.getValueOrUndefined(\n        billboardGraphics._image,\n        time\n      );\n      show = defined(position) && defined(textureValue);\n    }\n\n    if (!show) {\n      //don't bother creating or updating anything else\n      returnPrimitive(item, entity, cluster);\n      continue;\n    }\n\n    if (!Property.isConstant(entity._position)) {\n      cluster._clusterDirty = true;\n    }\n\n    if (!defined(billboard)) {\n      billboard = cluster.getBillboard(entity);\n      billboard.id = entity;\n      billboard.image = undefined;\n      item.billboard = billboard;\n    }\n\n    billboard.show = show;\n    if (!defined(billboard.image) || item.textureValue !== textureValue) {\n      billboard.image = textureValue;\n      item.textureValue = textureValue;\n    }\n    billboard.position = position;\n    billboard.color = Property.getValueOrDefault(\n      billboardGraphics._color,\n      time,\n      defaultColor,\n      colorScratch\n    );\n    billboard.eyeOffset = Property.getValueOrDefault(\n      billboardGraphics._eyeOffset,\n      time,\n      defaultEyeOffset,\n      eyeOffsetScratch\n    );\n    billboard.heightReference = Property.getValueOrDefault(\n      billboardGraphics._heightReference,\n      time,\n      defaultHeightReference\n    );\n    billboard.pixelOffset = Property.getValueOrDefault(\n      billboardGraphics._pixelOffset,\n      time,\n      defaultPixelOffset,\n      pixelOffsetScratch\n    );\n    billboard.scale = Property.getValueOrDefault(\n      billboardGraphics._scale,\n      time,\n      defaultScale\n    );\n    billboard.rotation = Property.getValueOrDefault(\n      billboardGraphics._rotation,\n      time,\n      defaultRotation\n    );\n    billboard.alignedAxis = Property.getValueOrDefault(\n      billboardGraphics._alignedAxis,\n      time,\n      defaultAlignedAxis\n    );\n    billboard.horizontalOrigin = Property.getValueOrDefault(\n      billboardGraphics._horizontalOrigin,\n      time,\n      defaultHorizontalOrigin\n    );\n    billboard.verticalOrigin = Property.getValueOrDefault(\n      billboardGraphics._verticalOrigin,\n      time,\n      defaultVerticalOrigin\n    );\n    billboard.width = Property.getValueOrUndefined(\n      billboardGraphics._width,\n      time\n    );\n    billboard.height = Property.getValueOrUndefined(\n      billboardGraphics._height,\n      time\n    );\n    billboard.scaleByDistance = Property.getValueOrUndefined(\n      billboardGraphics._scaleByDistance,\n      time,\n      scaleByDistanceScratch\n    );\n    billboard.translucencyByDistance = Property.getValueOrUndefined(\n      billboardGraphics._translucencyByDistance,\n      time,\n      translucencyByDistanceScratch\n    );\n    billboard.pixelOffsetScaleByDistance = Property.getValueOrUndefined(\n      billboardGraphics._pixelOffsetScaleByDistance,\n      time,\n      pixelOffsetScaleByDistanceScratch\n    );\n    billboard.sizeInMeters = Property.getValueOrDefault(\n      billboardGraphics._sizeInMeters,\n      time,\n      defaultSizeInMeters\n    );\n    billboard.distanceDisplayCondition = Property.getValueOrUndefined(\n      billboardGraphics._distanceDisplayCondition,\n      time,\n      distanceDisplayConditionScratch\n    );\n    billboard.disableDepthTestDistance = Property.getValueOrUndefined(\n      billboardGraphics._disableDepthTestDistance,\n      time\n    );\n\n    const subRegion = Property.getValueOrUndefined(\n      billboardGraphics._imageSubRegion,\n      time,\n      boundingRectangleScratch\n    );\n    if (defined(subRegion)) {\n      billboard.setImageSubRegion(billboard._imageId, subRegion);\n    }\n  }\n  return true;\n};\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n *                       BoundingSphereState.PENDING if the result is still being computed, or\n *                       BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nBillboardVisualizer.prototype.getBoundingSphere = function (entity, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(entity)) {\n    throw new DeveloperError(\"entity is required.\");\n  }\n  if (!defined(result)) {\n    throw new DeveloperError(\"result is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const item = this._items.get(entity.id);\n  if (!defined(item) || !defined(item.billboard)) {\n    return BoundingSphereState.FAILED;\n  }\n\n  const billboard = item.billboard;\n  if (billboard.heightReference === HeightReference.NONE) {\n    result.center = Cartesian3.clone(billboard.position, result.center);\n  } else {\n    if (!defined(billboard._clampedPosition)) {\n      return BoundingSphereState.PENDING;\n    }\n    result.center = Cartesian3.clone(billboard._clampedPosition, result.center);\n  }\n  result.radius = 0;\n  return BoundingSphereState.DONE;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n */\nBillboardVisualizer.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nBillboardVisualizer.prototype.destroy = function () {\n  this._entityCollection.collectionChanged.removeEventListener(\n    BillboardVisualizer.prototype._onCollectionChanged,\n    this\n  );\n  const entities = this._entityCollection.values;\n  for (let i = 0; i < entities.length; i++) {\n    this._cluster.removeBillboard(entities[i]);\n  }\n  return destroyObject(this);\n};\n\nBillboardVisualizer.prototype._onCollectionChanged = function (\n  entityCollection,\n  added,\n  removed,\n  changed\n) {\n  let i;\n  let entity;\n  const items = this._items;\n  const cluster = this._cluster;\n\n  for (i = added.length - 1; i > -1; i--) {\n    entity = added[i];\n    if (defined(entity._billboard) && defined(entity._position)) {\n      items.set(entity.id, new EntityData(entity));\n    }\n  }\n\n  for (i = changed.length - 1; i > -1; i--) {\n    entity = changed[i];\n    if (defined(entity._billboard) && defined(entity._position)) {\n      if (!items.contains(entity.id)) {\n        items.set(entity.id, new EntityData(entity));\n      }\n    } else {\n      returnPrimitive(items.get(entity.id), entity, cluster);\n      items.remove(entity.id);\n    }\n  }\n\n  for (i = removed.length - 1; i > -1; i--) {\n    entity = removed[i];\n    returnPrimitive(items.get(entity.id), entity, cluster);\n    items.remove(entity.id);\n  }\n};\n\nfunction returnPrimitive(item, entity, cluster) {\n  if (defined(item)) {\n    item.billboard = undefined;\n    cluster.removeBillboard(entity);\n  }\n}\nexport default BillboardVisualizer;\n", "import defaultValue from \"./defaultValue.js\";\n\n/**\n * Represents the closed interval [start, stop].\n * @alias Interval\n * @constructor\n *\n * @param {number} [start=0.0] The beginning of the interval.\n * @param {number} [stop=0.0] The end of the interval.\n */\nfunction Interval(start, stop) {\n  /**\n   * The beginning of the interval.\n   * @type {number}\n   * @default 0.0\n   */\n  this.start = defaultValue(start, 0.0);\n  /**\n   * The end of the interval.\n   * @type {number}\n   * @default 0.0\n   */\n  this.stop = defaultValue(stop, 0.0);\n}\nexport default Interval;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport Intersect from \"./Intersect.js\";\nimport Interval from \"./Interval.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Rectangle from \"./Rectangle.js\";\n\n/**\n * A bounding sphere with a center and a radius.\n * @alias BoundingSphere\n * @constructor\n *\n * @param {Cartesian3} [center=Cartesian3.ZERO] The center of the bounding sphere.\n * @param {number} [radius=0.0] The radius of the bounding sphere.\n *\n * @see AxisAlignedBoundingBox\n * @see BoundingRectangle\n * @see Packable\n */\nfunction BoundingSphere(center, radius) {\n  /**\n   * The center point of the sphere.\n   * @type {Cartesian3}\n   * @default {@link Cartesian3.ZERO}\n   */\n  this.center = Cartesian3.clone(defaultValue(center, Cartesian3.ZERO));\n\n  /**\n   * The radius of the sphere.\n   * @type {number}\n   * @default 0.0\n   */\n  this.radius = defaultValue(radius, 0.0);\n}\n\nconst fromPointsXMin = new Cartesian3();\nconst fromPointsYMin = new Cartesian3();\nconst fromPointsZMin = new Cartesian3();\nconst fromPointsXMax = new Cartesian3();\nconst fromPointsYMax = new Cartesian3();\nconst fromPointsZMax = new Cartesian3();\nconst fromPointsCurrentPos = new Cartesian3();\nconst fromPointsScratch = new Cartesian3();\nconst fromPointsRitterCenter = new Cartesian3();\nconst fromPointsMinBoxPt = new Cartesian3();\nconst fromPointsMaxBoxPt = new Cartesian3();\nconst fromPointsNaiveCenterScratch = new Cartesian3();\nconst volumeConstant = (4.0 / 3.0) * CesiumMath.PI;\n\n/**\n * Computes a tight-fitting bounding sphere enclosing a list of 3D Cartesian points.\n * The bounding sphere is computed by running two algorithms, a naive algorithm and\n * Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit.\n *\n * @param {Cartesian3[]} [positions] An array of points that the bounding sphere will enclose.  Each point must have <code>x</code>, <code>y</code>, and <code>z</code> properties.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.\n *\n * @see {@link http://help.agi.com/AGIComponents/html/BlogBoundingSphere.htm|Bounding Sphere computation article}\n */\nBoundingSphere.fromPoints = function (positions, result) {\n  if (!defined(result)) {\n    result = new BoundingSphere();\n  }\n\n  if (!defined(positions) || positions.length === 0) {\n    result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\n    result.radius = 0.0;\n    return result;\n  }\n\n  const currentPos = Cartesian3.clone(positions[0], fromPointsCurrentPos);\n\n  const xMin = Cartesian3.clone(currentPos, fromPointsXMin);\n  const yMin = Cartesian3.clone(currentPos, fromPointsYMin);\n  const zMin = Cartesian3.clone(currentPos, fromPointsZMin);\n\n  const xMax = Cartesian3.clone(currentPos, fromPointsXMax);\n  const yMax = Cartesian3.clone(currentPos, fromPointsYMax);\n  const zMax = Cartesian3.clone(currentPos, fromPointsZMax);\n\n  const numPositions = positions.length;\n  let i;\n  for (i = 1; i < numPositions; i++) {\n    Cartesian3.clone(positions[i], currentPos);\n\n    const x = currentPos.x;\n    const y = currentPos.y;\n    const z = currentPos.z;\n\n    // Store points containing the the smallest and largest components\n    if (x < xMin.x) {\n      Cartesian3.clone(currentPos, xMin);\n    }\n\n    if (x > xMax.x) {\n      Cartesian3.clone(currentPos, xMax);\n    }\n\n    if (y < yMin.y) {\n      Cartesian3.clone(currentPos, yMin);\n    }\n\n    if (y > yMax.y) {\n      Cartesian3.clone(currentPos, yMax);\n    }\n\n    if (z < zMin.z) {\n      Cartesian3.clone(currentPos, zMin);\n    }\n\n    if (z > zMax.z) {\n      Cartesian3.clone(currentPos, zMax);\n    }\n  }\n\n  // Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.).\n  const xSpan = Cartesian3.magnitudeSquared(\n    Cartesian3.subtract(xMax, xMin, fromPointsScratch)\n  );\n  const ySpan = Cartesian3.magnitudeSquared(\n    Cartesian3.subtract(yMax, yMin, fromPointsScratch)\n  );\n  const zSpan = Cartesian3.magnitudeSquared(\n    Cartesian3.subtract(zMax, zMin, fromPointsScratch)\n  );\n\n  // Set the diameter endpoints to the largest span.\n  let diameter1 = xMin;\n  let diameter2 = xMax;\n  let maxSpan = xSpan;\n  if (ySpan > maxSpan) {\n    maxSpan = ySpan;\n    diameter1 = yMin;\n    diameter2 = yMax;\n  }\n  if (zSpan > maxSpan) {\n    maxSpan = zSpan;\n    diameter1 = zMin;\n    diameter2 = zMax;\n  }\n\n  // Calculate the center of the initial sphere found by Ritter's algorithm\n  const ritterCenter = fromPointsRitterCenter;\n  ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;\n  ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;\n  ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;\n\n  // Calculate the radius of the initial sphere found by Ritter's algorithm\n  let radiusSquared = Cartesian3.magnitudeSquared(\n    Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch)\n  );\n  let ritterRadius = Math.sqrt(radiusSquared);\n\n  // Find the center of the sphere found using the Naive method.\n  const minBoxPt = fromPointsMinBoxPt;\n  minBoxPt.x = xMin.x;\n  minBoxPt.y = yMin.y;\n  minBoxPt.z = zMin.z;\n\n  const maxBoxPt = fromPointsMaxBoxPt;\n  maxBoxPt.x = xMax.x;\n  maxBoxPt.y = yMax.y;\n  maxBoxPt.z = zMax.z;\n\n  const naiveCenter = Cartesian3.midpoint(\n    minBoxPt,\n    maxBoxPt,\n    fromPointsNaiveCenterScratch\n  );\n\n  // Begin 2nd pass to find naive radius and modify the ritter sphere.\n  let naiveRadius = 0;\n  for (i = 0; i < numPositions; i++) {\n    Cartesian3.clone(positions[i], currentPos);\n\n    // Find the furthest point from the naive center to calculate the naive radius.\n    const r = Cartesian3.magnitude(\n      Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch)\n    );\n    if (r > naiveRadius) {\n      naiveRadius = r;\n    }\n\n    // Make adjustments to the Ritter Sphere to include all points.\n    const oldCenterToPointSquared = Cartesian3.magnitudeSquared(\n      Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch)\n    );\n    if (oldCenterToPointSquared > radiusSquared) {\n      const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);\n      // Calculate new radius to include the point that lies outside\n      ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;\n      radiusSquared = ritterRadius * ritterRadius;\n      // Calculate center of new Ritter sphere\n      const oldToNew = oldCenterToPoint - ritterRadius;\n      ritterCenter.x =\n        (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) /\n        oldCenterToPoint;\n      ritterCenter.y =\n        (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) /\n        oldCenterToPoint;\n      ritterCenter.z =\n        (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) /\n        oldCenterToPoint;\n    }\n  }\n\n  if (ritterRadius < naiveRadius) {\n    Cartesian3.clone(ritterCenter, result.center);\n    result.radius = ritterRadius;\n  } else {\n    Cartesian3.clone(naiveCenter, result.center);\n    result.radius = naiveRadius;\n  }\n\n  return result;\n};\n\nconst defaultProjection = new GeographicProjection();\nconst fromRectangle2DLowerLeft = new Cartesian3();\nconst fromRectangle2DUpperRight = new Cartesian3();\nconst fromRectangle2DSouthwest = new Cartographic();\nconst fromRectangle2DNortheast = new Cartographic();\n\n/**\n * Computes a bounding sphere from a rectangle projected in 2D.\n *\n * @param {Rectangle} [rectangle] The rectangle around which to create a bounding sphere.\n * @param {object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.fromRectangle2D = function (rectangle, projection, result) {\n  return BoundingSphere.fromRectangleWithHeights2D(\n    rectangle,\n    projection,\n    0.0,\n    0.0,\n    result\n  );\n};\n\n/**\n * Computes a bounding sphere from a rectangle projected in 2D.  The bounding sphere accounts for the\n * object's minimum and maximum heights over the rectangle.\n *\n * @param {Rectangle} [rectangle] The rectangle around which to create a bounding sphere.\n * @param {object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.\n * @param {number} [minimumHeight=0.0] The minimum height over the rectangle.\n * @param {number} [maximumHeight=0.0] The maximum height over the rectangle.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.fromRectangleWithHeights2D = function (\n  rectangle,\n  projection,\n  minimumHeight,\n  maximumHeight,\n  result\n) {\n  if (!defined(result)) {\n    result = new BoundingSphere();\n  }\n\n  if (!defined(rectangle)) {\n    result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\n    result.radius = 0.0;\n    return result;\n  }\n\n  projection = defaultValue(projection, defaultProjection);\n\n  Rectangle.southwest(rectangle, fromRectangle2DSouthwest);\n  fromRectangle2DSouthwest.height = minimumHeight;\n  Rectangle.northeast(rectangle, fromRectangle2DNortheast);\n  fromRectangle2DNortheast.height = maximumHeight;\n\n  const lowerLeft = projection.project(\n    fromRectangle2DSouthwest,\n    fromRectangle2DLowerLeft\n  );\n  const upperRight = projection.project(\n    fromRectangle2DNortheast,\n    fromRectangle2DUpperRight\n  );\n\n  const width = upperRight.x - lowerLeft.x;\n  const height = upperRight.y - lowerLeft.y;\n  const elevation = upperRight.z - lowerLeft.z;\n\n  result.radius =\n    Math.sqrt(width * width + height * height + elevation * elevation) * 0.5;\n  const center = result.center;\n  center.x = lowerLeft.x + width * 0.5;\n  center.y = lowerLeft.y + height * 0.5;\n  center.z = lowerLeft.z + elevation * 0.5;\n  return result;\n};\n\nconst fromRectangle3DScratch = [];\n\n/**\n * Computes a bounding sphere from a rectangle in 3D. The bounding sphere is created using a subsample of points\n * on the ellipsoid and contained in the rectangle. It may not be accurate for all rectangles on all types of ellipsoids.\n *\n * @param {Rectangle} [rectangle] The valid rectangle used to create a bounding sphere.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid used to determine positions of the rectangle.\n * @param {number} [surfaceHeight=0.0] The height above the surface of the ellipsoid.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.fromRectangle3D = function (\n  rectangle,\n  ellipsoid,\n  surfaceHeight,\n  result\n) {\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n  surfaceHeight = defaultValue(surfaceHeight, 0.0);\n\n  if (!defined(result)) {\n    result = new BoundingSphere();\n  }\n\n  if (!defined(rectangle)) {\n    result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\n    result.radius = 0.0;\n    return result;\n  }\n\n  const positions = Rectangle.subsample(\n    rectangle,\n    ellipsoid,\n    surfaceHeight,\n    fromRectangle3DScratch\n  );\n  return BoundingSphere.fromPoints(positions, result);\n};\n\n/**\n * Computes a tight-fitting bounding sphere enclosing a list of 3D points, where the points are\n * stored in a flat array in X, Y, Z, order.  The bounding sphere is computed by running two\n * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to\n * ensure a tight fit.\n *\n * @param {number[]} [positions] An array of points that the bounding sphere will enclose.  Each point\n *        is formed from three elements in the array in the order X, Y, Z.\n * @param {Cartesian3} [center=Cartesian3.ZERO] The position to which the positions are relative, which need not be the\n *        origin of the coordinate system.  This is useful when the positions are to be used for\n *        relative-to-center (RTC) rendering.\n * @param {number} [stride=3] The number of array elements per vertex.  It must be at least 3, but it may\n *        be higher.  Regardless of the value of this parameter, the X coordinate of the first position\n *        is at array index 0, the Y coordinate is at array index 1, and the Z coordinate is at array index\n *        2.  When stride is 3, the X coordinate of the next position then begins at array index 3.  If\n *        the stride is 5, however, two array elements are skipped and the next position begins at array\n *        index 5.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.\n *\n * @example\n * // Compute the bounding sphere from 3 positions, each specified relative to a center.\n * // In addition to the X, Y, and Z coordinates, the points array contains two additional\n * // elements per point which are ignored for the purpose of computing the bounding sphere.\n * const center = new Cesium.Cartesian3(1.0, 2.0, 3.0);\n * const points = [1.0, 2.0, 3.0, 0.1, 0.2,\n *               4.0, 5.0, 6.0, 0.1, 0.2,\n *               7.0, 8.0, 9.0, 0.1, 0.2];\n * const sphere = Cesium.BoundingSphere.fromVertices(points, center, 5);\n *\n * @see {@link http://blogs.agi.com/insight3d/index.php/2008/02/04/a-bounding/|Bounding Sphere computation article}\n */\nBoundingSphere.fromVertices = function (positions, center, stride, result) {\n  if (!defined(result)) {\n    result = new BoundingSphere();\n  }\n\n  if (!defined(positions) || positions.length === 0) {\n    result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\n    result.radius = 0.0;\n    return result;\n  }\n\n  center = defaultValue(center, Cartesian3.ZERO);\n\n  stride = defaultValue(stride, 3);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThanOrEquals(\"stride\", stride, 3);\n  //>>includeEnd('debug');\n\n  const currentPos = fromPointsCurrentPos;\n  currentPos.x = positions[0] + center.x;\n  currentPos.y = positions[1] + center.y;\n  currentPos.z = positions[2] + center.z;\n\n  const xMin = Cartesian3.clone(currentPos, fromPointsXMin);\n  const yMin = Cartesian3.clone(currentPos, fromPointsYMin);\n  const zMin = Cartesian3.clone(currentPos, fromPointsZMin);\n\n  const xMax = Cartesian3.clone(currentPos, fromPointsXMax);\n  const yMax = Cartesian3.clone(currentPos, fromPointsYMax);\n  const zMax = Cartesian3.clone(currentPos, fromPointsZMax);\n\n  const numElements = positions.length;\n  let i;\n  for (i = 0; i < numElements; i += stride) {\n    const x = positions[i] + center.x;\n    const y = positions[i + 1] + center.y;\n    const z = positions[i + 2] + center.z;\n\n    currentPos.x = x;\n    currentPos.y = y;\n    currentPos.z = z;\n\n    // Store points containing the the smallest and largest components\n    if (x < xMin.x) {\n      Cartesian3.clone(currentPos, xMin);\n    }\n\n    if (x > xMax.x) {\n      Cartesian3.clone(currentPos, xMax);\n    }\n\n    if (y < yMin.y) {\n      Cartesian3.clone(currentPos, yMin);\n    }\n\n    if (y > yMax.y) {\n      Cartesian3.clone(currentPos, yMax);\n    }\n\n    if (z < zMin.z) {\n      Cartesian3.clone(currentPos, zMin);\n    }\n\n    if (z > zMax.z) {\n      Cartesian3.clone(currentPos, zMax);\n    }\n  }\n\n  // Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.).\n  const xSpan = Cartesian3.magnitudeSquared(\n    Cartesian3.subtract(xMax, xMin, fromPointsScratch)\n  );\n  const ySpan = Cartesian3.magnitudeSquared(\n    Cartesian3.subtract(yMax, yMin, fromPointsScratch)\n  );\n  const zSpan = Cartesian3.magnitudeSquared(\n    Cartesian3.subtract(zMax, zMin, fromPointsScratch)\n  );\n\n  // Set the diameter endpoints to the largest span.\n  let diameter1 = xMin;\n  let diameter2 = xMax;\n  let maxSpan = xSpan;\n  if (ySpan > maxSpan) {\n    maxSpan = ySpan;\n    diameter1 = yMin;\n    diameter2 = yMax;\n  }\n  if (zSpan > maxSpan) {\n    maxSpan = zSpan;\n    diameter1 = zMin;\n    diameter2 = zMax;\n  }\n\n  // Calculate the center of the initial sphere found by Ritter's algorithm\n  const ritterCenter = fromPointsRitterCenter;\n  ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;\n  ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;\n  ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;\n\n  // Calculate the radius of the initial sphere found by Ritter's algorithm\n  let radiusSquared = Cartesian3.magnitudeSquared(\n    Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch)\n  );\n  let ritterRadius = Math.sqrt(radiusSquared);\n\n  // Find the center of the sphere found using the Naive method.\n  const minBoxPt = fromPointsMinBoxPt;\n  minBoxPt.x = xMin.x;\n  minBoxPt.y = yMin.y;\n  minBoxPt.z = zMin.z;\n\n  const maxBoxPt = fromPointsMaxBoxPt;\n  maxBoxPt.x = xMax.x;\n  maxBoxPt.y = yMax.y;\n  maxBoxPt.z = zMax.z;\n\n  const naiveCenter = Cartesian3.midpoint(\n    minBoxPt,\n    maxBoxPt,\n    fromPointsNaiveCenterScratch\n  );\n\n  // Begin 2nd pass to find naive radius and modify the ritter sphere.\n  let naiveRadius = 0;\n  for (i = 0; i < numElements; i += stride) {\n    currentPos.x = positions[i] + center.x;\n    currentPos.y = positions[i + 1] + center.y;\n    currentPos.z = positions[i + 2] + center.z;\n\n    // Find the furthest point from the naive center to calculate the naive radius.\n    const r = Cartesian3.magnitude(\n      Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch)\n    );\n    if (r > naiveRadius) {\n      naiveRadius = r;\n    }\n\n    // Make adjustments to the Ritter Sphere to include all points.\n    const oldCenterToPointSquared = Cartesian3.magnitudeSquared(\n      Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch)\n    );\n    if (oldCenterToPointSquared > radiusSquared) {\n      const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);\n      // Calculate new radius to include the point that lies outside\n      ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;\n      radiusSquared = ritterRadius * ritterRadius;\n      // Calculate center of new Ritter sphere\n      const oldToNew = oldCenterToPoint - ritterRadius;\n      ritterCenter.x =\n        (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) /\n        oldCenterToPoint;\n      ritterCenter.y =\n        (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) /\n        oldCenterToPoint;\n      ritterCenter.z =\n        (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) /\n        oldCenterToPoint;\n    }\n  }\n\n  if (ritterRadius < naiveRadius) {\n    Cartesian3.clone(ritterCenter, result.center);\n    result.radius = ritterRadius;\n  } else {\n    Cartesian3.clone(naiveCenter, result.center);\n    result.radius = naiveRadius;\n  }\n\n  return result;\n};\n\n/**\n * Computes a tight-fitting bounding sphere enclosing a list of EncodedCartesian3s, where the points are\n * stored in parallel flat arrays in X, Y, Z, order.  The bounding sphere is computed by running two\n * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to\n * ensure a tight fit.\n *\n * @param {number[]} [positionsHigh] An array of high bits of the encoded cartesians that the bounding sphere will enclose.  Each point\n *        is formed from three elements in the array in the order X, Y, Z.\n * @param {number[]} [positionsLow] An array of low bits of the encoded cartesians that the bounding sphere will enclose.  Each point\n *        is formed from three elements in the array in the order X, Y, Z.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.\n *\n * @see {@link http://blogs.agi.com/insight3d/index.php/2008/02/04/a-bounding/|Bounding Sphere computation article}\n */\nBoundingSphere.fromEncodedCartesianVertices = function (\n  positionsHigh,\n  positionsLow,\n  result\n) {\n  if (!defined(result)) {\n    result = new BoundingSphere();\n  }\n\n  if (\n    !defined(positionsHigh) ||\n    !defined(positionsLow) ||\n    positionsHigh.length !== positionsLow.length ||\n    positionsHigh.length === 0\n  ) {\n    result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\n    result.radius = 0.0;\n    return result;\n  }\n\n  const currentPos = fromPointsCurrentPos;\n  currentPos.x = positionsHigh[0] + positionsLow[0];\n  currentPos.y = positionsHigh[1] + positionsLow[1];\n  currentPos.z = positionsHigh[2] + positionsLow[2];\n\n  const xMin = Cartesian3.clone(currentPos, fromPointsXMin);\n  const yMin = Cartesian3.clone(currentPos, fromPointsYMin);\n  const zMin = Cartesian3.clone(currentPos, fromPointsZMin);\n\n  const xMax = Cartesian3.clone(currentPos, fromPointsXMax);\n  const yMax = Cartesian3.clone(currentPos, fromPointsYMax);\n  const zMax = Cartesian3.clone(currentPos, fromPointsZMax);\n\n  const numElements = positionsHigh.length;\n  let i;\n  for (i = 0; i < numElements; i += 3) {\n    const x = positionsHigh[i] + positionsLow[i];\n    const y = positionsHigh[i + 1] + positionsLow[i + 1];\n    const z = positionsHigh[i + 2] + positionsLow[i + 2];\n\n    currentPos.x = x;\n    currentPos.y = y;\n    currentPos.z = z;\n\n    // Store points containing the the smallest and largest components\n    if (x < xMin.x) {\n      Cartesian3.clone(currentPos, xMin);\n    }\n\n    if (x > xMax.x) {\n      Cartesian3.clone(currentPos, xMax);\n    }\n\n    if (y < yMin.y) {\n      Cartesian3.clone(currentPos, yMin);\n    }\n\n    if (y > yMax.y) {\n      Cartesian3.clone(currentPos, yMax);\n    }\n\n    if (z < zMin.z) {\n      Cartesian3.clone(currentPos, zMin);\n    }\n\n    if (z > zMax.z) {\n      Cartesian3.clone(currentPos, zMax);\n    }\n  }\n\n  // Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.).\n  const xSpan = Cartesian3.magnitudeSquared(\n    Cartesian3.subtract(xMax, xMin, fromPointsScratch)\n  );\n  const ySpan = Cartesian3.magnitudeSquared(\n    Cartesian3.subtract(yMax, yMin, fromPointsScratch)\n  );\n  const zSpan = Cartesian3.magnitudeSquared(\n    Cartesian3.subtract(zMax, zMin, fromPointsScratch)\n  );\n\n  // Set the diameter endpoints to the largest span.\n  let diameter1 = xMin;\n  let diameter2 = xMax;\n  let maxSpan = xSpan;\n  if (ySpan > maxSpan) {\n    maxSpan = ySpan;\n    diameter1 = yMin;\n    diameter2 = yMax;\n  }\n  if (zSpan > maxSpan) {\n    maxSpan = zSpan;\n    diameter1 = zMin;\n    diameter2 = zMax;\n  }\n\n  // Calculate the center of the initial sphere found by Ritter's algorithm\n  const ritterCenter = fromPointsRitterCenter;\n  ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;\n  ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;\n  ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;\n\n  // Calculate the radius of the initial sphere found by Ritter's algorithm\n  let radiusSquared = Cartesian3.magnitudeSquared(\n    Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch)\n  );\n  let ritterRadius = Math.sqrt(radiusSquared);\n\n  // Find the center of the sphere found using the Naive method.\n  const minBoxPt = fromPointsMinBoxPt;\n  minBoxPt.x = xMin.x;\n  minBoxPt.y = yMin.y;\n  minBoxPt.z = zMin.z;\n\n  const maxBoxPt = fromPointsMaxBoxPt;\n  maxBoxPt.x = xMax.x;\n  maxBoxPt.y = yMax.y;\n  maxBoxPt.z = zMax.z;\n\n  const naiveCenter = Cartesian3.midpoint(\n    minBoxPt,\n    maxBoxPt,\n    fromPointsNaiveCenterScratch\n  );\n\n  // Begin 2nd pass to find naive radius and modify the ritter sphere.\n  let naiveRadius = 0;\n  for (i = 0; i < numElements; i += 3) {\n    currentPos.x = positionsHigh[i] + positionsLow[i];\n    currentPos.y = positionsHigh[i + 1] + positionsLow[i + 1];\n    currentPos.z = positionsHigh[i + 2] + positionsLow[i + 2];\n\n    // Find the furthest point from the naive center to calculate the naive radius.\n    const r = Cartesian3.magnitude(\n      Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch)\n    );\n    if (r > naiveRadius) {\n      naiveRadius = r;\n    }\n\n    // Make adjustments to the Ritter Sphere to include all points.\n    const oldCenterToPointSquared = Cartesian3.magnitudeSquared(\n      Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch)\n    );\n    if (oldCenterToPointSquared > radiusSquared) {\n      const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);\n      // Calculate new radius to include the point that lies outside\n      ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;\n      radiusSquared = ritterRadius * ritterRadius;\n      // Calculate center of new Ritter sphere\n      const oldToNew = oldCenterToPoint - ritterRadius;\n      ritterCenter.x =\n        (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) /\n        oldCenterToPoint;\n      ritterCenter.y =\n        (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) /\n        oldCenterToPoint;\n      ritterCenter.z =\n        (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) /\n        oldCenterToPoint;\n    }\n  }\n\n  if (ritterRadius < naiveRadius) {\n    Cartesian3.clone(ritterCenter, result.center);\n    result.radius = ritterRadius;\n  } else {\n    Cartesian3.clone(naiveCenter, result.center);\n    result.radius = naiveRadius;\n  }\n\n  return result;\n};\n\n/**\n * Computes a bounding sphere from the corner points of an axis-aligned bounding box.  The sphere\n * tightly and fully encompasses the box.\n *\n * @param {Cartesian3} [corner] The minimum height over the rectangle.\n * @param {Cartesian3} [oppositeCorner] The maximum height over the rectangle.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n *\n * @example\n * // Create a bounding sphere around the unit cube\n * const sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5));\n */\nBoundingSphere.fromCornerPoints = function (corner, oppositeCorner, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"corner\", corner);\n  Check.typeOf.object(\"oppositeCorner\", oppositeCorner);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new BoundingSphere();\n  }\n\n  const center = Cartesian3.midpoint(corner, oppositeCorner, result.center);\n  result.radius = Cartesian3.distance(center, oppositeCorner);\n  return result;\n};\n\n/**\n * Creates a bounding sphere encompassing an ellipsoid.\n *\n * @param {Ellipsoid} ellipsoid The ellipsoid around which to create a bounding sphere.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n *\n * @example\n * const boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid);\n */\nBoundingSphere.fromEllipsoid = function (ellipsoid, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"ellipsoid\", ellipsoid);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new BoundingSphere();\n  }\n\n  Cartesian3.clone(Cartesian3.ZERO, result.center);\n  result.radius = ellipsoid.maximumRadius;\n  return result;\n};\n\nconst fromBoundingSpheresScratch = new Cartesian3();\n\n/**\n * Computes a tight-fitting bounding sphere enclosing the provided array of bounding spheres.\n *\n * @param {BoundingSphere[]} [boundingSpheres] The array of bounding spheres.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.fromBoundingSpheres = function (boundingSpheres, result) {\n  if (!defined(result)) {\n    result = new BoundingSphere();\n  }\n\n  if (!defined(boundingSpheres) || boundingSpheres.length === 0) {\n    result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\n    result.radius = 0.0;\n    return result;\n  }\n\n  const length = boundingSpheres.length;\n  if (length === 1) {\n    return BoundingSphere.clone(boundingSpheres[0], result);\n  }\n\n  if (length === 2) {\n    return BoundingSphere.union(boundingSpheres[0], boundingSpheres[1], result);\n  }\n\n  const positions = [];\n  let i;\n  for (i = 0; i < length; i++) {\n    positions.push(boundingSpheres[i].center);\n  }\n\n  result = BoundingSphere.fromPoints(positions, result);\n\n  const center = result.center;\n  let radius = result.radius;\n  for (i = 0; i < length; i++) {\n    const tmp = boundingSpheres[i];\n    radius = Math.max(\n      radius,\n      Cartesian3.distance(center, tmp.center, fromBoundingSpheresScratch) +\n        tmp.radius\n    );\n  }\n  result.radius = radius;\n\n  return result;\n};\n\nconst fromOrientedBoundingBoxScratchU = new Cartesian3();\nconst fromOrientedBoundingBoxScratchV = new Cartesian3();\nconst fromOrientedBoundingBoxScratchW = new Cartesian3();\n\n/**\n * Computes a tight-fitting bounding sphere enclosing the provided oriented bounding box.\n *\n * @param {OrientedBoundingBox} orientedBoundingBox The oriented bounding box.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.fromOrientedBoundingBox = function (\n  orientedBoundingBox,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"orientedBoundingBox\", orientedBoundingBox);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new BoundingSphere();\n  }\n\n  const halfAxes = orientedBoundingBox.halfAxes;\n  const u = Matrix3.getColumn(halfAxes, 0, fromOrientedBoundingBoxScratchU);\n  const v = Matrix3.getColumn(halfAxes, 1, fromOrientedBoundingBoxScratchV);\n  const w = Matrix3.getColumn(halfAxes, 2, fromOrientedBoundingBoxScratchW);\n\n  Cartesian3.add(u, v, u);\n  Cartesian3.add(u, w, u);\n\n  result.center = Cartesian3.clone(orientedBoundingBox.center, result.center);\n  result.radius = Cartesian3.magnitude(u);\n\n  return result;\n};\n\nconst scratchFromTransformationCenter = new Cartesian3();\nconst scratchFromTransformationScale = new Cartesian3();\n\n/**\n * Computes a tight-fitting bounding sphere enclosing the provided affine transformation.\n *\n * @param {Matrix4} transformation The affine transformation.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.fromTransformation = function (transformation, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"transformation\", transformation);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new BoundingSphere();\n  }\n\n  const center = Matrix4.getTranslation(\n    transformation,\n    scratchFromTransformationCenter\n  );\n  const scale = Matrix4.getScale(\n    transformation,\n    scratchFromTransformationScale\n  );\n  const radius = 0.5 * Cartesian3.magnitude(scale);\n  result.center = Cartesian3.clone(center, result.center);\n  result.radius = radius;\n\n  return result;\n};\n\n/**\n * Duplicates a BoundingSphere instance.\n *\n * @param {BoundingSphere} sphere The bounding sphere to duplicate.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. (Returns undefined if sphere is undefined)\n */\nBoundingSphere.clone = function (sphere, result) {\n  if (!defined(sphere)) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    return new BoundingSphere(sphere.center, sphere.radius);\n  }\n\n  result.center = Cartesian3.clone(sphere.center, result.center);\n  result.radius = sphere.radius;\n  return result;\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nBoundingSphere.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {BoundingSphere} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nBoundingSphere.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const center = value.center;\n  array[startingIndex++] = center.x;\n  array[startingIndex++] = center.y;\n  array[startingIndex++] = center.z;\n  array[startingIndex] = value.radius;\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {BoundingSphere} [result] The object into which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.\n */\nBoundingSphere.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new BoundingSphere();\n  }\n\n  const center = result.center;\n  center.x = array[startingIndex++];\n  center.y = array[startingIndex++];\n  center.z = array[startingIndex++];\n  result.radius = array[startingIndex];\n  return result;\n};\n\nconst unionScratch = new Cartesian3();\nconst unionScratchCenter = new Cartesian3();\n/**\n * Computes a bounding sphere that contains both the left and right bounding spheres.\n *\n * @param {BoundingSphere} left A sphere to enclose in a bounding sphere.\n * @param {BoundingSphere} right A sphere to enclose in a bounding sphere.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.union = function (left, right, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  Check.typeOf.object(\"right\", right);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new BoundingSphere();\n  }\n\n  const leftCenter = left.center;\n  const leftRadius = left.radius;\n  const rightCenter = right.center;\n  const rightRadius = right.radius;\n\n  const toRightCenter = Cartesian3.subtract(\n    rightCenter,\n    leftCenter,\n    unionScratch\n  );\n  const centerSeparation = Cartesian3.magnitude(toRightCenter);\n\n  if (leftRadius >= centerSeparation + rightRadius) {\n    // Left sphere wins.\n    left.clone(result);\n    return result;\n  }\n\n  if (rightRadius >= centerSeparation + leftRadius) {\n    // Right sphere wins.\n    right.clone(result);\n    return result;\n  }\n\n  // There are two tangent points, one on far side of each sphere.\n  const halfDistanceBetweenTangentPoints =\n    (leftRadius + centerSeparation + rightRadius) * 0.5;\n\n  // Compute the center point halfway between the two tangent points.\n  const center = Cartesian3.multiplyByScalar(\n    toRightCenter,\n    (-leftRadius + halfDistanceBetweenTangentPoints) / centerSeparation,\n    unionScratchCenter\n  );\n  Cartesian3.add(center, leftCenter, center);\n  Cartesian3.clone(center, result.center);\n  result.radius = halfDistanceBetweenTangentPoints;\n\n  return result;\n};\n\nconst expandScratch = new Cartesian3();\n/**\n * Computes a bounding sphere by enlarging the provided sphere to contain the provided point.\n *\n * @param {BoundingSphere} sphere A sphere to expand.\n * @param {Cartesian3} point A point to enclose in a bounding sphere.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.expand = function (sphere, point, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"sphere\", sphere);\n  Check.typeOf.object(\"point\", point);\n  //>>includeEnd('debug');\n\n  result = BoundingSphere.clone(sphere, result);\n\n  const radius = Cartesian3.magnitude(\n    Cartesian3.subtract(point, result.center, expandScratch)\n  );\n  if (radius > result.radius) {\n    result.radius = radius;\n  }\n\n  return result;\n};\n\n/**\n * Determines which side of a plane a sphere is located.\n *\n * @param {BoundingSphere} sphere The bounding sphere to test.\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire sphere is on the side of the plane\n *                      the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is\n *                      on the opposite side, and {@link Intersect.INTERSECTING} if the sphere\n *                      intersects the plane.\n */\nBoundingSphere.intersectPlane = function (sphere, plane) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"sphere\", sphere);\n  Check.typeOf.object(\"plane\", plane);\n  //>>includeEnd('debug');\n\n  const center = sphere.center;\n  const radius = sphere.radius;\n  const normal = plane.normal;\n  const distanceToPlane = Cartesian3.dot(normal, center) + plane.distance;\n\n  if (distanceToPlane < -radius) {\n    // The center point is negative side of the plane normal\n    return Intersect.OUTSIDE;\n  } else if (distanceToPlane < radius) {\n    // The center point is positive side of the plane, but radius extends beyond it; partial overlap\n    return Intersect.INTERSECTING;\n  }\n  return Intersect.INSIDE;\n};\n\n/**\n * Applies a 4x4 affine transformation matrix to a bounding sphere.\n *\n * @param {BoundingSphere} sphere The bounding sphere to apply the transformation to.\n * @param {Matrix4} transform The transformation matrix to apply to the bounding sphere.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.transform = function (sphere, transform, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"sphere\", sphere);\n  Check.typeOf.object(\"transform\", transform);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new BoundingSphere();\n  }\n\n  result.center = Matrix4.multiplyByPoint(\n    transform,\n    sphere.center,\n    result.center\n  );\n  result.radius = Matrix4.getMaximumScale(transform) * sphere.radius;\n\n  return result;\n};\n\nconst distanceSquaredToScratch = new Cartesian3();\n\n/**\n * Computes the estimated distance squared from the closest point on a bounding sphere to a point.\n *\n * @param {BoundingSphere} sphere The sphere.\n * @param {Cartesian3} cartesian The point\n * @returns {number} The distance squared from the bounding sphere to the point. Returns 0 if the point is inside the sphere.\n *\n * @example\n * // Sort bounding spheres from back to front\n * spheres.sort(function(a, b) {\n *     return Cesium.BoundingSphere.distanceSquaredTo(b, camera.positionWC) - Cesium.BoundingSphere.distanceSquaredTo(a, camera.positionWC);\n * });\n */\nBoundingSphere.distanceSquaredTo = function (sphere, cartesian) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"sphere\", sphere);\n  Check.typeOf.object(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  const diff = Cartesian3.subtract(\n    sphere.center,\n    cartesian,\n    distanceSquaredToScratch\n  );\n\n  const distance = Cartesian3.magnitude(diff) - sphere.radius;\n  if (distance <= 0.0) {\n    return 0.0;\n  }\n\n  return distance * distance;\n};\n\n/**\n * Applies a 4x4 affine transformation matrix to a bounding sphere where there is no scale\n * The transformation matrix is not verified to have a uniform scale of 1.\n * This method is faster than computing the general bounding sphere transform using {@link BoundingSphere.transform}.\n *\n * @param {BoundingSphere} sphere The bounding sphere to apply the transformation to.\n * @param {Matrix4} transform The transformation matrix to apply to the bounding sphere.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n *\n * @example\n * const modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid);\n * const boundingSphere = new Cesium.BoundingSphere();\n * const newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix);\n */\nBoundingSphere.transformWithoutScale = function (sphere, transform, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"sphere\", sphere);\n  Check.typeOf.object(\"transform\", transform);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new BoundingSphere();\n  }\n\n  result.center = Matrix4.multiplyByPoint(\n    transform,\n    sphere.center,\n    result.center\n  );\n  result.radius = sphere.radius;\n\n  return result;\n};\n\nconst scratchCartesian3 = new Cartesian3();\n/**\n * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction\n * plus/minus the radius of the bounding sphere.\n * <br>\n * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the\n * closest and farthest planes from position that intersect the bounding sphere.\n *\n * @param {BoundingSphere} sphere The bounding sphere to calculate the distance to.\n * @param {Cartesian3} position The position to calculate the distance from.\n * @param {Cartesian3} direction The direction from position.\n * @param {Interval} [result] A Interval to store the nearest and farthest distances.\n * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction.\n */\nBoundingSphere.computePlaneDistances = function (\n  sphere,\n  position,\n  direction,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"sphere\", sphere);\n  Check.typeOf.object(\"position\", position);\n  Check.typeOf.object(\"direction\", direction);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Interval();\n  }\n\n  const toCenter = Cartesian3.subtract(\n    sphere.center,\n    position,\n    scratchCartesian3\n  );\n  const mag = Cartesian3.dot(direction, toCenter);\n\n  result.start = mag - sphere.radius;\n  result.stop = mag + sphere.radius;\n  return result;\n};\n\nconst projectTo2DNormalScratch = new Cartesian3();\nconst projectTo2DEastScratch = new Cartesian3();\nconst projectTo2DNorthScratch = new Cartesian3();\nconst projectTo2DWestScratch = new Cartesian3();\nconst projectTo2DSouthScratch = new Cartesian3();\nconst projectTo2DCartographicScratch = new Cartographic();\nconst projectTo2DPositionsScratch = new Array(8);\nfor (let n = 0; n < 8; ++n) {\n  projectTo2DPositionsScratch[n] = new Cartesian3();\n}\n\nconst projectTo2DProjection = new GeographicProjection();\n/**\n * Creates a bounding sphere in 2D from a bounding sphere in 3D world coordinates.\n *\n * @param {BoundingSphere} sphere The bounding sphere to transform to 2D.\n * @param {object} [projection=GeographicProjection] The projection to 2D.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.projectTo2D = function (sphere, projection, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"sphere\", sphere);\n  //>>includeEnd('debug');\n\n  projection = defaultValue(projection, projectTo2DProjection);\n\n  const ellipsoid = projection.ellipsoid;\n  let center = sphere.center;\n  const radius = sphere.radius;\n\n  let normal;\n  if (Cartesian3.equals(center, Cartesian3.ZERO)) {\n    // Bounding sphere is at the center. The geodetic surface normal is not\n    // defined here so pick the x-axis as a fallback.\n    normal = Cartesian3.clone(Cartesian3.UNIT_X, projectTo2DNormalScratch);\n  } else {\n    normal = ellipsoid.geodeticSurfaceNormal(center, projectTo2DNormalScratch);\n  }\n  const east = Cartesian3.cross(\n    Cartesian3.UNIT_Z,\n    normal,\n    projectTo2DEastScratch\n  );\n  Cartesian3.normalize(east, east);\n  const north = Cartesian3.cross(normal, east, projectTo2DNorthScratch);\n  Cartesian3.normalize(north, north);\n\n  Cartesian3.multiplyByScalar(normal, radius, normal);\n  Cartesian3.multiplyByScalar(north, radius, north);\n  Cartesian3.multiplyByScalar(east, radius, east);\n\n  const south = Cartesian3.negate(north, projectTo2DSouthScratch);\n  const west = Cartesian3.negate(east, projectTo2DWestScratch);\n\n  const positions = projectTo2DPositionsScratch;\n\n  // top NE corner\n  let corner = positions[0];\n  Cartesian3.add(normal, north, corner);\n  Cartesian3.add(corner, east, corner);\n\n  // top NW corner\n  corner = positions[1];\n  Cartesian3.add(normal, north, corner);\n  Cartesian3.add(corner, west, corner);\n\n  // top SW corner\n  corner = positions[2];\n  Cartesian3.add(normal, south, corner);\n  Cartesian3.add(corner, west, corner);\n\n  // top SE corner\n  corner = positions[3];\n  Cartesian3.add(normal, south, corner);\n  Cartesian3.add(corner, east, corner);\n\n  Cartesian3.negate(normal, normal);\n\n  // bottom NE corner\n  corner = positions[4];\n  Cartesian3.add(normal, north, corner);\n  Cartesian3.add(corner, east, corner);\n\n  // bottom NW corner\n  corner = positions[5];\n  Cartesian3.add(normal, north, corner);\n  Cartesian3.add(corner, west, corner);\n\n  // bottom SW corner\n  corner = positions[6];\n  Cartesian3.add(normal, south, corner);\n  Cartesian3.add(corner, west, corner);\n\n  // bottom SE corner\n  corner = positions[7];\n  Cartesian3.add(normal, south, corner);\n  Cartesian3.add(corner, east, corner);\n\n  const length = positions.length;\n  for (let i = 0; i < length; ++i) {\n    const position = positions[i];\n    Cartesian3.add(center, position, position);\n    const cartographic = ellipsoid.cartesianToCartographic(\n      position,\n      projectTo2DCartographicScratch\n    );\n    projection.project(cartographic, position);\n  }\n\n  result = BoundingSphere.fromPoints(positions, result);\n\n  // swizzle center components\n  center = result.center;\n  const x = center.x;\n  const y = center.y;\n  const z = center.z;\n  center.x = z;\n  center.y = x;\n  center.z = y;\n\n  return result;\n};\n\n/**\n * Determines whether or not a sphere is hidden from view by the occluder.\n *\n * @param {BoundingSphere} sphere The bounding sphere surrounding the occludee object.\n * @param {Occluder} occluder The occluder.\n * @returns {boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>.\n */\nBoundingSphere.isOccluded = function (sphere, occluder) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"sphere\", sphere);\n  Check.typeOf.object(\"occluder\", occluder);\n  //>>includeEnd('debug');\n  return !occluder.isBoundingSphereVisible(sphere);\n};\n\n/**\n * Compares the provided BoundingSphere componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {BoundingSphere} [left] The first BoundingSphere.\n * @param {BoundingSphere} [right] The second BoundingSphere.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nBoundingSphere.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      Cartesian3.equals(left.center, right.center) &&\n      left.radius === right.radius)\n  );\n};\n\n/**\n * Determines which side of a plane the sphere is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire sphere is on the side of the plane\n *                      the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is\n *                      on the opposite side, and {@link Intersect.INTERSECTING} if the sphere\n *                      intersects the plane.\n */\nBoundingSphere.prototype.intersectPlane = function (plane) {\n  return BoundingSphere.intersectPlane(this, plane);\n};\n\n/**\n * Computes the estimated distance squared from the closest point on a bounding sphere to a point.\n *\n * @param {Cartesian3} cartesian The point\n * @returns {number} The estimated distance squared from the bounding sphere to the point.\n *\n * @example\n * // Sort bounding spheres from back to front\n * spheres.sort(function(a, b) {\n *     return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);\n * });\n */\nBoundingSphere.prototype.distanceSquaredTo = function (cartesian) {\n  return BoundingSphere.distanceSquaredTo(this, cartesian);\n};\n\n/**\n * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction\n * plus/minus the radius of the bounding sphere.\n * <br>\n * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the\n * closest and farthest planes from position that intersect the bounding sphere.\n *\n * @param {Cartesian3} position The position to calculate the distance from.\n * @param {Cartesian3} direction The direction from position.\n * @param {Interval} [result] A Interval to store the nearest and farthest distances.\n * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction.\n */\nBoundingSphere.prototype.computePlaneDistances = function (\n  position,\n  direction,\n  result\n) {\n  return BoundingSphere.computePlaneDistances(\n    this,\n    position,\n    direction,\n    result\n  );\n};\n\n/**\n * Determines whether or not a sphere is hidden from view by the occluder.\n *\n * @param {Occluder} occluder The occluder.\n * @returns {boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>.\n */\nBoundingSphere.prototype.isOccluded = function (occluder) {\n  return BoundingSphere.isOccluded(this, occluder);\n};\n\n/**\n * Compares this BoundingSphere against the provided BoundingSphere componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {BoundingSphere} [right] The right hand side BoundingSphere.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nBoundingSphere.prototype.equals = function (right) {\n  return BoundingSphere.equals(this, right);\n};\n\n/**\n * Duplicates this BoundingSphere instance.\n *\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.prototype.clone = function (result) {\n  return BoundingSphere.clone(this, result);\n};\n\n/**\n * Computes the radius of the BoundingSphere.\n * @returns {number} The radius of the BoundingSphere.\n */\nBoundingSphere.prototype.volume = function () {\n  const radius = this.radius;\n  return volumeConstant * radius * radius * radius;\n};\nexport default BoundingSphere;\n", "import defaultValue from \"./defaultValue.js\";\n\n/**\n * Attributes, which make up a geometry's vertices.  Each property in this object corresponds to a\n * {@link GeometryAttribute} containing the attribute's data.\n * <p>\n * Attributes are always stored non-interleaved in a Geometry.\n * </p>\n *\n * @alias GeometryAttributes\n * @constructor\n */\nfunction GeometryAttributes(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * The 3D position attribute.\n   * <p>\n   * 64-bit floating-point (for precision).  3 components per attribute.\n   * </p>\n   *\n   * @type GeometryAttribute\n   *\n   * @default undefined\n   */\n  this.position = options.position;\n\n  /**\n   * The normal attribute (normalized), which is commonly used for lighting.\n   * <p>\n   * 32-bit floating-point.  3 components per attribute.\n   * </p>\n   *\n   * @type GeometryAttribute\n   *\n   * @default undefined\n   */\n  this.normal = options.normal;\n\n  /**\n   * The 2D texture coordinate attribute.\n   * <p>\n   * 32-bit floating-point.  2 components per attribute\n   * </p>\n   *\n   * @type GeometryAttribute\n   *\n   * @default undefined\n   */\n  this.st = options.st;\n\n  /**\n   * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.\n   * <p>\n   * 32-bit floating-point.  3 components per attribute.\n   * </p>\n   *\n   * @type GeometryAttribute\n   *\n   * @default undefined\n   */\n  this.bitangent = options.bitangent;\n\n  /**\n   * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping.\n   * <p>\n   * 32-bit floating-point.  3 components per attribute.\n   * </p>\n   *\n   * @type GeometryAttribute\n   *\n   * @default undefined\n   */\n  this.tangent = options.tangent;\n\n  /**\n   * The color attribute.\n   * <p>\n   * 8-bit unsigned integer. 4 components per attribute.\n   * </p>\n   *\n   * @type GeometryAttribute\n   *\n   * @default undefined\n   */\n  this.color = options.color;\n}\nexport default GeometryAttributes;\n", "/**\n * Represents which vertices should have a value of `true` for the `applyOffset` attribute\n * @private\n */\nconst GeometryOffsetAttribute = {\n  NONE: 0,\n  TOP: 1,\n  ALL: 2,\n};\nexport default Object.freeze(GeometryOffsetAttribute);\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * A vertex format defines what attributes make up a vertex.  A VertexFormat can be provided\n * to a {@link Geometry} to request that certain properties be computed, e.g., just position,\n * position and normal, etc.\n *\n * @param {object} [options] An object with boolean properties corresponding to VertexFormat properties as shown in the code example.\n *\n * @alias VertexFormat\n * @constructor\n *\n * @example\n * // Create a vertex format with position and 2D texture coordinate attributes.\n * const format = new Cesium.VertexFormat({\n *   position : true,\n *   st : true\n * });\n *\n * @see Geometry#attributes\n * @see Packable\n */\nfunction VertexFormat(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * When <code>true</code>, the vertex has a 3D position attribute.\n   * <p>\n   * 64-bit floating-point (for precision).  3 components per attribute.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.position = defaultValue(options.position, false);\n\n  /**\n   * When <code>true</code>, the vertex has a normal attribute (normalized), which is commonly used for lighting.\n   * <p>\n   * 32-bit floating-point.  3 components per attribute.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.normal = defaultValue(options.normal, false);\n\n  /**\n   * When <code>true</code>, the vertex has a 2D texture coordinate attribute.\n   * <p>\n   * 32-bit floating-point.  2 components per attribute\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.st = defaultValue(options.st, false);\n\n  /**\n   * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.\n   * <p>\n   * 32-bit floating-point.  3 components per attribute.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.bitangent = defaultValue(options.bitangent, false);\n\n  /**\n   * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping.\n   * <p>\n   * 32-bit floating-point.  3 components per attribute.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.tangent = defaultValue(options.tangent, false);\n\n  /**\n   * When <code>true</code>, the vertex has an RGB color attribute.\n   * <p>\n   * 8-bit unsigned byte.  3 components per attribute.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.color = defaultValue(options.color, false);\n}\n\n/**\n * An immutable vertex format with only a position attribute.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n */\nVertexFormat.POSITION_ONLY = Object.freeze(\n  new VertexFormat({\n    position: true,\n  })\n);\n\n/**\n * An immutable vertex format with position and normal attributes.\n * This is compatible with per-instance color appearances like {@link PerInstanceColorAppearance}.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n * @see VertexFormat#normal\n */\nVertexFormat.POSITION_AND_NORMAL = Object.freeze(\n  new VertexFormat({\n    position: true,\n    normal: true,\n  })\n);\n\n/**\n * An immutable vertex format with position, normal, and st attributes.\n * This is compatible with {@link MaterialAppearance} when {@link MaterialAppearance#materialSupport}\n * is <code>TEXTURED/code>.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n * @see VertexFormat#normal\n * @see VertexFormat#st\n */\nVertexFormat.POSITION_NORMAL_AND_ST = Object.freeze(\n  new VertexFormat({\n    position: true,\n    normal: true,\n    st: true,\n  })\n);\n\n/**\n * An immutable vertex format with position and st attributes.\n * This is compatible with {@link EllipsoidSurfaceAppearance}.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n * @see VertexFormat#st\n */\nVertexFormat.POSITION_AND_ST = Object.freeze(\n  new VertexFormat({\n    position: true,\n    st: true,\n  })\n);\n\n/**\n * An immutable vertex format with position and color attributes.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n * @see VertexFormat#color\n */\nVertexFormat.POSITION_AND_COLOR = Object.freeze(\n  new VertexFormat({\n    position: true,\n    color: true,\n  })\n);\n\n/**\n * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n * @see VertexFormat#normal\n * @see VertexFormat#st\n * @see VertexFormat#tangent\n * @see VertexFormat#bitangent\n */\nVertexFormat.ALL = Object.freeze(\n  new VertexFormat({\n    position: true,\n    normal: true,\n    st: true,\n    tangent: true,\n    bitangent: true,\n  })\n);\n\n/**\n * An immutable vertex format with position, normal, and st attributes.\n * This is compatible with most appearances and materials; however\n * normal and st attributes are not always required.  When this is\n * known in advance, another <code>VertexFormat</code> should be used.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n * @see VertexFormat#normal\n */\nVertexFormat.DEFAULT = VertexFormat.POSITION_NORMAL_AND_ST;\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nVertexFormat.packedLength = 6;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {VertexFormat} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nVertexFormat.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required\");\n  }\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  array[startingIndex++] = value.position ? 1.0 : 0.0;\n  array[startingIndex++] = value.normal ? 1.0 : 0.0;\n  array[startingIndex++] = value.st ? 1.0 : 0.0;\n  array[startingIndex++] = value.tangent ? 1.0 : 0.0;\n  array[startingIndex++] = value.bitangent ? 1.0 : 0.0;\n  array[startingIndex] = value.color ? 1.0 : 0.0;\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {VertexFormat} [result] The object into which to store the result.\n * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided.\n */\nVertexFormat.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new VertexFormat();\n  }\n\n  result.position = array[startingIndex++] === 1.0;\n  result.normal = array[startingIndex++] === 1.0;\n  result.st = array[startingIndex++] === 1.0;\n  result.tangent = array[startingIndex++] === 1.0;\n  result.bitangent = array[startingIndex++] === 1.0;\n  result.color = array[startingIndex] === 1.0;\n  return result;\n};\n\n/**\n * Duplicates a VertexFormat instance.\n *\n * @param {VertexFormat} vertexFormat The vertex format to duplicate.\n * @param {VertexFormat} [result] The object onto which to store the result.\n * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined)\n */\nVertexFormat.clone = function (vertexFormat, result) {\n  if (!defined(vertexFormat)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    result = new VertexFormat();\n  }\n\n  result.position = vertexFormat.position;\n  result.normal = vertexFormat.normal;\n  result.st = vertexFormat.st;\n  result.tangent = vertexFormat.tangent;\n  result.bitangent = vertexFormat.bitangent;\n  result.color = vertexFormat.color;\n  return result;\n};\nexport default VertexFormat;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst diffScratch = new Cartesian3();\n\n/**\n * Describes a cube centered at the origin.\n *\n * @alias BoxGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3} options.minimum The minimum x, y, and z coordinates of the box.\n * @param {Cartesian3} options.maximum The maximum x, y, and z coordinates of the box.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @see BoxGeometry.fromDimensions\n * @see BoxGeometry.createGeometry\n * @see Packable\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Box.html|Cesium Sandcastle Box Demo}\n *\n * @example\n * const box = new Cesium.BoxGeometry({\n *   vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\n *   maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),\n *   minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)\n * });\n * const geometry = Cesium.BoxGeometry.createGeometry(box);\n */\nfunction BoxGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const min = options.minimum;\n  const max = options.maximum;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"min\", min);\n  Check.typeOf.object(\"max\", max);\n  if (\n    defined(options.offsetAttribute) &&\n    options.offsetAttribute === GeometryOffsetAttribute.TOP\n  ) {\n    throw new DeveloperError(\n      \"GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n\n  this._minimum = Cartesian3.clone(min);\n  this._maximum = Cartesian3.clone(max);\n  this._vertexFormat = vertexFormat;\n  this._offsetAttribute = options.offsetAttribute;\n  this._workerName = \"createBoxGeometry\";\n}\n\n/**\n * Creates a cube centered at the origin given its dimensions.\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3} options.dimensions The width, depth, and height of the box stored in the x, y, and z coordinates of the <code>Cartesian3</code>, respectively.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @returns {BoxGeometry}\n *\n * @exception {DeveloperError} All dimensions components must be greater than or equal to zero.\n *\n *\n * @example\n * const box = Cesium.BoxGeometry.fromDimensions({\n *   vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\n *   dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)\n * });\n * const geometry = Cesium.BoxGeometry.createGeometry(box);\n *\n * @see BoxGeometry.createGeometry\n */\nBoxGeometry.fromDimensions = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const dimensions = options.dimensions;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"dimensions\", dimensions);\n  Check.typeOf.number.greaterThanOrEquals(\"dimensions.x\", dimensions.x, 0);\n  Check.typeOf.number.greaterThanOrEquals(\"dimensions.y\", dimensions.y, 0);\n  Check.typeOf.number.greaterThanOrEquals(\"dimensions.z\", dimensions.z, 0);\n  //>>includeEnd('debug');\n\n  const corner = Cartesian3.multiplyByScalar(dimensions, 0.5, new Cartesian3());\n\n  return new BoxGeometry({\n    minimum: Cartesian3.negate(corner, new Cartesian3()),\n    maximum: corner,\n    vertexFormat: options.vertexFormat,\n    offsetAttribute: options.offsetAttribute,\n  });\n};\n\n/**\n * Creates a cube from the dimensions of an AxisAlignedBoundingBox.\n *\n * @param {AxisAlignedBoundingBox} boundingBox A description of the AxisAlignedBoundingBox.\n * @returns {BoxGeometry}\n *\n *\n *\n * @example\n * const aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([\n *      -72.0, 40.0,\n *      -70.0, 35.0,\n *      -75.0, 30.0,\n *      -70.0, 30.0,\n *      -68.0, 40.0\n * ]));\n * const box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb);\n *\n * @see BoxGeometry.createGeometry\n */\nBoxGeometry.fromAxisAlignedBoundingBox = function (boundingBox) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"boundingBox\", boundingBox);\n  //>>includeEnd('debug');\n\n  return new BoxGeometry({\n    minimum: boundingBox.minimum,\n    maximum: boundingBox.maximum,\n  });\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nBoxGeometry.packedLength =\n  2 * Cartesian3.packedLength + VertexFormat.packedLength + 1;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {BoxGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nBoxGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  Cartesian3.pack(value._minimum, array, startingIndex);\n  Cartesian3.pack(\n    value._maximum,\n    array,\n    startingIndex + Cartesian3.packedLength\n  );\n  VertexFormat.pack(\n    value._vertexFormat,\n    array,\n    startingIndex + 2 * Cartesian3.packedLength\n  );\n  array[\n    startingIndex + 2 * Cartesian3.packedLength + VertexFormat.packedLength\n  ] = defaultValue(value._offsetAttribute, -1);\n\n  return array;\n};\n\nconst scratchMin = new Cartesian3();\nconst scratchMax = new Cartesian3();\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n  minimum: scratchMin,\n  maximum: scratchMax,\n  vertexFormat: scratchVertexFormat,\n  offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {BoxGeometry} [result] The object into which to store the result.\n * @returns {BoxGeometry} The modified result parameter or a new BoxGeometry instance if one was not provided.\n */\nBoxGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const min = Cartesian3.unpack(array, startingIndex, scratchMin);\n  const max = Cartesian3.unpack(\n    array,\n    startingIndex + Cartesian3.packedLength,\n    scratchMax\n  );\n  const vertexFormat = VertexFormat.unpack(\n    array,\n    startingIndex + 2 * Cartesian3.packedLength,\n    scratchVertexFormat\n  );\n  const offsetAttribute =\n    array[\n      startingIndex + 2 * Cartesian3.packedLength + VertexFormat.packedLength\n    ];\n\n  if (!defined(result)) {\n    scratchOptions.offsetAttribute =\n      offsetAttribute === -1 ? undefined : offsetAttribute;\n    return new BoxGeometry(scratchOptions);\n  }\n\n  result._minimum = Cartesian3.clone(min, result._minimum);\n  result._maximum = Cartesian3.clone(max, result._maximum);\n  result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n  result._offsetAttribute =\n    offsetAttribute === -1 ? undefined : offsetAttribute;\n\n  return result;\n};\n\n/**\n * Computes the geometric representation of a box, including its vertices, indices, and a bounding sphere.\n *\n * @param {BoxGeometry} boxGeometry A description of the box.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nBoxGeometry.createGeometry = function (boxGeometry) {\n  const min = boxGeometry._minimum;\n  const max = boxGeometry._maximum;\n  const vertexFormat = boxGeometry._vertexFormat;\n\n  if (Cartesian3.equals(min, max)) {\n    return;\n  }\n\n  const attributes = new GeometryAttributes();\n  let indices;\n  let positions;\n\n  if (\n    vertexFormat.position &&\n    (vertexFormat.st ||\n      vertexFormat.normal ||\n      vertexFormat.tangent ||\n      vertexFormat.bitangent)\n  ) {\n    if (vertexFormat.position) {\n      // 8 corner points.  Duplicated 3 times each for each incident edge/face.\n      positions = new Float64Array(6 * 4 * 3);\n\n      // +z face\n      positions[0] = min.x;\n      positions[1] = min.y;\n      positions[2] = max.z;\n      positions[3] = max.x;\n      positions[4] = min.y;\n      positions[5] = max.z;\n      positions[6] = max.x;\n      positions[7] = max.y;\n      positions[8] = max.z;\n      positions[9] = min.x;\n      positions[10] = max.y;\n      positions[11] = max.z;\n\n      // -z face\n      positions[12] = min.x;\n      positions[13] = min.y;\n      positions[14] = min.z;\n      positions[15] = max.x;\n      positions[16] = min.y;\n      positions[17] = min.z;\n      positions[18] = max.x;\n      positions[19] = max.y;\n      positions[20] = min.z;\n      positions[21] = min.x;\n      positions[22] = max.y;\n      positions[23] = min.z;\n\n      // +x face\n      positions[24] = max.x;\n      positions[25] = min.y;\n      positions[26] = min.z;\n      positions[27] = max.x;\n      positions[28] = max.y;\n      positions[29] = min.z;\n      positions[30] = max.x;\n      positions[31] = max.y;\n      positions[32] = max.z;\n      positions[33] = max.x;\n      positions[34] = min.y;\n      positions[35] = max.z;\n\n      // -x face\n      positions[36] = min.x;\n      positions[37] = min.y;\n      positions[38] = min.z;\n      positions[39] = min.x;\n      positions[40] = max.y;\n      positions[41] = min.z;\n      positions[42] = min.x;\n      positions[43] = max.y;\n      positions[44] = max.z;\n      positions[45] = min.x;\n      positions[46] = min.y;\n      positions[47] = max.z;\n\n      // +y face\n      positions[48] = min.x;\n      positions[49] = max.y;\n      positions[50] = min.z;\n      positions[51] = max.x;\n      positions[52] = max.y;\n      positions[53] = min.z;\n      positions[54] = max.x;\n      positions[55] = max.y;\n      positions[56] = max.z;\n      positions[57] = min.x;\n      positions[58] = max.y;\n      positions[59] = max.z;\n\n      // -y face\n      positions[60] = min.x;\n      positions[61] = min.y;\n      positions[62] = min.z;\n      positions[63] = max.x;\n      positions[64] = min.y;\n      positions[65] = min.z;\n      positions[66] = max.x;\n      positions[67] = min.y;\n      positions[68] = max.z;\n      positions[69] = min.x;\n      positions[70] = min.y;\n      positions[71] = max.z;\n\n      attributes.position = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.DOUBLE,\n        componentsPerAttribute: 3,\n        values: positions,\n      });\n    }\n\n    if (vertexFormat.normal) {\n      const normals = new Float32Array(6 * 4 * 3);\n\n      // +z face\n      normals[0] = 0.0;\n      normals[1] = 0.0;\n      normals[2] = 1.0;\n      normals[3] = 0.0;\n      normals[4] = 0.0;\n      normals[5] = 1.0;\n      normals[6] = 0.0;\n      normals[7] = 0.0;\n      normals[8] = 1.0;\n      normals[9] = 0.0;\n      normals[10] = 0.0;\n      normals[11] = 1.0;\n\n      // -z face\n      normals[12] = 0.0;\n      normals[13] = 0.0;\n      normals[14] = -1.0;\n      normals[15] = 0.0;\n      normals[16] = 0.0;\n      normals[17] = -1.0;\n      normals[18] = 0.0;\n      normals[19] = 0.0;\n      normals[20] = -1.0;\n      normals[21] = 0.0;\n      normals[22] = 0.0;\n      normals[23] = -1.0;\n\n      // +x face\n      normals[24] = 1.0;\n      normals[25] = 0.0;\n      normals[26] = 0.0;\n      normals[27] = 1.0;\n      normals[28] = 0.0;\n      normals[29] = 0.0;\n      normals[30] = 1.0;\n      normals[31] = 0.0;\n      normals[32] = 0.0;\n      normals[33] = 1.0;\n      normals[34] = 0.0;\n      normals[35] = 0.0;\n\n      // -x face\n      normals[36] = -1.0;\n      normals[37] = 0.0;\n      normals[38] = 0.0;\n      normals[39] = -1.0;\n      normals[40] = 0.0;\n      normals[41] = 0.0;\n      normals[42] = -1.0;\n      normals[43] = 0.0;\n      normals[44] = 0.0;\n      normals[45] = -1.0;\n      normals[46] = 0.0;\n      normals[47] = 0.0;\n\n      // +y face\n      normals[48] = 0.0;\n      normals[49] = 1.0;\n      normals[50] = 0.0;\n      normals[51] = 0.0;\n      normals[52] = 1.0;\n      normals[53] = 0.0;\n      normals[54] = 0.0;\n      normals[55] = 1.0;\n      normals[56] = 0.0;\n      normals[57] = 0.0;\n      normals[58] = 1.0;\n      normals[59] = 0.0;\n\n      // -y face\n      normals[60] = 0.0;\n      normals[61] = -1.0;\n      normals[62] = 0.0;\n      normals[63] = 0.0;\n      normals[64] = -1.0;\n      normals[65] = 0.0;\n      normals[66] = 0.0;\n      normals[67] = -1.0;\n      normals[68] = 0.0;\n      normals[69] = 0.0;\n      normals[70] = -1.0;\n      normals[71] = 0.0;\n\n      attributes.normal = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: normals,\n      });\n    }\n\n    if (vertexFormat.st) {\n      const texCoords = new Float32Array(6 * 4 * 2);\n\n      // +z face\n      texCoords[0] = 0.0;\n      texCoords[1] = 0.0;\n      texCoords[2] = 1.0;\n      texCoords[3] = 0.0;\n      texCoords[4] = 1.0;\n      texCoords[5] = 1.0;\n      texCoords[6] = 0.0;\n      texCoords[7] = 1.0;\n\n      // -z face\n      texCoords[8] = 1.0;\n      texCoords[9] = 0.0;\n      texCoords[10] = 0.0;\n      texCoords[11] = 0.0;\n      texCoords[12] = 0.0;\n      texCoords[13] = 1.0;\n      texCoords[14] = 1.0;\n      texCoords[15] = 1.0;\n\n      //+x face\n      texCoords[16] = 0.0;\n      texCoords[17] = 0.0;\n      texCoords[18] = 1.0;\n      texCoords[19] = 0.0;\n      texCoords[20] = 1.0;\n      texCoords[21] = 1.0;\n      texCoords[22] = 0.0;\n      texCoords[23] = 1.0;\n\n      // -x face\n      texCoords[24] = 1.0;\n      texCoords[25] = 0.0;\n      texCoords[26] = 0.0;\n      texCoords[27] = 0.0;\n      texCoords[28] = 0.0;\n      texCoords[29] = 1.0;\n      texCoords[30] = 1.0;\n      texCoords[31] = 1.0;\n\n      // +y face\n      texCoords[32] = 1.0;\n      texCoords[33] = 0.0;\n      texCoords[34] = 0.0;\n      texCoords[35] = 0.0;\n      texCoords[36] = 0.0;\n      texCoords[37] = 1.0;\n      texCoords[38] = 1.0;\n      texCoords[39] = 1.0;\n\n      // -y face\n      texCoords[40] = 0.0;\n      texCoords[41] = 0.0;\n      texCoords[42] = 1.0;\n      texCoords[43] = 0.0;\n      texCoords[44] = 1.0;\n      texCoords[45] = 1.0;\n      texCoords[46] = 0.0;\n      texCoords[47] = 1.0;\n\n      attributes.st = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 2,\n        values: texCoords,\n      });\n    }\n\n    if (vertexFormat.tangent) {\n      const tangents = new Float32Array(6 * 4 * 3);\n\n      // +z face\n      tangents[0] = 1.0;\n      tangents[1] = 0.0;\n      tangents[2] = 0.0;\n      tangents[3] = 1.0;\n      tangents[4] = 0.0;\n      tangents[5] = 0.0;\n      tangents[6] = 1.0;\n      tangents[7] = 0.0;\n      tangents[8] = 0.0;\n      tangents[9] = 1.0;\n      tangents[10] = 0.0;\n      tangents[11] = 0.0;\n\n      // -z face\n      tangents[12] = -1.0;\n      tangents[13] = 0.0;\n      tangents[14] = 0.0;\n      tangents[15] = -1.0;\n      tangents[16] = 0.0;\n      tangents[17] = 0.0;\n      tangents[18] = -1.0;\n      tangents[19] = 0.0;\n      tangents[20] = 0.0;\n      tangents[21] = -1.0;\n      tangents[22] = 0.0;\n      tangents[23] = 0.0;\n\n      // +x face\n      tangents[24] = 0.0;\n      tangents[25] = 1.0;\n      tangents[26] = 0.0;\n      tangents[27] = 0.0;\n      tangents[28] = 1.0;\n      tangents[29] = 0.0;\n      tangents[30] = 0.0;\n      tangents[31] = 1.0;\n      tangents[32] = 0.0;\n      tangents[33] = 0.0;\n      tangents[34] = 1.0;\n      tangents[35] = 0.0;\n\n      // -x face\n      tangents[36] = 0.0;\n      tangents[37] = -1.0;\n      tangents[38] = 0.0;\n      tangents[39] = 0.0;\n      tangents[40] = -1.0;\n      tangents[41] = 0.0;\n      tangents[42] = 0.0;\n      tangents[43] = -1.0;\n      tangents[44] = 0.0;\n      tangents[45] = 0.0;\n      tangents[46] = -1.0;\n      tangents[47] = 0.0;\n\n      // +y face\n      tangents[48] = -1.0;\n      tangents[49] = 0.0;\n      tangents[50] = 0.0;\n      tangents[51] = -1.0;\n      tangents[52] = 0.0;\n      tangents[53] = 0.0;\n      tangents[54] = -1.0;\n      tangents[55] = 0.0;\n      tangents[56] = 0.0;\n      tangents[57] = -1.0;\n      tangents[58] = 0.0;\n      tangents[59] = 0.0;\n\n      // -y face\n      tangents[60] = 1.0;\n      tangents[61] = 0.0;\n      tangents[62] = 0.0;\n      tangents[63] = 1.0;\n      tangents[64] = 0.0;\n      tangents[65] = 0.0;\n      tangents[66] = 1.0;\n      tangents[67] = 0.0;\n      tangents[68] = 0.0;\n      tangents[69] = 1.0;\n      tangents[70] = 0.0;\n      tangents[71] = 0.0;\n\n      attributes.tangent = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: tangents,\n      });\n    }\n\n    if (vertexFormat.bitangent) {\n      const bitangents = new Float32Array(6 * 4 * 3);\n\n      // +z face\n      bitangents[0] = 0.0;\n      bitangents[1] = 1.0;\n      bitangents[2] = 0.0;\n      bitangents[3] = 0.0;\n      bitangents[4] = 1.0;\n      bitangents[5] = 0.0;\n      bitangents[6] = 0.0;\n      bitangents[7] = 1.0;\n      bitangents[8] = 0.0;\n      bitangents[9] = 0.0;\n      bitangents[10] = 1.0;\n      bitangents[11] = 0.0;\n\n      // -z face\n      bitangents[12] = 0.0;\n      bitangents[13] = 1.0;\n      bitangents[14] = 0.0;\n      bitangents[15] = 0.0;\n      bitangents[16] = 1.0;\n      bitangents[17] = 0.0;\n      bitangents[18] = 0.0;\n      bitangents[19] = 1.0;\n      bitangents[20] = 0.0;\n      bitangents[21] = 0.0;\n      bitangents[22] = 1.0;\n      bitangents[23] = 0.0;\n\n      // +x face\n      bitangents[24] = 0.0;\n      bitangents[25] = 0.0;\n      bitangents[26] = 1.0;\n      bitangents[27] = 0.0;\n      bitangents[28] = 0.0;\n      bitangents[29] = 1.0;\n      bitangents[30] = 0.0;\n      bitangents[31] = 0.0;\n      bitangents[32] = 1.0;\n      bitangents[33] = 0.0;\n      bitangents[34] = 0.0;\n      bitangents[35] = 1.0;\n\n      // -x face\n      bitangents[36] = 0.0;\n      bitangents[37] = 0.0;\n      bitangents[38] = 1.0;\n      bitangents[39] = 0.0;\n      bitangents[40] = 0.0;\n      bitangents[41] = 1.0;\n      bitangents[42] = 0.0;\n      bitangents[43] = 0.0;\n      bitangents[44] = 1.0;\n      bitangents[45] = 0.0;\n      bitangents[46] = 0.0;\n      bitangents[47] = 1.0;\n\n      // +y face\n      bitangents[48] = 0.0;\n      bitangents[49] = 0.0;\n      bitangents[50] = 1.0;\n      bitangents[51] = 0.0;\n      bitangents[52] = 0.0;\n      bitangents[53] = 1.0;\n      bitangents[54] = 0.0;\n      bitangents[55] = 0.0;\n      bitangents[56] = 1.0;\n      bitangents[57] = 0.0;\n      bitangents[58] = 0.0;\n      bitangents[59] = 1.0;\n\n      // -y face\n      bitangents[60] = 0.0;\n      bitangents[61] = 0.0;\n      bitangents[62] = 1.0;\n      bitangents[63] = 0.0;\n      bitangents[64] = 0.0;\n      bitangents[65] = 1.0;\n      bitangents[66] = 0.0;\n      bitangents[67] = 0.0;\n      bitangents[68] = 1.0;\n      bitangents[69] = 0.0;\n      bitangents[70] = 0.0;\n      bitangents[71] = 1.0;\n\n      attributes.bitangent = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: bitangents,\n      });\n    }\n\n    // 12 triangles:  6 faces, 2 triangles each.\n    indices = new Uint16Array(6 * 2 * 3);\n\n    // +z face\n    indices[0] = 0;\n    indices[1] = 1;\n    indices[2] = 2;\n    indices[3] = 0;\n    indices[4] = 2;\n    indices[5] = 3;\n\n    // -z face\n    indices[6] = 4 + 2;\n    indices[7] = 4 + 1;\n    indices[8] = 4 + 0;\n    indices[9] = 4 + 3;\n    indices[10] = 4 + 2;\n    indices[11] = 4 + 0;\n\n    // +x face\n    indices[12] = 8 + 0;\n    indices[13] = 8 + 1;\n    indices[14] = 8 + 2;\n    indices[15] = 8 + 0;\n    indices[16] = 8 + 2;\n    indices[17] = 8 + 3;\n\n    // -x face\n    indices[18] = 12 + 2;\n    indices[19] = 12 + 1;\n    indices[20] = 12 + 0;\n    indices[21] = 12 + 3;\n    indices[22] = 12 + 2;\n    indices[23] = 12 + 0;\n\n    // +y face\n    indices[24] = 16 + 2;\n    indices[25] = 16 + 1;\n    indices[26] = 16 + 0;\n    indices[27] = 16 + 3;\n    indices[28] = 16 + 2;\n    indices[29] = 16 + 0;\n\n    // -y face\n    indices[30] = 20 + 0;\n    indices[31] = 20 + 1;\n    indices[32] = 20 + 2;\n    indices[33] = 20 + 0;\n    indices[34] = 20 + 2;\n    indices[35] = 20 + 3;\n  } else {\n    // Positions only - no need to duplicate corner points\n    positions = new Float64Array(8 * 3);\n\n    positions[0] = min.x;\n    positions[1] = min.y;\n    positions[2] = min.z;\n    positions[3] = max.x;\n    positions[4] = min.y;\n    positions[5] = min.z;\n    positions[6] = max.x;\n    positions[7] = max.y;\n    positions[8] = min.z;\n    positions[9] = min.x;\n    positions[10] = max.y;\n    positions[11] = min.z;\n    positions[12] = min.x;\n    positions[13] = min.y;\n    positions[14] = max.z;\n    positions[15] = max.x;\n    positions[16] = min.y;\n    positions[17] = max.z;\n    positions[18] = max.x;\n    positions[19] = max.y;\n    positions[20] = max.z;\n    positions[21] = min.x;\n    positions[22] = max.y;\n    positions[23] = max.z;\n\n    attributes.position = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: positions,\n    });\n\n    // 12 triangles:  6 faces, 2 triangles each.\n    indices = new Uint16Array(6 * 2 * 3);\n\n    // plane z = corner.Z\n    indices[0] = 4;\n    indices[1] = 5;\n    indices[2] = 6;\n    indices[3] = 4;\n    indices[4] = 6;\n    indices[5] = 7;\n\n    // plane z = -corner.Z\n    indices[6] = 1;\n    indices[7] = 0;\n    indices[8] = 3;\n    indices[9] = 1;\n    indices[10] = 3;\n    indices[11] = 2;\n\n    // plane x = corner.X\n    indices[12] = 1;\n    indices[13] = 6;\n    indices[14] = 5;\n    indices[15] = 1;\n    indices[16] = 2;\n    indices[17] = 6;\n\n    // plane y = corner.Y\n    indices[18] = 2;\n    indices[19] = 3;\n    indices[20] = 7;\n    indices[21] = 2;\n    indices[22] = 7;\n    indices[23] = 6;\n\n    // plane x = -corner.X\n    indices[24] = 3;\n    indices[25] = 0;\n    indices[26] = 4;\n    indices[27] = 3;\n    indices[28] = 4;\n    indices[29] = 7;\n\n    // plane y = -corner.Y\n    indices[30] = 0;\n    indices[31] = 1;\n    indices[32] = 5;\n    indices[33] = 0;\n    indices[34] = 5;\n    indices[35] = 4;\n  }\n\n  const diff = Cartesian3.subtract(max, min, diffScratch);\n  const radius = Cartesian3.magnitude(diff) * 0.5;\n\n  if (defined(boxGeometry._offsetAttribute)) {\n    const length = positions.length;\n    const offsetValue =\n      boxGeometry._offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n    const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n    attributes.applyOffset = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 1,\n      values: applyOffset,\n    });\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: PrimitiveType.TRIANGLES,\n    boundingSphere: new BoundingSphere(Cartesian3.ZERO, radius),\n    offsetAttribute: boxGeometry._offsetAttribute,\n  });\n};\n\nlet unitBoxGeometry;\n\n/**\n * Returns the geometric representation of a unit box, including its vertices, indices, and a bounding sphere.\n * @returns {Geometry} The computed vertices and indices.\n *\n * @private\n */\nBoxGeometry.getUnitBox = function () {\n  if (!defined(unitBoxGeometry)) {\n    unitBoxGeometry = BoxGeometry.createGeometry(\n      BoxGeometry.fromDimensions({\n        dimensions: new Cartesian3(1.0, 1.0, 1.0),\n        vertexFormat: VertexFormat.POSITION_ONLY,\n      })\n    );\n  }\n  return unitBoxGeometry;\n};\nexport default BoxGeometry;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\nconst diffScratch = new Cartesian3();\n\n/**\n * A description of the outline of a cube centered at the origin.\n *\n * @alias BoxOutlineGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3} options.minimum The minimum x, y, and z coordinates of the box.\n * @param {Cartesian3} options.maximum The maximum x, y, and z coordinates of the box.\n *\n * @see BoxOutlineGeometry.fromDimensions\n * @see BoxOutlineGeometry.createGeometry\n * @see Packable\n *\n * @example\n * const box = new Cesium.BoxOutlineGeometry({\n *   maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),\n *   minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)\n * });\n * const geometry = Cesium.BoxOutlineGeometry.createGeometry(box);\n */\nfunction BoxOutlineGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const min = options.minimum;\n  const max = options.maximum;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"min\", min);\n  Check.typeOf.object(\"max\", max);\n  if (\n    defined(options.offsetAttribute) &&\n    options.offsetAttribute === GeometryOffsetAttribute.TOP\n  ) {\n    throw new DeveloperError(\n      \"GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._min = Cartesian3.clone(min);\n  this._max = Cartesian3.clone(max);\n  this._offsetAttribute = options.offsetAttribute;\n  this._workerName = \"createBoxOutlineGeometry\";\n}\n\n/**\n * Creates an outline of a cube centered at the origin given its dimensions.\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3} options.dimensions The width, depth, and height of the box stored in the x, y, and z coordinates of the <code>Cartesian3</code>, respectively.\n * @returns {BoxOutlineGeometry}\n *\n * @exception {DeveloperError} All dimensions components must be greater than or equal to zero.\n *\n *\n * @example\n * const box = Cesium.BoxOutlineGeometry.fromDimensions({\n *   dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)\n * });\n * const geometry = Cesium.BoxOutlineGeometry.createGeometry(box);\n *\n * @see BoxOutlineGeometry.createGeometry\n */\nBoxOutlineGeometry.fromDimensions = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const dimensions = options.dimensions;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"dimensions\", dimensions);\n  Check.typeOf.number.greaterThanOrEquals(\"dimensions.x\", dimensions.x, 0);\n  Check.typeOf.number.greaterThanOrEquals(\"dimensions.y\", dimensions.y, 0);\n  Check.typeOf.number.greaterThanOrEquals(\"dimensions.z\", dimensions.z, 0);\n  //>>includeEnd('debug');\n\n  const corner = Cartesian3.multiplyByScalar(dimensions, 0.5, new Cartesian3());\n\n  return new BoxOutlineGeometry({\n    minimum: Cartesian3.negate(corner, new Cartesian3()),\n    maximum: corner,\n    offsetAttribute: options.offsetAttribute,\n  });\n};\n\n/**\n * Creates an outline of a cube from the dimensions of an AxisAlignedBoundingBox.\n *\n * @param {AxisAlignedBoundingBox} boundingBox A description of the AxisAlignedBoundingBox.\n * @returns {BoxOutlineGeometry}\n *\n *\n *\n * @example\n * const aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([\n *      -72.0, 40.0,\n *      -70.0, 35.0,\n *      -75.0, 30.0,\n *      -70.0, 30.0,\n *      -68.0, 40.0\n * ]));\n * const box = Cesium.BoxOutlineGeometry.fromAxisAlignedBoundingBox(aabb);\n *\n *  @see BoxOutlineGeometry.createGeometry\n */\nBoxOutlineGeometry.fromAxisAlignedBoundingBox = function (boundingBox) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"boundindBox\", boundingBox);\n  //>>includeEnd('debug');\n\n  return new BoxOutlineGeometry({\n    minimum: boundingBox.minimum,\n    maximum: boundingBox.maximum,\n  });\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nBoxOutlineGeometry.packedLength = 2 * Cartesian3.packedLength + 1;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {BoxOutlineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nBoxOutlineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  Cartesian3.pack(value._min, array, startingIndex);\n  Cartesian3.pack(value._max, array, startingIndex + Cartesian3.packedLength);\n  array[startingIndex + Cartesian3.packedLength * 2] = defaultValue(\n    value._offsetAttribute,\n    -1\n  );\n\n  return array;\n};\n\nconst scratchMin = new Cartesian3();\nconst scratchMax = new Cartesian3();\nconst scratchOptions = {\n  minimum: scratchMin,\n  maximum: scratchMax,\n  offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {BoxOutlineGeometry} [result] The object into which to store the result.\n * @returns {BoxOutlineGeometry} The modified result parameter or a new BoxOutlineGeometry instance if one was not provided.\n */\nBoxOutlineGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const min = Cartesian3.unpack(array, startingIndex, scratchMin);\n  const max = Cartesian3.unpack(\n    array,\n    startingIndex + Cartesian3.packedLength,\n    scratchMax\n  );\n  const offsetAttribute = array[startingIndex + Cartesian3.packedLength * 2];\n\n  if (!defined(result)) {\n    scratchOptions.offsetAttribute =\n      offsetAttribute === -1 ? undefined : offsetAttribute;\n    return new BoxOutlineGeometry(scratchOptions);\n  }\n\n  result._min = Cartesian3.clone(min, result._min);\n  result._max = Cartesian3.clone(max, result._max);\n  result._offsetAttribute =\n    offsetAttribute === -1 ? undefined : offsetAttribute;\n\n  return result;\n};\n\n/**\n * Computes the geometric representation of an outline of a box, including its vertices, indices, and a bounding sphere.\n *\n * @param {BoxOutlineGeometry} boxGeometry A description of the box outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nBoxOutlineGeometry.createGeometry = function (boxGeometry) {\n  const min = boxGeometry._min;\n  const max = boxGeometry._max;\n\n  if (Cartesian3.equals(min, max)) {\n    return;\n  }\n\n  const attributes = new GeometryAttributes();\n  const indices = new Uint16Array(12 * 2);\n  const positions = new Float64Array(8 * 3);\n\n  positions[0] = min.x;\n  positions[1] = min.y;\n  positions[2] = min.z;\n  positions[3] = max.x;\n  positions[4] = min.y;\n  positions[5] = min.z;\n  positions[6] = max.x;\n  positions[7] = max.y;\n  positions[8] = min.z;\n  positions[9] = min.x;\n  positions[10] = max.y;\n  positions[11] = min.z;\n\n  positions[12] = min.x;\n  positions[13] = min.y;\n  positions[14] = max.z;\n  positions[15] = max.x;\n  positions[16] = min.y;\n  positions[17] = max.z;\n  positions[18] = max.x;\n  positions[19] = max.y;\n  positions[20] = max.z;\n  positions[21] = min.x;\n  positions[22] = max.y;\n  positions[23] = max.z;\n\n  attributes.position = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.DOUBLE,\n    componentsPerAttribute: 3,\n    values: positions,\n  });\n\n  // top\n  indices[0] = 4;\n  indices[1] = 5;\n  indices[2] = 5;\n  indices[3] = 6;\n  indices[4] = 6;\n  indices[5] = 7;\n  indices[6] = 7;\n  indices[7] = 4;\n\n  // bottom\n  indices[8] = 0;\n  indices[9] = 1;\n  indices[10] = 1;\n  indices[11] = 2;\n  indices[12] = 2;\n  indices[13] = 3;\n  indices[14] = 3;\n  indices[15] = 0;\n\n  // left\n  indices[16] = 0;\n  indices[17] = 4;\n  indices[18] = 1;\n  indices[19] = 5;\n\n  //right\n  indices[20] = 2;\n  indices[21] = 6;\n  indices[22] = 3;\n  indices[23] = 7;\n\n  const diff = Cartesian3.subtract(max, min, diffScratch);\n  const radius = Cartesian3.magnitude(diff) * 0.5;\n\n  if (defined(boxGeometry._offsetAttribute)) {\n    const length = positions.length;\n    const offsetValue =\n      boxGeometry._offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n    const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n    attributes.applyOffset = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 1,\n      values: applyOffset,\n    });\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: PrimitiveType.LINES,\n    boundingSphere: new BoundingSphere(Cartesian3.ZERO, radius),\n    offsetAttribute: boxGeometry._offsetAttribute,\n  });\n};\nexport default BoxOutlineGeometry;\n", "import Color from \"./Color.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Value and type information for per-instance geometry color.\n *\n * @alias ColorGeometryInstanceAttribute\n * @constructor\n *\n * @param {number} [red=1.0] The red component.\n * @param {number} [green=1.0] The green component.\n * @param {number} [blue=1.0] The blue component.\n * @param {number} [alpha=1.0] The alpha component.\n *\n *\n * @example\n * const instance = new Cesium.GeometryInstance({\n *   geometry : Cesium.BoxGeometry.fromDimensions({\n *     dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)\n *   }),\n *   modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n *     Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),\n *   id : 'box',\n *   attributes : {\n *     color : new Cesium.ColorGeometryInstanceAttribute(red, green, blue, alpha)\n *   }\n * });\n *\n * @see GeometryInstance\n * @see GeometryInstanceAttribute\n */\nfunction ColorGeometryInstanceAttribute(red, green, blue, alpha) {\n  red = defaultValue(red, 1.0);\n  green = defaultValue(green, 1.0);\n  blue = defaultValue(blue, 1.0);\n  alpha = defaultValue(alpha, 1.0);\n\n  /**\n   * The values for the attributes stored in a typed array.\n   *\n   * @type Uint8Array\n   *\n   * @default [255, 255, 255, 255]\n   */\n  this.value = new Uint8Array([\n    Color.floatToByte(red),\n    Color.floatToByte(green),\n    Color.floatToByte(blue),\n    Color.floatToByte(alpha),\n  ]);\n}\n\nObject.defineProperties(ColorGeometryInstanceAttribute.prototype, {\n  /**\n   * The datatype of each component in the attribute, e.g., individual elements in\n   * {@link ColorGeometryInstanceAttribute#value}.\n   *\n   * @memberof ColorGeometryInstanceAttribute.prototype\n   *\n   * @type {ComponentDatatype}\n   * @readonly\n   *\n   * @default {@link ComponentDatatype.UNSIGNED_BYTE}\n   */\n  componentDatatype: {\n    get: function () {\n      return ComponentDatatype.UNSIGNED_BYTE;\n    },\n  },\n\n  /**\n   * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.\n   *\n   * @memberof ColorGeometryInstanceAttribute.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @default 4\n   */\n  componentsPerAttribute: {\n    get: function () {\n      return 4;\n    },\n  },\n\n  /**\n   * When <code>true</code> and <code>componentDatatype</code> is an integer format,\n   * indicate that the components should be mapped to the range [0, 1] (unsigned)\n   * or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n   *\n   * @memberof ColorGeometryInstanceAttribute.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  normalize: {\n    get: function () {\n      return true;\n    },\n  },\n});\n\n/**\n * Creates a new {@link ColorGeometryInstanceAttribute} instance given the provided {@link Color}.\n *\n * @param {Color} color The color.\n * @returns {ColorGeometryInstanceAttribute} The new {@link ColorGeometryInstanceAttribute} instance.\n *\n * @example\n * const instance = new Cesium.GeometryInstance({\n *   geometry : geometry,\n *   attributes : {\n *     color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.CORNFLOWERBLUE),\n *   }\n * });\n */\nColorGeometryInstanceAttribute.fromColor = function (color) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(color)) {\n    throw new DeveloperError(\"color is required.\");\n  }\n  //>>includeEnd('debug');\n\n  return new ColorGeometryInstanceAttribute(\n    color.red,\n    color.green,\n    color.blue,\n    color.alpha\n  );\n};\n\n/**\n * Converts a color to a typed array that can be used to assign a color attribute.\n *\n * @param {Color} color The color.\n * @param {Uint8Array} [result] The array to store the result in, if undefined a new instance will be created.\n *\n * @returns {Uint8Array} The modified result parameter or a new instance if result was undefined.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA, attributes.color);\n */\nColorGeometryInstanceAttribute.toValue = function (color, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(color)) {\n    throw new DeveloperError(\"color is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Uint8Array(color.toBytes());\n  }\n  return color.toBytes(result);\n};\n\n/**\n * Compares the provided ColorGeometryInstanceAttributes and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {ColorGeometryInstanceAttribute} [left] The first ColorGeometryInstanceAttribute.\n * @param {ColorGeometryInstanceAttribute} [right] The second ColorGeometryInstanceAttribute.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nColorGeometryInstanceAttribute.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left.value[0] === right.value[0] &&\n      left.value[1] === right.value[1] &&\n      left.value[2] === right.value[2] &&\n      left.value[3] === right.value[3])\n  );\n};\nexport default ColorGeometryInstanceAttribute;\n", "import ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Value and type information for per-instance geometry attribute that determines if the geometry instance has a distance display condition.\n *\n * @alias DistanceDisplayConditionGeometryInstanceAttribute\n * @constructor\n *\n * @param {number} [near=0.0] The near distance.\n * @param {number} [far=Number.MAX_VALUE] The far distance.\n *\n * @exception {DeveloperError} far must be greater than near.\n *\n * @example\n * const instance = new Cesium.GeometryInstance({\n *   geometry : new Cesium.BoxGeometry({\n *     vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,\n *     minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),\n *     maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)\n *   }),\n *   modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n *     Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),\n *   id : 'box',\n *   attributes : {\n *     distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10000.0)\n *   }\n * });\n *\n * @see GeometryInstance\n * @see GeometryInstanceAttribute\n */\nfunction DistanceDisplayConditionGeometryInstanceAttribute(near, far) {\n  near = defaultValue(near, 0.0);\n  far = defaultValue(far, Number.MAX_VALUE);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (far <= near) {\n    throw new DeveloperError(\n      \"far distance must be greater than near distance.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  /**\n   * The values for the attributes stored in a typed array.\n   *\n   * @type {Float32Array}\n   *\n   * @default [0.0, 0.0, Number.MAX_VALUE]\n   */\n  this.value = new Float32Array([near, far]);\n}\n\nObject.defineProperties(\n  DistanceDisplayConditionGeometryInstanceAttribute.prototype,\n  {\n    /**\n     * The datatype of each component in the attribute, e.g., individual elements in\n     * {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.\n     *\n     * @memberof DistanceDisplayConditionGeometryInstanceAttribute.prototype\n     *\n     * @type {ComponentDatatype}\n     * @readonly\n     *\n     * @default {@link ComponentDatatype.FLOAT}\n     */\n    componentDatatype: {\n      get: function () {\n        return ComponentDatatype.FLOAT;\n      },\n    },\n\n    /**\n     * The number of components in the attributes, i.e., {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.\n     *\n     * @memberof DistanceDisplayConditionGeometryInstanceAttribute.prototype\n     *\n     * @type {number}\n     * @readonly\n     *\n     * @default 3\n     */\n    componentsPerAttribute: {\n      get: function () {\n        return 2;\n      },\n    },\n\n    /**\n     * When <code>true</code> and <code>componentDatatype</code> is an integer format,\n     * indicate that the components should be mapped to the range [0, 1] (unsigned)\n     * or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n     *\n     * @memberof DistanceDisplayConditionGeometryInstanceAttribute.prototype\n     *\n     * @type {boolean}\n     * @readonly\n     *\n     * @default false\n     */\n    normalize: {\n      get: function () {\n        return false;\n      },\n    },\n  }\n);\n\n/**\n * Creates a new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}.\n *\n * @param {DistanceDisplayCondition} distanceDisplayCondition The distance display condition.\n * @returns {DistanceDisplayConditionGeometryInstanceAttribute} The new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance.\n *\n * @exception {DeveloperError} distanceDisplayCondition.far must be greater than distanceDisplayCondition.near\n *\n * @example\n * const distanceDisplayCondition = new Cesium.DistanceDisplayCondition(100.0, 10000.0);\n * const instance = new Cesium.GeometryInstance({\n *   geometry : geometry,\n *   attributes : {\n *     distanceDisplayCondition : Cesium.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition)\n *   }\n * });\n */\nDistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition = function (\n  distanceDisplayCondition\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(distanceDisplayCondition)) {\n    throw new DeveloperError(\"distanceDisplayCondition is required.\");\n  }\n  if (distanceDisplayCondition.far <= distanceDisplayCondition.near) {\n    throw new DeveloperError(\n      \"distanceDisplayCondition.far distance must be greater than distanceDisplayCondition.near distance.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  return new DistanceDisplayConditionGeometryInstanceAttribute(\n    distanceDisplayCondition.near,\n    distanceDisplayCondition.far\n  );\n};\n\n/**\n * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.\n *\n * @param {DistanceDisplayCondition} distanceDisplayCondition The distance display condition value.\n * @param {Float32Array} [result] The array to store the result in, if undefined a new instance will be created.\n * @returns {Float32Array} The modified result parameter or a new instance if result was undefined.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition);\n */\nDistanceDisplayConditionGeometryInstanceAttribute.toValue = function (\n  distanceDisplayCondition,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(distanceDisplayCondition)) {\n    throw new DeveloperError(\"distanceDisplayCondition is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Float32Array([\n      distanceDisplayCondition.near,\n      distanceDisplayCondition.far,\n    ]);\n  }\n  result[0] = distanceDisplayCondition.near;\n  result[1] = distanceDisplayCondition.far;\n  return result;\n};\nexport default DistanceDisplayConditionGeometryInstanceAttribute;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Matrix4 from \"./Matrix4.js\";\n\n/**\n * Geometry instancing allows one {@link Geometry} object to be positions in several\n * different locations and colored uniquely.  For example, one {@link BoxGeometry} can\n * be instanced several times, each with a different <code>modelMatrix</code> to change\n * its position, rotation, and scale.\n *\n * @alias GeometryInstance\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Geometry|GeometryFactory} options.geometry The geometry to instance.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The model matrix that transforms to transform the geometry from model to world coordinates.\n * @param {object} [options.id] A user-defined object to return when the instance is picked with {@link Scene#pick} or get/set per-instance attributes with {@link Primitive#getGeometryInstanceAttributes}.\n * @param {object} [options.attributes] Per-instance attributes like a show or color attribute shown in the example below.\n *\n *\n * @example\n * // Create geometry for a box, and two instances that refer to it.\n * // One instance positions the box on the bottom and colored aqua.\n * // The other instance positions the box on the top and color white.\n * const geometry = Cesium.BoxGeometry.fromDimensions({\n *   vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,\n *   dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)\n * });\n * const instanceBottom = new Cesium.GeometryInstance({\n *   geometry : geometry,\n *   modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n *     Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),\n *   attributes : {\n *     color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)\n *   },\n *   id : 'bottom'\n * });\n * const instanceTop = new Cesium.GeometryInstance({\n *   geometry : geometry,\n *   modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n *     Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()),\n *   attributes : {\n *     color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)\n *   },\n *   id : 'top'\n * });\n *\n * @see Geometry\n */\nfunction GeometryInstance(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options.geometry)) {\n    throw new DeveloperError(\"options.geometry is required.\");\n  }\n  //>>includeEnd('debug');\n\n  /**\n   * The geometry being instanced.\n   *\n   * @type Geometry\n   *\n   * @default undefined\n   */\n  this.geometry = options.geometry;\n\n  /**\n   * The 4x4 transformation matrix that transforms the geometry from model to world coordinates.\n   * When this is the identity matrix, the geometry is drawn in world coordinates, i.e., Earth's WGS84 coordinates.\n   * Local reference frames can be used by providing a different transformation matrix, like that returned\n   * by {@link Transforms.eastNorthUpToFixedFrame}.\n   *\n   * @type Matrix4\n   *\n   * @default Matrix4.IDENTITY\n   */\n  this.modelMatrix = Matrix4.clone(\n    defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n  );\n\n  /**\n   * User-defined object returned when the instance is picked or used to get/set per-instance attributes.\n   *\n   * @type {object}\n   *\n   * @default undefined\n   *\n   * @see Scene#pick\n   * @see Primitive#getGeometryInstanceAttributes\n   */\n  this.id = options.id;\n\n  /**\n   * Used for picking primitives that wrap geometry instances.\n   *\n   * @private\n   */\n  this.pickPrimitive = options.pickPrimitive;\n\n  /**\n   * Per-instance attributes like {@link ColorGeometryInstanceAttribute} or {@link ShowGeometryInstanceAttribute}.\n   * {@link Geometry} attributes varying per vertex; these attributes are constant for the entire instance.\n   *\n   * @type {object}\n   *\n   * @default undefined\n   */\n  this.attributes = defaultValue(options.attributes, {});\n\n  /**\n   * @private\n   */\n  this.westHemisphereGeometry = undefined;\n  /**\n   * @private\n   */\n  this.eastHemisphereGeometry = undefined;\n}\nexport default GeometryInstance;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport JulianDate from \"./JulianDate.js\";\n\n/**\n * An interval defined by a start and a stop time; optionally including those times as part of the interval.\n * Arbitrary data can optionally be associated with each instance for used with {@link TimeIntervalCollection}.\n *\n * @alias TimeInterval\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {JulianDate} [options.start=new JulianDate()] The start time of the interval.\n * @param {JulianDate} [options.stop=new JulianDate()] The stop time of the interval.\n * @param {boolean} [options.isStartIncluded=true] <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.\n * @param {boolean} [options.isStopIncluded=true] <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.\n * @param {object} [options.data] Arbitrary data associated with this interval.\n *\n * @example\n * // Create an instance that spans August 1st, 1980 and is associated\n * // with a Cartesian position.\n * const timeInterval = new Cesium.TimeInterval({\n *     start : Cesium.JulianDate.fromIso8601('1980-08-01T00:00:00Z'),\n *     stop : Cesium.JulianDate.fromIso8601('1980-08-02T00:00:00Z'),\n *     isStartIncluded : true,\n *     isStopIncluded : false,\n *     data : Cesium.Cartesian3.fromDegrees(39.921037, -75.170082)\n * });\n *\n * @example\n * // Create two instances from ISO 8601 intervals with associated numeric data\n * // then compute their intersection, summing the data they contain.\n * const left = Cesium.TimeInterval.fromIso8601({\n *     iso8601 : '2000/2010',\n *     data : 2\n * });\n *\n * const right = Cesium.TimeInterval.fromIso8601({\n *     iso8601 : '1995/2005',\n *     data : 3\n * });\n *\n * //The result of the below intersection will be an interval equivalent to\n * //const intersection = Cesium.TimeInterval.fromIso8601({\n * //  iso8601 : '2000/2005',\n * //  data : 5\n * //});\n * const intersection = new Cesium.TimeInterval();\n * Cesium.TimeInterval.intersect(left, right, intersection, function(leftData, rightData) {\n *     return leftData + rightData;\n * });\n *\n * @example\n * // Check if an interval contains a specific time.\n * const dateToCheck = Cesium.JulianDate.fromIso8601('1982-09-08T11:30:00Z');\n * const containsDate = Cesium.TimeInterval.contains(timeInterval, dateToCheck);\n */\nfunction TimeInterval(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  /**\n   * Gets or sets the start time of this interval.\n   * @type {JulianDate}\n   */\n  this.start = defined(options.start)\n    ? JulianDate.clone(options.start)\n    : new JulianDate();\n\n  /**\n   * Gets or sets the stop time of this interval.\n   * @type {JulianDate}\n   */\n  this.stop = defined(options.stop)\n    ? JulianDate.clone(options.stop)\n    : new JulianDate();\n\n  /**\n   * Gets or sets the data associated with this interval.\n   * @type {*}\n   */\n  this.data = options.data;\n\n  /**\n   * Gets or sets whether or not the start time is included in this interval.\n   * @type {boolean}\n   * @default true\n   */\n  this.isStartIncluded = defaultValue(options.isStartIncluded, true);\n\n  /**\n   * Gets or sets whether or not the stop time is included in this interval.\n   * @type {boolean}\n   * @default true\n   */\n  this.isStopIncluded = defaultValue(options.isStopIncluded, true);\n}\n\nObject.defineProperties(TimeInterval.prototype, {\n  /**\n   * Gets whether or not this interval is empty.\n   * @memberof TimeInterval.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  isEmpty: {\n    get: function () {\n      const stopComparedToStart = JulianDate.compare(this.stop, this.start);\n      return (\n        stopComparedToStart < 0 ||\n        (stopComparedToStart === 0 &&\n          (!this.isStartIncluded || !this.isStopIncluded))\n      );\n    },\n  },\n});\n\nconst scratchInterval = {\n  start: undefined,\n  stop: undefined,\n  isStartIncluded: undefined,\n  isStopIncluded: undefined,\n  data: undefined,\n};\n\n/**\n * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} interval.\n *\n * @throws DeveloperError if options.iso8601 does not match proper formatting.\n *\n * @param {object} options Object with the following properties:\n * @param {string} options.iso8601 An ISO 8601 interval.\n * @param {boolean} [options.isStartIncluded=true] <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.\n * @param {boolean} [options.isStopIncluded=true] <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.\n * @param {object} [options.data] Arbitrary data associated with this interval.\n * @param {TimeInterval} [result] An existing instance to use for the result.\n * @returns {TimeInterval} The modified result parameter or a new instance if none was provided.\n */\nTimeInterval.fromIso8601 = function (options, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options\", options);\n  Check.typeOf.string(\"options.iso8601\", options.iso8601);\n  //>>includeEnd('debug');\n\n  const dates = options.iso8601.split(\"/\");\n  if (dates.length !== 2) {\n    throw new DeveloperError(\n      \"options.iso8601 is an invalid ISO 8601 interval.\"\n    );\n  }\n  const start = JulianDate.fromIso8601(dates[0]);\n  const stop = JulianDate.fromIso8601(dates[1]);\n  const isStartIncluded = defaultValue(options.isStartIncluded, true);\n  const isStopIncluded = defaultValue(options.isStopIncluded, true);\n  const data = options.data;\n\n  if (!defined(result)) {\n    scratchInterval.start = start;\n    scratchInterval.stop = stop;\n    scratchInterval.isStartIncluded = isStartIncluded;\n    scratchInterval.isStopIncluded = isStopIncluded;\n    scratchInterval.data = data;\n    return new TimeInterval(scratchInterval);\n  }\n\n  result.start = start;\n  result.stop = stop;\n  result.isStartIncluded = isStartIncluded;\n  result.isStopIncluded = isStopIncluded;\n  result.data = data;\n  return result;\n};\n\n/**\n * Creates an ISO8601 representation of the provided interval.\n *\n * @param {TimeInterval} timeInterval The interval to be converted.\n * @param {number} [precision] The number of fractional digits used to represent the seconds component.  By default, the most precise representation is used.\n * @returns {string} The ISO8601 representation of the provided interval.\n */\nTimeInterval.toIso8601 = function (timeInterval, precision) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"timeInterval\", timeInterval);\n  //>>includeEnd('debug');\n\n  return `${JulianDate.toIso8601(\n    timeInterval.start,\n    precision\n  )}/${JulianDate.toIso8601(timeInterval.stop, precision)}`;\n};\n\n/**\n * Duplicates the provided instance.\n *\n * @param {TimeInterval} [timeInterval] The instance to clone.\n * @param {TimeInterval} [result] An existing instance to use for the result.\n * @returns {TimeInterval} The modified result parameter or a new instance if none was provided.\n */\nTimeInterval.clone = function (timeInterval, result) {\n  if (!defined(timeInterval)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    return new TimeInterval(timeInterval);\n  }\n  result.start = timeInterval.start;\n  result.stop = timeInterval.stop;\n  result.isStartIncluded = timeInterval.isStartIncluded;\n  result.isStopIncluded = timeInterval.isStopIncluded;\n  result.data = timeInterval.data;\n  return result;\n};\n\n/**\n * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {TimeInterval} [left] The first instance.\n * @param {TimeInterval} [right] The second instance.\n * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals.  If omitted, reference equality is used.\n * @returns {boolean} <code>true</code> if the dates are equal; otherwise, <code>false</code>.\n */\nTimeInterval.equals = function (left, right, dataComparer) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      ((left.isEmpty && right.isEmpty) ||\n        (left.isStartIncluded === right.isStartIncluded &&\n          left.isStopIncluded === right.isStopIncluded &&\n          JulianDate.equals(left.start, right.start) &&\n          JulianDate.equals(left.stop, right.stop) &&\n          (left.data === right.data ||\n            (defined(dataComparer) && dataComparer(left.data, right.data))))))\n  );\n};\n\n/**\n * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of\n * each other.  That is, in order for the dates to be considered equal (and for\n * this function to return <code>true</code>), the absolute value of the difference between them, in\n * seconds, must be less than <code>epsilon</code>.\n *\n * @param {TimeInterval} [left] The first instance.\n * @param {TimeInterval} [right] The second instance.\n * @param {number} [epsilon=0] The maximum number of seconds that should separate the two instances.\n * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals.  If omitted, reference equality is used.\n * @returns {boolean} <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.\n */\nTimeInterval.equalsEpsilon = function (left, right, epsilon, dataComparer) {\n  epsilon = defaultValue(epsilon, 0);\n\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      ((left.isEmpty && right.isEmpty) ||\n        (left.isStartIncluded === right.isStartIncluded &&\n          left.isStopIncluded === right.isStopIncluded &&\n          JulianDate.equalsEpsilon(left.start, right.start, epsilon) &&\n          JulianDate.equalsEpsilon(left.stop, right.stop, epsilon) &&\n          (left.data === right.data ||\n            (defined(dataComparer) && dataComparer(left.data, right.data))))))\n  );\n};\n\n/**\n * Computes the intersection of two intervals, optionally merging their data.\n *\n * @param {TimeInterval} left The first interval.\n * @param {TimeInterval} [right] The second interval.\n * @param {TimeInterval} [result] An existing instance to use for the result.\n * @param {TimeInterval.MergeCallback} [mergeCallback] A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.\n * @returns {TimeInterval} The modified result parameter.\n */\nTimeInterval.intersect = function (left, right, result, mergeCallback) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"left\", left);\n  //>>includeEnd('debug');\n\n  if (!defined(right)) {\n    return TimeInterval.clone(TimeInterval.EMPTY, result);\n  }\n\n  const leftStart = left.start;\n  const leftStop = left.stop;\n\n  const rightStart = right.start;\n  const rightStop = right.stop;\n\n  const intersectsStartRight =\n    JulianDate.greaterThanOrEquals(rightStart, leftStart) &&\n    JulianDate.greaterThanOrEquals(leftStop, rightStart);\n  const intersectsStartLeft =\n    !intersectsStartRight &&\n    JulianDate.lessThanOrEquals(rightStart, leftStart) &&\n    JulianDate.lessThanOrEquals(leftStart, rightStop);\n\n  if (!intersectsStartRight && !intersectsStartLeft) {\n    return TimeInterval.clone(TimeInterval.EMPTY, result);\n  }\n\n  const leftIsStartIncluded = left.isStartIncluded;\n  const leftIsStopIncluded = left.isStopIncluded;\n  const rightIsStartIncluded = right.isStartIncluded;\n  const rightIsStopIncluded = right.isStopIncluded;\n  const leftLessThanRight = JulianDate.lessThan(leftStop, rightStop);\n\n  if (!defined(result)) {\n    result = new TimeInterval();\n  }\n\n  result.start = intersectsStartRight ? rightStart : leftStart;\n  result.isStartIncluded =\n    (leftIsStartIncluded && rightIsStartIncluded) ||\n    (!JulianDate.equals(rightStart, leftStart) &&\n      ((intersectsStartRight && rightIsStartIncluded) ||\n        (intersectsStartLeft && leftIsStartIncluded)));\n  result.stop = leftLessThanRight ? leftStop : rightStop;\n  result.isStopIncluded = leftLessThanRight\n    ? leftIsStopIncluded\n    : (leftIsStopIncluded && rightIsStopIncluded) ||\n      (!JulianDate.equals(rightStop, leftStop) && rightIsStopIncluded);\n  result.data = defined(mergeCallback)\n    ? mergeCallback(left.data, right.data)\n    : left.data;\n  return result;\n};\n\n/**\n * Checks if the specified date is inside the provided interval.\n *\n * @param {TimeInterval} timeInterval The interval.\n * @param {JulianDate} julianDate The date to check.\n * @returns {boolean} <code>true</code> if the interval contains the specified date, <code>false</code> otherwise.\n */\nTimeInterval.contains = function (timeInterval, julianDate) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"timeInterval\", timeInterval);\n  Check.typeOf.object(\"julianDate\", julianDate);\n  //>>includeEnd('debug');\n\n  if (timeInterval.isEmpty) {\n    return false;\n  }\n\n  const startComparedToDate = JulianDate.compare(\n    timeInterval.start,\n    julianDate\n  );\n  if (startComparedToDate === 0) {\n    return timeInterval.isStartIncluded;\n  }\n\n  const dateComparedToStop = JulianDate.compare(julianDate, timeInterval.stop);\n  if (dateComparedToStop === 0) {\n    return timeInterval.isStopIncluded;\n  }\n\n  return startComparedToDate < 0 && dateComparedToStop < 0;\n};\n\n/**\n * Duplicates this instance.\n *\n * @param {TimeInterval} [result] An existing instance to use for the result.\n * @returns {TimeInterval} The modified result parameter or a new instance if none was provided.\n */\nTimeInterval.prototype.clone = function (result) {\n  return TimeInterval.clone(this, result);\n};\n\n/**\n * Compares this instance against the provided instance componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {TimeInterval} [right] The right hand side interval.\n * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals.  If omitted, reference equality is used.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nTimeInterval.prototype.equals = function (right, dataComparer) {\n  return TimeInterval.equals(this, right, dataComparer);\n};\n\n/**\n * Compares this instance against the provided instance componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {TimeInterval} [right] The right hand side interval.\n * @param {number} [epsilon=0] The epsilon to use for equality testing.\n * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals.  If omitted, reference equality is used.\n * @returns {boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nTimeInterval.prototype.equalsEpsilon = function (right, epsilon, dataComparer) {\n  return TimeInterval.equalsEpsilon(this, right, epsilon, dataComparer);\n};\n\n/**\n * Creates a string representing this TimeInterval in ISO8601 format.\n *\n * @returns {string} A string representing this TimeInterval in ISO8601 format.\n */\nTimeInterval.prototype.toString = function () {\n  return TimeInterval.toIso8601(this);\n};\n\n/**\n * An immutable empty interval.\n *\n * @type {TimeInterval}\n * @constant\n */\nTimeInterval.EMPTY = Object.freeze(\n  new TimeInterval({\n    start: new JulianDate(),\n    stop: new JulianDate(),\n    isStartIncluded: false,\n    isStopIncluded: false,\n  })\n);\n\n/**\n * Function interface for merging interval data.\n * @callback TimeInterval.MergeCallback\n *\n * @param {*} leftData The first data instance.\n * @param {*} rightData The second data instance.\n * @returns {*} The result of merging the two data instances.\n */\n\n/**\n * Function interface for comparing interval data.\n * @callback TimeInterval.DataComparer\n * @param {*} leftData The first data instance.\n * @param {*} rightData The second data instance.\n * @returns {boolean} <code>true</code> if the provided instances are equal, <code>false</code> otherwise.\n */\nexport default TimeInterval;\n", "import JulianDate from \"./JulianDate.js\";\nimport TimeInterval from \"./TimeInterval.js\";\n\nconst MINIMUM_VALUE = Object.freeze(\n  JulianDate.fromIso8601(\"0000-01-01T00:00:00Z\")\n);\nconst MAXIMUM_VALUE = Object.freeze(\n  JulianDate.fromIso8601(\"9999-12-31T24:00:00Z\")\n);\nconst MAXIMUM_INTERVAL = Object.freeze(\n  new TimeInterval({\n    start: MINIMUM_VALUE,\n    stop: MAXIMUM_VALUE,\n  })\n);\n\n/**\n * Constants related to ISO8601 support.\n *\n * @namespace\n *\n * @see {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601 on Wikipedia}\n * @see JulianDate\n * @see TimeInterval\n */\nconst Iso8601 = {\n  /**\n   * A {@link JulianDate} representing the earliest time representable by an ISO8601 date.\n   * This is equivalent to the date string '0000-01-01T00:00:00Z'\n   *\n   * @type {JulianDate}\n   * @constant\n   */\n  MINIMUM_VALUE: MINIMUM_VALUE,\n\n  /**\n   * A {@link JulianDate} representing the latest time representable by an ISO8601 date.\n   * This is equivalent to the date string '9999-12-31T24:00:00Z'\n   *\n   * @type {JulianDate}\n   * @constant\n   */\n  MAXIMUM_VALUE: MAXIMUM_VALUE,\n\n  /**\n   * A {@link TimeInterval} representing the largest interval representable by an ISO8601 interval.\n   * This is equivalent to the interval string '0000-01-01T00:00:00Z/9999-12-31T24:00:00Z'\n   *\n   * @type {TimeInterval}\n   * @constant\n   */\n  MAXIMUM_INTERVAL: MAXIMUM_INTERVAL,\n};\nexport default Iso8601;\n", "import Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\n\n/**\n * Value and type information for per-instance geometry attribute that determines the geometry instance offset\n *\n * @alias OffsetGeometryInstanceAttribute\n * @constructor\n *\n * @param {number} [x=0] The x translation\n * @param {number} [y=0] The y translation\n * @param {number} [z=0] The z translation\n *\n * @private\n *\n * @see GeometryInstance\n * @see GeometryInstanceAttribute\n */\nfunction OffsetGeometryInstanceAttribute(x, y, z) {\n  x = defaultValue(x, 0);\n  y = defaultValue(y, 0);\n  z = defaultValue(z, 0);\n\n  /**\n   * The values for the attributes stored in a typed array.\n   *\n   * @type Float32Array\n   */\n  this.value = new Float32Array([x, y, z]);\n}\n\nObject.defineProperties(OffsetGeometryInstanceAttribute.prototype, {\n  /**\n   * The datatype of each component in the attribute, e.g., individual elements in\n   * {@link OffsetGeometryInstanceAttribute#value}.\n   *\n   * @memberof OffsetGeometryInstanceAttribute.prototype\n   *\n   * @type {ComponentDatatype}\n   * @readonly\n   *\n   * @default {@link ComponentDatatype.FLOAT}\n   */\n  componentDatatype: {\n    get: function () {\n      return ComponentDatatype.FLOAT;\n    },\n  },\n\n  /**\n   * The number of components in the attributes, i.e., {@link OffsetGeometryInstanceAttribute#value}.\n   *\n   * @memberof OffsetGeometryInstanceAttribute.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @default 3\n   */\n  componentsPerAttribute: {\n    get: function () {\n      return 3;\n    },\n  },\n\n  /**\n   * When <code>true</code> and <code>componentDatatype</code> is an integer format,\n   * indicate that the components should be mapped to the range [0, 1] (unsigned)\n   * or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n   *\n   * @memberof OffsetGeometryInstanceAttribute.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  normalize: {\n    get: function () {\n      return false;\n    },\n  },\n});\n\n/**\n * Creates a new {@link OffsetGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}.\n *\n * @param {Cartesian3} offset The cartesian offset\n * @returns {OffsetGeometryInstanceAttribute} The new {@link OffsetGeometryInstanceAttribute} instance.\n */\nOffsetGeometryInstanceAttribute.fromCartesian3 = function (offset) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"offset\", offset);\n  //>>includeEnd('debug');\n\n  return new OffsetGeometryInstanceAttribute(offset.x, offset.y, offset.z);\n};\n\n/**\n * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.\n *\n * @param {Cartesian3} offset The cartesian offset\n * @param {Float32Array} [result] The array to store the result in, if undefined a new instance will be created.\n * @returns {Float32Array} The modified result parameter or a new instance if result was undefined.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.modelMatrix = Cesium.OffsetGeometryInstanceAttribute.toValue(modelMatrix, attributes.modelMatrix);\n */\nOffsetGeometryInstanceAttribute.toValue = function (offset, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"offset\", offset);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Float32Array([offset.x, offset.y, offset.z]);\n  }\n\n  result[0] = offset.x;\n  result[1] = offset.y;\n  result[2] = offset.z;\n  return result;\n};\nexport default OffsetGeometryInstanceAttribute;\n", "import ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Value and type information for per-instance geometry attribute that determines if the geometry instance will be shown.\n *\n * @alias ShowGeometryInstanceAttribute\n * @constructor\n *\n * @param {boolean} [show=true] Determines if the geometry instance will be shown.\n *\n *\n * @example\n * const instance = new Cesium.GeometryInstance({\n *   geometry : new Cesium.BoxGeometry({\n *     vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,\n *     minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),\n *     maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)\n *   }),\n *   modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n *     Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),\n *   id : 'box',\n *   attributes : {\n *     show : new Cesium.ShowGeometryInstanceAttribute(false)\n *   }\n * });\n *\n * @see GeometryInstance\n * @see GeometryInstanceAttribute\n */\nfunction ShowGeometryInstanceAttribute(show) {\n  show = defaultValue(show, true);\n\n  /**\n   * The values for the attributes stored in a typed array.\n   *\n   * @type Uint8Array\n   *\n   * @default [1.0]\n   */\n  this.value = ShowGeometryInstanceAttribute.toValue(show);\n}\n\nObject.defineProperties(ShowGeometryInstanceAttribute.prototype, {\n  /**\n   * The datatype of each component in the attribute, e.g., individual elements in\n   * {@link ColorGeometryInstanceAttribute#value}.\n   *\n   * @memberof ShowGeometryInstanceAttribute.prototype\n   *\n   * @type {ComponentDatatype}\n   * @readonly\n   *\n   * @default {@link ComponentDatatype.UNSIGNED_BYTE}\n   */\n  componentDatatype: {\n    get: function () {\n      return ComponentDatatype.UNSIGNED_BYTE;\n    },\n  },\n\n  /**\n   * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.\n   *\n   * @memberof ShowGeometryInstanceAttribute.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @default 1\n   */\n  componentsPerAttribute: {\n    get: function () {\n      return 1;\n    },\n  },\n\n  /**\n   * When <code>true</code> and <code>componentDatatype</code> is an integer format,\n   * indicate that the components should be mapped to the range [0, 1] (unsigned)\n   * or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n   *\n   * @memberof ShowGeometryInstanceAttribute.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  normalize: {\n    get: function () {\n      return false;\n    },\n  },\n});\n\n/**\n * Converts a boolean show to a typed array that can be used to assign a show attribute.\n *\n * @param {boolean} show The show value.\n * @param {Uint8Array} [result] The array to store the result in, if undefined a new instance will be created.\n * @returns {Uint8Array} The modified result parameter or a new instance if result was undefined.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true, attributes.show);\n */\nShowGeometryInstanceAttribute.toValue = function (show, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(show)) {\n    throw new DeveloperError(\"show is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Uint8Array([show]);\n  }\n  result[0] = show;\n  return result;\n};\nexport default ShowGeometryInstanceAttribute;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 v_positionEC;\\n\\\nin vec3 v_normalEC;\\n\\\nin vec3 v_tangentEC;\\n\\\nin vec3 v_bitangentEC;\\n\\\nin vec2 v_st;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec3 positionToEyeEC = -v_positionEC;\\n\\\n    mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\\n\\\n\\n\\\n    vec3 normalEC = normalize(v_normalEC);\\n\\\n#ifdef FACE_FORWARD\\n\\\n    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\\n\\\n#endif\\n\\\n\\n\\\n    czm_materialInput materialInput;\\n\\\n    materialInput.normalEC = normalEC;\\n\\\n    materialInput.tangentToEyeMatrix = tangentToEyeMatrix;\\n\\\n    materialInput.positionToEyeEC = positionToEyeEC;\\n\\\n    materialInput.st = v_st;\\n\\\n    czm_material material = czm_getMaterial(materialInput);\\n\\\n\\n\\\n#ifdef FLAT\\n\\\n    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#else\\n\\\n    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 position3DHigh;\\n\\\nin vec3 position3DLow;\\n\\\nin vec3 normal;\\n\\\nin vec3 tangent;\\n\\\nin vec3 bitangent;\\n\\\nin vec2 st;\\n\\\nin float batchId;\\n\\\n\\n\\\nout vec3 v_positionEC;\\n\\\nout vec3 v_normalEC;\\n\\\nout vec3 v_tangentEC;\\n\\\nout vec3 v_bitangentEC;\\n\\\nout vec2 v_st;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 p = czm_computePosition();\\n\\\n\\n\\\n    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates\\n\\\n    v_normalEC = czm_normal * normal;                         // normal in eye coordinates\\n\\\n    v_tangentEC = czm_normal * tangent;                       // tangent in eye coordinates\\n\\\n    v_bitangentEC = czm_normal * bitangent;                   // bitangent in eye coordinates\\n\\\n    v_st = st;\\n\\\n\\n\\\n    gl_Position = czm_modelViewProjectionRelativeToEye * p;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 v_positionEC;\\n\\\nin vec3 v_normalEC;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec3 positionToEyeEC = -v_positionEC;\\n\\\n\\n\\\n    vec3 normalEC = normalize(v_normalEC);\\n\\\n#ifdef FACE_FORWARD\\n\\\n    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\\n\\\n#endif\\n\\\n\\n\\\n    czm_materialInput materialInput;\\n\\\n    materialInput.normalEC = normalEC;\\n\\\n    materialInput.positionToEyeEC = positionToEyeEC;\\n\\\n    czm_material material = czm_getMaterial(materialInput);\\n\\\n\\n\\\n#ifdef FLAT\\n\\\n    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#else\\n\\\n    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 position3DHigh;\\n\\\nin vec3 position3DLow;\\n\\\nin vec3 normal;\\n\\\nin float batchId;\\n\\\n\\n\\\nout vec3 v_positionEC;\\n\\\nout vec3 v_normalEC;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 p = czm_computePosition();\\n\\\n\\n\\\n    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates\\n\\\n    v_normalEC = czm_normal * normal;                         // normal in eye coordinates\\n\\\n\\n\\\n    gl_Position = czm_modelViewProjectionRelativeToEye * p;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 v_positionEC;\\n\\\nin vec3 v_normalEC;\\n\\\nin vec2 v_st;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec3 positionToEyeEC = -v_positionEC;\\n\\\n\\n\\\n    vec3 normalEC = normalize(v_normalEC);\\n\\\n#ifdef FACE_FORWARD\\n\\\n    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\\n\\\n#endif\\n\\\n\\n\\\n    czm_materialInput materialInput;\\n\\\n    materialInput.normalEC = normalEC;\\n\\\n    materialInput.positionToEyeEC = positionToEyeEC;\\n\\\n    materialInput.st = v_st;\\n\\\n    czm_material material = czm_getMaterial(materialInput);\\n\\\n\\n\\\n#ifdef FLAT\\n\\\n    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#else\\n\\\n    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 position3DHigh;\\n\\\nin vec3 position3DLow;\\n\\\nin vec3 normal;\\n\\\nin vec2 st;\\n\\\nin float batchId;\\n\\\n\\n\\\nout vec3 v_positionEC;\\n\\\nout vec3 v_normalEC;\\n\\\nout vec2 v_st;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 p = czm_computePosition();\\n\\\n\\n\\\n    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates\\n\\\n    v_normalEC = czm_normal * normal;                         // normal in eye coordinates\\n\\\n    v_st = st;\\n\\\n\\n\\\n    gl_Position = czm_modelViewProjectionRelativeToEye * p;\\n\\\n}\\n\\\n\";\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Determines how two pixels' values are combined.\n *\n * @enum {number}\n */\nconst BlendEquation = {\n  /**\n   * Pixel values are added componentwise.  This is used in additive blending for translucency.\n   *\n   * @type {number}\n   * @constant\n   */\n  ADD: WebGLConstants.FUNC_ADD,\n\n  /**\n   * Pixel values are subtracted componentwise (source - destination).  This is used in alpha blending for translucency.\n   *\n   * @type {number}\n   * @constant\n   */\n  SUBTRACT: WebGLConstants.FUNC_SUBTRACT,\n\n  /**\n   * Pixel values are subtracted componentwise (destination - source).\n   *\n   * @type {number}\n   * @constant\n   */\n  REVERSE_SUBTRACT: WebGLConstants.FUNC_REVERSE_SUBTRACT,\n\n  /**\n   * Pixel values are given to the minimum function (min(source, destination)).\n   *\n   * This equation operates on each pixel color component.\n   *\n   * @type {number}\n   * @constant\n   */\n  MIN: WebGLConstants.MIN,\n\n  /**\n   * Pixel values are given to the maximum function (max(source, destination)).\n   *\n   * This equation operates on each pixel color component.\n   *\n   * @type {number}\n   * @constant\n   */\n  MAX: WebGLConstants.MAX,\n};\nexport default Object.freeze(BlendEquation);\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Determines how blending factors are computed.\n *\n * @enum {number}\n */\nconst BlendFunction = {\n  /**\n   * The blend factor is zero.\n   *\n   * @type {number}\n   * @constant\n   */\n  ZERO: WebGLConstants.ZERO,\n\n  /**\n   * The blend factor is one.\n   *\n   * @type {number}\n   * @constant\n   */\n  ONE: WebGLConstants.ONE,\n\n  /**\n   * The blend factor is the source color.\n   *\n   * @type {number}\n   * @constant\n   */\n  SOURCE_COLOR: WebGLConstants.SRC_COLOR,\n\n  /**\n   * The blend factor is one minus the source color.\n   *\n   * @type {number}\n   * @constant\n   */\n  ONE_MINUS_SOURCE_COLOR: WebGLConstants.ONE_MINUS_SRC_COLOR,\n\n  /**\n   * The blend factor is the destination color.\n   *\n   * @type {number}\n   * @constant\n   */\n  DESTINATION_COLOR: WebGLConstants.DST_COLOR,\n\n  /**\n   * The blend factor is one minus the destination color.\n   *\n   * @type {number}\n   * @constant\n   */\n  ONE_MINUS_DESTINATION_COLOR: WebGLConstants.ONE_MINUS_DST_COLOR,\n\n  /**\n   * The blend factor is the source alpha.\n   *\n   * @type {number}\n   * @constant\n   */\n  SOURCE_ALPHA: WebGLConstants.SRC_ALPHA,\n\n  /**\n   * The blend factor is one minus the source alpha.\n   *\n   * @type {number}\n   * @constant\n   */\n  ONE_MINUS_SOURCE_ALPHA: WebGLConstants.ONE_MINUS_SRC_ALPHA,\n\n  /**\n   * The blend factor is the destination alpha.\n   *\n   * @type {number}\n   * @constant\n   */\n  DESTINATION_ALPHA: WebGLConstants.DST_ALPHA,\n\n  /**\n   * The blend factor is one minus the destination alpha.\n   *\n   * @type {number}\n   * @constant\n   */\n  ONE_MINUS_DESTINATION_ALPHA: WebGLConstants.ONE_MINUS_DST_ALPHA,\n\n  /**\n   * The blend factor is the constant color.\n   *\n   * @type {number}\n   * @constant\n   */\n  CONSTANT_COLOR: WebGLConstants.CONSTANT_COLOR,\n\n  /**\n   * The blend factor is one minus the constant color.\n   *\n   * @type {number}\n   * @constant\n   */\n  ONE_MINUS_CONSTANT_COLOR: WebGLConstants.ONE_MINUS_CONSTANT_COLOR,\n\n  /**\n   * The blend factor is the constant alpha.\n   *\n   * @type {number}\n   * @constant\n   */\n  CONSTANT_ALPHA: WebGLConstants.CONSTANT_ALPHA,\n\n  /**\n   * The blend factor is one minus the constant alpha.\n   *\n   * @type {number}\n   * @constant\n   */\n  ONE_MINUS_CONSTANT_ALPHA: WebGLConstants.ONE_MINUS_CONSTANT_ALPHA,\n\n  /**\n   * The blend factor is the saturated source alpha.\n   *\n   * @type {number}\n   * @constant\n   */\n  SOURCE_ALPHA_SATURATE: WebGLConstants.SRC_ALPHA_SATURATE,\n};\nexport default Object.freeze(BlendFunction);\n", "import BlendEquation from \"./BlendEquation.js\";\nimport BlendFunction from \"./BlendFunction.js\";\n\n/**\n * The blending state combines {@link BlendEquation} and {@link BlendFunction} and the\n * <code>enabled</code> flag to define the full blending state for combining source and\n * destination fragments when rendering.\n * <p>\n * This is a helper when using custom render states with {@link Appearance#renderState}.\n * </p>\n *\n * @namespace\n */\nconst BlendingState = {\n  /**\n   * Blending is disabled.\n   *\n   * @type {object}\n   * @constant\n   */\n  DISABLED: Object.freeze({\n    enabled: false,\n  }),\n\n  /**\n   * Blending is enabled using alpha blending, <code>source(source.alpha) + destination(1 - source.alpha)</code>.\n   *\n   * @type {object}\n   * @constant\n   */\n  ALPHA_BLEND: Object.freeze({\n    enabled: true,\n    equationRgb: BlendEquation.ADD,\n    equationAlpha: BlendEquation.ADD,\n    functionSourceRgb: BlendFunction.SOURCE_ALPHA,\n    functionSourceAlpha: BlendFunction.ONE,\n    functionDestinationRgb: BlendFunction.ONE_MINUS_SOURCE_ALPHA,\n    functionDestinationAlpha: BlendFunction.ONE_MINUS_SOURCE_ALPHA,\n  }),\n\n  /**\n   * Blending is enabled using alpha blending with premultiplied alpha, <code>source + destination(1 - source.alpha)</code>.\n   *\n   * @type {object}\n   * @constant\n   */\n  PRE_MULTIPLIED_ALPHA_BLEND: Object.freeze({\n    enabled: true,\n    equationRgb: BlendEquation.ADD,\n    equationAlpha: BlendEquation.ADD,\n    functionSourceRgb: BlendFunction.ONE,\n    functionSourceAlpha: BlendFunction.ONE,\n    functionDestinationRgb: BlendFunction.ONE_MINUS_SOURCE_ALPHA,\n    functionDestinationAlpha: BlendFunction.ONE_MINUS_SOURCE_ALPHA,\n  }),\n\n  /**\n   * Blending is enabled using additive blending, <code>source(source.alpha) + destination</code>.\n   *\n   * @type {object}\n   * @constant\n   */\n  ADDITIVE_BLEND: Object.freeze({\n    enabled: true,\n    equationRgb: BlendEquation.ADD,\n    equationAlpha: BlendEquation.ADD,\n    functionSourceRgb: BlendFunction.SOURCE_ALPHA,\n    functionSourceAlpha: BlendFunction.ONE,\n    functionDestinationRgb: BlendFunction.ONE,\n    functionDestinationAlpha: BlendFunction.ONE,\n  }),\n};\nexport default Object.freeze(BlendingState);\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Determines which triangles, if any, are culled.\n *\n * @enum {number}\n */\nconst CullFace = {\n  /**\n   * Front-facing triangles are culled.\n   *\n   * @type {number}\n   * @constant\n   */\n  FRONT: WebGLConstants.FRONT,\n\n  /**\n   * Back-facing triangles are culled.\n   *\n   * @type {number}\n   * @constant\n   */\n  BACK: WebGLConstants.BACK,\n\n  /**\n   * Both front-facing and back-facing triangles are culled.\n   *\n   * @type {number}\n   * @constant\n   */\n  FRONT_AND_BACK: WebGLConstants.FRONT_AND_BACK,\n};\nexport default Object.freeze(CullFace);\n", "import clone from \"../Core/clone.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport CullFace from \"./CullFace.js\";\n\n/**\n * An appearance defines the full GLSL vertex and fragment shaders and the\n * render state used to draw a {@link Primitive}.  All appearances implement\n * this base <code>Appearance</code> interface.\n *\n * @alias Appearance\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {boolean} [options.translucent=true] When <code>true</code>, the geometry is expected to appear translucent so {@link Appearance#renderState} has alpha blending enabled.\n * @param {boolean} [options.closed=false] When <code>true</code>, the geometry is expected to be closed so {@link Appearance#renderState} has backface culling enabled.\n * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color.\n * @param {string} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.\n * @param {string} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.\n * @param {object} [options.renderState] Optional render state to override the default render state.\n *\n * @see MaterialAppearance\n * @see EllipsoidSurfaceAppearance\n * @see PerInstanceColorAppearance\n * @see DebugAppearance\n * @see PolylineColorAppearance\n * @see PolylineMaterialAppearance\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Geometry%20and%20Appearances.html|Geometry and Appearances Demo}\n */\nfunction Appearance(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * The material used to determine the fragment color.  Unlike other {@link Appearance}\n   * properties, this is not read-only, so an appearance's material can change on the fly.\n   *\n   * @type Material\n   *\n   * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n   */\n  this.material = options.material;\n\n  /**\n   * When <code>true</code>, the geometry is expected to appear translucent.\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  this.translucent = defaultValue(options.translucent, true);\n\n  this._vertexShaderSource = options.vertexShaderSource;\n  this._fragmentShaderSource = options.fragmentShaderSource;\n  this._renderState = options.renderState;\n  this._closed = defaultValue(options.closed, false);\n}\n\nObject.defineProperties(Appearance.prototype, {\n  /**\n   * The GLSL source code for the vertex shader.\n   *\n   * @memberof Appearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  vertexShaderSource: {\n    get: function () {\n      return this._vertexShaderSource;\n    },\n  },\n\n  /**\n   * The GLSL source code for the fragment shader.  The full fragment shader\n   * source is built procedurally taking into account the {@link Appearance#material}.\n   * Use {@link Appearance#getFragmentShaderSource} to get the full source.\n   *\n   * @memberof Appearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  fragmentShaderSource: {\n    get: function () {\n      return this._fragmentShaderSource;\n    },\n  },\n\n  /**\n   * The WebGL fixed-function state to use when rendering the geometry.\n   *\n   * @memberof Appearance.prototype\n   *\n   * @type {object}\n   * @readonly\n   */\n  renderState: {\n    get: function () {\n      return this._renderState;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the geometry is expected to be closed.\n   *\n   * @memberof Appearance.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  closed: {\n    get: function () {\n      return this._closed;\n    },\n  },\n});\n\n/**\n * Procedurally creates the full GLSL fragment shader source for this appearance\n * taking into account {@link Appearance#fragmentShaderSource} and {@link Appearance#material}.\n *\n * @returns {string} The full GLSL fragment shader source.\n */\nAppearance.prototype.getFragmentShaderSource = function () {\n  const parts = [];\n  if (this.flat) {\n    parts.push(\"#define FLAT\");\n  }\n  if (this.faceForward) {\n    parts.push(\"#define FACE_FORWARD\");\n  }\n  if (defined(this.material)) {\n    parts.push(this.material.shaderSource);\n  }\n  parts.push(this.fragmentShaderSource);\n\n  return parts.join(\"\\n\");\n};\n\n/**\n * Determines if the geometry is translucent based on {@link Appearance#translucent} and {@link Material#isTranslucent}.\n *\n * @returns {boolean} <code>true</code> if the appearance is translucent.\n */\nAppearance.prototype.isTranslucent = function () {\n  return (\n    (defined(this.material) && this.material.isTranslucent()) ||\n    (!defined(this.material) && this.translucent)\n  );\n};\n\n/**\n * Creates a render state.  This is not the final render state instance; instead,\n * it can contain a subset of render state properties identical to the render state\n * created in the context.\n *\n * @returns {object} The render state.\n */\nAppearance.prototype.getRenderState = function () {\n  const translucent = this.isTranslucent();\n  const rs = clone(this.renderState, false);\n  if (translucent) {\n    rs.depthMask = false;\n    rs.blending = BlendingState.ALPHA_BLEND;\n  } else {\n    rs.depthMask = true;\n  }\n  return rs;\n};\n\n/**\n * @private\n */\nAppearance.getDefaultRenderState = function (translucent, closed, existing) {\n  let rs = {\n    depthTest: {\n      enabled: true,\n    },\n  };\n\n  if (translucent) {\n    rs.depthMask = false;\n    rs.blending = BlendingState.ALPHA_BLEND;\n  }\n\n  if (closed) {\n    rs.cull = {\n      enabled: true,\n      face: CullFace.BACK,\n    };\n  }\n\n  if (defined(existing)) {\n    rs = combine(existing, rs, true);\n  }\n\n  return rs;\n};\nexport default Appearance;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D image;\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n    vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));\\n\\\n    rampColor = czm_gammaCorrect(rampColor);\\n\\\n    material.diffuse = rampColor.rgb;\\n\\\n    material.alpha = rampColor.a;\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D image;\\n\\\nuniform float strength;\\n\\\nuniform vec2 repeat;\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n\\n\\\n    vec2 st = materialInput.st;\\n\\\n\\n\\\n    vec2 centerPixel = fract(repeat * st);\\n\\\n    float centerBump = texture(image, centerPixel).channel;\\n\\\n\\n\\\n    float imageWidth = float(imageDimensions.x);\\n\\\n    vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\\n\\\n    float rightBump = texture(image, rightPixel).channel;\\n\\\n\\n\\\n    float imageHeight = float(imageDimensions.y);\\n\\\n    vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\\n\\\n    float topBump = texture(image, leftPixel).channel;\\n\\\n\\n\\\n    vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\\n\\\n    vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\\n\\\n\\n\\\n    material.normal = normalEC;\\n\\\n    material.diffuse = vec3(0.01);\\n\\\n\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 lightColor;\\n\\\nuniform vec4 darkColor;\\n\\\nuniform vec2 repeat;\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n\\n\\\n    vec2 st = materialInput.st;\\n\\\n\\n\\\n    // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights\\n\\\n    float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);  // 0.0 or 1.0\\n\\\n\\n\\\n    // Find the distance from the closest separator (region between two colors)\\n\\\n    float scaledWidth = fract(repeat.s * st.s);\\n\\\n    scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\\n\\\n    float scaledHeight = fract(repeat.t * st.t);\\n\\\n    scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\\n\\\n    float value = min(scaledWidth, scaledHeight);\\n\\\n\\n\\\n    vec4 currentColor = mix(lightColor, darkColor, b);\\n\\\n    vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\\n\\\n\\n\\\n    color = czm_gammaCorrect(color);\\n\\\n    material.diffuse = color.rgb;\\n\\\n    material.alpha = color.a;\\n\\\n\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 lightColor;\\n\\\nuniform vec4 darkColor;\\n\\\nuniform vec2 repeat;\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n\\n\\\n    // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights\\n\\\n    float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));  // 0.0 or 1.0\\n\\\n\\n\\\n    vec4 color = mix(lightColor, darkColor, b);\\n\\\n    color = czm_gammaCorrect(color);\\n\\\n    material.diffuse = color.rgb;\\n\\\n    material.alpha = color.a;\\n\\\n\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D heights;\\n\\\nuniform sampler2D colors;\\n\\\n\\n\\\n// This material expects heights to be sorted from lowest to highest.\\n\\\n\\n\\\nfloat getHeight(int idx, float invTexSize)\\n\\\n{\\n\\\n    vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);\\n\\\n#ifdef OES_texture_float\\n\\\n    return texture(heights, uv).x;\\n\\\n#else\\n\\\n    return czm_unpackFloat(texture(heights, uv));\\n\\\n#endif\\n\\\n}\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n\\n\\\n    float height = materialInput.height;\\n\\\n    float invTexSize = 1.0 / float(heightsDimensions.x);\\n\\\n\\n\\\n    float minHeight = getHeight(0, invTexSize);\\n\\\n    float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize);\\n\\\n\\n\\\n    // early-out when outside the height range\\n\\\n    if (height < minHeight || height > maxHeight) {\\n\\\n        material.diffuse = vec3(0.0);\\n\\\n        material.alpha = 0.0;\\n\\\n        return material;\\n\\\n    }\\n\\\n\\n\\\n    // Binary search to find heights above and below.\\n\\\n    int idxBelow = 0;\\n\\\n    int idxAbove = heightsDimensions.x;\\n\\\n    float heightBelow = minHeight;\\n\\\n    float heightAbove = maxHeight;\\n\\\n\\n\\\n    // while loop not allowed, so use for loop with max iterations.\\n\\\n    // maxIterations of 16 supports a texture size up to 65536 (2^16).\\n\\\n    const int maxIterations = 16;\\n\\\n    for (int i = 0; i < maxIterations; i++) {\\n\\\n        if (idxBelow >= idxAbove - 1) {\\n\\\n            break;\\n\\\n        }\\n\\\n\\n\\\n        int idxMid = (idxBelow + idxAbove) / 2;\\n\\\n        float heightTex = getHeight(idxMid, invTexSize);\\n\\\n\\n\\\n        if (height > heightTex) {\\n\\\n            idxBelow = idxMid;\\n\\\n            heightBelow = heightTex;\\n\\\n        } else {\\n\\\n            idxAbove = idxMid;\\n\\\n            heightAbove = heightTex;\\n\\\n        }\\n\\\n    }\\n\\\n\\n\\\n    float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);\\n\\\n    vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);\\n\\\n    vec4 color = texture(colors, colorUv);\\n\\\n\\n\\\n    // undo preumultiplied alpha\\n\\\n    if (color.a > 0.0) \\n\\\n    {\\n\\\n        color.rgb /= color.a;\\n\\\n    }\\n\\\n    \\n\\\n    color.rgb = czm_gammaCorrect(color.rgb);\\n\\\n\\n\\\n    material.diffuse = color.rgb;\\n\\\n    material.alpha = color.a;\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 color;\\n\\\nuniform float spacing;\\n\\\nuniform float width;\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n\\n\\\n    float distanceToContour = mod(materialInput.height, spacing);\\n\\\n\\n\\\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\\n\\\n    float dxc = abs(dFdx(materialInput.height));\\n\\\n    float dyc = abs(dFdy(materialInput.height));\\n\\\n    float dF = max(dxc, dyc) * czm_pixelRatio * width;\\n\\\n    float alpha = (distanceToContour < dF) ? 1.0 : 0.0;\\n\\\n#else\\n\\\n    // If no derivatives available (IE 10?), use pixel ratio\\n\\\n    float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;\\n\\\n#endif\\n\\\n\\n\\\n    vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a));\\n\\\n    material.diffuse = outColor.rgb;\\n\\\n    material.alpha = outColor.a;\\n\\\n\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D image;\\n\\\nuniform float minimumHeight;\\n\\\nuniform float maximumHeight;\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n    float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);\\n\\\n    vec4 rampColor = texture(image, vec2(scaledHeight, 0.5));\\n\\\n    rampColor = czm_gammaCorrect(rampColor);\\n\\\n    material.diffuse = rampColor.rgb;\\n\\\n    material.alpha = rampColor.a;\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 fadeInColor;\\n\\\nuniform vec4 fadeOutColor;\\n\\\nuniform float maximumDistance;\\n\\\nuniform bool repeat;\\n\\\nuniform vec2 fadeDirection;\\n\\\nuniform vec2 time;\\n\\\n\\n\\\nfloat getTime(float t, float coord)\\n\\\n{\\n\\\n    float scalar = 1.0 / maximumDistance;\\n\\\n    float q  = distance(t, coord) * scalar;\\n\\\n    if (repeat)\\n\\\n    {\\n\\\n        float r = distance(t, coord + 1.0) * scalar;\\n\\\n        float s = distance(t, coord - 1.0) * scalar;\\n\\\n        q = min(min(r, s), q);\\n\\\n    }\\n\\\n    return clamp(q, 0.0, 1.0);\\n\\\n}\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n\\n\\\n    vec2 st = materialInput.st;\\n\\\n    float s = getTime(time.x, st.s) * fadeDirection.s;\\n\\\n    float t = getTime(time.y, st.t) * fadeDirection.t;\\n\\\n\\n\\\n    float u = length(vec2(s, t));\\n\\\n    vec4 color = mix(fadeInColor, fadeOutColor, u);\\n\\\n\\n\\\n    color = czm_gammaCorrect(color);\\n\\\n    material.emission = color.rgb;\\n\\\n    material.alpha = color.a;\\n\\\n\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 color;\\n\\\nuniform float cellAlpha;\\n\\\nuniform vec2 lineCount;\\n\\\nuniform vec2 lineThickness;\\n\\\nuniform vec2 lineOffset;\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n\\n\\\n    vec2 st = materialInput.st;\\n\\\n\\n\\\n    float scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\\n\\\n    scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\\n\\\n    float scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\\n\\\n    scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\\n\\\n\\n\\\n    float value;\\n\\\n\\n\\\n    // Fuzz Factor - Controls blurriness of lines\\n\\\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\\n\\\n    const float fuzz = 1.2;\\n\\\n    vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;\\n\\\n\\n\\\n    // From \\\"3D Engine Design for Virtual Globes\\\" by Cozzi and Ring, Listing 4.13.\\n\\\n    vec2 dx = abs(dFdx(st));\\n\\\n    vec2 dy = abs(dFdy(st));\\n\\\n    vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\\n\\\n    value = min(\\n\\\n        smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\\n\\\n        smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\\n\\\n#else\\n\\\n    // If no derivatives available (IE 10?), revert to view-dependent fuzz\\n\\\n    const float fuzz = 0.05;\\n\\\n\\n\\\n    vec2 range = 0.5 - (lineThickness * 0.05);\\n\\\n    value = min(\\n\\\n        1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\\n\\\n        1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\\n\\\n#endif\\n\\\n\\n\\\n    // Edges taken from RimLightingMaterial.glsl\\n\\\n    // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html\\n\\\n    float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\\n\\\n    float sRim = smoothstep(0.8, 1.0, dRim);\\n\\\n    value *= (1.0 - sRim);\\n\\\n\\n\\\n    vec4 halfColor;\\n\\\n    halfColor.rgb = color.rgb * 0.5;\\n\\\n    halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));\\n\\\n    halfColor = czm_gammaCorrect(halfColor);\\n\\\n    material.diffuse = halfColor.rgb;\\n\\\n    material.emission = halfColor.rgb;\\n\\\n    material.alpha = halfColor.a;\\n\\\n\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D image;\\n\\\nuniform float strength;\\n\\\nuniform vec2 repeat;\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n    \\n\\\n    vec4 textureValue = texture(image, fract(repeat * materialInput.st));\\n\\\n    vec3 normalTangentSpace = textureValue.channels;\\n\\\n    normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\\n\\\n    normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\\n\\\n    normalTangentSpace = normalize(normalTangentSpace);\\n\\\n    vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\\n\\\n    \\n\\\n    material.normal = normalEC;\\n\\\n    \\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 color;\\n\\\n\\n\\\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\\n\\\n{\\n\\\n    float slope = (p0.y - p1.y) / (p0.x - p1.x);\\n\\\n    return slope * (x - p0.x) + p0.y;\\n\\\n}\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n\\n\\\n    vec2 st = materialInput.st;\\n\\\n\\n\\\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\\n\\\n    float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;\\n\\\n#else\\n\\\n     // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head\\n\\\n    float base = 0.975;\\n\\\n#endif\\n\\\n\\n\\\n    vec2 center = vec2(1.0, 0.5);\\n\\\n    float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\\n\\\n    float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\\n\\\n\\n\\\n    float halfWidth = 0.15;\\n\\\n    float s = step(0.5 - halfWidth, st.t);\\n\\\n    s *= 1.0 - step(0.5 + halfWidth, st.t);\\n\\\n    s *= 1.0 - step(base, st.s);\\n\\\n\\n\\\n    float t = step(base, materialInput.st.s);\\n\\\n    t *= 1.0 - step(ptOnUpperLine, st.t);\\n\\\n    t *= step(ptOnLowerLine, st.t);\\n\\\n\\n\\\n    // Find the distance from the closest separator (region between two colors)\\n\\\n    float dist;\\n\\\n    if (st.s < base)\\n\\\n    {\\n\\\n        float d1 = abs(st.t - (0.5 - halfWidth));\\n\\\n        float d2 = abs(st.t - (0.5 + halfWidth));\\n\\\n        dist = min(d1, d2);\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        float d1 = czm_infinity;\\n\\\n        if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\\n\\\n        {\\n\\\n            d1 = abs(st.s - base);\\n\\\n        }\\n\\\n        float d2 = abs(st.t - ptOnUpperLine);\\n\\\n        float d3 = abs(st.t - ptOnLowerLine);\\n\\\n        dist = min(min(d1, d2), d3);\\n\\\n    }\\n\\\n\\n\\\n    vec4 outsideColor = vec4(0.0);\\n\\\n    vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\\n\\\n    vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\\n\\\n\\n\\\n    outColor = czm_gammaCorrect(outColor);\\n\\\n    material.diffuse = outColor.rgb;\\n\\\n    material.alpha = outColor.a;\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 color;\\n\\\nuniform vec4 gapColor;\\n\\\nuniform float dashLength;\\n\\\nuniform float dashPattern;\\n\\\nin float v_polylineAngle;\\n\\\n\\n\\\nconst float maskLength = 16.0;\\n\\\n\\n\\\nmat2 rotate(float rad) {\\n\\\n    float c = cos(rad);\\n\\\n    float s = sin(rad);\\n\\\n    return mat2(\\n\\\n        c, s,\\n\\\n        -s, c\\n\\\n    );\\n\\\n}\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n\\n\\\n    vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;\\n\\\n\\n\\\n    // Get the relative position within the dash from 0 to 1\\n\\\n    float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));\\n\\\n    // Figure out the mask index.\\n\\\n    float maskIndex = floor(dashPosition * maskLength);\\n\\\n    // Test the bit mask.\\n\\\n    float maskTest = floor(dashPattern / pow(2.0, maskIndex));\\n\\\n    vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;\\n\\\n    if (fragColor.a < 0.005) {   // matches 0/255 and 1/255\\n\\\n        discard;\\n\\\n    }\\n\\\n\\n\\\n    fragColor = czm_gammaCorrect(fragColor);\\n\\\n    material.emission = fragColor.rgb;\\n\\\n    material.alpha = fragColor.a;\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 color;\\n\\\nuniform float glowPower;\\n\\\nuniform float taperPower;\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n\\n\\\n    vec2 st = materialInput.st;\\n\\\n    float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\\n\\\n\\n\\\n    if (taperPower <= 0.99999) {\\n\\\n        glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));\\n\\\n    }\\n\\\n\\n\\\n    vec4 fragColor;\\n\\\n    fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);\\n\\\n    fragColor.a = clamp(0.0, 1.0, glow) * color.a;\\n\\\n    fragColor = czm_gammaCorrect(fragColor);\\n\\\n\\n\\\n    material.emission = fragColor.rgb;\\n\\\n    material.alpha = fragColor.a;\\n\\\n\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 color;\\n\\\nuniform vec4 outlineColor;\\n\\\nuniform float outlineWidth;\\n\\\n\\n\\\nin float v_width;\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n\\n\\\n    vec2 st = materialInput.st;\\n\\\n    float halfInteriorWidth =  0.5 * (v_width - outlineWidth) / v_width;\\n\\\n    float b = step(0.5 - halfInteriorWidth, st.t);\\n\\\n    b *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\\n\\\n\\n\\\n    // Find the distance from the closest separator (region between two colors)\\n\\\n    float d1 = abs(st.t - (0.5 - halfInteriorWidth));\\n\\\n    float d2 = abs(st.t - (0.5 + halfInteriorWidth));\\n\\\n    float dist = min(d1, d2);\\n\\\n\\n\\\n    vec4 currentColor = mix(outlineColor, color, b);\\n\\\n    vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\\n\\\n    outColor = czm_gammaCorrect(outColor);\\n\\\n\\n\\\n    material.diffuse = outColor.rgb;\\n\\\n    material.alpha = outColor.a;\\n\\\n\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 color;\\n\\\nuniform vec4 rimColor;\\n\\\nuniform float width;\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n\\n\\\n    // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html\\n\\\n    float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\\n\\\n    float s = smoothstep(1.0 - width, 1.0, d);\\n\\\n\\n\\\n    vec4 outColor = czm_gammaCorrect(color);\\n\\\n    vec4 outRimColor = czm_gammaCorrect(rimColor);\\n\\\n\\n\\\n    material.diffuse = outColor.rgb;\\n\\\n    material.emission = outRimColor.rgb * s;\\n\\\n    material.alpha = mix(outColor.a, outRimColor.a, s);\\n\\\n\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D image;\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n    vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));\\n\\\n    rampColor = czm_gammaCorrect(rampColor);\\n\\\n    material.diffuse = rampColor.rgb;\\n\\\n    material.alpha = rampColor.a;\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 evenColor;\\n\\\nuniform vec4 oddColor;\\n\\\nuniform float offset;\\n\\\nuniform float repeat;\\n\\\nuniform bool horizontal;\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n\\n\\\n    // Based on the Stripes Fragment Shader in the Orange Book (11.1.2)\\n\\\n    float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\\n\\\n    float value = fract((coord - offset) * (repeat * 0.5));\\n\\\n    float dist = min(value, min(abs(value - 0.5), 1.0 - value));\\n\\\n\\n\\\n    vec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\\n\\\n    vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\\n\\\n    color = czm_gammaCorrect(color);\\n\\\n\\n\\\n    material.diffuse = color.rgb;\\n\\\n    material.alpha = color.a;\\n\\\n\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"// Thanks for the contribution Jonas\\n\\\n// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog\\n\\\n\\n\\\nuniform sampler2D specularMap;\\n\\\nuniform sampler2D normalMap;\\n\\\nuniform vec4 baseWaterColor;\\n\\\nuniform vec4 blendColor;\\n\\\nuniform float frequency;\\n\\\nuniform float animationSpeed;\\n\\\nuniform float amplitude;\\n\\\nuniform float specularIntensity;\\n\\\nuniform float fadeFactor;\\n\\\n\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n\\n\\\n    float time = czm_frameNumber * animationSpeed;\\n\\\n\\n\\\n    // fade is a function of the distance from the fragment and the frequency of the waves\\n\\\n    float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\\n\\\n\\n\\\n    float specularMapValue = texture(specularMap, materialInput.st).r;\\n\\\n\\n\\\n    // note: not using directional motion at this time, just set the angle to 0.0;\\n\\\n    vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\\n\\\n    vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\\n\\\n\\n\\\n    // fade out the normal perturbation as we move further from the water surface\\n\\\n    normalTangentSpace.xy /= fade;\\n\\\n\\n\\\n    // attempt to fade out the normal perturbation as we approach non water areas (low specular map value)\\n\\\n    normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\\n\\\n\\n\\\n    normalTangentSpace = normalize(normalTangentSpace);\\n\\\n\\n\\\n    // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane\\n\\\n    float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\\n\\\n\\n\\\n    // fade out water effect as specular map value decreases\\n\\\n    material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;\\n\\\n\\n\\\n    // base color is a blend of the water and non-water color based on the value from the specular map\\n\\\n    // may need a uniform blend factor to better control this\\n\\\n    material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\\n\\\n\\n\\\n    // diffuse highlights are based on how perturbed the normal is\\n\\\n    material.diffuse += (0.1 * tsPerturbationRatio);\\n\\\n\\n\\\n    material.diffuse = material.diffuse;\\n\\\n\\n\\\n    material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\\n\\\n\\n\\\n    material.specular = specularIntensity;\\n\\\n    material.shininess = 10.0;\\n\\\n\\n\\\n    return material;\\n\\\n}\\n\\\n\";\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport combine from \"../Core/combine.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport loadKTX2 from \"../Core/loadKTX2.js\";\nimport Matrix2 from \"../Core/Matrix2.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Resource from \"../Core/Resource.js\";\nimport CubeMap from \"../Renderer/CubeMap.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport AspectRampMaterial from \"../Shaders/Materials/AspectRampMaterial.js\";\nimport BumpMapMaterial from \"../Shaders/Materials/BumpMapMaterial.js\";\nimport CheckerboardMaterial from \"../Shaders/Materials/CheckerboardMaterial.js\";\nimport DotMaterial from \"../Shaders/Materials/DotMaterial.js\";\nimport ElevationBandMaterial from \"../Shaders/Materials/ElevationBandMaterial.js\";\nimport ElevationContourMaterial from \"../Shaders/Materials/ElevationContourMaterial.js\";\nimport ElevationRampMaterial from \"../Shaders/Materials/ElevationRampMaterial.js\";\nimport FadeMaterial from \"../Shaders/Materials/FadeMaterial.js\";\nimport GridMaterial from \"../Shaders/Materials/GridMaterial.js\";\nimport NormalMapMaterial from \"../Shaders/Materials/NormalMapMaterial.js\";\nimport PolylineArrowMaterial from \"../Shaders/Materials/PolylineArrowMaterial.js\";\nimport PolylineDashMaterial from \"../Shaders/Materials/PolylineDashMaterial.js\";\nimport PolylineGlowMaterial from \"../Shaders/Materials/PolylineGlowMaterial.js\";\nimport PolylineOutlineMaterial from \"../Shaders/Materials/PolylineOutlineMaterial.js\";\nimport RimLightingMaterial from \"../Shaders/Materials/RimLightingMaterial.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport SlopeRampMaterial from \"../Shaders/Materials/SlopeRampMaterial.js\";\nimport StripeMaterial from \"../Shaders/Materials/StripeMaterial.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport WaterMaterial from \"../Shaders/Materials/Water.js\";\n\n/**\n * A Material defines surface appearance through a combination of diffuse, specular,\n * normal, emission, and alpha components. These values are specified using a\n * JSON schema called Fabric which gets parsed and assembled into glsl shader code\n * behind-the-scenes. Check out the {@link https://github.com/CesiumGS/cesium/wiki/Fabric|wiki page}\n * for more details on Fabric.\n * <br /><br />\n * <style type=\"text/css\">\n *  #materialDescriptions code {\n *      font-weight: normal;\n *      font-family: Consolas, 'Lucida Console', Monaco, monospace;\n *      color: #A35A00;\n *  }\n *  #materialDescriptions ul, #materialDescriptions ul ul {\n *      list-style-type: none;\n *  }\n *  #materialDescriptions ul ul {\n *      margin-bottom: 10px;\n *  }\n *  #materialDescriptions ul ul li {\n *      font-weight: normal;\n *      color: #000000;\n *      text-indent: -2em;\n *      margin-left: 2em;\n *  }\n *  #materialDescriptions ul li {\n *      font-weight: bold;\n *      color: #0053CF;\n *  }\n * </style>\n *\n * Base material types and their uniforms:\n * <div id='materialDescriptions'>\n * <ul>\n *  <li>Color</li>\n *  <ul>\n *      <li><code>color</code>:  rgba color object.</li>\n *  </ul>\n *  <li>Image</li>\n *  <ul>\n *      <li><code>image</code>:  path to image.</li>\n *      <li><code>repeat</code>:  Object with x and y values specifying the number of times to repeat the image.</li>\n *  </ul>\n *  <li>DiffuseMap</li>\n *  <ul>\n *      <li><code>image</code>:  path to image.</li>\n *      <li><code>channels</code>:  Three character string containing any combination of r, g, b, and a for selecting the desired image channels.</li>\n *      <li><code>repeat</code>:  Object with x and y values specifying the number of times to repeat the image.</li>\n *  </ul>\n *  <li>AlphaMap</li>\n *  <ul>\n *      <li><code>image</code>:  path to image.</li>\n *      <li><code>channel</code>:  One character string containing r, g, b, or a for selecting the desired image channel. </li>\n *      <li><code>repeat</code>:  Object with x and y values specifying the number of times to repeat the image.</li>\n *  </ul>\n *  <li>SpecularMap</li>\n *  <ul>\n *      <li><code>image</code>: path to image.</li>\n *      <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>\n *      <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>\n *  </ul>\n *  <li>EmissionMap</li>\n *  <ul>\n *      <li><code>image</code>:  path to image.</li>\n *      <li><code>channels</code>:  Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>\n *      <li><code>repeat</code>:  Object with x and y values specifying the number of times to repeat the image.</li>\n *  </ul>\n *  <li>BumpMap</li>\n *  <ul>\n *      <li><code>image</code>:  path to image.</li>\n *      <li><code>channel</code>:  One character string containing r, g, b, or a for selecting the desired image channel. </li>\n *      <li><code>repeat</code>:  Object with x and y values specifying the number of times to repeat the image.</li>\n *      <li><code>strength</code>:  Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.</li>\n *  </ul>\n *  <li>NormalMap</li>\n *  <ul>\n *      <li><code>image</code>:  path to image.</li>\n *      <li><code>channels</code>:  Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>\n *      <li><code>repeat</code>:  Object with x and y values specifying the number of times to repeat the image.</li>\n *      <li><code>strength</code>:  Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.</li>\n *  </ul>\n *  <li>Grid</li>\n *  <ul>\n *      <li><code>color</code>:  rgba color object for the whole material.</li>\n *      <li><code>cellAlpha</code>: Alpha value for the cells between grid lines.  This will be combined with color.alpha.</li>\n *      <li><code>lineCount</code>:  Object with x and y values specifying the number of columns and rows respectively.</li>\n *      <li><code>lineThickness</code>:  Object with x and y values specifying the thickness of grid lines (in pixels where available).</li>\n *      <li><code>lineOffset</code>:  Object with x and y values specifying the offset of grid lines (range is 0 to 1).</li>\n *  </ul>\n *  <li>Stripe</li>\n *  <ul>\n *      <li><code>horizontal</code>:  Boolean that determines if the stripes are horizontal or vertical.</li>\n *      <li><code>evenColor</code>:  rgba color object for the stripe's first color.</li>\n *      <li><code>oddColor</code>:  rgba color object for the stripe's second color.</li>\n *      <li><code>offset</code>:  Number that controls at which point into the pattern to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning of the odd color, 2.0 being the even color again, and any multiple or fractional values being in between.</li>\n *      <li><code>repeat</code>:  Number that controls the total number of stripes, half light and half dark.</li>\n *  </ul>\n *  <li>Checkerboard</li>\n *  <ul>\n *      <li><code>lightColor</code>:  rgba color object for the checkerboard's light alternating color.</li>\n *      <li><code>darkColor</code>: rgba color object for the checkerboard's dark alternating color.</li>\n *      <li><code>repeat</code>:  Object with x and y values specifying the number of columns and rows respectively.</li>\n *  </ul>\n *  <li>Dot</li>\n *  <ul>\n *      <li><code>lightColor</code>:  rgba color object for the dot color.</li>\n *      <li><code>darkColor</code>:  rgba color object for the background color.</li>\n *      <li><code>repeat</code>:  Object with x and y values specifying the number of columns and rows of dots respectively.</li>\n *  </ul>\n *  <li>Water</li>\n *  <ul>\n *      <li><code>baseWaterColor</code>:  rgba color object base color of the water.</li>\n *      <li><code>blendColor</code>:  rgba color object used when blending from water to non-water areas.</li>\n *      <li><code>specularMap</code>:  Single channel texture used to indicate areas of water.</li>\n *      <li><code>normalMap</code>:  Normal map for water normal perturbation.</li>\n *      <li><code>frequency</code>:  Number that controls the number of waves.</li>\n *      <li><code>animationSpeed</code>:  Number that controls the animations speed of the water.</li>\n *      <li><code>amplitude</code>:  Number that controls the amplitude of water waves.</li>\n *      <li><code>specularIntensity</code>:  Number that controls the intensity of specular reflections.</li>\n *  </ul>\n *  <li>RimLighting</li>\n *  <ul>\n *      <li><code>color</code>:  diffuse color and alpha.</li>\n *      <li><code>rimColor</code>:  diffuse color and alpha of the rim.</li>\n *      <li><code>width</code>:  Number that determines the rim's width.</li>\n *  </ul>\n *  <li>Fade</li>\n *  <ul>\n *      <li><code>fadeInColor</code>: diffuse color and alpha at <code>time</code></li>\n *      <li><code>fadeOutColor</code>: diffuse color and alpha at <code>maximumDistance</code> from <code>time</code></li>\n *      <li><code>maximumDistance</code>: Number between 0.0 and 1.0 where the <code>fadeInColor</code> becomes the <code>fadeOutColor</code>. A value of 0.0 gives the entire material a color of <code>fadeOutColor</code> and a value of 1.0 gives the the entire material a color of <code>fadeInColor</code></li>\n *      <li><code>repeat</code>: true if the fade should wrap around the texture coodinates.</li>\n *      <li><code>fadeDirection</code>: Object with x and y values specifying if the fade should be in the x and y directions.</li>\n *      <li><code>time</code>: Object with x and y values between 0.0 and 1.0 of the <code>fadeInColor</code> position</li>\n *  </ul>\n *  <li>PolylineArrow</li>\n *  <ul>\n *      <li><code>color</code>: diffuse color and alpha.</li>\n *  </ul>\n *  <li>PolylineDash</li>\n *  <ul>\n *      <li><code>color</code>: color for the line.</li>\n *      <li><code>gapColor</code>: color for the gaps in the line.</li>\n *      <li><code>dashLength</code>: Dash length in pixels.</li>\n *      <li><code>dashPattern</code>: The 16 bit stipple pattern for the line..</li>\n *  </ul>\n *  <li>PolylineGlow</li>\n *  <ul>\n *      <li><code>color</code>: color and maximum alpha for the glow on the line.</li>\n *      <li><code>glowPower</code>: strength of the glow, as a percentage of the total line width (less than 1.0).</li>\n *      <li><code>taperPower</code>: strength of the tapering effect, as a percentage of the total line length.  If 1.0 or higher, no taper effect is used.</li>\n *  </ul>\n *  <li>PolylineOutline</li>\n *  <ul>\n *      <li><code>color</code>: diffuse color and alpha for the interior of the line.</li>\n *      <li><code>outlineColor</code>: diffuse color and alpha for the outline.</li>\n *      <li><code>outlineWidth</code>: width of the outline in pixels.</li>\n *  </ul>\n *  <li>ElevationContour</li>\n *  <ul>\n *      <li><code>color</code>: color and alpha for the contour line.</li>\n *      <li><code>spacing</code>: spacing for contour lines in meters.</li>\n *      <li><code>width</code>: Number specifying the width of the grid lines in pixels.</li>\n *  </ul>\n *  <li>ElevationRamp</li>\n *  <ul>\n *      <li><code>image</code>: color ramp image to use for coloring the terrain.</li>\n *      <li><code>minimumHeight</code>: minimum height for the ramp.</li>\n *      <li><code>maximumHeight</code>: maximum height for the ramp.</li>\n *  </ul>\n *  <li>SlopeRamp</li>\n *  <ul>\n *      <li><code>image</code>: color ramp image to use for coloring the terrain by slope.</li>\n *  </ul>\n *  <li>AspectRamp</li>\n *  <ul>\n *      <li><code>image</code>: color ramp image to use for color the terrain by aspect.</li>\n *  </ul>\n *  <li>ElevationBand</li>\n *  <ul>\n *      <li><code>heights</code>: image of heights sorted from lowest to highest.</li>\n *      <li><code>colors</code>: image of colors at the corresponding heights.</li>\n * </ul>\n * </ul>\n * </ul>\n * </div>\n *\n * @alias Material\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {boolean} [options.strict=false] Throws errors for issues that would normally be ignored, including unused uniforms or materials.\n * @param {boolean|Function} [options.translucent=true] When <code>true</code> or a function that returns <code>true</code>, the geometry\n *                           with this material is expected to appear translucent.\n * @param {TextureMinificationFilter} [options.minificationFilter=TextureMinificationFilter.LINEAR] The {@link TextureMinificationFilter} to apply to this material's textures.\n * @param {TextureMagnificationFilter} [options.magnificationFilter=TextureMagnificationFilter.LINEAR] The {@link TextureMagnificationFilter} to apply to this material's textures.\n * @param {object} options.fabric The fabric JSON used to generate the material.\n *ructor\n *\n * @exception {DeveloperError} fabric: uniform has invalid type.\n * @exception {DeveloperError} fabric: uniforms and materials cannot share the same property.\n * @exception {DeveloperError} fabric: cannot have source and components in the same section.\n * @exception {DeveloperError} fabric: property name is not valid. It should be 'type', 'materials', 'uniforms', 'components', or 'source'.\n * @exception {DeveloperError} fabric: property name is not valid. It should be 'diffuse', 'specular', 'shininess', 'normal', 'emission', or 'alpha'.\n * @exception {DeveloperError} strict: shader source does not use string.\n * @exception {DeveloperError} strict: shader source does not use uniform.\n * @exception {DeveloperError} strict: shader source does not use material.\n *\n * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric wiki page} for a more detailed options of Fabric.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Materials.html|Cesium Sandcastle Materials Demo}\n *\n * @example\n * // Create a color material with fromType:\n * polygon.material = Cesium.Material.fromType('Color');\n * polygon.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);\n *\n * // Create the default material:\n * polygon.material = new Cesium.Material();\n *\n * // Create a color material with full Fabric notation:\n * polygon.material = new Cesium.Material({\n *   fabric: {\n *     type: 'Color',\n *     uniforms: {\n *       color: new Cesium.Color(1.0, 1.0, 0.0, 1.0)\n *     }\n *   }\n * });\n */\nfunction Material(options) {\n  /**\n   * The material type. Can be an existing type or a new type. If no type is specified in fabric, type is a GUID.\n   * @type {string}\n   * @default undefined\n   */\n  this.type = undefined;\n\n  /**\n   * The glsl shader source for this material.\n   * @type {string}\n   * @default undefined\n   */\n  this.shaderSource = undefined;\n\n  /**\n   * Maps sub-material names to Material objects.\n   * @type {object}\n   * @default undefined\n   */\n  this.materials = undefined;\n\n  /**\n   * Maps uniform names to their values.\n   * @type {object}\n   * @default undefined\n   */\n  this.uniforms = undefined;\n  this._uniforms = undefined;\n\n  /**\n   * When <code>true</code> or a function that returns <code>true</code>,\n   * the geometry is expected to appear translucent.\n   * @type {boolean|Function}\n   * @default undefined\n   */\n  this.translucent = undefined;\n\n  this._minificationFilter = defaultValue(\n    options.minificationFilter,\n    TextureMinificationFilter.LINEAR\n  );\n  this._magnificationFilter = defaultValue(\n    options.magnificationFilter,\n    TextureMagnificationFilter.LINEAR\n  );\n\n  this._strict = undefined;\n  this._template = undefined;\n  this._count = undefined;\n\n  this._texturePaths = {};\n  this._loadedImages = [];\n  this._loadedCubeMaps = [];\n\n  this._textures = {};\n\n  this._updateFunctions = [];\n\n  this._defaultTexture = undefined;\n\n  initializeMaterial(options, this);\n  Object.defineProperties(this, {\n    type: {\n      value: this.type,\n      writable: false,\n    },\n  });\n\n  if (!defined(Material._uniformList[this.type])) {\n    Material._uniformList[this.type] = Object.keys(this._uniforms);\n  }\n}\n\n// Cached list of combined uniform names indexed by type.\n// Used to get the list of uniforms in the same order.\nMaterial._uniformList = {};\n\n/**\n * Creates a new material using an existing material type.\n * <br /><br />\n * Shorthand for: new Material({fabric : {type : type}});\n *\n * @param {string} type The base material type.\n * @param {object} [uniforms] Overrides for the default uniforms.\n * @returns {Material} New material object.\n *\n * @exception {DeveloperError} material with that type does not exist.\n *\n * @example\n * const material = Cesium.Material.fromType('Color', {\n *   color: new Cesium.Color(1.0, 0.0, 0.0, 1.0)\n * });\n */\nMaterial.fromType = function (type, uniforms) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(Material._materialCache.getMaterial(type))) {\n    throw new DeveloperError(`material with type '${type}' does not exist.`);\n  }\n  //>>includeEnd('debug');\n\n  const material = new Material({\n    fabric: {\n      type: type,\n    },\n  });\n\n  if (defined(uniforms)) {\n    for (const name in uniforms) {\n      if (uniforms.hasOwnProperty(name)) {\n        material.uniforms[name] = uniforms[name];\n      }\n    }\n  }\n\n  return material;\n};\n\n/**\n * Gets whether or not this material is translucent.\n * @returns {boolean} <code>true</code> if this material is translucent, <code>false</code> otherwise.\n */\nMaterial.prototype.isTranslucent = function () {\n  if (defined(this.translucent)) {\n    if (typeof this.translucent === \"function\") {\n      return this.translucent();\n    }\n\n    return this.translucent;\n  }\n\n  let translucent = true;\n  const funcs = this._translucentFunctions;\n  const length = funcs.length;\n  for (let i = 0; i < length; ++i) {\n    const func = funcs[i];\n    if (typeof func === \"function\") {\n      translucent = translucent && func();\n    } else {\n      translucent = translucent && func;\n    }\n\n    if (!translucent) {\n      break;\n    }\n  }\n  return translucent;\n};\n\n/**\n * @private\n */\nMaterial.prototype.update = function (context) {\n  this._defaultTexture = context.defaultTexture;\n\n  let i;\n  let uniformId;\n\n  const loadedImages = this._loadedImages;\n  let length = loadedImages.length;\n  for (i = 0; i < length; ++i) {\n    const loadedImage = loadedImages[i];\n    uniformId = loadedImage.id;\n    let image = loadedImage.image;\n\n    // Images transcoded from KTX2 can contain multiple mip levels:\n    // https://github.khronos.org/KTX-Specification/#_mip_level_array\n    let mipLevels;\n    if (Array.isArray(image)) {\n      // highest detail mip should be level 0\n      mipLevels = image.slice(1, image.length).map(function (mipLevel) {\n        return mipLevel.bufferView;\n      });\n      image = image[0];\n    }\n\n    const sampler = new Sampler({\n      minificationFilter: this._minificationFilter,\n      magnificationFilter: this._magnificationFilter,\n    });\n\n    let texture;\n    if (defined(image.internalFormat)) {\n      texture = new Texture({\n        context: context,\n        pixelFormat: image.internalFormat,\n        width: image.width,\n        height: image.height,\n        source: {\n          arrayBufferView: image.bufferView,\n          mipLevels: mipLevels,\n        },\n        sampler: sampler,\n      });\n    } else {\n      texture = new Texture({\n        context: context,\n        source: image,\n        sampler: sampler,\n      });\n    }\n\n    // The material destroys its old texture only after the new one has been loaded.\n    // This will ensure a smooth swap of textures and prevent the default texture\n    // from appearing for a few frames.\n    const oldTexture = this._textures[uniformId];\n    if (defined(oldTexture) && oldTexture !== this._defaultTexture) {\n      oldTexture.destroy();\n    }\n\n    this._textures[uniformId] = texture;\n\n    const uniformDimensionsName = `${uniformId}Dimensions`;\n    if (this.uniforms.hasOwnProperty(uniformDimensionsName)) {\n      const uniformDimensions = this.uniforms[uniformDimensionsName];\n      uniformDimensions.x = texture._width;\n      uniformDimensions.y = texture._height;\n    }\n  }\n\n  loadedImages.length = 0;\n\n  const loadedCubeMaps = this._loadedCubeMaps;\n  length = loadedCubeMaps.length;\n\n  for (i = 0; i < length; ++i) {\n    const loadedCubeMap = loadedCubeMaps[i];\n    uniformId = loadedCubeMap.id;\n    const images = loadedCubeMap.images;\n\n    const cubeMap = new CubeMap({\n      context: context,\n      source: {\n        positiveX: images[0],\n        negativeX: images[1],\n        positiveY: images[2],\n        negativeY: images[3],\n        positiveZ: images[4],\n        negativeZ: images[5],\n      },\n      sampler: new Sampler({\n        minificationFilter: this._minificationFilter,\n        magnificationFilter: this._magnificationFilter,\n      }),\n    });\n\n    this._textures[uniformId] = cubeMap;\n  }\n\n  loadedCubeMaps.length = 0;\n\n  const updateFunctions = this._updateFunctions;\n  length = updateFunctions.length;\n  for (i = 0; i < length; ++i) {\n    updateFunctions[i](this, context);\n  }\n\n  const subMaterials = this.materials;\n  for (const name in subMaterials) {\n    if (subMaterials.hasOwnProperty(name)) {\n      subMaterials[name].update(context);\n    }\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see Material#destroy\n */\nMaterial.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * material = material && material.destroy();\n *\n * @see Material#isDestroyed\n */\nMaterial.prototype.destroy = function () {\n  const textures = this._textures;\n  for (const texture in textures) {\n    if (textures.hasOwnProperty(texture)) {\n      const instance = textures[texture];\n      if (instance !== this._defaultTexture) {\n        instance.destroy();\n      }\n    }\n  }\n\n  const materials = this.materials;\n  for (const material in materials) {\n    if (materials.hasOwnProperty(material)) {\n      materials[material].destroy();\n    }\n  }\n  return destroyObject(this);\n};\n\nfunction initializeMaterial(options, result) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  result._strict = defaultValue(options.strict, false);\n  result._count = defaultValue(options.count, 0);\n  result._template = clone(\n    defaultValue(options.fabric, defaultValue.EMPTY_OBJECT)\n  );\n  result._template.uniforms = clone(\n    defaultValue(result._template.uniforms, defaultValue.EMPTY_OBJECT)\n  );\n  result._template.materials = clone(\n    defaultValue(result._template.materials, defaultValue.EMPTY_OBJECT)\n  );\n\n  result.type = defined(result._template.type)\n    ? result._template.type\n    : createGuid();\n\n  result.shaderSource = \"\";\n  result.materials = {};\n  result.uniforms = {};\n  result._uniforms = {};\n  result._translucentFunctions = [];\n\n  let translucent;\n\n  // If the cache contains this material type, build the material template off of the stored template.\n  const cachedMaterial = Material._materialCache.getMaterial(result.type);\n  if (defined(cachedMaterial)) {\n    const template = clone(cachedMaterial.fabric, true);\n    result._template = combine(result._template, template, true);\n    translucent = cachedMaterial.translucent;\n  }\n\n  // Make sure the template has no obvious errors. More error checking happens later.\n  checkForTemplateErrors(result);\n\n  // If the material has a new type, add it to the cache.\n  if (!defined(cachedMaterial)) {\n    Material._materialCache.addMaterial(result.type, result);\n  }\n\n  createMethodDefinition(result);\n  createUniforms(result);\n  createSubMaterials(result);\n\n  const defaultTranslucent =\n    result._translucentFunctions.length === 0 ? true : undefined;\n  translucent = defaultValue(translucent, defaultTranslucent);\n  translucent = defaultValue(options.translucent, translucent);\n\n  if (defined(translucent)) {\n    if (typeof translucent === \"function\") {\n      const wrappedTranslucent = function () {\n        return translucent(result);\n      };\n      result._translucentFunctions.push(wrappedTranslucent);\n    } else {\n      result._translucentFunctions.push(translucent);\n    }\n  }\n}\n\nfunction checkForValidProperties(object, properties, result, throwNotFound) {\n  if (defined(object)) {\n    for (const property in object) {\n      if (object.hasOwnProperty(property)) {\n        const hasProperty = properties.indexOf(property) !== -1;\n        if (\n          (throwNotFound && !hasProperty) ||\n          (!throwNotFound && hasProperty)\n        ) {\n          result(property, properties);\n        }\n      }\n    }\n  }\n}\n\nfunction invalidNameError(property, properties) {\n  //>>includeStart('debug', pragmas.debug);\n  let errorString = `fabric: property name '${property}' is not valid. It should be `;\n  for (let i = 0; i < properties.length; i++) {\n    const propertyName = `'${properties[i]}'`;\n    errorString +=\n      i === properties.length - 1 ? `or ${propertyName}.` : `${propertyName}, `;\n  }\n  throw new DeveloperError(errorString);\n  //>>includeEnd('debug');\n}\n\nfunction duplicateNameError(property, properties) {\n  //>>includeStart('debug', pragmas.debug);\n  const errorString = `fabric: uniforms and materials cannot share the same property '${property}'`;\n  throw new DeveloperError(errorString);\n  //>>includeEnd('debug');\n}\n\nconst templateProperties = [\n  \"type\",\n  \"materials\",\n  \"uniforms\",\n  \"components\",\n  \"source\",\n];\nconst componentProperties = [\n  \"diffuse\",\n  \"specular\",\n  \"shininess\",\n  \"normal\",\n  \"emission\",\n  \"alpha\",\n];\n\nfunction checkForTemplateErrors(material) {\n  const template = material._template;\n  const uniforms = template.uniforms;\n  const materials = template.materials;\n  const components = template.components;\n\n  // Make sure source and components do not exist in the same template.\n  //>>includeStart('debug', pragmas.debug);\n  if (defined(components) && defined(template.source)) {\n    throw new DeveloperError(\n      \"fabric: cannot have source and components in the same template.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  // Make sure all template and components properties are valid.\n  checkForValidProperties(template, templateProperties, invalidNameError, true);\n  checkForValidProperties(\n    components,\n    componentProperties,\n    invalidNameError,\n    true\n  );\n\n  // Make sure uniforms and materials do not share any of the same names.\n  const materialNames = [];\n  for (const property in materials) {\n    if (materials.hasOwnProperty(property)) {\n      materialNames.push(property);\n    }\n  }\n  checkForValidProperties(uniforms, materialNames, duplicateNameError, false);\n}\n\nfunction isMaterialFused(shaderComponent, material) {\n  const materials = material._template.materials;\n  for (const subMaterialId in materials) {\n    if (materials.hasOwnProperty(subMaterialId)) {\n      if (shaderComponent.indexOf(subMaterialId) > -1) {\n        return true;\n      }\n    }\n  }\n\n  return false;\n}\n\n// Create the czm_getMaterial method body using source or components.\nfunction createMethodDefinition(material) {\n  const components = material._template.components;\n  const source = material._template.source;\n  if (defined(source)) {\n    material.shaderSource += `${source}\\n`;\n  } else {\n    material.shaderSource +=\n      \"czm_material czm_getMaterial(czm_materialInput materialInput)\\n{\\n\";\n    material.shaderSource +=\n      \"czm_material material = czm_getDefaultMaterial(materialInput);\\n\";\n    if (defined(components)) {\n      const isMultiMaterial =\n        Object.keys(material._template.materials).length > 0;\n      for (const component in components) {\n        if (components.hasOwnProperty(component)) {\n          if (component === \"diffuse\" || component === \"emission\") {\n            const isFusion =\n              isMultiMaterial &&\n              isMaterialFused(components[component], material);\n            const componentSource = isFusion\n              ? components[component]\n              : `czm_gammaCorrect(${components[component]})`;\n            material.shaderSource += `material.${component} = ${componentSource}; \\n`;\n          } else if (component === \"alpha\") {\n            material.shaderSource += `material.alpha = ${components.alpha}; \\n`;\n          } else {\n            material.shaderSource += `material.${component} = ${components[component]};\\n`;\n          }\n        }\n      }\n    }\n    material.shaderSource += \"return material;\\n}\\n\";\n  }\n}\n\nconst matrixMap = {\n  mat2: Matrix2,\n  mat3: Matrix3,\n  mat4: Matrix4,\n};\n\nconst ktx2Regex = /\\.ktx2$/i;\n\nfunction createTexture2DUpdateFunction(uniformId) {\n  let oldUniformValue;\n  return function (material, context) {\n    const uniforms = material.uniforms;\n    const uniformValue = uniforms[uniformId];\n    const uniformChanged = oldUniformValue !== uniformValue;\n    const uniformValueIsDefaultImage =\n      !defined(uniformValue) || uniformValue === Material.DefaultImageId;\n    oldUniformValue = uniformValue;\n\n    let texture = material._textures[uniformId];\n    let uniformDimensionsName;\n    let uniformDimensions;\n\n    if (uniformValue instanceof HTMLVideoElement) {\n      // HTMLVideoElement.readyState >=2 means we have enough data for the current frame.\n      // See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/readyState\n      if (uniformValue.readyState >= 2) {\n        if (uniformChanged && defined(texture)) {\n          if (texture !== context.defaultTexture) {\n            texture.destroy();\n          }\n          texture = undefined;\n        }\n\n        if (!defined(texture) || texture === context.defaultTexture) {\n          const sampler = new Sampler({\n            minificationFilter: material._minificationFilter,\n            magnificationFilter: material._magnificationFilter,\n          });\n          texture = new Texture({\n            context: context,\n            source: uniformValue,\n            sampler: sampler,\n          });\n          material._textures[uniformId] = texture;\n          return;\n        }\n\n        texture.copyFrom({\n          source: uniformValue,\n        });\n      } else if (!defined(texture)) {\n        material._textures[uniformId] = context.defaultTexture;\n      }\n      return;\n    }\n\n    if (uniformValue instanceof Texture && uniformValue !== texture) {\n      material._texturePaths[uniformId] = undefined;\n      const tmp = material._textures[uniformId];\n      if (defined(tmp) && tmp !== material._defaultTexture) {\n        tmp.destroy();\n      }\n      material._textures[uniformId] = uniformValue;\n\n      uniformDimensionsName = `${uniformId}Dimensions`;\n      if (uniforms.hasOwnProperty(uniformDimensionsName)) {\n        uniformDimensions = uniforms[uniformDimensionsName];\n        uniformDimensions.x = uniformValue._width;\n        uniformDimensions.y = uniformValue._height;\n      }\n\n      return;\n    }\n\n    if (uniformChanged && defined(texture) && uniformValueIsDefaultImage) {\n      // If the newly-assigned texture is the default texture,\n      // we don't need to wait for a new image to load before destroying\n      // the old texture.\n      if (texture !== material._defaultTexture) {\n        texture.destroy();\n      }\n      texture = undefined;\n    }\n\n    if (!defined(texture)) {\n      material._texturePaths[uniformId] = undefined;\n      texture = material._textures[uniformId] = material._defaultTexture;\n\n      uniformDimensionsName = `${uniformId}Dimensions`;\n      if (uniforms.hasOwnProperty(uniformDimensionsName)) {\n        uniformDimensions = uniforms[uniformDimensionsName];\n        uniformDimensions.x = texture._width;\n        uniformDimensions.y = texture._height;\n      }\n    }\n\n    if (uniformValueIsDefaultImage) {\n      return;\n    }\n\n    // When using the entity layer, the Resource objects get recreated on getValue because\n    //  they are clonable. That's why we check the url property for Resources\n    //  because the instances aren't the same and we keep trying to load the same\n    //  image if it fails to load.\n    const isResource = uniformValue instanceof Resource;\n    if (\n      !defined(material._texturePaths[uniformId]) ||\n      (isResource &&\n        uniformValue.url !== material._texturePaths[uniformId].url) ||\n      (!isResource && uniformValue !== material._texturePaths[uniformId])\n    ) {\n      if (typeof uniformValue === \"string\" || isResource) {\n        const resource = isResource\n          ? uniformValue\n          : Resource.createIfNeeded(uniformValue);\n\n        let promise;\n        if (ktx2Regex.test(resource.url)) {\n          promise = loadKTX2(resource.url);\n        } else {\n          promise = resource.fetchImage();\n        }\n\n        Promise.resolve(promise)\n          .then(function (image) {\n            material._loadedImages.push({\n              id: uniformId,\n              image: image,\n            });\n          })\n          .catch(function () {\n            if (defined(texture) && texture !== material._defaultTexture) {\n              texture.destroy();\n            }\n            material._textures[uniformId] = material._defaultTexture;\n          });\n      } else if (\n        uniformValue instanceof HTMLCanvasElement ||\n        uniformValue instanceof HTMLImageElement\n      ) {\n        material._loadedImages.push({\n          id: uniformId,\n          image: uniformValue,\n        });\n      }\n\n      material._texturePaths[uniformId] = uniformValue;\n    }\n  };\n}\n\nfunction createCubeMapUpdateFunction(uniformId) {\n  return function (material, context) {\n    const uniformValue = material.uniforms[uniformId];\n\n    if (uniformValue instanceof CubeMap) {\n      const tmp = material._textures[uniformId];\n      if (tmp !== material._defaultTexture) {\n        tmp.destroy();\n      }\n      material._texturePaths[uniformId] = undefined;\n      material._textures[uniformId] = uniformValue;\n      return;\n    }\n\n    if (!defined(material._textures[uniformId])) {\n      material._texturePaths[uniformId] = undefined;\n      material._textures[uniformId] = context.defaultCubeMap;\n    }\n\n    if (uniformValue === Material.DefaultCubeMapId) {\n      return;\n    }\n\n    const path =\n      uniformValue.positiveX +\n      uniformValue.negativeX +\n      uniformValue.positiveY +\n      uniformValue.negativeY +\n      uniformValue.positiveZ +\n      uniformValue.negativeZ;\n\n    if (path !== material._texturePaths[uniformId]) {\n      const promises = [\n        Resource.createIfNeeded(uniformValue.positiveX).fetchImage(),\n        Resource.createIfNeeded(uniformValue.negativeX).fetchImage(),\n        Resource.createIfNeeded(uniformValue.positiveY).fetchImage(),\n        Resource.createIfNeeded(uniformValue.negativeY).fetchImage(),\n        Resource.createIfNeeded(uniformValue.positiveZ).fetchImage(),\n        Resource.createIfNeeded(uniformValue.negativeZ).fetchImage(),\n      ];\n\n      Promise.all(promises).then(function (images) {\n        material._loadedCubeMaps.push({\n          id: uniformId,\n          images: images,\n        });\n      });\n\n      material._texturePaths[uniformId] = path;\n    }\n  };\n}\n\nfunction createUniforms(material) {\n  const uniforms = material._template.uniforms;\n  for (const uniformId in uniforms) {\n    if (uniforms.hasOwnProperty(uniformId)) {\n      createUniform(material, uniformId);\n    }\n  }\n}\n\n// Writes uniform declarations to the shader file and connects uniform values with\n// corresponding material properties through the returnUniforms function.\nfunction createUniform(material, uniformId) {\n  const strict = material._strict;\n  const materialUniforms = material._template.uniforms;\n  const uniformValue = materialUniforms[uniformId];\n  const uniformType = getUniformType(uniformValue);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(uniformType)) {\n    throw new DeveloperError(\n      `fabric: uniform '${uniformId}' has invalid type.`\n    );\n  }\n  //>>includeEnd('debug');\n\n  let replacedTokenCount;\n  if (uniformType === \"channels\") {\n    replacedTokenCount = replaceToken(material, uniformId, uniformValue, false);\n    //>>includeStart('debug', pragmas.debug);\n    if (replacedTokenCount === 0 && strict) {\n      throw new DeveloperError(\n        `strict: shader source does not use channels '${uniformId}'.`\n      );\n    }\n    //>>includeEnd('debug');\n  } else {\n    // Since webgl doesn't allow texture dimension queries in glsl, create a uniform to do it.\n    // Check if the shader source actually uses texture dimensions before creating the uniform.\n    if (uniformType === \"sampler2D\") {\n      const imageDimensionsUniformName = `${uniformId}Dimensions`;\n      if (getNumberOfTokens(material, imageDimensionsUniformName) > 0) {\n        materialUniforms[imageDimensionsUniformName] = {\n          type: \"ivec3\",\n          x: 1,\n          y: 1,\n        };\n        createUniform(material, imageDimensionsUniformName);\n      }\n    }\n\n    // Add uniform declaration to source code.\n    const uniformDeclarationRegex = new RegExp(\n      `uniform\\\\s+${uniformType}\\\\s+${uniformId}\\\\s*;`\n    );\n    if (!uniformDeclarationRegex.test(material.shaderSource)) {\n      const uniformDeclaration = `uniform ${uniformType} ${uniformId};`;\n      material.shaderSource = uniformDeclaration + material.shaderSource;\n    }\n\n    const newUniformId = `${uniformId}_${material._count++}`;\n    replacedTokenCount = replaceToken(material, uniformId, newUniformId);\n    //>>includeStart('debug', pragmas.debug);\n    if (replacedTokenCount === 1 && strict) {\n      throw new DeveloperError(\n        `strict: shader source does not use uniform '${uniformId}'.`\n      );\n    }\n    //>>includeEnd('debug');\n\n    // Set uniform value\n    material.uniforms[uniformId] = uniformValue;\n\n    if (uniformType === \"sampler2D\") {\n      material._uniforms[newUniformId] = function () {\n        return material._textures[uniformId];\n      };\n      material._updateFunctions.push(createTexture2DUpdateFunction(uniformId));\n    } else if (uniformType === \"samplerCube\") {\n      material._uniforms[newUniformId] = function () {\n        return material._textures[uniformId];\n      };\n      material._updateFunctions.push(createCubeMapUpdateFunction(uniformId));\n    } else if (uniformType.indexOf(\"mat\") !== -1) {\n      const scratchMatrix = new matrixMap[uniformType]();\n      material._uniforms[newUniformId] = function () {\n        return matrixMap[uniformType].fromColumnMajorArray(\n          material.uniforms[uniformId],\n          scratchMatrix\n        );\n      };\n    } else {\n      material._uniforms[newUniformId] = function () {\n        return material.uniforms[uniformId];\n      };\n    }\n  }\n}\n\n// Determines the uniform type based on the uniform in the template.\nfunction getUniformType(uniformValue) {\n  let uniformType = uniformValue.type;\n  if (!defined(uniformType)) {\n    const type = typeof uniformValue;\n    if (type === \"number\") {\n      uniformType = \"float\";\n    } else if (type === \"boolean\") {\n      uniformType = \"bool\";\n    } else if (\n      type === \"string\" ||\n      uniformValue instanceof Resource ||\n      uniformValue instanceof HTMLCanvasElement ||\n      uniformValue instanceof HTMLImageElement\n    ) {\n      if (/^([rgba]){1,4}$/i.test(uniformValue)) {\n        uniformType = \"channels\";\n      } else if (uniformValue === Material.DefaultCubeMapId) {\n        uniformType = \"samplerCube\";\n      } else {\n        uniformType = \"sampler2D\";\n      }\n    } else if (type === \"object\") {\n      if (Array.isArray(uniformValue)) {\n        if (\n          uniformValue.length === 4 ||\n          uniformValue.length === 9 ||\n          uniformValue.length === 16\n        ) {\n          uniformType = `mat${Math.sqrt(uniformValue.length)}`;\n        }\n      } else {\n        let numAttributes = 0;\n        for (const attribute in uniformValue) {\n          if (uniformValue.hasOwnProperty(attribute)) {\n            numAttributes += 1;\n          }\n        }\n        if (numAttributes >= 2 && numAttributes <= 4) {\n          uniformType = `vec${numAttributes}`;\n        } else if (numAttributes === 6) {\n          uniformType = \"samplerCube\";\n        }\n      }\n    }\n  }\n  return uniformType;\n}\n\n// Create all sub-materials by combining source and uniforms together.\nfunction createSubMaterials(material) {\n  const strict = material._strict;\n  const subMaterialTemplates = material._template.materials;\n  for (const subMaterialId in subMaterialTemplates) {\n    if (subMaterialTemplates.hasOwnProperty(subMaterialId)) {\n      // Construct the sub-material.\n      const subMaterial = new Material({\n        strict: strict,\n        fabric: subMaterialTemplates[subMaterialId],\n        count: material._count,\n      });\n\n      material._count = subMaterial._count;\n      material._uniforms = combine(\n        material._uniforms,\n        subMaterial._uniforms,\n        true\n      );\n      material.materials[subMaterialId] = subMaterial;\n      material._translucentFunctions = material._translucentFunctions.concat(\n        subMaterial._translucentFunctions\n      );\n\n      // Make the material's czm_getMaterial unique by appending the sub-material type.\n      const originalMethodName = \"czm_getMaterial\";\n      const newMethodName = `${originalMethodName}_${material._count++}`;\n      replaceToken(subMaterial, originalMethodName, newMethodName);\n      material.shaderSource = subMaterial.shaderSource + material.shaderSource;\n\n      // Replace each material id with an czm_getMaterial method call.\n      const materialMethodCall = `${newMethodName}(materialInput)`;\n      const tokensReplacedCount = replaceToken(\n        material,\n        subMaterialId,\n        materialMethodCall\n      );\n      //>>includeStart('debug', pragmas.debug);\n      if (tokensReplacedCount === 0 && strict) {\n        throw new DeveloperError(\n          `strict: shader source does not use material '${subMaterialId}'.`\n        );\n      }\n      //>>includeEnd('debug');\n    }\n  }\n}\n\n// Used for searching or replacing a token in a material's shader source with something else.\n// If excludePeriod is true, do not accept tokens that are preceded by periods.\n// http://stackoverflow.com/questions/641407/javascript-negative-lookbehind-equivalent\nfunction replaceToken(material, token, newToken, excludePeriod) {\n  excludePeriod = defaultValue(excludePeriod, true);\n  let count = 0;\n  const suffixChars = \"([\\\\w])?\";\n  const prefixChars = `([\\\\w${excludePeriod ? \".\" : \"\"}])?`;\n  const regExp = new RegExp(prefixChars + token + suffixChars, \"g\");\n  material.shaderSource = material.shaderSource.replace(regExp, function (\n    $0,\n    $1,\n    $2\n  ) {\n    if ($1 || $2) {\n      return $0;\n    }\n    count += 1;\n    return newToken;\n  });\n  return count;\n}\n\nfunction getNumberOfTokens(material, token, excludePeriod) {\n  return replaceToken(material, token, token, excludePeriod);\n}\n\nMaterial._materialCache = {\n  _materials: {},\n  addMaterial: function (type, materialTemplate) {\n    this._materials[type] = materialTemplate;\n  },\n  getMaterial: function (type) {\n    return this._materials[type];\n  },\n};\n\n/**\n * Gets or sets the default texture uniform value.\n * @type {string}\n */\nMaterial.DefaultImageId = \"czm_defaultImage\";\n\n/**\n * Gets or sets the default cube map texture uniform value.\n * @type {string}\n */\nMaterial.DefaultCubeMapId = \"czm_defaultCubeMap\";\n\n/**\n * Gets the name of the color material.\n * @type {string}\n * @readonly\n */\nMaterial.ColorType = \"Color\";\nMaterial._materialCache.addMaterial(Material.ColorType, {\n  fabric: {\n    type: Material.ColorType,\n    uniforms: {\n      color: new Color(1.0, 0.0, 0.0, 0.5),\n    },\n    components: {\n      diffuse: \"color.rgb\",\n      alpha: \"color.a\",\n    },\n  },\n  translucent: function (material) {\n    return material.uniforms.color.alpha < 1.0;\n  },\n});\n\n/**\n * Gets the name of the image material.\n * @type {string}\n * @readonly\n */\nMaterial.ImageType = \"Image\";\nMaterial._materialCache.addMaterial(Material.ImageType, {\n  fabric: {\n    type: Material.ImageType,\n    uniforms: {\n      image: Material.DefaultImageId,\n      repeat: new Cartesian2(1.0, 1.0),\n      color: new Color(1.0, 1.0, 1.0, 1.0),\n    },\n    components: {\n      diffuse:\n        \"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb\",\n      alpha: \"texture(image, fract(repeat * materialInput.st)).a * color.a\",\n    },\n  },\n  translucent: function (material) {\n    return material.uniforms.color.alpha < 1.0;\n  },\n});\n\n/**\n * Gets the name of the diffuce map material.\n * @type {string}\n * @readonly\n */\nMaterial.DiffuseMapType = \"DiffuseMap\";\nMaterial._materialCache.addMaterial(Material.DiffuseMapType, {\n  fabric: {\n    type: Material.DiffuseMapType,\n    uniforms: {\n      image: Material.DefaultImageId,\n      channels: \"rgb\",\n      repeat: new Cartesian2(1.0, 1.0),\n    },\n    components: {\n      diffuse: \"texture(image, fract(repeat * materialInput.st)).channels\",\n    },\n  },\n  translucent: false,\n});\n\n/**\n * Gets the name of the alpha map material.\n * @type {string}\n * @readonly\n */\nMaterial.AlphaMapType = \"AlphaMap\";\nMaterial._materialCache.addMaterial(Material.AlphaMapType, {\n  fabric: {\n    type: Material.AlphaMapType,\n    uniforms: {\n      image: Material.DefaultImageId,\n      channel: \"a\",\n      repeat: new Cartesian2(1.0, 1.0),\n    },\n    components: {\n      alpha: \"texture(image, fract(repeat * materialInput.st)).channel\",\n    },\n  },\n  translucent: true,\n});\n\n/**\n * Gets the name of the specular map material.\n * @type {string}\n * @readonly\n */\nMaterial.SpecularMapType = \"SpecularMap\";\nMaterial._materialCache.addMaterial(Material.SpecularMapType, {\n  fabric: {\n    type: Material.SpecularMapType,\n    uniforms: {\n      image: Material.DefaultImageId,\n      channel: \"r\",\n      repeat: new Cartesian2(1.0, 1.0),\n    },\n    components: {\n      specular: \"texture(image, fract(repeat * materialInput.st)).channel\",\n    },\n  },\n  translucent: false,\n});\n\n/**\n * Gets the name of the emmision map material.\n * @type {string}\n * @readonly\n */\nMaterial.EmissionMapType = \"EmissionMap\";\nMaterial._materialCache.addMaterial(Material.EmissionMapType, {\n  fabric: {\n    type: Material.EmissionMapType,\n    uniforms: {\n      image: Material.DefaultImageId,\n      channels: \"rgb\",\n      repeat: new Cartesian2(1.0, 1.0),\n    },\n    components: {\n      emission: \"texture(image, fract(repeat * materialInput.st)).channels\",\n    },\n  },\n  translucent: false,\n});\n\n/**\n * Gets the name of the bump map material.\n * @type {string}\n * @readonly\n */\nMaterial.BumpMapType = \"BumpMap\";\nMaterial._materialCache.addMaterial(Material.BumpMapType, {\n  fabric: {\n    type: Material.BumpMapType,\n    uniforms: {\n      image: Material.DefaultImageId,\n      channel: \"r\",\n      strength: 0.8,\n      repeat: new Cartesian2(1.0, 1.0),\n    },\n    source: BumpMapMaterial,\n  },\n  translucent: false,\n});\n\n/**\n * Gets the name of the normal map material.\n * @type {string}\n * @readonly\n */\nMaterial.NormalMapType = \"NormalMap\";\nMaterial._materialCache.addMaterial(Material.NormalMapType, {\n  fabric: {\n    type: Material.NormalMapType,\n    uniforms: {\n      image: Material.DefaultImageId,\n      channels: \"rgb\",\n      strength: 0.8,\n      repeat: new Cartesian2(1.0, 1.0),\n    },\n    source: NormalMapMaterial,\n  },\n  translucent: false,\n});\n\n/**\n * Gets the name of the grid material.\n * @type {string}\n * @readonly\n */\nMaterial.GridType = \"Grid\";\nMaterial._materialCache.addMaterial(Material.GridType, {\n  fabric: {\n    type: Material.GridType,\n    uniforms: {\n      color: new Color(0.0, 1.0, 0.0, 1.0),\n      cellAlpha: 0.1,\n      lineCount: new Cartesian2(8.0, 8.0),\n      lineThickness: new Cartesian2(1.0, 1.0),\n      lineOffset: new Cartesian2(0.0, 0.0),\n    },\n    source: GridMaterial,\n  },\n  translucent: function (material) {\n    const uniforms = material.uniforms;\n    return uniforms.color.alpha < 1.0 || uniforms.cellAlpha < 1.0;\n  },\n});\n\n/**\n * Gets the name of the stripe material.\n * @type {string}\n * @readonly\n */\nMaterial.StripeType = \"Stripe\";\nMaterial._materialCache.addMaterial(Material.StripeType, {\n  fabric: {\n    type: Material.StripeType,\n    uniforms: {\n      horizontal: true,\n      evenColor: new Color(1.0, 1.0, 1.0, 0.5),\n      oddColor: new Color(0.0, 0.0, 1.0, 0.5),\n      offset: 0.0,\n      repeat: 5.0,\n    },\n    source: StripeMaterial,\n  },\n  translucent: function (material) {\n    const uniforms = material.uniforms;\n    return uniforms.evenColor.alpha < 1.0 || uniforms.oddColor.alpha < 1.0;\n  },\n});\n\n/**\n * Gets the name of the checkerboard material.\n * @type {string}\n * @readonly\n */\nMaterial.CheckerboardType = \"Checkerboard\";\nMaterial._materialCache.addMaterial(Material.CheckerboardType, {\n  fabric: {\n    type: Material.CheckerboardType,\n    uniforms: {\n      lightColor: new Color(1.0, 1.0, 1.0, 0.5),\n      darkColor: new Color(0.0, 0.0, 0.0, 0.5),\n      repeat: new Cartesian2(5.0, 5.0),\n    },\n    source: CheckerboardMaterial,\n  },\n  translucent: function (material) {\n    const uniforms = material.uniforms;\n    return uniforms.lightColor.alpha < 1.0 || uniforms.darkColor.alpha < 1.0;\n  },\n});\n\n/**\n * Gets the name of the dot material.\n * @type {string}\n * @readonly\n */\nMaterial.DotType = \"Dot\";\nMaterial._materialCache.addMaterial(Material.DotType, {\n  fabric: {\n    type: Material.DotType,\n    uniforms: {\n      lightColor: new Color(1.0, 1.0, 0.0, 0.75),\n      darkColor: new Color(0.0, 1.0, 1.0, 0.75),\n      repeat: new Cartesian2(5.0, 5.0),\n    },\n    source: DotMaterial,\n  },\n  translucent: function (material) {\n    const uniforms = material.uniforms;\n    return uniforms.lightColor.alpha < 1.0 || uniforms.darkColor.alpha < 1.0;\n  },\n});\n\n/**\n * Gets the name of the water material.\n * @type {string}\n * @readonly\n */\nMaterial.WaterType = \"Water\";\nMaterial._materialCache.addMaterial(Material.WaterType, {\n  fabric: {\n    type: Material.WaterType,\n    uniforms: {\n      baseWaterColor: new Color(0.2, 0.3, 0.6, 1.0),\n      blendColor: new Color(0.0, 1.0, 0.699, 1.0),\n      specularMap: Material.DefaultImageId,\n      normalMap: Material.DefaultImageId,\n      frequency: 10.0,\n      animationSpeed: 0.01,\n      amplitude: 1.0,\n      specularIntensity: 0.5,\n      fadeFactor: 1.0,\n    },\n    source: WaterMaterial,\n  },\n  translucent: function (material) {\n    const uniforms = material.uniforms;\n    return (\n      uniforms.baseWaterColor.alpha < 1.0 || uniforms.blendColor.alpha < 1.0\n    );\n  },\n});\n\n/**\n * Gets the name of the rim lighting material.\n * @type {string}\n * @readonly\n */\nMaterial.RimLightingType = \"RimLighting\";\nMaterial._materialCache.addMaterial(Material.RimLightingType, {\n  fabric: {\n    type: Material.RimLightingType,\n    uniforms: {\n      color: new Color(1.0, 0.0, 0.0, 0.7),\n      rimColor: new Color(1.0, 1.0, 1.0, 0.4),\n      width: 0.3,\n    },\n    source: RimLightingMaterial,\n  },\n  translucent: function (material) {\n    const uniforms = material.uniforms;\n    return uniforms.color.alpha < 1.0 || uniforms.rimColor.alpha < 1.0;\n  },\n});\n\n/**\n * Gets the name of the fade material.\n * @type {string}\n * @readonly\n */\nMaterial.FadeType = \"Fade\";\nMaterial._materialCache.addMaterial(Material.FadeType, {\n  fabric: {\n    type: Material.FadeType,\n    uniforms: {\n      fadeInColor: new Color(1.0, 0.0, 0.0, 1.0),\n      fadeOutColor: new Color(0.0, 0.0, 0.0, 0.0),\n      maximumDistance: 0.5,\n      repeat: true,\n      fadeDirection: {\n        x: true,\n        y: true,\n      },\n      time: new Cartesian2(0.5, 0.5),\n    },\n    source: FadeMaterial,\n  },\n  translucent: function (material) {\n    const uniforms = material.uniforms;\n    return (\n      uniforms.fadeInColor.alpha < 1.0 || uniforms.fadeOutColor.alpha < 1.0\n    );\n  },\n});\n\n/**\n * Gets the name of the polyline arrow material.\n * @type {string}\n * @readonly\n */\nMaterial.PolylineArrowType = \"PolylineArrow\";\nMaterial._materialCache.addMaterial(Material.PolylineArrowType, {\n  fabric: {\n    type: Material.PolylineArrowType,\n    uniforms: {\n      color: new Color(1.0, 1.0, 1.0, 1.0),\n    },\n    source: PolylineArrowMaterial,\n  },\n  translucent: true,\n});\n\n/**\n * Gets the name of the polyline glow material.\n * @type {string}\n * @readonly\n */\nMaterial.PolylineDashType = \"PolylineDash\";\nMaterial._materialCache.addMaterial(Material.PolylineDashType, {\n  fabric: {\n    type: Material.PolylineDashType,\n    uniforms: {\n      color: new Color(1.0, 0.0, 1.0, 1.0),\n      gapColor: new Color(0.0, 0.0, 0.0, 0.0),\n      dashLength: 16.0,\n      dashPattern: 255.0,\n    },\n    source: PolylineDashMaterial,\n  },\n  translucent: true,\n});\n\n/**\n * Gets the name of the polyline glow material.\n * @type {string}\n * @readonly\n */\nMaterial.PolylineGlowType = \"PolylineGlow\";\nMaterial._materialCache.addMaterial(Material.PolylineGlowType, {\n  fabric: {\n    type: Material.PolylineGlowType,\n    uniforms: {\n      color: new Color(0.0, 0.5, 1.0, 1.0),\n      glowPower: 0.25,\n      taperPower: 1.0,\n    },\n    source: PolylineGlowMaterial,\n  },\n  translucent: true,\n});\n\n/**\n * Gets the name of the polyline outline material.\n * @type {string}\n * @readonly\n */\nMaterial.PolylineOutlineType = \"PolylineOutline\";\nMaterial._materialCache.addMaterial(Material.PolylineOutlineType, {\n  fabric: {\n    type: Material.PolylineOutlineType,\n    uniforms: {\n      color: new Color(1.0, 1.0, 1.0, 1.0),\n      outlineColor: new Color(1.0, 0.0, 0.0, 1.0),\n      outlineWidth: 1.0,\n    },\n    source: PolylineOutlineMaterial,\n  },\n  translucent: function (material) {\n    const uniforms = material.uniforms;\n    return uniforms.color.alpha < 1.0 || uniforms.outlineColor.alpha < 1.0;\n  },\n});\n\n/**\n * Gets the name of the elevation contour material.\n * @type {string}\n * @readonly\n */\nMaterial.ElevationContourType = \"ElevationContour\";\nMaterial._materialCache.addMaterial(Material.ElevationContourType, {\n  fabric: {\n    type: Material.ElevationContourType,\n    uniforms: {\n      spacing: 100.0,\n      color: new Color(1.0, 0.0, 0.0, 1.0),\n      width: 1.0,\n    },\n    source: ElevationContourMaterial,\n  },\n  translucent: false,\n});\n\n/**\n * Gets the name of the elevation contour material.\n * @type {string}\n * @readonly\n */\nMaterial.ElevationRampType = \"ElevationRamp\";\nMaterial._materialCache.addMaterial(Material.ElevationRampType, {\n  fabric: {\n    type: Material.ElevationRampType,\n    uniforms: {\n      image: Material.DefaultImageId,\n      minimumHeight: 0.0,\n      maximumHeight: 10000.0,\n    },\n    source: ElevationRampMaterial,\n  },\n  translucent: false,\n});\n\n/**\n * Gets the name of the slope ramp material.\n * @type {string}\n * @readonly\n */\nMaterial.SlopeRampMaterialType = \"SlopeRamp\";\nMaterial._materialCache.addMaterial(Material.SlopeRampMaterialType, {\n  fabric: {\n    type: Material.SlopeRampMaterialType,\n    uniforms: {\n      image: Material.DefaultImageId,\n    },\n    source: SlopeRampMaterial,\n  },\n  translucent: false,\n});\n\n/**\n * Gets the name of the aspect ramp material.\n * @type {string}\n * @readonly\n */\nMaterial.AspectRampMaterialType = \"AspectRamp\";\nMaterial._materialCache.addMaterial(Material.AspectRampMaterialType, {\n  fabric: {\n    type: Material.AspectRampMaterialType,\n    uniforms: {\n      image: Material.DefaultImageId,\n    },\n    source: AspectRampMaterial,\n  },\n  translucent: false,\n});\n\n/**\n * Gets the name of the elevation band material.\n * @type {string}\n * @readonly\n */\nMaterial.ElevationBandType = \"ElevationBand\";\nMaterial._materialCache.addMaterial(Material.ElevationBandType, {\n  fabric: {\n    type: Material.ElevationBandType,\n    uniforms: {\n      heights: Material.DefaultImageId,\n      colors: Material.DefaultImageId,\n    },\n    source: ElevationBandMaterial,\n  },\n  translucent: true,\n});\n\nexport default Material;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport AllMaterialAppearanceFS from \"../Shaders/Appearances/AllMaterialAppearanceFS.js\";\nimport AllMaterialAppearanceVS from \"../Shaders/Appearances/AllMaterialAppearanceVS.js\";\nimport BasicMaterialAppearanceFS from \"../Shaders/Appearances/BasicMaterialAppearanceFS.js\";\nimport BasicMaterialAppearanceVS from \"../Shaders/Appearances/BasicMaterialAppearanceVS.js\";\nimport TexturedMaterialAppearanceFS from \"../Shaders/Appearances/TexturedMaterialAppearanceFS.js\";\nimport TexturedMaterialAppearanceVS from \"../Shaders/Appearances/TexturedMaterialAppearanceVS.js\";\nimport Appearance from \"./Appearance.js\";\nimport Material from \"./Material.js\";\n\n/**\n     * An appearance for arbitrary geometry (as opposed to {@link EllipsoidSurfaceAppearance}, for example)\n     * that supports shading with materials.\n     *\n     * @alias MaterialAppearance\n     * @constructor\n     *\n     * @param {object} [options] Object with the following properties:\n     * @param {boolean} [options.flat=false] When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.\n     * @param {boolean} [options.faceForward=!options.closed] When <code>true</code>, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots.  This is useful when both sides of a geometry should be shaded like {@link WallGeometry}.\n     * @param {boolean} [options.translucent=true] When <code>true</code>, the geometry is expected to appear translucent so {@link MaterialAppearance#renderState} has alpha blending enabled.\n     * @param {boolean} [options.closed=false] When <code>true</code>, the geometry is expected to be closed so {@link MaterialAppearance#renderState} has backface culling enabled.\n     * @param {MaterialAppearance.MaterialSupportType} [options.materialSupport=MaterialAppearance.MaterialSupport.TEXTURED] The type of materials that will be supported.\n     * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color.\n     * @param {string} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.\n     * @param {string} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.\n     * @param {object} [options.renderState] Optional render state to override the default render state.\n     *\n     * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n     * @demo {@link https://sandcastle.cesium.com/index.html?src=Materials.html|Cesium Sandcastle Material Appearance Demo}\n     *\n     * @example\n     * const primitive = new Cesium.Primitive({\n     *   geometryInstances : new Cesium.GeometryInstance({\n     *     geometry : new Cesium.WallGeometry({\n            materialSupport :  Cesium.MaterialAppearance.MaterialSupport.BASIC.vertexFormat,\n     *       // ...\n     *     })\n     *   }),\n     *   appearance : new Cesium.MaterialAppearance({\n     *     material : Cesium.Material.fromType('Color'),\n     *     faceForward : true\n     *   })\n     *\n     * });\n     */\nfunction MaterialAppearance(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const translucent = defaultValue(options.translucent, true);\n  const closed = defaultValue(options.closed, false);\n  const materialSupport = defaultValue(\n    options.materialSupport,\n    MaterialAppearance.MaterialSupport.TEXTURED\n  );\n\n  /**\n   * The material used to determine the fragment color.  Unlike other {@link MaterialAppearance}\n   * properties, this is not read-only, so an appearance's material can change on the fly.\n   *\n   * @type Material\n   *\n   * @default {@link Material.ColorType}\n   *\n   * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n   */\n  this.material = defined(options.material)\n    ? options.material\n    : Material.fromType(Material.ColorType);\n\n  /**\n   * When <code>true</code>, the geometry is expected to appear translucent.\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  this.translucent = translucent;\n\n  this._vertexShaderSource = defaultValue(\n    options.vertexShaderSource,\n    materialSupport.vertexShaderSource\n  );\n  this._fragmentShaderSource = defaultValue(\n    options.fragmentShaderSource,\n    materialSupport.fragmentShaderSource\n  );\n  this._renderState = Appearance.getDefaultRenderState(\n    translucent,\n    closed,\n    options.renderState\n  );\n  this._closed = closed;\n\n  // Non-derived members\n\n  this._materialSupport = materialSupport;\n  this._vertexFormat = materialSupport.vertexFormat;\n  this._flat = defaultValue(options.flat, false);\n  this._faceForward = defaultValue(options.faceForward, !closed);\n}\n\nObject.defineProperties(MaterialAppearance.prototype, {\n  /**\n   * The GLSL source code for the vertex shader.\n   *\n   * @memberof MaterialAppearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  vertexShaderSource: {\n    get: function () {\n      return this._vertexShaderSource;\n    },\n  },\n\n  /**\n   * The GLSL source code for the fragment shader.  The full fragment shader\n   * source is built procedurally taking into account {@link MaterialAppearance#material},\n   * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.\n   * Use {@link MaterialAppearance#getFragmentShaderSource} to get the full source.\n   *\n   * @memberof MaterialAppearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  fragmentShaderSource: {\n    get: function () {\n      return this._fragmentShaderSource;\n    },\n  },\n\n  /**\n   * The WebGL fixed-function state to use when rendering the geometry.\n   * <p>\n   * The render state can be explicitly defined when constructing a {@link MaterialAppearance}\n   * instance, or it is set implicitly via {@link MaterialAppearance#translucent}\n   * and {@link MaterialAppearance#closed}.\n   * </p>\n   *\n   * @memberof MaterialAppearance.prototype\n   *\n   * @type {object}\n   * @readonly\n   */\n  renderState: {\n    get: function () {\n      return this._renderState;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the geometry is expected to be closed so\n   * {@link MaterialAppearance#renderState} has backface culling enabled.\n   * If the viewer enters the geometry, it will not be visible.\n   *\n   * @memberof MaterialAppearance.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  closed: {\n    get: function () {\n      return this._closed;\n    },\n  },\n\n  /**\n   * The type of materials supported by this instance.  This impacts the required\n   * {@link VertexFormat} and the complexity of the vertex and fragment shaders.\n   *\n   * @memberof MaterialAppearance.prototype\n   *\n   * @type {MaterialAppearance.MaterialSupportType}\n   * @readonly\n   *\n   * @default {@link MaterialAppearance.MaterialSupport.TEXTURED}\n   */\n  materialSupport: {\n    get: function () {\n      return this._materialSupport;\n    },\n  },\n\n  /**\n   * The {@link VertexFormat} that this appearance instance is compatible with.\n   * A geometry can have more vertex attributes and still be compatible - at a\n   * potential performance cost - but it can't have less.\n   *\n   * @memberof MaterialAppearance.prototype\n   *\n   * @type VertexFormat\n   * @readonly\n   *\n   * @default {@link MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}\n   */\n  vertexFormat: {\n    get: function () {\n      return this._vertexFormat;\n    },\n  },\n\n  /**\n   * When <code>true</code>, flat shading is used in the fragment shader,\n   * which means lighting is not taking into account.\n   *\n   * @memberof MaterialAppearance.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  flat: {\n    get: function () {\n      return this._flat;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the fragment shader flips the surface normal\n   * as needed to ensure that the normal faces the viewer to avoid\n   * dark spots.  This is useful when both sides of a geometry should be\n   * shaded like {@link WallGeometry}.\n   *\n   * @memberof MaterialAppearance.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  faceForward: {\n    get: function () {\n      return this._faceForward;\n    },\n  },\n});\n\n/**\n * Procedurally creates the full GLSL fragment shader source.  For {@link MaterialAppearance},\n * this is derived from {@link MaterialAppearance#fragmentShaderSource}, {@link MaterialAppearance#material},\n * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.\n *\n * @function\n *\n * @returns {string} The full GLSL fragment shader source.\n */\nMaterialAppearance.prototype.getFragmentShaderSource =\n  Appearance.prototype.getFragmentShaderSource;\n\n/**\n * Determines if the geometry is translucent based on {@link MaterialAppearance#translucent} and {@link Material#isTranslucent}.\n *\n * @function\n *\n * @returns {boolean} <code>true</code> if the appearance is translucent.\n */\nMaterialAppearance.prototype.isTranslucent = Appearance.prototype.isTranslucent;\n\n/**\n * Creates a render state.  This is not the final render state instance; instead,\n * it can contain a subset of render state properties identical to the render state\n * created in the context.\n *\n * @function\n *\n * @returns {object} The render state.\n */\nMaterialAppearance.prototype.getRenderState =\n  Appearance.prototype.getRenderState;\n\n/**\n * @typedef MaterialAppearance.MaterialSupportType\n * @type {object}\n * @property {VertexFormat} vertexFormat\n * @property {string} vertexShaderSource\n * @property {string} fragmentShaderSource\n */\n\n/**\n * Determines the type of {@link Material} that is supported by a\n * {@link MaterialAppearance} instance.  This is a trade-off between\n * flexibility (a wide array of materials) and memory/performance\n * (required vertex format and GLSL shader complexity.\n * @namespace\n */\nMaterialAppearance.MaterialSupport = {\n  /**\n   * Only basic materials, which require just <code>position</code> and\n   * <code>normal</code> vertex attributes, are supported.\n   *\n   * @type {MaterialAppearance.MaterialSupportType}\n   * @constant\n   */\n  BASIC: Object.freeze({\n    vertexFormat: VertexFormat.POSITION_AND_NORMAL,\n    vertexShaderSource: BasicMaterialAppearanceVS,\n    fragmentShaderSource: BasicMaterialAppearanceFS,\n  }),\n  /**\n   * Materials with textures, which require <code>position</code>,\n   * <code>normal</code>, and <code>st</code> vertex attributes,\n   * are supported.  The vast majority of materials fall into this category.\n   *\n   * @type {MaterialAppearance.MaterialSupportType}\n   * @constant\n   */\n  TEXTURED: Object.freeze({\n    vertexFormat: VertexFormat.POSITION_NORMAL_AND_ST,\n    vertexShaderSource: TexturedMaterialAppearanceVS,\n    fragmentShaderSource: TexturedMaterialAppearanceFS,\n  }),\n  /**\n   * All materials, including those that work in tangent space, are supported.\n   * This requires <code>position</code>, <code>normal</code>, <code>st</code>,\n   * <code>tangent</code>, and <code>bitangent</code> vertex attributes.\n   *\n   * @type {MaterialAppearance.MaterialSupportType}\n   * @constant\n   */\n  ALL: Object.freeze({\n    vertexFormat: VertexFormat.ALL,\n    vertexShaderSource: AllMaterialAppearanceVS,\n    fragmentShaderSource: AllMaterialAppearanceFS,\n  }),\n};\nexport default MaterialAppearance;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 v_positionEC;\\n\\\nin vec3 v_normalEC;\\n\\\nin vec4 v_color;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec3 positionToEyeEC = -v_positionEC;\\n\\\n\\n\\\n    vec3 normalEC = normalize(v_normalEC);\\n\\\n#ifdef FACE_FORWARD\\n\\\n    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\\n\\\n#endif\\n\\\n\\n\\\n    vec4 color = czm_gammaCorrect(v_color);\\n\\\n\\n\\\n    czm_materialInput materialInput;\\n\\\n    materialInput.normalEC = normalEC;\\n\\\n    materialInput.positionToEyeEC = positionToEyeEC;\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n    material.diffuse = color.rgb;\\n\\\n    material.alpha = color.a;\\n\\\n\\n\\\n    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 position3DHigh;\\n\\\nin vec3 position3DLow;\\n\\\nin vec3 normal;\\n\\\nin vec4 color;\\n\\\nin float batchId;\\n\\\n\\n\\\nout vec3 v_positionEC;\\n\\\nout vec3 v_normalEC;\\n\\\nout vec4 v_color;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 p = czm_computePosition();\\n\\\n\\n\\\n    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates\\n\\\n    v_normalEC = czm_normal * normal;                         // normal in eye coordinates\\n\\\n    v_color = color;\\n\\\n\\n\\\n    gl_Position = czm_modelViewProjectionRelativeToEye * p;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec4 v_color;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    out_FragColor = czm_gammaCorrect(v_color);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 position3DHigh;\\n\\\nin vec3 position3DLow;\\n\\\nin vec4 color;\\n\\\nin float batchId;\\n\\\n\\n\\\nout vec4 v_color;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 p = czm_computePosition();\\n\\\n\\n\\\n    v_color = color;\\n\\\n\\n\\\n    gl_Position = czm_modelViewProjectionRelativeToEye * p;\\n\\\n}\\n\\\n\";\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport PerInstanceColorAppearanceFS from \"../Shaders/Appearances/PerInstanceColorAppearanceFS.js\";\nimport PerInstanceColorAppearanceVS from \"../Shaders/Appearances/PerInstanceColorAppearanceVS.js\";\nimport PerInstanceFlatColorAppearanceFS from \"../Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js\";\nimport PerInstanceFlatColorAppearanceVS from \"../Shaders/Appearances/PerInstanceFlatColorAppearanceVS.js\";\nimport Appearance from \"./Appearance.js\";\n\n/**\n * An appearance for {@link GeometryInstance} instances with color attributes.\n * This allows several geometry instances, each with a different color, to\n * be drawn with the same {@link Primitive} as shown in the second example below.\n *\n * @alias PerInstanceColorAppearance\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {boolean} [options.flat=false] When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.\n * @param {boolean} [options.faceForward=!options.closed] When <code>true</code>, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots.  This is useful when both sides of a geometry should be shaded like {@link WallGeometry}.\n * @param {boolean} [options.translucent=true] When <code>true</code>, the geometry is expected to appear translucent so {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.\n * @param {boolean} [options.closed=false] When <code>true</code>, the geometry is expected to be closed so {@link PerInstanceColorAppearance#renderState} has backface culling enabled.\n * @param {string} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.\n * @param {string} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.\n * @param {object} [options.renderState] Optional render state to override the default render state.\n *\n * @example\n * // A solid white line segment\n * const primitive = new Cesium.Primitive({\n *   geometryInstances : new Cesium.GeometryInstance({\n *     geometry : new Cesium.SimplePolylineGeometry({\n *       positions : Cesium.Cartesian3.fromDegreesArray([\n *         0.0, 0.0,\n *         5.0, 0.0\n *       ])\n *     }),\n *     attributes : {\n *       color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))\n *     }\n *   }),\n *   appearance : new Cesium.PerInstanceColorAppearance({\n *     flat : true,\n *     translucent : false\n *   })\n * });\n *\n * // Two rectangles in a primitive, each with a different color\n * const instance = new Cesium.GeometryInstance({\n *   geometry : new Cesium.RectangleGeometry({\n *     rectangle : Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0)\n *   }),\n *   attributes : {\n *     color : new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 0.5)\n *   }\n * });\n *\n * const anotherInstance = new Cesium.GeometryInstance({\n *   geometry : new Cesium.RectangleGeometry({\n *     rectangle : Cesium.Rectangle.fromDegrees(0.0, 40.0, 10.0, 50.0)\n *   }),\n *   attributes : {\n *     color : new Cesium.ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 0.5)\n *   }\n * });\n *\n * const rectanglePrimitive = new Cesium.Primitive({\n *   geometryInstances : [instance, anotherInstance],\n *   appearance : new Cesium.PerInstanceColorAppearance()\n * });\n */\nfunction PerInstanceColorAppearance(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const translucent = defaultValue(options.translucent, true);\n  const closed = defaultValue(options.closed, false);\n  const flat = defaultValue(options.flat, false);\n  const vs = flat\n    ? PerInstanceFlatColorAppearanceVS\n    : PerInstanceColorAppearanceVS;\n  const fs = flat\n    ? PerInstanceFlatColorAppearanceFS\n    : PerInstanceColorAppearanceFS;\n  const vertexFormat = flat\n    ? PerInstanceColorAppearance.FLAT_VERTEX_FORMAT\n    : PerInstanceColorAppearance.VERTEX_FORMAT;\n\n  /**\n   * This property is part of the {@link Appearance} interface, but is not\n   * used by {@link PerInstanceColorAppearance} since a fully custom fragment shader is used.\n   *\n   * @type Material\n   *\n   * @default undefined\n   */\n  this.material = undefined;\n\n  /**\n   * When <code>true</code>, the geometry is expected to appear translucent so\n   * {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  this.translucent = translucent;\n\n  this._vertexShaderSource = defaultValue(options.vertexShaderSource, vs);\n  this._fragmentShaderSource = defaultValue(options.fragmentShaderSource, fs);\n  this._renderState = Appearance.getDefaultRenderState(\n    translucent,\n    closed,\n    options.renderState\n  );\n  this._closed = closed;\n\n  // Non-derived members\n\n  this._vertexFormat = vertexFormat;\n  this._flat = flat;\n  this._faceForward = defaultValue(options.faceForward, !closed);\n}\n\nObject.defineProperties(PerInstanceColorAppearance.prototype, {\n  /**\n   * The GLSL source code for the vertex shader.\n   *\n   * @memberof PerInstanceColorAppearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  vertexShaderSource: {\n    get: function () {\n      return this._vertexShaderSource;\n    },\n  },\n\n  /**\n   * The GLSL source code for the fragment shader.\n   *\n   * @memberof PerInstanceColorAppearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  fragmentShaderSource: {\n    get: function () {\n      return this._fragmentShaderSource;\n    },\n  },\n\n  /**\n   * The WebGL fixed-function state to use when rendering the geometry.\n   * <p>\n   * The render state can be explicitly defined when constructing a {@link PerInstanceColorAppearance}\n   * instance, or it is set implicitly via {@link PerInstanceColorAppearance#translucent}\n   * and {@link PerInstanceColorAppearance#closed}.\n   * </p>\n   *\n   * @memberof PerInstanceColorAppearance.prototype\n   *\n   * @type {object}\n   * @readonly\n   */\n  renderState: {\n    get: function () {\n      return this._renderState;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the geometry is expected to be closed so\n   * {@link PerInstanceColorAppearance#renderState} has backface culling enabled.\n   * If the viewer enters the geometry, it will not be visible.\n   *\n   * @memberof PerInstanceColorAppearance.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  closed: {\n    get: function () {\n      return this._closed;\n    },\n  },\n\n  /**\n   * The {@link VertexFormat} that this appearance instance is compatible with.\n   * A geometry can have more vertex attributes and still be compatible - at a\n   * potential performance cost - but it can't have less.\n   *\n   * @memberof PerInstanceColorAppearance.prototype\n   *\n   * @type VertexFormat\n   * @readonly\n   */\n  vertexFormat: {\n    get: function () {\n      return this._vertexFormat;\n    },\n  },\n\n  /**\n   * When <code>true</code>, flat shading is used in the fragment shader,\n   * which means lighting is not taking into account.\n   *\n   * @memberof PerInstanceColorAppearance.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  flat: {\n    get: function () {\n      return this._flat;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the fragment shader flips the surface normal\n   * as needed to ensure that the normal faces the viewer to avoid\n   * dark spots.  This is useful when both sides of a geometry should be\n   * shaded like {@link WallGeometry}.\n   *\n   * @memberof PerInstanceColorAppearance.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  faceForward: {\n    get: function () {\n      return this._faceForward;\n    },\n  },\n});\n\n/**\n * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances\n * are compatible with.  This requires only <code>position</code> and <code>normal</code>\n * attributes.\n *\n * @type VertexFormat\n *\n * @constant\n */\nPerInstanceColorAppearance.VERTEX_FORMAT = VertexFormat.POSITION_AND_NORMAL;\n\n/**\n * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances\n * are compatible with when {@link PerInstanceColorAppearance#flat} is <code>true</code>.\n * This requires only a <code>position</code> attribute.\n *\n * @type VertexFormat\n *\n * @constant\n */\nPerInstanceColorAppearance.FLAT_VERTEX_FORMAT = VertexFormat.POSITION_ONLY;\n\n/**\n * Procedurally creates the full GLSL fragment shader source.  For {@link PerInstanceColorAppearance},\n * this is derived from {@link PerInstanceColorAppearance#fragmentShaderSource}, {@link PerInstanceColorAppearance#flat},\n * and {@link PerInstanceColorAppearance#faceForward}.\n *\n * @function\n *\n * @returns {string} The full GLSL fragment shader source.\n */\nPerInstanceColorAppearance.prototype.getFragmentShaderSource =\n  Appearance.prototype.getFragmentShaderSource;\n\n/**\n * Determines if the geometry is translucent based on {@link PerInstanceColorAppearance#translucent}.\n *\n * @function\n *\n * @returns {boolean} <code>true</code> if the appearance is translucent.\n */\nPerInstanceColorAppearance.prototype.isTranslucent =\n  Appearance.prototype.isTranslucent;\n\n/**\n * Creates a render state.  This is not the final render state instance; instead,\n * it can contain a subset of render state properties identical to the render state\n * created in the context.\n *\n * @function\n *\n * @returns {object} The render state.\n */\nPerInstanceColorAppearance.prototype.getRenderState =\n  Appearance.prototype.getRenderState;\nexport default PerInstanceColorAppearance;\n", "import Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link MaterialProperty} that maps to solid color {@link Material} uniforms.\n *\n * @param {Property|Color} [color=Color.WHITE] The {@link Color} Property to be used.\n *\n * @alias ColorMaterialProperty\n * @constructor\n */\nfunction ColorMaterialProperty(color) {\n  this._definitionChanged = new Event();\n  this._color = undefined;\n  this._colorSubscription = undefined;\n\n  this.color = color;\n}\n\nObject.defineProperties(ColorMaterialProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof ColorMaterialProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return Property.isConstant(this._color);\n    },\n  },\n\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof ColorMaterialProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the {@link Color} {@link Property}.\n   * @memberof ColorMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default Color.WHITE\n   */\n  color: createPropertyDescriptor(\"color\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {string} The type of material.\n */\nColorMaterialProperty.prototype.getType = function (time) {\n  return \"Color\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nColorMaterialProperty.prototype.getValue = function (time, result) {\n  if (!defined(result)) {\n    result = {};\n  }\n  result.color = Property.getValueOrClonedDefault(\n    this._color,\n    time,\n    Color.WHITE,\n    result.color\n  );\n  return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nColorMaterialProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof ColorMaterialProperty && //\n      Property.equals(this._color, other._color))\n  );\n};\nexport default ColorMaterialProperty;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport CesiumMath from \"./Math.js\";\nimport Rectangle from \"./Rectangle.js\";\n\n/**\n * A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where\n * longitude and latitude are directly mapped to X and Y.  This projection is commonly\n * known as geographic, equirectangular, equidistant cylindrical, or plate carr\u00E9e.\n *\n * @alias GeographicTilingScheme\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid whose surface is being tiled. Defaults to\n * the WGS84 ellipsoid.\n * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the tiling scheme.\n * @param {number} [options.numberOfLevelZeroTilesX=2] The number of tiles in the X direction at level zero of\n * the tile tree.\n * @param {number} [options.numberOfLevelZeroTilesY=1] The number of tiles in the Y direction at level zero of\n * the tile tree.\n */\nfunction GeographicTilingScheme(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  this._rectangle = defaultValue(options.rectangle, Rectangle.MAX_VALUE);\n  this._projection = new GeographicProjection(this._ellipsoid);\n  this._numberOfLevelZeroTilesX = defaultValue(\n    options.numberOfLevelZeroTilesX,\n    2\n  );\n  this._numberOfLevelZeroTilesY = defaultValue(\n    options.numberOfLevelZeroTilesY,\n    1\n  );\n}\n\nObject.defineProperties(GeographicTilingScheme.prototype, {\n  /**\n   * Gets the ellipsoid that is tiled by this tiling scheme.\n   * @memberof GeographicTilingScheme.prototype\n   * @type {Ellipsoid}\n   */\n  ellipsoid: {\n    get: function () {\n      return this._ellipsoid;\n    },\n  },\n\n  /**\n   * Gets the rectangle, in radians, covered by this tiling scheme.\n   * @memberof GeographicTilingScheme.prototype\n   * @type {Rectangle}\n   */\n  rectangle: {\n    get: function () {\n      return this._rectangle;\n    },\n  },\n\n  /**\n   * Gets the map projection used by this tiling scheme.\n   * @memberof GeographicTilingScheme.prototype\n   * @type {MapProjection}\n   */\n  projection: {\n    get: function () {\n      return this._projection;\n    },\n  },\n});\n\n/**\n * Gets the total number of tiles in the X direction at a specified level-of-detail.\n *\n * @param {number} level The level-of-detail.\n * @returns {number} The number of tiles in the X direction at the given level.\n */\nGeographicTilingScheme.prototype.getNumberOfXTilesAtLevel = function (level) {\n  return this._numberOfLevelZeroTilesX << level;\n};\n\n/**\n * Gets the total number of tiles in the Y direction at a specified level-of-detail.\n *\n * @param {number} level The level-of-detail.\n * @returns {number} The number of tiles in the Y direction at the given level.\n */\nGeographicTilingScheme.prototype.getNumberOfYTilesAtLevel = function (level) {\n  return this._numberOfLevelZeroTilesY << level;\n};\n\n/**\n * Transforms a rectangle specified in geodetic radians to the native coordinate system\n * of this tiling scheme.\n *\n * @param {Rectangle} rectangle The rectangle to transform.\n * @param {Rectangle} [result] The instance to which to copy the result, or undefined if a new instance\n *        should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the native rectangle if 'result'\n *          is undefined.\n */\nGeographicTilingScheme.prototype.rectangleToNativeRectangle = function (\n  rectangle,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"rectangle\", rectangle);\n  //>>includeEnd('debug');\n\n  const west = CesiumMath.toDegrees(rectangle.west);\n  const south = CesiumMath.toDegrees(rectangle.south);\n  const east = CesiumMath.toDegrees(rectangle.east);\n  const north = CesiumMath.toDegrees(rectangle.north);\n\n  if (!defined(result)) {\n    return new Rectangle(west, south, east, north);\n  }\n\n  result.west = west;\n  result.south = south;\n  result.east = east;\n  result.north = north;\n  return result;\n};\n\n/**\n * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates\n * of the tiling scheme.\n *\n * @param {number} x The integer x coordinate of the tile.\n * @param {number} y The integer y coordinate of the tile.\n * @param {number} level The tile level-of-detail.  Zero is the least detailed.\n * @param {object} [result] The instance to which to copy the result, or undefined if a new instance\n *        should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the rectangle\n *          if 'result' is undefined.\n */\nGeographicTilingScheme.prototype.tileXYToNativeRectangle = function (\n  x,\n  y,\n  level,\n  result\n) {\n  const rectangleRadians = this.tileXYToRectangle(x, y, level, result);\n  rectangleRadians.west = CesiumMath.toDegrees(rectangleRadians.west);\n  rectangleRadians.south = CesiumMath.toDegrees(rectangleRadians.south);\n  rectangleRadians.east = CesiumMath.toDegrees(rectangleRadians.east);\n  rectangleRadians.north = CesiumMath.toDegrees(rectangleRadians.north);\n  return rectangleRadians;\n};\n\n/**\n * Converts tile x, y coordinates and level to a cartographic rectangle in radians.\n *\n * @param {number} x The integer x coordinate of the tile.\n * @param {number} y The integer y coordinate of the tile.\n * @param {number} level The tile level-of-detail.  Zero is the least detailed.\n * @param {object} [result] The instance to which to copy the result, or undefined if a new instance\n *        should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the rectangle\n *          if 'result' is undefined.\n */\nGeographicTilingScheme.prototype.tileXYToRectangle = function (\n  x,\n  y,\n  level,\n  result\n) {\n  const rectangle = this._rectangle;\n\n  const xTiles = this.getNumberOfXTilesAtLevel(level);\n  const yTiles = this.getNumberOfYTilesAtLevel(level);\n\n  const xTileWidth = rectangle.width / xTiles;\n  const west = x * xTileWidth + rectangle.west;\n  const east = (x + 1) * xTileWidth + rectangle.west;\n\n  const yTileHeight = rectangle.height / yTiles;\n  const north = rectangle.north - y * yTileHeight;\n  const south = rectangle.north - (y + 1) * yTileHeight;\n\n  if (!defined(result)) {\n    result = new Rectangle(west, south, east, north);\n  }\n\n  result.west = west;\n  result.south = south;\n  result.east = east;\n  result.north = north;\n  return result;\n};\n\n/**\n * Calculates the tile x, y coordinates of the tile containing\n * a given cartographic position.\n *\n * @param {Cartographic} position The position.\n * @param {number} level The tile level-of-detail.  Zero is the least detailed.\n * @param {Cartesian2} [result] The instance to which to copy the result, or undefined if a new instance\n *        should be created.\n * @returns {Cartesian2} The specified 'result', or a new object containing the tile x, y coordinates\n *          if 'result' is undefined.\n */\nGeographicTilingScheme.prototype.positionToTileXY = function (\n  position,\n  level,\n  result\n) {\n  const rectangle = this._rectangle;\n  if (!Rectangle.contains(rectangle, position)) {\n    // outside the bounds of the tiling scheme\n    return undefined;\n  }\n\n  const xTiles = this.getNumberOfXTilesAtLevel(level);\n  const yTiles = this.getNumberOfYTilesAtLevel(level);\n\n  const xTileWidth = rectangle.width / xTiles;\n  const yTileHeight = rectangle.height / yTiles;\n\n  let longitude = position.longitude;\n  if (rectangle.east < rectangle.west) {\n    longitude += CesiumMath.TWO_PI;\n  }\n\n  let xTileCoordinate = ((longitude - rectangle.west) / xTileWidth) | 0;\n  if (xTileCoordinate >= xTiles) {\n    xTileCoordinate = xTiles - 1;\n  }\n\n  let yTileCoordinate =\n    ((rectangle.north - position.latitude) / yTileHeight) | 0;\n  if (yTileCoordinate >= yTiles) {\n    yTileCoordinate = yTiles - 1;\n  }\n\n  if (!defined(result)) {\n    return new Cartesian2(xTileCoordinate, yTileCoordinate);\n  }\n\n  result.x = xTileCoordinate;\n  result.y = yTileCoordinate;\n  return result;\n};\nexport default GeographicTilingScheme;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport buildModuleUrl from \"./buildModuleUrl.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport GeographicTilingScheme from \"./GeographicTilingScheme.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Resource from \"./Resource.js\";\n\nconst scratchDiagonalCartesianNE = new Cartesian3();\nconst scratchDiagonalCartesianSW = new Cartesian3();\nconst scratchDiagonalCartographic = new Cartographic();\nconst scratchCenterCartesian = new Cartesian3();\nconst scratchSurfaceCartesian = new Cartesian3();\n\nconst scratchBoundingSphere = new BoundingSphere();\nconst tilingScheme = new GeographicTilingScheme();\nconst scratchCorners = [\n  new Cartographic(),\n  new Cartographic(),\n  new Cartographic(),\n  new Cartographic(),\n];\nconst scratchTileXY = new Cartesian2();\n\n/**\n * A collection of functions for approximating terrain height\n * @private\n */\nconst ApproximateTerrainHeights = {};\n\n/**\n * Initializes the minimum and maximum terrain heights\n * @return {Promise<void>}\n */\nApproximateTerrainHeights.initialize = function () {\n  let initPromise = ApproximateTerrainHeights._initPromise;\n  if (defined(initPromise)) {\n    return initPromise;\n  }\n  initPromise = Resource.fetchJson(\n    buildModuleUrl(\"Assets/approximateTerrainHeights.json\")\n  ).then(function (json) {\n    ApproximateTerrainHeights._terrainHeights = json;\n  });\n  ApproximateTerrainHeights._initPromise = initPromise;\n\n  return initPromise;\n};\n\n/**\n * Computes the minimum and maximum terrain heights for a given rectangle\n * @param {Rectangle} rectangle The bounding rectangle\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid\n * @return {{minimumTerrainHeight: number, maximumTerrainHeight: number}}\n */\nApproximateTerrainHeights.getMinimumMaximumHeights = function (\n  rectangle,\n  ellipsoid\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"rectangle\", rectangle);\n  if (!defined(ApproximateTerrainHeights._terrainHeights)) {\n    throw new DeveloperError(\n      \"You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function\"\n    );\n  }\n  //>>includeEnd('debug');\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n  const xyLevel = getTileXYLevel(rectangle);\n\n  // Get the terrain min/max for that tile\n  let minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;\n  let maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;\n  if (defined(xyLevel)) {\n    const key = `${xyLevel.level}-${xyLevel.x}-${xyLevel.y}`;\n    const heights = ApproximateTerrainHeights._terrainHeights[key];\n    if (defined(heights)) {\n      minTerrainHeight = heights[0];\n      maxTerrainHeight = heights[1];\n    }\n\n    // Compute min by taking the center of the NE->SW diagonal and finding distance to the surface\n    ellipsoid.cartographicToCartesian(\n      Rectangle.northeast(rectangle, scratchDiagonalCartographic),\n      scratchDiagonalCartesianNE\n    );\n    ellipsoid.cartographicToCartesian(\n      Rectangle.southwest(rectangle, scratchDiagonalCartographic),\n      scratchDiagonalCartesianSW\n    );\n\n    Cartesian3.midpoint(\n      scratchDiagonalCartesianSW,\n      scratchDiagonalCartesianNE,\n      scratchCenterCartesian\n    );\n    const surfacePosition = ellipsoid.scaleToGeodeticSurface(\n      scratchCenterCartesian,\n      scratchSurfaceCartesian\n    );\n    if (defined(surfacePosition)) {\n      const distance = Cartesian3.distance(\n        scratchCenterCartesian,\n        surfacePosition\n      );\n      minTerrainHeight = Math.min(minTerrainHeight, -distance);\n    } else {\n      minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;\n    }\n  }\n\n  minTerrainHeight = Math.max(\n    ApproximateTerrainHeights._defaultMinTerrainHeight,\n    minTerrainHeight\n  );\n\n  return {\n    minimumTerrainHeight: minTerrainHeight,\n    maximumTerrainHeight: maxTerrainHeight,\n  };\n};\n\n/**\n * Computes the bounding sphere based on the tile heights in the rectangle\n * @param {Rectangle} rectangle The bounding rectangle\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid\n * @return {BoundingSphere} The result bounding sphere\n */\nApproximateTerrainHeights.getBoundingSphere = function (rectangle, ellipsoid) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"rectangle\", rectangle);\n  if (!defined(ApproximateTerrainHeights._terrainHeights)) {\n    throw new DeveloperError(\n      \"You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function\"\n    );\n  }\n  //>>includeEnd('debug');\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n  const xyLevel = getTileXYLevel(rectangle);\n\n  // Get the terrain max for that tile\n  let maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;\n  if (defined(xyLevel)) {\n    const key = `${xyLevel.level}-${xyLevel.x}-${xyLevel.y}`;\n    const heights = ApproximateTerrainHeights._terrainHeights[key];\n    if (defined(heights)) {\n      maxTerrainHeight = heights[1];\n    }\n  }\n\n  const result = BoundingSphere.fromRectangle3D(rectangle, ellipsoid, 0.0);\n  BoundingSphere.fromRectangle3D(\n    rectangle,\n    ellipsoid,\n    maxTerrainHeight,\n    scratchBoundingSphere\n  );\n\n  return BoundingSphere.union(result, scratchBoundingSphere, result);\n};\n\nfunction getTileXYLevel(rectangle) {\n  Cartographic.fromRadians(\n    rectangle.east,\n    rectangle.north,\n    0.0,\n    scratchCorners[0]\n  );\n  Cartographic.fromRadians(\n    rectangle.west,\n    rectangle.north,\n    0.0,\n    scratchCorners[1]\n  );\n  Cartographic.fromRadians(\n    rectangle.east,\n    rectangle.south,\n    0.0,\n    scratchCorners[2]\n  );\n  Cartographic.fromRadians(\n    rectangle.west,\n    rectangle.south,\n    0.0,\n    scratchCorners[3]\n  );\n\n  // Determine which tile the bounding rectangle is in\n  let lastLevelX = 0,\n    lastLevelY = 0;\n  let currentX = 0,\n    currentY = 0;\n  const maxLevel = ApproximateTerrainHeights._terrainHeightsMaxLevel;\n  let i;\n  for (i = 0; i <= maxLevel; ++i) {\n    let failed = false;\n    for (let j = 0; j < 4; ++j) {\n      const corner = scratchCorners[j];\n      tilingScheme.positionToTileXY(corner, i, scratchTileXY);\n      if (j === 0) {\n        currentX = scratchTileXY.x;\n        currentY = scratchTileXY.y;\n      } else if (currentX !== scratchTileXY.x || currentY !== scratchTileXY.y) {\n        failed = true;\n        break;\n      }\n    }\n\n    if (failed) {\n      break;\n    }\n\n    lastLevelX = currentX;\n    lastLevelY = currentY;\n  }\n\n  if (i === 0) {\n    return undefined;\n  }\n\n  return {\n    x: lastLevelX,\n    y: lastLevelY,\n    level: i > maxLevel ? maxLevel : i - 1,\n  };\n}\n\nApproximateTerrainHeights._terrainHeightsMaxLevel = 6;\nApproximateTerrainHeights._defaultMaxTerrainHeight = 9000.0;\nApproximateTerrainHeights._defaultMinTerrainHeight = -100000.0;\nApproximateTerrainHeights._terrainHeights = undefined;\nApproximateTerrainHeights._initPromise = undefined;\n\nObject.defineProperties(ApproximateTerrainHeights, {\n  /**\n   * Determines if the terrain heights are initialized and ready to use. To initialize the terrain heights,\n   * call {@link ApproximateTerrainHeights#initialize} and wait for the returned promise to resolve.\n   * @type {boolean}\n   * @readonly\n   * @memberof ApproximateTerrainHeights\n   */\n  initialized: {\n    get: function () {\n      return defined(ApproximateTerrainHeights._terrainHeights);\n    },\n  },\n});\nexport default ApproximateTerrainHeights;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Intersect from \"./Intersect.js\";\n\n/**\n * Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes.\n * @alias AxisAlignedBoundingBox\n * @constructor\n *\n * @param {Cartesian3} [minimum=Cartesian3.ZERO] The minimum point along the x, y, and z axes.\n * @param {Cartesian3} [maximum=Cartesian3.ZERO] The maximum point along the x, y, and z axes.\n * @param {Cartesian3} [center] The center of the box; automatically computed if not supplied.\n *\n * @see BoundingSphere\n * @see BoundingRectangle\n */\nfunction AxisAlignedBoundingBox(minimum, maximum, center) {\n  /**\n   * The minimum point defining the bounding box.\n   * @type {Cartesian3}\n   * @default {@link Cartesian3.ZERO}\n   */\n  this.minimum = Cartesian3.clone(defaultValue(minimum, Cartesian3.ZERO));\n\n  /**\n   * The maximum point defining the bounding box.\n   * @type {Cartesian3}\n   * @default {@link Cartesian3.ZERO}\n   */\n  this.maximum = Cartesian3.clone(defaultValue(maximum, Cartesian3.ZERO));\n\n  // If center was not defined, compute it.\n  if (!defined(center)) {\n    center = Cartesian3.midpoint(this.minimum, this.maximum, new Cartesian3());\n  } else {\n    center = Cartesian3.clone(center);\n  }\n\n  /**\n   * The center point of the bounding box.\n   * @type {Cartesian3}\n   */\n  this.center = center;\n}\n\n/**\n * Creates an instance of an AxisAlignedBoundingBox from its corners.\n *\n * @param {Cartesian3} minimum The minimum point along the x, y, and z axes.\n * @param {Cartesian3} maximum The maximum point along the x, y, and z axes.\n * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.\n * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.\n *\n * @example\n * // Compute an axis aligned bounding box from the two corners.\n * const box = Cesium.AxisAlignedBoundingBox.fromCorners(new Cesium.Cartesian3(-1, -1, -1), new Cesium.Cartesian3(1, 1, 1));\n */\nAxisAlignedBoundingBox.fromCorners = function (minimum, maximum, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"minimum\", minimum);\n  Check.defined(\"maximum\", maximum);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new AxisAlignedBoundingBox();\n  }\n\n  result.minimum = Cartesian3.clone(minimum, result.minimum);\n  result.maximum = Cartesian3.clone(maximum, result.maximum);\n  result.center = Cartesian3.midpoint(minimum, maximum, result.center);\n\n  return result;\n};\n\n/**\n * Computes an instance of an AxisAlignedBoundingBox. The box is determined by\n * finding the points spaced the farthest apart on the x, y, and z axes.\n *\n * @param {Cartesian3[]} positions List of points that the bounding box will enclose.  Each point must have a <code>x</code>, <code>y</code>, and <code>z</code> properties.\n * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.\n * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.\n *\n * @example\n * // Compute an axis aligned bounding box enclosing two points.\n * const box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);\n */\nAxisAlignedBoundingBox.fromPoints = function (positions, result) {\n  if (!defined(result)) {\n    result = new AxisAlignedBoundingBox();\n  }\n\n  if (!defined(positions) || positions.length === 0) {\n    result.minimum = Cartesian3.clone(Cartesian3.ZERO, result.minimum);\n    result.maximum = Cartesian3.clone(Cartesian3.ZERO, result.maximum);\n    result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\n    return result;\n  }\n\n  let minimumX = positions[0].x;\n  let minimumY = positions[0].y;\n  let minimumZ = positions[0].z;\n\n  let maximumX = positions[0].x;\n  let maximumY = positions[0].y;\n  let maximumZ = positions[0].z;\n\n  const length = positions.length;\n  for (let i = 1; i < length; i++) {\n    const p = positions[i];\n    const x = p.x;\n    const y = p.y;\n    const z = p.z;\n\n    minimumX = Math.min(x, minimumX);\n    maximumX = Math.max(x, maximumX);\n    minimumY = Math.min(y, minimumY);\n    maximumY = Math.max(y, maximumY);\n    minimumZ = Math.min(z, minimumZ);\n    maximumZ = Math.max(z, maximumZ);\n  }\n\n  const minimum = result.minimum;\n  minimum.x = minimumX;\n  minimum.y = minimumY;\n  minimum.z = minimumZ;\n\n  const maximum = result.maximum;\n  maximum.x = maximumX;\n  maximum.y = maximumY;\n  maximum.z = maximumZ;\n\n  result.center = Cartesian3.midpoint(minimum, maximum, result.center);\n\n  return result;\n};\n\n/**\n * Duplicates a AxisAlignedBoundingBox instance.\n *\n * @param {AxisAlignedBoundingBox} box The bounding box to duplicate.\n * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.\n * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if none was provided. (Returns undefined if box is undefined)\n */\nAxisAlignedBoundingBox.clone = function (box, result) {\n  if (!defined(box)) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    return new AxisAlignedBoundingBox(box.minimum, box.maximum, box.center);\n  }\n\n  result.minimum = Cartesian3.clone(box.minimum, result.minimum);\n  result.maximum = Cartesian3.clone(box.maximum, result.maximum);\n  result.center = Cartesian3.clone(box.center, result.center);\n  return result;\n};\n\n/**\n * Compares the provided AxisAlignedBoundingBox componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {AxisAlignedBoundingBox} [left] The first AxisAlignedBoundingBox.\n * @param {AxisAlignedBoundingBox} [right] The second AxisAlignedBoundingBox.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nAxisAlignedBoundingBox.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      Cartesian3.equals(left.center, right.center) &&\n      Cartesian3.equals(left.minimum, right.minimum) &&\n      Cartesian3.equals(left.maximum, right.maximum))\n  );\n};\n\nlet intersectScratch = new Cartesian3();\n/**\n * Determines which side of a plane a box is located.\n *\n * @param {AxisAlignedBoundingBox} box The bounding box to test.\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\n *                      the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\n *                      on the opposite side, and {@link Intersect.INTERSECTING} if the box\n *                      intersects the plane.\n */\nAxisAlignedBoundingBox.intersectPlane = function (box, plane) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"box\", box);\n  Check.defined(\"plane\", plane);\n  //>>includeEnd('debug');\n\n  intersectScratch = Cartesian3.subtract(\n    box.maximum,\n    box.minimum,\n    intersectScratch\n  );\n  const h = Cartesian3.multiplyByScalar(\n    intersectScratch,\n    0.5,\n    intersectScratch\n  ); //The positive half diagonal\n  const normal = plane.normal;\n  const e =\n    h.x * Math.abs(normal.x) +\n    h.y * Math.abs(normal.y) +\n    h.z * Math.abs(normal.z);\n  const s = Cartesian3.dot(box.center, normal) + plane.distance; //signed distance from center\n\n  if (s - e > 0) {\n    return Intersect.INSIDE;\n  }\n\n  if (s + e < 0) {\n    //Not in front because normals point inward\n    return Intersect.OUTSIDE;\n  }\n\n  return Intersect.INTERSECTING;\n};\n\n/**\n * Duplicates this AxisAlignedBoundingBox instance.\n *\n * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.\n * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.\n */\nAxisAlignedBoundingBox.prototype.clone = function (result) {\n  return AxisAlignedBoundingBox.clone(this, result);\n};\n\n/**\n * Determines which side of a plane this box is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\n *                      the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\n *                      on the opposite side, and {@link Intersect.INTERSECTING} if the box\n *                      intersects the plane.\n */\nAxisAlignedBoundingBox.prototype.intersectPlane = function (plane) {\n  return AxisAlignedBoundingBox.intersectPlane(this, plane);\n};\n\n/**\n * Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {AxisAlignedBoundingBox} [right] The right hand side AxisAlignedBoundingBox.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nAxisAlignedBoundingBox.prototype.equals = function (right) {\n  return AxisAlignedBoundingBox.equals(this, right);\n};\nexport default AxisAlignedBoundingBox;\n", "import DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * Defines functions for 2nd order polynomial functions of one variable with only real coefficients.\n *\n * @namespace QuadraticRealPolynomial\n */\nconst QuadraticRealPolynomial = {};\n\n/**\n * Provides the discriminant of the quadratic equation from the supplied coefficients.\n *\n * @param {number} a The coefficient of the 2nd order monomial.\n * @param {number} b The coefficient of the 1st order monomial.\n * @param {number} c The coefficient of the 0th order monomial.\n * @returns {number} The value of the discriminant.\n */\nQuadraticRealPolynomial.computeDiscriminant = function (a, b, c) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof a !== \"number\") {\n    throw new DeveloperError(\"a is a required number.\");\n  }\n  if (typeof b !== \"number\") {\n    throw new DeveloperError(\"b is a required number.\");\n  }\n  if (typeof c !== \"number\") {\n    throw new DeveloperError(\"c is a required number.\");\n  }\n  //>>includeEnd('debug');\n\n  const discriminant = b * b - 4.0 * a * c;\n  return discriminant;\n};\n\nfunction addWithCancellationCheck(left, right, tolerance) {\n  const difference = left + right;\n  if (\n    CesiumMath.sign(left) !== CesiumMath.sign(right) &&\n    Math.abs(difference / Math.max(Math.abs(left), Math.abs(right))) < tolerance\n  ) {\n    return 0.0;\n  }\n\n  return difference;\n}\n\n/**\n * Provides the real valued roots of the quadratic polynomial with the provided coefficients.\n *\n * @param {number} a The coefficient of the 2nd order monomial.\n * @param {number} b The coefficient of the 1st order monomial.\n * @param {number} c The coefficient of the 0th order monomial.\n * @returns {number[]} The real valued roots.\n */\nQuadraticRealPolynomial.computeRealRoots = function (a, b, c) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof a !== \"number\") {\n    throw new DeveloperError(\"a is a required number.\");\n  }\n  if (typeof b !== \"number\") {\n    throw new DeveloperError(\"b is a required number.\");\n  }\n  if (typeof c !== \"number\") {\n    throw new DeveloperError(\"c is a required number.\");\n  }\n  //>>includeEnd('debug');\n\n  let ratio;\n  if (a === 0.0) {\n    if (b === 0.0) {\n      // Constant function: c = 0.\n      return [];\n    }\n\n    // Linear function: b * x + c = 0.\n    return [-c / b];\n  } else if (b === 0.0) {\n    if (c === 0.0) {\n      // 2nd order monomial: a * x^2 = 0.\n      return [0.0, 0.0];\n    }\n\n    const cMagnitude = Math.abs(c);\n    const aMagnitude = Math.abs(a);\n\n    if (\n      cMagnitude < aMagnitude &&\n      cMagnitude / aMagnitude < CesiumMath.EPSILON14\n    ) {\n      // c ~= 0.0.\n      // 2nd order monomial: a * x^2 = 0.\n      return [0.0, 0.0];\n    } else if (\n      cMagnitude > aMagnitude &&\n      aMagnitude / cMagnitude < CesiumMath.EPSILON14\n    ) {\n      // a ~= 0.0.\n      // Constant function: c = 0.\n      return [];\n    }\n\n    // a * x^2 + c = 0\n    ratio = -c / a;\n\n    if (ratio < 0.0) {\n      // Both roots are complex.\n      return [];\n    }\n\n    // Both roots are real.\n    const root = Math.sqrt(ratio);\n    return [-root, root];\n  } else if (c === 0.0) {\n    // a * x^2 + b * x = 0\n    ratio = -b / a;\n    if (ratio < 0.0) {\n      return [ratio, 0.0];\n    }\n\n    return [0.0, ratio];\n  }\n\n  // a * x^2 + b * x + c = 0\n  const b2 = b * b;\n  const four_ac = 4.0 * a * c;\n  const radicand = addWithCancellationCheck(b2, -four_ac, CesiumMath.EPSILON14);\n\n  if (radicand < 0.0) {\n    // Both roots are complex.\n    return [];\n  }\n\n  const q =\n    -0.5 *\n    addWithCancellationCheck(\n      b,\n      CesiumMath.sign(b) * Math.sqrt(radicand),\n      CesiumMath.EPSILON14\n    );\n  if (b > 0.0) {\n    return [q / a, c / q];\n  }\n\n  return [c / q, q / a];\n};\nexport default QuadraticRealPolynomial;\n", "import DeveloperError from \"./DeveloperError.js\";\nimport QuadraticRealPolynomial from \"./QuadraticRealPolynomial.js\";\n\n/**\n * Defines functions for 3rd order polynomial functions of one variable with only real coefficients.\n *\n * @namespace CubicRealPolynomial\n */\nconst CubicRealPolynomial = {};\n\n/**\n * Provides the discriminant of the cubic equation from the supplied coefficients.\n *\n * @param {number} a The coefficient of the 3rd order monomial.\n * @param {number} b The coefficient of the 2nd order monomial.\n * @param {number} c The coefficient of the 1st order monomial.\n * @param {number} d The coefficient of the 0th order monomial.\n * @returns {number} The value of the discriminant.\n */\nCubicRealPolynomial.computeDiscriminant = function (a, b, c, d) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof a !== \"number\") {\n    throw new DeveloperError(\"a is a required number.\");\n  }\n  if (typeof b !== \"number\") {\n    throw new DeveloperError(\"b is a required number.\");\n  }\n  if (typeof c !== \"number\") {\n    throw new DeveloperError(\"c is a required number.\");\n  }\n  if (typeof d !== \"number\") {\n    throw new DeveloperError(\"d is a required number.\");\n  }\n  //>>includeEnd('debug');\n\n  const a2 = a * a;\n  const b2 = b * b;\n  const c2 = c * c;\n  const d2 = d * d;\n\n  const discriminant =\n    18.0 * a * b * c * d +\n    b2 * c2 -\n    27.0 * a2 * d2 -\n    4.0 * (a * c2 * c + b2 * b * d);\n  return discriminant;\n};\n\nfunction computeRealRoots(a, b, c, d) {\n  const A = a;\n  const B = b / 3.0;\n  const C = c / 3.0;\n  const D = d;\n\n  const AC = A * C;\n  const BD = B * D;\n  const B2 = B * B;\n  const C2 = C * C;\n  const delta1 = A * C - B2;\n  const delta2 = A * D - B * C;\n  const delta3 = B * D - C2;\n\n  const discriminant = 4.0 * delta1 * delta3 - delta2 * delta2;\n  let temp;\n  let temp1;\n\n  if (discriminant < 0.0) {\n    let ABar;\n    let CBar;\n    let DBar;\n\n    if (B2 * BD >= AC * C2) {\n      ABar = A;\n      CBar = delta1;\n      DBar = -2.0 * B * delta1 + A * delta2;\n    } else {\n      ABar = D;\n      CBar = delta3;\n      DBar = -D * delta2 + 2.0 * C * delta3;\n    }\n\n    const s = DBar < 0.0 ? -1.0 : 1.0; // This is not Math.Sign()!\n    const temp0 = -s * Math.abs(ABar) * Math.sqrt(-discriminant);\n    temp1 = -DBar + temp0;\n\n    const x = temp1 / 2.0;\n    const p = x < 0.0 ? -Math.pow(-x, 1.0 / 3.0) : Math.pow(x, 1.0 / 3.0);\n    const q = temp1 === temp0 ? -p : -CBar / p;\n\n    temp = CBar <= 0.0 ? p + q : -DBar / (p * p + q * q + CBar);\n\n    if (B2 * BD >= AC * C2) {\n      return [(temp - B) / A];\n    }\n\n    return [-D / (temp + C)];\n  }\n\n  const CBarA = delta1;\n  const DBarA = -2.0 * B * delta1 + A * delta2;\n\n  const CBarD = delta3;\n  const DBarD = -D * delta2 + 2.0 * C * delta3;\n\n  const squareRootOfDiscriminant = Math.sqrt(discriminant);\n  const halfSquareRootOf3 = Math.sqrt(3.0) / 2.0;\n\n  let theta = Math.abs(Math.atan2(A * squareRootOfDiscriminant, -DBarA) / 3.0);\n  temp = 2.0 * Math.sqrt(-CBarA);\n  let cosine = Math.cos(theta);\n  temp1 = temp * cosine;\n  let temp3 = temp * (-cosine / 2.0 - halfSquareRootOf3 * Math.sin(theta));\n\n  const numeratorLarge = temp1 + temp3 > 2.0 * B ? temp1 - B : temp3 - B;\n  const denominatorLarge = A;\n\n  const root1 = numeratorLarge / denominatorLarge;\n\n  theta = Math.abs(Math.atan2(D * squareRootOfDiscriminant, -DBarD) / 3.0);\n  temp = 2.0 * Math.sqrt(-CBarD);\n  cosine = Math.cos(theta);\n  temp1 = temp * cosine;\n  temp3 = temp * (-cosine / 2.0 - halfSquareRootOf3 * Math.sin(theta));\n\n  const numeratorSmall = -D;\n  const denominatorSmall = temp1 + temp3 < 2.0 * C ? temp1 + C : temp3 + C;\n\n  const root3 = numeratorSmall / denominatorSmall;\n\n  const E = denominatorLarge * denominatorSmall;\n  const F =\n    -numeratorLarge * denominatorSmall - denominatorLarge * numeratorSmall;\n  const G = numeratorLarge * numeratorSmall;\n\n  const root2 = (C * F - B * G) / (-B * F + C * E);\n\n  if (root1 <= root2) {\n    if (root1 <= root3) {\n      if (root2 <= root3) {\n        return [root1, root2, root3];\n      }\n      return [root1, root3, root2];\n    }\n    return [root3, root1, root2];\n  }\n  if (root1 <= root3) {\n    return [root2, root1, root3];\n  }\n  if (root2 <= root3) {\n    return [root2, root3, root1];\n  }\n  return [root3, root2, root1];\n}\n\n/**\n * Provides the real valued roots of the cubic polynomial with the provided coefficients.\n *\n * @param {number} a The coefficient of the 3rd order monomial.\n * @param {number} b The coefficient of the 2nd order monomial.\n * @param {number} c The coefficient of the 1st order monomial.\n * @param {number} d The coefficient of the 0th order monomial.\n * @returns {number[]} The real valued roots.\n */\nCubicRealPolynomial.computeRealRoots = function (a, b, c, d) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof a !== \"number\") {\n    throw new DeveloperError(\"a is a required number.\");\n  }\n  if (typeof b !== \"number\") {\n    throw new DeveloperError(\"b is a required number.\");\n  }\n  if (typeof c !== \"number\") {\n    throw new DeveloperError(\"c is a required number.\");\n  }\n  if (typeof d !== \"number\") {\n    throw new DeveloperError(\"d is a required number.\");\n  }\n  //>>includeEnd('debug');\n\n  let roots;\n  let ratio;\n  if (a === 0.0) {\n    // Quadratic function: b * x^2 + c * x + d = 0.\n    return QuadraticRealPolynomial.computeRealRoots(b, c, d);\n  } else if (b === 0.0) {\n    if (c === 0.0) {\n      if (d === 0.0) {\n        // 3rd order monomial: a * x^3 = 0.\n        return [0.0, 0.0, 0.0];\n      }\n\n      // a * x^3 + d = 0\n      ratio = -d / a;\n      const root =\n        ratio < 0.0 ? -Math.pow(-ratio, 1.0 / 3.0) : Math.pow(ratio, 1.0 / 3.0);\n      return [root, root, root];\n    } else if (d === 0.0) {\n      // x * (a * x^2 + c) = 0.\n      roots = QuadraticRealPolynomial.computeRealRoots(a, 0, c);\n\n      // Return the roots in ascending order.\n      if (roots.Length === 0) {\n        return [0.0];\n      }\n      return [roots[0], 0.0, roots[1]];\n    }\n\n    // Deflated cubic polynomial: a * x^3 + c * x + d= 0.\n    return computeRealRoots(a, 0, c, d);\n  } else if (c === 0.0) {\n    if (d === 0.0) {\n      // x^2 * (a * x + b) = 0.\n      ratio = -b / a;\n      if (ratio < 0.0) {\n        return [ratio, 0.0, 0.0];\n      }\n      return [0.0, 0.0, ratio];\n    }\n    // a * x^3 + b * x^2 + d = 0.\n    return computeRealRoots(a, b, 0, d);\n  } else if (d === 0.0) {\n    // x * (a * x^2 + b * x + c) = 0\n    roots = QuadraticRealPolynomial.computeRealRoots(a, b, c);\n\n    // Return the roots in ascending order.\n    if (roots.length === 0) {\n      return [0.0];\n    } else if (roots[1] <= 0.0) {\n      return [roots[0], roots[1], 0.0];\n    } else if (roots[0] >= 0.0) {\n      return [0.0, roots[0], roots[1]];\n    }\n    return [roots[0], 0.0, roots[1]];\n  }\n\n  return computeRealRoots(a, b, c, d);\n};\nexport default CubicRealPolynomial;\n", "import CubicRealPolynomial from \"./CubicRealPolynomial.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport QuadraticRealPolynomial from \"./QuadraticRealPolynomial.js\";\n\n/**\n * Defines functions for 4th order polynomial functions of one variable with only real coefficients.\n *\n * @namespace QuarticRealPolynomial\n */\nconst QuarticRealPolynomial = {};\n\n/**\n * Provides the discriminant of the quartic equation from the supplied coefficients.\n *\n * @param {number} a The coefficient of the 4th order monomial.\n * @param {number} b The coefficient of the 3rd order monomial.\n * @param {number} c The coefficient of the 2nd order monomial.\n * @param {number} d The coefficient of the 1st order monomial.\n * @param {number} e The coefficient of the 0th order monomial.\n * @returns {number} The value of the discriminant.\n */\nQuarticRealPolynomial.computeDiscriminant = function (a, b, c, d, e) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof a !== \"number\") {\n    throw new DeveloperError(\"a is a required number.\");\n  }\n  if (typeof b !== \"number\") {\n    throw new DeveloperError(\"b is a required number.\");\n  }\n  if (typeof c !== \"number\") {\n    throw new DeveloperError(\"c is a required number.\");\n  }\n  if (typeof d !== \"number\") {\n    throw new DeveloperError(\"d is a required number.\");\n  }\n  if (typeof e !== \"number\") {\n    throw new DeveloperError(\"e is a required number.\");\n  }\n  //>>includeEnd('debug');\n\n  const a2 = a * a;\n  const a3 = a2 * a;\n  const b2 = b * b;\n  const b3 = b2 * b;\n  const c2 = c * c;\n  const c3 = c2 * c;\n  const d2 = d * d;\n  const d3 = d2 * d;\n  const e2 = e * e;\n  const e3 = e2 * e;\n\n  const discriminant =\n    b2 * c2 * d2 -\n    4.0 * b3 * d3 -\n    4.0 * a * c3 * d2 +\n    18 * a * b * c * d3 -\n    27.0 * a2 * d2 * d2 +\n    256.0 * a3 * e3 +\n    e *\n      (18.0 * b3 * c * d -\n        4.0 * b2 * c3 +\n        16.0 * a * c2 * c2 -\n        80.0 * a * b * c2 * d -\n        6.0 * a * b2 * d2 +\n        144.0 * a2 * c * d2) +\n    e2 *\n      (144.0 * a * b2 * c -\n        27.0 * b2 * b2 -\n        128.0 * a2 * c2 -\n        192.0 * a2 * b * d);\n  return discriminant;\n};\n\nfunction original(a3, a2, a1, a0) {\n  const a3Squared = a3 * a3;\n\n  const p = a2 - (3.0 * a3Squared) / 8.0;\n  const q = a1 - (a2 * a3) / 2.0 + (a3Squared * a3) / 8.0;\n  const r =\n    a0 -\n    (a1 * a3) / 4.0 +\n    (a2 * a3Squared) / 16.0 -\n    (3.0 * a3Squared * a3Squared) / 256.0;\n\n  // Find the roots of the cubic equations:  h^6 + 2 p h^4 + (p^2 - 4 r) h^2 - q^2 = 0.\n  const cubicRoots = CubicRealPolynomial.computeRealRoots(\n    1.0,\n    2.0 * p,\n    p * p - 4.0 * r,\n    -q * q\n  );\n\n  if (cubicRoots.length > 0) {\n    const temp = -a3 / 4.0;\n\n    // Use the largest positive root.\n    const hSquared = cubicRoots[cubicRoots.length - 1];\n\n    if (Math.abs(hSquared) < CesiumMath.EPSILON14) {\n      // y^4 + p y^2 + r = 0.\n      const roots = QuadraticRealPolynomial.computeRealRoots(1.0, p, r);\n\n      if (roots.length === 2) {\n        const root0 = roots[0];\n        const root1 = roots[1];\n\n        let y;\n        if (root0 >= 0.0 && root1 >= 0.0) {\n          const y0 = Math.sqrt(root0);\n          const y1 = Math.sqrt(root1);\n\n          return [temp - y1, temp - y0, temp + y0, temp + y1];\n        } else if (root0 >= 0.0 && root1 < 0.0) {\n          y = Math.sqrt(root0);\n          return [temp - y, temp + y];\n        } else if (root0 < 0.0 && root1 >= 0.0) {\n          y = Math.sqrt(root1);\n          return [temp - y, temp + y];\n        }\n      }\n      return [];\n    } else if (hSquared > 0.0) {\n      const h = Math.sqrt(hSquared);\n\n      const m = (p + hSquared - q / h) / 2.0;\n      const n = (p + hSquared + q / h) / 2.0;\n\n      // Now solve the two quadratic factors:  (y^2 + h y + m)(y^2 - h y + n);\n      const roots1 = QuadraticRealPolynomial.computeRealRoots(1.0, h, m);\n      const roots2 = QuadraticRealPolynomial.computeRealRoots(1.0, -h, n);\n\n      if (roots1.length !== 0) {\n        roots1[0] += temp;\n        roots1[1] += temp;\n\n        if (roots2.length !== 0) {\n          roots2[0] += temp;\n          roots2[1] += temp;\n\n          if (roots1[1] <= roots2[0]) {\n            return [roots1[0], roots1[1], roots2[0], roots2[1]];\n          } else if (roots2[1] <= roots1[0]) {\n            return [roots2[0], roots2[1], roots1[0], roots1[1]];\n          } else if (roots1[0] >= roots2[0] && roots1[1] <= roots2[1]) {\n            return [roots2[0], roots1[0], roots1[1], roots2[1]];\n          } else if (roots2[0] >= roots1[0] && roots2[1] <= roots1[1]) {\n            return [roots1[0], roots2[0], roots2[1], roots1[1]];\n          } else if (roots1[0] > roots2[0] && roots1[0] < roots2[1]) {\n            return [roots2[0], roots1[0], roots2[1], roots1[1]];\n          }\n          return [roots1[0], roots2[0], roots1[1], roots2[1]];\n        }\n        return roots1;\n      }\n\n      if (roots2.length !== 0) {\n        roots2[0] += temp;\n        roots2[1] += temp;\n\n        return roots2;\n      }\n      return [];\n    }\n  }\n  return [];\n}\n\nfunction neumark(a3, a2, a1, a0) {\n  const a1Squared = a1 * a1;\n  const a2Squared = a2 * a2;\n  const a3Squared = a3 * a3;\n\n  const p = -2.0 * a2;\n  const q = a1 * a3 + a2Squared - 4.0 * a0;\n  const r = a3Squared * a0 - a1 * a2 * a3 + a1Squared;\n\n  const cubicRoots = CubicRealPolynomial.computeRealRoots(1.0, p, q, r);\n\n  if (cubicRoots.length > 0) {\n    // Use the most positive root\n    const y = cubicRoots[0];\n\n    const temp = a2 - y;\n    const tempSquared = temp * temp;\n\n    const g1 = a3 / 2.0;\n    const h1 = temp / 2.0;\n\n    const m = tempSquared - 4.0 * a0;\n    const mError = tempSquared + 4.0 * Math.abs(a0);\n\n    const n = a3Squared - 4.0 * y;\n    const nError = a3Squared + 4.0 * Math.abs(y);\n\n    let g2;\n    let h2;\n\n    if (y < 0.0 || m * nError < n * mError) {\n      const squareRootOfN = Math.sqrt(n);\n      g2 = squareRootOfN / 2.0;\n      h2 = squareRootOfN === 0.0 ? 0.0 : (a3 * h1 - a1) / squareRootOfN;\n    } else {\n      const squareRootOfM = Math.sqrt(m);\n      g2 = squareRootOfM === 0.0 ? 0.0 : (a3 * h1 - a1) / squareRootOfM;\n      h2 = squareRootOfM / 2.0;\n    }\n\n    let G;\n    let g;\n    if (g1 === 0.0 && g2 === 0.0) {\n      G = 0.0;\n      g = 0.0;\n    } else if (CesiumMath.sign(g1) === CesiumMath.sign(g2)) {\n      G = g1 + g2;\n      g = y / G;\n    } else {\n      g = g1 - g2;\n      G = y / g;\n    }\n\n    let H;\n    let h;\n    if (h1 === 0.0 && h2 === 0.0) {\n      H = 0.0;\n      h = 0.0;\n    } else if (CesiumMath.sign(h1) === CesiumMath.sign(h2)) {\n      H = h1 + h2;\n      h = a0 / H;\n    } else {\n      h = h1 - h2;\n      H = a0 / h;\n    }\n\n    // Now solve the two quadratic factors:  (y^2 + G y + H)(y^2 + g y + h);\n    const roots1 = QuadraticRealPolynomial.computeRealRoots(1.0, G, H);\n    const roots2 = QuadraticRealPolynomial.computeRealRoots(1.0, g, h);\n\n    if (roots1.length !== 0) {\n      if (roots2.length !== 0) {\n        if (roots1[1] <= roots2[0]) {\n          return [roots1[0], roots1[1], roots2[0], roots2[1]];\n        } else if (roots2[1] <= roots1[0]) {\n          return [roots2[0], roots2[1], roots1[0], roots1[1]];\n        } else if (roots1[0] >= roots2[0] && roots1[1] <= roots2[1]) {\n          return [roots2[0], roots1[0], roots1[1], roots2[1]];\n        } else if (roots2[0] >= roots1[0] && roots2[1] <= roots1[1]) {\n          return [roots1[0], roots2[0], roots2[1], roots1[1]];\n        } else if (roots1[0] > roots2[0] && roots1[0] < roots2[1]) {\n          return [roots2[0], roots1[0], roots2[1], roots1[1]];\n        }\n        return [roots1[0], roots2[0], roots1[1], roots2[1]];\n      }\n      return roots1;\n    }\n    if (roots2.length !== 0) {\n      return roots2;\n    }\n  }\n  return [];\n}\n\n/**\n * Provides the real valued roots of the quartic polynomial with the provided coefficients.\n *\n * @param {number} a The coefficient of the 4th order monomial.\n * @param {number} b The coefficient of the 3rd order monomial.\n * @param {number} c The coefficient of the 2nd order monomial.\n * @param {number} d The coefficient of the 1st order monomial.\n * @param {number} e The coefficient of the 0th order monomial.\n * @returns {number[]} The real valued roots.\n */\nQuarticRealPolynomial.computeRealRoots = function (a, b, c, d, e) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof a !== \"number\") {\n    throw new DeveloperError(\"a is a required number.\");\n  }\n  if (typeof b !== \"number\") {\n    throw new DeveloperError(\"b is a required number.\");\n  }\n  if (typeof c !== \"number\") {\n    throw new DeveloperError(\"c is a required number.\");\n  }\n  if (typeof d !== \"number\") {\n    throw new DeveloperError(\"d is a required number.\");\n  }\n  if (typeof e !== \"number\") {\n    throw new DeveloperError(\"e is a required number.\");\n  }\n  //>>includeEnd('debug');\n\n  if (Math.abs(a) < CesiumMath.EPSILON15) {\n    return CubicRealPolynomial.computeRealRoots(b, c, d, e);\n  }\n  const a3 = b / a;\n  const a2 = c / a;\n  const a1 = d / a;\n  const a0 = e / a;\n\n  let k = a3 < 0.0 ? 1 : 0;\n  k += a2 < 0.0 ? k + 1 : k;\n  k += a1 < 0.0 ? k + 1 : k;\n  k += a0 < 0.0 ? k + 1 : k;\n\n  switch (k) {\n    case 0:\n      return original(a3, a2, a1, a0);\n    case 1:\n      return neumark(a3, a2, a1, a0);\n    case 2:\n      return neumark(a3, a2, a1, a0);\n    case 3:\n      return original(a3, a2, a1, a0);\n    case 4:\n      return original(a3, a2, a1, a0);\n    case 5:\n      return neumark(a3, a2, a1, a0);\n    case 6:\n      return original(a3, a2, a1, a0);\n    case 7:\n      return original(a3, a2, a1, a0);\n    case 8:\n      return neumark(a3, a2, a1, a0);\n    case 9:\n      return original(a3, a2, a1, a0);\n    case 10:\n      return original(a3, a2, a1, a0);\n    case 11:\n      return neumark(a3, a2, a1, a0);\n    case 12:\n      return original(a3, a2, a1, a0);\n    case 13:\n      return original(a3, a2, a1, a0);\n    case 14:\n      return original(a3, a2, a1, a0);\n    case 15:\n      return original(a3, a2, a1, a0);\n    default:\n      return undefined;\n  }\n};\nexport default QuarticRealPolynomial;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\n\n/**\n * Represents a ray that extends infinitely from the provided origin in the provided direction.\n * @alias Ray\n * @constructor\n *\n * @param {Cartesian3} [origin=Cartesian3.ZERO] The origin of the ray.\n * @param {Cartesian3} [direction=Cartesian3.ZERO] The direction of the ray.\n */\nfunction Ray(origin, direction) {\n  direction = Cartesian3.clone(defaultValue(direction, Cartesian3.ZERO));\n  if (!Cartesian3.equals(direction, Cartesian3.ZERO)) {\n    Cartesian3.normalize(direction, direction);\n  }\n\n  /**\n   * The origin of the ray.\n   * @type {Cartesian3}\n   * @default {@link Cartesian3.ZERO}\n   */\n  this.origin = Cartesian3.clone(defaultValue(origin, Cartesian3.ZERO));\n\n  /**\n   * The direction of the ray.\n   * @type {Cartesian3}\n   */\n  this.direction = direction;\n}\n\n/**\n * Duplicates a Ray instance.\n *\n * @param {Ray} ray The ray to duplicate.\n * @param {Ray} [result] The object onto which to store the result.\n * @returns {Ray} The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined)\n */\nRay.clone = function (ray, result) {\n  if (!defined(ray)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    return new Ray(ray.origin, ray.direction);\n  }\n  result.origin = Cartesian3.clone(ray.origin);\n  result.direction = Cartesian3.clone(ray.direction);\n  return result;\n};\n\n/**\n * Computes the point along the ray given by r(t) = o + t*d,\n * where o is the origin of the ray and d is the direction.\n *\n * @param {Ray} ray The ray.\n * @param {number} t A scalar value.\n * @param {Cartesian3} [result] The object in which the result will be stored.\n * @returns {Cartesian3} The modified result parameter, or a new instance if none was provided.\n *\n * @example\n * //Get the first intersection point of a ray and an ellipsoid.\n * const intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);\n * const point = Cesium.Ray.getPoint(ray, intersection.start);\n */\nRay.getPoint = function (ray, t, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"ray\", ray);\n  Check.typeOf.number(\"t\", t);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  result = Cartesian3.multiplyByScalar(ray.direction, t, result);\n  return Cartesian3.add(ray.origin, result, result);\n};\nexport default Ray;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Interval from \"./Interval.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport QuadraticRealPolynomial from \"./QuadraticRealPolynomial.js\";\nimport QuarticRealPolynomial from \"./QuarticRealPolynomial.js\";\nimport Ray from \"./Ray.js\";\n\n/**\n * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids.\n *\n * @namespace IntersectionTests\n */\nconst IntersectionTests = {};\n\n/**\n * Computes the intersection of a ray and a plane.\n *\n * @param {Ray} ray The ray.\n * @param {Plane} plane The plane.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The intersection point or undefined if there is no intersections.\n */\nIntersectionTests.rayPlane = function (ray, plane, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(ray)) {\n    throw new DeveloperError(\"ray is required.\");\n  }\n  if (!defined(plane)) {\n    throw new DeveloperError(\"plane is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  const origin = ray.origin;\n  const direction = ray.direction;\n  const normal = plane.normal;\n  const denominator = Cartesian3.dot(normal, direction);\n\n  if (Math.abs(denominator) < CesiumMath.EPSILON15) {\n    // Ray is parallel to plane.  The ray may be in the polygon's plane.\n    return undefined;\n  }\n\n  const t = (-plane.distance - Cartesian3.dot(normal, origin)) / denominator;\n\n  if (t < 0) {\n    return undefined;\n  }\n\n  result = Cartesian3.multiplyByScalar(direction, t, result);\n  return Cartesian3.add(origin, result, result);\n};\n\nconst scratchEdge0 = new Cartesian3();\nconst scratchEdge1 = new Cartesian3();\nconst scratchPVec = new Cartesian3();\nconst scratchTVec = new Cartesian3();\nconst scratchQVec = new Cartesian3();\n\n/**\n * Computes the intersection of a ray and a triangle as a parametric distance along the input ray. The result is negative when the triangle is behind the ray.\n *\n * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|\n * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.\n *\n * @memberof IntersectionTests\n *\n * @param {Ray} ray The ray.\n * @param {Cartesian3} p0 The first vertex of the triangle.\n * @param {Cartesian3} p1 The second vertex of the triangle.\n * @param {Cartesian3} p2 The third vertex of the triangle.\n * @param {boolean} [cullBackFaces=false] If <code>true</code>, will only compute an intersection with the front face of the triangle\n *                  and return undefined for intersections with the back face.\n * @returns {number} The intersection as a parametric distance along the ray, or undefined if there is no intersection.\n */\nIntersectionTests.rayTriangleParametric = function (\n  ray,\n  p0,\n  p1,\n  p2,\n  cullBackFaces\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(ray)) {\n    throw new DeveloperError(\"ray is required.\");\n  }\n  if (!defined(p0)) {\n    throw new DeveloperError(\"p0 is required.\");\n  }\n  if (!defined(p1)) {\n    throw new DeveloperError(\"p1 is required.\");\n  }\n  if (!defined(p2)) {\n    throw new DeveloperError(\"p2 is required.\");\n  }\n  //>>includeEnd('debug');\n\n  cullBackFaces = defaultValue(cullBackFaces, false);\n\n  const origin = ray.origin;\n  const direction = ray.direction;\n\n  const edge0 = Cartesian3.subtract(p1, p0, scratchEdge0);\n  const edge1 = Cartesian3.subtract(p2, p0, scratchEdge1);\n\n  const p = Cartesian3.cross(direction, edge1, scratchPVec);\n  const det = Cartesian3.dot(edge0, p);\n\n  let tvec;\n  let q;\n\n  let u;\n  let v;\n  let t;\n\n  if (cullBackFaces) {\n    if (det < CesiumMath.EPSILON6) {\n      return undefined;\n    }\n\n    tvec = Cartesian3.subtract(origin, p0, scratchTVec);\n    u = Cartesian3.dot(tvec, p);\n    if (u < 0.0 || u > det) {\n      return undefined;\n    }\n\n    q = Cartesian3.cross(tvec, edge0, scratchQVec);\n\n    v = Cartesian3.dot(direction, q);\n    if (v < 0.0 || u + v > det) {\n      return undefined;\n    }\n\n    t = Cartesian3.dot(edge1, q) / det;\n  } else {\n    if (Math.abs(det) < CesiumMath.EPSILON6) {\n      return undefined;\n    }\n    const invDet = 1.0 / det;\n\n    tvec = Cartesian3.subtract(origin, p0, scratchTVec);\n    u = Cartesian3.dot(tvec, p) * invDet;\n    if (u < 0.0 || u > 1.0) {\n      return undefined;\n    }\n\n    q = Cartesian3.cross(tvec, edge0, scratchQVec);\n\n    v = Cartesian3.dot(direction, q) * invDet;\n    if (v < 0.0 || u + v > 1.0) {\n      return undefined;\n    }\n\n    t = Cartesian3.dot(edge1, q) * invDet;\n  }\n\n  return t;\n};\n\n/**\n * Computes the intersection of a ray and a triangle as a Cartesian3 coordinate.\n *\n * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|\n * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.\n *\n * @memberof IntersectionTests\n *\n * @param {Ray} ray The ray.\n * @param {Cartesian3} p0 The first vertex of the triangle.\n * @param {Cartesian3} p1 The second vertex of the triangle.\n * @param {Cartesian3} p2 The third vertex of the triangle.\n * @param {boolean} [cullBackFaces=false] If <code>true</code>, will only compute an intersection with the front face of the triangle\n *                  and return undefined for intersections with the back face.\n * @param {Cartesian3} [result] The <code>Cartesian3</code> onto which to store the result.\n * @returns {Cartesian3} The intersection point or undefined if there is no intersections.\n */\nIntersectionTests.rayTriangle = function (\n  ray,\n  p0,\n  p1,\n  p2,\n  cullBackFaces,\n  result\n) {\n  const t = IntersectionTests.rayTriangleParametric(\n    ray,\n    p0,\n    p1,\n    p2,\n    cullBackFaces\n  );\n  if (!defined(t) || t < 0.0) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  Cartesian3.multiplyByScalar(ray.direction, t, result);\n  return Cartesian3.add(ray.origin, result, result);\n};\n\nconst scratchLineSegmentTriangleRay = new Ray();\n\n/**\n * Computes the intersection of a line segment and a triangle.\n * @memberof IntersectionTests\n *\n * @param {Cartesian3} v0 The an end point of the line segment.\n * @param {Cartesian3} v1 The other end point of the line segment.\n * @param {Cartesian3} p0 The first vertex of the triangle.\n * @param {Cartesian3} p1 The second vertex of the triangle.\n * @param {Cartesian3} p2 The third vertex of the triangle.\n * @param {boolean} [cullBackFaces=false] If <code>true</code>, will only compute an intersection with the front face of the triangle\n *                  and return undefined for intersections with the back face.\n * @param {Cartesian3} [result] The <code>Cartesian3</code> onto which to store the result.\n * @returns {Cartesian3} The intersection point or undefined if there is no intersections.\n */\nIntersectionTests.lineSegmentTriangle = function (\n  v0,\n  v1,\n  p0,\n  p1,\n  p2,\n  cullBackFaces,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(v0)) {\n    throw new DeveloperError(\"v0 is required.\");\n  }\n  if (!defined(v1)) {\n    throw new DeveloperError(\"v1 is required.\");\n  }\n  if (!defined(p0)) {\n    throw new DeveloperError(\"p0 is required.\");\n  }\n  if (!defined(p1)) {\n    throw new DeveloperError(\"p1 is required.\");\n  }\n  if (!defined(p2)) {\n    throw new DeveloperError(\"p2 is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const ray = scratchLineSegmentTriangleRay;\n  Cartesian3.clone(v0, ray.origin);\n  Cartesian3.subtract(v1, v0, ray.direction);\n  Cartesian3.normalize(ray.direction, ray.direction);\n\n  const t = IntersectionTests.rayTriangleParametric(\n    ray,\n    p0,\n    p1,\n    p2,\n    cullBackFaces\n  );\n  if (!defined(t) || t < 0.0 || t > Cartesian3.distance(v0, v1)) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  Cartesian3.multiplyByScalar(ray.direction, t, result);\n  return Cartesian3.add(ray.origin, result, result);\n};\n\nfunction solveQuadratic(a, b, c, result) {\n  const det = b * b - 4.0 * a * c;\n  if (det < 0.0) {\n    return undefined;\n  } else if (det > 0.0) {\n    const denom = 1.0 / (2.0 * a);\n    const disc = Math.sqrt(det);\n    const root0 = (-b + disc) * denom;\n    const root1 = (-b - disc) * denom;\n\n    if (root0 < root1) {\n      result.root0 = root0;\n      result.root1 = root1;\n    } else {\n      result.root0 = root1;\n      result.root1 = root0;\n    }\n\n    return result;\n  }\n\n  const root = -b / (2.0 * a);\n  if (root === 0.0) {\n    return undefined;\n  }\n\n  result.root0 = result.root1 = root;\n  return result;\n}\n\nconst raySphereRoots = {\n  root0: 0.0,\n  root1: 0.0,\n};\n\nfunction raySphere(ray, sphere, result) {\n  if (!defined(result)) {\n    result = new Interval();\n  }\n\n  const origin = ray.origin;\n  const direction = ray.direction;\n\n  const center = sphere.center;\n  const radiusSquared = sphere.radius * sphere.radius;\n\n  const diff = Cartesian3.subtract(origin, center, scratchPVec);\n\n  const a = Cartesian3.dot(direction, direction);\n  const b = 2.0 * Cartesian3.dot(direction, diff);\n  const c = Cartesian3.magnitudeSquared(diff) - radiusSquared;\n\n  const roots = solveQuadratic(a, b, c, raySphereRoots);\n  if (!defined(roots)) {\n    return undefined;\n  }\n\n  result.start = roots.root0;\n  result.stop = roots.root1;\n  return result;\n}\n\n/**\n * Computes the intersection points of a ray with a sphere.\n * @memberof IntersectionTests\n *\n * @param {Ray} ray The ray.\n * @param {BoundingSphere} sphere The sphere.\n * @param {Interval} [result] The result onto which to store the result.\n * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections.\n */\nIntersectionTests.raySphere = function (ray, sphere, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(ray)) {\n    throw new DeveloperError(\"ray is required.\");\n  }\n  if (!defined(sphere)) {\n    throw new DeveloperError(\"sphere is required.\");\n  }\n  //>>includeEnd('debug');\n\n  result = raySphere(ray, sphere, result);\n  if (!defined(result) || result.stop < 0.0) {\n    return undefined;\n  }\n\n  result.start = Math.max(result.start, 0.0);\n  return result;\n};\n\nconst scratchLineSegmentRay = new Ray();\n\n/**\n * Computes the intersection points of a line segment with a sphere.\n * @memberof IntersectionTests\n *\n * @param {Cartesian3} p0 An end point of the line segment.\n * @param {Cartesian3} p1 The other end point of the line segment.\n * @param {BoundingSphere} sphere The sphere.\n * @param {Interval} [result] The result onto which to store the result.\n * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections.\n */\nIntersectionTests.lineSegmentSphere = function (p0, p1, sphere, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(p0)) {\n    throw new DeveloperError(\"p0 is required.\");\n  }\n  if (!defined(p1)) {\n    throw new DeveloperError(\"p1 is required.\");\n  }\n  if (!defined(sphere)) {\n    throw new DeveloperError(\"sphere is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const ray = scratchLineSegmentRay;\n  Cartesian3.clone(p0, ray.origin);\n  const direction = Cartesian3.subtract(p1, p0, ray.direction);\n\n  const maxT = Cartesian3.magnitude(direction);\n  Cartesian3.normalize(direction, direction);\n\n  result = raySphere(ray, sphere, result);\n  if (!defined(result) || result.stop < 0.0 || result.start > maxT) {\n    return undefined;\n  }\n\n  result.start = Math.max(result.start, 0.0);\n  result.stop = Math.min(result.stop, maxT);\n  return result;\n};\n\nconst scratchQ = new Cartesian3();\nconst scratchW = new Cartesian3();\n\n/**\n * Computes the intersection points of a ray with an ellipsoid.\n *\n * @param {Ray} ray The ray.\n * @param {Ellipsoid} ellipsoid The ellipsoid.\n * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections.\n */\nIntersectionTests.rayEllipsoid = function (ray, ellipsoid) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(ray)) {\n    throw new DeveloperError(\"ray is required.\");\n  }\n  if (!defined(ellipsoid)) {\n    throw new DeveloperError(\"ellipsoid is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const inverseRadii = ellipsoid.oneOverRadii;\n  const q = Cartesian3.multiplyComponents(inverseRadii, ray.origin, scratchQ);\n  const w = Cartesian3.multiplyComponents(\n    inverseRadii,\n    ray.direction,\n    scratchW\n  );\n\n  const q2 = Cartesian3.magnitudeSquared(q);\n  const qw = Cartesian3.dot(q, w);\n\n  let difference, w2, product, discriminant, temp;\n\n  if (q2 > 1.0) {\n    // Outside ellipsoid.\n    if (qw >= 0.0) {\n      // Looking outward or tangent (0 intersections).\n      return undefined;\n    }\n\n    // qw < 0.0.\n    const qw2 = qw * qw;\n    difference = q2 - 1.0; // Positively valued.\n    w2 = Cartesian3.magnitudeSquared(w);\n    product = w2 * difference;\n\n    if (qw2 < product) {\n      // Imaginary roots (0 intersections).\n      return undefined;\n    } else if (qw2 > product) {\n      // Distinct roots (2 intersections).\n      discriminant = qw * qw - product;\n      temp = -qw + Math.sqrt(discriminant); // Avoid cancellation.\n      const root0 = temp / w2;\n      const root1 = difference / temp;\n      if (root0 < root1) {\n        return new Interval(root0, root1);\n      }\n\n      return {\n        start: root1,\n        stop: root0,\n      };\n    }\n    // qw2 == product.  Repeated roots (2 intersections).\n    const root = Math.sqrt(difference / w2);\n    return new Interval(root, root);\n  } else if (q2 < 1.0) {\n    // Inside ellipsoid (2 intersections).\n    difference = q2 - 1.0; // Negatively valued.\n    w2 = Cartesian3.magnitudeSquared(w);\n    product = w2 * difference; // Negatively valued.\n\n    discriminant = qw * qw - product;\n    temp = -qw + Math.sqrt(discriminant); // Positively valued.\n    return new Interval(0.0, temp / w2);\n  }\n  // q2 == 1.0. On ellipsoid.\n  if (qw < 0.0) {\n    // Looking inward.\n    w2 = Cartesian3.magnitudeSquared(w);\n    return new Interval(0.0, -qw / w2);\n  }\n\n  // qw >= 0.0.  Looking outward or tangent.\n  return undefined;\n};\n\nfunction addWithCancellationCheck(left, right, tolerance) {\n  const difference = left + right;\n  if (\n    CesiumMath.sign(left) !== CesiumMath.sign(right) &&\n    Math.abs(difference / Math.max(Math.abs(left), Math.abs(right))) < tolerance\n  ) {\n    return 0.0;\n  }\n\n  return difference;\n}\n\nfunction quadraticVectorExpression(A, b, c, x, w) {\n  const xSquared = x * x;\n  const wSquared = w * w;\n\n  const l2 = (A[Matrix3.COLUMN1ROW1] - A[Matrix3.COLUMN2ROW2]) * wSquared;\n  const l1 =\n    w *\n    (x *\n      addWithCancellationCheck(\n        A[Matrix3.COLUMN1ROW0],\n        A[Matrix3.COLUMN0ROW1],\n        CesiumMath.EPSILON15\n      ) +\n      b.y);\n  const l0 =\n    A[Matrix3.COLUMN0ROW0] * xSquared +\n    A[Matrix3.COLUMN2ROW2] * wSquared +\n    x * b.x +\n    c;\n\n  const r1 =\n    wSquared *\n    addWithCancellationCheck(\n      A[Matrix3.COLUMN2ROW1],\n      A[Matrix3.COLUMN1ROW2],\n      CesiumMath.EPSILON15\n    );\n  const r0 =\n    w *\n    (x *\n      addWithCancellationCheck(A[Matrix3.COLUMN2ROW0], A[Matrix3.COLUMN0ROW2]) +\n      b.z);\n\n  let cosines;\n  const solutions = [];\n  if (r0 === 0.0 && r1 === 0.0) {\n    cosines = QuadraticRealPolynomial.computeRealRoots(l2, l1, l0);\n    if (cosines.length === 0) {\n      return solutions;\n    }\n\n    const cosine0 = cosines[0];\n    const sine0 = Math.sqrt(Math.max(1.0 - cosine0 * cosine0, 0.0));\n    solutions.push(new Cartesian3(x, w * cosine0, w * -sine0));\n    solutions.push(new Cartesian3(x, w * cosine0, w * sine0));\n\n    if (cosines.length === 2) {\n      const cosine1 = cosines[1];\n      const sine1 = Math.sqrt(Math.max(1.0 - cosine1 * cosine1, 0.0));\n      solutions.push(new Cartesian3(x, w * cosine1, w * -sine1));\n      solutions.push(new Cartesian3(x, w * cosine1, w * sine1));\n    }\n\n    return solutions;\n  }\n\n  const r0Squared = r0 * r0;\n  const r1Squared = r1 * r1;\n  const l2Squared = l2 * l2;\n  const r0r1 = r0 * r1;\n\n  const c4 = l2Squared + r1Squared;\n  const c3 = 2.0 * (l1 * l2 + r0r1);\n  const c2 = 2.0 * l0 * l2 + l1 * l1 - r1Squared + r0Squared;\n  const c1 = 2.0 * (l0 * l1 - r0r1);\n  const c0 = l0 * l0 - r0Squared;\n\n  if (c4 === 0.0 && c3 === 0.0 && c2 === 0.0 && c1 === 0.0) {\n    return solutions;\n  }\n\n  cosines = QuarticRealPolynomial.computeRealRoots(c4, c3, c2, c1, c0);\n  const length = cosines.length;\n  if (length === 0) {\n    return solutions;\n  }\n\n  for (let i = 0; i < length; ++i) {\n    const cosine = cosines[i];\n    const cosineSquared = cosine * cosine;\n    const sineSquared = Math.max(1.0 - cosineSquared, 0.0);\n    const sine = Math.sqrt(sineSquared);\n\n    //const left = l2 * cosineSquared + l1 * cosine + l0;\n    let left;\n    if (CesiumMath.sign(l2) === CesiumMath.sign(l0)) {\n      left = addWithCancellationCheck(\n        l2 * cosineSquared + l0,\n        l1 * cosine,\n        CesiumMath.EPSILON12\n      );\n    } else if (CesiumMath.sign(l0) === CesiumMath.sign(l1 * cosine)) {\n      left = addWithCancellationCheck(\n        l2 * cosineSquared,\n        l1 * cosine + l0,\n        CesiumMath.EPSILON12\n      );\n    } else {\n      left = addWithCancellationCheck(\n        l2 * cosineSquared + l1 * cosine,\n        l0,\n        CesiumMath.EPSILON12\n      );\n    }\n\n    const right = addWithCancellationCheck(\n      r1 * cosine,\n      r0,\n      CesiumMath.EPSILON15\n    );\n    const product = left * right;\n\n    if (product < 0.0) {\n      solutions.push(new Cartesian3(x, w * cosine, w * sine));\n    } else if (product > 0.0) {\n      solutions.push(new Cartesian3(x, w * cosine, w * -sine));\n    } else if (sine !== 0.0) {\n      solutions.push(new Cartesian3(x, w * cosine, w * -sine));\n      solutions.push(new Cartesian3(x, w * cosine, w * sine));\n      ++i;\n    } else {\n      solutions.push(new Cartesian3(x, w * cosine, w * sine));\n    }\n  }\n\n  return solutions;\n}\n\nconst firstAxisScratch = new Cartesian3();\nconst secondAxisScratch = new Cartesian3();\nconst thirdAxisScratch = new Cartesian3();\nconst referenceScratch = new Cartesian3();\nconst bCart = new Cartesian3();\nconst bScratch = new Matrix3();\nconst btScratch = new Matrix3();\nconst diScratch = new Matrix3();\nconst dScratch = new Matrix3();\nconst cScratch = new Matrix3();\nconst tempMatrix = new Matrix3();\nconst aScratch = new Matrix3();\nconst sScratch = new Cartesian3();\nconst closestScratch = new Cartesian3();\nconst surfPointScratch = new Cartographic();\n\n/**\n * Provides the point along the ray which is nearest to the ellipsoid.\n *\n * @param {Ray} ray The ray.\n * @param {Ellipsoid} ellipsoid The ellipsoid.\n * @returns {Cartesian3} The nearest planetodetic point on the ray.\n */\nIntersectionTests.grazingAltitudeLocation = function (ray, ellipsoid) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(ray)) {\n    throw new DeveloperError(\"ray is required.\");\n  }\n  if (!defined(ellipsoid)) {\n    throw new DeveloperError(\"ellipsoid is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const position = ray.origin;\n  const direction = ray.direction;\n\n  if (!Cartesian3.equals(position, Cartesian3.ZERO)) {\n    const normal = ellipsoid.geodeticSurfaceNormal(position, firstAxisScratch);\n    if (Cartesian3.dot(direction, normal) >= 0.0) {\n      // The location provided is the closest point in altitude\n      return position;\n    }\n  }\n\n  const intersects = defined(this.rayEllipsoid(ray, ellipsoid));\n\n  // Compute the scaled direction vector.\n  const f = ellipsoid.transformPositionToScaledSpace(\n    direction,\n    firstAxisScratch\n  );\n\n  // Constructs a basis from the unit scaled direction vector. Construct its rotation and transpose.\n  const firstAxis = Cartesian3.normalize(f, f);\n  const reference = Cartesian3.mostOrthogonalAxis(f, referenceScratch);\n  const secondAxis = Cartesian3.normalize(\n    Cartesian3.cross(reference, firstAxis, secondAxisScratch),\n    secondAxisScratch\n  );\n  const thirdAxis = Cartesian3.normalize(\n    Cartesian3.cross(firstAxis, secondAxis, thirdAxisScratch),\n    thirdAxisScratch\n  );\n  const B = bScratch;\n  B[0] = firstAxis.x;\n  B[1] = firstAxis.y;\n  B[2] = firstAxis.z;\n  B[3] = secondAxis.x;\n  B[4] = secondAxis.y;\n  B[5] = secondAxis.z;\n  B[6] = thirdAxis.x;\n  B[7] = thirdAxis.y;\n  B[8] = thirdAxis.z;\n\n  const B_T = Matrix3.transpose(B, btScratch);\n\n  // Get the scaling matrix and its inverse.\n  const D_I = Matrix3.fromScale(ellipsoid.radii, diScratch);\n  const D = Matrix3.fromScale(ellipsoid.oneOverRadii, dScratch);\n\n  const C = cScratch;\n  C[0] = 0.0;\n  C[1] = -direction.z;\n  C[2] = direction.y;\n  C[3] = direction.z;\n  C[4] = 0.0;\n  C[5] = -direction.x;\n  C[6] = -direction.y;\n  C[7] = direction.x;\n  C[8] = 0.0;\n\n  const temp = Matrix3.multiply(\n    Matrix3.multiply(B_T, D, tempMatrix),\n    C,\n    tempMatrix\n  );\n  const A = Matrix3.multiply(\n    Matrix3.multiply(temp, D_I, aScratch),\n    B,\n    aScratch\n  );\n  const b = Matrix3.multiplyByVector(temp, position, bCart);\n\n  // Solve for the solutions to the expression in standard form:\n  const solutions = quadraticVectorExpression(\n    A,\n    Cartesian3.negate(b, firstAxisScratch),\n    0.0,\n    0.0,\n    1.0\n  );\n\n  let s;\n  let altitude;\n  const length = solutions.length;\n  if (length > 0) {\n    let closest = Cartesian3.clone(Cartesian3.ZERO, closestScratch);\n    let maximumValue = Number.NEGATIVE_INFINITY;\n\n    for (let i = 0; i < length; ++i) {\n      s = Matrix3.multiplyByVector(\n        D_I,\n        Matrix3.multiplyByVector(B, solutions[i], sScratch),\n        sScratch\n      );\n      const v = Cartesian3.normalize(\n        Cartesian3.subtract(s, position, referenceScratch),\n        referenceScratch\n      );\n      const dotProduct = Cartesian3.dot(v, direction);\n\n      if (dotProduct > maximumValue) {\n        maximumValue = dotProduct;\n        closest = Cartesian3.clone(s, closest);\n      }\n    }\n\n    const surfacePoint = ellipsoid.cartesianToCartographic(\n      closest,\n      surfPointScratch\n    );\n    maximumValue = CesiumMath.clamp(maximumValue, 0.0, 1.0);\n    altitude =\n      Cartesian3.magnitude(\n        Cartesian3.subtract(closest, position, referenceScratch)\n      ) * Math.sqrt(1.0 - maximumValue * maximumValue);\n    altitude = intersects ? -altitude : altitude;\n    surfacePoint.height = altitude;\n    return ellipsoid.cartographicToCartesian(surfacePoint, new Cartesian3());\n  }\n\n  return undefined;\n};\n\nconst lineSegmentPlaneDifference = new Cartesian3();\n\n/**\n * Computes the intersection of a line segment and a plane.\n *\n * @param {Cartesian3} endPoint0 An end point of the line segment.\n * @param {Cartesian3} endPoint1 The other end point of the line segment.\n * @param {Plane} plane The plane.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The intersection point or undefined if there is no intersection.\n *\n * @example\n * const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);\n * const normal = ellipsoid.geodeticSurfaceNormal(origin);\n * const plane = Cesium.Plane.fromPointNormal(origin, normal);\n *\n * const p0 = new Cesium.Cartesian3(...);\n * const p1 = new Cesium.Cartesian3(...);\n *\n * // find the intersection of the line segment from p0 to p1 and the tangent plane at origin.\n * const intersection = Cesium.IntersectionTests.lineSegmentPlane(p0, p1, plane);\n */\nIntersectionTests.lineSegmentPlane = function (\n  endPoint0,\n  endPoint1,\n  plane,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(endPoint0)) {\n    throw new DeveloperError(\"endPoint0 is required.\");\n  }\n  if (!defined(endPoint1)) {\n    throw new DeveloperError(\"endPoint1 is required.\");\n  }\n  if (!defined(plane)) {\n    throw new DeveloperError(\"plane is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  const difference = Cartesian3.subtract(\n    endPoint1,\n    endPoint0,\n    lineSegmentPlaneDifference\n  );\n  const normal = plane.normal;\n  const nDotDiff = Cartesian3.dot(normal, difference);\n\n  // check if the segment and plane are parallel\n  if (Math.abs(nDotDiff) < CesiumMath.EPSILON6) {\n    return undefined;\n  }\n\n  const nDotP0 = Cartesian3.dot(normal, endPoint0);\n  const t = -(plane.distance + nDotP0) / nDotDiff;\n\n  // intersection only if t is in [0, 1]\n  if (t < 0.0 || t > 1.0) {\n    return undefined;\n  }\n\n  // intersection is endPoint0 + t * (endPoint1 - endPoint0)\n  Cartesian3.multiplyByScalar(difference, t, result);\n  Cartesian3.add(endPoint0, result, result);\n  return result;\n};\n\n/**\n * Computes the intersection of a triangle and a plane\n *\n * @param {Cartesian3} p0 First point of the triangle\n * @param {Cartesian3} p1 Second point of the triangle\n * @param {Cartesian3} p2 Third point of the triangle\n * @param {Plane} plane Intersection plane\n * @returns {object} An object with properties <code>positions</code> and <code>indices</code>, which are arrays that represent three triangles that do not cross the plane. (Undefined if no intersection exists)\n *\n * @example\n * const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);\n * const normal = ellipsoid.geodeticSurfaceNormal(origin);\n * const plane = Cesium.Plane.fromPointNormal(origin, normal);\n *\n * const p0 = new Cesium.Cartesian3(...);\n * const p1 = new Cesium.Cartesian3(...);\n * const p2 = new Cesium.Cartesian3(...);\n *\n * // convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane\n * const triangles = Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane);\n */\nIntersectionTests.trianglePlaneIntersection = function (p0, p1, p2, plane) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(p0) || !defined(p1) || !defined(p2) || !defined(plane)) {\n    throw new DeveloperError(\"p0, p1, p2, and plane are required.\");\n  }\n  //>>includeEnd('debug');\n\n  const planeNormal = plane.normal;\n  const planeD = plane.distance;\n  const p0Behind = Cartesian3.dot(planeNormal, p0) + planeD < 0.0;\n  const p1Behind = Cartesian3.dot(planeNormal, p1) + planeD < 0.0;\n  const p2Behind = Cartesian3.dot(planeNormal, p2) + planeD < 0.0;\n  // Given these dots products, the calls to lineSegmentPlaneIntersection\n  // always have defined results.\n\n  let numBehind = 0;\n  numBehind += p0Behind ? 1 : 0;\n  numBehind += p1Behind ? 1 : 0;\n  numBehind += p2Behind ? 1 : 0;\n\n  let u1, u2;\n  if (numBehind === 1 || numBehind === 2) {\n    u1 = new Cartesian3();\n    u2 = new Cartesian3();\n  }\n\n  if (numBehind === 1) {\n    if (p0Behind) {\n      IntersectionTests.lineSegmentPlane(p0, p1, plane, u1);\n      IntersectionTests.lineSegmentPlane(p0, p2, plane, u2);\n\n      return {\n        positions: [p0, p1, p2, u1, u2],\n        indices: [\n          // Behind\n          0,\n          3,\n          4,\n\n          // In front\n          1,\n          2,\n          4,\n          1,\n          4,\n          3,\n        ],\n      };\n    } else if (p1Behind) {\n      IntersectionTests.lineSegmentPlane(p1, p2, plane, u1);\n      IntersectionTests.lineSegmentPlane(p1, p0, plane, u2);\n\n      return {\n        positions: [p0, p1, p2, u1, u2],\n        indices: [\n          // Behind\n          1,\n          3,\n          4,\n\n          // In front\n          2,\n          0,\n          4,\n          2,\n          4,\n          3,\n        ],\n      };\n    } else if (p2Behind) {\n      IntersectionTests.lineSegmentPlane(p2, p0, plane, u1);\n      IntersectionTests.lineSegmentPlane(p2, p1, plane, u2);\n\n      return {\n        positions: [p0, p1, p2, u1, u2],\n        indices: [\n          // Behind\n          2,\n          3,\n          4,\n\n          // In front\n          0,\n          1,\n          4,\n          0,\n          4,\n          3,\n        ],\n      };\n    }\n  } else if (numBehind === 2) {\n    if (!p0Behind) {\n      IntersectionTests.lineSegmentPlane(p1, p0, plane, u1);\n      IntersectionTests.lineSegmentPlane(p2, p0, plane, u2);\n\n      return {\n        positions: [p0, p1, p2, u1, u2],\n        indices: [\n          // Behind\n          1,\n          2,\n          4,\n          1,\n          4,\n          3,\n\n          // In front\n          0,\n          3,\n          4,\n        ],\n      };\n    } else if (!p1Behind) {\n      IntersectionTests.lineSegmentPlane(p2, p1, plane, u1);\n      IntersectionTests.lineSegmentPlane(p0, p1, plane, u2);\n\n      return {\n        positions: [p0, p1, p2, u1, u2],\n        indices: [\n          // Behind\n          2,\n          0,\n          4,\n          2,\n          4,\n          3,\n\n          // In front\n          1,\n          3,\n          4,\n        ],\n      };\n    } else if (!p2Behind) {\n      IntersectionTests.lineSegmentPlane(p0, p2, plane, u1);\n      IntersectionTests.lineSegmentPlane(p1, p2, plane, u2);\n\n      return {\n        positions: [p0, p1, p2, u1, u2],\n        indices: [\n          // Behind\n          0,\n          1,\n          4,\n          0,\n          4,\n          3,\n\n          // In front\n          2,\n          3,\n          4,\n        ],\n      };\n    }\n  }\n\n  // if numBehind is 3, the triangle is completely behind the plane;\n  // otherwise, it is completely in front (numBehind is 0).\n  return undefined;\n};\nexport default IntersectionTests;\n", "import AxisAlignedBoundingBox from \"./AxisAlignedBoundingBox.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport IntersectionTests from \"./IntersectionTests.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Plane from \"./Plane.js\";\nimport Ray from \"./Ray.js\";\nimport Transforms from \"./Transforms.js\";\n\nconst scratchCart4 = new Cartesian4();\n/**\n * A plane tangent to the provided ellipsoid at the provided origin.\n * If origin is not on the surface of the ellipsoid, it's surface projection will be used.\n * If origin is at the center of the ellipsoid, an exception will be thrown.\n * @alias EllipsoidTangentPlane\n * @constructor\n *\n * @param {Cartesian3} origin The point on the surface of the ellipsoid where the tangent plane touches.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.\n *\n * @exception {DeveloperError} origin must not be at the center of the ellipsoid.\n */\nfunction EllipsoidTangentPlane(origin, ellipsoid) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"origin\", origin);\n  //>>includeEnd('debug');\n\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n  origin = ellipsoid.scaleToGeodeticSurface(origin);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(origin)) {\n    throw new DeveloperError(\n      \"origin must not be at the center of the ellipsoid.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const eastNorthUp = Transforms.eastNorthUpToFixedFrame(origin, ellipsoid);\n  this._ellipsoid = ellipsoid;\n  this._origin = origin;\n  this._xAxis = Cartesian3.fromCartesian4(\n    Matrix4.getColumn(eastNorthUp, 0, scratchCart4)\n  );\n  this._yAxis = Cartesian3.fromCartesian4(\n    Matrix4.getColumn(eastNorthUp, 1, scratchCart4)\n  );\n\n  const normal = Cartesian3.fromCartesian4(\n    Matrix4.getColumn(eastNorthUp, 2, scratchCart4)\n  );\n  this._plane = Plane.fromPointNormal(origin, normal);\n}\n\nObject.defineProperties(EllipsoidTangentPlane.prototype, {\n  /**\n   * Gets the ellipsoid.\n   * @memberof EllipsoidTangentPlane.prototype\n   * @type {Ellipsoid}\n   */\n  ellipsoid: {\n    get: function () {\n      return this._ellipsoid;\n    },\n  },\n\n  /**\n   * Gets the origin.\n   * @memberof EllipsoidTangentPlane.prototype\n   * @type {Cartesian3}\n   */\n  origin: {\n    get: function () {\n      return this._origin;\n    },\n  },\n\n  /**\n   * Gets the plane which is tangent to the ellipsoid.\n   * @memberof EllipsoidTangentPlane.prototype\n   * @readonly\n   * @type {Plane}\n   */\n  plane: {\n    get: function () {\n      return this._plane;\n    },\n  },\n\n  /**\n   * Gets the local X-axis (east) of the tangent plane.\n   * @memberof EllipsoidTangentPlane.prototype\n   * @readonly\n   * @type {Cartesian3}\n   */\n  xAxis: {\n    get: function () {\n      return this._xAxis;\n    },\n  },\n\n  /**\n   * Gets the local Y-axis (north) of the tangent plane.\n   * @memberof EllipsoidTangentPlane.prototype\n   * @readonly\n   * @type {Cartesian3}\n   */\n  yAxis: {\n    get: function () {\n      return this._yAxis;\n    },\n  },\n\n  /**\n   * Gets the local Z-axis (up) of the tangent plane.\n   * @memberof EllipsoidTangentPlane.prototype\n   * @readonly\n   * @type {Cartesian3}\n   */\n  zAxis: {\n    get: function () {\n      return this._plane.normal;\n    },\n  },\n});\n\nconst tmp = new AxisAlignedBoundingBox();\n/**\n * Creates a new instance from the provided ellipsoid and the center\n * point of the provided Cartesians.\n *\n * @param {Cartesian3[]} cartesians The list of positions surrounding the center point.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.\n * @returns {EllipsoidTangentPlane} The new instance of EllipsoidTangentPlane.\n */\nEllipsoidTangentPlane.fromPoints = function (cartesians, ellipsoid) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartesians\", cartesians);\n  //>>includeEnd('debug');\n\n  const box = AxisAlignedBoundingBox.fromPoints(cartesians, tmp);\n  return new EllipsoidTangentPlane(box.center, ellipsoid);\n};\n\nconst scratchProjectPointOntoPlaneRay = new Ray();\nconst scratchProjectPointOntoPlaneCartesian3 = new Cartesian3();\n\n/**\n * Computes the projection of the provided 3D position onto the 2D plane, radially outward from the {@link EllipsoidTangentPlane.ellipsoid} coordinate system origin.\n *\n * @param {Cartesian3} cartesian The point to project.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided. Undefined if there is no intersection point\n */\nEllipsoidTangentPlane.prototype.projectPointOntoPlane = function (\n  cartesian,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  const ray = scratchProjectPointOntoPlaneRay;\n  ray.origin = cartesian;\n  Cartesian3.normalize(cartesian, ray.direction);\n\n  let intersectionPoint = IntersectionTests.rayPlane(\n    ray,\n    this._plane,\n    scratchProjectPointOntoPlaneCartesian3\n  );\n  if (!defined(intersectionPoint)) {\n    Cartesian3.negate(ray.direction, ray.direction);\n    intersectionPoint = IntersectionTests.rayPlane(\n      ray,\n      this._plane,\n      scratchProjectPointOntoPlaneCartesian3\n    );\n  }\n\n  if (defined(intersectionPoint)) {\n    const v = Cartesian3.subtract(\n      intersectionPoint,\n      this._origin,\n      intersectionPoint\n    );\n    const x = Cartesian3.dot(this._xAxis, v);\n    const y = Cartesian3.dot(this._yAxis, v);\n\n    if (!defined(result)) {\n      return new Cartesian2(x, y);\n    }\n    result.x = x;\n    result.y = y;\n    return result;\n  }\n  return undefined;\n};\n\n/**\n * Computes the projection of the provided 3D positions onto the 2D plane (where possible), radially outward from the global origin.\n * The resulting array may be shorter than the input array - if a single projection is impossible it will not be included.\n *\n * @see EllipsoidTangentPlane.projectPointOntoPlane\n *\n * @param {Cartesian3[]} cartesians The array of points to project.\n * @param {Cartesian2[]} [result] The array of Cartesian2 instances onto which to store results.\n * @returns {Cartesian2[]} The modified result parameter or a new array of Cartesian2 instances if none was provided.\n */\nEllipsoidTangentPlane.prototype.projectPointsOntoPlane = function (\n  cartesians,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartesians\", cartesians);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = [];\n  }\n\n  let count = 0;\n  const length = cartesians.length;\n  for (let i = 0; i < length; i++) {\n    const p = this.projectPointOntoPlane(cartesians[i], result[count]);\n    if (defined(p)) {\n      result[count] = p;\n      count++;\n    }\n  }\n  result.length = count;\n  return result;\n};\n\n/**\n * Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.\n *\n * @param {Cartesian3} cartesian The point to project.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided.\n */\nEllipsoidTangentPlane.prototype.projectPointToNearestOnPlane = function (\n  cartesian,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian2();\n  }\n\n  const ray = scratchProjectPointOntoPlaneRay;\n  ray.origin = cartesian;\n  Cartesian3.clone(this._plane.normal, ray.direction);\n\n  let intersectionPoint = IntersectionTests.rayPlane(\n    ray,\n    this._plane,\n    scratchProjectPointOntoPlaneCartesian3\n  );\n  if (!defined(intersectionPoint)) {\n    Cartesian3.negate(ray.direction, ray.direction);\n    intersectionPoint = IntersectionTests.rayPlane(\n      ray,\n      this._plane,\n      scratchProjectPointOntoPlaneCartesian3\n    );\n  }\n\n  const v = Cartesian3.subtract(\n    intersectionPoint,\n    this._origin,\n    intersectionPoint\n  );\n  const x = Cartesian3.dot(this._xAxis, v);\n  const y = Cartesian3.dot(this._yAxis, v);\n\n  result.x = x;\n  result.y = y;\n  return result;\n};\n\n/**\n * Computes the projection of the provided 3D positions onto the 2D plane, along the plane normal.\n *\n * @see EllipsoidTangentPlane.projectPointToNearestOnPlane\n *\n * @param {Cartesian3[]} cartesians The array of points to project.\n * @param {Cartesian2[]} [result] The array of Cartesian2 instances onto which to store results.\n * @returns {Cartesian2[]} The modified result parameter or a new array of Cartesian2 instances if none was provided. This will have the same length as <code>cartesians</code>.\n */\nEllipsoidTangentPlane.prototype.projectPointsToNearestOnPlane = function (\n  cartesians,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartesians\", cartesians);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = [];\n  }\n\n  const length = cartesians.length;\n  result.length = length;\n  for (let i = 0; i < length; i++) {\n    result[i] = this.projectPointToNearestOnPlane(cartesians[i], result[i]);\n  }\n  return result;\n};\n\nconst projectPointsOntoEllipsoidScratch = new Cartesian3();\n/**\n * Computes the projection of the provided 2D position onto the 3D ellipsoid.\n *\n * @param {Cartesian2} cartesian The points to project.\n * @param {Cartesian3} [result] The Cartesian3 instance to store result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */\nEllipsoidTangentPlane.prototype.projectPointOntoEllipsoid = function (\n  cartesian,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  const ellipsoid = this._ellipsoid;\n  const origin = this._origin;\n  const xAxis = this._xAxis;\n  const yAxis = this._yAxis;\n  const tmp = projectPointsOntoEllipsoidScratch;\n\n  Cartesian3.multiplyByScalar(xAxis, cartesian.x, tmp);\n  result = Cartesian3.add(origin, tmp, result);\n  Cartesian3.multiplyByScalar(yAxis, cartesian.y, tmp);\n  Cartesian3.add(result, tmp, result);\n  ellipsoid.scaleToGeocentricSurface(result, result);\n\n  return result;\n};\n\n/**\n * Computes the projection of the provided 2D positions onto the 3D ellipsoid.\n *\n * @param {Cartesian2[]} cartesians The array of points to project.\n * @param {Cartesian3[]} [result] The array of Cartesian3 instances onto which to store results.\n * @returns {Cartesian3[]} The modified result parameter or a new array of Cartesian3 instances if none was provided.\n */\nEllipsoidTangentPlane.prototype.projectPointsOntoEllipsoid = function (\n  cartesians,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartesians\", cartesians);\n  //>>includeEnd('debug');\n\n  const length = cartesians.length;\n  if (!defined(result)) {\n    result = new Array(length);\n  } else {\n    result.length = length;\n  }\n\n  for (let i = 0; i < length; ++i) {\n    result[i] = this.projectPointOntoEllipsoid(cartesians[i], result[i]);\n  }\n\n  return result;\n};\nexport default EllipsoidTangentPlane;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidTangentPlane from \"./EllipsoidTangentPlane.js\";\nimport Intersect from \"./Intersect.js\";\nimport Interval from \"./Interval.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Plane from \"./Plane.js\";\nimport Rectangle from \"./Rectangle.js\";\n\n/**\n * Creates an instance of an OrientedBoundingBox.\n * An OrientedBoundingBox of some object is a closed and convex rectangular cuboid. It can provide a tighter bounding volume than {@link BoundingSphere} or {@link AxisAlignedBoundingBox} in many cases.\n * @alias OrientedBoundingBox\n * @constructor\n *\n * @param {Cartesian3} [center=Cartesian3.ZERO] The center of the box.\n * @param {Matrix3} [halfAxes=Matrix3.ZERO] The three orthogonal half-axes of the bounding box.\n *                                          Equivalently, the transformation matrix, to rotate and scale a 2x2x2\n *                                          cube centered at the origin.\n *\n *\n * @example\n * // Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale.\n * const center = new Cesium.Cartesian3(1.0, 0.0, 0.0);\n * const halfAxes = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(1.0, 3.0, 2.0), new Cesium.Matrix3());\n *\n * const obb = new Cesium.OrientedBoundingBox(center, halfAxes);\n *\n * @see BoundingSphere\n * @see BoundingRectangle\n */\nfunction OrientedBoundingBox(center, halfAxes) {\n  /**\n   * The center of the box.\n   * @type {Cartesian3}\n   * @default {@link Cartesian3.ZERO}\n   */\n  this.center = Cartesian3.clone(defaultValue(center, Cartesian3.ZERO));\n  /**\n   * The three orthogonal half-axes of the bounding box. Equivalently, the\n   * transformation matrix, to rotate and scale a 2x2x2 cube centered at the\n   * origin.\n   * @type {Matrix3}\n   * @default {@link Matrix3.ZERO}\n   */\n  this.halfAxes = Matrix3.clone(defaultValue(halfAxes, Matrix3.ZERO));\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nOrientedBoundingBox.packedLength =\n  Cartesian3.packedLength + Matrix3.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {OrientedBoundingBox} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nOrientedBoundingBox.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  Cartesian3.pack(value.center, array, startingIndex);\n  Matrix3.pack(value.halfAxes, array, startingIndex + Cartesian3.packedLength);\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {OrientedBoundingBox} [result] The object into which to store the result.\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if one was not provided.\n */\nOrientedBoundingBox.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new OrientedBoundingBox();\n  }\n\n  Cartesian3.unpack(array, startingIndex, result.center);\n  Matrix3.unpack(\n    array,\n    startingIndex + Cartesian3.packedLength,\n    result.halfAxes\n  );\n  return result;\n};\n\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchCartesian3 = new Cartesian3();\nconst scratchCartesian4 = new Cartesian3();\nconst scratchCartesian5 = new Cartesian3();\nconst scratchCartesian6 = new Cartesian3();\nconst scratchCovarianceResult = new Matrix3();\nconst scratchEigenResult = {\n  unitary: new Matrix3(),\n  diagonal: new Matrix3(),\n};\n\n/**\n * Computes an instance of an OrientedBoundingBox of the given positions.\n * This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis).\n * Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf\n *\n * @param {Cartesian3[]} [positions] List of {@link Cartesian3} points that the bounding box will enclose.\n * @param {OrientedBoundingBox} [result] The object onto which to store the result.\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if one was not provided.\n *\n * @example\n * // Compute an object oriented bounding box enclosing two points.\n * const box = Cesium.OrientedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);\n */\nOrientedBoundingBox.fromPoints = function (positions, result) {\n  if (!defined(result)) {\n    result = new OrientedBoundingBox();\n  }\n\n  if (!defined(positions) || positions.length === 0) {\n    result.halfAxes = Matrix3.ZERO;\n    result.center = Cartesian3.ZERO;\n    return result;\n  }\n\n  let i;\n  const length = positions.length;\n\n  const meanPoint = Cartesian3.clone(positions[0], scratchCartesian1);\n  for (i = 1; i < length; i++) {\n    Cartesian3.add(meanPoint, positions[i], meanPoint);\n  }\n  const invLength = 1.0 / length;\n  Cartesian3.multiplyByScalar(meanPoint, invLength, meanPoint);\n\n  let exx = 0.0;\n  let exy = 0.0;\n  let exz = 0.0;\n  let eyy = 0.0;\n  let eyz = 0.0;\n  let ezz = 0.0;\n  let p;\n\n  for (i = 0; i < length; i++) {\n    p = Cartesian3.subtract(positions[i], meanPoint, scratchCartesian2);\n    exx += p.x * p.x;\n    exy += p.x * p.y;\n    exz += p.x * p.z;\n    eyy += p.y * p.y;\n    eyz += p.y * p.z;\n    ezz += p.z * p.z;\n  }\n\n  exx *= invLength;\n  exy *= invLength;\n  exz *= invLength;\n  eyy *= invLength;\n  eyz *= invLength;\n  ezz *= invLength;\n\n  const covarianceMatrix = scratchCovarianceResult;\n  covarianceMatrix[0] = exx;\n  covarianceMatrix[1] = exy;\n  covarianceMatrix[2] = exz;\n  covarianceMatrix[3] = exy;\n  covarianceMatrix[4] = eyy;\n  covarianceMatrix[5] = eyz;\n  covarianceMatrix[6] = exz;\n  covarianceMatrix[7] = eyz;\n  covarianceMatrix[8] = ezz;\n\n  const eigenDecomposition = Matrix3.computeEigenDecomposition(\n    covarianceMatrix,\n    scratchEigenResult\n  );\n  const rotation = Matrix3.clone(eigenDecomposition.unitary, result.halfAxes);\n\n  let v1 = Matrix3.getColumn(rotation, 0, scratchCartesian4);\n  let v2 = Matrix3.getColumn(rotation, 1, scratchCartesian5);\n  let v3 = Matrix3.getColumn(rotation, 2, scratchCartesian6);\n\n  let u1 = -Number.MAX_VALUE;\n  let u2 = -Number.MAX_VALUE;\n  let u3 = -Number.MAX_VALUE;\n  let l1 = Number.MAX_VALUE;\n  let l2 = Number.MAX_VALUE;\n  let l3 = Number.MAX_VALUE;\n\n  for (i = 0; i < length; i++) {\n    p = positions[i];\n    u1 = Math.max(Cartesian3.dot(v1, p), u1);\n    u2 = Math.max(Cartesian3.dot(v2, p), u2);\n    u3 = Math.max(Cartesian3.dot(v3, p), u3);\n\n    l1 = Math.min(Cartesian3.dot(v1, p), l1);\n    l2 = Math.min(Cartesian3.dot(v2, p), l2);\n    l3 = Math.min(Cartesian3.dot(v3, p), l3);\n  }\n\n  v1 = Cartesian3.multiplyByScalar(v1, 0.5 * (l1 + u1), v1);\n  v2 = Cartesian3.multiplyByScalar(v2, 0.5 * (l2 + u2), v2);\n  v3 = Cartesian3.multiplyByScalar(v3, 0.5 * (l3 + u3), v3);\n\n  const center = Cartesian3.add(v1, v2, result.center);\n  Cartesian3.add(center, v3, center);\n\n  const scale = scratchCartesian3;\n  scale.x = u1 - l1;\n  scale.y = u2 - l2;\n  scale.z = u3 - l3;\n  Cartesian3.multiplyByScalar(scale, 0.5, scale);\n  Matrix3.multiplyByScale(result.halfAxes, scale, result.halfAxes);\n\n  return result;\n};\n\nconst scratchOffset = new Cartesian3();\nconst scratchScale = new Cartesian3();\nfunction fromPlaneExtents(\n  planeOrigin,\n  planeXAxis,\n  planeYAxis,\n  planeZAxis,\n  minimumX,\n  maximumX,\n  minimumY,\n  maximumY,\n  minimumZ,\n  maximumZ,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    !defined(minimumX) ||\n    !defined(maximumX) ||\n    !defined(minimumY) ||\n    !defined(maximumY) ||\n    !defined(minimumZ) ||\n    !defined(maximumZ)\n  ) {\n    throw new DeveloperError(\n      \"all extents (minimum/maximum X/Y/Z) are required.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new OrientedBoundingBox();\n  }\n\n  const halfAxes = result.halfAxes;\n  Matrix3.setColumn(halfAxes, 0, planeXAxis, halfAxes);\n  Matrix3.setColumn(halfAxes, 1, planeYAxis, halfAxes);\n  Matrix3.setColumn(halfAxes, 2, planeZAxis, halfAxes);\n\n  let centerOffset = scratchOffset;\n  centerOffset.x = (minimumX + maximumX) / 2.0;\n  centerOffset.y = (minimumY + maximumY) / 2.0;\n  centerOffset.z = (minimumZ + maximumZ) / 2.0;\n\n  const scale = scratchScale;\n  scale.x = (maximumX - minimumX) / 2.0;\n  scale.y = (maximumY - minimumY) / 2.0;\n  scale.z = (maximumZ - minimumZ) / 2.0;\n\n  const center = result.center;\n  centerOffset = Matrix3.multiplyByVector(halfAxes, centerOffset, centerOffset);\n  Cartesian3.add(planeOrigin, centerOffset, center);\n  Matrix3.multiplyByScale(halfAxes, scale, halfAxes);\n\n  return result;\n}\n\nconst scratchRectangleCenterCartographic = new Cartographic();\nconst scratchRectangleCenter = new Cartesian3();\nconst scratchPerimeterCartographicNC = new Cartographic();\nconst scratchPerimeterCartographicNW = new Cartographic();\nconst scratchPerimeterCartographicCW = new Cartographic();\nconst scratchPerimeterCartographicSW = new Cartographic();\nconst scratchPerimeterCartographicSC = new Cartographic();\nconst scratchPerimeterCartesianNC = new Cartesian3();\nconst scratchPerimeterCartesianNW = new Cartesian3();\nconst scratchPerimeterCartesianCW = new Cartesian3();\nconst scratchPerimeterCartesianSW = new Cartesian3();\nconst scratchPerimeterCartesianSC = new Cartesian3();\nconst scratchPerimeterProjectedNC = new Cartesian2();\nconst scratchPerimeterProjectedNW = new Cartesian2();\nconst scratchPerimeterProjectedCW = new Cartesian2();\nconst scratchPerimeterProjectedSW = new Cartesian2();\nconst scratchPerimeterProjectedSC = new Cartesian2();\n\nconst scratchPlaneOrigin = new Cartesian3();\nconst scratchPlaneNormal = new Cartesian3();\nconst scratchPlaneXAxis = new Cartesian3();\nconst scratchHorizonCartesian = new Cartesian3();\nconst scratchHorizonProjected = new Cartesian2();\nconst scratchMaxY = new Cartesian3();\nconst scratchMinY = new Cartesian3();\nconst scratchZ = new Cartesian3();\nconst scratchPlane = new Plane(Cartesian3.UNIT_X, 0.0);\n\n/**\n * Computes an OrientedBoundingBox that bounds a {@link Rectangle} on the surface of an {@link Ellipsoid}.\n * There are no guarantees about the orientation of the bounding box.\n *\n * @param {Rectangle} rectangle The cartographic rectangle on the surface of the ellipsoid.\n * @param {number} [minimumHeight=0.0] The minimum height (elevation) within the tile.\n * @param {number} [maximumHeight=0.0] The maximum height (elevation) within the tile.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle is defined.\n * @param {OrientedBoundingBox} [result] The object onto which to store the result.\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if none was provided.\n *\n * @exception {DeveloperError} rectangle.width must be between 0 and 2 * pi.\n * @exception {DeveloperError} rectangle.height must be between 0 and pi.\n * @exception {DeveloperError} ellipsoid must be an ellipsoid of revolution (<code>radii.x == radii.y</code>)\n */\nOrientedBoundingBox.fromRectangle = function (\n  rectangle,\n  minimumHeight,\n  maximumHeight,\n  ellipsoid,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(rectangle)) {\n    throw new DeveloperError(\"rectangle is required\");\n  }\n  if (rectangle.width < 0.0 || rectangle.width > CesiumMath.TWO_PI) {\n    throw new DeveloperError(\"Rectangle width must be between 0 and 2 * pi\");\n  }\n  if (rectangle.height < 0.0 || rectangle.height > CesiumMath.PI) {\n    throw new DeveloperError(\"Rectangle height must be between 0 and pi\");\n  }\n  if (\n    defined(ellipsoid) &&\n    !CesiumMath.equalsEpsilon(\n      ellipsoid.radii.x,\n      ellipsoid.radii.y,\n      CesiumMath.EPSILON15\n    )\n  ) {\n    throw new DeveloperError(\n      \"Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  minimumHeight = defaultValue(minimumHeight, 0.0);\n  maximumHeight = defaultValue(maximumHeight, 0.0);\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n  let minX, maxX, minY, maxY, minZ, maxZ, plane;\n\n  if (rectangle.width <= CesiumMath.PI) {\n    // The bounding box will be aligned with the tangent plane at the center of the rectangle.\n    const tangentPointCartographic = Rectangle.center(\n      rectangle,\n      scratchRectangleCenterCartographic\n    );\n    const tangentPoint = ellipsoid.cartographicToCartesian(\n      tangentPointCartographic,\n      scratchRectangleCenter\n    );\n    const tangentPlane = new EllipsoidTangentPlane(tangentPoint, ellipsoid);\n    plane = tangentPlane.plane;\n\n    // If the rectangle spans the equator, CW is instead aligned with the equator (because it sticks out the farthest at the equator).\n    const lonCenter = tangentPointCartographic.longitude;\n    const latCenter =\n      rectangle.south < 0.0 && rectangle.north > 0.0\n        ? 0.0\n        : tangentPointCartographic.latitude;\n\n    // Compute XY extents using the rectangle at maximum height\n    const perimeterCartographicNC = Cartographic.fromRadians(\n      lonCenter,\n      rectangle.north,\n      maximumHeight,\n      scratchPerimeterCartographicNC\n    );\n    const perimeterCartographicNW = Cartographic.fromRadians(\n      rectangle.west,\n      rectangle.north,\n      maximumHeight,\n      scratchPerimeterCartographicNW\n    );\n    const perimeterCartographicCW = Cartographic.fromRadians(\n      rectangle.west,\n      latCenter,\n      maximumHeight,\n      scratchPerimeterCartographicCW\n    );\n    const perimeterCartographicSW = Cartographic.fromRadians(\n      rectangle.west,\n      rectangle.south,\n      maximumHeight,\n      scratchPerimeterCartographicSW\n    );\n    const perimeterCartographicSC = Cartographic.fromRadians(\n      lonCenter,\n      rectangle.south,\n      maximumHeight,\n      scratchPerimeterCartographicSC\n    );\n\n    const perimeterCartesianNC = ellipsoid.cartographicToCartesian(\n      perimeterCartographicNC,\n      scratchPerimeterCartesianNC\n    );\n    let perimeterCartesianNW = ellipsoid.cartographicToCartesian(\n      perimeterCartographicNW,\n      scratchPerimeterCartesianNW\n    );\n    const perimeterCartesianCW = ellipsoid.cartographicToCartesian(\n      perimeterCartographicCW,\n      scratchPerimeterCartesianCW\n    );\n    let perimeterCartesianSW = ellipsoid.cartographicToCartesian(\n      perimeterCartographicSW,\n      scratchPerimeterCartesianSW\n    );\n    const perimeterCartesianSC = ellipsoid.cartographicToCartesian(\n      perimeterCartographicSC,\n      scratchPerimeterCartesianSC\n    );\n\n    const perimeterProjectedNC = tangentPlane.projectPointToNearestOnPlane(\n      perimeterCartesianNC,\n      scratchPerimeterProjectedNC\n    );\n    const perimeterProjectedNW = tangentPlane.projectPointToNearestOnPlane(\n      perimeterCartesianNW,\n      scratchPerimeterProjectedNW\n    );\n    const perimeterProjectedCW = tangentPlane.projectPointToNearestOnPlane(\n      perimeterCartesianCW,\n      scratchPerimeterProjectedCW\n    );\n    const perimeterProjectedSW = tangentPlane.projectPointToNearestOnPlane(\n      perimeterCartesianSW,\n      scratchPerimeterProjectedSW\n    );\n    const perimeterProjectedSC = tangentPlane.projectPointToNearestOnPlane(\n      perimeterCartesianSC,\n      scratchPerimeterProjectedSC\n    );\n\n    minX = Math.min(\n      perimeterProjectedNW.x,\n      perimeterProjectedCW.x,\n      perimeterProjectedSW.x\n    );\n    maxX = -minX; // symmetrical\n\n    maxY = Math.max(perimeterProjectedNW.y, perimeterProjectedNC.y);\n    minY = Math.min(perimeterProjectedSW.y, perimeterProjectedSC.y);\n\n    // Compute minimum Z using the rectangle at minimum height, since it will be deeper than the maximum height\n    perimeterCartographicNW.height = perimeterCartographicSW.height = minimumHeight;\n    perimeterCartesianNW = ellipsoid.cartographicToCartesian(\n      perimeterCartographicNW,\n      scratchPerimeterCartesianNW\n    );\n    perimeterCartesianSW = ellipsoid.cartographicToCartesian(\n      perimeterCartographicSW,\n      scratchPerimeterCartesianSW\n    );\n\n    minZ = Math.min(\n      Plane.getPointDistance(plane, perimeterCartesianNW),\n      Plane.getPointDistance(plane, perimeterCartesianSW)\n    );\n    maxZ = maximumHeight; // Since the tangent plane touches the surface at height = 0, this is okay\n\n    return fromPlaneExtents(\n      tangentPlane.origin,\n      tangentPlane.xAxis,\n      tangentPlane.yAxis,\n      tangentPlane.zAxis,\n      minX,\n      maxX,\n      minY,\n      maxY,\n      minZ,\n      maxZ,\n      result\n    );\n  }\n\n  // Handle the case where rectangle width is greater than PI (wraps around more than half the ellipsoid).\n  const fullyAboveEquator = rectangle.south > 0.0;\n  const fullyBelowEquator = rectangle.north < 0.0;\n  const latitudeNearestToEquator = fullyAboveEquator\n    ? rectangle.south\n    : fullyBelowEquator\n    ? rectangle.north\n    : 0.0;\n  const centerLongitude = Rectangle.center(\n    rectangle,\n    scratchRectangleCenterCartographic\n  ).longitude;\n\n  // Plane is located at the rectangle's center longitude and the rectangle's latitude that is closest to the equator. It rotates around the Z axis.\n  // This results in a better fit than the obb approach for smaller rectangles, which orients with the rectangle's center normal.\n  const planeOrigin = Cartesian3.fromRadians(\n    centerLongitude,\n    latitudeNearestToEquator,\n    maximumHeight,\n    ellipsoid,\n    scratchPlaneOrigin\n  );\n  planeOrigin.z = 0.0; // center the plane on the equator to simpify plane normal calculation\n  const isPole =\n    Math.abs(planeOrigin.x) < CesiumMath.EPSILON10 &&\n    Math.abs(planeOrigin.y) < CesiumMath.EPSILON10;\n  const planeNormal = !isPole\n    ? Cartesian3.normalize(planeOrigin, scratchPlaneNormal)\n    : Cartesian3.UNIT_X;\n  const planeYAxis = Cartesian3.UNIT_Z;\n  const planeXAxis = Cartesian3.cross(\n    planeNormal,\n    planeYAxis,\n    scratchPlaneXAxis\n  );\n  plane = Plane.fromPointNormal(planeOrigin, planeNormal, scratchPlane);\n\n  // Get the horizon point relative to the center. This will be the farthest extent in the plane's X dimension.\n  const horizonCartesian = Cartesian3.fromRadians(\n    centerLongitude + CesiumMath.PI_OVER_TWO,\n    latitudeNearestToEquator,\n    maximumHeight,\n    ellipsoid,\n    scratchHorizonCartesian\n  );\n  maxX = Cartesian3.dot(\n    Plane.projectPointOntoPlane(\n      plane,\n      horizonCartesian,\n      scratchHorizonProjected\n    ),\n    planeXAxis\n  );\n  minX = -maxX; // symmetrical\n\n  // Get the min and max Y, using the height that will give the largest extent\n  maxY = Cartesian3.fromRadians(\n    0.0,\n    rectangle.north,\n    fullyBelowEquator ? minimumHeight : maximumHeight,\n    ellipsoid,\n    scratchMaxY\n  ).z;\n  minY = Cartesian3.fromRadians(\n    0.0,\n    rectangle.south,\n    fullyAboveEquator ? minimumHeight : maximumHeight,\n    ellipsoid,\n    scratchMinY\n  ).z;\n\n  const farZ = Cartesian3.fromRadians(\n    rectangle.east,\n    latitudeNearestToEquator,\n    maximumHeight,\n    ellipsoid,\n    scratchZ\n  );\n  minZ = Plane.getPointDistance(plane, farZ);\n  maxZ = 0.0; // plane origin starts at maxZ already\n\n  // min and max are local to the plane axes\n  return fromPlaneExtents(\n    planeOrigin,\n    planeXAxis,\n    planeYAxis,\n    planeNormal,\n    minX,\n    maxX,\n    minY,\n    maxY,\n    minZ,\n    maxZ,\n    result\n  );\n};\n\n/**\n * Computes an OrientedBoundingBox that bounds an affine transformation.\n *\n * @param {Matrix4} transformation The affine transformation.\n * @param {OrientedBoundingBox} [result] The object onto which to store the result.\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if none was provided.\n */\nOrientedBoundingBox.fromTransformation = function (transformation, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"transformation\", transformation);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new OrientedBoundingBox();\n  }\n\n  result.center = Matrix4.getTranslation(transformation, result.center);\n  result.halfAxes = Matrix4.getMatrix3(transformation, result.halfAxes);\n  result.halfAxes = Matrix3.multiplyByScalar(\n    result.halfAxes,\n    0.5,\n    result.halfAxes\n  );\n  return result;\n};\n\n/**\n * Duplicates a OrientedBoundingBox instance.\n *\n * @param {OrientedBoundingBox} box The bounding box to duplicate.\n * @param {OrientedBoundingBox} [result] The object onto which to store the result.\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if none was provided. (Returns undefined if box is undefined)\n */\nOrientedBoundingBox.clone = function (box, result) {\n  if (!defined(box)) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    return new OrientedBoundingBox(box.center, box.halfAxes);\n  }\n\n  Cartesian3.clone(box.center, result.center);\n  Matrix3.clone(box.halfAxes, result.halfAxes);\n\n  return result;\n};\n\n/**\n * Determines which side of a plane the oriented bounding box is located.\n *\n * @param {OrientedBoundingBox} box The oriented bounding box to test.\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\n *                      the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\n *                      on the opposite side, and {@link Intersect.INTERSECTING} if the box\n *                      intersects the plane.\n */\nOrientedBoundingBox.intersectPlane = function (box, plane) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(box)) {\n    throw new DeveloperError(\"box is required.\");\n  }\n\n  if (!defined(plane)) {\n    throw new DeveloperError(\"plane is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const center = box.center;\n  const normal = plane.normal;\n  const halfAxes = box.halfAxes;\n  const normalX = normal.x,\n    normalY = normal.y,\n    normalZ = normal.z;\n  // plane is used as if it is its normal; the first three components are assumed to be normalized\n  const radEffective =\n    Math.abs(\n      normalX * halfAxes[Matrix3.COLUMN0ROW0] +\n        normalY * halfAxes[Matrix3.COLUMN0ROW1] +\n        normalZ * halfAxes[Matrix3.COLUMN0ROW2]\n    ) +\n    Math.abs(\n      normalX * halfAxes[Matrix3.COLUMN1ROW0] +\n        normalY * halfAxes[Matrix3.COLUMN1ROW1] +\n        normalZ * halfAxes[Matrix3.COLUMN1ROW2]\n    ) +\n    Math.abs(\n      normalX * halfAxes[Matrix3.COLUMN2ROW0] +\n        normalY * halfAxes[Matrix3.COLUMN2ROW1] +\n        normalZ * halfAxes[Matrix3.COLUMN2ROW2]\n    );\n  const distanceToPlane = Cartesian3.dot(normal, center) + plane.distance;\n\n  if (distanceToPlane <= -radEffective) {\n    // The entire box is on the negative side of the plane normal\n    return Intersect.OUTSIDE;\n  } else if (distanceToPlane >= radEffective) {\n    // The entire box is on the positive side of the plane normal\n    return Intersect.INSIDE;\n  }\n  return Intersect.INTERSECTING;\n};\n\nconst scratchCartesianU = new Cartesian3();\nconst scratchCartesianV = new Cartesian3();\nconst scratchCartesianW = new Cartesian3();\nconst scratchValidAxis2 = new Cartesian3();\nconst scratchValidAxis3 = new Cartesian3();\nconst scratchPPrime = new Cartesian3();\n\n/**\n * Computes the estimated distance squared from the closest point on a bounding box to a point.\n *\n * @param {OrientedBoundingBox} box The box.\n * @param {Cartesian3} cartesian The point\n * @returns {number} The distance squared from the oriented bounding box to the point. Returns 0 if the point is inside the box.\n *\n * @example\n * // Sort bounding boxes from back to front\n * boxes.sort(function(a, b) {\n *     return Cesium.OrientedBoundingBox.distanceSquaredTo(b, camera.positionWC) - Cesium.OrientedBoundingBox.distanceSquaredTo(a, camera.positionWC);\n * });\n */\nOrientedBoundingBox.distanceSquaredTo = function (box, cartesian) {\n  // See Geometric Tools for Computer Graphics 10.4.2\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(box)) {\n    throw new DeveloperError(\"box is required.\");\n  }\n  if (!defined(cartesian)) {\n    throw new DeveloperError(\"cartesian is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const offset = Cartesian3.subtract(cartesian, box.center, scratchOffset);\n\n  const halfAxes = box.halfAxes;\n  let u = Matrix3.getColumn(halfAxes, 0, scratchCartesianU);\n  let v = Matrix3.getColumn(halfAxes, 1, scratchCartesianV);\n  let w = Matrix3.getColumn(halfAxes, 2, scratchCartesianW);\n\n  const uHalf = Cartesian3.magnitude(u);\n  const vHalf = Cartesian3.magnitude(v);\n  const wHalf = Cartesian3.magnitude(w);\n\n  let uValid = true;\n  let vValid = true;\n  let wValid = true;\n\n  if (uHalf > 0) {\n    Cartesian3.divideByScalar(u, uHalf, u);\n  } else {\n    uValid = false;\n  }\n\n  if (vHalf > 0) {\n    Cartesian3.divideByScalar(v, vHalf, v);\n  } else {\n    vValid = false;\n  }\n\n  if (wHalf > 0) {\n    Cartesian3.divideByScalar(w, wHalf, w);\n  } else {\n    wValid = false;\n  }\n\n  const numberOfDegenerateAxes = !uValid + !vValid + !wValid;\n  let validAxis1;\n  let validAxis2;\n  let validAxis3;\n\n  if (numberOfDegenerateAxes === 1) {\n    let degenerateAxis = u;\n    validAxis1 = v;\n    validAxis2 = w;\n    if (!vValid) {\n      degenerateAxis = v;\n      validAxis1 = u;\n    } else if (!wValid) {\n      degenerateAxis = w;\n      validAxis2 = u;\n    }\n\n    validAxis3 = Cartesian3.cross(validAxis1, validAxis2, scratchValidAxis3);\n\n    if (degenerateAxis === u) {\n      u = validAxis3;\n    } else if (degenerateAxis === v) {\n      v = validAxis3;\n    } else if (degenerateAxis === w) {\n      w = validAxis3;\n    }\n  } else if (numberOfDegenerateAxes === 2) {\n    validAxis1 = u;\n    if (vValid) {\n      validAxis1 = v;\n    } else if (wValid) {\n      validAxis1 = w;\n    }\n\n    let crossVector = Cartesian3.UNIT_Y;\n    if (crossVector.equalsEpsilon(validAxis1, CesiumMath.EPSILON3)) {\n      crossVector = Cartesian3.UNIT_X;\n    }\n\n    validAxis2 = Cartesian3.cross(validAxis1, crossVector, scratchValidAxis2);\n    Cartesian3.normalize(validAxis2, validAxis2);\n    validAxis3 = Cartesian3.cross(validAxis1, validAxis2, scratchValidAxis3);\n    Cartesian3.normalize(validAxis3, validAxis3);\n\n    if (validAxis1 === u) {\n      v = validAxis2;\n      w = validAxis3;\n    } else if (validAxis1 === v) {\n      w = validAxis2;\n      u = validAxis3;\n    } else if (validAxis1 === w) {\n      u = validAxis2;\n      v = validAxis3;\n    }\n  } else if (numberOfDegenerateAxes === 3) {\n    u = Cartesian3.UNIT_X;\n    v = Cartesian3.UNIT_Y;\n    w = Cartesian3.UNIT_Z;\n  }\n\n  const pPrime = scratchPPrime;\n  pPrime.x = Cartesian3.dot(offset, u);\n  pPrime.y = Cartesian3.dot(offset, v);\n  pPrime.z = Cartesian3.dot(offset, w);\n\n  let distanceSquared = 0.0;\n  let d;\n\n  if (pPrime.x < -uHalf) {\n    d = pPrime.x + uHalf;\n    distanceSquared += d * d;\n  } else if (pPrime.x > uHalf) {\n    d = pPrime.x - uHalf;\n    distanceSquared += d * d;\n  }\n\n  if (pPrime.y < -vHalf) {\n    d = pPrime.y + vHalf;\n    distanceSquared += d * d;\n  } else if (pPrime.y > vHalf) {\n    d = pPrime.y - vHalf;\n    distanceSquared += d * d;\n  }\n\n  if (pPrime.z < -wHalf) {\n    d = pPrime.z + wHalf;\n    distanceSquared += d * d;\n  } else if (pPrime.z > wHalf) {\n    d = pPrime.z - wHalf;\n    distanceSquared += d * d;\n  }\n\n  return distanceSquared;\n};\n\nconst scratchCorner = new Cartesian3();\nconst scratchToCenter = new Cartesian3();\n\n/**\n * The distances calculated by the vector from the center of the bounding box to position projected onto direction.\n * <br>\n * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the\n * closest and farthest planes from position that intersect the bounding box.\n *\n * @param {OrientedBoundingBox} box The bounding box to calculate the distance to.\n * @param {Cartesian3} position The position to calculate the distance from.\n * @param {Cartesian3} direction The direction from position.\n * @param {Interval} [result] A Interval to store the nearest and farthest distances.\n * @returns {Interval} The nearest and farthest distances on the bounding box from position in direction.\n */\nOrientedBoundingBox.computePlaneDistances = function (\n  box,\n  position,\n  direction,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(box)) {\n    throw new DeveloperError(\"box is required.\");\n  }\n\n  if (!defined(position)) {\n    throw new DeveloperError(\"position is required.\");\n  }\n\n  if (!defined(direction)) {\n    throw new DeveloperError(\"direction is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Interval();\n  }\n\n  let minDist = Number.POSITIVE_INFINITY;\n  let maxDist = Number.NEGATIVE_INFINITY;\n\n  const center = box.center;\n  const halfAxes = box.halfAxes;\n\n  const u = Matrix3.getColumn(halfAxes, 0, scratchCartesianU);\n  const v = Matrix3.getColumn(halfAxes, 1, scratchCartesianV);\n  const w = Matrix3.getColumn(halfAxes, 2, scratchCartesianW);\n\n  // project first corner\n  const corner = Cartesian3.add(u, v, scratchCorner);\n  Cartesian3.add(corner, w, corner);\n  Cartesian3.add(corner, center, corner);\n\n  const toCenter = Cartesian3.subtract(corner, position, scratchToCenter);\n  let mag = Cartesian3.dot(direction, toCenter);\n\n  minDist = Math.min(mag, minDist);\n  maxDist = Math.max(mag, maxDist);\n\n  // project second corner\n  Cartesian3.add(center, u, corner);\n  Cartesian3.add(corner, v, corner);\n  Cartesian3.subtract(corner, w, corner);\n\n  Cartesian3.subtract(corner, position, toCenter);\n  mag = Cartesian3.dot(direction, toCenter);\n\n  minDist = Math.min(mag, minDist);\n  maxDist = Math.max(mag, maxDist);\n\n  // project third corner\n  Cartesian3.add(center, u, corner);\n  Cartesian3.subtract(corner, v, corner);\n  Cartesian3.add(corner, w, corner);\n\n  Cartesian3.subtract(corner, position, toCenter);\n  mag = Cartesian3.dot(direction, toCenter);\n\n  minDist = Math.min(mag, minDist);\n  maxDist = Math.max(mag, maxDist);\n\n  // project fourth corner\n  Cartesian3.add(center, u, corner);\n  Cartesian3.subtract(corner, v, corner);\n  Cartesian3.subtract(corner, w, corner);\n\n  Cartesian3.subtract(corner, position, toCenter);\n  mag = Cartesian3.dot(direction, toCenter);\n\n  minDist = Math.min(mag, minDist);\n  maxDist = Math.max(mag, maxDist);\n\n  // project fifth corner\n  Cartesian3.subtract(center, u, corner);\n  Cartesian3.add(corner, v, corner);\n  Cartesian3.add(corner, w, corner);\n\n  Cartesian3.subtract(corner, position, toCenter);\n  mag = Cartesian3.dot(direction, toCenter);\n\n  minDist = Math.min(mag, minDist);\n  maxDist = Math.max(mag, maxDist);\n\n  // project sixth corner\n  Cartesian3.subtract(center, u, corner);\n  Cartesian3.add(corner, v, corner);\n  Cartesian3.subtract(corner, w, corner);\n\n  Cartesian3.subtract(corner, position, toCenter);\n  mag = Cartesian3.dot(direction, toCenter);\n\n  minDist = Math.min(mag, minDist);\n  maxDist = Math.max(mag, maxDist);\n\n  // project seventh corner\n  Cartesian3.subtract(center, u, corner);\n  Cartesian3.subtract(corner, v, corner);\n  Cartesian3.add(corner, w, corner);\n\n  Cartesian3.subtract(corner, position, toCenter);\n  mag = Cartesian3.dot(direction, toCenter);\n\n  minDist = Math.min(mag, minDist);\n  maxDist = Math.max(mag, maxDist);\n\n  // project eighth corner\n  Cartesian3.subtract(center, u, corner);\n  Cartesian3.subtract(corner, v, corner);\n  Cartesian3.subtract(corner, w, corner);\n\n  Cartesian3.subtract(corner, position, toCenter);\n  mag = Cartesian3.dot(direction, toCenter);\n\n  minDist = Math.min(mag, minDist);\n  maxDist = Math.max(mag, maxDist);\n\n  result.start = minDist;\n  result.stop = maxDist;\n  return result;\n};\n\nconst scratchXAxis = new Cartesian3();\nconst scratchYAxis = new Cartesian3();\nconst scratchZAxis = new Cartesian3();\n\n/**\n * Computes the eight corners of an oriented bounding box. The corners are ordered by (-X, -Y, -Z), (-X, -Y, +Z), (-X, +Y, -Z), (-X, +Y, +Z), (+X, -Y, -Z), (+X, -Y, +Z), (+X, +Y, -Z), (+X, +Y, +Z).\n *\n * @param {OrientedBoundingBox} box The oriented bounding box.\n * @param {Cartesian3[]} [result] An array of eight {@link Cartesian3} instances onto which to store the corners.\n * @returns {Cartesian3[]} The modified result parameter or a new array if none was provided.\n */\nOrientedBoundingBox.computeCorners = function (box, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"box\", box);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = [\n      new Cartesian3(),\n      new Cartesian3(),\n      new Cartesian3(),\n      new Cartesian3(),\n      new Cartesian3(),\n      new Cartesian3(),\n      new Cartesian3(),\n      new Cartesian3(),\n    ];\n  }\n\n  const center = box.center;\n  const halfAxes = box.halfAxes;\n  const xAxis = Matrix3.getColumn(halfAxes, 0, scratchXAxis);\n  const yAxis = Matrix3.getColumn(halfAxes, 1, scratchYAxis);\n  const zAxis = Matrix3.getColumn(halfAxes, 2, scratchZAxis);\n\n  Cartesian3.clone(center, result[0]);\n  Cartesian3.subtract(result[0], xAxis, result[0]);\n  Cartesian3.subtract(result[0], yAxis, result[0]);\n  Cartesian3.subtract(result[0], zAxis, result[0]);\n\n  Cartesian3.clone(center, result[1]);\n  Cartesian3.subtract(result[1], xAxis, result[1]);\n  Cartesian3.subtract(result[1], yAxis, result[1]);\n  Cartesian3.add(result[1], zAxis, result[1]);\n\n  Cartesian3.clone(center, result[2]);\n  Cartesian3.subtract(result[2], xAxis, result[2]);\n  Cartesian3.add(result[2], yAxis, result[2]);\n  Cartesian3.subtract(result[2], zAxis, result[2]);\n\n  Cartesian3.clone(center, result[3]);\n  Cartesian3.subtract(result[3], xAxis, result[3]);\n  Cartesian3.add(result[3], yAxis, result[3]);\n  Cartesian3.add(result[3], zAxis, result[3]);\n\n  Cartesian3.clone(center, result[4]);\n  Cartesian3.add(result[4], xAxis, result[4]);\n  Cartesian3.subtract(result[4], yAxis, result[4]);\n  Cartesian3.subtract(result[4], zAxis, result[4]);\n\n  Cartesian3.clone(center, result[5]);\n  Cartesian3.add(result[5], xAxis, result[5]);\n  Cartesian3.subtract(result[5], yAxis, result[5]);\n  Cartesian3.add(result[5], zAxis, result[5]);\n\n  Cartesian3.clone(center, result[6]);\n  Cartesian3.add(result[6], xAxis, result[6]);\n  Cartesian3.add(result[6], yAxis, result[6]);\n  Cartesian3.subtract(result[6], zAxis, result[6]);\n\n  Cartesian3.clone(center, result[7]);\n  Cartesian3.add(result[7], xAxis, result[7]);\n  Cartesian3.add(result[7], yAxis, result[7]);\n  Cartesian3.add(result[7], zAxis, result[7]);\n\n  return result;\n};\n\nconst scratchRotationScale = new Matrix3();\n\n/**\n * Computes a transformation matrix from an oriented bounding box.\n *\n * @param {OrientedBoundingBox} box The oriented bounding box.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new {@link Matrix4} instance if none was provided.\n */\nOrientedBoundingBox.computeTransformation = function (box, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"box\", box);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Matrix4();\n  }\n\n  const translation = box.center;\n  const rotationScale = Matrix3.multiplyByUniformScale(\n    box.halfAxes,\n    2.0,\n    scratchRotationScale\n  );\n  return Matrix4.fromRotationTranslation(rotationScale, translation, result);\n};\n\nconst scratchBoundingSphere = new BoundingSphere();\n\n/**\n * Determines whether or not a bounding box is hidden from view by the occluder.\n *\n * @param {OrientedBoundingBox} box The bounding box surrounding the occludee object.\n * @param {Occluder} occluder The occluder.\n * @returns {boolean} <code>true</code> if the box is not visible; otherwise <code>false</code>.\n */\nOrientedBoundingBox.isOccluded = function (box, occluder) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(box)) {\n    throw new DeveloperError(\"box is required.\");\n  }\n  if (!defined(occluder)) {\n    throw new DeveloperError(\"occluder is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const sphere = BoundingSphere.fromOrientedBoundingBox(\n    box,\n    scratchBoundingSphere\n  );\n\n  return !occluder.isBoundingSphereVisible(sphere);\n};\n\n/**\n * Determines which side of a plane the oriented bounding box is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\n *                      the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\n *                      on the opposite side, and {@link Intersect.INTERSECTING} if the box\n *                      intersects the plane.\n */\nOrientedBoundingBox.prototype.intersectPlane = function (plane) {\n  return OrientedBoundingBox.intersectPlane(this, plane);\n};\n\n/**\n * Computes the estimated distance squared from the closest point on a bounding box to a point.\n *\n * @param {Cartesian3} cartesian The point\n * @returns {number} The estimated distance squared from the bounding sphere to the point.\n *\n * @example\n * // Sort bounding boxes from back to front\n * boxes.sort(function(a, b) {\n *     return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);\n * });\n */\nOrientedBoundingBox.prototype.distanceSquaredTo = function (cartesian) {\n  return OrientedBoundingBox.distanceSquaredTo(this, cartesian);\n};\n\n/**\n * The distances calculated by the vector from the center of the bounding box to position projected onto direction.\n * <br>\n * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the\n * closest and farthest planes from position that intersect the bounding box.\n *\n * @param {Cartesian3} position The position to calculate the distance from.\n * @param {Cartesian3} direction The direction from position.\n * @param {Interval} [result] A Interval to store the nearest and farthest distances.\n * @returns {Interval} The nearest and farthest distances on the bounding box from position in direction.\n */\nOrientedBoundingBox.prototype.computePlaneDistances = function (\n  position,\n  direction,\n  result\n) {\n  return OrientedBoundingBox.computePlaneDistances(\n    this,\n    position,\n    direction,\n    result\n  );\n};\n\n/**\n * Computes the eight corners of an oriented bounding box. The corners are ordered by (-X, -Y, -Z), (-X, -Y, +Z), (-X, +Y, -Z), (-X, +Y, +Z), (+X, -Y, -Z), (+X, -Y, +Z), (+X, +Y, -Z), (+X, +Y, +Z).\n *\n * @param {Cartesian3[]} [result] An array of eight {@link Cartesian3} instances onto which to store the corners.\n * @returns {Cartesian3[]} The modified result parameter or a new array if none was provided.\n */\nOrientedBoundingBox.prototype.computeCorners = function (result) {\n  return OrientedBoundingBox.computeCorners(this, result);\n};\n\n/**\n * Computes a transformation matrix from an oriented bounding box.\n *\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new {@link Matrix4} instance if none was provided.\n */\nOrientedBoundingBox.prototype.computeTransformation = function (result) {\n  return OrientedBoundingBox.computeTransformation(this, result);\n};\n\n/**\n * Determines whether or not a bounding box is hidden from view by the occluder.\n *\n * @param {Occluder} occluder The occluder.\n * @returns {boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>.\n */\nOrientedBoundingBox.prototype.isOccluded = function (occluder) {\n  return OrientedBoundingBox.isOccluded(this, occluder);\n};\n\n/**\n * Compares the provided OrientedBoundingBox componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {OrientedBoundingBox} left The first OrientedBoundingBox.\n * @param {OrientedBoundingBox} right The second OrientedBoundingBox.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nOrientedBoundingBox.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      Cartesian3.equals(left.center, right.center) &&\n      Matrix3.equals(left.halfAxes, right.halfAxes))\n  );\n};\n\n/**\n * Duplicates this OrientedBoundingBox instance.\n *\n * @param {OrientedBoundingBox} [result] The object onto which to store the result.\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if one was not provided.\n */\nOrientedBoundingBox.prototype.clone = function (result) {\n  return OrientedBoundingBox.clone(this, result);\n};\n\n/**\n * Compares this OrientedBoundingBox against the provided OrientedBoundingBox componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {OrientedBoundingBox} [right] The right hand side OrientedBoundingBox.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nOrientedBoundingBox.prototype.equals = function (right) {\n  return OrientedBoundingBox.equals(this, right);\n};\nexport default OrientedBoundingBox;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport defined from \"./defined.js\";\n\n/**\n * @private\n */\nconst VerticalExaggeration = {};\n\n/**\n * Scales a height relative to an offset.\n *\n * @param {number} height The height.\n * @param {number} scale A scalar used to exaggerate the terrain. If the value is 1.0 there will be no effect.\n * @param {number} relativeHeight The height relative to which terrain is exaggerated. If the value is 0.0 terrain will be exaggerated relative to the ellipsoid surface.\n */\nVerticalExaggeration.getHeight = function (height, scale, relativeHeight) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!Number.isFinite(scale)) {\n    throw new DeveloperError(\"scale must be a finite number.\");\n  }\n  if (!Number.isFinite(relativeHeight)) {\n    throw new DeveloperError(\"relativeHeight must be a finite number.\");\n  }\n  //>>includeEnd('debug')\n  return (height - relativeHeight) * scale + relativeHeight;\n};\n\nconst scratchCartographic = new Cartesian3();\n\n/**\n * Scales a position by exaggeration.\n *\n * @param {Cartesian3} position The position.\n * @param {Ellipsoid} ellipsoid The ellipsoid.\n * @param {number} verticalExaggeration A scalar used to exaggerate the terrain. If the value is 1.0 there will be no effect.\n * @param {number} verticalExaggerationRelativeHeight The height relative to which terrain is exaggerated. If the value is 0.0 terrain will be exaggerated relative to the ellipsoid surface.\n * @param {Cartesian3} [result] The object onto which to store the result.\n */\nVerticalExaggeration.getPosition = function (\n  position,\n  ellipsoid,\n  verticalExaggeration,\n  verticalExaggerationRelativeHeight,\n  result\n) {\n  const cartographic = ellipsoid.cartesianToCartographic(\n    position,\n    scratchCartographic\n  );\n  // If the position is too near the center of the ellipsoid, exaggeration is undefined.\n  if (!defined(cartographic)) {\n    return Cartesian3.clone(position, result);\n  }\n  const newHeight = VerticalExaggeration.getHeight(\n    cartographic.height,\n    verticalExaggeration,\n    verticalExaggerationRelativeHeight\n  );\n  return Cartesian3.fromRadians(\n    cartographic.longitude,\n    cartographic.latitude,\n    newHeight,\n    ellipsoid,\n    result\n  );\n};\n\nexport default VerticalExaggeration;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 position3DHigh;\\n\\\nin vec3 position3DLow;\\n\\\nin float batchId;\\n\\\n\\n\\\n#ifdef EXTRUDED_GEOMETRY\\n\\\nin vec3 extrudeDirection;\\n\\\n\\n\\\nuniform float u_globeMinimumAltitude;\\n\\\n#endif // EXTRUDED_GEOMETRY\\n\\\n\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nout vec4 v_color;\\n\\\n#endif // PER_INSTANCE_COLOR\\n\\\n\\n\\\n#ifdef TEXTURE_COORDINATES\\n\\\n#ifdef SPHERICAL\\n\\\nout vec4 v_sphericalExtents;\\n\\\n#else // SPHERICAL\\n\\\nout vec2 v_inversePlaneExtents;\\n\\\nout vec4 v_westPlane;\\n\\\nout vec4 v_southPlane;\\n\\\n#endif // SPHERICAL\\n\\\nout vec3 v_uvMinAndSphericalLongitudeRotation;\\n\\\nout vec3 v_uMaxAndInverseDistance;\\n\\\nout vec3 v_vMaxAndInverseDistance;\\n\\\n#endif // TEXTURE_COORDINATES\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 position = czm_computePosition();\\n\\\n\\n\\\n#ifdef EXTRUDED_GEOMETRY\\n\\\n    float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));\\n\\\n    delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;\\n\\\n\\n\\\n    //extrudeDirection is zero for the top layer\\n\\\n    position = position + vec4(extrudeDirection * delta, 0.0);\\n\\\n#endif\\n\\\n\\n\\\n#ifdef TEXTURE_COORDINATES\\n\\\n#ifdef SPHERICAL\\n\\\n    v_sphericalExtents = czm_batchTable_sphericalExtents(batchId);\\n\\\n    v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);\\n\\\n#else // SPHERICAL\\n\\\n#ifdef COLUMBUS_VIEW_2D\\n\\\n    vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);\\n\\\n    vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);\\n\\\n\\n\\\n    // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w):\\n\\\n    // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts)\\n\\\n    // - existing \\\"east\\\" is on the wrong side of the world, far away (planes2D_high/low.w)\\n\\\n    // - so set \\\"east\\\" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow)\\n\\\n    vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));\\n\\\n    bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;\\n\\\n    planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);\\n\\\n    planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);\\n\\\n\\n\\\n    // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0)\\n\\\n    // - existing \\\"west\\\" is on the wrong side of the world, far away (planes2D_high/low.x)\\n\\\n    // - so set \\\"west\\\" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow)\\n\\\n    idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;\\n\\\n    idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));\\n\\\n    planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);\\n\\\n    planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);\\n\\\n\\n\\\n    vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;\\n\\\n    vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;\\n\\\n    vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;\\n\\\n#else // COLUMBUS_VIEW_2D\\n\\\n    // 3D case has smaller \\\"plane extents,\\\" so planes encoded as a 64 bit position and 2 vec3s for distances/direction\\n\\\n    vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;\\n\\\n    vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;\\n\\\n    vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;\\n\\\n#endif // COLUMBUS_VIEW_2D\\n\\\n\\n\\\n    vec3 eastWard = southEastCorner - southWestCorner;\\n\\\n    float eastExtent = length(eastWard);\\n\\\n    eastWard /= eastExtent;\\n\\\n\\n\\\n    vec3 northWard = northWestCorner - southWestCorner;\\n\\\n    float northExtent = length(northWard);\\n\\\n    northWard /= northExtent;\\n\\\n\\n\\\n    v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));\\n\\\n    v_southPlane = vec4(northWard, -dot(northWard, southWestCorner));\\n\\\n    v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);\\n\\\n#endif // SPHERICAL\\n\\\n    vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);\\n\\\n    vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);\\n\\\n\\n\\\n    v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);\\n\\\n    v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);\\n\\\n    v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;\\n\\\n#endif // TEXTURE_COORDINATES\\n\\\n\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\n    v_color = czm_batchTable_color(batchId);\\n\\\n#endif\\n\\\n\\n\\\n    gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef VECTOR_TILE\\n\\\nuniform vec4 u_highlightColor;\\n\\\n#endif\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n#ifdef VECTOR_TILE\\n\\\n    out_FragColor = czm_gammaCorrect(u_highlightColor);\\n\\\n#else\\n\\\n    out_FragColor = vec4(1.0);\\n\\\n#endif\\n\\\n    czm_writeDepthClamp();\\n\\\n}\\n\\\n\";\n", "/**\n * Whether a classification affects terrain, 3D Tiles or both.\n *\n * @enum {number}\n */\nconst ClassificationType = {\n  /**\n   * Only terrain will be classified.\n   *\n   * @type {number}\n   * @constant\n   */\n  TERRAIN: 0,\n  /**\n   * Only 3D Tiles will be classified.\n   *\n   * @type {number}\n   * @constant\n   */\n  CESIUM_3D_TILE: 1,\n  /**\n   * Both terrain and 3D Tiles will be classified.\n   *\n   * @type {number}\n   * @constant\n   */\n  BOTH: 2,\n};\n\n/**\n * @private\n */\nClassificationType.NUMBER_OF_CLASSIFICATION_TYPES = 3;\n\nexport default Object.freeze(ClassificationType);\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Determines the function used to compare two depths for the depth test.\n *\n * @enum {number}\n */\nconst DepthFunction = {\n  /**\n   * The depth test never passes.\n   *\n   * @type {number}\n   * @constant\n   */\n  NEVER: WebGLConstants.NEVER,\n\n  /**\n   * The depth test passes if the incoming depth is less than the stored depth.\n   *\n   * @type {number}\n   * @constant\n   */\n  LESS: WebGLConstants.LESS,\n\n  /**\n   * The depth test passes if the incoming depth is equal to the stored depth.\n   *\n   * @type {number}\n   * @constant\n   */\n  EQUAL: WebGLConstants.EQUAL,\n\n  /**\n   * The depth test passes if the incoming depth is less than or equal to the stored depth.\n   *\n   * @type {number}\n   * @constant\n   */\n  LESS_OR_EQUAL: WebGLConstants.LEQUAL,\n\n  /**\n   * The depth test passes if the incoming depth is greater than the stored depth.\n   *\n   * @type {number}\n   * @constant\n   */\n  GREATER: WebGLConstants.GREATER,\n\n  /**\n   * The depth test passes if the incoming depth is not equal to the stored depth.\n   *\n   * @type {number}\n   * @constant\n   */\n  NOT_EQUAL: WebGLConstants.NOTEQUAL,\n\n  /**\n   * The depth test passes if the incoming depth is greater than or equal to the stored depth.\n   *\n   * @type {number}\n   * @constant\n   */\n  GREATER_OR_EQUAL: WebGLConstants.GEQUAL,\n\n  /**\n   * The depth test always passes.\n   *\n   * @type {number}\n   * @constant\n   */\n  ALWAYS: WebGLConstants.ALWAYS,\n};\nexport default Object.freeze(DepthFunction);\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Subdivides an array into a number of smaller, equal sized arrays.\n *\n * @function subdivideArray\n *\n * @param {Array} array The array to divide.\n * @param {number} numberOfArrays The number of arrays to divide the provided array into.\n *\n * @exception {DeveloperError} numberOfArrays must be greater than 0.\n */\nfunction subdivideArray(array, numberOfArrays) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required.\");\n  }\n\n  if (!defined(numberOfArrays) || numberOfArrays < 1) {\n    throw new DeveloperError(\"numberOfArrays must be greater than 0.\");\n  }\n  //>>includeEnd('debug');\n\n  const result = [];\n  const len = array.length;\n  let i = 0;\n  while (i < len) {\n    const size = Math.ceil((len - i) / numberOfArrays--);\n    result.push(array.slice(i, i + size));\n    i += size;\n  }\n  return result;\n}\nexport default subdivideArray;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport combine from \"../Core/combine.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\n\n/**\n * Creates a texture to look up per instance attributes for batched primitives. For example, store each primitive's pick color in the texture.\n *\n * @alias BatchTable\n * @constructor\n * @private\n *\n * @param {Context} context The context in which the batch table is created.\n * @param {Object[]} attributes An array of objects describing a per instance attribute. Each object contains a datatype, components per attributes, whether it is normalized and a function name\n *     to retrieve the value in the vertex shader.\n * @param {number} numberOfInstances The number of instances in a batch table.\n *\n * @example\n * // create the batch table\n * const attributes = [{\n *     functionName : 'getShow',\n *     componentDatatype : ComponentDatatype.UNSIGNED_BYTE,\n *     componentsPerAttribute : 1\n * }, {\n *     functionName : 'getPickColor',\n *     componentDatatype : ComponentDatatype.UNSIGNED_BYTE,\n *     componentsPerAttribute : 4,\n *     normalize : true\n * }];\n * const batchTable = new BatchTable(context, attributes, 5);\n *\n * // when creating the draw commands, update the uniform map and the vertex shader\n * vertexShaderSource = batchTable.getVertexShaderCallback()(vertexShaderSource);\n * const shaderProgram = ShaderProgram.fromCache({\n *    // ...\n *    vertexShaderSource : vertexShaderSource,\n * });\n *\n * drawCommand.shaderProgram = shaderProgram;\n * drawCommand.uniformMap = batchTable.getUniformMapCallback()(uniformMap);\n *\n * // use the attribute function names in the shader to retrieve the instance values\n * // ...\n * attribute float batchId;\n *\n * void main() {\n *     // ...\n *     float show = getShow(batchId);\n *     vec3 pickColor = getPickColor(batchId);\n *     // ...\n * }\n */\nfunction BatchTable(context, attributes, numberOfInstances) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(context)) {\n    throw new DeveloperError(\"context is required\");\n  }\n  if (!defined(attributes)) {\n    throw new DeveloperError(\"attributes is required\");\n  }\n  if (!defined(numberOfInstances)) {\n    throw new DeveloperError(\"numberOfInstances is required\");\n  }\n  //>>includeEnd('debug');\n\n  this._attributes = attributes;\n  this._numberOfInstances = numberOfInstances;\n\n  if (attributes.length === 0) {\n    return;\n  }\n\n  // PERFORMANCE_IDEA: We may be able to arrange the attributes so they can be packing into fewer texels.\n  // Right now, an attribute with one component uses an entire texel when 4 single component attributes can\n  // be packed into a texel.\n  //\n  // Packing floats into unsigned byte textures makes the problem worse. A single component float attribute\n  // will be packed into a single texel leaving 3 texels unused. 4 texels are reserved for each float attribute\n  // regardless of how many components it has.\n  const pixelDatatype = getDatatype(attributes);\n  const textureFloatSupported = context.floatingPointTexture;\n  const packFloats =\n    pixelDatatype === PixelDatatype.FLOAT && !textureFloatSupported;\n  const offsets = createOffsets(attributes, packFloats);\n\n  const stride = getStride(offsets, attributes, packFloats);\n  const maxNumberOfInstancesPerRow = Math.floor(\n    ContextLimits.maximumTextureSize / stride\n  );\n\n  const instancesPerWidth = Math.min(\n    numberOfInstances,\n    maxNumberOfInstancesPerRow\n  );\n  const width = stride * instancesPerWidth;\n  const height = Math.ceil(numberOfInstances / instancesPerWidth);\n\n  const stepX = 1.0 / width;\n  const centerX = stepX * 0.5;\n  const stepY = 1.0 / height;\n  const centerY = stepY * 0.5;\n\n  this._textureDimensions = new Cartesian2(width, height);\n  this._textureStep = new Cartesian4(stepX, centerX, stepY, centerY);\n  this._pixelDatatype = !packFloats\n    ? pixelDatatype\n    : PixelDatatype.UNSIGNED_BYTE;\n  this._packFloats = packFloats;\n  this._offsets = offsets;\n  this._stride = stride;\n  this._texture = undefined;\n\n  const batchLength = 4 * width * height;\n  this._batchValues =\n    pixelDatatype === PixelDatatype.FLOAT && !packFloats\n      ? new Float32Array(batchLength)\n      : new Uint8Array(batchLength);\n  this._batchValuesDirty = false;\n}\n\nObject.defineProperties(BatchTable.prototype, {\n  /**\n   * The attribute descriptions.\n   * @memberOf BatchTable.prototype\n   * @type {Object[]}\n   * @readonly\n   */\n  attributes: {\n    get: function () {\n      return this._attributes;\n    },\n  },\n  /**\n   * The number of instances.\n   * @memberOf BatchTable.prototype\n   * @type {number}\n   * @readonly\n   */\n  numberOfInstances: {\n    get: function () {\n      return this._numberOfInstances;\n    },\n  },\n});\n\nfunction getDatatype(attributes) {\n  let foundFloatDatatype = false;\n  const length = attributes.length;\n  for (let i = 0; i < length; ++i) {\n    if (attributes[i].componentDatatype !== ComponentDatatype.UNSIGNED_BYTE) {\n      foundFloatDatatype = true;\n      break;\n    }\n  }\n  return foundFloatDatatype ? PixelDatatype.FLOAT : PixelDatatype.UNSIGNED_BYTE;\n}\n\nfunction getAttributeType(attributes, attributeIndex) {\n  const componentsPerAttribute =\n    attributes[attributeIndex].componentsPerAttribute;\n  if (componentsPerAttribute === 2) {\n    return Cartesian2;\n  } else if (componentsPerAttribute === 3) {\n    return Cartesian3;\n  } else if (componentsPerAttribute === 4) {\n    return Cartesian4;\n  }\n  return Number;\n}\n\nfunction createOffsets(attributes, packFloats) {\n  const offsets = new Array(attributes.length);\n\n  let currentOffset = 0;\n  const attributesLength = attributes.length;\n  for (let i = 0; i < attributesLength; ++i) {\n    const attribute = attributes[i];\n    const componentDatatype = attribute.componentDatatype;\n\n    offsets[i] = currentOffset;\n\n    if (componentDatatype !== ComponentDatatype.UNSIGNED_BYTE && packFloats) {\n      currentOffset += 4;\n    } else {\n      ++currentOffset;\n    }\n  }\n\n  return offsets;\n}\n\nfunction getStride(offsets, attributes, packFloats) {\n  const length = offsets.length;\n  const lastOffset = offsets[length - 1];\n  const lastAttribute = attributes[length - 1];\n  const componentDatatype = lastAttribute.componentDatatype;\n\n  if (componentDatatype !== ComponentDatatype.UNSIGNED_BYTE && packFloats) {\n    return lastOffset + 4;\n  }\n  return lastOffset + 1;\n}\n\nconst scratchPackedFloatCartesian4 = new Cartesian4();\n\nfunction getPackedFloat(array, index, result) {\n  let packed = Cartesian4.unpack(array, index, scratchPackedFloatCartesian4);\n  const x = Cartesian4.unpackFloat(packed);\n\n  packed = Cartesian4.unpack(array, index + 4, scratchPackedFloatCartesian4);\n  const y = Cartesian4.unpackFloat(packed);\n\n  packed = Cartesian4.unpack(array, index + 8, scratchPackedFloatCartesian4);\n  const z = Cartesian4.unpackFloat(packed);\n\n  packed = Cartesian4.unpack(array, index + 12, scratchPackedFloatCartesian4);\n  const w = Cartesian4.unpackFloat(packed);\n\n  return Cartesian4.fromElements(x, y, z, w, result);\n}\n\nfunction setPackedAttribute(value, array, index) {\n  let packed = Cartesian4.packFloat(value.x, scratchPackedFloatCartesian4);\n  Cartesian4.pack(packed, array, index);\n\n  packed = Cartesian4.packFloat(value.y, packed);\n  Cartesian4.pack(packed, array, index + 4);\n\n  packed = Cartesian4.packFloat(value.z, packed);\n  Cartesian4.pack(packed, array, index + 8);\n\n  packed = Cartesian4.packFloat(value.w, packed);\n  Cartesian4.pack(packed, array, index + 12);\n}\n\nconst scratchGetAttributeCartesian4 = new Cartesian4();\n\n/**\n * Gets the value of an attribute in the table.\n *\n * @param {number} instanceIndex The index of the instance.\n * @param {number} attributeIndex The index of the attribute.\n * @param {undefined|Cartesian2|Cartesian3|Cartesian4} [result] The object onto which to store the result. The type is dependent on the attribute's number of components.\n * @returns {number|Cartesian2|Cartesian3|Cartesian4} The attribute value stored for the instance.\n *\n * @exception {DeveloperError} instanceIndex is out of range.\n * @exception {DeveloperError} attributeIndex is out of range.\n */\nBatchTable.prototype.getBatchedAttribute = function (\n  instanceIndex,\n  attributeIndex,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (instanceIndex < 0 || instanceIndex >= this._numberOfInstances) {\n    throw new DeveloperError(\"instanceIndex is out of range.\");\n  }\n  if (attributeIndex < 0 || attributeIndex >= this._attributes.length) {\n    throw new DeveloperError(\"attributeIndex is out of range\");\n  }\n  //>>includeEnd('debug');\n\n  const attributes = this._attributes;\n  const offset = this._offsets[attributeIndex];\n  const stride = this._stride;\n\n  const index = 4 * stride * instanceIndex + 4 * offset;\n  let value;\n\n  if (\n    this._packFloats &&\n    attributes[attributeIndex].componentDatatype !== PixelDatatype.UNSIGNED_BYTE\n  ) {\n    value = getPackedFloat(\n      this._batchValues,\n      index,\n      scratchGetAttributeCartesian4\n    );\n  } else {\n    value = Cartesian4.unpack(\n      this._batchValues,\n      index,\n      scratchGetAttributeCartesian4\n    );\n  }\n\n  const attributeType = getAttributeType(attributes, attributeIndex);\n  if (defined(attributeType.fromCartesian4)) {\n    return attributeType.fromCartesian4(value, result);\n  } else if (defined(attributeType.clone)) {\n    return attributeType.clone(value, result);\n  }\n\n  return value.x;\n};\n\nconst setAttributeScratchValues = [\n  undefined,\n  undefined,\n  new Cartesian2(),\n  new Cartesian3(),\n  new Cartesian4(),\n];\nconst setAttributeScratchCartesian4 = new Cartesian4();\n\n/**\n * Sets the value of an attribute in the table.\n *\n * @param {number} instanceIndex The index of the instance.\n * @param {number} attributeIndex The index of the attribute.\n * @param {number|Cartesian2|Cartesian3|Cartesian4} value The value to be stored in the table. The type of value will depend on the number of components of the attribute.\n *\n * @exception {DeveloperError} instanceIndex is out of range.\n * @exception {DeveloperError} attributeIndex is out of range.\n */\nBatchTable.prototype.setBatchedAttribute = function (\n  instanceIndex,\n  attributeIndex,\n  value\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (instanceIndex < 0 || instanceIndex >= this._numberOfInstances) {\n    throw new DeveloperError(\"instanceIndex is out of range.\");\n  }\n  if (attributeIndex < 0 || attributeIndex >= this._attributes.length) {\n    throw new DeveloperError(\"attributeIndex is out of range\");\n  }\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const attributes = this._attributes;\n  const result =\n    setAttributeScratchValues[\n      attributes[attributeIndex].componentsPerAttribute\n    ];\n  const currentAttribute = this.getBatchedAttribute(\n    instanceIndex,\n    attributeIndex,\n    result\n  );\n  const attributeType = getAttributeType(this._attributes, attributeIndex);\n  const entriesEqual = defined(attributeType.equals)\n    ? attributeType.equals(currentAttribute, value)\n    : currentAttribute === value;\n  if (entriesEqual) {\n    return;\n  }\n\n  const attributeValue = setAttributeScratchCartesian4;\n  attributeValue.x = defined(value.x) ? value.x : value;\n  attributeValue.y = defined(value.y) ? value.y : 0.0;\n  attributeValue.z = defined(value.z) ? value.z : 0.0;\n  attributeValue.w = defined(value.w) ? value.w : 0.0;\n\n  const offset = this._offsets[attributeIndex];\n  const stride = this._stride;\n  const index = 4 * stride * instanceIndex + 4 * offset;\n\n  if (\n    this._packFloats &&\n    attributes[attributeIndex].componentDatatype !== PixelDatatype.UNSIGNED_BYTE\n  ) {\n    setPackedAttribute(attributeValue, this._batchValues, index);\n  } else {\n    Cartesian4.pack(attributeValue, this._batchValues, index);\n  }\n\n  this._batchValuesDirty = true;\n};\n\nfunction createTexture(batchTable, context) {\n  const dimensions = batchTable._textureDimensions;\n  batchTable._texture = new Texture({\n    context: context,\n    pixelFormat: PixelFormat.RGBA,\n    pixelDatatype: batchTable._pixelDatatype,\n    width: dimensions.x,\n    height: dimensions.y,\n    sampler: Sampler.NEAREST,\n    flipY: false,\n  });\n}\n\nfunction updateTexture(batchTable) {\n  const dimensions = batchTable._textureDimensions;\n  batchTable._texture.copyFrom({\n    source: {\n      width: dimensions.x,\n      height: dimensions.y,\n      arrayBufferView: batchTable._batchValues,\n    },\n  });\n}\n\n/**\n * Creates/updates the batch table texture.\n * @param {FrameState} frameState The frame state.\n *\n * @exception {RuntimeError} The floating point texture extension is required but not supported.\n */\nBatchTable.prototype.update = function (frameState) {\n  if (\n    (defined(this._texture) && !this._batchValuesDirty) ||\n    this._attributes.length === 0\n  ) {\n    return;\n  }\n\n  this._batchValuesDirty = false;\n\n  if (!defined(this._texture)) {\n    createTexture(this, frameState.context);\n  }\n  updateTexture(this);\n};\n\n/**\n * Gets a function that will update a uniform map to contain values for looking up values in the batch table.\n *\n * @returns {BatchTable.updateUniformMapCallback} A callback for updating uniform maps.\n */\nBatchTable.prototype.getUniformMapCallback = function () {\n  const that = this;\n  return function (uniformMap) {\n    if (that._attributes.length === 0) {\n      return uniformMap;\n    }\n\n    const batchUniformMap = {\n      batchTexture: function () {\n        return that._texture;\n      },\n      batchTextureDimensions: function () {\n        return that._textureDimensions;\n      },\n      batchTextureStep: function () {\n        return that._textureStep;\n      },\n    };\n    return combine(uniformMap, batchUniformMap);\n  };\n};\n\nfunction getGlslComputeSt(batchTable) {\n  const stride = batchTable._stride;\n\n  // GLSL batchId is zero-based: [0, numberOfInstances - 1]\n  if (batchTable._textureDimensions.y === 1) {\n    return (\n      `${\n        \"uniform vec4 batchTextureStep; \\n\" +\n        \"vec2 computeSt(float batchId) \\n\" +\n        \"{ \\n\" +\n        \"    float stepX = batchTextureStep.x; \\n\" +\n        \"    float centerX = batchTextureStep.y; \\n\" +\n        \"    float numberOfAttributes = float(\"\n      }${stride}); \\n` +\n      `    return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); \\n` +\n      `} \\n`\n    );\n  }\n\n  return (\n    `${\n      \"uniform vec4 batchTextureStep; \\n\" +\n      \"uniform vec2 batchTextureDimensions; \\n\" +\n      \"vec2 computeSt(float batchId) \\n\" +\n      \"{ \\n\" +\n      \"    float stepX = batchTextureStep.x; \\n\" +\n      \"    float centerX = batchTextureStep.y; \\n\" +\n      \"    float stepY = batchTextureStep.z; \\n\" +\n      \"    float centerY = batchTextureStep.w; \\n\" +\n      \"    float numberOfAttributes = float(\"\n    }${stride}); \\n` +\n    `    float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); \\n` +\n    `    float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); \\n` +\n    `    return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \\n` +\n    `} \\n`\n  );\n}\n\nfunction getComponentType(componentsPerAttribute) {\n  if (componentsPerAttribute === 1) {\n    return \"float\";\n  }\n  return `vec${componentsPerAttribute}`;\n}\n\nfunction getComponentSwizzle(componentsPerAttribute) {\n  if (componentsPerAttribute === 1) {\n    return \".x\";\n  } else if (componentsPerAttribute === 2) {\n    return \".xy\";\n  } else if (componentsPerAttribute === 3) {\n    return \".xyz\";\n  }\n  return \"\";\n}\n\nfunction getGlslAttributeFunction(batchTable, attributeIndex) {\n  const attributes = batchTable._attributes;\n  const attribute = attributes[attributeIndex];\n  const componentsPerAttribute = attribute.componentsPerAttribute;\n  const functionName = attribute.functionName;\n  const functionReturnType = getComponentType(componentsPerAttribute);\n  const functionReturnValue = getComponentSwizzle(componentsPerAttribute);\n\n  const offset = batchTable._offsets[attributeIndex];\n\n  let glslFunction =\n    `${functionReturnType} ${functionName}(float batchId) \\n` +\n    `{ \\n` +\n    `    vec2 st = computeSt(batchId); \\n` +\n    `    st.x += batchTextureStep.x * float(${offset}); \\n`;\n\n  if (\n    batchTable._packFloats &&\n    attribute.componentDatatype !== PixelDatatype.UNSIGNED_BYTE\n  ) {\n    glslFunction +=\n      \"vec4 textureValue; \\n\" +\n      \"textureValue.x = czm_unpackFloat(texture(batchTexture, st)); \\n\" +\n      \"textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \\n\" +\n      \"textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \\n\" +\n      \"textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \\n\";\n  } else {\n    glslFunction += \"    vec4 textureValue = texture(batchTexture, st); \\n\";\n  }\n\n  glslFunction += `    ${functionReturnType} value = textureValue${functionReturnValue}; \\n`;\n\n  if (\n    batchTable._pixelDatatype === PixelDatatype.UNSIGNED_BYTE &&\n    attribute.componentDatatype === ComponentDatatype.UNSIGNED_BYTE &&\n    !attribute.normalize\n  ) {\n    glslFunction += \"value *= 255.0; \\n\";\n  } else if (\n    batchTable._pixelDatatype === PixelDatatype.FLOAT &&\n    attribute.componentDatatype === ComponentDatatype.UNSIGNED_BYTE &&\n    attribute.normalize\n  ) {\n    glslFunction += \"value /= 255.0; \\n\";\n  }\n\n  glslFunction += \"    return value; \\n\" + \"} \\n\";\n  return glslFunction;\n}\n\n/**\n * Gets a function that will update a vertex shader to contain functions for looking up values in the batch table.\n *\n * @returns {BatchTable.updateVertexShaderSourceCallback} A callback for updating a vertex shader source.\n */\nBatchTable.prototype.getVertexShaderCallback = function () {\n  const attributes = this._attributes;\n  if (attributes.length === 0) {\n    return function (source) {\n      return source;\n    };\n  }\n\n  let batchTableShader = \"uniform highp sampler2D batchTexture; \\n\";\n  batchTableShader += `${getGlslComputeSt(this)}\\n`;\n\n  const length = attributes.length;\n  for (let i = 0; i < length; ++i) {\n    batchTableShader += getGlslAttributeFunction(this, i);\n  }\n\n  return function (source) {\n    const mainIndex = source.indexOf(\"void main\");\n    const beforeMain = source.substring(0, mainIndex);\n    const afterMain = source.substring(mainIndex);\n    return `${beforeMain}\\n${batchTableShader}\\n${afterMain}`;\n  };\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see BatchTable#destroy\n */\nBatchTable.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see BatchTable#isDestroyed\n */\nBatchTable.prototype.destroy = function () {\n  this._texture = this._texture && this._texture.destroy();\n  return destroyObject(this);\n};\n\n/**\n * A callback for updating uniform maps.\n * @callback BatchTable.updateUniformMapCallback\n *\n * @param {object} uniformMap The uniform map.\n * @returns {object} The new uniform map with properties for retrieving values from the batch table.\n */\n\n/**\n * A callback for updating a vertex shader source.\n * @callback BatchTable.updateVertexShaderSourceCallback\n *\n * @param {string} vertexShaderSource The vertex shader source.\n * @returns {string} The new vertex shader source with the functions for retrieving batch table values injected.\n */\nexport default BatchTable;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Check from \"../Core/Check.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix2 from \"../Core/Matrix2.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\n\n/**\n * An enum describing the attribute type for glTF and 3D Tiles.\n *\n * @enum {string}\n *\n * @private\n */\nconst AttributeType = {\n  /**\n   * The attribute is a single component.\n   *\n   * @type {string}\n   * @constant\n   */\n  SCALAR: \"SCALAR\",\n\n  /**\n   * The attribute is a two-component vector.\n   *\n   * @type {string}\n   * @constant\n   */\n  VEC2: \"VEC2\",\n\n  /**\n   * The attribute is a three-component vector.\n   *\n   * @type {string}\n   * @constant\n   */\n  VEC3: \"VEC3\",\n\n  /**\n   * The attribute is a four-component vector.\n   *\n   * @type {string}\n   * @constant\n   */\n  VEC4: \"VEC4\",\n\n  /**\n   * The attribute is a 2x2 matrix.\n   *\n   * @type {string}\n   * @constant\n   */\n  MAT2: \"MAT2\",\n\n  /**\n   * The attribute is a 3x3 matrix.\n   *\n   * @type {string}\n   * @constant\n   */\n  MAT3: \"MAT3\",\n\n  /**\n   * The attribute is a 4x4 matrix.\n   *\n   * @type {string}\n   * @constant\n   */\n  MAT4: \"MAT4\",\n};\n\n/**\n * Gets the scalar, vector, or matrix type for the attribute type.\n *\n * @param {AttributeType} attributeType The attribute type.\n * @returns {*} The math type.\n *\n * @private\n */\nAttributeType.getMathType = function (attributeType) {\n  switch (attributeType) {\n    case AttributeType.SCALAR:\n      return Number;\n    case AttributeType.VEC2:\n      return Cartesian2;\n    case AttributeType.VEC3:\n      return Cartesian3;\n    case AttributeType.VEC4:\n      return Cartesian4;\n    case AttributeType.MAT2:\n      return Matrix2;\n    case AttributeType.MAT3:\n      return Matrix3;\n    case AttributeType.MAT4:\n      return Matrix4;\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\"attributeType is not a valid value.\");\n    //>>includeEnd('debug');\n  }\n};\n\n/**\n * Gets the number of components per attribute.\n *\n * @param {AttributeType} attributeType The attribute type.\n * @returns {number} The number of components.\n *\n * @private\n */\nAttributeType.getNumberOfComponents = function (attributeType) {\n  switch (attributeType) {\n    case AttributeType.SCALAR:\n      return 1;\n    case AttributeType.VEC2:\n      return 2;\n    case AttributeType.VEC3:\n      return 3;\n    case AttributeType.VEC4:\n    case AttributeType.MAT2:\n      return 4;\n    case AttributeType.MAT3:\n      return 9;\n    case AttributeType.MAT4:\n      return 16;\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\"attributeType is not a valid value.\");\n    //>>includeEnd('debug');\n  }\n};\n\n/**\n * Get the number of attribute locations needed to fit this attribute. Most\n * types require one, but matrices require multiple attribute locations.\n *\n * @param {AttributeType} attributeType The attribute type.\n * @returns {number} The number of attribute locations needed in the shader\n *\n * @private\n */\nAttributeType.getAttributeLocationCount = function (attributeType) {\n  switch (attributeType) {\n    case AttributeType.SCALAR:\n    case AttributeType.VEC2:\n    case AttributeType.VEC3:\n    case AttributeType.VEC4:\n      return 1;\n    case AttributeType.MAT2:\n      return 2;\n    case AttributeType.MAT3:\n      return 3;\n    case AttributeType.MAT4:\n      return 4;\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\"attributeType is not a valid value.\");\n    //>>includeEnd('debug');\n  }\n};\n\n/**\n * Gets the GLSL type for the attribute type.\n *\n * @param {AttributeType} attributeType The attribute type.\n * @returns {string} The GLSL type for the attribute type.\n *\n * @private\n */\nAttributeType.getGlslType = function (attributeType) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"attributeType\", attributeType);\n  //>>includeEnd('debug');\n\n  switch (attributeType) {\n    case AttributeType.SCALAR:\n      return \"float\";\n    case AttributeType.VEC2:\n      return \"vec2\";\n    case AttributeType.VEC3:\n      return \"vec3\";\n    case AttributeType.VEC4:\n      return \"vec4\";\n    case AttributeType.MAT2:\n      return \"mat2\";\n    case AttributeType.MAT3:\n      return \"mat3\";\n    case AttributeType.MAT4:\n      return \"mat4\";\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\"attributeType is not a valid value.\");\n    //>>includeEnd('debug');\n  }\n};\n\nexport default Object.freeze(AttributeType);\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport Check from \"./Check.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport AttributeType from \"../Scene/AttributeType.js\";\n\nconst RIGHT_SHIFT = 1.0 / 256.0;\nconst LEFT_SHIFT = 256.0;\n\n/**\n * Attribute compression and decompression functions.\n *\n * @namespace AttributeCompression\n *\n * @private\n */\nconst AttributeCompression = {};\n\n/**\n * Encodes a normalized vector into 2 SNORM values in the range of [0-rangeMax] following the 'oct' encoding.\n *\n * Oct encoding is a compact representation of unit length vectors.\n * The 'oct' encoding is described in \"A Survey of Efficient Representations of Independent Unit Vectors\",\n * Cigolle et al 2014: {@link http://jcgt.org/published/0003/02/01/}\n *\n * @param {Cartesian3} vector The normalized vector to be compressed into 2 component 'oct' encoding.\n * @param {Cartesian2} result The 2 component oct-encoded unit length vector.\n * @param {number} rangeMax The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.\n * @returns {Cartesian2} The 2 component oct-encoded unit length vector.\n *\n * @exception {DeveloperError} vector must be normalized.\n *\n * @see AttributeCompression.octDecodeInRange\n */\nAttributeCompression.octEncodeInRange = function (vector, rangeMax, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"vector\", vector);\n  Check.defined(\"result\", result);\n  const magSquared = Cartesian3.magnitudeSquared(vector);\n  if (Math.abs(magSquared - 1.0) > CesiumMath.EPSILON6) {\n    throw new DeveloperError(\"vector must be normalized.\");\n  }\n  //>>includeEnd('debug');\n\n  result.x =\n    vector.x / (Math.abs(vector.x) + Math.abs(vector.y) + Math.abs(vector.z));\n  result.y =\n    vector.y / (Math.abs(vector.x) + Math.abs(vector.y) + Math.abs(vector.z));\n  if (vector.z < 0) {\n    const x = result.x;\n    const y = result.y;\n    result.x = (1.0 - Math.abs(y)) * CesiumMath.signNotZero(x);\n    result.y = (1.0 - Math.abs(x)) * CesiumMath.signNotZero(y);\n  }\n\n  result.x = CesiumMath.toSNorm(result.x, rangeMax);\n  result.y = CesiumMath.toSNorm(result.y, rangeMax);\n\n  return result;\n};\n\n/**\n * Encodes a normalized vector into 2 SNORM values in the range of [0-255] following the 'oct' encoding.\n *\n * @param {Cartesian3} vector The normalized vector to be compressed into 2 byte 'oct' encoding.\n * @param {Cartesian2} result The 2 byte oct-encoded unit length vector.\n * @returns {Cartesian2} The 2 byte oct-encoded unit length vector.\n *\n * @exception {DeveloperError} vector must be normalized.\n *\n * @see AttributeCompression.octEncodeInRange\n * @see AttributeCompression.octDecode\n */\nAttributeCompression.octEncode = function (vector, result) {\n  return AttributeCompression.octEncodeInRange(vector, 255, result);\n};\n\nconst octEncodeScratch = new Cartesian2();\nconst uint8ForceArray = new Uint8Array(1);\nfunction forceUint8(value) {\n  uint8ForceArray[0] = value;\n  return uint8ForceArray[0];\n}\n/**\n * @param {Cartesian3} vector The normalized vector to be compressed into 4 byte 'oct' encoding.\n * @param {Cartesian4} result The 4 byte oct-encoded unit length vector.\n * @returns {Cartesian4} The 4 byte oct-encoded unit length vector.\n *\n * @exception {DeveloperError} vector must be normalized.\n *\n * @see AttributeCompression.octEncodeInRange\n * @see AttributeCompression.octDecodeFromCartesian4\n */\nAttributeCompression.octEncodeToCartesian4 = function (vector, result) {\n  AttributeCompression.octEncodeInRange(vector, 65535, octEncodeScratch);\n  result.x = forceUint8(octEncodeScratch.x * RIGHT_SHIFT);\n  result.y = forceUint8(octEncodeScratch.x);\n  result.z = forceUint8(octEncodeScratch.y * RIGHT_SHIFT);\n  result.w = forceUint8(octEncodeScratch.y);\n  return result;\n};\n\n/**\n * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component vector.\n *\n * @param {number} x The x component of the oct-encoded unit length vector.\n * @param {number} y The y component of the oct-encoded unit length vector.\n * @param {number} rangeMax The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.\n * @param {Cartesian3} result The decoded and normalized vector\n * @returns {Cartesian3} The decoded and normalized vector.\n *\n * @exception {DeveloperError} x and y must be unsigned normalized integers between 0 and rangeMax.\n *\n * @see AttributeCompression.octEncodeInRange\n */\nAttributeCompression.octDecodeInRange = function (x, y, rangeMax, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"result\", result);\n  if (x < 0 || x > rangeMax || y < 0 || y > rangeMax) {\n    throw new DeveloperError(\n      `x and y must be unsigned normalized integers between 0 and ${rangeMax}`\n    );\n  }\n  //>>includeEnd('debug');\n\n  result.x = CesiumMath.fromSNorm(x, rangeMax);\n  result.y = CesiumMath.fromSNorm(y, rangeMax);\n  result.z = 1.0 - (Math.abs(result.x) + Math.abs(result.y));\n\n  if (result.z < 0.0) {\n    const oldVX = result.x;\n    result.x = (1.0 - Math.abs(result.y)) * CesiumMath.signNotZero(oldVX);\n    result.y = (1.0 - Math.abs(oldVX)) * CesiumMath.signNotZero(result.y);\n  }\n\n  return Cartesian3.normalize(result, result);\n};\n\n/**\n * Decodes a unit-length vector in 2 byte 'oct' encoding to a normalized 3-component vector.\n *\n * @param {number} x The x component of the oct-encoded unit length vector.\n * @param {number} y The y component of the oct-encoded unit length vector.\n * @param {Cartesian3} result The decoded and normalized vector.\n * @returns {Cartesian3} The decoded and normalized vector.\n *\n * @exception {DeveloperError} x and y must be an unsigned normalized integer between 0 and 255.\n *\n * @see AttributeCompression.octDecodeInRange\n */\nAttributeCompression.octDecode = function (x, y, result) {\n  return AttributeCompression.octDecodeInRange(x, y, 255, result);\n};\n\n/**\n * Decodes a unit-length vector in 4 byte 'oct' encoding to a normalized 3-component vector.\n *\n * @param {Cartesian4} encoded The oct-encoded unit length vector.\n * @param {Cartesian3} result The decoded and normalized vector.\n * @returns {Cartesian3} The decoded and normalized vector.\n *\n * @exception {DeveloperError} x, y, z, and w must be unsigned normalized integers between 0 and 255.\n *\n * @see AttributeCompression.octDecodeInRange\n * @see AttributeCompression.octEncodeToCartesian4\n */\nAttributeCompression.octDecodeFromCartesian4 = function (encoded, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"encoded\", encoded);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n  const x = encoded.x;\n  const y = encoded.y;\n  const z = encoded.z;\n  const w = encoded.w;\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    x < 0 ||\n    x > 255 ||\n    y < 0 ||\n    y > 255 ||\n    z < 0 ||\n    z > 255 ||\n    w < 0 ||\n    w > 255\n  ) {\n    throw new DeveloperError(\n      \"x, y, z, and w must be unsigned normalized integers between 0 and 255\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const xOct16 = x * LEFT_SHIFT + y;\n  const yOct16 = z * LEFT_SHIFT + w;\n  return AttributeCompression.octDecodeInRange(xOct16, yOct16, 65535, result);\n};\n\n/**\n * Packs an oct encoded vector into a single floating-point number.\n *\n * @param {Cartesian2} encoded The oct encoded vector.\n * @returns {number} The oct encoded vector packed into a single float.\n *\n */\nAttributeCompression.octPackFloat = function (encoded) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"encoded\", encoded);\n  //>>includeEnd('debug');\n  return 256.0 * encoded.x + encoded.y;\n};\n\nconst scratchEncodeCart2 = new Cartesian2();\n\n/**\n * Encodes a normalized vector into 2 SNORM values in the range of [0-255] following the 'oct' encoding and\n * stores those values in a single float-point number.\n *\n * @param {Cartesian3} vector The normalized vector to be compressed into 2 byte 'oct' encoding.\n * @returns {number} The 2 byte oct-encoded unit length vector.\n *\n * @exception {DeveloperError} vector must be normalized.\n */\nAttributeCompression.octEncodeFloat = function (vector) {\n  AttributeCompression.octEncode(vector, scratchEncodeCart2);\n  return AttributeCompression.octPackFloat(scratchEncodeCart2);\n};\n\n/**\n * Decodes a unit-length vector in 'oct' encoding packed in a floating-point number to a normalized 3-component vector.\n *\n * @param {number} value The oct-encoded unit length vector stored as a single floating-point number.\n * @param {Cartesian3} result The decoded and normalized vector\n * @returns {Cartesian3} The decoded and normalized vector.\n *\n */\nAttributeCompression.octDecodeFloat = function (value, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"value\", value);\n  //>>includeEnd('debug');\n\n  const temp = value / 256.0;\n  const x = Math.floor(temp);\n  const y = (temp - x) * 256.0;\n\n  return AttributeCompression.octDecode(x, y, result);\n};\n\n/**\n * Encodes three normalized vectors into 6 SNORM values in the range of [0-255] following the 'oct' encoding and\n * packs those into two floating-point numbers.\n *\n * @param {Cartesian3} v1 A normalized vector to be compressed.\n * @param {Cartesian3} v2 A normalized vector to be compressed.\n * @param {Cartesian3} v3 A normalized vector to be compressed.\n * @param {Cartesian2} result The 'oct' encoded vectors packed into two floating-point numbers.\n * @returns {Cartesian2} The 'oct' encoded vectors packed into two floating-point numbers.\n *\n */\nAttributeCompression.octPack = function (v1, v2, v3, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"v1\", v1);\n  Check.defined(\"v2\", v2);\n  Check.defined(\"v3\", v3);\n  Check.defined(\"result\", result);\n  //>>includeEnd('debug');\n\n  const encoded1 = AttributeCompression.octEncodeFloat(v1);\n  const encoded2 = AttributeCompression.octEncodeFloat(v2);\n\n  const encoded3 = AttributeCompression.octEncode(v3, scratchEncodeCart2);\n  result.x = 65536.0 * encoded3.x + encoded1;\n  result.y = 65536.0 * encoded3.y + encoded2;\n  return result;\n};\n\n/**\n * Decodes three unit-length vectors in 'oct' encoding packed into a floating-point number to a normalized 3-component vector.\n *\n * @param {Cartesian2} packed The three oct-encoded unit length vectors stored as two floating-point number.\n * @param {Cartesian3} v1 One decoded and normalized vector.\n * @param {Cartesian3} v2 One decoded and normalized vector.\n * @param {Cartesian3} v3 One decoded and normalized vector.\n */\nAttributeCompression.octUnpack = function (packed, v1, v2, v3) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"packed\", packed);\n  Check.defined(\"v1\", v1);\n  Check.defined(\"v2\", v2);\n  Check.defined(\"v3\", v3);\n  //>>includeEnd('debug');\n\n  let temp = packed.x / 65536.0;\n  const x = Math.floor(temp);\n  const encodedFloat1 = (temp - x) * 65536.0;\n\n  temp = packed.y / 65536.0;\n  const y = Math.floor(temp);\n  const encodedFloat2 = (temp - y) * 65536.0;\n\n  AttributeCompression.octDecodeFloat(encodedFloat1, v1);\n  AttributeCompression.octDecodeFloat(encodedFloat2, v2);\n  AttributeCompression.octDecode(x, y, v3);\n};\n\n/**\n * Pack texture coordinates into a single float. The texture coordinates will only preserve 12 bits of precision.\n *\n * @param {Cartesian2} textureCoordinates The texture coordinates to compress.  Both coordinates must be in the range 0.0-1.0.\n * @returns {number} The packed texture coordinates.\n *\n */\nAttributeCompression.compressTextureCoordinates = function (\n  textureCoordinates\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"textureCoordinates\", textureCoordinates);\n  //>>includeEnd('debug');\n\n  // Move x and y to the range 0-4095;\n  const x = (textureCoordinates.x * 4095.0) | 0;\n  const y = (textureCoordinates.y * 4095.0) | 0;\n  return 4096.0 * x + y;\n};\n\n/**\n * Decompresses texture coordinates that were packed into a single float.\n *\n * @param {number} compressed The compressed texture coordinates.\n * @param {Cartesian2} result The decompressed texture coordinates.\n * @returns {Cartesian2} The modified result parameter.\n *\n */\nAttributeCompression.decompressTextureCoordinates = function (\n  compressed,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"compressed\", compressed);\n  Check.defined(\"result\", result);\n  //>>includeEnd('debug');\n\n  const temp = compressed / 4096.0;\n  const xZeroTo4095 = Math.floor(temp);\n  result.x = xZeroTo4095 / 4095.0;\n  result.y = (compressed - xZeroTo4095 * 4096) / 4095;\n  return result;\n};\n\nfunction zigZagDecode(value) {\n  return (value >> 1) ^ -(value & 1);\n}\n\n/**\n * Decodes delta and ZigZag encoded vertices. This modifies the buffers in place.\n *\n * @param {Uint16Array} uBuffer The buffer view of u values.\n * @param {Uint16Array} vBuffer The buffer view of v values.\n * @param {Uint16Array} [heightBuffer] The buffer view of height values.\n *\n * @see {@link https://github.com/CesiumGS/quantized-mesh|quantized-mesh-1.0 terrain format}\n */\nAttributeCompression.zigZagDeltaDecode = function (\n  uBuffer,\n  vBuffer,\n  heightBuffer\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"uBuffer\", uBuffer);\n  Check.defined(\"vBuffer\", vBuffer);\n  Check.typeOf.number.equals(\n    \"uBuffer.length\",\n    \"vBuffer.length\",\n    uBuffer.length,\n    vBuffer.length\n  );\n  if (defined(heightBuffer)) {\n    Check.typeOf.number.equals(\n      \"uBuffer.length\",\n      \"heightBuffer.length\",\n      uBuffer.length,\n      heightBuffer.length\n    );\n  }\n  //>>includeEnd('debug');\n\n  const count = uBuffer.length;\n\n  let u = 0;\n  let v = 0;\n  let height = 0;\n\n  for (let i = 0; i < count; ++i) {\n    u += zigZagDecode(uBuffer[i]);\n    v += zigZagDecode(vBuffer[i]);\n\n    uBuffer[i] = u;\n    vBuffer[i] = v;\n\n    if (defined(heightBuffer)) {\n      height += zigZagDecode(heightBuffer[i]);\n      heightBuffer[i] = height;\n    }\n  }\n};\n\n/**\n * Dequantizes a quantized typed array into a floating point typed array.\n *\n * @see {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization#encoding-quantized-data}\n *\n * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array} typedArray The typed array for the quantized data.\n * @param {ComponentDatatype} componentDatatype The component datatype of the quantized data.\n * @param {AttributeType} type The attribute type of the quantized data.\n * @param {number} count The number of attributes referenced in the dequantized array.\n *\n * @returns {Float32Array} The dequantized array.\n */\nAttributeCompression.dequantize = function (\n  typedArray,\n  componentDatatype,\n  type,\n  count\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"typedArray\", typedArray);\n  Check.defined(\"componentDatatype\", componentDatatype);\n  Check.defined(\"type\", type);\n  Check.defined(\"count\", count);\n  //>>includeEnd('debug');\n\n  const componentsPerAttribute = AttributeType.getNumberOfComponents(type);\n\n  let divisor;\n  switch (componentDatatype) {\n    case ComponentDatatype.BYTE:\n      divisor = 127.0;\n      break;\n    case ComponentDatatype.UNSIGNED_BYTE:\n      divisor = 255.0;\n      break;\n    case ComponentDatatype.SHORT:\n      divisor = 32767.0;\n      break;\n    case ComponentDatatype.UNSIGNED_SHORT:\n      divisor = 65535.0;\n      break;\n    case ComponentDatatype.INT:\n      divisor = 2147483647.0;\n      break;\n    case ComponentDatatype.UNSIGNED_INT:\n      divisor = 4294967295.0;\n      break;\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\n        `Cannot dequantize component datatype: ${componentDatatype}`\n      );\n    //>>includeEnd('debug');\n  }\n\n  const dequantizedTypedArray = new Float32Array(\n    count * componentsPerAttribute\n  );\n\n  for (let i = 0; i < count; i++) {\n    for (let j = 0; j < componentsPerAttribute; j++) {\n      const index = i * componentsPerAttribute + j;\n      dequantizedTypedArray[index] = Math.max(\n        typedArray[index] / divisor,\n        -1.0\n      );\n    }\n  }\n\n  return dequantizedTypedArray;\n};\n\n/**\n * Decode RGB565-encoded colors into a floating point typed array containing\n * normalized RGB values.\n *\n * @param {Uint16Array} typedArray Array of RGB565 values\n * @param {Float32Array} [result] Array to store the normalized VEC3 result\n */\nAttributeCompression.decodeRGB565 = function (typedArray, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"typedArray\", typedArray);\n\n  const expectedLength = typedArray.length * 3;\n  if (defined(result)) {\n    Check.typeOf.number.equals(\n      \"result.length\",\n      \"typedArray.length * 3\",\n      result.length,\n      expectedLength\n    );\n  }\n  //>>includeEnd('debug');\n\n  const count = typedArray.length;\n  if (!defined(result)) {\n    result = new Float32Array(count * 3);\n  }\n\n  const mask5 = (1 << 5) - 1;\n  const mask6 = (1 << 6) - 1;\n  const normalize5 = 1.0 / 31.0;\n  const normalize6 = 1.0 / 63.0;\n  for (let i = 0; i < count; i++) {\n    const value = typedArray[i];\n    const red = value >> 11;\n    const green = (value >> 5) & mask6;\n    const blue = value & mask5;\n\n    const offset = 3 * i;\n    result[offset] = red * normalize5;\n    result[offset + 1] = green * normalize6;\n    result[offset + 2] = blue * normalize5;\n  }\n\n  return result;\n};\n\nexport default AttributeCompression;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defined from \"./defined.js\";\nimport CesiumMath from \"./Math.js\";\n\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchCartesian3 = new Cartesian3();\n\n/**\n * Computes the barycentric coordinates for a point with respect to a triangle.\n *\n * @function\n *\n * @param {Cartesian2|Cartesian3} point The point to test.\n * @param {Cartesian2|Cartesian3} p0 The first point of the triangle, corresponding to the barycentric x-axis.\n * @param {Cartesian2|Cartesian3} p1 The second point of the triangle, corresponding to the barycentric y-axis.\n * @param {Cartesian2|Cartesian3} p2 The third point of the triangle, corresponding to the barycentric z-axis.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3|undefined} The modified result parameter or a new Cartesian3 instance if one was not provided. If the triangle is degenerate the function will return undefined.\n *\n * @example\n * // Returns Cartesian3.UNIT_X\n * const p = new Cesium.Cartesian3(-1.0, 0.0, 0.0);\n * const b = Cesium.barycentricCoordinates(p,\n *   new Cesium.Cartesian3(-1.0, 0.0, 0.0),\n *   new Cesium.Cartesian3( 1.0, 0.0, 0.0),\n *   new Cesium.Cartesian3( 0.0, 1.0, 1.0));\n */\nfunction barycentricCoordinates(point, p0, p1, p2, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"point\", point);\n  Check.defined(\"p0\", p0);\n  Check.defined(\"p1\", p1);\n  Check.defined(\"p2\", p2);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  // Implementation based on http://www.blackpawn.com/texts/pointinpoly/default.html.\n  let v0;\n  let v1;\n  let v2;\n  let dot00;\n  let dot01;\n  let dot02;\n  let dot11;\n  let dot12;\n\n  if (!defined(p0.z)) {\n    if (Cartesian2.equalsEpsilon(point, p0, CesiumMath.EPSILON14)) {\n      return Cartesian3.clone(Cartesian3.UNIT_X, result);\n    }\n    if (Cartesian2.equalsEpsilon(point, p1, CesiumMath.EPSILON14)) {\n      return Cartesian3.clone(Cartesian3.UNIT_Y, result);\n    }\n    if (Cartesian2.equalsEpsilon(point, p2, CesiumMath.EPSILON14)) {\n      return Cartesian3.clone(Cartesian3.UNIT_Z, result);\n    }\n\n    v0 = Cartesian2.subtract(p1, p0, scratchCartesian1);\n    v1 = Cartesian2.subtract(p2, p0, scratchCartesian2);\n    v2 = Cartesian2.subtract(point, p0, scratchCartesian3);\n\n    dot00 = Cartesian2.dot(v0, v0);\n    dot01 = Cartesian2.dot(v0, v1);\n    dot02 = Cartesian2.dot(v0, v2);\n    dot11 = Cartesian2.dot(v1, v1);\n    dot12 = Cartesian2.dot(v1, v2);\n  } else {\n    if (Cartesian3.equalsEpsilon(point, p0, CesiumMath.EPSILON14)) {\n      return Cartesian3.clone(Cartesian3.UNIT_X, result);\n    }\n    if (Cartesian3.equalsEpsilon(point, p1, CesiumMath.EPSILON14)) {\n      return Cartesian3.clone(Cartesian3.UNIT_Y, result);\n    }\n    if (Cartesian3.equalsEpsilon(point, p2, CesiumMath.EPSILON14)) {\n      return Cartesian3.clone(Cartesian3.UNIT_Z, result);\n    }\n\n    v0 = Cartesian3.subtract(p1, p0, scratchCartesian1);\n    v1 = Cartesian3.subtract(p2, p0, scratchCartesian2);\n    v2 = Cartesian3.subtract(point, p0, scratchCartesian3);\n\n    dot00 = Cartesian3.dot(v0, v0);\n    dot01 = Cartesian3.dot(v0, v1);\n    dot02 = Cartesian3.dot(v0, v2);\n    dot11 = Cartesian3.dot(v1, v1);\n    dot12 = Cartesian3.dot(v1, v2);\n  }\n\n  result.y = dot11 * dot02 - dot01 * dot12;\n  result.z = dot00 * dot12 - dot01 * dot02;\n  const q = dot00 * dot11 - dot01 * dot01;\n\n  // Triangle is degenerate\n  if (q === 0) {\n    return undefined;\n  }\n\n  result.y /= q;\n  result.z /= q;\n  result.x = 1.0 - result.y - result.z;\n  return result;\n}\nexport default barycentricCoordinates;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Encapsulates an algorithm to optimize triangles for the post\n * vertex-shader cache.  This is based on the 2007 SIGGRAPH paper\n * 'Fast Triangle Reordering for Vertex Locality and Reduced Overdraw.'\n * The runtime is linear but several passes are made.\n *\n * @namespace Tipsify\n *\n * @see <a href='http://gfx.cs.princeton.edu/pubs/Sander_2007_%3ETR/tipsy.pdf'>\n * Fast Triangle Reordering for Vertex Locality and Reduced Overdraw</a>\n * by Sander, Nehab, and Barczak\n *\n * @private\n */\nconst Tipsify = {};\n\n/**\n * Calculates the average cache miss ratio (ACMR) for a given set of indices.\n *\n * @param {object} options Object with the following properties:\n * @param {number[]} options.indices Lists triads of numbers corresponding to the indices of the vertices\n *                        in the vertex buffer that define the geometry's triangles.\n * @param {number} [options.maximumIndex] The maximum value of the elements in <code>args.indices</code>.\n *                                     If not supplied, this value will be computed.\n * @param {number} [options.cacheSize=24] The number of vertices that can be stored in the cache at any one time.\n * @returns {number} The average cache miss ratio (ACMR).\n *\n * @exception {DeveloperError} indices length must be a multiple of three.\n * @exception {DeveloperError} cacheSize must be greater than two.\n *\n * @example\n * const indices = [0, 1, 2, 3, 4, 5];\n * const maxIndex = 5;\n * const cacheSize = 3;\n * const acmr = Cesium.Tipsify.calculateACMR({indices : indices, maxIndex : maxIndex, cacheSize : cacheSize});\n */\nTipsify.calculateACMR = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const indices = options.indices;\n  let maximumIndex = options.maximumIndex;\n  const cacheSize = defaultValue(options.cacheSize, 24);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(indices)) {\n    throw new DeveloperError(\"indices is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const numIndices = indices.length;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (numIndices < 3 || numIndices % 3 !== 0) {\n    throw new DeveloperError(\"indices length must be a multiple of three.\");\n  }\n  if (maximumIndex <= 0) {\n    throw new DeveloperError(\"maximumIndex must be greater than zero.\");\n  }\n  if (cacheSize < 3) {\n    throw new DeveloperError(\"cacheSize must be greater than two.\");\n  }\n  //>>includeEnd('debug');\n\n  // Compute the maximumIndex if not given\n  if (!defined(maximumIndex)) {\n    maximumIndex = 0;\n    let currentIndex = 0;\n    let intoIndices = indices[currentIndex];\n    while (currentIndex < numIndices) {\n      if (intoIndices > maximumIndex) {\n        maximumIndex = intoIndices;\n      }\n      ++currentIndex;\n      intoIndices = indices[currentIndex];\n    }\n  }\n\n  // Vertex time stamps\n  const vertexTimeStamps = [];\n  for (let i = 0; i < maximumIndex + 1; i++) {\n    vertexTimeStamps[i] = 0;\n  }\n\n  // Cache processing\n  let s = cacheSize + 1;\n  for (let j = 0; j < numIndices; ++j) {\n    if (s - vertexTimeStamps[indices[j]] > cacheSize) {\n      vertexTimeStamps[indices[j]] = s;\n      ++s;\n    }\n  }\n\n  return (s - cacheSize + 1) / (numIndices / 3);\n};\n\n/**\n * Optimizes triangles for the post-vertex shader cache.\n *\n * @param {object} options Object with the following properties:\n * @param {number[]} options.indices Lists triads of numbers corresponding to the indices of the vertices\n *                        in the vertex buffer that define the geometry's triangles.\n * @param {number} [options.maximumIndex] The maximum value of the elements in <code>args.indices</code>.\n *                                     If not supplied, this value will be computed.\n * @param {number} [options.cacheSize=24] The number of vertices that can be stored in the cache at any one time.\n * @returns {number[]} A list of the input indices in an optimized order.\n *\n * @exception {DeveloperError} indices length must be a multiple of three.\n * @exception {DeveloperError} cacheSize must be greater than two.\n *\n * @example\n * const indices = [0, 1, 2, 3, 4, 5];\n * const maxIndex = 5;\n * const cacheSize = 3;\n * const reorderedIndices = Cesium.Tipsify.tipsify({indices : indices, maxIndex : maxIndex, cacheSize : cacheSize});\n */\nTipsify.tipsify = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const indices = options.indices;\n  const maximumIndex = options.maximumIndex;\n  const cacheSize = defaultValue(options.cacheSize, 24);\n\n  let cursor;\n\n  function skipDeadEnd(vertices, deadEnd, indices, maximumIndexPlusOne) {\n    while (deadEnd.length >= 1) {\n      // while the stack is not empty\n      const d = deadEnd[deadEnd.length - 1]; // top of the stack\n      deadEnd.splice(deadEnd.length - 1, 1); // pop the stack\n\n      if (vertices[d].numLiveTriangles > 0) {\n        return d;\n      }\n    }\n\n    while (cursor < maximumIndexPlusOne) {\n      if (vertices[cursor].numLiveTriangles > 0) {\n        ++cursor;\n        return cursor - 1;\n      }\n      ++cursor;\n    }\n    return -1;\n  }\n\n  function getNextVertex(\n    indices,\n    cacheSize,\n    oneRing,\n    vertices,\n    s,\n    deadEnd,\n    maximumIndexPlusOne\n  ) {\n    let n = -1;\n    let p;\n    let m = -1;\n    let itOneRing = 0;\n    while (itOneRing < oneRing.length) {\n      const index = oneRing[itOneRing];\n      if (vertices[index].numLiveTriangles) {\n        p = 0;\n        if (\n          s -\n            vertices[index].timeStamp +\n            2 * vertices[index].numLiveTriangles <=\n          cacheSize\n        ) {\n          p = s - vertices[index].timeStamp;\n        }\n        if (p > m || m === -1) {\n          m = p;\n          n = index;\n        }\n      }\n      ++itOneRing;\n    }\n    if (n === -1) {\n      return skipDeadEnd(vertices, deadEnd, indices, maximumIndexPlusOne);\n    }\n    return n;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(indices)) {\n    throw new DeveloperError(\"indices is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const numIndices = indices.length;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (numIndices < 3 || numIndices % 3 !== 0) {\n    throw new DeveloperError(\"indices length must be a multiple of three.\");\n  }\n  if (maximumIndex <= 0) {\n    throw new DeveloperError(\"maximumIndex must be greater than zero.\");\n  }\n  if (cacheSize < 3) {\n    throw new DeveloperError(\"cacheSize must be greater than two.\");\n  }\n  //>>includeEnd('debug');\n\n  // Determine maximum index\n  let maximumIndexPlusOne = 0;\n  let currentIndex = 0;\n  let intoIndices = indices[currentIndex];\n  const endIndex = numIndices;\n  if (defined(maximumIndex)) {\n    maximumIndexPlusOne = maximumIndex + 1;\n  } else {\n    while (currentIndex < endIndex) {\n      if (intoIndices > maximumIndexPlusOne) {\n        maximumIndexPlusOne = intoIndices;\n      }\n      ++currentIndex;\n      intoIndices = indices[currentIndex];\n    }\n    if (maximumIndexPlusOne === -1) {\n      return 0;\n    }\n    ++maximumIndexPlusOne;\n  }\n\n  // Vertices\n  const vertices = [];\n  let i;\n  for (i = 0; i < maximumIndexPlusOne; i++) {\n    vertices[i] = {\n      numLiveTriangles: 0,\n      timeStamp: 0,\n      vertexTriangles: [],\n    };\n  }\n  currentIndex = 0;\n  let triangle = 0;\n  while (currentIndex < endIndex) {\n    vertices[indices[currentIndex]].vertexTriangles.push(triangle);\n    ++vertices[indices[currentIndex]].numLiveTriangles;\n    vertices[indices[currentIndex + 1]].vertexTriangles.push(triangle);\n    ++vertices[indices[currentIndex + 1]].numLiveTriangles;\n    vertices[indices[currentIndex + 2]].vertexTriangles.push(triangle);\n    ++vertices[indices[currentIndex + 2]].numLiveTriangles;\n    ++triangle;\n    currentIndex += 3;\n  }\n\n  // Starting index\n  let f = 0;\n\n  // Time Stamp\n  let s = cacheSize + 1;\n  cursor = 1;\n\n  // Process\n  let oneRing = [];\n  const deadEnd = []; //Stack\n  let vertex;\n  let intoVertices;\n  let currentOutputIndex = 0;\n  const outputIndices = [];\n  const numTriangles = numIndices / 3;\n  const triangleEmitted = [];\n  for (i = 0; i < numTriangles; i++) {\n    triangleEmitted[i] = false;\n  }\n  let index;\n  let limit;\n  while (f !== -1) {\n    oneRing = [];\n    intoVertices = vertices[f];\n    limit = intoVertices.vertexTriangles.length;\n    for (let k = 0; k < limit; ++k) {\n      triangle = intoVertices.vertexTriangles[k];\n      if (!triangleEmitted[triangle]) {\n        triangleEmitted[triangle] = true;\n        currentIndex = triangle + triangle + triangle;\n        for (let j = 0; j < 3; ++j) {\n          // Set this index as a possible next index\n          index = indices[currentIndex];\n          oneRing.push(index);\n          deadEnd.push(index);\n\n          // Output index\n          outputIndices[currentOutputIndex] = index;\n          ++currentOutputIndex;\n\n          // Cache processing\n          vertex = vertices[index];\n          --vertex.numLiveTriangles;\n          if (s - vertex.timeStamp > cacheSize) {\n            vertex.timeStamp = s;\n            ++s;\n          }\n          ++currentIndex;\n        }\n      }\n    }\n    f = getNextVertex(\n      indices,\n      cacheSize,\n      oneRing,\n      vertices,\n      s,\n      deadEnd,\n      maximumIndexPlusOne\n    );\n  }\n\n  return outputIndices;\n};\nexport default Tipsify;\n", "import AttributeCompression from \"./AttributeCompression.js\";\nimport barycentricCoordinates from \"./barycentricCoordinates.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport EncodedCartesian3 from \"./EncodedCartesian3.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryType from \"./GeometryType.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport Intersect from \"./Intersect.js\";\nimport IntersectionTests from \"./IntersectionTests.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Plane from \"./Plane.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Tipsify from \"./Tipsify.js\";\n\n/**\n * Content pipeline functions for geometries.\n *\n * @namespace GeometryPipeline\n *\n * @see Geometry\n */\nconst GeometryPipeline = {};\n\nfunction addTriangle(lines, index, i0, i1, i2) {\n  lines[index++] = i0;\n  lines[index++] = i1;\n\n  lines[index++] = i1;\n  lines[index++] = i2;\n\n  lines[index++] = i2;\n  lines[index] = i0;\n}\n\nfunction trianglesToLines(triangles) {\n  const count = triangles.length;\n  const size = (count / 3) * 6;\n  const lines = IndexDatatype.createTypedArray(count, size);\n\n  let index = 0;\n  for (let i = 0; i < count; i += 3, index += 6) {\n    addTriangle(lines, index, triangles[i], triangles[i + 1], triangles[i + 2]);\n  }\n\n  return lines;\n}\n\nfunction triangleStripToLines(triangles) {\n  const count = triangles.length;\n  if (count >= 3) {\n    const size = (count - 2) * 6;\n    const lines = IndexDatatype.createTypedArray(count, size);\n\n    addTriangle(lines, 0, triangles[0], triangles[1], triangles[2]);\n    let index = 6;\n\n    for (let i = 3; i < count; ++i, index += 6) {\n      addTriangle(\n        lines,\n        index,\n        triangles[i - 1],\n        triangles[i],\n        triangles[i - 2]\n      );\n    }\n\n    return lines;\n  }\n\n  return new Uint16Array();\n}\n\nfunction triangleFanToLines(triangles) {\n  if (triangles.length > 0) {\n    const count = triangles.length - 1;\n    const size = (count - 1) * 6;\n    const lines = IndexDatatype.createTypedArray(count, size);\n\n    const base = triangles[0];\n    let index = 0;\n    for (let i = 1; i < count; ++i, index += 6) {\n      addTriangle(lines, index, base, triangles[i], triangles[i + 1]);\n    }\n\n    return lines;\n  }\n\n  return new Uint16Array();\n}\n\n/**\n * Converts a geometry's triangle indices to line indices.  If the geometry has an <code>indices</code>\n * and its <code>primitiveType</code> is <code>TRIANGLES</code>, <code>TRIANGLE_STRIP</code>,\n * <code>TRIANGLE_FAN</code>, it is converted to <code>LINES</code>; otherwise, the geometry is not changed.\n * <p>\n * This is commonly used to create a wireframe geometry for visual debugging.\n * </p>\n *\n * @param {Geometry} geometry The geometry to modify.\n * @returns {Geometry} The modified <code>geometry</code> argument, with its triangle indices converted to lines.\n *\n * @exception {DeveloperError} geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.\n *\n * @example\n * geometry = Cesium.GeometryPipeline.toWireframe(geometry);\n */\nGeometryPipeline.toWireframe = function (geometry) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(geometry)) {\n    throw new DeveloperError(\"geometry is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const indices = geometry.indices;\n  if (defined(indices)) {\n    switch (geometry.primitiveType) {\n      case PrimitiveType.TRIANGLES:\n        geometry.indices = trianglesToLines(indices);\n        break;\n      case PrimitiveType.TRIANGLE_STRIP:\n        geometry.indices = triangleStripToLines(indices);\n        break;\n      case PrimitiveType.TRIANGLE_FAN:\n        geometry.indices = triangleFanToLines(indices);\n        break;\n      //>>includeStart('debug', pragmas.debug);\n      default:\n        throw new DeveloperError(\n          \"geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.\"\n        );\n      //>>includeEnd('debug');\n    }\n\n    geometry.primitiveType = PrimitiveType.LINES;\n  }\n\n  return geometry;\n};\n\n/**\n * Creates a new {@link Geometry} with <code>LINES</code> representing the provided\n * attribute (<code>attributeName</code>) for the provided geometry.  This is used to\n * visualize vector attributes like normals, tangents, and bitangents.\n *\n * @param {Geometry} geometry The <code>Geometry</code> instance with the attribute.\n * @param {string} [attributeName='normal'] The name of the attribute.\n * @param {number} [length=10000.0] The length of each line segment in meters.  This can be negative to point the vector in the opposite direction.\n * @returns {Geometry} A new <code>Geometry</code> instance with line segments for the vector.\n *\n * @exception {DeveloperError} geometry.attributes must have an attribute with the same name as the attributeName parameter.\n *\n * @example\n * const geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0);\n */\nGeometryPipeline.createLineSegmentsForVectors = function (\n  geometry,\n  attributeName,\n  length\n) {\n  attributeName = defaultValue(attributeName, \"normal\");\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(geometry)) {\n    throw new DeveloperError(\"geometry is required.\");\n  }\n  if (!defined(geometry.attributes.position)) {\n    throw new DeveloperError(\"geometry.attributes.position is required.\");\n  }\n  if (!defined(geometry.attributes[attributeName])) {\n    throw new DeveloperError(\n      `geometry.attributes must have an attribute with the same name as the attributeName parameter, ${attributeName}.`\n    );\n  }\n  //>>includeEnd('debug');\n\n  length = defaultValue(length, 10000.0);\n\n  const positions = geometry.attributes.position.values;\n  const vectors = geometry.attributes[attributeName].values;\n  const positionsLength = positions.length;\n\n  const newPositions = new Float64Array(2 * positionsLength);\n\n  let j = 0;\n  for (let i = 0; i < positionsLength; i += 3) {\n    newPositions[j++] = positions[i];\n    newPositions[j++] = positions[i + 1];\n    newPositions[j++] = positions[i + 2];\n\n    newPositions[j++] = positions[i] + vectors[i] * length;\n    newPositions[j++] = positions[i + 1] + vectors[i + 1] * length;\n    newPositions[j++] = positions[i + 2] + vectors[i + 2] * length;\n  }\n\n  let newBoundingSphere;\n  const bs = geometry.boundingSphere;\n  if (defined(bs)) {\n    newBoundingSphere = new BoundingSphere(bs.center, bs.radius + length);\n  }\n\n  return new Geometry({\n    attributes: {\n      position: new GeometryAttribute({\n        componentDatatype: ComponentDatatype.DOUBLE,\n        componentsPerAttribute: 3,\n        values: newPositions,\n      }),\n    },\n    primitiveType: PrimitiveType.LINES,\n    boundingSphere: newBoundingSphere,\n  });\n};\n\n/**\n * Creates an object that maps attribute names to unique locations (indices)\n * for matching vertex attributes and shader programs.\n *\n * @param {Geometry} geometry The geometry, which is not modified, to create the object for.\n * @returns {object} An object with attribute name / index pairs.\n *\n * @example\n * const attributeLocations = Cesium.GeometryPipeline.createAttributeLocations(geometry);\n * // Example output\n * // {\n * //   'position' : 0,\n * //   'normal' : 1\n * // }\n */\nGeometryPipeline.createAttributeLocations = function (geometry) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(geometry)) {\n    throw new DeveloperError(\"geometry is required.\");\n  }\n  //>>includeEnd('debug')\n\n  // There can be a WebGL performance hit when attribute 0 is disabled, so\n  // assign attribute locations to well-known attributes.\n  const semantics = [\n    \"position\",\n    \"positionHigh\",\n    \"positionLow\",\n\n    // From VertexFormat.position - after 2D projection and high-precision encoding\n    \"position3DHigh\",\n    \"position3DLow\",\n    \"position2DHigh\",\n    \"position2DLow\",\n\n    // From Primitive\n    \"pickColor\",\n\n    // From VertexFormat\n    \"normal\",\n    \"st\",\n    \"tangent\",\n    \"bitangent\",\n\n    // For shadow volumes\n    \"extrudeDirection\",\n\n    // From compressing texture coordinates and normals\n    \"compressedAttributes\",\n  ];\n\n  const attributes = geometry.attributes;\n  const indices = {};\n  let j = 0;\n  let i;\n  const len = semantics.length;\n\n  // Attribute locations for well-known attributes\n  for (i = 0; i < len; ++i) {\n    const semantic = semantics[i];\n\n    if (defined(attributes[semantic])) {\n      indices[semantic] = j++;\n    }\n  }\n\n  // Locations for custom attributes\n  for (const name in attributes) {\n    if (attributes.hasOwnProperty(name) && !defined(indices[name])) {\n      indices[name] = j++;\n    }\n  }\n\n  return indices;\n};\n\n/**\n * Reorders a geometry's attributes and <code>indices</code> to achieve better performance from the GPU's pre-vertex-shader cache.\n *\n * @param {Geometry} geometry The geometry to modify.\n * @returns {Geometry} The modified <code>geometry</code> argument, with its attributes and indices reordered for the GPU's pre-vertex-shader cache.\n *\n * @exception {DeveloperError} Each attribute array in geometry.attributes must have the same number of attributes.\n *\n *\n * @example\n * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry);\n *\n * @see GeometryPipeline.reorderForPostVertexCache\n */\nGeometryPipeline.reorderForPreVertexCache = function (geometry) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(geometry)) {\n    throw new DeveloperError(\"geometry is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const numVertices = Geometry.computeNumberOfVertices(geometry);\n\n  const indices = geometry.indices;\n  if (defined(indices)) {\n    const indexCrossReferenceOldToNew = new Int32Array(numVertices);\n    for (let i = 0; i < numVertices; i++) {\n      indexCrossReferenceOldToNew[i] = -1;\n    }\n\n    // Construct cross reference and reorder indices\n    const indicesIn = indices;\n    const numIndices = indicesIn.length;\n    const indicesOut = IndexDatatype.createTypedArray(numVertices, numIndices);\n\n    let intoIndicesIn = 0;\n    let intoIndicesOut = 0;\n    let nextIndex = 0;\n    let tempIndex;\n    while (intoIndicesIn < numIndices) {\n      tempIndex = indexCrossReferenceOldToNew[indicesIn[intoIndicesIn]];\n      if (tempIndex !== -1) {\n        indicesOut[intoIndicesOut] = tempIndex;\n      } else {\n        tempIndex = indicesIn[intoIndicesIn];\n        indexCrossReferenceOldToNew[tempIndex] = nextIndex;\n\n        indicesOut[intoIndicesOut] = nextIndex;\n        ++nextIndex;\n      }\n      ++intoIndicesIn;\n      ++intoIndicesOut;\n    }\n    geometry.indices = indicesOut;\n\n    // Reorder attributes\n    const attributes = geometry.attributes;\n    for (const property in attributes) {\n      if (\n        attributes.hasOwnProperty(property) &&\n        defined(attributes[property]) &&\n        defined(attributes[property].values)\n      ) {\n        const attribute = attributes[property];\n        const elementsIn = attribute.values;\n        let intoElementsIn = 0;\n        const numComponents = attribute.componentsPerAttribute;\n        const elementsOut = ComponentDatatype.createTypedArray(\n          attribute.componentDatatype,\n          nextIndex * numComponents\n        );\n        while (intoElementsIn < numVertices) {\n          const temp = indexCrossReferenceOldToNew[intoElementsIn];\n          if (temp !== -1) {\n            for (let j = 0; j < numComponents; j++) {\n              elementsOut[numComponents * temp + j] =\n                elementsIn[numComponents * intoElementsIn + j];\n            }\n          }\n          ++intoElementsIn;\n        }\n        attribute.values = elementsOut;\n      }\n    }\n  }\n\n  return geometry;\n};\n\n/**\n * Reorders a geometry's <code>indices</code> to achieve better performance from the GPU's\n * post vertex-shader cache by using the Tipsify algorithm.  If the geometry <code>primitiveType</code>\n * is not <code>TRIANGLES</code> or the geometry does not have an <code>indices</code>, this function has no effect.\n *\n * @param {Geometry} geometry The geometry to modify.\n * @param {number} [cacheCapacity=24] The number of vertices that can be held in the GPU's vertex cache.\n * @returns {Geometry} The modified <code>geometry</code> argument, with its indices reordered for the post-vertex-shader cache.\n *\n * @exception {DeveloperError} cacheCapacity must be greater than two.\n *\n *\n * @example\n * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry);\n *\n * @see GeometryPipeline.reorderForPreVertexCache\n * @see {@link http://gfx.cs.princ0eton.edu/pubs/Sander_2007_%3ETR/tipsy.pdf|Fast Triangle Reordering for Vertex Locality and Reduced Overdraw}\n * by Sander, Nehab, and Barczak\n */\nGeometryPipeline.reorderForPostVertexCache = function (\n  geometry,\n  cacheCapacity\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(geometry)) {\n    throw new DeveloperError(\"geometry is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const indices = geometry.indices;\n  if (geometry.primitiveType === PrimitiveType.TRIANGLES && defined(indices)) {\n    const numIndices = indices.length;\n    let maximumIndex = 0;\n    for (let j = 0; j < numIndices; j++) {\n      if (indices[j] > maximumIndex) {\n        maximumIndex = indices[j];\n      }\n    }\n    geometry.indices = Tipsify.tipsify({\n      indices: indices,\n      maximumIndex: maximumIndex,\n      cacheSize: cacheCapacity,\n    });\n  }\n\n  return geometry;\n};\n\nfunction copyAttributesDescriptions(attributes) {\n  const newAttributes = {};\n\n  for (const attribute in attributes) {\n    if (\n      attributes.hasOwnProperty(attribute) &&\n      defined(attributes[attribute]) &&\n      defined(attributes[attribute].values)\n    ) {\n      const attr = attributes[attribute];\n      newAttributes[attribute] = new GeometryAttribute({\n        componentDatatype: attr.componentDatatype,\n        componentsPerAttribute: attr.componentsPerAttribute,\n        normalize: attr.normalize,\n        values: [],\n      });\n    }\n  }\n\n  return newAttributes;\n}\n\nfunction copyVertex(destinationAttributes, sourceAttributes, index) {\n  for (const attribute in sourceAttributes) {\n    if (\n      sourceAttributes.hasOwnProperty(attribute) &&\n      defined(sourceAttributes[attribute]) &&\n      defined(sourceAttributes[attribute].values)\n    ) {\n      const attr = sourceAttributes[attribute];\n\n      for (let k = 0; k < attr.componentsPerAttribute; ++k) {\n        destinationAttributes[attribute].values.push(\n          attr.values[index * attr.componentsPerAttribute + k]\n        );\n      }\n    }\n  }\n}\n\n/**\n * Splits a geometry into multiple geometries, if necessary, to ensure that indices in the\n * <code>indices</code> fit into unsigned shorts.  This is used to meet the WebGL requirements\n * when unsigned int indices are not supported.\n * <p>\n * If the geometry does not have any <code>indices</code>, this function has no effect.\n * </p>\n *\n * @param {Geometry} geometry The geometry to be split into multiple geometries.\n * @returns {Geometry[]} An array of geometries, each with indices that fit into unsigned shorts.\n *\n * @exception {DeveloperError} geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS\n * @exception {DeveloperError} All geometry attribute lists must have the same number of attributes.\n *\n * @example\n * const geometries = Cesium.GeometryPipeline.fitToUnsignedShortIndices(geometry);\n */\nGeometryPipeline.fitToUnsignedShortIndices = function (geometry) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(geometry)) {\n    throw new DeveloperError(\"geometry is required.\");\n  }\n  if (\n    defined(geometry.indices) &&\n    geometry.primitiveType !== PrimitiveType.TRIANGLES &&\n    geometry.primitiveType !== PrimitiveType.LINES &&\n    geometry.primitiveType !== PrimitiveType.POINTS\n  ) {\n    throw new DeveloperError(\n      \"geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const geometries = [];\n\n  // If there's an index list and more than 64K attributes, it is possible that\n  // some indices are outside the range of unsigned short [0, 64K - 1]\n  const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n  if (\n    defined(geometry.indices) &&\n    numberOfVertices >= CesiumMath.SIXTY_FOUR_KILOBYTES\n  ) {\n    let oldToNewIndex = [];\n    let newIndices = [];\n    let currentIndex = 0;\n    let newAttributes = copyAttributesDescriptions(geometry.attributes);\n\n    const originalIndices = geometry.indices;\n    const numberOfIndices = originalIndices.length;\n\n    let indicesPerPrimitive;\n\n    if (geometry.primitiveType === PrimitiveType.TRIANGLES) {\n      indicesPerPrimitive = 3;\n    } else if (geometry.primitiveType === PrimitiveType.LINES) {\n      indicesPerPrimitive = 2;\n    } else if (geometry.primitiveType === PrimitiveType.POINTS) {\n      indicesPerPrimitive = 1;\n    }\n\n    for (let j = 0; j < numberOfIndices; j += indicesPerPrimitive) {\n      for (let k = 0; k < indicesPerPrimitive; ++k) {\n        const x = originalIndices[j + k];\n        let i = oldToNewIndex[x];\n        if (!defined(i)) {\n          i = currentIndex++;\n          oldToNewIndex[x] = i;\n          copyVertex(newAttributes, geometry.attributes, x);\n        }\n        newIndices.push(i);\n      }\n\n      if (\n        currentIndex + indicesPerPrimitive >=\n        CesiumMath.SIXTY_FOUR_KILOBYTES\n      ) {\n        geometries.push(\n          new Geometry({\n            attributes: newAttributes,\n            indices: newIndices,\n            primitiveType: geometry.primitiveType,\n            boundingSphere: geometry.boundingSphere,\n            boundingSphereCV: geometry.boundingSphereCV,\n          })\n        );\n\n        // Reset for next vertex-array\n        oldToNewIndex = [];\n        newIndices = [];\n        currentIndex = 0;\n        newAttributes = copyAttributesDescriptions(geometry.attributes);\n      }\n    }\n\n    if (newIndices.length !== 0) {\n      geometries.push(\n        new Geometry({\n          attributes: newAttributes,\n          indices: newIndices,\n          primitiveType: geometry.primitiveType,\n          boundingSphere: geometry.boundingSphere,\n          boundingSphereCV: geometry.boundingSphereCV,\n        })\n      );\n    }\n  } else {\n    // No need to split into multiple geometries\n    geometries.push(geometry);\n  }\n\n  return geometries;\n};\n\nconst scratchProjectTo2DCartesian3 = new Cartesian3();\nconst scratchProjectTo2DCartographic = new Cartographic();\n\n/**\n * Projects a geometry's 3D <code>position</code> attribute to 2D, replacing the <code>position</code>\n * attribute with separate <code>position3D</code> and <code>position2D</code> attributes.\n * <p>\n * If the geometry does not have a <code>position</code>, this function has no effect.\n * </p>\n *\n * @param {Geometry} geometry The geometry to modify.\n * @param {string} attributeName The name of the attribute.\n * @param {string} attributeName3D The name of the attribute in 3D.\n * @param {string} attributeName2D The name of the attribute in 2D.\n * @param {object} [projection=new GeographicProjection()] The projection to use.\n * @returns {Geometry} The modified <code>geometry</code> argument with <code>position3D</code> and <code>position2D</code> attributes.\n *\n * @exception {DeveloperError} geometry must have attribute matching the attributeName argument.\n * @exception {DeveloperError} The attribute componentDatatype must be ComponentDatatype.DOUBLE.\n * @exception {DeveloperError} Could not project a point to 2D.\n *\n * @example\n * geometry = Cesium.GeometryPipeline.projectTo2D(geometry, 'position', 'position3D', 'position2D');\n */\nGeometryPipeline.projectTo2D = function (\n  geometry,\n  attributeName,\n  attributeName3D,\n  attributeName2D,\n  projection\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(geometry)) {\n    throw new DeveloperError(\"geometry is required.\");\n  }\n  if (!defined(attributeName)) {\n    throw new DeveloperError(\"attributeName is required.\");\n  }\n  if (!defined(attributeName3D)) {\n    throw new DeveloperError(\"attributeName3D is required.\");\n  }\n  if (!defined(attributeName2D)) {\n    throw new DeveloperError(\"attributeName2D is required.\");\n  }\n  if (!defined(geometry.attributes[attributeName])) {\n    throw new DeveloperError(\n      `geometry must have attribute matching the attributeName argument: ${attributeName}.`\n    );\n  }\n  if (\n    geometry.attributes[attributeName].componentDatatype !==\n    ComponentDatatype.DOUBLE\n  ) {\n    throw new DeveloperError(\n      \"The attribute componentDatatype must be ComponentDatatype.DOUBLE.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const attribute = geometry.attributes[attributeName];\n  projection = defined(projection) ? projection : new GeographicProjection();\n  const ellipsoid = projection.ellipsoid;\n\n  // Project original values to 2D.\n  const values3D = attribute.values;\n  const projectedValues = new Float64Array(values3D.length);\n  let index = 0;\n\n  for (let i = 0; i < values3D.length; i += 3) {\n    const value = Cartesian3.fromArray(\n      values3D,\n      i,\n      scratchProjectTo2DCartesian3\n    );\n\n    const lonLat = ellipsoid.cartesianToCartographic(\n      value,\n      scratchProjectTo2DCartographic\n    );\n    //>>includeStart('debug', pragmas.debug);\n    if (!defined(lonLat)) {\n      throw new DeveloperError(\n        `Could not project point (${value.x}, ${value.y}, ${value.z}) to 2D.`\n      );\n    }\n    //>>includeEnd('debug');\n\n    const projectedLonLat = projection.project(\n      lonLat,\n      scratchProjectTo2DCartesian3\n    );\n\n    projectedValues[index++] = projectedLonLat.x;\n    projectedValues[index++] = projectedLonLat.y;\n    projectedValues[index++] = projectedLonLat.z;\n  }\n\n  // Rename original cartesians to WGS84 cartesians.\n  geometry.attributes[attributeName3D] = attribute;\n\n  // Replace original cartesians with 2D projected cartesians\n  geometry.attributes[attributeName2D] = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.DOUBLE,\n    componentsPerAttribute: 3,\n    values: projectedValues,\n  });\n  delete geometry.attributes[attributeName];\n\n  return geometry;\n};\n\nconst encodedResult = {\n  high: 0.0,\n  low: 0.0,\n};\n\n/**\n * Encodes floating-point geometry attribute values as two separate attributes to improve\n * rendering precision.\n * <p>\n * This is commonly used to create high-precision position vertex attributes.\n * </p>\n *\n * @param {Geometry} geometry The geometry to modify.\n * @param {string} attributeName The name of the attribute.\n * @param {string} attributeHighName The name of the attribute for the encoded high bits.\n * @param {string} attributeLowName The name of the attribute for the encoded low bits.\n * @returns {Geometry} The modified <code>geometry</code> argument, with its encoded attribute.\n *\n * @exception {DeveloperError} geometry must have attribute matching the attributeName argument.\n * @exception {DeveloperError} The attribute componentDatatype must be ComponentDatatype.DOUBLE.\n *\n * @example\n * geometry = Cesium.GeometryPipeline.encodeAttribute(geometry, 'position3D', 'position3DHigh', 'position3DLow');\n */\nGeometryPipeline.encodeAttribute = function (\n  geometry,\n  attributeName,\n  attributeHighName,\n  attributeLowName\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(geometry)) {\n    throw new DeveloperError(\"geometry is required.\");\n  }\n  if (!defined(attributeName)) {\n    throw new DeveloperError(\"attributeName is required.\");\n  }\n  if (!defined(attributeHighName)) {\n    throw new DeveloperError(\"attributeHighName is required.\");\n  }\n  if (!defined(attributeLowName)) {\n    throw new DeveloperError(\"attributeLowName is required.\");\n  }\n  if (!defined(geometry.attributes[attributeName])) {\n    throw new DeveloperError(\n      `geometry must have attribute matching the attributeName argument: ${attributeName}.`\n    );\n  }\n  if (\n    geometry.attributes[attributeName].componentDatatype !==\n    ComponentDatatype.DOUBLE\n  ) {\n    throw new DeveloperError(\n      \"The attribute componentDatatype must be ComponentDatatype.DOUBLE.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const attribute = geometry.attributes[attributeName];\n  const values = attribute.values;\n  const length = values.length;\n  const highValues = new Float32Array(length);\n  const lowValues = new Float32Array(length);\n\n  for (let i = 0; i < length; ++i) {\n    EncodedCartesian3.encode(values[i], encodedResult);\n    highValues[i] = encodedResult.high;\n    lowValues[i] = encodedResult.low;\n  }\n\n  const componentsPerAttribute = attribute.componentsPerAttribute;\n\n  geometry.attributes[attributeHighName] = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: componentsPerAttribute,\n    values: highValues,\n  });\n  geometry.attributes[attributeLowName] = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: componentsPerAttribute,\n    values: lowValues,\n  });\n  delete geometry.attributes[attributeName];\n\n  return geometry;\n};\n\nlet scratchCartesian3 = new Cartesian3();\n\nfunction transformPoint(matrix, attribute) {\n  if (defined(attribute)) {\n    const values = attribute.values;\n    const length = values.length;\n    for (let i = 0; i < length; i += 3) {\n      Cartesian3.unpack(values, i, scratchCartesian3);\n      Matrix4.multiplyByPoint(matrix, scratchCartesian3, scratchCartesian3);\n      Cartesian3.pack(scratchCartesian3, values, i);\n    }\n  }\n}\n\nfunction transformVector(matrix, attribute) {\n  if (defined(attribute)) {\n    const values = attribute.values;\n    const length = values.length;\n    for (let i = 0; i < length; i += 3) {\n      Cartesian3.unpack(values, i, scratchCartesian3);\n      Matrix3.multiplyByVector(matrix, scratchCartesian3, scratchCartesian3);\n      scratchCartesian3 = Cartesian3.normalize(\n        scratchCartesian3,\n        scratchCartesian3\n      );\n      Cartesian3.pack(scratchCartesian3, values, i);\n    }\n  }\n}\n\nconst inverseTranspose = new Matrix4();\nconst normalMatrix = new Matrix3();\n\n/**\n * Transforms a geometry instance to world coordinates.  This changes\n * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the\n * following attributes if they are present: <code>position</code>, <code>normal</code>,\n * <code>tangent</code>, and <code>bitangent</code>.\n *\n * @param {GeometryInstance} instance The geometry instance to modify.\n * @returns {GeometryInstance} The modified <code>instance</code> argument, with its attributes transforms to world coordinates.\n *\n * @example\n * Cesium.GeometryPipeline.transformToWorldCoordinates(instance);\n */\nGeometryPipeline.transformToWorldCoordinates = function (instance) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(instance)) {\n    throw new DeveloperError(\"instance is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const modelMatrix = instance.modelMatrix;\n\n  if (Matrix4.equals(modelMatrix, Matrix4.IDENTITY)) {\n    // Already in world coordinates\n    return instance;\n  }\n\n  const attributes = instance.geometry.attributes;\n\n  // Transform attributes in known vertex formats\n  transformPoint(modelMatrix, attributes.position);\n  transformPoint(modelMatrix, attributes.prevPosition);\n  transformPoint(modelMatrix, attributes.nextPosition);\n\n  if (\n    defined(attributes.normal) ||\n    defined(attributes.tangent) ||\n    defined(attributes.bitangent)\n  ) {\n    Matrix4.inverse(modelMatrix, inverseTranspose);\n    Matrix4.transpose(inverseTranspose, inverseTranspose);\n    Matrix4.getMatrix3(inverseTranspose, normalMatrix);\n\n    transformVector(normalMatrix, attributes.normal);\n    transformVector(normalMatrix, attributes.tangent);\n    transformVector(normalMatrix, attributes.bitangent);\n  }\n\n  const boundingSphere = instance.geometry.boundingSphere;\n  if (defined(boundingSphere)) {\n    instance.geometry.boundingSphere = BoundingSphere.transform(\n      boundingSphere,\n      modelMatrix,\n      boundingSphere\n    );\n  }\n\n  instance.modelMatrix = Matrix4.clone(Matrix4.IDENTITY);\n\n  return instance;\n};\n\nfunction findAttributesInAllGeometries(instances, propertyName) {\n  const length = instances.length;\n\n  const attributesInAllGeometries = {};\n\n  const attributes0 = instances[0][propertyName].attributes;\n  let name;\n\n  for (name in attributes0) {\n    if (\n      attributes0.hasOwnProperty(name) &&\n      defined(attributes0[name]) &&\n      defined(attributes0[name].values)\n    ) {\n      const attribute = attributes0[name];\n      let numberOfComponents = attribute.values.length;\n      let inAllGeometries = true;\n\n      // Does this same attribute exist in all geometries?\n      for (let i = 1; i < length; ++i) {\n        const otherAttribute = instances[i][propertyName].attributes[name];\n\n        if (\n          !defined(otherAttribute) ||\n          attribute.componentDatatype !== otherAttribute.componentDatatype ||\n          attribute.componentsPerAttribute !==\n            otherAttribute.componentsPerAttribute ||\n          attribute.normalize !== otherAttribute.normalize\n        ) {\n          inAllGeometries = false;\n          break;\n        }\n\n        numberOfComponents += otherAttribute.values.length;\n      }\n\n      if (inAllGeometries) {\n        attributesInAllGeometries[name] = new GeometryAttribute({\n          componentDatatype: attribute.componentDatatype,\n          componentsPerAttribute: attribute.componentsPerAttribute,\n          normalize: attribute.normalize,\n          values: ComponentDatatype.createTypedArray(\n            attribute.componentDatatype,\n            numberOfComponents\n          ),\n        });\n      }\n    }\n  }\n\n  return attributesInAllGeometries;\n}\n\nconst tempScratch = new Cartesian3();\n\nfunction combineGeometries(instances, propertyName) {\n  const length = instances.length;\n\n  let name;\n  let i;\n  let j;\n  let k;\n\n  const m = instances[0].modelMatrix;\n  const haveIndices = defined(instances[0][propertyName].indices);\n  const primitiveType = instances[0][propertyName].primitiveType;\n\n  //>>includeStart('debug', pragmas.debug);\n  for (i = 1; i < length; ++i) {\n    if (!Matrix4.equals(instances[i].modelMatrix, m)) {\n      throw new DeveloperError(\"All instances must have the same modelMatrix.\");\n    }\n    if (defined(instances[i][propertyName].indices) !== haveIndices) {\n      throw new DeveloperError(\n        \"All instance geometries must have an indices or not have one.\"\n      );\n    }\n    if (instances[i][propertyName].primitiveType !== primitiveType) {\n      throw new DeveloperError(\n        \"All instance geometries must have the same primitiveType.\"\n      );\n    }\n  }\n  //>>includeEnd('debug');\n\n  // Find subset of attributes in all geometries\n  const attributes = findAttributesInAllGeometries(instances, propertyName);\n  let values;\n  let sourceValues;\n  let sourceValuesLength;\n\n  // Combine attributes from each geometry into a single typed array\n  for (name in attributes) {\n    if (attributes.hasOwnProperty(name)) {\n      values = attributes[name].values;\n\n      k = 0;\n      for (i = 0; i < length; ++i) {\n        sourceValues = instances[i][propertyName].attributes[name].values;\n        sourceValuesLength = sourceValues.length;\n\n        for (j = 0; j < sourceValuesLength; ++j) {\n          values[k++] = sourceValues[j];\n        }\n      }\n    }\n  }\n\n  // Combine index lists\n  let indices;\n\n  if (haveIndices) {\n    let numberOfIndices = 0;\n    for (i = 0; i < length; ++i) {\n      numberOfIndices += instances[i][propertyName].indices.length;\n    }\n\n    const numberOfVertices = Geometry.computeNumberOfVertices(\n      new Geometry({\n        attributes: attributes,\n        primitiveType: PrimitiveType.POINTS,\n      })\n    );\n    const destIndices = IndexDatatype.createTypedArray(\n      numberOfVertices,\n      numberOfIndices\n    );\n\n    let destOffset = 0;\n    let offset = 0;\n\n    for (i = 0; i < length; ++i) {\n      const sourceIndices = instances[i][propertyName].indices;\n      const sourceIndicesLen = sourceIndices.length;\n\n      for (k = 0; k < sourceIndicesLen; ++k) {\n        destIndices[destOffset++] = offset + sourceIndices[k];\n      }\n\n      offset += Geometry.computeNumberOfVertices(instances[i][propertyName]);\n    }\n\n    indices = destIndices;\n  }\n\n  // Create bounding sphere that includes all instances\n  let center = new Cartesian3();\n  let radius = 0.0;\n  let bs;\n\n  for (i = 0; i < length; ++i) {\n    bs = instances[i][propertyName].boundingSphere;\n    if (!defined(bs)) {\n      // If any geometries have an undefined bounding sphere, then so does the combined geometry\n      center = undefined;\n      break;\n    }\n\n    Cartesian3.add(bs.center, center, center);\n  }\n\n  if (defined(center)) {\n    Cartesian3.divideByScalar(center, length, center);\n\n    for (i = 0; i < length; ++i) {\n      bs = instances[i][propertyName].boundingSphere;\n      const tempRadius =\n        Cartesian3.magnitude(\n          Cartesian3.subtract(bs.center, center, tempScratch)\n        ) + bs.radius;\n\n      if (tempRadius > radius) {\n        radius = tempRadius;\n      }\n    }\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: primitiveType,\n    boundingSphere: defined(center)\n      ? new BoundingSphere(center, radius)\n      : undefined,\n  });\n}\n\n/**\n * Combines geometry from several {@link GeometryInstance} objects into one geometry.\n * This concatenates the attributes, concatenates and adjusts the indices, and creates\n * a bounding sphere encompassing all instances.\n * <p>\n * If the instances do not have the same attributes, a subset of attributes common\n * to all instances is used, and the others are ignored.\n * </p>\n * <p>\n * This is used by {@link Primitive} to efficiently render a large amount of static data.\n * </p>\n *\n * @private\n *\n * @param {GeometryInstance[]} [instances] The array of {@link GeometryInstance} objects whose geometry will be combined.\n * @returns {Geometry} A single geometry created from the provided geometry instances.\n *\n * @exception {DeveloperError} All instances must have the same modelMatrix.\n * @exception {DeveloperError} All instance geometries must have an indices or not have one.\n * @exception {DeveloperError} All instance geometries must have the same primitiveType.\n *\n *\n * @example\n * for (let i = 0; i < instances.length; ++i) {\n *   Cesium.GeometryPipeline.transformToWorldCoordinates(instances[i]);\n * }\n * const geometries = Cesium.GeometryPipeline.combineInstances(instances);\n *\n * @see GeometryPipeline.transformToWorldCoordinates\n */\nGeometryPipeline.combineInstances = function (instances) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(instances) || instances.length < 1) {\n    throw new DeveloperError(\n      \"instances is required and must have length greater than zero.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const instanceGeometry = [];\n  const instanceSplitGeometry = [];\n  const length = instances.length;\n  for (let i = 0; i < length; ++i) {\n    const instance = instances[i];\n\n    if (defined(instance.geometry)) {\n      instanceGeometry.push(instance);\n    } else if (\n      defined(instance.westHemisphereGeometry) &&\n      defined(instance.eastHemisphereGeometry)\n    ) {\n      instanceSplitGeometry.push(instance);\n    }\n  }\n\n  const geometries = [];\n  if (instanceGeometry.length > 0) {\n    geometries.push(combineGeometries(instanceGeometry, \"geometry\"));\n  }\n\n  if (instanceSplitGeometry.length > 0) {\n    geometries.push(\n      combineGeometries(instanceSplitGeometry, \"westHemisphereGeometry\")\n    );\n    geometries.push(\n      combineGeometries(instanceSplitGeometry, \"eastHemisphereGeometry\")\n    );\n  }\n\n  return geometries;\n};\n\nconst normal = new Cartesian3();\nconst v0 = new Cartesian3();\nconst v1 = new Cartesian3();\nconst v2 = new Cartesian3();\n\n/**\n * Computes per-vertex normals for a geometry containing <code>TRIANGLES</code> by averaging the normals of\n * all triangles incident to the vertex.  The result is a new <code>normal</code> attribute added to the geometry.\n * This assumes a counter-clockwise winding order.\n *\n * @param {Geometry} geometry The geometry to modify.\n * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>normal</code> attribute.\n *\n * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3.\n * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}.\n *\n * @example\n * Cesium.GeometryPipeline.computeNormal(geometry);\n */\nGeometryPipeline.computeNormal = function (geometry) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(geometry)) {\n    throw new DeveloperError(\"geometry is required.\");\n  }\n  if (\n    !defined(geometry.attributes.position) ||\n    !defined(geometry.attributes.position.values)\n  ) {\n    throw new DeveloperError(\n      \"geometry.attributes.position.values is required.\"\n    );\n  }\n  if (!defined(geometry.indices)) {\n    throw new DeveloperError(\"geometry.indices is required.\");\n  }\n  if (geometry.indices.length < 2 || geometry.indices.length % 3 !== 0) {\n    throw new DeveloperError(\n      \"geometry.indices length must be greater than 0 and be a multiple of 3.\"\n    );\n  }\n  if (geometry.primitiveType !== PrimitiveType.TRIANGLES) {\n    throw new DeveloperError(\n      \"geometry.primitiveType must be PrimitiveType.TRIANGLES.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const indices = geometry.indices;\n  const attributes = geometry.attributes;\n  const vertices = attributes.position.values;\n  const numVertices = attributes.position.values.length / 3;\n  const numIndices = indices.length;\n  const normalsPerVertex = new Array(numVertices);\n  const normalsPerTriangle = new Array(numIndices / 3);\n  const normalIndices = new Array(numIndices);\n  let i;\n  for (i = 0; i < numVertices; i++) {\n    normalsPerVertex[i] = {\n      indexOffset: 0,\n      count: 0,\n      currentCount: 0,\n    };\n  }\n\n  let j = 0;\n  for (i = 0; i < numIndices; i += 3) {\n    const i0 = indices[i];\n    const i1 = indices[i + 1];\n    const i2 = indices[i + 2];\n    const i03 = i0 * 3;\n    const i13 = i1 * 3;\n    const i23 = i2 * 3;\n\n    v0.x = vertices[i03];\n    v0.y = vertices[i03 + 1];\n    v0.z = vertices[i03 + 2];\n    v1.x = vertices[i13];\n    v1.y = vertices[i13 + 1];\n    v1.z = vertices[i13 + 2];\n    v2.x = vertices[i23];\n    v2.y = vertices[i23 + 1];\n    v2.z = vertices[i23 + 2];\n\n    normalsPerVertex[i0].count++;\n    normalsPerVertex[i1].count++;\n    normalsPerVertex[i2].count++;\n\n    Cartesian3.subtract(v1, v0, v1);\n    Cartesian3.subtract(v2, v0, v2);\n    normalsPerTriangle[j] = Cartesian3.cross(v1, v2, new Cartesian3());\n    j++;\n  }\n\n  let indexOffset = 0;\n  for (i = 0; i < numVertices; i++) {\n    normalsPerVertex[i].indexOffset += indexOffset;\n    indexOffset += normalsPerVertex[i].count;\n  }\n\n  j = 0;\n  let vertexNormalData;\n  for (i = 0; i < numIndices; i += 3) {\n    vertexNormalData = normalsPerVertex[indices[i]];\n    let index = vertexNormalData.indexOffset + vertexNormalData.currentCount;\n    normalIndices[index] = j;\n    vertexNormalData.currentCount++;\n\n    vertexNormalData = normalsPerVertex[indices[i + 1]];\n    index = vertexNormalData.indexOffset + vertexNormalData.currentCount;\n    normalIndices[index] = j;\n    vertexNormalData.currentCount++;\n\n    vertexNormalData = normalsPerVertex[indices[i + 2]];\n    index = vertexNormalData.indexOffset + vertexNormalData.currentCount;\n    normalIndices[index] = j;\n    vertexNormalData.currentCount++;\n\n    j++;\n  }\n\n  const normalValues = new Float32Array(numVertices * 3);\n  for (i = 0; i < numVertices; i++) {\n    const i3 = i * 3;\n    vertexNormalData = normalsPerVertex[i];\n    Cartesian3.clone(Cartesian3.ZERO, normal);\n    if (vertexNormalData.count > 0) {\n      for (j = 0; j < vertexNormalData.count; j++) {\n        Cartesian3.add(\n          normal,\n          normalsPerTriangle[normalIndices[vertexNormalData.indexOffset + j]],\n          normal\n        );\n      }\n\n      // We can run into an issue where a vertex is used with 2 primitives that have opposite winding order.\n      if (\n        Cartesian3.equalsEpsilon(Cartesian3.ZERO, normal, CesiumMath.EPSILON10)\n      ) {\n        Cartesian3.clone(\n          normalsPerTriangle[normalIndices[vertexNormalData.indexOffset]],\n          normal\n        );\n      }\n    }\n\n    // We end up with a zero vector probably because of a degenerate triangle\n    if (\n      Cartesian3.equalsEpsilon(Cartesian3.ZERO, normal, CesiumMath.EPSILON10)\n    ) {\n      // Default to (0,0,1)\n      normal.z = 1.0;\n    }\n\n    Cartesian3.normalize(normal, normal);\n    normalValues[i3] = normal.x;\n    normalValues[i3 + 1] = normal.y;\n    normalValues[i3 + 2] = normal.z;\n  }\n\n  geometry.attributes.normal = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: 3,\n    values: normalValues,\n  });\n\n  return geometry;\n};\n\nconst normalScratch = new Cartesian3();\nconst normalScale = new Cartesian3();\nconst tScratch = new Cartesian3();\n\n/**\n * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>.\n * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry.\n * This assumes a counter-clockwise winding order.\n * <p>\n * Based on <a href=\"http://www.terathon.com/code/tangent.html\">Computing Tangent Space Basis Vectors\n * for an Arbitrary Mesh</a> by Eric Lengyel.\n * </p>\n *\n * @param {Geometry} geometry The geometry to modify.\n * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes.\n *\n * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3.\n * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}.\n *\n * @example\n * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry);\n */\nGeometryPipeline.computeTangentAndBitangent = function (geometry) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(geometry)) {\n    throw new DeveloperError(\"geometry is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const attributes = geometry.attributes;\n  const indices = geometry.indices;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(attributes.position) || !defined(attributes.position.values)) {\n    throw new DeveloperError(\n      \"geometry.attributes.position.values is required.\"\n    );\n  }\n  if (!defined(attributes.normal) || !defined(attributes.normal.values)) {\n    throw new DeveloperError(\"geometry.attributes.normal.values is required.\");\n  }\n  if (!defined(attributes.st) || !defined(attributes.st.values)) {\n    throw new DeveloperError(\"geometry.attributes.st.values is required.\");\n  }\n  if (!defined(indices)) {\n    throw new DeveloperError(\"geometry.indices is required.\");\n  }\n  if (indices.length < 2 || indices.length % 3 !== 0) {\n    throw new DeveloperError(\n      \"geometry.indices length must be greater than 0 and be a multiple of 3.\"\n    );\n  }\n  if (geometry.primitiveType !== PrimitiveType.TRIANGLES) {\n    throw new DeveloperError(\n      \"geometry.primitiveType must be PrimitiveType.TRIANGLES.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const vertices = geometry.attributes.position.values;\n  const normals = geometry.attributes.normal.values;\n  const st = geometry.attributes.st.values;\n\n  const numVertices = geometry.attributes.position.values.length / 3;\n  const numIndices = indices.length;\n  const tan1 = new Array(numVertices * 3);\n\n  let i;\n  for (i = 0; i < tan1.length; i++) {\n    tan1[i] = 0;\n  }\n\n  let i03;\n  let i13;\n  let i23;\n  for (i = 0; i < numIndices; i += 3) {\n    const i0 = indices[i];\n    const i1 = indices[i + 1];\n    const i2 = indices[i + 2];\n    i03 = i0 * 3;\n    i13 = i1 * 3;\n    i23 = i2 * 3;\n    const i02 = i0 * 2;\n    const i12 = i1 * 2;\n    const i22 = i2 * 2;\n\n    const ux = vertices[i03];\n    const uy = vertices[i03 + 1];\n    const uz = vertices[i03 + 2];\n\n    const wx = st[i02];\n    const wy = st[i02 + 1];\n    const t1 = st[i12 + 1] - wy;\n    const t2 = st[i22 + 1] - wy;\n\n    const r = 1.0 / ((st[i12] - wx) * t2 - (st[i22] - wx) * t1);\n    const sdirx = (t2 * (vertices[i13] - ux) - t1 * (vertices[i23] - ux)) * r;\n    const sdiry =\n      (t2 * (vertices[i13 + 1] - uy) - t1 * (vertices[i23 + 1] - uy)) * r;\n    const sdirz =\n      (t2 * (vertices[i13 + 2] - uz) - t1 * (vertices[i23 + 2] - uz)) * r;\n\n    tan1[i03] += sdirx;\n    tan1[i03 + 1] += sdiry;\n    tan1[i03 + 2] += sdirz;\n\n    tan1[i13] += sdirx;\n    tan1[i13 + 1] += sdiry;\n    tan1[i13 + 2] += sdirz;\n\n    tan1[i23] += sdirx;\n    tan1[i23 + 1] += sdiry;\n    tan1[i23 + 2] += sdirz;\n  }\n\n  const tangentValues = new Float32Array(numVertices * 3);\n  const bitangentValues = new Float32Array(numVertices * 3);\n\n  for (i = 0; i < numVertices; i++) {\n    i03 = i * 3;\n    i13 = i03 + 1;\n    i23 = i03 + 2;\n\n    const n = Cartesian3.fromArray(normals, i03, normalScratch);\n    const t = Cartesian3.fromArray(tan1, i03, tScratch);\n    const scalar = Cartesian3.dot(n, t);\n    Cartesian3.multiplyByScalar(n, scalar, normalScale);\n    Cartesian3.normalize(Cartesian3.subtract(t, normalScale, t), t);\n\n    tangentValues[i03] = t.x;\n    tangentValues[i13] = t.y;\n    tangentValues[i23] = t.z;\n\n    Cartesian3.normalize(Cartesian3.cross(n, t, t), t);\n\n    bitangentValues[i03] = t.x;\n    bitangentValues[i13] = t.y;\n    bitangentValues[i23] = t.z;\n  }\n\n  geometry.attributes.tangent = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: 3,\n    values: tangentValues,\n  });\n\n  geometry.attributes.bitangent = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: 3,\n    values: bitangentValues,\n  });\n\n  return geometry;\n};\n\nconst scratchCartesian2 = new Cartesian2();\nconst toEncode1 = new Cartesian3();\nconst toEncode2 = new Cartesian3();\nconst toEncode3 = new Cartesian3();\nlet encodeResult2 = new Cartesian2();\n/**\n * Compresses and packs geometry normal attribute values to save memory.\n *\n * @param {Geometry} geometry The geometry to modify.\n * @returns {Geometry} The modified <code>geometry</code> argument, with its normals compressed and packed.\n *\n * @example\n * geometry = Cesium.GeometryPipeline.compressVertices(geometry);\n */\nGeometryPipeline.compressVertices = function (geometry) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(geometry)) {\n    throw new DeveloperError(\"geometry is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const extrudeAttribute = geometry.attributes.extrudeDirection;\n  let i;\n  let numVertices;\n  if (defined(extrudeAttribute)) {\n    //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes\n    const extrudeDirections = extrudeAttribute.values;\n    numVertices = extrudeDirections.length / 3.0;\n    const compressedDirections = new Float32Array(numVertices * 2);\n\n    let i2 = 0;\n    for (i = 0; i < numVertices; ++i) {\n      Cartesian3.fromArray(extrudeDirections, i * 3.0, toEncode1);\n      if (Cartesian3.equals(toEncode1, Cartesian3.ZERO)) {\n        i2 += 2;\n        continue;\n      }\n      encodeResult2 = AttributeCompression.octEncodeInRange(\n        toEncode1,\n        65535,\n        encodeResult2\n      );\n      compressedDirections[i2++] = encodeResult2.x;\n      compressedDirections[i2++] = encodeResult2.y;\n    }\n\n    geometry.attributes.compressedAttributes = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n      values: compressedDirections,\n    });\n    delete geometry.attributes.extrudeDirection;\n    return geometry;\n  }\n\n  const normalAttribute = geometry.attributes.normal;\n  const stAttribute = geometry.attributes.st;\n\n  const hasNormal = defined(normalAttribute);\n  const hasSt = defined(stAttribute);\n  if (!hasNormal && !hasSt) {\n    return geometry;\n  }\n\n  const tangentAttribute = geometry.attributes.tangent;\n  const bitangentAttribute = geometry.attributes.bitangent;\n\n  const hasTangent = defined(tangentAttribute);\n  const hasBitangent = defined(bitangentAttribute);\n\n  let normals;\n  let st;\n  let tangents;\n  let bitangents;\n\n  if (hasNormal) {\n    normals = normalAttribute.values;\n  }\n  if (hasSt) {\n    st = stAttribute.values;\n  }\n  if (hasTangent) {\n    tangents = tangentAttribute.values;\n  }\n  if (hasBitangent) {\n    bitangents = bitangentAttribute.values;\n  }\n\n  const length = hasNormal ? normals.length : st.length;\n  const numComponents = hasNormal ? 3.0 : 2.0;\n  numVertices = length / numComponents;\n\n  let compressedLength = numVertices;\n  let numCompressedComponents = hasSt && hasNormal ? 2.0 : 1.0;\n  numCompressedComponents += hasTangent || hasBitangent ? 1.0 : 0.0;\n  compressedLength *= numCompressedComponents;\n\n  const compressedAttributes = new Float32Array(compressedLength);\n\n  let normalIndex = 0;\n  for (i = 0; i < numVertices; ++i) {\n    if (hasSt) {\n      Cartesian2.fromArray(st, i * 2.0, scratchCartesian2);\n      compressedAttributes[\n        normalIndex++\n      ] = AttributeCompression.compressTextureCoordinates(scratchCartesian2);\n    }\n\n    const index = i * 3.0;\n    if (hasNormal && defined(tangents) && defined(bitangents)) {\n      Cartesian3.fromArray(normals, index, toEncode1);\n      Cartesian3.fromArray(tangents, index, toEncode2);\n      Cartesian3.fromArray(bitangents, index, toEncode3);\n\n      AttributeCompression.octPack(\n        toEncode1,\n        toEncode2,\n        toEncode3,\n        scratchCartesian2\n      );\n      compressedAttributes[normalIndex++] = scratchCartesian2.x;\n      compressedAttributes[normalIndex++] = scratchCartesian2.y;\n    } else {\n      if (hasNormal) {\n        Cartesian3.fromArray(normals, index, toEncode1);\n        compressedAttributes[\n          normalIndex++\n        ] = AttributeCompression.octEncodeFloat(toEncode1);\n      }\n\n      if (hasTangent) {\n        Cartesian3.fromArray(tangents, index, toEncode1);\n        compressedAttributes[\n          normalIndex++\n        ] = AttributeCompression.octEncodeFloat(toEncode1);\n      }\n\n      if (hasBitangent) {\n        Cartesian3.fromArray(bitangents, index, toEncode1);\n        compressedAttributes[\n          normalIndex++\n        ] = AttributeCompression.octEncodeFloat(toEncode1);\n      }\n    }\n  }\n\n  geometry.attributes.compressedAttributes = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: numCompressedComponents,\n    values: compressedAttributes,\n  });\n\n  if (hasNormal) {\n    delete geometry.attributes.normal;\n  }\n  if (hasSt) {\n    delete geometry.attributes.st;\n  }\n  if (hasBitangent) {\n    delete geometry.attributes.bitangent;\n  }\n  if (hasTangent) {\n    delete geometry.attributes.tangent;\n  }\n\n  return geometry;\n};\n\nfunction indexTriangles(geometry) {\n  if (defined(geometry.indices)) {\n    return geometry;\n  }\n  const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (numberOfVertices < 3) {\n    throw new DeveloperError(\"The number of vertices must be at least three.\");\n  }\n  if (numberOfVertices % 3 !== 0) {\n    throw new DeveloperError(\n      \"The number of vertices must be a multiple of three.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const indices = IndexDatatype.createTypedArray(\n    numberOfVertices,\n    numberOfVertices\n  );\n  for (let i = 0; i < numberOfVertices; ++i) {\n    indices[i] = i;\n  }\n\n  geometry.indices = indices;\n  return geometry;\n}\n\nfunction indexTriangleFan(geometry) {\n  const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (numberOfVertices < 3) {\n    throw new DeveloperError(\"The number of vertices must be at least three.\");\n  }\n  //>>includeEnd('debug');\n\n  const indices = IndexDatatype.createTypedArray(\n    numberOfVertices,\n    (numberOfVertices - 2) * 3\n  );\n  indices[0] = 1;\n  indices[1] = 0;\n  indices[2] = 2;\n\n  let indicesIndex = 3;\n  for (let i = 3; i < numberOfVertices; ++i) {\n    indices[indicesIndex++] = i - 1;\n    indices[indicesIndex++] = 0;\n    indices[indicesIndex++] = i;\n  }\n\n  geometry.indices = indices;\n  geometry.primitiveType = PrimitiveType.TRIANGLES;\n  return geometry;\n}\n\nfunction indexTriangleStrip(geometry) {\n  const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (numberOfVertices < 3) {\n    throw new DeveloperError(\"The number of vertices must be at least 3.\");\n  }\n  //>>includeEnd('debug');\n\n  const indices = IndexDatatype.createTypedArray(\n    numberOfVertices,\n    (numberOfVertices - 2) * 3\n  );\n  indices[0] = 0;\n  indices[1] = 1;\n  indices[2] = 2;\n\n  if (numberOfVertices > 3) {\n    indices[3] = 0;\n    indices[4] = 2;\n    indices[5] = 3;\n  }\n\n  let indicesIndex = 6;\n  for (let i = 3; i < numberOfVertices - 1; i += 2) {\n    indices[indicesIndex++] = i;\n    indices[indicesIndex++] = i - 1;\n    indices[indicesIndex++] = i + 1;\n\n    if (i + 2 < numberOfVertices) {\n      indices[indicesIndex++] = i;\n      indices[indicesIndex++] = i + 1;\n      indices[indicesIndex++] = i + 2;\n    }\n  }\n\n  geometry.indices = indices;\n  geometry.primitiveType = PrimitiveType.TRIANGLES;\n  return geometry;\n}\n\nfunction indexLines(geometry) {\n  if (defined(geometry.indices)) {\n    return geometry;\n  }\n  const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (numberOfVertices < 2) {\n    throw new DeveloperError(\"The number of vertices must be at least two.\");\n  }\n  if (numberOfVertices % 2 !== 0) {\n    throw new DeveloperError(\"The number of vertices must be a multiple of 2.\");\n  }\n  //>>includeEnd('debug');\n\n  const indices = IndexDatatype.createTypedArray(\n    numberOfVertices,\n    numberOfVertices\n  );\n  for (let i = 0; i < numberOfVertices; ++i) {\n    indices[i] = i;\n  }\n\n  geometry.indices = indices;\n  return geometry;\n}\n\nfunction indexLineStrip(geometry) {\n  const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (numberOfVertices < 2) {\n    throw new DeveloperError(\"The number of vertices must be at least two.\");\n  }\n  //>>includeEnd('debug');\n\n  const indices = IndexDatatype.createTypedArray(\n    numberOfVertices,\n    (numberOfVertices - 1) * 2\n  );\n  indices[0] = 0;\n  indices[1] = 1;\n  let indicesIndex = 2;\n  for (let i = 2; i < numberOfVertices; ++i) {\n    indices[indicesIndex++] = i - 1;\n    indices[indicesIndex++] = i;\n  }\n\n  geometry.indices = indices;\n  geometry.primitiveType = PrimitiveType.LINES;\n  return geometry;\n}\n\nfunction indexLineLoop(geometry) {\n  const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (numberOfVertices < 2) {\n    throw new DeveloperError(\"The number of vertices must be at least two.\");\n  }\n  //>>includeEnd('debug');\n\n  const indices = IndexDatatype.createTypedArray(\n    numberOfVertices,\n    numberOfVertices * 2\n  );\n\n  indices[0] = 0;\n  indices[1] = 1;\n\n  let indicesIndex = 2;\n  for (let i = 2; i < numberOfVertices; ++i) {\n    indices[indicesIndex++] = i - 1;\n    indices[indicesIndex++] = i;\n  }\n\n  indices[indicesIndex++] = numberOfVertices - 1;\n  indices[indicesIndex] = 0;\n\n  geometry.indices = indices;\n  geometry.primitiveType = PrimitiveType.LINES;\n  return geometry;\n}\n\nfunction indexPrimitive(geometry) {\n  switch (geometry.primitiveType) {\n    case PrimitiveType.TRIANGLE_FAN:\n      return indexTriangleFan(geometry);\n    case PrimitiveType.TRIANGLE_STRIP:\n      return indexTriangleStrip(geometry);\n    case PrimitiveType.TRIANGLES:\n      return indexTriangles(geometry);\n    case PrimitiveType.LINE_STRIP:\n      return indexLineStrip(geometry);\n    case PrimitiveType.LINE_LOOP:\n      return indexLineLoop(geometry);\n    case PrimitiveType.LINES:\n      return indexLines(geometry);\n  }\n\n  return geometry;\n}\n\nfunction offsetPointFromXZPlane(p, isBehind) {\n  if (Math.abs(p.y) < CesiumMath.EPSILON6) {\n    if (isBehind) {\n      p.y = -CesiumMath.EPSILON6;\n    } else {\n      p.y = CesiumMath.EPSILON6;\n    }\n  }\n}\n\nfunction offsetTriangleFromXZPlane(p0, p1, p2) {\n  if (p0.y !== 0.0 && p1.y !== 0.0 && p2.y !== 0.0) {\n    offsetPointFromXZPlane(p0, p0.y < 0.0);\n    offsetPointFromXZPlane(p1, p1.y < 0.0);\n    offsetPointFromXZPlane(p2, p2.y < 0.0);\n    return;\n  }\n\n  const p0y = Math.abs(p0.y);\n  const p1y = Math.abs(p1.y);\n  const p2y = Math.abs(p2.y);\n\n  let sign;\n  if (p0y > p1y) {\n    if (p0y > p2y) {\n      sign = CesiumMath.sign(p0.y);\n    } else {\n      sign = CesiumMath.sign(p2.y);\n    }\n  } else if (p1y > p2y) {\n    sign = CesiumMath.sign(p1.y);\n  } else {\n    sign = CesiumMath.sign(p2.y);\n  }\n\n  const isBehind = sign < 0.0;\n  offsetPointFromXZPlane(p0, isBehind);\n  offsetPointFromXZPlane(p1, isBehind);\n  offsetPointFromXZPlane(p2, isBehind);\n}\n\nconst c3 = new Cartesian3();\nfunction getXZIntersectionOffsetPoints(p, p1, u1, v1) {\n  Cartesian3.add(\n    p,\n    Cartesian3.multiplyByScalar(\n      Cartesian3.subtract(p1, p, c3),\n      p.y / (p.y - p1.y),\n      c3\n    ),\n    u1\n  );\n  Cartesian3.clone(u1, v1);\n  offsetPointFromXZPlane(u1, true);\n  offsetPointFromXZPlane(v1, false);\n}\n\nconst u1 = new Cartesian3();\nconst u2 = new Cartesian3();\nconst q1 = new Cartesian3();\nconst q2 = new Cartesian3();\n\nconst splitTriangleResult = {\n  positions: new Array(7),\n  indices: new Array(3 * 3),\n};\n\nfunction splitTriangle(p0, p1, p2) {\n  // In WGS84 coordinates, for a triangle approximately on the\n  // ellipsoid to cross the IDL, first it needs to be on the\n  // negative side of the plane x = 0.\n  if (p0.x >= 0.0 || p1.x >= 0.0 || p2.x >= 0.0) {\n    return undefined;\n  }\n\n  offsetTriangleFromXZPlane(p0, p1, p2);\n\n  const p0Behind = p0.y < 0.0;\n  const p1Behind = p1.y < 0.0;\n  const p2Behind = p2.y < 0.0;\n\n  let numBehind = 0;\n  numBehind += p0Behind ? 1 : 0;\n  numBehind += p1Behind ? 1 : 0;\n  numBehind += p2Behind ? 1 : 0;\n\n  const indices = splitTriangleResult.indices;\n\n  if (numBehind === 1) {\n    indices[1] = 3;\n    indices[2] = 4;\n    indices[5] = 6;\n    indices[7] = 6;\n    indices[8] = 5;\n\n    if (p0Behind) {\n      getXZIntersectionOffsetPoints(p0, p1, u1, q1);\n      getXZIntersectionOffsetPoints(p0, p2, u2, q2);\n\n      indices[0] = 0;\n      indices[3] = 1;\n      indices[4] = 2;\n      indices[6] = 1;\n    } else if (p1Behind) {\n      getXZIntersectionOffsetPoints(p1, p2, u1, q1);\n      getXZIntersectionOffsetPoints(p1, p0, u2, q2);\n\n      indices[0] = 1;\n      indices[3] = 2;\n      indices[4] = 0;\n      indices[6] = 2;\n    } else if (p2Behind) {\n      getXZIntersectionOffsetPoints(p2, p0, u1, q1);\n      getXZIntersectionOffsetPoints(p2, p1, u2, q2);\n\n      indices[0] = 2;\n      indices[3] = 0;\n      indices[4] = 1;\n      indices[6] = 0;\n    }\n  } else if (numBehind === 2) {\n    indices[2] = 4;\n    indices[4] = 4;\n    indices[5] = 3;\n    indices[7] = 5;\n    indices[8] = 6;\n\n    if (!p0Behind) {\n      getXZIntersectionOffsetPoints(p0, p1, u1, q1);\n      getXZIntersectionOffsetPoints(p0, p2, u2, q2);\n\n      indices[0] = 1;\n      indices[1] = 2;\n      indices[3] = 1;\n      indices[6] = 0;\n    } else if (!p1Behind) {\n      getXZIntersectionOffsetPoints(p1, p2, u1, q1);\n      getXZIntersectionOffsetPoints(p1, p0, u2, q2);\n\n      indices[0] = 2;\n      indices[1] = 0;\n      indices[3] = 2;\n      indices[6] = 1;\n    } else if (!p2Behind) {\n      getXZIntersectionOffsetPoints(p2, p0, u1, q1);\n      getXZIntersectionOffsetPoints(p2, p1, u2, q2);\n\n      indices[0] = 0;\n      indices[1] = 1;\n      indices[3] = 0;\n      indices[6] = 2;\n    }\n  }\n\n  const positions = splitTriangleResult.positions;\n  positions[0] = p0;\n  positions[1] = p1;\n  positions[2] = p2;\n  positions.length = 3;\n\n  if (numBehind === 1 || numBehind === 2) {\n    positions[3] = u1;\n    positions[4] = u2;\n    positions[5] = q1;\n    positions[6] = q2;\n    positions.length = 7;\n  }\n\n  return splitTriangleResult;\n}\n\nfunction updateGeometryAfterSplit(geometry, computeBoundingSphere) {\n  const attributes = geometry.attributes;\n\n  if (attributes.position.values.length === 0) {\n    return undefined;\n  }\n\n  for (const property in attributes) {\n    if (\n      attributes.hasOwnProperty(property) &&\n      defined(attributes[property]) &&\n      defined(attributes[property].values)\n    ) {\n      const attribute = attributes[property];\n      attribute.values = ComponentDatatype.createTypedArray(\n        attribute.componentDatatype,\n        attribute.values\n      );\n    }\n  }\n\n  const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n  geometry.indices = IndexDatatype.createTypedArray(\n    numberOfVertices,\n    geometry.indices\n  );\n\n  if (computeBoundingSphere) {\n    geometry.boundingSphere = BoundingSphere.fromVertices(\n      attributes.position.values\n    );\n  }\n\n  return geometry;\n}\n\nfunction copyGeometryForSplit(geometry) {\n  const attributes = geometry.attributes;\n  const copiedAttributes = {};\n\n  for (const property in attributes) {\n    if (\n      attributes.hasOwnProperty(property) &&\n      defined(attributes[property]) &&\n      defined(attributes[property].values)\n    ) {\n      const attribute = attributes[property];\n      copiedAttributes[property] = new GeometryAttribute({\n        componentDatatype: attribute.componentDatatype,\n        componentsPerAttribute: attribute.componentsPerAttribute,\n        normalize: attribute.normalize,\n        values: [],\n      });\n    }\n  }\n\n  return new Geometry({\n    attributes: copiedAttributes,\n    indices: [],\n    primitiveType: geometry.primitiveType,\n  });\n}\n\nfunction updateInstanceAfterSplit(instance, westGeometry, eastGeometry) {\n  const computeBoundingSphere = defined(instance.geometry.boundingSphere);\n\n  westGeometry = updateGeometryAfterSplit(westGeometry, computeBoundingSphere);\n  eastGeometry = updateGeometryAfterSplit(eastGeometry, computeBoundingSphere);\n\n  if (defined(eastGeometry) && !defined(westGeometry)) {\n    instance.geometry = eastGeometry;\n  } else if (!defined(eastGeometry) && defined(westGeometry)) {\n    instance.geometry = westGeometry;\n  } else {\n    instance.westHemisphereGeometry = westGeometry;\n    instance.eastHemisphereGeometry = eastGeometry;\n    instance.geometry = undefined;\n  }\n}\n\nfunction generateBarycentricInterpolateFunction(\n  CartesianType,\n  numberOfComponents\n) {\n  const v0Scratch = new CartesianType();\n  const v1Scratch = new CartesianType();\n  const v2Scratch = new CartesianType();\n\n  return function (\n    i0,\n    i1,\n    i2,\n    coords,\n    sourceValues,\n    currentValues,\n    insertedIndex,\n    normalize\n  ) {\n    const v0 = CartesianType.fromArray(\n      sourceValues,\n      i0 * numberOfComponents,\n      v0Scratch\n    );\n    const v1 = CartesianType.fromArray(\n      sourceValues,\n      i1 * numberOfComponents,\n      v1Scratch\n    );\n    const v2 = CartesianType.fromArray(\n      sourceValues,\n      i2 * numberOfComponents,\n      v2Scratch\n    );\n\n    CartesianType.multiplyByScalar(v0, coords.x, v0);\n    CartesianType.multiplyByScalar(v1, coords.y, v1);\n    CartesianType.multiplyByScalar(v2, coords.z, v2);\n\n    const value = CartesianType.add(v0, v1, v0);\n    CartesianType.add(value, v2, value);\n\n    if (normalize) {\n      CartesianType.normalize(value, value);\n    }\n\n    CartesianType.pack(\n      value,\n      currentValues,\n      insertedIndex * numberOfComponents\n    );\n  };\n}\n\nconst interpolateAndPackCartesian4 = generateBarycentricInterpolateFunction(\n  Cartesian4,\n  4\n);\nconst interpolateAndPackCartesian3 = generateBarycentricInterpolateFunction(\n  Cartesian3,\n  3\n);\nconst interpolateAndPackCartesian2 = generateBarycentricInterpolateFunction(\n  Cartesian2,\n  2\n);\nconst interpolateAndPackBoolean = function (\n  i0,\n  i1,\n  i2,\n  coords,\n  sourceValues,\n  currentValues,\n  insertedIndex\n) {\n  const v1 = sourceValues[i0] * coords.x;\n  const v2 = sourceValues[i1] * coords.y;\n  const v3 = sourceValues[i2] * coords.z;\n  currentValues[insertedIndex] = v1 + v2 + v3 > CesiumMath.EPSILON6 ? 1 : 0;\n};\n\nconst p0Scratch = new Cartesian3();\nconst p1Scratch = new Cartesian3();\nconst p2Scratch = new Cartesian3();\nconst barycentricScratch = new Cartesian3();\n\nfunction computeTriangleAttributes(\n  i0,\n  i1,\n  i2,\n  point,\n  positions,\n  normals,\n  tangents,\n  bitangents,\n  texCoords,\n  extrudeDirections,\n  applyOffset,\n  currentAttributes,\n  customAttributeNames,\n  customAttributesLength,\n  allAttributes,\n  insertedIndex\n) {\n  if (\n    !defined(normals) &&\n    !defined(tangents) &&\n    !defined(bitangents) &&\n    !defined(texCoords) &&\n    !defined(extrudeDirections) &&\n    customAttributesLength === 0\n  ) {\n    return;\n  }\n\n  const p0 = Cartesian3.fromArray(positions, i0 * 3, p0Scratch);\n  const p1 = Cartesian3.fromArray(positions, i1 * 3, p1Scratch);\n  const p2 = Cartesian3.fromArray(positions, i2 * 3, p2Scratch);\n  const coords = barycentricCoordinates(point, p0, p1, p2, barycentricScratch);\n  if (!defined(coords)) {\n    return;\n  }\n\n  if (defined(normals)) {\n    interpolateAndPackCartesian3(\n      i0,\n      i1,\n      i2,\n      coords,\n      normals,\n      currentAttributes.normal.values,\n      insertedIndex,\n      true\n    );\n  }\n\n  if (defined(extrudeDirections)) {\n    const d0 = Cartesian3.fromArray(extrudeDirections, i0 * 3, p0Scratch);\n    const d1 = Cartesian3.fromArray(extrudeDirections, i1 * 3, p1Scratch);\n    const d2 = Cartesian3.fromArray(extrudeDirections, i2 * 3, p2Scratch);\n\n    Cartesian3.multiplyByScalar(d0, coords.x, d0);\n    Cartesian3.multiplyByScalar(d1, coords.y, d1);\n    Cartesian3.multiplyByScalar(d2, coords.z, d2);\n\n    let direction;\n    if (\n      !Cartesian3.equals(d0, Cartesian3.ZERO) ||\n      !Cartesian3.equals(d1, Cartesian3.ZERO) ||\n      !Cartesian3.equals(d2, Cartesian3.ZERO)\n    ) {\n      direction = Cartesian3.add(d0, d1, d0);\n      Cartesian3.add(direction, d2, direction);\n      Cartesian3.normalize(direction, direction);\n    } else {\n      direction = p0Scratch;\n      direction.x = 0;\n      direction.y = 0;\n      direction.z = 0;\n    }\n    Cartesian3.pack(\n      direction,\n      currentAttributes.extrudeDirection.values,\n      insertedIndex * 3\n    );\n  }\n\n  if (defined(applyOffset)) {\n    interpolateAndPackBoolean(\n      i0,\n      i1,\n      i2,\n      coords,\n      applyOffset,\n      currentAttributes.applyOffset.values,\n      insertedIndex\n    );\n  }\n\n  if (defined(tangents)) {\n    interpolateAndPackCartesian3(\n      i0,\n      i1,\n      i2,\n      coords,\n      tangents,\n      currentAttributes.tangent.values,\n      insertedIndex,\n      true\n    );\n  }\n\n  if (defined(bitangents)) {\n    interpolateAndPackCartesian3(\n      i0,\n      i1,\n      i2,\n      coords,\n      bitangents,\n      currentAttributes.bitangent.values,\n      insertedIndex,\n      true\n    );\n  }\n\n  if (defined(texCoords)) {\n    interpolateAndPackCartesian2(\n      i0,\n      i1,\n      i2,\n      coords,\n      texCoords,\n      currentAttributes.st.values,\n      insertedIndex\n    );\n  }\n\n  if (customAttributesLength > 0) {\n    for (let i = 0; i < customAttributesLength; i++) {\n      const attributeName = customAttributeNames[i];\n      genericInterpolate(\n        i0,\n        i1,\n        i2,\n        coords,\n        insertedIndex,\n        allAttributes[attributeName],\n        currentAttributes[attributeName]\n      );\n    }\n  }\n}\n\nfunction genericInterpolate(\n  i0,\n  i1,\n  i2,\n  coords,\n  insertedIndex,\n  sourceAttribute,\n  currentAttribute\n) {\n  const componentsPerAttribute = sourceAttribute.componentsPerAttribute;\n  const sourceValues = sourceAttribute.values;\n  const currentValues = currentAttribute.values;\n  switch (componentsPerAttribute) {\n    case 4:\n      interpolateAndPackCartesian4(\n        i0,\n        i1,\n        i2,\n        coords,\n        sourceValues,\n        currentValues,\n        insertedIndex,\n        false\n      );\n      break;\n    case 3:\n      interpolateAndPackCartesian3(\n        i0,\n        i1,\n        i2,\n        coords,\n        sourceValues,\n        currentValues,\n        insertedIndex,\n        false\n      );\n      break;\n    case 2:\n      interpolateAndPackCartesian2(\n        i0,\n        i1,\n        i2,\n        coords,\n        sourceValues,\n        currentValues,\n        insertedIndex,\n        false\n      );\n      break;\n    default:\n      currentValues[insertedIndex] =\n        sourceValues[i0] * coords.x +\n        sourceValues[i1] * coords.y +\n        sourceValues[i2] * coords.z;\n  }\n}\n\nfunction insertSplitPoint(\n  currentAttributes,\n  currentIndices,\n  currentIndexMap,\n  indices,\n  currentIndex,\n  point\n) {\n  const insertIndex = currentAttributes.position.values.length / 3;\n\n  if (currentIndex !== -1) {\n    const prevIndex = indices[currentIndex];\n    const newIndex = currentIndexMap[prevIndex];\n\n    if (newIndex === -1) {\n      currentIndexMap[prevIndex] = insertIndex;\n      currentAttributes.position.values.push(point.x, point.y, point.z);\n      currentIndices.push(insertIndex);\n      return insertIndex;\n    }\n\n    currentIndices.push(newIndex);\n    return newIndex;\n  }\n\n  currentAttributes.position.values.push(point.x, point.y, point.z);\n  currentIndices.push(insertIndex);\n  return insertIndex;\n}\n\nconst NAMED_ATTRIBUTES = {\n  position: true,\n  normal: true,\n  bitangent: true,\n  tangent: true,\n  st: true,\n  extrudeDirection: true,\n  applyOffset: true,\n};\nfunction splitLongitudeTriangles(instance) {\n  const geometry = instance.geometry;\n  const attributes = geometry.attributes;\n  const positions = attributes.position.values;\n  const normals = defined(attributes.normal)\n    ? attributes.normal.values\n    : undefined;\n  const bitangents = defined(attributes.bitangent)\n    ? attributes.bitangent.values\n    : undefined;\n  const tangents = defined(attributes.tangent)\n    ? attributes.tangent.values\n    : undefined;\n  const texCoords = defined(attributes.st) ? attributes.st.values : undefined;\n  const extrudeDirections = defined(attributes.extrudeDirection)\n    ? attributes.extrudeDirection.values\n    : undefined;\n  const applyOffset = defined(attributes.applyOffset)\n    ? attributes.applyOffset.values\n    : undefined;\n  const indices = geometry.indices;\n\n  const customAttributeNames = [];\n  for (const attributeName in attributes) {\n    if (\n      attributes.hasOwnProperty(attributeName) &&\n      !NAMED_ATTRIBUTES[attributeName] &&\n      defined(attributes[attributeName])\n    ) {\n      customAttributeNames.push(attributeName);\n    }\n  }\n  const customAttributesLength = customAttributeNames.length;\n\n  const eastGeometry = copyGeometryForSplit(geometry);\n  const westGeometry = copyGeometryForSplit(geometry);\n\n  let currentAttributes;\n  let currentIndices;\n  let currentIndexMap;\n  let insertedIndex;\n  let i;\n\n  const westGeometryIndexMap = [];\n  westGeometryIndexMap.length = positions.length / 3;\n\n  const eastGeometryIndexMap = [];\n  eastGeometryIndexMap.length = positions.length / 3;\n\n  for (i = 0; i < westGeometryIndexMap.length; ++i) {\n    westGeometryIndexMap[i] = -1;\n    eastGeometryIndexMap[i] = -1;\n  }\n\n  const len = indices.length;\n  for (i = 0; i < len; i += 3) {\n    const i0 = indices[i];\n    const i1 = indices[i + 1];\n    const i2 = indices[i + 2];\n\n    let p0 = Cartesian3.fromArray(positions, i0 * 3);\n    let p1 = Cartesian3.fromArray(positions, i1 * 3);\n    let p2 = Cartesian3.fromArray(positions, i2 * 3);\n\n    const result = splitTriangle(p0, p1, p2);\n    if (defined(result) && result.positions.length > 3) {\n      const resultPositions = result.positions;\n      const resultIndices = result.indices;\n      const resultLength = resultIndices.length;\n\n      for (let j = 0; j < resultLength; ++j) {\n        const resultIndex = resultIndices[j];\n        const point = resultPositions[resultIndex];\n\n        if (point.y < 0.0) {\n          currentAttributes = westGeometry.attributes;\n          currentIndices = westGeometry.indices;\n          currentIndexMap = westGeometryIndexMap;\n        } else {\n          currentAttributes = eastGeometry.attributes;\n          currentIndices = eastGeometry.indices;\n          currentIndexMap = eastGeometryIndexMap;\n        }\n\n        insertedIndex = insertSplitPoint(\n          currentAttributes,\n          currentIndices,\n          currentIndexMap,\n          indices,\n          resultIndex < 3 ? i + resultIndex : -1,\n          point\n        );\n        computeTriangleAttributes(\n          i0,\n          i1,\n          i2,\n          point,\n          positions,\n          normals,\n          tangents,\n          bitangents,\n          texCoords,\n          extrudeDirections,\n          applyOffset,\n          currentAttributes,\n          customAttributeNames,\n          customAttributesLength,\n          attributes,\n          insertedIndex\n        );\n      }\n    } else {\n      if (defined(result)) {\n        p0 = result.positions[0];\n        p1 = result.positions[1];\n        p2 = result.positions[2];\n      }\n\n      if (p0.y < 0.0) {\n        currentAttributes = westGeometry.attributes;\n        currentIndices = westGeometry.indices;\n        currentIndexMap = westGeometryIndexMap;\n      } else {\n        currentAttributes = eastGeometry.attributes;\n        currentIndices = eastGeometry.indices;\n        currentIndexMap = eastGeometryIndexMap;\n      }\n\n      insertedIndex = insertSplitPoint(\n        currentAttributes,\n        currentIndices,\n        currentIndexMap,\n        indices,\n        i,\n        p0\n      );\n      computeTriangleAttributes(\n        i0,\n        i1,\n        i2,\n        p0,\n        positions,\n        normals,\n        tangents,\n        bitangents,\n        texCoords,\n        extrudeDirections,\n        applyOffset,\n        currentAttributes,\n        customAttributeNames,\n        customAttributesLength,\n        attributes,\n        insertedIndex\n      );\n\n      insertedIndex = insertSplitPoint(\n        currentAttributes,\n        currentIndices,\n        currentIndexMap,\n        indices,\n        i + 1,\n        p1\n      );\n      computeTriangleAttributes(\n        i0,\n        i1,\n        i2,\n        p1,\n        positions,\n        normals,\n        tangents,\n        bitangents,\n        texCoords,\n        extrudeDirections,\n        applyOffset,\n        currentAttributes,\n        customAttributeNames,\n        customAttributesLength,\n        attributes,\n        insertedIndex\n      );\n\n      insertedIndex = insertSplitPoint(\n        currentAttributes,\n        currentIndices,\n        currentIndexMap,\n        indices,\n        i + 2,\n        p2\n      );\n      computeTriangleAttributes(\n        i0,\n        i1,\n        i2,\n        p2,\n        positions,\n        normals,\n        tangents,\n        bitangents,\n        texCoords,\n        extrudeDirections,\n        applyOffset,\n        currentAttributes,\n        customAttributeNames,\n        customAttributesLength,\n        attributes,\n        insertedIndex\n      );\n    }\n  }\n\n  updateInstanceAfterSplit(instance, westGeometry, eastGeometry);\n}\n\nconst xzPlane = Plane.fromPointNormal(Cartesian3.ZERO, Cartesian3.UNIT_Y);\n\nconst offsetScratch = new Cartesian3();\nconst offsetPointScratch = new Cartesian3();\n\nfunction computeLineAttributes(\n  i0,\n  i1,\n  point,\n  positions,\n  insertIndex,\n  currentAttributes,\n  applyOffset\n) {\n  if (!defined(applyOffset)) {\n    return;\n  }\n\n  const p0 = Cartesian3.fromArray(positions, i0 * 3, p0Scratch);\n  if (Cartesian3.equalsEpsilon(p0, point, CesiumMath.EPSILON10)) {\n    currentAttributes.applyOffset.values[insertIndex] = applyOffset[i0];\n  } else {\n    currentAttributes.applyOffset.values[insertIndex] = applyOffset[i1];\n  }\n}\n\nfunction splitLongitudeLines(instance) {\n  const geometry = instance.geometry;\n  const attributes = geometry.attributes;\n  const positions = attributes.position.values;\n  const applyOffset = defined(attributes.applyOffset)\n    ? attributes.applyOffset.values\n    : undefined;\n  const indices = geometry.indices;\n\n  const eastGeometry = copyGeometryForSplit(geometry);\n  const westGeometry = copyGeometryForSplit(geometry);\n\n  let i;\n  const length = indices.length;\n\n  const westGeometryIndexMap = [];\n  westGeometryIndexMap.length = positions.length / 3;\n\n  const eastGeometryIndexMap = [];\n  eastGeometryIndexMap.length = positions.length / 3;\n\n  for (i = 0; i < westGeometryIndexMap.length; ++i) {\n    westGeometryIndexMap[i] = -1;\n    eastGeometryIndexMap[i] = -1;\n  }\n\n  for (i = 0; i < length; i += 2) {\n    const i0 = indices[i];\n    const i1 = indices[i + 1];\n\n    const p0 = Cartesian3.fromArray(positions, i0 * 3, p0Scratch);\n    const p1 = Cartesian3.fromArray(positions, i1 * 3, p1Scratch);\n    let insertIndex;\n\n    if (Math.abs(p0.y) < CesiumMath.EPSILON6) {\n      if (p0.y < 0.0) {\n        p0.y = -CesiumMath.EPSILON6;\n      } else {\n        p0.y = CesiumMath.EPSILON6;\n      }\n    }\n\n    if (Math.abs(p1.y) < CesiumMath.EPSILON6) {\n      if (p1.y < 0.0) {\n        p1.y = -CesiumMath.EPSILON6;\n      } else {\n        p1.y = CesiumMath.EPSILON6;\n      }\n    }\n\n    let p0Attributes = eastGeometry.attributes;\n    let p0Indices = eastGeometry.indices;\n    let p0IndexMap = eastGeometryIndexMap;\n    let p1Attributes = westGeometry.attributes;\n    let p1Indices = westGeometry.indices;\n    let p1IndexMap = westGeometryIndexMap;\n\n    const intersection = IntersectionTests.lineSegmentPlane(\n      p0,\n      p1,\n      xzPlane,\n      p2Scratch\n    );\n    if (defined(intersection)) {\n      // move point on the xz-plane slightly away from the plane\n      const offset = Cartesian3.multiplyByScalar(\n        Cartesian3.UNIT_Y,\n        5.0 * CesiumMath.EPSILON9,\n        offsetScratch\n      );\n      if (p0.y < 0.0) {\n        Cartesian3.negate(offset, offset);\n\n        p0Attributes = westGeometry.attributes;\n        p0Indices = westGeometry.indices;\n        p0IndexMap = westGeometryIndexMap;\n        p1Attributes = eastGeometry.attributes;\n        p1Indices = eastGeometry.indices;\n        p1IndexMap = eastGeometryIndexMap;\n      }\n\n      const offsetPoint = Cartesian3.add(\n        intersection,\n        offset,\n        offsetPointScratch\n      );\n\n      insertIndex = insertSplitPoint(\n        p0Attributes,\n        p0Indices,\n        p0IndexMap,\n        indices,\n        i,\n        p0\n      );\n      computeLineAttributes(\n        i0,\n        i1,\n        p0,\n        positions,\n        insertIndex,\n        p0Attributes,\n        applyOffset\n      );\n\n      insertIndex = insertSplitPoint(\n        p0Attributes,\n        p0Indices,\n        p0IndexMap,\n        indices,\n        -1,\n        offsetPoint\n      );\n      computeLineAttributes(\n        i0,\n        i1,\n        offsetPoint,\n        positions,\n        insertIndex,\n        p0Attributes,\n        applyOffset\n      );\n\n      Cartesian3.negate(offset, offset);\n      Cartesian3.add(intersection, offset, offsetPoint);\n      insertIndex = insertSplitPoint(\n        p1Attributes,\n        p1Indices,\n        p1IndexMap,\n        indices,\n        -1,\n        offsetPoint\n      );\n      computeLineAttributes(\n        i0,\n        i1,\n        offsetPoint,\n        positions,\n        insertIndex,\n        p1Attributes,\n        applyOffset\n      );\n\n      insertIndex = insertSplitPoint(\n        p1Attributes,\n        p1Indices,\n        p1IndexMap,\n        indices,\n        i + 1,\n        p1\n      );\n      computeLineAttributes(\n        i0,\n        i1,\n        p1,\n        positions,\n        insertIndex,\n        p1Attributes,\n        applyOffset\n      );\n    } else {\n      let currentAttributes;\n      let currentIndices;\n      let currentIndexMap;\n\n      if (p0.y < 0.0) {\n        currentAttributes = westGeometry.attributes;\n        currentIndices = westGeometry.indices;\n        currentIndexMap = westGeometryIndexMap;\n      } else {\n        currentAttributes = eastGeometry.attributes;\n        currentIndices = eastGeometry.indices;\n        currentIndexMap = eastGeometryIndexMap;\n      }\n\n      insertIndex = insertSplitPoint(\n        currentAttributes,\n        currentIndices,\n        currentIndexMap,\n        indices,\n        i,\n        p0\n      );\n      computeLineAttributes(\n        i0,\n        i1,\n        p0,\n        positions,\n        insertIndex,\n        currentAttributes,\n        applyOffset\n      );\n\n      insertIndex = insertSplitPoint(\n        currentAttributes,\n        currentIndices,\n        currentIndexMap,\n        indices,\n        i + 1,\n        p1\n      );\n      computeLineAttributes(\n        i0,\n        i1,\n        p1,\n        positions,\n        insertIndex,\n        currentAttributes,\n        applyOffset\n      );\n    }\n  }\n\n  updateInstanceAfterSplit(instance, westGeometry, eastGeometry);\n}\n\nconst cartesian2Scratch0 = new Cartesian2();\nconst cartesian2Scratch1 = new Cartesian2();\n\nconst cartesian3Scratch0 = new Cartesian3();\nconst cartesian3Scratch2 = new Cartesian3();\nconst cartesian3Scratch3 = new Cartesian3();\nconst cartesian3Scratch4 = new Cartesian3();\nconst cartesian3Scratch5 = new Cartesian3();\nconst cartesian3Scratch6 = new Cartesian3();\n\nconst cartesian4Scratch0 = new Cartesian4();\n\nfunction updateAdjacencyAfterSplit(geometry) {\n  const attributes = geometry.attributes;\n  const positions = attributes.position.values;\n  const prevPositions = attributes.prevPosition.values;\n  const nextPositions = attributes.nextPosition.values;\n\n  const length = positions.length;\n  for (let j = 0; j < length; j += 3) {\n    const position = Cartesian3.unpack(positions, j, cartesian3Scratch0);\n    if (position.x > 0.0) {\n      continue;\n    }\n\n    const prevPosition = Cartesian3.unpack(\n      prevPositions,\n      j,\n      cartesian3Scratch2\n    );\n    if (\n      (position.y < 0.0 && prevPosition.y > 0.0) ||\n      (position.y > 0.0 && prevPosition.y < 0.0)\n    ) {\n      if (j - 3 > 0) {\n        prevPositions[j] = positions[j - 3];\n        prevPositions[j + 1] = positions[j - 2];\n        prevPositions[j + 2] = positions[j - 1];\n      } else {\n        Cartesian3.pack(position, prevPositions, j);\n      }\n    }\n\n    const nextPosition = Cartesian3.unpack(\n      nextPositions,\n      j,\n      cartesian3Scratch3\n    );\n    if (\n      (position.y < 0.0 && nextPosition.y > 0.0) ||\n      (position.y > 0.0 && nextPosition.y < 0.0)\n    ) {\n      if (j + 3 < length) {\n        nextPositions[j] = positions[j + 3];\n        nextPositions[j + 1] = positions[j + 4];\n        nextPositions[j + 2] = positions[j + 5];\n      } else {\n        Cartesian3.pack(position, nextPositions, j);\n      }\n    }\n  }\n}\n\nconst offsetScalar = 5.0 * CesiumMath.EPSILON9;\nconst coplanarOffset = CesiumMath.EPSILON6;\n\nfunction splitLongitudePolyline(instance) {\n  const geometry = instance.geometry;\n  const attributes = geometry.attributes;\n  const positions = attributes.position.values;\n  const prevPositions = attributes.prevPosition.values;\n  const nextPositions = attributes.nextPosition.values;\n  const expandAndWidths = attributes.expandAndWidth.values;\n\n  const texCoords = defined(attributes.st) ? attributes.st.values : undefined;\n  const colors = defined(attributes.color)\n    ? attributes.color.values\n    : undefined;\n\n  const eastGeometry = copyGeometryForSplit(geometry);\n  const westGeometry = copyGeometryForSplit(geometry);\n\n  let i;\n  let j;\n  let index;\n\n  let intersectionFound = false;\n\n  const length = positions.length / 3;\n  for (i = 0; i < length; i += 4) {\n    const i0 = i;\n    const i2 = i + 2;\n\n    const p0 = Cartesian3.fromArray(positions, i0 * 3, cartesian3Scratch0);\n    const p2 = Cartesian3.fromArray(positions, i2 * 3, cartesian3Scratch2);\n\n    // Offset points that are close to the 180 longitude and change the previous/next point\n    // to be the same offset point so it can be projected to 2D. There is special handling in the\n    // shader for when position == prevPosition || position == nextPosition.\n    if (Math.abs(p0.y) < coplanarOffset) {\n      p0.y = coplanarOffset * (p2.y < 0.0 ? -1.0 : 1.0);\n      positions[i * 3 + 1] = p0.y;\n      positions[(i + 1) * 3 + 1] = p0.y;\n\n      for (j = i0 * 3; j < i0 * 3 + 4 * 3; j += 3) {\n        prevPositions[j] = positions[i * 3];\n        prevPositions[j + 1] = positions[i * 3 + 1];\n        prevPositions[j + 2] = positions[i * 3 + 2];\n      }\n    }\n\n    // Do the same but for when the line crosses 180 longitude in the opposite direction.\n    if (Math.abs(p2.y) < coplanarOffset) {\n      p2.y = coplanarOffset * (p0.y < 0.0 ? -1.0 : 1.0);\n      positions[(i + 2) * 3 + 1] = p2.y;\n      positions[(i + 3) * 3 + 1] = p2.y;\n\n      for (j = i0 * 3; j < i0 * 3 + 4 * 3; j += 3) {\n        nextPositions[j] = positions[(i + 2) * 3];\n        nextPositions[j + 1] = positions[(i + 2) * 3 + 1];\n        nextPositions[j + 2] = positions[(i + 2) * 3 + 2];\n      }\n    }\n\n    let p0Attributes = eastGeometry.attributes;\n    let p0Indices = eastGeometry.indices;\n    let p2Attributes = westGeometry.attributes;\n    let p2Indices = westGeometry.indices;\n\n    const intersection = IntersectionTests.lineSegmentPlane(\n      p0,\n      p2,\n      xzPlane,\n      cartesian3Scratch4\n    );\n    if (defined(intersection)) {\n      intersectionFound = true;\n\n      // move point on the xz-plane slightly away from the plane\n      const offset = Cartesian3.multiplyByScalar(\n        Cartesian3.UNIT_Y,\n        offsetScalar,\n        cartesian3Scratch5\n      );\n      if (p0.y < 0.0) {\n        Cartesian3.negate(offset, offset);\n        p0Attributes = westGeometry.attributes;\n        p0Indices = westGeometry.indices;\n        p2Attributes = eastGeometry.attributes;\n        p2Indices = eastGeometry.indices;\n      }\n\n      const offsetPoint = Cartesian3.add(\n        intersection,\n        offset,\n        cartesian3Scratch6\n      );\n      p0Attributes.position.values.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z);\n      p0Attributes.position.values.push(\n        offsetPoint.x,\n        offsetPoint.y,\n        offsetPoint.z\n      );\n      p0Attributes.position.values.push(\n        offsetPoint.x,\n        offsetPoint.y,\n        offsetPoint.z\n      );\n\n      p0Attributes.prevPosition.values.push(\n        prevPositions[i0 * 3],\n        prevPositions[i0 * 3 + 1],\n        prevPositions[i0 * 3 + 2]\n      );\n      p0Attributes.prevPosition.values.push(\n        prevPositions[i0 * 3 + 3],\n        prevPositions[i0 * 3 + 4],\n        prevPositions[i0 * 3 + 5]\n      );\n      p0Attributes.prevPosition.values.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z);\n\n      p0Attributes.nextPosition.values.push(\n        offsetPoint.x,\n        offsetPoint.y,\n        offsetPoint.z\n      );\n      p0Attributes.nextPosition.values.push(\n        offsetPoint.x,\n        offsetPoint.y,\n        offsetPoint.z\n      );\n      p0Attributes.nextPosition.values.push(\n        offsetPoint.x,\n        offsetPoint.y,\n        offsetPoint.z\n      );\n      p0Attributes.nextPosition.values.push(\n        offsetPoint.x,\n        offsetPoint.y,\n        offsetPoint.z\n      );\n\n      Cartesian3.negate(offset, offset);\n      Cartesian3.add(intersection, offset, offsetPoint);\n      p2Attributes.position.values.push(\n        offsetPoint.x,\n        offsetPoint.y,\n        offsetPoint.z\n      );\n      p2Attributes.position.values.push(\n        offsetPoint.x,\n        offsetPoint.y,\n        offsetPoint.z\n      );\n      p2Attributes.position.values.push(p2.x, p2.y, p2.z, p2.x, p2.y, p2.z);\n\n      p2Attributes.prevPosition.values.push(\n        offsetPoint.x,\n        offsetPoint.y,\n        offsetPoint.z\n      );\n      p2Attributes.prevPosition.values.push(\n        offsetPoint.x,\n        offsetPoint.y,\n        offsetPoint.z\n      );\n      p2Attributes.prevPosition.values.push(\n        offsetPoint.x,\n        offsetPoint.y,\n        offsetPoint.z\n      );\n      p2Attributes.prevPosition.values.push(\n        offsetPoint.x,\n        offsetPoint.y,\n        offsetPoint.z\n      );\n\n      p2Attributes.nextPosition.values.push(p2.x, p2.y, p2.z, p2.x, p2.y, p2.z);\n      p2Attributes.nextPosition.values.push(\n        nextPositions[i2 * 3],\n        nextPositions[i2 * 3 + 1],\n        nextPositions[i2 * 3 + 2]\n      );\n      p2Attributes.nextPosition.values.push(\n        nextPositions[i2 * 3 + 3],\n        nextPositions[i2 * 3 + 4],\n        nextPositions[i2 * 3 + 5]\n      );\n\n      const ew0 = Cartesian2.fromArray(\n        expandAndWidths,\n        i0 * 2,\n        cartesian2Scratch0\n      );\n      const width = Math.abs(ew0.y);\n\n      p0Attributes.expandAndWidth.values.push(-1, width, 1, width);\n      p0Attributes.expandAndWidth.values.push(-1, -width, 1, -width);\n      p2Attributes.expandAndWidth.values.push(-1, width, 1, width);\n      p2Attributes.expandAndWidth.values.push(-1, -width, 1, -width);\n\n      let t = Cartesian3.magnitudeSquared(\n        Cartesian3.subtract(intersection, p0, cartesian3Scratch3)\n      );\n      t /= Cartesian3.magnitudeSquared(\n        Cartesian3.subtract(p2, p0, cartesian3Scratch3)\n      );\n\n      if (defined(colors)) {\n        const c0 = Cartesian4.fromArray(colors, i0 * 4, cartesian4Scratch0);\n        const c2 = Cartesian4.fromArray(colors, i2 * 4, cartesian4Scratch0);\n\n        const r = CesiumMath.lerp(c0.x, c2.x, t);\n        const g = CesiumMath.lerp(c0.y, c2.y, t);\n        const b = CesiumMath.lerp(c0.z, c2.z, t);\n        const a = CesiumMath.lerp(c0.w, c2.w, t);\n\n        for (j = i0 * 4; j < i0 * 4 + 2 * 4; ++j) {\n          p0Attributes.color.values.push(colors[j]);\n        }\n        p0Attributes.color.values.push(r, g, b, a);\n        p0Attributes.color.values.push(r, g, b, a);\n        p2Attributes.color.values.push(r, g, b, a);\n        p2Attributes.color.values.push(r, g, b, a);\n        for (j = i2 * 4; j < i2 * 4 + 2 * 4; ++j) {\n          p2Attributes.color.values.push(colors[j]);\n        }\n      }\n\n      if (defined(texCoords)) {\n        const s0 = Cartesian2.fromArray(texCoords, i0 * 2, cartesian2Scratch0);\n        const s3 = Cartesian2.fromArray(\n          texCoords,\n          (i + 3) * 2,\n          cartesian2Scratch1\n        );\n\n        const sx = CesiumMath.lerp(s0.x, s3.x, t);\n\n        for (j = i0 * 2; j < i0 * 2 + 2 * 2; ++j) {\n          p0Attributes.st.values.push(texCoords[j]);\n        }\n        p0Attributes.st.values.push(sx, s0.y);\n        p0Attributes.st.values.push(sx, s3.y);\n        p2Attributes.st.values.push(sx, s0.y);\n        p2Attributes.st.values.push(sx, s3.y);\n        for (j = i2 * 2; j < i2 * 2 + 2 * 2; ++j) {\n          p2Attributes.st.values.push(texCoords[j]);\n        }\n      }\n\n      index = p0Attributes.position.values.length / 3 - 4;\n      p0Indices.push(index, index + 2, index + 1);\n      p0Indices.push(index + 1, index + 2, index + 3);\n\n      index = p2Attributes.position.values.length / 3 - 4;\n      p2Indices.push(index, index + 2, index + 1);\n      p2Indices.push(index + 1, index + 2, index + 3);\n    } else {\n      let currentAttributes;\n      let currentIndices;\n\n      if (p0.y < 0.0) {\n        currentAttributes = westGeometry.attributes;\n        currentIndices = westGeometry.indices;\n      } else {\n        currentAttributes = eastGeometry.attributes;\n        currentIndices = eastGeometry.indices;\n      }\n\n      currentAttributes.position.values.push(p0.x, p0.y, p0.z);\n      currentAttributes.position.values.push(p0.x, p0.y, p0.z);\n      currentAttributes.position.values.push(p2.x, p2.y, p2.z);\n      currentAttributes.position.values.push(p2.x, p2.y, p2.z);\n\n      for (j = i * 3; j < i * 3 + 4 * 3; ++j) {\n        currentAttributes.prevPosition.values.push(prevPositions[j]);\n        currentAttributes.nextPosition.values.push(nextPositions[j]);\n      }\n\n      for (j = i * 2; j < i * 2 + 4 * 2; ++j) {\n        currentAttributes.expandAndWidth.values.push(expandAndWidths[j]);\n        if (defined(texCoords)) {\n          currentAttributes.st.values.push(texCoords[j]);\n        }\n      }\n\n      if (defined(colors)) {\n        for (j = i * 4; j < i * 4 + 4 * 4; ++j) {\n          currentAttributes.color.values.push(colors[j]);\n        }\n      }\n\n      index = currentAttributes.position.values.length / 3 - 4;\n      currentIndices.push(index, index + 2, index + 1);\n      currentIndices.push(index + 1, index + 2, index + 3);\n    }\n  }\n\n  if (intersectionFound) {\n    updateAdjacencyAfterSplit(westGeometry);\n    updateAdjacencyAfterSplit(eastGeometry);\n  }\n\n  updateInstanceAfterSplit(instance, westGeometry, eastGeometry);\n}\n\n/**\n * Splits the instances's geometry, by introducing new vertices and indices,that\n * intersect the International Date Line and Prime Meridian so that no primitives cross longitude\n * -180/180 degrees.  This is not required for 3D drawing, but is required for\n * correcting drawing in 2D and Columbus view.\n *\n * @private\n *\n * @param {GeometryInstance} instance The instance to modify.\n * @returns {GeometryInstance} The modified <code>instance</code> argument, with it's geometry split at the International Date Line.\n *\n * @example\n * instance = Cesium.GeometryPipeline.splitLongitude(instance);\n */\nGeometryPipeline.splitLongitude = function (instance) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(instance)) {\n    throw new DeveloperError(\"instance is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const geometry = instance.geometry;\n  const boundingSphere = geometry.boundingSphere;\n  if (defined(boundingSphere)) {\n    const minX = boundingSphere.center.x - boundingSphere.radius;\n    if (\n      minX > 0 ||\n      BoundingSphere.intersectPlane(boundingSphere, Plane.ORIGIN_ZX_PLANE) !==\n        Intersect.INTERSECTING\n    ) {\n      return instance;\n    }\n  }\n\n  if (geometry.geometryType !== GeometryType.NONE) {\n    switch (geometry.geometryType) {\n      case GeometryType.POLYLINES:\n        splitLongitudePolyline(instance);\n        break;\n      case GeometryType.TRIANGLES:\n        splitLongitudeTriangles(instance);\n        break;\n      case GeometryType.LINES:\n        splitLongitudeLines(instance);\n        break;\n    }\n  } else {\n    indexPrimitive(geometry);\n    if (geometry.primitiveType === PrimitiveType.TRIANGLES) {\n      splitLongitudeTriangles(instance);\n    } else if (geometry.primitiveType === PrimitiveType.LINES) {\n      splitLongitudeLines(instance);\n    }\n  }\n\n  return instance;\n};\nexport default GeometryPipeline;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857.  This\n * projection use longitude and latitude expressed with the WGS84 and transforms them to Mercator using\n * the spherical (rather than ellipsoidal) equations.\n *\n * @alias WebMercatorProjection\n * @constructor\n *\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid.\n *\n * @see GeographicProjection\n */\nfunction WebMercatorProjection(ellipsoid) {\n  this._ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n  this._semimajorAxis = this._ellipsoid.maximumRadius;\n  this._oneOverSemimajorAxis = 1.0 / this._semimajorAxis;\n}\n\nObject.defineProperties(WebMercatorProjection.prototype, {\n  /**\n   * Gets the {@link Ellipsoid}.\n   *\n   * @memberof WebMercatorProjection.prototype\n   *\n   * @type {Ellipsoid}\n   * @readonly\n   */\n  ellipsoid: {\n    get: function () {\n      return this._ellipsoid;\n    },\n  },\n});\n\n/**\n * Converts a Mercator angle, in the range -PI to PI, to a geodetic latitude\n * in the range -PI/2 to PI/2.\n *\n * @param {number} mercatorAngle The angle to convert.\n * @returns {number} The geodetic latitude in radians.\n */\nWebMercatorProjection.mercatorAngleToGeodeticLatitude = function (\n  mercatorAngle\n) {\n  return CesiumMath.PI_OVER_TWO - 2.0 * Math.atan(Math.exp(-mercatorAngle));\n};\n\n/**\n * Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercator\n * angle in the range -PI to PI.\n *\n * @param {number} latitude The geodetic latitude in radians.\n * @returns {number} The Mercator angle.\n */\nWebMercatorProjection.geodeticLatitudeToMercatorAngle = function (latitude) {\n  // Clamp the latitude coordinate to the valid Mercator bounds.\n  if (latitude > WebMercatorProjection.MaximumLatitude) {\n    latitude = WebMercatorProjection.MaximumLatitude;\n  } else if (latitude < -WebMercatorProjection.MaximumLatitude) {\n    latitude = -WebMercatorProjection.MaximumLatitude;\n  }\n  const sinLatitude = Math.sin(latitude);\n  return 0.5 * Math.log((1.0 + sinLatitude) / (1.0 - sinLatitude));\n};\n\n/**\n * The maximum latitude (both North and South) supported by a Web Mercator\n * (EPSG:3857) projection.  Technically, the Mercator projection is defined\n * for any latitude up to (but not including) 90 degrees, but it makes sense\n * to cut it off sooner because it grows exponentially with increasing latitude.\n * The logic behind this particular cutoff value, which is the one used by\n * Google Maps, Bing Maps, and Esri, is that it makes the projection\n * square.  That is, the rectangle is equal in the X and Y directions.\n *\n * The constant value is computed by calling:\n *    WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI)\n *\n * @type {number}\n */\nWebMercatorProjection.MaximumLatitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude(\n  Math.PI\n);\n\n/**\n * Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator\n * X, Y, Z coordinates expressed in meters and returned in a {@link Cartesian3}.  The height\n * is copied unmodified to the Z coordinate.\n *\n * @param {Cartographic} cartographic The cartographic coordinates in radians.\n * @param {Cartesian3} [result] The instance to which to copy the result, or undefined if a\n *        new instance should be created.\n * @returns {Cartesian3} The equivalent web mercator X, Y, Z coordinates, in meters.\n */\nWebMercatorProjection.prototype.project = function (cartographic, result) {\n  const semimajorAxis = this._semimajorAxis;\n  const x = cartographic.longitude * semimajorAxis;\n  const y =\n    WebMercatorProjection.geodeticLatitudeToMercatorAngle(\n      cartographic.latitude\n    ) * semimajorAxis;\n  const z = cartographic.height;\n\n  if (!defined(result)) {\n    return new Cartesian3(x, y, z);\n  }\n\n  result.x = x;\n  result.y = y;\n  result.z = z;\n  return result;\n};\n\n/**\n * Converts Web Mercator X, Y coordinates, expressed in meters, to a {@link Cartographic}\n * containing geodetic ellipsoid coordinates.  The Z coordinate is copied unmodified to the\n * height.\n *\n * @param {Cartesian3} cartesian The web mercator Cartesian position to unrproject with height (z) in meters.\n * @param {Cartographic} [result] The instance to which to copy the result, or undefined if a\n *        new instance should be created.\n * @returns {Cartographic} The equivalent cartographic coordinates.\n */\nWebMercatorProjection.prototype.unproject = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(cartesian)) {\n    throw new DeveloperError(\"cartesian is required\");\n  }\n  //>>includeEnd('debug');\n\n  const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;\n  const longitude = cartesian.x * oneOverEarthSemimajorAxis;\n  const latitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude(\n    cartesian.y * oneOverEarthSemimajorAxis\n  );\n  const height = cartesian.z;\n\n  if (!defined(result)) {\n    return new Cartographic(longitude, latitude, height);\n  }\n\n  result.longitude = longitude;\n  result.latitude = latitude;\n  result.height = height;\n  return result;\n};\nexport default WebMercatorProjection;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport GeographicProjection from \"../Core/GeographicProjection.js\";\nimport Geometry from \"../Core/Geometry.js\";\nimport GeometryAttribute from \"../Core/GeometryAttribute.js\";\nimport GeometryAttributes from \"../Core/GeometryAttributes.js\";\nimport GeometryPipeline from \"../Core/GeometryPipeline.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\n\nfunction transformToWorldCoordinates(\n  instances,\n  primitiveModelMatrix,\n  scene3DOnly\n) {\n  let toWorld = !scene3DOnly;\n  const length = instances.length;\n  let i;\n\n  if (!toWorld && length > 1) {\n    const modelMatrix = instances[0].modelMatrix;\n\n    for (i = 1; i < length; ++i) {\n      if (!Matrix4.equals(modelMatrix, instances[i].modelMatrix)) {\n        toWorld = true;\n        break;\n      }\n    }\n  }\n\n  if (toWorld) {\n    for (i = 0; i < length; ++i) {\n      if (defined(instances[i].geometry)) {\n        GeometryPipeline.transformToWorldCoordinates(instances[i]);\n      }\n    }\n  } else {\n    // Leave geometry in local coordinate system; auto update model-matrix.\n    Matrix4.multiplyTransformation(\n      primitiveModelMatrix,\n      instances[0].modelMatrix,\n      primitiveModelMatrix\n    );\n  }\n}\n\nfunction addGeometryBatchId(geometry, batchId) {\n  const attributes = geometry.attributes;\n  const positionAttr = attributes.position;\n  const numberOfComponents =\n    positionAttr.values.length / positionAttr.componentsPerAttribute;\n\n  attributes.batchId = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: 1,\n    values: new Float32Array(numberOfComponents),\n  });\n\n  const values = attributes.batchId.values;\n  for (let j = 0; j < numberOfComponents; ++j) {\n    values[j] = batchId;\n  }\n}\n\nfunction addBatchIds(instances) {\n  const length = instances.length;\n\n  for (let i = 0; i < length; ++i) {\n    const instance = instances[i];\n    if (defined(instance.geometry)) {\n      addGeometryBatchId(instance.geometry, i);\n    } else if (\n      defined(instance.westHemisphereGeometry) &&\n      defined(instance.eastHemisphereGeometry)\n    ) {\n      addGeometryBatchId(instance.westHemisphereGeometry, i);\n      addGeometryBatchId(instance.eastHemisphereGeometry, i);\n    }\n  }\n}\n\nfunction geometryPipeline(parameters) {\n  const instances = parameters.instances;\n  const projection = parameters.projection;\n  const uintIndexSupport = parameters.elementIndexUintSupported;\n  const scene3DOnly = parameters.scene3DOnly;\n  const vertexCacheOptimize = parameters.vertexCacheOptimize;\n  const compressVertices = parameters.compressVertices;\n  const modelMatrix = parameters.modelMatrix;\n\n  let i;\n  let geometry;\n  let primitiveType;\n  let length = instances.length;\n\n  for (i = 0; i < length; ++i) {\n    if (defined(instances[i].geometry)) {\n      primitiveType = instances[i].geometry.primitiveType;\n      break;\n    }\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  for (i = 1; i < length; ++i) {\n    if (\n      defined(instances[i].geometry) &&\n      instances[i].geometry.primitiveType !== primitiveType\n    ) {\n      throw new DeveloperError(\n        \"All instance geometries must have the same primitiveType.\"\n      );\n    }\n  }\n  //>>includeEnd('debug');\n\n  // Unify to world coordinates before combining.\n  transformToWorldCoordinates(instances, modelMatrix, scene3DOnly);\n\n  // Clip to IDL\n  if (!scene3DOnly) {\n    for (i = 0; i < length; ++i) {\n      if (defined(instances[i].geometry)) {\n        GeometryPipeline.splitLongitude(instances[i]);\n      }\n    }\n  }\n\n  addBatchIds(instances);\n\n  // Optimize for vertex shader caches\n  if (vertexCacheOptimize) {\n    for (i = 0; i < length; ++i) {\n      const instance = instances[i];\n      if (defined(instance.geometry)) {\n        GeometryPipeline.reorderForPostVertexCache(instance.geometry);\n        GeometryPipeline.reorderForPreVertexCache(instance.geometry);\n      } else if (\n        defined(instance.westHemisphereGeometry) &&\n        defined(instance.eastHemisphereGeometry)\n      ) {\n        GeometryPipeline.reorderForPostVertexCache(\n          instance.westHemisphereGeometry\n        );\n        GeometryPipeline.reorderForPreVertexCache(\n          instance.westHemisphereGeometry\n        );\n\n        GeometryPipeline.reorderForPostVertexCache(\n          instance.eastHemisphereGeometry\n        );\n        GeometryPipeline.reorderForPreVertexCache(\n          instance.eastHemisphereGeometry\n        );\n      }\n    }\n  }\n\n  // Combine into single geometry for better rendering performance.\n  let geometries = GeometryPipeline.combineInstances(instances);\n\n  length = geometries.length;\n  for (i = 0; i < length; ++i) {\n    geometry = geometries[i];\n\n    // Split positions for GPU RTE\n    const attributes = geometry.attributes;\n    if (!scene3DOnly) {\n      for (const name in attributes) {\n        if (\n          attributes.hasOwnProperty(name) &&\n          attributes[name].componentDatatype === ComponentDatatype.DOUBLE\n        ) {\n          const name3D = `${name}3D`;\n          const name2D = `${name}2D`;\n\n          // Compute 2D positions\n          GeometryPipeline.projectTo2D(\n            geometry,\n            name,\n            name3D,\n            name2D,\n            projection\n          );\n          if (defined(geometry.boundingSphere) && name === \"position\") {\n            geometry.boundingSphereCV = BoundingSphere.fromVertices(\n              geometry.attributes.position2D.values\n            );\n          }\n\n          GeometryPipeline.encodeAttribute(\n            geometry,\n            name3D,\n            `${name3D}High`,\n            `${name3D}Low`\n          );\n          GeometryPipeline.encodeAttribute(\n            geometry,\n            name2D,\n            `${name2D}High`,\n            `${name2D}Low`\n          );\n        }\n      }\n    } else {\n      for (const name in attributes) {\n        if (\n          attributes.hasOwnProperty(name) &&\n          attributes[name].componentDatatype === ComponentDatatype.DOUBLE\n        ) {\n          GeometryPipeline.encodeAttribute(\n            geometry,\n            name,\n            `${name}3DHigh`,\n            `${name}3DLow`\n          );\n        }\n      }\n    }\n\n    // oct encode and pack normals, compress texture coordinates\n    if (compressVertices) {\n      GeometryPipeline.compressVertices(geometry);\n    }\n  }\n\n  if (!uintIndexSupport) {\n    // Break into multiple geometries to fit within unsigned short indices if needed\n    let splitGeometries = [];\n    length = geometries.length;\n    for (i = 0; i < length; ++i) {\n      geometry = geometries[i];\n      splitGeometries = splitGeometries.concat(\n        GeometryPipeline.fitToUnsignedShortIndices(geometry)\n      );\n    }\n\n    geometries = splitGeometries;\n  }\n\n  return geometries;\n}\n\nfunction createPickOffsets(instances, geometryName, geometries, pickOffsets) {\n  let offset;\n  let indexCount;\n  let geometryIndex;\n\n  const offsetIndex = pickOffsets.length - 1;\n  if (offsetIndex >= 0) {\n    const pickOffset = pickOffsets[offsetIndex];\n    offset = pickOffset.offset + pickOffset.count;\n    geometryIndex = pickOffset.index;\n    indexCount = geometries[geometryIndex].indices.length;\n  } else {\n    offset = 0;\n    geometryIndex = 0;\n    indexCount = geometries[geometryIndex].indices.length;\n  }\n\n  const length = instances.length;\n  for (let i = 0; i < length; ++i) {\n    const instance = instances[i];\n    const geometry = instance[geometryName];\n    if (!defined(geometry)) {\n      continue;\n    }\n\n    const count = geometry.indices.length;\n\n    if (offset + count > indexCount) {\n      offset = 0;\n      indexCount = geometries[++geometryIndex].indices.length;\n    }\n\n    pickOffsets.push({\n      index: geometryIndex,\n      offset: offset,\n      count: count,\n    });\n    offset += count;\n  }\n}\n\nfunction createInstancePickOffsets(instances, geometries) {\n  const pickOffsets = [];\n  createPickOffsets(instances, \"geometry\", geometries, pickOffsets);\n  createPickOffsets(\n    instances,\n    \"westHemisphereGeometry\",\n    geometries,\n    pickOffsets\n  );\n  createPickOffsets(\n    instances,\n    \"eastHemisphereGeometry\",\n    geometries,\n    pickOffsets\n  );\n  return pickOffsets;\n}\n\n/**\n * @private\n */\nconst PrimitivePipeline = {};\n\n/**\n * @private\n */\nPrimitivePipeline.combineGeometry = function (parameters) {\n  let geometries;\n  let attributeLocations;\n  const instances = parameters.instances;\n  const length = instances.length;\n  let pickOffsets;\n\n  let offsetInstanceExtend;\n  let hasOffset = false;\n  if (length > 0) {\n    geometries = geometryPipeline(parameters);\n    if (geometries.length > 0) {\n      attributeLocations = GeometryPipeline.createAttributeLocations(\n        geometries[0]\n      );\n      if (parameters.createPickOffsets) {\n        pickOffsets = createInstancePickOffsets(instances, geometries);\n      }\n    }\n    if (\n      defined(instances[0].attributes) &&\n      defined(instances[0].attributes.offset)\n    ) {\n      offsetInstanceExtend = new Array(length);\n      hasOffset = true;\n    }\n  }\n\n  const boundingSpheres = new Array(length);\n  const boundingSpheresCV = new Array(length);\n  for (let i = 0; i < length; ++i) {\n    const instance = instances[i];\n    const geometry = instance.geometry;\n    if (defined(geometry)) {\n      boundingSpheres[i] = geometry.boundingSphere;\n      boundingSpheresCV[i] = geometry.boundingSphereCV;\n      if (hasOffset) {\n        offsetInstanceExtend[i] = instance.geometry.offsetAttribute;\n      }\n    }\n\n    const eastHemisphereGeometry = instance.eastHemisphereGeometry;\n    const westHemisphereGeometry = instance.westHemisphereGeometry;\n    if (defined(eastHemisphereGeometry) && defined(westHemisphereGeometry)) {\n      if (\n        defined(eastHemisphereGeometry.boundingSphere) &&\n        defined(westHemisphereGeometry.boundingSphere)\n      ) {\n        boundingSpheres[i] = BoundingSphere.union(\n          eastHemisphereGeometry.boundingSphere,\n          westHemisphereGeometry.boundingSphere\n        );\n      }\n      if (\n        defined(eastHemisphereGeometry.boundingSphereCV) &&\n        defined(westHemisphereGeometry.boundingSphereCV)\n      ) {\n        boundingSpheresCV[i] = BoundingSphere.union(\n          eastHemisphereGeometry.boundingSphereCV,\n          westHemisphereGeometry.boundingSphereCV\n        );\n      }\n    }\n  }\n\n  return {\n    geometries: geometries,\n    modelMatrix: parameters.modelMatrix,\n    attributeLocations: attributeLocations,\n    pickOffsets: pickOffsets,\n    offsetInstanceExtend: offsetInstanceExtend,\n    boundingSpheres: boundingSpheres,\n    boundingSpheresCV: boundingSpheresCV,\n  };\n};\n\nfunction transferGeometry(geometry, transferableObjects) {\n  const attributes = geometry.attributes;\n  for (const name in attributes) {\n    if (attributes.hasOwnProperty(name)) {\n      const attribute = attributes[name];\n\n      if (defined(attribute) && defined(attribute.values)) {\n        transferableObjects.push(attribute.values.buffer);\n      }\n    }\n  }\n\n  if (defined(geometry.indices)) {\n    transferableObjects.push(geometry.indices.buffer);\n  }\n}\n\nfunction transferGeometries(geometries, transferableObjects) {\n  const length = geometries.length;\n  for (let i = 0; i < length; ++i) {\n    transferGeometry(geometries[i], transferableObjects);\n  }\n}\n\n// This function was created by simplifying packCreateGeometryResults into a count-only operation.\nfunction countCreateGeometryResults(items) {\n  let count = 1;\n  const length = items.length;\n  for (let i = 0; i < length; i++) {\n    const geometry = items[i];\n    ++count;\n\n    if (!defined(geometry)) {\n      continue;\n    }\n\n    const attributes = geometry.attributes;\n\n    count +=\n      7 +\n      2 * BoundingSphere.packedLength +\n      (defined(geometry.indices) ? geometry.indices.length : 0);\n\n    for (const property in attributes) {\n      if (\n        attributes.hasOwnProperty(property) &&\n        defined(attributes[property])\n      ) {\n        const attribute = attributes[property];\n        count += 5 + attribute.values.length;\n      }\n    }\n  }\n\n  return count;\n}\n\n/**\n * @private\n */\nPrimitivePipeline.packCreateGeometryResults = function (\n  items,\n  transferableObjects\n) {\n  const packedData = new Float64Array(countCreateGeometryResults(items));\n  const stringTable = [];\n  const stringHash = {};\n\n  const length = items.length;\n  let count = 0;\n  packedData[count++] = length;\n  for (let i = 0; i < length; i++) {\n    const geometry = items[i];\n\n    const validGeometry = defined(geometry);\n    packedData[count++] = validGeometry ? 1.0 : 0.0;\n\n    if (!validGeometry) {\n      continue;\n    }\n\n    packedData[count++] = geometry.primitiveType;\n    packedData[count++] = geometry.geometryType;\n    packedData[count++] = defaultValue(geometry.offsetAttribute, -1);\n\n    const validBoundingSphere = defined(geometry.boundingSphere) ? 1.0 : 0.0;\n    packedData[count++] = validBoundingSphere;\n    if (validBoundingSphere) {\n      BoundingSphere.pack(geometry.boundingSphere, packedData, count);\n    }\n\n    count += BoundingSphere.packedLength;\n\n    const validBoundingSphereCV = defined(geometry.boundingSphereCV)\n      ? 1.0\n      : 0.0;\n    packedData[count++] = validBoundingSphereCV;\n    if (validBoundingSphereCV) {\n      BoundingSphere.pack(geometry.boundingSphereCV, packedData, count);\n    }\n\n    count += BoundingSphere.packedLength;\n\n    const attributes = geometry.attributes;\n    const attributesToWrite = [];\n    for (const property in attributes) {\n      if (\n        attributes.hasOwnProperty(property) &&\n        defined(attributes[property])\n      ) {\n        attributesToWrite.push(property);\n        if (!defined(stringHash[property])) {\n          stringHash[property] = stringTable.length;\n          stringTable.push(property);\n        }\n      }\n    }\n\n    packedData[count++] = attributesToWrite.length;\n    for (let q = 0; q < attributesToWrite.length; q++) {\n      const name = attributesToWrite[q];\n      const attribute = attributes[name];\n      packedData[count++] = stringHash[name];\n      packedData[count++] = attribute.componentDatatype;\n      packedData[count++] = attribute.componentsPerAttribute;\n      packedData[count++] = attribute.normalize ? 1 : 0;\n      packedData[count++] = attribute.values.length;\n      packedData.set(attribute.values, count);\n      count += attribute.values.length;\n    }\n\n    const indicesLength = defined(geometry.indices)\n      ? geometry.indices.length\n      : 0;\n    packedData[count++] = indicesLength;\n\n    if (indicesLength > 0) {\n      packedData.set(geometry.indices, count);\n      count += indicesLength;\n    }\n  }\n\n  transferableObjects.push(packedData.buffer);\n\n  return {\n    stringTable: stringTable,\n    packedData: packedData,\n  };\n};\n\n/**\n * @private\n */\nPrimitivePipeline.unpackCreateGeometryResults = function (\n  createGeometryResult\n) {\n  const stringTable = createGeometryResult.stringTable;\n  const packedGeometry = createGeometryResult.packedData;\n\n  let i;\n  const result = new Array(packedGeometry[0]);\n  let resultIndex = 0;\n\n  let packedGeometryIndex = 1;\n  while (packedGeometryIndex < packedGeometry.length) {\n    const valid = packedGeometry[packedGeometryIndex++] === 1.0;\n    if (!valid) {\n      result[resultIndex++] = undefined;\n      continue;\n    }\n\n    const primitiveType = packedGeometry[packedGeometryIndex++];\n    const geometryType = packedGeometry[packedGeometryIndex++];\n    let offsetAttribute = packedGeometry[packedGeometryIndex++];\n    if (offsetAttribute === -1) {\n      offsetAttribute = undefined;\n    }\n\n    let boundingSphere;\n    let boundingSphereCV;\n\n    const validBoundingSphere = packedGeometry[packedGeometryIndex++] === 1.0;\n    if (validBoundingSphere) {\n      boundingSphere = BoundingSphere.unpack(\n        packedGeometry,\n        packedGeometryIndex\n      );\n    }\n\n    packedGeometryIndex += BoundingSphere.packedLength;\n\n    const validBoundingSphereCV = packedGeometry[packedGeometryIndex++] === 1.0;\n    if (validBoundingSphereCV) {\n      boundingSphereCV = BoundingSphere.unpack(\n        packedGeometry,\n        packedGeometryIndex\n      );\n    }\n\n    packedGeometryIndex += BoundingSphere.packedLength;\n\n    let length;\n    let values;\n    let componentsPerAttribute;\n    const attributes = new GeometryAttributes();\n    const numAttributes = packedGeometry[packedGeometryIndex++];\n    for (i = 0; i < numAttributes; i++) {\n      const name = stringTable[packedGeometry[packedGeometryIndex++]];\n      const componentDatatype = packedGeometry[packedGeometryIndex++];\n      componentsPerAttribute = packedGeometry[packedGeometryIndex++];\n      const normalize = packedGeometry[packedGeometryIndex++] !== 0;\n\n      length = packedGeometry[packedGeometryIndex++];\n      values = ComponentDatatype.createTypedArray(componentDatatype, length);\n      for (let valuesIndex = 0; valuesIndex < length; valuesIndex++) {\n        values[valuesIndex] = packedGeometry[packedGeometryIndex++];\n      }\n\n      attributes[name] = new GeometryAttribute({\n        componentDatatype: componentDatatype,\n        componentsPerAttribute: componentsPerAttribute,\n        normalize: normalize,\n        values: values,\n      });\n    }\n\n    let indices;\n    length = packedGeometry[packedGeometryIndex++];\n\n    if (length > 0) {\n      const numberOfVertices = values.length / componentsPerAttribute;\n      indices = IndexDatatype.createTypedArray(numberOfVertices, length);\n      for (i = 0; i < length; i++) {\n        indices[i] = packedGeometry[packedGeometryIndex++];\n      }\n    }\n\n    result[resultIndex++] = new Geometry({\n      primitiveType: primitiveType,\n      geometryType: geometryType,\n      boundingSphere: boundingSphere,\n      boundingSphereCV: boundingSphereCV,\n      indices: indices,\n      attributes: attributes,\n      offsetAttribute: offsetAttribute,\n    });\n  }\n\n  return result;\n};\n\nfunction packInstancesForCombine(instances, transferableObjects) {\n  const length = instances.length;\n  const packedData = new Float64Array(1 + length * 19);\n  let count = 0;\n  packedData[count++] = length;\n  for (let i = 0; i < length; i++) {\n    const instance = instances[i];\n    Matrix4.pack(instance.modelMatrix, packedData, count);\n    count += Matrix4.packedLength;\n    if (defined(instance.attributes) && defined(instance.attributes.offset)) {\n      const values = instance.attributes.offset.value;\n      packedData[count] = values[0];\n      packedData[count + 1] = values[1];\n      packedData[count + 2] = values[2];\n    }\n    count += 3;\n  }\n  transferableObjects.push(packedData.buffer);\n\n  return packedData;\n}\n\nfunction unpackInstancesForCombine(data) {\n  const packedInstances = data;\n  const result = new Array(packedInstances[0]);\n  let count = 0;\n\n  let i = 1;\n  while (i < packedInstances.length) {\n    const modelMatrix = Matrix4.unpack(packedInstances, i);\n    let attributes;\n    i += Matrix4.packedLength;\n    if (defined(packedInstances[i])) {\n      attributes = {\n        offset: new OffsetGeometryInstanceAttribute(\n          packedInstances[i],\n          packedInstances[i + 1],\n          packedInstances[i + 2]\n        ),\n      };\n    }\n    i += 3;\n\n    result[count++] = {\n      modelMatrix: modelMatrix,\n      attributes: attributes,\n    };\n  }\n\n  return result;\n}\n\n/**\n * @private\n */\nPrimitivePipeline.packCombineGeometryParameters = function (\n  parameters,\n  transferableObjects\n) {\n  const createGeometryResults = parameters.createGeometryResults;\n  const length = createGeometryResults.length;\n\n  for (let i = 0; i < length; i++) {\n    transferableObjects.push(createGeometryResults[i].packedData.buffer);\n  }\n\n  return {\n    createGeometryResults: parameters.createGeometryResults,\n    packedInstances: packInstancesForCombine(\n      parameters.instances,\n      transferableObjects\n    ),\n    ellipsoid: parameters.ellipsoid,\n    isGeographic: parameters.projection instanceof GeographicProjection,\n    elementIndexUintSupported: parameters.elementIndexUintSupported,\n    scene3DOnly: parameters.scene3DOnly,\n    vertexCacheOptimize: parameters.vertexCacheOptimize,\n    compressVertices: parameters.compressVertices,\n    modelMatrix: parameters.modelMatrix,\n    createPickOffsets: parameters.createPickOffsets,\n  };\n};\n\n/**\n * @private\n */\nPrimitivePipeline.unpackCombineGeometryParameters = function (\n  packedParameters\n) {\n  const instances = unpackInstancesForCombine(packedParameters.packedInstances);\n  const createGeometryResults = packedParameters.createGeometryResults;\n  const length = createGeometryResults.length;\n  let instanceIndex = 0;\n\n  for (let resultIndex = 0; resultIndex < length; resultIndex++) {\n    const geometries = PrimitivePipeline.unpackCreateGeometryResults(\n      createGeometryResults[resultIndex]\n    );\n    const geometriesLength = geometries.length;\n    for (\n      let geometryIndex = 0;\n      geometryIndex < geometriesLength;\n      geometryIndex++\n    ) {\n      const geometry = geometries[geometryIndex];\n      const instance = instances[instanceIndex];\n      instance.geometry = geometry;\n      ++instanceIndex;\n    }\n  }\n\n  const ellipsoid = Ellipsoid.clone(packedParameters.ellipsoid);\n  const projection = packedParameters.isGeographic\n    ? new GeographicProjection(ellipsoid)\n    : new WebMercatorProjection(ellipsoid);\n\n  return {\n    instances: instances,\n    ellipsoid: ellipsoid,\n    projection: projection,\n    elementIndexUintSupported: packedParameters.elementIndexUintSupported,\n    scene3DOnly: packedParameters.scene3DOnly,\n    vertexCacheOptimize: packedParameters.vertexCacheOptimize,\n    compressVertices: packedParameters.compressVertices,\n    modelMatrix: Matrix4.clone(packedParameters.modelMatrix),\n    createPickOffsets: packedParameters.createPickOffsets,\n  };\n};\n\nfunction packBoundingSpheres(boundingSpheres) {\n  const length = boundingSpheres.length;\n  const bufferLength = 1 + (BoundingSphere.packedLength + 1) * length;\n  const buffer = new Float32Array(bufferLength);\n\n  let bufferIndex = 0;\n  buffer[bufferIndex++] = length;\n\n  for (let i = 0; i < length; ++i) {\n    const bs = boundingSpheres[i];\n    if (!defined(bs)) {\n      buffer[bufferIndex++] = 0.0;\n    } else {\n      buffer[bufferIndex++] = 1.0;\n      BoundingSphere.pack(boundingSpheres[i], buffer, bufferIndex);\n    }\n    bufferIndex += BoundingSphere.packedLength;\n  }\n\n  return buffer;\n}\n\nfunction unpackBoundingSpheres(buffer) {\n  const result = new Array(buffer[0]);\n  let count = 0;\n\n  let i = 1;\n  while (i < buffer.length) {\n    if (buffer[i++] === 1.0) {\n      result[count] = BoundingSphere.unpack(buffer, i);\n    }\n    ++count;\n    i += BoundingSphere.packedLength;\n  }\n\n  return result;\n}\n\n/**\n * @private\n */\nPrimitivePipeline.packCombineGeometryResults = function (\n  results,\n  transferableObjects\n) {\n  if (defined(results.geometries)) {\n    transferGeometries(results.geometries, transferableObjects);\n  }\n\n  const packedBoundingSpheres = packBoundingSpheres(results.boundingSpheres);\n  const packedBoundingSpheresCV = packBoundingSpheres(\n    results.boundingSpheresCV\n  );\n  transferableObjects.push(\n    packedBoundingSpheres.buffer,\n    packedBoundingSpheresCV.buffer\n  );\n\n  return {\n    geometries: results.geometries,\n    attributeLocations: results.attributeLocations,\n    modelMatrix: results.modelMatrix,\n    pickOffsets: results.pickOffsets,\n    offsetInstanceExtend: results.offsetInstanceExtend,\n    boundingSpheres: packedBoundingSpheres,\n    boundingSpheresCV: packedBoundingSpheresCV,\n  };\n};\n\n/**\n * @private\n */\nPrimitivePipeline.unpackCombineGeometryResults = function (packedResult) {\n  return {\n    geometries: packedResult.geometries,\n    attributeLocations: packedResult.attributeLocations,\n    modelMatrix: packedResult.modelMatrix,\n    pickOffsets: packedResult.pickOffsets,\n    offsetInstanceExtend: packedResult.offsetInstanceExtend,\n    boundingSpheres: unpackBoundingSpheres(packedResult.boundingSpheres),\n    boundingSpheresCV: unpackBoundingSpheres(packedResult.boundingSpheresCV),\n  };\n};\nexport default PrimitivePipeline;\n", "/**\n * @private\n */\nconst PrimitiveState = {\n  READY: 0,\n  CREATING: 1,\n  CREATED: 2,\n  COMBINING: 3,\n  COMBINED: 4,\n  COMPLETE: 5,\n  FAILED: 6,\n};\nexport default Object.freeze(PrimitiveState);\n", "/**\n * Specifies whether the object casts or receives shadows from light sources when\n * shadows are enabled.\n *\n * @enum {number}\n */\nconst ShadowMode = {\n  /**\n   * The object does not cast or receive shadows.\n   *\n   * @type {number}\n   * @constant\n   */\n  DISABLED: 0,\n\n  /**\n   * The object casts and receives shadows.\n   *\n   * @type {number}\n   * @constant\n   */\n  ENABLED: 1,\n\n  /**\n   * The object casts shadows only.\n   *\n   * @type {number}\n   * @constant\n   */\n  CAST_ONLY: 2,\n\n  /**\n   * The object receives shadows only.\n   *\n   * @type {number}\n   * @constant\n   */\n  RECEIVE_ONLY: 3,\n};\n\n/**\n * @private\n */\nShadowMode.NUMBER_OF_SHADOW_MODES = 4;\n\n/**\n * @private\n */\nShadowMode.castShadows = function (shadowMode) {\n  return (\n    shadowMode === ShadowMode.ENABLED || shadowMode === ShadowMode.CAST_ONLY\n  );\n};\n\n/**\n * @private\n */\nShadowMode.receiveShadows = function (shadowMode) {\n  return (\n    shadowMode === ShadowMode.ENABLED || shadowMode === ShadowMode.RECEIVE_ONLY\n  );\n};\n\n/**\n * @private\n */\nShadowMode.fromCastReceive = function (castShadows, receiveShadows) {\n  if (castShadows && receiveShadows) {\n    return ShadowMode.ENABLED;\n  } else if (castShadows) {\n    return ShadowMode.CAST_ONLY;\n  } else if (receiveShadows) {\n    return ShadowMode.RECEIVE_ONLY;\n  }\n  return ShadowMode.DISABLED;\n};\n\nexport default Object.freeze(ShadowMode);\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport combine from \"../Core/combine.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EncodedCartesian3 from \"../Core/EncodedCartesian3.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport Geometry from \"../Core/Geometry.js\";\nimport GeometryAttribute from \"../Core/GeometryAttribute.js\";\nimport GeometryAttributes from \"../Core/GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"../Core/GeometryOffsetAttribute.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Plane from \"../Core/Plane.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport subdivideArray from \"../Core/subdivideArray.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport BatchTable from \"./BatchTable.js\";\nimport CullFace from \"./CullFace.js\";\nimport DepthFunction from \"./DepthFunction.js\";\nimport PrimitivePipeline from \"./PrimitivePipeline.js\";\nimport PrimitiveState from \"./PrimitiveState.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowMode from \"./ShadowMode.js\";\n\n/**\n * A primitive represents geometry in the {@link Scene}.  The geometry can be from a single {@link GeometryInstance}\n * as shown in example 1 below, or from an array of instances, even if the geometry is from different\n * geometry types, e.g., an {@link RectangleGeometry} and an {@link EllipsoidGeometry} as shown in Code Example 2.\n * <p>\n * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including\n * {@link Material} and {@link RenderState}.  Roughly, the geometry instance defines the structure and placement,\n * and the appearance defines the visual characteristics.  Decoupling geometry and appearance allows us to mix\n * and match most of them and add a new geometry or appearance independently of each other.\n * </p>\n * <p>\n * Combining multiple instances into one primitive is called batching, and significantly improves performance for static data.\n * Instances can be individually picked; {@link Scene#pick} returns their {@link GeometryInstance#id}.  Using\n * per-instance appearances like {@link PerInstanceColorAppearance}, each instance can also have a unique color.\n * </p>\n * <p>\n * {@link Geometry} can either be created and batched on a web worker or the main thread. The first two examples\n * show geometry that will be created on a web worker by using the descriptions of the geometry. The third example\n * shows how to create the geometry on the main thread by explicitly calling the <code>createGeometry</code> method.\n * </p>\n *\n * @alias Primitive\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {GeometryInstance[]|GeometryInstance} [options.geometryInstances] The geometry instances - or a single geometry instance - to render.\n * @param {Appearance} [options.appearance] The appearance used to render the primitive.\n * @param {Appearance} [options.depthFailAppearance] The appearance used to shade this primitive when it fails the depth test.\n * @param {boolean} [options.show=true] Determines if this primitive will be shown.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.\n * @param {boolean} [options.vertexCacheOptimize=false] When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.\n * @param {boolean} [options.interleave=false] When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.\n * @param {boolean} [options.compressVertices=true] When <code>true</code>, the geometry vertices are compressed, which will save memory.\n * @param {boolean} [options.releaseGeometryInstances=true] When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n * @param {boolean} [options.allowPicking=true] When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}.  When <code>false</code>, GPU memory is saved.\n * @param {boolean} [options.cull=true] When <code>true</code>, the renderer frustum culls and horizon culls the primitive's commands based on their bounding volume.  Set this to <code>false</code> for a small performance gain if you are manually culling the primitive.\n * @param {boolean} [options.asynchronous=true] Determines if the primitive will be created asynchronously or block until ready.\n * @param {boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {ShadowMode} [options.shadows=ShadowMode.DISABLED] Determines whether this primitive casts or receives shadows from light sources.\n *\n * @example\n * // 1. Draw a translucent ellipse on the surface with a checkerboard pattern\n * const instance = new Cesium.GeometryInstance({\n *   geometry : new Cesium.EllipseGeometry({\n *       center : Cesium.Cartesian3.fromDegrees(-100.0, 20.0),\n *       semiMinorAxis : 500000.0,\n *       semiMajorAxis : 1000000.0,\n *       rotation : Cesium.Math.PI_OVER_FOUR,\n *       vertexFormat : Cesium.VertexFormat.POSITION_AND_ST\n *   }),\n *   id : 'object returned when this instance is picked and to get/set per-instance attributes'\n * });\n * scene.primitives.add(new Cesium.Primitive({\n *   geometryInstances : instance,\n *   appearance : new Cesium.EllipsoidSurfaceAppearance({\n *     material : Cesium.Material.fromType('Checkerboard')\n *   })\n * }));\n *\n * @example\n * // 2. Draw different instances each with a unique color\n * const rectangleInstance = new Cesium.GeometryInstance({\n *   geometry : new Cesium.RectangleGeometry({\n *     rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0),\n *     vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT\n *   }),\n *   id : 'rectangle',\n *   attributes : {\n *     color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)\n *   }\n * });\n * const ellipsoidInstance = new Cesium.GeometryInstance({\n *   geometry : new Cesium.EllipsoidGeometry({\n *     radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),\n *     vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL\n *   }),\n *   modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n *     Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),\n *   id : 'ellipsoid',\n *   attributes : {\n *     color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)\n *   }\n * });\n * scene.primitives.add(new Cesium.Primitive({\n *   geometryInstances : [rectangleInstance, ellipsoidInstance],\n *   appearance : new Cesium.PerInstanceColorAppearance()\n * }));\n *\n * @example\n * // 3. Create the geometry on the main thread.\n * scene.primitives.add(new Cesium.Primitive({\n *   geometryInstances : new Cesium.GeometryInstance({\n *     geometry : Cesium.EllipsoidGeometry.createGeometry(new Cesium.EllipsoidGeometry({\n *       radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),\n *       vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL\n *     })),\n *     modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n *       Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),\n *     id : 'ellipsoid',\n *     attributes : {\n *       color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)\n *     }\n *   }),\n *   appearance : new Cesium.PerInstanceColorAppearance(),\n *   asynchronous : false\n * }));\n *\n * @see GeometryInstance\n * @see Appearance\n * @see ClassificationPrimitive\n * @see GroundPrimitive\n */\nfunction Primitive(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * The geometry instances rendered with this primitive.  This may\n   * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>\n   * is <code>true</code> when the primitive is constructed.\n   * <p>\n   * Changing this property after the primitive is rendered has no effect.\n   * </p>\n   *\n   * @readonly\n   * @type GeometryInstance[]|GeometryInstance\n   *\n   * @default undefined\n   */\n  this.geometryInstances = options.geometryInstances;\n\n  /**\n   * The {@link Appearance} used to shade this primitive. Each geometry\n   * instance is shaded with the same appearance.  Some appearances, like\n   * {@link PerInstanceColorAppearance} allow giving each instance unique\n   * properties.\n   *\n   * @type Appearance\n   *\n   * @default undefined\n   */\n  this.appearance = options.appearance;\n  this._appearance = undefined;\n  this._material = undefined;\n\n  /**\n   * The {@link Appearance} used to shade this primitive when it fails the depth test. Each geometry\n   * instance is shaded with the same appearance.  Some appearances, like\n   * {@link PerInstanceColorAppearance} allow giving each instance unique\n   * properties.\n   *\n   * <p>\n   * When using an appearance that requires a color attribute, like PerInstanceColorAppearance,\n   * add a depthFailColor per-instance attribute instead.\n   * </p>\n   *\n   * <p>\n   * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,\n   * there may be artifacts.\n   * </p>\n   * @type Appearance\n   *\n   * @default undefined\n   */\n  this.depthFailAppearance = options.depthFailAppearance;\n  this._depthFailAppearance = undefined;\n  this._depthFailMaterial = undefined;\n\n  /**\n   * The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.\n   * When this is the identity matrix, the primitive is drawn in world coordinates, i.e., Earth's WGS84 coordinates.\n   * Local reference frames can be used by providing a different transformation matrix, like that returned\n   * by {@link Transforms.eastNorthUpToFixedFrame}.\n   *\n   * <p>\n   * This property is only supported in 3D mode.\n   * </p>\n   *\n   * @type Matrix4\n   *\n   * @default Matrix4.IDENTITY\n   *\n   * @example\n   * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);\n   * p.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);\n   */\n  this.modelMatrix = Matrix4.clone(\n    defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n  );\n  this._modelMatrix = new Matrix4();\n\n  /**\n   * Determines if the primitive will be shown.  This affects all geometry\n   * instances in the primitive.\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  this._vertexCacheOptimize = defaultValue(options.vertexCacheOptimize, false);\n  this._interleave = defaultValue(options.interleave, false);\n  this._releaseGeometryInstances = defaultValue(\n    options.releaseGeometryInstances,\n    true\n  );\n  this._allowPicking = defaultValue(options.allowPicking, true);\n  this._asynchronous = defaultValue(options.asynchronous, true);\n  this._compressVertices = defaultValue(options.compressVertices, true);\n\n  /**\n   * When <code>true</code>, the renderer frustum culls and horizon culls the primitive's commands\n   * based on their bounding volume.  Set this to <code>false</code> for a small performance gain\n   * if you are manually culling the primitive.\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  this.cull = defaultValue(options.cull, true);\n\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the bounding sphere for each draw command in the primitive.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowBoundingVolume = defaultValue(\n    options.debugShowBoundingVolume,\n    false\n  );\n\n  /**\n   * @private\n   */\n  this.rtcCenter = options.rtcCenter;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    defined(this.rtcCenter) &&\n    (!defined(this.geometryInstances) ||\n      (Array.isArray(this.geometryInstances) &&\n        this.geometryInstances.length !== 1))\n  ) {\n    throw new DeveloperError(\n      \"Relative-to-center rendering only supports one geometry instance.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  /**\n   * Determines whether this primitive casts or receives shadows from light sources.\n   *\n   * @type {ShadowMode}\n   *\n   * @default ShadowMode.DISABLED\n   */\n  this.shadows = defaultValue(options.shadows, ShadowMode.DISABLED);\n\n  this._translucent = undefined;\n\n  this._state = PrimitiveState.READY;\n  this._geometries = [];\n  this._error = undefined;\n  this._numberOfInstances = 0;\n\n  this._boundingSpheres = [];\n  this._boundingSphereWC = [];\n  this._boundingSphereCV = [];\n  this._boundingSphere2D = [];\n  this._boundingSphereMorph = [];\n  this._perInstanceAttributeCache = new Map();\n  this._instanceIds = [];\n  this._lastPerInstanceAttributeIndex = 0;\n\n  this._va = [];\n  this._attributeLocations = undefined;\n  this._primitiveType = undefined;\n\n  this._frontFaceRS = undefined;\n  this._backFaceRS = undefined;\n  this._sp = undefined;\n\n  this._depthFailAppearance = undefined;\n  this._spDepthFail = undefined;\n  this._frontFaceDepthFailRS = undefined;\n  this._backFaceDepthFailRS = undefined;\n\n  this._pickIds = [];\n\n  this._colorCommands = [];\n  this._pickCommands = [];\n\n  this._createBoundingVolumeFunction = options._createBoundingVolumeFunction;\n  this._createRenderStatesFunction = options._createRenderStatesFunction;\n  this._createShaderProgramFunction = options._createShaderProgramFunction;\n  this._createCommandsFunction = options._createCommandsFunction;\n  this._updateAndQueueCommandsFunction =\n    options._updateAndQueueCommandsFunction;\n\n  this._createPickOffsets = options._createPickOffsets;\n  this._pickOffsets = undefined;\n\n  this._createGeometryResults = undefined;\n  this._ready = false;\n\n  this._batchTable = undefined;\n  this._batchTableAttributeIndices = undefined;\n  this._offsetInstanceExtend = undefined;\n  this._batchTableOffsetAttribute2DIndex = undefined;\n  this._batchTableOffsetsUpdated = false;\n  this._instanceBoundingSpheres = undefined;\n  this._instanceBoundingSpheresCV = undefined;\n  this._tempBoundingSpheres = undefined;\n  this._recomputeBoundingSpheres = false;\n  this._batchTableBoundingSpheresUpdated = false;\n  this._batchTableBoundingSphereAttributeIndices = undefined;\n}\n\nObject.defineProperties(Primitive.prototype, {\n  /**\n   * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.\n   *\n   * @memberof Primitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  vertexCacheOptimize: {\n    get: function () {\n      return this._vertexCacheOptimize;\n    },\n  },\n\n  /**\n   * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.\n   *\n   * @memberof Primitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  interleave: {\n    get: function () {\n      return this._interleave;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n   *\n   * @memberof Primitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  releaseGeometryInstances: {\n    get: function () {\n      return this._releaseGeometryInstances;\n    },\n  },\n\n  /**\n   * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}.  When <code>false</code>, GPU memory is saved.         *\n   *\n   * @memberof Primitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  allowPicking: {\n    get: function () {\n      return this._allowPicking;\n    },\n  },\n\n  /**\n   * Determines if the geometry instances will be created and batched on a web worker.\n   *\n   * @memberof Primitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  asynchronous: {\n    get: function () {\n      return this._asynchronous;\n    },\n  },\n\n  /**\n   * When <code>true</code>, geometry vertices are compressed, which will save memory.\n   *\n   * @memberof Primitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  compressVertices: {\n    get: function () {\n      return this._compressVertices;\n    },\n  },\n\n  /**\n   * Determines if the primitive is complete and ready to render.  If this property is\n   * true, the primitive will be rendered the next time that {@link Primitive#update}\n   * is called.\n   *\n   * @memberof Primitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @example\n   * // Wait for a primitive to become ready before accessing attributes\n   * const removeListener = scene.postRender.addEventListener(() => {\n   *   if (!frustumPrimitive.ready) {\n   *     return;\n   *   }\n   *\n   *   const attributes = primitive.getGeometryInstanceAttributes('an id');\n   *   attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);\n   *\n   *   removeListener();\n   * });\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n});\n\nfunction getCommonPerInstanceAttributeNames(instances) {\n  const length = instances.length;\n\n  const attributesInAllInstances = [];\n  const attributes0 = instances[0].attributes;\n  let name;\n\n  for (name in attributes0) {\n    if (attributes0.hasOwnProperty(name) && defined(attributes0[name])) {\n      const attribute = attributes0[name];\n      let inAllInstances = true;\n\n      // Does this same attribute exist in all instances?\n      for (let i = 1; i < length; ++i) {\n        const otherAttribute = instances[i].attributes[name];\n\n        if (\n          !defined(otherAttribute) ||\n          attribute.componentDatatype !== otherAttribute.componentDatatype ||\n          attribute.componentsPerAttribute !==\n            otherAttribute.componentsPerAttribute ||\n          attribute.normalize !== otherAttribute.normalize\n        ) {\n          inAllInstances = false;\n          break;\n        }\n      }\n\n      if (inAllInstances) {\n        attributesInAllInstances.push(name);\n      }\n    }\n  }\n\n  return attributesInAllInstances;\n}\n\nconst scratchGetAttributeCartesian2 = new Cartesian2();\nconst scratchGetAttributeCartesian3 = new Cartesian3();\nconst scratchGetAttributeCartesian4 = new Cartesian4();\n\nfunction getAttributeValue(value) {\n  const componentsPerAttribute = value.length;\n  if (componentsPerAttribute === 1) {\n    return value[0];\n  } else if (componentsPerAttribute === 2) {\n    return Cartesian2.unpack(value, 0, scratchGetAttributeCartesian2);\n  } else if (componentsPerAttribute === 3) {\n    return Cartesian3.unpack(value, 0, scratchGetAttributeCartesian3);\n  } else if (componentsPerAttribute === 4) {\n    return Cartesian4.unpack(value, 0, scratchGetAttributeCartesian4);\n  }\n}\n\nfunction createBatchTable(primitive, context) {\n  const geometryInstances = primitive.geometryInstances;\n  const instances = Array.isArray(geometryInstances)\n    ? geometryInstances\n    : [geometryInstances];\n  const numberOfInstances = instances.length;\n  if (numberOfInstances === 0) {\n    return;\n  }\n\n  const names = getCommonPerInstanceAttributeNames(instances);\n  const length = names.length;\n\n  const attributes = [];\n  const attributeIndices = {};\n  const boundingSphereAttributeIndices = {};\n  let offset2DIndex;\n\n  const firstInstance = instances[0];\n  let instanceAttributes = firstInstance.attributes;\n\n  let i;\n  let name;\n  let attribute;\n\n  for (i = 0; i < length; ++i) {\n    name = names[i];\n    attribute = instanceAttributes[name];\n\n    attributeIndices[name] = i;\n    attributes.push({\n      functionName: `czm_batchTable_${name}`,\n      componentDatatype: attribute.componentDatatype,\n      componentsPerAttribute: attribute.componentsPerAttribute,\n      normalize: attribute.normalize,\n    });\n  }\n\n  if (names.indexOf(\"distanceDisplayCondition\") !== -1) {\n    attributes.push(\n      {\n        functionName: \"czm_batchTable_boundingSphereCenter3DHigh\",\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n      },\n      {\n        functionName: \"czm_batchTable_boundingSphereCenter3DLow\",\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n      },\n      {\n        functionName: \"czm_batchTable_boundingSphereCenter2DHigh\",\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n      },\n      {\n        functionName: \"czm_batchTable_boundingSphereCenter2DLow\",\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n      },\n      {\n        functionName: \"czm_batchTable_boundingSphereRadius\",\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 1,\n      }\n    );\n    boundingSphereAttributeIndices.center3DHigh = attributes.length - 5;\n    boundingSphereAttributeIndices.center3DLow = attributes.length - 4;\n    boundingSphereAttributeIndices.center2DHigh = attributes.length - 3;\n    boundingSphereAttributeIndices.center2DLow = attributes.length - 2;\n    boundingSphereAttributeIndices.radius = attributes.length - 1;\n  }\n\n  if (names.indexOf(\"offset\") !== -1) {\n    attributes.push({\n      functionName: \"czm_batchTable_offset2D\",\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n    });\n    offset2DIndex = attributes.length - 1;\n  }\n\n  attributes.push({\n    functionName: \"czm_batchTable_pickColor\",\n    componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n    componentsPerAttribute: 4,\n    normalize: true,\n  });\n\n  const attributesLength = attributes.length;\n  const batchTable = new BatchTable(context, attributes, numberOfInstances);\n\n  for (i = 0; i < numberOfInstances; ++i) {\n    const instance = instances[i];\n    instanceAttributes = instance.attributes;\n\n    for (let j = 0; j < length; ++j) {\n      name = names[j];\n      attribute = instanceAttributes[name];\n      const value = getAttributeValue(attribute.value);\n      const attributeIndex = attributeIndices[name];\n      batchTable.setBatchedAttribute(i, attributeIndex, value);\n    }\n\n    const pickObject = {\n      primitive: defaultValue(instance.pickPrimitive, primitive),\n    };\n\n    if (defined(instance.id)) {\n      pickObject.id = instance.id;\n    }\n\n    const pickId = context.createPickId(pickObject);\n    primitive._pickIds.push(pickId);\n\n    const pickColor = pickId.color;\n    const color = scratchGetAttributeCartesian4;\n    color.x = Color.floatToByte(pickColor.red);\n    color.y = Color.floatToByte(pickColor.green);\n    color.z = Color.floatToByte(pickColor.blue);\n    color.w = Color.floatToByte(pickColor.alpha);\n\n    batchTable.setBatchedAttribute(i, attributesLength - 1, color);\n  }\n\n  primitive._batchTable = batchTable;\n  primitive._batchTableAttributeIndices = attributeIndices;\n  primitive._batchTableBoundingSphereAttributeIndices = boundingSphereAttributeIndices;\n  primitive._batchTableOffsetAttribute2DIndex = offset2DIndex;\n}\n\nfunction cloneAttribute(attribute) {\n  let clonedValues;\n  if (Array.isArray(attribute.values)) {\n    clonedValues = attribute.values.slice(0);\n  } else {\n    clonedValues = new attribute.values.constructor(attribute.values);\n  }\n  return new GeometryAttribute({\n    componentDatatype: attribute.componentDatatype,\n    componentsPerAttribute: attribute.componentsPerAttribute,\n    normalize: attribute.normalize,\n    values: clonedValues,\n  });\n}\n\nfunction cloneGeometry(geometry) {\n  const attributes = geometry.attributes;\n  const newAttributes = new GeometryAttributes();\n  for (const property in attributes) {\n    if (attributes.hasOwnProperty(property) && defined(attributes[property])) {\n      newAttributes[property] = cloneAttribute(attributes[property]);\n    }\n  }\n\n  let indices;\n  if (defined(geometry.indices)) {\n    const sourceValues = geometry.indices;\n    if (Array.isArray(sourceValues)) {\n      indices = sourceValues.slice(0);\n    } else {\n      indices = new sourceValues.constructor(sourceValues);\n    }\n  }\n\n  return new Geometry({\n    attributes: newAttributes,\n    indices: indices,\n    primitiveType: geometry.primitiveType,\n    boundingSphere: BoundingSphere.clone(geometry.boundingSphere),\n  });\n}\n\nfunction cloneInstance(instance, geometry) {\n  return {\n    geometry: geometry,\n    attributes: instance.attributes,\n    modelMatrix: Matrix4.clone(instance.modelMatrix),\n    pickPrimitive: instance.pickPrimitive,\n    id: instance.id,\n  };\n}\n\nconst positionRegex = /in\\s+vec(?:3|4)\\s+(.*)3DHigh;/g;\n\nPrimitive._modifyShaderPosition = function (\n  primitive,\n  vertexShaderSource,\n  scene3DOnly\n) {\n  let match;\n\n  let forwardDecl = \"\";\n  let attributes = \"\";\n  let computeFunctions = \"\";\n\n  while ((match = positionRegex.exec(vertexShaderSource)) !== null) {\n    const name = match[1];\n\n    const functionName = `vec4 czm_compute${name[0].toUpperCase()}${name.substr(\n      1\n    )}()`;\n\n    // Don't forward-declare czm_computePosition because computePosition.glsl already does.\n    if (functionName !== \"vec4 czm_computePosition()\") {\n      forwardDecl += `${functionName};\\n`;\n    }\n\n    if (!defined(primitive.rtcCenter)) {\n      // Use GPU RTE\n      if (!scene3DOnly) {\n        attributes += `in vec3 ${name}2DHigh;\\nin vec3 ${name}2DLow;\\n`;\n\n        computeFunctions +=\n          `${functionName}\\n` +\n          `{\\n` +\n          `    vec4 p;\\n` +\n          `    if (czm_morphTime == 1.0)\\n` +\n          `    {\\n` +\n          `        p = czm_translateRelativeToEye(${name}3DHigh, ${name}3DLow);\\n` +\n          `    }\\n` +\n          `    else if (czm_morphTime == 0.0)\\n` +\n          `    {\\n` +\n          `        p = czm_translateRelativeToEye(${name}2DHigh.zxy, ${name}2DLow.zxy);\\n` +\n          `    }\\n` +\n          `    else\\n` +\n          `    {\\n` +\n          `        p = czm_columbusViewMorph(\\n` +\n          `                czm_translateRelativeToEye(${name}2DHigh.zxy, ${name}2DLow.zxy),\\n` +\n          `                czm_translateRelativeToEye(${name}3DHigh, ${name}3DLow),\\n` +\n          `                czm_morphTime);\\n` +\n          `    }\\n` +\n          `    return p;\\n` +\n          `}\\n\\n`;\n      } else {\n        computeFunctions +=\n          `${functionName}\\n` +\n          `{\\n` +\n          `    return czm_translateRelativeToEye(${name}3DHigh, ${name}3DLow);\\n` +\n          `}\\n\\n`;\n      }\n    } else {\n      // Use RTC\n      vertexShaderSource = vertexShaderSource.replace(\n        /in\\s+vec(?:3|4)\\s+position3DHigh;/g,\n        \"\"\n      );\n      vertexShaderSource = vertexShaderSource.replace(\n        /in\\s+vec(?:3|4)\\s+position3DLow;/g,\n        \"\"\n      );\n\n      forwardDecl += \"uniform mat4 u_modifiedModelView;\\n\";\n      attributes += \"in vec4 position;\\n\";\n\n      computeFunctions +=\n        `${functionName}\\n` +\n        `{\\n` +\n        `    return u_modifiedModelView * position;\\n` +\n        `}\\n\\n`;\n\n      vertexShaderSource = vertexShaderSource.replace(\n        /czm_modelViewRelativeToEye\\s+\\*\\s+/g,\n        \"\"\n      );\n      vertexShaderSource = vertexShaderSource.replace(\n        /czm_modelViewProjectionRelativeToEye/g,\n        \"czm_projection\"\n      );\n    }\n  }\n\n  return [forwardDecl, attributes, vertexShaderSource, computeFunctions].join(\n    \"\\n\"\n  );\n};\n\nPrimitive._appendShowToShader = function (primitive, vertexShaderSource) {\n  if (!defined(primitive._batchTableAttributeIndices.show)) {\n    return vertexShaderSource;\n  }\n\n  const renamedVS = ShaderSource.replaceMain(\n    vertexShaderSource,\n    \"czm_non_show_main\"\n  );\n  const showMain =\n    \"void main() \\n\" +\n    \"{ \\n\" +\n    \"    czm_non_show_main(); \\n\" +\n    \"    gl_Position *= czm_batchTable_show(batchId); \\n\" +\n    \"}\";\n\n  return `${renamedVS}\\n${showMain}`;\n};\n\nPrimitive._updateColorAttribute = function (\n  primitive,\n  vertexShaderSource,\n  isDepthFail\n) {\n  // some appearances have a color attribute for per vertex color.\n  // only remove if color is a per instance attribute.\n  if (\n    !defined(primitive._batchTableAttributeIndices.color) &&\n    !defined(primitive._batchTableAttributeIndices.depthFailColor)\n  ) {\n    return vertexShaderSource;\n  }\n\n  if (vertexShaderSource.search(/in\\s+vec4\\s+color;/g) === -1) {\n    return vertexShaderSource;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    isDepthFail &&\n    !defined(primitive._batchTableAttributeIndices.depthFailColor)\n  ) {\n    throw new DeveloperError(\n      \"A depthFailColor per-instance attribute is required when using a depth fail appearance that uses a color attribute.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  let modifiedVS = vertexShaderSource;\n  modifiedVS = modifiedVS.replace(/in\\s+vec4\\s+color;/g, \"\");\n  if (!isDepthFail) {\n    modifiedVS = modifiedVS.replace(\n      /(\\b)color(\\b)/g,\n      \"$1czm_batchTable_color(batchId)$2\"\n    );\n  } else {\n    modifiedVS = modifiedVS.replace(\n      /(\\b)color(\\b)/g,\n      \"$1czm_batchTable_depthFailColor(batchId)$2\"\n    );\n  }\n  return modifiedVS;\n};\n\nfunction appendPickToVertexShader(source) {\n  const renamedVS = ShaderSource.replaceMain(source, \"czm_non_pick_main\");\n  const pickMain =\n    \"out vec4 v_pickColor; \\n\" +\n    \"void main() \\n\" +\n    \"{ \\n\" +\n    \"    czm_non_pick_main(); \\n\" +\n    \"    v_pickColor = czm_batchTable_pickColor(batchId); \\n\" +\n    \"}\";\n\n  return `${renamedVS}\\n${pickMain}`;\n}\n\nfunction appendPickToFragmentShader(source) {\n  return `in vec4 v_pickColor;\\n${source}`;\n}\n\nPrimitive._updatePickColorAttribute = function (source) {\n  let vsPick = source.replace(/in\\s+vec4\\s+pickColor;/g, \"\");\n  vsPick = vsPick.replace(\n    /(\\b)pickColor(\\b)/g,\n    \"$1czm_batchTable_pickColor(batchId)$2\"\n  );\n  return vsPick;\n};\n\nPrimitive._appendOffsetToShader = function (primitive, vertexShaderSource) {\n  if (!defined(primitive._batchTableAttributeIndices.offset)) {\n    return vertexShaderSource;\n  }\n\n  let attr = \"in float batchId;\\n\";\n  attr += \"in float applyOffset;\";\n  let modifiedShader = vertexShaderSource.replace(\n    /in\\s+float\\s+batchId;/g,\n    attr\n  );\n\n  let str = \"vec4 $1 = czm_computePosition();\\n\";\n  str += \"    if (czm_sceneMode == czm_sceneMode3D)\\n\";\n  str += \"    {\\n\";\n  str +=\n    \"        $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);\";\n  str += \"    }\\n\";\n  str += \"    else\\n\";\n  str += \"    {\\n\";\n  str +=\n    \"        $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);\";\n  str += \"    }\\n\";\n  modifiedShader = modifiedShader.replace(\n    /vec4\\s+([A-Za-z0-9_]+)\\s+=\\s+czm_computePosition\\(\\);/g,\n    str\n  );\n  return modifiedShader;\n};\n\nPrimitive._appendDistanceDisplayConditionToShader = function (\n  primitive,\n  vertexShaderSource,\n  scene3DOnly\n) {\n  if (\n    !defined(primitive._batchTableAttributeIndices.distanceDisplayCondition)\n  ) {\n    return vertexShaderSource;\n  }\n\n  const renamedVS = ShaderSource.replaceMain(\n    vertexShaderSource,\n    \"czm_non_distanceDisplayCondition_main\"\n  );\n  let distanceDisplayConditionMain =\n    \"void main() \\n\" +\n    \"{ \\n\" +\n    \"    czm_non_distanceDisplayCondition_main(); \\n\" +\n    \"    vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);\\n\" +\n    \"    vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);\\n\" +\n    \"    vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);\\n\" +\n    \"    float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);\\n\";\n\n  if (!scene3DOnly) {\n    distanceDisplayConditionMain +=\n      \"    vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);\\n\" +\n      \"    vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);\\n\" +\n      \"    vec4 centerRTE;\\n\" +\n      \"    if (czm_morphTime == 1.0)\\n\" +\n      \"    {\\n\" +\n      \"        centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\\n\" +\n      \"    }\\n\" +\n      \"    else if (czm_morphTime == 0.0)\\n\" +\n      \"    {\\n\" +\n      \"        centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);\\n\" +\n      \"    }\\n\" +\n      \"    else\\n\" +\n      \"    {\\n\" +\n      \"        centerRTE = czm_columbusViewMorph(\\n\" +\n      \"                czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),\\n\" +\n      \"                czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),\\n\" +\n      \"                czm_morphTime);\\n\" +\n      \"    }\\n\";\n  } else {\n    distanceDisplayConditionMain +=\n      \"    vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\\n\";\n  }\n\n  distanceDisplayConditionMain +=\n    \"    float radiusSq = boundingSphereRadius * boundingSphereRadius; \\n\" +\n    \"    float distanceSq; \\n\" +\n    \"    if (czm_sceneMode == czm_sceneMode2D) \\n\" +\n    \"    { \\n\" +\n    \"        distanceSq = czm_eyeHeight2D.y - radiusSq; \\n\" +\n    \"    } \\n\" +\n    \"    else \\n\" +\n    \"    { \\n\" +\n    \"        distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; \\n\" +\n    \"    } \\n\" +\n    \"    distanceSq = max(distanceSq, 0.0); \\n\" +\n    \"    float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; \\n\" +\n    \"    float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; \\n\" +\n    \"    float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; \\n\" +\n    \"    gl_Position *= show; \\n\" +\n    \"}\";\n  return `${renamedVS}\\n${distanceDisplayConditionMain}`;\n};\n\nfunction modifyForEncodedNormals(primitive, vertexShaderSource) {\n  if (!primitive.compressVertices) {\n    return vertexShaderSource;\n  }\n\n  const containsNormal =\n    vertexShaderSource.search(/in\\s+vec3\\s+normal;/g) !== -1;\n  const containsSt = vertexShaderSource.search(/in\\s+vec2\\s+st;/g) !== -1;\n  if (!containsNormal && !containsSt) {\n    return vertexShaderSource;\n  }\n\n  const containsTangent =\n    vertexShaderSource.search(/in\\s+vec3\\s+tangent;/g) !== -1;\n  const containsBitangent =\n    vertexShaderSource.search(/in\\s+vec3\\s+bitangent;/g) !== -1;\n\n  let numComponents = containsSt && containsNormal ? 2.0 : 1.0;\n  numComponents += containsTangent || containsBitangent ? 1 : 0;\n\n  const type = numComponents > 1 ? `vec${numComponents}` : \"float\";\n\n  const attributeName = \"compressedAttributes\";\n  const attributeDecl = `in ${type} ${attributeName};`;\n\n  let globalDecl = \"\";\n  let decode = \"\";\n\n  if (containsSt) {\n    globalDecl += \"vec2 st;\\n\";\n    const stComponent =\n      numComponents > 1 ? `${attributeName}.x` : attributeName;\n    decode += `    st = czm_decompressTextureCoordinates(${stComponent});\\n`;\n  }\n\n  if (containsNormal && containsTangent && containsBitangent) {\n    globalDecl += \"vec3 normal;\\n\" + \"vec3 tangent;\\n\" + \"vec3 bitangent;\\n\";\n    decode += `    czm_octDecode(${attributeName}.${\n      containsSt ? \"yz\" : \"xy\"\n    }, normal, tangent, bitangent);\\n`;\n  } else {\n    if (containsNormal) {\n      globalDecl += \"vec3 normal;\\n\";\n      decode += `    normal = czm_octDecode(${attributeName}${\n        numComponents > 1 ? `.${containsSt ? \"y\" : \"x\"}` : \"\"\n      });\\n`;\n    }\n\n    if (containsTangent) {\n      globalDecl += \"vec3 tangent;\\n\";\n      decode += `    tangent = czm_octDecode(${attributeName}.${\n        containsSt && containsNormal ? \"z\" : \"y\"\n      });\\n`;\n    }\n\n    if (containsBitangent) {\n      globalDecl += \"vec3 bitangent;\\n\";\n      decode += `    bitangent = czm_octDecode(${attributeName}.${\n        containsSt && containsNormal ? \"z\" : \"y\"\n      });\\n`;\n    }\n  }\n\n  let modifiedVS = vertexShaderSource;\n  modifiedVS = modifiedVS.replace(/in\\s+vec3\\s+normal;/g, \"\");\n  modifiedVS = modifiedVS.replace(/in\\s+vec2\\s+st;/g, \"\");\n  modifiedVS = modifiedVS.replace(/in\\s+vec3\\s+tangent;/g, \"\");\n  modifiedVS = modifiedVS.replace(/in\\s+vec3\\s+bitangent;/g, \"\");\n  modifiedVS = ShaderSource.replaceMain(modifiedVS, \"czm_non_compressed_main\");\n  const compressedMain =\n    `${\"void main() \\n\" + \"{ \\n\"}${decode}    czm_non_compressed_main(); \\n` +\n    `}`;\n\n  return [attributeDecl, globalDecl, modifiedVS, compressedMain].join(\"\\n\");\n}\n\nfunction depthClampVS(vertexShaderSource) {\n  let modifiedVS = ShaderSource.replaceMain(\n    vertexShaderSource,\n    \"czm_non_depth_clamp_main\"\n  );\n  modifiedVS +=\n    \"void main() {\\n\" +\n    \"    czm_non_depth_clamp_main();\\n\" +\n    \"    gl_Position = czm_depthClamp(gl_Position);\" +\n    \"}\\n\";\n  return modifiedVS;\n}\n\nfunction depthClampFS(fragmentShaderSource) {\n  let modifiedFS = ShaderSource.replaceMain(\n    fragmentShaderSource,\n    \"czm_non_depth_clamp_main\"\n  );\n  modifiedFS +=\n    \"void main() {\\n\" +\n    \"    czm_non_depth_clamp_main();\\n\" +\n    \"    #if defined(LOG_DEPTH)\\n\" +\n    \"        czm_writeLogDepth();\\n\" +\n    \"    #else\\n\" +\n    \"        czm_writeDepthClamp();\\n\" +\n    \"    #endif\\n\" +\n    \"}\\n\";\n  return modifiedFS;\n}\n\nfunction validateShaderMatching(shaderProgram, attributeLocations) {\n  // For a VAO and shader program to be compatible, the VAO must have\n  // all active attribute in the shader program.  The VAO may have\n  // extra attributes with the only concern being a potential\n  // performance hit due to extra memory bandwidth and cache pollution.\n  // The shader source could have extra attributes that are not used,\n  // but there is no guarantee they will be optimized out.\n  //\n  // Here, we validate that the VAO has all attributes required\n  // to match the shader program.\n  const shaderAttributes = shaderProgram.vertexAttributes;\n\n  //>>includeStart('debug', pragmas.debug);\n  for (const name in shaderAttributes) {\n    if (shaderAttributes.hasOwnProperty(name)) {\n      if (!defined(attributeLocations[name])) {\n        throw new DeveloperError(\n          `Appearance/Geometry mismatch.  The appearance requires vertex shader attribute input '${name}', which was not computed as part of the Geometry.  Use the appearance's vertexFormat property when constructing the geometry.`\n        );\n      }\n    }\n  }\n  //>>includeEnd('debug');\n}\n\nfunction getUniformFunction(uniforms, name) {\n  return function () {\n    return uniforms[name];\n  };\n}\n\nconst numberOfCreationWorkers = Math.max(\n  FeatureDetection.hardwareConcurrency - 1,\n  1\n);\nlet createGeometryTaskProcessors;\nconst combineGeometryTaskProcessor = new TaskProcessor(\"combineGeometry\");\n\nfunction loadAsynchronous(primitive, frameState) {\n  let instances;\n  let geometry;\n  let i;\n  let j;\n\n  const instanceIds = primitive._instanceIds;\n\n  if (primitive._state === PrimitiveState.READY) {\n    instances = Array.isArray(primitive.geometryInstances)\n      ? primitive.geometryInstances\n      : [primitive.geometryInstances];\n    const length = (primitive._numberOfInstances = instances.length);\n\n    const promises = [];\n    let subTasks = [];\n    for (i = 0; i < length; ++i) {\n      geometry = instances[i].geometry;\n      instanceIds.push(instances[i].id);\n\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(geometry._workerName)) {\n        throw new DeveloperError(\n          \"_workerName must be defined for asynchronous geometry.\"\n        );\n      }\n      //>>includeEnd('debug');\n\n      subTasks.push({\n        moduleName: geometry._workerName,\n        geometry: geometry,\n      });\n    }\n\n    if (!defined(createGeometryTaskProcessors)) {\n      createGeometryTaskProcessors = new Array(numberOfCreationWorkers);\n      for (i = 0; i < numberOfCreationWorkers; i++) {\n        createGeometryTaskProcessors[i] = new TaskProcessor(\"createGeometry\");\n      }\n    }\n\n    let subTask;\n    subTasks = subdivideArray(subTasks, numberOfCreationWorkers);\n\n    for (i = 0; i < subTasks.length; i++) {\n      let packedLength = 0;\n      const workerSubTasks = subTasks[i];\n      const workerSubTasksLength = workerSubTasks.length;\n      for (j = 0; j < workerSubTasksLength; ++j) {\n        subTask = workerSubTasks[j];\n        geometry = subTask.geometry;\n        if (defined(geometry.constructor.pack)) {\n          subTask.offset = packedLength;\n          packedLength += defaultValue(\n            geometry.constructor.packedLength,\n            geometry.packedLength\n          );\n        }\n      }\n\n      let subTaskTransferableObjects;\n\n      if (packedLength > 0) {\n        const array = new Float64Array(packedLength);\n        subTaskTransferableObjects = [array.buffer];\n\n        for (j = 0; j < workerSubTasksLength; ++j) {\n          subTask = workerSubTasks[j];\n          geometry = subTask.geometry;\n          if (defined(geometry.constructor.pack)) {\n            geometry.constructor.pack(geometry, array, subTask.offset);\n            subTask.geometry = array;\n          }\n        }\n      }\n\n      promises.push(\n        createGeometryTaskProcessors[i].scheduleTask(\n          {\n            subTasks: subTasks[i],\n          },\n          subTaskTransferableObjects\n        )\n      );\n    }\n\n    primitive._state = PrimitiveState.CREATING;\n\n    Promise.all(promises)\n      .then(function (results) {\n        primitive._createGeometryResults = results;\n        primitive._state = PrimitiveState.CREATED;\n      })\n      .catch(function (error) {\n        setReady(primitive, frameState, PrimitiveState.FAILED, error);\n      });\n  } else if (primitive._state === PrimitiveState.CREATED) {\n    const transferableObjects = [];\n    instances = Array.isArray(primitive.geometryInstances)\n      ? primitive.geometryInstances\n      : [primitive.geometryInstances];\n\n    const scene3DOnly = frameState.scene3DOnly;\n    const projection = frameState.mapProjection;\n\n    const promise = combineGeometryTaskProcessor.scheduleTask(\n      PrimitivePipeline.packCombineGeometryParameters(\n        {\n          createGeometryResults: primitive._createGeometryResults,\n          instances: instances,\n          ellipsoid: projection.ellipsoid,\n          projection: projection,\n          elementIndexUintSupported: frameState.context.elementIndexUint,\n          scene3DOnly: scene3DOnly,\n          vertexCacheOptimize: primitive.vertexCacheOptimize,\n          compressVertices: primitive.compressVertices,\n          modelMatrix: primitive.modelMatrix,\n          createPickOffsets: primitive._createPickOffsets,\n        },\n        transferableObjects\n      ),\n      transferableObjects\n    );\n\n    primitive._createGeometryResults = undefined;\n    primitive._state = PrimitiveState.COMBINING;\n\n    Promise.resolve(promise)\n      .then(function (packedResult) {\n        const result = PrimitivePipeline.unpackCombineGeometryResults(\n          packedResult\n        );\n        primitive._geometries = result.geometries;\n        primitive._attributeLocations = result.attributeLocations;\n        primitive.modelMatrix = Matrix4.clone(\n          result.modelMatrix,\n          primitive.modelMatrix\n        );\n        primitive._pickOffsets = result.pickOffsets;\n        primitive._offsetInstanceExtend = result.offsetInstanceExtend;\n        primitive._instanceBoundingSpheres = result.boundingSpheres;\n        primitive._instanceBoundingSpheresCV = result.boundingSpheresCV;\n\n        if (\n          defined(primitive._geometries) &&\n          primitive._geometries.length > 0\n        ) {\n          primitive._recomputeBoundingSpheres = true;\n          primitive._state = PrimitiveState.COMBINED;\n        } else {\n          setReady(primitive, frameState, PrimitiveState.FAILED, undefined);\n        }\n      })\n      .catch(function (error) {\n        setReady(primitive, frameState, PrimitiveState.FAILED, error);\n      });\n  }\n}\n\nfunction loadSynchronous(primitive, frameState) {\n  const instances = Array.isArray(primitive.geometryInstances)\n    ? primitive.geometryInstances\n    : [primitive.geometryInstances];\n  const length = (primitive._numberOfInstances = instances.length);\n  const clonedInstances = new Array(length);\n  const instanceIds = primitive._instanceIds;\n\n  let instance;\n  let i;\n\n  let geometryIndex = 0;\n  for (i = 0; i < length; i++) {\n    instance = instances[i];\n    const geometry = instance.geometry;\n\n    let createdGeometry;\n    if (defined(geometry.attributes) && defined(geometry.primitiveType)) {\n      createdGeometry = cloneGeometry(geometry);\n    } else {\n      createdGeometry = geometry.constructor.createGeometry(geometry);\n    }\n\n    clonedInstances[geometryIndex++] = cloneInstance(instance, createdGeometry);\n    instanceIds.push(instance.id);\n  }\n\n  clonedInstances.length = geometryIndex;\n\n  const scene3DOnly = frameState.scene3DOnly;\n  const projection = frameState.mapProjection;\n\n  const result = PrimitivePipeline.combineGeometry({\n    instances: clonedInstances,\n    ellipsoid: projection.ellipsoid,\n    projection: projection,\n    elementIndexUintSupported: frameState.context.elementIndexUint,\n    scene3DOnly: scene3DOnly,\n    vertexCacheOptimize: primitive.vertexCacheOptimize,\n    compressVertices: primitive.compressVertices,\n    modelMatrix: primitive.modelMatrix,\n    createPickOffsets: primitive._createPickOffsets,\n  });\n\n  primitive._geometries = result.geometries;\n  primitive._attributeLocations = result.attributeLocations;\n  primitive.modelMatrix = Matrix4.clone(\n    result.modelMatrix,\n    primitive.modelMatrix\n  );\n  primitive._pickOffsets = result.pickOffsets;\n  primitive._offsetInstanceExtend = result.offsetInstanceExtend;\n  primitive._instanceBoundingSpheres = result.boundingSpheres;\n  primitive._instanceBoundingSpheresCV = result.boundingSpheresCV;\n\n  if (defined(primitive._geometries) && primitive._geometries.length > 0) {\n    primitive._recomputeBoundingSpheres = true;\n    primitive._state = PrimitiveState.COMBINED;\n  } else {\n    setReady(primitive, frameState, PrimitiveState.FAILED, undefined);\n  }\n}\n\nfunction recomputeBoundingSpheres(primitive, frameState) {\n  const offsetIndex = primitive._batchTableAttributeIndices.offset;\n  if (!primitive._recomputeBoundingSpheres || !defined(offsetIndex)) {\n    primitive._recomputeBoundingSpheres = false;\n    return;\n  }\n\n  let i;\n  const offsetInstanceExtend = primitive._offsetInstanceExtend;\n  const boundingSpheres = primitive._instanceBoundingSpheres;\n  const length = boundingSpheres.length;\n  let newBoundingSpheres = primitive._tempBoundingSpheres;\n  if (!defined(newBoundingSpheres)) {\n    newBoundingSpheres = new Array(length);\n    for (i = 0; i < length; i++) {\n      newBoundingSpheres[i] = new BoundingSphere();\n    }\n    primitive._tempBoundingSpheres = newBoundingSpheres;\n  }\n  for (i = 0; i < length; ++i) {\n    let newBS = newBoundingSpheres[i];\n    const offset = primitive._batchTable.getBatchedAttribute(\n      i,\n      offsetIndex,\n      new Cartesian3()\n    );\n    newBS = boundingSpheres[i].clone(newBS);\n    transformBoundingSphere(newBS, offset, offsetInstanceExtend[i]);\n  }\n  const combinedBS = [];\n  const combinedWestBS = [];\n  const combinedEastBS = [];\n\n  for (i = 0; i < length; ++i) {\n    const bs = newBoundingSpheres[i];\n\n    const minX = bs.center.x - bs.radius;\n    if (\n      minX > 0 ||\n      BoundingSphere.intersectPlane(bs, Plane.ORIGIN_ZX_PLANE) !==\n        Intersect.INTERSECTING\n    ) {\n      combinedBS.push(bs);\n    } else {\n      combinedWestBS.push(bs);\n      combinedEastBS.push(bs);\n    }\n  }\n\n  let resultBS1 = combinedBS[0];\n  let resultBS2 = combinedEastBS[0];\n  let resultBS3 = combinedWestBS[0];\n\n  for (i = 1; i < combinedBS.length; i++) {\n    resultBS1 = BoundingSphere.union(resultBS1, combinedBS[i]);\n  }\n  for (i = 1; i < combinedEastBS.length; i++) {\n    resultBS2 = BoundingSphere.union(resultBS2, combinedEastBS[i]);\n  }\n  for (i = 1; i < combinedWestBS.length; i++) {\n    resultBS3 = BoundingSphere.union(resultBS3, combinedWestBS[i]);\n  }\n  const result = [];\n  if (defined(resultBS1)) {\n    result.push(resultBS1);\n  }\n  if (defined(resultBS2)) {\n    result.push(resultBS2);\n  }\n  if (defined(resultBS3)) {\n    result.push(resultBS3);\n  }\n\n  for (i = 0; i < result.length; i++) {\n    const boundingSphere = result[i].clone(primitive._boundingSpheres[i]);\n    primitive._boundingSpheres[i] = boundingSphere;\n    primitive._boundingSphereCV[i] = BoundingSphere.projectTo2D(\n      boundingSphere,\n      frameState.mapProjection,\n      primitive._boundingSphereCV[i]\n    );\n  }\n\n  Primitive._updateBoundingVolumes(\n    primitive,\n    frameState,\n    primitive.modelMatrix,\n    true\n  );\n  primitive._recomputeBoundingSpheres = false;\n}\n\nconst scratchBoundingSphereCenterEncoded = new EncodedCartesian3();\nconst scratchBoundingSphereCartographic = new Cartographic();\nconst scratchBoundingSphereCenter2D = new Cartesian3();\nconst scratchBoundingSphere = new BoundingSphere();\n\nfunction updateBatchTableBoundingSpheres(primitive, frameState) {\n  const hasDistanceDisplayCondition = defined(\n    primitive._batchTableAttributeIndices.distanceDisplayCondition\n  );\n  if (\n    !hasDistanceDisplayCondition ||\n    primitive._batchTableBoundingSpheresUpdated\n  ) {\n    return;\n  }\n\n  const indices = primitive._batchTableBoundingSphereAttributeIndices;\n  const center3DHighIndex = indices.center3DHigh;\n  const center3DLowIndex = indices.center3DLow;\n  const center2DHighIndex = indices.center2DHigh;\n  const center2DLowIndex = indices.center2DLow;\n  const radiusIndex = indices.radius;\n\n  const projection = frameState.mapProjection;\n  const ellipsoid = projection.ellipsoid;\n\n  const batchTable = primitive._batchTable;\n  const boundingSpheres = primitive._instanceBoundingSpheres;\n  const length = boundingSpheres.length;\n\n  for (let i = 0; i < length; ++i) {\n    let boundingSphere = boundingSpheres[i];\n    if (!defined(boundingSphere)) {\n      continue;\n    }\n\n    const modelMatrix = primitive.modelMatrix;\n    if (defined(modelMatrix)) {\n      boundingSphere = BoundingSphere.transform(\n        boundingSphere,\n        modelMatrix,\n        scratchBoundingSphere\n      );\n    }\n\n    const center = boundingSphere.center;\n    const radius = boundingSphere.radius;\n\n    let encodedCenter = EncodedCartesian3.fromCartesian(\n      center,\n      scratchBoundingSphereCenterEncoded\n    );\n    batchTable.setBatchedAttribute(i, center3DHighIndex, encodedCenter.high);\n    batchTable.setBatchedAttribute(i, center3DLowIndex, encodedCenter.low);\n\n    if (!frameState.scene3DOnly) {\n      const cartographic = ellipsoid.cartesianToCartographic(\n        center,\n        scratchBoundingSphereCartographic\n      );\n      const center2D = projection.project(\n        cartographic,\n        scratchBoundingSphereCenter2D\n      );\n      encodedCenter = EncodedCartesian3.fromCartesian(\n        center2D,\n        scratchBoundingSphereCenterEncoded\n      );\n      batchTable.setBatchedAttribute(i, center2DHighIndex, encodedCenter.high);\n      batchTable.setBatchedAttribute(i, center2DLowIndex, encodedCenter.low);\n    }\n\n    batchTable.setBatchedAttribute(i, radiusIndex, radius);\n  }\n\n  primitive._batchTableBoundingSpheresUpdated = true;\n}\n\nconst offsetScratchCartesian = new Cartesian3();\nconst offsetCenterScratch = new Cartesian3();\nfunction updateBatchTableOffsets(primitive, frameState) {\n  const hasOffset = defined(primitive._batchTableAttributeIndices.offset);\n  if (\n    !hasOffset ||\n    primitive._batchTableOffsetsUpdated ||\n    frameState.scene3DOnly\n  ) {\n    return;\n  }\n\n  const index2D = primitive._batchTableOffsetAttribute2DIndex;\n\n  const projection = frameState.mapProjection;\n  const ellipsoid = projection.ellipsoid;\n\n  const batchTable = primitive._batchTable;\n  const boundingSpheres = primitive._instanceBoundingSpheres;\n  const length = boundingSpheres.length;\n\n  for (let i = 0; i < length; ++i) {\n    let boundingSphere = boundingSpheres[i];\n    if (!defined(boundingSphere)) {\n      continue;\n    }\n    const offset = batchTable.getBatchedAttribute(\n      i,\n      primitive._batchTableAttributeIndices.offset\n    );\n    if (Cartesian3.equals(offset, Cartesian3.ZERO)) {\n      batchTable.setBatchedAttribute(i, index2D, Cartesian3.ZERO);\n      continue;\n    }\n\n    const modelMatrix = primitive.modelMatrix;\n    if (defined(modelMatrix)) {\n      boundingSphere = BoundingSphere.transform(\n        boundingSphere,\n        modelMatrix,\n        scratchBoundingSphere\n      );\n    }\n\n    let center = boundingSphere.center;\n    center = ellipsoid.scaleToGeodeticSurface(center, offsetCenterScratch);\n    let cartographic = ellipsoid.cartesianToCartographic(\n      center,\n      scratchBoundingSphereCartographic\n    );\n    const center2D = projection.project(\n      cartographic,\n      scratchBoundingSphereCenter2D\n    );\n\n    const newPoint = Cartesian3.add(offset, center, offsetScratchCartesian);\n    cartographic = ellipsoid.cartesianToCartographic(newPoint, cartographic);\n\n    const newPointProjected = projection.project(\n      cartographic,\n      offsetScratchCartesian\n    );\n\n    const newVector = Cartesian3.subtract(\n      newPointProjected,\n      center2D,\n      offsetScratchCartesian\n    );\n\n    const x = newVector.x;\n    newVector.x = newVector.z;\n    newVector.z = newVector.y;\n    newVector.y = x;\n\n    batchTable.setBatchedAttribute(i, index2D, newVector);\n  }\n\n  primitive._batchTableOffsetsUpdated = true;\n}\n\nfunction createVertexArray(primitive, frameState) {\n  const attributeLocations = primitive._attributeLocations;\n  const geometries = primitive._geometries;\n  const scene3DOnly = frameState.scene3DOnly;\n  const context = frameState.context;\n\n  const va = [];\n  const length = geometries.length;\n  for (let i = 0; i < length; ++i) {\n    const geometry = geometries[i];\n\n    va.push(\n      VertexArray.fromGeometry({\n        context: context,\n        geometry: geometry,\n        attributeLocations: attributeLocations,\n        bufferUsage: BufferUsage.STATIC_DRAW,\n        interleave: primitive._interleave,\n      })\n    );\n\n    if (defined(primitive._createBoundingVolumeFunction)) {\n      primitive._createBoundingVolumeFunction(frameState, geometry);\n    } else {\n      primitive._boundingSpheres.push(\n        BoundingSphere.clone(geometry.boundingSphere)\n      );\n      primitive._boundingSphereWC.push(new BoundingSphere());\n\n      if (!scene3DOnly) {\n        const center = geometry.boundingSphereCV.center;\n        const x = center.x;\n        const y = center.y;\n        const z = center.z;\n        center.x = z;\n        center.y = x;\n        center.z = y;\n\n        primitive._boundingSphereCV.push(\n          BoundingSphere.clone(geometry.boundingSphereCV)\n        );\n        primitive._boundingSphere2D.push(new BoundingSphere());\n        primitive._boundingSphereMorph.push(new BoundingSphere());\n      }\n    }\n  }\n\n  primitive._va = va;\n  primitive._primitiveType = geometries[0].primitiveType;\n\n  if (primitive.releaseGeometryInstances) {\n    primitive.geometryInstances = undefined;\n  }\n\n  primitive._geometries = undefined;\n  setReady(primitive, frameState, PrimitiveState.COMPLETE, undefined);\n}\n\nfunction createRenderStates(primitive, context, appearance, twoPasses) {\n  let renderState = appearance.getRenderState();\n  let rs;\n\n  if (twoPasses) {\n    rs = clone(renderState, false);\n    rs.cull = {\n      enabled: true,\n      face: CullFace.BACK,\n    };\n    primitive._frontFaceRS = RenderState.fromCache(rs);\n\n    rs.cull.face = CullFace.FRONT;\n    primitive._backFaceRS = RenderState.fromCache(rs);\n  } else {\n    primitive._frontFaceRS = RenderState.fromCache(renderState);\n    primitive._backFaceRS = primitive._frontFaceRS;\n  }\n\n  rs = clone(renderState, false);\n  if (defined(primitive._depthFailAppearance)) {\n    rs.depthTest.enabled = false;\n  }\n\n  if (defined(primitive._depthFailAppearance)) {\n    renderState = primitive._depthFailAppearance.getRenderState();\n    rs = clone(renderState, false);\n    rs.depthTest.func = DepthFunction.GREATER;\n    if (twoPasses) {\n      rs.cull = {\n        enabled: true,\n        face: CullFace.BACK,\n      };\n      primitive._frontFaceDepthFailRS = RenderState.fromCache(rs);\n\n      rs.cull.face = CullFace.FRONT;\n      primitive._backFaceDepthFailRS = RenderState.fromCache(rs);\n    } else {\n      primitive._frontFaceDepthFailRS = RenderState.fromCache(rs);\n      primitive._backFaceDepthFailRS = primitive._frontFaceRS;\n    }\n  }\n}\n\nfunction createShaderProgram(primitive, frameState, appearance) {\n  const context = frameState.context;\n\n  const attributeLocations = primitive._attributeLocations;\n\n  let vs = primitive._batchTable.getVertexShaderCallback()(\n    appearance.vertexShaderSource\n  );\n  vs = Primitive._appendOffsetToShader(primitive, vs);\n  vs = Primitive._appendShowToShader(primitive, vs);\n  vs = Primitive._appendDistanceDisplayConditionToShader(\n    primitive,\n    vs,\n    frameState.scene3DOnly\n  );\n  vs = appendPickToVertexShader(vs);\n  vs = Primitive._updateColorAttribute(primitive, vs, false);\n  vs = modifyForEncodedNormals(primitive, vs);\n  vs = Primitive._modifyShaderPosition(primitive, vs, frameState.scene3DOnly);\n  let fs = appearance.getFragmentShaderSource();\n  fs = appendPickToFragmentShader(fs);\n\n  primitive._sp = ShaderProgram.replaceCache({\n    context: context,\n    shaderProgram: primitive._sp,\n    vertexShaderSource: vs,\n    fragmentShaderSource: fs,\n    attributeLocations: attributeLocations,\n  });\n  validateShaderMatching(primitive._sp, attributeLocations);\n\n  if (defined(primitive._depthFailAppearance)) {\n    vs = primitive._batchTable.getVertexShaderCallback()(\n      primitive._depthFailAppearance.vertexShaderSource\n    );\n    vs = Primitive._appendShowToShader(primitive, vs);\n    vs = Primitive._appendDistanceDisplayConditionToShader(\n      primitive,\n      vs,\n      frameState.scene3DOnly\n    );\n    vs = appendPickToVertexShader(vs);\n    vs = Primitive._updateColorAttribute(primitive, vs, true);\n    vs = modifyForEncodedNormals(primitive, vs);\n    vs = Primitive._modifyShaderPosition(primitive, vs, frameState.scene3DOnly);\n    vs = depthClampVS(vs);\n\n    fs = primitive._depthFailAppearance.getFragmentShaderSource();\n    fs = appendPickToFragmentShader(fs);\n    fs = depthClampFS(fs);\n\n    primitive._spDepthFail = ShaderProgram.replaceCache({\n      context: context,\n      shaderProgram: primitive._spDepthFail,\n      vertexShaderSource: vs,\n      fragmentShaderSource: fs,\n      attributeLocations: attributeLocations,\n    });\n    validateShaderMatching(primitive._spDepthFail, attributeLocations);\n  }\n}\n\nconst modifiedModelViewScratch = new Matrix4();\nconst rtcScratch = new Cartesian3();\n\nfunction getUniforms(primitive, appearance, material, frameState) {\n  // Create uniform map by combining uniforms from the appearance and material if either have uniforms.\n  const materialUniformMap = defined(material) ? material._uniforms : undefined;\n  const appearanceUniformMap = {};\n  const appearanceUniforms = appearance.uniforms;\n  if (defined(appearanceUniforms)) {\n    // Convert to uniform map of functions for the renderer\n    for (const name in appearanceUniforms) {\n      if (appearanceUniforms.hasOwnProperty(name)) {\n        //>>includeStart('debug', pragmas.debug);\n        if (defined(materialUniformMap) && defined(materialUniformMap[name])) {\n          // Later, we could rename uniforms behind-the-scenes if needed.\n          throw new DeveloperError(\n            `Appearance and material have a uniform with the same name: ${name}`\n          );\n        }\n        //>>includeEnd('debug');\n\n        appearanceUniformMap[name] = getUniformFunction(\n          appearanceUniforms,\n          name\n        );\n      }\n    }\n  }\n  let uniforms = combine(appearanceUniformMap, materialUniformMap);\n  uniforms = primitive._batchTable.getUniformMapCallback()(uniforms);\n\n  if (defined(primitive.rtcCenter)) {\n    uniforms.u_modifiedModelView = function () {\n      const viewMatrix = frameState.context.uniformState.view;\n      Matrix4.multiply(\n        viewMatrix,\n        primitive._modelMatrix,\n        modifiedModelViewScratch\n      );\n      Matrix4.multiplyByPoint(\n        modifiedModelViewScratch,\n        primitive.rtcCenter,\n        rtcScratch\n      );\n      Matrix4.setTranslation(\n        modifiedModelViewScratch,\n        rtcScratch,\n        modifiedModelViewScratch\n      );\n      return modifiedModelViewScratch;\n    };\n  }\n\n  return uniforms;\n}\n\nfunction createCommands(\n  primitive,\n  appearance,\n  material,\n  translucent,\n  twoPasses,\n  colorCommands,\n  pickCommands,\n  frameState\n) {\n  const uniforms = getUniforms(primitive, appearance, material, frameState);\n\n  let depthFailUniforms;\n  if (defined(primitive._depthFailAppearance)) {\n    depthFailUniforms = getUniforms(\n      primitive,\n      primitive._depthFailAppearance,\n      primitive._depthFailAppearance.material,\n      frameState\n    );\n  }\n\n  const pass = translucent ? Pass.TRANSLUCENT : Pass.OPAQUE;\n\n  let multiplier = twoPasses ? 2 : 1;\n  multiplier *= defined(primitive._depthFailAppearance) ? 2 : 1;\n  colorCommands.length = primitive._va.length * multiplier;\n\n  const length = colorCommands.length;\n  let vaIndex = 0;\n  for (let i = 0; i < length; ++i) {\n    let colorCommand;\n\n    if (twoPasses) {\n      colorCommand = colorCommands[i];\n      if (!defined(colorCommand)) {\n        colorCommand = colorCommands[i] = new DrawCommand({\n          owner: primitive,\n          primitiveType: primitive._primitiveType,\n        });\n      }\n      colorCommand.vertexArray = primitive._va[vaIndex];\n      colorCommand.renderState = primitive._backFaceRS;\n      colorCommand.shaderProgram = primitive._sp;\n      colorCommand.uniformMap = uniforms;\n      colorCommand.pass = pass;\n\n      ++i;\n    }\n\n    colorCommand = colorCommands[i];\n    if (!defined(colorCommand)) {\n      colorCommand = colorCommands[i] = new DrawCommand({\n        owner: primitive,\n        primitiveType: primitive._primitiveType,\n      });\n    }\n    colorCommand.vertexArray = primitive._va[vaIndex];\n    colorCommand.renderState = primitive._frontFaceRS;\n    colorCommand.shaderProgram = primitive._sp;\n    colorCommand.uniformMap = uniforms;\n    colorCommand.pass = pass;\n\n    if (defined(primitive._depthFailAppearance)) {\n      if (twoPasses) {\n        ++i;\n\n        colorCommand = colorCommands[i];\n        if (!defined(colorCommand)) {\n          colorCommand = colorCommands[i] = new DrawCommand({\n            owner: primitive,\n            primitiveType: primitive._primitiveType,\n          });\n        }\n        colorCommand.vertexArray = primitive._va[vaIndex];\n        colorCommand.renderState = primitive._backFaceDepthFailRS;\n        colorCommand.shaderProgram = primitive._spDepthFail;\n        colorCommand.uniformMap = depthFailUniforms;\n        colorCommand.pass = pass;\n      }\n\n      ++i;\n\n      colorCommand = colorCommands[i];\n      if (!defined(colorCommand)) {\n        colorCommand = colorCommands[i] = new DrawCommand({\n          owner: primitive,\n          primitiveType: primitive._primitiveType,\n        });\n      }\n      colorCommand.vertexArray = primitive._va[vaIndex];\n      colorCommand.renderState = primitive._frontFaceDepthFailRS;\n      colorCommand.shaderProgram = primitive._spDepthFail;\n      colorCommand.uniformMap = depthFailUniforms;\n      colorCommand.pass = pass;\n    }\n\n    ++vaIndex;\n  }\n}\n\nPrimitive._updateBoundingVolumes = function (\n  primitive,\n  frameState,\n  modelMatrix,\n  forceUpdate\n) {\n  let i;\n  let length;\n  let boundingSphere;\n\n  if (forceUpdate || !Matrix4.equals(modelMatrix, primitive._modelMatrix)) {\n    Matrix4.clone(modelMatrix, primitive._modelMatrix);\n    length = primitive._boundingSpheres.length;\n    for (i = 0; i < length; ++i) {\n      boundingSphere = primitive._boundingSpheres[i];\n      if (defined(boundingSphere)) {\n        primitive._boundingSphereWC[i] = BoundingSphere.transform(\n          boundingSphere,\n          modelMatrix,\n          primitive._boundingSphereWC[i]\n        );\n        if (!frameState.scene3DOnly) {\n          primitive._boundingSphere2D[i] = BoundingSphere.clone(\n            primitive._boundingSphereCV[i],\n            primitive._boundingSphere2D[i]\n          );\n          primitive._boundingSphere2D[i].center.x = 0.0;\n          primitive._boundingSphereMorph[i] = BoundingSphere.union(\n            primitive._boundingSphereWC[i],\n            primitive._boundingSphereCV[i]\n          );\n        }\n      }\n    }\n  }\n\n  // Update bounding volumes for primitives that are sized in pixels.\n  // The pixel size in meters varies based on the distance from the camera.\n  const pixelSize = primitive.appearance.pixelSize;\n  if (defined(pixelSize)) {\n    length = primitive._boundingSpheres.length;\n    for (i = 0; i < length; ++i) {\n      boundingSphere = primitive._boundingSpheres[i];\n      const boundingSphereWC = primitive._boundingSphereWC[i];\n      const pixelSizeInMeters = frameState.camera.getPixelSize(\n        boundingSphere,\n        frameState.context.drawingBufferWidth,\n        frameState.context.drawingBufferHeight\n      );\n      const sizeInMeters = pixelSizeInMeters * pixelSize;\n      boundingSphereWC.radius = boundingSphere.radius + sizeInMeters;\n    }\n  }\n};\n\nfunction updateAndQueueCommands(\n  primitive,\n  frameState,\n  colorCommands,\n  pickCommands,\n  modelMatrix,\n  cull,\n  debugShowBoundingVolume,\n  twoPasses\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    frameState.mode !== SceneMode.SCENE3D &&\n    !Matrix4.equals(modelMatrix, Matrix4.IDENTITY)\n  ) {\n    throw new DeveloperError(\n      \"Primitive.modelMatrix is only supported in 3D mode.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  Primitive._updateBoundingVolumes(primitive, frameState, modelMatrix);\n\n  let boundingSpheres;\n  if (frameState.mode === SceneMode.SCENE3D) {\n    boundingSpheres = primitive._boundingSphereWC;\n  } else if (frameState.mode === SceneMode.COLUMBUS_VIEW) {\n    boundingSpheres = primitive._boundingSphereCV;\n  } else if (\n    frameState.mode === SceneMode.SCENE2D &&\n    defined(primitive._boundingSphere2D)\n  ) {\n    boundingSpheres = primitive._boundingSphere2D;\n  } else if (defined(primitive._boundingSphereMorph)) {\n    boundingSpheres = primitive._boundingSphereMorph;\n  }\n\n  const commandList = frameState.commandList;\n  const passes = frameState.passes;\n  if (passes.render || passes.pick) {\n    const allowPicking = primitive.allowPicking;\n    const castShadows = ShadowMode.castShadows(primitive.shadows);\n    const receiveShadows = ShadowMode.receiveShadows(primitive.shadows);\n    const colorLength = colorCommands.length;\n\n    let factor = twoPasses ? 2 : 1;\n    factor *= defined(primitive._depthFailAppearance) ? 2 : 1;\n\n    for (let j = 0; j < colorLength; ++j) {\n      const sphereIndex = Math.floor(j / factor);\n      const colorCommand = colorCommands[j];\n      colorCommand.modelMatrix = modelMatrix;\n      colorCommand.boundingVolume = boundingSpheres[sphereIndex];\n      colorCommand.cull = cull;\n      colorCommand.debugShowBoundingVolume = debugShowBoundingVolume;\n      colorCommand.castShadows = castShadows;\n      colorCommand.receiveShadows = receiveShadows;\n\n      if (allowPicking) {\n        colorCommand.pickId = \"v_pickColor\";\n      } else {\n        colorCommand.pickId = undefined;\n      }\n\n      commandList.push(colorCommand);\n    }\n  }\n}\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly.  This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {DeveloperError} All instance geometries must have the same primitiveType.\n * @exception {DeveloperError} Appearance and material have a uniform with the same name.\n * @exception {DeveloperError} Primitive.modelMatrix is only supported in 3D mode.\n * @exception {RuntimeError} Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.\n */\nPrimitive.prototype.update = function (frameState) {\n  if (\n    (!defined(this.geometryInstances) && this._va.length === 0) ||\n    (defined(this.geometryInstances) &&\n      Array.isArray(this.geometryInstances) &&\n      this.geometryInstances.length === 0) ||\n    !defined(this.appearance) ||\n    (frameState.mode !== SceneMode.SCENE3D && frameState.scene3DOnly) ||\n    (!frameState.passes.render && !frameState.passes.pick)\n  ) {\n    return;\n  }\n\n  if (defined(this._error)) {\n    throw this._error;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (defined(this.rtcCenter) && !frameState.scene3DOnly) {\n    throw new DeveloperError(\n      \"RTC rendering is only available for 3D only scenes.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  if (this._state === PrimitiveState.FAILED) {\n    return;\n  }\n\n  const context = frameState.context;\n  if (!defined(this._batchTable)) {\n    createBatchTable(this, context);\n  }\n  if (this._batchTable.attributes.length > 0) {\n    if (ContextLimits.maximumVertexTextureImageUnits === 0) {\n      throw new RuntimeError(\n        \"Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.\"\n      );\n    }\n    this._batchTable.update(frameState);\n  }\n\n  if (\n    this._state !== PrimitiveState.COMPLETE &&\n    this._state !== PrimitiveState.COMBINED\n  ) {\n    if (this.asynchronous) {\n      loadAsynchronous(this, frameState);\n    } else {\n      loadSynchronous(this, frameState);\n    }\n  }\n\n  if (this._state === PrimitiveState.COMBINED) {\n    updateBatchTableBoundingSpheres(this, frameState);\n    updateBatchTableOffsets(this, frameState);\n    createVertexArray(this, frameState);\n  }\n\n  if (!this.show || this._state !== PrimitiveState.COMPLETE) {\n    return;\n  }\n\n  if (!this._batchTableOffsetsUpdated) {\n    updateBatchTableOffsets(this, frameState);\n  }\n  if (this._recomputeBoundingSpheres) {\n    recomputeBoundingSpheres(this, frameState);\n  }\n\n  // Create or recreate render state and shader program if appearance/material changed\n  const appearance = this.appearance;\n  const material = appearance.material;\n  let createRS = false;\n  let createSP = false;\n\n  if (this._appearance !== appearance) {\n    this._appearance = appearance;\n    this._material = material;\n    createRS = true;\n    createSP = true;\n  } else if (this._material !== material) {\n    this._material = material;\n    createSP = true;\n  }\n\n  const depthFailAppearance = this.depthFailAppearance;\n  const depthFailMaterial = defined(depthFailAppearance)\n    ? depthFailAppearance.material\n    : undefined;\n\n  if (this._depthFailAppearance !== depthFailAppearance) {\n    this._depthFailAppearance = depthFailAppearance;\n    this._depthFailMaterial = depthFailMaterial;\n    createRS = true;\n    createSP = true;\n  } else if (this._depthFailMaterial !== depthFailMaterial) {\n    this._depthFailMaterial = depthFailMaterial;\n    createSP = true;\n  }\n\n  const translucent = this._appearance.isTranslucent();\n  if (this._translucent !== translucent) {\n    this._translucent = translucent;\n    createRS = true;\n  }\n\n  if (defined(this._material)) {\n    this._material.update(context);\n  }\n\n  const twoPasses = appearance.closed && translucent;\n\n  if (createRS) {\n    const rsFunc = defaultValue(\n      this._createRenderStatesFunction,\n      createRenderStates\n    );\n    rsFunc(this, context, appearance, twoPasses);\n  }\n\n  if (createSP) {\n    const spFunc = defaultValue(\n      this._createShaderProgramFunction,\n      createShaderProgram\n    );\n    spFunc(this, frameState, appearance);\n  }\n\n  if (createRS || createSP) {\n    const commandFunc = defaultValue(\n      this._createCommandsFunction,\n      createCommands\n    );\n    commandFunc(\n      this,\n      appearance,\n      material,\n      translucent,\n      twoPasses,\n      this._colorCommands,\n      this._pickCommands,\n      frameState\n    );\n  }\n\n  const updateAndQueueCommandsFunc = defaultValue(\n    this._updateAndQueueCommandsFunction,\n    updateAndQueueCommands\n  );\n  updateAndQueueCommandsFunc(\n    this,\n    frameState,\n    this._colorCommands,\n    this._pickCommands,\n    this.modelMatrix,\n    this.cull,\n    this.debugShowBoundingVolume,\n    twoPasses\n  );\n};\n\nconst offsetBoundingSphereScratch1 = new BoundingSphere();\nconst offsetBoundingSphereScratch2 = new BoundingSphere();\nfunction transformBoundingSphere(boundingSphere, offset, offsetAttribute) {\n  if (offsetAttribute === GeometryOffsetAttribute.TOP) {\n    const origBS = BoundingSphere.clone(\n      boundingSphere,\n      offsetBoundingSphereScratch1\n    );\n    const offsetBS = BoundingSphere.clone(\n      boundingSphere,\n      offsetBoundingSphereScratch2\n    );\n    offsetBS.center = Cartesian3.add(offsetBS.center, offset, offsetBS.center);\n    boundingSphere = BoundingSphere.union(origBS, offsetBS, boundingSphere);\n  } else if (offsetAttribute === GeometryOffsetAttribute.ALL) {\n    boundingSphere.center = Cartesian3.add(\n      boundingSphere.center,\n      offset,\n      boundingSphere.center\n    );\n  }\n\n  return boundingSphere;\n}\n\nfunction createGetFunction(batchTable, instanceIndex, attributeIndex) {\n  return function () {\n    const attributeValue = batchTable.getBatchedAttribute(\n      instanceIndex,\n      attributeIndex\n    );\n    const attribute = batchTable.attributes[attributeIndex];\n    const componentsPerAttribute = attribute.componentsPerAttribute;\n    const value = ComponentDatatype.createTypedArray(\n      attribute.componentDatatype,\n      componentsPerAttribute\n    );\n    if (defined(attributeValue.constructor.pack)) {\n      attributeValue.constructor.pack(attributeValue, value, 0);\n    } else {\n      value[0] = attributeValue;\n    }\n    return value;\n  };\n}\n\nfunction createSetFunction(\n  batchTable,\n  instanceIndex,\n  attributeIndex,\n  primitive,\n  name\n) {\n  return function (value) {\n    //>>includeStart('debug', pragmas.debug);\n    if (\n      !defined(value) ||\n      !defined(value.length) ||\n      value.length < 1 ||\n      value.length > 4\n    ) {\n      throw new DeveloperError(\n        \"value must be and array with length between 1 and 4.\"\n      );\n    }\n    //>>includeEnd('debug');\n    const attributeValue = getAttributeValue(value);\n    batchTable.setBatchedAttribute(\n      instanceIndex,\n      attributeIndex,\n      attributeValue\n    );\n    if (name === \"offset\") {\n      primitive._recomputeBoundingSpheres = true;\n      primitive._batchTableOffsetsUpdated = false;\n    }\n  };\n}\n\nconst offsetScratch = new Cartesian3();\n\nfunction createBoundingSphereProperties(primitive, properties, index) {\n  properties.boundingSphere = {\n    get: function () {\n      let boundingSphere = primitive._instanceBoundingSpheres[index];\n      if (defined(boundingSphere)) {\n        boundingSphere = boundingSphere.clone();\n        const modelMatrix = primitive.modelMatrix;\n        const offset = properties.offset;\n        if (defined(offset)) {\n          transformBoundingSphere(\n            boundingSphere,\n            Cartesian3.fromArray(offset.get(), 0, offsetScratch),\n            primitive._offsetInstanceExtend[index]\n          );\n        }\n        if (defined(modelMatrix)) {\n          boundingSphere = BoundingSphere.transform(\n            boundingSphere,\n            modelMatrix\n          );\n        }\n      }\n\n      return boundingSphere;\n    },\n  };\n  properties.boundingSphereCV = {\n    get: function () {\n      return primitive._instanceBoundingSpheresCV[index];\n    },\n  };\n}\n\nfunction createPickIdProperty(primitive, properties, index) {\n  properties.pickId = {\n    get: function () {\n      return primitive._pickIds[index];\n    },\n  };\n}\n\n/**\n * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.\n *\n * @param {*} id The id of the {@link GeometryInstance}.\n * @returns {object} The typed array in the attribute's format or undefined if the is no instance with id.\n *\n * @exception {DeveloperError} must call update before calling getGeometryInstanceAttributes.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);\n * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);\n * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(100.0, 10000.0);\n * attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue(Cartesian3.IDENTITY);\n */\nPrimitive.prototype.getGeometryInstanceAttributes = function (id) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(id)) {\n    throw new DeveloperError(\"id is required\");\n  }\n  if (!defined(this._batchTable)) {\n    throw new DeveloperError(\n      \"must call update before calling getGeometryInstanceAttributes\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  let attributes = this._perInstanceAttributeCache.get(id);\n  if (defined(attributes)) {\n    return attributes;\n  }\n\n  let index = -1;\n  const lastIndex = this._lastPerInstanceAttributeIndex;\n  const ids = this._instanceIds;\n  const length = ids.length;\n  for (let i = 0; i < length; ++i) {\n    const curIndex = (lastIndex + i) % length;\n    if (id === ids[curIndex]) {\n      index = curIndex;\n      break;\n    }\n  }\n\n  if (index === -1) {\n    return undefined;\n  }\n\n  const batchTable = this._batchTable;\n  const perInstanceAttributeIndices = this._batchTableAttributeIndices;\n  attributes = {};\n  const properties = {};\n\n  for (const name in perInstanceAttributeIndices) {\n    if (perInstanceAttributeIndices.hasOwnProperty(name)) {\n      const attributeIndex = perInstanceAttributeIndices[name];\n      properties[name] = {\n        get: createGetFunction(batchTable, index, attributeIndex),\n        set: createSetFunction(batchTable, index, attributeIndex, this, name),\n      };\n    }\n  }\n\n  createBoundingSphereProperties(this, properties, index);\n  createPickIdProperty(this, properties, index);\n  Object.defineProperties(attributes, properties);\n\n  this._lastPerInstanceAttributeIndex = index;\n  this._perInstanceAttributeCache.set(id, attributes);\n  return attributes;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see Primitive#destroy\n */\nPrimitive.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * e = e && e.destroy();\n *\n * @see Primitive#isDestroyed\n */\nPrimitive.prototype.destroy = function () {\n  let length;\n  let i;\n\n  this._sp = this._sp && this._sp.destroy();\n  this._spDepthFail = this._spDepthFail && this._spDepthFail.destroy();\n\n  const va = this._va;\n  length = va.length;\n  for (i = 0; i < length; ++i) {\n    va[i].destroy();\n  }\n  this._va = undefined;\n\n  const pickIds = this._pickIds;\n  length = pickIds.length;\n  for (i = 0; i < length; ++i) {\n    pickIds[i].destroy();\n  }\n  this._pickIds = undefined;\n\n  this._batchTable = this._batchTable && this._batchTable.destroy();\n\n  //These objects may be fairly large and reference other large objects (like Entities)\n  //We explicitly set them to undefined here so that the memory can be freed\n  //even if a reference to the destroyed Primitive has been kept around.\n  this._instanceIds = undefined;\n  this._perInstanceAttributeCache = undefined;\n  this._attributeLocations = undefined;\n\n  return destroyObject(this);\n};\n\nfunction setReady(primitive, frameState, state, error) {\n  primitive._error = error;\n  primitive._state = state;\n  frameState.afterRender.push(function () {\n    primitive._ready =\n      primitive._state === PrimitiveState.COMPLETE ||\n      primitive._state === PrimitiveState.FAILED;\n    if (!defined(error)) {\n      return true;\n    }\n  });\n}\nexport default Primitive;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Values and type information for per-instance geometry attributes.\n *\n * @alias GeometryInstanceAttribute\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {ComponentDatatype} options.componentDatatype The datatype of each component in the attribute, e.g., individual elements in values.\n * @param {number} options.componentsPerAttribute A number between 1 and 4 that defines the number of components in an attributes.\n * @param {boolean} [options.normalize=false] When <code>true</code> and <code>componentDatatype</code> is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n * @param {number[]} options.value The value for the attribute.\n *\n * @exception {DeveloperError} options.componentsPerAttribute must be between 1 and 4.\n *\n *\n * @example\n * const instance = new Cesium.GeometryInstance({\n *   geometry : Cesium.BoxGeometry.fromDimensions({\n *     dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)\n *   }),\n *   modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n *     Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),\n *   id : 'box',\n *   attributes : {\n *     color : new Cesium.GeometryInstanceAttribute({\n *       componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,\n *       componentsPerAttribute : 4,\n *       normalize : true,\n *       value : [255, 255, 0, 255]\n *     })\n *   }\n * });\n *\n * @see ColorGeometryInstanceAttribute\n * @see ShowGeometryInstanceAttribute\n * @see DistanceDisplayConditionGeometryInstanceAttribute\n */\nfunction GeometryInstanceAttribute(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options.componentDatatype)) {\n    throw new DeveloperError(\"options.componentDatatype is required.\");\n  }\n  if (!defined(options.componentsPerAttribute)) {\n    throw new DeveloperError(\"options.componentsPerAttribute is required.\");\n  }\n  if (\n    options.componentsPerAttribute < 1 ||\n    options.componentsPerAttribute > 4\n  ) {\n    throw new DeveloperError(\n      \"options.componentsPerAttribute must be between 1 and 4.\"\n    );\n  }\n  if (!defined(options.value)) {\n    throw new DeveloperError(\"options.value is required.\");\n  }\n  //>>includeEnd('debug');\n\n  /**\n   * The datatype of each component in the attribute, e.g., individual elements in\n   * {@link GeometryInstanceAttribute#value}.\n   *\n   * @type ComponentDatatype\n   *\n   * @default undefined\n   */\n  this.componentDatatype = options.componentDatatype;\n\n  /**\n   * A number between 1 and 4 that defines the number of components in an attributes.\n   * For example, a position attribute with x, y, and z components would have 3 as\n   * shown in the code example.\n   *\n   * @type {number}\n   *\n   * @default undefined\n   *\n   * @example\n   * show : new Cesium.GeometryInstanceAttribute({\n   *   componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,\n   *   componentsPerAttribute : 1,\n   *   normalize : true,\n   *   value : [1.0]\n   * })\n   */\n  this.componentsPerAttribute = options.componentsPerAttribute;\n\n  /**\n   * When <code>true</code> and <code>componentDatatype</code> is an integer format,\n   * indicate that the components should be mapped to the range [0, 1] (unsigned)\n   * or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n   * <p>\n   * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   *\n   * @example\n   * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;\n   * attribute.componentsPerAttribute = 4;\n   * attribute.normalize = true;\n   * attribute.value = [\n   *   Cesium.Color.floatToByte(color.red),\n   *   Cesium.Color.floatToByte(color.green),\n   *   Cesium.Color.floatToByte(color.blue),\n   *   Cesium.Color.floatToByte(color.alpha)\n   * ];\n   */\n  this.normalize = defaultValue(options.normalize, false);\n\n  /**\n   * The values for the attributes stored in a typed array.  In the code example,\n   * every three elements in <code>values</code> defines one attributes since\n   * <code>componentsPerAttribute</code> is 3.\n   *\n   * @type {number[]}\n   *\n   * @default undefined\n   *\n   * @example\n   * show : new Cesium.GeometryInstanceAttribute({\n   *   componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,\n   *   componentsPerAttribute : 1,\n   *   normalize : true,\n   *   value : [1.0]\n   * })\n   */\n  this.value = options.value;\n}\nexport default GeometryInstanceAttribute;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef TEXTURE_COORDINATES\\n\\\n#ifdef SPHERICAL\\n\\\nin vec4 v_sphericalExtents;\\n\\\n#else // SPHERICAL\\n\\\nin vec2 v_inversePlaneExtents;\\n\\\nin vec4 v_westPlane;\\n\\\nin vec4 v_southPlane;\\n\\\n#endif // SPHERICAL\\n\\\nin vec3 v_uvMinAndSphericalLongitudeRotation;\\n\\\nin vec3 v_uMaxAndInverseDistance;\\n\\\nin vec3 v_vMaxAndInverseDistance;\\n\\\n#endif // TEXTURE_COORDINATES\\n\\\n\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nin vec4 v_color;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef NORMAL_EC\\n\\\nvec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {\\n\\\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);\\n\\\n    return eyeCoordinate.xyz / eyeCoordinate.w;\\n\\\n}\\n\\\n\\n\\\nvec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {\\n\\\n    vec2 glFragCoordXY = gl_FragCoord.xy;\\n\\\n    // Sample depths at both offset and negative offset\\n\\\n    float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));\\n\\\n    float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));\\n\\\n    // Explicitly evaluate both paths\\n\\\n    // Necessary for multifrustum and for edges of the screen\\n\\\n    bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);\\n\\\n    float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);\\n\\\n    float useDownOrLeft = float(useUpOrRight == 0.0);\\n\\\n    vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);\\n\\\n    vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);\\n\\\n    return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;\\n\\\n}\\n\\\n#endif // NORMAL_EC\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n#ifdef REQUIRES_EC\\n\\\n    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));\\n\\\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\\n\\\n#endif\\n\\\n\\n\\\n#ifdef REQUIRES_WC\\n\\\n    vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\\n\\\n    vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef TEXTURE_COORDINATES\\n\\\n    vec2 uv;\\n\\\n#ifdef SPHERICAL\\n\\\n    // Treat world coords as a sphere normal for spherical coordinates\\n\\\n    vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);\\n\\\n    sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;\\n\\\n    sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);\\n\\\n    uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;\\n\\\n    uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;\\n\\\n#else // SPHERICAL\\n\\\n    // Unpack planes and transform to eye space\\n\\\n    uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;\\n\\\n    uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;\\n\\\n#endif // SPHERICAL\\n\\\n#endif // TEXTURE_COORDINATES\\n\\\n\\n\\\n#ifdef PICK\\n\\\n#ifdef CULL_FRAGMENTS\\n\\\n    // When classifying translucent geometry, logDepthOrDepth == 0.0\\n\\\n    // indicates a region that should not be classified, possibly due to there\\n\\\n    // being opaque pixels there in another buffer.\\n\\\n    // Check for logDepthOrDepth != 0.0 to make sure this should be classified.\\n\\\n    if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) {\\n\\\n        out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource\\n\\\n        czm_writeDepthClamp();\\n\\\n    }\\n\\\n#else // CULL_FRAGMENTS\\n\\\n        out_FragColor.a = 1.0;\\n\\\n#endif // CULL_FRAGMENTS\\n\\\n#else // PICK\\n\\\n\\n\\\n#ifdef CULL_FRAGMENTS\\n\\\n    // When classifying translucent geometry, logDepthOrDepth == 0.0\\n\\\n    // indicates a region that should not be classified, possibly due to there\\n\\\n    // being opaque pixels there in another buffer.\\n\\\n    if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {\\n\\\n        discard;\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n#ifdef NORMAL_EC\\n\\\n    // Compute normal by sampling adjacent pixels in 2x2 block in screen space\\n\\\n    vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));\\n\\\n    vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));\\n\\\n    vec3 normalEC = normalize(cross(leftRight, downUp));\\n\\\n#endif\\n\\\n\\n\\\n\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\n\\n\\\n    vec4 color = czm_gammaCorrect(v_color);\\n\\\n#ifdef FLAT\\n\\\n    out_FragColor = color;\\n\\\n#else // FLAT\\n\\\n    czm_materialInput materialInput;\\n\\\n    materialInput.normalEC = normalEC;\\n\\\n    materialInput.positionToEyeEC = -eyeCoordinate.xyz;\\n\\\n    czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n    material.diffuse = color.rgb;\\n\\\n    material.alpha = color.a;\\n\\\n\\n\\\n    out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\\n\\\n#endif // FLAT\\n\\\n\\n\\\n    // Premultiply alpha. Required for classification primitives on translucent globe.\\n\\\n    out_FragColor.rgb *= out_FragColor.a;\\n\\\n\\n\\\n#else // PER_INSTANCE_COLOR\\n\\\n\\n\\\n    // Material support.\\n\\\n    // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or\\n\\\n    // dependencies for culling but might not actually be used by the material.\\n\\\n\\n\\\n    czm_materialInput materialInput;\\n\\\n\\n\\\n#ifdef USES_NORMAL_EC\\n\\\n    materialInput.normalEC = normalEC;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef USES_POSITION_TO_EYE_EC\\n\\\n    materialInput.positionToEyeEC = -eyeCoordinate.xyz;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef USES_TANGENT_TO_EYE\\n\\\n    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);\\n\\\n#endif\\n\\\n\\n\\\n#ifdef USES_ST\\n\\\n    // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired\\n\\\n    // texture coordinate system, which typically forms a tight oriented bounding box around the geometry.\\n\\\n    // Shader is provided a set of reference points for remapping.\\n\\\n    materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;\\n\\\n    materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;\\n\\\n#endif\\n\\\n\\n\\\n    czm_material material = czm_getMaterial(materialInput);\\n\\\n\\n\\\n#ifdef FLAT\\n\\\n    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#else // FLAT\\n\\\n    out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\\n\\\n#endif // FLAT\\n\\\n\\n\\\n    // Premultiply alpha. Required for classification primitives on translucent globe.\\n\\\n    out_FragColor.rgb *= out_FragColor.a;\\n\\\n\\n\\\n#endif // PER_INSTANCE_COLOR\\n\\\n    czm_writeDepthClamp();\\n\\\n#endif // PICK\\n\\\n}\\n\\\n\";\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport EncodedCartesian3 from \"../Core/EncodedCartesian3.js\";\nimport GeometryInstanceAttribute from \"../Core/GeometryInstanceAttribute.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ShadowVolumeAppearanceFS from \"../Shaders/ShadowVolumeAppearanceFS.js\";\n\n/**\n * Creates shaders for a ClassificationPrimitive to use a given Appearance, as well as for picking.\n *\n * @param {boolean} extentsCulling Discard fragments outside the instance's texture coordinate extents.\n * @param {boolean} planarExtents If true, texture coordinates will be computed using planes instead of spherical coordinates.\n * @param {Appearance} appearance An Appearance to be used with a ClassificationPrimitive via GroundPrimitive.\n * @private\n */\nfunction ShadowVolumeAppearance(extentsCulling, planarExtents, appearance) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.bool(\"extentsCulling\", extentsCulling);\n  Check.typeOf.bool(\"planarExtents\", planarExtents);\n  Check.typeOf.object(\"appearance\", appearance);\n  //>>includeEnd('debug');\n\n  this._projectionExtentDefines = {\n    eastMostYhighDefine: \"\",\n    eastMostYlowDefine: \"\",\n    westMostYhighDefine: \"\",\n    westMostYlowDefine: \"\",\n  };\n\n  // Compute shader dependencies\n  const colorShaderDependencies = new ShaderDependencies();\n  colorShaderDependencies.requiresTextureCoordinates = extentsCulling;\n  colorShaderDependencies.requiresEC = !appearance.flat;\n\n  const pickShaderDependencies = new ShaderDependencies();\n  pickShaderDependencies.requiresTextureCoordinates = extentsCulling;\n\n  if (appearance instanceof PerInstanceColorAppearance) {\n    // PerInstanceColorAppearance doesn't have material.shaderSource, instead it has its own vertex and fragment shaders\n    colorShaderDependencies.requiresNormalEC = !appearance.flat;\n  } else {\n    // Scan material source for what hookups are needed. Assume czm_materialInput materialInput.\n    const materialShaderSource = `${appearance.material.shaderSource}\\n${appearance.fragmentShaderSource}`;\n\n    colorShaderDependencies.normalEC =\n      materialShaderSource.indexOf(\"materialInput.normalEC\") !== -1 ||\n      materialShaderSource.indexOf(\"czm_getDefaultMaterial\") !== -1;\n    colorShaderDependencies.positionToEyeEC =\n      materialShaderSource.indexOf(\"materialInput.positionToEyeEC\") !== -1;\n    colorShaderDependencies.tangentToEyeMatrix =\n      materialShaderSource.indexOf(\"materialInput.tangentToEyeMatrix\") !== -1;\n    colorShaderDependencies.st =\n      materialShaderSource.indexOf(\"materialInput.st\") !== -1;\n  }\n\n  this._colorShaderDependencies = colorShaderDependencies;\n  this._pickShaderDependencies = pickShaderDependencies;\n  this._appearance = appearance;\n  this._extentsCulling = extentsCulling;\n  this._planarExtents = planarExtents;\n}\n\n/**\n * Create the fragment shader for a ClassificationPrimitive's color pass when rendering for color.\n *\n * @param {boolean} columbusView2D Whether the shader will be used for Columbus View or 2D.\n * @returns {ShaderSource} Shader source for the fragment shader.\n */\nShadowVolumeAppearance.prototype.createFragmentShader = function (\n  columbusView2D\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.bool(\"columbusView2D\", columbusView2D);\n  //>>includeEnd('debug');\n\n  const appearance = this._appearance;\n  const dependencies = this._colorShaderDependencies;\n\n  const defines = [];\n  if (!columbusView2D && !this._planarExtents) {\n    defines.push(\"SPHERICAL\");\n  }\n  if (dependencies.requiresEC) {\n    defines.push(\"REQUIRES_EC\");\n  }\n  if (dependencies.requiresWC) {\n    defines.push(\"REQUIRES_WC\");\n  }\n  if (dependencies.requiresTextureCoordinates) {\n    defines.push(\"TEXTURE_COORDINATES\");\n  }\n  if (this._extentsCulling) {\n    defines.push(\"CULL_FRAGMENTS\");\n  }\n  if (dependencies.requiresNormalEC) {\n    defines.push(\"NORMAL_EC\");\n  }\n  if (appearance instanceof PerInstanceColorAppearance) {\n    defines.push(\"PER_INSTANCE_COLOR\");\n  }\n\n  // Material inputs. Use of parameters in the material is different\n  // from requirement of the parameters in the overall shader, for example,\n  // texture coordinates may be used for fragment culling but not for the material itself.\n  if (dependencies.normalEC) {\n    defines.push(\"USES_NORMAL_EC\");\n  }\n  if (dependencies.positionToEyeEC) {\n    defines.push(\"USES_POSITION_TO_EYE_EC\");\n  }\n  if (dependencies.tangentToEyeMatrix) {\n    defines.push(\"USES_TANGENT_TO_EYE\");\n  }\n  if (dependencies.st) {\n    defines.push(\"USES_ST\");\n  }\n\n  if (appearance.flat) {\n    defines.push(\"FLAT\");\n  }\n\n  let materialSource = \"\";\n  if (!(appearance instanceof PerInstanceColorAppearance)) {\n    materialSource = appearance.material.shaderSource;\n  }\n\n  return new ShaderSource({\n    defines: defines,\n    sources: [materialSource, ShadowVolumeAppearanceFS],\n  });\n};\n\nShadowVolumeAppearance.prototype.createPickFragmentShader = function (\n  columbusView2D\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.bool(\"columbusView2D\", columbusView2D);\n  //>>includeEnd('debug');\n\n  const dependencies = this._pickShaderDependencies;\n\n  const defines = [\"PICK\"];\n  if (!columbusView2D && !this._planarExtents) {\n    defines.push(\"SPHERICAL\");\n  }\n  if (dependencies.requiresEC) {\n    defines.push(\"REQUIRES_EC\");\n  }\n  if (dependencies.requiresWC) {\n    defines.push(\"REQUIRES_WC\");\n  }\n  if (dependencies.requiresTextureCoordinates) {\n    defines.push(\"TEXTURE_COORDINATES\");\n  }\n  if (this._extentsCulling) {\n    defines.push(\"CULL_FRAGMENTS\");\n  }\n  return new ShaderSource({\n    defines: defines,\n    sources: [ShadowVolumeAppearanceFS],\n    pickColorQualifier: \"in\",\n  });\n};\n\n/**\n * Create the vertex shader for a ClassificationPrimitive's color pass on the final of 3 shadow volume passes\n *\n * @param {string[]} defines External defines to pass to the vertex shader.\n * @param {string} vertexShaderSource ShadowVolumeAppearanceVS with any required modifications for computing position.\n * @param {boolean} columbusView2D Whether the shader will be used for Columbus View or 2D.\n * @param {MapProjection} mapProjection Current scene's map projection.\n * @returns {string} Shader source for the vertex shader.\n */\nShadowVolumeAppearance.prototype.createVertexShader = function (\n  defines,\n  vertexShaderSource,\n  columbusView2D,\n  mapProjection\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"defines\", defines);\n  Check.typeOf.string(\"vertexShaderSource\", vertexShaderSource);\n  Check.typeOf.bool(\"columbusView2D\", columbusView2D);\n  Check.defined(\"mapProjection\", mapProjection);\n  //>>includeEnd('debug');\n  return createShadowVolumeAppearanceVS(\n    this._colorShaderDependencies,\n    this._planarExtents,\n    columbusView2D,\n    defines,\n    vertexShaderSource,\n    this._appearance,\n    mapProjection,\n    this._projectionExtentDefines\n  );\n};\n\n/**\n * Create the vertex shader for a ClassificationPrimitive's pick pass on the final of 3 shadow volume passes\n *\n * @param {string[]} defines External defines to pass to the vertex shader.\n * @param {string} vertexShaderSource ShadowVolumeAppearanceVS with any required modifications for computing position and picking.\n * @param {boolean} columbusView2D Whether the shader will be used for Columbus View or 2D.\n * @param {MapProjection} mapProjection Current scene's map projection.\n * @returns {string} Shader source for the vertex shader.\n */\nShadowVolumeAppearance.prototype.createPickVertexShader = function (\n  defines,\n  vertexShaderSource,\n  columbusView2D,\n  mapProjection\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"defines\", defines);\n  Check.typeOf.string(\"vertexShaderSource\", vertexShaderSource);\n  Check.typeOf.bool(\"columbusView2D\", columbusView2D);\n  Check.defined(\"mapProjection\", mapProjection);\n  //>>includeEnd('debug');\n  return createShadowVolumeAppearanceVS(\n    this._pickShaderDependencies,\n    this._planarExtents,\n    columbusView2D,\n    defines,\n    vertexShaderSource,\n    undefined,\n    mapProjection,\n    this._projectionExtentDefines\n  );\n};\n\nconst longitudeExtentsCartesianScratch = new Cartesian3();\nconst longitudeExtentsCartographicScratch = new Cartographic();\nconst longitudeExtentsEncodeScratch = {\n  high: 0.0,\n  low: 0.0,\n};\nfunction createShadowVolumeAppearanceVS(\n  shaderDependencies,\n  planarExtents,\n  columbusView2D,\n  defines,\n  vertexShaderSource,\n  appearance,\n  mapProjection,\n  projectionExtentDefines\n) {\n  const allDefines = defines.slice();\n\n  if (projectionExtentDefines.eastMostYhighDefine === \"\") {\n    const eastMostCartographic = longitudeExtentsCartographicScratch;\n    eastMostCartographic.longitude = CesiumMath.PI;\n    eastMostCartographic.latitude = 0.0;\n    eastMostCartographic.height = 0.0;\n    const eastMostCartesian = mapProjection.project(\n      eastMostCartographic,\n      longitudeExtentsCartesianScratch\n    );\n    let encoded = EncodedCartesian3.encode(\n      eastMostCartesian.x,\n      longitudeExtentsEncodeScratch\n    );\n    projectionExtentDefines.eastMostYhighDefine = `EAST_MOST_X_HIGH ${encoded.high.toFixed(\n      `${encoded.high}`.length + 1\n    )}`;\n    projectionExtentDefines.eastMostYlowDefine = `EAST_MOST_X_LOW ${encoded.low.toFixed(\n      `${encoded.low}`.length + 1\n    )}`;\n\n    const westMostCartographic = longitudeExtentsCartographicScratch;\n    westMostCartographic.longitude = -CesiumMath.PI;\n    westMostCartographic.latitude = 0.0;\n    westMostCartographic.height = 0.0;\n    const westMostCartesian = mapProjection.project(\n      westMostCartographic,\n      longitudeExtentsCartesianScratch\n    );\n    encoded = EncodedCartesian3.encode(\n      westMostCartesian.x,\n      longitudeExtentsEncodeScratch\n    );\n    projectionExtentDefines.westMostYhighDefine = `WEST_MOST_X_HIGH ${encoded.high.toFixed(\n      `${encoded.high}`.length + 1\n    )}`;\n    projectionExtentDefines.westMostYlowDefine = `WEST_MOST_X_LOW ${encoded.low.toFixed(\n      `${encoded.low}`.length + 1\n    )}`;\n  }\n\n  if (columbusView2D) {\n    allDefines.push(projectionExtentDefines.eastMostYhighDefine);\n    allDefines.push(projectionExtentDefines.eastMostYlowDefine);\n    allDefines.push(projectionExtentDefines.westMostYhighDefine);\n    allDefines.push(projectionExtentDefines.westMostYlowDefine);\n  }\n\n  if (defined(appearance) && appearance instanceof PerInstanceColorAppearance) {\n    allDefines.push(\"PER_INSTANCE_COLOR\");\n  }\n  if (shaderDependencies.requiresTextureCoordinates) {\n    allDefines.push(\"TEXTURE_COORDINATES\");\n    if (!(planarExtents || columbusView2D)) {\n      allDefines.push(\"SPHERICAL\");\n    }\n    if (columbusView2D) {\n      allDefines.push(\"COLUMBUS_VIEW_2D\");\n    }\n  }\n\n  return new ShaderSource({\n    defines: allDefines,\n    sources: [vertexShaderSource],\n  });\n}\n\n/**\n * Tracks shader dependencies.\n * @private\n */\nfunction ShaderDependencies() {\n  this._requiresEC = false;\n  this._requiresWC = false; // depends on eye coordinates, needed for material and for phong\n  this._requiresNormalEC = false; // depends on eye coordinates, needed for material\n  this._requiresTextureCoordinates = false; // depends on world coordinates, needed for material and for culling\n\n  this._usesNormalEC = false;\n  this._usesPositionToEyeEC = false;\n  this._usesTangentToEyeMat = false;\n  this._usesSt = false;\n}\n\nObject.defineProperties(ShaderDependencies.prototype, {\n  // Set when assessing final shading (flat vs. phong) and culling using computed texture coordinates\n  requiresEC: {\n    get: function () {\n      return this._requiresEC;\n    },\n    set: function (value) {\n      this._requiresEC = value || this._requiresEC;\n    },\n  },\n  requiresWC: {\n    get: function () {\n      return this._requiresWC;\n    },\n    set: function (value) {\n      this._requiresWC = value || this._requiresWC;\n      this.requiresEC = this._requiresWC;\n    },\n  },\n  requiresNormalEC: {\n    get: function () {\n      return this._requiresNormalEC;\n    },\n    set: function (value) {\n      this._requiresNormalEC = value || this._requiresNormalEC;\n      this.requiresEC = this._requiresNormalEC;\n    },\n  },\n  requiresTextureCoordinates: {\n    get: function () {\n      return this._requiresTextureCoordinates;\n    },\n    set: function (value) {\n      this._requiresTextureCoordinates =\n        value || this._requiresTextureCoordinates;\n      this.requiresWC = this._requiresTextureCoordinates;\n    },\n  },\n  // Get/Set when assessing material hookups\n  normalEC: {\n    set: function (value) {\n      this.requiresNormalEC = value;\n      this._usesNormalEC = value;\n    },\n    get: function () {\n      return this._usesNormalEC;\n    },\n  },\n  tangentToEyeMatrix: {\n    set: function (value) {\n      this.requiresWC = value;\n      this.requiresNormalEC = value;\n      this._usesTangentToEyeMat = value;\n    },\n    get: function () {\n      return this._usesTangentToEyeMat;\n    },\n  },\n  positionToEyeEC: {\n    set: function (value) {\n      this.requiresEC = value;\n      this._usesPositionToEyeEC = value;\n    },\n    get: function () {\n      return this._usesPositionToEyeEC;\n    },\n  },\n  st: {\n    set: function (value) {\n      this.requiresTextureCoordinates = value;\n      this._usesSt = value;\n    },\n    get: function () {\n      return this._usesSt;\n    },\n  },\n});\n\nfunction pointLineDistance(point1, point2, point) {\n  return (\n    Math.abs(\n      (point2.y - point1.y) * point.x -\n        (point2.x - point1.x) * point.y +\n        point2.x * point1.y -\n        point2.y * point1.x\n    ) / Cartesian2.distance(point2, point1)\n  );\n}\n\nconst points2DScratch = [\n  new Cartesian2(),\n  new Cartesian2(),\n  new Cartesian2(),\n  new Cartesian2(),\n];\n\n// textureCoordinateRotationPoints form 2 lines in the computed UV space that remap to desired texture coordinates.\n// This allows simulation of baked texture coordinates for EllipseGeometry, RectangleGeometry, and PolygonGeometry.\nfunction addTextureCoordinateRotationAttributes(\n  attributes,\n  textureCoordinateRotationPoints\n) {\n  const points2D = points2DScratch;\n\n  const minXYCorner = Cartesian2.unpack(\n    textureCoordinateRotationPoints,\n    0,\n    points2D[0]\n  );\n  const maxYCorner = Cartesian2.unpack(\n    textureCoordinateRotationPoints,\n    2,\n    points2D[1]\n  );\n  const maxXCorner = Cartesian2.unpack(\n    textureCoordinateRotationPoints,\n    4,\n    points2D[2]\n  );\n\n  attributes.uMaxVmax = new GeometryInstanceAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: 4,\n    normalize: false,\n    value: [maxYCorner.x, maxYCorner.y, maxXCorner.x, maxXCorner.y],\n  });\n\n  const inverseExtentX =\n    1.0 / pointLineDistance(minXYCorner, maxYCorner, maxXCorner);\n  const inverseExtentY =\n    1.0 / pointLineDistance(minXYCorner, maxXCorner, maxYCorner);\n\n  attributes.uvMinAndExtents = new GeometryInstanceAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: 4,\n    normalize: false,\n    value: [minXYCorner.x, minXYCorner.y, inverseExtentX, inverseExtentY],\n  });\n}\n\nconst cartographicScratch = new Cartographic();\nconst cornerScratch = new Cartesian3();\nconst northWestScratch = new Cartesian3();\nconst southEastScratch = new Cartesian3();\nconst highLowScratch = { high: 0.0, low: 0.0 };\nfunction add2DTextureCoordinateAttributes(rectangle, projection, attributes) {\n  // Compute corner positions in double precision\n  const carto = cartographicScratch;\n  carto.height = 0.0;\n\n  carto.longitude = rectangle.west;\n  carto.latitude = rectangle.south;\n\n  const southWestCorner = projection.project(carto, cornerScratch);\n\n  carto.latitude = rectangle.north;\n  const northWest = projection.project(carto, northWestScratch);\n\n  carto.longitude = rectangle.east;\n  carto.latitude = rectangle.south;\n  const southEast = projection.project(carto, southEastScratch);\n\n  // Since these positions are all in the 2D plane, there's a lot of zeros\n  // and a lot of repetition. So we only need to encode 4 values.\n  // Encode:\n  // x: x value for southWestCorner\n  // y: y value for southWestCorner\n  // z: y value for northWest\n  // w: x value for southEast\n\n  const valuesHigh = [0, 0, 0, 0];\n  const valuesLow = [0, 0, 0, 0];\n  let encoded = EncodedCartesian3.encode(southWestCorner.x, highLowScratch);\n  valuesHigh[0] = encoded.high;\n  valuesLow[0] = encoded.low;\n\n  encoded = EncodedCartesian3.encode(southWestCorner.y, highLowScratch);\n  valuesHigh[1] = encoded.high;\n  valuesLow[1] = encoded.low;\n\n  encoded = EncodedCartesian3.encode(northWest.y, highLowScratch);\n  valuesHigh[2] = encoded.high;\n  valuesLow[2] = encoded.low;\n\n  encoded = EncodedCartesian3.encode(southEast.x, highLowScratch);\n  valuesHigh[3] = encoded.high;\n  valuesLow[3] = encoded.low;\n\n  attributes.planes2D_HIGH = new GeometryInstanceAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: 4,\n    normalize: false,\n    value: valuesHigh,\n  });\n\n  attributes.planes2D_LOW = new GeometryInstanceAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: 4,\n    normalize: false,\n    value: valuesLow,\n  });\n}\n\nconst enuMatrixScratch = new Matrix4();\nconst inverseEnuScratch = new Matrix4();\nconst rectanglePointCartesianScratch = new Cartesian3();\nconst rectangleCenterScratch = new Cartographic();\nconst pointsCartographicScratch = [\n  new Cartographic(),\n  new Cartographic(),\n  new Cartographic(),\n  new Cartographic(),\n  new Cartographic(),\n  new Cartographic(),\n  new Cartographic(),\n  new Cartographic(),\n];\n/**\n * When computing planes to bound the rectangle,\n * need to factor in \"bulge\" and other distortion.\n * Flatten the ellipsoid-centered corners and edge-centers of the rectangle\n * into the plane of the local ENU system, compute bounds in 2D, and\n * project back to ellipsoid-centered.\n *\n * @private\n */\nfunction computeRectangleBounds(\n  rectangle,\n  ellipsoid,\n  height,\n  southWestCornerResult,\n  eastVectorResult,\n  northVectorResult\n) {\n  // Compute center of rectangle\n  const centerCartographic = Rectangle.center(\n    rectangle,\n    rectangleCenterScratch\n  );\n  centerCartographic.height = height;\n  const centerCartesian = Cartographic.toCartesian(\n    centerCartographic,\n    ellipsoid,\n    rectanglePointCartesianScratch\n  );\n  const enuMatrix = Transforms.eastNorthUpToFixedFrame(\n    centerCartesian,\n    ellipsoid,\n    enuMatrixScratch\n  );\n  const inverseEnu = Matrix4.inverse(enuMatrix, inverseEnuScratch);\n\n  const west = rectangle.west;\n  const east = rectangle.east;\n  const north = rectangle.north;\n  const south = rectangle.south;\n\n  const cartographics = pointsCartographicScratch;\n  cartographics[0].latitude = south;\n  cartographics[0].longitude = west;\n  cartographics[1].latitude = north;\n  cartographics[1].longitude = west;\n  cartographics[2].latitude = north;\n  cartographics[2].longitude = east;\n  cartographics[3].latitude = south;\n  cartographics[3].longitude = east;\n\n  const longitudeCenter = (west + east) * 0.5;\n  const latitudeCenter = (north + south) * 0.5;\n\n  cartographics[4].latitude = south;\n  cartographics[4].longitude = longitudeCenter;\n  cartographics[5].latitude = north;\n  cartographics[5].longitude = longitudeCenter;\n  cartographics[6].latitude = latitudeCenter;\n  cartographics[6].longitude = west;\n  cartographics[7].latitude = latitudeCenter;\n  cartographics[7].longitude = east;\n\n  let minX = Number.POSITIVE_INFINITY;\n  let maxX = Number.NEGATIVE_INFINITY;\n  let minY = Number.POSITIVE_INFINITY;\n  let maxY = Number.NEGATIVE_INFINITY;\n  for (let i = 0; i < 8; i++) {\n    cartographics[i].height = height;\n    const pointCartesian = Cartographic.toCartesian(\n      cartographics[i],\n      ellipsoid,\n      rectanglePointCartesianScratch\n    );\n    Matrix4.multiplyByPoint(inverseEnu, pointCartesian, pointCartesian);\n    pointCartesian.z = 0.0; // flatten into XY plane of ENU coordinate system\n    minX = Math.min(minX, pointCartesian.x);\n    maxX = Math.max(maxX, pointCartesian.x);\n    minY = Math.min(minY, pointCartesian.y);\n    maxY = Math.max(maxY, pointCartesian.y);\n  }\n\n  const southWestCorner = southWestCornerResult;\n  southWestCorner.x = minX;\n  southWestCorner.y = minY;\n  southWestCorner.z = 0.0;\n  Matrix4.multiplyByPoint(enuMatrix, southWestCorner, southWestCorner);\n\n  const southEastCorner = eastVectorResult;\n  southEastCorner.x = maxX;\n  southEastCorner.y = minY;\n  southEastCorner.z = 0.0;\n  Matrix4.multiplyByPoint(enuMatrix, southEastCorner, southEastCorner);\n  // make eastward vector\n  Cartesian3.subtract(southEastCorner, southWestCorner, eastVectorResult);\n\n  const northWestCorner = northVectorResult;\n  northWestCorner.x = minX;\n  northWestCorner.y = maxY;\n  northWestCorner.z = 0.0;\n  Matrix4.multiplyByPoint(enuMatrix, northWestCorner, northWestCorner);\n  // make eastward vector\n  Cartesian3.subtract(northWestCorner, southWestCorner, northVectorResult);\n}\n\nconst eastwardScratch = new Cartesian3();\nconst northwardScratch = new Cartesian3();\nconst encodeScratch = new EncodedCartesian3();\n/**\n * Gets an attributes object containing:\n * - 3 high-precision points as 6 GeometryInstanceAttributes. These points are used to compute eye-space planes.\n * - 1 texture coordinate rotation GeometryInstanceAttributes\n * - 2 GeometryInstanceAttributes used to compute high-precision points in 2D and Columbus View.\n *   These points are used to compute eye-space planes like above.\n *\n * Used to compute texture coordinates for small-area ClassificationPrimitives with materials or multiple non-overlapping instances.\n *\n * @see ShadowVolumeAppearance\n * @private\n *\n * @param {Rectangle} boundingRectangle Rectangle object that the points will approximately bound\n * @param {number[]} textureCoordinateRotationPoints Points in the computed texture coordinate system for remapping texture coordinates\n * @param {Ellipsoid} ellipsoid Ellipsoid for converting Rectangle points to world coordinates\n * @param {MapProjection} projection The MapProjection used for 2D and Columbus View.\n * @param {number} [height=0] The maximum height for the shadow volume.\n * @returns {object} An attributes dictionary containing planar texture coordinate attributes.\n */\nShadowVolumeAppearance.getPlanarTextureCoordinateAttributes = function (\n  boundingRectangle,\n  textureCoordinateRotationPoints,\n  ellipsoid,\n  projection,\n  height\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"boundingRectangle\", boundingRectangle);\n  Check.defined(\n    \"textureCoordinateRotationPoints\",\n    textureCoordinateRotationPoints\n  );\n  Check.typeOf.object(\"ellipsoid\", ellipsoid);\n  Check.typeOf.object(\"projection\", projection);\n  //>>includeEnd('debug');\n\n  const corner = cornerScratch;\n  const eastward = eastwardScratch;\n  const northward = northwardScratch;\n  computeRectangleBounds(\n    boundingRectangle,\n    ellipsoid,\n    defaultValue(height, 0.0),\n    corner,\n    eastward,\n    northward\n  );\n\n  const attributes = {};\n  addTextureCoordinateRotationAttributes(\n    attributes,\n    textureCoordinateRotationPoints\n  );\n\n  const encoded = EncodedCartesian3.fromCartesian(corner, encodeScratch);\n\n  attributes.southWest_HIGH = new GeometryInstanceAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: 3,\n    normalize: false,\n    value: Cartesian3.pack(encoded.high, [0, 0, 0]),\n  });\n  attributes.southWest_LOW = new GeometryInstanceAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: 3,\n    normalize: false,\n    value: Cartesian3.pack(encoded.low, [0, 0, 0]),\n  });\n  attributes.eastward = new GeometryInstanceAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: 3,\n    normalize: false,\n    value: Cartesian3.pack(eastward, [0, 0, 0]),\n  });\n  attributes.northward = new GeometryInstanceAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: 3,\n    normalize: false,\n    value: Cartesian3.pack(northward, [0, 0, 0]),\n  });\n\n  add2DTextureCoordinateAttributes(boundingRectangle, projection, attributes);\n  return attributes;\n};\n\nconst spherePointScratch = new Cartesian3();\nfunction latLongToSpherical(latitude, longitude, ellipsoid, result) {\n  const cartographic = cartographicScratch;\n  cartographic.latitude = latitude;\n  cartographic.longitude = longitude;\n  cartographic.height = 0.0;\n\n  const spherePoint = Cartographic.toCartesian(\n    cartographic,\n    ellipsoid,\n    spherePointScratch\n  );\n\n  // Project into plane with vertical for latitude\n  const magXY = Math.sqrt(\n    spherePoint.x * spherePoint.x + spherePoint.y * spherePoint.y\n  );\n\n  // Use fastApproximateAtan2 for alignment with shader\n  const sphereLatitude = CesiumMath.fastApproximateAtan2(magXY, spherePoint.z);\n  const sphereLongitude = CesiumMath.fastApproximateAtan2(\n    spherePoint.x,\n    spherePoint.y\n  );\n\n  result.x = sphereLatitude;\n  result.y = sphereLongitude;\n\n  return result;\n}\n\nconst sphericalScratch = new Cartesian2();\n/**\n * Gets an attributes object containing:\n * - the southwest corner of a rectangular area in spherical coordinates, as well as the inverse of the latitude/longitude range.\n *   These are computed using the same atan2 approximation used in the shader.\n * - 1 texture coordinate rotation GeometryInstanceAttributes\n * - 2 GeometryInstanceAttributes used to compute high-precision points in 2D and Columbus View.\n *   These points are used to compute eye-space planes like above.\n *\n * Used when computing texture coordinates for large-area ClassificationPrimitives with materials or\n * multiple non-overlapping instances.\n * @see ShadowVolumeAppearance\n * @private\n *\n * @param {Rectangle} boundingRectangle Rectangle object that the spherical extents will approximately bound\n * @param {number[]} textureCoordinateRotationPoints Points in the computed texture coordinate system for remapping texture coordinates\n * @param {Ellipsoid} ellipsoid Ellipsoid for converting Rectangle points to world coordinates\n * @param {MapProjection} projection The MapProjection used for 2D and Columbus View.\n * @returns {object} An attributes dictionary containing spherical texture coordinate attributes.\n */\nShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes = function (\n  boundingRectangle,\n  textureCoordinateRotationPoints,\n  ellipsoid,\n  projection\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"boundingRectangle\", boundingRectangle);\n  Check.defined(\n    \"textureCoordinateRotationPoints\",\n    textureCoordinateRotationPoints\n  );\n  Check.typeOf.object(\"ellipsoid\", ellipsoid);\n  Check.typeOf.object(\"projection\", projection);\n  //>>includeEnd('debug');\n\n  // rectangle cartographic coords !== spherical because it's on an ellipsoid\n  const southWestExtents = latLongToSpherical(\n    boundingRectangle.south,\n    boundingRectangle.west,\n    ellipsoid,\n    sphericalScratch\n  );\n\n  let south = southWestExtents.x;\n  let west = southWestExtents.y;\n\n  const northEastExtents = latLongToSpherical(\n    boundingRectangle.north,\n    boundingRectangle.east,\n    ellipsoid,\n    sphericalScratch\n  );\n  let north = northEastExtents.x;\n  let east = northEastExtents.y;\n\n  // If the bounding rectangle crosses the IDL, rotate the spherical extents so the cross no longer happens.\n  // This rotation must happen in the shader too.\n  let rotationRadians = 0.0;\n  if (west > east) {\n    rotationRadians = CesiumMath.PI - west;\n    west = -CesiumMath.PI;\n    east += rotationRadians;\n  }\n\n  // Slightly pad extents to avoid floating point error when fragment culling at edges.\n  south -= CesiumMath.EPSILON5;\n  west -= CesiumMath.EPSILON5;\n  north += CesiumMath.EPSILON5;\n  east += CesiumMath.EPSILON5;\n\n  const longitudeRangeInverse = 1.0 / (east - west);\n  const latitudeRangeInverse = 1.0 / (north - south);\n\n  const attributes = {\n    sphericalExtents: new GeometryInstanceAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 4,\n      normalize: false,\n      value: [south, west, latitudeRangeInverse, longitudeRangeInverse],\n    }),\n    longitudeRotation: new GeometryInstanceAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 1,\n      normalize: false,\n      value: [rotationRadians],\n    }),\n  };\n\n  addTextureCoordinateRotationAttributes(\n    attributes,\n    textureCoordinateRotationPoints\n  );\n  add2DTextureCoordinateAttributes(boundingRectangle, projection, attributes);\n  return attributes;\n};\n\nShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes = function (\n  attributes\n) {\n  return (\n    defined(attributes.southWest_HIGH) &&\n    defined(attributes.southWest_LOW) &&\n    defined(attributes.northward) &&\n    defined(attributes.eastward) &&\n    defined(attributes.planes2D_HIGH) &&\n    defined(attributes.planes2D_LOW) &&\n    defined(attributes.uMaxVmax) &&\n    defined(attributes.uvMinAndExtents)\n  );\n};\n\nShadowVolumeAppearance.hasAttributesForSphericalExtents = function (\n  attributes\n) {\n  return (\n    defined(attributes.sphericalExtents) &&\n    defined(attributes.longitudeRotation) &&\n    defined(attributes.planes2D_HIGH) &&\n    defined(attributes.planes2D_LOW) &&\n    defined(attributes.uMaxVmax) &&\n    defined(attributes.uvMinAndExtents)\n  );\n};\n\nfunction shouldUseSpherical(rectangle) {\n  return (\n    Math.max(rectangle.width, rectangle.height) >\n    ShadowVolumeAppearance.MAX_WIDTH_FOR_PLANAR_EXTENTS\n  );\n}\n\n/**\n * Computes whether the given rectangle is wide enough that texture coordinates\n * over its area should be computed using spherical extents instead of distance to planes.\n *\n * @param {Rectangle} rectangle A rectangle\n * @private\n */\nShadowVolumeAppearance.shouldUseSphericalCoordinates = function (rectangle) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  //>>includeEnd('debug');\n\n  return shouldUseSpherical(rectangle);\n};\n\n/**\n * Texture coordinates for ground primitives are computed either using spherical coordinates for large areas or\n * using distance from planes for small areas.\n *\n * @type {number}\n * @constant\n * @private\n */\nShadowVolumeAppearance.MAX_WIDTH_FOR_PLANAR_EXTENTS = CesiumMath.toRadians(1.0);\nexport default ShadowVolumeAppearance;\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Determines the function used to compare stencil values for the stencil test.\n *\n * @enum {number}\n */\nconst StencilFunction = {\n  /**\n   * The stencil test never passes.\n   *\n   * @type {number}\n   * @constant\n   */\n  NEVER: WebGLConstants.NEVER,\n\n  /**\n   * The stencil test passes when the masked reference value is less than the masked stencil value.\n   *\n   * @type {number}\n   * @constant\n   */\n  LESS: WebGLConstants.LESS,\n\n  /**\n   * The stencil test passes when the masked reference value is equal to the masked stencil value.\n   *\n   * @type {number}\n   * @constant\n   */\n  EQUAL: WebGLConstants.EQUAL,\n\n  /**\n   * The stencil test passes when the masked reference value is less than or equal to the masked stencil value.\n   *\n   * @type {number}\n   * @constant\n   */\n  LESS_OR_EQUAL: WebGLConstants.LEQUAL,\n\n  /**\n   * The stencil test passes when the masked reference value is greater than the masked stencil value.\n   *\n   * @type {number}\n   * @constant\n   */\n  GREATER: WebGLConstants.GREATER,\n\n  /**\n   * The stencil test passes when the masked reference value is not equal to the masked stencil value.\n   *\n   * @type {number}\n   * @constant\n   */\n  NOT_EQUAL: WebGLConstants.NOTEQUAL,\n\n  /**\n   * The stencil test passes when the masked reference value is greater than or equal to the masked stencil value.\n   *\n   * @type {number}\n   * @constant\n   */\n  GREATER_OR_EQUAL: WebGLConstants.GEQUAL,\n\n  /**\n   * The stencil test always passes.\n   *\n   * @type {number}\n   * @constant\n   */\n  ALWAYS: WebGLConstants.ALWAYS,\n};\nexport default Object.freeze(StencilFunction);\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Determines the action taken based on the result of the stencil test.\n *\n * @enum {number}\n */\nconst StencilOperation = {\n  /**\n   * Sets the stencil buffer value to zero.\n   *\n   * @type {number}\n   * @constant\n   */\n  ZERO: WebGLConstants.ZERO,\n\n  /**\n   * Does not change the stencil buffer.\n   *\n   * @type {number}\n   * @constant\n   */\n  KEEP: WebGLConstants.KEEP,\n\n  /**\n   * Replaces the stencil buffer value with the reference value.\n   *\n   * @type {number}\n   * @constant\n   */\n  REPLACE: WebGLConstants.REPLACE,\n\n  /**\n   * Increments the stencil buffer value, clamping to unsigned byte.\n   *\n   * @type {number}\n   * @constant\n   */\n  INCREMENT: WebGLConstants.INCR,\n\n  /**\n   * Decrements the stencil buffer value, clamping to zero.\n   *\n   * @type {number}\n   * @constant\n   */\n  DECREMENT: WebGLConstants.DECR,\n\n  /**\n   * Bitwise inverts the existing stencil buffer value.\n   *\n   * @type {number}\n   * @constant\n   */\n  INVERT: WebGLConstants.INVERT,\n\n  /**\n   * Increments the stencil buffer value, wrapping to zero when exceeding the unsigned byte range.\n   *\n   * @type {number}\n   * @constant\n   */\n  INCREMENT_WRAP: WebGLConstants.INCR_WRAP,\n\n  /**\n   * Decrements the stencil buffer value, wrapping to the maximum unsigned byte instead of going below zero.\n   *\n   * @type {number}\n   * @constant\n   */\n  DECREMENT_WRAP: WebGLConstants.DECR_WRAP,\n};\nexport default Object.freeze(StencilOperation);\n", "import StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\n\n/**\n * The most significant bit is used to identify whether the pixel is 3D Tiles.\n * The next three bits store selection depth for the skip LODs optimization.\n * The last four bits are for increment/decrement shadow volume operations for classification.\n *\n * @private\n */\nconst StencilConstants = {\n  CESIUM_3D_TILE_MASK: 0x80,\n  SKIP_LOD_MASK: 0x70,\n  SKIP_LOD_BIT_SHIFT: 4,\n  CLASSIFICATION_MASK: 0x0f,\n};\n\nStencilConstants.setCesium3DTileBit = function () {\n  return {\n    enabled: true,\n    frontFunction: StencilFunction.ALWAYS,\n    frontOperation: {\n      fail: StencilOperation.KEEP,\n      zFail: StencilOperation.KEEP,\n      zPass: StencilOperation.REPLACE,\n    },\n    backFunction: StencilFunction.ALWAYS,\n    backOperation: {\n      fail: StencilOperation.KEEP,\n      zFail: StencilOperation.KEEP,\n      zPass: StencilOperation.REPLACE,\n    },\n    reference: StencilConstants.CESIUM_3D_TILE_MASK,\n    mask: StencilConstants.CESIUM_3D_TILE_MASK,\n  };\n};\nexport default Object.freeze(StencilConstants);\n", "import ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport ShadowVolumeAppearanceVS from \"../Shaders/ShadowVolumeAppearanceVS.js\";\nimport ShadowVolumeFS from \"../Shaders/ShadowVolumeFS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport ClassificationType from \"./ClassificationType.js\";\nimport DepthFunction from \"./DepthFunction.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowVolumeAppearance from \"./ShadowVolumeAppearance.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\n\n/**\n * A classification primitive represents a volume enclosing geometry in the {@link Scene} to be highlighted.\n * <p>\n * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including\n * {@link Material} and {@link RenderState}.  Roughly, the geometry instance defines the structure and placement,\n * and the appearance defines the visual characteristics.  Decoupling geometry and appearance allows us to mix\n * and match most of them and add a new geometry or appearance independently of each other.\n * Only {@link PerInstanceColorAppearance} with the same color across all instances is supported at this time when using\n * ClassificationPrimitive directly.\n * For full {@link Appearance} support when classifying terrain or 3D Tiles use {@link GroundPrimitive} instead.\n * </p>\n * <p>\n * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there\n * will be rendering artifacts for some viewing angles.\n * </p>\n * <p>\n * Valid geometries are {@link BoxGeometry}, {@link CylinderGeometry}, {@link EllipsoidGeometry}, {@link PolylineVolumeGeometry}, and {@link SphereGeometry}.\n * </p>\n * <p>\n * Geometries that follow the surface of the ellipsoid, such as {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry},\n * are also valid if they are extruded volumes; otherwise, they will not be rendered.\n * </p>\n *\n * @alias ClassificationPrimitive\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Array|GeometryInstance} [options.geometryInstances] The geometry instances to render. This can either be a single instance or an array of length one.\n * @param {Appearance} [options.appearance] The appearance used to render the primitive. Defaults to PerInstanceColorAppearance when GeometryInstances have a color attribute.\n * @param {boolean} [options.show=true] Determines if this primitive will be shown.\n * @param {boolean} [options.vertexCacheOptimize=false] When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.\n * @param {boolean} [options.interleave=false] When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.\n * @param {boolean} [options.compressVertices=true] When <code>true</code>, the geometry vertices are compressed, which will save memory.\n * @param {boolean} [options.releaseGeometryInstances=true] When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n * @param {boolean} [options.allowPicking=true] When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}.  When <code>false</code>, GPU memory is saved.\n * @param {boolean} [options.asynchronous=true] Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.\n * @param {ClassificationType} [options.classificationType=ClassificationType.BOTH] Determines whether terrain, 3D Tiles or both will be classified.\n * @param {boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {boolean} [options.debugShowShadowVolume=false] For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be <code>true</code> on\n *                  creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.\n *\n * @see Primitive\n * @see GroundPrimitive\n * @see GeometryInstance\n * @see Appearance\n */\nfunction ClassificationPrimitive(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const geometryInstances = options.geometryInstances;\n\n  /**\n   * The geometry instance rendered with this primitive.  This may\n   * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>\n   * is <code>true</code> when the primitive is constructed.\n   * <p>\n   * Changing this property after the primitive is rendered has no effect.\n   * </p>\n   * <p>\n   * Because of the rendering technique used, all geometry instances must be the same color.\n   * If there is an instance with a differing color, a <code>DeveloperError</code> will be thrown\n   * on the first attempt to render.\n   * </p>\n   *\n   * @readonly\n   * @type {Array|GeometryInstance}\n   *\n   * @default undefined\n   */\n  this.geometryInstances = geometryInstances;\n  /**\n   * Determines if the primitive will be shown.  This affects all geometry\n   * instances in the primitive.\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n  /**\n   * Determines whether terrain, 3D Tiles or both will be classified.\n   *\n   * @type {ClassificationType}\n   *\n   * @default ClassificationType.BOTH\n   */\n  this.classificationType = defaultValue(\n    options.classificationType,\n    ClassificationType.BOTH\n  );\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the bounding sphere for each draw command in the primitive.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowBoundingVolume = defaultValue(\n    options.debugShowBoundingVolume,\n    false\n  );\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the shadow volume for each geometry in the primitive.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowShadowVolume = defaultValue(\n    options.debugShowShadowVolume,\n    false\n  );\n  this._debugShowShadowVolume = false;\n\n  // These are used by GroundPrimitive to augment the shader and uniform map.\n  this._extruded = defaultValue(options._extruded, false);\n  this._uniformMap = options._uniformMap;\n\n  this._sp = undefined;\n  this._spStencil = undefined;\n  this._spPick = undefined;\n  this._spColor = undefined;\n\n  this._spPick2D = undefined; // only derived if necessary\n  this._spColor2D = undefined; // only derived if necessary\n\n  this._rsStencilDepthPass = undefined;\n  this._rsStencilDepthPass3DTiles = undefined;\n  this._rsColorPass = undefined;\n  this._rsPickPass = undefined;\n\n  this._commandsIgnoreShow = [];\n\n  this._ready = false;\n  this._primitive = undefined;\n  this._pickPrimitive = options._pickPrimitive;\n\n  // Set in update\n  this._hasSphericalExtentsAttribute = false;\n  this._hasPlanarExtentsAttributes = false;\n  this._hasPerColorAttribute = false;\n\n  this.appearance = options.appearance;\n\n  this._createBoundingVolumeFunction = options._createBoundingVolumeFunction;\n  this._updateAndQueueCommandsFunction =\n    options._updateAndQueueCommandsFunction;\n\n  this._usePickOffsets = false;\n\n  this._primitiveOptions = {\n    geometryInstances: undefined,\n    appearance: undefined,\n    vertexCacheOptimize: defaultValue(options.vertexCacheOptimize, false),\n    interleave: defaultValue(options.interleave, false),\n    releaseGeometryInstances: defaultValue(\n      options.releaseGeometryInstances,\n      true\n    ),\n    allowPicking: defaultValue(options.allowPicking, true),\n    asynchronous: defaultValue(options.asynchronous, true),\n    compressVertices: defaultValue(options.compressVertices, true),\n    _createBoundingVolumeFunction: undefined,\n    _createRenderStatesFunction: undefined,\n    _createShaderProgramFunction: undefined,\n    _createCommandsFunction: undefined,\n    _updateAndQueueCommandsFunction: undefined,\n    _createPickOffsets: true,\n  };\n}\n\nObject.defineProperties(ClassificationPrimitive.prototype, {\n  /**\n   * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.\n   *\n   * @memberof ClassificationPrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  vertexCacheOptimize: {\n    get: function () {\n      return this._primitiveOptions.vertexCacheOptimize;\n    },\n  },\n\n  /**\n   * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.\n   *\n   * @memberof ClassificationPrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  interleave: {\n    get: function () {\n      return this._primitiveOptions.interleave;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n   *\n   * @memberof ClassificationPrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  releaseGeometryInstances: {\n    get: function () {\n      return this._primitiveOptions.releaseGeometryInstances;\n    },\n  },\n\n  /**\n   * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}.  When <code>false</code>, GPU memory is saved.\n   *\n   * @memberof ClassificationPrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  allowPicking: {\n    get: function () {\n      return this._primitiveOptions.allowPicking;\n    },\n  },\n\n  /**\n   * Determines if the geometry instances will be created and batched on a web worker.\n   *\n   * @memberof ClassificationPrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  asynchronous: {\n    get: function () {\n      return this._primitiveOptions.asynchronous;\n    },\n  },\n\n  /**\n   * When <code>true</code>, geometry vertices are compressed, which will save memory.\n   *\n   * @memberof ClassificationPrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  compressVertices: {\n    get: function () {\n      return this._primitiveOptions.compressVertices;\n    },\n  },\n\n  /**\n   * Determines if the primitive is complete and ready to render.  If this property is\n   * true, the primitive will be rendered the next time that {@link ClassificationPrimitive#update}\n   * is called.\n   *\n   * @memberof ClassificationPrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n\n  /**\n   * Returns true if the ClassificationPrimitive needs a separate shader and commands for 2D.\n   * This is because texture coordinates on ClassificationPrimitives are computed differently,\n   * and are used for culling when multiple GeometryInstances are batched in one ClassificationPrimitive.\n   * @memberof ClassificationPrimitive.prototype\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  _needs2DShader: {\n    get: function () {\n      return (\n        this._hasPlanarExtentsAttributes || this._hasSphericalExtentsAttribute\n      );\n    },\n  },\n});\n\n/**\n * Determines if ClassificationPrimitive rendering is supported.\n *\n * @param {Scene} scene The scene.\n * @returns {boolean} <code>true</code> if ClassificationPrimitives are supported; otherwise, returns <code>false</code>\n */\nClassificationPrimitive.isSupported = function (scene) {\n  return scene.context.stencilBuffer;\n};\n\nfunction getStencilDepthRenderState(enableStencil, mask3DTiles) {\n  const stencilFunction = mask3DTiles\n    ? StencilFunction.EQUAL\n    : StencilFunction.ALWAYS;\n  return {\n    colorMask: {\n      red: false,\n      green: false,\n      blue: false,\n      alpha: false,\n    },\n    stencilTest: {\n      enabled: enableStencil,\n      frontFunction: stencilFunction,\n      frontOperation: {\n        fail: StencilOperation.KEEP,\n        zFail: StencilOperation.DECREMENT_WRAP,\n        zPass: StencilOperation.KEEP,\n      },\n      backFunction: stencilFunction,\n      backOperation: {\n        fail: StencilOperation.KEEP,\n        zFail: StencilOperation.INCREMENT_WRAP,\n        zPass: StencilOperation.KEEP,\n      },\n      reference: StencilConstants.CESIUM_3D_TILE_MASK,\n      mask: StencilConstants.CESIUM_3D_TILE_MASK,\n    },\n    stencilMask: StencilConstants.CLASSIFICATION_MASK,\n    depthTest: {\n      enabled: true,\n      func: DepthFunction.LESS_OR_EQUAL,\n    },\n    depthMask: false,\n  };\n}\n\nfunction getColorRenderState(enableStencil) {\n  return {\n    stencilTest: {\n      enabled: enableStencil,\n      frontFunction: StencilFunction.NOT_EQUAL,\n      frontOperation: {\n        fail: StencilOperation.ZERO,\n        zFail: StencilOperation.ZERO,\n        zPass: StencilOperation.ZERO,\n      },\n      backFunction: StencilFunction.NOT_EQUAL,\n      backOperation: {\n        fail: StencilOperation.ZERO,\n        zFail: StencilOperation.ZERO,\n        zPass: StencilOperation.ZERO,\n      },\n      reference: 0,\n      mask: StencilConstants.CLASSIFICATION_MASK,\n    },\n    stencilMask: StencilConstants.CLASSIFICATION_MASK,\n    depthTest: {\n      enabled: false,\n    },\n    depthMask: false,\n    blending: BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,\n  };\n}\n\nconst pickRenderState = {\n  stencilTest: {\n    enabled: true,\n    frontFunction: StencilFunction.NOT_EQUAL,\n    frontOperation: {\n      fail: StencilOperation.ZERO,\n      zFail: StencilOperation.ZERO,\n      zPass: StencilOperation.ZERO,\n    },\n    backFunction: StencilFunction.NOT_EQUAL,\n    backOperation: {\n      fail: StencilOperation.ZERO,\n      zFail: StencilOperation.ZERO,\n      zPass: StencilOperation.ZERO,\n    },\n    reference: 0,\n    mask: StencilConstants.CLASSIFICATION_MASK,\n  },\n  stencilMask: StencilConstants.CLASSIFICATION_MASK,\n  depthTest: {\n    enabled: false,\n  },\n  depthMask: false,\n};\n\nfunction createRenderStates(\n  classificationPrimitive,\n  context,\n  appearance,\n  twoPasses\n) {\n  if (defined(classificationPrimitive._rsStencilDepthPass)) {\n    return;\n  }\n  const stencilEnabled = !classificationPrimitive.debugShowShadowVolume;\n\n  classificationPrimitive._rsStencilDepthPass = RenderState.fromCache(\n    getStencilDepthRenderState(stencilEnabled, false)\n  );\n  classificationPrimitive._rsStencilDepthPass3DTiles = RenderState.fromCache(\n    getStencilDepthRenderState(stencilEnabled, true)\n  );\n  classificationPrimitive._rsColorPass = RenderState.fromCache(\n    getColorRenderState(stencilEnabled, false)\n  );\n  classificationPrimitive._rsPickPass = RenderState.fromCache(pickRenderState);\n}\n\nfunction modifyForEncodedNormals(primitive, vertexShaderSource) {\n  if (!primitive.compressVertices) {\n    return vertexShaderSource;\n  }\n\n  if (vertexShaderSource.search(/in\\s+vec3\\s+extrudeDirection;/g) !== -1) {\n    const attributeName = \"compressedAttributes\";\n\n    //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes\n    const attributeDecl = `in vec2 ${attributeName};`;\n\n    const globalDecl = \"vec3 extrudeDirection;\\n\";\n    const decode = `    extrudeDirection = czm_octDecode(${attributeName}, 65535.0);\\n`;\n\n    let modifiedVS = vertexShaderSource;\n    modifiedVS = modifiedVS.replace(/in\\s+vec3\\s+extrudeDirection;/g, \"\");\n    modifiedVS = ShaderSource.replaceMain(\n      modifiedVS,\n      \"czm_non_compressed_main\"\n    );\n    const compressedMain =\n      `${\"void main() \\n\" + \"{ \\n\"}${decode}    czm_non_compressed_main(); \\n` +\n      `}`;\n\n    return [attributeDecl, globalDecl, modifiedVS, compressedMain].join(\"\\n\");\n  }\n}\n\nfunction createShaderProgram(classificationPrimitive, frameState) {\n  const context = frameState.context;\n  const primitive = classificationPrimitive._primitive;\n  let vs = ShadowVolumeAppearanceVS;\n  vs = classificationPrimitive._primitive._batchTable.getVertexShaderCallback()(\n    vs\n  );\n  vs = Primitive._appendDistanceDisplayConditionToShader(primitive, vs);\n  vs = Primitive._modifyShaderPosition(\n    classificationPrimitive,\n    vs,\n    frameState.scene3DOnly\n  );\n  vs = Primitive._updateColorAttribute(primitive, vs);\n\n  const planarExtents = classificationPrimitive._hasPlanarExtentsAttributes;\n  const cullFragmentsUsingExtents =\n    planarExtents || classificationPrimitive._hasSphericalExtentsAttribute;\n\n  if (classificationPrimitive._extruded) {\n    vs = modifyForEncodedNormals(primitive, vs);\n  }\n\n  const extrudedDefine = classificationPrimitive._extruded\n    ? \"EXTRUDED_GEOMETRY\"\n    : \"\";\n\n  let vsSource = new ShaderSource({\n    defines: [extrudedDefine],\n    sources: [vs],\n  });\n  const fsSource = new ShaderSource({\n    sources: [ShadowVolumeFS],\n  });\n  const attributeLocations =\n    classificationPrimitive._primitive._attributeLocations;\n\n  const shadowVolumeAppearance = new ShadowVolumeAppearance(\n    cullFragmentsUsingExtents,\n    planarExtents,\n    classificationPrimitive.appearance\n  );\n\n  classificationPrimitive._spStencil = ShaderProgram.replaceCache({\n    context: context,\n    shaderProgram: classificationPrimitive._spStencil,\n    vertexShaderSource: vsSource,\n    fragmentShaderSource: fsSource,\n    attributeLocations: attributeLocations,\n  });\n\n  if (classificationPrimitive._primitive.allowPicking) {\n    let vsPick = ShaderSource.createPickVertexShaderSource(vs);\n    vsPick = Primitive._appendShowToShader(primitive, vsPick);\n    vsPick = Primitive._updatePickColorAttribute(vsPick);\n\n    const pickFS3D = shadowVolumeAppearance.createPickFragmentShader(false);\n    const pickVS3D = shadowVolumeAppearance.createPickVertexShader(\n      [extrudedDefine],\n      vsPick,\n      false,\n      frameState.mapProjection\n    );\n\n    classificationPrimitive._spPick = ShaderProgram.replaceCache({\n      context: context,\n      shaderProgram: classificationPrimitive._spPick,\n      vertexShaderSource: pickVS3D,\n      fragmentShaderSource: pickFS3D,\n      attributeLocations: attributeLocations,\n    });\n\n    // Derive a 2D pick shader if the primitive uses texture coordinate-based fragment culling,\n    // since texture coordinates are computed differently in 2D.\n    if (cullFragmentsUsingExtents) {\n      let pickProgram2D = context.shaderCache.getDerivedShaderProgram(\n        classificationPrimitive._spPick,\n        \"2dPick\"\n      );\n      if (!defined(pickProgram2D)) {\n        const pickFS2D = shadowVolumeAppearance.createPickFragmentShader(true);\n        const pickVS2D = shadowVolumeAppearance.createPickVertexShader(\n          [extrudedDefine],\n          vsPick,\n          true,\n          frameState.mapProjection\n        );\n\n        pickProgram2D = context.shaderCache.createDerivedShaderProgram(\n          classificationPrimitive._spPick,\n          \"2dPick\",\n          {\n            vertexShaderSource: pickVS2D,\n            fragmentShaderSource: pickFS2D,\n            attributeLocations: attributeLocations,\n          }\n        );\n      }\n      classificationPrimitive._spPick2D = pickProgram2D;\n    }\n  } else {\n    classificationPrimitive._spPick = ShaderProgram.fromCache({\n      context: context,\n      vertexShaderSource: vsSource,\n      fragmentShaderSource: fsSource,\n      attributeLocations: attributeLocations,\n    });\n  }\n\n  vs = Primitive._appendShowToShader(primitive, vs);\n  vsSource = new ShaderSource({\n    defines: [extrudedDefine],\n    sources: [vs],\n  });\n\n  classificationPrimitive._sp = ShaderProgram.replaceCache({\n    context: context,\n    shaderProgram: classificationPrimitive._sp,\n    vertexShaderSource: vsSource,\n    fragmentShaderSource: fsSource,\n    attributeLocations: attributeLocations,\n  });\n\n  // Create a fragment shader that computes only required material hookups using screen space techniques\n  const fsColorSource = shadowVolumeAppearance.createFragmentShader(false);\n  const vsColorSource = shadowVolumeAppearance.createVertexShader(\n    [extrudedDefine],\n    vs,\n    false,\n    frameState.mapProjection\n  );\n\n  classificationPrimitive._spColor = ShaderProgram.replaceCache({\n    context: context,\n    shaderProgram: classificationPrimitive._spColor,\n    vertexShaderSource: vsColorSource,\n    fragmentShaderSource: fsColorSource,\n    attributeLocations: attributeLocations,\n  });\n\n  // Derive a 2D shader if the primitive uses texture coordinate-based fragment culling,\n  // since texture coordinates are computed differently in 2D.\n  // Any material that uses texture coordinates will also equip texture coordinate-based fragment culling.\n  if (cullFragmentsUsingExtents) {\n    let colorProgram2D = context.shaderCache.getDerivedShaderProgram(\n      classificationPrimitive._spColor,\n      \"2dColor\"\n    );\n    if (!defined(colorProgram2D)) {\n      const fsColorSource2D = shadowVolumeAppearance.createFragmentShader(true);\n      const vsColorSource2D = shadowVolumeAppearance.createVertexShader(\n        [extrudedDefine],\n        vs,\n        true,\n        frameState.mapProjection\n      );\n\n      colorProgram2D = context.shaderCache.createDerivedShaderProgram(\n        classificationPrimitive._spColor,\n        \"2dColor\",\n        {\n          vertexShaderSource: vsColorSource2D,\n          fragmentShaderSource: fsColorSource2D,\n          attributeLocations: attributeLocations,\n        }\n      );\n    }\n    classificationPrimitive._spColor2D = colorProgram2D;\n  }\n}\n\nfunction createColorCommands(classificationPrimitive, colorCommands) {\n  const primitive = classificationPrimitive._primitive;\n  let length = primitive._va.length * 2; // each geometry (pack of vertex attributes) needs 2 commands: front/back stencils and fill\n  colorCommands.length = length;\n\n  let i;\n  let command;\n  let derivedCommand;\n  let vaIndex = 0;\n  let uniformMap = primitive._batchTable.getUniformMapCallback()(\n    classificationPrimitive._uniformMap\n  );\n\n  const needs2DShader = classificationPrimitive._needs2DShader;\n\n  for (i = 0; i < length; i += 2) {\n    const vertexArray = primitive._va[vaIndex++];\n\n    // Stencil depth command\n    command = colorCommands[i];\n    if (!defined(command)) {\n      command = colorCommands[i] = new DrawCommand({\n        owner: classificationPrimitive,\n        primitiveType: primitive._primitiveType,\n      });\n    }\n\n    command.vertexArray = vertexArray;\n    command.renderState = classificationPrimitive._rsStencilDepthPass;\n    command.shaderProgram = classificationPrimitive._sp;\n    command.uniformMap = uniformMap;\n    command.pass = Pass.TERRAIN_CLASSIFICATION;\n\n    derivedCommand = DrawCommand.shallowClone(\n      command,\n      command.derivedCommands.tileset\n    );\n    derivedCommand.renderState =\n      classificationPrimitive._rsStencilDepthPass3DTiles;\n    derivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n    command.derivedCommands.tileset = derivedCommand;\n\n    // Color command\n    command = colorCommands[i + 1];\n    if (!defined(command)) {\n      command = colorCommands[i + 1] = new DrawCommand({\n        owner: classificationPrimitive,\n        primitiveType: primitive._primitiveType,\n      });\n    }\n\n    command.vertexArray = vertexArray;\n    command.renderState = classificationPrimitive._rsColorPass;\n    command.shaderProgram = classificationPrimitive._spColor;\n    command.pass = Pass.TERRAIN_CLASSIFICATION;\n\n    const appearance = classificationPrimitive.appearance;\n    const material = appearance.material;\n    if (defined(material)) {\n      uniformMap = combine(uniformMap, material._uniforms);\n    }\n\n    command.uniformMap = uniformMap;\n\n    derivedCommand = DrawCommand.shallowClone(\n      command,\n      command.derivedCommands.tileset\n    );\n    derivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n    command.derivedCommands.tileset = derivedCommand;\n\n    // Derive for 2D if texture coordinates are ever computed\n    if (needs2DShader) {\n      // First derive from the terrain command\n      let derived2DCommand = DrawCommand.shallowClone(\n        command,\n        command.derivedCommands.appearance2D\n      );\n      derived2DCommand.shaderProgram = classificationPrimitive._spColor2D;\n      command.derivedCommands.appearance2D = derived2DCommand;\n\n      // Then derive from the 3D Tiles command\n      derived2DCommand = DrawCommand.shallowClone(\n        derivedCommand,\n        derivedCommand.derivedCommands.appearance2D\n      );\n      derived2DCommand.shaderProgram = classificationPrimitive._spColor2D;\n      derivedCommand.derivedCommands.appearance2D = derived2DCommand;\n    }\n  }\n\n  const commandsIgnoreShow = classificationPrimitive._commandsIgnoreShow;\n  const spStencil = classificationPrimitive._spStencil;\n\n  let commandIndex = 0;\n  length = commandsIgnoreShow.length = length / 2;\n\n  for (let j = 0; j < length; ++j) {\n    const commandIgnoreShow = (commandsIgnoreShow[j] = DrawCommand.shallowClone(\n      colorCommands[commandIndex],\n      commandsIgnoreShow[j]\n    ));\n    commandIgnoreShow.shaderProgram = spStencil;\n    commandIgnoreShow.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW;\n\n    commandIndex += 2;\n  }\n}\n\nfunction createPickCommands(classificationPrimitive, pickCommands) {\n  const usePickOffsets = classificationPrimitive._usePickOffsets;\n\n  const primitive = classificationPrimitive._primitive;\n  let length = primitive._va.length * 2; // each geometry (pack of vertex attributes) needs 2 commands: front/back stencils and fill\n\n  // Fallback for batching same-color geometry instances\n  let pickOffsets;\n  let pickIndex = 0;\n  let pickOffset;\n  if (usePickOffsets) {\n    pickOffsets = primitive._pickOffsets;\n    length = pickOffsets.length * 2;\n  }\n\n  pickCommands.length = length;\n\n  let j;\n  let command;\n  let derivedCommand;\n  let vaIndex = 0;\n  const uniformMap = primitive._batchTable.getUniformMapCallback()(\n    classificationPrimitive._uniformMap\n  );\n\n  const needs2DShader = classificationPrimitive._needs2DShader;\n\n  for (j = 0; j < length; j += 2) {\n    let vertexArray = primitive._va[vaIndex++];\n    if (usePickOffsets) {\n      pickOffset = pickOffsets[pickIndex++];\n      vertexArray = primitive._va[pickOffset.index];\n    }\n\n    // Stencil depth command\n    command = pickCommands[j];\n    if (!defined(command)) {\n      command = pickCommands[j] = new DrawCommand({\n        owner: classificationPrimitive,\n        primitiveType: primitive._primitiveType,\n        pickOnly: true,\n      });\n    }\n\n    command.vertexArray = vertexArray;\n    command.renderState = classificationPrimitive._rsStencilDepthPass;\n    command.shaderProgram = classificationPrimitive._sp;\n    command.uniformMap = uniformMap;\n    command.pass = Pass.TERRAIN_CLASSIFICATION;\n    if (usePickOffsets) {\n      command.offset = pickOffset.offset;\n      command.count = pickOffset.count;\n    }\n\n    // Derive for 3D Tiles classification\n    derivedCommand = DrawCommand.shallowClone(\n      command,\n      command.derivedCommands.tileset\n    );\n    derivedCommand.renderState =\n      classificationPrimitive._rsStencilDepthPass3DTiles;\n    derivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n    command.derivedCommands.tileset = derivedCommand;\n\n    // Pick color command\n    command = pickCommands[j + 1];\n    if (!defined(command)) {\n      command = pickCommands[j + 1] = new DrawCommand({\n        owner: classificationPrimitive,\n        primitiveType: primitive._primitiveType,\n        pickOnly: true,\n      });\n    }\n\n    command.vertexArray = vertexArray;\n    command.renderState = classificationPrimitive._rsPickPass;\n    command.shaderProgram = classificationPrimitive._spPick;\n    command.uniformMap = uniformMap;\n    command.pass = Pass.TERRAIN_CLASSIFICATION;\n    if (usePickOffsets) {\n      command.offset = pickOffset.offset;\n      command.count = pickOffset.count;\n    }\n\n    derivedCommand = DrawCommand.shallowClone(\n      command,\n      command.derivedCommands.tileset\n    );\n    derivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n    command.derivedCommands.tileset = derivedCommand;\n\n    // Derive for 2D if texture coordinates are ever computed\n    if (needs2DShader) {\n      // First derive from the terrain command\n      let derived2DCommand = DrawCommand.shallowClone(\n        command,\n        command.derivedCommands.pick2D\n      );\n      derived2DCommand.shaderProgram = classificationPrimitive._spPick2D;\n      command.derivedCommands.pick2D = derived2DCommand;\n\n      // Then derive from the 3D Tiles command\n      derived2DCommand = DrawCommand.shallowClone(\n        derivedCommand,\n        derivedCommand.derivedCommands.pick2D\n      );\n      derived2DCommand.shaderProgram = classificationPrimitive._spPick2D;\n      derivedCommand.derivedCommands.pick2D = derived2DCommand;\n    }\n  }\n}\n\nfunction createCommands(\n  classificationPrimitive,\n  appearance,\n  material,\n  translucent,\n  twoPasses,\n  colorCommands,\n  pickCommands\n) {\n  createColorCommands(classificationPrimitive, colorCommands);\n  createPickCommands(classificationPrimitive, pickCommands);\n}\n\nfunction boundingVolumeIndex(commandIndex, length) {\n  return Math.floor((commandIndex % length) / 2);\n}\n\nfunction updateAndQueueRenderCommand(\n  command,\n  frameState,\n  modelMatrix,\n  cull,\n  boundingVolume,\n  debugShowBoundingVolume\n) {\n  command.modelMatrix = modelMatrix;\n  command.boundingVolume = boundingVolume;\n  command.cull = cull;\n  command.debugShowBoundingVolume = debugShowBoundingVolume;\n\n  frameState.commandList.push(command);\n}\n\nfunction updateAndQueuePickCommand(\n  command,\n  frameState,\n  modelMatrix,\n  cull,\n  boundingVolume\n) {\n  command.modelMatrix = modelMatrix;\n  command.boundingVolume = boundingVolume;\n  command.cull = cull;\n\n  frameState.commandList.push(command);\n}\n\nfunction updateAndQueueCommands(\n  classificationPrimitive,\n  frameState,\n  colorCommands,\n  pickCommands,\n  modelMatrix,\n  cull,\n  debugShowBoundingVolume,\n  twoPasses\n) {\n  const primitive = classificationPrimitive._primitive;\n  Primitive._updateBoundingVolumes(primitive, frameState, modelMatrix);\n\n  let boundingVolumes;\n  if (frameState.mode === SceneMode.SCENE3D) {\n    boundingVolumes = primitive._boundingSphereWC;\n  } else if (frameState.mode === SceneMode.COLUMBUS_VIEW) {\n    boundingVolumes = primitive._boundingSphereCV;\n  } else if (\n    frameState.mode === SceneMode.SCENE2D &&\n    defined(primitive._boundingSphere2D)\n  ) {\n    boundingVolumes = primitive._boundingSphere2D;\n  } else if (defined(primitive._boundingSphereMorph)) {\n    boundingVolumes = primitive._boundingSphereMorph;\n  }\n\n  const classificationType = classificationPrimitive.classificationType;\n  const queueTerrainCommands =\n    classificationType !== ClassificationType.CESIUM_3D_TILE;\n  const queue3DTilesCommands =\n    classificationType !== ClassificationType.TERRAIN;\n\n  const passes = frameState.passes;\n\n  let i;\n  let boundingVolume;\n  let command;\n\n  if (passes.render) {\n    const colorLength = colorCommands.length;\n    for (i = 0; i < colorLength; ++i) {\n      boundingVolume = boundingVolumes[boundingVolumeIndex(i, colorLength)];\n      if (queueTerrainCommands) {\n        command = colorCommands[i];\n        updateAndQueueRenderCommand(\n          command,\n          frameState,\n          modelMatrix,\n          cull,\n          boundingVolume,\n          debugShowBoundingVolume\n        );\n      }\n      if (queue3DTilesCommands) {\n        command = colorCommands[i].derivedCommands.tileset;\n        updateAndQueueRenderCommand(\n          command,\n          frameState,\n          modelMatrix,\n          cull,\n          boundingVolume,\n          debugShowBoundingVolume\n        );\n      }\n    }\n\n    if (frameState.invertClassification) {\n      const ignoreShowCommands = classificationPrimitive._commandsIgnoreShow;\n      const ignoreShowCommandsLength = ignoreShowCommands.length;\n      for (i = 0; i < ignoreShowCommandsLength; ++i) {\n        boundingVolume = boundingVolumes[i];\n        command = ignoreShowCommands[i];\n        updateAndQueueRenderCommand(\n          command,\n          frameState,\n          modelMatrix,\n          cull,\n          boundingVolume,\n          debugShowBoundingVolume\n        );\n      }\n    }\n  }\n\n  if (passes.pick) {\n    const pickLength = pickCommands.length;\n    const pickOffsets = primitive._pickOffsets;\n    for (i = 0; i < pickLength; ++i) {\n      const pickOffset = pickOffsets[boundingVolumeIndex(i, pickLength)];\n      boundingVolume = boundingVolumes[pickOffset.index];\n      if (queueTerrainCommands) {\n        command = pickCommands[i];\n        updateAndQueuePickCommand(\n          command,\n          frameState,\n          modelMatrix,\n          cull,\n          boundingVolume\n        );\n      }\n      if (queue3DTilesCommands) {\n        command = pickCommands[i].derivedCommands.tileset;\n        updateAndQueuePickCommand(\n          command,\n          frameState,\n          modelMatrix,\n          cull,\n          boundingVolume\n        );\n      }\n    }\n  }\n}\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly.  This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {DeveloperError} All instance geometries must have the same primitiveType.\n * @exception {DeveloperError} Appearance and material have a uniform with the same name.\n * @exception {DeveloperError} Not all of the geometry instances have the same color attribute.\n */\nClassificationPrimitive.prototype.update = function (frameState) {\n  if (!defined(this._primitive) && !defined(this.geometryInstances)) {\n    return;\n  }\n\n  let appearance = this.appearance;\n  if (defined(appearance) && defined(appearance.material)) {\n    appearance.material.update(frameState.context);\n  }\n\n  const that = this;\n  const primitiveOptions = this._primitiveOptions;\n\n  if (!defined(this._primitive)) {\n    const instances = Array.isArray(this.geometryInstances)\n      ? this.geometryInstances\n      : [this.geometryInstances];\n    const length = instances.length;\n\n    let i;\n    let instance;\n    let attributes;\n\n    let hasPerColorAttribute = false;\n    let allColorsSame = true;\n    let firstColor;\n    let hasSphericalExtentsAttribute = false;\n    let hasPlanarExtentsAttributes = false;\n\n    if (length > 0) {\n      attributes = instances[0].attributes;\n      // Not expecting these to be set by users, should only be set via GroundPrimitive.\n      // So don't check for mismatch.\n      hasSphericalExtentsAttribute = ShadowVolumeAppearance.hasAttributesForSphericalExtents(\n        attributes\n      );\n      hasPlanarExtentsAttributes = ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes(\n        attributes\n      );\n      firstColor = attributes.color;\n    }\n\n    for (i = 0; i < length; i++) {\n      instance = instances[i];\n      const color = instance.attributes.color;\n      if (defined(color)) {\n        hasPerColorAttribute = true;\n      }\n      //>>includeStart('debug', pragmas.debug);\n      else if (hasPerColorAttribute) {\n        throw new DeveloperError(\n          \"All GeometryInstances must have color attributes to use per-instance color.\"\n        );\n      }\n      //>>includeEnd('debug');\n\n      allColorsSame =\n        allColorsSame &&\n        defined(color) &&\n        ColorGeometryInstanceAttribute.equals(firstColor, color);\n    }\n\n    // If no attributes exist for computing spherical extents or fragment culling,\n    // throw if the colors aren't all the same.\n    if (\n      !allColorsSame &&\n      !hasSphericalExtentsAttribute &&\n      !hasPlanarExtentsAttributes\n    ) {\n      throw new DeveloperError(\n        \"All GeometryInstances must have the same color attribute except via GroundPrimitives\"\n      );\n    }\n\n    // default to a color appearance\n    if (hasPerColorAttribute && !defined(appearance)) {\n      appearance = new PerInstanceColorAppearance({\n        flat: true,\n      });\n      this.appearance = appearance;\n    }\n\n    //>>includeStart('debug', pragmas.debug);\n    if (\n      !hasPerColorAttribute &&\n      appearance instanceof PerInstanceColorAppearance\n    ) {\n      throw new DeveloperError(\n        \"PerInstanceColorAppearance requires color GeometryInstanceAttributes on all GeometryInstances\"\n      );\n    }\n    if (\n      defined(appearance.material) &&\n      !hasSphericalExtentsAttribute &&\n      !hasPlanarExtentsAttributes\n    ) {\n      throw new DeveloperError(\n        \"Materials on ClassificationPrimitives are not supported except via GroundPrimitives\"\n      );\n    }\n    //>>includeEnd('debug');\n\n    this._usePickOffsets =\n      !hasSphericalExtentsAttribute && !hasPlanarExtentsAttributes;\n    this._hasSphericalExtentsAttribute = hasSphericalExtentsAttribute;\n    this._hasPlanarExtentsAttributes = hasPlanarExtentsAttributes;\n    this._hasPerColorAttribute = hasPerColorAttribute;\n\n    const geometryInstances = new Array(length);\n    for (i = 0; i < length; ++i) {\n      instance = instances[i];\n      geometryInstances[i] = new GeometryInstance({\n        geometry: instance.geometry,\n        attributes: instance.attributes,\n        modelMatrix: instance.modelMatrix,\n        id: instance.id,\n        pickPrimitive: defaultValue(this._pickPrimitive, that),\n      });\n    }\n\n    primitiveOptions.appearance = appearance;\n    primitiveOptions.geometryInstances = geometryInstances;\n\n    if (defined(this._createBoundingVolumeFunction)) {\n      primitiveOptions._createBoundingVolumeFunction = function (\n        frameState,\n        geometry\n      ) {\n        that._createBoundingVolumeFunction(frameState, geometry);\n      };\n    }\n\n    primitiveOptions._createRenderStatesFunction = function (\n      primitive,\n      context,\n      appearance,\n      twoPasses\n    ) {\n      createRenderStates(that, context);\n    };\n    primitiveOptions._createShaderProgramFunction = function (\n      primitive,\n      frameState,\n      appearance\n    ) {\n      createShaderProgram(that, frameState);\n    };\n    primitiveOptions._createCommandsFunction = function (\n      primitive,\n      appearance,\n      material,\n      translucent,\n      twoPasses,\n      colorCommands,\n      pickCommands\n    ) {\n      createCommands(\n        that,\n        undefined,\n        undefined,\n        true,\n        false,\n        colorCommands,\n        pickCommands\n      );\n    };\n\n    if (defined(this._updateAndQueueCommandsFunction)) {\n      primitiveOptions._updateAndQueueCommandsFunction = function (\n        primitive,\n        frameState,\n        colorCommands,\n        pickCommands,\n        modelMatrix,\n        cull,\n        debugShowBoundingVolume,\n        twoPasses\n      ) {\n        that._updateAndQueueCommandsFunction(\n          primitive,\n          frameState,\n          colorCommands,\n          pickCommands,\n          modelMatrix,\n          cull,\n          debugShowBoundingVolume,\n          twoPasses\n        );\n      };\n    } else {\n      primitiveOptions._updateAndQueueCommandsFunction = function (\n        primitive,\n        frameState,\n        colorCommands,\n        pickCommands,\n        modelMatrix,\n        cull,\n        debugShowBoundingVolume,\n        twoPasses\n      ) {\n        updateAndQueueCommands(\n          that,\n          frameState,\n          colorCommands,\n          pickCommands,\n          modelMatrix,\n          cull,\n          debugShowBoundingVolume,\n          twoPasses\n        );\n      };\n    }\n\n    this._primitive = new Primitive(primitiveOptions);\n  }\n\n  if (\n    this.debugShowShadowVolume &&\n    !this._debugShowShadowVolume &&\n    this._ready\n  ) {\n    this._debugShowShadowVolume = true;\n    this._rsStencilDepthPass = RenderState.fromCache(\n      getStencilDepthRenderState(false, false)\n    );\n    this._rsStencilDepthPass3DTiles = RenderState.fromCache(\n      getStencilDepthRenderState(false, true)\n    );\n    this._rsColorPass = RenderState.fromCache(getColorRenderState(false));\n  } else if (!this.debugShowShadowVolume && this._debugShowShadowVolume) {\n    this._debugShowShadowVolume = false;\n    this._rsStencilDepthPass = RenderState.fromCache(\n      getStencilDepthRenderState(true, false)\n    );\n    this._rsStencilDepthPass3DTiles = RenderState.fromCache(\n      getStencilDepthRenderState(true, true)\n    );\n    this._rsColorPass = RenderState.fromCache(getColorRenderState(true));\n  }\n  // Update primitive appearance\n  if (this._primitive.appearance !== appearance) {\n    //>>includeStart('debug', pragmas.debug);\n    // Check if the appearance is supported by the geometry attributes\n    if (\n      !this._hasSphericalExtentsAttribute &&\n      !this._hasPlanarExtentsAttributes &&\n      defined(appearance.material)\n    ) {\n      throw new DeveloperError(\n        \"Materials on ClassificationPrimitives are not supported except via GroundPrimitive\"\n      );\n    }\n    if (\n      !this._hasPerColorAttribute &&\n      appearance instanceof PerInstanceColorAppearance\n    ) {\n      throw new DeveloperError(\n        \"PerInstanceColorAppearance requires color GeometryInstanceAttribute\"\n      );\n    }\n    //>>includeEnd('debug');\n    this._primitive.appearance = appearance;\n  }\n\n  this._primitive.show = this.show;\n  this._primitive.debugShowBoundingVolume = this.debugShowBoundingVolume;\n  this._primitive.update(frameState);\n\n  frameState.afterRender.push(() => {\n    if (defined(this._primitive) && this._primitive.ready) {\n      this._ready = true;\n\n      if (this.releaseGeometryInstances) {\n        this.geometryInstances = undefined;\n      }\n    }\n  });\n};\n\n/**\n * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.\n *\n * @param {*} id The id of the {@link GeometryInstance}.\n * @returns {object} The typed array in the attribute's format or undefined if the is no instance with id.\n *\n * @exception {DeveloperError} must call update before calling getGeometryInstanceAttributes.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);\n * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);\n */\nClassificationPrimitive.prototype.getGeometryInstanceAttributes = function (\n  id\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(this._primitive)) {\n    throw new DeveloperError(\n      \"must call update before calling getGeometryInstanceAttributes\"\n    );\n  }\n  //>>includeEnd('debug');\n  return this._primitive.getGeometryInstanceAttributes(id);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see ClassificationPrimitive#destroy\n */\nClassificationPrimitive.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * e = e && e.destroy();\n *\n * @see ClassificationPrimitive#isDestroyed\n */\nClassificationPrimitive.prototype.destroy = function () {\n  this._primitive = this._primitive && this._primitive.destroy();\n  this._sp = this._sp && this._sp.destroy();\n  this._spPick = this._spPick && this._spPick.destroy();\n  this._spColor = this._spColor && this._spColor.destroy();\n\n  // Derived programs, destroyed above if they existed.\n  this._spPick2D = undefined;\n  this._spColor2D = undefined;\n  return destroyObject(this);\n};\nexport default ClassificationPrimitive;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport VerticalExaggeration from \"../Core/VerticalExaggeration.js\";\nimport ClassificationPrimitive from \"./ClassificationPrimitive.js\";\nimport ClassificationType from \"./ClassificationType.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowVolumeAppearance from \"./ShadowVolumeAppearance.js\";\n\nconst GroundPrimitiveUniformMap = {\n  u_globeMinimumAltitude: function () {\n    return 55000.0;\n  },\n};\n\n/**\n * A ground primitive represents geometry draped over terrain or 3D Tiles in the {@link Scene}.\n * <p>\n * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including\n * {@link Material} and {@link RenderState}.  Roughly, the geometry instance defines the structure and placement,\n * and the appearance defines the visual characteristics.  Decoupling geometry and appearance allows us to mix\n * and match most of them and add a new geometry or appearance independently of each other.\n * </p>\n * <p>\n * Support for the WEBGL_depth_texture extension is required to use GeometryInstances with different PerInstanceColors\n * or materials besides PerInstanceColorAppearance.\n * </p>\n * <p>\n * Textured GroundPrimitives were designed for notional patterns and are not meant for precisely mapping\n * textures to terrain - for that use case, use {@link SingleTileImageryProvider}.\n * </p>\n * <p>\n * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there\n * will be rendering artifacts for some viewing angles.\n * </p>\n * <p>\n * Valid geometries are {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}.\n * </p>\n *\n * @alias GroundPrimitive\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Array|GeometryInstance} [options.geometryInstances] The geometry instances to render.\n * @param {Appearance} [options.appearance] The appearance used to render the primitive. Defaults to a flat PerInstanceColorAppearance when GeometryInstances have a color attribute.\n * @param {boolean} [options.show=true] Determines if this primitive will be shown.\n * @param {boolean} [options.vertexCacheOptimize=false] When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.\n * @param {boolean} [options.interleave=false] When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.\n * @param {boolean} [options.compressVertices=true] When <code>true</code>, the geometry vertices are compressed, which will save memory.\n * @param {boolean} [options.releaseGeometryInstances=true] When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n * @param {boolean} [options.allowPicking=true] When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}.  When <code>false</code>, GPU memory is saved.\n * @param {boolean} [options.asynchronous=true] Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.\n * @param {ClassificationType} [options.classificationType=ClassificationType.BOTH] Determines whether terrain, 3D Tiles or both will be classified.\n * @param {boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {boolean} [options.debugShowShadowVolume=false] For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be <code>true</code> on\n *                  creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.\n *\n * @example\n * // Example 1: Create primitive with a single instance\n * const rectangleInstance = new Cesium.GeometryInstance({\n *   geometry : new Cesium.RectangleGeometry({\n *     rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)\n *   }),\n *   id : 'rectangle',\n *   attributes : {\n *     color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)\n *   }\n * });\n * scene.primitives.add(new Cesium.GroundPrimitive({\n *   geometryInstances : rectangleInstance\n * }));\n *\n * // Example 2: Batch instances\n * const color = new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5); // Both instances must have the same color.\n * const rectangleInstance = new Cesium.GeometryInstance({\n *   geometry : new Cesium.RectangleGeometry({\n *     rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)\n *   }),\n *   id : 'rectangle',\n *   attributes : {\n *     color : color\n *   }\n * });\n * const ellipseInstance = new Cesium.GeometryInstance({\n *     geometry : new Cesium.EllipseGeometry({\n *         center : Cesium.Cartesian3.fromDegrees(-105.0, 40.0),\n *         semiMinorAxis : 300000.0,\n *         semiMajorAxis : 400000.0\n *     }),\n *     id : 'ellipse',\n *     attributes : {\n *         color : color\n *     }\n * });\n * scene.primitives.add(new Cesium.GroundPrimitive({\n *   geometryInstances : [rectangleInstance, ellipseInstance]\n * }));\n *\n * @see Primitive\n * @see ClassificationPrimitive\n * @see GeometryInstance\n * @see Appearance\n */\nfunction GroundPrimitive(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  let appearance = options.appearance;\n  const geometryInstances = options.geometryInstances;\n  if (!defined(appearance) && defined(geometryInstances)) {\n    const geometryInstancesArray = Array.isArray(geometryInstances)\n      ? geometryInstances\n      : [geometryInstances];\n    const geometryInstanceCount = geometryInstancesArray.length;\n    for (let i = 0; i < geometryInstanceCount; i++) {\n      const attributes = geometryInstancesArray[i].attributes;\n      if (defined(attributes) && defined(attributes.color)) {\n        appearance = new PerInstanceColorAppearance({\n          flat: true,\n        });\n        break;\n      }\n    }\n  }\n  /**\n   * The {@link Appearance} used to shade this primitive. Each geometry\n   * instance is shaded with the same appearance.  Some appearances, like\n   * {@link PerInstanceColorAppearance} allow giving each instance unique\n   * properties.\n   *\n   * @type Appearance\n   *\n   * @default undefined\n   */\n  this.appearance = appearance;\n\n  /**\n   * The geometry instances rendered with this primitive.  This may\n   * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>\n   * is <code>true</code> when the primitive is constructed.\n   * <p>\n   * Changing this property after the primitive is rendered has no effect.\n   * </p>\n   *\n   * @readonly\n   * @type {Array|GeometryInstance}\n   *\n   * @default undefined\n   */\n  this.geometryInstances = options.geometryInstances;\n  /**\n   * Determines if the primitive will be shown.  This affects all geometry\n   * instances in the primitive.\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n  /**\n   * Determines whether terrain, 3D Tiles or both will be classified.\n   *\n   * @type {ClassificationType}\n   *\n   * @default ClassificationType.BOTH\n   */\n  this.classificationType = defaultValue(\n    options.classificationType,\n    ClassificationType.BOTH\n  );\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the bounding sphere for each draw command in the primitive.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowBoundingVolume = defaultValue(\n    options.debugShowBoundingVolume,\n    false\n  );\n\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the shadow volume for each geometry in the primitive.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowShadowVolume = defaultValue(\n    options.debugShowShadowVolume,\n    false\n  );\n\n  this._boundingVolumes = [];\n  this._boundingVolumes2D = [];\n\n  this._ready = false;\n  this._primitive = undefined;\n\n  this._maxHeight = undefined;\n  this._minHeight = undefined;\n\n  this._maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;\n  this._minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;\n\n  this._boundingSpheresKeys = [];\n  this._boundingSpheres = [];\n\n  this._useFragmentCulling = false;\n  // Used when inserting in an OrderedPrimitiveCollection\n  this._zIndex = undefined;\n\n  const that = this;\n  this._classificationPrimitiveOptions = {\n    geometryInstances: undefined,\n    appearance: undefined,\n    vertexCacheOptimize: defaultValue(options.vertexCacheOptimize, false),\n    interleave: defaultValue(options.interleave, false),\n    releaseGeometryInstances: defaultValue(\n      options.releaseGeometryInstances,\n      true\n    ),\n    allowPicking: defaultValue(options.allowPicking, true),\n    asynchronous: defaultValue(options.asynchronous, true),\n    compressVertices: defaultValue(options.compressVertices, true),\n    _createBoundingVolumeFunction: undefined,\n    _updateAndQueueCommandsFunction: undefined,\n    _pickPrimitive: that,\n    _extruded: true,\n    _uniformMap: GroundPrimitiveUniformMap,\n  };\n}\n\nObject.defineProperties(GroundPrimitive.prototype, {\n  /**\n   * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.\n   *\n   * @memberof GroundPrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  vertexCacheOptimize: {\n    get: function () {\n      return this._classificationPrimitiveOptions.vertexCacheOptimize;\n    },\n  },\n\n  /**\n   * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.\n   *\n   * @memberof GroundPrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  interleave: {\n    get: function () {\n      return this._classificationPrimitiveOptions.interleave;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n   *\n   * @memberof GroundPrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  releaseGeometryInstances: {\n    get: function () {\n      return this._classificationPrimitiveOptions.releaseGeometryInstances;\n    },\n  },\n\n  /**\n   * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}.  When <code>false</code>, GPU memory is saved.\n   *\n   * @memberof GroundPrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  allowPicking: {\n    get: function () {\n      return this._classificationPrimitiveOptions.allowPicking;\n    },\n  },\n\n  /**\n   * Determines if the geometry instances will be created and batched on a web worker.\n   *\n   * @memberof GroundPrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  asynchronous: {\n    get: function () {\n      return this._classificationPrimitiveOptions.asynchronous;\n    },\n  },\n\n  /**\n   * When <code>true</code>, geometry vertices are compressed, which will save memory.\n   *\n   * @memberof GroundPrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  compressVertices: {\n    get: function () {\n      return this._classificationPrimitiveOptions.compressVertices;\n    },\n  },\n\n  /**\n   * Determines if the primitive is complete and ready to render.  If this property is\n   * true, the primitive will be rendered the next time that {@link GroundPrimitive#update}\n   * is called.\n   *\n   * @memberof GroundPrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n});\n\n/**\n * Determines if GroundPrimitive rendering is supported.\n *\n * @function\n * @param {Scene} scene The scene.\n * @returns {boolean} <code>true</code> if GroundPrimitives are supported; otherwise, returns <code>false</code>\n */\nGroundPrimitive.isSupported = ClassificationPrimitive.isSupported;\n\nfunction getComputeMaximumHeightFunction(primitive) {\n  return function (granularity, ellipsoid) {\n    const r = ellipsoid.maximumRadius;\n    const delta = r / Math.cos(granularity * 0.5) - r;\n    return primitive._maxHeight + delta;\n  };\n}\n\nfunction getComputeMinimumHeightFunction(primitive) {\n  return function (granularity, ellipsoid) {\n    return primitive._minHeight;\n  };\n}\n\nconst scratchBVCartesianHigh = new Cartesian3();\nconst scratchBVCartesianLow = new Cartesian3();\nconst scratchBVCartesian = new Cartesian3();\nconst scratchBVCartographic = new Cartographic();\nconst scratchBVRectangle = new Rectangle();\n\nfunction getRectangle(frameState, geometry) {\n  const ellipsoid = frameState.mapProjection.ellipsoid;\n\n  if (\n    !defined(geometry.attributes) ||\n    !defined(geometry.attributes.position3DHigh)\n  ) {\n    if (defined(geometry.rectangle)) {\n      return geometry.rectangle;\n    }\n\n    return undefined;\n  }\n\n  const highPositions = geometry.attributes.position3DHigh.values;\n  const lowPositions = geometry.attributes.position3DLow.values;\n  const length = highPositions.length;\n\n  let minLat = Number.POSITIVE_INFINITY;\n  let minLon = Number.POSITIVE_INFINITY;\n  let maxLat = Number.NEGATIVE_INFINITY;\n  let maxLon = Number.NEGATIVE_INFINITY;\n\n  for (let i = 0; i < length; i += 3) {\n    const highPosition = Cartesian3.unpack(\n      highPositions,\n      i,\n      scratchBVCartesianHigh\n    );\n    const lowPosition = Cartesian3.unpack(\n      lowPositions,\n      i,\n      scratchBVCartesianLow\n    );\n\n    const position = Cartesian3.add(\n      highPosition,\n      lowPosition,\n      scratchBVCartesian\n    );\n    const cartographic = ellipsoid.cartesianToCartographic(\n      position,\n      scratchBVCartographic\n    );\n\n    const latitude = cartographic.latitude;\n    const longitude = cartographic.longitude;\n\n    minLat = Math.min(minLat, latitude);\n    minLon = Math.min(minLon, longitude);\n    maxLat = Math.max(maxLat, latitude);\n    maxLon = Math.max(maxLon, longitude);\n  }\n\n  const rectangle = scratchBVRectangle;\n  rectangle.north = maxLat;\n  rectangle.south = minLat;\n  rectangle.east = maxLon;\n  rectangle.west = minLon;\n\n  return rectangle;\n}\n\nfunction setMinMaxTerrainHeights(primitive, rectangle, ellipsoid) {\n  const result = ApproximateTerrainHeights.getMinimumMaximumHeights(\n    rectangle,\n    ellipsoid\n  );\n\n  primitive._minTerrainHeight = result.minimumTerrainHeight;\n  primitive._maxTerrainHeight = result.maximumTerrainHeight;\n}\n\nfunction createBoundingVolume(groundPrimitive, frameState, geometry) {\n  const ellipsoid = frameState.mapProjection.ellipsoid;\n  const rectangle = getRectangle(frameState, geometry);\n\n  const obb = OrientedBoundingBox.fromRectangle(\n    rectangle,\n    groundPrimitive._minHeight,\n    groundPrimitive._maxHeight,\n    ellipsoid\n  );\n  groundPrimitive._boundingVolumes.push(obb);\n\n  if (!frameState.scene3DOnly) {\n    const projection = frameState.mapProjection;\n    const boundingVolume = BoundingSphere.fromRectangleWithHeights2D(\n      rectangle,\n      projection,\n      groundPrimitive._maxHeight,\n      groundPrimitive._minHeight\n    );\n    Cartesian3.fromElements(\n      boundingVolume.center.z,\n      boundingVolume.center.x,\n      boundingVolume.center.y,\n      boundingVolume.center\n    );\n\n    groundPrimitive._boundingVolumes2D.push(boundingVolume);\n  }\n}\n\nfunction boundingVolumeIndex(commandIndex, length) {\n  return Math.floor((commandIndex % length) / 2);\n}\n\nfunction updateAndQueueRenderCommand(\n  groundPrimitive,\n  command,\n  frameState,\n  modelMatrix,\n  cull,\n  boundingVolume,\n  debugShowBoundingVolume\n) {\n  // Use derived appearance command for 2D if needed\n  const classificationPrimitive = groundPrimitive._primitive;\n  if (\n    frameState.mode !== SceneMode.SCENE3D &&\n    command.shaderProgram === classificationPrimitive._spColor &&\n    classificationPrimitive._needs2DShader\n  ) {\n    command = command.derivedCommands.appearance2D;\n  }\n\n  command.owner = groundPrimitive;\n  command.modelMatrix = modelMatrix;\n  command.boundingVolume = boundingVolume;\n  command.cull = cull;\n  command.debugShowBoundingVolume = debugShowBoundingVolume;\n\n  frameState.commandList.push(command);\n}\n\nfunction updateAndQueuePickCommand(\n  groundPrimitive,\n  command,\n  frameState,\n  modelMatrix,\n  cull,\n  boundingVolume\n) {\n  // Use derived pick command for 2D if needed\n  const classificationPrimitive = groundPrimitive._primitive;\n  if (\n    frameState.mode !== SceneMode.SCENE3D &&\n    command.shaderProgram === classificationPrimitive._spPick &&\n    classificationPrimitive._needs2DShader\n  ) {\n    command = command.derivedCommands.pick2D;\n  }\n\n  command.owner = groundPrimitive;\n  command.modelMatrix = modelMatrix;\n  command.boundingVolume = boundingVolume;\n  command.cull = cull;\n\n  frameState.commandList.push(command);\n}\n\nfunction updateAndQueueCommands(\n  groundPrimitive,\n  frameState,\n  colorCommands,\n  pickCommands,\n  modelMatrix,\n  cull,\n  debugShowBoundingVolume,\n  twoPasses\n) {\n  let boundingVolumes;\n  if (frameState.mode === SceneMode.SCENE3D) {\n    boundingVolumes = groundPrimitive._boundingVolumes;\n  } else {\n    boundingVolumes = groundPrimitive._boundingVolumes2D;\n  }\n\n  const classificationType = groundPrimitive.classificationType;\n  const queueTerrainCommands =\n    classificationType !== ClassificationType.CESIUM_3D_TILE;\n  const queue3DTilesCommands =\n    classificationType !== ClassificationType.TERRAIN;\n\n  const passes = frameState.passes;\n  const classificationPrimitive = groundPrimitive._primitive;\n\n  let i;\n  let boundingVolume;\n  let command;\n\n  if (passes.render) {\n    const colorLength = colorCommands.length;\n\n    for (i = 0; i < colorLength; ++i) {\n      boundingVolume = boundingVolumes[boundingVolumeIndex(i, colorLength)];\n      if (queueTerrainCommands) {\n        command = colorCommands[i];\n        updateAndQueueRenderCommand(\n          groundPrimitive,\n          command,\n          frameState,\n          modelMatrix,\n          cull,\n          boundingVolume,\n          debugShowBoundingVolume\n        );\n      }\n      if (queue3DTilesCommands) {\n        command = colorCommands[i].derivedCommands.tileset;\n        updateAndQueueRenderCommand(\n          groundPrimitive,\n          command,\n          frameState,\n          modelMatrix,\n          cull,\n          boundingVolume,\n          debugShowBoundingVolume\n        );\n      }\n    }\n\n    if (frameState.invertClassification) {\n      const ignoreShowCommands = classificationPrimitive._commandsIgnoreShow;\n      const ignoreShowCommandsLength = ignoreShowCommands.length;\n      for (i = 0; i < ignoreShowCommandsLength; ++i) {\n        boundingVolume = boundingVolumes[i];\n        command = ignoreShowCommands[i];\n        updateAndQueueRenderCommand(\n          groundPrimitive,\n          command,\n          frameState,\n          modelMatrix,\n          cull,\n          boundingVolume,\n          debugShowBoundingVolume\n        );\n      }\n    }\n  }\n\n  if (passes.pick) {\n    const pickLength = pickCommands.length;\n\n    let pickOffsets;\n    if (!groundPrimitive._useFragmentCulling) {\n      // Must be using pick offsets\n      pickOffsets = classificationPrimitive._primitive._pickOffsets;\n    }\n    for (i = 0; i < pickLength; ++i) {\n      boundingVolume = boundingVolumes[boundingVolumeIndex(i, pickLength)];\n      if (!groundPrimitive._useFragmentCulling) {\n        const pickOffset = pickOffsets[boundingVolumeIndex(i, pickLength)];\n        boundingVolume = boundingVolumes[pickOffset.index];\n      }\n      if (queueTerrainCommands) {\n        command = pickCommands[i];\n        updateAndQueuePickCommand(\n          groundPrimitive,\n          command,\n          frameState,\n          modelMatrix,\n          cull,\n          boundingVolume\n        );\n      }\n      if (queue3DTilesCommands) {\n        command = pickCommands[i].derivedCommands.tileset;\n        updateAndQueuePickCommand(\n          groundPrimitive,\n          command,\n          frameState,\n          modelMatrix,\n          cull,\n          boundingVolume\n        );\n      }\n    }\n  }\n}\n\n/**\n * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the\n * GroundPrimitive synchronously.\n *\n * @returns {Promise<void>} A promise that will resolve once the terrain heights have been loaded.\n *\n */\nGroundPrimitive.initializeTerrainHeights = function () {\n  return ApproximateTerrainHeights.initialize();\n};\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly.  This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {DeveloperError} For synchronous GroundPrimitive, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve.\n * @exception {DeveloperError} All instance geometries must have the same primitiveType.\n * @exception {DeveloperError} Appearance and material have a uniform with the same name.\n */\nGroundPrimitive.prototype.update = function (frameState) {\n  if (!defined(this._primitive) && !defined(this.geometryInstances)) {\n    return;\n  }\n\n  if (!ApproximateTerrainHeights.initialized) {\n    //>>includeStart('debug', pragmas.debug);\n    if (!this.asynchronous) {\n      throw new DeveloperError(\n        \"For synchronous GroundPrimitives, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve.\"\n      );\n    }\n    //>>includeEnd('debug');\n\n    GroundPrimitive.initializeTerrainHeights();\n    return;\n  }\n\n  const that = this;\n  const primitiveOptions = this._classificationPrimitiveOptions;\n\n  if (!defined(this._primitive)) {\n    const ellipsoid = frameState.mapProjection.ellipsoid;\n\n    let instance;\n    let geometry;\n    let instanceType;\n\n    const instances = Array.isArray(this.geometryInstances)\n      ? this.geometryInstances\n      : [this.geometryInstances];\n    const length = instances.length;\n    const groundInstances = new Array(length);\n\n    let i;\n    let rectangle;\n    for (i = 0; i < length; ++i) {\n      instance = instances[i];\n      geometry = instance.geometry;\n      const instanceRectangle = getRectangle(frameState, geometry);\n      if (!defined(rectangle)) {\n        rectangle = Rectangle.clone(instanceRectangle);\n      } else if (defined(instanceRectangle)) {\n        Rectangle.union(rectangle, instanceRectangle, rectangle);\n      }\n\n      const id = instance.id;\n      if (defined(id) && defined(instanceRectangle)) {\n        const boundingSphere = ApproximateTerrainHeights.getBoundingSphere(\n          instanceRectangle,\n          ellipsoid\n        );\n        this._boundingSpheresKeys.push(id);\n        this._boundingSpheres.push(boundingSphere);\n      }\n\n      instanceType = geometry.constructor;\n      if (!defined(instanceType) || !defined(instanceType.createShadowVolume)) {\n        //>>includeStart('debug', pragmas.debug);\n        throw new DeveloperError(\n          \"Not all of the geometry instances have GroundPrimitive support.\"\n        );\n        //>>includeEnd('debug');\n      }\n    }\n\n    // Now compute the min/max heights for the primitive\n    setMinMaxTerrainHeights(this, rectangle, ellipsoid);\n    const exaggeration = frameState.verticalExaggeration;\n    const exaggerationRelativeHeight =\n      frameState.verticalExaggerationRelativeHeight;\n    this._minHeight = VerticalExaggeration.getHeight(\n      this._minTerrainHeight,\n      exaggeration,\n      exaggerationRelativeHeight\n    );\n    this._maxHeight = VerticalExaggeration.getHeight(\n      this._maxTerrainHeight,\n      exaggeration,\n      exaggerationRelativeHeight\n    );\n\n    const useFragmentCulling = GroundPrimitive._supportsMaterials(\n      frameState.context\n    );\n    this._useFragmentCulling = useFragmentCulling;\n\n    if (useFragmentCulling) {\n      // Determine whether to add spherical or planar extent attributes for computing texture coordinates.\n      // This depends on the size of the GeometryInstances.\n      let attributes;\n      let usePlanarExtents = true;\n      for (i = 0; i < length; ++i) {\n        instance = instances[i];\n        geometry = instance.geometry;\n        rectangle = getRectangle(frameState, geometry);\n        if (ShadowVolumeAppearance.shouldUseSphericalCoordinates(rectangle)) {\n          usePlanarExtents = false;\n          break;\n        }\n      }\n\n      for (i = 0; i < length; ++i) {\n        instance = instances[i];\n        geometry = instance.geometry;\n        instanceType = geometry.constructor;\n\n        const boundingRectangle = getRectangle(frameState, geometry);\n        const textureCoordinateRotationPoints =\n          geometry.textureCoordinateRotationPoints;\n\n        if (usePlanarExtents) {\n          attributes = ShadowVolumeAppearance.getPlanarTextureCoordinateAttributes(\n            boundingRectangle,\n            textureCoordinateRotationPoints,\n            ellipsoid,\n            frameState.mapProjection,\n            this._maxHeight\n          );\n        } else {\n          attributes = ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes(\n            boundingRectangle,\n            textureCoordinateRotationPoints,\n            ellipsoid,\n            frameState.mapProjection\n          );\n        }\n\n        const instanceAttributes = instance.attributes;\n        for (const attributeKey in instanceAttributes) {\n          if (instanceAttributes.hasOwnProperty(attributeKey)) {\n            attributes[attributeKey] = instanceAttributes[attributeKey];\n          }\n        }\n\n        groundInstances[i] = new GeometryInstance({\n          geometry: instanceType.createShadowVolume(\n            geometry,\n            getComputeMinimumHeightFunction(this),\n            getComputeMaximumHeightFunction(this)\n          ),\n          attributes: attributes,\n          id: instance.id,\n        });\n      }\n    } else {\n      // ClassificationPrimitive will check if the colors are all the same if it detects lack of fragment culling attributes\n      for (i = 0; i < length; ++i) {\n        instance = instances[i];\n        geometry = instance.geometry;\n        instanceType = geometry.constructor;\n        groundInstances[i] = new GeometryInstance({\n          geometry: instanceType.createShadowVolume(\n            geometry,\n            getComputeMinimumHeightFunction(this),\n            getComputeMaximumHeightFunction(this)\n          ),\n          attributes: instance.attributes,\n          id: instance.id,\n        });\n      }\n    }\n\n    primitiveOptions.geometryInstances = groundInstances;\n    primitiveOptions.appearance = this.appearance;\n\n    primitiveOptions._createBoundingVolumeFunction = function (\n      frameState,\n      geometry\n    ) {\n      createBoundingVolume(that, frameState, geometry);\n    };\n    primitiveOptions._updateAndQueueCommandsFunction = function (\n      primitive,\n      frameState,\n      colorCommands,\n      pickCommands,\n      modelMatrix,\n      cull,\n      debugShowBoundingVolume,\n      twoPasses\n    ) {\n      updateAndQueueCommands(\n        that,\n        frameState,\n        colorCommands,\n        pickCommands,\n        modelMatrix,\n        cull,\n        debugShowBoundingVolume,\n        twoPasses\n      );\n    };\n\n    this._primitive = new ClassificationPrimitive(primitiveOptions);\n  }\n\n  this._primitive.appearance = this.appearance;\n  this._primitive.show = this.show;\n  this._primitive.debugShowShadowVolume = this.debugShowShadowVolume;\n  this._primitive.debugShowBoundingVolume = this.debugShowBoundingVolume;\n  this._primitive.update(frameState);\n\n  frameState.afterRender.push(() => {\n    if (!this._ready && defined(this._primitive) && this._primitive.ready) {\n      this._ready = true;\n\n      if (this.releaseGeometryInstances) {\n        this.geometryInstances = undefined;\n      }\n    }\n  });\n};\n\n/**\n * @private\n */\nGroundPrimitive.prototype.getBoundingSphere = function (id) {\n  const index = this._boundingSpheresKeys.indexOf(id);\n  if (index !== -1) {\n    return this._boundingSpheres[index];\n  }\n\n  return undefined;\n};\n\n/**\n * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.\n *\n * @param {*} id The id of the {@link GeometryInstance}.\n * @returns {object} The typed array in the attribute's format or undefined if the is no instance with id.\n *\n * @exception {DeveloperError} must call update before calling getGeometryInstanceAttributes.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);\n * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);\n */\nGroundPrimitive.prototype.getGeometryInstanceAttributes = function (id) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(this._primitive)) {\n    throw new DeveloperError(\n      \"must call update before calling getGeometryInstanceAttributes\"\n    );\n  }\n  //>>includeEnd('debug');\n  return this._primitive.getGeometryInstanceAttributes(id);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see GroundPrimitive#destroy\n */\nGroundPrimitive.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * e = e && e.destroy();\n *\n * @see GroundPrimitive#isDestroyed\n */\nGroundPrimitive.prototype.destroy = function () {\n  this._primitive = this._primitive && this._primitive.destroy();\n  return destroyObject(this);\n};\n\n/**\n * Exposed for testing.\n *\n * @param {Context} context Rendering context\n * @returns {boolean} Whether or not the current context supports materials on GroundPrimitives.\n * @private\n */\nGroundPrimitive._supportsMaterials = function (context) {\n  return context.depthTexture;\n};\n\n/**\n * Checks if the given Scene supports materials on GroundPrimitives.\n * Materials on GroundPrimitives require support for the WEBGL_depth_texture extension.\n *\n * @param {Scene} scene The current scene.\n * @returns {boolean} Whether or not the current scene supports materials on GroundPrimitives.\n */\nGroundPrimitive.supportsMaterials = function (scene) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"scene\", scene);\n  //>>includeEnd('debug');\n\n  return GroundPrimitive._supportsMaterials(scene.frameState.context);\n};\nexport default GroundPrimitive;\n", "import Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Material from \"../Scene/Material.js\";\n\n/**\n * The interface for all {@link Property} objects that represent {@link Material} uniforms.\n * This type defines an interface and cannot be instantiated directly.\n *\n * @alias MaterialProperty\n * @constructor\n * @abstract\n *\n * @see ColorMaterialProperty\n * @see CompositeMaterialProperty\n * @see GridMaterialProperty\n * @see ImageMaterialProperty\n * @see PolylineGlowMaterialProperty\n * @see PolylineOutlineMaterialProperty\n * @see StripeMaterialProperty\n */\nfunction MaterialProperty() {\n  DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(MaterialProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof MaterialProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: DeveloperError.throwInstantiationError,\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof MaterialProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: DeveloperError.throwInstantiationError,\n  },\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n * @function\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {string} The type of material.\n */\nMaterialProperty.prototype.getType = DeveloperError.throwInstantiationError;\n\n/**\n * Gets the value of the property at the provided time.\n * @function\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nMaterialProperty.prototype.getValue = DeveloperError.throwInstantiationError;\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n * @function\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nMaterialProperty.prototype.equals = DeveloperError.throwInstantiationError;\n\n/**\n * @private\n */\nMaterialProperty.getValue = function (time, materialProperty, material) {\n  let type;\n\n  if (defined(materialProperty)) {\n    type = materialProperty.getType(time);\n    if (defined(type)) {\n      if (!defined(material) || material.type !== type) {\n        material = Material.fromType(type);\n      }\n      materialProperty.getValue(time, material.uniforms);\n      return material;\n    }\n  }\n\n  if (!defined(material) || material.type !== Material.ColorType) {\n    material = Material.fromType(Material.ColorType);\n  }\n  Color.clone(Color.WHITE, material.uniforms.color);\n\n  return material;\n};\nexport default MaterialProperty;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GroundPrimitive from \"../Scene/GroundPrimitive.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport Primitive from \"../Scene/Primitive.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\n\n/**\n * Defines the interface for a dynamic geometry updater.  A DynamicGeometryUpdater\n * is responsible for handling visualization of a specific type of geometry\n * that needs to be recomputed based on simulation time.\n * This object is never used directly by client code, but is instead created by\n * {@link GeometryUpdater} implementations which contain dynamic geometry.\n *\n * This type defines an interface and cannot be instantiated directly.\n *\n * @alias DynamicGeometryUpdater\n * @constructor\n * @private\n * @abstract\n */\nfunction DynamicGeometryUpdater(\n  geometryUpdater,\n  primitives,\n  orderedGroundPrimitives\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"geometryUpdater\", geometryUpdater);\n  Check.defined(\"primitives\", primitives);\n  Check.defined(\"orderedGroundPrimitives\", orderedGroundPrimitives);\n  //>>includeEnd('debug');\n\n  this._primitives = primitives;\n  this._orderedGroundPrimitives = orderedGroundPrimitives;\n  this._primitive = undefined;\n  this._outlinePrimitive = undefined;\n  this._geometryUpdater = geometryUpdater;\n  this._options = geometryUpdater._options;\n  this._entity = geometryUpdater._entity;\n  this._material = undefined;\n}\n\nDynamicGeometryUpdater.prototype._isHidden = function (entity, geometry, time) {\n  return (\n    !entity.isShowing ||\n    !entity.isAvailable(time) ||\n    !Property.getValueOrDefault(geometry.show, time, true)\n  );\n};\n\nDynamicGeometryUpdater.prototype._setOptions =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Updates the geometry to the specified time.\n * @memberof DynamicGeometryUpdater\n * @function\n *\n * @param {JulianDate} time The current time.\n */\nDynamicGeometryUpdater.prototype.update = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n  //>>includeEnd('debug');\n\n  const geometryUpdater = this._geometryUpdater;\n  const onTerrain = geometryUpdater._onTerrain;\n\n  const primitives = this._primitives;\n  const orderedGroundPrimitives = this._orderedGroundPrimitives;\n  if (onTerrain) {\n    orderedGroundPrimitives.remove(this._primitive);\n  } else {\n    primitives.removeAndDestroy(this._primitive);\n    primitives.removeAndDestroy(this._outlinePrimitive);\n    this._outlinePrimitive = undefined;\n  }\n  this._primitive = undefined;\n\n  const entity = this._entity;\n  const geometry = entity[this._geometryUpdater._geometryPropertyName];\n  this._setOptions(entity, geometry, time);\n  if (this._isHidden(entity, geometry, time)) {\n    return;\n  }\n\n  const shadows = this._geometryUpdater.shadowsProperty.getValue(time);\n  const options = this._options;\n  if (!defined(geometry.fill) || geometry.fill.getValue(time)) {\n    const fillMaterialProperty = geometryUpdater.fillMaterialProperty;\n    const isColorAppearance =\n      fillMaterialProperty instanceof ColorMaterialProperty;\n    let appearance;\n    const closed = geometryUpdater._getIsClosed(options);\n    if (isColorAppearance) {\n      appearance = new PerInstanceColorAppearance({\n        closed: closed,\n        flat:\n          onTerrain && !geometryUpdater._supportsMaterialsforEntitiesOnTerrain,\n      });\n    } else {\n      const material = MaterialProperty.getValue(\n        time,\n        fillMaterialProperty,\n        this._material\n      );\n      this._material = material;\n      appearance = new MaterialAppearance({\n        material: material,\n        translucent: material.isTranslucent(),\n        closed: closed,\n      });\n    }\n\n    if (onTerrain) {\n      options.vertexFormat = PerInstanceColorAppearance.VERTEX_FORMAT;\n      this._primitive = orderedGroundPrimitives.add(\n        new GroundPrimitive({\n          geometryInstances: this._geometryUpdater.createFillGeometryInstance(\n            time\n          ),\n          appearance: appearance,\n          asynchronous: false,\n          shadows: shadows,\n          classificationType: this._geometryUpdater.classificationTypeProperty.getValue(\n            time\n          ),\n        }),\n        Property.getValueOrUndefined(this._geometryUpdater.zIndex, time)\n      );\n    } else {\n      options.vertexFormat = appearance.vertexFormat;\n\n      const fillInstance = this._geometryUpdater.createFillGeometryInstance(\n        time\n      );\n\n      if (isColorAppearance) {\n        appearance.translucent = fillInstance.attributes.color.value[3] !== 255;\n      }\n\n      this._primitive = primitives.add(\n        new Primitive({\n          geometryInstances: fillInstance,\n          appearance: appearance,\n          asynchronous: false,\n          shadows: shadows,\n        })\n      );\n    }\n  }\n\n  if (\n    !onTerrain &&\n    defined(geometry.outline) &&\n    geometry.outline.getValue(time)\n  ) {\n    const outlineInstance = this._geometryUpdater.createOutlineGeometryInstance(\n      time\n    );\n    const outlineWidth = Property.getValueOrDefault(\n      geometry.outlineWidth,\n      time,\n      1.0\n    );\n\n    this._outlinePrimitive = primitives.add(\n      new Primitive({\n        geometryInstances: outlineInstance,\n        appearance: new PerInstanceColorAppearance({\n          flat: true,\n          translucent: outlineInstance.attributes.color.value[3] !== 255,\n          renderState: {\n            lineWidth: geometryUpdater._scene.clampLineWidth(outlineWidth),\n          },\n        }),\n        asynchronous: false,\n        shadows: shadows,\n      })\n    );\n  }\n};\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n * @function\n *\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n *                       BoundingSphereState.PENDING if the result is still being computed, or\n *                       BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nDynamicGeometryUpdater.prototype.getBoundingSphere = function (result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(result)) {\n    throw new DeveloperError(\"result is required.\");\n  }\n  //>>includeEnd('debug');\n  const entity = this._entity;\n  const primitive = this._primitive;\n  const outlinePrimitive = this._outlinePrimitive;\n\n  let attributes;\n\n  //Outline and Fill geometries have the same bounding sphere, so just use whichever one is defined and ready\n  if (defined(primitive) && primitive.show && primitive.ready) {\n    attributes = primitive.getGeometryInstanceAttributes(entity);\n    if (defined(attributes) && defined(attributes.boundingSphere)) {\n      BoundingSphere.clone(attributes.boundingSphere, result);\n      return BoundingSphereState.DONE;\n    }\n  }\n\n  if (\n    defined(outlinePrimitive) &&\n    outlinePrimitive.show &&\n    outlinePrimitive.ready\n  ) {\n    attributes = outlinePrimitive.getGeometryInstanceAttributes(entity);\n    if (defined(attributes) && defined(attributes.boundingSphere)) {\n      BoundingSphere.clone(attributes.boundingSphere, result);\n      return BoundingSphereState.DONE;\n    }\n  }\n\n  if (\n    (defined(primitive) && !primitive.ready) ||\n    (defined(outlinePrimitive) && !outlinePrimitive.ready)\n  ) {\n    return BoundingSphereState.PENDING;\n  }\n\n  return BoundingSphereState.FAILED;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * @memberof DynamicGeometryUpdater\n * @function\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n */\nDynamicGeometryUpdater.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys and resources used by the object.  Once an object is destroyed, it should not be used.\n * @memberof DynamicGeometryUpdater\n * @function\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nDynamicGeometryUpdater.prototype.destroy = function () {\n  const primitives = this._primitives;\n  const orderedGroundPrimitives = this._orderedGroundPrimitives;\n  if (this._geometryUpdater._onTerrain) {\n    orderedGroundPrimitives.remove(this._primitive);\n  } else {\n    primitives.removeAndDestroy(this._primitive);\n  }\n  primitives.removeAndDestroy(this._outlinePrimitive);\n  destroyObject(this);\n};\nexport default DynamicGeometryUpdater;\n", "/**\n * ArcType defines the path that should be taken connecting vertices.\n *\n * @enum {number}\n */\nconst ArcType = {\n  /**\n   * Straight line that does not conform to the surface of the ellipsoid.\n   *\n   * @type {number}\n   * @constant\n   */\n  NONE: 0,\n\n  /**\n   * Follow geodesic path.\n   *\n   * @type {number}\n   * @constant\n   */\n  GEODESIC: 1,\n\n  /**\n   * Follow rhumb or loxodrome path.\n   *\n   * @type {number}\n   * @constant\n   */\n  RHUMB: 2,\n};\nexport default Object.freeze(ArcType);\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport CesiumMath from \"./Math.js\";\n\nconst removeDuplicatesEpsilon = CesiumMath.EPSILON10;\n\n/**\n * Removes adjacent duplicate values in an array of values.\n *\n * @param {any[]} [values] The array of values.\n * @param {Function} equalsEpsilon Function to compare values with an epsilon. Boolean equalsEpsilon(left, right, epsilon).\n * @param {boolean} [wrapAround=false] Compare the last value in the array against the first value. If they are equal, the last value is removed.\n * @param {number[]} [removedIndices=undefined] Store the indices that correspond to the duplicate items removed from the array, if there were any.\n * @returns {any[]|undefined} A new array of values with no adjacent duplicate values or the input array if no duplicates were found.\n *\n * @example\n * // Returns [(1.0, 1.0, 1.0), (2.0, 2.0, 2.0), (3.0, 3.0, 3.0), (1.0, 1.0, 1.0)]\n * const values = [\n *     new Cesium.Cartesian3(1.0, 1.0, 1.0),\n *     new Cesium.Cartesian3(1.0, 1.0, 1.0),\n *     new Cesium.Cartesian3(2.0, 2.0, 2.0),\n *     new Cesium.Cartesian3(3.0, 3.0, 3.0),\n *     new Cesium.Cartesian3(1.0, 1.0, 1.0)];\n * const nonDuplicatevalues = Cesium.PolylinePipeline.removeDuplicates(values, Cartesian3.equalsEpsilon);\n *\n * @example\n * // Returns [(1.0, 1.0, 1.0), (2.0, 2.0, 2.0), (3.0, 3.0, 3.0)]\n * const values = [\n *     new Cesium.Cartesian3(1.0, 1.0, 1.0),\n *     new Cesium.Cartesian3(1.0, 1.0, 1.0),\n *     new Cesium.Cartesian3(2.0, 2.0, 2.0),\n *     new Cesium.Cartesian3(3.0, 3.0, 3.0),\n *     new Cesium.Cartesian3(1.0, 1.0, 1.0)];\n * const nonDuplicatevalues = Cesium.PolylinePipeline.removeDuplicates(values, Cartesian3.equalsEpsilon, true);\n *\n * @example\n * // Returns [(1.0, 1.0, 1.0), (2.0, 2.0, 2.0), (3.0, 3.0, 3.0)]\n * // removedIndices will be equal to [1, 3, 5]\n * const values = [\n *     new Cesium.Cartesian3(1.0, 1.0, 1.0),\n *     new Cesium.Cartesian3(1.0, 1.0, 1.0),\n *     new Cesium.Cartesian3(2.0, 2.0, 2.0),\n *     new Cesium.Cartesian3(2.0, 2.0, 2.0),\n *     new Cesium.Cartesian3(3.0, 3.0, 3.0),\n *     new Cesium.Cartesian3(1.0, 1.0, 1.0)];\n * const nonDuplicatevalues = Cesium.PolylinePipeline.removeDuplicates(values, Cartesian3.equalsEpsilon, true);\n * @private\n */\nfunction arrayRemoveDuplicates(\n  values,\n  equalsEpsilon,\n  wrapAround,\n  removedIndices\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"equalsEpsilon\", equalsEpsilon);\n  //>>includeEnd('debug');\n\n  if (!defined(values)) {\n    return undefined;\n  }\n\n  wrapAround = defaultValue(wrapAround, false);\n  const storeRemovedIndices = defined(removedIndices);\n\n  const length = values.length;\n  if (length < 2) {\n    return values;\n  }\n\n  let i;\n  let v0 = values[0];\n  let v1;\n\n  // We only want to create a new array if there are duplicates in the array.\n  // As such, cleanedValues is undefined until it encounters the first duplicate, if it exists.\n  let cleanedValues;\n  let lastCleanIndex = 0;\n\n  // removedIndexLCI keeps track of where lastCleanIndex would be if it were sorted into the removedIndices array.\n  // In case of arrays such as [A, B, C, ..., A, A, A], removedIndices will not be sorted properly without this.\n  let removedIndexLCI = -1;\n\n  for (i = 1; i < length; ++i) {\n    v1 = values[i];\n    if (equalsEpsilon(v0, v1, removeDuplicatesEpsilon)) {\n      if (!defined(cleanedValues)) {\n        cleanedValues = values.slice(0, i);\n        lastCleanIndex = i - 1;\n        removedIndexLCI = 0;\n      }\n      if (storeRemovedIndices) {\n        removedIndices.push(i);\n      }\n    } else {\n      if (defined(cleanedValues)) {\n        cleanedValues.push(v1);\n        lastCleanIndex = i;\n        if (storeRemovedIndices) {\n          removedIndexLCI = removedIndices.length;\n        }\n      }\n      v0 = v1;\n    }\n  }\n\n  if (\n    wrapAround &&\n    equalsEpsilon(values[0], values[length - 1], removeDuplicatesEpsilon)\n  ) {\n    if (storeRemovedIndices) {\n      if (defined(cleanedValues)) {\n        removedIndices.splice(removedIndexLCI, 0, lastCleanIndex);\n      } else {\n        removedIndices.push(length - 1);\n      }\n    }\n\n    if (defined(cleanedValues)) {\n      cleanedValues.length -= 1;\n    } else {\n      cleanedValues = values.slice(0, -1);\n    }\n  }\n\n  return defined(cleanedValues) ? cleanedValues : values;\n}\n\nexport default arrayRemoveDuplicates;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport CesiumMath from \"./Math.js\";\n\nfunction setConstants(ellipsoidGeodesic) {\n  const uSquared = ellipsoidGeodesic._uSquared;\n  const a = ellipsoidGeodesic._ellipsoid.maximumRadius;\n  const b = ellipsoidGeodesic._ellipsoid.minimumRadius;\n  const f = (a - b) / a;\n\n  const cosineHeading = Math.cos(ellipsoidGeodesic._startHeading);\n  const sineHeading = Math.sin(ellipsoidGeodesic._startHeading);\n\n  const tanU = (1 - f) * Math.tan(ellipsoidGeodesic._start.latitude);\n\n  const cosineU = 1.0 / Math.sqrt(1.0 + tanU * tanU);\n  const sineU = cosineU * tanU;\n\n  const sigma = Math.atan2(tanU, cosineHeading);\n\n  const sineAlpha = cosineU * sineHeading;\n  const sineSquaredAlpha = sineAlpha * sineAlpha;\n\n  const cosineSquaredAlpha = 1.0 - sineSquaredAlpha;\n  const cosineAlpha = Math.sqrt(cosineSquaredAlpha);\n\n  const u2Over4 = uSquared / 4.0;\n  const u4Over16 = u2Over4 * u2Over4;\n  const u6Over64 = u4Over16 * u2Over4;\n  const u8Over256 = u4Over16 * u4Over16;\n\n  const a0 =\n    1.0 +\n    u2Over4 -\n    (3.0 * u4Over16) / 4.0 +\n    (5.0 * u6Over64) / 4.0 -\n    (175.0 * u8Over256) / 64.0;\n  const a1 = 1.0 - u2Over4 + (15.0 * u4Over16) / 8.0 - (35.0 * u6Over64) / 8.0;\n  const a2 = 1.0 - 3.0 * u2Over4 + (35.0 * u4Over16) / 4.0;\n  const a3 = 1.0 - 5.0 * u2Over4;\n\n  const distanceRatio =\n    a0 * sigma -\n    (a1 * Math.sin(2.0 * sigma) * u2Over4) / 2.0 -\n    (a2 * Math.sin(4.0 * sigma) * u4Over16) / 16.0 -\n    (a3 * Math.sin(6.0 * sigma) * u6Over64) / 48.0 -\n    (Math.sin(8.0 * sigma) * 5.0 * u8Over256) / 512;\n\n  const constants = ellipsoidGeodesic._constants;\n\n  constants.a = a;\n  constants.b = b;\n  constants.f = f;\n  constants.cosineHeading = cosineHeading;\n  constants.sineHeading = sineHeading;\n  constants.tanU = tanU;\n  constants.cosineU = cosineU;\n  constants.sineU = sineU;\n  constants.sigma = sigma;\n  constants.sineAlpha = sineAlpha;\n  constants.sineSquaredAlpha = sineSquaredAlpha;\n  constants.cosineSquaredAlpha = cosineSquaredAlpha;\n  constants.cosineAlpha = cosineAlpha;\n  constants.u2Over4 = u2Over4;\n  constants.u4Over16 = u4Over16;\n  constants.u6Over64 = u6Over64;\n  constants.u8Over256 = u8Over256;\n  constants.a0 = a0;\n  constants.a1 = a1;\n  constants.a2 = a2;\n  constants.a3 = a3;\n  constants.distanceRatio = distanceRatio;\n}\n\nfunction computeC(f, cosineSquaredAlpha) {\n  return (\n    (f * cosineSquaredAlpha * (4.0 + f * (4.0 - 3.0 * cosineSquaredAlpha))) /\n    16.0\n  );\n}\n\nfunction computeDeltaLambda(\n  f,\n  sineAlpha,\n  cosineSquaredAlpha,\n  sigma,\n  sineSigma,\n  cosineSigma,\n  cosineTwiceSigmaMidpoint\n) {\n  const C = computeC(f, cosineSquaredAlpha);\n\n  return (\n    (1.0 - C) *\n    f *\n    sineAlpha *\n    (sigma +\n      C *\n        sineSigma *\n        (cosineTwiceSigmaMidpoint +\n          C *\n            cosineSigma *\n            (2.0 * cosineTwiceSigmaMidpoint * cosineTwiceSigmaMidpoint - 1.0)))\n  );\n}\n\nfunction vincentyInverseFormula(\n  ellipsoidGeodesic,\n  major,\n  minor,\n  firstLongitude,\n  firstLatitude,\n  secondLongitude,\n  secondLatitude\n) {\n  const eff = (major - minor) / major;\n  const l = secondLongitude - firstLongitude;\n\n  const u1 = Math.atan((1 - eff) * Math.tan(firstLatitude));\n  const u2 = Math.atan((1 - eff) * Math.tan(secondLatitude));\n\n  const cosineU1 = Math.cos(u1);\n  const sineU1 = Math.sin(u1);\n  const cosineU2 = Math.cos(u2);\n  const sineU2 = Math.sin(u2);\n\n  const cc = cosineU1 * cosineU2;\n  const cs = cosineU1 * sineU2;\n  const ss = sineU1 * sineU2;\n  const sc = sineU1 * cosineU2;\n\n  let lambda = l;\n  let lambdaDot = CesiumMath.TWO_PI;\n\n  let cosineLambda = Math.cos(lambda);\n  let sineLambda = Math.sin(lambda);\n\n  let sigma;\n  let cosineSigma;\n  let sineSigma;\n  let cosineSquaredAlpha;\n  let cosineTwiceSigmaMidpoint;\n\n  do {\n    cosineLambda = Math.cos(lambda);\n    sineLambda = Math.sin(lambda);\n\n    const temp = cs - sc * cosineLambda;\n    sineSigma = Math.sqrt(\n      cosineU2 * cosineU2 * sineLambda * sineLambda + temp * temp\n    );\n    cosineSigma = ss + cc * cosineLambda;\n\n    sigma = Math.atan2(sineSigma, cosineSigma);\n\n    let sineAlpha;\n\n    if (sineSigma === 0.0) {\n      sineAlpha = 0.0;\n      cosineSquaredAlpha = 1.0;\n    } else {\n      sineAlpha = (cc * sineLambda) / sineSigma;\n      cosineSquaredAlpha = 1.0 - sineAlpha * sineAlpha;\n    }\n\n    lambdaDot = lambda;\n\n    cosineTwiceSigmaMidpoint = cosineSigma - (2.0 * ss) / cosineSquaredAlpha;\n\n    if (!isFinite(cosineTwiceSigmaMidpoint)) {\n      cosineTwiceSigmaMidpoint = 0.0;\n    }\n\n    lambda =\n      l +\n      computeDeltaLambda(\n        eff,\n        sineAlpha,\n        cosineSquaredAlpha,\n        sigma,\n        sineSigma,\n        cosineSigma,\n        cosineTwiceSigmaMidpoint\n      );\n  } while (Math.abs(lambda - lambdaDot) > CesiumMath.EPSILON12);\n\n  const uSquared =\n    (cosineSquaredAlpha * (major * major - minor * minor)) / (minor * minor);\n  const A =\n    1.0 +\n    (uSquared *\n      (4096.0 + uSquared * (uSquared * (320.0 - 175.0 * uSquared) - 768.0))) /\n      16384.0;\n  const B =\n    (uSquared *\n      (256.0 + uSquared * (uSquared * (74.0 - 47.0 * uSquared) - 128.0))) /\n    1024.0;\n\n  const cosineSquaredTwiceSigmaMidpoint =\n    cosineTwiceSigmaMidpoint * cosineTwiceSigmaMidpoint;\n  const deltaSigma =\n    B *\n    sineSigma *\n    (cosineTwiceSigmaMidpoint +\n      (B *\n        (cosineSigma * (2.0 * cosineSquaredTwiceSigmaMidpoint - 1.0) -\n          (B *\n            cosineTwiceSigmaMidpoint *\n            (4.0 * sineSigma * sineSigma - 3.0) *\n            (4.0 * cosineSquaredTwiceSigmaMidpoint - 3.0)) /\n            6.0)) /\n        4.0);\n\n  const distance = minor * A * (sigma - deltaSigma);\n\n  const startHeading = Math.atan2(\n    cosineU2 * sineLambda,\n    cs - sc * cosineLambda\n  );\n  const endHeading = Math.atan2(cosineU1 * sineLambda, cs * cosineLambda - sc);\n\n  ellipsoidGeodesic._distance = distance;\n  ellipsoidGeodesic._startHeading = startHeading;\n  ellipsoidGeodesic._endHeading = endHeading;\n  ellipsoidGeodesic._uSquared = uSquared;\n}\n\nconst scratchCart1 = new Cartesian3();\nconst scratchCart2 = new Cartesian3();\nfunction computeProperties(ellipsoidGeodesic, start, end, ellipsoid) {\n  const firstCartesian = Cartesian3.normalize(\n    ellipsoid.cartographicToCartesian(start, scratchCart2),\n    scratchCart1\n  );\n  const lastCartesian = Cartesian3.normalize(\n    ellipsoid.cartographicToCartesian(end, scratchCart2),\n    scratchCart2\n  );\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThanOrEquals(\n    \"value\",\n    Math.abs(\n      Math.abs(Cartesian3.angleBetween(firstCartesian, lastCartesian)) - Math.PI\n    ),\n    0.0125\n  );\n  //>>includeEnd('debug');\n\n  vincentyInverseFormula(\n    ellipsoidGeodesic,\n    ellipsoid.maximumRadius,\n    ellipsoid.minimumRadius,\n    start.longitude,\n    start.latitude,\n    end.longitude,\n    end.latitude\n  );\n\n  ellipsoidGeodesic._start = Cartographic.clone(\n    start,\n    ellipsoidGeodesic._start\n  );\n  ellipsoidGeodesic._end = Cartographic.clone(end, ellipsoidGeodesic._end);\n  ellipsoidGeodesic._start.height = 0;\n  ellipsoidGeodesic._end.height = 0;\n\n  setConstants(ellipsoidGeodesic);\n}\n\n/**\n * Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.\n *\n * @alias EllipsoidGeodesic\n * @constructor\n *\n * @param {Cartographic} [start] The initial planetodetic point on the path.\n * @param {Cartographic} [end] The final planetodetic point on the path.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the geodesic lies.\n */\nfunction EllipsoidGeodesic(start, end, ellipsoid) {\n  const e = defaultValue(ellipsoid, Ellipsoid.WGS84);\n  this._ellipsoid = e;\n  this._start = new Cartographic();\n  this._end = new Cartographic();\n\n  this._constants = {};\n  this._startHeading = undefined;\n  this._endHeading = undefined;\n  this._distance = undefined;\n  this._uSquared = undefined;\n\n  if (defined(start) && defined(end)) {\n    computeProperties(this, start, end, e);\n  }\n}\n\nObject.defineProperties(EllipsoidGeodesic.prototype, {\n  /**\n   * Gets the ellipsoid.\n   * @memberof EllipsoidGeodesic.prototype\n   * @type {Ellipsoid}\n   * @readonly\n   */\n  ellipsoid: {\n    get: function () {\n      return this._ellipsoid;\n    },\n  },\n\n  /**\n   * Gets the surface distance between the start and end point\n   * @memberof EllipsoidGeodesic.prototype\n   * @type {number}\n   * @readonly\n   */\n  surfaceDistance: {\n    get: function () {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"distance\", this._distance);\n      //>>includeEnd('debug');\n\n      return this._distance;\n    },\n  },\n\n  /**\n   * Gets the initial planetodetic point on the path.\n   * @memberof EllipsoidGeodesic.prototype\n   * @type {Cartographic}\n   * @readonly\n   */\n  start: {\n    get: function () {\n      return this._start;\n    },\n  },\n\n  /**\n   * Gets the final planetodetic point on the path.\n   * @memberof EllipsoidGeodesic.prototype\n   * @type {Cartographic}\n   * @readonly\n   */\n  end: {\n    get: function () {\n      return this._end;\n    },\n  },\n\n  /**\n   * Gets the heading at the initial point.\n   * @memberof EllipsoidGeodesic.prototype\n   * @type {number}\n   * @readonly\n   */\n  startHeading: {\n    get: function () {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"distance\", this._distance);\n      //>>includeEnd('debug');\n\n      return this._startHeading;\n    },\n  },\n\n  /**\n   * Gets the heading at the final point.\n   * @memberof EllipsoidGeodesic.prototype\n   * @type {number}\n   * @readonly\n   */\n  endHeading: {\n    get: function () {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"distance\", this._distance);\n      //>>includeEnd('debug');\n\n      return this._endHeading;\n    },\n  },\n});\n\n/**\n * Sets the start and end points of the geodesic\n *\n * @param {Cartographic} start The initial planetodetic point on the path.\n * @param {Cartographic} end The final planetodetic point on the path.\n */\nEllipsoidGeodesic.prototype.setEndPoints = function (start, end) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"start\", start);\n  Check.defined(\"end\", end);\n  //>>includeEnd('debug');\n\n  computeProperties(this, start, end, this._ellipsoid);\n};\n\n/**\n * Provides the location of a point at the indicated portion along the geodesic.\n *\n * @param {number} fraction The portion of the distance between the initial and final points.\n * @param {Cartographic} [result] The object in which to store the result.\n * @returns {Cartographic} The location of the point along the geodesic.\n */\nEllipsoidGeodesic.prototype.interpolateUsingFraction = function (\n  fraction,\n  result\n) {\n  return this.interpolateUsingSurfaceDistance(\n    this._distance * fraction,\n    result\n  );\n};\n\n/**\n * Provides the location of a point at the indicated distance along the geodesic.\n *\n * @param {number} distance The distance from the inital point to the point of interest along the geodesic\n * @param {Cartographic} [result] The object in which to store the result.\n * @returns {Cartographic} The location of the point along the geodesic.\n *\n * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance\n */\nEllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance = function (\n  distance,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"distance\", this._distance);\n  //>>includeEnd('debug');\n\n  const constants = this._constants;\n\n  const s = constants.distanceRatio + distance / constants.b;\n\n  const cosine2S = Math.cos(2.0 * s);\n  const cosine4S = Math.cos(4.0 * s);\n  const cosine6S = Math.cos(6.0 * s);\n  const sine2S = Math.sin(2.0 * s);\n  const sine4S = Math.sin(4.0 * s);\n  const sine6S = Math.sin(6.0 * s);\n  const sine8S = Math.sin(8.0 * s);\n\n  const s2 = s * s;\n  const s3 = s * s2;\n\n  const u8Over256 = constants.u8Over256;\n  const u2Over4 = constants.u2Over4;\n  const u6Over64 = constants.u6Over64;\n  const u4Over16 = constants.u4Over16;\n  let sigma =\n    (2.0 * s3 * u8Over256 * cosine2S) / 3.0 +\n    s *\n      (1.0 -\n        u2Over4 +\n        (7.0 * u4Over16) / 4.0 -\n        (15.0 * u6Over64) / 4.0 +\n        (579.0 * u8Over256) / 64.0 -\n        (u4Over16 - (15.0 * u6Over64) / 4.0 + (187.0 * u8Over256) / 16.0) *\n          cosine2S -\n        ((5.0 * u6Over64) / 4.0 - (115.0 * u8Over256) / 16.0) * cosine4S -\n        (29.0 * u8Over256 * cosine6S) / 16.0) +\n    (u2Over4 / 2.0 -\n      u4Over16 +\n      (71.0 * u6Over64) / 32.0 -\n      (85.0 * u8Over256) / 16.0) *\n      sine2S +\n    ((5.0 * u4Over16) / 16.0 -\n      (5.0 * u6Over64) / 4.0 +\n      (383.0 * u8Over256) / 96.0) *\n      sine4S -\n    s2 *\n      ((u6Over64 - (11.0 * u8Over256) / 2.0) * sine2S +\n        (5.0 * u8Over256 * sine4S) / 2.0) +\n    ((29.0 * u6Over64) / 96.0 - (29.0 * u8Over256) / 16.0) * sine6S +\n    (539.0 * u8Over256 * sine8S) / 1536.0;\n\n  const theta = Math.asin(Math.sin(sigma) * constants.cosineAlpha);\n  const latitude = Math.atan((constants.a / constants.b) * Math.tan(theta));\n\n  // Redefine in terms of relative argument of latitude.\n  sigma = sigma - constants.sigma;\n\n  const cosineTwiceSigmaMidpoint = Math.cos(2.0 * constants.sigma + sigma);\n\n  const sineSigma = Math.sin(sigma);\n  const cosineSigma = Math.cos(sigma);\n\n  const cc = constants.cosineU * cosineSigma;\n  const ss = constants.sineU * sineSigma;\n\n  const lambda = Math.atan2(\n    sineSigma * constants.sineHeading,\n    cc - ss * constants.cosineHeading\n  );\n\n  const l =\n    lambda -\n    computeDeltaLambda(\n      constants.f,\n      constants.sineAlpha,\n      constants.cosineSquaredAlpha,\n      sigma,\n      sineSigma,\n      cosineSigma,\n      cosineTwiceSigmaMidpoint\n    );\n\n  if (defined(result)) {\n    result.longitude = this._start.longitude + l;\n    result.latitude = latitude;\n    result.height = 0.0;\n    return result;\n  }\n\n  return new Cartographic(this._start.longitude + l, latitude, 0.0);\n};\nexport default EllipsoidGeodesic;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport CesiumMath from \"./Math.js\";\n\nfunction calculateM(ellipticity, major, latitude) {\n  if (ellipticity === 0.0) {\n    // sphere\n    return major * latitude;\n  }\n\n  const e2 = ellipticity * ellipticity;\n  const e4 = e2 * e2;\n  const e6 = e4 * e2;\n  const e8 = e6 * e2;\n  const e10 = e8 * e2;\n  const e12 = e10 * e2;\n  const phi = latitude;\n  const sin2Phi = Math.sin(2 * phi);\n  const sin4Phi = Math.sin(4 * phi);\n  const sin6Phi = Math.sin(6 * phi);\n  const sin8Phi = Math.sin(8 * phi);\n  const sin10Phi = Math.sin(10 * phi);\n  const sin12Phi = Math.sin(12 * phi);\n\n  return (\n    major *\n    ((1 -\n      e2 / 4 -\n      (3 * e4) / 64 -\n      (5 * e6) / 256 -\n      (175 * e8) / 16384 -\n      (441 * e10) / 65536 -\n      (4851 * e12) / 1048576) *\n      phi -\n      ((3 * e2) / 8 +\n        (3 * e4) / 32 +\n        (45 * e6) / 1024 +\n        (105 * e8) / 4096 +\n        (2205 * e10) / 131072 +\n        (6237 * e12) / 524288) *\n        sin2Phi +\n      ((15 * e4) / 256 +\n        (45 * e6) / 1024 +\n        (525 * e8) / 16384 +\n        (1575 * e10) / 65536 +\n        (155925 * e12) / 8388608) *\n        sin4Phi -\n      ((35 * e6) / 3072 +\n        (175 * e8) / 12288 +\n        (3675 * e10) / 262144 +\n        (13475 * e12) / 1048576) *\n        sin6Phi +\n      ((315 * e8) / 131072 + (2205 * e10) / 524288 + (43659 * e12) / 8388608) *\n        sin8Phi -\n      ((693 * e10) / 1310720 + (6237 * e12) / 5242880) * sin10Phi +\n      ((1001 * e12) / 8388608) * sin12Phi)\n  );\n}\n\nfunction calculateInverseM(M, ellipticity, major) {\n  const d = M / major;\n\n  if (ellipticity === 0.0) {\n    // sphere\n    return d;\n  }\n\n  const d2 = d * d;\n  const d3 = d2 * d;\n  const d4 = d3 * d;\n  const e = ellipticity;\n  const e2 = e * e;\n  const e4 = e2 * e2;\n  const e6 = e4 * e2;\n  const e8 = e6 * e2;\n  const e10 = e8 * e2;\n  const e12 = e10 * e2;\n  const sin2D = Math.sin(2 * d);\n  const cos2D = Math.cos(2 * d);\n  const sin4D = Math.sin(4 * d);\n  const cos4D = Math.cos(4 * d);\n  const sin6D = Math.sin(6 * d);\n  const cos6D = Math.cos(6 * d);\n  const sin8D = Math.sin(8 * d);\n  const cos8D = Math.cos(8 * d);\n  const sin10D = Math.sin(10 * d);\n  const cos10D = Math.cos(10 * d);\n  const sin12D = Math.sin(12 * d);\n\n  return (\n    d +\n    (d * e2) / 4 +\n    (7 * d * e4) / 64 +\n    (15 * d * e6) / 256 +\n    (579 * d * e8) / 16384 +\n    (1515 * d * e10) / 65536 +\n    (16837 * d * e12) / 1048576 +\n    ((3 * d * e4) / 16 +\n      (45 * d * e6) / 256 -\n      (d * (32 * d2 - 561) * e8) / 4096 -\n      (d * (232 * d2 - 1677) * e10) / 16384 +\n      (d * (399985 - 90560 * d2 + 512 * d4) * e12) / 5242880) *\n      cos2D +\n    ((21 * d * e6) / 256 +\n      (483 * d * e8) / 4096 -\n      (d * (224 * d2 - 1969) * e10) / 16384 -\n      (d * (33152 * d2 - 112599) * e12) / 1048576) *\n      cos4D +\n    ((151 * d * e8) / 4096 +\n      (4681 * d * e10) / 65536 +\n      (1479 * d * e12) / 16384 -\n      (453 * d3 * e12) / 32768) *\n      cos6D +\n    ((1097 * d * e10) / 65536 + (42783 * d * e12) / 1048576) * cos8D +\n    ((8011 * d * e12) / 1048576) * cos10D +\n    ((3 * e2) / 8 +\n      (3 * e4) / 16 +\n      (213 * e6) / 2048 -\n      (3 * d2 * e6) / 64 +\n      (255 * e8) / 4096 -\n      (33 * d2 * e8) / 512 +\n      (20861 * e10) / 524288 -\n      (33 * d2 * e10) / 512 +\n      (d4 * e10) / 1024 +\n      (28273 * e12) / 1048576 -\n      (471 * d2 * e12) / 8192 +\n      (9 * d4 * e12) / 4096) *\n      sin2D +\n    ((21 * e4) / 256 +\n      (21 * e6) / 256 +\n      (533 * e8) / 8192 -\n      (21 * d2 * e8) / 512 +\n      (197 * e10) / 4096 -\n      (315 * d2 * e10) / 4096 +\n      (584039 * e12) / 16777216 -\n      (12517 * d2 * e12) / 131072 +\n      (7 * d4 * e12) / 2048) *\n      sin4D +\n    ((151 * e6) / 6144 +\n      (151 * e8) / 4096 +\n      (5019 * e10) / 131072 -\n      (453 * d2 * e10) / 16384 +\n      (26965 * e12) / 786432 -\n      (8607 * d2 * e12) / 131072) *\n      sin6D +\n    ((1097 * e8) / 131072 +\n      (1097 * e10) / 65536 +\n      (225797 * e12) / 10485760 -\n      (1097 * d2 * e12) / 65536) *\n      sin8D +\n    ((8011 * e10) / 2621440 + (8011 * e12) / 1048576) * sin10D +\n    ((293393 * e12) / 251658240) * sin12D\n  );\n}\n\nfunction calculateSigma(ellipticity, latitude) {\n  if (ellipticity === 0.0) {\n    // sphere\n    return Math.log(Math.tan(0.5 * (CesiumMath.PI_OVER_TWO + latitude)));\n  }\n\n  const eSinL = ellipticity * Math.sin(latitude);\n  return (\n    Math.log(Math.tan(0.5 * (CesiumMath.PI_OVER_TWO + latitude))) -\n    (ellipticity / 2.0) * Math.log((1 + eSinL) / (1 - eSinL))\n  );\n}\n\nfunction calculateHeading(\n  ellipsoidRhumbLine,\n  firstLongitude,\n  firstLatitude,\n  secondLongitude,\n  secondLatitude\n) {\n  const sigma1 = calculateSigma(ellipsoidRhumbLine._ellipticity, firstLatitude);\n  const sigma2 = calculateSigma(\n    ellipsoidRhumbLine._ellipticity,\n    secondLatitude\n  );\n  return Math.atan2(\n    CesiumMath.negativePiToPi(secondLongitude - firstLongitude),\n    sigma2 - sigma1\n  );\n}\n\nfunction calculateArcLength(\n  ellipsoidRhumbLine,\n  major,\n  minor,\n  firstLongitude,\n  firstLatitude,\n  secondLongitude,\n  secondLatitude\n) {\n  const heading = ellipsoidRhumbLine._heading;\n  const deltaLongitude = secondLongitude - firstLongitude;\n\n  let distance = 0.0;\n\n  //Check to see if the rhumb line has constant latitude\n  //This equation will diverge if heading gets close to 90 degrees\n  if (\n    CesiumMath.equalsEpsilon(\n      Math.abs(heading),\n      CesiumMath.PI_OVER_TWO,\n      CesiumMath.EPSILON8\n    )\n  ) {\n    //If heading is close to 90 degrees\n    if (major === minor) {\n      distance =\n        major *\n        Math.cos(firstLatitude) *\n        CesiumMath.negativePiToPi(deltaLongitude);\n    } else {\n      const sinPhi = Math.sin(firstLatitude);\n      distance =\n        (major *\n          Math.cos(firstLatitude) *\n          CesiumMath.negativePiToPi(deltaLongitude)) /\n        Math.sqrt(1 - ellipsoidRhumbLine._ellipticitySquared * sinPhi * sinPhi);\n    }\n  } else {\n    const M1 = calculateM(\n      ellipsoidRhumbLine._ellipticity,\n      major,\n      firstLatitude\n    );\n    const M2 = calculateM(\n      ellipsoidRhumbLine._ellipticity,\n      major,\n      secondLatitude\n    );\n\n    distance = (M2 - M1) / Math.cos(heading);\n  }\n  return Math.abs(distance);\n}\n\nconst scratchCart1 = new Cartesian3();\nconst scratchCart2 = new Cartesian3();\n\nfunction computeProperties(ellipsoidRhumbLine, start, end, ellipsoid) {\n  const firstCartesian = Cartesian3.normalize(\n    ellipsoid.cartographicToCartesian(start, scratchCart2),\n    scratchCart1\n  );\n  const lastCartesian = Cartesian3.normalize(\n    ellipsoid.cartographicToCartesian(end, scratchCart2),\n    scratchCart2\n  );\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThanOrEquals(\n    \"value\",\n    Math.abs(\n      Math.abs(Cartesian3.angleBetween(firstCartesian, lastCartesian)) - Math.PI\n    ),\n    0.0125\n  );\n  //>>includeEnd('debug');\n\n  const major = ellipsoid.maximumRadius;\n  const minor = ellipsoid.minimumRadius;\n  const majorSquared = major * major;\n  const minorSquared = minor * minor;\n  ellipsoidRhumbLine._ellipticitySquared =\n    (majorSquared - minorSquared) / majorSquared;\n  ellipsoidRhumbLine._ellipticity = Math.sqrt(\n    ellipsoidRhumbLine._ellipticitySquared\n  );\n\n  ellipsoidRhumbLine._start = Cartographic.clone(\n    start,\n    ellipsoidRhumbLine._start\n  );\n  ellipsoidRhumbLine._start.height = 0;\n\n  ellipsoidRhumbLine._end = Cartographic.clone(end, ellipsoidRhumbLine._end);\n  ellipsoidRhumbLine._end.height = 0;\n\n  ellipsoidRhumbLine._heading = calculateHeading(\n    ellipsoidRhumbLine,\n    start.longitude,\n    start.latitude,\n    end.longitude,\n    end.latitude\n  );\n  ellipsoidRhumbLine._distance = calculateArcLength(\n    ellipsoidRhumbLine,\n    ellipsoid.maximumRadius,\n    ellipsoid.minimumRadius,\n    start.longitude,\n    start.latitude,\n    end.longitude,\n    end.latitude\n  );\n}\n\nfunction interpolateUsingSurfaceDistance(\n  start,\n  heading,\n  distance,\n  major,\n  ellipticity,\n  result\n) {\n  if (distance === 0.0) {\n    return Cartographic.clone(start, result);\n  }\n\n  const ellipticitySquared = ellipticity * ellipticity;\n\n  let longitude;\n  let latitude;\n  let deltaLongitude;\n\n  //Check to see if the rhumb line has constant latitude\n  //This won't converge if heading is close to 90 degrees\n  if (\n    Math.abs(CesiumMath.PI_OVER_TWO - Math.abs(heading)) > CesiumMath.EPSILON8\n  ) {\n    //Calculate latitude of the second point\n    const M1 = calculateM(ellipticity, major, start.latitude);\n    const deltaM = distance * Math.cos(heading);\n    const M2 = M1 + deltaM;\n    latitude = calculateInverseM(M2, ellipticity, major);\n\n    //Now find the longitude of the second point\n\n    // Check to see if the rhumb line has constant longitude\n    if (Math.abs(heading) < CesiumMath.EPSILON10) {\n      longitude = CesiumMath.negativePiToPi(start.longitude);\n    } else {\n      const sigma1 = calculateSigma(ellipticity, start.latitude);\n      const sigma2 = calculateSigma(ellipticity, latitude);\n      deltaLongitude = Math.tan(heading) * (sigma2 - sigma1);\n      longitude = CesiumMath.negativePiToPi(start.longitude + deltaLongitude);\n    }\n  } else {\n    //If heading is close to 90 degrees\n    latitude = start.latitude;\n    let localRad;\n\n    if (ellipticity === 0.0) {\n      // sphere\n      localRad = major * Math.cos(start.latitude);\n    } else {\n      const sinPhi = Math.sin(start.latitude);\n      localRad =\n        (major * Math.cos(start.latitude)) /\n        Math.sqrt(1 - ellipticitySquared * sinPhi * sinPhi);\n    }\n\n    deltaLongitude = distance / localRad;\n    if (heading > 0.0) {\n      longitude = CesiumMath.negativePiToPi(start.longitude + deltaLongitude);\n    } else {\n      longitude = CesiumMath.negativePiToPi(start.longitude - deltaLongitude);\n    }\n  }\n\n  if (defined(result)) {\n    result.longitude = longitude;\n    result.latitude = latitude;\n    result.height = 0;\n\n    return result;\n  }\n\n  return new Cartographic(longitude, latitude, 0);\n}\n\n/**\n * Initializes a rhumb line on the ellipsoid connecting the two provided planetodetic points.\n *\n * @alias EllipsoidRhumbLine\n * @constructor\n *\n * @param {Cartographic} [start] The initial planetodetic point on the path.\n * @param {Cartographic} [end] The final planetodetic point on the path.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rhumb line lies.\n *\n * @exception {DeveloperError} angle between start and end must be at least 0.0125 radians.\n */\nfunction EllipsoidRhumbLine(start, end, ellipsoid) {\n  const e = defaultValue(ellipsoid, Ellipsoid.WGS84);\n  this._ellipsoid = e;\n  this._start = new Cartographic();\n  this._end = new Cartographic();\n\n  this._heading = undefined;\n  this._distance = undefined;\n  this._ellipticity = undefined;\n  this._ellipticitySquared = undefined;\n\n  if (defined(start) && defined(end)) {\n    computeProperties(this, start, end, e);\n  }\n}\n\nObject.defineProperties(EllipsoidRhumbLine.prototype, {\n  /**\n   * Gets the ellipsoid.\n   * @memberof EllipsoidRhumbLine.prototype\n   * @type {Ellipsoid}\n   * @readonly\n   */\n  ellipsoid: {\n    get: function () {\n      return this._ellipsoid;\n    },\n  },\n\n  /**\n   * Gets the surface distance between the start and end point\n   * @memberof EllipsoidRhumbLine.prototype\n   * @type {number}\n   * @readonly\n   */\n  surfaceDistance: {\n    get: function () {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"distance\", this._distance);\n      //>>includeEnd('debug');\n\n      return this._distance;\n    },\n  },\n\n  /**\n   * Gets the initial planetodetic point on the path.\n   * @memberof EllipsoidRhumbLine.prototype\n   * @type {Cartographic}\n   * @readonly\n   */\n  start: {\n    get: function () {\n      return this._start;\n    },\n  },\n\n  /**\n   * Gets the final planetodetic point on the path.\n   * @memberof EllipsoidRhumbLine.prototype\n   * @type {Cartographic}\n   * @readonly\n   */\n  end: {\n    get: function () {\n      return this._end;\n    },\n  },\n\n  /**\n   * Gets the heading from the start point to the end point.\n   * @memberof EllipsoidRhumbLine.prototype\n   * @type {number}\n   * @readonly\n   */\n  heading: {\n    get: function () {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"distance\", this._distance);\n      //>>includeEnd('debug');\n\n      return this._heading;\n    },\n  },\n});\n\n/**\n * Create a rhumb line using an initial position with a heading and distance.\n *\n * @param {Cartographic} start The initial planetodetic point on the path.\n * @param {number} heading The heading in radians.\n * @param {number} distance The rhumb line distance between the start and end point.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rhumb line lies.\n * @param {EllipsoidRhumbLine} [result] The object in which to store the result.\n * @returns {EllipsoidRhumbLine} The EllipsoidRhumbLine object.\n */\nEllipsoidRhumbLine.fromStartHeadingDistance = function (\n  start,\n  heading,\n  distance,\n  ellipsoid,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"start\", start);\n  Check.defined(\"heading\", heading);\n  Check.defined(\"distance\", distance);\n  Check.typeOf.number.greaterThan(\"distance\", distance, 0.0);\n  //>>includeEnd('debug');\n\n  const e = defaultValue(ellipsoid, Ellipsoid.WGS84);\n  const major = e.maximumRadius;\n  const minor = e.minimumRadius;\n  const majorSquared = major * major;\n  const minorSquared = minor * minor;\n  const ellipticity = Math.sqrt((majorSquared - minorSquared) / majorSquared);\n\n  heading = CesiumMath.negativePiToPi(heading);\n  const end = interpolateUsingSurfaceDistance(\n    start,\n    heading,\n    distance,\n    e.maximumRadius,\n    ellipticity\n  );\n\n  if (\n    !defined(result) ||\n    (defined(ellipsoid) && !ellipsoid.equals(result.ellipsoid))\n  ) {\n    return new EllipsoidRhumbLine(start, end, e);\n  }\n\n  result.setEndPoints(start, end);\n  return result;\n};\n\n/**\n * Sets the start and end points of the rhumb line.\n *\n * @param {Cartographic} start The initial planetodetic point on the path.\n * @param {Cartographic} end The final planetodetic point on the path.\n */\nEllipsoidRhumbLine.prototype.setEndPoints = function (start, end) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"start\", start);\n  Check.defined(\"end\", end);\n  //>>includeEnd('debug');\n\n  computeProperties(this, start, end, this._ellipsoid);\n};\n\n/**\n * Provides the location of a point at the indicated portion along the rhumb line.\n *\n * @param {number} fraction The portion of the distance between the initial and final points.\n * @param {Cartographic} [result] The object in which to store the result.\n * @returns {Cartographic} The location of the point along the rhumb line.\n */\nEllipsoidRhumbLine.prototype.interpolateUsingFraction = function (\n  fraction,\n  result\n) {\n  return this.interpolateUsingSurfaceDistance(\n    fraction * this._distance,\n    result\n  );\n};\n\n/**\n * Provides the location of a point at the indicated distance along the rhumb line.\n *\n * @param {number} distance The distance from the inital point to the point of interest along the rhumbLine.\n * @param {Cartographic} [result] The object in which to store the result.\n * @returns {Cartographic} The location of the point along the rhumb line.\n *\n * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance\n */\nEllipsoidRhumbLine.prototype.interpolateUsingSurfaceDistance = function (\n  distance,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"distance\", distance);\n  if (!defined(this._distance) || this._distance === 0.0) {\n    throw new DeveloperError(\n      \"EllipsoidRhumbLine must have distinct start and end set.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  return interpolateUsingSurfaceDistance(\n    this._start,\n    this._heading,\n    distance,\n    this._ellipsoid.maximumRadius,\n    this._ellipticity,\n    result\n  );\n};\n\n/**\n * Provides the location of a point at the indicated longitude along the rhumb line.\n * If the longitude is outside the range of start and end points, the first intersection with the longitude from the start point in the direction of the heading is returned. This follows the spiral property of a rhumb line.\n *\n * @param {number} intersectionLongitude The longitude, in radians, at which to find the intersection point from the starting point using the heading.\n * @param {Cartographic} [result] The object in which to store the result.\n * @returns {Cartographic} The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.\n *\n * @exception {DeveloperError} start and end must be set before calling function findIntersectionWithLongitude.\n */\nEllipsoidRhumbLine.prototype.findIntersectionWithLongitude = function (\n  intersectionLongitude,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"intersectionLongitude\", intersectionLongitude);\n  if (!defined(this._distance) || this._distance === 0.0) {\n    throw new DeveloperError(\n      \"EllipsoidRhumbLine must have distinct start and end set.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const ellipticity = this._ellipticity;\n  const heading = this._heading;\n  const absHeading = Math.abs(heading);\n  const start = this._start;\n\n  intersectionLongitude = CesiumMath.negativePiToPi(intersectionLongitude);\n\n  if (\n    CesiumMath.equalsEpsilon(\n      Math.abs(intersectionLongitude),\n      Math.PI,\n      CesiumMath.EPSILON14\n    )\n  ) {\n    intersectionLongitude = CesiumMath.sign(start.longitude) * Math.PI;\n  }\n\n  if (!defined(result)) {\n    result = new Cartographic();\n  }\n\n  // If heading is -PI/2 or PI/2, this is an E-W rhumb line\n  // If heading is 0 or PI, this is an N-S rhumb line\n  if (Math.abs(CesiumMath.PI_OVER_TWO - absHeading) <= CesiumMath.EPSILON8) {\n    result.longitude = intersectionLongitude;\n    result.latitude = start.latitude;\n    result.height = 0;\n    return result;\n  } else if (\n    CesiumMath.equalsEpsilon(\n      Math.abs(CesiumMath.PI_OVER_TWO - absHeading),\n      CesiumMath.PI_OVER_TWO,\n      CesiumMath.EPSILON8\n    )\n  ) {\n    if (\n      CesiumMath.equalsEpsilon(\n        intersectionLongitude,\n        start.longitude,\n        CesiumMath.EPSILON12\n      )\n    ) {\n      return undefined;\n    }\n\n    result.longitude = intersectionLongitude;\n    result.latitude =\n      CesiumMath.PI_OVER_TWO *\n      CesiumMath.sign(CesiumMath.PI_OVER_TWO - heading);\n    result.height = 0;\n    return result;\n  }\n\n  // Use iterative solver from Equation 9 from http://edwilliams.org/ellipsoid/ellipsoid.pdf\n  const phi1 = start.latitude;\n  const eSinPhi1 = ellipticity * Math.sin(phi1);\n  const leftComponent =\n    Math.tan(0.5 * (CesiumMath.PI_OVER_TWO + phi1)) *\n    Math.exp((intersectionLongitude - start.longitude) / Math.tan(heading));\n  const denominator = (1 + eSinPhi1) / (1 - eSinPhi1);\n\n  let newPhi = start.latitude;\n  let phi;\n  do {\n    phi = newPhi;\n    const eSinPhi = ellipticity * Math.sin(phi);\n    const numerator = (1 + eSinPhi) / (1 - eSinPhi);\n    newPhi =\n      2 *\n        Math.atan(\n          leftComponent * Math.pow(numerator / denominator, ellipticity / 2)\n        ) -\n      CesiumMath.PI_OVER_TWO;\n  } while (!CesiumMath.equalsEpsilon(newPhi, phi, CesiumMath.EPSILON12));\n\n  result.longitude = intersectionLongitude;\n  result.latitude = newPhi;\n  result.height = 0;\n  return result;\n};\n\n/**\n * Provides the location of a point at the indicated latitude along the rhumb line.\n * If the latitude is outside the range of start and end points, the first intersection with the latitude from that start point in the direction of the heading is returned. This follows the spiral property of a rhumb line.\n *\n * @param {number} intersectionLatitude The latitude, in radians, at which to find the intersection point from the starting point using the heading.\n * @param {Cartographic} [result] The object in which to store the result.\n * @returns {Cartographic} The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.\n *\n * @exception {DeveloperError} start and end must be set before calling function findIntersectionWithLongitude.\n */\nEllipsoidRhumbLine.prototype.findIntersectionWithLatitude = function (\n  intersectionLatitude,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"intersectionLatitude\", intersectionLatitude);\n  if (!defined(this._distance) || this._distance === 0.0) {\n    throw new DeveloperError(\n      \"EllipsoidRhumbLine must have distinct start and end set.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const ellipticity = this._ellipticity;\n  const heading = this._heading;\n  const start = this._start;\n\n  // If start and end have same latitude, return undefined since it's either no intersection or infinite intersections\n  if (\n    CesiumMath.equalsEpsilon(\n      Math.abs(heading),\n      CesiumMath.PI_OVER_TWO,\n      CesiumMath.EPSILON8\n    )\n  ) {\n    return;\n  }\n\n  // Can be solved using the same equations from interpolateUsingSurfaceDistance\n  const sigma1 = calculateSigma(ellipticity, start.latitude);\n  const sigma2 = calculateSigma(ellipticity, intersectionLatitude);\n  const deltaLongitude = Math.tan(heading) * (sigma2 - sigma1);\n  const longitude = CesiumMath.negativePiToPi(start.longitude + deltaLongitude);\n\n  if (defined(result)) {\n    result.longitude = longitude;\n    result.latitude = intersectionLatitude;\n    result.height = 0;\n\n    return result;\n  }\n\n  return new Cartographic(longitude, intersectionLatitude, 0);\n};\nexport default EllipsoidRhumbLine;\n", "import ApproximateTerrainHeights from \"./ApproximateTerrainHeights.js\";\nimport ArcType from \"./ArcType.js\";\nimport arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidGeodesic from \"./EllipsoidGeodesic.js\";\nimport EllipsoidRhumbLine from \"./EllipsoidRhumbLine.js\";\nimport EncodedCartesian3 from \"./EncodedCartesian3.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport IntersectionTests from \"./IntersectionTests.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Plane from \"./Plane.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport WebMercatorProjection from \"./WebMercatorProjection.js\";\n\nconst PROJECTIONS = [GeographicProjection, WebMercatorProjection];\nconst PROJECTION_COUNT = PROJECTIONS.length;\n\nconst MITER_BREAK_SMALL = Math.cos(CesiumMath.toRadians(30.0));\nconst MITER_BREAK_LARGE = Math.cos(CesiumMath.toRadians(150.0));\n\n// Initial heights for constructing the wall.\n// Keeping WALL_INITIAL_MIN_HEIGHT near the ellipsoid surface helps\n// prevent precision problems with planes in the shader.\n// Putting the start point of a plane at ApproximateTerrainHeights._defaultMinTerrainHeight,\n// which is a highly conservative bound, usually puts the plane origin several thousands\n// of meters away from the actual terrain, causing floating point problems when checking\n// fragments on terrain against the plane.\n// Ellipsoid height is generally much closer.\n// The initial max height is arbitrary.\n// Both heights are corrected using ApproximateTerrainHeights for computing the actual volume geometry.\nconst WALL_INITIAL_MIN_HEIGHT = 0.0;\nconst WALL_INITIAL_MAX_HEIGHT = 1000.0;\n\n/**\n * A description of a polyline on terrain or 3D Tiles. Only to be used with {@link GroundPolylinePrimitive}.\n *\n * @alias GroundPolylineGeometry\n * @constructor\n *\n * @param {object} options Options with the following properties:\n * @param {Cartesian3[]} options.positions An array of {@link Cartesian3} defining the polyline's points. Heights above the ellipsoid will be ignored.\n * @param {number} [options.width=1.0] The screen space width in pixels.\n * @param {number} [options.granularity=9999.0] The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation.\n * @param {boolean} [options.loop=false] Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\n *\n * @exception {DeveloperError} At least two positions are required.\n *\n * @see GroundPolylinePrimitive\n *\n * @example\n * const positions = Cesium.Cartesian3.fromDegreesArray([\n *   -112.1340164450331, 36.05494287836128,\n *   -112.08821010582645, 36.097804071380715,\n *   -112.13296079730024, 36.168769146801104\n * ]);\n *\n * const geometry = new Cesium.GroundPolylineGeometry({\n *   positions : positions\n * });\n */\nfunction GroundPolylineGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const positions = options.positions;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(positions) || positions.length < 2) {\n    throw new DeveloperError(\"At least two positions are required.\");\n  }\n  if (\n    defined(options.arcType) &&\n    options.arcType !== ArcType.GEODESIC &&\n    options.arcType !== ArcType.RHUMB\n  ) {\n    throw new DeveloperError(\n      \"Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  /**\n   * The screen space width in pixels.\n   * @type {number}\n   */\n  this.width = defaultValue(options.width, 1.0); // Doesn't get packed, not necessary for computing geometry.\n\n  this._positions = positions;\n\n  /**\n   * The distance interval used for interpolating options.points. Zero indicates no interpolation.\n   * Default of 9999.0 allows centimeter accuracy with 32 bit floating point.\n   * @type {boolean}\n   * @default 9999.0\n   */\n  this.granularity = defaultValue(options.granularity, 9999.0);\n\n  /**\n   * Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.\n   * If the geometry has two positions this parameter will be ignored.\n   * @type {boolean}\n   * @default false\n   */\n  this.loop = defaultValue(options.loop, false);\n\n  /**\n   * The type of path the polyline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\n   * @type {ArcType}\n   * @default ArcType.GEODESIC\n   */\n  this.arcType = defaultValue(options.arcType, ArcType.GEODESIC);\n\n  this._ellipsoid = Ellipsoid.WGS84;\n\n  // MapProjections can't be packed, so store the index to a known MapProjection.\n  this._projectionIndex = 0;\n  this._workerName = \"createGroundPolylineGeometry\";\n\n  // Used by GroundPolylinePrimitive to signal worker that scenemode is 3D only.\n  this._scene3DOnly = false;\n}\n\nObject.defineProperties(GroundPolylineGeometry.prototype, {\n  /**\n   * The number of elements used to pack the object into an array.\n   * @memberof GroundPolylineGeometry.prototype\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  packedLength: {\n    get: function () {\n      return (\n        1.0 +\n        this._positions.length * 3 +\n        1.0 +\n        1.0 +\n        1.0 +\n        Ellipsoid.packedLength +\n        1.0 +\n        1.0\n      );\n    },\n  },\n});\n\n/**\n * Set the GroundPolylineGeometry's projection and ellipsoid.\n * Used by GroundPolylinePrimitive to signal scene information to the geometry for generating 2D attributes.\n *\n * @param {GroundPolylineGeometry} groundPolylineGeometry GroundPolylinGeometry describing a polyline on terrain or 3D Tiles.\n * @param {Projection} mapProjection A MapProjection used for projecting cartographic coordinates to 2D.\n * @private\n */\nGroundPolylineGeometry.setProjectionAndEllipsoid = function (\n  groundPolylineGeometry,\n  mapProjection\n) {\n  let projectionIndex = 0;\n  for (let i = 0; i < PROJECTION_COUNT; i++) {\n    if (mapProjection instanceof PROJECTIONS[i]) {\n      projectionIndex = i;\n      break;\n    }\n  }\n\n  groundPolylineGeometry._projectionIndex = projectionIndex;\n  groundPolylineGeometry._ellipsoid = mapProjection.ellipsoid;\n};\n\nconst cart3Scratch1 = new Cartesian3();\nconst cart3Scratch2 = new Cartesian3();\nconst cart3Scratch3 = new Cartesian3();\nfunction computeRightNormal(start, end, maxHeight, ellipsoid, result) {\n  const startBottom = getPosition(ellipsoid, start, 0.0, cart3Scratch1);\n  const startTop = getPosition(ellipsoid, start, maxHeight, cart3Scratch2);\n  const endBottom = getPosition(ellipsoid, end, 0.0, cart3Scratch3);\n\n  const up = direction(startTop, startBottom, cart3Scratch2);\n  const forward = direction(endBottom, startBottom, cart3Scratch3);\n\n  Cartesian3.cross(forward, up, result);\n  return Cartesian3.normalize(result, result);\n}\n\nconst interpolatedCartographicScratch = new Cartographic();\nconst interpolatedBottomScratch = new Cartesian3();\nconst interpolatedTopScratch = new Cartesian3();\nconst interpolatedNormalScratch = new Cartesian3();\nfunction interpolateSegment(\n  start,\n  end,\n  minHeight,\n  maxHeight,\n  granularity,\n  arcType,\n  ellipsoid,\n  normalsArray,\n  bottomPositionsArray,\n  topPositionsArray,\n  cartographicsArray\n) {\n  if (granularity === 0.0) {\n    return;\n  }\n\n  let ellipsoidLine;\n  if (arcType === ArcType.GEODESIC) {\n    ellipsoidLine = new EllipsoidGeodesic(start, end, ellipsoid);\n  } else if (arcType === ArcType.RHUMB) {\n    ellipsoidLine = new EllipsoidRhumbLine(start, end, ellipsoid);\n  }\n\n  const surfaceDistance = ellipsoidLine.surfaceDistance;\n  if (surfaceDistance < granularity) {\n    return;\n  }\n\n  // Compute rightwards normal applicable at all interpolated points\n  const interpolatedNormal = computeRightNormal(\n    start,\n    end,\n    maxHeight,\n    ellipsoid,\n    interpolatedNormalScratch\n  );\n\n  const segments = Math.ceil(surfaceDistance / granularity);\n  const interpointDistance = surfaceDistance / segments;\n  let distanceFromStart = interpointDistance;\n  const pointsToAdd = segments - 1;\n  let packIndex = normalsArray.length;\n  for (let i = 0; i < pointsToAdd; i++) {\n    const interpolatedCartographic = ellipsoidLine.interpolateUsingSurfaceDistance(\n      distanceFromStart,\n      interpolatedCartographicScratch\n    );\n    const interpolatedBottom = getPosition(\n      ellipsoid,\n      interpolatedCartographic,\n      minHeight,\n      interpolatedBottomScratch\n    );\n    const interpolatedTop = getPosition(\n      ellipsoid,\n      interpolatedCartographic,\n      maxHeight,\n      interpolatedTopScratch\n    );\n\n    Cartesian3.pack(interpolatedNormal, normalsArray, packIndex);\n    Cartesian3.pack(interpolatedBottom, bottomPositionsArray, packIndex);\n    Cartesian3.pack(interpolatedTop, topPositionsArray, packIndex);\n    cartographicsArray.push(interpolatedCartographic.latitude);\n    cartographicsArray.push(interpolatedCartographic.longitude);\n\n    packIndex += 3;\n    distanceFromStart += interpointDistance;\n  }\n}\n\nconst heightlessCartographicScratch = new Cartographic();\nfunction getPosition(ellipsoid, cartographic, height, result) {\n  Cartographic.clone(cartographic, heightlessCartographicScratch);\n  heightlessCartographicScratch.height = height;\n  return Cartographic.toCartesian(\n    heightlessCartographicScratch,\n    ellipsoid,\n    result\n  );\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PolygonGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nGroundPolylineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  let index = defaultValue(startingIndex, 0);\n\n  const positions = value._positions;\n  const positionsLength = positions.length;\n\n  array[index++] = positionsLength;\n\n  for (let i = 0; i < positionsLength; ++i) {\n    const cartesian = positions[i];\n    Cartesian3.pack(cartesian, array, index);\n    index += 3;\n  }\n\n  array[index++] = value.granularity;\n  array[index++] = value.loop ? 1.0 : 0.0;\n  array[index++] = value.arcType;\n\n  Ellipsoid.pack(value._ellipsoid, array, index);\n  index += Ellipsoid.packedLength;\n\n  array[index++] = value._projectionIndex;\n  array[index++] = value._scene3DOnly ? 1.0 : 0.0;\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PolygonGeometry} [result] The object into which to store the result.\n */\nGroundPolylineGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  let index = defaultValue(startingIndex, 0);\n  const positionsLength = array[index++];\n  const positions = new Array(positionsLength);\n\n  for (let i = 0; i < positionsLength; i++) {\n    positions[i] = Cartesian3.unpack(array, index);\n    index += 3;\n  }\n\n  const granularity = array[index++];\n  const loop = array[index++] === 1.0;\n  const arcType = array[index++];\n\n  const ellipsoid = Ellipsoid.unpack(array, index);\n  index += Ellipsoid.packedLength;\n\n  const projectionIndex = array[index++];\n  const scene3DOnly = array[index++] === 1.0;\n\n  if (!defined(result)) {\n    result = new GroundPolylineGeometry({\n      positions: positions,\n    });\n  }\n\n  result._positions = positions;\n  result.granularity = granularity;\n  result.loop = loop;\n  result.arcType = arcType;\n  result._ellipsoid = ellipsoid;\n  result._projectionIndex = projectionIndex;\n  result._scene3DOnly = scene3DOnly;\n\n  return result;\n};\n\nfunction direction(target, origin, result) {\n  Cartesian3.subtract(target, origin, result);\n  Cartesian3.normalize(result, result);\n  return result;\n}\n\nfunction tangentDirection(target, origin, up, result) {\n  result = direction(target, origin, result);\n\n  // orthogonalize\n  result = Cartesian3.cross(result, up, result);\n  result = Cartesian3.normalize(result, result);\n  result = Cartesian3.cross(up, result, result);\n  return result;\n}\n\nconst toPreviousScratch = new Cartesian3();\nconst toNextScratch = new Cartesian3();\nconst forwardScratch = new Cartesian3();\nconst vertexUpScratch = new Cartesian3();\nconst cosine90 = 0.0;\nconst cosine180 = -1.0;\nfunction computeVertexMiterNormal(\n  previousBottom,\n  vertexBottom,\n  vertexTop,\n  nextBottom,\n  result\n) {\n  const up = direction(vertexTop, vertexBottom, vertexUpScratch);\n\n  // Compute vectors pointing towards neighboring points but tangent to this point on the ellipsoid\n  const toPrevious = tangentDirection(\n    previousBottom,\n    vertexBottom,\n    up,\n    toPreviousScratch\n  );\n  const toNext = tangentDirection(nextBottom, vertexBottom, up, toNextScratch);\n\n  // Check if tangents are almost opposite - if so, no need to miter.\n  if (\n    CesiumMath.equalsEpsilon(\n      Cartesian3.dot(toPrevious, toNext),\n      cosine180,\n      CesiumMath.EPSILON5\n    )\n  ) {\n    result = Cartesian3.cross(up, toPrevious, result);\n    result = Cartesian3.normalize(result, result);\n    return result;\n  }\n\n  // Average directions to previous and to next in the plane of Up\n  result = Cartesian3.add(toNext, toPrevious, result);\n  result = Cartesian3.normalize(result, result);\n\n  // Flip the normal if it isn't pointing roughly bound right (aka if forward is pointing more \"backwards\")\n  const forward = Cartesian3.cross(up, result, forwardScratch);\n  if (Cartesian3.dot(toNext, forward) < cosine90) {\n    result = Cartesian3.negate(result, result);\n  }\n\n  return result;\n}\n\nconst XZ_PLANE = Plane.fromPointNormal(Cartesian3.ZERO, Cartesian3.UNIT_Y);\n\nconst previousBottomScratch = new Cartesian3();\nconst vertexBottomScratch = new Cartesian3();\nconst vertexTopScratch = new Cartesian3();\nconst nextBottomScratch = new Cartesian3();\nconst vertexNormalScratch = new Cartesian3();\nconst intersectionScratch = new Cartesian3();\nconst cartographicScratch0 = new Cartographic();\nconst cartographicScratch1 = new Cartographic();\nconst cartographicIntersectionScratch = new Cartographic();\n/**\n * Computes shadow volumes for the ground polyline, consisting of its vertices, indices, and a bounding sphere.\n * Vertices are \"fat,\" packing all the data needed in each volume to describe a line on terrain or 3D Tiles.\n * Should not be called independent of {@link GroundPolylinePrimitive}.\n *\n * @param {GroundPolylineGeometry} groundPolylineGeometry\n * @private\n */\nGroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) {\n  const compute2dAttributes = !groundPolylineGeometry._scene3DOnly;\n  let loop = groundPolylineGeometry.loop;\n  const ellipsoid = groundPolylineGeometry._ellipsoid;\n  const granularity = groundPolylineGeometry.granularity;\n  const arcType = groundPolylineGeometry.arcType;\n  const projection = new PROJECTIONS[groundPolylineGeometry._projectionIndex](\n    ellipsoid\n  );\n\n  const minHeight = WALL_INITIAL_MIN_HEIGHT;\n  const maxHeight = WALL_INITIAL_MAX_HEIGHT;\n\n  let index;\n  let i;\n\n  const positions = groundPolylineGeometry._positions;\n  const positionsLength = positions.length;\n\n  if (positionsLength === 2) {\n    loop = false;\n  }\n\n  // Split positions across the IDL and the Prime Meridian as well.\n  // Split across prime meridian because very large geometries crossing the Prime Meridian but not the IDL\n  // may get split by the plane of IDL + Prime Meridian.\n  let p0;\n  let p1;\n  let c0;\n  let c1;\n  const rhumbLine = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);\n  let intersection;\n  let intersectionCartographic;\n  let intersectionLongitude;\n  const splitPositions = [positions[0]];\n  for (i = 0; i < positionsLength - 1; i++) {\n    p0 = positions[i];\n    p1 = positions[i + 1];\n    intersection = IntersectionTests.lineSegmentPlane(\n      p0,\n      p1,\n      XZ_PLANE,\n      intersectionScratch\n    );\n    if (\n      defined(intersection) &&\n      !Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&\n      !Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)\n    ) {\n      if (groundPolylineGeometry.arcType === ArcType.GEODESIC) {\n        splitPositions.push(Cartesian3.clone(intersection));\n      } else if (groundPolylineGeometry.arcType === ArcType.RHUMB) {\n        intersectionLongitude = ellipsoid.cartesianToCartographic(\n          intersection,\n          cartographicScratch0\n        ).longitude;\n        c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);\n        c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);\n        rhumbLine.setEndPoints(c0, c1);\n        intersectionCartographic = rhumbLine.findIntersectionWithLongitude(\n          intersectionLongitude,\n          cartographicIntersectionScratch\n        );\n        intersection = ellipsoid.cartographicToCartesian(\n          intersectionCartographic,\n          intersectionScratch\n        );\n        if (\n          defined(intersection) &&\n          !Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&\n          !Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)\n        ) {\n          splitPositions.push(Cartesian3.clone(intersection));\n        }\n      }\n    }\n    splitPositions.push(p1);\n  }\n\n  if (loop) {\n    p0 = positions[positionsLength - 1];\n    p1 = positions[0];\n    intersection = IntersectionTests.lineSegmentPlane(\n      p0,\n      p1,\n      XZ_PLANE,\n      intersectionScratch\n    );\n    if (\n      defined(intersection) &&\n      !Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&\n      !Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)\n    ) {\n      if (groundPolylineGeometry.arcType === ArcType.GEODESIC) {\n        splitPositions.push(Cartesian3.clone(intersection));\n      } else if (groundPolylineGeometry.arcType === ArcType.RHUMB) {\n        intersectionLongitude = ellipsoid.cartesianToCartographic(\n          intersection,\n          cartographicScratch0\n        ).longitude;\n        c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);\n        c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);\n        rhumbLine.setEndPoints(c0, c1);\n        intersectionCartographic = rhumbLine.findIntersectionWithLongitude(\n          intersectionLongitude,\n          cartographicIntersectionScratch\n        );\n        intersection = ellipsoid.cartographicToCartesian(\n          intersectionCartographic,\n          intersectionScratch\n        );\n        if (\n          defined(intersection) &&\n          !Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&\n          !Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)\n        ) {\n          splitPositions.push(Cartesian3.clone(intersection));\n        }\n      }\n    }\n  }\n  let cartographicsLength = splitPositions.length;\n\n  let cartographics = new Array(cartographicsLength);\n  for (i = 0; i < cartographicsLength; i++) {\n    const cartographic = Cartographic.fromCartesian(\n      splitPositions[i],\n      ellipsoid\n    );\n    cartographic.height = 0.0;\n    cartographics[i] = cartographic;\n  }\n\n  cartographics = arrayRemoveDuplicates(\n    cartographics,\n    Cartographic.equalsEpsilon\n  );\n  cartographicsLength = cartographics.length;\n\n  if (cartographicsLength < 2) {\n    return undefined;\n  }\n\n  /**** Build heap-side arrays for positions, interpolated cartographics, and normals from which to compute vertices ****/\n  // We build a \"wall\" and then decompose it into separately connected component \"volumes\" because we need a lot\n  // of information about the wall. Also, this simplifies interpolation.\n  // Convention: \"next\" and \"end\" are locally forward to each segment of the wall,\n  // and we are computing normals pointing towards the local right side of the vertices in each segment.\n  const cartographicsArray = [];\n  const normalsArray = [];\n  const bottomPositionsArray = [];\n  const topPositionsArray = [];\n\n  let previousBottom = previousBottomScratch;\n  let vertexBottom = vertexBottomScratch;\n  let vertexTop = vertexTopScratch;\n  let nextBottom = nextBottomScratch;\n  let vertexNormal = vertexNormalScratch;\n\n  // First point - either loop or attach a \"perpendicular\" normal\n  const startCartographic = cartographics[0];\n  const nextCartographic = cartographics[1];\n\n  const prestartCartographic = cartographics[cartographicsLength - 1];\n  previousBottom = getPosition(\n    ellipsoid,\n    prestartCartographic,\n    minHeight,\n    previousBottom\n  );\n  nextBottom = getPosition(ellipsoid, nextCartographic, minHeight, nextBottom);\n  vertexBottom = getPosition(\n    ellipsoid,\n    startCartographic,\n    minHeight,\n    vertexBottom\n  );\n  vertexTop = getPosition(ellipsoid, startCartographic, maxHeight, vertexTop);\n\n  if (loop) {\n    vertexNormal = computeVertexMiterNormal(\n      previousBottom,\n      vertexBottom,\n      vertexTop,\n      nextBottom,\n      vertexNormal\n    );\n  } else {\n    vertexNormal = computeRightNormal(\n      startCartographic,\n      nextCartographic,\n      maxHeight,\n      ellipsoid,\n      vertexNormal\n    );\n  }\n\n  Cartesian3.pack(vertexNormal, normalsArray, 0);\n  Cartesian3.pack(vertexBottom, bottomPositionsArray, 0);\n  Cartesian3.pack(vertexTop, topPositionsArray, 0);\n  cartographicsArray.push(startCartographic.latitude);\n  cartographicsArray.push(startCartographic.longitude);\n\n  interpolateSegment(\n    startCartographic,\n    nextCartographic,\n    minHeight,\n    maxHeight,\n    granularity,\n    arcType,\n    ellipsoid,\n    normalsArray,\n    bottomPositionsArray,\n    topPositionsArray,\n    cartographicsArray\n  );\n\n  // All inbetween points\n  for (i = 1; i < cartographicsLength - 1; ++i) {\n    previousBottom = Cartesian3.clone(vertexBottom, previousBottom);\n    vertexBottom = Cartesian3.clone(nextBottom, vertexBottom);\n    const vertexCartographic = cartographics[i];\n    getPosition(ellipsoid, vertexCartographic, maxHeight, vertexTop);\n    getPosition(ellipsoid, cartographics[i + 1], minHeight, nextBottom);\n\n    computeVertexMiterNormal(\n      previousBottom,\n      vertexBottom,\n      vertexTop,\n      nextBottom,\n      vertexNormal\n    );\n\n    index = normalsArray.length;\n    Cartesian3.pack(vertexNormal, normalsArray, index);\n    Cartesian3.pack(vertexBottom, bottomPositionsArray, index);\n    Cartesian3.pack(vertexTop, topPositionsArray, index);\n    cartographicsArray.push(vertexCartographic.latitude);\n    cartographicsArray.push(vertexCartographic.longitude);\n\n    interpolateSegment(\n      cartographics[i],\n      cartographics[i + 1],\n      minHeight,\n      maxHeight,\n      granularity,\n      arcType,\n      ellipsoid,\n      normalsArray,\n      bottomPositionsArray,\n      topPositionsArray,\n      cartographicsArray\n    );\n  }\n\n  // Last point - either loop or attach a normal \"perpendicular\" to the wall.\n  const endCartographic = cartographics[cartographicsLength - 1];\n  const preEndCartographic = cartographics[cartographicsLength - 2];\n\n  vertexBottom = getPosition(\n    ellipsoid,\n    endCartographic,\n    minHeight,\n    vertexBottom\n  );\n  vertexTop = getPosition(ellipsoid, endCartographic, maxHeight, vertexTop);\n\n  if (loop) {\n    const postEndCartographic = cartographics[0];\n    previousBottom = getPosition(\n      ellipsoid,\n      preEndCartographic,\n      minHeight,\n      previousBottom\n    );\n    nextBottom = getPosition(\n      ellipsoid,\n      postEndCartographic,\n      minHeight,\n      nextBottom\n    );\n\n    vertexNormal = computeVertexMiterNormal(\n      previousBottom,\n      vertexBottom,\n      vertexTop,\n      nextBottom,\n      vertexNormal\n    );\n  } else {\n    vertexNormal = computeRightNormal(\n      preEndCartographic,\n      endCartographic,\n      maxHeight,\n      ellipsoid,\n      vertexNormal\n    );\n  }\n\n  index = normalsArray.length;\n  Cartesian3.pack(vertexNormal, normalsArray, index);\n  Cartesian3.pack(vertexBottom, bottomPositionsArray, index);\n  Cartesian3.pack(vertexTop, topPositionsArray, index);\n  cartographicsArray.push(endCartographic.latitude);\n  cartographicsArray.push(endCartographic.longitude);\n\n  if (loop) {\n    interpolateSegment(\n      endCartographic,\n      startCartographic,\n      minHeight,\n      maxHeight,\n      granularity,\n      arcType,\n      ellipsoid,\n      normalsArray,\n      bottomPositionsArray,\n      topPositionsArray,\n      cartographicsArray\n    );\n    index = normalsArray.length;\n    for (i = 0; i < 3; ++i) {\n      normalsArray[index + i] = normalsArray[i];\n      bottomPositionsArray[index + i] = bottomPositionsArray[i];\n      topPositionsArray[index + i] = topPositionsArray[i];\n    }\n    cartographicsArray.push(startCartographic.latitude);\n    cartographicsArray.push(startCartographic.longitude);\n  }\n\n  return generateGeometryAttributes(\n    loop,\n    projection,\n    bottomPositionsArray,\n    topPositionsArray,\n    normalsArray,\n    cartographicsArray,\n    compute2dAttributes\n  );\n};\n\n// If the end normal angle is too steep compared to the direction of the line segment,\n// \"break\" the miter by rotating the normal 90 degrees around the \"up\" direction at the point\n// For ultra precision we would want to project into a plane, but in practice this is sufficient.\nconst lineDirectionScratch = new Cartesian3();\nconst matrix3Scratch = new Matrix3();\nconst quaternionScratch = new Quaternion();\nfunction breakMiter(endGeometryNormal, startBottom, endBottom, endTop) {\n  const lineDirection = direction(endBottom, startBottom, lineDirectionScratch);\n\n  const dot = Cartesian3.dot(lineDirection, endGeometryNormal);\n  if (dot > MITER_BREAK_SMALL || dot < MITER_BREAK_LARGE) {\n    const vertexUp = direction(endTop, endBottom, vertexUpScratch);\n    const angle =\n      dot < MITER_BREAK_LARGE\n        ? CesiumMath.PI_OVER_TWO\n        : -CesiumMath.PI_OVER_TWO;\n    const quaternion = Quaternion.fromAxisAngle(\n      vertexUp,\n      angle,\n      quaternionScratch\n    );\n    const rotationMatrix = Matrix3.fromQuaternion(quaternion, matrix3Scratch);\n    Matrix3.multiplyByVector(\n      rotationMatrix,\n      endGeometryNormal,\n      endGeometryNormal\n    );\n    return true;\n  }\n  return false;\n}\n\nconst endPosCartographicScratch = new Cartographic();\nconst normalStartpointScratch = new Cartesian3();\nconst normalEndpointScratch = new Cartesian3();\nfunction projectNormal(\n  projection,\n  cartographic,\n  normal,\n  projectedPosition,\n  result\n) {\n  const position = Cartographic.toCartesian(\n    cartographic,\n    projection._ellipsoid,\n    normalStartpointScratch\n  );\n  let normalEndpoint = Cartesian3.add(position, normal, normalEndpointScratch);\n  let flipNormal = false;\n\n  const ellipsoid = projection._ellipsoid;\n  let normalEndpointCartographic = ellipsoid.cartesianToCartographic(\n    normalEndpoint,\n    endPosCartographicScratch\n  );\n  // If normal crosses the IDL, go the other way and flip the result.\n  // In practice this almost never happens because the cartographic start\n  // and end points of each segment are \"nudged\" to be on the same side\n  // of the IDL and slightly away from the IDL.\n  if (\n    Math.abs(cartographic.longitude - normalEndpointCartographic.longitude) >\n    CesiumMath.PI_OVER_TWO\n  ) {\n    flipNormal = true;\n    normalEndpoint = Cartesian3.subtract(\n      position,\n      normal,\n      normalEndpointScratch\n    );\n    normalEndpointCartographic = ellipsoid.cartesianToCartographic(\n      normalEndpoint,\n      endPosCartographicScratch\n    );\n  }\n\n  normalEndpointCartographic.height = 0.0;\n  const normalEndpointProjected = projection.project(\n    normalEndpointCartographic,\n    result\n  );\n  result = Cartesian3.subtract(\n    normalEndpointProjected,\n    projectedPosition,\n    result\n  );\n  result.z = 0.0;\n  result = Cartesian3.normalize(result, result);\n  if (flipNormal) {\n    Cartesian3.negate(result, result);\n  }\n  return result;\n}\n\nconst adjustHeightNormalScratch = new Cartesian3();\nconst adjustHeightOffsetScratch = new Cartesian3();\nfunction adjustHeights(\n  bottom,\n  top,\n  minHeight,\n  maxHeight,\n  adjustHeightBottom,\n  adjustHeightTop\n) {\n  // bottom and top should be at WALL_INITIAL_MIN_HEIGHT and WALL_INITIAL_MAX_HEIGHT, respectively\n  const adjustHeightNormal = Cartesian3.subtract(\n    top,\n    bottom,\n    adjustHeightNormalScratch\n  );\n  Cartesian3.normalize(adjustHeightNormal, adjustHeightNormal);\n\n  const distanceForBottom = minHeight - WALL_INITIAL_MIN_HEIGHT;\n  let adjustHeightOffset = Cartesian3.multiplyByScalar(\n    adjustHeightNormal,\n    distanceForBottom,\n    adjustHeightOffsetScratch\n  );\n  Cartesian3.add(bottom, adjustHeightOffset, adjustHeightBottom);\n\n  const distanceForTop = maxHeight - WALL_INITIAL_MAX_HEIGHT;\n  adjustHeightOffset = Cartesian3.multiplyByScalar(\n    adjustHeightNormal,\n    distanceForTop,\n    adjustHeightOffsetScratch\n  );\n  Cartesian3.add(top, adjustHeightOffset, adjustHeightTop);\n}\n\nconst nudgeDirectionScratch = new Cartesian3();\nfunction nudgeXZ(start, end) {\n  const startToXZdistance = Plane.getPointDistance(XZ_PLANE, start);\n  const endToXZdistance = Plane.getPointDistance(XZ_PLANE, end);\n  let offset = nudgeDirectionScratch;\n  // Larger epsilon than what's used in GeometryPipeline, a centimeter in world space\n  if (CesiumMath.equalsEpsilon(startToXZdistance, 0.0, CesiumMath.EPSILON2)) {\n    offset = direction(end, start, offset);\n    Cartesian3.multiplyByScalar(offset, CesiumMath.EPSILON2, offset);\n    Cartesian3.add(start, offset, start);\n  } else if (\n    CesiumMath.equalsEpsilon(endToXZdistance, 0.0, CesiumMath.EPSILON2)\n  ) {\n    offset = direction(start, end, offset);\n    Cartesian3.multiplyByScalar(offset, CesiumMath.EPSILON2, offset);\n    Cartesian3.add(end, offset, end);\n  }\n}\n\n// \"Nudge\" cartographic coordinates so start and end are on the same side of the IDL.\n// Nudge amounts are tiny, basically just an IDL flip.\n// Only used for 2D/CV.\nfunction nudgeCartographic(start, end) {\n  const absStartLon = Math.abs(start.longitude);\n  const absEndLon = Math.abs(end.longitude);\n  if (\n    CesiumMath.equalsEpsilon(absStartLon, CesiumMath.PI, CesiumMath.EPSILON11)\n  ) {\n    const endSign = CesiumMath.sign(end.longitude);\n    start.longitude = endSign * (absStartLon - CesiumMath.EPSILON11);\n    return 1;\n  } else if (\n    CesiumMath.equalsEpsilon(absEndLon, CesiumMath.PI, CesiumMath.EPSILON11)\n  ) {\n    const startSign = CesiumMath.sign(start.longitude);\n    end.longitude = startSign * (absEndLon - CesiumMath.EPSILON11);\n    return 2;\n  }\n  return 0;\n}\n\nconst startCartographicScratch = new Cartographic();\nconst endCartographicScratch = new Cartographic();\n\nconst segmentStartTopScratch = new Cartesian3();\nconst segmentEndTopScratch = new Cartesian3();\nconst segmentStartBottomScratch = new Cartesian3();\nconst segmentEndBottomScratch = new Cartesian3();\nconst segmentStartNormalScratch = new Cartesian3();\nconst segmentEndNormalScratch = new Cartesian3();\n\nconst getHeightCartographics = [\n  startCartographicScratch,\n  endCartographicScratch,\n];\nconst getHeightRectangleScratch = new Rectangle();\n\nconst adjustHeightStartTopScratch = new Cartesian3();\nconst adjustHeightEndTopScratch = new Cartesian3();\nconst adjustHeightStartBottomScratch = new Cartesian3();\nconst adjustHeightEndBottomScratch = new Cartesian3();\n\nconst segmentStart2DScratch = new Cartesian3();\nconst segmentEnd2DScratch = new Cartesian3();\nconst segmentStartNormal2DScratch = new Cartesian3();\nconst segmentEndNormal2DScratch = new Cartesian3();\n\nconst offsetScratch = new Cartesian3();\nconst startUpScratch = new Cartesian3();\nconst endUpScratch = new Cartesian3();\nconst rightScratch = new Cartesian3();\nconst startPlaneNormalScratch = new Cartesian3();\nconst endPlaneNormalScratch = new Cartesian3();\nconst encodeScratch = new EncodedCartesian3();\n\nconst encodeScratch2D = new EncodedCartesian3();\nconst forwardOffset2DScratch = new Cartesian3();\nconst right2DScratch = new Cartesian3();\n\nconst normalNudgeScratch = new Cartesian3();\n\nconst scratchBoundingSpheres = [new BoundingSphere(), new BoundingSphere()];\n\n// Winding order is reversed so each segment's volume is inside-out\nconst REFERENCE_INDICES = [\n  0,\n  2,\n  1,\n  0,\n  3,\n  2, // right\n  0,\n  7,\n  3,\n  0,\n  4,\n  7, // start\n  0,\n  5,\n  4,\n  0,\n  1,\n  5, // bottom\n  5,\n  7,\n  4,\n  5,\n  6,\n  7, // left\n  5,\n  2,\n  6,\n  5,\n  1,\n  2, // end\n  3,\n  6,\n  2,\n  3,\n  7,\n  6, // top\n];\nconst REFERENCE_INDICES_LENGTH = REFERENCE_INDICES.length;\n\n// Decompose the \"wall\" into a series of shadow volumes.\n// Each shadow volume's vertices encode a description of the line it contains,\n// including mitering planes at the end points, a plane along the line itself,\n// and attributes for computing length-wise texture coordinates.\nfunction generateGeometryAttributes(\n  loop,\n  projection,\n  bottomPositionsArray,\n  topPositionsArray,\n  normalsArray,\n  cartographicsArray,\n  compute2dAttributes\n) {\n  let i;\n  let index;\n  const ellipsoid = projection._ellipsoid;\n\n  // Each segment will have 8 vertices\n  const segmentCount = bottomPositionsArray.length / 3 - 1;\n  const vertexCount = segmentCount * 8;\n  const arraySizeVec4 = vertexCount * 4;\n  const indexCount = segmentCount * 36;\n\n  const indices =\n    vertexCount > 65535\n      ? new Uint32Array(indexCount)\n      : new Uint16Array(indexCount);\n  const positionsArray = new Float64Array(vertexCount * 3);\n\n  const startHiAndForwardOffsetX = new Float32Array(arraySizeVec4);\n  const startLoAndForwardOffsetY = new Float32Array(arraySizeVec4);\n  const startNormalAndForwardOffsetZ = new Float32Array(arraySizeVec4);\n  const endNormalAndTextureCoordinateNormalizationX = new Float32Array(\n    arraySizeVec4\n  );\n  const rightNormalAndTextureCoordinateNormalizationY = new Float32Array(\n    arraySizeVec4\n  );\n\n  let startHiLo2D;\n  let offsetAndRight2D;\n  let startEndNormals2D;\n  let texcoordNormalization2D;\n\n  if (compute2dAttributes) {\n    startHiLo2D = new Float32Array(arraySizeVec4);\n    offsetAndRight2D = new Float32Array(arraySizeVec4);\n    startEndNormals2D = new Float32Array(arraySizeVec4);\n    texcoordNormalization2D = new Float32Array(vertexCount * 2);\n  }\n\n  /*** Compute total lengths for texture coordinate normalization ***/\n  // 2D\n  const cartographicsLength = cartographicsArray.length / 2;\n  let length2D = 0.0;\n\n  const startCartographic = startCartographicScratch;\n  startCartographic.height = 0.0;\n  const endCartographic = endCartographicScratch;\n  endCartographic.height = 0.0;\n\n  let segmentStartCartesian = segmentStartTopScratch;\n  let segmentEndCartesian = segmentEndTopScratch;\n\n  if (compute2dAttributes) {\n    index = 0;\n    for (i = 1; i < cartographicsLength; i++) {\n      // Don't clone anything from previous segment b/c possible IDL touch\n      startCartographic.latitude = cartographicsArray[index];\n      startCartographic.longitude = cartographicsArray[index + 1];\n      endCartographic.latitude = cartographicsArray[index + 2];\n      endCartographic.longitude = cartographicsArray[index + 3];\n\n      segmentStartCartesian = projection.project(\n        startCartographic,\n        segmentStartCartesian\n      );\n      segmentEndCartesian = projection.project(\n        endCartographic,\n        segmentEndCartesian\n      );\n      length2D += Cartesian3.distance(\n        segmentStartCartesian,\n        segmentEndCartesian\n      );\n      index += 2;\n    }\n  }\n\n  // 3D\n  const positionsLength = topPositionsArray.length / 3;\n  segmentEndCartesian = Cartesian3.unpack(\n    topPositionsArray,\n    0,\n    segmentEndCartesian\n  );\n  let length3D = 0.0;\n\n  index = 3;\n  for (i = 1; i < positionsLength; i++) {\n    segmentStartCartesian = Cartesian3.clone(\n      segmentEndCartesian,\n      segmentStartCartesian\n    );\n    segmentEndCartesian = Cartesian3.unpack(\n      topPositionsArray,\n      index,\n      segmentEndCartesian\n    );\n    length3D += Cartesian3.distance(segmentStartCartesian, segmentEndCartesian);\n    index += 3;\n  }\n\n  /*** Generate segments ***/\n  let j;\n  index = 3;\n  let cartographicsIndex = 0;\n  let vec2sWriteIndex = 0;\n  let vec3sWriteIndex = 0;\n  let vec4sWriteIndex = 0;\n  let miterBroken = false;\n\n  let endBottom = Cartesian3.unpack(\n    bottomPositionsArray,\n    0,\n    segmentEndBottomScratch\n  );\n  let endTop = Cartesian3.unpack(topPositionsArray, 0, segmentEndTopScratch);\n  let endGeometryNormal = Cartesian3.unpack(\n    normalsArray,\n    0,\n    segmentEndNormalScratch\n  );\n\n  if (loop) {\n    const preEndBottom = Cartesian3.unpack(\n      bottomPositionsArray,\n      bottomPositionsArray.length - 6,\n      segmentStartBottomScratch\n    );\n    if (breakMiter(endGeometryNormal, preEndBottom, endBottom, endTop)) {\n      // Miter broken as if for the last point in the loop, needs to be inverted for first point (clone of endBottom)\n      endGeometryNormal = Cartesian3.negate(\n        endGeometryNormal,\n        endGeometryNormal\n      );\n    }\n  }\n\n  let lengthSoFar3D = 0.0;\n  let lengthSoFar2D = 0.0;\n\n  // For translating bounding volume\n  let sumHeights = 0.0;\n\n  for (i = 0; i < segmentCount; i++) {\n    const startBottom = Cartesian3.clone(endBottom, segmentStartBottomScratch);\n    const startTop = Cartesian3.clone(endTop, segmentStartTopScratch);\n    let startGeometryNormal = Cartesian3.clone(\n      endGeometryNormal,\n      segmentStartNormalScratch\n    );\n\n    if (miterBroken) {\n      startGeometryNormal = Cartesian3.negate(\n        startGeometryNormal,\n        startGeometryNormal\n      );\n    }\n\n    endBottom = Cartesian3.unpack(\n      bottomPositionsArray,\n      index,\n      segmentEndBottomScratch\n    );\n    endTop = Cartesian3.unpack(topPositionsArray, index, segmentEndTopScratch);\n    endGeometryNormal = Cartesian3.unpack(\n      normalsArray,\n      index,\n      segmentEndNormalScratch\n    );\n\n    miterBroken = breakMiter(endGeometryNormal, startBottom, endBottom, endTop);\n\n    // 2D - don't clone anything from previous segment b/c possible IDL touch\n    startCartographic.latitude = cartographicsArray[cartographicsIndex];\n    startCartographic.longitude = cartographicsArray[cartographicsIndex + 1];\n    endCartographic.latitude = cartographicsArray[cartographicsIndex + 2];\n    endCartographic.longitude = cartographicsArray[cartographicsIndex + 3];\n    let start2D;\n    let end2D;\n    let startGeometryNormal2D;\n    let endGeometryNormal2D;\n\n    if (compute2dAttributes) {\n      const nudgeResult = nudgeCartographic(startCartographic, endCartographic);\n      start2D = projection.project(startCartographic, segmentStart2DScratch);\n      end2D = projection.project(endCartographic, segmentEnd2DScratch);\n      const direction2D = direction(end2D, start2D, forwardOffset2DScratch);\n      direction2D.y = Math.abs(direction2D.y);\n\n      startGeometryNormal2D = segmentStartNormal2DScratch;\n      endGeometryNormal2D = segmentEndNormal2DScratch;\n      if (\n        nudgeResult === 0 ||\n        Cartesian3.dot(direction2D, Cartesian3.UNIT_Y) > MITER_BREAK_SMALL\n      ) {\n        // No nudge - project the original normal\n        // Or, if the line's angle relative to the IDL is very acute,\n        // in which case snapping will produce oddly shaped volumes.\n        startGeometryNormal2D = projectNormal(\n          projection,\n          startCartographic,\n          startGeometryNormal,\n          start2D,\n          segmentStartNormal2DScratch\n        );\n        endGeometryNormal2D = projectNormal(\n          projection,\n          endCartographic,\n          endGeometryNormal,\n          end2D,\n          segmentEndNormal2DScratch\n        );\n      } else if (nudgeResult === 1) {\n        // Start is close to IDL - snap start normal to align with IDL\n        endGeometryNormal2D = projectNormal(\n          projection,\n          endCartographic,\n          endGeometryNormal,\n          end2D,\n          segmentEndNormal2DScratch\n        );\n        startGeometryNormal2D.x = 0.0;\n        // If start longitude is negative and end longitude is less negative, relative right is unit -Y\n        // If start longitude is positive and end longitude is less positive, relative right is unit +Y\n        startGeometryNormal2D.y = CesiumMath.sign(\n          startCartographic.longitude - Math.abs(endCartographic.longitude)\n        );\n        startGeometryNormal2D.z = 0.0;\n      } else {\n        // End is close to IDL - snap end normal to align with IDL\n        startGeometryNormal2D = projectNormal(\n          projection,\n          startCartographic,\n          startGeometryNormal,\n          start2D,\n          segmentStartNormal2DScratch\n        );\n        endGeometryNormal2D.x = 0.0;\n        // If end longitude is negative and start longitude is less negative, relative right is unit Y\n        // If end longitude is positive and start longitude is less positive, relative right is unit -Y\n        endGeometryNormal2D.y = CesiumMath.sign(\n          startCartographic.longitude - endCartographic.longitude\n        );\n        endGeometryNormal2D.z = 0.0;\n      }\n    }\n\n    /****************************************\n     * Geometry descriptors of a \"line on terrain,\"\n     * as opposed to the \"shadow volume used to draw\n     * the line on terrain\":\n     * - position of start + offset to end\n     * - start, end, and right-facing planes\n     * - encoded texture coordinate offsets\n     ****************************************/\n\n    /* 3D */\n    const segmentLength3D = Cartesian3.distance(startTop, endTop);\n\n    const encodedStart = EncodedCartesian3.fromCartesian(\n      startBottom,\n      encodeScratch\n    );\n    const forwardOffset = Cartesian3.subtract(\n      endBottom,\n      startBottom,\n      offsetScratch\n    );\n    const forward = Cartesian3.normalize(forwardOffset, rightScratch);\n\n    let startUp = Cartesian3.subtract(startTop, startBottom, startUpScratch);\n    startUp = Cartesian3.normalize(startUp, startUp);\n    let rightNormal = Cartesian3.cross(forward, startUp, rightScratch);\n    rightNormal = Cartesian3.normalize(rightNormal, rightNormal);\n\n    let startPlaneNormal = Cartesian3.cross(\n      startUp,\n      startGeometryNormal,\n      startPlaneNormalScratch\n    );\n    startPlaneNormal = Cartesian3.normalize(startPlaneNormal, startPlaneNormal);\n\n    let endUp = Cartesian3.subtract(endTop, endBottom, endUpScratch);\n    endUp = Cartesian3.normalize(endUp, endUp);\n    let endPlaneNormal = Cartesian3.cross(\n      endGeometryNormal,\n      endUp,\n      endPlaneNormalScratch\n    );\n    endPlaneNormal = Cartesian3.normalize(endPlaneNormal, endPlaneNormal);\n\n    const texcoordNormalization3DX = segmentLength3D / length3D;\n    const texcoordNormalization3DY = lengthSoFar3D / length3D;\n\n    /* 2D */\n    let segmentLength2D = 0.0;\n    let encodedStart2D;\n    let forwardOffset2D;\n    let right2D;\n    let texcoordNormalization2DX = 0.0;\n    let texcoordNormalization2DY = 0.0;\n    if (compute2dAttributes) {\n      segmentLength2D = Cartesian3.distance(start2D, end2D);\n\n      encodedStart2D = EncodedCartesian3.fromCartesian(\n        start2D,\n        encodeScratch2D\n      );\n      forwardOffset2D = Cartesian3.subtract(\n        end2D,\n        start2D,\n        forwardOffset2DScratch\n      );\n\n      // Right direction is just forward direction rotated by -90 degrees around Z\n      // Similarly with plane normals\n      right2D = Cartesian3.normalize(forwardOffset2D, right2DScratch);\n      const swap = right2D.x;\n      right2D.x = right2D.y;\n      right2D.y = -swap;\n\n      texcoordNormalization2DX = segmentLength2D / length2D;\n      texcoordNormalization2DY = lengthSoFar2D / length2D;\n    }\n    /** Pack **/\n    for (j = 0; j < 8; j++) {\n      const vec4Index = vec4sWriteIndex + j * 4;\n      const vec2Index = vec2sWriteIndex + j * 2;\n      const wIndex = vec4Index + 3;\n\n      // Encode sidedness of vertex relative to right plane in texture coordinate normalization X,\n      // whether vertex is top or bottom of volume in sign/magnitude of normalization Y.\n      const rightPlaneSide = j < 4 ? 1.0 : -1.0;\n      const topBottomSide =\n        j === 2 || j === 3 || j === 6 || j === 7 ? 1.0 : -1.0;\n\n      // 3D\n      Cartesian3.pack(encodedStart.high, startHiAndForwardOffsetX, vec4Index);\n      startHiAndForwardOffsetX[wIndex] = forwardOffset.x;\n\n      Cartesian3.pack(encodedStart.low, startLoAndForwardOffsetY, vec4Index);\n      startLoAndForwardOffsetY[wIndex] = forwardOffset.y;\n\n      Cartesian3.pack(\n        startPlaneNormal,\n        startNormalAndForwardOffsetZ,\n        vec4Index\n      );\n      startNormalAndForwardOffsetZ[wIndex] = forwardOffset.z;\n\n      Cartesian3.pack(\n        endPlaneNormal,\n        endNormalAndTextureCoordinateNormalizationX,\n        vec4Index\n      );\n      endNormalAndTextureCoordinateNormalizationX[wIndex] =\n        texcoordNormalization3DX * rightPlaneSide;\n\n      Cartesian3.pack(\n        rightNormal,\n        rightNormalAndTextureCoordinateNormalizationY,\n        vec4Index\n      );\n\n      let texcoordNormalization = texcoordNormalization3DY * topBottomSide;\n      if (texcoordNormalization === 0.0 && topBottomSide < 0.0) {\n        texcoordNormalization = 9.0; // some value greater than 1.0\n      }\n      rightNormalAndTextureCoordinateNormalizationY[\n        wIndex\n      ] = texcoordNormalization;\n\n      // 2D\n      if (compute2dAttributes) {\n        startHiLo2D[vec4Index] = encodedStart2D.high.x;\n        startHiLo2D[vec4Index + 1] = encodedStart2D.high.y;\n        startHiLo2D[vec4Index + 2] = encodedStart2D.low.x;\n        startHiLo2D[vec4Index + 3] = encodedStart2D.low.y;\n\n        startEndNormals2D[vec4Index] = -startGeometryNormal2D.y;\n        startEndNormals2D[vec4Index + 1] = startGeometryNormal2D.x;\n        startEndNormals2D[vec4Index + 2] = endGeometryNormal2D.y;\n        startEndNormals2D[vec4Index + 3] = -endGeometryNormal2D.x;\n\n        offsetAndRight2D[vec4Index] = forwardOffset2D.x;\n        offsetAndRight2D[vec4Index + 1] = forwardOffset2D.y;\n        offsetAndRight2D[vec4Index + 2] = right2D.x;\n        offsetAndRight2D[vec4Index + 3] = right2D.y;\n\n        texcoordNormalization2D[vec2Index] =\n          texcoordNormalization2DX * rightPlaneSide;\n\n        texcoordNormalization = texcoordNormalization2DY * topBottomSide;\n        if (texcoordNormalization === 0.0 && topBottomSide < 0.0) {\n          texcoordNormalization = 9.0; // some value greater than 1.0\n        }\n        texcoordNormalization2D[vec2Index + 1] = texcoordNormalization;\n      }\n    }\n\n    // Adjust height of volume in 3D\n    const adjustHeightStartBottom = adjustHeightStartBottomScratch;\n    const adjustHeightEndBottom = adjustHeightEndBottomScratch;\n    const adjustHeightStartTop = adjustHeightStartTopScratch;\n    const adjustHeightEndTop = adjustHeightEndTopScratch;\n\n    const getHeightsRectangle = Rectangle.fromCartographicArray(\n      getHeightCartographics,\n      getHeightRectangleScratch\n    );\n    const minMaxHeights = ApproximateTerrainHeights.getMinimumMaximumHeights(\n      getHeightsRectangle,\n      ellipsoid\n    );\n    const minHeight = minMaxHeights.minimumTerrainHeight;\n    const maxHeight = minMaxHeights.maximumTerrainHeight;\n\n    // Sum using abs() to properly account for negative eleavtions in calculating bounding sphere radius\n    sumHeights += Math.abs(minHeight);\n    sumHeights += Math.abs(maxHeight);\n\n    adjustHeights(\n      startBottom,\n      startTop,\n      minHeight,\n      maxHeight,\n      adjustHeightStartBottom,\n      adjustHeightStartTop\n    );\n    adjustHeights(\n      endBottom,\n      endTop,\n      minHeight,\n      maxHeight,\n      adjustHeightEndBottom,\n      adjustHeightEndTop\n    );\n\n    // Nudge the positions away from the \"polyline\" a little bit to prevent errors in GeometryPipeline\n    let normalNudge = Cartesian3.multiplyByScalar(\n      rightNormal,\n      CesiumMath.EPSILON5,\n      normalNudgeScratch\n    );\n    Cartesian3.add(\n      adjustHeightStartBottom,\n      normalNudge,\n      adjustHeightStartBottom\n    );\n    Cartesian3.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom);\n    Cartesian3.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop);\n    Cartesian3.add(adjustHeightEndTop, normalNudge, adjustHeightEndTop);\n\n    // If the segment is very close to the XZ plane, nudge the vertices slightly to avoid touching it.\n    nudgeXZ(adjustHeightStartBottom, adjustHeightEndBottom);\n    nudgeXZ(adjustHeightStartTop, adjustHeightEndTop);\n\n    Cartesian3.pack(adjustHeightStartBottom, positionsArray, vec3sWriteIndex);\n    Cartesian3.pack(adjustHeightEndBottom, positionsArray, vec3sWriteIndex + 3);\n    Cartesian3.pack(adjustHeightEndTop, positionsArray, vec3sWriteIndex + 6);\n    Cartesian3.pack(adjustHeightStartTop, positionsArray, vec3sWriteIndex + 9);\n\n    normalNudge = Cartesian3.multiplyByScalar(\n      rightNormal,\n      -2.0 * CesiumMath.EPSILON5,\n      normalNudgeScratch\n    );\n    Cartesian3.add(\n      adjustHeightStartBottom,\n      normalNudge,\n      adjustHeightStartBottom\n    );\n    Cartesian3.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom);\n    Cartesian3.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop);\n    Cartesian3.add(adjustHeightEndTop, normalNudge, adjustHeightEndTop);\n\n    nudgeXZ(adjustHeightStartBottom, adjustHeightEndBottom);\n    nudgeXZ(adjustHeightStartTop, adjustHeightEndTop);\n\n    Cartesian3.pack(\n      adjustHeightStartBottom,\n      positionsArray,\n      vec3sWriteIndex + 12\n    );\n    Cartesian3.pack(\n      adjustHeightEndBottom,\n      positionsArray,\n      vec3sWriteIndex + 15\n    );\n    Cartesian3.pack(adjustHeightEndTop, positionsArray, vec3sWriteIndex + 18);\n    Cartesian3.pack(adjustHeightStartTop, positionsArray, vec3sWriteIndex + 21);\n\n    cartographicsIndex += 2;\n    index += 3;\n\n    vec2sWriteIndex += 16;\n    vec3sWriteIndex += 24;\n    vec4sWriteIndex += 32;\n\n    lengthSoFar3D += segmentLength3D;\n    lengthSoFar2D += segmentLength2D;\n  }\n\n  index = 0;\n  let indexOffset = 0;\n  for (i = 0; i < segmentCount; i++) {\n    for (j = 0; j < REFERENCE_INDICES_LENGTH; j++) {\n      indices[index + j] = REFERENCE_INDICES[j] + indexOffset;\n    }\n    indexOffset += 8;\n    index += REFERENCE_INDICES_LENGTH;\n  }\n\n  const boundingSpheres = scratchBoundingSpheres;\n  BoundingSphere.fromVertices(\n    bottomPositionsArray,\n    Cartesian3.ZERO,\n    3,\n    boundingSpheres[0]\n  );\n  BoundingSphere.fromVertices(\n    topPositionsArray,\n    Cartesian3.ZERO,\n    3,\n    boundingSpheres[1]\n  );\n  const boundingSphere = BoundingSphere.fromBoundingSpheres(boundingSpheres);\n\n  // Adjust bounding sphere height and radius to cover more of the volume\n  boundingSphere.radius += sumHeights / (segmentCount * 2.0);\n\n  const attributes = {\n    position: new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      normalize: false,\n      values: positionsArray,\n    }),\n    startHiAndForwardOffsetX: getVec4GeometryAttribute(\n      startHiAndForwardOffsetX\n    ),\n    startLoAndForwardOffsetY: getVec4GeometryAttribute(\n      startLoAndForwardOffsetY\n    ),\n    startNormalAndForwardOffsetZ: getVec4GeometryAttribute(\n      startNormalAndForwardOffsetZ\n    ),\n    endNormalAndTextureCoordinateNormalizationX: getVec4GeometryAttribute(\n      endNormalAndTextureCoordinateNormalizationX\n    ),\n    rightNormalAndTextureCoordinateNormalizationY: getVec4GeometryAttribute(\n      rightNormalAndTextureCoordinateNormalizationY\n    ),\n  };\n\n  if (compute2dAttributes) {\n    attributes.startHiLo2D = getVec4GeometryAttribute(startHiLo2D);\n    attributes.offsetAndRight2D = getVec4GeometryAttribute(offsetAndRight2D);\n    attributes.startEndNormals2D = getVec4GeometryAttribute(startEndNormals2D);\n    attributes.texcoordNormalization2D = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n      normalize: false,\n      values: texcoordNormalization2D,\n    });\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    boundingSphere: boundingSphere,\n  });\n}\n\nfunction getVec4GeometryAttribute(typedArray) {\n  return new GeometryAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: 4,\n    normalize: false,\n    values: typedArray,\n  });\n}\n\n/**\n * Approximates an ellipsoid-tangent vector in 2D by projecting the end point into 2D.\n * Exposed for testing.\n *\n * @param {MapProjection} projection Map Projection for projecting coordinates to 2D.\n * @param {Cartographic} cartographic The cartographic origin point of the normal.\n *   Used to check if the normal crosses the IDL during projection.\n * @param {Cartesian3} normal The normal in 3D.\n * @param {Cartesian3} projectedPosition The projected origin point of the normal in 2D.\n * @param {Cartesian3} result Result parameter on which to store the projected normal.\n * @private\n */\nGroundPolylineGeometry._projectNormal = projectNormal;\nexport default GroundPolylineGeometry;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec4 v_startPlaneNormalEcAndHalfWidth;\\n\\\nin vec4 v_endPlaneNormalEcAndBatchId;\\n\\\nin vec4 v_rightPlaneEC; // Technically can compute distance for this here\\n\\\nin vec4 v_endEcAndStartEcX;\\n\\\nin vec4 v_texcoordNormalizationAndStartEcYZ;\\n\\\n\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nin vec4 v_color;\\n\\\n#endif\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n    float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));\\n\\\n    vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);\\n\\\n\\n\\\n    // Discard for sky\\n\\\n    if (logDepthOrDepth == 0.0) {\\n\\\n#ifdef DEBUG_SHOW_VOLUME\\n\\\n        out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\\n\\\n        return;\\n\\\n#else // DEBUG_SHOW_VOLUME\\n\\\n        discard;\\n\\\n#endif // DEBUG_SHOW_VOLUME\\n\\\n    }\\n\\\n\\n\\\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\\n\\\n    eyeCoordinate /= eyeCoordinate.w;\\n\\\n\\n\\\n    float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);\\n\\\n    // Check distance of the eye coordinate against the right-facing plane\\n\\\n    float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);\\n\\\n\\n\\\n    // Check eye coordinate against the mitering planes\\n\\\n    float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);\\n\\\n    float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);\\n\\\n\\n\\\n    if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {\\n\\\n#ifdef DEBUG_SHOW_VOLUME\\n\\\n        out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\\n\\\n        return;\\n\\\n#else // DEBUG_SHOW_VOLUME\\n\\\n        discard;\\n\\\n#endif // DEBUG_SHOW_VOLUME\\n\\\n    }\\n\\\n\\n\\\n    // Check distance of the eye coordinate against start and end planes with normals in the right plane.\\n\\\n    // For computing unskewed lengthwise texture coordinate.\\n\\\n    // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking.\\n\\\n\\n\\\n    // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more \\\"forward\\\"\\n\\\n    vec3 alignedPlaneNormal;\\n\\\n\\n\\\n    // start aligned plane\\n\\\n    alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);\\n\\\n    alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\\n\\\n    distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);\\n\\\n\\n\\\n    // end aligned plane\\n\\\n    alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);\\n\\\n    alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\\n\\\n    distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);\\n\\\n\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\n    out_FragColor = czm_gammaCorrect(v_color);\\n\\\n#else // PER_INSTANCE_COLOR\\n\\\n    // Clamp - distance to aligned planes may be negative due to mitering,\\n\\\n    // so fragment texture coordinate might be out-of-bounds.\\n\\\n    float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);\\n\\\n    s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;\\n\\\n    float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);\\n\\\n\\n\\\n    czm_materialInput materialInput;\\n\\\n\\n\\\n    materialInput.s = s;\\n\\\n    materialInput.st = vec2(s, t);\\n\\\n    materialInput.str = vec3(s, t, 0.0);\\n\\\n\\n\\\n    czm_material material = czm_getMaterial(materialInput);\\n\\\n    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#endif // PER_INSTANCE_COLOR\\n\\\n\\n\\\n    // Premultiply alpha. Required for classification primitives on translucent globe.\\n\\\n    out_FragColor.rgb *= out_FragColor.a;\\n\\\n\\n\\\n    czm_writeDepthClamp();\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 v_forwardDirectionEC;\\n\\\nin vec3 v_texcoordNormalizationAndHalfWidth;\\n\\\nin float v_batchId;\\n\\\n\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nin vec4 v_color;\\n\\\n#else\\n\\\nin vec2 v_alignedPlaneDistances;\\n\\\nin float v_texcoordT;\\n\\\n#endif\\n\\\n\\n\\\nfloat rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {\\n\\\n    // We don't expect the ray to ever be parallel to the plane\\n\\\n    return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);\\n\\\n}\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n    vec4 eyeCoordinate = gl_FragCoord;\\n\\\n    eyeCoordinate /= eyeCoordinate.w;\\n\\\n\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\n    out_FragColor = czm_gammaCorrect(v_color);\\n\\\n#else // PER_INSTANCE_COLOR\\n\\\n    // Use distances for planes aligned with segment to prevent skew in dashing\\n\\\n    float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);\\n\\\n    float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);\\n\\\n\\n\\\n    // Clamp - distance to aligned planes may be negative due to mitering\\n\\\n    distanceFromStart = max(0.0, distanceFromStart);\\n\\\n    distanceFromEnd = max(0.0, distanceFromEnd);\\n\\\n\\n\\\n    float s = distanceFromStart / (distanceFromStart + distanceFromEnd);\\n\\\n    s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;\\n\\\n\\n\\\n    czm_materialInput materialInput;\\n\\\n\\n\\\n    materialInput.s = s;\\n\\\n    materialInput.st = vec2(s, v_texcoordT);\\n\\\n    materialInput.str = vec3(s, v_texcoordT, 0.0);\\n\\\n\\n\\\n    czm_material material = czm_getMaterial(materialInput);\\n\\\n    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#endif // PER_INSTANCE_COLOR\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 position3DHigh;\\n\\\nin vec3 position3DLow;\\n\\\n\\n\\\nin vec4 startHiAndForwardOffsetX;\\n\\\nin vec4 startLoAndForwardOffsetY;\\n\\\nin vec4 startNormalAndForwardOffsetZ;\\n\\\nin vec4 endNormalAndTextureCoordinateNormalizationX;\\n\\\nin vec4 rightNormalAndTextureCoordinateNormalizationY;\\n\\\nin vec4 startHiLo2D;\\n\\\nin vec4 offsetAndRight2D;\\n\\\nin vec4 startEndNormals2D;\\n\\\nin vec2 texcoordNormalization2D;\\n\\\n\\n\\\nin float batchId;\\n\\\n\\n\\\nout vec3 v_forwardDirectionEC;\\n\\\nout vec3 v_texcoordNormalizationAndHalfWidth;\\n\\\nout float v_batchId;\\n\\\n\\n\\\n// For materials\\n\\\n#ifdef WIDTH_VARYING\\n\\\nout float v_width;\\n\\\n#endif\\n\\\n#ifdef ANGLE_VARYING\\n\\\nout float v_polylineAngle;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nout vec4 v_color;\\n\\\n#else\\n\\\nout vec2 v_alignedPlaneDistances;\\n\\\nout float v_texcoordT;\\n\\\n#endif\\n\\\n\\n\\\n// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume.\\n\\\n// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient.\\n\\\nvoid main()\\n\\\n{\\n\\\n    v_batchId = batchId;\\n\\\n\\n\\\n    // Start position\\n\\\n    vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));\\n\\\n    vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);\\n\\\n    vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);\\n\\\n    vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;\\n\\\n    vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;\\n\\\n    vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;\\n\\\n\\n\\\n    // Start plane\\n\\\n    vec4 startPlane2D;\\n\\\n    vec4 startPlane3D;\\n\\\n    startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);\\n\\\n    startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\\n\\\n    startPlane2D.w = -dot(startPlane2D.xyz, posEc2D);\\n\\\n    startPlane3D.w = -dot(startPlane3D.xyz, posEc3D);\\n\\\n\\n\\\n    // Right plane\\n\\\n    vec4 rightPlane2D;\\n\\\n    vec4 rightPlane3D;\\n\\\n    rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);\\n\\\n    rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\\n\\\n    rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);\\n\\\n    rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);\\n\\\n\\n\\\n    // End position\\n\\\n    posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);\\n\\\n    posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);\\n\\\n    posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);\\n\\\n    posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;\\n\\\n    posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;\\n\\\n    vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;\\n\\\n    vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));\\n\\\n    vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));\\n\\\n\\n\\\n    // End plane\\n\\\n    vec4 endPlane2D;\\n\\\n    vec4 endPlane3D;\\n\\\n    endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);\\n\\\n    endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\\n\\\n    endPlane2D.w = -dot(endPlane2D.xyz, posEc2D);\\n\\\n    endPlane3D.w = -dot(endPlane3D.xyz, posEc3D);\\n\\\n\\n\\\n    // Forward direction\\n\\\n    v_forwardDirectionEC = normalize(endEC - startEC);\\n\\\n\\n\\\n    vec2 cleanTexcoordNormalization2D;\\n\\\n    cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);\\n\\\n    cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));\\n\\\n    vec2 cleanTexcoordNormalization3D;\\n\\\n    cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\\n\\\n    cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;\\n\\\n    cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));\\n\\\n\\n\\\n    v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);\\n\\\n\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\n    v_color = czm_batchTable_color(batchId);\\n\\\n#else // PER_INSTANCE_COLOR\\n\\\n    // For computing texture coordinates\\n\\\n\\n\\\n    v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);\\n\\\n    v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);\\n\\\n#endif // PER_INSTANCE_COLOR\\n\\\n\\n\\\n#ifdef WIDTH_VARYING\\n\\\n    float width = czm_batchTable_width(batchId);\\n\\\n    float halfWidth = width * 0.5;\\n\\\n    v_width = width;\\n\\\n    v_texcoordNormalizationAndHalfWidth.z = halfWidth;\\n\\\n#else\\n\\\n    float halfWidth = 0.5 * czm_batchTable_width(batchId);\\n\\\n    v_texcoordNormalizationAndHalfWidth.z = halfWidth;\\n\\\n#endif\\n\\\n\\n\\\n    // Compute a normal along which to \\\"push\\\" the position out, extending the miter depending on view distance.\\n\\\n    // Position has already been \\\"pushed\\\" by unit length along miter normal, and miter normals are encoded in the planes.\\n\\\n    // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.\\n\\\n    // Since this is morphing, compute both 3D and 2D positions and then blend.\\n\\\n\\n\\\n    // ****** 3D ******\\n\\\n    // Check distance to the end plane and start plane, pick the plane that is closer\\n\\\n    vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition\\n\\\n    float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));\\n\\\n    float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));\\n\\\n    vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);\\n\\\n    vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points \\\"up\\\" for start plane, \\\"down\\\" at end plane.\\n\\\n    vec3 normalEC = normalize(cross(planeDirection, upOrDown));         // In practice, the opposite seems to work too.\\n\\\n\\n\\\n    // Nudge the top vertex upwards to prevent flickering\\n\\\n    vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));\\n\\\n    geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);\\n\\\n    geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;\\n\\\n    positionEc3D.xyz += geodeticSurfaceNormal;\\n\\\n\\n\\\n    // Determine if this vertex is on the \\\"left\\\" or \\\"right\\\"\\n\\\n    normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\\n\\\n\\n\\\n    // A \\\"perfect\\\" implementation would push along normals according to the angle against forward.\\n\\\n    // In practice, just pushing the normal out by halfWidth is sufficient for morph views.\\n\\\n    positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)\\n\\\n\\n\\\n    // ****** 2D ******\\n\\\n    // Check distance to the end plane and start plane, pick the plane that is closer\\n\\\n    vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition\\n\\\n    absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));\\n\\\n    absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));\\n\\\n    planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);\\n\\\n    upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points \\\"up\\\" for start plane, \\\"down\\\" at end plane.\\n\\\n    normalEC = normalize(cross(planeDirection, upOrDown));         // In practice, the opposite seems to work too.\\n\\\n\\n\\\n    // Nudge the top vertex upwards to prevent flickering\\n\\\n    geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));\\n\\\n    geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);\\n\\\n    geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;\\n\\\n    positionEc2D.xyz += geodeticSurfaceNormal;\\n\\\n\\n\\\n    // Determine if this vertex is on the \\\"left\\\" or \\\"right\\\"\\n\\\n    normalEC *= sign(texcoordNormalization2D.x);\\n\\\n#ifndef PER_INSTANCE_COLOR\\n\\\n    // Use vertex's sidedness to compute its texture coordinate.\\n\\\n    v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);\\n\\\n#endif\\n\\\n\\n\\\n    // A \\\"perfect\\\" implementation would push along normals according to the angle against forward.\\n\\\n    // In practice, just pushing the normal out by halfWidth is sufficient for morph views.\\n\\\n    positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)\\n\\\n\\n\\\n    // Blend for actual position\\n\\\n    gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);\\n\\\n\\n\\\n#ifdef ANGLE_VARYING\\n\\\n    // Approximate relative screen space direction of the line.\\n\\\n    vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));\\n\\\n    approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);\\n\\\n    v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 position3DHigh;\\n\\\nin vec3 position3DLow;\\n\\\n\\n\\\n// In 2D and in 3D, texture coordinate normalization component signs encodes:\\n\\\n// * X sign - sidedness relative to right plane\\n\\\n// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume\\n\\\n#ifndef COLUMBUS_VIEW_2D\\n\\\nin vec4 startHiAndForwardOffsetX;\\n\\\nin vec4 startLoAndForwardOffsetY;\\n\\\nin vec4 startNormalAndForwardOffsetZ;\\n\\\nin vec4 endNormalAndTextureCoordinateNormalizationX;\\n\\\nin vec4 rightNormalAndTextureCoordinateNormalizationY;\\n\\\n#else\\n\\\nin vec4 startHiLo2D;\\n\\\nin vec4 offsetAndRight2D;\\n\\\nin vec4 startEndNormals2D;\\n\\\nin vec2 texcoordNormalization2D;\\n\\\n#endif\\n\\\n\\n\\\nin float batchId;\\n\\\n\\n\\\nout vec4 v_startPlaneNormalEcAndHalfWidth;\\n\\\nout vec4 v_endPlaneNormalEcAndBatchId;\\n\\\nout vec4 v_rightPlaneEC;\\n\\\nout vec4 v_endEcAndStartEcX;\\n\\\nout vec4 v_texcoordNormalizationAndStartEcYZ;\\n\\\n\\n\\\n// For materials\\n\\\n#ifdef WIDTH_VARYING\\n\\\nout float v_width;\\n\\\n#endif\\n\\\n#ifdef ANGLE_VARYING\\n\\\nout float v_polylineAngle;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nout vec4 v_color;\\n\\\n#endif\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n#ifdef COLUMBUS_VIEW_2D\\n\\\n    vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;\\n\\\n\\n\\\n    vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);\\n\\\n    vec3 ecEnd = forwardDirectionEC + ecStart;\\n\\\n    forwardDirectionEC = normalize(forwardDirectionEC);\\n\\\n\\n\\\n    // Right plane\\n\\\n    v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);\\n\\\n    v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\\n\\\n\\n\\\n    // start plane\\n\\\n    vec4 startPlaneEC;\\n\\\n    startPlaneEC.xyz =  czm_normal * vec3(0.0, startEndNormals2D.xy);\\n\\\n    startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\\n\\\n\\n\\\n    // end plane\\n\\\n    vec4 endPlaneEC;\\n\\\n    endPlaneEC.xyz =  czm_normal * vec3(0.0, startEndNormals2D.zw);\\n\\\n    endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\\n\\\n\\n\\\n    v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);\\n\\\n    v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;\\n\\\n\\n\\\n#else // COLUMBUS_VIEW_2D\\n\\\n    vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;\\n\\\n    vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);\\n\\\n    vec3 ecEnd = ecStart + offset;\\n\\\n\\n\\\n    vec3 forwardDirectionEC = normalize(offset);\\n\\\n\\n\\\n    // start plane\\n\\\n    vec4 startPlaneEC;\\n\\\n    startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\\n\\\n    startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\\n\\\n\\n\\\n    // end plane\\n\\\n    vec4 endPlaneEC;\\n\\\n    endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\\n\\\n    endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\\n\\\n\\n\\\n    // Right plane\\n\\\n    v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\\n\\\n    v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\\n\\\n\\n\\\n    v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\\n\\\n    v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;\\n\\\n\\n\\\n#endif // COLUMBUS_VIEW_2D\\n\\\n\\n\\\n    v_endEcAndStartEcX.xyz = ecEnd;\\n\\\n    v_endEcAndStartEcX.w = ecStart.x;\\n\\\n    v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;\\n\\\n\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\n    v_color = czm_batchTable_color(batchId);\\n\\\n#endif // PER_INSTANCE_COLOR\\n\\\n\\n\\\n    // Compute a normal along which to \\\"push\\\" the position out, extending the miter depending on view distance.\\n\\\n    // Position has already been \\\"pushed\\\" by unit length along miter normal, and miter normals are encoded in the planes.\\n\\\n    // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.\\n\\\n    vec4 positionRelativeToEye = czm_computePosition();\\n\\\n\\n\\\n    // Check distance to the end plane and start plane, pick the plane that is closer\\n\\\n    vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition\\n\\\n    float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));\\n\\\n    float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));\\n\\\n    vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);\\n\\\n    vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points \\\"up\\\" for start plane, \\\"down\\\" at end plane.\\n\\\n    vec3 normalEC = normalize(cross(planeDirection, upOrDown));           // In practice, the opposite seems to work too.\\n\\\n\\n\\\n    // Extrude bottom vertices downward for far view distances, like for GroundPrimitives\\n\\\n    upOrDown = cross(forwardDirectionEC, normalEC);\\n\\\n    upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;\\n\\\n    upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;\\n\\\n    upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;\\n\\\n    positionEC.xyz += upOrDown;\\n\\\n\\n\\\n    v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));\\n\\\n\\n\\\n    // Determine distance along normalEC to push for a volume of appropriate width.\\n\\\n    // Make volumes about double pixel width for a conservative fit - in practice the\\n\\\n    // extra cost here is minimal compared to the loose volume heights.\\n\\\n    //\\n\\\n    // N = normalEC (guaranteed \\\"right-facing\\\")\\n\\\n    // R = rightEC\\n\\\n    // p = angle between N and R\\n\\\n    // w = distance to push along R if R == N\\n\\\n    // d = distance to push along N\\n\\\n    //\\n\\\n    //   N   R\\n\\\n    //  { \\ p| }      * cos(p) = dot(N, R) = w / d\\n\\\n    //  d\\ \\ |  |w    * d = w / dot(N, R)\\n\\\n    //    { \\| }\\n\\\n    //       o---------- polyline segment ---->\\n\\\n    //\\n\\\n    float width = czm_batchTable_width(batchId);\\n\\\n#ifdef WIDTH_VARYING\\n\\\n    v_width = width;\\n\\\n#endif\\n\\\n\\n\\\n    v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;\\n\\\n    v_startPlaneNormalEcAndHalfWidth.w = width * 0.5;\\n\\\n\\n\\\n    v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;\\n\\\n    v_endPlaneNormalEcAndBatchId.w = batchId;\\n\\\n\\n\\\n    width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R\\n\\\n    width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N\\n\\\n\\n\\\n    // Determine if this vertex is on the \\\"left\\\" or \\\"right\\\"\\n\\\n#ifdef COLUMBUS_VIEW_2D\\n\\\n        normalEC *= sign(texcoordNormalization2D.x);\\n\\\n#else\\n\\\n        normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\\n\\\n#endif\\n\\\n\\n\\\n    positionEC.xyz += width * normalEC;\\n\\\n    gl_Position = czm_depthClamp(czm_projection * positionEC);\\n\\\n\\n\\\n#ifdef ANGLE_VARYING\\n\\\n    // Approximate relative screen space direction of the line.\\n\\\n    vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));\\n\\\n    approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);\\n\\\n    v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 position3DHigh;\\n\\\nin vec3 position3DLow;\\n\\\nin vec3 prevPosition3DHigh;\\n\\\nin vec3 prevPosition3DLow;\\n\\\nin vec3 nextPosition3DHigh;\\n\\\nin vec3 nextPosition3DLow;\\n\\\nin vec2 expandAndWidth;\\n\\\nin vec4 color;\\n\\\nin float batchId;\\n\\\n\\n\\\nout vec4 v_color;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    float expandDir = expandAndWidth.x;\\n\\\n    float width = abs(expandAndWidth.y) + 0.5;\\n\\\n    bool usePrev = expandAndWidth.y < 0.0;\\n\\\n\\n\\\n    vec4 p = czm_computePosition();\\n\\\n    vec4 prev = czm_computePrevPosition();\\n\\\n    vec4 next = czm_computeNextPosition();\\n\\\n\\n\\\n    float angle;\\n\\\n    vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\\n\\\n    gl_Position = czm_viewportOrthographic * positionWC;\\n\\\n\\n\\\n    v_color = color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void clipLineSegmentToNearPlane(\\n\\\n    vec3 p0,\\n\\\n    vec3 p1,\\n\\\n    out vec4 positionWC,\\n\\\n    out bool clipped,\\n\\\n    out bool culledByNearPlane,\\n\\\n    out vec4 clippedPositionEC)\\n\\\n{\\n\\\n    culledByNearPlane = false;\\n\\\n    clipped = false;\\n\\\n\\n\\\n    vec3 p0ToP1 = p1 - p0;\\n\\\n    float magnitude = length(p0ToP1);\\n\\\n    vec3 direction = normalize(p0ToP1);\\n\\\n\\n\\\n    // Distance that p0 is behind the near plane. Negative means p0 is\\n\\\n    // in front of the near plane.\\n\\\n    float endPoint0Distance =  czm_currentFrustum.x + p0.z;\\n\\\n\\n\\\n    // Camera looks down -Z.\\n\\\n    // When moving a point along +Z: LESS VISIBLE\\n\\\n    //   * Points in front of the camera move closer to the camera.\\n\\\n    //   * Points behind the camrea move farther away from the camera.\\n\\\n    // When moving a point along -Z: MORE VISIBLE\\n\\\n    //   * Points in front of the camera move farther away from the camera.\\n\\\n    //   * Points behind the camera move closer to the camera.\\n\\\n\\n\\\n    // Positive denominator: -Z, becoming more visible\\n\\\n    // Negative denominator: +Z, becoming less visible\\n\\\n    // Nearly zero: parallel to near plane\\n\\\n    float denominator = -direction.z;\\n\\\n\\n\\\n    if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)\\n\\\n    {\\n\\\n        // p0 is behind the near plane and the line to p1 is nearly parallel to\\n\\\n        // the near plane, so cull the segment completely.\\n\\\n        culledByNearPlane = true;\\n\\\n    }\\n\\\n    else if (endPoint0Distance > 0.0)\\n\\\n    {\\n\\\n        // p0 is behind the near plane, and the line to p1 is moving distinctly\\n\\\n        // toward or away from it.\\n\\\n\\n\\\n        // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction)\\n\\\n        float t = endPoint0Distance / denominator;\\n\\\n        if (t < 0.0 || t > magnitude)\\n\\\n        {\\n\\\n            // Near plane intersection is not between the two points.\\n\\\n            // We already confirmed p0 is behind the naer plane, so now\\n\\\n            // we know the entire segment is behind it.\\n\\\n            culledByNearPlane = true;\\n\\\n        }\\n\\\n        else\\n\\\n        {\\n\\\n            // Segment crosses the near plane, update p0 to lie exactly on it.\\n\\\n            p0 = p0 + t * direction;\\n\\\n\\n\\\n            // Numerical noise might put us a bit on the wrong side of the near plane.\\n\\\n            // Don't let that happen.\\n\\\n            p0.z = min(p0.z, -czm_currentFrustum.x);\\n\\\n\\n\\\n            clipped = true;\\n\\\n        }\\n\\\n    }\\n\\\n\\n\\\n    clippedPositionEC = vec4(p0, 1.0);\\n\\\n    positionWC = czm_eyeToWindowCoordinates(clippedPositionEC);\\n\\\n}\\n\\\n\\n\\\nvec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)\\n\\\n{\\n\\\n    // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC.\\n\\\n\\n\\\n#ifdef POLYLINE_DASH\\n\\\n    // Compute the window coordinates of the points.\\n\\\n    vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);\\n\\\n    vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);\\n\\\n    vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);\\n\\\n\\n\\\n    // Determine the relative screen space direction of the line.\\n\\\n    vec2 lineDir;\\n\\\n    if (usePrevious) {\\n\\\n        lineDir = normalize(positionWindow.xy - previousWindow.xy);\\n\\\n    }\\n\\\n    else {\\n\\\n        lineDir = normalize(nextWindow.xy - positionWindow.xy);\\n\\\n    }\\n\\\n    angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0)\\n\\\n\\n\\\n    // Quantize the angle so it doesn't change rapidly between segments.\\n\\\n    angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;\\n\\\n#endif\\n\\\n\\n\\\n    vec4 clippedPrevWC, clippedPrevEC;\\n\\\n    bool prevSegmentClipped, prevSegmentCulled;\\n\\\n    clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);\\n\\\n\\n\\\n    vec4 clippedNextWC, clippedNextEC;\\n\\\n    bool nextSegmentClipped, nextSegmentCulled;\\n\\\n    clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);\\n\\\n\\n\\\n    bool segmentClipped, segmentCulled;\\n\\\n    vec4 clippedPositionWC, clippedPositionEC;\\n\\\n    clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);\\n\\\n\\n\\\n    if (segmentCulled)\\n\\\n    {\\n\\\n        return vec4(0.0, 0.0, 0.0, 1.0);\\n\\\n    }\\n\\\n\\n\\\n    vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);\\n\\\n    vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);\\n\\\n\\n\\\n    // If a segment was culled, we can't use the corresponding direction\\n\\\n    // computed above. We should never see both of these be true without\\n\\\n    // `segmentCulled` above also being true.\\n\\\n    if (prevSegmentCulled)\\n\\\n    {\\n\\\n        directionToPrevWC = -directionToNextWC;\\n\\\n    }\\n\\\n    else if (nextSegmentCulled)\\n\\\n    {\\n\\\n        directionToNextWC = -directionToPrevWC;\\n\\\n    }\\n\\\n\\n\\\n    vec2 thisSegmentForwardWC, otherSegmentForwardWC;\\n\\\n    if (usePrevious)\\n\\\n    {\\n\\\n        thisSegmentForwardWC = -directionToPrevWC;\\n\\\n        otherSegmentForwardWC = directionToNextWC;\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        thisSegmentForwardWC = directionToNextWC;\\n\\\n        otherSegmentForwardWC =  -directionToPrevWC;\\n\\\n    }\\n\\\n\\n\\\n    vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);\\n\\\n\\n\\\n    vec2 leftWC = thisSegmentLeftWC;\\n\\\n    float expandWidth = width * 0.5;\\n\\\n\\n\\\n    // When lines are split at the anti-meridian, the position may be at the\\n\\\n    // same location as the next or previous position, and we need to handle\\n\\\n    // that to avoid producing NaNs.\\n\\\n    if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))\\n\\\n    {\\n\\\n        vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);\\n\\\n\\n\\\n        vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;\\n\\\n        float leftSumLength = length(leftSumWC);\\n\\\n        leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);\\n\\\n\\n\\\n        // The sine of the angle between the two vectors is given by the formula\\n\\\n        //         |a x b| = |a||b|sin(theta)\\n\\\n        // which is\\n\\\n        //     float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0)));\\n\\\n        // Because the z components of both vectors are zero, the x and y coordinate will be zero.\\n\\\n        // Therefore, the sine of the angle is just the z component of the cross product.\\n\\\n        vec2 u = -thisSegmentForwardWC;\\n\\\n        vec2 v = leftWC;\\n\\\n        float sinAngle = abs(u.x * v.y - u.y * v.x);\\n\\\n        expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\\n\\\n    }\\n\\\n\\n\\\n    vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;\\n\\\n    return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;\\n\\\n}\\n\\\n\\n\\\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)\\n\\\n{\\n\\\n    vec4 positionEC = czm_modelViewRelativeToEye * position;\\n\\\n    vec4 prevEC = czm_modelViewRelativeToEye * previous;\\n\\\n    vec4 nextEC = czm_modelViewRelativeToEye * next;\\n\\\n    return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);\\n\\\n}\\n\\\n\";\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport PerInstanceFlatColorAppearanceFS from \"../Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js\";\nimport PolylineColorAppearanceVS from \"../Shaders/Appearances/PolylineColorAppearanceVS.js\";\nimport PolylineCommon from \"../Shaders/PolylineCommon.js\";\nimport Appearance from \"./Appearance.js\";\n\nlet defaultVertexShaderSource = `${PolylineCommon}\\n${PolylineColorAppearanceVS}`;\nconst defaultFragmentShaderSource = PerInstanceFlatColorAppearanceFS;\n\nif (!FeatureDetection.isInternetExplorer()) {\n  defaultVertexShaderSource = `#define CLIP_POLYLINE \\n${defaultVertexShaderSource}`;\n}\n\n/**\n * An appearance for {@link GeometryInstance} instances with color attributes and\n * {@link PolylineGeometry} or {@link GroundPolylineGeometry}.\n * This allows several geometry instances, each with a different color, to\n * be drawn with the same {@link Primitive}.\n *\n * @alias PolylineColorAppearance\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {boolean} [options.translucent=true] When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineColorAppearance#renderState} has alpha blending enabled.\n * @param {string} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.\n * @param {string} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.\n * @param {object} [options.renderState] Optional render state to override the default render state.\n *\n * @example\n * // A solid white line segment\n * const primitive = new Cesium.Primitive({\n *   geometryInstances : new Cesium.GeometryInstance({\n *     geometry : new Cesium.PolylineGeometry({\n *       positions : Cesium.Cartesian3.fromDegreesArray([\n *         0.0, 0.0,\n *         5.0, 0.0\n *       ]),\n *       width : 10.0,\n *       vertexFormat : Cesium.PolylineColorAppearance.VERTEX_FORMAT\n *     }),\n *     attributes : {\n *       color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))\n *     }\n *   }),\n *   appearance : new Cesium.PolylineColorAppearance({\n *     translucent : false\n *   })\n * });\n */\nfunction PolylineColorAppearance(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const translucent = defaultValue(options.translucent, true);\n  const closed = false;\n  const vertexFormat = PolylineColorAppearance.VERTEX_FORMAT;\n\n  /**\n   * This property is part of the {@link Appearance} interface, but is not\n   * used by {@link PolylineColorAppearance} since a fully custom fragment shader is used.\n   *\n   * @type Material\n   *\n   * @default undefined\n   */\n  this.material = undefined;\n\n  /**\n   * When <code>true</code>, the geometry is expected to appear translucent so\n   * {@link PolylineColorAppearance#renderState} has alpha blending enabled.\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  this.translucent = translucent;\n\n  this._vertexShaderSource = defaultValue(\n    options.vertexShaderSource,\n    defaultVertexShaderSource\n  );\n  this._fragmentShaderSource = defaultValue(\n    options.fragmentShaderSource,\n    defaultFragmentShaderSource\n  );\n  this._renderState = Appearance.getDefaultRenderState(\n    translucent,\n    closed,\n    options.renderState\n  );\n  this._closed = closed;\n\n  // Non-derived members\n\n  this._vertexFormat = vertexFormat;\n}\n\nObject.defineProperties(PolylineColorAppearance.prototype, {\n  /**\n   * The GLSL source code for the vertex shader.\n   *\n   * @memberof PolylineColorAppearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  vertexShaderSource: {\n    get: function () {\n      return this._vertexShaderSource;\n    },\n  },\n\n  /**\n   * The GLSL source code for the fragment shader.\n   *\n   * @memberof PolylineColorAppearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  fragmentShaderSource: {\n    get: function () {\n      return this._fragmentShaderSource;\n    },\n  },\n\n  /**\n   * The WebGL fixed-function state to use when rendering the geometry.\n   * <p>\n   * The render state can be explicitly defined when constructing a {@link PolylineColorAppearance}\n   * instance, or it is set implicitly via {@link PolylineColorAppearance#translucent}.\n   * </p>\n   *\n   * @memberof PolylineColorAppearance.prototype\n   *\n   * @type {object}\n   * @readonly\n   */\n  renderState: {\n    get: function () {\n      return this._renderState;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the geometry is expected to be closed so\n   * {@link PolylineColorAppearance#renderState} has backface culling enabled.\n   * This is always <code>false</code> for <code>PolylineColorAppearance</code>.\n   *\n   * @memberof PolylineColorAppearance.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  closed: {\n    get: function () {\n      return this._closed;\n    },\n  },\n\n  /**\n   * The {@link VertexFormat} that this appearance instance is compatible with.\n   * A geometry can have more vertex attributes and still be compatible - at a\n   * potential performance cost - but it can't have less.\n   *\n   * @memberof PolylineColorAppearance.prototype\n   *\n   * @type VertexFormat\n   * @readonly\n   *\n   * @default {@link PolylineColorAppearance.VERTEX_FORMAT}\n   */\n  vertexFormat: {\n    get: function () {\n      return this._vertexFormat;\n    },\n  },\n});\n\n/**\n * The {@link VertexFormat} that all {@link PolylineColorAppearance} instances\n * are compatible with. This requires only a <code>position</code> attribute.\n *\n * @type VertexFormat\n *\n * @constant\n */\nPolylineColorAppearance.VERTEX_FORMAT = VertexFormat.POSITION_ONLY;\n\n/**\n * Procedurally creates the full GLSL fragment shader source.\n *\n * @function\n *\n * @returns {string} The full GLSL fragment shader source.\n */\nPolylineColorAppearance.prototype.getFragmentShaderSource =\n  Appearance.prototype.getFragmentShaderSource;\n\n/**\n * Determines if the geometry is translucent based on {@link PolylineColorAppearance#translucent}.\n *\n * @function\n *\n * @returns {boolean} <code>true</code> if the appearance is translucent.\n */\nPolylineColorAppearance.prototype.isTranslucent =\n  Appearance.prototype.isTranslucent;\n\n/**\n * Creates a render state.  This is not the final render state instance; instead,\n * it can contain a subset of render state properties identical to the render state\n * created in the context.\n *\n * @function\n *\n * @returns {object} The render state.\n */\nPolylineColorAppearance.prototype.getRenderState =\n  Appearance.prototype.getRenderState;\nexport default PolylineColorAppearance;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 position3DHigh;\\n\\\nin vec3 position3DLow;\\n\\\nin vec3 prevPosition3DHigh;\\n\\\nin vec3 prevPosition3DLow;\\n\\\nin vec3 nextPosition3DHigh;\\n\\\nin vec3 nextPosition3DLow;\\n\\\nin vec2 expandAndWidth;\\n\\\nin vec2 st;\\n\\\nin float batchId;\\n\\\n\\n\\\nout float v_width;\\n\\\nout vec2 v_st;\\n\\\nout float v_polylineAngle;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    float expandDir = expandAndWidth.x;\\n\\\n    float width = abs(expandAndWidth.y) + 0.5;\\n\\\n    bool usePrev = expandAndWidth.y < 0.0;\\n\\\n\\n\\\n    vec4 p = czm_computePosition();\\n\\\n    vec4 prev = czm_computePrevPosition();\\n\\\n    vec4 next = czm_computeNextPosition();\\n\\\n\\n\\\n    float angle;\\n\\\n    vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\\n\\\n    gl_Position = czm_viewportOrthographic * positionWC;\\n\\\n\\n\\\n    v_width = width;\\n\\\n    v_st.s = st.s;\\n\\\n    v_st.t = czm_writeNonPerspective(st.t, gl_Position.w);\\n\\\n    v_polylineAngle = angle;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef VECTOR_TILE\\n\\\nuniform vec4 u_highlightColor;\\n\\\n#endif\\n\\\n\\n\\\nin vec2 v_st;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    czm_materialInput materialInput;\\n\\\n\\n\\\n    vec2 st = v_st;\\n\\\n    st.t = czm_readNonPerspective(st.t, gl_FragCoord.w);\\n\\\n\\n\\\n    materialInput.s = st.s;\\n\\\n    materialInput.st = st;\\n\\\n    materialInput.str = vec3(st, 0.0);\\n\\\n\\n\\\n    czm_material material = czm_getMaterial(materialInput);\\n\\\n    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#ifdef VECTOR_TILE\\n\\\n    out_FragColor *= u_highlightColor;\\n\\\n#endif\\n\\\n\\n\\\n    czm_writeLogDepth();\\n\\\n}\\n\\\n\";\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport PolylineMaterialAppearanceVS from \"../Shaders/Appearances/PolylineMaterialAppearanceVS.js\";\nimport PolylineCommon from \"../Shaders/PolylineCommon.js\";\nimport PolylineFS from \"../Shaders/PolylineFS.js\";\nimport Appearance from \"./Appearance.js\";\nimport Material from \"./Material.js\";\n\nlet defaultVertexShaderSource = `${PolylineCommon}\\n${PolylineMaterialAppearanceVS}`;\nconst defaultFragmentShaderSource = PolylineFS;\n\nif (!FeatureDetection.isInternetExplorer()) {\n  defaultVertexShaderSource = `#define CLIP_POLYLINE \\n${defaultVertexShaderSource}`;\n}\n\n/**\n * An appearance for {@link PolylineGeometry} that supports shading with materials.\n *\n * @alias PolylineMaterialAppearance\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {boolean} [options.translucent=true] When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.\n * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color.\n * @param {string} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.\n * @param {string} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.\n * @param {object} [options.renderState] Optional render state to override the default render state.\n *\n * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n *\n * @example\n * const primitive = new Cesium.Primitive({\n *   geometryInstances : new Cesium.GeometryInstance({\n *     geometry : new Cesium.PolylineGeometry({\n *       positions : Cesium.Cartesian3.fromDegreesArray([\n *         0.0, 0.0,\n *         5.0, 0.0\n *       ]),\n *       width : 10.0,\n *       vertexFormat : Cesium.PolylineMaterialAppearance.VERTEX_FORMAT\n *     })\n *   }),\n *   appearance : new Cesium.PolylineMaterialAppearance({\n *     material : Cesium.Material.fromType('Color')\n *   })\n * });\n */\nfunction PolylineMaterialAppearance(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const translucent = defaultValue(options.translucent, true);\n  const closed = false;\n  const vertexFormat = PolylineMaterialAppearance.VERTEX_FORMAT;\n\n  /**\n   * The material used to determine the fragment color.  Unlike other {@link PolylineMaterialAppearance}\n   * properties, this is not read-only, so an appearance's material can change on the fly.\n   *\n   * @type Material\n   *\n   * @default {@link Material.ColorType}\n   *\n   * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n   */\n  this.material = defined(options.material)\n    ? options.material\n    : Material.fromType(Material.ColorType);\n\n  /**\n   * When <code>true</code>, the geometry is expected to appear translucent so\n   * {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  this.translucent = translucent;\n\n  this._vertexShaderSource = defaultValue(\n    options.vertexShaderSource,\n    defaultVertexShaderSource\n  );\n  this._fragmentShaderSource = defaultValue(\n    options.fragmentShaderSource,\n    defaultFragmentShaderSource\n  );\n  this._renderState = Appearance.getDefaultRenderState(\n    translucent,\n    closed,\n    options.renderState\n  );\n  this._closed = closed;\n\n  // Non-derived members\n\n  this._vertexFormat = vertexFormat;\n}\n\nObject.defineProperties(PolylineMaterialAppearance.prototype, {\n  /**\n   * The GLSL source code for the vertex shader.\n   *\n   * @memberof PolylineMaterialAppearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  vertexShaderSource: {\n    get: function () {\n      let vs = this._vertexShaderSource;\n      if (\n        this.material.shaderSource.search(/in\\s+float\\s+v_polylineAngle;/g) !==\n        -1\n      ) {\n        vs = `#define POLYLINE_DASH\\n${vs}`;\n      }\n      return vs;\n    },\n  },\n\n  /**\n   * The GLSL source code for the fragment shader.\n   *\n   * @memberof PolylineMaterialAppearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  fragmentShaderSource: {\n    get: function () {\n      return this._fragmentShaderSource;\n    },\n  },\n\n  /**\n   * The WebGL fixed-function state to use when rendering the geometry.\n   * <p>\n   * The render state can be explicitly defined when constructing a {@link PolylineMaterialAppearance}\n   * instance, or it is set implicitly via {@link PolylineMaterialAppearance#translucent}\n   * and {@link PolylineMaterialAppearance#closed}.\n   * </p>\n   *\n   * @memberof PolylineMaterialAppearance.prototype\n   *\n   * @type {object}\n   * @readonly\n   */\n  renderState: {\n    get: function () {\n      return this._renderState;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the geometry is expected to be closed so\n   * {@link PolylineMaterialAppearance#renderState} has backface culling enabled.\n   * This is always <code>false</code> for <code>PolylineMaterialAppearance</code>.\n   *\n   * @memberof PolylineMaterialAppearance.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  closed: {\n    get: function () {\n      return this._closed;\n    },\n  },\n\n  /**\n   * The {@link VertexFormat} that this appearance instance is compatible with.\n   * A geometry can have more vertex attributes and still be compatible - at a\n   * potential performance cost - but it can't have less.\n   *\n   * @memberof PolylineMaterialAppearance.prototype\n   *\n   * @type VertexFormat\n   * @readonly\n   *\n   * @default {@link PolylineMaterialAppearance.VERTEX_FORMAT}\n   */\n  vertexFormat: {\n    get: function () {\n      return this._vertexFormat;\n    },\n  },\n});\n\n/**\n * The {@link VertexFormat} that all {@link PolylineMaterialAppearance} instances\n * are compatible with. This requires <code>position</code> and <code>st</code> attributes.\n *\n * @type VertexFormat\n *\n * @constant\n */\nPolylineMaterialAppearance.VERTEX_FORMAT = VertexFormat.POSITION_AND_ST;\n\n/**\n * Procedurally creates the full GLSL fragment shader source.  For {@link PolylineMaterialAppearance},\n * this is derived from {@link PolylineMaterialAppearance#fragmentShaderSource} and {@link PolylineMaterialAppearance#material}.\n *\n * @function\n *\n * @returns {string} The full GLSL fragment shader source.\n */\nPolylineMaterialAppearance.prototype.getFragmentShaderSource =\n  Appearance.prototype.getFragmentShaderSource;\n\n/**\n * Determines if the geometry is translucent based on {@link PolylineMaterialAppearance#translucent} and {@link Material#isTranslucent}.\n *\n * @function\n *\n * @returns {boolean} <code>true</code> if the appearance is translucent.\n */\nPolylineMaterialAppearance.prototype.isTranslucent =\n  Appearance.prototype.isTranslucent;\n\n/**\n * Creates a render state.  This is not the final render state instance; instead,\n * it can contain a subset of render state properties identical to the render state\n * created in the context.\n *\n * @function\n *\n * @returns {object} The render state.\n */\nPolylineMaterialAppearance.prototype.getRenderState =\n  Appearance.prototype.getRenderState;\nexport default PolylineMaterialAppearance;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GeometryInstanceAttribute from \"../Core/GeometryInstanceAttribute.js\";\nimport GroundPolylineGeometry from \"../Core/GroundPolylineGeometry.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport PolylineShadowVolumeFS from \"../Shaders/PolylineShadowVolumeFS.js\";\nimport PolylineShadowVolumeMorphFS from \"../Shaders/PolylineShadowVolumeMorphFS.js\";\nimport PolylineShadowVolumeMorphVS from \"../Shaders/PolylineShadowVolumeMorphVS.js\";\nimport PolylineShadowVolumeVS from \"../Shaders/PolylineShadowVolumeVS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport ClassificationType from \"./ClassificationType.js\";\nimport CullFace from \"./CullFace.js\";\nimport PolylineColorAppearance from \"./PolylineColorAppearance.js\";\nimport PolylineMaterialAppearance from \"./PolylineMaterialAppearance.js\";\nimport Primitive from \"./Primitive.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\n\n/**\n * A GroundPolylinePrimitive represents a polyline draped over the terrain or 3D Tiles in the {@link Scene}.\n * <p>\n * Only to be used with GeometryInstances containing {@link GroundPolylineGeometry}.\n * </p>\n *\n * @alias GroundPolylinePrimitive\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Array|GeometryInstance} [options.geometryInstances] GeometryInstances containing GroundPolylineGeometry\n * @param {Appearance} [options.appearance] The Appearance used to render the polyline. Defaults to a white color {@link Material} on a {@link PolylineMaterialAppearance}.\n * @param {boolean} [options.show=true] Determines if this primitive will be shown.\n * @param {boolean} [options.interleave=false] When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.\n * @param {boolean} [options.releaseGeometryInstances=true] When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n * @param {boolean} [options.allowPicking=true] When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}.  When <code>false</code>, GPU memory is saved.\n * @param {boolean} [options.asynchronous=true] Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.\n * @param {ClassificationType} [options.classificationType=ClassificationType.BOTH] Determines whether terrain, 3D Tiles or both will be classified.\n * @param {boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {boolean} [options.debugShowShadowVolume=false] For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be <code>true</code> on creation to have effect.\n *\n * @example\n * // 1. Draw a polyline on terrain with a basic color material\n *\n * const instance = new Cesium.GeometryInstance({\n *   geometry : new Cesium.GroundPolylineGeometry({\n *      positions : Cesium.Cartesian3.fromDegreesArray([\n *          -112.1340164450331, 36.05494287836128,\n *          -112.08821010582645, 36.097804071380715\n *      ]),\n *      width : 4.0\n *   }),\n *   id : 'object returned when this instance is picked and to get/set per-instance attributes'\n * });\n *\n * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({\n *   geometryInstances : instance,\n *   appearance : new Cesium.PolylineMaterialAppearance()\n * }));\n *\n * // 2. Draw a looped polyline on terrain with per-instance color and a distance display condition.\n * // Distance display conditions for polylines on terrain are based on an approximate terrain height\n * // instead of true terrain height.\n *\n * const instance2 = new Cesium.GeometryInstance({\n *   geometry : new Cesium.GroundPolylineGeometry({\n *      positions : Cesium.Cartesian3.fromDegreesArray([\n *          -112.1340164450331, 36.05494287836128,\n *          -112.08821010582645, 36.097804071380715,\n *          -112.13296079730024, 36.168769146801104\n *      ]),\n *      loop : true,\n *      width : 4.0\n *   }),\n *   attributes : {\n *      color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('green').withAlpha(0.7)),\n *      distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(1000, 30000)\n *   },\n *   id : 'object returned when this instance is picked and to get/set per-instance attributes'\n * });\n *\n * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({\n *   geometryInstances : instance2,\n *   appearance : new Cesium.PolylineColorAppearance()\n * }));\n */\nfunction GroundPolylinePrimitive(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * The geometry instances rendered with this primitive. This may\n   * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>\n   * is <code>true</code> when the primitive is constructed.\n   * <p>\n   * Changing this property after the primitive is rendered has no effect.\n   * </p>\n   *\n   * @readonly\n   * @type {Array|GeometryInstance}\n   *\n   * @default undefined\n   */\n  this.geometryInstances = options.geometryInstances;\n  this._hasPerInstanceColors = true;\n\n  let appearance = options.appearance;\n  if (!defined(appearance)) {\n    appearance = new PolylineMaterialAppearance();\n  }\n  /**\n   * The {@link Appearance} used to shade this primitive. Each geometry\n   * instance is shaded with the same appearance.  Some appearances, like\n   * {@link PolylineColorAppearance} allow giving each instance unique\n   * properties.\n   *\n   * @type Appearance\n   *\n   * @default undefined\n   */\n  this.appearance = appearance;\n\n  /**\n   * Determines if the primitive will be shown.  This affects all geometry\n   * instances in the primitive.\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  /**\n   * Determines whether terrain, 3D Tiles or both will be classified.\n   *\n   * @type {ClassificationType}\n   *\n   * @default ClassificationType.BOTH\n   */\n  this.classificationType = defaultValue(\n    options.classificationType,\n    ClassificationType.BOTH\n  );\n\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the bounding sphere for each draw command in the primitive.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowBoundingVolume = defaultValue(\n    options.debugShowBoundingVolume,\n    false\n  );\n\n  // Shadow volume is shown by removing a discard in the shader, so this isn't toggleable.\n  this._debugShowShadowVolume = defaultValue(\n    options.debugShowShadowVolume,\n    false\n  );\n\n  this._primitiveOptions = {\n    geometryInstances: undefined,\n    appearance: undefined,\n    vertexCacheOptimize: false,\n    interleave: defaultValue(options.interleave, false),\n    releaseGeometryInstances: defaultValue(\n      options.releaseGeometryInstances,\n      true\n    ),\n    allowPicking: defaultValue(options.allowPicking, true),\n    asynchronous: defaultValue(options.asynchronous, true),\n    compressVertices: false,\n    _createShaderProgramFunction: undefined,\n    _createCommandsFunction: undefined,\n    _updateAndQueueCommandsFunction: undefined,\n  };\n\n  // Used when inserting in an OrderedPrimitiveCollection\n  this._zIndex = undefined;\n\n  this._ready = false;\n  this._primitive = undefined;\n\n  this._sp = undefined;\n  this._sp2D = undefined;\n  this._spMorph = undefined;\n\n  this._renderState = getRenderState(false);\n  this._renderState3DTiles = getRenderState(true);\n\n  this._renderStateMorph = RenderState.fromCache({\n    cull: {\n      enabled: true,\n      face: CullFace.FRONT, // Geometry is \"inverted,\" so cull front when materials on volume instead of on terrain (morph)\n    },\n    depthTest: {\n      enabled: true,\n    },\n    blending: BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,\n    depthMask: false,\n  });\n}\n\nObject.defineProperties(GroundPolylinePrimitive.prototype, {\n  /**\n   * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.\n   *\n   * @memberof GroundPolylinePrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  interleave: {\n    get: function () {\n      return this._primitiveOptions.interleave;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n   *\n   * @memberof GroundPolylinePrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  releaseGeometryInstances: {\n    get: function () {\n      return this._primitiveOptions.releaseGeometryInstances;\n    },\n  },\n\n  /**\n   * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}.  When <code>false</code>, GPU memory is saved.\n   *\n   * @memberof GroundPolylinePrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  allowPicking: {\n    get: function () {\n      return this._primitiveOptions.allowPicking;\n    },\n  },\n\n  /**\n   * Determines if the geometry instances will be created and batched on a web worker.\n   *\n   * @memberof GroundPolylinePrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  asynchronous: {\n    get: function () {\n      return this._primitiveOptions.asynchronous;\n    },\n  },\n\n  /**\n   * Determines if the primitive is complete and ready to render.  If this property is\n   * true, the primitive will be rendered the next time that {@link GroundPolylinePrimitive#update}\n   * is called.\n   *\n   * @memberof GroundPolylinePrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * If true, draws the shadow volume for each geometry in the primitive.\n   * </p>\n   *\n   * @memberof GroundPolylinePrimitive.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  debugShowShadowVolume: {\n    get: function () {\n      return this._debugShowShadowVolume;\n    },\n  },\n});\n\n/**\n * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the\n * GroundPolylinePrimitive synchronously.\n *\n * @returns {Promise<void>} A promise that will resolve once the terrain heights have been loaded.\n */\nGroundPolylinePrimitive.initializeTerrainHeights = function () {\n  return ApproximateTerrainHeights.initialize();\n};\n\nfunction createShaderProgram(groundPolylinePrimitive, frameState, appearance) {\n  const context = frameState.context;\n  const primitive = groundPolylinePrimitive._primitive;\n  const attributeLocations = primitive._attributeLocations;\n\n  let vs = primitive._batchTable.getVertexShaderCallback()(\n    PolylineShadowVolumeVS\n  );\n  vs = Primitive._appendShowToShader(primitive, vs);\n  vs = Primitive._appendDistanceDisplayConditionToShader(primitive, vs);\n  vs = Primitive._modifyShaderPosition(\n    groundPolylinePrimitive,\n    vs,\n    frameState.scene3DOnly\n  );\n\n  let vsMorph = primitive._batchTable.getVertexShaderCallback()(\n    PolylineShadowVolumeMorphVS\n  );\n  vsMorph = Primitive._appendShowToShader(primitive, vsMorph);\n  vsMorph = Primitive._appendDistanceDisplayConditionToShader(\n    primitive,\n    vsMorph\n  );\n  vsMorph = Primitive._modifyShaderPosition(\n    groundPolylinePrimitive,\n    vsMorph,\n    frameState.scene3DOnly\n  );\n\n  // Access pick color from fragment shader.\n  // Helps with varying budget.\n  let fs = primitive._batchTable.getVertexShaderCallback()(\n    PolylineShadowVolumeFS\n  );\n\n  const vsDefines = [\n    `GLOBE_MINIMUM_ALTITUDE ${frameState.mapProjection.ellipsoid.minimumRadius.toFixed(\n      1\n    )}`,\n  ];\n  let colorDefine = \"\";\n  let materialShaderSource = \"\";\n  if (defined(appearance.material)) {\n    materialShaderSource = defined(appearance.material)\n      ? appearance.material.shaderSource\n      : \"\";\n\n    // Check for use of v_width and v_polylineAngle in material shader\n    // to determine whether these varyings should be active in the vertex shader.\n    if (materialShaderSource.search(/in\\s+float\\s+v_polylineAngle;/g) !== -1) {\n      vsDefines.push(\"ANGLE_VARYING\");\n    }\n    if (materialShaderSource.search(/in\\s+float\\s+v_width;/g) !== -1) {\n      vsDefines.push(\"WIDTH_VARYING\");\n    }\n  } else {\n    colorDefine = \"PER_INSTANCE_COLOR\";\n  }\n\n  vsDefines.push(colorDefine);\n  const fsDefines = groundPolylinePrimitive.debugShowShadowVolume\n    ? [\"DEBUG_SHOW_VOLUME\", colorDefine]\n    : [colorDefine];\n\n  const vsColor3D = new ShaderSource({\n    defines: vsDefines,\n    sources: [vs],\n  });\n  const fsColor3D = new ShaderSource({\n    defines: fsDefines,\n    sources: [materialShaderSource, fs],\n  });\n  groundPolylinePrimitive._sp = ShaderProgram.replaceCache({\n    context: context,\n    shaderProgram: primitive._sp,\n    vertexShaderSource: vsColor3D,\n    fragmentShaderSource: fsColor3D,\n    attributeLocations: attributeLocations,\n  });\n\n  // Derive 2D/CV\n  let colorProgram2D = context.shaderCache.getDerivedShaderProgram(\n    groundPolylinePrimitive._sp,\n    \"2dColor\"\n  );\n  if (!defined(colorProgram2D)) {\n    const vsColor2D = new ShaderSource({\n      defines: vsDefines.concat([\"COLUMBUS_VIEW_2D\"]),\n      sources: [vs],\n    });\n    colorProgram2D = context.shaderCache.createDerivedShaderProgram(\n      groundPolylinePrimitive._sp,\n      \"2dColor\",\n      {\n        context: context,\n        shaderProgram: groundPolylinePrimitive._sp2D,\n        vertexShaderSource: vsColor2D,\n        fragmentShaderSource: fsColor3D,\n        attributeLocations: attributeLocations,\n      }\n    );\n  }\n  groundPolylinePrimitive._sp2D = colorProgram2D;\n\n  // Derive Morph\n  let colorProgramMorph = context.shaderCache.getDerivedShaderProgram(\n    groundPolylinePrimitive._sp,\n    \"MorphColor\"\n  );\n  if (!defined(colorProgramMorph)) {\n    const vsColorMorph = new ShaderSource({\n      defines: vsDefines.concat([\n        `MAX_TERRAIN_HEIGHT ${ApproximateTerrainHeights._defaultMaxTerrainHeight.toFixed(\n          1\n        )}`,\n      ]),\n      sources: [vsMorph],\n    });\n\n    fs = primitive._batchTable.getVertexShaderCallback()(\n      PolylineShadowVolumeMorphFS\n    );\n    const fsColorMorph = new ShaderSource({\n      defines: fsDefines,\n      sources: [materialShaderSource, fs],\n    });\n    colorProgramMorph = context.shaderCache.createDerivedShaderProgram(\n      groundPolylinePrimitive._sp,\n      \"MorphColor\",\n      {\n        context: context,\n        shaderProgram: groundPolylinePrimitive._spMorph,\n        vertexShaderSource: vsColorMorph,\n        fragmentShaderSource: fsColorMorph,\n        attributeLocations: attributeLocations,\n      }\n    );\n  }\n  groundPolylinePrimitive._spMorph = colorProgramMorph;\n}\n\nfunction getRenderState(mask3DTiles) {\n  return RenderState.fromCache({\n    cull: {\n      enabled: true, // prevent double-draw. Geometry is \"inverted\" (reversed winding order) so we're drawing backfaces.\n    },\n    blending: BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,\n    depthMask: false,\n    stencilTest: {\n      enabled: mask3DTiles,\n      frontFunction: StencilFunction.EQUAL,\n      frontOperation: {\n        fail: StencilOperation.KEEP,\n        zFail: StencilOperation.KEEP,\n        zPass: StencilOperation.KEEP,\n      },\n      backFunction: StencilFunction.EQUAL,\n      backOperation: {\n        fail: StencilOperation.KEEP,\n        zFail: StencilOperation.KEEP,\n        zPass: StencilOperation.KEEP,\n      },\n      reference: StencilConstants.CESIUM_3D_TILE_MASK,\n      mask: StencilConstants.CESIUM_3D_TILE_MASK,\n    },\n  });\n}\n\nfunction createCommands(\n  groundPolylinePrimitive,\n  appearance,\n  material,\n  translucent,\n  colorCommands,\n  pickCommands\n) {\n  const primitive = groundPolylinePrimitive._primitive;\n  const length = primitive._va.length;\n  colorCommands.length = length;\n  pickCommands.length = length;\n\n  const isPolylineColorAppearance =\n    appearance instanceof PolylineColorAppearance;\n\n  const materialUniforms = isPolylineColorAppearance ? {} : material._uniforms;\n  const uniformMap = primitive._batchTable.getUniformMapCallback()(\n    materialUniforms\n  );\n\n  for (let i = 0; i < length; i++) {\n    const vertexArray = primitive._va[i];\n\n    let command = colorCommands[i];\n    if (!defined(command)) {\n      command = colorCommands[i] = new DrawCommand({\n        owner: groundPolylinePrimitive,\n        primitiveType: primitive._primitiveType,\n      });\n    }\n\n    command.vertexArray = vertexArray;\n    command.renderState = groundPolylinePrimitive._renderState;\n    command.shaderProgram = groundPolylinePrimitive._sp;\n    command.uniformMap = uniformMap;\n    command.pass = Pass.TERRAIN_CLASSIFICATION;\n    command.pickId = \"czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)\";\n\n    const derivedTilesetCommand = DrawCommand.shallowClone(\n      command,\n      command.derivedCommands.tileset\n    );\n    derivedTilesetCommand.renderState =\n      groundPolylinePrimitive._renderState3DTiles;\n    derivedTilesetCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n    command.derivedCommands.tileset = derivedTilesetCommand;\n\n    // derive for 2D\n    const derived2DCommand = DrawCommand.shallowClone(\n      command,\n      command.derivedCommands.color2D\n    );\n    derived2DCommand.shaderProgram = groundPolylinePrimitive._sp2D;\n    command.derivedCommands.color2D = derived2DCommand;\n\n    const derived2DTilesetCommand = DrawCommand.shallowClone(\n      derivedTilesetCommand,\n      derivedTilesetCommand.derivedCommands.color2D\n    );\n    derived2DTilesetCommand.shaderProgram = groundPolylinePrimitive._sp2D;\n    derivedTilesetCommand.derivedCommands.color2D = derived2DTilesetCommand;\n\n    // derive for Morph\n    const derivedMorphCommand = DrawCommand.shallowClone(\n      command,\n      command.derivedCommands.colorMorph\n    );\n    derivedMorphCommand.renderState = groundPolylinePrimitive._renderStateMorph;\n    derivedMorphCommand.shaderProgram = groundPolylinePrimitive._spMorph;\n    derivedMorphCommand.pickId = \"czm_batchTable_pickColor(v_batchId)\";\n    command.derivedCommands.colorMorph = derivedMorphCommand;\n  }\n}\n\nfunction updateAndQueueCommand(\n  groundPolylinePrimitive,\n  command,\n  frameState,\n  modelMatrix,\n  cull,\n  boundingVolume,\n  debugShowBoundingVolume\n) {\n  // Use derived appearance command for morph and 2D\n  if (frameState.mode === SceneMode.MORPHING) {\n    command = command.derivedCommands.colorMorph;\n  } else if (frameState.mode !== SceneMode.SCENE3D) {\n    command = command.derivedCommands.color2D;\n  }\n  command.modelMatrix = modelMatrix;\n  command.boundingVolume = boundingVolume;\n  command.cull = cull;\n  command.debugShowBoundingVolume = debugShowBoundingVolume;\n\n  frameState.commandList.push(command);\n}\n\nfunction updateAndQueueCommands(\n  groundPolylinePrimitive,\n  frameState,\n  colorCommands,\n  pickCommands,\n  modelMatrix,\n  cull,\n  debugShowBoundingVolume\n) {\n  const primitive = groundPolylinePrimitive._primitive;\n\n  Primitive._updateBoundingVolumes(primitive, frameState, modelMatrix); // Expected to be identity - GroundPrimitives don't support other model matrices\n\n  let boundingSpheres;\n  if (frameState.mode === SceneMode.SCENE3D) {\n    boundingSpheres = primitive._boundingSphereWC;\n  } else if (frameState.mode === SceneMode.COLUMBUS_VIEW) {\n    boundingSpheres = primitive._boundingSphereCV;\n  } else if (\n    frameState.mode === SceneMode.SCENE2D &&\n    defined(primitive._boundingSphere2D)\n  ) {\n    boundingSpheres = primitive._boundingSphere2D;\n  } else if (defined(primitive._boundingSphereMorph)) {\n    boundingSpheres = primitive._boundingSphereMorph;\n  }\n\n  const morphing = frameState.mode === SceneMode.MORPHING;\n  const classificationType = groundPolylinePrimitive.classificationType;\n  const queueTerrainCommands =\n    classificationType !== ClassificationType.CESIUM_3D_TILE;\n  const queue3DTilesCommands =\n    classificationType !== ClassificationType.TERRAIN && !morphing;\n\n  let command;\n  const passes = frameState.passes;\n  if (passes.render || (passes.pick && primitive.allowPicking)) {\n    const colorLength = colorCommands.length;\n    for (let j = 0; j < colorLength; ++j) {\n      const boundingVolume = boundingSpheres[j];\n      if (queueTerrainCommands) {\n        command = colorCommands[j];\n        updateAndQueueCommand(\n          groundPolylinePrimitive,\n          command,\n          frameState,\n          modelMatrix,\n          cull,\n          boundingVolume,\n          debugShowBoundingVolume\n        );\n      }\n      if (queue3DTilesCommands) {\n        command = colorCommands[j].derivedCommands.tileset;\n        updateAndQueueCommand(\n          groundPolylinePrimitive,\n          command,\n          frameState,\n          modelMatrix,\n          cull,\n          boundingVolume,\n          debugShowBoundingVolume\n        );\n      }\n    }\n  }\n}\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly.  This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {DeveloperError} For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.\n * @exception {DeveloperError} All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.\n */\nGroundPolylinePrimitive.prototype.update = function (frameState) {\n  if (!defined(this._primitive) && !defined(this.geometryInstances)) {\n    return;\n  }\n\n  if (!ApproximateTerrainHeights.initialized) {\n    //>>includeStart('debug', pragmas.debug);\n    if (!this.asynchronous) {\n      throw new DeveloperError(\n        \"For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.\"\n      );\n    }\n    //>>includeEnd('debug');\n\n    GroundPolylinePrimitive.initializeTerrainHeights();\n    return;\n  }\n\n  let i;\n\n  const that = this;\n  const primitiveOptions = this._primitiveOptions;\n  if (!defined(this._primitive)) {\n    const geometryInstances = Array.isArray(this.geometryInstances)\n      ? this.geometryInstances\n      : [this.geometryInstances];\n    const geometryInstancesLength = geometryInstances.length;\n    const groundInstances = new Array(geometryInstancesLength);\n\n    let attributes;\n\n    // Check if each instance has a color attribute.\n    for (i = 0; i < geometryInstancesLength; ++i) {\n      attributes = geometryInstances[i].attributes;\n      if (!defined(attributes) || !defined(attributes.color)) {\n        this._hasPerInstanceColors = false;\n        break;\n      }\n    }\n\n    for (i = 0; i < geometryInstancesLength; ++i) {\n      const geometryInstance = geometryInstances[i];\n      attributes = {};\n      const instanceAttributes = geometryInstance.attributes;\n      for (const attributeKey in instanceAttributes) {\n        if (instanceAttributes.hasOwnProperty(attributeKey)) {\n          attributes[attributeKey] = instanceAttributes[attributeKey];\n        }\n      }\n\n      // Automatically create line width attribute if not already given\n      if (!defined(attributes.width)) {\n        attributes.width = new GeometryInstanceAttribute({\n          componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n          componentsPerAttribute: 1.0,\n          value: [geometryInstance.geometry.width],\n        });\n      }\n\n      // Update each geometry for framestate.scene3DOnly = true and projection\n      geometryInstance.geometry._scene3DOnly = frameState.scene3DOnly;\n      GroundPolylineGeometry.setProjectionAndEllipsoid(\n        geometryInstance.geometry,\n        frameState.mapProjection\n      );\n\n      groundInstances[i] = new GeometryInstance({\n        geometry: geometryInstance.geometry,\n        attributes: attributes,\n        id: geometryInstance.id,\n        pickPrimitive: that,\n      });\n    }\n\n    primitiveOptions.geometryInstances = groundInstances;\n    primitiveOptions.appearance = this.appearance;\n\n    primitiveOptions._createShaderProgramFunction = function (\n      primitive,\n      frameState,\n      appearance\n    ) {\n      createShaderProgram(that, frameState, appearance);\n    };\n    primitiveOptions._createCommandsFunction = function (\n      primitive,\n      appearance,\n      material,\n      translucent,\n      twoPasses,\n      colorCommands,\n      pickCommands\n    ) {\n      createCommands(\n        that,\n        appearance,\n        material,\n        translucent,\n        colorCommands,\n        pickCommands\n      );\n    };\n    primitiveOptions._updateAndQueueCommandsFunction = function (\n      primitive,\n      frameState,\n      colorCommands,\n      pickCommands,\n      modelMatrix,\n      cull,\n      debugShowBoundingVolume,\n      twoPasses\n    ) {\n      updateAndQueueCommands(\n        that,\n        frameState,\n        colorCommands,\n        pickCommands,\n        modelMatrix,\n        cull,\n        debugShowBoundingVolume\n      );\n    };\n\n    this._primitive = new Primitive(primitiveOptions);\n  }\n\n  if (\n    this.appearance instanceof PolylineColorAppearance &&\n    !this._hasPerInstanceColors\n  ) {\n    throw new DeveloperError(\n      \"All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.\"\n    );\n  }\n\n  this._primitive.appearance = this.appearance;\n  this._primitive.show = this.show;\n  this._primitive.debugShowBoundingVolume = this.debugShowBoundingVolume;\n  this._primitive.update(frameState);\n  frameState.afterRender.push(() => {\n    if (!this._ready && defined(this._primitive) && this._primitive.ready) {\n      this._ready = true;\n\n      if (this.releaseGeometryInstances) {\n        this.geometryInstances = undefined;\n      }\n    }\n  });\n};\n\n/**\n * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.\n *\n * @param {*} id The id of the {@link GeometryInstance}.\n * @returns {object} The typed array in the attribute's format or undefined if the is no instance with id.\n *\n * @exception {DeveloperError} must call update before calling getGeometryInstanceAttributes.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);\n * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);\n */\nGroundPolylinePrimitive.prototype.getGeometryInstanceAttributes = function (\n  id\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(this._primitive)) {\n    throw new DeveloperError(\n      \"must call update before calling getGeometryInstanceAttributes\"\n    );\n  }\n  //>>includeEnd('debug');\n  return this._primitive.getGeometryInstanceAttributes(id);\n};\n\n/**\n * Checks if the given Scene supports GroundPolylinePrimitives.\n * GroundPolylinePrimitives require support for the WEBGL_depth_texture extension.\n *\n * @param {Scene} scene The current scene.\n * @returns {boolean} Whether or not the current scene supports GroundPolylinePrimitives.\n */\nGroundPolylinePrimitive.isSupported = function (scene) {\n  return scene.frameState.context.depthTexture;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see GroundPolylinePrimitive#destroy\n */\nGroundPolylinePrimitive.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * e = e && e.destroy();\n *\n * @see GroundPolylinePrimitive#isDestroyed\n */\nGroundPolylinePrimitive.prototype.destroy = function () {\n  this._primitive = this._primitive && this._primitive.destroy();\n  this._sp = this._sp && this._sp.destroy();\n\n  // Derived programs, destroyed above if they existed.\n  this._sp2D = undefined;\n  this._spMorph = undefined;\n\n  return destroyObject(this);\n};\nexport default GroundPolylinePrimitive;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\nconst defaultRepeat = new Cartesian2(1, 1);\nconst defaultTransparent = false;\nconst defaultColor = Color.WHITE;\n\n/**\n * A {@link MaterialProperty} that maps to image {@link Material} uniforms.\n * @alias ImageMaterialProperty\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Property|string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} [options.image] A Property specifying the Image, URL, Canvas, or Video.\n * @param {Property|Cartesian2} [options.repeat=new Cartesian2(1.0, 1.0)] A {@link Cartesian2} Property specifying the number of times the image repeats in each direction.\n * @param {Property|Color} [options.color=Color.WHITE] The color applied to the image\n * @param {Property|boolean} [options.transparent=false] Set to true when the image has transparency (for example, when a png has transparent sections)\n */\nfunction ImageMaterialProperty(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._definitionChanged = new Event();\n  this._image = undefined;\n  this._imageSubscription = undefined;\n  this._repeat = undefined;\n  this._repeatSubscription = undefined;\n  this._color = undefined;\n  this._colorSubscription = undefined;\n  this._transparent = undefined;\n  this._transparentSubscription = undefined;\n\n  this.image = options.image;\n  this.repeat = options.repeat;\n  this.color = options.color;\n  this.transparent = options.transparent;\n}\n\nObject.defineProperties(ImageMaterialProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof ImageMaterialProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return (\n        Property.isConstant(this._image) && Property.isConstant(this._repeat)\n      );\n    },\n  },\n\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof ImageMaterialProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the Property specifying Image, URL, Canvas, or Video to use.\n   * @memberof ImageMaterialProperty.prototype\n   * @type {Property|undefined}\n   */\n  image: createPropertyDescriptor(\"image\"),\n\n  /**\n   * Gets or sets the {@link Cartesian2} Property specifying the number of times the image repeats in each direction.\n   * @memberof ImageMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default new Cartesian2(1, 1)\n   */\n  repeat: createPropertyDescriptor(\"repeat\"),\n\n  /**\n   * Gets or sets the Color Property specifying the desired color applied to the image.\n   * @memberof ImageMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  color: createPropertyDescriptor(\"color\"),\n\n  /**\n   * Gets or sets the Boolean Property specifying whether the image has transparency\n   * @memberof ImageMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  transparent: createPropertyDescriptor(\"transparent\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {string} The type of material.\n */\nImageMaterialProperty.prototype.getType = function (time) {\n  return \"Image\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nImageMaterialProperty.prototype.getValue = function (time, result) {\n  if (!defined(result)) {\n    result = {};\n  }\n\n  result.image = Property.getValueOrUndefined(this._image, time);\n  result.repeat = Property.getValueOrClonedDefault(\n    this._repeat,\n    time,\n    defaultRepeat,\n    result.repeat\n  );\n  result.color = Property.getValueOrClonedDefault(\n    this._color,\n    time,\n    defaultColor,\n    result.color\n  );\n  if (Property.getValueOrDefault(this._transparent, time, defaultTransparent)) {\n    result.color.alpha = Math.min(0.99, result.color.alpha);\n  }\n\n  return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nImageMaterialProperty.prototype.equals = function (other) {\n  return (\n    this === other ||\n    (other instanceof ImageMaterialProperty &&\n      Property.equals(this._image, other._image) &&\n      Property.equals(this._repeat, other._repeat) &&\n      Property.equals(this._color, other._color) &&\n      Property.equals(this._transparent, other._transparent))\n  );\n};\nexport default ImageMaterialProperty;\n", "import Color from \"../Core/Color.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Resource from \"../Core/Resource.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport ImageMaterialProperty from \"./ImageMaterialProperty.js\";\n\nfunction createMaterialProperty(value) {\n  if (value instanceof Color) {\n    return new ColorMaterialProperty(value);\n  }\n\n  if (\n    typeof value === \"string\" ||\n    value instanceof Resource ||\n    value instanceof HTMLCanvasElement ||\n    value instanceof HTMLVideoElement\n  ) {\n    const result = new ImageMaterialProperty();\n    result.image = value;\n    return result;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  throw new DeveloperError(`Unable to infer material type: ${value}`);\n  //>>includeEnd('debug');\n}\n\n/**\n * @private\n */\nfunction createMaterialPropertyDescriptor(name, configurable) {\n  return createPropertyDescriptor(name, configurable, createMaterialProperty);\n}\nexport default createMaterialPropertyDescriptor;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {object} BoxGraphics.ConstructorOptions\n *\n * Initialization options for the BoxGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the box.\n * @property {Property | Cartesian3} [dimensions] A {@link Cartesian3} Property specifying the length, width, and height of the box.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height from the entity position is relative to.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the box is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the box.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the box is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the box casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this box will be displayed.\n *\n */\n\n/**\n * Describes a box. The center position and orientation are determined by the containing {@link Entity}.\n *\n * @alias BoxGraphics\n * @constructor\n *\n * @param {BoxGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Box.html|Cesium Sandcastle Box Demo}\n */\nfunction BoxGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._dimensions = undefined;\n  this._dimensionsSubscription = undefined;\n  this._heightReference = undefined;\n  this._heightReferenceSubscription = undefined;\n  this._fill = undefined;\n  this._fillSubscription = undefined;\n  this._material = undefined;\n  this._materialSubscription = undefined;\n  this._outline = undefined;\n  this._outlineSubscription = undefined;\n  this._outlineColor = undefined;\n  this._outlineColorSubscription = undefined;\n  this._outlineWidth = undefined;\n  this._outlineWidthSubscription = undefined;\n  this._shadows = undefined;\n  this._shadowsSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distanceDisplayConditionSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(BoxGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof BoxGraphics.prototype\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the box.\n   * @memberof BoxGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets {@link Cartesian3} Property property specifying the length, width, and height of the box.\n   * @memberof BoxGraphics.prototype\n   * @type {Property|undefined}\n   */\n  dimensions: createPropertyDescriptor(\"dimensions\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link HeightReference}.\n   * @memberof BoxGraphics.prototype\n   * @type {Property|undefined}\n   * @default HeightReference.NONE\n   */\n  heightReference: createPropertyDescriptor(\"heightReference\"),\n\n  /**\n   * Gets or sets the boolean Property specifying whether the box is filled with the provided material.\n   * @memberof BoxGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  fill: createPropertyDescriptor(\"fill\"),\n\n  /**\n   * Gets or sets the material used to fill the box.\n   * @memberof BoxGraphics.prototype\n   * @type {MaterialProperty|undefined}\n   * @default Color.WHITE\n   */\n  material: createMaterialPropertyDescriptor(\"material\"),\n\n  /**\n   * Gets or sets the Property specifying whether the box is outlined.\n   * @memberof BoxGraphics.prototype\n   * @type {Property|undefined}\n   * @default false\n   */\n  outline: createPropertyDescriptor(\"outline\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the outline.\n   * @memberof BoxGraphics.prototype\n   * @type {Property|undefined}\n   * @default Color.BLACK\n   */\n  outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the width of the outline.\n   * <p>\n   * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n   * </p>\n   * @memberof BoxGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n  /**\n   * Get or sets the enum Property specifying whether the box\n   * casts or receives shadows from light sources.\n   * @memberof BoxGraphics.prototype\n   * @type {Property|undefined}\n   * @default ShadowMode.DISABLED\n   */\n  shadows: createPropertyDescriptor(\"shadows\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this box will be displayed.\n   * @memberof BoxGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {BoxGraphics} [result] The object onto which to store the result.\n * @returns {BoxGraphics} The modified result parameter or a new instance if one was not provided.\n */\nBoxGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new BoxGraphics(this);\n  }\n  result.show = this.show;\n  result.dimensions = this.dimensions;\n  result.heightReference = this.heightReference;\n  result.fill = this.fill;\n  result.material = this.material;\n  result.outline = this.outline;\n  result.outlineColor = this.outlineColor;\n  result.outlineWidth = this.outlineWidth;\n  result.shadows = this.shadows;\n  result.distanceDisplayCondition = this.distanceDisplayCondition;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {BoxGraphics} source The object to be merged into this object.\n */\nBoxGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.dimensions = defaultValue(this.dimensions, source.dimensions);\n  this.heightReference = defaultValue(\n    this.heightReference,\n    source.heightReference\n  );\n  this.fill = defaultValue(this.fill, source.fill);\n  this.material = defaultValue(this.material, source.material);\n  this.outline = defaultValue(this.outline, source.outline);\n  this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n  this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n  this.shadows = defaultValue(this.shadows, source.shadows);\n  this.distanceDisplayCondition = defaultValue(\n    this.distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n};\nexport default BoxGraphics;\n", "/**\n * Constants for identifying well-known reference frames.\n *\n * @enum {number}\n */\nconst ReferenceFrame = {\n  /**\n   * The fixed frame.\n   *\n   * @type {number}\n   * @constant\n   */\n  FIXED: 0,\n\n  /**\n   * The inertial frame.\n   *\n   * @type {number}\n   * @constant\n   */\n  INERTIAL: 1,\n};\nexport default Object.freeze(ReferenceFrame);\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport Transforms from \"../Core/Transforms.js\";\n\n/**\n * The interface for all {@link Property} objects that define a world\n * location as a {@link Cartesian3} with an associated {@link ReferenceFrame}.\n * This type defines an interface and cannot be instantiated directly.\n *\n * @alias PositionProperty\n * @constructor\n * @abstract\n *\n * @see CompositePositionProperty\n * @see ConstantPositionProperty\n * @see SampledPositionProperty\n * @see TimeIntervalCollectionPositionProperty\n */\nfunction PositionProperty() {\n  DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(PositionProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof PositionProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: DeveloperError.throwInstantiationError,\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof PositionProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: DeveloperError.throwInstantiationError,\n  },\n  /**\n   * Gets the reference frame that the position is defined in.\n   * @memberof PositionProperty.prototype\n   * @type {ReferenceFrame}\n   */\n  referenceFrame: {\n    get: DeveloperError.throwInstantiationError,\n  },\n});\n\n/**\n * Gets the value of the property at the provided time in the fixed frame.\n * @function\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPositionProperty.prototype.getValue = DeveloperError.throwInstantiationError;\n\n/**\n * Gets the value of the property at the provided time and in the provided reference frame.\n * @function\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPositionProperty.prototype.getValueInReferenceFrame =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n * @function\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPositionProperty.prototype.equals = DeveloperError.throwInstantiationError;\n\nconst scratchMatrix3 = new Matrix3();\n\n/**\n * @private\n */\nPositionProperty.convertToReferenceFrame = function (\n  time,\n  value,\n  inputFrame,\n  outputFrame,\n  result\n) {\n  if (!defined(value)) {\n    return value;\n  }\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  if (inputFrame === outputFrame) {\n    return Cartesian3.clone(value, result);\n  }\n\n  let icrfToFixed = Transforms.computeIcrfToFixedMatrix(time, scratchMatrix3);\n  if (!defined(icrfToFixed)) {\n    icrfToFixed = Transforms.computeTemeToPseudoFixedMatrix(\n      time,\n      scratchMatrix3\n    );\n  }\n  if (inputFrame === ReferenceFrame.INERTIAL) {\n    return Matrix3.multiplyByVector(icrfToFixed, value, result);\n  }\n  if (inputFrame === ReferenceFrame.FIXED) {\n    return Matrix3.multiplyByVector(\n      Matrix3.transpose(icrfToFixed, scratchMatrix3),\n      value,\n      result\n    );\n  }\n};\nexport default PositionProperty;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport PositionProperty from \"./PositionProperty.js\";\n\n/**\n * A {@link PositionProperty} whose value does not change in respect to the\n * {@link ReferenceFrame} in which is it defined.\n *\n * @alias ConstantPositionProperty\n * @constructor\n *\n * @param {Cartesian3} [value] The property value.\n * @param {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined.\n */\nfunction ConstantPositionProperty(value, referenceFrame) {\n  this._definitionChanged = new Event();\n  this._value = Cartesian3.clone(value);\n  this._referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED);\n}\n\nObject.defineProperties(ConstantPositionProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof ConstantPositionProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return (\n        !defined(this._value) || this._referenceFrame === ReferenceFrame.FIXED\n      );\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof ConstantPositionProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets the reference frame in which the position is defined.\n   * @memberof ConstantPositionProperty.prototype\n   * @type {ReferenceFrame}\n   * @default ReferenceFrame.FIXED;\n   */\n  referenceFrame: {\n    get: function () {\n      return this._referenceFrame;\n    },\n  },\n});\n\n/**\n * Gets the value of the property at the provided time in the fixed frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nConstantPositionProperty.prototype.getValue = function (time, result) {\n  return this.getValueInReferenceFrame(time, ReferenceFrame.FIXED, result);\n};\n\n/**\n * Sets the value of the property.\n *\n * @param {Cartesian3} value The property value.\n * @param {ReferenceFrame} [referenceFrame=this.referenceFrame] The reference frame in which the position is defined.\n */\nConstantPositionProperty.prototype.setValue = function (value, referenceFrame) {\n  let definitionChanged = false;\n  if (!Cartesian3.equals(this._value, value)) {\n    definitionChanged = true;\n    this._value = Cartesian3.clone(value);\n  }\n  if (defined(referenceFrame) && this._referenceFrame !== referenceFrame) {\n    definitionChanged = true;\n    this._referenceFrame = referenceFrame;\n  }\n  if (definitionChanged) {\n    this._definitionChanged.raiseEvent(this);\n  }\n};\n\n/**\n * Gets the value of the property at the provided time and in the provided reference frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nConstantPositionProperty.prototype.getValueInReferenceFrame = function (\n  time,\n  referenceFrame,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required.\");\n  }\n  if (!defined(referenceFrame)) {\n    throw new DeveloperError(\"referenceFrame is required.\");\n  }\n  //>>includeEnd('debug');\n\n  return PositionProperty.convertToReferenceFrame(\n    time,\n    this._value,\n    this._referenceFrame,\n    referenceFrame,\n    result\n  );\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nConstantPositionProperty.prototype.equals = function (other) {\n  return (\n    this === other ||\n    (other instanceof ConstantPositionProperty &&\n      Cartesian3.equals(this._value, other._value) &&\n      this._referenceFrame === other._referenceFrame)\n  );\n};\nexport default ConstantPositionProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {object} CorridorGraphics.ConstructorOptions\n *\n * Initialization options for the CorridorGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the corridor.\n * @property {Property | Cartesian3[]} [positions] A Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.\n * @property {Property | number} [width] A numeric Property specifying the distance between the edges of the corridor.\n * @property {Property | number} [height=0] A numeric Property specifying the altitude of the corridor relative to the ellipsoid surface.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | number} [extrudedHeight] A numeric Property specifying the altitude of the corridor's extruded face relative to the ellipsoid surface.\n * @property {Property | HeightReference} [extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to.\n * @property {Property | CornerType} [cornerType=CornerType.ROUNDED] A {@link CornerType} Property specifying the style of the corners.\n * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the distance between each latitude and longitude.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the corridor is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the corridor.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the corridor is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the corridor casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this corridor will be displayed.\n * @property {Property | ClassificationType} [classificationType=ClassificationType.BOTH] An enum Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.\n * @property {ConstantProperty | number} [zIndex] A Property specifying the zIndex of the corridor, used for ordering.  Only has an effect if height and extrudedHeight are undefined, and if the corridor is static.\n */\n\n/**\n * Describes a corridor, which is a shape defined by a centerline and width that\n * conforms to the curvature of the globe. It can be placed on the surface or at altitude\n * and can optionally be extruded into a volume.\n *\n * @alias CorridorGraphics\n * @constructor\n *\n * @param {CorridorGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @see Entity\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Corridor.html|Cesium Sandcastle Corridor Demo}\n */\nfunction CorridorGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._positions = undefined;\n  this._positionsSubscription = undefined;\n  this._width = undefined;\n  this._widthSubscription = undefined;\n  this._height = undefined;\n  this._heightSubscription = undefined;\n  this._heightReference = undefined;\n  this._heightReferenceSubscription = undefined;\n  this._extrudedHeight = undefined;\n  this._extrudedHeightSubscription = undefined;\n  this._extrudedHeightReference = undefined;\n  this._extrudedHeightReferenceSubscription = undefined;\n  this._cornerType = undefined;\n  this._cornerTypeSubscription = undefined;\n  this._granularity = undefined;\n  this._granularitySubscription = undefined;\n  this._fill = undefined;\n  this._fillSubscription = undefined;\n  this._material = undefined;\n  this._materialSubscription = undefined;\n  this._outline = undefined;\n  this._outlineSubscription = undefined;\n  this._outlineColor = undefined;\n  this._outlineColorSubscription = undefined;\n  this._outlineWidth = undefined;\n  this._outlineWidthSubscription = undefined;\n  this._shadows = undefined;\n  this._shadowsSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distanceDisplayConditionSubscription = undefined;\n  this._classificationType = undefined;\n  this._classificationTypeSubscription = undefined;\n  this._zIndex = undefined;\n  this._zIndexSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(CorridorGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof CorridorGraphics.prototype\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the corridor.\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets a Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   */\n  positions: createPropertyDescriptor(\"positions\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the width of the outline.\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   */\n  width: createPropertyDescriptor(\"width\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the altitude of the corridor.\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0.0\n   */\n  height: createPropertyDescriptor(\"height\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link HeightReference}.\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   * @default HeightReference.NONE\n   */\n  heightReference: createPropertyDescriptor(\"heightReference\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the altitude of the corridor extrusion.\n   * Setting this property creates a corridor shaped volume starting at height and ending\n   * at this altitude.\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   */\n  extrudedHeight: createPropertyDescriptor(\"extrudedHeight\"),\n\n  /**\n   * Gets or sets the Property specifying the extruded {@link HeightReference}.\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   * @default HeightReference.NONE\n   */\n  extrudedHeightReference: createPropertyDescriptor(\"extrudedHeightReference\"),\n\n  /**\n   * Gets or sets the {@link CornerType} Property specifying how corners are styled.\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   * @default CornerType.ROUNDED\n   */\n  cornerType: createPropertyDescriptor(\"cornerType\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the sampling distance between each latitude and longitude point.\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   * @default {CesiumMath.RADIANS_PER_DEGREE}\n   */\n  granularity: createPropertyDescriptor(\"granularity\"),\n\n  /**\n   * Gets or sets the boolean Property specifying whether the corridor is filled with the provided material.\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  fill: createPropertyDescriptor(\"fill\"),\n\n  /**\n   * Gets or sets the Property specifying the material used to fill the corridor.\n   * @memberof CorridorGraphics.prototype\n   * @type {MaterialProperty|undefined}\n   * @default Color.WHITE\n   */\n  material: createMaterialPropertyDescriptor(\"material\"),\n\n  /**\n   * Gets or sets the Property specifying whether the corridor is outlined.\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   * @default false\n   */\n  outline: createPropertyDescriptor(\"outline\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the outline.\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   * @default Color.BLACK\n   */\n  outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the width of the outline.\n   * <p>\n   * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n   * </p>\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n  /**\n   * Get or sets the enum Property specifying whether the corridor\n   * casts or receives shadows from light sources.\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   * @default ShadowMode.DISABLED\n   */\n  shadows: createPropertyDescriptor(\"shadows\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this corridor will be displayed.\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n\n  /**\n   * Gets or sets the {@link ClassificationType} Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.\n   * @memberof CorridorGraphics.prototype\n   * @type {Property|undefined}\n   * @default ClassificationType.BOTH\n   */\n  classificationType: createPropertyDescriptor(\"classificationType\"),\n\n  /**\n   * Gets or sets the zIndex Property specifying the ordering of the corridor.  Only has an effect if the coridor is static and neither height or exturdedHeight are specified.\n   * @memberof CorridorGraphics.prototype\n   * @type {ConstantProperty|undefined}\n   * @default 0\n   */\n  zIndex: createPropertyDescriptor(\"zIndex\"),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {CorridorGraphics} [result] The object onto which to store the result.\n * @returns {CorridorGraphics} The modified result parameter or a new instance if one was not provided.\n */\nCorridorGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new CorridorGraphics(this);\n  }\n  result.show = this.show;\n  result.positions = this.positions;\n  result.width = this.width;\n  result.height = this.height;\n  result.heightReference = this.heightReference;\n  result.extrudedHeight = this.extrudedHeight;\n  result.extrudedHeightReference = this.extrudedHeightReference;\n  result.cornerType = this.cornerType;\n  result.granularity = this.granularity;\n  result.fill = this.fill;\n  result.material = this.material;\n  result.outline = this.outline;\n  result.outlineColor = this.outlineColor;\n  result.outlineWidth = this.outlineWidth;\n  result.shadows = this.shadows;\n  result.distanceDisplayCondition = this.distanceDisplayCondition;\n  result.classificationType = this.classificationType;\n  result.zIndex = this.zIndex;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {CorridorGraphics} source The object to be merged into this object.\n */\nCorridorGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.positions = defaultValue(this.positions, source.positions);\n  this.width = defaultValue(this.width, source.width);\n  this.height = defaultValue(this.height, source.height);\n  this.heightReference = defaultValue(\n    this.heightReference,\n    source.heightReference\n  );\n  this.extrudedHeight = defaultValue(\n    this.extrudedHeight,\n    source.extrudedHeight\n  );\n  this.extrudedHeightReference = defaultValue(\n    this.extrudedHeightReference,\n    source.extrudedHeightReference\n  );\n  this.cornerType = defaultValue(this.cornerType, source.cornerType);\n  this.granularity = defaultValue(this.granularity, source.granularity);\n  this.fill = defaultValue(this.fill, source.fill);\n  this.material = defaultValue(this.material, source.material);\n  this.outline = defaultValue(this.outline, source.outline);\n  this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n  this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n  this.shadows = defaultValue(this.shadows, source.shadows);\n  this.distanceDisplayCondition = defaultValue(\n    this.distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n  this.classificationType = defaultValue(\n    this.classificationType,\n    source.classificationType\n  );\n  this.zIndex = defaultValue(this.zIndex, source.zIndex);\n};\nexport default CorridorGraphics;\n", "import createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\nfunction createRawProperty(value) {\n  return value;\n}\n\n/**\n * @private\n */\nfunction createRawPropertyDescriptor(name, configurable) {\n  return createPropertyDescriptor(name, configurable, createRawProperty);\n}\nexport default createRawPropertyDescriptor;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {object} CylinderGraphics.ConstructorOptions\n *\n * Initialization options for the CylinderGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the cylinder.\n * @property {Property | number} [length] A numeric Property specifying the length of the cylinder.\n * @property {Property | number} [topRadius] A numeric Property specifying the radius of the top of the cylinder.\n * @property {Property | number} [bottomRadius] A numeric Property specifying the radius of the bottom of the cylinder.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height from the entity position is relative to.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the cylinder is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the cylinder.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the cylinder is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | number} [numberOfVerticalLines=16] A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.\n * @property {Property | number} [slices=128] The number of edges around the perimeter of the cylinder.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the cylinder casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this cylinder will be displayed.\n */\n\n/**\n * Describes a cylinder, truncated cone, or cone defined by a length, top radius, and bottom radius.\n * The center position and orientation are determined by the containing {@link Entity}.\n *\n * @alias CylinderGraphics\n * @constructor\n *\n * @param {CylinderGraphics.ConstructorOptions} [options] Object describing initialization options\n */\nfunction CylinderGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._length = undefined;\n  this._lengthSubscription = undefined;\n  this._topRadius = undefined;\n  this._topRadiusSubscription = undefined;\n  this._bottomRadius = undefined;\n  this._bottomRadiusSubscription = undefined;\n  this._heightReference = undefined;\n  this._heightReferenceSubscription = undefined;\n  this._fill = undefined;\n  this._fillSubscription = undefined;\n  this._material = undefined;\n  this._materialSubscription = undefined;\n  this._outline = undefined;\n  this._outlineSubscription = undefined;\n  this._outlineColor = undefined;\n  this._outlineColorSubscription = undefined;\n  this._outlineWidth = undefined;\n  this._outlineWidthSubscription = undefined;\n  this._numberOfVerticalLines = undefined;\n  this._numberOfVerticalLinesSubscription = undefined;\n  this._slices = undefined;\n  this._slicesSubscription = undefined;\n  this._shadows = undefined;\n  this._shadowsSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distanceDisplayConditionSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(CylinderGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof CylinderGraphics.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the cylinder.\n   * @memberof CylinderGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the length of the cylinder.\n   * @memberof CylinderGraphics.prototype\n   * @type {Property|undefined}\n   */\n  length: createPropertyDescriptor(\"length\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the radius of the top of the cylinder.\n   * @memberof CylinderGraphics.prototype\n   * @type {Property|undefined}\n   */\n  topRadius: createPropertyDescriptor(\"topRadius\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the radius of the bottom of the cylinder.\n   * @memberof CylinderGraphics.prototype\n   * @type {Property|undefined}\n   */\n  bottomRadius: createPropertyDescriptor(\"bottomRadius\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link HeightReference}.\n   * @memberof CylinderGraphics.prototype\n   * @type {Property|undefined}\n   * @default HeightReference.NONE\n   */\n  heightReference: createPropertyDescriptor(\"heightReference\"),\n\n  /**\n   * Gets or sets the boolean Property specifying whether the cylinder is filled with the provided material.\n   * @memberof CylinderGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  fill: createPropertyDescriptor(\"fill\"),\n\n  /**\n   * Gets or sets the Property specifying the material used to fill the cylinder.\n   * @memberof CylinderGraphics.prototype\n   * @type {MaterialProperty|undefined}\n   * @default Color.WHITE\n   */\n  material: createMaterialPropertyDescriptor(\"material\"),\n\n  /**\n   * Gets or sets the boolean Property specifying whether the cylinder is outlined.\n   * @memberof CylinderGraphics.prototype\n   * @type {Property|undefined}\n   * @default false\n   */\n  outline: createPropertyDescriptor(\"outline\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the outline.\n   * @memberof CylinderGraphics.prototype\n   * @type {Property|undefined}\n   * @default Color.BLACK\n   */\n  outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the width of the outline.\n   * <p>\n   * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n   * </p>\n   * @memberof CylinderGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n  /**\n   * Gets or sets the Property specifying the number of vertical lines to draw along the perimeter for the outline.\n   * @memberof CylinderGraphics.prototype\n   * @type {Property|undefined}\n   * @default 16\n   */\n  numberOfVerticalLines: createPropertyDescriptor(\"numberOfVerticalLines\"),\n\n  /**\n   * Gets or sets the Property specifying the number of edges around the perimeter of the cylinder.\n   * @memberof CylinderGraphics.prototype\n   * @type {Property|undefined}\n   * @default 128\n   */\n  slices: createPropertyDescriptor(\"slices\"),\n\n  /**\n   * Get or sets the enum Property specifying whether the cylinder\n   * casts or receives shadows from light sources.\n   * @memberof CylinderGraphics.prototype\n   * @type {Property|undefined}\n   * @default ShadowMode.DISABLED\n   */\n  shadows: createPropertyDescriptor(\"shadows\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this cylinder will be displayed.\n   * @memberof CylinderGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {CylinderGraphics} [result] The object onto which to store the result.\n * @returns {CylinderGraphics} The modified result parameter or a new instance if one was not provided.\n */\nCylinderGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new CylinderGraphics(this);\n  }\n  result.show = this.show;\n  result.length = this.length;\n  result.topRadius = this.topRadius;\n  result.bottomRadius = this.bottomRadius;\n  result.heightReference = this.heightReference;\n  result.fill = this.fill;\n  result.material = this.material;\n  result.outline = this.outline;\n  result.outlineColor = this.outlineColor;\n  result.outlineWidth = this.outlineWidth;\n  result.numberOfVerticalLines = this.numberOfVerticalLines;\n  result.slices = this.slices;\n  result.shadows = this.shadows;\n  result.distanceDisplayCondition = this.distanceDisplayCondition;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {CylinderGraphics} source The object to be merged into this object.\n */\nCylinderGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.length = defaultValue(this.length, source.length);\n  this.topRadius = defaultValue(this.topRadius, source.topRadius);\n  this.bottomRadius = defaultValue(this.bottomRadius, source.bottomRadius);\n  this.heightReference = defaultValue(\n    this.heightReference,\n    source.heightReference\n  );\n  this.fill = defaultValue(this.fill, source.fill);\n  this.material = defaultValue(this.material, source.material);\n  this.outline = defaultValue(this.outline, source.outline);\n  this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n  this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n  this.numberOfVerticalLines = defaultValue(\n    this.numberOfVerticalLines,\n    source.numberOfVerticalLines\n  );\n  this.slices = defaultValue(this.slices, source.slices);\n  this.shadows = defaultValue(this.shadows, source.shadows);\n  this.distanceDisplayCondition = defaultValue(\n    this.distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n};\nexport default CylinderGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {object} EllipseGraphics.ConstructorOptions\n *\n * Initialization options for the EllipseGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the ellipse.\n * @property {Property | number} [semiMajorAxis] The numeric Property specifying the semi-major axis.\n * @property {Property | number} [semiMinorAxis] The numeric Property specifying the semi-minor axis.\n * @property {Property | number} [height=0] A numeric Property specifying the altitude of the ellipse relative to the ellipsoid surface.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | number} [extrudedHeight] A numeric Property specifying the altitude of the ellipse's extruded face relative to the ellipsoid surface.\n * @property {Property | HeightReference} [extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to.\n * @property {Property | number} [rotation=0.0] A numeric property specifying the rotation of the ellipse counter-clockwise from north.\n * @property {Property | number} [stRotation=0.0] A numeric property specifying the rotation of the ellipse texture counter-clockwise from north.\n * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between points on the ellipse.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the ellipse is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the ellipse.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the ellipse is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | number} [numberOfVerticalLines=16] A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the ellipse casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this ellipse will be displayed.\n * @property {Property | ClassificationType} [classificationType=ClassificationType.BOTH] An enum Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground.\n * @property {ConstantProperty | number} [zIndex=0] A property specifying the zIndex of the Ellipse.  Used for ordering ground geometry.  Only has an effect if the ellipse is constant and neither height or exturdedHeight are specified.\n */\n\n/**\n * Describes an ellipse defined by a center point and semi-major and semi-minor axes.\n * The ellipse conforms to the curvature of the globe and can be placed on the surface or\n * at altitude and can optionally be extruded into a volume.\n * The center point is determined by the containing {@link Entity}.\n *\n * @alias EllipseGraphics\n * @constructor\n *\n * @param {EllipseGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Circles and Ellipses.html|Cesium Sandcastle Circles and Ellipses Demo}\n */\nfunction EllipseGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._semiMajorAxis = undefined;\n  this._semiMajorAxisSubscription = undefined;\n  this._semiMinorAxis = undefined;\n  this._semiMinorAxisSubscription = undefined;\n  this._height = undefined;\n  this._heightSubscription = undefined;\n  this._heightReference = undefined;\n  this._heightReferenceSubscription = undefined;\n  this._extrudedHeight = undefined;\n  this._extrudedHeightSubscription = undefined;\n  this._extrudedHeightReference = undefined;\n  this._extrudedHeightReferenceSubscription = undefined;\n  this._rotation = undefined;\n  this._rotationSubscription = undefined;\n  this._stRotation = undefined;\n  this._stRotationSubscription = undefined;\n  this._granularity = undefined;\n  this._granularitySubscription = undefined;\n  this._fill = undefined;\n  this._fillSubscription = undefined;\n  this._material = undefined;\n  this._materialSubscription = undefined;\n  this._outline = undefined;\n  this._outlineSubscription = undefined;\n  this._outlineColor = undefined;\n  this._outlineColorSubscription = undefined;\n  this._outlineWidth = undefined;\n  this._outlineWidthSubscription = undefined;\n  this._numberOfVerticalLines = undefined;\n  this._numberOfVerticalLinesSubscription = undefined;\n  this._shadows = undefined;\n  this._shadowsSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distanceDisplayConditionSubscription = undefined;\n  this._classificationType = undefined;\n  this._classificationTypeSubscription = undefined;\n  this._zIndex = undefined;\n  this._zIndexSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(EllipseGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof EllipseGraphics.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the ellipse.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the semi-major axis.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   */\n  semiMajorAxis: createPropertyDescriptor(\"semiMajorAxis\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the semi-minor axis.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   */\n  semiMinorAxis: createPropertyDescriptor(\"semiMinorAxis\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the altitude of the ellipse.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0.0\n   */\n  height: createPropertyDescriptor(\"height\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link HeightReference}.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   * @default HeightReference.NONE\n   */\n  heightReference: createPropertyDescriptor(\"heightReference\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the altitude of the ellipse extrusion.\n   * Setting this property creates volume starting at height and ending at this altitude.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   */\n  extrudedHeight: createPropertyDescriptor(\"extrudedHeight\"),\n\n  /**\n   * Gets or sets the Property specifying the extruded {@link HeightReference}.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   * @default HeightReference.NONE\n   */\n  extrudedHeightReference: createPropertyDescriptor(\"extrudedHeightReference\"),\n\n  /**\n   * Gets or sets the numeric property specifying the rotation of the ellipse counter-clockwise from north.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0\n   */\n  rotation: createPropertyDescriptor(\"rotation\"),\n\n  /**\n   * Gets or sets the numeric property specifying the rotation of the ellipse texture counter-clockwise from north.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0\n   */\n  stRotation: createPropertyDescriptor(\"stRotation\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the angular distance between points on the ellipse.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   * @default {CesiumMath.RADIANS_PER_DEGREE}\n   */\n  granularity: createPropertyDescriptor(\"granularity\"),\n\n  /**\n   * Gets or sets the boolean Property specifying whether the ellipse is filled with the provided material.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  fill: createPropertyDescriptor(\"fill\"),\n\n  /**\n   * Gets or sets the Property specifying the material used to fill the ellipse.\n   * @memberof EllipseGraphics.prototype\n   * @type {MaterialProperty|undefined}\n   * @default Color.WHITE\n   */\n  material: createMaterialPropertyDescriptor(\"material\"),\n\n  /**\n   * Gets or sets the Property specifying whether the ellipse is outlined.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   * @default false\n   */\n  outline: createPropertyDescriptor(\"outline\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the outline.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   * @default Color.BLACK\n   */\n  outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the width of the outline.\n   * <p>\n   * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n   * </p>\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   * @default 16\n   */\n  numberOfVerticalLines: createPropertyDescriptor(\"numberOfVerticalLines\"),\n\n  /**\n   * Get or sets the enum Property specifying whether the ellipse\n   * casts or receives shadows from light sources.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   * @default ShadowMode.DISABLED\n   */\n  shadows: createPropertyDescriptor(\"shadows\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipse will be displayed.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n\n  /**\n   * Gets or sets the {@link ClassificationType} Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground.\n   * @memberof EllipseGraphics.prototype\n   * @type {Property|undefined}\n   * @default ClassificationType.BOTH\n   */\n  classificationType: createPropertyDescriptor(\"classificationType\"),\n\n  /**\n   * Gets or sets the zIndex Property specifying the ellipse ordering.  Only has an effect if the ellipse is constant and neither height or extrudedHeight are specified\n   * @memberof EllipseGraphics.prototype\n   * @type {ConstantProperty|undefined}\n   * @default 0\n   */\n  zIndex: createPropertyDescriptor(\"zIndex\"),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {EllipseGraphics} [result] The object onto which to store the result.\n * @returns {EllipseGraphics} The modified result parameter or a new instance if one was not provided.\n */\nEllipseGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new EllipseGraphics(this);\n  }\n  result.show = this.show;\n  result.semiMajorAxis = this.semiMajorAxis;\n  result.semiMinorAxis = this.semiMinorAxis;\n  result.height = this.height;\n  result.heightReference = this.heightReference;\n  result.extrudedHeight = this.extrudedHeight;\n  result.extrudedHeightReference = this.extrudedHeightReference;\n  result.rotation = this.rotation;\n  result.stRotation = this.stRotation;\n  result.granularity = this.granularity;\n  result.fill = this.fill;\n  result.material = this.material;\n  result.outline = this.outline;\n  result.outlineColor = this.outlineColor;\n  result.outlineWidth = this.outlineWidth;\n  result.numberOfVerticalLines = this.numberOfVerticalLines;\n  result.shadows = this.shadows;\n  result.distanceDisplayCondition = this.distanceDisplayCondition;\n  result.classificationType = this.classificationType;\n  result.zIndex = this.zIndex;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {EllipseGraphics} source The object to be merged into this object.\n */\nEllipseGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.semiMajorAxis = defaultValue(this.semiMajorAxis, source.semiMajorAxis);\n  this.semiMinorAxis = defaultValue(this.semiMinorAxis, source.semiMinorAxis);\n  this.height = defaultValue(this.height, source.height);\n  this.heightReference = defaultValue(\n    this.heightReference,\n    source.heightReference\n  );\n  this.extrudedHeight = defaultValue(\n    this.extrudedHeight,\n    source.extrudedHeight\n  );\n  this.extrudedHeightReference = defaultValue(\n    this.extrudedHeightReference,\n    source.extrudedHeightReference\n  );\n  this.rotation = defaultValue(this.rotation, source.rotation);\n  this.stRotation = defaultValue(this.stRotation, source.stRotation);\n  this.granularity = defaultValue(this.granularity, source.granularity);\n  this.fill = defaultValue(this.fill, source.fill);\n  this.material = defaultValue(this.material, source.material);\n  this.outline = defaultValue(this.outline, source.outline);\n  this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n  this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n  this.numberOfVerticalLines = defaultValue(\n    this.numberOfVerticalLines,\n    source.numberOfVerticalLines\n  );\n  this.shadows = defaultValue(this.shadows, source.shadows);\n  this.distanceDisplayCondition = defaultValue(\n    this.distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n  this.classificationType = defaultValue(\n    this.classificationType,\n    source.classificationType\n  );\n  this.zIndex = defaultValue(this.zIndex, source.zIndex);\n};\nexport default EllipseGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {object} EllipsoidGraphics.ConstructorOptions\n *\n * Initialization options for the EllipsoidGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the ellipsoid.\n * @property {Property | Cartesian3} [radii] A {@link Cartesian3} Property specifying the radii of the ellipsoid.\n * @property {Property | Cartesian3} [innerRadii] A {@link Cartesian3} Property specifying the inner radii of the ellipsoid.\n * @property {Property | number} [minimumClock=0.0] A Property specifying the minimum clock angle of the ellipsoid.\n * @property {Property | number} [maximumClock=2*PI] A Property specifying the maximum clock angle of the ellipsoid.\n * @property {Property | number} [minimumCone=0.0] A Property specifying the minimum cone angle of the ellipsoid.\n * @property {Property | number} [maximumCone=PI] A Property specifying the maximum cone angle of the ellipsoid.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height from the entity position is relative to.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the ellipsoid is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the ellipsoid.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the ellipsoid is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | number} [stackPartitions=64] A Property specifying the number of stacks.\n * @property {Property | number} [slicePartitions=64] A Property specifying the number of radial slices.\n * @property {Property | number} [subdivisions=128] A Property specifying the number of samples per outline ring, determining the granularity of the curvature.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the ellipsoid casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this ellipsoid will be displayed.\n */\n\n/**\n * Describe an ellipsoid or sphere.  The center position and orientation are determined by the containing {@link Entity}.\n *\n * @alias EllipsoidGraphics\n * @constructor\n *\n * @param {EllipsoidGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Spheres%20and%20Ellipsoids.html|Cesium Sandcastle Spheres and Ellipsoids Demo}\n */\nfunction EllipsoidGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._radii = undefined;\n  this._radiiSubscription = undefined;\n  this._innerRadii = undefined;\n  this._innerRadiiSubscription = undefined;\n  this._minimumClock = undefined;\n  this._minimumClockSubscription = undefined;\n  this._maximumClock = undefined;\n  this._maximumClockSubscription = undefined;\n  this._minimumCone = undefined;\n  this._minimumConeSubscription = undefined;\n  this._maximumCone = undefined;\n  this._maximumConeSubscription = undefined;\n  this._heightReference = undefined;\n  this._heightReferenceSubscription = undefined;\n  this._fill = undefined;\n  this._fillSubscription = undefined;\n  this._material = undefined;\n  this._materialSubscription = undefined;\n  this._outline = undefined;\n  this._outlineSubscription = undefined;\n  this._outlineColor = undefined;\n  this._outlineColorSubscription = undefined;\n  this._outlineWidth = undefined;\n  this._outlineWidthSubscription = undefined;\n  this._stackPartitions = undefined;\n  this._stackPartitionsSubscription = undefined;\n  this._slicePartitions = undefined;\n  this._slicePartitionsSubscription = undefined;\n  this._subdivisions = undefined;\n  this._subdivisionsSubscription = undefined;\n  this._shadows = undefined;\n  this._shadowsSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distanceDisplayConditionSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(EllipsoidGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof EllipsoidGraphics.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the ellipsoid.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets the {@link Cartesian3} {@link Property} specifying the radii of the ellipsoid.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   */\n  radii: createPropertyDescriptor(\"radii\"),\n\n  /**\n   * Gets or sets the {@link Cartesian3} {@link Property} specifying the inner radii of the ellipsoid.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   * @default radii\n   */\n  innerRadii: createPropertyDescriptor(\"innerRadii\"),\n\n  /**\n   * Gets or sets the Property specifying the minimum clock angle of the ellipsoid.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0.0\n   */\n  minimumClock: createPropertyDescriptor(\"minimumClock\"),\n\n  /**\n   * Gets or sets the Property specifying the maximum clock angle of the ellipsoid.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   * @default 2*PI\n   */\n  maximumClock: createPropertyDescriptor(\"maximumClock\"),\n\n  /**\n   * Gets or sets the Property specifying the minimum cone angle of the ellipsoid.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0.0\n   */\n  minimumCone: createPropertyDescriptor(\"minimumCone\"),\n\n  /**\n   * Gets or sets the Property specifying the maximum cone angle of the ellipsoid.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   * @default PI\n   */\n  maximumCone: createPropertyDescriptor(\"maximumCone\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link HeightReference}.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   * @default HeightReference.NONE\n   */\n  heightReference: createPropertyDescriptor(\"heightReference\"),\n\n  /**\n   * Gets or sets the boolean Property specifying whether the ellipsoid is filled with the provided material.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  fill: createPropertyDescriptor(\"fill\"),\n\n  /**\n   * Gets or sets the Property specifying the material used to fill the ellipsoid.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {MaterialProperty}\n   * @default Color.WHITE\n   */\n  material: createMaterialPropertyDescriptor(\"material\"),\n\n  /**\n   * Gets or sets the Property specifying whether the ellipsoid is outlined.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   * @default false\n   */\n  outline: createPropertyDescriptor(\"outline\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the outline.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   * @default Color.BLACK\n   */\n  outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the width of the outline.\n   * <p>\n   * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n   * </p>\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n  /**\n   * Gets or sets the Property specifying the number of stacks.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   * @default 64\n   */\n  stackPartitions: createPropertyDescriptor(\"stackPartitions\"),\n\n  /**\n   * Gets or sets the Property specifying the number of radial slices per 360 degrees.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   * @default 64\n   */\n  slicePartitions: createPropertyDescriptor(\"slicePartitions\"),\n\n  /**\n   * Gets or sets the Property specifying the number of samples per outline ring, determining the granularity of the curvature.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   * @default 128\n   */\n  subdivisions: createPropertyDescriptor(\"subdivisions\"),\n\n  /**\n   * Get or sets the enum Property specifying whether the ellipsoid\n   * casts or receives shadows from light sources.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   * @default ShadowMode.DISABLED\n   */\n  shadows: createPropertyDescriptor(\"shadows\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipsoid will be displayed.\n   * @memberof EllipsoidGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {EllipsoidGraphics} [result] The object onto which to store the result.\n * @returns {EllipsoidGraphics} The modified result parameter or a new instance if one was not provided.\n */\nEllipsoidGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new EllipsoidGraphics(this);\n  }\n  result.show = this.show;\n  result.radii = this.radii;\n  result.innerRadii = this.innerRadii;\n  result.minimumClock = this.minimumClock;\n  result.maximumClock = this.maximumClock;\n  result.minimumCone = this.minimumCone;\n  result.maximumCone = this.maximumCone;\n  result.heightReference = this.heightReference;\n  result.fill = this.fill;\n  result.material = this.material;\n  result.outline = this.outline;\n  result.outlineColor = this.outlineColor;\n  result.outlineWidth = this.outlineWidth;\n  result.stackPartitions = this.stackPartitions;\n  result.slicePartitions = this.slicePartitions;\n  result.subdivisions = this.subdivisions;\n  result.shadows = this.shadows;\n  result.distanceDisplayCondition = this.distanceDisplayCondition;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {EllipsoidGraphics} source The object to be merged into this object.\n */\nEllipsoidGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.radii = defaultValue(this.radii, source.radii);\n  this.innerRadii = defaultValue(this.innerRadii, source.innerRadii);\n  this.minimumClock = defaultValue(this.minimumClock, source.minimumClock);\n  this.maximumClock = defaultValue(this.maximumClock, source.maximumClock);\n  this.minimumCone = defaultValue(this.minimumCone, source.minimumCone);\n  this.maximumCone = defaultValue(this.maximumCone, source.maximumCone);\n  this.heightReference = defaultValue(\n    this.heightReference,\n    source.heightReference\n  );\n  this.fill = defaultValue(this.fill, source.fill);\n  this.material = defaultValue(this.material, source.material);\n  this.outline = defaultValue(this.outline, source.outline);\n  this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n  this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n  this.stackPartitions = defaultValue(\n    this.stackPartitions,\n    source.stackPartitions\n  );\n  this.slicePartitions = defaultValue(\n    this.slicePartitions,\n    source.slicePartitions\n  );\n  this.subdivisions = defaultValue(this.subdivisions, source.subdivisions);\n  this.shadows = defaultValue(this.shadows, source.shadows);\n  this.distanceDisplayCondition = defaultValue(\n    this.distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n};\nexport default EllipsoidGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {object} LabelGraphics.ConstructorOptions\n *\n * Initialization options for the LabelGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the label.\n * @property {Property | string} [text] A Property specifying the text. Explicit newlines '\\n' are supported.\n * @property {Property | string} [font='30px sans-serif'] A Property specifying the CSS font.\n * @property {Property | LabelStyle} [style=LabelStyle.FILL] A Property specifying the {@link LabelStyle}.\n * @property {Property | number} [scale=1.0] A numeric Property specifying the scale to apply to the text.\n * @property {Property | boolean} [showBackground=false] A boolean Property specifying the visibility of the background behind the label.\n * @property {Property | Color} [backgroundColor=new Color(0.165, 0.165, 0.165, 0.8)] A Property specifying the background {@link Color}.\n * @property {Property | Cartesian2} [backgroundPadding=new Cartesian2(7, 5)] A {@link Cartesian2} Property specifying the horizontal and vertical background padding in pixels.\n * @property {Property | Cartesian2} [pixelOffset=Cartesian2.ZERO] A {@link Cartesian2} Property specifying the pixel offset.\n * @property {Property | Cartesian3} [eyeOffset=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the eye offset.\n * @property {Property | HorizontalOrigin} [horizontalOrigin=HorizontalOrigin.CENTER] A Property specifying the {@link HorizontalOrigin}.\n * @property {Property | VerticalOrigin} [verticalOrigin=VerticalOrigin.CENTER] A Property specifying the {@link VerticalOrigin}.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | Color} [fillColor=Color.WHITE] A Property specifying the fill {@link Color}.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the outline {@link Color}.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the outline width.\n * @property {Property | NearFarScalar} [translucencyByDistance] A {@link NearFarScalar} Property used to set translucency based on distance from the camera.\n * @property {Property | NearFarScalar} [pixelOffsetScaleByDistance] A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.\n * @property {Property | NearFarScalar} [scaleByDistance] A {@link NearFarScalar} Property used to set scale based on distance from the camera.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this label will be displayed.\n * @property {Property | number} [disableDepthTestDistance] A Property specifying the distance from the camera at which to disable the depth test to.\n */\n\n/**\n * Describes a two dimensional label located at the position of the containing {@link Entity}.\n * <p>\n * <div align='center'>\n * <img src='Images/Label.png' width='400' height='300' /><br />\n * Example labels\n * </div>\n * </p>\n *\n * @alias LabelGraphics\n * @constructor\n *\n * @param {LabelGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Labels.html|Cesium Sandcastle Labels Demo}\n */\nfunction LabelGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._text = undefined;\n  this._textSubscription = undefined;\n  this._font = undefined;\n  this._fontSubscription = undefined;\n  this._style = undefined;\n  this._styleSubscription = undefined;\n  this._scale = undefined;\n  this._scaleSubscription = undefined;\n  this._showBackground = undefined;\n  this._showBackgroundSubscription = undefined;\n  this._backgroundColor = undefined;\n  this._backgroundColorSubscription = undefined;\n  this._backgroundPadding = undefined;\n  this._backgroundPaddingSubscription = undefined;\n  this._pixelOffset = undefined;\n  this._pixelOffsetSubscription = undefined;\n  this._eyeOffset = undefined;\n  this._eyeOffsetSubscription = undefined;\n  this._horizontalOrigin = undefined;\n  this._horizontalOriginSubscription = undefined;\n  this._verticalOrigin = undefined;\n  this._verticalOriginSubscription = undefined;\n  this._heightReference = undefined;\n  this._heightReferenceSubscription = undefined;\n  this._fillColor = undefined;\n  this._fillColorSubscription = undefined;\n  this._outlineColor = undefined;\n  this._outlineColorSubscription = undefined;\n  this._outlineWidth = undefined;\n  this._outlineWidthSubscription = undefined;\n  this._translucencyByDistance = undefined;\n  this._translucencyByDistanceSubscription = undefined;\n  this._pixelOffsetScaleByDistance = undefined;\n  this._pixelOffsetScaleByDistanceSubscription = undefined;\n  this._scaleByDistance = undefined;\n  this._scaleByDistanceSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distanceDisplayConditionSubscription = undefined;\n  this._disableDepthTestDistance = undefined;\n  this._disableDepthTestDistanceSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(LabelGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof LabelGraphics.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the label.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets the string Property specifying the text of the label.\n   * Explicit newlines '\\n' are supported.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  text: createPropertyDescriptor(\"text\"),\n\n  /**\n   * Gets or sets the string Property specifying the font in CSS syntax.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   * @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/font|CSS font on MDN}\n   */\n  font: createPropertyDescriptor(\"font\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link LabelStyle}.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  style: createPropertyDescriptor(\"style\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the uniform scale to apply to the image.\n   * A scale greater than <code>1.0</code> enlarges the label while a scale less than <code>1.0</code> shrinks it.\n   * <p>\n   * <div align='center'>\n   * <img src='Images/Label.setScale.png' width='400' height='300' /><br/>\n   * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,\n   * and <code>2.0</code>.\n   * </div>\n   * </p>\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  scale: createPropertyDescriptor(\"scale\"),\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the background behind the label.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   * @default false\n   */\n  showBackground: createPropertyDescriptor(\"showBackground\"),\n\n  /**\n   * Gets or sets the Property specifying the background {@link Color}.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   * @default new Color(0.165, 0.165, 0.165, 0.8)\n   */\n  backgroundColor: createPropertyDescriptor(\"backgroundColor\"),\n\n  /**\n   * Gets or sets the {@link Cartesian2} Property specifying the label's horizontal and vertical\n   * background padding in pixels.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   * @default new Cartesian2(7, 5)\n   */\n  backgroundPadding: createPropertyDescriptor(\"backgroundPadding\"),\n\n  /**\n   * Gets or sets the {@link Cartesian2} Property specifying the label's pixel offset in screen space\n   * from the origin of this label.  This is commonly used to align multiple labels and labels at\n   * the same position, e.g., an image and text.  The screen space origin is the top, left corner of the\n   * canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.\n   * <p>\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>\n   * <td align='center'><code>l.pixeloffset = new Cartesian2(25, 75);</code><br/><img src='Images/Label.setPixelOffset.x50y-25.png' width='250' height='188' /></td>\n   * </tr></table>\n   * The label's origin is indicated by the yellow point.\n   * </div>\n   * </p>\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   * @default Cartesian2.ZERO\n   */\n  pixelOffset: createPropertyDescriptor(\"pixelOffset\"),\n\n  /**\n   * Gets or sets the {@link Cartesian3} Property specifying the label's offset in eye coordinates.\n   * Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's\n   * right, <code>y</code> points up, and <code>z</code> points into the screen.\n   * <p>\n   * An eye offset is commonly used to arrange multiple labels or objects at the same position, e.g., to\n   * arrange a label above its corresponding 3D model.\n   * </p>\n   * Below, the label is positioned at the center of the Earth but an eye offset makes it always\n   * appear on top of the Earth regardless of the viewer's or Earth's orientation.\n   * <p>\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>\n   * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>\n   * </tr></table>\n   * <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />\n   * </div>\n   * </p>\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   * @default Cartesian3.ZERO\n   */\n  eyeOffset: createPropertyDescriptor(\"eyeOffset\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link HorizontalOrigin}.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  horizontalOrigin: createPropertyDescriptor(\"horizontalOrigin\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link VerticalOrigin}.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  verticalOrigin: createPropertyDescriptor(\"verticalOrigin\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link HeightReference}.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   * @default HeightReference.NONE\n   */\n  heightReference: createPropertyDescriptor(\"heightReference\"),\n\n  /**\n   * Gets or sets the Property specifying the fill {@link Color}.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  fillColor: createPropertyDescriptor(\"fillColor\"),\n\n  /**\n   * Gets or sets the Property specifying the outline {@link Color}.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the outline width.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n  /**\n   * Gets or sets {@link NearFarScalar} Property specifying the translucency of the label based on the distance from the camera.\n   * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the label's translucency remains clamped to the nearest bound.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  translucencyByDistance: createPropertyDescriptor(\"translucencyByDistance\"),\n\n  /**\n   * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the label based on the distance from the camera.\n   * A label's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the label's pixel offset remains clamped to the nearest bound.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  pixelOffsetScaleByDistance: createPropertyDescriptor(\n    \"pixelOffsetScaleByDistance\"\n  ),\n\n  /**\n   * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.\n   * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the label's scale remains clamped to the nearest bound.  If undefined,\n   * scaleByDistance will be disabled.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  scaleByDistance: createPropertyDescriptor(\"scaleByDistance\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this label will be displayed.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n\n  /**\n   * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.\n   * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.\n   * @memberof LabelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  disableDepthTestDistance: createPropertyDescriptor(\n    \"disableDepthTestDistance\"\n  ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {LabelGraphics} [result] The object onto which to store the result.\n * @returns {LabelGraphics} The modified result parameter or a new instance if one was not provided.\n */\nLabelGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new LabelGraphics(this);\n  }\n  result.show = this.show;\n  result.text = this.text;\n  result.font = this.font;\n  result.style = this.style;\n  result.scale = this.scale;\n  result.showBackground = this.showBackground;\n  result.backgroundColor = this.backgroundColor;\n  result.backgroundPadding = this.backgroundPadding;\n  result.pixelOffset = this.pixelOffset;\n  result.eyeOffset = this.eyeOffset;\n  result.horizontalOrigin = this.horizontalOrigin;\n  result.verticalOrigin = this.verticalOrigin;\n  result.heightReference = this.heightReference;\n  result.fillColor = this.fillColor;\n  result.outlineColor = this.outlineColor;\n  result.outlineWidth = this.outlineWidth;\n  result.translucencyByDistance = this.translucencyByDistance;\n  result.pixelOffsetScaleByDistance = this.pixelOffsetScaleByDistance;\n  result.scaleByDistance = this.scaleByDistance;\n  result.distanceDisplayCondition = this.distanceDisplayCondition;\n  result.disableDepthTestDistance = this.disableDepthTestDistance;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {LabelGraphics} source The object to be merged into this object.\n */\nLabelGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.text = defaultValue(this.text, source.text);\n  this.font = defaultValue(this.font, source.font);\n  this.style = defaultValue(this.style, source.style);\n  this.scale = defaultValue(this.scale, source.scale);\n  this.showBackground = defaultValue(\n    this.showBackground,\n    source.showBackground\n  );\n  this.backgroundColor = defaultValue(\n    this.backgroundColor,\n    source.backgroundColor\n  );\n  this.backgroundPadding = defaultValue(\n    this.backgroundPadding,\n    source.backgroundPadding\n  );\n  this.pixelOffset = defaultValue(this.pixelOffset, source.pixelOffset);\n  this.eyeOffset = defaultValue(this.eyeOffset, source.eyeOffset);\n  this.horizontalOrigin = defaultValue(\n    this.horizontalOrigin,\n    source.horizontalOrigin\n  );\n  this.verticalOrigin = defaultValue(\n    this.verticalOrigin,\n    source.verticalOrigin\n  );\n  this.heightReference = defaultValue(\n    this.heightReference,\n    source.heightReference\n  );\n  this.fillColor = defaultValue(this.fillColor, source.fillColor);\n  this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n  this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n  this.translucencyByDistance = defaultValue(\n    this.translucencyByDistance,\n    source.translucencyByDistance\n  );\n  this.pixelOffsetScaleByDistance = defaultValue(\n    this.pixelOffsetScaleByDistance,\n    source.pixelOffsetScaleByDistance\n  );\n  this.scaleByDistance = defaultValue(\n    this.scaleByDistance,\n    source.scaleByDistance\n  );\n  this.distanceDisplayCondition = defaultValue(\n    this.distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n  this.disableDepthTestDistance = defaultValue(\n    this.disableDepthTestDistance,\n    source.disableDepthTestDistance\n  );\n};\nexport default LabelGraphics;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Quaternion from \"./Quaternion.js\";\n\nconst defaultScale = new Cartesian3(1.0, 1.0, 1.0);\nconst defaultTranslation = Cartesian3.ZERO;\nconst defaultRotation = Quaternion.IDENTITY;\n\n/**\n * An affine transformation defined by a translation, rotation, and scale.\n * @alias TranslationRotationScale\n * @constructor\n *\n * @param {Cartesian3} [translation=Cartesian3.ZERO] A {@link Cartesian3} specifying the (x, y, z) translation to apply to the node.\n * @param {Quaternion} [rotation=Quaternion.IDENTITY] A {@link Quaternion} specifying the (x, y, z, w) rotation to apply to the node.\n * @param {Cartesian3} [scale=new Cartesian3(1.0, 1.0, 1.0)] A {@link Cartesian3} specifying the (x, y, z) scaling to apply to the node.\n */\nfunction TranslationRotationScale(translation, rotation, scale) {\n  /**\n   * Gets or sets the (x, y, z) translation to apply to the node.\n   * @type {Cartesian3}\n   * @default Cartesian3.ZERO\n   */\n  this.translation = Cartesian3.clone(\n    defaultValue(translation, defaultTranslation)\n  );\n\n  /**\n   * Gets or sets the (x, y, z, w) rotation to apply to the node.\n   * @type {Quaternion}\n   * @default Quaternion.IDENTITY\n   */\n  this.rotation = Quaternion.clone(defaultValue(rotation, defaultRotation));\n\n  /**\n   * Gets or sets the (x, y, z) scaling to apply to the node.\n   * @type {Cartesian3}\n   * @default new Cartesian3(1.0, 1.0, 1.0)\n   */\n  this.scale = Cartesian3.clone(defaultValue(scale, defaultScale));\n}\n\n/**\n * Compares this instance against the provided instance and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {TranslationRotationScale} [right] The right hand side TranslationRotationScale.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nTranslationRotationScale.prototype.equals = function (right) {\n  return (\n    this === right ||\n    (defined(right) &&\n      Cartesian3.equals(this.translation, right.translation) &&\n      Quaternion.equals(this.rotation, right.rotation) &&\n      Cartesian3.equals(this.scale, right.scale))\n  );\n};\nexport default TranslationRotationScale;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport TranslationRotationScale from \"../Core/TranslationRotationScale.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\nconst defaultNodeTransformation = new TranslationRotationScale();\n\n/**\n * A {@link Property} that produces {@link TranslationRotationScale} data.\n * @alias NodeTransformationProperty\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Property|Cartesian3} [options.translation=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node.\n * @param {Property|Quaternion} [options.rotation=Quaternion.IDENTITY] A {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node.\n * @param {Property|Cartesian3} [options.scale=new Cartesian3(1.0, 1.0, 1.0)] A {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node.\n */\nfunction NodeTransformationProperty(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._definitionChanged = new Event();\n  this._translation = undefined;\n  this._translationSubscription = undefined;\n  this._rotation = undefined;\n  this._rotationSubscription = undefined;\n  this._scale = undefined;\n  this._scaleSubscription = undefined;\n\n  this.translation = options.translation;\n  this.rotation = options.rotation;\n  this.scale = options.scale;\n}\n\nObject.defineProperties(NodeTransformationProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof NodeTransformationProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return (\n        Property.isConstant(this._translation) &&\n        Property.isConstant(this._rotation) &&\n        Property.isConstant(this._scale)\n      );\n    },\n  },\n\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof NodeTransformationProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node.\n   * @memberof NodeTransformationProperty.prototype\n   * @type {Property|undefined}\n   * @default Cartesian3.ZERO\n   */\n  translation: createPropertyDescriptor(\"translation\"),\n\n  /**\n   * Gets or sets the {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node.\n   * @memberof NodeTransformationProperty.prototype\n   * @type {Property|undefined}\n   * @default Quaternion.IDENTITY\n   */\n  rotation: createPropertyDescriptor(\"rotation\"),\n\n  /**\n   * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node.\n   * @memberof NodeTransformationProperty.prototype\n   * @type {Property|undefined}\n   * @default new Cartesian3(1.0, 1.0, 1.0)\n   */\n  scale: createPropertyDescriptor(\"scale\"),\n});\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {TranslationRotationScale} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {TranslationRotationScale} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nNodeTransformationProperty.prototype.getValue = function (time, result) {\n  if (!defined(result)) {\n    result = new TranslationRotationScale();\n  }\n\n  result.translation = Property.getValueOrClonedDefault(\n    this._translation,\n    time,\n    defaultNodeTransformation.translation,\n    result.translation\n  );\n  result.rotation = Property.getValueOrClonedDefault(\n    this._rotation,\n    time,\n    defaultNodeTransformation.rotation,\n    result.rotation\n  );\n  result.scale = Property.getValueOrClonedDefault(\n    this._scale,\n    time,\n    defaultNodeTransformation.scale,\n    result.scale\n  );\n  return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nNodeTransformationProperty.prototype.equals = function (other) {\n  return (\n    this === other ||\n    (other instanceof NodeTransformationProperty &&\n      Property.equals(this._translation, other._translation) &&\n      Property.equals(this._rotation, other._rotation) &&\n      Property.equals(this._scale, other._scale))\n  );\n};\nexport default NodeTransformationProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link Property} whose value is a key-value mapping of property names to the computed value of other properties.\n *\n * @alias PropertyBag\n * @implements Record<string, any>\n * @constructor\n *\n * @param {object} [value] An object, containing key-value mapping of property names to properties.\n * @param {Function} [createPropertyCallback] A function that will be called when the value of any of the properties in value are not a Property.\n */\nfunction PropertyBag(value, createPropertyCallback) {\n  this._propertyNames = [];\n  this._definitionChanged = new Event();\n\n  if (defined(value)) {\n    this.merge(value, createPropertyCallback);\n  }\n}\n\nObject.defineProperties(PropertyBag.prototype, {\n  /**\n   * Gets the names of all properties registered on this instance.\n   * @memberof PropertyBag.prototype\n   * @type {Array}\n   */\n  propertyNames: {\n    get: function () {\n      return this._propertyNames;\n    },\n  },\n  /**\n   * Gets a value indicating if this property is constant.  This property\n   * is considered constant if all property items in this object are constant.\n   * @memberof PropertyBag.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      const propertyNames = this._propertyNames;\n      for (let i = 0, len = propertyNames.length; i < len; i++) {\n        if (!Property.isConstant(this[propertyNames[i]])) {\n          return false;\n        }\n      }\n      return true;\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the set of properties contained in this\n   * object changes, or one of the properties itself changes.\n   *\n   * @memberof PropertyBag.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n});\n\n/**\n * Determines if this object has defined a property with the given name.\n *\n * @param {string} propertyName The name of the property to check for.\n *\n * @returns {boolean} True if this object has defined a property with the given name, false otherwise.\n */\nPropertyBag.prototype.hasProperty = function (propertyName) {\n  return this._propertyNames.indexOf(propertyName) !== -1;\n};\n\nfunction createConstantProperty(value) {\n  return new ConstantProperty(value);\n}\n\n/**\n * Adds a property to this object.\n *\n * @param {string} propertyName The name of the property to add.\n * @param {*} [value] The value of the new property, if provided.\n * @param {Function} [createPropertyCallback] A function that will be called when the value of this new property is set to a value that is not a Property.\n *\n * @exception {DeveloperError} \"propertyName\" is already a registered property.\n */\nPropertyBag.prototype.addProperty = function (\n  propertyName,\n  value,\n  createPropertyCallback\n) {\n  const propertyNames = this._propertyNames;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(propertyName)) {\n    throw new DeveloperError(\"propertyName is required.\");\n  }\n  if (propertyNames.indexOf(propertyName) !== -1) {\n    throw new DeveloperError(\n      `${propertyName} is already a registered property.`\n    );\n  }\n  //>>includeEnd('debug');\n\n  propertyNames.push(propertyName);\n  Object.defineProperty(\n    this,\n    propertyName,\n    createPropertyDescriptor(\n      propertyName,\n      true,\n      defaultValue(createPropertyCallback, createConstantProperty)\n    )\n  );\n\n  if (defined(value)) {\n    this[propertyName] = value;\n  }\n\n  this._definitionChanged.raiseEvent(this);\n};\n\n/**\n * Removed a property previously added with addProperty.\n *\n * @param {string} propertyName The name of the property to remove.\n *\n * @exception {DeveloperError} \"propertyName\" is not a registered property.\n */\nPropertyBag.prototype.removeProperty = function (propertyName) {\n  const propertyNames = this._propertyNames;\n  const index = propertyNames.indexOf(propertyName);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(propertyName)) {\n    throw new DeveloperError(\"propertyName is required.\");\n  }\n  if (index === -1) {\n    throw new DeveloperError(`${propertyName} is not a registered property.`);\n  }\n  //>>includeEnd('debug');\n\n  this._propertyNames.splice(index, 1);\n  delete this[propertyName];\n\n  this._definitionChanged.raiseEvent(this);\n};\n\n/**\n * Gets the value of this property.  Each contained property will be evaluated at the given time, and the overall\n * result will be an object, mapping property names to those values.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * Note that any properties in result which are not part of this PropertyBag will be left as-is.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPropertyBag.prototype.getValue = function (time, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = {};\n  }\n\n  const propertyNames = this._propertyNames;\n  for (let i = 0, len = propertyNames.length; i < len; i++) {\n    const propertyName = propertyNames[i];\n    result[propertyName] = Property.getValueOrUndefined(\n      this[propertyName],\n      time,\n      result[propertyName]\n    );\n  }\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {object} source The object to be merged into this object.\n * @param {Function} [createPropertyCallback] A function that will be called when the value of any of the properties in value are not a Property.\n */\nPropertyBag.prototype.merge = function (source, createPropertyCallback) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const propertyNames = this._propertyNames;\n  const sourcePropertyNames = defined(source._propertyNames)\n    ? source._propertyNames\n    : Object.keys(source);\n  for (let i = 0, len = sourcePropertyNames.length; i < len; i++) {\n    const name = sourcePropertyNames[i];\n\n    const targetProperty = this[name];\n    const sourceProperty = source[name];\n\n    //Custom properties that are registered on the source must also be added to this.\n    if (targetProperty === undefined && propertyNames.indexOf(name) === -1) {\n      this.addProperty(name, undefined, createPropertyCallback);\n    }\n\n    if (sourceProperty !== undefined) {\n      if (targetProperty !== undefined) {\n        if (defined(targetProperty) && defined(targetProperty.merge)) {\n          targetProperty.merge(sourceProperty);\n        }\n      } else if (\n        defined(sourceProperty) &&\n        defined(sourceProperty.merge) &&\n        defined(sourceProperty.clone)\n      ) {\n        this[name] = sourceProperty.clone();\n      } else {\n        this[name] = sourceProperty;\n      }\n    }\n  }\n};\n\nfunction propertiesEqual(a, b) {\n  const aPropertyNames = a._propertyNames;\n  const bPropertyNames = b._propertyNames;\n\n  const len = aPropertyNames.length;\n  if (len !== bPropertyNames.length) {\n    return false;\n  }\n\n  for (let aIndex = 0; aIndex < len; ++aIndex) {\n    const name = aPropertyNames[aIndex];\n    const bIndex = bPropertyNames.indexOf(name);\n    if (bIndex === -1) {\n      return false;\n    }\n    if (!Property.equals(a[name], b[name])) {\n      return false;\n    }\n  }\n  return true;\n}\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPropertyBag.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof PropertyBag && //\n      propertiesEqual(this, other))\n  );\n};\nexport default PropertyBag;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport NodeTransformationProperty from \"./NodeTransformationProperty.js\";\nimport PropertyBag from \"./PropertyBag.js\";\n\nfunction createNodeTransformationProperty(value) {\n  return new NodeTransformationProperty(value);\n}\n\nfunction createNodeTransformationPropertyBag(value) {\n  return new PropertyBag(value, createNodeTransformationProperty);\n}\n\nfunction createArticulationStagePropertyBag(value) {\n  return new PropertyBag(value);\n}\n\n/**\n * @typedef {object} ModelGraphics.ConstructorOptions\n *\n * Initialization options for the ModelGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the model.\n * @property {Property | string | Resource} [uri] A string or Resource Property specifying the URI of the glTF asset.\n * @property {Property | number} [scale=1.0] A numeric Property specifying a uniform linear scale.\n * @property {Property | number} [minimumPixelSize=0.0] A numeric Property specifying the approximate minimum pixel size of the model regardless of zoom.\n * @property {Property | number} [maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize.\n * @property {Property | boolean} [incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded.\n * @property {Property | boolean} [runAnimations=true] A boolean Property specifying if glTF animations specified in the model should be started.\n * @property {Property | boolean} [clampAnimations=true] A boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.\n * @property {Property | ShadowMode} [shadows=ShadowMode.ENABLED] An enum Property specifying whether the model casts or receives shadows from light sources.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | Color} [silhouetteColor=Color.RED] A Property specifying the {@link Color} of the silhouette.\n * @property {Property | number} [silhouetteSize=0.0] A numeric Property specifying the size of the silhouette in pixels.\n * @property {Property | Color} [color=Color.WHITE] A Property specifying the {@link Color} that blends with the model's rendered color.\n * @property {Property | ColorBlendMode} [colorBlendMode=ColorBlendMode.HIGHLIGHT] An enum Property specifying how the color blends with the model.\n * @property {Property | number} [colorBlendAmount=0.5] A numeric Property specifying the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.\n * @property {Property | Cartesian2} [imageBasedLightingFactor=new Cartesian2(1.0, 1.0)] A property specifying the contribution from diffuse and specular image-based lighting.\n * @property {Property | Color} [lightColor] A property specifying the light color when shading the model. When <code>undefined</code> the scene's light color is used instead.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this model will be displayed.\n * @property {PropertyBag | Object<string, TranslationRotationScale>} [nodeTransformations] An object, where keys are names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node. The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation.\n * @property {PropertyBag | Object<string, number>} [articulations] An object, where keys are composed of an articulation name, a single space, and a stage name, and the values are numeric properties.\n * @property {Property | ClippingPlaneCollection} [clippingPlanes] A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model.\n * @property {Property | CustomShader} [customShader] A property specifying the {@link CustomShader} to apply to this model.\n */\n\n/**\n * A 3D model based on {@link https://github.com/KhronosGroup/glTF|glTF}, the runtime asset format for WebGL, OpenGL ES, and OpenGL.\n * The position and orientation of the model is determined by the containing {@link Entity}.\n * <p>\n * Cesium includes support for glTF geometry, materials, animations, and skinning.\n * Cameras and lights are not currently supported.\n * </p>\n *\n * @alias ModelGraphics\n * @constructor\n *\n * @param {ModelGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=3D%20Models.html|Cesium Sandcastle 3D Models Demo}\n */\nfunction ModelGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._uri = undefined;\n  this._uriSubscription = undefined;\n  this._scale = undefined;\n  this._scaleSubscription = undefined;\n  this._minimumPixelSize = undefined;\n  this._minimumPixelSizeSubscription = undefined;\n  this._maximumScale = undefined;\n  this._maximumScaleSubscription = undefined;\n  this._incrementallyLoadTextures = undefined;\n  this._incrementallyLoadTexturesSubscription = undefined;\n  this._runAnimations = undefined;\n  this._runAnimationsSubscription = undefined;\n  this._clampAnimations = undefined;\n  this._clampAnimationsSubscription = undefined;\n  this._shadows = undefined;\n  this._shadowsSubscription = undefined;\n  this._heightReference = undefined;\n  this._heightReferenceSubscription = undefined;\n  this._silhouetteColor = undefined;\n  this._silhouetteColorSubscription = undefined;\n  this._silhouetteSize = undefined;\n  this._silhouetteSizeSubscription = undefined;\n  this._color = undefined;\n  this._colorSubscription = undefined;\n  this._colorBlendMode = undefined;\n  this._colorBlendModeSubscription = undefined;\n  this._colorBlendAmount = undefined;\n  this._colorBlendAmountSubscription = undefined;\n  this._imageBasedLightingFactor = undefined;\n  this._imageBasedLightingFactorSubscription = undefined;\n  this._lightColor = undefined;\n  this._lightColorSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distanceDisplayConditionSubscription = undefined;\n  this._nodeTransformations = undefined;\n  this._nodeTransformationsSubscription = undefined;\n  this._articulations = undefined;\n  this._articulationsSubscription = undefined;\n  this._clippingPlanes = undefined;\n  this._clippingPlanesSubscription = undefined;\n  this._customShader = undefined;\n  this._customShaderSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(ModelGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof ModelGraphics.prototype\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the model.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets the string Property specifying the URI of the glTF asset.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  uri: createPropertyDescriptor(\"uri\"),\n\n  /**\n   * Gets or sets the numeric Property specifying a uniform linear scale\n   * for this model. Values greater than 1.0 increase the size of the model while\n   * values less than 1.0 decrease it.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  scale: createPropertyDescriptor(\"scale\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the approximate minimum\n   * pixel size of the model regardless of zoom. This can be used to ensure that\n   * a model is visible even when the viewer zooms out.  When <code>0.0</code>,\n   * no minimum size is enforced.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0.0\n   */\n  minimumPixelSize: createPropertyDescriptor(\"minimumPixelSize\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the maximum scale\n   * size of a model. This property is used as an upper limit for\n   * {@link ModelGraphics#minimumPixelSize}.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  maximumScale: createPropertyDescriptor(\"maximumScale\"),\n\n  /**\n   * Get or sets the boolean Property specifying whether textures\n   * may continue to stream in after the model is loaded.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  incrementallyLoadTextures: createPropertyDescriptor(\n    \"incrementallyLoadTextures\"\n  ),\n\n  /**\n   * Gets or sets the boolean Property specifying if glTF animations should be run.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  runAnimations: createPropertyDescriptor(\"runAnimations\"),\n\n  /**\n   * Gets or sets the boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  clampAnimations: createPropertyDescriptor(\"clampAnimations\"),\n\n  /**\n   * Get or sets the enum Property specifying whether the model\n   * casts or receives shadows from light sources.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   * @default ShadowMode.ENABLED\n   */\n  shadows: createPropertyDescriptor(\"shadows\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link HeightReference}.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   * @default HeightReference.NONE\n   */\n  heightReference: createPropertyDescriptor(\"heightReference\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the silhouette.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   * @default Color.RED\n   */\n  silhouetteColor: createPropertyDescriptor(\"silhouetteColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the size of the silhouette in pixels.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0.0\n   */\n  silhouetteSize: createPropertyDescriptor(\"silhouetteSize\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} that blends with the model's rendered color.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   * @default Color.WHITE\n   */\n  color: createPropertyDescriptor(\"color\"),\n\n  /**\n   * Gets or sets the enum Property specifying how the color blends with the model.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   * @default ColorBlendMode.HIGHLIGHT\n   */\n  colorBlendMode: createPropertyDescriptor(\"colorBlendMode\"),\n\n  /**\n   * A numeric Property specifying the color strength when the <code>colorBlendMode</code> is MIX.\n   * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with\n   * any value in-between resulting in a mix of the two.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0.5\n   */\n  colorBlendAmount: createPropertyDescriptor(\"colorBlendAmount\"),\n\n  /**\n   * A property specifying the {@link Cartesian2} used to scale the diffuse and specular image-based lighting contribution to the final color.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  imageBasedLightingFactor: createPropertyDescriptor(\n    \"imageBasedLightingFactor\"\n  ),\n\n  /**\n   * A property specifying the {@link Cartesian3} light color when shading the model. When <code>undefined</code> the scene's light color is used instead.\n   * @memberOf ModelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  lightColor: createPropertyDescriptor(\"lightColor\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this model will be displayed.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n\n  /**\n   * Gets or sets the set of node transformations to apply to this model.  This is represented as an {@link PropertyBag}, where keys are\n   * names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node.\n   * The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation.\n   * @memberof ModelGraphics.prototype\n   * @type {PropertyBag}\n   */\n  nodeTransformations: createPropertyDescriptor(\n    \"nodeTransformations\",\n    undefined,\n    createNodeTransformationPropertyBag\n  ),\n\n  /**\n   * Gets or sets the set of articulation values to apply to this model.  This is represented as an {@link PropertyBag}, where keys are\n   * composed as the name of the articulation, a single space, and the name of the stage.\n   * @memberof ModelGraphics.prototype\n   * @type {PropertyBag}\n   */\n  articulations: createPropertyDescriptor(\n    \"articulations\",\n    undefined,\n    createArticulationStagePropertyBag\n  ),\n\n  /**\n   * A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  clippingPlanes: createPropertyDescriptor(\"clippingPlanes\"),\n\n  /**\n   * Gets or sets the {@link CustomShader} to apply to this model. When <code>undefined</code>, no custom shader code is used.\n   * @memberof ModelGraphics.prototype\n   * @type {Property|undefined}\n   */\n  customShader: createPropertyDescriptor(\"customShader\"),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {ModelGraphics} [result] The object onto which to store the result.\n * @returns {ModelGraphics} The modified result parameter or a new instance if one was not provided.\n */\nModelGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new ModelGraphics(this);\n  }\n  result.show = this.show;\n  result.uri = this.uri;\n  result.scale = this.scale;\n  result.minimumPixelSize = this.minimumPixelSize;\n  result.maximumScale = this.maximumScale;\n  result.incrementallyLoadTextures = this.incrementallyLoadTextures;\n  result.runAnimations = this.runAnimations;\n  result.clampAnimations = this.clampAnimations;\n  result.heightReference = this._heightReference;\n  result.silhouetteColor = this.silhouetteColor;\n  result.silhouetteSize = this.silhouetteSize;\n  result.color = this.color;\n  result.colorBlendMode = this.colorBlendMode;\n  result.colorBlendAmount = this.colorBlendAmount;\n  result.imageBasedLightingFactor = this.imageBasedLightingFactor;\n  result.lightColor = this.lightColor;\n  result.distanceDisplayCondition = this.distanceDisplayCondition;\n  result.nodeTransformations = this.nodeTransformations;\n  result.articulations = this.articulations;\n  result.clippingPlanes = this.clippingPlanes;\n  result.customShader = this.customShader;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {ModelGraphics} source The object to be merged into this object.\n */\nModelGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.uri = defaultValue(this.uri, source.uri);\n  this.scale = defaultValue(this.scale, source.scale);\n  this.minimumPixelSize = defaultValue(\n    this.minimumPixelSize,\n    source.minimumPixelSize\n  );\n  this.maximumScale = defaultValue(this.maximumScale, source.maximumScale);\n  this.incrementallyLoadTextures = defaultValue(\n    this.incrementallyLoadTextures,\n    source.incrementallyLoadTextures\n  );\n  this.runAnimations = defaultValue(this.runAnimations, source.runAnimations);\n  this.clampAnimations = defaultValue(\n    this.clampAnimations,\n    source.clampAnimations\n  );\n  this.shadows = defaultValue(this.shadows, source.shadows);\n  this.heightReference = defaultValue(\n    this.heightReference,\n    source.heightReference\n  );\n  this.silhouetteColor = defaultValue(\n    this.silhouetteColor,\n    source.silhouetteColor\n  );\n  this.silhouetteSize = defaultValue(\n    this.silhouetteSize,\n    source.silhouetteSize\n  );\n  this.color = defaultValue(this.color, source.color);\n  this.colorBlendMode = defaultValue(\n    this.colorBlendMode,\n    source.colorBlendMode\n  );\n  this.colorBlendAmount = defaultValue(\n    this.colorBlendAmount,\n    source.colorBlendAmount\n  );\n  this.imageBasedLightingFactor = defaultValue(\n    this.imageBasedLightingFactor,\n    source.imageBasedLightingFactor\n  );\n  this.lightColor = defaultValue(this.lightColor, source.lightColor);\n  this.distanceDisplayCondition = defaultValue(\n    this.distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n  this.clippingPlanes = defaultValue(\n    this.clippingPlanes,\n    source.clippingPlanes\n  );\n  this.customShader = defaultValue(this.customShader, source.customShader);\n\n  const sourceNodeTransformations = source.nodeTransformations;\n  if (defined(sourceNodeTransformations)) {\n    const targetNodeTransformations = this.nodeTransformations;\n    if (defined(targetNodeTransformations)) {\n      targetNodeTransformations.merge(sourceNodeTransformations);\n    } else {\n      this.nodeTransformations = new PropertyBag(\n        sourceNodeTransformations,\n        createNodeTransformationProperty\n      );\n    }\n  }\n\n  const sourceArticulations = source.articulations;\n  if (defined(sourceArticulations)) {\n    const targetArticulations = this.articulations;\n    if (defined(targetArticulations)) {\n      targetArticulations.merge(sourceArticulations);\n    } else {\n      this.articulations = new PropertyBag(sourceArticulations);\n    }\n  }\n};\nexport default ModelGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {object} Cesium3DTilesetGraphics.ConstructorOptions\n *\n * Initialization options for the Cesium3DTilesetGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the tileset.\n * @property {Property | string | Resource} [uri] A string or Resource Property specifying the URI of the tileset.\n * @property {Property | number} [maximumScreenSpaceError] A number or Property specifying the maximum screen space error used to drive level of detail refinement.\n */\n\n/**\n * A 3D Tiles tileset represented by an {@link Entity}.\n * The tileset modelMatrix is determined by the containing Entity position and orientation\n * or is left unset if position is undefined.\n *\n * @alias Cesium3DTilesetGraphics\n * @constructor\n *\n * @param {Cesium3DTilesetGraphics.ConstructorOptions} [options] Object describing initialization options\n */\nfunction Cesium3DTilesetGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._uri = undefined;\n  this._uriSubscription = undefined;\n  this._maximumScreenSpaceError = undefined;\n  this._maximumScreenSpaceErrorSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(Cesium3DTilesetGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof Cesium3DTilesetGraphics.prototype\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the model.\n   * @memberof Cesium3DTilesetGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets the string Property specifying the URI of the glTF asset.\n   * @memberof Cesium3DTilesetGraphics.prototype\n   * @type {Property|undefined}\n   */\n  uri: createPropertyDescriptor(\"uri\"),\n\n  /**\n   * Gets or sets the maximum screen space error used to drive level of detail refinement.\n   * @memberof Cesium3DTilesetGraphics.prototype\n   * @type {Property|undefined}\n   */\n  maximumScreenSpaceError: createPropertyDescriptor(\"maximumScreenSpaceError\"),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {Cesium3DTilesetGraphics} [result] The object onto which to store the result.\n * @returns {Cesium3DTilesetGraphics} The modified result parameter or a new instance if one was not provided.\n */\nCesium3DTilesetGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new Cesium3DTilesetGraphics(this);\n  }\n  result.show = this.show;\n  result.uri = this.uri;\n  result.maximumScreenSpaceError = this.maximumScreenSpaceError;\n\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {Cesium3DTilesetGraphics} source The object to be merged into this object.\n */\nCesium3DTilesetGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.uri = defaultValue(this.uri, source.uri);\n  this.maximumScreenSpaceError = defaultValue(\n    this.maximumScreenSpaceError,\n    source.maximumScreenSpaceError\n  );\n};\n\nexport default Cesium3DTilesetGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {object} PathGraphics.ConstructorOptions\n *\n * Initialization options for the PathGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the path.\n * @property {Property | number} [leadTime] A Property specifying the number of seconds in front the object to show.\n * @property {Property | number} [trailTime] A Property specifying the number of seconds behind of the object to show.\n * @property {Property | number} [width=1.0] A numeric Property specifying the width in pixels.\n * @property {Property | number} [resolution=60] A numeric Property specifying the maximum number of seconds to step when sampling the position.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to draw the path.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this path will be displayed.\n */\n\n/**\n * Describes a polyline defined as the path made by an {@link Entity} as it moves over time.\n *\n * @alias PathGraphics\n * @constructor\n *\n * @param {PathGraphics.ConstructorOptions} [options] Object describing initialization options\n */\nfunction PathGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._leadTime = undefined;\n  this._leadTimeSubscription = undefined;\n  this._trailTime = undefined;\n  this._trailTimeSubscription = undefined;\n  this._width = undefined;\n  this._widthSubscription = undefined;\n  this._resolution = undefined;\n  this._resolutionSubscription = undefined;\n  this._material = undefined;\n  this._materialSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distanceDisplayConditionSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(PathGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof PathGraphics.prototype\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the path.\n   * @memberof PathGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets the Property specifying the number of seconds in front of the object to show.\n   * @memberof PathGraphics.prototype\n   * @type {Property|undefined}\n   */\n  leadTime: createPropertyDescriptor(\"leadTime\"),\n\n  /**\n   * Gets or sets the Property specifying the number of seconds behind the object to show.\n   * @memberof PathGraphics.prototype\n   * @type {Property|undefined}\n   */\n  trailTime: createPropertyDescriptor(\"trailTime\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the width in pixels.\n   * @memberof PathGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  width: createPropertyDescriptor(\"width\"),\n\n  /**\n   * Gets or sets the Property specifying the maximum number of seconds to step when sampling the position.\n   * @memberof PathGraphics.prototype\n   * @type {Property|undefined}\n   * @default 60\n   */\n  resolution: createPropertyDescriptor(\"resolution\"),\n\n  /**\n   * Gets or sets the Property specifying the material used to draw the path.\n   * @memberof PathGraphics.prototype\n   * @type {MaterialProperty}\n   * @default Color.WHITE\n   */\n  material: createMaterialPropertyDescriptor(\"material\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this path will be displayed.\n   * @memberof PathGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {PathGraphics} [result] The object onto which to store the result.\n * @returns {PathGraphics} The modified result parameter or a new instance if one was not provided.\n */\nPathGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new PathGraphics(this);\n  }\n  result.show = this.show;\n  result.leadTime = this.leadTime;\n  result.trailTime = this.trailTime;\n  result.width = this.width;\n  result.resolution = this.resolution;\n  result.material = this.material;\n  result.distanceDisplayCondition = this.distanceDisplayCondition;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {PathGraphics} source The object to be merged into this object.\n */\nPathGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.leadTime = defaultValue(this.leadTime, source.leadTime);\n  this.trailTime = defaultValue(this.trailTime, source.trailTime);\n  this.width = defaultValue(this.width, source.width);\n  this.resolution = defaultValue(this.resolution, source.resolution);\n  this.material = defaultValue(this.material, source.material);\n  this.distanceDisplayCondition = defaultValue(\n    this.distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n};\nexport default PathGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {object} PlaneGraphics.ConstructorOptions\n *\n * Initialization options for the PlaneGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the plane.\n * @property {Property | Plane} [plane] A {@link Plane} Property specifying the normal and distance for the plane.\n * @property {Property | Cartesian2} [dimensions] A {@link Cartesian2} Property specifying the width and height of the plane.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the plane is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the plane.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the plane is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the plane casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this plane will be displayed.\n */\n\n/**\n * Describes a plane. The center position and orientation are determined by the containing {@link Entity}.\n *\n * @alias PlaneGraphics\n * @constructor\n *\n * @param {PlaneGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Plane.html|Cesium Sandcastle Plane Demo}\n */\nfunction PlaneGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._plane = undefined;\n  this._planeSubscription = undefined;\n  this._dimensions = undefined;\n  this._dimensionsSubscription = undefined;\n  this._fill = undefined;\n  this._fillSubscription = undefined;\n  this._material = undefined;\n  this._materialSubscription = undefined;\n  this._outline = undefined;\n  this._outlineSubscription = undefined;\n  this._outlineColor = undefined;\n  this._outlineColorSubscription = undefined;\n  this._outlineWidth = undefined;\n  this._outlineWidthSubscription = undefined;\n  this._shadows = undefined;\n  this._shadowsSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distanceDisplayConditionSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(PlaneGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof PlaneGraphics.prototype\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the plane.\n   * @memberof PlaneGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets the {@link Plane} Property specifying the normal and distance of the plane.\n   *\n   * @memberof PlaneGraphics.prototype\n   * @type {Property|undefined}\n   */\n  plane: createPropertyDescriptor(\"plane\"),\n\n  /**\n   * Gets or sets the {@link Cartesian2} Property specifying the width and height of the plane.\n   *\n   * @memberof PlaneGraphics.prototype\n   * @type {Property|undefined}\n   */\n  dimensions: createPropertyDescriptor(\"dimensions\"),\n\n  /**\n   * Gets or sets the boolean Property specifying whether the plane is filled with the provided material.\n   * @memberof PlaneGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  fill: createPropertyDescriptor(\"fill\"),\n\n  /**\n   * Gets or sets the material used to fill the plane.\n   * @memberof PlaneGraphics.prototype\n   * @type {MaterialProperty}\n   * @default Color.WHITE\n   */\n  material: createMaterialPropertyDescriptor(\"material\"),\n\n  /**\n   * Gets or sets the Property specifying whether the plane is outlined.\n   * @memberof PlaneGraphics.prototype\n   * @type {Property|undefined}\n   * @default false\n   */\n  outline: createPropertyDescriptor(\"outline\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the outline.\n   * @memberof PlaneGraphics.prototype\n   * @type {Property|undefined}\n   * @default Color.BLACK\n   */\n  outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the width of the outline.\n   * <p>\n   * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n   * </p>\n   * @memberof PlaneGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n  /**\n   * Get or sets the enum Property specifying whether the plane\n   * casts or receives shadows from light sources.\n   * @memberof PlaneGraphics.prototype\n   * @type {Property|undefined}\n   * @default ShadowMode.DISABLED\n   */\n  shadows: createPropertyDescriptor(\"shadows\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this plane will be displayed.\n   * @memberof PlaneGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {PlaneGraphics} [result] The object onto which to store the result.\n * @returns {PlaneGraphics} The modified result parameter or a new instance if one was not provided.\n */\nPlaneGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new PlaneGraphics(this);\n  }\n  result.show = this.show;\n  result.plane = this.plane;\n  result.dimensions = this.dimensions;\n  result.fill = this.fill;\n  result.material = this.material;\n  result.outline = this.outline;\n  result.outlineColor = this.outlineColor;\n  result.outlineWidth = this.outlineWidth;\n  result.shadows = this.shadows;\n  result.distanceDisplayCondition = this.distanceDisplayCondition;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {PlaneGraphics} source The object to be merged into this object.\n */\nPlaneGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.plane = defaultValue(this.plane, source.plane);\n  this.dimensions = defaultValue(this.dimensions, source.dimensions);\n  this.fill = defaultValue(this.fill, source.fill);\n  this.material = defaultValue(this.material, source.material);\n  this.outline = defaultValue(this.outline, source.outline);\n  this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n  this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n  this.shadows = defaultValue(this.shadows, source.shadows);\n  this.distanceDisplayCondition = defaultValue(\n    this.distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n};\nexport default PlaneGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {object} PointGraphics.ConstructorOptions\n *\n * Initialization options for the PointGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the point.\n * @property {Property | number} [pixelSize=1] A numeric Property specifying the size in pixels.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | Color} [color=Color.WHITE] A Property specifying the {@link Color} of the point.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=0] A numeric Property specifying the the outline width in pixels.\n * @property {Property | NearFarScalar} [scaleByDistance] A {@link NearFarScalar} Property used to scale the point based on distance.\n * @property {Property | NearFarScalar} [translucencyByDistance] A {@link NearFarScalar} Property used to set translucency based on distance from the camera.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this point will be displayed.\n * @property {Property | number} [disableDepthTestDistance] A Property specifying the distance from the camera at which to disable the depth test to.\n */\n\n/**\n * Describes a graphical point located at the position of the containing {@link Entity}.\n *\n * @alias PointGraphics\n * @constructor\n *\n * @param {PointGraphics.ConstructorOptions} [options] Object describing initialization options\n */\nfunction PointGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._pixelSize = undefined;\n  this._pixelSizeSubscription = undefined;\n  this._heightReference = undefined;\n  this._heightReferenceSubscription = undefined;\n  this._color = undefined;\n  this._colorSubscription = undefined;\n  this._outlineColor = undefined;\n  this._outlineColorSubscription = undefined;\n  this._outlineWidth = undefined;\n  this._outlineWidthSubscription = undefined;\n  this._scaleByDistance = undefined;\n  this._scaleByDistanceSubscription = undefined;\n  this._translucencyByDistance = undefined;\n  this._translucencyByDistanceSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distanceDisplayConditionSubscription = undefined;\n  this._disableDepthTestDistance = undefined;\n  this._disableDepthTestDistanceSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(PointGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof PointGraphics.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the point.\n   * @memberof PointGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the size in pixels.\n   * @memberof PointGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1\n   */\n  pixelSize: createPropertyDescriptor(\"pixelSize\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link HeightReference}.\n   * @memberof PointGraphics.prototype\n   * @type {Property|undefined}\n   * @default HeightReference.NONE\n   */\n  heightReference: createPropertyDescriptor(\"heightReference\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the point.\n   * @memberof PointGraphics.prototype\n   * @type {Property|undefined}\n   * @default Color.WHITE\n   */\n  color: createPropertyDescriptor(\"color\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the outline.\n   * @memberof PointGraphics.prototype\n   * @type {Property|undefined}\n   * @default Color.BLACK\n   */\n  outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the the outline width in pixels.\n   * @memberof PointGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0\n   */\n  outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n  /**\n   * Gets or sets the {@link NearFarScalar} Property used to scale the point based on distance.\n   * If undefined, a constant size is used.\n   * @memberof PointGraphics.prototype\n   * @type {Property|undefined}\n   */\n  scaleByDistance: createPropertyDescriptor(\"scaleByDistance\"),\n\n  /**\n   * Gets or sets {@link NearFarScalar} Property specifying the translucency of the point based on the distance from the camera.\n   * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the points's translucency remains clamped to the nearest bound.\n   * @memberof PointGraphics.prototype\n   * @type {Property|undefined}\n   */\n  translucencyByDistance: createPropertyDescriptor(\"translucencyByDistance\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this point will be displayed.\n   * @memberof PointGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n\n  /**\n   * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.\n   * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.\n   * @memberof PointGraphics.prototype\n   * @type {Property|undefined}\n   */\n  disableDepthTestDistance: createPropertyDescriptor(\n    \"disableDepthTestDistance\"\n  ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {PointGraphics} [result] The object onto which to store the result.\n * @returns {PointGraphics} The modified result parameter or a new instance if one was not provided.\n */\nPointGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new PointGraphics(this);\n  }\n  result.show = this.show;\n  result.pixelSize = this.pixelSize;\n  result.heightReference = this.heightReference;\n  result.color = this.color;\n  result.outlineColor = this.outlineColor;\n  result.outlineWidth = this.outlineWidth;\n  result.scaleByDistance = this.scaleByDistance;\n  result.translucencyByDistance = this._translucencyByDistance;\n  result.distanceDisplayCondition = this.distanceDisplayCondition;\n  result.disableDepthTestDistance = this.disableDepthTestDistance;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {PointGraphics} source The object to be merged into this object.\n */\nPointGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.pixelSize = defaultValue(this.pixelSize, source.pixelSize);\n  this.heightReference = defaultValue(\n    this.heightReference,\n    source.heightReference\n  );\n  this.color = defaultValue(this.color, source.color);\n  this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n  this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n  this.scaleByDistance = defaultValue(\n    this.scaleByDistance,\n    source.scaleByDistance\n  );\n  this.translucencyByDistance = defaultValue(\n    this._translucencyByDistance,\n    source.translucencyByDistance\n  );\n  this.distanceDisplayCondition = defaultValue(\n    this.distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n  this.disableDepthTestDistance = defaultValue(\n    this.disableDepthTestDistance,\n    source.disableDepthTestDistance\n  );\n};\nexport default PointGraphics;\n", "import defined from \"./defined.js\";\n\n/**\n * An hierarchy of linear rings which define a polygon and its holes.\n * The holes themselves may also have holes which nest inner polygons.\n * @alias PolygonHierarchy\n * @constructor\n *\n * @param {Cartesian3[]} [positions] A linear ring defining the outer boundary of the polygon or hole.\n * @param {PolygonHierarchy[]} [holes] An array of polygon hierarchies defining holes in the polygon.\n */\nfunction PolygonHierarchy(positions, holes) {\n  /**\n   * A linear ring defining the outer boundary of the polygon or hole.\n   * @type {Cartesian3[]}\n   */\n  this.positions = defined(positions) ? positions : [];\n\n  /**\n   * An array of polygon hierarchies defining holes in the polygon.\n   * @type {PolygonHierarchy[]}\n   */\n  this.holes = defined(holes) ? holes : [];\n}\nexport default PolygonHierarchy;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport PolygonHierarchy from \"../Core/PolygonHierarchy.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\nfunction createPolygonHierarchyProperty(value) {\n  if (Array.isArray(value)) {\n    // convert array of positions to PolygonHierarchy object\n    value = new PolygonHierarchy(value);\n  }\n  return new ConstantProperty(value);\n}\n\n/**\n * @typedef {object} PolygonGraphics.ConstructorOptions\n *\n * Initialization options for the PolygonGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the polygon.\n * @property {Property | PolygonHierarchy | Cartesian3[]} [hierarchy] A Property specifying the {@link PolygonHierarchy}.\n * @property {Property | number} [height=0] A numeric Property specifying the altitude of the polygon relative to the ellipsoid surface.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | number} [extrudedHeight] A numeric Property specifying the altitude of the polygon's extruded face relative to the ellipsoid surface.\n * @property {Property | HeightReference} [extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to.\n * @property {Property | number} [stRotation=0.0] A numeric property specifying the rotation of the polygon texture counter-clockwise from north. Only has an effect if textureCoordinates is not defined.\n * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude point.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the polygon is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the polygon.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the polygon is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | boolean} [perPositionHeight=false] A boolean specifying whether or not the height of each position is used.\n * @property {boolean | boolean} [closeTop=true] When false, leaves off the top of an extruded polygon open.\n * @property {boolean | boolean} [closeBottom=true] When false, leaves off the bottom of an extruded polygon open.\n * @property {Property | ArcType} [arcType=ArcType.GEODESIC] The type of line the polygon edges must follow.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the polygon casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this polygon will be displayed.\n * @property {Property | ClassificationType} [classificationType=ClassificationType.BOTH] An enum Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.\n * @property {ConstantProperty | number} [zIndex=0] A property specifying the zIndex used for ordering ground geometry.  Only has an effect if the polygon is constant and neither height or extrudedHeight are specified.\n * @property {Property | PolygonHierarchy} [textureCoordinates] A Property specifying texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.\n */\n\n/**\n * Describes a polygon defined by an hierarchy of linear rings which make up the outer shape and any nested holes.\n * The polygon conforms to the curvature of the globe and can be placed on the surface or\n * at altitude and can optionally be extruded into a volume.\n *\n * @alias PolygonGraphics\n * @constructor\n *\n * @param {PolygonGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @see Entity\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Polygon.html|Cesium Sandcastle Polygon Demo}\n */\nfunction PolygonGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._hierarchy = undefined;\n  this._hierarchySubscription = undefined;\n  this._height = undefined;\n  this._heightSubscription = undefined;\n  this._heightReference = undefined;\n  this._heightReferenceSubscription = undefined;\n  this._extrudedHeight = undefined;\n  this._extrudedHeightSubscription = undefined;\n  this._extrudedHeightReference = undefined;\n  this._extrudedHeightReferenceSubscription = undefined;\n  this._stRotation = undefined;\n  this._stRotationSubscription = undefined;\n  this._granularity = undefined;\n  this._granularitySubscription = undefined;\n  this._fill = undefined;\n  this._fillSubscription = undefined;\n  this._material = undefined;\n  this._materialSubscription = undefined;\n  this._outline = undefined;\n  this._outlineSubscription = undefined;\n  this._outlineColor = undefined;\n  this._outlineColorSubscription = undefined;\n  this._outlineWidth = undefined;\n  this._outlineWidthSubscription = undefined;\n  this._perPositionHeight = undefined;\n  this._perPositionHeightSubscription = undefined;\n  this._closeTop = undefined;\n  this._closeTopSubscription = undefined;\n  this._closeBottom = undefined;\n  this._closeBottomSubscription = undefined;\n  this._arcType = undefined;\n  this._arcTypeSubscription = undefined;\n  this._shadows = undefined;\n  this._shadowsSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distanceDisplayConditionSubscription = undefined;\n  this._classificationType = undefined;\n  this._classificationTypeSubscription = undefined;\n  this._zIndex = undefined;\n  this._zIndexSubscription = undefined;\n  this._textureCoordinates = undefined;\n  this._textureCoordinatesSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(PolygonGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof PolygonGraphics.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the polygon.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link PolygonHierarchy}.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   */\n  hierarchy: createPropertyDescriptor(\n    \"hierarchy\",\n    undefined,\n    createPolygonHierarchyProperty\n  ),\n\n  /**\n   * Gets or sets the numeric Property specifying the constant altitude of the polygon.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0.0\n   */\n  height: createPropertyDescriptor(\"height\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link HeightReference}.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   * @default HeightReference.NONE\n   */\n  heightReference: createPropertyDescriptor(\"heightReference\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the altitude of the polygon extrusion.\n   * If {@link PolygonGraphics#perPositionHeight} is false, the volume starts at {@link PolygonGraphics#height} and ends at this altitude.\n   * If {@link PolygonGraphics#perPositionHeight} is true, the volume starts at the height of each {@link PolygonGraphics#hierarchy} position and ends at this altitude.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   */\n  extrudedHeight: createPropertyDescriptor(\"extrudedHeight\"),\n\n  /**\n   * Gets or sets the Property specifying the extruded {@link HeightReference}.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   * @default HeightReference.NONE\n   */\n  extrudedHeightReference: createPropertyDescriptor(\"extrudedHeightReference\"),\n\n  /**\n   * Gets or sets the numeric property specifying the rotation of the polygon texture counter-clockwise from north. Only has an effect if textureCoordinates is not defined.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0\n   */\n  stRotation: createPropertyDescriptor(\"stRotation\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the angular distance between points on the polygon.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   * @default {CesiumMath.RADIANS_PER_DEGREE}\n   */\n  granularity: createPropertyDescriptor(\"granularity\"),\n\n  /**\n   * Gets or sets the boolean Property specifying whether the polygon is filled with the provided material.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  fill: createPropertyDescriptor(\"fill\"),\n\n  /**\n   * Gets or sets the Property specifying the material used to fill the polygon.\n   * @memberof PolygonGraphics.prototype\n   * @type {MaterialProperty}\n   * @default Color.WHITE\n   */\n  material: createMaterialPropertyDescriptor(\"material\"),\n\n  /**\n   * Gets or sets the Property specifying whether the polygon is outlined.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   * @default false\n   */\n  outline: createPropertyDescriptor(\"outline\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the outline.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   * @default Color.BLACK\n   */\n  outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the width of the outline.\n   * <p>\n   * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n   * </p>\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n  /**\n   * Gets or sets the boolean specifying whether or not the the height of each position is used.\n   * If true, the shape will have non-uniform altitude defined by the height of each {@link PolygonGraphics#hierarchy} position.\n   * If false, the shape will have a constant altitude as specified by {@link PolygonGraphics#height}.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   */\n  perPositionHeight: createPropertyDescriptor(\"perPositionHeight\"),\n\n  /**\n   * Gets or sets a boolean specifying whether or not the top of an extruded polygon is included.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   */\n  closeTop: createPropertyDescriptor(\"closeTop\"),\n\n  /**\n   * Gets or sets a boolean specifying whether or not the bottom of an extruded polygon is included.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   */\n  closeBottom: createPropertyDescriptor(\"closeBottom\"),\n\n  /**\n   * Gets or sets the {@link ArcType} Property specifying the type of lines the polygon edges use.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   * @default ArcType.GEODESIC\n   */\n  arcType: createPropertyDescriptor(\"arcType\"),\n\n  /**\n   * Get or sets the enum Property specifying whether the polygon\n   * casts or receives shadows from light sources.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   * @default ShadowMode.DISABLED\n   */\n  shadows: createPropertyDescriptor(\"shadows\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polygon will be displayed.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n\n  /**\n   * Gets or sets the {@link ClassificationType} Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   * @default ClassificationType.BOTH\n   */\n  classificationType: createPropertyDescriptor(\"classificationType\"),\n\n  /**\n   * Gets or sets the zIndex Prperty specifying the ordering of ground geometry.  Only has an effect if the polygon is constant and neither height or extrudedHeight are specified.\n   * @memberof PolygonGraphics.prototype\n   * @type {ConstantProperty|undefined}\n   * @default 0\n   */\n  zIndex: createPropertyDescriptor(\"zIndex\"),\n\n  /**\n   *  A Property specifying texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.\n   * @memberof PolygonGraphics.prototype\n   * @type {Property|undefined}\n   */\n  textureCoordinates: createPropertyDescriptor(\"textureCoordinates\"),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {PolygonGraphics} [result] The object onto which to store the result.\n * @returns {PolygonGraphics} The modified result parameter or a new instance if one was not provided.\n */\nPolygonGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new PolygonGraphics(this);\n  }\n  result.show = this.show;\n  result.hierarchy = this.hierarchy;\n  result.height = this.height;\n  result.heightReference = this.heightReference;\n  result.extrudedHeight = this.extrudedHeight;\n  result.extrudedHeightReference = this.extrudedHeightReference;\n  result.stRotation = this.stRotation;\n  result.granularity = this.granularity;\n  result.fill = this.fill;\n  result.material = this.material;\n  result.outline = this.outline;\n  result.outlineColor = this.outlineColor;\n  result.outlineWidth = this.outlineWidth;\n  result.perPositionHeight = this.perPositionHeight;\n  result.closeTop = this.closeTop;\n  result.closeBottom = this.closeBottom;\n  result.arcType = this.arcType;\n  result.shadows = this.shadows;\n  result.distanceDisplayCondition = this.distanceDisplayCondition;\n  result.classificationType = this.classificationType;\n  result.zIndex = this.zIndex;\n  result.textureCoordinates = this.textureCoordinates;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {PolygonGraphics} source The object to be merged into this object.\n */\nPolygonGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.hierarchy = defaultValue(this.hierarchy, source.hierarchy);\n  this.height = defaultValue(this.height, source.height);\n  this.heightReference = defaultValue(\n    this.heightReference,\n    source.heightReference\n  );\n  this.extrudedHeight = defaultValue(\n    this.extrudedHeight,\n    source.extrudedHeight\n  );\n  this.extrudedHeightReference = defaultValue(\n    this.extrudedHeightReference,\n    source.extrudedHeightReference\n  );\n  this.stRotation = defaultValue(this.stRotation, source.stRotation);\n  this.granularity = defaultValue(this.granularity, source.granularity);\n  this.fill = defaultValue(this.fill, source.fill);\n  this.material = defaultValue(this.material, source.material);\n  this.outline = defaultValue(this.outline, source.outline);\n  this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n  this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n  this.perPositionHeight = defaultValue(\n    this.perPositionHeight,\n    source.perPositionHeight\n  );\n  this.closeTop = defaultValue(this.closeTop, source.closeTop);\n  this.closeBottom = defaultValue(this.closeBottom, source.closeBottom);\n  this.arcType = defaultValue(this.arcType, source.arcType);\n  this.shadows = defaultValue(this.shadows, source.shadows);\n  this.distanceDisplayCondition = defaultValue(\n    this.distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n  this.classificationType = defaultValue(\n    this.classificationType,\n    source.classificationType\n  );\n  this.zIndex = defaultValue(this.zIndex, source.zIndex);\n  this.textureCoordinates = defaultValue(\n    this.textureCoordinates,\n    source.textureCoordinates\n  );\n};\nexport default PolygonGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {object} PolylineGraphics.ConstructorOptions\n *\n * Initialization options for the PolylineGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the polyline.\n * @property {Property | Cartesian3[]} [positions] A Property specifying the array of {@link Cartesian3} positions that define the line strip.\n * @property {Property | number} [width=1.0] A numeric Property specifying the width in pixels.\n * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to draw the polyline.\n * @property {MaterialProperty | Color} [depthFailMaterial] A property specifying the material used to draw the polyline when it is below the terrain.\n * @property {Property | ArcType} [arcType=ArcType.GEODESIC] The type of line the polyline segments must follow.\n * @property {Property | boolean} [clampToGround=false] A boolean Property specifying whether the Polyline should be clamped to the ground.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the polyline casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this polyline will be displayed.\n * @property {Property | ClassificationType} [classificationType=ClassificationType.BOTH] An enum Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.\n * @property {Property | number} [zIndex=0] A Property specifying the zIndex used for ordering ground geometry. Only has an effect if `clampToGround` is true and polylines on terrain is supported.\n */\n\n/**\n * Describes a polyline. The first two positions define a line segment,\n * and each additional position defines a line segment from the previous position. The segments\n * can be linear connected points, great arcs, or clamped to terrain.\n *\n * @alias PolylineGraphics\n * @constructor\n *\n * @param {PolylineGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @see Entity\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Polyline.html|Cesium Sandcastle Polyline Demo}\n */\nfunction PolylineGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._positions = undefined;\n  this._positionsSubscription = undefined;\n  this._width = undefined;\n  this._widthSubscription = undefined;\n  this._granularity = undefined;\n  this._granularitySubscription = undefined;\n  this._material = undefined;\n  this._materialSubscription = undefined;\n  this._depthFailMaterial = undefined;\n  this._depthFailMaterialSubscription = undefined;\n  this._arcType = undefined;\n  this._arcTypeSubscription = undefined;\n  this._clampToGround = undefined;\n  this._clampToGroundSubscription = undefined;\n  this._shadows = undefined;\n  this._shadowsSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distanceDisplayConditionSubscription = undefined;\n  this._classificationType = undefined;\n  this._classificationTypeSubscription = undefined;\n  this._zIndex = undefined;\n  this._zIndexSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(PolylineGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof PolylineGraphics.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the polyline.\n   * @memberof PolylineGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets the Property specifying the array of {@link Cartesian3}\n   * positions that define the line strip.\n   * @memberof PolylineGraphics.prototype\n   * @type {Property|undefined}\n   */\n  positions: createPropertyDescriptor(\"positions\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the width in pixels.\n   * @memberof PolylineGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  width: createPropertyDescriptor(\"width\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE and clampToGround is false.\n   * @memberof PolylineGraphics.prototype\n   * @type {Property|undefined}\n   * @default Cesium.Math.RADIANS_PER_DEGREE\n   */\n  granularity: createPropertyDescriptor(\"granularity\"),\n\n  /**\n   * Gets or sets the Property specifying the material used to draw the polyline.\n   * @memberof PolylineGraphics.prototype\n   * @type {MaterialProperty}\n   * @default Color.WHITE\n   */\n  material: createMaterialPropertyDescriptor(\"material\"),\n\n  /**\n   * Gets or sets the Property specifying the material used to draw the polyline when it fails the depth test.\n   * <p>\n   * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,\n   * there may be artifacts.\n   * </p>\n   * @memberof PolylineGraphics.prototype\n   * @type {MaterialProperty}\n   * @default undefined\n   */\n  depthFailMaterial: createMaterialPropertyDescriptor(\"depthFailMaterial\"),\n\n  /**\n   * Gets or sets the {@link ArcType} Property specifying whether the line segments should be great arcs, rhumb lines or linearly connected.\n   * @memberof PolylineGraphics.prototype\n   * @type {Property|undefined}\n   * @default ArcType.GEODESIC\n   */\n  arcType: createPropertyDescriptor(\"arcType\"),\n\n  /**\n   * Gets or sets the boolean Property specifying whether the polyline\n   * should be clamped to the ground.\n   * @memberof PolylineGraphics.prototype\n   * @type {Property|undefined}\n   * @default false\n   */\n  clampToGround: createPropertyDescriptor(\"clampToGround\"),\n\n  /**\n   * Get or sets the enum Property specifying whether the polyline\n   * casts or receives shadows from light sources.\n   * @memberof PolylineGraphics.prototype\n   * @type {Property|undefined}\n   * @default ShadowMode.DISABLED\n   */\n  shadows: createPropertyDescriptor(\"shadows\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polyline will be displayed.\n   * @memberof PolylineGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n\n  /**\n   * Gets or sets the {@link ClassificationType} Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.\n   * @memberof PolylineGraphics.prototype\n   * @type {Property|undefined}\n   * @default ClassificationType.BOTH\n   */\n  classificationType: createPropertyDescriptor(\"classificationType\"),\n\n  /**\n   * Gets or sets the zIndex Property specifying the ordering of the polyline. Only has an effect if `clampToGround` is true and polylines on terrain is supported.\n   * @memberof PolylineGraphics.prototype\n   * @type {ConstantProperty|undefined}\n   * @default 0\n   */\n  zIndex: createPropertyDescriptor(\"zIndex\"),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {PolylineGraphics} [result] The object onto which to store the result.\n * @returns {PolylineGraphics} The modified result parameter or a new instance if one was not provided.\n */\nPolylineGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new PolylineGraphics(this);\n  }\n  result.show = this.show;\n  result.positions = this.positions;\n  result.width = this.width;\n  result.granularity = this.granularity;\n  result.material = this.material;\n  result.depthFailMaterial = this.depthFailMaterial;\n  result.arcType = this.arcType;\n  result.clampToGround = this.clampToGround;\n  result.shadows = this.shadows;\n  result.distanceDisplayCondition = this.distanceDisplayCondition;\n  result.classificationType = this.classificationType;\n  result.zIndex = this.zIndex;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {PolylineGraphics} source The object to be merged into this object.\n */\nPolylineGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.positions = defaultValue(this.positions, source.positions);\n  this.width = defaultValue(this.width, source.width);\n  this.granularity = defaultValue(this.granularity, source.granularity);\n  this.material = defaultValue(this.material, source.material);\n  this.depthFailMaterial = defaultValue(\n    this.depthFailMaterial,\n    source.depthFailMaterial\n  );\n  this.arcType = defaultValue(this.arcType, source.arcType);\n  this.clampToGround = defaultValue(this.clampToGround, source.clampToGround);\n  this.shadows = defaultValue(this.shadows, source.shadows);\n  this.distanceDisplayCondition = defaultValue(\n    this.distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n  this.classificationType = defaultValue(\n    this.classificationType,\n    source.classificationType\n  );\n  this.zIndex = defaultValue(this.zIndex, source.zIndex);\n};\nexport default PolylineGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {object} PolylineVolumeGraphics.ConstructorOptions\n *\n * Initialization options for the PolylineVolumeGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the volume.\n * @property {Property | Cartesian3[]} [positions] A Property specifying the array of {@link Cartesian3} positions which define the line strip.\n * @property {Property | Cartesian2[]} [shape] A Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded.\n * @property {Property | CornerType} [cornerType=CornerType.ROUNDED] A {@link CornerType} Property specifying the style of the corners.\n * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude point.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the volume is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the volume.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the volume is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the volume casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this volume will be displayed.\n */\n\n/**\n * Describes a polyline volume defined as a line strip and corresponding two dimensional shape which is extruded along it.\n * The resulting volume conforms to the curvature of the globe.\n *\n * @alias PolylineVolumeGraphics\n * @constructor\n *\n * @param {PolylineVolumeGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @see Entity\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Polyline%20Volume.html|Cesium Sandcastle Polyline Volume Demo}\n */\nfunction PolylineVolumeGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._positions = undefined;\n  this._positionsSubscription = undefined;\n  this._shape = undefined;\n  this._shapeSubscription = undefined;\n  this._cornerType = undefined;\n  this._cornerTypeSubscription = undefined;\n  this._granularity = undefined;\n  this._granularitySubscription = undefined;\n  this._fill = undefined;\n  this._fillSubscription = undefined;\n  this._material = undefined;\n  this._materialSubscription = undefined;\n  this._outline = undefined;\n  this._outlineSubscription = undefined;\n  this._outlineColor = undefined;\n  this._outlineColorSubscription = undefined;\n  this._outlineWidth = undefined;\n  this._outlineWidthSubscription = undefined;\n  this._shadows = undefined;\n  this._shadowsSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distanceDisplayConditionSubsription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(PolylineVolumeGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof PolylineVolumeGraphics.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the volume.\n   * @memberof PolylineVolumeGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the line strip.\n   * @memberof PolylineVolumeGraphics.prototype\n   * @type {Property|undefined}\n   */\n  positions: createPropertyDescriptor(\"positions\"),\n\n  /**\n   * Gets or sets the Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded.\n   * @memberof PolylineVolumeGraphics.prototype\n   * @type {Property|undefined}\n   */\n  shape: createPropertyDescriptor(\"shape\"),\n\n  /**\n   * Gets or sets the {@link CornerType} Property specifying the style of the corners.\n   * @memberof PolylineVolumeGraphics.prototype\n   * @type {Property|undefined}\n   * @default CornerType.ROUNDED\n   */\n  cornerType: createPropertyDescriptor(\"cornerType\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the angular distance between points on the volume.\n   * @memberof PolylineVolumeGraphics.prototype\n   * @type {Property|undefined}\n   * @default {CesiumMath.RADIANS_PER_DEGREE}\n   */\n  granularity: createPropertyDescriptor(\"granularity\"),\n\n  /**\n   * Gets or sets the boolean Property specifying whether the volume is filled with the provided material.\n   * @memberof PolylineVolumeGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  fill: createPropertyDescriptor(\"fill\"),\n\n  /**\n   * Gets or sets the Property specifying the material used to fill the volume.\n   * @memberof PolylineVolumeGraphics.prototype\n   * @type {MaterialProperty}\n   * @default Color.WHITE\n   */\n  material: createMaterialPropertyDescriptor(\"material\"),\n\n  /**\n   * Gets or sets the Property specifying whether the volume is outlined.\n   * @memberof PolylineVolumeGraphics.prototype\n   * @type {Property|undefined}\n   * @default false\n   */\n  outline: createPropertyDescriptor(\"outline\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the outline.\n   * @memberof PolylineVolumeGraphics.prototype\n   * @type {Property|undefined}\n   * @default Color.BLACK\n   */\n  outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the width of the outline.\n   * <p>\n   * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n   * </p>\n   * @memberof PolylineVolumeGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n  /**\n   * Get or sets the enum Property specifying whether the volume\n   * casts or receives shadows from light sources.\n   * @memberof PolylineVolumeGraphics.prototype\n   * @type {Property|undefined}\n   * @default ShadowMode.DISABLED\n   */\n  shadows: createPropertyDescriptor(\"shadows\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this volume will be displayed.\n   * @memberof PolylineVolumeGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {PolylineVolumeGraphics} [result] The object onto which to store the result.\n * @returns {PolylineVolumeGraphics} The modified result parameter or a new instance if one was not provided.\n */\nPolylineVolumeGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new PolylineVolumeGraphics(this);\n  }\n  result.show = this.show;\n  result.positions = this.positions;\n  result.shape = this.shape;\n  result.cornerType = this.cornerType;\n  result.granularity = this.granularity;\n  result.fill = this.fill;\n  result.material = this.material;\n  result.outline = this.outline;\n  result.outlineColor = this.outlineColor;\n  result.outlineWidth = this.outlineWidth;\n  result.shadows = this.shadows;\n  result.distanceDisplayCondition = this.distanceDisplayCondition;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {PolylineVolumeGraphics} source The object to be merged into this object.\n */\nPolylineVolumeGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.positions = defaultValue(this.positions, source.positions);\n  this.shape = defaultValue(this.shape, source.shape);\n  this.cornerType = defaultValue(this.cornerType, source.cornerType);\n  this.granularity = defaultValue(this.granularity, source.granularity);\n  this.fill = defaultValue(this.fill, source.fill);\n  this.material = defaultValue(this.material, source.material);\n  this.outline = defaultValue(this.outline, source.outline);\n  this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n  this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n  this.shadows = defaultValue(this.shadows, source.shadows);\n  this.distanceDisplayCondition = defaultValue(\n    this.distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n};\nexport default PolylineVolumeGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {object} RectangleGraphics.ConstructorOptions\n *\n * Initialization options for the RectangleGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the rectangle.\n * @property {Property | Rectangle} [coordinates] The Property specifying the {@link Rectangle}.\n * @property {Property | number} [height=0] A numeric Property specifying the altitude of the rectangle relative to the ellipsoid surface.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | number} [extrudedHeight] A numeric Property specifying the altitude of the rectangle's extruded face relative to the ellipsoid surface.\n * @property {Property | HeightReference} [extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to.\n * @property {Property | number} [rotation=0.0] A numeric property specifying the rotation of the rectangle clockwise from north.\n * @property {Property | number} [stRotation=0.0] A numeric property specifying the rotation of the rectangle texture counter-clockwise from north.\n * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between points on the rectangle.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the rectangle is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the rectangle.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the rectangle is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the rectangle casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this rectangle will be displayed.\n * @property {Property | ClassificationType} [classificationType=ClassificationType.BOTH] An enum Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground.\n * @property {Property | number} [zIndex=0] A Property specifying the zIndex used for ordering ground geometry.  Only has an effect if the rectangle is constant and neither height or extrudedHeight are specified.\n */\n\n/**\n * Describes graphics for a {@link Rectangle}.\n * The rectangle conforms to the curvature of the globe and can be placed on the surface or\n * at altitude and can optionally be extruded into a volume.\n *\n * @alias RectangleGraphics\n * @constructor\n *\n * @param {RectangleGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @see Entity\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Rectangle.html|Cesium Sandcastle Rectangle Demo}\n */\nfunction RectangleGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._coordinates = undefined;\n  this._coordinatesSubscription = undefined;\n  this._height = undefined;\n  this._heightSubscription = undefined;\n  this._heightReference = undefined;\n  this._heightReferenceSubscription = undefined;\n  this._extrudedHeight = undefined;\n  this._extrudedHeightSubscription = undefined;\n  this._extrudedHeightReference = undefined;\n  this._extrudedHeightReferenceSubscription = undefined;\n  this._rotation = undefined;\n  this._rotationSubscription = undefined;\n  this._stRotation = undefined;\n  this._stRotationSubscription = undefined;\n  this._granularity = undefined;\n  this._granularitySubscription = undefined;\n  this._fill = undefined;\n  this._fillSubscription = undefined;\n  this._material = undefined;\n  this._materialSubscription = undefined;\n  this._outline = undefined;\n  this._outlineSubscription = undefined;\n  this._outlineColor = undefined;\n  this._outlineColorSubscription = undefined;\n  this._outlineWidth = undefined;\n  this._outlineWidthSubscription = undefined;\n  this._shadows = undefined;\n  this._shadowsSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distancedisplayConditionSubscription = undefined;\n  this._classificationType = undefined;\n  this._classificationTypeSubscription = undefined;\n  this._zIndex = undefined;\n  this._zIndexSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(RectangleGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof RectangleGraphics.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the rectangle.\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Rectangle}.\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   */\n  coordinates: createPropertyDescriptor(\"coordinates\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the altitude of the rectangle.\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0.0\n   */\n  height: createPropertyDescriptor(\"height\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link HeightReference}.\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   * @default HeightReference.NONE\n   */\n  heightReference: createPropertyDescriptor(\"heightReference\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the altitude of the rectangle extrusion.\n   * Setting this property creates volume starting at height and ending at this altitude.\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   */\n  extrudedHeight: createPropertyDescriptor(\"extrudedHeight\"),\n\n  /**\n   * Gets or sets the Property specifying the extruded {@link HeightReference}.\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   * @default HeightReference.NONE\n   */\n  extrudedHeightReference: createPropertyDescriptor(\"extrudedHeightReference\"),\n\n  /**\n   * Gets or sets the numeric property specifying the rotation of the rectangle clockwise from north.\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0\n   */\n  rotation: createPropertyDescriptor(\"rotation\"),\n\n  /**\n   * Gets or sets the numeric property specifying the rotation of the rectangle texture counter-clockwise from north.\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   * @default 0\n   */\n  stRotation: createPropertyDescriptor(\"stRotation\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the angular distance between points on the rectangle.\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   * @default {CesiumMath.RADIANS_PER_DEGREE}\n   */\n  granularity: createPropertyDescriptor(\"granularity\"),\n\n  /**\n   * Gets or sets the boolean Property specifying whether the rectangle is filled with the provided material.\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  fill: createPropertyDescriptor(\"fill\"),\n\n  /**\n   * Gets or sets the Property specifying the material used to fill the rectangle.\n   * @memberof RectangleGraphics.prototype\n   * @type {MaterialProperty}\n   * @default Color.WHITE\n   */\n  material: createMaterialPropertyDescriptor(\"material\"),\n\n  /**\n   * Gets or sets the Property specifying whether the rectangle is outlined.\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   * @default false\n   */\n  outline: createPropertyDescriptor(\"outline\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the outline.\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   * @default Color.BLACK\n   */\n  outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the width of the outline.\n   * <p>\n   * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n   * </p>\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n  /**\n   * Get or sets the enum Property specifying whether the rectangle\n   * casts or receives shadows from light sources.\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   * @default ShadowMode.DISABLED\n   */\n  shadows: createPropertyDescriptor(\"shadows\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this rectangle will be displayed.\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n\n  /**\n   * Gets or sets the {@link ClassificationType} Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground.\n   * @memberof RectangleGraphics.prototype\n   * @type {Property|undefined}\n   * @default ClassificationType.BOTH\n   */\n  classificationType: createPropertyDescriptor(\"classificationType\"),\n\n  /**\n   * Gets or sets the zIndex Property specifying the ordering of the rectangle.  Only has an effect if the rectangle is constant and neither height or extrudedHeight are specified.\n   * @memberof RectangleGraphics.prototype\n   * @type {ConstantProperty|undefined}\n   * @default 0\n   */\n  zIndex: createPropertyDescriptor(\"zIndex\"),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {RectangleGraphics} [result] The object onto which to store the result.\n * @returns {RectangleGraphics} The modified result parameter or a new instance if one was not provided.\n */\nRectangleGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new RectangleGraphics(this);\n  }\n  result.show = this.show;\n  result.coordinates = this.coordinates;\n  result.height = this.height;\n  result.heightReference = this.heightReference;\n  result.extrudedHeight = this.extrudedHeight;\n  result.extrudedHeightReference = this.extrudedHeightReference;\n  result.rotation = this.rotation;\n  result.stRotation = this.stRotation;\n  result.granularity = this.granularity;\n  result.fill = this.fill;\n  result.material = this.material;\n  result.outline = this.outline;\n  result.outlineColor = this.outlineColor;\n  result.outlineWidth = this.outlineWidth;\n  result.shadows = this.shadows;\n  result.distanceDisplayCondition = this.distanceDisplayCondition;\n  result.classificationType = this.classificationType;\n  result.zIndex = this.zIndex;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {RectangleGraphics} source The object to be merged into this object.\n */\nRectangleGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.coordinates = defaultValue(this.coordinates, source.coordinates);\n  this.height = defaultValue(this.height, source.height);\n  this.heightReference = defaultValue(\n    this.heightReference,\n    source.heightReference\n  );\n  this.extrudedHeight = defaultValue(\n    this.extrudedHeight,\n    source.extrudedHeight\n  );\n  this.extrudedHeightReference = defaultValue(\n    this.extrudedHeightReference,\n    source.extrudedHeightReference\n  );\n  this.rotation = defaultValue(this.rotation, source.rotation);\n  this.stRotation = defaultValue(this.stRotation, source.stRotation);\n  this.granularity = defaultValue(this.granularity, source.granularity);\n  this.fill = defaultValue(this.fill, source.fill);\n  this.material = defaultValue(this.material, source.material);\n  this.outline = defaultValue(this.outline, source.outline);\n  this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n  this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n  this.shadows = defaultValue(this.shadows, source.shadows);\n  this.distanceDisplayCondition = defaultValue(\n    this.distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n  this.classificationType = defaultValue(\n    this.classificationType,\n    source.classificationType\n  );\n  this.zIndex = defaultValue(this.zIndex, source.zIndex);\n};\nexport default RectangleGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {object} WallGraphics.ConstructorOptions\n *\n * Initialization options for the WallGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the wall.\n * @property {Property | Cartesian3[]} [positions] A Property specifying the array of {@link Cartesian3} positions which define the top of the wall.\n * @property {Property | number[]} [minimumHeights] A Property specifying an array of heights to be used for the bottom of the wall instead of the globe surface.\n * @property {Property | number[]} [maximumHeights] A Property specifying an array of heights to be used for the top of the wall instead of the height of each position.\n * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude point.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the wall is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the wall.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the wall is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the wall casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this wall will be displayed.\n */\n\n/**\n * Describes a two dimensional wall defined as a line strip and optional maximum and minimum heights.\n * The wall conforms to the curvature of the globe and can be placed along the surface or at altitude.\n *\n * @alias WallGraphics\n * @constructor\n *\n * @param {WallGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @see Entity\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Wall.html|Cesium Sandcastle Wall Demo}\n */\nfunction WallGraphics(options) {\n  this._definitionChanged = new Event();\n  this._show = undefined;\n  this._showSubscription = undefined;\n  this._positions = undefined;\n  this._positionsSubscription = undefined;\n  this._minimumHeights = undefined;\n  this._minimumHeightsSubscription = undefined;\n  this._maximumHeights = undefined;\n  this._maximumHeightsSubscription = undefined;\n  this._granularity = undefined;\n  this._granularitySubscription = undefined;\n  this._fill = undefined;\n  this._fillSubscription = undefined;\n  this._material = undefined;\n  this._materialSubscription = undefined;\n  this._outline = undefined;\n  this._outlineSubscription = undefined;\n  this._outlineColor = undefined;\n  this._outlineColorSubscription = undefined;\n  this._outlineWidth = undefined;\n  this._outlineWidthSubscription = undefined;\n  this._shadows = undefined;\n  this._shadowsSubscription = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._distanceDisplayConditionSubscription = undefined;\n\n  this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(WallGraphics.prototype, {\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof WallGraphics.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the boolean Property specifying the visibility of the wall.\n   * @memberof WallGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  show: createPropertyDescriptor(\"show\"),\n\n  /**\n   * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the top of the wall.\n   * @memberof WallGraphics.prototype\n   * @type {Property|undefined}\n   */\n  positions: createPropertyDescriptor(\"positions\"),\n\n  /**\n   * Gets or sets the Property specifying an array of heights to be used for the bottom of the wall instead of the surface of the globe.\n   * If defined, the array must be the same length as {@link Wall#positions}.\n   * @memberof WallGraphics.prototype\n   * @type {Property|undefined}\n   */\n  minimumHeights: createPropertyDescriptor(\"minimumHeights\"),\n\n  /**\n   * Gets or sets the Property specifying an array of heights to be used for the top of the wall instead of the height of each position.\n   * If defined, the array must be the same length as {@link Wall#positions}.\n   * @memberof WallGraphics.prototype\n   * @type {Property|undefined}\n   */\n  maximumHeights: createPropertyDescriptor(\"maximumHeights\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the angular distance between points on the wall.\n   * @memberof WallGraphics.prototype\n   * @type {Property|undefined}\n   * @default {CesiumMath.RADIANS_PER_DEGREE}\n   */\n  granularity: createPropertyDescriptor(\"granularity\"),\n\n  /**\n   * Gets or sets the boolean Property specifying whether the wall is filled with the provided material.\n   * @memberof WallGraphics.prototype\n   * @type {Property|undefined}\n   * @default true\n   */\n  fill: createPropertyDescriptor(\"fill\"),\n\n  /**\n   * Gets or sets the Property specifying the material used to fill the wall.\n   * @memberof WallGraphics.prototype\n   * @type {MaterialProperty}\n   * @default Color.WHITE\n   */\n  material: createMaterialPropertyDescriptor(\"material\"),\n\n  /**\n   * Gets or sets the Property specifying whether the wall is outlined.\n   * @memberof WallGraphics.prototype\n   * @type {Property|undefined}\n   * @default false\n   */\n  outline: createPropertyDescriptor(\"outline\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the outline.\n   * @memberof WallGraphics.prototype\n   * @type {Property|undefined}\n   * @default Color.BLACK\n   */\n  outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the width of the outline.\n   * <p>\n   * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n   * </p>\n   * @memberof WallGraphics.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n  /**\n   * Get or sets the enum Property specifying whether the wall\n   * casts or receives shadows from light sources.\n   * @memberof WallGraphics.prototype\n   * @type {Property|undefined}\n   * @default ShadowMode.DISABLED\n   */\n  shadows: createPropertyDescriptor(\"shadows\"),\n\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this wall will be displayed.\n   * @memberof WallGraphics.prototype\n   * @type {Property|undefined}\n   */\n  distanceDisplayCondition: createPropertyDescriptor(\n    \"distanceDisplayCondition\"\n  ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {WallGraphics} [result] The object onto which to store the result.\n * @returns {WallGraphics} The modified result parameter or a new instance if one was not provided.\n */\nWallGraphics.prototype.clone = function (result) {\n  if (!defined(result)) {\n    return new WallGraphics(this);\n  }\n  result.show = this.show;\n  result.positions = this.positions;\n  result.minimumHeights = this.minimumHeights;\n  result.maximumHeights = this.maximumHeights;\n  result.granularity = this.granularity;\n  result.fill = this.fill;\n  result.material = this.material;\n  result.outline = this.outline;\n  result.outlineColor = this.outlineColor;\n  result.outlineWidth = this.outlineWidth;\n  result.shadows = this.shadows;\n  result.distanceDisplayCondition = this.distanceDisplayCondition;\n  return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {WallGraphics} source The object to be merged into this object.\n */\nWallGraphics.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.show = defaultValue(this.show, source.show);\n  this.positions = defaultValue(this.positions, source.positions);\n  this.minimumHeights = defaultValue(\n    this.minimumHeights,\n    source.minimumHeights\n  );\n  this.maximumHeights = defaultValue(\n    this.maximumHeights,\n    source.maximumHeights\n  );\n  this.granularity = defaultValue(this.granularity, source.granularity);\n  this.fill = defaultValue(this.fill, source.fill);\n  this.material = defaultValue(this.material, source.material);\n  this.outline = defaultValue(this.outline, source.outline);\n  this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n  this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n  this.shadows = defaultValue(this.shadows, source.shadows);\n  this.distanceDisplayCondition = defaultValue(\n    this.distanceDisplayCondition,\n    source.distanceDisplayCondition\n  );\n};\nexport default WallGraphics;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport GroundPolylinePrimitive from \"../Scene/GroundPolylinePrimitive.js\";\nimport GroundPrimitive from \"../Scene/GroundPrimitive.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport BillboardGraphics from \"./BillboardGraphics.js\";\nimport BoxGraphics from \"./BoxGraphics.js\";\nimport ConstantPositionProperty from \"./ConstantPositionProperty.js\";\nimport CorridorGraphics from \"./CorridorGraphics.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport createRawPropertyDescriptor from \"./createRawPropertyDescriptor.js\";\nimport CylinderGraphics from \"./CylinderGraphics.js\";\nimport EllipseGraphics from \"./EllipseGraphics.js\";\nimport EllipsoidGraphics from \"./EllipsoidGraphics.js\";\nimport LabelGraphics from \"./LabelGraphics.js\";\nimport ModelGraphics from \"./ModelGraphics.js\";\nimport Cesium3DTilesetGraphics from \"./Cesium3DTilesetGraphics.js\";\nimport PathGraphics from \"./PathGraphics.js\";\nimport PlaneGraphics from \"./PlaneGraphics.js\";\nimport PointGraphics from \"./PointGraphics.js\";\nimport PolygonGraphics from \"./PolygonGraphics.js\";\nimport PolylineGraphics from \"./PolylineGraphics.js\";\nimport PolylineVolumeGraphics from \"./PolylineVolumeGraphics.js\";\nimport Property from \"./Property.js\";\nimport PropertyBag from \"./PropertyBag.js\";\nimport RectangleGraphics from \"./RectangleGraphics.js\";\nimport WallGraphics from \"./WallGraphics.js\";\n\nconst cartoScratch = new Cartographic();\n\nfunction createConstantPositionProperty(value) {\n  return new ConstantPositionProperty(value);\n}\n\nfunction createPositionPropertyDescriptor(name) {\n  return createPropertyDescriptor(\n    name,\n    undefined,\n    createConstantPositionProperty\n  );\n}\n\nfunction createPropertyTypeDescriptor(name, Type) {\n  return createPropertyDescriptor(name, undefined, function (value) {\n    if (value instanceof Type) {\n      return value;\n    }\n    return new Type(value);\n  });\n}\n\n/**\n * @typedef {object} Entity.ConstructorOptions\n *\n * Initialization options for the Entity constructor\n *\n * @property {string} [id] A unique identifier for this object. If none is provided, a GUID is generated.\n * @property {string} [name] A human readable name to display to users. It does not have to be unique.\n * @property {TimeIntervalCollection} [availability] The availability, if any, associated with this object.\n * @property {boolean} [show] A boolean value indicating if the entity and its children are displayed.\n * @property {Property | string} [description] A string Property specifying an HTML description for this entity.\n * @property {PositionProperty | Cartesian3} [position] A Property specifying the entity position.\n * @property {Property} [orientation] A Property specifying the entity orientation.\n * @property {Property} [viewFrom] A suggested initial offset for viewing this object.\n * @property {Entity} [parent] A parent entity to associate with this entity.\n * @property {BillboardGraphics | BillboardGraphics.ConstructorOptions} [billboard] A billboard to associate with this entity.\n * @property {BoxGraphics | BoxGraphics.ConstructorOptions} [box] A box to associate with this entity.\n * @property {CorridorGraphics | CorridorGraphics.ConstructorOptions} [corridor] A corridor to associate with this entity.\n * @property {CylinderGraphics | CylinderGraphics.ConstructorOptions} [cylinder] A cylinder to associate with this entity.\n * @property {EllipseGraphics | EllipseGraphics.ConstructorOptions} [ellipse] A ellipse to associate with this entity.\n * @property {EllipsoidGraphics | EllipsoidGraphics.ConstructorOptions} [ellipsoid] A ellipsoid to associate with this entity.\n * @property {LabelGraphics | LabelGraphics.ConstructorOptions} [label] A options.label to associate with this entity.\n * @property {ModelGraphics | ModelGraphics.ConstructorOptions} [model] A model to associate with this entity.\n * @property {Cesium3DTilesetGraphics | Cesium3DTilesetGraphics.ConstructorOptions} [tileset] A 3D Tiles tileset to associate with this entity.\n * @property {PathGraphics | PathGraphics.ConstructorOptions} [path] A path to associate with this entity.\n * @property {PlaneGraphics | PlaneGraphics.ConstructorOptions} [plane] A plane to associate with this entity.\n * @property {PointGraphics | PointGraphics.ConstructorOptions} [point] A point to associate with this entity.\n * @property {PolygonGraphics | PolygonGraphics.ConstructorOptions} [polygon] A polygon to associate with this entity.\n * @property {PolylineGraphics | PolylineGraphics.ConstructorOptions} [polyline] A polyline to associate with this entity.\n * @property {PropertyBag | Object<string,*>} [properties] Arbitrary properties to associate with this entity.\n * @property {PolylineVolumeGraphics | PolylineVolumeGraphics.ConstructorOptions} [polylineVolume] A polylineVolume to associate with this entity.\n * @property {RectangleGraphics | RectangleGraphics.ConstructorOptions} [rectangle] A rectangle to associate with this entity.\n * @property {WallGraphics | WallGraphics.ConstructorOptions} [wall] A wall to associate with this entity.\n */\n\n/**\n * Entity instances aggregate multiple forms of visualization into a single high-level object.\n * They can be created manually and added to {@link Viewer#entities} or be produced by\n * data sources, such as {@link CzmlDataSource} and {@link GeoJsonDataSource}.\n * @alias Entity\n * @constructor\n *\n * @param {Entity.ConstructorOptions} [options] Object describing initialization options\n *\n * @see {@link https://cesium.com/learn/cesiumjs-learn/cesiumjs-creating-entities/|Creating Entities}\n */\nfunction Entity(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  let id = options.id;\n  if (!defined(id)) {\n    id = createGuid();\n  }\n\n  this._availability = undefined;\n  this._id = id;\n  this._definitionChanged = new Event();\n  this._name = options.name;\n  this._show = defaultValue(options.show, true);\n  this._parent = undefined;\n  this._propertyNames = [\n    \"billboard\",\n    \"box\",\n    \"corridor\",\n    \"cylinder\",\n    \"description\",\n    \"ellipse\", //\n    \"ellipsoid\",\n    \"label\",\n    \"model\",\n    \"tileset\",\n    \"orientation\",\n    \"path\",\n    \"plane\",\n    \"point\",\n    \"polygon\", //\n    \"polyline\",\n    \"polylineVolume\",\n    \"position\",\n    \"properties\",\n    \"rectangle\",\n    \"viewFrom\",\n    \"wall\",\n  ];\n\n  this._billboard = undefined;\n  this._billboardSubscription = undefined;\n  this._box = undefined;\n  this._boxSubscription = undefined;\n  this._corridor = undefined;\n  this._corridorSubscription = undefined;\n  this._cylinder = undefined;\n  this._cylinderSubscription = undefined;\n  this._description = undefined;\n  this._descriptionSubscription = undefined;\n  this._ellipse = undefined;\n  this._ellipseSubscription = undefined;\n  this._ellipsoid = undefined;\n  this._ellipsoidSubscription = undefined;\n  this._label = undefined;\n  this._labelSubscription = undefined;\n  this._model = undefined;\n  this._modelSubscription = undefined;\n  this._tileset = undefined;\n  this._tilesetSubscription = undefined;\n  this._orientation = undefined;\n  this._orientationSubscription = undefined;\n  this._path = undefined;\n  this._pathSubscription = undefined;\n  this._plane = undefined;\n  this._planeSubscription = undefined;\n  this._point = undefined;\n  this._pointSubscription = undefined;\n  this._polygon = undefined;\n  this._polygonSubscription = undefined;\n  this._polyline = undefined;\n  this._polylineSubscription = undefined;\n  this._polylineVolume = undefined;\n  this._polylineVolumeSubscription = undefined;\n  this._position = undefined;\n  this._positionSubscription = undefined;\n  this._properties = undefined;\n  this._propertiesSubscription = undefined;\n  this._rectangle = undefined;\n  this._rectangleSubscription = undefined;\n  this._viewFrom = undefined;\n  this._viewFromSubscription = undefined;\n  this._wall = undefined;\n  this._wallSubscription = undefined;\n  this._children = [];\n\n  /**\n   * Gets or sets the entity collection that this entity belongs to.\n   * @type {EntityCollection}\n   */\n  this.entityCollection = undefined;\n\n  this.parent = options.parent;\n  this.merge(options);\n}\n\nfunction updateShow(entity, children, isShowing) {\n  const length = children.length;\n  for (let i = 0; i < length; i++) {\n    const child = children[i];\n    const childShow = child._show;\n    const oldValue = !isShowing && childShow;\n    const newValue = isShowing && childShow;\n    if (oldValue !== newValue) {\n      updateShow(child, child._children, isShowing);\n    }\n  }\n  entity._definitionChanged.raiseEvent(\n    entity,\n    \"isShowing\",\n    isShowing,\n    !isShowing\n  );\n}\n\nObject.defineProperties(Entity.prototype, {\n  /**\n   * The availability, if any, associated with this object.\n   * If availability is undefined, it is assumed that this object's\n   * other properties will return valid data for any provided time.\n   * If availability exists, the objects other properties will only\n   * provide valid data if queried within the given interval.\n   * @memberof Entity.prototype\n   * @type {TimeIntervalCollection|undefined}\n   */\n  availability: createRawPropertyDescriptor(\"availability\"),\n  /**\n   * Gets the unique ID associated with this object.\n   * @memberof Entity.prototype\n   * @type {string}\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n  /**\n   * Gets the event that is raised whenever a property or sub-property is changed or modified.\n   * @memberof Entity.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets or sets the name of the object.  The name is intended for end-user\n   * consumption and does not need to be unique.\n   * @memberof Entity.prototype\n   * @type {string|undefined}\n   */\n  name: createRawPropertyDescriptor(\"name\"),\n  /**\n   * Gets or sets whether this entity should be displayed. When set to true,\n   * the entity is only displayed if the parent entity's show property is also true.\n   * @memberof Entity.prototype\n   * @type {boolean}\n   */\n  show: {\n    get: function () {\n      return this._show;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (value === this._show) {\n        return;\n      }\n\n      const wasShowing = this.isShowing;\n      this._show = value;\n      const isShowing = this.isShowing;\n\n      if (wasShowing !== isShowing) {\n        updateShow(this, this._children, isShowing);\n      }\n\n      this._definitionChanged.raiseEvent(this, \"show\", value, !value);\n    },\n  },\n  /**\n   * Gets whether this entity is being displayed, taking into account\n   * the visibility of any ancestor entities.\n   * @memberof Entity.prototype\n   * @type {boolean}\n   */\n  isShowing: {\n    get: function () {\n      return (\n        this._show &&\n        (!defined(this.entityCollection) || this.entityCollection.show) &&\n        (!defined(this._parent) || this._parent.isShowing)\n      );\n    },\n  },\n  /**\n   * Gets or sets the parent object.\n   * @memberof Entity.prototype\n   * @type {Entity|undefined}\n   */\n  parent: {\n    get: function () {\n      return this._parent;\n    },\n    set: function (value) {\n      const oldValue = this._parent;\n\n      if (oldValue === value) {\n        return;\n      }\n\n      const wasShowing = this.isShowing;\n      if (defined(oldValue)) {\n        const index = oldValue._children.indexOf(this);\n        oldValue._children.splice(index, 1);\n      }\n\n      this._parent = value;\n      if (defined(value)) {\n        value._children.push(this);\n      }\n\n      const isShowing = this.isShowing;\n\n      if (wasShowing !== isShowing) {\n        updateShow(this, this._children, isShowing);\n      }\n\n      this._definitionChanged.raiseEvent(this, \"parent\", value, oldValue);\n    },\n  },\n  /**\n   * Gets the names of all properties registered on this instance.\n   * @memberof Entity.prototype\n   * @type {string[]}\n   */\n  propertyNames: {\n    get: function () {\n      return this._propertyNames;\n    },\n  },\n  /**\n   * Gets or sets the billboard.\n   * @memberof Entity.prototype\n   * @type {BillboardGraphics|undefined}\n   */\n  billboard: createPropertyTypeDescriptor(\"billboard\", BillboardGraphics),\n  /**\n   * Gets or sets the box.\n   * @memberof Entity.prototype\n   * @type {BoxGraphics|undefined}\n   */\n  box: createPropertyTypeDescriptor(\"box\", BoxGraphics),\n  /**\n   * Gets or sets the corridor.\n   * @memberof Entity.prototype\n   * @type {CorridorGraphics|undefined}\n   */\n  corridor: createPropertyTypeDescriptor(\"corridor\", CorridorGraphics),\n  /**\n   * Gets or sets the cylinder.\n   * @memberof Entity.prototype\n   * @type {CylinderGraphics|undefined}\n   */\n  cylinder: createPropertyTypeDescriptor(\"cylinder\", CylinderGraphics),\n  /**\n   * Gets or sets the description.\n   * @memberof Entity.prototype\n   * @type {Property|undefined}\n   */\n  description: createPropertyDescriptor(\"description\"),\n  /**\n   * Gets or sets the ellipse.\n   * @memberof Entity.prototype\n   * @type {EllipseGraphics|undefined}\n   */\n  ellipse: createPropertyTypeDescriptor(\"ellipse\", EllipseGraphics),\n  /**\n   * Gets or sets the ellipsoid.\n   * @memberof Entity.prototype\n   * @type {EllipsoidGraphics|undefined}\n   */\n  ellipsoid: createPropertyTypeDescriptor(\"ellipsoid\", EllipsoidGraphics),\n  /**\n   * Gets or sets the label.\n   * @memberof Entity.prototype\n   * @type {LabelGraphics|undefined}\n   */\n  label: createPropertyTypeDescriptor(\"label\", LabelGraphics),\n  /**\n   * Gets or sets the model.\n   * @memberof Entity.prototype\n   * @type {ModelGraphics|undefined}\n   */\n  model: createPropertyTypeDescriptor(\"model\", ModelGraphics),\n  /**\n   * Gets or sets the tileset.\n   * @memberof Entity.prototype\n   * @type {Cesium3DTilesetGraphics|undefined}\n   */\n  tileset: createPropertyTypeDescriptor(\"tileset\", Cesium3DTilesetGraphics),\n  /**\n   * Gets or sets the orientation.\n   * @memberof Entity.prototype\n   * @type {Property|undefined}\n   */\n  orientation: createPropertyDescriptor(\"orientation\"),\n  /**\n   * Gets or sets the path.\n   * @memberof Entity.prototype\n   * @type {PathGraphics|undefined}\n   */\n  path: createPropertyTypeDescriptor(\"path\", PathGraphics),\n  /**\n   * Gets or sets the plane.\n   * @memberof Entity.prototype\n   * @type {PlaneGraphics|undefined}\n   */\n  plane: createPropertyTypeDescriptor(\"plane\", PlaneGraphics),\n  /**\n   * Gets or sets the point graphic.\n   * @memberof Entity.prototype\n   * @type {PointGraphics|undefined}\n   */\n  point: createPropertyTypeDescriptor(\"point\", PointGraphics),\n  /**\n   * Gets or sets the polygon.\n   * @memberof Entity.prototype\n   * @type {PolygonGraphics|undefined}\n   */\n  polygon: createPropertyTypeDescriptor(\"polygon\", PolygonGraphics),\n  /**\n   * Gets or sets the polyline.\n   * @memberof Entity.prototype\n   * @type {PolylineGraphics|undefined}\n   */\n  polyline: createPropertyTypeDescriptor(\"polyline\", PolylineGraphics),\n  /**\n   * Gets or sets the polyline volume.\n   * @memberof Entity.prototype\n   * @type {PolylineVolumeGraphics|undefined}\n   */\n  polylineVolume: createPropertyTypeDescriptor(\n    \"polylineVolume\",\n    PolylineVolumeGraphics\n  ),\n  /**\n   * Gets or sets the bag of arbitrary properties associated with this entity.\n   * @memberof Entity.prototype\n   * @type {PropertyBag|undefined}\n   */\n  properties: createPropertyTypeDescriptor(\"properties\", PropertyBag),\n  /**\n   * Gets or sets the position.\n   * @memberof Entity.prototype\n   * @type {PositionProperty|undefined}\n   */\n  position: createPositionPropertyDescriptor(\"position\"),\n  /**\n   * Gets or sets the rectangle.\n   * @memberof Entity.prototype\n   * @type {RectangleGraphics|undefined}\n   */\n  rectangle: createPropertyTypeDescriptor(\"rectangle\", RectangleGraphics),\n  /**\n   * Gets or sets the suggested initial offset when tracking this object.\n   * The offset is typically defined in the east-north-up reference frame,\n   * but may be another frame depending on the object's velocity.\n   * @memberof Entity.prototype\n   * @type {Property|undefined}\n   */\n  viewFrom: createPropertyDescriptor(\"viewFrom\"),\n  /**\n   * Gets or sets the wall.\n   * @memberof Entity.prototype\n   * @type {WallGraphics|undefined}\n   */\n  wall: createPropertyTypeDescriptor(\"wall\", WallGraphics),\n});\n\n/**\n * Given a time, returns true if this object should have data during that time.\n *\n * @param {JulianDate} time The time to check availability for.\n * @returns {boolean} true if the object should have data during the provided time, false otherwise.\n */\nEntity.prototype.isAvailable = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const availability = this._availability;\n  return !defined(availability) || availability.contains(time);\n};\n\n/**\n * Adds a property to this object.  Once a property is added, it can be\n * observed with {@link Entity#definitionChanged} and composited\n * with {@link CompositeEntityCollection}\n *\n * @param {string} propertyName The name of the property to add.\n *\n * @exception {DeveloperError} \"propertyName\" is a reserved property name.\n * @exception {DeveloperError} \"propertyName\" is already a registered property.\n */\nEntity.prototype.addProperty = function (propertyName) {\n  const propertyNames = this._propertyNames;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(propertyName)) {\n    throw new DeveloperError(\"propertyName is required.\");\n  }\n  if (propertyNames.indexOf(propertyName) !== -1) {\n    throw new DeveloperError(\n      `${propertyName} is already a registered property.`\n    );\n  }\n  if (propertyName in this) {\n    throw new DeveloperError(`${propertyName} is a reserved property name.`);\n  }\n  //>>includeEnd('debug');\n\n  propertyNames.push(propertyName);\n  Object.defineProperty(\n    this,\n    propertyName,\n    createRawPropertyDescriptor(propertyName, true)\n  );\n};\n\n/**\n * Removed a property previously added with addProperty.\n *\n * @param {string} propertyName The name of the property to remove.\n *\n * @exception {DeveloperError} \"propertyName\" is a reserved property name.\n * @exception {DeveloperError} \"propertyName\" is not a registered property.\n */\nEntity.prototype.removeProperty = function (propertyName) {\n  const propertyNames = this._propertyNames;\n  const index = propertyNames.indexOf(propertyName);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(propertyName)) {\n    throw new DeveloperError(\"propertyName is required.\");\n  }\n  if (index === -1) {\n    throw new DeveloperError(`${propertyName} is not a registered property.`);\n  }\n  //>>includeEnd('debug');\n\n  this._propertyNames.splice(index, 1);\n  delete this[propertyName];\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {Entity} source The object to be merged into this object.\n */\nEntity.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  //Name, show, and availability are not Property objects and are currently handled differently.\n  //source.show is intentionally ignored because this.show always has a value.\n  this.name = defaultValue(this.name, source.name);\n  this.availability = defaultValue(this.availability, source.availability);\n\n  const propertyNames = this._propertyNames;\n  const sourcePropertyNames = defined(source._propertyNames)\n    ? source._propertyNames\n    : Object.keys(source);\n  const propertyNamesLength = sourcePropertyNames.length;\n  for (let i = 0; i < propertyNamesLength; i++) {\n    const name = sourcePropertyNames[i];\n\n    //While source is required by the API to be an Entity, we internally call this method from the\n    //constructor with an options object to configure initial custom properties.\n    //So we need to ignore reserved-non-property.\n    if (\n      name === \"parent\" ||\n      name === \"name\" ||\n      name === \"availability\" ||\n      name === \"children\"\n    ) {\n      continue;\n    }\n\n    const targetProperty = this[name];\n    const sourceProperty = source[name];\n\n    //Custom properties that are registered on the source entity must also\n    //get registered on this entity.\n    if (!defined(targetProperty) && propertyNames.indexOf(name) === -1) {\n      this.addProperty(name);\n    }\n\n    if (defined(sourceProperty)) {\n      if (defined(targetProperty)) {\n        if (defined(targetProperty.merge)) {\n          targetProperty.merge(sourceProperty);\n        }\n      } else if (\n        defined(sourceProperty.merge) &&\n        defined(sourceProperty.clone)\n      ) {\n        this[name] = sourceProperty.clone();\n      } else {\n        this[name] = sourceProperty;\n      }\n    }\n  }\n};\n\nconst matrix3Scratch = new Matrix3();\nconst positionScratch = new Cartesian3();\nconst orientationScratch = new Quaternion();\n\n/**\n * Computes the model matrix for the entity's transform at specified time. Returns undefined if position is undefined\n *\n * @param {JulianDate} time The time to retrieve model matrix for.\n * @param {Matrix4} [result] The object onto which to store the result.\n *\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. Result is undefined if position is undefined.\n */\nEntity.prototype.computeModelMatrix = function (time, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"time\", time);\n  //>>includeEnd('debug');\n  const position = Property.getValueOrUndefined(\n    this._position,\n    time,\n    positionScratch\n  );\n  if (!defined(position)) {\n    return undefined;\n  }\n\n  const orientation = Property.getValueOrUndefined(\n    this._orientation,\n    time,\n    orientationScratch\n  );\n  if (!defined(orientation)) {\n    result = Transforms.eastNorthUpToFixedFrame(position, undefined, result);\n  } else {\n    result = Matrix4.fromRotationTranslation(\n      Matrix3.fromQuaternion(orientation, matrix3Scratch),\n      position,\n      result\n    );\n  }\n  return result;\n};\n\n/**\n * @private\n */\nEntity.prototype.computeModelMatrixForHeightReference = function (\n  time,\n  heightReferenceProperty,\n  heightOffset,\n  ellipsoid,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"time\", time);\n  //>>includeEnd('debug');\n  const heightReference = Property.getValueOrDefault(\n    heightReferenceProperty,\n    time,\n    HeightReference.NONE\n  );\n  let position = Property.getValueOrUndefined(\n    this._position,\n    time,\n    positionScratch\n  );\n  if (\n    heightReference === HeightReference.NONE ||\n    !defined(position) ||\n    Cartesian3.equalsEpsilon(position, Cartesian3.ZERO, CesiumMath.EPSILON8)\n  ) {\n    return this.computeModelMatrix(time, result);\n  }\n\n  const carto = ellipsoid.cartesianToCartographic(position, cartoScratch);\n  if (heightReference === HeightReference.CLAMP_TO_GROUND) {\n    carto.height = heightOffset;\n  } else {\n    carto.height += heightOffset;\n  }\n  position = ellipsoid.cartographicToCartesian(carto, position);\n\n  const orientation = Property.getValueOrUndefined(\n    this._orientation,\n    time,\n    orientationScratch\n  );\n  if (!defined(orientation)) {\n    result = Transforms.eastNorthUpToFixedFrame(position, undefined, result);\n  } else {\n    result = Matrix4.fromRotationTranslation(\n      Matrix3.fromQuaternion(orientation, matrix3Scratch),\n      position,\n      result\n    );\n  }\n  return result;\n};\n\n/**\n * Checks if the given Scene supports materials besides Color on Entities draped on terrain or 3D Tiles.\n * If this feature is not supported, Entities with non-color materials but no `height` will\n * instead be rendered as if height is 0.\n *\n * @param {Scene} scene The current scene.\n * @returns {boolean} Whether or not the current scene supports materials for entities on terrain.\n */\nEntity.supportsMaterialsforEntitiesOnTerrain = function (scene) {\n  return GroundPrimitive.supportsMaterials(scene);\n};\n\n/**\n * Checks if the given Scene supports polylines clamped to terrain or 3D Tiles.\n * If this feature is not supported, Entities with PolylineGraphics will be rendered with vertices at\n * the provided heights and using the `arcType` parameter instead of clamped to the ground.\n *\n * @param {Scene} scene The current scene.\n * @returns {boolean} Whether or not the current scene supports polylines on terrain or 3D TIles.\n */\nEntity.supportsPolylinesOnTerrain = function (scene) {\n  return GroundPolylinePrimitive.isSupported(scene);\n};\nexport default Entity;\n", "import Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport Event from \"../Core/Event.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport ClassificationType from \"../Scene/ClassificationType.js\";\nimport ShadowMode from \"../Scene/ShadowMode.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport Entity from \"./Entity.js\";\nimport Property from \"./Property.js\";\n\nconst defaultMaterial = new ColorMaterialProperty(Color.WHITE);\nconst defaultShow = new ConstantProperty(true);\nconst defaultFill = new ConstantProperty(true);\nconst defaultOutline = new ConstantProperty(false);\nconst defaultOutlineColor = new ConstantProperty(Color.BLACK);\nconst defaultShadows = new ConstantProperty(ShadowMode.DISABLED);\nconst defaultDistanceDisplayCondition = new ConstantProperty(\n  new DistanceDisplayCondition()\n);\nconst defaultClassificationType = new ConstantProperty(ClassificationType.BOTH);\n\n/**\n * An abstract class for updating geometry entities.\n * @alias GeometryUpdater\n * @constructor\n *\n * @param {object} options An object with the following properties:\n * @param {Entity} options.entity The entity containing the geometry to be visualized.\n * @param {Scene} options.scene The scene where visualization is taking place.\n * @param {object} options.geometryOptions Options for the geometry\n * @param {string} options.geometryPropertyName The geometry property name\n * @param {string[]} options.observedPropertyNames The entity properties this geometry cares about\n */\nfunction GeometryUpdater(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.entity\", options.entity);\n  Check.defined(\"options.scene\", options.scene);\n  Check.defined(\"options.geometryOptions\", options.geometryOptions);\n  Check.defined(\"options.geometryPropertyName\", options.geometryPropertyName);\n  Check.defined(\"options.observedPropertyNames\", options.observedPropertyNames);\n  //>>includeEnd('debug');\n\n  const entity = options.entity;\n  const geometryPropertyName = options.geometryPropertyName;\n\n  this._entity = entity;\n  this._scene = options.scene;\n  this._fillEnabled = false;\n  this._isClosed = false;\n  this._onTerrain = false;\n  this._dynamic = false;\n  this._outlineEnabled = false;\n  this._geometryChanged = new Event();\n  this._showProperty = undefined;\n  this._materialProperty = undefined;\n  this._showOutlineProperty = undefined;\n  this._outlineColorProperty = undefined;\n  this._outlineWidth = 1.0;\n  this._shadowsProperty = undefined;\n  this._distanceDisplayConditionProperty = undefined;\n  this._classificationTypeProperty = undefined;\n  this._options = options.geometryOptions;\n  this._geometryPropertyName = geometryPropertyName;\n  this._id = `${geometryPropertyName}-${entity.id}`;\n  this._observedPropertyNames = options.observedPropertyNames;\n  this._supportsMaterialsforEntitiesOnTerrain = Entity.supportsMaterialsforEntitiesOnTerrain(\n    options.scene\n  );\n}\n\nObject.defineProperties(GeometryUpdater.prototype, {\n  /**\n   * Gets the unique ID associated with this updater\n   * @memberof GeometryUpdater.prototype\n   * @type {string}\n   * @readonly\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n  /**\n   * Gets the entity associated with this geometry.\n   * @memberof GeometryUpdater.prototype\n   *\n   * @type {Entity}\n   * @readonly\n   */\n  entity: {\n    get: function () {\n      return this._entity;\n    },\n  },\n  /**\n   * Gets a value indicating if the geometry has a fill component.\n   * @memberof GeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  fillEnabled: {\n    get: function () {\n      return this._fillEnabled;\n    },\n  },\n  /**\n   * Gets a value indicating if fill visibility varies with simulation time.\n   * @memberof GeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  hasConstantFill: {\n    get: function () {\n      return (\n        !this._fillEnabled ||\n        (!defined(this._entity.availability) &&\n          Property.isConstant(this._showProperty) &&\n          Property.isConstant(this._fillProperty))\n      );\n    },\n  },\n  /**\n   * Gets the material property used to fill the geometry.\n   * @memberof GeometryUpdater.prototype\n   *\n   * @type {MaterialProperty}\n   * @readonly\n   */\n  fillMaterialProperty: {\n    get: function () {\n      return this._materialProperty;\n    },\n  },\n  /**\n   * Gets a value indicating if the geometry has an outline component.\n   * @memberof GeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  outlineEnabled: {\n    get: function () {\n      return this._outlineEnabled;\n    },\n  },\n  /**\n   * Gets a value indicating if the geometry has an outline component.\n   * @memberof GeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  hasConstantOutline: {\n    get: function () {\n      return (\n        !this._outlineEnabled ||\n        (!defined(this._entity.availability) &&\n          Property.isConstant(this._showProperty) &&\n          Property.isConstant(this._showOutlineProperty))\n      );\n    },\n  },\n  /**\n   * Gets the {@link Color} property for the geometry outline.\n   * @memberof GeometryUpdater.prototype\n   *\n   * @type {Property}\n   * @readonly\n   */\n  outlineColorProperty: {\n    get: function () {\n      return this._outlineColorProperty;\n    },\n  },\n  /**\n   * Gets the constant with of the geometry outline, in pixels.\n   * This value is only valid if isDynamic is false.\n   * @memberof GeometryUpdater.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  outlineWidth: {\n    get: function () {\n      return this._outlineWidth;\n    },\n  },\n  /**\n   * Gets the property specifying whether the geometry\n   * casts or receives shadows from light sources.\n   * @memberof GeometryUpdater.prototype\n   *\n   * @type {Property}\n   * @readonly\n   */\n  shadowsProperty: {\n    get: function () {\n      return this._shadowsProperty;\n    },\n  },\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.\n   * @memberof GeometryUpdater.prototype\n   *\n   * @type {Property}\n   * @readonly\n   */\n  distanceDisplayConditionProperty: {\n    get: function () {\n      return this._distanceDisplayConditionProperty;\n    },\n  },\n  /**\n   * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.\n   * @memberof GeometryUpdater.prototype\n   *\n   * @type {Property}\n   * @readonly\n   */\n  classificationTypeProperty: {\n    get: function () {\n      return this._classificationTypeProperty;\n    },\n  },\n  /**\n   * Gets a value indicating if the geometry is time-varying.\n   * If true, all visualization is delegated to a DynamicGeometryUpdater\n   * returned by GeometryUpdater#createDynamicUpdater.\n   * @memberof GeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isDynamic: {\n    get: function () {\n      return this._dynamic;\n    },\n  },\n  /**\n   * Gets a value indicating if the geometry is closed.\n   * This property is only valid for static geometry.\n   * @memberof GeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isClosed: {\n    get: function () {\n      return this._isClosed;\n    },\n  },\n  /**\n   * Gets a value indicating if the geometry should be drawn on terrain.\n   * @memberof EllipseGeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  onTerrain: {\n    get: function () {\n      return this._onTerrain;\n    },\n  },\n  /**\n   * Gets an event that is raised whenever the public properties\n   * of this updater change.\n   * @memberof GeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  geometryChanged: {\n    get: function () {\n      return this._geometryChanged;\n    },\n  },\n});\n\n/**\n * Checks if the geometry is outlined at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve visibility.\n * @returns {boolean} true if geometry is outlined at the provided time, false otherwise.\n */\nGeometryUpdater.prototype.isOutlineVisible = function (time) {\n  const entity = this._entity;\n  const visible =\n    this._outlineEnabled &&\n    entity.isAvailable(time) &&\n    this._showProperty.getValue(time) &&\n    this._showOutlineProperty.getValue(time);\n  return defaultValue(visible, false);\n};\n\n/**\n * Checks if the geometry is filled at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve visibility.\n * @returns {boolean} true if geometry is filled at the provided time, false otherwise.\n */\nGeometryUpdater.prototype.isFilled = function (time) {\n  const entity = this._entity;\n  const visible =\n    this._fillEnabled &&\n    entity.isAvailable(time) &&\n    this._showProperty.getValue(time) &&\n    this._fillProperty.getValue(time);\n  return defaultValue(visible, false);\n};\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @function\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nGeometryUpdater.prototype.createFillGeometryInstance =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @function\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nGeometryUpdater.prototype.createOutlineGeometryInstance =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n */\nGeometryUpdater.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys and resources used by the object.  Once an object is destroyed, it should not be used.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nGeometryUpdater.prototype.destroy = function () {\n  destroyObject(this);\n};\n/**\n * @param {Entity} entity\n * @param {object} geometry\n * @private\n */\nGeometryUpdater.prototype._isHidden = function (entity, geometry) {\n  const show = geometry.show;\n  return (\n    defined(show) && show.isConstant && !show.getValue(Iso8601.MINIMUM_VALUE)\n  );\n};\n\n/**\n * @param {Entity} entity\n * @param {object} geometry\n * @private\n */\nGeometryUpdater.prototype._isOnTerrain = function (entity, geometry) {\n  return false;\n};\n\n/**\n * @param {GeometryOptions} options\n * @private\n */\nGeometryUpdater.prototype._getIsClosed = function (options) {\n  return true;\n};\n\n/**\n * @param {Entity} entity\n * @param {object} geometry\n * @private\n */\nGeometryUpdater.prototype._isDynamic = DeveloperError.throwInstantiationError;\n\n/**\n * @param {Entity} entity\n * @param {object} geometry\n * @private\n */\nGeometryUpdater.prototype._setStaticOptions =\n  DeveloperError.throwInstantiationError;\n\n/**\n * @param {Entity} entity\n * @param {string} propertyName\n * @param {*} newValue\n * @param {*} oldValue\n * @private\n */\nGeometryUpdater.prototype._onEntityPropertyChanged = function (\n  entity,\n  propertyName,\n  newValue,\n  oldValue\n) {\n  if (this._observedPropertyNames.indexOf(propertyName) === -1) {\n    return;\n  }\n\n  const geometry = this._entity[this._geometryPropertyName];\n\n  if (!defined(geometry)) {\n    if (this._fillEnabled || this._outlineEnabled) {\n      this._fillEnabled = false;\n      this._outlineEnabled = false;\n      this._geometryChanged.raiseEvent(this);\n    }\n    return;\n  }\n\n  const fillProperty = geometry.fill;\n  const fillEnabled =\n    defined(fillProperty) && fillProperty.isConstant\n      ? fillProperty.getValue(Iso8601.MINIMUM_VALUE)\n      : true;\n\n  const outlineProperty = geometry.outline;\n  let outlineEnabled = defined(outlineProperty);\n  if (outlineEnabled && outlineProperty.isConstant) {\n    outlineEnabled = outlineProperty.getValue(Iso8601.MINIMUM_VALUE);\n  }\n\n  if (!fillEnabled && !outlineEnabled) {\n    if (this._fillEnabled || this._outlineEnabled) {\n      this._fillEnabled = false;\n      this._outlineEnabled = false;\n      this._geometryChanged.raiseEvent(this);\n    }\n    return;\n  }\n\n  const show = geometry.show;\n  if (this._isHidden(entity, geometry)) {\n    if (this._fillEnabled || this._outlineEnabled) {\n      this._fillEnabled = false;\n      this._outlineEnabled = false;\n      this._geometryChanged.raiseEvent(this);\n    }\n    return;\n  }\n\n  this._materialProperty = defaultValue(geometry.material, defaultMaterial);\n  this._fillProperty = defaultValue(fillProperty, defaultFill);\n  this._showProperty = defaultValue(show, defaultShow);\n  this._showOutlineProperty = defaultValue(geometry.outline, defaultOutline);\n  this._outlineColorProperty = outlineEnabled\n    ? defaultValue(geometry.outlineColor, defaultOutlineColor)\n    : undefined;\n  this._shadowsProperty = defaultValue(geometry.shadows, defaultShadows);\n  this._distanceDisplayConditionProperty = defaultValue(\n    geometry.distanceDisplayCondition,\n    defaultDistanceDisplayCondition\n  );\n  this._classificationTypeProperty = defaultValue(\n    geometry.classificationType,\n    defaultClassificationType\n  );\n\n  this._fillEnabled = fillEnabled;\n\n  const onTerrain =\n    this._isOnTerrain(entity, geometry) &&\n    (this._supportsMaterialsforEntitiesOnTerrain ||\n      this._materialProperty instanceof ColorMaterialProperty);\n\n  if (outlineEnabled && onTerrain) {\n    oneTimeWarning(oneTimeWarning.geometryOutlines);\n    outlineEnabled = false;\n  }\n\n  this._onTerrain = onTerrain;\n  this._outlineEnabled = outlineEnabled;\n\n  if (this._isDynamic(entity, geometry)) {\n    if (!this._dynamic) {\n      this._dynamic = true;\n      this._geometryChanged.raiseEvent(this);\n    }\n  } else {\n    this._setStaticOptions(entity, geometry);\n    this._isClosed = this._getIsClosed(this._options);\n    const outlineWidth = geometry.outlineWidth;\n    this._outlineWidth = defined(outlineWidth)\n      ? outlineWidth.getValue(Iso8601.MINIMUM_VALUE)\n      : 1.0;\n    this._dynamic = false;\n    this._geometryChanged.raiseEvent(this);\n  }\n};\n\n/**\n * Creates the dynamic updater to be used when GeometryUpdater#isDynamic is true.\n *\n * @param {PrimitiveCollection} primitives The primitive collection to use.\n * @param {PrimitiveCollection} [groundPrimitives] The primitive collection to use for ground primitives.\n *\n * @returns {DynamicGeometryUpdater} The dynamic updater used to update the geometry each frame.\n *\n * @exception {DeveloperError} This instance does not represent dynamic geometry.\n * @private\n */\nGeometryUpdater.prototype.createDynamicUpdater = function (\n  primitives,\n  groundPrimitives\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"primitives\", primitives);\n  Check.defined(\"groundPrimitives\", groundPrimitives);\n\n  if (!this._dynamic) {\n    throw new DeveloperError(\n      \"This instance does not represent dynamic geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  return new this.constructor.DynamicGeometryUpdater(\n    this,\n    primitives,\n    groundPrimitives\n  );\n};\nexport default GeometryUpdater;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\n\n/**\n * A {@link Property} whose value is lazily evaluated by a callback function.\n *\n * @alias CallbackProperty\n * @constructor\n *\n * @param {CallbackProperty.Callback} callback The function to be called when the property is evaluated.\n * @param {boolean} isConstant <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.\n */\nfunction CallbackProperty(callback, isConstant) {\n  this._callback = undefined;\n  this._isConstant = undefined;\n  this._definitionChanged = new Event();\n  this.setCallback(callback, isConstant);\n}\n\nObject.defineProperties(CallbackProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.\n   * @memberof CallbackProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return this._isConstant;\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is changed whenever setCallback is called.\n   * @memberof CallbackProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n});\n\n/**\n * Gets the value of the property.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied or is unsupported.\n */\nCallbackProperty.prototype.getValue = function (time, result) {\n  return this._callback(time, result);\n};\n\n/**\n * Sets the callback to be used.\n *\n * @param {CallbackProperty.Callback} callback The function to be called when the property is evaluated.\n * @param {boolean} isConstant <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.\n */\nCallbackProperty.prototype.setCallback = function (callback, isConstant) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(callback)) {\n    throw new DeveloperError(\"callback is required.\");\n  }\n  if (!defined(isConstant)) {\n    throw new DeveloperError(\"isConstant is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const changed =\n    this._callback !== callback || this._isConstant !== isConstant;\n\n  this._callback = callback;\n  this._isConstant = isConstant;\n\n  if (changed) {\n    this._definitionChanged.raiseEvent(this);\n  }\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCallbackProperty.prototype.equals = function (other) {\n  return (\n    this === other ||\n    (other instanceof CallbackProperty &&\n      this._callback === other._callback &&\n      this._isConstant === other._isConstant)\n  );\n};\n\n/**\n * A function that returns the value of the property.\n * @callback CallbackProperty.Callback\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into. If omitted, the function must create and return a new instance.\n * @returns {object} The modified result parameter, or a new instance if the result parameter was not supplied or is unsupported.\n */\nexport default CallbackProperty;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Event from \"../Core/Event.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport SceneMode from \"../Scene/SceneMode.js\";\nimport Property from \"./Property.js\";\n\nconst scratchPosition = new Cartesian3();\nconst scratchCarto = new Cartographic();\n\n/**\n * @private\n */\nfunction TerrainOffsetProperty(\n  scene,\n  positionProperty,\n  heightReferenceProperty,\n  extrudedHeightReferenceProperty\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"scene\", scene);\n  Check.defined(\"positionProperty\", positionProperty);\n  //>>includeEnd('debug');\n\n  this._scene = scene;\n  this._heightReference = heightReferenceProperty;\n  this._extrudedHeightReference = extrudedHeightReferenceProperty;\n  this._positionProperty = positionProperty;\n\n  this._position = new Cartesian3();\n  this._cartographicPosition = new Cartographic();\n  this._normal = new Cartesian3();\n\n  this._definitionChanged = new Event();\n  this._terrainHeight = 0;\n  this._removeCallbackFunc = undefined;\n  this._removeEventListener = undefined;\n  this._removeModeListener = undefined;\n\n  const that = this;\n  if (defined(scene.globe)) {\n    this._removeEventListener = scene.terrainProviderChanged.addEventListener(\n      function () {\n        that._updateClamping();\n      }\n    );\n    this._removeModeListener = scene.morphComplete.addEventListener(\n      function () {\n        that._updateClamping();\n      }\n    );\n  }\n\n  if (positionProperty.isConstant) {\n    const position = positionProperty.getValue(\n      Iso8601.MINIMUM_VALUE,\n      scratchPosition\n    );\n    if (\n      !defined(position) ||\n      Cartesian3.equals(position, Cartesian3.ZERO) ||\n      !defined(scene.globe)\n    ) {\n      return;\n    }\n    this._position = Cartesian3.clone(position, this._position);\n\n    this._updateClamping();\n\n    this._normal = scene.globe.ellipsoid.geodeticSurfaceNormal(\n      position,\n      this._normal\n    );\n  }\n}\n\nObject.defineProperties(TerrainOffsetProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.\n   * @memberof TerrainOffsetProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return false;\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * @memberof TerrainOffsetProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n});\n\n/**\n * @private\n */\nTerrainOffsetProperty.prototype._updateClamping = function () {\n  if (defined(this._removeCallbackFunc)) {\n    this._removeCallbackFunc();\n  }\n\n  const scene = this._scene;\n  const globe = scene.globe;\n  const position = this._position;\n\n  if (!defined(globe) || Cartesian3.equals(position, Cartesian3.ZERO)) {\n    this._terrainHeight = 0;\n    return;\n  }\n  const ellipsoid = globe.ellipsoid;\n  const surface = globe._surface;\n\n  const that = this;\n  const cartographicPosition = ellipsoid.cartesianToCartographic(\n    position,\n    this._cartographicPosition\n  );\n  const height = globe.getHeight(cartographicPosition);\n  if (defined(height)) {\n    this._terrainHeight = height;\n  } else {\n    this._terrainHeight = 0;\n  }\n\n  function updateFunction(clampedPosition) {\n    if (scene.mode === SceneMode.SCENE3D) {\n      const carto = ellipsoid.cartesianToCartographic(\n        clampedPosition,\n        scratchCarto\n      );\n      that._terrainHeight = carto.height;\n    } else {\n      that._terrainHeight = clampedPosition.x;\n    }\n    that.definitionChanged.raiseEvent();\n  }\n  this._removeCallbackFunc = surface.updateHeight(\n    cartographicPosition,\n    updateFunction\n  );\n};\n\n/**\n * Gets the height relative to the terrain based on the positions.\n *\n * @returns {Cartesian3} The offset\n */\nTerrainOffsetProperty.prototype.getValue = function (time, result) {\n  const heightReference = Property.getValueOrDefault(\n    this._heightReference,\n    time,\n    HeightReference.NONE\n  );\n  const extrudedHeightReference = Property.getValueOrDefault(\n    this._extrudedHeightReference,\n    time,\n    HeightReference.NONE\n  );\n\n  if (\n    heightReference === HeightReference.NONE &&\n    extrudedHeightReference !== HeightReference.RELATIVE_TO_GROUND\n  ) {\n    this._position = Cartesian3.clone(Cartesian3.ZERO, this._position);\n    return Cartesian3.clone(Cartesian3.ZERO, result);\n  }\n\n  if (this._positionProperty.isConstant) {\n    return Cartesian3.multiplyByScalar(\n      this._normal,\n      this._terrainHeight,\n      result\n    );\n  }\n\n  const scene = this._scene;\n  const position = this._positionProperty.getValue(time, scratchPosition);\n  if (\n    !defined(position) ||\n    Cartesian3.equals(position, Cartesian3.ZERO) ||\n    !defined(scene.globe)\n  ) {\n    return Cartesian3.clone(Cartesian3.ZERO, result);\n  }\n\n  if (\n    Cartesian3.equalsEpsilon(this._position, position, CesiumMath.EPSILON10)\n  ) {\n    return Cartesian3.multiplyByScalar(\n      this._normal,\n      this._terrainHeight,\n      result\n    );\n  }\n\n  this._position = Cartesian3.clone(position, this._position);\n\n  this._updateClamping();\n\n  const normal = scene.globe.ellipsoid.geodeticSurfaceNormal(\n    position,\n    this._normal\n  );\n  return Cartesian3.multiplyByScalar(normal, this._terrainHeight, result);\n};\n\nTerrainOffsetProperty.prototype.isDestroyed = function () {\n  return false;\n};\n\nTerrainOffsetProperty.prototype.destroy = function () {\n  if (defined(this._removeEventListener)) {\n    this._removeEventListener();\n  }\n  if (defined(this._removeModeListener)) {\n    this._removeModeListener();\n  }\n  if (defined(this._removeCallbackFunc)) {\n    this._removeCallbackFunc();\n  }\n  return destroyObject(this);\n};\n\n/**\n * A function which creates one or more providers.\n * @callback TerrainOffsetProperty.PositionFunction\n * @param {JulianDate} time The clock time at which to retrieve the position\n * @param {Cartesian3} result The result position\n * @returns {Cartesian3} The position at which to do the terrain height check\n */\nexport default TerrainOffsetProperty;\n", "import defined from \"../Core/defined.js\";\nimport CallbackProperty from \"./CallbackProperty.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport TerrainOffsetProperty from \"./TerrainOffsetProperty.js\";\n\nfunction heightReferenceOnEntityPropertyChanged(\n  entity,\n  propertyName,\n  newValue,\n  oldValue\n) {\n  GeometryUpdater.prototype._onEntityPropertyChanged.call(\n    this,\n    entity,\n    propertyName,\n    newValue,\n    oldValue\n  );\n  if (this._observedPropertyNames.indexOf(propertyName) === -1) {\n    return;\n  }\n\n  const geometry = this._entity[this._geometryPropertyName];\n  if (!defined(geometry)) {\n    return;\n  }\n\n  if (defined(this._terrainOffsetProperty)) {\n    this._terrainOffsetProperty.destroy();\n    this._terrainOffsetProperty = undefined;\n  }\n\n  const heightReferenceProperty = geometry.heightReference;\n\n  if (defined(heightReferenceProperty)) {\n    const centerPosition = new CallbackProperty(\n      this._computeCenter.bind(this),\n      !this._dynamic\n    );\n    this._terrainOffsetProperty = new TerrainOffsetProperty(\n      this._scene,\n      centerPosition,\n      heightReferenceProperty\n    );\n  }\n}\nexport default heightReferenceOnEntityPropertyChanged;\n", "import BoxGeometry from \"../Core/BoxGeometry.js\";\nimport BoxOutlineGeometry from \"../Core/BoxOutlineGeometry.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GeometryOffsetAttribute from \"../Core/GeometryOffsetAttribute.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport heightReferenceOnEntityPropertyChanged from \"./heightReferenceOnEntityPropertyChanged.js\";\nimport Property from \"./Property.js\";\n\nconst defaultOffset = Cartesian3.ZERO;\n\nconst offsetScratch = new Cartesian3();\nconst positionScratch = new Cartesian3();\nconst scratchColor = new Color();\n\nfunction BoxGeometryOptions(entity) {\n  this.id = entity;\n  this.vertexFormat = undefined;\n  this.dimensions = undefined;\n  this.offsetAttribute = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for boxes.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias BoxGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction BoxGeometryUpdater(entity, scene) {\n  GeometryUpdater.call(this, {\n    entity: entity,\n    scene: scene,\n    geometryOptions: new BoxGeometryOptions(entity),\n    geometryPropertyName: \"box\",\n    observedPropertyNames: [\"availability\", \"position\", \"orientation\", \"box\"],\n  });\n\n  this._onEntityPropertyChanged(entity, \"box\", entity.box, undefined);\n}\n\nif (defined(Object.create)) {\n  BoxGeometryUpdater.prototype = Object.create(GeometryUpdater.prototype);\n  BoxGeometryUpdater.prototype.constructor = BoxGeometryUpdater;\n}\n\nObject.defineProperties(BoxGeometryUpdater.prototype, {\n  /**\n   * Gets the terrain offset property\n   * @type {TerrainOffsetProperty}\n   * @memberof BoxGeometryUpdater.prototype\n   * @readonly\n   * @private\n   */\n  terrainOffsetProperty: {\n    get: function () {\n      return this._terrainOffsetProperty;\n    },\n  },\n});\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nBoxGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._fillEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent a filled geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n\n  const show = new ShowGeometryInstanceAttribute(\n    isAvailable &&\n      entity.isShowing &&\n      this._showProperty.getValue(time) &&\n      this._fillProperty.getValue(time)\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n  const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n    distanceDisplayCondition\n  );\n\n  const attributes = {\n    show: show,\n    distanceDisplayCondition: distanceDisplayConditionAttribute,\n    color: undefined,\n    offset: undefined,\n  };\n  if (this._materialProperty instanceof ColorMaterialProperty) {\n    let currentColor;\n    if (\n      defined(this._materialProperty.color) &&\n      (this._materialProperty.color.isConstant || isAvailable)\n    ) {\n      currentColor = this._materialProperty.color.getValue(time, scratchColor);\n    }\n    if (!defined(currentColor)) {\n      currentColor = Color.WHITE;\n    }\n    attributes.color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n  }\n  if (defined(this._options.offsetAttribute)) {\n    attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n      Property.getValueOrDefault(\n        this._terrainOffsetProperty,\n        time,\n        defaultOffset,\n        offsetScratch\n      )\n    );\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: BoxGeometry.fromDimensions(this._options),\n    modelMatrix: entity.computeModelMatrixForHeightReference(\n      time,\n      entity.box.heightReference,\n      this._options.dimensions.z * 0.5,\n      this._scene.mapProjection.ellipsoid\n    ),\n    attributes: attributes,\n  });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nBoxGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._outlineEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent an outlined geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n  const outlineColor = Property.getValueOrDefault(\n    this._outlineColorProperty,\n    time,\n    Color.BLACK,\n    scratchColor\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n\n  const attributes = {\n    show: new ShowGeometryInstanceAttribute(\n      isAvailable &&\n        entity.isShowing &&\n        this._showProperty.getValue(time) &&\n        this._showOutlineProperty.getValue(time)\n    ),\n    color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n    distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n      distanceDisplayCondition\n    ),\n    offset: undefined,\n  };\n  if (defined(this._options.offsetAttribute)) {\n    attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n      Property.getValueOrDefault(\n        this._terrainOffsetProperty,\n        time,\n        defaultOffset,\n        offsetScratch\n      )\n    );\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: BoxOutlineGeometry.fromDimensions(this._options),\n    modelMatrix: entity.computeModelMatrixForHeightReference(\n      time,\n      entity.box.heightReference,\n      this._options.dimensions.z * 0.5,\n      this._scene.mapProjection.ellipsoid\n    ),\n    attributes: attributes,\n  });\n};\n\nBoxGeometryUpdater.prototype._computeCenter = function (time, result) {\n  return Property.getValueOrUndefined(this._entity.position, time, result);\n};\n\nBoxGeometryUpdater.prototype._isHidden = function (entity, box) {\n  return (\n    !defined(box.dimensions) ||\n    !defined(entity.position) ||\n    GeometryUpdater.prototype._isHidden.call(this, entity, box)\n  );\n};\n\nBoxGeometryUpdater.prototype._isDynamic = function (entity, box) {\n  return (\n    !entity.position.isConstant ||\n    !Property.isConstant(entity.orientation) ||\n    !box.dimensions.isConstant ||\n    !Property.isConstant(box.outlineWidth)\n  );\n};\n\nBoxGeometryUpdater.prototype._setStaticOptions = function (entity, box) {\n  const heightReference = Property.getValueOrDefault(\n    box.heightReference,\n    Iso8601.MINIMUM_VALUE,\n    HeightReference.NONE\n  );\n\n  const options = this._options;\n  options.vertexFormat =\n    this._materialProperty instanceof ColorMaterialProperty\n      ? PerInstanceColorAppearance.VERTEX_FORMAT\n      : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n  options.dimensions = box.dimensions.getValue(\n    Iso8601.MINIMUM_VALUE,\n    options.dimensions\n  );\n  options.offsetAttribute =\n    heightReference !== HeightReference.NONE\n      ? GeometryOffsetAttribute.ALL\n      : undefined;\n};\n\nBoxGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged;\n\nBoxGeometryUpdater.DynamicGeometryUpdater = DynamicBoxGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicBoxGeometryUpdater(\n  geometryUpdater,\n  primitives,\n  groundPrimitives\n) {\n  DynamicGeometryUpdater.call(\n    this,\n    geometryUpdater,\n    primitives,\n    groundPrimitives\n  );\n}\n\nif (defined(Object.create)) {\n  DynamicBoxGeometryUpdater.prototype = Object.create(\n    DynamicGeometryUpdater.prototype\n  );\n  DynamicBoxGeometryUpdater.prototype.constructor = DynamicBoxGeometryUpdater;\n}\n\nDynamicBoxGeometryUpdater.prototype._isHidden = function (entity, box, time) {\n  const position = Property.getValueOrUndefined(\n    entity.position,\n    time,\n    positionScratch\n  );\n  const dimensions = this._options.dimensions;\n  return (\n    !defined(position) ||\n    !defined(dimensions) ||\n    DynamicGeometryUpdater.prototype._isHidden.call(this, entity, box, time)\n  );\n};\n\nDynamicBoxGeometryUpdater.prototype._setOptions = function (entity, box, time) {\n  const heightReference = Property.getValueOrDefault(\n    box.heightReference,\n    time,\n    HeightReference.NONE\n  );\n  const options = this._options;\n  options.dimensions = Property.getValueOrUndefined(\n    box.dimensions,\n    time,\n    options.dimensions\n  );\n  options.offsetAttribute =\n    heightReference !== HeightReference.NONE\n      ? GeometryOffsetAttribute.ALL\n      : undefined;\n};\nexport default BoxGeometryUpdater;\n", "import DOMPurify from \"dompurify\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\n\nlet nextCreditId = 0;\nconst creditToId = {};\n\n/**\n * A credit contains data pertaining to how to display attributions/credits for certain content on the screen.\n * @param {string} html An string representing an html code snippet\n * @param {boolean} [showOnScreen=false] If true, the credit will be visible in the main credit container.  Otherwise, it will appear in a popover\n *\n * @alias Credit\n * @constructor\n *\n * @exception {DeveloperError} html is required.\n *\n * @example\n * // Create a credit with a tooltip, image and link\n * const credit = new Cesium.Credit('<a href=\"https://cesium.com/\" target=\"_blank\"><img src=\"/images/cesium_logo.png\" title=\"Cesium\"/></a>');\n */\nfunction Credit(html, showOnScreen) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"html\", html);\n  //>>includeEnd('debug');\n  let id;\n  const key = html;\n\n  if (defined(creditToId[key])) {\n    id = creditToId[key];\n  } else {\n    id = nextCreditId++;\n    creditToId[key] = id;\n  }\n\n  showOnScreen = defaultValue(showOnScreen, false);\n\n  // Credits are immutable so generate an id to use to optimize equal()\n  this._id = id;\n  this._html = html;\n  this._showOnScreen = showOnScreen;\n  this._element = undefined;\n}\n\nObject.defineProperties(Credit.prototype, {\n  /**\n   * The credit content\n   * @memberof Credit.prototype\n   * @type {string}\n   * @readonly\n   */\n  html: {\n    get: function () {\n      return this._html;\n    },\n  },\n\n  /**\n   * @memberof Credit.prototype\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n\n  /**\n   * Whether the credit should be displayed on screen or in a lightbox\n   * @memberof Credit.prototype\n   * @type {boolean}\n   */\n  showOnScreen: {\n    get: function () {\n      return this._showOnScreen;\n    },\n    set: function (value) {\n      this._showOnScreen = value;\n    },\n  },\n\n  /**\n   * Gets the credit element\n   * @memberof Credit.prototype\n   * @type {HTMLElement}\n   * @readonly\n   */\n  element: {\n    get: function () {\n      if (!defined(this._element)) {\n        const html = DOMPurify.sanitize(this._html);\n\n        const div = document.createElement(\"div\");\n        div._creditId = this._id;\n        div.style.display = \"inline\";\n        div.innerHTML = html;\n\n        const links = div.querySelectorAll(\"a\");\n        for (let i = 0; i < links.length; i++) {\n          links[i].setAttribute(\"target\", \"_blank\");\n        }\n\n        this._element = div;\n      }\n      return this._element;\n    },\n  },\n});\n\n/**\n * Returns true if the credits are equal\n *\n * @param {Credit} left The first credit\n * @param {Credit} right The second credit\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCredit.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left._id === right._id &&\n      left._showOnScreen === right._showOnScreen)\n  );\n};\n\n/**\n * Returns true if the credits are equal\n *\n * @param {Credit} credit The credit to compare to.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCredit.prototype.equals = function (credit) {\n  return Credit.equals(this, credit);\n};\n\n/**\n * @private\n */\nCredit.prototype.isIon = function () {\n  return this.html.indexOf(\"ion-credit.png\") !== -1;\n};\n\n/**\n * @private\n * @param attribution\n * @return {Credit}\n */\nCredit.getIonCredit = function (attribution) {\n  const showOnScreen =\n    defined(attribution.collapsible) && !attribution.collapsible;\n  const credit = new Credit(attribution.html, showOnScreen);\n\n  return credit;\n};\n\n/**\n * Duplicates a Credit instance.\n *\n * @param {Credit} [credit] The Credit to duplicate.\n * @returns {Credit} A new Credit instance that is a duplicate of the one provided. (Returns undefined if the credit is undefined)\n */\nCredit.clone = function (credit) {\n  if (defined(credit)) {\n    return new Credit(credit.html, credit.showOnScreen);\n  }\n};\nexport default Credit;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec2 v_textureCoordinates;\\n\\\n\\n\\\nuniform float originalSize;\\n\\\nuniform sampler2D texture0;\\n\\\nuniform sampler2D texture1;\\n\\\nuniform sampler2D texture2;\\n\\\nuniform sampler2D texture3;\\n\\\nuniform sampler2D texture4;\\n\\\nuniform sampler2D texture5;\\n\\\n\\n\\\nconst float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0));\\n\\\nconst float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0));\\n\\\nconst float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0));\\n\\\nconst float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0));\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec2 uv = v_textureCoordinates;\\n\\\n    vec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize);\\n\\\n    vec2 pixel = 1.0 / textureSize;\\n\\\n\\n\\\n    float mipLevel = 0.0;\\n\\\n\\n\\\n    if (uv.x - pixel.x > (textureSize.y / textureSize.x))\\n\\\n    {\\n\\\n        mipLevel = 1.0;\\n\\\n        if (uv.y - pixel.y > yMipLevel1)\\n\\\n        {\\n\\\n            mipLevel = 2.0;\\n\\\n            if (uv.y - pixel.y * 3.0 > yMipLevel2)\\n\\\n            {\\n\\\n                mipLevel = 3.0;\\n\\\n                if (uv.y - pixel.y * 5.0 > yMipLevel3)\\n\\\n                {\\n\\\n                    mipLevel = 4.0;\\n\\\n                    if (uv.y - pixel.y * 7.0 > yMipLevel4)\\n\\\n                    {\\n\\\n                        mipLevel = 5.0;\\n\\\n                    }\\n\\\n                }\\n\\\n            }\\n\\\n        }\\n\\\n    }\\n\\\n\\n\\\n    if (mipLevel > 0.0)\\n\\\n    {\\n\\\n        float scale = pow(2.0, mipLevel);\\n\\\n\\n\\\n        uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0);\\n\\\n        uv.x *= ((textureSize.x - 2.0) / textureSize.y);\\n\\\n\\n\\\n        uv.x -= 1.0 + pixel.x;\\n\\\n        uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0)));\\n\\\n        uv *= scale;\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        uv.x *= (textureSize.x / textureSize.y);\\n\\\n    }\\n\\\n\\n\\\n    if(mipLevel == 0.0)\\n\\\n    {\\n\\\n        out_FragColor = texture(texture0, uv);\\n\\\n    }\\n\\\n    else if(mipLevel == 1.0)\\n\\\n    {\\n\\\n        out_FragColor = texture(texture1, uv);\\n\\\n    }\\n\\\n    else if(mipLevel == 2.0)\\n\\\n    {\\n\\\n        out_FragColor = texture(texture2, uv);\\n\\\n    }\\n\\\n    else if(mipLevel == 3.0)\\n\\\n    {\\n\\\n        out_FragColor = texture(texture3, uv);\\n\\\n    }\\n\\\n    else if(mipLevel == 4.0)\\n\\\n    {\\n\\\n        out_FragColor = texture(texture4, uv);\\n\\\n    }\\n\\\n    else if(mipLevel == 5.0)\\n\\\n    {\\n\\\n        out_FragColor = texture(texture5, uv);\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        out_FragColor = vec4(0.0);\\n\\\n    }\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 v_cubeMapCoordinates;\\n\\\nuniform samplerCube cubeMap;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates);\\n\\\n    #ifdef RGBA_NORMALIZED\\n\\\n        out_FragColor = vec4(rgba.rgb, 1.0);\\n\\\n    #else\\n\\\n        float m = rgba.a * 16.0;\\n\\\n        vec3 r = rgba.rgb * m;\\n\\\n        out_FragColor = vec4(r * r, 1.0);\\n\\\n    #endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec4 position;\\n\\\nin vec3 cubeMapCoordinates;\\n\\\n\\n\\\nout vec3 v_cubeMapCoordinates;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    gl_Position = position;\\n\\\n    v_cubeMapCoordinates = cubeMapCoordinates;\\n\\\n}\\n\\\n\";\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Event from \"../Core/Event.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport loadKTX2 from \"../Core/loadKTX2.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ComputeCommand from \"../Renderer/ComputeCommand.js\";\nimport CubeMap from \"../Renderer/CubeMap.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport OctahedralProjectionAtlasFS from \"../Shaders/OctahedralProjectionAtlasFS.js\";\nimport OctahedralProjectionFS from \"../Shaders/OctahedralProjectionFS.js\";\nimport OctahedralProjectionVS from \"../Shaders/OctahedralProjectionVS.js\";\n\n/**\n * Packs all mip levels of a cube map into a 2D texture atlas.\n *\n * Octahedral projection is a way of putting the cube maps onto a 2D texture\n * with minimal distortion and easy look up.\n * See Chapter 16 of WebGL Insights \"HDR Image-Based Lighting on the Web\" by Jeff Russell\n * and \"Octahedron Environment Maps\" for reference.\n *\n * @private\n */\nfunction OctahedralProjectedCubeMap(url) {\n  this._url = url;\n\n  this._cubeMapBuffers = undefined;\n  this._cubeMaps = undefined;\n  this._texture = undefined;\n  this._mipTextures = undefined;\n  this._va = undefined;\n  this._sp = undefined;\n\n  this._maximumMipmapLevel = undefined;\n\n  this._loading = false;\n  this._ready = false;\n\n  this._errorEvent = new Event();\n}\n\nObject.defineProperties(OctahedralProjectedCubeMap.prototype, {\n  /**\n   * The url to the KTX2 file containing the specular environment map and convoluted mipmaps.\n   * @memberof OctahedralProjectedCubeMap.prototype\n   * @type {string}\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return this._url;\n    },\n  },\n  /**\n   * Gets an event that is raised when encountering an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.\n   * @memberof OctahedralProjectedCubeMap.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n  /**\n   * A texture containing all the packed convolutions.\n   * @memberof OctahedralProjectedCubeMap.prototype\n   * @type {Texture}\n   * @readonly\n   */\n  texture: {\n    get: function () {\n      return this._texture;\n    },\n  },\n  /**\n   * The maximum number of mip levels.\n   * @memberOf OctahedralProjectedCubeMap.prototype\n   * @type {number}\n   * @readonly\n   */\n  maximumMipmapLevel: {\n    get: function () {\n      return this._maximumMipmapLevel;\n    },\n  },\n  /**\n   * Determines if the texture atlas is complete and ready to use.\n   * @memberof OctahedralProjectedCubeMap.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n});\n\nOctahedralProjectedCubeMap.isSupported = function (context) {\n  return (\n    (context.colorBufferHalfFloat && context.halfFloatingPointTexture) ||\n    (context.floatingPointTexture && context.colorBufferFloat)\n  );\n};\n\n// These vertices are based on figure 1 from \"Octahedron Environment Maps\".\nconst v1 = new Cartesian3(1.0, 0.0, 0.0);\nconst v2 = new Cartesian3(0.0, 0.0, 1.0);\nconst v3 = new Cartesian3(-1.0, 0.0, 0.0);\nconst v4 = new Cartesian3(0.0, 0.0, -1.0);\nconst v5 = new Cartesian3(0.0, 1.0, 0.0);\nconst v6 = new Cartesian3(0.0, -1.0, 0.0);\n\n// top left, left, top, center, right, top right, bottom, bottom left, bottom right\nconst cubeMapCoordinates = [v5, v3, v2, v6, v1, v5, v4, v5, v5];\nconst length = cubeMapCoordinates.length;\nconst flatCubeMapCoordinates = new Float32Array(length * 3);\n\nlet offset = 0;\nfor (let i = 0; i < length; ++i, offset += 3) {\n  Cartesian3.pack(cubeMapCoordinates[i], flatCubeMapCoordinates, offset);\n}\n\nconst flatPositions = new Float32Array([\n  -1.0,\n  1.0, // top left\n  -1.0,\n  0.0, // left\n  0.0,\n  1.0, // top\n  0.0,\n  0.0, // center\n  1.0,\n  0.0, // right\n  1.0,\n  1.0, // top right\n  0.0,\n  -1.0, // bottom\n  -1.0,\n  -1.0, // bottom left\n  1.0,\n  -1.0, // bottom right\n]);\nconst indices = new Uint16Array([\n  0,\n  1,\n  2, // top left, left, top,\n  2,\n  3,\n  1, // top, center, left,\n  7,\n  6,\n  1, // bottom left, bottom, left,\n  3,\n  6,\n  1, // center, bottom, left,\n  2,\n  5,\n  4, // top, top right, right,\n  3,\n  4,\n  2, // center, right, top,\n  4,\n  8,\n  6, // right, bottom right, bottom,\n  3,\n  4,\n  6, //center, right, bottom\n]);\n\nfunction createVertexArray(context) {\n  const positionBuffer = Buffer.createVertexBuffer({\n    context: context,\n    typedArray: flatPositions,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n  const cubeMapCoordinatesBuffer = Buffer.createVertexBuffer({\n    context: context,\n    typedArray: flatCubeMapCoordinates,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n  const indexBuffer = Buffer.createIndexBuffer({\n    context: context,\n    typedArray: indices,\n    usage: BufferUsage.STATIC_DRAW,\n    indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n  });\n\n  const attributes = [\n    {\n      index: 0,\n      vertexBuffer: positionBuffer,\n      componentsPerAttribute: 2,\n      componentDatatype: ComponentDatatype.FLOAT,\n    },\n    {\n      index: 1,\n      vertexBuffer: cubeMapCoordinatesBuffer,\n      componentsPerAttribute: 3,\n      componentDatatype: ComponentDatatype.FLOAT,\n    },\n  ];\n  return new VertexArray({\n    context: context,\n    attributes: attributes,\n    indexBuffer: indexBuffer,\n  });\n}\n\nfunction createUniformTexture(texture) {\n  return function () {\n    return texture;\n  };\n}\n\nfunction cleanupResources(map) {\n  map._va = map._va && map._va.destroy();\n  map._sp = map._sp && map._sp.destroy();\n\n  let i;\n  let length;\n\n  const cubeMaps = map._cubeMaps;\n  if (defined(cubeMaps)) {\n    length = cubeMaps.length;\n    for (i = 0; i < length; ++i) {\n      cubeMaps[i].destroy();\n    }\n  }\n  const mipTextures = map._mipTextures;\n  if (defined(mipTextures)) {\n    length = mipTextures.length;\n    for (i = 0; i < length; ++i) {\n      mipTextures[i].destroy();\n    }\n  }\n\n  map._va = undefined;\n  map._sp = undefined;\n  map._cubeMaps = undefined;\n  map._cubeMapBuffers = undefined;\n  map._mipTextures = undefined;\n}\n\n/**\n * Creates compute commands to generate octahedral projections of each cube map\n * and then renders them to an atlas.\n * <p>\n * Only needs to be called twice. The first call queues the compute commands to generate the atlas.\n * The second call cleans up unused resources. Every call afterwards is a no-op.\n * </p>\n *\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nOctahedralProjectedCubeMap.prototype.update = function (frameState) {\n  const context = frameState.context;\n\n  if (!OctahedralProjectedCubeMap.isSupported(context)) {\n    return;\n  }\n\n  if (defined(this._texture) && defined(this._va)) {\n    cleanupResources(this);\n  }\n  if (defined(this._texture)) {\n    return;\n  }\n\n  if (!defined(this._texture) && !this._loading) {\n    const cachedTexture = frameState.context.textureCache.getTexture(this._url);\n    if (defined(cachedTexture)) {\n      cleanupResources(this);\n      this._texture = cachedTexture;\n      this._maximumMipmapLevel = this._texture.maximumMipmapLevel;\n      this._ready = true;\n    }\n  }\n\n  const cubeMapBuffers = this._cubeMapBuffers;\n  if (!defined(cubeMapBuffers) && !this._loading) {\n    const that = this;\n    loadKTX2(this._url)\n      .then(function (buffers) {\n        that._cubeMapBuffers = buffers;\n        that._loading = false;\n      })\n      .catch(function (error) {\n        if (that.isDestroyed()) {\n          return;\n        }\n        that._errorEvent.raiseEvent(error);\n      });\n    this._loading = true;\n  }\n\n  if (!defined(this._cubeMapBuffers)) {\n    return;\n  }\n\n  const defines = [];\n  // Datatype is defined if it is a normalized type (i.e. ..._UNORM, ..._SFLOAT)\n  let pixelDatatype = cubeMapBuffers[0].positiveX.pixelDatatype;\n  if (!defined(pixelDatatype)) {\n    pixelDatatype = context.halfFloatingPointTexture\n      ? PixelDatatype.HALF_FLOAT\n      : PixelDatatype.FLOAT;\n  } else {\n    defines.push(\"RGBA_NORMALIZED\");\n  }\n  const pixelFormat = PixelFormat.RGBA;\n\n  const fs = new ShaderSource({\n    defines: defines,\n    sources: [OctahedralProjectionFS],\n  });\n\n  this._va = createVertexArray(context);\n  this._sp = ShaderProgram.fromCache({\n    context: context,\n    vertexShaderSource: OctahedralProjectionVS,\n    fragmentShaderSource: fs,\n    attributeLocations: {\n      position: 0,\n      cubeMapCoordinates: 1,\n    },\n  });\n\n  // We only need up to 6 mip levels to avoid artifacts.\n  const length = Math.min(cubeMapBuffers.length, 6);\n  this._maximumMipmapLevel = length - 1;\n  const cubeMaps = (this._cubeMaps = new Array(length));\n  const mipTextures = (this._mipTextures = new Array(length));\n  const originalSize = cubeMapBuffers[0].positiveX.width * 2.0;\n  const uniformMap = {\n    originalSize: function () {\n      return originalSize;\n    },\n  };\n\n  // First we project each cubemap onto a flat octahedron, and write that to a texture.\n  for (let i = 0; i < length; ++i) {\n    // Swap +Y/-Y faces since the octahedral projection expects this order.\n    const positiveY = cubeMapBuffers[i].positiveY;\n    cubeMapBuffers[i].positiveY = cubeMapBuffers[i].negativeY;\n    cubeMapBuffers[i].negativeY = positiveY;\n\n    const cubeMap = (cubeMaps[i] = new CubeMap({\n      context: context,\n      source: cubeMapBuffers[i],\n      pixelDatatype: pixelDatatype,\n    }));\n    const size = cubeMaps[i].width * 2;\n\n    const mipTexture = (mipTextures[i] = new Texture({\n      context: context,\n      width: size,\n      height: size,\n      pixelDatatype: pixelDatatype,\n      pixelFormat: pixelFormat,\n    }));\n\n    const command = new ComputeCommand({\n      vertexArray: this._va,\n      shaderProgram: this._sp,\n      uniformMap: {\n        cubeMap: createUniformTexture(cubeMap),\n      },\n      outputTexture: mipTexture,\n      persists: true,\n      owner: this,\n    });\n    frameState.commandList.push(command);\n\n    uniformMap[`texture${i}`] = createUniformTexture(mipTexture);\n  }\n\n  this._texture = new Texture({\n    context: context,\n    width: originalSize * 1.5 + 2.0, // We add a 1 pixel border to avoid linear sampling artifacts.\n    height: originalSize,\n    pixelDatatype: pixelDatatype,\n    pixelFormat: pixelFormat,\n  });\n\n  this._texture.maximumMipmapLevel = this._maximumMipmapLevel;\n  context.textureCache.addTexture(this._url, this._texture);\n\n  const atlasCommand = new ComputeCommand({\n    fragmentShaderSource: OctahedralProjectionAtlasFS,\n    uniformMap: uniformMap,\n    outputTexture: this._texture,\n    persists: false,\n    owner: this,\n  });\n  frameState.commandList.push(atlasCommand);\n\n  this._ready = true;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see OctahedralProjectedCubeMap#destroy\n */\nOctahedralProjectedCubeMap.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see OctahedralProjectedCubeMap#isDestroyed\n */\nOctahedralProjectedCubeMap.prototype.destroy = function () {\n  cleanupResources(this);\n  this._texture = this._texture && this._texture.destroy();\n  return destroyObject(this);\n};\nexport default OctahedralProjectedCubeMap;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport OctahedralProjectedCubeMap from \"./OctahedralProjectedCubeMap.js\";\n\n/**\n * Properties for managing image-based lighting on tilesets and models.\n * Also manages the necessary resources and textures.\n * <p>\n * If specular environment maps are used, {@link ImageBasedLighting#destroy} must be called\n * when the image-based lighting is no longer needed to clean up GPU resources properly.\n * If a model or tileset creates an instance of ImageBasedLighting, it will handle this.\n * Otherwise, the application is responsible for calling destroy().\n *</p>\n *\n * @alias ImageBasedLighting\n * @constructor\n *\n * @param {Cartesian2} [options.imageBasedLightingFactor=Cartesian2(1.0, 1.0)] Scales diffuse and specular image-based lighting from the earth, sky, atmosphere and star skybox.\n * @param {number} [options.luminanceAtZenith=0.2] The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map.\n * @param {Cartesian3[]} [options.sphericalHarmonicCoefficients] The third order spherical harmonic coefficients used for the diffuse color of image-based lighting.\n * @param {string} [options.specularEnvironmentMaps] A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps.\n */\nfunction ImageBasedLighting(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const imageBasedLightingFactor = defined(options.imageBasedLightingFactor)\n    ? Cartesian2.clone(options.imageBasedLightingFactor)\n    : new Cartesian2(1.0, 1.0);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\n    \"options.imageBasedLightingFactor\",\n    imageBasedLightingFactor\n  );\n  Check.typeOf.number.greaterThanOrEquals(\n    \"options.imageBasedLightingFactor.x\",\n    imageBasedLightingFactor.x,\n    0.0\n  );\n  Check.typeOf.number.lessThanOrEquals(\n    \"options.imageBasedLightingFactor.x\",\n    imageBasedLightingFactor.x,\n    1.0\n  );\n  Check.typeOf.number.greaterThanOrEquals(\n    \"options.imageBasedLightingFactor.y\",\n    imageBasedLightingFactor.y,\n    0.0\n  );\n  Check.typeOf.number.lessThanOrEquals(\n    \"options.imageBasedLightingFactor.y\",\n    imageBasedLightingFactor.y,\n    1.0\n  );\n  //>>includeEnd('debug');\n\n  this._imageBasedLightingFactor = imageBasedLightingFactor;\n\n  const luminanceAtZenith = defaultValue(options.luminanceAtZenith, 0.2);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"options.luminanceAtZenith\", luminanceAtZenith);\n  //>>includeEnd('debug');\n\n  this._luminanceAtZenith = luminanceAtZenith;\n\n  const sphericalHarmonicCoefficients = options.sphericalHarmonicCoefficients;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    defined(sphericalHarmonicCoefficients) &&\n    (!Array.isArray(sphericalHarmonicCoefficients) ||\n      sphericalHarmonicCoefficients.length !== 9)\n  ) {\n    throw new DeveloperError(\n      \"options.sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.\"\n    );\n  }\n  //>>includeEnd('debug');\n  this._sphericalHarmonicCoefficients = sphericalHarmonicCoefficients;\n\n  // The specular environment map texture is created in update();\n  this._specularEnvironmentMaps = options.specularEnvironmentMaps;\n  this._specularEnvironmentMapAtlas = undefined;\n  this._specularEnvironmentMapAtlasDirty = true;\n  this._specularEnvironmentMapLoaded = false;\n  this._previousSpecularEnvironmentMapLoaded = false;\n\n  this._useDefaultSpecularMaps = false;\n  this._useDefaultSphericalHarmonics = false;\n  this._shouldRegenerateShaders = false;\n\n  // Store the previous frame number to prevent redundant update calls\n  this._previousFrameNumber = undefined;\n\n  // Keeps track of the last values for use during update logic\n  this._previousImageBasedLightingFactor = Cartesian2.clone(\n    imageBasedLightingFactor\n  );\n  this._previousLuminanceAtZenith = luminanceAtZenith;\n  this._previousSphericalHarmonicCoefficients = sphericalHarmonicCoefficients;\n  this._removeErrorListener = undefined;\n}\n\nObject.defineProperties(ImageBasedLighting.prototype, {\n  /**\n   * Cesium adds lighting from the earth, sky, atmosphere, and star skybox.\n   * This cartesian is used to scale the final diffuse and specular lighting\n   * contribution from those sources to the final color. A value of 0.0 will\n   * disable those light sources.\n   *\n   * @memberof ImageBasedLighting.prototype\n   *\n   * @type {Cartesian2}\n   * @default Cartesian2(1.0, 1.0)\n   */\n  imageBasedLightingFactor: {\n    get: function () {\n      return this._imageBasedLightingFactor;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.object(\"imageBasedLightingFactor\", value);\n      Check.typeOf.number.greaterThanOrEquals(\n        \"imageBasedLightingFactor.x\",\n        value.x,\n        0.0\n      );\n      Check.typeOf.number.lessThanOrEquals(\n        \"imageBasedLightingFactor.x\",\n        value.x,\n        1.0\n      );\n      Check.typeOf.number.greaterThanOrEquals(\n        \"imageBasedLightingFactor.y\",\n        value.y,\n        0.0\n      );\n      Check.typeOf.number.lessThanOrEquals(\n        \"imageBasedLightingFactor.y\",\n        value.y,\n        1.0\n      );\n      //>>includeEnd('debug');\n      this._previousImageBasedLightingFactor = Cartesian2.clone(\n        this._imageBasedLightingFactor,\n        this._previousImageBasedLightingFactor\n      );\n      this._imageBasedLightingFactor = Cartesian2.clone(\n        value,\n        this._imageBasedLightingFactor\n      );\n    },\n  },\n\n  /**\n   * The sun's luminance at the zenith in kilo candela per meter squared\n   * to use for this model's procedural environment map. This is used when\n   * {@link ImageBasedLighting#specularEnvironmentMaps} and {@link ImageBasedLighting#sphericalHarmonicCoefficients}\n   * are not defined.\n   *\n   * @memberof ImageBasedLighting.prototype\n   *\n   * @type {number}\n   * @default 0.2\n   */\n  luminanceAtZenith: {\n    get: function () {\n      return this._luminanceAtZenith;\n    },\n    set: function (value) {\n      this._previousLuminanceAtZenith = this._luminanceAtZenith;\n      this._luminanceAtZenith = value;\n    },\n  },\n\n  /**\n   * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When <code>undefined</code>, a diffuse irradiance\n   * computed from the atmosphere color is used.\n   * <p>\n   * There are nine <code>Cartesian3</code> coefficients.\n   * The order of the coefficients is: L<sub>0,0</sub>, L<sub>1,-1</sub>, L<sub>1,0</sub>, L<sub>1,1</sub>, L<sub>2,-2</sub>, L<sub>2,-1</sub>, L<sub>2,0</sub>, L<sub>2,1</sub>, L<sub>2,2</sub>\n   * </p>\n   *\n   * These values can be obtained by preprocessing the environment map using the <code>cmgen</code> tool of\n   * {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be\n   * supplied to {@link Model#specularEnvironmentMaps}.\n   *\n   * @memberof ImageBasedLighting.prototype\n   *\n   * @type {Cartesian3[]}\n   * @demo {@link https://sandcastle.cesium.com/index.html?src=Image-Based Lighting.html|Sandcastle Image Based Lighting Demo}\n   * @see {@link https://graphics.stanford.edu/papers/envmap/envmap.pdf|An Efficient Representation for Irradiance Environment Maps}\n   */\n  sphericalHarmonicCoefficients: {\n    get: function () {\n      return this._sphericalHarmonicCoefficients;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value) && (!Array.isArray(value) || value.length !== 9)) {\n        throw new DeveloperError(\n          \"sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.\"\n        );\n      }\n      //>>includeEnd('debug');\n      this._previousSphericalHarmonicCoefficients = this._sphericalHarmonicCoefficients;\n      this._sphericalHarmonicCoefficients = value;\n    },\n  },\n\n  /**\n   * A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps.\n   *\n   * @memberof ImageBasedLighting.prototype\n   * @demo {@link https://sandcastle.cesium.com/index.html?src=Image-Based Lighting.html|Sandcastle Image Based Lighting Demo}\n   * @type {string}\n   * @see ImageBasedLighting#sphericalHarmonicCoefficients\n   */\n  specularEnvironmentMaps: {\n    get: function () {\n      return this._specularEnvironmentMaps;\n    },\n    set: function (value) {\n      if (value !== this._specularEnvironmentMaps) {\n        this._specularEnvironmentMapAtlasDirty =\n          this._specularEnvironmentMapAtlasDirty ||\n          value !== this._specularEnvironmentMaps;\n        this._specularEnvironmentMapLoaded = false;\n      }\n      this._specularEnvironmentMaps = value;\n    },\n  },\n\n  /**\n   * Whether or not image-based lighting is enabled.\n   *\n   * @memberof ImageBasedLighting.prototype\n   * @type {boolean}\n   *\n   * @private\n   */\n  enabled: {\n    get: function () {\n      return (\n        this._imageBasedLightingFactor.x > 0.0 ||\n        this._imageBasedLightingFactor.y > 0.0\n      );\n    },\n  },\n\n  /**\n   * Whether or not the models that use this lighting should regenerate their shaders,\n   * based on the properties and resources have changed.\n   *\n   * @memberof ImageBasedLighting.prototype\n   * @type {boolean}\n   *\n   * @private\n   */\n  shouldRegenerateShaders: {\n    get: function () {\n      return this._shouldRegenerateShaders;\n    },\n  },\n\n  /**\n   * Whether or not to use the default spherical harmonic coefficients.\n   *\n   * @memberof ImageBasedLighting.prototype\n   * @type {boolean}\n   *\n   * @private\n   */\n  useDefaultSphericalHarmonics: {\n    get: function () {\n      return this._useDefaultSphericalHarmonics;\n    },\n  },\n\n  /**\n   * Whether or not the image-based lighting settings use spherical harmonic coefficients.\n   *\n   * @memberof ImageBasedLighting.prototype\n   * @type {boolean}\n   *\n   * @private\n   */\n  useSphericalHarmonicCoefficients: {\n    get: function () {\n      return (\n        defined(this._sphericalHarmonicCoefficients) ||\n        this._useDefaultSphericalHarmonics\n      );\n    },\n  },\n\n  /**\n   * The texture atlas for the specular environment maps.\n   *\n   * @memberof ImageBasedLighting.prototype\n   * @type {OctahedralProjectedCubeMap}\n   *\n   * @private\n   */\n  specularEnvironmentMapAtlas: {\n    get: function () {\n      return this._specularEnvironmentMapAtlas;\n    },\n  },\n\n  /**\n   * Whether or not to use the default specular environment maps.\n   *\n   * @memberof ImageBasedLighting.prototype\n   * @type {boolean}\n   *\n   * @private\n   */\n  useDefaultSpecularMaps: {\n    get: function () {\n      return this._useDefaultSpecularMaps;\n    },\n  },\n\n  /**\n   * Whether or not the image-based lighting settings use specular environment maps.\n   *\n   * @memberof ImageBasedLighting.prototype\n   * @type {boolean}\n   *\n   * @private\n   */\n  useSpecularEnvironmentMaps: {\n    get: function () {\n      return (\n        (defined(this._specularEnvironmentMapAtlas) &&\n          this._specularEnvironmentMapAtlas.ready) ||\n        this._useDefaultSpecularMaps\n      );\n    },\n  },\n});\n\nfunction createSpecularEnvironmentMapAtlas(imageBasedLighting, context) {\n  if (!OctahedralProjectedCubeMap.isSupported(context)) {\n    return;\n  }\n\n  imageBasedLighting._specularEnvironmentMapAtlas =\n    imageBasedLighting._specularEnvironmentMapAtlas &&\n    imageBasedLighting._specularEnvironmentMapAtlas.destroy();\n\n  if (defined(imageBasedLighting._specularEnvironmentMaps)) {\n    const atlas = new OctahedralProjectedCubeMap(\n      imageBasedLighting._specularEnvironmentMaps\n    );\n    imageBasedLighting._specularEnvironmentMapAtlas = atlas;\n\n    imageBasedLighting._removeErrorListener = atlas.errorEvent.addEventListener(\n      (error) => {\n        console.error(`Error loading specularEnvironmentMaps: ${error}`);\n      }\n    );\n  }\n\n  // Regenerate shaders so they do not use an environment map.\n  // Will be set to true again if there was a new environment map and it is ready.\n  imageBasedLighting._shouldRegenerateShaders = true;\n}\n\nImageBasedLighting.prototype.update = function (frameState) {\n  if (frameState.frameNumber === this._previousFrameNumber) {\n    return;\n  }\n\n  this._previousFrameNumber = frameState.frameNumber;\n  const context = frameState.context;\n\n  frameState.brdfLutGenerator.update(frameState);\n  this._shouldRegenerateShaders = false;\n\n  const iblFactor = this._imageBasedLightingFactor;\n  const previousIBLFactor = this._previousImageBasedLightingFactor;\n  if (!Cartesian2.equals(iblFactor, previousIBLFactor)) {\n    this._shouldRegenerateShaders =\n      (iblFactor.x > 0.0 && previousIBLFactor.x === 0.0) ||\n      (iblFactor.x === 0.0 && previousIBLFactor.x > 0.0);\n    this._shouldRegenerateShaders =\n      this._shouldRegenerateShaders ||\n      (iblFactor.y > 0.0 && previousIBLFactor.y === 0.0) ||\n      (iblFactor.y === 0.0 && previousIBLFactor.y > 0.0);\n\n    this._previousImageBasedLightingFactor = Cartesian2.clone(\n      this._imageBasedLightingFactor,\n      this._previousImageBasedLightingFactor\n    );\n  }\n\n  if (this._luminanceAtZenith !== this._previousLuminanceAtZenith) {\n    this._shouldRegenerateShaders =\n      this._shouldRegenerateShaders ||\n      defined(this._luminanceAtZenith) !==\n        defined(this._previousLuminanceAtZenith);\n\n    this._previousLuminanceAtZenith = this._luminanceAtZenith;\n  }\n\n  if (\n    this._previousSphericalHarmonicCoefficients !==\n    this._sphericalHarmonicCoefficients\n  ) {\n    this._shouldRegenerateShaders =\n      this._shouldRegenerateShaders ||\n      defined(this._previousSphericalHarmonicCoefficients) !==\n        defined(this._sphericalHarmonicCoefficients);\n\n    this._previousSphericalHarmonicCoefficients = this._sphericalHarmonicCoefficients;\n  }\n\n  this._shouldRegenerateShaders =\n    this._shouldRegenerateShaders ||\n    this._previousSpecularEnvironmentMapLoaded !==\n      this._specularEnvironmentMapLoaded;\n\n  this._previousSpecularEnvironmentMapLoaded = this._specularEnvironmentMapLoaded;\n\n  if (this._specularEnvironmentMapAtlasDirty) {\n    createSpecularEnvironmentMapAtlas(this, context);\n    this._specularEnvironmentMapAtlasDirty = false;\n  }\n\n  if (defined(this._specularEnvironmentMapAtlas)) {\n    this._specularEnvironmentMapAtlas.update(frameState);\n    if (this._specularEnvironmentMapAtlas.ready) {\n      this._specularEnvironmentMapLoaded = true;\n    }\n  }\n\n  const recompileWithDefaultAtlas =\n    !defined(this._specularEnvironmentMapAtlas) &&\n    defined(frameState.specularEnvironmentMaps) &&\n    !this._useDefaultSpecularMaps;\n  const recompileWithoutDefaultAtlas =\n    !defined(frameState.specularEnvironmentMaps) &&\n    this._useDefaultSpecularMaps;\n\n  const recompileWithDefaultSHCoeffs =\n    !defined(this._sphericalHarmonicCoefficients) &&\n    defined(frameState.sphericalHarmonicCoefficients) &&\n    !this._useDefaultSphericalHarmonics;\n  const recompileWithoutDefaultSHCoeffs =\n    !defined(frameState.sphericalHarmonicCoefficients) &&\n    this._useDefaultSphericalHarmonics;\n\n  this._shouldRegenerateShaders =\n    this._shouldRegenerateShaders ||\n    recompileWithDefaultAtlas ||\n    recompileWithoutDefaultAtlas ||\n    recompileWithDefaultSHCoeffs ||\n    recompileWithoutDefaultSHCoeffs;\n\n  this._useDefaultSpecularMaps =\n    !defined(this._specularEnvironmentMapAtlas) &&\n    defined(frameState.specularEnvironmentMaps);\n  this._useDefaultSphericalHarmonics =\n    !defined(this._sphericalHarmonicCoefficients) &&\n    defined(frameState.sphericalHarmonicCoefficients);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see ImageBasedLighting#destroy\n * @private\n */\nImageBasedLighting.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * imageBasedLighting = imageBasedLighting && imageBasedLighting.destroy();\n *\n * @see ImageBasedLighting#isDestroyed\n * @private\n */\nImageBasedLighting.prototype.destroy = function () {\n  this._specularEnvironmentMapAtlas =\n    this._specularEnvironmentMapAtlas &&\n    this._specularEnvironmentMapAtlas.destroy();\n  this._removeErrorListener =\n    this._removeErrorListener && this._removeErrorListener();\n  return destroyObject(this);\n};\n\nexport default ImageBasedLighting;\n", "import Uri from \"urijs\";\nimport Check from \"./Check.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ion from \"./Ion.js\";\nimport Resource from \"./Resource.js\";\nimport RuntimeError from \"./RuntimeError.js\";\n\n/**\n * A {@link Resource} instance that encapsulates Cesium ion asset access.\n * This object is normally not instantiated directly, use {@link IonResource.fromAssetId}.\n *\n * @alias IonResource\n * @constructor\n * @augments Resource\n *\n * @param {object} endpoint The result of the Cesium ion asset endpoint service.\n * @param {Resource} endpointResource The resource used to retrieve the endpoint.\n *\n * @see Ion\n * @see IonImageryProvider\n * @see createWorldTerrain\n * @see https://cesium.com\n */\nfunction IonResource(endpoint, endpointResource) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"endpoint\", endpoint);\n  Check.defined(\"endpointResource\", endpointResource);\n  //>>includeEnd('debug');\n\n  let options;\n  const externalType = endpoint.externalType;\n  const isExternal = defined(externalType);\n\n  if (!isExternal) {\n    options = {\n      url: endpoint.url,\n      retryAttempts: 1,\n      retryCallback: retryCallback,\n    };\n  } else if (\n    externalType === \"3DTILES\" ||\n    externalType === \"STK_TERRAIN_SERVER\"\n  ) {\n    // 3D Tiles and STK Terrain Server external assets can still be represented as an IonResource\n    options = { url: endpoint.options.url };\n  } else {\n    //External imagery assets have additional configuration that can't be represented as a Resource\n    throw new RuntimeError(\n      \"Ion.createResource does not support external imagery assets; use IonImageryProvider instead.\"\n    );\n  }\n\n  Resource.call(this, options);\n\n  // The asset endpoint data returned from ion.\n  this._ionEndpoint = endpoint;\n  this._ionEndpointDomain = isExternal\n    ? undefined\n    : new Uri(endpoint.url).authority();\n\n  // The endpoint resource to fetch when a new token is needed\n  this._ionEndpointResource = endpointResource;\n\n  // The primary IonResource from which an instance is derived\n  this._ionRoot = undefined;\n\n  // Shared promise for endpooint requests amd credits (only ever set on the root request)\n  this._pendingPromise = undefined;\n  this._credits = undefined;\n  this._isExternal = isExternal;\n}\n\nif (defined(Object.create)) {\n  IonResource.prototype = Object.create(Resource.prototype);\n  IonResource.prototype.constructor = IonResource;\n}\n\n/**\n * Asynchronously creates an instance.\n *\n * @param {number} assetId The Cesium ion asset id.\n * @param {object} [options] An object with the following properties:\n * @param {string} [options.accessToken=Ion.defaultAccessToken] The access token to use.\n * @param {string|Resource} [options.server=Ion.defaultServer] The resource to the Cesium ion API server.\n * @returns {Promise<IonResource>} A Promise to am instance representing the Cesium ion Asset.\n *\n * @example\n * // Load a Cesium3DTileset with asset ID of 124624234\n * try {\n *   const resource = await Cesium.IonResource.fromAssetId(124624234);\n *   const tileset = await Cesium.Cesium3DTileset.fromUrl(resource);\n *   scene.primitives.add(tileset);\n * } catch (error) {\n *   console.error(`Error creating tileset: ${error}`);\n * }\n *\n * @example\n * //Load a CZML file with asset ID of 10890\n * Cesium.IonResource.fromAssetId(10890)\n *   .then(function (resource) {\n *     viewer.dataSources.add(Cesium.CzmlDataSource.load(resource));\n *   });\n */\nIonResource.fromAssetId = function (assetId, options) {\n  const endpointResource = IonResource._createEndpointResource(\n    assetId,\n    options\n  );\n\n  return endpointResource.fetchJson().then(function (endpoint) {\n    return new IonResource(endpoint, endpointResource);\n  });\n};\n\nObject.defineProperties(IonResource.prototype, {\n  /**\n   * Gets the credits required for attribution of the asset.\n   *\n   * @memberof IonResource.prototype\n   * @type {Credit[]}\n   * @readonly\n   */\n  credits: {\n    get: function () {\n      // Only we're not the root, return its credits;\n      if (defined(this._ionRoot)) {\n        return this._ionRoot.credits;\n      }\n\n      // We are the root\n      if (defined(this._credits)) {\n        return this._credits;\n      }\n\n      this._credits = IonResource.getCreditsFromEndpoint(\n        this._ionEndpoint,\n        this._ionEndpointResource\n      );\n\n      return this._credits;\n    },\n  },\n});\n\n/** @private */\nIonResource.getCreditsFromEndpoint = function (endpoint, endpointResource) {\n  const credits = endpoint.attributions.map(Credit.getIonCredit);\n  const defaultTokenCredit = Ion.getDefaultTokenCredit(\n    endpointResource.queryParameters.access_token\n  );\n  if (defined(defaultTokenCredit)) {\n    credits.push(Credit.clone(defaultTokenCredit));\n  }\n  return credits;\n};\n\n/** @inheritdoc */\nIonResource.prototype.clone = function (result) {\n  // We always want to use the root's information because it's the most up-to-date\n  const ionRoot = defaultValue(this._ionRoot, this);\n\n  if (!defined(result)) {\n    result = new IonResource(\n      ionRoot._ionEndpoint,\n      ionRoot._ionEndpointResource\n    );\n  }\n\n  result = Resource.prototype.clone.call(this, result);\n  result._ionRoot = ionRoot;\n  result._isExternal = this._isExternal;\n\n  return result;\n};\n\nIonResource.prototype.fetchImage = function (options) {\n  if (!this._isExternal) {\n    const userOptions = options;\n    options = {\n      preferBlob: true,\n    };\n    if (defined(userOptions)) {\n      options.flipY = userOptions.flipY;\n      options.preferImageBitmap = userOptions.preferImageBitmap;\n    }\n  }\n\n  return Resource.prototype.fetchImage.call(this, options);\n};\n\nIonResource.prototype._makeRequest = function (options) {\n  // Don't send ion access token to non-ion servers.\n  if (\n    this._isExternal ||\n    new Uri(this.url).authority() !== this._ionEndpointDomain\n  ) {\n    return Resource.prototype._makeRequest.call(this, options);\n  }\n\n  if (!defined(options.headers)) {\n    options.headers = {};\n  }\n  options.headers.Authorization = `Bearer ${this._ionEndpoint.accessToken}`;\n  options.headers[\"X-Cesium-Client\"] = \"CesiumJS\";\n  /* global CESIUM_VERSION */\n  if (typeof CESIUM_VERSION !== \"undefined\") {\n    options.headers[\"X-Cesium-Client-Version\"] = CESIUM_VERSION;\n  }\n\n  return Resource.prototype._makeRequest.call(this, options);\n};\n\n/**\n * @private\n */\nIonResource._createEndpointResource = function (assetId, options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"assetId\", assetId);\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  let server = defaultValue(options.server, Ion.defaultServer);\n  const accessToken = defaultValue(options.accessToken, Ion.defaultAccessToken);\n  server = Resource.createIfNeeded(server);\n\n  const resourceOptions = {\n    url: `v1/assets/${assetId}/endpoint`,\n  };\n\n  if (defined(accessToken)) {\n    resourceOptions.queryParameters = { access_token: accessToken };\n  }\n\n  return server.getDerivedResource(resourceOptions);\n};\n\nfunction retryCallback(that, error) {\n  const ionRoot = defaultValue(that._ionRoot, that);\n  const endpointResource = ionRoot._ionEndpointResource;\n\n  // Image is not available in worker threads, so this avoids\n  // a ReferenceError\n  const imageDefined = typeof Image !== \"undefined\";\n\n  // We only want to retry in the case of invalid credentials (401) or image\n  // requests(since Image failures can not provide a status code)\n  if (\n    !defined(error) ||\n    (error.statusCode !== 401 &&\n      !(imageDefined && error.target instanceof Image))\n  ) {\n    return Promise.resolve(false);\n  }\n\n  // We use a shared pending promise for all derived assets, since they share\n  // a common access_token.  If we're already requesting a new token for this\n  // asset, we wait on the same promise.\n  if (!defined(ionRoot._pendingPromise)) {\n    ionRoot._pendingPromise = endpointResource\n      .fetchJson()\n      .then(function (newEndpoint) {\n        //Set the token for root resource so new derived resources automatically pick it up\n        ionRoot._ionEndpoint = newEndpoint;\n        return newEndpoint;\n      })\n      .finally(function (newEndpoint) {\n        // Pass or fail, we're done with this promise, the next failure should use a new one.\n        ionRoot._pendingPromise = undefined;\n        return newEndpoint;\n      });\n  }\n\n  return ionRoot._pendingPromise.then(function (newEndpoint) {\n    // Set the new token and endpoint for this resource\n    that._ionEndpoint = newEndpoint;\n    return true;\n  });\n}\nexport default IonResource;\n", "import Credit from \"./Credit.js\";\nimport defined from \"./defined.js\";\nimport Resource from \"./Resource.js\";\n\nlet defaultTokenCredit;\nconst defaultAccessToken =\n  \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkNzEwOTRhMi05YmYyLTQyY2EtYTU2My04YTM1MWE2YjhjNjAiLCJpZCI6MjU5LCJpYXQiOjE3MDQyMTcxMzh9.rE7KTaFyZydhuP1Z7ohzClO3J1tMOvaHODzt3_5jo7s\";\n/**\n * Default settings for accessing the Cesium ion API.\n *\n * An ion access token is only required if you are using any ion related APIs.\n * A default access token is provided for evaluation purposes only.\n * Sign up for a free ion account and get your own access token at {@link https://cesium.com}\n *\n * @see IonResource\n * @see IonImageryProvider\n * @see IonGeocoderService\n * @see createWorldImagery\n * @see createWorldTerrain\n * @namespace Ion\n */\nconst Ion = {};\n\n/**\n * Gets or sets the default Cesium ion access token.\n *\n * @type {string}\n */\nIon.defaultAccessToken = defaultAccessToken;\n\n/**\n * Gets or sets the default Cesium ion server.\n *\n * @type {string|Resource}\n * @default https://api.cesium.com\n */\nIon.defaultServer = new Resource({ url: \"https://api.cesium.com/\" });\n\nIon.getDefaultTokenCredit = function (providedKey) {\n  if (providedKey !== defaultAccessToken) {\n    return undefined;\n  }\n\n  if (!defined(defaultTokenCredit)) {\n    const defaultTokenMessage =\n      '<b> \\\n            This application is using Cesium\\'s default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> \\\n            with an access token from your ion account before making any Cesium API calls. \\\n            You can sign up for a free ion account at <a href=\"https://cesium.com\">https://cesium.com</a>.</b>';\n\n    defaultTokenCredit = new Credit(defaultTokenMessage, true);\n  }\n\n  return defaultTokenCredit;\n};\nexport default Ion;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\n\n/**\n * A wrapper around arrays so that the internal length of the array can be manually managed.\n *\n * @alias ManagedArray\n * @constructor\n * @private\n *\n * @param {number} [length=0] The initial length of the array.\n */\nfunction ManagedArray(length) {\n  length = defaultValue(length, 0);\n  this._array = new Array(length);\n  this._length = length;\n}\n\nObject.defineProperties(ManagedArray.prototype, {\n  /**\n   * Gets or sets the length of the array.\n   * If the set length is greater than the length of the internal array, the internal array is resized.\n   *\n   * @memberof ManagedArray.prototype\n   * @type {number}\n   */\n  length: {\n    get: function () {\n      return this._length;\n    },\n    set: function (length) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"length\", length, 0);\n      //>>includeEnd('debug');\n      const array = this._array;\n      const originalLength = this._length;\n      if (length < originalLength) {\n        // Remove trailing references\n        for (let i = length; i < originalLength; ++i) {\n          array[i] = undefined;\n        }\n      } else if (length > array.length) {\n        array.length = length;\n      }\n      this._length = length;\n    },\n  },\n\n  /**\n   * Gets the internal array.\n   *\n   * @memberof ManagedArray.prototype\n   * @type {Array}\n   * @readonly\n   */\n  values: {\n    get: function () {\n      return this._array;\n    },\n  },\n});\n\n/**\n * Gets the element at an index.\n *\n * @param {number} index The index to get.\n */\nManagedArray.prototype.get = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.lessThan(\"index\", index, this._array.length);\n  //>>includeEnd('debug');\n\n  return this._array[index];\n};\n\n/**\n * Sets the element at an index. Resizes the array if index is greater than the length of the array.\n *\n * @param {number} index The index to set.\n * @param {*} element The element to set at index.\n */\nManagedArray.prototype.set = function (index, element) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"index\", index);\n  //>>includeEnd('debug');\n\n  if (index >= this._length) {\n    this.length = index + 1;\n  }\n  this._array[index] = element;\n};\n\n/**\n * Returns the last element in the array without modifying the array.\n *\n * @returns {*} The last element in the array.\n */\nManagedArray.prototype.peek = function () {\n  return this._array[this._length - 1];\n};\n\n/**\n * Push an element into the array.\n *\n * @param {*} element The element to push.\n */\nManagedArray.prototype.push = function (element) {\n  const index = this.length++;\n  this._array[index] = element;\n};\n\n/**\n * Pop an element from the array.\n *\n * @returns {*} The last element in the array.\n */\nManagedArray.prototype.pop = function () {\n  if (this._length === 0) {\n    return undefined;\n  }\n  const element = this._array[this._length - 1];\n  --this.length;\n  return element;\n};\n\n/**\n * Resize the internal array if length > _array.length.\n *\n * @param {number} length The length.\n */\nManagedArray.prototype.reserve = function (length) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThanOrEquals(\"length\", length, 0);\n  //>>includeEnd('debug');\n\n  if (length > this._array.length) {\n    this._array.length = length;\n  }\n};\n\n/**\n * Resize the array.\n *\n * @param {number} length The length.\n */\nManagedArray.prototype.resize = function (length) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThanOrEquals(\"length\", length, 0);\n  //>>includeEnd('debug');\n\n  this.length = length;\n};\n\n/**\n * Trim the internal array to the specified length. Defaults to the current length.\n *\n * @param {number} [length] The length.\n */\nManagedArray.prototype.trim = function (length) {\n  length = defaultValue(length, this._length);\n  this._array.length = length;\n};\nexport default ManagedArray;\n", "import Check from \"../Core/Check.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\n\n/**\n * An enum describing the x, y, and z axes and helper conversion functions.\n *\n * @enum {number}\n */\nconst Axis = {\n  /**\n   * Denotes the x-axis.\n   *\n   * @type {number}\n   * @constant\n   */\n  X: 0,\n\n  /**\n   * Denotes the y-axis.\n   *\n   * @type {number}\n   * @constant\n   */\n  Y: 1,\n\n  /**\n   * Denotes the z-axis.\n   *\n   * @type {number}\n   * @constant\n   */\n  Z: 2,\n};\n\n/**\n * Matrix used to convert from y-up to z-up\n *\n * @type {Matrix4}\n * @constant\n */\nAxis.Y_UP_TO_Z_UP = Matrix4.fromRotationTranslation(\n  Matrix3.fromRotationX(CesiumMath.PI_OVER_TWO)\n);\n\n/**\n * Matrix used to convert from z-up to y-up\n *\n * @type {Matrix4}\n * @constant\n */\nAxis.Z_UP_TO_Y_UP = Matrix4.fromRotationTranslation(\n  Matrix3.fromRotationX(-CesiumMath.PI_OVER_TWO)\n);\n\n/**\n * Matrix used to convert from x-up to z-up\n *\n * @type {Matrix4}\n * @constant\n */\nAxis.X_UP_TO_Z_UP = Matrix4.fromRotationTranslation(\n  Matrix3.fromRotationY(-CesiumMath.PI_OVER_TWO)\n);\n\n/**\n * Matrix used to convert from z-up to x-up\n *\n * @type {Matrix4}\n * @constant\n */\nAxis.Z_UP_TO_X_UP = Matrix4.fromRotationTranslation(\n  Matrix3.fromRotationY(CesiumMath.PI_OVER_TWO)\n);\n\n/**\n * Matrix used to convert from x-up to y-up\n *\n * @type {Matrix4}\n * @constant\n */\nAxis.X_UP_TO_Y_UP = Matrix4.fromRotationTranslation(\n  Matrix3.fromRotationZ(CesiumMath.PI_OVER_TWO)\n);\n\n/**\n * Matrix used to convert from y-up to x-up\n *\n * @type {Matrix4}\n * @constant\n */\nAxis.Y_UP_TO_X_UP = Matrix4.fromRotationTranslation(\n  Matrix3.fromRotationZ(-CesiumMath.PI_OVER_TWO)\n);\n\n/**\n * Gets the axis by name\n *\n * @param {string} name The name of the axis.\n * @returns {number} The axis enum.\n */\nAxis.fromName = function (name) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"name\", name);\n  //>>includeEnd('debug');\n\n  return Axis[name];\n};\n\nexport default Object.freeze(Axis);\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\n\n/**\n * Simple abstraction for a group. This class exists to make the metadata API\n * more consistent, i.e. metadata can be accessed via\n * <code>content.group.metadata</code> much like tile metadata is accessed as\n * <code>tile.metadata</code>.\n *\n * @param {object} options Object with the following properties:\n * @param {GroupMetadata} options.metadata The metadata associated with this group.\n *\n * @alias Cesium3DContentGroup\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction Cesium3DContentGroup(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.metadata\", options.metadata);\n  //>>includeEnd('debug');\n\n  this._metadata = options.metadata;\n}\n\nObject.defineProperties(Cesium3DContentGroup.prototype, {\n  /**\n   * Get the metadata for this group\n   *\n   * @memberof Cesium3DContentGroup.prototype\n   *\n   * @type {GroupMetadata}\n   *\n   * @readonly\n   */\n  metadata: {\n    get: function () {\n      return this._metadata;\n    },\n  },\n});\n\nexport default Cesium3DContentGroup;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport RuntimeError from \"./RuntimeError.js\";\n\n/**\n * Reads a string from a Uint8Array.\n *\n * @function\n *\n * @param {Uint8Array} uint8Array The Uint8Array to read from.\n * @param {number} [byteOffset=0] The byte offset to start reading from.\n * @param {number} [byteLength] The byte length to read. If byteLength is omitted the remainder of the buffer is read.\n * @returns {string} The string.\n *\n * @private\n */\nfunction getStringFromTypedArray(uint8Array, byteOffset, byteLength) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(uint8Array)) {\n    throw new DeveloperError(\"uint8Array is required.\");\n  }\n  if (byteOffset < 0) {\n    throw new DeveloperError(\"byteOffset cannot be negative.\");\n  }\n  if (byteLength < 0) {\n    throw new DeveloperError(\"byteLength cannot be negative.\");\n  }\n  if (byteOffset + byteLength > uint8Array.byteLength) {\n    throw new DeveloperError(\"sub-region exceeds array bounds.\");\n  }\n  //>>includeEnd('debug');\n\n  byteOffset = defaultValue(byteOffset, 0);\n  byteLength = defaultValue(byteLength, uint8Array.byteLength - byteOffset);\n\n  uint8Array = uint8Array.subarray(byteOffset, byteOffset + byteLength);\n\n  return getStringFromTypedArray.decode(uint8Array);\n}\n\n// Exposed functions for testing\ngetStringFromTypedArray.decodeWithTextDecoder = function (view) {\n  const decoder = new TextDecoder(\"utf-8\");\n  return decoder.decode(view);\n};\n\ngetStringFromTypedArray.decodeWithFromCharCode = function (view) {\n  let result = \"\";\n  const codePoints = utf8Handler(view);\n  const length = codePoints.length;\n  for (let i = 0; i < length; ++i) {\n    let cp = codePoints[i];\n    if (cp <= 0xffff) {\n      result += String.fromCharCode(cp);\n    } else {\n      cp -= 0x10000;\n      result += String.fromCharCode((cp >> 10) + 0xd800, (cp & 0x3ff) + 0xdc00);\n    }\n  }\n  return result;\n};\n\nfunction inRange(a, min, max) {\n  return min <= a && a <= max;\n}\n\n// This code is inspired by public domain code found here: https://github.com/inexorabletash/text-encoding\nfunction utf8Handler(utfBytes) {\n  let codePoint = 0;\n  let bytesSeen = 0;\n  let bytesNeeded = 0;\n  let lowerBoundary = 0x80;\n  let upperBoundary = 0xbf;\n\n  const codePoints = [];\n  const length = utfBytes.length;\n  for (let i = 0; i < length; ++i) {\n    const currentByte = utfBytes[i];\n\n    // If bytesNeeded = 0, then we are starting a new character\n    if (bytesNeeded === 0) {\n      // 1 Byte Ascii character\n      if (inRange(currentByte, 0x00, 0x7f)) {\n        // Return a code point whose value is byte.\n        codePoints.push(currentByte);\n        continue;\n      }\n\n      // 2 Byte character\n      if (inRange(currentByte, 0xc2, 0xdf)) {\n        bytesNeeded = 1;\n        codePoint = currentByte & 0x1f;\n        continue;\n      }\n\n      // 3 Byte character\n      if (inRange(currentByte, 0xe0, 0xef)) {\n        // If byte is 0xE0, set utf-8 lower boundary to 0xA0.\n        if (currentByte === 0xe0) {\n          lowerBoundary = 0xa0;\n        }\n        // If byte is 0xED, set utf-8 upper boundary to 0x9F.\n        if (currentByte === 0xed) {\n          upperBoundary = 0x9f;\n        }\n\n        bytesNeeded = 2;\n        codePoint = currentByte & 0xf;\n        continue;\n      }\n\n      // 4 Byte character\n      if (inRange(currentByte, 0xf0, 0xf4)) {\n        // If byte is 0xF0, set utf-8 lower boundary to 0x90.\n        if (currentByte === 0xf0) {\n          lowerBoundary = 0x90;\n        }\n        // If byte is 0xF4, set utf-8 upper boundary to 0x8F.\n        if (currentByte === 0xf4) {\n          upperBoundary = 0x8f;\n        }\n\n        bytesNeeded = 3;\n        codePoint = currentByte & 0x7;\n        continue;\n      }\n\n      throw new RuntimeError(\"String decoding failed.\");\n    }\n\n    // Out of range, so ignore the first part(s) of the character and continue with this byte on its own\n    if (!inRange(currentByte, lowerBoundary, upperBoundary)) {\n      codePoint = bytesNeeded = bytesSeen = 0;\n      lowerBoundary = 0x80;\n      upperBoundary = 0xbf;\n      --i;\n      continue;\n    }\n\n    // Set appropriate boundaries, since we've now checked byte 2 of a potential longer character\n    lowerBoundary = 0x80;\n    upperBoundary = 0xbf;\n\n    // Add byte to code point\n    codePoint = (codePoint << 6) | (currentByte & 0x3f);\n\n    // We have the correct number of bytes, so push and reset for next character\n    ++bytesSeen;\n    if (bytesSeen === bytesNeeded) {\n      codePoints.push(codePoint);\n      codePoint = bytesNeeded = bytesSeen = 0;\n    }\n  }\n\n  return codePoints;\n}\n\nif (typeof TextDecoder !== \"undefined\") {\n  getStringFromTypedArray.decode =\n    getStringFromTypedArray.decodeWithTextDecoder;\n} else {\n  getStringFromTypedArray.decode =\n    getStringFromTypedArray.decodeWithFromCharCode;\n}\nexport default getStringFromTypedArray;\n", "import defaultValue from \"./defaultValue.js\";\nimport getStringFromTypedArray from \"./getStringFromTypedArray.js\";\n\n/**\n * @private\n */\nfunction getMagic(uint8Array, byteOffset) {\n  byteOffset = defaultValue(byteOffset, 0);\n  return getStringFromTypedArray(\n    uint8Array,\n    byteOffset,\n    Math.min(4, uint8Array.length)\n  );\n}\nexport default getMagic;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport getMagic from \"../Core/getMagic.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * Represents the contents of a\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Composite|Composite}\n * tile in a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles} tileset.\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n *\n * @alias Composite3DTileContent\n * @constructor\n *\n * @private\n */\nfunction Composite3DTileContent(tileset, tile, resource, contents) {\n  this._tileset = tileset;\n  this._tile = tile;\n  this._resource = resource;\n\n  if (!defined(contents)) {\n    contents = [];\n  }\n  this._contents = contents;\n\n  this._metadata = undefined;\n  this._group = undefined;\n  this._ready = false;\n}\n\nObject.defineProperties(Composite3DTileContent.prototype, {\n  featurePropertiesDirty: {\n    get: function () {\n      const contents = this._contents;\n      const length = contents.length;\n      for (let i = 0; i < length; ++i) {\n        if (contents[i].featurePropertiesDirty) {\n          return true;\n        }\n      }\n\n      return false;\n    },\n    set: function (value) {\n      const contents = this._contents;\n      const length = contents.length;\n      for (let i = 0; i < length; ++i) {\n        contents[i].featurePropertiesDirty = value;\n      }\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface.  <code>Composite3DTileContent</code>\n   * always returns <code>0</code>.  Instead call <code>featuresLength</code> for a tile in the composite.\n   * @memberof Composite3DTileContent.prototype\n   */\n  featuresLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface.  <code>Composite3DTileContent</code>\n   * always returns <code>0</code>.  Instead call <code>pointsLength</code> for a tile in the composite.\n   * @memberof Composite3DTileContent.prototype\n   */\n  pointsLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface.  <code>Composite3DTileContent</code>\n   * always returns <code>0</code>.  Instead call <code>trianglesLength</code> for a tile in the composite.\n   * @memberof Composite3DTileContent.prototype\n   */\n  trianglesLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface.  <code>Composite3DTileContent</code>\n   * always returns <code>0</code>.  Instead call <code>geometryByteLength</code> for a tile in the composite.\n   * @memberof Composite3DTileContent.prototype\n   */\n  geometryByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface.   <code>Composite3DTileContent</code>\n   * always returns <code>0</code>.  Instead call <code>texturesByteLength</code> for a tile in the composite.\n   * @memberof Composite3DTileContent.prototype\n   */\n  texturesByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface.  <code>Composite3DTileContent</code>\n   * always returns <code>0</code>.  Instead call <code>batchTableByteLength</code> for a tile in the composite.\n   * @memberof Composite3DTileContent.prototype\n   */\n  batchTableByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  innerContents: {\n    get: function () {\n      return this._contents;\n    },\n  },\n\n  /**\n   * Returns true when the tile's content is ready to render; otherwise false\n   *\n   * @memberof Composite3DTileContent.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n\n  tileset: {\n    get: function () {\n      return this._tileset;\n    },\n  },\n\n  tile: {\n    get: function () {\n      return this._tile;\n    },\n  },\n\n  url: {\n    get: function () {\n      return this._resource.getUrlComponent(true);\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface. <code>Composite3DTileContent</code>\n   * both stores the content metadata and propagates the content metadata to all of its children.\n   * @memberof Composite3DTileContent.prototype\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  metadata: {\n    get: function () {\n      return this._metadata;\n    },\n    set: function (value) {\n      this._metadata = value;\n      const contents = this._contents;\n      const length = contents.length;\n      for (let i = 0; i < length; ++i) {\n        contents[i].metadata = value;\n      }\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface. <code>Composite3DTileContent</code>\n   * always returns <code>undefined</code>.  Instead call <code>batchTable</code> for a tile in the composite.\n   * @memberof Composite3DTileContent.prototype\n   */\n  batchTable: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface. <code>Composite3DTileContent</code>\n   * both stores the group metadata and propagates the group metadata to all of its children.\n   * @memberof Composite3DTileContent.prototype\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  group: {\n    get: function () {\n      return this._group;\n    },\n    set: function (value) {\n      this._group = value;\n      const contents = this._contents;\n      const length = contents.length;\n      for (let i = 0; i < length; ++i) {\n        contents[i].group = value;\n      }\n    },\n  },\n});\n\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\n\nComposite3DTileContent.fromTileType = async function (\n  tileset,\n  tile,\n  resource,\n  arrayBuffer,\n  byteOffset,\n  factory\n) {\n  byteOffset = defaultValue(byteOffset, 0);\n\n  const uint8Array = new Uint8Array(arrayBuffer);\n  const view = new DataView(arrayBuffer);\n  byteOffset += sizeOfUint32; // Skip magic\n\n  const version = view.getUint32(byteOffset, true);\n  if (version !== 1) {\n    throw new RuntimeError(\n      `Only Composite Tile version 1 is supported. Version ${version} is not.`\n    );\n  }\n  byteOffset += sizeOfUint32;\n\n  // Skip byteLength\n  byteOffset += sizeOfUint32;\n\n  const tilesLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  // For caching purposes, models within the composite tile must be\n  // distinguished. To do this, add a query parameter ?compositeIndex=i.\n  // Since composite tiles may contain other composite tiles, check for an\n  // existing prefix and separate them with underscores. e.g.\n  // ?compositeIndex=0_1_1\n  let prefix = resource.queryParameters.compositeIndex;\n  if (defined(prefix)) {\n    // We'll be adding another value at the end, so add an underscore.\n    prefix = `${prefix}_`;\n  } else {\n    // no prefix\n    prefix = \"\";\n  }\n\n  const promises = [];\n  promises.length = tilesLength;\n  for (let i = 0; i < tilesLength; ++i) {\n    const tileType = getMagic(uint8Array, byteOffset);\n\n    // Tile byte length is stored after magic and version\n    const tileByteLength = view.getUint32(byteOffset + sizeOfUint32 * 2, true);\n\n    const contentFactory = factory[tileType];\n\n    // Label which content within the composite this is\n    const compositeIndex = `${prefix}${i}`;\n    const childResource = resource.getDerivedResource({\n      queryParameters: {\n        compositeIndex: compositeIndex,\n      },\n    });\n\n    if (defined(contentFactory)) {\n      promises[i] = Promise.resolve(\n        contentFactory(tileset, tile, childResource, arrayBuffer, byteOffset)\n      );\n    } else {\n      throw new RuntimeError(\n        `Unknown tile content type, ${tileType}, inside Composite tile`\n      );\n    }\n\n    byteOffset += tileByteLength;\n  }\n\n  const innerContents = await Promise.all(promises);\n  const content = new Composite3DTileContent(\n    tileset,\n    tile,\n    resource,\n    innerContents\n  );\n  return content;\n};\n\n/**\n * Part of the {@link Cesium3DTileContent} interface.  <code>Composite3DTileContent</code>\n * always returns <code>false</code>.  Instead call <code>hasProperty</code> for a tile in the composite.\n */\nComposite3DTileContent.prototype.hasProperty = function (batchId, name) {\n  return false;\n};\n\n/**\n * Part of the {@link Cesium3DTileContent} interface.  <code>Composite3DTileContent</code>\n * always returns <code>undefined</code>.  Instead call <code>getFeature</code> for a tile in the composite.\n */\nComposite3DTileContent.prototype.getFeature = function (batchId) {\n  return undefined;\n};\n\nComposite3DTileContent.prototype.applyDebugSettings = function (\n  enabled,\n  color\n) {\n  const contents = this._contents;\n  const length = contents.length;\n  for (let i = 0; i < length; ++i) {\n    contents[i].applyDebugSettings(enabled, color);\n  }\n};\n\nComposite3DTileContent.prototype.applyStyle = function (style) {\n  const contents = this._contents;\n  const length = contents.length;\n  for (let i = 0; i < length; ++i) {\n    contents[i].applyStyle(style);\n  }\n};\n\nComposite3DTileContent.prototype.update = function (tileset, frameState) {\n  const contents = this._contents;\n  const length = contents.length;\n  let ready = true;\n  for (let i = 0; i < length; ++i) {\n    contents[i].update(tileset, frameState);\n    ready = ready && contents[i].ready;\n  }\n\n  if (!this._ready && ready) {\n    this._ready = true;\n  }\n};\n\nComposite3DTileContent.prototype.isDestroyed = function () {\n  return false;\n};\n\nComposite3DTileContent.prototype.destroy = function () {\n  const contents = this._contents;\n  const length = contents.length;\n  for (let i = 0; i < length; ++i) {\n    contents[i].destroy();\n  }\n  return destroyObject(this);\n};\nexport default Composite3DTileContent;\n", "import getStringFromTypedArray from \"./getStringFromTypedArray.js\";\n\n/**\n * Parses JSON from a Uint8Array.\n *\n * @function\n *\n * @param {Uint8Array} uint8Array The Uint8Array to read from.\n * @param {number} [byteOffset=0] The byte offset to start reading from.\n * @param {number} [byteLength] The byte length to read. If byteLength is omitted the remainder of the buffer is read.\n * @returns {object} An object containing the parsed JSON.\n *\n * @private\n */\nfunction getJsonFromTypedArray(uint8Array, byteOffset, byteLength) {\n  return JSON.parse(\n    getStringFromTypedArray(uint8Array, byteOffset, byteLength)\n  );\n}\n\nexport default getJsonFromTypedArray;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\n\n/**\n * An object that manages color, show/hide and picking textures for a batch\n * table or feature table.\n *\n * @param {object} options Object with the following properties:\n * @param {number} featuresLength The number of features in the batch table or feature table\n * @param {Cesium3DTileContent|ModelFeatureTable} owner The owner of this batch texture. For 3D Tiles, this will be a {@link Cesium3DTileContent}. For glTF models, this will be a {@link ModelFeatureTable}.\n * @param {object} [statistics] The statistics object to update with information about the batch texture.\n * @param {Function} [colorChangedCallback] A callback function that is called whenever the color of a feature changes.\n *\n * @alias BatchTexture\n * @constructor\n *\n * @private\n */\nfunction BatchTexture(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"options.featuresLength\", options.featuresLength);\n  Check.typeOf.object(\"options.owner\", options.owner);\n  //>>includeEnd('debug');\n\n  this._id = createGuid();\n\n  const featuresLength = options.featuresLength;\n\n  // PERFORMANCE_IDEA: These parallel arrays probably generate cache misses in get/set color/show\n  // and use A LOT of memory.  How can we use less memory?\n  this._showAlphaProperties = undefined; // [Show (0 or 255), Alpha (0 to 255)] property for each feature\n  this._batchValues = undefined; // Per-feature RGBA (A is based on the color's alpha and feature's show property)\n\n  this._batchValuesDirty = false;\n  this._batchTexture = undefined;\n  this._defaultTexture = undefined;\n\n  this._pickTexture = undefined;\n  this._pickIds = [];\n\n  // Dimensions for batch and pick textures\n  let textureDimensions;\n  let textureStep;\n\n  if (featuresLength > 0) {\n    // PERFORMANCE_IDEA: this can waste memory in the last row in the uncommon case\n    // when more than one row is needed (e.g., > 16K features in one tile)\n    const width = Math.min(featuresLength, ContextLimits.maximumTextureSize);\n    const height = Math.ceil(featuresLength / ContextLimits.maximumTextureSize);\n    const stepX = 1.0 / width;\n    const centerX = stepX * 0.5;\n    const stepY = 1.0 / height;\n    const centerY = stepY * 0.5;\n\n    textureDimensions = new Cartesian2(width, height);\n    textureStep = new Cartesian4(stepX, centerX, stepY, centerY);\n  }\n\n  this._translucentFeaturesLength = 0;\n  this._featuresLength = featuresLength;\n  this._textureDimensions = textureDimensions;\n  this._textureStep = textureStep;\n  this._owner = options.owner;\n  this._statistics = options.statistics;\n  this._colorChangedCallback = options.colorChangedCallback;\n}\n\nObject.defineProperties(BatchTexture.prototype, {\n  /**\n   * Number of features that are translucent\n   *\n   * @memberof BatchTexture.prototype\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  translucentFeaturesLength: {\n    get: function () {\n      return this._translucentFeaturesLength;\n    },\n  },\n\n  /**\n   * Total size of all GPU resources used by this batch texture.\n   *\n   * @memberof BatchTexture.prototype\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  byteLength: {\n    get: function () {\n      let memory = 0;\n      if (defined(this._pickTexture)) {\n        memory += this._pickTexture.sizeInBytes;\n      }\n      if (defined(this._batchTexture)) {\n        memory += this._batchTexture.sizeInBytes;\n      }\n      return memory;\n    },\n  },\n\n  /**\n   * Dimensions of the underlying batch texture.\n   *\n   * @memberof BatchTexture.prototype\n   * @type {Cartesian2}\n   * @readonly\n   * @private\n   */\n  textureDimensions: {\n    get: function () {\n      return this._textureDimensions;\n    },\n  },\n\n  /**\n   * Size of each texture and distance from side to center of a texel in\n   * each direction. Stored as (stepX, centerX, stepY, centerY)\n   *\n   * @memberof BatchTexture.prototype\n   * @type {Cartesian4}\n   * @readonly\n   * @private\n   */\n  textureStep: {\n    get: function () {\n      return this._textureStep;\n    },\n  },\n\n  /**\n   * The underlying texture used for styling. The texels are accessed\n   * by batch ID, and the value is the color of this feature after accounting\n   * for show/hide settings.\n   *\n   * @memberof BatchTexture.prototype\n   * @type {Texture}\n   * @readonly\n   * @private\n   */\n  batchTexture: {\n    get: function () {\n      return this._batchTexture;\n    },\n  },\n\n  /**\n   * The default texture to use when there are no batch values\n   *\n   * @memberof BatchTexture.prototype\n   * @type {Texture}\n   * @readonly\n   * @private\n   */\n  defaultTexture: {\n    get: function () {\n      return this._defaultTexture;\n    },\n  },\n\n  /**\n   * The underlying texture used for picking. The texels are accessed by\n   * batch ID, and the value is the pick color.\n   *\n   * @memberof BatchTexture.prototype\n   * @type {Texture}\n   * @readonly\n   * @private\n   */\n  pickTexture: {\n    get: function () {\n      return this._pickTexture;\n    },\n  },\n});\n\nBatchTexture.DEFAULT_COLOR_VALUE = Color.WHITE;\nBatchTexture.DEFAULT_SHOW_VALUE = true;\n\nfunction getByteLength(batchTexture) {\n  const dimensions = batchTexture._textureDimensions;\n  return dimensions.x * dimensions.y * 4;\n}\n\nfunction getBatchValues(batchTexture) {\n  if (!defined(batchTexture._batchValues)) {\n    // Default batch texture to RGBA = 255: white highlight (RGB) and show/alpha = true/255 (A).\n    const byteLength = getByteLength(batchTexture);\n    const bytes = new Uint8Array(byteLength).fill(255);\n    batchTexture._batchValues = bytes;\n  }\n\n  return batchTexture._batchValues;\n}\n\nfunction getShowAlphaProperties(batchTexture) {\n  if (!defined(batchTexture._showAlphaProperties)) {\n    const byteLength = 2 * batchTexture._featuresLength;\n    const bytes = new Uint8Array(byteLength).fill(255);\n    // [Show = true, Alpha = 255]\n    batchTexture._showAlphaProperties = bytes;\n  }\n  return batchTexture._showAlphaProperties;\n}\n\nfunction checkBatchId(batchId, featuresLength) {\n  if (!defined(batchId) || batchId < 0 || batchId >= featuresLength) {\n    throw new DeveloperError(\n      `batchId is required and between zero and featuresLength - 1 (${featuresLength}` -\n        +\").\"\n    );\n  }\n}\n\n/**\n * Set whether a feature is visible.\n *\n * @param {number} batchId the ID of the feature\n * @param {boolean} show <code>true</code> if the feature should be shown, <code>false</code> otherwise\n * @private\n */\nBatchTexture.prototype.setShow = function (batchId, show) {\n  //>>includeStart('debug', pragmas.debug);\n  checkBatchId(batchId, this._featuresLength);\n  Check.typeOf.bool(\"show\", show);\n  //>>includeEnd('debug');\n\n  if (show && !defined(this._showAlphaProperties)) {\n    // Avoid allocating since the default is show = true\n    return;\n  }\n\n  const showAlphaProperties = getShowAlphaProperties(this);\n  const propertyOffset = batchId * 2;\n\n  const newShow = show ? 255 : 0;\n  if (showAlphaProperties[propertyOffset] !== newShow) {\n    showAlphaProperties[propertyOffset] = newShow;\n\n    const batchValues = getBatchValues(this);\n\n    // Compute alpha used in the shader based on show and color.alpha properties\n    const offset = batchId * 4 + 3;\n    batchValues[offset] = show ? showAlphaProperties[propertyOffset + 1] : 0;\n\n    this._batchValuesDirty = true;\n  }\n};\n\n/**\n * Set the show for all features at once.\n *\n * @param {boolean} show <code>true</code> if the feature should be shown, <code>false</code> otherwise\n * @private\n */\nBatchTexture.prototype.setAllShow = function (show) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.bool(\"show\", show);\n  //>>includeEnd('debug');\n\n  const featuresLength = this._featuresLength;\n  for (let i = 0; i < featuresLength; ++i) {\n    this.setShow(i, show);\n  }\n};\n\n/**\n * Check the current show value for a feature\n *\n * @param {number} batchId the ID of the feature\n * @return {boolean} <code>true</code> if the feature is shown, or <code>false</code> otherwise\n * @private\n */\nBatchTexture.prototype.getShow = function (batchId) {\n  //>>includeStart('debug', pragmas.debug);\n  checkBatchId(batchId, this._featuresLength);\n  //>>includeEnd('debug');\n\n  if (!defined(this._showAlphaProperties)) {\n    // Avoid allocating since the default is show = true\n    return true;\n  }\n\n  const offset = batchId * 2;\n  return this._showAlphaProperties[offset] === 255;\n};\n\nconst scratchColorBytes = new Array(4);\n\n/**\n * Set the styling color of a feature\n *\n * @param {number} batchId the ID of the feature\n * @param {Color} color the color to assign to this feature.\n *\n * @private\n */\nBatchTexture.prototype.setColor = function (batchId, color) {\n  //>>includeStart('debug', pragmas.debug);\n  checkBatchId(batchId, this._featuresLength);\n  Check.typeOf.object(\"color\", color);\n  //>>includeEnd('debug');\n\n  if (\n    Color.equals(color, BatchTexture.DEFAULT_COLOR_VALUE) &&\n    !defined(this._batchValues)\n  ) {\n    // Avoid allocating since the default is white\n    return;\n  }\n\n  const newColor = color.toBytes(scratchColorBytes);\n  const newAlpha = newColor[3];\n\n  const batchValues = getBatchValues(this);\n  const offset = batchId * 4;\n\n  const showAlphaProperties = getShowAlphaProperties(this);\n  const propertyOffset = batchId * 2;\n\n  if (\n    batchValues[offset] !== newColor[0] ||\n    batchValues[offset + 1] !== newColor[1] ||\n    batchValues[offset + 2] !== newColor[2] ||\n    showAlphaProperties[propertyOffset + 1] !== newAlpha\n  ) {\n    batchValues[offset] = newColor[0];\n    batchValues[offset + 1] = newColor[1];\n    batchValues[offset + 2] = newColor[2];\n\n    const wasTranslucent = showAlphaProperties[propertyOffset + 1] !== 255;\n\n    // Compute alpha used in the shader based on show and color.alpha properties\n    const show = showAlphaProperties[propertyOffset] !== 0;\n    batchValues[offset + 3] = show ? newAlpha : 0;\n    showAlphaProperties[propertyOffset + 1] = newAlpha;\n\n    // Track number of translucent features so we know if this tile needs\n    // opaque commands, translucent commands, or both for rendering.\n    const isTranslucent = newAlpha !== 255;\n    if (isTranslucent && !wasTranslucent) {\n      ++this._translucentFeaturesLength;\n    } else if (!isTranslucent && wasTranslucent) {\n      --this._translucentFeaturesLength;\n    }\n\n    this._batchValuesDirty = true;\n\n    if (defined(this._colorChangedCallback)) {\n      this._colorChangedCallback(batchId, color);\n    }\n  }\n};\n\n/**\n * Set the styling color for all features at once\n *\n * @param {Color} color the color to assign to all features.\n *\n * @private\n */\nBatchTexture.prototype.setAllColor = function (color) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"color\", color);\n  //>>includeEnd('debug');\n\n  const featuresLength = this._featuresLength;\n  for (let i = 0; i < featuresLength; ++i) {\n    this.setColor(i, color);\n  }\n};\n\n/**\n * Get the current color of a feature\n *\n * @param {number} batchId The ID of the feature\n * @param {Color} result A color object where the result will be stored.\n * @return {Color} The color assigned to the selected feature\n *\n * @private\n */\nBatchTexture.prototype.getColor = function (batchId, result) {\n  //>>includeStart('debug', pragmas.debug);\n  checkBatchId(batchId, this._featuresLength);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  if (!defined(this._batchValues)) {\n    return Color.clone(BatchTexture.DEFAULT_COLOR_VALUE, result);\n  }\n\n  const batchValues = this._batchValues;\n  const offset = batchId * 4;\n\n  const showAlphaProperties = this._showAlphaProperties;\n  const propertyOffset = batchId * 2;\n\n  return Color.fromBytes(\n    batchValues[offset],\n    batchValues[offset + 1],\n    batchValues[offset + 2],\n    showAlphaProperties[propertyOffset + 1],\n    result\n  );\n};\n\n/**\n * Get the pick color of a feature. This feature is an RGBA encoding of the\n * pick ID.\n *\n * @param {number} batchId The ID of the feature\n * @return {PickId} The picking color assigned to this feature\n *\n * @private\n */\nBatchTexture.prototype.getPickColor = function (batchId) {\n  //>>includeStart('debug', pragmas.debug);\n  checkBatchId(batchId, this._featuresLength);\n  //>>includeEnd('debug');\n  return this._pickIds[batchId];\n};\n\nfunction createTexture(batchTexture, context, bytes) {\n  const dimensions = batchTexture._textureDimensions;\n  return new Texture({\n    context: context,\n    pixelFormat: PixelFormat.RGBA,\n    pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n    source: {\n      width: dimensions.x,\n      height: dimensions.y,\n      arrayBufferView: bytes,\n    },\n    flipY: false,\n    sampler: Sampler.NEAREST,\n  });\n}\n\nfunction createPickTexture(batchTexture, context) {\n  const featuresLength = batchTexture._featuresLength;\n  if (!defined(batchTexture._pickTexture) && featuresLength > 0) {\n    const pickIds = batchTexture._pickIds;\n    const byteLength = getByteLength(batchTexture);\n    const bytes = new Uint8Array(byteLength);\n    const owner = batchTexture._owner;\n    const statistics = batchTexture._statistics;\n\n    // PERFORMANCE_IDEA: we could skip the pick texture completely by allocating\n    // a continuous range of pickIds and then converting the base pickId + batchId\n    // to RGBA in the shader.  The only consider is precision issues, which might\n    // not be an issue in WebGL 2.\n    for (let i = 0; i < featuresLength; ++i) {\n      const pickId = context.createPickId(owner.getFeature(i));\n      pickIds.push(pickId);\n\n      const pickColor = pickId.color;\n      const offset = i * 4;\n      bytes[offset] = Color.floatToByte(pickColor.red);\n      bytes[offset + 1] = Color.floatToByte(pickColor.green);\n      bytes[offset + 2] = Color.floatToByte(pickColor.blue);\n      bytes[offset + 3] = Color.floatToByte(pickColor.alpha);\n    }\n\n    batchTexture._pickTexture = createTexture(batchTexture, context, bytes);\n\n    // Make sure the tileset statistics are updated the frame when the pick\n    // texture is created.\n    if (defined(statistics)) {\n      statistics.batchTableByteLength += batchTexture._pickTexture.sizeInBytes;\n    }\n  }\n}\n\nfunction updateBatchTexture(batchTexture) {\n  const dimensions = batchTexture._textureDimensions;\n  // PERFORMANCE_IDEA: Instead of rewriting the entire texture, use fine-grained\n  // texture updates when less than, for example, 10%, of the values changed.  Or\n  // even just optimize the common case when one feature show/color changed.\n  batchTexture._batchTexture.copyFrom({\n    source: {\n      width: dimensions.x,\n      height: dimensions.y,\n      arrayBufferView: batchTexture._batchValues,\n    },\n  });\n}\n\nBatchTexture.prototype.update = function (tileset, frameState) {\n  const context = frameState.context;\n  this._defaultTexture = context.defaultTexture;\n\n  const passes = frameState.passes;\n  if (passes.pick || passes.postProcess) {\n    createPickTexture(this, context);\n  }\n\n  if (this._batchValuesDirty) {\n    this._batchValuesDirty = false;\n\n    // Create batch texture on-demand\n    if (!defined(this._batchTexture)) {\n      this._batchTexture = createTexture(this, context, this._batchValues);\n\n      // Make sure the tileset statistics are updated the frame when the\n      // batch texture is created.\n      if (defined(this._statistics)) {\n        this._statistics.batchTableByteLength += this._batchTexture.sizeInBytes;\n      }\n    }\n\n    updateBatchTexture(this); // Apply per-feature show/color updates\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see BatchTexture#destroy\n * @private\n */\nBatchTexture.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * e = e && e.destroy();\n *\n * @see BatchTexture#isDestroyed\n * @private\n */\nBatchTexture.prototype.destroy = function () {\n  this._batchTexture = this._batchTexture && this._batchTexture.destroy();\n  this._pickTexture = this._pickTexture && this._pickTexture.destroy();\n\n  const pickIds = this._pickIds;\n  const length = pickIds.length;\n  for (let i = 0; i < length; ++i) {\n    pickIds[i].destroy();\n  }\n\n  return destroyObject(this);\n};\n\nexport default BatchTexture;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport Matrix2 from \"../Core/Matrix2.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\n\nconst ComponentsPerAttribute = {\n  SCALAR: 1,\n  VEC2: 2,\n  VEC3: 3,\n  VEC4: 4,\n  MAT2: 4,\n  MAT3: 9,\n  MAT4: 16,\n};\n\nconst ClassPerType = {\n  SCALAR: undefined,\n  VEC2: Cartesian2,\n  VEC3: Cartesian3,\n  VEC4: Cartesian4,\n  MAT2: Matrix2,\n  MAT3: Matrix3,\n  MAT4: Matrix4,\n};\n\n/**\n * @private\n */\nfunction getBinaryAccessor(accessor) {\n  const componentType = accessor.componentType;\n  let componentDatatype;\n  if (typeof componentType === \"string\") {\n    componentDatatype = ComponentDatatype.fromName(componentType);\n  } else {\n    componentDatatype = componentType;\n  }\n\n  const componentsPerAttribute = ComponentsPerAttribute[accessor.type];\n  const classType = ClassPerType[accessor.type];\n  return {\n    componentsPerAttribute: componentsPerAttribute,\n    classType: classType,\n    createArrayBufferView: function (buffer, byteOffset, length) {\n      return ComponentDatatype.createArrayBufferView(\n        componentDatatype,\n        buffer,\n        byteOffset,\n        componentsPerAttribute * length\n      );\n    },\n  };\n}\nexport default getBinaryAccessor;\n", "import AttributeType from \"./AttributeType.js\";\nimport Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport combine from \"../Core/combine.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defined from \"../Core/defined.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport getBinaryAccessor from \"./getBinaryAccessor.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * Object for handling the <code>3DTILES_batch_table_hierarchy</code> extension\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.extension The <code>3DTILES_batch_table_hierarchy</code> extension object.\n * @param {Uint8Array} [options.binaryBody] The binary body of the batch table\n *\n * @alias BatchTableHierarchy\n * @constructor\n *\n * @private\n */\nfunction BatchTableHierarchy(options) {\n  this._classes = undefined;\n  this._classIds = undefined;\n  this._classIndexes = undefined;\n  this._parentCounts = undefined;\n  this._parentIndexes = undefined;\n  this._parentIds = undefined;\n\n  // Total memory used by the typed arrays\n  this._byteLength = 0;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.extension\", options.extension);\n  //>>includeEnd('debug');\n\n  initialize(this, options.extension, options.binaryBody);\n\n  //>>includeStart('debug', pragmas.debug);\n  validateHierarchy(this);\n  //>>includeEnd('debug');\n}\n\nObject.defineProperties(BatchTableHierarchy.prototype, {\n  byteLength: {\n    get: function () {\n      return this._byteLength;\n    },\n  },\n});\n\n/**\n * Parse the batch table hierarchy from the\n * <code>3DTILES_batch_table_hierarchy</code> extension.\n *\n * @param {BatchTableHierarchy} hierarchy The hierarchy instance\n * @param {object} hierarchyJson The JSON of the extension\n * @param {Uint8Array} [binaryBody] The binary body of the batch table for accessing binary properties\n * @private\n */\nfunction initialize(hierarchy, hierarchyJson, binaryBody) {\n  let i;\n  let classId;\n  let binaryAccessor;\n\n  const instancesLength = hierarchyJson.instancesLength;\n  const classes = hierarchyJson.classes;\n  let classIds = hierarchyJson.classIds;\n  let parentCounts = hierarchyJson.parentCounts;\n  let parentIds = hierarchyJson.parentIds;\n  let parentIdsLength = instancesLength;\n  let byteLength = 0;\n\n  if (defined(classIds.byteOffset)) {\n    classIds.componentType = defaultValue(\n      classIds.componentType,\n      ComponentDatatype.UNSIGNED_SHORT\n    );\n    classIds.type = AttributeType.SCALAR;\n    binaryAccessor = getBinaryAccessor(classIds);\n    classIds = binaryAccessor.createArrayBufferView(\n      binaryBody.buffer,\n      binaryBody.byteOffset + classIds.byteOffset,\n      instancesLength\n    );\n    byteLength += classIds.byteLength;\n  }\n\n  let parentIndexes;\n  if (defined(parentCounts)) {\n    if (defined(parentCounts.byteOffset)) {\n      parentCounts.componentType = defaultValue(\n        parentCounts.componentType,\n        ComponentDatatype.UNSIGNED_SHORT\n      );\n      parentCounts.type = AttributeType.SCALAR;\n      binaryAccessor = getBinaryAccessor(parentCounts);\n      parentCounts = binaryAccessor.createArrayBufferView(\n        binaryBody.buffer,\n        binaryBody.byteOffset + parentCounts.byteOffset,\n        instancesLength\n      );\n      byteLength += parentCounts.byteLength;\n    }\n    parentIndexes = new Uint16Array(instancesLength);\n    parentIdsLength = 0;\n    for (i = 0; i < instancesLength; ++i) {\n      parentIndexes[i] = parentIdsLength;\n      parentIdsLength += parentCounts[i];\n    }\n\n    byteLength += parentIndexes.byteLength;\n  }\n\n  if (defined(parentIds) && defined(parentIds.byteOffset)) {\n    parentIds.componentType = defaultValue(\n      parentIds.componentType,\n      ComponentDatatype.UNSIGNED_SHORT\n    );\n    parentIds.type = AttributeType.SCALAR;\n    binaryAccessor = getBinaryAccessor(parentIds);\n    parentIds = binaryAccessor.createArrayBufferView(\n      binaryBody.buffer,\n      binaryBody.byteOffset + parentIds.byteOffset,\n      parentIdsLength\n    );\n\n    byteLength += parentIds.byteLength;\n  }\n\n  const classesLength = classes.length;\n  for (i = 0; i < classesLength; ++i) {\n    const classInstancesLength = classes[i].length;\n    const properties = classes[i].instances;\n    const binaryProperties = getBinaryProperties(\n      classInstancesLength,\n      properties,\n      binaryBody\n    );\n    byteLength += countBinaryPropertyMemory(binaryProperties);\n    classes[i].instances = combine(binaryProperties, properties);\n  }\n\n  const classCounts = new Array(classesLength).fill(0);\n  const classIndexes = new Uint16Array(instancesLength);\n  for (i = 0; i < instancesLength; ++i) {\n    classId = classIds[i];\n    classIndexes[i] = classCounts[classId];\n    ++classCounts[classId];\n  }\n  byteLength += classIndexes.byteLength;\n\n  hierarchy._classes = classes;\n  hierarchy._classIds = classIds;\n  hierarchy._classIndexes = classIndexes;\n  hierarchy._parentCounts = parentCounts;\n  hierarchy._parentIndexes = parentIndexes;\n  hierarchy._parentIds = parentIds;\n  hierarchy._byteLength = byteLength;\n}\n\nfunction getBinaryProperties(featuresLength, properties, binaryBody) {\n  let binaryProperties;\n  for (const name in properties) {\n    if (properties.hasOwnProperty(name)) {\n      const property = properties[name];\n      const byteOffset = property.byteOffset;\n      if (defined(byteOffset)) {\n        // This is a binary property\n        const componentType = property.componentType;\n        const type = property.type;\n        if (!defined(componentType)) {\n          throw new RuntimeError(\"componentType is required.\");\n        }\n        if (!defined(type)) {\n          throw new RuntimeError(\"type is required.\");\n        }\n        if (!defined(binaryBody)) {\n          throw new RuntimeError(\n            `Property ${name} requires a batch table binary.`\n          );\n        }\n\n        const binaryAccessor = getBinaryAccessor(property);\n        const componentCount = binaryAccessor.componentsPerAttribute;\n        const classType = binaryAccessor.classType;\n        const typedArray = binaryAccessor.createArrayBufferView(\n          binaryBody.buffer,\n          binaryBody.byteOffset + byteOffset,\n          featuresLength\n        );\n\n        if (!defined(binaryProperties)) {\n          binaryProperties = {};\n        }\n\n        // Store any information needed to access the binary data, including the typed array,\n        // componentCount (e.g. a VEC4 would be 4), and the type used to pack and unpack (e.g. Cartesian4).\n        binaryProperties[name] = {\n          typedArray: typedArray,\n          componentCount: componentCount,\n          type: classType,\n        };\n      }\n    }\n  }\n  return binaryProperties;\n}\n\nfunction countBinaryPropertyMemory(binaryProperties) {\n  let byteLength = 0;\n  for (const name in binaryProperties) {\n    if (binaryProperties.hasOwnProperty(name)) {\n      byteLength += binaryProperties[name].typedArray.byteLength;\n    }\n  }\n  return byteLength;\n}\n\n//>>includeStart('debug', pragmas.debug);\nconst scratchValidateStack = [];\nfunction validateHierarchy(hierarchy) {\n  const stack = scratchValidateStack;\n  stack.length = 0;\n\n  const classIds = hierarchy._classIds;\n  const instancesLength = classIds.length;\n\n  for (let i = 0; i < instancesLength; ++i) {\n    validateInstance(hierarchy, i, stack);\n  }\n}\n\nfunction validateInstance(hierarchy, instanceIndex, stack) {\n  const parentCounts = hierarchy._parentCounts;\n  const parentIds = hierarchy._parentIds;\n  const parentIndexes = hierarchy._parentIndexes;\n  const classIds = hierarchy._classIds;\n  const instancesLength = classIds.length;\n\n  if (!defined(parentIds)) {\n    // No need to validate if there are no parents\n    return;\n  }\n\n  if (instanceIndex >= instancesLength) {\n    throw new DeveloperError(\n      `Parent index ${instanceIndex} exceeds the total number of instances: ${instancesLength}`\n    );\n  }\n  if (stack.indexOf(instanceIndex) > -1) {\n    throw new DeveloperError(\n      \"Circular dependency detected in the batch table hierarchy.\"\n    );\n  }\n\n  stack.push(instanceIndex);\n  const parentCount = defined(parentCounts) ? parentCounts[instanceIndex] : 1;\n  const parentIndex = defined(parentCounts)\n    ? parentIndexes[instanceIndex]\n    : instanceIndex;\n  for (let i = 0; i < parentCount; ++i) {\n    const parentId = parentIds[parentIndex + i];\n    // Stop the traversal when the instance has no parent (its parentId equals itself), else continue the traversal.\n    if (parentId !== instanceIndex) {\n      validateInstance(hierarchy, parentId, stack);\n    }\n  }\n  stack.pop(instanceIndex);\n}\n//>>includeEnd('debug');\n\n// The size of this array equals the maximum instance count among all loaded tiles, which has the potential to be large.\nconst scratchVisited = [];\nconst scratchStack = [];\nlet marker = 0;\nfunction traverseHierarchyMultipleParents(\n  hierarchy,\n  instanceIndex,\n  endConditionCallback\n) {\n  const classIds = hierarchy._classIds;\n  const parentCounts = hierarchy._parentCounts;\n  const parentIds = hierarchy._parentIds;\n  const parentIndexes = hierarchy._parentIndexes;\n  const instancesLength = classIds.length;\n\n  // Ignore instances that have already been visited. This occurs in diamond inheritance situations.\n  // Use a marker value to indicate that an instance has been visited, which increments with each run.\n  // This is more efficient than clearing the visited array every time.\n  const visited = scratchVisited;\n  visited.length = Math.max(visited.length, instancesLength);\n  const visitedMarker = ++marker;\n\n  const stack = scratchStack;\n  stack.length = 0;\n  stack.push(instanceIndex);\n\n  while (stack.length > 0) {\n    instanceIndex = stack.pop();\n    if (visited[instanceIndex] === visitedMarker) {\n      // This instance has already been visited, stop traversal\n      continue;\n    }\n    visited[instanceIndex] = visitedMarker;\n    const result = endConditionCallback(hierarchy, instanceIndex);\n    if (defined(result)) {\n      // The end condition was met, stop the traversal and return the result\n      return result;\n    }\n    const parentCount = parentCounts[instanceIndex];\n    const parentIndex = parentIndexes[instanceIndex];\n    for (let i = 0; i < parentCount; ++i) {\n      const parentId = parentIds[parentIndex + i];\n      // Stop the traversal when the instance has no parent (its parentId equals itself)\n      // else add the parent to the stack to continue the traversal.\n      if (parentId !== instanceIndex) {\n        stack.push(parentId);\n      }\n    }\n  }\n}\n\nfunction traverseHierarchySingleParent(\n  hierarchy,\n  instanceIndex,\n  endConditionCallback\n) {\n  let hasParent = true;\n  while (hasParent) {\n    const result = endConditionCallback(hierarchy, instanceIndex);\n    if (defined(result)) {\n      // The end condition was met, stop the traversal and return the result\n      return result;\n    }\n    const parentId = hierarchy._parentIds[instanceIndex];\n    hasParent = parentId !== instanceIndex;\n    instanceIndex = parentId;\n  }\n}\n\nfunction traverseHierarchy(hierarchy, instanceIndex, endConditionCallback) {\n  // Traverse over the hierarchy and process each instance with the endConditionCallback.\n  // When the endConditionCallback returns a value, the traversal stops and that value is returned.\n  const parentCounts = hierarchy._parentCounts;\n  const parentIds = hierarchy._parentIds;\n  if (!defined(parentIds)) {\n    return endConditionCallback(hierarchy, instanceIndex);\n  } else if (defined(parentCounts)) {\n    return traverseHierarchyMultipleParents(\n      hierarchy,\n      instanceIndex,\n      endConditionCallback\n    );\n  }\n  return traverseHierarchySingleParent(\n    hierarchy,\n    instanceIndex,\n    endConditionCallback\n  );\n}\n\n/**\n * Returns whether the feature has this property.\n *\n * @param {number} batchId the batch ID of the feature\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {boolean} Whether the feature has this property.\n * @private\n */\nBatchTableHierarchy.prototype.hasProperty = function (batchId, propertyId) {\n  const result = traverseHierarchy(this, batchId, function (\n    hierarchy,\n    instanceIndex\n  ) {\n    const classId = hierarchy._classIds[instanceIndex];\n    const instances = hierarchy._classes[classId].instances;\n    if (defined(instances[propertyId])) {\n      return true;\n    }\n  });\n  return defined(result);\n};\n\n/**\n * Returns whether any feature has this property.\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {boolean} Whether any feature has this property.\n * @private\n */\nBatchTableHierarchy.prototype.propertyExists = function (propertyId) {\n  const classes = this._classes;\n  const classesLength = classes.length;\n  for (let i = 0; i < classesLength; ++i) {\n    const instances = classes[i].instances;\n    if (defined(instances[propertyId])) {\n      return true;\n    }\n  }\n  return false;\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {number} batchId the batch ID of the feature\n * @param {number} index The index of the entity.\n * @param {string[]} [results] An array into which to store the results.\n * @returns {string[]} The property IDs.\n * @private\n */\nBatchTableHierarchy.prototype.getPropertyIds = function (batchId, results) {\n  results = defined(results) ? results : [];\n  results.length = 0;\n\n  traverseHierarchy(this, batchId, function (hierarchy, instanceIndex) {\n    const classId = hierarchy._classIds[instanceIndex];\n    const instances = hierarchy._classes[classId].instances;\n    for (const name in instances) {\n      if (instances.hasOwnProperty(name)) {\n        if (results.indexOf(name) === -1) {\n          results.push(name);\n        }\n      }\n    }\n  });\n\n  return results;\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n *\n * @param {number} batchId the batch ID of the feature\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n * @private\n */\nBatchTableHierarchy.prototype.getProperty = function (batchId, propertyId) {\n  return traverseHierarchy(this, batchId, function (hierarchy, instanceIndex) {\n    const classId = hierarchy._classIds[instanceIndex];\n    const instanceClass = hierarchy._classes[classId];\n    const indexInClass = hierarchy._classIndexes[instanceIndex];\n    const propertyValues = instanceClass.instances[propertyId];\n    if (defined(propertyValues)) {\n      if (defined(propertyValues.typedArray)) {\n        return getBinaryProperty(propertyValues, indexInClass);\n      }\n      return clone(propertyValues[indexInClass], true);\n    }\n  });\n};\n\nfunction getBinaryProperty(binaryProperty, index) {\n  const typedArray = binaryProperty.typedArray;\n  const componentCount = binaryProperty.componentCount;\n  if (componentCount === 1) {\n    return typedArray[index];\n  }\n  return binaryProperty.type.unpack(typedArray, index * componentCount);\n}\n\n/**\n * Sets the value of the property with the given ID. Only properties of the\n * instance may be set; parent properties may not be set.\n *\n * @param {number} batchId The batchId of the feature\n * @param {string} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n *\n * @exception {DeveloperError} when setting an inherited property\n * @private\n */\nBatchTableHierarchy.prototype.setProperty = function (\n  batchId,\n  propertyId,\n  value\n) {\n  const result = traverseHierarchy(this, batchId, function (\n    hierarchy,\n    instanceIndex\n  ) {\n    const classId = hierarchy._classIds[instanceIndex];\n    const instanceClass = hierarchy._classes[classId];\n    const indexInClass = hierarchy._classIndexes[instanceIndex];\n    const propertyValues = instanceClass.instances[propertyId];\n    if (defined(propertyValues)) {\n      //>>includeStart('debug', pragmas.debug);\n      if (instanceIndex !== batchId) {\n        throw new DeveloperError(\n          `Inherited property \"${propertyId}\" is read-only.`\n        );\n      }\n      //>>includeEnd('debug');\n      if (defined(propertyValues.typedArray)) {\n        setBinaryProperty(propertyValues, indexInClass, value);\n      } else {\n        propertyValues[indexInClass] = clone(value, true);\n      }\n      return true;\n    }\n  });\n  return defined(result);\n};\n\nfunction setBinaryProperty(binaryProperty, index, value) {\n  const typedArray = binaryProperty.typedArray;\n  const componentCount = binaryProperty.componentCount;\n  if (componentCount === 1) {\n    typedArray[index] = value;\n  } else {\n    binaryProperty.type.pack(value, typedArray, index * componentCount);\n  }\n}\n\n/**\n * Check if a feature belongs to a class with the given name\n *\n * @param {number} batchId The batch ID of the feature\n * @param {string} className The name of the class\n * @return {boolean} <code>true</code> if the feature belongs to the class given by className, or <code>false</code> otherwise\n * @private\n */\nBatchTableHierarchy.prototype.isClass = function (batchId, className) {\n  // PERFORMANCE_IDEA : cache results in the ancestor classes to speed up this check if this area becomes a hotspot\n  // PERFORMANCE_IDEA : treat class names as integers for faster comparisons\n  const result = traverseHierarchy(this, batchId, function (\n    hierarchy,\n    instanceIndex\n  ) {\n    const classId = hierarchy._classIds[instanceIndex];\n    const instanceClass = hierarchy._classes[classId];\n    if (instanceClass.name === className) {\n      return true;\n    }\n  });\n  return defined(result);\n};\n\n/**\n * Get the name of the class a given feature belongs to\n *\n * @param {number} batchId The batch ID of the feature\n * @return {string} The name of the class this feature belongs to\n */\nBatchTableHierarchy.prototype.getClassName = function (batchId) {\n  const classId = this._classIds[batchId];\n  const instanceClass = this._classes[classId];\n  return instanceClass.name;\n};\n\nexport default BatchTableHierarchy;\n", "/**\n * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from\n * the original feature, e.g. glTF material or per-point color in the tile.\n * <p>\n * When <code>REPLACE</code> or <code>MIX</code> are used and the source color is a glTF material, the technique must assign the\n * <code>_3DTILESDIFFUSE</code> semantic to the diffuse color parameter. Otherwise only <code>HIGHLIGHT</code> is supported.\n * </p>\n * <p>\n * A feature whose color evaluates to white (1.0, 1.0, 1.0) is always rendered without color blending, regardless of the\n * tileset's color blend mode.\n * </p>\n * <pre><code>\n * \"techniques\": {\n *   \"technique0\": {\n *     \"parameters\": {\n *       \"diffuse\": {\n *         \"semantic\": \"_3DTILESDIFFUSE\",\n *         \"type\": 35666\n *       }\n *     }\n *   }\n * }\n * </code></pre>\n *\n * @enum {number}\n */\nconst Cesium3DTileColorBlendMode = {\n  /**\n   * Multiplies the source color by the feature color.\n   *\n   * @type {number}\n   * @constant\n   */\n  HIGHLIGHT: 0,\n\n  /**\n   * Replaces the source color with the feature color.\n   *\n   * @type {number}\n   * @constant\n   */\n  REPLACE: 1,\n\n  /**\n   * Blends the source color and feature color together.\n   *\n   * @type {number}\n   * @constant\n   */\n  MIX: 2,\n};\nexport default Object.freeze(Cesium3DTileColorBlendMode);\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport BatchTexture from \"./BatchTexture.js\";\nimport BatchTableHierarchy from \"./BatchTableHierarchy.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport Cesium3DTileColorBlendMode from \"./Cesium3DTileColorBlendMode.js\";\nimport CullFace from \"./CullFace.js\";\nimport getBinaryAccessor from \"./getBinaryAccessor.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\n\nconst DEFAULT_COLOR_VALUE = BatchTexture.DEFAULT_COLOR_VALUE;\nconst DEFAULT_SHOW_VALUE = BatchTexture.DEFAULT_SHOW_VALUE;\n\n/**\n * @private\n * @constructor\n */\nfunction Cesium3DTileBatchTable(\n  content,\n  featuresLength,\n  batchTableJson,\n  batchTableBinary,\n  colorChangedCallback\n) {\n  /**\n   * @readonly\n   */\n  this.featuresLength = featuresLength;\n\n  let extensions;\n  if (defined(batchTableJson)) {\n    extensions = batchTableJson.extensions;\n  }\n  this._extensions = defaultValue(extensions, {});\n\n  const properties = initializeProperties(batchTableJson);\n  this._properties = properties;\n\n  this._batchTableHierarchy = initializeHierarchy(\n    this,\n    batchTableJson,\n    batchTableBinary\n  );\n\n  const binaryProperties = getBinaryProperties(\n    featuresLength,\n    properties,\n    batchTableBinary\n  );\n  this._binaryPropertiesByteLength = countBinaryPropertyMemory(\n    binaryProperties\n  );\n  this._batchTableBinaryProperties = binaryProperties;\n\n  this._content = content;\n\n  this._batchTexture = new BatchTexture({\n    featuresLength: featuresLength,\n    colorChangedCallback: colorChangedCallback,\n    owner: content,\n    statistics: content.tileset.statistics,\n  });\n}\n\n// This can be overridden for testing purposes\nCesium3DTileBatchTable._deprecationWarning = deprecationWarning;\n\nObject.defineProperties(Cesium3DTileBatchTable.prototype, {\n  /**\n   * Size of the batch table, including the batch table hierarchy's binary\n   * buffers and any binary properties. JSON data is not counted.\n   *\n   * @memberof Cesium3DTileBatchTable.prototype\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  batchTableByteLength: {\n    get: function () {\n      let totalByteLength = this._binaryPropertiesByteLength;\n\n      if (defined(this._batchTableHierarchy)) {\n        totalByteLength += this._batchTableHierarchy.byteLength;\n      }\n\n      totalByteLength += this._batchTexture.byteLength;\n\n      return totalByteLength;\n    },\n  },\n});\n\nfunction initializeProperties(jsonHeader) {\n  const properties = {};\n\n  if (!defined(jsonHeader)) {\n    return properties;\n  }\n\n  for (const propertyName in jsonHeader) {\n    if (\n      jsonHeader.hasOwnProperty(propertyName) &&\n      propertyName !== \"HIERARCHY\" && // Deprecated HIERARCHY property\n      propertyName !== \"extensions\" &&\n      propertyName !== \"extras\"\n    ) {\n      properties[propertyName] = clone(jsonHeader[propertyName], true);\n    }\n  }\n\n  return properties;\n}\n\nfunction initializeHierarchy(batchTable, jsonHeader, binaryBody) {\n  if (!defined(jsonHeader)) {\n    return;\n  }\n\n  let hierarchy = batchTable._extensions[\"3DTILES_batch_table_hierarchy\"];\n\n  const legacyHierarchy = jsonHeader.HIERARCHY;\n  if (defined(legacyHierarchy)) {\n    Cesium3DTileBatchTable._deprecationWarning(\n      \"batchTableHierarchyExtension\",\n      \"The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead.\"\n    );\n    batchTable._extensions[\"3DTILES_batch_table_hierarchy\"] = legacyHierarchy;\n    hierarchy = legacyHierarchy;\n  }\n\n  if (!defined(hierarchy)) {\n    return;\n  }\n\n  return new BatchTableHierarchy({\n    extension: hierarchy,\n    binaryBody: binaryBody,\n  });\n}\n\nfunction getBinaryProperties(featuresLength, properties, binaryBody) {\n  let binaryProperties;\n  for (const name in properties) {\n    if (properties.hasOwnProperty(name)) {\n      const property = properties[name];\n      const byteOffset = property.byteOffset;\n      if (defined(byteOffset)) {\n        // This is a binary property\n        const componentType = property.componentType;\n        const type = property.type;\n        if (!defined(componentType)) {\n          throw new RuntimeError(\"componentType is required.\");\n        }\n        if (!defined(type)) {\n          throw new RuntimeError(\"type is required.\");\n        }\n        if (!defined(binaryBody)) {\n          throw new RuntimeError(\n            `Property ${name} requires a batch table binary.`\n          );\n        }\n\n        const binaryAccessor = getBinaryAccessor(property);\n        const componentCount = binaryAccessor.componentsPerAttribute;\n        const classType = binaryAccessor.classType;\n        const typedArray = binaryAccessor.createArrayBufferView(\n          binaryBody.buffer,\n          binaryBody.byteOffset + byteOffset,\n          featuresLength\n        );\n\n        if (!defined(binaryProperties)) {\n          binaryProperties = {};\n        }\n\n        // Store any information needed to access the binary data, including the typed array,\n        // componentCount (e.g. a VEC4 would be 4), and the type used to pack and unpack (e.g. Cartesian4).\n        binaryProperties[name] = {\n          typedArray: typedArray,\n          componentCount: componentCount,\n          type: classType,\n        };\n      }\n    }\n  }\n  return binaryProperties;\n}\n\nfunction countBinaryPropertyMemory(binaryProperties) {\n  if (!defined(binaryProperties)) {\n    return 0;\n  }\n\n  let byteLength = 0;\n  for (const name in binaryProperties) {\n    if (binaryProperties.hasOwnProperty(name)) {\n      byteLength += binaryProperties[name].typedArray.byteLength;\n    }\n  }\n  return byteLength;\n}\n\nCesium3DTileBatchTable.getBinaryProperties = function (\n  featuresLength,\n  batchTableJson,\n  batchTableBinary\n) {\n  return getBinaryProperties(featuresLength, batchTableJson, batchTableBinary);\n};\n\nCesium3DTileBatchTable.prototype.setShow = function (batchId, show) {\n  this._batchTexture.setShow(batchId, show);\n};\n\nCesium3DTileBatchTable.prototype.setAllShow = function (show) {\n  this._batchTexture.setAllShow(show);\n};\n\nCesium3DTileBatchTable.prototype.getShow = function (batchId) {\n  return this._batchTexture.getShow(batchId);\n};\n\nCesium3DTileBatchTable.prototype.setColor = function (batchId, color) {\n  this._batchTexture.setColor(batchId, color);\n};\n\nCesium3DTileBatchTable.prototype.setAllColor = function (color) {\n  this._batchTexture.setAllColor(color);\n};\n\nCesium3DTileBatchTable.prototype.getColor = function (batchId, result) {\n  return this._batchTexture.getColor(batchId, result);\n};\n\nCesium3DTileBatchTable.prototype.getPickColor = function (batchId) {\n  return this._batchTexture.getPickColor(batchId);\n};\n\nconst scratchColor = new Color();\n\nCesium3DTileBatchTable.prototype.applyStyle = function (style) {\n  if (!defined(style)) {\n    this.setAllColor(DEFAULT_COLOR_VALUE);\n    this.setAllShow(DEFAULT_SHOW_VALUE);\n    return;\n  }\n\n  const content = this._content;\n  const length = this.featuresLength;\n  for (let i = 0; i < length; ++i) {\n    const feature = content.getFeature(i);\n    const color = defined(style.color)\n      ? defaultValue(\n          style.color.evaluateColor(feature, scratchColor),\n          DEFAULT_COLOR_VALUE\n        )\n      : DEFAULT_COLOR_VALUE;\n    const show = defined(style.show)\n      ? defaultValue(style.show.evaluate(feature), DEFAULT_SHOW_VALUE)\n      : DEFAULT_SHOW_VALUE;\n    this.setColor(i, color);\n    this.setShow(i, show);\n  }\n};\n\nfunction getBinaryProperty(binaryProperty, index) {\n  const typedArray = binaryProperty.typedArray;\n  const componentCount = binaryProperty.componentCount;\n  if (componentCount === 1) {\n    return typedArray[index];\n  }\n  return binaryProperty.type.unpack(typedArray, index * componentCount);\n}\n\nfunction setBinaryProperty(binaryProperty, index, value) {\n  const typedArray = binaryProperty.typedArray;\n  const componentCount = binaryProperty.componentCount;\n  if (componentCount === 1) {\n    typedArray[index] = value;\n  } else {\n    binaryProperty.type.pack(value, typedArray, index * componentCount);\n  }\n}\n\nfunction checkBatchId(batchId, featuresLength) {\n  if (!defined(batchId) || batchId < 0 || batchId >= featuresLength) {\n    throw new DeveloperError(\n      `batchId is required and must be between zero and featuresLength - 1 (${featuresLength}` -\n        +\").\"\n    );\n  }\n}\n\nCesium3DTileBatchTable.prototype.isClass = function (batchId, className) {\n  //>>includeStart('debug', pragmas.debug);\n  checkBatchId(batchId, this.featuresLength);\n  Check.typeOf.string(\"className\", className);\n  //>>includeEnd('debug');\n\n  const hierarchy = this._batchTableHierarchy;\n  if (!defined(hierarchy)) {\n    return false;\n  }\n\n  return hierarchy.isClass(batchId, className);\n};\n\nCesium3DTileBatchTable.prototype.isExactClass = function (batchId, className) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"className\", className);\n  //>>includeEnd('debug');\n\n  return this.getExactClassName(batchId) === className;\n};\n\nCesium3DTileBatchTable.prototype.getExactClassName = function (batchId) {\n  //>>includeStart('debug', pragmas.debug);\n  checkBatchId(batchId, this.featuresLength);\n  //>>includeEnd('debug');\n\n  const hierarchy = this._batchTableHierarchy;\n  if (!defined(hierarchy)) {\n    return undefined;\n  }\n\n  return hierarchy.getClassName(batchId);\n};\n\nCesium3DTileBatchTable.prototype.hasProperty = function (batchId, name) {\n  //>>includeStart('debug', pragmas.debug);\n  checkBatchId(batchId, this.featuresLength);\n  Check.typeOf.string(\"name\", name);\n  //>>includeEnd('debug');\n\n  return (\n    defined(this._properties[name]) ||\n    (defined(this._batchTableHierarchy) &&\n      this._batchTableHierarchy.hasProperty(batchId, name))\n  );\n};\n\n/**\n * @private\n */\nCesium3DTileBatchTable.prototype.hasPropertyBySemantic = function () {\n  // Cesium 3D Tiles 1.0 formats do not have semantics\n  return false;\n};\n\nCesium3DTileBatchTable.prototype.getPropertyIds = function (batchId, results) {\n  //>>includeStart('debug', pragmas.debug);\n  checkBatchId(batchId, this.featuresLength);\n  //>>includeEnd('debug');\n\n  results = defined(results) ? results : [];\n  results.length = 0;\n\n  const scratchPropertyIds = Object.keys(this._properties);\n  results.push.apply(results, scratchPropertyIds);\n\n  if (defined(this._batchTableHierarchy)) {\n    results.push.apply(\n      results,\n      this._batchTableHierarchy.getPropertyIds(batchId, scratchPropertyIds)\n    );\n  }\n\n  return results;\n};\n\n/**\n * @private\n */\nCesium3DTileBatchTable.prototype.getPropertyBySemantic = function (\n  batchId,\n  name\n) {\n  // Cesium 3D Tiles 1.0 formats do not have semantics\n  return undefined;\n};\n\nCesium3DTileBatchTable.prototype.getProperty = function (batchId, name) {\n  //>>includeStart('debug', pragmas.debug);\n  checkBatchId(batchId, this.featuresLength);\n  Check.typeOf.string(\"name\", name);\n  //>>includeEnd('debug');\n\n  if (defined(this._batchTableBinaryProperties)) {\n    const binaryProperty = this._batchTableBinaryProperties[name];\n    if (defined(binaryProperty)) {\n      return getBinaryProperty(binaryProperty, batchId);\n    }\n  }\n\n  const propertyValues = this._properties[name];\n  if (defined(propertyValues)) {\n    return clone(propertyValues[batchId], true);\n  }\n\n  if (defined(this._batchTableHierarchy)) {\n    const hierarchyProperty = this._batchTableHierarchy.getProperty(\n      batchId,\n      name\n    );\n    if (defined(hierarchyProperty)) {\n      return hierarchyProperty;\n    }\n  }\n\n  return undefined;\n};\n\nCesium3DTileBatchTable.prototype.setProperty = function (batchId, name, value) {\n  const featuresLength = this.featuresLength;\n  //>>includeStart('debug', pragmas.debug);\n  checkBatchId(batchId, featuresLength);\n  Check.typeOf.string(\"name\", name);\n  //>>includeEnd('debug');\n\n  if (defined(this._batchTableBinaryProperties)) {\n    const binaryProperty = this._batchTableBinaryProperties[name];\n    if (defined(binaryProperty)) {\n      setBinaryProperty(binaryProperty, batchId, value);\n      return;\n    }\n  }\n\n  if (defined(this._batchTableHierarchy)) {\n    if (this._batchTableHierarchy.setProperty(batchId, name, value)) {\n      return;\n    }\n  }\n\n  let propertyValues = this._properties[name];\n  if (!defined(propertyValues)) {\n    // Property does not exist. Create it.\n    this._properties[name] = new Array(featuresLength);\n    propertyValues = this._properties[name];\n  }\n\n  propertyValues[batchId] = clone(value, true);\n};\n\nfunction getGlslComputeSt(batchTable) {\n  // GLSL batchId is zero-based: [0, featuresLength - 1]\n  if (batchTable._batchTexture.textureDimensions.y === 1) {\n    return (\n      \"uniform vec4 tile_textureStep; \\n\" +\n      \"vec2 computeSt(float batchId) \\n\" +\n      \"{ \\n\" +\n      \"    float stepX = tile_textureStep.x; \\n\" +\n      \"    float centerX = tile_textureStep.y; \\n\" +\n      \"    return vec2(centerX + (batchId * stepX), 0.5); \\n\" +\n      \"} \\n\"\n    );\n  }\n\n  return (\n    \"uniform vec4 tile_textureStep; \\n\" +\n    \"uniform vec2 tile_textureDimensions; \\n\" +\n    \"vec2 computeSt(float batchId) \\n\" +\n    \"{ \\n\" +\n    \"    float stepX = tile_textureStep.x; \\n\" +\n    \"    float centerX = tile_textureStep.y; \\n\" +\n    \"    float stepY = tile_textureStep.z; \\n\" +\n    \"    float centerY = tile_textureStep.w; \\n\" +\n    \"    float xId = mod(batchId, tile_textureDimensions.x); \\n\" +\n    \"    float yId = floor(batchId / tile_textureDimensions.x); \\n\" +\n    \"    return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \\n\" +\n    \"} \\n\"\n  );\n}\n\nCesium3DTileBatchTable.prototype.getVertexShaderCallback = function (\n  handleTranslucent,\n  batchIdAttributeName,\n  diffuseAttributeOrUniformName\n) {\n  if (this.featuresLength === 0) {\n    return;\n  }\n\n  const that = this;\n  return function (source) {\n    // If the color blend mode is HIGHLIGHT, the highlight color will always be applied in the fragment shader.\n    // No need to apply the highlight color in the vertex shader as well.\n    const renamedSource = modifyDiffuse(\n      source,\n      diffuseAttributeOrUniformName,\n      false\n    );\n    let newMain;\n\n    if (ContextLimits.maximumVertexTextureImageUnits > 0) {\n      // When VTF is supported, perform per-feature show/hide in the vertex shader\n      newMain = \"\";\n      if (handleTranslucent) {\n        newMain += \"uniform bool tile_translucentCommand; \\n\";\n      }\n      newMain +=\n        `${\n          \"uniform sampler2D tile_batchTexture; \\n\" +\n          \"out vec4 tile_featureColor; \\n\" +\n          \"out vec2 tile_featureSt; \\n\" +\n          \"void main() \\n\" +\n          \"{ \\n\" +\n          \"    vec2 st = computeSt(\"\n        }${batchIdAttributeName}); \\n` +\n        `    vec4 featureProperties = texture(tile_batchTexture, st); \\n` +\n        `    tile_color(featureProperties); \\n` +\n        `    float show = ceil(featureProperties.a); \\n` + // 0 - false, non-zero - true\n        `    gl_Position *= show; \\n`; // Per-feature show/hide\n      if (handleTranslucent) {\n        newMain +=\n          \"    bool isStyleTranslucent = (featureProperties.a != 1.0); \\n\" +\n          \"    if (czm_pass == czm_passTranslucent) \\n\" +\n          \"    { \\n\" +\n          \"        if (!isStyleTranslucent && !tile_translucentCommand) \\n\" + // Do not render opaque features in the translucent pass\n          \"        { \\n\" +\n          \"            gl_Position *= 0.0; \\n\" +\n          \"        } \\n\" +\n          \"    } \\n\" +\n          \"    else \\n\" +\n          \"    { \\n\" +\n          \"        if (isStyleTranslucent) \\n\" + // Do not render translucent features in the opaque pass\n          \"        { \\n\" +\n          \"            gl_Position *= 0.0; \\n\" +\n          \"        } \\n\" +\n          \"    } \\n\";\n      }\n      newMain +=\n        \"    tile_featureColor = featureProperties; \\n\" +\n        \"    tile_featureSt = st; \\n\" +\n        \"}\";\n    } else {\n      // When VTF is not supported, color blend mode MIX will look incorrect due to the feature's color not being available in the vertex shader\n      newMain =\n        `${\n          \"out vec2 tile_featureSt; \\n\" +\n          \"void main() \\n\" +\n          \"{ \\n\" +\n          \"    tile_color(vec4(1.0)); \\n\" +\n          \"    tile_featureSt = computeSt(\"\n        }${batchIdAttributeName}); \\n` + `}`;\n    }\n\n    return `${renamedSource}\\n${getGlslComputeSt(that)}${newMain}`;\n  };\n};\n\nfunction getDefaultShader(source, applyHighlight) {\n  source = ShaderSource.replaceMain(source, \"tile_main\");\n\n  if (!applyHighlight) {\n    return (\n      `${source}void tile_color(vec4 tile_featureColor) \\n` +\n      `{ \\n` +\n      `    tile_main(); \\n` +\n      `} \\n`\n    );\n  }\n\n  // The color blend mode is intended for the RGB channels so alpha is always just multiplied.\n  // out_FragColor is multiplied by the tile color only when tile_colorBlend is 0.0 (highlight)\n  return (\n    `${source}uniform float tile_colorBlend; \\n` +\n    `void tile_color(vec4 tile_featureColor) \\n` +\n    `{ \\n` +\n    `    tile_main(); \\n` +\n    `    tile_featureColor = czm_gammaCorrect(tile_featureColor); \\n` +\n    `    out_FragColor.a *= tile_featureColor.a; \\n` +\n    `    float highlight = ceil(tile_colorBlend); \\n` +\n    `    out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \\n` +\n    `} \\n`\n  );\n}\n\nfunction replaceDiffuseTextureCalls(source, diffuseAttributeOrUniformName) {\n  const functionCall = `texture(${diffuseAttributeOrUniformName}`;\n\n  let fromIndex = 0;\n  let startIndex = source.indexOf(functionCall, fromIndex);\n  let endIndex;\n\n  while (startIndex > -1) {\n    let nestedLevel = 0;\n    for (let i = startIndex; i < source.length; ++i) {\n      const character = source.charAt(i);\n      if (character === \"(\") {\n        ++nestedLevel;\n      } else if (character === \")\") {\n        --nestedLevel;\n        if (nestedLevel === 0) {\n          endIndex = i + 1;\n          break;\n        }\n      }\n    }\n    const extractedFunction = source.slice(startIndex, endIndex);\n    const replacedFunction = `tile_diffuse_final(${extractedFunction}, tile_diffuse)`;\n\n    source =\n      source.slice(0, startIndex) + replacedFunction + source.slice(endIndex);\n    fromIndex = startIndex + replacedFunction.length;\n    startIndex = source.indexOf(functionCall, fromIndex);\n  }\n\n  return source;\n}\n\nfunction modifyDiffuse(source, diffuseAttributeOrUniformName, applyHighlight) {\n  // If the glTF does not specify the _3DTILESDIFFUSE semantic, return the default shader.\n  // Otherwise if _3DTILESDIFFUSE is defined prefer the shader below that can switch the color mode at runtime.\n  if (!defined(diffuseAttributeOrUniformName)) {\n    return getDefaultShader(source, applyHighlight);\n  }\n\n  // Find the diffuse uniform. Examples matches:\n  //   uniform vec3 u_diffuseColor;\n  //   uniform sampler2D diffuseTexture;\n  let regex = new RegExp(\n    `(uniform|attribute|in)\\\\s+(vec[34]|sampler2D)\\\\s+${diffuseAttributeOrUniformName};`\n  );\n  const uniformMatch = source.match(regex);\n\n  if (!defined(uniformMatch)) {\n    // Could not find uniform declaration of type vec3, vec4, or sampler2D\n    return getDefaultShader(source, applyHighlight);\n  }\n\n  const declaration = uniformMatch[0];\n  const type = uniformMatch[2];\n\n  source = ShaderSource.replaceMain(source, \"tile_main\");\n  source = source.replace(declaration, \"\"); // Remove uniform declaration for now so the replace below doesn't affect it\n\n  // If the tile color is white, use the source color. This implies the feature has not been styled.\n  // Highlight: tile_colorBlend is 0.0 and the source color is used\n  // Replace: tile_colorBlend is 1.0 and the tile color is used\n  // Mix: tile_colorBlend is between 0.0 and 1.0, causing the source color and tile color to mix\n  const finalDiffuseFunction =\n    \"bool isWhite(vec3 color) \\n\" +\n    \"{ \\n\" +\n    \"    return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); \\n\" +\n    \"} \\n\" +\n    \"vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) \\n\" +\n    \"{ \\n\" +\n    \"    vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); \\n\" +\n    \"    vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; \\n\" +\n    \"    return vec4(diffuse.rgb, sourceDiffuse.a); \\n\" +\n    \"} \\n\";\n\n  // The color blend mode is intended for the RGB channels so alpha is always just multiplied.\n  // out_FragColor is multiplied by the tile color only when tile_colorBlend is 0.0 (highlight)\n  const highlight =\n    \"    tile_featureColor = czm_gammaCorrect(tile_featureColor); \\n\" +\n    \"    out_FragColor.a *= tile_featureColor.a; \\n\" +\n    \"    float highlight = ceil(tile_colorBlend); \\n\" +\n    \"    out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \\n\";\n\n  let setColor;\n  if (type === \"vec3\" || type === \"vec4\") {\n    const sourceDiffuse =\n      type === \"vec3\"\n        ? `vec4(${diffuseAttributeOrUniformName}, 1.0)`\n        : diffuseAttributeOrUniformName;\n    const replaceDiffuse =\n      type === \"vec3\" ? \"tile_diffuse.xyz\" : \"tile_diffuse\";\n    regex = new RegExp(diffuseAttributeOrUniformName, \"g\");\n    source = source.replace(regex, replaceDiffuse);\n    setColor =\n      `    vec4 source = ${sourceDiffuse}; \\n` +\n      `    tile_diffuse = tile_diffuse_final(source, tile_featureColor); \\n` +\n      `    tile_main(); \\n`;\n  } else if (type === \"sampler2D\") {\n    // Handles any number of nested parentheses\n    // E.g. texture(u_diffuse, uv)\n    // E.g. texture(u_diffuse, computeUV(index))\n    source = replaceDiffuseTextureCalls(source, diffuseAttributeOrUniformName);\n    setColor =\n      \"    tile_diffuse = tile_featureColor; \\n\" + \"    tile_main(); \\n\";\n  }\n\n  source =\n    `${\n      \"uniform float tile_colorBlend; \\n\" + \"vec4 tile_diffuse = vec4(1.0); \\n\"\n    }${finalDiffuseFunction}${declaration}\\n${source}\\n` +\n    `void tile_color(vec4 tile_featureColor) \\n` +\n    `{ \\n${setColor}`;\n\n  if (applyHighlight) {\n    source += highlight;\n  }\n\n  source += \"} \\n\";\n  return source;\n}\n\nCesium3DTileBatchTable.prototype.getFragmentShaderCallback = function (\n  handleTranslucent,\n  diffuseAttributeOrUniformName,\n  hasPremultipliedAlpha\n) {\n  if (this.featuresLength === 0) {\n    return;\n  }\n  return function (source) {\n    source = modifyDiffuse(source, diffuseAttributeOrUniformName, true);\n    if (ContextLimits.maximumVertexTextureImageUnits > 0) {\n      // When VTF is supported, per-feature show/hide already happened in the fragment shader\n      source +=\n        \"uniform sampler2D tile_pickTexture; \\n\" +\n        \"in vec2 tile_featureSt; \\n\" +\n        \"in vec4 tile_featureColor; \\n\" +\n        \"void main() \\n\" +\n        \"{ \\n\" +\n        \"    tile_color(tile_featureColor); \\n\";\n\n      if (hasPremultipliedAlpha) {\n        source += \"    out_FragColor.rgb *= out_FragColor.a; \\n\";\n      }\n\n      source += \"}\";\n    } else {\n      if (handleTranslucent) {\n        source += \"uniform bool tile_translucentCommand; \\n\";\n      }\n      source +=\n        \"uniform sampler2D tile_pickTexture; \\n\" +\n        \"uniform sampler2D tile_batchTexture; \\n\" +\n        \"in vec2 tile_featureSt; \\n\" +\n        \"void main() \\n\" +\n        \"{ \\n\" +\n        \"    vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); \\n\" +\n        \"    if (featureProperties.a == 0.0) { \\n\" + // show: alpha == 0 - false, non-zeo - true\n        \"        discard; \\n\" +\n        \"    } \\n\";\n\n      if (handleTranslucent) {\n        source +=\n          \"    bool isStyleTranslucent = (featureProperties.a != 1.0); \\n\" +\n          \"    if (czm_pass == czm_passTranslucent) \\n\" +\n          \"    { \\n\" +\n          \"        if (!isStyleTranslucent && !tile_translucentCommand) \\n\" + // Do not render opaque features in the translucent pass\n          \"        { \\n\" +\n          \"            discard; \\n\" +\n          \"        } \\n\" +\n          \"    } \\n\" +\n          \"    else \\n\" +\n          \"    { \\n\" +\n          \"        if (isStyleTranslucent) \\n\" + // Do not render translucent features in the opaque pass\n          \"        { \\n\" +\n          \"            discard; \\n\" +\n          \"        } \\n\" +\n          \"    } \\n\";\n      }\n\n      source += \"    tile_color(featureProperties); \\n\";\n\n      if (hasPremultipliedAlpha) {\n        source += \"    out_FragColor.rgb *= out_FragColor.a; \\n\";\n      }\n\n      source += \"} \\n\";\n    }\n    return source;\n  };\n};\n\nCesium3DTileBatchTable.prototype.getClassificationFragmentShaderCallback = function () {\n  if (this.featuresLength === 0) {\n    return;\n  }\n  return function (source) {\n    source = ShaderSource.replaceMain(source, \"tile_main\");\n    if (ContextLimits.maximumVertexTextureImageUnits > 0) {\n      // When VTF is supported, per-feature show/hide already happened in the fragment shader\n      source +=\n        \"uniform sampler2D tile_pickTexture;\\n\" +\n        \"in vec2 tile_featureSt; \\n\" +\n        \"in vec4 tile_featureColor; \\n\" +\n        \"void main() \\n\" +\n        \"{ \\n\" +\n        \"    tile_main(); \\n\" +\n        \"    out_FragColor = tile_featureColor; \\n\" +\n        \"    out_FragColor.rgb *= out_FragColor.a; \\n\" +\n        \"}\";\n    } else {\n      source +=\n        \"uniform sampler2D tile_batchTexture; \\n\" +\n        \"uniform sampler2D tile_pickTexture;\\n\" +\n        \"in vec2 tile_featureSt; \\n\" +\n        \"void main() \\n\" +\n        \"{ \\n\" +\n        \"    tile_main(); \\n\" +\n        \"    vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); \\n\" +\n        \"    if (featureProperties.a == 0.0) { \\n\" + // show: alpha == 0 - false, non-zero - true\n        \"        discard; \\n\" +\n        \"    } \\n\" +\n        \"    out_FragColor = featureProperties; \\n\" +\n        \"    out_FragColor.rgb *= out_FragColor.a; \\n\" +\n        \"} \\n\";\n    }\n    return source;\n  };\n};\n\nfunction getColorBlend(batchTable) {\n  const tileset = batchTable._content.tileset;\n  const colorBlendMode = tileset.colorBlendMode;\n  const colorBlendAmount = tileset.colorBlendAmount;\n  if (colorBlendMode === Cesium3DTileColorBlendMode.HIGHLIGHT) {\n    return 0.0;\n  }\n  if (colorBlendMode === Cesium3DTileColorBlendMode.REPLACE) {\n    return 1.0;\n  }\n  if (colorBlendMode === Cesium3DTileColorBlendMode.MIX) {\n    // The value 0.0 is reserved for highlight, so clamp to just above 0.0.\n    return CesiumMath.clamp(colorBlendAmount, CesiumMath.EPSILON4, 1.0);\n  }\n  //>>includeStart('debug', pragmas.debug);\n  throw new DeveloperError(`Invalid color blend mode \"${colorBlendMode}\".`);\n  //>>includeEnd('debug');\n}\n\nCesium3DTileBatchTable.prototype.getUniformMapCallback = function () {\n  if (this.featuresLength === 0) {\n    return;\n  }\n\n  const that = this;\n  return function (uniformMap) {\n    const batchUniformMap = {\n      tile_batchTexture: function () {\n        // PERFORMANCE_IDEA: we could also use a custom shader that avoids the texture read.\n        return defaultValue(\n          that._batchTexture.batchTexture,\n          that._batchTexture.defaultTexture\n        );\n      },\n      tile_textureDimensions: function () {\n        return that._batchTexture.textureDimensions;\n      },\n      tile_textureStep: function () {\n        return that._batchTexture.textureStep;\n      },\n      tile_colorBlend: function () {\n        return getColorBlend(that);\n      },\n      tile_pickTexture: function () {\n        return that._batchTexture.pickTexture;\n      },\n    };\n\n    return combine(uniformMap, batchUniformMap);\n  };\n};\n\nCesium3DTileBatchTable.prototype.getPickId = function () {\n  return \"texture(tile_pickTexture, tile_featureSt)\";\n};\n\n///////////////////////////////////////////////////////////////////////////\n\nconst StyleCommandsNeeded = {\n  ALL_OPAQUE: 0,\n  ALL_TRANSLUCENT: 1,\n  OPAQUE_AND_TRANSLUCENT: 2,\n};\n\nCesium3DTileBatchTable.prototype.addDerivedCommands = function (\n  frameState,\n  commandStart\n) {\n  const commandList = frameState.commandList;\n  const commandEnd = commandList.length;\n  const tile = this._content._tile;\n  const finalResolution = tile._finalResolution;\n  const tileset = tile.tileset;\n  const bivariateVisibilityTest =\n    tileset.isSkippingLevelOfDetail &&\n    tileset.hasMixedContent &&\n    frameState.context.stencilBuffer;\n  const styleCommandsNeeded = getStyleCommandsNeeded(this);\n\n  for (let i = commandStart; i < commandEnd; ++i) {\n    const command = commandList[i];\n    if (command.pass === Pass.COMPUTE) {\n      continue;\n    }\n\n    let derivedCommands = command.derivedCommands.tileset;\n    if (!defined(derivedCommands) || command.dirty) {\n      derivedCommands = {};\n      command.derivedCommands.tileset = derivedCommands;\n      derivedCommands.originalCommand = deriveCommand(command);\n      command.dirty = false;\n    }\n    const originalCommand = derivedCommands.originalCommand;\n\n    if (\n      styleCommandsNeeded !== StyleCommandsNeeded.ALL_OPAQUE &&\n      command.pass !== Pass.TRANSLUCENT\n    ) {\n      if (!defined(derivedCommands.translucent)) {\n        derivedCommands.translucent = deriveTranslucentCommand(originalCommand);\n      }\n    }\n\n    if (\n      styleCommandsNeeded !== StyleCommandsNeeded.ALL_TRANSLUCENT &&\n      command.pass !== Pass.TRANSLUCENT\n    ) {\n      if (!defined(derivedCommands.opaque)) {\n        derivedCommands.opaque = deriveOpaqueCommand(originalCommand);\n      }\n\n      if (bivariateVisibilityTest) {\n        if (!finalResolution) {\n          if (!defined(derivedCommands.zback)) {\n            derivedCommands.zback = deriveZBackfaceCommand(\n              frameState.context,\n              originalCommand\n            );\n          }\n          tileset._backfaceCommands.push(derivedCommands.zback);\n        }\n        if (\n          !defined(derivedCommands.stencil) ||\n          tile._selectionDepth !==\n            getLastSelectionDepth(derivedCommands.stencil)\n        ) {\n          if (command.renderState.depthMask) {\n            derivedCommands.stencil = deriveStencilCommand(\n              originalCommand,\n              tile._selectionDepth\n            );\n          } else {\n            // Ignore if tile does not write depth\n            derivedCommands.stencil = derivedCommands.opaque;\n          }\n        }\n      }\n    }\n\n    const opaqueCommand = bivariateVisibilityTest\n      ? derivedCommands.stencil\n      : derivedCommands.opaque;\n    const translucentCommand = derivedCommands.translucent;\n\n    // If the command was originally opaque:\n    //    * If the styling applied to the tile is all opaque, use the opaque command\n    //      (with one additional uniform needed for the shader).\n    //    * If the styling is all translucent, use new (cached) derived commands (front\n    //      and back faces) with a translucent render state.\n    //    * If the styling causes both opaque and translucent features in this tile,\n    //      then use both sets of commands.\n    if (command.pass !== Pass.TRANSLUCENT) {\n      if (styleCommandsNeeded === StyleCommandsNeeded.ALL_OPAQUE) {\n        commandList[i] = opaqueCommand;\n      }\n      if (styleCommandsNeeded === StyleCommandsNeeded.ALL_TRANSLUCENT) {\n        commandList[i] = translucentCommand;\n      }\n      if (styleCommandsNeeded === StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT) {\n        // PERFORMANCE_IDEA: if the tile has multiple commands, we do not know what features are in what\n        // commands so this case may be overkill.\n        commandList[i] = opaqueCommand;\n        commandList.push(translucentCommand);\n      }\n    } else {\n      // Command was originally translucent so no need to derive new commands;\n      // as of now, a style can't change an originally translucent feature to\n      // opaque since the style's alpha is modulated, not a replacement.  When\n      // this changes, we need to derive new opaque commands here.\n      commandList[i] = originalCommand;\n    }\n  }\n};\n\nfunction getStyleCommandsNeeded(batchTable) {\n  const translucentFeaturesLength =\n    batchTable._batchTexture.translucentFeaturesLength;\n\n  if (translucentFeaturesLength === 0) {\n    return StyleCommandsNeeded.ALL_OPAQUE;\n  } else if (translucentFeaturesLength === batchTable.featuresLength) {\n    return StyleCommandsNeeded.ALL_TRANSLUCENT;\n  }\n\n  return StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT;\n}\n\nfunction deriveCommand(command) {\n  const derivedCommand = DrawCommand.shallowClone(command);\n\n  // Add a uniform to indicate if the original command was translucent so\n  // the shader knows not to cull vertices that were originally transparent\n  // even though their style is opaque.\n  const translucentCommand = derivedCommand.pass === Pass.TRANSLUCENT;\n\n  derivedCommand.uniformMap = defined(derivedCommand.uniformMap)\n    ? derivedCommand.uniformMap\n    : {};\n  derivedCommand.uniformMap.tile_translucentCommand = function () {\n    return translucentCommand;\n  };\n\n  return derivedCommand;\n}\n\nfunction deriveTranslucentCommand(command) {\n  const derivedCommand = DrawCommand.shallowClone(command);\n  derivedCommand.pass = Pass.TRANSLUCENT;\n  derivedCommand.renderState = getTranslucentRenderState(command.renderState);\n  return derivedCommand;\n}\n\nfunction deriveOpaqueCommand(command) {\n  const derivedCommand = DrawCommand.shallowClone(command);\n  derivedCommand.renderState = getOpaqueRenderState(command.renderState);\n  return derivedCommand;\n}\n\nfunction getLogDepthPolygonOffsetFragmentShaderProgram(context, shaderProgram) {\n  let shader = context.shaderCache.getDerivedShaderProgram(\n    shaderProgram,\n    \"zBackfaceLogDepth\"\n  );\n  if (!defined(shader)) {\n    const fs = shaderProgram.fragmentShaderSource.clone();\n    fs.defines = defined(fs.defines) ? fs.defines.slice(0) : [];\n    fs.defines.push(\"POLYGON_OFFSET\");\n\n    shader = context.shaderCache.createDerivedShaderProgram(\n      shaderProgram,\n      \"zBackfaceLogDepth\",\n      {\n        vertexShaderSource: shaderProgram.vertexShaderSource,\n        fragmentShaderSource: fs,\n        attributeLocations: shaderProgram._attributeLocations,\n      }\n    );\n  }\n\n  return shader;\n}\n\nfunction deriveZBackfaceCommand(context, command) {\n  // Write just backface depth of unresolved tiles so resolved stenciled tiles do not appear in front\n  const derivedCommand = DrawCommand.shallowClone(command);\n  const rs = clone(derivedCommand.renderState, true);\n  rs.cull.enabled = true;\n  rs.cull.face = CullFace.FRONT;\n  // Back faces do not need to write color.\n  rs.colorMask = {\n    red: false,\n    green: false,\n    blue: false,\n    alpha: false,\n  };\n  // Push back face depth away from the camera so it is less likely that back faces and front faces of the same tile\n  // intersect and overlap. This helps avoid flickering for very thin double-sided walls.\n  rs.polygonOffset = {\n    enabled: true,\n    factor: 5.0,\n    units: 5.0,\n  };\n  // Set the 3D Tiles bit\n  rs.stencilTest = StencilConstants.setCesium3DTileBit();\n  rs.stencilMask = StencilConstants.CESIUM_3D_TILE_MASK;\n\n  derivedCommand.renderState = RenderState.fromCache(rs);\n  derivedCommand.castShadows = false;\n  derivedCommand.receiveShadows = false;\n  derivedCommand.uniformMap = clone(command.uniformMap);\n\n  const polygonOffset = new Cartesian2(5.0, 5.0);\n  derivedCommand.uniformMap.u_polygonOffset = function () {\n    return polygonOffset;\n  };\n\n  // Make the log depth depth fragment write account for the polygon offset, too.\n  // Otherwise, the back face commands will cause the higher resolution\n  // tiles to disappear.\n  derivedCommand.shaderProgram = getLogDepthPolygonOffsetFragmentShaderProgram(\n    context,\n    command.shaderProgram\n  );\n  return derivedCommand;\n}\n\nfunction deriveStencilCommand(command, reference) {\n  // Tiles only draw if their selection depth is >= the tile drawn already. They write their\n  // selection depth to the stencil buffer to prevent ancestor tiles from drawing on top\n  const derivedCommand = DrawCommand.shallowClone(command);\n  const rs = clone(derivedCommand.renderState, true);\n  // Stencil test is masked to the most significant 3 bits so the reference is shifted. Writes 0 for the terrain bit\n  rs.stencilTest.enabled = true;\n  rs.stencilTest.mask = StencilConstants.SKIP_LOD_MASK;\n  rs.stencilTest.reference =\n    StencilConstants.CESIUM_3D_TILE_MASK |\n    (reference << StencilConstants.SKIP_LOD_BIT_SHIFT);\n  rs.stencilTest.frontFunction = StencilFunction.GREATER_OR_EQUAL;\n  rs.stencilTest.frontOperation.zPass = StencilOperation.REPLACE;\n  rs.stencilTest.backFunction = StencilFunction.GREATER_OR_EQUAL;\n  rs.stencilTest.backOperation.zPass = StencilOperation.REPLACE;\n  rs.stencilMask =\n    StencilConstants.CESIUM_3D_TILE_MASK | StencilConstants.SKIP_LOD_MASK;\n  derivedCommand.renderState = RenderState.fromCache(rs);\n  return derivedCommand;\n}\n\nfunction getLastSelectionDepth(stencilCommand) {\n  // Isolate the selection depth from the stencil reference.\n  const reference = stencilCommand.renderState.stencilTest.reference;\n  return (\n    (reference & StencilConstants.SKIP_LOD_MASK) >>>\n    StencilConstants.SKIP_LOD_BIT_SHIFT\n  );\n}\n\nfunction getTranslucentRenderState(renderState) {\n  const rs = clone(renderState, true);\n  rs.cull.enabled = false;\n  rs.depthTest.enabled = true;\n  rs.depthMask = false;\n  rs.blending = BlendingState.ALPHA_BLEND;\n  rs.stencilTest = StencilConstants.setCesium3DTileBit();\n  rs.stencilMask = StencilConstants.CESIUM_3D_TILE_MASK;\n\n  return RenderState.fromCache(rs);\n}\n\nfunction getOpaqueRenderState(renderState) {\n  const rs = clone(renderState, true);\n  rs.stencilTest = StencilConstants.setCesium3DTileBit();\n  rs.stencilMask = StencilConstants.CESIUM_3D_TILE_MASK;\n\n  return RenderState.fromCache(rs);\n}\n\nCesium3DTileBatchTable.prototype.update = function (tileset, frameState) {\n  this._batchTexture.update(tileset, frameState);\n};\n\nCesium3DTileBatchTable.prototype.isDestroyed = function () {\n  return false;\n};\n\nCesium3DTileBatchTable.prototype.destroy = function () {\n  this._batchTexture = this._batchTexture && this._batchTexture.destroy();\n  return destroyObject(this);\n};\nexport default Cesium3DTileBatchTable;\n", "/**\n * Describes a renderable batch of geometry.\n *\n * @alias Vector3DTileBatch\n * @constructor\n *\n * @param {object} options An object with the following properties:\n * @param {number} options.offset The offset of the batch into the indices buffer.\n * @param {number} options.count The number of indices in the batch.\n * @param {Color} options.color The color of the geometry in the batch.\n * @param {number[]} options.batchIds An array where each element is the batch id of the geometry in the batch.\n *\n * @private\n */\nfunction Vector3DTileBatch(options) {\n  /**\n   * The offset of the batch into the indices buffer.\n   * @type {number}\n   */\n  this.offset = options.offset;\n  /**\n   * The number of indices in the batch.\n   * @type {number}\n   */\n  this.count = options.count;\n  /**\n   * The color of the geometry in the batch.\n   * @type {Color}\n   */\n  this.color = options.color;\n  /**\n   * An array where each element is the batch id of the geometry in the batch.\n   * @type {number[]}\n   */\n  this.batchIds = options.batchIds;\n}\nexport default Vector3DTileBatch;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 position;\\n\\\nin float a_batchId;\\n\\\n\\n\\\nuniform mat4 u_modifiedModelViewProjection;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));\\n\\\n}\\n\\\n\";\n", "import Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * A feature of a {@link Cesium3DTileset}.\n * <p>\n * Provides access to a feature's properties stored in the tile's batch table, as well\n * as the ability to show/hide a feature and change its highlight color via\n * {@link Cesium3DTileFeature#show} and {@link Cesium3DTileFeature#color}, respectively.\n * </p>\n * <p>\n * Modifications to a <code>Cesium3DTileFeature</code> object have the lifetime of the tile's\n * content.  If the tile's content is unloaded, e.g., due to it going out of view and needing\n * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any\n * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications.\n * </p>\n * <p>\n * Do not construct this directly.  Access it through {@link Cesium3DTileContent#getFeature}\n * or picking using {@link Scene#pick}.\n * </p>\n *\n * @alias Cesium3DTileFeature\n * @constructor\n *\n * @example\n * // On mouse over, display all the properties for a feature in the console log.\n * handler.setInputAction(function(movement) {\n *     const feature = scene.pick(movement.endPosition);\n *     if (feature instanceof Cesium.Cesium3DTileFeature) {\n *         const propertyIds = feature.getPropertyIds();\n *         const length = propertyIds.length;\n *         for (let i = 0; i < length; ++i) {\n *             const propertyId = propertyIds[i];\n *             console.log(`{propertyId}: ${feature.getProperty(propertyId)}`);\n *         }\n *     }\n * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);\n */\nfunction Cesium3DTileFeature(content, batchId) {\n  this._content = content;\n  this._batchId = batchId;\n  this._color = undefined; // for calling getColor\n}\n\nObject.defineProperties(Cesium3DTileFeature.prototype, {\n  /**\n   * Gets or sets if the feature will be shown. This is set for all features\n   * when a style's show is evaluated.\n   *\n   * @memberof Cesium3DTileFeature.prototype\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  show: {\n    get: function () {\n      return this._content.batchTable.getShow(this._batchId);\n    },\n    set: function (value) {\n      this._content.batchTable.setShow(this._batchId, value);\n    },\n  },\n\n  /**\n   * Gets or sets the highlight color multiplied with the feature's color.  When\n   * this is white, the feature's color is not changed. This is set for all features\n   * when a style's color is evaluated.\n   *\n   * @memberof Cesium3DTileFeature.prototype\n   *\n   * @type {Color}\n   *\n   * @default {@link Color.WHITE}\n   */\n  color: {\n    get: function () {\n      if (!defined(this._color)) {\n        this._color = new Color();\n      }\n      return this._content.batchTable.getColor(this._batchId, this._color);\n    },\n    set: function (value) {\n      this._content.batchTable.setColor(this._batchId, value);\n    },\n  },\n\n  /**\n   * Gets a typed array containing the ECEF positions of the polyline.\n   * Returns undefined if {@link Cesium3DTileset#vectorKeepDecodedPositions} is false\n   * or the feature is not a polyline in a vector tile.\n   *\n   * @memberof Cesium3DTileFeature.prototype\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @type {Float64Array}\n   */\n  polylinePositions: {\n    get: function () {\n      if (!defined(this._content.getPolylinePositions)) {\n        return undefined;\n      }\n\n      return this._content.getPolylinePositions(this._batchId);\n    },\n  },\n\n  /**\n   * Gets the content of the tile containing the feature.\n   *\n   * @memberof Cesium3DTileFeature.prototype\n   *\n   * @type {Cesium3DTileContent}\n   *\n   * @readonly\n   * @private\n   */\n  content: {\n    get: function () {\n      return this._content;\n    },\n  },\n\n  /**\n   * Gets the tileset containing the feature.\n   *\n   * @memberof Cesium3DTileFeature.prototype\n   *\n   * @type {Cesium3DTileset}\n   *\n   * @readonly\n   */\n  tileset: {\n    get: function () {\n      return this._content.tileset;\n    },\n  },\n\n  /**\n   * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns\n   * the tileset containing the feature.\n   *\n   * @memberof Cesium3DTileFeature.prototype\n   *\n   * @type {Cesium3DTileset}\n   *\n   * @readonly\n   */\n  primitive: {\n    get: function () {\n      return this._content.tileset;\n    },\n  },\n\n  /**\n   * Get the feature ID associated with this feature. For 3D Tiles 1.0, the\n   * batch ID is returned. For EXT_mesh_features, this is the feature ID from\n   * the selected feature ID set.\n   *\n   * @memberof Cesium3DTileFeature.prototype\n   *\n   * @type {number}\n   *\n   * @readonly\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  featureId: {\n    get: function () {\n      return this._batchId;\n    },\n  },\n\n  /**\n   * @private\n   */\n  pickId: {\n    get: function () {\n      return this._content.batchTable.getPickColor(this._batchId);\n    },\n  },\n});\n\n/**\n * Returns whether the feature contains this property. This includes properties from this feature's\n * class and inherited classes when using a batch table hierarchy.\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy}\n *\n * @param {string} name The case-sensitive name of the property.\n * @returns {boolean} Whether the feature contains this property.\n */\nCesium3DTileFeature.prototype.hasProperty = function (name) {\n  return this._content.batchTable.hasProperty(this._batchId, name);\n};\n\n/**\n * Returns an array of property IDs for the feature. This includes properties from this feature's\n * class and inherited classes when using a batch table hierarchy.\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy}\n *\n * @param {string[]} [results] An array into which to store the results.\n * @returns {string[]} The IDs of the feature's properties.\n */\nCesium3DTileFeature.prototype.getPropertyIds = function (results) {\n  return this._content.batchTable.getPropertyIds(this._batchId, results);\n};\n\n/**\n * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's\n * class and inherited classes when using a batch table hierarchy.\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy}\n *\n * @param {string} name The case-sensitive name of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n *\n * @example\n * // Display all the properties for a feature in the console log.\n * const propertyIds = feature.getPropertyIds();\n * const length = propertyIds.length;\n * for (let i = 0; i < length; ++i) {\n *     const propertyId = propertyIds[i];\n *     console.log(`{propertyId}: ${feature.getProperty(propertyId)}`);\n * }\n */\nCesium3DTileFeature.prototype.getProperty = function (name) {\n  return this._content.batchTable.getProperty(this._batchId, name);\n};\n\n/**\n * Returns a copy of the feature's property with the given name, examining all\n * the metadata from 3D Tiles 1.0 formats, the EXT_structural_metadata and legacy\n * EXT_feature_metadata glTF extensions, and the metadata present either in the\n * tileset JSON (3D Tiles 1.1) or in the 3DTILES_metadata 3D Tiles extension.\n * Metadata is checked against name from most specific to most general and the\n * first match is returned. Metadata is checked in this order:\n *\n * <ol>\n *   <li>Batch table (structural metadata) property by semantic</li>\n *   <li>Batch table (structural metadata) property by property ID</li>\n *   <li>Content metadata property by semantic</li>\n *   <li>Content metadata property by property</li>\n *   <li>Tile metadata property by semantic</li>\n *   <li>Tile metadata property by property ID</li>\n *   <li>Subtree metadata property by semantic</li>\n *   <li>Subtree metadata property by property ID</li>\n *   <li>Group metadata property by semantic</li>\n *   <li>Group metadata property by property ID</li>\n *   <li>Tileset metadata property by semantic</li>\n *   <li>Tileset metadata property by property ID</li>\n *   <li>Otherwise, return undefined</li>\n * </ol>\n * <p>\n * For 3D Tiles Next details, see the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension}\n * for 3D Tiles, as well as the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension}\n * for glTF. For the legacy glTF extension, see {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension}\n * </p>\n *\n * @param {Cesium3DTileContent} content The content for accessing the metadata\n * @param {number} batchId The batch ID (or feature ID) of the feature to get a property for\n * @param {string} name The semantic or property ID of the feature. Semantics are checked before property IDs in each granularity of metadata.\n * @return {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nCesium3DTileFeature.getPropertyInherited = function (content, batchId, name) {\n  const batchTable = content.batchTable;\n  if (defined(batchTable)) {\n    if (batchTable.hasPropertyBySemantic(batchId, name)) {\n      return batchTable.getPropertyBySemantic(batchId, name);\n    }\n\n    if (batchTable.hasProperty(batchId, name)) {\n      return batchTable.getProperty(batchId, name);\n    }\n  }\n\n  const contentMetadata = content.metadata;\n  if (defined(contentMetadata)) {\n    if (contentMetadata.hasPropertyBySemantic(name)) {\n      return contentMetadata.getPropertyBySemantic(name);\n    }\n\n    if (contentMetadata.hasProperty(name)) {\n      return contentMetadata.getProperty(name);\n    }\n  }\n\n  const tile = content.tile;\n  const tileMetadata = tile.metadata;\n  if (defined(tileMetadata)) {\n    if (tileMetadata.hasPropertyBySemantic(name)) {\n      return tileMetadata.getPropertyBySemantic(name);\n    }\n\n    if (tileMetadata.hasProperty(name)) {\n      return tileMetadata.getProperty(name);\n    }\n  }\n\n  let subtreeMetadata;\n  if (defined(tile.implicitSubtree)) {\n    subtreeMetadata = tile.implicitSubtree.metadata;\n  }\n\n  if (defined(subtreeMetadata)) {\n    if (subtreeMetadata.hasPropertyBySemantic(name)) {\n      return subtreeMetadata.getPropertyBySemantic(name);\n    }\n\n    if (subtreeMetadata.hasProperty(name)) {\n      return subtreeMetadata.getProperty(name);\n    }\n  }\n\n  const groupMetadata = defined(content.group)\n    ? content.group.metadata\n    : undefined;\n  if (defined(groupMetadata)) {\n    if (groupMetadata.hasPropertyBySemantic(name)) {\n      return groupMetadata.getPropertyBySemantic(name);\n    }\n\n    if (groupMetadata.hasProperty(name)) {\n      return groupMetadata.getProperty(name);\n    }\n  }\n\n  const tilesetMetadata = content.tileset.metadata;\n  if (defined(tilesetMetadata)) {\n    if (tilesetMetadata.hasPropertyBySemantic(name)) {\n      return tilesetMetadata.getPropertyBySemantic(name);\n    }\n\n    if (tilesetMetadata.hasProperty(name)) {\n      return tilesetMetadata.getProperty(name);\n    }\n  }\n\n  return undefined;\n};\n\n/**\n * Returns a copy of the value of the feature's property with the given name.\n * If the feature is contained within a tileset that has metadata (3D Tiles 1.1)\n * or uses the <code>3DTILES_metadata</code> extension, tileset, group and tile\n * metadata is inherited.\n * <p>\n * To resolve name conflicts, this method resolves names from most specific to\n * least specific by metadata granularity in the order: feature, tile, group,\n * tileset. Within each granularity, semantics are resolved first, then other\n * properties.\n * </p>\n * @param {string} name The case-sensitive name of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n * @private\n */\nCesium3DTileFeature.prototype.getPropertyInherited = function (name) {\n  return Cesium3DTileFeature.getPropertyInherited(\n    this._content,\n    this._batchId,\n    name\n  );\n};\n\n/**\n * Sets the value of the feature's property with the given name.\n * <p>\n * If a property with the given name doesn't exist, it is created.\n * </p>\n *\n * @param {string} name The case-sensitive name of the property.\n * @param {*} value The value of the property that will be copied.\n *\n * @exception {DeveloperError} Inherited batch table hierarchy property is read only.\n *\n * @example\n * const height = feature.getProperty('Height'); // e.g., the height of a building\n *\n * @example\n * const name = 'clicked';\n * if (feature.getProperty(name)) {\n *     console.log('already clicked');\n * } else {\n *     feature.setProperty(name, true);\n *     console.log('first click');\n * }\n */\nCesium3DTileFeature.prototype.setProperty = function (name, value) {\n  this._content.batchTable.setProperty(this._batchId, name, value);\n\n  // PERFORMANCE_IDEA: Probably overkill, but maybe only mark the tile dirty if the\n  // property is in one of the style's expressions or - if it can be done quickly -\n  // if the new property value changed the result of an expression.\n  this._content.featurePropertiesDirty = true;\n};\n\n/**\n * Returns whether the feature's class name equals <code>className</code>. Unlike {@link Cesium3DTileFeature#isClass}\n * this function only checks the feature's exact class and not inherited classes.\n * <p>\n * This function returns <code>false</code> if no batch table hierarchy is present.\n * </p>\n *\n * @param {string} className The name to check against.\n * @returns {boolean} Whether the feature's class name equals <code>className</code>\n *\n * @private\n */\nCesium3DTileFeature.prototype.isExactClass = function (className) {\n  return this._content.batchTable.isExactClass(this._batchId, className);\n};\n\n/**\n * Returns whether the feature's class or any inherited classes are named <code>className</code>.\n * <p>\n * This function returns <code>false</code> if no batch table hierarchy is present.\n * </p>\n *\n * @param {string} className The name to check against.\n * @returns {boolean} Whether the feature's class or inherited classes are named <code>className</code>\n *\n * @private\n */\nCesium3DTileFeature.prototype.isClass = function (className) {\n  return this._content.batchTable.isClass(this._batchId, className);\n};\n\n/**\n * Returns the feature's class name.\n * <p>\n * This function returns <code>undefined</code> if no batch table hierarchy is present.\n * </p>\n *\n * @returns {string} The feature's class name.\n *\n * @private\n */\nCesium3DTileFeature.prototype.getExactClassName = function () {\n  return this._content.batchTable.getExactClassName(this._batchId);\n};\nexport default Cesium3DTileFeature;\n", "/**\n * @implements {IHooks}\n */\nclass Hooks {\n\t/**\n\t * @callback HookCallback\n\t * @this {*|Jsep} this\n\t * @param {Jsep} env\n\t * @returns: void\n\t */\n\t/**\n\t * Adds the given callback to the list of callbacks for the given hook.\n\t *\n\t * The callback will be invoked when the hook it is registered for is run.\n\t *\n\t * One callback function can be registered to multiple hooks and the same hook multiple times.\n\t *\n\t * @param {string|object} name The name of the hook, or an object of callbacks keyed by name\n\t * @param {HookCallback|boolean} callback The callback function which is given environment variables.\n\t * @param {?boolean} [first=false] Will add the hook to the top of the list (defaults to the bottom)\n\t * @public\n\t */\n\tadd(name, callback, first) {\n\t\tif (typeof arguments[0] != 'string') {\n\t\t\t// Multiple hook callbacks, keyed by name\n\t\t\tfor (let name in arguments[0]) {\n\t\t\t\tthis.add(name, arguments[0][name], arguments[1]);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t(Array.isArray(name) ? name : [name]).forEach(function (name) {\n\t\t\t\tthis[name] = this[name] || [];\n\n\t\t\t\tif (callback) {\n\t\t\t\t\tthis[name][first ? 'unshift' : 'push'](callback);\n\t\t\t\t}\n\t\t\t}, this);\n\t\t}\n\t}\n\n\t/**\n\t * Runs a hook invoking all registered callbacks with the given environment variables.\n\t *\n\t * Callbacks will be invoked synchronously and in the order in which they were registered.\n\t *\n\t * @param {string} name The name of the hook.\n\t * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.\n\t * @public\n\t */\n\trun(name, env) {\n\t\tthis[name] = this[name] || [];\n\t\tthis[name].forEach(function (callback) {\n\t\t\tcallback.call(env && env.context ? env.context : env, env);\n\t\t});\n\t}\n}\n\n/**\n * @implements {IPlugins}\n */\nclass Plugins {\n\tconstructor(jsep) {\n\t\tthis.jsep = jsep;\n\t\tthis.registered = {};\n\t}\n\n\t/**\n\t * @callback PluginSetup\n\t * @this {Jsep} jsep\n\t * @returns: void\n\t */\n\t/**\n\t * Adds the given plugin(s) to the registry\n\t *\n\t * @param {object} plugins\n\t * @param {string} plugins.name The name of the plugin\n\t * @param {PluginSetup} plugins.init The init function\n\t * @public\n\t */\n\tregister(...plugins) {\n\t\tplugins.forEach((plugin) => {\n\t\t\tif (typeof plugin !== 'object' || !plugin.name || !plugin.init) {\n\t\t\t\tthrow new Error('Invalid JSEP plugin format');\n\t\t\t}\n\t\t\tif (this.registered[plugin.name]) {\n\t\t\t\t// already registered. Ignore.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tplugin.init(this.jsep);\n\t\t\tthis.registered[plugin.name] = plugin;\n\t\t});\n\t}\n}\n\n//     JavaScript Expression Parser (JSEP) 1.3.8\n\nclass Jsep {\n\t/**\n\t * @returns {string}\n\t */\n\tstatic get version() {\n\t\t// To be filled in by the template\n\t\treturn '1.3.8';\n\t}\n\n\t/**\n\t * @returns {string}\n\t */\n\tstatic toString() {\n\t\treturn 'JavaScript Expression Parser (JSEP) v' + Jsep.version;\n\t};\n\n\t// ==================== CONFIG ================================\n\t/**\n\t * @method addUnaryOp\n\t * @param {string} op_name The name of the unary op to add\n\t * @returns {Jsep}\n\t */\n\tstatic addUnaryOp(op_name) {\n\t\tJsep.max_unop_len = Math.max(op_name.length, Jsep.max_unop_len);\n\t\tJsep.unary_ops[op_name] = 1;\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method jsep.addBinaryOp\n\t * @param {string} op_name The name of the binary op to add\n\t * @param {number} precedence The precedence of the binary op (can be a float). Higher number = higher precedence\n\t * @param {boolean} [isRightAssociative=false] whether operator is right-associative\n\t * @returns {Jsep}\n\t */\n\tstatic addBinaryOp(op_name, precedence, isRightAssociative) {\n\t\tJsep.max_binop_len = Math.max(op_name.length, Jsep.max_binop_len);\n\t\tJsep.binary_ops[op_name] = precedence;\n\t\tif (isRightAssociative) {\n\t\t\tJsep.right_associative.add(op_name);\n\t\t}\n\t\telse {\n\t\t\tJsep.right_associative.delete(op_name);\n\t\t}\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method addIdentifierChar\n\t * @param {string} char The additional character to treat as a valid part of an identifier\n\t * @returns {Jsep}\n\t */\n\tstatic addIdentifierChar(char) {\n\t\tJsep.additional_identifier_chars.add(char);\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method addLiteral\n\t * @param {string} literal_name The name of the literal to add\n\t * @param {*} literal_value The value of the literal\n\t * @returns {Jsep}\n\t */\n\tstatic addLiteral(literal_name, literal_value) {\n\t\tJsep.literals[literal_name] = literal_value;\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeUnaryOp\n\t * @param {string} op_name The name of the unary op to remove\n\t * @returns {Jsep}\n\t */\n\tstatic removeUnaryOp(op_name) {\n\t\tdelete Jsep.unary_ops[op_name];\n\t\tif (op_name.length === Jsep.max_unop_len) {\n\t\t\tJsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);\n\t\t}\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeAllUnaryOps\n\t * @returns {Jsep}\n\t */\n\tstatic removeAllUnaryOps() {\n\t\tJsep.unary_ops = {};\n\t\tJsep.max_unop_len = 0;\n\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeIdentifierChar\n\t * @param {string} char The additional character to stop treating as a valid part of an identifier\n\t * @returns {Jsep}\n\t */\n\tstatic removeIdentifierChar(char) {\n\t\tJsep.additional_identifier_chars.delete(char);\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeBinaryOp\n\t * @param {string} op_name The name of the binary op to remove\n\t * @returns {Jsep}\n\t */\n\tstatic removeBinaryOp(op_name) {\n\t\tdelete Jsep.binary_ops[op_name];\n\n\t\tif (op_name.length === Jsep.max_binop_len) {\n\t\t\tJsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);\n\t\t}\n\t\tJsep.right_associative.delete(op_name);\n\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeAllBinaryOps\n\t * @returns {Jsep}\n\t */\n\tstatic removeAllBinaryOps() {\n\t\tJsep.binary_ops = {};\n\t\tJsep.max_binop_len = 0;\n\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeLiteral\n\t * @param {string} literal_name The name of the literal to remove\n\t * @returns {Jsep}\n\t */\n\tstatic removeLiteral(literal_name) {\n\t\tdelete Jsep.literals[literal_name];\n\t\treturn Jsep;\n\t}\n\n\t/**\n\t * @method removeAllLiterals\n\t * @returns {Jsep}\n\t */\n\tstatic removeAllLiterals() {\n\t\tJsep.literals = {};\n\n\t\treturn Jsep;\n\t}\n\t// ==================== END CONFIG ============================\n\n\n\t/**\n\t * @returns {string}\n\t */\n\tget char() {\n\t\treturn this.expr.charAt(this.index);\n\t}\n\n\t/**\n\t * @returns {number}\n\t */\n\tget code() {\n\t\treturn this.expr.charCodeAt(this.index);\n\t};\n\n\n\t/**\n\t * @param {string} expr a string with the passed in express\n\t * @returns Jsep\n\t */\n\tconstructor(expr) {\n\t\t// `index` stores the character number we are currently at\n\t\t// All of the gobbles below will modify `index` as we move along\n\t\tthis.expr = expr;\n\t\tthis.index = 0;\n\t}\n\n\t/**\n\t * static top-level parser\n\t * @returns {jsep.Expression}\n\t */\n\tstatic parse(expr) {\n\t\treturn (new Jsep(expr)).parse();\n\t}\n\n\t/**\n\t * Get the longest key length of any object\n\t * @param {object} obj\n\t * @returns {number}\n\t */\n\tstatic getMaxKeyLen(obj) {\n\t\treturn Math.max(0, ...Object.keys(obj).map(k => k.length));\n\t}\n\n\t/**\n\t * `ch` is a character code in the next three functions\n\t * @param {number} ch\n\t * @returns {boolean}\n\t */\n\tstatic isDecimalDigit(ch) {\n\t\treturn (ch >= 48 && ch <= 57); // 0...9\n\t}\n\n\t/**\n\t * Returns the precedence of a binary operator or `0` if it isn't a binary operator. Can be float.\n\t * @param {string} op_val\n\t * @returns {number}\n\t */\n\tstatic binaryPrecedence(op_val) {\n\t\treturn Jsep.binary_ops[op_val] || 0;\n\t}\n\n\t/**\n\t * Looks for start of identifier\n\t * @param {number} ch\n\t * @returns {boolean}\n\t */\n\tstatic isIdentifierStart(ch) {\n\t\treturn  (ch >= 65 && ch <= 90) || // A...Z\n\t\t\t(ch >= 97 && ch <= 122) || // a...z\n\t\t\t(ch >= 128 && !Jsep.binary_ops[String.fromCharCode(ch)]) || // any non-ASCII that is not an operator\n\t\t\t(Jsep.additional_identifier_chars.has(String.fromCharCode(ch))); // additional characters\n\t}\n\n\t/**\n\t * @param {number} ch\n\t * @returns {boolean}\n\t */\n\tstatic isIdentifierPart(ch) {\n\t\treturn Jsep.isIdentifierStart(ch) || Jsep.isDecimalDigit(ch);\n\t}\n\n\t/**\n\t * throw error at index of the expression\n\t * @param {string} message\n\t * @throws\n\t */\n\tthrowError(message) {\n\t\tconst error = new Error(message + ' at character ' + this.index);\n\t\terror.index = this.index;\n\t\terror.description = message;\n\t\tthrow error;\n\t}\n\n\t/**\n\t * Run a given hook\n\t * @param {string} name\n\t * @param {jsep.Expression|false} [node]\n\t * @returns {?jsep.Expression}\n\t */\n\trunHook(name, node) {\n\t\tif (Jsep.hooks[name]) {\n\t\t\tconst env = { context: this, node };\n\t\t\tJsep.hooks.run(name, env);\n\t\t\treturn env.node;\n\t\t}\n\t\treturn node;\n\t}\n\n\t/**\n\t * Runs a given hook until one returns a node\n\t * @param {string} name\n\t * @returns {?jsep.Expression}\n\t */\n\tsearchHook(name) {\n\t\tif (Jsep.hooks[name]) {\n\t\t\tconst env = { context: this };\n\t\t\tJsep.hooks[name].find(function (callback) {\n\t\t\t\tcallback.call(env.context, env);\n\t\t\t\treturn env.node;\n\t\t\t});\n\t\t\treturn env.node;\n\t\t}\n\t}\n\n\t/**\n\t * Push `index` up to the next non-space character\n\t */\n\tgobbleSpaces() {\n\t\tlet ch = this.code;\n\t\t// Whitespace\n\t\twhile (ch === Jsep.SPACE_CODE\n\t\t|| ch === Jsep.TAB_CODE\n\t\t|| ch === Jsep.LF_CODE\n\t\t|| ch === Jsep.CR_CODE) {\n\t\t\tch = this.expr.charCodeAt(++this.index);\n\t\t}\n\t\tthis.runHook('gobble-spaces');\n\t}\n\n\t/**\n\t * Top-level method to parse all expressions and returns compound or single node\n\t * @returns {jsep.Expression}\n\t */\n\tparse() {\n\t\tthis.runHook('before-all');\n\t\tconst nodes = this.gobbleExpressions();\n\n\t\t// If there's only one expression just try returning the expression\n\t\tconst node = nodes.length === 1\n\t\t  ? nodes[0]\n\t\t\t: {\n\t\t\t\ttype: Jsep.COMPOUND,\n\t\t\t\tbody: nodes\n\t\t\t};\n\t\treturn this.runHook('after-all', node);\n\t}\n\n\t/**\n\t * top-level parser (but can be reused within as well)\n\t * @param {number} [untilICode]\n\t * @returns {jsep.Expression[]}\n\t */\n\tgobbleExpressions(untilICode) {\n\t\tlet nodes = [], ch_i, node;\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tch_i = this.code;\n\n\t\t\t// Expressions can be separated by semicolons, commas, or just inferred without any\n\t\t\t// separators\n\t\t\tif (ch_i === Jsep.SEMCOL_CODE || ch_i === Jsep.COMMA_CODE) {\n\t\t\t\tthis.index++; // ignore separators\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Try to gobble each expression individually\n\t\t\t\tif (node = this.gobbleExpression()) {\n\t\t\t\t\tnodes.push(node);\n\t\t\t\t\t// If we weren't able to find a binary expression and are out of room, then\n\t\t\t\t\t// the expression passed in probably has too much\n\t\t\t\t}\n\t\t\t\telse if (this.index < this.expr.length) {\n\t\t\t\t\tif (ch_i === untilICode) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tthis.throwError('Unexpected \"' + this.char + '\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nodes;\n\t}\n\n\t/**\n\t * The main parsing function.\n\t * @returns {?jsep.Expression}\n\t */\n\tgobbleExpression() {\n\t\tconst node = this.searchHook('gobble-expression') || this.gobbleBinaryExpression();\n\t\tthis.gobbleSpaces();\n\n\t\treturn this.runHook('after-expression', node);\n\t}\n\n\t/**\n\t * Search for the operation portion of the string (e.g. `+`, `===`)\n\t * Start by taking the longest possible binary operations (3 characters: `===`, `!==`, `>>>`)\n\t * and move down from 3 to 2 to 1 character until a matching binary operation is found\n\t * then, return that binary operation\n\t * @returns {string|boolean}\n\t */\n\tgobbleBinaryOp() {\n\t\tthis.gobbleSpaces();\n\t\tlet to_check = this.expr.substr(this.index, Jsep.max_binop_len);\n\t\tlet tc_len = to_check.length;\n\n\t\twhile (tc_len > 0) {\n\t\t\t// Don't accept a binary op when it is an identifier.\n\t\t\t// Binary ops that start with a identifier-valid character must be followed\n\t\t\t// by a non identifier-part valid character\n\t\t\tif (Jsep.binary_ops.hasOwnProperty(to_check) && (\n\t\t\t\t!Jsep.isIdentifierStart(this.code) ||\n\t\t\t\t(this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))\n\t\t\t)) {\n\t\t\t\tthis.index += tc_len;\n\t\t\t\treturn to_check;\n\t\t\t}\n\t\t\tto_check = to_check.substr(0, --tc_len);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * This function is responsible for gobbling an individual expression,\n\t * e.g. `1`, `1+2`, `a+(b*2)-Math.sqrt(2)`\n\t * @returns {?jsep.BinaryExpression}\n\t */\n\tgobbleBinaryExpression() {\n\t\tlet node, biop, prec, stack, biop_info, left, right, i, cur_biop;\n\n\t\t// First, try to get the leftmost thing\n\t\t// Then, check to see if there's a binary operator operating on that leftmost thing\n\t\t// Don't gobbleBinaryOp without a left-hand-side\n\t\tleft = this.gobbleToken();\n\t\tif (!left) {\n\t\t\treturn left;\n\t\t}\n\t\tbiop = this.gobbleBinaryOp();\n\n\t\t// If there wasn't a binary operator, just return the leftmost node\n\t\tif (!biop) {\n\t\t\treturn left;\n\t\t}\n\n\t\t// Otherwise, we need to start a stack to properly place the binary operations in their\n\t\t// precedence structure\n\t\tbiop_info = { value: biop, prec: Jsep.binaryPrecedence(biop), right_a: Jsep.right_associative.has(biop) };\n\n\t\tright = this.gobbleToken();\n\n\t\tif (!right) {\n\t\t\tthis.throwError(\"Expected expression after \" + biop);\n\t\t}\n\n\t\tstack = [left, biop_info, right];\n\n\t\t// Properly deal with precedence using [recursive descent](http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm)\n\t\twhile ((biop = this.gobbleBinaryOp())) {\n\t\t\tprec = Jsep.binaryPrecedence(biop);\n\n\t\t\tif (prec === 0) {\n\t\t\t\tthis.index -= biop.length;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tbiop_info = { value: biop, prec, right_a: Jsep.right_associative.has(biop) };\n\n\t\t\tcur_biop = biop;\n\n\t\t\t// Reduce: make a binary expression from the three topmost entries.\n\t\t\tconst comparePrev = prev => biop_info.right_a && prev.right_a\n\t\t\t\t? prec > prev.prec\n\t\t\t\t: prec <= prev.prec;\n\t\t\twhile ((stack.length > 2) && comparePrev(stack[stack.length - 2])) {\n\t\t\t\tright = stack.pop();\n\t\t\t\tbiop = stack.pop().value;\n\t\t\t\tleft = stack.pop();\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.BINARY_EXP,\n\t\t\t\t\toperator: biop,\n\t\t\t\t\tleft,\n\t\t\t\t\tright\n\t\t\t\t};\n\t\t\t\tstack.push(node);\n\t\t\t}\n\n\t\t\tnode = this.gobbleToken();\n\n\t\t\tif (!node) {\n\t\t\t\tthis.throwError(\"Expected expression after \" + cur_biop);\n\t\t\t}\n\n\t\t\tstack.push(biop_info, node);\n\t\t}\n\n\t\ti = stack.length - 1;\n\t\tnode = stack[i];\n\n\t\twhile (i > 1) {\n\t\t\tnode = {\n\t\t\t\ttype: Jsep.BINARY_EXP,\n\t\t\t\toperator: stack[i - 1].value,\n\t\t\t\tleft: stack[i - 2],\n\t\t\t\tright: node\n\t\t\t};\n\t\t\ti -= 2;\n\t\t}\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * An individual part of a binary expression:\n\t * e.g. `foo.bar(baz)`, `1`, `\"abc\"`, `(a % 2)` (because it's in parenthesis)\n\t * @returns {boolean|jsep.Expression}\n\t */\n\tgobbleToken() {\n\t\tlet ch, to_check, tc_len, node;\n\n\t\tthis.gobbleSpaces();\n\t\tnode = this.searchHook('gobble-token');\n\t\tif (node) {\n\t\t\treturn this.runHook('after-token', node);\n\t\t}\n\n\t\tch = this.code;\n\n\t\tif (Jsep.isDecimalDigit(ch) || ch === Jsep.PERIOD_CODE) {\n\t\t\t// Char code 46 is a dot `.` which can start off a numeric literal\n\t\t\treturn this.gobbleNumericLiteral();\n\t\t}\n\n\t\tif (ch === Jsep.SQUOTE_CODE || ch === Jsep.DQUOTE_CODE) {\n\t\t\t// Single or double quotes\n\t\t\tnode = this.gobbleStringLiteral();\n\t\t}\n\t\telse if (ch === Jsep.OBRACK_CODE) {\n\t\t\tnode = this.gobbleArray();\n\t\t}\n\t\telse {\n\t\t\tto_check = this.expr.substr(this.index, Jsep.max_unop_len);\n\t\t\ttc_len = to_check.length;\n\n\t\t\twhile (tc_len > 0) {\n\t\t\t\t// Don't accept an unary op when it is an identifier.\n\t\t\t\t// Unary ops that start with a identifier-valid character must be followed\n\t\t\t\t// by a non identifier-part valid character\n\t\t\t\tif (Jsep.unary_ops.hasOwnProperty(to_check) && (\n\t\t\t\t\t!Jsep.isIdentifierStart(this.code) ||\n\t\t\t\t\t(this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))\n\t\t\t\t)) {\n\t\t\t\t\tthis.index += tc_len;\n\t\t\t\t\tconst argument = this.gobbleToken();\n\t\t\t\t\tif (!argument) {\n\t\t\t\t\t\tthis.throwError('missing unaryOp argument');\n\t\t\t\t\t}\n\t\t\t\t\treturn this.runHook('after-token', {\n\t\t\t\t\t\ttype: Jsep.UNARY_EXP,\n\t\t\t\t\t\toperator: to_check,\n\t\t\t\t\t\targument,\n\t\t\t\t\t\tprefix: true\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tto_check = to_check.substr(0, --tc_len);\n\t\t\t}\n\n\t\t\tif (Jsep.isIdentifierStart(ch)) {\n\t\t\t\tnode = this.gobbleIdentifier();\n\t\t\t\tif (Jsep.literals.hasOwnProperty(node.name)) {\n\t\t\t\t\tnode = {\n\t\t\t\t\t\ttype: Jsep.LITERAL,\n\t\t\t\t\t\tvalue: Jsep.literals[node.name],\n\t\t\t\t\t\traw: node.name,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\telse if (node.name === Jsep.this_str) {\n\t\t\t\t\tnode = { type: Jsep.THIS_EXP };\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (ch === Jsep.OPAREN_CODE) { // open parenthesis\n\t\t\t\tnode = this.gobbleGroup();\n\t\t\t}\n\t\t}\n\n\t\tif (!node) {\n\t\t\treturn this.runHook('after-token', false);\n\t\t}\n\n\t\tnode = this.gobbleTokenProperty(node);\n\t\treturn this.runHook('after-token', node);\n\t}\n\n\t/**\n\t * Gobble properties of of identifiers/strings/arrays/groups.\n\t * e.g. `foo`, `bar.baz`, `foo['bar'].baz`\n\t * It also gobbles function calls:\n\t * e.g. `Math.acos(obj.angle)`\n\t * @param {jsep.Expression} node\n\t * @returns {jsep.Expression}\n\t */\n\tgobbleTokenProperty(node) {\n\t\tthis.gobbleSpaces();\n\n\t\tlet ch = this.code;\n\t\twhile (ch === Jsep.PERIOD_CODE || ch === Jsep.OBRACK_CODE || ch === Jsep.OPAREN_CODE || ch === Jsep.QUMARK_CODE) {\n\t\t\tlet optional;\n\t\t\tif (ch === Jsep.QUMARK_CODE) {\n\t\t\t\tif (this.expr.charCodeAt(this.index + 1) !== Jsep.PERIOD_CODE) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\toptional = true;\n\t\t\t\tthis.index += 2;\n\t\t\t\tthis.gobbleSpaces();\n\t\t\t\tch = this.code;\n\t\t\t}\n\t\t\tthis.index++;\n\n\t\t\tif (ch === Jsep.OBRACK_CODE) {\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.MEMBER_EXP,\n\t\t\t\t\tcomputed: true,\n\t\t\t\t\tobject: node,\n\t\t\t\t\tproperty: this.gobbleExpression()\n\t\t\t\t};\n\t\t\t\tthis.gobbleSpaces();\n\t\t\t\tch = this.code;\n\t\t\t\tif (ch !== Jsep.CBRACK_CODE) {\n\t\t\t\t\tthis.throwError('Unclosed [');\n\t\t\t\t}\n\t\t\t\tthis.index++;\n\t\t\t}\n\t\t\telse if (ch === Jsep.OPAREN_CODE) {\n\t\t\t\t// A function call is being made; gobble all the arguments\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.CALL_EXP,\n\t\t\t\t\t'arguments': this.gobbleArguments(Jsep.CPAREN_CODE),\n\t\t\t\t\tcallee: node\n\t\t\t\t};\n\t\t\t}\n\t\t\telse if (ch === Jsep.PERIOD_CODE || optional) {\n\t\t\t\tif (optional) {\n\t\t\t\t\tthis.index--;\n\t\t\t\t}\n\t\t\t\tthis.gobbleSpaces();\n\t\t\t\tnode = {\n\t\t\t\t\ttype: Jsep.MEMBER_EXP,\n\t\t\t\t\tcomputed: false,\n\t\t\t\t\tobject: node,\n\t\t\t\t\tproperty: this.gobbleIdentifier(),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (optional) {\n\t\t\t\tnode.optional = true;\n\t\t\t} // else leave undefined for compatibility with esprima\n\n\t\t\tthis.gobbleSpaces();\n\t\t\tch = this.code;\n\t\t}\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to\n\t * keep track of everything in the numeric literal and then calling `parseFloat` on that string\n\t * @returns {jsep.Literal}\n\t */\n\tgobbleNumericLiteral() {\n\t\tlet number = '', ch, chCode;\n\n\t\twhile (Jsep.isDecimalDigit(this.code)) {\n\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t}\n\n\t\tif (this.code === Jsep.PERIOD_CODE) { // can start with a decimal marker\n\t\t\tnumber += this.expr.charAt(this.index++);\n\n\t\t\twhile (Jsep.isDecimalDigit(this.code)) {\n\t\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\t}\n\t\t}\n\n\t\tch = this.char;\n\n\t\tif (ch === 'e' || ch === 'E') { // exponent marker\n\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\tch = this.char;\n\n\t\t\tif (ch === '+' || ch === '-') { // exponent sign\n\t\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\t}\n\n\t\t\twhile (Jsep.isDecimalDigit(this.code)) { // exponent itself\n\t\t\t\tnumber += this.expr.charAt(this.index++);\n\t\t\t}\n\n\t\t\tif (!Jsep.isDecimalDigit(this.expr.charCodeAt(this.index - 1)) ) {\n\t\t\t\tthis.throwError('Expected exponent (' + number + this.char + ')');\n\t\t\t}\n\t\t}\n\n\t\tchCode = this.code;\n\n\t\t// Check to make sure this isn't a variable name that start with a number (123abc)\n\t\tif (Jsep.isIdentifierStart(chCode)) {\n\t\t\tthis.throwError('Variable names cannot start with a number (' +\n\t\t\t\tnumber + this.char + ')');\n\t\t}\n\t\telse if (chCode === Jsep.PERIOD_CODE || (number.length === 1 && number.charCodeAt(0) === Jsep.PERIOD_CODE)) {\n\t\t\tthis.throwError('Unexpected period');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Jsep.LITERAL,\n\t\t\tvalue: parseFloat(number),\n\t\t\traw: number\n\t\t};\n\t}\n\n\t/**\n\t * Parses a string literal, staring with single or double quotes with basic support for escape codes\n\t * e.g. `\"hello world\"`, `'this is\\nJSEP'`\n\t * @returns {jsep.Literal}\n\t */\n\tgobbleStringLiteral() {\n\t\tlet str = '';\n\t\tconst startIndex = this.index;\n\t\tconst quote = this.expr.charAt(this.index++);\n\t\tlet closed = false;\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tlet ch = this.expr.charAt(this.index++);\n\n\t\t\tif (ch === quote) {\n\t\t\t\tclosed = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (ch === '\\\\') {\n\t\t\t\t// Check for all of the common escape codes\n\t\t\t\tch = this.expr.charAt(this.index++);\n\n\t\t\t\tswitch (ch) {\n\t\t\t\t\tcase 'n': str += '\\n'; break;\n\t\t\t\t\tcase 'r': str += '\\r'; break;\n\t\t\t\t\tcase 't': str += '\\t'; break;\n\t\t\t\t\tcase 'b': str += '\\b'; break;\n\t\t\t\t\tcase 'f': str += '\\f'; break;\n\t\t\t\t\tcase 'v': str += '\\x0B'; break;\n\t\t\t\t\tdefault : str += ch;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tstr += ch;\n\t\t\t}\n\t\t}\n\n\t\tif (!closed) {\n\t\t\tthis.throwError('Unclosed quote after \"' + str + '\"');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Jsep.LITERAL,\n\t\t\tvalue: str,\n\t\t\traw: this.expr.substring(startIndex, this.index),\n\t\t};\n\t}\n\n\t/**\n\t * Gobbles only identifiers\n\t * e.g.: `foo`, `_value`, `$x1`\n\t * Also, this function checks if that identifier is a literal:\n\t * (e.g. `true`, `false`, `null`) or `this`\n\t * @returns {jsep.Identifier}\n\t */\n\tgobbleIdentifier() {\n\t\tlet ch = this.code, start = this.index;\n\n\t\tif (Jsep.isIdentifierStart(ch)) {\n\t\t\tthis.index++;\n\t\t}\n\t\telse {\n\t\t\tthis.throwError('Unexpected ' + this.char);\n\t\t}\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tch = this.code;\n\n\t\t\tif (Jsep.isIdentifierPart(ch)) {\n\t\t\t\tthis.index++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\ttype: Jsep.IDENTIFIER,\n\t\t\tname: this.expr.slice(start, this.index),\n\t\t};\n\t}\n\n\t/**\n\t * Gobbles a list of arguments within the context of a function call\n\t * or array literal. This function also assumes that the opening character\n\t * `(` or `[` has already been gobbled, and gobbles expressions and commas\n\t * until the terminator character `)` or `]` is encountered.\n\t * e.g. `foo(bar, baz)`, `my_func()`, or `[bar, baz]`\n\t * @param {number} termination\n\t * @returns {jsep.Expression[]}\n\t */\n\tgobbleArguments(termination) {\n\t\tconst args = [];\n\t\tlet closed = false;\n\t\tlet separator_count = 0;\n\n\t\twhile (this.index < this.expr.length) {\n\t\t\tthis.gobbleSpaces();\n\t\t\tlet ch_i = this.code;\n\n\t\t\tif (ch_i === termination) { // done parsing\n\t\t\t\tclosed = true;\n\t\t\t\tthis.index++;\n\n\t\t\t\tif (termination === Jsep.CPAREN_CODE && separator_count && separator_count >= args.length){\n\t\t\t\t\tthis.throwError('Unexpected token ' + String.fromCharCode(termination));\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (ch_i === Jsep.COMMA_CODE) { // between expressions\n\t\t\t\tthis.index++;\n\t\t\t\tseparator_count++;\n\n\t\t\t\tif (separator_count !== args.length) { // missing argument\n\t\t\t\t\tif (termination === Jsep.CPAREN_CODE) {\n\t\t\t\t\t\tthis.throwError('Unexpected token ,');\n\t\t\t\t\t}\n\t\t\t\t\telse if (termination === Jsep.CBRACK_CODE) {\n\t\t\t\t\t\tfor (let arg = args.length; arg < separator_count; arg++) {\n\t\t\t\t\t\t\targs.push(null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (args.length !== separator_count && separator_count !== 0) {\n\t\t\t\t// NOTE: `&& separator_count !== 0` allows for either all commas, or all spaces as arguments\n\t\t\t\tthis.throwError('Expected comma');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst node = this.gobbleExpression();\n\n\t\t\t\tif (!node || node.type === Jsep.COMPOUND) {\n\t\t\t\t\tthis.throwError('Expected comma');\n\t\t\t\t}\n\n\t\t\t\targs.push(node);\n\t\t\t}\n\t\t}\n\n\t\tif (!closed) {\n\t\t\tthis.throwError('Expected ' + String.fromCharCode(termination));\n\t\t}\n\n\t\treturn args;\n\t}\n\n\t/**\n\t * Responsible for parsing a group of things within parentheses `()`\n\t * that have no identifier in front (so not a function call)\n\t * This function assumes that it needs to gobble the opening parenthesis\n\t * and then tries to gobble everything within that parenthesis, assuming\n\t * that the next thing it should see is the close parenthesis. If not,\n\t * then the expression probably doesn't have a `)`\n\t * @returns {boolean|jsep.Expression}\n\t */\n\tgobbleGroup() {\n\t\tthis.index++;\n\t\tlet nodes = this.gobbleExpressions(Jsep.CPAREN_CODE);\n\t\tif (this.code === Jsep.CPAREN_CODE) {\n\t\t\tthis.index++;\n\t\t\tif (nodes.length === 1) {\n\t\t\t\treturn nodes[0];\n\t\t\t}\n\t\t\telse if (!nodes.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn {\n\t\t\t\t\ttype: Jsep.SEQUENCE_EXP,\n\t\t\t\t\texpressions: nodes,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthis.throwError('Unclosed (');\n\t\t}\n\t}\n\n\t/**\n\t * Responsible for parsing Array literals `[1, 2, 3]`\n\t * This function assumes that it needs to gobble the opening bracket\n\t * and then tries to gobble the expressions as arguments.\n\t * @returns {jsep.ArrayExpression}\n\t */\n\tgobbleArray() {\n\t\tthis.index++;\n\n\t\treturn {\n\t\t\ttype: Jsep.ARRAY_EXP,\n\t\t\telements: this.gobbleArguments(Jsep.CBRACK_CODE)\n\t\t};\n\t}\n}\n\n// Static fields:\nconst hooks = new Hooks();\nObject.assign(Jsep, {\n\thooks,\n\tplugins: new Plugins(Jsep),\n\n\t// Node Types\n\t// ----------\n\t// This is the full set of types that any JSEP node can be.\n\t// Store them here to save space when minified\n\tCOMPOUND:        'Compound',\n\tSEQUENCE_EXP:    'SequenceExpression',\n\tIDENTIFIER:      'Identifier',\n\tMEMBER_EXP:      'MemberExpression',\n\tLITERAL:         'Literal',\n\tTHIS_EXP:        'ThisExpression',\n\tCALL_EXP:        'CallExpression',\n\tUNARY_EXP:       'UnaryExpression',\n\tBINARY_EXP:      'BinaryExpression',\n\tARRAY_EXP:       'ArrayExpression',\n\n\tTAB_CODE:    9,\n\tLF_CODE:     10,\n\tCR_CODE:     13,\n\tSPACE_CODE:  32,\n\tPERIOD_CODE: 46, // '.'\n\tCOMMA_CODE:  44, // ','\n\tSQUOTE_CODE: 39, // single quote\n\tDQUOTE_CODE: 34, // double quotes\n\tOPAREN_CODE: 40, // (\n\tCPAREN_CODE: 41, // )\n\tOBRACK_CODE: 91, // [\n\tCBRACK_CODE: 93, // ]\n\tQUMARK_CODE: 63, // ?\n\tSEMCOL_CODE: 59, // ;\n\tCOLON_CODE:  58, // :\n\n\n\t// Operations\n\t// ----------\n\t// Use a quickly-accessible map to store all of the unary operators\n\t// Values are set to `1` (it really doesn't matter)\n\tunary_ops: {\n\t\t'-': 1,\n\t\t'!': 1,\n\t\t'~': 1,\n\t\t'+': 1\n\t},\n\n\t// Also use a map for the binary operations but set their values to their\n\t// binary precedence for quick reference (higher number = higher precedence)\n\t// see [Order of operations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence)\n\tbinary_ops: {\n\t\t'||': 1, '&&': 2, '|': 3, '^': 4, '&': 5,\n\t\t'==': 6, '!=': 6, '===': 6, '!==': 6,\n\t\t'<': 7, '>': 7, '<=': 7, '>=': 7,\n\t\t'<<': 8, '>>': 8, '>>>': 8,\n\t\t'+': 9, '-': 9,\n\t\t'*': 10, '/': 10, '%': 10\n\t},\n\n\t// sets specific binary_ops as right-associative\n\tright_associative: new Set(),\n\n\t// Additional valid identifier chars, apart from a-z, A-Z and 0-9 (except on the starting char)\n\tadditional_identifier_chars: new Set(['$', '_']),\n\n\t// Literals\n\t// ----------\n\t// Store the values to return for the various literals we may encounter\n\tliterals: {\n\t\t'true': true,\n\t\t'false': false,\n\t\t'null': null\n\t},\n\n\t// Except for `this`, which is special. This could be changed to something like `'self'` as well\n\tthis_str: 'this',\n});\nJsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);\nJsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);\n\n// Backward Compatibility:\nconst jsep = expr => (new Jsep(expr)).parse();\nconst staticMethods = Object.getOwnPropertyNames(Jsep);\nstaticMethods\n\t.forEach((m) => {\n\t\tif (jsep[m] === undefined && m !== 'prototype') {\n\t\t\tjsep[m] = Jsep[m];\n\t\t}\n\t});\njsep.Jsep = Jsep; // allows for const { Jsep } = require('jsep');\n\nconst CONDITIONAL_EXP = 'ConditionalExpression';\n\nvar ternary = {\n\tname: 'ternary',\n\n\tinit(jsep) {\n\t\t// Ternary expression: test ? consequent : alternate\n\t\tjsep.hooks.add('after-expression', function gobbleTernary(env) {\n\t\t\tif (env.node && this.code === jsep.QUMARK_CODE) {\n\t\t\t\tthis.index++;\n\t\t\t\tconst test = env.node;\n\t\t\t\tconst consequent = this.gobbleExpression();\n\n\t\t\t\tif (!consequent) {\n\t\t\t\t\tthis.throwError('Expected expression');\n\t\t\t\t}\n\n\t\t\t\tthis.gobbleSpaces();\n\n\t\t\t\tif (this.code === jsep.COLON_CODE) {\n\t\t\t\t\tthis.index++;\n\t\t\t\t\tconst alternate = this.gobbleExpression();\n\n\t\t\t\t\tif (!alternate) {\n\t\t\t\t\t\tthis.throwError('Expected expression');\n\t\t\t\t\t}\n\t\t\t\t\tenv.node = {\n\t\t\t\t\t\ttype: CONDITIONAL_EXP,\n\t\t\t\t\t\ttest,\n\t\t\t\t\t\tconsequent,\n\t\t\t\t\t\talternate,\n\t\t\t\t\t};\n\n\t\t\t\t\t// check for operators of higher priority than ternary (i.e. assignment)\n\t\t\t\t\t// jsep sets || at 1, and assignment at 0.9, and conditional should be between them\n\t\t\t\t\tif (test.operator && jsep.binary_ops[test.operator] <= 0.9) {\n\t\t\t\t\t\tlet newTest = test;\n\t\t\t\t\t\twhile (newTest.right.operator && jsep.binary_ops[newTest.right.operator] <= 0.9) {\n\t\t\t\t\t\t\tnewTest = newTest.right;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenv.node.test = newTest.right;\n\t\t\t\t\t\tnewTest.right = env.node;\n\t\t\t\t\t\tenv.node = test;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.throwError('Expected :');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t},\n};\n\n// Add default plugins:\n\njsep.plugins.register(ternary);\n\nexport { Jsep, jsep as default };\n", "/**\n * @private\n */\nconst ExpressionNodeType = {\n  VARIABLE: 0,\n  UNARY: 1,\n  BINARY: 2,\n  TERNARY: 3,\n  CONDITIONAL: 4,\n  MEMBER: 5,\n  FUNCTION_CALL: 6,\n  ARRAY: 7,\n  REGEX: 8,\n  VARIABLE_IN_STRING: 9,\n  LITERAL_NULL: 10,\n  LITERAL_BOOLEAN: 11,\n  LITERAL_NUMBER: 12,\n  LITERAL_STRING: 13,\n  LITERAL_COLOR: 14,\n  LITERAL_VECTOR: 15,\n  LITERAL_REGEX: 16,\n  LITERAL_UNDEFINED: 17,\n  BUILTIN_VARIABLE: 18,\n};\nexport default Object.freeze(ExpressionNodeType);\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport jsep from \"jsep\";\nimport ExpressionNodeType from \"./ExpressionNodeType.js\";\n\n/**\n * An expression for a style applied to a {@link Cesium3DTileset}.\n * <p>\n * Evaluates an expression defined using the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.\n * </p>\n * <p>\n * Implements the {@link StyleExpression} interface.\n * </p>\n *\n * @alias Expression\n * @constructor\n *\n * @param {string} [expression] The expression defined using the 3D Tiles Styling language.\n * @param {object} [defines] Defines in the style.\n *\n * @example\n * const expression = new Cesium.Expression('(regExp(\"^Chest\").test(${County})) && (${YearBuilt} >= 1970)');\n * expression.evaluate(feature); // returns true or false depending on the feature's properties\n *\n * @example\n * const expression = new Cesium.Expression('(${Temperature} > 90) ? color(\"red\") : color(\"white\")');\n * expression.evaluateColor(feature, result); // returns a Cesium.Color object\n */\nfunction Expression(expression, defines) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"expression\", expression);\n  //>>includeEnd('debug');\n\n  this._expression = expression;\n  expression = replaceDefines(expression, defines);\n  expression = replaceVariables(removeBackslashes(expression));\n\n  // customize jsep operators\n  jsep.addBinaryOp(\"=~\", 0);\n  jsep.addBinaryOp(\"!~\", 0);\n\n  let ast;\n  try {\n    ast = jsep(expression);\n  } catch (e) {\n    throw new RuntimeError(e);\n  }\n\n  this._runtimeAst = createRuntimeAst(this, ast);\n}\n\nObject.defineProperties(Expression.prototype, {\n  /**\n   * Gets the expression defined in the 3D Tiles Styling language.\n   *\n   * @memberof Expression.prototype\n   *\n   * @type {string}\n   * @readonly\n   *\n   * @default undefined\n   */\n  expression: {\n    get: function () {\n      return this._expression;\n    },\n  },\n});\n\n// Scratch storage manager while evaluating deep expressions.\n// For example, an expression like dot(vec4(${red}), vec4(${green}) * vec4(${blue}) requires 3 scratch Cartesian4's\nconst scratchStorage = {\n  arrayIndex: 0,\n  arrayArray: [[]],\n  cartesian2Index: 0,\n  cartesian3Index: 0,\n  cartesian4Index: 0,\n  cartesian2Array: [new Cartesian2()],\n  cartesian3Array: [new Cartesian3()],\n  cartesian4Array: [new Cartesian4()],\n  reset: function () {\n    this.arrayIndex = 0;\n    this.cartesian2Index = 0;\n    this.cartesian3Index = 0;\n    this.cartesian4Index = 0;\n  },\n  getArray: function () {\n    if (this.arrayIndex >= this.arrayArray.length) {\n      this.arrayArray.push([]);\n    }\n    const array = this.arrayArray[this.arrayIndex++];\n    array.length = 0;\n    return array;\n  },\n  getCartesian2: function () {\n    if (this.cartesian2Index >= this.cartesian2Array.length) {\n      this.cartesian2Array.push(new Cartesian2());\n    }\n    return this.cartesian2Array[this.cartesian2Index++];\n  },\n  getCartesian3: function () {\n    if (this.cartesian3Index >= this.cartesian3Array.length) {\n      this.cartesian3Array.push(new Cartesian3());\n    }\n    return this.cartesian3Array[this.cartesian3Index++];\n  },\n  getCartesian4: function () {\n    if (this.cartesian4Index >= this.cartesian4Array.length) {\n      this.cartesian4Array.push(new Cartesian4());\n    }\n    return this.cartesian4Array[this.cartesian4Index++];\n  },\n};\n\n/**\n * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of\n * the expression in the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}\n * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript\n * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>\n * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,\n * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is\n * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.\n *\n * @param {Cesium3DTileFeature} feature The feature whose properties may be used as variables in the expression.\n * @param {object} [result] The object onto which to store the result.\n * @returns {boolean|number|string|RegExp|Cartesian2|Cartesian3|Cartesian4|Color} The result of evaluating the expression.\n */\nExpression.prototype.evaluate = function (feature, result) {\n  scratchStorage.reset();\n  const value = this._runtimeAst.evaluate(feature);\n  if (result instanceof Color && value instanceof Cartesian4) {\n    return Color.fromCartesian4(value, result);\n  }\n  if (\n    value instanceof Cartesian2 ||\n    value instanceof Cartesian3 ||\n    value instanceof Cartesian4\n  ) {\n    return value.clone(result);\n  }\n  return value;\n};\n\n/**\n * Evaluates the result of a Color expression, optionally using the provided feature's properties.\n * <p>\n * This is equivalent to {@link Expression#evaluate} but always returns a {@link Color} object.\n * </p>\n *\n * @param {Cesium3DTileFeature} feature The feature whose properties may be used as variables in the expression.\n * @param {Color} [result] The object in which to store the result\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n */\nExpression.prototype.evaluateColor = function (feature, result) {\n  scratchStorage.reset();\n  const color = this._runtimeAst.evaluate(feature);\n  return Color.fromCartesian4(color, result);\n};\n\n/**\n * Gets the shader function for this expression.\n * Returns undefined if the shader function can't be generated from this expression.\n *\n * @param {string} functionSignature Signature of the generated function.\n * @param {object} variableSubstitutionMap Maps variable names to shader variable names.\n * @param {object} shaderState Stores information about the generated shader function, including whether it is translucent.\n * @param {string} returnType The return type of the generated function.\n *\n * @returns {string} The shader function.\n *\n * @private\n */\nExpression.prototype.getShaderFunction = function (\n  functionSignature,\n  variableSubstitutionMap,\n  shaderState,\n  returnType\n) {\n  let shaderExpression = this.getShaderExpression(\n    variableSubstitutionMap,\n    shaderState\n  );\n\n  shaderExpression =\n    `${returnType} ${functionSignature}\\n` +\n    `{\\n` +\n    `    return ${shaderExpression};\\n` +\n    `}\\n`;\n\n  return shaderExpression;\n};\n\n/**\n * Gets the shader expression for this expression.\n * Returns undefined if the shader expression can't be generated from this expression.\n *\n * @param {object} variableSubstitutionMap Maps variable names to shader variable names.\n * @param {object} shaderState Stores information about the generated shader function, including whether it is translucent.\n *\n * @returns {string} The shader expression.\n *\n * @private\n */\nExpression.prototype.getShaderExpression = function (\n  variableSubstitutionMap,\n  shaderState\n) {\n  return this._runtimeAst.getShaderExpression(\n    variableSubstitutionMap,\n    shaderState\n  );\n};\n\n/**\n * Gets the variables used by the expression.\n *\n * @returns {string[]} The variables used by the expression.\n *\n * @private\n */\nExpression.prototype.getVariables = function () {\n  let variables = [];\n\n  this._runtimeAst.getVariables(variables);\n\n  // Remove duplicates\n  variables = variables.filter(function (variable, index, variables) {\n    return variables.indexOf(variable) === index;\n  });\n\n  return variables;\n};\n\nconst unaryOperators = [\"!\", \"-\", \"+\"];\nconst binaryOperators = [\n  \"+\",\n  \"-\",\n  \"*\",\n  \"/\",\n  \"%\",\n  \"===\",\n  \"!==\",\n  \">\",\n  \">=\",\n  \"<\",\n  \"<=\",\n  \"&&\",\n  \"||\",\n  \"!~\",\n  \"=~\",\n];\n\nconst variableRegex = /\\${(.*?)}/g; // Matches ${variable_name}\nconst backslashRegex = /\\\\/g;\nconst backslashReplacement = \"@#%\";\nconst replacementRegex = /@#%/g;\n\nconst scratchColor = new Color();\n\nconst unaryFunctions = {\n  abs: getEvaluateUnaryComponentwise(Math.abs),\n  sqrt: getEvaluateUnaryComponentwise(Math.sqrt),\n  cos: getEvaluateUnaryComponentwise(Math.cos),\n  sin: getEvaluateUnaryComponentwise(Math.sin),\n  tan: getEvaluateUnaryComponentwise(Math.tan),\n  acos: getEvaluateUnaryComponentwise(Math.acos),\n  asin: getEvaluateUnaryComponentwise(Math.asin),\n  atan: getEvaluateUnaryComponentwise(Math.atan),\n  radians: getEvaluateUnaryComponentwise(CesiumMath.toRadians),\n  degrees: getEvaluateUnaryComponentwise(CesiumMath.toDegrees),\n  sign: getEvaluateUnaryComponentwise(CesiumMath.sign),\n  floor: getEvaluateUnaryComponentwise(Math.floor),\n  ceil: getEvaluateUnaryComponentwise(Math.ceil),\n  round: getEvaluateUnaryComponentwise(Math.round),\n  exp: getEvaluateUnaryComponentwise(Math.exp),\n  exp2: getEvaluateUnaryComponentwise(exp2),\n  log: getEvaluateUnaryComponentwise(Math.log),\n  log2: getEvaluateUnaryComponentwise(log2),\n  fract: getEvaluateUnaryComponentwise(fract),\n  length: length,\n  normalize: normalize,\n};\n\nconst binaryFunctions = {\n  atan2: getEvaluateBinaryComponentwise(Math.atan2, false),\n  pow: getEvaluateBinaryComponentwise(Math.pow, false),\n  min: getEvaluateBinaryComponentwise(Math.min, true),\n  max: getEvaluateBinaryComponentwise(Math.max, true),\n  distance: distance,\n  dot: dot,\n  cross: cross,\n};\n\nconst ternaryFunctions = {\n  clamp: getEvaluateTernaryComponentwise(CesiumMath.clamp, true),\n  mix: getEvaluateTernaryComponentwise(CesiumMath.lerp, true),\n};\n\nfunction fract(number) {\n  return number - Math.floor(number);\n}\n\nfunction exp2(exponent) {\n  return Math.pow(2.0, exponent);\n}\n\nfunction log2(number) {\n  return CesiumMath.log2(number);\n}\n\nfunction getEvaluateUnaryComponentwise(operation) {\n  return function (call, left) {\n    if (typeof left === \"number\") {\n      return operation(left);\n    } else if (left instanceof Cartesian2) {\n      return Cartesian2.fromElements(\n        operation(left.x),\n        operation(left.y),\n        scratchStorage.getCartesian2()\n      );\n    } else if (left instanceof Cartesian3) {\n      return Cartesian3.fromElements(\n        operation(left.x),\n        operation(left.y),\n        operation(left.z),\n        scratchStorage.getCartesian3()\n      );\n    } else if (left instanceof Cartesian4) {\n      return Cartesian4.fromElements(\n        operation(left.x),\n        operation(left.y),\n        operation(left.z),\n        operation(left.w),\n        scratchStorage.getCartesian4()\n      );\n    }\n    throw new RuntimeError(\n      `Function \"${call}\" requires a vector or number argument. Argument is ${left}.`\n    );\n  };\n}\n\nfunction getEvaluateBinaryComponentwise(operation, allowScalar) {\n  return function (call, left, right) {\n    if (allowScalar && typeof right === \"number\") {\n      if (typeof left === \"number\") {\n        return operation(left, right);\n      } else if (left instanceof Cartesian2) {\n        return Cartesian2.fromElements(\n          operation(left.x, right),\n          operation(left.y, right),\n          scratchStorage.getCartesian2()\n        );\n      } else if (left instanceof Cartesian3) {\n        return Cartesian3.fromElements(\n          operation(left.x, right),\n          operation(left.y, right),\n          operation(left.z, right),\n          scratchStorage.getCartesian3()\n        );\n      } else if (left instanceof Cartesian4) {\n        return Cartesian4.fromElements(\n          operation(left.x, right),\n          operation(left.y, right),\n          operation(left.z, right),\n          operation(left.w, right),\n          scratchStorage.getCartesian4()\n        );\n      }\n    }\n\n    if (typeof left === \"number\" && typeof right === \"number\") {\n      return operation(left, right);\n    } else if (left instanceof Cartesian2 && right instanceof Cartesian2) {\n      return Cartesian2.fromElements(\n        operation(left.x, right.x),\n        operation(left.y, right.y),\n        scratchStorage.getCartesian2()\n      );\n    } else if (left instanceof Cartesian3 && right instanceof Cartesian3) {\n      return Cartesian3.fromElements(\n        operation(left.x, right.x),\n        operation(left.y, right.y),\n        operation(left.z, right.z),\n        scratchStorage.getCartesian3()\n      );\n    } else if (left instanceof Cartesian4 && right instanceof Cartesian4) {\n      return Cartesian4.fromElements(\n        operation(left.x, right.x),\n        operation(left.y, right.y),\n        operation(left.z, right.z),\n        operation(left.w, right.w),\n        scratchStorage.getCartesian4()\n      );\n    }\n\n    throw new RuntimeError(\n      `Function \"${call}\" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`\n    );\n  };\n}\n\nfunction getEvaluateTernaryComponentwise(operation, allowScalar) {\n  return function (call, left, right, test) {\n    if (allowScalar && typeof test === \"number\") {\n      if (typeof left === \"number\" && typeof right === \"number\") {\n        return operation(left, right, test);\n      } else if (left instanceof Cartesian2 && right instanceof Cartesian2) {\n        return Cartesian2.fromElements(\n          operation(left.x, right.x, test),\n          operation(left.y, right.y, test),\n          scratchStorage.getCartesian2()\n        );\n      } else if (left instanceof Cartesian3 && right instanceof Cartesian3) {\n        return Cartesian3.fromElements(\n          operation(left.x, right.x, test),\n          operation(left.y, right.y, test),\n          operation(left.z, right.z, test),\n          scratchStorage.getCartesian3()\n        );\n      } else if (left instanceof Cartesian4 && right instanceof Cartesian4) {\n        return Cartesian4.fromElements(\n          operation(left.x, right.x, test),\n          operation(left.y, right.y, test),\n          operation(left.z, right.z, test),\n          operation(left.w, right.w, test),\n          scratchStorage.getCartesian4()\n        );\n      }\n    }\n\n    if (\n      typeof left === \"number\" &&\n      typeof right === \"number\" &&\n      typeof test === \"number\"\n    ) {\n      return operation(left, right, test);\n    } else if (\n      left instanceof Cartesian2 &&\n      right instanceof Cartesian2 &&\n      test instanceof Cartesian2\n    ) {\n      return Cartesian2.fromElements(\n        operation(left.x, right.x, test.x),\n        operation(left.y, right.y, test.y),\n        scratchStorage.getCartesian2()\n      );\n    } else if (\n      left instanceof Cartesian3 &&\n      right instanceof Cartesian3 &&\n      test instanceof Cartesian3\n    ) {\n      return Cartesian3.fromElements(\n        operation(left.x, right.x, test.x),\n        operation(left.y, right.y, test.y),\n        operation(left.z, right.z, test.z),\n        scratchStorage.getCartesian3()\n      );\n    } else if (\n      left instanceof Cartesian4 &&\n      right instanceof Cartesian4 &&\n      test instanceof Cartesian4\n    ) {\n      return Cartesian4.fromElements(\n        operation(left.x, right.x, test.x),\n        operation(left.y, right.y, test.y),\n        operation(left.z, right.z, test.z),\n        operation(left.w, right.w, test.w),\n        scratchStorage.getCartesian4()\n      );\n    }\n\n    throw new RuntimeError(\n      `Function \"${call}\" requires vector or number arguments of matching types. Arguments are ${left}, ${right}, and ${test}.`\n    );\n  };\n}\n\nfunction length(call, left) {\n  if (typeof left === \"number\") {\n    return Math.abs(left);\n  } else if (left instanceof Cartesian2) {\n    return Cartesian2.magnitude(left);\n  } else if (left instanceof Cartesian3) {\n    return Cartesian3.magnitude(left);\n  } else if (left instanceof Cartesian4) {\n    return Cartesian4.magnitude(left);\n  }\n\n  throw new RuntimeError(\n    `Function \"${call}\" requires a vector or number argument. Argument is ${left}.`\n  );\n}\n\nfunction normalize(call, left) {\n  if (typeof left === \"number\") {\n    return 1.0;\n  } else if (left instanceof Cartesian2) {\n    return Cartesian2.normalize(left, scratchStorage.getCartesian2());\n  } else if (left instanceof Cartesian3) {\n    return Cartesian3.normalize(left, scratchStorage.getCartesian3());\n  } else if (left instanceof Cartesian4) {\n    return Cartesian4.normalize(left, scratchStorage.getCartesian4());\n  }\n\n  throw new RuntimeError(\n    `Function \"${call}\" requires a vector or number argument. Argument is ${left}.`\n  );\n}\n\nfunction distance(call, left, right) {\n  if (typeof left === \"number\" && typeof right === \"number\") {\n    return Math.abs(left - right);\n  } else if (left instanceof Cartesian2 && right instanceof Cartesian2) {\n    return Cartesian2.distance(left, right);\n  } else if (left instanceof Cartesian3 && right instanceof Cartesian3) {\n    return Cartesian3.distance(left, right);\n  } else if (left instanceof Cartesian4 && right instanceof Cartesian4) {\n    return Cartesian4.distance(left, right);\n  }\n\n  throw new RuntimeError(\n    `Function \"${call}\" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`\n  );\n}\n\nfunction dot(call, left, right) {\n  if (typeof left === \"number\" && typeof right === \"number\") {\n    return left * right;\n  } else if (left instanceof Cartesian2 && right instanceof Cartesian2) {\n    return Cartesian2.dot(left, right);\n  } else if (left instanceof Cartesian3 && right instanceof Cartesian3) {\n    return Cartesian3.dot(left, right);\n  } else if (left instanceof Cartesian4 && right instanceof Cartesian4) {\n    return Cartesian4.dot(left, right);\n  }\n\n  throw new RuntimeError(\n    `Function \"${call}\" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`\n  );\n}\n\nfunction cross(call, left, right) {\n  if (left instanceof Cartesian3 && right instanceof Cartesian3) {\n    return Cartesian3.cross(left, right, scratchStorage.getCartesian3());\n  }\n\n  throw new RuntimeError(\n    `Function \"${call}\" requires vec3 arguments. Arguments are ${left} and ${right}.`\n  );\n}\n\nfunction Node(type, value, left, right, test) {\n  this._type = type;\n  this._value = value;\n  this._left = left;\n  this._right = right;\n  this._test = test;\n  this.evaluate = undefined;\n\n  setEvaluateFunction(this);\n}\n\nfunction replaceDefines(expression, defines) {\n  if (!defined(defines)) {\n    return expression;\n  }\n  for (const key in defines) {\n    if (defines.hasOwnProperty(key)) {\n      const definePlaceholder = new RegExp(`\\\\$\\\\{${key}\\\\}`, \"g\");\n      const defineReplace = `(${defines[key]})`;\n      if (defined(defineReplace)) {\n        expression = expression.replace(definePlaceholder, defineReplace);\n      }\n    }\n  }\n  return expression;\n}\n\nfunction removeBackslashes(expression) {\n  return expression.replace(backslashRegex, backslashReplacement);\n}\n\nfunction replaceBackslashes(expression) {\n  return expression.replace(replacementRegex, \"\\\\\");\n}\n\nfunction replaceVariables(expression) {\n  let exp = expression;\n  let result = \"\";\n  let i = exp.indexOf(\"${\");\n  while (i >= 0) {\n    // Check if string is inside quotes\n    const openSingleQuote = exp.indexOf(\"'\");\n    const openDoubleQuote = exp.indexOf('\"');\n    let closeQuote;\n    if (openSingleQuote >= 0 && openSingleQuote < i) {\n      closeQuote = exp.indexOf(\"'\", openSingleQuote + 1);\n      result += exp.substr(0, closeQuote + 1);\n      exp = exp.substr(closeQuote + 1);\n      i = exp.indexOf(\"${\");\n    } else if (openDoubleQuote >= 0 && openDoubleQuote < i) {\n      closeQuote = exp.indexOf('\"', openDoubleQuote + 1);\n      result += exp.substr(0, closeQuote + 1);\n      exp = exp.substr(closeQuote + 1);\n      i = exp.indexOf(\"${\");\n    } else {\n      result += exp.substr(0, i);\n      const j = exp.indexOf(\"}\");\n      if (j < 0) {\n        throw new RuntimeError(\"Unmatched {.\");\n      }\n      result += `czm_${exp.substr(i + 2, j - (i + 2))}`;\n      exp = exp.substr(j + 1);\n      i = exp.indexOf(\"${\");\n    }\n  }\n  result += exp;\n  return result;\n}\n\nfunction parseLiteral(ast) {\n  const type = typeof ast.value;\n  if (ast.value === null) {\n    return new Node(ExpressionNodeType.LITERAL_NULL, null);\n  } else if (type === \"boolean\") {\n    return new Node(ExpressionNodeType.LITERAL_BOOLEAN, ast.value);\n  } else if (type === \"number\") {\n    return new Node(ExpressionNodeType.LITERAL_NUMBER, ast.value);\n  } else if (type === \"string\") {\n    if (ast.value.indexOf(\"${\") >= 0) {\n      return new Node(ExpressionNodeType.VARIABLE_IN_STRING, ast.value);\n    }\n    return new Node(\n      ExpressionNodeType.LITERAL_STRING,\n      replaceBackslashes(ast.value)\n    );\n  }\n}\n\nfunction parseCall(expression, ast) {\n  const args = ast.arguments;\n  const argsLength = args.length;\n  let call;\n  let val, left, right;\n\n  // Member function calls\n  if (ast.callee.type === \"MemberExpression\") {\n    call = ast.callee.property.name;\n    const object = ast.callee.object;\n    if (call === \"test\" || call === \"exec\") {\n      // Make sure this is called on a valid type\n      if (!defined(object.callee) || object.callee.name !== \"regExp\") {\n        throw new RuntimeError(`${call} is not a function.`);\n      }\n      if (argsLength === 0) {\n        if (call === \"test\") {\n          return new Node(ExpressionNodeType.LITERAL_BOOLEAN, false);\n        }\n        return new Node(ExpressionNodeType.LITERAL_NULL, null);\n      }\n      left = createRuntimeAst(expression, object);\n      right = createRuntimeAst(expression, args[0]);\n      return new Node(ExpressionNodeType.FUNCTION_CALL, call, left, right);\n    } else if (call === \"toString\") {\n      val = createRuntimeAst(expression, object);\n      return new Node(ExpressionNodeType.FUNCTION_CALL, call, val);\n    }\n\n    throw new RuntimeError(`Unexpected function call \"${call}\".`);\n  }\n\n  // Non-member function calls\n  call = ast.callee.name;\n  if (call === \"color\") {\n    if (argsLength === 0) {\n      return new Node(ExpressionNodeType.LITERAL_COLOR, call);\n    }\n    val = createRuntimeAst(expression, args[0]);\n    if (defined(args[1])) {\n      const alpha = createRuntimeAst(expression, args[1]);\n      return new Node(ExpressionNodeType.LITERAL_COLOR, call, [val, alpha]);\n    }\n    return new Node(ExpressionNodeType.LITERAL_COLOR, call, [val]);\n  } else if (call === \"rgb\" || call === \"hsl\") {\n    if (argsLength < 3) {\n      throw new RuntimeError(`${call} requires three arguments.`);\n    }\n    val = [\n      createRuntimeAst(expression, args[0]),\n      createRuntimeAst(expression, args[1]),\n      createRuntimeAst(expression, args[2]),\n    ];\n    return new Node(ExpressionNodeType.LITERAL_COLOR, call, val);\n  } else if (call === \"rgba\" || call === \"hsla\") {\n    if (argsLength < 4) {\n      throw new RuntimeError(`${call} requires four arguments.`);\n    }\n    val = [\n      createRuntimeAst(expression, args[0]),\n      createRuntimeAst(expression, args[1]),\n      createRuntimeAst(expression, args[2]),\n      createRuntimeAst(expression, args[3]),\n    ];\n    return new Node(ExpressionNodeType.LITERAL_COLOR, call, val);\n  } else if (call === \"vec2\" || call === \"vec3\" || call === \"vec4\") {\n    // Check for invalid constructors at evaluation time\n    val = new Array(argsLength);\n    for (let i = 0; i < argsLength; ++i) {\n      val[i] = createRuntimeAst(expression, args[i]);\n    }\n    return new Node(ExpressionNodeType.LITERAL_VECTOR, call, val);\n  } else if (call === \"isNaN\" || call === \"isFinite\") {\n    if (argsLength === 0) {\n      if (call === \"isNaN\") {\n        return new Node(ExpressionNodeType.LITERAL_BOOLEAN, true);\n      }\n      return new Node(ExpressionNodeType.LITERAL_BOOLEAN, false);\n    }\n    val = createRuntimeAst(expression, args[0]);\n    return new Node(ExpressionNodeType.UNARY, call, val);\n  } else if (call === \"isExactClass\" || call === \"isClass\") {\n    if (argsLength < 1 || argsLength > 1) {\n      throw new RuntimeError(`${call} requires exactly one argument.`);\n    }\n    val = createRuntimeAst(expression, args[0]);\n    return new Node(ExpressionNodeType.UNARY, call, val);\n  } else if (call === \"getExactClassName\") {\n    if (argsLength > 0) {\n      throw new RuntimeError(`${call} does not take any argument.`);\n    }\n    return new Node(ExpressionNodeType.UNARY, call);\n  } else if (defined(unaryFunctions[call])) {\n    if (argsLength !== 1) {\n      throw new RuntimeError(`${call} requires exactly one argument.`);\n    }\n    val = createRuntimeAst(expression, args[0]);\n    return new Node(ExpressionNodeType.UNARY, call, val);\n  } else if (defined(binaryFunctions[call])) {\n    if (argsLength !== 2) {\n      throw new RuntimeError(`${call} requires exactly two arguments.`);\n    }\n    left = createRuntimeAst(expression, args[0]);\n    right = createRuntimeAst(expression, args[1]);\n    return new Node(ExpressionNodeType.BINARY, call, left, right);\n  } else if (defined(ternaryFunctions[call])) {\n    if (argsLength !== 3) {\n      throw new RuntimeError(`${call} requires exactly three arguments.`);\n    }\n    left = createRuntimeAst(expression, args[0]);\n    right = createRuntimeAst(expression, args[1]);\n    const test = createRuntimeAst(expression, args[2]);\n    return new Node(ExpressionNodeType.TERNARY, call, left, right, test);\n  } else if (call === \"Boolean\") {\n    if (argsLength === 0) {\n      return new Node(ExpressionNodeType.LITERAL_BOOLEAN, false);\n    }\n    val = createRuntimeAst(expression, args[0]);\n    return new Node(ExpressionNodeType.UNARY, call, val);\n  } else if (call === \"Number\") {\n    if (argsLength === 0) {\n      return new Node(ExpressionNodeType.LITERAL_NUMBER, 0);\n    }\n    val = createRuntimeAst(expression, args[0]);\n    return new Node(ExpressionNodeType.UNARY, call, val);\n  } else if (call === \"String\") {\n    if (argsLength === 0) {\n      return new Node(ExpressionNodeType.LITERAL_STRING, \"\");\n    }\n    val = createRuntimeAst(expression, args[0]);\n    return new Node(ExpressionNodeType.UNARY, call, val);\n  } else if (call === \"regExp\") {\n    return parseRegex(expression, ast);\n  }\n\n  throw new RuntimeError(`Unexpected function call \"${call}\".`);\n}\n\nfunction parseRegex(expression, ast) {\n  const args = ast.arguments;\n  // no arguments, return default regex\n  if (args.length === 0) {\n    return new Node(ExpressionNodeType.LITERAL_REGEX, new RegExp());\n  }\n\n  const pattern = createRuntimeAst(expression, args[0]);\n  let exp;\n\n  // optional flag argument supplied\n  if (args.length > 1) {\n    const flags = createRuntimeAst(expression, args[1]);\n    if (isLiteralType(pattern) && isLiteralType(flags)) {\n      try {\n        exp = new RegExp(\n          replaceBackslashes(String(pattern._value)),\n          flags._value\n        );\n      } catch (e) {\n        throw new RuntimeError(e);\n      }\n      return new Node(ExpressionNodeType.LITERAL_REGEX, exp);\n    }\n    return new Node(ExpressionNodeType.REGEX, pattern, flags);\n  }\n\n  // only pattern argument supplied\n  if (isLiteralType(pattern)) {\n    try {\n      exp = new RegExp(replaceBackslashes(String(pattern._value)));\n    } catch (e) {\n      throw new RuntimeError(e);\n    }\n    return new Node(ExpressionNodeType.LITERAL_REGEX, exp);\n  }\n  return new Node(ExpressionNodeType.REGEX, pattern);\n}\n\nfunction parseKeywordsAndVariables(ast) {\n  if (isVariable(ast.name)) {\n    const name = getPropertyName(ast.name);\n    if (name.substr(0, 8) === \"tiles3d_\") {\n      return new Node(ExpressionNodeType.BUILTIN_VARIABLE, name);\n    }\n    return new Node(ExpressionNodeType.VARIABLE, name);\n  } else if (ast.name === \"NaN\") {\n    return new Node(ExpressionNodeType.LITERAL_NUMBER, NaN);\n  } else if (ast.name === \"Infinity\") {\n    return new Node(ExpressionNodeType.LITERAL_NUMBER, Infinity);\n  } else if (ast.name === \"undefined\") {\n    return new Node(ExpressionNodeType.LITERAL_UNDEFINED, undefined);\n  }\n\n  throw new RuntimeError(`${ast.name} is not defined.`);\n}\n\nfunction parseMathConstant(ast) {\n  const name = ast.property.name;\n  if (name === \"PI\") {\n    return new Node(ExpressionNodeType.LITERAL_NUMBER, Math.PI);\n  } else if (name === \"E\") {\n    return new Node(ExpressionNodeType.LITERAL_NUMBER, Math.E);\n  }\n}\n\nfunction parseNumberConstant(ast) {\n  const name = ast.property.name;\n  if (name === \"POSITIVE_INFINITY\") {\n    return new Node(\n      ExpressionNodeType.LITERAL_NUMBER,\n      Number.POSITIVE_INFINITY\n    );\n  }\n}\n\nfunction parseMemberExpression(expression, ast) {\n  if (ast.object.name === \"Math\") {\n    return parseMathConstant(ast);\n  } else if (ast.object.name === \"Number\") {\n    return parseNumberConstant(ast);\n  }\n\n  let val;\n  const obj = createRuntimeAst(expression, ast.object);\n  if (ast.computed) {\n    val = createRuntimeAst(expression, ast.property);\n    return new Node(ExpressionNodeType.MEMBER, \"brackets\", obj, val);\n  }\n\n  val = new Node(ExpressionNodeType.LITERAL_STRING, ast.property.name);\n  return new Node(ExpressionNodeType.MEMBER, \"dot\", obj, val);\n}\n\nfunction isLiteralType(node) {\n  return node._type >= ExpressionNodeType.LITERAL_NULL;\n}\n\nfunction isVariable(name) {\n  return name.substr(0, 4) === \"czm_\";\n}\n\nfunction getPropertyName(variable) {\n  return variable.substr(4);\n}\n\nfunction createRuntimeAst(expression, ast) {\n  let node;\n  let op;\n  let left;\n  let right;\n\n  if (ast.type === \"Literal\") {\n    node = parseLiteral(ast);\n  } else if (ast.type === \"CallExpression\") {\n    node = parseCall(expression, ast);\n  } else if (ast.type === \"Identifier\") {\n    node = parseKeywordsAndVariables(ast);\n  } else if (ast.type === \"UnaryExpression\") {\n    op = ast.operator;\n    const child = createRuntimeAst(expression, ast.argument);\n    if (unaryOperators.indexOf(op) > -1) {\n      node = new Node(ExpressionNodeType.UNARY, op, child);\n    } else {\n      throw new RuntimeError(`Unexpected operator \"${op}\".`);\n    }\n  } else if (ast.type === \"BinaryExpression\") {\n    op = ast.operator;\n    left = createRuntimeAst(expression, ast.left);\n    right = createRuntimeAst(expression, ast.right);\n    if (binaryOperators.indexOf(op) > -1) {\n      node = new Node(ExpressionNodeType.BINARY, op, left, right);\n    } else {\n      throw new RuntimeError(`Unexpected operator \"${op}\".`);\n    }\n  } else if (ast.type === \"LogicalExpression\") {\n    op = ast.operator;\n    left = createRuntimeAst(expression, ast.left);\n    right = createRuntimeAst(expression, ast.right);\n    if (binaryOperators.indexOf(op) > -1) {\n      node = new Node(ExpressionNodeType.BINARY, op, left, right);\n    }\n  } else if (ast.type === \"ConditionalExpression\") {\n    const test = createRuntimeAst(expression, ast.test);\n    left = createRuntimeAst(expression, ast.consequent);\n    right = createRuntimeAst(expression, ast.alternate);\n    node = new Node(ExpressionNodeType.CONDITIONAL, \"?\", left, right, test);\n  } else if (ast.type === \"MemberExpression\") {\n    node = parseMemberExpression(expression, ast);\n  } else if (ast.type === \"ArrayExpression\") {\n    const val = [];\n    for (let i = 0; i < ast.elements.length; i++) {\n      val[i] = createRuntimeAst(expression, ast.elements[i]);\n    }\n    node = new Node(ExpressionNodeType.ARRAY, val);\n  } else if (ast.type === \"Compound\") {\n    // empty expression or multiple expressions\n    throw new RuntimeError(\"Provide exactly one expression.\");\n  } else {\n    throw new RuntimeError(\"Cannot parse expression.\");\n  }\n\n  return node;\n}\n\nfunction setEvaluateFunction(node) {\n  if (node._type === ExpressionNodeType.CONDITIONAL) {\n    node.evaluate = node._evaluateConditional;\n  } else if (node._type === ExpressionNodeType.FUNCTION_CALL) {\n    if (node._value === \"test\") {\n      node.evaluate = node._evaluateRegExpTest;\n    } else if (node._value === \"exec\") {\n      node.evaluate = node._evaluateRegExpExec;\n    } else if (node._value === \"toString\") {\n      node.evaluate = node._evaluateToString;\n    }\n  } else if (node._type === ExpressionNodeType.UNARY) {\n    if (node._value === \"!\") {\n      node.evaluate = node._evaluateNot;\n    } else if (node._value === \"-\") {\n      node.evaluate = node._evaluateNegative;\n    } else if (node._value === \"+\") {\n      node.evaluate = node._evaluatePositive;\n    } else if (node._value === \"isNaN\") {\n      node.evaluate = node._evaluateNaN;\n    } else if (node._value === \"isFinite\") {\n      node.evaluate = node._evaluateIsFinite;\n    } else if (node._value === \"isExactClass\") {\n      node.evaluate = node._evaluateIsExactClass;\n    } else if (node._value === \"isClass\") {\n      node.evaluate = node._evaluateIsClass;\n    } else if (node._value === \"getExactClassName\") {\n      node.evaluate = node._evaluateGetExactClassName;\n    } else if (node._value === \"Boolean\") {\n      node.evaluate = node._evaluateBooleanConversion;\n    } else if (node._value === \"Number\") {\n      node.evaluate = node._evaluateNumberConversion;\n    } else if (node._value === \"String\") {\n      node.evaluate = node._evaluateStringConversion;\n    } else if (defined(unaryFunctions[node._value])) {\n      node.evaluate = getEvaluateUnaryFunction(node._value);\n    }\n  } else if (node._type === ExpressionNodeType.BINARY) {\n    if (node._value === \"+\") {\n      node.evaluate = node._evaluatePlus;\n    } else if (node._value === \"-\") {\n      node.evaluate = node._evaluateMinus;\n    } else if (node._value === \"*\") {\n      node.evaluate = node._evaluateTimes;\n    } else if (node._value === \"/\") {\n      node.evaluate = node._evaluateDivide;\n    } else if (node._value === \"%\") {\n      node.evaluate = node._evaluateMod;\n    } else if (node._value === \"===\") {\n      node.evaluate = node._evaluateEqualsStrict;\n    } else if (node._value === \"!==\") {\n      node.evaluate = node._evaluateNotEqualsStrict;\n    } else if (node._value === \"<\") {\n      node.evaluate = node._evaluateLessThan;\n    } else if (node._value === \"<=\") {\n      node.evaluate = node._evaluateLessThanOrEquals;\n    } else if (node._value === \">\") {\n      node.evaluate = node._evaluateGreaterThan;\n    } else if (node._value === \">=\") {\n      node.evaluate = node._evaluateGreaterThanOrEquals;\n    } else if (node._value === \"&&\") {\n      node.evaluate = node._evaluateAnd;\n    } else if (node._value === \"||\") {\n      node.evaluate = node._evaluateOr;\n    } else if (node._value === \"=~\") {\n      node.evaluate = node._evaluateRegExpMatch;\n    } else if (node._value === \"!~\") {\n      node.evaluate = node._evaluateRegExpNotMatch;\n    } else if (defined(binaryFunctions[node._value])) {\n      node.evaluate = getEvaluateBinaryFunction(node._value);\n    }\n  } else if (node._type === ExpressionNodeType.TERNARY) {\n    node.evaluate = getEvaluateTernaryFunction(node._value);\n  } else if (node._type === ExpressionNodeType.MEMBER) {\n    if (node._value === \"brackets\") {\n      node.evaluate = node._evaluateMemberBrackets;\n    } else {\n      node.evaluate = node._evaluateMemberDot;\n    }\n  } else if (node._type === ExpressionNodeType.ARRAY) {\n    node.evaluate = node._evaluateArray;\n  } else if (node._type === ExpressionNodeType.VARIABLE) {\n    node.evaluate = node._evaluateVariable;\n  } else if (node._type === ExpressionNodeType.VARIABLE_IN_STRING) {\n    node.evaluate = node._evaluateVariableString;\n  } else if (node._type === ExpressionNodeType.LITERAL_COLOR) {\n    node.evaluate = node._evaluateLiteralColor;\n  } else if (node._type === ExpressionNodeType.LITERAL_VECTOR) {\n    node.evaluate = node._evaluateLiteralVector;\n  } else if (node._type === ExpressionNodeType.LITERAL_STRING) {\n    node.evaluate = node._evaluateLiteralString;\n  } else if (node._type === ExpressionNodeType.REGEX) {\n    node.evaluate = node._evaluateRegExp;\n  } else if (node._type === ExpressionNodeType.BUILTIN_VARIABLE) {\n    if (node._value === \"tiles3d_tileset_time\") {\n      node.evaluate = evaluateTilesetTime;\n    }\n  } else {\n    node.evaluate = node._evaluateLiteral;\n  }\n}\n\nfunction evaluateTilesetTime(feature) {\n  if (!defined(feature)) {\n    return 0.0;\n  }\n  return feature.content.tileset.timeSinceLoad;\n}\n\nfunction getEvaluateUnaryFunction(call) {\n  const evaluate = unaryFunctions[call];\n  return function (feature) {\n    const left = this._left.evaluate(feature);\n    return evaluate(call, left);\n  };\n}\n\nfunction getEvaluateBinaryFunction(call) {\n  const evaluate = binaryFunctions[call];\n  return function (feature) {\n    const left = this._left.evaluate(feature);\n    const right = this._right.evaluate(feature);\n    return evaluate(call, left, right);\n  };\n}\n\nfunction getEvaluateTernaryFunction(call) {\n  const evaluate = ternaryFunctions[call];\n  return function (feature) {\n    const left = this._left.evaluate(feature);\n    const right = this._right.evaluate(feature);\n    const test = this._test.evaluate(feature);\n    return evaluate(call, left, right, test);\n  };\n}\n\nfunction getFeatureProperty(feature, name) {\n  // Returns undefined if the feature is not defined or the property name is not defined for that feature\n  if (defined(feature)) {\n    return feature.getPropertyInherited(name);\n  }\n}\n\nNode.prototype._evaluateLiteral = function () {\n  return this._value;\n};\n\nNode.prototype._evaluateLiteralColor = function (feature) {\n  const color = scratchColor;\n  const args = this._left;\n  if (this._value === \"color\") {\n    if (!defined(args)) {\n      Color.fromBytes(255, 255, 255, 255, color);\n    } else if (args.length > 1) {\n      Color.fromCssColorString(args[0].evaluate(feature), color);\n      color.alpha = args[1].evaluate(feature);\n    } else {\n      Color.fromCssColorString(args[0].evaluate(feature), color);\n    }\n  } else if (this._value === \"rgb\") {\n    Color.fromBytes(\n      args[0].evaluate(feature),\n      args[1].evaluate(feature),\n      args[2].evaluate(feature),\n      255,\n      color\n    );\n  } else if (this._value === \"rgba\") {\n    // convert between css alpha (0 to 1) and cesium alpha (0 to 255)\n    const a = args[3].evaluate(feature) * 255;\n    Color.fromBytes(\n      args[0].evaluate(feature),\n      args[1].evaluate(feature),\n      args[2].evaluate(feature),\n      a,\n      color\n    );\n  } else if (this._value === \"hsl\") {\n    Color.fromHsl(\n      args[0].evaluate(feature),\n      args[1].evaluate(feature),\n      args[2].evaluate(feature),\n      1.0,\n      color\n    );\n  } else if (this._value === \"hsla\") {\n    Color.fromHsl(\n      args[0].evaluate(feature),\n      args[1].evaluate(feature),\n      args[2].evaluate(feature),\n      args[3].evaluate(feature),\n      color\n    );\n  }\n  return Cartesian4.fromColor(color, scratchStorage.getCartesian4());\n};\n\nNode.prototype._evaluateLiteralVector = function (feature) {\n  // Gather the components that make up the vector, which includes components from interior vectors.\n  // For example vec3(1, 2, 3) or vec3(vec2(1, 2), 3) are both valid.\n  //\n  // If the number of components does not equal the vector's size, then a RuntimeError is thrown - with two exceptions:\n  // 1. A vector may be constructed from a larger vector and drop the extra components.\n  // 2. A vector may be constructed from a single component - vec3(1) will become vec3(1, 1, 1).\n  //\n  // Examples of invalid constructors include:\n  // vec4(1, 2)        // not enough components\n  // vec3(vec2(1, 2))  // not enough components\n  // vec3(1, 2, 3, 4)  // too many components\n  // vec2(vec4(1), 1)  // too many components\n\n  const components = scratchStorage.getArray();\n  const call = this._value;\n  const args = this._left;\n  const argsLength = args.length;\n  for (let i = 0; i < argsLength; ++i) {\n    const value = args[i].evaluate(feature);\n    if (typeof value === \"number\") {\n      components.push(value);\n    } else if (value instanceof Cartesian2) {\n      components.push(value.x, value.y);\n    } else if (value instanceof Cartesian3) {\n      components.push(value.x, value.y, value.z);\n    } else if (value instanceof Cartesian4) {\n      components.push(value.x, value.y, value.z, value.w);\n    } else {\n      throw new RuntimeError(\n        `${call} argument must be a vector or number. Argument is ${value}.`\n      );\n    }\n  }\n\n  const componentsLength = components.length;\n  const vectorLength = parseInt(call.charAt(3));\n\n  if (componentsLength === 0) {\n    throw new RuntimeError(`Invalid ${call} constructor. No valid arguments.`);\n  } else if (componentsLength < vectorLength && componentsLength > 1) {\n    throw new RuntimeError(\n      `Invalid ${call} constructor. Not enough arguments.`\n    );\n  } else if (componentsLength > vectorLength && argsLength > 1) {\n    throw new RuntimeError(`Invalid ${call} constructor. Too many arguments.`);\n  }\n\n  if (componentsLength === 1) {\n    // Add the same component 3 more times\n    const component = components[0];\n    components.push(component, component, component);\n  }\n\n  if (call === \"vec2\") {\n    return Cartesian2.fromArray(components, 0, scratchStorage.getCartesian2());\n  } else if (call === \"vec3\") {\n    return Cartesian3.fromArray(components, 0, scratchStorage.getCartesian3());\n  } else if (call === \"vec4\") {\n    return Cartesian4.fromArray(components, 0, scratchStorage.getCartesian4());\n  }\n};\n\nNode.prototype._evaluateLiteralString = function () {\n  return this._value;\n};\n\nNode.prototype._evaluateVariableString = function (feature) {\n  let result = this._value;\n  let match = variableRegex.exec(result);\n  while (match !== null) {\n    const placeholder = match[0];\n    const variableName = match[1];\n    let property = getFeatureProperty(feature, variableName);\n    if (!defined(property)) {\n      property = \"\";\n    }\n    result = result.replace(placeholder, property);\n    match = variableRegex.exec(result);\n  }\n  return result;\n};\n\nNode.prototype._evaluateVariable = function (feature) {\n  // evaluates to undefined if the property name is not defined for that feature\n  return getFeatureProperty(feature, this._value);\n};\n\nfunction checkFeature(ast) {\n  return ast._value === \"feature\";\n}\n\n// PERFORMANCE_IDEA: Determine if parent property needs to be computed before runtime\nNode.prototype._evaluateMemberDot = function (feature) {\n  if (checkFeature(this._left)) {\n    return getFeatureProperty(feature, this._right.evaluate(feature));\n  }\n  const property = this._left.evaluate(feature);\n  if (!defined(property)) {\n    return undefined;\n  }\n\n  const member = this._right.evaluate(feature);\n  if (\n    property instanceof Cartesian2 ||\n    property instanceof Cartesian3 ||\n    property instanceof Cartesian4\n  ) {\n    // Vector components may be accessed with .r, .g, .b, .a and implicitly with .x, .y, .z, .w\n    if (member === \"r\") {\n      return property.x;\n    } else if (member === \"g\") {\n      return property.y;\n    } else if (member === \"b\") {\n      return property.z;\n    } else if (member === \"a\") {\n      return property.w;\n    }\n  }\n  return property[member];\n};\n\nNode.prototype._evaluateMemberBrackets = function (feature) {\n  if (checkFeature(this._left)) {\n    return getFeatureProperty(feature, this._right.evaluate(feature));\n  }\n  const property = this._left.evaluate(feature);\n  if (!defined(property)) {\n    return undefined;\n  }\n\n  const member = this._right.evaluate(feature);\n  if (\n    property instanceof Cartesian2 ||\n    property instanceof Cartesian3 ||\n    property instanceof Cartesian4\n  ) {\n    // Vector components may be accessed with [0][1][2][3], ['r']['g']['b']['a'] and implicitly with ['x']['y']['z']['w']\n    // For Cartesian2 and Cartesian3 out-of-range components will just return undefined\n    if (member === 0 || member === \"r\") {\n      return property.x;\n    } else if (member === 1 || member === \"g\") {\n      return property.y;\n    } else if (member === 2 || member === \"b\") {\n      return property.z;\n    } else if (member === 3 || member === \"a\") {\n      return property.w;\n    }\n  }\n  return property[member];\n};\n\nNode.prototype._evaluateArray = function (feature) {\n  const array = [];\n  for (let i = 0; i < this._value.length; i++) {\n    array[i] = this._value[i].evaluate(feature);\n  }\n  return array;\n};\n\n// PERFORMANCE_IDEA: Have \"fast path\" functions that deal only with specific types\n// that we can assign if we know the types before runtime\n\nNode.prototype._evaluateNot = function (feature) {\n  const left = this._left.evaluate(feature);\n  if (typeof left !== \"boolean\") {\n    throw new RuntimeError(\n      `Operator \"!\" requires a boolean argument. Argument is ${left}.`\n    );\n  }\n  return !left;\n};\n\nNode.prototype._evaluateNegative = function (feature) {\n  const left = this._left.evaluate(feature);\n  if (left instanceof Cartesian2) {\n    return Cartesian2.negate(left, scratchStorage.getCartesian2());\n  } else if (left instanceof Cartesian3) {\n    return Cartesian3.negate(left, scratchStorage.getCartesian3());\n  } else if (left instanceof Cartesian4) {\n    return Cartesian4.negate(left, scratchStorage.getCartesian4());\n  } else if (typeof left === \"number\") {\n    return -left;\n  }\n\n  throw new RuntimeError(\n    `Operator \"-\" requires a vector or number argument. Argument is ${left}.`\n  );\n};\n\nNode.prototype._evaluatePositive = function (feature) {\n  const left = this._left.evaluate(feature);\n\n  if (\n    !(\n      left instanceof Cartesian2 ||\n      left instanceof Cartesian3 ||\n      left instanceof Cartesian4 ||\n      typeof left === \"number\"\n    )\n  ) {\n    throw new RuntimeError(\n      `Operator \"+\" requires a vector or number argument. Argument is ${left}.`\n    );\n  }\n\n  return left;\n};\n\nNode.prototype._evaluateLessThan = function (feature) {\n  const left = this._left.evaluate(feature);\n  const right = this._right.evaluate(feature);\n\n  if (typeof left !== \"number\" || typeof right !== \"number\") {\n    throw new RuntimeError(\n      `Operator \"<\" requires number arguments. Arguments are ${left} and ${right}.`\n    );\n  }\n\n  return left < right;\n};\n\nNode.prototype._evaluateLessThanOrEquals = function (feature) {\n  const left = this._left.evaluate(feature);\n  const right = this._right.evaluate(feature);\n\n  if (typeof left !== \"number\" || typeof right !== \"number\") {\n    throw new RuntimeError(\n      `Operator \"<=\" requires number arguments. Arguments are ${left} and ${right}.`\n    );\n  }\n\n  return left <= right;\n};\n\nNode.prototype._evaluateGreaterThan = function (feature) {\n  const left = this._left.evaluate(feature);\n  const right = this._right.evaluate(feature);\n\n  if (typeof left !== \"number\" || typeof right !== \"number\") {\n    throw new RuntimeError(\n      `Operator \">\" requires number arguments. Arguments are ${left} and ${right}.`\n    );\n  }\n\n  return left > right;\n};\n\nNode.prototype._evaluateGreaterThanOrEquals = function (feature) {\n  const left = this._left.evaluate(feature);\n  const right = this._right.evaluate(feature);\n\n  if (typeof left !== \"number\" || typeof right !== \"number\") {\n    throw new RuntimeError(\n      `Operator \">=\" requires number arguments. Arguments are ${left} and ${right}.`\n    );\n  }\n\n  return left >= right;\n};\n\nNode.prototype._evaluateOr = function (feature) {\n  const left = this._left.evaluate(feature);\n  if (typeof left !== \"boolean\") {\n    throw new RuntimeError(\n      `Operator \"||\" requires boolean arguments. First argument is ${left}.`\n    );\n  }\n\n  // short circuit the expression\n  if (left) {\n    return true;\n  }\n\n  const right = this._right.evaluate(feature);\n  if (typeof right !== \"boolean\") {\n    throw new RuntimeError(\n      `Operator \"||\" requires boolean arguments. Second argument is ${right}.`\n    );\n  }\n\n  return left || right;\n};\n\nNode.prototype._evaluateAnd = function (feature) {\n  const left = this._left.evaluate(feature);\n  if (typeof left !== \"boolean\") {\n    throw new RuntimeError(\n      `Operator \"&&\" requires boolean arguments. First argument is ${left}.`\n    );\n  }\n\n  // short circuit the expression\n  if (!left) {\n    return false;\n  }\n\n  const right = this._right.evaluate(feature);\n  if (typeof right !== \"boolean\") {\n    throw new RuntimeError(\n      `Operator \"&&\" requires boolean arguments. Second argument is ${right}.`\n    );\n  }\n\n  return left && right;\n};\n\nNode.prototype._evaluatePlus = function (feature) {\n  const left = this._left.evaluate(feature);\n  const right = this._right.evaluate(feature);\n  if (right instanceof Cartesian2 && left instanceof Cartesian2) {\n    return Cartesian2.add(left, right, scratchStorage.getCartesian2());\n  } else if (right instanceof Cartesian3 && left instanceof Cartesian3) {\n    return Cartesian3.add(left, right, scratchStorage.getCartesian3());\n  } else if (right instanceof Cartesian4 && left instanceof Cartesian4) {\n    return Cartesian4.add(left, right, scratchStorage.getCartesian4());\n  } else if (typeof left === \"string\" || typeof right === \"string\") {\n    // If only one argument is a string the other argument calls its toString function.\n    return left + right;\n  } else if (typeof left === \"number\" && typeof right === \"number\") {\n    return left + right;\n  }\n\n  throw new RuntimeError(\n    `Operator \"+\" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${left} and ${right}.`\n  );\n};\n\nNode.prototype._evaluateMinus = function (feature) {\n  const left = this._left.evaluate(feature);\n  const right = this._right.evaluate(feature);\n  if (right instanceof Cartesian2 && left instanceof Cartesian2) {\n    return Cartesian2.subtract(left, right, scratchStorage.getCartesian2());\n  } else if (right instanceof Cartesian3 && left instanceof Cartesian3) {\n    return Cartesian3.subtract(left, right, scratchStorage.getCartesian3());\n  } else if (right instanceof Cartesian4 && left instanceof Cartesian4) {\n    return Cartesian4.subtract(left, right, scratchStorage.getCartesian4());\n  } else if (typeof left === \"number\" && typeof right === \"number\") {\n    return left - right;\n  }\n\n  throw new RuntimeError(\n    `Operator \"-\" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`\n  );\n};\n\nNode.prototype._evaluateTimes = function (feature) {\n  const left = this._left.evaluate(feature);\n  const right = this._right.evaluate(feature);\n  if (right instanceof Cartesian2 && left instanceof Cartesian2) {\n    return Cartesian2.multiplyComponents(\n      left,\n      right,\n      scratchStorage.getCartesian2()\n    );\n  } else if (right instanceof Cartesian2 && typeof left === \"number\") {\n    return Cartesian2.multiplyByScalar(\n      right,\n      left,\n      scratchStorage.getCartesian2()\n    );\n  } else if (left instanceof Cartesian2 && typeof right === \"number\") {\n    return Cartesian2.multiplyByScalar(\n      left,\n      right,\n      scratchStorage.getCartesian2()\n    );\n  } else if (right instanceof Cartesian3 && left instanceof Cartesian3) {\n    return Cartesian3.multiplyComponents(\n      left,\n      right,\n      scratchStorage.getCartesian3()\n    );\n  } else if (right instanceof Cartesian3 && typeof left === \"number\") {\n    return Cartesian3.multiplyByScalar(\n      right,\n      left,\n      scratchStorage.getCartesian3()\n    );\n  } else if (left instanceof Cartesian3 && typeof right === \"number\") {\n    return Cartesian3.multiplyByScalar(\n      left,\n      right,\n      scratchStorage.getCartesian3()\n    );\n  } else if (right instanceof Cartesian4 && left instanceof Cartesian4) {\n    return Cartesian4.multiplyComponents(\n      left,\n      right,\n      scratchStorage.getCartesian4()\n    );\n  } else if (right instanceof Cartesian4 && typeof left === \"number\") {\n    return Cartesian4.multiplyByScalar(\n      right,\n      left,\n      scratchStorage.getCartesian4()\n    );\n  } else if (left instanceof Cartesian4 && typeof right === \"number\") {\n    return Cartesian4.multiplyByScalar(\n      left,\n      right,\n      scratchStorage.getCartesian4()\n    );\n  } else if (typeof left === \"number\" && typeof right === \"number\") {\n    return left * right;\n  }\n\n  throw new RuntimeError(\n    `Operator \"*\" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${left} and ${right}.`\n  );\n};\n\nNode.prototype._evaluateDivide = function (feature) {\n  const left = this._left.evaluate(feature);\n  const right = this._right.evaluate(feature);\n  if (right instanceof Cartesian2 && left instanceof Cartesian2) {\n    return Cartesian2.divideComponents(\n      left,\n      right,\n      scratchStorage.getCartesian2()\n    );\n  } else if (left instanceof Cartesian2 && typeof right === \"number\") {\n    return Cartesian2.divideByScalar(\n      left,\n      right,\n      scratchStorage.getCartesian2()\n    );\n  } else if (right instanceof Cartesian3 && left instanceof Cartesian3) {\n    return Cartesian3.divideComponents(\n      left,\n      right,\n      scratchStorage.getCartesian3()\n    );\n  } else if (left instanceof Cartesian3 && typeof right === \"number\") {\n    return Cartesian3.divideByScalar(\n      left,\n      right,\n      scratchStorage.getCartesian3()\n    );\n  } else if (right instanceof Cartesian4 && left instanceof Cartesian4) {\n    return Cartesian4.divideComponents(\n      left,\n      right,\n      scratchStorage.getCartesian4()\n    );\n  } else if (left instanceof Cartesian4 && typeof right === \"number\") {\n    return Cartesian4.divideByScalar(\n      left,\n      right,\n      scratchStorage.getCartesian4()\n    );\n  } else if (typeof left === \"number\" && typeof right === \"number\") {\n    return left / right;\n  }\n\n  throw new RuntimeError(\n    `Operator \"/\" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${left} and ${right}.`\n  );\n};\n\nNode.prototype._evaluateMod = function (feature) {\n  const left = this._left.evaluate(feature);\n  const right = this._right.evaluate(feature);\n  if (right instanceof Cartesian2 && left instanceof Cartesian2) {\n    return Cartesian2.fromElements(\n      left.x % right.x,\n      left.y % right.y,\n      scratchStorage.getCartesian2()\n    );\n  } else if (right instanceof Cartesian3 && left instanceof Cartesian3) {\n    return Cartesian3.fromElements(\n      left.x % right.x,\n      left.y % right.y,\n      left.z % right.z,\n      scratchStorage.getCartesian3()\n    );\n  } else if (right instanceof Cartesian4 && left instanceof Cartesian4) {\n    return Cartesian4.fromElements(\n      left.x % right.x,\n      left.y % right.y,\n      left.z % right.z,\n      left.w % right.w,\n      scratchStorage.getCartesian4()\n    );\n  } else if (typeof left === \"number\" && typeof right === \"number\") {\n    return left % right;\n  }\n\n  throw new RuntimeError(\n    `Operator \"%\" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`\n  );\n};\n\nNode.prototype._evaluateEqualsStrict = function (feature) {\n  const left = this._left.evaluate(feature);\n  const right = this._right.evaluate(feature);\n  if (\n    (right instanceof Cartesian2 && left instanceof Cartesian2) ||\n    (right instanceof Cartesian3 && left instanceof Cartesian3) ||\n    (right instanceof Cartesian4 && left instanceof Cartesian4)\n  ) {\n    return left.equals(right);\n  }\n  return left === right;\n};\n\nNode.prototype._evaluateNotEqualsStrict = function (feature) {\n  const left = this._left.evaluate(feature);\n  const right = this._right.evaluate(feature);\n  if (\n    (right instanceof Cartesian2 && left instanceof Cartesian2) ||\n    (right instanceof Cartesian3 && left instanceof Cartesian3) ||\n    (right instanceof Cartesian4 && left instanceof Cartesian4)\n  ) {\n    return !left.equals(right);\n  }\n  return left !== right;\n};\n\nNode.prototype._evaluateConditional = function (feature) {\n  const test = this._test.evaluate(feature);\n\n  if (typeof test !== \"boolean\") {\n    throw new RuntimeError(\n      `Conditional argument of conditional expression must be a boolean. Argument is ${test}.`\n    );\n  }\n\n  if (test) {\n    return this._left.evaluate(feature);\n  }\n  return this._right.evaluate(feature);\n};\n\nNode.prototype._evaluateNaN = function (feature) {\n  return isNaN(this._left.evaluate(feature));\n};\n\nNode.prototype._evaluateIsFinite = function (feature) {\n  return isFinite(this._left.evaluate(feature));\n};\n\nNode.prototype._evaluateIsExactClass = function (feature) {\n  if (defined(feature)) {\n    return feature.isExactClass(this._left.evaluate(feature));\n  }\n  return false;\n};\n\nNode.prototype._evaluateIsClass = function (feature) {\n  if (defined(feature)) {\n    return feature.isClass(this._left.evaluate(feature));\n  }\n  return false;\n};\n\nNode.prototype._evaluateGetExactClassName = function (feature) {\n  if (defined(feature)) {\n    return feature.getExactClassName();\n  }\n};\n\nNode.prototype._evaluateBooleanConversion = function (feature) {\n  return Boolean(this._left.evaluate(feature));\n};\n\nNode.prototype._evaluateNumberConversion = function (feature) {\n  return Number(this._left.evaluate(feature));\n};\n\nNode.prototype._evaluateStringConversion = function (feature) {\n  return String(this._left.evaluate(feature));\n};\n\nNode.prototype._evaluateRegExp = function (feature) {\n  const pattern = this._value.evaluate(feature);\n  let flags = \"\";\n\n  if (defined(this._left)) {\n    flags = this._left.evaluate(feature);\n  }\n\n  let exp;\n  try {\n    exp = new RegExp(pattern, flags);\n  } catch (e) {\n    throw new RuntimeError(e);\n  }\n  return exp;\n};\n\nNode.prototype._evaluateRegExpTest = function (feature) {\n  const left = this._left.evaluate(feature);\n  const right = this._right.evaluate(feature);\n\n  if (!(left instanceof RegExp && typeof right === \"string\")) {\n    throw new RuntimeError(\n      `RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${left} and ${right}.`\n    );\n  }\n\n  return left.test(right);\n};\n\nNode.prototype._evaluateRegExpMatch = function (feature) {\n  const left = this._left.evaluate(feature);\n  const right = this._right.evaluate(feature);\n\n  if (left instanceof RegExp && typeof right === \"string\") {\n    return left.test(right);\n  } else if (right instanceof RegExp && typeof left === \"string\") {\n    return right.test(left);\n  }\n\n  throw new RuntimeError(\n    `Operator \"=~\" requires one RegExp argument and one string argument. Arguments are ${left} and ${right}.`\n  );\n};\n\nNode.prototype._evaluateRegExpNotMatch = function (feature) {\n  const left = this._left.evaluate(feature);\n  const right = this._right.evaluate(feature);\n\n  if (left instanceof RegExp && typeof right === \"string\") {\n    return !left.test(right);\n  } else if (right instanceof RegExp && typeof left === \"string\") {\n    return !right.test(left);\n  }\n\n  throw new RuntimeError(\n    `Operator \"!~\" requires one RegExp argument and one string argument. Arguments are ${left} and ${right}.`\n  );\n};\n\nNode.prototype._evaluateRegExpExec = function (feature) {\n  const left = this._left.evaluate(feature);\n  const right = this._right.evaluate(feature);\n\n  if (!(left instanceof RegExp && typeof right === \"string\")) {\n    throw new RuntimeError(\n      `RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${left} and ${right}.`\n    );\n  }\n\n  const exec = left.exec(right);\n  if (!defined(exec)) {\n    return null;\n  }\n  return exec[1];\n};\n\nNode.prototype._evaluateToString = function (feature) {\n  const left = this._left.evaluate(feature);\n  if (\n    left instanceof RegExp ||\n    left instanceof Cartesian2 ||\n    left instanceof Cartesian3 ||\n    left instanceof Cartesian4\n  ) {\n    return String(left);\n  }\n\n  throw new RuntimeError(`Unexpected function call \"${this._value}\".`);\n};\n\nfunction convertHSLToRGB(ast) {\n  // Check if the color contains any nested expressions to see if the color can be converted here.\n  // E.g. \"hsl(0.9, 0.6, 0.7)\" is able to convert directly to rgb, \"hsl(0.9, 0.6, ${Height})\" is not.\n  const channels = ast._left;\n  const length = channels.length;\n  for (let i = 0; i < length; ++i) {\n    if (channels[i]._type !== ExpressionNodeType.LITERAL_NUMBER) {\n      return undefined;\n    }\n  }\n  const h = channels[0]._value;\n  const s = channels[1]._value;\n  const l = channels[2]._value;\n  const a = length === 4 ? channels[3]._value : 1.0;\n  return Color.fromHsl(h, s, l, a, scratchColor);\n}\n\nfunction convertRGBToColor(ast) {\n  // Check if the color contains any nested expressions to see if the color can be converted here.\n  // E.g. \"rgb(255, 255, 255)\" is able to convert directly to Color, \"rgb(255, 255, ${Height})\" is not.\n  const channels = ast._left;\n  const length = channels.length;\n  for (let i = 0; i < length; ++i) {\n    if (channels[i]._type !== ExpressionNodeType.LITERAL_NUMBER) {\n      return undefined;\n    }\n  }\n  const color = scratchColor;\n  color.red = channels[0]._value / 255.0;\n  color.green = channels[1]._value / 255.0;\n  color.blue = channels[2]._value / 255.0;\n  color.alpha = length === 4 ? channels[3]._value : 1.0;\n  return color;\n}\n\nfunction numberToString(number) {\n  if (number % 1 === 0) {\n    // Add a .0 to whole numbers\n    return number.toFixed(1);\n  }\n\n  return number.toString();\n}\n\nfunction colorToVec3(color) {\n  const r = numberToString(color.red);\n  const g = numberToString(color.green);\n  const b = numberToString(color.blue);\n  return `vec3(${r}, ${g}, ${b})`;\n}\n\nfunction colorToVec4(color) {\n  const r = numberToString(color.red);\n  const g = numberToString(color.green);\n  const b = numberToString(color.blue);\n  const a = numberToString(color.alpha);\n  return `vec4(${r}, ${g}, ${b}, ${a})`;\n}\n\nfunction getExpressionArray(\n  array,\n  variableSubstitutionMap,\n  shaderState,\n  parent\n) {\n  const length = array.length;\n  const expressions = new Array(length);\n  for (let i = 0; i < length; ++i) {\n    expressions[i] = array[i].getShaderExpression(\n      variableSubstitutionMap,\n      shaderState,\n      parent\n    );\n  }\n  return expressions;\n}\n\nfunction getVariableName(variableName, variableSubstitutionMap) {\n  if (!defined(variableSubstitutionMap[variableName])) {\n    return Expression.NULL_SENTINEL;\n  }\n\n  return variableSubstitutionMap[variableName];\n}\n\n/**\n * @private\n */\nExpression.NULL_SENTINEL = \"czm_infinity\"; // null just needs to be some sentinel value that will cause \"[expression] === null\" to be false in nearly all cases. GLSL doesn't have a NaN constant so use czm_infinity.\n\nNode.prototype.getShaderExpression = function (\n  variableSubstitutionMap,\n  shaderState,\n  parent\n) {\n  let color;\n  let left;\n  let right;\n  let test;\n\n  const type = this._type;\n  let value = this._value;\n\n  if (defined(this._left)) {\n    if (Array.isArray(this._left)) {\n      // Left can be an array if the type is LITERAL_COLOR or LITERAL_VECTOR\n      left = getExpressionArray(\n        this._left,\n        variableSubstitutionMap,\n        shaderState,\n        this\n      );\n    } else {\n      left = this._left.getShaderExpression(\n        variableSubstitutionMap,\n        shaderState,\n        this\n      );\n    }\n  }\n\n  if (defined(this._right)) {\n    right = this._right.getShaderExpression(\n      variableSubstitutionMap,\n      shaderState,\n      this\n    );\n  }\n\n  if (defined(this._test)) {\n    test = this._test.getShaderExpression(\n      variableSubstitutionMap,\n      shaderState,\n      this\n    );\n  }\n\n  if (Array.isArray(this._value)) {\n    // For ARRAY type\n    value = getExpressionArray(\n      this._value,\n      variableSubstitutionMap,\n      shaderState,\n      this\n    );\n  }\n\n  let args;\n  let length;\n  let vectorExpression;\n  switch (type) {\n    case ExpressionNodeType.VARIABLE:\n      if (checkFeature(this)) {\n        return undefined;\n      }\n      return getVariableName(value, variableSubstitutionMap);\n    case ExpressionNodeType.UNARY:\n      // Supported types: +, -, !, Boolean, Number\n      if (value === \"Boolean\") {\n        return `bool(${left})`;\n      } else if (value === \"Number\") {\n        return `float(${left})`;\n      } else if (value === \"round\") {\n        return `floor(${left} + 0.5)`;\n      } else if (defined(unaryFunctions[value])) {\n        return `${value}(${left})`;\n      } else if (value === \"isNaN\") {\n        // In GLSL 2.0 use isnan instead\n        return `(${left} != ${left})`;\n      } else if (value === \"isFinite\") {\n        // In GLSL 2.0 use isinf instead. GLSL doesn't have an infinity constant so use czm_infinity which is an arbitrarily big enough number.\n        return `(abs(${left}) < czm_infinity)`;\n      } else if (\n        value === \"String\" ||\n        value === \"isExactClass\" ||\n        value === \"isClass\" ||\n        value === \"getExactClassName\"\n      ) {\n        throw new RuntimeError(\n          `Error generating style shader: \"${value}\" is not supported.`\n        );\n      }\n      return value + left;\n    case ExpressionNodeType.BINARY:\n      // Supported types: ||, &&, ===, !==, <, >, <=, >=, +, -, *, /, %\n      if (value === \"%\") {\n        return `mod(${left}, ${right})`;\n      } else if (value === \"===\") {\n        return `(${left} == ${right})`;\n      } else if (value === \"!==\") {\n        return `(${left} != ${right})`;\n      } else if (value === \"atan2\") {\n        return `atan(${left}, ${right})`;\n      } else if (defined(binaryFunctions[value])) {\n        return `${value}(${left}, ${right})`;\n      }\n      return `(${left} ${value} ${right})`;\n    case ExpressionNodeType.TERNARY:\n      if (defined(ternaryFunctions[value])) {\n        return `${value}(${left}, ${right}, ${test})`;\n      }\n      break;\n    case ExpressionNodeType.CONDITIONAL:\n      return `(${test} ? ${left} : ${right})`;\n    case ExpressionNodeType.MEMBER:\n      if (checkFeature(this._left)) {\n        return getVariableName(right, variableSubstitutionMap);\n      }\n      // This is intended for accessing the components of vector properties. String members aren't supported.\n      // Check for 0.0 rather than 0 because all numbers are previously converted to decimals.\n      if (right === \"r\" || right === \"x\" || right === \"0.0\") {\n        return `${left}[0]`;\n      } else if (right === \"g\" || right === \"y\" || right === \"1.0\") {\n        return `${left}[1]`;\n      } else if (right === \"b\" || right === \"z\" || right === \"2.0\") {\n        return `${left}[2]`;\n      } else if (right === \"a\" || right === \"w\" || right === \"3.0\") {\n        return `${left}[3]`;\n      }\n      return `${left}[int(${right})]`;\n    case ExpressionNodeType.FUNCTION_CALL:\n      throw new RuntimeError(\n        `Error generating style shader: \"${value}\" is not supported.`\n      );\n    case ExpressionNodeType.ARRAY:\n      if (value.length === 4) {\n        return `vec4(${value[0]}, ${value[1]}, ${value[2]}, ${value[3]})`;\n      } else if (value.length === 3) {\n        return `vec3(${value[0]}, ${value[1]}, ${value[2]})`;\n      } else if (value.length === 2) {\n        return `vec2(${value[0]}, ${value[1]})`;\n      }\n      throw new RuntimeError(\n        \"Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.\"\n      );\n    case ExpressionNodeType.REGEX:\n      throw new RuntimeError(\n        \"Error generating style shader: Regular expressions are not supported.\"\n      );\n    case ExpressionNodeType.VARIABLE_IN_STRING:\n      throw new RuntimeError(\n        \"Error generating style shader: Converting a variable to a string is not supported.\"\n      );\n    case ExpressionNodeType.LITERAL_NULL:\n      return Expression.NULL_SENTINEL;\n    case ExpressionNodeType.LITERAL_BOOLEAN:\n      return value ? \"true\" : \"false\";\n    case ExpressionNodeType.LITERAL_NUMBER:\n      return numberToString(value);\n    case ExpressionNodeType.LITERAL_STRING:\n      if (defined(parent) && parent._type === ExpressionNodeType.MEMBER) {\n        if (\n          value === \"r\" ||\n          value === \"g\" ||\n          value === \"b\" ||\n          value === \"a\" ||\n          value === \"x\" ||\n          value === \"y\" ||\n          value === \"z\" ||\n          value === \"w\" ||\n          checkFeature(parent._left)\n        ) {\n          return value;\n        }\n      }\n      // Check for css color strings\n      color = Color.fromCssColorString(value, scratchColor);\n      if (defined(color)) {\n        return colorToVec3(color);\n      }\n      throw new RuntimeError(\n        \"Error generating style shader: String literals are not supported.\"\n      );\n    case ExpressionNodeType.LITERAL_COLOR:\n      args = left;\n      if (value === \"color\") {\n        if (!defined(args)) {\n          return \"vec4(1.0)\";\n        } else if (args.length > 1) {\n          const rgb = args[0];\n          const alpha = args[1];\n          if (alpha !== \"1.0\") {\n            shaderState.translucent = true;\n          }\n          return `vec4(${rgb}, ${alpha})`;\n        }\n        return `vec4(${args[0]}, 1.0)`;\n      } else if (value === \"rgb\") {\n        color = convertRGBToColor(this);\n        if (defined(color)) {\n          return colorToVec4(color);\n        }\n        return `vec4(${args[0]} / 255.0, ${args[1]} / 255.0, ${args[2]} / 255.0, 1.0)`;\n      } else if (value === \"rgba\") {\n        if (args[3] !== \"1.0\") {\n          shaderState.translucent = true;\n        }\n        color = convertRGBToColor(this);\n        if (defined(color)) {\n          return colorToVec4(color);\n        }\n        return `vec4(${args[0]} / 255.0, ${args[1]} / 255.0, ${args[2]} / 255.0, ${args[3]})`;\n      } else if (value === \"hsl\") {\n        color = convertHSLToRGB(this);\n        if (defined(color)) {\n          return colorToVec4(color);\n        }\n        return `vec4(czm_HSLToRGB(vec3(${args[0]}, ${args[1]}, ${args[2]})), 1.0)`;\n      } else if (value === \"hsla\") {\n        color = convertHSLToRGB(this);\n        if (defined(color)) {\n          if (color.alpha !== 1.0) {\n            shaderState.translucent = true;\n          }\n          return colorToVec4(color);\n        }\n        if (args[3] !== \"1.0\") {\n          shaderState.translucent = true;\n        }\n        return `vec4(czm_HSLToRGB(vec3(${args[0]}, ${args[1]}, ${args[2]})), ${args[3]})`;\n      }\n      break;\n    case ExpressionNodeType.LITERAL_VECTOR:\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(left)) {\n        throw new DeveloperError(\n          \"left should always be defined for type ExpressionNodeType.LITERAL_VECTOR\"\n        );\n      }\n      //>>includeEnd('debug');\n      length = left.length;\n      vectorExpression = `${value}(`;\n      for (let i = 0; i < length; ++i) {\n        vectorExpression += left[i];\n        if (i < length - 1) {\n          vectorExpression += \", \";\n        }\n      }\n      vectorExpression += \")\";\n      return vectorExpression;\n    case ExpressionNodeType.LITERAL_REGEX:\n      throw new RuntimeError(\n        \"Error generating style shader: Regular expressions are not supported.\"\n      );\n    case ExpressionNodeType.LITERAL_UNDEFINED:\n      return Expression.NULL_SENTINEL;\n    case ExpressionNodeType.BUILTIN_VARIABLE:\n      if (value === \"tiles3d_tileset_time\") {\n        return value;\n      }\n  }\n};\n\nNode.prototype.getVariables = function (variables, parent) {\n  let array;\n  let length;\n  let i;\n\n  const type = this._type;\n  const value = this._value;\n\n  if (defined(this._left)) {\n    if (Array.isArray(this._left)) {\n      // Left can be an array if the type is LITERAL_COLOR or LITERAL_VECTOR\n      array = this._left;\n      length = array.length;\n      for (i = 0; i < length; ++i) {\n        array[i].getVariables(variables, this);\n      }\n    } else {\n      this._left.getVariables(variables, this);\n    }\n  }\n\n  if (defined(this._right)) {\n    this._right.getVariables(variables, this);\n  }\n\n  if (defined(this._test)) {\n    this._test.getVariables(variables, this);\n  }\n\n  if (Array.isArray(this._value)) {\n    // For ARRAY type\n    array = this._value;\n    length = array.length;\n    for (i = 0; i < length; ++i) {\n      array[i].getVariables(variables, this);\n    }\n  }\n\n  let match;\n  switch (type) {\n    case ExpressionNodeType.VARIABLE:\n      if (!checkFeature(this)) {\n        variables.push(value);\n      }\n      break;\n    case ExpressionNodeType.VARIABLE_IN_STRING:\n      match = variableRegex.exec(value);\n      while (match !== null) {\n        variables.push(match[1]);\n        match = variableRegex.exec(value);\n      }\n      break;\n    case ExpressionNodeType.LITERAL_STRING:\n      if (\n        defined(parent) &&\n        parent._type === ExpressionNodeType.MEMBER &&\n        checkFeature(parent._left)\n      ) {\n        variables.push(value);\n      }\n      break;\n  }\n};\n\nexport default Expression;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport ShadowVolumeFS from \"../Shaders/ShadowVolumeFS.js\";\nimport VectorTileVS from \"../Shaders/VectorTileVS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport Cesium3DTileFeature from \"./Cesium3DTileFeature.js\";\nimport ClassificationType from \"./ClassificationType.js\";\nimport DepthFunction from \"./DepthFunction.js\";\nimport Expression from \"./Expression.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\nimport Vector3DTileBatch from \"./Vector3DTileBatch.js\";\n\n/**\n * Creates a batch of classification meshes.\n *\n * @alias Vector3DTilePrimitive\n * @constructor\n *\n * @param {object} options An object with following properties:\n * @param {Float32Array} options.positions The positions of the meshes.\n * @param {Uint16Array|Uint32Array} options.indices The indices of the triangulated meshes. The indices must be contiguous so that\n * the indices for mesh n are in [i, i + indexCounts[n]] where i = sum{indexCounts[0], indexCounts[n - 1]}.\n * @param {Uint32Array} options.indexCounts The number of indices for each mesh.\n * @param {Uint32Array} options.indexOffsets The offset into the index buffer for each mesh.\n * @param {Vector3DTileBatch[]} options.batchedIndices The index offset and count for each batch with the same color.\n * @param {Cartesian3} [options.center=Cartesian3.ZERO] The RTC center.\n * @param {Cesium3DTileBatchTable} options.batchTable The batch table for the tile containing the batched meshes.\n * @param {Uint16Array} options.batchIds The batch ids for each mesh.\n * @param {Uint16Array} options.vertexBatchIds The batch id for each vertex.\n * @param {BoundingSphere} options.boundingVolume The bounding volume for the entire batch of meshes.\n * @param {BoundingSphere[]} options.boundingVolumes The bounding volume for each mesh.\n * @param {ClassificationType} [options.classificationType] What this tile will classify.\n *\n * @private\n */\nfunction Vector3DTilePrimitive(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._batchTable = options.batchTable;\n  this._batchIds = options.batchIds;\n\n  // These arrays are released after VAO creation.\n  this._positions = options.positions;\n  this._vertexBatchIds = options.vertexBatchIds;\n\n  // These arrays are kept for re-batching indices based on colors.\n  // If WebGL 2 is supported, indices will be released and re-batching uses buffer-to-buffer copies.\n  this._indices = options.indices;\n  this._indexCounts = options.indexCounts;\n  this._indexOffsets = options.indexOffsets;\n  this._batchedIndices = options.batchedIndices;\n\n  this._boundingVolume = options.boundingVolume;\n  this._boundingVolumes = options.boundingVolumes;\n\n  this._center = defaultValue(options.center, Cartesian3.ZERO);\n\n  this._va = undefined;\n  this._sp = undefined;\n  this._spStencil = undefined;\n  this._spPick = undefined;\n  this._uniformMap = undefined;\n\n  // Only used with WebGL 2 to ping-pong ibos after copy.\n  this._vaSwap = undefined;\n\n  this._rsStencilDepthPass = undefined;\n  this._rsStencilDepthPass3DTiles = undefined;\n  this._rsColorPass = undefined;\n  this._rsPickPass = undefined;\n  this._rsWireframe = undefined;\n\n  this._commands = [];\n  this._commandsIgnoreShow = [];\n  this._pickCommands = [];\n\n  this._constantColor = Color.clone(Color.WHITE);\n  this._highlightColor = this._constantColor;\n\n  this._batchDirty = true;\n  this._pickCommandsDirty = true;\n  this._framesSinceLastRebatch = 0;\n\n  this._updatingAllCommands = false;\n\n  this._trianglesLength = this._indices.length / 3;\n  this._geometryByteLength =\n    this._indices.byteLength +\n    this._positions.byteLength +\n    this._vertexBatchIds.byteLength;\n\n  /**\n   * Draw the wireframe of the classification meshes.\n   * @type {boolean}\n   * @default false\n   */\n  this.debugWireframe = false;\n  this._debugWireframe = this.debugWireframe;\n  this._wireframeDirty = false;\n\n  /**\n   * Forces a re-batch instead of waiting after a number of frames have been rendered. For testing only.\n   * @type {boolean}\n   * @default false\n   */\n  this.forceRebatch = false;\n\n  /**\n   * What this tile will classify.\n   * @type {ClassificationType}\n   * @default ClassificationType.BOTH\n   */\n  this.classificationType = defaultValue(\n    options.classificationType,\n    ClassificationType.BOTH\n  );\n\n  // Hidden options\n  this._vertexShaderSource = options._vertexShaderSource;\n  this._fragmentShaderSource = options._fragmentShaderSource;\n  this._attributeLocations = options._attributeLocations;\n  this._uniformMap = options._uniformMap;\n  this._pickId = options._pickId;\n  this._modelMatrix = options._modelMatrix;\n  this._boundingSphere = options._boundingSphere;\n\n  this._batchIdLookUp = {};\n\n  const length = this._batchIds.length;\n  for (let i = 0; i < length; ++i) {\n    const batchId = this._batchIds[i];\n    this._batchIdLookUp[batchId] = i;\n  }\n}\n\nObject.defineProperties(Vector3DTilePrimitive.prototype, {\n  /**\n   * Gets the number of triangles.\n   *\n   * @memberof Vector3DTilePrimitive.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  trianglesLength: {\n    get: function () {\n      return this._trianglesLength;\n    },\n  },\n\n  /**\n   * Gets the geometry memory in bytes.\n   *\n   * @memberof Vector3DTilePrimitive.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  geometryByteLength: {\n    get: function () {\n      return this._geometryByteLength;\n    },\n  },\n});\n\nconst defaultAttributeLocations = {\n  position: 0,\n  a_batchId: 1,\n};\n\nfunction createVertexArray(primitive, context) {\n  if (defined(primitive._va)) {\n    return;\n  }\n\n  const positionBuffer = Buffer.createVertexBuffer({\n    context: context,\n    typedArray: primitive._positions,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n  const idBuffer = Buffer.createVertexBuffer({\n    context: context,\n    typedArray: primitive._vertexBatchIds,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n  const indexBuffer = Buffer.createIndexBuffer({\n    context: context,\n    typedArray: primitive._indices,\n    usage: BufferUsage.DYNAMIC_DRAW,\n    indexDatatype:\n      primitive._indices.BYTES_PER_ELEMENT === 2\n        ? IndexDatatype.UNSIGNED_SHORT\n        : IndexDatatype.UNSIGNED_INT,\n  });\n\n  const vertexAttributes = [\n    {\n      index: 0,\n      vertexBuffer: positionBuffer,\n      componentDatatype: ComponentDatatype.fromTypedArray(primitive._positions),\n      componentsPerAttribute: 3,\n    },\n    {\n      index: 1,\n      vertexBuffer: idBuffer,\n      componentDatatype: ComponentDatatype.fromTypedArray(\n        primitive._vertexBatchIds\n      ),\n      componentsPerAttribute: 1,\n    },\n  ];\n\n  primitive._va = new VertexArray({\n    context: context,\n    attributes: vertexAttributes,\n    indexBuffer: indexBuffer,\n  });\n\n  if (context.webgl2) {\n    primitive._vaSwap = new VertexArray({\n      context: context,\n      attributes: vertexAttributes,\n      indexBuffer: Buffer.createIndexBuffer({\n        context: context,\n        sizeInBytes: indexBuffer.sizeInBytes,\n        usage: BufferUsage.DYNAMIC_DRAW,\n        indexDatatype: indexBuffer.indexDatatype,\n      }),\n    });\n  }\n\n  primitive._batchedPositions = undefined;\n  primitive._transferrableBatchIds = undefined;\n  primitive._vertexBatchIds = undefined;\n}\n\nfunction createShaders(primitive, context) {\n  if (defined(primitive._sp)) {\n    return;\n  }\n\n  const batchTable = primitive._batchTable;\n  const attributeLocations = defaultValue(\n    primitive._attributeLocations,\n    defaultAttributeLocations\n  );\n\n  let pickId = primitive._pickId;\n  const vertexShaderSource = primitive._vertexShaderSource;\n  let fragmentShaderSource = primitive._fragmentShaderSource;\n  if (defined(vertexShaderSource)) {\n    primitive._sp = ShaderProgram.fromCache({\n      context: context,\n      vertexShaderSource: vertexShaderSource,\n      fragmentShaderSource: fragmentShaderSource,\n      attributeLocations: attributeLocations,\n    });\n    primitive._spStencil = primitive._sp;\n\n    fragmentShaderSource = ShaderSource.replaceMain(\n      fragmentShaderSource,\n      \"czm_non_pick_main\"\n    );\n    fragmentShaderSource =\n      `${fragmentShaderSource}void main() \\n` +\n      `{ \\n` +\n      `    czm_non_pick_main(); \\n` +\n      `    out_FragColor = ${pickId}; \\n` +\n      `} \\n`;\n    primitive._spPick = ShaderProgram.fromCache({\n      context: context,\n      vertexShaderSource: vertexShaderSource,\n      fragmentShaderSource: fragmentShaderSource,\n      attributeLocations: attributeLocations,\n    });\n    return;\n  }\n\n  const vsSource = batchTable.getVertexShaderCallback(\n    false,\n    \"a_batchId\",\n    undefined\n  )(VectorTileVS);\n  let fsSource = batchTable.getFragmentShaderCallback(\n    false,\n    undefined,\n    true\n  )(ShadowVolumeFS);\n\n  pickId = batchTable.getPickId();\n\n  let vs = new ShaderSource({\n    sources: [vsSource],\n  });\n  let fs = new ShaderSource({\n    defines: [\"VECTOR_TILE\"],\n    sources: [fsSource],\n  });\n\n  primitive._sp = ShaderProgram.fromCache({\n    context: context,\n    vertexShaderSource: vs,\n    fragmentShaderSource: fs,\n    attributeLocations: attributeLocations,\n  });\n\n  vs = new ShaderSource({\n    sources: [VectorTileVS],\n  });\n  fs = new ShaderSource({\n    defines: [\"VECTOR_TILE\"],\n    sources: [ShadowVolumeFS],\n  });\n\n  primitive._spStencil = ShaderProgram.fromCache({\n    context: context,\n    vertexShaderSource: vs,\n    fragmentShaderSource: fs,\n    attributeLocations: attributeLocations,\n  });\n\n  fsSource = ShaderSource.replaceMain(fsSource, \"czm_non_pick_main\");\n  fsSource =\n    `${fsSource}\\n` +\n    `void main() \\n` +\n    `{ \\n` +\n    `    czm_non_pick_main(); \\n` +\n    `    out_FragColor = ${pickId}; \\n` +\n    `} \\n`;\n\n  const pickVS = new ShaderSource({\n    sources: [vsSource],\n  });\n  const pickFS = new ShaderSource({\n    defines: [\"VECTOR_TILE\"],\n    sources: [fsSource],\n  });\n  primitive._spPick = ShaderProgram.fromCache({\n    context: context,\n    vertexShaderSource: pickVS,\n    fragmentShaderSource: pickFS,\n    attributeLocations: attributeLocations,\n  });\n}\n\nfunction getStencilDepthRenderState(mask3DTiles) {\n  const stencilFunction = mask3DTiles\n    ? StencilFunction.EQUAL\n    : StencilFunction.ALWAYS;\n  return {\n    colorMask: {\n      red: false,\n      green: false,\n      blue: false,\n      alpha: false,\n    },\n    stencilTest: {\n      enabled: true,\n      frontFunction: stencilFunction,\n      frontOperation: {\n        fail: StencilOperation.KEEP,\n        zFail: StencilOperation.DECREMENT_WRAP,\n        zPass: StencilOperation.KEEP,\n      },\n      backFunction: stencilFunction,\n      backOperation: {\n        fail: StencilOperation.KEEP,\n        zFail: StencilOperation.INCREMENT_WRAP,\n        zPass: StencilOperation.KEEP,\n      },\n      reference: StencilConstants.CESIUM_3D_TILE_MASK,\n      mask: StencilConstants.CESIUM_3D_TILE_MASK,\n    },\n    stencilMask: StencilConstants.CLASSIFICATION_MASK,\n    depthTest: {\n      enabled: true,\n      func: DepthFunction.LESS_OR_EQUAL,\n    },\n    depthMask: false,\n  };\n}\n\nconst colorRenderState = {\n  stencilTest: {\n    enabled: true,\n    frontFunction: StencilFunction.NOT_EQUAL,\n    frontOperation: {\n      fail: StencilOperation.ZERO,\n      zFail: StencilOperation.ZERO,\n      zPass: StencilOperation.ZERO,\n    },\n    backFunction: StencilFunction.NOT_EQUAL,\n    backOperation: {\n      fail: StencilOperation.ZERO,\n      zFail: StencilOperation.ZERO,\n      zPass: StencilOperation.ZERO,\n    },\n    reference: 0,\n    mask: StencilConstants.CLASSIFICATION_MASK,\n  },\n  stencilMask: StencilConstants.CLASSIFICATION_MASK,\n  depthTest: {\n    enabled: false,\n  },\n  depthMask: false,\n  blending: BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,\n};\n\nconst pickRenderState = {\n  stencilTest: {\n    enabled: true,\n    frontFunction: StencilFunction.NOT_EQUAL,\n    frontOperation: {\n      fail: StencilOperation.ZERO,\n      zFail: StencilOperation.ZERO,\n      zPass: StencilOperation.ZERO,\n    },\n    backFunction: StencilFunction.NOT_EQUAL,\n    backOperation: {\n      fail: StencilOperation.ZERO,\n      zFail: StencilOperation.ZERO,\n      zPass: StencilOperation.ZERO,\n    },\n    reference: 0,\n    mask: StencilConstants.CLASSIFICATION_MASK,\n  },\n  stencilMask: StencilConstants.CLASSIFICATION_MASK,\n  depthTest: {\n    enabled: false,\n  },\n  depthMask: false,\n};\n\nfunction createRenderStates(primitive) {\n  if (defined(primitive._rsStencilDepthPass)) {\n    return;\n  }\n\n  primitive._rsStencilDepthPass = RenderState.fromCache(\n    getStencilDepthRenderState(false)\n  );\n  primitive._rsStencilDepthPass3DTiles = RenderState.fromCache(\n    getStencilDepthRenderState(true)\n  );\n  primitive._rsColorPass = RenderState.fromCache(colorRenderState);\n  primitive._rsPickPass = RenderState.fromCache(pickRenderState);\n}\n\nconst modifiedModelViewScratch = new Matrix4();\nconst rtcScratch = new Cartesian3();\n\nfunction createUniformMap(primitive, context) {\n  if (defined(primitive._uniformMap)) {\n    return;\n  }\n\n  const uniformMap = {\n    u_modifiedModelViewProjection: function () {\n      const viewMatrix = context.uniformState.view;\n      const projectionMatrix = context.uniformState.projection;\n      Matrix4.clone(viewMatrix, modifiedModelViewScratch);\n      Matrix4.multiplyByPoint(\n        modifiedModelViewScratch,\n        primitive._center,\n        rtcScratch\n      );\n      Matrix4.setTranslation(\n        modifiedModelViewScratch,\n        rtcScratch,\n        modifiedModelViewScratch\n      );\n      Matrix4.multiply(\n        projectionMatrix,\n        modifiedModelViewScratch,\n        modifiedModelViewScratch\n      );\n      return modifiedModelViewScratch;\n    },\n    u_highlightColor: function () {\n      return primitive._highlightColor;\n    },\n  };\n\n  primitive._uniformMap = primitive._batchTable.getUniformMapCallback()(\n    uniformMap\n  );\n}\n\nfunction copyIndicesCPU(\n  indices,\n  newIndices,\n  currentOffset,\n  offsets,\n  counts,\n  batchIds,\n  batchIdLookUp\n) {\n  const sizeInBytes = indices.constructor.BYTES_PER_ELEMENT;\n\n  const batchedIdsLength = batchIds.length;\n  for (let j = 0; j < batchedIdsLength; ++j) {\n    const batchedId = batchIds[j];\n    const index = batchIdLookUp[batchedId];\n    const offset = offsets[index];\n    const count = counts[index];\n\n    const subarray = new indices.constructor(\n      indices.buffer,\n      sizeInBytes * offset,\n      count\n    );\n    newIndices.set(subarray, currentOffset);\n\n    offsets[index] = currentOffset;\n    currentOffset += count;\n  }\n\n  return currentOffset;\n}\n\nfunction rebatchCPU(primitive, batchedIndices) {\n  const indices = primitive._indices;\n  const indexOffsets = primitive._indexOffsets;\n  const indexCounts = primitive._indexCounts;\n  const batchIdLookUp = primitive._batchIdLookUp;\n\n  const newIndices = new indices.constructor(indices.length);\n\n  let current = batchedIndices.pop();\n  const newBatchedIndices = [current];\n\n  let currentOffset = copyIndicesCPU(\n    indices,\n    newIndices,\n    0,\n    indexOffsets,\n    indexCounts,\n    current.batchIds,\n    batchIdLookUp\n  );\n\n  current.offset = 0;\n  current.count = currentOffset;\n\n  while (batchedIndices.length > 0) {\n    const next = batchedIndices.pop();\n    if (Color.equals(next.color, current.color)) {\n      currentOffset = copyIndicesCPU(\n        indices,\n        newIndices,\n        currentOffset,\n        indexOffsets,\n        indexCounts,\n        next.batchIds,\n        batchIdLookUp\n      );\n      current.batchIds = current.batchIds.concat(next.batchIds);\n      current.count = currentOffset - current.offset;\n    } else {\n      const offset = currentOffset;\n      currentOffset = copyIndicesCPU(\n        indices,\n        newIndices,\n        currentOffset,\n        indexOffsets,\n        indexCounts,\n        next.batchIds,\n        batchIdLookUp\n      );\n\n      next.offset = offset;\n      next.count = currentOffset - offset;\n      newBatchedIndices.push(next);\n      current = next;\n    }\n  }\n\n  primitive._va.indexBuffer.copyFromArrayView(newIndices);\n\n  primitive._indices = newIndices;\n  primitive._batchedIndices = newBatchedIndices;\n}\n\nfunction copyIndicesGPU(\n  readBuffer,\n  writeBuffer,\n  currentOffset,\n  offsets,\n  counts,\n  batchIds,\n  batchIdLookUp\n) {\n  const sizeInBytes = readBuffer.bytesPerIndex;\n\n  const batchedIdsLength = batchIds.length;\n  for (let j = 0; j < batchedIdsLength; ++j) {\n    const batchedId = batchIds[j];\n    const index = batchIdLookUp[batchedId];\n    const offset = offsets[index];\n    const count = counts[index];\n\n    writeBuffer.copyFromBuffer(\n      readBuffer,\n      offset * sizeInBytes,\n      currentOffset * sizeInBytes,\n      count * sizeInBytes\n    );\n\n    offsets[index] = currentOffset;\n    currentOffset += count;\n  }\n\n  return currentOffset;\n}\n\nfunction rebatchGPU(primitive, batchedIndices) {\n  const indexOffsets = primitive._indexOffsets;\n  const indexCounts = primitive._indexCounts;\n  const batchIdLookUp = primitive._batchIdLookUp;\n\n  let current = batchedIndices.pop();\n  const newBatchedIndices = [current];\n\n  const readBuffer = primitive._va.indexBuffer;\n  const writeBuffer = primitive._vaSwap.indexBuffer;\n\n  let currentOffset = copyIndicesGPU(\n    readBuffer,\n    writeBuffer,\n    0,\n    indexOffsets,\n    indexCounts,\n    current.batchIds,\n    batchIdLookUp\n  );\n\n  current.offset = 0;\n  current.count = currentOffset;\n\n  while (batchedIndices.length > 0) {\n    const next = batchedIndices.pop();\n    if (Color.equals(next.color, current.color)) {\n      currentOffset = copyIndicesGPU(\n        readBuffer,\n        writeBuffer,\n        currentOffset,\n        indexOffsets,\n        indexCounts,\n        next.batchIds,\n        batchIdLookUp\n      );\n      current.batchIds = current.batchIds.concat(next.batchIds);\n      current.count = currentOffset - current.offset;\n    } else {\n      const offset = currentOffset;\n      currentOffset = copyIndicesGPU(\n        readBuffer,\n        writeBuffer,\n        currentOffset,\n        indexOffsets,\n        indexCounts,\n        next.batchIds,\n        batchIdLookUp\n      );\n      next.offset = offset;\n      next.count = currentOffset - offset;\n      newBatchedIndices.push(next);\n      current = next;\n    }\n  }\n\n  const temp = primitive._va;\n  primitive._va = primitive._vaSwap;\n  primitive._vaSwap = temp;\n\n  primitive._batchedIndices = newBatchedIndices;\n}\n\nfunction compareColors(a, b) {\n  return b.color.toRgba() - a.color.toRgba();\n}\n\n// PERFORMANCE_IDEA: For WebGL 2, we can use copyBufferSubData for buffer-to-buffer copies.\n// PERFORMANCE_IDEA: Not supported, but we could use glMultiDrawElements here.\nfunction rebatchCommands(primitive, context) {\n  if (!primitive._batchDirty) {\n    return false;\n  }\n\n  const batchedIndices = primitive._batchedIndices;\n  const length = batchedIndices.length;\n\n  let needToRebatch = false;\n  const colorCounts = {};\n\n  for (let i = 0; i < length; ++i) {\n    const color = batchedIndices[i].color;\n    const rgba = color.toRgba();\n    if (defined(colorCounts[rgba])) {\n      needToRebatch = true;\n      break;\n    } else {\n      colorCounts[rgba] = true;\n    }\n  }\n\n  if (!needToRebatch) {\n    primitive._batchDirty = false;\n    return false;\n  }\n\n  if (\n    needToRebatch &&\n    !primitive.forceRebatch &&\n    primitive._framesSinceLastRebatch < 120\n  ) {\n    ++primitive._framesSinceLastRebatch;\n    return;\n  }\n\n  batchedIndices.sort(compareColors);\n\n  if (context.webgl2) {\n    rebatchGPU(primitive, batchedIndices);\n  } else {\n    rebatchCPU(primitive, batchedIndices);\n  }\n\n  primitive._framesSinceLastRebatch = 0;\n  primitive._batchDirty = false;\n  primitive._pickCommandsDirty = true;\n  primitive._wireframeDirty = true;\n  return true;\n}\n\nfunction createColorCommands(primitive, context) {\n  const needsRebatch = rebatchCommands(primitive, context);\n\n  const commands = primitive._commands;\n  const batchedIndices = primitive._batchedIndices;\n  const length = batchedIndices.length;\n  const commandsLength = length * 2;\n\n  if (\n    defined(commands) &&\n    !needsRebatch &&\n    commands.length === commandsLength\n  ) {\n    return;\n  }\n\n  commands.length = commandsLength;\n\n  const vertexArray = primitive._va;\n  const sp = primitive._sp;\n  const modelMatrix = defaultValue(primitive._modelMatrix, Matrix4.IDENTITY);\n  const uniformMap = primitive._uniformMap;\n  const bv = primitive._boundingVolume;\n\n  for (let j = 0; j < length; ++j) {\n    const offset = batchedIndices[j].offset;\n    const count = batchedIndices[j].count;\n\n    let stencilDepthCommand = commands[j * 2];\n    if (!defined(stencilDepthCommand)) {\n      stencilDepthCommand = commands[j * 2] = new DrawCommand({\n        owner: primitive,\n      });\n    }\n\n    stencilDepthCommand.vertexArray = vertexArray;\n    stencilDepthCommand.modelMatrix = modelMatrix;\n    stencilDepthCommand.offset = offset;\n    stencilDepthCommand.count = count;\n    stencilDepthCommand.renderState = primitive._rsStencilDepthPass;\n    stencilDepthCommand.shaderProgram = sp;\n    stencilDepthCommand.uniformMap = uniformMap;\n    stencilDepthCommand.boundingVolume = bv;\n    stencilDepthCommand.cull = false;\n    stencilDepthCommand.pass = Pass.TERRAIN_CLASSIFICATION;\n\n    const stencilDepthDerivedCommand = DrawCommand.shallowClone(\n      stencilDepthCommand,\n      stencilDepthCommand.derivedCommands.tileset\n    );\n    stencilDepthDerivedCommand.renderState =\n      primitive._rsStencilDepthPass3DTiles;\n    stencilDepthDerivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n    stencilDepthCommand.derivedCommands.tileset = stencilDepthDerivedCommand;\n\n    let colorCommand = commands[j * 2 + 1];\n    if (!defined(colorCommand)) {\n      colorCommand = commands[j * 2 + 1] = new DrawCommand({\n        owner: primitive,\n      });\n    }\n\n    colorCommand.vertexArray = vertexArray;\n    colorCommand.modelMatrix = modelMatrix;\n    colorCommand.offset = offset;\n    colorCommand.count = count;\n    colorCommand.renderState = primitive._rsColorPass;\n    colorCommand.shaderProgram = sp;\n    colorCommand.uniformMap = uniformMap;\n    colorCommand.boundingVolume = bv;\n    colorCommand.cull = false;\n    colorCommand.pass = Pass.TERRAIN_CLASSIFICATION;\n\n    const colorDerivedCommand = DrawCommand.shallowClone(\n      colorCommand,\n      colorCommand.derivedCommands.tileset\n    );\n    colorDerivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n    colorCommand.derivedCommands.tileset = colorDerivedCommand;\n  }\n\n  primitive._commandsDirty = true;\n}\n\nfunction createColorCommandsIgnoreShow(primitive, frameState) {\n  if (\n    primitive.classificationType === ClassificationType.TERRAIN ||\n    !frameState.invertClassification ||\n    (defined(primitive._commandsIgnoreShow) && !primitive._commandsDirty)\n  ) {\n    return;\n  }\n\n  const commands = primitive._commands;\n  const commandsIgnoreShow = primitive._commandsIgnoreShow;\n  const spStencil = primitive._spStencil;\n\n  const commandsLength = commands.length;\n  const length = (commandsIgnoreShow.length = commandsLength / 2);\n\n  let commandIndex = 0;\n  for (let j = 0; j < length; ++j) {\n    const commandIgnoreShow = (commandsIgnoreShow[j] = DrawCommand.shallowClone(\n      commands[commandIndex],\n      commandsIgnoreShow[j]\n    ));\n    commandIgnoreShow.shaderProgram = spStencil;\n    commandIgnoreShow.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW;\n\n    commandIndex += 2;\n  }\n\n  primitive._commandsDirty = false;\n}\n\nfunction createPickCommands(primitive) {\n  if (!primitive._pickCommandsDirty) {\n    return;\n  }\n\n  const length = primitive._indexOffsets.length;\n  const pickCommands = primitive._pickCommands;\n  pickCommands.length = length * 2;\n\n  const vertexArray = primitive._va;\n  const spStencil = primitive._spStencil;\n  const spPick = primitive._spPick;\n  const modelMatrix = defaultValue(primitive._modelMatrix, Matrix4.IDENTITY);\n  const uniformMap = primitive._uniformMap;\n\n  for (let j = 0; j < length; ++j) {\n    const offset = primitive._indexOffsets[j];\n    const count = primitive._indexCounts[j];\n    const bv = defined(primitive._boundingVolumes)\n      ? primitive._boundingVolumes[j]\n      : primitive.boundingVolume;\n\n    let stencilDepthCommand = pickCommands[j * 2];\n    if (!defined(stencilDepthCommand)) {\n      stencilDepthCommand = pickCommands[j * 2] = new DrawCommand({\n        owner: primitive,\n        pickOnly: true,\n      });\n    }\n\n    stencilDepthCommand.vertexArray = vertexArray;\n    stencilDepthCommand.modelMatrix = modelMatrix;\n    stencilDepthCommand.offset = offset;\n    stencilDepthCommand.count = count;\n    stencilDepthCommand.renderState = primitive._rsStencilDepthPass;\n    stencilDepthCommand.shaderProgram = spStencil;\n    stencilDepthCommand.uniformMap = uniformMap;\n    stencilDepthCommand.boundingVolume = bv;\n    stencilDepthCommand.pass = Pass.TERRAIN_CLASSIFICATION;\n\n    const stencilDepthDerivedCommand = DrawCommand.shallowClone(\n      stencilDepthCommand,\n      stencilDepthCommand.derivedCommands.tileset\n    );\n    stencilDepthDerivedCommand.renderState =\n      primitive._rsStencilDepthPass3DTiles;\n    stencilDepthDerivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n    stencilDepthCommand.derivedCommands.tileset = stencilDepthDerivedCommand;\n\n    let colorCommand = pickCommands[j * 2 + 1];\n    if (!defined(colorCommand)) {\n      colorCommand = pickCommands[j * 2 + 1] = new DrawCommand({\n        owner: primitive,\n        pickOnly: true,\n      });\n    }\n\n    colorCommand.vertexArray = vertexArray;\n    colorCommand.modelMatrix = modelMatrix;\n    colorCommand.offset = offset;\n    colorCommand.count = count;\n    colorCommand.renderState = primitive._rsPickPass;\n    colorCommand.shaderProgram = spPick;\n    colorCommand.uniformMap = uniformMap;\n    colorCommand.boundingVolume = bv;\n    colorCommand.pass = Pass.TERRAIN_CLASSIFICATION;\n\n    const colorDerivedCommand = DrawCommand.shallowClone(\n      colorCommand,\n      colorCommand.derivedCommands.tileset\n    );\n    colorDerivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n    colorCommand.derivedCommands.tileset = colorDerivedCommand;\n  }\n\n  primitive._pickCommandsDirty = false;\n}\n\n/**\n * Creates features for each mesh and places it at the batch id index of features.\n *\n * @param {Vector3DTileContent} content The vector tile content.\n * @param {Cesium3DTileFeature[]} features An array of features where the polygon features will be placed.\n */\nVector3DTilePrimitive.prototype.createFeatures = function (content, features) {\n  const batchIds = this._batchIds;\n  const length = batchIds.length;\n  for (let i = 0; i < length; ++i) {\n    const batchId = batchIds[i];\n    features[batchId] = new Cesium3DTileFeature(content, batchId);\n  }\n};\n\n/**\n * Colors the entire tile when enabled is true. The resulting color will be (mesh batch table color * color).\n *\n * @param {boolean} enabled Whether to enable debug coloring.\n * @param {Color} color The debug color.\n */\nVector3DTilePrimitive.prototype.applyDebugSettings = function (enabled, color) {\n  this._highlightColor = enabled ? color : this._constantColor;\n};\n\nfunction clearStyle(polygons, features) {\n  polygons._updatingAllCommands = true;\n\n  const batchIds = polygons._batchIds;\n  let length = batchIds.length;\n  let i;\n\n  for (i = 0; i < length; ++i) {\n    const batchId = batchIds[i];\n    const feature = features[batchId];\n\n    feature.show = true;\n    feature.color = Color.WHITE;\n  }\n\n  const batchedIndices = polygons._batchedIndices;\n  length = batchedIndices.length;\n\n  for (i = 0; i < length; ++i) {\n    batchedIndices[i].color = Color.clone(Color.WHITE);\n  }\n\n  polygons._updatingAllCommands = false;\n  polygons._batchDirty = true;\n}\n\nconst scratchColor = new Color();\n\nconst DEFAULT_COLOR_VALUE = Color.WHITE;\nconst DEFAULT_SHOW_VALUE = true;\n\nconst complexExpressionReg = /\\$/;\n\n/**\n * Apply a style to the content.\n *\n * @param {Cesium3DTileStyle} style The style.\n * @param {Cesium3DTileFeature[]} features The array of features.\n */\nVector3DTilePrimitive.prototype.applyStyle = function (style, features) {\n  if (!defined(style)) {\n    clearStyle(this, features);\n    return;\n  }\n\n  const colorExpression = style.color;\n  const isSimpleStyle =\n    colorExpression instanceof Expression &&\n    !complexExpressionReg.test(colorExpression.expression);\n  this._updatingAllCommands = isSimpleStyle;\n\n  const batchIds = this._batchIds;\n  let length = batchIds.length;\n  let i;\n\n  for (i = 0; i < length; ++i) {\n    const batchId = batchIds[i];\n    const feature = features[batchId];\n\n    feature.color = defined(style.color)\n      ? style.color.evaluateColor(feature, scratchColor)\n      : DEFAULT_COLOR_VALUE;\n    feature.show = defined(style.show)\n      ? style.show.evaluate(feature)\n      : DEFAULT_SHOW_VALUE;\n  }\n\n  if (isSimpleStyle) {\n    const batchedIndices = this._batchedIndices;\n    length = batchedIndices.length;\n\n    for (i = 0; i < length; ++i) {\n      batchedIndices[i].color = Color.clone(Color.WHITE);\n    }\n\n    this._updatingAllCommands = false;\n    this._batchDirty = true;\n  }\n};\n\n/**\n * Call when updating the color of a mesh with batchId changes color. The meshes will need to be re-batched\n * on the next update.\n *\n * @param {number} batchId The batch id of the meshes whose color has changed.\n * @param {Color} color The new polygon color.\n */\nVector3DTilePrimitive.prototype.updateCommands = function (batchId, color) {\n  if (this._updatingAllCommands) {\n    return;\n  }\n\n  const batchIdLookUp = this._batchIdLookUp;\n  const index = batchIdLookUp[batchId];\n  if (!defined(index)) {\n    return;\n  }\n\n  const indexOffsets = this._indexOffsets;\n  const indexCounts = this._indexCounts;\n\n  const offset = indexOffsets[index];\n  const count = indexCounts[index];\n\n  const batchedIndices = this._batchedIndices;\n  const length = batchedIndices.length;\n\n  let i;\n  for (i = 0; i < length; ++i) {\n    const batchedOffset = batchedIndices[i].offset;\n    const batchedCount = batchedIndices[i].count;\n\n    if (offset >= batchedOffset && offset < batchedOffset + batchedCount) {\n      break;\n    }\n  }\n\n  batchedIndices.push(\n    new Vector3DTileBatch({\n      color: Color.clone(color),\n      offset: offset,\n      count: count,\n      batchIds: [batchId],\n    })\n  );\n\n  const startIds = [];\n  const endIds = [];\n\n  const batchIds = batchedIndices[i].batchIds;\n  const batchIdsLength = batchIds.length;\n\n  for (let j = 0; j < batchIdsLength; ++j) {\n    const id = batchIds[j];\n    if (id === batchId) {\n      continue;\n    }\n\n    const offsetIndex = batchIdLookUp[id];\n    if (indexOffsets[offsetIndex] < offset) {\n      startIds.push(id);\n    } else {\n      endIds.push(id);\n    }\n  }\n\n  if (endIds.length !== 0) {\n    batchedIndices.push(\n      new Vector3DTileBatch({\n        color: Color.clone(batchedIndices[i].color),\n        offset: offset + count,\n        count:\n          batchedIndices[i].offset + batchedIndices[i].count - (offset + count),\n        batchIds: endIds,\n      })\n    );\n  }\n\n  if (startIds.length !== 0) {\n    batchedIndices[i].count = offset - batchedIndices[i].offset;\n    batchedIndices[i].batchIds = startIds;\n  } else {\n    batchedIndices.splice(i, 1);\n  }\n\n  this._batchDirty = true;\n};\n\nfunction queueCommands(primitive, frameState, commands, commandsIgnoreShow) {\n  const classificationType = primitive.classificationType;\n  const queueTerrainCommands =\n    classificationType !== ClassificationType.CESIUM_3D_TILE;\n  const queue3DTilesCommands =\n    classificationType !== ClassificationType.TERRAIN;\n\n  const commandList = frameState.commandList;\n  let commandLength = commands.length;\n  let command;\n  let i;\n  for (i = 0; i < commandLength; ++i) {\n    if (queueTerrainCommands) {\n      command = commands[i];\n      command.pass = Pass.TERRAIN_CLASSIFICATION;\n      commandList.push(command);\n    }\n    if (queue3DTilesCommands) {\n      command = commands[i].derivedCommands.tileset;\n      command.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n      commandList.push(command);\n    }\n  }\n\n  if (!frameState.invertClassification || !defined(commandsIgnoreShow)) {\n    return;\n  }\n\n  commandLength = commandsIgnoreShow.length;\n  for (i = 0; i < commandLength; ++i) {\n    commandList.push(commandsIgnoreShow[i]);\n  }\n}\n\nfunction queueWireframeCommands(frameState, commands) {\n  const commandList = frameState.commandList;\n  const commandLength = commands.length;\n  for (let i = 0; i < commandLength; i += 2) {\n    const command = commands[i + 1];\n    command.pass = Pass.OPAQUE;\n    commandList.push(command);\n  }\n}\n\nfunction updateWireframe(primitive) {\n  let earlyExit = primitive.debugWireframe === primitive._debugWireframe;\n  earlyExit =\n    earlyExit && !(primitive.debugWireframe && primitive._wireframeDirty);\n  if (earlyExit) {\n    return;\n  }\n\n  if (!defined(primitive._rsWireframe)) {\n    primitive._rsWireframe = RenderState.fromCache({});\n  }\n\n  let rs;\n  let type;\n\n  if (primitive.debugWireframe) {\n    rs = primitive._rsWireframe;\n    type = PrimitiveType.LINES;\n  } else {\n    rs = primitive._rsColorPass;\n    type = PrimitiveType.TRIANGLES;\n  }\n\n  const commands = primitive._commands;\n  const commandLength = commands.length;\n  for (let i = 0; i < commandLength; i += 2) {\n    const command = commands[i + 1];\n    command.renderState = rs;\n    command.primitiveType = type;\n  }\n\n  primitive._debugWireframe = primitive.debugWireframe;\n  primitive._wireframeDirty = false;\n}\n\n/**\n * Updates the batches and queues the commands for rendering.\n *\n * @param {FrameState} frameState The current frame state.\n */\nVector3DTilePrimitive.prototype.update = function (frameState) {\n  const context = frameState.context;\n\n  createVertexArray(this, context);\n  createShaders(this, context);\n  createRenderStates(this);\n  createUniformMap(this, context);\n\n  const passes = frameState.passes;\n  if (passes.render) {\n    createColorCommands(this, context);\n    createColorCommandsIgnoreShow(this, frameState);\n    updateWireframe(this);\n\n    if (this._debugWireframe) {\n      queueWireframeCommands(frameState, this._commands);\n    } else {\n      queueCommands(this, frameState, this._commands, this._commandsIgnoreShow);\n    }\n  }\n\n  if (passes.pick) {\n    createPickCommands(this);\n    queueCommands(this, frameState, this._pickCommands);\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nVector3DTilePrimitive.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nVector3DTilePrimitive.prototype.destroy = function () {\n  this._va = this._va && this._va.destroy();\n  this._sp = this._sp && this._sp.destroy();\n  this._spPick = this._spPick && this._spPick.destroy();\n  this._vaSwap = this._vaSwap && this._vaSwap.destroy();\n  return destroyObject(this);\n};\nexport default Vector3DTilePrimitive;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\nimport ClassificationType from \"./ClassificationType.js\";\nimport Vector3DTileBatch from \"./Vector3DTileBatch.js\";\nimport Vector3DTilePrimitive from \"./Vector3DTilePrimitive.js\";\n\n/**\n * Creates a batch of box, cylinder, ellipsoid and/or sphere geometries intersecting terrain or 3D Tiles.\n *\n * @alias Vector3DTileGeometry\n * @constructor\n *\n * @param {object} options An object with following properties:\n * @param {Float32Array} [options.boxes] The boxes in the tile.\n * @param {Uint16Array} [options.boxBatchIds] The batch ids for each box.\n * @param {Float32Array} [options.cylinders] The cylinders in the tile.\n * @param {Uint16Array} [options.cylinderBatchIds] The batch ids for each cylinder.\n * @param {Float32Array} [options.ellipsoids] The ellipsoids in the tile.\n * @param {Uint16Array} [options.ellipsoidBatchIds] The batch ids for each ellipsoid.\n * @param {Float32Array} [options.spheres] The spheres in the tile.\n * @param {Uint16Array} [options.sphereBatchIds] The batch ids for each sphere.\n * @param {Cartesian3} options.center The RTC center of all geometries.\n * @param {Matrix4} options.modelMatrix The model matrix of all geometries. Applied after the individual geometry model matrices.\n * @param {Cesium3DTileBatchTable} options.batchTable The batch table.\n * @param {BoundingSphere} options.boundingVolume The bounding volume containing all of the geometry in the tile.\n *\n * @private\n */\nfunction Vector3DTileGeometry(options) {\n  // these will all be released after the primitive is created\n  this._boxes = options.boxes;\n  this._boxBatchIds = options.boxBatchIds;\n  this._cylinders = options.cylinders;\n  this._cylinderBatchIds = options.cylinderBatchIds;\n  this._ellipsoids = options.ellipsoids;\n  this._ellipsoidBatchIds = options.ellipsoidBatchIds;\n  this._spheres = options.spheres;\n  this._sphereBatchIds = options.sphereBatchIds;\n  this._modelMatrix = options.modelMatrix;\n  this._batchTable = options.batchTable;\n  this._boundingVolume = options.boundingVolume;\n\n  this._center = options.center;\n  if (!defined(this._center)) {\n    if (defined(this._boundingVolume)) {\n      this._center = Cartesian3.clone(this._boundingVolume.center);\n    } else {\n      this._center = Cartesian3.clone(Cartesian3.ZERO);\n    }\n  }\n\n  this._boundingVolumes = undefined;\n  this._batchedIndices = undefined;\n\n  this._indices = undefined;\n  this._indexOffsets = undefined;\n  this._indexCounts = undefined;\n\n  this._positions = undefined;\n  this._vertexBatchIds = undefined;\n\n  this._batchIds = undefined;\n\n  this._batchTableColors = undefined;\n  this._packedBuffer = undefined;\n\n  this._ready = false;\n  this._promise = undefined;\n  this._error = undefined;\n\n  this._verticesPromise = undefined;\n\n  this._primitive = undefined;\n\n  /**\n   * Draws the wireframe of the classification geometries.\n   * @type {boolean}\n   * @default false\n   */\n  this.debugWireframe = false;\n\n  /**\n   * Forces a re-batch instead of waiting after a number of frames have been rendered. For testing only.\n   * @type {boolean}\n   * @default false\n   */\n  this.forceRebatch = false;\n\n  /**\n   * What this tile will classify.\n   * @type {ClassificationType}\n   * @default ClassificationType.BOTH\n   */\n  this.classificationType = ClassificationType.BOTH;\n}\n\nObject.defineProperties(Vector3DTileGeometry.prototype, {\n  /**\n   * Gets the number of triangles.\n   *\n   * @memberof Vector3DTileGeometry.prototype\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  trianglesLength: {\n    get: function () {\n      if (defined(this._primitive)) {\n        return this._primitive.trianglesLength;\n      }\n      return 0;\n    },\n  },\n\n  /**\n   * Gets the geometry memory in bytes.\n   *\n   * @memberof Vector3DTileGeometry.prototype\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  geometryByteLength: {\n    get: function () {\n      if (defined(this._primitive)) {\n        return this._primitive.geometryByteLength;\n      }\n      return 0;\n    },\n  },\n\n  /**\n   * Return true when the primitive is ready to render.\n   * @memberof Vector3DTileGeometry.prototype\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n});\n\nVector3DTileGeometry.packedBoxLength =\n  Matrix4.packedLength + Cartesian3.packedLength;\nVector3DTileGeometry.packedCylinderLength = Matrix4.packedLength + 2;\nVector3DTileGeometry.packedEllipsoidLength =\n  Matrix4.packedLength + Cartesian3.packedLength;\nVector3DTileGeometry.packedSphereLength = Cartesian3.packedLength + 1;\n\nfunction packBuffer(geometries) {\n  const packedBuffer = new Float64Array(\n    Matrix4.packedLength + Cartesian3.packedLength\n  );\n\n  let offset = 0;\n  Cartesian3.pack(geometries._center, packedBuffer, offset);\n  offset += Cartesian3.packedLength;\n  Matrix4.pack(geometries._modelMatrix, packedBuffer, offset);\n\n  return packedBuffer;\n}\n\nfunction unpackBuffer(geometries, packedBuffer) {\n  let offset = 0;\n\n  const indicesBytesPerElement = packedBuffer[offset++];\n  const numBVS = packedBuffer[offset++];\n  const bvs = (geometries._boundingVolumes = new Array(numBVS));\n\n  for (let i = 0; i < numBVS; ++i) {\n    bvs[i] = BoundingSphere.unpack(packedBuffer, offset);\n    offset += BoundingSphere.packedLength;\n  }\n\n  const numBatchedIndices = packedBuffer[offset++];\n  const bis = (geometries._batchedIndices = new Array(numBatchedIndices));\n\n  for (let j = 0; j < numBatchedIndices; ++j) {\n    const color = Color.unpack(packedBuffer, offset);\n    offset += Color.packedLength;\n\n    const indexOffset = packedBuffer[offset++];\n    const count = packedBuffer[offset++];\n\n    const length = packedBuffer[offset++];\n    const batchIds = new Array(length);\n\n    for (let k = 0; k < length; ++k) {\n      batchIds[k] = packedBuffer[offset++];\n    }\n\n    bis[j] = new Vector3DTileBatch({\n      color: color,\n      offset: indexOffset,\n      count: count,\n      batchIds: batchIds,\n    });\n  }\n\n  return indicesBytesPerElement;\n}\n\nconst createVerticesTaskProcessor = new TaskProcessor(\n  \"createVectorTileGeometries\",\n  5\n);\nconst scratchColor = new Color();\n\nfunction createPrimitive(geometries) {\n  if (defined(geometries._primitive)) {\n    return;\n  }\n\n  if (!defined(geometries._verticesPromise)) {\n    let boxes = geometries._boxes;\n    let boxBatchIds = geometries._boxBatchIds;\n    let cylinders = geometries._cylinders;\n    let cylinderBatchIds = geometries._cylinderBatchIds;\n    let ellipsoids = geometries._ellipsoids;\n    let ellipsoidBatchIds = geometries._ellipsoidBatchIds;\n    let spheres = geometries._spheres;\n    let sphereBatchIds = geometries._sphereBatchIds;\n\n    let batchTableColors = geometries._batchTableColors;\n    let packedBuffer = geometries._packedBuffer;\n\n    if (!defined(batchTableColors)) {\n      // Copy because they may be the views on the same buffer.\n      let length = 0;\n      if (defined(geometries._boxes)) {\n        boxes = geometries._boxes = boxes.slice();\n        boxBatchIds = geometries._boxBatchIds = boxBatchIds.slice();\n        length += boxBatchIds.length;\n      }\n      if (defined(geometries._cylinders)) {\n        cylinders = geometries._cylinders = cylinders.slice();\n        cylinderBatchIds = geometries._cylinderBatchIds = cylinderBatchIds.slice();\n        length += cylinderBatchIds.length;\n      }\n      if (defined(geometries._ellipsoids)) {\n        ellipsoids = geometries._ellipsoids = ellipsoids.slice();\n        ellipsoidBatchIds = geometries._ellipsoidBatchIds = ellipsoidBatchIds.slice();\n        length += ellipsoidBatchIds.length;\n      }\n      if (defined(geometries._spheres)) {\n        spheres = geometries._sphere = spheres.slice();\n        sphereBatchIds = geometries._sphereBatchIds = sphereBatchIds.slice();\n        length += sphereBatchIds.length;\n      }\n\n      batchTableColors = geometries._batchTableColors = new Uint32Array(length);\n      const batchTable = geometries._batchTable;\n\n      for (let i = 0; i < length; ++i) {\n        const color = batchTable.getColor(i, scratchColor);\n        batchTableColors[i] = color.toRgba();\n      }\n\n      packedBuffer = geometries._packedBuffer = packBuffer(geometries);\n    }\n\n    const transferrableObjects = [];\n    if (defined(boxes)) {\n      transferrableObjects.push(boxes.buffer, boxBatchIds.buffer);\n    }\n    if (defined(cylinders)) {\n      transferrableObjects.push(cylinders.buffer, cylinderBatchIds.buffer);\n    }\n    if (defined(ellipsoids)) {\n      transferrableObjects.push(ellipsoids.buffer, ellipsoidBatchIds.buffer);\n    }\n    if (defined(spheres)) {\n      transferrableObjects.push(spheres.buffer, sphereBatchIds.buffer);\n    }\n    transferrableObjects.push(batchTableColors.buffer, packedBuffer.buffer);\n\n    const parameters = {\n      boxes: defined(boxes) ? boxes.buffer : undefined,\n      boxBatchIds: defined(boxes) ? boxBatchIds.buffer : undefined,\n      cylinders: defined(cylinders) ? cylinders.buffer : undefined,\n      cylinderBatchIds: defined(cylinders)\n        ? cylinderBatchIds.buffer\n        : undefined,\n      ellipsoids: defined(ellipsoids) ? ellipsoids.buffer : undefined,\n      ellipsoidBatchIds: defined(ellipsoids)\n        ? ellipsoidBatchIds.buffer\n        : undefined,\n      spheres: defined(spheres) ? spheres.buffer : undefined,\n      sphereBatchIds: defined(spheres) ? sphereBatchIds.buffer : undefined,\n      batchTableColors: batchTableColors.buffer,\n      packedBuffer: packedBuffer.buffer,\n    };\n\n    const verticesPromise = (geometries._verticesPromise = createVerticesTaskProcessor.scheduleTask(\n      parameters,\n      transferrableObjects\n    ));\n    if (!defined(verticesPromise)) {\n      // Postponed\n      return;\n    }\n\n    return verticesPromise\n      .then(function (result) {\n        if (geometries.isDestroyed()) {\n          return;\n        }\n\n        const packedBuffer = new Float64Array(result.packedBuffer);\n        const indicesBytesPerElement = unpackBuffer(geometries, packedBuffer);\n\n        if (indicesBytesPerElement === 2) {\n          geometries._indices = new Uint16Array(result.indices);\n        } else {\n          geometries._indices = new Uint32Array(result.indices);\n        }\n\n        geometries._indexOffsets = new Uint32Array(result.indexOffsets);\n        geometries._indexCounts = new Uint32Array(result.indexCounts);\n\n        geometries._positions = new Float32Array(result.positions);\n        geometries._vertexBatchIds = new Uint16Array(result.vertexBatchIds);\n\n        geometries._batchIds = new Uint16Array(result.batchIds);\n\n        finishPrimitive(geometries);\n\n        geometries._ready = true;\n      })\n      .catch((error) => {\n        if (geometries.isDestroyed()) {\n          return;\n        }\n\n        geometries._error = error;\n      });\n  }\n}\n\nfunction finishPrimitive(geometries) {\n  if (!defined(geometries._primitive)) {\n    geometries._primitive = new Vector3DTilePrimitive({\n      batchTable: geometries._batchTable,\n      positions: geometries._positions,\n      batchIds: geometries._batchIds,\n      vertexBatchIds: geometries._vertexBatchIds,\n      indices: geometries._indices,\n      indexOffsets: geometries._indexOffsets,\n      indexCounts: geometries._indexCounts,\n      batchedIndices: geometries._batchedIndices,\n      boundingVolume: geometries._boundingVolume,\n      boundingVolumes: geometries._boundingVolumes,\n      center: geometries._center,\n      pickObject: defaultValue(geometries._pickObject, geometries),\n    });\n\n    geometries._boxes = undefined;\n    geometries._boxBatchIds = undefined;\n    geometries._cylinders = undefined;\n    geometries._cylinderBatchIds = undefined;\n    geometries._ellipsoids = undefined;\n    geometries._ellipsoidBatchIds = undefined;\n    geometries._spheres = undefined;\n    geometries._sphereBatchIds = undefined;\n    geometries._center = undefined;\n    geometries._modelMatrix = undefined;\n    geometries._batchTable = undefined;\n    geometries._boundingVolume = undefined;\n\n    geometries._boundingVolumes = undefined;\n    geometries._batchedIndices = undefined;\n\n    geometries._indices = undefined;\n    geometries._indexOffsets = undefined;\n    geometries._indexCounts = undefined;\n\n    geometries._positions = undefined;\n    geometries._vertexBatchIds = undefined;\n\n    geometries._batchIds = undefined;\n\n    geometries._batchTableColors = undefined;\n    geometries._packedBuffer = undefined;\n\n    geometries._verticesPromise = undefined;\n  }\n}\n\n/**\n * Creates features for each geometry and places it at the batch id index of features.\n *\n * @param {Vector3DTileContent} content The vector tile content.\n * @param {Cesium3DTileFeature[]} features An array of features where the polygon features will be placed.\n */\nVector3DTileGeometry.prototype.createFeatures = function (content, features) {\n  this._primitive.createFeatures(content, features);\n};\n\n/**\n * Colors the entire tile when enabled is true. The resulting color will be (geometry batch table color * color).\n *\n * @param {boolean} enabled Whether to enable debug coloring.\n * @param {Color} color The debug color.\n */\nVector3DTileGeometry.prototype.applyDebugSettings = function (enabled, color) {\n  this._primitive.applyDebugSettings(enabled, color);\n};\n\n/**\n * Apply a style to the content.\n *\n * @param {Cesium3DTileStyle} style The style.\n * @param {Cesium3DTileFeature[]} features The array of features.\n */\nVector3DTileGeometry.prototype.applyStyle = function (style, features) {\n  this._primitive.applyStyle(style, features);\n};\n\n/**\n * Call when updating the color of a geometry with batchId changes color. The geometries will need to be re-batched\n * on the next update.\n *\n * @param {number} batchId The batch id of the geometries whose color has changed.\n * @param {Color} color The new polygon color.\n */\nVector3DTileGeometry.prototype.updateCommands = function (batchId, color) {\n  this._primitive.updateCommands(batchId, color);\n};\n\n/**\n * Updates the batches and queues the commands for rendering.\n *\n * @param {FrameState} frameState The current frame state.\n */\nVector3DTileGeometry.prototype.update = function (frameState) {\n  if (!this._ready) {\n    if (!defined(this._promise)) {\n      this._promise = createPrimitive(this);\n    }\n\n    if (defined(this._error)) {\n      const error = this._error;\n      this._error = undefined;\n      throw error;\n    }\n\n    return;\n  }\n\n  this._primitive.debugWireframe = this.debugWireframe;\n  this._primitive.forceRebatch = this.forceRebatch;\n  this._primitive.classificationType = this.classificationType;\n  this._primitive.update(frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nVector3DTileGeometry.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nVector3DTileGeometry.prototype.destroy = function () {\n  this._primitive = this._primitive && this._primitive.destroy();\n  return destroyObject(this);\n};\nexport default Vector3DTileGeometry;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Cesium3DTileBatchTable from \"./Cesium3DTileBatchTable.js\";\nimport Vector3DTileGeometry from \"./Vector3DTileGeometry.js\";\n\n/**\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n *\n * @alias Geometry3DTileContent\n * @constructor\n *\n * @private\n */\nfunction Geometry3DTileContent(\n  tileset,\n  tile,\n  resource,\n  arrayBuffer,\n  byteOffset\n) {\n  this._tileset = tileset;\n  this._tile = tile;\n  this._resource = resource;\n  this._geometries = undefined;\n\n  this._metadata = undefined;\n\n  this._batchTable = undefined;\n  this._features = undefined;\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface.\n   */\n  this.featurePropertiesDirty = false;\n  this._group = undefined;\n\n  this._ready = false;\n\n  initialize(this, arrayBuffer, byteOffset);\n}\n\nObject.defineProperties(Geometry3DTileContent.prototype, {\n  featuresLength: {\n    get: function () {\n      return defined(this._batchTable) ? this._batchTable.featuresLength : 0;\n    },\n  },\n\n  pointsLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  trianglesLength: {\n    get: function () {\n      if (defined(this._geometries)) {\n        return this._geometries.trianglesLength;\n      }\n      return 0;\n    },\n  },\n\n  geometryByteLength: {\n    get: function () {\n      if (defined(this._geometries)) {\n        return this._geometries.geometryByteLength;\n      }\n      return 0;\n    },\n  },\n\n  texturesByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  batchTableByteLength: {\n    get: function () {\n      return defined(this._batchTable)\n        ? this._batchTable.batchTableByteLength\n        : 0;\n    },\n  },\n\n  innerContents: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Returns true when the tile's content is ready to render; otherwise false\n   *\n   * @memberof Geometry3DTileContent.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n\n  tileset: {\n    get: function () {\n      return this._tileset;\n    },\n  },\n\n  tile: {\n    get: function () {\n      return this._tile;\n    },\n  },\n\n  url: {\n    get: function () {\n      return this._resource.getUrlComponent(true);\n    },\n  },\n\n  metadata: {\n    get: function () {\n      return this._metadata;\n    },\n    set: function (value) {\n      this._metadata = value;\n    },\n  },\n\n  batchTable: {\n    get: function () {\n      return this._batchTable;\n    },\n  },\n\n  group: {\n    get: function () {\n      return this._group;\n    },\n    set: function (value) {\n      this._group = value;\n    },\n  },\n});\n\nfunction createColorChangedCallback(content) {\n  return function (batchId, color) {\n    if (defined(content._geometries)) {\n      content._geometries.updateCommands(batchId, color);\n    }\n  };\n}\n\nfunction getBatchIds(featureTableJson, featureTableBinary) {\n  let boxBatchIds;\n  let cylinderBatchIds;\n  let ellipsoidBatchIds;\n  let sphereBatchIds;\n  let i;\n\n  const numberOfBoxes = defaultValue(featureTableJson.BOXES_LENGTH, 0);\n  const numberOfCylinders = defaultValue(featureTableJson.CYLINDERS_LENGTH, 0);\n  const numberOfEllipsoids = defaultValue(\n    featureTableJson.ELLIPSOIDS_LENGTH,\n    0\n  );\n  const numberOfSpheres = defaultValue(featureTableJson.SPHERES_LENGTH, 0);\n\n  if (numberOfBoxes > 0 && defined(featureTableJson.BOX_BATCH_IDS)) {\n    const boxBatchIdsByteOffset =\n      featureTableBinary.byteOffset + featureTableJson.BOX_BATCH_IDS.byteOffset;\n    boxBatchIds = new Uint16Array(\n      featureTableBinary.buffer,\n      boxBatchIdsByteOffset,\n      numberOfBoxes\n    );\n  }\n\n  if (numberOfCylinders > 0 && defined(featureTableJson.CYLINDER_BATCH_IDS)) {\n    const cylinderBatchIdsByteOffset =\n      featureTableBinary.byteOffset +\n      featureTableJson.CYLINDER_BATCH_IDS.byteOffset;\n    cylinderBatchIds = new Uint16Array(\n      featureTableBinary.buffer,\n      cylinderBatchIdsByteOffset,\n      numberOfCylinders\n    );\n  }\n\n  if (numberOfEllipsoids > 0 && defined(featureTableJson.ELLIPSOID_BATCH_IDS)) {\n    const ellipsoidBatchIdsByteOffset =\n      featureTableBinary.byteOffset +\n      featureTableJson.ELLIPSOID_BATCH_IDS.byteOffset;\n    ellipsoidBatchIds = new Uint16Array(\n      featureTableBinary.buffer,\n      ellipsoidBatchIdsByteOffset,\n      numberOfEllipsoids\n    );\n  }\n\n  if (numberOfSpheres > 0 && defined(featureTableJson.SPHERE_BATCH_IDS)) {\n    const sphereBatchIdsByteOffset =\n      featureTableBinary.byteOffset +\n      featureTableJson.SPHERE_BATCH_IDS.byteOffset;\n    sphereBatchIds = new Uint16Array(\n      featureTableBinary.buffer,\n      sphereBatchIdsByteOffset,\n      numberOfSpheres\n    );\n  }\n\n  const atLeastOneDefined =\n    defined(boxBatchIds) ||\n    defined(cylinderBatchIds) ||\n    defined(ellipsoidBatchIds) ||\n    defined(sphereBatchIds);\n  const atLeastOneUndefined =\n    (numberOfBoxes > 0 && !defined(boxBatchIds)) ||\n    (numberOfCylinders > 0 && !defined(cylinderBatchIds)) ||\n    (numberOfEllipsoids > 0 && !defined(ellipsoidBatchIds)) ||\n    (numberOfSpheres > 0 && !defined(sphereBatchIds));\n\n  if (atLeastOneDefined && atLeastOneUndefined) {\n    throw new RuntimeError(\n      \"If one group of batch ids is defined, then all batch ids must be defined\"\n    );\n  }\n\n  const allUndefinedBatchIds =\n    !defined(boxBatchIds) &&\n    !defined(cylinderBatchIds) &&\n    !defined(ellipsoidBatchIds) &&\n    !defined(sphereBatchIds);\n  if (allUndefinedBatchIds) {\n    let id = 0;\n    if (!defined(boxBatchIds) && numberOfBoxes > 0) {\n      boxBatchIds = new Uint16Array(numberOfBoxes);\n      for (i = 0; i < numberOfBoxes; ++i) {\n        boxBatchIds[i] = id++;\n      }\n    }\n    if (!defined(cylinderBatchIds) && numberOfCylinders > 0) {\n      cylinderBatchIds = new Uint16Array(numberOfCylinders);\n      for (i = 0; i < numberOfCylinders; ++i) {\n        cylinderBatchIds[i] = id++;\n      }\n    }\n    if (!defined(ellipsoidBatchIds) && numberOfEllipsoids > 0) {\n      ellipsoidBatchIds = new Uint16Array(numberOfEllipsoids);\n      for (i = 0; i < numberOfEllipsoids; ++i) {\n        ellipsoidBatchIds[i] = id++;\n      }\n    }\n    if (!defined(sphereBatchIds) && numberOfSpheres > 0) {\n      sphereBatchIds = new Uint16Array(numberOfSpheres);\n      for (i = 0; i < numberOfSpheres; ++i) {\n        sphereBatchIds[i] = id++;\n      }\n    }\n  }\n\n  return {\n    boxes: boxBatchIds,\n    cylinders: cylinderBatchIds,\n    ellipsoids: ellipsoidBatchIds,\n    spheres: sphereBatchIds,\n  };\n}\n\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\n\nfunction initialize(content, arrayBuffer, byteOffset) {\n  byteOffset = defaultValue(byteOffset, 0);\n\n  const uint8Array = new Uint8Array(arrayBuffer);\n  const view = new DataView(arrayBuffer);\n  byteOffset += sizeOfUint32; // Skip magic number\n\n  const version = view.getUint32(byteOffset, true);\n  if (version !== 1) {\n    throw new RuntimeError(\n      `Only Geometry tile version 1 is supported.  Version ${version} is not.`\n    );\n  }\n  byteOffset += sizeOfUint32;\n\n  const byteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  if (byteLength === 0) {\n    content._ready = true;\n    return;\n  }\n\n  const featureTableJSONByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  if (featureTableJSONByteLength === 0) {\n    throw new RuntimeError(\n      \"Feature table must have a byte length greater than zero\"\n    );\n  }\n\n  const featureTableBinaryByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n  const batchTableJSONByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n  const batchTableBinaryByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  const featureTableJson = getJsonFromTypedArray(\n    uint8Array,\n    byteOffset,\n    featureTableJSONByteLength\n  );\n  byteOffset += featureTableJSONByteLength;\n\n  const featureTableBinary = new Uint8Array(\n    arrayBuffer,\n    byteOffset,\n    featureTableBinaryByteLength\n  );\n  byteOffset += featureTableBinaryByteLength;\n\n  let batchTableJson;\n  let batchTableBinary;\n  if (batchTableJSONByteLength > 0) {\n    // PERFORMANCE_IDEA: is it possible to allocate this on-demand?  Perhaps keep the\n    // arraybuffer/string compressed in memory and then decompress it when it is first accessed.\n    //\n    // We could also make another request for it, but that would make the property set/get\n    // API async, and would double the number of numbers in some cases.\n    batchTableJson = getJsonFromTypedArray(\n      uint8Array,\n      byteOffset,\n      batchTableJSONByteLength\n    );\n    byteOffset += batchTableJSONByteLength;\n\n    if (batchTableBinaryByteLength > 0) {\n      // Has a batch table binary\n      batchTableBinary = new Uint8Array(\n        arrayBuffer,\n        byteOffset,\n        batchTableBinaryByteLength\n      );\n      // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed\n      batchTableBinary = new Uint8Array(batchTableBinary);\n    }\n  }\n\n  const numberOfBoxes = defaultValue(featureTableJson.BOXES_LENGTH, 0);\n  const numberOfCylinders = defaultValue(featureTableJson.CYLINDERS_LENGTH, 0);\n  const numberOfEllipsoids = defaultValue(\n    featureTableJson.ELLIPSOIDS_LENGTH,\n    0\n  );\n  const numberOfSpheres = defaultValue(featureTableJson.SPHERES_LENGTH, 0);\n\n  const totalPrimitives =\n    numberOfBoxes + numberOfCylinders + numberOfEllipsoids + numberOfSpheres;\n\n  const batchTable = new Cesium3DTileBatchTable(\n    content,\n    totalPrimitives,\n    batchTableJson,\n    batchTableBinary,\n    createColorChangedCallback(content)\n  );\n  content._batchTable = batchTable;\n\n  if (totalPrimitives === 0) {\n    return;\n  }\n\n  const modelMatrix = content.tile.computedTransform;\n\n  let center;\n  if (defined(featureTableJson.RTC_CENTER)) {\n    center = Cartesian3.unpack(featureTableJson.RTC_CENTER);\n    Matrix4.multiplyByPoint(modelMatrix, center, center);\n  }\n\n  const batchIds = getBatchIds(featureTableJson, featureTableBinary);\n\n  if (\n    numberOfBoxes > 0 ||\n    numberOfCylinders > 0 ||\n    numberOfEllipsoids > 0 ||\n    numberOfSpheres > 0\n  ) {\n    let boxes;\n    let cylinders;\n    let ellipsoids;\n    let spheres;\n\n    if (numberOfBoxes > 0) {\n      const boxesByteOffset =\n        featureTableBinary.byteOffset + featureTableJson.BOXES.byteOffset;\n      boxes = new Float32Array(\n        featureTableBinary.buffer,\n        boxesByteOffset,\n        Vector3DTileGeometry.packedBoxLength * numberOfBoxes\n      );\n    }\n\n    if (numberOfCylinders > 0) {\n      const cylindersByteOffset =\n        featureTableBinary.byteOffset + featureTableJson.CYLINDERS.byteOffset;\n      cylinders = new Float32Array(\n        featureTableBinary.buffer,\n        cylindersByteOffset,\n        Vector3DTileGeometry.packedCylinderLength * numberOfCylinders\n      );\n    }\n\n    if (numberOfEllipsoids > 0) {\n      const ellipsoidsByteOffset =\n        featureTableBinary.byteOffset + featureTableJson.ELLIPSOIDS.byteOffset;\n      ellipsoids = new Float32Array(\n        featureTableBinary.buffer,\n        ellipsoidsByteOffset,\n        Vector3DTileGeometry.packedEllipsoidLength * numberOfEllipsoids\n      );\n    }\n\n    if (numberOfSpheres > 0) {\n      const spheresByteOffset =\n        featureTableBinary.byteOffset + featureTableJson.SPHERES.byteOffset;\n      spheres = new Float32Array(\n        featureTableBinary.buffer,\n        spheresByteOffset,\n        Vector3DTileGeometry.packedSphereLength * numberOfSpheres\n      );\n    }\n\n    content._geometries = new Vector3DTileGeometry({\n      boxes: boxes,\n      boxBatchIds: batchIds.boxes,\n      cylinders: cylinders,\n      cylinderBatchIds: batchIds.cylinders,\n      ellipsoids: ellipsoids,\n      ellipsoidBatchIds: batchIds.ellipsoids,\n      spheres: spheres,\n      sphereBatchIds: batchIds.spheres,\n      center: center,\n      modelMatrix: modelMatrix,\n      batchTable: batchTable,\n      boundingVolume: content.tile.boundingVolume.boundingVolume,\n    });\n\n    return content;\n  }\n\n  return Promise.resolve(content);\n}\n\nfunction createFeatures(content) {\n  const featuresLength = content.featuresLength;\n  if (!defined(content._features) && featuresLength > 0) {\n    const features = new Array(featuresLength);\n    if (defined(content._geometries)) {\n      content._geometries.createFeatures(content, features);\n    }\n    content._features = features;\n  }\n}\n\nGeometry3DTileContent.prototype.hasProperty = function (batchId, name) {\n  return this._batchTable.hasProperty(batchId, name);\n};\n\nGeometry3DTileContent.prototype.getFeature = function (batchId) {\n  //>>includeStart('debug', pragmas.debug);\n  const featuresLength = this.featuresLength;\n  if (!defined(batchId) || batchId < 0 || batchId >= featuresLength) {\n    throw new DeveloperError(\n      `batchId is required and between zero and featuresLength - 1 (${\n        featuresLength - 1\n      }).`\n    );\n  }\n  //>>includeEnd('debug');\n\n  createFeatures(this);\n  return this._features[batchId];\n};\n\nGeometry3DTileContent.prototype.applyDebugSettings = function (enabled, color) {\n  if (defined(this._geometries)) {\n    this._geometries.applyDebugSettings(enabled, color);\n  }\n};\n\nGeometry3DTileContent.prototype.applyStyle = function (style) {\n  createFeatures(this);\n  if (defined(this._geometries)) {\n    this._geometries.applyStyle(style, this._features);\n  }\n};\n\nGeometry3DTileContent.prototype.update = function (tileset, frameState) {\n  if (defined(this._geometries)) {\n    this._geometries.classificationType = this._tileset.classificationType;\n    this._geometries.debugWireframe = this._tileset.debugWireframe;\n    this._geometries.update(frameState);\n  }\n\n  if (defined(this._batchTable) && this._geometries.ready) {\n    this._batchTable.update(tileset, frameState);\n    this._ready = true;\n  }\n};\n\nGeometry3DTileContent.prototype.isDestroyed = function () {\n  return false;\n};\n\nGeometry3DTileContent.prototype.destroy = function () {\n  this._geometries = this._geometries && this._geometries.destroy();\n  this._batchTable = this._batchTable && this._batchTable.destroy();\n  return destroyObject(this);\n};\nexport default Geometry3DTileContent;\n", "import Check from \"./Check.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Hilbert Order helper functions.\n *\n * @namespace HilbertOrder\n */\nconst HilbertOrder = {};\n\n/**\n * Computes the Hilbert index at the given level from 2D coordinates.\n *\n * @param {number} level The level of the curve\n * @param {number} x The X coordinate\n * @param {number} y The Y coordinate\n * @returns {number} The Hilbert index.\n * @private\n */\nHilbertOrder.encode2D = function (level, x, y) {\n  const n = Math.pow(2, level);\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"level\", level);\n  Check.typeOf.number(\"x\", x);\n  Check.typeOf.number(\"y\", y);\n  if (level < 1) {\n    throw new DeveloperError(\"Hilbert level cannot be less than 1.\");\n  }\n  if (x < 0 || x >= n || y < 0 || y >= n) {\n    throw new DeveloperError(\"Invalid coordinates for given level.\");\n  }\n  //>>includeEnd('debug');\n\n  const p = {\n    x: x,\n    y: y,\n  };\n  let rx,\n    ry,\n    s,\n    // eslint-disable-next-line no-undef\n    index = BigInt(0);\n\n  for (s = n / 2; s > 0; s /= 2) {\n    rx = (p.x & s) > 0 ? 1 : 0;\n    ry = (p.y & s) > 0 ? 1 : 0;\n    // eslint-disable-next-line no-undef\n    index += BigInt(((3 * rx) ^ ry) * s * s);\n    rotate(n, p, rx, ry);\n  }\n\n  return index;\n};\n\n/**\n * Computes the 2D coordinates from the Hilbert index at the given level.\n *\n * @param {number} level The level of the curve\n * @param {bigint} index The Hilbert index\n * @returns {number[]} An array containing the 2D coordinates ([x, y]) corresponding to the Morton index.\n * @private\n */\nHilbertOrder.decode2D = function (level, index) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"level\", level);\n  Check.typeOf.bigint(\"index\", index);\n  if (level < 1) {\n    throw new DeveloperError(\"Hilbert level cannot be less than 1.\");\n  }\n  // eslint-disable-next-line no-undef\n  if (index < BigInt(0) || index >= BigInt(Math.pow(4, level))) {\n    throw new DeveloperError(\n      \"Hilbert index exceeds valid maximum for given level.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const n = Math.pow(2, level);\n  const p = {\n    x: 0,\n    y: 0,\n  };\n  let rx, ry, s, t;\n\n  for (s = 1, t = index; s < n; s *= 2) {\n    // eslint-disable-next-line no-undef\n    rx = 1 & Number(t / BigInt(2));\n    // eslint-disable-next-line no-undef\n    ry = 1 & Number(t ^ BigInt(rx));\n    rotate(s, p, rx, ry);\n    p.x += s * rx;\n    p.y += s * ry;\n    // eslint-disable-next-line no-undef\n    t /= BigInt(4);\n  }\n\n  return [p.x, p.y];\n};\n\n/**\n * @private\n */\nfunction rotate(n, p, rx, ry) {\n  if (ry !== 0) {\n    return;\n  }\n\n  if (rx === 1) {\n    p.x = n - 1 - p.x;\n    p.y = n - 1 - p.y;\n  }\n\n  const t = p.x;\n  p.x = p.y;\n  p.y = t;\n}\n\nexport default HilbertOrder;\n", "/* eslint-disable new-cap */\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport FeatureDetection from \"./FeatureDetection.js\";\nimport RuntimeError from \"./RuntimeError.js\";\n\n/**\n * S2\n * --\n *\n * This implementation is based on the S2 C++ reference implementation: https://github.com/google/s2geometry\n *\n *\n * Overview:\n * ---------\n * The S2 library decomposes the unit sphere into a hierarchy of cells. A cell is a quadrilateral bounded by 4 geodesics.\n * The 6 root cells are obtained by projecting the six faces of a cube on a unit sphere. Each root cell follows a quadtree\n * subdivision scheme, i.e. each cell subdivides into 4 smaller cells that cover the same area as the parent cell. The S2 cell\n * hierarchy extends from level 0 (root cells) to level 30 (leaf cells). The root cells are rotated to enable a continuous Hilbert\n * curve to map all 6 faces of the cube.\n *\n *\n * Cell ID:\n * --------\n * Each cell in S2 can be uniquely identified using a 64-bit unsigned integer, its cell ID. The first 3 bits of the cell ID are the face bits, i.e.\n * they indicate which of the 6 faces of the cube a cell lies on. After the face bits are the position bits, i.e. they indicate the position\n * of the cell along the Hilbert curve. After the positions bits is the sentinel bit, which is always set to 1, and it indicates the level of the\n * cell. Again, the level can be between 0 and 30 in S2.\n *\n *   Note: In the illustration below, the face bits are marked with 'f', the position bits are marked with 'p', the zero bits are marked with '-'.\n *\n *   Cell ID (base 10): 3170534137668829184\n *   Cell ID (base 2) : 0010110000000000000000000000000000000000000000000000000000000000\n *\n *   001 0110000000000000000000000000000000000000000000000000000000000\n *   fff pps----------------------------------------------------------\n *\n * For the cell above, we can see that it lies on face 1 (01), with a Hilbert index of 1 (1).\n *\n *\n * Cell Subdivision:\n * ------------------\n * Cells in S2 subdivide recursively using quadtree subdivision. For each cell, you can get a child of index [0-3]. To compute the child at index i,\n * insert the base 2 representation of i to the right of the parent's position bits. Ensure that the sentinel bit is also shifted two places to the right.\n *\n *   Parent Cell ID (base 10) : 3170534137668829184\n *   Parent Cell ID (base 2)  : 0010110000000000000000000000000000000000000000000000000000000000\n *\n *   001 0110000000000000000000000000000000000000000000000000000000000\n *   fff pps----------------------------------------------------------\n *\n *   To get the 3rd child of the cell above, we insert the binary representation of 3 to the right of the parent's position bits:\n *\n *   Note: In the illustration below, the bits to be added are highlighted with '^'.\n *\n *   001 0111100000000000000000000000000000000000000000000000000000000\n *   fff pppps--------------------------------------------------------\n *         ^^\n *\n *   Child(3) Cell ID (base 10) : 3386706919782612992\n *   Child(3) Cell ID (base 2)  : 0010111100000000000000000000000000000000000000000000000000000000\n *\n * Cell Token:\n * -----------\n * To provide a more concise representation of the S2 cell ID, we can use their hexadecimal representation.\n *\n *   Cell ID (base 10): 3170534137668829184\n *   Cell ID (base 2) : 0010110000000000000000000000000000000000000000000000000000000000\n *\n *   We remove all trailing zero bits, until we reach the nybble (4 bits) that contains the sentinel bit.\n *\n *   Note: In the illustration below, the bits to be removed are highlighted with 'X'.\n *\n *   0010110000000000000000000000000000000000000000000000000000000000\n *   fffpps--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n *\n *   We convert the remaining bits to their hexadecimal representation.\n *\n *   Base 2: 0010 1100\n *   Base 16: \"2\"  \"c\"\n *\n *   Cell Token: \"2c\"\n *\n * To compute the cell ID from the token, we simply add enough zeros to the right to make the ID span 64 bits.\n *\n * Coordinate Transforms:\n * ----------------------\n *\n * To go from a cell in S2 to a point on the ellipsoid, the following order of transforms is applied:\n *\n *   1. (Cell ID): S2 cell ID\n *   2. (Face, I, J): Leaf cell coordinates, where i and j are in range [0, 2^30 - 1]\n *   3. (Face, S, T): Cell space coordinates, where s and t are in range [0, 1].\n *   4. (Face, Si, Ti): Discrete cell space coordinates, where si and ti are in range [0, 2^31]\n *   5. (Face, U, V): Cube space coordinates, where u and v are in range [-1, 1]. We apply the non-linear quadratic transform here.\n *   6. (X, Y, Z): Direction vector, where vector may not be unit length. Can be normalized to obtain point on unit sphere\n *   7. (Latitude, Longitude): Direction vector, where latitude is in range [-90, 90] and longitude is in range [-180, 180]\n *\n * @ignore\n */\n\n// The maximum level supported within an S2 cell ID. Each level is represented by two bits in the final cell ID\nconst S2_MAX_LEVEL = 30;\n\n// The maximum index of a valid leaf cell plus one.  The range of valid leaf cell indices is [0..S2_LIMIT_IJ-1].\nconst S2_LIMIT_IJ = 1 << S2_MAX_LEVEL;\n\n// The maximum value of an si- or ti-coordinate.  The range of valid (si,ti) values is [0..S2_MAX_SITI].  Use `>>>` to convert to unsigned.\nconst S2_MAX_SITI = (1 << (S2_MAX_LEVEL + 1)) >>> 0;\n\n// The number of bits in a S2 cell ID used for specifying the position along the Hilbert curve\nconst S2_POSITION_BITS = 2 * S2_MAX_LEVEL + 1;\n\n// The number of bits per I and J in the lookup tables\nconst S2_LOOKUP_BITS = 4;\n\n// Lookup table for mapping 10 bits of IJ + orientation to 10 bits of Hilbert curve position + orientation.\nconst S2_LOOKUP_POSITIONS = [];\n\n// Lookup table for mapping 10 bits of IJ + orientation to 10 bits of Hilbert curve position + orientation.\nconst S2_LOOKUP_IJ = [];\n\n// Lookup table of two bits of IJ from two bits of curve position, based also on the current curve orientation from the swap and invert bits\nconst S2_POSITION_TO_IJ = [\n  [0, 1, 3, 2], // 0: Normal order, no swap or invert\n  [0, 2, 3, 1], // 1: Swap bit set, swap I and J bits\n  [3, 2, 0, 1], // 2: Invert bit set, invert bits\n  [3, 1, 0, 2], // 3: Swap and invert bits set\n];\n\n// Mask that specifies the swap orientation bit for the Hilbert curve\nconst S2_SWAP_MASK = 1;\n\n// Mask that specifies the invert orientation bit for the Hilbert curve\nconst S2_INVERT_MASK = 2;\n\n// Lookup for the orientation update mask of one of the four sub-cells within a higher level cell.\n// This mask is XOR'ed with the current orientation to get the sub-cell orientation.\nconst S2_POSITION_TO_ORIENTATION_MASK = [\n  S2_SWAP_MASK,\n  0,\n  0,\n  S2_SWAP_MASK | S2_INVERT_MASK,\n];\n\n/**\n * Represents a cell in the S2 geometry library.\n *\n * @alias S2Cell\n * @constructor\n *\n * @param {bigint} [cellId] The 64-bit S2CellId.\n * @private\n */\nfunction S2Cell(cellId) {\n  if (!FeatureDetection.supportsBigInt()) {\n    throw new RuntimeError(\"S2 required BigInt support\");\n  }\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(cellId)) {\n    throw new DeveloperError(\"cell ID is required.\");\n  }\n  if (!S2Cell.isValidId(cellId)) {\n    throw new DeveloperError(\"cell ID is invalid.\");\n  }\n  //>>includeEnd('debug');\n\n  this._cellId = cellId;\n  this._level = S2Cell.getLevel(cellId);\n}\n\n/**\n * Creates a new S2Cell from a token. A token is a hexadecimal representation of the 64-bit S2CellId.\n *\n * @param {string} token The token for the S2 Cell.\n * @returns {S2Cell} Returns a new S2Cell.\n * @private\n */\nS2Cell.fromToken = function (token) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"token\", token);\n  if (!S2Cell.isValidToken(token)) {\n    throw new DeveloperError(\"token is invalid.\");\n  }\n  //>>includeEnd('debug');\n\n  return new S2Cell(S2Cell.getIdFromToken(token));\n};\n\n/**\n * Validates an S2 cell ID.\n *\n * @param {bigint} [cellId] The S2CellId.\n * @returns {boolean} Returns true if the cell ID is valid, returns false otherwise.\n * @private\n */\nS2Cell.isValidId = function (cellId) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.bigint(\"cellId\", cellId);\n  //>>includeEnd('debug');\n\n  // Check if sentinel bit is missing.\n  if (cellId <= 0) {\n    return false;\n  }\n\n  // Check if face bits indicate a valid value, in range [0-5].\n  // eslint-disable-next-line\n  if (cellId >> BigInt(S2_POSITION_BITS) > 5) {\n    return false;\n  }\n\n  // Check trailing 1 bit is in one of the even bit positions allowed for the 30 levels, using a bitmask.\n  // eslint-disable-next-line no-undef\n  const lowestSetBit = cellId & (~cellId + BigInt(1));\n  // eslint-disable-next-line\n  if (!(lowestSetBit & BigInt(\"0x1555555555555555\"))) {\n    return false;\n  }\n\n  return true;\n};\n\n/**\n * Validates an S2 cell token.\n *\n * @param {string} [token] The hexadecimal representation of an S2CellId.\n * @returns {boolean} Returns true if the token is valid, returns false otherwise.\n * @private\n */\nS2Cell.isValidToken = function (token) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"token\", token);\n  //>>includeEnd('debug');\n\n  if (!/^[0-9a-fA-F]{1,16}$/.test(token)) {\n    return false;\n  }\n\n  return S2Cell.isValidId(S2Cell.getIdFromToken(token));\n};\n\n/**\n * Converts an S2 cell token to a 64-bit S2 cell ID.\n *\n * @param {string} [token] The hexadecimal representation of an S2CellId. Expected to be a valid S2 token.\n * @returns {bigint} Returns the S2 cell ID.\n * @private\n */\nS2Cell.getIdFromToken = function (token) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"token\", token);\n  //>>includeEnd('debug');\n\n  return BigInt(\"0x\" + token + \"0\".repeat(16 - token.length)); // eslint-disable-line\n};\n\n/**\n * Converts a 64-bit S2 cell ID to an S2 cell token.\n *\n * @param {bigint} [cellId] The S2 cell ID.\n * @returns {string} Returns hexadecimal representation of an S2CellId.\n * @private\n */\nS2Cell.getTokenFromId = function (cellId) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.bigint(\"cellId\", cellId);\n  //>>includeEnd('debug');\n\n  const trailingZeroHexChars = Math.floor(countTrailingZeroBits(cellId) / 4);\n  const hexString = cellId.toString(16).replace(/0*$/, \"\");\n\n  const zeroString = Array(17 - trailingZeroHexChars - hexString.length).join(\n    \"0\"\n  );\n  return zeroString + hexString;\n};\n\n/**\n * Gets the level of the cell from the cell ID.\n *\n * @param {bigint} [cellId] The S2 cell ID.\n * @returns {number} Returns the level of the cell.\n * @private\n */\nS2Cell.getLevel = function (cellId) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.bigint(\"cellId\", cellId);\n  if (!S2Cell.isValidId(cellId)) {\n    throw new DeveloperError();\n  }\n  //>>includeEnd('debug');\n\n  let lsbPosition = 0;\n  // eslint-disable-next-line\n  while (cellId !== BigInt(0)) {\n    // eslint-disable-next-line\n    if (cellId & BigInt(1)) {\n      break;\n    }\n    lsbPosition++;\n    cellId = cellId >> BigInt(1); // eslint-disable-line\n  }\n\n  // We use (>> 1) because there are 2 bits per level.\n  return S2_MAX_LEVEL - (lsbPosition >> 1);\n};\n\n/**\n * Gets the child cell of the cell at the given index.\n *\n * @param {number} index An integer index of the child.\n * @returns {S2Cell} The child of the S2Cell.\n * @private\n */\nS2Cell.prototype.getChild = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"index\", index);\n  if (index < 0 || index > 3) {\n    throw new DeveloperError(\"child index must be in the range [0-3].\");\n  }\n  if (this._level === 30) {\n    throw new DeveloperError(\"cannot get child of leaf cell.\");\n  }\n  //>>includeEnd('debug');\n\n  // Shift sentinel bit 2 positions to the right.\n  // eslint-disable-next-line no-undef\n  const newLsb = lsb(this._cellId) >> BigInt(2);\n  // Insert child index before the sentinel bit.\n  // eslint-disable-next-line no-undef\n  const childCellId = this._cellId + BigInt(2 * index + 1 - 4) * newLsb;\n  return new S2Cell(childCellId);\n};\n\n/**\n * Gets the parent cell of an S2Cell.\n *\n * @returns {S2Cell} Returns the parent of the S2Cell.\n * @private\n */\nS2Cell.prototype.getParent = function () {\n  //>>includeStart('debug', pragmas.debug);\n  if (this._level === 0) {\n    throw new DeveloperError(\"cannot get parent of root cell.\");\n  }\n  //>>includeEnd('debug');\n  // Shift the sentinel bit 2 positions to the left.\n  // eslint-disable-next-line no-undef\n  const newLsb = lsb(this._cellId) << BigInt(2);\n  // Erase the left over bits to the right of the sentinel bit.\n  // eslint-disable-next-line no-undef\n  return new S2Cell((this._cellId & (~newLsb + BigInt(1))) | newLsb);\n};\n\n/**\n * Gets the parent cell at the given level.\n *\n * @returns {S2Cell} Returns the parent of the S2Cell.\n * @private\n */\nS2Cell.prototype.getParentAtLevel = function (level) {\n  //>>includeStart('debug', pragmas.debug);\n  if (this._level === 0 || level < 0 || this._level < level) {\n    throw new DeveloperError(\"cannot get parent at invalid level.\");\n  }\n  //>>includeEnd('debug');\n  const newLsb = lsbForLevel(level);\n  return new S2Cell((this._cellId & -newLsb) | newLsb);\n};\n\n/**\n * Get center of the S2 cell.\n *\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid.\n * @returns {Cartesian3} The position of center of the S2 cell.\n * @private\n */\nS2Cell.prototype.getCenter = function (ellipsoid) {\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n  let center = getS2Center(this._cellId, this._level);\n  // Normalize XYZ.\n  center = Cartesian3.normalize(center, center);\n  const cartographic = new Cartographic.fromCartesian(\n    center,\n    Ellipsoid.UNIT_SPHERE\n  );\n  // Interpret as geodetic coordinates on the ellipsoid.\n  return Cartographic.toCartesian(cartographic, ellipsoid, new Cartesian3());\n};\n\n/**\n * Get vertex of the S2 cell. Vertices are indexed in CCW order.\n *\n * @param {number} index An integer index of the vertex. Must be in the range [0-3].\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid.\n * @returns {Cartesian3} The position of the vertex of the S2 cell.\n * @private\n */\nS2Cell.prototype.getVertex = function (index, ellipsoid) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"index\", index);\n  if (index < 0 || index > 3) {\n    throw new DeveloperError(\"vertex index must be in the range [0-3].\");\n  }\n  //>>includeEnd('debug');\n\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n  let vertex = getS2Vertex(this._cellId, this._level, index);\n  // Normalize XYZ.\n  vertex = Cartesian3.normalize(vertex, vertex);\n  const cartographic = new Cartographic.fromCartesian(\n    vertex,\n    Ellipsoid.UNIT_SPHERE\n  );\n  // Interpret as geodetic coordinates on the ellipsoid.\n  return Cartographic.toCartesian(cartographic, ellipsoid, new Cartesian3());\n};\n\n/**\n * Creates an S2Cell from its face, position along the Hilbert curve for a given level.\n *\n * @param {number} face The root face of S2 this cell is on. Must be in the range [0-5].\n * @param {bigint} position The position along the Hilbert curve. Must be in the range [0-4**level).\n * @param {number} level The level of the S2 curve. Must be in the range [0-30].\n * @returns {S2Cell} A new S2Cell from the given parameters.\n * @private\n */\nS2Cell.fromFacePositionLevel = function (face, position, level) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.bigint(\"position\", position);\n  if (face < 0 || face > 5) {\n    throw new DeveloperError(\"Invalid S2 Face (must be within 0-5)\");\n  }\n\n  if (level < 0 || level > S2_MAX_LEVEL) {\n    throw new DeveloperError(\"Invalid level (must be within 0-30)\");\n  }\n  if (position < 0 || position >= Math.pow(4, level)) {\n    throw new DeveloperError(\"Invalid Hilbert position for level\");\n  }\n  //>>includeEnd('debug');\n\n  const faceBitString =\n    (face < 4 ? \"0\" : \"\") + (face < 2 ? \"0\" : \"\") + face.toString(2);\n  const positionBitString = position.toString(2);\n  const positionPrefixPadding = Array(\n    2 * level - positionBitString.length + 1\n  ).join(\"0\");\n  const positionSuffixPadding = Array(S2_POSITION_BITS - 2 * level).join(\"0\");\n\n  // eslint-disable-next-line no-undef\n  const cellId = BigInt(\n    `0b${faceBitString}${positionPrefixPadding}${positionBitString}1${\n      // Adding the sentinel bit that always follows the position bits.\n      positionSuffixPadding\n    }`\n  );\n  return new S2Cell(cellId);\n};\n\n/**\n * @private\n */\nfunction getS2Center(cellId, level) {\n  const faceSiTi = convertCellIdToFaceSiTi(cellId, level);\n  return convertFaceSiTitoXYZ(faceSiTi[0], faceSiTi[1], faceSiTi[2]);\n}\n/**\n * @private\n */\nfunction getS2Vertex(cellId, level, index) {\n  const faceIJ = convertCellIdToFaceIJ(cellId, level);\n  const uv = convertIJLeveltoBoundUV([faceIJ[1], faceIJ[2]], level);\n  // Handles CCW ordering of the vertices.\n  const y = (index >> 1) & 1;\n  return convertFaceUVtoXYZ(faceIJ[0], uv[0][y ^ (index & 1)], uv[1][y]);\n}\n\n// S2 Coordinate Conversions\n\n/**\n * @private\n */\nfunction convertCellIdToFaceSiTi(cellId, level) {\n  const faceIJ = convertCellIdToFaceIJ(cellId);\n  const face = faceIJ[0];\n  const i = faceIJ[1];\n  const j = faceIJ[2];\n\n  // We're resolving the center when we do the coordinate transform here. For the leaf cells, we're adding half the cell size\n  // (remember that this space has 31 levels - which allows us to pick center and edges of the leaf cells). For non leaf cells,\n  // we get one of either two cells diagonal to the cell center. The correction is used to make sure we pick the leaf cell edges\n  // that represent the parent cell center.\n  const isLeaf = level === 30;\n  const shouldCorrect =\n    !isLeaf && (BigInt(i) ^ (cellId >> BigInt(2))) & BigInt(1); // eslint-disable-line\n  const correction = isLeaf ? 1 : shouldCorrect ? 2 : 0;\n  const si = (i << 1) + correction;\n  const ti = (j << 1) + correction;\n  return [face, si, ti];\n}\n\n/**\n * @private\n */\nfunction convertCellIdToFaceIJ(cellId) {\n  if (S2_LOOKUP_POSITIONS.length === 0) {\n    generateLookupTable();\n  }\n\n  // eslint-disable-next-line no-undef\n  const face = Number(cellId >> BigInt(S2_POSITION_BITS));\n  let bits = face & S2_SWAP_MASK;\n  const lookupMask = (1 << S2_LOOKUP_BITS) - 1;\n\n  let i = 0;\n  let j = 0;\n\n  for (let k = 7; k >= 0; k--) {\n    const numberOfBits =\n      k === 7 ? S2_MAX_LEVEL - 7 * S2_LOOKUP_BITS : S2_LOOKUP_BITS;\n    const extractMask = (1 << (2 * numberOfBits)) - 1;\n    bits +=\n      Number(\n        (cellId >> BigInt(k * 2 * S2_LOOKUP_BITS + 1)) & BigInt(extractMask) // eslint-disable-line\n      ) << 2;\n\n    bits = S2_LOOKUP_IJ[bits];\n\n    const offset = k * S2_LOOKUP_BITS;\n    i += (bits >> (S2_LOOKUP_BITS + 2)) << offset;\n    j += ((bits >> 2) & lookupMask) << offset;\n\n    bits &= S2_SWAP_MASK | S2_INVERT_MASK;\n  }\n\n  return [face, i, j];\n}\n\n/**\n * @private\n */\nfunction convertFaceSiTitoXYZ(face, si, ti) {\n  const s = convertSiTitoST(si);\n  const t = convertSiTitoST(ti);\n\n  const u = convertSTtoUV(s);\n  const v = convertSTtoUV(t);\n  return convertFaceUVtoXYZ(face, u, v);\n}\n\n/**\n * @private\n */\nfunction convertFaceUVtoXYZ(face, u, v) {\n  switch (face) {\n    case 0:\n      return new Cartesian3(1, u, v);\n    case 1:\n      return new Cartesian3(-u, 1, v);\n    case 2:\n      return new Cartesian3(-u, -v, 1);\n    case 3:\n      return new Cartesian3(-1, -v, -u);\n    case 4:\n      return new Cartesian3(v, -1, -u);\n    default:\n      return new Cartesian3(v, u, -1);\n  }\n}\n\n/**\n * S2 provides 3 methods for the non-linear transform: linear, quadratic and tangential.\n * This implementation uses the quadratic method because it provides a good balance of\n * accuracy and speed.\n *\n * For a more detailed comparison of these transform methods, see\n * {@link https://github.com/google/s2geometry/blob/0c4c460bdfe696da303641771f9def900b3e440f/src/s2/s2metrics.cc}\n * @private\n */\nfunction convertSTtoUV(s) {\n  if (s >= 0.5) {\n    return (1 / 3) * (4 * s * s - 1);\n  }\n  return (1 / 3) * (1 - 4 * (1 - s) * (1 - s));\n}\n\n/**\n * @private\n */\nfunction convertSiTitoST(si) {\n  return (1.0 / S2_MAX_SITI) * si;\n}\n\n/**\n * @private\n */\nfunction convertIJLeveltoBoundUV(ij, level) {\n  const result = [[], []];\n  const cellSize = getSizeIJ(level);\n  for (let d = 0; d < 2; ++d) {\n    const ijLow = ij[d] & -cellSize;\n    const ijHigh = ijLow + cellSize;\n    result[d][0] = convertSTtoUV(convertIJtoSTMinimum(ijLow));\n    result[d][1] = convertSTtoUV(convertIJtoSTMinimum(ijHigh));\n  }\n  return result;\n}\n\n/**\n * @private\n */\nfunction getSizeIJ(level) {\n  return (1 << (S2_MAX_LEVEL - level)) >>> 0;\n}\n\n/**\n * @private\n */\nfunction convertIJtoSTMinimum(i) {\n  return (1.0 / S2_LIMIT_IJ) * i;\n}\n\n// Utility Functions\n\n/**\n * This function generates 4 variations of a Hilbert curve of level 4, based on the S2_POSITION_TO_IJ table, for fast lookups of (i, j)\n * to position along Hilbert curve. The reference C++ implementation uses an iterative approach, however, this function is implemented\n * recursively.\n *\n * See {@link https://github.com/google/s2geometry/blob/c59d0ca01ae3976db7f8abdc83fcc871a3a95186/src/s2/s2cell_id.cc#L75-L109}\n * @private\n */\nfunction generateLookupCell(\n  level,\n  i,\n  j,\n  originalOrientation,\n  position,\n  orientation\n) {\n  if (level === S2_LOOKUP_BITS) {\n    const ij = (i << S2_LOOKUP_BITS) + j;\n    S2_LOOKUP_POSITIONS[(ij << 2) + originalOrientation] =\n      (position << 2) + orientation;\n    S2_LOOKUP_IJ[(position << 2) + originalOrientation] =\n      (ij << 2) + orientation;\n  } else {\n    level++;\n    i <<= 1;\n    j <<= 1;\n    position <<= 2;\n    const r = S2_POSITION_TO_IJ[orientation];\n    generateLookupCell(\n      level,\n      i + (r[0] >> 1),\n      j + (r[0] & 1),\n      originalOrientation,\n      position,\n      orientation ^ S2_POSITION_TO_ORIENTATION_MASK[0]\n    );\n    generateLookupCell(\n      level,\n      i + (r[1] >> 1),\n      j + (r[1] & 1),\n      originalOrientation,\n      position + 1,\n      orientation ^ S2_POSITION_TO_ORIENTATION_MASK[1]\n    );\n    generateLookupCell(\n      level,\n      i + (r[2] >> 1),\n      j + (r[2] & 1),\n      originalOrientation,\n      position + 2,\n      orientation ^ S2_POSITION_TO_ORIENTATION_MASK[2]\n    );\n    generateLookupCell(\n      level,\n      i + (r[3] >> 1),\n      j + (r[3] & 1),\n      originalOrientation,\n      position + 3,\n      orientation ^ S2_POSITION_TO_ORIENTATION_MASK[3]\n    );\n  }\n}\n\n/**\n * @private\n */\nfunction generateLookupTable() {\n  generateLookupCell(0, 0, 0, 0, 0, 0);\n  generateLookupCell(0, 0, 0, S2_SWAP_MASK, 0, S2_SWAP_MASK);\n  generateLookupCell(0, 0, 0, S2_INVERT_MASK, 0, S2_INVERT_MASK);\n  generateLookupCell(\n    0,\n    0,\n    0,\n    S2_SWAP_MASK | S2_INVERT_MASK,\n    0,\n    S2_SWAP_MASK | S2_INVERT_MASK\n  );\n}\n\n/**\n * Return the lowest-numbered bit that is on for this cell id\n * @private\n */\nfunction lsb(cellId) {\n  return cellId & (~cellId + BigInt(1)); // eslint-disable-line\n}\n\n/**\n * Return the lowest-numbered bit that is on for cells at the given level.\n * @private\n */\nfunction lsbForLevel(level) {\n  return BigInt(1) << BigInt(2 * (S2_MAX_LEVEL - level)); // eslint-disable-line\n}\n\n// Lookup table for getting trailing zero bits.\n// https://graphics.stanford.edu/~seander/bithacks.html\nconst Mod67BitPosition = [\n  64,\n  0,\n  1,\n  39,\n  2,\n  15,\n  40,\n  23,\n  3,\n  12,\n  16,\n  59,\n  41,\n  19,\n  24,\n  54,\n  4,\n  64,\n  13,\n  10,\n  17,\n  62,\n  60,\n  28,\n  42,\n  30,\n  20,\n  51,\n  25,\n  44,\n  55,\n  47,\n  5,\n  32,\n  65,\n  38,\n  14,\n  22,\n  11,\n  58,\n  18,\n  53,\n  63,\n  9,\n  61,\n  27,\n  29,\n  50,\n  43,\n  46,\n  31,\n  37,\n  21,\n  57,\n  52,\n  8,\n  26,\n  49,\n  45,\n  36,\n  56,\n  7,\n  48,\n  35,\n  6,\n  34,\n  33,\n  0,\n];\n\n/**\n * Return the number of trailing zeros in number.\n * @private\n */\nfunction countTrailingZeroBits(x) {\n  return Mod67BitPosition[(-x & x) % BigInt(67)]; // eslint-disable-line\n}\n\nexport default S2Cell;\n", "import defined from \"../Core/defined.js\";\n\n/**\n * Check if a specific extension is present on a JSON object. This can be used\n * for either 3D Tiles extensions or glTF extensions\n * @param {object} json The JSON object\n * @param {string} extensionName The name of the extension, e.g. '3DTILES_implicit_tiling'\n * @returns {boolean} True if the extension is present\n * @private\n */\nfunction hasExtension(json, extensionName) {\n  return (\n    defined(json) &&\n    defined(json.extensions) &&\n    defined(json.extensions[extensionName])\n  );\n}\n\nexport default hasExtension;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * An availability bitstream for use in an {@link ImplicitSubtree}. This handles\n * both Uint8Array bitstreams and constant values.\n *\n * @alias ImplicitAvailabilityBitstream\n * @constructor\n *\n * @param {object} options An object with the following properties:\n * @param {number} options.lengthBits The length of the bitstream in bits\n * @param {boolean} [options.constant] A single boolean value indicating the value of all the bits in the bitstream if they are all the same\n * @param {Uint8Array} [options.bitstream] An array of bytes storing the bitstream in binary\n * @param {number} [options.availableCount] A number indicating how many 1 bits are found in the bitstream\n * @param {boolean} [options.computeAvailableCountEnabled=false] If true, and options.availableCount is undefined, the availableCount will be computed from the bitstream.\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ImplicitAvailabilityBitstream(options) {\n  const lengthBits = options.lengthBits;\n  let availableCount = options.availableCount;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"options.lengthBits\", lengthBits);\n  //>>includeEnd('debug');\n\n  const constant = options.constant;\n  const bitstream = options.bitstream;\n\n  if (defined(constant)) {\n    // if defined, constant must be 1 which means all tiles are available\n    availableCount = lengthBits;\n  } else {\n    const expectedLength = Math.ceil(lengthBits / 8);\n    if (bitstream.length !== expectedLength) {\n      throw new RuntimeError(\n        `Availability bitstream must be exactly ${expectedLength} bytes long to store ${lengthBits} bits. Actual bitstream was ${bitstream.length} bytes long.`\n      );\n    }\n\n    // Only compute the available count if requested, as this involves looping\n    // over the bitstream.\n    const computeAvailableCountEnabled = defaultValue(\n      options.computeAvailableCountEnabled,\n      false\n    );\n    if (!defined(availableCount) && computeAvailableCountEnabled) {\n      availableCount = count1Bits(bitstream, lengthBits);\n    }\n  }\n\n  this._lengthBits = lengthBits;\n  this._availableCount = availableCount;\n  this._constant = constant;\n  this._bitstream = bitstream;\n}\n\n/**\n * Count the number of bits with value 1 in the bitstream. This is used for\n * computing availableCount if not precomputed\n *\n * @param {Uint8Array} bitstream The bitstream typed array\n * @param {number} lengthBits How many bits are in the bitstream\n * @private\n */\nfunction count1Bits(bitstream, lengthBits) {\n  let count = 0;\n  for (let i = 0; i < lengthBits; i++) {\n    const byteIndex = i >> 3;\n    const bitIndex = i % 8;\n    count += (bitstream[byteIndex] >> bitIndex) & 1;\n  }\n  return count;\n}\n\nObject.defineProperties(ImplicitAvailabilityBitstream.prototype, {\n  /**\n   * The length of the bitstream in bits.\n   *\n   * @memberof ImplicitAvailabilityBitstream.prototype\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  lengthBits: {\n    get: function () {\n      return this._lengthBits;\n    },\n  },\n  /**\n   * The number of bits in the bitstream with value <code>1</code>.\n   *\n   * @memberof ImplicitAvailabilityBitstream.prototype\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  availableCount: {\n    get: function () {\n      return this._availableCount;\n    },\n  },\n});\n\n/**\n * Get a bit from the availability bitstream as a Boolean. If the bitstream\n * is a constant, the constant value is returned instead.\n *\n * @param {number} index The integer index of the bit.\n * @returns {boolean} The value of the bit\n * @private\n */\nImplicitAvailabilityBitstream.prototype.getBit = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  if (index < 0 || index >= this._lengthBits) {\n    throw new DeveloperError(\"Bit index out of bounds.\");\n  }\n  //>>includeEnd('debug');\n\n  if (defined(this._constant)) {\n    return this._constant;\n  }\n\n  // byteIndex is floor(index / 8)\n  const byteIndex = index >> 3;\n  const bitIndex = index % 8;\n\n  return ((this._bitstream[byteIndex] >> bitIndex) & 1) === 1;\n};\n\nexport default ImplicitAvailabilityBitstream;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\n\n/**\n * This class represents a single entity in the <code>MetadataTable</code> owned by an implicit subtree. The entity is specified by the entityId.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @param {MetadataTable} options.metadataTable The metadata table.\n * @param {MetadataClass} options.class The class that the metadata conforms to.\n * @param {number} options.entityId The ID of the entity the metadata belongs to.\n * @param {object} options.propertyTableJson The JSON that contains the property table of the entity.\n *\n * @alias ImplicitMetadataView\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ImplicitMetadataView(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const metadataTable = options.metadataTable;\n  const metadataClass = options.class;\n  const entityId = options.entityId;\n  const propertyTableJson = options.propertyTableJson;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.metadataTable\", metadataTable);\n  Check.typeOf.object(\"options.class\", metadataClass);\n  Check.typeOf.number(\"options.entityId\", entityId);\n  Check.typeOf.object(\"options.propertyTableJson\", propertyTableJson);\n\n  //>>includeEnd('debug');\n\n  this._class = metadataClass;\n  this._metadataTable = metadataTable;\n  this._entityId = entityId;\n\n  this._extensions = propertyTableJson.extensions;\n  this._extras = propertyTableJson.extras;\n}\n\nObject.defineProperties(ImplicitMetadataView.prototype, {\n  /**\n   * The class that properties conform to.\n   *\n   * @memberof ImplicitMetadataView.prototype\n   * @type {MetadataClass}\n   * @readonly\n   */\n  class: {\n    get: function () {\n      return this._class;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof ImplicitMetadataView.prototype\n   * @type {object}\n   * @readonly\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof ImplicitMetadataView.prototype\n   * @type {object}\n   * @readonly\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\n/**\n * Returns whether the metadata contains this property.\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {boolean} Whether the tile has this property.\n * @private\n */\nImplicitMetadataView.prototype.hasProperty = function (propertyId) {\n  return this._metadataTable.hasProperty(propertyId);\n};\n\n/**\n * Returns whether the metadata contains a property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {boolean} Whether the tile has a property with the given semantic.\n * @private\n */\nImplicitMetadataView.prototype.hasPropertyBySemantic = function (semantic) {\n  return this._metadataTable.hasPropertyBySemantic(semantic);\n};\n\n/**\n * Returns an array of property IDs in the metadata table.\n *\n * @param {string[]} [results] An array into which to store the results.\n * @returns {string[]} The property IDs.\n * @private\n */\nImplicitMetadataView.prototype.getPropertyIds = function (results) {\n  return this._metadataTable.getPropertyIds(results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the tile does not have this property.\n * @private\n */\nImplicitMetadataView.prototype.getProperty = function (propertyId) {\n  return this._metadataTable.getProperty(this._entityId, propertyId);\n};\n\n/**\n * Sets the value of the property with the given ID in the metadata table.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nImplicitMetadataView.prototype.setProperty = function (propertyId, value) {\n  return this._metadataTable.setProperty(this._entityId, propertyId, value);\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic in the metadata table.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the tile does not have this semantic.\n * @private\n */\nImplicitMetadataView.prototype.getPropertyBySemantic = function (semantic) {\n  return this._metadataTable.getPropertyBySemantic(this._entityId, semantic);\n};\n\n/**\n * Sets the value of the property with the given semantic in the metadata table.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\n\nImplicitMetadataView.prototype.setPropertyBySemantic = function (\n  semantic,\n  value\n) {\n  return this._metadataTable.setPropertyBySemantic(\n    this._entityId,\n    semantic,\n    value\n  );\n};\n\nexport default ImplicitMetadataView;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * The subdivision scheme for an implicit tileset.\n *\n * @enum {string}\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst ImplicitSubdivisionScheme = {\n  /**\n   * A quadtree divides a parent tile into four children, split at the midpoint\n   * of the x and y dimensions of the bounding box\n   * @type {string}\n   * @constant\n   * @private\n   */\n  QUADTREE: \"QUADTREE\",\n  /**\n   * An octree divides a parent tile into eight children, split at the midpoint\n   * of the x, y, and z dimensions of the bounding box.\n   * @type {string}\n   * @constant\n   * @private\n   */\n  OCTREE: \"OCTREE\",\n};\n\n/**\n * Get the branching factor for the given subdivision scheme\n * @param {ImplicitSubdivisionScheme} subdivisionScheme The subdivision scheme\n * @returns {number} The branching factor, either 4 for QUADTREE or 8 for OCTREE\n * @private\n */\nImplicitSubdivisionScheme.getBranchingFactor = function (subdivisionScheme) {\n  switch (subdivisionScheme) {\n    case ImplicitSubdivisionScheme.OCTREE:\n      return 8;\n    case ImplicitSubdivisionScheme.QUADTREE:\n      return 4;\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\"subdivisionScheme is not a valid value.\");\n    //>>includeEnd('debug');\n  }\n};\n\nexport default Object.freeze(ImplicitSubdivisionScheme);\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * An entity containing metadata.\n * <p>\n * This type describes an interface and is not intended to be instantiated directly.\n * </p>\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @alias MetadataEntity\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataEntity() {}\n\nObject.defineProperties(MetadataEntity.prototype, {\n  /**\n   * The class that properties conform to.\n   *\n   * @memberof MetadataEntity.prototype\n   * @type {MetadataClass}\n   * @readonly\n   * @private\n   */\n  class: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n});\n\n/**\n * Returns whether the entity has this property.\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {boolean} Whether the entity has this property.\n * @private\n */\nMetadataEntity.prototype.hasProperty = function (propertyId) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Returns whether the entity has a property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {boolean} Whether the entity has a property with the given semantic.\n * @private\n */\nMetadataEntity.prototype.hasPropertyBySemantic = function (semantic) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {string[]} [results] An array into which to store the results.\n * @returns {string[]} The property IDs.\n * @private\n */\nMetadataEntity.prototype.getPropertyIds = function (results) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the entity does not have this property.\n * @private\n */\nMetadataEntity.prototype.getProperty = function (propertyId) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nMetadataEntity.prototype.setProperty = function (propertyId, value) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the entity does not have this property.\n * @private\n */\nMetadataEntity.prototype.getPropertyBySemantic = function (semantic) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nMetadataEntity.prototype.setPropertyBySemantic = function (semantic, value) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Returns whether the entity has this property.\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @param {object} properties The dictionary containing properties.\n * @param {MetadataClass} classDefinition The class.\n * @returns {boolean} Whether the entity has this property.\n *\n * @private\n */\nMetadataEntity.hasProperty = function (\n  propertyId,\n  properties,\n  classDefinition\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"propertyId\", propertyId);\n  Check.typeOf.object(\"properties\", properties);\n  Check.typeOf.object(\"classDefinition\", classDefinition);\n  //>>includeEnd('debug');\n\n  if (defined(properties[propertyId])) {\n    return true;\n  }\n\n  const classProperties = classDefinition.properties;\n  if (!defined(classProperties)) {\n    return false;\n  }\n\n  const classProperty = classProperties[propertyId];\n  if (defined(classProperty) && defined(classProperty.default)) {\n    return true;\n  }\n\n  return false;\n};\n\n/**\n * Returns whether the entity has a property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @param {object} properties The dictionary containing properties.\n * @param {MetadataClass} classDefinition The class.\n * @returns {boolean} Whether the entity has a property with the given semantic.\n *\n * @private\n */\nMetadataEntity.hasPropertyBySemantic = function (\n  semantic,\n  properties,\n  classDefinition\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"semantic\", semantic);\n  Check.typeOf.object(\"properties\", properties);\n  Check.typeOf.object(\"classDefinition\", classDefinition);\n  //>>includeEnd('debug');\n\n  const propertiesBySemantic = classDefinition.propertiesBySemantic;\n  if (!defined(propertiesBySemantic)) {\n    return false;\n  }\n\n  const property = propertiesBySemantic[semantic];\n  return defined(property);\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {object} properties The dictionary containing properties.\n * @param {MetadataClass} classDefinition The class.\n * @param {string[]} [results] An array into which to store the results.\n * @returns {string[]} The property IDs.\n *\n * @private\n */\nMetadataEntity.getPropertyIds = function (\n  properties,\n  classDefinition,\n  results\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"properties\", properties);\n  Check.typeOf.object(\"classDefinition\", classDefinition);\n  //>>includeEnd('debug');\n\n  results = defined(results) ? results : [];\n  results.length = 0;\n\n  // Add entity properties\n  for (const propertyId in properties) {\n    if (\n      properties.hasOwnProperty(propertyId) &&\n      defined(properties[propertyId])\n    ) {\n      results.push(propertyId);\n    }\n  }\n\n  // Add default properties\n  const classProperties = classDefinition.properties;\n  if (defined(classProperties)) {\n    for (const classPropertyId in classProperties) {\n      if (\n        classProperties.hasOwnProperty(classPropertyId) &&\n        !defined(properties[classPropertyId]) &&\n        defined(classProperties[classPropertyId].default)\n      ) {\n        results.push(classPropertyId);\n      }\n    }\n  }\n\n  return results;\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @param {object} properties The dictionary containing properties.\n * @param {MetadataClass} classDefinition The class.\n * @returns {*} The value of the property or <code>undefined</code> if the entity does not have this property.\n *\n * @private\n */\nMetadataEntity.getProperty = function (\n  propertyId,\n  properties,\n  classDefinition\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"propertyId\", propertyId);\n  Check.typeOf.object(\"properties\", properties);\n  Check.typeOf.object(\"classDefinition\", classDefinition);\n\n  if (!defined(classDefinition.properties[propertyId])) {\n    throw new DeveloperError(`Class definition missing property ${propertyId}`);\n  }\n  //>>includeEnd('debug');\n\n  const classProperty = classDefinition.properties[propertyId];\n  let value = properties[propertyId];\n\n  // Clone array values\n  if (Array.isArray(value)) {\n    value = value.slice();\n  }\n\n  // Arrays of vectors are represented as nested arrays in JSON\n  const enableNestedArrays = true;\n\n  // Handle noData and default\n  value = classProperty.handleNoData(value);\n  if (!defined(value) && defined(classProperty.default)) {\n    value = clone(classProperty.default, true);\n    return classProperty.unpackVectorAndMatrixTypes(value, enableNestedArrays);\n  }\n\n  if (!defined(value)) {\n    return undefined;\n  }\n\n  value = classProperty.normalize(value);\n  value = classProperty.applyValueTransform(value);\n  return classProperty.unpackVectorAndMatrixTypes(value, enableNestedArrays);\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @param {object} properties The dictionary containing properties.\n * @param {MetadataClass} classDefinition The class.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n *\n * @private\n */\nMetadataEntity.setProperty = function (\n  propertyId,\n  value,\n  properties,\n  classDefinition\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"propertyId\", propertyId);\n  Check.defined(\"value\", value);\n  Check.typeOf.object(\"properties\", properties);\n  Check.typeOf.object(\"classDefinition\", classDefinition);\n  //>>includeEnd('debug');\n\n  if (!defined(properties[propertyId])) {\n    return false;\n  }\n\n  if (Array.isArray(value)) {\n    value = value.slice(); // clone\n  }\n\n  let classProperty;\n  const classProperties = classDefinition.properties;\n  if (defined(classProperties)) {\n    classProperty = classProperties[propertyId];\n  }\n\n  // arrays of vectors are represented as nested arrays in JSON\n  const enableNestedArrays = true;\n  if (defined(classProperty)) {\n    value = classProperty.packVectorAndMatrixTypes(value, enableNestedArrays);\n    value = classProperty.unapplyValueTransform(value);\n    value = classProperty.unnormalize(value);\n  }\n\n  properties[propertyId] = value;\n  return true;\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @param {object} properties The dictionary containing properties.\n * @param {MetadataClass} classDefinition The class.\n * @returns {*} The value of the property or <code>undefined</code> if the entity does not have this property.\n *\n * @private\n */\nMetadataEntity.getPropertyBySemantic = function (\n  semantic,\n  properties,\n  classDefinition\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"semantic\", semantic);\n  Check.typeOf.object(\"properties\", properties);\n  Check.typeOf.object(\"classDefinition\", classDefinition);\n  //>>includeEnd('debug');\n\n  const propertiesBySemantic = classDefinition.propertiesBySemantic;\n  if (!defined(propertiesBySemantic)) {\n    return undefined;\n  }\n\n  const property = propertiesBySemantic[semantic];\n  if (defined(property)) {\n    return MetadataEntity.getProperty(property.id, properties, classDefinition);\n  }\n  return undefined;\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @param {object} properties The dictionary containing properties.\n * @param {MetadataClass} classDefinition The class.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nMetadataEntity.setPropertyBySemantic = function (\n  semantic,\n  value,\n  properties,\n  classDefinition\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"semantic\", semantic);\n  Check.defined(\"value\", value);\n  Check.typeOf.object(\"properties\", properties);\n  Check.typeOf.object(\"classDefinition\", classDefinition);\n  //>>includeEnd('debug');\n\n  const propertiesBySemantic = classDefinition.propertiesBySemantic;\n  if (!defined(propertiesBySemantic)) {\n    return false;\n  }\n\n  const property = classDefinition.propertiesBySemantic[semantic];\n  if (defined(property)) {\n    return MetadataEntity.setProperty(\n      property.id,\n      value,\n      properties,\n      classDefinition\n    );\n  }\n\n  return false;\n};\n\nexport default MetadataEntity;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport MetadataEntity from \"./MetadataEntity.js\";\n\n/**\n * Metadata about an implicit subtree.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.subtreeMetadata The subtree metadata JSON object.\n * @param {MetadataClass} options.class The class that subtree metadata conforms to.\n *\n * @alias ImplicitSubtreeMetadata\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ImplicitSubtreeMetadata(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const subtreeMetadata = options.subtreeMetadata;\n  const metadataClass = options.class;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.subtreeMetadata\", subtreeMetadata);\n  Check.typeOf.object(\"options.class\", metadataClass);\n  //>>includeEnd('debug');\n\n  const properties = defined(subtreeMetadata.properties)\n    ? subtreeMetadata.properties\n    : {};\n\n  this._class = metadataClass;\n  this._properties = properties;\n  this._extras = subtreeMetadata.extras;\n  this._extensions = subtreeMetadata.extensions;\n}\n\nObject.defineProperties(ImplicitSubtreeMetadata.prototype, {\n  /**\n   * The class that properties conform to.\n   *\n   * @memberof ImplicitSubtreeMetadata.prototype\n   * @type {MetadataClass}\n   * @readonly\n   * @private\n   */\n  class: {\n    get: function () {\n      return this._class;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof ImplicitSubtreeMetadata.prototype\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof ImplicitSubtreeMetadata.prototype\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\n/**\n * Returns whether the subtree has this property.\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {boolean} Whether the subtree has this property.\n * @private\n */\nImplicitSubtreeMetadata.prototype.hasProperty = function (propertyId) {\n  return MetadataEntity.hasProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Returns whether the subtree has a property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {boolean} Whether the subtree has a property with the given semantic.\n * @private\n */\nImplicitSubtreeMetadata.prototype.hasPropertyBySemantic = function (semantic) {\n  return MetadataEntity.hasPropertyBySemantic(\n    semantic,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {string[]} [results] An array into which to store the results.\n * @returns {string[]} The property IDs.\n * @private\n */\nImplicitSubtreeMetadata.prototype.getPropertyIds = function (results) {\n  return MetadataEntity.getPropertyIds(this._properties, this._class, results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the subtree does not have this property.\n * @private\n */\nImplicitSubtreeMetadata.prototype.getProperty = function (propertyId) {\n  return MetadataEntity.getProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nImplicitSubtreeMetadata.prototype.setProperty = function (propertyId, value) {\n  return MetadataEntity.setProperty(\n    propertyId,\n    value,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the subtree does not have this semantic.\n * @private\n */\nImplicitSubtreeMetadata.prototype.getPropertyBySemantic = function (semantic) {\n  return MetadataEntity.getPropertyBySemantic(\n    semantic,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nImplicitSubtreeMetadata.prototype.setPropertyBySemantic = function (\n  semantic,\n  value\n) {\n  return MetadataEntity.setPropertyBySemantic(\n    semantic,\n    value,\n    this._properties,\n    this._class\n  );\n};\n\nexport default ImplicitSubtreeMetadata;\n", "import CesiumMath from \"../Core/Math.js\";\nimport Check from \"../Core/Check.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\n\n/**\n * An enum of metadata component types.\n *\n * @enum {string}\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst MetadataComponentType = {\n  /**\n   * An 8-bit signed integer\n   *\n   * @type {string}\n   * @constant\n   */\n  INT8: \"INT8\",\n  /**\n   * An 8-bit unsigned integer\n   *\n   * @type {string}\n   * @constant\n   */\n  UINT8: \"UINT8\",\n  /**\n   * A 16-bit signed integer\n   *\n   * @type {string}\n   * @constant\n   */\n  INT16: \"INT16\",\n  /**\n   * A 16-bit unsigned integer\n   *\n   * @type {string}\n   * @constant\n   */\n  UINT16: \"UINT16\",\n  /**\n   * A 32-bit signed integer\n   *\n   * @type {string}\n   * @constant\n   */\n  INT32: \"INT32\",\n  /**\n   * A 32-bit unsigned integer\n   *\n   * @type {string}\n   * @constant\n   */\n  UINT32: \"UINT32\",\n  /**\n   * A 64-bit signed integer. This type requires BigInt support.\n   *\n   * @see FeatureDetection.supportsBigInt\n   *\n   * @type {string}\n   * @constant\n   */\n  INT64: \"INT64\",\n  /**\n   * A 64-bit signed integer. This type requires BigInt support\n   *\n   * @see FeatureDetection.supportsBigInt\n   *\n   * @type {string}\n   * @constant\n   */\n  UINT64: \"UINT64\",\n  /**\n   * A 32-bit (single precision) floating point number\n   *\n   * @type {string}\n   * @constant\n   */\n  FLOAT32: \"FLOAT32\",\n  /**\n   * A 64-bit (double precision) floating point number\n   *\n   * @type {string}\n   * @constant\n   */\n  FLOAT64: \"FLOAT64\",\n};\n\n/**\n * Gets the minimum value for the numeric type.\n * <p>\n * Returns a BigInt for the INT64 and UINT64 types if BigInt is supported on this platform.\n * Otherwise an approximate number is returned.\n * </p>\n *\n * @param {MetadataComponentType} type The type.\n * @returns {number|bigint} The minimum value.\n *\n * @private\n */\nMetadataComponentType.getMinimum = function (type) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"type\", type);\n  //>>includeEnd('debug');\n\n  switch (type) {\n    case MetadataComponentType.INT8:\n      return -128;\n    case MetadataComponentType.UINT8:\n      return 0;\n    case MetadataComponentType.INT16:\n      return -32768;\n    case MetadataComponentType.UINT16:\n      return 0;\n    case MetadataComponentType.INT32:\n      return -2147483648;\n    case MetadataComponentType.UINT32:\n      return 0;\n    case MetadataComponentType.INT64:\n      if (FeatureDetection.supportsBigInt()) {\n        return BigInt(\"-9223372036854775808\"); // eslint-disable-line\n      }\n      return -Math.pow(2, 63);\n    case MetadataComponentType.UINT64:\n      if (FeatureDetection.supportsBigInt()) {\n        return BigInt(0); // eslint-disable-line\n      }\n      return 0;\n    case MetadataComponentType.FLOAT32:\n      // Maximum 32-bit floating point number. This value will be converted to the nearest 64-bit Number\n      return -340282346638528859811704183484516925440.0;\n    case MetadataComponentType.FLOAT64:\n      return -Number.MAX_VALUE;\n  }\n};\n\n/**\n * Gets the maximum value for the numeric type.\n * <p>\n * Returns a BigInt for the INT64 and UINT64 types if BigInt is supported on this platform.\n * Otherwise an approximate number is returned.\n * </p>\n *\n * @param {MetadataComponentType} type The type.\n * @returns {number|bigint} The maximum value.\n *\n * @private\n */\nMetadataComponentType.getMaximum = function (type) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"type\", type);\n  //>>includeEnd('debug');\n\n  switch (type) {\n    case MetadataComponentType.INT8:\n      return 127;\n    case MetadataComponentType.UINT8:\n      return 255;\n    case MetadataComponentType.INT16:\n      return 32767;\n    case MetadataComponentType.UINT16:\n      return 65535;\n    case MetadataComponentType.INT32:\n      return 2147483647;\n    case MetadataComponentType.UINT32:\n      return 4294967295;\n    case MetadataComponentType.INT64:\n      if (FeatureDetection.supportsBigInt()) {\n        // Need to initialize with a string otherwise the value will be 9223372036854775808\n        return BigInt(\"9223372036854775807\"); // eslint-disable-line\n      }\n      return Math.pow(2, 63) - 1;\n    case MetadataComponentType.UINT64:\n      if (FeatureDetection.supportsBigInt()) {\n        // Need to initialize with a string otherwise the value will be 18446744073709551616\n        return BigInt(\"18446744073709551615\"); // eslint-disable-line\n      }\n      return Math.pow(2, 64) - 1;\n    case MetadataComponentType.FLOAT32:\n      // Maximum 32-bit floating point number\n      return 340282346638528859811704183484516925440.0;\n    case MetadataComponentType.FLOAT64:\n      return Number.MAX_VALUE;\n  }\n};\n\n/**\n * Returns whether the type is an integer type.\n *\n * @param {MetadataComponentType} type The type.\n * @returns {boolean} Whether the type is an integer type.\n *\n * @private\n */\nMetadataComponentType.isIntegerType = function (type) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"type\", type);\n  //>>includeEnd('debug');\n\n  switch (type) {\n    case MetadataComponentType.INT8:\n    case MetadataComponentType.UINT8:\n    case MetadataComponentType.INT16:\n    case MetadataComponentType.UINT16:\n    case MetadataComponentType.INT32:\n    case MetadataComponentType.UINT32:\n    case MetadataComponentType.INT64:\n    case MetadataComponentType.UINT64:\n      return true;\n    default:\n      return false;\n  }\n};\n\n/**\n * Returns whether the type is an unsigned integer type.\n *\n * @param {MetadataComponentType} type The type.\n * @returns {boolean} Whether the type is an unsigned integer type.\n *\n * @private\n */\nMetadataComponentType.isUnsignedIntegerType = function (type) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"type\", type);\n  //>>includeEnd('debug');\n\n  switch (type) {\n    case MetadataComponentType.UINT8:\n    case MetadataComponentType.UINT16:\n    case MetadataComponentType.UINT32:\n    case MetadataComponentType.UINT64:\n      return true;\n    default:\n      return false;\n  }\n};\n\n/**\n * Returns whether a type can be used in a vector, i.e. the {@link Cartesian2},\n * {@link Cartesian3}, or {@link Cartesian4} classes. This includes all numeric\n * types except for types requiring 64-bit integers\n * @param {MetadataComponentType} type The type to check\n * @return {boolean} <code>true</code> if the type can be encoded as a vector type, or <code>false</code> otherwise\n * @private\n */\nMetadataComponentType.isVectorCompatible = function (type) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"type\", type);\n  //>>includeEnd('debug');\n\n  switch (type) {\n    case MetadataComponentType.INT8:\n    case MetadataComponentType.UINT8:\n    case MetadataComponentType.INT16:\n    case MetadataComponentType.UINT16:\n    case MetadataComponentType.INT32:\n    case MetadataComponentType.UINT32:\n    case MetadataComponentType.FLOAT32:\n    case MetadataComponentType.FLOAT64:\n      return true;\n    default:\n      return false;\n  }\n};\n\n/**\n * Normalizes signed integers to the range [-1.0, 1.0] and unsigned integers to\n * the range [0.0, 1.0].\n * <p>\n * The value may be a BigInt for the INT64 and UINT64 types. The value is converted\n * to a 64-bit floating point number during normalization which may result in\n * small precision differences.\n * </p>\n *\n * @param {number|bigint} value The integer value.\n * @param {MetadataComponentType} type The type.\n * @returns {number} The normalized value.\n *\n * @exception {DeveloperError} value must be a number or a BigInt\n * @exception {DeveloperError} type must be an integer type\n *\n * @private\n */\nMetadataComponentType.normalize = function (value, type) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof value !== \"number\" && typeof value !== \"bigint\") {\n    throw new DeveloperError(\"value must be a number or a BigInt\");\n  }\n  if (!MetadataComponentType.isIntegerType(type)) {\n    throw new DeveloperError(\"type must be an integer type\");\n  }\n  //>>includeEnd('debug');\n\n  return Math.max(\n    Number(value) / Number(MetadataComponentType.getMaximum(type)),\n    -1.0\n  );\n};\n\n/**\n * Unnormalizes signed numbers in the range [-1.0, 1.0] to signed integers and\n * unsigned numbers in the range [0.0, 1.0] to unsigned integers. Values outside\n * the range are clamped to the range.\n * <p>\n * Returns a BigInt for the INT64 and UINT64 types if BigInt is supported on this platform.\n * </p>\n *\n * @param {number} value The normalized value.\n * @param {MetadataComponentType} type The type.\n * @returns {number|bigint} The integer value.\n *\n * @exception {DeveloperError} type must be an integer type\n *\n * @private\n */\nMetadataComponentType.unnormalize = function (value, type) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"value\", value);\n  if (!MetadataComponentType.isIntegerType(type)) {\n    throw new DeveloperError(\"type must be an integer type\");\n  }\n  //>>includeEnd('debug');\n\n  const max = MetadataComponentType.getMaximum(type);\n  const min = MetadataComponentType.isUnsignedIntegerType(type) ? 0 : -max;\n\n  value = CesiumMath.sign(value) * Math.round(Math.abs(value) * Number(max));\n\n  if (\n    (type === MetadataComponentType.INT64 ||\n      type === MetadataComponentType.UINT64) &&\n    FeatureDetection.supportsBigInt()\n  ) {\n    value = BigInt(value); // eslint-disable-line\n  }\n\n  if (value > max) {\n    return max;\n  }\n\n  if (value < min) {\n    return min;\n  }\n\n  return value;\n};\n\n/**\n * @private\n */\nMetadataComponentType.applyValueTransform = function (value, offset, scale) {\n  return scale * value + offset;\n};\n\n/**\n * @private\n */\nMetadataComponentType.unapplyValueTransform = function (value, offset, scale) {\n  // if the scale is 0, avoid a divide by zero error. The result can be any\n  // finite number, so 0.0 will do nicely.\n  if (scale === 0) {\n    return 0.0;\n  }\n\n  return (value - offset) / scale;\n};\n\n/**\n * Gets the size in bytes for the numeric type.\n *\n * @param {MetadataComponentType} type The type.\n * @returns {number} The size in bytes.\n *\n * @private\n */\nMetadataComponentType.getSizeInBytes = function (type) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"type\", type);\n  //>>includeEnd('debug');\n\n  switch (type) {\n    case MetadataComponentType.INT8:\n    case MetadataComponentType.UINT8:\n      return 1;\n    case MetadataComponentType.INT16:\n    case MetadataComponentType.UINT16:\n      return 2;\n    case MetadataComponentType.INT32:\n    case MetadataComponentType.UINT32:\n      return 4;\n    case MetadataComponentType.INT64:\n    case MetadataComponentType.UINT64:\n      return 8;\n    case MetadataComponentType.FLOAT32:\n      return 4;\n    case MetadataComponentType.FLOAT64:\n      return 8;\n  }\n};\n\n/**\n * Gets the {@link MetadataComponentType} from a {@link ComponentDatatype}.\n *\n * @param {ComponentDatatype} componentDatatype The component datatype.\n * @returns {MetadataComponentType} The type.\n *\n * @private\n */\nMetadataComponentType.fromComponentDatatype = function (componentDatatype) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"componentDatatype\", componentDatatype);\n  //>>includeEnd('debug');\n\n  switch (componentDatatype) {\n    case ComponentDatatype.BYTE:\n      return MetadataComponentType.INT8;\n    case ComponentDatatype.UNSIGNED_BYTE:\n      return MetadataComponentType.UINT8;\n    case ComponentDatatype.SHORT:\n      return MetadataComponentType.INT16;\n    case ComponentDatatype.UNSIGNED_SHORT:\n      return MetadataComponentType.UINT16;\n    case ComponentDatatype.INT:\n      return MetadataComponentType.INT32;\n    case ComponentDatatype.UNSIGNED_INT:\n      return MetadataComponentType.UINT32;\n    case ComponentDatatype.FLOAT:\n      return MetadataComponentType.FLOAT32;\n    case ComponentDatatype.DOUBLE:\n      return MetadataComponentType.FLOAT64;\n  }\n};\n\n/**\n * Gets the {@link ComponentDatatype} from a {@link MetadataComponentType}.\n *\n * @param {MetadataComponentType} type The type.\n * @returns {ComponentDatatype} The component datatype.\n *\n * @private\n */\nMetadataComponentType.toComponentDatatype = function (type) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"type\", type);\n  //>>includeEnd('debug');\n\n  switch (type) {\n    case MetadataComponentType.INT8:\n      return ComponentDatatype.BYTE;\n    case MetadataComponentType.UINT8:\n      return ComponentDatatype.UNSIGNED_BYTE;\n    case MetadataComponentType.INT16:\n      return ComponentDatatype.SHORT;\n    case MetadataComponentType.UINT16:\n      return ComponentDatatype.UNSIGNED_SHORT;\n    case MetadataComponentType.INT32:\n      return ComponentDatatype.INT;\n    case MetadataComponentType.UINT32:\n      return ComponentDatatype.UNSIGNED_INT;\n    case MetadataComponentType.FLOAT32:\n      return ComponentDatatype.FLOAT;\n    case MetadataComponentType.FLOAT64:\n      return ComponentDatatype.DOUBLE;\n  }\n};\n\nexport default Object.freeze(MetadataComponentType);\n", "import Check from \"../Core/Check.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix2 from \"../Core/Matrix2.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\n\n/**\n * An enum of metadata types. These metadata types are containers containing\n * one or more components of type {@link MetadataComponentType}\n *\n * @enum {string}\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst MetadataType = {\n  /**\n   * A single component\n   *\n   * @type {string}\n   * @constant\n   */\n  SCALAR: \"SCALAR\",\n  /**\n   * A vector with two components\n   *\n   * @type {string}\n   * @constant\n   */\n  VEC2: \"VEC2\",\n  /**\n   * A vector with three components\n   *\n   * @type {string}\n   * @constant\n   */\n  VEC3: \"VEC3\",\n  /**\n   * A vector with four components\n   *\n   * @type {string}\n   * @constant\n   */\n  VEC4: \"VEC4\",\n  /**\n   * A 2x2 matrix, stored in column-major format.\n   *\n   * @type {string}\n   * @constant\n   */\n  MAT2: \"MAT2\",\n  /**\n   * A 3x3 matrix, stored in column-major format.\n   *\n   * @type {string}\n   * @constant\n   */\n  MAT3: \"MAT3\",\n  /**\n   * A 4x4 matrix, stored in column-major format.\n   *\n   * @type {string}\n   * @constant\n   */\n  MAT4: \"MAT4\",\n  /**\n   * A boolean (true/false) value\n   *\n   * @type {string}\n   * @constant\n   */\n  BOOLEAN: \"BOOLEAN\",\n  /**\n   * A UTF-8 encoded string value\n   *\n   * @type {string}\n   * @constant\n   */\n  STRING: \"STRING\",\n  /**\n   * An enumerated value. This type is used in conjunction with a {@link MetadataEnum} to describe the valid values.\n   *\n   * @see MetadataEnum\n   *\n   * @type {string}\n   * @constant\n   */\n  ENUM: \"ENUM\",\n};\n\n/**\n * Check if a type is VEC2, VEC3 or VEC4\n *\n * @param {MetadataType} type The type\n * @return {boolean} <code>true</code> if the type is a vector, <code>false</code> otherwise\n * @private\n */\nMetadataType.isVectorType = function (type) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"type\", type);\n  //>>includeEnd('debug');\n\n  switch (type) {\n    case MetadataType.VEC2:\n    case MetadataType.VEC3:\n    case MetadataType.VEC4:\n      return true;\n    default:\n      return false;\n  }\n};\n\n/**\n * Check if a type is MAT2, MAT3 or MAT4\n *\n * @param {MetadataType} type The type\n * @return {boolean} <code>true</code> if the type is a matrix, <code>false</code> otherwise\n * @private\n */\nMetadataType.isMatrixType = function (type) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"type\", type);\n  //>>includeEnd('debug');\n\n  switch (type) {\n    case MetadataType.MAT2:\n    case MetadataType.MAT3:\n    case MetadataType.MAT4:\n      return true;\n    default:\n      return false;\n  }\n};\n\n/**\n * Get the number of components for a vector or matrix type. e.g.\n * a VECN returns N, and a MATN returns N*N. All other types return 1.\n *\n * @param {MetadataType} type The type to get the component count for\n * @return {number} The number of components\n * @private\n */\nMetadataType.getComponentCount = function (type) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"type\", type);\n  //>>includeEnd('debug');\n\n  switch (type) {\n    case MetadataType.SCALAR:\n    case MetadataType.STRING:\n    case MetadataType.ENUM:\n    case MetadataType.BOOLEAN:\n      return 1;\n    case MetadataType.VEC2:\n      return 2;\n    case MetadataType.VEC3:\n      return 3;\n    case MetadataType.VEC4:\n      return 4;\n    case MetadataType.MAT2:\n      return 4;\n    case MetadataType.MAT3:\n      return 9;\n    case MetadataType.MAT4:\n      return 16;\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(`Invalid metadata type ${type}`);\n    //>>includeEnd('debug');\n  }\n};\n\n/**\n * Get the corresponding vector or matrix class. This is used to simplify\n * packing and unpacking code.\n * @param {MetadataType} type The metadata type\n * @return {object} The appropriate CartesianN class for vector types, MatrixN class for matrix types, or undefined otherwise.\n * @private\n */\nMetadataType.getMathType = function (type) {\n  switch (type) {\n    case MetadataType.VEC2:\n      return Cartesian2;\n    case MetadataType.VEC3:\n      return Cartesian3;\n    case MetadataType.VEC4:\n      return Cartesian4;\n    case MetadataType.MAT2:\n      return Matrix2;\n    case MetadataType.MAT3:\n      return Matrix3;\n    case MetadataType.MAT4:\n      return Matrix4;\n    default:\n      return undefined;\n  }\n};\n\nexport default Object.freeze(MetadataType);\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix2 from \"../Core/Matrix2.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport MetadataType from \"./MetadataType.js\";\nimport MetadataComponentType from \"./MetadataComponentType.js\";\n\n/**\n * A metadata property, as part of a {@link MetadataClass}.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata|3D Metadata Specification} for 3D Tiles\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {string} options.id The ID of the property.\n * @param {MetadataType} options.type The type of the property such as SCALAR, VEC2, VEC3.\n * @param {MetadataComponentType} [options.componentType] The component type of the property. This includes integer (e.g. INT8 or UINT16), and floating point (FLOAT32 and FLOAT64) values.\n * @param {MetadataEnum} [options.enumType] The enum type of the property. Only defined when type is ENUM.\n * @param {boolean} [options.isArray=false] True if a property is an array (either fixed length or variable length), false otherwise.\n * @param {boolean} [options.isVariableLengthArray=false] True if a property is a variable length array, false otherwise.\n * @param {number} [options.arrayLength] The number of array elements. Only defined for fixed length arrays.\n * @param {boolean} [options.normalized=false] Whether the property is normalized.\n * @param {number|number[]|number[][]} [options.min] A number or an array of numbers storing the minimum allowable value of this property. Only defined when type is a numeric type.\n * @param {number|number[]|number[][]} [options.max] A number or an array of numbers storing the maximum allowable value of this property. Only defined when type is a numeric type.\n * @param {number|number[]|number[][]} [options.offset] The offset to be added to property values as part of the value transform.\n * @param {number|number[]|number[][]} [options.scale] The scale to be multiplied to property values as part of the value transform.\n * @param {boolean|number|string|Array} [options.noData] The no-data sentinel value that represents null values.\n * @param {boolean|number|string|Array} [options.default] A default value to use when an entity's property value is not defined.\n * @param {boolean} [options.required=false] Whether the property is required.\n * @param {string} [options.name] The name of the property.\n * @param {string} [options.description] The description of the property.\n * @param {string} [options.semantic] An identifier that describes how this property should be interpreted.\n * @param {*} [options.extras] Extra user-defined properties.\n * @param {object} [options.extensions] An object containing extensions.\n *\n * @alias MetadataClassProperty\n * @constructor\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataClassProperty(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const id = options.id;\n  const type = options.type;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"options.id\", id);\n  Check.typeOf.string(\"options.type\", type);\n  //>>includeEnd('debug');\n\n  const componentType = options.componentType;\n  const enumType = options.enumType;\n\n  const normalized =\n    defined(componentType) &&\n    MetadataComponentType.isIntegerType(componentType) &&\n    defaultValue(options.normalized, false);\n\n  // Basic information about this property\n  this._id = id;\n  this._name = options.name;\n  this._description = options.description;\n  this._semantic = options.semantic;\n\n  // Only for unit testing purposes, not documented in the API\n  this._isLegacyExtension = options.isLegacyExtension;\n\n  // Details about basic types\n  this._type = type;\n  this._componentType = componentType;\n  this._enumType = enumType;\n  this._valueType = defined(enumType) ? enumType.valueType : componentType;\n\n  // Details about arrays\n  this._isArray = defaultValue(options.isArray, false);\n  this._isVariableLengthArray = defaultValue(\n    options.isVariableLengthArray,\n    false\n  );\n  this._arrayLength = options.arrayLength;\n\n  // min and max allowed values\n  this._min = clone(options.min, true);\n  this._max = clone(options.max, true);\n\n  // properties that adjust the range of metadata values\n  this._normalized = normalized;\n\n  let offset = clone(options.offset, true);\n  let scale = clone(options.scale, true);\n  const hasValueTransform = defined(offset) || defined(scale);\n\n  const enableNestedArrays = true;\n  if (!defined(offset)) {\n    offset = this.expandConstant(0, enableNestedArrays);\n  }\n\n  if (!defined(scale)) {\n    scale = this.expandConstant(1, enableNestedArrays);\n  }\n\n  this._offset = offset;\n  this._scale = scale;\n  this._hasValueTransform = hasValueTransform;\n\n  // sentinel value for missing data, and a default value to use\n  // in its place if needed.\n  this._noData = clone(options.noData, true);\n  // For vector and array types, this is stored as an array of values.\n  this._default = clone(options.default, true);\n\n  this._required = defaultValue(options.required, true);\n\n  // extras and extensions\n  this._extras = clone(options.extras, true);\n  this._extensions = clone(options.extensions, true);\n}\n\n/**\n * Creates a {@link MetadataClassProperty} from either 3D Tiles 1.1, 3DTILES_metadata, EXT_structural_metadata, or EXT_feature_metadata.\n *\n * @param {object} options Object with the following properties:\n * @param {string} options.id The ID of the property.\n * @param {object} options.property The property JSON object.\n * @param {Object<string, MetadataEnum>} [options.enums] A dictionary of enums.\n *\n * @returns {MetadataClassProperty} The newly created metadata class property.\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nMetadataClassProperty.fromJson = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const id = options.id;\n  const property = options.property;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"options.id\", id);\n  Check.typeOf.object(\"options.property\", property);\n  Check.typeOf.string(\"options.property.type\", property.type);\n  //>>includeEnd('debug');\n\n  // Try to determine if this is the legacy extension. This is not\n  // always possible, as there are some types that are valid in both\n  // extensions.\n  const isLegacyExtension = isLegacy(property);\n  const parsedType = parseType(property, options.enums);\n\n  // EXT_feature_metadata had an optional flag, while EXT_structural_metadata\n  // has a required flag. The defaults are not the same, and there's some cases\n  // like {type: BOOLEAN} that are ambiguous. Coalesce this into a single\n  // required flag\n  let required;\n  if (!defined(isLegacyExtension)) {\n    // Impossible to tell which extension was used, so don't require\n    // the property\n    required = false;\n  } else if (isLegacyExtension) {\n    required = defined(property.optional) ? !property.optional : true;\n  } else {\n    required = defaultValue(property.required, false);\n  }\n\n  return new MetadataClassProperty({\n    id: id,\n    type: parsedType.type,\n    componentType: parsedType.componentType,\n    enumType: parsedType.enumType,\n    isArray: parsedType.isArray,\n    isVariableLengthArray: parsedType.isVariableLengthArray,\n    arrayLength: parsedType.arrayLength,\n    normalized: property.normalized,\n    min: property.min,\n    max: property.max,\n    offset: property.offset,\n    scale: property.scale,\n    noData: property.noData,\n    default: property.default,\n    required: required,\n    name: property.name,\n    description: property.description,\n    semantic: property.semantic,\n    extras: property.extras,\n    extensions: property.extensions,\n    isLegacyExtension: isLegacyExtension,\n  });\n};\n\nObject.defineProperties(MetadataClassProperty.prototype, {\n  /**\n   * The ID of the property.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {string}\n   * @readonly\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n\n  /**\n   * The name of the property.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {string}\n   * @readonly\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n\n  /**\n   * The description of the property.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {string}\n   * @readonly\n   */\n  description: {\n    get: function () {\n      return this._description;\n    },\n  },\n\n  /**\n   * The type of the property such as SCALAR, VEC2, VEC3\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {MetadataType}\n   * @readonly\n   */\n  type: {\n    get: function () {\n      return this._type;\n    },\n  },\n\n  /**\n   * The enum type of the property. Only defined when type is ENUM.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {MetadataEnum}\n   * @readonly\n   */\n  enumType: {\n    get: function () {\n      return this._enumType;\n    },\n  },\n\n  /**\n   * The component type of the property. This includes integer\n   * (e.g. INT8 or UINT16), and floating point (FLOAT32 and FLOAT64) values\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {MetadataComponentType}\n   * @readonly\n   */\n  componentType: {\n    get: function () {\n      return this._componentType;\n    },\n  },\n\n  /**\n   * The datatype used for storing each component of the property. This\n   * is usually the same as componentType except for ENUM, where this\n   * returns an integer type\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {MetadataComponentType}\n   * @readonly\n   * @private\n   */\n  valueType: {\n    get: function () {\n      return this._valueType;\n    },\n  },\n\n  /**\n   * True if a property is an array (either fixed length or variable length),\n   * false otherwise.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  isArray: {\n    get: function () {\n      return this._isArray;\n    },\n  },\n\n  /**\n   * True if a property is a variable length array, false otherwise.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  isVariableLengthArray: {\n    get: function () {\n      return this._isVariableLengthArray;\n    },\n  },\n\n  /**\n   * The number of array elements. Only defined for fixed-size\n   * arrays.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {number}\n   * @readonly\n   */\n  arrayLength: {\n    get: function () {\n      return this._arrayLength;\n    },\n  },\n\n  /**\n   * Whether the property is normalized.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  normalized: {\n    get: function () {\n      return this._normalized;\n    },\n  },\n\n  /**\n   * A number or an array of numbers storing the maximum allowable value of this property. Only defined when type is a numeric type.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {number|number[]|number[][]}\n   * @readonly\n   */\n  max: {\n    get: function () {\n      return this._max;\n    },\n  },\n\n  /**\n   * A number or an array of numbers storing the minimum allowable value of this property. Only defined when type is a numeric type.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {number|number[]|number[][]}\n   * @readonly\n   */\n  min: {\n    get: function () {\n      return this._min;\n    },\n  },\n\n  /**\n   * The no-data sentinel value that represents null values\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {boolean|number|string|Array}\n   * @readonly\n   */\n  noData: {\n    get: function () {\n      return this._noData;\n    },\n  },\n\n  /**\n   * A default value to use when an entity's property value is not defined.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {boolean|number|string|Array}\n   * @readonly\n   */\n  default: {\n    get: function () {\n      return this._default;\n    },\n  },\n\n  /**\n   * Whether the property is required.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  required: {\n    get: function () {\n      return this._required;\n    },\n  },\n\n  /**\n   * An identifier that describes how this property should be interpreted.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {string}\n   * @readonly\n   */\n  semantic: {\n    get: function () {\n      return this._semantic;\n    },\n  },\n\n  /**\n   * True if offset/scale should be applied. If both offset/scale were\n   * undefined, they default to identity so this property is set false\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  hasValueTransform: {\n    get: function () {\n      return this._hasValueTransform;\n    },\n  },\n\n  /**\n   * The offset to be added to property values as part of the value transform.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {number|number[]|number[][]}\n   * @readonly\n   */\n  offset: {\n    get: function () {\n      return this._offset;\n    },\n  },\n\n  /**\n   * The scale to be multiplied to property values as part of the value transform.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {number|number[]|number[][]}\n   * @readonly\n   */\n  scale: {\n    get: function () {\n      return this._scale;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {*}\n   * @readonly\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {object}\n   * @readonly\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\nfunction isLegacy(property) {\n  if (property.type === \"ARRAY\") {\n    return true;\n  }\n\n  // New property types in EXT_structural_metadata\n  const type = property.type;\n  if (\n    type === MetadataType.SCALAR ||\n    MetadataType.isMatrixType(type) ||\n    MetadataType.isVectorType(type)\n  ) {\n    return false;\n  }\n\n  // EXT_feature_metadata allowed numeric types as a type. Now they are\n  // represented as {type: SINGLE, componentType: type}\n  if (defined(MetadataComponentType[type])) {\n    return true;\n  }\n\n  // New properties in EXT_structural_metadata\n  if (\n    defined(property.noData) ||\n    defined(property.scale) ||\n    defined(property.offset) ||\n    defined(property.required) ||\n    defined(property.count) ||\n    defined(property.array)\n  ) {\n    return false;\n  }\n\n  // Properties that only exist in EXT_feature_metadata\n  if (defined(property.optional)) {\n    return false;\n  }\n\n  // impossible to tell, give up.\n  return undefined;\n}\n\nfunction parseType(property, enums) {\n  const type = property.type;\n  const componentType = property.componentType;\n\n  // EXT_feature_metadata had an ARRAY type. This is now handled\n  // with array + count, so some details need to be transcoded\n  const isLegacyArray = type === \"ARRAY\";\n  let isArray;\n  let arrayLength;\n  let isVariableLengthArray;\n  if (isLegacyArray) {\n    // definitely EXT_feature_metadata\n    isArray = true;\n    arrayLength = property.componentCount;\n    isVariableLengthArray = !defined(arrayLength);\n  } else if (property.array) {\n    isArray = true;\n    arrayLength = property.count;\n    isVariableLengthArray = !defined(property.count);\n  } else {\n    // Could be either extension. Some cases are impossible to distinguish\n    // Default to a single value\n    isArray = false;\n    arrayLength = undefined;\n    isVariableLengthArray = false;\n  }\n\n  let enumType;\n  if (defined(property.enumType)) {\n    enumType = enums[property.enumType];\n  }\n\n  // In both EXT_feature_metadata and EXT_structural_metadata, ENUM appears\n  // as a type.\n  if (type === MetadataType.ENUM) {\n    return {\n      type: type,\n      componentType: undefined,\n      enumType: enumType,\n      valueType: enumType.valueType,\n      isArray: isArray,\n      isVariableLengthArray: isVariableLengthArray,\n      arrayLength: arrayLength,\n    };\n  }\n\n  // In EXT_feature_metadata, ENUM also appears as an ARRAY componentType\n  if (isLegacyArray && componentType === MetadataType.ENUM) {\n    return {\n      type: componentType,\n      componentType: undefined,\n      enumType: enumType,\n      valueType: enumType.valueType,\n      isArray: isArray,\n      isVariableLengthArray: isVariableLengthArray,\n      arrayLength: arrayLength,\n    };\n  }\n\n  // EXT_structural_metadata only: SCALAR, VECN and MATN\n  if (\n    type === MetadataType.SCALAR ||\n    MetadataType.isMatrixType(type) ||\n    MetadataType.isVectorType(type)\n  ) {\n    return {\n      type: type,\n      componentType: componentType,\n      enumType: undefined,\n      valueType: componentType,\n      isArray: isArray,\n      isVariableLengthArray: isVariableLengthArray,\n      arrayLength: arrayLength,\n    };\n  }\n\n  // In both EXT_structural_metadata and EXT_feature_metadata,\n  // BOOLEAN and STRING appear as types\n  if (type === MetadataType.BOOLEAN || type === MetadataType.STRING) {\n    return {\n      type: type,\n      componentType: undefined,\n      enumType: undefined,\n      valueType: undefined,\n      isArray: isArray,\n      isVariableLengthArray: isVariableLengthArray,\n      arrayLength: arrayLength,\n    };\n  }\n\n  // EXT_feature_metadata also allows BOOLEAN and STRING as an ARRAY\n  // componentType\n  if (\n    isLegacyArray &&\n    (componentType === MetadataType.BOOLEAN ||\n      componentType === MetadataType.STRING)\n  ) {\n    return {\n      type: componentType,\n      componentType: undefined,\n      enumType: undefined,\n      valueType: undefined,\n      isArray: isArray,\n      isVariableLengthArray: isVariableLengthArray,\n      arrayLength: arrayLength,\n    };\n  }\n\n  // Both EXT_feature_metadata and EXT_structural_metadata allow numeric types like\n  // INT32 or FLOAT64 as a componentType.\n  if (defined(componentType) && defined(MetadataComponentType[componentType])) {\n    return {\n      type: MetadataType.SCALAR,\n      componentType: componentType,\n      enumType: undefined,\n      valueType: componentType,\n      isArray: isArray,\n      isVariableLengthArray: isVariableLengthArray,\n      arrayLength: arrayLength,\n    };\n  }\n\n  // EXT_feature_metadata: integer and float types were allowed as types,\n  // but now these are expressed as {type: SCALAR, componentType: type}\n  if (defined(MetadataComponentType[type])) {\n    return {\n      type: MetadataType.SCALAR,\n      componentType: type,\n      enumType: undefined,\n      valueType: type,\n      isArray: isArray,\n      isVariableLengthArray: isVariableLengthArray,\n      arrayLength: arrayLength,\n    };\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  throw new DeveloperError(\n    `unknown metadata type {type: ${type}, componentType: ${componentType})`\n  );\n  //>>includeEnd('debug');\n}\n\n/**\n * Normalizes integer property values. If the property is not normalized\n * the value is returned unmodified.\n * <p>\n * Given the way normalization is defined in {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#normalized-values|the 3D Metadata Specification},\n * normalize and unnormalize are almost, but not quite inverses. In particular,\n * the smallest signed integer value will be off by one after normalizing and\n * unnormalizing. See\n * {@link https://www.desmos.com/calculator/nledg1evut|this Desmos graph} for\n * an example using INT8.\n * </p>\n * <p>\n * Furthermore, for 64-bit integer types, there may be a loss of precision\n * due to conversion to Number\n * </p>\n *\n * @param {*} value The integer value or array of integer values.\n * @returns {*} The normalized value or array of normalized values.\n *\n * @private\n */\nMetadataClassProperty.prototype.normalize = function (value) {\n  if (!this._normalized) {\n    return value;\n  }\n\n  return normalizeInPlace(\n    value,\n    this._valueType,\n    MetadataComponentType.normalize\n  );\n};\n\n/**\n * Unnormalizes integer property values. If the property is not normalized\n * the value is returned unmodified.\n * <p>\n * Given the way normalization is defined in {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#normalized-values|the 3D Metadata Specification},\n * normalize and unnormalize are almost, but not quite inverses. In particular,\n * the smallest signed integer value will be off by one after normalizing and\n * unnormalizing. See\n * {@link https://www.desmos.com/calculator/nledg1evut|this Desmos graph} for\n * an example using INT8.\n * </p>\n * <p>\n * Furthermore, for 64-bit integer types, there may be a loss of precision\n * due to conversion to Number\n * </p>\n *\n * @param {*} value The normalized value or array of normalized values.\n * @returns {*} The integer value or array of integer values.\n *\n * @private\n */\nMetadataClassProperty.prototype.unnormalize = function (value) {\n  if (!this._normalized) {\n    return value;\n  }\n\n  return normalizeInPlace(\n    value,\n    this._valueType,\n    MetadataComponentType.unnormalize\n  );\n};\n\n/**\n * @private\n */\nMetadataClassProperty.prototype.applyValueTransform = function (value) {\n  // variable length arrays do not have a well-defined offset/scale so this\n  // is forbidden by the spec\n  if (!this._hasValueTransform || this._isVariableLengthArray) {\n    return value;\n  }\n\n  return MetadataClassProperty.valueTransformInPlace(\n    value,\n    this._offset,\n    this._scale,\n    MetadataComponentType.applyValueTransform\n  );\n};\n\n/**\n * @private\n */\nMetadataClassProperty.prototype.unapplyValueTransform = function (value) {\n  // variable length arrays do not have a well-defined offset/scale so this\n  // is forbidden by the spec\n  if (!this._hasValueTransform || this._isVariableLengthArray) {\n    return value;\n  }\n\n  return MetadataClassProperty.valueTransformInPlace(\n    value,\n    this._offset,\n    this._scale,\n    MetadataComponentType.unapplyValueTransform\n  );\n};\n\n/**\n * @private\n */\nMetadataClassProperty.prototype.expandConstant = function (\n  constant,\n  enableNestedArrays\n) {\n  enableNestedArrays = defaultValue(enableNestedArrays, false);\n  const isArray = this._isArray;\n  const arrayLength = this._arrayLength;\n  const componentCount = MetadataType.getComponentCount(this._type);\n  const isNested = isArray && componentCount > 1;\n\n  // scalar values can be returned directly\n  if (!isArray && componentCount === 1) {\n    return constant;\n  }\n\n  // vector and matrix values\n  if (!isArray) {\n    return new Array(componentCount).fill(constant);\n  }\n\n  // arrays of scalars\n  if (!isNested) {\n    return new Array(arrayLength).fill(constant);\n  }\n\n  // arrays of vectors/matrices: flattened\n  if (!enableNestedArrays) {\n    return new Array(this._arrayLength * componentCount).fill(constant);\n  }\n\n  // array of vectors/matrices: nested\n  const innerConstant = new Array(componentCount).fill(constant);\n  // This array fill duplicates the pointer to the inner arrays. Since this is\n  // intended for use with constants, no need to clone the array.\n  return new Array(this._arrayLength).fill(innerConstant);\n};\n\n/**\n * If the value is the noData sentinel, return undefined. Otherwise, return\n * the value.\n * @param {*} value The raw value\n * @returns {*} Either the value or undefined if the value was a no data value.\n *\n * @private\n */\nMetadataClassProperty.prototype.handleNoData = function (value) {\n  const sentinel = this._noData;\n  if (!defined(sentinel)) {\n    return value;\n  }\n\n  if (arrayEquals(value, sentinel)) {\n    return undefined;\n  }\n\n  return value;\n};\n\nfunction arrayEquals(left, right) {\n  if (!Array.isArray(left)) {\n    return left === right;\n  }\n\n  if (!Array.isArray(right)) {\n    return false;\n  }\n\n  if (left.length !== right.length) {\n    return false;\n  }\n\n  for (let i = 0; i < left.length; i++) {\n    if (!arrayEquals(left[i], right[i])) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\n/**\n * Unpack VECN values into {@link Cartesian2}, {@link Cartesian3}, or\n * {@link Cartesian4} and MATN values into {@link Matrix2}, {@link Matrix3}, or\n * {@link Matrix4} depending on N. All other values (including arrays of\n * other sizes) are passed through unaltered.\n *\n * @param {*} value the original, normalized values.\n * @param {boolean} [enableNestedArrays=false] If true, arrays of vectors are represented as nested arrays. This is used for JSON encoding but not binary encoding\n * @returns {*} The appropriate vector or matrix type if the value is a vector or matrix type, respectively. If the property is an array of vectors or matrices, an array of the appropriate vector or matrix type is returned. Otherwise, the value is returned unaltered.\n * @private\n */\nMetadataClassProperty.prototype.unpackVectorAndMatrixTypes = function (\n  value,\n  enableNestedArrays\n) {\n  enableNestedArrays = defaultValue(enableNestedArrays, false);\n  const MathType = MetadataType.getMathType(this._type);\n  const isArray = this._isArray;\n  const componentCount = MetadataType.getComponentCount(this._type);\n  const isNested = isArray && componentCount > 1;\n\n  if (!defined(MathType)) {\n    return value;\n  }\n\n  if (enableNestedArrays && isNested) {\n    return value.map(function (x) {\n      return MathType.unpack(x);\n    });\n  }\n\n  if (isArray) {\n    return MathType.unpackArray(value);\n  }\n\n  return MathType.unpack(value);\n};\n\n/**\n * Pack a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} into an\n * array if this property is an <code>VECN</code>.\n * Pack a {@link Matrix2}, {@link Matrix3}, or {@link Matrix4} into an\n * array if this property is an <code>MATN</code>.\n * All other values (including arrays of other sizes) are passed through unaltered.\n *\n * @param {*} value The value of this property\n * @param {boolean} [enableNestedArrays=false] If true, arrays of vectors are represented as nested arrays. This is used for JSON encoding but not binary encoding\n * @returns {*} An array of the appropriate length if the property is a vector or matrix type. Otherwise, the value is returned unaltered.\n * @private\n */\nMetadataClassProperty.prototype.packVectorAndMatrixTypes = function (\n  value,\n  enableNestedArrays\n) {\n  enableNestedArrays = defaultValue(enableNestedArrays, false);\n  const MathType = MetadataType.getMathType(this._type);\n  const isArray = this._isArray;\n  const componentCount = MetadataType.getComponentCount(this._type);\n  const isNested = isArray && componentCount > 1;\n\n  if (!defined(MathType)) {\n    return value;\n  }\n\n  if (enableNestedArrays && isNested) {\n    return value.map(function (x) {\n      return MathType.pack(x, []);\n    });\n  }\n\n  if (isArray) {\n    return MathType.packArray(value, []);\n  }\n\n  return MathType.pack(value, []);\n};\n\n/**\n * Validates whether the given value conforms to the property.\n *\n * @param {*} value The value.\n * @returns {string|undefined} An error message if the value does not conform to the property, otherwise undefined.\n * @private\n */\nMetadataClassProperty.prototype.validate = function (value) {\n  if (!defined(value) && defined(this._default)) {\n    // no value, but we have a default to use.\n    return undefined;\n  }\n\n  if (this._required && !defined(value)) {\n    return `required property must have a value`;\n  }\n\n  if (this._isArray) {\n    return validateArray(this, value);\n  }\n\n  return validateSingleValue(this, value);\n};\n\nfunction validateArray(classProperty, value) {\n  if (!Array.isArray(value)) {\n    return `value ${value} must be an array`;\n  }\n\n  const length = value.length;\n  if (\n    !classProperty._isVariableLengthArray &&\n    length !== classProperty._arrayLength\n  ) {\n    return \"Array length does not match property.arrayLength\";\n  }\n\n  for (let i = 0; i < length; i++) {\n    const message = validateSingleValue(classProperty, value[i]);\n    if (defined(message)) {\n      return message;\n    }\n  }\n}\n\nfunction validateSingleValue(classProperty, value) {\n  const type = classProperty._type;\n  const componentType = classProperty._componentType;\n  const enumType = classProperty._enumType;\n  const normalized = classProperty._normalized;\n\n  if (MetadataType.isVectorType(type)) {\n    return validateVector(value, type, componentType);\n  } else if (MetadataType.isMatrixType(type)) {\n    return validateMatrix(value, type, componentType);\n  } else if (type === MetadataType.STRING) {\n    return validateString(value);\n  } else if (type === MetadataType.BOOLEAN) {\n    return validateBoolean(value);\n  } else if (type === MetadataType.ENUM) {\n    return validateEnum(value, enumType);\n  }\n\n  return validateScalar(value, componentType, normalized);\n}\n\nfunction validateVector(value, type, componentType) {\n  if (!MetadataComponentType.isVectorCompatible(componentType)) {\n    return `componentType ${componentType} is incompatible with vector type ${type}`;\n  }\n\n  if (type === MetadataType.VEC2 && !(value instanceof Cartesian2)) {\n    return `vector value ${value} must be a Cartesian2`;\n  }\n\n  if (type === MetadataType.VEC3 && !(value instanceof Cartesian3)) {\n    return `vector value ${value} must be a Cartesian3`;\n  }\n\n  if (type === MetadataType.VEC4 && !(value instanceof Cartesian4)) {\n    return `vector value ${value} must be a Cartesian4`;\n  }\n}\n\nfunction validateMatrix(value, type, componentType) {\n  if (!MetadataComponentType.isVectorCompatible(componentType)) {\n    return `componentType ${componentType} is incompatible with matrix type ${type}`;\n  }\n\n  if (type === MetadataType.MAT2 && !(value instanceof Matrix2)) {\n    return `matrix value ${value} must be a Matrix2`;\n  }\n\n  if (type === MetadataType.MAT3 && !(value instanceof Matrix3)) {\n    return `matrix value ${value} must be a Matrix3`;\n  }\n\n  if (type === MetadataType.MAT4 && !(value instanceof Matrix4)) {\n    return `matrix value ${value} must be a Matrix4`;\n  }\n}\n\nfunction validateString(value) {\n  if (typeof value !== \"string\") {\n    return getTypeErrorMessage(value, MetadataType.STRING);\n  }\n}\n\nfunction validateBoolean(value) {\n  if (typeof value !== \"boolean\") {\n    return getTypeErrorMessage(value, MetadataType.BOOLEAN);\n  }\n}\n\nfunction validateEnum(value, enumType) {\n  const javascriptType = typeof value;\n  if (defined(enumType)) {\n    if (javascriptType !== \"string\" || !defined(enumType.valuesByName[value])) {\n      return `value ${value} is not a valid enum name for ${enumType.id}`;\n    }\n    return;\n  }\n}\n\nfunction validateScalar(value, componentType, normalized) {\n  const javascriptType = typeof value;\n\n  switch (componentType) {\n    case MetadataComponentType.INT8:\n    case MetadataComponentType.UINT8:\n    case MetadataComponentType.INT16:\n    case MetadataComponentType.UINT16:\n    case MetadataComponentType.INT32:\n    case MetadataComponentType.UINT32:\n    case MetadataComponentType.FLOAT32:\n    case MetadataComponentType.FLOAT64:\n      if (javascriptType !== \"number\") {\n        return getTypeErrorMessage(value, componentType);\n      }\n      if (!isFinite(value)) {\n        return getNonFiniteErrorMessage(value, componentType);\n      }\n      return checkInRange(value, componentType, normalized);\n    case MetadataComponentType.INT64:\n    case MetadataComponentType.UINT64:\n      if (javascriptType !== \"number\" && javascriptType !== \"bigint\") {\n        return getTypeErrorMessage(value, componentType);\n      }\n      if (javascriptType === \"number\" && !isFinite(value)) {\n        return getNonFiniteErrorMessage(value, componentType);\n      }\n      return checkInRange(value, componentType, normalized);\n  }\n}\n\nfunction getTypeErrorMessage(value, type) {\n  return `value ${value} does not match type ${type}`;\n}\n\nfunction getOutOfRangeErrorMessage(value, type, normalized) {\n  let errorMessage = `value ${value} is out of range for type ${type}`;\n  if (normalized) {\n    errorMessage += \" (normalized)\";\n  }\n  return errorMessage;\n}\n\nfunction checkInRange(value, componentType, normalized) {\n  if (normalized) {\n    const min = MetadataComponentType.isUnsignedIntegerType(componentType)\n      ? 0.0\n      : -1.0;\n    const max = 1.0;\n    if (value < min || value > max) {\n      return getOutOfRangeErrorMessage(value, componentType, normalized);\n    }\n    return;\n  }\n\n  if (\n    value < MetadataComponentType.getMinimum(componentType) ||\n    value > MetadataComponentType.getMaximum(componentType)\n  ) {\n    return getOutOfRangeErrorMessage(value, componentType, normalized);\n  }\n}\n\nfunction getNonFiniteErrorMessage(value, type) {\n  return `value ${value} of type ${type} must be finite`;\n}\n\nfunction normalizeInPlace(values, valueType, normalizeFunction) {\n  if (!Array.isArray(values)) {\n    return normalizeFunction(values, valueType);\n  }\n\n  for (let i = 0; i < values.length; i++) {\n    values[i] = normalizeInPlace(values[i], valueType, normalizeFunction);\n  }\n\n  return values;\n}\n\n/**\n * @private\n */\nMetadataClassProperty.valueTransformInPlace = function (\n  values,\n  offsets,\n  scales,\n  transformationFunction\n) {\n  if (!Array.isArray(values)) {\n    // transform a single value\n    return transformationFunction(values, offsets, scales);\n  }\n\n  for (let i = 0; i < values.length; i++) {\n    // offsets and scales must be the same array shape as values.\n    values[i] = MetadataClassProperty.valueTransformInPlace(\n      values[i],\n      offsets[i],\n      scales[i],\n      transformationFunction\n    );\n  }\n\n  return values;\n};\n\nexport default MetadataClassProperty;\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport getStringFromTypedArray from \"../Core/getStringFromTypedArray.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport MetadataComponentType from \"./MetadataComponentType.js\";\nimport MetadataClassProperty from \"./MetadataClassProperty.js\";\nimport MetadataType from \"./MetadataType.js\";\n\n/**\n * A binary property in a {@MetadataTable}\n * <p>\n * For 3D Tiles Next details, see the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension}\n * for 3D Tiles, as well as the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension}\n * for glTF. For the legacy glTF extension, see {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension}\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {number} options.count The number of elements in each property array.\n * @param {object} options.property The property JSON object.\n * @param {MetadataClassProperty} options.classProperty The class property.\n * @param {Object<string, Uint8Array>} options.bufferViews An object mapping bufferView IDs to Uint8Array objects.\n *\n * @alias MetadataTableProperty\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataTableProperty(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const count = options.count;\n  const property = options.property;\n  const classProperty = options.classProperty;\n  const bufferViews = options.bufferViews;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThan(\"options.count\", count, 0);\n  Check.typeOf.object(\"options.property\", property);\n  Check.typeOf.object(\"options.classProperty\", classProperty);\n  Check.typeOf.object(\"options.bufferViews\", bufferViews);\n  //>>includeEnd('debug');\n\n  const type = classProperty.type;\n  const isArray = classProperty.isArray;\n  const isVariableLengthArray = classProperty.isVariableLengthArray;\n\n  let valueType = classProperty.valueType;\n  const enumType = classProperty.enumType;\n\n  const hasStrings = type === MetadataType.STRING;\n  const hasBooleans = type === MetadataType.BOOLEAN;\n\n  let byteLength = 0;\n\n  let arrayOffsets;\n  if (isVariableLengthArray) {\n    // EXT_structural_metadata uses arrayOffsetType.\n    // EXT_feature_metadata uses offsetType for both arrays and strings\n    let arrayOffsetType = defaultValue(\n      property.arrayOffsetType,\n      property.offsetType\n    );\n    arrayOffsetType = defaultValue(\n      MetadataComponentType[arrayOffsetType],\n      MetadataComponentType.UINT32\n    );\n\n    // EXT_structural_metadata uses arrayOffsets.\n    // EXT_feature_metadata uses arrayOffsetBufferView\n    const arrayOffsetBufferView = defaultValue(\n      property.arrayOffsets,\n      property.arrayOffsetBufferView\n    );\n    arrayOffsets = new BufferView(\n      bufferViews[arrayOffsetBufferView],\n      arrayOffsetType,\n      count + 1\n    );\n\n    byteLength += arrayOffsets.typedArray.byteLength;\n  }\n\n  const vectorComponentCount = MetadataType.getComponentCount(type);\n\n  let arrayComponentCount;\n  if (isVariableLengthArray) {\n    arrayComponentCount = arrayOffsets.get(count) - arrayOffsets.get(0);\n  } else if (isArray) {\n    arrayComponentCount = count * classProperty.arrayLength;\n  } else {\n    arrayComponentCount = count;\n  }\n\n  const componentCount = vectorComponentCount * arrayComponentCount;\n\n  let stringOffsets;\n  if (hasStrings) {\n    // EXT_structural_metadata uses stringOffsetType, EXT_feature_metadata uses offsetType for both arrays and strings\n    let stringOffsetType = defaultValue(\n      property.stringOffsetType,\n      property.offsetType\n    );\n    stringOffsetType = defaultValue(\n      MetadataComponentType[stringOffsetType],\n      MetadataComponentType.UINT32\n    );\n\n    // EXT_structural_metadata uses stringOffsets.\n    // EXT_feature_metadata uses stringOffsetBufferView\n    const stringOffsetBufferView = defaultValue(\n      property.stringOffsets,\n      property.stringOffsetBufferView\n    );\n    stringOffsets = new BufferView(\n      bufferViews[stringOffsetBufferView],\n      stringOffsetType,\n      componentCount + 1\n    );\n\n    byteLength += stringOffsets.typedArray.byteLength;\n  }\n\n  if (hasStrings || hasBooleans) {\n    // STRING and BOOLEAN types need to be parsed differently than other types\n    valueType = MetadataComponentType.UINT8;\n  }\n\n  let valueCount;\n  if (hasStrings) {\n    valueCount = stringOffsets.get(componentCount) - stringOffsets.get(0);\n  } else if (hasBooleans) {\n    valueCount = Math.ceil(componentCount / 8);\n  } else {\n    valueCount = componentCount;\n  }\n\n  // EXT_structural_metadata uses values\n  // EXT_feature_metadata uses bufferView\n  const valuesBufferView = defaultValue(property.values, property.bufferView);\n  const values = new BufferView(\n    bufferViews[valuesBufferView],\n    valueType,\n    valueCount\n  );\n  byteLength += values.typedArray.byteLength;\n\n  let offset = property.offset;\n  let scale = property.scale;\n\n  // This needs to be set before handling default values\n  const hasValueTransform =\n    classProperty.hasValueTransform || defined(offset) || defined(scale);\n\n  // If the table does not define an offset/scale, it inherits from the\n  // class property. The class property handles setting the default of identity:\n  // (offset 0, scale 1) with the same array shape as the property's type\n  // information.\n  offset = defaultValue(offset, classProperty.offset);\n  scale = defaultValue(scale, classProperty.scale);\n\n  // Since metadata table properties are stored as packed typed\n  // arrays, flatten the offset/scale to make it easier to apply the\n  // transformation by iteration.\n  offset = flatten(offset);\n  scale = flatten(scale);\n\n  let getValueFunction;\n  let setValueFunction;\n  const that = this;\n  if (hasStrings) {\n    getValueFunction = function (index) {\n      return getString(index, that._values, that._stringOffsets);\n    };\n  } else if (hasBooleans) {\n    getValueFunction = function (index) {\n      return getBoolean(index, that._values);\n    };\n    setValueFunction = function (index, value) {\n      setBoolean(index, that._values, value);\n    };\n  } else if (defined(enumType)) {\n    getValueFunction = function (index) {\n      const integer = that._values.get(index);\n      return enumType.namesByValue[integer];\n    };\n    setValueFunction = function (index, value) {\n      const integer = enumType.valuesByName[value];\n      that._values.set(index, integer);\n    };\n  } else {\n    getValueFunction = function (index) {\n      return that._values.get(index);\n    };\n    setValueFunction = function (index, value) {\n      that._values.set(index, value);\n    };\n  }\n\n  this._arrayOffsets = arrayOffsets;\n  this._stringOffsets = stringOffsets;\n  this._values = values;\n  this._classProperty = classProperty;\n  this._count = count;\n  this._vectorComponentCount = vectorComponentCount;\n  this._min = property.min;\n  this._max = property.max;\n  this._offset = offset;\n  this._scale = scale;\n  this._hasValueTransform = hasValueTransform;\n  this._getValue = getValueFunction;\n  this._setValue = setValueFunction;\n  this._unpackedValues = undefined;\n  this._extras = property.extras;\n  this._extensions = property.extensions;\n  this._byteLength = byteLength;\n}\n\nObject.defineProperties(MetadataTableProperty.prototype, {\n  /**\n   * True if offset/scale should be applied. If both offset/scale were\n   * undefined, they default to identity so this property is set false\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  hasValueTransform: {\n    get: function () {\n      return this._hasValueTransform;\n    },\n  },\n\n  /**\n   * The offset to be added to property values as part of the value transform.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {number|number[]|number[][]}\n   * @readonly\n   * @private\n   */\n  offset: {\n    get: function () {\n      return this._offset;\n    },\n  },\n\n  /**\n   * The scale to be multiplied to property values as part of the value transform.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {number|number[]|number[][]}\n   * @readonly\n   * @private\n   */\n  scale: {\n    get: function () {\n      return this._scale;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof MetadataTableProperty.prototype\n   * @type {*}\n   * @readonly\n   * @private\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof MetadataTableProperty.prototype\n   * @type {*}\n   * @readonly\n   * @private\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n\n  /**\n   * Size of all typed arrays used by this table property\n   *\n   * @memberof MetadataTableProperty.prototype\n   * @type {Normal}\n   * @readonly\n   * @private\n   */\n  byteLength: {\n    get: function () {\n      return this._byteLength;\n    },\n  },\n});\n\n/**\n * Returns a copy of the value at the given index.\n *\n * @param {number} index The index.\n * @returns {*} The value of the property.\n *\n * @private\n */\nMetadataTableProperty.prototype.get = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  checkIndex(this, index);\n  //>>includeEnd('debug');\n\n  let value = get(this, index);\n\n  // handle noData and default\n  value = this._classProperty.handleNoData(value);\n  if (!defined(value)) {\n    value = this._classProperty.default;\n    return this._classProperty.unpackVectorAndMatrixTypes(value);\n  }\n\n  value = this._classProperty.normalize(value);\n  value = applyValueTransform(this, value);\n  return this._classProperty.unpackVectorAndMatrixTypes(value);\n};\n\n/**\n * Sets the value at the given index.\n *\n * @param {number} index The index.\n * @param {*} value The value of the property.\n *\n * @private\n */\nMetadataTableProperty.prototype.set = function (index, value) {\n  const classProperty = this._classProperty;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"value\", value);\n  checkIndex(this, index);\n  const errorMessage = classProperty.validate(value);\n  if (defined(errorMessage)) {\n    throw new DeveloperError(errorMessage);\n  }\n  //>>includeEnd('debug');\n\n  value = classProperty.packVectorAndMatrixTypes(value);\n  value = unapplyValueTransform(this, value);\n  value = classProperty.unnormalize(value);\n\n  set(this, index, value);\n};\n\n/**\n * Returns a typed array containing the property values.\n *\n * @returns {*} The typed array containing the property values or <code>undefined</code> if the property values are not stored in a typed array.\n *\n * @private\n */\nMetadataTableProperty.prototype.getTypedArray = function () {\n  // Note: depending on the class definition some properties are unpacked to\n  // JS arrays when first accessed and values will be undefined. Generally not\n  // a concern for fixed-length arrays of numbers.\n  if (defined(this._values)) {\n    return this._values.typedArray;\n  }\n\n  return undefined;\n};\n\nfunction flatten(values) {\n  if (!Array.isArray(values)) {\n    return values;\n  }\n\n  const result = [];\n  for (let i = 0; i < values.length; i++) {\n    const value = values[i];\n    if (Array.isArray(value)) {\n      result.push.apply(result, value);\n    } else {\n      result.push(value);\n    }\n  }\n\n  return result;\n}\n\nfunction checkIndex(table, index) {\n  const count = table._count;\n  if (!defined(index) || index < 0 || index >= count) {\n    const maximumIndex = count - 1;\n    throw new DeveloperError(\n      `index is required and between zero and count - 1. Actual value: ${maximumIndex}`\n    );\n  }\n}\n\nfunction get(property, index) {\n  if (requiresUnpackForGet(property)) {\n    unpackProperty(property);\n  }\n\n  const classProperty = property._classProperty;\n  const isArray = classProperty.isArray;\n  const type = classProperty.type;\n  const componentCount = MetadataType.getComponentCount(type);\n\n  if (defined(property._unpackedValues)) {\n    const value = property._unpackedValues[index];\n    if (isArray) {\n      return clone(value, true);\n    }\n    return value;\n  }\n\n  // handle single values\n  if (!isArray && componentCount === 1) {\n    return property._getValue(index);\n  }\n\n  return getArrayValues(property, classProperty, index);\n}\n\nfunction getArrayValues(property, classProperty, index) {\n  let offset;\n  let length;\n  if (classProperty.isVariableLengthArray) {\n    offset = property._arrayOffsets.get(index);\n    length = property._arrayOffsets.get(index + 1) - offset;\n\n    // for vectors and matrices, the offset and length need to be multiplied\n    // by the component count\n    const componentCount = MetadataType.getComponentCount(classProperty.type);\n    offset *= componentCount;\n    length *= componentCount;\n  } else {\n    const arrayLength = defaultValue(classProperty.arrayLength, 1);\n    const componentCount = arrayLength * property._vectorComponentCount;\n    offset = index * componentCount;\n    length = componentCount;\n  }\n\n  const values = new Array(length);\n  for (let i = 0; i < length; i++) {\n    values[i] = property._getValue(offset + i);\n  }\n\n  return values;\n}\n\nfunction set(property, index, value) {\n  if (requiresUnpackForSet(property, index, value)) {\n    unpackProperty(property);\n  }\n\n  const classProperty = property._classProperty;\n  const isArray = classProperty.isArray;\n  const type = classProperty.type;\n  const componentCount = MetadataType.getComponentCount(type);\n\n  if (defined(property._unpackedValues)) {\n    if (classProperty.isArray) {\n      value = clone(value, true);\n    }\n    property._unpackedValues[index] = value;\n    return;\n  }\n\n  // Values are unpacked if the length of a variable-size array changes or the\n  // property has strings. No need to handle these cases below.\n\n  // Handle single values\n  if (!isArray && componentCount === 1) {\n    property._setValue(index, value);\n    return;\n  }\n\n  let offset;\n  let length;\n  if (classProperty.isVariableLengthArray) {\n    offset = property._arrayOffsets.get(index);\n    length = property._arrayOffsets.get(index + 1) - offset;\n  } else {\n    const arrayLength = defaultValue(classProperty.arrayLength, 1);\n    const componentCount = arrayLength * property._vectorComponentCount;\n    offset = index * componentCount;\n    length = componentCount;\n  }\n\n  for (let i = 0; i < length; ++i) {\n    property._setValue(offset + i, value[i]);\n  }\n}\n\nfunction getString(index, values, stringOffsets) {\n  const stringByteOffset = stringOffsets.get(index);\n  const stringByteLength = stringOffsets.get(index + 1) - stringByteOffset;\n  return getStringFromTypedArray(\n    values.typedArray,\n    stringByteOffset,\n    stringByteLength\n  );\n}\n\nfunction getBoolean(index, values) {\n  // byteIndex is floor(index / 8)\n  const byteIndex = index >> 3;\n  const bitIndex = index % 8;\n  return ((values.typedArray[byteIndex] >> bitIndex) & 1) === 1;\n}\n\nfunction setBoolean(index, values, value) {\n  // byteIndex is floor(index / 8)\n  const byteIndex = index >> 3;\n  const bitIndex = index % 8;\n\n  if (value) {\n    values.typedArray[byteIndex] |= 1 << bitIndex;\n  } else {\n    values.typedArray[byteIndex] &= ~(1 << bitIndex);\n  }\n}\n\nfunction getInt64NumberFallback(index, values) {\n  const dataView = values.dataView;\n  const byteOffset = index * 8;\n  let value = 0;\n  const isNegative = (dataView.getUint8(byteOffset + 7) & 0x80) > 0;\n  let carrying = true;\n  for (let i = 0; i < 8; ++i) {\n    let byte = dataView.getUint8(byteOffset + i);\n    if (isNegative) {\n      if (carrying) {\n        if (byte !== 0x00) {\n          byte = ~(byte - 1) & 0xff;\n          carrying = false;\n        }\n      } else {\n        byte = ~byte & 0xff;\n      }\n    }\n    value += byte * Math.pow(256, i);\n  }\n  if (isNegative) {\n    value = -value;\n  }\n  return value;\n}\n\nfunction getInt64BigIntFallback(index, values) {\n  const dataView = values.dataView;\n  const byteOffset = index * 8;\n  // eslint-disable-next-line no-undef\n  let value = BigInt(0);\n  const isNegative = (dataView.getUint8(byteOffset + 7) & 0x80) > 0;\n  let carrying = true;\n  for (let i = 0; i < 8; ++i) {\n    let byte = dataView.getUint8(byteOffset + i);\n    if (isNegative) {\n      if (carrying) {\n        if (byte !== 0x00) {\n          byte = ~(byte - 1) & 0xff;\n          carrying = false;\n        }\n      } else {\n        byte = ~byte & 0xff;\n      }\n    }\n    value += BigInt(byte) * (BigInt(1) << BigInt(i * 8)); // eslint-disable-line\n  }\n  if (isNegative) {\n    value = -value;\n  }\n  return value;\n}\n\nfunction getUint64NumberFallback(index, values) {\n  const dataView = values.dataView;\n  const byteOffset = index * 8;\n\n  // Split 64-bit number into two 32-bit (4-byte) parts\n  const left = dataView.getUint32(byteOffset, true);\n  const right = dataView.getUint32(byteOffset + 4, true);\n\n  // Combine the two 32-bit values\n  const value = left + 4294967296 * right;\n\n  return value;\n}\n\nfunction getUint64BigIntFallback(index, values) {\n  const dataView = values.dataView;\n  const byteOffset = index * 8;\n\n  // Split 64-bit number into two 32-bit (4-byte) parts\n  // eslint-disable-next-line no-undef\n  const left = BigInt(dataView.getUint32(byteOffset, true));\n\n  // eslint-disable-next-line no-undef\n  const right = BigInt(dataView.getUint32(byteOffset + 4, true));\n\n  // Combine the two 32-bit values\n  // eslint-disable-next-line no-undef\n  const value = left + BigInt(4294967296) * right;\n\n  return value;\n}\n\nfunction getComponentDatatype(componentType) {\n  switch (componentType) {\n    case MetadataComponentType.INT8:\n      return ComponentDatatype.BYTE;\n    case MetadataComponentType.UINT8:\n      return ComponentDatatype.UNSIGNED_BYTE;\n    case MetadataComponentType.INT16:\n      return ComponentDatatype.SHORT;\n    case MetadataComponentType.UINT16:\n      return ComponentDatatype.UNSIGNED_SHORT;\n    case MetadataComponentType.INT32:\n      return ComponentDatatype.INT;\n    case MetadataComponentType.UINT32:\n      return ComponentDatatype.UNSIGNED_INT;\n    case MetadataComponentType.FLOAT32:\n      return ComponentDatatype.FLOAT;\n    case MetadataComponentType.FLOAT64:\n      return ComponentDatatype.DOUBLE;\n  }\n}\n\nfunction requiresUnpackForGet(property) {\n  if (defined(property._unpackedValues)) {\n    return false;\n  }\n\n  const classProperty = property._classProperty;\n  const type = classProperty.type;\n  const valueType = classProperty.valueType;\n\n  if (type === MetadataType.STRING) {\n    // Unpack since UTF-8 decoding is expensive\n    return true;\n  }\n\n  if (\n    valueType === MetadataComponentType.INT64 &&\n    !FeatureDetection.supportsBigInt64Array()\n  ) {\n    // Unpack since the fallback INT64 getters are expensive\n    return true;\n  }\n\n  if (\n    valueType === MetadataComponentType.UINT64 &&\n    !FeatureDetection.supportsBigUint64Array()\n  ) {\n    // Unpack since the fallback UINT64 getters are expensive\n    return true;\n  }\n\n  return false;\n}\n\nfunction requiresUnpackForSet(property, index, value) {\n  if (requiresUnpackForGet(property)) {\n    return true;\n  }\n\n  const arrayOffsets = property._arrayOffsets;\n  if (defined(arrayOffsets)) {\n    // Unpacking is required if a variable-size array changes length since it\n    // would be expensive to repack the binary data\n    const oldLength = arrayOffsets.get(index + 1) - arrayOffsets.get(index);\n    const newLength = value.length;\n    if (oldLength !== newLength) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\nfunction unpackProperty(property) {\n  property._unpackedValues = unpackValues(property);\n\n  // Free memory\n  property._arrayOffsets = undefined;\n  property._stringOffsets = undefined;\n  property._values = undefined;\n}\n\nfunction unpackValues(property) {\n  const count = property._count;\n  const unpackedValues = new Array(count);\n\n  const classProperty = property._classProperty;\n  const isArray = classProperty.isArray;\n  const type = classProperty.type;\n  const componentCount = MetadataType.getComponentCount(type);\n\n  // Handle single values\n  if (!isArray && componentCount === 1) {\n    for (let i = 0; i < count; ++i) {\n      unpackedValues[i] = property._getValue(i);\n    }\n    return unpackedValues;\n  }\n\n  for (let i = 0; i < count; i++) {\n    unpackedValues[i] = getArrayValues(property, classProperty, i);\n  }\n  return unpackedValues;\n}\n\nfunction applyValueTransform(property, value) {\n  const classProperty = property._classProperty;\n  const isVariableLengthArray = classProperty.isVariableLengthArray;\n  if (!property._hasValueTransform || isVariableLengthArray) {\n    return value;\n  }\n\n  return MetadataClassProperty.valueTransformInPlace(\n    value,\n    property._offset,\n    property._scale,\n    MetadataComponentType.applyValueTransform\n  );\n}\n\nfunction unapplyValueTransform(property, value) {\n  const classProperty = property._classProperty;\n  const isVariableLengthArray = classProperty.isVariableLengthArray;\n  if (!property._hasValueTransform || isVariableLengthArray) {\n    return value;\n  }\n\n  return MetadataClassProperty.valueTransformInPlace(\n    value,\n    property._offset,\n    property._scale,\n    MetadataComponentType.unapplyValueTransform\n  );\n}\n\nfunction BufferView(bufferView, componentType, length) {\n  const that = this;\n\n  let typedArray;\n  let getFunction;\n  let setFunction;\n\n  if (componentType === MetadataComponentType.INT64) {\n    if (!FeatureDetection.supportsBigInt()) {\n      oneTimeWarning(\n        \"INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read.\"\n      );\n      typedArray = new Uint8Array(\n        bufferView.buffer,\n        bufferView.byteOffset,\n        length * 8\n      );\n      getFunction = function (index) {\n        return getInt64NumberFallback(index, that);\n      };\n    } else if (!FeatureDetection.supportsBigInt64Array()) {\n      typedArray = new Uint8Array(\n        bufferView.buffer,\n        bufferView.byteOffset,\n        length * 8\n      );\n      getFunction = function (index) {\n        return getInt64BigIntFallback(index, that);\n      };\n    } else {\n      // eslint-disable-next-line\n      typedArray = new BigInt64Array(\n        bufferView.buffer,\n        bufferView.byteOffset,\n        length\n      );\n      setFunction = function (index, value) {\n        // Convert the number to a BigInt before setting the value in the typed array\n        that.typedArray[index] = BigInt(value); // eslint-disable-line\n      };\n    }\n  } else if (componentType === MetadataComponentType.UINT64) {\n    if (!FeatureDetection.supportsBigInt()) {\n      oneTimeWarning(\n        \"UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read.\"\n      );\n      typedArray = new Uint8Array(\n        bufferView.buffer,\n        bufferView.byteOffset,\n        length * 8\n      );\n      getFunction = function (index) {\n        return getUint64NumberFallback(index, that);\n      };\n    } else if (!FeatureDetection.supportsBigUint64Array()) {\n      typedArray = new Uint8Array(\n        bufferView.buffer,\n        bufferView.byteOffset,\n        length * 8\n      );\n      getFunction = function (index) {\n        return getUint64BigIntFallback(index, that);\n      };\n    } else {\n      // eslint-disable-next-line\n      typedArray = new BigUint64Array(\n        bufferView.buffer,\n        bufferView.byteOffset,\n        length\n      );\n      setFunction = function (index, value) {\n        // Convert the number to a BigInt before setting the value in the typed array\n        that.typedArray[index] = BigInt(value); // eslint-disable-line\n      };\n    }\n  } else {\n    const componentDatatype = getComponentDatatype(componentType);\n    typedArray = ComponentDatatype.createArrayBufferView(\n      componentDatatype,\n      bufferView.buffer,\n      bufferView.byteOffset,\n      length\n    );\n    setFunction = function (index, value) {\n      that.typedArray[index] = value;\n    };\n  }\n\n  if (!defined(getFunction)) {\n    getFunction = function (index) {\n      return that.typedArray[index];\n    };\n  }\n\n  this.typedArray = typedArray;\n  this.dataView = new DataView(typedArray.buffer, typedArray.byteOffset);\n  this.get = getFunction;\n  this.set = setFunction;\n\n  // for unit testing\n  this._componentType = componentType;\n}\n\nexport default MetadataTableProperty;\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport MetadataEntity from \"./MetadataEntity.js\";\nimport MetadataTableProperty from \"./MetadataTableProperty.js\";\n\n/**\n * A table containing binary metadata for a collection of entities. This is\n * used for representing binary properties of a batch table, as well as binary\n * metadata in 3D Tiles next extensions.\n * <p>\n * For 3D Tiles Next details, see the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles, as well as the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} for glTF.\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {number} options.count The number of entities in the table.\n * @param {object} [options.properties] A dictionary containing properties.\n * @param {MetadataClass} options.class The class that properties conform to.\n * @param {Object<string, Uint8Array>} [options.bufferViews] An object mapping bufferView IDs to Uint8Array objects.\n *\n * @alias MetadataTable\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataTable(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const count = options.count;\n  const metadataClass = options.class;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThan(\"options.count\", count, 0);\n  Check.typeOf.object(\"options.class\", metadataClass);\n  //>>includeEnd('debug');\n\n  let byteLength = 0;\n  const properties = {};\n  if (defined(options.properties)) {\n    for (const propertyId in options.properties) {\n      if (options.properties.hasOwnProperty(propertyId)) {\n        const property = new MetadataTableProperty({\n          count: count,\n          property: options.properties[propertyId],\n          classProperty: metadataClass.properties[propertyId],\n          bufferViews: options.bufferViews,\n        });\n        properties[propertyId] = property;\n        byteLength += property.byteLength;\n      }\n    }\n  }\n\n  this._count = count;\n  this._class = metadataClass;\n  this._properties = properties;\n  this._byteLength = byteLength;\n}\n\nObject.defineProperties(MetadataTable.prototype, {\n  /**\n   * The number of entities in the table.\n   *\n   * @memberof MetadataTable.prototype\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  count: {\n    get: function () {\n      return this._count;\n    },\n  },\n\n  /**\n   * The class that properties conform to.\n   *\n   * @memberof MetadataTable.prototype\n   * @type {MetadataClass}\n   * @readonly\n   * @private\n   */\n  class: {\n    get: function () {\n      return this._class;\n    },\n  },\n\n  /**\n   * The size of all typed arrays used in this table.\n   *\n   * @memberof MetadataTable.prototype\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  byteLength: {\n    get: function () {\n      return this._byteLength;\n    },\n  },\n});\n\n/**\n * Returns whether the table has this property.\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {boolean} Whether the table has this property.\n * @private\n */\nMetadataTable.prototype.hasProperty = function (propertyId) {\n  return MetadataEntity.hasProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Returns whether the table has a property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {boolean} Whether the table has a property with the given semantic.\n * @private\n */\nMetadataTable.prototype.hasPropertyBySemantic = function (semantic) {\n  return MetadataEntity.hasPropertyBySemantic(\n    semantic,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {string[]} [results] An array into which to store the results.\n * @returns {string[]} The property IDs.\n * @private\n */\nMetadataTable.prototype.getPropertyIds = function (results) {\n  return MetadataEntity.getPropertyIds(this._properties, this._class, results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is an enum the name of the enum is returned.\n * </p>\n * <p>\n * If the property is normalized the normalized value is returned. The value is\n * in the range [-1.0, 1.0] for signed integer types and [0.0, 1.0] for unsigned\n * integer types.\n * </p>\n * <p>\n * If the property is not normalized and type or componentType is INT64 or\n * UINT64 a BigInt will be returned. On platforms that don't support BigInt a\n * number will be returned instead. Note that numbers only support up to 52 bits\n * of integer precision. Values greater than 2^53 - 1 or less than -(2^53 - 1)\n * may lose precision when read.\n * </p>\n *\n * @param {number} index The index of the entity.\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the entity does not have this property.\n *\n * @exception {DeveloperError} index is required and between zero and count - 1\n * @private\n */\nMetadataTable.prototype.getProperty = function (index, propertyId) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"propertyId\", propertyId);\n  //>>includeEnd('debug');\n\n  const property = this._properties[propertyId];\n\n  let value;\n  if (defined(property)) {\n    value = property.get(index);\n  } else {\n    value = getDefault(this._class, propertyId);\n  }\n\n  return value;\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is an enum the name of the enum must be provided, not the\n * integer value.\n * </p>\n * <p>\n * If the property is normalized a normalized value must be provided to this\n * function. The value must be in the range [-1.0, 1.0] for signed integer\n * types and [0.0, 1.0] for unsigned integer types.\n * </p>\n * <p>\n * If the property is not normalized and type or componentType is INT64 or\n * UINT64 a BigInt may be provided. On platforms that don't support BigInt a\n * number may be provided instead. Note that numbers only support up to 52 bits\n * of integer precision. Values greater than 2^53 - 1 or less than -(2^53 - 1)\n * may lose precision when set.\"\n * </p>\n *\n * @param {number} index The index of the entity.\n * @param {string} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n *\n * @exception {DeveloperError} index is required and between zero and count - 1\n * @exception {DeveloperError} value does not match type\n * @exception {DeveloperError} value is out of range for type\n * @exception {DeveloperError} Array length does not match componentCount\n * @private\n */\nMetadataTable.prototype.setProperty = function (index, propertyId, value) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"propertyId\", propertyId);\n  //>>includeEnd('debug');\n\n  const property = this._properties[propertyId];\n  if (defined(property)) {\n    property.set(index, value);\n    return true;\n  }\n\n  return false;\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {number} index The index of the entity.\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the entity does not have this semantic.\n *\n * @exception {DeveloperError} index is required and between zero and count - 1\n * @private\n */\nMetadataTable.prototype.getPropertyBySemantic = function (index, semantic) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"semantic\", semantic);\n  //>>includeEnd('debug');\n\n  let property;\n  const propertiesBySemantic = this._class.propertiesBySemantic;\n  if (defined(propertiesBySemantic)) {\n    property = propertiesBySemantic[semantic];\n  }\n\n  if (defined(property)) {\n    return this.getProperty(index, property.id);\n  }\n\n  return undefined;\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {number} index The index of the entity.\n * @param {string} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n *\n * @exception {DeveloperError} index is required and between zero and count - 1\n * @exception {DeveloperError} value does not match type\n * @exception {DeveloperError} value is out of range for type\n * @exception {DeveloperError} Array length does not match componentCount\n * @private\n */\nMetadataTable.prototype.setPropertyBySemantic = function (\n  index,\n  semantic,\n  value\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"semantic\", semantic);\n  //>>includeEnd('debug');\n\n  let property;\n  const propertiesBySemantic = this._class.propertiesBySemantic;\n  if (defined(propertiesBySemantic)) {\n    property = propertiesBySemantic[semantic];\n  }\n\n  if (defined(property)) {\n    return this.setProperty(index, property.id, value);\n  }\n\n  return false;\n};\n\n/**\n * Returns a typed array containing the property values for a given propertyId.\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {*} The typed array containing the property values or <code>undefined</code> if the property values are not stored in a typed array.\n *\n * @private\n */\nMetadataTable.prototype.getPropertyTypedArray = function (propertyId) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"propertyId\", propertyId);\n  //>>includeEnd('debug');\n\n  const property = this._properties[propertyId];\n\n  if (defined(property)) {\n    return property.getTypedArray();\n  }\n\n  return undefined;\n};\n\n/**\n * Returns a typed array containing the property values for the property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {*} The typed array containing the property values or <code>undefined</code> if the property values are not stored in a typed array.\n *\n * @private\n */\nMetadataTable.prototype.getPropertyTypedArrayBySemantic = function (semantic) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"semantic\", semantic);\n  //>>includeEnd('debug');\n\n  let property;\n  const propertiesBySemantic = this._class.propertiesBySemantic;\n  if (defined(propertiesBySemantic)) {\n    property = propertiesBySemantic[semantic];\n  }\n\n  if (defined(property)) {\n    return this.getPropertyTypedArray(property.id);\n  }\n\n  return undefined;\n};\n\nfunction getDefault(classDefinition, propertyId) {\n  const classProperties = classDefinition.properties;\n  if (!defined(classProperties)) {\n    return undefined;\n  }\n\n  const classProperty = classProperties[propertyId];\n  if (defined(classProperty) && defined(classProperty.default)) {\n    let value = classProperty.default;\n    if (classProperty.isArray) {\n      value = clone(value, true);\n    }\n    value = classProperty.normalize(value);\n    return classProperty.unpackVectorAndMatrixTypes(value);\n  }\n}\n\nexport default MetadataTable;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * A cache resource.\n * <p>\n * This type describes an interface and is not intended to be instantiated directly.\n * </p>\n *\n * @alias ResourceLoader\n * @constructor\n *\n * @see ResourceCache\n *\n * @private\n */\nfunction ResourceLoader() {}\n\nObject.defineProperties(ResourceLoader.prototype, {\n  /**\n   * The cache key of the resource.\n   *\n   * @memberof ResourceLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise<ResourceLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nResourceLoader.prototype.load = function () {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Unloads the resource.\n * @private\n */\nResourceLoader.prototype.unload = function () {};\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @returns {boolean} true once all resourced are ready.\n * @private\n */\nResourceLoader.prototype.process = function (frameState) {\n  return false;\n};\n\n/**\n * Constructs a {@link RuntimeError} from an errorMessage and an error.\n *\n * @param {string} errorMessage The error message.\n * @param {Error} [error] The error.\n *\n * @returns {RuntimeError} The runtime error.\n * @private\n */\nResourceLoader.prototype.getError = function (errorMessage, error) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"errorMessage\", errorMessage);\n  //>>includeEnd('debug');\n\n  if (defined(error) && defined(error.message)) {\n    errorMessage += `\\n${error.message}`;\n  }\n\n  const runtimeError = new RuntimeError(errorMessage);\n  if (defined(error)) {\n    runtimeError.stack = `Original stack:\\n${error.stack}\\nHandler stack:\\n${runtimeError.stack}`;\n  }\n\n  return runtimeError;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see ResourceLoader#destroy\n * @private\n */\nResourceLoader.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the loaded resource.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * resourceLoader = resourceLoader && resourceLoader.destroy();\n *\n * @see ResourceLoader#isDestroyed\n * @private\n */\nResourceLoader.prototype.destroy = function () {\n  this.unload();\n  return destroyObject(this);\n};\n\nexport default ResourceLoader;\n", "/**\n * The {@link ResourceLoader} state.\n *\n * @private\n */\nconst ResourceLoaderState = {\n  /**\n   * The resource has not yet been loaded.\n   *\n   * @type {number}\n   * @constant\n   * @private\n   */\n  UNLOADED: 0,\n  /**\n   * The resource is loading. In this state, external resources are fetched as needed.\n   *\n   * @type {number}\n   * @constant\n   * @private\n   */\n  LOADING: 1,\n  /**\n   * The resource has finished loading, but requires further processing.\n   *\n   * @type {number}\n   * @constant\n   * @private\n   */\n  LOADED: 2,\n  /**\n   * The resource is processing. GPU resources are allocated in this state as needed.\n   *\n   * @type {Number}\n   * @constant\n   * @private\n   */\n  PROCESSING: 3,\n  /**\n   * The resource has finished loading and processing; the results are ready to be used.\n   *\n   * @type {number}\n   * @constant\n   * @private\n   */\n  READY: 4,\n  /**\n   * The resource loading or processing has failed due to an error.\n   *\n   * @type {number}\n   * @constant\n   * @private\n   */\n  FAILED: 5,\n};\nexport default Object.freeze(ResourceLoaderState);\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * Loads an embedded or external buffer.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias BufferLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {object} options Object with the following properties:\n * @param {Uint8Array} [options.typedArray] The typed array containing the embedded buffer contents. Mutually exclusive with options.resource.\n * @param {Resource} [options.resource] The {@link Resource} pointing to the external buffer. Mutually exclusive with options.typedArray.\n * @param {string} [options.cacheKey] The cache key of the resource.\n *\n * @exception {DeveloperError} One of options.typedArray and options.resource must be defined.\n *\n * @private\n */\nfunction BufferLoader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const typedArray = options.typedArray;\n  const resource = options.resource;\n  const cacheKey = options.cacheKey;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (defined(typedArray) === defined(resource)) {\n    throw new DeveloperError(\n      \"One of options.typedArray and options.resource must be defined.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._typedArray = typedArray;\n  this._resource = resource;\n  this._cacheKey = cacheKey;\n  this._state = ResourceLoaderState.UNLOADED;\n  this._promise = undefined;\n}\n\nif (defined(Object.create)) {\n  BufferLoader.prototype = Object.create(ResourceLoader.prototype);\n  BufferLoader.prototype.constructor = BufferLoader;\n}\n\nObject.defineProperties(BufferLoader.prototype, {\n  /**\n   * The cache key of the resource.\n   *\n   * @memberof BufferLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    get: function () {\n      return this._cacheKey;\n    },\n  },\n  /**\n   * The typed array containing the embedded buffer contents.\n   *\n   * @memberof BufferLoader.prototype\n   *\n   * @type {Uint8Array}\n   * @readonly\n   * @private\n   */\n  typedArray: {\n    get: function () {\n      return this._typedArray;\n    },\n  },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise<BufferLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nBufferLoader.prototype.load = async function () {\n  if (defined(this._promise)) {\n    return this._promise;\n  }\n\n  if (defined(this._typedArray)) {\n    this._promise = Promise.resolve(this);\n    return this._promise;\n  }\n\n  this._promise = loadExternalBuffer(this);\n  return this._promise;\n};\n\nasync function loadExternalBuffer(bufferLoader) {\n  const resource = bufferLoader._resource;\n  bufferLoader._state = ResourceLoaderState.LOADING;\n  try {\n    const arrayBuffer = await BufferLoader._fetchArrayBuffer(resource);\n    if (bufferLoader.isDestroyed()) {\n      return;\n    }\n\n    bufferLoader._typedArray = new Uint8Array(arrayBuffer);\n    bufferLoader._state = ResourceLoaderState.READY;\n    return bufferLoader;\n  } catch (error) {\n    if (bufferLoader.isDestroyed()) {\n      return;\n    }\n\n    bufferLoader._state = ResourceLoaderState.FAILED;\n    const errorMessage = `Failed to load external buffer: ${resource.url}`;\n    throw bufferLoader.getError(errorMessage, error);\n  }\n}\n\n/**\n * Exposed for testing\n * @private\n */\nBufferLoader._fetchArrayBuffer = function (resource) {\n  return resource.fetchArrayBuffer();\n};\n\n/**\n * Unloads the resource.\n * @private\n */\nBufferLoader.prototype.unload = function () {\n  this._typedArray = undefined;\n};\n\nexport default BufferLoader;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport { MeshoptDecoder } from \"meshoptimizer\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * Loads a glTF buffer view.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfBufferViewLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {object} options Object with the following properties:\n * @param {ResourceCache} options.resourceCache The {@link ResourceCache} (to avoid circular dependencies).\n * @param {object} options.gltf The glTF JSON.\n * @param {number} options.bufferViewId The buffer view ID.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {string} [options.cacheKey] The cache key of the resource.\n *\n * @private\n */\nfunction GltfBufferViewLoader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const resourceCache = options.resourceCache;\n  const gltf = options.gltf;\n  const bufferViewId = options.bufferViewId;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n  const cacheKey = options.cacheKey;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.func(\"options.resourceCache\", resourceCache);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.number(\"options.bufferViewId\", bufferViewId);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  //>>includeEnd('debug');\n\n  const bufferView = gltf.bufferViews[bufferViewId];\n  let bufferId = bufferView.buffer;\n  let byteOffset = bufferView.byteOffset;\n  let byteLength = bufferView.byteLength;\n\n  let hasMeshopt = false;\n  let meshoptByteStride;\n  let meshoptCount;\n  let meshoptMode;\n  let meshoptFilter;\n\n  if (hasExtension(bufferView, \"EXT_meshopt_compression\")) {\n    const meshopt = bufferView.extensions.EXT_meshopt_compression;\n    bufferId = meshopt.buffer;\n    byteOffset = defaultValue(meshopt.byteOffset, 0);\n    byteLength = meshopt.byteLength;\n\n    hasMeshopt = true;\n    meshoptByteStride = meshopt.byteStride;\n    meshoptCount = meshopt.count;\n    meshoptMode = meshopt.mode;\n    meshoptFilter = defaultValue(meshopt.filter, \"NONE\");\n  }\n\n  const buffer = gltf.buffers[bufferId];\n\n  this._hasMeshopt = hasMeshopt;\n  this._meshoptByteStride = meshoptByteStride;\n  this._meshoptCount = meshoptCount;\n  this._meshoptMode = meshoptMode;\n  this._meshoptFilter = meshoptFilter;\n\n  this._resourceCache = resourceCache;\n  this._gltfResource = gltfResource;\n  this._baseResource = baseResource;\n  this._buffer = buffer;\n  this._bufferId = bufferId;\n  this._byteOffset = byteOffset;\n  this._byteLength = byteLength;\n  this._cacheKey = cacheKey;\n  this._bufferLoader = undefined;\n  this._typedArray = undefined;\n  this._state = ResourceLoaderState.UNLOADED;\n  this._promise = undefined;\n}\n\nif (defined(Object.create)) {\n  GltfBufferViewLoader.prototype = Object.create(ResourceLoader.prototype);\n  GltfBufferViewLoader.prototype.constructor = GltfBufferViewLoader;\n}\n\nObject.defineProperties(GltfBufferViewLoader.prototype, {\n  /**\n   * The cache key of the resource.\n   *\n   * @memberof GltfBufferViewLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    get: function () {\n      return this._cacheKey;\n    },\n  },\n  /**\n   * The typed array containing buffer view data.\n   *\n   * @memberof GltfBufferViewLoader.prototype\n   *\n   * @type {Uint8Array}\n   * @readonly\n   * @private\n   */\n  typedArray: {\n    get: function () {\n      return this._typedArray;\n    },\n  },\n});\n\nasync function loadResources(loader) {\n  try {\n    const bufferLoader = getBufferLoader(loader);\n    loader._bufferLoader = bufferLoader;\n    await bufferLoader.load();\n\n    if (loader.isDestroyed()) {\n      return;\n    }\n\n    const bufferTypedArray = bufferLoader.typedArray;\n    const bufferViewTypedArray = new Uint8Array(\n      bufferTypedArray.buffer,\n      bufferTypedArray.byteOffset + loader._byteOffset,\n      loader._byteLength\n    );\n\n    // Unload the buffer\n    loader.unload();\n\n    loader._typedArray = bufferViewTypedArray;\n    if (loader._hasMeshopt) {\n      const count = loader._meshoptCount;\n      const byteStride = loader._meshoptByteStride;\n      const result = new Uint8Array(count * byteStride);\n      MeshoptDecoder.decodeGltfBuffer(\n        result,\n        count,\n        byteStride,\n        loader._typedArray,\n        loader._meshoptMode,\n        loader._meshoptFilter\n      );\n      loader._typedArray = result;\n    }\n\n    loader._state = ResourceLoaderState.READY;\n    return loader;\n  } catch (error) {\n    if (loader.isDestroyed()) {\n      return;\n    }\n\n    loader.unload();\n    loader._state = ResourceLoaderState.FAILED;\n    const errorMessage = \"Failed to load buffer view\";\n    throw loader.getError(errorMessage, error);\n  }\n}\n\n/**\n * Loads the resource.\n * @returns {Promise<GltfBufferViewLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfBufferViewLoader.prototype.load = async function () {\n  if (defined(this._promise)) {\n    return this._promise;\n  }\n\n  this._state = ResourceLoaderState.LOADING;\n  this._promise = loadResources(this);\n  return this._promise;\n};\n\nfunction getBufferLoader(bufferViewLoader) {\n  const resourceCache = bufferViewLoader._resourceCache;\n  const buffer = bufferViewLoader._buffer;\n  if (defined(buffer.uri)) {\n    const baseResource = bufferViewLoader._baseResource;\n    const resource = baseResource.getDerivedResource({\n      url: buffer.uri,\n    });\n    return resourceCache.getExternalBufferLoader({\n      resource: resource,\n    });\n  }\n  return resourceCache.getEmbeddedBufferLoader({\n    parentResource: bufferViewLoader._gltfResource,\n    bufferId: bufferViewLoader._bufferId,\n  });\n}\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfBufferViewLoader.prototype.unload = function () {\n  if (defined(this._bufferLoader) && !this._bufferLoader.isDestroyed()) {\n    this._resourceCache.unload(this._bufferLoader);\n  }\n\n  this._bufferLoader = undefined;\n  this._typedArray = undefined;\n};\n\nexport default GltfBufferViewLoader;\n", "import defined from \"../Core/defined.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\n\n/**\n * @private\n */\nfunction DracoLoader() {}\n\n// Maximum concurrency to use when decoding draco models\nDracoLoader._maxDecodingConcurrency = Math.max(\n  FeatureDetection.hardwareConcurrency - 1,\n  1\n);\n\n// Exposed for testing purposes\nDracoLoader._decoderTaskProcessor = undefined;\nDracoLoader._taskProcessorReady = false;\nDracoLoader._error = undefined;\nDracoLoader._getDecoderTaskProcessor = function () {\n  if (!defined(DracoLoader._decoderTaskProcessor)) {\n    const processor = new TaskProcessor(\n      \"decodeDraco\",\n      DracoLoader._maxDecodingConcurrency\n    );\n    processor\n      .initWebAssemblyModule({\n        wasmBinaryFile: \"ThirdParty/draco_decoder.wasm\",\n      })\n      .then(function (result) {\n        if (result) {\n          DracoLoader._taskProcessorReady = true;\n        } else {\n          DracoLoader._error = new RuntimeError(\n            \"Draco decoder could not be initialized.\"\n          );\n        }\n      })\n      .catch((error) => {\n        DracoLoader._error = error;\n      });\n    DracoLoader._decoderTaskProcessor = processor;\n  }\n\n  return DracoLoader._decoderTaskProcessor;\n};\n\n/**\n * Decodes a compressed point cloud. Returns undefined if the task cannot be scheduled.\n * @private\n *\n * @exception {RuntimeError} Draco decoder could not be initialized.\n */\nDracoLoader.decodePointCloud = function (parameters) {\n  const decoderTaskProcessor = DracoLoader._getDecoderTaskProcessor();\n  if (defined(DracoLoader._error)) {\n    throw DracoLoader._error;\n  }\n\n  if (!DracoLoader._taskProcessorReady) {\n    // The task processor is not ready to schedule tasks\n    return;\n  }\n  return decoderTaskProcessor.scheduleTask(parameters, [\n    parameters.buffer.buffer,\n  ]);\n};\n\n/**\n * Decodes a buffer view. Returns undefined if the task cannot be scheduled.\n *\n * @param {object} options Object with the following properties:\n * @param {Uint8Array} options.array The typed array containing the buffer view data.\n * @param {object} options.bufferView The glTF buffer view object.\n * @param {Object<string, number>} options.compressedAttributes The compressed attributes.\n * @param {boolean} options.dequantizeInShader Whether POSITION and NORMAL attributes should be dequantized on the GPU.\n *\n * @returns {Promise} A promise that resolves to the decoded indices and attributes.\n * @private\n *\n * @exception {RuntimeError} Draco decoder could not be initialized.\n */\nDracoLoader.decodeBufferView = function (options) {\n  const decoderTaskProcessor = DracoLoader._getDecoderTaskProcessor();\n\n  if (defined(DracoLoader._error)) {\n    throw DracoLoader._error;\n  }\n\n  if (!DracoLoader._taskProcessorReady) {\n    // The task processor is not ready to schedule tasks\n    return;\n  }\n\n  return decoderTaskProcessor.scheduleTask(options, [options.array.buffer]);\n};\n\nexport default DracoLoader;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DracoLoader from \"./DracoLoader.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * Load a draco buffer from a glTF.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfDracoLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {object} options Object with the following properties:\n * @param {ResourceCache} options.resourceCache The {@link ResourceCache} (to avoid circular dependencies).\n * @param {object} options.gltf The glTF JSON.\n * @param {object} options.draco The Draco extension object.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {string} [options.cacheKey] The cache key of the resource.\n *\n * @private\n */\nfunction GltfDracoLoader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const resourceCache = options.resourceCache;\n  const gltf = options.gltf;\n  const draco = options.draco;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n  const cacheKey = options.cacheKey;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.func(\"options.resourceCache\", resourceCache);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.object(\"options.draco\", draco);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  //>>includeEnd('debug');\n\n  this._resourceCache = resourceCache;\n  this._gltfResource = gltfResource;\n  this._baseResource = baseResource;\n  this._gltf = gltf;\n  this._draco = draco;\n  this._cacheKey = cacheKey;\n  this._bufferViewLoader = undefined;\n  this._bufferViewTypedArray = undefined;\n  this._decodePromise = undefined;\n  this._decodedData = undefined;\n  this._state = ResourceLoaderState.UNLOADED;\n  this._promise = undefined;\n  this._dracoError = undefined;\n}\n\nif (defined(Object.create)) {\n  GltfDracoLoader.prototype = Object.create(ResourceLoader.prototype);\n  GltfDracoLoader.prototype.constructor = GltfDracoLoader;\n}\n\nObject.defineProperties(GltfDracoLoader.prototype, {\n  /**\n   * The cache key of the resource.\n   *\n   * @memberof GltfDracoLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    get: function () {\n      return this._cacheKey;\n    },\n  },\n  /**\n   * The decoded data.\n   *\n   * @memberof GltfDracoLoader.prototype\n   *\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  decodedData: {\n    get: function () {\n      return this._decodedData;\n    },\n  },\n});\n\nasync function loadResources(loader) {\n  const resourceCache = loader._resourceCache;\n  try {\n    const bufferViewLoader = resourceCache.getBufferViewLoader({\n      gltf: loader._gltf,\n      bufferViewId: loader._draco.bufferView,\n      gltfResource: loader._gltfResource,\n      baseResource: loader._baseResource,\n    });\n    loader._bufferViewLoader = bufferViewLoader;\n    await bufferViewLoader.load();\n\n    if (loader.isDestroyed()) {\n      return;\n    }\n\n    loader._bufferViewTypedArray = bufferViewLoader.typedArray;\n    loader._state = ResourceLoaderState.PROCESSING;\n    return loader;\n  } catch (error) {\n    if (loader.isDestroyed()) {\n      return;\n    }\n\n    handleError(loader, error);\n  }\n}\n\n/**\n * Loads the resource.\n * @returns {Promise<GltfDracoLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfDracoLoader.prototype.load = async function () {\n  if (defined(this._promise)) {\n    return this._promise;\n  }\n\n  this._state = ResourceLoaderState.LOADING;\n  this._promise = loadResources(this);\n  return this._promise;\n};\n\nfunction handleError(dracoLoader, error) {\n  dracoLoader.unload();\n  dracoLoader._state = ResourceLoaderState.FAILED;\n  const errorMessage = \"Failed to load Draco\";\n  throw dracoLoader.getError(errorMessage, error);\n}\n\nasync function processDecode(loader, decodePromise) {\n  try {\n    const results = await decodePromise;\n    if (loader.isDestroyed()) {\n      return;\n    }\n\n    // Unload everything except the decoded data\n    loader.unload();\n\n    loader._decodedData = {\n      indices: results.indexArray,\n      vertexAttributes: results.attributeData,\n    };\n    loader._state = ResourceLoaderState.READY;\n    return loader._baseResource;\n  } catch (error) {\n    if (loader.isDestroyed()) {\n      return;\n    }\n\n    // Capture this error so it can be thrown on the next `process` call\n    loader._dracoError = error;\n  }\n}\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @private\n */\nGltfDracoLoader.prototype.process = function (frameState) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"frameState\", frameState);\n  //>>includeEnd('debug');\n\n  if (this._state === ResourceLoaderState.READY) {\n    return true;\n  }\n\n  if (this._state !== ResourceLoaderState.PROCESSING) {\n    return false;\n  }\n\n  if (defined(this._dracoError)) {\n    handleError(this, this._dracoError);\n  }\n\n  if (!defined(this._bufferViewTypedArray)) {\n    // Not ready to decode the Draco buffer\n    return false;\n  }\n\n  if (defined(this._decodePromise)) {\n    // Currently decoding\n    return false;\n  }\n\n  const draco = this._draco;\n  const gltf = this._gltf;\n  const bufferViews = gltf.bufferViews;\n  const bufferViewId = draco.bufferView;\n  const bufferView = bufferViews[bufferViewId];\n  const compressedAttributes = draco.attributes;\n\n  const decodeOptions = {\n    // Need to make a copy of the typed array otherwise the underlying\n    // ArrayBuffer may be accessed on both the worker and the main thread. This\n    // leads to errors such as \"ArrayBuffer at index 0 is already detached\".\n    // PERFORMANCE_IDEA: Look into SharedArrayBuffer to get around this.\n    array: new Uint8Array(this._bufferViewTypedArray),\n    bufferView: bufferView,\n    compressedAttributes: compressedAttributes,\n    dequantizeInShader: true,\n  };\n\n  const decodePromise = DracoLoader.decodeBufferView(decodeOptions);\n\n  if (!defined(decodePromise)) {\n    // Cannot schedule task this frame\n    return false;\n  }\n\n  this._decodePromise = processDecode(this, decodePromise);\n};\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfDracoLoader.prototype.unload = function () {\n  if (defined(this._bufferViewLoader)) {\n    this._resourceCache.unload(this._bufferViewLoader);\n  }\n\n  this._bufferViewLoader = undefined;\n  this._bufferViewTypedArray = undefined;\n  this._decodedData = undefined;\n  this._gltf = undefined;\n};\n\nexport default GltfDracoLoader;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Resource from \"./Resource.js\";\n\n/**\n * @private\n */\nfunction loadImageFromTypedArray(options) {\n  const uint8Array = options.uint8Array;\n  const format = options.format;\n  const request = options.request;\n  const flipY = defaultValue(options.flipY, false);\n  const skipColorSpaceConversion = defaultValue(\n    options.skipColorSpaceConversion,\n    false\n  );\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"uint8Array\", uint8Array);\n  Check.typeOf.string(\"format\", format);\n  //>>includeEnd('debug');\n\n  const blob = new Blob([uint8Array], {\n    type: format,\n  });\n\n  let blobUrl;\n  return Resource.supportsImageBitmapOptions()\n    .then(function (result) {\n      if (result) {\n        return Promise.resolve(\n          Resource.createImageBitmapFromBlob(blob, {\n            flipY: flipY,\n            premultiplyAlpha: false,\n            skipColorSpaceConversion: skipColorSpaceConversion,\n          })\n        );\n      }\n\n      blobUrl = window.URL.createObjectURL(blob);\n      const resource = new Resource({\n        url: blobUrl,\n        request: request,\n      });\n\n      return resource.fetchImage({\n        flipY: flipY,\n        skipColorSpaceConversion: skipColorSpaceConversion,\n      });\n    })\n    .then(function (result) {\n      if (defined(blobUrl)) {\n        window.URL.revokeObjectURL(blobUrl);\n      }\n      return result;\n    })\n    .catch(function (error) {\n      if (defined(blobUrl)) {\n        window.URL.revokeObjectURL(blobUrl);\n      }\n      return Promise.reject(error);\n    });\n}\nexport default loadImageFromTypedArray;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport loadImageFromTypedArray from \"../Core/loadImageFromTypedArray.js\";\nimport loadKTX2 from \"../Core/loadKTX2.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * Loads a glTF image.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfImageLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {object} options Object with the following properties:\n * @param {ResourceCache} options.resourceCache The {@link ResourceCache} (to avoid circular dependencies).\n * @param {object} options.gltf The glTF JSON.\n * @param {number} options.imageId The image ID.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {string} [options.cacheKey] The cache key of the resource.\n *\n * @private\n */\nfunction GltfImageLoader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const resourceCache = options.resourceCache;\n  const gltf = options.gltf;\n  const imageId = options.imageId;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n  const cacheKey = options.cacheKey;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.func(\"options.resourceCache\", resourceCache);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.number(\"options.imageId\", imageId);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  //>>includeEnd('debug');\n\n  const image = gltf.images[imageId];\n  const bufferViewId = image.bufferView;\n  const uri = image.uri;\n\n  this._resourceCache = resourceCache;\n  this._gltfResource = gltfResource;\n  this._baseResource = baseResource;\n  this._gltf = gltf;\n  this._bufferViewId = bufferViewId;\n  this._uri = uri;\n  this._cacheKey = cacheKey;\n  this._bufferViewLoader = undefined;\n  this._image = undefined;\n  this._mipLevels = undefined;\n  this._state = ResourceLoaderState.UNLOADED;\n  this._promise = undefined;\n}\n\nif (defined(Object.create)) {\n  GltfImageLoader.prototype = Object.create(ResourceLoader.prototype);\n  GltfImageLoader.prototype.constructor = GltfImageLoader;\n}\n\nObject.defineProperties(GltfImageLoader.prototype, {\n  /**\n   * The cache key of the resource.\n   *\n   * @memberof GltfImageLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    get: function () {\n      return this._cacheKey;\n    },\n  },\n  /**\n   * The image.\n   *\n   * @memberof GltfImageLoader.prototype\n   *\n   * @type {Image|ImageBitmap|CompressedTextureBuffer}\n   * @readonly\n   * @private\n   */\n  image: {\n    get: function () {\n      return this._image;\n    },\n  },\n  /**\n   * The mip levels. Only defined for KTX2 files containing mip levels.\n   *\n   * @memberof GltfImageLoader.prototype\n   *\n   * @type {Uint8Array[]}\n   * @readonly\n   * @private\n   */\n  mipLevels: {\n    get: function () {\n      return this._mipLevels;\n    },\n  },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise<GltfImageLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfImageLoader.prototype.load = function () {\n  if (defined(this._promise)) {\n    return this._promise;\n  }\n\n  if (defined(this._bufferViewId)) {\n    this._promise = loadFromBufferView(this);\n    return this._promise;\n  }\n\n  this._promise = loadFromUri(this);\n  return this._promise;\n};\n\nfunction getImageAndMipLevels(image) {\n  // Images transcoded from KTX2 can contain multiple mip levels:\n  // https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu\n  let mipLevels;\n  if (Array.isArray(image)) {\n    // highest detail mip should be level 0\n    mipLevels = image.slice(1, image.length).map(function (mipLevel) {\n      return mipLevel.bufferView;\n    });\n    image = image[0];\n  }\n  return {\n    image: image,\n    mipLevels: mipLevels,\n  };\n}\n\nasync function loadFromBufferView(imageLoader) {\n  imageLoader._state = ResourceLoaderState.LOADING;\n  const resourceCache = imageLoader._resourceCache;\n  try {\n    const bufferViewLoader = resourceCache.getBufferViewLoader({\n      gltf: imageLoader._gltf,\n      bufferViewId: imageLoader._bufferViewId,\n      gltfResource: imageLoader._gltfResource,\n      baseResource: imageLoader._baseResource,\n    });\n    imageLoader._bufferViewLoader = bufferViewLoader;\n    await bufferViewLoader.load();\n\n    if (imageLoader.isDestroyed()) {\n      return;\n    }\n\n    const typedArray = bufferViewLoader.typedArray;\n    const image = await loadImageFromBufferTypedArray(typedArray);\n    if (imageLoader.isDestroyed()) {\n      return;\n    }\n\n    const imageAndMipLevels = getImageAndMipLevels(image);\n\n    // Unload everything except the image\n    imageLoader.unload();\n\n    imageLoader._image = imageAndMipLevels.image;\n    imageLoader._mipLevels = imageAndMipLevels.mipLevels;\n    imageLoader._state = ResourceLoaderState.READY;\n\n    return imageLoader;\n  } catch (error) {\n    if (imageLoader.isDestroyed()) {\n      return;\n    }\n\n    return handleError(imageLoader, error, \"Failed to load embedded image\");\n  }\n}\n\nasync function loadFromUri(imageLoader) {\n  imageLoader._state = ResourceLoaderState.LOADING;\n  const baseResource = imageLoader._baseResource;\n  const uri = imageLoader._uri;\n  const resource = baseResource.getDerivedResource({\n    url: uri,\n  });\n\n  try {\n    const image = await loadImageFromUri(resource);\n    if (imageLoader.isDestroyed()) {\n      return;\n    }\n\n    const imageAndMipLevels = getImageAndMipLevels(image);\n\n    // Unload everything except the image\n    imageLoader.unload();\n\n    imageLoader._image = imageAndMipLevels.image;\n    imageLoader._mipLevels = imageAndMipLevels.mipLevels;\n    imageLoader._state = ResourceLoaderState.READY;\n\n    return imageLoader;\n  } catch (error) {\n    if (imageLoader.isDestroyed()) {\n      return;\n    }\n    return handleError(imageLoader, error, `Failed to load image: ${uri}`);\n  }\n}\n\nfunction handleError(imageLoader, error, errorMessage) {\n  imageLoader.unload();\n  imageLoader._state = ResourceLoaderState.FAILED;\n  return Promise.reject(imageLoader.getError(errorMessage, error));\n}\n\nfunction getMimeTypeFromTypedArray(typedArray) {\n  const header = typedArray.subarray(0, 2);\n  const webpHeaderRIFFChars = typedArray.subarray(0, 4);\n  const webpHeaderWEBPChars = typedArray.subarray(8, 12);\n\n  if (header[0] === 0xff && header[1] === 0xd8) {\n    // See https://en.wikipedia.org/wiki/JPEG_File_Interchange_Format\n    return \"image/jpeg\";\n  } else if (header[0] === 0x89 && header[1] === 0x50) {\n    // See http://www.libpng.org/pub/png/spec/1.2/PNG-Structure.html\n    return \"image/png\";\n  } else if (header[0] === 0xab && header[1] === 0x4b) {\n    // See http://github.khronos.org/KTX-Specification/#_identifier\n    return \"image/ktx2\";\n  } else if (\n    // See https://developers.google.com/speed/webp/docs/riff_container#webp_file_header\n    webpHeaderRIFFChars[0] === 0x52 &&\n    webpHeaderRIFFChars[1] === 0x49 &&\n    webpHeaderRIFFChars[2] === 0x46 &&\n    webpHeaderRIFFChars[3] === 0x46 &&\n    webpHeaderWEBPChars[0] === 0x57 &&\n    webpHeaderWEBPChars[1] === 0x45 &&\n    webpHeaderWEBPChars[2] === 0x42 &&\n    webpHeaderWEBPChars[3] === 0x50\n  ) {\n    return \"image/webp\";\n  }\n\n  throw new RuntimeError(\"Image format is not recognized\");\n}\n\nasync function loadImageFromBufferTypedArray(typedArray) {\n  const mimeType = getMimeTypeFromTypedArray(typedArray);\n  if (mimeType === \"image/ktx2\") {\n    // Need to make a copy of the embedded KTX2 buffer otherwise the underlying\n    // ArrayBuffer may be accessed on both the worker and the main thread and\n    // throw an error like \"Cannot perform Construct on a detached ArrayBuffer\".\n    // Look into SharedArrayBuffer at some point to get around this.\n    const ktxBuffer = new Uint8Array(typedArray);\n\n    // Resolves to a CompressedTextureBuffer\n    return loadKTX2(ktxBuffer);\n  }\n  // Resolves to an Image or ImageBitmap\n  return GltfImageLoader._loadImageFromTypedArray({\n    uint8Array: typedArray,\n    format: mimeType,\n    flipY: false,\n    skipColorSpaceConversion: true,\n  });\n}\n\nconst ktx2Regex = /(^data:image\\/ktx2)|(\\.ktx2$)/i;\n\nfunction loadImageFromUri(resource) {\n  const uri = resource.getUrlComponent(false, true);\n  if (ktx2Regex.test(uri)) {\n    // Resolves to a CompressedTextureBuffer\n    return loadKTX2(resource);\n  }\n  // Resolves to an ImageBitmap or Image\n  return resource.fetchImage({\n    skipColorSpaceConversion: true,\n    preferImageBitmap: true,\n  });\n}\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfImageLoader.prototype.unload = function () {\n  if (\n    defined(this._bufferViewLoader) &&\n    !this._bufferViewLoader.isDestroyed()\n  ) {\n    this._resourceCache.unload(this._bufferViewLoader);\n  }\n\n  this._bufferViewLoader = undefined;\n  this._uri = undefined; // Free in case the uri is a data uri\n  this._image = undefined;\n  this._mipLevels = undefined;\n  this._gltf = undefined;\n};\n\n// Exposed for testing\nGltfImageLoader._loadImageFromTypedArray = loadImageFromTypedArray;\n\nexport default GltfImageLoader;\n", "/**\n * @private\n */\nconst JobType = {\n  TEXTURE: 0,\n  PROGRAM: 1,\n  BUFFER: 2,\n  NUMBER_OF_JOB_TYPES: 3,\n};\nexport default Object.freeze(JobType);\n", "import Check from \"../Core/Check.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport JobType from \"./JobType.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * Loads an index buffer from a glTF accessor.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfIndexBufferLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {object} options Object with the following properties:\n * @param {ResourceCache} options.resourceCache The {@link ResourceCache} (to avoid circular dependencies).\n * @param {object} options.gltf The glTF JSON.\n * @param {number} options.accessorId The accessor ID corresponding to the index buffer.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {object} [options.draco] The Draco extension object.\n * @param {string} [options.cacheKey] The cache key of the resource.\n * @param {boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n * @param {boolean} [options.loadBuffer=false] Load the index buffer as a GPU index buffer.\n * @param {boolean} [options.loadTypedArray=false] Load the index buffer as a typed array.\n * @private\n */\nfunction GltfIndexBufferLoader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const resourceCache = options.resourceCache;\n  const gltf = options.gltf;\n  const accessorId = options.accessorId;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n  const draco = options.draco;\n  const cacheKey = options.cacheKey;\n  const asynchronous = defaultValue(options.asynchronous, true);\n  const loadBuffer = defaultValue(options.loadBuffer, false);\n  const loadTypedArray = defaultValue(options.loadTypedArray, false);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.func(\"options.resourceCache\", resourceCache);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.number(\"options.accessorId\", accessorId);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  if (!loadBuffer && !loadTypedArray) {\n    throw new DeveloperError(\n      \"At least one of loadBuffer and loadTypedArray must be true.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const indexDatatype = gltf.accessors[accessorId].componentType;\n\n  this._resourceCache = resourceCache;\n  this._gltfResource = gltfResource;\n  this._baseResource = baseResource;\n  this._gltf = gltf;\n  this._accessorId = accessorId;\n  this._indexDatatype = indexDatatype;\n  this._draco = draco;\n  this._cacheKey = cacheKey;\n  this._asynchronous = asynchronous;\n  this._loadBuffer = loadBuffer;\n  this._loadTypedArray = loadTypedArray;\n  this._bufferViewLoader = undefined;\n  this._dracoLoader = undefined;\n  this._typedArray = undefined;\n  this._buffer = undefined;\n  this._state = ResourceLoaderState.UNLOADED;\n  this._promise = undefined;\n}\n\nif (defined(Object.create)) {\n  GltfIndexBufferLoader.prototype = Object.create(ResourceLoader.prototype);\n  GltfIndexBufferLoader.prototype.constructor = GltfIndexBufferLoader;\n}\n\nObject.defineProperties(GltfIndexBufferLoader.prototype, {\n  /**\n   * The cache key of the resource.\n   *\n   * @memberof GltfIndexBufferLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    get: function () {\n      return this._cacheKey;\n    },\n  },\n  /**\n   * The index buffer. This is only defined when <code>loadBuffer</code> is true.\n   *\n   * @memberof GltfIndexBufferLoader.prototype\n   *\n   * @type {Buffer}\n   * @readonly\n   * @private\n   */\n  buffer: {\n    get: function () {\n      return this._buffer;\n    },\n  },\n  /**\n   * The typed array containing indices. This is only defined when <code>loadTypedArray</code> is true.\n   *\n   * @memberof GltfIndexBufferLoader.prototype\n   *\n   * @type {Uint8Array|Uint16Array|Uint32Array}\n   * @readonly\n   * @private\n   */\n  typedArray: {\n    get: function () {\n      return this._typedArray;\n    },\n  },\n\n  /**\n   * The index datatype after decode.\n   *\n   * @memberof GltfIndexBufferLoader.prototype\n   *\n   * @type {IndexDatatype}\n   * @readonly\n   * @private\n   */\n  indexDatatype: {\n    get: function () {\n      return this._indexDatatype;\n    },\n  },\n});\n\nconst scratchIndexBufferJob = new CreateIndexBufferJob();\n\n/**\n * Loads the resource.\n * @returns {Promise<GltfIndexBufferLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfIndexBufferLoader.prototype.load = async function () {\n  if (defined(this._promise)) {\n    return this._promise;\n  }\n\n  if (defined(this._draco)) {\n    this._promise = loadFromDraco(this);\n    return this._promise;\n  }\n\n  this._promise = loadFromBufferView(this);\n  return this._promise;\n};\n\nasync function loadFromDraco(indexBufferLoader) {\n  indexBufferLoader._state = ResourceLoaderState.LOADING;\n  const resourceCache = indexBufferLoader._resourceCache;\n\n  try {\n    const dracoLoader = resourceCache.getDracoLoader({\n      gltf: indexBufferLoader._gltf,\n      draco: indexBufferLoader._draco,\n      gltfResource: indexBufferLoader._gltfResource,\n      baseResource: indexBufferLoader._baseResource,\n    });\n    indexBufferLoader._dracoLoader = dracoLoader;\n    await dracoLoader.load();\n\n    if (indexBufferLoader.isDestroyed()) {\n      return;\n    }\n\n    // Now wait for process() to run to finish loading\n    indexBufferLoader._state = ResourceLoaderState.LOADED;\n    return indexBufferLoader;\n  } catch (error) {\n    if (indexBufferLoader.isDestroyed()) {\n      return;\n    }\n\n    handleError(indexBufferLoader, error);\n  }\n}\n\nasync function loadFromBufferView(indexBufferLoader) {\n  const gltf = indexBufferLoader._gltf;\n  const accessorId = indexBufferLoader._accessorId;\n  const accessor = gltf.accessors[accessorId];\n  const bufferViewId = accessor.bufferView;\n\n  indexBufferLoader._state = ResourceLoaderState.LOADING;\n  const resourceCache = indexBufferLoader._resourceCache;\n  try {\n    const bufferViewLoader = resourceCache.getBufferViewLoader({\n      gltf: gltf,\n      bufferViewId: bufferViewId,\n      gltfResource: indexBufferLoader._gltfResource,\n      baseResource: indexBufferLoader._baseResource,\n    });\n    indexBufferLoader._bufferViewLoader = bufferViewLoader;\n\n    await bufferViewLoader.load();\n    if (indexBufferLoader.isDestroyed()) {\n      return;\n    }\n\n    const bufferViewTypedArray = bufferViewLoader.typedArray;\n    indexBufferLoader._typedArray = createIndicesTypedArray(\n      indexBufferLoader,\n      bufferViewTypedArray\n    );\n    indexBufferLoader._state = ResourceLoaderState.PROCESSING;\n    return indexBufferLoader;\n  } catch (error) {\n    if (indexBufferLoader.isDestroyed()) {\n      return;\n    }\n\n    handleError(indexBufferLoader, error);\n  }\n}\n\nfunction createIndicesTypedArray(indexBufferLoader, bufferViewTypedArray) {\n  const gltf = indexBufferLoader._gltf;\n  const accessorId = indexBufferLoader._accessorId;\n  const accessor = gltf.accessors[accessorId];\n  const count = accessor.count;\n  const indexDatatype = accessor.componentType;\n  const indexSize = IndexDatatype.getSizeInBytes(indexDatatype);\n\n  let arrayBuffer = bufferViewTypedArray.buffer;\n  let byteOffset = bufferViewTypedArray.byteOffset + accessor.byteOffset;\n\n  if (byteOffset % indexSize !== 0) {\n    const byteLength = count * indexSize;\n    const view = new Uint8Array(arrayBuffer, byteOffset, byteLength);\n    const copy = new Uint8Array(view);\n    arrayBuffer = copy.buffer;\n    byteOffset = 0;\n    deprecationWarning(\n      \"index-buffer-unaligned\",\n      `The index array is not aligned to a ${indexSize}-byte boundary.`\n    );\n  }\n\n  let typedArray;\n  if (indexDatatype === IndexDatatype.UNSIGNED_BYTE) {\n    typedArray = new Uint8Array(arrayBuffer, byteOffset, count);\n  } else if (indexDatatype === IndexDatatype.UNSIGNED_SHORT) {\n    typedArray = new Uint16Array(arrayBuffer, byteOffset, count);\n  } else if (indexDatatype === IndexDatatype.UNSIGNED_INT) {\n    typedArray = new Uint32Array(arrayBuffer, byteOffset, count);\n  }\n\n  return typedArray;\n}\n\nfunction handleError(indexBufferLoader, error) {\n  indexBufferLoader.unload();\n  indexBufferLoader._state = ResourceLoaderState.FAILED;\n  const errorMessage = \"Failed to load index buffer\";\n  throw indexBufferLoader.getError(errorMessage, error);\n}\n\nfunction CreateIndexBufferJob() {\n  this.typedArray = undefined;\n  this.indexDatatype = undefined;\n  this.context = undefined;\n  this.buffer = undefined;\n}\n\nCreateIndexBufferJob.prototype.set = function (\n  typedArray,\n  indexDatatype,\n  context\n) {\n  this.typedArray = typedArray;\n  this.indexDatatype = indexDatatype;\n  this.context = context;\n};\n\nCreateIndexBufferJob.prototype.execute = function () {\n  this.buffer = createIndexBuffer(\n    this.typedArray,\n    this.indexDatatype,\n    this.context\n  );\n};\n\nfunction createIndexBuffer(typedArray, indexDatatype, context) {\n  const buffer = Buffer.createIndexBuffer({\n    typedArray: typedArray,\n    context: context,\n    usage: BufferUsage.STATIC_DRAW,\n    indexDatatype: indexDatatype,\n  });\n  buffer.vertexArrayDestroyable = false;\n  return buffer;\n}\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @private\n */\nGltfIndexBufferLoader.prototype.process = function (frameState) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"frameState\", frameState);\n  //>>includeEnd('debug');\n\n  if (this._state === ResourceLoaderState.READY) {\n    return true;\n  }\n\n  if (\n    this._state !== ResourceLoaderState.LOADED &&\n    this._state !== ResourceLoaderState.PROCESSING\n  ) {\n    return false;\n  }\n\n  let typedArray = this._typedArray;\n  let indexDatatype = this._indexDatatype;\n\n  if (defined(this._dracoLoader)) {\n    try {\n      const ready = this._dracoLoader.process(frameState);\n      if (ready) {\n        const dracoLoader = this._dracoLoader;\n        typedArray = dracoLoader.decodedData.indices.typedArray;\n        this._typedArray = typedArray;\n        // The index datatype may be a smaller datatype after draco decode\n        indexDatatype = ComponentDatatype.fromTypedArray(typedArray);\n        this._indexDatatype = indexDatatype;\n      }\n    } catch (error) {\n      handleError(this, error);\n    }\n  }\n\n  if (!defined(typedArray)) {\n    // Buffer view hasn't been loaded yet\n    return false;\n  }\n\n  let buffer;\n  if (this._loadBuffer && this._asynchronous) {\n    const indexBufferJob = scratchIndexBufferJob;\n    indexBufferJob.set(typedArray, indexDatatype, frameState.context);\n    const jobScheduler = frameState.jobScheduler;\n    if (!jobScheduler.execute(indexBufferJob, JobType.BUFFER)) {\n      // Job scheduler is full. Try again next frame.\n      return false;\n    }\n    buffer = indexBufferJob.buffer;\n  } else if (this._loadBuffer) {\n    buffer = createIndexBuffer(typedArray, indexDatatype, frameState.context);\n  }\n\n  // Unload everything except the index buffer and/or typed array.\n  this.unload();\n\n  this._buffer = buffer;\n  this._typedArray = this._loadTypedArray ? typedArray : undefined;\n  this._state = ResourceLoaderState.READY;\n\n  this._resourceCache.statistics.addGeometryLoader(this);\n  return true;\n};\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfIndexBufferLoader.prototype.unload = function () {\n  if (defined(this._buffer)) {\n    this._buffer.destroy();\n  }\n\n  const resourceCache = this._resourceCache;\n\n  if (\n    defined(this._bufferViewLoader) &&\n    !this._bufferViewLoader.isDestroyed()\n  ) {\n    resourceCache.unload(this._bufferViewLoader);\n  }\n\n  if (defined(this._dracoLoader)) {\n    resourceCache.unload(this._dracoLoader);\n  }\n\n  this._bufferViewLoader = undefined;\n  this._dracoLoader = undefined;\n  this._typedArray = undefined;\n  this._buffer = undefined;\n  this._gltf = undefined;\n};\n\nexport default GltfIndexBufferLoader;\n", "import defaultValue from \"../../Core/defaultValue.js\";\n\n/**\n * Adds an element to an array and returns the element's index.\n *\n * @param {Array} array The array to add to.\n * @param {object} element The element to add.\n * @param {boolean} [checkDuplicates=false] When <code>true</code>, if a duplicate element is found its index is returned and <code>element</code> is not added to the array.\n *\n * @private\n */\nfunction addToArray(array, element, checkDuplicates) {\n  checkDuplicates = defaultValue(checkDuplicates, false);\n  if (checkDuplicates) {\n    const index = array.indexOf(element);\n    if (index > -1) {\n      return index;\n    }\n  }\n\n  array.push(element);\n  return array.length - 1;\n}\n\nexport default addToArray;\n", "import defined from \"../../Core/defined.js\";\n\n/**\n * Checks whether the glTF uses the given extension.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @param {string} extension The name of the extension.\n * @returns {boolean} Whether the glTF uses the given extension.\n *\n * @private\n */\nfunction usesExtension(gltf, extension) {\n  return (\n    defined(gltf.extensionsUsed) && gltf.extensionsUsed.indexOf(extension) >= 0\n  );\n}\n\nexport default usesExtension;\n", "import usesExtension from \"./usesExtension.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Contains traversal functions for processing elements of the glTF hierarchy.\n * @constructor\n *\n * @private\n */\nfunction ForEach() {}\n\n/**\n * Fallback for glTF 1.0\n * @private\n */\nForEach.objectLegacy = function (objects, handler) {\n  if (defined(objects)) {\n    for (const objectId in objects) {\n      if (Object.prototype.hasOwnProperty.call(objects, objectId)) {\n        const object = objects[objectId];\n        const value = handler(object, objectId);\n\n        if (defined(value)) {\n          return value;\n        }\n      }\n    }\n  }\n};\n\n/**\n * @private\n */\nForEach.object = function (arrayOfObjects, handler) {\n  if (defined(arrayOfObjects)) {\n    const length = arrayOfObjects.length;\n    for (let i = 0; i < length; i++) {\n      const object = arrayOfObjects[i];\n      const value = handler(object, i);\n\n      if (defined(value)) {\n        return value;\n      }\n    }\n  }\n};\n\n/**\n * Supports glTF 1.0 and 2.0\n * @private\n */\nForEach.topLevel = function (gltf, name, handler) {\n  const gltfProperty = gltf[name];\n  if (defined(gltfProperty) && !Array.isArray(gltfProperty)) {\n    return ForEach.objectLegacy(gltfProperty, handler);\n  }\n\n  return ForEach.object(gltfProperty, handler);\n};\n\nForEach.accessor = function (gltf, handler) {\n  return ForEach.topLevel(gltf, \"accessors\", handler);\n};\n\nForEach.accessorWithSemantic = function (gltf, semantic, handler) {\n  const visited = {};\n  return ForEach.mesh(gltf, function (mesh) {\n    return ForEach.meshPrimitive(mesh, function (primitive) {\n      const valueForEach = ForEach.meshPrimitiveAttribute(\n        primitive,\n        function (accessorId, attributeSemantic) {\n          if (\n            attributeSemantic.indexOf(semantic) === 0 &&\n            !defined(visited[accessorId])\n          ) {\n            visited[accessorId] = true;\n            const value = handler(accessorId);\n\n            if (defined(value)) {\n              return value;\n            }\n          }\n        }\n      );\n\n      if (defined(valueForEach)) {\n        return valueForEach;\n      }\n\n      return ForEach.meshPrimitiveTarget(primitive, function (target) {\n        return ForEach.meshPrimitiveTargetAttribute(\n          target,\n          function (accessorId, attributeSemantic) {\n            if (\n              attributeSemantic.indexOf(semantic) === 0 &&\n              !defined(visited[accessorId])\n            ) {\n              visited[accessorId] = true;\n              const value = handler(accessorId);\n\n              if (defined(value)) {\n                return value;\n              }\n            }\n          }\n        );\n      });\n    });\n  });\n};\n\nForEach.accessorContainingVertexAttributeData = function (gltf, handler) {\n  const visited = {};\n  return ForEach.mesh(gltf, function (mesh) {\n    return ForEach.meshPrimitive(mesh, function (primitive) {\n      const valueForEach = ForEach.meshPrimitiveAttribute(\n        primitive,\n        function (accessorId) {\n          if (!defined(visited[accessorId])) {\n            visited[accessorId] = true;\n            const value = handler(accessorId);\n\n            if (defined(value)) {\n              return value;\n            }\n          }\n        }\n      );\n\n      if (defined(valueForEach)) {\n        return valueForEach;\n      }\n\n      return ForEach.meshPrimitiveTarget(primitive, function (target) {\n        return ForEach.meshPrimitiveTargetAttribute(\n          target,\n          function (accessorId) {\n            if (!defined(visited[accessorId])) {\n              visited[accessorId] = true;\n              const value = handler(accessorId);\n\n              if (defined(value)) {\n                return value;\n              }\n            }\n          }\n        );\n      });\n    });\n  });\n};\n\nForEach.accessorContainingIndexData = function (gltf, handler) {\n  const visited = {};\n  return ForEach.mesh(gltf, function (mesh) {\n    return ForEach.meshPrimitive(mesh, function (primitive) {\n      const indices = primitive.indices;\n      if (defined(indices) && !defined(visited[indices])) {\n        visited[indices] = true;\n        const value = handler(indices);\n\n        if (defined(value)) {\n          return value;\n        }\n      }\n    });\n  });\n};\n\nForEach.animation = function (gltf, handler) {\n  return ForEach.topLevel(gltf, \"animations\", handler);\n};\n\nForEach.animationChannel = function (animation, handler) {\n  const channels = animation.channels;\n  return ForEach.object(channels, handler);\n};\n\nForEach.animationSampler = function (animation, handler) {\n  const samplers = animation.samplers;\n  return ForEach.object(samplers, handler);\n};\n\nForEach.buffer = function (gltf, handler) {\n  return ForEach.topLevel(gltf, \"buffers\", handler);\n};\n\nForEach.bufferView = function (gltf, handler) {\n  return ForEach.topLevel(gltf, \"bufferViews\", handler);\n};\n\nForEach.camera = function (gltf, handler) {\n  return ForEach.topLevel(gltf, \"cameras\", handler);\n};\n\nForEach.image = function (gltf, handler) {\n  return ForEach.topLevel(gltf, \"images\", handler);\n};\n\nForEach.material = function (gltf, handler) {\n  return ForEach.topLevel(gltf, \"materials\", handler);\n};\n\nForEach.materialValue = function (material, handler) {\n  let values = material.values;\n  if (\n    defined(material.extensions) &&\n    defined(material.extensions.KHR_techniques_webgl)\n  ) {\n    values = material.extensions.KHR_techniques_webgl.values;\n  }\n\n  for (const name in values) {\n    if (Object.prototype.hasOwnProperty.call(values, name)) {\n      const value = handler(values[name], name);\n\n      if (defined(value)) {\n        return value;\n      }\n    }\n  }\n};\n\nForEach.mesh = function (gltf, handler) {\n  return ForEach.topLevel(gltf, \"meshes\", handler);\n};\n\nForEach.meshPrimitive = function (mesh, handler) {\n  const primitives = mesh.primitives;\n  if (defined(primitives)) {\n    const primitivesLength = primitives.length;\n    for (let i = 0; i < primitivesLength; i++) {\n      const primitive = primitives[i];\n      const value = handler(primitive, i);\n\n      if (defined(value)) {\n        return value;\n      }\n    }\n  }\n};\n\nForEach.meshPrimitiveAttribute = function (primitive, handler) {\n  const attributes = primitive.attributes;\n  for (const semantic in attributes) {\n    if (Object.prototype.hasOwnProperty.call(attributes, semantic)) {\n      const value = handler(attributes[semantic], semantic);\n\n      if (defined(value)) {\n        return value;\n      }\n    }\n  }\n};\n\nForEach.meshPrimitiveTarget = function (primitive, handler) {\n  const targets = primitive.targets;\n  if (defined(targets)) {\n    const length = targets.length;\n    for (let i = 0; i < length; ++i) {\n      const value = handler(targets[i], i);\n\n      if (defined(value)) {\n        return value;\n      }\n    }\n  }\n};\n\nForEach.meshPrimitiveTargetAttribute = function (target, handler) {\n  for (const semantic in target) {\n    if (Object.prototype.hasOwnProperty.call(target, semantic)) {\n      const accessorId = target[semantic];\n      const value = handler(accessorId, semantic);\n\n      if (defined(value)) {\n        return value;\n      }\n    }\n  }\n};\n\nForEach.node = function (gltf, handler) {\n  return ForEach.topLevel(gltf, \"nodes\", handler);\n};\n\nForEach.nodeInTree = function (gltf, nodeIds, handler) {\n  const nodes = gltf.nodes;\n  if (defined(nodes)) {\n    const length = nodeIds.length;\n    for (let i = 0; i < length; i++) {\n      const nodeId = nodeIds[i];\n      const node = nodes[nodeId];\n      if (defined(node)) {\n        let value = handler(node, nodeId);\n\n        if (defined(value)) {\n          return value;\n        }\n\n        const children = node.children;\n        if (defined(children)) {\n          value = ForEach.nodeInTree(gltf, children, handler);\n\n          if (defined(value)) {\n            return value;\n          }\n        }\n      }\n    }\n  }\n};\n\nForEach.nodeInScene = function (gltf, scene, handler) {\n  const sceneNodeIds = scene.nodes;\n  if (defined(sceneNodeIds)) {\n    return ForEach.nodeInTree(gltf, sceneNodeIds, handler);\n  }\n};\n\nForEach.program = function (gltf, handler) {\n  if (usesExtension(gltf, \"KHR_techniques_webgl\")) {\n    return ForEach.object(\n      gltf.extensions.KHR_techniques_webgl.programs,\n      handler\n    );\n  }\n\n  return ForEach.topLevel(gltf, \"programs\", handler);\n};\n\nForEach.sampler = function (gltf, handler) {\n  return ForEach.topLevel(gltf, \"samplers\", handler);\n};\n\nForEach.scene = function (gltf, handler) {\n  return ForEach.topLevel(gltf, \"scenes\", handler);\n};\n\nForEach.shader = function (gltf, handler) {\n  if (usesExtension(gltf, \"KHR_techniques_webgl\")) {\n    return ForEach.object(\n      gltf.extensions.KHR_techniques_webgl.shaders,\n      handler\n    );\n  }\n\n  return ForEach.topLevel(gltf, \"shaders\", handler);\n};\n\nForEach.skin = function (gltf, handler) {\n  return ForEach.topLevel(gltf, \"skins\", handler);\n};\n\nForEach.skinJoint = function (skin, handler) {\n  const joints = skin.joints;\n  if (defined(joints)) {\n    const jointsLength = joints.length;\n    for (let i = 0; i < jointsLength; i++) {\n      const joint = joints[i];\n      const value = handler(joint);\n\n      if (defined(value)) {\n        return value;\n      }\n    }\n  }\n};\n\nForEach.techniqueAttribute = function (technique, handler) {\n  const attributes = technique.attributes;\n  for (const attributeName in attributes) {\n    if (Object.prototype.hasOwnProperty.call(attributes, attributeName)) {\n      const value = handler(attributes[attributeName], attributeName);\n\n      if (defined(value)) {\n        return value;\n      }\n    }\n  }\n};\n\nForEach.techniqueUniform = function (technique, handler) {\n  const uniforms = technique.uniforms;\n  for (const uniformName in uniforms) {\n    if (Object.prototype.hasOwnProperty.call(uniforms, uniformName)) {\n      const value = handler(uniforms[uniformName], uniformName);\n\n      if (defined(value)) {\n        return value;\n      }\n    }\n  }\n};\n\nForEach.techniqueParameter = function (technique, handler) {\n  const parameters = technique.parameters;\n  for (const parameterName in parameters) {\n    if (Object.prototype.hasOwnProperty.call(parameters, parameterName)) {\n      const value = handler(parameters[parameterName], parameterName);\n\n      if (defined(value)) {\n        return value;\n      }\n    }\n  }\n};\n\nForEach.technique = function (gltf, handler) {\n  if (usesExtension(gltf, \"KHR_techniques_webgl\")) {\n    return ForEach.object(\n      gltf.extensions.KHR_techniques_webgl.techniques,\n      handler\n    );\n  }\n\n  return ForEach.topLevel(gltf, \"techniques\", handler);\n};\n\nForEach.texture = function (gltf, handler) {\n  return ForEach.topLevel(gltf, \"textures\", handler);\n};\n\nexport default ForEach;\n", "\n\n/**\n * Utility function for retrieving the number of components in a given type.\n *\n * @param {string} type glTF type\n * @returns {number} The number of components in that type.\n *\n * @private\n */\nfunction numberOfComponentsForType(type) {\n  switch (type) {\n    case \"SCALAR\":\n      return 1;\n    case \"VEC2\":\n      return 2;\n    case \"VEC3\":\n      return 3;\n    case \"VEC4\":\n    case \"MAT2\":\n      return 4;\n    case \"MAT3\":\n      return 9;\n    case \"MAT4\":\n      return 16;\n  }\n}\n\nexport default numberOfComponentsForType;\n", "import numberOfComponentsForType from \"./numberOfComponentsForType.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Returns the byte stride of the provided accessor.\n * If the byteStride is 0, it is calculated based on type and componentType\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @param {object} accessor The accessor.\n * @returns {number} The byte stride of the accessor.\n *\n * @private\n */\nfunction getAccessorByteStride(gltf, accessor) {\n  const bufferViewId = accessor.bufferView;\n  if (defined(bufferViewId)) {\n    const bufferView = gltf.bufferViews[bufferViewId];\n    if (defined(bufferView.byteStride) && bufferView.byteStride > 0) {\n      return bufferView.byteStride;\n    }\n  }\n  return (\n    ComponentDatatype.getSizeInBytes(accessor.componentType) *\n    numberOfComponentsForType(accessor.type)\n  );\n}\n\nexport default getAccessorByteStride;\n", "import addToArray from \"./addToArray.js\";\nimport ForEach from \"./ForEach.js\";\nimport getAccessorByteStride from \"./getAccessorByteStride.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport WebGLConstants from \"../../Core/WebGLConstants.js\";\n\n/**\n * Adds default glTF values if they don't exist.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @returns {object} The modified glTF.\n *\n * @private\n */\nfunction addDefaults(gltf) {\n  ForEach.accessor(gltf, function (accessor) {\n    if (defined(accessor.bufferView)) {\n      accessor.byteOffset = defaultValue(accessor.byteOffset, 0);\n    }\n  });\n\n  ForEach.bufferView(gltf, function (bufferView) {\n    if (defined(bufferView.buffer)) {\n      bufferView.byteOffset = defaultValue(bufferView.byteOffset, 0);\n    }\n  });\n\n  ForEach.mesh(gltf, function (mesh) {\n    ForEach.meshPrimitive(mesh, function (primitive) {\n      primitive.mode = defaultValue(primitive.mode, WebGLConstants.TRIANGLES);\n      if (!defined(primitive.material)) {\n        if (!defined(gltf.materials)) {\n          gltf.materials = [];\n        }\n        const defaultMaterial = {\n          name: \"default\",\n        };\n        primitive.material = addToArray(gltf.materials, defaultMaterial);\n      }\n    });\n  });\n\n  ForEach.accessorContainingVertexAttributeData(gltf, function (accessorId) {\n    const accessor = gltf.accessors[accessorId];\n    const bufferViewId = accessor.bufferView;\n    accessor.normalized = defaultValue(accessor.normalized, false);\n    if (defined(bufferViewId)) {\n      const bufferView = gltf.bufferViews[bufferViewId];\n      bufferView.byteStride = getAccessorByteStride(gltf, accessor);\n      bufferView.target = WebGLConstants.ARRAY_BUFFER;\n    }\n  });\n\n  ForEach.accessorContainingIndexData(gltf, function (accessorId) {\n    const accessor = gltf.accessors[accessorId];\n    const bufferViewId = accessor.bufferView;\n    if (defined(bufferViewId)) {\n      const bufferView = gltf.bufferViews[bufferViewId];\n      bufferView.target = WebGLConstants.ELEMENT_ARRAY_BUFFER;\n    }\n  });\n\n  ForEach.material(gltf, function (material) {\n    const extensions = defaultValue(\n      material.extensions,\n      defaultValue.EMPTY_OBJECT\n    );\n    const materialsCommon = extensions.KHR_materials_common;\n    if (defined(materialsCommon)) {\n      const technique = materialsCommon.technique;\n      const values = defined(materialsCommon.values)\n        ? materialsCommon.values\n        : {};\n      materialsCommon.values = values;\n\n      values.ambient = defined(values.ambient)\n        ? values.ambient\n        : [0.0, 0.0, 0.0, 1.0];\n      values.emission = defined(values.emission)\n        ? values.emission\n        : [0.0, 0.0, 0.0, 1.0];\n\n      values.transparency = defaultValue(values.transparency, 1.0);\n\n      if (technique !== \"CONSTANT\") {\n        values.diffuse = defined(values.diffuse)\n          ? values.diffuse\n          : [0.0, 0.0, 0.0, 1.0];\n        if (technique !== \"LAMBERT\") {\n          values.specular = defined(values.specular)\n            ? values.specular\n            : [0.0, 0.0, 0.0, 1.0];\n          values.shininess = defaultValue(values.shininess, 0.0);\n        }\n      }\n\n      // These actually exist on the extension object, not the values object despite what's shown in the spec\n      materialsCommon.transparent = defaultValue(\n        materialsCommon.transparent,\n        false\n      );\n      materialsCommon.doubleSided = defaultValue(\n        materialsCommon.doubleSided,\n        false\n      );\n\n      return;\n    }\n\n    material.emissiveFactor = defaultValue(\n      material.emissiveFactor,\n      [0.0, 0.0, 0.0]\n    );\n    material.alphaMode = defaultValue(material.alphaMode, \"OPAQUE\");\n    material.doubleSided = defaultValue(material.doubleSided, false);\n\n    if (material.alphaMode === \"MASK\") {\n      material.alphaCutoff = defaultValue(material.alphaCutoff, 0.5);\n    }\n\n    const techniquesExtension = extensions.KHR_techniques_webgl;\n    if (defined(techniquesExtension)) {\n      ForEach.materialValue(material, function (materialValue) {\n        // Check if material value is a TextureInfo object\n        if (defined(materialValue.index)) {\n          addTextureDefaults(materialValue);\n        }\n      });\n    }\n\n    addTextureDefaults(material.emissiveTexture);\n    addTextureDefaults(material.normalTexture);\n    addTextureDefaults(material.occlusionTexture);\n\n    const pbrMetallicRoughness = material.pbrMetallicRoughness;\n    if (defined(pbrMetallicRoughness)) {\n      pbrMetallicRoughness.baseColorFactor = defaultValue(\n        pbrMetallicRoughness.baseColorFactor,\n        [1.0, 1.0, 1.0, 1.0]\n      );\n      pbrMetallicRoughness.metallicFactor = defaultValue(\n        pbrMetallicRoughness.metallicFactor,\n        1.0\n      );\n      pbrMetallicRoughness.roughnessFactor = defaultValue(\n        pbrMetallicRoughness.roughnessFactor,\n        1.0\n      );\n      addTextureDefaults(pbrMetallicRoughness.baseColorTexture);\n      addTextureDefaults(pbrMetallicRoughness.metallicRoughnessTexture);\n    }\n\n    const pbrSpecularGlossiness =\n      extensions.KHR_materials_pbrSpecularGlossiness;\n    if (defined(pbrSpecularGlossiness)) {\n      pbrSpecularGlossiness.diffuseFactor = defaultValue(\n        pbrSpecularGlossiness.diffuseFactor,\n        [1.0, 1.0, 1.0, 1.0]\n      );\n      pbrSpecularGlossiness.specularFactor = defaultValue(\n        pbrSpecularGlossiness.specularFactor,\n        [1.0, 1.0, 1.0]\n      );\n      pbrSpecularGlossiness.glossinessFactor = defaultValue(\n        pbrSpecularGlossiness.glossinessFactor,\n        1.0\n      );\n      addTextureDefaults(pbrSpecularGlossiness.specularGlossinessTexture);\n    }\n  });\n\n  ForEach.animation(gltf, function (animation) {\n    ForEach.animationSampler(animation, function (sampler) {\n      sampler.interpolation = defaultValue(sampler.interpolation, \"LINEAR\");\n    });\n  });\n\n  const animatedNodes = getAnimatedNodes(gltf);\n  ForEach.node(gltf, function (node, id) {\n    const animated = defined(animatedNodes[id]);\n    if (\n      animated ||\n      defined(node.translation) ||\n      defined(node.rotation) ||\n      defined(node.scale)\n    ) {\n      node.translation = defaultValue(node.translation, [0.0, 0.0, 0.0]);\n      node.rotation = defaultValue(node.rotation, [0.0, 0.0, 0.0, 1.0]);\n      node.scale = defaultValue(node.scale, [1.0, 1.0, 1.0]);\n    } else {\n      node.matrix = defaultValue(\n        node.matrix,\n        [\n          1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0,\n          0.0, 1.0,\n        ]\n      );\n    }\n  });\n\n  ForEach.sampler(gltf, function (sampler) {\n    sampler.wrapS = defaultValue(sampler.wrapS, WebGLConstants.REPEAT);\n    sampler.wrapT = defaultValue(sampler.wrapT, WebGLConstants.REPEAT);\n  });\n\n  if (defined(gltf.scenes) && !defined(gltf.scene)) {\n    gltf.scene = 0;\n  }\n\n  return gltf;\n}\n\nfunction getAnimatedNodes(gltf) {\n  const nodes = {};\n  ForEach.animation(gltf, function (animation) {\n    ForEach.animationChannel(animation, function (channel) {\n      const target = channel.target;\n      const nodeId = target.node;\n      const path = target.path;\n      // Ignore animations that target 'weights'\n      if (path === \"translation\" || path === \"rotation\" || path === \"scale\") {\n        nodes[nodeId] = true;\n      }\n    });\n  });\n  return nodes;\n}\n\nfunction addTextureDefaults(texture) {\n  if (defined(texture)) {\n    texture.texCoord = defaultValue(texture.texCoord, 0);\n  }\n}\n\nexport default addDefaults;\n", "import ForEach from \"./ForEach.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Adds extras._pipeline to each object that can have extras in the glTF asset.\n * This stage runs before updateVersion and handles both glTF 1.0 and glTF 2.0 assets.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @returns {object} The glTF asset with the added pipeline extras.\n *\n * @private\n */\nfunction addPipelineExtras(gltf) {\n  ForEach.shader(gltf, function (shader) {\n    addExtras(shader);\n  });\n  ForEach.buffer(gltf, function (buffer) {\n    addExtras(buffer);\n  });\n  ForEach.image(gltf, function (image) {\n    addExtras(image);\n  });\n\n  addExtras(gltf);\n\n  return gltf;\n}\n\nfunction addExtras(object) {\n  object.extras = defined(object.extras) ? object.extras : {};\n  object.extras._pipeline = defined(object.extras._pipeline)\n    ? object.extras._pipeline\n    : {};\n}\n\nexport default addPipelineExtras;\n", "import defined from \"../../Core/defined.js\";\n\n/**\n * Removes an extension from gltf.extensionsRequired if it is present.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @param {string} extension The extension to remove.\n *\n * @private\n */\nfunction removeExtensionsRequired(gltf, extension) {\n  const extensionsRequired = gltf.extensionsRequired;\n  if (defined(extensionsRequired)) {\n    const index = extensionsRequired.indexOf(extension);\n    if (index >= 0) {\n      extensionsRequired.splice(index, 1);\n    }\n    if (extensionsRequired.length === 0) {\n      delete gltf.extensionsRequired;\n    }\n  }\n}\n\nexport default removeExtensionsRequired;\n", "import removeExtensionsRequired from \"./removeExtensionsRequired.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Removes an extension from gltf.extensionsUsed and gltf.extensionsRequired if it is present.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @param {string} extension The extension to remove.\n *\n * @private\n */\nfunction removeExtensionsUsed(gltf, extension) {\n  const extensionsUsed = gltf.extensionsUsed;\n  if (defined(extensionsUsed)) {\n    const index = extensionsUsed.indexOf(extension);\n    if (index >= 0) {\n      extensionsUsed.splice(index, 1);\n    }\n    removeExtensionsRequired(gltf, extension);\n    if (extensionsUsed.length === 0) {\n      delete gltf.extensionsUsed;\n    }\n  }\n}\n\nexport default removeExtensionsUsed;\n", "import addPipelineExtras from \"./addPipelineExtras.js\";\nimport removeExtensionsUsed from \"./removeExtensionsUsed.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport getMagic from \"../../Core/getMagic.js\";\nimport getStringFromTypedArray from \"../../Core/getStringFromTypedArray.js\";\nimport RuntimeError from \"../../Core/RuntimeError.js\";\n\nconst sizeOfUint32 = 4;\n\n/**\n * Convert a binary glTF to glTF.\n *\n * The returned glTF has pipeline extras included. The embedded binary data is stored in gltf.buffers[0].extras._pipeline.source.\n *\n * @param {Buffer} glb The glb data to parse.\n * @returns {object} A javascript object containing a glTF asset with pipeline extras included.\n *\n * @private\n */\nfunction parseGlb(glb) {\n  // Check that the magic string is present\n  const magic = getMagic(glb);\n  if (magic !== \"glTF\") {\n    throw new RuntimeError(\"File is not valid binary glTF\");\n  }\n\n  const header = readHeader(glb, 0, 5);\n  const version = header[1];\n  if (version !== 1 && version !== 2) {\n    throw new RuntimeError(\"Binary glTF version is not 1 or 2\");\n  }\n\n  if (version === 1) {\n    return parseGlbVersion1(glb, header);\n  }\n\n  return parseGlbVersion2(glb, header);\n}\n\nfunction readHeader(glb, byteOffset, count) {\n  const dataView = new DataView(glb.buffer);\n  const header = new Array(count);\n  for (let i = 0; i < count; ++i) {\n    header[i] = dataView.getUint32(\n      glb.byteOffset + byteOffset + i * sizeOfUint32,\n      true\n    );\n  }\n  return header;\n}\n\nfunction parseGlbVersion1(glb, header) {\n  const length = header[2];\n  const contentLength = header[3];\n  const contentFormat = header[4];\n\n  // Check that the content format is 0, indicating that it is JSON\n  if (contentFormat !== 0) {\n    throw new RuntimeError(\"Binary glTF scene format is not JSON\");\n  }\n\n  const jsonStart = 20;\n  const binaryStart = jsonStart + contentLength;\n\n  const contentString = getStringFromTypedArray(glb, jsonStart, contentLength);\n  const gltf = JSON.parse(contentString);\n  addPipelineExtras(gltf);\n\n  const binaryBuffer = glb.subarray(binaryStart, length);\n\n  const buffers = gltf.buffers;\n  if (defined(buffers) && Object.keys(buffers).length > 0) {\n    // In some older models, the binary glTF buffer is named KHR_binary_glTF\n    const binaryGltfBuffer = defaultValue(\n      buffers.binary_glTF,\n      buffers.KHR_binary_glTF\n    );\n    if (defined(binaryGltfBuffer)) {\n      binaryGltfBuffer.extras._pipeline.source = binaryBuffer;\n      delete binaryGltfBuffer.uri;\n    }\n  }\n  // Remove the KHR_binary_glTF extension\n  removeExtensionsUsed(gltf, \"KHR_binary_glTF\");\n  return gltf;\n}\n\nfunction parseGlbVersion2(glb, header) {\n  const length = header[2];\n  let byteOffset = 12;\n  let gltf;\n  let binaryBuffer;\n  while (byteOffset < length) {\n    const chunkHeader = readHeader(glb, byteOffset, 2);\n    const chunkLength = chunkHeader[0];\n    const chunkType = chunkHeader[1];\n    byteOffset += 8;\n    const chunkBuffer = glb.subarray(byteOffset, byteOffset + chunkLength);\n    byteOffset += chunkLength;\n    // Load JSON chunk\n    if (chunkType === 0x4e4f534a) {\n      const jsonString = getStringFromTypedArray(chunkBuffer);\n      gltf = JSON.parse(jsonString);\n      addPipelineExtras(gltf);\n    }\n    // Load Binary chunk\n    else if (chunkType === 0x004e4942) {\n      binaryBuffer = chunkBuffer;\n    }\n  }\n  if (defined(gltf) && defined(binaryBuffer)) {\n    const buffers = gltf.buffers;\n    if (defined(buffers) && buffers.length > 0) {\n      const buffer = buffers[0];\n      buffer.extras._pipeline.source = binaryBuffer;\n    }\n  }\n  return gltf;\n}\n\nexport default parseGlb;\n", "import ForEach from \"./ForEach.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Iterate through the objects within the glTF and delete their pipeline extras object.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @returns {object} glTF with no pipeline extras.\n *\n * @private\n */\nfunction removePipelineExtras(gltf) {\n  ForEach.shader(gltf, function (shader) {\n    removeExtras(shader);\n  });\n  ForEach.buffer(gltf, function (buffer) {\n    removeExtras(buffer);\n  });\n  ForEach.image(gltf, function (image) {\n    removeExtras(image);\n  });\n\n  removeExtras(gltf);\n\n  return gltf;\n}\n\nfunction removeExtras(object) {\n  if (!defined(object.extras)) {\n    return;\n  }\n\n  if (defined(object.extras._pipeline)) {\n    delete object.extras._pipeline;\n  }\n\n  if (Object.keys(object.extras).length === 0) {\n    delete object.extras;\n  }\n}\n\nexport default removePipelineExtras;\n", "import addToArray from \"./addToArray.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Adds an extension to gltf.extensionsUsed if it does not already exist.\n * Initializes extensionsUsed if it is not defined.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @param {string} extension The extension to add.\n *\n * @private\n */\nfunction addExtensionsUsed(gltf, extension) {\n  let extensionsUsed = gltf.extensionsUsed;\n  if (!defined(extensionsUsed)) {\n    extensionsUsed = [];\n    gltf.extensionsUsed = extensionsUsed;\n  }\n  addToArray(extensionsUsed, extension, true);\n}\n\nexport default addExtensionsUsed;\n", "import ComponentDatatype from \"../../Core/ComponentDatatype.js\";\n\n/**\n * Returns a function to read and convert data from a DataView into an array.\n *\n * @param {number} componentType Type to convert the data to.\n * @returns {ComponentReader} Function that reads and converts data.\n *\n * @private\n */\nfunction getComponentReader(componentType) {\n  switch (componentType) {\n    case ComponentDatatype.BYTE:\n      return function (\n        dataView,\n        byteOffset,\n        numberOfComponents,\n        componentTypeByteLength,\n        result\n      ) {\n        for (let i = 0; i < numberOfComponents; ++i) {\n          result[i] = dataView.getInt8(\n            byteOffset + i * componentTypeByteLength\n          );\n        }\n      };\n    case ComponentDatatype.UNSIGNED_BYTE:\n      return function (\n        dataView,\n        byteOffset,\n        numberOfComponents,\n        componentTypeByteLength,\n        result\n      ) {\n        for (let i = 0; i < numberOfComponents; ++i) {\n          result[i] = dataView.getUint8(\n            byteOffset + i * componentTypeByteLength\n          );\n        }\n      };\n    case ComponentDatatype.SHORT:\n      return function (\n        dataView,\n        byteOffset,\n        numberOfComponents,\n        componentTypeByteLength,\n        result\n      ) {\n        for (let i = 0; i < numberOfComponents; ++i) {\n          result[i] = dataView.getInt16(\n            byteOffset + i * componentTypeByteLength,\n            true\n          );\n        }\n      };\n    case ComponentDatatype.UNSIGNED_SHORT:\n      return function (\n        dataView,\n        byteOffset,\n        numberOfComponents,\n        componentTypeByteLength,\n        result\n      ) {\n        for (let i = 0; i < numberOfComponents; ++i) {\n          result[i] = dataView.getUint16(\n            byteOffset + i * componentTypeByteLength,\n            true\n          );\n        }\n      };\n    case ComponentDatatype.INT:\n      return function (\n        dataView,\n        byteOffset,\n        numberOfComponents,\n        componentTypeByteLength,\n        result\n      ) {\n        for (let i = 0; i < numberOfComponents; ++i) {\n          result[i] = dataView.getInt32(\n            byteOffset + i * componentTypeByteLength,\n            true\n          );\n        }\n      };\n    case ComponentDatatype.UNSIGNED_INT:\n      return function (\n        dataView,\n        byteOffset,\n        numberOfComponents,\n        componentTypeByteLength,\n        result\n      ) {\n        for (let i = 0; i < numberOfComponents; ++i) {\n          result[i] = dataView.getUint32(\n            byteOffset + i * componentTypeByteLength,\n            true\n          );\n        }\n      };\n    case ComponentDatatype.FLOAT:\n      return function (\n        dataView,\n        byteOffset,\n        numberOfComponents,\n        componentTypeByteLength,\n        result\n      ) {\n        for (let i = 0; i < numberOfComponents; ++i) {\n          result[i] = dataView.getFloat32(\n            byteOffset + i * componentTypeByteLength,\n            true\n          );\n        }\n      };\n    case ComponentDatatype.DOUBLE:\n      return function (\n        dataView,\n        byteOffset,\n        numberOfComponents,\n        componentTypeByteLength,\n        result\n      ) {\n        for (let i = 0; i < numberOfComponents; ++i) {\n          result[i] = dataView.getFloat64(\n            byteOffset + i * componentTypeByteLength,\n            true\n          );\n        }\n      };\n  }\n}\n\n/**\n * A callback function that logs messages.\n * @callback ComponentReader\n *\n * @param {DataView} dataView The data view to read from.\n * @param {number} byteOffset The byte offset applied when reading from the data view.\n * @param {number} numberOfComponents The number of components to read.\n * @param {number} componentTypeByteLength The byte length of each component.\n * @param {number} result An array storing the components that are read.\n *\n * @private\n */\n\nexport default getComponentReader;\n", "import getAccessorByteStride from \"./getAccessorByteStride.js\";\nimport getComponentReader from \"./getComponentReader.js\";\nimport numberOfComponentsForType from \"./numberOfComponentsForType.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Finds the min and max values of the accessor.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @param {object} accessor The accessor object from the glTF asset to read.\n * @returns {{min: Array, max: Array}} min holding the array of minimum values and max holding the array of maximum values.\n *\n * @private\n */\nfunction findAccessorMinMax(gltf, accessor) {\n  const bufferViews = gltf.bufferViews;\n  const buffers = gltf.buffers;\n  const bufferViewId = accessor.bufferView;\n  const numberOfComponents = numberOfComponentsForType(accessor.type);\n\n  // According to the spec, when bufferView is not defined, accessor must be initialized with zeros\n  if (!defined(accessor.bufferView)) {\n    return {\n      min: new Array(numberOfComponents).fill(0.0),\n      max: new Array(numberOfComponents).fill(0.0),\n    };\n  }\n\n  const min = new Array(numberOfComponents).fill(Number.POSITIVE_INFINITY);\n  const max = new Array(numberOfComponents).fill(Number.NEGATIVE_INFINITY);\n\n  const bufferView = bufferViews[bufferViewId];\n  const bufferId = bufferView.buffer;\n  const buffer = buffers[bufferId];\n  const source = buffer.extras._pipeline.source;\n\n  const count = accessor.count;\n  const byteStride = getAccessorByteStride(gltf, accessor);\n  let byteOffset =\n    accessor.byteOffset + bufferView.byteOffset + source.byteOffset;\n  const componentType = accessor.componentType;\n  const componentTypeByteLength =\n    ComponentDatatype.getSizeInBytes(componentType);\n  const dataView = new DataView(source.buffer);\n  const components = new Array(numberOfComponents);\n  const componentReader = getComponentReader(componentType);\n\n  for (let i = 0; i < count; i++) {\n    componentReader(\n      dataView,\n      byteOffset,\n      numberOfComponents,\n      componentTypeByteLength,\n      components\n    );\n    for (let j = 0; j < numberOfComponents; j++) {\n      const value = components[j];\n      min[j] = Math.min(min[j], value);\n      max[j] = Math.max(max[j], value);\n    }\n    byteOffset += byteStride;\n  }\n\n  return {\n    min: min,\n    max: max,\n  };\n}\n\nexport default findAccessorMinMax;\n", "import addExtensionsUsed from \"./addExtensionsUsed.js\";\nimport ForEach from \"./ForEach.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport WebGLConstants from \"../../Core/WebGLConstants.js\";\n\nconst defaultBlendEquation = [WebGLConstants.FUNC_ADD, WebGLConstants.FUNC_ADD];\n\nconst defaultBlendFactors = [\n  WebGLConstants.ONE,\n  WebGLConstants.ZERO,\n  WebGLConstants.ONE,\n  WebGLConstants.ZERO,\n];\n\nfunction isStateEnabled(renderStates, state) {\n  const enabled = renderStates.enable;\n  if (!defined(enabled)) {\n    return false;\n  }\n\n  return enabled.indexOf(state) > -1;\n}\n\nconst supportedBlendFactors = [\n  WebGLConstants.ZERO,\n  WebGLConstants.ONE,\n  WebGLConstants.SRC_COLOR,\n  WebGLConstants.ONE_MINUS_SRC_COLOR,\n  WebGLConstants.SRC_ALPHA,\n  WebGLConstants.ONE_MINUS_SRC_ALPHA,\n  WebGLConstants.DST_ALPHA,\n  WebGLConstants.ONE_MINUS_DST_ALPHA,\n  WebGLConstants.DST_COLOR,\n  WebGLConstants.ONE_MINUS_DST_COLOR,\n];\n\n// If any of the blend factors are not supported, return the default\nfunction getSupportedBlendFactors(value, defaultValue) {\n  if (!defined(value)) {\n    return defaultValue;\n  }\n\n  for (let i = 0; i < 4; i++) {\n    if (supportedBlendFactors.indexOf(value[i]) === -1) {\n      return defaultValue;\n    }\n  }\n\n  return value;\n}\n\n/**\n * Move glTF 1.0 technique render states to glTF 2.0 materials properties and KHR_blend extension.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @returns {object} The updated glTF asset.\n *\n * @private\n */\nfunction moveTechniqueRenderStates(gltf) {\n  const blendingForTechnique = {};\n  const materialPropertiesForTechnique = {};\n  const techniquesLegacy = gltf.techniques;\n  if (!defined(techniquesLegacy)) {\n    return gltf;\n  }\n\n  ForEach.technique(gltf, function (techniqueLegacy, techniqueIndex) {\n    const renderStates = techniqueLegacy.states;\n    if (defined(renderStates)) {\n      const materialProperties = (materialPropertiesForTechnique[\n        techniqueIndex\n      ] = {});\n\n      // If BLEND is enabled, the material should have alpha mode BLEND\n      if (isStateEnabled(renderStates, WebGLConstants.BLEND)) {\n        materialProperties.alphaMode = \"BLEND\";\n\n        const blendFunctions = renderStates.functions;\n        if (\n          defined(blendFunctions) &&\n          (defined(blendFunctions.blendEquationSeparate) ||\n            defined(blendFunctions.blendFuncSeparate))\n        ) {\n          blendingForTechnique[techniqueIndex] = {\n            blendEquation: defaultValue(\n              blendFunctions.blendEquationSeparate,\n              defaultBlendEquation\n            ),\n            blendFactors: getSupportedBlendFactors(\n              blendFunctions.blendFuncSeparate,\n              defaultBlendFactors\n            ),\n          };\n        }\n      }\n\n      // If CULL_FACE is not enabled, the material should be doubleSided\n      if (!isStateEnabled(renderStates, WebGLConstants.CULL_FACE)) {\n        materialProperties.doubleSided = true;\n      }\n\n      delete techniqueLegacy.states;\n    }\n  });\n\n  if (Object.keys(blendingForTechnique).length > 0) {\n    if (!defined(gltf.extensions)) {\n      gltf.extensions = {};\n    }\n\n    addExtensionsUsed(gltf, \"KHR_blend\");\n  }\n\n  ForEach.material(gltf, function (material) {\n    if (defined(material.technique)) {\n      const materialProperties =\n        materialPropertiesForTechnique[material.technique];\n      ForEach.objectLegacy(materialProperties, function (value, property) {\n        material[property] = value;\n      });\n\n      const blending = blendingForTechnique[material.technique];\n      if (defined(blending)) {\n        if (!defined(material.extensions)) {\n          material.extensions = {};\n        }\n\n        material.extensions.KHR_blend = blending;\n      }\n    }\n  });\n\n  return gltf;\n}\n\nexport default moveTechniqueRenderStates;\n", "import addExtensionsUsed from \"./addExtensionsUsed.js\";\nimport addToArray from \"./addToArray.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Adds an extension to gltf.extensionsRequired if it does not already exist.\n * Initializes extensionsRequired if it is not defined.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @param {string} extension The extension to add.\n *\n * @private\n */\nfunction addExtensionsRequired(gltf, extension) {\n  let extensionsRequired = gltf.extensionsRequired;\n  if (!defined(extensionsRequired)) {\n    extensionsRequired = [];\n    gltf.extensionsRequired = extensionsRequired;\n  }\n  addToArray(extensionsRequired, extension, true);\n  addExtensionsUsed(gltf, extension);\n}\n\nexport default addExtensionsRequired;\n", "import addExtensionsUsed from \"./addExtensionsUsed.js\";\nimport addExtensionsRequired from \"./addExtensionsRequired.js\";\nimport addToArray from \"./addToArray.js\";\nimport ForEach from \"./ForEach.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Move glTF 1.0 material techniques to glTF 2.0 KHR_techniques_webgl extension.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @returns {object} The updated glTF asset.\n *\n * @private\n */\nfunction moveTechniquesToExtension(gltf) {\n  const techniquesLegacy = gltf.techniques;\n  const mappedUniforms = {};\n  const updatedTechniqueIndices = {};\n  const seenPrograms = {};\n  if (defined(techniquesLegacy)) {\n    const extension = {\n      programs: [],\n      shaders: [],\n      techniques: [],\n    };\n\n    // Some 1.1 models have a glExtensionsUsed property that can be transferred to program.glExtensions\n    const glExtensions = gltf.glExtensionsUsed;\n    delete gltf.glExtensionsUsed;\n\n    ForEach.technique(gltf, function (techniqueLegacy, techniqueId) {\n      const technique = {\n        name: techniqueLegacy.name,\n        program: undefined,\n        attributes: {},\n        uniforms: {},\n      };\n\n      let parameterLegacy;\n      ForEach.techniqueAttribute(\n        techniqueLegacy,\n        function (parameterName, attributeName) {\n          parameterLegacy = techniqueLegacy.parameters[parameterName];\n          technique.attributes[attributeName] = {\n            semantic: parameterLegacy.semantic,\n          };\n        }\n      );\n\n      ForEach.techniqueUniform(\n        techniqueLegacy,\n        function (parameterName, uniformName) {\n          parameterLegacy = techniqueLegacy.parameters[parameterName];\n          technique.uniforms[uniformName] = {\n            count: parameterLegacy.count,\n            node: parameterLegacy.node,\n            type: parameterLegacy.type,\n            semantic: parameterLegacy.semantic,\n            value: parameterLegacy.value,\n          };\n\n          // Store the name of the uniform to update material values.\n          if (!defined(mappedUniforms[techniqueId])) {\n            mappedUniforms[techniqueId] = {};\n          }\n          mappedUniforms[techniqueId][parameterName] = uniformName;\n        }\n      );\n\n      if (!defined(seenPrograms[techniqueLegacy.program])) {\n        const programLegacy = gltf.programs[techniqueLegacy.program];\n\n        const program = {\n          name: programLegacy.name,\n          fragmentShader: undefined,\n          vertexShader: undefined,\n          glExtensions: glExtensions,\n        };\n\n        const fs = gltf.shaders[programLegacy.fragmentShader];\n        program.fragmentShader = addToArray(extension.shaders, fs, true);\n\n        const vs = gltf.shaders[programLegacy.vertexShader];\n        program.vertexShader = addToArray(extension.shaders, vs, true);\n\n        technique.program = addToArray(extension.programs, program);\n        seenPrograms[techniqueLegacy.program] = technique.program;\n      } else {\n        technique.program = seenPrograms[techniqueLegacy.program];\n      }\n\n      // Store the index of the new technique to reference instead.\n      updatedTechniqueIndices[techniqueId] = addToArray(\n        extension.techniques,\n        technique\n      );\n    });\n\n    if (extension.techniques.length > 0) {\n      if (!defined(gltf.extensions)) {\n        gltf.extensions = {};\n      }\n\n      gltf.extensions.KHR_techniques_webgl = extension;\n      addExtensionsUsed(gltf, \"KHR_techniques_webgl\");\n      addExtensionsRequired(gltf, \"KHR_techniques_webgl\");\n    }\n  }\n\n  ForEach.material(gltf, function (material) {\n    if (defined(material.technique)) {\n      const materialExtension = {\n        technique: updatedTechniqueIndices[material.technique],\n      };\n\n      ForEach.objectLegacy(material.values, function (value, parameterName) {\n        if (!defined(materialExtension.values)) {\n          materialExtension.values = {};\n        }\n\n        const uniformName = mappedUniforms[material.technique][parameterName];\n        if (defined(uniformName)) {\n          materialExtension.values[uniformName] = value;\n        }\n      });\n\n      if (!defined(material.extensions)) {\n        material.extensions = {};\n      }\n\n      material.extensions.KHR_techniques_webgl = materialExtension;\n    }\n\n    delete material.technique;\n    delete material.values;\n  });\n\n  delete gltf.techniques;\n  delete gltf.programs;\n  delete gltf.shaders;\n\n  return gltf;\n}\n\nexport default moveTechniquesToExtension;\n", "import ForEach from \"./ForEach.js\";\nimport Check from \"../../Core/Check.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Calls the provider handler function on each texture used by the material.\n * Mimics the behavior of functions in gltf-pipeline ForEach.\n * @param {object} material The glTF material.\n * @param {forEachTextureInMaterial~handler} handler Function that is called for each texture in the material.\n *\n * @private\n */\nfunction forEachTextureInMaterial(material, handler) {\n  Check.typeOf.object(\"material\", material);\n  Check.defined(\"handler\", handler);\n\n  // Metallic roughness\n  const pbrMetallicRoughness = material.pbrMetallicRoughness;\n  if (defined(pbrMetallicRoughness)) {\n    if (defined(pbrMetallicRoughness.baseColorTexture)) {\n      const textureInfo = pbrMetallicRoughness.baseColorTexture;\n      const value = handler(textureInfo.index, textureInfo);\n      if (defined(value)) {\n        return value;\n      }\n    }\n    if (defined(pbrMetallicRoughness.metallicRoughnessTexture)) {\n      const textureInfo = pbrMetallicRoughness.metallicRoughnessTexture;\n      const value = handler(textureInfo.index, textureInfo);\n      if (defined(value)) {\n        return value;\n      }\n    }\n  }\n\n  if (defined(material.extensions)) {\n    // Spec gloss extension\n    const pbrSpecularGlossiness =\n      material.extensions.KHR_materials_pbrSpecularGlossiness;\n    if (defined(pbrSpecularGlossiness)) {\n      if (defined(pbrSpecularGlossiness.diffuseTexture)) {\n        const textureInfo = pbrSpecularGlossiness.diffuseTexture;\n        const value = handler(textureInfo.index, textureInfo);\n        if (defined(value)) {\n          return value;\n        }\n      }\n      if (defined(pbrSpecularGlossiness.specularGlossinessTexture)) {\n        const textureInfo = pbrSpecularGlossiness.specularGlossinessTexture;\n        const value = handler(textureInfo.index, textureInfo);\n        if (defined(value)) {\n          return value;\n        }\n      }\n    }\n\n    // Materials common extension (may be present in models converted from glTF 1.0)\n    const materialsCommon = material.extensions.KHR_materials_common;\n    if (defined(materialsCommon) && defined(materialsCommon.values)) {\n      const diffuse = materialsCommon.values.diffuse;\n      const ambient = materialsCommon.values.ambient;\n      const emission = materialsCommon.values.emission;\n      const specular = materialsCommon.values.specular;\n      if (defined(diffuse) && defined(diffuse.index)) {\n        const value = handler(diffuse.index, diffuse);\n        if (defined(value)) {\n          return value;\n        }\n      }\n      if (defined(ambient) && defined(ambient.index)) {\n        const value = handler(ambient.index, ambient);\n        if (defined(value)) {\n          return value;\n        }\n      }\n      if (defined(emission) && defined(emission.index)) {\n        const value = handler(emission.index, emission);\n        if (defined(value)) {\n          return value;\n        }\n      }\n      if (defined(specular) && defined(specular.index)) {\n        const value = handler(specular.index, specular);\n        if (defined(value)) {\n          return value;\n        }\n      }\n    }\n  }\n\n  // KHR_techniques_webgl extension\n  const value = ForEach.materialValue(material, function (materialValue) {\n    if (defined(materialValue.index)) {\n      const value = handler(materialValue.index, materialValue);\n      if (defined(value)) {\n        return value;\n      }\n    }\n  });\n  if (defined(value)) {\n    return value;\n  }\n\n  // Top level textures\n  if (defined(material.emissiveTexture)) {\n    const textureInfo = material.emissiveTexture;\n    const value = handler(textureInfo.index, textureInfo);\n    if (defined(value)) {\n      return value;\n    }\n  }\n\n  if (defined(material.normalTexture)) {\n    const textureInfo = material.normalTexture;\n    const value = handler(textureInfo.index, textureInfo);\n    if (defined(value)) {\n      return value;\n    }\n  }\n\n  if (defined(material.occlusionTexture)) {\n    const textureInfo = material.occlusionTexture;\n    const value = handler(textureInfo.index, textureInfo);\n    if (defined(value)) {\n      return value;\n    }\n  }\n}\n\n/**\n * Function that is called for each texture in the material. If this function returns a value the for each stops and returns that value.\n * @callback forEachTextureInMaterial~handler\n * @param {number} The texture index.\n * @param {object} The texture info object.\n *\n * @private\n */\n\nexport default forEachTextureInMaterial;\n", "import ForEach from \"./ForEach.js\";\nimport forEachTextureInMaterial from \"./forEachTextureInMaterial.js\";\nimport usesExtension from \"./usesExtension.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\n\nconst allElementTypes = [\n  \"mesh\",\n  \"node\",\n  \"material\",\n  \"accessor\",\n  \"bufferView\",\n  \"buffer\",\n  \"texture\",\n  \"sampler\",\n  \"image\",\n];\n\n/**\n * Removes unused elements from gltf.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @param {string[]} [elementTypes=['mesh', 'node', 'material', 'accessor', 'bufferView', 'buffer']] Element types to be removed. Needs to be a subset of ['mesh', 'node', 'material', 'accessor', 'bufferView', 'buffer'], other items will be ignored.\n *\n * @private\n */\nfunction removeUnusedElements(gltf, elementTypes) {\n  elementTypes = defaultValue(elementTypes, allElementTypes);\n  allElementTypes.forEach(function (type) {\n    if (elementTypes.indexOf(type) > -1) {\n      removeUnusedElementsByType(gltf, type);\n    }\n  });\n  return gltf;\n}\n\nconst TypeToGltfElementName = {\n  accessor: \"accessors\",\n  buffer: \"buffers\",\n  bufferView: \"bufferViews\",\n  image: \"images\",\n  node: \"nodes\",\n  material: \"materials\",\n  mesh: \"meshes\",\n  sampler: \"samplers\",\n  texture: \"textures\",\n};\n\nfunction removeUnusedElementsByType(gltf, type) {\n  const name = TypeToGltfElementName[type];\n  const arrayOfObjects = gltf[name];\n\n  if (defined(arrayOfObjects)) {\n    let removed = 0;\n    const usedIds = getListOfElementsIdsInUse[type](gltf);\n    const length = arrayOfObjects.length;\n\n    for (let i = 0; i < length; ++i) {\n      if (!usedIds[i]) {\n        Remove[type](gltf, i - removed);\n        removed++;\n      }\n    }\n  }\n}\n\n/**\n * Contains functions for removing elements from a glTF hierarchy.\n * Since top-level glTF elements are arrays, when something is removed, referring\n * indices need to be updated.\n * @constructor\n *\n * @private\n */\nfunction Remove() {}\n\nRemove.accessor = function (gltf, accessorId) {\n  const accessors = gltf.accessors;\n\n  accessors.splice(accessorId, 1);\n\n  ForEach.mesh(gltf, function (mesh) {\n    ForEach.meshPrimitive(mesh, function (primitive) {\n      // Update accessor ids for the primitives.\n      ForEach.meshPrimitiveAttribute(\n        primitive,\n        function (attributeAccessorId, semantic) {\n          if (attributeAccessorId > accessorId) {\n            primitive.attributes[semantic]--;\n          }\n        }\n      );\n\n      // Update accessor ids for the targets.\n      ForEach.meshPrimitiveTarget(primitive, function (target) {\n        ForEach.meshPrimitiveTargetAttribute(\n          target,\n          function (attributeAccessorId, semantic) {\n            if (attributeAccessorId > accessorId) {\n              target[semantic]--;\n            }\n          }\n        );\n      });\n      const indices = primitive.indices;\n      if (defined(indices) && indices > accessorId) {\n        primitive.indices--;\n      }\n\n      const ext = primitive.extensions;\n      if (\n        defined(ext) &&\n        defined(ext.CESIUM_primitive_outline) &&\n        ext.CESIUM_primitive_outline.indices > accessorId\n      ) {\n        --ext.CESIUM_primitive_outline.indices;\n      }\n    });\n  });\n\n  ForEach.skin(gltf, function (skin) {\n    if (\n      defined(skin.inverseBindMatrices) &&\n      skin.inverseBindMatrices > accessorId\n    ) {\n      skin.inverseBindMatrices--;\n    }\n  });\n\n  ForEach.animation(gltf, function (animation) {\n    ForEach.animationSampler(animation, function (sampler) {\n      if (defined(sampler.input) && sampler.input > accessorId) {\n        sampler.input--;\n      }\n      if (defined(sampler.output) && sampler.output > accessorId) {\n        sampler.output--;\n      }\n    });\n  });\n};\n\nRemove.buffer = function (gltf, bufferId) {\n  const buffers = gltf.buffers;\n\n  buffers.splice(bufferId, 1);\n\n  ForEach.bufferView(gltf, function (bufferView) {\n    if (defined(bufferView.buffer) && bufferView.buffer > bufferId) {\n      bufferView.buffer--;\n    }\n\n    if (\n      defined(bufferView.extensions) &&\n      defined(bufferView.extensions.EXT_meshopt_compression)\n    ) {\n      bufferView.extensions.EXT_meshopt_compression.buffer--;\n    }\n  });\n};\n\nRemove.bufferView = function (gltf, bufferViewId) {\n  const bufferViews = gltf.bufferViews;\n\n  bufferViews.splice(bufferViewId, 1);\n\n  ForEach.accessor(gltf, function (accessor) {\n    if (defined(accessor.bufferView) && accessor.bufferView > bufferViewId) {\n      accessor.bufferView--;\n    }\n  });\n\n  ForEach.shader(gltf, function (shader) {\n    if (defined(shader.bufferView) && shader.bufferView > bufferViewId) {\n      shader.bufferView--;\n    }\n  });\n\n  ForEach.image(gltf, function (image) {\n    if (defined(image.bufferView) && image.bufferView > bufferViewId) {\n      image.bufferView--;\n    }\n  });\n\n  if (usesExtension(gltf, \"KHR_draco_mesh_compression\")) {\n    ForEach.mesh(gltf, function (mesh) {\n      ForEach.meshPrimitive(mesh, function (primitive) {\n        if (\n          defined(primitive.extensions) &&\n          defined(primitive.extensions.KHR_draco_mesh_compression)\n        ) {\n          if (\n            primitive.extensions.KHR_draco_mesh_compression.bufferView >\n            bufferViewId\n          ) {\n            primitive.extensions.KHR_draco_mesh_compression.bufferView--;\n          }\n        }\n      });\n    });\n  }\n\n  if (usesExtension(gltf, \"EXT_feature_metadata\")) {\n    const extension = gltf.extensions.EXT_feature_metadata;\n    const featureTables = extension.featureTables;\n    for (const featureTableId in featureTables) {\n      if (featureTables.hasOwnProperty(featureTableId)) {\n        const featureTable = featureTables[featureTableId];\n        const properties = featureTable.properties;\n        if (defined(properties)) {\n          for (const propertyId in properties) {\n            if (properties.hasOwnProperty(propertyId)) {\n              const property = properties[propertyId];\n              if (\n                defined(property.bufferView) &&\n                property.bufferView > bufferViewId\n              ) {\n                property.bufferView--;\n              }\n              if (\n                defined(property.arrayOffsetBufferView) &&\n                property.arrayOffsetBufferView > bufferViewId\n              ) {\n                property.arrayOffsetBufferView--;\n              }\n              if (\n                defined(property.stringOffsetBufferView) &&\n                property.stringOffsetBufferView > bufferViewId\n              ) {\n                property.stringOffsetBufferView--;\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n\n  if (usesExtension(gltf, \"EXT_structural_metadata\")) {\n    const extension = gltf.extensions.EXT_structural_metadata;\n    const propertyTables = extension.propertyTables;\n    if (defined(propertyTables)) {\n      const propertyTablesLength = propertyTables.length;\n      for (let i = 0; i < propertyTablesLength; ++i) {\n        const propertyTable = propertyTables[i];\n        const properties = propertyTable.properties;\n        for (const propertyId in properties) {\n          if (properties.hasOwnProperty(propertyId)) {\n            const property = properties[propertyId];\n            if (defined(property.values) && property.values > bufferViewId) {\n              property.values--;\n            }\n            if (\n              defined(property.arrayOffsets) &&\n              property.arrayOffsets > bufferViewId\n            ) {\n              property.arrayOffsets--;\n            }\n            if (\n              defined(property.stringOffsets) &&\n              property.stringOffsets > bufferViewId\n            ) {\n              property.stringOffsets--;\n            }\n          }\n        }\n      }\n    }\n  }\n};\n\nRemove.image = function (gltf, imageId) {\n  const images = gltf.images;\n  images.splice(imageId, 1);\n\n  ForEach.texture(gltf, function (texture) {\n    if (defined(texture.source)) {\n      if (texture.source > imageId) {\n        --texture.source;\n      }\n    }\n    const ext = texture.extensions;\n    if (\n      defined(ext) &&\n      defined(ext.EXT_texture_webp) &&\n      ext.EXT_texture_webp.source > imageId\n    ) {\n      --texture.extensions.EXT_texture_webp.source;\n    } else if (\n      defined(ext) &&\n      defined(ext.KHR_texture_basisu) &&\n      ext.KHR_texture_basisu.source > imageId\n    ) {\n      --texture.extensions.KHR_texture_basisu.source;\n    }\n  });\n};\n\nRemove.mesh = function (gltf, meshId) {\n  const meshes = gltf.meshes;\n  meshes.splice(meshId, 1);\n\n  ForEach.node(gltf, function (node) {\n    if (defined(node.mesh)) {\n      if (node.mesh > meshId) {\n        node.mesh--;\n      } else if (node.mesh === meshId) {\n        // Remove reference to deleted mesh\n        delete node.mesh;\n      }\n    }\n  });\n};\n\nRemove.node = function (gltf, nodeId) {\n  const nodes = gltf.nodes;\n  nodes.splice(nodeId, 1);\n\n  // Shift all node references\n  ForEach.skin(gltf, function (skin) {\n    if (defined(skin.skeleton) && skin.skeleton > nodeId) {\n      skin.skeleton--;\n    }\n\n    skin.joints = skin.joints.map(function (x) {\n      return x > nodeId ? x - 1 : x;\n    });\n  });\n  ForEach.animation(gltf, function (animation) {\n    ForEach.animationChannel(animation, function (channel) {\n      if (\n        defined(channel.target) &&\n        defined(channel.target.node) &&\n        channel.target.node > nodeId\n      ) {\n        channel.target.node--;\n      }\n    });\n  });\n  ForEach.technique(gltf, function (technique) {\n    ForEach.techniqueUniform(technique, function (uniform) {\n      if (defined(uniform.node) && uniform.node > nodeId) {\n        uniform.node--;\n      }\n    });\n  });\n  ForEach.node(gltf, function (node) {\n    if (!defined(node.children)) {\n      return;\n    }\n\n    node.children = node.children\n      .filter(function (x) {\n        return x !== nodeId; // Remove\n      })\n      .map(function (x) {\n        return x > nodeId ? x - 1 : x; // Shift indices\n      });\n  });\n  ForEach.scene(gltf, function (scene) {\n    scene.nodes = scene.nodes\n      .filter(function (x) {\n        return x !== nodeId; // Remove\n      })\n      .map(function (x) {\n        return x > nodeId ? x - 1 : x; // Shift indices\n      });\n  });\n};\n\nRemove.material = function (gltf, materialId) {\n  const materials = gltf.materials;\n  materials.splice(materialId, 1);\n\n  // Shift other material ids\n  ForEach.mesh(gltf, function (mesh) {\n    ForEach.meshPrimitive(mesh, function (primitive) {\n      if (defined(primitive.material) && primitive.material > materialId) {\n        primitive.material--;\n      }\n    });\n  });\n};\n\nRemove.sampler = function (gltf, samplerId) {\n  const samplers = gltf.samplers;\n  samplers.splice(samplerId, 1);\n\n  ForEach.texture(gltf, function (texture) {\n    if (defined(texture.sampler)) {\n      if (texture.sampler > samplerId) {\n        --texture.sampler;\n      }\n    }\n  });\n};\n\nRemove.texture = function (gltf, textureId) {\n  const textures = gltf.textures;\n  textures.splice(textureId, 1);\n\n  ForEach.material(gltf, function (material) {\n    forEachTextureInMaterial(material, function (textureIndex, textureInfo) {\n      if (textureInfo.index > textureId) {\n        --textureInfo.index;\n      }\n    });\n  });\n\n  if (usesExtension(gltf, \"EXT_feature_metadata\")) {\n    ForEach.mesh(gltf, function (mesh) {\n      ForEach.meshPrimitive(mesh, function (primitive) {\n        const extensions = primitive.extensions;\n        if (defined(extensions) && defined(extensions.EXT_feature_metadata)) {\n          const extension = extensions.EXT_feature_metadata;\n          const featureIdTextures = extension.featureIdTextures;\n          if (defined(featureIdTextures)) {\n            const featureIdTexturesLength = featureIdTextures.length;\n            for (let i = 0; i < featureIdTexturesLength; ++i) {\n              const featureIdTexture = featureIdTextures[i];\n              const textureInfo = featureIdTexture.featureIds.texture;\n              if (textureInfo.index > textureId) {\n                --textureInfo.index;\n              }\n            }\n          }\n        }\n      });\n    });\n\n    const extension = gltf.extensions.EXT_feature_metadata;\n    const featureTextures = extension.featureTextures;\n    for (const featureTextureId in featureTextures) {\n      if (featureTextures.hasOwnProperty(featureTextureId)) {\n        const featureTexture = featureTextures[featureTextureId];\n        const properties = featureTexture.properties;\n        if (defined(properties)) {\n          for (const propertyId in properties) {\n            if (properties.hasOwnProperty(propertyId)) {\n              const property = properties[propertyId];\n              const textureInfo = property.texture;\n              if (textureInfo.index > textureId) {\n                --textureInfo.index;\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n\n  if (usesExtension(gltf, \"EXT_mesh_features\")) {\n    ForEach.mesh(gltf, function (mesh) {\n      ForEach.meshPrimitive(mesh, function (primitive) {\n        const extensions = primitive.extensions;\n        if (defined(extensions) && defined(extensions.EXT_mesh_features)) {\n          const extension = extensions.EXT_mesh_features;\n          const featureIds = extension.featureIds;\n          if (defined(featureIds)) {\n            const featureIdsLength = featureIds.length;\n            for (let i = 0; i < featureIdsLength; ++i) {\n              const featureId = featureIds[i];\n              if (defined(featureId.texture)) {\n                if (featureId.texture.index > textureId) {\n                  --featureId.texture.index;\n                }\n              }\n            }\n          }\n        }\n      });\n    });\n  }\n\n  if (usesExtension(gltf, \"EXT_structural_metadata\")) {\n    const extension = gltf.extensions.EXT_structural_metadata;\n    const propertyTextures = extension.propertyTextures;\n    if (defined(propertyTextures)) {\n      const propertyTexturesLength = propertyTextures.length;\n      for (let i = 0; i < propertyTexturesLength; ++i) {\n        const propertyTexture = propertyTextures[i];\n        const properties = propertyTexture.properties;\n        for (const propertyId in properties) {\n          if (properties.hasOwnProperty(propertyId)) {\n            const property = properties[propertyId];\n            if (property.index > textureId) {\n              --property.index;\n            }\n          }\n        }\n      }\n    }\n  }\n};\n\n/**\n * Contains functions for getting a list of element ids in use by the glTF asset.\n * @constructor\n *\n * @private\n */\nfunction getListOfElementsIdsInUse() {}\n\ngetListOfElementsIdsInUse.accessor = function (gltf) {\n  // Calculate accessor's that are currently in use.\n  const usedAccessorIds = {};\n\n  ForEach.mesh(gltf, function (mesh) {\n    ForEach.meshPrimitive(mesh, function (primitive) {\n      ForEach.meshPrimitiveAttribute(primitive, function (accessorId) {\n        usedAccessorIds[accessorId] = true;\n      });\n      ForEach.meshPrimitiveTarget(primitive, function (target) {\n        ForEach.meshPrimitiveTargetAttribute(target, function (accessorId) {\n          usedAccessorIds[accessorId] = true;\n        });\n      });\n      const indices = primitive.indices;\n      if (defined(indices)) {\n        usedAccessorIds[indices] = true;\n      }\n    });\n  });\n\n  ForEach.skin(gltf, function (skin) {\n    if (defined(skin.inverseBindMatrices)) {\n      usedAccessorIds[skin.inverseBindMatrices] = true;\n    }\n  });\n\n  ForEach.animation(gltf, function (animation) {\n    ForEach.animationSampler(animation, function (sampler) {\n      if (defined(sampler.input)) {\n        usedAccessorIds[sampler.input] = true;\n      }\n      if (defined(sampler.output)) {\n        usedAccessorIds[sampler.output] = true;\n      }\n    });\n  });\n\n  if (usesExtension(gltf, \"EXT_mesh_gpu_instancing\")) {\n    ForEach.node(gltf, function (node) {\n      if (\n        defined(node.extensions) &&\n        defined(node.extensions.EXT_mesh_gpu_instancing)\n      ) {\n        Object.keys(node.extensions.EXT_mesh_gpu_instancing.attributes).forEach(\n          function (key) {\n            const attributeAccessorId =\n              node.extensions.EXT_mesh_gpu_instancing.attributes[key];\n            usedAccessorIds[attributeAccessorId] = true;\n          }\n        );\n      }\n    });\n  }\n\n  if (usesExtension(gltf, \"CESIUM_primitive_outline\")) {\n    ForEach.mesh(gltf, function (mesh) {\n      ForEach.meshPrimitive(mesh, function (primitive) {\n        const extensions = primitive.extensions;\n        if (\n          defined(extensions) &&\n          defined(extensions.CESIUM_primitive_outline)\n        ) {\n          const extension = extensions.CESIUM_primitive_outline;\n          const indicesAccessorId = extension.indices;\n          if (defined(indicesAccessorId)) {\n            usedAccessorIds[indicesAccessorId] = true;\n          }\n        }\n      });\n    });\n  }\n\n  return usedAccessorIds;\n};\n\ngetListOfElementsIdsInUse.buffer = function (gltf) {\n  // Calculate buffer's that are currently in use.\n  const usedBufferIds = {};\n\n  ForEach.bufferView(gltf, function (bufferView) {\n    if (defined(bufferView.buffer)) {\n      usedBufferIds[bufferView.buffer] = true;\n    }\n    if (\n      defined(bufferView.extensions) &&\n      defined(bufferView.extensions.EXT_meshopt_compression)\n    ) {\n      usedBufferIds[\n        bufferView.extensions.EXT_meshopt_compression.buffer\n      ] = true;\n    }\n  });\n\n  return usedBufferIds;\n};\n\ngetListOfElementsIdsInUse.bufferView = function (gltf) {\n  // Calculate bufferView's that are currently in use.\n  const usedBufferViewIds = {};\n\n  ForEach.accessor(gltf, function (accessor) {\n    if (defined(accessor.bufferView)) {\n      usedBufferViewIds[accessor.bufferView] = true;\n    }\n  });\n\n  ForEach.shader(gltf, function (shader) {\n    if (defined(shader.bufferView)) {\n      usedBufferViewIds[shader.bufferView] = true;\n    }\n  });\n\n  ForEach.image(gltf, function (image) {\n    if (defined(image.bufferView)) {\n      usedBufferViewIds[image.bufferView] = true;\n    }\n  });\n\n  if (usesExtension(gltf, \"KHR_draco_mesh_compression\")) {\n    ForEach.mesh(gltf, function (mesh) {\n      ForEach.meshPrimitive(mesh, function (primitive) {\n        if (\n          defined(primitive.extensions) &&\n          defined(primitive.extensions.KHR_draco_mesh_compression)\n        ) {\n          usedBufferViewIds[\n            primitive.extensions.KHR_draco_mesh_compression.bufferView\n          ] = true;\n        }\n      });\n    });\n  }\n\n  if (usesExtension(gltf, \"EXT_feature_metadata\")) {\n    const extension = gltf.extensions.EXT_feature_metadata;\n    const featureTables = extension.featureTables;\n    for (const featureTableId in featureTables) {\n      if (featureTables.hasOwnProperty(featureTableId)) {\n        const featureTable = featureTables[featureTableId];\n        const properties = featureTable.properties;\n        if (defined(properties)) {\n          for (const propertyId in properties) {\n            if (properties.hasOwnProperty(propertyId)) {\n              const property = properties[propertyId];\n              if (defined(property.bufferView)) {\n                usedBufferViewIds[property.bufferView] = true;\n              }\n              if (defined(property.arrayOffsetBufferView)) {\n                usedBufferViewIds[property.arrayOffsetBufferView] = true;\n              }\n              if (defined(property.stringOffsetBufferView)) {\n                usedBufferViewIds[property.stringOffsetBufferView] = true;\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n\n  if (usesExtension(gltf, \"EXT_structural_metadata\")) {\n    const extension = gltf.extensions.EXT_structural_metadata;\n    const propertyTables = extension.propertyTables;\n    if (defined(propertyTables)) {\n      const propertyTablesLength = propertyTables.length;\n      for (let i = 0; i < propertyTablesLength; ++i) {\n        const propertyTable = propertyTables[i];\n        const properties = propertyTable.properties;\n        for (const propertyId in properties) {\n          if (properties.hasOwnProperty(propertyId)) {\n            const property = properties[propertyId];\n            if (defined(property.values)) {\n              usedBufferViewIds[property.values] = true;\n            }\n            if (defined(property.arrayOffsets)) {\n              usedBufferViewIds[property.arrayOffsets] = true;\n            }\n            if (defined(property.stringOffsets)) {\n              usedBufferViewIds[property.stringOffsets] = true;\n            }\n          }\n        }\n      }\n    }\n  }\n\n  return usedBufferViewIds;\n};\n\ngetListOfElementsIdsInUse.image = function (gltf) {\n  const usedImageIds = {};\n\n  ForEach.texture(gltf, function (texture) {\n    if (defined(texture.source)) {\n      usedImageIds[texture.source] = true;\n    }\n\n    if (\n      defined(texture.extensions) &&\n      defined(texture.extensions.EXT_texture_webp)\n    ) {\n      usedImageIds[texture.extensions.EXT_texture_webp.source] = true;\n    } else if (\n      defined(texture.extensions) &&\n      defined(texture.extensions.KHR_texture_basisu)\n    ) {\n      usedImageIds[texture.extensions.KHR_texture_basisu.source] = true;\n    }\n  });\n  return usedImageIds;\n};\n\ngetListOfElementsIdsInUse.mesh = function (gltf) {\n  const usedMeshIds = {};\n  ForEach.node(gltf, function (node) {\n    if (defined(node.mesh && defined(gltf.meshes))) {\n      const mesh = gltf.meshes[node.mesh];\n      if (\n        defined(mesh) &&\n        defined(mesh.primitives) &&\n        mesh.primitives.length > 0\n      ) {\n        usedMeshIds[node.mesh] = true;\n      }\n    }\n  });\n\n  return usedMeshIds;\n};\n\n// Check if node is empty. It is considered empty if neither referencing\n// mesh, camera, extensions and has no children\nfunction nodeIsEmpty(gltf, nodeId, usedNodeIds) {\n  const node = gltf.nodes[nodeId];\n  if (\n    defined(node.mesh) ||\n    defined(node.camera) ||\n    defined(node.skin) ||\n    defined(node.weights) ||\n    defined(node.extras) ||\n    (defined(node.extensions) && Object.keys(node.extensions).length !== 0) ||\n    defined(usedNodeIds[nodeId])\n  ) {\n    return false;\n  }\n\n  // Empty if no children or children are all empty nodes\n  return (\n    !defined(node.children) ||\n    node.children.filter(function (n) {\n      return !nodeIsEmpty(gltf, n, usedNodeIds);\n    }).length === 0\n  );\n}\n\ngetListOfElementsIdsInUse.node = function (gltf) {\n  const usedNodeIds = {};\n  ForEach.skin(gltf, function (skin) {\n    if (defined(skin.skeleton)) {\n      usedNodeIds[skin.skeleton] = true;\n    }\n\n    ForEach.skinJoint(skin, function (joint) {\n      usedNodeIds[joint] = true;\n    });\n  });\n  ForEach.animation(gltf, function (animation) {\n    ForEach.animationChannel(animation, function (channel) {\n      if (defined(channel.target) && defined(channel.target.node)) {\n        usedNodeIds[channel.target.node] = true;\n      }\n    });\n  });\n  ForEach.technique(gltf, function (technique) {\n    ForEach.techniqueUniform(technique, function (uniform) {\n      if (defined(uniform.node)) {\n        usedNodeIds[uniform.node] = true;\n      }\n    });\n  });\n  ForEach.node(gltf, function (node, nodeId) {\n    if (!nodeIsEmpty(gltf, nodeId, usedNodeIds)) {\n      usedNodeIds[nodeId] = true;\n    }\n  });\n\n  return usedNodeIds;\n};\n\ngetListOfElementsIdsInUse.material = function (gltf) {\n  const usedMaterialIds = {};\n\n  ForEach.mesh(gltf, function (mesh) {\n    ForEach.meshPrimitive(mesh, function (primitive) {\n      if (defined(primitive.material)) {\n        usedMaterialIds[primitive.material] = true;\n      }\n    });\n  });\n\n  return usedMaterialIds;\n};\n\ngetListOfElementsIdsInUse.texture = function (gltf) {\n  const usedTextureIds = {};\n\n  ForEach.material(gltf, function (material) {\n    forEachTextureInMaterial(material, function (textureId) {\n      usedTextureIds[textureId] = true;\n    });\n  });\n\n  if (usesExtension(gltf, \"EXT_feature_metadata\")) {\n    ForEach.mesh(gltf, function (mesh) {\n      ForEach.meshPrimitive(mesh, function (primitive) {\n        const extensions = primitive.extensions;\n        if (defined(extensions) && defined(extensions.EXT_feature_metadata)) {\n          const extension = extensions.EXT_feature_metadata;\n          const featureIdTextures = extension.featureIdTextures;\n          if (defined(featureIdTextures)) {\n            const featureIdTexturesLength = featureIdTextures.length;\n            for (let i = 0; i < featureIdTexturesLength; ++i) {\n              const featureIdTexture = featureIdTextures[i];\n              const textureInfo = featureIdTexture.featureIds.texture;\n              usedTextureIds[textureInfo.index] = true;\n            }\n          }\n        }\n      });\n    });\n\n    const extension = gltf.extensions.EXT_feature_metadata;\n    const featureTextures = extension.featureTextures;\n    for (const featureTextureId in featureTextures) {\n      if (featureTextures.hasOwnProperty(featureTextureId)) {\n        const featureTexture = featureTextures[featureTextureId];\n        const properties = featureTexture.properties;\n        if (defined(properties)) {\n          for (const propertyId in properties) {\n            if (properties.hasOwnProperty(propertyId)) {\n              const property = properties[propertyId];\n              const textureInfo = property.texture;\n              usedTextureIds[textureInfo.index] = true;\n            }\n          }\n        }\n      }\n    }\n  }\n\n  if (usesExtension(gltf, \"EXT_mesh_features\")) {\n    ForEach.mesh(gltf, function (mesh) {\n      ForEach.meshPrimitive(mesh, function (primitive) {\n        const extensions = primitive.extensions;\n        if (defined(extensions) && defined(extensions.EXT_mesh_features)) {\n          const extension = extensions.EXT_mesh_features;\n          const featureIds = extension.featureIds;\n          if (defined(featureIds)) {\n            const featureIdsLength = featureIds.length;\n            for (let i = 0; i < featureIdsLength; ++i) {\n              const featureId = featureIds[i];\n              if (defined(featureId.texture)) {\n                usedTextureIds[featureId.texture.index] = true;\n              }\n            }\n          }\n        }\n      });\n    });\n  }\n\n  if (usesExtension(gltf, \"EXT_structural_metadata\")) {\n    const extension = gltf.extensions.EXT_structural_metadata;\n    const propertyTextures = extension.propertyTextures;\n    if (defined(propertyTextures)) {\n      const propertyTexturesLength = propertyTextures.length;\n      for (let i = 0; i < propertyTexturesLength; ++i) {\n        const propertyTexture = propertyTextures[i];\n        const properties = propertyTexture.properties;\n        for (const propertyId in properties) {\n          if (properties.hasOwnProperty(propertyId)) {\n            const property = properties[propertyId];\n            usedTextureIds[property.index] = true;\n          }\n        }\n      }\n    }\n  }\n\n  return usedTextureIds;\n};\n\ngetListOfElementsIdsInUse.sampler = function (gltf) {\n  const usedSamplerIds = {};\n\n  ForEach.texture(gltf, function (texture) {\n    if (defined(texture.sampler)) {\n      usedSamplerIds[texture.sampler] = true;\n    }\n  });\n\n  return usedSamplerIds;\n};\n\nexport default removeUnusedElements;\n", "import addToArray from \"./addToArray.js\";\n\n/**\n * Adds buffer to gltf.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @param {Buffer} buffer A Buffer object which will be added to gltf.buffers.\n * @returns {number} The bufferView id of the newly added bufferView.\n *\n * @private\n */\nfunction addBuffer(gltf, buffer) {\n  const newBuffer = {\n    byteLength: buffer.length,\n    extras: {\n      _pipeline: {\n        source: buffer,\n      },\n    },\n  };\n  const bufferId = addToArray(gltf.buffers, newBuffer);\n  const bufferView = {\n    buffer: bufferId,\n    byteOffset: 0,\n    byteLength: buffer.length,\n  };\n  return addToArray(gltf.bufferViews, bufferView);\n}\n\nexport default addBuffer;\n", "import getAccessorByteStride from \"./getAccessorByteStride.js\";\nimport getComponentReader from \"./getComponentReader.js\";\nimport numberOfComponentsForType from \"./numberOfComponentsForType.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Returns the accessor data in a contiguous array.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @param {object} accessor The accessor.\n * @returns {Array} The accessor values in a contiguous array.\n *\n * @private\n */\nfunction readAccessorPacked(gltf, accessor) {\n  const byteStride = getAccessorByteStride(gltf, accessor);\n  const componentTypeByteLength = ComponentDatatype.getSizeInBytes(\n    accessor.componentType\n  );\n  const numberOfComponents = numberOfComponentsForType(accessor.type);\n  const count = accessor.count;\n  const values = new Array(numberOfComponents * count);\n\n  if (!defined(accessor.bufferView)) {\n    return values.fill(0);\n  }\n\n  const bufferView = gltf.bufferViews[accessor.bufferView];\n  const source = gltf.buffers[bufferView.buffer].extras._pipeline.source;\n  let byteOffset =\n    accessor.byteOffset + bufferView.byteOffset + source.byteOffset;\n\n  const dataView = new DataView(source.buffer);\n  const components = new Array(numberOfComponents);\n  const componentReader = getComponentReader(accessor.componentType);\n\n  for (let i = 0; i < count; ++i) {\n    componentReader(\n      dataView,\n      byteOffset,\n      numberOfComponents,\n      componentTypeByteLength,\n      components\n    );\n    for (let j = 0; j < numberOfComponents; ++j) {\n      values[i * numberOfComponents + j] = components[j];\n    }\n    byteOffset += byteStride;\n  }\n  return values;\n}\n\nexport default readAccessorPacked;\n", "import addBuffer from \"./addBuffer.js\";\nimport ForEach from \"./ForEach.js\";\nimport readAccessorPacked from \"./readAccessorPacked.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport WebGLConstants from \"../../Core/WebGLConstants.js\";\n\n/**\n * Update accessors referenced by JOINTS_0 and WEIGHTS_0 attributes to use correct component types.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @returns {object} The glTF asset with compressed meshes.\n *\n * @private\n */\nfunction updateAccessorComponentTypes(gltf) {\n  let componentType;\n  ForEach.accessorWithSemantic(gltf, \"JOINTS_0\", function (accessorId) {\n    const accessor = gltf.accessors[accessorId];\n    componentType = accessor.componentType;\n    if (componentType === WebGLConstants.BYTE) {\n      convertType(gltf, accessor, ComponentDatatype.UNSIGNED_BYTE);\n    } else if (\n      componentType !== WebGLConstants.UNSIGNED_BYTE &&\n      componentType !== WebGLConstants.UNSIGNED_SHORT\n    ) {\n      convertType(gltf, accessor, ComponentDatatype.UNSIGNED_SHORT);\n    }\n  });\n  ForEach.accessorWithSemantic(gltf, \"WEIGHTS_0\", function (accessorId) {\n    const accessor = gltf.accessors[accessorId];\n    componentType = accessor.componentType;\n    if (componentType === WebGLConstants.BYTE) {\n      convertType(gltf, accessor, ComponentDatatype.UNSIGNED_BYTE);\n    } else if (componentType === WebGLConstants.SHORT) {\n      convertType(gltf, accessor, ComponentDatatype.UNSIGNED_SHORT);\n    }\n  });\n\n  return gltf;\n}\n\nfunction convertType(gltf, accessor, updatedComponentType) {\n  const typedArray = ComponentDatatype.createTypedArray(\n    updatedComponentType,\n    readAccessorPacked(gltf, accessor)\n  );\n  const newBuffer = new Uint8Array(typedArray.buffer);\n  accessor.bufferView = addBuffer(gltf, newBuffer);\n  accessor.componentType = updatedComponentType;\n  accessor.byteOffset = 0;\n}\n\nexport default updateAccessorComponentTypes;\n", "import ForEach from \"./ForEach.js\";\nimport removeExtensionsUsed from \"./removeExtensionsUsed.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Removes an extension from gltf.extensions, gltf.extensionsUsed, gltf.extensionsRequired, and any other objects in the glTF if it is present.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @param {string} extension The extension to remove.\n *\n * @returns {*} The extension data removed from gltf.extensions.\n */\nfunction removeExtension(gltf, extension) {\n  removeExtensionsUsed(gltf, extension); // Also removes from extensionsRequired\n\n  if (extension === \"CESIUM_RTC\") {\n    removeCesiumRTC(gltf);\n  }\n\n  return removeExtensionAndTraverse(gltf, extension);\n}\n\nfunction removeCesiumRTC(gltf) {\n  ForEach.technique(gltf, function (technique) {\n    ForEach.techniqueUniform(technique, function (uniform) {\n      if (uniform.semantic === \"CESIUM_RTC_MODELVIEW\") {\n        uniform.semantic = \"MODELVIEW\";\n      }\n    });\n  });\n}\n\nfunction removeExtensionAndTraverse(object, extension) {\n  if (Array.isArray(object)) {\n    const length = object.length;\n    for (let i = 0; i < length; ++i) {\n      removeExtensionAndTraverse(object[i], extension);\n    }\n  } else if (\n    object !== null &&\n    typeof object === \"object\" &&\n    object.constructor === Object\n  ) {\n    const extensions = object.extensions;\n    let extensionData;\n    if (defined(extensions)) {\n      extensionData = extensions[extension];\n      if (defined(extensionData)) {\n        delete extensions[extension];\n        if (Object.keys(extensions).length === 0) {\n          delete object.extensions;\n        }\n      }\n    }\n    for (const key in object) {\n      if (Object.prototype.hasOwnProperty.call(object, key)) {\n        removeExtensionAndTraverse(object[key], extension);\n      }\n    }\n    return extensionData;\n  }\n}\n\nexport default removeExtension;\n", "import addExtensionsUsed from \"./addExtensionsUsed.js\";\nimport addToArray from \"./addToArray.js\";\nimport findAccessorMinMax from \"./findAccessorMinMax.js\";\nimport ForEach from \"./ForEach.js\";\nimport getAccessorByteStride from \"./getAccessorByteStride.js\";\nimport numberOfComponentsForType from \"./numberOfComponentsForType.js\";\nimport moveTechniqueRenderStates from \"./moveTechniqueRenderStates.js\";\nimport moveTechniquesToExtension from \"./moveTechniquesToExtension.js\";\nimport removeUnusedElements from \"./removeUnusedElements.js\";\nimport updateAccessorComponentTypes from \"./updateAccessorComponentTypes.js\";\nimport removeExtension from \"./removeExtension.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Cartesian4 from \"../../Core/Cartesian4.js\";\nimport clone from \"../../Core/clone.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport Quaternion from \"../../Core/Quaternion.js\";\nimport WebGLConstants from \"../../Core/WebGLConstants.js\";\n\nconst updateFunctions = {\n  0.8: glTF08to10,\n  \"1.0\": glTF10to20,\n  \"2.0\": undefined,\n};\n\n/**\n * Update the glTF version to the latest version (2.0), or targetVersion if specified.\n * Applies changes made to the glTF spec between revisions so that the core library\n * only has to handle the latest version.\n *\n * @param {object} gltf A javascript object containing a glTF asset.\n * @param {object} [options] Options for updating the glTF.\n * @param {string} [options.targetVersion] The glTF will be upgraded until it hits the specified version.\n * @param {string[]} [options.baseColorTextureNames] Names of uniforms that indicate base color textures.\n * @param {string[]} [options.baseColorFactorNames] Names of uniforms that indicate base color factors.\n * @returns {object} The updated glTF asset.\n *\n * @private\n */\nfunction updateVersion(gltf, options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const targetVersion = options.targetVersion;\n  let version = gltf.version;\n\n  gltf.asset = defaultValue(gltf.asset, {\n    version: \"1.0\",\n  });\n\n  gltf.asset.version = defaultValue(gltf.asset.version, \"1.0\");\n  version = defaultValue(version, gltf.asset.version).toString();\n\n  // Invalid version\n  if (!Object.prototype.hasOwnProperty.call(updateFunctions, version)) {\n    // Try truncating trailing version numbers, could be a number as well if it is 0.8\n    if (defined(version)) {\n      version = version.substring(0, 3);\n    }\n    // Default to 1.0 if it cannot be determined\n    if (!Object.prototype.hasOwnProperty.call(updateFunctions, version)) {\n      version = \"1.0\";\n    }\n  }\n\n  let updateFunction = updateFunctions[version];\n\n  while (defined(updateFunction)) {\n    if (version === targetVersion) {\n      break;\n    }\n    updateFunction(gltf, options);\n    version = gltf.asset.version;\n    updateFunction = updateFunctions[version];\n  }\n\n  if (!options.keepLegacyExtensions) {\n    convertTechniquesToPbr(gltf, options);\n    convertMaterialsCommonToPbr(gltf);\n  }\n\n  return gltf;\n}\n\nfunction updateInstanceTechniques(gltf) {\n  const materials = gltf.materials;\n  for (const materialId in materials) {\n    if (Object.prototype.hasOwnProperty.call(materials, materialId)) {\n      const material = materials[materialId];\n      const instanceTechnique = material.instanceTechnique;\n      if (defined(instanceTechnique)) {\n        material.technique = instanceTechnique.technique;\n        material.values = instanceTechnique.values;\n        delete material.instanceTechnique;\n      }\n    }\n  }\n}\n\nfunction setPrimitiveModes(gltf) {\n  const meshes = gltf.meshes;\n  for (const meshId in meshes) {\n    if (Object.prototype.hasOwnProperty.call(meshes, meshId)) {\n      const mesh = meshes[meshId];\n      const primitives = mesh.primitives;\n      if (defined(primitives)) {\n        const primitivesLength = primitives.length;\n        for (let i = 0; i < primitivesLength; ++i) {\n          const primitive = primitives[i];\n          const defaultMode = defaultValue(\n            primitive.primitive,\n            WebGLConstants.TRIANGLES\n          );\n          primitive.mode = defaultValue(primitive.mode, defaultMode);\n          delete primitive.primitive;\n        }\n      }\n    }\n  }\n}\n\nfunction updateNodes(gltf) {\n  const nodes = gltf.nodes;\n  const axis = new Cartesian3();\n  const quat = new Quaternion();\n  for (const nodeId in nodes) {\n    if (Object.prototype.hasOwnProperty.call(nodes, nodeId)) {\n      const node = nodes[nodeId];\n      if (defined(node.rotation)) {\n        const rotation = node.rotation;\n        Cartesian3.fromArray(rotation, 0, axis);\n        Quaternion.fromAxisAngle(axis, rotation[3], quat);\n        node.rotation = [quat.x, quat.y, quat.z, quat.w];\n      }\n      const instanceSkin = node.instanceSkin;\n      if (defined(instanceSkin)) {\n        node.skeletons = instanceSkin.skeletons;\n        node.skin = instanceSkin.skin;\n        node.meshes = instanceSkin.meshes;\n        delete node.instanceSkin;\n      }\n    }\n  }\n}\n\nfunction updateAnimations(gltf) {\n  const animations = gltf.animations;\n  const accessors = gltf.accessors;\n  const bufferViews = gltf.bufferViews;\n  const buffers = gltf.buffers;\n  const updatedAccessors = {};\n  const axis = new Cartesian3();\n  const quat = new Quaternion();\n  for (const animationId in animations) {\n    if (Object.prototype.hasOwnProperty.call(animations, animationId)) {\n      const animation = animations[animationId];\n      const channels = animation.channels;\n      const parameters = animation.parameters;\n      const samplers = animation.samplers;\n      if (defined(channels)) {\n        const channelsLength = channels.length;\n        for (let i = 0; i < channelsLength; ++i) {\n          const channel = channels[i];\n          if (channel.target.path === \"rotation\") {\n            const accessorId = parameters[samplers[channel.sampler].output];\n            if (defined(updatedAccessors[accessorId])) {\n              continue;\n            }\n            updatedAccessors[accessorId] = true;\n            const accessor = accessors[accessorId];\n            const bufferView = bufferViews[accessor.bufferView];\n            const buffer = buffers[bufferView.buffer];\n            const source = buffer.extras._pipeline.source;\n            const byteOffset =\n              source.byteOffset + bufferView.byteOffset + accessor.byteOffset;\n            const componentType = accessor.componentType;\n            const count = accessor.count;\n            const componentsLength = numberOfComponentsForType(accessor.type);\n            const length = accessor.count * componentsLength;\n            const typedArray = ComponentDatatype.createArrayBufferView(\n              componentType,\n              source.buffer,\n              byteOffset,\n              length\n            );\n\n            for (let j = 0; j < count; j++) {\n              const offset = j * componentsLength;\n              Cartesian3.unpack(typedArray, offset, axis);\n              const angle = typedArray[offset + 3];\n              Quaternion.fromAxisAngle(axis, angle, quat);\n              Quaternion.pack(quat, typedArray, offset);\n            }\n          }\n        }\n      }\n    }\n  }\n}\n\nfunction removeTechniquePasses(gltf) {\n  const techniques = gltf.techniques;\n  for (const techniqueId in techniques) {\n    if (Object.prototype.hasOwnProperty.call(techniques, techniqueId)) {\n      const technique = techniques[techniqueId];\n      const passes = technique.passes;\n      if (defined(passes)) {\n        const passName = defaultValue(technique.pass, \"defaultPass\");\n        if (Object.prototype.hasOwnProperty.call(passes, passName)) {\n          const pass = passes[passName];\n          const instanceProgram = pass.instanceProgram;\n          technique.attributes = defaultValue(\n            technique.attributes,\n            instanceProgram.attributes\n          );\n          technique.program = defaultValue(\n            technique.program,\n            instanceProgram.program\n          );\n          technique.uniforms = defaultValue(\n            technique.uniforms,\n            instanceProgram.uniforms\n          );\n          technique.states = defaultValue(technique.states, pass.states);\n        }\n        delete technique.passes;\n        delete technique.pass;\n      }\n    }\n  }\n}\n\nfunction glTF08to10(gltf) {\n  if (!defined(gltf.asset)) {\n    gltf.asset = {};\n  }\n  const asset = gltf.asset;\n  asset.version = \"1.0\";\n  // Profile should be an object, not a string\n  if (typeof asset.profile === \"string\") {\n    const split = asset.profile.split(\" \");\n    asset.profile = {\n      api: split[0],\n      version: split[1],\n    };\n  } else {\n    asset.profile = {};\n  }\n\n  // Version property should be in asset, not on the root element\n  if (defined(gltf.version)) {\n    delete gltf.version;\n  }\n  // material.instanceTechnique properties should be directly on the material\n  updateInstanceTechniques(gltf);\n  // primitive.primitive should be primitive.mode\n  setPrimitiveModes(gltf);\n  // Node rotation should be quaternion, not axis-angle\n  // node.instanceSkin is deprecated\n  updateNodes(gltf);\n  // Animations that target rotations should be quaternion, not axis-angle\n  updateAnimations(gltf);\n  // technique.pass and techniques.passes are deprecated\n  removeTechniquePasses(gltf);\n  // gltf.allExtensions -> extensionsUsed\n  if (defined(gltf.allExtensions)) {\n    gltf.extensionsUsed = gltf.allExtensions;\n    delete gltf.allExtensions;\n  }\n  // gltf.lights -> khrMaterialsCommon.lights\n  if (defined(gltf.lights)) {\n    const extensions = defaultValue(gltf.extensions, {});\n    gltf.extensions = extensions;\n    const materialsCommon = defaultValue(extensions.KHR_materials_common, {});\n    extensions.KHR_materials_common = materialsCommon;\n    materialsCommon.lights = gltf.lights;\n    delete gltf.lights;\n    addExtensionsUsed(gltf, \"KHR_materials_common\");\n  }\n}\n\nfunction removeAnimationSamplersIndirection(gltf) {\n  const animations = gltf.animations;\n  for (const animationId in animations) {\n    if (Object.prototype.hasOwnProperty.call(animations, animationId)) {\n      const animation = animations[animationId];\n      const parameters = animation.parameters;\n      if (defined(parameters)) {\n        const samplers = animation.samplers;\n        for (const samplerId in samplers) {\n          if (Object.prototype.hasOwnProperty.call(samplers, samplerId)) {\n            const sampler = samplers[samplerId];\n            sampler.input = parameters[sampler.input];\n            sampler.output = parameters[sampler.output];\n          }\n        }\n        delete animation.parameters;\n      }\n    }\n  }\n}\n\nfunction objectToArray(object, mapping) {\n  const array = [];\n  for (const id in object) {\n    if (Object.prototype.hasOwnProperty.call(object, id)) {\n      const value = object[id];\n      mapping[id] = array.length;\n      array.push(value);\n      if (!defined(value.name)) {\n        value.name = id;\n      }\n    }\n  }\n  return array;\n}\n\nfunction objectsToArrays(gltf) {\n  let i;\n  const globalMapping = {\n    accessors: {},\n    animations: {},\n    buffers: {},\n    bufferViews: {},\n    cameras: {},\n    images: {},\n    materials: {},\n    meshes: {},\n    nodes: {},\n    programs: {},\n    samplers: {},\n    scenes: {},\n    shaders: {},\n    skins: {},\n    textures: {},\n    techniques: {},\n  };\n\n  // Map joint names to id names\n  let jointName;\n  const jointNameToId = {};\n  const nodes = gltf.nodes;\n  for (const id in nodes) {\n    if (Object.prototype.hasOwnProperty.call(nodes, id)) {\n      jointName = nodes[id].jointName;\n      if (defined(jointName)) {\n        jointNameToId[jointName] = id;\n      }\n    }\n  }\n\n  // Convert top level objects to arrays\n  for (const topLevelId in gltf) {\n    if (\n      Object.prototype.hasOwnProperty.call(gltf, topLevelId) &&\n      defined(globalMapping[topLevelId])\n    ) {\n      const objectMapping = {};\n      const object = gltf[topLevelId];\n      gltf[topLevelId] = objectToArray(object, objectMapping);\n      globalMapping[topLevelId] = objectMapping;\n    }\n  }\n\n  // Remap joint names to array indexes\n  for (jointName in jointNameToId) {\n    if (Object.prototype.hasOwnProperty.call(jointNameToId, jointName)) {\n      jointNameToId[jointName] = globalMapping.nodes[jointNameToId[jointName]];\n    }\n  }\n\n  // Fix references\n  if (defined(gltf.scene)) {\n    gltf.scene = globalMapping.scenes[gltf.scene];\n  }\n  ForEach.bufferView(gltf, function (bufferView) {\n    if (defined(bufferView.buffer)) {\n      bufferView.buffer = globalMapping.buffers[bufferView.buffer];\n    }\n  });\n  ForEach.accessor(gltf, function (accessor) {\n    if (defined(accessor.bufferView)) {\n      accessor.bufferView = globalMapping.bufferViews[accessor.bufferView];\n    }\n  });\n  ForEach.shader(gltf, function (shader) {\n    const extensions = shader.extensions;\n    if (defined(extensions)) {\n      const binaryGltf = extensions.KHR_binary_glTF;\n      if (defined(binaryGltf)) {\n        shader.bufferView = globalMapping.bufferViews[binaryGltf.bufferView];\n        delete extensions.KHR_binary_glTF;\n      }\n      if (Object.keys(extensions).length === 0) {\n        delete shader.extensions;\n      }\n    }\n  });\n  ForEach.program(gltf, function (program) {\n    if (defined(program.vertexShader)) {\n      program.vertexShader = globalMapping.shaders[program.vertexShader];\n    }\n    if (defined(program.fragmentShader)) {\n      program.fragmentShader = globalMapping.shaders[program.fragmentShader];\n    }\n  });\n  ForEach.technique(gltf, function (technique) {\n    if (defined(technique.program)) {\n      technique.program = globalMapping.programs[technique.program];\n    }\n    ForEach.techniqueParameter(technique, function (parameter) {\n      if (defined(parameter.node)) {\n        parameter.node = globalMapping.nodes[parameter.node];\n      }\n      const value = parameter.value;\n      if (typeof value === \"string\") {\n        parameter.value = {\n          index: globalMapping.textures[value],\n        };\n      }\n    });\n  });\n  ForEach.mesh(gltf, function (mesh) {\n    ForEach.meshPrimitive(mesh, function (primitive) {\n      if (defined(primitive.indices)) {\n        primitive.indices = globalMapping.accessors[primitive.indices];\n      }\n      ForEach.meshPrimitiveAttribute(\n        primitive,\n        function (accessorId, semantic) {\n          primitive.attributes[semantic] = globalMapping.accessors[accessorId];\n        }\n      );\n      if (defined(primitive.material)) {\n        primitive.material = globalMapping.materials[primitive.material];\n      }\n    });\n  });\n  ForEach.node(gltf, function (node) {\n    let children = node.children;\n    if (defined(children)) {\n      const childrenLength = children.length;\n      for (i = 0; i < childrenLength; ++i) {\n        children[i] = globalMapping.nodes[children[i]];\n      }\n    }\n    if (defined(node.meshes)) {\n      // Split out meshes on nodes\n      const meshes = node.meshes;\n      const meshesLength = meshes.length;\n      if (meshesLength > 0) {\n        node.mesh = globalMapping.meshes[meshes[0]];\n        for (i = 1; i < meshesLength; ++i) {\n          const meshNode = {\n            mesh: globalMapping.meshes[meshes[i]],\n          };\n          const meshNodeId = addToArray(gltf.nodes, meshNode);\n          if (!defined(children)) {\n            children = [];\n            node.children = children;\n          }\n          children.push(meshNodeId);\n        }\n      }\n      delete node.meshes;\n    }\n    if (defined(node.camera)) {\n      node.camera = globalMapping.cameras[node.camera];\n    }\n    if (defined(node.skin)) {\n      node.skin = globalMapping.skins[node.skin];\n    }\n    if (defined(node.skeletons)) {\n      // Assign skeletons to skins\n      const skeletons = node.skeletons;\n      const skeletonsLength = skeletons.length;\n      if (skeletonsLength > 0 && defined(node.skin)) {\n        const skin = gltf.skins[node.skin];\n        skin.skeleton = globalMapping.nodes[skeletons[0]];\n      }\n      delete node.skeletons;\n    }\n    if (defined(node.jointName)) {\n      delete node.jointName;\n    }\n  });\n  ForEach.skin(gltf, function (skin) {\n    if (defined(skin.inverseBindMatrices)) {\n      skin.inverseBindMatrices =\n        globalMapping.accessors[skin.inverseBindMatrices];\n    }\n    const jointNames = skin.jointNames;\n    if (defined(jointNames)) {\n      const joints = [];\n      const jointNamesLength = jointNames.length;\n      for (i = 0; i < jointNamesLength; ++i) {\n        joints[i] = jointNameToId[jointNames[i]];\n      }\n      skin.joints = joints;\n      delete skin.jointNames;\n    }\n  });\n  ForEach.scene(gltf, function (scene) {\n    const sceneNodes = scene.nodes;\n    if (defined(sceneNodes)) {\n      const sceneNodesLength = sceneNodes.length;\n      for (i = 0; i < sceneNodesLength; ++i) {\n        sceneNodes[i] = globalMapping.nodes[sceneNodes[i]];\n      }\n    }\n  });\n  ForEach.animation(gltf, function (animation) {\n    const samplerMapping = {};\n    animation.samplers = objectToArray(animation.samplers, samplerMapping);\n    ForEach.animationSampler(animation, function (sampler) {\n      sampler.input = globalMapping.accessors[sampler.input];\n      sampler.output = globalMapping.accessors[sampler.output];\n    });\n    ForEach.animationChannel(animation, function (channel) {\n      channel.sampler = samplerMapping[channel.sampler];\n      const target = channel.target;\n      if (defined(target)) {\n        target.node = globalMapping.nodes[target.id];\n        delete target.id;\n      }\n    });\n  });\n  ForEach.material(gltf, function (material) {\n    if (defined(material.technique)) {\n      material.technique = globalMapping.techniques[material.technique];\n    }\n    ForEach.materialValue(material, function (value, name) {\n      if (typeof value === \"string\") {\n        material.values[name] = {\n          index: globalMapping.textures[value],\n        };\n      }\n    });\n    const extensions = material.extensions;\n    if (defined(extensions)) {\n      const materialsCommon = extensions.KHR_materials_common;\n      if (defined(materialsCommon) && defined(materialsCommon.values)) {\n        ForEach.materialValue(materialsCommon, function (value, name) {\n          if (typeof value === \"string\") {\n            materialsCommon.values[name] = {\n              index: globalMapping.textures[value],\n            };\n          }\n        });\n      }\n    }\n  });\n  ForEach.image(gltf, function (image) {\n    const extensions = image.extensions;\n    if (defined(extensions)) {\n      const binaryGltf = extensions.KHR_binary_glTF;\n      if (defined(binaryGltf)) {\n        image.bufferView = globalMapping.bufferViews[binaryGltf.bufferView];\n        image.mimeType = binaryGltf.mimeType;\n        delete extensions.KHR_binary_glTF;\n      }\n      if (Object.keys(extensions).length === 0) {\n        delete image.extensions;\n      }\n    }\n  });\n  ForEach.texture(gltf, function (texture) {\n    if (defined(texture.sampler)) {\n      texture.sampler = globalMapping.samplers[texture.sampler];\n    }\n    if (defined(texture.source)) {\n      texture.source = globalMapping.images[texture.source];\n    }\n  });\n}\n\nfunction removeAnimationSamplerNames(gltf) {\n  ForEach.animation(gltf, function (animation) {\n    ForEach.animationSampler(animation, function (sampler) {\n      delete sampler.name;\n    });\n  });\n}\n\nfunction removeEmptyArrays(gltf) {\n  for (const topLevelId in gltf) {\n    if (Object.prototype.hasOwnProperty.call(gltf, topLevelId)) {\n      const array = gltf[topLevelId];\n      if (Array.isArray(array) && array.length === 0) {\n        delete gltf[topLevelId];\n      }\n    }\n  }\n  ForEach.node(gltf, function (node) {\n    if (defined(node.children) && node.children.length === 0) {\n      delete node.children;\n    }\n  });\n}\n\nfunction stripAsset(gltf) {\n  const asset = gltf.asset;\n  delete asset.profile;\n  delete asset.premultipliedAlpha;\n}\n\nconst knownExtensions = {\n  CESIUM_RTC: true,\n  KHR_materials_common: true,\n  WEB3D_quantized_attributes: true,\n};\nfunction requireKnownExtensions(gltf) {\n  const extensionsUsed = gltf.extensionsUsed;\n  gltf.extensionsRequired = defaultValue(gltf.extensionsRequired, []);\n  if (defined(extensionsUsed)) {\n    const extensionsUsedLength = extensionsUsed.length;\n    for (let i = 0; i < extensionsUsedLength; ++i) {\n      const extension = extensionsUsed[i];\n      if (defined(knownExtensions[extension])) {\n        gltf.extensionsRequired.push(extension);\n      }\n    }\n  }\n}\n\nfunction removeBufferType(gltf) {\n  ForEach.buffer(gltf, function (buffer) {\n    delete buffer.type;\n  });\n}\n\nfunction removeTextureProperties(gltf) {\n  ForEach.texture(gltf, function (texture) {\n    delete texture.format;\n    delete texture.internalFormat;\n    delete texture.target;\n    delete texture.type;\n  });\n}\n\nfunction requireAttributeSetIndex(gltf) {\n  ForEach.mesh(gltf, function (mesh) {\n    ForEach.meshPrimitive(mesh, function (primitive) {\n      ForEach.meshPrimitiveAttribute(\n        primitive,\n        function (accessorId, semantic) {\n          if (semantic === \"TEXCOORD\") {\n            primitive.attributes.TEXCOORD_0 = accessorId;\n          } else if (semantic === \"COLOR\") {\n            primitive.attributes.COLOR_0 = accessorId;\n          }\n        }\n      );\n      delete primitive.attributes.TEXCOORD;\n      delete primitive.attributes.COLOR;\n    });\n  });\n  ForEach.technique(gltf, function (technique) {\n    ForEach.techniqueParameter(technique, function (parameter) {\n      const semantic = parameter.semantic;\n      if (defined(semantic)) {\n        if (semantic === \"TEXCOORD\") {\n          parameter.semantic = \"TEXCOORD_0\";\n        } else if (semantic === \"COLOR\") {\n          parameter.semantic = \"COLOR_0\";\n        }\n      }\n    });\n  });\n}\n\nconst knownSemantics = {\n  POSITION: true,\n  NORMAL: true,\n  TANGENT: true,\n};\nconst indexedSemantics = {\n  COLOR: \"COLOR\",\n  JOINT: \"JOINTS\",\n  JOINTS: \"JOINTS\",\n  TEXCOORD: \"TEXCOORD\",\n  WEIGHT: \"WEIGHTS\",\n  WEIGHTS: \"WEIGHTS\",\n};\nfunction underscoreApplicationSpecificSemantics(gltf) {\n  const mappedSemantics = {};\n  ForEach.mesh(gltf, function (mesh) {\n    ForEach.meshPrimitive(mesh, function (primitive) {\n      /*eslint-disable no-unused-vars*/\n      ForEach.meshPrimitiveAttribute(\n        primitive,\n        function (accessorId, semantic) {\n          if (semantic.charAt(0) !== \"_\") {\n            const setIndex = semantic.search(/_[0-9]+/g);\n            let strippedSemantic = semantic;\n            let suffix = \"_0\";\n            if (setIndex >= 0) {\n              strippedSemantic = semantic.substring(0, setIndex);\n              suffix = semantic.substring(setIndex);\n            }\n            let newSemantic;\n            const indexedSemantic = indexedSemantics[strippedSemantic];\n            if (defined(indexedSemantic)) {\n              newSemantic = indexedSemantic + suffix;\n              mappedSemantics[semantic] = newSemantic;\n            } else if (!defined(knownSemantics[strippedSemantic])) {\n              newSemantic = `_${semantic}`;\n              mappedSemantics[semantic] = newSemantic;\n            }\n          }\n        }\n      );\n      for (const semantic in mappedSemantics) {\n        if (Object.prototype.hasOwnProperty.call(mappedSemantics, semantic)) {\n          const mappedSemantic = mappedSemantics[semantic];\n          const accessorId = primitive.attributes[semantic];\n          if (defined(accessorId)) {\n            delete primitive.attributes[semantic];\n            primitive.attributes[mappedSemantic] = accessorId;\n          }\n        }\n      }\n    });\n  });\n  ForEach.technique(gltf, function (technique) {\n    ForEach.techniqueParameter(technique, function (parameter) {\n      const mappedSemantic = mappedSemantics[parameter.semantic];\n      if (defined(mappedSemantic)) {\n        parameter.semantic = mappedSemantic;\n      }\n    });\n  });\n}\n\nfunction clampCameraParameters(gltf) {\n  ForEach.camera(gltf, function (camera) {\n    const perspective = camera.perspective;\n    if (defined(perspective)) {\n      const aspectRatio = perspective.aspectRatio;\n      if (defined(aspectRatio) && aspectRatio === 0.0) {\n        delete perspective.aspectRatio;\n      }\n      const yfov = perspective.yfov;\n      if (defined(yfov) && yfov === 0.0) {\n        perspective.yfov = 1.0;\n      }\n    }\n  });\n}\n\nfunction computeAccessorByteStride(gltf, accessor) {\n  return defined(accessor.byteStride) && accessor.byteStride !== 0\n    ? accessor.byteStride\n    : getAccessorByteStride(gltf, accessor);\n}\n\nfunction requireByteLength(gltf) {\n  ForEach.buffer(gltf, function (buffer) {\n    if (!defined(buffer.byteLength)) {\n      buffer.byteLength = buffer.extras._pipeline.source.length;\n    }\n  });\n  ForEach.accessor(gltf, function (accessor) {\n    const bufferViewId = accessor.bufferView;\n    if (defined(bufferViewId)) {\n      const bufferView = gltf.bufferViews[bufferViewId];\n      const accessorByteStride = computeAccessorByteStride(gltf, accessor);\n      const accessorByteEnd =\n        accessor.byteOffset + accessor.count * accessorByteStride;\n      bufferView.byteLength = Math.max(\n        defaultValue(bufferView.byteLength, 0),\n        accessorByteEnd\n      );\n    }\n  });\n}\n\nfunction moveByteStrideToBufferView(gltf) {\n  let i;\n  let j;\n  let bufferView;\n  const bufferViews = gltf.bufferViews;\n\n  const bufferViewHasVertexAttributes = {};\n  ForEach.accessorContainingVertexAttributeData(gltf, function (accessorId) {\n    const accessor = gltf.accessors[accessorId];\n    if (defined(accessor.bufferView)) {\n      bufferViewHasVertexAttributes[accessor.bufferView] = true;\n    }\n  });\n\n  // Map buffer views to a list of accessors\n  const bufferViewMap = {};\n  ForEach.accessor(gltf, function (accessor) {\n    if (defined(accessor.bufferView)) {\n      bufferViewMap[accessor.bufferView] = defaultValue(\n        bufferViewMap[accessor.bufferView],\n        []\n      );\n      bufferViewMap[accessor.bufferView].push(accessor);\n    }\n  });\n\n  // Split accessors with different byte strides\n  for (const bufferViewId in bufferViewMap) {\n    if (Object.prototype.hasOwnProperty.call(bufferViewMap, bufferViewId)) {\n      bufferView = bufferViews[bufferViewId];\n      const accessors = bufferViewMap[bufferViewId];\n      accessors.sort(function (a, b) {\n        return a.byteOffset - b.byteOffset;\n      });\n      let currentByteOffset = 0;\n      let currentIndex = 0;\n      const accessorsLength = accessors.length;\n      for (i = 0; i < accessorsLength; ++i) {\n        let accessor = accessors[i];\n        const accessorByteStride = computeAccessorByteStride(gltf, accessor);\n        const accessorByteOffset = accessor.byteOffset;\n        const accessorByteLength = accessor.count * accessorByteStride;\n        delete accessor.byteStride;\n\n        const hasNextAccessor = i < accessorsLength - 1;\n        const nextAccessorByteStride = hasNextAccessor\n          ? computeAccessorByteStride(gltf, accessors[i + 1])\n          : undefined;\n        if (accessorByteStride !== nextAccessorByteStride) {\n          const newBufferView = clone(bufferView, true);\n          if (bufferViewHasVertexAttributes[bufferViewId]) {\n            newBufferView.byteStride = accessorByteStride;\n          }\n          newBufferView.byteOffset += currentByteOffset;\n          newBufferView.byteLength =\n            accessorByteOffset + accessorByteLength - currentByteOffset;\n          const newBufferViewId = addToArray(bufferViews, newBufferView);\n          for (j = currentIndex; j <= i; ++j) {\n            accessor = accessors[j];\n            accessor.bufferView = newBufferViewId;\n            accessor.byteOffset = accessor.byteOffset - currentByteOffset;\n          }\n          // Set current byte offset to next accessor's byte offset\n          currentByteOffset = hasNextAccessor\n            ? accessors[i + 1].byteOffset\n            : undefined;\n          currentIndex = i + 1;\n        }\n      }\n    }\n  }\n\n  // Remove unused buffer views\n  removeUnusedElements(gltf, [\"accessor\", \"bufferView\", \"buffer\"]);\n}\n\nfunction requirePositionAccessorMinMax(gltf) {\n  ForEach.accessorWithSemantic(gltf, \"POSITION\", function (accessorId) {\n    const accessor = gltf.accessors[accessorId];\n    if (!defined(accessor.min) || !defined(accessor.max)) {\n      const minMax = findAccessorMinMax(gltf, accessor);\n      accessor.min = minMax.min;\n      accessor.max = minMax.max;\n    }\n  });\n}\n\nfunction isNodeEmpty(node) {\n  return (\n    (!defined(node.children) || node.children.length === 0) &&\n    (!defined(node.meshes) || node.meshes.length === 0) &&\n    !defined(node.camera) &&\n    !defined(node.skin) &&\n    !defined(node.skeletons) &&\n    !defined(node.jointName) &&\n    (!defined(node.translation) ||\n      Cartesian3.fromArray(node.translation).equals(Cartesian3.ZERO)) &&\n    (!defined(node.scale) ||\n      Cartesian3.fromArray(node.scale).equals(new Cartesian3(1.0, 1.0, 1.0))) &&\n    (!defined(node.rotation) ||\n      Cartesian4.fromArray(node.rotation).equals(\n        new Cartesian4(0.0, 0.0, 0.0, 1.0)\n      )) &&\n    (!defined(node.matrix) ||\n      Matrix4.fromColumnMajorArray(node.matrix).equals(Matrix4.IDENTITY)) &&\n    !defined(node.extensions) &&\n    !defined(node.extras)\n  );\n}\n\nfunction deleteNode(gltf, nodeId) {\n  // Remove from list of nodes in scene\n  ForEach.scene(gltf, function (scene) {\n    const sceneNodes = scene.nodes;\n    if (defined(sceneNodes)) {\n      const sceneNodesLength = sceneNodes.length;\n      for (let i = sceneNodesLength; i >= 0; --i) {\n        if (sceneNodes[i] === nodeId) {\n          sceneNodes.splice(i, 1);\n          return;\n        }\n      }\n    }\n  });\n\n  // Remove parent node's reference to this node, and delete the parent if also empty\n  ForEach.node(gltf, function (parentNode, parentNodeId) {\n    if (defined(parentNode.children)) {\n      const index = parentNode.children.indexOf(nodeId);\n      if (index > -1) {\n        parentNode.children.splice(index, 1);\n\n        if (isNodeEmpty(parentNode)) {\n          deleteNode(gltf, parentNodeId);\n        }\n      }\n    }\n  });\n\n  delete gltf.nodes[nodeId];\n}\n\nfunction removeEmptyNodes(gltf) {\n  ForEach.node(gltf, function (node, nodeId) {\n    if (isNodeEmpty(node)) {\n      deleteNode(gltf, nodeId);\n    }\n  });\n\n  return gltf;\n}\n\nfunction requireAnimationAccessorMinMax(gltf) {\n  ForEach.animation(gltf, function (animation) {\n    ForEach.animationSampler(animation, function (sampler) {\n      const accessor = gltf.accessors[sampler.input];\n      if (!defined(accessor.min) || !defined(accessor.max)) {\n        const minMax = findAccessorMinMax(gltf, accessor);\n        accessor.min = minMax.min;\n        accessor.max = minMax.max;\n      }\n    });\n  });\n}\n\nfunction validatePresentAccessorMinMax(gltf) {\n  ForEach.accessor(gltf, function (accessor) {\n    if (defined(accessor.min) || defined(accessor.max)) {\n      const minMax = findAccessorMinMax(gltf, accessor);\n      if (defined(accessor.min)) {\n        accessor.min = minMax.min;\n      }\n      if (defined(accessor.max)) {\n        accessor.max = minMax.max;\n      }\n    }\n  });\n}\n\nfunction glTF10to20(gltf) {\n  gltf.asset = defaultValue(gltf.asset, {});\n  gltf.asset.version = \"2.0\";\n  // material.instanceTechnique properties should be directly on the material. instanceTechnique is a gltf 0.8 property but is seen in some 1.0 models.\n  updateInstanceTechniques(gltf);\n  // animation.samplers now refers directly to accessors and animation.parameters should be removed\n  removeAnimationSamplersIndirection(gltf);\n  // Remove empty nodes and re-assign referencing indices\n  removeEmptyNodes(gltf);\n  // Top-level objects are now arrays referenced by index instead of id\n  objectsToArrays(gltf);\n  // Animation.sampler objects cannot have names\n  removeAnimationSamplerNames(gltf);\n  // asset.profile no longer exists\n  stripAsset(gltf);\n  // Move known extensions from extensionsUsed to extensionsRequired\n  requireKnownExtensions(gltf);\n  // bufferView.byteLength and buffer.byteLength are required\n  requireByteLength(gltf);\n  // byteStride moved from accessor to bufferView\n  moveByteStrideToBufferView(gltf);\n  // accessor.min and accessor.max must be defined for accessors containing POSITION attributes\n  requirePositionAccessorMinMax(gltf);\n  // An animation sampler's input accessor must have min and max properties defined\n  requireAnimationAccessorMinMax(gltf);\n  // When an acccessor has a min- or max, then it is recomputed, to capture the actual\n  // value, and not use the (possibly imprecise) value from the input\n  validatePresentAccessorMinMax(gltf);\n  // buffer.type is unnecessary and should be removed\n  removeBufferType(gltf);\n  // Remove format, internalFormat, target, and type\n  removeTextureProperties(gltf);\n  // TEXCOORD and COLOR attributes must be written with a set index (TEXCOORD_#)\n  requireAttributeSetIndex(gltf);\n  // Add underscores to application-specific parameters\n  underscoreApplicationSpecificSemantics(gltf);\n  // Accessors referenced by JOINTS_0 and WEIGHTS_0 attributes must have correct component types\n  updateAccessorComponentTypes(gltf);\n  // Clamp camera parameters\n  clampCameraParameters(gltf);\n  // Move legacy technique render states to material properties and add KHR_blend extension blending functions\n  moveTechniqueRenderStates(gltf);\n  // Add material techniques to KHR_techniques_webgl extension, removing shaders, programs, and techniques\n  moveTechniquesToExtension(gltf);\n  // Remove empty arrays\n  removeEmptyArrays(gltf);\n}\n\n// It's not possible to upgrade glTF 1.0 shaders to 2.0 PBR materials in a generic way,\n// but we can look for certain uniform names that are commonly found in glTF 1.0 assets\n// and create PBR materials out of those.\nconst defaultBaseColorTextureNames = [\n  \"u_tex\",\n  \"u_diffuse\",\n  \"u_emission\",\n  \"u_diffuse_tex\",\n];\nconst defaultBaseColorFactorNames = [\"u_diffuse\", \"u_diffuse_mat\"];\n\nfunction initializePbrMaterial(material) {\n  material.pbrMetallicRoughness = defined(material.pbrMetallicRoughness)\n    ? material.pbrMetallicRoughness\n    : {};\n\n  material.pbrMetallicRoughness.roughnessFactor = 1.0;\n  material.pbrMetallicRoughness.metallicFactor = 0.0;\n}\n\nfunction isTexture(value) {\n  return defined(value.index);\n}\n\nfunction isVec4(value) {\n  return Array.isArray(value) && value.length === 4;\n}\n\nfunction srgbToLinear(srgb) {\n  const linear = new Array(4);\n  linear[3] = srgb[3];\n\n  for (let i = 0; i < 3; i++) {\n    const c = srgb[i];\n    if (c <= 0.04045) {\n      // eslint-disable-next-line no-loss-of-precision\n      linear[i] = srgb[i] * 0.07739938080495356037151702786378;\n    } else {\n      linear[i] = Math.pow(\n        // eslint-disable-next-line no-loss-of-precision\n        (c + 0.055) * 0.94786729857819905213270142180095,\n        2.4\n      );\n    }\n  }\n\n  return linear;\n}\n\nfunction convertTechniquesToPbr(gltf, options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const baseColorTextureNames = defaultValue(\n    options.baseColorTextureNames,\n    defaultBaseColorTextureNames\n  );\n  const baseColorFactorNames = defaultValue(\n    options.baseColorFactorNames,\n    defaultBaseColorFactorNames\n  );\n\n  // Future work: convert other values like emissive, specular, etc. Only handling diffuse right now.\n  ForEach.material(gltf, function (material) {\n    ForEach.materialValue(material, function (value, name) {\n      if (baseColorTextureNames.indexOf(name) !== -1 && isTexture(value)) {\n        initializePbrMaterial(material);\n        material.pbrMetallicRoughness.baseColorTexture = value;\n      } else if (baseColorFactorNames.indexOf(name) !== -1 && isVec4(value)) {\n        initializePbrMaterial(material);\n        material.pbrMetallicRoughness.baseColorFactor = srgbToLinear(value);\n      }\n    });\n  });\n\n  removeExtension(gltf, \"KHR_techniques_webgl\");\n  removeExtension(gltf, \"KHR_blend\");\n}\n\nfunction convertMaterialsCommonToPbr(gltf) {\n  // Future work: convert KHR_materials_common lights to KHR_lights_punctual\n  ForEach.material(gltf, function (material) {\n    const materialsCommon = defaultValue(\n      material.extensions,\n      defaultValue.EMPTY_OBJECT\n    ).KHR_materials_common;\n\n    if (defined(materialsCommon)) {\n      const technique = materialsCommon.technique;\n      if (technique === \"CONSTANT\") {\n        // Add the KHR_materials_unlit extension\n        addExtensionsUsed(gltf, \"KHR_materials_unlit\");\n        material.extensions = defined(material.extensions)\n          ? material.extensions\n          : {};\n        material.extensions[\"KHR_materials_unlit\"] = {};\n      }\n\n      const values = defined(materialsCommon.values)\n        ? materialsCommon.values\n        : {};\n\n      const ambient = values.ambient;\n      const diffuse = values.diffuse;\n      const emission = values.emission;\n      const transparency = values.transparency;\n\n      // These actually exist on the extension object, not the values object despite what's shown in the spec\n      const doubleSided = materialsCommon.doubleSided;\n      const transparent = materialsCommon.transparent;\n\n      // Ignore specular and shininess for now because the conversion to PBR\n      // isn't straightforward and depends on the technique\n      initializePbrMaterial(material);\n\n      if (defined(ambient)) {\n        if (isVec4(ambient)) {\n          material.emissiveFactor = ambient.slice(0, 3);\n        } else if (isTexture(ambient)) {\n          material.emissiveTexture = ambient;\n        }\n      }\n\n      if (defined(diffuse)) {\n        if (isVec4(diffuse)) {\n          material.pbrMetallicRoughness.baseColorFactor = srgbToLinear(diffuse);\n        } else if (isTexture(diffuse)) {\n          material.pbrMetallicRoughness.baseColorTexture = diffuse;\n        }\n      }\n\n      if (defined(doubleSided)) {\n        material.doubleSided = doubleSided;\n      }\n\n      if (defined(emission)) {\n        if (isVec4(emission)) {\n          material.emissiveFactor = emission.slice(0, 3);\n        } else if (isTexture(emission)) {\n          material.emissiveTexture = emission;\n        }\n      }\n\n      if (defined(transparency)) {\n        if (defined(material.pbrMetallicRoughness.baseColorFactor)) {\n          material.pbrMetallicRoughness.baseColorFactor[3] *= transparency;\n        } else {\n          material.pbrMetallicRoughness.baseColorFactor = [\n            1,\n            1,\n            1,\n            transparency,\n          ];\n        }\n      }\n\n      if (defined(transparent)) {\n        material.alphaMode = transparent ? \"BLEND\" : \"OPAQUE\";\n      }\n    }\n  });\n\n  removeExtension(gltf, \"KHR_materials_common\");\n}\n\nexport default updateVersion;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * An enum describing the built-in vertex attribute semantics.\n *\n * @enum {string}\n *\n * @private\n */\nconst VertexAttributeSemantic = {\n  /**\n   * Per-vertex position.\n   *\n   * @type {string}\n   * @constant\n   */\n  POSITION: \"POSITION\",\n\n  /**\n   * Per-vertex normal.\n   *\n   * @type {string}\n   * @constant\n   */\n  NORMAL: \"NORMAL\",\n\n  /**\n   * Per-vertex tangent.\n   *\n   * @type {string}\n   * @constant\n   */\n  TANGENT: \"TANGENT\",\n\n  /**\n   * Per-vertex texture coordinates.\n   *\n   * @type {string}\n   * @constant\n   */\n  TEXCOORD: \"TEXCOORD\",\n\n  /**\n   * Per-vertex color.\n   *\n   * @type {string}\n   * @constant\n   */\n  COLOR: \"COLOR\",\n\n  /**\n   * Per-vertex joint IDs for skinning.\n   *\n   * @type {string}\n   * @constant\n   */\n  JOINTS: \"JOINTS\",\n\n  /**\n   * Per-vertex joint weights for skinning.\n   *\n   * @type {string}\n   * @constant\n   */\n  WEIGHTS: \"WEIGHTS\",\n\n  /**\n   * Per-vertex feature ID.\n   *\n   * @type {string}\n   * @constant\n   */\n  FEATURE_ID: \"_FEATURE_ID\",\n};\n\nfunction semanticToVariableName(semantic) {\n  switch (semantic) {\n    case VertexAttributeSemantic.POSITION:\n      return \"positionMC\";\n    case VertexAttributeSemantic.NORMAL:\n      return \"normalMC\";\n    case VertexAttributeSemantic.TANGENT:\n      return \"tangentMC\";\n    case VertexAttributeSemantic.TEXCOORD:\n      return \"texCoord\";\n    case VertexAttributeSemantic.COLOR:\n      return \"color\";\n    case VertexAttributeSemantic.JOINTS:\n      return \"joints\";\n    case VertexAttributeSemantic.WEIGHTS:\n      return \"weights\";\n    case VertexAttributeSemantic.FEATURE_ID:\n      return \"featureId\";\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\"semantic is not a valid value.\");\n    //>>includeEnd('debug');\n  }\n}\n\n/**\n * Returns whether the vertex attribute semantic can have a set index.\n *\n * @param {VertexAttributeSemantic} semantic The semantic.\n *\n * @returns {boolean} Whether the semantic can have a set index.\n *\n * @private\n */\nVertexAttributeSemantic.hasSetIndex = function (semantic) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"semantic\", semantic);\n  //>>includeEnd('debug');\n\n  switch (semantic) {\n    case VertexAttributeSemantic.POSITION:\n    case VertexAttributeSemantic.NORMAL:\n    case VertexAttributeSemantic.TANGENT:\n      return false;\n    case VertexAttributeSemantic.TEXCOORD:\n    case VertexAttributeSemantic.COLOR:\n    case VertexAttributeSemantic.JOINTS:\n    case VertexAttributeSemantic.WEIGHTS:\n    case VertexAttributeSemantic.FEATURE_ID:\n      return true;\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\"semantic is not a valid value.\");\n    //>>includeEnd('debug');\n  }\n};\n\n/**\n * Gets the vertex attribute semantic matching the glTF semantic.\n *\n * @param {string} gltfSemantic The glTF semantic.\n *\n * @returns {VertexAttributeSemantic|undefined} The vertex attribute semantic, or undefined if there is no match.\n *\n * @private\n */\nVertexAttributeSemantic.fromGltfSemantic = function (gltfSemantic) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"gltfSemantic\", gltfSemantic);\n  //>>includeEnd('debug');\n\n  let semantic = gltfSemantic;\n\n  // Strip the set index from the semantic\n  const setIndexRegex = /^(\\w+)_\\d+$/;\n  const setIndexMatch = setIndexRegex.exec(gltfSemantic);\n  if (setIndexMatch !== null) {\n    semantic = setIndexMatch[1];\n  }\n\n  switch (semantic) {\n    case \"POSITION\":\n      return VertexAttributeSemantic.POSITION;\n    case \"NORMAL\":\n      return VertexAttributeSemantic.NORMAL;\n    case \"TANGENT\":\n      return VertexAttributeSemantic.TANGENT;\n    case \"TEXCOORD\":\n      return VertexAttributeSemantic.TEXCOORD;\n    case \"COLOR\":\n      return VertexAttributeSemantic.COLOR;\n    case \"JOINTS\":\n      return VertexAttributeSemantic.JOINTS;\n    case \"WEIGHTS\":\n      return VertexAttributeSemantic.WEIGHTS;\n    case \"_FEATURE_ID\":\n      return VertexAttributeSemantic.FEATURE_ID;\n  }\n\n  return undefined;\n};\n\n/**\n * Gets the vertex attribute semantic matching the pnts semantic.\n *\n * @param {string} pntsSemantic The pnts semantic.\n *\n * @returns {VertexAttributeSemantic|undefined} The vertex attribute semantic, or undefined if there is no match.\n *\n * @private\n */\nVertexAttributeSemantic.fromPntsSemantic = function (pntsSemantic) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"pntsSemantic\", pntsSemantic);\n  //>>includeEnd('debug');\n\n  switch (pntsSemantic) {\n    case \"POSITION\":\n    case \"POSITION_QUANTIZED\":\n      return VertexAttributeSemantic.POSITION;\n    case \"RGBA\":\n    case \"RGB\":\n    case \"RGB565\":\n      return VertexAttributeSemantic.COLOR;\n    case \"NORMAL\":\n    case \"NORMAL_OCT16P\":\n      return VertexAttributeSemantic.NORMAL;\n    case \"BATCH_ID\":\n      return VertexAttributeSemantic.FEATURE_ID;\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\"pntsSemantic is not a valid value.\");\n    //>>includeEnd('debug');\n  }\n};\n\n/**\n * Gets the GLSL type (such as <code>vec3</code> or <code>int</code>) for the\n * given vertex attribute.\n *\n * @param {VertexAttributeSemantic} semantic The semantic.\n *\n * @returns {string} The shader type.\n *\n * @private\n */\nVertexAttributeSemantic.getGlslType = function (semantic) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"semantic\", semantic);\n  //>>includeEnd('debug');\n\n  switch (semantic) {\n    case VertexAttributeSemantic.POSITION:\n    case VertexAttributeSemantic.NORMAL:\n    case VertexAttributeSemantic.TANGENT:\n      return \"vec3\";\n    case VertexAttributeSemantic.TEXCOORD:\n      return \"vec2\";\n    case VertexAttributeSemantic.COLOR:\n      return \"vec4\";\n    case VertexAttributeSemantic.JOINTS:\n      return \"ivec4\";\n    case VertexAttributeSemantic.WEIGHTS:\n      return \"vec4\";\n    case VertexAttributeSemantic.FEATURE_ID:\n      return \"int\";\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\"semantic is not a valid value.\");\n    //>>includeEnd('debug');\n  }\n};\n\n/**\n * Gets the variable name for the given semantic and set index.\n *\n * @param {VertexAttributeSemantic} semantic The semantic.\n * @param {number} [setIndex] The set index.\n *\n * @returns {string} The variable name.\n *\n * @private\n */\nVertexAttributeSemantic.getVariableName = function (semantic, setIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"semantic\", semantic);\n  //>>includeEnd('debug');\n\n  let variableName = semanticToVariableName(semantic);\n  if (defined(setIndex)) {\n    variableName += `_${setIndex}`;\n  }\n  return variableName;\n};\n\nexport default Object.freeze(VertexAttributeSemantic);\n", "import Cartesian3 from \"../../Core/Cartesian3.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport Quaternion from \"../../Core/Quaternion.js\";\nimport RuntimeError from \"../../Core/RuntimeError.js\";\nimport Axis from \"../Axis.js\";\nimport AttributeType from \"../AttributeType.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\nimport CullFace from \"../CullFace.js\";\nimport PrimitiveType from \"../../Core/PrimitiveType.js\";\nimport Matrix3 from \"../../Core/Matrix3.js\";\n\n/**\n * Utility functions for {@link Model}.\n *\n * @private\n */\nfunction ModelUtility() {}\n\n/**\n * Create a function for reporting when a model fails to load\n *\n * @param {string} type The type of object to report about\n * @param {string} path The URI of the model file\n * @param {Error} [error] The error which caused the failure\n * @returns {RuntimeError} An error for the failed model\n *\n * @private\n */\nModelUtility.getError = function (type, path, error) {\n  let message = `Failed to load ${type}: ${path}`;\n  if (defined(error) && defined(error.message)) {\n    message += `\\n${error.message}`;\n  }\n\n  const runtimeError = new RuntimeError(message);\n  if (defined(error)) {\n    // the original call stack is often more useful than the new error's stack,\n    // so add the information here\n    runtimeError.stack = `Original stack:\\n${error.stack}\\nHandler stack:\\n${runtimeError.stack}`;\n  }\n\n  return runtimeError;\n};\n\n/**\n * Get a transformation matrix from a node in the model.\n *\n * @param {ModelComponents.Node} node The node components\n * @returns {Matrix4} The computed transformation matrix. If no transformation matrix or parameters are specified, this will be the identity matrix.\n *\n * @private\n */\nModelUtility.getNodeTransform = function (node) {\n  if (defined(node.matrix)) {\n    return node.matrix;\n  }\n\n  return Matrix4.fromTranslationQuaternionRotationScale(\n    defined(node.translation) ? node.translation : Cartesian3.ZERO,\n    defined(node.rotation) ? node.rotation : Quaternion.IDENTITY,\n    defined(node.scale) ? node.scale : Cartesian3.ONE\n  );\n};\n\n/**\n * Find an attribute by semantic such as POSITION or TANGENT.\n *\n * @param {ModelComponents.Primitive|ModelComponents.Instances} object The primitive components or instances object\n * @param {VertexAttributeSemantic|InstanceAttributeSemantic} semantic The semantic to search for\n * @param {number} [setIndex] The set index of the semantic. May be undefined for some semantics (POSITION, NORMAL, TRANSLATION, ROTATION, for example)\n * @return {ModelComponents.Attribute} The selected attribute, or undefined if not found.\n *\n * @private\n */\nModelUtility.getAttributeBySemantic = function (object, semantic, setIndex) {\n  const attributes = object.attributes;\n  const attributesLength = attributes.length;\n  for (let i = 0; i < attributesLength; ++i) {\n    const attribute = attributes[i];\n    const matchesSetIndex = defined(setIndex)\n      ? attribute.setIndex === setIndex\n      : true;\n    if (attribute.semantic === semantic && matchesSetIndex) {\n      return attribute;\n    }\n  }\n\n  return undefined;\n};\n\n/**\n * Similar to getAttributeBySemantic, but search using the name field only,\n * as custom attributes do not have a semantic.\n *\n * @param {ModelComponents.Primitive|ModelComponents.Instances} object The primitive components or instances object\n * @param {string} name The name of the attribute as it appears in the model file.\n * @return {ModelComponents.Attribute} The selected attribute, or undefined if not found.\n *\n * @private\n */\nModelUtility.getAttributeByName = function (object, name) {\n  const attributes = object.attributes;\n  const attributesLength = attributes.length;\n  for (let i = 0; i < attributesLength; ++i) {\n    const attribute = attributes[i];\n    if (attribute.name === name) {\n      return attribute;\n    }\n  }\n\n  return undefined;\n};\n\n/**\n * Find a feature ID from an array with label or positionalLabel matching the\n * given label\n * @param {ModelComponents.FeatureIdAttribute[]|ModelComponents.FeatureIdImplicitRange[]|ModelComponents.FeatureIdTexture[]} featureIds\n * @param {string} label the label to search for\n * @returns {ModelComponents.FeatureIdAttribute|ModelComponents.FeatureIdImplicitRange|ModelComponents.FeatureIdTexture} The feature ID set if found, otherwise <code>undefined</code>\n *\n * @private\n */\nModelUtility.getFeatureIdsByLabel = function (featureIds, label) {\n  for (let i = 0; i < featureIds.length; i++) {\n    const featureIdSet = featureIds[i];\n    if (\n      featureIdSet.positionalLabel === label ||\n      featureIdSet.label === label\n    ) {\n      return featureIdSet;\n    }\n  }\n\n  return undefined;\n};\n\nModelUtility.hasQuantizedAttributes = function (attributes) {\n  if (!defined(attributes)) {\n    return false;\n  }\n\n  for (let i = 0; i < attributes.length; i++) {\n    const attribute = attributes[i];\n    if (defined(attribute.quantization)) {\n      return true;\n    }\n  }\n  return false;\n};\n\n/**\n * @param {ModelComponents.Attribute} attribute\n *\n * @private\n */\nModelUtility.getAttributeInfo = function (attribute) {\n  const semantic = attribute.semantic;\n  const setIndex = attribute.setIndex;\n\n  let variableName;\n  let hasSemantic = false;\n  if (defined(semantic)) {\n    variableName = VertexAttributeSemantic.getVariableName(semantic, setIndex);\n    hasSemantic = true;\n  } else {\n    variableName = attribute.name;\n    // According to the glTF 2.0 spec, custom attributes must be prepended with\n    // an underscore.\n    variableName = variableName.replace(/^_/, \"\");\n    variableName = variableName.toLowerCase();\n  }\n\n  const isVertexColor = /^color_\\d+$/.test(variableName);\n  const attributeType = attribute.type;\n  let glslType = AttributeType.getGlslType(attributeType);\n\n  // color_n can be either a vec3 or a vec4. But in GLSL we can always use\n  // attribute vec4 since GLSL promotes vec3 attribute data to vec4 with\n  // the .a channel set to 1.0.\n  if (isVertexColor) {\n    glslType = \"vec4\";\n  }\n\n  const isQuantized = defined(attribute.quantization);\n  let quantizedGlslType;\n  if (isQuantized) {\n    // The quantized color_n attribute also is promoted to a vec4 in the shader\n    quantizedGlslType = isVertexColor\n      ? \"vec4\"\n      : AttributeType.getGlslType(attribute.quantization.type);\n  }\n\n  return {\n    attribute: attribute,\n    isQuantized: isQuantized,\n    variableName: variableName,\n    hasSemantic: hasSemantic,\n    glslType: glslType,\n    quantizedGlslType: quantizedGlslType,\n  };\n};\n\nconst cartesianMaxScratch = new Cartesian3();\nconst cartesianMinScratch = new Cartesian3();\n\n/**\n * Get the minimum and maximum values for a primitive's POSITION attribute.\n * This is used to compute the bounding sphere of the primitive, as well as\n * the bounding sphere of the whole model.\n *\n * @param {ModelComponents.Primitive} primitive The primitive components.\n * @param {Cartesian3} [instancingTranslationMin] The component-wise minimum value of the instancing translation attribute.\n * @param {Cartesian3} [instancingTranslationMax] The component-wise maximum value of the instancing translation attribute.\n *\n * @returns {object} An object containing the minimum and maximum position values.\n *\n * @private\n */\nModelUtility.getPositionMinMax = function (\n  primitive,\n  instancingTranslationMin,\n  instancingTranslationMax\n) {\n  const positionGltfAttribute = ModelUtility.getAttributeBySemantic(\n    primitive,\n    \"POSITION\"\n  );\n\n  let positionMax = positionGltfAttribute.max;\n  let positionMin = positionGltfAttribute.min;\n\n  if (defined(instancingTranslationMax) && defined(instancingTranslationMin)) {\n    positionMin = Cartesian3.add(\n      positionMin,\n      instancingTranslationMin,\n      cartesianMinScratch\n    );\n    positionMax = Cartesian3.add(\n      positionMax,\n      instancingTranslationMax,\n      cartesianMaxScratch\n    );\n  }\n\n  return {\n    min: positionMin,\n    max: positionMax,\n  };\n};\n\n/**\n * Model matrices in a model file (e.g. glTF) are typically in a different\n * coordinate system, such as with y-up instead of z-up in 3D Tiles.\n * This function returns a matrix that will correct this such that z is up,\n * and x is forward.\n *\n * @param {Axis} upAxis The original up direction\n * @param {Axis} forwardAxis The original forward direction\n * @param {Matrix4} result The matrix in which to store the result.\n * @returns {Matrix4} The axis correction matrix\n *\n * @private\n */\nModelUtility.getAxisCorrectionMatrix = function (upAxis, forwardAxis, result) {\n  result = Matrix4.clone(Matrix4.IDENTITY, result);\n\n  if (upAxis === Axis.Y) {\n    result = Matrix4.clone(Axis.Y_UP_TO_Z_UP, result);\n  } else if (upAxis === Axis.X) {\n    result = Matrix4.clone(Axis.X_UP_TO_Z_UP, result);\n  }\n\n  if (forwardAxis === Axis.Z) {\n    // glTF 2.0 has a Z-forward convention that must be adapted here to X-forward.\n    result = Matrix4.multiplyTransformation(result, Axis.Z_UP_TO_X_UP, result);\n  }\n\n  return result;\n};\n\nconst scratchMatrix3 = new Matrix3();\n\n/**\n * Get the cull face to use in the command's render state.\n * <p>\n * From the glTF spec section 3.7.4:\n * When a mesh primitive uses any triangle-based topology (i.e., triangles,\n * triangle strip, or triangle fan), the determinant of the node\u2019s global\n * transform defines the winding order of that primitive. If the determinant\n * is a positive value, the winding order triangle faces is counterclockwise;\n * in the opposite case, the winding order is clockwise.\n * </p>\n *\n * @param {Matrix4} modelMatrix The model matrix\n * @param {PrimitiveType} primitiveType The primitive type\n * @returns {CullFace} The cull face\n *\n * @private\n */\nModelUtility.getCullFace = function (modelMatrix, primitiveType) {\n  if (!PrimitiveType.isTriangles(primitiveType)) {\n    return CullFace.BACK;\n  }\n\n  const matrix3 = Matrix4.getMatrix3(modelMatrix, scratchMatrix3);\n  return Matrix3.determinant(matrix3) < 0.0 ? CullFace.FRONT : CullFace.BACK;\n};\n\n/**\n * Sanitize the identifier to be used in a GLSL shader. The identifier\n * is sanitized as follows:\n * - Replace all sequences of non-alphanumeric characters with a single `_`.\n * - If the gl_ prefix is present, remove it. The prefix is reserved in GLSL.\n * - If the identifier starts with a digit, prefix it with an underscore.\n *\n * @example\n * // Returns \"customProperty\"\n * ModelUtility.sanitizeGlslIdentifier(\"gl_customProperty\");\n *\n * @example\n * // Returns \"_1234\"\n * ModelUtility.sanitizeGlslIdentifier(\"1234\");\n *\n * @param {string} identifier The original identifier.\n *\n * @returns {string} The sanitized version of the identifier.\n */\nModelUtility.sanitizeGlslIdentifier = function (identifier) {\n  // Remove non-alphanumeric characters and replace with a single underscore.\n  // This regex is designed so that the result won't have multiple underscores\n  // in a row.\n  let sanitizedIdentifier = identifier.replaceAll(/[^A-Za-z0-9]+/g, \"_\");\n  // Remove the gl_ prefix if present.\n  sanitizedIdentifier = sanitizedIdentifier.replace(/^gl_/, \"\");\n  // Add an underscore if first character is a digit.\n  if (/^\\d/.test(sanitizedIdentifier)) {\n    sanitizedIdentifier = `_${sanitizedIdentifier}`;\n  }\n\n  return sanitizedIdentifier;\n};\n\nModelUtility.supportedExtensions = {\n  AGI_articulations: true,\n  CESIUM_primitive_outline: true,\n  CESIUM_RTC: true,\n  EXT_feature_metadata: true,\n  EXT_instance_features: true,\n  EXT_mesh_features: true,\n  EXT_mesh_gpu_instancing: true,\n  EXT_meshopt_compression: true,\n  EXT_structural_metadata: true,\n  EXT_texture_webp: true,\n  KHR_blend: true,\n  KHR_draco_mesh_compression: true,\n  KHR_techniques_webgl: true,\n  KHR_materials_common: true,\n  KHR_materials_pbrSpecularGlossiness: true,\n  KHR_materials_unlit: true,\n  KHR_mesh_quantization: true,\n  KHR_texture_basisu: true,\n  KHR_texture_transform: true,\n  WEB3D_quantized_attributes: true,\n};\n\n/**\n * Checks whether or not the extensions required by the glTF are\n * supported. If an unsupported extension is found, this throws\n * a {@link RuntimeError} with the extension name.\n *\n * @param {string[]} extensionsRequired The extensionsRequired array in the glTF.\n *\n * @exception {RuntimeError} Unsupported glTF Extension\n */\nModelUtility.checkSupportedExtensions = function (extensionsRequired) {\n  const length = extensionsRequired.length;\n  for (let i = 0; i < length; i++) {\n    const extension = extensionsRequired[i];\n    if (!ModelUtility.supportedExtensions[extension]) {\n      throw new RuntimeError(`Unsupported glTF Extension: ${extension}`);\n    }\n  }\n};\n\nexport default ModelUtility;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport getMagic from \"../Core/getMagic.js\";\nimport isDataUri from \"../Core/isDataUri.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport addDefaults from \"./GltfPipeline/addDefaults.js\";\nimport addPipelineExtras from \"./GltfPipeline/addPipelineExtras.js\";\nimport ForEach from \"./GltfPipeline/ForEach.js\";\nimport parseGlb from \"./GltfPipeline/parseGlb.js\";\nimport removePipelineExtras from \"./GltfPipeline/removePipelineExtras.js\";\nimport updateVersion from \"./GltfPipeline/updateVersion.js\";\nimport usesExtension from \"./GltfPipeline/usesExtension.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\nimport ModelUtility from \"./Model/ModelUtility.js\";\n\n/**\n * Loads a glTF JSON from a glTF or glb.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfJsonLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {object} options Object with the following properties:\n * @param {ResourceCache} options.resourceCache The {@link ResourceCache} (to avoid circular dependencies).\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {Uint8Array} [options.typedArray] The typed array containing the glTF contents.\n * @param {object} [options.gltfJson] The parsed glTF JSON contents.\n * @param {string} [options.cacheKey] The cache key of the resource.\n *\n * @private\n */\nfunction GltfJsonLoader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const resourceCache = options.resourceCache;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n  const typedArray = options.typedArray;\n  const gltfJson = options.gltfJson;\n  const cacheKey = options.cacheKey;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.func(\"options.resourceCache\", resourceCache);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  //>>includeEnd('debug');\n\n  this._resourceCache = resourceCache;\n  this._gltfResource = gltfResource;\n  this._baseResource = baseResource;\n  this._typedArray = typedArray;\n  this._gltfJson = gltfJson;\n  this._cacheKey = cacheKey;\n  this._gltf = undefined;\n  this._bufferLoaders = [];\n  this._state = ResourceLoaderState.UNLOADED;\n  this._promise = undefined;\n}\n\nif (defined(Object.create)) {\n  GltfJsonLoader.prototype = Object.create(ResourceLoader.prototype);\n  GltfJsonLoader.prototype.constructor = GltfJsonLoader;\n}\n\nObject.defineProperties(GltfJsonLoader.prototype, {\n  /**\n   * The cache key of the resource.\n   *\n   * @memberof GltfJsonLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    get: function () {\n      return this._cacheKey;\n    },\n  },\n  /**\n   * The glTF JSON.\n   *\n   * @memberof GltfJsonLoader.prototype\n   *\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  gltf: {\n    get: function () {\n      return this._gltf;\n    },\n  },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise<GltfJsonLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfJsonLoader.prototype.load = async function () {\n  if (defined(this._promise)) {\n    return this._promise;\n  }\n\n  this._state = ResourceLoaderState.LOADING;\n\n  if (defined(this._gltfJson)) {\n    this._promise = processGltfJson(this, this._gltfJson);\n    return this._promise;\n  }\n\n  if (defined(this._typedArray)) {\n    this._promise = processGltfTypedArray(this, this._typedArray);\n    return this._promise;\n  }\n\n  this._promise = loadFromUri(this);\n  return this._promise;\n};\n\nasync function loadFromUri(gltfJsonLoader) {\n  let typedArray;\n  try {\n    const arrayBuffer = await gltfJsonLoader._fetchGltf();\n    if (gltfJsonLoader.isDestroyed()) {\n      return;\n    }\n\n    typedArray = new Uint8Array(arrayBuffer);\n  } catch (error) {\n    if (gltfJsonLoader.isDestroyed()) {\n      return;\n    }\n\n    handleError(gltfJsonLoader, error);\n  }\n\n  return processGltfTypedArray(gltfJsonLoader, typedArray);\n}\n\nfunction handleError(gltfJsonLoader, error) {\n  gltfJsonLoader.unload();\n  gltfJsonLoader._state = ResourceLoaderState.FAILED;\n  const errorMessage = `Failed to load glTF: ${gltfJsonLoader._gltfResource.url}`;\n  throw gltfJsonLoader.getError(errorMessage, error);\n}\n\nasync function upgradeVersion(gltfJsonLoader, gltf) {\n  if (\n    defined(gltf.asset) &&\n    gltf.asset.version === \"2.0\" &&\n    !usesExtension(gltf, \"KHR_techniques_webgl\") &&\n    !usesExtension(gltf, \"KHR_materials_common\")\n  ) {\n    return Promise.resolve();\n  }\n\n  // Load all buffers into memory. updateVersion will read and in some cases modify\n  // the buffer data, which it accesses from buffer.extras._pipeline.source\n  const promises = [];\n  ForEach.buffer(gltf, function (buffer) {\n    if (\n      !defined(buffer.extras._pipeline.source) && // Ignore uri if this buffer uses the glTF 1.0 KHR_binary_glTF extension\n      defined(buffer.uri)\n    ) {\n      const resource = gltfJsonLoader._baseResource.getDerivedResource({\n        url: buffer.uri,\n      });\n      const resourceCache = gltfJsonLoader._resourceCache;\n      const bufferLoader = resourceCache.getExternalBufferLoader({\n        resource: resource,\n      });\n      gltfJsonLoader._bufferLoaders.push(bufferLoader);\n\n      promises.push(\n        bufferLoader.load().then(function () {\n          if (bufferLoader.isDestroyed()) {\n            return;\n          }\n\n          buffer.extras._pipeline.source = bufferLoader.typedArray;\n        })\n      );\n    }\n  });\n\n  await Promise.all(promises);\n  updateVersion(gltf);\n}\n\nfunction decodeDataUris(gltf) {\n  const promises = [];\n  ForEach.buffer(gltf, function (buffer) {\n    const bufferUri = buffer.uri;\n    if (\n      !defined(buffer.extras._pipeline.source) && // Ignore uri if this buffer uses the glTF 1.0 KHR_binary_glTF extension\n      defined(bufferUri) &&\n      isDataUri(bufferUri)\n    ) {\n      delete buffer.uri; // Delete the data URI to keep the cached glTF JSON small\n      promises.push(\n        Resource.fetchArrayBuffer(bufferUri).then(function (arrayBuffer) {\n          buffer.extras._pipeline.source = new Uint8Array(arrayBuffer);\n        })\n      );\n    }\n  });\n  return Promise.all(promises);\n}\n\nfunction loadEmbeddedBuffers(gltfJsonLoader, gltf) {\n  const promises = [];\n  ForEach.buffer(gltf, function (buffer, bufferId) {\n    const source = buffer.extras._pipeline.source;\n    if (defined(source) && !defined(buffer.uri)) {\n      const resourceCache = gltfJsonLoader._resourceCache;\n      const bufferLoader = resourceCache.getEmbeddedBufferLoader({\n        parentResource: gltfJsonLoader._gltfResource,\n        bufferId: bufferId,\n        typedArray: source,\n      });\n      gltfJsonLoader._bufferLoaders.push(bufferLoader);\n      promises.push(bufferLoader.load());\n    }\n  });\n  return Promise.all(promises);\n}\n\nasync function processGltfJson(gltfJsonLoader, gltf) {\n  try {\n    addPipelineExtras(gltf);\n\n    await decodeDataUris(gltf);\n    await upgradeVersion(gltfJsonLoader, gltf);\n    addDefaults(gltf);\n    await loadEmbeddedBuffers(gltfJsonLoader, gltf);\n    removePipelineExtras(gltf);\n\n    const version = gltf.asset.version;\n    if (version !== \"1.0\" && version !== \"2.0\") {\n      throw new RuntimeError(`Unsupported glTF version: ${version}`);\n    }\n\n    const extensionsRequired = gltf.extensionsRequired;\n    if (defined(extensionsRequired)) {\n      ModelUtility.checkSupportedExtensions(extensionsRequired);\n    }\n\n    gltfJsonLoader._gltf = gltf;\n    gltfJsonLoader._state = ResourceLoaderState.READY;\n    return gltfJsonLoader;\n  } catch (error) {\n    if (gltfJsonLoader.isDestroyed()) {\n      return;\n    }\n\n    handleError(gltfJsonLoader, error);\n  }\n}\n\nasync function processGltfTypedArray(gltfJsonLoader, typedArray) {\n  let gltf;\n  try {\n    if (getMagic(typedArray) === \"glTF\") {\n      gltf = parseGlb(typedArray);\n    } else {\n      gltf = getJsonFromTypedArray(typedArray);\n    }\n  } catch (error) {\n    if (gltfJsonLoader.isDestroyed()) {\n      return;\n    }\n\n    handleError(gltfJsonLoader, error);\n  }\n\n  return processGltfJson(gltfJsonLoader, gltf);\n}\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfJsonLoader.prototype.unload = function () {\n  const bufferLoaders = this._bufferLoaders;\n  const bufferLoadersLength = bufferLoaders.length;\n  for (let i = 0; i < bufferLoadersLength; ++i) {\n    bufferLoaders[i] =\n      !bufferLoaders[i].isDestroyed() &&\n      this._resourceCache.unload(bufferLoaders[i]);\n  }\n  this._bufferLoaders.length = 0;\n\n  this._gltf = undefined;\n};\n\n/**\n * Exposed for testing\n *\n * @private\n */\nGltfJsonLoader.prototype._fetchGltf = function () {\n  return this._gltfResource.fetchArrayBuffer();\n};\n\nexport default GltfJsonLoader;\n", "/**\n * The alpha rendering mode of the material.\n *\n * @enum {string}\n * @private\n */\nconst AlphaMode = {\n  /**\n   * The alpha value is ignored and the rendered output is fully opaque.\n   *\n   * @type {string}\n   * @constant\n   */\n  OPAQUE: \"OPAQUE\",\n\n  /**\n   * The rendered output is either fully opaque or fully transparent depending on the alpha value and the specified alpha cutoff value.\n   *\n   * @type {string}\n   * @constant\n   */\n  MASK: \"MASK\",\n\n  /**\n   * The rendered output is composited onto the destination with alpha blending.\n   *\n   * @type {string}\n   * @constant\n   */\n  BLEND: \"BLEND\",\n};\n\nexport default Object.freeze(AlphaMode);\n", "import AlphaMode from \"./AlphaMode.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\n\n/**\n * Components for building models.\n *\n * @namespace ModelComponents\n *\n * @private\n */\nconst ModelComponents = {};\n\n/**\n * Information about the quantized attribute.\n *\n * @alias ModelComponents.Quantization\n * @constructor\n *\n * @private\n */\nfunction Quantization() {\n  /**\n   * Whether the quantized attribute is oct-encoded.\n   *\n   * @type {boolean}\n   * @private\n   */\n  this.octEncoded = false;\n\n  /**\n   * Whether the oct-encoded values are stored as ZXY instead of XYZ. This is true when decoding from Draco.\n   *\n   * @type {boolean}\n   * @private\n   */\n  this.octEncodedZXY = false;\n\n  /**\n   * The range used to convert buffer values to normalized values [0.0, 1.0]\n   * This is typically computed as (1 << quantizationBits) - 1.\n   * For oct-encoded values this value is a single Number.\n   *\n   * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n   * @private\n   */\n  this.normalizationRange = undefined;\n\n  /**\n   * The bottom-left corner of the quantization volume. Not applicable for oct encoded attributes.\n   * The type should match the attribute type - e.g. if the attribute type\n   * is AttributeType.VEC4 the offset should be a Cartesian4.\n   *\n   * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n   * @private\n   */\n  this.quantizedVolumeOffset = undefined;\n\n  /**\n   * The dimensions of the quantization volume. Not applicable for oct encoded attributes.\n   * The type should match the attribute type - e.g. if the attribute type\n   * is AttributeType.VEC4 the dimensions should be a Cartesian4.\n   *\n   * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n   * @private\n   */\n  this.quantizedVolumeDimensions = undefined;\n\n  /**\n   * The step size of the quantization volume, equal to\n   * quantizedVolumeDimensions / normalizationRange (component-wise).\n   * Not applicable for oct encoded attributes.\n   * The type should match the attribute type - e.g. if the attribute type\n   * is AttributeType.VEC4 the dimensions should be a Cartesian4.\n   *\n   * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n   * @private\n   */\n  this.quantizedVolumeStepSize = undefined;\n\n  /**\n   * The component data type of the quantized attribute, e.g. ComponentDatatype.UNSIGNED_SHORT.\n   *\n   * <p>\n   * The following component datatypes are not supported:\n   * <ul>\n   *   <li>ComponentDatatype.INT</li>\n   *   <li>ComponentDatatype.UNSIGNED_INT</li>\n   *   <li>ComponentDatatype.DOUBLE</li>\n   * </ul>\n   * </p>\n   *\n   * @type {ComponentDatatype}\n   * @private\n   */\n  this.componentDatatype = undefined;\n\n  /**\n   * The type of the quantized attribute, e.g. AttributeType.VEC2 for oct-encoded normals.\n   *\n   * @type {AttributeType}\n   * @private\n   */\n  this.type = undefined;\n}\n\n/**\n * A per-vertex or per-instance attribute.\n *\n * @alias ModelComponents.Attribute\n * @constructor\n *\n * @private\n */\nfunction Attribute() {\n  /**\n   * The attribute name. Must be unique within the attributes array.\n   *\n   * @type {string}\n   * @private\n   */\n  this.name = undefined;\n\n  /**\n   * The attribute semantic. The combination of semantic and setIndex must be\n   * unique within the attributes array.\n   *\n   * @type {VertexAttributeSemantic|InstanceAttributeSemantic}\n   * @private\n   */\n  this.semantic = undefined;\n\n  /**\n   * The set index of the attribute. Only applicable when the attribute has one\n   * of the following semantics:\n   *\n   * <ul>\n   *   <li>{@link VertexAttributeSemantic.TEXCOORD}</li>\n   *   <li>{@link VertexAttributeSemantic.COLOR}</li>\n   *   <li>{@link VertexAttributeSemantic.JOINTS}</li>\n   *   <li>{@link VertexAttributeSemantic.WEIGHTS}</li>\n   *   <li>{@link VertexAttributeSemantic.FEATURE_ID}</li>\n   *   <li>{@link InstanceAttributeSemantic.FEATURE_ID}</li>\n   * </ul>\n   */\n  this.setIndex = undefined;\n\n  /**\n   * The component data type of the attribute.\n   * <p>\n   * When the data is quantized the componentDatatype should match the\n   * dequantized data, which is typically ComponentDatatype.FLOAT.\n   * </p>\n   * <p>\n   * The following component datatypes are not supported:\n   * <ul>\n   *   <li>ComponentDatatype.INT</li>\n   *   <li>ComponentDatatype.UNSIGNED_INT</li>\n   *   <li>ComponentDatatype.DOUBLE</li>\n   * </ul>\n   * </p>\n   *\n   * @type {ComponentDatatype}\n   * @private\n   */\n  this.componentDatatype = undefined;\n\n  /**\n   * The type of the attribute.\n   * <p>\n   * When the data is oct-encoded the type should match the decoded data, which\n   * is typically AttributeType.VEC3.\n   * </p>\n   *\n   * @type {AttributeType}\n   * @private\n   */\n  this.type = undefined;\n\n  /**\n   * Whether the attribute is normalized.\n   *\n   * @type {boolean}\n   * @default false\n   * @private\n   */\n  this.normalized = false;\n\n  /**\n   * The number of elements.\n   *\n   * @type {number}\n   * @private\n   */\n  this.count = undefined;\n\n  /**\n   * Minimum value of each component in the attribute.\n   * <p>\n   * When the data is quantized the min should match the dequantized data.\n   * The normalized property has no effect on these values.\n   * </p>\n   * <p>\n   * Must be defined for POSITION attributes.\n   * </p>\n   *\n   * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n   * @private\n   */\n  this.min = undefined;\n\n  /**\n   * Maximum value of each component in the attribute.\n   * <p>\n   * When the data is quantized the max should match the dequantized data.\n   * The normalized property has no effect on these values.\n   * </p>\n   * <p>\n   * Must be defined for POSITION attributes.\n   * </p>\n   *\n   * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n   * @private\n   */\n  this.max = undefined;\n\n  /**\n   * A constant value used for all elements when typed array and buffer are undefined.\n   *\n   * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n   * @private\n   */\n  this.constant = undefined;\n\n  /**\n   * Information about the quantized attribute.\n   *\n   * @type {ModelComponents.Quantization}\n   * @private\n   */\n  this.quantization = undefined;\n\n  /**\n   * A typed array containing tightly-packed attribute values, as they appear\n   * in the model file.\n   *\n   * @type {Uint8Array|Int8Array|Uint16Array|Int16Array|Uint32Array|Int32Array|Float32Array}\n   * @private\n   */\n  this.typedArray = undefined;\n\n  /**\n   * A vertex buffer. Attribute values are accessed using byteOffset and byteStride.\n   *\n   * @type {Buffer}\n   * @private\n   */\n  this.buffer = undefined;\n\n  /**\n   * The byte offset of elements in the buffer.\n   *\n   * @type {number}\n   * @default 0\n   * @private\n   */\n  this.byteOffset = 0;\n\n  /**\n   * The byte stride of elements in the buffer. When undefined the elements are tightly packed.\n   *\n   * @type {number}\n   * @private\n   */\n  this.byteStride = undefined;\n}\n\n/**\n * Indices used to select vertices for rendering.\n *\n * @alias ModelComponents.Indices\n * @constructor\n *\n * @private\n */\nfunction Indices() {\n  /**\n   * The index data type of the attribute, e.g. IndexDatatype.UNSIGNED_SHORT.\n   *\n   * @type {IndexDatatype}\n   * @private\n   */\n  this.indexDatatype = undefined;\n\n  /**\n   * The number of indices.\n   *\n   * @type {number}\n   * @private\n   */\n  this.count = undefined;\n\n  /**\n   * An index buffer containing indices.\n   *\n   * @type {Buffer}\n   * @private\n   */\n  this.buffer = undefined;\n\n  /**\n   * A typed array containing indices.\n   *\n   * @type {Uint8Array|Uint16Array|Uint32Array}\n   * @private\n   */\n  this.typedArray = undefined;\n}\n\n/**\n * Maps per-vertex or per-instance feature IDs to a property table. Feature\n * IDs are stored in an accessor.\n *\n * @alias ModelComponents.FeatureIdAttribute\n * @constructor\n *\n * @private\n */\nfunction FeatureIdAttribute() {\n  /**\n   * How many unique features are defined in this set of feature IDs\n   *\n   * @type {number}\n   * @private\n   */\n  this.featureCount = undefined;\n\n  /**\n   * This value indicates that no feature is indicated with this vertex\n   *\n   * @type {number}\n   * @private\n   */\n  this.nullFeatureId = undefined;\n\n  /**\n   * The ID of the property table that feature IDs index into. If undefined,\n   * feature IDs are used for classification, but no metadata is associated.\n   *\n   *\n   * @type {number}\n   * @private\n   */\n  this.propertyTableId = undefined;\n\n  /**\n   * The set index of feature ID attribute containing feature IDs.\n   *\n   * @type {number}\n   * @private\n   */\n  this.setIndex = undefined;\n\n  /**\n   * The label to identify this set of feature IDs. This is used in picking,\n   * styling and shaders.\n   *\n   * @type {string}\n   * @private\n   */\n  this.label = undefined;\n\n  /**\n   * Label to identify this set of feature IDs by its position in the array.\n   * This will always be either \"featureId_N\" for primitives or\n   * \"instanceFeatureId_N\" for instances.\n   *\n   * @type {string}\n   * @private\n   */\n  this.positionalLabel = undefined;\n}\n\n/**\n * Defines a range of implicitly-defined feature IDs, one for each vertex or\n * instance. Such feature IDs may optionally be associated with a property table\n * storing metadata\n *\n * @alias ModelComponents.FeatureIdImplicitRange\n * @constructor\n *\n * @private\n */\nfunction FeatureIdImplicitRange() {\n  /**\n   * How many unique features are defined in this set of feature IDs\n   *\n   * @type {number}\n   * @private\n   */\n  this.featureCount = undefined;\n\n  /**\n   * This value indicates that no feature is indicated with this vertex\n   *\n   * @type {number}\n   * @private\n   */\n  this.nullFeatureId = undefined;\n\n  /**\n   * The ID of the property table that feature IDs index into. If undefined,\n   * feature IDs are used for classification, but no metadata is associated.\n   *\n   * @type {number}\n   * @private\n   */\n  this.propertyTableId = undefined;\n\n  /**\n   * The first feature ID to use when setIndex is undefined\n   *\n   * @type {number}\n   * @default 0\n   * @private\n   */\n  this.offset = 0;\n\n  /**\n   * Number of times each feature ID is repeated before being incremented.\n   *\n   * @type {number}\n   * @private\n   */\n  this.repeat = undefined;\n\n  /**\n   * The label to identify this set of feature IDs. This is used in picking,\n   * styling and shaders.\n   *\n   * @type {string}\n   * @private\n   */\n  this.label = undefined;\n\n  /**\n   * Label to identify this set of feature IDs by its position in the array.\n   * This will always be either \"featureId_N\" for primitives or\n   * \"instanceFeatureId_N\" for instances.\n   *\n   * @type {string}\n   * @private\n   */\n  this.positionalLabel = undefined;\n}\n\n/**\n * A texture that contains per-texel feature IDs that index into a property table.\n *\n * @alias ModelComponents.FeatureIdTexture\n * @constructor\n *\n * @private\n */\nfunction FeatureIdTexture() {\n  /**\n   * How many unique features are defined in this set of feature IDs\n   *\n   * @type {number}\n   * @private\n   */\n  this.featureCount = undefined;\n\n  /**\n   * This value indicates that no feature is indicated with this texel\n   *\n   * @type {number}\n   * @private\n   */\n  this.nullFeatureId = undefined;\n\n  /**\n   * The ID of the property table that feature IDs index into. If undefined,\n   * feature IDs are used for classification, but no metadata is associated.\n   *\n   * @type {string}\n   * @private\n   */\n  this.propertyTableId = undefined;\n\n  /**\n   * The texture reader containing feature IDs.\n   *\n   * @type {ModelComponents.TextureReader}\n   * @private\n   */\n  this.textureReader = undefined;\n\n  /**\n   * The label to identify this set of feature IDs. This is used in picking,\n   * styling and shaders.\n   *\n   * @type {string}\n   * @private\n   */\n  this.label = undefined;\n\n  /**\n   * Label to identify this set of feature IDs by its position in the array.\n   * This will always be either \"featureId_N\" for primitives or\n   * \"instanceFeatureId_N\" for instances.\n   *\n   * @type {string}\n   * @private\n   */\n  this.positionalLabel = undefined;\n}\n\n/**\n * A morph target where each attribute contains attribute displacement data.\n *\n * @alias ModelComponents.MorphTarget\n * @constructor\n *\n * @private\n */\nfunction MorphTarget() {\n  /**\n   * Attributes that are part of the morph target, e.g. positions, normals, and tangents.\n   *\n   * @type {ModelComponents.Attribute[]}\n   * @private\n   */\n  this.attributes = [];\n}\n\n/**\n * Geometry to be rendered with a material.\n *\n * @alias ModelComponents.Primitive\n * @constructor\n *\n * @private\n */\nfunction Primitive() {\n  /**\n   * The vertex attributes, e.g. positions, normals, etc.\n   *\n   * @type {ModelComponents.Attribute[]}\n   * @private\n   */\n  this.attributes = [];\n\n  /**\n   * The morph targets.\n   *\n   * @type {ModelComponents.MorphTarget[]}\n   * @private\n   */\n  this.morphTargets = [];\n\n  /**\n   * The indices.\n   *\n   * @type {ModelComponents.Indices}\n   * @private\n   */\n  this.indices = undefined;\n\n  /**\n   * The material.\n   *\n   * @type {ModelComponents.Material}\n   * @private\n   */\n  this.material = undefined;\n\n  /**\n   * The primitive type, e.g. PrimitiveType.TRIANGLES.\n   *\n   * @type {PrimitiveType}\n   * @private\n   */\n  this.primitiveType = undefined;\n\n  /**\n   * The feature IDs associated with this primitive. Feature ID types may\n   * be interleaved\n   *\n   * @type {Array<ModelComponents.FeatureIdAttribute|ModelComponents.FeatureIdImplicitRange|ModelComponents.FeatureIdTexture>}\n   * @private\n   */\n  this.featureIds = [];\n\n  /**\n   * The property texture IDs. These indices correspond to the array of\n   * property textures.\n   *\n   * @type {number[]}\n   * @private\n   */\n  this.propertyTextureIds = [];\n\n  /**\n   * The property attribute IDs. These indices correspond to the array of\n   * property attributes in the EXT_structural_metadata extension.\n   *\n   * @type {number[]}\n   * @private\n   */\n  this.propertyAttributeIds = [];\n\n  /**\n   * If the CESIUM_primitive_outline glTF extension is used, this property\n   * stores an additional attribute storing outline coordinates.\n   *\n   * @type {Attribute}\n   * @private\n   */\n  this.outlineCoordinates = undefined;\n}\n\n/**\n * Position and metadata information for instances of a node.\n *\n * @alias ModelComponents.Instances\n * @constructor\n *\n * @private\n */\nfunction Instances() {\n  /**\n   * The instance attributes, e.g. translation, rotation, scale, feature id, etc.\n   *\n   * @type {ModelComponents.Attribute[]}\n   * @private\n   */\n  this.attributes = [];\n\n  /**\n   * The feature ID attributes associated with this set of instances.\n   * Feature ID attribute types may be interleaved.\n   *\n   * @type {Array<ModelComponents.FeatureIdAttribute|ModelComponents.FeatureIdImplicitRange>}\n   * @private\n   */\n  this.featureIds = [];\n\n  /**\n   * Whether the instancing transforms are applied in world space. For glTF models that\n   * use EXT_mesh_gpu_instancing, the transform is applied in object space. For i3dm files,\n   * the instance transform is in world space.\n   *\n   * @type {boolean}\n   * @private\n   */\n  this.transformInWorldSpace = false;\n}\n\n/**\n * Joints and matrices defining a skin.\n *\n * @alias ModelComponents.Skin\n * @constructor\n *\n * @private\n */\nfunction Skin() {\n  /**\n   * The index of the skin in the glTF. This is useful for finding the skin\n   * that applies to a node after the skin is instantiated at runtime.\n   *\n   * @type {number}\n   * @private\n   */\n  this.index = undefined;\n\n  /**\n   * The joints.\n   *\n   * @type {ModelComponents.Node[]}\n   * @private\n   */\n  this.joints = [];\n\n  /**\n   * The inverse bind matrices of the joints.\n   *\n   * @type {Matrix4[]}\n   * @private\n   */\n  this.inverseBindMatrices = [];\n}\n\n/**\n * A node in the node hierarchy.\n *\n * @alias ModelComponents.Node\n * @constructor\n *\n * @private\n */\nfunction Node() {\n  /**\n   * The name of the node.\n   *\n   * @type {string}\n   * @private\n   */\n  this.name = undefined;\n\n  /**\n   * The index of the node in the glTF. This is useful for finding the nodes\n   * that belong to a skin after they have been instantiated at runtime.\n   *\n   * @type {number}\n   * @private\n   */\n  this.index = undefined;\n\n  /**\n   * The children nodes.\n   *\n   * @type {ModelComponents.Node[]}\n   * @private\n   */\n  this.children = [];\n\n  /**\n   * The mesh primitives.\n   *\n   * @type {ModelComponents.Primitive[]}\n   * @private\n   */\n  this.primitives = [];\n\n  /**\n   * Instances of this node.\n   *\n   * @type {ModelComponents.Instances}\n   * @private\n   */\n  this.instances = undefined;\n\n  /**\n   * The skin.\n   *\n   * @type {ModelComponents.Skin}\n   * @private\n   */\n  this.skin = undefined;\n\n  /**\n   * The local transformation matrix. When matrix is defined translation,\n   * rotation, and scale must be undefined. When matrix is undefined\n   * translation, rotation, and scale must all be defined.\n   *\n   * @type {Matrix4}\n   * @private\n   */\n  this.matrix = undefined;\n\n  /**\n   * The local translation.\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this.translation = undefined;\n\n  /**\n   * The local rotation.\n   *\n   * @type {Quaternion}\n   * @private\n   */\n  this.rotation = undefined;\n\n  /**\n   * The local scale.\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this.scale = undefined;\n\n  /**\n   * An array of weights to be applied to the primitives' morph targets.\n   * These are supplied by either the node or its mesh.\n   *\n   * @type {number[]}\n   * @private\n   */\n  this.morphWeights = [];\n\n  /**\n   * The name of the articulation affecting this node, as defined by the\n   * AGI_articulations extension.\n   *\n   * @type {string}\n   * @private\n   */\n  this.articulationName = undefined;\n}\n\n/**\n * A scene containing nodes.\n *\n * @alias ModelComponents.Scene\n * @constructor\n *\n * @private\n */\nfunction Scene() {\n  /**\n   * The nodes belonging to the scene.\n   *\n   * @type {ModelComponents.Node[]}\n   * @private\n   */\n  this.nodes = [];\n}\n\n/**\n * The property of the node that is targeted by an animation. The values of\n * this enum are used to look up the appropriate property on the runtime node.\n *\n * @alias {ModelComponents.AnimatedPropertyType}\n * @enum {string}\n *\n * @private\n */\nconst AnimatedPropertyType = {\n  TRANSLATION: \"translation\",\n  ROTATION: \"rotation\",\n  SCALE: \"scale\",\n  WEIGHTS: \"weights\",\n};\n\n/**\n * An animation sampler that describes the sources of animated keyframe data\n * and their interpolation.\n *\n * @alias {ModelComponents.AnimationSampler}\n * @constructor\n *\n * @private\n */\nfunction AnimationSampler() {\n  /**\n   * The timesteps of the animation.\n   *\n   * @type {number[]}\n   * @private\n   */\n  this.input = [];\n\n  /**\n   * The method used to interpolate between the animation's keyframe data.\n   *\n   * @type {InterpolationType}\n   * @private\n   */\n  this.interpolation = undefined;\n\n  /**\n   * The keyframe data of the animation.\n   *\n   * @type {number[]|Cartesian3[]|Quaternion[]}\n   * @private\n   */\n  this.output = [];\n}\n\n/**\n * An animation target, which specifies the node and property to animate.\n *\n * @alias {ModelComponents.AnimationTarget}\n * @constructor\n *\n * @private\n */\nfunction AnimationTarget() {\n  /**\n   * The node that will be affected by the animation.\n   *\n   * @type {ModelComponents.Node}\n   * @private\n   */\n  this.node = undefined;\n\n  /**\n   * The property of the node to be animated.\n   *\n   * @type {ModelComponents.AnimatedPropertyType}\n   * @private\n   */\n  this.path = undefined;\n}\n\n/**\n * An animation channel linking an animation sampler and the target it animates.\n *\n * @alias {ModelComponents.AnimationChannel}\n * @constructor\n *\n * @private\n */\nfunction AnimationChannel() {\n  /**\n   * The sampler used as the source of the animation data.\n   *\n   * @type {ModelComponents.AnimationSampler}\n   * @private\n   */\n  this.sampler = undefined;\n\n  /**\n   * The target of the animation.\n   *\n   * @type {ModelComponents.AnimationTarget}\n   * @private\n   */\n  this.target = undefined;\n}\n\n/**\n * An animation in the model.\n *\n * @alias {ModelComponents.Animation}\n * @constructor\n *\n * @private\n */\nfunction Animation() {\n  /**\n   * The name of the animation.\n   *\n   * @type {string}\n   * @private\n   */\n  this.name = undefined;\n\n  /**\n   * The samplers used in this animation.\n   *\n   * @type {ModelComponents.AnimationSampler[]}\n   * @private\n   */\n  this.samplers = [];\n\n  /**\n   * The channels used in this animation.\n   *\n   * @type {ModelComponents.AnimationChannel[]}\n   * @private\n   */\n  this.channels = [];\n}\n\n/**\n * An articulation stage belonging to an articulation from the\n * AGI_articulations extension.\n *\n * @alias {ModelComponents.ArticulationStage}\n * @constructor\n *\n * @private\n */\nfunction ArticulationStage() {\n  /**\n   * The name of the articulation stage.\n   *\n   * @type {string}\n   * @private\n   */\n  this.name = undefined;\n\n  /**\n   * The type of the articulation stage, defined by the type of motion it modifies.\n   *\n   * @type {ArticulationStageType}\n   * @private\n   */\n  this.type = undefined;\n\n  /**\n   * The minimum value for the range of motion of this articulation stage.\n   *\n   * @type {number}\n   * @private\n   */\n  this.minimumValue = undefined;\n\n  /**\n   * The maximum value for the range of motion of this articulation stage.\n   *\n   * @type {number}\n   * @private\n   */\n  this.maximumValue = undefined;\n\n  /**\n   * The initial value for this articulation stage.\n   *\n   * @type {number}\n   * @private\n   */\n  this.initialValue = undefined;\n}\n\n/**\n * An articulation for the model, as defined by the AGI_articulations extension.\n *\n * @alias {ModelComponents.Articulation}\n * @constructor\n *\n * @private\n */\nfunction Articulation() {\n  /**\n   * The name of the articulation.\n   *\n   * @type {string}\n   * @private\n   */\n  this.name = undefined;\n\n  /**\n   * The stages belonging to this articulation. The stages are applied to\n   * the model in order of appearance.\n   *\n   * @type {ModelComponents.ArticulationStage[]}\n   * @private\n   */\n  this.stages = [];\n}\n\n/**\n * The asset of the model.\n *\n * @alias {ModelComponents.Asset}\n * @constructor\n *\n * @private\n */\nfunction Asset() {\n  /**\n   * The credits of the model.\n   *\n   * @type {Credit[]}\n   * @private\n   */\n  this.credits = [];\n}\n\n/**\n * The components that make up a model.\n *\n * @alias ModelComponents.Components\n * @constructor\n *\n * @private\n */\nfunction Components() {\n  /**\n   * The asset of the model.\n   *\n   * @type {ModelComponents.Asset}\n   * @private\n   */\n  this.asset = new Asset();\n\n  /**\n   * The default scene.\n   *\n   * @type {ModelComponents.Scene}\n   * @private\n   */\n  this.scene = undefined;\n\n  /**\n   * All nodes in the model.\n   *\n   * @type {ModelComponents.Node[]}\n   */\n  this.nodes = [];\n\n  /**\n   * All skins in the model.\n   *\n   * @type {ModelComponents.Skin[]}\n   */\n  this.skins = [];\n\n  /**\n   * All animations in the model.\n   *\n   * @type {ModelComponents.Animation[]}\n   */\n  this.animations = [];\n\n  /**\n   * All articulations in the model as defined by the AGI_articulations extension.\n   *\n   * @type {ModelComponents.Articulation[]}\n   */\n  this.articulations = [];\n\n  /**\n   * Structural metadata containing the schema, property tables, property\n   * textures and property mappings\n   *\n   * @type {StructuralMetadata}\n   * @private\n   */\n  this.structuralMetadata = undefined;\n\n  /**\n   * The model's up axis.\n   *\n   * @type {Axis}\n   * @private\n   */\n  this.upAxis = undefined;\n\n  /**\n   * The model's forward axis.\n   *\n   * @type {Axis}\n   * @private\n   */\n  this.forwardAxis = undefined;\n\n  /**\n   * A world-space transform to apply to the primitives.\n   *\n   * @type {Matrix4}\n   * @private\n   */\n  this.transform = Matrix4.clone(Matrix4.IDENTITY);\n}\n\n/**\n * Information about a GPU texture, including the texture itself\n *\n * @alias ModelComponents.TextureReader\n * @constructor\n *\n * @private\n */\nfunction TextureReader() {\n  /**\n   * The underlying GPU texture. The {@link Texture} contains the sampler.\n   *\n   * @type {Texture}\n   * @private\n   */\n  this.texture = undefined;\n\n  /**\n   * The index of the texture in the glTF. This is useful for determining\n   * when textures are shared to avoid attaching a texture in multiple uniform\n   * slots in the shader.\n   *\n   * @type {number}\n   * @private\n   */\n  this.index = undefined;\n\n  /**\n   * The texture coordinate set.\n   *\n   * @type {number}\n   * @default 0\n   * @private\n   */\n  this.texCoord = 0;\n\n  /**\n   * Transformation matrix to apply to texture coordinates.\n   *\n   * @type {Matrix3}\n   * @default Matrix3.IDENTITY\n   */\n  this.transform = Matrix3.clone(Matrix3.IDENTITY);\n\n  /**\n   * The texture channels to read from. When undefined all channels are read.\n   *\n   * @type {string}\n   */\n  this.channels = undefined;\n}\n\n/**\n * Material properties for the PBR metallic roughness shading model.\n *\n * @alias ModelComponents.MetallicRoughness\n * @constructor\n *\n * @private\n */\nfunction MetallicRoughness() {\n  /**\n   * The base color texture reader.\n   *\n   * @type {ModelComponents.TextureReader}\n   * @private\n   */\n  this.baseColorTexture = undefined;\n\n  /**\n   * The metallic roughness texture reader.\n   *\n   * @type {ModelComponents.TextureReader}\n   * @private\n   */\n  this.metallicRoughnessTexture = undefined;\n\n  /**\n   * The base color factor.\n   *\n   * @type {Cartesian4}\n   * @default new Cartesian4(1.0, 1.0, 1.0, 1.0)\n   * @private\n   */\n  this.baseColorFactor = Cartesian4.clone(\n    MetallicRoughness.DEFAULT_BASE_COLOR_FACTOR\n  );\n\n  /**\n   * The metallic factor.\n   *\n   * @type {number}\n   * @default 1.0\n   * @private\n   */\n  this.metallicFactor = MetallicRoughness.DEFAULT_METALLIC_FACTOR;\n\n  /**\n   * The roughness factor.\n   *\n   * @type {number}\n   * @default 1.0\n   * @private\n   */\n  this.roughnessFactor = MetallicRoughness.DEFAULT_ROUGHNESS_FACTOR;\n}\n\n/**\n * @private\n */\nMetallicRoughness.DEFAULT_BASE_COLOR_FACTOR = Cartesian4.ONE;\n\n/**\n * @private\n */\nMetallicRoughness.DEFAULT_METALLIC_FACTOR = 1.0;\n\n/**\n * @private\n */\nMetallicRoughness.DEFAULT_ROUGHNESS_FACTOR = 1.0;\n\n/**\n * Material properties for the PBR specular glossiness shading model.\n *\n * @alias ModelComponents.SpecularGlossiness\n * @constructor\n *\n * @private\n */\nfunction SpecularGlossiness() {\n  /**\n   * The diffuse texture reader.\n   *\n   * @type {ModelComponents.TextureReader}\n   * @private\n   */\n  this.diffuseTexture = undefined;\n\n  /**\n   * The specular glossiness texture reader.\n   *\n   * @type {ModelComponents.TextureReader}\n   * @private\n   */\n  this.specularGlossinessTexture = undefined;\n\n  /**\n   * The diffuse factor.\n   *\n   * @type {Cartesian4}\n   * @default new Cartesian4(1.0, 1.0, 1.0, 1.0)\n   * @private\n   */\n  this.diffuseFactor = Cartesian4.clone(\n    SpecularGlossiness.DEFAULT_DIFFUSE_FACTOR\n  );\n\n  /**\n   * The specular factor.\n   *\n   * @type {Cartesian3}\n   * @default new Cartesian3(1.0, 1.0, 1.0)\n   * @private\n   */\n  this.specularFactor = Cartesian3.clone(\n    SpecularGlossiness.DEFAULT_SPECULAR_FACTOR\n  );\n\n  /**\n   * The glossiness factor.\n   *\n   * @type {number}\n   * @default 1.0\n   * @private\n   */\n  this.glossinessFactor = SpecularGlossiness.DEFAULT_GLOSSINESS_FACTOR;\n}\n\n/**\n * @private\n */\nSpecularGlossiness.DEFAULT_DIFFUSE_FACTOR = Cartesian4.ONE;\n\n/**\n * @private\n */\nSpecularGlossiness.DEFAULT_SPECULAR_FACTOR = Cartesian3.ONE;\n\n/**\n * @private\n */\nSpecularGlossiness.DEFAULT_GLOSSINESS_FACTOR = 1.0;\n\n/**\n * The material appearance of a primitive.\n *\n * @alias ModelComponent.Material\n * @constructor\n *\n * @private\n */\nfunction Material() {\n  /**\n   * Material properties for the PBR metallic roughness shading model.\n   *\n   * @type {ModelComponents.MetallicRoughness}\n   * @private\n   */\n  this.metallicRoughness = new MetallicRoughness();\n\n  /**\n   * Material properties for the PBR specular glossiness shading model.\n   *\n   * @type {ModelComponents.SpecularGlossiness}\n   * @private\n   */\n  this.specularGlossiness = undefined;\n\n  /**\n   * The emissive texture reader.\n   *\n   * @type {ModelComponents.TextureReader}\n   * @private\n   */\n  this.emissiveTexture = undefined;\n\n  /**\n   * The normal texture reader.\n   *\n   * @type {ModelComponents.TextureReader}\n   * @private\n   */\n  this.normalTexture = undefined;\n\n  /**\n   * The occlusion texture reader.\n   *\n   * @type {ModelComponents.TextureReader}\n   * @private\n   */\n  this.occlusionTexture = undefined;\n\n  /**\n   * The emissive factor.\n   *\n   * @type {Cartesian3}\n   * @default Cartesian3.ZERO\n   * @private\n   */\n  this.emissiveFactor = Cartesian3.clone(Material.DEFAULT_EMISSIVE_FACTOR);\n\n  /**\n   * The alpha mode.\n   *\n   * @type {AlphaMode}\n   * @default AlphaMode.OPAQUE\n   * @private\n   */\n  this.alphaMode = AlphaMode.OPAQUE;\n\n  /**\n   * The alpha cutoff value of the material for the MASK alpha mode.\n   *\n   * @type {number}\n   * @default 0.5\n   * @private\n   */\n  this.alphaCutoff = 0.5;\n\n  /**\n   * Specifies whether the material is double sided.\n   *\n   * @type {boolean}\n   * @default false\n   * @private\n   */\n  this.doubleSided = false;\n\n  /**\n   * Specifies whether the material is unlit.\n   *\n   * @type {boolean}\n   * @default false\n   * @private\n   */\n  this.unlit = false;\n}\n\n/**\n * @private\n */\nMaterial.DEFAULT_EMISSIVE_FACTOR = Cartesian3.ZERO;\n\nModelComponents.Quantization = Quantization;\nModelComponents.Attribute = Attribute;\nModelComponents.Indices = Indices;\nModelComponents.FeatureIdAttribute = FeatureIdAttribute;\nModelComponents.FeatureIdTexture = FeatureIdTexture;\nModelComponents.FeatureIdImplicitRange = FeatureIdImplicitRange;\nModelComponents.MorphTarget = MorphTarget;\nModelComponents.Primitive = Primitive;\nModelComponents.Instances = Instances;\nModelComponents.Skin = Skin;\nModelComponents.Node = Node;\nModelComponents.Scene = Scene;\nModelComponents.AnimatedPropertyType = Object.freeze(AnimatedPropertyType);\nModelComponents.AnimationSampler = AnimationSampler;\nModelComponents.AnimationTarget = AnimationTarget;\nModelComponents.AnimationChannel = AnimationChannel;\nModelComponents.Animation = Animation;\nModelComponents.ArticulationStage = ArticulationStage;\nModelComponents.Articulation = Articulation;\nModelComponents.Asset = Asset;\nModelComponents.Components = Components;\nModelComponents.TextureReader = TextureReader;\nModelComponents.MetallicRoughness = MetallicRoughness;\nModelComponents.SpecularGlossiness = SpecularGlossiness;\nModelComponents.Material = Material;\n\nexport default ModelComponents;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport ModelComponents from \"./ModelComponents.js\";\n\n/**\n * glTF loading utilities.\n *\n * @namespace GltfLoaderUtil\n *\n * @private\n */\nconst GltfLoaderUtil = {};\n\n/**\n * Get the image ID referenced by a texture.\n * <p>\n * When the texture has the EXT_texture_webp extension and the browser supports\n * WebP images the WebP image ID is returned.\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.gltf The glTF JSON.\n * @param {number} options.textureId The texture ID.\n * @param {SupportedImageFormats} options.supportedImageFormats The supported image formats.\n *\n * @returns {number} The image ID.\n * @private\n */\nGltfLoaderUtil.getImageIdFromTexture = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltf = options.gltf;\n  const textureId = options.textureId;\n  const supportedImageFormats = options.supportedImageFormats;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.number(\"options.textureId\", textureId);\n  Check.typeOf.object(\"options.supportedImageFormats\", supportedImageFormats);\n  //>>includeEnd('debug');\n\n  const texture = gltf.textures[textureId];\n  const extensions = texture.extensions;\n  if (defined(extensions)) {\n    if (supportedImageFormats.webp && defined(extensions.EXT_texture_webp)) {\n      return extensions.EXT_texture_webp.source;\n    } else if (\n      supportedImageFormats.basis &&\n      defined(extensions.KHR_texture_basisu)\n    ) {\n      return extensions.KHR_texture_basisu.source;\n    }\n  }\n  return texture.source;\n};\n\n/**\n * Create a sampler for a texture.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.gltf The glTF JSON.\n * @param {object} options.textureInfo The texture info object.\n * @param {boolean} [options.compressedTextureNoMipmap=false] True when the texture is compressed and does not have an embedded mipmap.\n *\n * @returns {Sampler} The sampler.\n * @private\n */\nGltfLoaderUtil.createSampler = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltf = options.gltf;\n  const textureInfo = options.textureInfo;\n  const compressedTextureNoMipmap = defaultValue(\n    options.compressedTextureNoMipmap,\n    false\n  );\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.object(\"options.textureInfo\", textureInfo);\n  //>>includeEnd('debug');\n\n  // Default sampler properties\n  let wrapS = TextureWrap.REPEAT;\n  let wrapT = TextureWrap.REPEAT;\n  let minFilter = TextureMinificationFilter.LINEAR;\n  let magFilter = TextureMagnificationFilter.LINEAR;\n\n  const textureId = textureInfo.index;\n  const texture = gltf.textures[textureId];\n  const samplerId = texture.sampler;\n\n  if (defined(samplerId)) {\n    const sampler = gltf.samplers[samplerId];\n    wrapS = defaultValue(sampler.wrapS, wrapS);\n    wrapT = defaultValue(sampler.wrapT, wrapT);\n    minFilter = defaultValue(sampler.minFilter, minFilter);\n    magFilter = defaultValue(sampler.magFilter, magFilter);\n  }\n\n  if (\n    compressedTextureNoMipmap &&\n    minFilter !== TextureMinificationFilter.LINEAR &&\n    minFilter !== TextureMinificationFilter.NEAREST\n  ) {\n    if (\n      minFilter === TextureMinificationFilter.NEAREST_MIPMAP_NEAREST ||\n      minFilter === TextureMinificationFilter.NEAREST_MIPMAP_LINEAR\n    ) {\n      minFilter = TextureMinificationFilter.NEAREST;\n    } else {\n      minFilter = TextureMinificationFilter.LINEAR;\n    }\n  }\n\n  return new Sampler({\n    wrapS: wrapS,\n    wrapT: wrapT,\n    minificationFilter: minFilter,\n    magnificationFilter: magFilter,\n  });\n};\n\nconst defaultScale = new Cartesian2(1.0, 1.0);\n\n/**\n * Create a model texture reader.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.textureInfo The texture info JSON.\n * @param {string} [options.channels] The texture channels to read from.\n * @param {Texture} [options.texture] The texture object.\n *\n * @returns {ModelComponents.TextureReader} The texture reader for this model.\n */\nGltfLoaderUtil.createModelTextureReader = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const textureInfo = options.textureInfo;\n  const channels = options.channels;\n  const texture = options.texture;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.textureInfo\", textureInfo);\n  //>>includeEnd('debug');\n\n  let texCoord = defaultValue(textureInfo.texCoord, 0);\n  let transform;\n\n  const textureTransform = defaultValue(\n    textureInfo.extensions,\n    defaultValue.EMPTY_OBJECT\n  ).KHR_texture_transform;\n\n  if (defined(textureTransform)) {\n    texCoord = defaultValue(textureTransform.texCoord, texCoord);\n\n    const offset = defined(textureTransform.offset)\n      ? Cartesian2.unpack(textureTransform.offset)\n      : Cartesian2.ZERO;\n    let rotation = defaultValue(textureTransform.rotation, 0.0);\n    const scale = defined(textureTransform.scale)\n      ? Cartesian2.unpack(textureTransform.scale)\n      : defaultScale;\n\n    // glTF assumes UV coordinates start with (0, 0) in the top left corner\n    // (y-down) unlike WebGL which puts (0, 0) in the bottom left corner (y-up).\n    // This means rotations are reversed since the angle from x to y is now\n    // clockwise instead of CCW. Translations and scales are not impacted by\n    // this.\n    rotation = -rotation;\n\n    // prettier-ignore\n    transform = new Matrix3(\n        Math.cos(rotation) * scale.x, -Math.sin(rotation) * scale.y, offset.x,\n        Math.sin(rotation) * scale.x, Math.cos(rotation) * scale.y, offset.y,\n        0.0, 0.0, 1.0\n      );\n  }\n\n  const modelTextureReader = new ModelComponents.TextureReader();\n  modelTextureReader.index = textureInfo.index;\n  modelTextureReader.texture = texture;\n  modelTextureReader.texCoord = texCoord;\n  modelTextureReader.transform = transform;\n  modelTextureReader.channels = channels;\n\n  return modelTextureReader;\n};\n\nexport default GltfLoaderUtil;\n", "import CesiumMath from \"./Math.js\";\n\n/**\n * Resizes an image to ensure both width and height are powers of 2.\n * NOTE: The input image is resampled larger, rather than padded.\n * The aspect ratio of the image may change.\n *\n * @param {HTMLImageElement|HTMLCanvasElement} image The image to be resized\n * @returns {HTMLCanvasElement} A new canvas with the resized image drawn to it\n *\n * @private\n */\nfunction resizeImageToNextPowerOfTwo(image) {\n  const canvas = document.createElement(\"canvas\");\n  canvas.width = CesiumMath.nextPowerOfTwo(image.width);\n  canvas.height = CesiumMath.nextPowerOfTwo(image.height);\n  const canvasContext = canvas.getContext(\"2d\");\n  canvasContext.drawImage(\n    image,\n    0,\n    0,\n    image.width,\n    image.height,\n    0,\n    0,\n    canvas.width,\n    canvas.height\n  );\n  return canvas;\n}\nexport default resizeImageToNextPowerOfTwo;\n", "import Check from \"../Core/Check.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport GltfLoaderUtil from \"./GltfLoaderUtil.js\";\nimport JobType from \"./JobType.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\nimport resizeImageToNextPowerOfTwo from \"../Core/resizeImageToNextPowerOfTwo.js\";\n\n/**\n * Loads a glTF texture.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfTextureLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {object} options Object with the following properties:\n * @param {ResourceCache} options.resourceCache The {@link ResourceCache} (to avoid circular dependencies).\n * @param {object} options.gltf The glTF JSON.\n * @param {object} options.textureInfo The texture info object.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {SupportedImageFormats} options.supportedImageFormats The supported image formats.\n * @param {string} [options.cacheKey] The cache key of the resource.\n * @param {boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n *\n * @private\n */\nfunction GltfTextureLoader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const resourceCache = options.resourceCache;\n  const gltf = options.gltf;\n  const textureInfo = options.textureInfo;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n  const supportedImageFormats = options.supportedImageFormats;\n  const cacheKey = options.cacheKey;\n  const asynchronous = defaultValue(options.asynchronous, true);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.func(\"options.resourceCache\", resourceCache);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.object(\"options.textureInfo\", textureInfo);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  Check.typeOf.object(\"options.supportedImageFormats\", supportedImageFormats);\n  //>>includeEnd('debug');\n\n  const textureId = textureInfo.index;\n\n  // imageId is guaranteed to be defined otherwise the GltfTextureLoader\n  // wouldn't have been created\n  const imageId = GltfLoaderUtil.getImageIdFromTexture({\n    gltf: gltf,\n    textureId: textureId,\n    supportedImageFormats: supportedImageFormats,\n  });\n\n  this._resourceCache = resourceCache;\n  this._gltf = gltf;\n  this._textureInfo = textureInfo;\n  this._imageId = imageId;\n  this._gltfResource = gltfResource;\n  this._baseResource = baseResource;\n  this._cacheKey = cacheKey;\n  this._asynchronous = asynchronous;\n  this._imageLoader = undefined;\n  this._image = undefined;\n  this._mipLevels = undefined;\n  this._texture = undefined;\n  this._state = ResourceLoaderState.UNLOADED;\n  this._promise = undefined;\n}\n\nif (defined(Object.create)) {\n  GltfTextureLoader.prototype = Object.create(ResourceLoader.prototype);\n  GltfTextureLoader.prototype.constructor = GltfTextureLoader;\n}\n\nObject.defineProperties(GltfTextureLoader.prototype, {\n  /**\n   * The cache key of the resource.\n   *\n   * @memberof GltfTextureLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    get: function () {\n      return this._cacheKey;\n    },\n  },\n  /**\n   * The texture.\n   *\n   * @memberof GltfTextureLoader.prototype\n   *\n   * @type {Texture}\n   * @readonly\n   * @private\n   */\n  texture: {\n    get: function () {\n      return this._texture;\n    },\n  },\n});\n\nconst scratchTextureJob = new CreateTextureJob();\n\nasync function loadResources(loader) {\n  const resourceCache = loader._resourceCache;\n  try {\n    const imageLoader = resourceCache.getImageLoader({\n      gltf: loader._gltf,\n      imageId: loader._imageId,\n      gltfResource: loader._gltfResource,\n      baseResource: loader._baseResource,\n    });\n    loader._imageLoader = imageLoader;\n    await imageLoader.load();\n\n    if (loader.isDestroyed()) {\n      return;\n    }\n\n    // Now wait for process() to run to finish loading\n    loader._image = imageLoader.image;\n    loader._mipLevels = imageLoader.mipLevels;\n    loader._state = ResourceLoaderState.LOADED;\n\n    return loader;\n  } catch (error) {\n    if (loader.isDestroyed()) {\n      return;\n    }\n\n    loader.unload();\n    loader._state = ResourceLoaderState.FAILED;\n    const errorMessage = \"Failed to load texture\";\n    throw loader.getError(errorMessage, error);\n  }\n}\n\n/**\n * Loads the resource.\n * @returns {Promise<GltfDracoLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfTextureLoader.prototype.load = async function () {\n  if (defined(this._promise)) {\n    return this._promise;\n  }\n\n  this._state = ResourceLoaderState.LOADING;\n  this._promise = loadResources(this);\n  return this._promise;\n};\n\nfunction CreateTextureJob() {\n  this.gltf = undefined;\n  this.textureInfo = undefined;\n  this.image = undefined;\n  this.context = undefined;\n  this.texture = undefined;\n}\n\nCreateTextureJob.prototype.set = function (\n  gltf,\n  textureInfo,\n  image,\n  mipLevels,\n  context\n) {\n  this.gltf = gltf;\n  this.textureInfo = textureInfo;\n  this.image = image;\n  this.mipLevels = mipLevels;\n  this.context = context;\n};\n\nCreateTextureJob.prototype.execute = function () {\n  this.texture = createTexture(\n    this.gltf,\n    this.textureInfo,\n    this.image,\n    this.mipLevels,\n    this.context\n  );\n};\n\nfunction createTexture(gltf, textureInfo, image, mipLevels, context) {\n  // internalFormat is only defined for CompressedTextureBuffer\n  const internalFormat = image.internalFormat;\n\n  let compressedTextureNoMipmap = false;\n  if (PixelFormat.isCompressedFormat(internalFormat) && !defined(mipLevels)) {\n    compressedTextureNoMipmap = true;\n  }\n\n  const sampler = GltfLoaderUtil.createSampler({\n    gltf: gltf,\n    textureInfo: textureInfo,\n    compressedTextureNoMipmap: compressedTextureNoMipmap,\n  });\n\n  const minFilter = sampler.minificationFilter;\n  const wrapS = sampler.wrapS;\n  const wrapT = sampler.wrapT;\n\n  const samplerRequiresMipmap =\n    minFilter === TextureMinificationFilter.NEAREST_MIPMAP_NEAREST ||\n    minFilter === TextureMinificationFilter.NEAREST_MIPMAP_LINEAR ||\n    minFilter === TextureMinificationFilter.LINEAR_MIPMAP_NEAREST ||\n    minFilter === TextureMinificationFilter.LINEAR_MIPMAP_LINEAR;\n\n  // generateMipmap is disallowed for compressed textures. Compressed textures\n  // can have mipmaps but they must come with the KTX2 instead of generated by\n  // WebGL. Also note from the KHR_texture_basisu spec:\n  //\n  //   When a texture refers to a sampler with mipmap minification or when the\n  //   sampler is undefined, the KTX2 image SHOULD contain a full mip pyramid.\n  //\n  const generateMipmap = !defined(internalFormat) && samplerRequiresMipmap;\n\n  // WebGL 1 requires power-of-two texture dimensions for mipmapping and REPEAT/MIRRORED_REPEAT wrap modes.\n  const requiresPowerOfTwo =\n    generateMipmap ||\n    wrapS === TextureWrap.REPEAT ||\n    wrapS === TextureWrap.MIRRORED_REPEAT ||\n    wrapT === TextureWrap.REPEAT ||\n    wrapT === TextureWrap.MIRRORED_REPEAT;\n\n  const nonPowerOfTwo =\n    !CesiumMath.isPowerOfTwo(image.width) ||\n    !CesiumMath.isPowerOfTwo(image.height);\n\n  const requiresResize = requiresPowerOfTwo && nonPowerOfTwo;\n\n  let texture;\n  if (defined(internalFormat)) {\n    if (\n      !context.webgl2 &&\n      PixelFormat.isCompressedFormat(internalFormat) &&\n      nonPowerOfTwo &&\n      requiresPowerOfTwo\n    ) {\n      console.warn(\n        \"Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly.\"\n      );\n    }\n\n    texture = Texture.create({\n      context: context,\n      source: {\n        arrayBufferView: image.bufferView, // Only defined for CompressedTextureBuffer\n        mipLevels: mipLevels,\n      },\n      width: image.width,\n      height: image.height,\n      pixelFormat: image.internalFormat, // Only defined for CompressedTextureBuffer\n      sampler: sampler,\n    });\n  } else {\n    if (requiresResize) {\n      image = resizeImageToNextPowerOfTwo(image);\n    }\n    texture = Texture.create({\n      context: context,\n      source: image,\n      sampler: sampler,\n      flipY: false,\n      skipColorSpaceConversion: true,\n    });\n  }\n\n  if (generateMipmap) {\n    texture.generateMipmap();\n  }\n\n  return texture;\n}\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @returns {boolean} true once all resourced are ready.\n * @private\n */\nGltfTextureLoader.prototype.process = function (frameState) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"frameState\", frameState);\n  //>>includeEnd('debug');\n\n  if (this._state === ResourceLoaderState.READY) {\n    return true;\n  }\n\n  if (\n    this._state !== ResourceLoaderState.LOADED &&\n    this._state !== ResourceLoaderState.PROCESSING\n  ) {\n    return false;\n  }\n\n  if (defined(this._texture)) {\n    // Already created texture\n    return false;\n  }\n\n  if (!defined(this._image)) {\n    // Not ready to create texture\n    return false;\n  }\n\n  this._state = ResourceLoaderState.PROCESSING;\n\n  let texture;\n  if (this._asynchronous) {\n    const textureJob = scratchTextureJob;\n    textureJob.set(\n      this._gltf,\n      this._textureInfo,\n      this._image,\n      this._mipLevels,\n      frameState.context\n    );\n    const jobScheduler = frameState.jobScheduler;\n    if (!jobScheduler.execute(textureJob, JobType.TEXTURE)) {\n      // Job scheduler is full. Try again next frame.\n      return;\n    }\n    texture = textureJob.texture;\n  } else {\n    texture = createTexture(\n      this._gltf,\n      this._textureInfo,\n      this._image,\n      this._mipLevels,\n      frameState.context\n    );\n  }\n\n  // Unload everything except the texture\n  this.unload();\n\n  this._texture = texture;\n  this._state = ResourceLoaderState.READY;\n  this._resourceCache.statistics.addTextureLoader(this);\n  return true;\n};\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfTextureLoader.prototype.unload = function () {\n  if (defined(this._texture)) {\n    this._texture.destroy();\n  }\n\n  if (defined(this._imageLoader) && !this._imageLoader.isDestroyed()) {\n    this._resourceCache.unload(this._imageLoader);\n  }\n\n  this._imageLoader = undefined;\n  this._image = undefined;\n  this._mipLevels = undefined;\n  this._texture = undefined;\n  this._gltf = undefined;\n};\n\nexport default GltfTextureLoader;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport AttributeType from \"./AttributeType.js\";\nimport JobType from \"./JobType.js\";\nimport ModelComponents from \"./ModelComponents.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * Loads a vertex buffer from a glTF buffer view.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfVertexBufferLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {object} options Object with the following properties:\n * @param {ResourceCache} options.resourceCache The {@link ResourceCache} (to avoid circular dependencies).\n * @param {object} options.gltf The glTF JSON.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {number} [options.bufferViewId] The bufferView ID corresponding to the vertex buffer.\n * @param {object} [options.draco] The Draco extension object.\n * @param {string} [options.attributeSemantic] The attribute semantic, e.g. POSITION or NORMAL.\n * @param {number} [options.accessorId] The accessor id.\n * @param {string} [options.cacheKey] The cache key of the resource.\n * @param {boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n * @param {boolean} [options.loadBuffer=false] Load vertex buffer as a GPU vertex buffer.\n * @param {boolean} [options.loadTypedArray=false] Load vertex buffer as a typed array.\n *\n * @exception {DeveloperError} One of options.bufferViewId and options.draco must be defined.\n * @exception {DeveloperError} When options.draco is defined options.attributeSemantic must also be defined.\n * @exception {DeveloperError} When options.draco is defined options.accessorId must also be defined.\n *\n * @private\n */\nfunction GltfVertexBufferLoader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const resourceCache = options.resourceCache;\n  const gltf = options.gltf;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n  const bufferViewId = options.bufferViewId;\n  const draco = options.draco;\n  const attributeSemantic = options.attributeSemantic;\n  const accessorId = options.accessorId;\n  const cacheKey = options.cacheKey;\n  const asynchronous = defaultValue(options.asynchronous, true);\n  const loadBuffer = defaultValue(options.loadBuffer, false);\n  const loadTypedArray = defaultValue(options.loadTypedArray, false);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.func(\"options.resourceCache\", resourceCache);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  if (!loadBuffer && !loadTypedArray) {\n    throw new DeveloperError(\n      \"At least one of loadBuffer and loadTypedArray must be true.\"\n    );\n  }\n\n  const hasBufferViewId = defined(bufferViewId);\n  const hasDraco = hasDracoCompression(draco, attributeSemantic);\n  const hasAttributeSemantic = defined(attributeSemantic);\n  const hasAccessorId = defined(accessorId);\n\n  if (hasBufferViewId === hasDraco) {\n    throw new DeveloperError(\n      \"One of options.bufferViewId and options.draco must be defined.\"\n    );\n  }\n\n  if (hasDraco && !hasAttributeSemantic) {\n    throw new DeveloperError(\n      \"When options.draco is defined options.attributeSemantic must also be defined.\"\n    );\n  }\n\n  if (hasDraco && !hasAccessorId) {\n    throw new DeveloperError(\n      \"When options.draco is defined options.accessorId must also be defined.\"\n    );\n  }\n\n  if (hasDraco) {\n    Check.typeOf.object(\"options.draco\", draco);\n    Check.typeOf.string(\"options.attributeSemantic\", attributeSemantic);\n    Check.typeOf.number(\"options.accessorId\", accessorId);\n  }\n  //>>includeEnd('debug');\n\n  this._resourceCache = resourceCache;\n  this._gltfResource = gltfResource;\n  this._baseResource = baseResource;\n  this._gltf = gltf;\n  this._bufferViewId = bufferViewId;\n  this._draco = draco;\n  this._attributeSemantic = attributeSemantic;\n  this._accessorId = accessorId;\n  this._cacheKey = cacheKey;\n  this._asynchronous = asynchronous;\n  this._loadBuffer = loadBuffer;\n  this._loadTypedArray = loadTypedArray;\n  this._bufferViewLoader = undefined;\n  this._dracoLoader = undefined;\n  this._quantization = undefined;\n  this._typedArray = undefined;\n  this._buffer = undefined;\n  this._state = ResourceLoaderState.UNLOADED;\n  this._promise = undefined;\n}\n\nif (defined(Object.create)) {\n  GltfVertexBufferLoader.prototype = Object.create(ResourceLoader.prototype);\n  GltfVertexBufferLoader.prototype.constructor = GltfVertexBufferLoader;\n}\n\nObject.defineProperties(GltfVertexBufferLoader.prototype, {\n  /**\n   * The cache key of the resource.\n   *\n   * @memberof GltfVertexBufferLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    get: function () {\n      return this._cacheKey;\n    },\n  },\n  /**\n   * The vertex buffer. This is only defined when <code>loadAsTypedArray</code> is false.\n   *\n   * @memberof GltfVertexBufferLoader.prototype\n   *\n   * @type {Buffer}\n   * @readonly\n   * @private\n   */\n  buffer: {\n    get: function () {\n      return this._buffer;\n    },\n  },\n  /**\n   * The typed array containing vertex buffer data. This is only defined when <code>loadAsTypedArray</code> is true.\n   *\n   * @memberof GltfVertexBufferLoader.prototype\n   *\n   * @type {Uint8Array}\n   * @readonly\n   * @private\n   */\n  typedArray: {\n    get: function () {\n      return this._typedArray;\n    },\n  },\n  /**\n   * Information about the quantized vertex attribute after Draco decode.\n   *\n   * @memberof GltfVertexBufferLoader.prototype\n   *\n   * @type {ModelComponents.Quantization}\n   * @readonly\n   * @private\n   */\n  quantization: {\n    get: function () {\n      return this._quantization;\n    },\n  },\n});\n\nfunction hasDracoCompression(draco, semantic) {\n  return (\n    defined(draco) &&\n    defined(draco.attributes) &&\n    defined(draco.attributes[semantic])\n  );\n}\n\n/**\n * Loads the resource.\n * @returns {Promise<GltfVertexBufferLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfVertexBufferLoader.prototype.load = async function () {\n  if (defined(this._promise)) {\n    return this._promise;\n  }\n\n  if (hasDracoCompression(this._draco, this._attributeSemantic)) {\n    this._promise = loadFromDraco(this);\n    return this._promise;\n  }\n\n  this._promise = loadFromBufferView(this);\n  return this._promise;\n};\n\nfunction getQuantizationInformation(\n  dracoQuantization,\n  componentDatatype,\n  componentCount,\n  type\n) {\n  const quantizationBits = dracoQuantization.quantizationBits;\n  const normalizationRange = (1 << quantizationBits) - 1;\n  const normalizationDivisor = 1.0 / normalizationRange;\n\n  const quantization = new ModelComponents.Quantization();\n  quantization.componentDatatype = componentDatatype;\n  quantization.octEncoded = dracoQuantization.octEncoded;\n  quantization.octEncodedZXY = true;\n  quantization.type = type;\n\n  if (quantization.octEncoded) {\n    quantization.type = AttributeType.VEC2;\n    quantization.normalizationRange = normalizationRange;\n  } else {\n    const MathType = AttributeType.getMathType(type);\n    if (MathType === Number) {\n      const dimensions = dracoQuantization.range;\n      quantization.quantizedVolumeOffset = dracoQuantization.minValues[0];\n      quantization.quantizedVolumeDimensions = dimensions;\n      quantization.normalizationRange = normalizationRange;\n      quantization.quantizedVolumeStepSize = dimensions * normalizationDivisor;\n    } else {\n      quantization.quantizedVolumeOffset = MathType.unpack(\n        dracoQuantization.minValues\n      );\n      quantization.normalizationRange = MathType.unpack(\n        new Array(componentCount).fill(normalizationRange)\n      );\n      const packedDimensions = new Array(componentCount).fill(\n        dracoQuantization.range\n      );\n      quantization.quantizedVolumeDimensions = MathType.unpack(\n        packedDimensions\n      );\n\n      // Computing the step size\n      const packedSteps = packedDimensions.map(function (dimension) {\n        return dimension * normalizationDivisor;\n      });\n      quantization.quantizedVolumeStepSize = MathType.unpack(packedSteps);\n    }\n  }\n\n  return quantization;\n}\n\nasync function loadFromDraco(vertexBufferLoader) {\n  vertexBufferLoader._state = ResourceLoaderState.LOADING;\n  const resourceCache = vertexBufferLoader._resourceCache;\n  try {\n    const dracoLoader = resourceCache.getDracoLoader({\n      gltf: vertexBufferLoader._gltf,\n      draco: vertexBufferLoader._draco,\n      gltfResource: vertexBufferLoader._gltfResource,\n      baseResource: vertexBufferLoader._baseResource,\n    });\n    vertexBufferLoader._dracoLoader = dracoLoader;\n    await dracoLoader.load();\n\n    if (vertexBufferLoader.isDestroyed()) {\n      return;\n    }\n\n    // Now wait for process() to run to finish loading\n    vertexBufferLoader._state = ResourceLoaderState.LOADED;\n    return vertexBufferLoader;\n  } catch {\n    if (vertexBufferLoader.isDestroyed()) {\n      return;\n    }\n\n    handleError(vertexBufferLoader);\n  }\n}\n\nfunction processDraco(vertexBufferLoader) {\n  vertexBufferLoader._state = ResourceLoaderState.PROCESSING;\n  const dracoLoader = vertexBufferLoader._dracoLoader;\n\n  // Get the typed array and quantization information\n  const decodedVertexAttributes = dracoLoader.decodedData.vertexAttributes;\n  const attributeSemantic = vertexBufferLoader._attributeSemantic;\n  const dracoAttribute = decodedVertexAttributes[attributeSemantic];\n  const accessorId = vertexBufferLoader._accessorId;\n  const accessor = vertexBufferLoader._gltf.accessors[accessorId];\n  const type = accessor.type;\n  const typedArray = dracoAttribute.array;\n  const dracoQuantization = dracoAttribute.data.quantization;\n  if (defined(dracoQuantization)) {\n    vertexBufferLoader._quantization = getQuantizationInformation(\n      dracoQuantization,\n      dracoAttribute.data.componentDatatype,\n      dracoAttribute.data.componentsPerAttribute,\n      type\n    );\n  }\n\n  vertexBufferLoader._typedArray = new Uint8Array(\n    typedArray.buffer,\n    typedArray.byteOffset,\n    typedArray.byteLength\n  );\n}\n\nasync function loadFromBufferView(vertexBufferLoader) {\n  vertexBufferLoader._state = ResourceLoaderState.LOADING;\n  const resourceCache = vertexBufferLoader._resourceCache;\n  try {\n    const bufferViewLoader = resourceCache.getBufferViewLoader({\n      gltf: vertexBufferLoader._gltf,\n      bufferViewId: vertexBufferLoader._bufferViewId,\n      gltfResource: vertexBufferLoader._gltfResource,\n      baseResource: vertexBufferLoader._baseResource,\n    });\n    vertexBufferLoader._bufferViewLoader = bufferViewLoader;\n    await bufferViewLoader.load();\n\n    if (vertexBufferLoader.isDestroyed()) {\n      return;\n    }\n\n    vertexBufferLoader._typedArray = bufferViewLoader.typedArray;\n    vertexBufferLoader._state = ResourceLoaderState.PROCESSING;\n    return vertexBufferLoader;\n  } catch (error) {\n    if (vertexBufferLoader.isDestroyed()) {\n      return;\n    }\n\n    handleError(vertexBufferLoader, error);\n  }\n}\n\nfunction handleError(vertexBufferLoader, error) {\n  vertexBufferLoader.unload();\n  vertexBufferLoader._state = ResourceLoaderState.FAILED;\n  const errorMessage = \"Failed to load vertex buffer\";\n  throw vertexBufferLoader.getError(errorMessage, error);\n}\n\nfunction CreateVertexBufferJob() {\n  this.typedArray = undefined;\n  this.context = undefined;\n  this.buffer = undefined;\n}\n\nCreateVertexBufferJob.prototype.set = function (typedArray, context) {\n  this.typedArray = typedArray;\n  this.context = context;\n};\n\nCreateVertexBufferJob.prototype.execute = function () {\n  this.buffer = createVertexBuffer(this.typedArray, this.context);\n};\n\nfunction createVertexBuffer(typedArray, context) {\n  const buffer = Buffer.createVertexBuffer({\n    typedArray: typedArray,\n    context: context,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n  buffer.vertexArrayDestroyable = false;\n  return buffer;\n}\n\nconst scratchVertexBufferJob = new CreateVertexBufferJob();\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @private\n */\nGltfVertexBufferLoader.prototype.process = function (frameState) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"frameState\", frameState);\n  //>>includeEnd('debug');\n\n  if (this._state === ResourceLoaderState.READY) {\n    return true;\n  }\n\n  if (\n    this._state !== ResourceLoaderState.LOADED &&\n    this._state !== ResourceLoaderState.PROCESSING\n  ) {\n    return false;\n  }\n\n  if (defined(this._dracoLoader)) {\n    try {\n      const ready = this._dracoLoader.process(frameState);\n      if (!ready) {\n        return false;\n      }\n    } catch (error) {\n      handleError(this, error);\n    }\n\n    processDraco(this);\n  }\n\n  let buffer;\n  const typedArray = this._typedArray;\n  if (this._loadBuffer && this._asynchronous) {\n    const vertexBufferJob = scratchVertexBufferJob;\n    vertexBufferJob.set(typedArray, frameState.context);\n    const jobScheduler = frameState.jobScheduler;\n    if (!jobScheduler.execute(vertexBufferJob, JobType.BUFFER)) {\n      // Job scheduler is full. Try again next frame.\n      return false;\n    }\n    buffer = vertexBufferJob.buffer;\n  } else if (this._loadBuffer) {\n    buffer = createVertexBuffer(typedArray, frameState.context);\n  }\n\n  // Unload everything except the vertex buffer\n  this.unload();\n\n  this._buffer = buffer;\n  this._typedArray = this._loadTypedArray ? typedArray : undefined;\n  this._state = ResourceLoaderState.READY;\n  this._resourceCache.statistics.addGeometryLoader(this);\n  return true;\n};\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfVertexBufferLoader.prototype.unload = function () {\n  if (defined(this._buffer)) {\n    this._buffer.destroy();\n  }\n\n  const resourceCache = this._resourceCache;\n\n  if (\n    defined(this._bufferViewLoader) &&\n    !this._bufferViewLoader.isDestroyed()\n  ) {\n    resourceCache.unload(this._bufferViewLoader);\n  }\n\n  if (defined(this._dracoLoader)) {\n    resourceCache.unload(this._dracoLoader);\n  }\n\n  this._bufferViewLoader = undefined;\n  this._dracoLoader = undefined;\n  this._typedArray = undefined;\n  this._buffer = undefined;\n  this._gltf = undefined;\n};\n\nexport default GltfVertexBufferLoader;\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport MetadataClassProperty from \"./MetadataClassProperty.js\";\n\n/**\n * A metadata class.\n *\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata|3D Metadata Specification} for 3D Tiles\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {string} options.id The ID of the class.\n * @param {string} [options.name] The name of the class.\n * @param {string} [options.description] The description of the class.\n * @param {Object<string, MetadataClassProperty>} [options.properties] The class properties, where each key is the property ID.\n * @param {*} [options.extras] Extra user-defined properties.\n * @param {object} [options.extensions] An object containing extensions.\n *\n * @alias MetadataClass\n * @constructor\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataClass(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const id = options.id;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"options.id\", id);\n  //>>includeEnd('debug');\n\n  const properties = defaultValue(options.properties, {});\n  const propertiesBySemantic = {};\n  for (const propertyId in properties) {\n    if (properties.hasOwnProperty(propertyId)) {\n      const property = properties[propertyId];\n      if (defined(property.semantic)) {\n        propertiesBySemantic[property.semantic] = property;\n      }\n    }\n  }\n\n  this._id = id;\n  this._name = options.name;\n  this._description = options.description;\n  this._properties = properties;\n  this._propertiesBySemantic = propertiesBySemantic;\n  this._extras = clone(options.extras, true);\n  this._extensions = clone(options.extensions, true);\n}\n\n/**\n * Creates a {@link MetadataClass} from either 3D Tiles 1.1, 3DTILES_metadata, EXT_structural_metadata, or EXT_feature_metadata.\n *\n * @param {object} options Object with the following properties:\n * @param {string} options.id The ID of the class.\n * @param {object} options.class The class JSON object.\n * @param {Object<string, MetadataEnum>} [options.enums] A dictionary of enums.\n *\n * @returns {MetadataClass} The newly created metadata class.\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nMetadataClass.fromJson = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const id = options.id;\n  const classDefinition = options.class;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"options.id\", id);\n  Check.typeOf.object(\"options.class\", classDefinition);\n  //>>includeEnd('debug');\n\n  const properties = {};\n  for (const propertyId in classDefinition.properties) {\n    if (classDefinition.properties.hasOwnProperty(propertyId)) {\n      const property = MetadataClassProperty.fromJson({\n        id: propertyId,\n        property: classDefinition.properties[propertyId],\n        enums: options.enums,\n      });\n      properties[propertyId] = property;\n    }\n  }\n\n  return new MetadataClass({\n    id: id,\n    name: classDefinition.name,\n    description: classDefinition.description,\n    properties: properties,\n    extras: classDefinition.extras,\n    extensions: classDefinition.extensions,\n  });\n};\n\nObject.defineProperties(MetadataClass.prototype, {\n  /**\n   * The class properties.\n   *\n   * @memberof MetadataClass.prototype\n   * @type {Object<string, MetadataClassProperty>}\n   * @readonly\n   */\n  properties: {\n    get: function () {\n      return this._properties;\n    },\n  },\n\n  /**\n   * A dictionary mapping semantics to class properties.\n   *\n   * @memberof MetadataClass.prototype\n   * @type {Object<string, MetadataClassProperty>}\n   * @readonly\n   *\n   * @private\n   */\n  propertiesBySemantic: {\n    get: function () {\n      return this._propertiesBySemantic;\n    },\n  },\n\n  /**\n   * The ID of the class.\n   *\n   * @memberof MetadataClass.prototype\n   * @type {string}\n   * @readonly\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n\n  /**\n   * The name of the class.\n   *\n   * @memberof MetadataClass.prototype\n   * @type {string}\n   * @readonly\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n\n  /**\n   * The description of the class.\n   *\n   * @memberof MetadataClass.prototype\n   * @type {string}\n   * @readonly\n   */\n  description: {\n    get: function () {\n      return this._description;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof MetadataClass.prototype\n   * @type {*}\n   * @readonly\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof MetadataClass.prototype\n   * @type {object}\n   * @readonly\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\n/**\n * The class name given to the metadata class when a batch\n * table is loaded from 3D Tiles 1.0 formats.\n *\n * @private\n */\nMetadataClass.BATCH_TABLE_CLASS_NAME = \"_batchTable\";\n\nexport default MetadataClass;\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\n\n/**\n * A metadata enum value.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata|3D Metadata Specification} for 3D Tiles\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {number} options.value The integer value.\n * @param {string} options.name The name of the enum value.\n * @param {string} [options.description] The description of the enum value.\n * @param {*} [options.extras] Extra user-defined properties.\n * @param {object} [options.extensions] An object containing extensions.\n *\n * @alias MetadataEnumValue\n * @constructor\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataEnumValue(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const value = options.value;\n  const name = options.name;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"options.value\", value);\n  Check.typeOf.string(\"options.name\", name);\n\n  //>>includeEnd('debug');\n\n  this._value = value;\n  this._name = name;\n  this._description = options.description;\n  this._extras = clone(options.extras, true);\n  this._extensions = clone(options.extensions, true);\n}\n\n/**\n * Creates a {@link MetadataEnumValue} from either 3D Tiles 1.1, 3DTILES_metadata, EXT_structural_metadata, or EXT_feature_metadata.\n *\n * @param {object} value The enum value JSON object.\n *\n * @returns {MetadataEnumValue} The newly created metadata enum value.\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nMetadataEnumValue.fromJson = function (value) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  //>>includeEnd('debug');\n\n  return new MetadataEnumValue({\n    value: value.value,\n    name: value.name,\n    description: value.description,\n    extras: value.extras,\n    extensions: value.extensions,\n  });\n};\n\nObject.defineProperties(MetadataEnumValue.prototype, {\n  /**\n   * The integer value.\n   *\n   * @memberof MetadataEnumValue.prototype\n   * @type {number}\n   * @readonly\n   */\n  value: {\n    get: function () {\n      return this._value;\n    },\n  },\n\n  /**\n   * The name of the enum value.\n   *\n   * @memberof MetadataEnumValue.prototype\n   * @type {string}\n   * @readonly\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n\n  /**\n   * The description of the enum value.\n   *\n   * @memberof MetadataEnumValue.prototype\n   * @type {string}\n   * @readonly\n   */\n  description: {\n    get: function () {\n      return this._description;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof MetadataEnumValue.prototype\n   * @type {*}\n   * @readonly\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof MetadataEnumValue.prototype\n   * @type {object}\n   * @readonly\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\nexport default MetadataEnumValue;\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport MetadataEnumValue from \"./MetadataEnumValue.js\";\nimport MetadataComponentType from \"./MetadataComponentType.js\";\n\n/**\n * A metadata enum.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata|3D Metadata Specification} for 3D Tiles\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {string} options.id The ID of the enum.\n * @param {MetadataEnumValue[]} options.values The enum values.\n * @param {MetadataComponentType} [options.valueType=MetadataComponentType.UINT16] The enum value type.\n * @param {string} [options.name] The name of the enum.\n * @param {string} [options.description] The description of the enum.\n * @param {*} [options.extras] Extra user-defined properties.\n * @param {object} [options.extensions] An object containing extensions.\n *\n * @alias MetadataEnum\n * @constructor\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataEnum(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const id = options.id;\n  const values = options.values;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"options.id\", id);\n  Check.defined(\"options.values\", values);\n  //>>includeEnd('debug');\n\n  const namesByValue = {};\n  const valuesByName = {};\n\n  const valuesLength = values.length;\n  for (let i = 0; i < valuesLength; ++i) {\n    const value = values[i];\n    namesByValue[value.value] = value.name;\n    valuesByName[value.name] = value.value;\n  }\n\n  const valueType = defaultValue(\n    options.valueType,\n    MetadataComponentType.UINT16\n  );\n\n  this._values = values;\n  this._namesByValue = namesByValue;\n  this._valuesByName = valuesByName;\n  this._valueType = valueType;\n  this._id = id;\n  this._name = options.name;\n  this._description = options.description;\n  this._extras = clone(options.extras, true);\n  this._extensions = clone(options.extensions, true);\n}\n\n/**\n * Creates a {@link MetadataEnum} from either 3D Tiles 1.1, 3DTILES_metadata, EXT_structural_metadata, or EXT_feature_metadata.\n *\n * @param {object} options Object with the following properties:\n * @param {string} options.id The ID of the enum.\n * @param {object} options.enum The enum JSON object.\n *\n * @returns {MetadataEnum} The newly created metadata enum.\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nMetadataEnum.fromJson = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const id = options.id;\n  const enumDefinition = options.enum;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"options.id\", id);\n  Check.typeOf.object(\"options.enum\", enumDefinition);\n  //>>includeEnd('debug');\n\n  const values = enumDefinition.values.map(function (value) {\n    return MetadataEnumValue.fromJson(value);\n  });\n\n  return new MetadataEnum({\n    id: id,\n    values: values,\n    valueType: MetadataComponentType[enumDefinition.valueType],\n    name: enumDefinition.name,\n    description: enumDefinition.description,\n    extras: enumDefinition.extras,\n    extensions: enumDefinition.extensions,\n  });\n};\n\nObject.defineProperties(MetadataEnum.prototype, {\n  /**\n   * The enum values.\n   *\n   * @memberof MetadataEnum.prototype\n   * @type {MetadataEnumValue[]}\n   * @readonly\n   */\n  values: {\n    get: function () {\n      return this._values;\n    },\n  },\n\n  /**\n   * A dictionary mapping enum integer values to names.\n   *\n   * @memberof MetadataEnum.prototype\n   * @type {Object<number, string>}\n   * @readonly\n   *\n   * @private\n   */\n  namesByValue: {\n    get: function () {\n      return this._namesByValue;\n    },\n  },\n\n  /**\n   * A dictionary mapping enum names to integer values.\n   *\n   * @memberof MetadataEnum.prototype\n   * @type {Object<string, number>}\n   * @readonly\n   *\n   * @private\n   */\n  valuesByName: {\n    get: function () {\n      return this._valuesByName;\n    },\n  },\n\n  /**\n   * The enum value type.\n   *\n   * @memberof MetadataEnum.prototype\n   * @type {MetadataComponentType}\n   * @readonly\n   */\n  valueType: {\n    get: function () {\n      return this._valueType;\n    },\n  },\n\n  /**\n   * The ID of the enum.\n   *\n   * @memberof MetadataEnum.prototype\n   * @type {string}\n   * @readonly\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n\n  /**\n   * The name of the enum.\n   *\n   * @memberof MetadataEnum.prototype\n   * @type {string}\n   * @readonly\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n\n  /**\n   * The description of the enum.\n   *\n   * @memberof MetadataEnum.prototype\n   * @type {string}\n   * @readonly\n   */\n  description: {\n    get: function () {\n      return this._description;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof MetadataEnum.prototype\n   * @type {*}\n   * @readonly\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof MetadataEnum.prototype\n   * @type {object}\n   * @readonly\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\nexport default MetadataEnum;\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport MetadataClass from \"./MetadataClass.js\";\nimport MetadataEnum from \"./MetadataEnum.js\";\n\n/**\n * A schema containing classes and enums.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata|3D Metadata Specification} for 3D Tiles\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {string} [options.id] The ID of the schema\n * @param {string} [options.name] The name of the schema.\n * @param {string} [options.description] The description of the schema.\n * @param {string} [options.version] The application-specific version of the schema.\n * @param {Object<string, MetadataClass>} [options.classes] Classes defined in the schema, where each key is the class ID.\n * @param {Object<string, MetadataEnum>} [options.enums] Enums defined in the schema, where each key is the enum ID.\n * @param {*} [options.extras] Extra user-defined properties.\n * @param {object} [options.extensions] An object containing extensions.\n *\n * @alias MetadataSchema\n * @constructor\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataSchema(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const classes = defaultValue(options.classes, {});\n  const enums = defaultValue(options.enums, {});\n\n  this._classes = classes;\n  this._enums = enums;\n  this._id = options.id;\n  this._name = options.name;\n  this._description = options.description;\n  this._version = options.version;\n  this._extras = clone(options.extras, true);\n  this._extensions = clone(options.extensions, true);\n}\n\n/**\n * Creates a {@link MetadataSchema} from either 3D Tiles 1.1, 3DTILES_metadata, EXT_structural_metadata, or EXT_feature_metadata.\n *\n * @param {object} schema The schema JSON object.\n *\n * @returns {MetadataSchema} The newly created metadata schema\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nMetadataSchema.fromJson = function (schema) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"schema\", schema);\n  //>>includeEnd('debug');\n\n  const enums = {};\n  if (defined(schema.enums)) {\n    for (const enumId in schema.enums) {\n      if (schema.enums.hasOwnProperty(enumId)) {\n        enums[enumId] = MetadataEnum.fromJson({\n          id: enumId,\n          enum: schema.enums[enumId],\n        });\n      }\n    }\n  }\n\n  const classes = {};\n  if (defined(schema.classes)) {\n    for (const classId in schema.classes) {\n      if (schema.classes.hasOwnProperty(classId)) {\n        classes[classId] = MetadataClass.fromJson({\n          id: classId,\n          class: schema.classes[classId],\n          enums: enums,\n        });\n      }\n    }\n  }\n\n  return new MetadataSchema({\n    id: schema.id,\n    name: schema.name,\n    description: schema.description,\n    version: schema.version,\n    classes: classes,\n    enums: enums,\n    extras: schema.extras,\n    extensions: schema.extensions,\n  });\n};\n\nObject.defineProperties(MetadataSchema.prototype, {\n  /**\n   * Classes defined in the schema.\n   *\n   * @memberof MetadataSchema.prototype\n   * @type {Object<string, MetadataClass>}\n   * @readonly\n   */\n  classes: {\n    get: function () {\n      return this._classes;\n    },\n  },\n\n  /**\n   * Enums defined in the schema.\n   *\n   * @memberof MetadataSchema.prototype\n   * @type {Object<string, MetadataEnum>}\n   * @readonly\n   */\n  enums: {\n    get: function () {\n      return this._enums;\n    },\n  },\n\n  /**\n   * The ID of the schema.\n   *\n   * @memberof MetadataSchema.prototype\n   * @type {string}\n   * @readonly\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n\n  /**\n   * The name of the schema.\n   *\n   * @memberof MetadataSchema.prototype\n   * @type {string}\n   * @readonly\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n\n  /**\n   * The description of the schema.\n   *\n   * @memberof MetadataSchema.prototype\n   * @type {string}\n   * @readonly\n   */\n  description: {\n    get: function () {\n      return this._description;\n    },\n  },\n\n  /**\n   * The application-specific version of the schema.\n   *\n   * @memberof MetadataSchema.prototype\n   * @type {string}\n   * @readonly\n   */\n  version: {\n    get: function () {\n      return this._version;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof MetadataSchema.prototype\n   * @type {*}\n   * @readonly\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof MetadataSchema.prototype\n   * @type {object}\n   * @readonly\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\nexport default MetadataSchema;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport MetadataSchema from \"./MetadataSchema.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * A {@link MetadataSchema} loader.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias MetadataSchemaLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {object} options Object with the following properties:\n * @param {object} [options.schema] An object that explicitly defines a schema JSON. Mutually exclusive with options.resource.\n * @param {Resource} [options.resource] The {@link Resource} pointing to the schema JSON. Mutually exclusive with options.schema.\n * @param {string} [options.cacheKey] The cache key of the resource.\n *\n * @exception {DeveloperError} One of options.schema and options.resource must be defined.\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataSchemaLoader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const schema = options.schema;\n  const resource = options.resource;\n  const cacheKey = options.cacheKey;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (defined(schema) === defined(resource)) {\n    throw new DeveloperError(\n      \"One of options.schema and options.resource must be defined.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._schema = defined(schema) ? MetadataSchema.fromJson(schema) : undefined;\n  this._resource = resource;\n  this._cacheKey = cacheKey;\n  this._state = ResourceLoaderState.UNLOADED;\n  this._promise = undefined;\n}\n\nif (defined(Object.create)) {\n  MetadataSchemaLoader.prototype = Object.create(ResourceLoader.prototype);\n  MetadataSchemaLoader.prototype.constructor = MetadataSchemaLoader;\n}\n\nObject.defineProperties(MetadataSchemaLoader.prototype, {\n  /**\n   * The cache key of the resource.\n   *\n   * @memberof MetadataSchemaLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    get: function () {\n      return this._cacheKey;\n    },\n  },\n  /**\n   * The metadata schema object.\n   *\n   * @memberof MetadataSchemaLoader.prototype\n   *\n   * @type {MetadataSchema}\n   * @readonly\n   * @private\n   */\n  schema: {\n    get: function () {\n      return this._schema;\n    },\n  },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise<MetadataSchemaLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nMetadataSchemaLoader.prototype.load = async function () {\n  if (defined(this._promise)) {\n    return this._promise;\n  }\n\n  if (defined(this._schema)) {\n    this._promise = Promise.resolve(this);\n    return this._promise;\n  }\n\n  this._promise = loadExternalSchema(this);\n  return this._promise;\n};\n\nasync function loadExternalSchema(schemaLoader) {\n  const resource = schemaLoader._resource;\n  schemaLoader._state = ResourceLoaderState.LOADING;\n  try {\n    const json = await resource.fetchJson();\n    if (schemaLoader.isDestroyed()) {\n      return;\n    }\n\n    schemaLoader._schema = MetadataSchema.fromJson(json);\n    schemaLoader._state = ResourceLoaderState.READY;\n    return schemaLoader;\n  } catch (error) {\n    if (schemaLoader.isDestroyed()) {\n      return;\n    }\n\n    schemaLoader._state = ResourceLoaderState.FAILED;\n    const errorMessage = `Failed to load schema: ${resource.url}`;\n    throw schemaLoader.getError(errorMessage, error);\n  }\n}\n\n/**\n * Unloads the resource.\n * @private\n */\nMetadataSchemaLoader.prototype.unload = function () {\n  this._schema = undefined;\n};\n\nexport default MetadataSchemaLoader;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport getAbsoluteUri from \"../Core/getAbsoluteUri.js\";\nimport GltfLoaderUtil from \"./GltfLoaderUtil.js\";\nimport hasExtension from \"./hasExtension.js\";\n\n/**\n * Compute cache keys for resources in {@link ResourceCache}.\n *\n * @namespace ResourceCacheKey\n *\n * @private\n */\nconst ResourceCacheKey = {};\n\nfunction getExternalResourceCacheKey(resource) {\n  return getAbsoluteUri(resource.url);\n}\n\nfunction getBufferViewCacheKey(bufferView) {\n  let byteOffset = bufferView.byteOffset;\n  let byteLength = bufferView.byteLength;\n\n  if (hasExtension(bufferView, \"EXT_meshopt_compression\")) {\n    const meshopt = bufferView.extensions.EXT_meshopt_compression;\n    byteOffset = defaultValue(meshopt.byteOffset, 0);\n    byteLength = meshopt.byteLength;\n  }\n\n  return `${byteOffset}-${byteOffset + byteLength}`;\n}\n\nfunction getAccessorCacheKey(accessor, bufferView) {\n  const byteOffset = bufferView.byteOffset + accessor.byteOffset;\n  const componentType = accessor.componentType;\n  const type = accessor.type;\n  const count = accessor.count;\n  return `${byteOffset}-${componentType}-${type}-${count}`;\n}\n\nfunction getExternalBufferCacheKey(resource) {\n  return getExternalResourceCacheKey(resource);\n}\n\nfunction getEmbeddedBufferCacheKey(parentResource, bufferId) {\n  const parentCacheKey = getExternalResourceCacheKey(parentResource);\n  return `${parentCacheKey}-buffer-id-${bufferId}`;\n}\n\nfunction getBufferCacheKey(buffer, bufferId, gltfResource, baseResource) {\n  if (defined(buffer.uri)) {\n    const resource = baseResource.getDerivedResource({\n      url: buffer.uri,\n    });\n    return getExternalBufferCacheKey(resource);\n  }\n\n  return getEmbeddedBufferCacheKey(gltfResource, bufferId);\n}\n\nfunction getDracoCacheKey(gltf, draco, gltfResource, baseResource) {\n  const bufferViewId = draco.bufferView;\n  const bufferView = gltf.bufferViews[bufferViewId];\n  const bufferId = bufferView.buffer;\n  const buffer = gltf.buffers[bufferId];\n\n  const bufferCacheKey = getBufferCacheKey(\n    buffer,\n    bufferId,\n    gltfResource,\n    baseResource\n  );\n\n  const bufferViewCacheKey = getBufferViewCacheKey(bufferView);\n\n  return `${bufferCacheKey}-range-${bufferViewCacheKey}`;\n}\n\nfunction getImageCacheKey(gltf, imageId, gltfResource, baseResource) {\n  const image = gltf.images[imageId];\n  const bufferViewId = image.bufferView;\n  const uri = image.uri;\n\n  if (defined(uri)) {\n    const resource = baseResource.getDerivedResource({\n      url: uri,\n    });\n    return getExternalResourceCacheKey(resource);\n  }\n\n  const bufferView = gltf.bufferViews[bufferViewId];\n  const bufferId = bufferView.buffer;\n  const buffer = gltf.buffers[bufferId];\n\n  const bufferCacheKey = getBufferCacheKey(\n    buffer,\n    bufferId,\n    gltfResource,\n    baseResource\n  );\n\n  const bufferViewCacheKey = getBufferViewCacheKey(bufferView);\n\n  return `${bufferCacheKey}-range-${bufferViewCacheKey}`;\n}\n\nfunction getSamplerCacheKey(gltf, textureInfo) {\n  const sampler = GltfLoaderUtil.createSampler({\n    gltf: gltf,\n    textureInfo: textureInfo,\n  });\n\n  return `${sampler.wrapS}-${sampler.wrapT}-${sampler.minificationFilter}-${sampler.magnificationFilter}`;\n}\n\n/**\n * Gets the schema cache key.\n *\n * @param {object} options Object with the following properties:\n * @param {object} [options.schema] An object that explicitly defines a schema JSON. Mutually exclusive with options.resource.\n * @param {Resource} [options.resource] The {@link Resource} pointing to the schema JSON. Mutually exclusive with options.schema.\n *\n * @returns {string} The schema cache key.\n *\n * @exception {DeveloperError} One of options.schema and options.resource must be defined.\n * @private\n */\nResourceCacheKey.getSchemaCacheKey = function (options) {\n  const schema = options.schema;\n  const resource = options.resource;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (defined(schema) === defined(resource)) {\n    throw new DeveloperError(\n      \"One of options.schema and options.resource must be defined.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  if (defined(schema)) {\n    return `embedded-schema:${JSON.stringify(schema)}`;\n  }\n\n  return `external-schema:${getExternalResourceCacheKey(resource)}`;\n};\n\n/**\n * Gets the external buffer cache key.\n *\n * @param {object} options Object with the following properties:\n * @param {Resource} options.resource The {@link Resource} pointing to the external buffer.\n *\n * @returns {string} The external buffer cache key.\n * @private\n */\nResourceCacheKey.getExternalBufferCacheKey = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const resource = options.resource;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.resource\", resource);\n  //>>includeEnd('debug');\n\n  return `external-buffer:${getExternalBufferCacheKey(resource)}`;\n};\n\n/**\n * Gets the embedded buffer cache key.\n *\n * @param {object} options Object with the following properties:\n * @param {Resource} options.parentResource The {@link Resource} containing the embedded buffer.\n * @param {number} options.bufferId A unique identifier of the embedded buffer within the parent resource.\n *\n * @returns {string} The embedded buffer cache key.\n * @private\n */\nResourceCacheKey.getEmbeddedBufferCacheKey = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const parentResource = options.parentResource;\n  const bufferId = options.bufferId;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.parentResource\", parentResource);\n  Check.typeOf.number(\"options.bufferId\", bufferId);\n  //>>includeEnd('debug');\n\n  return `embedded-buffer:${getEmbeddedBufferCacheKey(\n    parentResource,\n    bufferId\n  )}`;\n};\n\n/**\n * Gets the glTF cache key.\n *\n * @param {object} options Object with the following properties:\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n *\n * @returns {string} The glTF cache key.\n * @private\n */\nResourceCacheKey.getGltfCacheKey = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltfResource = options.gltfResource;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  //>>includeEnd('debug');\n\n  return `gltf:${getExternalResourceCacheKey(gltfResource)}`;\n};\n\n/**\n * Gets the buffer view cache key.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.gltf The glTF JSON.\n * @param {number} options.bufferViewId The bufferView ID.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n *\n * @returns {string} The buffer view cache key.\n * @private\n */\nResourceCacheKey.getBufferViewCacheKey = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltf = options.gltf;\n  const bufferViewId = options.bufferViewId;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.number(\"options.bufferViewId\", bufferViewId);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  //>>includeEnd('debug');\n\n  const bufferView = gltf.bufferViews[bufferViewId];\n  let bufferId = bufferView.buffer;\n  const buffer = gltf.buffers[bufferId];\n  if (hasExtension(bufferView, \"EXT_meshopt_compression\")) {\n    const meshopt = bufferView.extensions.EXT_meshopt_compression;\n    bufferId = meshopt.buffer;\n  }\n\n  const bufferCacheKey = getBufferCacheKey(\n    buffer,\n    bufferId,\n    gltfResource,\n    baseResource\n  );\n\n  const bufferViewCacheKey = getBufferViewCacheKey(bufferView);\n\n  return `buffer-view:${bufferCacheKey}-range-${bufferViewCacheKey}`;\n};\n\n/**\n * Gets the Draco cache key.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.gltf The glTF JSON.\n * @param {object} options.draco The Draco extension object.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n *\n * @returns {string} The Draco cache key.\n * @private\n */\nResourceCacheKey.getDracoCacheKey = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltf = options.gltf;\n  const draco = options.draco;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.object(\"options.draco\", draco);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  //>>includeEnd('debug');\n\n  return `draco:${getDracoCacheKey(gltf, draco, gltfResource, baseResource)}`;\n};\n\n/**\n * Gets the vertex buffer cache key.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.gltf The glTF JSON.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {FrameState} options.frameState The frame state.\n * @param {number} [options.bufferViewId] The bufferView ID corresponding to the vertex buffer.\n * @param {object} [options.draco] The Draco extension object.\n * @param {string} [options.attributeSemantic] The attribute semantic, e.g. POSITION or NORMAL.\n * @param {boolean} [options.dequantize=false] Determines whether or not the vertex buffer will be dequantized on the CPU.\n * @param {boolean} [options.loadBuffer=false] Load vertex buffer as a GPU vertex buffer.\n * @param {boolean} [options.loadTypedArray=false] Load vertex buffer as a typed array.\n * @exception {DeveloperError} One of options.bufferViewId and options.draco must be defined.\n * @exception {DeveloperError} When options.draco is defined options.attributeSemantic must also be defined.\n *\n * @returns {string} The vertex buffer cache key.\n * @private\n */\nResourceCacheKey.getVertexBufferCacheKey = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltf = options.gltf;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n  const frameState = options.frameState;\n  const bufferViewId = options.bufferViewId;\n  const draco = options.draco;\n  const attributeSemantic = options.attributeSemantic;\n  const dequantize = defaultValue(options.dequantize, false);\n  const loadBuffer = defaultValue(options.loadBuffer, false);\n  const loadTypedArray = defaultValue(options.loadTypedArray, false);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  Check.typeOf.object(\"options.frameState\", frameState);\n\n  const hasBufferViewId = defined(bufferViewId);\n  const hasDraco = hasDracoCompression(draco, attributeSemantic);\n  const hasAttributeSemantic = defined(attributeSemantic);\n\n  if (hasBufferViewId === hasDraco) {\n    throw new DeveloperError(\n      \"One of options.bufferViewId and options.draco must be defined.\"\n    );\n  }\n\n  if (hasDraco && !hasAttributeSemantic) {\n    throw new DeveloperError(\n      \"When options.draco is defined options.attributeSemantic must also be defined.\"\n    );\n  }\n\n  if (hasDraco) {\n    Check.typeOf.object(\"options.draco\", draco);\n    Check.typeOf.string(\"options.attributeSemantic\", attributeSemantic);\n  }\n\n  if (!loadBuffer && !loadTypedArray) {\n    throw new DeveloperError(\n      \"At least one of loadBuffer and loadTypedArray must be true.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  let cacheKeySuffix = \"\";\n  if (dequantize) {\n    cacheKeySuffix += \"-dequantize\";\n  }\n\n  if (loadBuffer) {\n    cacheKeySuffix += \"-buffer\";\n    cacheKeySuffix += `-context-${frameState.context.id}`;\n  }\n\n  if (loadTypedArray) {\n    cacheKeySuffix += \"-typed-array\";\n  }\n\n  if (defined(draco)) {\n    const dracoCacheKey = getDracoCacheKey(\n      gltf,\n      draco,\n      gltfResource,\n      baseResource\n    );\n    return `vertex-buffer:${dracoCacheKey}-draco-${attributeSemantic}${cacheKeySuffix}`;\n  }\n\n  const bufferView = gltf.bufferViews[bufferViewId];\n  const bufferId = bufferView.buffer;\n  const buffer = gltf.buffers[bufferId];\n\n  const bufferCacheKey = getBufferCacheKey(\n    buffer,\n    bufferId,\n    gltfResource,\n    baseResource\n  );\n\n  const bufferViewCacheKey = getBufferViewCacheKey(bufferView);\n\n  return `vertex-buffer:${bufferCacheKey}-range-${bufferViewCacheKey}${cacheKeySuffix}`;\n};\n\nfunction hasDracoCompression(draco, semantic) {\n  return (\n    defined(draco) &&\n    defined(draco.attributes) &&\n    defined(draco.attributes[semantic])\n  );\n}\n\n/**\n * Gets the index buffer cache key.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.gltf The glTF JSON.\n * @param {number} options.accessorId The accessor ID corresponding to the index buffer.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {FrameState} options.frameState The frame state.\n * @param {object} [options.draco] The Draco extension object.\n * @param {boolean} [options.loadBuffer=false] Load index buffer as a GPU index buffer.\n * @param {boolean} [options.loadTypedArray=false] Load index buffer as a typed array.\n *\n * @returns {string} The index buffer cache key.\n * @private\n */\nResourceCacheKey.getIndexBufferCacheKey = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltf = options.gltf;\n  const accessorId = options.accessorId;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n  const frameState = options.frameState;\n  const draco = options.draco;\n  const loadBuffer = defaultValue(options.loadBuffer, false);\n  const loadTypedArray = defaultValue(options.loadTypedArray, false);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.number(\"options.accessorId\", accessorId);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  Check.typeOf.object(\"options.frameState\", frameState);\n\n  if (!loadBuffer && !loadTypedArray) {\n    throw new DeveloperError(\n      \"At least one of loadBuffer and loadTypedArray must be true.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  let cacheKeySuffix = \"\";\n  if (loadBuffer) {\n    cacheKeySuffix += \"-buffer\";\n    cacheKeySuffix += `-context-${frameState.context.id}`;\n  }\n\n  if (loadTypedArray) {\n    cacheKeySuffix += \"-typed-array\";\n  }\n\n  if (defined(draco)) {\n    const dracoCacheKey = getDracoCacheKey(\n      gltf,\n      draco,\n      gltfResource,\n      baseResource\n    );\n    return `index-buffer:${dracoCacheKey}-draco${cacheKeySuffix}`;\n  }\n\n  const accessor = gltf.accessors[accessorId];\n  const bufferViewId = accessor.bufferView;\n  const bufferView = gltf.bufferViews[bufferViewId];\n  const bufferId = bufferView.buffer;\n  const buffer = gltf.buffers[bufferId];\n\n  const bufferCacheKey = getBufferCacheKey(\n    buffer,\n    bufferId,\n    gltfResource,\n    baseResource\n  );\n\n  const accessorCacheKey = getAccessorCacheKey(accessor, bufferView);\n\n  return `index-buffer:${bufferCacheKey}-accessor-${accessorCacheKey}${cacheKeySuffix}`;\n};\n\n/**\n * Gets the image cache key.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.gltf The glTF JSON.\n * @param {number} options.imageId The image ID.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n *\n * @returns {string} The image cache key.\n * @private\n */\nResourceCacheKey.getImageCacheKey = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltf = options.gltf;\n  const imageId = options.imageId;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.number(\"options.imageId\", imageId);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  //>>includeEnd('debug');\n\n  const imageCacheKey = getImageCacheKey(\n    gltf,\n    imageId,\n    gltfResource,\n    baseResource\n  );\n\n  return `image:${imageCacheKey}`;\n};\n\n/**\n * Gets the texture cache key.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.gltf The glTF JSON.\n * @param {object} options.textureInfo The texture info object.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {SupportedImageFormats} options.supportedImageFormats The supported image formats.\n * @param {FrameState} options.frameState The frame state.\n *\n * @returns {string} The texture cache key.\n * @private\n */\nResourceCacheKey.getTextureCacheKey = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltf = options.gltf;\n  const textureInfo = options.textureInfo;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n  const supportedImageFormats = options.supportedImageFormats;\n  const frameState = options.frameState;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.object(\"options.textureInfo\", textureInfo);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  Check.typeOf.object(\"options.supportedImageFormats\", supportedImageFormats);\n  Check.typeOf.object(\"options.frameState\", frameState);\n  //>>includeEnd('debug');\n\n  const textureId = textureInfo.index;\n\n  const imageId = GltfLoaderUtil.getImageIdFromTexture({\n    gltf: gltf,\n    textureId: textureId,\n    supportedImageFormats: supportedImageFormats,\n  });\n\n  const imageCacheKey = getImageCacheKey(\n    gltf,\n    imageId,\n    gltfResource,\n    baseResource\n  );\n\n  // Include the sampler cache key in the texture cache key since textures and\n  // samplers are coupled in WebGL 1. When upgrading to WebGL 2 consider\n  // removing the sampleCacheKey here.\n  const samplerCacheKey = getSamplerCacheKey(gltf, textureInfo);\n\n  return `texture:${imageCacheKey}-sampler-${samplerCacheKey}-context-${frameState.context.id}`;\n};\n\nexport default ResourceCacheKey;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * Statistics for the GPU and CPU memory used by the models loaded through the\n * {@link ResourceCache}.\n *\n * @alias ResourceCacheStatistics\n * @constructor\n *\n * @private\n */\nfunction ResourceCacheStatistics() {\n  /**\n   * The size of vertex buffers and index buffers loaded in the cache in bytes.\n   *\n   * @type {number}\n   * @private\n   */\n  this.geometryByteLength = 0;\n\n  /**\n   * The size of all textures loaded in the cache in bytes\n   *\n   * @type {number}\n   * @private\n   */\n  this.texturesByteLength = 0;\n\n  // Track the sizes of resources by cache key. This is important so\n  // removeLoader() can decrement the counts correctly.\n  this._geometrySizes = {};\n  this._textureSizes = {};\n}\n\n/**\n * Reset the memory counts\n *\n * @private\n */\nResourceCacheStatistics.prototype.clear = function () {\n  this.geometryByteLength = 0;\n  this.texturesByteLength = 0;\n\n  this._geometrySizes = {};\n  this._textureSizes = {};\n};\n\n/**\n * Track the resources for a vertex or index buffer loader. This should be called after a loader is ready; that\n * is it has been loaded and processed.\n * This method handles the following cases gracefully:\n * <ul>\n *   <li>If the loader is added twice, its resources will not be double-counted</li>\n *   <li>If the geometry has a CPU copy of the GPU buffer, it will be added to the count</li>\n * </ul>\n * @param {GltfVertexBufferLoader|GltfIndexBufferLoader} loader The geometry buffer with resources to track\n *\n * @private\n */\nResourceCacheStatistics.prototype.addGeometryLoader = function (loader) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"loader\", loader);\n  //>>includeEnd('debug');\n\n  const cacheKey = loader.cacheKey;\n\n  // Don't double count the same resource.\n  if (this._geometrySizes.hasOwnProperty(cacheKey)) {\n    return;\n  }\n\n  this._geometrySizes[cacheKey] = 0;\n\n  const buffer = loader.buffer;\n  const typedArray = loader.typedArray;\n\n  let totalSize = 0;\n\n  if (defined(buffer)) {\n    totalSize += buffer.sizeInBytes;\n  }\n\n  if (defined(typedArray)) {\n    totalSize += typedArray.byteLength;\n  }\n\n  this.geometryByteLength += totalSize;\n  this._geometrySizes[cacheKey] = totalSize;\n};\n\n/**\n * Track the resources for a texture loader. This should be called after a loader is ready; that\n * is it has been loaded and processed.\n * If the loader is added twice, its resources will not be double-counted.\n *\n * @param {GltfTextureLoader} loader The texture loader with resources to track\n *\n * @private\n */\nResourceCacheStatistics.prototype.addTextureLoader = function (loader) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"loader\", loader);\n  //>>includeEnd('debug');\n\n  const cacheKey = loader.cacheKey;\n\n  // Don't double count the same resource.\n  if (this._textureSizes.hasOwnProperty(cacheKey)) {\n    return;\n  }\n\n  this._textureSizes[cacheKey] = 0;\n  const totalSize = loader.texture.sizeInBytes;\n  this.texturesByteLength += loader.texture.sizeInBytes;\n  this._textureSizes[cacheKey] = totalSize;\n};\n\n/**\n * Remove a loader's resources from the memory count. The loader's cache key\n * is used to determine information about the resource, so this method can\n * be used both for geometry and textures. If the loader does not have any\n * tracked resources, this is a no-op.\n * @param {ResourceLoader} loader The resource loader to remove from the cache\n *\n * @private\n */\nResourceCacheStatistics.prototype.removeLoader = function (loader) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"loader\", loader);\n  //>>includeEnd('debug');\n\n  const cacheKey = loader.cacheKey;\n  const geometrySize = this._geometrySizes[cacheKey];\n  delete this._geometrySizes[cacheKey];\n\n  if (defined(geometrySize)) {\n    this.geometryByteLength -= geometrySize;\n  }\n\n  const textureSize = this._textureSizes[cacheKey];\n  delete this._textureSizes[cacheKey];\n\n  if (defined(textureSize)) {\n    this.texturesByteLength -= textureSize;\n  }\n};\n\nexport default ResourceCacheStatistics;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport BufferLoader from \"./BufferLoader.js\";\nimport GltfBufferViewLoader from \"./GltfBufferViewLoader.js\";\nimport GltfDracoLoader from \"./GltfDracoLoader.js\";\nimport GltfImageLoader from \"./GltfImageLoader.js\";\nimport GltfIndexBufferLoader from \"./GltfIndexBufferLoader.js\";\nimport GltfJsonLoader from \"./GltfJsonLoader.js\";\nimport GltfTextureLoader from \"./GltfTextureLoader.js\";\nimport GltfVertexBufferLoader from \"./GltfVertexBufferLoader.js\";\nimport MetadataSchemaLoader from \"./MetadataSchemaLoader.js\";\nimport ResourceCacheKey from \"./ResourceCacheKey.js\";\nimport ResourceCacheStatistics from \"./ResourceCacheStatistics.js\";\n\n/**\n * Cache for resources shared across 3D Tiles and glTF.\n *\n * @namespace ResourceCache\n *\n * @private\n */\nfunction ResourceCache() {}\n\nResourceCache.cacheEntries = {};\n\n// Statistics about binary data stored in the resource cache\nResourceCache.statistics = new ResourceCacheStatistics();\n\n/**\n * A reference-counted cache entry.\n *\n * @param {ResourceLoader} resourceLoader The resource.\n *\n * @alias CacheEntry\n * @constructor\n *\n * @private\n */\nfunction CacheEntry(resourceLoader) {\n  this.referenceCount = 1;\n  this.resourceLoader = resourceLoader;\n\n  // For unit testing only\n  this._statisticsPromise = undefined;\n}\n\n/**\n * Gets a resource from the cache. If the resource exists its reference count is\n * incremented. Otherwise, if no resource loader exists, undefined is returned.\n *\n * @param {string} cacheKey The cache key of the resource.\n *\n * @returns {ResourceLoader|undefined} The resource.\n * @private\n */\nResourceCache.get = function (cacheKey) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"cacheKey\", cacheKey);\n  //>>includeEnd('debug');\n\n  const cacheEntry = ResourceCache.cacheEntries[cacheKey];\n  if (defined(cacheEntry)) {\n    ++cacheEntry.referenceCount;\n    return cacheEntry.resourceLoader;\n  }\n  return undefined;\n};\n\n/**\n * Adds it to the cache.\n *\n * @param {ResourceLoader} resourceLoader The resource.\n * @returns {ResourceLoader} The resource.\n *\n * @exception {DeveloperError} Resource with this cacheKey is already in the cache\n * @private\n */\nResourceCache.add = function (resourceLoader) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"resourceLoader\", resourceLoader);\n  //>>includeEnd('debug');\n\n  const cacheKey = resourceLoader.cacheKey;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"options.resourceLoader.cacheKey\", cacheKey);\n\n  if (defined(ResourceCache.cacheEntries[cacheKey])) {\n    throw new DeveloperError(\n      `Resource with this cacheKey is already in the cache: ${cacheKey}`\n    );\n  }\n  //>>includeEnd('debug');\n\n  ResourceCache.cacheEntries[cacheKey] = new CacheEntry(resourceLoader);\n\n  return resourceLoader;\n};\n\n/**\n * Unloads a resource from the cache. When the reference count hits zero the\n * resource is destroyed.\n *\n * @param {ResourceLoader} resourceLoader The resource.\n *\n * @exception {DeveloperError} Resource is not in the cache.\n * @exception {DeveloperError} Cannot unload resource that has no references.\n * @private\n */\nResourceCache.unload = function (resourceLoader) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"resourceLoader\", resourceLoader);\n  //>>includeEnd('debug');\n\n  const cacheKey = resourceLoader.cacheKey;\n  const cacheEntry = ResourceCache.cacheEntries[cacheKey];\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(cacheEntry)) {\n    throw new DeveloperError(`Resource is not in the cache: ${cacheKey}`);\n  }\n  //>>includeEnd('debug');\n\n  --cacheEntry.referenceCount;\n\n  if (cacheEntry.referenceCount === 0) {\n    ResourceCache.statistics.removeLoader(resourceLoader);\n    resourceLoader.destroy();\n    delete ResourceCache.cacheEntries[cacheKey];\n  }\n};\n\n/**\n * Gets an existing schema loader from the cache, or creates a new loader if one does not already exist.\n *\n * @param {object} options Object with the following properties:\n * @param {object} [options.schema] An object that explicitly defines a schema JSON. Mutually exclusive with options.resource.\n * @param {Resource} [options.resource] The {@link Resource} pointing to the schema JSON. Mutually exclusive with options.schema.\n *\n * @returns {MetadataSchemaLoader} The cached schema resource.\n *\n * @exception {DeveloperError} One of options.schema and options.resource must be defined.\n * @private\n */\nResourceCache.getSchemaLoader = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const schema = options.schema;\n  const resource = options.resource;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (defined(schema) === defined(resource)) {\n    throw new DeveloperError(\n      \"One of options.schema and options.resource must be defined.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const cacheKey = ResourceCacheKey.getSchemaCacheKey({\n    schema: schema,\n    resource: resource,\n  });\n\n  let schemaLoader = ResourceCache.get(cacheKey);\n  if (defined(schemaLoader)) {\n    return schemaLoader;\n  }\n\n  schemaLoader = new MetadataSchemaLoader({\n    schema: schema,\n    resource: resource,\n    cacheKey: cacheKey,\n  });\n\n  return ResourceCache.add(schemaLoader);\n};\n\n/**\n * Gets an existing embedded buffer loader from the cache, or creates a new loader if one does not already exist.\n *\n * @param {object} options Object with the following properties:\n * @param {Resource} options.parentResource The {@link Resource} containing the embedded buffer.\n * @param {number} options.bufferId A unique identifier of the embedded buffer within the parent resource.\n * @param {Uint8Array} [options.typedArray] The typed array containing the embedded buffer contents.\n *\n * @returns {BufferLoader} The cached buffer loader.\n * @private\n */\nResourceCache.getEmbeddedBufferLoader = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const parentResource = options.parentResource;\n  const bufferId = options.bufferId;\n  const typedArray = options.typedArray;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.parentResource\", parentResource);\n  Check.typeOf.number(\"options.bufferId\", bufferId);\n  //>>includeEnd('debug');\n\n  const cacheKey = ResourceCacheKey.getEmbeddedBufferCacheKey({\n    parentResource: parentResource,\n    bufferId: bufferId,\n  });\n\n  let bufferLoader = ResourceCache.get(cacheKey);\n  if (defined(bufferLoader)) {\n    return bufferLoader;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.typedArray\", typedArray);\n  //>>includeEnd('debug');\n\n  bufferLoader = new BufferLoader({\n    typedArray: typedArray,\n    cacheKey: cacheKey,\n  });\n\n  return ResourceCache.add(bufferLoader);\n};\n\n/**\n * Gets an existing external buffer from loader the cache, or creates a new loader if one does not already exist.\n *\n * @param {object} options Object with the following properties:\n * @param {Resource} options.resource The {@link Resource} pointing to the external buffer.\n *\n * @returns {BufferLoader} The cached buffer loader.\n * @private\n */\nResourceCache.getExternalBufferLoader = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const resource = options.resource;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.resource\", resource);\n  //>>includeEnd('debug');\n\n  const cacheKey = ResourceCacheKey.getExternalBufferCacheKey({\n    resource: resource,\n  });\n\n  let bufferLoader = ResourceCache.get(cacheKey);\n  if (defined(bufferLoader)) {\n    return bufferLoader;\n  }\n\n  bufferLoader = new BufferLoader({\n    resource: resource,\n    cacheKey: cacheKey,\n  });\n\n  return ResourceCache.add(bufferLoader);\n};\n\n/**\n * Gets an existing glTF JSON loader from the cache, or creates a new loader if one does not already exist.\n *\n * @param {object} options Object with the following properties:\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {Uint8Array} [options.typedArray] The typed array containing the glTF contents.\n * @param {object} [options.gltfJson] The parsed glTF JSON contents.\n *\n * @returns {GltfJsonLoader} The cached glTF JSON loader.\n * @private\n */\nResourceCache.getGltfJsonLoader = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n  const typedArray = options.typedArray;\n  const gltfJson = options.gltfJson;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  //>>includeEnd('debug');\n\n  const cacheKey = ResourceCacheKey.getGltfCacheKey({\n    gltfResource: gltfResource,\n  });\n\n  let gltfJsonLoader = ResourceCache.get(cacheKey);\n  if (defined(gltfJsonLoader)) {\n    return gltfJsonLoader;\n  }\n\n  gltfJsonLoader = new GltfJsonLoader({\n    resourceCache: ResourceCache,\n    gltfResource: gltfResource,\n    baseResource: baseResource,\n    typedArray: typedArray,\n    gltfJson: gltfJson,\n    cacheKey: cacheKey,\n  });\n\n  return ResourceCache.add(gltfJsonLoader);\n};\n\n/**\n * Gets an existing glTF buffer view from the cache, or creates a new loader if one does not already exist.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.gltf The glTF JSON.\n * @param {number} options.bufferViewId The bufferView ID.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n *\n * @returns {GltfBufferViewLoader} The cached buffer view loader.\n * @private\n */\nResourceCache.getBufferViewLoader = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltf = options.gltf;\n  const bufferViewId = options.bufferViewId;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.number(\"options.bufferViewId\", bufferViewId);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  //>>includeEnd('debug');\n\n  const cacheKey = ResourceCacheKey.getBufferViewCacheKey({\n    gltf: gltf,\n    bufferViewId: bufferViewId,\n    gltfResource: gltfResource,\n    baseResource: baseResource,\n  });\n\n  let bufferViewLoader = ResourceCache.get(cacheKey);\n  if (defined(bufferViewLoader)) {\n    return bufferViewLoader;\n  }\n\n  bufferViewLoader = new GltfBufferViewLoader({\n    resourceCache: ResourceCache,\n    gltf: gltf,\n    bufferViewId: bufferViewId,\n    gltfResource: gltfResource,\n    baseResource: baseResource,\n    cacheKey: cacheKey,\n  });\n\n  return ResourceCache.add(bufferViewLoader);\n};\n\n/**\n * Gets an existing Draco data from the cache, or creates a new loader if one does not already exist.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.gltf The glTF JSON.\n * @param {object} options.draco The Draco extension object.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n *\n * @returns {GltfDracoLoader} The cached Draco loader.\n * @private\n */\nResourceCache.getDracoLoader = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltf = options.gltf;\n  const draco = options.draco;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.object(\"options.draco\", draco);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  //>>includeEnd('debug');\n\n  const cacheKey = ResourceCacheKey.getDracoCacheKey({\n    gltf: gltf,\n    draco: draco,\n    gltfResource: gltfResource,\n    baseResource: baseResource,\n  });\n\n  let dracoLoader = ResourceCache.get(cacheKey);\n  if (defined(dracoLoader)) {\n    return dracoLoader;\n  }\n\n  dracoLoader = new GltfDracoLoader({\n    resourceCache: ResourceCache,\n    gltf: gltf,\n    draco: draco,\n    gltfResource: gltfResource,\n    baseResource: baseResource,\n    cacheKey: cacheKey,\n  });\n\n  return ResourceCache.add(dracoLoader);\n};\n\n/**\n * Gets an existing glTF vertex buffer from the cache, or creates a new loader if one does not already exist.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.gltf The glTF JSON.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {FrameState} options.frameState The frame state.\n * @param {number} [options.bufferViewId] The bufferView ID corresponding to the vertex buffer.\n * @param {object} [options.draco] The Draco extension object.\n * @param {string} [options.attributeSemantic] The attribute semantic, e.g. POSITION or NORMAL.\n * @param {number} [options.accessorId] The accessor ID.\n * @param {boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n * @param {boolean} [options.dequantize=false] Determines whether or not the vertex buffer will be dequantized on the CPU.\n * @param {boolean} [options.loadBuffer=false] Load vertex buffer as a GPU vertex buffer.\n * @param {boolean} [options.loadTypedArray=false] Load vertex buffer as a typed array.\n * @exception {DeveloperError} One of options.bufferViewId and options.draco must be defined.\n * @exception {DeveloperError} When options.draco is defined options.attributeSemantic must also be defined.\n * @exception {DeveloperError} When options.draco is defined options.accessorId must also be defined.\n *\n * @returns {GltfVertexBufferLoader} The cached vertex buffer loader.\n * @private\n */\nResourceCache.getVertexBufferLoader = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltf = options.gltf;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n  const frameState = options.frameState;\n  const bufferViewId = options.bufferViewId;\n  const draco = options.draco;\n  const attributeSemantic = options.attributeSemantic;\n  const accessorId = options.accessorId;\n  const asynchronous = defaultValue(options.asynchronous, true);\n  const dequantize = defaultValue(options.dequantize, false);\n  const loadBuffer = defaultValue(options.loadBuffer, false);\n  const loadTypedArray = defaultValue(options.loadTypedArray, false);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  Check.typeOf.object(\"options.frameState\", frameState);\n  if (!loadBuffer && !loadTypedArray) {\n    throw new DeveloperError(\n      \"At least one of loadBuffer and loadTypedArray must be true.\"\n    );\n  }\n\n  const hasBufferViewId = defined(bufferViewId);\n  const hasDraco = hasDracoCompression(draco, attributeSemantic);\n  const hasAttributeSemantic = defined(attributeSemantic);\n  const hasAccessorId = defined(accessorId);\n\n  if (hasBufferViewId === hasDraco) {\n    throw new DeveloperError(\n      \"One of options.bufferViewId and options.draco must be defined.\"\n    );\n  }\n\n  if (hasDraco && !hasAttributeSemantic) {\n    throw new DeveloperError(\n      \"When options.draco is defined options.attributeSemantic must also be defined.\"\n    );\n  }\n\n  if (hasDraco && !hasAccessorId) {\n    throw new DeveloperError(\n      \"When options.draco is defined options.haAccessorId must also be defined.\"\n    );\n  }\n\n  if (hasDraco) {\n    Check.typeOf.object(\"options.draco\", draco);\n    Check.typeOf.string(\"options.attributeSemantic\", attributeSemantic);\n    Check.typeOf.number(\"options.accessorId\", accessorId);\n  }\n  //>>includeEnd('debug');\n\n  const cacheKey = ResourceCacheKey.getVertexBufferCacheKey({\n    gltf: gltf,\n    gltfResource: gltfResource,\n    baseResource: baseResource,\n    frameState: frameState,\n    bufferViewId: bufferViewId,\n    draco: draco,\n    attributeSemantic: attributeSemantic,\n    dequantize: dequantize,\n    loadBuffer: loadBuffer,\n    loadTypedArray: loadTypedArray,\n  });\n\n  let vertexBufferLoader = ResourceCache.get(cacheKey);\n  if (defined(vertexBufferLoader)) {\n    return vertexBufferLoader;\n  }\n\n  vertexBufferLoader = new GltfVertexBufferLoader({\n    resourceCache: ResourceCache,\n    gltf: gltf,\n    gltfResource: gltfResource,\n    baseResource: baseResource,\n    bufferViewId: bufferViewId,\n    draco: draco,\n    attributeSemantic: attributeSemantic,\n    accessorId: accessorId,\n    cacheKey: cacheKey,\n    asynchronous: asynchronous,\n    dequantize: dequantize,\n    loadBuffer: loadBuffer,\n    loadTypedArray: loadTypedArray,\n  });\n\n  return ResourceCache.add(vertexBufferLoader);\n};\n\nfunction hasDracoCompression(draco, semantic) {\n  return (\n    defined(draco) &&\n    defined(draco.attributes) &&\n    defined(draco.attributes[semantic])\n  );\n}\n\n/**\n * Gets an existing glTF index buffer from the cache, or creates a new loader if one does not already exist.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.gltf The glTF JSON.\n * @param {number} options.accessorId The accessor ID corresponding to the index buffer.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {FrameState} options.frameState The frame state.\n * @param {object} [options.draco] The Draco extension object.\n * @param {boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n * @param {boolean} [options.loadBuffer=false] Load index buffer as a GPU index buffer.\n * @param {boolean} [options.loadTypedArray=false] Load index buffer as a typed array.\n * @returns {GltfIndexBufferLoader} The cached index buffer loader.\n * @private\n */\nResourceCache.getIndexBufferLoader = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltf = options.gltf;\n  const accessorId = options.accessorId;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n  const frameState = options.frameState;\n  const draco = options.draco;\n  const asynchronous = defaultValue(options.asynchronous, true);\n  const loadBuffer = defaultValue(options.loadBuffer, false);\n  const loadTypedArray = defaultValue(options.loadTypedArray, false);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.number(\"options.accessorId\", accessorId);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  Check.typeOf.object(\"options.frameState\", frameState);\n  if (!loadBuffer && !loadTypedArray) {\n    throw new DeveloperError(\n      \"At least one of loadBuffer and loadTypedArray must be true.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const cacheKey = ResourceCacheKey.getIndexBufferCacheKey({\n    gltf: gltf,\n    accessorId: accessorId,\n    gltfResource: gltfResource,\n    baseResource: baseResource,\n    frameState: frameState,\n    draco: draco,\n    loadBuffer: loadBuffer,\n    loadTypedArray: loadTypedArray,\n  });\n\n  let indexBufferLoader = ResourceCache.get(cacheKey);\n  if (defined(indexBufferLoader)) {\n    return indexBufferLoader;\n  }\n\n  indexBufferLoader = new GltfIndexBufferLoader({\n    resourceCache: ResourceCache,\n    gltf: gltf,\n    accessorId: accessorId,\n    gltfResource: gltfResource,\n    baseResource: baseResource,\n    draco: draco,\n    cacheKey: cacheKey,\n    asynchronous: asynchronous,\n    loadBuffer: loadBuffer,\n    loadTypedArray: loadTypedArray,\n  });\n\n  return ResourceCache.add(indexBufferLoader);\n};\n\n/**\n * Gets an existing glTF image from the cache, or creates a new loader if one does not already exist.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.gltf The glTF JSON.\n * @param {number} options.imageId The image ID.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n *\n * @returns {GltfImageLoader} The cached image loader.\n * @private\n */\nResourceCache.getImageLoader = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltf = options.gltf;\n  const imageId = options.imageId;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.number(\"options.imageId\", imageId);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  //>>includeEnd('debug');\n\n  const cacheKey = ResourceCacheKey.getImageCacheKey({\n    gltf: gltf,\n    imageId: imageId,\n    gltfResource: gltfResource,\n    baseResource: baseResource,\n  });\n\n  let imageLoader = ResourceCache.get(cacheKey);\n  if (defined(imageLoader)) {\n    return imageLoader;\n  }\n\n  imageLoader = new GltfImageLoader({\n    resourceCache: ResourceCache,\n    gltf: gltf,\n    imageId: imageId,\n    gltfResource: gltfResource,\n    baseResource: baseResource,\n    cacheKey: cacheKey,\n  });\n\n  return ResourceCache.add(imageLoader);\n};\n\n/**\n * Gets an existing glTF texture from the cache, or creates a new loader if one does not already exist.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.gltf The glTF JSON.\n * @param {object} options.textureInfo The texture info object.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {SupportedImageFormats} options.supportedImageFormats The supported image formats.\n * @param {FrameState} options.frameState The frame state.\n * @param {boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n *\n * @returns {GltfTextureLoader} The cached texture loader.\n * @private\n */\nResourceCache.getTextureLoader = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltf = options.gltf;\n  const textureInfo = options.textureInfo;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n  const supportedImageFormats = options.supportedImageFormats;\n  const frameState = options.frameState;\n  const asynchronous = defaultValue(options.asynchronous, true);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.object(\"options.textureInfo\", textureInfo);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  Check.typeOf.object(\"options.supportedImageFormats\", supportedImageFormats);\n  Check.typeOf.object(\"options.frameState\", frameState);\n  //>>includeEnd('debug');\n\n  const cacheKey = ResourceCacheKey.getTextureCacheKey({\n    gltf: gltf,\n    textureInfo: textureInfo,\n    gltfResource: gltfResource,\n    baseResource: baseResource,\n    supportedImageFormats: supportedImageFormats,\n    frameState: frameState,\n  });\n\n  let textureLoader = ResourceCache.get(cacheKey);\n  if (defined(textureLoader)) {\n    return textureLoader;\n  }\n\n  textureLoader = new GltfTextureLoader({\n    resourceCache: ResourceCache,\n    gltf: gltf,\n    textureInfo: textureInfo,\n    gltfResource: gltfResource,\n    baseResource: baseResource,\n    supportedImageFormats: supportedImageFormats,\n    cacheKey: cacheKey,\n    asynchronous: asynchronous,\n  });\n\n  return ResourceCache.add(textureLoader);\n};\n\n/**\n * Unload everything from the cache. This is used for unit testing.\n *\n * @private\n */\nResourceCache.clearForSpecs = function () {\n  // Unload in the order below. This prevents an unload function from unloading\n  // a resource that has already been unloaded.\n  const precedence = [\n    GltfVertexBufferLoader,\n    GltfIndexBufferLoader,\n    GltfDracoLoader,\n    GltfTextureLoader,\n    GltfImageLoader,\n    GltfBufferViewLoader,\n    BufferLoader,\n    MetadataSchemaLoader,\n    GltfJsonLoader,\n  ];\n\n  let cacheKey;\n  const cacheEntries = ResourceCache.cacheEntries;\n\n  const cacheEntriesSorted = [];\n  for (cacheKey in cacheEntries) {\n    if (cacheEntries.hasOwnProperty(cacheKey)) {\n      cacheEntriesSorted.push(cacheEntries[cacheKey]);\n    }\n  }\n\n  cacheEntriesSorted.sort(function (a, b) {\n    const indexA = precedence.indexOf(a.resourceLoader.constructor);\n    const indexB = precedence.indexOf(b.resourceLoader.constructor);\n    return indexA - indexB;\n  });\n\n  const cacheEntriesLength = cacheEntriesSorted.length;\n  for (let i = 0; i < cacheEntriesLength; ++i) {\n    const cacheEntry = cacheEntriesSorted[i];\n    cacheKey = cacheEntry.resourceLoader.cacheKey;\n    if (defined(cacheEntries[cacheKey])) {\n      cacheEntry.resourceLoader.destroy();\n      delete cacheEntries[cacheKey];\n    }\n  }\n\n  ResourceCache.statistics.clear();\n};\n\nexport default ResourceCache;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport ImplicitAvailabilityBitstream from \"./ImplicitAvailabilityBitstream.js\";\nimport ImplicitMetadataView from \"./ImplicitMetadataView.js\";\nimport ImplicitSubdivisionScheme from \"./ImplicitSubdivisionScheme.js\";\nimport ImplicitSubtreeMetadata from \"./ImplicitSubtreeMetadata.js\";\nimport MetadataTable from \"./MetadataTable.js\";\nimport ResourceCache from \"./ResourceCache.js\";\n\n/**\n * An object representing a single subtree in an implicit tileset\n * including availability.\n * <p>\n * Subtrees handle tile metadata, defined in the subtree JSON in either\n * tileMetadata (3D Tiles 1.1) or the <code>3DTILES_metadata</code> extension.\n * Subtrees also handle content metadata and metadata about the subtree itself.\n * </p>\n *\n * This object is normally not instantiated directly, use {@link ImplicitSubtree.fromSubtreeJson}.\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata#implicit-tile-properties|Implicit Tile Properties in the 3DTILES_metadata specification}\n * @see ImplicitSubtree.fromSubtreeJson\n *\n * @alias ImplicitSubtree\n * @constructor\n *\n * @param {Resource} resource The resource for this subtree. This is used for fetching external buffers as needed.\n * @param {ImplicitTileset} implicitTileset The implicit tileset. This includes information about the size of subtrees\n * @param {ImplicitTileCoordinates} implicitCoordinates The coordinates of the subtree's root tile.\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ImplicitSubtree(resource, implicitTileset, implicitCoordinates) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"resource\", resource);\n  Check.typeOf.object(\"implicitTileset\", implicitTileset);\n  Check.typeOf.object(\"implicitCoordinates\", implicitCoordinates);\n  //>>includeEnd('debug');\n\n  this._resource = resource;\n  this._subtreeJson = undefined;\n  this._bufferLoader = undefined;\n  this._tileAvailability = undefined;\n  this._contentAvailabilityBitstreams = [];\n  this._childSubtreeAvailability = undefined;\n  this._implicitCoordinates = implicitCoordinates;\n  this._subtreeLevels = implicitTileset.subtreeLevels;\n  this._subdivisionScheme = implicitTileset.subdivisionScheme;\n  this._branchingFactor = implicitTileset.branchingFactor;\n\n  // properties for metadata\n  this._metadata = undefined;\n  this._tileMetadataTable = undefined;\n  this._tilePropertyTableJson = undefined;\n\n  this._contentMetadataTables = [];\n  this._contentPropertyTableJsons = [];\n\n  // Jump buffers are maps of availability bit index to entity ID\n  this._tileJumpBuffer = undefined;\n  this._contentJumpBuffers = [];\n\n  this._ready = false;\n}\n\nObject.defineProperties(ImplicitSubtree.prototype, {\n  /**\n   * Returns true once all necessary availability buffers\n   * are loaded.\n   *\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n\n  /**\n   * When subtree metadata is present (3D Tiles 1.1), this property stores an {@link ImplicitSubtreeMetadata} instance\n   *\n   * @type {ImplicitSubtreeMetadata}\n   * @readonly\n   * @private\n   */\n  metadata: {\n    get: function () {\n      return this._metadata;\n    },\n  },\n\n  /**\n   * When tile metadata is present (3D Tiles 1.1) or the <code>3DTILES_metadata</code> extension is used,\n   * this property stores a {@link MetadataTable} instance for the tiles in the subtree.\n   *\n   * @type {MetadataTable}\n   * @readonly\n   * @private\n   */\n  tileMetadataTable: {\n    get: function () {\n      return this._tileMetadataTable;\n    },\n  },\n\n  /**\n   * When tile metadata is present (3D Tiles 1.1) or the <code>3DTILES_metadata</code> extension is used,\n   * this property stores the JSON from the extension. This is used by {@link TileMetadata}\n   * to get the extras and extensions for the tiles in the subtree.\n   *\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  tilePropertyTableJson: {\n    get: function () {\n      return this._tilePropertyTableJson;\n    },\n  },\n\n  /**\n   * When content metadata is present (3D Tiles 1.1), this property stores\n   * an array of {@link MetadataTable} instances for the contents in the subtree.\n   *\n   * @type {Array}\n   * @readonly\n   * @private\n   */\n  contentMetadataTables: {\n    get: function () {\n      return this._contentMetadataTables;\n    },\n  },\n\n  /**\n   * When content metadata is present (3D Tiles 1.1), this property\n   * an array of the JSONs from the extension. This is used to get the extras\n   * and extensions for the contents in the subtree.\n   *\n   * @type {Array}\n   * @readonly\n   * @private\n   */\n  contentPropertyTableJsons: {\n    get: function () {\n      return this._contentPropertyTableJsons;\n    },\n  },\n\n  /**\n   * Gets the implicit tile coordinates for the root of the subtree.\n   *\n   * @type {ImplicitTileCoordinates}\n   * @readonly\n   * @private\n   */\n  implicitCoordinates: {\n    get: function () {\n      return this._implicitCoordinates;\n    },\n  },\n});\n\n/**\n * Check if a specific tile is available at an index of the tile availability bitstream\n *\n * @param {number} index The index of the desired tile\n * @returns {boolean} The value of the i-th bit\n * @private\n */\nImplicitSubtree.prototype.tileIsAvailableAtIndex = function (index) {\n  return this._tileAvailability.getBit(index);\n};\n\n/**\n * Check if a specific tile is available at an implicit tile coordinate\n *\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a tile\n * @returns {boolean} The value of the i-th bit\n * @private\n */\nImplicitSubtree.prototype.tileIsAvailableAtCoordinates = function (\n  implicitCoordinates\n) {\n  const index = this.getTileIndex(implicitCoordinates);\n  return this.tileIsAvailableAtIndex(index);\n};\n\n/**\n * Check if a specific tile's content is available at an index of the content availability bitstream\n *\n * @param {number} index The index of the desired tile\n * @param {number} [contentIndex=0] The index of the desired content when multiple contents are used.\n * @returns {boolean} The value of the i-th bit\n * @private\n */\nImplicitSubtree.prototype.contentIsAvailableAtIndex = function (\n  index,\n  contentIndex\n) {\n  contentIndex = defaultValue(contentIndex, 0);\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    contentIndex < 0 ||\n    contentIndex >= this._contentAvailabilityBitstreams.length\n  ) {\n    throw new DeveloperError(\"contentIndex out of bounds.\");\n  }\n  //>>includeEnd('debug');\n\n  return this._contentAvailabilityBitstreams[contentIndex].getBit(index);\n};\n\n/**\n * Check if a specific tile's content is available at an implicit tile coordinate\n *\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a tile\n * @param {number} [contentIndex=0] The index of the desired content when the <code>3DTILES_multiple_contents</code> extension is used.\n * @returns {boolean} The value of the i-th bit\n * @private\n */\nImplicitSubtree.prototype.contentIsAvailableAtCoordinates = function (\n  implicitCoordinates,\n  contentIndex\n) {\n  const index = this.getTileIndex(implicitCoordinates);\n  return this.contentIsAvailableAtIndex(index, contentIndex);\n};\n\n/**\n * Check if a child subtree is available at an index of the child subtree availability bitstream\n *\n * @param {number} index The index of the desired child subtree\n * @returns {boolean} The value of the i-th bit\n * @private\n */\nImplicitSubtree.prototype.childSubtreeIsAvailableAtIndex = function (index) {\n  return this._childSubtreeAvailability.getBit(index);\n};\n\n/**\n * Check if a specific child subtree is available at an implicit tile coordinate\n *\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a child subtree\n * @returns {boolean} The value of the i-th bit\n * @private\n */\nImplicitSubtree.prototype.childSubtreeIsAvailableAtCoordinates = function (\n  implicitCoordinates\n) {\n  const index = this.getChildSubtreeIndex(implicitCoordinates);\n  return this.childSubtreeIsAvailableAtIndex(index);\n};\n\n/**\n * Get the index of the first node at the given level within this subtree.\n * e.g. for a quadtree:\n * <ul>\n * <li>Level 0 starts at index 0</li>\n * <li>Level 1 starts at index 1</li>\n * <li>Level 2 starts at index 5</li>\n * </ul>\n *\n * @param {number} level The 0-indexed level number relative to the root of the subtree\n * @returns {number} The first index at the desired level\n * @private\n */\nImplicitSubtree.prototype.getLevelOffset = function (level) {\n  const branchingFactor = this._branchingFactor;\n  return (Math.pow(branchingFactor, level) - 1) / (branchingFactor - 1);\n};\n\n/**\n * Get the morton index of a tile's parent. This is equivalent to\n * chopping off the last 2 (quadtree) or 3 (octree) bits of the morton\n * index.\n *\n * @param {number} childIndex The morton index of the child tile relative to its parent\n * @returns {number} The index of the child's parent node\n * @private\n */\nImplicitSubtree.prototype.getParentMortonIndex = function (mortonIndex) {\n  let bitsPerLevel = 2;\n  if (this._subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n    bitsPerLevel = 3;\n  }\n\n  return mortonIndex >> bitsPerLevel;\n};\n\n/**\n * Parse all relevant information out of the subtree. This fetches any\n * external buffers that are used by the implicit tileset.\n *\n * @param {Resource} resource The resource for this subtree. This is used for fetching external buffers as needed.\n * @param {object} [json] The JSON object for this subtree. If parsing from a binary subtree file, this will be undefined.\n * @param {Uint8Array} [subtreeView] The contents of the subtree binary\n * @param {ImplicitTileset} implicitTileset The implicit tileset this subtree belongs to.\n * @param {ImplicitTileCoordinates} implicitCoordinates The coordinates of the subtree's root tile.\n * @return {Promise<ImplicitSubtree>} The created subtree\n * @private\n *\n * @exception {DeveloperError} One of json and subtreeView must be defined.\n */\nImplicitSubtree.fromSubtreeJson = async function (\n  resource,\n  json,\n  subtreeView,\n  implicitTileset,\n  implicitCoordinates\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"resource\", resource);\n  if (defined(json) === defined(subtreeView)) {\n    throw new DeveloperError(\"One of json and subtreeView must be defined.\");\n  }\n  Check.typeOf.object(\"implicitTileset\", implicitTileset);\n  Check.typeOf.object(\"implicitCoordinates\", implicitCoordinates);\n  //>>includeEnd('debug');\n\n  const subtree = new ImplicitSubtree(\n    resource,\n    implicitTileset,\n    implicitCoordinates\n  );\n\n  let chunks;\n  if (defined(json)) {\n    chunks = {\n      json: json,\n      binary: undefined,\n    };\n  } else {\n    chunks = parseSubtreeChunks(subtreeView);\n  }\n\n  const subtreeJson = chunks.json;\n  subtree._subtreeJson = subtreeJson;\n\n  let tilePropertyTableJson;\n  if (hasExtension(subtreeJson, \"3DTILES_metadata\")) {\n    tilePropertyTableJson = subtreeJson.extensions[\"3DTILES_metadata\"];\n  } else if (defined(subtreeJson.tileMetadata)) {\n    const propertyTableIndex = subtreeJson.tileMetadata;\n    tilePropertyTableJson = subtreeJson.propertyTables[propertyTableIndex];\n  }\n\n  const contentPropertyTableJsons = [];\n  if (defined(subtreeJson.contentMetadata)) {\n    const length = subtreeJson.contentMetadata.length;\n    for (let i = 0; i < length; i++) {\n      const propertyTableIndex = subtreeJson.contentMetadata[i];\n      contentPropertyTableJsons.push(\n        subtreeJson.propertyTables[propertyTableIndex]\n      );\n    }\n  }\n\n  let metadata;\n  const schema = implicitTileset.metadataSchema;\n  const subtreeMetadata = subtreeJson.subtreeMetadata;\n  if (defined(subtreeMetadata)) {\n    const metadataClass = subtreeMetadata.class;\n    const subtreeMetadataClass = schema.classes[metadataClass];\n    metadata = new ImplicitSubtreeMetadata({\n      subtreeMetadata: subtreeMetadata,\n      class: subtreeMetadataClass,\n    });\n  }\n\n  subtree._metadata = metadata;\n  subtree._tilePropertyTableJson = tilePropertyTableJson;\n  subtree._contentPropertyTableJsons = contentPropertyTableJsons;\n\n  // if no contentAvailability is specified, no tile in the subtree has\n  // content\n  const defaultContentAvailability = {\n    constant: 0,\n  };\n\n  // In 3D Tiles 1.1, content availability is provided in an array in the subtree JSON\n  // regardless of whether or not it contains multiple contents. This differs from previous\n  // schemas, where content availability is either a single object in the subtree JSON or\n  // as an array in the 3DTILES_multiple_contents extension.\n  //\n  // After identifying how availability is stored, put the results in this new array for consistent processing later\n  subtreeJson.contentAvailabilityHeaders = [];\n  if (hasExtension(subtreeJson, \"3DTILES_multiple_contents\")) {\n    subtreeJson.contentAvailabilityHeaders =\n      subtreeJson.extensions[\"3DTILES_multiple_contents\"].contentAvailability;\n  } else if (Array.isArray(subtreeJson.contentAvailability)) {\n    subtreeJson.contentAvailabilityHeaders = subtreeJson.contentAvailability;\n  } else {\n    subtreeJson.contentAvailabilityHeaders.push(\n      defaultValue(subtreeJson.contentAvailability, defaultContentAvailability)\n    );\n  }\n\n  const bufferHeaders = preprocessBuffers(subtreeJson.buffers);\n  const bufferViewHeaders = preprocessBufferViews(\n    subtreeJson.bufferViews,\n    bufferHeaders\n  );\n\n  // Buffers and buffer views are inactive until explicitly marked active.\n  // This way we can avoid fetching buffers that will not be used.\n  markActiveBufferViews(subtreeJson, bufferViewHeaders);\n  if (defined(tilePropertyTableJson)) {\n    markActiveMetadataBufferViews(tilePropertyTableJson, bufferViewHeaders);\n  }\n\n  for (let i = 0; i < contentPropertyTableJsons.length; i++) {\n    const contentPropertyTableJson = contentPropertyTableJsons[i];\n    markActiveMetadataBufferViews(contentPropertyTableJson, bufferViewHeaders);\n  }\n\n  const buffersU8 = await requestActiveBuffers(\n    subtree,\n    bufferHeaders,\n    chunks.binary\n  );\n  const bufferViewsU8 = parseActiveBufferViews(bufferViewHeaders, buffersU8);\n  parseAvailability(subtree, subtreeJson, implicitTileset, bufferViewsU8);\n\n  if (defined(tilePropertyTableJson)) {\n    parseTileMetadataTable(subtree, implicitTileset, bufferViewsU8);\n    makeTileJumpBuffer(subtree);\n  }\n\n  parseContentMetadataTables(subtree, implicitTileset, bufferViewsU8);\n  makeContentJumpBuffers(subtree);\n\n  subtree._ready = true;\n  return subtree;\n};\n\n/**\n * A helper object for storing the two parts of the subtree binary\n *\n * @typedef {object} SubtreeChunks\n * @property {object} json The json chunk of the subtree\n * @property {Uint8Array} binary The binary chunk of the subtree. This represents the internal buffer.\n * @private\n */\n\n/**\n * Given the binary contents of a subtree, split into JSON and binary chunks\n *\n * @param {Uint8Array} subtreeView The subtree binary\n * @returns {SubtreeChunks} An object containing the JSON and binary chunks.\n * @private\n */\nfunction parseSubtreeChunks(subtreeView) {\n  // Parse the header\n  const littleEndian = true;\n  const subtreeReader = new DataView(\n    subtreeView.buffer,\n    subtreeView.byteOffset\n  );\n  // Skip to the chunk lengths\n  let byteOffset = 8;\n\n  // Read the bottom 32 bits of the 64-bit byte length. This is ok for now because:\n  // 1) not all browsers have native 64-bit operations\n  // 2) the data is well under 4GB\n  const jsonByteLength = subtreeReader.getUint32(byteOffset, littleEndian);\n  byteOffset += 8;\n  const binaryByteLength = subtreeReader.getUint32(byteOffset, littleEndian);\n  byteOffset += 8;\n\n  const subtreeJson = getJsonFromTypedArray(\n    subtreeView,\n    byteOffset,\n    jsonByteLength\n  );\n  byteOffset += jsonByteLength;\n  const subtreeBinary = subtreeView.subarray(\n    byteOffset,\n    byteOffset + binaryByteLength\n  );\n\n  return {\n    json: subtreeJson,\n    binary: subtreeBinary,\n  };\n}\n\n/**\n * A buffer header is the JSON header from the subtree JSON chunk plus\n * a couple extra boolean flags for easy reference.\n *\n * Buffers are assumed inactive until explicitly marked active. This is used\n * to avoid fetching unneeded buffers.\n *\n * @typedef {object} BufferHeader\n * @property {boolean} isExternal True if this is an external buffer\n * @property {boolean} isActive Whether this buffer is currently used.\n * @property {string} [uri] The URI of the buffer (external buffers only)\n * @property {number} byteLength The byte length of the buffer, including any padding contained within.\n * @private\n */\n\n/**\n * Iterate over the list of buffers from the subtree JSON and add the\n * isExternal and isActive fields for easier parsing later. This modifies\n * the objects in place.\n *\n * @param {Object[]} [bufferHeaders=[]] The JSON from subtreeJson.buffers.\n * @returns {BufferHeader[]} The same array of headers with additional fields.\n * @private\n */\nfunction preprocessBuffers(bufferHeaders) {\n  bufferHeaders = defined(bufferHeaders) ? bufferHeaders : [];\n  for (let i = 0; i < bufferHeaders.length; i++) {\n    const bufferHeader = bufferHeaders[i];\n    bufferHeader.isExternal = defined(bufferHeader.uri);\n    bufferHeader.isActive = false;\n  }\n\n  return bufferHeaders;\n}\n\n/**\n * A buffer header is the JSON header from the subtree JSON chunk plus\n * the isActive flag and a reference to the header for the underlying buffer\n *\n * @typedef {object} BufferViewHeader\n * @property {BufferHeader} bufferHeader A reference to the header for the underlying buffer\n * @property {boolean} isActive Whether this bufferView is currently used.\n * @property {number} buffer The index of the underlying buffer.\n * @property {number} byteOffset The start byte of the bufferView within the buffer.\n * @property {number} byteLength The length of the bufferView. No padding is included in this length.\n * @private\n */\n\n/**\n * Iterate the list of buffer views from the subtree JSON and add the\n * isActive flag. Also save a reference to the bufferHeader\n *\n * @param {Object[]} [bufferViewHeaders=[]] The JSON from subtree.bufferViews\n * @param {BufferHeader[]} bufferHeaders The preprocessed buffer headers\n * @returns {BufferViewHeader[]} The same array of bufferView headers with additional fields\n * @private\n */\nfunction preprocessBufferViews(bufferViewHeaders, bufferHeaders) {\n  bufferViewHeaders = defined(bufferViewHeaders) ? bufferViewHeaders : [];\n  for (let i = 0; i < bufferViewHeaders.length; i++) {\n    const bufferViewHeader = bufferViewHeaders[i];\n    const bufferHeader = bufferHeaders[bufferViewHeader.buffer];\n    bufferViewHeader.bufferHeader = bufferHeader;\n    bufferViewHeader.isActive = false;\n  }\n  return bufferViewHeaders;\n}\n\n/**\n * Determine which buffer views need to be loaded into memory. This includes:\n *\n * <ul>\n * <li>The tile availability bitstream (if a bitstream is defined)</li>\n * <li>The content availability bitstream(s) (if a bitstream is defined)</li>\n * <li>The child subtree availability bitstream (if a bitstream is defined)</li>\n * </ul>\n *\n * <p>\n * This function modifies the buffer view headers' isActive flags in place.\n * </p>\n *\n * @param {Object[]} subtreeJson The JSON chunk from the subtree\n * @param {BufferViewHeader[]} bufferViewHeaders The preprocessed buffer view headers\n * @private\n */\nfunction markActiveBufferViews(subtreeJson, bufferViewHeaders) {\n  let header;\n  const tileAvailabilityHeader = subtreeJson.tileAvailability;\n\n  // Check for bitstream first, which is part of the current schema.\n  // bufferView is the name of the bitstream from an older schema.\n  if (defined(tileAvailabilityHeader.bitstream)) {\n    header = bufferViewHeaders[tileAvailabilityHeader.bitstream];\n  } else if (defined(tileAvailabilityHeader.bufferView)) {\n    header = bufferViewHeaders[tileAvailabilityHeader.bufferView];\n  }\n\n  if (defined(header)) {\n    header.isActive = true;\n    header.bufferHeader.isActive = true;\n  }\n\n  const contentAvailabilityHeaders = subtreeJson.contentAvailabilityHeaders;\n  for (let i = 0; i < contentAvailabilityHeaders.length; i++) {\n    header = undefined;\n    if (defined(contentAvailabilityHeaders[i].bitstream)) {\n      header = bufferViewHeaders[contentAvailabilityHeaders[i].bitstream];\n    } else if (defined(contentAvailabilityHeaders[i].bufferView)) {\n      header = bufferViewHeaders[contentAvailabilityHeaders[i].bufferView];\n    }\n\n    if (defined(header)) {\n      header.isActive = true;\n      header.bufferHeader.isActive = true;\n    }\n  }\n\n  header = undefined;\n  const childSubtreeAvailabilityHeader = subtreeJson.childSubtreeAvailability;\n  if (defined(childSubtreeAvailabilityHeader.bitstream)) {\n    header = bufferViewHeaders[childSubtreeAvailabilityHeader.bitstream];\n  } else if (defined(childSubtreeAvailabilityHeader.bufferView)) {\n    header = bufferViewHeaders[childSubtreeAvailabilityHeader.bufferView];\n  }\n\n  if (defined(header)) {\n    header.isActive = true;\n    header.bufferHeader.isActive = true;\n  }\n}\n\n/**\n * For handling metadata, look over the tile and content metadata buffers\n * <p>\n * This always loads all of the metadata immediately. Future iterations may\n * allow filtering this to avoid downloading unneeded buffers.\n * </p>\n *\n * @param {object} propertyTableJson The property table JSON for either a tile or some content\n * @param {BufferViewHeader[]} bufferViewHeaders The preprocessed buffer view headers\n * @private\n */\nfunction markActiveMetadataBufferViews(propertyTableJson, bufferViewHeaders) {\n  const properties = propertyTableJson.properties;\n  let header;\n  for (const key in properties) {\n    if (properties.hasOwnProperty(key)) {\n      const metadataHeader = properties[key];\n\n      // An older spec used bufferView\n      const valuesBufferView = defaultValue(\n        metadataHeader.values,\n        metadataHeader.bufferView\n      );\n      header = bufferViewHeaders[valuesBufferView];\n      header.isActive = true;\n      header.bufferHeader.isActive = true;\n\n      // An older spec used stringOffsetBufferView\n      const stringOffsetBufferView = defaultValue(\n        metadataHeader.stringOffsets,\n        metadataHeader.stringOffsetBufferView\n      );\n      if (defined(stringOffsetBufferView)) {\n        header = bufferViewHeaders[stringOffsetBufferView];\n        header.isActive = true;\n        header.bufferHeader.isActive = true;\n      }\n\n      // an older spec used arrayOffsetBufferView\n      const arrayOffsetBufferView = defaultValue(\n        metadataHeader.arrayOffsets,\n        metadataHeader.arrayOffsetBufferView\n      );\n      if (defined(arrayOffsetBufferView)) {\n        header = bufferViewHeaders[arrayOffsetBufferView];\n        header.isActive = true;\n        header.bufferHeader.isActive = true;\n      }\n    }\n  }\n}\n\n/**\n * Go through the list of buffers and gather all the active ones into a\n * a dictionary. Since external buffers are allowed, this sometimes involves\n * fetching separate binary files. Consequently, this method returns a promise.\n * <p>\n * The results are put into a dictionary object. The keys are indices of\n * buffers, and the values are Uint8Arrays of the contents. Only buffers\n * marked with the isActive flag are fetched.\n * </p>\n * <p>\n * The internal buffer (the subtree's binary chunk) is also stored in this\n * dictionary if it is marked active.\n * </p>\n * @param {ImplicitSubtree} subtree The subtree\n * @param {BufferHeader[]} bufferHeaders The preprocessed buffer headers\n * @param {Uint8Array} internalBuffer The binary chunk of the subtree file\n * @returns {Promise<object>} A promise resolving to the dictionary of active buffers\n * @private\n */\nfunction requestActiveBuffers(subtree, bufferHeaders, internalBuffer) {\n  const promises = [];\n  for (let i = 0; i < bufferHeaders.length; i++) {\n    const bufferHeader = bufferHeaders[i];\n    if (!bufferHeader.isActive) {\n      promises.push(Promise.resolve(undefined));\n    } else if (bufferHeader.isExternal) {\n      const promise = requestExternalBuffer(subtree, bufferHeader);\n      promises.push(promise);\n    } else {\n      promises.push(Promise.resolve(internalBuffer));\n    }\n  }\n  return Promise.all(promises).then(function (bufferResults) {\n    const buffersU8 = {};\n    for (let i = 0; i < bufferResults.length; i++) {\n      const result = bufferResults[i];\n      if (defined(result)) {\n        buffersU8[i] = result;\n      }\n    }\n    return buffersU8;\n  });\n}\n\nasync function requestExternalBuffer(subtree, bufferHeader) {\n  const baseResource = subtree._resource;\n  const bufferResource = baseResource.getDerivedResource({\n    url: bufferHeader.uri,\n  });\n\n  const bufferLoader = ResourceCache.getExternalBufferLoader({\n    resource: bufferResource,\n  });\n  subtree._bufferLoader = bufferLoader;\n\n  try {\n    await bufferLoader.load();\n  } catch (error) {\n    if (bufferLoader.isDestroyed()) {\n      return;\n    }\n\n    throw error;\n  }\n\n  return bufferLoader.typedArray;\n}\n\n/**\n * Go through the list of buffer views, and if they are marked as active,\n * extract a subarray from one of the active buffers.\n *\n * @param {BufferViewHeader[]} bufferViewHeaders\n * @param {object} buffersU8 A dictionary of buffer index to a Uint8Array of its contents.\n * @returns {object} A dictionary of buffer view index to a Uint8Array of its contents.\n * @private\n */\nfunction parseActiveBufferViews(bufferViewHeaders, buffersU8) {\n  const bufferViewsU8 = {};\n  for (let i = 0; i < bufferViewHeaders.length; i++) {\n    const bufferViewHeader = bufferViewHeaders[i];\n\n    if (!bufferViewHeader.isActive) {\n      continue;\n    }\n\n    const start = bufferViewHeader.byteOffset;\n    const end = start + bufferViewHeader.byteLength;\n    const buffer = buffersU8[bufferViewHeader.buffer];\n    const bufferView = buffer.subarray(start, end);\n    bufferViewsU8[i] = bufferView;\n  }\n  return bufferViewsU8;\n}\n\n/**\n * Parse the three availability bitstreams and store them in the subtree\n *\n * @param {ImplicitSubtree} subtree The subtree to modify\n * @param {object} subtreeJson The subtree JSON\n * @param {ImplicitTileset} implicitTileset The implicit tileset this subtree belongs to\n * @param {object} bufferViewsU8 A dictionary of buffer view index to a Uint8Array of its contents.\n * @private\n */\nfunction parseAvailability(\n  subtree,\n  subtreeJson,\n  implicitTileset,\n  bufferViewsU8\n) {\n  const branchingFactor = implicitTileset.branchingFactor;\n  const subtreeLevels = implicitTileset.subtreeLevels;\n  const tileAvailabilityBits =\n    (Math.pow(branchingFactor, subtreeLevels) - 1) / (branchingFactor - 1);\n  const childSubtreeBits = Math.pow(branchingFactor, subtreeLevels);\n\n  // availableCount is only needed for the metadata jump buffer, which\n  // corresponds to the tile availability bitstream.\n  const hasMetadataExtension = hasExtension(subtreeJson, \"3DTILES_metadata\");\n  const hasTileMetadata = defined(subtree._tilePropertyTableJson);\n  let computeAvailableCountEnabled = hasMetadataExtension || hasTileMetadata;\n\n  subtree._tileAvailability = parseAvailabilityBitstream(\n    subtreeJson.tileAvailability,\n    bufferViewsU8,\n    tileAvailabilityBits,\n    computeAvailableCountEnabled\n  );\n\n  const hasContentMetadata = subtree._contentPropertyTableJsons.length > 0;\n  computeAvailableCountEnabled =\n    computeAvailableCountEnabled || hasContentMetadata;\n\n  for (let i = 0; i < subtreeJson.contentAvailabilityHeaders.length; i++) {\n    const bitstream = parseAvailabilityBitstream(\n      subtreeJson.contentAvailabilityHeaders[i],\n      bufferViewsU8,\n      // content availability has the same length as tile availability.\n      tileAvailabilityBits,\n      computeAvailableCountEnabled\n    );\n    subtree._contentAvailabilityBitstreams.push(bitstream);\n  }\n\n  subtree._childSubtreeAvailability = parseAvailabilityBitstream(\n    subtreeJson.childSubtreeAvailability,\n    bufferViewsU8,\n    childSubtreeBits\n  );\n}\n\n/**\n * Given the JSON describing an availability bitstream, turn it into an\n * in-memory representation using an {@link ImplicitAvailabilityBitstream}\n * object. This handles both constants and bitstreams from a bufferView.\n *\n * @param {object} availabilityJson A JSON object representing the availability\n * @param {object} bufferViewsU8 A dictionary of bufferView index to its Uint8Array contents.\n * @param {number} lengthBits The length of the availability bitstream in bits\n * @param {boolean} [computeAvailableCountEnabled] If true and availabilityJson.availableCount is undefined, the availableCount will be computed.\n * @returns {ImplicitAvailabilityBitstream} The parsed bitstream object\n * @private\n */\nfunction parseAvailabilityBitstream(\n  availabilityJson,\n  bufferViewsU8,\n  lengthBits,\n  computeAvailableCountEnabled\n) {\n  if (defined(availabilityJson.constant)) {\n    return new ImplicitAvailabilityBitstream({\n      constant: Boolean(availabilityJson.constant),\n      lengthBits: lengthBits,\n      availableCount: availabilityJson.availableCount,\n    });\n  }\n\n  let bufferView;\n\n  // Check for bitstream first, which is part of the current schema.\n  // bufferView is the name of the bitstream from an older schema.\n  if (defined(availabilityJson.bitstream)) {\n    bufferView = bufferViewsU8[availabilityJson.bitstream];\n  } else if (defined(availabilityJson.bufferView)) {\n    bufferView = bufferViewsU8[availabilityJson.bufferView];\n  }\n\n  return new ImplicitAvailabilityBitstream({\n    bitstream: bufferView,\n    lengthBits: lengthBits,\n    availableCount: availabilityJson.availableCount,\n    computeAvailableCountEnabled: computeAvailableCountEnabled,\n  });\n}\n\n/**\n * Parse the metadata table for the tile metadata, storing a {@link MetadataTable}\n * in the subtree.\n *\n * @param {ImplicitSubtree} subtree The subtree\n * @param {ImplicitTileset} implicitTileset The implicit tileset this subtree belongs to.\n * @param {object} bufferViewsU8 A dictionary of bufferView index to its Uint8Array contents.\n * @private\n */\nfunction parseTileMetadataTable(subtree, implicitTileset, bufferViewsU8) {\n  const tilePropertyTableJson = subtree._tilePropertyTableJson;\n  const tileCount = subtree._tileAvailability.availableCount;\n  const metadataSchema = implicitTileset.metadataSchema;\n\n  const tileMetadataClassName = tilePropertyTableJson.class;\n  const tileMetadataClass = metadataSchema.classes[tileMetadataClassName];\n\n  subtree._tileMetadataTable = new MetadataTable({\n    class: tileMetadataClass,\n    count: tileCount,\n    properties: tilePropertyTableJson.properties,\n    bufferViews: bufferViewsU8,\n  });\n}\n\n/**\n * Parse the metadata tables for the content metadata, storing an array of\n * {@link MetadataTable}s in the subtree.\n *\n * @param {ImplicitSubtree} subtree The subtree\n * @param {ImplicitTileset} implicitTileset The implicit tileset this subtree belongs to.\n * @param {object} bufferViewsU8 A dictionary of bufferView index to its Uint8Array contents.\n * @private\n */\nfunction parseContentMetadataTables(subtree, implicitTileset, bufferViewsU8) {\n  const contentPropertyTableJsons = subtree._contentPropertyTableJsons;\n  const contentAvailabilityBitstreams = subtree._contentAvailabilityBitstreams;\n  const metadataSchema = implicitTileset.metadataSchema;\n\n  const contentMetadataTables = subtree._contentMetadataTables;\n  for (let i = 0; i < contentPropertyTableJsons.length; i++) {\n    const contentPropertyTableJson = contentPropertyTableJsons[i];\n    const contentAvailabilityBitsteam = contentAvailabilityBitstreams[i];\n\n    const contentCount = contentAvailabilityBitsteam.availableCount;\n    const contentMetadataClassName = contentPropertyTableJson.class;\n    const contentMetadataClass =\n      metadataSchema.classes[contentMetadataClassName];\n\n    const metadataTable = new MetadataTable({\n      class: contentMetadataClass,\n      count: contentCount,\n      properties: contentPropertyTableJson.properties,\n      bufferViews: bufferViewsU8,\n    });\n\n    contentMetadataTables.push(metadataTable);\n  }\n}\n\n/**\n * Make a jump buffer, i.e. a map of a bit index to the metadata entity ID.\n * <p>\n * For unavailable tiles and content, the jump buffer entries will be uninitialized.\n * Use the tile and content availability to determine whether a jump buffer value is valid.\n * </p>\n *\n * @param {ImplicitAvailabilityBitstream} availability The availability bitstream to create the jump buffer from.\n * @returns {Array} The resulting jump buffer.\n * @private\n */\nfunction makeJumpBuffer(availability) {\n  let entityId = 0;\n  const bufferLength = availability.lengthBits;\n  const availableCount = availability.availableCount;\n\n  let jumpBuffer;\n  if (availableCount < 256) {\n    jumpBuffer = new Uint8Array(bufferLength);\n  } else if (availableCount < 65536) {\n    jumpBuffer = new Uint16Array(bufferLength);\n  } else {\n    jumpBuffer = new Uint32Array(bufferLength);\n  }\n\n  for (let i = 0; i < availability.lengthBits; i++) {\n    if (availability.getBit(i)) {\n      jumpBuffer[i] = entityId;\n      entityId++;\n    }\n  }\n\n  return jumpBuffer;\n}\n\n/**\n * Make the jump buffer, i.e. a map of a bit index to the metadata entity ID,\n * for the content metadata. This is stored in the subtree.\n *\n * @param {ImplicitSubtree} subtree The subtree\n * @private\n */\nfunction makeTileJumpBuffer(subtree) {\n  const tileJumpBuffer = makeJumpBuffer(subtree._tileAvailability);\n  subtree._tileJumpBuffer = tileJumpBuffer;\n}\n\n/**\n * Make the jump buffers, i.e. maps of bit indices to the metadata entity IDs,\n * for the content metadata. This is stored in the subtree.\n *\n * @param {ImplicitSubtree} subtree The subtree\n * @private\n */\nfunction makeContentJumpBuffers(subtree) {\n  const contentJumpBuffers = subtree._contentJumpBuffers;\n  const contentAvailabilityBitstreams = subtree._contentAvailabilityBitstreams;\n  for (let i = 0; i < contentAvailabilityBitstreams.length; i++) {\n    const contentAvailability = contentAvailabilityBitstreams[i];\n    const contentJumpBuffer = makeJumpBuffer(contentAvailability);\n    contentJumpBuffers.push(contentJumpBuffer);\n  }\n}\n\n/**\n * Given the implicit tiling coordinates for a tile, get the index within the\n * subtree's tile availability bitstream.\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a tile\n * @return {number} The tile's index within the subtree.\n * @private\n */\nImplicitSubtree.prototype.getTileIndex = function (implicitCoordinates) {\n  const localLevel =\n    implicitCoordinates.level - this._implicitCoordinates.level;\n  if (localLevel < 0 || this._subtreeLevels <= localLevel) {\n    throw new RuntimeError(\"level is out of bounds for this subtree\");\n  }\n\n  const subtreeCoordinates = implicitCoordinates.getSubtreeCoordinates();\n  const offsetCoordinates = subtreeCoordinates.getOffsetCoordinates(\n    implicitCoordinates\n  );\n  const index = offsetCoordinates.tileIndex;\n  return index;\n};\n\n/**\n * Given the implicit tiling coordinates for a child subtree, get the index within the\n * subtree's child subtree availability bitstream.\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a child subtree\n * @return {number} The child subtree's index within the subtree's child subtree availability bitstream.\n * @private\n */\nImplicitSubtree.prototype.getChildSubtreeIndex = function (\n  implicitCoordinates\n) {\n  const localLevel =\n    implicitCoordinates.level - this._implicitCoordinates.level;\n  if (localLevel !== this._implicitCoordinates.subtreeLevels) {\n    throw new RuntimeError(\"level is out of bounds for this subtree\");\n  }\n\n  // Call getParentSubtreeCoordinates instead of getSubtreeCoordinates because the\n  // child subtree is by definition the root of its own subtree, so we need to find\n  // the parent subtree.\n  const parentSubtreeCoordinates = implicitCoordinates.getParentSubtreeCoordinates();\n  const offsetCoordinates = parentSubtreeCoordinates.getOffsetCoordinates(\n    implicitCoordinates\n  );\n  const index = offsetCoordinates.mortonIndex;\n  return index;\n};\n\n/**\n * Get the entity ID for a tile within this subtree.\n * @param {ImplicitSubtree} subtree The subtree\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a tile\n * @return {number} The entity ID for this tile for accessing tile metadata, or <code>undefined</code> if not applicable.\n *\n * @private\n */\nfunction getTileEntityId(subtree, implicitCoordinates) {\n  if (!defined(subtree._tileMetadataTable)) {\n    return undefined;\n  }\n\n  const tileIndex = subtree.getTileIndex(implicitCoordinates);\n  if (subtree._tileAvailability.getBit(tileIndex)) {\n    return subtree._tileJumpBuffer[tileIndex];\n  }\n\n  return undefined;\n}\n\n/**\n * Get the entity ID for a content within this subtree.\n * @param {ImplicitSubtree} subtree The subtree\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a content\n * @param {number} contentIndex The content index, for distinguishing between multiple contents.\n * @return {number} The entity ID for this content for accessing content metadata, or <code>undefined</code> if not applicable.\n *\n * @private\n */\nfunction getContentEntityId(subtree, implicitCoordinates, contentIndex) {\n  const metadataTables = subtree._contentMetadataTables;\n  if (!defined(metadataTables)) {\n    return undefined;\n  }\n\n  const metadataTable = metadataTables[contentIndex];\n  if (!defined(metadataTable)) {\n    return undefined;\n  }\n\n  const availability = subtree._contentAvailabilityBitstreams[contentIndex];\n  const tileIndex = subtree.getTileIndex(implicitCoordinates);\n  if (availability.getBit(tileIndex)) {\n    const contentJumpBuffer = subtree._contentJumpBuffers[contentIndex];\n    return contentJumpBuffer[tileIndex];\n  }\n\n  return undefined;\n}\n\n/**\n * Create and return a metadata table view for a tile within this subtree.\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a tile\n * @return {ImplicitMetadataView} The metadata view for this tile, or <code>undefined</code> if not applicable.\n *\n * @private\n */\nImplicitSubtree.prototype.getTileMetadataView = function (implicitCoordinates) {\n  const entityId = getTileEntityId(this, implicitCoordinates);\n  if (!defined(entityId)) {\n    return undefined;\n  }\n\n  const metadataTable = this._tileMetadataTable;\n  return new ImplicitMetadataView({\n    class: metadataTable.class,\n    metadataTable: metadataTable,\n    entityId: entityId,\n    propertyTableJson: this._tilePropertyTableJson,\n  });\n};\n\n/**\n * Create and return a metadata table view for a content within this subtree.\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a content\n * @param {number} contentIndex The index of the content used to distinguish between multiple contents\n * @return {ImplicitMetadataView} The metadata view for this content, or <code>undefined</code> if not applicable.\n *\n * @private\n */\nImplicitSubtree.prototype.getContentMetadataView = function (\n  implicitCoordinates,\n  contentIndex\n) {\n  const entityId = getContentEntityId(this, implicitCoordinates, contentIndex);\n  if (!defined(entityId)) {\n    return undefined;\n  }\n\n  const metadataTable = this._contentMetadataTables[contentIndex];\n  const propertyTableJson = this._contentPropertyTableJsons[contentIndex];\n  return new ImplicitMetadataView({\n    class: metadataTable.class,\n    metadataTable: metadataTable,\n    entityId: entityId,\n    contentIndex: contentIndex,\n    propertyTableJson: propertyTableJson,\n  });\n};\n\n/**\n * @private\n */\nImplicitSubtree.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * @private\n */\nImplicitSubtree.prototype.destroy = function () {\n  if (defined(this._bufferLoader)) {\n    ResourceCache.unload(this._bufferLoader);\n  }\n\n  return destroyObject(this);\n};\n\nexport default ImplicitSubtree;\n", "/**\n * An enum of built-in semantics.\n *\n * @enum MetadataSemantic\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata/Semantics|3D Metadata Semantic Reference}\n */\nconst MetadataSemantic = {\n  /**\n   * A unique identifier, stored as a <code>STRING</code>.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  ID: \"ID\",\n  /**\n   * A name, stored as a <code>STRING</code>. This does not have to be unique.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  NAME: \"NAME\",\n  /**\n   * A description, stored as a <code>STRING</code>.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  DESCRIPTION: \"DESCRIPTION\",\n  /**\n   * The number of tiles in a tileset, stored as a <code>UINT64</code>.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  TILESET_TILE_COUNT: \"TILESET_TILE_COUNT\",\n  /**\n   * A bounding box for a tile, stored as an array of 12 <code>FLOAT32</code> or <code>FLOAT64</code> components. The components are the same format as for <code>boundingVolume.box</code> in 3D Tiles 1.0. This semantic is used to provide a tighter bounding volume than the one implicitly calculated in implicit tiling.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  TILE_BOUNDING_BOX: \"TILE_BOUNDING_BOX\",\n  /**\n   * A bounding region for a tile, stored as an array of 6 <code>FLOAT64</code> components. The components are <code>[west, south, east, north, minimumHeight, maximumHeight]</code>. This semantic is used to provide a tighter bounding volume than the one implicitly calculated in implicit tiling.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  TILE_BOUNDING_REGION: \"TILE_BOUNDING_REGION\",\n  /**\n   * A bounding sphere for a tile, stored as an array of 4 <code>FLOAT32</code> or <code>FLOAT64</code> components. The components are <code>[centerX, centerY, centerZ, radius]</code>. This semantic is used to provide a tighter bounding volume than the one implicitly calculated in implicit tiling.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  TILE_BOUNDING_SPHERE: \"TILE_BOUNDING_SPHERE\",\n  /**\n   * The minimum height of a tile above (or below) the WGS84 ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>. This semantic is used to tighten bounding regions implicitly calculated in implicit tiling.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  TILE_MINIMUM_HEIGHT: \"TILE_MINIMUM_HEIGHT\",\n  /**\n   * The maximum height of a tile above (or below) the WGS84 ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>. This semantic is used to tighten bounding regions implicitly calculated in implicit tiling.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  TILE_MAXIMUM_HEIGHT: \"TILE_MAXIMUM_HEIGHT\",\n  /**\n   * The horizon occlusion point for a tile, stored as an <code>VEC3</code> of <code>FLOAT32</code> or <code>FLOAT64</code> components.\n   *\n   * @see {@link https://cesium.com/blog/2013/04/25/horizon-culling/|Horizon Culling}\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  TILE_HORIZON_OCCLUSION_POINT: \"TILE_HORIZON_OCCLUSION_POINT\",\n  /**\n   * The geometric error for a tile, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>. This semantic is used to override the geometric error implicitly calculated in implicit tiling.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  TILE_GEOMETRIC_ERROR: \"TILE_GEOMETRIC_ERROR\",\n  /**\n   * A bounding box for the content of a tile, stored as an array of 12 <code>FLOAT32</code> or <code>FLOAT64</code> components. The components are the same format as for <code>boundingVolume.box</code> in 3D Tiles 1.0. This semantic is used to provide a tighter bounding volume than the one implicitly calculated in implicit tiling.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  CONTENT_BOUNDING_BOX: \"CONTENT_BOUNDING_BOX\",\n  /**\n   * A bounding region for the content of a tile, stored as an array of 6 <code>FLOAT64</code> components. The components are <code>[west, south, east, north, minimumHeight, maximumHeight]</code>. This semantic is used to provide a tighter bounding volume than the one implicitly calculated in implicit tiling.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  CONTENT_BOUNDING_REGION: \"CONTENT_BOUNDING_REGION\",\n  /**\n   * A bounding sphere for the content of a tile, stored as an array of 4 <code>FLOAT32</code> or <code>FLOAT64</code> components. The components are <code>[centerX, centerY, centerZ, radius]</code>. This semantic is used to provide a tighter bounding volume than the one implicitly calculated in implicit tiling.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  CONTENT_BOUNDING_SPHERE: \"CONTENT_BOUNDING_SPHERE\",\n  /**\n   * The minimum height of the content of a tile above (or below) the WGS84 ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  CONTENT_MINIMUM_HEIGHT: \"CONTENT_MINIMUM_HEIGHT\",\n  /**\n   * The maximum height of the content of a tile above (or below) the WGS84 ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  CONTENT_MAXIMUM_HEIGHT: \"CONTENT_MAXIMUM_HEIGHT\",\n  /**\n   * The horizon occlusion point for the content of a tile, stored as an <code>VEC3</code> of <code>FLOAT32</code> or <code>FLOAT64</code> components.\n   *\n   * @see {@link https://cesium.com/blog/2013/04/25/horizon-culling/|Horizon Culling}\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  CONTENT_HORIZON_OCCLUSION_POINT: \"CONTENT_HORIZON_OCCLUSION_POINT\",\n};\n\nexport default Object.freeze(MetadataSemantic);\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * Utilities for parsing bounding volume semantics from 3D Tiles 1.1 metadata.\n *\n * @namespace BoundingVolumeSemantics\n * @private\n */\nconst BoundingVolumeSemantics = {};\n\n/**\n * Parse the bounding volume-related semantics such as\n * <code>TILE_BOUNDING_BOX</code> and <code>CONTENT_BOUNDING_REGION</code> from\n * implicit tile metadata. Results are returned as a JSON object for use when\n * transcoding tiles (see {@link Implicit3DTileContent}).\n * <p>\n * Bounding volumes are checked in the order box, region, then sphere. Only\n * the first valid bounding volume is returned.\n * </p>\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata/Semantics|3D Metadata Semantic Reference} for the various bounding volumes and minimum/maximum heights.\n *\n * @param {TileMetadata} tileMetadata The metadata object for looking up values by semantic. In practice, this will typically be a {@link ImplicitMetadataView}\n * @return {object} An object containing a <code>tile</code> property and a <code>content</code> property. These contain the bounding volume, and any minimum or maximum height.\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nBoundingVolumeSemantics.parseAllBoundingVolumeSemantics = function (\n  tileMetadata\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"tileMetadata\", tileMetadata);\n  //>>includeEnd('debug');\n\n  return {\n    tile: {\n      boundingVolume: BoundingVolumeSemantics.parseBoundingVolumeSemantic(\n        \"TILE\",\n        tileMetadata\n      ),\n      minimumHeight: BoundingVolumeSemantics._parseMinimumHeight(\n        \"TILE\",\n        tileMetadata\n      ),\n      maximumHeight: BoundingVolumeSemantics._parseMaximumHeight(\n        \"TILE\",\n        tileMetadata\n      ),\n    },\n    content: {\n      boundingVolume: BoundingVolumeSemantics.parseBoundingVolumeSemantic(\n        \"CONTENT\",\n        tileMetadata\n      ),\n      minimumHeight: BoundingVolumeSemantics._parseMinimumHeight(\n        \"CONTENT\",\n        tileMetadata\n      ),\n      maximumHeight: BoundingVolumeSemantics._parseMaximumHeight(\n        \"CONTENT\",\n        tileMetadata\n      ),\n    },\n  };\n};\n\n/**\n * Parse the bounding volume from a tile metadata. If the metadata specify\n * multiple bounding volumes, only the first one is returned. Bounding volumes\n * are checked in the order box, region, then sphere.\n *\n * This handles both tile and content bounding volumes, as the only difference\n * is the prefix. e.g. <code>TILE_BOUNDING_BOX</code> and\n * <code>CONTENT_BOUNDING_BOX</code> have the same memory layout.\n *\n * @param {string} prefix Either \"TILE\" or \"CONTENT\"\n * @param {TileMetadata} tileMetadata The tileMetadata for looking up values\n * @return {object} An object representing the JSON description of the tile metadata\n * @private\n */\nBoundingVolumeSemantics.parseBoundingVolumeSemantic = function (\n  prefix,\n  tileMetadata\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"prefix\", prefix);\n  if (prefix !== \"TILE\" && prefix !== \"CONTENT\") {\n    throw new DeveloperError(\"prefix must be either 'TILE' or 'CONTENT'\");\n  }\n  Check.typeOf.object(\"tileMetadata\", tileMetadata);\n  //>>includeEnd('debug');\n\n  const boundingBoxSemantic = `${prefix}_BOUNDING_BOX`;\n  const boundingBox = tileMetadata.getPropertyBySemantic(boundingBoxSemantic);\n\n  if (defined(boundingBox)) {\n    return {\n      box: boundingBox,\n    };\n  }\n\n  const boundingRegionSemantic = `${prefix}_BOUNDING_REGION`;\n  const boundingRegion = tileMetadata.getPropertyBySemantic(\n    boundingRegionSemantic\n  );\n\n  if (defined(boundingRegion)) {\n    return {\n      region: boundingRegion,\n    };\n  }\n\n  const boundingSphereSemantic = `${prefix}_BOUNDING_SPHERE`;\n  const boundingSphere = tileMetadata.getPropertyBySemantic(\n    boundingSphereSemantic\n  );\n\n  if (defined(boundingSphere)) {\n    // ARRAY with 4 elements is automatically converted to a Cartesian4\n    return {\n      sphere: boundingSphere,\n    };\n  }\n\n  return undefined;\n};\n\n/**\n * Parse the minimum height from tile metadata. This is used for making tighter\n * quadtree bounds for implicit tiling. This works for both\n * <code>TILE_MINIMUM_HEIGHT</code> and <code>CONTENT_MINIMUM_HEIGHT</code>\n *\n * @param {string} prefix Either \"TILE\" or \"CONTENT\"\n * @param {TileMetadata} tileMetadata The tileMetadata for looking up values\n * @return {number} The minimum height\n * @private\n */\nBoundingVolumeSemantics._parseMinimumHeight = function (prefix, tileMetadata) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"prefix\", prefix);\n  if (prefix !== \"TILE\" && prefix !== \"CONTENT\") {\n    throw new DeveloperError(\"prefix must be either 'TILE' or 'CONTENT'\");\n  }\n  Check.typeOf.object(\"tileMetadata\", tileMetadata);\n  //>>includeEnd('debug');\n\n  const minimumHeightSemantic = `${prefix}_MINIMUM_HEIGHT`;\n  return tileMetadata.getPropertyBySemantic(minimumHeightSemantic);\n};\n\n/**\n * Parse the maximum height from tile metadata. This is used for making tighter\n * quadtree bounds for implicit tiling. This works for both\n * <code>TILE_MAXIMUM_HEIGHT</code> and <code>CONTENT_MAXIMUM_HEIGHT</code>\n *\n * @param {string} prefix Either \"TILE\" or \"CONTENT\"\n * @param {TileMetadata} tileMetadata The tileMetadata for looking up values\n * @return {number} The maximum height\n * @private\n */\nBoundingVolumeSemantics._parseMaximumHeight = function (prefix, tileMetadata) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"prefix\", prefix);\n  if (prefix !== \"TILE\" && prefix !== \"CONTENT\") {\n    throw new DeveloperError(\"prefix must be either 'TILE' or 'CONTENT'\");\n  }\n  Check.typeOf.object(\"tileMetadata\", tileMetadata);\n  //>>includeEnd('debug');\n\n  const maximumHeightSemantic = `${prefix}_MAXIMUM_HEIGHT`;\n  return tileMetadata.getPropertyBySemantic(maximumHeightSemantic);\n};\n\nexport default BoundingVolumeSemantics;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport HilbertOrder from \"../Core/HilbertOrder.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport S2Cell from \"../Core/S2Cell.js\";\nimport ImplicitSubtree from \"./ImplicitSubtree.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport MetadataSemantic from \"./MetadataSemantic.js\";\nimport BoundingVolumeSemantics from \"./BoundingVolumeSemantics.js\";\n\n/**\n * A specialized {@link Cesium3DTileContent} that lazily evaluates an implicit\n * tileset. It is somewhat similar in operation to a\n * {@link Tileset3DTileContent} in that once the content is constructed, it\n * updates the tileset tree with more tiles. However, unlike external tilesets,\n * child subtrees are represented as additional placeholder nodes with\n * Implicit3DTileContent.\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n * This object is normally not instantiated directly, use {@link Implicit3DTileContent.fromSubtreeJson}.\n *\n * @alias Implicit3DTileContent\n * @constructor\n *\n * @param {Cesium3DTileset} tileset The tileset this content belongs to\n * @param {Cesium3DTile} tile The tile this content belongs to.\n * @param {Resource} resource The resource for the tileset\n * @param {object} [json] The JSON object containing the subtree. Mutually exclusive with arrayBuffer.\n * @param {ArrayBuffer} [arrayBuffer] The array buffer that stores the content payload. Mutually exclusive with json.\n * @param {number} [byteOffset=0] The offset into the array buffer, if one was provided\n *\n * @exception {DeveloperError} One of json and arrayBuffer must be defined.\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction Implicit3DTileContent(tileset, tile, resource) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"tile.implicitTileset\", tile.implicitTileset);\n  Check.defined(\"tile.implicitCoordinates\", tile.implicitCoordinates);\n  //>>includeEnd('debug');\n\n  const implicitTileset = tile.implicitTileset;\n  const implicitCoordinates = tile.implicitCoordinates;\n\n  this._implicitTileset = implicitTileset;\n  this._implicitCoordinates = implicitCoordinates;\n  this._implicitSubtree = undefined;\n  this._tileset = tileset;\n  this._tile = tile;\n  this._resource = resource;\n\n  this._metadata = undefined;\n\n  this.featurePropertiesDirty = false;\n  this._group = undefined;\n\n  const templateValues = implicitCoordinates.getTemplateValues();\n  const subtreeResource = implicitTileset.subtreeUriTemplate.getDerivedResource(\n    {\n      templateValues: templateValues,\n    }\n  );\n  this._url = subtreeResource.getUrlComponent(true);\n\n  this._ready = false;\n}\n\nObject.defineProperties(Implicit3DTileContent.prototype, {\n  featuresLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  pointsLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  trianglesLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  geometryByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  texturesByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  batchTableByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  innerContents: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Returns true when the tile's content is ready to render; otherwise false\n   *\n   * @memberof Implicit3DTileContent.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n\n  tileset: {\n    get: function () {\n      return this._tileset;\n    },\n  },\n\n  tile: {\n    get: function () {\n      return this._tile;\n    },\n  },\n\n  url: {\n    get: function () {\n      return this._url;\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface. <code>Implicit3DTileContent</code>\n   * always returns <code>undefined</code>. Only transcoded tiles have content metadata.\n   * @memberof Implicit3DTileContent.prototype\n   * @private\n   */\n  metadata: {\n    get: function () {\n      return undefined;\n    },\n    set: function () {\n      //>>includeStart('debug', pragmas.debug);\n      throw new DeveloperError(\"Implicit3DTileContent cannot have metadata\");\n      //>>includeEnd('debug');\n    },\n  },\n\n  batchTable: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  group: {\n    get: function () {\n      return this._group;\n    },\n    set: function (value) {\n      this._group = value;\n    },\n  },\n});\n\n/**\n * Initialize the implicit content by parsing the subtree resource and setting\n * up a promise chain to expand the immediate subtree.\n *\n * @param {Cesium3DTileset} tileset The tileset this content belongs to\n * @param {Cesium3DTile} tile The tile this content belongs to.\n * @param {Resource} resource The resource for the tileset\n * @param {object} [json] The JSON containing the subtree. Mutually exclusive with arrayBuffer.\n * @param {ArrayBuffer} [arrayBuffer] The ArrayBuffer containing a subtree binary. Mutually exclusive with json.\n * @param {number} [byteOffset=0] The byte offset into the arrayBuffer\n * @return {Promise<Implicit3DTileContent>}\n *\n * @exception {DeveloperError} One of json and arrayBuffer must be defined.\n *\n * @private\n */\nImplicit3DTileContent.fromSubtreeJson = async function (\n  tileset,\n  tile,\n  resource,\n  json,\n  arrayBuffer,\n  byteOffset\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"tile.implicitTileset\", tile.implicitTileset);\n  Check.defined(\"tile.implicitCoordinates\", tile.implicitCoordinates);\n  if (defined(json) === defined(arrayBuffer)) {\n    throw new DeveloperError(\"One of json and arrayBuffer must be defined.\");\n  }\n  //>>includeEnd('debug');\n\n  byteOffset = defaultValue(byteOffset, 0);\n  let uint8Array;\n  if (defined(arrayBuffer)) {\n    uint8Array = new Uint8Array(arrayBuffer, byteOffset);\n  }\n\n  const implicitTileset = tile.implicitTileset;\n  const implicitCoordinates = tile.implicitCoordinates;\n\n  const subtree = await ImplicitSubtree.fromSubtreeJson(\n    resource,\n    json,\n    uint8Array,\n    implicitTileset,\n    implicitCoordinates\n  );\n\n  const content = new Implicit3DTileContent(tileset, tile, resource);\n\n  content._implicitSubtree = subtree;\n  expandSubtree(content, subtree);\n  content._ready = true;\n\n  return content;\n};\n\n/**\n * Expand a single subtree placeholder tile. This transcodes the subtree into\n * a tree of {@link Cesium3DTile}. The root of this tree is stored in\n * the placeholder tile's children array. This method also creates placeholder\n * tiles for the child subtrees to be lazily expanded as needed.\n *\n * @param {Implicit3DTileContent} content The content\n * @param {ImplicitSubtree} subtree The parsed subtree\n * @private\n */\nfunction expandSubtree(content, subtree) {\n  const placeholderTile = content._tile;\n\n  // Parse the tiles inside this immediate subtree\n  const childIndex = content._implicitCoordinates.childIndex;\n  const results = transcodeSubtreeTiles(\n    content,\n    subtree,\n    placeholderTile,\n    childIndex\n  );\n\n  const statistics = content._tileset.statistics;\n\n  // Link the new subtree to the existing placeholder tile.\n  placeholderTile.children.push(results.rootTile);\n  statistics.numberOfTilesTotal++;\n\n  // for each child subtree, make new placeholder tiles\n  const childSubtrees = listChildSubtrees(content, subtree, results.bottomRow);\n  for (let i = 0; i < childSubtrees.length; i++) {\n    const subtreeLocator = childSubtrees[i];\n    const leafTile = subtreeLocator.tile;\n    const implicitChildTile = makePlaceholderChildSubtree(\n      content,\n      leafTile,\n      subtreeLocator.childIndex\n    );\n    leafTile.children.push(implicitChildTile);\n    statistics.numberOfTilesTotal++;\n  }\n}\n\n/**\n * A pair of (tile, childIndex) used for finding child subtrees.\n *\n * @typedef {object} ChildSubtreeLocator\n * @property {Cesium3DTile} tile One of the tiles in the bottommost row of the subtree.\n * @property {number} childIndex The morton index of the child tile relative to its parent\n * @private\n */\n\n/**\n * Determine what child subtrees exist and return a list of information\n *\n * @param {Implicit3DTileContent} content The implicit content\n * @param {ImplicitSubtree} subtree The subtree for looking up availability\n * @param {Array<Cesium3DTile|undefined>} bottomRow The bottom row of tiles in a transcoded subtree\n * @returns {ChildSubtreeLocator[]} A list of identifiers for the child subtrees.\n * @private\n */\nfunction listChildSubtrees(content, subtree, bottomRow) {\n  const results = [];\n  const branchingFactor = content._implicitTileset.branchingFactor;\n  for (let i = 0; i < bottomRow.length; i++) {\n    const leafTile = bottomRow[i];\n    if (!defined(leafTile)) {\n      continue;\n    }\n\n    for (let j = 0; j < branchingFactor; j++) {\n      const index = i * branchingFactor + j;\n      if (subtree.childSubtreeIsAvailableAtIndex(index)) {\n        results.push({\n          tile: leafTile,\n          childIndex: j,\n        });\n      }\n    }\n  }\n  return results;\n}\n\n/**\n * Results of transcodeSubtreeTiles, containing the root tile of the\n * subtree and the bottom row of nodes for further processing.\n *\n * @typedef {object} TranscodedSubtree\n * @property {Cesium3DTile} rootTile The transcoded root tile of the subtree\n * @property {Array<Cesium3DTile|undefined>} bottomRow The bottom row of transcoded tiles. This is helpful for processing child subtrees\n * @private\n */\n\n/**\n * Transcode the implicitly-defined tiles within this subtree and generate\n * explicit {@link Cesium3DTile} objects. This function only transcode tiles,\n * child subtrees are handled separately.\n *\n * @param {Implicit3DTileContent} content The implicit content\n * @param {ImplicitSubtree} subtree The subtree to get availability information\n * @param {Cesium3DTile} placeholderTile The placeholder tile, used for constructing the subtree root tile\n * @param {number} childIndex The Morton index of the root tile relative to parentOfRootTile\n * @returns {TranscodedSubtree} The newly created subtree of tiles\n * @private\n */\nfunction transcodeSubtreeTiles(content, subtree, placeholderTile, childIndex) {\n  const rootBitIndex = 0;\n  const rootParentIsPlaceholder = true;\n  const rootTile = deriveChildTile(\n    content,\n    subtree,\n    placeholderTile,\n    childIndex,\n    rootBitIndex,\n    rootParentIsPlaceholder\n  );\n\n  const statistics = content._tileset.statistics;\n\n  // Sliding window over the levels of the tree.\n  // Each row is branchingFactor * length of previous row\n  // Tiles within a row are ordered by Morton index.\n  let parentRow = [rootTile];\n  let currentRow = [];\n\n  const implicitTileset = content._implicitTileset;\n  for (let level = 1; level < implicitTileset.subtreeLevels; level++) {\n    const levelOffset = subtree.getLevelOffset(level);\n    const numberOfChildren = implicitTileset.branchingFactor * parentRow.length;\n    for (\n      let childMortonIndex = 0;\n      childMortonIndex < numberOfChildren;\n      childMortonIndex++\n    ) {\n      const childBitIndex = levelOffset + childMortonIndex;\n\n      if (!subtree.tileIsAvailableAtIndex(childBitIndex)) {\n        currentRow.push(undefined);\n        continue;\n      }\n\n      const parentMortonIndex = subtree.getParentMortonIndex(childMortonIndex);\n      const parentTile = parentRow[parentMortonIndex];\n      const childChildIndex =\n        childMortonIndex % implicitTileset.branchingFactor;\n      const childTile = deriveChildTile(\n        content,\n        subtree,\n        parentTile,\n        childChildIndex,\n        childBitIndex\n      );\n      parentTile.children.push(childTile);\n      statistics.numberOfTilesTotal++;\n      currentRow.push(childTile);\n    }\n\n    parentRow = currentRow;\n    currentRow = [];\n  }\n\n  return {\n    rootTile: rootTile,\n    // At the end of the last loop, bottomRow was moved to parentRow\n    bottomRow: parentRow,\n  };\n}\n\nfunction getGeometricError(tileMetadata, implicitTileset, implicitCoordinates) {\n  const semantic = MetadataSemantic.TILE_GEOMETRIC_ERROR;\n\n  if (defined(tileMetadata) && tileMetadata.hasPropertyBySemantic(semantic)) {\n    return tileMetadata.getPropertyBySemantic(semantic);\n  }\n\n  return (\n    implicitTileset.geometricError / Math.pow(2, implicitCoordinates.level)\n  );\n}\n\n/**\n * Given a parent tile and information about which child to create, derive\n * the properties of the child tile implicitly.\n * <p>\n * This creates a real tile for rendering, not a placeholder tile like some of\n * the other methods of ImplicitTileset.\n * </p>\n *\n * @param {Implicit3DTileContent} implicitContent The implicit content\n * @param {ImplicitSubtree} subtree The subtree the child tile belongs to\n * @param {Cesium3DTile} parentTile The parent of the new child tile\n * @param {number} childIndex The morton index of the child tile relative to its parent\n * @param {number} childBitIndex The index of the child tile within the tile's availability information.\n * @param {boolean} [parentIsPlaceholderTile=false] True if parentTile is a placeholder tile. This is true for the root of each subtree.\n * @returns {Cesium3DTile} The new child tile.\n * @private\n */\nfunction deriveChildTile(\n  implicitContent,\n  subtree,\n  parentTile,\n  childIndex,\n  childBitIndex,\n  parentIsPlaceholderTile\n) {\n  const implicitTileset = implicitContent._implicitTileset;\n  let implicitCoordinates;\n  if (defaultValue(parentIsPlaceholderTile, false)) {\n    implicitCoordinates = parentTile.implicitCoordinates;\n  } else {\n    implicitCoordinates = parentTile.implicitCoordinates.getChildCoordinates(\n      childIndex\n    );\n  }\n\n  // Parse metadata and bounding volume semantics at the beginning\n  // as the bounding volumes are needed below.\n  let tileMetadata;\n  let tileBounds;\n  let contentBounds;\n  if (defined(subtree.tilePropertyTableJson)) {\n    tileMetadata = subtree.getTileMetadataView(implicitCoordinates);\n\n    const boundingVolumeSemantics = BoundingVolumeSemantics.parseAllBoundingVolumeSemantics(\n      tileMetadata\n    );\n    tileBounds = boundingVolumeSemantics.tile;\n    contentBounds = boundingVolumeSemantics.content;\n  }\n\n  // Content is not loaded at this point, so this flag is set for future reference.\n  const contentPropertyTableJsons = subtree.contentPropertyTableJsons;\n  const length = contentPropertyTableJsons.length;\n  let hasImplicitContentMetadata = false;\n  for (let i = 0; i < length; i++) {\n    if (subtree.contentIsAvailableAtCoordinates(implicitCoordinates, i)) {\n      hasImplicitContentMetadata = true;\n      break;\n    }\n  }\n\n  const boundingVolume = getTileBoundingVolume(\n    implicitTileset,\n    implicitCoordinates,\n    childIndex,\n    parentIsPlaceholderTile,\n    parentTile,\n    tileBounds\n  );\n\n  const contentJsons = [];\n  for (let i = 0; i < implicitTileset.contentCount; i++) {\n    if (!subtree.contentIsAvailableAtIndex(childBitIndex, i)) {\n      continue;\n    }\n    const childContentTemplate = implicitTileset.contentUriTemplates[i];\n    const childContentUri = childContentTemplate.getDerivedResource({\n      templateValues: implicitCoordinates.getTemplateValues(),\n    }).url;\n    const contentJson = {\n      uri: childContentUri,\n    };\n\n    const contentBoundingVolume = getContentBoundingVolume(\n      boundingVolume,\n      contentBounds\n    );\n\n    if (defined(contentBoundingVolume)) {\n      contentJson.boundingVolume = contentBoundingVolume;\n    }\n\n    // combine() is used to pass through any additional properties the\n    // user specified such as extras or extensions\n    contentJsons.push(combine(contentJson, implicitTileset.contentHeaders[i]));\n  }\n\n  const childGeometricError = getGeometricError(\n    tileMetadata,\n    implicitTileset,\n    implicitCoordinates\n  );\n\n  const tileJson = {\n    boundingVolume: boundingVolume,\n    geometricError: childGeometricError,\n    refine: implicitTileset.refine,\n    contents: contentJsons,\n  };\n\n  // combine() is used to pass through any additional properties the\n  // user specified such as extras or extensions.\n  const deep = true;\n  const rootHeader = clone(implicitTileset.tileHeader, deep);\n  // The bounding volume was computed above since it may come from metadata\n  // in the subtree file.\n  delete rootHeader.boundingVolume;\n  // Copying the transform to all the transcoded tiles would cause the transform\n  // to be applied multiple times. Removing it from the header avoids this issue.\n  delete rootHeader.transform;\n  // The implicit tiling spec does not specify what should happen if explicit\n  // tile metadata is added to the placeholder tile. Since implicit tile\n  // metadata comes from the subtree file, ignore the explicit version.\n  //\n  // Also, when a property with the semantic TILE_BOUNDING_VOLUME is added to\n  // the placeholder tile to set a tight bounding volume (See Cesium3DTile.js)\n  // propagating it to transcoded tiles causes transcoded tiles to use the\n  // wrong bounding volume, this can lead to loading far too many tiles.\n  delete rootHeader.metadata;\n  const combinedTileJson = combine(tileJson, rootHeader, deep);\n\n  const childTile = makeTile(\n    implicitContent,\n    implicitTileset.baseResource,\n    combinedTileJson,\n    parentTile\n  );\n\n  childTile.implicitCoordinates = implicitCoordinates;\n  childTile.implicitSubtree = subtree;\n  childTile.metadata = tileMetadata;\n  childTile.hasImplicitContentMetadata = hasImplicitContentMetadata;\n\n  return childTile;\n}\n\n/**\n * Checks whether the bounding volume's heights can be updated.\n * Returns true if the minimumHeight/maximumHeight parameter\n * is defined and the bounding volume is a region or S2 cell.\n *\n * @param {object} [boundingVolume] The bounding volume\n * @param {object} [tileBounds] The tile bounds\n * @param {number} [tileBounds.minimumHeight] The minimum height\n * @param {number} [tileBounds.maximumHeight] The maximum height\n * @returns {boolean} Whether the bounding volume's heights can be updated\n * @private\n */\nfunction canUpdateHeights(boundingVolume, tileBounds) {\n  return (\n    defined(boundingVolume) &&\n    defined(tileBounds) &&\n    (defined(tileBounds.minimumHeight) || defined(tileBounds.maximumHeight)) &&\n    (hasExtension(boundingVolume, \"3DTILES_bounding_volume_S2\") ||\n      defined(boundingVolume.region))\n  );\n}\n\n/**\n * Update the minimum and maximum height of the bounding volume.\n * This is typically used to tighten a bounding volume using the\n * <code>TILE_MINIMUM_HEIGHT</code> and <code>TILE_MAXIMUM_HEIGHT</code>\n * semantics. Heights are only updated if the respective\n * minimumHeight/maximumHeight parameter is defined and the\n * bounding volume is a region or S2 cell.\n *\n * @param {object} boundingVolume The bounding volume\n * @param {object} [tileBounds] The tile bounds\n * @param {number} [tileBounds.minimumHeight] The new minimum height\n * @param {number} [tileBounds.maximumHeight] The new maximum height\n * @private\n */\nfunction updateHeights(boundingVolume, tileBounds) {\n  if (!defined(tileBounds)) {\n    return;\n  }\n\n  if (hasExtension(boundingVolume, \"3DTILES_bounding_volume_S2\")) {\n    updateS2CellHeights(\n      boundingVolume.extensions[\"3DTILES_bounding_volume_S2\"],\n      tileBounds.minimumHeight,\n      tileBounds.maximumHeight\n    );\n  } else if (defined(boundingVolume.region)) {\n    updateRegionHeights(\n      boundingVolume.region,\n      tileBounds.minimumHeight,\n      tileBounds.maximumHeight\n    );\n  }\n}\n\n/**\n * For a bounding region, update the minimum and maximum height. This\n * is typically used to tighten a bounding volume using the\n * <code>TILE_MINIMUM_HEIGHT</code> and <code>TILE_MAXIMUM_HEIGHT</code>\n * semantics. Heights are only updated if the respective\n * minimumHeight/maximumHeight parameter is defined.\n *\n * @param {Array} region A 6-element array describing the bounding region\n * @param {number} [minimumHeight] The new minimum height\n * @param {number} [maximumHeight] The new maximum height\n * @private\n */\nfunction updateRegionHeights(region, minimumHeight, maximumHeight) {\n  if (defined(minimumHeight)) {\n    region[4] = minimumHeight;\n  }\n\n  if (defined(maximumHeight)) {\n    region[5] = maximumHeight;\n  }\n}\n\n/**\n * For a bounding S2 cell, update the minimum and maximum height. This\n * is typically used to tighten a bounding volume using the\n * <code>TILE_MINIMUM_HEIGHT</code> and <code>TILE_MAXIMUM_HEIGHT</code>\n * semantics. Heights are only updated if the respective\n * minimumHeight/maximumHeight parameter is defined.\n *\n * @param {object} s2CellVolume An object describing the S2 cell\n * @param {number} [minimumHeight] The new minimum height\n * @param {number} [maximumHeight] The new maximum height\n * @private\n */\nfunction updateS2CellHeights(s2CellVolume, minimumHeight, maximumHeight) {\n  if (defined(minimumHeight)) {\n    s2CellVolume.minimumHeight = minimumHeight;\n  }\n\n  if (defined(maximumHeight)) {\n    s2CellVolume.maximumHeight = maximumHeight;\n  }\n}\n\n/**\n * Gets the tile's bounding volume, which may be specified via\n * metadata semantics such as TILE_BOUNDING_BOX or implicitly\n * derived from the implicit root tile's bounding volume.\n * <p>\n * Priority of bounding volume types:\n * <ol>\n * <li>Explicit min/max height\n *   <ol>\n *     <li>With explicit region</li>\n *     <li>With implicit S2</li>\n *     <li>With implicit region</li>\n *   </ol>\n * </li>\n * <li>Explicit box</li>\n * <li>Explicit region</li>\n * <li>Explicit sphere</li>\n * <li>Implicit S2</li>\n * <li>Implicit box</li>\n * <li>Implicit region</li>\n * </ol>\n * </p>\n *\n * @param {ImplicitTileset} implicitTileset The implicit tileset struct which holds the root bounding volume\n * @param {ImplicitTileCoordinates} implicitCoordinates The coordinates of the child tile\n * @param {number} childIndex The morton index of the child tile relative to its parent\n * @param {boolean} parentIsPlaceholderTile True if parentTile is a placeholder tile. This is true for the root of each subtree.\n * @param {Cesium3DTile} parentTile The parent of the new child tile\n * @param {object} [tileBounds] The tile bounds\n * @returns {object} An object containing the JSON for a bounding volume\n * @private\n */\nfunction getTileBoundingVolume(\n  implicitTileset,\n  implicitCoordinates,\n  childIndex,\n  parentIsPlaceholderTile,\n  parentTile,\n  tileBounds\n) {\n  let boundingVolume;\n\n  if (\n    !defined(tileBounds) ||\n    !defined(tileBounds.boundingVolume) ||\n    (!canUpdateHeights(tileBounds.boundingVolume, tileBounds) &&\n      canUpdateHeights(implicitTileset.boundingVolume, tileBounds))\n  ) {\n    boundingVolume = deriveBoundingVolume(\n      implicitTileset,\n      implicitCoordinates,\n      childIndex,\n      defaultValue(parentIsPlaceholderTile, false),\n      parentTile\n    );\n  } else {\n    boundingVolume = tileBounds.boundingVolume;\n  }\n\n  // The TILE_MINIMUM_HEIGHT and TILE_MAXIMUM_HEIGHT metadata semantics\n  // can be used to tighten the bounding volume\n  updateHeights(boundingVolume, tileBounds);\n\n  return boundingVolume;\n}\n\n/**\n * Gets the content bounding volume, which may be specified via\n * metadata semantics such as CONTENT_BOUNDING_BOX.\n * <p>\n * Priority of bounding volume types:\n * <ol>\n * <li>Explicit min/max height\n *   <ol>\n *     <li>With explicit region</li>\n *     <li>With tile bounding volume (S2 or region)</li>\n *   </ol>\n * </li>\n * <li>Explicit box</li>\n * <li>Explicit region</li>\n * <li>Explicit sphere</li>\n * <li>Tile bounding volume (when content.boundingVolume is undefined)</li>\n * </ol>\n * </p>\n *\n * @param {object} tileBoundingVolume An object containing the JSON for the tile's bounding volume\n * @param {object} [contentBounds] The content bounds\n * @returns {object|undefined} An object containing the JSON for a bounding volume, or <code>undefined</code> if there is no bounding volume\n * @private\n */\nfunction getContentBoundingVolume(tileBoundingVolume, contentBounds) {\n  // content bounding volumes can only be specified via\n  // metadata semantics such as CONTENT_BOUNDING_BOX\n  let contentBoundingVolume;\n  if (defined(contentBounds)) {\n    contentBoundingVolume = contentBounds.boundingVolume;\n  }\n\n  // The CONTENT_MINIMUM_HEIGHT and CONTENT_MAXIMUM_HEIGHT metadata semantics\n  // can be used to tighten the bounding volume\n  if (canUpdateHeights(contentBoundingVolume, contentBounds)) {\n    updateHeights(contentBoundingVolume, contentBounds);\n  } else if (canUpdateHeights(tileBoundingVolume, contentBounds)) {\n    contentBoundingVolume = clone(tileBoundingVolume, true);\n    updateHeights(contentBoundingVolume, contentBounds);\n  }\n\n  return contentBoundingVolume;\n}\n\n/**\n * Given the coordinates of a tile, derive its bounding volume from the root.\n *\n * @param {ImplicitTileset} implicitTileset The implicit tileset struct which holds the root bounding volume\n * @param {ImplicitTileCoordinates} implicitCoordinates The coordinates of the child tile\n * @param {number} childIndex The morton index of the child tile relative to its parent\n * @param {boolean} parentIsPlaceholderTile True if parentTile is a placeholder tile. This is true for the root of each subtree.\n * @param {Cesium3DTile} parentTile The parent of the new child tile\n * @returns {object} An object containing the JSON for a bounding volume\n * @private\n */\nfunction deriveBoundingVolume(\n  implicitTileset,\n  implicitCoordinates,\n  childIndex,\n  parentIsPlaceholderTile,\n  parentTile\n) {\n  const rootBoundingVolume = implicitTileset.boundingVolume;\n\n  if (hasExtension(rootBoundingVolume, \"3DTILES_bounding_volume_S2\")) {\n    return deriveBoundingVolumeS2(\n      parentIsPlaceholderTile,\n      parentTile,\n      childIndex,\n      implicitCoordinates.level,\n      implicitCoordinates.x,\n      implicitCoordinates.y,\n      implicitCoordinates.z\n    );\n  }\n\n  if (defined(rootBoundingVolume.region)) {\n    const childRegion = deriveBoundingRegion(\n      rootBoundingVolume.region,\n      implicitCoordinates.level,\n      implicitCoordinates.x,\n      implicitCoordinates.y,\n      implicitCoordinates.z\n    );\n\n    return {\n      region: childRegion,\n    };\n  }\n\n  const childBox = deriveBoundingBox(\n    rootBoundingVolume.box,\n    implicitCoordinates.level,\n    implicitCoordinates.x,\n    implicitCoordinates.y,\n    implicitCoordinates.z\n  );\n\n  return {\n    box: childBox,\n  };\n}\n\n/**\n * Derive a bounding volume for a descendant tile (child, grandchild, etc.),\n * assuming a quadtree or octree implicit tiling scheme. The (level, x, y, [z])\n * coordinates are given to select the descendant tile and compute its position\n * and dimensions.\n * <p>\n * If z is present, octree subdivision is used. Otherwise, quadtree subdivision\n * is used. Quadtrees are always divided at the midpoint of the the horizontal\n * dimensions, i.e. (x, y), leaving the z axis unchanged.\n * </p>\n *\n * @param {boolean} parentIsPlaceholderTile True if parentTile is a placeholder tile. This is true for the root of each subtree.\n * @param {Cesium3DTile} parentTile The parent of the new child tile\n * @param {number} childIndex The morton index of the child tile relative to its parent\n * @param {number} level The level of the descendant tile relative to the root implicit tile\n * @param {number} x The x coordinate of the descendant tile\n * @param {number} y The y coordinate of the descendant tile\n * @param {number} [z] The z coordinate of the descendant tile (octree only)\n * @returns {object} An object with the 3DTILES_bounding_volume_S2 extension.\n * @private\n */\nfunction deriveBoundingVolumeS2(\n  parentIsPlaceholderTile,\n  parentTile,\n  childIndex,\n  level,\n  x,\n  y,\n  z\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.bool(\"parentIsPlaceholderTile\", parentIsPlaceholderTile);\n  Check.typeOf.object(\"parentTile\", parentTile);\n  Check.typeOf.number(\"childIndex\", childIndex);\n  Check.typeOf.number(\"level\", level);\n  Check.typeOf.number(\"x\", x);\n  Check.typeOf.number(\"y\", y);\n  if (defined(z)) {\n    Check.typeOf.number(\"z\", z);\n  }\n  //>>includeEnd('debug');\n\n  const boundingVolumeS2 = parentTile._boundingVolume;\n\n  // Handle the placeholder tile case, where we just duplicate the placeholder's bounding volume.\n  if (parentIsPlaceholderTile) {\n    return {\n      extensions: {\n        \"3DTILES_bounding_volume_S2\": {\n          token: S2Cell.getTokenFromId(boundingVolumeS2.s2Cell._cellId),\n          minimumHeight: boundingVolumeS2.minimumHeight,\n          maximumHeight: boundingVolumeS2.maximumHeight,\n        },\n      },\n    };\n  }\n\n  // Extract the first 3 face bits from the 64-bit S2 cell ID.\n  // eslint-disable-next-line no-undef\n  const face = Number(parentTile._boundingVolume.s2Cell._cellId >> BigInt(61));\n  // The Hilbert curve is rotated for the \"odd\" faces on the S2 Earthcube.\n  // See http://s2geometry.io/devguide/img/s2cell_global.jpg\n  const position =\n    face % 2 === 0\n      ? HilbertOrder.encode2D(level, x, y)\n      : HilbertOrder.encode2D(level, y, x);\n  // eslint-disable-next-line no-undef\n  const cell = S2Cell.fromFacePositionLevel(face, BigInt(position), level);\n\n  let minHeight, maxHeight;\n  if (defined(z)) {\n    const midpointHeight =\n      (boundingVolumeS2.maximumHeight + boundingVolumeS2.minimumHeight) / 2;\n    minHeight =\n      childIndex < 4 ? boundingVolumeS2.minimumHeight : midpointHeight;\n    maxHeight =\n      childIndex < 4 ? midpointHeight : boundingVolumeS2.maximumHeight;\n  } else {\n    minHeight = boundingVolumeS2.minimumHeight;\n    maxHeight = boundingVolumeS2.maximumHeight;\n  }\n\n  return {\n    extensions: {\n      \"3DTILES_bounding_volume_S2\": {\n        token: S2Cell.getTokenFromId(cell._cellId),\n        minimumHeight: minHeight,\n        maximumHeight: maxHeight,\n      },\n    },\n  };\n}\n\nconst scratchScaleFactors = new Cartesian3();\nconst scratchRootCenter = new Cartesian3();\nconst scratchCenter = new Cartesian3();\nconst scratchHalfAxes = new Matrix3();\n/**\n * Derive a bounding volume for a descendant tile (child, grandchild, etc.),\n * assuming a quadtree or octree implicit tiling scheme. The (level, x, y, [z])\n * coordinates are given to select the descendant tile and compute its position\n * and dimensions.\n * <p>\n * If z is present, octree subdivision is used. Otherwise, quadtree subdivision\n * is used. Quadtrees are always divided at the midpoint of the the horizontal\n * dimensions, i.e. (x, y), leaving the z axis unchanged.\n * </p>\n * <p>\n * This computes the child volume directly from the root bounding volume rather\n * than recursively subdividing to minimize floating point error.\n * </p>\n *\n * @param {number[]} rootBox An array of 12 numbers representing the bounding box of the root tile\n * @param {number} level The level of the descendant tile relative to the root implicit tile\n * @param {number} x The x coordinate of the descendant tile\n * @param {number} y The y coordinate of the descendant tile\n * @param {number} [z] The z coordinate of the descendant tile (octree only)\n * @returns {number[]} An array of 12 numbers representing the bounding box of the descendant tile.\n * @private\n */\nfunction deriveBoundingBox(rootBox, level, x, y, z) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rootBox\", rootBox);\n  Check.typeOf.number(\"level\", level);\n  Check.typeOf.number(\"x\", x);\n  Check.typeOf.number(\"y\", y);\n  if (defined(z)) {\n    Check.typeOf.number(\"z\", z);\n  }\n  //>>includeEnd('debug');\n\n  if (level === 0) {\n    return rootBox;\n  }\n\n  const rootCenter = Cartesian3.unpack(rootBox, 0, scratchRootCenter);\n  const rootHalfAxes = Matrix3.unpack(rootBox, 3, scratchHalfAxes);\n\n  const tileScale = Math.pow(2, -level);\n  const modelSpaceX = -1 + (2 * x + 1) * tileScale;\n  const modelSpaceY = -1 + (2 * y + 1) * tileScale;\n\n  let modelSpaceZ = 0;\n  const scaleFactors = Cartesian3.fromElements(\n    tileScale,\n    tileScale,\n    1,\n    scratchScaleFactors\n  );\n\n  if (defined(z)) {\n    modelSpaceZ = -1 + (2 * z + 1) * tileScale;\n    scaleFactors.z = tileScale;\n  }\n\n  let center = Cartesian3.fromElements(\n    modelSpaceX,\n    modelSpaceY,\n    modelSpaceZ,\n    scratchCenter\n  );\n  center = Matrix3.multiplyByVector(rootHalfAxes, center, scratchCenter);\n  center = Cartesian3.add(center, rootCenter, scratchCenter);\n\n  let halfAxes = Matrix3.clone(rootHalfAxes);\n  halfAxes = Matrix3.multiplyByScale(halfAxes, scaleFactors, halfAxes);\n\n  const childBox = new Array(12);\n  Cartesian3.pack(center, childBox);\n  Matrix3.pack(halfAxes, childBox, 3);\n  return childBox;\n}\n\nconst scratchRectangle = new Rectangle();\n/**\n * Derive a bounding volume for a descendant tile (child, grandchild, etc.),\n * assuming a quadtree or octree implicit tiling scheme. The (level, x, y, [z])\n * coordinates are given to select the descendant tile and compute its position\n * and dimensions.\n * <p>\n * If z is present, octree subdivision is used. Otherwise, quadtree subdivision\n * is used. Quadtrees are always divided at the midpoint of the the horizontal\n * dimensions, i.e. (mid_longitude, mid_latitude), leaving the height values\n * unchanged.\n * </p>\n * <p>\n * This computes the child volume directly from the root bounding volume rather\n * than recursively subdividing to minimize floating point error.\n * </p>\n * @param {number[]} rootRegion An array of 6 numbers representing the root implicit tile\n * @param {number} level The level of the descendant tile relative to the root implicit tile\n * @param {number} x The x coordinate of the descendant tile\n * @param {number} y The x coordinate of the descendant tile\n * @param {number} [z] The z coordinate of the descendant tile (octree only)\n * @returns {number[]} An array of 6 numbers representing the bounding region of the descendant tile\n * @private\n */\nfunction deriveBoundingRegion(rootRegion, level, x, y, z) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rootRegion\", rootRegion);\n  Check.typeOf.number(\"level\", level);\n  Check.typeOf.number(\"x\", x);\n  Check.typeOf.number(\"y\", y);\n  if (defined(z)) {\n    Check.typeOf.number(\"z\", z);\n  }\n  //>>includeEnd('debug');\n\n  if (level === 0) {\n    return rootRegion.slice();\n  }\n\n  const rectangle = Rectangle.unpack(rootRegion, 0, scratchRectangle);\n  const rootMinimumHeight = rootRegion[4];\n  const rootMaximumHeight = rootRegion[5];\n  const tileScale = Math.pow(2, -level);\n\n  const childWidth = tileScale * rectangle.width;\n  const west = CesiumMath.negativePiToPi(rectangle.west + x * childWidth);\n  const east = CesiumMath.negativePiToPi(west + childWidth);\n\n  const childHeight = tileScale * rectangle.height;\n  const south = CesiumMath.negativePiToPi(rectangle.south + y * childHeight);\n  const north = CesiumMath.negativePiToPi(south + childHeight);\n\n  // Height is only subdivided for octrees; It remains constant for quadtrees.\n  let minimumHeight = rootMinimumHeight;\n  let maximumHeight = rootMaximumHeight;\n  if (defined(z)) {\n    const childThickness = tileScale * (rootMaximumHeight - rootMinimumHeight);\n    minimumHeight += z * childThickness;\n    maximumHeight = minimumHeight + childThickness;\n  }\n\n  return [west, south, east, north, minimumHeight, maximumHeight];\n}\n\n/**\n * Create a placeholder 3D Tile whose content will be an Implicit3DTileContent\n * for lazy evaluation of a child subtree.\n *\n * @param {Implicit3DTileContent} content The content object.\n * @param {Cesium3DTile} parentTile The parent of the new child subtree.\n * @param {number} childIndex The morton index of the child tile relative to its parent\n * @returns {Cesium3DTile} The new placeholder tile\n * @private\n */\nfunction makePlaceholderChildSubtree(content, parentTile, childIndex) {\n  const implicitTileset = content._implicitTileset;\n  const implicitCoordinates = parentTile.implicitCoordinates.getChildCoordinates(\n    childIndex\n  );\n\n  const childBoundingVolume = deriveBoundingVolume(\n    implicitTileset,\n    implicitCoordinates,\n    childIndex,\n    false,\n    parentTile\n  );\n\n  // Ignore tile metadata when computing geometric error for the placeholder tile\n  // since the child subtree's metadata hasn't been loaded yet.\n  // The actual geometric error will be computed in deriveChildTile.\n  const childGeometricError = getGeometricError(\n    undefined,\n    implicitTileset,\n    implicitCoordinates\n  );\n\n  const childContentUri = implicitTileset.subtreeUriTemplate.getDerivedResource(\n    {\n      templateValues: implicitCoordinates.getTemplateValues(),\n    }\n  ).url;\n  const tileJson = {\n    boundingVolume: childBoundingVolume,\n    geometricError: childGeometricError,\n    refine: implicitTileset.refine,\n    contents: [\n      {\n        uri: childContentUri,\n      },\n    ],\n  };\n\n  const tile = makeTile(\n    content,\n    implicitTileset.baseResource,\n    tileJson,\n    parentTile\n  );\n  tile.implicitTileset = implicitTileset;\n  tile.implicitCoordinates = implicitCoordinates;\n  return tile;\n}\n\n/**\n * Make a {@link Cesium3DTile}. This uses the content's tile's constructor instead\n * of importing Cesium3DTile. This is to avoid a circular dependency between\n * this file and Cesium3DTile.js\n * @param {Implicit3DTileContent} content The implicit content\n * @param {Resource} baseResource The base resource for the tileset\n * @param {object} tileJson The JSON header for the tile\n * @param {Cesium3DTile} parentTile The parent of the new tile\n * @returns {Cesium3DTile} The newly created tile.\n * @private\n */\nfunction makeTile(content, baseResource, tileJson, parentTile) {\n  const Cesium3DTile = content._tile.constructor;\n  return new Cesium3DTile(content._tileset, baseResource, tileJson, parentTile);\n}\n\n/**\n * Part of the {@link Cesium3DTileContent} interface.  <code>Implicit3DTileContent</code>\n * always returns <code>false</code> since a tile of this type does not have any features.\n * @private\n */\nImplicit3DTileContent.prototype.hasProperty = function (batchId, name) {\n  return false;\n};\n\n/**\n * Part of the {@link Cesium3DTileContent} interface.  <code>Implicit3DTileContent</code>\n * always returns <code>undefined</code> since a tile of this type does not have any features.\n * @private\n */\nImplicit3DTileContent.prototype.getFeature = function (batchId) {\n  return undefined;\n};\n\nImplicit3DTileContent.prototype.applyDebugSettings = function (\n  enabled,\n  color\n) {};\n\nImplicit3DTileContent.prototype.applyStyle = function (style) {};\n\nImplicit3DTileContent.prototype.update = function (tileset, frameState) {};\n\nImplicit3DTileContent.prototype.isDestroyed = function () {\n  return false;\n};\n\nImplicit3DTileContent.prototype.destroy = function () {\n  this._implicitSubtree =\n    this._implicitSubtree && this._implicitSubtree.destroy();\n  return destroyObject(this);\n};\n\n// Exposed for testing\nImplicit3DTileContent._deriveBoundingBox = deriveBoundingBox;\nImplicit3DTileContent._deriveBoundingRegion = deriveBoundingRegion;\nImplicit3DTileContent._deriveBoundingVolumeS2 = deriveBoundingVolumeS2;\n\nexport default Implicit3DTileContent;\n", "/**\n * Determines if and how a glTF animation is looped.\n *\n * @enum {number}\n *\n * @see ModelAnimationCollection#add\n */\nconst ModelAnimationLoop = {\n  /**\n   * Play the animation once; do not loop it.\n   *\n   * @type {number}\n   * @constant\n   */\n  NONE: 0,\n\n  /**\n   * Loop the animation playing it from the start immediately after it stops.\n   *\n   * @type {number}\n   * @constant\n   */\n  REPEAT: 1,\n\n  /**\n   * Loop the animation.  First, playing it forward, then in reverse, then forward, and so on.\n   *\n   * @type {number}\n   * @constant\n   */\n  MIRRORED_REPEAT: 2,\n};\nexport default Object.freeze(ModelAnimationLoop);\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * A Plane in Hessian Normal form to be used with {@link ClippingPlaneCollection}.\n * Compatible with mathematics functions in {@link Plane}\n *\n * @alias ClippingPlane\n * @constructor\n *\n * @param {Cartesian3} normal The plane's normal (normalized).\n * @param {number} distance The shortest distance from the origin to the plane.  The sign of\n * <code>distance</code> determines which side of the plane the origin\n * is on.  If <code>distance</code> is positive, the origin is in the half-space\n * in the direction of the normal; if negative, the origin is in the half-space\n * opposite to the normal; if zero, the plane passes through the origin.\n */\nfunction ClippingPlane(normal, distance) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"normal\", normal);\n  Check.typeOf.number(\"distance\", distance);\n  //>>includeEnd('debug');\n\n  this._distance = distance;\n  this._normal = new UpdateChangedCartesian3(normal, this);\n  this.onChangeCallback = undefined;\n  this.index = -1; // to be set by ClippingPlaneCollection\n}\n\nObject.defineProperties(ClippingPlane.prototype, {\n  /**\n   * The shortest distance from the origin to the plane.  The sign of\n   * <code>distance</code> determines which side of the plane the origin\n   * is on.  If <code>distance</code> is positive, the origin is in the half-space\n   * in the direction of the normal; if negative, the origin is in the half-space\n   * opposite to the normal; if zero, the plane passes through the origin.\n   *\n   * @type {number}\n   * @memberof ClippingPlane.prototype\n   */\n  distance: {\n    get: function () {\n      return this._distance;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number(\"value\", value);\n      //>>includeEnd('debug');\n      if (defined(this.onChangeCallback) && value !== this._distance) {\n        this.onChangeCallback(this.index);\n      }\n      this._distance = value;\n    },\n  },\n  /**\n   * The plane's normal.\n   *\n   * @type {Cartesian3}\n   * @memberof ClippingPlane.prototype\n   */\n  normal: {\n    get: function () {\n      return this._normal;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.object(\"value\", value);\n      //>>includeEnd('debug');\n      if (\n        defined(this.onChangeCallback) &&\n        !Cartesian3.equals(this._normal._cartesian3, value)\n      ) {\n        this.onChangeCallback(this.index);\n      }\n      // Set without firing callback again\n      Cartesian3.clone(value, this._normal._cartesian3);\n    },\n  },\n});\n\n/**\n * Create a ClippingPlane from a Plane object.\n *\n * @param {Plane} plane The plane containing parameters to copy\n * @param {ClippingPlane} [result] The object on which to store the result\n * @returns {ClippingPlane} The ClippingPlane generated from the plane's parameters.\n */\nClippingPlane.fromPlane = function (plane, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"plane\", plane);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new ClippingPlane(plane.normal, plane.distance);\n  } else {\n    result.normal = plane.normal;\n    result.distance = plane.distance;\n  }\n  return result;\n};\n\n/**\n * Clones the ClippingPlane without setting its ownership.\n * @param {ClippingPlane} clippingPlane The ClippingPlane to be cloned\n * @param {ClippingPlane} [result] The object on which to store the cloned parameters.\n * @returns {ClippingPlane} a clone of the input ClippingPlane\n */\nClippingPlane.clone = function (clippingPlane, result) {\n  if (!defined(result)) {\n    return new ClippingPlane(clippingPlane.normal, clippingPlane.distance);\n  }\n  result.normal = clippingPlane.normal;\n  result.distance = clippingPlane.distance;\n  return result;\n};\n\n/**\n * Wrapper on Cartesian3 that allows detection of Plane changes from \"members of members,\" for example:\n *\n * const clippingPlane = new ClippingPlane(...);\n * clippingPlane.normal.z = -1.0;\n *\n * @private\n */\nfunction UpdateChangedCartesian3(normal, clippingPlane) {\n  this._clippingPlane = clippingPlane;\n  this._cartesian3 = Cartesian3.clone(normal);\n}\n\nObject.defineProperties(UpdateChangedCartesian3.prototype, {\n  x: {\n    get: function () {\n      return this._cartesian3.x;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number(\"value\", value);\n      //>>includeEnd('debug');\n      if (\n        defined(this._clippingPlane.onChangeCallback) &&\n        value !== this._cartesian3.x\n      ) {\n        this._clippingPlane.onChangeCallback(this._clippingPlane.index);\n      }\n      this._cartesian3.x = value;\n    },\n  },\n  y: {\n    get: function () {\n      return this._cartesian3.y;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number(\"value\", value);\n      //>>includeEnd('debug');\n      if (\n        defined(this._clippingPlane.onChangeCallback) &&\n        value !== this._cartesian3.y\n      ) {\n        this._clippingPlane.onChangeCallback(this._clippingPlane.index);\n      }\n      this._cartesian3.y = value;\n    },\n  },\n  z: {\n    get: function () {\n      return this._cartesian3.z;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number(\"value\", value);\n      //>>includeEnd('debug');\n      if (\n        defined(this._clippingPlane.onChangeCallback) &&\n        value !== this._cartesian3.z\n      ) {\n        this._clippingPlane.onChangeCallback(this._clippingPlane.index);\n      }\n      this._cartesian3.z = value;\n    },\n  },\n});\nexport default ClippingPlane;\n", "import AttributeCompression from \"../Core/AttributeCompression.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Plane from \"../Core/Plane.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport ClippingPlane from \"./ClippingPlane.js\";\n\n/**\n * Specifies a set of clipping planes. Clipping planes selectively disable rendering in a region on the\n * outside of the specified list of {@link ClippingPlane} objects for a single gltf model, 3D Tileset, or the globe.\n * <p>\n * In general the clipping planes' coordinates are relative to the object they're attached to, so a plane with distance set to 0 will clip\n * through the center of the object.\n * </p>\n * <p>\n * For 3D Tiles, the root tile's transform is used to position the clipping planes. If a transform is not defined, the root tile's {@link Cesium3DTile#boundingSphere} is used instead.\n * </p>\n *\n * @alias ClippingPlaneCollection\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {ClippingPlane[]} [options.planes=[]] An array of {@link ClippingPlane} objects used to selectively disable rendering on the outside of each plane.\n * @param {boolean} [options.enabled=true] Determines whether the clipping planes are active.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix specifying an additional transform relative to the clipping planes original coordinate system.\n * @param {boolean} [options.unionClippingRegions=false] If true, a region will be clipped if it is on the outside of any plane in the collection. Otherwise, a region will only be clipped if it is on the outside of every plane.\n * @param {Color} [options.edgeColor=Color.WHITE] The color applied to highlight the edge along which an object is clipped.\n * @param {number} [options.edgeWidth=0.0] The width, in pixels, of the highlight applied to the edge along which an object is clipped.\n *\n * @demo {@link https://sandcastle.cesium.com/?src=3D%20Tiles%20Clipping%20Planes.html|Clipping 3D Tiles and glTF models.}\n * @demo {@link https://sandcastle.cesium.com/?src=Terrain%20Clipping%20Planes.html|Clipping the Globe.}\n *\n * @example\n * // This clipping plane's distance is positive, which means its normal\n * // is facing the origin. This will clip everything that is behind\n * // the plane, which is anything with y coordinate < -5.\n * const clippingPlanes = new Cesium.ClippingPlaneCollection({\n *     planes : [\n *         new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 5.0)\n *     ],\n * });\n * // Create an entity and attach the ClippingPlaneCollection to the model.\n * const entity = viewer.entities.add({\n *     position : Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 10000),\n *     model : {\n *         uri : 'model.gltf',\n *         minimumPixelSize : 128,\n *         maximumScale : 20000,\n *         clippingPlanes : clippingPlanes\n *     }\n * });\n * viewer.zoomTo(entity);\n */\nfunction ClippingPlaneCollection(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._planes = [];\n\n  // Do partial texture updates if just one plane is dirty.\n  // If many planes are dirty, refresh the entire texture.\n  this._dirtyIndex = -1;\n  this._multipleDirtyPlanes = false;\n\n  this._enabled = defaultValue(options.enabled, true);\n\n  /**\n   * The 4x4 transformation matrix specifying an additional transform relative to the clipping planes\n   * original coordinate system.\n   *\n   * @type {Matrix4}\n   * @default Matrix4.IDENTITY\n   */\n  this.modelMatrix = Matrix4.clone(\n    defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n  );\n\n  /**\n   * The color applied to highlight the edge along which an object is clipped.\n   *\n   * @type {Color}\n   * @default Color.WHITE\n   */\n  this.edgeColor = Color.clone(defaultValue(options.edgeColor, Color.WHITE));\n\n  /**\n   * The width, in pixels, of the highlight applied to the edge along which an object is clipped.\n   *\n   * @type {number}\n   * @default 0.0\n   */\n  this.edgeWidth = defaultValue(options.edgeWidth, 0.0);\n\n  /**\n   * An event triggered when a new clipping plane is added to the collection.  Event handlers\n   * are passed the new plane and the index at which it was added.\n   * @type {Event}\n   * @default Event()\n   */\n  this.planeAdded = new Event();\n\n  /**\n   * An event triggered when a new clipping plane is removed from the collection.  Event handlers\n   * are passed the new plane and the index from which it was removed.\n   * @type {Event}\n   * @default Event()\n   */\n  this.planeRemoved = new Event();\n\n  // If this ClippingPlaneCollection has an owner, only its owner should update or destroy it.\n  // This is because in a Cesium3DTileset multiple models may reference the tileset's ClippingPlaneCollection.\n  this._owner = undefined;\n\n  const unionClippingRegions = defaultValue(\n    options.unionClippingRegions,\n    false\n  );\n  this._unionClippingRegions = unionClippingRegions;\n  this._testIntersection = unionClippingRegions\n    ? unionIntersectFunction\n    : defaultIntersectFunction;\n\n  this._uint8View = undefined;\n  this._float32View = undefined;\n\n  this._clippingPlanesTexture = undefined;\n\n  // Add each ClippingPlane object.\n  const planes = options.planes;\n  if (defined(planes)) {\n    const planesLength = planes.length;\n    for (let i = 0; i < planesLength; ++i) {\n      this.add(planes[i]);\n    }\n  }\n}\n\nfunction unionIntersectFunction(value) {\n  return value === Intersect.OUTSIDE;\n}\n\nfunction defaultIntersectFunction(value) {\n  return value === Intersect.INSIDE;\n}\n\nObject.defineProperties(ClippingPlaneCollection.prototype, {\n  /**\n   * Returns the number of planes in this collection.  This is commonly used with\n   * {@link ClippingPlaneCollection#get} to iterate over all the planes\n   * in the collection.\n   *\n   * @memberof ClippingPlaneCollection.prototype\n   * @type {number}\n   * @readonly\n   */\n  length: {\n    get: function () {\n      return this._planes.length;\n    },\n  },\n\n  /**\n   * If true, a region will be clipped if it is on the outside of any plane in the\n   * collection. Otherwise, a region will only be clipped if it is on the\n   * outside of every plane.\n   *\n   * @memberof ClippingPlaneCollection.prototype\n   * @type {boolean}\n   * @default false\n   */\n  unionClippingRegions: {\n    get: function () {\n      return this._unionClippingRegions;\n    },\n    set: function (value) {\n      if (this._unionClippingRegions === value) {\n        return;\n      }\n      this._unionClippingRegions = value;\n      this._testIntersection = value\n        ? unionIntersectFunction\n        : defaultIntersectFunction;\n    },\n  },\n\n  /**\n   * If true, clipping will be enabled.\n   *\n   * @memberof ClippingPlaneCollection.prototype\n   * @type {boolean}\n   * @default true\n   */\n  enabled: {\n    get: function () {\n      return this._enabled;\n    },\n    set: function (value) {\n      if (this._enabled === value) {\n        return;\n      }\n      this._enabled = value;\n    },\n  },\n\n  /**\n   * Returns a texture containing packed, untransformed clipping planes.\n   *\n   * @memberof ClippingPlaneCollection.prototype\n   * @type {Texture}\n   * @readonly\n   * @private\n   */\n  texture: {\n    get: function () {\n      return this._clippingPlanesTexture;\n    },\n  },\n\n  /**\n   * A reference to the ClippingPlaneCollection's owner, if any.\n   *\n   * @memberof ClippingPlaneCollection.prototype\n   * @readonly\n   * @private\n   */\n  owner: {\n    get: function () {\n      return this._owner;\n    },\n  },\n\n  /**\n   * Returns a Number encapsulating the state for this ClippingPlaneCollection.\n   *\n   * Clipping mode is encoded in the sign of the number, which is just the plane count.\n   * If this value changes, then shader regeneration is necessary.\n   *\n   * @memberof ClippingPlaneCollection.prototype\n   * @returns {number} A Number that describes the ClippingPlaneCollection's state.\n   * @readonly\n   * @private\n   */\n  clippingPlanesState: {\n    get: function () {\n      return this._unionClippingRegions\n        ? this._planes.length\n        : -this._planes.length;\n    },\n  },\n});\n\nfunction setIndexDirty(collection, index) {\n  // If there's already a different _dirtyIndex set, more than one plane has changed since update.\n  // Entire texture must be reloaded\n  collection._multipleDirtyPlanes =\n    collection._multipleDirtyPlanes ||\n    (collection._dirtyIndex !== -1 && collection._dirtyIndex !== index);\n  collection._dirtyIndex = index;\n}\n\n/**\n * Adds the specified {@link ClippingPlane} to the collection to be used to selectively disable rendering\n * on the outside of each plane. Use {@link ClippingPlaneCollection#unionClippingRegions} to modify\n * how modify the clipping behavior of multiple planes.\n *\n * @param {ClippingPlane} plane The ClippingPlane to add to the collection.\n *\n * @see ClippingPlaneCollection#unionClippingRegions\n * @see ClippingPlaneCollection#remove\n * @see ClippingPlaneCollection#removeAll\n */\nClippingPlaneCollection.prototype.add = function (plane) {\n  const newPlaneIndex = this._planes.length;\n\n  const that = this;\n  plane.onChangeCallback = function (index) {\n    setIndexDirty(that, index);\n  };\n  plane.index = newPlaneIndex;\n\n  setIndexDirty(this, newPlaneIndex);\n  this._planes.push(plane);\n  this.planeAdded.raiseEvent(plane, newPlaneIndex);\n};\n\n/**\n * Returns the plane in the collection at the specified index.  Indices are zero-based\n * and increase as planes are added.  Removing a plane shifts all planes after\n * it to the left, changing their indices.  This function is commonly used with\n * {@link ClippingPlaneCollection#length} to iterate over all the planes\n * in the collection.\n *\n * @param {number} index The zero-based index of the plane.\n * @returns {ClippingPlane} The ClippingPlane at the specified index.\n *\n * @see ClippingPlaneCollection#length\n */\nClippingPlaneCollection.prototype.get = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"index\", index);\n  //>>includeEnd('debug');\n\n  return this._planes[index];\n};\n\nfunction indexOf(planes, plane) {\n  const length = planes.length;\n  for (let i = 0; i < length; ++i) {\n    if (Plane.equals(planes[i], plane)) {\n      return i;\n    }\n  }\n\n  return -1;\n}\n\n/**\n * Checks whether this collection contains a ClippingPlane equal to the given ClippingPlane.\n *\n * @param {ClippingPlane} [clippingPlane] The ClippingPlane to check for.\n * @returns {boolean} true if this collection contains the ClippingPlane, false otherwise.\n *\n * @see ClippingPlaneCollection#get\n */\nClippingPlaneCollection.prototype.contains = function (clippingPlane) {\n  return indexOf(this._planes, clippingPlane) !== -1;\n};\n\n/**\n * Removes the first occurrence of the given ClippingPlane from the collection.\n *\n * @param {ClippingPlane} clippingPlane\n * @returns {boolean} <code>true</code> if the plane was removed; <code>false</code> if the plane was not found in the collection.\n *\n * @see ClippingPlaneCollection#add\n * @see ClippingPlaneCollection#contains\n * @see ClippingPlaneCollection#removeAll\n */\nClippingPlaneCollection.prototype.remove = function (clippingPlane) {\n  const planes = this._planes;\n  const index = indexOf(planes, clippingPlane);\n\n  if (index === -1) {\n    return false;\n  }\n\n  // Unlink this ClippingPlaneCollection from the ClippingPlane\n  if (clippingPlane instanceof ClippingPlane) {\n    clippingPlane.onChangeCallback = undefined;\n    clippingPlane.index = -1;\n  }\n\n  // Shift and update indices\n  const length = planes.length - 1;\n  for (let i = index; i < length; ++i) {\n    const planeToKeep = planes[i + 1];\n    planes[i] = planeToKeep;\n    if (planeToKeep instanceof ClippingPlane) {\n      planeToKeep.index = i;\n    }\n  }\n\n  // Indicate planes texture is dirty\n  this._multipleDirtyPlanes = true;\n  planes.length = length;\n\n  this.planeRemoved.raiseEvent(clippingPlane, index);\n\n  return true;\n};\n\n/**\n * Removes all planes from the collection.\n *\n * @see ClippingPlaneCollection#add\n * @see ClippingPlaneCollection#remove\n */\nClippingPlaneCollection.prototype.removeAll = function () {\n  // Dereference this ClippingPlaneCollection from all ClippingPlanes\n  const planes = this._planes;\n  const planesCount = planes.length;\n  for (let i = 0; i < planesCount; ++i) {\n    const plane = planes[i];\n    if (plane instanceof ClippingPlane) {\n      plane.onChangeCallback = undefined;\n      plane.index = -1;\n    }\n    this.planeRemoved.raiseEvent(plane, i);\n  }\n  this._multipleDirtyPlanes = true;\n  this._planes = [];\n};\n\nconst distanceEncodeScratch = new Cartesian4();\nconst oct32EncodeScratch = new Cartesian4();\nfunction packPlanesAsUint8(clippingPlaneCollection, startIndex, endIndex) {\n  const uint8View = clippingPlaneCollection._uint8View;\n  const planes = clippingPlaneCollection._planes;\n  let byteIndex = 0;\n  for (let i = startIndex; i < endIndex; ++i) {\n    const plane = planes[i];\n\n    const oct32Normal = AttributeCompression.octEncodeToCartesian4(\n      plane.normal,\n      oct32EncodeScratch\n    );\n    uint8View[byteIndex] = oct32Normal.x;\n    uint8View[byteIndex + 1] = oct32Normal.y;\n    uint8View[byteIndex + 2] = oct32Normal.z;\n    uint8View[byteIndex + 3] = oct32Normal.w;\n\n    const encodedDistance = Cartesian4.packFloat(\n      plane.distance,\n      distanceEncodeScratch\n    );\n    uint8View[byteIndex + 4] = encodedDistance.x;\n    uint8View[byteIndex + 5] = encodedDistance.y;\n    uint8View[byteIndex + 6] = encodedDistance.z;\n    uint8View[byteIndex + 7] = encodedDistance.w;\n\n    byteIndex += 8;\n  }\n}\n\n// Pack starting at the beginning of the buffer to allow partial update\nfunction packPlanesAsFloats(clippingPlaneCollection, startIndex, endIndex) {\n  const float32View = clippingPlaneCollection._float32View;\n  const planes = clippingPlaneCollection._planes;\n\n  let floatIndex = 0;\n  for (let i = startIndex; i < endIndex; ++i) {\n    const plane = planes[i];\n    const normal = plane.normal;\n\n    float32View[floatIndex] = normal.x;\n    float32View[floatIndex + 1] = normal.y;\n    float32View[floatIndex + 2] = normal.z;\n    float32View[floatIndex + 3] = plane.distance;\n\n    floatIndex += 4; // each plane is 4 floats\n  }\n}\n\nfunction computeTextureResolution(pixelsNeeded, result) {\n  const maxSize = ContextLimits.maximumTextureSize;\n  result.x = Math.min(pixelsNeeded, maxSize);\n  result.y = Math.ceil(pixelsNeeded / result.x);\n  return result;\n}\n\nconst textureResolutionScratch = new Cartesian2();\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * build the resources for clipping planes.\n * <p>\n * Do not call this function directly.\n * </p>\n */\nClippingPlaneCollection.prototype.update = function (frameState) {\n  let clippingPlanesTexture = this._clippingPlanesTexture;\n  const context = frameState.context;\n  const useFloatTexture = ClippingPlaneCollection.useFloatTexture(context);\n\n  // Compute texture requirements for current planes\n  // In RGBA FLOAT, A plane is 4 floats packed to a RGBA.\n  // In RGBA UNSIGNED_BYTE, A plane is a float in [0, 1) packed to RGBA and an Oct32 quantized normal,\n  // so 8 bits or 2 pixels in RGBA.\n  const pixelsNeeded = useFloatTexture ? this.length : this.length * 2;\n\n  if (defined(clippingPlanesTexture)) {\n    const currentPixelCount =\n      clippingPlanesTexture.width * clippingPlanesTexture.height;\n    // Recreate the texture to double current requirement if it isn't big enough or is 4 times larger than it needs to be.\n    // Optimization note: this isn't exactly the classic resizeable array algorithm\n    // * not necessarily checking for resize after each add/remove operation\n    // * random-access deletes instead of just pops\n    // * alloc ops likely more expensive than demonstrable via big-O analysis\n    if (\n      currentPixelCount < pixelsNeeded ||\n      pixelsNeeded < 0.25 * currentPixelCount\n    ) {\n      clippingPlanesTexture.destroy();\n      clippingPlanesTexture = undefined;\n      this._clippingPlanesTexture = undefined;\n    }\n  }\n\n  // If there are no clipping planes, there's nothing to update.\n  if (this.length === 0) {\n    return;\n  }\n\n  if (!defined(clippingPlanesTexture)) {\n    const requiredResolution = computeTextureResolution(\n      pixelsNeeded,\n      textureResolutionScratch\n    );\n    // Allocate twice as much space as needed to avoid frequent texture reallocation.\n    // Allocate in the Y direction, since texture may be as wide as context texture support.\n    requiredResolution.y *= 2;\n\n    if (useFloatTexture) {\n      clippingPlanesTexture = new Texture({\n        context: context,\n        width: requiredResolution.x,\n        height: requiredResolution.y,\n        pixelFormat: PixelFormat.RGBA,\n        pixelDatatype: PixelDatatype.FLOAT,\n        sampler: Sampler.NEAREST,\n        flipY: false,\n      });\n      this._float32View = new Float32Array(\n        requiredResolution.x * requiredResolution.y * 4\n      );\n    } else {\n      clippingPlanesTexture = new Texture({\n        context: context,\n        width: requiredResolution.x,\n        height: requiredResolution.y,\n        pixelFormat: PixelFormat.RGBA,\n        pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n        sampler: Sampler.NEAREST,\n        flipY: false,\n      });\n      this._uint8View = new Uint8Array(\n        requiredResolution.x * requiredResolution.y * 4\n      );\n    }\n\n    this._clippingPlanesTexture = clippingPlanesTexture;\n    this._multipleDirtyPlanes = true;\n  }\n\n  const dirtyIndex = this._dirtyIndex;\n  if (!this._multipleDirtyPlanes && dirtyIndex === -1) {\n    return;\n  }\n  if (!this._multipleDirtyPlanes) {\n    // partial updates possible\n    let offsetX = 0;\n    let offsetY = 0;\n    if (useFloatTexture) {\n      offsetY = Math.floor(dirtyIndex / clippingPlanesTexture.width);\n      offsetX = Math.floor(dirtyIndex - offsetY * clippingPlanesTexture.width);\n\n      packPlanesAsFloats(this, dirtyIndex, dirtyIndex + 1);\n      clippingPlanesTexture.copyFrom({\n        source: {\n          width: 1,\n          height: 1,\n          arrayBufferView: this._float32View,\n        },\n        xOffset: offsetX,\n        yOffset: offsetY,\n      });\n    } else {\n      offsetY = Math.floor((dirtyIndex * 2) / clippingPlanesTexture.width);\n      offsetX = Math.floor(\n        dirtyIndex * 2 - offsetY * clippingPlanesTexture.width\n      );\n      packPlanesAsUint8(this, dirtyIndex, dirtyIndex + 1);\n      clippingPlanesTexture.copyFrom({\n        source: {\n          width: 2,\n          height: 1,\n          arrayBufferView: this._uint8View,\n        },\n        xOffset: offsetX,\n        yOffset: offsetY,\n      });\n    }\n  } else if (useFloatTexture) {\n    packPlanesAsFloats(this, 0, this._planes.length);\n    clippingPlanesTexture.copyFrom({\n      source: {\n        width: clippingPlanesTexture.width,\n        height: clippingPlanesTexture.height,\n        arrayBufferView: this._float32View,\n      },\n    });\n  } else {\n    packPlanesAsUint8(this, 0, this._planes.length);\n    clippingPlanesTexture.copyFrom({\n      source: {\n        width: clippingPlanesTexture.width,\n        height: clippingPlanesTexture.height,\n        arrayBufferView: this._uint8View,\n      },\n    });\n  }\n\n  this._multipleDirtyPlanes = false;\n  this._dirtyIndex = -1;\n};\n\nconst scratchMatrix = new Matrix4();\nconst scratchPlane = new Plane(Cartesian3.UNIT_X, 0.0);\n/**\n * Determines the type intersection with the planes of this ClippingPlaneCollection instance and the specified {@link TileBoundingVolume}.\n * @private\n *\n * @param {object} tileBoundingVolume The volume to determine the intersection with the planes.\n * @param {Matrix4} [transform] An optional, additional matrix to transform the plane to world coordinates.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire volume is on the side of the planes\n *                      the normal is pointing and should be entirely rendered, {@link Intersect.OUTSIDE}\n *                      if the entire volume is on the opposite side and should be clipped, and\n *                      {@link Intersect.INTERSECTING} if the volume intersects the planes.\n */\nClippingPlaneCollection.prototype.computeIntersectionWithBoundingVolume = function (\n  tileBoundingVolume,\n  transform\n) {\n  const planes = this._planes;\n  const length = planes.length;\n\n  let modelMatrix = this.modelMatrix;\n  if (defined(transform)) {\n    modelMatrix = Matrix4.multiply(transform, modelMatrix, scratchMatrix);\n  }\n\n  // If the collection is not set to union the clipping regions, the volume must be outside of all planes to be\n  // considered completely clipped. If the collection is set to union the clipping regions, if the volume can be\n  // outside any the planes, it is considered completely clipped.\n  // Lastly, if not completely clipped, if any plane is intersecting, more calculations must be performed.\n  let intersection = Intersect.INSIDE;\n  if (!this.unionClippingRegions && length > 0) {\n    intersection = Intersect.OUTSIDE;\n  }\n\n  for (let i = 0; i < length; ++i) {\n    const plane = planes[i];\n\n    Plane.transform(plane, modelMatrix, scratchPlane); // ClippingPlane can be used for Plane math\n\n    const value = tileBoundingVolume.intersectPlane(scratchPlane);\n    if (value === Intersect.INTERSECTING) {\n      intersection = value;\n    } else if (this._testIntersection(value)) {\n      return value;\n    }\n  }\n\n  return intersection;\n};\n\n/**\n * Sets the owner for the input ClippingPlaneCollection if there wasn't another owner.\n * Destroys the owner's previous ClippingPlaneCollection if setting is successful.\n *\n * @param {ClippingPlaneCollection} [clippingPlaneCollection] A ClippingPlaneCollection (or undefined) being attached to an object\n * @param {object} owner An Object that should receive the new ClippingPlaneCollection\n * @param {string} key The Key for the Object to reference the ClippingPlaneCollection\n * @private\n */\nClippingPlaneCollection.setOwner = function (\n  clippingPlaneCollection,\n  owner,\n  key\n) {\n  // Don't destroy the ClippingPlaneCollection if it is already owned by newOwner\n  if (clippingPlaneCollection === owner[key]) {\n    return;\n  }\n  // Destroy the existing ClippingPlaneCollection, if any\n  owner[key] = owner[key] && owner[key].destroy();\n  if (defined(clippingPlaneCollection)) {\n    //>>includeStart('debug', pragmas.debug);\n    if (defined(clippingPlaneCollection._owner)) {\n      throw new DeveloperError(\n        \"ClippingPlaneCollection should only be assigned to one object\"\n      );\n    }\n    //>>includeEnd('debug');\n    clippingPlaneCollection._owner = owner;\n    owner[key] = clippingPlaneCollection;\n  }\n};\n\n/**\n * Function for checking if the context will allow clipping planes with floating point textures.\n *\n * @param {Context} context The Context that will contain clipped objects and clipping textures.\n * @returns {boolean} <code>true</code> if floating point textures can be used for clipping planes.\n * @private\n */\nClippingPlaneCollection.useFloatTexture = function (context) {\n  return context.floatingPointTexture;\n};\n\n/**\n * Function for getting the clipping plane collection's texture resolution.\n * If the ClippingPlaneCollection hasn't been updated, returns the resolution that will be\n * allocated based on the current plane count.\n *\n * @param {ClippingPlaneCollection} clippingPlaneCollection The clipping plane collection\n * @param {Context} context The rendering context\n * @param {Cartesian2} result A Cartesian2 for the result.\n * @returns {Cartesian2} The required resolution.\n * @private\n */\nClippingPlaneCollection.getTextureResolution = function (\n  clippingPlaneCollection,\n  context,\n  result\n) {\n  const texture = clippingPlaneCollection.texture;\n  if (defined(texture)) {\n    result.x = texture.width;\n    result.y = texture.height;\n    return result;\n  }\n\n  const pixelsNeeded = ClippingPlaneCollection.useFloatTexture(context)\n    ? clippingPlaneCollection.length\n    : clippingPlaneCollection.length * 2;\n  const requiredResolution = computeTextureResolution(pixelsNeeded, result);\n\n  // Allocate twice as much space as needed to avoid frequent texture reallocation.\n  requiredResolution.y *= 2;\n  return requiredResolution;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see ClippingPlaneCollection#destroy\n */\nClippingPlaneCollection.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * clippingPlanes = clippingPlanes && clippingPlanes.destroy();\n *\n * @see ClippingPlaneCollection#isDestroyed\n */\nClippingPlaneCollection.prototype.destroy = function () {\n  this._clippingPlanesTexture =\n    this._clippingPlanesTexture && this._clippingPlanesTexture.destroy();\n  return destroyObject(this);\n};\nexport default ClippingPlaneCollection;\n", "import CesiumMath from \"../Core/Math.js\";\n\n/**\n * Defines different modes for blending between a target color and a primitive's source color.\n *\n * HIGHLIGHT multiplies the source color by the target color\n * REPLACE replaces the source color with the target color\n * MIX blends the source color and target color together\n *\n * @enum {number}\n *\n * @see Model.colorBlendMode\n */\nconst ColorBlendMode = {\n  HIGHLIGHT: 0,\n  REPLACE: 1,\n  MIX: 2,\n};\n\n/**\n * @private\n */\nColorBlendMode.getColorBlend = function (colorBlendMode, colorBlendAmount) {\n  if (colorBlendMode === ColorBlendMode.HIGHLIGHT) {\n    return 0.0;\n  } else if (colorBlendMode === ColorBlendMode.REPLACE) {\n    return 1.0;\n  } else if (colorBlendMode === ColorBlendMode.MIX) {\n    // The value 0.0 is reserved for highlight, so clamp to just above 0.0.\n    return CesiumMath.clamp(colorBlendAmount, CesiumMath.EPSILON4, 1.0);\n  }\n};\nexport default Object.freeze(ColorBlendMode);\n", "/**\n * An enum describing the type of motion that is defined by an articulation stage\n * in the AGI_articulations extension.\n *\n * @alias {ArticulationStageType}\n * @enum {string}\n *\n * @private\n */\nconst ArticulationStageType = {\n  XTRANSLATE: \"xTranslate\",\n  YTRANSLATE: \"yTranslate\",\n  ZTRANSLATE: \"zTranslate\",\n  XROTATE: \"xRotate\",\n  YROTATE: \"yRotate\",\n  ZROTATE: \"zRotate\",\n  XSCALE: \"xScale\",\n  YSCALE: \"yScale\",\n  ZSCALE: \"zScale\",\n  UNIFORMSCALE: \"uniformScale\",\n};\n\nexport default Object.freeze(ArticulationStageType);\n", "/**\n * An enum describing the type of interpolation used in a glTF animation.\n *\n * @enum {number}\n *\n * @private\n */\nconst InterpolationType = {\n  STEP: 0,\n  LINEAR: 1,\n  CUBICSPLINE: 2,\n};\n\nexport default Object.freeze(InterpolationType);\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport MetadataEntity from \"./MetadataEntity.js\";\n\n/**\n * A table for storing free-form JSON metadata, as in the 3D Tiles batch table.\n *\n * @param {object} options Object with the following properties:\n * @param {number} options.count The number of entities in the table.\n * @param {Object<string, Array>} options.properties The JSON representation of the metadata table. All the arrays must have exactly options.count elements.\n *\n * @alias JsonMetadataTable\n * @constructor\n * @private\n */\n\n// An empty class is used because JsonMetadataTable is an older type of metadata table\n// that does not have a class definition.\nconst emptyClass = {};\n\nfunction JsonMetadataTable(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThan(\"options.count\", options.count, 0);\n  Check.typeOf.object(\"options.properties\", options.properties);\n  //>>includeEnd('debug');\n\n  this._count = options.count;\n  this._properties = clone(options.properties, true);\n}\n\n/**\n * Returns whether the table has this property.\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {boolean} Whether the table has this property.\n * @private\n */\nJsonMetadataTable.prototype.hasProperty = function (propertyId) {\n  return MetadataEntity.hasProperty(propertyId, this._properties, emptyClass);\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {string[]} [results] An array into which to store the results.\n * @returns {string[]} The property IDs.\n * @private\n */\nJsonMetadataTable.prototype.getPropertyIds = function (results) {\n  return MetadataEntity.getPropertyIds(this._properties, emptyClass, results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n *\n * @param {number} index The index of the entity.\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the entity does not have this property.\n *\n * @exception {DeveloperError} index is out of bounds\n * @private\n */\nJsonMetadataTable.prototype.getProperty = function (index, propertyId) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"index\", index);\n  Check.typeOf.string(\"propertyId\", propertyId);\n\n  if (index < 0 || index >= this._count) {\n    throw new DeveloperError(`index must be in the range [0, ${this._count})`);\n  }\n  //>>includeEnd('debug');\n\n  const property = this._properties[propertyId];\n  if (defined(property)) {\n    return clone(property[index], true);\n  }\n\n  return undefined;\n};\n\n/**\n * Sets the value of the property with the given ID. If the property did not\n * exist, it will be created.\n *\n * @param {number} index The index of the entity.\n * @param {string} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n *\n * @exception {DeveloperError} index is out of bounds\n * @private\n */\nJsonMetadataTable.prototype.setProperty = function (index, propertyId, value) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"index\", index);\n  Check.typeOf.string(\"propertyId\", propertyId);\n\n  if (index < 0 || index >= this._count) {\n    throw new DeveloperError(`index must be in the range [0, ${this._count})`);\n  }\n  //>>includeEnd('debug');\n\n  let property = this._properties[propertyId];\n  if (!defined(property)) {\n    // Property does not exist. Create it.\n    property = new Array(this._count);\n    this._properties[propertyId] = property;\n  }\n\n  property[index] = clone(value, true);\n};\n\nexport default JsonMetadataTable;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport defined from \"../Core/defined.js\";\nimport JsonMetadataTable from \"./JsonMetadataTable.js\";\n\n/**\n * A property table for use with the <code>EXT_structural_metadata</code> extension or\n * legacy <code>EXT_feature_metadata</code> glTF extension. It also includes some\n * options to be compatible with the 3D Tiles 1.0 batch table.\n * <p>\n * For batch tables, properties are resolved in the following order:\n * </p>\n * <ol>\n *   <li>binary properties from options.metadataTable</li>\n *   <li>JSON properties from options.jsonMetadataTable</li>\n *   <li>batch table hierarchy properties from options.batchTableHierarchy</li>\n * </ol>\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension} as well as the\n * previous {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} for glTF.\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {string} [options.name] Human-readable name to describe the table\n * @param {string|number} [options.id] A unique id to identify the property table, useful for debugging. For <code>EXT_structural_metadata</code>, this is the array index in the property tables array, for <code>EXT_feature_metadata</code> this is the dictionary key in the property tables dictionary.\n * @param {number} options.count The number of features in the table.\n * @param {MetadataTable} [options.metadataTable] A table of binary properties.\n * @param {JsonMetadataTable} [options.jsonMetadataTable] For compatibility with the old batch table, free-form JSON properties can be passed in.\n * @param {BatchTableHierarchy} [options.batchTableHierarchy] For compatibility with the <code>3DTILES_batch_table_hierarchy</code> extension, a hierarchy can be provided.\n * @param {object} [options.extras] Extra user-defined properties\n * @param {object} [options.extensions] An object containing extensions\n *\n * @alias PropertyTable\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction PropertyTable(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"options.count\", options.count);\n  //>>includeEnd('debug');\n\n  this._name = options.name;\n  this._id = options.id;\n  this._count = options.count;\n  this._extras = options.extras;\n  this._extensions = options.extensions;\n  this._metadataTable = options.metadataTable;\n  this._jsonMetadataTable = options.jsonMetadataTable;\n  this._batchTableHierarchy = options.batchTableHierarchy;\n}\n\nObject.defineProperties(PropertyTable.prototype, {\n  /**\n   * A human-readable name for this table\n   *\n   * @memberof PropertyTable.prototype\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n  /**\n   * An identifier for this table. Useful for debugging.\n   *\n   * @memberof PropertyTable.prototype\n   * @type {string|number}\n   * @readonly\n   * @private\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n  /**\n   * The number of features in the table.\n   *\n   * @memberof PropertyTable.prototype\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  count: {\n    get: function () {\n      return this._count;\n    },\n  },\n\n  /**\n   * The class that properties conform to.\n   *\n   * @memberof PropertyTable.prototype\n   * @type {MetadataClass}\n   * @readonly\n   */\n  class: {\n    get: function () {\n      if (defined(this._metadataTable)) {\n        return this._metadataTable.class;\n      }\n\n      return undefined;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof PropertyTable.prototype\n   * @type {*}\n   * @readonly\n   * @private\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof PropertyTable.prototype\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n\n  /**\n   * Get the total amount of binary metadata stored in memory. This does\n   * not include JSON metadata\n   *\n   * @memberof PropertyTable.prototype\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  byteLength: {\n    get: function () {\n      let totalByteLength = 0;\n      if (defined(this._metadataTable)) {\n        totalByteLength += this._metadataTable.byteLength;\n      }\n\n      if (defined(this._batchTableHierarchy)) {\n        totalByteLength += this._batchTableHierarchy.byteLength;\n      }\n\n      return totalByteLength;\n    },\n  },\n});\n\n/**\n * Returns whether the feature has this property. For compatibility with the <code>3DTILES_batch_table_hierarchy</code> extension, this is computed for a specific feature.\n *\n * @param {number} index The index of the feature.\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {boolean} Whether the feature has this property.\n * @private\n */\nPropertyTable.prototype.hasProperty = function (index, propertyId) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"index\", index);\n  Check.typeOf.string(\"propertyId\", propertyId);\n  //>>includeEnd('debug');\n\n  if (\n    defined(this._metadataTable) &&\n    this._metadataTable.hasProperty(propertyId)\n  ) {\n    return true;\n  }\n\n  if (\n    defined(this._batchTableHierarchy) &&\n    this._batchTableHierarchy.hasProperty(index, propertyId)\n  ) {\n    return true;\n  }\n\n  if (\n    defined(this._jsonMetadataTable) &&\n    this._jsonMetadataTable.hasProperty(propertyId)\n  ) {\n    return true;\n  }\n\n  return false;\n};\n\n/**\n * Returns whether the feature has a property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {boolean} Whether the feature has a property with the given semantic.\n * @private\n */\nPropertyTable.prototype.hasPropertyBySemantic = function (index, semantic) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"index\", index);\n  Check.typeOf.string(\"semantic\", semantic);\n  //>>includeEnd('debug');\n\n  if (defined(this._metadataTable)) {\n    return this._metadataTable.hasPropertyBySemantic(semantic);\n  }\n\n  return false;\n};\n\n/**\n * Returns whether any feature has this property.\n * This is mainly useful for checking whether a property exists in the class\n * hierarchy when using the <code>3DTILES_batch_table_hierarchy</code> extension.\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {boolean} Whether any feature has this property.\n * @private\n */\nPropertyTable.prototype.propertyExists = function (propertyId) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"propertyId\", propertyId);\n  //>>includeEnd('debug');\n\n  if (\n    defined(this._metadataTable) &&\n    this._metadataTable.hasProperty(propertyId)\n  ) {\n    return true;\n  }\n\n  if (\n    defined(this._batchTableHierarchy) &&\n    this._batchTableHierarchy.propertyExists(propertyId)\n  ) {\n    return true;\n  }\n\n  if (\n    defined(this._jsonMetadataTable) &&\n    this._jsonMetadataTable.hasProperty(propertyId)\n  ) {\n    return true;\n  }\n\n  return false;\n};\n\n/**\n * Returns whether any feature has a property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {boolean} Whether any feature has a property with the given semantic.\n * @private\n */\nPropertyTable.prototype.propertyExistsBySemantic = function (semantic) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"semantic\", semantic);\n  //>>includeEnd('debug');\n\n  if (defined(this._metadataTable)) {\n    return this._metadataTable.hasPropertyBySemantic(semantic);\n  }\n\n  return false;\n};\n\nconst scratchResults = [];\n\n/**\n * Returns an array of property IDs. For compatibility with the <code>3DTILES_batch_table_hierarchy</code> extension, this is computed for a specific feature.\n *\n * @param {number} index The index of the feature.\n * @param {string[]} [results] An array into which to store the results.\n * @returns {string[]} The property IDs.\n * @private\n */\nPropertyTable.prototype.getPropertyIds = function (index, results) {\n  results = defined(results) ? results : [];\n  results.length = 0;\n\n  if (defined(this._metadataTable)) {\n    // concat in place to avoid unnecessary array allocation\n    results.push.apply(\n      results,\n      this._metadataTable.getPropertyIds(scratchResults)\n    );\n  }\n\n  if (defined(this._batchTableHierarchy)) {\n    results.push.apply(\n      results,\n      this._batchTableHierarchy.getPropertyIds(index, scratchResults)\n    );\n  }\n\n  if (defined(this._jsonMetadataTable)) {\n    results.push.apply(\n      results,\n      this._jsonMetadataTable.getPropertyIds(scratchResults)\n    );\n  }\n\n  return results;\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {number} index The index of the feature.\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n * @private\n */\nPropertyTable.prototype.getProperty = function (index, propertyId) {\n  let result;\n  if (defined(this._metadataTable)) {\n    result = this._metadataTable.getProperty(index, propertyId);\n    if (defined(result)) {\n      return result;\n    }\n  }\n\n  if (defined(this._batchTableHierarchy)) {\n    result = this._batchTableHierarchy.getProperty(index, propertyId);\n    if (defined(result)) {\n      return result;\n    }\n  }\n\n  if (defined(this._jsonMetadataTable)) {\n    result = this._jsonMetadataTable.getProperty(index, propertyId);\n    if (defined(result)) {\n      return result;\n    }\n  }\n\n  return undefined;\n};\n\n/**\n * Sets the value of the property with the given ID. If the property did not\n * exist, it will be created as a JSON metadata property\n *\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {number} index The index of the feature.\n * @param {string} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @private\n */\nPropertyTable.prototype.setProperty = function (index, propertyId, value) {\n  if (\n    defined(this._metadataTable) &&\n    this._metadataTable.setProperty(index, propertyId, value)\n  ) {\n    return;\n  }\n\n  if (\n    defined(this._batchTableHierarchy) &&\n    this._batchTableHierarchy.setProperty(index, propertyId, value)\n  ) {\n    return;\n  }\n\n  // Ensure we have a table for JSON properties\n  if (!defined(this._jsonMetadataTable)) {\n    this._jsonMetadataTable = new JsonMetadataTable({\n      count: this._count,\n      properties: {},\n    });\n  }\n\n  // JsonMetadataTable will handle creating a new property at runtime.\n  this._jsonMetadataTable.setProperty(index, propertyId, value);\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n * <p>\n * This only operates on the underlying {@link MetadataTable} (if present) as\n * {@link JsonMetadataTable} and {@link BatchTableHierarchy} do not have\n * semantics.\n * </p>\n *\n * @param {number} index The index of the feature.\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this semantic.\n * @private\n */\nPropertyTable.prototype.getPropertyBySemantic = function (index, semantic) {\n  if (defined(this._metadataTable)) {\n    return this._metadataTable.getPropertyBySemantic(index, semantic);\n  }\n\n  return undefined;\n};\n\n/**\n * Sets the value of the property with the given semantic.\n * <p>\n * This only operates on the underlying {@link MetadataTable} (if present) as\n * {@link JsonMetadataTable} and {@link BatchTableHierarchy} do not have\n * semantics.\n * </p>\n *\n * @param {number} index The index of the feature.\n * @param {string} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nPropertyTable.prototype.setPropertyBySemantic = function (\n  index,\n  semantic,\n  value\n) {\n  if (defined(this._metadataTable)) {\n    return this._metadataTable.setPropertyBySemantic(index, semantic, value);\n  }\n\n  return false;\n};\n\n/**\n * Returns a typed array containing the property values for a given propertyId.\n * <p>\n * This only operates on the underlying {@link MetadataTable} (if present) as\n * {@link JsonMetadataTable} and {@link BatchTableHierarchy} do not store\n * values in typed arrays.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {*} The typed array containing the property values or <code>undefined</code> if the property values are not stored in a typed array.\n *\n * @private\n */\nPropertyTable.prototype.getPropertyTypedArray = function (propertyId) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"propertyId\", propertyId);\n  //>>includeEnd('debug');\n\n  if (defined(this._metadataTable)) {\n    return this._metadataTable.getPropertyTypedArray(propertyId);\n  }\n\n  return undefined;\n};\n\n/**\n * Returns a typed array containing the property values for the property with the given semantic.\n * <p>\n * This only operates on the underlying {@link MetadataTable} (if present) as\n * {@link JsonMetadataTable} and {@link BatchTableHierarchy} do not have\n * semantics.\n * </p>\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {*} The typed array containing the property values or <code>undefined</code> if the property values are not stored in a typed array.\n *\n * @private\n */\nPropertyTable.prototype.getPropertyTypedArrayBySemantic = function (semantic) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"semantic\", semantic);\n  //>>includeEnd('debug');\n\n  if (defined(this._metadataTable)) {\n    return this._metadataTable.getPropertyTypedArrayBySemantic(semantic);\n  }\n\n  return undefined;\n};\n\nfunction checkFeatureId(featureId, featuresLength) {\n  if (!defined(featureId) || featureId < 0 || featureId >= featuresLength) {\n    throw new DeveloperError(\n      `featureId is required and must be between zero and featuresLength - 1 (${featuresLength}` -\n        +\").\"\n    );\n  }\n}\n\nPropertyTable.prototype.isClass = function (featureId, className) {\n  //>>includeStart('debug', pragmas.debug);\n  checkFeatureId(featureId, this.count);\n  Check.typeOf.string(\"className\", className);\n  //>>includeEnd('debug');\n\n  const hierarchy = this._batchTableHierarchy;\n  if (!defined(hierarchy)) {\n    return false;\n  }\n\n  return hierarchy.isClass(featureId, className);\n};\n\nPropertyTable.prototype.isExactClass = function (featureId, className) {\n  //>>includeStart('debug', pragmas.debug);\n  checkFeatureId(featureId, this.count);\n  Check.typeOf.string(\"className\", className);\n  //>>includeEnd('debug');\n\n  return this.getExactClassName(featureId) === className;\n};\n\nPropertyTable.prototype.getExactClassName = function (featureId) {\n  //>>includeStart('debug', pragmas.debug);\n  checkFeatureId(featureId, this.count);\n  //>>includeEnd('debug');\n\n  const hierarchy = this._batchTableHierarchy;\n  if (!defined(hierarchy)) {\n    return undefined;\n  }\n\n  return hierarchy.getClassName(featureId);\n};\n\nexport default PropertyTable;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport GltfLoaderUtil from \"./GltfLoaderUtil.js\";\nimport MetadataType from \"./MetadataType.js\";\nimport MetadataComponentType from \"./MetadataComponentType.js\";\n\n/**\n * A property in a property texture.\n *\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension} as well as the\n * previous {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} for glTF.\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.property The property JSON object.\n * @param {MetadataClassProperty} options.classProperty The class property.\n * @param {Object<number, Texture>} options.textures An object mapping texture IDs to {@link Texture} objects.\n *\n * @alias PropertyTextureProperty\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction PropertyTextureProperty(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const property = options.property;\n  const classProperty = options.classProperty;\n  const textures = options.textures;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.property\", property);\n  Check.typeOf.object(\"options.classProperty\", classProperty);\n  Check.typeOf.object(\"options.textures\", textures);\n  //>>includeEnd('debug');\n\n  // in EXT_structural_metadata, the property is a valid glTF textureInfo\n  const channels = defined(property.channels) ? property.channels : [0];\n  const textureInfo = property;\n  const textureReader = GltfLoaderUtil.createModelTextureReader({\n    textureInfo: textureInfo,\n    channels: reformatChannels(channels),\n    texture: textures[textureInfo.index],\n  });\n\n  this._min = property.min;\n  this._max = property.max;\n\n  let offset = property.offset;\n  let scale = property.scale;\n\n  // This needs to be set before handling default values\n  const hasValueTransform =\n    classProperty.hasValueTransform || defined(offset) || defined(scale);\n\n  // If the property attribute does not define an offset/scale, it inherits from\n  // the class property. The class property handles setting the default of\n  // identity: (offset 0, scale 1) with the same scalar/vector/matrix types.\n  // array types are disallowed by the spec.\n  offset = defaultValue(offset, classProperty.offset);\n  scale = defaultValue(scale, classProperty.scale);\n\n  // offset and scale are applied on the GPU, so unpack the values\n  // as math types we can use in uniform callbacks.\n  offset = classProperty.unpackVectorAndMatrixTypes(offset);\n  scale = classProperty.unpackVectorAndMatrixTypes(scale);\n\n  this._offset = offset;\n  this._scale = scale;\n  this._hasValueTransform = hasValueTransform;\n\n  this._textureReader = textureReader;\n  this._classProperty = classProperty;\n  this._extras = property.extras;\n  this._extensions = property.extensions;\n}\n\nObject.defineProperties(PropertyTextureProperty.prototype, {\n  /**\n   * The texture reader.\n   *\n   * @memberof PropertyTextureProperty.prototype\n   * @type {ModelComponents.TextureReader}\n   * @readonly\n   * @private\n   */\n  textureReader: {\n    get: function () {\n      return this._textureReader;\n    },\n  },\n\n  /**\n   * True if offset/scale should be applied. If both offset/scale were\n   * undefined, they default to identity so this property is set false\n   *\n   * @memberof PropertyTextureProperty.prototype\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  hasValueTransform: {\n    get: function () {\n      return this._hasValueTransform;\n    },\n  },\n\n  /**\n   * The offset to be added to property values as part of the value transform.\n   *\n   * @memberof PropertyTextureProperty.prototype\n   * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n   * @readonly\n   * @private\n   */\n  offset: {\n    get: function () {\n      return this._offset;\n    },\n  },\n\n  /**\n   * The scale to be multiplied to property values as part of the value transform.\n   *\n   * @memberof PropertyTextureProperty.prototype\n   * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n   * @readonly\n   * @private\n   */\n  scale: {\n    get: function () {\n      return this._scale;\n    },\n  },\n\n  /**\n   * The properties inherited from this property's class\n   *\n   * @memberof PropertyTextureProperty.prototype\n   * @type {MetadataClassProperty}\n   * @readonly\n   * @private\n   */\n  classProperty: {\n    get: function () {\n      return this._classProperty;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof PropertyTextureProperty.prototype\n   * @type {*}\n   * @readonly\n   * @private\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof PropertyTextureProperty.prototype\n   * @type {*}\n   * @readonly\n   * @private\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\nPropertyTextureProperty.prototype.isGpuCompatible = function () {\n  const classProperty = this._classProperty;\n  const type = classProperty.type;\n  const componentType = classProperty.componentType;\n\n  if (classProperty.isArray) {\n    // only support arrays of 1-4 UINT8 scalars (normalized or unnormalized)\n    return (\n      !classProperty.isVariableLengthArray &&\n      classProperty.arrayLength <= 4 &&\n      type === MetadataType.SCALAR &&\n      componentType === MetadataComponentType.UINT8\n    );\n  }\n\n  if (MetadataType.isVectorType(type) || type === MetadataType.SCALAR) {\n    return componentType === MetadataComponentType.UINT8;\n  }\n\n  // For this initial implementation, only UINT8-based properties\n  // are supported.\n  return false;\n};\n\nconst floatTypesByComponentCount = [undefined, \"float\", \"vec2\", \"vec3\", \"vec4\"];\nconst integerTypesByComponentCount = [\n  undefined,\n  \"int\",\n  \"ivec2\",\n  \"ivec3\",\n  \"ivec4\",\n];\nPropertyTextureProperty.prototype.getGlslType = function () {\n  const classProperty = this._classProperty;\n\n  let componentCount = MetadataType.getComponentCount(classProperty.type);\n  if (classProperty.isArray) {\n    // fixed-sized arrays of length 2-4 UINT8s are represented as vectors as the\n    // shader since those are more useful in GLSL.\n    componentCount = classProperty.arrayLength;\n  }\n\n  // Normalized UINT8 properties are float types in the shader\n  if (classProperty.normalized) {\n    return floatTypesByComponentCount[componentCount];\n  }\n\n  // other UINT8-based properties are represented as integer types.\n  return integerTypesByComponentCount[componentCount];\n};\n\nPropertyTextureProperty.prototype.unpackInShader = function (packedValueGlsl) {\n  const classProperty = this._classProperty;\n\n  // no unpacking needed if for normalized types\n  if (classProperty.normalized) {\n    return packedValueGlsl;\n  }\n\n  // integer types are read from the texture as normalized float values.\n  // these need to be rescaled to [0, 255] and cast to the appropriate integer\n  // type.\n  const glslType = this.getGlslType();\n  return `${glslType}(255.0 * ${packedValueGlsl})`;\n};\n\n/**\n * Reformat from an array of channel indices like <code>[0, 1]</code> to a\n * string of channels as would be used in GLSL swizzling (e.g. \"rg\")\n *\n * @param {number[]} channels the channel indices\n * @return {string} The channels as a string of \"r\", \"g\", \"b\" or \"a\" characters.\n * @private\n */\nfunction reformatChannels(channels) {\n  return channels\n    .map(function (channelIndex) {\n      return \"rgba\".charAt(channelIndex);\n    })\n    .join(\"\");\n}\n\nexport default PropertyTextureProperty;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport PropertyTextureProperty from \"./PropertyTextureProperty.js\";\n\n/**\n * A property texture.\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension} as well as the\n * previous {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} for glTF.\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {string} [options.name] Optional human-readable name to describe the texture\n * @param {string|number} [options.id] A unique id to identify the property texture, useful for debugging. For <code>EXT_structural_metadata</code>, this is the array index in the property textures array, for <code>EXT_feature_metadata</code> this is the dictionary key in the property textures dictionary.\n * @param {object} options.propertyTexture The property texture JSON, following the EXT_structural_metadata schema.\n * @param {MetadataClass} options.class The class that properties conform to.\n * @param {Object<string, Texture>} options.textures An object mapping texture IDs to {@link Texture} objects.\n *\n * @alias PropertyTexture\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction PropertyTexture(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const propertyTexture = options.propertyTexture;\n  const classDefinition = options.class;\n  const textures = options.textures;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.propertyTexture\", propertyTexture);\n  Check.typeOf.object(\"options.class\", classDefinition);\n  Check.typeOf.object(\"options.textures\", textures);\n  //>>includeEnd('debug');\n\n  const extensions = propertyTexture.extensions;\n  const extras = propertyTexture.extras;\n\n  const properties = {};\n  if (defined(propertyTexture.properties)) {\n    for (const propertyId in propertyTexture.properties) {\n      if (propertyTexture.properties.hasOwnProperty(propertyId)) {\n        properties[propertyId] = new PropertyTextureProperty({\n          property: propertyTexture.properties[propertyId],\n          classProperty: classDefinition.properties[propertyId],\n          textures: textures,\n        });\n      }\n    }\n  }\n\n  this._name = options.name;\n  this._id = options.id;\n  this._class = classDefinition;\n  this._properties = properties;\n  this._extras = extras;\n  this._extensions = extensions;\n}\n\nObject.defineProperties(PropertyTexture.prototype, {\n  /**\n   * A human-readable name for this texture\n   *\n   * @memberof PropertyTexture.prototype\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n  /**\n   * An identifier for this texture. Useful for debugging.\n   *\n   * @memberof PropertyTexture.prototype\n   * @type {string|number}\n   * @readonly\n   * @private\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n  /**\n   * The class that properties conform to.\n   *\n   * @memberof PropertyTexture.prototype\n   * @type {MetadataClass}\n   * @readonly\n   * @private\n   */\n  class: {\n    get: function () {\n      return this._class;\n    },\n  },\n\n  /**\n   * The properties in this property texture.\n   *\n   * @memberof PropertyTexture.prototype\n   *\n   * @type {PropertyTextureProperty}\n   * @readonly\n   * @private\n   */\n  properties: {\n    get: function () {\n      return this._properties;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof PropertyTexture.prototype\n   * @type {*}\n   * @readonly\n   * @private\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof PropertyTexture.prototype\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\n/**\n * Gets the property with the given property ID.\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {PropertyTextureProperty|undefined} The property, or <code>undefined</code> if the property does not exist.\n * @private\n */\nPropertyTexture.prototype.getProperty = function (propertyId) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"propertyId\", propertyId);\n  //>>includeEnd('debug');\n\n  return this._properties[propertyId];\n};\n\nexport default PropertyTexture;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * A property in a property attribute from EXT_structural_metadata.\n *\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension}\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.property The property JSON object.\n * @param {MetadataClassProperty} options.classProperty The class property.\n *\n * @alias PropertyAttributeProperty\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction PropertyAttributeProperty(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const property = options.property;\n  const classProperty = options.classProperty;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.property\", property);\n  Check.typeOf.object(\"options.classProperty\", classProperty);\n  //>>includeEnd('debug');\n\n  this._attribute = property.attribute;\n  this._classProperty = classProperty;\n  this._min = property.min;\n  this._max = property.max;\n\n  let offset = property.offset;\n  let scale = property.scale;\n\n  // This needs to be set before handling default values\n  const hasValueTransform =\n    classProperty.hasValueTransform || defined(offset) || defined(scale);\n\n  // If the property attribute does not define an offset/scale, it inherits from\n  // the class property. The class property handles setting the default of\n  // identity: (offset 0, scale 1) with the same scalar/vector/matrix types.\n  // array types are disallowed by the spec.\n  offset = defaultValue(offset, classProperty.offset);\n  scale = defaultValue(scale, classProperty.scale);\n\n  // offset and scale are applied on the GPU, so unpack the values\n  // as math types we can use in uniform callbacks.\n  offset = classProperty.unpackVectorAndMatrixTypes(offset);\n  scale = classProperty.unpackVectorAndMatrixTypes(scale);\n\n  this._offset = offset;\n  this._scale = scale;\n  this._hasValueTransform = hasValueTransform;\n\n  this._extras = property.extras;\n  this._extensions = property.extensions;\n}\n\nObject.defineProperties(PropertyAttributeProperty.prototype, {\n  /**\n   * The attribute semantic\n   *\n   * @memberof PropertyAttributeProperty.prototype\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  attribute: {\n    get: function () {\n      return this._attribute;\n    },\n  },\n\n  /**\n   * True if offset/scale should be applied. If both offset/scale were\n   * undefined, they default to identity so this property is set false\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  hasValueTransform: {\n    get: function () {\n      return this._hasValueTransform;\n    },\n  },\n\n  /**\n   * The offset to be added to property values as part of the value transform.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n   * @readonly\n   * @private\n   */\n  offset: {\n    get: function () {\n      return this._offset;\n    },\n  },\n\n  /**\n   * The scale to be multiplied to property values as part of the value transform.\n   *\n   * @memberof MetadataClassProperty.prototype\n   * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n   * @readonly\n   * @private\n   */\n  scale: {\n    get: function () {\n      return this._scale;\n    },\n  },\n\n  /**\n   * The properties inherited from this property's class\n   *\n   * @memberof PropertyAttributeProperty.prototype\n   * @type {MetadataClassProperty}\n   * @readonly\n   * @private\n   */\n  classProperty: {\n    get: function () {\n      return this._classProperty;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof PropertyAttributeProperty.prototype\n   * @type {*}\n   * @readonly\n   * @private\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof PropertyAttributeProperty.prototype\n   * @type {*}\n   * @readonly\n   * @private\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\nexport default PropertyAttributeProperty;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport PropertyAttributeProperty from \"./PropertyAttributeProperty.js\";\n\n/**\n * A property attribute; a collection of per-point properties stored as custom\n * vertex attributes.\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension}\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {string} [options.name] Optional human-readable name to describe the attribute\n * @param {number} [options.id] A unique id to identify the property attribute, useful for debugging. This is the array index in the property attributes array\n * @param {object} options.propertyAttribute The property attribute JSON, following the EXT_structural_metadata schema.\n * @param {MetadataClass} options.class The class that properties conform to.\n *\n * @alias PropertyAttribute\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction PropertyAttribute(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const propertyAttribute = options.propertyAttribute;\n  const classDefinition = options.class;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.propertyAttribute\", propertyAttribute);\n  Check.typeOf.object(\"options.class\", classDefinition);\n  //>>includeEnd('debug');\n\n  const properties = {};\n  if (defined(propertyAttribute.properties)) {\n    for (const propertyId in propertyAttribute.properties) {\n      if (propertyAttribute.properties.hasOwnProperty(propertyId)) {\n        properties[propertyId] = new PropertyAttributeProperty({\n          property: propertyAttribute.properties[propertyId],\n          classProperty: classDefinition.properties[propertyId],\n        });\n      }\n    }\n  }\n\n  this._name = options.name;\n  this._id = options.id;\n  this._class = classDefinition;\n  this._properties = properties;\n  this._extras = propertyAttribute.extras;\n  this._extensions = propertyAttribute.extensions;\n}\n\nObject.defineProperties(PropertyAttribute.prototype, {\n  /**\n   * A human-readable name for this attribute\n   *\n   * @memberof PropertyAttribute.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n  /**\n   * An identifier for this attribute. Useful for debugging.\n   *\n   * @memberof PropertyAttribute.prototype\n   *\n   * @type {string|number}\n   * @readonly\n   * @private\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n  /**\n   * The class that properties conform to.\n   *\n   * @memberof PropertyAttribute.prototype\n   *\n   * @type {MetadataClass}\n   * @readonly\n   * @private\n   */\n  class: {\n    get: function () {\n      return this._class;\n    },\n  },\n\n  /**\n   * The properties in this property attribute.\n   *\n   * @memberof PropertyAttribute.prototype\n   *\n   * @type {Object<string, PropertyAttributeProperty>}\n   * @readonly\n   * @private\n   */\n  properties: {\n    get: function () {\n      return this._properties;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof PropertyAttribute.prototype\n   *\n   * @type {*}\n   * @readonly\n   * @private\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof PropertyAttribute.prototype\n   *\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\n/**\n * Gets the property with the given property ID.\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {PropertyAttributeProperty|undefined} The property, or <code>undefined</code> if the property does not exist.\n * @private\n */\nPropertyAttribute.prototype.getProperty = function (propertyId) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"propertyId\", propertyId);\n  //>>includeEnd('debug');\n\n  return this._properties[propertyId];\n};\n\nexport default PropertyAttribute;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * An object containing structural metadata.\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadatas|EXT_structural_metadata Extension} as well as the\n * previous {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} for glTF.\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {MetadataSchema} options.schema The parsed schema.\n * @param {PropertyTable[]} [options.propertyTables] An array of property table objects. For the legacy <code>EXT_feature_metadata</code> extension, this is sorted by the key in the propertyTables dictionary\n * @param {PropertyTexture[]} [options.propertyTextures] An array of property texture objects. For the legacy <code>EXT_feature_metadata</code> extension, this is sorted by the key in the propertyTextures dictionary\n * @param {PropertyAttribute[]} [options.propertyAttributes] An array of property attribute objects. This is new in <code>EXT_structural_metadata</code>\n * @param {object} [options.statistics] Statistics about metadata\n * @param {object} [options.extras] Extra user-defined properties\n * @param {object} [options.extensions] An object containing extensions\n *\n * @alias StructuralMetadata\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction StructuralMetadata(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.schema\", options.schema);\n  //>>includeEnd('debug');\n\n  this._schema = options.schema;\n  const propertyTables = options.propertyTables;\n  this._propertyTableCount = defined(propertyTables)\n    ? propertyTables.length\n    : 0;\n  this._propertyTables = propertyTables;\n  this._propertyTextures = options.propertyTextures;\n  this._propertyAttributes = options.propertyAttributes;\n  this._statistics = options.statistics;\n  this._extras = options.extras;\n  this._extensions = options.extensions;\n}\n\nObject.defineProperties(StructuralMetadata.prototype, {\n  /**\n   * Schema containing classes and enums.\n   *\n   * @memberof StructuralMetadata.prototype\n   * @type {MetadataSchema}\n   * @readonly\n   * @private\n   */\n  schema: {\n    get: function () {\n      return this._schema;\n    },\n  },\n\n  /**\n   * Statistics about the metadata.\n   * <p>\n   * See the {@link https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata/schema/statistics.schema.json|statistics schema reference} for the full set of properties.\n   * </p>\n   *\n   * @memberof StructuralMetadata.prototype\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  statistics: {\n    get: function () {\n      return this._statistics;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof StructuralMetadata.prototype\n   * @type {*}\n   * @readonly\n   * @private\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof StructuralMetadata.prototype\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n\n  /**\n   * Number of property tables in the metadata.\n   *\n   * @memberof StructuralMetadata.prototype\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  propertyTableCount: {\n    get: function () {\n      return this._propertyTableCount;\n    },\n  },\n\n  /**\n   * The property tables in the metadata.\n   *\n   * @memberof StructuralMetadata.prototype\n   * @type {PropertyTable[]}\n   * @readonly\n   * @private\n   */\n  propertyTables: {\n    get: function () {\n      return this._propertyTables;\n    },\n  },\n\n  /**\n   * The property textures in the metadata.\n   *\n   * @memberof StructuralMetadata.prototype\n   * @type {PropertyTexture[]}\n   * @readonly\n   * @private\n   */\n  propertyTextures: {\n    get: function () {\n      return this._propertyTextures;\n    },\n  },\n\n  /**\n   * The property attributes from the structural metadata extension\n   *\n   * @memberof StructuralMetadata.prototype\n   * @type {PropertyAttribute[]}\n   * @readonly\n   * @private\n   */\n  propertyAttributes: {\n    get: function () {\n      return this._propertyAttributes;\n    },\n  },\n\n  /**\n   * Total size in bytes across all property tables\n   *\n   * @memberof StructuralMetadata.prototype\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  propertyTablesByteLength: {\n    get: function () {\n      if (!defined(this._propertyTables)) {\n        return 0;\n      }\n\n      let totalByteLength = 0;\n      const length = this._propertyTables.length;\n      for (let i = 0; i < length; i++) {\n        totalByteLength += this._propertyTables[i].byteLength;\n      }\n\n      return totalByteLength;\n    },\n  },\n});\n\n/**\n * Gets the property table with the given ID.\n * <p>\n * For the legacy <code>EXT_feature_metadata</code>, textures are stored in an array sorted\n * by the key in the propertyTables dictionary.\n * </p>\n *\n * @param {number} propertyTableId The property table ID.\n * @returns {PropertyTable} The property table.\n * @private\n */\nStructuralMetadata.prototype.getPropertyTable = function (propertyTableId) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"propertyTableId\", propertyTableId);\n  //>>includeEnd('debug');\n\n  return this._propertyTables[propertyTableId];\n};\n\n/**\n * Gets the property texture with the given ID.\n * <p>\n * For the legacy <code>EXT_feature_metadata</code>, textures are stored in an array sorted\n * by the key in the propertyTextures dictionary.\n * </p>\n *\n * @param {number} propertyTextureId The index into the property textures array.\n * @returns {PropertyTexture} The property texture\n * @private\n */\nStructuralMetadata.prototype.getPropertyTexture = function (propertyTextureId) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"propertyTextureId\", propertyTextureId);\n  //>>includeEnd('debug');\n\n  return this._propertyTextures[propertyTextureId];\n};\n\n/**\n * Gets the property attribute with the given ID. This concept is new in\n * EXT_structural_metadata\n *\n * @param {number} propertyAttributeId The index into the property attributes array.\n * @returns {PropertyAttribute} The property attribute\n * @private\n */\nStructuralMetadata.prototype.getPropertyAttribute = function (\n  propertyAttributeId\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"propertyAttributeId\", propertyAttributeId);\n  //>>includeEnd('debug');\n\n  return this._propertyAttributes[propertyAttributeId];\n};\n\nexport default StructuralMetadata;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport PropertyTable from \"./PropertyTable.js\";\nimport PropertyTexture from \"./PropertyTexture.js\";\nimport PropertyAttribute from \"./PropertyAttribute.js\";\nimport StructuralMetadata from \"./StructuralMetadata.js\";\nimport MetadataTable from \"./MetadataTable.js\";\n\n/**\n * Parse the <code>EXT_structural_metadata</code> glTF extension to create a\n * structural metadata object.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.extension The extension JSON object.\n * @param {MetadataSchema} options.schema The parsed schema.\n * @param {Object<string, Uint8Array>} [options.bufferViews] An object mapping bufferView IDs to Uint8Array objects.\n * @param {Object<string, Texture>} [options.textures] An object mapping texture IDs to {@link Texture} objects.\n * @return {StructuralMetadata} A structural metadata object\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction parseStructuralMetadata(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const extension = options.extension;\n\n  // The calling code is responsible for loading the schema.\n  // This keeps metadata parsing synchronous.\n  const schema = options.schema;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.extension\", extension);\n  Check.typeOf.object(\"options.schema\", schema);\n  //>>includeEnd('debug');\n\n  const propertyTables = [];\n  if (defined(extension.propertyTables)) {\n    for (let i = 0; i < extension.propertyTables.length; i++) {\n      const propertyTable = extension.propertyTables[i];\n      const classDefinition = schema.classes[propertyTable.class];\n      const metadataTable = new MetadataTable({\n        count: propertyTable.count,\n        properties: propertyTable.properties,\n        class: classDefinition,\n        bufferViews: options.bufferViews,\n      });\n      propertyTables.push(\n        new PropertyTable({\n          id: i,\n          name: propertyTable.name,\n          count: propertyTable.count,\n          metadataTable: metadataTable,\n          extras: propertyTable.extras,\n          extensions: propertyTable.extensions,\n        })\n      );\n    }\n  }\n\n  const propertyTextures = [];\n  if (defined(extension.propertyTextures)) {\n    for (let i = 0; i < extension.propertyTextures.length; i++) {\n      const propertyTexture = extension.propertyTextures[i];\n      propertyTextures.push(\n        new PropertyTexture({\n          id: i,\n          name: propertyTexture.name,\n          propertyTexture: propertyTexture,\n          class: schema.classes[propertyTexture.class],\n          textures: options.textures,\n        })\n      );\n    }\n  }\n\n  const propertyAttributes = [];\n  if (defined(extension.propertyAttributes)) {\n    for (let i = 0; i < extension.propertyAttributes.length; i++) {\n      const propertyAttribute = extension.propertyAttributes[i];\n      propertyAttributes.push(\n        new PropertyAttribute({\n          id: i,\n          name: propertyAttribute.name,\n          class: schema.classes[propertyAttribute.class],\n          propertyAttribute: propertyAttribute,\n        })\n      );\n    }\n  }\n\n  return new StructuralMetadata({\n    schema: schema,\n    propertyTables: propertyTables,\n    propertyTextures: propertyTextures,\n    propertyAttributes: propertyAttributes,\n    statistics: extension.statistics,\n    extras: extension.extras,\n    extensions: extension.extensions,\n  });\n}\n\nexport default parseStructuralMetadata;\n", "import Check from \"../Core/Check.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport PropertyTable from \"./PropertyTable.js\";\nimport PropertyTexture from \"./PropertyTexture.js\";\nimport StructuralMetadata from \"./StructuralMetadata.js\";\nimport MetadataTable from \"./MetadataTable.js\";\n\n/**\n * Parse the <code>EXT_feature_metadata</code> glTF extension to create a\n * structural metadata object.\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.extension The extension JSON object.\n * @param {MetadataSchema} options.schema The parsed schema.\n * @param {Object<string, Uint8Array>} [options.bufferViews] An object mapping bufferView IDs to Uint8Array objects.\n * @param {Object<string, Texture>} [options.textures] An object mapping texture IDs to {@link Texture} objects.\n * @return {StructuralMetadata} A structural metadata object\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction parseFeatureMetadataLegacy(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const extension = options.extension;\n\n  // The calling code is responsible for loading the schema.\n  // This keeps metadata parsing synchronous.\n  const schema = options.schema;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.extension\", extension);\n  Check.typeOf.object(\"options.schema\", schema);\n  //>>includeEnd('debug');\n\n  let i;\n  const propertyTables = [];\n  let sortedIds;\n  if (defined(extension.featureTables)) {\n    // Store textures in an array sorted by the dictionary keys. This\n    // allows compatibility with the newer EXT_structural_metadata extension\n    // which is array-based.\n    sortedIds = Object.keys(extension.featureTables).sort();\n    for (i = 0; i < sortedIds.length; i++) {\n      const featureTableId = sortedIds[i];\n      const featureTable = extension.featureTables[featureTableId];\n      const classDefinition = schema.classes[featureTable.class];\n\n      const metadataTable = new MetadataTable({\n        count: featureTable.count,\n        properties: featureTable.properties,\n        class: classDefinition,\n        bufferViews: options.bufferViews,\n      });\n\n      propertyTables.push(\n        new PropertyTable({\n          id: featureTableId,\n          count: featureTable.count,\n          metadataTable: metadataTable,\n          extras: featureTable.extras,\n          extensions: featureTable.extensions,\n        })\n      );\n    }\n  }\n\n  const propertyTextures = [];\n  if (defined(extension.featureTextures)) {\n    // Store textures in an array sorted by the dictionary keys. This\n    // allows compatibility with the newer EXT_structural_metadata extension\n    // which is array-based.\n    sortedIds = Object.keys(extension.featureTextures).sort();\n    for (i = 0; i < sortedIds.length; i++) {\n      const featureTextureId = sortedIds[i];\n      const featureTexture = extension.featureTextures[featureTextureId];\n      propertyTextures.push(\n        new PropertyTexture({\n          id: featureTextureId,\n          propertyTexture: transcodeToPropertyTexture(featureTexture),\n          class: schema.classes[featureTexture.class],\n          textures: options.textures,\n        })\n      );\n    }\n  }\n\n  return new StructuralMetadata({\n    schema: schema,\n    propertyTables: propertyTables,\n    propertyTextures: propertyTextures,\n    statistics: extension.statistics,\n    extras: extension.extras,\n    extensions: extension.extensions,\n  });\n}\n\nfunction transcodeToPropertyTexture(featureTexture) {\n  const propertyTexture = {\n    class: featureTexture.class,\n    properties: {},\n  };\n\n  const properties = featureTexture.properties;\n  for (const propertyId in properties) {\n    if (properties.hasOwnProperty(propertyId)) {\n      const oldProperty = properties[propertyId];\n      const property = {\n        // EXT_structural_metadata uses numeric channel indices instead of\n        // a string of channel letters like \"rgba\".\n        channels: reformatChannels(oldProperty.channels),\n        extras: oldProperty.extras,\n        extensions: oldProperty.extensions,\n      };\n\n      // EXT_feature_metadata puts the textureInfo in property.texture.\n      // EXT_structural_metadata flattens this structure; essentially a\n      // textureInfo + channels\n      propertyTexture.properties[propertyId] = combine(\n        oldProperty.texture,\n        property,\n        true\n      );\n    }\n  }\n\n  return propertyTexture;\n}\n\nfunction reformatChannels(channelsString) {\n  const length = channelsString.length;\n  const result = new Array(length);\n  for (let i = 0; i < length; i++) {\n    result[i] = \"rgba\".indexOf(channelsString[i]);\n  }\n  return result;\n}\n\nexport default parseFeatureMetadataLegacy;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport parseStructuralMetadata from \"./parseStructuralMetadata.js\";\nimport parseFeatureMetadataLegacy from \"./parseFeatureMetadataLegacy.js\";\nimport ResourceCache from \"./ResourceCache.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * Loads glTF structural metadata\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfStructuralMetadataLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.gltf The glTF JSON.\n * @param {string} [options.extension] The <code>EXT_structural_metadata</code> extension object. If this is undefined, then extensionLegacy must be defined.\n * @param {string} [options.extensionLegacy] The legacy <code>EXT_feature_metadata</code> extension for backwards compatibility.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {SupportedImageFormats} options.supportedImageFormats The supported image formats.\n * @param {FrameState} options.frameState The frame state.\n * @param {string} [options.cacheKey] The cache key of the resource.\n * @param {boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction GltfStructuralMetadataLoader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltf = options.gltf;\n  const extension = options.extension;\n  const extensionLegacy = options.extensionLegacy;\n  const gltfResource = options.gltfResource;\n  const baseResource = options.baseResource;\n  const supportedImageFormats = options.supportedImageFormats;\n  const frameState = options.frameState;\n  const cacheKey = options.cacheKey;\n  const asynchronous = defaultValue(options.asynchronous, true);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltf\", gltf);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  Check.typeOf.object(\"options.baseResource\", baseResource);\n  Check.typeOf.object(\"options.supportedImageFormats\", supportedImageFormats);\n  Check.typeOf.object(\"options.frameState\", frameState);\n\n  if (!defined(options.extension) && !defined(options.extensionLegacy)) {\n    throw new DeveloperError(\n      \"One of options.extension or options.extensionLegacy must be specified\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._gltfResource = gltfResource;\n  this._baseResource = baseResource;\n  this._gltf = gltf;\n  this._extension = extension;\n  this._extensionLegacy = extensionLegacy;\n  this._supportedImageFormats = supportedImageFormats;\n  this._frameState = frameState;\n  this._cacheKey = cacheKey;\n  this._asynchronous = asynchronous;\n  this._bufferViewLoaders = [];\n  this._bufferViewIds = [];\n  this._textureLoaders = [];\n  this._textureIds = [];\n  this._schemaLoader = undefined;\n  this._structuralMetadata = undefined;\n  this._state = ResourceLoaderState.UNLOADED;\n  this._promise = undefined;\n}\n\nif (defined(Object.create)) {\n  GltfStructuralMetadataLoader.prototype = Object.create(\n    ResourceLoader.prototype\n  );\n  GltfStructuralMetadataLoader.prototype.constructor = GltfStructuralMetadataLoader;\n}\n\nObject.defineProperties(GltfStructuralMetadataLoader.prototype, {\n  /**\n   * The cache key of the resource.\n   *\n   * @memberof GltfStructuralMetadataLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    get: function () {\n      return this._cacheKey;\n    },\n  },\n  /**\n   * The parsed structural metadata\n   *\n   * @memberof GltfStructuralMetadataLoader.prototype\n   *\n   * @type {StructuralMetadata}\n   * @readonly\n   * @private\n   */\n  structuralMetadata: {\n    get: function () {\n      return this._structuralMetadata;\n    },\n  },\n});\n\nasync function loadResources(loader) {\n  try {\n    const bufferViewsPromise = loadBufferViews(loader);\n    const texturesPromise = loadTextures(loader);\n    const schemaPromise = loadSchema(loader);\n\n    await Promise.all([bufferViewsPromise, texturesPromise, schemaPromise]);\n\n    if (loader.isDestroyed()) {\n      return;\n    }\n\n    loader._gltf = undefined; // No longer need to hold onto the glTF\n\n    loader._state = ResourceLoaderState.LOADED;\n    return loader;\n  } catch (error) {\n    if (loader.isDestroyed()) {\n      return;\n    }\n\n    loader.unload();\n    loader._state = ResourceLoaderState.FAILED;\n    const errorMessage = \"Failed to load structural metadata\";\n    throw loader.getError(errorMessage, error);\n  }\n}\n\n/**\n * Loads the resource.\n * @returns {Promise<GltfStructuralMetadataLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfStructuralMetadataLoader.prototype.load = function () {\n  if (defined(this._promise)) {\n    return this._promise;\n  }\n\n  this._state = ResourceLoaderState.LOADING;\n  this._promise = loadResources(this);\n  return this._promise;\n};\n\nfunction gatherBufferViewIdsFromProperties(properties, bufferViewIdSet) {\n  for (const propertyId in properties) {\n    if (properties.hasOwnProperty(propertyId)) {\n      const property = properties[propertyId];\n      const values = property.values;\n      const arrayOffsets = property.arrayOffsets;\n      const stringOffsets = property.stringOffsets;\n\n      // Using an object like a mathematical set\n      if (defined(values)) {\n        bufferViewIdSet[values] = true;\n      }\n      if (defined(arrayOffsets)) {\n        bufferViewIdSet[arrayOffsets] = true;\n      }\n      if (defined(stringOffsets)) {\n        bufferViewIdSet[stringOffsets] = true;\n      }\n    }\n  }\n}\n\nfunction gatherBufferViewIdsFromPropertiesLegacy(properties, bufferViewIdSet) {\n  for (const propertyId in properties) {\n    if (properties.hasOwnProperty(propertyId)) {\n      const property = properties[propertyId];\n      const bufferView = property.bufferView;\n      const arrayOffsetBufferView = property.arrayOffsetBufferView;\n      const stringOffsetBufferView = property.stringOffsetBufferView;\n\n      // Using an object like a mathematical set\n      if (defined(bufferView)) {\n        bufferViewIdSet[bufferView] = true;\n      }\n      if (defined(arrayOffsetBufferView)) {\n        bufferViewIdSet[arrayOffsetBufferView] = true;\n      }\n      if (defined(stringOffsetBufferView)) {\n        bufferViewIdSet[stringOffsetBufferView] = true;\n      }\n    }\n  }\n}\n\nfunction gatherUsedBufferViewIds(extension) {\n  const propertyTables = extension.propertyTables;\n  const bufferViewIdSet = {};\n  if (defined(propertyTables)) {\n    for (let i = 0; i < propertyTables.length; i++) {\n      const propertyTable = propertyTables[i];\n      gatherBufferViewIdsFromProperties(\n        propertyTable.properties,\n        bufferViewIdSet\n      );\n    }\n  }\n  return bufferViewIdSet;\n}\n\nfunction gatherUsedBufferViewIdsLegacy(extensionLegacy) {\n  const featureTables = extensionLegacy.featureTables;\n\n  const bufferViewIdSet = {};\n  if (defined(featureTables)) {\n    for (const featureTableId in featureTables) {\n      if (featureTables.hasOwnProperty(featureTableId)) {\n        const featureTable = featureTables[featureTableId];\n        const properties = featureTable.properties;\n        if (defined(properties)) {\n          gatherBufferViewIdsFromPropertiesLegacy(properties, bufferViewIdSet);\n        }\n      }\n    }\n  }\n  return bufferViewIdSet;\n}\n\nasync function loadBufferViews(structuralMetadataLoader) {\n  let bufferViewIds;\n  if (defined(structuralMetadataLoader._extension)) {\n    bufferViewIds = gatherUsedBufferViewIds(\n      structuralMetadataLoader._extension\n    );\n  } else {\n    bufferViewIds = gatherUsedBufferViewIdsLegacy(\n      structuralMetadataLoader._extensionLegacy\n    );\n  }\n\n  // Load the buffer views\n  const bufferViewPromises = [];\n  for (const bufferViewId in bufferViewIds) {\n    if (bufferViewIds.hasOwnProperty(bufferViewId)) {\n      const bufferViewLoader = ResourceCache.getBufferViewLoader({\n        gltf: structuralMetadataLoader._gltf,\n        bufferViewId: parseInt(bufferViewId),\n        gltfResource: structuralMetadataLoader._gltfResource,\n        baseResource: structuralMetadataLoader._baseResource,\n      });\n\n      structuralMetadataLoader._bufferViewLoaders.push(bufferViewLoader);\n      structuralMetadataLoader._bufferViewIds.push(bufferViewId);\n\n      bufferViewPromises.push(bufferViewLoader.load());\n    }\n  }\n\n  return Promise.all(bufferViewPromises);\n}\n\nfunction gatherUsedTextureIds(structuralMetadataExtension) {\n  // Gather the used textures\n  const textureIds = {};\n  const propertyTextures = structuralMetadataExtension.propertyTextures;\n  if (defined(propertyTextures)) {\n    for (let i = 0; i < propertyTextures.length; i++) {\n      const propertyTexture = propertyTextures[i];\n      const properties = propertyTexture.properties;\n      if (defined(properties)) {\n        gatherTextureIdsFromProperties(properties, textureIds);\n      }\n    }\n  }\n  return textureIds;\n}\n\nfunction gatherTextureIdsFromProperties(properties, textureIds) {\n  for (const propertyId in properties) {\n    if (properties.hasOwnProperty(propertyId)) {\n      // in EXT_structural_metadata the property is a valid textureInfo.\n      const textureInfo = properties[propertyId];\n      textureIds[textureInfo.index] = textureInfo;\n    }\n  }\n}\n\nfunction gatherUsedTextureIdsLegacy(extensionLegacy) {\n  // Gather the used textures\n  const textureIds = {};\n  const featureTextures = extensionLegacy.featureTextures;\n  if (defined(featureTextures)) {\n    for (const featureTextureId in featureTextures) {\n      if (featureTextures.hasOwnProperty(featureTextureId)) {\n        const featureTexture = featureTextures[featureTextureId];\n        const properties = featureTexture.properties;\n        if (defined(properties)) {\n          gatherTextureIdsFromPropertiesLegacy(properties, textureIds);\n        }\n      }\n    }\n  }\n\n  return textureIds;\n}\n\nfunction gatherTextureIdsFromPropertiesLegacy(properties, textureIds) {\n  for (const propertyId in properties) {\n    if (properties.hasOwnProperty(propertyId)) {\n      const property = properties[propertyId];\n      const textureInfo = property.texture;\n      textureIds[textureInfo.index] = textureInfo;\n    }\n  }\n}\n\nfunction loadTextures(structuralMetadataLoader) {\n  let textureIds;\n  if (defined(structuralMetadataLoader._extension)) {\n    textureIds = gatherUsedTextureIds(structuralMetadataLoader._extension);\n  } else {\n    textureIds = gatherUsedTextureIdsLegacy(\n      structuralMetadataLoader._extensionLegacy\n    );\n  }\n\n  const gltf = structuralMetadataLoader._gltf;\n  const gltfResource = structuralMetadataLoader._gltfResource;\n  const baseResource = structuralMetadataLoader._baseResource;\n  const supportedImageFormats = structuralMetadataLoader._supportedImageFormats;\n  const frameState = structuralMetadataLoader._frameState;\n  const asynchronous = structuralMetadataLoader._asynchronous;\n\n  // Load the textures\n  const texturePromises = [];\n  for (const textureId in textureIds) {\n    if (textureIds.hasOwnProperty(textureId)) {\n      const textureLoader = ResourceCache.getTextureLoader({\n        gltf: gltf,\n        textureInfo: textureIds[textureId],\n        gltfResource: gltfResource,\n        baseResource: baseResource,\n        supportedImageFormats: supportedImageFormats,\n        frameState: frameState,\n        asynchronous: asynchronous,\n      });\n      structuralMetadataLoader._textureLoaders.push(textureLoader);\n      structuralMetadataLoader._textureIds.push(textureId);\n      texturePromises.push(textureLoader.load());\n    }\n  }\n\n  return Promise.all(texturePromises);\n}\n\nasync function loadSchema(structuralMetadataLoader) {\n  const extension = defaultValue(\n    structuralMetadataLoader._extension,\n    structuralMetadataLoader._extensionLegacy\n  );\n\n  let schemaLoader;\n  if (defined(extension.schemaUri)) {\n    const resource = structuralMetadataLoader._baseResource.getDerivedResource({\n      url: extension.schemaUri,\n    });\n    schemaLoader = ResourceCache.getSchemaLoader({\n      resource: resource,\n    });\n  } else {\n    schemaLoader = ResourceCache.getSchemaLoader({\n      schema: extension.schema,\n    });\n  }\n\n  structuralMetadataLoader._schemaLoader = schemaLoader;\n  await schemaLoader.load();\n  if (!schemaLoader.isDestroyed()) {\n    return schemaLoader.schema;\n  }\n}\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @private\n */\nGltfStructuralMetadataLoader.prototype.process = function (frameState) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"frameState\", frameState);\n  //>>includeEnd('debug');\n\n  if (this._state === ResourceLoaderState.READY) {\n    return true;\n  }\n\n  if (this._state !== ResourceLoaderState.LOADED) {\n    return false;\n  }\n\n  const textureLoaders = this._textureLoaders;\n  const textureLoadersLength = textureLoaders.length;\n  let ready = true;\n  for (let i = 0; i < textureLoadersLength; ++i) {\n    const textureLoader = textureLoaders[i];\n    const textureReady = textureLoader.process(frameState);\n    ready = ready && textureReady;\n  }\n\n  if (!ready) {\n    return false;\n  }\n\n  const schema = this._schemaLoader.schema;\n  const bufferViews = {};\n  for (let i = 0; i < this._bufferViewIds.length; ++i) {\n    const bufferViewId = this._bufferViewIds[i];\n    const bufferViewLoader = this._bufferViewLoaders[i];\n    if (!bufferViewLoader.isDestroyed()) {\n      // Copy the typed array and let the underlying ArrayBuffer be freed\n      const bufferViewTypedArray = new Uint8Array(bufferViewLoader.typedArray);\n      bufferViews[bufferViewId] = bufferViewTypedArray;\n    }\n  }\n\n  const textures = {};\n  for (let i = 0; i < this._textureIds.length; ++i) {\n    const textureId = this._textureIds[i];\n    const textureLoader = textureLoaders[i];\n    if (!textureLoader.isDestroyed()) {\n      textures[textureId] = textureLoader.texture;\n    }\n  }\n  if (defined(this._extension)) {\n    this._structuralMetadata = parseStructuralMetadata({\n      extension: this._extension,\n      schema: schema,\n      bufferViews: bufferViews,\n      textures: textures,\n    });\n  } else {\n    this._structuralMetadata = parseFeatureMetadataLegacy({\n      extension: this._extensionLegacy,\n      schema: schema,\n      bufferViews: bufferViews,\n      textures: textures,\n    });\n  }\n\n  // Buffer views can be unloaded after the data has been copied\n  unloadBufferViews(this);\n\n  this._state = ResourceLoaderState.READY;\n  return true;\n};\n\nfunction unloadBufferViews(structuralMetadataLoader) {\n  const bufferViewLoaders = structuralMetadataLoader._bufferViewLoaders;\n  const bufferViewLoadersLength = bufferViewLoaders.length;\n  for (let i = 0; i < bufferViewLoadersLength; ++i) {\n    ResourceCache.unload(bufferViewLoaders[i]);\n  }\n  structuralMetadataLoader._bufferViewLoaders.length = 0;\n  structuralMetadataLoader._bufferViewIds.length = 0;\n}\n\nfunction unloadTextures(structuralMetadataLoader) {\n  const textureLoaders = structuralMetadataLoader._textureLoaders;\n  const textureLoadersLength = textureLoaders.length;\n  for (let i = 0; i < textureLoadersLength; ++i) {\n    ResourceCache.unload(textureLoaders[i]);\n  }\n  structuralMetadataLoader._textureLoaders.length = 0;\n  structuralMetadataLoader._textureIds.length = 0;\n}\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfStructuralMetadataLoader.prototype.unload = function () {\n  unloadBufferViews(this);\n  unloadTextures(this);\n\n  if (defined(this._schemaLoader)) {\n    ResourceCache.unload(this._schemaLoader);\n  }\n  this._schemaLoader = undefined;\n\n  this._structuralMetadata = undefined;\n};\n\nexport default GltfStructuralMetadataLoader;\n", "import Check from \"../Core/Check.js\";\n\n/**\n * An enum describing the built-in instance attribute semantics.\n *\n * @enum {string}\n *\n * @private\n */\nconst InstanceAttributeSemantic = {\n  /**\n   * Per-instance translation.\n   *\n   * @type {string}\n   * @constant\n   */\n  TRANSLATION: \"TRANSLATION\",\n\n  /**\n   * Per-instance rotation.\n   *\n   * @type {string}\n   * @constant\n   */\n  ROTATION: \"ROTATION\",\n\n  /**\n   * Per-instance scale.\n   *\n   * @type {string}\n   * @constant\n   */\n  SCALE: \"SCALE\",\n\n  /**\n   * Per-instance feature ID.\n   *\n   * @type {string}\n   * @constant\n   */\n  FEATURE_ID: \"_FEATURE_ID\",\n};\n\n/**\n * Gets the instance attribute semantic matching the glTF attribute semantic.\n *\n * @returns {InstanceAttributeSemantic} The instance attribute semantic, or undefined if there is no match.\n *\n * @private\n */\nInstanceAttributeSemantic.fromGltfSemantic = function (gltfSemantic) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"gltfSemantic\", gltfSemantic);\n  //>>includeEnd('debug')\n\n  let semantic = gltfSemantic;\n\n  // Strip the set index from the semantic\n  const setIndexRegex = /^(\\w+)_\\d+$/;\n  const setIndexMatch = setIndexRegex.exec(gltfSemantic);\n  if (setIndexMatch !== null) {\n    semantic = setIndexMatch[1];\n  }\n\n  switch (semantic) {\n    case \"TRANSLATION\":\n      return InstanceAttributeSemantic.TRANSLATION;\n    case \"ROTATION\":\n      return InstanceAttributeSemantic.ROTATION;\n    case \"SCALE\":\n      return InstanceAttributeSemantic.SCALE;\n    case \"_FEATURE_ID\":\n      return InstanceAttributeSemantic.FEATURE_ID;\n  }\n\n  return undefined;\n};\n\nexport default Object.freeze(InstanceAttributeSemantic);\n", "import Check from \"../../Core/Check.js\";\nimport defined from \"../../Core/defined.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport PixelFormat from \"../../Core/PixelFormat.js\";\nimport ContextLimits from \"../../Renderer/ContextLimits.js\";\nimport Sampler from \"../../Renderer/Sampler.js\";\nimport Texture from \"../../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../../Renderer/TextureWrap.js\";\n\n// glTF does not allow an index value of 65535 because this is the primitive\n// restart value in some APIs.\nconst MAX_GLTF_UINT16_INDEX = 65534;\nconst MAX_GLTF_UINT8_INDEX = 255;\n\n/**\n * A class to handle the low-level details of processing indices and vertex\n * attributes for the CESIUM_primitive_outline extension.\n * <p>\n * To render outlines, a lookup texture is used 3 times, once per edge of a\n * triangle. In order to render correctly, all three vertices must agree on the\n * same ordering of the three edges when computing outline (texture)\n * coordinates. Sometimes this is not possible, as a vertex shared between\n * multiple triangles may become overly constrained. In such cases, vertices are\n * copied and indices are updated until valid outline coordinates can be\n * defined.\n * </p>\n *\n * @see {@link https://www.researchgate.net/publication/220067637_Fast_and_versatile_texture-based_wireframe_rendering|Fast and versatile texture-based wireframe rendering}\n *\n * @alias PrimitiveOutlineGenerator\n * @constructor\n *\n * @param {number} options Object with the following properties:\n * @param {Uint8Array|Uint16Array|Uint32Array} options.triangleIndices The original triangle indices of the primitive. The constructor takes ownership of this typed array as it will be modified internally. Use the updatedTriangleIndices getter to get the final result.\n * @param {number[]} options.outlineIndices The indices of edges in the triangle from the CESIUM_primitive_outline extension\n * @param {number} options.originalVertexCount The original number of vertices in the primitive\n * @example\n * // The constructor will compute the updated indices and generate outline\n * // coordinates.\n * const outlineGenerator = new PrimitiveOutlineGenerator({\n *   triangleIndices: primitive.indices.typedArray,\n *   outlineIndices: outlineIndices,\n *   originalVertexCount: primitive.attributes[0].count\n * });\n *\n * // Caller must update the indices (the data type may have been upgraded!)\n * primitive.indices.typedArray = outlineGenerator.updatedTriangleIndices;\n * primitive.indices.indexDatatype =\n *  IndexDatatype.fromTypedArray(primitive.indices.typedArray);\n *\n * // Create a new attribute for the generated outline coordinates\n * primitive.outlineCoordinates = new ModelComponents.Attribute();\n * // ... initialize as a vec3 attribute\n * primitive.outlineCoordinates.typedArray =\n *   outlineGenerator.outlineCoordinates;\n *\n * // Updating an attribute\n * const attribute = primitive.attributes[i];\n * attribute.typedArray = outlineGenerator.updateAttribute(\n *   attribute.typedArray\n * );\n *\n * @private\n */\nfunction PrimitiveOutlineGenerator(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const triangleIndices = options.triangleIndices;\n  const outlineIndices = options.outlineIndices;\n  const originalVertexCount = options.originalVertexCount;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.triangleIndices\", triangleIndices);\n  Check.typeOf.object(\"options.outlineIndices\", outlineIndices);\n  Check.typeOf.number(\"options.originalVertexCount\", originalVertexCount);\n  //>>includeEnd('debug');\n\n  /**\n   * The triangle indices. It will be modified in place.\n   *\n   * @type {Uint8Array|Uint16Array|Uint32Array}\n   *\n   * @private\n   */\n  this._triangleIndices = triangleIndices;\n\n  /**\n   * How many vertices were originally in the primitive\n   *\n   * @type {number}\n   *\n   * @private\n   */\n  this._originalVertexCount = originalVertexCount;\n\n  /**\n   * The outline indices represent edges of the primitive's triangle mesh where\n   * outlines must be drawn. This is stored as a hash set for efficient\n   * checks of whether an edge is present.\n   *\n   * @type {EdgeSet}\n   *\n   * @private\n   */\n  this._edges = new EdgeSet(outlineIndices, originalVertexCount);\n\n  /**\n   * The typed array that will store the outline texture coordinates\n   * once computed. This typed array should be turned into a vertex attribute\n   * when rendering outlines.\n   *\n   * @type {Float32Array}\n   *\n   * @private\n   */\n  this._outlineCoordinatesTypedArray = undefined;\n\n  /**\n   * Array containing the indices of any vertices that must be copied and\n   * appended to the list.\n   *\n   * @type {number[]}\n   *\n   * @private\n   */\n  this._extraVertices = [];\n\n  initialize(this);\n}\n\nObject.defineProperties(PrimitiveOutlineGenerator.prototype, {\n  /**\n   * The updated triangle indices after generating outlines. The caller is for\n   * responsible for updating the primitive's indices to use this array.\n   *\n   * @memberof PrimitiveOutlineGenerator.prototype\n   *\n   * @type {Uint8Array|Uint16Array|Uint32Array}\n   * @readonly\n   *\n   * @private\n   */\n  updatedTriangleIndices: {\n    get: function () {\n      return this._triangleIndices;\n    },\n  },\n\n  /**\n   * The computed outline coordinates. The caller is responsible for\n   * turning this into a vec3 attribute for rendering.\n   *\n   * @memberof PrimitiveOutlineGenerator.prototype\n   *\n   * @type {Float32Array}\n   * @readonly\n   *\n   * @private\n   */\n  outlineCoordinates: {\n    get: function () {\n      return this._outlineCoordinatesTypedArray;\n    },\n  },\n});\n\n/**\n * Initialize the outline generator from the CESIUM_primitive_outline\n * extension data. This updates the triangle indices and generates outline\n * coordinates, but does not update other attributes (see\n * {@link PrimitiveOutlineGenerator#updateAttribute})\n *\n * @param {PrimitiveOutlineGenerator} outlineGenerator The outline generator\n *\n * @private\n */\nfunction initialize(outlineGenerator) {\n  // triangle indices may be extended from 16-bits to 32 bits if needed.\n  let triangleIndices = outlineGenerator._triangleIndices;\n\n  const edges = outlineGenerator._edges;\n  const outlineCoordinates = [];\n  const extraVertices = outlineGenerator._extraVertices;\n  const vertexCount = outlineGenerator._originalVertexCount;\n\n  // Dictionary of unmatchable vertex index -> copied vertex index. This is\n  // used so we don't copy the same vertex more than necessary.\n  const vertexCopies = {};\n\n  // For each triangle, adjust vertex data so that the correct edges are outlined.\n  for (let i = 0; i < triangleIndices.length; i += 3) {\n    let i0 = triangleIndices[i];\n    let i1 = triangleIndices[i + 1];\n    let i2 = triangleIndices[i + 2];\n\n    // Check which edges need to be outlined based on the contents of the\n    // outline indices from the extension.\n    const all = false; // set this to true to draw a full wireframe.\n    const hasEdge01 = all || edges.hasEdge(i0, i1);\n    const hasEdge12 = all || edges.hasEdge(i1, i2);\n    const hasEdge20 = all || edges.hasEdge(i2, i0);\n\n    // Attempt to compute outline coordinates. If no consistent ordering of\n    // edges can be computed (due to constraints from adjacent faces), the\n    // first attempt may fail. In such cases, make a copy of a vertex and\n    // try again. This relaxes the constraints, so the while loop will\n    // eventually finish.\n    let unmatchableVertexIndex = matchAndStoreCoordinates(\n      outlineCoordinates,\n      i0,\n      i1,\n      i2,\n      hasEdge01,\n      hasEdge12,\n      hasEdge20\n    );\n    while (defined(unmatchableVertexIndex)) {\n      // Copy the unmatchable index and try again.\n      let copy = vertexCopies[unmatchableVertexIndex];\n\n      // Only copy if we haven't already\n      if (!defined(copy)) {\n        // The new vertex will appear at the end of the vertex list\n        copy = vertexCount + extraVertices.length;\n\n        // Sometimes the copied vertex will in turn be a copy, so search\n        // for the original one\n        let original = unmatchableVertexIndex;\n        while (original >= vertexCount) {\n          original = extraVertices[original - vertexCount];\n        }\n\n        // Store the original vertex that needs to be copied\n        extraVertices.push(original);\n\n        // mark that we've seen this unmatchable vertex before so we don't\n        // copy it multiple times.\n        vertexCopies[unmatchableVertexIndex] = copy;\n      }\n\n      // Corner case: copying a vertex may overflow the range of an\n      // 8- or 16- bit index buffer, so upgrade to a larger data type.\n      if (\n        copy > MAX_GLTF_UINT16_INDEX &&\n        (triangleIndices instanceof Uint16Array ||\n          triangleIndices instanceof Uint8Array)\n      ) {\n        triangleIndices = new Uint32Array(triangleIndices);\n      } else if (\n        copy > MAX_GLTF_UINT8_INDEX &&\n        triangleIndices instanceof Uint8Array\n      ) {\n        triangleIndices = new Uint16Array(triangleIndices);\n      }\n\n      // Update the triangle indices buffer to use the copied vertex instead\n      // of the original one.\n      if (unmatchableVertexIndex === i0) {\n        i0 = copy;\n        triangleIndices[i] = copy;\n      } else if (unmatchableVertexIndex === i1) {\n        i1 = copy;\n        triangleIndices[i + 1] = copy;\n      } else {\n        i2 = copy;\n        triangleIndices[i + 2] = copy;\n      }\n\n      // Attempt to generate outline coordinates again. This is more likely\n      // to succeed since the copied vertex has no constraints on which order\n      // of the 3 edges to use.\n      unmatchableVertexIndex = matchAndStoreCoordinates(\n        outlineCoordinates,\n        i0,\n        i1,\n        i2,\n        hasEdge01,\n        hasEdge12,\n        hasEdge20\n      );\n    }\n  }\n\n  // Store the triangle indices in case we had to expand to 32-bit indices\n  outlineGenerator._triangleIndices = triangleIndices;\n  outlineGenerator._outlineCoordinatesTypedArray = new Float32Array(\n    outlineCoordinates\n  );\n}\n\n/**\n * This function attempts to compute a valid ordering of edges for this triangle\n * and if found, computes outline coordinates for the three vertices. If not\n * possible, one of the vertices is returned so it can be copied.\n *\n * @param {number[]} outlineCoordinates An array to store the computed outline coordinates. There are 3 components per vertex. This will be modified in place.\n * @param {number} i0 The index of the first vertex of the triangle.\n * @param {number} i1 The index of the second vertex of the triangle.\n * @param {number} i2 The index of the third vertex of the triangle.\n * @param {boolean} hasEdge01 Whether there is an outline edge between vertices 0 and 1 of the triangle\n * @param {boolean} hasEdge12 Whether there is an outline edge between vertices 1 and 2 of the triangle\n * @param {boolean} hasEdge20 Whether there is an outline edge between vertices 2 and 0 of the triangle\n * @returns {number} If it's not possible to compute consistent outline coordinates for this triangle, the index of the most constrained vertex of i0, i1 and i2 is returned. Otherwise, this function returns undefined to indicate a successful match.\n *\n * @private\n */\nfunction matchAndStoreCoordinates(\n  outlineCoordinates,\n  i0,\n  i1,\n  i2,\n  hasEdge01,\n  hasEdge12,\n  hasEdge20\n) {\n  const a0 = hasEdge20 ? 1.0 : 0.0;\n  const b0 = hasEdge01 ? 1.0 : 0.0;\n  const c0 = 0.0;\n\n  const i0Mask = computeOrderMask(outlineCoordinates, i0, a0, b0, c0);\n  if (i0Mask === 0) {\n    return i0;\n  }\n\n  const a1 = 0.0;\n  const b1 = hasEdge01 ? 1.0 : 0.0;\n  const c1 = hasEdge12 ? 1.0 : 0.0;\n\n  const i1Mask = computeOrderMask(outlineCoordinates, i1, a1, b1, c1);\n  if (i1Mask === 0) {\n    return i1;\n  }\n\n  const a2 = hasEdge20 ? 1.0 : 0.0;\n  const b2 = 0.0;\n  const c2 = hasEdge12 ? 1.0 : 0.0;\n\n  const i2Mask = computeOrderMask(outlineCoordinates, i2, a2, b2, c2);\n  if (i2Mask === 0) {\n    return i2;\n  }\n\n  const workingOrders = i0Mask & i1Mask & i2Mask;\n\n  let a, b, c;\n\n  if (workingOrders & (1 << 0)) {\n    // 0 - abc\n    a = 0;\n    b = 1;\n    c = 2;\n  } else if (workingOrders & (1 << 1)) {\n    // 1 - acb\n    a = 0;\n    c = 1;\n    b = 2;\n  } else if (workingOrders & (1 << 2)) {\n    // 2 - bac\n    b = 0;\n    a = 1;\n    c = 2;\n  } else if (workingOrders & (1 << 3)) {\n    // 3 - bca\n    b = 0;\n    c = 1;\n    a = 2;\n  } else if (workingOrders & (1 << 4)) {\n    // 4 - cab\n    c = 0;\n    a = 1;\n    b = 2;\n  } else if (workingOrders & (1 << 5)) {\n    // 5 - cba\n    c = 0;\n    b = 1;\n    a = 2;\n  } else {\n    // No ordering works. Report the most constrained vertex (i.e. the one with\n    // fewest valid orderings) as unmatched so we copy that one.\n    const i0ValidOrderCount = popcount6Bit(i0Mask);\n    const i1ValidOrderCount = popcount6Bit(i1Mask);\n    const i2ValidOrderCount = popcount6Bit(i2Mask);\n    if (\n      i0ValidOrderCount < i1ValidOrderCount &&\n      i0ValidOrderCount < i2ValidOrderCount\n    ) {\n      return i0;\n    } else if (i1ValidOrderCount < i2ValidOrderCount) {\n      return i1;\n    }\n    return i2;\n  }\n\n  // We found a valid ordering of the edges, so store the outline coordinates\n  // for this triangle.\n  const i0Start = i0 * 3;\n  outlineCoordinates[i0Start + a] = a0;\n  outlineCoordinates[i0Start + b] = b0;\n  outlineCoordinates[i0Start + c] = c0;\n\n  const i1Start = i1 * 3;\n  outlineCoordinates[i1Start + a] = a1;\n  outlineCoordinates[i1Start + b] = b1;\n  outlineCoordinates[i1Start + c] = c1;\n\n  const i2Start = i2 * 3;\n  outlineCoordinates[i2Start + a] = a2;\n  outlineCoordinates[i2Start + b] = b2;\n  outlineCoordinates[i2Start + c] = c2;\n\n  // successful match\n  return undefined;\n}\n\n/**\n * Each vertex has three coordinates, a, b, and c.\n * a is the coordinate that applies to edge 2-0 for the vertex.\n * b is the coordinate that applies to edge 0-1 for the vertex.\n * c is the coordinate that applies to edge 1-2 for the vertex.\n *\n * A single triangle with all edges highlighted:\n *\n *                 | a | b | c |\n *                 | 1 | 1 | 0 |\n *                       0\n *                      / \\\n *                     /   \\\n *           edge 0-1 /     \\ edge 2-0\n *                   /       \\\n *                  /         \\\n * | a | b | c |   1-----------2   | a | b | c |\n * | 0 | 1 | 1 |     edge 1-2      | 1 | 0 | 1 |\n *\n * There are 6 possible orderings of coordinates a, b, and c:\n * 0 - abc\n * 1 - acb\n * 2 - bac\n * 3 - bca\n * 4 - cab\n * 5 - cba\n *\n * All vertices must use the _same ordering_ for the edges to be rendered\n * correctly. So we compute a bitmask for each vertex, where the bit at\n * each position indicates whether that ordering works (i.e. doesn't\n * conflict with already-assigned coordinates) for that vertex.\n *\n * Then we can find an ordering that works for all three vertices with a\n * bitwise AND.\n *\n * @param {number[]} outlineCoordinates The array of outline coordinates\n * @param {number} vertexIndex The index of the vertex to compute the mask for\n * @param {number} a The outline coordinate for edge 2-0\n * @param {number} b The outline coordinate for edge 0-1\n * @param {number} c The outline coordinate for edge 1-2\n * @returns {number} A bitmask with 6 bits where a 1 indicates the corresponding ordering is valid.\n *\n * @private\n */\nfunction computeOrderMask(outlineCoordinates, vertexIndex, a, b, c) {\n  const startIndex = vertexIndex * 3;\n  const first = outlineCoordinates[startIndex];\n  const second = outlineCoordinates[startIndex + 1];\n  const third = outlineCoordinates[startIndex + 2];\n\n  // If one coordinate is undefined, they all are since matchAndStoreCoordinates sets\n  // all 3 components at once. In this case, all orderings are fine.\n  if (!defined(first)) {\n    return 0b111111;\n  }\n\n  return (\n    ((first === a && second === b && third === c) << 0) |\n    ((first === a && second === c && third === b) << 1) |\n    ((first === b && second === a && third === c) << 2) |\n    ((first === b && second === c && third === a) << 3) |\n    ((first === c && second === a && third === b) << 4) |\n    ((first === c && second === b && third === a) << 5)\n  );\n}\n\n/**\n * Compute the popcount for 6-bit integers (values 0-63). This is the\n * number of 1s in the binary representation of the value.\n *\n * @param {number} value The value to compute the popcount for\n * @returns {number} The number of 1s in the binary representation of value\n *\n * @private\n */\nfunction popcount6Bit(value) {\n  return (\n    (value & 1) +\n    ((value >> 1) & 1) +\n    ((value >> 2) & 1) +\n    ((value >> 3) & 1) +\n    ((value >> 4) & 1) +\n    ((value >> 5) & 1)\n  );\n}\n\n/**\n * After computing the outline coordinates, some vertices may need to be\n * copied and appended to the end of the list of vertices. This function updates\n * a typed array for a single attribute (e.g. POSITION or NORMAL).\n *\n * @param {Uint8Array|Int8Array|Uint16Array|Int16Array|Uint32Array|Int32Array|Float32Array} attributeTypedArray The attribute values to update. This function takes ownership of this typed array\n * @returns {Uint8Array|Int8Array|Uint16Array|Int16Array|Uint32Array|Int32Array|Float32Array} A new typed array that contains the existing attribute values, plus any copied values at the end.\n *\n * @private\n */\nPrimitiveOutlineGenerator.prototype.updateAttribute = function (\n  attributeTypedArray\n) {\n  const extraVertices = this._extraVertices;\n\n  const originalLength = attributeTypedArray.length;\n\n  // This is a stride in number of typed elements. For example, a VEC3 would\n  // have a stride of 3 (floats)\n  const stride = originalLength / this._originalVertexCount;\n\n  const extraVerticesLength = extraVertices.length;\n\n  // Make a larger typed array of the same type as the input\n  const ArrayType = attributeTypedArray.constructor;\n  const result = new ArrayType(\n    attributeTypedArray.length + extraVerticesLength * stride\n  );\n\n  // Copy original vertices\n  result.set(attributeTypedArray);\n\n  // Copy the vertices added for outlining\n  for (let i = 0; i < extraVerticesLength; i++) {\n    const sourceIndex = extraVertices[i] * stride;\n    const resultIndex = originalLength + i * stride;\n    for (let j = 0; j < stride; j++) {\n      result[resultIndex + j] = result[sourceIndex + j];\n    }\n  }\n\n  return result;\n};\n\n/**\n * Create a mip-mapped lookup texture for rendering outlines. The texture is\n * constant, so it is cached on the context.\n *\n * @param {Context} context The context to use for creating the texture\n * @returns {Texture} The outline lookup texture.\n *\n * @private\n */\nPrimitiveOutlineGenerator.createTexture = function (context) {\n  let cache = context.cache.modelOutliningCache;\n  if (!defined(cache)) {\n    cache = context.cache.modelOutliningCache = {};\n  }\n\n  if (defined(cache.outlineTexture)) {\n    return cache.outlineTexture;\n  }\n\n  const maxSize = Math.min(4096, ContextLimits.maximumTextureSize);\n\n  let size = maxSize;\n  const levelZero = createMipLevel(size);\n\n  const mipLevels = [];\n\n  while (size > 1) {\n    size >>= 1;\n    mipLevels.push(createMipLevel(size));\n  }\n\n  const texture = new Texture({\n    context: context,\n    source: {\n      arrayBufferView: levelZero,\n      mipLevels: mipLevels,\n    },\n    width: maxSize,\n    height: 1,\n    pixelFormat: PixelFormat.LUMINANCE,\n    sampler: new Sampler({\n      wrapS: TextureWrap.CLAMP_TO_EDGE,\n      wrapT: TextureWrap.CLAMP_TO_EDGE,\n      minificationFilter: TextureMinificationFilter.LINEAR_MIPMAP_LINEAR,\n      magnificationFilter: TextureMagnificationFilter.LINEAR,\n    }),\n  });\n\n  cache.outlineTexture = texture;\n\n  return texture;\n};\n\n/**\n * Create an outline lookup texture for a single mip level. This is a texture of\n * mostly 0 values, except for the last value which is brighter to indicate\n * the outline.\n *\n * @param {number} size The width of the texture for this mip level\n * @returns {Uint8Array} A typed array containing the texels of the mip level\n *\n * @private\n */\nfunction createMipLevel(size) {\n  const texture = new Uint8Array(size);\n\n  // This lookup texture creates an outline with width 0.75 px in screen space.\n  texture[size - 1] = 192;\n\n  // As we reach the top of the mip pyramid, a single set pixel becomes a\n  // significant portion of the texture. This doesn't look great when zoomed\n  // out, so attenuate the value by 50% at each level.\n  if (size === 8) {\n    texture[size - 1] = 96;\n  } else if (size === 4) {\n    texture[size - 1] = 48;\n  } else if (size === 2) {\n    texture[size - 1] = 24;\n  } else if (size === 1) {\n    texture[size - 1] = 12;\n  }\n  return texture;\n}\n\n/**\n * A hash set that provides quick lookups of whether an edge exists between\n * two vertices.\n *\n * @alias EdgeSet\n * @constructor\n *\n * @param {number[]} edgeIndices An array of vertex indices with an even number of elements where each pair of indices defines an edge.\n * @param {number} originalVertexCount The original number of vertices. This is used for computing a hash function.\n *\n * @private\n */\nfunction EdgeSet(edgeIndices, originalVertexCount) {\n  /**\n   * Original number of vertices in the primitive. This is used for computing\n   * the hash key\n   *\n   * @type {number}\n   *\n   * @private\n   */\n  this._originalVertexCount = originalVertexCount;\n\n  /**\n   * The internal hash set used to store the edges. Edges are hashed as follows:\n   * <p>\n   * smallerVertexIndex * originalVertexCount + biggerVertexIndex\n   * <p>\n   * @type {Set}\n   *\n   * @private\n   */\n  this._edges = new Set();\n  for (let i = 0; i < edgeIndices.length; i += 2) {\n    const a = edgeIndices[i];\n    const b = edgeIndices[i + 1];\n    const small = Math.min(a, b);\n    const big = Math.max(a, b);\n    const hash = small * this._originalVertexCount + big;\n    this._edges.add(hash);\n  }\n}\n\n/**\n * Check if an edge exists in the set. The order of the input vertices does\n * not matter.\n * @param {number} a The first index\n * @param {number} b The second index\n * @returns {boolean} true if there is an edge between a and b\n *\n * @private\n */\nEdgeSet.prototype.hasEdge = function (a, b) {\n  const small = Math.min(a, b);\n  const big = Math.max(a, b);\n  const hash = small * this._originalVertexCount + big;\n  return this._edges.has(hash);\n};\n\nexport default PrimitiveOutlineGenerator;\n", "import Check from \"../Core/Check.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defined from \"../Core/defined.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport AttributeType from \"./AttributeType.js\";\nimport ModelComponents from \"./ModelComponents.js\";\nimport PrimitiveOutlineGenerator from \"./Model/PrimitiveOutlineGenerator.js\";\n\n/**\n * Simple struct for tracking whether an attribute will be loaded as a buffer\n * or typed array after post-processing.\n *\n * @alias PrimitiveLoadPlan.AttributeLoadPlan\n * @constructor\n *\n * @param {ModelComponents.Attribute} attribute The attribute to be updated\n *\n * @private\n */\nfunction AttributeLoadPlan(attribute) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"attribute\", attribute);\n  //>>includeEnd('debug');\n\n  /**\n   * The attribute to track.\n   *\n   * @type {ModelComponents.Attribute}\n   * @readonly\n   * @private\n   */\n  this.attribute = attribute;\n\n  /**\n   * Whether the attribute will be loaded as a GPU buffer by the time\n   * {@link PrimitiveLoadPlan#postProcess} is finished.\n   *\n   * @type {boolean}\n   * @private\n   */\n  this.loadBuffer = false;\n\n  /**\n   * Whether the attribute will be loaded as a packed typed array by the time\n   * {@link PrimitiveLoadPlan#postProcess} is finished.\n   *\n   * @type {boolean}\n   * @private\n   */\n  this.loadTypedArray = false;\n}\n\n/**\n * Simple struct for tracking whether an index buffer will be loaded as a buffer\n * or typed array after post-processing.\n *\n * @alias PrimitiveLoadPlan.IndicesLoadPlan\n * @constructor\n *\n * @param {ModelComponents.Indices} indices The indices to be updated\n *\n * @private\n */\nfunction IndicesLoadPlan(indices) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"indices\", indices);\n  //>>includeEnd('debug');\n\n  /**\n   * The indices to track.\n   *\n   * @type {ModelComponents.Indices}\n   * @readonly\n   * @private\n   */\n  this.indices = indices;\n\n  /**\n   * Whether the indices will be loaded as a GPU buffer by the time\n   * {@link PrimitiveLoadPlan#postProcess} is finished.\n   *\n   * @type {boolean}\n   * @private\n   */\n  this.loadBuffer = false;\n\n  /**\n   * Whether the indices will be loaded as a typed array copy of the GPU\n   * buffer by the time {@link PrimitiveLoadPlan#postProcess} is finished.\n   *\n   * @type {boolean}\n   * @private\n   */\n  this.loadTypedArray = false;\n}\n\n/**\n * Primitives may need post-processing steps after their attributes and indices\n * have loaded, such as generating outlines for the CESIUM_primitive_outline glTF\n * extension. This object tracks what indices and attributes need to be\n * post-processed.\n *\n * @alias PrimitiveLoadPlan\n * @constructor\n *\n * @param {ModelComponents.Primitive} primitive The primitive to track\n *\n * @private\n */\nfunction PrimitiveLoadPlan(primitive) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"primitive\", primitive);\n  //>>includeEnd('debug');\n\n  /**\n   * The primitive to track.\n   *\n   * @type {ModelComponents.Primitive}\n   * @readonly\n   * @private\n   */\n  this.primitive = primitive;\n\n  /**\n   * A flat list of attributes that need to be post-processed. This includes\n   * both regular attributes and morph target attributes.\n   *\n   * @type {PrimitiveLoadPlan.AttributeLoadPlan[]}\n   * @private\n   */\n  this.attributePlans = [];\n\n  /**\n   * Information about the triangle indices that need to be post-processed,\n   * if they exist.\n   *\n   * @type {PrimitiveLoadPlan.IndicesLoadPlan}\n   * @private\n   */\n  this.indicesPlan = undefined;\n\n  /**\n   * Set this true to indicate that the primitive has the\n   * CESIUM_primitive_outline extension and needs to be post-processed\n   *\n   * @type {boolean}\n   * @private\n   */\n  this.needsOutlines = false;\n\n  /**\n   * The outline edge indices from the CESIUM_primitive_outline extension\n   *\n   * @type {number[]}\n   * @private\n   */\n  this.outlineIndices = undefined;\n}\n\n/**\n * Apply post-processing steps that may modify geometry such as generating\n * outline coordinates. If no post-processing steps are needed, this function\n * is a no-op.\n *\n * @param {Context} context The context for generating buffers on the GPU\n */\nPrimitiveLoadPlan.prototype.postProcess = function (context) {\n  // Handle CESIUM_primitive_outline. This modifies indices and attributes and\n  // also generates a new attribute for the outline coordinates. These steps\n  // are synchronous.\n  if (this.needsOutlines) {\n    generateOutlines(this);\n    generateBuffers(this, context);\n  }\n};\n\nfunction generateOutlines(loadPlan) {\n  const primitive = loadPlan.primitive;\n  const indices = primitive.indices;\n\n  const vertexCount = primitive.attributes[0].count;\n\n  const generator = new PrimitiveOutlineGenerator({\n    triangleIndices: indices.typedArray,\n    outlineIndices: loadPlan.outlineIndices,\n    originalVertexCount: vertexCount,\n  });\n\n  // The generator modifies/adds indices. In some uncommon cases it may have\n  // to upgrade to 16- or 32-bit indices so the datatype may change.\n  indices.typedArray = generator.updatedTriangleIndices;\n  indices.indexDatatype = IndexDatatype.fromTypedArray(indices.typedArray);\n\n  // The outline generator creates a new attribute for the outline coordinates\n  // that are used with a lookup texture.\n  const outlineCoordinates = makeOutlineCoordinatesAttribute(\n    generator.outlineCoordinates\n  );\n  const outlineCoordinatesPlan = new AttributeLoadPlan(outlineCoordinates);\n  outlineCoordinatesPlan.loadBuffer = true;\n  outlineCoordinatesPlan.loadTypedArray = false;\n  loadPlan.attributePlans.push(outlineCoordinatesPlan);\n  primitive.outlineCoordinates = outlineCoordinatesPlan.attribute;\n\n  // Some vertices may be copied due to the addition of the new attribute\n  // which may have multiple values at a vertex depending on the face\n  const attributePlans = loadPlan.attributePlans;\n  const attributesLength = loadPlan.attributePlans.length;\n  for (let i = 0; i < attributesLength; i++) {\n    const attribute = attributePlans[i].attribute;\n    attribute.typedArray = generator.updateAttribute(attribute.typedArray);\n  }\n}\n\nfunction makeOutlineCoordinatesAttribute(outlineCoordinatesTypedArray) {\n  const attribute = new ModelComponents.Attribute();\n  attribute.name = \"_OUTLINE_COORDINATES\";\n  attribute.typedArray = outlineCoordinatesTypedArray;\n  attribute.componentDatatype = ComponentDatatype.FLOAT;\n  attribute.type = AttributeType.VEC3;\n  attribute.normalized = false;\n  attribute.count = outlineCoordinatesTypedArray.length / 3;\n\n  return attribute;\n}\n\nfunction generateBuffers(loadPlan, context) {\n  generateAttributeBuffers(loadPlan.attributePlans, context);\n\n  if (defined(loadPlan.indicesPlan)) {\n    generateIndexBuffers(loadPlan.indicesPlan, context);\n  }\n}\n\nfunction generateAttributeBuffers(attributePlans, context) {\n  const attributesLength = attributePlans.length;\n  for (let i = 0; i < attributesLength; i++) {\n    const attributePlan = attributePlans[i];\n    const attribute = attributePlan.attribute;\n    const typedArray = attribute.typedArray;\n\n    if (attributePlan.loadBuffer) {\n      const buffer = Buffer.createVertexBuffer({\n        typedArray: typedArray,\n        context: context,\n        usage: BufferUsage.STATIC_DRAW,\n      });\n      buffer.vertexArrayDestroyable = false;\n      attribute.buffer = buffer;\n    }\n\n    if (!attributePlan.loadTypedArray) {\n      attribute.typedArray = undefined;\n    }\n  }\n}\n\nfunction generateIndexBuffers(indicesPlan, context) {\n  const indices = indicesPlan.indices;\n  if (indicesPlan.loadBuffer) {\n    const buffer = Buffer.createIndexBuffer({\n      typedArray: indices.typedArray,\n      context: context,\n      usage: BufferUsage.STATIC_DRAW,\n      indexDatatype: indices.indexDatatype,\n    });\n    indices.buffer = buffer;\n    buffer.vertexArrayDestroyable = false;\n  }\n\n  if (!indicesPlan.loadTypedArray) {\n    indices.typedArray = undefined;\n  }\n}\n\nPrimitiveLoadPlan.AttributeLoadPlan = AttributeLoadPlan;\nPrimitiveLoadPlan.IndicesLoadPlan = IndicesLoadPlan;\nexport default PrimitiveLoadPlan;\n", "import defaultValue from \"../Core/defaultValue.js\";\n\n/**\n * Image formats supported by the browser.\n *\n * @param {object} [options] Object with the following properties:\n * @param {boolean} [options.webp=false] Whether the browser supports WebP images.\n * @param {boolean} [options.basis=false] Whether the browser supports compressed textures required to view KTX2 + Basis Universal images.\n *\n * @private\n */\nfunction SupportedImageFormats(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  this.webp = defaultValue(options.webp, false);\n  this.basis = defaultValue(options.basis, false);\n}\n\nexport default SupportedImageFormats;\n", "import ArticulationStageType from \"../Core/ArticulationStageType.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Check from \"../Core/Check.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport InterpolationType from \"../Core/InterpolationType.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport getAccessorByteStride from \"./GltfPipeline/getAccessorByteStride.js\";\nimport getComponentReader from \"./GltfPipeline/getComponentReader.js\";\nimport numberOfComponentsForType from \"./GltfPipeline/numberOfComponentsForType.js\";\nimport GltfStructuralMetadataLoader from \"./GltfStructuralMetadataLoader.js\";\nimport AttributeType from \"./AttributeType.js\";\nimport Axis from \"./Axis.js\";\nimport GltfLoaderUtil from \"./GltfLoaderUtil.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport InstanceAttributeSemantic from \"./InstanceAttributeSemantic.js\";\nimport ModelComponents from \"./ModelComponents.js\";\nimport PrimitiveLoadPlan from \"./PrimitiveLoadPlan.js\";\nimport ResourceCache from \"./ResourceCache.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport SupportedImageFormats from \"./SupportedImageFormats.js\";\nimport VertexAttributeSemantic from \"./VertexAttributeSemantic.js\";\n\nconst Attribute = ModelComponents.Attribute;\nconst Indices = ModelComponents.Indices;\nconst FeatureIdAttribute = ModelComponents.FeatureIdAttribute;\nconst FeatureIdTexture = ModelComponents.FeatureIdTexture;\nconst FeatureIdImplicitRange = ModelComponents.FeatureIdImplicitRange;\nconst MorphTarget = ModelComponents.MorphTarget;\nconst Primitive = ModelComponents.Primitive;\nconst Instances = ModelComponents.Instances;\nconst Skin = ModelComponents.Skin;\nconst Node = ModelComponents.Node;\nconst AnimatedPropertyType = ModelComponents.AnimatedPropertyType;\nconst AnimationSampler = ModelComponents.AnimationSampler;\nconst AnimationTarget = ModelComponents.AnimationTarget;\nconst AnimationChannel = ModelComponents.AnimationChannel;\nconst Animation = ModelComponents.Animation;\nconst ArticulationStage = ModelComponents.ArticulationStage;\nconst Articulation = ModelComponents.Articulation;\nconst Asset = ModelComponents.Asset;\nconst Scene = ModelComponents.Scene;\nconst Components = ModelComponents.Components;\nconst MetallicRoughness = ModelComponents.MetallicRoughness;\nconst SpecularGlossiness = ModelComponents.SpecularGlossiness;\nconst Material = ModelComponents.Material;\n\n/**\n * States of the glTF loading process. These states also apply to\n * asynchronous texture loading unless otherwise noted\n *\n * @enum {number}\n *\n * @private\n */\nconst GltfLoaderState = {\n  /**\n   * The initial state of the glTF loader before load() is called.\n   *\n   * @type {number}\n   * @constant\n   *\n   * @private\n   */\n  NOT_LOADED: 0,\n  /**\n   * The state of the loader while waiting for the glTF JSON loader promise\n   * to resolve.\n   *\n   * @type {number}\n   * @constant\n   *\n   * @private\n   */\n  LOADING: 1,\n  /**\n   * The state of the loader once the glTF JSON is loaded but before\n   * process() is called.\n   *\n   * @type {number}\n   * @constant\n   *\n   * @private\n   */\n  LOADED: 2,\n  /**\n   * The state of the loader while parsing the glTF and creating GPU resources\n   * as needed.\n   *\n   * @type {number}\n   * @constant\n   *\n   * @private\n   */\n  PROCESSING: 3,\n  /**\n   * For some features like handling CESIUM_primitive_outlines, the geometry\n   * must be modified after it is loaded. The post-processing state handles\n   * any geometry modification (if needed).\n   * <p>\n   * This state is not used for asynchronous texture loading.\n   * </p>\n   *\n   * @type {number}\n   * @constant\n   *\n   * @private\n   */\n  POST_PROCESSING: 4,\n  /**\n   * Once the processing/post-processing states are finished, the loader\n   * enters the processed state (sometimes from a promise chain). The next\n   * call to process() will advance to the ready state.\n   *\n   * @type {number}\n   * @constant\n   *\n   * @private\n   */\n  PROCESSED: 5,\n  /**\n   * When the loader reaches the ready state, the loaders' promise will be\n   * resolved.\n   *\n   * @type {number}\n   * @constant\n   *\n   * @private\n   */\n  READY: 6,\n  /**\n   * If an error occurs at any point, the loader switches to the failed state.\n   *\n   * @type {number}\n   * @constant\n   *\n   * @private\n   */\n  FAILED: 7,\n  /**\n   * If unload() is called, the loader switches to the unloaded state.\n   *\n   * @type {number}\n   * @constant\n   *\n   * @private\n   */\n  UNLOADED: 8,\n};\n\n/**\n * Loads a glTF model.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {object} options Object with the following properties:\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF. This is often the path of the .gltf or .glb file, but may also be the path of the .b3dm, .i3dm, or .cmpt file containing the embedded glb. .cmpt resources should have a URI fragment indicating the index of the inner content to which the glb belongs in order to individually identify the glb in the cache, e.g. http://example.com/tile.cmpt#index=2.\n * @param {Resource} [options.baseResource] The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {Uint8Array} [options.typedArray] The typed array containing the glTF contents, e.g. from a .b3dm, .i3dm, or .cmpt file.\n * @param {object} [options.gltfJson] A parsed glTF JSON file instead of passing it in as a typed array.\n * @param {boolean} [options.releaseGltfJson=false] When true, the glTF JSON is released once the glTF is loaded. This is especially useful for cases like 3D Tiles, where each .gltf model is unique and caching the glTF JSON is not effective.\n * @param {boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n * @param {boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the glTF is loaded.\n * @param {Axis} [options.upAxis=Axis.Y] The up-axis of the glTF model.\n * @param {Axis} [options.forwardAxis=Axis.Z] The forward-axis of the glTF model.\n * @param {boolean} [options.loadAttributesAsTypedArray=false] Load all attributes and indices as typed arrays instead of GPU buffers. If the attributes are interleaved in the glTF they will be de-interleaved in the typed array.\n * @param {boolean} [options.loadAttributesFor2D=false] If <code>true</code>, load the positions buffer and any instanced attribute buffers as typed arrays for accurately projecting models to 2D.\n * @param {boolean} [options.loadIndicesForWireframe=false] If <code>true</code>, load the index buffer as both a buffer and typed array. The latter is useful for creating wireframe indices in WebGL1.\n * @param {boolean} [options.loadPrimitiveOutline=true] If <code>true</code>, load outlines from the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set false to avoid post-processing geometry at load time.\n * @param {boolean} [options.loadForClassification=false] If <code>true</code> and if the model has feature IDs, load the feature IDs and indices as typed arrays. This is useful for batching features for classification.\n * @param {boolean} [options.renameBatchIdSemantic=false] If <code>true</code>, rename _BATCHID or BATCHID to _FEATURE_ID_0. This is used for .b3dm models\n * @private\n */\nfunction GltfLoader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const gltfResource = options.gltfResource;\n  let baseResource = options.baseResource;\n  const typedArray = options.typedArray;\n  const releaseGltfJson = defaultValue(options.releaseGltfJson, false);\n  const asynchronous = defaultValue(options.asynchronous, true);\n  const incrementallyLoadTextures = defaultValue(\n    options.incrementallyLoadTextures,\n    true\n  );\n  const upAxis = defaultValue(options.upAxis, Axis.Y);\n  const forwardAxis = defaultValue(options.forwardAxis, Axis.Z);\n  const loadAttributesAsTypedArray = defaultValue(\n    options.loadAttributesAsTypedArray,\n    false\n  );\n  const loadAttributesFor2D = defaultValue(options.loadAttributesFor2D, false);\n  const loadIndicesForWireframe = defaultValue(\n    options.loadIndicesForWireframe,\n    false\n  );\n  const loadPrimitiveOutline = defaultValue(options.loadPrimitiveOutline, true);\n  const loadForClassification = defaultValue(\n    options.loadForClassification,\n    false\n  );\n  const renameBatchIdSemantic = defaultValue(\n    options.renameBatchIdSemantic,\n    false\n  );\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.gltfResource\", gltfResource);\n  //>>includeEnd('debug');\n\n  baseResource = defined(baseResource) ? baseResource : gltfResource.clone();\n\n  this._gltfJson = options.gltfJson;\n  this._gltfResource = gltfResource;\n  this._baseResource = baseResource;\n  this._typedArray = typedArray;\n  this._releaseGltfJson = releaseGltfJson;\n  this._asynchronous = asynchronous;\n  this._incrementallyLoadTextures = incrementallyLoadTextures;\n  this._upAxis = upAxis;\n  this._forwardAxis = forwardAxis;\n  this._loadAttributesAsTypedArray = loadAttributesAsTypedArray;\n  this._loadAttributesFor2D = loadAttributesFor2D;\n  this._loadIndicesForWireframe = loadIndicesForWireframe;\n  this._loadPrimitiveOutline = loadPrimitiveOutline;\n  this._loadForClassification = loadForClassification;\n  this._renameBatchIdSemantic = renameBatchIdSemantic;\n\n  // When loading EXT_feature_metadata, the feature tables and textures\n  // are now stored as arrays like the newer EXT_structural_metadata extension.\n  // This requires sorting the dictionary keys for a consistent ordering.\n  this._sortedPropertyTableIds = undefined;\n  this._sortedFeatureTextureIds = undefined;\n\n  this._gltfJsonLoader = undefined;\n  this._state = GltfLoaderState.NOT_LOADED;\n  this._textureState = GltfLoaderState.NOT_LOADED;\n  this._promise = undefined;\n  this._processError = undefined;\n  this._textureErrors = [];\n\n  // Information about whether to load primitives as typed arrays or buffers,\n  // and whether post-processing is needed after loading (e.g. for\n  // generating outlines)\n  this._primitiveLoadPlans = [];\n\n  // Loaders that need to be processed before the glTF becomes ready\n  this._loaderPromises = [];\n  this._textureLoaders = [];\n  this._texturesPromises = [];\n  this._textureCallbacks = [];\n  this._bufferViewLoaders = [];\n  this._geometryLoaders = [];\n  this._geometryCallbacks = [];\n  this._structuralMetadataLoader = undefined;\n  this._loadResourcesPromise = undefined;\n  this._resourcesLoaded = false;\n  this._texturesLoaded = false;\n\n  // In some cases where geometry post-processing is needed (like generating\n  // outlines) new attributes are added that may have GPU resources attached.\n  // The GltfLoader will own the resources and store them here.\n  this._postProcessBuffers = [];\n\n  // Loaded results\n  this._components = undefined;\n}\n\nif (defined(Object.create)) {\n  GltfLoader.prototype = Object.create(ResourceLoader.prototype);\n  GltfLoader.prototype.constructor = GltfLoader;\n}\n\nObject.defineProperties(GltfLoader.prototype, {\n  /**\n   * The cache key of the resource.\n   *\n   * @memberof GltfLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    get: function () {\n      return undefined;\n    },\n  },\n  /**\n   * The loaded components.\n   *\n   * @memberof GltfLoader.prototype\n   *\n   * @type {ModelComponents.Components}\n   * @readonly\n   * @private\n   */\n  components: {\n    get: function () {\n      return this._components;\n    },\n  },\n  /**\n   * The loaded glTF json.\n   *\n   * @memberof GltfLoader.prototype\n   *\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  gltfJson: {\n    get: function () {\n      if (defined(this._gltfJsonLoader)) {\n        return this._gltfJsonLoader.gltf;\n      }\n      return this._gltfJson;\n    },\n  },\n  /**\n   * Returns true if textures are loaded separately from the other glTF resources.\n   *\n   * @memberof GltfLoader.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  incrementallyLoadTextures: {\n    get: function () {\n      return this._incrementallyLoadTextures;\n    },\n  },\n  /**\n   * true if textures are loaded, useful when incrementallyLoadTextures is true\n   *\n   * @memberof GltfLoader.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  texturesLoaded: {\n    get: function () {\n      return this._texturesLoaded;\n    },\n  },\n});\n\n/**\n * Loads the gltf object\n */\nasync function loadGltfJson(loader) {\n  loader._state = GltfLoaderState.LOADING;\n  loader._textureState = GltfLoaderState.LOADING;\n\n  try {\n    const gltfJsonLoader = ResourceCache.getGltfJsonLoader({\n      gltfResource: loader._gltfResource,\n      baseResource: loader._baseResource,\n      typedArray: loader._typedArray,\n      gltfJson: loader._gltfJson,\n    });\n    loader._gltfJsonLoader = gltfJsonLoader;\n    await gltfJsonLoader.load();\n\n    if (\n      loader.isDestroyed() ||\n      loader.isUnloaded() ||\n      gltfJsonLoader.isDestroyed()\n    ) {\n      return;\n    }\n\n    loader._state = GltfLoaderState.LOADED;\n    loader._textureState = GltfLoaderState.LOADED;\n\n    return loader;\n  } catch (error) {\n    if (loader.isDestroyed()) {\n      return;\n    }\n\n    loader._state = GltfLoaderState.FAILED;\n    loader._textureState = GltfLoaderState.FAILED;\n    handleError(loader, error);\n  }\n}\n\nasync function loadResources(loader, frameState) {\n  if (!FeatureDetection.supportsWebP.initialized) {\n    await FeatureDetection.supportsWebP.initialize();\n  }\n\n  const supportedImageFormats = new SupportedImageFormats({\n    webp: FeatureDetection.supportsWebP(),\n    basis: frameState.context.supportsBasis,\n  });\n\n  // Parse the glTF which populates the loaders arrays. Loading promises will be created, and will\n  // resolve once the loaders are ready (i.e. all external resources\n  // have been fetched and all GPU resources have been created). Loaders that\n  // create GPU resources need to be processed every frame until they become\n  // ready since the JobScheduler is not able to execute all jobs in a single\n  // frame. Any promise failures are collected, and will be handled synchronously in process(). Also note that it's fine to call process before a loader is ready\n  // to process or after it has failed; nothing will happen.\n  const gltf = loader.gltfJson;\n  const promise = parse(loader, gltf, supportedImageFormats, frameState);\n\n  // All resource loaders have been created, so we can begin processing\n  loader._state = GltfLoaderState.PROCESSING;\n  loader._textureState = GltfLoaderState.PROCESSING;\n\n  if (defined(loader._gltfJsonLoader) && loader._releaseGltfJson) {\n    // Check that the glTF JSON loader is still defined before trying to unload it.\n    // It can be unloaded if the glTF loader is destroyed.\n    ResourceCache.unload(loader._gltfJsonLoader);\n    loader._gltfJsonLoader = undefined;\n  }\n\n  return promise;\n}\n\n/**\n * Loads the resource.\n * @returns {Promise.<GltfLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @exception {RuntimeError} Unsupported glTF version\n * @exception {RuntimeError} Unsupported glTF Extension\n * @private\n */\nGltfLoader.prototype.load = async function () {\n  if (defined(this._promise)) {\n    return this._promise;\n  }\n\n  this._promise = loadGltfJson(this);\n  return this._promise;\n};\n\nfunction handleError(gltfLoader, error) {\n  gltfLoader.unload();\n  const errorMessage = \"Failed to load glTF\";\n  throw gltfLoader.getError(errorMessage, error);\n}\n\nfunction processLoaders(loader, frameState) {\n  let i;\n  let ready = true;\n  const geometryLoaders = loader._geometryLoaders;\n  const geometryLoadersLength = geometryLoaders.length;\n  for (i = 0; i < geometryLoadersLength; ++i) {\n    const geometryReady = geometryLoaders[i].process(frameState);\n    if (geometryReady && defined(loader._geometryCallbacks[i])) {\n      loader._geometryCallbacks[i]();\n      loader._geometryCallbacks[i] = undefined;\n    }\n    ready = ready && geometryReady;\n  }\n\n  const structuralMetadataLoader = loader._structuralMetadataLoader;\n  if (defined(structuralMetadataLoader)) {\n    const metadataReady = structuralMetadataLoader.process(frameState);\n    if (metadataReady) {\n      loader._components.structuralMetadata =\n        structuralMetadataLoader.structuralMetadata;\n    }\n    ready = ready && metadataReady;\n  }\n\n  if (ready) {\n    // Geometry requires further processing\n    loader._state = GltfLoaderState.POST_PROCESSING;\n  }\n}\n\nfunction postProcessGeometry(loader, context) {\n  // Apply post-processing steps on geometry such as\n  // updating attributes for rendering outlines.\n  const loadPlans = loader._primitiveLoadPlans;\n  const length = loadPlans.length;\n  for (let i = 0; i < length; i++) {\n    const loadPlan = loadPlans[i];\n    loadPlan.postProcess(context);\n\n    if (loadPlan.needsOutlines) {\n      // The glTF loader takes ownership of any buffers generated in the\n      // post-process stage since they were created after the geometry loaders\n      // finished. This way they can be destroyed when the loader is destroyed.\n      gatherPostProcessBuffers(loader, loadPlan);\n    }\n  }\n}\n\nfunction gatherPostProcessBuffers(loader, primitiveLoadPlan) {\n  const buffers = loader._postProcessBuffers;\n  const primitive = primitiveLoadPlan.primitive;\n\n  const outlineCoordinates = primitive.outlineCoordinates;\n  if (defined(outlineCoordinates)) {\n    // outline coordinates are always loaded as a buffer.\n    buffers.push(outlineCoordinates.buffer);\n  }\n\n  // to do post-processing, all the attributes are loaded as typed arrays\n  // so if a buffer exists, it was newly generated\n  const attributes = primitive.attributes;\n  const length = attributes.length;\n  for (let i = 0; i < length; i++) {\n    const attribute = attributes[i];\n    if (defined(attribute.buffer)) {\n      buffers.push(attribute.buffer);\n    }\n  }\n\n  // Similarly for the indices.\n  const indices = primitive.indices;\n  if (defined(indices) && defined(indices.buffer)) {\n    buffers.push(indices.buffer);\n  }\n}\n\n/**\n * Process loaders other than textures\n * @private\n */\nGltfLoader.prototype._process = function (frameState) {\n  if (this._state === GltfLoaderState.READY) {\n    return true;\n  }\n\n  if (this._state === GltfLoaderState.PROCESSING) {\n    processLoaders(this, frameState);\n  }\n\n  if (\n    this._resourcesLoaded &&\n    this._state === GltfLoaderState.POST_PROCESSING\n  ) {\n    postProcessGeometry(this, frameState.context);\n    this._state = GltfLoaderState.PROCESSED;\n  }\n\n  if (this._resourcesLoaded && this._state === GltfLoaderState.PROCESSED) {\n    // The buffer views can be unloaded once the data is copied.\n    unloadBufferViewLoaders(this);\n\n    // Similarly, if the glTF was loaded from a typed array, release the memory\n    this._typedArray = undefined;\n\n    this._state = GltfLoaderState.READY;\n    return true;\n  }\n\n  return false;\n};\n\n/**\n * Process textures other than textures\n * @private\n */\nGltfLoader.prototype._processTextures = function (frameState) {\n  if (this._textureState === GltfLoaderState.READY) {\n    return true;\n  }\n\n  if (this._textureState !== GltfLoaderState.PROCESSING) {\n    return false;\n  }\n\n  let i;\n  let ready = true;\n  const textureLoaders = this._textureLoaders;\n  const textureLoadersLength = textureLoaders.length;\n  for (i = 0; i < textureLoadersLength; ++i) {\n    const textureReady = textureLoaders[i].process(frameState);\n    if (textureReady && defined(this._textureCallbacks[i])) {\n      this._textureCallbacks[i]();\n      this._textureCallbacks[i] = undefined;\n    }\n\n    ready = ready && textureReady;\n  }\n\n  if (!ready) {\n    return false;\n  }\n\n  this._textureState = GltfLoaderState.READY;\n  this._texturesLoaded = true;\n  return true;\n};\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @private\n */\nGltfLoader.prototype.process = function (frameState) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"frameState\", frameState);\n  //>>includeEnd('debug');\n\n  if (\n    this._state === GltfLoaderState.LOADED &&\n    !defined(this._loadResourcesPromise)\n  ) {\n    this._loadResourcesPromise = loadResources(this, frameState)\n      .then(() => {\n        this._resourcesLoaded = true;\n      })\n      .catch((error) => {\n        this._processError = error;\n      });\n  }\n\n  if (defined(this._processError)) {\n    this._state = GltfLoaderState.FAILED;\n    const error = this._processError;\n    this._processError = undefined;\n    handleError(this, error);\n  }\n\n  // Pop the next error of the list in case there are multiple\n  const textureError = this._textureErrors.pop();\n  if (defined(textureError)) {\n    // There shouldn't be the need to completely unload in this case. Just throw the error.\n    const error = this.getError(\"Failed to load glTF texture\", textureError);\n    error.name = \"TextureError\";\n    throw error;\n  }\n\n  if (this._state === GltfLoaderState.FAILED) {\n    return false;\n  }\n\n  let ready = false;\n  try {\n    ready = this._process(frameState);\n  } catch (error) {\n    this._state = GltfLoaderState.FAILED;\n    handleError(this, error);\n  }\n\n  // Since textures can be loaded independently and are handled through a separate promise, they are processed in their own function\n  let texturesReady = false;\n  try {\n    texturesReady = this._processTextures(frameState);\n  } catch (error) {\n    this._textureState = GltfLoaderState.FAILED;\n    handleError(this, error);\n  }\n\n  if (this._incrementallyLoadTextures) {\n    return ready;\n  }\n\n  return ready && texturesReady;\n};\n\nfunction getVertexBufferLoader(\n  loader,\n  gltf,\n  accessorId,\n  semantic,\n  draco,\n  loadBuffer,\n  loadTypedArray,\n  frameState\n) {\n  const accessor = gltf.accessors[accessorId];\n  const bufferViewId = accessor.bufferView;\n\n  const vertexBufferLoader = ResourceCache.getVertexBufferLoader({\n    gltf: gltf,\n    gltfResource: loader._gltfResource,\n    baseResource: loader._baseResource,\n    frameState: frameState,\n    bufferViewId: bufferViewId,\n    draco: draco,\n    attributeSemantic: semantic,\n    accessorId: accessorId,\n    asynchronous: loader._asynchronous,\n    loadBuffer: loadBuffer,\n    loadTypedArray: loadTypedArray,\n  });\n\n  return vertexBufferLoader;\n}\n\nfunction getIndexBufferLoader(\n  loader,\n  gltf,\n  accessorId,\n  draco,\n  loadBuffer,\n  loadTypedArray,\n  frameState\n) {\n  const indexBufferLoader = ResourceCache.getIndexBufferLoader({\n    gltf: gltf,\n    accessorId: accessorId,\n    gltfResource: loader._gltfResource,\n    baseResource: loader._baseResource,\n    frameState: frameState,\n    draco: draco,\n    asynchronous: loader._asynchronous,\n    loadBuffer: loadBuffer,\n    loadTypedArray: loadTypedArray,\n  });\n\n  return indexBufferLoader;\n}\n\nfunction getBufferViewLoader(loader, gltf, bufferViewId) {\n  const bufferViewLoader = ResourceCache.getBufferViewLoader({\n    gltf: gltf,\n    bufferViewId: bufferViewId,\n    gltfResource: loader._gltfResource,\n    baseResource: loader._baseResource,\n  });\n\n  loader._bufferViewLoaders.push(bufferViewLoader);\n\n  return bufferViewLoader;\n}\n\nfunction getPackedTypedArray(gltf, accessor, bufferViewTypedArray) {\n  let byteOffset = accessor.byteOffset;\n  const byteStride = getAccessorByteStride(gltf, accessor);\n  const count = accessor.count;\n  const componentCount = numberOfComponentsForType(accessor.type);\n  const componentType = accessor.componentType;\n  const componentByteLength = ComponentDatatype.getSizeInBytes(componentType);\n  const defaultByteStride = componentByteLength * componentCount;\n  const componentsLength = count * componentCount;\n\n  if (byteStride === defaultByteStride) {\n    // Copy the typed array and let the underlying ArrayBuffer be freed\n    bufferViewTypedArray = new Uint8Array(bufferViewTypedArray);\n    return ComponentDatatype.createArrayBufferView(\n      componentType,\n      bufferViewTypedArray.buffer,\n      bufferViewTypedArray.byteOffset + byteOffset,\n      componentsLength\n    );\n  }\n\n  const accessorTypedArray = ComponentDatatype.createTypedArray(\n    componentType,\n    componentsLength\n  );\n\n  const dataView = new DataView(bufferViewTypedArray.buffer);\n  const components = new Array(componentCount);\n  const componentReader = getComponentReader(accessor.componentType);\n  byteOffset = bufferViewTypedArray.byteOffset + byteOffset;\n\n  for (let i = 0; i < count; ++i) {\n    componentReader(\n      dataView,\n      byteOffset,\n      componentCount,\n      componentByteLength,\n      components\n    );\n    for (let j = 0; j < componentCount; ++j) {\n      accessorTypedArray[i * componentCount + j] = components[j];\n    }\n    byteOffset += byteStride;\n  }\n\n  return accessorTypedArray;\n}\n\nfunction loadDefaultAccessorValues(accessor, values) {\n  const accessorType = accessor.type;\n  if (accessorType === AttributeType.SCALAR) {\n    return values.fill(0);\n  }\n\n  const MathType = AttributeType.getMathType(accessorType);\n  return values.fill(MathType.clone(MathType.ZERO));\n}\n\nfunction loadAccessorValues(accessor, typedArray, values, useQuaternion) {\n  const accessorType = accessor.type;\n  const accessorCount = accessor.count;\n\n  if (accessorType === AttributeType.SCALAR) {\n    for (let i = 0; i < accessorCount; i++) {\n      values[i] = typedArray[i];\n    }\n  } else if (accessorType === AttributeType.VEC4 && useQuaternion) {\n    for (let i = 0; i < accessorCount; i++) {\n      values[i] = Quaternion.unpack(typedArray, i * 4);\n    }\n  } else {\n    const MathType = AttributeType.getMathType(accessorType);\n    const numberOfComponents = AttributeType.getNumberOfComponents(\n      accessorType\n    );\n\n    for (let i = 0; i < accessorCount; i++) {\n      values[i] = MathType.unpack(typedArray, i * numberOfComponents);\n    }\n  }\n\n  return values;\n}\n\nasync function loadAccessorBufferView(\n  loader,\n  bufferViewLoader,\n  gltf,\n  accessor,\n  useQuaternion,\n  values\n) {\n  await bufferViewLoader.load();\n  if (loader.isDestroyed()) {\n    return;\n  }\n\n  const bufferViewTypedArray = bufferViewLoader.typedArray;\n  const typedArray = getPackedTypedArray(gltf, accessor, bufferViewTypedArray);\n\n  useQuaternion = defaultValue(useQuaternion, false);\n  loadAccessorValues(accessor, typedArray, values, useQuaternion);\n}\n\nfunction loadAccessor(loader, gltf, accessorId, useQuaternion) {\n  const accessor = gltf.accessors[accessorId];\n  const accessorCount = accessor.count;\n  const values = new Array(accessorCount);\n\n  const bufferViewId = accessor.bufferView;\n  if (defined(bufferViewId)) {\n    const bufferViewLoader = getBufferViewLoader(loader, gltf, bufferViewId);\n    const promise = loadAccessorBufferView(\n      loader,\n      bufferViewLoader,\n      gltf,\n      accessor,\n      useQuaternion,\n      values\n    );\n    loader._loaderPromises.push(promise);\n\n    return values;\n  }\n\n  return loadDefaultAccessorValues(accessor, values);\n}\n\nfunction fromArray(MathType, values) {\n  if (!defined(values)) {\n    return undefined;\n  }\n\n  if (MathType === Number) {\n    return values[0];\n  }\n\n  return MathType.unpack(values);\n}\n\nfunction getDefault(MathType) {\n  if (MathType === Number) {\n    return 0.0;\n  }\n\n  return new MathType(); // defaults to 0.0 for all types\n}\n\nfunction getQuantizationDivisor(componentDatatype) {\n  switch (componentDatatype) {\n    case ComponentDatatype.BYTE:\n      return 127;\n    case ComponentDatatype.UNSIGNED_BYTE:\n      return 255;\n    case ComponentDatatype.SHORT:\n      return 32767;\n    case ComponentDatatype.UNSIGNED_SHORT:\n      return 65535;\n    default:\n      return 1.0;\n  }\n}\n\nconst minimumBoundsByType = {\n  VEC2: new Cartesian2(-1.0, -1.0),\n  VEC3: new Cartesian3(-1.0, -1.0, -1.0),\n  VEC4: new Cartesian4(-1.0, -1.0, -1.0, -1.0),\n};\n\nfunction dequantizeMinMax(attribute, VectorType) {\n  const divisor = getQuantizationDivisor(attribute.componentDatatype);\n  const minimumBound = minimumBoundsByType[attribute.type];\n\n  // dequantized = max(quantized / divisor, -1.0)\n  let min = attribute.min;\n  if (defined(min)) {\n    min = VectorType.divideByScalar(min, divisor, min);\n    min = VectorType.maximumByComponent(min, minimumBound, min);\n  }\n\n  let max = attribute.max;\n  if (defined(max)) {\n    max = VectorType.divideByScalar(max, divisor, max);\n    max = VectorType.maximumByComponent(max, minimumBound, max);\n  }\n\n  attribute.min = min;\n  attribute.max = max;\n}\n\nfunction setQuantizationFromWeb3dQuantizedAttributes(\n  extension,\n  attribute,\n  MathType\n) {\n  const decodeMatrix = extension.decodeMatrix;\n  const decodedMin = fromArray(MathType, extension.decodedMin);\n  const decodedMax = fromArray(MathType, extension.decodedMax);\n\n  if (defined(decodedMin) && defined(decodedMax)) {\n    attribute.min = decodedMin;\n    attribute.max = decodedMax;\n  }\n\n  const quantization = new ModelComponents.Quantization();\n  quantization.componentDatatype = attribute.componentDatatype;\n  quantization.type = attribute.type;\n\n  if (decodeMatrix.length === 4) {\n    quantization.quantizedVolumeOffset = decodeMatrix[2];\n    quantization.quantizedVolumeStepSize = decodeMatrix[0];\n  } else if (decodeMatrix.length === 9) {\n    quantization.quantizedVolumeOffset = new Cartesian2(\n      decodeMatrix[6],\n      decodeMatrix[7]\n    );\n    quantization.quantizedVolumeStepSize = new Cartesian2(\n      decodeMatrix[0],\n      decodeMatrix[4]\n    );\n  } else if (decodeMatrix.length === 16) {\n    quantization.quantizedVolumeOffset = new Cartesian3(\n      decodeMatrix[12],\n      decodeMatrix[13],\n      decodeMatrix[14]\n    );\n    quantization.quantizedVolumeStepSize = new Cartesian3(\n      decodeMatrix[0],\n      decodeMatrix[5],\n      decodeMatrix[10]\n    );\n  } else if (decodeMatrix.length === 25) {\n    quantization.quantizedVolumeOffset = new Cartesian4(\n      decodeMatrix[20],\n      decodeMatrix[21],\n      decodeMatrix[22],\n      decodeMatrix[23]\n    );\n    quantization.quantizedVolumeStepSize = new Cartesian4(\n      decodeMatrix[0],\n      decodeMatrix[6],\n      decodeMatrix[12],\n      decodeMatrix[18]\n    );\n  }\n\n  attribute.quantization = quantization;\n}\n\nfunction createAttribute(gltf, accessorId, name, semantic, setIndex) {\n  const accessor = gltf.accessors[accessorId];\n  const MathType = AttributeType.getMathType(accessor.type);\n  const normalized = defaultValue(accessor.normalized, false);\n\n  const attribute = new Attribute();\n  attribute.name = name;\n  attribute.semantic = semantic;\n  attribute.setIndex = setIndex;\n  attribute.constant = getDefault(MathType);\n  attribute.componentDatatype = accessor.componentType;\n  attribute.normalized = normalized;\n  attribute.count = accessor.count;\n  attribute.type = accessor.type;\n  attribute.min = fromArray(MathType, accessor.min);\n  attribute.max = fromArray(MathType, accessor.max);\n  attribute.byteOffset = accessor.byteOffset;\n  attribute.byteStride = getAccessorByteStride(gltf, accessor);\n\n  if (hasExtension(accessor, \"WEB3D_quantized_attributes\")) {\n    setQuantizationFromWeb3dQuantizedAttributes(\n      accessor.extensions.WEB3D_quantized_attributes,\n      attribute,\n      MathType\n    );\n  }\n\n  const isQuantizable =\n    attribute.semantic === VertexAttributeSemantic.POSITION ||\n    attribute.semantic === VertexAttributeSemantic.NORMAL ||\n    attribute.semantic === VertexAttributeSemantic.TANGENT ||\n    attribute.semantic === VertexAttributeSemantic.TEXCOORD;\n\n  // In the glTF 2.0 spec, min and max are not affected by the normalized flag.\n  // However, for KHR_mesh_quantization, min and max must be dequantized for\n  // normalized values, else the bounding sphere will be computed incorrectly.\n  const hasKhrMeshQuantization = gltf.extensionsRequired?.includes(\n    \"KHR_mesh_quantization\"\n  );\n\n  if (hasKhrMeshQuantization && normalized && isQuantizable) {\n    dequantizeMinMax(attribute, MathType);\n  }\n\n  return attribute;\n}\n\nfunction getSetIndex(gltfSemantic) {\n  const setIndexRegex = /^\\w+_(\\d+)$/;\n  const setIndexMatch = setIndexRegex.exec(gltfSemantic);\n  if (setIndexMatch !== null) {\n    return parseInt(setIndexMatch[1]);\n  }\n  return undefined;\n}\n\nconst scratchSemanticInfo = {\n  gltfSemantic: undefined,\n  renamedSemantic: undefined,\n  modelSemantic: undefined,\n};\n\nfunction getSemanticInfo(loader, semanticType, gltfSemantic) {\n  // For .b3dm, rename _BATCHID (or the legacy BATCHID) to _FEATURE_ID_0\n  // in the generated model components for compatibility with EXT_mesh_features\n  let renamedSemantic = gltfSemantic;\n  if (\n    loader._renameBatchIdSemantic &&\n    (gltfSemantic === \"_BATCHID\" || gltfSemantic === \"BATCHID\")\n  ) {\n    renamedSemantic = \"_FEATURE_ID_0\";\n  }\n\n  const modelSemantic = semanticType.fromGltfSemantic(renamedSemantic);\n\n  const semanticInfo = scratchSemanticInfo;\n  semanticInfo.gltfSemantic = gltfSemantic;\n  semanticInfo.renamedSemantic = renamedSemantic;\n  semanticInfo.modelSemantic = modelSemantic;\n\n  return semanticInfo;\n}\n\nfunction isClassificationAttribute(attributeSemantic) {\n  // Classification models only use the position, texcoord, and feature ID attributes.\n  const isPositionAttribute =\n    attributeSemantic === VertexAttributeSemantic.POSITION;\n  const isFeatureIdAttribute =\n    attributeSemantic === VertexAttributeSemantic.FEATURE_ID;\n  const isTexcoordAttribute =\n    attributeSemantic === VertexAttributeSemantic.TEXCOORD;\n\n  return isPositionAttribute || isFeatureIdAttribute || isTexcoordAttribute;\n}\n\nfunction finalizeDracoAttribute(\n  attribute,\n  vertexBufferLoader,\n  loadBuffer,\n  loadTypedArray\n) {\n  // The accessor's byteOffset and byteStride should be ignored for draco.\n  // Each attribute is tightly packed in its own buffer after decode.\n  attribute.byteOffset = 0;\n  attribute.byteStride = undefined;\n  attribute.quantization = vertexBufferLoader.quantization;\n\n  if (loadBuffer) {\n    attribute.buffer = vertexBufferLoader.buffer;\n  }\n\n  if (loadTypedArray) {\n    const componentDatatype = defined(vertexBufferLoader.quantization)\n      ? vertexBufferLoader.quantization.componentDatatype\n      : attribute.componentDatatype;\n\n    attribute.typedArray = ComponentDatatype.createArrayBufferView(\n      componentDatatype,\n      vertexBufferLoader.typedArray.buffer\n    );\n  }\n}\n\nfunction finalizeAttribute(\n  gltf,\n  accessor,\n  attribute,\n  vertexBufferLoader,\n  loadBuffer,\n  loadTypedArray\n) {\n  if (loadBuffer) {\n    attribute.buffer = vertexBufferLoader.buffer;\n  }\n\n  if (loadTypedArray) {\n    const bufferViewTypedArray = vertexBufferLoader.typedArray;\n    attribute.typedArray = getPackedTypedArray(\n      gltf,\n      accessor,\n      bufferViewTypedArray\n    );\n\n    if (!loadBuffer) {\n      // If the buffer isn't loaded, then the accessor's byteOffset and\n      // byteStride should be ignored, since values are only available in a\n      // tightly packed typed array\n      attribute.byteOffset = 0;\n      attribute.byteStride = undefined;\n    }\n  }\n}\n\nfunction loadAttribute(\n  loader,\n  gltf,\n  accessorId,\n  semanticInfo,\n  draco,\n  loadBuffer,\n  loadTypedArray,\n  frameState\n) {\n  const accessor = gltf.accessors[accessorId];\n  const bufferViewId = accessor.bufferView;\n\n  const gltfSemantic = semanticInfo.gltfSemantic;\n  const renamedSemantic = semanticInfo.renamedSemantic;\n  const modelSemantic = semanticInfo.modelSemantic;\n\n  const setIndex = defined(modelSemantic)\n    ? getSetIndex(renamedSemantic)\n    : undefined;\n\n  const name = gltfSemantic;\n  const attribute = createAttribute(\n    gltf,\n    accessorId,\n    name,\n    modelSemantic,\n    setIndex\n  );\n\n  if (!defined(draco) && !defined(bufferViewId)) {\n    return attribute;\n  }\n\n  const vertexBufferLoader = getVertexBufferLoader(\n    loader,\n    gltf,\n    accessorId,\n    gltfSemantic,\n    draco,\n    loadBuffer,\n    loadTypedArray,\n    frameState\n  );\n\n  const index = loader._geometryLoaders.length;\n  loader._geometryLoaders.push(vertexBufferLoader);\n  const promise = vertexBufferLoader.load();\n  loader._loaderPromises.push(promise);\n  // This can only execute once vertexBufferLoader.process() has run and returns true\n  // Save this finish callback by the loader index so it can be called\n  // in process().\n  loader._geometryCallbacks[index] = () => {\n    if (\n      defined(draco) &&\n      defined(draco.attributes) &&\n      defined(draco.attributes[gltfSemantic])\n    ) {\n      finalizeDracoAttribute(\n        attribute,\n        vertexBufferLoader,\n        loadBuffer,\n        loadTypedArray\n      );\n    } else {\n      finalizeAttribute(\n        gltf,\n        accessor,\n        attribute,\n        vertexBufferLoader,\n        loadBuffer,\n        loadTypedArray\n      );\n    }\n  };\n\n  return attribute;\n}\n\nfunction loadVertexAttribute(\n  loader,\n  gltf,\n  accessorId,\n  semanticInfo,\n  draco,\n  hasInstances,\n  needsPostProcessing,\n  frameState\n) {\n  const modelSemantic = semanticInfo.modelSemantic;\n\n  const isPositionAttribute =\n    modelSemantic === VertexAttributeSemantic.POSITION;\n  const isFeatureIdAttribute =\n    modelSemantic === VertexAttributeSemantic.FEATURE_ID;\n\n  const loadTypedArrayFor2D =\n    isPositionAttribute &&\n    !hasInstances &&\n    loader._loadAttributesFor2D &&\n    !frameState.scene3DOnly;\n\n  const loadTypedArrayForClassification =\n    loader._loadForClassification && isFeatureIdAttribute;\n\n  // Whether the final output should be a buffer or typed array\n  // after loading and post-processing.\n  const outputTypedArrayOnly = loader._loadAttributesAsTypedArray;\n  const outputBuffer = !outputTypedArrayOnly;\n  const outputTypedArray =\n    outputTypedArrayOnly ||\n    loadTypedArrayFor2D ||\n    loadTypedArrayForClassification;\n\n  // Determine what to load right now:\n  //\n  // - If post-processing is needed, load a packed typed array for\n  //   further processing, and defer the buffer loading until later.\n  // - On the other hand, if post-processing is not needed,\n  //   set the load flags directly\n  const loadBuffer = needsPostProcessing ? false : outputBuffer;\n  const loadTypedArray = needsPostProcessing ? true : outputTypedArray;\n\n  const attribute = loadAttribute(\n    loader,\n    gltf,\n    accessorId,\n    semanticInfo,\n    draco,\n    loadBuffer,\n    loadTypedArray,\n    frameState\n  );\n\n  const attributePlan = new PrimitiveLoadPlan.AttributeLoadPlan(attribute);\n  attributePlan.loadBuffer = outputBuffer;\n  attributePlan.loadTypedArray = outputTypedArray;\n\n  return attributePlan;\n}\n\nfunction loadInstancedAttribute(\n  loader,\n  gltf,\n  accessorId,\n  attributes,\n  gltfSemantic,\n  frameState\n) {\n  const hasRotation = defined(attributes.ROTATION);\n  const hasTranslationMinMax =\n    defined(attributes.TRANSLATION) &&\n    defined(gltf.accessors[attributes.TRANSLATION].min) &&\n    defined(gltf.accessors[attributes.TRANSLATION].max);\n\n  const semanticInfo = getSemanticInfo(\n    loader,\n    InstanceAttributeSemantic,\n    gltfSemantic\n  );\n  const modelSemantic = semanticInfo.modelSemantic;\n\n  const isTransformAttribute =\n    modelSemantic === InstanceAttributeSemantic.TRANSLATION ||\n    modelSemantic === InstanceAttributeSemantic.ROTATION ||\n    modelSemantic === InstanceAttributeSemantic.SCALE;\n  const isTranslationAttribute =\n    modelSemantic === InstanceAttributeSemantic.TRANSLATION;\n\n  // Load the attributes as typed arrays only if:\n  // - loadAttributesAsTypedArray is true\n  // - the instances have rotations. This only applies to the transform attributes,\n  //   since The instance matrices are computed on the CPU. This avoids the\n  //   expensive quaternion -> rotation matrix conversion in the shader.\n  // - GPU instancing is not supported.\n  const loadAsTypedArrayOnly =\n    loader._loadAttributesAsTypedArray ||\n    (hasRotation && isTransformAttribute) ||\n    !frameState.context.instancedArrays;\n\n  const loadBuffer = !loadAsTypedArrayOnly;\n\n  // Load the translations as a typed array in addition to the buffer if\n  // - the accessor does not have a min and max. The values will be used\n  //   for computing an accurate bounding volume.\n  // - the model will be projected to 2D.\n  const loadFor2D = loader._loadAttributesFor2D && !frameState.scene3DOnly;\n  const loadTranslationAsTypedArray =\n    isTranslationAttribute && (!hasTranslationMinMax || loadFor2D);\n\n  const loadTypedArray = loadAsTypedArrayOnly || loadTranslationAsTypedArray;\n\n  // Don't pass in draco object since instanced attributes can't be draco compressed\n  return loadAttribute(\n    loader,\n    gltf,\n    accessorId,\n    semanticInfo,\n    undefined,\n    loadBuffer,\n    loadTypedArray,\n    frameState\n  );\n}\n\nfunction loadIndices(\n  loader,\n  gltf,\n  accessorId,\n  draco,\n  hasFeatureIds,\n  needsPostProcessing,\n  frameState\n) {\n  const accessor = gltf.accessors[accessorId];\n  const bufferViewId = accessor.bufferView;\n\n  if (!defined(draco) && !defined(bufferViewId)) {\n    return undefined;\n  }\n\n  const indices = new Indices();\n  indices.count = accessor.count;\n\n  const loadAttributesAsTypedArray = loader._loadAttributesAsTypedArray;\n  // Load the index buffer as a typed array to generate wireframes in WebGL1.\n  const loadForWireframe =\n    loader._loadIndicesForWireframe && !frameState.context.webgl2;\n\n  // Load the index buffer as a typed array to batch features together for classification.\n  const loadForClassification = loader._loadForClassification && hasFeatureIds;\n\n  // Whether the final output should be a buffer or typed array\n  // after loading and post-processing.\n  const outputTypedArrayOnly = loadAttributesAsTypedArray;\n  const outputBuffer = !outputTypedArrayOnly;\n  const outputTypedArray =\n    loadAttributesAsTypedArray || loadForWireframe || loadForClassification;\n\n  // Determine what to load right now:\n  //\n  // - If post-processing is needed, load a packed typed array for\n  //   further processing, and defer the buffer loading until later.\n  // - On the other hand, if post-processing is not needed, set the load\n  //   flags directly\n  const loadBuffer = needsPostProcessing ? false : outputBuffer;\n  const loadTypedArray = needsPostProcessing ? true : outputTypedArray;\n\n  const indexBufferLoader = getIndexBufferLoader(\n    loader,\n    gltf,\n    accessorId,\n    draco,\n    loadBuffer,\n    loadTypedArray,\n    frameState\n  );\n\n  const index = loader._geometryLoaders.length;\n  loader._geometryLoaders.push(indexBufferLoader);\n  const promise = indexBufferLoader.load();\n  loader._loaderPromises.push(promise);\n  // This can only execute once indexBufferLoader.process() has run and returns true\n  // Save this finish callback by the loader index so it can be called\n  // in process().\n  loader._geometryCallbacks[index] = () => {\n    indices.indexDatatype = indexBufferLoader.indexDatatype;\n    indices.buffer = indexBufferLoader.buffer;\n    indices.typedArray = indexBufferLoader.typedArray;\n  };\n\n  const indicesPlan = new PrimitiveLoadPlan.IndicesLoadPlan(indices);\n  indicesPlan.loadBuffer = outputBuffer;\n  indicesPlan.loadTypedArray = outputTypedArray;\n\n  return indicesPlan;\n}\n\nfunction loadTexture(\n  loader,\n  gltf,\n  textureInfo,\n  supportedImageFormats,\n  frameState,\n  samplerOverride\n) {\n  const imageId = GltfLoaderUtil.getImageIdFromTexture({\n    gltf: gltf,\n    textureId: textureInfo.index,\n    supportedImageFormats: supportedImageFormats,\n  });\n\n  if (!defined(imageId)) {\n    return undefined;\n  }\n\n  const textureLoader = ResourceCache.getTextureLoader({\n    gltf: gltf,\n    textureInfo: textureInfo,\n    gltfResource: loader._gltfResource,\n    baseResource: loader._baseResource,\n    supportedImageFormats: supportedImageFormats,\n    frameState: frameState,\n    asynchronous: loader._asynchronous,\n  });\n\n  const textureReader = GltfLoaderUtil.createModelTextureReader({\n    textureInfo: textureInfo,\n  });\n\n  const index = loader._textureLoaders.length;\n  loader._textureLoaders.push(textureLoader);\n  const promise = textureLoader.load().catch((error) => {\n    if (loader.isDestroyed()) {\n      return;\n    }\n\n    if (!loader._incrementallyLoadTextures) {\n      // If incrementallyLoadTextures is false, throw the error to ensure the loader state\n      // immediately is set to have failed\n      throw error;\n    }\n\n    // Otherwise, save the error so it can be thrown next\n    loader._textureState = GltfLoaderState.FAILED;\n    loader._textureErrors.push(error);\n  });\n  loader._texturesPromises.push(promise);\n  // This can only execute once textureLoader.process() has run and returns true\n  // Save this finish callback by the loader index so it can be called\n  // in process().\n  loader._textureCallbacks[index] = () => {\n    textureReader.texture = textureLoader.texture;\n    if (defined(samplerOverride)) {\n      textureReader.texture.sampler = samplerOverride;\n    }\n  };\n\n  return textureReader;\n}\n\nfunction loadMaterial(\n  loader,\n  gltf,\n  gltfMaterial,\n  supportedImageFormats,\n  frameState\n) {\n  const material = new Material();\n\n  const extensions = defaultValue(\n    gltfMaterial.extensions,\n    defaultValue.EMPTY_OBJECT\n  );\n  const pbrSpecularGlossiness = extensions.KHR_materials_pbrSpecularGlossiness;\n  const pbrMetallicRoughness = gltfMaterial.pbrMetallicRoughness;\n\n  material.unlit = defined(extensions.KHR_materials_unlit);\n\n  if (defined(pbrSpecularGlossiness)) {\n    const specularGlossiness = new SpecularGlossiness();\n    material.specularGlossiness = specularGlossiness;\n\n    if (defined(pbrSpecularGlossiness.diffuseTexture)) {\n      specularGlossiness.diffuseTexture = loadTexture(\n        loader,\n        gltf,\n        pbrSpecularGlossiness.diffuseTexture,\n        supportedImageFormats,\n        frameState\n      );\n    }\n    if (defined(pbrSpecularGlossiness.specularGlossinessTexture)) {\n      if (defined(pbrSpecularGlossiness.specularGlossinessTexture)) {\n        specularGlossiness.specularGlossinessTexture = loadTexture(\n          loader,\n          gltf,\n          pbrSpecularGlossiness.specularGlossinessTexture,\n          supportedImageFormats,\n          frameState\n        );\n      }\n    }\n    specularGlossiness.diffuseFactor = fromArray(\n      Cartesian4,\n      pbrSpecularGlossiness.diffuseFactor\n    );\n    specularGlossiness.specularFactor = fromArray(\n      Cartesian3,\n      pbrSpecularGlossiness.specularFactor\n    );\n    specularGlossiness.glossinessFactor =\n      pbrSpecularGlossiness.glossinessFactor;\n    material.pbrSpecularGlossiness = pbrSpecularGlossiness;\n  } else if (defined(pbrMetallicRoughness)) {\n    const metallicRoughness = new MetallicRoughness();\n\n    if (defined(pbrMetallicRoughness.baseColorTexture)) {\n      metallicRoughness.baseColorTexture = loadTexture(\n        loader,\n        gltf,\n        pbrMetallicRoughness.baseColorTexture,\n        supportedImageFormats,\n        frameState\n      );\n    }\n    if (defined(pbrMetallicRoughness.metallicRoughnessTexture)) {\n      metallicRoughness.metallicRoughnessTexture = loadTexture(\n        loader,\n        gltf,\n        pbrMetallicRoughness.metallicRoughnessTexture,\n        supportedImageFormats,\n        frameState\n      );\n    }\n    metallicRoughness.baseColorFactor = fromArray(\n      Cartesian4,\n      pbrMetallicRoughness.baseColorFactor\n    );\n    metallicRoughness.metallicFactor = pbrMetallicRoughness.metallicFactor;\n    metallicRoughness.roughnessFactor = pbrMetallicRoughness.roughnessFactor;\n    material.metallicRoughness = metallicRoughness;\n  }\n\n  // Top level textures\n  if (defined(gltfMaterial.emissiveTexture)) {\n    material.emissiveTexture = loadTexture(\n      loader,\n      gltf,\n      gltfMaterial.emissiveTexture,\n      supportedImageFormats,\n      frameState\n    );\n  }\n  // Normals aren't used for classification, so don't load the normal texture.\n  if (defined(gltfMaterial.normalTexture) && !loader._loadForClassification) {\n    material.normalTexture = loadTexture(\n      loader,\n      gltf,\n      gltfMaterial.normalTexture,\n      supportedImageFormats,\n      frameState\n    );\n  }\n  if (defined(gltfMaterial.occlusionTexture)) {\n    material.occlusionTexture = loadTexture(\n      loader,\n      gltf,\n      gltfMaterial.occlusionTexture,\n      supportedImageFormats,\n      frameState\n    );\n  }\n  material.emissiveFactor = fromArray(Cartesian3, gltfMaterial.emissiveFactor);\n  material.alphaMode = gltfMaterial.alphaMode;\n  material.alphaCutoff = gltfMaterial.alphaCutoff;\n  material.doubleSided = gltfMaterial.doubleSided;\n\n  return material;\n}\n\n// for EXT_mesh_features\nfunction loadFeatureIdAttribute(featureIds, positionalLabel) {\n  const featureIdAttribute = new FeatureIdAttribute();\n  featureIdAttribute.featureCount = featureIds.featureCount;\n  featureIdAttribute.nullFeatureId = featureIds.nullFeatureId;\n  featureIdAttribute.propertyTableId = featureIds.propertyTable;\n  featureIdAttribute.setIndex = featureIds.attribute;\n  featureIdAttribute.label = featureIds.label;\n  featureIdAttribute.positionalLabel = positionalLabel;\n  return featureIdAttribute;\n}\n\n// for backwards compatibility with EXT_feature_metadata\nfunction loadFeatureIdAttributeLegacy(\n  gltfFeatureIdAttribute,\n  featureTableId,\n  featureCount,\n  positionalLabel\n) {\n  const featureIdAttribute = new FeatureIdAttribute();\n  const featureIds = gltfFeatureIdAttribute.featureIds;\n  featureIdAttribute.featureCount = featureCount;\n  featureIdAttribute.propertyTableId = featureTableId;\n  featureIdAttribute.setIndex = getSetIndex(featureIds.attribute);\n  featureIdAttribute.positionalLabel = positionalLabel;\n  return featureIdAttribute;\n}\n\n// implicit ranges do not exist in EXT_mesh_features and EXT_instance_features,\n// but both default to the vertex/instance ID which is like\n// an implicit range of {offset: 0, repeat: 1}\nfunction loadDefaultFeatureIds(featureIds, positionalLabel) {\n  const featureIdRange = new FeatureIdImplicitRange();\n  featureIdRange.propertyTableId = featureIds.propertyTable;\n  featureIdRange.featureCount = featureIds.featureCount;\n  featureIdRange.nullFeatureId = featureIds.nullFeatureId;\n  featureIdRange.label = featureIds.label;\n  featureIdRange.positionalLabel = positionalLabel;\n  featureIdRange.offset = 0;\n  featureIdRange.repeat = 1;\n  return featureIdRange;\n}\n\n// for backwards compatibility with EXT_feature_metadata\nfunction loadFeatureIdImplicitRangeLegacy(\n  gltfFeatureIdAttribute,\n  featureTableId,\n  featureCount,\n  positionalLabel\n) {\n  const featureIdRange = new FeatureIdImplicitRange();\n  const featureIds = gltfFeatureIdAttribute.featureIds;\n  featureIdRange.propertyTableId = featureTableId;\n  featureIdRange.featureCount = featureCount;\n\n  // constant/divisor was renamed to offset/repeat\n  featureIdRange.offset = defaultValue(featureIds.constant, 0);\n  // The default is now undefined\n  const divisor = defaultValue(featureIds.divisor, 0);\n  featureIdRange.repeat = divisor === 0 ? undefined : divisor;\n\n  featureIdRange.positionalLabel = positionalLabel;\n  return featureIdRange;\n}\n\n// for EXT_mesh_features\nfunction loadFeatureIdTexture(\n  loader,\n  gltf,\n  gltfFeatureIdTexture,\n  supportedImageFormats,\n  frameState,\n  positionalLabel\n) {\n  const featureIdTexture = new FeatureIdTexture();\n\n  featureIdTexture.featureCount = gltfFeatureIdTexture.featureCount;\n  featureIdTexture.nullFeatureId = gltfFeatureIdTexture.nullFeatureId;\n  featureIdTexture.propertyTableId = gltfFeatureIdTexture.propertyTable;\n  featureIdTexture.label = gltfFeatureIdTexture.label;\n  featureIdTexture.positionalLabel = positionalLabel;\n\n  const textureInfo = gltfFeatureIdTexture.texture;\n  featureIdTexture.textureReader = loadTexture(\n    loader,\n    gltf,\n    textureInfo,\n    supportedImageFormats,\n    frameState,\n    Sampler.NEAREST // Feature ID textures require nearest sampling\n  );\n\n  // Though the new channel index is more future-proof, this implementation\n  // only supports RGBA textures. At least for now, the string representation\n  // is more useful for generating shader code.\n  const channels = defined(textureInfo.channels) ? textureInfo.channels : [0];\n  const channelString = channels\n    .map(function (channelIndex) {\n      return \"rgba\".charAt(channelIndex);\n    })\n    .join(\"\");\n  featureIdTexture.textureReader.channels = channelString;\n\n  return featureIdTexture;\n}\n\n// for backwards compatibility with EXT_feature_metadata\nfunction loadFeatureIdTextureLegacy(\n  loader,\n  gltf,\n  gltfFeatureIdTexture,\n  featureTableId,\n  supportedImageFormats,\n  frameState,\n  featureCount,\n  positionalLabel\n) {\n  const featureIdTexture = new FeatureIdTexture();\n  const featureIds = gltfFeatureIdTexture.featureIds;\n  const textureInfo = featureIds.texture;\n  featureIdTexture.featureCount = featureCount;\n  featureIdTexture.propertyTableId = featureTableId;\n  featureIdTexture.textureReader = loadTexture(\n    loader,\n    gltf,\n    textureInfo,\n    supportedImageFormats,\n    frameState,\n    Sampler.NEAREST // Feature ID textures require nearest sampling\n  );\n\n  featureIdTexture.textureReader.channels = featureIds.channels;\n  featureIdTexture.positionalLabel = positionalLabel;\n\n  return featureIdTexture;\n}\n\nfunction loadMorphTarget(\n  loader,\n  gltf,\n  target,\n  needsPostProcessing,\n  primitiveLoadPlan,\n  frameState\n) {\n  const morphTarget = new MorphTarget();\n\n  // Don't pass in draco object since morph targets can't be draco compressed\n  const draco = undefined;\n  const hasInstances = false;\n\n  for (const semantic in target) {\n    if (target.hasOwnProperty(semantic)) {\n      const accessorId = target[semantic];\n\n      const semanticInfo = getSemanticInfo(\n        loader,\n        VertexAttributeSemantic,\n        semantic\n      );\n\n      const attributePlan = loadVertexAttribute(\n        loader,\n        gltf,\n        accessorId,\n        semanticInfo,\n        draco,\n        hasInstances,\n        needsPostProcessing,\n        frameState\n      );\n      morphTarget.attributes.push(attributePlan.attribute);\n\n      // The load plan doesn't need to distinguish morph target attributes from\n      // regular attributes\n      primitiveLoadPlan.attributePlans.push(attributePlan);\n    }\n  }\n\n  return morphTarget;\n}\n\nfunction loadPrimitive(\n  loader,\n  gltf,\n  gltfPrimitive,\n  hasInstances,\n  supportedImageFormats,\n  frameState\n) {\n  const primitive = new Primitive();\n  const primitivePlan = new PrimitiveLoadPlan(primitive);\n  loader._primitiveLoadPlans.push(primitivePlan);\n\n  const materialId = gltfPrimitive.material;\n  if (defined(materialId)) {\n    primitive.material = loadMaterial(\n      loader,\n      gltf,\n      gltf.materials[materialId],\n      supportedImageFormats,\n      frameState\n    );\n  }\n\n  const extensions = defaultValue(\n    gltfPrimitive.extensions,\n    defaultValue.EMPTY_OBJECT\n  );\n\n  let needsPostProcessing = false;\n  const outlineExtension = extensions.CESIUM_primitive_outline;\n  if (loader._loadPrimitiveOutline && defined(outlineExtension)) {\n    needsPostProcessing = true;\n    primitivePlan.needsOutlines = true;\n    primitivePlan.outlineIndices = loadPrimitiveOutline(\n      loader,\n      gltf,\n      outlineExtension,\n      primitivePlan\n    );\n  }\n\n  const loadForClassification = loader._loadForClassification;\n  const draco = extensions.KHR_draco_mesh_compression;\n\n  let hasFeatureIds = false;\n  const attributes = gltfPrimitive.attributes;\n  if (defined(attributes)) {\n    for (const semantic in attributes) {\n      if (attributes.hasOwnProperty(semantic)) {\n        const accessorId = attributes[semantic];\n        const semanticInfo = getSemanticInfo(\n          loader,\n          VertexAttributeSemantic,\n          semantic\n        );\n\n        const modelSemantic = semanticInfo.modelSemantic;\n        if (\n          loadForClassification &&\n          !isClassificationAttribute(modelSemantic)\n        ) {\n          continue;\n        }\n\n        if (modelSemantic === VertexAttributeSemantic.FEATURE_ID) {\n          hasFeatureIds = true;\n        }\n\n        const attributePlan = loadVertexAttribute(\n          loader,\n          gltf,\n          accessorId,\n          semanticInfo,\n          draco,\n          hasInstances,\n          needsPostProcessing,\n          frameState\n        );\n\n        primitivePlan.attributePlans.push(attributePlan);\n        primitive.attributes.push(attributePlan.attribute);\n      }\n    }\n  }\n\n  const targets = gltfPrimitive.targets;\n  // Morph targets are disabled for classification models.\n  if (defined(targets) && !loadForClassification) {\n    const targetsLength = targets.length;\n    for (let i = 0; i < targetsLength; ++i) {\n      primitive.morphTargets.push(\n        loadMorphTarget(\n          loader,\n          gltf,\n          targets[i],\n          needsPostProcessing,\n          primitivePlan,\n          frameState\n        )\n      );\n    }\n  }\n\n  const indices = gltfPrimitive.indices;\n  if (defined(indices)) {\n    const indicesPlan = loadIndices(\n      loader,\n      gltf,\n      indices,\n      draco,\n      hasFeatureIds,\n      needsPostProcessing,\n      frameState\n    );\n\n    if (defined(indicesPlan)) {\n      primitivePlan.indicesPlan = indicesPlan;\n      primitive.indices = indicesPlan.indices;\n    }\n  }\n\n  // With the latest revision, feature IDs are defined in EXT_mesh_features\n  // while EXT_structural_metadata is for defining property textures and\n  // property mappings. In the legacy EXT_feature_metadata, these concepts\n  // were all in one extension.\n  const structuralMetadata = extensions.EXT_structural_metadata;\n  const meshFeatures = extensions.EXT_mesh_features;\n  const featureMetadataLegacy = extensions.EXT_feature_metadata;\n  const hasFeatureMetadataLegacy = defined(featureMetadataLegacy);\n\n  // Load feature Ids\n  if (defined(meshFeatures)) {\n    loadPrimitiveFeatures(\n      loader,\n      gltf,\n      primitive,\n      meshFeatures,\n      supportedImageFormats,\n      frameState\n    );\n  } else if (hasFeatureMetadataLegacy) {\n    loadPrimitiveFeaturesLegacy(\n      loader,\n      gltf,\n      primitive,\n      featureMetadataLegacy,\n      supportedImageFormats,\n      frameState\n    );\n  }\n\n  // Load structural metadata\n  if (defined(structuralMetadata)) {\n    loadPrimitiveMetadata(primitive, structuralMetadata);\n  } else if (hasFeatureMetadataLegacy) {\n    loadPrimitiveMetadataLegacy(loader, primitive, featureMetadataLegacy);\n  }\n\n  const primitiveType = gltfPrimitive.mode;\n  if (loadForClassification && primitiveType !== PrimitiveType.TRIANGLES) {\n    throw new RuntimeError(\n      \"Only triangle meshes can be used for classification.\"\n    );\n  }\n  primitive.primitiveType = primitiveType;\n\n  return primitive;\n}\n\nfunction loadPrimitiveOutline(loader, gltf, outlineExtension) {\n  const accessorId = outlineExtension.indices;\n  const useQuaternion = false;\n  return loadAccessor(loader, gltf, accessorId, useQuaternion);\n}\n\n// For EXT_mesh_features\nfunction loadPrimitiveFeatures(\n  loader,\n  gltf,\n  primitive,\n  meshFeaturesExtension,\n  supportedImageFormats,\n  frameState\n) {\n  let featureIdsArray;\n  if (\n    defined(meshFeaturesExtension) &&\n    defined(meshFeaturesExtension.featureIds)\n  ) {\n    featureIdsArray = meshFeaturesExtension.featureIds;\n  } else {\n    featureIdsArray = [];\n  }\n\n  for (let i = 0; i < featureIdsArray.length; i++) {\n    const featureIds = featureIdsArray[i];\n    const label = `featureId_${i}`;\n\n    let featureIdComponent;\n    if (defined(featureIds.texture)) {\n      featureIdComponent = loadFeatureIdTexture(\n        loader,\n        gltf,\n        featureIds,\n        supportedImageFormats,\n        frameState,\n        label\n      );\n    } else if (defined(featureIds.attribute)) {\n      featureIdComponent = loadFeatureIdAttribute(featureIds, label);\n    } else {\n      // default to vertex ID, in other words an implicit range with\n      // offset: 0, repeat: 1\n      featureIdComponent = loadDefaultFeatureIds(featureIds, label);\n    }\n\n    primitive.featureIds.push(featureIdComponent);\n  }\n}\n\n// For EXT_feature_metadata\nfunction loadPrimitiveFeaturesLegacy(\n  loader,\n  gltf,\n  primitive,\n  metadataExtension,\n  supportedImageFormats,\n  frameState\n) {\n  // For looking up the featureCount for each set of feature IDs\n  const featureTables = gltf.extensions.EXT_feature_metadata.featureTables;\n\n  let nextFeatureIdIndex = 0;\n\n  // Feature ID Attributes\n  const featureIdAttributes = metadataExtension.featureIdAttributes;\n  if (defined(featureIdAttributes)) {\n    const featureIdAttributesLength = featureIdAttributes.length;\n    for (let i = 0; i < featureIdAttributesLength; ++i) {\n      const featureIdAttribute = featureIdAttributes[i];\n      const featureTableId = featureIdAttribute.featureTable;\n      const propertyTableId = loader._sortedPropertyTableIds.indexOf(\n        featureTableId\n      );\n      const featureCount = featureTables[featureTableId].count;\n      const label = `featureId_${nextFeatureIdIndex}`;\n      nextFeatureIdIndex++;\n\n      let featureIdComponent;\n      if (defined(featureIdAttribute.featureIds.attribute)) {\n        featureIdComponent = loadFeatureIdAttributeLegacy(\n          featureIdAttribute,\n          propertyTableId,\n          featureCount,\n          label\n        );\n      } else {\n        featureIdComponent = loadFeatureIdImplicitRangeLegacy(\n          featureIdAttribute,\n          propertyTableId,\n          featureCount,\n          label\n        );\n      }\n      primitive.featureIds.push(featureIdComponent);\n    }\n  }\n\n  // Feature ID Textures\n  const featureIdTextures = metadataExtension.featureIdTextures;\n  if (defined(featureIdTextures)) {\n    const featureIdTexturesLength = featureIdTextures.length;\n    for (let i = 0; i < featureIdTexturesLength; ++i) {\n      const featureIdTexture = featureIdTextures[i];\n      const featureTableId = featureIdTexture.featureTable;\n      const propertyTableId = loader._sortedPropertyTableIds.indexOf(\n        featureTableId\n      );\n      const featureCount = featureTables[featureTableId].count;\n      const featureIdLabel = `featureId_${nextFeatureIdIndex}`;\n      nextFeatureIdIndex++;\n\n      const featureIdComponent = loadFeatureIdTextureLegacy(\n        loader,\n        gltf,\n        featureIdTexture,\n        propertyTableId,\n        supportedImageFormats,\n        frameState,\n        featureCount,\n        featureIdLabel\n      );\n      // Feature ID textures are added after feature ID attributes in the list\n      primitive.featureIds.push(featureIdComponent);\n    }\n  }\n}\n\n// For primitive-level EXT_structural_metadata\nfunction loadPrimitiveMetadata(primitive, structuralMetadataExtension) {\n  if (!defined(structuralMetadataExtension)) {\n    return;\n  }\n\n  // Property Textures\n  if (defined(structuralMetadataExtension.propertyTextures)) {\n    primitive.propertyTextureIds = structuralMetadataExtension.propertyTextures;\n  }\n\n  // Property Attributes\n  if (defined(structuralMetadataExtension.propertyAttributes)) {\n    primitive.propertyAttributeIds =\n      structuralMetadataExtension.propertyAttributes;\n  }\n}\n\n// For EXT_feature_metadata\nfunction loadPrimitiveMetadataLegacy(loader, primitive, metadataExtension) {\n  // Feature Textures\n  if (defined(metadataExtension.featureTextures)) {\n    // feature textures are now identified by an integer index. To convert the\n    // string IDs to integers, find their place in the sorted list of feature\n    // table names\n    primitive.propertyTextureIds = metadataExtension.featureTextures.map(\n      function (id) {\n        return loader._sortedFeatureTextureIds.indexOf(id);\n      }\n    );\n  }\n}\n\nfunction loadInstances(loader, gltf, nodeExtensions, frameState) {\n  const instancingExtension = nodeExtensions.EXT_mesh_gpu_instancing;\n\n  const instances = new Instances();\n  const attributes = instancingExtension.attributes;\n  if (defined(attributes)) {\n    for (const semantic in attributes) {\n      if (attributes.hasOwnProperty(semantic)) {\n        const accessorId = attributes[semantic];\n        instances.attributes.push(\n          loadInstancedAttribute(\n            loader,\n            gltf,\n            accessorId,\n            attributes,\n            semantic,\n            frameState\n          )\n        );\n      }\n    }\n  }\n\n  const instancingExtExtensions = defaultValue(\n    instancingExtension.extensions,\n    defaultValue.EMPTY_OBJECT\n  );\n  const instanceFeatures = nodeExtensions.EXT_instance_features;\n  const featureMetadataLegacy = instancingExtExtensions.EXT_feature_metadata;\n\n  if (defined(instanceFeatures)) {\n    loadInstanceFeatures(instances, instanceFeatures);\n  } else if (defined(featureMetadataLegacy)) {\n    loadInstanceFeaturesLegacy(\n      gltf,\n      instances,\n      featureMetadataLegacy,\n      loader._sortedPropertyTableIds\n    );\n  }\n\n  return instances;\n}\n\n// For EXT_mesh_features\nfunction loadInstanceFeatures(instances, instanceFeaturesExtension) {\n  // feature IDs are required in EXT_instance_features\n  const featureIdsArray = instanceFeaturesExtension.featureIds;\n\n  for (let i = 0; i < featureIdsArray.length; i++) {\n    const featureIds = featureIdsArray[i];\n    const label = `instanceFeatureId_${i}`;\n\n    let featureIdComponent;\n    if (defined(featureIds.attribute)) {\n      featureIdComponent = loadFeatureIdAttribute(featureIds, label);\n    } else {\n      // in EXT_instance_features, the default is to assign IDs by instance\n      // ID. This can be expressed with offset: 0, repeat: 1\n      featureIdComponent = loadDefaultFeatureIds(featureIds, label);\n    }\n\n    instances.featureIds.push(featureIdComponent);\n  }\n}\n\n// For backwards-compatibility with EXT_feature_metadata\nfunction loadInstanceFeaturesLegacy(\n  gltf,\n  instances,\n  metadataExtension,\n  sortedPropertyTableIds\n) {\n  // For looking up the featureCount for each set of feature IDs\n  const featureTables = gltf.extensions.EXT_feature_metadata.featureTables;\n\n  const featureIdAttributes = metadataExtension.featureIdAttributes;\n  if (defined(featureIdAttributes)) {\n    const featureIdAttributesLength = featureIdAttributes.length;\n    for (let i = 0; i < featureIdAttributesLength; ++i) {\n      const featureIdAttribute = featureIdAttributes[i];\n      const featureTableId = featureIdAttribute.featureTable;\n      const propertyTableId = sortedPropertyTableIds.indexOf(featureTableId);\n      const featureCount = featureTables[featureTableId].count;\n      const label = `instanceFeatureId_${i}`;\n\n      let featureIdComponent;\n      if (defined(featureIdAttribute.featureIds.attribute)) {\n        featureIdComponent = loadFeatureIdAttributeLegacy(\n          featureIdAttribute,\n          propertyTableId,\n          featureCount,\n          label\n        );\n      } else {\n        featureIdComponent = loadFeatureIdImplicitRangeLegacy(\n          featureIdAttribute,\n          propertyTableId,\n          featureCount,\n          label\n        );\n      }\n      instances.featureIds.push(featureIdComponent);\n    }\n  }\n}\n\nfunction loadNode(loader, gltf, gltfNode, supportedImageFormats, frameState) {\n  const node = new Node();\n\n  node.name = gltfNode.name;\n\n  node.matrix = fromArray(Matrix4, gltfNode.matrix);\n  node.translation = fromArray(Cartesian3, gltfNode.translation);\n  node.rotation = fromArray(Quaternion, gltfNode.rotation);\n  node.scale = fromArray(Cartesian3, gltfNode.scale);\n\n  const nodeExtensions = defaultValue(\n    gltfNode.extensions,\n    defaultValue.EMPTY_OBJECT\n  );\n  const instancingExtension = nodeExtensions.EXT_mesh_gpu_instancing;\n  const articulationsExtension = nodeExtensions.AGI_articulations;\n\n  if (defined(instancingExtension)) {\n    if (loader._loadForClassification) {\n      throw new RuntimeError(\n        \"Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.\"\n      );\n    }\n    node.instances = loadInstances(loader, gltf, nodeExtensions, frameState);\n  }\n\n  if (defined(articulationsExtension)) {\n    node.articulationName = articulationsExtension.articulationName;\n  }\n\n  const meshId = gltfNode.mesh;\n  if (defined(meshId)) {\n    const mesh = gltf.meshes[meshId];\n    const primitives = mesh.primitives;\n    const primitivesLength = primitives.length;\n    for (let i = 0; i < primitivesLength; ++i) {\n      node.primitives.push(\n        loadPrimitive(\n          loader,\n          gltf,\n          primitives[i],\n          defined(node.instances),\n          supportedImageFormats,\n          frameState\n        )\n      );\n    }\n\n    // If the node has no weights array, it will look for the weights array provided\n    // by the mesh. If both are undefined, it will default to an array of zero weights.\n    const morphWeights = defaultValue(gltfNode.weights, mesh.weights);\n    const targets = node.primitives[0].morphTargets;\n    const targetsLength = targets.length;\n\n    // Since meshes are not stored as separate components, the mesh weights will still\n    // be stored at the node level.\n    node.morphWeights = defined(morphWeights)\n      ? morphWeights.slice()\n      : new Array(targetsLength).fill(0.0);\n  }\n\n  return node;\n}\n\nfunction loadNodes(loader, gltf, supportedImageFormats, frameState) {\n  if (!defined(gltf.nodes)) {\n    return [];\n  }\n\n  let i;\n  let j;\n\n  const nodesLength = gltf.nodes.length;\n  const nodes = new Array(nodesLength);\n  for (i = 0; i < nodesLength; ++i) {\n    const node = loadNode(\n      loader,\n      gltf,\n      gltf.nodes[i],\n      supportedImageFormats,\n      frameState\n    );\n    node.index = i;\n    nodes[i] = node;\n  }\n\n  for (i = 0; i < nodesLength; ++i) {\n    const childrenNodeIds = gltf.nodes[i].children;\n    if (defined(childrenNodeIds)) {\n      const childrenLength = childrenNodeIds.length;\n      for (j = 0; j < childrenLength; ++j) {\n        nodes[i].children.push(nodes[childrenNodeIds[j]]);\n      }\n    }\n  }\n\n  return nodes;\n}\n\nfunction loadSkin(loader, gltf, gltfSkin, nodes) {\n  const skin = new Skin();\n\n  const jointIds = gltfSkin.joints;\n  const jointsLength = jointIds.length;\n  const joints = new Array(jointsLength);\n  for (let i = 0; i < jointsLength; ++i) {\n    joints[i] = nodes[jointIds[i]];\n  }\n  skin.joints = joints;\n\n  const inverseBindMatricesAccessorId = gltfSkin.inverseBindMatrices;\n  if (defined(inverseBindMatricesAccessorId)) {\n    skin.inverseBindMatrices = loadAccessor(\n      loader,\n      gltf,\n      inverseBindMatricesAccessorId\n    );\n  } else {\n    skin.inverseBindMatrices = new Array(jointsLength).fill(Matrix4.IDENTITY);\n  }\n\n  return skin;\n}\n\nfunction loadSkins(loader, gltf, nodes) {\n  const gltfSkins = gltf.skins;\n\n  // Skins are disabled for classification models.\n  if (loader._loadForClassification || !defined(gltfSkins)) {\n    return [];\n  }\n\n  const skinsLength = gltf.skins.length;\n  const skins = new Array(skinsLength);\n  for (let i = 0; i < skinsLength; ++i) {\n    const skin = loadSkin(loader, gltf, gltf.skins[i], nodes);\n    skin.index = i;\n    skins[i] = skin;\n  }\n\n  const nodesLength = nodes.length;\n  for (let i = 0; i < nodesLength; ++i) {\n    const skinId = gltf.nodes[i].skin;\n    if (defined(skinId)) {\n      nodes[i].skin = skins[skinId];\n    }\n  }\n\n  return skins;\n}\n\nasync function loadStructuralMetadata(\n  loader,\n  gltf,\n  extension,\n  extensionLegacy,\n  supportedImageFormats,\n  frameState\n) {\n  const structuralMetadataLoader = new GltfStructuralMetadataLoader({\n    gltf: gltf,\n    extension: extension,\n    extensionLegacy: extensionLegacy,\n    gltfResource: loader._gltfResource,\n    baseResource: loader._baseResource,\n    supportedImageFormats: supportedImageFormats,\n    frameState: frameState,\n    asynchronous: loader._asynchronous,\n  });\n  loader._structuralMetadataLoader = structuralMetadataLoader;\n  return structuralMetadataLoader.load();\n}\n\nfunction loadAnimationSampler(loader, gltf, gltfSampler) {\n  const animationSampler = new AnimationSampler();\n\n  const inputAccessorId = gltfSampler.input;\n  animationSampler.input = loadAccessor(loader, gltf, inputAccessorId);\n\n  const gltfInterpolation = gltfSampler.interpolation;\n  animationSampler.interpolation = defaultValue(\n    InterpolationType[gltfInterpolation],\n    InterpolationType.LINEAR\n  );\n\n  const outputAccessorId = gltfSampler.output;\n  animationSampler.output = loadAccessor(loader, gltf, outputAccessorId, true);\n\n  return animationSampler;\n}\n\nfunction loadAnimationTarget(gltfTarget, nodes) {\n  const animationTarget = new AnimationTarget();\n\n  const nodeIndex = gltfTarget.node;\n  // If the node isn't defined, the animation channel should be ignored.\n  // It's easiest to signal this by returning undefined.\n  if (!defined(nodeIndex)) {\n    return undefined;\n  }\n\n  animationTarget.node = nodes[nodeIndex];\n\n  const path = gltfTarget.path.toUpperCase();\n  animationTarget.path = AnimatedPropertyType[path];\n\n  return animationTarget;\n}\n\nfunction loadAnimationChannel(gltfChannel, samplers, nodes) {\n  const animationChannel = new AnimationChannel();\n\n  const samplerIndex = gltfChannel.sampler;\n  animationChannel.sampler = samplers[samplerIndex];\n  animationChannel.target = loadAnimationTarget(gltfChannel.target, nodes);\n\n  return animationChannel;\n}\n\nfunction loadAnimation(loader, gltf, gltfAnimation, nodes) {\n  let i;\n\n  const animation = new Animation();\n  animation.name = gltfAnimation.name;\n\n  const gltfSamplers = gltfAnimation.samplers;\n  const samplersLength = gltfSamplers.length;\n\n  const samplers = new Array(samplersLength);\n  for (i = 0; i < samplersLength; i++) {\n    const sampler = loadAnimationSampler(loader, gltf, gltfSamplers[i]);\n    sampler.index = i;\n    samplers[i] = sampler;\n  }\n\n  const gltfChannels = gltfAnimation.channels;\n  const channelsLength = gltfChannels.length;\n\n  const channels = new Array(channelsLength);\n  for (i = 0; i < channelsLength; i++) {\n    channels[i] = loadAnimationChannel(gltfChannels[i], samplers, nodes);\n  }\n\n  animation.samplers = samplers;\n  animation.channels = channels;\n\n  return animation;\n}\n\nfunction loadAnimations(loader, gltf, nodes) {\n  const gltfAnimations = gltf.animations;\n\n  // Animations are disabled for classification models.\n  if (loader._loadForClassification || !defined(gltfAnimations)) {\n    return [];\n  }\n\n  const animationsLength = gltf.animations.length;\n  const animations = new Array(animationsLength);\n  for (let i = 0; i < animationsLength; ++i) {\n    const animation = loadAnimation(loader, gltf, gltf.animations[i], nodes);\n    animation.index = i;\n    animations[i] = animation;\n  }\n\n  return animations;\n}\n\nfunction loadArticulationStage(gltfStage) {\n  const stage = new ArticulationStage();\n  stage.name = gltfStage.name;\n\n  const type = gltfStage.type.toUpperCase();\n  stage.type = ArticulationStageType[type];\n\n  stage.minimumValue = gltfStage.minimumValue;\n  stage.maximumValue = gltfStage.maximumValue;\n  stage.initialValue = gltfStage.initialValue;\n\n  return stage;\n}\n\nfunction loadArticulation(gltfArticulation) {\n  const articulation = new Articulation();\n  articulation.name = gltfArticulation.name;\n\n  const gltfStages = gltfArticulation.stages;\n  const gltfStagesLength = gltfStages.length;\n\n  const stages = new Array(gltfStagesLength);\n  for (let i = 0; i < gltfStagesLength; i++) {\n    const stage = loadArticulationStage(gltfStages[i]);\n    stages[i] = stage;\n  }\n\n  articulation.stages = stages;\n\n  return articulation;\n}\n\nfunction loadArticulations(gltf) {\n  const extensions = defaultValue(gltf.extensions, defaultValue.EMPTY_OBJECT);\n  const articulationsExtension = extensions.AGI_articulations;\n\n  if (!defined(articulationsExtension)) {\n    return [];\n  }\n\n  const gltfArticulations = articulationsExtension.articulations;\n  if (!defined(gltfArticulations)) {\n    return [];\n  }\n\n  const gltfArticulationsLength = gltfArticulations.length;\n  const articulations = new Array(gltfArticulationsLength);\n  for (let i = 0; i < gltfArticulationsLength; i++) {\n    const articulation = loadArticulation(gltfArticulations[i]);\n    articulations[i] = articulation;\n  }\n\n  return articulations;\n}\n\nfunction getSceneNodeIds(gltf) {\n  let nodesIds;\n  if (defined(gltf.scenes) && defined(gltf.scene)) {\n    nodesIds = gltf.scenes[gltf.scene].nodes;\n  }\n  nodesIds = defaultValue(nodesIds, gltf.nodes);\n  nodesIds = defined(nodesIds) ? nodesIds : [];\n  return nodesIds;\n}\n\nfunction loadScene(gltf, nodes) {\n  const scene = new Scene();\n  const sceneNodeIds = getSceneNodeIds(gltf);\n  scene.nodes = sceneNodeIds.map(function (sceneNodeId) {\n    return nodes[sceneNodeId];\n  });\n  return scene;\n}\n\nconst scratchCenter = new Cartesian3();\n\nfunction parse(loader, gltf, supportedImageFormats, frameState) {\n  const extensions = defaultValue(gltf.extensions, defaultValue.EMPTY_OBJECT);\n  const structuralMetadataExtension = extensions.EXT_structural_metadata;\n  const featureMetadataExtensionLegacy = extensions.EXT_feature_metadata;\n  const cesiumRtcExtension = extensions.CESIUM_RTC;\n\n  if (defined(featureMetadataExtensionLegacy)) {\n    // If the old EXT_feature_metadata extension is present, sort the IDs of the\n    // feature tables and feature textures so we don't have to do this once\n    // per primitive.\n    //\n    // This must run before loadNodes so these IDs are available when\n    // attributes are processed.\n    const featureTables = featureMetadataExtensionLegacy.featureTables;\n    const featureTextures = featureMetadataExtensionLegacy.featureTextures;\n    const allPropertyTableIds = defined(featureTables) ? featureTables : [];\n    const allFeatureTextureIds = defined(featureTextures)\n      ? featureTextures\n      : [];\n    loader._sortedPropertyTableIds = Object.keys(allPropertyTableIds).sort();\n    loader._sortedFeatureTextureIds = Object.keys(allFeatureTextureIds).sort();\n  }\n\n  const nodes = loadNodes(loader, gltf, supportedImageFormats, frameState);\n  const skins = loadSkins(loader, gltf, nodes);\n  const animations = loadAnimations(loader, gltf, nodes);\n  const articulations = loadArticulations(gltf);\n  const scene = loadScene(gltf, nodes);\n\n  const components = new Components();\n  const asset = new Asset();\n  const copyright = gltf.asset.copyright;\n  if (defined(copyright)) {\n    const credits = copyright.split(\";\").map(function (string) {\n      return new Credit(string.trim());\n    });\n    asset.credits = credits;\n  }\n\n  components.asset = asset;\n  components.scene = scene;\n  components.nodes = nodes;\n  components.skins = skins;\n  components.animations = animations;\n  components.articulations = articulations;\n  components.upAxis = loader._upAxis;\n  components.forwardAxis = loader._forwardAxis;\n\n  if (defined(cesiumRtcExtension)) {\n    // CESIUM_RTC is almost always WGS84 coordinates so no axis conversion needed\n    const center = Cartesian3.fromArray(\n      cesiumRtcExtension.center,\n      0,\n      scratchCenter\n    );\n    components.transform = Matrix4.fromTranslation(\n      center,\n      components.transform\n    );\n  }\n\n  loader._components = components;\n\n  // Load structural metadata (property tables and property textures)\n  if (\n    defined(structuralMetadataExtension) ||\n    defined(featureMetadataExtensionLegacy)\n  ) {\n    const promise = loadStructuralMetadata(\n      loader,\n      gltf,\n      structuralMetadataExtension,\n      featureMetadataExtensionLegacy,\n      supportedImageFormats,\n      frameState\n    );\n    loader._loaderPromises.push(promise);\n  }\n\n  // Gather promises and handle any errors\n  const readyPromises = [];\n  readyPromises.push.apply(readyPromises, loader._loaderPromises);\n\n  // When incrementallyLoadTextures is true, the errors are caught and thrown individually\n  // since it doesn't affect the overall loader state\n  if (!loader._incrementallyLoadTextures) {\n    readyPromises.push.apply(readyPromises, loader._texturesPromises);\n  }\n\n  return Promise.all(readyPromises);\n}\n\nfunction unloadTextures(loader) {\n  const textureLoaders = loader._textureLoaders;\n  const textureLoadersLength = textureLoaders.length;\n  for (let i = 0; i < textureLoadersLength; ++i) {\n    textureLoaders[i] =\n      !textureLoaders[i].isDestroyed() &&\n      ResourceCache.unload(textureLoaders[i]);\n  }\n  loader._textureLoaders.length = 0;\n}\n\nfunction unloadBufferViewLoaders(loader) {\n  const bufferViewLoaders = loader._bufferViewLoaders;\n  const bufferViewLoadersLength = bufferViewLoaders.length;\n  for (let i = 0; i < bufferViewLoadersLength; ++i) {\n    bufferViewLoaders[i] =\n      !bufferViewLoaders[i].isDestroyed() &&\n      ResourceCache.unload(bufferViewLoaders[i]);\n  }\n  loader._bufferViewLoaders.length = 0;\n}\n\nfunction unloadGeometry(loader) {\n  const geometryLoaders = loader._geometryLoaders;\n  const geometryLoadersLength = geometryLoaders.length;\n  for (let i = 0; i < geometryLoadersLength; ++i) {\n    geometryLoaders[i] =\n      !geometryLoaders[i].isDestroyed() &&\n      ResourceCache.unload(geometryLoaders[i]);\n  }\n  loader._geometryLoaders.length = 0;\n}\n\nfunction unloadGeneratedAttributes(loader) {\n  const buffers = loader._postProcessBuffers;\n  const length = buffers.length;\n  for (let i = 0; i < length; i++) {\n    const buffer = buffers[i];\n    if (!buffer.isDestroyed()) {\n      buffer.destroy();\n    }\n  }\n  buffers.length = 0;\n}\n\nfunction unloadStructuralMetadata(loader) {\n  if (\n    defined(loader._structuralMetadataLoader) &&\n    !loader._structuralMetadataLoader.isDestroyed()\n  ) {\n    loader._structuralMetadataLoader.destroy();\n    loader._structuralMetadataLoader = undefined;\n  }\n}\n\n/**\n * Returns whether the resource has been unloaded.\n * @private\n */\nGltfLoader.prototype.isUnloaded = function () {\n  return this._state === GltfLoaderState.UNLOADED;\n};\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfLoader.prototype.unload = function () {\n  if (defined(this._gltfJsonLoader) && !this._gltfJsonLoader.isDestroyed()) {\n    ResourceCache.unload(this._gltfJsonLoader);\n  }\n  this._gltfJsonLoader = undefined;\n\n  unloadTextures(this);\n  unloadBufferViewLoaders(this);\n  unloadGeometry(this);\n  unloadGeneratedAttributes(this);\n  unloadStructuralMetadata(this);\n\n  this._components = undefined;\n  this._typedArray = undefined;\n  this._state = GltfLoaderState.UNLOADED;\n};\n\nexport default GltfLoader;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D u_pointCloud_colorGBuffer;\\n\\\nuniform sampler2D u_pointCloud_depthGBuffer;\\n\\\nuniform vec2 u_distanceAndEdlStrength;\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvec2 neighborContribution(float log2Depth, vec2 offset)\\n\\\n{\\n\\\n    float dist = u_distanceAndEdlStrength.x;\\n\\\n    vec2 texCoordOrig = v_textureCoordinates + offset * dist;\\n\\\n    vec2 texCoord0 = v_textureCoordinates + offset * floor(dist);\\n\\\n    vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);\\n\\\n\\n\\\n    float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0));\\n\\\n    float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1));\\n\\\n\\n\\\n    // ignore depth values that are the clear depth\\n\\\n    if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {\\n\\\n        return vec2(0.0);\\n\\\n    }\\n\\\n\\n\\\n    // interpolate the two adjacent depth values\\n\\\n    float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));\\n\\\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);\\n\\\n    return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);\\n\\\n}\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates));\\n\\\n\\n\\\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);\\n\\\n    eyeCoordinate /= eyeCoordinate.w;\\n\\\n\\n\\\n    float log2Depth = log2(-eyeCoordinate.z);\\n\\\n\\n\\\n    if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer\\n\\\n    {\\n\\\n        discard;\\n\\\n    }\\n\\\n\\n\\\n    vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates);\\n\\\n\\n\\\n    // sample from neighbors left, right, down, up\\n\\\n    vec2 texelSize = 1.0 / czm_viewport.zw;\\n\\\n\\n\\\n    vec2 responseAndCount = vec2(0.0);\\n\\\n\\n\\\n    responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));\\n\\\n    responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));\\n\\\n    responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));\\n\\\n    responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));\\n\\\n\\n\\\n    float response = responseAndCount.x / responseAndCount.y;\\n\\\n    float strength = u_distanceAndEdlStrength.y;\\n\\\n    float shade = exp(-response * 300.0 * strength);\\n\\\n    color.rgb *= shade;\\n\\\n    out_FragColor = vec4(color);\\n\\\n\\n\\\n    // Input and output depth are the same.\\n\\\n    gl_FragDepth = depthOrLogDepth;\\n\\\n}\\n\\\n\";\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport BlendingState from \"../Scene/BlendingState.js\";\nimport StencilConstants from \"../Scene/StencilConstants.js\";\nimport PointCloudEyeDomeLightingShader from \"../Shaders/PostProcessStages/PointCloudEyeDomeLighting.js\";\n\n/**\n * Eye dome lighting. Does not support points with per-point translucency, but does allow translucent styling against the globe.\n * Requires support for EXT_frag_depth and WEBGL_draw_buffers extensions in WebGL 1.0.\n *\n * @private\n */\nfunction PointCloudEyeDomeLighting() {\n  this._framebuffer = new FramebufferManager({\n    colorAttachmentsLength: 2,\n    depth: true,\n    supportsDepthTexture: true,\n  });\n\n  this._drawCommand = undefined;\n  this._clearCommand = undefined;\n\n  this._strength = 1.0;\n  this._radius = 1.0;\n}\n\nObject.defineProperties(PointCloudEyeDomeLighting.prototype, {\n  framebuffer: {\n    get: function () {\n      return this._framebuffer.framebuffer;\n    },\n  },\n  colorGBuffer: {\n    get: function () {\n      return this._framebuffer.getColorTexture(0);\n    },\n  },\n  depthGBuffer: {\n    get: function () {\n      return this._framebuffer.getColorTexture(1);\n    },\n  },\n});\n\nfunction destroyFramebuffer(processor) {\n  processor._framebuffer.destroy();\n  processor._drawCommand = undefined;\n  processor._clearCommand = undefined;\n}\n\nconst distanceAndEdlStrengthScratch = new Cartesian2();\n\nfunction createCommands(processor, context) {\n  const blendFS = new ShaderSource({\n    defines: [\"LOG_DEPTH_WRITE\"],\n    sources: [PointCloudEyeDomeLightingShader],\n  });\n\n  const blendUniformMap = {\n    u_pointCloud_colorGBuffer: function () {\n      return processor.colorGBuffer;\n    },\n    u_pointCloud_depthGBuffer: function () {\n      return processor.depthGBuffer;\n    },\n    u_distanceAndEdlStrength: function () {\n      distanceAndEdlStrengthScratch.x = processor._radius;\n      distanceAndEdlStrengthScratch.y = processor._strength;\n      return distanceAndEdlStrengthScratch;\n    },\n  };\n\n  const blendRenderState = RenderState.fromCache({\n    blending: BlendingState.ALPHA_BLEND,\n    depthMask: true,\n    depthTest: {\n      enabled: true,\n    },\n    stencilTest: StencilConstants.setCesium3DTileBit(),\n    stencilMask: StencilConstants.CESIUM_3D_TILE_MASK,\n  });\n\n  processor._drawCommand = context.createViewportQuadCommand(blendFS, {\n    uniformMap: blendUniformMap,\n    renderState: blendRenderState,\n    pass: Pass.CESIUM_3D_TILE,\n    owner: processor,\n  });\n\n  processor._clearCommand = new ClearCommand({\n    framebuffer: processor.framebuffer,\n    color: new Color(0.0, 0.0, 0.0, 0.0),\n    depth: 1.0,\n    renderState: RenderState.fromCache(),\n    pass: Pass.CESIUM_3D_TILE,\n    owner: processor,\n  });\n}\n\nfunction createResources(processor, context) {\n  const width = context.drawingBufferWidth;\n  const height = context.drawingBufferHeight;\n  processor._framebuffer.update(context, width, height);\n  createCommands(processor, context);\n}\n\nfunction isSupported(context) {\n  return context.drawBuffers && context.fragmentDepth;\n}\n\nPointCloudEyeDomeLighting.isSupported = isSupported;\n\nfunction getECShaderProgram(context, shaderProgram) {\n  let shader = context.shaderCache.getDerivedShaderProgram(shaderProgram, \"EC\");\n  if (!defined(shader)) {\n    const attributeLocations = shaderProgram._attributeLocations;\n\n    const fs = shaderProgram.fragmentShaderSource.clone();\n\n    fs.sources.splice(\n      0,\n      0,\n      `layout (location = 0) out vec4 out_FragData_0;\\nlayout (location = 1) out vec4 out_FragData_1;`\n    );\n\n    fs.sources = fs.sources.map(function (source) {\n      source = ShaderSource.replaceMain(\n        source,\n        \"czm_point_cloud_post_process_main\"\n      );\n      source = source.replaceAll(/out_FragColor/g, \"out_FragData_0\");\n      return source;\n    });\n\n    fs.sources.push(\n      \"void main() \\n\" +\n        \"{ \\n\" +\n        \"    czm_point_cloud_post_process_main(); \\n\" +\n        \"#ifdef LOG_DEPTH\\n\" +\n        \"    czm_writeLogDepth();\\n\" +\n        \"    out_FragData_1 = czm_packDepth(gl_FragDepth); \\n\" +\n        \"#else\\n\" +\n        \"    out_FragData_1 = czm_packDepth(gl_FragCoord.z);\\n\" +\n        \"#endif\\n\" +\n        \"}\"\n    );\n\n    shader = context.shaderCache.createDerivedShaderProgram(\n      shaderProgram,\n      \"EC\",\n      {\n        vertexShaderSource: shaderProgram.vertexShaderSource,\n        fragmentShaderSource: fs,\n        attributeLocations: attributeLocations,\n      }\n    );\n  }\n\n  return shader;\n}\n\nPointCloudEyeDomeLighting.prototype.update = function (\n  frameState,\n  commandStart,\n  pointCloudShading,\n  boundingVolume\n) {\n  if (!isSupported(frameState.context)) {\n    return;\n  }\n\n  this._strength = pointCloudShading.eyeDomeLightingStrength;\n  this._radius =\n    pointCloudShading.eyeDomeLightingRadius * frameState.pixelRatio;\n\n  createResources(this, frameState.context);\n\n  // Hijack existing point commands to render into an offscreen FBO.\n  let i;\n  const commandList = frameState.commandList;\n  const commandEnd = commandList.length;\n\n  for (i = commandStart; i < commandEnd; ++i) {\n    const command = commandList[i];\n    if (\n      command.primitiveType !== PrimitiveType.POINTS ||\n      command.pass === Pass.TRANSLUCENT\n    ) {\n      continue;\n    }\n\n    let derivedCommand;\n    let originalShaderProgram;\n\n    let derivedCommandObject = command.derivedCommands.pointCloudProcessor;\n    if (defined(derivedCommandObject)) {\n      derivedCommand = derivedCommandObject.command;\n      originalShaderProgram = derivedCommandObject.originalShaderProgram;\n    }\n\n    if (\n      !defined(derivedCommand) ||\n      command.dirty ||\n      originalShaderProgram !== command.shaderProgram ||\n      derivedCommand.framebuffer !== this.framebuffer\n    ) {\n      // Prevent crash when tiles out-of-view come in-view during context size change or\n      // when the underlying shader changes while EDL is disabled\n      derivedCommand = DrawCommand.shallowClone(command, derivedCommand);\n      derivedCommand.framebuffer = this.framebuffer;\n      derivedCommand.shaderProgram = getECShaderProgram(\n        frameState.context,\n        command.shaderProgram\n      );\n      derivedCommand.castShadows = false;\n      derivedCommand.receiveShadows = false;\n\n      if (!defined(derivedCommandObject)) {\n        derivedCommandObject = {\n          command: derivedCommand,\n          originalShaderProgram: command.shaderProgram,\n        };\n        command.derivedCommands.pointCloudProcessor = derivedCommandObject;\n      }\n\n      derivedCommandObject.originalShaderProgram = command.shaderProgram;\n    }\n\n    commandList[i] = derivedCommand;\n  }\n\n  const clearCommand = this._clearCommand;\n  const blendCommand = this._drawCommand;\n\n  blendCommand.boundingVolume = boundingVolume;\n\n  // Blend EDL into the main FBO\n  commandList.push(blendCommand);\n  commandList.push(clearCommand);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see PointCloudEyeDomeLighting#destroy\n */\nPointCloudEyeDomeLighting.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * processor = processor && processor.destroy();\n *\n * @see PointCloudEyeDomeLighting#isDestroyed\n */\nPointCloudEyeDomeLighting.prototype.destroy = function () {\n  destroyFramebuffer(this);\n  return destroyObject(this);\n};\nexport default PointCloudEyeDomeLighting;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport PointCloudEyeDomeLighting from \"./PointCloudEyeDomeLighting.js\";\n\n/**\n * Options for performing point attenuation based on geometric error when rendering\n * point clouds using 3D Tiles.\n *\n * @param {object} [options] Object with the following properties:\n * @param {boolean} [options.attenuation=false] Perform point attenuation based on geometric error.\n * @param {number} [options.geometricErrorScale=1.0] Scale to be applied to each tile's geometric error.\n * @param {number} [options.maximumAttenuation] Maximum attenuation in pixels. Defaults to the Cesium3DTileset's maximumScreenSpaceError.\n * @param {number} [options.baseResolution] Average base resolution for the dataset in meters. Substitute for Geometric Error when not available.\n * @param {boolean} [options.eyeDomeLighting=true] When true, use eye dome lighting when drawing with point attenuation.\n * @param {number} [options.eyeDomeLightingStrength=1.0] Increasing this value increases contrast on slopes and edges.\n * @param {number} [options.eyeDomeLightingRadius=1.0] Increase the thickness of contours from eye dome lighting.\n * @param {boolean} [options.backFaceCulling=false] Determines whether back-facing points are hidden. This option works only if data has normals included.\n * @param {boolean} [options.normalShading=true] Determines whether a point cloud that contains normals is shaded by the scene's light source.\n *\n * @alias PointCloudShading\n * @constructor\n */\nfunction PointCloudShading(options) {\n  const pointCloudShading = defaultValue(options, {});\n\n  /**\n   * Perform point attenuation based on geometric error.\n   * @type {boolean}\n   * @default false\n   */\n  this.attenuation = defaultValue(pointCloudShading.attenuation, false);\n\n  /**\n   * Scale to be applied to the geometric error before computing attenuation.\n   * @type {number}\n   * @default 1.0\n   */\n  this.geometricErrorScale = defaultValue(\n    pointCloudShading.geometricErrorScale,\n    1.0\n  );\n\n  /**\n   * Maximum point attenuation in pixels. If undefined, the Cesium3DTileset's maximumScreenSpaceError will be used.\n   * @type {number}\n   */\n  this.maximumAttenuation = pointCloudShading.maximumAttenuation;\n\n  /**\n   * Average base resolution for the dataset in meters.\n   * Used in place of geometric error when geometric error is 0.\n   * If undefined, an approximation will be computed for each tile that has geometric error of 0.\n   * @type {number}\n   */\n  this.baseResolution = pointCloudShading.baseResolution;\n\n  /**\n   * Use eye dome lighting when drawing with point attenuation\n   * Requires support for EXT_frag_depth, OES_texture_float, and WEBGL_draw_buffers extensions in WebGL 1.0,\n   * otherwise eye dome lighting is ignored.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.eyeDomeLighting = defaultValue(pointCloudShading.eyeDomeLighting, true);\n\n  /**\n   * Eye dome lighting strength (apparent contrast)\n   * @type {number}\n   * @default 1.0\n   */\n  this.eyeDomeLightingStrength = defaultValue(\n    pointCloudShading.eyeDomeLightingStrength,\n    1.0\n  );\n\n  /**\n   * Thickness of contours from eye dome lighting\n   * @type {number}\n   * @default 1.0\n   */\n  this.eyeDomeLightingRadius = defaultValue(\n    pointCloudShading.eyeDomeLightingRadius,\n    1.0\n  );\n\n  /**\n   * Determines whether back-facing points are hidden.\n   * This option works only if data has normals included.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.backFaceCulling = defaultValue(pointCloudShading.backFaceCulling, false);\n\n  /**\n   * Determines whether a point cloud that contains normals is shaded by the scene's light source.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.normalShading = defaultValue(pointCloudShading.normalShading, true);\n}\n\n/**\n * Determines if point cloud shading is supported.\n *\n * @param {Scene} scene The scene.\n * @returns {boolean} <code>true</code> if point cloud shading is supported; otherwise, returns <code>false</code>\n */\nPointCloudShading.isSupported = function (scene) {\n  return PointCloudEyeDomeLighting.isSupported(scene.context);\n};\nexport default PointCloudShading;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * Functions that do scene-dependent transforms between rendering-related coordinate systems.\n *\n * @namespace SceneTransforms\n */\nconst SceneTransforms = {};\n\nconst actualPositionScratch = new Cartesian4(0, 0, 0, 1);\nlet positionCC = new Cartesian4();\nconst scratchViewport = new BoundingRectangle();\n\nconst scratchWindowCoord0 = new Cartesian2();\nconst scratchWindowCoord1 = new Cartesian2();\n\n/**\n * Transforms a position in WGS84 coordinates to window coordinates.  This is commonly used to place an\n * HTML element at the same screen position as an object in the scene.\n *\n * @param {Scene} scene The scene.\n * @param {Cartesian3} position The position in WGS84 (world) coordinates.\n * @param {Cartesian2} [result] An optional object to return the input position transformed to window coordinates.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.  This may be <code>undefined</code> if the input position is near the center of the ellipsoid.\n *\n * @example\n * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.\n * const scene = widget.scene;\n * const ellipsoid = scene.globe.ellipsoid;\n * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);\n * handler.setInputAction(function(movement) {\n *     console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));\n * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);\n */\nSceneTransforms.wgs84ToWindowCoordinates = function (scene, position, result) {\n  return SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates(\n    scene,\n    position,\n    Cartesian3.ZERO,\n    result\n  );\n};\n\nconst scratchCartesian4 = new Cartesian4();\nconst scratchEyeOffset = new Cartesian3();\n\nfunction worldToClip(position, eyeOffset, camera, result) {\n  const viewMatrix = camera.viewMatrix;\n\n  const positionEC = Matrix4.multiplyByVector(\n    viewMatrix,\n    Cartesian4.fromElements(\n      position.x,\n      position.y,\n      position.z,\n      1,\n      scratchCartesian4\n    ),\n    scratchCartesian4\n  );\n\n  const zEyeOffset = Cartesian3.multiplyComponents(\n    eyeOffset,\n    Cartesian3.normalize(positionEC, scratchEyeOffset),\n    scratchEyeOffset\n  );\n  positionEC.x += eyeOffset.x + zEyeOffset.x;\n  positionEC.y += eyeOffset.y + zEyeOffset.y;\n  positionEC.z += zEyeOffset.z;\n\n  return Matrix4.multiplyByVector(\n    camera.frustum.projectionMatrix,\n    positionEC,\n    result\n  );\n}\n\nconst scratchMaxCartographic = new Cartographic(\n  Math.PI,\n  CesiumMath.PI_OVER_TWO\n);\nconst scratchProjectedCartesian = new Cartesian3();\nconst scratchCameraPosition = new Cartesian3();\n\n/**\n * @private\n */\nSceneTransforms.wgs84WithEyeOffsetToWindowCoordinates = function (\n  scene,\n  position,\n  eyeOffset,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  if (!defined(position)) {\n    throw new DeveloperError(\"position is required.\");\n  }\n  //>>includeEnd('debug');\n\n  // Transform for 3D, 2D, or Columbus view\n  const frameState = scene.frameState;\n  const actualPosition = SceneTransforms.computeActualWgs84Position(\n    frameState,\n    position,\n    actualPositionScratch\n  );\n\n  if (!defined(actualPosition)) {\n    return undefined;\n  }\n\n  // Assuming viewport takes up the entire canvas...\n  const canvas = scene.canvas;\n  const viewport = scratchViewport;\n  viewport.x = 0;\n  viewport.y = 0;\n  viewport.width = canvas.clientWidth;\n  viewport.height = canvas.clientHeight;\n\n  const camera = scene.camera;\n  let cameraCentered = false;\n\n  if (frameState.mode === SceneMode.SCENE2D) {\n    const projection = scene.mapProjection;\n    const maxCartographic = scratchMaxCartographic;\n    const maxCoord = projection.project(\n      maxCartographic,\n      scratchProjectedCartesian\n    );\n\n    const cameraPosition = Cartesian3.clone(\n      camera.position,\n      scratchCameraPosition\n    );\n    const frustum = camera.frustum.clone();\n\n    const viewportTransformation = Matrix4.computeViewportTransformation(\n      viewport,\n      0.0,\n      1.0,\n      new Matrix4()\n    );\n    const projectionMatrix = camera.frustum.projectionMatrix;\n\n    const x = camera.positionWC.y;\n    const eyePoint = Cartesian3.fromElements(\n      CesiumMath.sign(x) * maxCoord.x - x,\n      0.0,\n      -camera.positionWC.x\n    );\n    const windowCoordinates = Transforms.pointToGLWindowCoordinates(\n      projectionMatrix,\n      viewportTransformation,\n      eyePoint\n    );\n\n    if (\n      x === 0.0 ||\n      windowCoordinates.x <= 0.0 ||\n      windowCoordinates.x >= canvas.clientWidth\n    ) {\n      cameraCentered = true;\n    } else {\n      if (windowCoordinates.x > canvas.clientWidth * 0.5) {\n        viewport.width = windowCoordinates.x;\n\n        camera.frustum.right = maxCoord.x - x;\n\n        positionCC = worldToClip(actualPosition, eyeOffset, camera, positionCC);\n        SceneTransforms.clipToGLWindowCoordinates(\n          viewport,\n          positionCC,\n          scratchWindowCoord0\n        );\n\n        viewport.x += windowCoordinates.x;\n\n        camera.position.x = -camera.position.x;\n\n        const right = camera.frustum.right;\n        camera.frustum.right = -camera.frustum.left;\n        camera.frustum.left = -right;\n\n        positionCC = worldToClip(actualPosition, eyeOffset, camera, positionCC);\n        SceneTransforms.clipToGLWindowCoordinates(\n          viewport,\n          positionCC,\n          scratchWindowCoord1\n        );\n      } else {\n        viewport.x += windowCoordinates.x;\n        viewport.width -= windowCoordinates.x;\n\n        camera.frustum.left = -maxCoord.x - x;\n\n        positionCC = worldToClip(actualPosition, eyeOffset, camera, positionCC);\n        SceneTransforms.clipToGLWindowCoordinates(\n          viewport,\n          positionCC,\n          scratchWindowCoord0\n        );\n\n        viewport.x = viewport.x - viewport.width;\n\n        camera.position.x = -camera.position.x;\n\n        const left = camera.frustum.left;\n        camera.frustum.left = -camera.frustum.right;\n        camera.frustum.right = -left;\n\n        positionCC = worldToClip(actualPosition, eyeOffset, camera, positionCC);\n        SceneTransforms.clipToGLWindowCoordinates(\n          viewport,\n          positionCC,\n          scratchWindowCoord1\n        );\n      }\n\n      Cartesian3.clone(cameraPosition, camera.position);\n      camera.frustum = frustum.clone();\n\n      result = Cartesian2.clone(scratchWindowCoord0, result);\n      if (result.x < 0.0 || result.x > canvas.clientWidth) {\n        result.x = scratchWindowCoord1.x;\n      }\n    }\n  }\n\n  if (frameState.mode !== SceneMode.SCENE2D || cameraCentered) {\n    // View-projection matrix to transform from world coordinates to clip coordinates\n    positionCC = worldToClip(actualPosition, eyeOffset, camera, positionCC);\n    if (\n      positionCC.z < 0 &&\n      !(camera.frustum instanceof OrthographicFrustum) &&\n      !(camera.frustum instanceof OrthographicOffCenterFrustum)\n    ) {\n      return undefined;\n    }\n\n    result = SceneTransforms.clipToGLWindowCoordinates(\n      viewport,\n      positionCC,\n      result\n    );\n  }\n\n  result.y = canvas.clientHeight - result.y;\n  return result;\n};\n\n/**\n * Transforms a position in WGS84 coordinates to drawing buffer coordinates.  This may produce different\n * results from SceneTransforms.wgs84ToWindowCoordinates when the browser zoom is not 100%, or on high-DPI displays.\n *\n * @param {Scene} scene The scene.\n * @param {Cartesian3} position The position in WGS84 (world) coordinates.\n * @param {Cartesian2} [result] An optional object to return the input position transformed to window coordinates.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.  This may be <code>undefined</code> if the input position is near the center of the ellipsoid.\n *\n * @example\n * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.\n * const scene = widget.scene;\n * const ellipsoid = scene.globe.ellipsoid;\n * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);\n * handler.setInputAction(function(movement) {\n *     console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));\n * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);\n */\nSceneTransforms.wgs84ToDrawingBufferCoordinates = function (\n  scene,\n  position,\n  result\n) {\n  result = SceneTransforms.wgs84ToWindowCoordinates(scene, position, result);\n  if (!defined(result)) {\n    return undefined;\n  }\n\n  return SceneTransforms.transformWindowToDrawingBuffer(scene, result, result);\n};\n\nconst projectedPosition = new Cartesian3();\nconst positionInCartographic = new Cartographic();\n\n/**\n * @private\n */\nSceneTransforms.computeActualWgs84Position = function (\n  frameState,\n  position,\n  result\n) {\n  const mode = frameState.mode;\n\n  if (mode === SceneMode.SCENE3D) {\n    return Cartesian3.clone(position, result);\n  }\n\n  const projection = frameState.mapProjection;\n  const cartographic = projection.ellipsoid.cartesianToCartographic(\n    position,\n    positionInCartographic\n  );\n  if (!defined(cartographic)) {\n    return undefined;\n  }\n\n  projection.project(cartographic, projectedPosition);\n\n  if (mode === SceneMode.COLUMBUS_VIEW) {\n    return Cartesian3.fromElements(\n      projectedPosition.z,\n      projectedPosition.x,\n      projectedPosition.y,\n      result\n    );\n  }\n\n  if (mode === SceneMode.SCENE2D) {\n    return Cartesian3.fromElements(\n      0.0,\n      projectedPosition.x,\n      projectedPosition.y,\n      result\n    );\n  }\n\n  // mode === SceneMode.MORPHING\n  const morphTime = frameState.morphTime;\n  return Cartesian3.fromElements(\n    CesiumMath.lerp(projectedPosition.z, position.x, morphTime),\n    CesiumMath.lerp(projectedPosition.x, position.y, morphTime),\n    CesiumMath.lerp(projectedPosition.y, position.z, morphTime),\n    result\n  );\n};\n\nconst positionNDC = new Cartesian3();\nconst positionWC = new Cartesian3();\nconst viewportTransform = new Matrix4();\n\n/**\n * @private\n */\nSceneTransforms.clipToGLWindowCoordinates = function (\n  viewport,\n  position,\n  result\n) {\n  // Perspective divide to transform from clip coordinates to normalized device coordinates\n  Cartesian3.divideByScalar(position, position.w, positionNDC);\n\n  // Viewport transform to transform from clip coordinates to window coordinates\n  Matrix4.computeViewportTransformation(viewport, 0.0, 1.0, viewportTransform);\n  Matrix4.multiplyByPoint(viewportTransform, positionNDC, positionWC);\n\n  return Cartesian2.fromCartesian3(positionWC, result);\n};\n\n/**\n * @private\n */\nSceneTransforms.transformWindowToDrawingBuffer = function (\n  scene,\n  windowPosition,\n  result\n) {\n  const canvas = scene.canvas;\n  const xScale = scene.drawingBufferWidth / canvas.clientWidth;\n  const yScale = scene.drawingBufferHeight / canvas.clientHeight;\n  return Cartesian2.fromElements(\n    windowPosition.x * xScale,\n    windowPosition.y * yScale,\n    result\n  );\n};\n\nconst scratchNDC = new Cartesian4();\nconst scratchWorldCoords = new Cartesian4();\n\n/**\n * @private\n */\nSceneTransforms.drawingBufferToWgs84Coordinates = function (\n  scene,\n  drawingBufferPosition,\n  depth,\n  result\n) {\n  const context = scene.context;\n  const uniformState = context.uniformState;\n\n  const currentFrustum = uniformState.currentFrustum;\n  const near = currentFrustum.x;\n  const far = currentFrustum.y;\n\n  if (scene.frameState.useLogDepth) {\n    // transforming logarithmic depth of form\n    // log2(z + 1) / log2( far + 1);\n    // to perspective form\n    // (far - far * near / z) / (far - near)\n    const log2Depth = depth * uniformState.log2FarDepthFromNearPlusOne;\n    const depthFromNear = Math.pow(2.0, log2Depth) - 1.0;\n    depth = (far * (1.0 - near / (depthFromNear + near))) / (far - near);\n  }\n\n  const viewport = scene.view.passState.viewport;\n  const ndc = Cartesian4.clone(Cartesian4.UNIT_W, scratchNDC);\n  ndc.x = ((drawingBufferPosition.x - viewport.x) / viewport.width) * 2.0 - 1.0;\n  ndc.y =\n    ((drawingBufferPosition.y - viewport.y) / viewport.height) * 2.0 - 1.0;\n  ndc.z = depth * 2.0 - 1.0;\n  ndc.w = 1.0;\n\n  let worldCoords;\n  let frustum = scene.camera.frustum;\n  if (!defined(frustum.fovy)) {\n    const offCenterFrustum = frustum.offCenterFrustum;\n    if (defined(offCenterFrustum)) {\n      frustum = offCenterFrustum;\n    }\n    worldCoords = scratchWorldCoords;\n    worldCoords.x =\n      (ndc.x * (frustum.right - frustum.left) + frustum.left + frustum.right) *\n      0.5;\n    worldCoords.y =\n      (ndc.y * (frustum.top - frustum.bottom) + frustum.bottom + frustum.top) *\n      0.5;\n    worldCoords.z = (ndc.z * (near - far) - near - far) * 0.5;\n    worldCoords.w = 1.0;\n\n    worldCoords = Matrix4.multiplyByVector(\n      uniformState.inverseView,\n      worldCoords,\n      worldCoords\n    );\n  } else {\n    worldCoords = Matrix4.multiplyByVector(\n      uniformState.inverseViewProjection,\n      ndc,\n      scratchWorldCoords\n    );\n\n    // Reverse perspective divide\n    const w = 1.0 / worldCoords.w;\n    Cartesian3.multiplyByScalar(worldCoords, w, worldCoords);\n  }\n  return Cartesian3.fromCartesian4(worldCoords, result);\n};\nexport default SceneTransforms;\n", "/**\n * The direction to display a primitive or ImageryLayer relative to the {@link Scene#splitPosition}.\n *\n * @enum {number}\n *\n * @see ImageryLayer#splitDirection\n * @see Cesium3DTileset#splitDirection\n */\nconst SplitDirection = {\n  /**\n   * Display the primitive or ImageryLayer to the left of the {@link Scene#splitPosition}.\n   *\n   * @type {number}\n   * @constant\n   */\n  LEFT: -1.0,\n\n  /**\n   *  Always display the primitive or ImageryLayer.\n   *\n   * @type {number}\n   * @constant\n   */\n  NONE: 0.0,\n\n  /**\n   * Display the primitive or ImageryLayer to the right of the {@link Scene#splitPosition}.\n   *\n   * @type {number}\n   * @constant\n   */\n  RIGHT: 1.0,\n};\nexport default Object.freeze(SplitDirection);\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * Handles parsing of a Batched 3D Model.\n *\n * @namespace B3dmParser\n * @private\n */\nconst B3dmParser = {};\nB3dmParser._deprecationWarning = deprecationWarning;\n\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\n\n/**\n * Parses the contents of a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel|Batched 3D Model}.\n *\n * @private\n *\n * @param {ArrayBuffer} arrayBuffer The array buffer containing the b3dm.\n * @param {number} [byteOffset=0] The byte offset of the beginning of the b3dm in the array buffer.\n * @returns {object} Returns an object with the batch length, feature table (binary and json), batch table (binary and json) and glTF parts of the b3dm.\n */\nB3dmParser.parse = function (arrayBuffer, byteOffset) {\n  const byteStart = defaultValue(byteOffset, 0);\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"arrayBuffer\", arrayBuffer);\n  //>>includeEnd('debug');\n\n  byteOffset = byteStart;\n\n  const uint8Array = new Uint8Array(arrayBuffer);\n  const view = new DataView(arrayBuffer);\n  byteOffset += sizeOfUint32; // Skip magic\n\n  const version = view.getUint32(byteOffset, true);\n  if (version !== 1) {\n    throw new RuntimeError(\n      `Only Batched 3D Model version 1 is supported.  Version ${version} is not.`\n    );\n  }\n  byteOffset += sizeOfUint32;\n\n  const byteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  let featureTableJsonByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  let featureTableBinaryByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  let batchTableJsonByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  let batchTableBinaryByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  let batchLength;\n\n  // Legacy header #1: [batchLength] [batchTableByteLength]\n  // Legacy header #2: [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]\n  // Current header: [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength]\n  // If the header is in the first legacy format 'batchTableJsonByteLength' will be the start of the JSON string (a quotation mark) or the glTF magic.\n  // Accordingly its first byte will be either 0x22 or 0x67, and so the minimum uint32 expected is 0x22000000 = 570425344 = 570MB. It is unlikely that the feature table JSON will exceed this length.\n  // The check for the second legacy format is similar, except it checks 'batchTableBinaryByteLength' instead\n  if (batchTableJsonByteLength >= 570425344) {\n    // First legacy check\n    byteOffset -= sizeOfUint32 * 2;\n    batchLength = featureTableJsonByteLength;\n    batchTableJsonByteLength = featureTableBinaryByteLength;\n    batchTableBinaryByteLength = 0;\n    featureTableJsonByteLength = 0;\n    featureTableBinaryByteLength = 0;\n    B3dmParser._deprecationWarning(\n      \"b3dm-legacy-header\",\n      \"This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.\"\n    );\n  } else if (batchTableBinaryByteLength >= 570425344) {\n    // Second legacy check\n    byteOffset -= sizeOfUint32;\n    batchLength = batchTableJsonByteLength;\n    batchTableJsonByteLength = featureTableJsonByteLength;\n    batchTableBinaryByteLength = featureTableBinaryByteLength;\n    featureTableJsonByteLength = 0;\n    featureTableBinaryByteLength = 0;\n    B3dmParser._deprecationWarning(\n      \"b3dm-legacy-header\",\n      \"This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.\"\n    );\n  }\n\n  let featureTableJson;\n  if (featureTableJsonByteLength === 0) {\n    featureTableJson = {\n      BATCH_LENGTH: defaultValue(batchLength, 0),\n    };\n  } else {\n    featureTableJson = getJsonFromTypedArray(\n      uint8Array,\n      byteOffset,\n      featureTableJsonByteLength\n    );\n    byteOffset += featureTableJsonByteLength;\n  }\n\n  const featureTableBinary = new Uint8Array(\n    arrayBuffer,\n    byteOffset,\n    featureTableBinaryByteLength\n  );\n  byteOffset += featureTableBinaryByteLength;\n\n  let batchTableJson;\n  let batchTableBinary;\n  if (batchTableJsonByteLength > 0) {\n    // PERFORMANCE_IDEA: is it possible to allocate this on-demand?  Perhaps keep the\n    // arraybuffer/string compressed in memory and then decompress it when it is first accessed.\n    //\n    // We could also make another request for it, but that would make the property set/get\n    // API async, and would double the number of numbers in some cases.\n    batchTableJson = getJsonFromTypedArray(\n      uint8Array,\n      byteOffset,\n      batchTableJsonByteLength\n    );\n    byteOffset += batchTableJsonByteLength;\n\n    if (batchTableBinaryByteLength > 0) {\n      // Has a batch table binary\n      batchTableBinary = new Uint8Array(\n        arrayBuffer,\n        byteOffset,\n        batchTableBinaryByteLength\n      );\n      // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed\n      batchTableBinary = new Uint8Array(batchTableBinary);\n      byteOffset += batchTableBinaryByteLength;\n    }\n  }\n\n  const gltfByteLength = byteStart + byteLength - byteOffset;\n  if (gltfByteLength === 0) {\n    throw new RuntimeError(\"glTF byte length must be greater than 0.\");\n  }\n\n  let gltfView;\n  if (byteOffset % 4 === 0) {\n    gltfView = new Uint8Array(arrayBuffer, byteOffset, gltfByteLength);\n  } else {\n    // Create a copy of the glb so that it is 4-byte aligned\n    B3dmParser._deprecationWarning(\n      \"b3dm-glb-unaligned\",\n      \"The embedded glb is not aligned to a 4-byte boundary.\"\n    );\n    gltfView = new Uint8Array(\n      uint8Array.subarray(byteOffset, byteOffset + gltfByteLength)\n    );\n  }\n\n  return {\n    batchLength: batchLength,\n    featureTableJson: featureTableJson,\n    featureTableBinary: featureTableBinary,\n    batchTableJson: batchTableJson,\n    batchTableBinary: batchTableBinary,\n    gltf: gltfView,\n  };\n};\n\nexport default B3dmParser;\n", "import ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * @private\n */\nfunction Cesium3DTileFeatureTable(featureTableJson, featureTableBinary) {\n  this.json = featureTableJson;\n  this.buffer = featureTableBinary;\n  this._cachedTypedArrays = {};\n  this.featuresLength = 0;\n}\n\nfunction getTypedArrayFromBinary(\n  featureTable,\n  semantic,\n  componentType,\n  componentLength,\n  count,\n  byteOffset\n) {\n  const cachedTypedArrays = featureTable._cachedTypedArrays;\n  let typedArray = cachedTypedArrays[semantic];\n  if (!defined(typedArray)) {\n    typedArray = ComponentDatatype.createArrayBufferView(\n      componentType,\n      featureTable.buffer.buffer,\n      featureTable.buffer.byteOffset + byteOffset,\n      count * componentLength\n    );\n    cachedTypedArrays[semantic] = typedArray;\n  }\n  return typedArray;\n}\n\nfunction getTypedArrayFromArray(featureTable, semantic, componentType, array) {\n  const cachedTypedArrays = featureTable._cachedTypedArrays;\n  let typedArray = cachedTypedArrays[semantic];\n  if (!defined(typedArray)) {\n    typedArray = ComponentDatatype.createTypedArray(componentType, array);\n    cachedTypedArrays[semantic] = typedArray;\n  }\n  return typedArray;\n}\n\nCesium3DTileFeatureTable.prototype.getGlobalProperty = function (\n  semantic,\n  componentType,\n  componentLength\n) {\n  const jsonValue = this.json[semantic];\n  if (!defined(jsonValue)) {\n    return undefined;\n  }\n\n  if (defined(jsonValue.byteOffset)) {\n    componentType = defaultValue(componentType, ComponentDatatype.UNSIGNED_INT);\n    componentLength = defaultValue(componentLength, 1);\n    return getTypedArrayFromBinary(\n      this,\n      semantic,\n      componentType,\n      componentLength,\n      1,\n      jsonValue.byteOffset\n    );\n  }\n\n  return jsonValue;\n};\n\nCesium3DTileFeatureTable.prototype.hasProperty = function (semantic) {\n  return defined(this.json[semantic]);\n};\n\nCesium3DTileFeatureTable.prototype.getPropertyArray = function (\n  semantic,\n  componentType,\n  componentLength\n) {\n  const jsonValue = this.json[semantic];\n  if (!defined(jsonValue)) {\n    return undefined;\n  }\n\n  if (defined(jsonValue.byteOffset)) {\n    if (defined(jsonValue.componentType)) {\n      componentType = ComponentDatatype.fromName(jsonValue.componentType);\n    }\n    return getTypedArrayFromBinary(\n      this,\n      semantic,\n      componentType,\n      componentLength,\n      this.featuresLength,\n      jsonValue.byteOffset\n    );\n  }\n\n  return getTypedArrayFromArray(this, semantic, componentType, jsonValue);\n};\n\nCesium3DTileFeatureTable.prototype.getProperty = function (\n  semantic,\n  componentType,\n  componentLength,\n  featureId,\n  result\n) {\n  const jsonValue = this.json[semantic];\n  if (!defined(jsonValue)) {\n    return undefined;\n  }\n\n  const typedArray = this.getPropertyArray(\n    semantic,\n    componentType,\n    componentLength\n  );\n\n  if (componentLength === 1) {\n    return typedArray[featureId];\n  }\n\n  for (let i = 0; i < componentLength; ++i) {\n    result[i] = typedArray[componentLength * featureId + i];\n  }\n\n  return result;\n};\nexport default Cesium3DTileFeatureTable;\n", "import Check from \"../Core/Check.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defined from \"../Core/defined.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport BatchTableHierarchy from \"./BatchTableHierarchy.js\";\nimport StructuralMetadata from \"./StructuralMetadata.js\";\nimport PropertyAttribute from \"./PropertyAttribute.js\";\nimport PropertyTable from \"./PropertyTable.js\";\nimport getBinaryAccessor from \"./getBinaryAccessor.js\";\nimport JsonMetadataTable from \"./JsonMetadataTable.js\";\nimport MetadataClass from \"./MetadataClass.js\";\nimport MetadataSchema from \"./MetadataSchema.js\";\nimport MetadataTable from \"./MetadataTable.js\";\nimport ModelComponents from \"./ModelComponents.js\";\nimport ModelUtility from \"./Model/ModelUtility.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\n\n/**\n * An object that parses the the 3D Tiles 1.0 batch table and transcodes it to\n * be compatible with structural metadata from the <code>EXT_structural_metadata</code> glTF extension\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension} for glTF.\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {number} options.count The number of features in the batch table.\n * @param {object} options.batchTable The batch table JSON\n * @param {Uint8Array} [options.binaryBody] The batch table binary body\n * @param {boolean} [options.parseAsPropertyAttributes=false] If true, binary properties are parsed as property attributes instead of a property table. This is used for .pnts models for GPU styling.\n * @param {ModelComponents.Attribute[]} [options.customAttributeOutput] Pass in an empty array here and this method will populate it with a list of custom attributes that will store the values of the property attributes. The attributes will be created with typed arrays, the caller is responsible for uploading them to the GPU. This option is required when options.parseAsPropertyAttributes is true.\n * @return {StructuralMetadata} A transcoded structural metadata object\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction parseBatchTable(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"options.count\", options.count);\n  Check.typeOf.object(\"options.batchTable\", options.batchTable);\n  //>>includeEnd('debug');\n\n  const featureCount = options.count;\n  const batchTable = options.batchTable;\n  const binaryBody = options.binaryBody;\n  const parseAsPropertyAttributes = defaultValue(\n    options.parseAsPropertyAttributes,\n    false\n  );\n  const customAttributeOutput = options.customAttributeOutput;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (parseAsPropertyAttributes && !defined(customAttributeOutput)) {\n    throw new DeveloperError(\n      \"customAttributeOutput is required when parsing batch table as property attributes\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  // divide properties into binary, json and hierarchy\n  const partitionResults = partitionProperties(batchTable);\n\n  let jsonMetadataTable;\n  if (defined(partitionResults.jsonProperties)) {\n    jsonMetadataTable = new JsonMetadataTable({\n      count: featureCount,\n      properties: partitionResults.jsonProperties,\n    });\n  }\n\n  let hierarchy;\n  if (defined(partitionResults.hierarchy)) {\n    hierarchy = new BatchTableHierarchy({\n      extension: partitionResults.hierarchy,\n      binaryBody: binaryBody,\n    });\n  }\n\n  const className = MetadataClass.BATCH_TABLE_CLASS_NAME;\n  const binaryProperties = partitionResults.binaryProperties;\n\n  let metadataTable;\n  let propertyAttributes;\n  let transcodedSchema;\n  if (parseAsPropertyAttributes) {\n    const attributeResults = transcodeBinaryPropertiesAsPropertyAttributes(\n      featureCount,\n      className,\n      binaryProperties,\n      binaryBody,\n      customAttributeOutput\n    );\n    transcodedSchema = attributeResults.transcodedSchema;\n    const propertyAttribute = new PropertyAttribute({\n      propertyAttribute: attributeResults.propertyAttributeJson,\n      class: attributeResults.transcodedClass,\n    });\n\n    propertyAttributes = [propertyAttribute];\n  } else {\n    const binaryResults = transcodeBinaryProperties(\n      featureCount,\n      className,\n      binaryProperties,\n      binaryBody\n    );\n    transcodedSchema = binaryResults.transcodedSchema;\n    const featureTableJson = binaryResults.featureTableJson;\n    metadataTable = new MetadataTable({\n      count: featureTableJson.count,\n      properties: featureTableJson.properties,\n      class: binaryResults.transcodedClass,\n      bufferViews: binaryResults.bufferViewsTypedArrays,\n    });\n    propertyAttributes = [];\n  }\n\n  const propertyTables = [];\n  if (\n    defined(metadataTable) ||\n    defined(jsonMetadataTable) ||\n    defined(hierarchy)\n  ) {\n    const propertyTable = new PropertyTable({\n      id: 0,\n      name: \"Batch Table\",\n      count: featureCount,\n      metadataTable: metadataTable,\n      jsonMetadataTable: jsonMetadataTable,\n      batchTableHierarchy: hierarchy,\n    });\n    propertyTables.push(propertyTable);\n  }\n\n  const metadataOptions = {\n    schema: transcodedSchema,\n    propertyTables: propertyTables,\n    propertyAttributes: propertyAttributes,\n    extensions: partitionResults.extensions,\n    extras: partitionResults.extras,\n  };\n\n  return new StructuralMetadata(metadataOptions);\n}\n\n/**\n * Divide the batch table's properties into binary, JSON and hierarchy\n * extension as each is handled separately\n *\n * @param {object} batchTable The batch table JSON\n * @returns {object} The batch table divided into binary, JSON and hierarchy portions. Extras and extensions are also divided out for ease of processing.\n *\n * @private\n */\nfunction partitionProperties(batchTable) {\n  const legacyHierarchy = batchTable.HIERARCHY;\n  const extras = batchTable.extras;\n  const extensions = batchTable.extensions;\n\n  let hierarchyExtension;\n  if (defined(legacyHierarchy)) {\n    parseBatchTable._deprecationWarning(\n      \"batchTableHierarchyExtension\",\n      \"The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead.\"\n    );\n    hierarchyExtension = legacyHierarchy;\n  } else if (defined(extensions)) {\n    hierarchyExtension = extensions[\"3DTILES_batch_table_hierarchy\"];\n  }\n\n  // A JsonMetadataTable is only allocated as needed.\n  let jsonProperties;\n  // A MetadataTable or PropertyAttribute will always be created, even if\n  // there are no properties.\n  const binaryProperties = {};\n  for (const propertyId in batchTable) {\n    if (\n      !batchTable.hasOwnProperty(propertyId) ||\n      // these cases were handled above;\n      propertyId === \"HIERARCHY\" ||\n      propertyId === \"extensions\" ||\n      propertyId === \"extras\"\n    ) {\n      continue;\n    }\n\n    const property = batchTable[propertyId];\n    if (Array.isArray(property)) {\n      jsonProperties = defined(jsonProperties) ? jsonProperties : {};\n      jsonProperties[propertyId] = property;\n    } else {\n      binaryProperties[propertyId] = property;\n    }\n  }\n\n  return {\n    binaryProperties: binaryProperties,\n    jsonProperties: jsonProperties,\n    hierarchy: hierarchyExtension,\n    extras: extras,\n    extensions: extensions,\n  };\n}\n\n/**\n * Transcode the binary properties of the batch table to be compatible with\n * <code>EXT_structural_metadata</code>\n *\n * @param {number} featureCount The number of features in the batch table\n * @param {string} className The name of the metadata class to be created.\n * @param {Object<string, Object>} binaryProperties A dictionary of property ID to property definition\n * @param {Uint8Array} [binaryBody] The binary body of the batch table\n * @return {object} Transcoded data needed for constructing a {@link StructuralMetadata} object.\n *\n * @private\n */\nfunction transcodeBinaryProperties(\n  featureCount,\n  className,\n  binaryProperties,\n  binaryBody\n) {\n  const classProperties = {};\n  const featureTableProperties = {};\n  const bufferViewsTypedArrays = {};\n  let bufferViewCount = 0;\n  for (const propertyId in binaryProperties) {\n    if (!binaryProperties.hasOwnProperty(propertyId)) {\n      continue;\n    }\n\n    if (!defined(binaryBody)) {\n      throw new RuntimeError(\n        `Property ${propertyId} requires a batch table binary.`\n      );\n    }\n\n    const property = binaryProperties[propertyId];\n    const binaryAccessor = getBinaryAccessor(property);\n\n    featureTableProperties[propertyId] = {\n      bufferView: bufferViewCount,\n    };\n\n    classProperties[propertyId] = transcodePropertyType(property);\n\n    bufferViewsTypedArrays[\n      bufferViewCount\n    ] = binaryAccessor.createArrayBufferView(\n      binaryBody.buffer,\n      binaryBody.byteOffset + property.byteOffset,\n      featureCount\n    );\n\n    bufferViewCount++;\n  }\n\n  const schemaJson = {\n    classes: {},\n  };\n  schemaJson.classes[className] = {\n    properties: classProperties,\n  };\n\n  const transcodedSchema = MetadataSchema.fromJson(schemaJson);\n\n  const featureTableJson = {\n    class: className,\n    count: featureCount,\n    properties: featureTableProperties,\n  };\n\n  return {\n    featureTableJson: featureTableJson,\n    bufferViewsTypedArrays: bufferViewsTypedArrays,\n    transcodedSchema: transcodedSchema,\n    transcodedClass: transcodedSchema.classes[className],\n  };\n}\n\nfunction transcodeBinaryPropertiesAsPropertyAttributes(\n  featureCount,\n  className,\n  binaryProperties,\n  binaryBody,\n  customAttributeOutput\n) {\n  const classProperties = {};\n  const propertyAttributeProperties = {};\n  let nextPlaceholderId = 0;\n\n  for (const propertyId in binaryProperties) {\n    if (!binaryProperties.hasOwnProperty(propertyId)) {\n      continue;\n    }\n\n    // For draco-compressed attributes from .pnts files, the results will be\n    // stored in separate typed arrays. These will be used in place of the\n    // binary body\n    const property = binaryProperties[propertyId];\n    if (!defined(binaryBody) && !defined(property.typedArray)) {\n      throw new RuntimeError(\n        `Property ${propertyId} requires a batch table binary.`\n      );\n    }\n\n    let sanitizedPropertyId = ModelUtility.sanitizeGlslIdentifier(propertyId);\n\n    // If the sanitized string is empty or a duplicate, use a placeholder\n    // name instead. This will work for styling, but it may lead to undefined\n    // behavior in CustomShader, since\n    // - different tiles may pick a different placeholder ID due to the\n    //    collection being unordered\n    // - different tiles may have different number of properties.\n    if (\n      sanitizedPropertyId === \"\" ||\n      classProperties.hasOwnProperty(sanitizedPropertyId)\n    ) {\n      sanitizedPropertyId = `property_${nextPlaceholderId}`;\n      nextPlaceholderId++;\n    }\n\n    const classProperty = transcodePropertyType(property);\n    classProperty.name = propertyId;\n    classProperties[sanitizedPropertyId] = classProperty;\n\n    // Extract the typed array and create a custom attribute as a typed array.\n    // The caller must add the results to the ModelComponents, and upload the\n    // typed array to the GPU. The attribute name is converted to all capitals\n    // and underscores, like a glTF custom attribute.\n    //\n    // For example, if the original property ID was 'Temperature \u2103', the result\n    // is _TEMPERATURE\n    let customAttributeName = sanitizedPropertyId.toUpperCase();\n    if (!customAttributeName.startsWith(\"_\")) {\n      customAttributeName = `_${customAttributeName}`;\n    }\n\n    // for .pnts with draco compression, property.typedArray is used\n    // instead of the binary body.\n    let attributeTypedArray = property.typedArray;\n    if (!defined(attributeTypedArray)) {\n      const binaryAccessor = getBinaryAccessor(property);\n      attributeTypedArray = binaryAccessor.createArrayBufferView(\n        binaryBody.buffer,\n        binaryBody.byteOffset + property.byteOffset,\n        featureCount\n      );\n    }\n\n    const attribute = new ModelComponents.Attribute();\n    attribute.name = customAttributeName;\n    attribute.count = featureCount;\n    attribute.type = property.type;\n    const componentDatatype = ComponentDatatype.fromTypedArray(\n      attributeTypedArray\n    );\n    if (\n      componentDatatype === ComponentDatatype.INT ||\n      componentDatatype === ComponentDatatype.UNSIGNED_INT ||\n      componentDatatype === ComponentDatatype.DOUBLE\n    ) {\n      parseBatchTable._oneTimeWarning(\n        \"Cast pnts property to floats\",\n        `Point cloud property \"${customAttributeName}\" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`\n      );\n      attributeTypedArray = new Float32Array(attributeTypedArray);\n    }\n    attribute.componentDatatype = ComponentDatatype.fromTypedArray(\n      attributeTypedArray\n    );\n    attribute.typedArray = attributeTypedArray;\n    customAttributeOutput.push(attribute);\n\n    // Refer to the custom attribute name from the property attribute\n    propertyAttributeProperties[sanitizedPropertyId] = {\n      attribute: customAttributeName,\n    };\n  }\n\n  const schemaJson = {\n    classes: {},\n  };\n  schemaJson.classes[className] = {\n    properties: classProperties,\n  };\n\n  const transcodedSchema = MetadataSchema.fromJson(schemaJson);\n\n  const propertyAttributeJson = {\n    properties: propertyAttributeProperties,\n  };\n\n  return {\n    class: className,\n    propertyAttributeJson: propertyAttributeJson,\n    transcodedSchema: transcodedSchema,\n    transcodedClass: transcodedSchema.classes[className],\n  };\n}\n\n/**\n * Given a property definition from the batch table, compute the equivalent\n * <code>EXT_structural_metadata</code> type definition\n *\n * @param {object} property The batch table property definition\n * @return {object} The corresponding structural metadata property definition\n * @private\n */\nfunction transcodePropertyType(property) {\n  const componentType = transcodeComponentType(property.componentType);\n\n  return {\n    type: property.type,\n    componentType: componentType,\n  };\n}\n\n/**\n * Convert the component type of a batch table property to the corresponding\n * type used with structural metadata\n *\n * @property {string} componentType the batch table's component type\n * @return {string} The corresponding structural metadata data type\n *\n * @private\n */\nfunction transcodeComponentType(componentType) {\n  switch (componentType) {\n    case \"BYTE\":\n      return \"INT8\";\n    case \"UNSIGNED_BYTE\":\n      return \"UINT8\";\n    case \"SHORT\":\n      return \"INT16\";\n    case \"UNSIGNED_SHORT\":\n      return \"UINT16\";\n    case \"INT\":\n      return \"INT32\";\n    case \"UNSIGNED_INT\":\n      return \"UINT32\";\n    case \"FLOAT\":\n      return \"FLOAT32\";\n    case \"DOUBLE\":\n      return \"FLOAT64\";\n  }\n}\n\n// exposed for testing\nparseBatchTable._deprecationWarning = deprecationWarning;\nparseBatchTable._oneTimeWarning = oneTimeWarning;\n\nexport default parseBatchTable;\n", "import Axis from \"../Axis.js\";\nimport B3dmParser from \"../B3dmParser.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Cesium3DTileFeatureTable from \"../Cesium3DTileFeatureTable.js\";\nimport Check from \"../../Core/Check.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport StructuralMetadata from \"../StructuralMetadata.js\";\nimport GltfLoader from \"../GltfLoader.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport MetadataClass from \"../MetadataClass.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport parseBatchTable from \"../parseBatchTable.js\";\nimport PropertyTable from \"../PropertyTable.js\";\nimport ResourceLoader from \"../ResourceLoader.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\n\nconst B3dmLoaderState = {\n  UNLOADED: 0,\n  LOADING: 1,\n  PROCESSING: 2,\n  READY: 3,\n  FAILED: 4,\n};\n\nconst FeatureIdAttribute = ModelComponents.FeatureIdAttribute;\n\n/**\n * Loads a Batched 3D Model.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias B3dmLoader\n * @constructor\n * @augments ResourceLoader\n * @private\n *\n * @param {object} options Object with the following properties:\n * @param {Resource} options.b3dmResource The {@link Resource} containing the b3dm.\n * @param {ArrayBuffer} options.arrayBuffer The array buffer of the b3dm contents.\n * @param {number} [options.byteOffset] The byte offset to the beginning of the b3dm contents in the array buffer.\n * @param {Resource} [options.baseResource] The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {boolean} [options.releaseGltfJson=false] When true, the glTF JSON is released once the glTF is loaded. This is especially useful for cases like 3D Tiles, where each .gltf model is unique and caching the glTF JSON is not effective.\n * @param {boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n * @param {boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the glTF is loaded.\n * @param {Axis} [options.upAxis=Axis.Y] The up-axis of the glTF model.\n * @param {Axis} [options.forwardAxis=Axis.X] The forward-axis of the glTF model.\n * @param {boolean} [options.loadAttributesAsTypedArray=false] If <code>true</code>, load all attributes as typed arrays instead of GPU buffers. If the attributes are interleaved in the glTF they will be de-interleaved in the typed array.\n * @param {boolean} [options.loadAttributesFor2D=false] If <code>true</code>, load the positions buffer and any instanced attribute buffers as typed arrays for accurately projecting models to 2D.\n * @param {boolean} [options.loadIndicesForWireframe=false] If <code>true</code>, load the index buffer as a typed array. This is useful for creating wireframe indices in WebGL1.\n * @param {boolean} [options.loadPrimitiveOutline=true] If <code>true</code>, load outlines from the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set false to avoid post-processing geometry at load time.\n * @param {boolean} [options.loadForClassification=false] If <code>true</code> and if the model has feature IDs, load the feature IDs and indices as typed arrays. This is useful for batching features for classification.\n * */\nfunction B3dmLoader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const b3dmResource = options.b3dmResource;\n  let baseResource = options.baseResource;\n  const arrayBuffer = options.arrayBuffer;\n  const byteOffset = defaultValue(options.byteOffset, 0);\n  const releaseGltfJson = defaultValue(options.releaseGltfJson, false);\n  const asynchronous = defaultValue(options.asynchronous, true);\n  const incrementallyLoadTextures = defaultValue(\n    options.incrementallyLoadTextures,\n    true\n  );\n  const upAxis = defaultValue(options.upAxis, Axis.Y);\n  const forwardAxis = defaultValue(options.forwardAxis, Axis.X);\n  const loadAttributesAsTypedArray = defaultValue(\n    options.loadAttributesAsTypedArray,\n    false\n  );\n  const loadAttributesFor2D = defaultValue(options.loadAttributesFor2D, false);\n  const loadIndicesForWireframe = defaultValue(\n    options.loadIndicesForWireframe,\n    false\n  );\n  const loadPrimitiveOutline = defaultValue(options.loadPrimitiveOutline, true);\n  const loadForClassification = defaultValue(\n    options.loadForClassification,\n    false\n  );\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.b3dmResource\", b3dmResource);\n  Check.typeOf.object(\"options.arrayBuffer\", arrayBuffer);\n  //>>includeEnd('debug');\n\n  baseResource = defined(baseResource) ? baseResource : b3dmResource.clone();\n\n  this._b3dmResource = b3dmResource;\n  this._baseResource = baseResource;\n  this._arrayBuffer = arrayBuffer;\n  this._byteOffset = byteOffset;\n  this._releaseGltfJson = releaseGltfJson;\n  this._asynchronous = asynchronous;\n  this._incrementallyLoadTextures = incrementallyLoadTextures;\n  this._upAxis = upAxis;\n  this._forwardAxis = forwardAxis;\n  this._loadAttributesAsTypedArray = loadAttributesAsTypedArray;\n  this._loadAttributesFor2D = loadAttributesFor2D;\n  this._loadIndicesForWireframe = loadIndicesForWireframe;\n  this._loadPrimitiveOutline = loadPrimitiveOutline;\n  this._loadForClassification = loadForClassification;\n\n  this._state = B3dmLoaderState.UNLOADED;\n\n  this._promise = undefined;\n\n  this._gltfLoader = undefined;\n\n  // Loaded results.\n  this._batchLength = 0;\n  this._propertyTable = undefined;\n\n  // The batch table object contains a json and a binary component access using keys of the same name.\n  this._batchTable = undefined;\n  this._components = undefined;\n  this._transform = Matrix4.IDENTITY;\n}\n\nif (defined(Object.create)) {\n  B3dmLoader.prototype = Object.create(ResourceLoader.prototype);\n  B3dmLoader.prototype.constructor = B3dmLoader;\n}\n\nObject.defineProperties(B3dmLoader.prototype, {\n  /**\n   * true if textures are loaded, useful when incrementallyLoadTextures is true\n   *\n   * @memberof B3dmLoader.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  texturesLoaded: {\n    get: function () {\n      return this._gltfLoader?.texturesLoaded;\n    },\n  },\n  /**\n   * The cache key of the resource\n   *\n   * @memberof B3dmLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * The loaded components.\n   *\n   * @memberof B3dmLoader.prototype\n   *\n   * @type {ModelComponents.Components}\n   * @readonly\n   * @private\n   */\n  components: {\n    get: function () {\n      return this._components;\n    },\n  },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise<B3dmLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nB3dmLoader.prototype.load = function () {\n  if (defined(this._promise)) {\n    return this._promise;\n  }\n\n  const b3dm = B3dmParser.parse(this._arrayBuffer, this._byteOffset);\n\n  let batchLength = b3dm.batchLength;\n  const featureTableJson = b3dm.featureTableJson;\n  const featureTableBinary = b3dm.featureTableBinary;\n  const batchTableJson = b3dm.batchTableJson;\n  const batchTableBinary = b3dm.batchTableBinary;\n\n  const featureTable = new Cesium3DTileFeatureTable(\n    featureTableJson,\n    featureTableBinary\n  );\n  batchLength = featureTable.getGlobalProperty(\"BATCH_LENGTH\");\n  // Set batch length.\n  this._batchLength = batchLength;\n  // Set the RTC Center transform, if present.\n  const rtcCenter = featureTable.getGlobalProperty(\n    \"RTC_CENTER\",\n    ComponentDatatype.FLOAT,\n    3\n  );\n  if (defined(rtcCenter)) {\n    this._transform = Matrix4.fromTranslation(Cartesian3.fromArray(rtcCenter));\n  }\n\n  this._batchTable = {\n    json: batchTableJson,\n    binary: batchTableBinary,\n  };\n\n  const gltfLoader = new GltfLoader({\n    typedArray: b3dm.gltf,\n    upAxis: this._upAxis,\n    forwardAxis: this._forwardAxis,\n    gltfResource: this._b3dmResource,\n    baseResource: this._baseResource,\n    releaseGltfJson: this._releaseGltfJson,\n    incrementallyLoadTextures: this._incrementallyLoadTextures,\n    loadAttributesAsTypedArray: this._loadAttributesAsTypedArray,\n    loadAttributesFor2D: this._loadAttributesFor2D,\n    loadIndicesForWireframe: this._loadIndicesForWireframe,\n    loadPrimitiveOutline: this._loadPrimitiveOutline,\n    loadForClassification: this._loadForClassification,\n    renameBatchIdSemantic: true,\n  });\n\n  this._gltfLoader = gltfLoader;\n  this._state = B3dmLoaderState.LOADING;\n\n  const that = this;\n  this._promise = gltfLoader\n    .load()\n    .then(function () {\n      if (that.isDestroyed()) {\n        return;\n      }\n\n      that._state = B3dmLoaderState.PROCESSING;\n      return that;\n    })\n    .catch(function (error) {\n      if (that.isDestroyed()) {\n        return;\n      }\n\n      return handleError(that, error);\n    });\n\n  return this._promise;\n};\n\nfunction handleError(b3dmLoader, error) {\n  b3dmLoader.unload();\n  b3dmLoader._state = B3dmLoaderState.FAILED;\n  const errorMessage = \"Failed to load b3dm\";\n  error = b3dmLoader.getError(errorMessage, error);\n  return Promise.reject(error);\n}\n\nB3dmLoader.prototype.process = function (frameState) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"frameState\", frameState);\n  //>>includeEnd('debug');\n\n  if (this._state === B3dmLoaderState.READY) {\n    return true;\n  }\n\n  if (this._state !== B3dmLoaderState.PROCESSING) {\n    return false;\n  }\n\n  const ready = this._gltfLoader.process(frameState);\n  if (!ready) {\n    return false;\n  }\n\n  const components = this._gltfLoader.components;\n\n  // Combine the RTC_CENTER transform from the b3dm and the CESIUM_RTC\n  // transform from the glTF. In practice usually only one or the\n  // other is supplied. If they don't exist the transforms will\n  // be identity matrices.\n  components.transform = Matrix4.multiplyTransformation(\n    this._transform,\n    components.transform,\n    components.transform\n  );\n  createStructuralMetadata(this, components);\n  this._components = components;\n\n  // Now that we have the parsed components, we can release the array buffer\n  this._arrayBuffer = undefined;\n\n  this._state = B3dmLoaderState.READY;\n  return true;\n};\n\nfunction createStructuralMetadata(loader, components) {\n  const batchTable = loader._batchTable;\n  const batchLength = loader._batchLength;\n\n  if (batchLength === 0) {\n    return;\n  }\n\n  let structuralMetadata;\n  if (defined(batchTable.json)) {\n    // Add the structural metadata from the batch table to the model components.\n    structuralMetadata = parseBatchTable({\n      count: batchLength,\n      batchTable: batchTable.json,\n      binaryBody: batchTable.binary,\n    });\n  } else {\n    // If batch table is not defined, create a property table without any properties.\n    const emptyPropertyTable = new PropertyTable({\n      name: MetadataClass.BATCH_TABLE_CLASS_NAME,\n      count: batchLength,\n    });\n    structuralMetadata = new StructuralMetadata({\n      schema: {},\n      propertyTables: [emptyPropertyTable],\n    });\n  }\n\n  // Add the feature ID attribute to the primitives.\n  const nodes = components.scene.nodes;\n  const length = nodes.length;\n  for (let i = 0; i < length; i++) {\n    processNode(nodes[i]);\n  }\n  components.structuralMetadata = structuralMetadata;\n}\n\n// Recursive function to add the feature ID attribute to all primitives that have a feature ID vertex attribute.\nfunction processNode(node) {\n  const childrenLength = node.children.length;\n  for (let i = 0; i < childrenLength; i++) {\n    processNode(node.children[i]);\n  }\n\n  const primitivesLength = node.primitives.length;\n  for (let i = 0; i < primitivesLength; i++) {\n    const primitive = node.primitives[i];\n    const featureIdVertexAttribute = ModelUtility.getAttributeBySemantic(\n      primitive,\n      VertexAttributeSemantic.FEATURE_ID\n    );\n    if (defined(featureIdVertexAttribute)) {\n      featureIdVertexAttribute.setIndex = 0;\n      const featureIdAttribute = new FeatureIdAttribute();\n      featureIdAttribute.propertyTableId = 0;\n      featureIdAttribute.setIndex = 0;\n      featureIdAttribute.positionalLabel = \"featureId_0\";\n      primitive.featureIds.push(featureIdAttribute);\n    }\n  }\n}\n\nB3dmLoader.prototype.unload = function () {\n  if (defined(this._gltfLoader) && !this._gltfLoader.isDestroyed()) {\n    this._gltfLoader.unload();\n  }\n\n  this._components = undefined;\n  this._arrayBuffer = undefined;\n};\n\nexport default B3dmLoader;\n", "import Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Check from \"../../Core/Check.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Ellipsoid from \"../../Core/Ellipsoid.js\";\nimport IndexDatatype from \"../../Core/IndexDatatype.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport PrimitiveType from \"../../Core/PrimitiveType.js\";\nimport RuntimeError from \"../../Core/RuntimeError.js\";\nimport Transforms from \"../../Core/Transforms.js\";\nimport AttributeType from \"../AttributeType.js\";\nimport JsonMetadataTable from \"../JsonMetadataTable.js\";\nimport MetadataSchema from \"../MetadataSchema.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport PropertyTable from \"../PropertyTable.js\";\nimport ResourceLoader from \"../ResourceLoader.js\";\nimport StructuralMetadata from \"../StructuralMetadata.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\nimport Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\n\n/**\n * Loads a GeoJson model as part of the <code>MAXAR_content_geojson</code> extension with the following constraints:\n * <ul>\n *   <li>The top level GeoJSON type must be FeatureCollection or Feature.</li>\n *   <li>The geometry types must be LineString, MultiLineString, MultiPolygon, Polygon, MultiPoint, or Point.</li>\n *   <li>Polygon and polyline geometries are converted to geodesic lines.</li>\n *   <li>Only WGS84 geographic coordinates are supported.</li>\n * </ul>\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GeoJsonLoader\n * @constructor\n * @augments ResourceLoader\n * @private\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.geoJson The GeoJson object.\n */\nfunction GeoJsonLoader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.geoJson\", options.geoJson);\n  //>>includeEnd('debug');\n\n  this._geoJson = options.geoJson;\n  this._components = undefined;\n}\n\nif (defined(Object.create)) {\n  GeoJsonLoader.prototype = Object.create(ResourceLoader.prototype);\n  GeoJsonLoader.prototype.constructor = GeoJsonLoader;\n}\n\nObject.defineProperties(GeoJsonLoader.prototype, {\n  /**\n   * The cache key of the resource.\n   *\n   * @memberof GeoJsonLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    get: function () {\n      return undefined;\n    },\n  },\n  /**\n   * The loaded components.\n   *\n   * @memberof GeoJsonLoader.prototype\n   *\n   * @type {ModelComponents.Components}\n   * @readonly\n   * @private\n   */\n  components: {\n    get: function () {\n      return this._components;\n    },\n  },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise<GeoJsonLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGeoJsonLoader.prototype.load = function () {\n  return Promise.resolve(this);\n};\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @private\n */\nGeoJsonLoader.prototype.process = function (frameState) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"frameState\", frameState);\n  //>>includeEnd('debug');\n\n  if (defined(this._components)) {\n    return true;\n  }\n\n  this._components = parse(this._geoJson, frameState);\n  this._geoJson = undefined;\n  return true;\n};\n\nfunction ParsedFeature() {\n  this.lines = undefined;\n  this.points = undefined;\n  this.properties = undefined;\n}\n\nfunction ParseResult() {\n  this.features = [];\n}\n\nfunction parsePosition(position) {\n  const x = position[0];\n  const y = position[1];\n  const z = defaultValue(position[2], 0.0);\n  return new Cartesian3(x, y, z);\n}\n\nfunction parseLineString(coordinates) {\n  const positionsLength = coordinates.length;\n  const line = new Array(positionsLength);\n  for (let i = 0; i < positionsLength; i++) {\n    line[i] = parsePosition(coordinates[i]);\n  }\n  const lines = [line];\n  return lines;\n}\n\nfunction parseMultiLineString(coordinates) {\n  const linesLength = coordinates.length;\n  const lines = new Array(linesLength);\n  for (let i = 0; i < linesLength; i++) {\n    lines[i] = parseLineString(coordinates[i])[0];\n  }\n  return lines;\n}\n\nfunction parsePolygon(coordinates) {\n  // Treat exterior polygon and interior polygons as lines\n  const linesLength = coordinates.length;\n  const lines = new Array(linesLength);\n  for (let i = 0; i < linesLength; i++) {\n    lines[i] = parseLineString(coordinates[i])[0];\n  }\n  return lines;\n}\n\nfunction parseMultiPolygon(coordinates) {\n  const polygonsLength = coordinates.length;\n  const lines = [];\n  for (let i = 0; i < polygonsLength; i++) {\n    Array.prototype.push.apply(lines, parsePolygon(coordinates[i]));\n  }\n  return lines;\n}\n\nfunction parsePoint(coordinates) {\n  return [parsePosition(coordinates)];\n}\n\nfunction parseMultiPoint(coordinates) {\n  const pointsLength = coordinates.length;\n  const points = new Array(pointsLength);\n  for (let i = 0; i < pointsLength; i++) {\n    points[i] = parsePosition(coordinates[i]);\n  }\n  return points;\n}\n\nconst geometryTypes = {\n  LineString: parseLineString,\n  MultiLineString: parseMultiLineString,\n  MultiPolygon: parseMultiPolygon,\n  Polygon: parsePolygon,\n  MultiPoint: parseMultiPoint,\n  Point: parsePoint,\n};\n\nconst primitiveTypes = {\n  LineString: PrimitiveType.LINES,\n  MultiLineString: PrimitiveType.LINES,\n  MultiPolygon: PrimitiveType.LINES,\n  Polygon: PrimitiveType.LINES,\n  MultiPoint: PrimitiveType.POINTS,\n  Point: PrimitiveType.POINTS,\n};\n\nfunction parseFeature(feature, result) {\n  if (!defined(feature.geometry)) {\n    return;\n  }\n\n  const geometryType = feature.geometry.type;\n  const geometryFunction = geometryTypes[geometryType];\n  const primitiveType = primitiveTypes[geometryType];\n  const coordinates = feature.geometry.coordinates;\n\n  if (!defined(geometryFunction)) {\n    return;\n  }\n\n  if (!defined(coordinates)) {\n    return;\n  }\n\n  const parsedFeature = new ParsedFeature();\n\n  if (primitiveType === PrimitiveType.LINES) {\n    parsedFeature.lines = geometryFunction(coordinates);\n  } else if (primitiveType === PrimitiveType.POINTS) {\n    parsedFeature.points = geometryFunction(coordinates);\n  }\n\n  parsedFeature.properties = feature.properties;\n\n  result.features.push(parsedFeature);\n}\n\nfunction parseFeatureCollection(featureCollection, result) {\n  const features = featureCollection.features;\n  const featuresLength = features.length;\n  for (let i = 0; i < featuresLength; i++) {\n    parseFeature(features[i], result);\n  }\n}\n\nconst geoJsonObjectTypes = {\n  FeatureCollection: parseFeatureCollection,\n  Feature: parseFeature,\n};\n\nconst scratchCartesian = new Cartesian3();\n\nfunction createLinesPrimitive(features, toLocal, frameState) {\n  // Count the number of vertices and indices\n  let vertexCount = 0;\n  let indexCount = 0;\n\n  const featureCount = features.length;\n\n  for (let i = 0; i < featureCount; i++) {\n    const feature = features[i];\n    if (defined(feature.lines)) {\n      const linesLength = feature.lines.length;\n      for (let j = 0; j < linesLength; j++) {\n        const line = feature.lines[j];\n        vertexCount += line.length;\n        indexCount += (line.length - 1) * 2;\n      }\n    }\n  }\n\n  // Allocate typed arrays\n  const positionsTypedArray = new Float32Array(vertexCount * 3);\n  const featureIdsTypedArray = new Float32Array(vertexCount);\n  const indicesTypedArray = IndexDatatype.createTypedArray(\n    vertexCount,\n    indexCount\n  );\n  const indexDatatype = IndexDatatype.fromTypedArray(indicesTypedArray);\n\n  // Process the data. Convert positions to local ENU. Generate indices.\n  const localMin = new Cartesian3(\n    Number.POSITIVE_INFINITY,\n    Number.POSITIVE_INFINITY,\n    Number.POSITIVE_INFINITY\n  );\n\n  const localMax = new Cartesian3(\n    Number.NEGATIVE_INFINITY,\n    Number.NEGATIVE_INFINITY,\n    Number.NEGATIVE_INFINITY\n  );\n\n  let vertexCounter = 0;\n  let segmentCounter = 0;\n\n  for (let i = 0; i < featureCount; i++) {\n    const feature = features[i];\n\n    if (!defined(feature.lines)) {\n      continue;\n    }\n\n    const linesLength = feature.lines.length;\n    for (let j = 0; j < linesLength; j++) {\n      const line = feature.lines[j];\n      const positionsLength = line.length;\n      for (let k = 0; k < positionsLength; k++) {\n        const cartographic = line[k];\n        const globalCartesian = Cartesian3.fromDegrees(\n          cartographic.x,\n          cartographic.y,\n          cartographic.z,\n          Ellipsoid.WGS84,\n          scratchCartesian\n        );\n        const localCartesian = Matrix4.multiplyByPoint(\n          toLocal,\n          globalCartesian,\n          scratchCartesian\n        );\n\n        Cartesian3.minimumByComponent(localMin, localCartesian, localMin);\n        Cartesian3.maximumByComponent(localMax, localCartesian, localMax);\n\n        Cartesian3.pack(localCartesian, positionsTypedArray, vertexCounter * 3);\n\n        featureIdsTypedArray[vertexCounter] = i;\n\n        if (k < positionsLength - 1) {\n          indicesTypedArray[segmentCounter * 2] = vertexCounter;\n          indicesTypedArray[segmentCounter * 2 + 1] = vertexCounter + 1;\n          segmentCounter++;\n        }\n\n        vertexCounter++;\n      }\n    }\n  }\n\n  // Create GPU buffers\n  const positionBuffer = Buffer.createVertexBuffer({\n    typedArray: positionsTypedArray,\n    context: frameState.context,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n  positionBuffer.vertexArrayDestroyable = false;\n\n  const featureIdBuffer = Buffer.createVertexBuffer({\n    typedArray: featureIdsTypedArray,\n    context: frameState.context,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n  featureIdBuffer.vertexArrayDestroyable = false;\n\n  const indexBuffer = Buffer.createIndexBuffer({\n    typedArray: indicesTypedArray,\n    context: frameState.context,\n    usage: BufferUsage.STATIC_DRAW,\n    indexDatatype: indexDatatype,\n  });\n  indexBuffer.vertexArrayDestroyable = false;\n\n  // Create ModelComponents\n  const positionAttribute = new ModelComponents.Attribute();\n  positionAttribute.semantic = VertexAttributeSemantic.POSITION;\n  positionAttribute.componentDatatype = ComponentDatatype.FLOAT;\n  positionAttribute.type = AttributeType.VEC3;\n  positionAttribute.count = vertexCount;\n  positionAttribute.min = localMin;\n  positionAttribute.max = localMax;\n  positionAttribute.buffer = positionBuffer;\n\n  const featureIdAttribute = new ModelComponents.Attribute();\n  featureIdAttribute.semantic = VertexAttributeSemantic.FEATURE_ID;\n  featureIdAttribute.setIndex = 0;\n  featureIdAttribute.componentDatatype = ComponentDatatype.FLOAT;\n  featureIdAttribute.type = AttributeType.SCALAR;\n  featureIdAttribute.count = vertexCount;\n  featureIdAttribute.buffer = featureIdBuffer;\n\n  const attributes = [positionAttribute, featureIdAttribute];\n\n  const material = new ModelComponents.Material();\n  material.unlit = true;\n\n  const indices = new ModelComponents.Indices();\n  indices.indexDatatype = indexDatatype;\n  indices.count = indicesTypedArray.length;\n  indices.buffer = indexBuffer;\n\n  const featureId = new ModelComponents.FeatureIdAttribute();\n  featureId.featureCount = featureCount;\n  featureId.propertyTableId = 0;\n  featureId.setIndex = 0;\n  featureId.positionalLabel = \"featureId_0\";\n\n  const featureIds = [featureId];\n\n  const primitive = new ModelComponents.Primitive();\n  primitive.attributes = attributes;\n  primitive.indices = indices;\n  primitive.featureIds = featureIds;\n  primitive.primitiveType = PrimitiveType.LINES;\n  primitive.material = material;\n\n  return primitive;\n}\n\nfunction createPointsPrimitive(features, toLocal, frameState) {\n  // Count the number of vertices\n  let vertexCount = 0;\n\n  const featureCount = features.length;\n\n  for (let i = 0; i < featureCount; i++) {\n    const feature = features[i];\n    if (defined(feature.points)) {\n      vertexCount += feature.points.length;\n    }\n  }\n\n  // Allocate typed arrays\n  const positionsTypedArray = new Float32Array(vertexCount * 3);\n  const featureIdsTypedArray = new Float32Array(vertexCount);\n\n  // Process the data. Convert positions to local ENU.\n  const localMin = new Cartesian3(\n    Number.POSITIVE_INFINITY,\n    Number.POSITIVE_INFINITY,\n    Number.POSITIVE_INFINITY\n  );\n\n  const localMax = new Cartesian3(\n    Number.NEGATIVE_INFINITY,\n    Number.NEGATIVE_INFINITY,\n    Number.NEGATIVE_INFINITY\n  );\n\n  let vertexCounter = 0;\n\n  for (let i = 0; i < featureCount; i++) {\n    const feature = features[i];\n\n    if (!defined(feature.points)) {\n      continue;\n    }\n\n    const pointsLength = feature.points.length;\n    for (let j = 0; j < pointsLength; j++) {\n      const cartographic = feature.points[j];\n      const globalCartesian = Cartesian3.fromDegrees(\n        cartographic.x,\n        cartographic.y,\n        cartographic.z,\n        Ellipsoid.WGS84,\n        scratchCartesian\n      );\n      const localCartesian = Matrix4.multiplyByPoint(\n        toLocal,\n        globalCartesian,\n        scratchCartesian\n      );\n\n      Cartesian3.minimumByComponent(localMin, localCartesian, localMin);\n      Cartesian3.maximumByComponent(localMax, localCartesian, localMax);\n\n      Cartesian3.pack(localCartesian, positionsTypedArray, vertexCounter * 3);\n\n      featureIdsTypedArray[vertexCounter] = i;\n\n      vertexCounter++;\n    }\n  }\n\n  // Create GPU buffers\n  const positionBuffer = Buffer.createVertexBuffer({\n    typedArray: positionsTypedArray,\n    context: frameState.context,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n  positionBuffer.vertexArrayDestroyable = false;\n\n  const featureIdBuffer = Buffer.createVertexBuffer({\n    typedArray: featureIdsTypedArray,\n    context: frameState.context,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n  featureIdBuffer.vertexArrayDestroyable = false;\n\n  // Create ModelComponents\n  const positionAttribute = new ModelComponents.Attribute();\n  positionAttribute.semantic = VertexAttributeSemantic.POSITION;\n  positionAttribute.componentDatatype = ComponentDatatype.FLOAT;\n  positionAttribute.type = AttributeType.VEC3;\n  positionAttribute.count = vertexCount;\n  positionAttribute.min = localMin;\n  positionAttribute.max = localMax;\n  positionAttribute.buffer = positionBuffer;\n\n  const featureIdAttribute = new ModelComponents.Attribute();\n  featureIdAttribute.semantic = VertexAttributeSemantic.FEATURE_ID;\n  featureIdAttribute.setIndex = 0;\n  featureIdAttribute.componentDatatype = ComponentDatatype.FLOAT;\n  featureIdAttribute.type = AttributeType.SCALAR;\n  featureIdAttribute.count = vertexCount;\n  featureIdAttribute.buffer = featureIdBuffer;\n\n  const attributes = [positionAttribute, featureIdAttribute];\n\n  const material = new ModelComponents.Material();\n  material.unlit = true;\n\n  const featureId = new ModelComponents.FeatureIdAttribute();\n  featureId.featureCount = featureCount;\n  featureId.propertyTableId = 0;\n  featureId.setIndex = 0;\n  featureId.positionalLabel = \"featureId_0\";\n\n  const featureIds = [featureId];\n\n  const primitive = new ModelComponents.Primitive();\n  primitive.attributes = attributes;\n  primitive.featureIds = featureIds;\n  primitive.primitiveType = PrimitiveType.POINTS;\n  primitive.material = material;\n\n  return primitive;\n}\n\nfunction parse(geoJson, frameState) {\n  const result = new ParseResult();\n\n  // Parse the GeoJSON\n  const parseFunction = geoJsonObjectTypes[geoJson.type];\n  if (defined(parseFunction)) {\n    parseFunction(geoJson, result);\n  }\n\n  const features = result.features;\n  const featureCount = features.length;\n\n  if (featureCount === 0) {\n    throw new RuntimeError(\"GeoJSON must have at least one feature\");\n  }\n\n  // Allocate space for property values\n  const properties = {};\n  for (let i = 0; i < featureCount; i++) {\n    const feature = features[i];\n    const featureProperties = defaultValue(\n      feature.properties,\n      defaultValue.EMPTY_OBJECT\n    );\n    for (const propertyId in featureProperties) {\n      if (featureProperties.hasOwnProperty(propertyId)) {\n        if (!defined(properties[propertyId])) {\n          properties[propertyId] = new Array(featureCount);\n        }\n      }\n    }\n  }\n\n  // Fill in the property values. Default to empty string for undefined values.\n  for (let i = 0; i < featureCount; i++) {\n    const feature = features[i];\n    for (const propertyId in properties) {\n      if (properties.hasOwnProperty(propertyId)) {\n        const value = defaultValue(feature.properties[propertyId], \"\");\n        properties[propertyId][i] = value;\n      }\n    }\n  }\n\n  const jsonMetadataTable = new JsonMetadataTable({\n    count: featureCount,\n    properties: properties,\n  });\n\n  const propertyTable = new PropertyTable({\n    id: 0,\n    count: featureCount,\n    jsonMetadataTable: jsonMetadataTable,\n  });\n  const propertyTables = [propertyTable];\n\n  const schema = MetadataSchema.fromJson({});\n\n  const structuralMetadata = new StructuralMetadata({\n    schema: schema,\n    propertyTables: propertyTables,\n  });\n\n  // Find the cartographic bounding box\n  const cartographicMin = new Cartesian3(\n    Number.POSITIVE_INFINITY,\n    Number.POSITIVE_INFINITY,\n    Number.POSITIVE_INFINITY\n  );\n\n  const cartographicMax = new Cartesian3(\n    Number.NEGATIVE_INFINITY,\n    Number.NEGATIVE_INFINITY,\n    Number.NEGATIVE_INFINITY\n  );\n\n  let hasLines = false;\n  let hasPoints = false;\n\n  for (let i = 0; i < featureCount; i++) {\n    const feature = features[i];\n    if (defined(feature.lines)) {\n      hasLines = true;\n      const linesLength = feature.lines.length;\n      for (let j = 0; j < linesLength; j++) {\n        const line = feature.lines[j];\n        const positionsLength = line.length;\n        for (let k = 0; k < positionsLength; k++) {\n          Cartesian3.minimumByComponent(\n            cartographicMin,\n            line[k],\n            cartographicMin\n          );\n          Cartesian3.maximumByComponent(\n            cartographicMax,\n            line[k],\n            cartographicMax\n          );\n        }\n      }\n    }\n\n    if (defined(feature.points)) {\n      hasPoints = true;\n      const pointsLength = feature.points.length;\n      for (let j = 0; j < pointsLength; j++) {\n        const point = feature.points[j];\n        Cartesian3.minimumByComponent(cartographicMin, point, cartographicMin);\n        Cartesian3.maximumByComponent(cartographicMax, point, cartographicMax);\n      }\n    }\n  }\n\n  // Compute the ENU matrix\n  const cartographicCenter = Cartesian3.midpoint(\n    cartographicMin,\n    cartographicMax,\n    new Cartesian3()\n  );\n  const ecefCenter = Cartesian3.fromDegrees(\n    cartographicCenter.x,\n    cartographicCenter.y,\n    cartographicCenter.z,\n    Ellipsoid.WGS84,\n    new Cartesian3()\n  );\n  const toGlobal = Transforms.eastNorthUpToFixedFrame(\n    ecefCenter,\n    Ellipsoid.WGS84,\n    new Matrix4()\n  );\n  const toLocal = Matrix4.inverseTransformation(toGlobal, new Matrix4());\n\n  const primitives = [];\n\n  if (hasLines) {\n    primitives.push(createLinesPrimitive(features, toLocal, frameState));\n  }\n\n  if (hasPoints) {\n    primitives.push(createPointsPrimitive(features, toLocal, frameState));\n  }\n\n  const node = new ModelComponents.Node();\n  node.index = 0;\n  node.primitives = primitives;\n\n  const nodes = [node];\n\n  const scene = new ModelComponents.Scene();\n  scene.nodes = nodes;\n\n  const components = new ModelComponents.Components();\n  components.scene = scene;\n  components.nodes = nodes;\n  components.transform = toGlobal;\n  components.structuralMetadata = structuralMetadata;\n\n  return components;\n}\n\n/**\n * Unloads the resource.\n * @private\n */\nGeoJsonLoader.prototype.unload = function () {\n  this._components = undefined;\n};\n\nexport default GeoJsonLoader;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * Handles parsing of an Instanced 3D Model.\n *\n * @namespace I3dmParser\n * @private\n */\nconst I3dmParser = {};\nI3dmParser._deprecationWarning = deprecationWarning;\n\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\n\n/**\n * Parses the contents of a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Instanced3DModel|Instanced 3D Model}.\n *\n * @private\n *\n * @param {ArrayBuffer} arrayBuffer The array buffer containing the i3dm.\n * @param {number} [byteOffset=0] The byte offset of the beginning of the i3dm in the array buffer.\n * @returns {object} Returns an object with the glTF format, feature table (binary and json), batch table (binary and json) and glTF parts of the i3dm.\n */\nI3dmParser.parse = function (arrayBuffer, byteOffset) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"arrayBuffer\", arrayBuffer);\n  //>>includeEnd('debug');\n\n  const byteStart = defaultValue(byteOffset, 0);\n  byteOffset = byteStart;\n\n  const uint8Array = new Uint8Array(arrayBuffer);\n  const view = new DataView(arrayBuffer);\n  byteOffset += sizeOfUint32; // Skip magic\n\n  const version = view.getUint32(byteOffset, true);\n  if (version !== 1) {\n    throw new RuntimeError(\n      `Only Instanced 3D Model version 1 is supported. Version ${version} is not.`\n    );\n  }\n  byteOffset += sizeOfUint32;\n\n  const byteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  const featureTableJsonByteLength = view.getUint32(byteOffset, true);\n  if (featureTableJsonByteLength === 0) {\n    throw new RuntimeError(\n      \"featureTableJsonByteLength is zero, the feature table must be defined.\"\n    );\n  }\n  byteOffset += sizeOfUint32;\n\n  const featureTableBinaryByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  const batchTableJsonByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  const batchTableBinaryByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  const gltfFormat = view.getUint32(byteOffset, true);\n  if (gltfFormat !== 1 && gltfFormat !== 0) {\n    throw new RuntimeError(\n      `Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${gltfFormat} is not.`\n    );\n  }\n  byteOffset += sizeOfUint32;\n\n  const featureTableJson = getJsonFromTypedArray(\n    uint8Array,\n    byteOffset,\n    featureTableJsonByteLength\n  );\n  byteOffset += featureTableJsonByteLength;\n\n  const featureTableBinary = new Uint8Array(\n    arrayBuffer,\n    byteOffset,\n    featureTableBinaryByteLength\n  );\n  byteOffset += featureTableBinaryByteLength;\n\n  let batchTableJson;\n  let batchTableBinary;\n  if (batchTableJsonByteLength > 0) {\n    batchTableJson = getJsonFromTypedArray(\n      uint8Array,\n      byteOffset,\n      batchTableJsonByteLength\n    );\n    byteOffset += batchTableJsonByteLength;\n\n    if (batchTableBinaryByteLength > 0) {\n      // Has a batch table binary\n      batchTableBinary = new Uint8Array(\n        arrayBuffer,\n        byteOffset,\n        batchTableBinaryByteLength\n      );\n      // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed\n      batchTableBinary = new Uint8Array(batchTableBinary);\n      byteOffset += batchTableBinaryByteLength;\n    }\n  }\n\n  const gltfByteLength = byteStart + byteLength - byteOffset;\n  if (gltfByteLength === 0) {\n    throw new RuntimeError(\"glTF byte length must be greater than 0.\");\n  }\n\n  let gltfView;\n  if (byteOffset % 4 === 0) {\n    gltfView = new Uint8Array(arrayBuffer, byteOffset, gltfByteLength);\n  } else {\n    // Create a copy of the glb so that it is 4-byte aligned\n    I3dmParser._deprecationWarning(\n      \"i3dm-glb-unaligned\",\n      \"The embedded glb is not aligned to a 4-byte boundary.\"\n    );\n    gltfView = new Uint8Array(\n      uint8Array.subarray(byteOffset, byteOffset + gltfByteLength)\n    );\n  }\n\n  return {\n    gltfFormat: gltfFormat,\n    featureTableJson: featureTableJson,\n    featureTableBinary: featureTableBinary,\n    batchTableJson: batchTableJson,\n    batchTableBinary: batchTableBinary,\n    gltf: gltfView,\n  };\n};\n\nexport default I3dmParser;\n", "import AttributeCompression from \"../../Core/AttributeCompression.js\";\nimport BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Check from \"../../Core/Check.js\";\nimport clone from \"../../Core/clone.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Ellipsoid from \"../../Core/Ellipsoid.js\";\nimport getStringFromTypedArray from \"../../Core/getStringFromTypedArray.js\";\nimport Matrix3 from \"../../Core/Matrix3.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport Quaternion from \"../../Core/Quaternion.js\";\nimport RuntimeError from \"../../Core/RuntimeError.js\";\nimport Transforms from \"../../Core/Transforms.js\";\nimport Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\nimport AttributeType from \"../AttributeType.js\";\nimport Axis from \"../Axis.js\";\nimport Cesium3DTileFeatureTable from \"../Cesium3DTileFeatureTable.js\";\nimport GltfLoader from \"../GltfLoader.js\";\nimport InstanceAttributeSemantic from \"../InstanceAttributeSemantic.js\";\nimport I3dmParser from \"../I3dmParser.js\";\nimport MetadataClass from \"../MetadataClass.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport parseBatchTable from \"../parseBatchTable.js\";\nimport PropertyTable from \"../PropertyTable.js\";\nimport ResourceLoader from \"../ResourceLoader.js\";\nimport StructuralMetadata from \"../StructuralMetadata.js\";\n\nconst I3dmLoaderState = {\n  NOT_LOADED: 0,\n  LOADING: 1,\n  PROCESSING: 2,\n  POST_PROCESSING: 3,\n  READY: 4,\n  FAILED: 5,\n  UNLOADED: 6,\n};\n\nconst Attribute = ModelComponents.Attribute;\nconst FeatureIdAttribute = ModelComponents.FeatureIdAttribute;\nconst Instances = ModelComponents.Instances;\n\n/**\n * Loads an Instanced 3D Model.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias I3dmLoader\n * @constructor\n * @augments ResourceLoader\n * @private\n *\n * @param {object} options Object with the following properties:\n * @param {Resource} options.i3dmResource The {@link Resource} containing the i3dm.\n * @param {ArrayBuffer} options.arrayBuffer The array buffer of the i3dm contents.\n * @param {number} [options.byteOffset=0] The byte offset to the beginning of the i3dm contents in the array buffer.\n * @param {Resource} [options.baseResource] The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {boolean} [options.releaseGltfJson=false] When true, the glTF JSON is released once the glTF is loaded. This is is especially useful for cases like 3D Tiles, where each .gltf model is unique and caching the glTF JSON is not effective.\n * @param {boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n * @param {boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the glTF is loaded.\n * @param {Axis} [options.upAxis=Axis.Y] The up-axis of the glTF model.\n * @param {Axis} [options.forwardAxis=Axis.X] The forward-axis of the glTF model.\n * @param {boolean} [options.loadAttributesAsTypedArray=false] Load all attributes as typed arrays instead of GPU buffers. If the attributes are interleaved in the glTF they will be de-interleaved in the typed array.\n * @param {boolean} [options.loadIndicesForWireframe=false] Load the index buffer as a typed array so wireframe indices can be created for WebGL1.\n * @param {boolean} [options.loadPrimitiveOutline=true] If true, load outlines from the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set false to avoid post-processing geometry at load time.\n */\nfunction I3dmLoader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const i3dmResource = options.i3dmResource;\n  const arrayBuffer = options.arrayBuffer;\n  let baseResource = options.baseResource;\n  const byteOffset = defaultValue(options.byteOffset, 0);\n  const releaseGltfJson = defaultValue(options.releaseGltfJson, false);\n  const asynchronous = defaultValue(options.asynchronous, true);\n  const incrementallyLoadTextures = defaultValue(\n    options.incrementallyLoadTextures,\n    true\n  );\n  const upAxis = defaultValue(options.upAxis, Axis.Y);\n  const forwardAxis = defaultValue(options.forwardAxis, Axis.X);\n  const loadAttributesAsTypedArray = defaultValue(\n    options.loadAttributesAsTypedArray,\n    false\n  );\n  const loadIndicesForWireframe = defaultValue(\n    options.loadIndicesForWireframe,\n    false\n  );\n  const loadPrimitiveOutline = defaultValue(options.loadPrimitiveOutline, true);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.i3dmResource\", i3dmResource);\n  Check.typeOf.object(\"options.arrayBuffer\", arrayBuffer);\n  //>>includeEnd('debug');\n\n  baseResource = defined(baseResource) ? baseResource : i3dmResource.clone();\n\n  this._i3dmResource = i3dmResource;\n  this._baseResource = baseResource;\n  this._arrayBuffer = arrayBuffer;\n  this._byteOffset = byteOffset;\n  this._releaseGltfJson = releaseGltfJson;\n  this._asynchronous = asynchronous;\n  this._incrementallyLoadTextures = incrementallyLoadTextures;\n  this._upAxis = upAxis;\n  this._forwardAxis = forwardAxis;\n  this._loadAttributesAsTypedArray = loadAttributesAsTypedArray;\n  this._loadIndicesForWireframe = loadIndicesForWireframe;\n  this._loadPrimitiveOutline = loadPrimitiveOutline;\n\n  this._state = I3dmLoaderState.NOT_LOADED;\n  this._promise = undefined;\n\n  this._gltfLoader = undefined;\n\n  // Instanced attributes are initially parsed as typed arrays, but if they\n  // do not need to be further processed (e.g. turned into transform matrices),\n  // it is more efficient to turn them into buffers. The I3dmLoader will own the\n  // resources and store them here.\n  this._buffers = [];\n  this._components = undefined;\n\n  this._transform = Matrix4.IDENTITY;\n  this._batchTable = undefined;\n  this._featureTable = undefined;\n  this._instancesLength = 0;\n}\n\nif (defined(Object.create)) {\n  I3dmLoader.prototype = Object.create(ResourceLoader.prototype);\n  I3dmLoader.prototype.constructor = I3dmLoader;\n}\n\nObject.defineProperties(I3dmLoader.prototype, {\n  /**\n   * true if textures are loaded, useful when incrementallyLoadTextures is true\n   *\n   * @memberof  I3dmLoader.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  texturesLoaded: {\n    get: function () {\n      return this._gltfLoader?.texturesLoaded;\n    },\n  },\n  /**\n   * The cache key of the resource\n   *\n   * @memberof I3dmLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * The loaded components.\n   *\n   * @memberof I3dmLoader.prototype\n   *\n   * @type {ModelComponents.Components}\n   * @default {@link Matrix4.IDENTITY}\n   * @readonly\n   * @private\n   */\n  components: {\n    get: function () {\n      return this._components;\n    },\n  },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise<I3dmLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nI3dmLoader.prototype.load = function () {\n  if (defined(this._promise)) {\n    return this._promise;\n  }\n\n  // Parse the i3dm into its various sections.\n  const i3dm = I3dmParser.parse(this._arrayBuffer, this._byteOffset);\n\n  const featureTableJson = i3dm.featureTableJson;\n  const featureTableBinary = i3dm.featureTableBinary;\n  const batchTableJson = i3dm.batchTableJson;\n  const batchTableBinary = i3dm.batchTableBinary;\n  const gltfFormat = i3dm.gltfFormat;\n\n  // Generate the feature table.\n  const featureTable = new Cesium3DTileFeatureTable(\n    featureTableJson,\n    featureTableBinary\n  );\n  this._featureTable = featureTable;\n\n  // Get the number of instances in the i3dm.\n  const instancesLength = featureTable.getGlobalProperty(\"INSTANCES_LENGTH\");\n  featureTable.featuresLength = instancesLength;\n  if (!defined(instancesLength)) {\n    throw new RuntimeError(\n      \"Feature table global property: INSTANCES_LENGTH must be defined\"\n    );\n  }\n  this._instancesLength = instancesLength;\n\n  // Get the RTC center, if available, and set the loader's transform.\n  const rtcCenter = featureTable.getGlobalProperty(\n    \"RTC_CENTER\",\n    ComponentDatatype.FLOAT,\n    3\n  );\n  if (defined(rtcCenter)) {\n    this._transform = Matrix4.fromTranslation(Cartesian3.fromArray(rtcCenter));\n  }\n\n  // Save the batch table section to use for StructuralMetadata generation.\n  this._batchTable = {\n    json: batchTableJson,\n    binary: batchTableBinary,\n  };\n\n  const loaderOptions = {\n    upAxis: this._upAxis,\n    forwardAxis: this._forwardAxis,\n    releaseGltfJson: this._releaseGltfJson,\n    incrementallyLoadTextures: this._incrementallyLoadTextures,\n    loadAttributesAsTypedArray: this._loadAttributesAsTypedArray,\n    loadIndicesForWireframe: this._loadIndicesForWireframe,\n    loadPrimitiveOutline: this._loadPrimitiveOutline,\n  };\n\n  if (gltfFormat === 0) {\n    let gltfUrl = getStringFromTypedArray(i3dm.gltf);\n\n    // We need to remove padding from the end of the model URL in case this tile was part of a composite tile.\n    // This removes all white space and null characters from the end of the string.\n    gltfUrl = gltfUrl.replace(/[\\s\\0]+$/, \"\");\n    const gltfResource = this._baseResource.getDerivedResource({\n      url: gltfUrl,\n    });\n    loaderOptions.gltfResource = gltfResource;\n    loaderOptions.baseResource = gltfResource;\n  } else {\n    loaderOptions.gltfResource = this._i3dmResource;\n    loaderOptions.typedArray = i3dm.gltf;\n  }\n\n  // Create the GltfLoader, update the state and load the glTF.\n  const gltfLoader = new GltfLoader(loaderOptions);\n\n  this._gltfLoader = gltfLoader;\n  this._state = I3dmLoaderState.LOADING;\n\n  this._promise = gltfLoader\n    .load()\n    .then(() => {\n      if (this.isDestroyed()) {\n        return;\n      }\n\n      this._state = I3dmLoaderState.PROCESSING;\n      return this;\n    })\n    .catch((error) => {\n      if (this.isDestroyed()) {\n        return;\n      }\n      throw handleError(this, error);\n    });\n\n  return this._promise;\n};\n\nfunction handleError(i3dmLoader, error) {\n  i3dmLoader.unload();\n  i3dmLoader._state = I3dmLoaderState.FAILED;\n  const errorMessage = \"Failed to load i3dm\";\n  return i3dmLoader.getError(errorMessage, error);\n}\n\nI3dmLoader.prototype.process = function (frameState) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"frameState\", frameState);\n  //>>includeEnd('debug');\n\n  if (this._state === I3dmLoaderState.READY) {\n    return true;\n  }\n\n  const gltfLoader = this._gltfLoader;\n  let ready = false;\n  if (this._state === I3dmLoaderState.PROCESSING) {\n    ready = gltfLoader.process(frameState);\n  }\n\n  if (!ready) {\n    return false;\n  }\n\n  const components = gltfLoader.components;\n\n  // Combine the RTC_CENTER transform from the i3dm and the CESIUM_RTC\n  // transform from the glTF. In practice CESIUM_RTC is not set for\n  // instanced models but multiply the transforms just in case.\n  components.transform = Matrix4.multiplyTransformation(\n    this._transform,\n    components.transform,\n    components.transform\n  );\n\n  createInstances(this, components, frameState);\n  createStructuralMetadata(this, components);\n  this._components = components;\n\n  // Now that we have the parsed components, we can release the array buffer\n  this._arrayBuffer = undefined;\n\n  this._state = I3dmLoaderState.READY;\n  return true;\n};\n\nfunction createStructuralMetadata(loader, components) {\n  const batchTable = loader._batchTable;\n  const instancesLength = loader._instancesLength;\n\n  if (instancesLength === 0) {\n    return;\n  }\n\n  let structuralMetadata;\n  if (defined(batchTable.json)) {\n    // Add the structural metadata from the batch table to the model components.\n    structuralMetadata = parseBatchTable({\n      count: instancesLength,\n      batchTable: batchTable.json,\n      binaryBody: batchTable.binary,\n    });\n  } else {\n    // If batch table is not defined, create a property table without any properties.\n    const emptyPropertyTable = new PropertyTable({\n      name: MetadataClass.BATCH_TABLE_CLASS_NAME,\n      count: instancesLength,\n    });\n    structuralMetadata = new StructuralMetadata({\n      schema: {},\n      propertyTables: [emptyPropertyTable],\n    });\n  }\n\n  components.structuralMetadata = structuralMetadata;\n}\n\nconst positionScratch = new Cartesian3();\nconst propertyScratch1 = new Array(4);\nconst transformScratch = new Matrix4();\n\nfunction createInstances(loader, components, frameState) {\n  let i;\n  const featureTable = loader._featureTable;\n  const instancesLength = loader._instancesLength;\n\n  if (instancesLength === 0) {\n    return;\n  }\n\n  const rtcCenter = featureTable.getGlobalProperty(\n    \"RTC_CENTER\",\n    ComponentDatatype.FLOAT,\n    3\n  );\n\n  const eastNorthUp = featureTable.getGlobalProperty(\"EAST_NORTH_UP\");\n  const hasRotation =\n    featureTable.hasProperty(\"NORMAL_UP\") ||\n    featureTable.hasProperty(\"NORMAL_UP_OCT32P\") ||\n    eastNorthUp;\n\n  const hasScale =\n    featureTable.hasProperty(\"SCALE\") ||\n    featureTable.hasProperty(\"SCALE_NON_UNIFORM\");\n\n  const translationTypedArray = getPositions(featureTable, instancesLength);\n  let rotationTypedArray;\n  if (hasRotation) {\n    rotationTypedArray = new Float32Array(4 * instancesLength);\n  }\n  let scaleTypedArray;\n  if (hasScale) {\n    scaleTypedArray = new Float32Array(3 * instancesLength);\n  }\n  const featureIdArray = new Float32Array(instancesLength);\n\n  const instancePositions = Cartesian3.unpackArray(translationTypedArray);\n  let instancePosition = new Cartesian3();\n\n  const instanceNormalRight = new Cartesian3();\n  const instanceNormalUp = new Cartesian3();\n  const instanceNormalForward = new Cartesian3();\n  const instanceRotation = new Matrix3();\n  const instanceQuaternion = new Quaternion();\n  const instanceQuaternionArray = new Array(4);\n\n  const instanceScale = new Cartesian3();\n  const instanceScaleArray = new Array(3);\n\n  const instanceTransform = new Matrix4();\n\n  // For I3DMs that do not define an RTC center, we manually compute a BoundingSphere and store\n  // positions relative to the center, to be uploaded to the GPU. This avoids jittering at higher\n  // precisions.\n  // Also manually compute if RTC center equals Cartesian3.ZERO\n  if (\n    !defined(rtcCenter) ||\n    Cartesian3.equals(Cartesian3.unpack(rtcCenter), Cartesian3.ZERO)\n  ) {\n    const positionBoundingSphere = BoundingSphere.fromPoints(instancePositions);\n\n    for (i = 0; i < instancePositions.length; i++) {\n      Cartesian3.subtract(\n        instancePositions[i],\n        positionBoundingSphere.center,\n        positionScratch\n      );\n\n      translationTypedArray[3 * i + 0] = positionScratch.x;\n      translationTypedArray[3 * i + 1] = positionScratch.y;\n      translationTypedArray[3 * i + 2] = positionScratch.z;\n    }\n\n    // Set the center of the bounding sphere as the RTC center transform.\n    const centerTransform = Matrix4.fromTranslation(\n      positionBoundingSphere.center,\n      transformScratch\n    );\n\n    // Combine the center transform and the CESIUM_RTC transform from the glTF.\n    // In practice CESIUM_RTC is not set for instanced models but multiply the\n    // transforms just in case.\n    components.transform = Matrix4.multiplyTransformation(\n      centerTransform,\n      components.transform,\n      components.transform\n    );\n  }\n\n  for (i = 0; i < instancesLength; i++) {\n    // Get the instance position\n    instancePosition = Cartesian3.clone(instancePositions[i]);\n\n    if (defined(rtcCenter)) {\n      Cartesian3.add(\n        instancePosition,\n        Cartesian3.unpack(rtcCenter),\n        instancePosition\n      );\n    }\n\n    // Get the instance rotation, if present\n    if (hasRotation) {\n      processRotation(\n        featureTable,\n        eastNorthUp,\n        i,\n        instanceQuaternion,\n        instancePosition,\n        instanceNormalUp,\n        instanceNormalRight,\n        instanceNormalForward,\n        instanceRotation,\n        instanceTransform\n      );\n      Quaternion.pack(instanceQuaternion, instanceQuaternionArray, 0);\n      rotationTypedArray[4 * i + 0] = instanceQuaternionArray[0];\n      rotationTypedArray[4 * i + 1] = instanceQuaternionArray[1];\n      rotationTypedArray[4 * i + 2] = instanceQuaternionArray[2];\n      rotationTypedArray[4 * i + 3] = instanceQuaternionArray[3];\n    }\n\n    // Get the instance scale, if present\n    if (hasScale) {\n      processScale(featureTable, i, instanceScale);\n      Cartesian3.pack(instanceScale, instanceScaleArray, 0);\n      scaleTypedArray[3 * i + 0] = instanceScaleArray[0];\n      scaleTypedArray[3 * i + 1] = instanceScaleArray[1];\n      scaleTypedArray[3 * i + 2] = instanceScaleArray[2];\n    }\n\n    // Get the batchId\n    let batchId = featureTable.getProperty(\n      \"BATCH_ID\",\n      ComponentDatatype.UNSIGNED_SHORT,\n      1,\n      i\n    );\n    if (!defined(batchId)) {\n      // If BATCH_ID semantic is undefined, batchId is just the instance number\n      batchId = i;\n    }\n    featureIdArray[i] = batchId;\n  }\n\n  // Create instances.\n  const instances = new Instances();\n  instances.transformInWorldSpace = true;\n  const buffers = loader._buffers;\n\n  // Create translation vertex attribute.\n  const translationAttribute = new Attribute();\n  translationAttribute.name = \"Instance Translation\";\n  translationAttribute.semantic = InstanceAttributeSemantic.TRANSLATION;\n  translationAttribute.componentDatatype = ComponentDatatype.FLOAT;\n  translationAttribute.type = AttributeType.VEC3;\n  translationAttribute.count = instancesLength;\n  // The min / max values of the translation attribute need to be computed\n  // by the model pipeline, so so a pointer to the typed array is stored.\n  translationAttribute.typedArray = translationTypedArray;\n  // If there is no rotation attribute, however, the translations can also be\n  // loaded as a buffer to prevent additional resource creation in the pipeline.\n  if (!hasRotation) {\n    const buffer = Buffer.createVertexBuffer({\n      context: frameState.context,\n      typedArray: translationTypedArray,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    // Destruction of resources is handled by I3dmLoader.unload().\n    buffer.vertexArrayDestroyable = false;\n    buffers.push(buffer);\n\n    translationAttribute.buffer = buffer;\n  }\n\n  instances.attributes.push(translationAttribute);\n\n  // Create rotation vertex attribute.\n  if (hasRotation) {\n    const rotationAttribute = new Attribute();\n    rotationAttribute.name = \"Instance Rotation\";\n    rotationAttribute.semantic = InstanceAttributeSemantic.ROTATION;\n    rotationAttribute.componentDatatype = ComponentDatatype.FLOAT;\n    rotationAttribute.type = AttributeType.VEC4;\n    rotationAttribute.count = instancesLength;\n    rotationAttribute.typedArray = rotationTypedArray;\n    instances.attributes.push(rotationAttribute);\n  }\n\n  // Create scale vertex attribute.\n  if (hasScale) {\n    const scaleAttribute = new Attribute();\n    scaleAttribute.name = \"Instance Scale\";\n    scaleAttribute.semantic = InstanceAttributeSemantic.SCALE;\n    scaleAttribute.componentDatatype = ComponentDatatype.FLOAT;\n    scaleAttribute.type = AttributeType.VEC3;\n    scaleAttribute.count = instancesLength;\n    if (hasRotation) {\n      // If rotations are present, all transform attributes are loaded\n      // as typed arrays to compute transform matrices for the model.\n      scaleAttribute.typedArray = scaleTypedArray;\n    } else {\n      const buffer = Buffer.createVertexBuffer({\n        context: frameState.context,\n        typedArray: scaleTypedArray,\n        usage: BufferUsage.STATIC_DRAW,\n      });\n      // Destruction of resources is handled by I3dmLoader.unload().\n      buffer.vertexArrayDestroyable = false;\n      buffers.push(buffer);\n\n      scaleAttribute.buffer = buffer;\n    }\n\n    instances.attributes.push(scaleAttribute);\n  }\n\n  // Create feature ID vertex attribute.\n  const featureIdAttribute = new Attribute();\n  featureIdAttribute.name = \"Instance Feature ID\";\n  featureIdAttribute.setIndex = 0;\n  featureIdAttribute.semantic = InstanceAttributeSemantic.FEATURE_ID;\n  featureIdAttribute.componentDatatype = ComponentDatatype.FLOAT;\n  featureIdAttribute.type = AttributeType.SCALAR;\n  featureIdAttribute.count = instancesLength;\n  const buffer = Buffer.createVertexBuffer({\n    context: frameState.context,\n    typedArray: featureIdArray,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n  // Destruction of resources is handled by I3dmLoader.unload().\n  buffer.vertexArrayDestroyable = false;\n  buffers.push(buffer);\n  featureIdAttribute.buffer = buffer;\n\n  instances.attributes.push(featureIdAttribute);\n\n  // Create feature ID attribute.\n  const featureIdInstanceAttribute = new FeatureIdAttribute();\n  featureIdInstanceAttribute.propertyTableId = 0;\n  featureIdInstanceAttribute.setIndex = 0;\n  featureIdInstanceAttribute.positionalLabel = \"instanceFeatureId_0\";\n  instances.featureIds.push(featureIdInstanceAttribute);\n\n  // Apply instancing to every node that has at least one primitive.\n  const nodes = components.nodes;\n  const nodesLength = nodes.length;\n  let makeInstancesCopy = false;\n  for (i = 0; i < nodesLength; i++) {\n    const node = nodes[i];\n    if (node.primitives.length > 0) {\n      // If the instances have not been assigned to a node already, assign\n      // it to the first node encountered. Otherwise, make a copy of them\n      // for each subsequent node.\n      node.instances = makeInstancesCopy\n        ? createInstancesCopy(instances)\n        : instances;\n\n      makeInstancesCopy = true;\n    }\n  }\n}\n\n/**\n * Returns a copy of the instances that contains shallow copies of the instanced\n * attributes. That is, the instances and attribute objects will be new copies,\n * but they will point to the same buffers and typed arrays. This is so each\n * node can manage memory separately, such that unloading memory for one\n * node does not unload it for another.\n *\n * @returns {ModelComponents.Instances}\n *\n * @private\n */\nfunction createInstancesCopy(instances) {\n  const instancesCopy = new Instances();\n  instancesCopy.transformInWorldSpace = instances.transformInWorldSpace;\n\n  const attributes = instances.attributes;\n  const attributesLength = attributes.length;\n\n  for (let i = 0; i < attributesLength; i++) {\n    const attributeCopy = clone(attributes[i], false);\n    instancesCopy.attributes.push(attributeCopy);\n  }\n\n  instancesCopy.featureIds = instances.featureIds;\n\n  return instancesCopy;\n}\n\n/**\n * Returns a typed array of positions from the i3dm's feature table. The positions\n * returned are dequantized, if dequantization is applied.\n *\n * @private\n */\nfunction getPositions(featureTable, instancesLength) {\n  if (featureTable.hasProperty(\"POSITION\")) {\n    // Handle positions.\n    return featureTable.getPropertyArray(\n      \"POSITION\",\n      ComponentDatatype.FLOAT,\n      3\n    );\n  } else if (featureTable.hasProperty(\"POSITION_QUANTIZED\")) {\n    // Handle quantized positions.\n    const quantizedPositions = featureTable.getPropertyArray(\n      \"POSITION_QUANTIZED\",\n      ComponentDatatype.UNSIGNED_SHORT,\n      3\n    );\n\n    const quantizedVolumeOffset = featureTable.getGlobalProperty(\n      \"QUANTIZED_VOLUME_OFFSET\",\n      ComponentDatatype.FLOAT,\n      3\n    );\n    if (!defined(quantizedVolumeOffset)) {\n      throw new RuntimeError(\n        \"Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.\"\n      );\n    }\n\n    const quantizedVolumeScale = featureTable.getGlobalProperty(\n      \"QUANTIZED_VOLUME_SCALE\",\n      ComponentDatatype.FLOAT,\n      3\n    );\n    if (!defined(quantizedVolumeScale)) {\n      throw new RuntimeError(\n        \"Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.\"\n      );\n    }\n\n    const decodedPositions = new Float32Array(quantizedPositions.length);\n    for (let i = 0; i < quantizedPositions.length / 3; i++) {\n      for (let j = 0; j < 3; j++) {\n        const index = 3 * i + j;\n        decodedPositions[index] =\n          (quantizedPositions[index] / 65535.0) * quantizedVolumeScale[j] +\n          quantizedVolumeOffset[j];\n      }\n    }\n\n    return decodedPositions;\n\n    // eslint-disable-next-line no-else-return\n  } else {\n    throw new RuntimeError(\n      \"Either POSITION or POSITION_QUANTIZED must be defined for each instance.\"\n    );\n  }\n}\n\nconst propertyScratch2 = new Array(4);\nfunction processRotation(\n  featureTable,\n  eastNorthUp,\n  i,\n  instanceQuaternion,\n  instancePosition,\n  instanceNormalUp,\n  instanceNormalRight,\n  instanceNormalForward,\n  instanceRotation,\n  instanceTransform\n) {\n  // Get the instance rotation\n  const normalUp = featureTable.getProperty(\n    \"NORMAL_UP\",\n    ComponentDatatype.FLOAT,\n    3,\n    i,\n    propertyScratch1\n  );\n  const normalRight = featureTable.getProperty(\n    \"NORMAL_RIGHT\",\n    ComponentDatatype.FLOAT,\n    3,\n    i,\n    propertyScratch2\n  );\n  let hasCustomOrientation = false;\n  if (defined(normalUp)) {\n    if (!defined(normalRight)) {\n      throw new RuntimeError(\n        \"To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.\"\n      );\n    }\n    Cartesian3.unpack(normalUp, 0, instanceNormalUp);\n    Cartesian3.unpack(normalRight, 0, instanceNormalRight);\n    hasCustomOrientation = true;\n  } else {\n    const octNormalUp = featureTable.getProperty(\n      \"NORMAL_UP_OCT32P\",\n      ComponentDatatype.UNSIGNED_SHORT,\n      2,\n      i,\n      propertyScratch1\n    );\n    const octNormalRight = featureTable.getProperty(\n      \"NORMAL_RIGHT_OCT32P\",\n      ComponentDatatype.UNSIGNED_SHORT,\n      2,\n      i,\n      propertyScratch2\n    );\n    if (defined(octNormalUp)) {\n      if (!defined(octNormalRight)) {\n        throw new RuntimeError(\n          \"To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.\"\n        );\n      }\n      AttributeCompression.octDecodeInRange(\n        octNormalUp[0],\n        octNormalUp[1],\n        65535,\n        instanceNormalUp\n      );\n      AttributeCompression.octDecodeInRange(\n        octNormalRight[0],\n        octNormalRight[1],\n        65535,\n        instanceNormalRight\n      );\n      hasCustomOrientation = true;\n    } else if (eastNorthUp) {\n      Transforms.eastNorthUpToFixedFrame(\n        instancePosition,\n        Ellipsoid.WGS84,\n        instanceTransform\n      );\n      Matrix4.getMatrix3(instanceTransform, instanceRotation);\n    } else {\n      Matrix3.clone(Matrix3.IDENTITY, instanceRotation);\n    }\n  }\n  if (hasCustomOrientation) {\n    Cartesian3.cross(\n      instanceNormalRight,\n      instanceNormalUp,\n      instanceNormalForward\n    );\n    Cartesian3.normalize(instanceNormalForward, instanceNormalForward);\n    Matrix3.setColumn(\n      instanceRotation,\n      0,\n      instanceNormalRight,\n      instanceRotation\n    );\n    Matrix3.setColumn(instanceRotation, 1, instanceNormalUp, instanceRotation);\n    Matrix3.setColumn(\n      instanceRotation,\n      2,\n      instanceNormalForward,\n      instanceRotation\n    );\n  }\n  Quaternion.fromRotationMatrix(instanceRotation, instanceQuaternion);\n}\n\nfunction processScale(featureTable, i, instanceScale) {\n  instanceScale = Cartesian3.fromElements(1.0, 1.0, 1.0, instanceScale);\n  const scale = featureTable.getProperty(\n    \"SCALE\",\n    ComponentDatatype.FLOAT,\n    1,\n    i\n  );\n  if (defined(scale)) {\n    Cartesian3.multiplyByScalar(instanceScale, scale, instanceScale);\n  }\n  const nonUniformScale = featureTable.getProperty(\n    \"SCALE_NON_UNIFORM\",\n    ComponentDatatype.FLOAT,\n    3,\n    i,\n    propertyScratch1\n  );\n  if (defined(nonUniformScale)) {\n    instanceScale.x *= nonUniformScale[0];\n    instanceScale.y *= nonUniformScale[1];\n    instanceScale.z *= nonUniformScale[2];\n  }\n}\n\nfunction unloadBuffers(loader) {\n  const buffers = loader._buffers;\n  const length = buffers.length;\n  for (let i = 0; i < length; i++) {\n    const buffer = buffers[i];\n    if (!buffer.isDestroyed()) {\n      buffer.destroy();\n    }\n  }\n  buffers.length = 0;\n}\n\nI3dmLoader.prototype.isUnloaded = function () {\n  return this._state === I3dmLoaderState.UNLOADED;\n};\n\nI3dmLoader.prototype.unload = function () {\n  if (defined(this._gltfLoader) && !this._gltfLoader.isDestroyed()) {\n    this._gltfLoader.unload();\n  }\n\n  unloadBuffers(this);\n\n  this._components = undefined;\n  this._arrayBuffer = undefined;\n  this._state = I3dmLoaderState.UNLOADED;\n};\n\nexport default I3dmLoader;\n", "/**\n * @private\n */\nconst ModelAnimationState = {\n  STOPPED: 0,\n  ANIMATING: 1,\n};\n\nexport default Object.freeze(ModelAnimationState);\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport CesiumMath from \"./Math.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Quaternion from \"./Quaternion.js\";\n\n/**\n * Creates a curve parameterized and evaluated by time. This type describes an interface\n * and is not intended to be instantiated directly.\n *\n * @alias Spline\n * @constructor\n *\n * @see CatmullRomSpline\n * @see LinearSpline\n * @see HermiteSpline\n * @see QuaternionSpline\n * @see MorphWeightSpline\n */\nfunction Spline() {\n  /**\n   * An array of times for the control points.\n   * @type {number[]}\n   * @default undefined\n   */\n  this.times = undefined;\n\n  /**\n   * An array of control points.\n   * @type {Cartesian3[]|Quaternion[]}\n   * @default undefined\n   */\n  this.points = undefined;\n\n  DeveloperError.throwInstantiationError();\n}\n\n/**\n * Gets the type of the point. This helps a spline determine how to interpolate\n * and return its values.\n *\n * @param {number|Cartesian3|Quaternion} point\n * @returns {*} The type of the point.\n *\n * @exception {DeveloperError} value must be a Cartesian3, Quaternion, or number.\n *\n * @private\n */\nSpline.getPointType = function (point) {\n  if (typeof point === \"number\") {\n    return Number;\n  }\n  if (point instanceof Cartesian3) {\n    return Cartesian3;\n  }\n  if (point instanceof Quaternion) {\n    return Quaternion;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  throw new DeveloperError(\n    \"point must be a Cartesian3, Quaternion, or number.\"\n  );\n  //>>includeEnd('debug');\n};\n\n/**\n * Evaluates the curve at a given time.\n * @function\n *\n * @param {number} time The time at which to evaluate the curve.\n * @param {Cartesian3|Quaternion|number[]} [result] The object onto which to store the result.\n * @returns {Cartesian3|Quaternion|number[]} The modified result parameter or a new instance of the point on the curve at the given time.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n *                             in the array <code>times</code>.\n */\nSpline.prototype.evaluate = DeveloperError.throwInstantiationError;\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n *\n * @param {number} time The time.\n * @param {number} startIndex The index from which to start the search.\n * @returns {number} The index for the element at the start of the interval.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n *                             in the array <code>times</code>.\n */\nSpline.prototype.findTimeInterval = function (time, startIndex) {\n  const times = this.times;\n  const length = times.length;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"time\", time);\n  if (time < times[0] || time > times[length - 1]) {\n    throw new DeveloperError(\"time is out of range.\");\n  }\n  //>>includeEnd('debug');\n\n  // Take advantage of temporal coherence by checking current, next and previous intervals\n  // for containment of time.\n  startIndex = defaultValue(startIndex, 0);\n\n  if (time >= times[startIndex]) {\n    if (startIndex + 1 < length && time < times[startIndex + 1]) {\n      return startIndex;\n    } else if (startIndex + 2 < length && time < times[startIndex + 2]) {\n      return startIndex + 1;\n    }\n  } else if (startIndex - 1 >= 0 && time >= times[startIndex - 1]) {\n    return startIndex - 1;\n  }\n\n  // The above failed so do a linear search. For the use cases so far, the\n  // length of the list is less than 10. In the future, if there is a bottle neck,\n  // it might be here.\n\n  let i;\n  if (time > times[startIndex]) {\n    for (i = startIndex; i < length - 1; ++i) {\n      if (time >= times[i] && time < times[i + 1]) {\n        break;\n      }\n    }\n  } else {\n    for (i = startIndex - 1; i >= 0; --i) {\n      if (time >= times[i] && time < times[i + 1]) {\n        break;\n      }\n    }\n  }\n\n  if (i === length - 1) {\n    i = length - 2;\n  }\n\n  return i;\n};\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, wrapped around the animation period.\n */\nSpline.prototype.wrapTime = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"time\", time);\n  //>>includeEnd('debug');\n\n  const times = this.times;\n  const timeEnd = times[times.length - 1];\n  const timeStart = times[0];\n  const timeStretch = timeEnd - timeStart;\n  let divs;\n  if (time < timeStart) {\n    divs = Math.floor((timeStart - time) / timeStretch) + 1;\n    time += divs * timeStretch;\n  }\n  if (time > timeEnd) {\n    divs = Math.floor((time - timeEnd) / timeStretch) + 1;\n    time -= divs * timeStretch;\n  }\n  return time;\n};\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, clamped to the animation period.\n */\nSpline.prototype.clampTime = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"time\", time);\n  //>>includeEnd('debug');\n\n  const times = this.times;\n  return CesiumMath.clamp(time, times[0], times[times.length - 1]);\n};\n\nexport default Spline;\n", "import Check from \"./Check.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Spline from \"./Spline.js\";\n\n/**\n * A spline that evaluates to a constant value. Although this follows the {@link Spline} interface,\n * it does not maintain an internal array of times since its value never changes.\n *\n * @alias ConstantSpline\n * @constructor\n *\n * @param {number|Cartesian3|Quaternion} value The constant value that the spline evaluates to.\n *\n * @example\n * const position = new Cesium.Cartesian3(1.0, 2.0, 3.0);\n * const spline = new Cesium.ConstantSpline(position);\n *\n * const p0 = spline.evaluate(0.0);\n *\n * @see LinearSpline\n * @see HermiteSpline\n * @see CatmullRomSpline\n * @see QuaternionSpline\n * @see MorphWeightSpline\n */\nfunction ConstantSpline(value) {\n  this._value = value;\n  this._valueType = Spline.getPointType(value);\n}\n\nObject.defineProperties(ConstantSpline.prototype, {\n  /**\n   * The constant value that the spline evaluates to.\n   *\n   * @memberof ConstantSpline.prototype\n   *\n   * @type {number|Cartesian3|Quaternion}\n   * @readonly\n   */\n  value: {\n    get: function () {\n      return this._value;\n    },\n  },\n});\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n *\n * Since a constant spline has no internal times array, this will throw an error.\n * @function\n *\n * @param {number} time The time.\n *\n * @exception {DeveloperError} findTimeInterval cannot be called on a ConstantSpline.\n */\nConstantSpline.prototype.findTimeInterval = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  throw new DeveloperError(\n    \"findTimeInterval cannot be called on a ConstantSpline.\"\n  );\n  //>>includeEnd('debug');\n};\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, wrapped around to the updated animation.\n */\nConstantSpline.prototype.wrapTime = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"time\", time);\n  //>>includeEnd('debug');\n\n  return 0.0;\n};\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, clamped to the animation period.\n */\nConstantSpline.prototype.clampTime = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"time\", time);\n  //>>includeEnd('debug');\n\n  return 0.0;\n};\n\n/**\n * Evaluates the curve at a given time.\n * @function\n *\n * @param {number} time The time at which to evaluate the curve.\n * @param {Cartesian3|Quaternion} [result] The object onto which to store the result.\n * @returns {number|Cartesian3|Quaternion} The modified result parameter or the value that the constant spline represents.\n */\nConstantSpline.prototype.evaluate = function (time, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"time\", time);\n  //>>includeEnd('debug');\n\n  const value = this._value;\n  const ValueType = this._valueType;\n\n  if (ValueType === Number) {\n    return value;\n  }\n\n  return ValueType.clone(value, result);\n};\n\nexport default ConstantSpline;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Spline from \"./Spline.js\";\n\n/**\n * A spline that uses piecewise linear interpolation to create a curve.\n *\n * @alias LinearSpline\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point.\n *                The values are in no way connected to the clock time. They are the parameterization for the curve.\n * @param {number[]|Cartesian3[]} options.points The array of control points.\n *\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be equal to points.length.\n *\n *\n * @example\n * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];\n * const spline = new Cesium.LinearSpline({\n *     times : times,\n *     points : [\n *         new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),\n *         new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),\n *         new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),\n *         new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),\n *         new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)\n *     ]\n * });\n *\n * const p0 = spline.evaluate(times[0]);\n *\n * @see ConstantSpline\n * @see SteppedSpline\n * @see HermiteSpline\n * @see CatmullRomSpline\n * @see QuaternionSpline\n * @see MorphWeightSpline\n */\nfunction LinearSpline(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const points = options.points;\n  const times = options.times;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(points) || !defined(times)) {\n    throw new DeveloperError(\"points and times are required.\");\n  }\n  if (points.length < 2) {\n    throw new DeveloperError(\n      \"points.length must be greater than or equal to 2.\"\n    );\n  }\n  if (times.length !== points.length) {\n    throw new DeveloperError(\"times.length must be equal to points.length.\");\n  }\n  //>>includeEnd('debug');\n\n  this._times = times;\n  this._points = points;\n  this._pointType = Spline.getPointType(points[0]);\n\n  this._lastTimeIndex = 0;\n}\n\nObject.defineProperties(LinearSpline.prototype, {\n  /**\n   * An array of times for the control points.\n   *\n   * @memberof LinearSpline.prototype\n   *\n   * @type {number[]}\n   * @readonly\n   */\n  times: {\n    get: function () {\n      return this._times;\n    },\n  },\n\n  /**\n   * An array of {@link Cartesian3} control points.\n   *\n   * @memberof LinearSpline.prototype\n   *\n   * @type {number[]|Cartesian3[]}\n   * @readonly\n   */\n  points: {\n    get: function () {\n      return this._points;\n    },\n  },\n});\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n * @function\n *\n * @param {number} time The time.\n * @returns {number} The index for the element at the start of the interval.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n *                             in the array <code>times</code>.\n */\nLinearSpline.prototype.findTimeInterval = Spline.prototype.findTimeInterval;\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, wrapped around to the updated animation.\n */\nLinearSpline.prototype.wrapTime = Spline.prototype.wrapTime;\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, clamped to the animation period.\n */\nLinearSpline.prototype.clampTime = Spline.prototype.clampTime;\n\n/**\n * Evaluates the curve at a given time.\n *\n * @param {number} time The time at which to evaluate the curve.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {number|Cartesian3} The modified result parameter or a new instance of the point on the curve at the given time.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n *                             in the array <code>times</code>.\n */\nLinearSpline.prototype.evaluate = function (time, result) {\n  const points = this.points;\n  const times = this.times;\n\n  const i = (this._lastTimeIndex = this.findTimeInterval(\n    time,\n    this._lastTimeIndex\n  ));\n  const u = (time - times[i]) / (times[i + 1] - times[i]);\n\n  const PointType = this._pointType;\n  if (PointType === Number) {\n    return (1.0 - u) * points[i] + u * points[i + 1];\n  }\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  return Cartesian3.lerp(points[i], points[i + 1], u, result);\n};\n\nexport default LinearSpline;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Uses the Tridiagonal Matrix Algorithm, also known as the Thomas Algorithm, to solve\n * a system of linear equations where the coefficient matrix is a tridiagonal matrix.\n *\n * @namespace TridiagonalSystemSolver\n */\nconst TridiagonalSystemSolver = {};\n\n/**\n * Solves a tridiagonal system of linear equations.\n *\n * @param {number[]} diagonal An array with length <code>n</code> that contains the diagonal of the coefficient matrix.\n * @param {number[]} lower An array with length <code>n - 1</code> that contains the lower diagonal of the coefficient matrix.\n * @param {number[]} upper An array with length <code>n - 1</code> that contains the upper diagonal of the coefficient matrix.\n * @param {Cartesian3[]} right An array of Cartesians with length <code>n</code> that is the right side of the system of equations.\n *\n * @exception {DeveloperError} diagonal and right must have the same lengths.\n * @exception {DeveloperError} lower and upper must have the same lengths.\n * @exception {DeveloperError} lower and upper must be one less than the length of diagonal.\n *\n * @performance Linear time.\n *\n * @example\n * const lowerDiagonal = [1.0, 1.0, 1.0, 1.0];\n * const diagonal = [2.0, 4.0, 4.0, 4.0, 2.0];\n * const upperDiagonal = [1.0, 1.0, 1.0, 1.0];\n * const rightHandSide = [\n *     new Cesium.Cartesian3(410757.0, -1595711.0, 1375302.0),\n *     new Cesium.Cartesian3(-5986705.0, -2190640.0, 1099600.0),\n *     new Cesium.Cartesian3(-12593180.0, 288588.0, -1755549.0),\n *     new Cesium.Cartesian3(-5349898.0, 2457005.0, -2685438.0),\n *     new Cesium.Cartesian3(845820.0, 1573488.0, -1205591.0)\n * ];\n *\n * const solution = Cesium.TridiagonalSystemSolver.solve(lowerDiagonal, diagonal, upperDiagonal, rightHandSide);\n *\n * @returns {Cartesian3[]} An array of Cartesians with length <code>n</code> that is the solution to the tridiagonal system of equations.\n */\nTridiagonalSystemSolver.solve = function (lower, diagonal, upper, right) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(lower) || !(lower instanceof Array)) {\n    throw new DeveloperError(\"The array lower is required.\");\n  }\n  if (!defined(diagonal) || !(diagonal instanceof Array)) {\n    throw new DeveloperError(\"The array diagonal is required.\");\n  }\n  if (!defined(upper) || !(upper instanceof Array)) {\n    throw new DeveloperError(\"The array upper is required.\");\n  }\n  if (!defined(right) || !(right instanceof Array)) {\n    throw new DeveloperError(\"The array right is required.\");\n  }\n  if (diagonal.length !== right.length) {\n    throw new DeveloperError(\"diagonal and right must have the same lengths.\");\n  }\n  if (lower.length !== upper.length) {\n    throw new DeveloperError(\"lower and upper must have the same lengths.\");\n  } else if (lower.length !== diagonal.length - 1) {\n    throw new DeveloperError(\n      \"lower and upper must be one less than the length of diagonal.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const c = new Array(upper.length);\n  const d = new Array(right.length);\n  const x = new Array(right.length);\n\n  let i;\n  for (i = 0; i < d.length; i++) {\n    d[i] = new Cartesian3();\n    x[i] = new Cartesian3();\n  }\n\n  c[0] = upper[0] / diagonal[0];\n  d[0] = Cartesian3.multiplyByScalar(right[0], 1.0 / diagonal[0], d[0]);\n\n  let scalar;\n  for (i = 1; i < c.length; ++i) {\n    scalar = 1.0 / (diagonal[i] - c[i - 1] * lower[i - 1]);\n    c[i] = upper[i] * scalar;\n    d[i] = Cartesian3.subtract(\n      right[i],\n      Cartesian3.multiplyByScalar(d[i - 1], lower[i - 1], d[i]),\n      d[i]\n    );\n    d[i] = Cartesian3.multiplyByScalar(d[i], scalar, d[i]);\n  }\n\n  scalar = 1.0 / (diagonal[i] - c[i - 1] * lower[i - 1]);\n  d[i] = Cartesian3.subtract(\n    right[i],\n    Cartesian3.multiplyByScalar(d[i - 1], lower[i - 1], d[i]),\n    d[i]\n  );\n  d[i] = Cartesian3.multiplyByScalar(d[i], scalar, d[i]);\n\n  x[x.length - 1] = d[d.length - 1];\n  for (i = x.length - 2; i >= 0; --i) {\n    x[i] = Cartesian3.subtract(\n      d[i],\n      Cartesian3.multiplyByScalar(x[i + 1], c[i], x[i]),\n      x[i]\n    );\n  }\n\n  return x;\n};\nexport default TridiagonalSystemSolver;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport LinearSpline from \"./LinearSpline.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Spline from \"./Spline.js\";\nimport TridiagonalSystemSolver from \"./TridiagonalSystemSolver.js\";\n\nconst scratchLower = [];\nconst scratchDiagonal = [];\nconst scratchUpper = [];\nconst scratchRight = [];\n\nfunction generateClamped(points, firstTangent, lastTangent) {\n  const l = scratchLower;\n  const u = scratchUpper;\n  const d = scratchDiagonal;\n  const r = scratchRight;\n\n  l.length = u.length = points.length - 1;\n  d.length = r.length = points.length;\n\n  let i;\n  l[0] = d[0] = 1.0;\n  u[0] = 0.0;\n\n  let right = r[0];\n  if (!defined(right)) {\n    right = r[0] = new Cartesian3();\n  }\n  Cartesian3.clone(firstTangent, right);\n\n  for (i = 1; i < l.length - 1; ++i) {\n    l[i] = u[i] = 1.0;\n    d[i] = 4.0;\n\n    right = r[i];\n    if (!defined(right)) {\n      right = r[i] = new Cartesian3();\n    }\n    Cartesian3.subtract(points[i + 1], points[i - 1], right);\n    Cartesian3.multiplyByScalar(right, 3.0, right);\n  }\n\n  l[i] = 0.0;\n  u[i] = 1.0;\n  d[i] = 4.0;\n\n  right = r[i];\n  if (!defined(right)) {\n    right = r[i] = new Cartesian3();\n  }\n  Cartesian3.subtract(points[i + 1], points[i - 1], right);\n  Cartesian3.multiplyByScalar(right, 3.0, right);\n\n  d[i + 1] = 1.0;\n  right = r[i + 1];\n  if (!defined(right)) {\n    right = r[i + 1] = new Cartesian3();\n  }\n  Cartesian3.clone(lastTangent, right);\n\n  return TridiagonalSystemSolver.solve(l, d, u, r);\n}\n\nfunction generateNatural(points) {\n  const l = scratchLower;\n  const u = scratchUpper;\n  const d = scratchDiagonal;\n  const r = scratchRight;\n\n  l.length = u.length = points.length - 1;\n  d.length = r.length = points.length;\n\n  let i;\n  l[0] = u[0] = 1.0;\n  d[0] = 2.0;\n\n  let right = r[0];\n  if (!defined(right)) {\n    right = r[0] = new Cartesian3();\n  }\n  Cartesian3.subtract(points[1], points[0], right);\n  Cartesian3.multiplyByScalar(right, 3.0, right);\n\n  for (i = 1; i < l.length; ++i) {\n    l[i] = u[i] = 1.0;\n    d[i] = 4.0;\n\n    right = r[i];\n    if (!defined(right)) {\n      right = r[i] = new Cartesian3();\n    }\n    Cartesian3.subtract(points[i + 1], points[i - 1], right);\n    Cartesian3.multiplyByScalar(right, 3.0, right);\n  }\n\n  d[i] = 2.0;\n\n  right = r[i];\n  if (!defined(right)) {\n    right = r[i] = new Cartesian3();\n  }\n  Cartesian3.subtract(points[i], points[i - 1], right);\n  Cartesian3.multiplyByScalar(right, 3.0, right);\n\n  return TridiagonalSystemSolver.solve(l, d, u, r);\n}\n\n/**\n * A Hermite spline is a cubic interpolating spline. Points, incoming tangents, outgoing tangents, and times\n * must be defined for each control point. The outgoing tangents are defined for points [0, n - 2] and the incoming\n * tangents are defined for points [1, n - 1]. For example, when interpolating a segment of the curve between <code>points[i]</code> and\n * <code>points[i + 1]</code>, the tangents at the points will be <code>outTangents[i]</code> and <code>inTangents[i]</code>,\n * respectively.\n *\n * @alias HermiteSpline\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point.\n *                The values are in no way connected to the clock time. They are the parameterization for the curve.\n * @param {Cartesian3[]} options.points The array of control points.\n * @param {Cartesian3[]} options.inTangents The array of incoming tangents at each control point.\n * @param {Cartesian3[]} options.outTangents The array of outgoing tangents at each control point.\n *\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be equal to points.length.\n * @exception {DeveloperError} inTangents and outTangents must have a length equal to points.length - 1.\n * @exception {DeveloperError} inTangents and outTangents must be of the same type as points.\n *\n * @example\n * // Create a G<sup>1</sup> continuous Hermite spline\n * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];\n * const spline = new Cesium.HermiteSpline({\n *     times : times,\n *     points : [\n *         new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),\n *         new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),\n *         new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),\n *         new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),\n *         new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)\n *     ],\n *     outTangents : [\n *         new Cesium.Cartesian3(1125196, -161816, 270551),\n *         new Cesium.Cartesian3(-996690.5, -365906.5, 184028.5),\n *         new Cesium.Cartesian3(-2096917, 48379.5, -292683.5),\n *         new Cesium.Cartesian3(-890902.5, 408999.5, -447115)\n *     ],\n *     inTangents : [\n *         new Cesium.Cartesian3(-1993381, -731813, 368057),\n *         new Cesium.Cartesian3(-4193834, 96759, -585367),\n *         new Cesium.Cartesian3(-1781805, 817999, -894230),\n *         new Cesium.Cartesian3(1165345, 112641, 47281)\n *     ]\n * });\n *\n * const p0 = spline.evaluate(times[0]);\n *\n * @see ConstantSpline\n * @see SteppedSpline\n * @see LinearSpline\n * @see CatmullRomSpline\n * @see QuaternionSpline\n * @see MorphWeightSpline\n */\nfunction HermiteSpline(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const points = options.points;\n  const times = options.times;\n  const inTangents = options.inTangents;\n  const outTangents = options.outTangents;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    !defined(points) ||\n    !defined(times) ||\n    !defined(inTangents) ||\n    !defined(outTangents)\n  ) {\n    throw new DeveloperError(\n      \"times, points, inTangents, and outTangents are required.\"\n    );\n  }\n  if (points.length < 2) {\n    throw new DeveloperError(\n      \"points.length must be greater than or equal to 2.\"\n    );\n  }\n  if (times.length !== points.length) {\n    throw new DeveloperError(\"times.length must be equal to points.length.\");\n  }\n  if (\n    inTangents.length !== outTangents.length ||\n    inTangents.length !== points.length - 1\n  ) {\n    throw new DeveloperError(\n      \"inTangents and outTangents must have a length equal to points.length - 1.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._times = times;\n  this._points = points;\n  this._pointType = Spline.getPointType(points[0]);\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    this._pointType !== Spline.getPointType(inTangents[0]) ||\n    this._pointType !== Spline.getPointType(outTangents[0])\n  ) {\n    throw new DeveloperError(\n      \"inTangents and outTangents must be of the same type as points.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._inTangents = inTangents;\n  this._outTangents = outTangents;\n\n  this._lastTimeIndex = 0;\n}\n\nObject.defineProperties(HermiteSpline.prototype, {\n  /**\n   * An array of times for the control points.\n   *\n   * @memberof HermiteSpline.prototype\n   *\n   * @type {number[]}\n   * @readonly\n   */\n  times: {\n    get: function () {\n      return this._times;\n    },\n  },\n\n  /**\n   * An array of control points.\n   *\n   * @memberof HermiteSpline.prototype\n   *\n   * @type {Cartesian3[]}\n   * @readonly\n   */\n  points: {\n    get: function () {\n      return this._points;\n    },\n  },\n\n  /**\n   * An array of incoming tangents at each control point.\n   *\n   * @memberof HermiteSpline.prototype\n   *\n   * @type {Cartesian3[]}\n   * @readonly\n   */\n  inTangents: {\n    get: function () {\n      return this._inTangents;\n    },\n  },\n\n  /**\n   * An array of outgoing tangents at each control point.\n   *\n   * @memberof HermiteSpline.prototype\n   *\n   * @type {Cartesian3[]}\n   * @readonly\n   */\n  outTangents: {\n    get: function () {\n      return this._outTangents;\n    },\n  },\n});\n\n/**\n * Creates a spline where the tangents at each control point are the same.\n * The curves are guaranteed to be at least in the class C<sup>1</sup>.\n *\n * @param {object} options Object with the following properties:\n * @param {number[]} options.times The array of control point times.\n * @param {Cartesian3[]} options.points The array of control points.\n * @param {Cartesian3[]} options.tangents The array of tangents at the control points.\n * @returns {HermiteSpline} A hermite spline.\n *\n * @exception {DeveloperError} points, times and tangents are required.\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times, points and tangents must have the same length.\n *\n * @example\n * const points = [\n *     new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),\n *     new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),\n *     new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),\n *     new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),\n *     new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)\n * ];\n *\n * // Add tangents\n * const tangents = new Array(points.length);\n * tangents[0] = new Cesium.Cartesian3(1125196, -161816, 270551);\n * const temp = new Cesium.Cartesian3();\n * for (let i = 1; i < tangents.length - 1; ++i) {\n *     tangents[i] = Cesium.Cartesian3.multiplyByScalar(Cesium.Cartesian3.subtract(points[i + 1], points[i - 1], temp), 0.5, new Cesium.Cartesian3());\n * }\n * tangents[tangents.length - 1] = new Cesium.Cartesian3(1165345, 112641, 47281);\n *\n * const spline = Cesium.HermiteSpline.createC1({\n *     times : times,\n *     points : points,\n *     tangents : tangents\n * });\n */\nHermiteSpline.createC1 = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const times = options.times;\n  const points = options.points;\n  const tangents = options.tangents;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(points) || !defined(times) || !defined(tangents)) {\n    throw new DeveloperError(\"points, times and tangents are required.\");\n  }\n  if (points.length < 2) {\n    throw new DeveloperError(\n      \"points.length must be greater than or equal to 2.\"\n    );\n  }\n  if (times.length !== points.length || times.length !== tangents.length) {\n    throw new DeveloperError(\n      \"times, points and tangents must have the same length.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const outTangents = tangents.slice(0, tangents.length - 1);\n  const inTangents = tangents.slice(1, tangents.length);\n\n  return new HermiteSpline({\n    times: times,\n    points: points,\n    inTangents: inTangents,\n    outTangents: outTangents,\n  });\n};\n\n/**\n * Creates a natural cubic spline. The tangents at the control points are generated\n * to create a curve in the class C<sup>2</sup>.\n *\n * @param {object} options Object with the following properties:\n * @param {number[]} options.times The array of control point times.\n * @param {Cartesian3[]} options.points The array of control points.\n * @returns {HermiteSpline|LinearSpline} A hermite spline, or a linear spline if less than 3 control points were given.\n *\n * @exception {DeveloperError} points and times are required.\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be equal to points.length.\n *\n * @example\n * // Create a natural cubic spline above the earth from Philadelphia to Los Angeles.\n * const spline = Cesium.HermiteSpline.createNaturalCubic({\n *     times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],\n *     points : [\n *         new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),\n *         new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),\n *         new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),\n *         new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),\n *         new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)\n *     ]\n * });\n */\nHermiteSpline.createNaturalCubic = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const times = options.times;\n  const points = options.points;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(points) || !defined(times)) {\n    throw new DeveloperError(\"points and times are required.\");\n  }\n  if (points.length < 2) {\n    throw new DeveloperError(\n      \"points.length must be greater than or equal to 2.\"\n    );\n  }\n  if (times.length !== points.length) {\n    throw new DeveloperError(\"times.length must be equal to points.length.\");\n  }\n  //>>includeEnd('debug');\n\n  if (points.length < 3) {\n    return new LinearSpline({\n      points: points,\n      times: times,\n    });\n  }\n\n  const tangents = generateNatural(points);\n  const outTangents = tangents.slice(0, tangents.length - 1);\n  const inTangents = tangents.slice(1, tangents.length);\n\n  return new HermiteSpline({\n    times: times,\n    points: points,\n    inTangents: inTangents,\n    outTangents: outTangents,\n  });\n};\n\n/**\n * Creates a clamped cubic spline. The tangents at the interior control points are generated\n * to create a curve in the class C<sup>2</sup>.\n *\n * @param {object} options Object with the following properties:\n * @param {number[]} options.times The array of control point times.\n * @param {number[]|Cartesian3[]} options.points The array of control points.\n * @param {Cartesian3} options.firstTangent The outgoing tangent of the first control point.\n * @param {Cartesian3} options.lastTangent The incoming tangent of the last control point.\n * @returns {HermiteSpline|LinearSpline} A hermite spline, or a linear spline if less than 3 control points were given.\n *\n * @exception {DeveloperError} points, times, firstTangent and lastTangent are required.\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be equal to points.length.\n * @exception {DeveloperError} firstTangent and lastTangent must be of the same type as points.\n *\n * @example\n * // Create a clamped cubic spline above the earth from Philadelphia to Los Angeles.\n * const spline = Cesium.HermiteSpline.createClampedCubic({\n *     times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],\n *     points : [\n *         new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),\n *         new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),\n *         new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),\n *         new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),\n *         new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)\n *     ],\n *     firstTangent : new Cesium.Cartesian3(1125196, -161816, 270551),\n *     lastTangent : new Cesium.Cartesian3(1165345, 112641, 47281)\n * });\n */\nHermiteSpline.createClampedCubic = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const times = options.times;\n  const points = options.points;\n  const firstTangent = options.firstTangent;\n  const lastTangent = options.lastTangent;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    !defined(points) ||\n    !defined(times) ||\n    !defined(firstTangent) ||\n    !defined(lastTangent)\n  ) {\n    throw new DeveloperError(\n      \"points, times, firstTangent and lastTangent are required.\"\n    );\n  }\n  if (points.length < 2) {\n    throw new DeveloperError(\n      \"points.length must be greater than or equal to 2.\"\n    );\n  }\n  if (times.length !== points.length) {\n    throw new DeveloperError(\"times.length must be equal to points.length.\");\n  }\n  //>>includeEnd('debug');\n\n  const PointType = Spline.getPointType(points[0]);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    PointType !== Spline.getPointType(firstTangent) ||\n    PointType !== Spline.getPointType(lastTangent)\n  ) {\n    throw new DeveloperError(\n      \"firstTangent and lastTangent must be of the same type as points.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  if (points.length < 3) {\n    return new LinearSpline({\n      points: points,\n      times: times,\n    });\n  }\n\n  const tangents = generateClamped(points, firstTangent, lastTangent);\n  const outTangents = tangents.slice(0, tangents.length - 1);\n  const inTangents = tangents.slice(1, tangents.length);\n\n  return new HermiteSpline({\n    times: times,\n    points: points,\n    inTangents: inTangents,\n    outTangents: outTangents,\n  });\n};\n\n//prettier-ignore\nHermiteSpline.hermiteCoefficientMatrix = new Matrix4(\n  2.0, -3.0, 0.0, 1.0,\n  -2.0, 3.0, 0.0, 0.0,\n  1.0, -2.0, 1.0, 0.0,\n  1.0, -1.0, 0.0, 0.0\n);\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n * @function\n *\n * @param {number} time The time.\n * @returns {number} The index for the element at the start of the interval.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n *                             in the array <code>times</code>.\n */\nHermiteSpline.prototype.findTimeInterval = Spline.prototype.findTimeInterval;\n\nconst scratchTimeVec = new Cartesian4();\nconst scratchTemp = new Cartesian3();\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, wrapped around to the updated animation.\n */\nHermiteSpline.prototype.wrapTime = Spline.prototype.wrapTime;\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, clamped to the animation period.\n */\nHermiteSpline.prototype.clampTime = Spline.prototype.clampTime;\n\n/**\n * Evaluates the curve at a given time.\n *\n * @param {number} time The time at which to evaluate the curve.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new instance of the point on the curve at the given time.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n *                             in the array <code>times</code>.\n */\nHermiteSpline.prototype.evaluate = function (time, result) {\n  const points = this.points;\n  const times = this.times;\n  const inTangents = this.inTangents;\n  const outTangents = this.outTangents;\n\n  this._lastTimeIndex = this.findTimeInterval(time, this._lastTimeIndex);\n  const i = this._lastTimeIndex;\n\n  const timesDelta = times[i + 1] - times[i];\n  const u = (time - times[i]) / timesDelta;\n\n  const timeVec = scratchTimeVec;\n  timeVec.z = u;\n  timeVec.y = u * u;\n  timeVec.x = timeVec.y * u;\n  timeVec.w = 1.0;\n\n  // Coefficients are returned in the following order:\n  // start, end, out-tangent, in-tangent\n  const coefs = Matrix4.multiplyByVector(\n    HermiteSpline.hermiteCoefficientMatrix,\n    timeVec,\n    timeVec\n  );\n\n  // Multiply the out-tangent and in-tangent values by the time delta.\n  coefs.z *= timesDelta;\n  coefs.w *= timesDelta;\n\n  const PointType = this._pointType;\n\n  if (PointType === Number) {\n    return (\n      points[i] * coefs.x +\n      points[i + 1] * coefs.y +\n      outTangents[i] * coefs.z +\n      inTangents[i] * coefs.w\n    );\n  }\n\n  if (!defined(result)) {\n    result = new PointType();\n  }\n\n  result = PointType.multiplyByScalar(points[i], coefs.x, result);\n  PointType.multiplyByScalar(points[i + 1], coefs.y, scratchTemp);\n  PointType.add(result, scratchTemp, result);\n  PointType.multiplyByScalar(outTangents[i], coefs.z, scratchTemp);\n  PointType.add(result, scratchTemp, result);\n  PointType.multiplyByScalar(inTangents[i], coefs.w, scratchTemp);\n  return PointType.add(result, scratchTemp, result);\n};\nexport default HermiteSpline;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Spline from \"./Spline.js\";\n\n/**\n * A spline that is composed of piecewise constants representing a step function.\n *\n * @alias SteppedSpline\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point. The values are in no way connected to the clock time. They are the parameterization for the curve.\n * @param {number[]|Cartesian3[]|Quaternion[]} options.points The array of control points.\n *\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be equal to points.length.\n *\n * @example\n * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];\n * const spline = new Cesium.SteppedSpline({\n *     times : times,\n *     points : [\n *         new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),\n *         new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),\n *         new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),\n *         new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),\n *         new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)\n *     ]\n * });\n *\n * const p0 = spline.evaluate(times[0]);\n *\n * @see ConstantSpline\n * @see CatmullRomSpline\n * @see HermiteSpline\n * @see LinearSpline\n * @see QuaternionSpline\n * @see MorphWeightSpline\n */\nfunction SteppedSpline(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const points = options.points;\n  const times = options.times;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(points) || !defined(times)) {\n    throw new DeveloperError(\"points and times are required.\");\n  }\n  if (points.length < 2) {\n    throw new DeveloperError(\n      \"points.length must be greater than or equal to 2.\"\n    );\n  }\n  if (times.length !== points.length) {\n    throw new DeveloperError(\"times.length must be equal to points.length.\");\n  }\n  //>>includeEnd('debug');\n\n  this._times = times;\n  this._points = points;\n  this._pointType = Spline.getPointType(points[0]);\n\n  this._lastTimeIndex = 0;\n}\n\nObject.defineProperties(SteppedSpline.prototype, {\n  /**\n   * An array of times for the control points.\n   *\n   * @memberof SteppedSpline.prototype\n   *\n   * @type {number[]}\n   * @readonly\n   */\n  times: {\n    get: function () {\n      return this._times;\n    },\n  },\n\n  /**\n   * An array of control points.\n   *\n   * @memberof SteppedSpline.prototype\n   *\n   * @type {number[]|Cartesian3[]|Quaternion[]}\n   * @readonly\n   */\n  points: {\n    get: function () {\n      return this._points;\n    },\n  },\n});\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n * @function\n *\n * @param {number} time The time.\n * @param {number} startIndex The index from which to start the search.\n * @returns {number} The index for the element at the start of the interval.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n *                             in the array <code>times</code>.\n */\nSteppedSpline.prototype.findTimeInterval = Spline.prototype.findTimeInterval;\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, wrapped around to the updated animation.\n */\nSteppedSpline.prototype.wrapTime = Spline.prototype.wrapTime;\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, clamped to the animation period.\n */\nSteppedSpline.prototype.clampTime = Spline.prototype.clampTime;\n\n/**\n * Evaluates the curve at a given time.\n *\n * @param {number} time The time at which to evaluate the curve.\n * @param {Cartesian3|Quaternion} [result] The object onto which to store the result.\n * @returns {number|Cartesian3|Quaternion} The modified result parameter or a new instance of the point on the curve at the given time.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n *                             in the array <code>times</code>.\n */\nSteppedSpline.prototype.evaluate = function (time, result) {\n  const points = this.points;\n\n  this._lastTimeIndex = this.findTimeInterval(time, this._lastTimeIndex);\n  const i = this._lastTimeIndex;\n\n  const PointType = this._pointType;\n  if (PointType === Number) {\n    return points[i];\n  }\n\n  if (!defined(result)) {\n    result = new PointType();\n  }\n\n  return PointType.clone(points[i], result);\n};\n\nexport default SteppedSpline;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Spline from \"./Spline.js\";\n\nfunction createEvaluateFunction(spline) {\n  const points = spline.points;\n  const times = spline.times;\n\n  // use slerp interpolation\n  return function (time, result) {\n    if (!defined(result)) {\n      result = new Quaternion();\n    }\n    const i = (spline._lastTimeIndex = spline.findTimeInterval(\n      time,\n      spline._lastTimeIndex\n    ));\n    const u = (time - times[i]) / (times[i + 1] - times[i]);\n\n    const q0 = points[i];\n    const q1 = points[i + 1];\n\n    return Quaternion.fastSlerp(q0, q1, u, result);\n  };\n}\n\n/**\n * A spline that uses spherical linear (slerp) interpolation to create a quaternion curve.\n * The generated curve is in the class C<sup>1</sup>.\n *\n * @alias QuaternionSpline\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point.\n *                The values are in no way connected to the clock time. They are the parameterization for the curve.\n * @param {Quaternion[]} options.points The array of {@link Quaternion} control points.\n *\n * @exception {DeveloperError} points and times are required\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be equal to points.length.\n\n * @see ConstantSpline\n * @see SteppedSpline\n * @see HermiteSpline\n * @see CatmullRomSpline\n * @see LinearSpline\n * @see MorphWeightSpline\n */\nfunction QuaternionSpline(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const points = options.points;\n  const times = options.times;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(points) || !defined(times)) {\n    throw new DeveloperError(\"points and times are required.\");\n  }\n  if (points.length < 2) {\n    throw new DeveloperError(\n      \"points.length must be greater than or equal to 2.\"\n    );\n  }\n  if (times.length !== points.length) {\n    throw new DeveloperError(\"times.length must be equal to points.length.\");\n  }\n  //>>includeEnd('debug');\n\n  this._times = times;\n  this._points = points;\n\n  this._evaluateFunction = createEvaluateFunction(this);\n  this._lastTimeIndex = 0;\n}\n\nObject.defineProperties(QuaternionSpline.prototype, {\n  /**\n   * An array of times for the control points.\n   *\n   * @memberof QuaternionSpline.prototype\n   *\n   * @type {number[]}\n   * @readonly\n   */\n  times: {\n    get: function () {\n      return this._times;\n    },\n  },\n\n  /**\n   * An array of {@link Quaternion} control points.\n   *\n   * @memberof QuaternionSpline.prototype\n   *\n   * @type {Quaternion[]}\n   * @readonly\n   */\n  points: {\n    get: function () {\n      return this._points;\n    },\n  },\n});\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n * @function\n *\n * @param {number} time The time.\n * @returns {number} The index for the element at the start of the interval.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n *                             in the array <code>times</code>.\n */\nQuaternionSpline.prototype.findTimeInterval = Spline.prototype.findTimeInterval;\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, wrapped around to the updated animation.\n */\nQuaternionSpline.prototype.wrapTime = Spline.prototype.wrapTime;\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, clamped to the animation period.\n */\nQuaternionSpline.prototype.clampTime = Spline.prototype.clampTime;\n\n/**\n * Evaluates the curve at a given time.\n *\n * @param {number} time The time at which to evaluate the curve.\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new instance of the point on the curve at the given time.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n *                             in the array <code>times</code>.\n */\nQuaternionSpline.prototype.evaluate = function (time, result) {\n  return this._evaluateFunction(time, result);\n};\nexport default QuaternionSpline;\n", "import Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Check from \"../../Core/Check.js\";\nimport ConstantSpline from \"../../Core/ConstantSpline.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport HermiteSpline from \"../../Core/HermiteSpline.js\";\nimport InterpolationType from \"../../Core/InterpolationType.js\";\nimport LinearSpline from \"../../Core/LinearSpline.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport SteppedSpline from \"../../Core/SteppedSpline.js\";\nimport Quaternion from \"../../Core/Quaternion.js\";\nimport QuaternionSpline from \"../../Core/QuaternionSpline.js\";\n\nconst AnimatedPropertyType = ModelComponents.AnimatedPropertyType;\n\n/**\n * A runtime animation channel for a {@link ModelAnimation}. An animation\n * channel is responsible for interpolating between the keyframe values of an animated\n * property, then applying the change to the target node.\n *\n * @param {object} options An object containing the following options:\n * @param {ModelComponents.AnimationChannel} options.channel The corresponding animation channel components from the 3D model.\n * @param {ModelAnimation} options.runtimeAnimation The runtime animation containing this channel.\n * @param {ModelRuntimeNode} options.runtimeNode The runtime node that this channel will animate.\n *\n * @alias ModelAnimationChannel\n * @constructor\n *\n * @private\n */\nfunction ModelAnimationChannel(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const channel = options.channel;\n  const runtimeAnimation = options.runtimeAnimation;\n  const runtimeNode = options.runtimeNode;\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.channel\", channel);\n  Check.typeOf.object(\"options.runtimeAnimation\", runtimeAnimation);\n  Check.typeOf.object(\"options.runtimeNode\", runtimeNode);\n  //>>includeEnd('debug');\n\n  this._channel = channel;\n  this._runtimeAnimation = runtimeAnimation;\n  this._runtimeNode = runtimeNode;\n\n  // An animation channel can have multiple splines if it animates\n  // a node's morph weights, which will involve multiple morph targets.\n  this._splines = [];\n  this._path = undefined;\n\n  initialize(this);\n}\n\nObject.defineProperties(ModelAnimationChannel.prototype, {\n  /**\n   * The glTF animation channel.\n   *\n   * @memberof ModelAnimationChannel.prototype\n   *\n   * @type {ModelComponents.AnimationChannel}\n   * @readonly\n   *\n   * @private\n   */\n  channel: {\n    get: function () {\n      return this._channel;\n    },\n  },\n\n  /**\n   * The runtime animation that owns this channel.\n   *\n   * @memberof ModelAnimationChannel.prototype\n   *\n   * @type {ModelAnimation}\n   * @readonly\n   *\n   * @private\n   */\n  runtimeAnimation: {\n    get: function () {\n      return this._runtimeAnimation;\n    },\n  },\n\n  /**\n   * The runtime node that this channel animates.\n   *\n   * @memberof ModelAnimationChannel.prototype\n   *\n   * @type {ModelRuntimeNode}\n   * @readonly\n   *\n   * @private\n   */\n  runtimeNode: {\n    get: function () {\n      return this._runtimeNode;\n    },\n  },\n\n  /**\n   * The splines used to evaluate this animation channel.\n   *\n   * @memberof ModelAnimationChannel.prototype\n   *\n   * @type {Spline[]}\n   * @readonly\n   *\n   * @private\n   */\n  splines: {\n    get: function () {\n      return this._splines;\n    },\n  },\n});\n\nfunction createCubicSpline(times, points) {\n  const cubicPoints = [];\n  const inTangents = [];\n  const outTangents = [];\n\n  const length = points.length;\n  for (let i = 0; i < length; i += 3) {\n    inTangents.push(points[i]);\n    cubicPoints.push(points[i + 1]);\n    outTangents.push(points[i + 2]);\n  }\n\n  // Remove the first in-tangent and last out-tangent, since they\n  // are not used in the spline calculations\n  inTangents.splice(0, 1);\n  outTangents.length = outTangents.length - 1;\n\n  return new HermiteSpline({\n    times: times,\n    points: cubicPoints,\n    inTangents: inTangents,\n    outTangents: outTangents,\n  });\n}\n\nfunction createSpline(times, points, interpolation, path) {\n  if (times.length === 1 && points.length === 1) {\n    return new ConstantSpline(points[0]);\n  }\n\n  switch (interpolation) {\n    case InterpolationType.STEP:\n      return new SteppedSpline({\n        times: times,\n        points: points,\n      });\n    case InterpolationType.CUBICSPLINE:\n      return createCubicSpline(times, points);\n    case InterpolationType.LINEAR:\n      if (path === AnimatedPropertyType.ROTATION) {\n        return new QuaternionSpline({\n          times: times,\n          points: points,\n        });\n      }\n      return new LinearSpline({\n        times: times,\n        points: points,\n      });\n  }\n}\n\nfunction createSplines(times, points, interpolation, path, count) {\n  const splines = [];\n  if (path === AnimatedPropertyType.WEIGHTS) {\n    const pointsLength = points.length;\n    // Get the number of keyframes in each weight's output.\n    const outputLength = pointsLength / count;\n\n    // Iterate over the array using the number of morph targets in the model.\n    let targetIndex, i;\n    for (targetIndex = 0; targetIndex < count; targetIndex++) {\n      const output = new Array(outputLength);\n\n      // Weights are ordered such that they are keyframed in the order in which\n      // their targets appear the glTF. For example, the weights of three targets\n      // may appear as [w(0,0), w(0,1), w(0,2), w(1,0), w(1,1), w(1,2) ...],\n      // where i and j in w(i,j) are the time indices and target indices, respectively.\n\n      // However, for morph targets with cubic interpolation, the data is stored per\n      // keyframe in the order [a1, a2, ..., an, v1, v2, ... vn, b1, b2, ..., bn],\n      // where ai, vi, and bi are the in-tangent, property, and out-tangents of\n      // the ith morph target respectively.\n      let pointsIndex = targetIndex;\n      if (interpolation === InterpolationType.CUBICSPLINE) {\n        for (i = 0; i < outputLength; i += 3) {\n          output[i] = points[pointsIndex];\n          output[i + 1] = points[pointsIndex + count];\n          output[i + 2] = points[pointsIndex + 2 * count];\n          pointsIndex += count * 3;\n        }\n      } else {\n        for (i = 0; i < outputLength; i++) {\n          output[i] = points[pointsIndex];\n          pointsIndex += count;\n        }\n      }\n\n      splines.push(createSpline(times, output, interpolation, path));\n    }\n  } else {\n    splines.push(createSpline(times, points, interpolation, path));\n  }\n\n  return splines;\n}\n\nlet scratchVariable;\n\nfunction initialize(runtimeChannel) {\n  const channel = runtimeChannel._channel;\n\n  const sampler = channel.sampler;\n  const times = sampler.input;\n  const points = sampler.output;\n\n  const interpolation = sampler.interpolation;\n  const target = channel.target;\n  const path = target.path;\n\n  const runtimeNode = runtimeChannel._runtimeNode;\n  const count = defined(runtimeNode.morphWeights)\n    ? runtimeNode.morphWeights.length\n    : 1;\n  const splines = createSplines(times, points, interpolation, path, count);\n\n  runtimeChannel._splines = splines;\n  runtimeChannel._path = path;\n\n  switch (path) {\n    case AnimatedPropertyType.TRANSLATION:\n    case AnimatedPropertyType.SCALE:\n      scratchVariable = new Cartesian3();\n      break;\n    case AnimatedPropertyType.ROTATION:\n      scratchVariable = new Quaternion();\n      break;\n    case AnimatedPropertyType.WEIGHTS:\n      // This is unused when setting a node's morph weights.\n      break;\n  }\n}\n\n/**\n * Animates the target node property based on its spline.\n *\n * @param {number} time The local animation time.\n *\n * @private\n */\nModelAnimationChannel.prototype.animate = function (time) {\n  const splines = this._splines;\n  const path = this._path;\n  const model = this._runtimeAnimation.model;\n  const runtimeNode = this._runtimeNode;\n\n  // Weights are handled differently than the other properties because\n  // they need to be updated in place.\n  if (path === AnimatedPropertyType.WEIGHTS) {\n    const morphWeights = runtimeNode.morphWeights;\n    const length = morphWeights.length;\n    for (let i = 0; i < length; i++) {\n      const spline = splines[i];\n      const localAnimationTime = model.clampAnimations\n        ? spline.clampTime(time)\n        : spline.wrapTime(time);\n      morphWeights[i] = spline.evaluate(localAnimationTime);\n    }\n  } else if (runtimeNode.userAnimated) {\n    // If the node is being animated externally, ignore the glTF animation.\n    return;\n  } else {\n    const spline = splines[0];\n    const localAnimationTime = model.clampAnimations\n      ? spline.clampTime(time)\n      : spline.wrapTime(time);\n\n    // This sets the translate, rotate, and scale properties.\n    runtimeNode[path] = spline.evaluate(localAnimationTime, scratchVariable);\n  }\n};\n\nexport default ModelAnimationChannel;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Event from \"../../Core/Event.js\";\nimport JulianDate from \"../../Core/JulianDate.js\";\nimport ModelAnimationLoop from \"../ModelAnimationLoop.js\";\nimport ModelAnimationState from \"../ModelAnimationState.js\";\nimport ModelAnimationChannel from \"./ModelAnimationChannel.js\";\n\n/**\n * <div class=\"notice\">\n * Create animations by calling {@link ModelAnimationCollection#add}. Do not call the constructor directly.\n * </div>\n *\n * An active animation derived from a glTF asset. An active animation is an\n * animation that is either currently playing or scheduled to be played due to\n * being added to a model's {@link ModelAnimationCollection}. An active animation\n * is an instance of an animation; for example, there can be multiple active\n * animations for the same glTF animation, each with a different start time.\n *\n * @alias ModelAnimation\n * @internalConstructor\n * @class\n *\n * @see ModelAnimationCollection#add\n */\nfunction ModelAnimation(model, animation, options) {\n  this._animation = animation;\n  this._name = animation.name;\n  this._runtimeChannels = undefined;\n\n  this._startTime = JulianDate.clone(options.startTime);\n  this._delay = defaultValue(options.delay, 0.0); // in seconds\n  this._stopTime = JulianDate.clone(options.stopTime);\n\n  /**\n   * When <code>true</code>, the animation is removed after it stops playing.\n   * This is slightly more efficient that not removing it, but if, for example,\n   * time is reversed, the animation is not played again.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.removeOnStop = defaultValue(options.removeOnStop, false);\n  this._multiplier = defaultValue(options.multiplier, 1.0);\n  this._reverse = defaultValue(options.reverse, false);\n  this._loop = defaultValue(options.loop, ModelAnimationLoop.NONE);\n  this._animationTime = options.animationTime;\n  this._prevAnimationDelta = undefined;\n\n  /**\n   * The event fired when this animation is started.  This can be used, for\n   * example, to play a sound or start a particle system, when the animation starts.\n   * <p>\n   * This event is fired at the end of the frame after the scene is rendered.\n   * </p>\n   *\n   * @type {Event}\n   * @default new Event()\n   *\n   * @example\n   * animation.start.addEventListener(function(model, animation) {\n   *   console.log(`Animation started: ${animation.name}`);\n   * });\n   */\n  this.start = new Event();\n\n  /**\n   * The event fired when on each frame when this animation is updated.  The\n   * current time of the animation, relative to the glTF animation time span, is\n   * passed to the event, which allows, for example, starting new animations at a\n   * specific time relative to a playing animation.\n   * <p>\n   * This event is fired at the end of the frame after the scene is rendered.\n   * </p>\n   *\n   * @type {Event}\n   * @default new Event()\n   *\n   * @example\n   * animation.update.addEventListener(function(model, animation, time) {\n   *   console.log(`Animation updated: ${animation.name}. glTF animation time: ${time}`);\n   * });\n   */\n  this.update = new Event();\n\n  /**\n   * The event fired when this animation is stopped.  This can be used, for\n   * example, to play a sound or start a particle system, when the animation stops.\n   * <p>\n   * This event is fired at the end of the frame after the scene is rendered.\n   * </p>\n   *\n   * @type {Event}\n   * @default new Event()\n   *\n   * @example\n   * animation.stop.addEventListener(function(model, animation) {\n   *   console.log(`Animation stopped: ${animation.name}`);\n   * });\n   */\n  this.stop = new Event();\n\n  this._state = ModelAnimationState.STOPPED;\n\n  // Set during animation update\n  this._computedStartTime = undefined;\n  this._duration = undefined;\n\n  // To avoid allocations in ModelAnimationCollection.update\n  const that = this;\n  this._raiseStartEvent = function () {\n    that.start.raiseEvent(model, that);\n  };\n  this._updateEventTime = 0.0;\n  this._raiseUpdateEvent = function () {\n    that.update.raiseEvent(model, that, that._updateEventTime);\n  };\n  this._raiseStopEvent = function () {\n    that.stop.raiseEvent(model, that);\n  };\n\n  this._model = model;\n\n  this._localStartTime = undefined;\n  this._localStopTime = undefined;\n\n  initialize(this);\n}\n\nObject.defineProperties(ModelAnimation.prototype, {\n  /**\n   * The glTF animation.\n   *\n   * @memberof ModelAnimation.prototype\n   *\n   * @type {ModelComponents.Animation}\n   * @readonly\n   *\n   * @private\n   */\n  animation: {\n    get: function () {\n      return this._animation;\n    },\n  },\n\n  /**\n   * The name that identifies this animation in the model, if it exists.\n   *\n   * @memberof ModelAnimation.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n\n  /**\n   * The runtime animation channels for this animation.\n   *\n   * @memberof ModelAnimation.prototype\n   *\n   * @type {ModelAnimationChannel[]}\n   * @readonly\n   *\n   * @private\n   */\n  runtimeChannels: {\n    get: function () {\n      return this._runtimeChannels;\n    },\n  },\n\n  /**\n   * The {@link Model} that owns this animation.\n   *\n   * @memberof ModelAnimation.prototype\n   *\n   * @type {Model}\n   * @readonly\n   *\n   * @private\n   */\n  model: {\n    get: function () {\n      return this._model;\n    },\n  },\n\n  /**\n   * The starting point of the animation in local animation time. This is the minimum\n   * time value across all of the keyframes belonging to this animation.\n   *\n   * @memberof ModelAnimation.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  localStartTime: {\n    get: function () {\n      return this._localStartTime;\n    },\n  },\n\n  /**\n   * The stopping point of the animation in local animation time. This is the maximum\n   * time value across all of the keyframes belonging to this animation.\n   *\n   * @memberof ModelAnimation.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  localStopTime: {\n    get: function () {\n      return this._localStopTime;\n    },\n  },\n\n  /**\n   * The scene time to start playing this animation. When this is <code>undefined</code>,\n   * the animation starts at the next frame.\n   *\n   * @memberof ModelAnimation.prototype\n   *\n   * @type {JulianDate}\n   * @readonly\n   *\n   * @default undefined\n   */\n  startTime: {\n    get: function () {\n      return this._startTime;\n    },\n  },\n\n  /**\n   * The delay, in seconds, from {@link ModelAnimation#startTime} to start playing.\n   *\n   * @memberof ModelAnimation.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @default undefined\n   */\n  delay: {\n    get: function () {\n      return this._delay;\n    },\n  },\n\n  /**\n   * The scene time to stop playing this animation. When this is <code>undefined</code>,\n   * the animation is played for its full duration and perhaps repeated depending on\n   * {@link ModelAnimation#loop}.\n   *\n   * @memberof ModelAnimation.prototype\n   *\n   * @type {JulianDate}\n   * @readonly\n   *\n   * @default undefined\n   */\n  stopTime: {\n    get: function () {\n      return this._stopTime;\n    },\n  },\n\n  /**\n   * Values greater than <code>1.0</code> increase the speed that the animation is played relative\n   * to the scene clock speed; values less than <code>1.0</code> decrease the speed.  A value of\n   * <code>1.0</code> plays the animation at the speed in the glTF animation mapped to the scene\n   * clock speed.  For example, if the scene is played at 2x real-time, a two-second glTF animation\n   * will play in one second even if <code>multiplier</code> is <code>1.0</code>.\n   *\n   * @memberof ModelAnimation.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @default 1.0\n   */\n  multiplier: {\n    get: function () {\n      return this._multiplier;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the animation is played in reverse.\n   *\n   * @memberof ModelAnimation.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  reverse: {\n    get: function () {\n      return this._reverse;\n    },\n  },\n\n  /**\n   * Determines if and how the animation is looped.\n   *\n   * @memberof ModelAnimation.prototype\n   *\n   * @type {ModelAnimationLoop}\n   * @readonly\n   *\n   * @default {@link ModelAnimationLoop.NONE}\n   */\n  loop: {\n    get: function () {\n      return this._loop;\n    },\n  },\n\n  /**\n   * If this is defined, it will be used to compute the local animation time\n   * instead of the scene's time.\n   *\n   * @memberof ModelAnimation.prototype\n   *\n   * @type {ModelAnimation.AnimationTimeCallback}\n   * @default undefined\n   */\n  animationTime: {\n    get: function () {\n      return this._animationTime;\n    },\n  },\n});\n\nfunction initialize(runtimeAnimation) {\n  let localStartTime = Number.MAX_VALUE;\n  let localStopTime = -Number.MAX_VALUE;\n\n  const sceneGraph = runtimeAnimation._model.sceneGraph;\n  const animation = runtimeAnimation._animation;\n  const channels = animation.channels;\n  const length = channels.length;\n\n  const runtimeChannels = [];\n  for (let i = 0; i < length; i++) {\n    const channel = channels[i];\n    const target = channel.target;\n\n    // Ignore this channel if the target is invalid, i.e. if the node\n    // it references doesn't exist.\n    if (!defined(target)) {\n      continue;\n    }\n\n    const nodeIndex = target.node.index;\n    const runtimeNode = sceneGraph._runtimeNodes[nodeIndex];\n\n    const runtimeChannel = new ModelAnimationChannel({\n      channel: channel,\n      runtimeAnimation: runtimeAnimation,\n      runtimeNode: runtimeNode,\n    });\n\n    const times = channel.sampler.input;\n    localStartTime = Math.min(localStartTime, times[0]);\n    localStopTime = Math.max(localStopTime, times[times.length - 1]);\n\n    runtimeChannels.push(runtimeChannel);\n  }\n\n  runtimeAnimation._runtimeChannels = runtimeChannels;\n  runtimeAnimation._localStartTime = localStartTime;\n  runtimeAnimation._localStopTime = localStopTime;\n}\n\n/**\n * Evaluate all animation channels to advance this animation.\n *\n * @param {number} time The local animation time.\n *\n * @private\n */\nModelAnimation.prototype.animate = function (time) {\n  const runtimeChannels = this._runtimeChannels;\n  const length = runtimeChannels.length;\n  for (let i = 0; i < length; i++) {\n    runtimeChannels[i].animate(time);\n  }\n};\n\n/**\n * A function used to compute the local animation time for a ModelAnimation.\n * @callback ModelAnimation.AnimationTimeCallback\n *\n * @param {number} duration The animation's original duration in seconds.\n * @param {number} seconds The seconds since the animation started, in scene time.\n * @returns {number} Returns the local animation time.\n *\n * @example\n * // Use real time for model animation (assuming animateWhilePaused was set to true)\n * function animationTime(duration) {\n *     return Date.now() / 1000 / duration;\n * }\n *\n * @example\n * // Offset the phase of the animation, so it starts halfway through its cycle.\n * function animationTime(duration, seconds) {\n *     return seconds / duration + 0.5;\n * }\n */\nexport default ModelAnimation;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Event from \"../../Core/Event.js\";\nimport JulianDate from \"../../Core/JulianDate.js\";\nimport CesiumMath from \"../../Core/Math.js\";\nimport ModelAnimation from \"./ModelAnimation.js\";\nimport ModelAnimationLoop from \".././ModelAnimationLoop.js\";\nimport ModelAnimationState from \".././ModelAnimationState.js\";\n\n/**\n * <div class=\"notice\">\n * Access a model's animations {@link Model#activeAnimations}. Do not call the constructor directly\n * </div>\n *\n * A collection of active model animations.\n *\n * @alias ModelAnimationCollection\n * @internalConstructor\n * @class\n *\n * @see Model#activeAnimations\n */\nfunction ModelAnimationCollection(model) {\n  /**\n   * The event fired when an animation is added to the collection.  This can be used, for\n   * example, to keep a UI in sync.\n   *\n   * @type {Event}\n   * @default new Event()\n   *\n   * @example\n   * model.activeAnimations.animationAdded.addEventListener(function(model, animation) {\n   *   console.log(`Animation added: ${animation.name}`);\n   * });\n   */\n  this.animationAdded = new Event();\n\n  /**\n   * The event fired when an animation is removed from the collection.  This can be used, for\n   * example, to keep a UI in sync.\n   *\n   * @type {Event}\n   * @default new Event()\n   *\n   * @example\n   * model.activeAnimations.animationRemoved.addEventListener(function(model, animation) {\n   *   console.log(`Animation removed: ${animation.name}`);\n   * });\n   */\n  this.animationRemoved = new Event();\n\n  /**\n   * When true, the animation will play even when the scene time is paused. However,\n   * whether animation takes place will depend on the animationTime functions assigned\n   * to the model's animations. By default, this is based on scene time, so models using\n   * the default will not animate regardless of this setting.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.animateWhilePaused = false;\n\n  this._model = model;\n  this._runtimeAnimations = [];\n  this._previousTime = undefined;\n}\n\nObject.defineProperties(ModelAnimationCollection.prototype, {\n  /**\n   * The number of animations in the collection.\n   *\n   * @memberof ModelAnimationCollection.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  length: {\n    get: function () {\n      return this._runtimeAnimations.length;\n    },\n  },\n\n  /**\n   * The model that owns this animation collection.\n   *\n   * @memberof ModelAnimationCollection.prototype\n   *\n   * @type {Model}\n   * @readonly\n   */\n  model: {\n    get: function () {\n      return this._model;\n    },\n  },\n});\n\nfunction addAnimation(collection, animation, options) {\n  const model = collection._model;\n  const runtimeAnimation = new ModelAnimation(model, animation, options);\n  collection._runtimeAnimations.push(runtimeAnimation);\n  collection.animationAdded.raiseEvent(model, runtimeAnimation);\n  return runtimeAnimation;\n}\n\n/**\n * Creates and adds an animation with the specified initial properties to the collection.\n * <p>\n * This raises the {@link ModelAnimationCollection#animationAdded} event so, for example, a UI can stay in sync.\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {string} [options.name] The glTF animation name that identifies the animation. Must be defined if <code>options.index</code> is <code>undefined</code>.\n * @param {number} [options.index] The glTF animation index that identifies the animation. Must be defined if <code>options.name</code> is <code>undefined</code>.\n * @param {JulianDate} [options.startTime] The scene time to start playing the animation.  When this is <code>undefined</code>, the animation starts at the next frame.\n * @param {number} [options.delay=0.0] The delay, in seconds, from <code>startTime</code> to start playing. This will only affect the animation if <code>options.loop</code> is ModelAnimationLoop.NONE.\n * @param {JulianDate} [options.stopTime] The scene time to stop playing the animation.  When this is <code>undefined</code>, the animation is played for its full duration.\n * @param {boolean} [options.removeOnStop=false] When <code>true</code>, the animation is removed after it stops playing. This will only affect the animation if <code>options.loop</code> is ModelAnimationLoop.NONE.\n * @param {number} [options.multiplier=1.0] Values greater than <code>1.0</code> increase the speed that the animation is played relative to the scene clock speed; values less than <code>1.0</code> decrease the speed.\n * @param {boolean} [options.reverse=false] When <code>true</code>, the animation is played in reverse.\n * @param {ModelAnimationLoop} [options.loop=ModelAnimationLoop.NONE] Determines if and how the animation is looped.\n * @param {ModelAnimation.AnimationTimeCallback} [options.animationTime=undefined] If defined, computes the local animation time for this animation.\n * @returns {ModelAnimation} The animation that was added to the collection.\n *\n * @exception {DeveloperError} Animations are not loaded.  Wait for the {@link Model#ready} to return trues.\n * @exception {DeveloperError} options.name must be a valid animation name.\n * @exception {DeveloperError} options.index must be a valid animation index.\n * @exception {DeveloperError} Either options.name or options.index must be defined.\n * @exception {DeveloperError} options.multiplier must be greater than zero.\n *\n * @example\n * // Example 1. Add an animation by name\n * model.activeAnimations.add({\n *   name : 'animation name'\n * });\n *\n * @example\n * // Example 2. Add an animation by index\n * model.activeAnimations.add({\n *   index : 0\n * });\n *\n * @example\n * // Example 3. Add an animation and provide all properties and events\n * const startTime = Cesium.JulianDate.now();\n *\n * const animation = model.activeAnimations.add({\n *   name : 'another animation name',\n *   startTime : startTime,\n *   delay : 0.0,                                 // Play at startTime (default)\n *   stopTime : Cesium.JulianDate.addSeconds(startTime, 4.0, new Cesium.JulianDate()),\n *   removeOnStop : false,                        // Do not remove when animation stops (default)\n *   multiplier : 2.0,                            // Play at double speed\n *   reverse : true,                              // Play in reverse\n *   loop : Cesium.ModelAnimationLoop.REPEAT      // Loop the animation\n * });\n *\n * animation.start.addEventListener(function(model, animation) {\n *   console.log(`Animation started: ${animation.name}`);\n * });\n * animation.update.addEventListener(function(model, animation, time) {\n *   console.log(`Animation updated: ${animation.name}. glTF animation time: ${time}`);\n * });\n * animation.stop.addEventListener(function(model, animation) {\n *   console.log(`Animation stopped: ${animation.name}`);\n * });\n */\nModelAnimationCollection.prototype.add = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const model = this._model;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!model.ready) {\n    throw new DeveloperError(\n      \"Animations are not loaded.  Wait for Model.ready to be true.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const animations = model.sceneGraph.components.animations;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options.name) && !defined(options.index)) {\n    throw new DeveloperError(\n      \"Either options.name or options.index must be defined.\"\n    );\n  }\n\n  if (defined(options.multiplier) && options.multiplier <= 0.0) {\n    throw new DeveloperError(\"options.multiplier must be greater than zero.\");\n  }\n\n  if (\n    defined(options.index) &&\n    (options.index >= animations.length || options.index < 0)\n  ) {\n    throw new DeveloperError(\"options.index must be a valid animation index.\");\n  }\n  //>>includeEnd('debug');\n\n  let index = options.index;\n  if (defined(index)) {\n    return addAnimation(this, animations[index], options);\n  }\n\n  // Find the index of the animation with the given name\n  const length = animations.length;\n  for (let i = 0; i < length; ++i) {\n    if (animations[i].name === options.name) {\n      index = i;\n      break;\n    }\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(index)) {\n    throw new DeveloperError(\"options.name must be a valid animation name.\");\n  }\n  //>>includeEnd('debug');\n\n  return addAnimation(this, animations[index], options);\n};\n\n/**\n * Creates and adds animations with the specified initial properties to the collection\n * for all animations in the model.\n * <p>\n * This raises the {@link ModelAnimationCollection#animationAdded} event for each model so, for example, a UI can stay in sync.\n * </p>\n *\n * @param {object} [options] Object with the following properties:\n * @param {JulianDate} [options.startTime] The scene time to start playing the animations. When this is <code>undefined</code>, the animations starts at the next frame.\n * @param {number} [options.delay=0.0] The delay, in seconds, from <code>startTime</code> to start playing. This will only affect the animation if <code>options.loop</code> is ModelAnimationLoop.NONE.\n * @param {JulianDate} [options.stopTime] The scene time to stop playing the animations. When this is <code>undefined</code>, the animations are played for its full duration.\n * @param {boolean} [options.removeOnStop=false] When <code>true</code>, the animations are removed after they stop playing. This will only affect the animation if <code>options.loop</code> is ModelAnimationLoop.NONE.\n * @param {number} [options.multiplier=1.0] Values greater than <code>1.0</code> increase the speed that the animations play relative to the scene clock speed; values less than <code>1.0</code> decrease the speed.\n * @param {boolean} [options.reverse=false] When <code>true</code>, the animations are played in reverse.\n * @param {ModelAnimationLoop} [options.loop=ModelAnimationLoop.NONE] Determines if and how the animations are looped.\n * @param {ModelAnimation.AnimationTimeCallback} [options.animationTime=undefined] If defined, computes the local animation time for all of the animations.\n * @returns {ModelAnimation[]} An array of {@link ModelAnimation} objects, one for each animation added to the collection.  If there are no glTF animations, the array is empty.\n *\n * @exception {DeveloperError} Animations are not loaded. Wait for the {@link Model#ready} to return true.\n * @exception {DeveloperError} options.multiplier must be greater than zero.\n *\n * @example\n * model.activeAnimations.addAll({\n *   multiplier : 0.5,                            // Play at half-speed\n *   loop : Cesium.ModelAnimationLoop.REPEAT      // Loop the animations\n * });\n */\nModelAnimationCollection.prototype.addAll = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const model = this._model;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!model.ready) {\n    throw new DeveloperError(\n      \"Animations are not loaded.  Wait for Model.ready to be true.\"\n    );\n  }\n\n  if (defined(options.multiplier) && options.multiplier <= 0.0) {\n    throw new DeveloperError(\"options.multiplier must be greater than zero.\");\n  }\n  //>>includeEnd('debug');\n\n  const animations = model.sceneGraph.components.animations;\n\n  const addedAnimations = [];\n  const length = animations.length;\n  for (let i = 0; i < length; ++i) {\n    const animation = addAnimation(this, animations[i], options);\n    addedAnimations.push(animation);\n  }\n  return addedAnimations;\n};\n\n/**\n * Removes an animation from the collection.\n * <p>\n * This raises the {@link ModelAnimationCollection#animationRemoved} event so, for example, a UI can stay in sync.\n * </p>\n * <p>\n * An animation can also be implicitly removed from the collection by setting {@link ModelAnimationCollection#removeOnStop} to\n * <code>true</code>.  The {@link ModelAnimationCollection#animationRemoved} event is still fired when the animation is removed.\n * </p>\n *\n * @param {ModelAnimation} runtimeAnimation The runtime animation to remove.\n * @returns {boolean} <code>true</code> if the animation was removed; <code>false</code> if the animation was not found in the collection.\n *\n * @example\n * const a = model.activeAnimations.add({\n *   name : 'animation name'\n * });\n * model.activeAnimations.remove(a); // Returns true\n */\nModelAnimationCollection.prototype.remove = function (runtimeAnimation) {\n  if (!defined(runtimeAnimation)) {\n    return false;\n  }\n\n  const animations = this._runtimeAnimations;\n  const i = animations.indexOf(runtimeAnimation);\n  if (i !== -1) {\n    animations.splice(i, 1);\n    this.animationRemoved.raiseEvent(this._model, runtimeAnimation);\n    return true;\n  }\n\n  return false;\n};\n\n/**\n * Removes all animations from the collection.\n * <p>\n * This raises the {@link ModelAnimationCollection#animationRemoved} event for each\n * animation so, for example, a UI can stay in sync.\n * </p>\n */\nModelAnimationCollection.prototype.removeAll = function () {\n  const model = this._model;\n  const animations = this._runtimeAnimations;\n  const length = animations.length;\n\n  this._runtimeAnimations.length = 0;\n\n  for (let i = 0; i < length; ++i) {\n    this.animationRemoved.raiseEvent(model, animations[i]);\n  }\n};\n\n/**\n * Determines whether this collection contains a given animation.\n *\n * @param {ModelAnimation} runtimeAnimation The runtime animation to check for.\n * @returns {boolean} <code>true</code> if this collection contains the animation, <code>false</code> otherwise.\n */\nModelAnimationCollection.prototype.contains = function (runtimeAnimation) {\n  if (defined(runtimeAnimation)) {\n    return this._runtimeAnimations.indexOf(runtimeAnimation) !== -1;\n  }\n\n  return false;\n};\n\n/**\n * Returns the animation in the collection at the specified index.  Indices are zero-based\n * and increase as animations are added.  Removing an animation shifts all animations after\n * it to the left, changing their indices.  This function is commonly used to iterate over\n * all the animations in the collection.\n *\n * @param {number} index The zero-based index of the animation.\n * @returns {ModelAnimation} The runtime animation at the specified index.\n *\n * @example\n * // Output the names of all the animations in the collection.\n * const animations = model.activeAnimations;\n * const length = animations.length;\n * for (let i = 0; i < length; ++i) {\n *   console.log(animations.get(i).name);\n * }\n */\nModelAnimationCollection.prototype.get = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(index)) {\n    throw new DeveloperError(\"index is required.\");\n  }\n\n  if (index >= this._runtimeAnimations.length || index < 0) {\n    throw new DeveloperError(\n      \"index must be valid within the range of the collection\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  return this._runtimeAnimations[index];\n};\n\nconst animationsToRemove = [];\n\nfunction createAnimationRemovedFunction(\n  modelAnimationCollection,\n  model,\n  animation\n) {\n  return function () {\n    modelAnimationCollection.animationRemoved.raiseEvent(model, animation);\n  };\n}\n\n/**\n * Updates the runtime animations in this collection, removing any animations\n * that have stopped.\n *\n * @param {FrameState} frameState The current frame state.\n * @returns {boolean} <code>true</code> if an animation played during this update, <code>false</code> otherwise.\n *\n * @private\n */\nModelAnimationCollection.prototype.update = function (frameState) {\n  const runtimeAnimations = this._runtimeAnimations;\n  let length = runtimeAnimations.length;\n\n  if (length === 0) {\n    this._previousTime = undefined;\n    return false;\n  }\n\n  if (\n    !this.animateWhilePaused &&\n    JulianDate.equals(frameState.time, this._previousTime)\n  ) {\n    return false;\n  }\n  this._previousTime = JulianDate.clone(frameState.time, this._previousTime);\n\n  let animationOccurred = false;\n  const sceneTime = frameState.time;\n  const model = this._model;\n\n  for (let i = 0; i < length; ++i) {\n    const runtimeAnimation = runtimeAnimations[i];\n\n    if (!defined(runtimeAnimation._computedStartTime)) {\n      runtimeAnimation._computedStartTime = JulianDate.addSeconds(\n        defaultValue(runtimeAnimation.startTime, sceneTime),\n        runtimeAnimation.delay,\n        new JulianDate()\n      );\n    }\n\n    if (!defined(runtimeAnimation._duration)) {\n      runtimeAnimation._duration =\n        runtimeAnimation.localStopTime * (1.0 / runtimeAnimation.multiplier);\n    }\n\n    const startTime = runtimeAnimation._computedStartTime;\n    const duration = runtimeAnimation._duration;\n    const stopTime = runtimeAnimation.stopTime;\n\n    const pastStartTime = JulianDate.lessThanOrEquals(startTime, sceneTime);\n    const reachedStopTime =\n      defined(stopTime) && JulianDate.greaterThan(sceneTime, stopTime);\n\n    // [0.0, 1.0] normalized local animation time\n    let delta = 0.0;\n    if (duration !== 0.0) {\n      const seconds = JulianDate.secondsDifference(\n        reachedStopTime ? stopTime : sceneTime,\n        startTime\n      );\n      delta = defined(runtimeAnimation._animationTime)\n        ? runtimeAnimation._animationTime(duration, seconds)\n        : seconds / duration;\n    }\n\n    // Play animation if\n    // * we are after the start time or the animation is being repeated, and\n    // * before the end of the animation's duration or the animation is being repeated, and\n    // * we did not reach a user-provided stop time.\n\n    const repeat =\n      runtimeAnimation.loop === ModelAnimationLoop.REPEAT ||\n      runtimeAnimation.loop === ModelAnimationLoop.MIRRORED_REPEAT;\n\n    const play =\n      (pastStartTime || (repeat && !defined(runtimeAnimation.startTime))) &&\n      (delta <= 1.0 || repeat) &&\n      !reachedStopTime;\n\n    if (delta === runtimeAnimation._prevAnimationDelta) {\n      const animationStopped =\n        runtimeAnimation._state === ModelAnimationState.STOPPED;\n      // no change to delta, and no change to the animation state means we can\n      // skip the update this time around.\n      if (play !== animationStopped) {\n        continue;\n      }\n    }\n    runtimeAnimation._prevAnimationDelta = delta;\n\n    // If it IS, or WAS, animating...\n    if (play || runtimeAnimation._state === ModelAnimationState.ANIMATING) {\n      // ...transition from STOPPED to ANIMATING\n      if (play && runtimeAnimation._state === ModelAnimationState.STOPPED) {\n        runtimeAnimation._state = ModelAnimationState.ANIMATING;\n        if (runtimeAnimation.start.numberOfListeners > 0) {\n          frameState.afterRender.push(runtimeAnimation._raiseStartEvent);\n        }\n      }\n\n      // Truncate to [0.0, 1.0] for repeating animations\n      if (runtimeAnimation.loop === ModelAnimationLoop.REPEAT) {\n        delta = delta - Math.floor(delta);\n      } else if (runtimeAnimation.loop === ModelAnimationLoop.MIRRORED_REPEAT) {\n        const floor = Math.floor(delta);\n        const fract = delta - floor;\n        // When odd use (1.0 - fract) to mirror repeat\n        delta = floor % 2 === 1.0 ? 1.0 - fract : fract;\n      }\n\n      if (runtimeAnimation.reverse) {\n        delta = 1.0 - delta;\n      }\n\n      let localAnimationTime = delta * duration * runtimeAnimation.multiplier;\n      // Clamp in case floating-point roundoff goes outside the animation's first or last keyframe\n      localAnimationTime = CesiumMath.clamp(\n        localAnimationTime,\n        runtimeAnimation.localStartTime,\n        runtimeAnimation.localStopTime\n      );\n\n      runtimeAnimation.animate(localAnimationTime);\n\n      if (runtimeAnimation.update.numberOfListeners > 0) {\n        runtimeAnimation._updateEventTime = localAnimationTime;\n        frameState.afterRender.push(runtimeAnimation._raiseUpdateEvent);\n      }\n      animationOccurred = true;\n\n      if (!play) {\n        // transition from ANIMATING to STOPPED\n        runtimeAnimation._state = ModelAnimationState.STOPPED;\n        if (runtimeAnimation.stop.numberOfListeners > 0) {\n          frameState.afterRender.push(runtimeAnimation._raiseStopEvent);\n        }\n\n        if (runtimeAnimation.removeOnStop) {\n          animationsToRemove.push(runtimeAnimation);\n        }\n      }\n    }\n  }\n\n  // Remove animations that stopped\n  length = animationsToRemove.length;\n  for (let j = 0; j < length; ++j) {\n    const animationToRemove = animationsToRemove[j];\n    runtimeAnimations.splice(runtimeAnimations.indexOf(animationToRemove), 1);\n    frameState.afterRender.push(\n      createAnimationRemovedFunction(this, model, animationToRemove)\n    );\n  }\n  animationsToRemove.length = 0;\n\n  return animationOccurred;\n};\n\nexport default ModelAnimationCollection;\n", "import Color from \"../../Core/Color.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * A feature of a {@link Model}.\n * <p>\n * Provides access to a feature's properties stored in the model's feature table.\n * </p>\n * <p>\n * Modifications to a <code>ModelFeature</code> object have the lifetime of the model.\n * </p>\n * <p>\n * Do not construct this directly. Access it through picking using {@link Scene#pick}.\n * </p>\n *\n * @alias ModelFeature\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Model} options.model The model the feature belongs to.\n * @param {number} options.featureId The unique integral identifier for this feature.\n *\n * @example\n * // On mouse over, display all the properties for a feature in the console log.\n * handler.setInputAction(function(movement) {\n *     const feature = scene.pick(movement.endPosition);\n *     if (feature instanceof Cesium.ModelFeature) {\n *         console.log(feature);\n *     }\n * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);\n *\n */\nfunction ModelFeature(options) {\n  this._model = options.model;\n\n  // This ModelFeatureTable is not documented as an option since it is\n  // part of the private API and should not appear in the documentation.\n  this._featureTable = options.featureTable;\n\n  this._featureId = options.featureId;\n  this._color = undefined; // for calling getColor\n}\n\nObject.defineProperties(ModelFeature.prototype, {\n  /**\n   * Gets or sets if the feature will be shown. This is set for all features\n   * when a style's show is evaluated.\n   *\n   * @memberof ModelFeature.prototype\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  show: {\n    get: function () {\n      return this._featureTable.getShow(this._featureId);\n    },\n    set: function (value) {\n      this._featureTable.setShow(this._featureId, value);\n    },\n  },\n\n  /**\n   * Gets or sets the highlight color multiplied with the feature's color.  When\n   * this is white, the feature's color is not changed. This is set for all features\n   * when a style's color is evaluated.\n   *\n   * @memberof ModelFeature.prototype\n   *\n   * @type {Color}\n   *\n   * @default {@link Color.WHITE}\n   */\n  color: {\n    get: function () {\n      if (!defined(this._color)) {\n        this._color = new Color();\n      }\n      return this._featureTable.getColor(this._featureId, this._color);\n    },\n    set: function (value) {\n      this._featureTable.setColor(this._featureId, value);\n    },\n  },\n  /**\n   * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns\n   * the model containing the feature.\n   *\n   * @memberof ModelFeature.prototype\n   *\n   * @type {Model}\n   *\n   * @readonly\n   * @private\n   */\n  primitive: {\n    get: function () {\n      return this._model;\n    },\n  },\n\n  /**\n   *  The {@link ModelFeatureTable} that this feature belongs to.\n   *\n   * @memberof ModelFeature.prototype\n   *\n   * @type {ModelFeatureTable}\n   *\n   * @readonly\n   * @private\n   */\n  featureTable: {\n    get: function () {\n      return this._featureTable;\n    },\n  },\n\n  /**\n   * Get the feature ID associated with this feature. For 3D Tiles 1.0, the\n   * batch ID is returned. For EXT_mesh_features, this is the feature ID from\n   * the selected feature ID set.\n   *\n   * @memberof ModelFeature.prototype\n   *\n   * @type {number}\n   *\n   * @readonly\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  featureId: {\n    get: function () {\n      return this._featureId;\n    },\n  },\n});\n\n/**\n * Returns whether the feature contains this property.\n *\n * @param {string} name The case-sensitive name of the property.\n * @returns {boolean} Whether the feature contains this property.\n */\nModelFeature.prototype.hasProperty = function (name) {\n  return this._featureTable.hasProperty(this._featureId, name);\n};\n\n/**\n * Returns a copy of the value of the feature's property with the given name.\n *\n * @param {string} name The case-sensitive name of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n *\n * @example\n * // Display all the properties for a feature in the console log.\n * const propertyIds = feature.getPropertyIds();\n * const length = propertyIds.length;\n * for (let i = 0; i < length; ++i) {\n *     const propertyId = propertyIds[i];\n *     console.log(propertyId + ': ' + feature.getProperty(propertyId));\n * }\n */\nModelFeature.prototype.getProperty = function (name) {\n  return this._featureTable.getProperty(this._featureId, name);\n};\n\n/**\n * Returns a copy of the feature's property with the given name, examining all\n * the metadata from the EXT_structural_metadata and legacy EXT_feature_metadata glTF\n * extensions. Metadata is checked against name from most specific to most\n * general and the first match is returned. Metadata is checked in this order:\n * <ol>\n *   <li>structural metadata property by semantic</li>\n *   <li>structural metadata property by property ID</li>\n * </ol>\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension} as well as the\n * previous {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} for glTF.\n * </p>\n *\n * @param {string} name The semantic or property ID of the feature. Semantics are checked before property IDs in each granularity of metadata.\n * @return {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nModelFeature.prototype.getPropertyInherited = function (name) {\n  if (this._featureTable.hasPropertyBySemantic(this._featureId, name)) {\n    return this._featureTable.getPropertyBySemantic(this._featureId, name);\n  }\n\n  return this._featureTable.getProperty(this._featureId, name);\n};\n\n/**\n * Returns an array of property IDs for the feature.\n *\n * @param {string[]} [results] An array into which to store the results.\n * @returns {string[]} The IDs of the feature's properties.\n */\nModelFeature.prototype.getPropertyIds = function (results) {\n  return this._featureTable.getPropertyIds(results);\n};\n\n/**\n * Sets the value of the feature's property with the given name.\n *\n * @param {string} name The case-sensitive name of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n *\n * @exception {DeveloperError} Inherited batch table hierarchy property is read only.\n *\n * @example\n * const height = feature.getProperty('Height'); // e.g., the height of a building\n *\n * @example\n * const name = 'clicked';\n * if (feature.getProperty(name)) {\n *     console.log('already clicked');\n * } else {\n *     feature.setProperty(name, true);\n *     console.log('first click');\n * }\n */\nModelFeature.prototype.setProperty = function (name, value) {\n  return this._featureTable.setProperty(this._featureId, name, value);\n};\n\nexport default ModelFeature;\n", "/**\n * An enum describing what commands (opaque or translucent) are required by\n * a {@link Cesium3DTileStyle}.\n *\n * @enum {number}\n * @private\n */\nconst StyleCommandsNeeded = {\n  ALL_OPAQUE: 0,\n  ALL_TRANSLUCENT: 1,\n  OPAQUE_AND_TRANSLUCENT: 2,\n};\n\n/**\n * @private\n */\nStyleCommandsNeeded.getStyleCommandsNeeded = function (\n  featuresLength,\n  translucentFeaturesLength\n) {\n  if (translucentFeaturesLength === 0) {\n    return StyleCommandsNeeded.ALL_OPAQUE;\n  } else if (translucentFeaturesLength === featuresLength) {\n    return StyleCommandsNeeded.ALL_TRANSLUCENT;\n  }\n  return StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT;\n};\n\nexport default Object.freeze(StyleCommandsNeeded);\n", "import Check from \"../../Core/Check.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\n\n/**\n * An enum to distinguish the different uses for {@link Model},\n * which include individual glTF models, and various 3D Tiles formats\n * (including glTF via <code>3DTILES_content_gltf</code>).\n *\n * @enum {string}\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst ModelType = {\n  /**\n   * An individual glTF model.\n   * <p>\n   * Not to be confused with {@link ModelType.TILE_GLTF}\n   * which is for 3D Tiles\n   * </p>\n   *\n   * @type {string}\n   * @constant\n   */\n  GLTF: \"GLTF\",\n  /**\n   * A glTF model used as tile content in a 3D Tileset via\n   * <code>3DTILES_content_gltf</code>.\n   * <p>\n   * Not to be confused with {@link ModelType.GLTF}\n   * which is for individual models\n   * </p>\n   *\n   * @type {string}\n   * @constant\n   */\n  TILE_GLTF: \"TILE_GLTF\",\n  /**\n   * A 3D Tiles 1.0 Batched 3D Model\n   *\n   * @type {string}\n   * @constant\n   */\n  TILE_B3DM: \"B3DM\",\n  /**\n   * A 3D Tiles 1.0 Instanced 3D Model\n   *\n   * @type {string}\n   * @constant\n   */\n  TILE_I3DM: \"I3DM\",\n  /**\n   * A 3D Tiles 1.0 Point Cloud\n   *\n   * @type {string}\n   * @constant\n   */\n  TILE_PNTS: \"PNTS\",\n\n  /**\n   * GeoJSON content for <code>MAXAR_content_geojson</code> extension\n   *\n   * @type {string}\n   * @constant\n   */\n  TILE_GEOJSON: \"TILE_GEOJSON\",\n};\n\n/**\n * Check if a model is used for 3D Tiles.\n * @param {ModelType} modelType The type of model\n * @returns {boolean} <code>true</code> if the model is a 3D Tiles format, <code>false</code> otherwise\n */\nModelType.is3DTiles = function (modelType) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"modelType\", modelType);\n  //>>includeEnd('debug');\n\n  switch (modelType) {\n    case ModelType.TILE_GLTF:\n    case ModelType.TILE_B3DM:\n    case ModelType.TILE_I3DM:\n    case ModelType.TILE_PNTS:\n    case ModelType.TILE_GEOJSON:\n      return true;\n    case ModelType.GLTF:\n      return false;\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\"modelType is not a valid value.\");\n    //>>includeEnd('debug');\n  }\n};\n\nexport default Object.freeze(ModelType);\n", "import BatchTexture from \"../BatchTexture.js\";\nimport Cesium3DTileFeature from \"../Cesium3DTileFeature.js\";\nimport Check from \"../../Core/Check.js\";\nimport Color from \"../../Core/Color.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport ModelFeature from \"./ModelFeature.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport StyleCommandsNeeded from \"./StyleCommandsNeeded.js\";\nimport ModelType from \"./ModelType.js\";\n\n/**\n * Manages the {@link ModelFeature}s in a {@link Model}.\n * Extracts the properties from a {@link PropertyTable}.\n *\n * @param {object} options An object containing the following options:\n * @param {Model} options.model The model that owns this feature table.\n * @param {PropertyTable} options.propertyTable The property table from the model used to initialize the model.\n *\n * @alias ModelFeatureTable\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ModelFeatureTable(options) {\n  const model = options.model;\n  const propertyTable = options.propertyTable;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"propertyTable\", propertyTable);\n  Check.typeOf.object(\"model\", model);\n  //>>includeEnd('debug');\n\n  this._propertyTable = propertyTable;\n  this._model = model;\n\n  this._features = undefined;\n  this._featuresLength = 0;\n\n  this._batchTexture = undefined;\n\n  this._styleCommandsNeededDirty = false;\n  this._styleCommandsNeeded = StyleCommandsNeeded.ALL_OPAQUE;\n\n  initialize(this);\n}\n\nObject.defineProperties(ModelFeatureTable.prototype, {\n  /**\n   * The batch texture created for the features in this table.\n   *\n   * @memberof ModelFeatureTable.prototype\n   *\n   * @type {BatchTexture}\n   * @readonly\n   *\n   * @private\n   */\n  batchTexture: {\n    get: function () {\n      return this._batchTexture;\n    },\n  },\n\n  /**\n   * The number of features in this table.\n   *\n   * @memberof ModelFeatureTable.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  featuresLength: {\n    get: function () {\n      return this._featuresLength;\n    },\n  },\n\n  /**\n   * Size of the batch texture. This does not count the property table size\n   * as that is counted separately through StructuralMetadata.\n   *\n   * @memberof ModelFeatureTable.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  batchTextureByteLength: {\n    get: function () {\n      if (defined(this._batchTexture)) {\n        return this._batchTexture.byteLength;\n      }\n\n      return 0;\n    },\n  },\n\n  /**\n   * A flag to indicate whether or not the types of style commands needed by this feature table have changed.\n   *\n   * @memberof ModelFeatureTable.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  styleCommandsNeededDirty: {\n    get: function () {\n      return this._styleCommandsNeededDirty;\n    },\n  },\n});\n\nfunction initialize(modelFeatureTable) {\n  const model = modelFeatureTable._model;\n  const is3DTiles = ModelType.is3DTiles(model.type);\n\n  const featuresLength = modelFeatureTable._propertyTable.count;\n  if (featuresLength === 0) {\n    return;\n  }\n\n  let i;\n  const features = new Array(featuresLength);\n  if (is3DTiles) {\n    const content = model.content;\n    for (i = 0; i < featuresLength; i++) {\n      features[i] = new Cesium3DTileFeature(content, i);\n    }\n  } else {\n    for (i = 0; i < featuresLength; i++) {\n      features[i] = new ModelFeature({\n        model: model,\n        featureId: i,\n        featureTable: modelFeatureTable,\n      });\n    }\n  }\n\n  modelFeatureTable._features = features;\n  modelFeatureTable._featuresLength = featuresLength;\n\n  modelFeatureTable._batchTexture = new BatchTexture({\n    featuresLength: featuresLength,\n    owner: modelFeatureTable,\n    statistics: is3DTiles ? model.content.tileset.statistics : undefined,\n  });\n}\n\n/**\n * Creates/updates the batch texture.\n *\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nModelFeatureTable.prototype.update = function (frameState) {\n  // Assume the number of translucent features has not changed.\n  this._styleCommandsNeededDirty = false;\n  this._batchTexture.update(undefined, frameState);\n\n  const currentStyleCommandsNeeded = StyleCommandsNeeded.getStyleCommandsNeeded(\n    this._featuresLength,\n    this._batchTexture.translucentFeaturesLength\n  );\n\n  if (this._styleCommandsNeeded !== currentStyleCommandsNeeded) {\n    this._styleCommandsNeededDirty = true;\n    this._styleCommandsNeeded = currentStyleCommandsNeeded;\n  }\n};\n\nModelFeatureTable.prototype.setShow = function (featureId, show) {\n  this._batchTexture.setShow(featureId, show);\n};\n\nModelFeatureTable.prototype.setAllShow = function (show) {\n  this._batchTexture.setAllShow(show);\n};\n\nModelFeatureTable.prototype.getShow = function (featureId) {\n  return this._batchTexture.getShow(featureId);\n};\n\nModelFeatureTable.prototype.setColor = function (featureId, color) {\n  this._batchTexture.setColor(featureId, color);\n};\n\nModelFeatureTable.prototype.setAllColor = function (color) {\n  this._batchTexture.setAllColor(color);\n};\n\nModelFeatureTable.prototype.getColor = function (featureId, result) {\n  return this._batchTexture.getColor(featureId, result);\n};\n\nModelFeatureTable.prototype.getPickColor = function (featureId) {\n  return this._batchTexture.getPickColor(featureId);\n};\n\nModelFeatureTable.prototype.getFeature = function (featureId) {\n  return this._features[featureId];\n};\n\nModelFeatureTable.prototype.hasProperty = function (featureId, propertyName) {\n  return this._propertyTable.hasProperty(featureId, propertyName);\n};\n\nModelFeatureTable.prototype.hasPropertyBySemantic = function (\n  featureId,\n  propertyName\n) {\n  return this._propertyTable.hasPropertyBySemantic(featureId, propertyName);\n};\n\nModelFeatureTable.prototype.getProperty = function (featureId, name) {\n  return this._propertyTable.getProperty(featureId, name);\n};\n\nModelFeatureTable.prototype.getPropertyBySemantic = function (\n  featureId,\n  semantic\n) {\n  return this._propertyTable.getPropertyBySemantic(featureId, semantic);\n};\n\nModelFeatureTable.prototype.getPropertyIds = function (results) {\n  return this._propertyTable.getPropertyIds(results);\n};\n\nModelFeatureTable.prototype.setProperty = function (featureId, name, value) {\n  return this._propertyTable.setProperty(featureId, name, value);\n};\n\nModelFeatureTable.prototype.isClass = function (featureId, className) {\n  return this._propertyTable.isClass(featureId, className);\n};\n\nModelFeatureTable.prototype.isExactClass = function (featureId, className) {\n  return this._propertyTable.isExactClass(featureId, className);\n};\n\nModelFeatureTable.prototype.getExactClassName = function (featureId) {\n  return this._propertyTable.getExactClassName(featureId);\n};\n\nconst scratchColor = new Color();\n/**\n * @private\n */\nModelFeatureTable.prototype.applyStyle = function (style) {\n  if (!defined(style)) {\n    this.setAllColor(BatchTexture.DEFAULT_COLOR_VALUE);\n    this.setAllShow(BatchTexture.DEFAULT_SHOW_VALUE);\n    return;\n  }\n\n  for (let i = 0; i < this._featuresLength; i++) {\n    const feature = this.getFeature(i);\n    const color = defined(style.color)\n      ? defaultValue(\n          style.color.evaluateColor(feature, scratchColor),\n          BatchTexture.DEFAULT_COLOR_VALUE\n        )\n      : BatchTexture.DEFAULT_COLOR_VALUE;\n    const show = defined(style.show)\n      ? defaultValue(\n          style.show.evaluate(feature),\n          BatchTexture.DEFAULT_SHOW_VALUE\n        )\n      : BatchTexture.DEFAULT_SHOW_VALUE;\n\n    this.setColor(i, color);\n    this.setShow(i, show);\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see ModelFeatureTable#destroy\n * @private\n */\nModelFeatureTable.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * e = e && e.destroy();\n *\n * @see ModelFeatureTable#isDestroyed\n * @private\n */\nModelFeatureTable.prototype.destroy = function (frameState) {\n  this._batchTexture = this._batchTexture && this._batchTexture.destroy();\n  destroyObject(this);\n};\n\nexport default ModelFeatureTable;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"czm_modelMaterial defaultModelMaterial()\\n\\\n{\\n\\\n    czm_modelMaterial material;\\n\\\n    material.diffuse = vec3(0.0);\\n\\\n    material.specular = vec3(1.0);\\n\\\n    material.roughness = 1.0;\\n\\\n    material.occlusion = 1.0;\\n\\\n    material.normalEC = vec3(0.0, 0.0, 1.0);\\n\\\n    material.emissive = vec3(0.0);\\n\\\n    material.alpha = 1.0;\\n\\\n    return material;\\n\\\n}\\n\\\n\\n\\\nvec4 handleAlpha(vec3 color, float alpha)\\n\\\n{\\n\\\n    #ifdef ALPHA_MODE_MASK\\n\\\n    if (alpha < u_alphaCutoff) {\\n\\\n        discard;\\n\\\n    }\\n\\\n    #endif\\n\\\n\\n\\\n    return vec4(color, alpha);\\n\\\n}\\n\\\n\\n\\\nSelectedFeature selectedFeature;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    #ifdef HAS_MODEL_SPLITTER\\n\\\n    modelSplitterStage();\\n\\\n    #endif\\n\\\n\\n\\\n    czm_modelMaterial material = defaultModelMaterial();\\n\\\n\\n\\\n    ProcessedAttributes attributes;\\n\\\n    geometryStage(attributes);\\n\\\n\\n\\\n    FeatureIds featureIds;\\n\\\n    featureIdStage(featureIds, attributes);\\n\\\n\\n\\\n    Metadata metadata;\\n\\\n    MetadataClass metadataClass;\\n\\\n    MetadataStatistics metadataStatistics;\\n\\\n    metadataStage(metadata, metadataClass, metadataStatistics, attributes);\\n\\\n\\n\\\n    #ifdef HAS_SELECTED_FEATURE_ID\\n\\\n    selectedFeatureIdStage(selectedFeature, featureIds);\\n\\\n    #endif\\n\\\n\\n\\\n    #ifndef CUSTOM_SHADER_REPLACE_MATERIAL\\n\\\n    materialStage(material, attributes, selectedFeature);\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_CUSTOM_FRAGMENT_SHADER\\n\\\n    customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics);\\n\\\n    #endif\\n\\\n\\n\\\n    lightingStage(material, attributes);\\n\\\n\\n\\\n    #ifdef HAS_SELECTED_FEATURE_ID\\n\\\n    cpuStylingStage(material, selectedFeature);\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_MODEL_COLOR\\n\\\n    modelColorStage(material);\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_PRIMITIVE_OUTLINE\\n\\\n    primitiveOutlineStage(material);\\n\\\n    #endif\\n\\\n\\n\\\n    vec4 color = handleAlpha(material.diffuse, material.alpha);\\n\\\n\\n\\\n    #ifdef HAS_CLIPPING_PLANES\\n\\\n    modelClippingPlanesStage(color);\\n\\\n    #endif\\n\\\n\\n\\\n    #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)\\n\\\n    silhouetteStage(color);\\n\\\n    #endif\\n\\\n\\n\\\n    out_FragColor = color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"precision highp float;\\n\\\n\\n\\\nczm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {\\n\\\n    czm_modelVertexOutput vsOutput;\\n\\\n    vsOutput.positionMC = positionMC;\\n\\\n    vsOutput.pointSize = 1.0;\\n\\\n    return vsOutput;\\n\\\n}\\n\\\n\\n\\\nvoid main() \\n\\\n{\\n\\\n    // Initialize the attributes struct with all\\n\\\n    // attributes except quantized ones.\\n\\\n    ProcessedAttributes attributes;\\n\\\n    initializeAttributes(attributes);\\n\\\n\\n\\\n    // Dequantize the quantized ones and add them to the\\n\\\n    // attributes struct.\\n\\\n    #ifdef USE_DEQUANTIZATION\\n\\\n    dequantizationStage(attributes);\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_MORPH_TARGETS\\n\\\n    morphTargetsStage(attributes);\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_SKINNING\\n\\\n    skinningStage(attributes);\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_PRIMITIVE_OUTLINE\\n\\\n    primitiveOutlineStage();\\n\\\n    #endif\\n\\\n\\n\\\n    // Compute the bitangent according to the formula in the glTF spec.\\n\\\n    // Normal and tangents can be affected by morphing and skinning, so\\n\\\n    // the bitangent should not be computed until their values are finalized.\\n\\\n    #ifdef HAS_BITANGENTS\\n\\\n    attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);\\n\\\n    #endif\\n\\\n\\n\\\n    FeatureIds featureIds;\\n\\\n    featureIdStage(featureIds, attributes);\\n\\\n\\n\\\n    #ifdef HAS_SELECTED_FEATURE_ID\\n\\\n    SelectedFeature feature;\\n\\\n    selectedFeatureIdStage(feature, featureIds);\\n\\\n    // Handle any show properties that come from the style.\\n\\\n    cpuStylingStage(attributes.positionMC, feature);\\n\\\n    #endif\\n\\\n\\n\\\n    #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)\\n\\\n    // The scene mode 2D pipeline stage and instancing stage add a different\\n\\\n    // model view matrix to accurately project the model to 2D. However, the\\n\\\n    // output positions and normals should be transformed by the 3D matrices\\n\\\n    // to keep the data the same for the fragment shader.\\n\\\n    mat4 modelView = czm_modelView3D;\\n\\\n    mat3 normal = czm_normal3D;\\n\\\n    #else\\n\\\n    // These are used for individual model projection because they will\\n\\\n    // automatically change based on the scene mode.\\n\\\n    mat4 modelView = czm_modelView;\\n\\\n    mat3 normal = czm_normal;\\n\\\n    #endif\\n\\\n\\n\\\n    // Update the position for this instance in place\\n\\\n    #ifdef HAS_INSTANCING\\n\\\n\\n\\\n        // The legacy instance stage is used when rendering i3dm models that \\n\\\n        // encode instances transforms in world space, as opposed to glTF models\\n\\\n        // that use EXT_mesh_gpu_instancing, where instance transforms are encoded\\n\\\n        // in object space.\\n\\\n        #ifdef USE_LEGACY_INSTANCING\\n\\\n        mat4 instanceModelView;\\n\\\n        mat3 instanceModelViewInverseTranspose;\\n\\\n        \\n\\\n        legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);\\n\\\n\\n\\\n        modelView = instanceModelView;\\n\\\n        normal = instanceModelViewInverseTranspose;\\n\\\n        #else\\n\\\n        instancingStage(attributes);\\n\\\n        #endif\\n\\\n\\n\\\n        #ifdef USE_PICKING\\n\\\n        v_pickColor = a_pickColor;\\n\\\n        #endif\\n\\\n\\n\\\n    #endif\\n\\\n\\n\\\n    Metadata metadata;\\n\\\n    MetadataClass metadataClass;\\n\\\n    MetadataStatistics metadataStatistics;\\n\\\n    metadataStage(metadata, metadataClass, metadataStatistics, attributes);\\n\\\n\\n\\\n    #ifdef HAS_VERTICAL_EXAGGERATION\\n\\\n    verticalExaggerationStage(attributes);\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_CUSTOM_VERTEX_SHADER\\n\\\n    czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);\\n\\\n    customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics);\\n\\\n    #endif\\n\\\n\\n\\\n    // Compute the final position in each coordinate system needed.\\n\\\n    // This returns the value that will be assigned to gl_Position.\\n\\\n    vec4 positionClip = geometryStage(attributes, modelView, normal);    \\n\\\n\\n\\\n    #ifdef HAS_SILHOUETTE\\n\\\n    silhouetteStage(attributes, positionClip);\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_POINT_CLOUD_SHOW_STYLE\\n\\\n    float show = pointCloudShowStylingStage(attributes, metadata);\\n\\\n    #else\\n\\\n    float show = 1.0;\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING\\n\\\n    show *= pointCloudBackFaceCullingStage();\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_POINT_CLOUD_COLOR_STYLE\\n\\\n    v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef PRIMITIVE_TYPE_POINTS\\n\\\n        #ifdef HAS_CUSTOM_VERTEX_SHADER\\n\\\n        gl_PointSize = vsOutput.pointSize;\\n\\\n        #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)\\n\\\n        gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);\\n\\\n        #else\\n\\\n        gl_PointSize = 1.0;\\n\\\n        #endif\\n\\\n\\n\\\n        gl_PointSize *= show;\\n\\\n    #endif\\n\\\n\\n\\\n    gl_Position = show * positionClip;\\n\\\n}\\n\\\n\";\n", "import BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport DrawCommand from \"../../Renderer/DrawCommand.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport RenderState from \"../../Renderer/RenderState.js\";\nimport BlendingState from \"../BlendingState.js\";\nimport ClassificationType from \"../ClassificationType.js\";\nimport DepthFunction from \"../DepthFunction.js\";\nimport StencilConstants from \"../StencilConstants.js\";\nimport StencilFunction from \"../StencilFunction.js\";\nimport StencilOperation from \"../StencilOperation.js\";\n\n/**\n * A wrapper around the draw commands used to render a classification model,\n * i.e. a {@link Model} that classifies another asset. This manages the\n * derived commands and returns only the necessary commands depending on the\n * given frame state.\n *\n * @param {object} options An object containing the following options:\n * @param {DrawCommand} options.command The draw command from which to derive other commands from.\n * @param {PrimitiveRenderResources} options.primitiveRenderResources The render resources of the primitive associated with the command.\n *\n * @alias ClassificationModelDrawCommand\n * @constructor\n *\n * @private\n */\nfunction ClassificationModelDrawCommand(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const command = options.command;\n  const renderResources = options.primitiveRenderResources;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.command\", command);\n  Check.typeOf.object(\"options.primitiveRenderResources\", renderResources);\n  //>>includeEnd('debug');\n\n  const model = renderResources.model;\n\n  this._command = command;\n  this._model = model;\n  this._runtimePrimitive = renderResources.runtimePrimitive;\n\n  // Classification models aren't supported in 2D mode, so there's no need to\n  // duplicate the model matrix for each derived command.\n  this._modelMatrix = command.modelMatrix;\n  this._boundingVolume = command.boundingVolume;\n  this._cullFace = command.renderState.cull.face;\n\n  const type = model.classificationType;\n  this._classificationType = type;\n\n  // ClassificationType has three values: terrain only, 3D Tiles only, or both.\n  this._classifiesTerrain = type !== ClassificationType.CESIUM_3D_TILE;\n  this._classifies3DTiles = type !== ClassificationType.TERRAIN;\n\n  this._useDebugWireframe = model._enableDebugWireframe && model.debugWireframe;\n  this._pickId = renderResources.pickId;\n\n  this._commandListTerrain = [];\n  this._commandList3DTiles = [];\n  this._commandListIgnoreShow = []; // Used for inverted classification.\n  this._commandListDebugWireframe = [];\n\n  this._commandListTerrainPicking = [];\n  this._commandList3DTilesPicking = [];\n\n  initialize(this);\n}\n\nfunction getStencilDepthRenderState(stencilFunction) {\n  return {\n    colorMask: {\n      red: false,\n      green: false,\n      blue: false,\n      alpha: false,\n    },\n    stencilTest: {\n      enabled: true,\n      frontFunction: stencilFunction,\n      frontOperation: {\n        fail: StencilOperation.KEEP,\n        zFail: StencilOperation.DECREMENT_WRAP,\n        zPass: StencilOperation.KEEP,\n      },\n      backFunction: stencilFunction,\n      backOperation: {\n        fail: StencilOperation.KEEP,\n        zFail: StencilOperation.INCREMENT_WRAP,\n        zPass: StencilOperation.KEEP,\n      },\n      reference: StencilConstants.CESIUM_3D_TILE_MASK,\n      mask: StencilConstants.CESIUM_3D_TILE_MASK,\n    },\n    stencilMask: StencilConstants.CLASSIFICATION_MASK,\n    depthTest: {\n      enabled: true,\n      func: DepthFunction.LESS_OR_EQUAL,\n    },\n    depthMask: false,\n  };\n}\n\nconst colorRenderState = {\n  stencilTest: {\n    enabled: true,\n    frontFunction: StencilFunction.NOT_EQUAL,\n    frontOperation: {\n      fail: StencilOperation.ZERO,\n      zFail: StencilOperation.ZERO,\n      zPass: StencilOperation.ZERO,\n    },\n    backFunction: StencilFunction.NOT_EQUAL,\n    backOperation: {\n      fail: StencilOperation.ZERO,\n      zFail: StencilOperation.ZERO,\n      zPass: StencilOperation.ZERO,\n    },\n    reference: 0,\n    mask: StencilConstants.CLASSIFICATION_MASK,\n  },\n  stencilMask: StencilConstants.CLASSIFICATION_MASK,\n  depthTest: {\n    enabled: false,\n  },\n  depthMask: false,\n  blending: BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,\n};\n\nconst pickRenderState = {\n  stencilTest: {\n    enabled: true,\n    frontFunction: StencilFunction.NOT_EQUAL,\n    frontOperation: {\n      fail: StencilOperation.ZERO,\n      zFail: StencilOperation.ZERO,\n      zPass: StencilOperation.ZERO,\n    },\n    backFunction: StencilFunction.NOT_EQUAL,\n    backOperation: {\n      fail: StencilOperation.ZERO,\n      zFail: StencilOperation.ZERO,\n      zPass: StencilOperation.ZERO,\n    },\n    reference: 0,\n    mask: StencilConstants.CLASSIFICATION_MASK,\n  },\n  stencilMask: StencilConstants.CLASSIFICATION_MASK,\n  depthTest: {\n    enabled: false,\n  },\n  depthMask: false,\n};\n\nconst scratchDerivedCommands = [];\n\nfunction initialize(drawCommand) {\n  const command = drawCommand._command;\n  const derivedCommands = scratchDerivedCommands;\n\n  // If debug wireframe is enabled, don't derive any new commands.\n  // Render normally in the opaque pass.\n  if (drawCommand._useDebugWireframe) {\n    command.pass = Pass.OPAQUE;\n\n    derivedCommands.length = 0;\n    derivedCommands.push(command);\n\n    drawCommand._commandListDebugWireframe = createBatchCommands(\n      drawCommand,\n      derivedCommands,\n      drawCommand._commandListDebugWireframe\n    );\n\n    const commandList = drawCommand._commandListDebugWireframe;\n    const length = commandList.length;\n    for (let i = 0; i < length; i++) {\n      // The lengths / offsets of the batches have to be adjusted for wireframe.\n      // Only PrimitiveType.TRIANGLES is allowed for classification, so this\n      // just requires doubling the values for the batches.\n      const command = commandList[i];\n      command.count *= 2;\n      command.offset *= 2;\n    }\n\n    return;\n  }\n\n  const model = drawCommand.model;\n  const allowPicking = model.allowPicking;\n\n  if (drawCommand._classifiesTerrain) {\n    const pass = Pass.TERRAIN_CLASSIFICATION;\n    const stencilDepthCommand = deriveStencilDepthCommand(command, pass);\n    const colorCommand = deriveColorCommand(command, pass);\n\n    derivedCommands.length = 0;\n    derivedCommands.push(stencilDepthCommand, colorCommand);\n\n    drawCommand._commandListTerrain = createBatchCommands(\n      drawCommand,\n      derivedCommands,\n      drawCommand._commandListTerrain\n    );\n\n    if (allowPicking) {\n      drawCommand._commandListTerrainPicking = createPickCommands(\n        drawCommand,\n        derivedCommands,\n        drawCommand._commandListTerrainPicking\n      );\n    }\n  }\n\n  if (drawCommand._classifies3DTiles) {\n    const pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n    const stencilDepthCommand = deriveStencilDepthCommand(command, pass);\n    const colorCommand = deriveColorCommand(command, pass);\n\n    derivedCommands.length = 0;\n    derivedCommands.push(stencilDepthCommand, colorCommand);\n\n    drawCommand._commandList3DTiles = createBatchCommands(\n      drawCommand,\n      derivedCommands,\n      drawCommand._commandList3DTiles\n    );\n\n    if (allowPicking) {\n      drawCommand._commandList3DTilesPicking = createPickCommands(\n        drawCommand,\n        derivedCommands,\n        drawCommand._commandList3DTilesPicking\n      );\n    }\n  }\n}\n\nfunction createBatchCommands(drawCommand, derivedCommands, result) {\n  const runtimePrimitive = drawCommand._runtimePrimitive;\n  const batchLengths = runtimePrimitive.batchLengths;\n  const batchOffsets = runtimePrimitive.batchOffsets;\n\n  const numBatches = batchLengths.length;\n  const numDerivedCommands = derivedCommands.length;\n  for (let i = 0; i < numBatches; i++) {\n    const batchLength = batchLengths[i];\n    const batchOffset = batchOffsets[i];\n    // For multiple derived commands (e.g. stencil and color commands),\n    // they must be added in a certain order even within the batches.\n    for (let j = 0; j < numDerivedCommands; j++) {\n      const derivedCommand = derivedCommands[j];\n      const batchCommand = DrawCommand.shallowClone(derivedCommand);\n      batchCommand.count = batchLength;\n      batchCommand.offset = batchOffset;\n      result.push(batchCommand);\n    }\n  }\n\n  return result;\n}\n\nfunction deriveStencilDepthCommand(command, pass) {\n  const stencilDepthCommand = DrawCommand.shallowClone(command);\n  stencilDepthCommand.cull = false;\n  stencilDepthCommand.pass = pass;\n\n  const stencilFunction =\n    pass === Pass.TERRAIN_CLASSIFICATION\n      ? StencilFunction.ALWAYS\n      : StencilFunction.EQUAL;\n  const renderState = getStencilDepthRenderState(stencilFunction);\n  stencilDepthCommand.renderState = RenderState.fromCache(renderState);\n\n  return stencilDepthCommand;\n}\n\nfunction deriveColorCommand(command, pass) {\n  const colorCommand = DrawCommand.shallowClone(command);\n  colorCommand.cull = false;\n  colorCommand.pass = pass;\n\n  colorCommand.renderState = RenderState.fromCache(colorRenderState);\n\n  return colorCommand;\n}\n\nconst scratchPickCommands = [];\n\nfunction createPickCommands(drawCommand, derivedCommands, commandList) {\n  const renderState = RenderState.fromCache(pickRenderState);\n  const stencilDepthCommand = derivedCommands[0];\n  const colorCommand = derivedCommands[1];\n\n  const pickStencilDepthCommand = DrawCommand.shallowClone(stencilDepthCommand);\n  pickStencilDepthCommand.cull = true;\n  pickStencilDepthCommand.pickOnly = true;\n\n  const pickColorCommand = DrawCommand.shallowClone(colorCommand);\n  pickColorCommand.cull = true;\n  pickColorCommand.pickOnly = true;\n  pickColorCommand.renderState = renderState;\n  pickColorCommand.pickId = drawCommand._pickId;\n\n  const pickCommands = scratchPickCommands;\n  pickCommands.length = 0;\n  pickCommands.push(pickStencilDepthCommand, pickColorCommand);\n\n  return createBatchCommands(drawCommand, pickCommands, commandList);\n}\n\nObject.defineProperties(ClassificationModelDrawCommand.prototype, {\n  /**\n   * The main draw command that the other commands are derived from.\n   *\n   * @memberof ClassificationModelDrawCommand.prototype\n   * @type {DrawCommand}\n   *\n   * @readonly\n   * @private\n   */\n  command: {\n    get: function () {\n      return this._command;\n    },\n  },\n\n  /**\n   * The runtime primitive that the draw command belongs to.\n   *\n   * @memberof ClassificationModelDrawCommand.prototype\n   * @type {ModelRuntimePrimitive}\n   *\n   * @readonly\n   * @private\n   */\n  runtimePrimitive: {\n    get: function () {\n      return this._runtimePrimitive;\n    },\n  },\n\n  /**\n   * The batch lengths used to generate multiple draw commands.\n   *\n   * @memberof ClassificationModelDrawCommand.prototype\n   * @type {number[]}\n   *\n   * @readonly\n   * @private\n   */\n  batchLengths: {\n    get: function () {\n      return this._runtimePrimitive.batchLengths;\n    },\n  },\n\n  /**\n   * The batch offsets used to generate multiple draw commands.\n   *\n   * @memberof ClassificationModelDrawCommand.prototype\n   * @type {number[]}\n   *\n   * @readonly\n   * @private\n   */\n  batchOffsets: {\n    get: function () {\n      return this._runtimePrimitive.batchOffsets;\n    },\n  },\n\n  /**\n   * The model that the draw command belongs to.\n   *\n   * @memberof ClassificationModelDrawCommand.prototype\n   * @type {Model}\n   *\n   * @readonly\n   * @private\n   */\n  model: {\n    get: function () {\n      return this._model;\n    },\n  },\n\n  /**\n   * The classification type of the model that this draw command belongs to.\n   *\n   * @memberof ClassificationModelDrawCommand.prototype\n   * @type {ClassificationType}\n   *\n   * @readonly\n   * @private\n   */\n  classificationType: {\n    get: function () {\n      return this._classificationType;\n    },\n  },\n\n  /**\n   * The current model matrix applied to the draw commands.\n   *\n   * @memberof ClassificationModelDrawCommand.prototype\n   * @type {Matrix4}\n   *\n   * @readonly\n   * @private\n   */\n  modelMatrix: {\n    get: function () {\n      return this._modelMatrix;\n    },\n    set: function (value) {\n      this._modelMatrix = Matrix4.clone(value, this._modelMatrix);\n      const boundingSphere = this._runtimePrimitive.boundingSphere;\n      this._boundingVolume = BoundingSphere.transform(\n        boundingSphere,\n        this._modelMatrix,\n        this._boundingVolume\n      );\n    },\n  },\n\n  /**\n   * The bounding volume of the main draw command. This is equivalent\n   * to the primitive's bounding sphere transformed by the draw\n   * command's model matrix.\n   *\n   * @memberof ClassificationModelDrawCommand.prototype\n   * @type {BoundingSphere}\n   *\n   * @readonly\n   * @private\n   */\n  boundingVolume: {\n    get: function () {\n      return this._boundingVolume;\n    },\n  },\n\n  /**\n   * Culling is disabled for classification models, so this has no effect on\n   * how the model renders. This only exists to match the interface of\n   * {@link ModelDrawCommand}.\n   *\n   * @memberof ClassificationModelDrawCommand.prototype\n   * @type {CullFace}\n   *\n   * @private\n   */\n  cullFace: {\n    get: function () {\n      return this._cullFace;\n    },\n    set: function (value) {\n      this._cullFace = value;\n    },\n  },\n});\n\n/**\n * Pushes the draw commands necessary to render the primitive.\n *\n * @param {FrameState} frameState The frame state.\n * @param {DrawCommand[]} result The array to push the draw commands to.\n *\n * @returns {DrawCommand[]} The modified result parameter.\n *\n * @private\n */\nClassificationModelDrawCommand.prototype.pushCommands = function (\n  frameState,\n  result\n) {\n  const passes = frameState.passes;\n  if (passes.render) {\n    if (this._useDebugWireframe) {\n      result.push.apply(result, this._commandListDebugWireframe);\n      return;\n    }\n\n    if (this._classifiesTerrain) {\n      result.push.apply(result, this._commandListTerrain);\n    }\n\n    if (this._classifies3DTiles) {\n      result.push.apply(result, this._commandList3DTiles);\n    }\n\n    const useIgnoreShowCommands =\n      frameState.invertClassification && this._classifies3DTiles;\n\n    if (useIgnoreShowCommands) {\n      if (this._commandListIgnoreShow.length === 0) {\n        const pass = Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW;\n        const command = deriveStencilDepthCommand(this._command, pass);\n\n        const derivedCommands = scratchDerivedCommands;\n        derivedCommands.length = 0;\n        derivedCommands.push(command);\n\n        this._commandListIgnoreShow = createBatchCommands(\n          this,\n          derivedCommands,\n          this._commandListIgnoreShow\n        );\n      }\n\n      result.push.apply(result, this._commandListIgnoreShow);\n    }\n  }\n\n  if (passes.pick) {\n    if (this._classifiesTerrain) {\n      result.push.apply(result, this._commandListTerrainPicking);\n    }\n\n    if (this._classifies3DTiles) {\n      result.push.apply(result, this._commandList3DTilesPicking);\n    }\n  }\n\n  return result;\n};\n\nexport default ClassificationModelDrawCommand;\n", "import BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../../Core/Cartesian2.js\";\nimport CesiumMath from \"../../Core/Math.js\";\nimport Check from \"../../Core/Check.js\";\nimport clone from \"../../Core/clone.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport WebGLConstants from \"../../Core/WebGLConstants.js\";\nimport DrawCommand from \"../../Renderer/DrawCommand.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport RenderState from \"../../Renderer/RenderState.js\";\nimport BlendingState from \"../BlendingState.js\";\nimport CullFace from \"../CullFace.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport ShadowMode from \"../ShadowMode.js\";\nimport StencilConstants from \"../StencilConstants.js\";\nimport StencilFunction from \"../StencilFunction.js\";\nimport StencilOperation from \"../StencilOperation.js\";\nimport StyleCommandsNeeded from \"./StyleCommandsNeeded.js\";\n\n/**\n * A wrapper around the draw commands used to render a {@link ModelRuntimePrimitive}.\n * This manages the derived commands and pushes only the necessary commands depending\n * on the given frame state.\n *\n * @param {object} options An object containing the following options:\n * @param {DrawCommand} options.command The draw command from which to derive other commands from.\n * @param {PrimitiveRenderResources} options.primitiveRenderResources The render resources of the primitive associated with the command.\n *\n * @alias ModelDrawCommand\n * @constructor\n *\n * @private\n */\nfunction ModelDrawCommand(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const command = options.command;\n  const renderResources = options.primitiveRenderResources;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.command\", command);\n  Check.typeOf.object(\"options.primitiveRenderResources\", renderResources);\n  //>>includeEnd('debug');\n\n  const model = renderResources.model;\n  this._model = model;\n\n  const runtimePrimitive = renderResources.runtimePrimitive;\n  this._runtimePrimitive = runtimePrimitive;\n\n  // If the command is translucent, or if the primitive's material is\n  // double-sided, then back-face culling is automatically disabled for\n  // the command. The user value for back-face culling will be ignored.\n  const isTranslucent = command.pass === Pass.TRANSLUCENT;\n  const isDoubleSided = runtimePrimitive.primitive.material.doubleSided;\n  const usesBackFaceCulling = !isDoubleSided && !isTranslucent;\n  const hasSilhouette = renderResources.hasSilhouette;\n\n  // If the command was already translucent, there's no need to derive a new\n  // translucent command. As of now, a style can't change an originally\n  // translucent feature to opaque since the style's alpha is modulated,\n  // not replaced. When this changes, we need to derive new opaque commands\n  // in initialize().\n  //\n  // Silhouettes for primitives with both opaque and translucent features\n  // are not yet supported.\n  const needsTranslucentCommand = !isTranslucent && !hasSilhouette;\n\n  const needsSkipLevelOfDetailCommands =\n    renderResources.hasSkipLevelOfDetail && !isTranslucent;\n\n  const needsSilhouetteCommands = hasSilhouette;\n\n  this._command = command;\n\n  // None of the derived commands (non-2D) use a different model matrix\n  // or bounding volume than the original, so they all point to the\n  // ModelDrawCommand's copy to save update time and memory.\n  this._modelMatrix = Matrix4.clone(command.modelMatrix);\n  this._boundingVolume = BoundingSphere.clone(command.boundingVolume);\n\n  // The 2D model matrix depends on the frame state's map projection,\n  // so it must be updated when the commands are handled in pushCommands.\n  this._modelMatrix2D = new Matrix4();\n  this._boundingVolume2D = new BoundingSphere();\n  this._modelMatrix2DDirty = false;\n\n  this._backFaceCulling = command.renderState.cull.enabled;\n  this._cullFace = command.renderState.cull.face;\n  this._shadows = model.shadows;\n  this._debugShowBoundingVolume = command.debugShowBoundingVolume;\n\n  this._usesBackFaceCulling = usesBackFaceCulling;\n  this._needsTranslucentCommand = needsTranslucentCommand;\n  this._needsSkipLevelOfDetailCommands = needsSkipLevelOfDetailCommands;\n  this._needsSilhouetteCommands = needsSilhouetteCommands;\n\n  // Derived commands\n  this._originalCommand = undefined;\n  this._translucentCommand = undefined;\n  this._skipLodBackfaceCommand = undefined;\n  this._skipLodStencilCommand = undefined;\n  this._silhouetteModelCommand = undefined;\n  this._silhouetteColorCommand = undefined;\n\n  // All derived commands (including 2D commands)\n  this._derivedCommands = [];\n  this._has2DCommands = false;\n\n  initialize(this);\n}\n\nfunction ModelDerivedCommand(options) {\n  // The DrawCommand managed by this derived command.\n  this.command = options.command;\n\n  // These control whether the derived command should update the\n  // values of the DrawCommand for the corresponding properties.\n  this.updateShadows = options.updateShadows;\n  this.updateBackFaceCulling = options.updateBackFaceCulling;\n  this.updateCullFace = options.updateCullFace;\n  this.updateDebugShowBoundingVolume = options.updateDebugShowBoundingVolume;\n\n  // Whether this ModelDerivedCommand is in 2D.\n  this.is2D = defaultValue(options.is2D, false);\n\n  // A ModelDerivedCommand that is the 2D version of this one.\n  this.derivedCommand2D = undefined;\n}\n\nModelDerivedCommand.clone = function (derivedCommand) {\n  return new ModelDerivedCommand({\n    command: derivedCommand.command,\n    updateShadows: derivedCommand.updateShadows,\n    updateBackFaceCulling: derivedCommand.updateBackFaceCulling,\n    updateCullFace: derivedCommand.updateCullFace,\n    updateDebugShowBoundingVolume: derivedCommand.updateDebugShowBoundingVolume,\n    is2D: derivedCommand.is2D,\n    derivedCommand2D: derivedCommand.derivedCommand2D,\n  });\n};\n\nfunction initialize(drawCommand) {\n  const command = drawCommand._command;\n  command.modelMatrix = drawCommand._modelMatrix;\n  command.boundingVolume = drawCommand._boundingVolume;\n\n  const model = drawCommand._model;\n  const usesBackFaceCulling = drawCommand._usesBackFaceCulling;\n  const derivedCommands = drawCommand._derivedCommands;\n\n  drawCommand._originalCommand = new ModelDerivedCommand({\n    command: command,\n    updateShadows: true,\n    updateBackFaceCulling: usesBackFaceCulling,\n    updateCullFace: usesBackFaceCulling,\n    updateDebugShowBoundingVolume: true,\n    is2D: false,\n  });\n\n  derivedCommands.push(drawCommand._originalCommand);\n\n  if (drawCommand._needsTranslucentCommand) {\n    drawCommand._translucentCommand = new ModelDerivedCommand({\n      command: deriveTranslucentCommand(command),\n      updateShadows: true,\n      updateBackFaceCulling: false,\n      updateCullFace: false,\n      updateDebugShowBoundingVolume: true,\n    });\n\n    derivedCommands.push(drawCommand._translucentCommand);\n  }\n\n  if (drawCommand._needsSkipLevelOfDetailCommands) {\n    drawCommand._skipLodBackfaceCommand = new ModelDerivedCommand({\n      command: deriveSkipLodBackfaceCommand(command),\n      updateShadows: false,\n      updateBackFaceCulling: false,\n      updateCullFace: usesBackFaceCulling,\n      updateDebugShowBoundingVolume: false,\n    });\n\n    drawCommand._skipLodStencilCommand = new ModelDerivedCommand({\n      command: deriveSkipLodStencilCommand(command, model),\n      updateShadows: true,\n      updateBackFaceCulling: usesBackFaceCulling,\n      updateCullFace: usesBackFaceCulling,\n      updateDebugShowBoundingVolume: true,\n    });\n\n    derivedCommands.push(drawCommand._skipLodBackfaceCommand);\n    derivedCommands.push(drawCommand._skipLodStencilCommand);\n  }\n\n  if (drawCommand._needsSilhouetteCommands) {\n    drawCommand._silhouetteModelCommand = new ModelDerivedCommand({\n      command: deriveSilhouetteModelCommand(command, model),\n      updateShadows: true,\n      updateBackFaceCulling: usesBackFaceCulling,\n      updateCullFace: usesBackFaceCulling,\n      updateDebugShowBoundingVolume: true,\n    });\n\n    drawCommand._silhouetteColorCommand = new ModelDerivedCommand({\n      command: deriveSilhouetteColorCommand(command, model),\n      updateShadows: false,\n      updateBackFaceCulling: false,\n      updateCullFace: false,\n      updateDebugShowBoundingVolume: false,\n    });\n\n    derivedCommands.push(drawCommand._silhouetteModelCommand);\n    derivedCommands.push(drawCommand._silhouetteColorCommand);\n  }\n}\n\nObject.defineProperties(ModelDrawCommand.prototype, {\n  /**\n   * The main draw command that the other commands are derived from.\n   *\n   * @memberof ModelDrawCommand.prototype\n   * @type {DrawCommand}\n   *\n   * @readonly\n   * @private\n   */\n  command: {\n    get: function () {\n      return this._command;\n    },\n  },\n\n  /**\n   * The runtime primitive that the draw command belongs to.\n   *\n   * @memberof ModelDrawCommand.prototype\n   * @type {ModelRuntimePrimitive}\n   *\n   * @readonly\n   * @private\n   */\n  runtimePrimitive: {\n    get: function () {\n      return this._runtimePrimitive;\n    },\n  },\n\n  /**\n   * The model that the draw command belongs to.\n   *\n   * @memberof ModelDrawCommand.prototype\n   * @type {Model}\n   *\n   * @readonly\n   * @private\n   */\n  model: {\n    get: function () {\n      return this._model;\n    },\n  },\n\n  /**\n   * The primitive type of the draw command.\n   *\n   * @memberof ModelDrawCommand.prototype\n   * @type {PrimitiveType}\n   *\n   * @readonly\n   * @private\n   */\n  primitiveType: {\n    get: function () {\n      return this._command.primitiveType;\n    },\n  },\n\n  /**\n   * The current model matrix applied to the draw commands. If there are\n   * 2D draw commands, their model matrix will be derived from the 3D one.\n   *\n   * @memberof ModelDrawCommand.prototype\n   * @type {Matrix4}\n   *\n   * @readonly\n   * @private\n   */\n  modelMatrix: {\n    get: function () {\n      return this._modelMatrix;\n    },\n    set: function (value) {\n      this._modelMatrix = Matrix4.clone(value, this._modelMatrix);\n      this._modelMatrix2DDirty = true;\n\n      this._boundingVolume = BoundingSphere.transform(\n        this.runtimePrimitive.boundingSphere,\n        this._modelMatrix,\n        this._boundingVolume\n      );\n    },\n  },\n\n  /**\n   * The bounding volume of the main draw command. This is equivalent\n   * to the primitive's bounding sphere transformed by the draw\n   * command's model matrix.\n   *\n   * @memberof ModelDrawCommand.prototype\n   * @type {BoundingSphere}\n   *\n   * @readonly\n   * @private\n   */\n  boundingVolume: {\n    get: function () {\n      return this._boundingVolume;\n    },\n  },\n\n  /**\n   * Whether the geometry casts or receives shadows from light sources.\n   *\n   * @memberof ModelDrawCommand.prototype\n   * @type {ShadowMode}\n   *\n   * @private\n   */\n  shadows: {\n    get: function () {\n      return this._shadows;\n    },\n    set: function (value) {\n      this._shadows = value;\n      updateShadows(this);\n    },\n  },\n\n  /**\n   * Whether to cull back-facing geometry. When true, back face culling is\n   * determined by the material's doubleSided property; when false, back face\n   * culling is disabled. Back faces are not culled if the command is\n   * translucent.\n   *\n   * @memberof ModelDrawCommand.prototype\n   * @type {boolean}\n   *\n   * @private\n   */\n  backFaceCulling: {\n    get: function () {\n      return this._backFaceCulling;\n    },\n    set: function (value) {\n      if (this._backFaceCulling === value) {\n        return;\n      }\n\n      this._backFaceCulling = value;\n      updateBackFaceCulling(this);\n    },\n  },\n\n  /**\n   * Determines which faces to cull, if culling is enabled.\n   *\n   * @memberof ModelDrawCommand.prototype\n   * @type {CullFace}\n   *\n   * @private\n   */\n  cullFace: {\n    get: function () {\n      return this._cullFace;\n    },\n    set: function (value) {\n      if (this._cullFace === value) {\n        return;\n      }\n\n      this._cullFace = value;\n      updateCullFace(this);\n    },\n  },\n\n  /**\n   * Whether to draw the bounding sphere associated with this draw command.\n   *\n   * @memberof ModelDrawCommand.prototype\n   * @type {boolean}\n   *\n   * @private\n   */\n  debugShowBoundingVolume: {\n    get: function () {\n      return this._debugShowBoundingVolume;\n    },\n    set: function (value) {\n      if (this._debugShowBoundingVolume === value) {\n        return;\n      }\n\n      this._debugShowBoundingVolume = value;\n      updateDebugShowBoundingVolume(this);\n    },\n  },\n});\n\nfunction updateModelMatrix2D(drawCommand, frameState) {\n  const modelMatrix = drawCommand._modelMatrix;\n  drawCommand._modelMatrix2D = Matrix4.clone(\n    modelMatrix,\n    drawCommand._modelMatrix2D\n  );\n\n  // Change the translation's y-component so it appears on the opposite side\n  // of the map.\n  drawCommand._modelMatrix2D[13] -=\n    CesiumMath.sign(modelMatrix[13]) *\n    2.0 *\n    CesiumMath.PI *\n    frameState.mapProjection.ellipsoid.maximumRadius;\n\n  drawCommand._boundingVolume2D = BoundingSphere.transform(\n    drawCommand.runtimePrimitive.boundingSphere,\n    drawCommand._modelMatrix2D,\n    drawCommand._boundingVolume2D\n  );\n}\n\nfunction updateShadows(drawCommand) {\n  const shadows = drawCommand.shadows;\n  const castShadows = ShadowMode.castShadows(shadows);\n  const receiveShadows = ShadowMode.receiveShadows(shadows);\n\n  const derivedCommands = drawCommand._derivedCommands;\n\n  for (let i = 0; i < derivedCommands.length; ++i) {\n    const derivedCommand = derivedCommands[i];\n    if (derivedCommand.updateShadows) {\n      const command = derivedCommand.command;\n      command.castShadows = castShadows;\n      command.receiveShadows = receiveShadows;\n    }\n  }\n}\n\nfunction updateBackFaceCulling(drawCommand) {\n  const backFaceCulling = drawCommand.backFaceCulling;\n  const derivedCommands = drawCommand._derivedCommands;\n\n  for (let i = 0; i < derivedCommands.length; ++i) {\n    const derivedCommand = derivedCommands[i];\n    if (derivedCommand.updateBackFaceCulling) {\n      const command = derivedCommand.command;\n      const renderState = clone(command.renderState, true);\n      renderState.cull.enabled = backFaceCulling;\n      command.renderState = RenderState.fromCache(renderState);\n    }\n  }\n}\n\nfunction updateCullFace(drawCommand) {\n  const cullFace = drawCommand.cullFace;\n  const derivedCommands = drawCommand._derivedCommands;\n\n  for (let i = 0; i < derivedCommands.length; ++i) {\n    const derivedCommand = derivedCommands[i];\n    if (derivedCommand.updateCullFace) {\n      const command = derivedCommand.command;\n      const renderState = clone(command.renderState, true);\n      renderState.cull.face = cullFace;\n      command.renderState = RenderState.fromCache(renderState);\n    }\n  }\n}\n\nfunction updateDebugShowBoundingVolume(drawCommand) {\n  const debugShowBoundingVolume = drawCommand.debugShowBoundingVolume;\n  const derivedCommands = drawCommand._derivedCommands;\n\n  for (let i = 0; i < derivedCommands.length; ++i) {\n    const derivedCommand = derivedCommands[i];\n    if (derivedCommand.updateDebugShowBoundingVolume) {\n      const command = derivedCommand.command;\n      command.debugShowBoundingVolume = debugShowBoundingVolume;\n    }\n  }\n}\n\n/**\n * Pushes the draw commands necessary to render the primitive.\n * This does not include the draw commands that render its silhouette.\n *\n * @param {FrameState} frameState The frame state.\n * @param {DrawCommand[]} result The array to push the draw commands to.\n *\n * @returns {DrawCommand[]} The modified result parameter.\n *\n * @private\n */\nModelDrawCommand.prototype.pushCommands = function (frameState, result) {\n  const use2D = shouldUse2DCommands(this, frameState);\n\n  if (use2D && !this._has2DCommands) {\n    derive2DCommands(this);\n    this._has2DCommands = true;\n    this._modelMatrix2DDirty = true;\n  }\n\n  if (this._modelMatrix2DDirty) {\n    updateModelMatrix2D(this, frameState);\n    this._modelMatrix2DDirty = false;\n  }\n\n  const styleCommandsNeeded = this.model.styleCommandsNeeded;\n  if (this._needsTranslucentCommand && defined(styleCommandsNeeded)) {\n    // StyleCommandsNeeded has three values: all opaque, all translucent, or both.\n    if (styleCommandsNeeded !== StyleCommandsNeeded.ALL_OPAQUE) {\n      pushCommand(result, this._translucentCommand, use2D);\n    }\n\n    // Continue only if opaque commands are needed.\n    if (styleCommandsNeeded === StyleCommandsNeeded.ALL_TRANSLUCENT) {\n      return;\n    }\n  }\n\n  if (this._needsSkipLevelOfDetailCommands) {\n    const { tileset, tile } = this._model.content;\n\n    if (tileset.hasMixedContent) {\n      if (!tile._finalResolution) {\n        pushCommand(\n          tileset._backfaceCommands,\n          this._skipLodBackfaceCommand,\n          use2D\n        );\n      }\n\n      updateSkipLodStencilCommand(this, tile, use2D);\n      pushCommand(result, this._skipLodStencilCommand, use2D);\n      return;\n    }\n  }\n\n  if (this._needsSilhouetteCommands) {\n    pushCommand(result, this._silhouetteModelCommand, use2D);\n    return;\n  }\n\n  pushCommand(result, this._originalCommand, use2D);\n\n  return result;\n};\n\n/**\n * Pushes the draw commands necessary to render the silhouette. These should\n * be added to the command list after the draw commands of all primitives\n * in the model have been added. This way, the silhouette won't render on\n * top of the model.\n * <p>\n * This should only be called after pushCommands() has been invoked for\n * the ModelDrawCommand this frame. Otherwise, the silhouette commands may\n * not have been derived for 2D. The model matrix will also not have been\n * updated for 2D commands.\n * </p>\n *\n * @param {FrameState} frameState The frame state.\n * @param {DrawCommand[]} result The array to push the silhouette commands to.\n *\n * @returns {DrawCommand[]} The modified result parameter.\n *\n * @private\n */\nModelDrawCommand.prototype.pushSilhouetteCommands = function (\n  frameState,\n  result\n) {\n  const use2D = shouldUse2DCommands(this, frameState);\n  pushCommand(result, this._silhouetteColorCommand, use2D);\n\n  return result;\n};\n\nfunction pushCommand(commandList, derivedCommand, use2D) {\n  commandList.push(derivedCommand.command);\n  if (use2D) {\n    commandList.push(derivedCommand.derivedCommand2D.command);\n  }\n}\n\nfunction shouldUse2DCommands(drawCommand, frameState) {\n  if (frameState.mode !== SceneMode.SCENE2D || drawCommand.model._projectTo2D) {\n    return false;\n  }\n\n  // The draw command's bounding sphere might cause primitives not to render\n  // over the IDL, even if they are part of the same model. Use the scene graph's\n  // bounding sphere instead.\n  const model = drawCommand.model;\n  const boundingSphere = model.sceneGraph._boundingSphere2D;\n\n  const left = boundingSphere.center.y - boundingSphere.radius;\n  const right = boundingSphere.center.y + boundingSphere.radius;\n  const idl2D =\n    frameState.mapProjection.ellipsoid.maximumRadius * CesiumMath.PI;\n\n  return (left < idl2D && right > idl2D) || (left < -idl2D && right > -idl2D);\n}\n\nfunction derive2DCommand(drawCommand, derivedCommand) {\n  if (!defined(derivedCommand)) {\n    return;\n  }\n\n  // If the model crosses the IDL in 2D, it will be drawn in one viewport but get\n  // clipped by the other viewport. We create a second command that translates\n  // the model matrix to the opposite side of the map so the part that was clipped\n  // in one viewport is drawn in the other.\n  const derivedCommand2D = ModelDerivedCommand.clone(derivedCommand);\n\n  const command2D = DrawCommand.shallowClone(derivedCommand.command);\n  command2D.modelMatrix = drawCommand._modelMatrix2D;\n  command2D.boundingVolume = drawCommand._boundingVolume2D;\n\n  derivedCommand2D.command = command2D;\n  derivedCommand2D.updateShadows = false; // Shadows are disabled for 2D\n  derivedCommand2D.is2D = true;\n\n  derivedCommand.derivedCommand2D = derivedCommand2D;\n  drawCommand._derivedCommands.push(derivedCommand2D);\n\n  return derivedCommand2D;\n}\n\nfunction derive2DCommands(drawCommand) {\n  derive2DCommand(drawCommand, drawCommand._originalCommand);\n  derive2DCommand(drawCommand, drawCommand._translucentCommand);\n  derive2DCommand(drawCommand, drawCommand._skipLodBackfaceCommand);\n  derive2DCommand(drawCommand, drawCommand._skipLodStencilCommand);\n  derive2DCommand(drawCommand, drawCommand._silhouetteModelCommand);\n  derive2DCommand(drawCommand, drawCommand._silhouetteColorCommand);\n}\n\nfunction deriveTranslucentCommand(command) {\n  const derivedCommand = DrawCommand.shallowClone(command);\n  derivedCommand.pass = Pass.TRANSLUCENT;\n  const rs = clone(command.renderState, true);\n  rs.cull.enabled = false;\n  rs.depthMask = false;\n  rs.blending = BlendingState.ALPHA_BLEND;\n  derivedCommand.renderState = RenderState.fromCache(rs);\n\n  return derivedCommand;\n}\n\nfunction deriveSilhouetteModelCommand(command, model) {\n  // Wrap around after exceeding the 8-bit stencil limit.\n  // The reference is unique to each model until this point.\n  const stencilReference = model._silhouetteId % 255;\n  const silhouetteModelCommand = DrawCommand.shallowClone(command);\n  const renderState = clone(command.renderState, true);\n\n  // Write the reference value into the stencil buffer.\n  renderState.stencilTest = {\n    enabled: true,\n    frontFunction: WebGLConstants.ALWAYS,\n    backFunction: WebGLConstants.ALWAYS,\n    reference: stencilReference,\n    mask: ~0,\n    frontOperation: {\n      fail: WebGLConstants.KEEP,\n      zFail: WebGLConstants.KEEP,\n      zPass: WebGLConstants.REPLACE,\n    },\n    backOperation: {\n      fail: WebGLConstants.KEEP,\n      zFail: WebGLConstants.KEEP,\n      zPass: WebGLConstants.REPLACE,\n    },\n  };\n\n  if (model.isInvisible()) {\n    renderState.colorMask = {\n      red: false,\n      green: false,\n      blue: false,\n      alpha: false,\n    };\n  }\n\n  silhouetteModelCommand.renderState = RenderState.fromCache(renderState);\n\n  return silhouetteModelCommand;\n}\n\nfunction deriveSilhouetteColorCommand(command, model) {\n  // Wrap around after exceeding the 8-bit stencil limit.\n  // The reference is unique to each model until this point.\n  const stencilReference = model._silhouetteId % 255;\n  const silhouetteColorCommand = DrawCommand.shallowClone(command);\n  const renderState = clone(command.renderState, true);\n  renderState.cull.enabled = false;\n\n  // Render the silhouette in the translucent pass if either the command\n  // pass or the silhouette color is translucent. This will account for\n  // translucent model color, since ModelColorPipelineStage sets the pass\n  // to translucent.\n  const silhouetteTranslucent =\n    command.pass === Pass.TRANSLUCENT || model.silhouetteColor.alpha < 1.0;\n  if (silhouetteTranslucent) {\n    silhouetteColorCommand.pass = Pass.TRANSLUCENT;\n    renderState.depthMask = false;\n    renderState.blending = BlendingState.ALPHA_BLEND;\n  }\n\n  // Only render the pixels of the silhouette that don't conflict with\n  // the stencil buffer. This way, the silhouette doesn't render over\n  // the original model.\n  renderState.stencilTest = {\n    enabled: true,\n    frontFunction: WebGLConstants.NOTEQUAL,\n    backFunction: WebGLConstants.NOTEQUAL,\n    reference: stencilReference,\n    mask: ~0,\n    frontOperation: {\n      fail: WebGLConstants.KEEP,\n      zFail: WebGLConstants.KEEP,\n      zPass: WebGLConstants.KEEP,\n    },\n    backOperation: {\n      fail: WebGLConstants.KEEP,\n      zFail: WebGLConstants.KEEP,\n      zPass: WebGLConstants.KEEP,\n    },\n  };\n\n  const uniformMap = clone(command.uniformMap);\n  uniformMap.model_silhouettePass = function () {\n    return true;\n  };\n\n  silhouetteColorCommand.renderState = RenderState.fromCache(renderState);\n  silhouetteColorCommand.uniformMap = uniformMap;\n  silhouetteColorCommand.castShadows = false;\n  silhouetteColorCommand.receiveShadows = false;\n\n  return silhouetteColorCommand;\n}\n\nfunction updateSkipLodStencilCommand(drawCommand, tile, use2D) {\n  const stencilDerivedComand = drawCommand._skipLodStencilCommand;\n  const stencilCommand = stencilDerivedComand.command;\n\n  const selectionDepth = tile._selectionDepth;\n  const lastSelectionDepth = getLastSelectionDepth(stencilCommand);\n\n  if (selectionDepth !== lastSelectionDepth) {\n    const skipLodStencilReference = getStencilReference(selectionDepth);\n    const renderState = clone(stencilCommand.renderState, true);\n    renderState.stencilTest.reference = skipLodStencilReference;\n    stencilCommand.renderState = RenderState.fromCache(renderState);\n\n    if (use2D) {\n      stencilDerivedComand.derivedCommand2D.renderState = renderState;\n    }\n  }\n}\n\nfunction getLastSelectionDepth(stencilCommand) {\n  // Isolate the selection depth from the stencil reference.\n  const reference = stencilCommand.renderState.stencilTest.reference;\n  return (\n    (reference & StencilConstants.SKIP_LOD_MASK) >>>\n    StencilConstants.SKIP_LOD_BIT_SHIFT\n  );\n}\n\nfunction getStencilReference(selectionDepth) {\n  // Stencil test is masked to the most significant 3 bits so the reference is shifted.\n  // Writes 0 for the terrain bit.\n  return (\n    StencilConstants.CESIUM_3D_TILE_MASK |\n    (selectionDepth << StencilConstants.SKIP_LOD_BIT_SHIFT)\n  );\n}\n\nfunction deriveSkipLodBackfaceCommand(command) {\n  // Write just backface depth of unresolved tiles so resolved stenciled tiles\n  // do not appear in front.\n  const backfaceCommand = DrawCommand.shallowClone(command);\n  const renderState = clone(command.renderState, true);\n  renderState.cull.enabled = true;\n  renderState.cull.face = CullFace.FRONT;\n  // Back faces do not need to write color.\n  renderState.colorMask = {\n    red: false,\n    green: false,\n    blue: false,\n    alpha: false,\n  };\n  // Push back face depth away from the camera so it is less likely that back faces and front faces of the same tile\n  // intersect and overlap. This helps avoid flickering for very thin double-sided walls.\n  renderState.polygonOffset = {\n    enabled: true,\n    factor: 5.0,\n    units: 5.0,\n  };\n\n  // The stencil test is set in TilesetPipelineStage.\n\n  const uniformMap = clone(backfaceCommand.uniformMap);\n  const polygonOffset = new Cartesian2(5.0, 5.0);\n\n  uniformMap.u_polygonOffset = function () {\n    return polygonOffset;\n  };\n\n  backfaceCommand.renderState = RenderState.fromCache(renderState);\n  backfaceCommand.uniformMap = uniformMap;\n  backfaceCommand.castShadows = false;\n  backfaceCommand.receiveShadows = false;\n\n  return backfaceCommand;\n}\n\nfunction deriveSkipLodStencilCommand(command) {\n  // Tiles only draw if their selection depth is >= the tile drawn already. They write their\n  // selection depth to the stencil buffer to prevent ancestor tiles from drawing on top\n  const stencilCommand = DrawCommand.shallowClone(command);\n  const renderState = clone(command.renderState, true);\n  // The stencil reference is updated dynamically; see updateSkipLodStencilCommand().\n  const { stencilTest } = renderState;\n  stencilTest.enabled = true;\n  stencilTest.mask = StencilConstants.SKIP_LOD_MASK;\n  stencilTest.reference = StencilConstants.CESIUM_3D_TILE_MASK;\n  stencilTest.frontFunction = StencilFunction.GREATER_OR_EQUAL;\n  stencilTest.frontOperation.zPass = StencilOperation.REPLACE;\n  stencilTest.backFunction = StencilFunction.GREATER_OR_EQUAL;\n  stencilTest.backOperation.zPass = StencilOperation.REPLACE;\n  renderState.stencilMask =\n    StencilConstants.CESIUM_3D_TILE_MASK | StencilConstants.SKIP_LOD_MASK;\n\n  stencilCommand.renderState = RenderState.fromCache(renderState);\n\n  return stencilCommand;\n}\n\nexport default ModelDrawCommand;\n", "import BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport clone from \"../../Core/clone.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport DrawCommand from \"../../Renderer/DrawCommand.js\";\nimport RenderState from \"../../Renderer/RenderState.js\";\nimport VertexArray from \"../../Renderer/VertexArray.js\";\nimport ModelFS from \"../../Shaders/Model/ModelFS.js\";\nimport ModelVS from \"../../Shaders/Model/ModelVS.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport ShadowMode from \"../ShadowMode.js\";\nimport ClassificationModelDrawCommand from \"./ClassificationModelDrawCommand.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport ModelDrawCommand from \"./ModelDrawCommand.js\";\n\n/**\n * Builds the {@link ModelDrawCommand} for a {@link ModelRuntimePrimitive}\n * using its render resources. If the model classifies another asset, it\n * builds a {@link ClassificationModelDrawCommand} instead.\n *\n * @param {PrimitiveRenderResources} primitiveRenderResources The render resources for a primitive.\n * @param {FrameState} frameState The frame state for creating GPU resources.\n *\n * @returns {ModelDrawCommand|ClassificationModelDrawCommand} The generated ModelDrawCommand or ClassificationModelDrawCommand.\n *\n * @private\n */\nfunction buildDrawCommand(primitiveRenderResources, frameState) {\n  const shaderBuilder = primitiveRenderResources.shaderBuilder;\n  shaderBuilder.addVertexLines(ModelVS);\n  shaderBuilder.addFragmentLines(ModelFS);\n\n  const indexBuffer = getIndexBuffer(primitiveRenderResources);\n\n  const vertexArray = new VertexArray({\n    context: frameState.context,\n    indexBuffer: indexBuffer,\n    attributes: primitiveRenderResources.attributes,\n  });\n\n  const model = primitiveRenderResources.model;\n  model._pipelineResources.push(vertexArray);\n\n  const shaderProgram = shaderBuilder.buildShaderProgram(frameState.context);\n  model._pipelineResources.push(shaderProgram);\n\n  const pass = primitiveRenderResources.alphaOptions.pass;\n  const sceneGraph = model.sceneGraph;\n\n  const is3D = frameState.mode === SceneMode.SCENE3D;\n  let modelMatrix, boundingSphere;\n\n  if (!is3D && !frameState.scene3DOnly && model._projectTo2D) {\n    modelMatrix = Matrix4.multiplyTransformation(\n      sceneGraph._computedModelMatrix,\n      primitiveRenderResources.runtimeNode.computedTransform,\n      new Matrix4()\n    );\n\n    const runtimePrimitive = primitiveRenderResources.runtimePrimitive;\n    boundingSphere = runtimePrimitive.boundingSphere2D;\n  } else {\n    const computedModelMatrix = is3D\n      ? sceneGraph._computedModelMatrix\n      : sceneGraph._computedModelMatrix2D;\n\n    modelMatrix = Matrix4.multiplyTransformation(\n      computedModelMatrix,\n      primitiveRenderResources.runtimeNode.computedTransform,\n      new Matrix4()\n    );\n\n    boundingSphere = BoundingSphere.transform(\n      primitiveRenderResources.boundingSphere,\n      modelMatrix,\n      primitiveRenderResources.boundingSphere\n    );\n  }\n\n  // Initialize render state with default values\n  let renderState = clone(\n    RenderState.fromCache(primitiveRenderResources.renderStateOptions),\n    true\n  );\n\n  renderState.cull.face = ModelUtility.getCullFace(\n    modelMatrix,\n    primitiveRenderResources.primitiveType\n  );\n  renderState = RenderState.fromCache(renderState);\n\n  const hasClassification = defined(model.classificationType);\n  const castShadows = hasClassification\n    ? false\n    : ShadowMode.castShadows(model.shadows);\n  const receiveShadows = hasClassification\n    ? false\n    : ShadowMode.receiveShadows(model.shadows);\n  // Pick IDs are only added to specific draw commands for classification.\n  // This behavior is handled by ClassificationModelDrawCommand.\n  const pickId = hasClassification\n    ? undefined\n    : primitiveRenderResources.pickId;\n\n  const command = new DrawCommand({\n    boundingVolume: boundingSphere,\n    modelMatrix: modelMatrix,\n    uniformMap: primitiveRenderResources.uniformMap,\n    renderState: renderState,\n    vertexArray: vertexArray,\n    shaderProgram: shaderProgram,\n    cull: model.cull,\n    pass: pass,\n    count: primitiveRenderResources.count,\n    owner: model,\n    pickId: pickId,\n    instanceCount: primitiveRenderResources.instanceCount,\n    primitiveType: primitiveRenderResources.primitiveType,\n    debugShowBoundingVolume: model.debugShowBoundingVolume,\n    castShadows: castShadows,\n    receiveShadows: receiveShadows,\n  });\n\n  if (hasClassification) {\n    return new ClassificationModelDrawCommand({\n      primitiveRenderResources: primitiveRenderResources,\n      command: command,\n    });\n  }\n\n  return new ModelDrawCommand({\n    primitiveRenderResources: primitiveRenderResources,\n    command: command,\n  });\n}\n\n/**\n * @private\n */\nfunction getIndexBuffer(primitiveRenderResources) {\n  const wireframeIndexBuffer = primitiveRenderResources.wireframeIndexBuffer;\n  if (defined(wireframeIndexBuffer)) {\n    return wireframeIndexBuffer;\n  }\n\n  const indices = primitiveRenderResources.indices;\n  if (!defined(indices)) {\n    return undefined;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(indices.buffer)) {\n    throw new DeveloperError(\"Indices must be provided as a Buffer\");\n  }\n  //>>includeEnd('debug');\n\n  return indices.buffer;\n}\n\nexport default buildDrawCommand;\n", "import combine from \"../../Core/combine.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport Cartesian2 from \"../../Core/Cartesian2.js\";\nimport StencilConstants from \"../StencilConstants.js\";\n\n/**\n * The tileset pipeline stage is responsible for updating the model with behavior\n * specific to 3D Tiles.\n *\n * @namespace TilesetPipelineStage\n *\n * @private\n */\nconst TilesetPipelineStage = {\n  name: \"TilesetPipelineStage\", // Helps with debugging\n};\n\n/**\n * Process a model. This modifies the following parts of the render resources:\n *\n * <ul>\n *  <li>adds a define to the fragment shader to indicate that the model uses polygon offset for the skipLevelOfDetail optimization</li>\n *  <li>adds a function to the uniform map to supply polygon offset values for the skipLevelOfDetail optimization</li>\n *  <li>sets stencil values that enable classification on 3D Tiles</li>\n * </ul>\n *\n * <p>\n * See {@link ModelDrawCommand} for the corresponding skipLevelOfDetail derived commands.\n * </p>\n *\n * @param {ModelRenderResources} renderResources The render resources for this model.\n * @param {ModelExperimental} model The model.\n * @param {FrameState} frameState The frameState.\n *\n * @private\n */\nTilesetPipelineStage.process = function (renderResources, model, frameState) {\n  if (model.hasSkipLevelOfDetail(frameState)) {\n    // Make the log-depth depth fragment write account for the polygon offset, too.\n    // Otherwise, the back face commands will cause the higher resolution\n    // tiles to disappear.\n    const shaderBuilder = renderResources.shaderBuilder;\n    shaderBuilder.addDefine(\n      \"POLYGON_OFFSET\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n\n    // This value will be overriden by the depth-only back face derived command.\n    // We just prepare it in advance so we don't have to recompile the shader.\n    // We don't add a uniform declaration through ShaderBuilder because\n    // this is included in writeLogDepth.glsl\n    const uniformMap = {\n      u_polygonOffset: function () {\n        return Cartesian2.ZERO;\n      },\n    };\n\n    renderResources.uniformMap = combine(\n      uniformMap,\n      renderResources.uniformMap\n    );\n    renderResources.hasSkipLevelOfDetail = true;\n  }\n\n  // Set stencil values for classification on 3D Tiles. This is applied to all\n  // of the derived commands, not just the back-face derived command.\n  const renderStateOptions = renderResources.renderStateOptions;\n  renderStateOptions.stencilTest = StencilConstants.setCesium3DTileBit();\n  renderStateOptions.stencilMask = StencilConstants.CESIUM_3D_TILE_MASK;\n};\n\nexport default TilesetPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 proceduralIBL(\\n\\\n    vec3 positionEC,\\n\\\n    vec3 normalEC,\\n\\\n    vec3 lightDirectionEC,\\n\\\n    vec3 lightColorHdr,\\n\\\n    czm_pbrParameters pbrParameters\\n\\\n) {\\n\\\n    vec3 v = -positionEC;\\n\\\n    vec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0));\\n\\\n    vec3 vWC = -normalize(positionWC);\\n\\\n    vec3 l = normalize(lightDirectionEC);\\n\\\n    vec3 n = normalEC;\\n\\\n    vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\\n\\\n\\n\\\n    float NdotL = clamp(dot(n, l), 0.001, 1.0);\\n\\\n    float NdotV = abs(dot(n, v)) + 0.001;\\n\\\n\\n\\\n    // Figure out if the reflection vector hits the ellipsoid\\n\\\n    float vertexRadius = length(positionWC);\\n\\\n    float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);\\n\\\n    float reflectionDotNadir = dot(r, normalize(positionWC));\\n\\\n    // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z.\\n\\\n    r.x = -r.x;\\n\\\n    r = -normalize(czm_temeToPseudoFixed * r);\\n\\\n    r.x = -r.x;\\n\\\n\\n\\\n    vec3 diffuseColor = pbrParameters.diffuseColor;\\n\\\n    float roughness = pbrParameters.roughness;\\n\\\n    vec3 specularColor = pbrParameters.f0;\\n\\\n\\n\\\n    float inverseRoughness = 1.04 - roughness;\\n\\\n    inverseRoughness *= inverseRoughness;\\n\\\n    vec3 sceneSkyBox = czm_textureCube(czm_environmentMap, r).rgb * inverseRoughness;\\n\\\n\\n\\\n    float atmosphereHeight = 0.05;\\n\\\n    float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\\n\\\n    float blendRegionOffset = roughness * -1.0;\\n\\\n    float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\\n\\\n    float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\\n\\\n    float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\\n\\\n    float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\\n\\\n    vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\\n\\\n    vec3 nadirColor = belowHorizonColor * 0.5;\\n\\\n    vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\\n\\\n    vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\\n\\\n    vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\\n\\\n    vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); \\n\\\n    float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;  \\n\\\n    float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\\n\\\n    vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\\n\\\n    float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\\n\\\n    vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\\n\\\n    specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\\n\\\n    specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\\n\\\n\\n\\\n    // Luminance model from page 40 of http://silviojemma.com/public/papers/lighting/spherical-harmonic-lighting.pdf\\n\\\n    #ifdef USE_SUN_LUMINANCE \\n\\\n    // Angle between sun and zenith\\n\\\n    float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), vWC), 0.001, 1.0);\\n\\\n    float S = acos(LdotZenith);\\n\\\n    // Angle between zenith and current pixel\\n\\\n    float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), vWC), 0.001, 1.0);\\n\\\n    // Angle between sun and current pixel\\n\\\n    float gamma = acos(NdotL);\\n\\\n    float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\\n\\\n    float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\\n\\\n    float luminance = model_luminanceAtZenith * (numerator / denominator);\\n\\\n    #endif \\n\\\n\\n\\\n    vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;\\n\\\n    vec3 iblColor = (diffuseIrradiance * diffuseColor * model_iblFactor.x) + (specularIrradiance * czm_srgbToLinear(specularColor * brdfLut.x + brdfLut.y) * model_iblFactor.y);\\n\\\n    float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);\\n\\\n    vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);\\n\\\n    iblColor *= lightColor;\\n\\\n\\n\\\n    #ifdef USE_SUN_LUMINANCE \\n\\\n    iblColor *= luminance;\\n\\\n    #endif\\n\\\n\\n\\\n    return iblColor;\\n\\\n}\\n\\\n\\n\\\n#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)\\n\\\nvec3 textureIBL(\\n\\\n    vec3 positionEC,\\n\\\n    vec3 normalEC,\\n\\\n    vec3 lightDirectionEC,\\n\\\n    czm_pbrParameters pbrParameters\\n\\\n) {\\n\\\n    vec3 diffuseColor = pbrParameters.diffuseColor;\\n\\\n    float roughness = pbrParameters.roughness;\\n\\\n    vec3 specularColor = pbrParameters.f0;\\n\\\n\\n\\\n    vec3 v = -positionEC;\\n\\\n    vec3 n = normalEC;\\n\\\n    vec3 l = normalize(lightDirectionEC);\\n\\\n    vec3 h = normalize(v + l);\\n\\\n\\n\\\n    float NdotV = abs(dot(n, v)) + 0.001;\\n\\\n    float VdotH = clamp(dot(v, h), 0.0, 1.0);\\n\\\n\\n\\\n    const mat3 yUpToZUp = mat3(\\n\\\n        -1.0, 0.0, 0.0,\\n\\\n        0.0, 0.0, -1.0, \\n\\\n        0.0, 1.0, 0.0\\n\\\n    ); \\n\\\n    vec3 cubeDir = normalize(yUpToZUp * model_iblReferenceFrameMatrix * normalize(reflect(-v, n))); \\n\\\n\\n\\\n    #ifdef DIFFUSE_IBL \\n\\\n        #ifdef CUSTOM_SPHERICAL_HARMONICS\\n\\\n        vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); \\n\\\n        #else\\n\\\n        vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); \\n\\\n        #endif \\n\\\n    #else \\n\\\n    vec3 diffuseIrradiance = vec3(0.0); \\n\\\n    #endif \\n\\\n\\n\\\n    #ifdef SPECULAR_IBL\\n\\\n    vec3 r0 = specularColor.rgb;\\n\\\n    float reflectance = max(max(r0.r, r0.g), r0.b);\\n\\\n    vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\\n\\\n    vec3 F = fresnelSchlick2(r0, r90, VdotH);\\n\\\n    \\n\\\n    vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;\\n\\\n      #ifdef CUSTOM_SPECULAR_IBL \\n\\\n      vec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD);\\n\\\n      #else \\n\\\n      vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir,  roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);\\n\\\n      #endif \\n\\\n    specularIBL *= F * brdfLut.x + brdfLut.y;\\n\\\n    #else \\n\\\n    vec3 specularIBL = vec3(0.0); \\n\\\n    #endif\\n\\\n\\n\\\n    return diffuseColor * diffuseIrradiance + specularColor * specularIBL;\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\nvec3 imageBasedLightingStage(\\n\\\n    vec3 positionEC,\\n\\\n    vec3 normalEC,\\n\\\n    vec3 lightDirectionEC,\\n\\\n    vec3 lightColorHdr,\\n\\\n    czm_pbrParameters pbrParameters\\n\\\n) {\\n\\\n  #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)\\n\\\n  // Environment maps were provided, use them for IBL\\n\\\n  return textureIBL(\\n\\\n      positionEC,\\n\\\n      normalEC,\\n\\\n      lightDirectionEC,\\n\\\n      pbrParameters\\n\\\n  );\\n\\\n  #else\\n\\\n  // Use the procedural IBL if there are no environment maps\\n\\\n  return proceduralIBL(\\n\\\n      positionEC,\\n\\\n      normalEC,\\n\\\n      lightDirectionEC,\\n\\\n      lightColorHdr,\\n\\\n      pbrParameters\\n\\\n  );\\n\\\n  #endif\\n\\\n}\";\n", "import combine from \"../../Core/combine.js\";\nimport defined from \"../../Core/defined.js\";\nimport ImageBasedLightingStageFS from \"../../Shaders/Model/ImageBasedLightingStageFS.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport OctahedralProjectedCubeMap from \"../OctahedralProjectedCubeMap.js\";\n\nconst ImageBasedLightingPipelineStage = {\n  name: \"ImageBasedLightingPipelineStage\", // Helps with debugging\n};\n\nImageBasedLightingPipelineStage.process = function (\n  renderResources,\n  model,\n  frameState\n) {\n  const imageBasedLighting = model.imageBasedLighting;\n  const shaderBuilder = renderResources.shaderBuilder;\n\n  shaderBuilder.addDefine(\n    \"USE_IBL_LIGHTING\",\n    undefined,\n    ShaderDestination.FRAGMENT\n  );\n  shaderBuilder.addUniform(\n    \"vec2\",\n    \"model_iblFactor\",\n    ShaderDestination.FRAGMENT\n  );\n\n  if (OctahedralProjectedCubeMap.isSupported(frameState.context)) {\n    const addMatrix =\n      imageBasedLighting.useSphericalHarmonics ||\n      imageBasedLighting.useSpecularEnvironmentMaps ||\n      imageBasedLighting.enabled;\n    if (addMatrix) {\n      shaderBuilder.addUniform(\n        \"mat3\",\n        \"model_iblReferenceFrameMatrix\",\n        ShaderDestination.FRAGMENT\n      );\n    }\n\n    if (defined(imageBasedLighting.sphericalHarmonicCoefficients)) {\n      shaderBuilder.addDefine(\n        \"DIFFUSE_IBL\",\n        undefined,\n        ShaderDestination.FRAGMENT\n      );\n      shaderBuilder.addDefine(\n        \"CUSTOM_SPHERICAL_HARMONICS\",\n        undefined,\n        ShaderDestination.FRAGMENT\n      );\n      shaderBuilder.addUniform(\n        \"vec3\",\n        \"model_sphericalHarmonicCoefficients[9]\",\n        ShaderDestination.FRAGMENT\n      );\n    } else if (imageBasedLighting.useDefaultSphericalHarmonics) {\n      shaderBuilder.addDefine(\n        \"DIFFUSE_IBL\",\n        undefined,\n        ShaderDestination.FRAGMENT\n      );\n    }\n\n    if (\n      defined(imageBasedLighting.specularEnvironmentMapAtlas) &&\n      imageBasedLighting.specularEnvironmentMapAtlas.ready\n    ) {\n      shaderBuilder.addDefine(\n        \"SPECULAR_IBL\",\n        undefined,\n        ShaderDestination.FRAGMENT\n      );\n      shaderBuilder.addDefine(\n        \"CUSTOM_SPECULAR_IBL\",\n        undefined,\n        ShaderDestination.FRAGMENT\n      );\n      shaderBuilder.addUniform(\n        \"sampler2D\",\n        \"model_specularEnvironmentMaps\",\n        ShaderDestination.FRAGMENT\n      );\n      shaderBuilder.addUniform(\n        \"vec2\",\n        \"model_specularEnvironmentMapsSize\",\n        ShaderDestination.FRAGMENT\n      );\n      shaderBuilder.addUniform(\n        \"float\",\n        \"model_specularEnvironmentMapsMaximumLOD\",\n        ShaderDestination.FRAGMENT\n      );\n    } else if (model.useDefaultSpecularMaps) {\n      shaderBuilder.addDefine(\n        \"SPECULAR_IBL\",\n        undefined,\n        ShaderDestination.FRAGMENT\n      );\n    }\n  }\n\n  if (defined(imageBasedLighting.luminanceAtZenith)) {\n    shaderBuilder.addDefine(\n      \"USE_SUN_LUMINANCE\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n    shaderBuilder.addUniform(\n      \"float\",\n      \"model_luminanceAtZenith\",\n      ShaderDestination.FRAGMENT\n    );\n  }\n\n  shaderBuilder.addFragmentLines(ImageBasedLightingStageFS);\n\n  const uniformMap = {\n    model_iblFactor: function () {\n      return imageBasedLighting.imageBasedLightingFactor;\n    },\n    model_iblReferenceFrameMatrix: function () {\n      return model._iblReferenceFrameMatrix;\n    },\n    model_luminanceAtZenith: function () {\n      return imageBasedLighting.luminanceAtZenith;\n    },\n    model_sphericalHarmonicCoefficients: function () {\n      return imageBasedLighting.sphericalHarmonicCoefficients;\n    },\n    model_specularEnvironmentMaps: function () {\n      return imageBasedLighting.specularEnvironmentMapAtlas.texture;\n    },\n    model_specularEnvironmentMapsSize: function () {\n      return imageBasedLighting.specularEnvironmentMapAtlas.texture.dimensions;\n    },\n    model_specularEnvironmentMapsMaximumLOD: function () {\n      return imageBasedLighting.specularEnvironmentMapAtlas.maximumMipmapLevel;\n    },\n  };\n\n  renderResources.uniformMap = combine(uniformMap, renderResources.uniformMap);\n};\n\nexport default ImageBasedLightingPipelineStage;\n", "import ArticulationStageType from \"../../Core/ArticulationStageType.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport CesiumMath from \"../../Core/Math.js\";\nimport Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport Matrix3 from \"../../Core/Matrix3.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\n\nconst articulationEpsilon = CesiumMath.EPSILON16;\n\n/**\n * An in-memory representation of an articulation stage belonging to a\n * {@link ModelArticulation}.\n *\n * @param {object} options An object containing the following options:\n * @param {ModelComponents.ArticulationStage} options.stage The articulation stage components from the 3D model.\n * @param {ModelArticulation} options.runtimeArticulation The runtime articulation that this stage belongs to.\n *\n * @alias ModelArticulationStage\n * @constructor\n *\n * @private\n */\nfunction ModelArticulationStage(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const stage = options.stage;\n  const runtimeArticulation = options.runtimeArticulation;\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.stage\", stage);\n  Check.typeOf.object(\"options.runtimeArticulation\", runtimeArticulation);\n  //>>includeEnd('debug');\n\n  this._stage = stage;\n  this._runtimeArticulation = runtimeArticulation;\n\n  this._name = stage.name;\n  this._type = stage.type;\n  this._minimumValue = stage.minimumValue;\n  this._maximumValue = stage.maximumValue;\n  this._currentValue = stage.initialValue;\n}\n\nObject.defineProperties(ModelArticulationStage.prototype, {\n  /**\n   * The internal articulation stage that this runtime stage represents.\n   *\n   * @memberof ModelArticulationStage.prototype\n   * @type {ModelComponents.ArticulationStage}\n   * @readonly\n   *\n   * @private\n   */\n  stage: {\n    get: function () {\n      return this._stage;\n    },\n  },\n\n  /**\n   * The runtime articulation that this stage belongs to.\n   *\n   * @memberof ModelArticulationStage.prototype\n   * @type {ModelArticulation}\n   * @readonly\n   *\n   * @private\n   */\n  runtimeArticulation: {\n    get: function () {\n      return this._runtimeArticulation;\n    },\n  },\n\n  /**\n   * The name of this articulation stage.\n   *\n   * @memberof ModelArticulationStage.prototype\n   * @type {string}\n   * @readonly\n   *\n   * @private\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n\n  /**\n   * The type of this articulation stage. This specifies which of the\n   * node's properties is modified by the stage's value.\n   *\n   * @memberof ModelArticulationStage.prototype\n   * @type {ArticulationStageType}\n   * @readonly\n   *\n   * @private\n   */\n  type: {\n    get: function () {\n      return this._type;\n    },\n  },\n\n  /**\n   * The minimum value of this articulation stage.\n   *\n   * @memberof ModelArticulationStage.prototype\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  minimumValue: {\n    get: function () {\n      return this._minimumValue;\n    },\n  },\n\n  /**\n   * The maximum value of this articulation stage.\n   *\n   * @memberof ModelArticulationStage.prototype\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  maximumValue: {\n    get: function () {\n      return this._maximumValue;\n    },\n  },\n\n  /**\n   * The current value of this articulation stage.\n   *\n   * @memberof ModelArticulationStage.prototype\n   * @type {number}\n   *\n   * @private\n   */\n  currentValue: {\n    get: function () {\n      return this._currentValue;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number(\"value\", value);\n      //>>includeEnd('debug');\n\n      value = CesiumMath.clamp(value, this.minimumValue, this.maximumValue);\n      if (\n        !CesiumMath.equalsEpsilon(\n          this._currentValue,\n          value,\n          articulationEpsilon\n        )\n      ) {\n        this._currentValue = value;\n        this.runtimeArticulation._dirty = true;\n      }\n    },\n  },\n});\n\nconst scratchArticulationCartesian = new Cartesian3();\nconst scratchArticulationRotation = new Matrix3();\n\n/**\n * Modifies a Matrix4 by applying a transformation for a given value of a stage.\n * Note that the <code>result</code> parameter is not just a container for the\n * returned value. The incoming value of <code>result</code> is part of the\n * computation itself. Various stages of an articulation can be multiplied\n * together, so their transformations are all merged into a composite Matrix4\n * representing them all.\n *\n * @param {Matrix4} result The matrix to be modified.\n * @returns {Matrix4} The transformed matrix as requested by the articulation stage.\n *\n * @private\n */\nModelArticulationStage.prototype.applyStageToMatrix = function (result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const type = this.type;\n  const value = this.currentValue;\n  const cartesian = scratchArticulationCartesian;\n  let rotation;\n  switch (type) {\n    case ArticulationStageType.XROTATE:\n      rotation = Matrix3.fromRotationX(\n        CesiumMath.toRadians(value),\n        scratchArticulationRotation\n      );\n      result = Matrix4.multiplyByMatrix3(result, rotation, result);\n      break;\n    case ArticulationStageType.YROTATE:\n      rotation = Matrix3.fromRotationY(\n        CesiumMath.toRadians(value),\n        scratchArticulationRotation\n      );\n      result = Matrix4.multiplyByMatrix3(result, rotation, result);\n      break;\n    case ArticulationStageType.ZROTATE:\n      rotation = Matrix3.fromRotationZ(\n        CesiumMath.toRadians(value),\n        scratchArticulationRotation\n      );\n      result = Matrix4.multiplyByMatrix3(result, rotation, result);\n      break;\n    case ArticulationStageType.XTRANSLATE:\n      cartesian.x = value;\n      cartesian.y = 0.0;\n      cartesian.z = 0.0;\n      result = Matrix4.multiplyByTranslation(result, cartesian, result);\n      break;\n    case ArticulationStageType.YTRANSLATE:\n      cartesian.x = 0.0;\n      cartesian.y = value;\n      cartesian.z = 0.0;\n      result = Matrix4.multiplyByTranslation(result, cartesian, result);\n      break;\n    case ArticulationStageType.ZTRANSLATE:\n      cartesian.x = 0.0;\n      cartesian.y = 0.0;\n      cartesian.z = value;\n      result = Matrix4.multiplyByTranslation(result, cartesian, result);\n      break;\n    case ArticulationStageType.XSCALE:\n      cartesian.x = value;\n      cartesian.y = 1.0;\n      cartesian.z = 1.0;\n      result = Matrix4.multiplyByScale(result, cartesian, result);\n      break;\n    case ArticulationStageType.YSCALE:\n      cartesian.x = 1.0;\n      cartesian.y = value;\n      cartesian.z = 1.0;\n      result = Matrix4.multiplyByScale(result, cartesian, result);\n      break;\n    case ArticulationStageType.ZSCALE:\n      cartesian.x = 1.0;\n      cartesian.y = 1.0;\n      cartesian.z = value;\n      result = Matrix4.multiplyByScale(result, cartesian, result);\n      break;\n    case ArticulationStageType.UNIFORMSCALE:\n      result = Matrix4.multiplyByUniformScale(result, value, result);\n      break;\n    default:\n      break;\n  }\n\n  return result;\n};\n\nexport default ModelArticulationStage;\n", "import Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport ModelArticulationStage from \"./ModelArticulationStage.js\";\n\n/**\n * An in-memory representation of an articulation that affects nodes in the\n * {@link ModelSceneGraph}. This is defined in a model by the\n * <code>AGI_articulations</code> extension.\n *\n * @param {object} options An object containing the following options:\n * @param {ModelComponents.Articulation} options.articulation The articulation components from the 3D model.\n * @param {ModelSceneGraph} options.sceneGraph The scene graph this articulation belongs to.\n *\n * @alias ModelArticulation\n * @constructor\n *\n * @private\n */\nfunction ModelArticulation(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const articulation = options.articulation;\n  const sceneGraph = options.sceneGraph;\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.articulation\", articulation);\n  Check.typeOf.object(\"options.sceneGraph\", sceneGraph);\n  //>>includeEnd('debug');\n\n  this._articulation = articulation;\n  this._sceneGraph = sceneGraph;\n\n  this._name = articulation.name;\n  this._runtimeStages = [];\n  this._runtimeStagesByName = {};\n\n  // Will be populated as the runtime nodes are created\n  this._runtimeNodes = [];\n\n  // Set to true so that the first call to\n  // ModelSceneGraph.applyArticulations will work.\n  this._dirty = true;\n\n  initialize(this);\n}\n\nObject.defineProperties(ModelArticulation.prototype, {\n  /**\n   * The internal articulation that this runtime articulation represents.\n   *\n   * @memberof ModelArticulation.prototype\n   * @type {ModelComponents.Articulation}\n   * @readonly\n   *\n   * @private\n   */\n  articulation: {\n    get: function () {\n      return this._articulation;\n    },\n  },\n\n  /**\n   * The scene graph that this articulation belongs to.\n   *\n   * @memberof ModelArticulation.prototype\n   * @type {ModelSceneGraph}\n   * @readonly\n   *\n   * @private\n   */\n  sceneGraph: {\n    get: function () {\n      return this._sceneGraph;\n    },\n  },\n\n  /**\n   * The name of this articulation.\n   *\n   * @memberof ModelArticulation.prototype\n   * @type {string}\n   * @readonly\n   *\n   * @private\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n\n  /**\n   * The runtime stages that belong to this articulation.\n   *\n   * @memberof ModelArticulation.prototype\n   * @type {ModelArticulationStage[]}\n   * @readonly\n   *\n   * @private\n   */\n  runtimeStages: {\n    get: function () {\n      return this._runtimeStages;\n    },\n  },\n\n  /**\n   * The runtime nodes that are affected by this articulation.\n   *\n   * @memberof ModelArticulation.prototype\n   * @type {ModelRuntimeNode[]}\n   * @readonly\n   *\n   * @private\n   */\n  runtimeNodes: {\n    get: function () {\n      return this._runtimeNodes;\n    },\n  },\n});\n\nfunction initialize(runtimeArticulation) {\n  const articulation = runtimeArticulation.articulation;\n\n  const stages = articulation.stages;\n  const length = stages.length;\n\n  const runtimeStages = runtimeArticulation._runtimeStages;\n  const runtimeStagesByName = runtimeArticulation._runtimeStagesByName;\n  for (let i = 0; i < length; i++) {\n    const stage = stages[i];\n    const runtimeStage = new ModelArticulationStage({\n      stage: stage,\n      runtimeArticulation: runtimeArticulation,\n    });\n\n    // Store the stages in an array to preserve the order in which\n    // they appeared in the 3D model.\n    runtimeStages.push(runtimeStage);\n\n    // Store the stages in a dictionary for retrieval by name.\n    const stageName = stage.name;\n    runtimeStagesByName[stageName] = runtimeStage;\n  }\n}\n\n/**\n * Sets the current value of an articulation stage.\n *\n * @param {string} stageName The name of the articulation stage.\n * @param {number} value The numeric value of this stage of the articulation.\n *\n * @private\n */\nModelArticulation.prototype.setArticulationStage = function (stageName, value) {\n  const stage = this._runtimeStagesByName[stageName];\n  if (defined(stage)) {\n    stage.currentValue = value;\n  }\n};\n\nconst scratchArticulationMatrix = new Matrix4();\nconst scratchNodeMatrix = new Matrix4();\n\n/**\n * Applies the chain of articulation stages to the transform of each node that\n * participates in the articulation. This only recomputes the node transforms\n * if any stage in the articulation has been modified.\n * <p>\n * Note that this will overwrite any existing transformations on participating\n * nodes.\n * </p>\n *\n * @private\n */\nModelArticulation.prototype.apply = function () {\n  if (!this._dirty) {\n    return;\n  }\n  this._dirty = false;\n\n  let articulationMatrix = Matrix4.clone(\n    Matrix4.IDENTITY,\n    scratchArticulationMatrix\n  );\n\n  let i;\n  const stages = this._runtimeStages;\n  const stagesLength = stages.length;\n\n  // Compute the result of the articulation stages...\n  for (i = 0; i < stagesLength; i++) {\n    const stage = stages[i];\n    articulationMatrix = stage.applyStageToMatrix(articulationMatrix);\n  }\n\n  // ...then apply it to the transforms of the affected nodes.\n  const nodes = this._runtimeNodes;\n  const nodesLength = nodes.length;\n  for (i = 0; i < nodesLength; i++) {\n    const node = nodes[i];\n    const transform = Matrix4.multiplyTransformation(\n      node.originalTransform,\n      articulationMatrix,\n      scratchNodeMatrix\n    );\n    node.transform = transform;\n  }\n};\n\nexport default ModelArticulation;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void modelColorStage(inout czm_modelMaterial material)\\n\\\n{\\n\\\n    material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend);\\n\\\n    float highlight = ceil(model_colorBlend);\\n\\\n    material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight);\\n\\\n    material.alpha *= model_color.a;\\n\\\n}\";\n", "import ColorBlendMode from \"../ColorBlendMode.js\";\nimport combine from \"../../Core/combine.js\";\nimport ModelColorStageFS from \"../../Shaders/Model/ModelColorStageFS.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\n\n/**\n * The model color pipeline stage is responsible for handling the application of a static color to the model.\n *\n * @namespace ModelColorPipelineStage\n *\n * @private\n */\nconst ModelColorPipelineStage = {\n  name: \"ModelColorPipelineStage\", // Helps with debugging\n\n  COLOR_UNIFORM_NAME: \"model_color\",\n  COLOR_BLEND_UNIFORM_NAME: \"model_colorBlend\",\n};\n\n/**\n * Process a model. This modifies the following parts of the render resources:\n *\n * <ul>\n *  <li>adds a define to the fragment shader to indicate that the model has a color</li>\n *  <li>adds a function to the fragment shader to apply the color to the model's base color</li>\n *  <li>adds the uniforms for the fragment shader for the model's color and blending properties</li>\n *  <li>updates the pass type in the render resources based on translucency of the model's color</li>\n *</ul>\n *\n * @param {ModelRenderResources} renderResources The render resources for this model.\n * @param {Model} model The model.\n * @param {FrameState} frameState The frameState.\n *\n * @private\n */\nModelColorPipelineStage.process = function (\n  renderResources,\n  model,\n  frameState\n) {\n  const shaderBuilder = renderResources.shaderBuilder;\n\n  shaderBuilder.addDefine(\n    \"HAS_MODEL_COLOR\",\n    undefined,\n    ShaderDestination.FRAGMENT\n  );\n  shaderBuilder.addFragmentLines(ModelColorStageFS);\n\n  const stageUniforms = {};\n\n  // Pass the model's color as a uniform. Set the pass type to translucent, if needed.\n  const color = model.color;\n\n  if (color.alpha === 0.0 && !model.hasSilhouette(frameState)) {\n    renderResources.renderStateOptions.colorMask = {\n      red: false,\n      green: false,\n      blue: false,\n      alpha: false,\n    };\n  }\n\n  if (color.alpha < 1.0) {\n    renderResources.alphaOptions.pass = Pass.TRANSLUCENT;\n  }\n\n  shaderBuilder.addUniform(\n    \"vec4\",\n    ModelColorPipelineStage.COLOR_UNIFORM_NAME,\n    ShaderDestination.FRAGMENT\n  );\n  stageUniforms[ModelColorPipelineStage.COLOR_UNIFORM_NAME] = function () {\n    return model.color;\n  };\n\n  // Create a colorBlend from the model's colorBlendMode and colorBlendAmount and pass it as a uniform.\n  shaderBuilder.addUniform(\n    \"float\",\n    ModelColorPipelineStage.COLOR_BLEND_UNIFORM_NAME,\n    ShaderDestination.FRAGMENT\n  );\n  stageUniforms[\n    ModelColorPipelineStage.COLOR_BLEND_UNIFORM_NAME\n  ] = function () {\n    return ColorBlendMode.getColorBlend(\n      model.colorBlendMode,\n      model.colorBlendAmount\n    );\n  };\n\n  renderResources.uniformMap = combine(\n    stageUniforms,\n    renderResources.uniformMap\n  );\n};\n\nexport default ModelColorPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE\\n\\\nvec4 getClippingPlane(\\n\\\n    highp sampler2D packedClippingPlanes,\\n\\\n    int clippingPlaneNumber,\\n\\\n    mat4 transform\\n\\\n) {\\n\\\n    int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH;\\n\\\n    int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);\\n\\\n    float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);\\n\\\n    float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);\\n\\\n    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel\\n\\\n    float v = (float(pixY) + 0.5) * pixelHeight;\\n\\\n    vec4 plane = texture(packedClippingPlanes, vec2(u, v));\\n\\\n    return czm_transformPlane(plane, transform);\\n\\\n}\\n\\\n#else\\n\\\n// Handle uint8 clipping texture instead\\n\\\nvec4 getClippingPlane(\\n\\\n    highp sampler2D packedClippingPlanes,\\n\\\n    int clippingPlaneNumber,\\n\\\n    mat4 transform\\n\\\n) {\\n\\\n    int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each\\n\\\n    int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH;\\n\\\n    int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);\\n\\\n    float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);\\n\\\n    float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);\\n\\\n    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel\\n\\\n    float v = (float(pixY) + 0.5) * pixelHeight;\\n\\\n    vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;\\n\\\n    vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);\\n\\\n    vec4 plane;\\n\\\n    plane.xyz = czm_octDecode(oct, 65535.0);\\n\\\n    plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v)));\\n\\\n    return czm_transformPlane(plane, transform);\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\nfloat clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) {\\n\\\n    vec4 position = czm_windowToEyeCoordinates(fragCoord);\\n\\\n    vec3 clipNormal = vec3(0.0);\\n\\\n    vec3 clipPosition = vec3(0.0);\\n\\\n    float pixelWidth = czm_metersPerPixel(position);\\n\\\n    \\n\\\n    #ifdef UNION_CLIPPING_REGIONS\\n\\\n    float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below.\\n\\\n    #else\\n\\\n    float clipAmount = 0.0;\\n\\\n    bool clipped = true;\\n\\\n    #endif\\n\\\n\\n\\\n    for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) {\\n\\\n        vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\\n\\\n        clipNormal = clippingPlane.xyz;\\n\\\n        clipPosition = -clippingPlane.w * clipNormal;\\n\\\n        float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\\n\\\n        \\n\\\n        #ifdef UNION_CLIPPING_REGIONS\\n\\\n        clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));\\n\\\n        if (amount <= 0.0) {\\n\\\n            discard;\\n\\\n        }\\n\\\n        #else\\n\\\n        clipAmount = max(amount, clipAmount);\\n\\\n        clipped = clipped && (amount <= 0.0);\\n\\\n        #endif\\n\\\n    }\\n\\\n\\n\\\n    #ifndef UNION_CLIPPING_REGIONS\\n\\\n    if (clipped) {\\n\\\n        discard;\\n\\\n    }\\n\\\n    #endif\\n\\\n    \\n\\\n    return clipAmount;\\n\\\n}\\n\\\n\\n\\\nvoid modelClippingPlanesStage(inout vec4 color)\\n\\\n{\\n\\\n    float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix);\\n\\\n    vec4 clippingPlanesEdgeColor = vec4(1.0);\\n\\\n    clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb;\\n\\\n    float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a;\\n\\\n    \\n\\\n    if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) {\\n\\\n        color = clippingPlanesEdgeColor;\\n\\\n    }\\n\\\n}\\n\\\n\";\n", "import Cartesian2 from \"../../Core/Cartesian2.js\";\nimport ClippingPlaneCollection from \"../ClippingPlaneCollection.js\";\nimport combine from \"../../Core/combine.js\";\nimport Color from \"../../Core/Color.js\";\nimport ModelClippingPlanesStageFS from \"../../Shaders/Model/ModelClippingPlanesStageFS.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\n\n/**\n * The model clipping planes stage is responsible for applying clipping planes to the model.\n *\n * @namespace ModelClippingPlanesPipelineStage\n *\n * @private\n */\nconst ModelClippingPlanesPipelineStage = {\n  name: \"ModelClippingPlanesPipelineStage\", // Helps with debugging\n};\n\nconst textureResolutionScratch = new Cartesian2();\n/**\n * Process a model. This modifies the following parts of the render resources:\n *\n * <ul>\n *  <li>adds a define to the fragment shader to indicate that the model has clipping planes</li>\n *  <li>adds the defines to the fragment shader for parameters related to clipping planes, such as the number of planes</li>\n *  <li>adds a function to the fragment shader to apply the clipping planes to the model's base color</li>\n *  <li>adds the uniforms for the fragment shader for the clipping plane texture and matrix</li>\n *</ul>\n *\n * @param {ModelRenderResources} renderResources The render resources for this model.\n * @param {Model} model The model.\n * @param {FrameState} frameState The frameState.\n *\n * @private\n */\nModelClippingPlanesPipelineStage.process = function (\n  renderResources,\n  model,\n  frameState\n) {\n  const clippingPlanes = model.clippingPlanes;\n  const context = frameState.context;\n  const shaderBuilder = renderResources.shaderBuilder;\n\n  shaderBuilder.addDefine(\n    \"HAS_CLIPPING_PLANES\",\n    undefined,\n    ShaderDestination.FRAGMENT\n  );\n\n  shaderBuilder.addDefine(\n    \"CLIPPING_PLANES_LENGTH\",\n    clippingPlanes.length,\n    ShaderDestination.FRAGMENT\n  );\n\n  if (clippingPlanes.unionClippingRegions) {\n    shaderBuilder.addDefine(\n      \"UNION_CLIPPING_REGIONS\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n  }\n\n  if (ClippingPlaneCollection.useFloatTexture(context)) {\n    shaderBuilder.addDefine(\n      \"USE_CLIPPING_PLANES_FLOAT_TEXTURE\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n  }\n\n  const textureResolution = ClippingPlaneCollection.getTextureResolution(\n    clippingPlanes,\n    context,\n    textureResolutionScratch\n  );\n\n  shaderBuilder.addDefine(\n    \"CLIPPING_PLANES_TEXTURE_WIDTH\",\n    textureResolution.x,\n    ShaderDestination.FRAGMENT\n  );\n\n  shaderBuilder.addDefine(\n    \"CLIPPING_PLANES_TEXTURE_HEIGHT\",\n    textureResolution.y,\n    ShaderDestination.FRAGMENT\n  );\n\n  shaderBuilder.addUniform(\n    \"sampler2D\",\n    \"model_clippingPlanes\",\n    ShaderDestination.FRAGMENT\n  );\n  shaderBuilder.addUniform(\n    \"vec4\",\n    \"model_clippingPlanesEdgeStyle\",\n    ShaderDestination.FRAGMENT\n  );\n  shaderBuilder.addUniform(\n    \"mat4\",\n    \"model_clippingPlanesMatrix\",\n    ShaderDestination.FRAGMENT\n  );\n\n  shaderBuilder.addFragmentLines(ModelClippingPlanesStageFS);\n\n  const uniformMap = {\n    model_clippingPlanes: function () {\n      return clippingPlanes.texture;\n    },\n    model_clippingPlanesEdgeStyle: function () {\n      const style = Color.clone(clippingPlanes.edgeColor);\n      style.alpha = clippingPlanes.edgeWidth;\n      return style;\n    },\n    model_clippingPlanesMatrix: function () {\n      return model._clippingPlanesMatrix;\n    },\n  };\n\n  renderResources.uniformMap = combine(uniformMap, renderResources.uniformMap);\n};\n\nexport default ModelClippingPlanesPipelineStage;\n", "import Check from \"../../Core/Check.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * <div class=\"notice\">\n * Use {@link Model#getNode} to get a node from a loaded model. Do not call the constructor directly.\n * </div>\n *\n * A model node with a modifiable transform to allow users to define their\n * own animations. While a model's asset can contain animations that target\n * a node's transform, this class allows users to change a node's transform\n * externally. In this way, animation can be driven by another source, not\n * just by the model's asset.\n *\n * @alias ModelNode\n * @internalConstructor\n * @class\n *\n * @example\n * const node = model.getNode(\"Hand\");\n * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);\n *\n * @see Model#getNode\n */\nfunction ModelNode(model, runtimeNode) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"model\", model);\n  Check.typeOf.object(\"runtimeNode\", runtimeNode);\n  //>>includeEnd('debug')\n\n  this._model = model;\n  this._runtimeNode = runtimeNode;\n}\n\nObject.defineProperties(ModelNode.prototype, {\n  /**\n   * The value of the <code>name</code> property of this node.\n   *\n   * @memberof ModelNode.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  name: {\n    get: function () {\n      return this._runtimeNode._name;\n    },\n  },\n\n  /**\n   * The index of the node in the glTF.\n   *\n   * @memberof ModelNode.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  id: {\n    get: function () {\n      return this._runtimeNode._id;\n    },\n  },\n\n  /**\n   * Determines if this node and its children will be shown.\n   *\n   * @memberof ModelNode.prototype\n   * @type {boolean}\n   *\n   * @default true\n   */\n  show: {\n    get: function () {\n      return this._runtimeNode.show;\n    },\n    set: function (value) {\n      this._runtimeNode.show = value;\n    },\n  },\n\n  /**\n   * The node's 4x4 matrix transform from its local coordinates to\n   * its parent's. Setting the matrix to undefined will restore the\n   * node's original transform, and allow the node to be animated by\n   * any animations in the model again.\n   * <p>\n   * For changes to take effect, this property must be assigned to;\n   * setting individual elements of the matrix will not work.\n   * </p>\n   *\n   * @memberof ModelNode.prototype\n   * @type {Matrix4}\n   */\n  matrix: {\n    get: function () {\n      return this._runtimeNode.transform;\n    },\n    set: function (value) {\n      if (defined(value)) {\n        this._runtimeNode.transform = value;\n        this._runtimeNode.userAnimated = true;\n        this._model._userAnimationDirty = true;\n      } else {\n        this._runtimeNode.transform = this.originalMatrix;\n        this._runtimeNode.userAnimated = false;\n      }\n    },\n  },\n\n  /**\n   * Gets the node's original 4x4 matrix transform from its local\n   * coordinates to its parent's, without any node transformations\n   * or articulations applied.\n   *\n   * @memberof ModelNode.prototype\n   * @type {Matrix4}\n   */\n  originalMatrix: {\n    get: function () {\n      return this._runtimeNode.originalTransform;\n    },\n  },\n});\n\nexport default ModelNode;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"mat4 getInstancingTransform()\\n\\\n{\\n\\\n    mat4 instancingTransform;\\n\\\n\\n\\\n    #ifdef HAS_INSTANCE_MATRICES\\n\\\n    instancingTransform = mat4(\\n\\\n        a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1\\n\\\n        a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2\\n\\\n        a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3\\n\\\n        a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0  // Column 4\\n\\\n    );\\n\\\n    #else\\n\\\n    vec3 translation = vec3(0.0, 0.0, 0.0);\\n\\\n    vec3 scale = vec3(1.0, 1.0, 1.0);\\n\\\n    \\n\\\n        #ifdef HAS_INSTANCE_TRANSLATION\\n\\\n        translation = a_instanceTranslation;\\n\\\n        #endif\\n\\\n        #ifdef HAS_INSTANCE_SCALE\\n\\\n        scale = a_instanceScale;\\n\\\n        #endif\\n\\\n\\n\\\n    instancingTransform = mat4(\\n\\\n        scale.x, 0.0, 0.0, 0.0,\\n\\\n        0.0, scale.y, 0.0, 0.0,\\n\\\n        0.0, 0.0, scale.z, 0.0,\\n\\\n        translation.x, translation.y, translation.z, 1.0\\n\\\n    ); \\n\\\n    #endif\\n\\\n\\n\\\n    return instancingTransform;\\n\\\n}\\n\\\n\\n\\\n#ifdef USE_2D_INSTANCING\\n\\\nmat4 getInstancingTransform2D()\\n\\\n{\\n\\\n    mat4 instancingTransform2D;\\n\\\n\\n\\\n    #ifdef HAS_INSTANCE_MATRICES\\n\\\n    instancingTransform2D = mat4(\\n\\\n        a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1\\n\\\n        a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2\\n\\\n        a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3\\n\\\n        a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0  // Column 4\\n\\\n    );\\n\\\n    #else\\n\\\n    vec3 translation2D = vec3(0.0, 0.0, 0.0);\\n\\\n    vec3 scale = vec3(1.0, 1.0, 1.0);\\n\\\n    \\n\\\n        #ifdef HAS_INSTANCE_TRANSLATION\\n\\\n        translation2D = a_instanceTranslation2D;\\n\\\n        #endif\\n\\\n        #ifdef HAS_INSTANCE_SCALE\\n\\\n        scale = a_instanceScale;\\n\\\n        #endif\\n\\\n\\n\\\n    instancingTransform2D = mat4(\\n\\\n        scale.x, 0.0, 0.0, 0.0,\\n\\\n        0.0, scale.y, 0.0, 0.0,\\n\\\n        0.0, 0.0, scale.z, 0.0,\\n\\\n        translation2D.x, translation2D.y, translation2D.z, 1.0\\n\\\n    ); \\n\\\n    #endif\\n\\\n\\n\\\n    return instancingTransform2D;\\n\\\n}\\n\\\n#endif\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void instancingStage(inout ProcessedAttributes attributes) \\n\\\n{\\n\\\n    vec3 positionMC = attributes.positionMC;\\n\\\n    \\n\\\n    mat4 instancingTransform = getInstancingTransform();\\n\\\n    \\n\\\n    attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz;\\n\\\n\\n\\\n    #ifdef HAS_NORMALS\\n\\\n    vec3 normalMC = attributes.normalMC;\\n\\\n    attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz;\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef USE_2D_INSTANCING\\n\\\n    mat4 instancingTransform2D = getInstancingTransform2D();\\n\\\n    attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;\\n\\\n    #endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void legacyInstancingStage(\\n\\\n    inout ProcessedAttributes attributes,\\n\\\n    out mat4 instanceModelView,\\n\\\n    out mat3 instanceModelViewInverseTranspose)\\n\\\n{\\n\\\n    vec3 positionMC = attributes.positionMC;\\n\\\n\\n\\\n    mat4 instancingTransform = getInstancingTransform();\\n\\\n \\n\\\n    mat4 instanceModel = instancingTransform * u_instance_nodeTransform;\\n\\\n    instanceModelView = u_instance_modifiedModelView;\\n\\\n    instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel);\\n\\\n\\n\\\n    attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz;\\n\\\n    \\n\\\n    #ifdef USE_2D_INSTANCING\\n\\\n    mat4 instancingTransform2D = getInstancingTransform2D();\\n\\\n    attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;\\n\\\n    #endif\\n\\\n}\\n\\\n\";\n", "import AttributeCompression from \"../../Core/AttributeCompression.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport clone from \"../../Core/clone.js\";\nimport combine from \"../../Core/combine.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport Quaternion from \"../../Core/Quaternion.js\";\nimport Transforms from \"../../Core/Transforms.js\";\nimport Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport InstancingStageCommon from \"../../Shaders/Model/InstancingStageCommon.js\";\nimport InstancingStageVS from \"../../Shaders/Model/InstancingStageVS.js\";\nimport LegacyInstancingStageVS from \"../../Shaders/Model/LegacyInstancingStageVS.js\";\nimport AttributeType from \"../AttributeType.js\";\nimport InstanceAttributeSemantic from \"../InstanceAttributeSemantic.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport SceneTransforms from \"../SceneTransforms.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\nconst modelViewScratch = new Matrix4();\nconst nodeTransformScratch = new Matrix4();\nconst modelView2DScratch = new Matrix4();\n\n/**\n * The instancing pipeline stage is responsible for handling GPU mesh instancing at the node\n * level.\n *\n * @namespace InstancingPipelineStage\n * @private\n */\nconst InstancingPipelineStage = {\n  name: \"InstancingPipelineStage\", // Helps with debugging\n\n  // Expose some methods for testing\n  _getInstanceTransformsAsMatrices: getInstanceTransformsAsMatrices,\n  _transformsToTypedArray: transformsToTypedArray,\n};\n\n/**\n * Process a node. This modifies the following parts of the render resources:\n * <ul>\n *  <li> creates buffers for the typed arrays of each attribute, if they do not yet exist\n *  <li> adds attribute declarations for the instancing vertex attributes in the vertex shader</li>\n *  <li> sets the instancing translation min and max to compute an accurate bounding volume</li>\n * </ul>\n *\n * If the scene is in either 2D or CV mode, this stage also:\n * <ul>\n *  <li> adds additional attributes for the transformation attributes projected to 2D\n *  <li> adds a flag to the shader to use the 2D instanced attributes\n *  <li> adds a uniform for the view model matrix in 2D\n * </ul>\n *\n * @param {NodeRenderResources} renderResources The render resources for this node.\n * @param {ModelComponents.Node} node The node.\n * @param {FrameState} frameState The frame state.\n */\nInstancingPipelineStage.process = function (renderResources, node, frameState) {\n  const instances = node.instances;\n  const count = instances.attributes[0].count;\n\n  const shaderBuilder = renderResources.shaderBuilder;\n  shaderBuilder.addDefine(\"HAS_INSTANCING\");\n  shaderBuilder.addVertexLines(InstancingStageCommon);\n\n  const model = renderResources.model;\n  const sceneGraph = model.sceneGraph;\n  const runtimeNode = renderResources.runtimeNode;\n\n  const use2D =\n    frameState.mode !== SceneMode.SCENE3D &&\n    !frameState.scene3DOnly &&\n    model._projectTo2D;\n\n  const instancingVertexAttributes = [];\n\n  processTransformAttributes(\n    renderResources,\n    frameState,\n    instances,\n    instancingVertexAttributes,\n    use2D\n  );\n\n  processFeatureIdAttributes(\n    renderResources,\n    frameState,\n    instances,\n    instancingVertexAttributes\n  );\n\n  const uniformMap = {};\n\n  if (instances.transformInWorldSpace) {\n    shaderBuilder.addDefine(\n      \"USE_LEGACY_INSTANCING\",\n      undefined,\n      ShaderDestination.VERTEX\n    );\n    shaderBuilder.addUniform(\n      \"mat4\",\n      \"u_instance_modifiedModelView\",\n      ShaderDestination.VERTEX\n    );\n    shaderBuilder.addUniform(\n      \"mat4\",\n      \"u_instance_nodeTransform\",\n      ShaderDestination.VERTEX\n    );\n\n    // The i3dm format applies the instancing transforms in world space.\n    // Instancing matrices come from a vertex attribute rather than a\n    // uniform, and they are multiplied in the middle of the modelView matrix\n    // product. This means czm_modelView can't be used. Instead, we split the\n    // matrix into two parts, modifiedModelView and nodeTransform, and handle\n    // this in LegacyInstancingStageVS.glsl. Conceptually the product looks like\n    // this:\n    //\n    // modelView = u_modifiedModelView * a_instanceTransform * u_nodeTransform\n    uniformMap.u_instance_modifiedModelView = function () {\n      // Model matrix without the node hierarchy or axis correction\n      // (see u_instance_nodeTransform).\n      let modifiedModelMatrix = Matrix4.multiplyTransformation(\n        // For 3D Tiles, model.modelMatrix is the computed tile\n        // transform (which includes tileset.modelMatrix). This always applies\n        // for i3dm, since such models are always part of a tileset.\n        model.modelMatrix,\n        // For i3dm models, components.transform contains the RTC_CENTER\n        // translation.\n        sceneGraph.components.transform,\n        modelViewScratch\n      );\n\n      if (use2D) {\n        // If projectTo2D is enabled, the 2D view matrix\n        // will be accounted for in the u_modelView2D\n        // uniform.\n        //\n        // modifiedModelView = view3D * modifiedModel\n        return Matrix4.multiplyTransformation(\n          frameState.context.uniformState.view3D,\n          modifiedModelMatrix,\n          modelViewScratch\n        );\n      }\n\n      // For projection to 2D without projectTo2D enabled,\n      // project the model matrix to 2D.\n      if (frameState.mode !== SceneMode.SCENE3D) {\n        modifiedModelMatrix = Transforms.basisTo2D(\n          frameState.mapProjection,\n          modifiedModelMatrix,\n          modelViewScratch\n        );\n      }\n\n      // modifiedModelView = view * modifiedModel\n      return Matrix4.multiplyTransformation(\n        frameState.context.uniformState.view,\n        modifiedModelMatrix,\n        modelViewScratch\n      );\n    };\n\n    uniformMap.u_instance_nodeTransform = function () {\n      // nodeTransform = axisCorrection * nodeHierarchyTransform\n      return Matrix4.multiplyTransformation(\n        // glTF y-up to 3D Tiles z-up\n        sceneGraph.axisCorrectionMatrix,\n        // This transforms from the node's coordinate system to the root\n        // of the node hierarchy\n        runtimeNode.computedTransform,\n        nodeTransformScratch\n      );\n    };\n\n    shaderBuilder.addVertexLines(LegacyInstancingStageVS);\n  } else {\n    shaderBuilder.addVertexLines(InstancingStageVS);\n  }\n\n  if (use2D) {\n    shaderBuilder.addDefine(\n      \"USE_2D_INSTANCING\",\n      undefined,\n      ShaderDestination.VERTEX\n    );\n\n    shaderBuilder.addUniform(\"mat4\", \"u_modelView2D\", ShaderDestination.VERTEX);\n\n    const context = frameState.context;\n    const modelMatrix2D = Matrix4.fromTranslation(\n      runtimeNode.instancingReferencePoint2D,\n      new Matrix4()\n    );\n\n    uniformMap.u_modelView2D = function () {\n      return Matrix4.multiplyTransformation(\n        context.uniformState.view,\n        modelMatrix2D,\n        modelView2DScratch\n      );\n    };\n  }\n\n  renderResources.uniformMap = combine(uniformMap, renderResources.uniformMap);\n\n  renderResources.instanceCount = count;\n  renderResources.attributes.push.apply(\n    renderResources.attributes,\n    instancingVertexAttributes\n  );\n};\n\nconst projectedTransformScratch = new Matrix4();\nconst projectedPositionScratch = new Cartesian3();\n\nfunction projectTransformTo2D(\n  transform,\n  modelMatrix,\n  nodeTransform,\n  frameState,\n  result\n) {\n  let projectedTransform = Matrix4.multiplyTransformation(\n    modelMatrix,\n    transform,\n    projectedTransformScratch\n  );\n\n  projectedTransform = Matrix4.multiplyTransformation(\n    projectedTransform,\n    nodeTransform,\n    projectedTransformScratch\n  );\n\n  result = Transforms.basisTo2D(\n    frameState.mapProjection,\n    projectedTransform,\n    result\n  );\n\n  return result;\n}\n\nfunction projectPositionTo2D(\n  position,\n  modelMatrix,\n  nodeTransform,\n  frameState,\n  result\n) {\n  const translationMatrix = Matrix4.fromTranslation(\n    position,\n    projectedTransformScratch\n  );\n\n  let projectedTransform = Matrix4.multiplyTransformation(\n    modelMatrix,\n    translationMatrix,\n    projectedTransformScratch\n  );\n\n  projectedTransform = Matrix4.multiplyTransformation(\n    projectedTransform,\n    nodeTransform,\n    projectedTransformScratch\n  );\n\n  const finalPosition = Matrix4.getTranslation(\n    projectedTransform,\n    projectedPositionScratch\n  );\n\n  result = SceneTransforms.computeActualWgs84Position(\n    frameState,\n    finalPosition,\n    result\n  );\n\n  return result;\n}\n\nfunction getModelMatrixAndNodeTransform(\n  renderResources,\n  modelMatrix,\n  nodeComputedTransform\n) {\n  const model = renderResources.model;\n  const sceneGraph = model.sceneGraph;\n\n  const instances = renderResources.runtimeNode.node.instances;\n  if (instances.transformInWorldSpace) {\n    // Replicate the multiplication order in LegacyInstancingStageVS.\n    modelMatrix = Matrix4.multiplyTransformation(\n      model.modelMatrix,\n      sceneGraph.components.transform,\n      modelMatrix\n    );\n\n    nodeComputedTransform = Matrix4.multiplyTransformation(\n      sceneGraph.axisCorrectionMatrix,\n      renderResources.runtimeNode.computedTransform,\n      nodeComputedTransform\n    );\n  } else {\n    // The node transform should be pre-multiplied with the instancing transform.\n    modelMatrix = Matrix4.clone(sceneGraph.computedModelMatrix, modelMatrix);\n    modelMatrix = Matrix4.multiplyTransformation(\n      modelMatrix,\n      renderResources.runtimeNode.computedTransform,\n      modelMatrix\n    );\n\n    nodeComputedTransform = Matrix4.clone(\n      Matrix4.IDENTITY,\n      nodeComputedTransform\n    );\n  }\n}\n\nconst modelMatrixScratch = new Matrix4();\nconst nodeComputedTransformScratch = new Matrix4();\nconst transformScratch = new Matrix4();\nconst positionScratch = new Cartesian3();\n\nfunction projectTransformsTo2D(\n  transforms,\n  renderResources,\n  frameState,\n  result\n) {\n  const modelMatrix = modelMatrixScratch;\n  const nodeComputedTransform = nodeComputedTransformScratch;\n\n  getModelMatrixAndNodeTransform(\n    renderResources,\n    modelMatrix,\n    nodeComputedTransform\n  );\n\n  const runtimeNode = renderResources.runtimeNode;\n  const referencePoint = runtimeNode.instancingReferencePoint2D;\n\n  const count = transforms.length;\n  for (let i = 0; i < count; i++) {\n    const transform = transforms[i];\n\n    const projectedTransform = projectTransformTo2D(\n      transform,\n      modelMatrix,\n      nodeComputedTransform,\n      frameState,\n      transformScratch\n    );\n\n    const position = Matrix4.getTranslation(\n      projectedTransform,\n      positionScratch\n    );\n\n    const finalTranslation = Cartesian3.subtract(\n      position,\n      referencePoint,\n      position\n    );\n\n    result[i] = Matrix4.setTranslation(\n      projectedTransform,\n      finalTranslation,\n      result[i]\n    );\n  }\n\n  return result;\n}\n\nfunction projectTranslationsTo2D(\n  translations,\n  renderResources,\n  frameState,\n  result\n) {\n  const modelMatrix = modelMatrixScratch;\n  const nodeComputedTransform = nodeComputedTransformScratch;\n\n  getModelMatrixAndNodeTransform(\n    renderResources,\n    modelMatrix,\n    nodeComputedTransform\n  );\n\n  const runtimeNode = renderResources.runtimeNode;\n  const referencePoint = runtimeNode.instancingReferencePoint2D;\n  const count = translations.length;\n  for (let i = 0; i < count; i++) {\n    const translation = translations[i];\n\n    const projectedPosition = projectPositionTo2D(\n      translation,\n      modelMatrix,\n      nodeComputedTransform,\n      frameState,\n      translation\n    );\n\n    result[i] = Cartesian3.subtract(\n      projectedPosition,\n      referencePoint,\n      result[i]\n    );\n  }\n\n  return result;\n}\n\nconst scratchProjectedMin = new Cartesian3();\nconst scratchProjectedMax = new Cartesian3();\n\nfunction computeReferencePoint2D(renderResources, frameState) {\n  // Compute the reference point by averaging the instancing translation\n  // min / max values after they are projected to 2D.\n  const runtimeNode = renderResources.runtimeNode;\n  const modelMatrix = renderResources.model.sceneGraph.computedModelMatrix;\n  const transformedPositionMin = Matrix4.multiplyByPoint(\n    modelMatrix,\n    runtimeNode.instancingTranslationMin,\n    scratchProjectedMin\n  );\n\n  const projectedMin = SceneTransforms.computeActualWgs84Position(\n    frameState,\n    transformedPositionMin,\n    transformedPositionMin\n  );\n\n  const transformedPositionMax = Matrix4.multiplyByPoint(\n    modelMatrix,\n    runtimeNode.instancingTranslationMax,\n    scratchProjectedMax\n  );\n\n  const projectedMax = SceneTransforms.computeActualWgs84Position(\n    frameState,\n    transformedPositionMax,\n    transformedPositionMax\n  );\n\n  runtimeNode.instancingReferencePoint2D = Cartesian3.lerp(\n    projectedMin,\n    projectedMax,\n    0.5,\n    new Cartesian3()\n  );\n}\n\nfunction transformsToTypedArray(transforms) {\n  const elements = 12;\n  const count = transforms.length;\n  const transformsTypedArray = new Float32Array(count * elements);\n\n  for (let i = 0; i < count; i++) {\n    const transform = transforms[i];\n    const offset = elements * i;\n\n    transformsTypedArray[offset + 0] = transform[0];\n    transformsTypedArray[offset + 1] = transform[4];\n    transformsTypedArray[offset + 2] = transform[8];\n    transformsTypedArray[offset + 3] = transform[12];\n    transformsTypedArray[offset + 4] = transform[1];\n    transformsTypedArray[offset + 5] = transform[5];\n    transformsTypedArray[offset + 6] = transform[9];\n    transformsTypedArray[offset + 7] = transform[13];\n    transformsTypedArray[offset + 8] = transform[2];\n    transformsTypedArray[offset + 9] = transform[6];\n    transformsTypedArray[offset + 10] = transform[10];\n    transformsTypedArray[offset + 11] = transform[14];\n  }\n\n  return transformsTypedArray;\n}\n\nfunction translationsToTypedArray(translations) {\n  const elements = 3;\n  const count = translations.length;\n  const transationsTypedArray = new Float32Array(count * elements);\n\n  for (let i = 0; i < count; i++) {\n    const translation = translations[i];\n    const offset = elements * i;\n\n    transationsTypedArray[offset + 0] = translation[0];\n    transationsTypedArray[offset + 1] = translation[4];\n    transationsTypedArray[offset + 2] = translation[8];\n  }\n\n  return transationsTypedArray;\n}\n\nconst translationScratch = new Cartesian3();\nconst rotationScratch = new Quaternion();\nconst scaleScratch = new Cartesian3();\n\nfunction getInstanceTransformsAsMatrices(instances, count, renderResources) {\n  const transforms = new Array(count);\n\n  const translationAttribute = ModelUtility.getAttributeBySemantic(\n    instances,\n    InstanceAttributeSemantic.TRANSLATION\n  );\n  const rotationAttribute = ModelUtility.getAttributeBySemantic(\n    instances,\n    InstanceAttributeSemantic.ROTATION\n  );\n  const scaleAttribute = ModelUtility.getAttributeBySemantic(\n    instances,\n    InstanceAttributeSemantic.SCALE\n  );\n\n  const instancingTranslationMax = new Cartesian3(\n    -Number.MAX_VALUE,\n    -Number.MAX_VALUE,\n    -Number.MAX_VALUE\n  );\n  const instancingTranslationMin = new Cartesian3(\n    Number.MAX_VALUE,\n    Number.MAX_VALUE,\n    Number.MAX_VALUE\n  );\n\n  const hasTranslation = defined(translationAttribute);\n  const hasRotation = defined(rotationAttribute);\n  const hasScale = defined(scaleAttribute);\n\n  // Translations get initialized to (0, 0, 0).\n  const translationTypedArray = hasTranslation\n    ? translationAttribute.typedArray\n    : new Float32Array(count * 3);\n\n  // Rotations get initialized to (0, 0, 0, 0).\n  // The w-component is set to 1 in the loop below.\n  let rotationTypedArray = hasRotation\n    ? rotationAttribute.typedArray\n    : new Float32Array(count * 4);\n\n  // The rotation attribute may be normalized\n  if (hasRotation && rotationAttribute.normalized) {\n    rotationTypedArray = AttributeCompression.dequantize(\n      rotationTypedArray,\n      rotationAttribute.componentDatatype,\n      rotationAttribute.type,\n      count\n    );\n  }\n\n  // Scales get initialized to (1, 1, 1).\n  let scaleTypedArray;\n  if (hasScale) {\n    scaleTypedArray = scaleAttribute.typedArray;\n  } else {\n    scaleTypedArray = new Float32Array(count * 3);\n    scaleTypedArray.fill(1);\n  }\n\n  for (let i = 0; i < count; i++) {\n    const translation = new Cartesian3(\n      translationTypedArray[i * 3],\n      translationTypedArray[i * 3 + 1],\n      translationTypedArray[i * 3 + 2],\n      translationScratch\n    );\n\n    Cartesian3.maximumByComponent(\n      instancingTranslationMax,\n      translation,\n      instancingTranslationMax\n    );\n    Cartesian3.minimumByComponent(\n      instancingTranslationMin,\n      translation,\n      instancingTranslationMin\n    );\n\n    const rotation = new Quaternion(\n      rotationTypedArray[i * 4],\n      rotationTypedArray[i * 4 + 1],\n      rotationTypedArray[i * 4 + 2],\n      hasRotation ? rotationTypedArray[i * 4 + 3] : 1,\n      rotationScratch\n    );\n\n    const scale = new Cartesian3(\n      scaleTypedArray[i * 3],\n      scaleTypedArray[i * 3 + 1],\n      scaleTypedArray[i * 3 + 2],\n      scaleScratch\n    );\n\n    const transform = Matrix4.fromTranslationQuaternionRotationScale(\n      translation,\n      rotation,\n      scale,\n      new Matrix4()\n    );\n\n    transforms[i] = transform;\n  }\n\n  const runtimeNode = renderResources.runtimeNode;\n  runtimeNode.instancingTranslationMin = instancingTranslationMin;\n  runtimeNode.instancingTranslationMax = instancingTranslationMax;\n\n  // Unload the typed arrays. These are just pointers to the arrays\n  // in the vertex buffer loader.\n  if (hasTranslation) {\n    translationAttribute.typedArray = undefined;\n  }\n  if (hasRotation) {\n    rotationAttribute.typedArray = undefined;\n  }\n  if (hasScale) {\n    scaleAttribute.typedArray = undefined;\n  }\n\n  return transforms;\n}\n\nfunction getInstanceTranslationsAsCartesian3s(\n  translationAttribute,\n  count,\n  renderResources\n) {\n  const instancingTranslations = new Array(count);\n  const translationTypedArray = translationAttribute.typedArray;\n\n  const instancingTranslationMin = new Cartesian3(\n    Number.MAX_VALUE,\n    Number.MAX_VALUE,\n    Number.MAX_VALUE\n  );\n  const instancingTranslationMax = new Cartesian3(\n    -Number.MAX_VALUE,\n    -Number.MAX_VALUE,\n    -Number.MAX_VALUE\n  );\n\n  for (let i = 0; i < count; i++) {\n    const translation = new Cartesian3(\n      translationTypedArray[i * 3],\n      translationTypedArray[i * 3 + 1],\n      translationTypedArray[i * 3 + 2]\n    );\n\n    instancingTranslations[i] = translation;\n\n    Cartesian3.minimumByComponent(\n      instancingTranslationMin,\n      translation,\n      instancingTranslationMin\n    );\n    Cartesian3.maximumByComponent(\n      instancingTranslationMax,\n      translation,\n      instancingTranslationMax\n    );\n  }\n\n  const runtimeNode = renderResources.runtimeNode;\n  runtimeNode.instancingTranslationMin = instancingTranslationMin;\n  runtimeNode.instancingTranslationMax = instancingTranslationMax;\n\n  // Unload the typed array. This is just a pointer to the array\n  // in the vertex buffer loader.\n  translationAttribute.typedArray = undefined;\n\n  return instancingTranslations;\n}\n\nfunction createVertexBuffer(typedArray, frameState) {\n  const buffer = Buffer.createVertexBuffer({\n    context: frameState.context,\n    typedArray: typedArray,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n\n  // Destruction of resources allocated by the Model\n  // is handled by Model.destroy().\n  buffer.vertexArrayDestroyable = false;\n\n  return buffer;\n}\n\nfunction processTransformAttributes(\n  renderResources,\n  frameState,\n  instances,\n  instancingVertexAttributes,\n  use2D\n) {\n  const rotationAttribute = ModelUtility.getAttributeBySemantic(\n    instances,\n    InstanceAttributeSemantic.ROTATION\n  );\n\n  // Only use matrices for the transforms if the rotation attribute is defined.\n  if (defined(rotationAttribute)) {\n    processTransformMatrixAttributes(\n      renderResources,\n      instances,\n      instancingVertexAttributes,\n      frameState,\n      use2D\n    );\n  } else {\n    processTransformVec3Attributes(\n      renderResources,\n      instances,\n      instancingVertexAttributes,\n      frameState,\n      use2D\n    );\n  }\n}\n\nfunction processTransformMatrixAttributes(\n  renderResources,\n  instances,\n  instancingVertexAttributes,\n  frameState,\n  use2D\n) {\n  const shaderBuilder = renderResources.shaderBuilder;\n  const count = instances.attributes[0].count;\n\n  const model = renderResources.model;\n  const runtimeNode = renderResources.runtimeNode;\n\n  shaderBuilder.addDefine(\"HAS_INSTANCE_MATRICES\");\n  const attributeString = \"Transform\";\n\n  let transforms;\n  let buffer = runtimeNode.instancingTransformsBuffer;\n  if (!defined(buffer)) {\n    // This function computes the transforms, sets the translation min / max,\n    // and unloads the typed arrays associated with the attributes.\n    transforms = getInstanceTransformsAsMatrices(\n      instances,\n      count,\n      renderResources\n    );\n\n    const transformsTypedArray = transformsToTypedArray(transforms);\n    buffer = createVertexBuffer(transformsTypedArray, frameState);\n    model._modelResources.push(buffer);\n\n    runtimeNode.instancingTransformsBuffer = buffer;\n  }\n\n  processMatrixAttributes(\n    renderResources,\n    buffer,\n    instancingVertexAttributes,\n    attributeString\n  );\n\n  if (!use2D) {\n    return;\n  }\n\n  // Force the scene mode to be CV. In 2D, projected positions will have\n  // an x-coordinate of 0, which eliminates the height data that is\n  // necessary for rendering in CV mode.\n  const frameStateCV = clone(frameState);\n  frameStateCV.mode = SceneMode.COLUMBUS_VIEW;\n\n  // To prevent jitter, the positions are defined relative to a common\n  // reference point. For convenience, this is the center of the instanced\n  // translation bounds projected to 2D.\n  computeReferencePoint2D(renderResources, frameStateCV);\n\n  let buffer2D = runtimeNode.instancingTransformsBuffer2D;\n  if (!defined(buffer2D)) {\n    const projectedTransforms = projectTransformsTo2D(\n      transforms,\n      renderResources,\n      frameStateCV,\n      transforms\n    );\n    const projectedTypedArray = transformsToTypedArray(projectedTransforms);\n\n    // This memory is counted during the statistics stage at the end\n    // of the pipeline.\n    buffer2D = createVertexBuffer(projectedTypedArray, frameState);\n    model._modelResources.push(buffer2D);\n\n    runtimeNode.instancingTransformsBuffer2D = buffer2D;\n  }\n\n  const attributeString2D = \"Transform2D\";\n  processMatrixAttributes(\n    renderResources,\n    buffer2D,\n    instancingVertexAttributes,\n    attributeString2D\n  );\n}\n\nfunction processTransformVec3Attributes(\n  renderResources,\n  instances,\n  instancingVertexAttributes,\n  frameState,\n  use2D\n) {\n  const shaderBuilder = renderResources.shaderBuilder;\n  const runtimeNode = renderResources.runtimeNode;\n  const translationAttribute = ModelUtility.getAttributeBySemantic(\n    instances,\n    InstanceAttributeSemantic.TRANSLATION\n  );\n  const scaleAttribute = ModelUtility.getAttributeBySemantic(\n    instances,\n    InstanceAttributeSemantic.SCALE\n  );\n\n  if (defined(scaleAttribute)) {\n    shaderBuilder.addDefine(\"HAS_INSTANCE_SCALE\");\n    const attributeString = \"Scale\";\n\n    // Instanced scale attributes are loaded as buffers only.\n    processVec3Attribute(\n      renderResources,\n      scaleAttribute.buffer,\n      scaleAttribute.byteOffset,\n      scaleAttribute.byteStride,\n      instancingVertexAttributes,\n      attributeString\n    );\n  }\n\n  if (!defined(translationAttribute)) {\n    return;\n  }\n\n  let instancingTranslations;\n  const typedArray = translationAttribute.typedArray;\n  if (defined(typedArray)) {\n    // This function computes and set the translation min / max, and unloads\n    // the typed array associated with the attribute.\n    // The translations are also returned in case they're used for 2D projection.\n    instancingTranslations = getInstanceTranslationsAsCartesian3s(\n      translationAttribute,\n      translationAttribute.count,\n      renderResources\n    );\n  } else if (!defined(runtimeNode.instancingTranslationMin)) {\n    runtimeNode.instancingTranslationMin = translationAttribute.min;\n    runtimeNode.instancingTranslationMax = translationAttribute.max;\n  }\n\n  shaderBuilder.addDefine(\"HAS_INSTANCE_TRANSLATION\");\n  const attributeString = \"Translation\";\n\n  processVec3Attribute(\n    renderResources,\n    translationAttribute.buffer,\n    translationAttribute.byteOffset,\n    translationAttribute.byteStride,\n    instancingVertexAttributes,\n    attributeString\n  );\n\n  if (!use2D) {\n    return;\n  }\n\n  // Force the scene mode to be CV. In 2D, projected positions will have\n  // an x-coordinate of 0, which eliminates the height data that is\n  // necessary for rendering in CV mode.\n  const frameStateCV = clone(frameState);\n  frameStateCV.mode = SceneMode.COLUMBUS_VIEW;\n\n  // To prevent jitter, the positions are defined relative to a common\n  // reference point. For convenience, this is the center of the instanced\n  // translation bounds projected to 2D.\n  computeReferencePoint2D(renderResources, frameStateCV);\n\n  let buffer2D = runtimeNode.instancingTranslationBuffer2D;\n\n  if (!defined(buffer2D)) {\n    const projectedTranslations = projectTranslationsTo2D(\n      instancingTranslations,\n      renderResources,\n      frameStateCV,\n      instancingTranslations\n    );\n    const projectedTypedArray = translationsToTypedArray(projectedTranslations);\n\n    // This memory is counted during the statistics stage at the end\n    // of the pipeline.\n    buffer2D = createVertexBuffer(projectedTypedArray, frameState);\n    renderResources.model._modelResources.push(buffer2D);\n\n    runtimeNode.instancingTranslationBuffer2D = buffer2D;\n  }\n\n  const byteOffset = 0;\n  const byteStride = undefined;\n\n  const attributeString2D = \"Translation2D\";\n  processVec3Attribute(\n    renderResources,\n    buffer2D,\n    byteOffset,\n    byteStride,\n    instancingVertexAttributes,\n    attributeString2D\n  );\n}\n\nfunction processMatrixAttributes(\n  renderResources,\n  buffer,\n  instancingVertexAttributes,\n  attributeString\n) {\n  const vertexSizeInFloats = 12;\n  const componentByteSize = ComponentDatatype.getSizeInBytes(\n    ComponentDatatype.FLOAT\n  );\n  const strideInBytes = componentByteSize * vertexSizeInFloats;\n\n  const matrixAttributes = [\n    {\n      index: renderResources.attributeIndex++,\n      vertexBuffer: buffer,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      normalize: false,\n      offsetInBytes: 0,\n      strideInBytes: strideInBytes,\n      instanceDivisor: 1,\n    },\n    {\n      index: renderResources.attributeIndex++,\n      vertexBuffer: buffer,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      normalize: false,\n      offsetInBytes: componentByteSize * 4,\n      strideInBytes: strideInBytes,\n      instanceDivisor: 1,\n    },\n    {\n      index: renderResources.attributeIndex++,\n      vertexBuffer: buffer,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      normalize: false,\n      offsetInBytes: componentByteSize * 8,\n      strideInBytes: strideInBytes,\n      instanceDivisor: 1,\n    },\n  ];\n\n  const shaderBuilder = renderResources.shaderBuilder;\n  shaderBuilder.addAttribute(\"vec4\", `a_instancing${attributeString}Row0`);\n  shaderBuilder.addAttribute(\"vec4\", `a_instancing${attributeString}Row1`);\n  shaderBuilder.addAttribute(\"vec4\", `a_instancing${attributeString}Row2`);\n\n  instancingVertexAttributes.push.apply(\n    instancingVertexAttributes,\n    matrixAttributes\n  );\n}\n\nfunction processVec3Attribute(\n  renderResources,\n  buffer,\n  byteOffset,\n  byteStride,\n  instancingVertexAttributes,\n  attributeString\n) {\n  instancingVertexAttributes.push({\n    index: renderResources.attributeIndex++,\n    vertexBuffer: buffer,\n    componentsPerAttribute: 3,\n    componentDatatype: ComponentDatatype.FLOAT,\n    normalize: false,\n    offsetInBytes: byteOffset,\n    strideInBytes: byteStride,\n    instanceDivisor: 1,\n  });\n\n  const shaderBuilder = renderResources.shaderBuilder;\n  shaderBuilder.addAttribute(\"vec3\", `a_instance${attributeString}`);\n}\n\nfunction processFeatureIdAttributes(\n  renderResources,\n  frameState,\n  instances,\n  instancingVertexAttributes\n) {\n  const attributes = instances.attributes;\n  const shaderBuilder = renderResources.shaderBuilder;\n\n  for (let i = 0; i < attributes.length; i++) {\n    const attribute = attributes[i];\n    if (attribute.semantic !== InstanceAttributeSemantic.FEATURE_ID) {\n      continue;\n    }\n\n    if (\n      attribute.setIndex >= renderResources.featureIdVertexAttributeSetIndex\n    ) {\n      renderResources.featureIdVertexAttributeSetIndex = attribute.setIndex + 1;\n    }\n\n    instancingVertexAttributes.push({\n      index: renderResources.attributeIndex++,\n      vertexBuffer: attribute.buffer,\n      componentsPerAttribute: AttributeType.getNumberOfComponents(\n        attribute.type\n      ),\n      componentDatatype: attribute.componentDatatype,\n      normalize: false,\n      offsetInBytes: attribute.byteOffset,\n      strideInBytes: attribute.byteStride,\n      instanceDivisor: 1,\n    });\n\n    shaderBuilder.addAttribute(\n      \"float\",\n      `a_instanceFeatureId_${attribute.setIndex}`\n    );\n  }\n}\n\nexport default InstancingPipelineStage;\n", "import Matrix4 from \"../../Core/Matrix4.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport SceneMode from \"../SceneMode.js\";\n\n/**\n * The model matrix update stage is responsible for updating the model matrices and bounding volumes of the draw commands.\n *\n * @namespace ModelMatrixUpdateStage\n *\n * @private\n */\nconst ModelMatrixUpdateStage = {};\nModelMatrixUpdateStage.name = \"ModelMatrixUpdateStage\"; // Helps with debugging\n\n/**\n * Processes a runtime node. This modifies the following parts of the scene graph and draw commands:\n * <ul>\n *  <li>updates the transforms the children of any nodes with a dirty transform</li>\n *  <li>updates the model matrix of each draw command in each primitive of the the dirty nodes and their children</li>\n *  <li>updates the bounding volume of each draw command in each primitive of the the dirty nodes and their children</li>\n * </ul>\n *\n * @param {ModelRuntimeNode} runtimeNode\n * @param {ModelSceneGraph} sceneGraph\n * @param {FrameState} frameState\n *\n * @private\n */\nModelMatrixUpdateStage.update = function (runtimeNode, sceneGraph, frameState) {\n  // Skip the update stage if the model is being projected to 2D\n  const use2D = frameState.mode !== SceneMode.SCENE3D;\n  if (use2D && sceneGraph._model._projectTo2D) {\n    return;\n  }\n\n  if (runtimeNode._transformDirty) {\n    const modelMatrix = use2D\n      ? sceneGraph._computedModelMatrix2D\n      : sceneGraph._computedModelMatrix;\n\n    updateRuntimeNode(\n      runtimeNode,\n      sceneGraph,\n      modelMatrix,\n      runtimeNode.transformToRoot\n    );\n    runtimeNode._transformDirty = false;\n  }\n};\n\n/**\n * Recursively update all child runtime nodes and their runtime primitives.\n *\n * @private\n */\nfunction updateRuntimeNode(\n  runtimeNode,\n  sceneGraph,\n  modelMatrix,\n  transformToRoot\n) {\n  let i;\n\n  // Apply the current node's transform to the end of the chain\n  transformToRoot = Matrix4.multiplyTransformation(\n    transformToRoot,\n    runtimeNode.transform,\n    new Matrix4()\n  );\n\n  runtimeNode.updateComputedTransform();\n\n  const primitivesLength = runtimeNode.runtimePrimitives.length;\n  for (i = 0; i < primitivesLength; i++) {\n    const runtimePrimitive = runtimeNode.runtimePrimitives[i];\n    const drawCommand = runtimePrimitive.drawCommand;\n    drawCommand.modelMatrix = Matrix4.multiplyTransformation(\n      modelMatrix,\n      transformToRoot,\n      drawCommand.modelMatrix\n    );\n    drawCommand.cullFace = ModelUtility.getCullFace(\n      drawCommand.modelMatrix,\n      drawCommand.primitiveType\n    );\n  }\n\n  const childrenLength = runtimeNode.children.length;\n  for (i = 0; i < childrenLength; i++) {\n    const childRuntimeNode = sceneGraph._runtimeNodes[runtimeNode.children[i]];\n\n    // Update transformToRoot to accommodate changes in the transforms of this node and its ancestors\n    childRuntimeNode._transformToRoot = Matrix4.clone(\n      transformToRoot,\n      childRuntimeNode._transformToRoot\n    );\n\n    updateRuntimeNode(\n      childRuntimeNode,\n      sceneGraph,\n      modelMatrix,\n      transformToRoot\n    );\n    childRuntimeNode._transformDirty = false;\n  }\n}\n\nexport default ModelMatrixUpdateStage;\n", "import defined from \"../../Core/defined.js\";\n\n/**\n * The node statistics update stage updates memory usage statistics for a Model\n * on the node level. This counts the binary resources that exist for the\n * lifetime of the Model (e.g. attributes loaded by GltfLoader). It does not\n * count resources that are created every time the pipeline is run.\n * The individual pipeline stages are responsible for keeping track of any\n * additional memory they allocate.\n *\n * @namespace NodeStatisticsPipelineStage\n *\n * @private\n */\nconst NodeStatisticsPipelineStage = {\n  name: \"NodeStatisticsPipelineStage\", // Helps with debugging\n\n  // Expose some methods for testing\n  _countInstancingAttributes: countInstancingAttributes,\n  _countGeneratedBuffers: countGeneratedBuffers,\n};\n\nNodeStatisticsPipelineStage.process = function (\n  renderResources,\n  node,\n  frameState\n) {\n  const statistics = renderResources.model.statistics;\n  const instances = node.instances;\n  const runtimeNode = renderResources.runtimeNode;\n\n  countInstancingAttributes(statistics, instances);\n  countGeneratedBuffers(statistics, runtimeNode);\n};\n\nfunction countInstancingAttributes(statistics, instances) {\n  if (!defined(instances)) {\n    return;\n  }\n\n  const attributes = instances.attributes;\n  const length = attributes.length;\n  for (let i = 0; i < length; i++) {\n    const attribute = attributes[i];\n    if (defined(attribute.buffer)) {\n      // Any typed arrays should have been unloaded before this stage.\n      const hasCpuCopy = false;\n      statistics.addBuffer(attribute.buffer, hasCpuCopy);\n    }\n  }\n}\n\nfunction countGeneratedBuffers(statistics, runtimeNode) {\n  if (defined(runtimeNode.instancingTransformsBuffer)) {\n    // The typed array containing the computed transforms isn't saved\n    // after the buffer is created.\n    const hasCpuCopy = false;\n    statistics.addBuffer(runtimeNode.instancingTransformsBuffer, hasCpuCopy);\n  }\n  if (defined(runtimeNode.instancingTransformsBuffer2D)) {\n    // The typed array containing the computed 2D transforms isn't saved\n    // after the buffer is created.\n    const hasCpuCopy = false;\n    statistics.addBuffer(runtimeNode.instancingTransformsBuffer2D, hasCpuCopy);\n  }\n\n  if (defined(runtimeNode.instancingTranslationBuffer2D)) {\n    // The typed array containing the computed 2D translations isn't saved\n    // after the buffer is created.\n    const hasCpuCopy = false;\n    statistics.addBuffer(runtimeNode.instancingTranslationBuffer2D, hasCpuCopy);\n  }\n}\n\nexport default NodeStatisticsPipelineStage;\n", "import Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport TranslationRotationScale from \"../../Core/TranslationRotationScale.js\";\nimport Quaternion from \"../../Core/Quaternion.js\";\nimport InstancingPipelineStage from \"./InstancingPipelineStage.js\";\nimport ModelMatrixUpdateStage from \"./ModelMatrixUpdateStage.js\";\nimport NodeStatisticsPipelineStage from \"./NodeStatisticsPipelineStage.js\";\n\n/**\n * An in-memory representation of a node as part of the {@link ModelSceneGraph}.\n *\n * @param {object} options An object containing the following options:\n * @param {ModelComponents.Node} options.node The corresponding node components from the 3D model.\n * @param {Matrix4} options.transform The transform of this node, excluding transforms from the node's ancestors or children.\n * @param {Matrix4} options.transformToRoot The product of the transforms of all the node's ancestors, excluding the node's own transform.\n * @param {ModelSceneGraph} options.sceneGraph The scene graph this node belongs to.\n * @param {number[]} options.children The indices of the children of this node in the runtime nodes array of the scene graph.\n *\n * @alias ModelRuntimeNode\n * @constructor\n *\n * @private\n */\nfunction ModelRuntimeNode(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const node = options.node;\n  const transform = options.transform;\n  const transformToRoot = options.transformToRoot;\n  const sceneGraph = options.sceneGraph;\n  const children = options.children;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.node\", node);\n  Check.typeOf.object(\"options.transform\", transform);\n  Check.typeOf.object(\"options.transformToRoot\", transformToRoot);\n  Check.typeOf.object(\"options.sceneGraph\", sceneGraph);\n  Check.typeOf.object(\"options.children\", children);\n  //>>includeEnd('debug');\n\n  this._node = node;\n  this._name = node.name;\n  this._id = node.index;\n  this._sceneGraph = sceneGraph;\n  this._children = children;\n\n  this._originalTransform = Matrix4.clone(transform, this._originalTransform);\n  this._transform = Matrix4.clone(transform, this._transform);\n  this._transformToRoot = Matrix4.clone(transformToRoot, this._transformToRoot);\n\n  this._computedTransform = new Matrix4(); // Computed in initialize()\n  this._transformDirty = false;\n\n  // Used for animation\n  this._transformParameters = undefined;\n  this._morphWeights = [];\n\n  // Will be set by the scene graph after the skins have been created\n  this._runtimeSkin = undefined;\n  this._computedJointMatrices = [];\n\n  /**\n   * Whether or not to show this node and its children. This can be toggled\n   * by the user through {@link ModelNode}.\n   *\n   * @type {boolean}\n   *\n   * @default true\n   *\n   * @private\n   */\n  this.show = true;\n\n  /**\n   * Whether or not this node is animated by the user. This is set by the\n   * corresponding {@link ModelNode} when the user supplies their\n   * own transform. If this is true, the node will ignore animations in the\n   * model's asset.\n   *\n   * @type {boolean}\n   *\n   * @private\n   */\n  this.userAnimated = false;\n\n  /**\n   * Pipeline stages to apply across all the mesh primitives of this node.\n   * This is an array of classes, each with a static method called\n   * <code>process()</code>.\n   *\n   * @type {Object[]}\n   * @readonly\n   *\n   * @private\n   */\n  this.pipelineStages = [];\n\n  /**\n   * The mesh primitives that belong to this node.\n   *\n   * @type {ModelRuntimePrimitive[]}\n   * @readonly\n   *\n   * @private\n   */\n  this.runtimePrimitives = [];\n\n  /**\n   * Update stages to apply to this node.\n   *\n   * @type {Object[]}\n   * @readonly\n   *\n   * @private\n   */\n  this.updateStages = [];\n\n  /**\n   * The component-wise minimum value of the translations of the instances.\n   * This value is set by InstancingPipelineStage.\n   *\n   * @type {Cartesian3}\n   *\n   * @private\n   */\n  this.instancingTranslationMin = undefined;\n\n  /**\n   * The component-wise maximum value of the translations of the instances.\n   * This value is set by InstancingPipelineStage.\n   *\n   * @type {Cartesian3}\n   *\n   * @private\n   */\n  this.instancingTranslationMax = undefined;\n\n  /**\n   * A buffer containing the instanced transforms. The memory is managed\n   * by Model; this is just a reference.\n   *\n   * @type {Buffer}\n   *\n   * @private\n   */\n  this.instancingTransformsBuffer = undefined;\n\n  /**\n   * A buffer containing the instanced transforms projected to 2D world\n   * coordinates. Used for rendering in 2D / CV mode. The memory is managed\n   * by Model; this is just a reference.\n   *\n   * @type {Buffer}\n   *\n   * @private\n   */\n  this.instancingTransformsBuffer2D = undefined;\n\n  /**\n   * A buffer containing the instanced translation values for the node if\n   * it is instanced. Used for rendering in 2D / CV mode. The memory is\n   * managed by Model; this is just a reference.\n   *\n   * @type {Buffer}\n   *\n   * @private\n   */\n  this.instancingTranslationBuffer2D = undefined;\n\n  /**\n   * If the model is instanced and projected to 2D, the reference point is the\n   * average of the instancing translation max and min. The 2D translations are\n   * defined relative to this point to avoid precision issues on the GPU.\n   * <p>\n   * This value is set by InstancingPipelineStage.\n   * </p>\n   *\n   * @type {Cartesian3}\n   *\n   * @private\n   */\n  this.instancingReferencePoint2D = undefined;\n\n  initialize(this);\n}\n\nObject.defineProperties(ModelRuntimeNode.prototype, {\n  /**\n   * The internal node this runtime node represents.\n   *\n   * @memberof ModelRuntimeNode.prototype\n   * @type {ModelComponents.Node}\n   * @readonly\n   *\n   * @private\n   */\n  node: {\n    get: function () {\n      return this._node;\n    },\n  },\n  /**\n   * The scene graph this node belongs to.\n   *\n   * @memberof ModelRuntimeNode.prototype\n   * @type {ModelSceneGraph}\n   * @readonly\n   *\n   * @private\n   */\n  sceneGraph: {\n    get: function () {\n      return this._sceneGraph;\n    },\n  },\n\n  /**\n   * The indices of the children of this node in the scene graph.\n   *\n   * @memberof ModelRuntimeNode.prototype\n   * @type {number[]}\n   * @readonly\n   *\n   * @private\n   */\n  children: {\n    get: function () {\n      return this._children;\n    },\n  },\n\n  /**\n   * The node's local space transform. This can be changed externally via\n   * the corresponding {@link ModelNode}, such that animation can be\n   * driven by another source, not just an animation in the model's asset.\n   *\n   * @memberof ModelRuntimeNode.prototype\n   * @type {Matrix4}\n   *\n   * @private\n   */\n  transform: {\n    get: function () {\n      return this._transform;\n    },\n    set: function (value) {\n      this._transformDirty = true;\n      this._transform = Matrix4.clone(value, this._transform);\n    },\n  },\n\n  /**\n   * The transforms of all the node's ancestors, not including this node's\n   * transform.\n   *\n   * @see ModelRuntimeNode#computedTransform\n   *\n   * @memberof ModelRuntimeNode.prototype\n   * @type {Matrix4}\n   * @readonly\n   *\n   * @private\n   */\n  transformToRoot: {\n    get: function () {\n      return this._transformToRoot;\n    },\n  },\n\n  /**\n   * A transform from the node's local space to the model's scene graph space.\n   * This is the product of transformToRoot * transform.\n   *\n   * @memberof ModelRuntimeNode.prototype\n   * @type {Matrix4}\n   * @readonly\n   *\n   * @private\n   */\n  computedTransform: {\n    get: function () {\n      return this._computedTransform;\n    },\n  },\n\n  /**\n   * The node's original transform, as specified in the model.\n   * Does not include transformations from the node's ancestors.\n   *\n   * @memberof ModelRuntimeNode.prototype\n   * @type {Matrix4}\n   * @readonly\n   *\n   * @private\n   */\n  originalTransform: {\n    get: function () {\n      return this._originalTransform;\n    },\n  },\n\n  /**\n   * The node's local space translation. This is used internally to allow\n   * animations in the model's asset to affect the node's properties.\n   *\n   * If the node's transformation was originally described using a matrix\n   * in the model, then this will return undefined.\n   *\n   * @memberof ModelRuntimeNode.prototype\n   * @type {Cartesian3}\n   *\n   * @exception {DeveloperError} The translation of a node cannot be set if it was defined using a matrix in the model's asset.\n   *\n   * @private\n   */\n  translation: {\n    get: function () {\n      return defined(this._transformParameters)\n        ? this._transformParameters.translation\n        : undefined;\n    },\n    set: function (value) {\n      const transformParameters = this._transformParameters;\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(transformParameters)) {\n        throw new DeveloperError(\n          \"The translation of a node cannot be set if it was defined using a matrix in the model.\"\n        );\n      }\n      //>>includeEnd('debug');\n\n      const currentTranslation = transformParameters.translation;\n      if (Cartesian3.equals(currentTranslation, value)) {\n        return;\n      }\n\n      transformParameters.translation = Cartesian3.clone(\n        value,\n        transformParameters.translation\n      );\n\n      updateTransformFromParameters(this, transformParameters);\n    },\n  },\n\n  /**\n   * The node's local space rotation. This is used internally to allow\n   * animations in the model's asset to affect the node's properties.\n   *\n   * If the node's transformation was originally described using a matrix\n   * in the model, then this will return undefined.\n   *\n   * @memberof ModelRuntimeNode.prototype\n   * @type {Quaternion}\n   *\n   * @exception {DeveloperError} The rotation of a node cannot be set if it was defined using a matrix in the model's asset.\n   *\n   * @private\n   */\n  rotation: {\n    get: function () {\n      return defined(this._transformParameters)\n        ? this._transformParameters.rotation\n        : undefined;\n    },\n    set: function (value) {\n      const transformParameters = this._transformParameters;\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(transformParameters)) {\n        throw new DeveloperError(\n          \"The rotation of a node cannot be set if it was defined using a matrix in the model.\"\n        );\n      }\n      //>>includeEnd('debug');\n\n      const currentRotation = transformParameters.rotation;\n      if (Quaternion.equals(currentRotation, value)) {\n        return;\n      }\n\n      transformParameters.rotation = Quaternion.clone(\n        value,\n        transformParameters.rotation\n      );\n\n      updateTransformFromParameters(this, transformParameters);\n    },\n  },\n\n  /**\n   * The node's local space scale. This is used internally to allow\n   * animations in the model's asset to affect the node's properties.\n   *\n   * If the node's transformation was originally described using a matrix\n   * in the model, then this will return undefined.\n   *\n   * @memberof ModelRuntimeNode.prototype\n   * @type {Cartesian3}\n   *\n   * @exception {DeveloperError} The scale of a node cannot be set if it was defined using a matrix in the model's asset.\n   * @private\n   */\n  scale: {\n    get: function () {\n      return defined(this._transformParameters)\n        ? this._transformParameters.scale\n        : undefined;\n    },\n    set: function (value) {\n      const transformParameters = this._transformParameters;\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(transformParameters)) {\n        throw new DeveloperError(\n          \"The scale of a node cannot be set if it was defined using a matrix in the model.\"\n        );\n      }\n      //>>includeEnd('debug');\n      const currentScale = transformParameters.scale;\n      if (Cartesian3.equals(currentScale, value)) {\n        return;\n      }\n\n      transformParameters.scale = Cartesian3.clone(\n        value,\n        transformParameters.scale\n      );\n\n      updateTransformFromParameters(this, transformParameters);\n    },\n  },\n\n  /**\n   * The node's morph weights. This is used internally to allow animations\n   * in the model's asset to affect the node's properties.\n   *\n   * @memberof ModelRuntimeNode.prototype\n   * @type {number[]}\n   *\n   * @private\n   */\n  morphWeights: {\n    get: function () {\n      return this._morphWeights;\n    },\n    set: function (value) {\n      const valueLength = value.length;\n      //>>includeStart('debug', pragmas.debug);\n      if (this._morphWeights.length !== valueLength) {\n        throw new DeveloperError(\n          \"value must have the same length as the original weights array.\"\n        );\n      }\n      //>>includeEnd('debug');\n      for (let i = 0; i < valueLength; i++) {\n        this._morphWeights[i] = value[i];\n      }\n    },\n  },\n\n  /**\n   * The skin applied to this node, if it exists.\n   *\n   * @memberof ModelRuntimeNode.prototype\n   * @type {ModelSkin}\n   * @readonly\n   *\n   * @private\n   */\n  runtimeSkin: {\n    get: function () {\n      return this._runtimeSkin;\n    },\n  },\n\n  /**\n   * The computed joint matrices of this node, derived from its skin.\n   *\n   * @memberof ModelRuntimeNode.prototype\n   * @type {Matrix4[]}\n   * @readonly\n   *\n   * @private\n   */\n  computedJointMatrices: {\n    get: function () {\n      return this._computedJointMatrices;\n    },\n  },\n});\n\nfunction initialize(runtimeNode) {\n  const transform = runtimeNode.transform;\n  const transformToRoot = runtimeNode.transformToRoot;\n  const computedTransform = runtimeNode._computedTransform;\n  runtimeNode._computedTransform = Matrix4.multiply(\n    transformToRoot,\n    transform,\n    computedTransform\n  );\n\n  const node = runtimeNode.node;\n  if (!defined(node.matrix)) {\n    runtimeNode._transformParameters = new TranslationRotationScale(\n      node.translation,\n      node.rotation,\n      node.scale\n    );\n  }\n\n  if (defined(node.morphWeights)) {\n    runtimeNode._morphWeights = node.morphWeights.slice();\n  }\n\n  // If this node is affected by an articulation from the AGI_articulations\n  // extension, add this node to its list of affected nodes.\n  const articulationName = node.articulationName;\n  if (defined(articulationName)) {\n    const sceneGraph = runtimeNode.sceneGraph;\n    const runtimeArticulations = sceneGraph._runtimeArticulations;\n\n    const runtimeArticulation = runtimeArticulations[articulationName];\n    if (defined(runtimeArticulation)) {\n      runtimeArticulation.runtimeNodes.push(runtimeNode);\n    }\n  }\n}\n\nfunction updateTransformFromParameters(runtimeNode, transformParameters) {\n  runtimeNode._transformDirty = true;\n\n  runtimeNode._transform = Matrix4.fromTranslationRotationScale(\n    transformParameters,\n    runtimeNode._transform\n  );\n}\n\n/**\n * Returns the child with the given index.\n *\n * @param {number} index The index of the child.\n *\n * @returns {ModelRuntimeNode}\n *\n * @example\n * // Iterate through all children of a runtime node.\n * for (let i = 0; i < runtimeNode.children.length; i++)\n * {\n *   const childNode = runtimeNode.getChild(i);\n * }\n *\n * @private\n */\nModelRuntimeNode.prototype.getChild = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"index\", index);\n  if (index < 0 || index >= this.children.length) {\n    throw new DeveloperError(\n      \"index must be greater than or equal to 0 and less than the number of children.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  return this.sceneGraph._runtimeNodes[this.children[index]];\n};\n\n/**\n * Configure the node pipeline stages. If the pipeline needs to be re-run, call\n * this method again to ensure the correct sequence of pipeline stages are\n * used.\n *\n * @private\n */\nModelRuntimeNode.prototype.configurePipeline = function () {\n  const node = this.node;\n  const pipelineStages = this.pipelineStages;\n  pipelineStages.length = 0;\n  const updateStages = this.updateStages;\n  updateStages.length = 0;\n\n  if (defined(node.instances)) {\n    pipelineStages.push(InstancingPipelineStage);\n  }\n\n  pipelineStages.push(NodeStatisticsPipelineStage);\n\n  updateStages.push(ModelMatrixUpdateStage);\n};\n\n/**\n * Updates the computed transform used for rendering and instancing.\n *\n * @private\n */\nModelRuntimeNode.prototype.updateComputedTransform = function () {\n  this._computedTransform = Matrix4.multiply(\n    this._transformToRoot,\n    this._transform,\n    this._computedTransform\n  );\n};\n\n/**\n * Updates the joint matrices for this node, where each matrix is computed as\n * computedJointMatrix = nodeWorldTransform^(-1) * skinJointMatrix.\n *\n * @private\n */\nModelRuntimeNode.prototype.updateJointMatrices = function () {\n  const runtimeSkin = this._runtimeSkin;\n  if (!defined(runtimeSkin)) {\n    return;\n  }\n\n  runtimeSkin.updateJointMatrices();\n\n  const computedJointMatrices = this._computedJointMatrices;\n  const skinJointMatrices = runtimeSkin.jointMatrices;\n  const length = skinJointMatrices.length;\n\n  for (let i = 0; i < length; i++) {\n    if (!defined(computedJointMatrices[i])) {\n      computedJointMatrices[i] = new Matrix4();\n    }\n\n    const nodeWorldTransform = Matrix4.multiplyTransformation(\n      this.transformToRoot,\n      this.transform,\n      computedJointMatrices[i]\n    );\n\n    const inverseNodeWorldTransform = Matrix4.inverseTransformation(\n      nodeWorldTransform,\n      computedJointMatrices[i]\n    );\n\n    computedJointMatrices[i] = Matrix4.multiplyTransformation(\n      inverseNodeWorldTransform,\n      skinJointMatrices[i],\n      computedJointMatrices[i]\n    );\n  }\n};\n\nexport default ModelRuntimeNode;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport BlendingState from \"../BlendingState.js\";\nimport Pass from \"../../Renderer/Pass.js\";\n\n/**\n * A pipeline stage for configuring the alpha options for handling translucency.\n *\n * @namespace MaterialPipelineStage\n *\n * @private\n */\nconst AlphaPipelineStage = {\n  name: \"AlphaPipelineStage\", // Helps with debugging\n};\n\nAlphaPipelineStage.process = function (renderResources, primitive, frameState) {\n  const alphaOptions = renderResources.alphaOptions;\n\n  // Ensure the pass is defined\n  const model = renderResources.model;\n  alphaOptions.pass = defaultValue(alphaOptions.pass, model.opaquePass);\n\n  const renderStateOptions = renderResources.renderStateOptions;\n  if (alphaOptions.pass === Pass.TRANSLUCENT) {\n    renderStateOptions.cull.enabled = false;\n    renderStateOptions.depthMask = false;\n    renderStateOptions.blending = BlendingState.ALPHA_BLEND;\n  }\n\n  const shaderBuilder = renderResources.shaderBuilder;\n  const uniformMap = renderResources.uniformMap;\n\n  if (defined(alphaOptions.alphaCutoff)) {\n    shaderBuilder.addDefine(\n      \"ALPHA_MODE_MASK\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n    shaderBuilder.addUniform(\n      \"float\",\n      \"u_alphaCutoff\",\n      ShaderDestination.FRAGMENT\n    );\n    uniformMap.u_alphaCutoff = function () {\n      return alphaOptions.alphaCutoff;\n    };\n  }\n};\n\nexport default AlphaPipelineStage;\n", "import combine from \"../../Core/combine.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\n\n/**\n * The batch texture stage is responsible for setting up the batch texture for the primitive.\n *\n * @namespace BatchTexturePipelineStage\n * @private\n */\nconst BatchTexturePipelineStage = {\n  name: \"BatchTexturePipelineStage\", // Helps with debugging\n};\n\n/**\n * Processes a primitive. This modifies the following parts of the render resources:\n * <ul>\n *  <li>adds uniforms for the batch texture</li>\n *  <li>adds defines for multiline batch textures</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n */\nBatchTexturePipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  const shaderBuilder = renderResources.shaderBuilder;\n  const batchTextureUniforms = {};\n\n  const model = renderResources.model;\n\n  const featureTable = model.featureTables[model.featureTableId];\n\n  // Number of features in the feature table.\n  const featuresLength = featureTable.featuresLength;\n  shaderBuilder.addUniform(\"int\", \"model_featuresLength\");\n  batchTextureUniforms.model_featuresLength = function () {\n    return featuresLength;\n  };\n\n  // Batch texture\n  const batchTexture = featureTable.batchTexture;\n  shaderBuilder.addUniform(\"sampler2D\", \"model_batchTexture\");\n  batchTextureUniforms.model_batchTexture = function () {\n    return defaultValue(batchTexture.batchTexture, batchTexture.defaultTexture);\n  };\n\n  // Batch texture step size\n  shaderBuilder.addUniform(\"vec4\", \"model_textureStep\");\n  batchTextureUniforms.model_textureStep = function () {\n    return batchTexture.textureStep;\n  };\n\n  // Batch texture dimensions\n  if (batchTexture.textureDimensions.y > 1) {\n    shaderBuilder.addDefine(\"MULTILINE_BATCH_TEXTURE\");\n    shaderBuilder.addUniform(\"vec2\", \"model_textureDimensions\");\n    batchTextureUniforms.model_textureDimensions = function () {\n      return batchTexture.textureDimensions;\n    };\n  }\n\n  renderResources.uniformMap = combine(\n    batchTextureUniforms,\n    renderResources.uniformMap\n  );\n};\n\nexport default BatchTexturePipelineStage;\n", "import defined from \"../../Core/defined.js\";\nimport RuntimeError from \"../../Core/RuntimeError.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\n/**\n * The classification pipeline stage is responsible for batching features\n * together to be rendered by the {@link ClassificationModelDrawCommand}.\n *\n * @namespace ClassificationPipelineStage\n *\n * @private\n */\nconst ClassificationPipelineStage = {\n  name: \"ClassificationPipelineStage\", // Helps with debugging\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render resources:\n *\n * <ul>\n *  <li>adds a define to the shader to indicate that the primitive classifies other assets</li>\n *  <li>adds arrays containing batch lengths and offsets to the primitive's resources\n * </ul>\n *\n * <p>\n * See {@link ClassificationModelDrawCommand} for the use of the batch offsets and lengths.\n * </p>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nClassificationPipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  const shaderBuilder = renderResources.shaderBuilder;\n\n  shaderBuilder.addDefine(\n    \"HAS_CLASSIFICATION\",\n    undefined,\n    ShaderDestination.BOTH\n  );\n\n  const runtimePrimitive = renderResources.runtimePrimitive;\n\n  if (!defined(runtimePrimitive.batchLengths)) {\n    createClassificationBatches(primitive, runtimePrimitive);\n  }\n};\n\nfunction createClassificationBatches(primitive, runtimePrimitive) {\n  const positionAttribute = ModelUtility.getAttributeBySemantic(\n    primitive,\n    VertexAttributeSemantic.POSITION\n  );\n\n  if (!defined(positionAttribute)) {\n    throw new RuntimeError(\n      \"Primitives must have a position attribute to be used for classification.\"\n    );\n  }\n\n  let indicesArray;\n  const indices = primitive.indices;\n  const hasIndices = defined(indices);\n  if (hasIndices) {\n    indicesArray = indices.typedArray;\n    // Unload the typed array. This is just a pointer to the array in\n    // the index buffer loader.\n    indices.typedArray = undefined;\n  }\n\n  const count = hasIndices ? indices.count : positionAttribute.count;\n  const featureIdAttribute = ModelUtility.getAttributeBySemantic(\n    primitive,\n    VertexAttributeSemantic.FEATURE_ID,\n    0\n  );\n\n  // If there are no feature IDs, render the primitive in a single batch.\n  if (!defined(featureIdAttribute)) {\n    runtimePrimitive.batchLengths = [count];\n    runtimePrimitive.batchOffsets = [0];\n\n    return;\n  }\n\n  const featureIds = featureIdAttribute.typedArray;\n  // Unload the typed array. This is just a pointer to the array in\n  // the vertex buffer loader, so if the typed array is shared by\n  // multiple primitives (i.e. multiple instances of the same mesh),\n  // this will not affect the other primitives.\n  featureIdAttribute.typedArray = undefined;\n\n  const batchLengths = [];\n  const batchOffsets = [0];\n\n  const firstIndex = hasIndices ? indicesArray[0] : 0;\n  let currentBatchId = featureIds[firstIndex];\n  let currentOffset = 0;\n\n  for (let i = 1; i < count; i++) {\n    const index = hasIndices ? indicesArray[i] : i;\n    const batchId = featureIds[index];\n\n    if (batchId !== currentBatchId) {\n      // Store the length of this batch and begin counting the next one.\n      const batchLength = i - currentOffset;\n      const newOffset = i;\n\n      batchLengths.push(batchLength);\n      batchOffsets.push(newOffset);\n\n      currentOffset = newOffset;\n      currentBatchId = batchId;\n    }\n  }\n\n  const finalBatchLength = count - currentOffset;\n  batchLengths.push(finalBatchLength);\n\n  runtimePrimitive.batchLengths = batchLengths;\n  runtimePrimitive.batchOffsets = batchOffsets;\n}\n\nexport default ClassificationPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void filterByPassType(inout vec3 positionMC, vec4 featureColor)\\n\\\n{\\n\\\n    bool styleTranslucent = (featureColor.a != 1.0);\\n\\\n    // Only render translucent features in the translucent pass (if the style or the original command has translucency).\\n\\\n    if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)\\n\\\n    {\\n\\\n        // If the model has a translucent silhouette, it needs to render during the silhouette color command,\\n\\\n        // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.\\n\\\n        #ifdef HAS_SILHOUETTE\\n\\\n        positionMC *= float(model_silhouettePass);\\n\\\n        #else\\n\\\n        positionMC *= 0.0;\\n\\\n        #endif\\n\\\n    }\\n\\\n    // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.\\n\\\n    else if (czm_pass != czm_passTranslucent && styleTranslucent)\\n\\\n    {\\n\\\n        positionMC *= 0.0;\\n\\\n    }\\n\\\n}\\n\\\n\\n\\\nvoid cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature)\\n\\\n{\\n\\\n    float show = ceil(feature.color.a);\\n\\\n    positionMC *= show;\\n\\\n\\n\\\n    #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION)\\n\\\n    filterByPassType(positionMC, feature.color);\\n\\\n    #endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void filterByPassType(vec4 featureColor)\\n\\\n{\\n\\\n    bool styleTranslucent = (featureColor.a != 1.0);\\n\\\n    // Only render translucent features in the translucent pass (if the style or the original command has translucency).\\n\\\n    if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)\\n\\\n    {   \\n\\\n        // If the model has a translucent silhouette, it needs to render during the silhouette color command,\\n\\\n        // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.\\n\\\n        #ifdef HAS_SILHOUETTE\\n\\\n        if(!model_silhouettePass) {\\n\\\n            discard;\\n\\\n        }\\n\\\n        #else\\n\\\n        discard;\\n\\\n        #endif\\n\\\n    }\\n\\\n    // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.\\n\\\n    else if (czm_pass != czm_passTranslucent && styleTranslucent)\\n\\\n    {\\n\\\n        discard;\\n\\\n    }\\n\\\n}\\n\\\n\\n\\\nvoid cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature)\\n\\\n{\\n\\\n    vec4 featureColor = feature.color;\\n\\\n    if (featureColor.a == 0.0)\\n\\\n    {\\n\\\n        discard;\\n\\\n    }\\n\\\n\\n\\\n    // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader.\\n\\\n    // So, we only apply in in the fragment shader if the feature ID texture is used.\\n\\\n    #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION)\\n\\\n    filterByPassType(featureColor);\\n\\\n    #endif\\n\\\n\\n\\\n    featureColor = czm_gammaCorrect(featureColor);\\n\\\n\\n\\\n    // Classification models compute the diffuse differently.\\n\\\n    #ifdef HAS_CLASSIFICATION\\n\\\n    material.diffuse = featureColor.rgb * featureColor.a;\\n\\\n    #else\\n\\\n    float highlight = ceil(model_colorBlend);\\n\\\n    material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight);\\n\\\n    #endif\\n\\\n    \\n\\\n    material.alpha *= featureColor.a;\\n\\\n}\\n\\\n\";\n", "import ColorBlendMode from \"../ColorBlendMode.js\";\nimport CPUStylingStageVS from \"../../Shaders/Model/CPUStylingStageVS.js\";\nimport CPUStylingStageFS from \"../../Shaders/Model/CPUStylingStageFS.js\";\nimport defined from \"../../Core/defined.js\";\nimport ModelColorPipelineStage from \"./ModelColorPipelineStage.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\n\n/**\n * The CPU styling stage is responsible for ensuring that the feature's color\n * is applied at runtime.\n *\n * @namespace CPUStylingPipelineStage\n *\n * @private\n */\nconst CPUStylingPipelineStage = {\n  name: \"CPUStylingPipelineStage\", // Helps with debugging\n};\n\n/**\n * Processes a primitive. This modifies the following parts of the render resources:\n * <ul>\n *  <li>adds the styling code to both the vertex and fragment shaders</li>\n *  <li>adds the define to trigger the stage's shader functions</li>\n *  <li>adds a uniform with the model's color blend mode and amount</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nCPUStylingPipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  const model = renderResources.model;\n  const shaderBuilder = renderResources.shaderBuilder;\n\n  shaderBuilder.addVertexLines(CPUStylingStageVS);\n  shaderBuilder.addFragmentLines(CPUStylingStageFS);\n  shaderBuilder.addDefine(\"USE_CPU_STYLING\", undefined, ShaderDestination.BOTH);\n\n  // These uniforms may have already been added by the ModelColorStage\n  // if a static color is applied.\n  if (!defined(model.color)) {\n    shaderBuilder.addUniform(\n      \"float\",\n      ModelColorPipelineStage.COLOR_BLEND_UNIFORM_NAME,\n      ShaderDestination.FRAGMENT\n    );\n    renderResources.uniformMap[\n      ModelColorPipelineStage.COLOR_BLEND_UNIFORM_NAME\n    ] = function () {\n      return ColorBlendMode.getColorBlend(\n        model.colorBlendMode,\n        model.colorBlendAmount\n      );\n    };\n  }\n\n  shaderBuilder.addUniform(\n    \"bool\",\n    \"model_commandTranslucent\",\n    ShaderDestination.BOTH\n  );\n  renderResources.uniformMap.model_commandTranslucent = function () {\n    // Always check the current value, because custom shaders may\n    // change the value with the translucencyMode parameter\n    return renderResources.alphaOptions.pass === Pass.TRANSLUCENT;\n  };\n};\n\nexport default CPUStylingPipelineStage;\n", "/**\n * An enum describing how the {@link CustomShader} will be added to the\n * fragment shader. This determines how the shader interacts with the material.\n *\n * @enum {string}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst CustomShaderMode = {\n  /**\n   * The custom shader will be used to modify the results of the material stage\n   * before lighting is applied.\n   *\n   * @type {string}\n   * @constant\n   */\n  MODIFY_MATERIAL: \"MODIFY_MATERIAL\",\n  /**\n   * The custom shader will be used instead of the material stage. This is a hint\n   * to optimize out the material processing code.\n   *\n   * @type {string}\n   * @constant\n   */\n  REPLACE_MATERIAL: \"REPLACE_MATERIAL\",\n};\n\n/**\n * Convert the shader mode to an uppercase identifier for use in GLSL define\n * directives. For example:  <code>#define CUSTOM_SHADER_MODIFY_MATERIAL</code>\n * @param {CustomShaderMode} customShaderMode The shader mode\n * @return {string} The name of the GLSL macro to use\n *\n * @private\n */\nCustomShaderMode.getDefineName = function (customShaderMode) {\n  return `CUSTOM_SHADER_${customShaderMode}`;\n};\n\nexport default Object.freeze(CustomShaderMode);\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void customShaderStage(\\n\\\n    inout czm_modelVertexOutput vsOutput, \\n\\\n    inout ProcessedAttributes attributes, \\n\\\n    FeatureIds featureIds,\\n\\\n    Metadata metadata,\\n\\\n    MetadataClass metadataClass,\\n\\\n    MetadataStatistics metadataStatistics\\n\\\n) {\\n\\\n    // VertexInput and initializeInputStruct() are dynamically generated in JS, \\n\\\n    // see CustomShaderPipelineStage.js\\n\\\n    VertexInput vsInput;\\n\\\n    initializeInputStruct(vsInput, attributes);\\n\\\n    vsInput.featureIds = featureIds;\\n\\\n    vsInput.metadata = metadata;\\n\\\n    vsInput.metadataClass = metadataClass;\\n\\\n    vsInput.metadataStatistics = metadataStatistics;\\n\\\n    vertexMain(vsInput, vsOutput);\\n\\\n    attributes.positionMC = vsOutput.positionMC;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void customShaderStage(\\n\\\n    inout czm_modelMaterial material,\\n\\\n    ProcessedAttributes attributes,\\n\\\n    FeatureIds featureIds,\\n\\\n    Metadata metadata,\\n\\\n    MetadataClass metadataClass,\\n\\\n    MetadataStatistics metadataStatistics\\n\\\n) {\\n\\\n    // FragmentInput and initializeInputStruct() are dynamically generated in JS, \\n\\\n    // see CustomShaderPipelineStage.js\\n\\\n    FragmentInput fsInput;\\n\\\n    initializeInputStruct(fsInput, attributes);\\n\\\n    fsInput.featureIds = featureIds;\\n\\\n    fsInput.metadata = metadata;\\n\\\n    fsInput.metadataClass = metadataClass;\\n\\\n    fsInput.metadataStatistics = metadataStatistics;\\n\\\n    fragmentMain(fsInput, material);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {\\n\\\n  initializeFeatureIds(featureIds, attributes);\\n\\\n  initializeFeatureIdAliases(featureIds);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) \\n\\\n{\\n\\\n  initializeFeatureIds(featureIds, attributes);\\n\\\n  initializeFeatureIdAliases(featureIds);\\n\\\n  setFeatureIdVaryings();\\n\\\n}\\n\\\n\";\n", "import ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\nimport FeatureIdStageFS from \"../../Shaders/Model/FeatureIdStageFS.js\";\nimport FeatureIdStageVS from \"../../Shaders/Model/FeatureIdStageVS.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\n/**\n * The feature ID pipeline stage is responsible for processing feature IDs\n * (both attributes and textures), updating the shader in preparation for\n * custom shaders, picking, and/or styling.\n *\n * @namespace FeatureIdPipelineStage\n * @private\n */\nconst FeatureIdPipelineStage = {\n  name: \"FeatureIdPipelineStage\", // Helps with debugging\n\n  STRUCT_ID_FEATURE_IDS_VS: \"FeatureIdsVS\",\n  STRUCT_ID_FEATURE_IDS_FS: \"FeatureIdsFS\",\n  STRUCT_NAME_FEATURE_IDS: \"FeatureIds\",\n  FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS: \"initializeFeatureIdsVS\",\n  FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS: \"initializeFeatureIdsFS\",\n  FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS: \"initializeFeatureIdAliasesVS\",\n  FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS: \"initializeFeatureIdAliasesFS\",\n  FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:\n    \"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)\",\n  FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:\n    \"void initializeFeatureIdAliases(inout FeatureIds featureIds)\",\n  FUNCTION_ID_SET_FEATURE_ID_VARYINGS: \"setFeatureIdVaryings\",\n  FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS: \"void setFeatureIdVaryings()\",\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render resources:\n * <ul>\n *  <li>Adds the FeatureIds struct and corresponding initialization functions in the vertex and fragment shader</li>\n *  <li>For each feature ID attribute, the attributes were already uploaded in the geometry stage, so just update the shader code </li>\n *  <li>For each feature ID implicit range, a new attribute is created and uploaded to the GPU since gl_VertexID is not available in WebGL 1. The shader is updated with an attribute, varying, and initialization code.</li>\n *  <li>For each feature ID texture, the texture is added to the uniform map, and shader code is added to perform the texture read.</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n */\nFeatureIdPipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  const shaderBuilder = renderResources.shaderBuilder;\n  declareStructsAndFunctions(shaderBuilder);\n\n  const instances = renderResources.runtimeNode.node.instances;\n  if (defined(instances)) {\n    processInstanceFeatureIds(renderResources, instances, frameState);\n  }\n  processPrimitiveFeatureIds(renderResources, primitive, frameState);\n\n  shaderBuilder.addVertexLines(FeatureIdStageVS);\n  shaderBuilder.addFragmentLines(FeatureIdStageFS);\n};\n\nfunction declareStructsAndFunctions(shaderBuilder) {\n  // Declare the FeatureIds struct. The vertex shader will only use\n  // feature ID attributes, while the fragment shader will also use\n  // feature ID textures.\n  shaderBuilder.addStruct(\n    FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,\n    FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS,\n    ShaderDestination.VERTEX\n  );\n  shaderBuilder.addStruct(\n    FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,\n    FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS,\n    ShaderDestination.FRAGMENT\n  );\n\n  // declare the initializeFeatureIds() function. The details may differ\n  // between vertex and fragment shader\n  shaderBuilder.addFunction(\n    FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,\n    FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,\n    ShaderDestination.VERTEX\n  );\n  shaderBuilder.addFunction(\n    FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,\n    FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,\n    ShaderDestination.FRAGMENT\n  );\n\n  // declare the initializeFeatureIdAliases() function. The details may differ\n  // between vertex and fragment shader\n  shaderBuilder.addFunction(\n    FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,\n    FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,\n    ShaderDestination.VERTEX\n  );\n  shaderBuilder.addFunction(\n    FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,\n    FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,\n    ShaderDestination.FRAGMENT\n  );\n\n  // declare the setFeatureIdVaryings() function in the vertex shader only\n  shaderBuilder.addFunction(\n    FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,\n    FeatureIdPipelineStage.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,\n    ShaderDestination.VERTEX\n  );\n}\n\nfunction processInstanceFeatureIds(renderResources, instances, frameState) {\n  const featureIdsArray = instances.featureIds;\n  const count = instances.attributes[0].count;\n\n  for (let i = 0; i < featureIdsArray.length; i++) {\n    const featureIds = featureIdsArray[i];\n    const variableName = featureIds.positionalLabel;\n\n    if (featureIds instanceof ModelComponents.FeatureIdAttribute) {\n      processInstanceAttribute(renderResources, featureIds, variableName);\n    } else {\n      const instanceDivisor = 1;\n      processImplicitRange(\n        renderResources,\n        featureIds,\n        variableName,\n        count,\n        instanceDivisor,\n        frameState\n      );\n    }\n\n    const label = featureIds.label;\n    if (defined(label)) {\n      addAlias(renderResources, variableName, label, ShaderDestination.BOTH);\n    }\n  }\n}\n\nfunction processPrimitiveFeatureIds(renderResources, primitive, frameState) {\n  const featureIdsArray = primitive.featureIds;\n  const positionAttribute = ModelUtility.getAttributeBySemantic(\n    primitive,\n    VertexAttributeSemantic.POSITION\n  );\n  const count = positionAttribute.count;\n\n  for (let i = 0; i < featureIdsArray.length; i++) {\n    const featureIds = featureIdsArray[i];\n    const variableName = featureIds.positionalLabel;\n\n    let aliasDestination = ShaderDestination.BOTH;\n    if (featureIds instanceof ModelComponents.FeatureIdAttribute) {\n      processAttribute(renderResources, featureIds, variableName);\n    } else if (featureIds instanceof ModelComponents.FeatureIdImplicitRange) {\n      processImplicitRange(\n        renderResources,\n        featureIds,\n        variableName,\n        count,\n        undefined,\n        frameState\n      );\n    } else {\n      processTexture(renderResources, featureIds, variableName, i, frameState);\n      aliasDestination = ShaderDestination.FRAGMENT;\n    }\n\n    const label = featureIds.label;\n    if (defined(label)) {\n      addAlias(renderResources, variableName, label, aliasDestination);\n    }\n  }\n}\n\nfunction processInstanceAttribute(\n  renderResources,\n  featureIdAttribute,\n  variableName\n) {\n  // Add a field to the FeatureIds struct.\n  // Example:\n  // struct FeatureIds {\n  //   ...\n  //   int instanceFeatureId_n;\n  //   ...\n  // }\n  const shaderBuilder = renderResources.shaderBuilder;\n  shaderBuilder.addStructField(\n    FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,\n    \"int\",\n    variableName\n  );\n  shaderBuilder.addStructField(\n    FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,\n    \"int\",\n    variableName\n  );\n\n  // Initialize the field from the corresponding attribute.\n  // Example: featureIds.instanceFeatureId_n = int(czm_round(attributes.instanceFeatureId_0));\n  const setIndex = featureIdAttribute.setIndex;\n  const prefix = variableName.replace(/_\\d+$/, \"_\");\n\n  const attributeName = `a_${prefix}${setIndex}`;\n  const varyingName = `v_${prefix}${setIndex}`;\n  const vertexLine = `featureIds.${variableName} = int(czm_round(${attributeName}));`;\n  const fragmentLine = `featureIds.${variableName} = int(czm_round(${varyingName}));`;\n\n  shaderBuilder.addFunctionLines(\n    FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,\n    [vertexLine]\n  );\n  shaderBuilder.addFunctionLines(\n    FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,\n    [fragmentLine]\n  );\n\n  // Instanced attributes don't normally need varyings, so add one here\n  shaderBuilder.addVarying(\"float\", varyingName);\n\n  // The varying needs initialization in the vertex shader\n  // Example:\n  // v_instanceFeatureId_n = a_instanceFeatureId_n;\n  shaderBuilder.addFunctionLines(\n    FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,\n    [`${varyingName} = ${attributeName};`]\n  );\n}\n\nfunction processAttribute(renderResources, featureIdAttribute, variableName) {\n  // Add a field to the FeatureIds struct.\n  // Example:\n  // struct FeatureIds {\n  //   ...\n  //   int featureId_n;\n  //   ...\n  // }\n  const shaderBuilder = renderResources.shaderBuilder;\n  shaderBuilder.addStructField(\n    FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,\n    \"int\",\n    variableName\n  );\n  shaderBuilder.addStructField(\n    FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,\n    \"int\",\n    variableName\n  );\n\n  // Initialize the field from the corresponding attribute.\n  // Example: featureIds.featureId_n = attributes.featureId_0;\n  // Since this uses the ProcessedAttributes struct, the line is the same\n  // for both vertex and fragment shader.\n  const setIndex = featureIdAttribute.setIndex;\n  const prefix = variableName.replace(/_\\d+$/, \"_\");\n\n  const initializationLines = [\n    `featureIds.${variableName} = int(czm_round(attributes.${prefix}${setIndex}));`,\n  ];\n  shaderBuilder.addFunctionLines(\n    FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,\n    initializationLines\n  );\n  shaderBuilder.addFunctionLines(\n    FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,\n    initializationLines\n  );\n}\n\nfunction processImplicitRange(\n  renderResources,\n  implicitFeatureIds,\n  variableName,\n  count,\n  instanceDivisor,\n  frameState\n) {\n  // Generate a vertex attribute for the implicit IDs since WebGL 1 does not\n  // support gl_VertexID\n  generateImplicitFeatureIdAttribute(\n    renderResources,\n    implicitFeatureIds,\n    count,\n    instanceDivisor,\n    frameState\n  );\n\n  // Declare the vertex attribute in the shader\n  // Example: in float a_implicit_feature_id_n;\n  const shaderBuilder = renderResources.shaderBuilder;\n  const implicitAttributeName = `a_implicit_${variableName}`;\n  shaderBuilder.addAttribute(\"float\", implicitAttributeName);\n\n  // Also declare the corresponding varyings\n  // Example: in float v_implicit_feature_id_n;\n  const implicitVaryingName = `v_implicit_${variableName}`;\n  shaderBuilder.addVarying(\"float\", implicitVaryingName);\n\n  // Add a field to the FeatureIds struct.\n  // Example:\n  // struct FeatureIds {\n  //   ...\n  //   int featureId_n;\n  //   ...\n  // }\n  shaderBuilder.addStructField(\n    FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,\n    \"int\",\n    variableName\n  );\n  shaderBuilder.addStructField(\n    FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,\n    \"int\",\n    variableName\n  );\n\n  // The varying needs initialization in the vertex shader\n  // Example:\n  // v_implicit_featureId_n = a_implicit_featureId_n;\n  shaderBuilder.addFunctionLines(\n    FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,\n    [`${implicitVaryingName} = ${implicitAttributeName};`]\n  );\n\n  // Initialize the field from the generated attribute/varying.\n  // Example:\n  // featureIds.featureId_n = a_implicit_featureId_n; (VS)\n  // featureIds.featureId_n = v_implicit_featureId_n; (FS)\n  shaderBuilder.addFunctionLines(\n    FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,\n    [`featureIds.${variableName} = int(czm_round(${implicitAttributeName}));`]\n  );\n  shaderBuilder.addFunctionLines(\n    FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,\n    [`featureIds.${variableName} = int(czm_round(${implicitVaryingName}));`]\n  );\n}\n\nfunction processTexture(\n  renderResources,\n  featureIdTexture,\n  variableName,\n  index,\n  frameState\n) {\n  // Create the feature ID texture uniform. The index matches the index from\n  // the featureIds array, even if this is not consecutive.\n  const uniformName = `u_featureIdTexture_${index}`;\n  const uniformMap = renderResources.uniformMap;\n  const textureReader = featureIdTexture.textureReader;\n  uniformMap[uniformName] = function () {\n    return defaultValue(\n      textureReader.texture,\n      frameState.context.defaultTexture\n    );\n  };\n\n  const channels = textureReader.channels;\n\n  // Add a field to the FeatureIds struct in the fragment shader only\n  // Example:\n  // struct FeatureIds {\n  //   ...\n  //   int featureId_n;\n  //   ...\n  // }\n  const shaderBuilder = renderResources.shaderBuilder;\n  shaderBuilder.addStructField(\n    FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,\n    \"int\",\n    variableName\n  );\n\n  // Declare the uniform in the fragment shader\n  shaderBuilder.addUniform(\n    \"sampler2D\",\n    uniformName,\n    ShaderDestination.FRAGMENT\n  );\n\n  // Read one or more channels from the texture\n  // example: texture(u_featureIdTexture_0, v_texCoord_1).rg\n  const texCoord = `v_texCoord_${textureReader.texCoord}`;\n  const textureRead = `texture(${uniformName}, ${texCoord}).${channels}`;\n\n  // Finally, assign to the struct field. Example:\n  // featureIds.featureId_0 = unpacked;\n  const initializationLine = `featureIds.${variableName} = czm_unpackUint(${textureRead});`;\n\n  shaderBuilder.addFunctionLines(\n    FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,\n    [initializationLine]\n  );\n}\n\nfunction addAlias(renderResources, variableName, alias, shaderDestination) {\n  // Add a field to the FeatureIds struct.\n  // Example:\n  // struct FeatureIds {\n  //   ...\n  //   int alias;\n  //   ...\n  // }\n  const shaderBuilder = renderResources.shaderBuilder;\n  const updateVS = ShaderDestination.includesVertexShader(shaderDestination);\n  if (updateVS) {\n    shaderBuilder.addStructField(\n      FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,\n      \"int\",\n      alias\n    );\n  }\n  shaderBuilder.addStructField(\n    FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,\n    \"int\",\n    alias\n  );\n\n  // Initialize the field from the original variable\n  // Example: featureIds.alias = featureIds.featureId_n;\n  const initializationLines = [\n    `featureIds.${alias} = featureIds.${variableName};`,\n  ];\n  if (updateVS) {\n    shaderBuilder.addFunctionLines(\n      FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,\n      initializationLines\n    );\n  }\n  shaderBuilder.addFunctionLines(\n    FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,\n    initializationLines\n  );\n}\n\nfunction generateImplicitFeatureIdAttribute(\n  renderResources,\n  implicitFeatureIds,\n  count,\n  instanceDivisor,\n  frameState\n) {\n  const model = renderResources.model;\n  let vertexBuffer;\n  let value;\n  if (defined(implicitFeatureIds.repeat)) {\n    const typedArray = generateImplicitFeatureIdTypedArray(\n      implicitFeatureIds,\n      count\n    );\n    vertexBuffer = Buffer.createVertexBuffer({\n      context: frameState.context,\n      typedArray: typedArray,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    vertexBuffer.vertexArrayDestroyable = false;\n    model._pipelineResources.push(vertexBuffer);\n    const hasCpuCopy = false;\n    model.statistics.addBuffer(vertexBuffer, hasCpuCopy);\n  } else {\n    value = [implicitFeatureIds.offset];\n  }\n\n  const generatedFeatureIdAttribute = {\n    index: renderResources.attributeIndex++,\n    instanceDivisor: instanceDivisor,\n    value: value,\n    vertexBuffer: vertexBuffer,\n    normalize: false,\n    componentsPerAttribute: 1,\n    componentDatatype: ComponentDatatype.FLOAT,\n    strideInBytes: ComponentDatatype.getSizeInBytes(ComponentDatatype.FLOAT),\n    offsetInBytes: 0,\n  };\n\n  renderResources.attributes.push(generatedFeatureIdAttribute);\n}\n\n/**\n * Generates a typed array for implicit feature IDs\n * @private\n */\nfunction generateImplicitFeatureIdTypedArray(implicitFeatureIds, count) {\n  const offset = implicitFeatureIds.offset;\n  const repeat = implicitFeatureIds.repeat;\n\n  const typedArray = new Float32Array(count);\n  for (let i = 0; i < count; i++) {\n    typedArray[i] = offset + Math.floor(i / repeat);\n  }\n\n  return typedArray;\n}\n\nexport default FeatureIdPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void metadataStage(\\n\\\n  out Metadata metadata,\\n\\\n  out MetadataClass metadataClass,\\n\\\n  out MetadataStatistics metadataStatistics,\\n\\\n  ProcessedAttributes attributes\\n\\\n  )\\n\\\n{\\n\\\n  initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void metadataStage(\\n\\\n  out Metadata metadata,\\n\\\n  out MetadataClass metadataClass,\\n\\\n  out MetadataStatistics metadataStatistics,\\n\\\n  ProcessedAttributes attributes\\n\\\n  )\\n\\\n{\\n\\\n  initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);\\n\\\n  setMetadataVaryings();\\n\\\n}\\n\\\n\";\n", "import defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport MetadataStageFS from \"../../Shaders/Model/MetadataStageFS.js\";\nimport MetadataStageVS from \"../../Shaders/Model/MetadataStageVS.js\";\nimport MetadataType from \"../MetadataType.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\n/**\n * The metadata pipeline stage processes metadata properties from\n * EXT_structural_metadata and inserts them into a struct in the shader.\n * This struct will be used by {@link CustomShaderPipelineStage} to allow the\n * user to access metadata using {@link CustomShader}\n *\n * @namespace MetadataPipelineStage\n *\n * @private\n */\nconst MetadataPipelineStage = {\n  name: \"MetadataPipelineStage\",\n\n  STRUCT_ID_METADATA_VS: \"MetadataVS\",\n  STRUCT_ID_METADATA_FS: \"MetadataFS\",\n  STRUCT_NAME_METADATA: \"Metadata\",\n\n  STRUCT_ID_METADATA_CLASS_VS: \"MetadataClassVS\",\n  STRUCT_ID_METADATA_CLASS_FS: \"MetadataClassFS\",\n  STRUCT_NAME_METADATA_CLASS: \"MetadataClass\",\n\n  STRUCT_ID_METADATA_STATISTICS_VS: \"MetadataStatisticsVS\",\n  STRUCT_ID_METADATA_STATISTICS_FS: \"MetadataStatisticsFS\",\n  STRUCT_NAME_METADATA_STATISTICS: \"MetadataStatistics\",\n\n  FUNCTION_ID_INITIALIZE_METADATA_VS: \"initializeMetadataVS\",\n  FUNCTION_ID_INITIALIZE_METADATA_FS: \"initializeMetadataFS\",\n  FUNCTION_SIGNATURE_INITIALIZE_METADATA:\n    \"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)\",\n  FUNCTION_ID_SET_METADATA_VARYINGS: \"setMetadataVaryings\",\n  FUNCTION_SIGNATURE_SET_METADATA_VARYINGS: \"void setMetadataVaryings()\",\n\n  // Metadata class and statistics fields:\n  // - some must be renamed to avoid reserved words\n  // - some always have float/vec values, even for integer/ivec property types\n  METADATA_CLASS_FIELDS: [\n    { specName: \"noData\", shaderName: \"noData\" },\n    { specName: \"default\", shaderName: \"defaultValue\" },\n    { specName: \"min\", shaderName: \"minValue\" },\n    { specName: \"max\", shaderName: \"maxValue\" },\n  ],\n  METADATA_STATISTICS_FIELDS: [\n    { specName: \"min\", shaderName: \"minValue\" },\n    { specName: \"max\", shaderName: \"maxValue\" },\n    { specName: \"mean\", shaderName: \"mean\", type: \"float\" },\n    { specName: \"median\", shaderName: \"median\" },\n    {\n      specName: \"standardDeviation\",\n      shaderName: \"standardDeviation\",\n      type: \"float\",\n    },\n    { specName: \"variance\", shaderName: \"variance\", type: \"float\" },\n    { specName: \"sum\", shaderName: \"sum\" },\n  ],\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render\n * resources:\n * <ul>\n *   <li>Adds a Metadata struct to the shader</li>\n *   <li>If the primitive has structural metadata, properties are added to the Metadata struct</li>\n *   <li>dynamic functions are added to the shader to initialize the metadata properties</li>\n *   <li>Adds uniforms for property textures to the uniform map as needed</li>\n *   <li>Adds uniforms for offset/scale to the uniform map as needed</li>\n * </ul>\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {ModelComponents.Primitive} primitive The primitive to be rendered\n * @param {FrameState} frameState The frame state\n * @private\n */\nMetadataPipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  const { shaderBuilder, model } = renderResources;\n  const { structuralMetadata = {}, content } = model;\n  const statistics = content?.tileset.metadataExtension?.statistics;\n\n  const propertyAttributesInfo = getPropertyAttributesInfo(\n    structuralMetadata.propertyAttributes,\n    primitive,\n    statistics\n  );\n  const propertyTexturesInfo = getPropertyTexturesInfo(\n    structuralMetadata.propertyTextures,\n    statistics\n  );\n\n  // Declare <type>MetadataClass and <type>MetadataStatistics structs as needed\n  const allPropertyInfos = propertyAttributesInfo.concat(propertyTexturesInfo);\n  declareMetadataTypeStructs(shaderBuilder, allPropertyInfos);\n\n  // Always declare the Metadata, MetadataClass, and MetadataStatistics structs\n  // and the initializeMetadata() function, even if not used\n  declareStructsAndFunctions(shaderBuilder);\n  shaderBuilder.addVertexLines(MetadataStageVS);\n  shaderBuilder.addFragmentLines(MetadataStageFS);\n\n  for (let i = 0; i < propertyAttributesInfo.length; i++) {\n    const info = propertyAttributesInfo[i];\n    processPropertyAttributeProperty(renderResources, info);\n  }\n  for (let i = 0; i < propertyTexturesInfo.length; i++) {\n    const info = propertyTexturesInfo[i];\n    processPropertyTextureProperty(renderResources, info);\n  }\n};\n\n/**\n * Collect info about all properties of all propertyAttributes, and\n * return as a flattened Array\n * @param {PropertyAttribute[]} propertyAttributes The PropertyAttributes with properties to be described\n * @param {ModelComponents.Primitive} primitive The primitive to be rendered\n * @param {object} [statistics] Statistics about the properties (if the model is from a 3DTiles tileset)\n * @returns {Object[]} An array of objects containing information about each PropertyAttributeProperty\n * @private\n */\nfunction getPropertyAttributesInfo(propertyAttributes, primitive, statistics) {\n  if (!defined(propertyAttributes)) {\n    return [];\n  }\n  return propertyAttributes.flatMap((propertyAttribute) =>\n    getPropertyAttributeInfo(propertyAttribute, primitive, statistics)\n  );\n}\n\n/**\n * Collect info about the properties of a single PropertyAttribute\n * @param {PropertyAttribute} propertyAttribute The PropertyAttribute with properties to be described\n * @param {ModelComponents.Primitive} primitive The primitive to be rendered\n * @param {object} [statistics] Statistics about the properties (if the model is from a 3DTiles tileset)\n * @returns {Object[]} An array of objects containing information about each PropertyAttributeProperty\n * @private\n */\nfunction getPropertyAttributeInfo(propertyAttribute, primitive, statistics) {\n  const {\n    getAttributeByName,\n    getAttributeInfo,\n    sanitizeGlslIdentifier,\n  } = ModelUtility;\n\n  const classId = propertyAttribute.class.id;\n  const classStatistics = statistics?.classes[classId];\n\n  const propertiesArray = Object.entries(propertyAttribute.properties);\n  const infoArray = new Array(propertiesArray.length);\n\n  for (let i = 0; i < propertiesArray.length; i++) {\n    const [propertyId, property] = propertiesArray[i];\n    const modelAttribute = getAttributeByName(primitive, property.attribute);\n    const { glslType, variableName } = getAttributeInfo(modelAttribute);\n\n    infoArray[i] = {\n      metadataVariable: sanitizeGlslIdentifier(propertyId),\n      property,\n      type: property.classProperty.type,\n      glslType,\n      variableName,\n      propertyStatistics: classStatistics?.properties[propertyId],\n      shaderDestination: ShaderDestination.BOTH,\n    };\n  }\n\n  return infoArray;\n}\n\n/**\n * Collect info about all properties of all propertyTextures, and\n * return as a flattened Array\n * @param {PropertyTexture[]} propertyTextures The PropertyTextures with properties to be described\n * @param {object} [statistics] Statistics about the properties (if the model is from a 3DTiles tileset)\n * @returns {Object[]} An array of objects containing information about each PropertyTextureProperty\n * @private\n */\nfunction getPropertyTexturesInfo(propertyTextures, statistics) {\n  if (!defined(propertyTextures)) {\n    return [];\n  }\n  return propertyTextures.flatMap((propertyTexture) =>\n    getPropertyTextureInfo(propertyTexture, statistics)\n  );\n}\n\n/**\n * Collect info about the properties of a single PropertyTexture\n * @param {PropertyTexture} propertyTexture The PropertyTexture with properties to be described\n * @param {object} [statistics] Statistics about the properties (if the model is from a 3DTiles tileset)\n * @returns {Object[]} An array of objects containing information about each PropertyTextureProperty\n * @private\n */\nfunction getPropertyTextureInfo(propertyTexture, statistics) {\n  const { sanitizeGlslIdentifier } = ModelUtility;\n\n  const classId = propertyTexture.class.id;\n  const classStatistics = statistics?.classes[classId];\n\n  const propertiesArray = Object.entries(\n    propertyTexture.properties\n  ).filter(([id, property]) => property.isGpuCompatible());\n  const infoArray = new Array(propertiesArray.length);\n\n  for (let i = 0; i < propertiesArray.length; i++) {\n    const [propertyId, property] = propertiesArray[i];\n\n    infoArray[i] = {\n      metadataVariable: sanitizeGlslIdentifier(propertyId),\n      property,\n      type: property.classProperty.type,\n      glslType: property.getGlslType(),\n      propertyStatistics: classStatistics?.properties[propertyId],\n      shaderDestination: ShaderDestination.FRAGMENT,\n    };\n  }\n\n  return infoArray;\n}\n\n/**\n * Declare <type>MetadataClass structs in the shader for each PropertyAttributeProperty and PropertyTextureProperty\n * @param {ShaderBuilder} shaderBuilder The shader builder for the primitive\n * @param {Object[]} propertyInfos Information about the PropertyAttributeProperties and PropertyTextureProperties\n * @private\n */\nfunction declareMetadataTypeStructs(shaderBuilder, propertyInfos) {\n  const classTypes = new Set();\n  const statisticsTypes = new Set();\n\n  for (let i = 0; i < propertyInfos.length; i++) {\n    const { type, glslType, propertyStatistics } = propertyInfos[i];\n    classTypes.add(glslType);\n    if (!defined(propertyStatistics)) {\n      continue;\n    }\n    if (type !== MetadataType.ENUM) {\n      statisticsTypes.add(glslType);\n    }\n  }\n\n  const classFields = MetadataPipelineStage.METADATA_CLASS_FIELDS;\n  for (const metadataType of classTypes) {\n    const classStructName = `${metadataType}MetadataClass`;\n    declareTypeStruct(classStructName, metadataType, classFields);\n  }\n\n  const statisticsFields = MetadataPipelineStage.METADATA_STATISTICS_FIELDS;\n  for (const metadataType of statisticsTypes) {\n    const statisticsStructName = `${metadataType}MetadataStatistics`;\n    declareTypeStruct(statisticsStructName, metadataType, statisticsFields);\n  }\n\n  function declareTypeStruct(structName, type, fields) {\n    shaderBuilder.addStruct(structName, structName, ShaderDestination.BOTH);\n\n    for (let i = 0; i < fields.length; i++) {\n      const { shaderName } = fields[i];\n      const shaderType =\n        fields[i].type === \"float\" ? convertToFloatComponents(type) : type;\n      shaderBuilder.addStructField(structName, shaderType, shaderName);\n    }\n  }\n}\n\nconst floatConversions = {\n  int: \"float\",\n  ivec2: \"vec2\",\n  ivec3: \"vec3\",\n  ivec4: \"vec4\",\n};\n\n/**\n * For a type with integer components, find a corresponding float-component type\n * @param {string} type The name of a GLSL type with integer components\n * @returns {string} The name of a GLSL type of the same dimension with float components, if available; otherwise the input type\n * @private\n */\nfunction convertToFloatComponents(type) {\n  const converted = floatConversions[type];\n  return defined(converted) ? converted : type;\n}\n\n/**\n * Declare the main Metadata, MetadataClass, and MetadataStatistics structs\n * and the initializeMetadata() function.\n * @param {ShaderBuilder} shaderBuilder The shader builder for the primitive\n * @private\n */\nfunction declareStructsAndFunctions(shaderBuilder) {\n  // Declare the Metadata struct.\n  shaderBuilder.addStruct(\n    MetadataPipelineStage.STRUCT_ID_METADATA_VS,\n    MetadataPipelineStage.STRUCT_NAME_METADATA,\n    ShaderDestination.VERTEX\n  );\n  shaderBuilder.addStruct(\n    MetadataPipelineStage.STRUCT_ID_METADATA_FS,\n    MetadataPipelineStage.STRUCT_NAME_METADATA,\n    ShaderDestination.FRAGMENT\n  );\n\n  // Declare the MetadataClass struct\n  shaderBuilder.addStruct(\n    MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_VS,\n    MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS,\n    ShaderDestination.VERTEX\n  );\n  shaderBuilder.addStruct(\n    MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_FS,\n    MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS,\n    ShaderDestination.FRAGMENT\n  );\n\n  // Declare the MetadataStatistics struct\n  shaderBuilder.addStruct(\n    MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_VS,\n    MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS,\n    ShaderDestination.VERTEX\n  );\n  shaderBuilder.addStruct(\n    MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_FS,\n    MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS,\n    ShaderDestination.FRAGMENT\n  );\n\n  // declare the initializeMetadata() function. The details may differ\n  // between vertex and fragment shader\n  shaderBuilder.addFunction(\n    MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS,\n    MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA,\n    ShaderDestination.VERTEX\n  );\n  shaderBuilder.addFunction(\n    MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS,\n    MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA,\n    ShaderDestination.FRAGMENT\n  );\n\n  // declare the setMetadataVaryings() function in the vertex shader only.\n  shaderBuilder.addFunction(\n    MetadataPipelineStage.FUNCTION_ID_SET_METADATA_VARYINGS,\n    MetadataPipelineStage.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,\n    ShaderDestination.VERTEX\n  );\n}\n\n/**\n * Update the shader for a single PropertyAttributeProperty\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {object} propertyInfo Info about the PropertyAttributeProperty\n * @private\n */\nfunction processPropertyAttributeProperty(renderResources, propertyInfo) {\n  addPropertyAttributePropertyMetadata(renderResources, propertyInfo);\n  addPropertyMetadataClass(renderResources.shaderBuilder, propertyInfo);\n  addPropertyMetadataStatistics(renderResources.shaderBuilder, propertyInfo);\n}\n\n/**\n * Add fields to the Metadata struct, and metadata value assignments to the\n * initializeMetadata function, for a PropertyAttributeProperty\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {object} propertyInfo Info about the PropertyAttributeProperty\n * @private\n */\nfunction addPropertyAttributePropertyMetadata(renderResources, propertyInfo) {\n  const { shaderBuilder } = renderResources;\n  const { metadataVariable, property, glslType } = propertyInfo;\n\n  const valueExpression = addValueTransformUniforms({\n    valueExpression: `attributes.${propertyInfo.variableName}`,\n    renderResources: renderResources,\n    glslType: glslType,\n    metadataVariable: metadataVariable,\n    shaderDestination: ShaderDestination.BOTH,\n    property: property,\n  });\n\n  // declare the struct field\n  shaderBuilder.addStructField(\n    MetadataPipelineStage.STRUCT_ID_METADATA_VS,\n    glslType,\n    metadataVariable\n  );\n  shaderBuilder.addStructField(\n    MetadataPipelineStage.STRUCT_ID_METADATA_FS,\n    glslType,\n    metadataVariable\n  );\n\n  // assign the result to the metadata struct property.\n  const initializationLine = `metadata.${metadataVariable} = ${valueExpression};`;\n  shaderBuilder.addFunctionLines(\n    MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS,\n    [initializationLine]\n  );\n  shaderBuilder.addFunctionLines(\n    MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS,\n    [initializationLine]\n  );\n}\n\n/**\n * Update the shader for a single PropertyTextureProperty\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {Object[]} propertyInfo Info about the PropertyTextureProperty\n * @private\n */\nfunction processPropertyTextureProperty(renderResources, propertyInfo) {\n  addPropertyTexturePropertyMetadata(renderResources, propertyInfo);\n  addPropertyMetadataClass(renderResources.shaderBuilder, propertyInfo);\n  addPropertyMetadataStatistics(renderResources.shaderBuilder, propertyInfo);\n}\n\n/**\n * Add fields to the Metadata struct, and metadata value expressions to the\n * initializeMetadata function, for a PropertyTextureProperty\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {object} propertyInfo Info about the PropertyTextureProperty\n * @private\n */\nfunction addPropertyTexturePropertyMetadata(renderResources, propertyInfo) {\n  const { shaderBuilder, uniformMap } = renderResources;\n  const { metadataVariable, glslType, property } = propertyInfo;\n\n  const { texCoord, channels, index, texture } = property.textureReader;\n  const textureUniformName = `u_propertyTexture_${index}`;\n\n  // Property texture properties may share the same physical texture, so only\n  // add the texture uniform the first time we encounter it.\n  if (!uniformMap.hasOwnProperty(textureUniformName)) {\n    shaderBuilder.addUniform(\n      \"sampler2D\",\n      textureUniformName,\n      ShaderDestination.FRAGMENT\n    );\n    uniformMap[textureUniformName] = () => texture;\n  }\n\n  shaderBuilder.addStructField(\n    MetadataPipelineStage.STRUCT_ID_METADATA_FS,\n    glslType,\n    metadataVariable\n  );\n\n  // Get a GLSL expression for the value of the property\n  const texCoordVariable = `attributes.texCoord_${texCoord}`;\n  const valueExpression = `texture(${textureUniformName}, ${texCoordVariable}).${channels}`;\n\n  // Some types need an unpacking step or two. For example, since texture reads\n  // are always normalized, UINT8 (not normalized) properties need to be\n  // un-normalized in the shader.\n  const unpackedValue = property.unpackInShader(valueExpression);\n\n  const transformedValue = addValueTransformUniforms({\n    valueExpression: unpackedValue,\n    renderResources: renderResources,\n    glslType: glslType,\n    metadataVariable: metadataVariable,\n    shaderDestination: ShaderDestination.FRAGMENT,\n    property: property,\n  });\n\n  const initializationLine = `metadata.${metadataVariable} = ${transformedValue};`;\n  shaderBuilder.addFunctionLines(\n    MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS,\n    [initializationLine]\n  );\n}\n\n/**\n * Add fields to the MetadataClass struct, and metadataClass value expressions\n * to the initializeMetadata function, for a PropertyAttributeProperty or\n * PropertyTextureProperty\n * @param {ShaderBuilder} shaderBuilder The shader builder for the primitive\n * @param {object} propertyInfo Info about the PropertyAttributeProperty or PropertyTextureProperty\n * @private\n */\nfunction addPropertyMetadataClass(shaderBuilder, propertyInfo) {\n  const { classProperty } = propertyInfo.property;\n  const { metadataVariable, glslType, shaderDestination } = propertyInfo;\n\n  // Construct assignment statements to set values in the metadataClass struct\n  const assignments = getStructAssignments(\n    MetadataPipelineStage.METADATA_CLASS_FIELDS,\n    classProperty,\n    `metadataClass.${metadataVariable}`,\n    glslType\n  );\n\n  // Struct field: Prefix to get the appropriate <type>MetadataClass struct\n  const metadataType = `${glslType}MetadataClass`;\n  shaderBuilder.addStructField(\n    MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_FS,\n    metadataType,\n    metadataVariable\n  );\n  shaderBuilder.addFunctionLines(\n    MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS,\n    assignments\n  );\n  if (!ShaderDestination.includesVertexShader(shaderDestination)) {\n    return;\n  }\n  shaderBuilder.addStructField(\n    MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_VS,\n    metadataType,\n    metadataVariable\n  );\n  shaderBuilder.addFunctionLines(\n    MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS,\n    assignments\n  );\n}\n\n/**\n * Add fields to the MetadataStatistics struct, and metadataStatistics value\n * expressions to the initializeMetadata function, for a\n * PropertyAttributeProperty or PropertyTextureProperty\n * @param {ShaderBuilder} shaderBuilder The shader builder for the primitive\n * @param {object} propertyInfo Info about the PropertyAttributeProperty or PropertyTextureProperty\n * @private\n */\nfunction addPropertyMetadataStatistics(shaderBuilder, propertyInfo) {\n  const { propertyStatistics } = propertyInfo;\n  if (!defined(propertyStatistics)) {\n    return;\n  }\n  const { metadataVariable, type, glslType } = propertyInfo;\n  if (type === MetadataType.ENUM) {\n    // enums have an \"occurrences\" statistic which is not implemented yet\n    return;\n  }\n\n  // Construct assignment statements to set values in the metadataStatistics struct\n  const fields = MetadataPipelineStage.METADATA_STATISTICS_FIELDS;\n  const struct = `metadataStatistics.${metadataVariable}`;\n  const assignments = getStructAssignments(\n    fields,\n    propertyStatistics,\n    struct,\n    glslType\n  );\n\n  // Struct field: Prefix to get the appropriate <type>MetadataStatistics struct\n  const statisticsType = `${glslType}MetadataStatistics`;\n  shaderBuilder.addStructField(\n    MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_FS,\n    statisticsType,\n    metadataVariable\n  );\n  shaderBuilder.addFunctionLines(\n    MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS,\n    assignments\n  );\n  if (!ShaderDestination.includesVertexShader(propertyInfo.shaderDestination)) {\n    return;\n  }\n  shaderBuilder.addStructField(\n    MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_VS,\n    statisticsType,\n    metadataVariable\n  );\n  shaderBuilder.addFunctionLines(\n    MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS,\n    assignments\n  );\n}\n\n/**\n * Construct GLSL assignment statements to set metadata spec values in a struct\n * @param {Object[]} fieldNames An object with the following properties:\n * @param {string} fieldNames[].specName The name of the property in the spec\n * @param {string} fieldNames[].shaderName The name of the property in the shader\n * @param {object} values A source of property values, keyed on fieldNames[].specName\n * @param {string} struct The name of the struct to which values will be assigned\n * @param {string} type The type of the values to be assigned\n * @returns {Array<{name: string, value: any}>} Objects containing the property name (in the shader) and a GLSL assignment statement for the property value\n * @private\n */\nfunction getStructAssignments(fieldNames, values, struct, type) {\n  function constructAssignment(field) {\n    const value = values[field.specName];\n    if (defined(value)) {\n      return `${struct}.${field.shaderName} = ${type}(${value});`;\n    }\n  }\n  return defined(values)\n    ? fieldNames.map(constructAssignment).filter(defined)\n    : [];\n}\n\n/**\n * Handle offset/scale transform for a property value\n * This wraps the GLSL value expression with a czm_valueTransform() call\n *\n * @param {object} options Object with the following properties:\n * @param {string} options.valueExpression The GLSL value expression without the transform\n * @param {string} options.metadataVariable The name of the GLSL variable that will contain the property value\n * @param {string} options.glslType The GLSL type of the variable\n * @param {ShaderDestination} options.shaderDestination Which shader(s) use this variable\n * @param {PrimitiveRenderResources} options.renderResources The render resources for this primitive\n * @param {(PropertyAttributeProperty|PropertyTextureProperty)} options.property The property from which the value is derived\n * @returns {string} A wrapped GLSL value expression\n * @private\n */\nfunction addValueTransformUniforms(options) {\n  const { valueExpression, property } = options;\n\n  if (!property.hasValueTransform) {\n    return valueExpression;\n  }\n\n  const metadataVariable = options.metadataVariable;\n  const offsetUniformName = `u_${metadataVariable}_offset`;\n  const scaleUniformName = `u_${metadataVariable}_scale`;\n\n  const { shaderBuilder, uniformMap } = options.renderResources;\n  const { glslType, shaderDestination } = options;\n  shaderBuilder.addUniform(glslType, offsetUniformName, shaderDestination);\n  shaderBuilder.addUniform(glslType, scaleUniformName, shaderDestination);\n\n  const { offset, scale } = property;\n  uniformMap[offsetUniformName] = () => offset;\n  uniformMap[scaleUniformName] = () => scale;\n\n  return `czm_valueTransform(${offsetUniformName}, ${scaleUniformName}, ${valueExpression})`;\n}\n\nexport default MetadataPipelineStage;\n", "/**\n * An enum for controling how {@link CustomShader} handles translucency compared with the original\n * primitive.\n *\n * @enum {number}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst CustomShaderTranslucencyMode = {\n  /**\n   * Inherit translucency settings from the primitive's material. If the primitive used a\n   * translucent material, the custom shader will also be considered translucent. If the primitive\n   * used an opaque material, the custom shader will be considered opaque.\n   *\n   * @type {number}\n   * @constant\n   */\n  INHERIT: 0,\n  /**\n   * Force the primitive to render the primitive as opaque, ignoring any material settings.\n   *\n   * @type {number}\n   * @constant\n   */\n  OPAQUE: 1,\n  /**\n   * Force the primitive to render the primitive as translucent, ignoring any material settings.\n   *\n   * @type {number}\n   * @constant\n   */\n  TRANSLUCENT: 2,\n};\n\nexport default Object.freeze(CustomShaderTranslucencyMode);\n", "import combine from \"../../Core/combine.js\";\nimport defined from \"../../Core/defined.js\";\nimport oneTimeWarning from \"../../Core/oneTimeWarning.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport CustomShaderStageVS from \"../../Shaders/Model/CustomShaderStageVS.js\";\nimport CustomShaderStageFS from \"../../Shaders/Model/CustomShaderStageFS.js\";\nimport CustomShaderMode from \"./CustomShaderMode.js\";\nimport FeatureIdPipelineStage from \"./FeatureIdPipelineStage.js\";\nimport MetadataPipelineStage from \"./MetadataPipelineStage.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport CustomShaderTranslucencyMode from \"./CustomShaderTranslucencyMode.js\";\n\n/**\n * The custom shader pipeline stage takes GLSL callbacks from the\n * {@link CustomShader} and inserts them into the overall shader code for the\n * {@link Model}. The input to the callback is a struct with many\n * properties that depend on the attributes of the primitive. This shader code\n * is automatically generated by this stage.\n *\n * @namespace CustomShaderPipelineStage\n *\n * @private\n */\nconst CustomShaderPipelineStage = {\n  name: \"CustomShaderPipelineStage\", // Helps with debugging\n\n  STRUCT_ID_ATTRIBUTES_VS: \"AttributesVS\",\n  STRUCT_ID_ATTRIBUTES_FS: \"AttributesFS\",\n  STRUCT_NAME_ATTRIBUTES: \"Attributes\",\n  STRUCT_ID_VERTEX_INPUT: \"VertexInput\",\n  STRUCT_NAME_VERTEX_INPUT: \"VertexInput\",\n  STRUCT_ID_FRAGMENT_INPUT: \"FragmentInput\",\n  STRUCT_NAME_FRAGMENT_INPUT: \"FragmentInput\",\n  FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS: \"initializeInputStructVS\",\n  FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:\n    \"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)\",\n  FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS: \"initializeInputStructFS\",\n  FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:\n    \"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)\",\n\n  // Expose method for testing.\n  _oneTimeWarning: oneTimeWarning,\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render\n * resources:\n * <ul>\n *   <li>Modifies the shader to include the custom shader code to the vertex and fragment shaders</li>\n *   <li>Modifies the shader to include automatically-generated structs that serve as input to the custom shader callbacks </li>\n *   <li>Modifies the shader to include any additional user-defined uniforms</li>\n *   <li>Modifies the shader to include any additional user-defined varyings</li>\n *   <li>Adds any user-defined uniforms to the uniform map</li>\n *   <li>If the user specified a lighting model, the settings are overridden in the render resources</li>\n * </ul>\n * <p>\n * This pipeline stage is designed to fail gracefully where possible. If the\n * primitive does not have the right attributes to satisfy the shader code,\n * defaults will be inferred (when reasonable to do so). If not, the custom\n * shader will be disabled.\n * <p>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {ModelComponents.Primitive} primitive The primitive to be rendered\n * @param {FrameState} frameState The frame state.\n * @private\n */\nCustomShaderPipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  const { shaderBuilder, model, alphaOptions } = renderResources;\n  const { customShader } = model;\n\n  // Check the lighting model and translucent options first, as sometimes\n  // these are used even if there is no vertex or fragment shader text.\n  const { lightingModel, translucencyMode } = customShader;\n\n  // if present, the lighting model overrides the material's lighting model.\n  if (defined(lightingModel)) {\n    renderResources.lightingOptions.lightingModel = lightingModel;\n  }\n\n  if (translucencyMode === CustomShaderTranslucencyMode.TRANSLUCENT) {\n    alphaOptions.pass = Pass.TRANSLUCENT;\n  } else if (translucencyMode === CustomShaderTranslucencyMode.OPAQUE) {\n    // Use the default opqaue pass (either OPAQUE or 3D_TILES), regardless of whether\n    // the material pipeline stage used translucent. The default is configured\n    // in AlphaPipelineStage\n    alphaOptions.pass = undefined;\n  }\n  // For CustomShaderTranslucencyMode.INHERIT, do not modify alphaOptions.pass\n\n  // Generate lines of code for the shader, but don't add them to the shader\n  // yet.\n  const generatedCode = generateShaderLines(customShader, primitive);\n\n  // In some corner cases, the primitive may not be compatible with the\n  // shader. In this case, skip the custom shader.\n  if (!generatedCode.customShaderEnabled) {\n    return;\n  }\n  addLinesToShader(shaderBuilder, customShader, generatedCode);\n\n  // the input to the fragment shader may include a low-precision ECEF position\n  if (generatedCode.shouldComputePositionWC) {\n    shaderBuilder.addDefine(\n      \"COMPUTE_POSITION_WC_CUSTOM_SHADER\",\n      undefined,\n      ShaderDestination.BOTH\n    );\n  }\n\n  if (defined(customShader.vertexShaderText)) {\n    shaderBuilder.addDefine(\n      \"HAS_CUSTOM_VERTEX_SHADER\",\n      undefined,\n      ShaderDestination.VERTEX\n    );\n  }\n\n  if (defined(customShader.fragmentShaderText)) {\n    shaderBuilder.addDefine(\n      \"HAS_CUSTOM_FRAGMENT_SHADER\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n\n    // add defines like CUSTOM_SHADER_MODIFY_MATERIAL\n    const shaderModeDefine = CustomShaderMode.getDefineName(customShader.mode);\n    shaderBuilder.addDefine(\n      shaderModeDefine,\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n  }\n\n  const uniforms = customShader.uniforms;\n  for (const uniformName in uniforms) {\n    if (uniforms.hasOwnProperty(uniformName)) {\n      const uniform = uniforms[uniformName];\n      shaderBuilder.addUniform(uniform.type, uniformName);\n    }\n  }\n\n  const varyings = customShader.varyings;\n  for (const varyingName in varyings) {\n    if (varyings.hasOwnProperty(varyingName)) {\n      const varyingType = varyings[varyingName];\n      shaderBuilder.addVarying(varyingType, varyingName);\n    }\n  }\n\n  renderResources.uniformMap = combine(\n    renderResources.uniformMap,\n    customShader.uniformMap\n  );\n};\n\n/**\n * @private\n * @param {ModelComponents.Attribute[]} attributes\n * @returns {Object<string, ModelComponents.Attribute>}\n */\nfunction getAttributesByName(attributes) {\n  const names = {};\n  for (let i = 0; i < attributes.length; i++) {\n    const attributeInfo = ModelUtility.getAttributeInfo(attributes[i]);\n    names[attributeInfo.variableName] = attributeInfo;\n  }\n  return names;\n}\n\n// GLSL types of standard attribute types when uniquely defined\nconst attributeTypeLUT = {\n  position: \"vec3\",\n  normal: \"vec3\",\n  tangent: \"vec3\",\n  bitangent: \"vec3\",\n  texCoord: \"vec2\",\n  color: \"vec4\",\n  joints: \"ivec4\",\n  weights: \"vec4\",\n};\n\n// Corresponding attribute values\nconst attributeDefaultValueLUT = {\n  position: \"vec3(0.0)\",\n  normal: \"vec3(0.0, 0.0, 1.0)\",\n  tangent: \"vec3(1.0, 0.0, 0.0)\",\n  bitangent: \"vec3(0.0, 1.0, 0.0)\",\n  texCoord: \"vec2(0.0)\",\n  color: \"vec4(1.0)\",\n  joints: \"ivec4(0)\",\n  weights: \"vec4(0.0)\",\n};\n\nfunction inferAttributeDefaults(attributeName) {\n  // remove trailing set indices. E.g. \"texCoord_0\" -> \"texCoord\"\n  let trimmed = attributeName.replace(/_[0-9]+$/, \"\");\n  // also remove the MC/EC since they will have the same default value\n  trimmed = trimmed.replace(/(MC|EC)$/, \"\");\n\n  const glslType = attributeTypeLUT[trimmed];\n  const value = attributeDefaultValueLUT[trimmed];\n\n  // - _CUSTOM_ATTRIBUTE has an unknown type.\n  if (!defined(glslType)) {\n    return undefined;\n  }\n\n  return {\n    attributeField: [glslType, attributeName],\n    value: value,\n  };\n}\n\n/**\n * @private\n * @param {CustomShader} customShader\n * @param {Object<string, ModelComponents.Attribute>} attributesByName\n * @returns {object}\n */\nfunction generateVertexShaderLines(customShader, attributesByName) {\n  if (!defined(customShader.vertexShaderText)) {\n    return { enabled: false };\n  }\n\n  const primitiveAttributes = customShader.usedVariablesVertex.attributeSet;\n  const addToShader = getPrimitiveAttributesUsedInShader(\n    attributesByName,\n    primitiveAttributes,\n    false\n  );\n  const needsDefault = getAttributesNeedingDefaults(\n    attributesByName,\n    primitiveAttributes,\n    false\n  );\n\n  let vertexInitialization;\n  const attributeFields = [];\n  const initializationLines = [];\n  for (const variableName in addToShader) {\n    if (!addToShader.hasOwnProperty(variableName)) {\n      continue;\n    }\n    const attributeInfo = addToShader[variableName];\n    const attributeField = [attributeInfo.glslType, variableName];\n    attributeFields.push(attributeField);\n\n    // Initializing attribute structs are just a matter of copying the\n    // attribute or varying: E.g.:\n    // \"    vsInput.attributes.position = a_position;\"\n    vertexInitialization = `vsInput.attributes.${variableName} = attributes.${variableName};`;\n    initializationLines.push(vertexInitialization);\n  }\n\n  for (let i = 0; i < needsDefault.length; i++) {\n    const variableName = needsDefault[i];\n    const attributeDefaults = inferAttributeDefaults(variableName);\n    if (!defined(attributeDefaults)) {\n      CustomShaderPipelineStage._oneTimeWarning(\n        \"CustomShaderPipelineStage.incompatiblePrimitiveVS\",\n        `Primitive is missing attribute ${variableName}, disabling custom vertex shader`\n      );\n      // This primitive isn't compatible with the shader. Return early\n      // to skip the vertex shader\n      return { enabled: false };\n    }\n\n    attributeFields.push(attributeDefaults.attributeField);\n    vertexInitialization = `vsInput.attributes.${variableName} = ${attributeDefaults.value};`;\n    initializationLines.push(vertexInitialization);\n  }\n\n  return {\n    enabled: true,\n    attributeFields: attributeFields,\n    initializationLines: initializationLines,\n  };\n}\n\nfunction generatePositionBuiltins(customShader) {\n  const attributeFields = [];\n  const initializationLines = [];\n  const usedVariables = customShader.usedVariablesFragment.attributeSet;\n\n  // Model space position is the same position as in the glTF accessor,\n  // this is already added to the shader with other attributes.\n\n  // World coordinates in ECEF coordinates. Note that this is\n  // low precision (32-bit floats) on the GPU.\n  if (usedVariables.hasOwnProperty(\"positionWC\")) {\n    attributeFields.push([\"vec3\", \"positionWC\"]);\n    initializationLines.push(\n      \"fsInput.attributes.positionWC = attributes.positionWC;\"\n    );\n  }\n\n  // position in eye coordinates\n  if (usedVariables.hasOwnProperty(\"positionEC\")) {\n    attributeFields.push([\"vec3\", \"positionEC\"]);\n    initializationLines.push(\n      \"fsInput.attributes.positionEC = attributes.positionEC;\"\n    );\n  }\n\n  return {\n    attributeFields: attributeFields,\n    initializationLines: initializationLines,\n  };\n}\n\n/**\n * @private\n * @param {CustomShader} customShader\n * @param {Object<string, ModelComponents.Attribute>} attributesByName\n * @returns {object}\n */\nfunction generateFragmentShaderLines(customShader, attributesByName) {\n  if (!defined(customShader.fragmentShaderText)) {\n    return { enabled: false };\n  }\n\n  const primitiveAttributes = customShader.usedVariablesFragment.attributeSet;\n  const addToShader = getPrimitiveAttributesUsedInShader(\n    attributesByName,\n    primitiveAttributes,\n    true\n  );\n  const needsDefault = getAttributesNeedingDefaults(\n    attributesByName,\n    primitiveAttributes,\n    true\n  );\n\n  let fragmentInitialization;\n  const attributeFields = [];\n  const initializationLines = [];\n  for (const variableName in addToShader) {\n    if (!addToShader.hasOwnProperty(variableName)) {\n      continue;\n    }\n    const attributeInfo = addToShader[variableName];\n\n    const attributeField = [attributeInfo.glslType, variableName];\n    attributeFields.push(attributeField);\n\n    // Initializing attribute structs are just a matter of copying the\n    // value from the processed attributes\n    // \"    fsInput.attributes.positionMC = attributes.positionMC;\"\n    fragmentInitialization = `fsInput.attributes.${variableName} = attributes.${variableName};`;\n    initializationLines.push(fragmentInitialization);\n  }\n\n  for (let i = 0; i < needsDefault.length; i++) {\n    const variableName = needsDefault[i];\n    const attributeDefaults = inferAttributeDefaults(variableName);\n    if (!defined(attributeDefaults)) {\n      CustomShaderPipelineStage._oneTimeWarning(\n        \"CustomShaderPipelineStage.incompatiblePrimitiveFS\",\n        `Primitive is missing attribute ${variableName}, disabling custom fragment shader.`\n      );\n\n      // This primitive isn't compatible with the shader. Return early\n      // so the fragment shader is skipped\n      return { enabled: false };\n    }\n\n    attributeFields.push(attributeDefaults.attributeField);\n    fragmentInitialization = `fsInput.attributes.${variableName} = ${attributeDefaults.value};`;\n    initializationLines.push(fragmentInitialization);\n  }\n\n  // Built-ins for positions in various coordinate systems.\n  const positionBuiltins = generatePositionBuiltins(customShader);\n\n  return {\n    enabled: true,\n    attributeFields: attributeFields.concat(positionBuiltins.attributeFields),\n    initializationLines: positionBuiltins.initializationLines.concat(\n      initializationLines\n    ),\n  };\n}\n\n// These attributes are derived from positionMC, and are handled separately\n// from other attributes\nconst builtinAttributes = {\n  positionWC: true,\n  positionEC: true,\n};\n\n/**\n * Get the primitive attributes that are referenced in the shader\n *\n * @private\n * @param {Object<string, ModelComponents.Attribute>} primitiveAttributes set of all the primitive's attributes\n * @param {Object<string, ModelComponents.Attribute>} shaderAttributeSet set of all attributes used in the shader\n * @param {boolean} isFragmentShader\n * @returns {Object<string, ModelComponents.Attribute>} A dictionary of the primitive attributes used in the shader\n */\nfunction getPrimitiveAttributesUsedInShader(\n  primitiveAttributes,\n  shaderAttributeSet,\n  isFragmentShader\n) {\n  const addToShader = {};\n  for (const attributeName in primitiveAttributes) {\n    if (!primitiveAttributes.hasOwnProperty(attributeName)) {\n      continue;\n    }\n    const attribute = primitiveAttributes[attributeName];\n\n    // normals and tangents are in model coordinates in the attributes but\n    // in eye coordinates in the fragment shader.\n    let renamed = attributeName;\n    if (isFragmentShader && attributeName === \"normalMC\") {\n      renamed = \"normalEC\";\n    } else if (isFragmentShader && attributeName === \"tangentMC\") {\n      renamed = \"tangentEC\";\n      attribute.glslType = \"vec3\";\n    }\n\n    if (shaderAttributeSet.hasOwnProperty(renamed)) {\n      addToShader[renamed] = attribute;\n    }\n  }\n  return addToShader;\n}\n\n/**\n * Get the attributes that will need to have default values defined.\n * Attributes referenced in the shader which are not already defined\n * for the primitive and are not built-in will need default values.\n *\n * @private\n * @param {Object<string, ModelComponents.Attribute>} primitiveAttributes set of all the primitive's attributes\n * @param {Object<string, ModelComponents.Attribute>} shaderAttributeSet set of all attributes used in the shader\n * @param {boolean} isFragmentShader\n * @returns {string[]} The names of the attributes needing defaults\n */\nfunction getAttributesNeedingDefaults(\n  primitiveAttributes,\n  shaderAttributeSet,\n  isFragmentShader\n) {\n  const needDefaults = [];\n  for (const attributeName in shaderAttributeSet) {\n    if (!shaderAttributeSet.hasOwnProperty(attributeName)) {\n      continue;\n    }\n    if (builtinAttributes.hasOwnProperty(attributeName)) {\n      // Builtins are handled separately from attributes, so skip them here\n      continue;\n    }\n\n    // normals and tangents are in model coordinates in the attributes but\n    // in eye coordinates in the fragment shader.\n    let renamed = attributeName;\n    if (isFragmentShader && attributeName === \"normalEC\") {\n      renamed = \"normalMC\";\n    } else if (isFragmentShader && attributeName === \"tangentEC\") {\n      renamed = \"tangentMC\";\n    }\n\n    if (!primitiveAttributes.hasOwnProperty(renamed)) {\n      needDefaults.push(attributeName);\n    }\n  }\n  return needDefaults;\n}\n\n/**\n * @private\n * @param {CustomShader} customShader\n * @param {ModelComponents.Primitive} primitive\n * @returns {object}\n */\nfunction generateShaderLines(customShader, primitive) {\n  // Attempt to generate vertex and fragment shader lines before adding any\n  // code to the shader.\n  const attributesByName = getAttributesByName(primitive.attributes);\n  const vertexLines = generateVertexShaderLines(customShader, attributesByName);\n  const fragmentLines = generateFragmentShaderLines(\n    customShader,\n    attributesByName\n  );\n\n  // positionWC must be computed in the vertex shader\n  // for use in the fragmentShader. However, this can be skipped if:\n  // - positionWC isn't used in the fragment shader\n  // - or the fragment shader is disabled\n  const attributeSetFS = customShader.usedVariablesFragment.attributeSet;\n  const shouldComputePositionWC =\n    attributeSetFS.hasOwnProperty(\"positionWC\") && fragmentLines.enabled;\n\n  // Return any generated shader code along with some flags to indicate which\n  // defines should be added.\n  return {\n    vertexLines: vertexLines,\n    fragmentLines: fragmentLines,\n    customShaderEnabled: vertexLines.enabled || fragmentLines.enabled,\n    shouldComputePositionWC: shouldComputePositionWC,\n  };\n}\n\nfunction addVertexLinesToShader(shaderBuilder, vertexLines) {\n  let structId = CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_VS;\n  shaderBuilder.addStruct(\n    structId,\n    CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES,\n    ShaderDestination.VERTEX\n  );\n\n  const { attributeFields, initializationLines } = vertexLines;\n  for (let i = 0; i < attributeFields.length; i++) {\n    const [glslType, variableName] = attributeFields[i];\n    shaderBuilder.addStructField(structId, glslType, variableName);\n  }\n\n  // This could be hard-coded, but the symmetry with other structs makes unit\n  // tests more convenient\n  structId = CustomShaderPipelineStage.STRUCT_ID_VERTEX_INPUT;\n  shaderBuilder.addStruct(\n    structId,\n    CustomShaderPipelineStage.STRUCT_NAME_VERTEX_INPUT,\n    ShaderDestination.VERTEX\n  );\n  shaderBuilder.addStructField(\n    structId,\n    CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES,\n    \"attributes\"\n  );\n  // Add FeatureIds struct from the Feature ID stage\n  shaderBuilder.addStructField(\n    structId,\n    FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS,\n    \"featureIds\"\n  );\n  // Add Metadata struct from the metadata stage\n  shaderBuilder.addStructField(\n    structId,\n    MetadataPipelineStage.STRUCT_NAME_METADATA,\n    \"metadata\"\n  );\n  // Add MetadataClass struct from the metadata stage\n  shaderBuilder.addStructField(\n    structId,\n    MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS,\n    \"metadataClass\"\n  );\n  // Add MetadataStatistics struct from the metadata stage\n  shaderBuilder.addStructField(\n    structId,\n    MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS,\n    \"metadataStatistics\"\n  );\n\n  const functionId =\n    CustomShaderPipelineStage.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;\n  shaderBuilder.addFunction(\n    functionId,\n    CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,\n    ShaderDestination.VERTEX\n  );\n\n  shaderBuilder.addFunctionLines(functionId, initializationLines);\n}\n\nfunction addFragmentLinesToShader(shaderBuilder, fragmentLines) {\n  let structId = CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_FS;\n  shaderBuilder.addStruct(\n    structId,\n    CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES,\n    ShaderDestination.FRAGMENT\n  );\n\n  const { attributeFields, initializationLines } = fragmentLines;\n  for (let i = 0; i < attributeFields.length; i++) {\n    const [glslType, variableName] = attributeFields[i];\n    shaderBuilder.addStructField(structId, glslType, variableName);\n  }\n\n  structId = CustomShaderPipelineStage.STRUCT_ID_FRAGMENT_INPUT;\n  shaderBuilder.addStruct(\n    structId,\n    CustomShaderPipelineStage.STRUCT_NAME_FRAGMENT_INPUT,\n    ShaderDestination.FRAGMENT\n  );\n  shaderBuilder.addStructField(\n    structId,\n    CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES,\n    \"attributes\"\n  );\n  // Add FeatureIds struct from the Feature ID stage\n  shaderBuilder.addStructField(\n    structId,\n    FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS,\n    \"featureIds\"\n  );\n  // Add Metadata struct from the metadata stage\n  shaderBuilder.addStructField(\n    structId,\n    MetadataPipelineStage.STRUCT_NAME_METADATA,\n    \"metadata\"\n  );\n  // Add MetadataClass struct from the metadata stage\n  shaderBuilder.addStructField(\n    structId,\n    MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS,\n    \"metadataClass\"\n  );\n  // Add MetadataStatistics struct from the metadata stage\n  shaderBuilder.addStructField(\n    structId,\n    MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS,\n    \"metadataStatistics\"\n  );\n\n  const functionId =\n    CustomShaderPipelineStage.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;\n  shaderBuilder.addFunction(\n    functionId,\n    CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,\n    ShaderDestination.FRAGMENT\n  );\n\n  shaderBuilder.addFunctionLines(functionId, initializationLines);\n}\n\nconst scratchShaderLines = [];\n\nfunction addLinesToShader(shaderBuilder, customShader, generatedCode) {\n  const { vertexLines, fragmentLines } = generatedCode;\n  const shaderLines = scratchShaderLines;\n\n  if (vertexLines.enabled) {\n    addVertexLinesToShader(shaderBuilder, vertexLines);\n\n    shaderLines.length = 0;\n    shaderLines.push(\n      \"#line 0\",\n      customShader.vertexShaderText,\n      CustomShaderStageVS\n    );\n\n    shaderBuilder.addVertexLines(shaderLines);\n  }\n\n  if (fragmentLines.enabled) {\n    addFragmentLinesToShader(shaderBuilder, fragmentLines);\n\n    shaderLines.length = 0;\n    shaderLines.push(\n      \"#line 0\",\n      customShader.fragmentShaderText,\n      CustomShaderStageFS\n    );\n\n    shaderBuilder.addFragmentLines(shaderLines);\n  }\n}\n\nexport default CustomShaderPipelineStage;\n", "import defined from \"../../Core/defined.js\";\nimport Cartesian4 from \"../../Core/Cartesian4.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\n\n/**\n * The dequantization stage generates shader code to dequantize attributes\n * in the vertex shader\n *\n * @namespace DequantizationPipelineStage\n *\n * @private\n */\nconst DequantizationPipelineStage = {\n  name: \"DequantizationPipelineStage\", // Helps with debugging\n\n  FUNCTION_ID_DEQUANTIZATION_STAGE_VS: \"dequantizationStage\",\n  FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:\n    \"void dequantizationStage(inout ProcessedAttributes attributes)\",\n};\n\n/**\n * Process a primitive with quantized attributes. This stage modifies the\n * following parts of the render resources:\n * <ul>\n *  <li>generates dequantization function and adds it to the shader</li>\n *  <li>adds any uniforms needed for dequantization to the shader and uniform map</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nDequantizationPipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  const shaderBuilder = renderResources.shaderBuilder;\n  const model = renderResources.model;\n  const hasClassification = defined(model.classificationType);\n\n  shaderBuilder.addDefine(\n    \"USE_DEQUANTIZATION\",\n    undefined,\n    ShaderDestination.VERTEX\n  );\n\n  shaderBuilder.addFunction(\n    DequantizationPipelineStage.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,\n    DequantizationPipelineStage.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,\n    ShaderDestination.VERTEX\n  );\n\n  const attributes = primitive.attributes;\n  for (let i = 0; i < attributes.length; i++) {\n    const attribute = attributes[i];\n    const quantization = attribute.quantization;\n    if (!defined(quantization)) {\n      // Non-quantized attributes were already handled in GeometryPipelineStage\n      continue;\n    }\n\n    // Only the position and texcoord attributes are used for classification models.\n    const isPositionAttribute =\n      attribute.semantic === VertexAttributeSemantic.POSITION;\n    const isTexcoordAttribute =\n      attribute.semantic === VertexAttributeSemantic.TEXCOORD;\n    if (hasClassification && !isPositionAttribute && !isTexcoordAttribute) {\n      continue;\n    }\n\n    const attributeInfo = ModelUtility.getAttributeInfo(attribute);\n    updateDequantizationFunction(shaderBuilder, attributeInfo);\n    addDequantizationUniforms(renderResources, attributeInfo);\n  }\n};\n\nfunction addDequantizationUniforms(renderResources, attributeInfo) {\n  const shaderBuilder = renderResources.shaderBuilder;\n  const uniformMap = renderResources.uniformMap;\n  const variableName = attributeInfo.variableName;\n  const quantization = attributeInfo.attribute.quantization;\n\n  if (quantization.octEncoded) {\n    const normalizationRange = `model_normalizationRange_${variableName}`;\n    shaderBuilder.addUniform(\n      \"float\",\n      normalizationRange,\n      ShaderDestination.VERTEX\n    );\n    uniformMap[normalizationRange] = function () {\n      return quantization.normalizationRange;\n    };\n  } else {\n    const offset = `model_quantizedVolumeOffset_${variableName}`;\n    const stepSize = `model_quantizedVolumeStepSize_${variableName}`;\n    const glslType = attributeInfo.glslType;\n    shaderBuilder.addUniform(glslType, offset, ShaderDestination.VERTEX);\n    shaderBuilder.addUniform(glslType, stepSize, ShaderDestination.VERTEX);\n\n    let quantizedVolumeOffset = quantization.quantizedVolumeOffset;\n    let quantizedVolumeStepSize = quantization.quantizedVolumeStepSize;\n\n    // COLOR_n is promoted to a vec4 in the shader, so the alpha value\n    // defaults to 1. For correctness, the quantization uniforms must be\n    // promoted to vec4s. The alpha values are chosen so the alpha\n    // dequantization is the identity, i.e. 0.0 + 1.0 * color.a\n    if (/^color_\\d+$/.test(variableName)) {\n      quantizedVolumeOffset = promoteToVec4(quantizedVolumeOffset, 0);\n      quantizedVolumeStepSize = promoteToVec4(quantizedVolumeStepSize, 1);\n    }\n\n    uniformMap[offset] = function () {\n      return quantizedVolumeOffset;\n    };\n\n    uniformMap[stepSize] = function () {\n      return quantizedVolumeStepSize;\n    };\n  }\n}\n\nfunction promoteToVec4(value, defaultAlpha) {\n  if (value instanceof Cartesian4) {\n    return value;\n  }\n\n  return new Cartesian4(value.x, value.y, value.z, defaultAlpha);\n}\n\nfunction updateDequantizationFunction(shaderBuilder, attributeInfo) {\n  const variableName = attributeInfo.variableName;\n  const quantization = attributeInfo.attribute.quantization;\n\n  let line;\n  if (quantization.octEncoded) {\n    line = generateOctDecodeLine(variableName, quantization);\n  } else {\n    line = generateDequantizeLine(variableName);\n  }\n\n  shaderBuilder.addFunctionLines(\n    DequantizationPipelineStage.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,\n    [line]\n  );\n}\n\nfunction generateOctDecodeLine(variableName, quantization) {\n  const structField = `attributes.${variableName}`;\n\n  const quantizedAttribute = `a_quantized_${variableName}`;\n  const normalizationRange = `model_normalizationRange_${variableName}`;\n\n  // Draco stores things as .zxy instead of xyz, so be explicit about the\n  // swizzle to avoid confusion\n  const swizzle = quantization.octEncodedZXY ? \".zxy\" : \".xyz\";\n\n  // This generates lines such as:\n  // attributes.normal = czm_octDecode(a_quantized_normal, model_normalizationRange_normal).zxy;\n  return `${structField} = czm_octDecode(${quantizedAttribute}, ${normalizationRange})${swizzle};`;\n}\n\nfunction generateDequantizeLine(variableName) {\n  const structField = `attributes.${variableName}`;\n  const quantizedAttribute = `a_quantized_${variableName}`;\n  const offset = `model_quantizedVolumeOffset_${variableName}`;\n  const stepSize = `model_quantizedVolumeStepSize_${variableName}`;\n\n  // This generates lines such as:\n  // attributes.texCoord_0 = model_quantizedVolumeOffset_texCoord_0 + a_quantized_texCoord_0 * model_quantizedVolumeStepSize;\n  return `${structField} = ${offset} + ${quantizedAttribute} * ${stepSize};`;\n}\n\nexport default DequantizationPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void geometryStage(out ProcessedAttributes attributes)\\n\\\n{\\n\\\n  attributes.positionMC = v_positionMC;\\n\\\n  attributes.positionEC = v_positionEC;\\n\\\n\\n\\\n  #ifdef COMPUTE_POSITION_WC_CUSTOM_SHADER\\n\\\n  attributes.positionWC = v_positionWC;\\n\\\n  #endif\\n\\\n\\n\\\n  #ifdef HAS_NORMALS\\n\\\n  // renormalize after interpolation\\n\\\n  attributes.normalEC = normalize(v_normalEC);\\n\\\n  #endif\\n\\\n\\n\\\n  #ifdef HAS_TANGENTS\\n\\\n  attributes.tangentEC = normalize(v_tangentEC);\\n\\\n  #endif\\n\\\n\\n\\\n  #ifdef HAS_BITANGENTS\\n\\\n  attributes.bitangentEC = normalize(v_bitangentEC);\\n\\\n  #endif\\n\\\n\\n\\\n  // Everything else is dynamically generated in GeometryPipelineStage\\n\\\n  setDynamicVaryings(attributes);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) \\n\\\n{\\n\\\n    vec4 computedPosition;\\n\\\n\\n\\\n    // Compute positions in different coordinate systems\\n\\\n    vec3 positionMC = attributes.positionMC;\\n\\\n    v_positionMC = positionMC;\\n\\\n    v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz;\\n\\\n\\n\\\n    #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)\\n\\\n    vec3 position2D = attributes.position2D;\\n\\\n    vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz;\\n\\\n    computedPosition = czm_projection * vec4(positionEC, 1.0);\\n\\\n    #else\\n\\\n    computedPosition = czm_projection * vec4(v_positionEC, 1.0);\\n\\\n    #endif\\n\\\n\\n\\\n    // Sometimes the custom shader and/or style needs this\\n\\\n    #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE)\\n\\\n    // Note that this is a 32-bit position which may result in jitter on small\\n\\\n    // scales.\\n\\\n    v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_NORMALS\\n\\\n    v_normalEC = normalize(normal * attributes.normalMC);\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_TANGENTS\\n\\\n    v_tangentEC = normalize(normal * attributes.tangentMC);    \\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_BITANGENTS\\n\\\n    v_bitangentEC = normalize(normal * attributes.bitangentMC);\\n\\\n    #endif\\n\\\n\\n\\\n    // All other varyings need to be dynamically generated in\\n\\\n    // GeometryPipelineStage\\n\\\n    setDynamicVaryings(attributes);\\n\\\n    \\n\\\n    return computedPosition;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec2 computeSt(float featureId)\\n\\\n{\\n\\\n    float stepX = model_textureStep.x;\\n\\\n    float centerX = model_textureStep.y;\\n\\\n\\n\\\n    #ifdef MULTILINE_BATCH_TEXTURE\\n\\\n    float stepY = model_textureStep.z;\\n\\\n    float centerY = model_textureStep.w;\\n\\\n\\n\\\n    float xId = mod(featureId, model_textureDimensions.x); \\n\\\n    float yId = floor(featureId / model_textureDimensions.x);\\n\\\n    \\n\\\n    return vec2(centerX + (xId * stepX), centerY + (yId * stepY));\\n\\\n    #else\\n\\\n    return vec2(centerX + (featureId * stepX), 0.5);\\n\\\n    #endif\\n\\\n}\\n\\\n\\n\\\nvoid selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)\\n\\\n{   \\n\\\n    int featureId = featureIds.SELECTED_FEATURE_ID;\\n\\\n\\n\\\n\\n\\\n    if (featureId < model_featuresLength)\\n\\\n    {\\n\\\n        vec2 featureSt = computeSt(float(featureId));\\n\\\n\\n\\\n        feature.id = featureId;\\n\\\n        feature.st = featureSt;\\n\\\n        feature.color = texture(model_batchTexture, featureSt);\\n\\\n    }\\n\\\n    // Floating point comparisons can be unreliable in GLSL, so we\\n\\\n    // increment the feature ID to make sure it's always greater\\n\\\n    // then the model_featuresLength - a condition we check for in the\\n\\\n    // pick ID, to avoid sampling the pick texture if the feature ID is\\n\\\n    // greater than the number of features.\\n\\\n    else\\n\\\n    {\\n\\\n        feature.id = model_featuresLength + 1;\\n\\\n        feature.st = vec2(0.0);\\n\\\n        feature.color = vec4(1.0);\\n\\\n    }\\n\\\n\\n\\\n    #ifdef HAS_NULL_FEATURE_ID\\n\\\n    if (featureId == model_nullFeatureId) {\\n\\\n        feature.id = featureId;\\n\\\n        feature.st = vec2(0.0);\\n\\\n        feature.color = vec4(1.0);\\n\\\n    }\\n\\\n    #endif\\n\\\n}\\n\\\n\";\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport SelectedFeatureIdStageCommon from \"../../Shaders/Model/SelectedFeatureIdStageCommon.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\n/**\n * The selected feature ID pipeline stage is responsible for handling the\n * set of feature IDs selected for styling/picking.\n *\n * @namespace SelectedFeatureIdPipelineStage\n * @private\n */\nconst SelectedFeatureIdPipelineStage = {\n  name: \"SelectedFeatureIdPipelineStage\", // Helps with debugging\n\n  STRUCT_ID_SELECTED_FEATURE: \"SelectedFeature\",\n  STRUCT_NAME_SELECTED_FEATURE: \"SelectedFeature\",\n  FUNCTION_ID_FEATURE_VARYINGS_VS: \"updateFeatureStructVS\",\n  FUNCTION_ID_FEATURE_VARYINGS_FS: \"updateFeatureStructFS\",\n  FUNCTION_SIGNATURE_UPDATE_FEATURE:\n    \"void updateFeatureStruct(inout SelectedFeature feature)\",\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render resources:\n * <ul>\n *  <li>sets the defines for the feature ID attribute to use for styling/picking</li>\n *  <li>adds fields to the SelectedFeature struct in the shader</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n */\nSelectedFeatureIdPipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  const shaderBuilder = renderResources.shaderBuilder;\n\n  renderResources.hasPropertyTable = true;\n\n  const model = renderResources.model;\n  const node = renderResources.runtimeNode.node;\n  const selectedFeatureIds = getSelectedFeatureIds(model, node, primitive);\n  const shaderDestination = selectedFeatureIds.shaderDestination;\n\n  shaderBuilder.addDefine(\n    \"HAS_SELECTED_FEATURE_ID\",\n    undefined,\n    shaderDestination\n  );\n\n  // Add a define to insert the variable to use.\n  // Example: #define SELECTED_FEATURE_ID featureId_1\n  // This corresponds to featureIds.featureId_1\n  shaderBuilder.addDefine(\n    \"SELECTED_FEATURE_ID\",\n    selectedFeatureIds.variableName,\n    shaderDestination\n  );\n\n  // Add a define to the shader to distinguish feature ID attributes from\n  // textures. This is needed for determining where to filter features\n  // by pass type.\n  shaderBuilder.addDefine(\n    selectedFeatureIds.featureIdDefine,\n    undefined,\n    shaderDestination\n  );\n\n  updateFeatureStruct(shaderBuilder);\n\n  const nullFeatureId = selectedFeatureIds.featureIds.nullFeatureId;\n  const uniformMap = renderResources.uniformMap;\n  if (defined(nullFeatureId)) {\n    shaderBuilder.addDefine(\n      \"HAS_NULL_FEATURE_ID\",\n      undefined,\n      shaderDestination\n    );\n    shaderBuilder.addUniform(\"int\", \"model_nullFeatureId\", shaderDestination);\n    uniformMap.model_nullFeatureId = function () {\n      return nullFeatureId;\n    };\n  }\n\n  if (selectedFeatureIds.shaderDestination === ShaderDestination.BOTH) {\n    shaderBuilder.addVertexLines(SelectedFeatureIdStageCommon);\n  }\n  shaderBuilder.addFragmentLines(SelectedFeatureIdStageCommon);\n};\n\nfunction getFeatureIdDefine(featureIds) {\n  if (featureIds instanceof ModelComponents.FeatureIdTexture) {\n    return \"HAS_SELECTED_FEATURE_ID_TEXTURE\";\n  }\n\n  return \"HAS_SELECTED_FEATURE_ID_ATTRIBUTE\";\n}\n\nfunction getShaderDestination(featureIds) {\n  // Feature ID textures are only supported in the fragment shader.\n  if (featureIds instanceof ModelComponents.FeatureIdTexture) {\n    return ShaderDestination.FRAGMENT;\n  }\n\n  return ShaderDestination.BOTH;\n}\n\nfunction getSelectedFeatureIds(model, node, primitive) {\n  let variableName;\n  let featureIds;\n  // Check instances first, as this is the most specific type of\n  // feature ID\n  if (defined(node.instances)) {\n    featureIds = ModelUtility.getFeatureIdsByLabel(\n      node.instances.featureIds,\n      model.instanceFeatureIdLabel\n    );\n\n    if (defined(featureIds)) {\n      // Either label could be used here, but prefer label as it may be more\n      // meaningful when debugging\n      variableName = defaultValue(featureIds.label, featureIds.positionalLabel);\n      return {\n        featureIds: featureIds,\n        variableName: variableName,\n        shaderDestination: getShaderDestination(featureIds),\n        featureIdDefine: getFeatureIdDefine(featureIds),\n      };\n    }\n  }\n\n  featureIds = ModelUtility.getFeatureIdsByLabel(\n    primitive.featureIds,\n    model.featureIdLabel\n  );\n  // again, prefer label for being more descriptive\n  variableName = defaultValue(featureIds.label, featureIds.positionalLabel);\n  return {\n    featureIds: featureIds,\n    variableName: variableName,\n    shaderDestination: getShaderDestination(featureIds),\n    featureIdDefine: getFeatureIdDefine(featureIds),\n  };\n}\n\n/**\n * Populate the \"SelectedFeature\" struct in the shaders that holds information about the \"active\" (used for picking/styling) feature.\n * The struct is always added to the shader by the GeometryPipelineStage (required for compilation). The SelectedFeature struct looks\n * as follows:\n *\n * struct SelectedFeature {\n *   int id;\n *   vec2 st;\n *   vec4 color;\n * }\n *\n * @private\n */\nfunction updateFeatureStruct(shaderBuilder) {\n  shaderBuilder.addStructField(\n    SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE,\n    \"int\",\n    \"id\"\n  );\n\n  shaderBuilder.addStructField(\n    SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE,\n    \"vec2\",\n    \"st\"\n  );\n\n  shaderBuilder.addStructField(\n    SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE,\n    \"vec4\",\n    \"color\"\n  );\n}\n\nexport default SelectedFeatureIdPipelineStage;\n", "import ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport PrimitiveType from \"../../Core/PrimitiveType.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport GeometryStageFS from \"../../Shaders/Model/GeometryStageFS.js\";\nimport GeometryStageVS from \"../../Shaders/Model/GeometryStageVS.js\";\nimport AttributeType from \"../AttributeType.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport ModelType from \"./ModelType.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport SelectedFeatureIdPipelineStage from \"./SelectedFeatureIdPipelineStage.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\n\n/**\n * The geometry pipeline stage processes the vertex attributes of a primitive.\n *\n * @namespace GeometryPipelineStage\n *\n * @private\n */\nconst GeometryPipelineStage = {\n  name: \"GeometryPipelineStage\", // Helps with debugging\n\n  STRUCT_ID_PROCESSED_ATTRIBUTES_VS: \"ProcessedAttributesVS\",\n  STRUCT_ID_PROCESSED_ATTRIBUTES_FS: \"ProcessedAttributesFS\",\n  STRUCT_NAME_PROCESSED_ATTRIBUTES: \"ProcessedAttributes\",\n  FUNCTION_ID_INITIALIZE_ATTRIBUTES: \"initializeAttributes\",\n  FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:\n    \"void initializeAttributes(out ProcessedAttributes attributes)\",\n  FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS: \"setDynamicVaryingsVS\",\n  FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS: \"setDynamicVaryingsFS\",\n  FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:\n    \"void setDynamicVaryings(inout ProcessedAttributes attributes)\",\n};\n\n/**\n * This pipeline stage processes the vertex attributes of a primitive,\n * adding attribute declarations to the shaders, adding attribute objects to the\n * render resources, and setting define flags as needed.\n *\n * Processes a primitive. This stage modifies the following parts of the render resources:\n * <ul>\n *  <li> adds attribute and varying declarations for the vertex attributes in the vertex and fragment shaders\n *  <li> creates the objects required to create VertexArrays\n *  <li> sets the flag for point primitive types\n * </ul>\n *\n * If the scene is in either 2D or CV mode, this stage also:\n * <ul>\n *  <li> adds a struct field for the 2D positions\n *  <li> adds an additional attribute object and declaration if the node containing this primitive is not instanced\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nGeometryPipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  const shaderBuilder = renderResources.shaderBuilder;\n  const model = renderResources.model;\n\n  // These structs are similar, though the fragment shader version has a couple\n  // additional fields.\n  shaderBuilder.addStruct(\n    GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,\n    \"ProcessedAttributes\",\n    ShaderDestination.VERTEX\n  );\n  shaderBuilder.addStruct(\n    GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,\n    \"ProcessedAttributes\",\n    ShaderDestination.FRAGMENT\n  );\n\n  // The Feature struct is always added since it's required for compilation.\n  // It may be unused if features are not present.\n  shaderBuilder.addStruct(\n    SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE,\n    SelectedFeatureIdPipelineStage.STRUCT_NAME_SELECTED_FEATURE,\n    ShaderDestination.BOTH\n  );\n\n  // This initialization function is only needed in the vertex shader,\n  // it assigns the non-quantized attribute struct fields from the\n  // physical attributes\n  shaderBuilder.addFunction(\n    GeometryPipelineStage.FUNCTION_ID_INITIALIZE_ATTRIBUTES,\n    GeometryPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,\n    ShaderDestination.VERTEX\n  );\n\n  // Positions in other coordinate systems need more variables\n  shaderBuilder.addVarying(\"vec3\", \"v_positionWC\");\n  shaderBuilder.addVarying(\"vec3\", \"v_positionEC\");\n  shaderBuilder.addStructField(\n    GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,\n    \"vec3\",\n    \"positionWC\"\n  );\n  shaderBuilder.addStructField(\n    GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,\n    \"vec3\",\n    \"positionEC\"\n  );\n\n  // Though they have identical signatures, the implementation is different\n  // between vertex and fragment shaders. The VS stores attributes in\n  // varyings, while the FS unpacks the varyings for use by other stages.\n  shaderBuilder.addFunction(\n    GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,\n    GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,\n    ShaderDestination.VERTEX\n  );\n  shaderBuilder.addFunction(\n    GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,\n    GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,\n    ShaderDestination.FRAGMENT\n  );\n\n  // .pnts point clouds store sRGB color rather than linear color\n  const modelType = model.type;\n  if (modelType === ModelType.TILE_PNTS) {\n    shaderBuilder.addDefine(\n      \"HAS_SRGB_COLOR\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n  }\n\n  // Attributes, structs, and functions will need to be modified for 2D / CV.\n  const use2D =\n    frameState.mode !== SceneMode.SCENE3D &&\n    !frameState.scene3DOnly &&\n    model._projectTo2D;\n\n  // If the model is instanced, the work for 2D projection will have been done\n  // in InstancingPipelineStage. The attribute struct will be updated with\n  // position2D, but nothing else should be modified.\n  const instanced = defined(renderResources.runtimeNode.node.instances);\n\n  // If the scene is in 3D or the model is instanced, the 2D position attribute\n  // is not needed, so don't increment attributeIndex.\n  const incrementIndexFor2D = use2D && !instanced;\n  const length = primitive.attributes.length;\n  for (let i = 0; i < length; i++) {\n    const attribute = primitive.attributes[i];\n    const attributeLocationCount = AttributeType.getAttributeLocationCount(\n      attribute.type\n    );\n\n    //>>includeStart('debug', pragmas.debug);\n    if (!defined(attribute.buffer) && !defined(attribute.constant)) {\n      throw new DeveloperError(\n        \"Attributes must be provided as a Buffer or constant value\"\n      );\n    }\n    //>>includeEnd('debug');\n\n    const isPositionAttribute =\n      attribute.semantic === VertexAttributeSemantic.POSITION;\n\n    let index;\n    if (attributeLocationCount > 1) {\n      index = renderResources.attributeIndex;\n      renderResources.attributeIndex += attributeLocationCount;\n    } else if (isPositionAttribute && !incrementIndexFor2D) {\n      index = 0;\n    } else {\n      index = renderResources.attributeIndex++;\n    }\n\n    processAttribute(\n      renderResources,\n      attribute,\n      index,\n      attributeLocationCount,\n      use2D,\n      instanced\n    );\n  }\n\n  handleBitangents(shaderBuilder, primitive.attributes);\n\n  if (primitive.primitiveType === PrimitiveType.POINTS) {\n    shaderBuilder.addDefine(\"PRIMITIVE_TYPE_POINTS\");\n  }\n\n  shaderBuilder.addVertexLines(GeometryStageVS);\n  shaderBuilder.addFragmentLines(GeometryStageFS);\n};\n\nfunction processAttribute(\n  renderResources,\n  attribute,\n  attributeIndex,\n  attributeLocationCount,\n  use2D,\n  instanced\n) {\n  const shaderBuilder = renderResources.shaderBuilder;\n  const attributeInfo = ModelUtility.getAttributeInfo(attribute);\n\n  // This indicates to only modify the resources for 2D if the model is\n  // not instanced.\n  const modifyFor2D = use2D && !instanced;\n\n  if (attributeLocationCount > 1) {\n    // Matrices are stored as multiple attributes, one per column vector.\n    addMatrixAttributeToRenderResources(\n      renderResources,\n      attribute,\n      attributeIndex,\n      attributeLocationCount\n    );\n  } else {\n    addAttributeToRenderResources(\n      renderResources,\n      attribute,\n      attributeIndex,\n      modifyFor2D\n    );\n  }\n\n  addAttributeDeclaration(shaderBuilder, attributeInfo, modifyFor2D);\n  addVaryingDeclaration(shaderBuilder, attributeInfo);\n\n  // For common attributes like normals and tangents, the code is\n  // already in GeometryStageVS, we just need to enable it.\n  if (defined(attribute.semantic)) {\n    addSemanticDefine(shaderBuilder, attribute);\n  }\n\n  // Dynamically generate GLSL code for the current attribute.\n  // For 2D projection, the position2D field will always be added\n  // to the attributes struct, even if the model is instanced.\n  updateAttributesStruct(shaderBuilder, attributeInfo, use2D);\n  updateInitializeAttributesFunction(shaderBuilder, attributeInfo, modifyFor2D);\n  updateSetDynamicVaryingsFunction(shaderBuilder, attributeInfo);\n}\n\nfunction addSemanticDefine(shaderBuilder, attribute) {\n  const semantic = attribute.semantic;\n  const setIndex = attribute.setIndex;\n  switch (semantic) {\n    case VertexAttributeSemantic.NORMAL:\n      shaderBuilder.addDefine(\"HAS_NORMALS\");\n      break;\n    case VertexAttributeSemantic.TANGENT:\n      shaderBuilder.addDefine(\"HAS_TANGENTS\");\n      break;\n    case VertexAttributeSemantic.FEATURE_ID:\n      // `_FEATURE_ID starts with an underscore so no need to double the\n      // underscore.\n      shaderBuilder.addDefine(`HAS${semantic}_${setIndex}`);\n      break;\n    case VertexAttributeSemantic.TEXCOORD:\n    case VertexAttributeSemantic.COLOR:\n      shaderBuilder.addDefine(`HAS_${semantic}_${setIndex}`);\n  }\n}\n\nfunction addAttributeToRenderResources(\n  renderResources,\n  attribute,\n  attributeIndex,\n  modifyFor2D\n) {\n  const quantization = attribute.quantization;\n  let type;\n  let componentDatatype;\n  if (defined(quantization)) {\n    type = quantization.type;\n    componentDatatype = quantization.componentDatatype;\n  } else {\n    type = attribute.type;\n    componentDatatype = attribute.componentDatatype;\n  }\n\n  const semantic = attribute.semantic;\n  const setIndex = attribute.setIndex;\n  if (\n    semantic === VertexAttributeSemantic.FEATURE_ID &&\n    setIndex >= renderResources.featureIdVertexAttributeSetIndex\n  ) {\n    renderResources.featureIdVertexAttributeSetIndex = setIndex + 1;\n  }\n\n  // The position attribute should always be in the first index.\n  const isPositionAttribute = semantic === VertexAttributeSemantic.POSITION;\n  const index = isPositionAttribute ? 0 : attributeIndex;\n  const componentsPerAttribute = AttributeType.getNumberOfComponents(type);\n\n  const vertexAttribute = {\n    index: index,\n    value: defined(attribute.buffer) ? undefined : attribute.constant,\n    vertexBuffer: attribute.buffer,\n    count: attribute.count,\n    componentsPerAttribute: componentsPerAttribute,\n    componentDatatype: componentDatatype,\n    offsetInBytes: attribute.byteOffset,\n    strideInBytes: attribute.byteStride,\n    normalize: attribute.normalized,\n  };\n\n  renderResources.attributes.push(vertexAttribute);\n\n  if (!isPositionAttribute || !modifyFor2D) {\n    return;\n  }\n\n  // Add an additional attribute for the projected positions in 2D / CV.\n  const buffer2D = renderResources.runtimePrimitive.positionBuffer2D;\n  const positionAttribute2D = {\n    index: attributeIndex,\n    vertexBuffer: buffer2D,\n    count: attribute.count,\n    componentsPerAttribute: componentsPerAttribute,\n    componentDatatype: ComponentDatatype.FLOAT, // Projected positions will always be floats.\n    offsetInBytes: 0,\n    strideInBytes: undefined,\n    normalize: attribute.normalized,\n  };\n\n  renderResources.attributes.push(positionAttribute2D);\n}\n\nfunction addMatrixAttributeToRenderResources(\n  renderResources,\n  attribute,\n  attributeIndex,\n  columnCount\n) {\n  const quantization = attribute.quantization;\n  let type;\n  let componentDatatype;\n  if (defined(quantization)) {\n    type = quantization.type;\n    componentDatatype = quantization.componentDatatype;\n  } else {\n    type = attribute.type;\n    componentDatatype = attribute.componentDatatype;\n  }\n\n  const normalized = attribute.normalized;\n\n  // componentCount is either 4, 9 or 16\n  const componentCount = AttributeType.getNumberOfComponents(type);\n  // componentsPerColumn is either 2, 3, or 4\n  const componentsPerColumn = componentCount / columnCount;\n\n  const componentSizeInBytes = ComponentDatatype.getSizeInBytes(\n    componentDatatype\n  );\n\n  const columnLengthInBytes = componentsPerColumn * componentSizeInBytes;\n\n  // The stride between corresponding columns of two matrices is constant\n  // regardless of where you start\n  const strideInBytes = attribute.byteStride;\n\n  for (let i = 0; i < columnCount; i++) {\n    const offsetInBytes = attribute.byteOffset + i * columnLengthInBytes;\n\n    // upload a single column vector.\n    const columnAttribute = {\n      index: attributeIndex + i,\n      vertexBuffer: attribute.buffer,\n      componentsPerAttribute: componentsPerColumn,\n      componentDatatype: componentDatatype,\n      offsetInBytes: offsetInBytes,\n      strideInBytes: strideInBytes,\n      normalize: normalized,\n    };\n\n    renderResources.attributes.push(columnAttribute);\n  }\n}\n\nfunction addVaryingDeclaration(shaderBuilder, attributeInfo) {\n  const variableName = attributeInfo.variableName;\n  let varyingName = `v_${variableName}`;\n\n  let glslType;\n  if (variableName === \"normalMC\") {\n    // though the attribute is in model coordinates, the varying is\n    // in eye coordinates.\n    varyingName = \"v_normalEC\";\n    glslType = attributeInfo.glslType;\n  } else if (variableName === \"tangentMC\") {\n    // Tangent's glslType is vec4, but in the shader it is split into\n    // vec3 tangent and vec3 bitangent\n    glslType = \"vec3\";\n    // like normalMC, the varying is converted to eye coordinates\n    varyingName = \"v_tangentEC\";\n  } else {\n    glslType = attributeInfo.glslType;\n  }\n\n  shaderBuilder.addVarying(glslType, varyingName);\n}\n\nfunction addAttributeDeclaration(shaderBuilder, attributeInfo, modifyFor2D) {\n  const semantic = attributeInfo.attribute.semantic;\n  const variableName = attributeInfo.variableName;\n\n  let attributeName;\n  let glslType;\n  if (attributeInfo.isQuantized) {\n    attributeName = `a_quantized_${variableName}`;\n    glslType = attributeInfo.quantizedGlslType;\n  } else {\n    attributeName = `a_${variableName}`;\n    glslType = attributeInfo.glslType;\n  }\n\n  const isPosition = semantic === VertexAttributeSemantic.POSITION;\n  if (isPosition) {\n    shaderBuilder.setPositionAttribute(glslType, attributeName);\n  } else {\n    shaderBuilder.addAttribute(glslType, attributeName);\n  }\n\n  if (isPosition && modifyFor2D) {\n    shaderBuilder.addAttribute(\"vec3\", \"a_position2D\");\n  }\n}\n\nfunction updateAttributesStruct(shaderBuilder, attributeInfo, use2D) {\n  const vsStructId = GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS;\n  const fsStructId = GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS;\n  const variableName = attributeInfo.variableName;\n\n  if (variableName === \"tangentMC\") {\n    // The w component of the tangent is only used for computing the bitangent,\n    // so it can be separated from the other tangent components.\n    shaderBuilder.addStructField(vsStructId, \"vec3\", \"tangentMC\");\n    shaderBuilder.addStructField(vsStructId, \"float\", \"tangentSignMC\");\n    // The tangent is in model coordinates in the vertex shader\n    // but in eye space in the fragment coordinates\n    shaderBuilder.addStructField(fsStructId, \"vec3\", \"tangentEC\");\n  } else if (variableName === \"normalMC\") {\n    // Normals are in model coordinates in the vertex shader but in eye\n    // coordinates in the fragment shader\n    shaderBuilder.addStructField(vsStructId, \"vec3\", \"normalMC\");\n    shaderBuilder.addStructField(fsStructId, \"vec3\", \"normalEC\");\n  } else {\n    shaderBuilder.addStructField(\n      vsStructId,\n      attributeInfo.glslType,\n      variableName\n    );\n    shaderBuilder.addStructField(\n      fsStructId,\n      attributeInfo.glslType,\n      variableName\n    );\n  }\n\n  if (variableName === \"positionMC\" && use2D) {\n    shaderBuilder.addStructField(vsStructId, \"vec3\", \"position2D\");\n  }\n}\n\nfunction updateInitializeAttributesFunction(\n  shaderBuilder,\n  attributeInfo,\n  use2D\n) {\n  const functionId = GeometryPipelineStage.FUNCTION_ID_INITIALIZE_ATTRIBUTES;\n  const variableName = attributeInfo.variableName;\n\n  // If the scene is in 2D / CV mode, this line should always be added\n  // regardless of whether the data is quantized.\n  const use2DPosition = variableName === \"positionMC\" && use2D;\n  if (use2DPosition) {\n    const line = \"attributes.position2D = a_position2D;\";\n    shaderBuilder.addFunctionLines(functionId, [line]);\n  }\n\n  if (attributeInfo.isQuantized) {\n    // Skip initialization, it will be handled in the dequantization stage.\n    return;\n  }\n\n  const lines = [];\n  if (variableName === \"tangentMC\") {\n    lines.push(\"attributes.tangentMC = a_tangentMC.xyz;\");\n    lines.push(\"attributes.tangentSignMC = a_tangentMC.w;\");\n  } else {\n    lines.push(`attributes.${variableName} = a_${variableName};`);\n  }\n\n  shaderBuilder.addFunctionLines(functionId, lines);\n}\n\nfunction updateSetDynamicVaryingsFunction(shaderBuilder, attributeInfo) {\n  const semantic = attributeInfo.attribute.semantic;\n  const setIndex = attributeInfo.attribute.setIndex;\n  if (defined(semantic) && !defined(setIndex)) {\n    // positions, normals, and tangents are handled statically in\n    // GeometryStageVS\n    return;\n  }\n\n  // In the vertex shader, we want things like\n  // v_texCoord_1 = attributes.texCoord_1;\n  let functionId = GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS;\n  const variableName = attributeInfo.variableName;\n  let line = `v_${variableName} = attributes.${variableName};`;\n  shaderBuilder.addFunctionLines(functionId, [line]);\n\n  // In the fragment shader, we do the opposite:\n  // attributes.texCoord_1 = v_texCoord_1;\n  functionId = GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS;\n  line = `attributes.${variableName} = v_${variableName};`;\n  shaderBuilder.addFunctionLines(functionId, [line]);\n}\n\nfunction handleBitangents(shaderBuilder, attributes) {\n  let hasNormals = false;\n  let hasTangents = false;\n  for (let i = 0; i < attributes.length; i++) {\n    const attribute = attributes[i];\n    if (attribute.semantic === VertexAttributeSemantic.NORMAL) {\n      hasNormals = true;\n    } else if (attribute.semantic === VertexAttributeSemantic.TANGENT) {\n      hasTangents = true;\n    }\n  }\n\n  // Bitangents are only defined if we have normals and tangents\n  if (!hasNormals || !hasTangents) {\n    return;\n  }\n\n  shaderBuilder.addDefine(\"HAS_BITANGENTS\");\n\n  shaderBuilder.addVarying(\"vec3\", \"v_bitangentEC\");\n  shaderBuilder.addStructField(\n    GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,\n    \"vec3\",\n    \"bitangentMC\"\n  );\n  shaderBuilder.addStructField(\n    GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,\n    \"vec3\",\n    \"bitangentEC\"\n  );\n}\n\nexport default GeometryPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef LIGHTING_PBR\\n\\\nvec3 computePbrLighting(czm_modelMaterial inputMaterial, ProcessedAttributes attributes)\\n\\\n{\\n\\\n    czm_pbrParameters pbrParameters;\\n\\\n    pbrParameters.diffuseColor = inputMaterial.diffuse;\\n\\\n    pbrParameters.f0 = inputMaterial.specular;\\n\\\n    pbrParameters.roughness = inputMaterial.roughness;\\n\\\n    \\n\\\n    #ifdef USE_CUSTOM_LIGHT_COLOR\\n\\\n    vec3 lightColorHdr = model_lightColorHdr;\\n\\\n    #else\\n\\\n    vec3 lightColorHdr = czm_lightColorHdr;\\n\\\n    #endif\\n\\\n\\n\\\n    vec3 color = inputMaterial.diffuse;\\n\\\n    #ifdef HAS_NORMALS\\n\\\n    color = czm_pbrLighting(\\n\\\n        attributes.positionEC,\\n\\\n        inputMaterial.normalEC,\\n\\\n        czm_lightDirectionEC,\\n\\\n        lightColorHdr,\\n\\\n        pbrParameters\\n\\\n    );\\n\\\n\\n\\\n        #ifdef USE_IBL_LIGHTING\\n\\\n        color += imageBasedLightingStage(\\n\\\n            attributes.positionEC,\\n\\\n            inputMaterial.normalEC,\\n\\\n            czm_lightDirectionEC,\\n\\\n            lightColorHdr,\\n\\\n            pbrParameters\\n\\\n        );\\n\\\n        #endif\\n\\\n    #endif\\n\\\n\\n\\\n    color *= inputMaterial.occlusion;\\n\\\n    color += inputMaterial.emissive;\\n\\\n\\n\\\n    // In HDR mode, the frame buffer is in linear color space. The\\n\\\n    // post-processing stages (see PostProcessStageCollection) will handle\\n\\\n    // tonemapping. However, if HDR is not enabled, we must tonemap else large\\n\\\n    // values may be clamped to 1.0\\n\\\n    #ifndef HDR \\n\\\n    color = czm_acesTonemapping(color);\\n\\\n    #endif \\n\\\n\\n\\\n    return color;\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\nvoid lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)\\n\\\n{\\n\\\n    // Even though the lighting will only set the diffuse color,\\n\\\n    // pass all other properties so further stages have access to them.\\n\\\n    vec3 color = vec3(0.0);\\n\\\n\\n\\\n    #ifdef LIGHTING_PBR\\n\\\n    color = computePbrLighting(material, attributes);\\n\\\n    #else // unlit\\n\\\n    color = material.diffuse;\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_POINT_CLOUD_COLOR_STYLE\\n\\\n    // The colors resulting from point cloud styles are adjusted differently.\\n\\\n    color = czm_gammaCorrect(color);\\n\\\n    #elif !defined(HDR)\\n\\\n    // If HDR is not enabled, the frame buffer stores sRGB colors rather than\\n\\\n    // linear colors so the linear value must be converted.\\n\\\n    color = czm_linearToSrgb(color);\\n\\\n    #endif\\n\\\n\\n\\\n    material.diffuse = color;\\n\\\n}\\n\\\n\";\n", "/**\n * The lighting model to use for lighting a {@link Model}.\n *\n * @enum {number}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst LightingModel = {\n  /**\n   * Use unlit shading, i.e. skip lighting calculations. The model's\n   * diffuse color (assumed to be linear RGB, not sRGB) is used directly\n   * when computing <code>out_FragColor</code>. The alpha mode is still\n   * applied.\n   *\n   * @type {number}\n   * @constant\n   */\n  UNLIT: 0,\n  /**\n   * Use physically-based rendering lighting calculations. This includes\n   * both PBR metallic roughness and PBR specular glossiness. Image-based\n   * lighting is also applied when possible.\n   *\n   * @type {number}\n   * @constant\n   */\n  PBR: 1,\n};\n\nexport default Object.freeze(LightingModel);\n", "import defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport LightingStageFS from \"../../Shaders/Model/LightingStageFS.js\";\nimport LightingModel from \"./LightingModel.js\";\n\n/**\n * The lighting pipeline stage is responsible for taking a material and rendering\n * it with a lighting model such as physically based rendering (PBR) or unlit\n * shading\n *\n * @namespace LightingPipelineStage\n *\n * @private\n */\nconst LightingPipelineStage = {\n  name: \"LightingPipelineStage\", // Helps with debugging\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render\n * resources:\n * <ul>\n *   <li>modifies the shader to include the lighting stage</li>\n * </ul>\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {ModelComponents.Primitive} primitive The primitive to be rendered\n *\n * @private\n */\nLightingPipelineStage.process = function (renderResources, primitive) {\n  const model = renderResources.model;\n  const lightingOptions = renderResources.lightingOptions;\n  const shaderBuilder = renderResources.shaderBuilder;\n\n  if (defined(model.lightColor)) {\n    shaderBuilder.addDefine(\n      \"USE_CUSTOM_LIGHT_COLOR\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n\n    shaderBuilder.addUniform(\n      \"vec3\",\n      \"model_lightColorHdr\",\n      ShaderDestination.FRAGMENT\n    );\n\n    const uniformMap = renderResources.uniformMap;\n    uniformMap.model_lightColorHdr = function () {\n      return model.lightColor;\n    };\n  }\n\n  // The lighting model is always set by the material. However, custom shaders\n  // can override this.\n  const lightingModel = lightingOptions.lightingModel;\n\n  if (lightingModel === LightingModel.PBR) {\n    shaderBuilder.addDefine(\n      \"LIGHTING_PBR\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n  } else {\n    shaderBuilder.addDefine(\n      \"LIGHTING_UNLIT\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n  }\n\n  shaderBuilder.addFragmentLines(LightingStageFS);\n};\n\nexport default LightingPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"// If the style color is white, it implies the feature has not been styled.\\n\\\nbool isDefaultStyleColor(vec3 color)\\n\\\n{\\n\\\n    return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));\\n\\\n}\\n\\\n\\n\\\nvec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)\\n\\\n{\\n\\\n    vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);\\n\\\n    vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;\\n\\\n    return color;\\n\\\n}\\n\\\n\\n\\\nvec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform)\\n\\\n{\\n\\\n    return vec2(textureTransform * vec3(texCoord, 1.0));\\n\\\n}\\n\\\n\\n\\\n#ifdef HAS_NORMALS\\n\\\nvec3 computeNormal(ProcessedAttributes attributes)\\n\\\n{\\n\\\n    // Geometry normal. This is already normalized \\n\\\n    vec3 ng = attributes.normalEC;\\n\\\n\\n\\\n    vec3 normal = ng;\\n\\\n    #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)\\n\\\n    vec2 normalTexCoords = TEXCOORD_NORMAL;\\n\\\n        #ifdef HAS_NORMAL_TEXTURE_TRANSFORM\\n\\\n        normalTexCoords = computeTextureTransform(normalTexCoords, u_normalTextureTransform);\\n\\\n        #endif\\n\\\n\\n\\\n        // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set\\n\\\n        #ifdef HAS_BITANGENTS\\n\\\n        vec3 t = attributes.tangentEC;\\n\\\n        vec3 b = attributes.bitangentEC;\\n\\\n        mat3 tbn = mat3(t, b, ng);\\n\\\n        vec3 n = texture(u_normalTexture, normalTexCoords).rgb;\\n\\\n        normal = normalize(tbn * (2.0 * n - 1.0));\\n\\\n        #elif (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\\n\\\n        // If derivatives are available (not IE 10), compute tangents\\n\\\n        vec3 positionEC = attributes.positionEC;\\n\\\n        vec3 pos_dx = dFdx(positionEC);\\n\\\n        vec3 pos_dy = dFdy(positionEC);\\n\\\n        vec3 tex_dx = dFdx(vec3(normalTexCoords,0.0));\\n\\\n        vec3 tex_dy = dFdy(vec3(normalTexCoords,0.0));\\n\\\n        vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\\n\\\n        t = normalize(t - ng * dot(ng, t));\\n\\\n        vec3 b = normalize(cross(ng, t));\\n\\\n        mat3 tbn = mat3(t, b, ng);\\n\\\n        vec3 n = texture(u_normalTexture, normalTexCoords).rgb;\\n\\\n        normal = normalize(tbn * (2.0 * n - 1.0));\\n\\\n        #endif\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_DOUBLE_SIDED_MATERIAL\\n\\\n    if (czm_backFacing()) {\\n\\\n        normal = -normal;\\n\\\n    }\\n\\\n    #endif\\n\\\n\\n\\\n    return normal;\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\nvoid materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)\\n\\\n{\\n\\\n    #ifdef HAS_NORMALS\\n\\\n    material.normalEC = computeNormal(attributes);\\n\\\n    #endif\\n\\\n\\n\\\n    vec4 baseColorWithAlpha = vec4(1.0);\\n\\\n    // Regardless of whether we use PBR, set a base color\\n\\\n    #ifdef HAS_BASE_COLOR_TEXTURE\\n\\\n    vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;\\n\\\n\\n\\\n        #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM\\n\\\n        baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);\\n\\\n        #endif\\n\\\n\\n\\\n    baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));\\n\\\n\\n\\\n        #ifdef HAS_BASE_COLOR_FACTOR\\n\\\n        baseColorWithAlpha *= u_baseColorFactor;\\n\\\n        #endif\\n\\\n    #elif defined(HAS_BASE_COLOR_FACTOR)\\n\\\n    baseColorWithAlpha = u_baseColorFactor;\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_POINT_CLOUD_COLOR_STYLE\\n\\\n    baseColorWithAlpha = v_pointCloudColor;\\n\\\n    #elif defined(HAS_COLOR_0)\\n\\\n    vec4 color = attributes.color_0;\\n\\\n        // .pnts files store colors in the sRGB color space\\n\\\n        #ifdef HAS_SRGB_COLOR\\n\\\n        color = czm_srgbToLinear(color);\\n\\\n        #endif\\n\\\n    baseColorWithAlpha *= color;\\n\\\n    #endif\\n\\\n\\n\\\n    material.diffuse = baseColorWithAlpha.rgb;\\n\\\n    material.alpha = baseColorWithAlpha.a;\\n\\\n\\n\\\n    #ifdef USE_CPU_STYLING\\n\\\n    material.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend);\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_OCCLUSION_TEXTURE\\n\\\n    vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;\\n\\\n        #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM\\n\\\n        occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);\\n\\\n        #endif\\n\\\n    material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r;\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_EMISSIVE_TEXTURE\\n\\\n    vec2 emissiveTexCoords = TEXCOORD_EMISSIVE;\\n\\\n        #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM\\n\\\n        emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);\\n\\\n        #endif\\n\\\n\\n\\\n    vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb);\\n\\\n        #ifdef HAS_EMISSIVE_FACTOR\\n\\\n        emissive *= u_emissiveFactor;\\n\\\n        #endif\\n\\\n    material.emissive = emissive;\\n\\\n    #elif defined(HAS_EMISSIVE_FACTOR)\\n\\\n    material.emissive = u_emissiveFactor;\\n\\\n    #endif\\n\\\n\\n\\\n    #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)\\n\\\n        #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE\\n\\\n        vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS;\\n\\\n          #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM\\n\\\n          specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);\\n\\\n          #endif\\n\\\n\\n\\\n        vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords));\\n\\\n        vec3 specular = specularGlossiness.rgb;\\n\\\n        float glossiness = specularGlossiness.a;\\n\\\n            #ifdef HAS_SPECULAR_FACTOR\\n\\\n            specular *= u_specularFactor;\\n\\\n            #endif\\n\\\n\\n\\\n            #ifdef HAS_GLOSSINESS_FACTOR\\n\\\n            glossiness *= u_glossinessFactor;\\n\\\n            #endif\\n\\\n        #else\\n\\\n            #ifdef HAS_SPECULAR_FACTOR\\n\\\n            vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0));\\n\\\n            #else\\n\\\n            vec3 specular = vec3(1.0);\\n\\\n            #endif\\n\\\n\\n\\\n            #ifdef HAS_GLOSSINESS_FACTOR\\n\\\n            float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);\\n\\\n            #else\\n\\\n            float glossiness = 1.0;\\n\\\n            #endif\\n\\\n        #endif\\n\\\n\\n\\\n        #ifdef HAS_DIFFUSE_TEXTURE\\n\\\n        vec2 diffuseTexCoords = TEXCOORD_DIFFUSE;\\n\\\n            #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM\\n\\\n            diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);\\n\\\n            #endif\\n\\\n\\n\\\n        vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords));\\n\\\n            #ifdef HAS_DIFFUSE_FACTOR\\n\\\n            diffuse *= u_diffuseFactor;\\n\\\n            #endif\\n\\\n        #elif defined(HAS_DIFFUSE_FACTOR)\\n\\\n        vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));\\n\\\n        #else\\n\\\n        vec4 diffuse = vec4(1.0);\\n\\\n        #endif\\n\\\n    czm_pbrParameters parameters = czm_pbrSpecularGlossinessMaterial(\\n\\\n      diffuse.rgb,\\n\\\n      specular,\\n\\\n      glossiness\\n\\\n    );\\n\\\n    material.diffuse = parameters.diffuseColor;\\n\\\n    // the specular glossiness extension's alpha overrides anything set\\n\\\n    // by the base material.\\n\\\n    material.alpha = diffuse.a;\\n\\\n    material.specular = parameters.f0;\\n\\\n    material.roughness = parameters.roughness;\\n\\\n    #elif defined(LIGHTING_PBR)\\n\\\n        #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE\\n\\\n        vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;\\n\\\n            #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM\\n\\\n            metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);\\n\\\n            #endif\\n\\\n\\n\\\n        vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;\\n\\\n        float metalness = clamp(metallicRoughness.b, 0.0, 1.0);\\n\\\n        float roughness = clamp(metallicRoughness.g, 0.04, 1.0);\\n\\\n            #ifdef HAS_METALLIC_FACTOR\\n\\\n            metalness *= u_metallicFactor;\\n\\\n            #endif\\n\\\n\\n\\\n            #ifdef HAS_ROUGHNESS_FACTOR\\n\\\n            roughness *= u_roughnessFactor;\\n\\\n            #endif\\n\\\n        #else\\n\\\n            #ifdef HAS_METALLIC_FACTOR\\n\\\n            float metalness = clamp(u_metallicFactor, 0.0, 1.0);\\n\\\n            #else\\n\\\n            float metalness = 1.0;\\n\\\n            #endif\\n\\\n\\n\\\n            #ifdef HAS_ROUGHNESS_FACTOR\\n\\\n            float roughness = clamp(u_roughnessFactor, 0.04, 1.0);\\n\\\n            #else\\n\\\n            float roughness = 1.0;\\n\\\n            #endif\\n\\\n        #endif\\n\\\n    czm_pbrParameters parameters = czm_pbrMetallicRoughnessMaterial(\\n\\\n      material.diffuse,\\n\\\n      metalness,\\n\\\n      roughness\\n\\\n    );\\n\\\n    material.diffuse = parameters.diffuseColor;\\n\\\n    material.specular = parameters.f0;\\n\\\n    material.roughness = parameters.roughness;\\n\\\n    #endif\\n\\\n}\\n\\\n\";\n", "import defined from \"../../Core/defined.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Cartesian4 from \"../../Core/Cartesian4.js\";\nimport Matrix3 from \"../../Core/Matrix3.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport MaterialStageFS from \"../../Shaders/Model/MaterialStageFS.js\";\nimport AlphaMode from \"../AlphaMode.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\nimport LightingModel from \"./LightingModel.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\nconst Material = ModelComponents.Material;\nconst MetallicRoughness = ModelComponents.MetallicRoughness;\nconst SpecularGlossiness = ModelComponents.SpecularGlossiness;\n\n/**\n * The material pipeline stage processes textures and other uniforms needed\n * to render a primitive. This handles the following material types:\n * <ul>\n *   <li>Basic glTF materials (PBR metallic roughness model)</li>\n *   <li>The `KHR_materials_pbrSpecularGlossiness` glTF extension</li>\n *   <li>The `KHR_materials_unlit` glTF extension</li>\n * </ul>\n *\n * @namespace MaterialPipelineStage\n *\n * @private\n */\nconst MaterialPipelineStage = {\n  name: \"MaterialPipelineStage\", // Helps with debugging\n\n  // Expose some methods for testing\n  _processTexture: processTexture,\n  _processTextureTransform: processTextureTransform,\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render\n * resources:\n * <ul>\n *   <li>Modifies the shader to include the material processing stage</li>\n *   <li>Modifies the shader to include additional uniforms for textures and other rendering details</li>\n *   <li>Modifies the lighting options to set either PBR or unlit lighting</li>\n *   <li>Sets the render state for back-face culling</li>\n * </ul>\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {ModelComponents.Primitive} primitive The primitive to be rendered\n * @param {FrameState} frameState The frame state.\n * @private\n */\nMaterialPipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  // gltf-pipeline automatically creates a default material so this will always\n  // be defined.\n  const material = primitive.material;\n  const model = renderResources.model;\n\n  // Classification models only use position and feature ID attributes,\n  // so textures should be disabled to avoid compile errors.\n  const hasClassification = defined(model.classificationType);\n  const disableTextures = hasClassification;\n\n  const uniformMap = renderResources.uniformMap;\n  const shaderBuilder = renderResources.shaderBuilder;\n\n  // When textures are loaded incrementally, fall back to a default 1x1 texture\n  const defaultTexture = frameState.context.defaultTexture;\n  const defaultNormalTexture = frameState.context.defaultNormalTexture;\n  const defaultEmissiveTexture = frameState.context.defaultEmissiveTexture;\n\n  processMaterialUniforms(\n    material,\n    uniformMap,\n    shaderBuilder,\n    defaultTexture,\n    defaultNormalTexture,\n    defaultEmissiveTexture,\n    disableTextures\n  );\n\n  if (defined(material.specularGlossiness)) {\n    processSpecularGlossinessUniforms(\n      material,\n      uniformMap,\n      shaderBuilder,\n      defaultTexture,\n      disableTextures\n    );\n  } else {\n    processMetallicRoughnessUniforms(\n      material,\n      uniformMap,\n      shaderBuilder,\n      defaultTexture,\n      disableTextures\n    );\n  }\n\n  // If the primitive does not have normals, fall back to unlit lighting.\n  const hasNormals = ModelUtility.getAttributeBySemantic(\n    primitive,\n    VertexAttributeSemantic.NORMAL\n  );\n\n  // Classification models will be rendered as unlit.\n  const lightingOptions = renderResources.lightingOptions;\n  if (material.unlit || !hasNormals || hasClassification) {\n    lightingOptions.lightingModel = LightingModel.UNLIT;\n  } else {\n    lightingOptions.lightingModel = LightingModel.PBR;\n  }\n\n  // Configure back-face culling\n  const cull = model.backFaceCulling && !material.doubleSided;\n  renderResources.renderStateOptions.cull.enabled = cull;\n\n  const alphaOptions = renderResources.alphaOptions;\n  if (material.alphaMode === AlphaMode.BLEND) {\n    alphaOptions.pass = Pass.TRANSLUCENT;\n  } else if (material.alphaMode === AlphaMode.MASK) {\n    alphaOptions.alphaCutoff = material.alphaCutoff;\n  }\n\n  shaderBuilder.addFragmentLines(MaterialStageFS);\n\n  if (material.doubleSided) {\n    shaderBuilder.addDefine(\n      \"HAS_DOUBLE_SIDED_MATERIAL\",\n      undefined,\n      ShaderDestination.BOTH\n    );\n  }\n};\n\n/**\n * Process a single texture transformation and add it to the shader and uniform map.\n *\n * @param {ShaderBuilder} shaderBuilder The shader builder to modify\n * @param {Object<string, Function>} uniformMap The uniform map to modify.\n * @param {ModelComponents.TextureReader} textureReader The texture to add to the shader\n * @param {string} uniformName The name of the sampler uniform such as <code>u_baseColorTexture</code>\n * @param {string} defineName The name of the texture for use in the defines, minus any prefix or suffix. For example, \"BASE_COLOR\" or \"EMISSIVE\"\n *\n * @private\n */\nfunction processTextureTransform(\n  shaderBuilder,\n  uniformMap,\n  textureReader,\n  uniformName,\n  defineName\n) {\n  // Add a define to enable the texture transformation code in the shader.\n  const transformDefine = `HAS_${defineName}_TEXTURE_TRANSFORM`;\n  shaderBuilder.addDefine(\n    transformDefine,\n    undefined,\n    ShaderDestination.FRAGMENT\n  );\n\n  // Add a uniform for the transformation matrix\n  const transformUniformName = `${uniformName}Transform`;\n  shaderBuilder.addUniform(\n    \"mat3\",\n    transformUniformName,\n    ShaderDestination.FRAGMENT\n  );\n  uniformMap[transformUniformName] = function () {\n    return textureReader.transform;\n  };\n}\n\n/**\n * Process a single texture and add it to the shader and uniform map.\n *\n * @param {ShaderBuilder} shaderBuilder The shader builder to modify\n * @param {Object<string, Function>} uniformMap The uniform map to modify.\n * @param {ModelComponents.TextureReader} textureReader The texture to add to the shader\n * @param {string} uniformName The name of the sampler uniform such as <code>u_baseColorTexture</code>\n * @param {string} defineName The name of the texture for use in the defines, minus any prefix or suffix. For example, \"BASE_COLOR\" or \"EMISSIVE\"\n *\n * @private\n */\nfunction processTexture(\n  shaderBuilder,\n  uniformMap,\n  textureReader,\n  uniformName,\n  defineName,\n  defaultTexture\n) {\n  // Add a uniform for the texture itself\n  shaderBuilder.addUniform(\n    \"sampler2D\",\n    uniformName,\n    ShaderDestination.FRAGMENT\n  );\n  uniformMap[uniformName] = function () {\n    return defaultValue(textureReader.texture, defaultTexture);\n  };\n\n  // Add a #define directive to enable using the texture in the shader\n  const textureDefine = `HAS_${defineName}_TEXTURE`;\n  shaderBuilder.addDefine(textureDefine, undefined, ShaderDestination.FRAGMENT);\n\n  // Add a #define to tell the shader which texture coordinates varying to use.\n  const texCoordIndex = textureReader.texCoord;\n  const texCoordVarying = `v_texCoord_${texCoordIndex}`;\n  const texCoordDefine = `TEXCOORD_${defineName}`;\n  shaderBuilder.addDefine(\n    texCoordDefine,\n    texCoordVarying,\n    ShaderDestination.FRAGMENT\n  );\n\n  // Some textures have matrix transforms (e.g. for texture atlases). Add those\n  // to the shader if present.\n  const textureTransform = textureReader.transform;\n  if (\n    defined(textureTransform) &&\n    !Matrix3.equals(textureTransform, Matrix3.IDENTITY)\n  ) {\n    processTextureTransform(\n      shaderBuilder,\n      uniformMap,\n      textureReader,\n      uniformName,\n      defineName\n    );\n  }\n}\n\nfunction processMaterialUniforms(\n  material,\n  uniformMap,\n  shaderBuilder,\n  defaultTexture,\n  defaultNormalTexture,\n  defaultEmissiveTexture,\n  disableTextures\n) {\n  const emissiveFactor = material.emissiveFactor;\n  if (\n    defined(emissiveFactor) &&\n    !Cartesian3.equals(emissiveFactor, Material.DEFAULT_EMISSIVE_FACTOR)\n  ) {\n    shaderBuilder.addUniform(\n      \"vec3\",\n      \"u_emissiveFactor\",\n      ShaderDestination.FRAGMENT\n    );\n    uniformMap.u_emissiveFactor = function () {\n      return material.emissiveFactor;\n    };\n    shaderBuilder.addDefine(\n      \"HAS_EMISSIVE_FACTOR\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n\n    const emissiveTexture = material.emissiveTexture;\n    if (defined(emissiveTexture) && !disableTextures) {\n      processTexture(\n        shaderBuilder,\n        uniformMap,\n        emissiveTexture,\n        \"u_emissiveTexture\",\n        \"EMISSIVE\",\n        defaultEmissiveTexture\n      );\n    }\n  }\n\n  const normalTexture = material.normalTexture;\n  if (defined(normalTexture) && !disableTextures) {\n    processTexture(\n      shaderBuilder,\n      uniformMap,\n      normalTexture,\n      \"u_normalTexture\",\n      \"NORMAL\",\n      defaultNormalTexture\n    );\n  }\n\n  const occlusionTexture = material.occlusionTexture;\n  if (defined(occlusionTexture) && !disableTextures) {\n    processTexture(\n      shaderBuilder,\n      uniformMap,\n      occlusionTexture,\n      \"u_occlusionTexture\",\n      \"OCCLUSION\",\n      defaultTexture\n    );\n  }\n}\n\nfunction processSpecularGlossinessUniforms(\n  material,\n  uniformMap,\n  shaderBuilder,\n  defaultTexture,\n  disableTextures\n) {\n  const specularGlossiness = material.specularGlossiness;\n  shaderBuilder.addDefine(\n    \"USE_SPECULAR_GLOSSINESS\",\n    undefined,\n    ShaderDestination.FRAGMENT\n  );\n\n  const diffuseTexture = specularGlossiness.diffuseTexture;\n  if (defined(diffuseTexture) && !disableTextures) {\n    processTexture(\n      shaderBuilder,\n      uniformMap,\n      diffuseTexture,\n      \"u_diffuseTexture\",\n      \"DIFFUSE\",\n      defaultTexture\n    );\n  }\n\n  const diffuseFactor = specularGlossiness.diffuseFactor;\n  if (\n    defined(diffuseFactor) &&\n    !Cartesian4.equals(diffuseFactor, SpecularGlossiness.DEFAULT_DIFFUSE_FACTOR)\n  ) {\n    shaderBuilder.addUniform(\n      \"vec4\",\n      \"u_diffuseFactor\",\n      ShaderDestination.FRAGMENT\n    );\n    uniformMap.u_diffuseFactor = function () {\n      return specularGlossiness.diffuseFactor;\n    };\n    shaderBuilder.addDefine(\n      \"HAS_DIFFUSE_FACTOR\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n  }\n\n  const specularGlossinessTexture =\n    specularGlossiness.specularGlossinessTexture;\n  if (defined(specularGlossinessTexture) && !disableTextures) {\n    processTexture(\n      shaderBuilder,\n      uniformMap,\n      specularGlossinessTexture,\n      \"u_specularGlossinessTexture\",\n      \"SPECULAR_GLOSSINESS\",\n      defaultTexture\n    );\n  }\n\n  const specularFactor = specularGlossiness.specularFactor;\n  if (\n    defined(specularFactor) &&\n    !Cartesian3.equals(\n      specularFactor,\n      SpecularGlossiness.DEFAULT_SPECULAR_FACTOR\n    )\n  ) {\n    shaderBuilder.addUniform(\n      \"vec3\",\n      \"u_specularFactor\",\n      ShaderDestination.FRAGMENT\n    );\n    uniformMap.u_specularFactor = function () {\n      return specularGlossiness.specularFactor;\n    };\n    shaderBuilder.addDefine(\n      \"HAS_SPECULAR_FACTOR\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n  }\n\n  const glossinessFactor = specularGlossiness.glossinessFactor;\n  if (\n    defined(glossinessFactor) &&\n    glossinessFactor !== SpecularGlossiness.DEFAULT_GLOSSINESS_FACTOR\n  ) {\n    shaderBuilder.addUniform(\n      \"float\",\n      \"u_glossinessFactor\",\n      ShaderDestination.FRAGMENT\n    );\n    uniformMap.u_glossinessFactor = function () {\n      return specularGlossiness.glossinessFactor;\n    };\n    shaderBuilder.addDefine(\n      \"HAS_GLOSSINESS_FACTOR\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n  }\n}\n\nfunction processMetallicRoughnessUniforms(\n  material,\n  uniformMap,\n  shaderBuilder,\n  defaultTexture,\n  disableTextures\n) {\n  const metallicRoughness = material.metallicRoughness;\n  shaderBuilder.addDefine(\n    \"USE_METALLIC_ROUGHNESS\",\n    undefined,\n    ShaderDestination.FRAGMENT\n  );\n\n  const baseColorTexture = metallicRoughness.baseColorTexture;\n  if (defined(baseColorTexture) && !disableTextures) {\n    processTexture(\n      shaderBuilder,\n      uniformMap,\n      baseColorTexture,\n      \"u_baseColorTexture\",\n      \"BASE_COLOR\",\n      defaultTexture\n    );\n  }\n\n  const baseColorFactor = metallicRoughness.baseColorFactor;\n  if (\n    defined(baseColorFactor) &&\n    !Cartesian4.equals(\n      baseColorFactor,\n      MetallicRoughness.DEFAULT_BASE_COLOR_FACTOR\n    )\n  ) {\n    shaderBuilder.addUniform(\n      \"vec4\",\n      \"u_baseColorFactor\",\n      ShaderDestination.FRAGMENT\n    );\n    uniformMap.u_baseColorFactor = function () {\n      return metallicRoughness.baseColorFactor;\n    };\n    shaderBuilder.addDefine(\n      \"HAS_BASE_COLOR_FACTOR\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n  }\n\n  const metallicRoughnessTexture = metallicRoughness.metallicRoughnessTexture;\n  if (defined(metallicRoughnessTexture) && !disableTextures) {\n    processTexture(\n      shaderBuilder,\n      uniformMap,\n      metallicRoughnessTexture,\n      \"u_metallicRoughnessTexture\",\n      \"METALLIC_ROUGHNESS\",\n      defaultTexture\n    );\n  }\n\n  const metallicFactor = metallicRoughness.metallicFactor;\n  if (\n    defined(metallicFactor) &&\n    metallicFactor !== MetallicRoughness.DEFAULT_METALLIC_FACTOR\n  ) {\n    shaderBuilder.addUniform(\n      \"float\",\n      \"u_metallicFactor\",\n      ShaderDestination.FRAGMENT\n    );\n    uniformMap.u_metallicFactor = function () {\n      return metallicRoughness.metallicFactor;\n    };\n    shaderBuilder.addDefine(\n      \"HAS_METALLIC_FACTOR\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n  }\n\n  const roughnessFactor = metallicRoughness.roughnessFactor;\n  if (\n    defined(roughnessFactor) &&\n    roughnessFactor !== MetallicRoughness.DEFAULT_ROUGHNESS_FACTOR\n  ) {\n    shaderBuilder.addUniform(\n      \"float\",\n      \"u_roughnessFactor\",\n      ShaderDestination.FRAGMENT\n    );\n    uniformMap.u_roughnessFactor = function () {\n      return metallicRoughness.roughnessFactor;\n    };\n    shaderBuilder.addDefine(\n      \"HAS_ROUGHNESS_FACTOR\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n  }\n}\n\nexport default MaterialPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void morphTargetsStage(inout ProcessedAttributes attributes) \\n\\\n{\\n\\\n    vec3 positionMC = attributes.positionMC;\\n\\\n    attributes.positionMC = getMorphedPosition(positionMC);\\n\\\n\\n\\\n    #ifdef HAS_NORMALS\\n\\\n    vec3 normalMC = attributes.normalMC;\\n\\\n    attributes.normalMC = getMorphedNormal(normalMC);\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_TANGENTS\\n\\\n    vec3 tangentMC = attributes.tangentMC;\\n\\\n    attributes.tangentMC = getMorphedTangent(tangentMC);\\n\\\n    #endif\\n\\\n}\";\n", "import AttributeType from \"../AttributeType.js\";\nimport combine from \"../../Core/combine.js\";\nimport defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport MorphTargetsStageVS from \"../../Shaders/Model/MorphTargetsStageVS.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\n\n/**\n * The morph targets pipeline stage processes the morph targets and weights of a primitive.\n *\n * @namespace MorphTargetsPipelineStage\n *\n * @private\n */\nconst MorphTargetsPipelineStage = {\n  name: \"MorphTargetsPipelineStage\", // Helps with debugging\n\n  FUNCTION_ID_GET_MORPHED_POSITION: \"getMorphedPosition\",\n  FUNCTION_SIGNATURE_GET_MORPHED_POSITION:\n    \"vec3 getMorphedPosition(in vec3 position)\",\n  FUNCTION_ID_GET_MORPHED_NORMAL: \"getMorphedNormal\",\n  FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:\n    \"vec3 getMorphedNormal(in vec3 normal)\",\n  FUNCTION_ID_GET_MORPHED_TANGENT: \"getMorphedTangent\",\n  FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:\n    \"vec3 getMorphedTangent(in vec3 tangent)\",\n};\n\n/**\n * This pipeline stage processes the morph targets and weights of a primitive,\n * adding the relevant attribute declarations and functions to the shaders.\n *\n * Processes a primitive. This stage modifies the following parts of the render resources:\n * <ul>\n *  <li> adds attribute declarations for the morph targets in the vertex shader\n *  <li> adds the uniform declaration for the morph weights in the vertex shader\n *  <li> adds functions to apply the morphs in the vertex shader\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n *\n * @private\n */\nMorphTargetsPipelineStage.process = function (renderResources, primitive) {\n  const shaderBuilder = renderResources.shaderBuilder;\n\n  shaderBuilder.addDefine(\n    \"HAS_MORPH_TARGETS\",\n    undefined,\n    ShaderDestination.VERTEX\n  );\n\n  addGetMorphedAttributeFunctionDeclarations(shaderBuilder);\n\n  const morphTargetsLength = primitive.morphTargets.length;\n  for (let i = 0; i < morphTargetsLength; i++) {\n    const attributes = primitive.morphTargets[i].attributes;\n\n    const attributesLength = attributes.length;\n    for (let j = 0; j < attributesLength; j++) {\n      const attribute = attributes[j];\n      const semantic = attribute.semantic;\n\n      // Cesium only supports morph targets for positions, normals, and tangents\n      if (\n        semantic !== VertexAttributeSemantic.POSITION &&\n        semantic !== VertexAttributeSemantic.NORMAL &&\n        semantic !== VertexAttributeSemantic.TANGENT\n      ) {\n        continue;\n      }\n\n      processMorphTargetAttribute(\n        renderResources,\n        attribute,\n        renderResources.attributeIndex,\n        i\n      );\n      renderResources.attributeIndex++;\n    }\n  }\n\n  addGetMorphedAttributeFunctionReturns(shaderBuilder);\n\n  const weights = renderResources.runtimeNode.morphWeights;\n  const weightsLength = weights.length;\n  shaderBuilder.addUniform(\n    \"float\",\n    `u_morphWeights[${weightsLength}]`,\n    ShaderDestination.VERTEX\n  );\n\n  shaderBuilder.addVertexLines(MorphTargetsStageVS);\n\n  const uniformMap = {\n    u_morphWeights: function () {\n      return renderResources.runtimeNode.morphWeights;\n    },\n  };\n\n  renderResources.uniformMap = combine(uniformMap, renderResources.uniformMap);\n};\n\nconst scratchAttributeInfo = {\n  attributeString: undefined,\n  functionId: undefined,\n};\n\nfunction processMorphTargetAttribute(\n  renderResources,\n  attribute,\n  attributeIndex,\n  morphTargetIndex\n) {\n  const shaderBuilder = renderResources.shaderBuilder;\n\n  addMorphTargetAttributeToRenderResources(\n    renderResources,\n    attribute,\n    attributeIndex\n  );\n\n  const attributeInfo = getMorphTargetAttributeInfo(\n    attribute,\n    scratchAttributeInfo\n  );\n\n  addMorphTargetAttributeDeclarationAndFunctionLine(\n    shaderBuilder,\n    attributeInfo,\n    morphTargetIndex\n  );\n}\n\nfunction addMorphTargetAttributeToRenderResources(\n  renderResources,\n  attribute,\n  attributeIndex\n) {\n  const vertexAttribute = {\n    index: attributeIndex,\n    value: defined(attribute.buffer) ? undefined : attribute.constant,\n    vertexBuffer: attribute.buffer,\n    componentsPerAttribute: AttributeType.getNumberOfComponents(attribute.type),\n    componentDatatype: attribute.componentDatatype,\n    offsetInBytes: attribute.byteOffset,\n    strideInBytes: attribute.byteStride,\n    normalize: attribute.normalized,\n  };\n\n  renderResources.attributes.push(vertexAttribute);\n}\n\nfunction getMorphTargetAttributeInfo(attribute, result) {\n  const semantic = attribute.semantic;\n  switch (semantic) {\n    case VertexAttributeSemantic.POSITION:\n      result.attributeString = \"Position\";\n      result.functionId =\n        MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_POSITION;\n      break;\n    case VertexAttributeSemantic.NORMAL:\n      result.attributeString = \"Normal\";\n      result.functionId =\n        MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_NORMAL;\n      break;\n    case VertexAttributeSemantic.TANGENT:\n      result.attributeString = \"Tangent\";\n      result.functionId =\n        MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_TANGENT;\n      break;\n    default:\n      break;\n  }\n  return result;\n}\n\nfunction addMorphTargetAttributeDeclarationAndFunctionLine(\n  shaderBuilder,\n  attributeInfo,\n  morphTargetIndex\n) {\n  const attributeString = attributeInfo.attributeString;\n  const attributeName = `a_target${attributeString}_${morphTargetIndex}`;\n  const line = `morphed${attributeString} += u_morphWeights[${morphTargetIndex}] * a_target${attributeString}_${morphTargetIndex};`;\n  shaderBuilder.addAttribute(\"vec3\", attributeName);\n  shaderBuilder.addFunctionLines(attributeInfo.functionId, [line]);\n}\n\nfunction addGetMorphedAttributeFunctionDeclarations(shaderBuilder) {\n  shaderBuilder.addFunction(\n    MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_POSITION,\n    MorphTargetsPipelineStage.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,\n    ShaderDestination.VERTEX\n  );\n\n  const positionLine = \"vec3 morphedPosition = position;\";\n  shaderBuilder.addFunctionLines(\n    MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_POSITION,\n    [positionLine]\n  );\n\n  shaderBuilder.addFunction(\n    MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_NORMAL,\n    MorphTargetsPipelineStage.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,\n    ShaderDestination.VERTEX\n  );\n\n  const normalLine = \"vec3 morphedNormal = normal;\";\n  shaderBuilder.addFunctionLines(\n    MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_NORMAL,\n    [normalLine]\n  );\n\n  shaderBuilder.addFunction(\n    MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_TANGENT,\n    MorphTargetsPipelineStage.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,\n    ShaderDestination.VERTEX\n  );\n\n  const tangentLine = \"vec3 morphedTangent = tangent;\";\n  shaderBuilder.addFunctionLines(\n    MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_TANGENT,\n    [tangentLine]\n  );\n}\n\nfunction addGetMorphedAttributeFunctionReturns(shaderBuilder) {\n  const positionLine = \"return morphedPosition;\";\n  shaderBuilder.addFunctionLines(\n    MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_POSITION,\n    [positionLine]\n  );\n\n  const normalLine = \"return morphedNormal;\";\n  shaderBuilder.addFunctionLines(\n    MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_NORMAL,\n    [normalLine]\n  );\n\n  const tangentLine = \"return morphedTangent;\";\n  shaderBuilder.addFunctionLines(\n    MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_TANGENT,\n    [tangentLine]\n  );\n}\n\nexport default MorphTargetsPipelineStage;\n", "import Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\nimport Color from \"../../Core/Color.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport ModelType from \"./ModelType.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\n/**\n * The picking pipeline stage is responsible for handling picking of primitives.\n *\n * @namespace PickingPipelineStage\n * @private\n */\nconst PickingPipelineStage = {\n  name: \"PickingPipelineStage\", // Helps with debugging\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render resources:\n * <ul>\n *  <li>adds attribute and varying declaration for the pick color vertex attribute in the vertex shader for instanced meshes</li>\n *  <li>adds declaration for the pick color uniform for non-instanced meshes</li>\n *  <li>adds defines in the shader for when picking is enabled</li>\n *  <li>creates the pick ID objects in the context</li>\n * </ul>\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n */\nPickingPipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  const context = frameState.context;\n  const runtimeNode = renderResources.runtimeNode;\n  const shaderBuilder = renderResources.shaderBuilder;\n  const model = renderResources.model;\n  const instances = runtimeNode.node.instances;\n\n  if (renderResources.hasPropertyTable) {\n    processPickTexture(renderResources, primitive, instances, context);\n  } else if (defined(instances)) {\n    // For instanced meshes, a pick color vertex attribute is used.\n    processInstancedPickIds(renderResources, context);\n  } else {\n    // For non-instanced meshes, a pick color uniform is used.\n    const pickObject = buildPickObject(renderResources);\n\n    const pickId = context.createPickId(pickObject);\n    model._pipelineResources.push(pickId);\n    model._pickIds.push(pickId);\n\n    shaderBuilder.addUniform(\n      \"vec4\",\n      \"czm_pickColor\",\n      ShaderDestination.FRAGMENT\n    );\n\n    const uniformMap = renderResources.uniformMap;\n    uniformMap.czm_pickColor = function () {\n      return pickId.color;\n    };\n\n    renderResources.pickId = \"czm_pickColor\";\n  }\n};\n\n/**\n * @private\n */\nfunction buildPickObject(renderResources, instanceId) {\n  const model = renderResources.model;\n\n  // Primitives that wrap Model may define the pickObject differently.\n  if (defined(model.pickObject)) {\n    return model.pickObject;\n  }\n\n  const detailPickObject = {\n    model: model,\n    node: renderResources.runtimeNode,\n    primitive: renderResources.runtimePrimitive,\n  };\n\n  let pickObject;\n\n  if (ModelType.is3DTiles(model.type)) {\n    // For 3D Tiles, the pick object's content and primitive are set to the Cesium3DTileContent that owns the model\n    // and the tileset it belongs to, respectively. The detail pick object is returned under the detail key.\n    const content = model.content;\n    pickObject = {\n      content: content,\n      primitive: content.tileset,\n      detail: detailPickObject,\n    };\n  } else {\n    // For models, the model itself is returned as the primitive, with the detail pick object under the detail key.\n    pickObject = {\n      primitive: model,\n      detail: detailPickObject,\n    };\n  }\n\n  pickObject.id = model.id;\n\n  if (defined(instanceId)) {\n    // For instanced models, an instanceId property is added to the pick object.\n    pickObject.instanceId = instanceId;\n  }\n\n  return pickObject;\n}\n\nfunction processPickTexture(renderResources, primitive, instances) {\n  const model = renderResources.model;\n  let featureTableId;\n  let featureIdAttribute;\n  const featureIdLabel = model.featureIdLabel;\n  const instanceFeatureIdLabel = model.instanceFeatureIdLabel;\n\n  if (defined(model.featureTableId)) {\n    // Extract the Feature Table ID from the Cesium3DTileContent.\n    featureTableId = model.featureTableId;\n  } else if (defined(instances)) {\n    // Extract the Feature Table ID from the instanced Feature ID attributes.\n    featureIdAttribute = ModelUtility.getFeatureIdsByLabel(\n      instances.featureIds,\n      instanceFeatureIdLabel\n    );\n    featureTableId = featureIdAttribute.propertyTableId;\n  } else {\n    // Extract the Feature Table ID from the primitive Feature ID attributes.\n    featureIdAttribute = ModelUtility.getFeatureIdsByLabel(\n      primitive.featureIds,\n      featureIdLabel\n    );\n    featureTableId = featureIdAttribute.propertyTableId;\n  }\n\n  const featureTable = model.featureTables[featureTableId];\n\n  const shaderBuilder = renderResources.shaderBuilder;\n  shaderBuilder.addUniform(\n    \"sampler2D\",\n    \"model_pickTexture\",\n    ShaderDestination.FRAGMENT\n  );\n\n  const batchTexture = featureTable.batchTexture;\n  renderResources.uniformMap.model_pickTexture = function () {\n    return defaultValue(batchTexture.pickTexture, batchTexture.defaultTexture);\n  };\n\n  // The feature ID is ignored if it is greater than the number of features.\n  renderResources.pickId =\n    \"((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))\";\n}\n\nfunction processInstancedPickIds(renderResources, context) {\n  const instanceCount = renderResources.instanceCount;\n  const pickIds = new Array(instanceCount);\n  const pickIdsTypedArray = new Uint8Array(instanceCount * 4);\n\n  const model = renderResources.model;\n\n  const pipelineResources = model._pipelineResources;\n  for (let i = 0; i < instanceCount; i++) {\n    const pickObject = buildPickObject(renderResources, i);\n\n    const pickId = context.createPickId(pickObject);\n    pipelineResources.push(pickId);\n    pickIds[i] = pickId;\n\n    const pickColor = pickId.color;\n    pickIdsTypedArray[i * 4 + 0] = Color.floatToByte(pickColor.red);\n    pickIdsTypedArray[i * 4 + 1] = Color.floatToByte(pickColor.green);\n    pickIdsTypedArray[i * 4 + 2] = Color.floatToByte(pickColor.blue);\n    pickIdsTypedArray[i * 4 + 3] = Color.floatToByte(pickColor.alpha);\n  }\n\n  model._pickIds = pickIds;\n\n  const pickIdsBuffer = Buffer.createVertexBuffer({\n    context: context,\n    typedArray: pickIdsTypedArray,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n  // Destruction of resources allocated by the Model\n  // is handled by Model.destroyPipelineResources().\n  pickIdsBuffer.vertexArrayDestroyable = false;\n  const hasCpuCopy = false;\n  model.statistics.addBuffer(pickIdsBuffer, hasCpuCopy);\n  pipelineResources.push(pickIdsBuffer);\n\n  const pickIdsVertexAttribute = {\n    index: renderResources.attributeIndex++,\n    vertexBuffer: pickIdsBuffer,\n    componentsPerAttribute: 4,\n    componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n    normalize: true,\n    offsetInBytes: 0,\n    strideInBytes: 0,\n    instanceDivisor: 1,\n  };\n\n  renderResources.attributes.push(pickIdsVertexAttribute);\n\n  const shaderBuilder = renderResources.shaderBuilder;\n  shaderBuilder.addDefine(\"USE_PICKING\", undefined, ShaderDestination.BOTH);\n  shaderBuilder.addAttribute(\"vec4\", \"a_pickColor\");\n  shaderBuilder.addVarying(\"vec4\", \"v_pickColor\");\n  renderResources.pickId = \"v_pickColor\";\n}\n\nexport default PickingPipelineStage;\n", "/**\n * The refinement approach for a tile.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#refinement|Refinement}\n * in the 3D Tiles spec.\n * </p>\n *\n * @enum {number}\n *\n * @private\n */\nconst Cesium3DTileRefine = {\n  /**\n   * Render this tile and, if it doesn't meet the screen space error, also refine to its children.\n   *\n   * @type {number}\n   * @constant\n   */\n  ADD: 0,\n\n  /**\n   * Render this tile or, if it doesn't meet the screen space error, refine to its descendants instead.\n   *\n   * @type {number}\n   * @constant\n   */\n  REPLACE: 1,\n};\nexport default Object.freeze(Cesium3DTileRefine);\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float getPointSizeFromAttenuation(vec3 positionEC) {\\n\\\n  // Variables are packed into a single vector to minimize gl.uniformXXX() calls\\n\\\n  float pointSize = model_pointCloudParameters.x;\\n\\\n  float geometricError = model_pointCloudParameters.y;\\n\\\n  float depthMultiplier = model_pointCloudParameters.z;\\n\\\n\\n\\\n  float depth = -positionEC.z;\\n\\\n  return min((geometricError / depth) * depthMultiplier, pointSize);\\n\\\n}\\n\\\n\\n\\\n#ifdef HAS_POINT_CLOUD_SHOW_STYLE\\n\\\nfloat pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\\n\\\n  float tiles3d_tileset_time = model_pointCloudParameters.w;\\n\\\n  return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time));\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\n#ifdef HAS_POINT_CLOUD_COLOR_STYLE\\n\\\nvec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\\n\\\n  float tiles3d_tileset_time = model_pointCloudParameters.w;\\n\\\n  return getColorFromStyle(attributes, metadata, tiles3d_tileset_time);\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\n#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE\\n\\\nfloat pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\\n\\\n  float tiles3d_tileset_time = model_pointCloudParameters.w;\\n\\\n  return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time));\\n\\\n}\\n\\\n#elif defined(HAS_POINT_CLOUD_ATTENUATION)\\n\\\nfloat pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\\n\\\n  return getPointSizeFromAttenuation(v_positionEC);\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\n#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING\\n\\\nfloat pointCloudBackFaceCullingStage() {\\n\\\n  #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL)\\n\\\n  // This needs to be computed in eye coordinates so we can't use attributes.normalMC\\n\\\n  return step(-v_normalEC.z, 0.0);\\n\\\n  #else\\n\\\n  return 1.0;\\n\\\n  #endif\\n\\\n}\\n\\\n#endif\";\n", "import Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Cartesian4 from \"../../Core/Cartesian4.js\";\nimport CesiumMath from \"../../Core/Math.js\";\nimport Cesium3DTileRefine from \"../Cesium3DTileRefine.js\";\nimport clone from \"../../Core/clone.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport ModelType from \"./ModelType.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport OrthographicFrustum from \"../../Core/OrthographicFrustum.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport PointCloudStylingStageVS from \"../../Shaders/Model/PointCloudStylingStageVS.js\";\nimport RuntimeError from \"../../Core/RuntimeError.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\n\nconst scratchUniform = new Cartesian4();\n\n/**\n * The point cloud styling stage is responsible for applying color,\n * size, and show styles to point clouds at runtime. It also handles\n * point cloud shading provided by either the model or the tileset that\n * owns it. Point cloud shading is only applied if no point size style\n * is provided.\n *\n * @namespace PointCloudStylingPipelineStage\n *\n * @private\n */\nconst PointCloudStylingPipelineStage = {\n  name: \"PointCloudStylingPipelineStage\", // Helps with debugging\n};\n\n/**\n * Processes a primitive. If the model that owns it has a style, then\n * this stage modifies the following parts of the render resources:\n * <ul>\n *  <li>adds the styling functions to the vertex shaders</li>\n *  <li>adds a define to compute the position in world coordinates</li>\n *  <li>adds a varying to compute point cloud color</li>\n * </ul>\n *\n * If the model has point cloud shading, then this stage modifies the following\n * part of the render resources:\n * <ul>\n *  <li>adds vertex shader code to compute attenuation and update gl_PointSize</li>\n *  <li>updates the uniform map to pass in point cloud parameters</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nPointCloudStylingPipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  const shaderBuilder = renderResources.shaderBuilder;\n  const model = renderResources.model;\n  const style = model.style;\n\n  // Point cloud styling will only be applied on the GPU if there is\n  // no batch table. If a batch table exists, then:\n  //  - the property attribute will not be defined\n  //  - the model will be using a feature table\n\n  const structuralMetadata = model.structuralMetadata;\n  const propertyAttributes = defined(structuralMetadata)\n    ? structuralMetadata.propertyAttributes\n    : undefined;\n\n  const hasFeatureTable =\n    defined(model.featureTableId) &&\n    model.featureTables[model.featureTableId].featuresLength > 0;\n\n  const hasBatchTable = !defined(propertyAttributes) && hasFeatureTable;\n\n  if (defined(style) && !hasBatchTable) {\n    const variableSubstitutionMap = getVariableSubstitutionMap(\n      propertyAttributes\n    );\n    const shaderFunctionInfo = getStyleShaderFunctionInfo(\n      style,\n      variableSubstitutionMap\n    );\n    addShaderFunctionsAndDefines(shaderBuilder, shaderFunctionInfo);\n\n    const propertyNames = getPropertyNames(shaderFunctionInfo);\n\n    const usesNormalSemantic = propertyNames.indexOf(\"normalMC\") >= 0;\n    const hasNormals = ModelUtility.getAttributeBySemantic(\n      primitive,\n      VertexAttributeSemantic.NORMAL\n    );\n\n    if (usesNormalSemantic && !hasNormals) {\n      throw new RuntimeError(\n        \"Style references the NORMAL semantic but the point cloud does not have normals\"\n      );\n    }\n\n    shaderBuilder.addDefine(\n      \"COMPUTE_POSITION_WC_STYLE\",\n      undefined,\n      ShaderDestination.VERTEX\n    );\n\n    // If the style is translucent, the alpha options must be adjusted.\n    const styleTranslucent = shaderFunctionInfo.styleTranslucent;\n    if (styleTranslucent) {\n      renderResources.alphaOptions.pass = Pass.TRANSLUCENT;\n    }\n  }\n\n  const pointCloudShading = model.pointCloudShading;\n  if (pointCloudShading.attenuation) {\n    shaderBuilder.addDefine(\n      \"HAS_POINT_CLOUD_ATTENUATION\",\n      undefined,\n      ShaderDestination.VERTEX\n    );\n  }\n\n  if (pointCloudShading.backFaceCulling) {\n    shaderBuilder.addDefine(\n      \"HAS_POINT_CLOUD_BACK_FACE_CULLING\",\n      undefined,\n      ShaderDestination.VERTEX\n    );\n  }\n\n  let content;\n  let is3DTiles;\n  let usesAddRefinement;\n\n  if (ModelType.is3DTiles(model.type)) {\n    is3DTiles = true;\n    content = model.content;\n    usesAddRefinement = content.tile.refine === Cesium3DTileRefine.ADD;\n  }\n\n  shaderBuilder.addUniform(\n    \"vec4\",\n    \"model_pointCloudParameters\",\n    ShaderDestination.VERTEX\n  );\n\n  shaderBuilder.addVertexLines(PointCloudStylingStageVS);\n\n  const uniformMap = renderResources.uniformMap;\n  uniformMap.model_pointCloudParameters = function () {\n    const vec4 = scratchUniform;\n\n    // Point size\n    let defaultPointSize = 1.0;\n    if (is3DTiles) {\n      defaultPointSize = usesAddRefinement\n        ? 5.0\n        : content.tileset.memoryAdjustedScreenSpaceError;\n    }\n    vec4.x = defaultValue(\n      pointCloudShading.maximumAttenuation,\n      defaultPointSize\n    );\n    vec4.x *= frameState.pixelRatio;\n\n    // Geometric error\n    const geometricError = getGeometricError(\n      renderResources,\n      primitive,\n      pointCloudShading,\n      content\n    );\n    vec4.y = geometricError * pointCloudShading.geometricErrorScale;\n\n    const context = frameState.context;\n    const frustum = frameState.camera.frustum;\n    let depthMultiplier;\n\n    // Attenuation is maximumAttenuation in 2D/ortho\n    if (\n      frameState.mode === SceneMode.SCENE2D ||\n      frustum instanceof OrthographicFrustum\n    ) {\n      depthMultiplier = Number.POSITIVE_INFINITY;\n    } else {\n      depthMultiplier =\n        context.drawingBufferHeight / frameState.camera.frustum.sseDenominator;\n    }\n\n    // Depth multiplier\n    vec4.z = depthMultiplier;\n\n    // Time\n    if (is3DTiles) {\n      vec4.w = content.tileset.timeSinceLoad;\n    }\n\n    return vec4;\n  };\n};\n\nconst scratchDimensions = new Cartesian3();\nfunction getGeometricError(\n  renderResources,\n  primitive,\n  pointCloudShading,\n  content\n) {\n  if (defined(content)) {\n    const geometricError = content.tile.geometricError;\n\n    if (geometricError > 0) {\n      return geometricError;\n    }\n  }\n\n  if (defined(pointCloudShading.baseResolution)) {\n    return pointCloudShading.baseResolution;\n  }\n\n  const positionAttribute = ModelUtility.getAttributeBySemantic(\n    primitive,\n    VertexAttributeSemantic.POSITION\n  );\n  const pointsLength = positionAttribute.count;\n\n  // Estimate the geometric error\n  const nodeTransform = renderResources.runtimeNode.transform;\n  let dimensions = Cartesian3.subtract(\n    positionAttribute.max,\n    positionAttribute.min,\n    scratchDimensions\n  );\n  // dimensions is a vector, as it is a subtraction between two points\n  dimensions = Matrix4.multiplyByPointAsVector(\n    nodeTransform,\n    dimensions,\n    scratchDimensions\n  );\n  const volume = dimensions.x * dimensions.y * dimensions.z;\n  const geometricErrorEstimate = CesiumMath.cbrt(volume / pointsLength);\n  return geometricErrorEstimate;\n}\n\nconst scratchShaderFunctionInfo = {\n  colorStyleFunction: undefined,\n  showStyleFunction: undefined,\n  pointSizeStyleFunction: undefined,\n  styleTranslucent: false,\n};\n\nconst builtinVariableSubstitutionMap = {\n  POSITION: \"attributes.positionMC\",\n  POSITION_ABSOLUTE: \"v_positionWC\",\n  COLOR: \"attributes.color_0\",\n  NORMAL: \"attributes.normalMC\",\n};\n\nfunction getVariableSubstitutionMap(propertyAttributes) {\n  const variableSubstitutionMap = clone(builtinVariableSubstitutionMap);\n\n  if (!defined(propertyAttributes)) {\n    return variableSubstitutionMap;\n  }\n\n  for (let i = 0; i < propertyAttributes.length; i++) {\n    const propertyAttribute = propertyAttributes[i];\n    const properties = propertyAttribute.properties;\n    for (const propertyId in properties) {\n      // The property ID was already sanitized for GLSL by PntsLoader.\n      if (properties.hasOwnProperty(propertyId)) {\n        variableSubstitutionMap[propertyId] = `metadata.${propertyId}`;\n      }\n    }\n  }\n\n  return variableSubstitutionMap;\n}\nconst parameterList =\n  \"ProcessedAttributes attributes, \" +\n  \"Metadata metadata, \" +\n  \"float tiles3d_tileset_time\";\n\nfunction getStyleShaderFunctionInfo(style, variableSubstitutionMap) {\n  const info = scratchShaderFunctionInfo;\n  const shaderState = {\n    translucent: false,\n  };\n\n  info.colorStyleFunction = style.getColorShaderFunction(\n    `getColorFromStyle(${parameterList})`,\n    variableSubstitutionMap,\n    shaderState\n  );\n  info.showStyleFunction = style.getShowShaderFunction(\n    `getShowFromStyle(${parameterList})`,\n    variableSubstitutionMap,\n    shaderState\n  );\n  info.pointSizeStyleFunction = style.getPointSizeShaderFunction(\n    `getPointSizeFromStyle(${parameterList})`,\n    variableSubstitutionMap,\n    shaderState\n  );\n  info.styleTranslucent =\n    defined(info.colorStyleFunction) && shaderState.translucent;\n\n  return info;\n}\n\nfunction addShaderFunctionsAndDefines(shaderBuilder, shaderFunctionInfo) {\n  const colorStyleFunction = shaderFunctionInfo.colorStyleFunction;\n  if (defined(colorStyleFunction)) {\n    shaderBuilder.addDefine(\n      \"HAS_POINT_CLOUD_COLOR_STYLE\",\n      undefined,\n      ShaderDestination.BOTH\n    );\n    shaderBuilder.addVertexLines(colorStyleFunction);\n\n    // The point cloud may not necessarily have a color attribute.\n    // Use a custom varying to account for this.\n    shaderBuilder.addVarying(\"vec4\", \"v_pointCloudColor\");\n  }\n\n  const showStyleFunction = shaderFunctionInfo.showStyleFunction;\n  if (defined(showStyleFunction)) {\n    shaderBuilder.addDefine(\n      \"HAS_POINT_CLOUD_SHOW_STYLE\",\n      undefined,\n      ShaderDestination.VERTEX\n    );\n    shaderBuilder.addVertexLines(showStyleFunction);\n  }\n\n  const pointSizeStyleFunction = shaderFunctionInfo.pointSizeStyleFunction;\n  if (defined(pointSizeStyleFunction)) {\n    shaderBuilder.addDefine(\n      \"HAS_POINT_CLOUD_POINT_SIZE_STYLE\",\n      undefined,\n      ShaderDestination.VERTEX\n    );\n    shaderBuilder.addVertexLines(pointSizeStyleFunction);\n  }\n}\n\n/**\n * Gets all the built-in property names used by the given style\n * function.\n *\n * @param {Function} source The style function.\n * @param {string[]} propertyNames The array of property names to add to.\n *\n * @private\n */\nfunction getBuiltinPropertyNames(source, propertyNames) {\n  const regex = /attributes\\.(\\w+)/g;\n  let matches = regex.exec(source);\n  while (matches !== null) {\n    const name = matches[1];\n    // Add the property name if it isn't already in the array.\n    if (propertyNames.indexOf(name) === -1) {\n      propertyNames.push(name);\n    }\n    matches = regex.exec(source);\n  }\n}\n\nfunction getPropertyNames(shaderFunctionInfo) {\n  const colorStyleFunction = shaderFunctionInfo.colorStyleFunction;\n  const showStyleFunction = shaderFunctionInfo.showStyleFunction;\n  const pointSizeStyleFunction = shaderFunctionInfo.pointSizeStyleFunction;\n\n  // Get the properties in use by the style.\n  const builtinPropertyNames = [];\n\n  if (defined(colorStyleFunction)) {\n    getBuiltinPropertyNames(colorStyleFunction, builtinPropertyNames);\n  }\n  if (defined(showStyleFunction)) {\n    getBuiltinPropertyNames(showStyleFunction, builtinPropertyNames);\n  }\n  if (defined(pointSizeStyleFunction)) {\n    getBuiltinPropertyNames(pointSizeStyleFunction, builtinPropertyNames);\n  }\n\n  return builtinPropertyNames;\n}\n\nexport default PointCloudStylingPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void primitiveOutlineStage() {\\n\\\n    v_outlineCoordinates = a_outlineCoordinates;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void primitiveOutlineStage(inout czm_modelMaterial material) {\\n\\\n    if (!model_showOutline) {\\n\\\n        return;\\n\\\n    }\\n\\\n\\n\\\n    float outlineX = \\n\\\n        texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;\\n\\\n    float outlineY = \\n\\\n        texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;\\n\\\n    float outlineZ = \\n\\\n        texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;\\n\\\n    float outlineness = max(outlineX, max(outlineY, outlineZ));\\n\\\n\\n\\\n    material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);\\n\\\n}\\n\\\n\\n\\\n\";\n", "import AttributeType from \"../AttributeType.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport PrimitiveOutlineGenerator from \"./PrimitiveOutlineGenerator.js\";\nimport PrimitiveOutlineStageVS from \"../../Shaders/Model/PrimitiveOutlineStageVS.js\";\nimport PrimitiveOutlineStageFS from \"../../Shaders/Model/PrimitiveOutlineStageFS.js\";\n\n/**\n * The primitive outline pipeline stage configures the shader to render outlines\n * from the CESIUM_primitive_outline extension.\n *\n * @namespace PrimitiveOutlinePipelineStage\n *\n * @private\n */\nconst PrimitiveOutlinePipelineStage = {\n  name: \"PrimitiveOutlinePipelineStage\", // Helps with debugging\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render\n * resources:\n * <ul>\n *  <li>Declares a new attribute for the outline (texture) coordinates</li>\n *  <li>Adds shader code to overlay outlines on the primitive after lighting computations</li>\n *  <li>Add uniforms for showing the outline and changing its color</li>\n * </ul>\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {ModelComponents.Primitive} primitive The primitive to be rendered\n * @param {FrameState} frameState The frame state\n * @private\n */\nPrimitiveOutlinePipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  const shaderBuilder = renderResources.shaderBuilder;\n  const uniformMap = renderResources.uniformMap;\n\n  shaderBuilder.addDefine(\n    \"HAS_PRIMITIVE_OUTLINE\",\n    undefined,\n    ShaderDestination.BOTH\n  );\n\n  shaderBuilder.addAttribute(\"vec3\", \"a_outlineCoordinates\");\n  shaderBuilder.addVarying(\"vec3\", \"v_outlineCoordinates\");\n\n  const outlineCoordinates = primitive.outlineCoordinates;\n  const vertexAttribute = {\n    index: renderResources.attributeIndex++,\n    vertexBuffer: outlineCoordinates.buffer,\n    componentsPerAttribute: AttributeType.getNumberOfComponents(\n      outlineCoordinates.type\n    ),\n    componentDatatype: outlineCoordinates.componentDatatype,\n    offsetInBytes: outlineCoordinates.byteOffset,\n    strideInBytes: outlineCoordinates.byteStride,\n    normalize: outlineCoordinates.normalized,\n  };\n  renderResources.attributes.push(vertexAttribute);\n\n  shaderBuilder.addUniform(\n    \"sampler2D\",\n    \"model_outlineTexture\",\n    ShaderDestination.FRAGMENT\n  );\n\n  // This automatically handles caching the texture on the context\n  const outlineTexture = PrimitiveOutlineGenerator.createTexture(\n    frameState.context\n  );\n  uniformMap.model_outlineTexture = function () {\n    return outlineTexture;\n  };\n\n  const model = renderResources.model;\n  shaderBuilder.addUniform(\n    \"vec4\",\n    \"model_outlineColor\",\n    ShaderDestination.FRAGMENT\n  );\n  uniformMap.model_outlineColor = function () {\n    return model.outlineColor;\n  };\n  shaderBuilder.addUniform(\n    \"bool\",\n    \"model_showOutline\",\n    ShaderDestination.FRAGMENT\n  );\n  uniformMap.model_showOutline = function () {\n    return model.showOutline;\n  };\n\n  shaderBuilder.addVertexLines(PrimitiveOutlineStageVS);\n  shaderBuilder.addFragmentLines(PrimitiveOutlineStageFS);\n};\n\nexport default PrimitiveOutlinePipelineStage;\n", "import defined from \"../../Core/defined.js\";\nimport PrimitiveType from \"../../Core/PrimitiveType.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\n/**\n * The primitive statistics update stage updates memory usage statistics\n * on the primitive level. This counts the binary resources that exist\n * for the lifetime of the Model (e.g. attributes and textures\n * loaded by GltfLoader). It does not count resources that are created\n * every time the pipeline is run. The individual pipeline stages are\n * responsible for tracking the additional memory they allocate.\n *\n * @namespace PrimitiveStatisticsPipelineStage\n *\n * @private\n */\nconst PrimitiveStatisticsPipelineStage = {\n  name: \"PrimitiveStatisticsPipelineStage\", // Helps with debugging\n\n  // Expose some methods for testing\n  _countGeometry: countGeometry,\n  _count2DPositions: count2DPositions,\n  _countMorphTargetAttributes: countMorphTargetAttributes,\n  _countMaterialTextures: countMaterialTextures,\n  _countFeatureIdTextures: countFeatureIdTextures,\n  _countBinaryMetadata: countBinaryMetadata,\n};\n\nPrimitiveStatisticsPipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  const model = renderResources.model;\n  const statistics = model.statistics;\n\n  countGeometry(statistics, primitive);\n  count2DPositions(statistics, renderResources.runtimePrimitive);\n  countMorphTargetAttributes(statistics, primitive);\n  countMaterialTextures(statistics, primitive.material);\n  countFeatureIdTextures(statistics, primitive.featureIds);\n  countBinaryMetadata(statistics, model);\n\n  // The following stages handle their own memory statistics, since all their\n  // resources are generated each time draw commands are built:\n  //\n  // - PickingPipelineStage\n  // - WireframePipelineStage\n  // - InstancingPipelineStage\n  // - FeatureIdPipelineStage (feature ID implicit ranges only)\n};\n\nfunction countGeometry(statistics, primitive) {\n  const indicesCount = defined(primitive.indices)\n    ? primitive.indices.count\n    : ModelUtility.getAttributeBySemantic(primitive, \"POSITION\").count;\n\n  const primitiveType = primitive.primitiveType;\n\n  if (primitiveType === PrimitiveType.POINTS) {\n    statistics.pointsLength += indicesCount;\n  } else if (PrimitiveType.isTriangles(primitiveType)) {\n    statistics.trianglesLength += countTriangles(primitiveType, indicesCount);\n  }\n\n  const attributes = primitive.attributes;\n  const length = attributes.length;\n  for (let i = 0; i < length; i++) {\n    const attribute = attributes[i];\n    if (defined(attribute.buffer)) {\n      const hasCpuCopy = defined(attribute.typedArray);\n      statistics.addBuffer(attribute.buffer, hasCpuCopy);\n    }\n  }\n\n  const outlineCoordinates = primitive.outlineCoordinates;\n  if (defined(outlineCoordinates) && defined(outlineCoordinates.buffer)) {\n    const hasCpuCopy = false;\n    statistics.addBuffer(outlineCoordinates.buffer, hasCpuCopy);\n  }\n\n  const indices = primitive.indices;\n  if (defined(indices) && defined(indices.buffer)) {\n    // Wireframe mode will have both GPU and CPU copies\n    const hasCpuCopy = defined(indices.typedArray);\n    statistics.addBuffer(indices.buffer, hasCpuCopy);\n  }\n}\n\nfunction countTriangles(primitiveType, indicesCount) {\n  switch (primitiveType) {\n    case PrimitiveType.TRIANGLES:\n      return indicesCount / 3;\n    case PrimitiveType.TRIANGLE_STRIP:\n    case PrimitiveType.TRIANGLE_FAN:\n      return Math.max(indicesCount - 2, 0);\n    default:\n      return 0;\n  }\n}\n\nfunction count2DPositions(statistics, runtimePrimitive) {\n  const buffer2D = runtimePrimitive.positionBuffer2D;\n\n  // The 2D buffer is only created the first time the scene switches to 2D mode.\n  // This means there's two main cases for accounting for 2D positions:\n  // 1. The scene was in 3D mode so positions were never generated from\n  //    positionAttribute.typedArray. In this case, countGeometry() will\n  //    detect the typed array and set hasCpuCopy = true. No memory is counted\n  //    here.\n  // 2. The scene was in 2D mode so positions were generated as a buffer.\n  //    Even though the typed array was unlinked from the attribute, it still\n  //    exists in the loader so we count it here.\n  if (defined(buffer2D)) {\n    const hasCpuCopy = true;\n    statistics.addBuffer(buffer2D, hasCpuCopy);\n  }\n}\n\nfunction countMorphTargetAttributes(statistics, primitive) {\n  const morphTargets = primitive.morphTargets;\n  if (!defined(morphTargets)) {\n    return;\n  }\n\n  const hasCpuCopy = false;\n  const morphTargetsLength = morphTargets.length;\n  for (let i = 0; i < morphTargetsLength; i++) {\n    const attributes = morphTargets[i].attributes;\n\n    const attributesLength = attributes.length;\n    for (let j = 0; j < attributesLength; j++) {\n      const attribute = attributes[j];\n\n      if (defined(attribute.buffer)) {\n        statistics.addBuffer(attribute.buffer, hasCpuCopy);\n      }\n    }\n  }\n}\n\nfunction countMaterialTextures(statistics, material) {\n  // gltf-pipeline provides a default material so material will always be\n  // defined.\n  const textureReaders = getAllTextureReaders(material);\n  const length = textureReaders.length;\n  for (let i = 0; i < length; i++) {\n    const textureReader = textureReaders[i];\n    // If textures were loaded asynchronously, the texture may not be available\n    // the first time this is run.\n    if (defined(textureReader) && defined(textureReader.texture)) {\n      statistics.addTexture(textureReader.texture);\n    }\n  }\n}\n\nfunction getAllTextureReaders(material) {\n  const metallicRoughness = material.metallicRoughness;\n  const textureReaders = [\n    material.emissiveTexture,\n    material.normalTexture,\n    material.occlusionTexture,\n    metallicRoughness.baseColorTexture,\n    metallicRoughness.metallicRoughnessTexture,\n  ];\n\n  const specularGlossiness = material.specularGlossiness;\n  if (defined(specularGlossiness)) {\n    textureReaders.push(specularGlossiness.diffuseTexture);\n    textureReaders.push(specularGlossiness.specularGlossinessTexture);\n  }\n\n  return textureReaders;\n}\n\nfunction countFeatureIdTextures(statistics, featureIdSets) {\n  // Feature ID attributes are handled by countGeometry()\n\n  // Feature ID implicit ranges are handled in the FeatureIdPipelineStage,\n  // as they only are created as-needed.\n\n  const length = featureIdSets.length;\n  for (let i = 0; i < length; i++) {\n    const featureIds = featureIdSets[i];\n    if (featureIds instanceof ModelComponents.FeatureIdTexture) {\n      const textureReader = featureIds.textureReader;\n      if (defined(textureReader.texture)) {\n        statistics.addTexture(textureReader.texture);\n      }\n    }\n  }\n}\n\nfunction countBinaryMetadata(statistics, model) {\n  // Add metadata memory to the statistics. Note that feature ID memory is\n  // handled by the Feature ID pipeline stage.\n  const structuralMetadata = model.structuralMetadata;\n  if (defined(structuralMetadata)) {\n    // Property textures are added to the texture memory count. If textures\n    // are loaded asynchronously, this may add 0 to the total. The pipeline\n    // will be re-run when textures are loaded for an accurate count.\n    countPropertyTextures(statistics, structuralMetadata);\n\n    // Property tables are accounted for here.\n    statistics.propertyTablesByteLength +=\n      structuralMetadata.propertyTablesByteLength;\n\n    // Skip property attributes since those are handled in countGeometry().\n  }\n\n  // Model feature tables also have batch and pick textures that need to be\n  // counted.\n  const featureTables = model.featureTables;\n  if (!defined(featureTables)) {\n    return;\n  }\n\n  const length = featureTables.length;\n  for (let i = 0; i < length; i++) {\n    const featureTable = featureTables[i];\n\n    // This does not include the property table memory, since\n    // it is counted through the structuralMetadata above.\n    statistics.addBatchTexture(featureTable.batchTexture);\n  }\n}\n\nfunction countPropertyTextures(statistics, structuralMetadata) {\n  const propertyTextures = structuralMetadata.propertyTextures;\n  if (!defined(propertyTextures)) {\n    return;\n  }\n\n  // Loop over the property textures from here so we can use\n  // statistics.addTexture() which avoids double-counting shared textures.\n  const texturesLength = propertyTextures.length;\n  for (let i = 0; i < texturesLength; i++) {\n    const propertyTexture = propertyTextures[i];\n    const properties = propertyTexture.properties;\n    for (const propertyId in properties) {\n      if (properties.hasOwnProperty(propertyId)) {\n        const property = properties[propertyId];\n        const textureReader = property.textureReader;\n        if (defined(textureReader.texture)) {\n          statistics.addTexture(textureReader.texture);\n        }\n      }\n    }\n  }\n}\n\nexport default PrimitiveStatisticsPipelineStage;\n", "import BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport clone from \"../../Core/clone.js\";\nimport combine from \"../../Core/combine.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\nimport SceneTransforms from \"../SceneTransforms.js\";\n\nconst scratchModelMatrix = new Matrix4();\nconst scratchModelView2D = new Matrix4();\n\n/**\n * The scene mode 2D stage generates resources for rendering a primitive in 2D / CV mode.\n *\n * @namespace SceneMode2DPipelineStage\n *\n * @private\n */\nconst SceneMode2DPipelineStage = {\n  name: \"SceneMode2DPipelineStage\", // Helps with debugging\n};\n\n/**\n * This pipeline stage processes the position attribute of a primitive and adds the relevant\n * define and uniform matrix to the shader. It also generates new resources for the primitive\n * in 2D. These resources persist in the runtime primitive so that the typed array used to\n * store the positional data can be freed.\n *\n * This stage must go before the GeometryPipelineStage in the primitive pipeline.\n *\n * Processes a primitive. This stage modifies the following parts of the render resources:\n * <ul>\n *  <li> creates a vertex buffer for the positions of the primitive projected to 2D\n *  <li> creates the bounding sphere for the primitive in 2D\n *  <li> adds a flag to the shader to use 2D positions\n *  <li> adds a uniform for the view model matrix in 2D\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\n\nSceneMode2DPipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  const positionAttribute = ModelUtility.getAttributeBySemantic(\n    primitive,\n    VertexAttributeSemantic.POSITION\n  );\n\n  const shaderBuilder = renderResources.shaderBuilder;\n  const model = renderResources.model;\n  const modelMatrix = model.sceneGraph.computedModelMatrix;\n  const nodeComputedTransform = renderResources.runtimeNode.computedTransform;\n  const computedModelMatrix = Matrix4.multiplyTransformation(\n    modelMatrix,\n    nodeComputedTransform,\n    scratchModelMatrix\n  );\n\n  const boundingSphere2D = computeBoundingSphere2D(\n    renderResources,\n    computedModelMatrix,\n    frameState\n  );\n\n  const runtimePrimitive = renderResources.runtimePrimitive;\n  runtimePrimitive.boundingSphere2D = boundingSphere2D;\n\n  // If the model is instanced, 2D projection will be handled in the\n  // InstancingPipelineStage.\n  const instances = renderResources.runtimeNode.node.instances;\n  if (defined(instances)) {\n    return;\n  }\n\n  // If the typed array of the position attribute exists, then\n  // the positions haven't been projected to 2D yet.\n  if (defined(positionAttribute.typedArray)) {\n    const buffer2D = createPositionBufferFor2D(\n      positionAttribute,\n      computedModelMatrix,\n      boundingSphere2D,\n      frameState\n    );\n\n    // Since this buffer will persist even if the pipeline is re-run,\n    // its memory will be counted in PrimitiveStatisticsPipelineStage\n    runtimePrimitive.positionBuffer2D = buffer2D;\n    model._modelResources.push(buffer2D);\n\n    // Unload the typed array. This is just a pointer to the array in\n    // the vertex buffer loader, so if the typed array is shared by\n    // multiple primitives (i.e. multiple instances of the same mesh),\n    // this will not affect the other primitives.\n    positionAttribute.typedArray = undefined;\n  }\n\n  shaderBuilder.addDefine(\n    \"USE_2D_POSITIONS\",\n    undefined,\n    ShaderDestination.VERTEX\n  );\n\n  shaderBuilder.addUniform(\"mat4\", \"u_modelView2D\", ShaderDestination.VERTEX);\n\n  const modelMatrix2D = Matrix4.fromTranslation(\n    boundingSphere2D.center,\n    new Matrix4()\n  );\n\n  const context = frameState.context;\n  const uniformMap = {\n    u_modelView2D: function () {\n      return Matrix4.multiplyTransformation(\n        context.uniformState.view,\n        modelMatrix2D,\n        scratchModelView2D\n      );\n    },\n  };\n\n  renderResources.uniformMap = combine(uniformMap, renderResources.uniformMap);\n};\n\nconst scratchProjectedMin = new Cartesian3();\nconst scratchProjectedMax = new Cartesian3();\n\nfunction computeBoundingSphere2D(renderResources, modelMatrix, frameState) {\n  // Compute the bounding sphere in 2D.\n  const transformedPositionMin = Matrix4.multiplyByPoint(\n    modelMatrix,\n    renderResources.positionMin,\n    scratchProjectedMin\n  );\n\n  const projectedMin = SceneTransforms.computeActualWgs84Position(\n    frameState,\n    transformedPositionMin,\n    transformedPositionMin\n  );\n\n  const transformedPositionMax = Matrix4.multiplyByPoint(\n    modelMatrix,\n    renderResources.positionMax,\n    scratchProjectedMax\n  );\n\n  const projectedMax = SceneTransforms.computeActualWgs84Position(\n    frameState,\n    transformedPositionMax,\n    transformedPositionMax\n  );\n\n  return BoundingSphere.fromCornerPoints(\n    projectedMin,\n    projectedMax,\n    new BoundingSphere()\n  );\n}\n\nconst scratchPosition = new Cartesian3();\n\nfunction dequantizePositionsTypedArray(typedArray, quantization) {\n  // Draco compression is normally handled in the dequantization stage\n  // in the shader, but it must be decoded here in order to project\n  // the positions to 2D / CV.\n  const length = typedArray.length;\n  const dequantizedArray = new Float32Array(length);\n  const quantizedVolumeOffset = quantization.quantizedVolumeOffset;\n  const quantizedVolumeStepSize = quantization.quantizedVolumeStepSize;\n  for (let i = 0; i < length; i += 3) {\n    const initialPosition = Cartesian3.fromArray(\n      typedArray,\n      i,\n      scratchPosition\n    );\n    const scaledPosition = Cartesian3.multiplyComponents(\n      initialPosition,\n      quantizedVolumeStepSize,\n      initialPosition\n    );\n    const dequantizedPosition = Cartesian3.add(\n      scaledPosition,\n      quantizedVolumeOffset,\n      scaledPosition\n    );\n\n    dequantizedArray[i] = dequantizedPosition.x;\n    dequantizedArray[i + 1] = dequantizedPosition.y;\n    dequantizedArray[i + 2] = dequantizedPosition.z;\n  }\n\n  return dequantizedArray;\n}\n\nfunction createPositionsTypedArrayFor2D(\n  attribute,\n  modelMatrix,\n  referencePoint,\n  frameState\n) {\n  let result;\n  if (defined(attribute.quantization)) {\n    // Dequantize the positions if necessary.\n    result = dequantizePositionsTypedArray(\n      attribute.typedArray,\n      attribute.quantization\n    );\n  } else {\n    result = attribute.typedArray.slice();\n  }\n\n  const startIndex = attribute.byteOffset / Float32Array.BYTES_PER_ELEMENT;\n  const length = result.length;\n  const stride = defined(attribute.byteStride)\n    ? attribute.byteStride / Float32Array.BYTES_PER_ELEMENT\n    : 3;\n\n  for (let i = startIndex; i < length; i += stride) {\n    const initialPosition = Cartesian3.fromArray(result, i, scratchPosition);\n    if (\n      isNaN(initialPosition.x) ||\n      isNaN(initialPosition.y) ||\n      isNaN(initialPosition.z)\n    ) {\n      continue;\n    }\n\n    const transformedPosition = Matrix4.multiplyByPoint(\n      modelMatrix,\n      initialPosition,\n      initialPosition\n    );\n\n    const projectedPosition = SceneTransforms.computeActualWgs84Position(\n      frameState,\n      transformedPosition,\n      transformedPosition\n    );\n\n    const relativePosition = Cartesian3.subtract(\n      projectedPosition,\n      referencePoint,\n      projectedPosition\n    );\n\n    result[i] = relativePosition.x;\n    result[i + 1] = relativePosition.y;\n    result[i + 2] = relativePosition.z;\n  }\n\n  return result;\n}\n\nfunction createPositionBufferFor2D(\n  positionAttribute,\n  modelMatrix,\n  boundingSphere2D,\n  frameState\n) {\n  // Force the scene mode to be CV. In 2D, projected positions will have\n  // an x-coordinate of 0, which eliminates the height data that is\n  // necessary for rendering in CV mode.\n  const frameStateCV = clone(frameState);\n  frameStateCV.mode = SceneMode.COLUMBUS_VIEW;\n\n  // To prevent jitter, the positions are defined relative to a common\n  // reference point. For convenience, this is the center of the\n  // primitive's bounding sphere in 2D.\n  const referencePoint = boundingSphere2D.center;\n  const projectedPositions = createPositionsTypedArrayFor2D(\n    positionAttribute,\n    modelMatrix,\n    referencePoint,\n    frameStateCV\n  );\n\n  // Put the resulting data in a GPU buffer.\n  const buffer = Buffer.createVertexBuffer({\n    context: frameState.context,\n    typedArray: projectedPositions,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n  buffer.vertexArrayDestroyable = false;\n\n  return buffer;\n}\n\nexport default SceneMode2DPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void skinningStage(inout ProcessedAttributes attributes) \\n\\\n{\\n\\\n    mat4 skinningMatrix = getSkinningMatrix();\\n\\\n    mat3 skinningMatrixMat3 = mat3(skinningMatrix);\\n\\\n\\n\\\n    vec4 positionMC = vec4(attributes.positionMC, 1.0);\\n\\\n    attributes.positionMC = vec3(skinningMatrix * positionMC);\\n\\\n\\n\\\n    #ifdef HAS_NORMALS\\n\\\n    vec3 normalMC = attributes.normalMC;\\n\\\n    attributes.normalMC = skinningMatrixMat3 * normalMC;\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef HAS_TANGENTS\\n\\\n    vec3 tangentMC = attributes.tangentMC;\\n\\\n    attributes.tangentMC = skinningMatrixMat3 * tangentMC;\\n\\\n    #endif\\n\\\n}\";\n", "import combine from \"../../Core/combine.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport SkinningStageVS from \"../../Shaders/Model/SkinningStageVS.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\n\n/**\n * The skinning pipeline stage processes the joint matrices of a skinned primitive.\n *\n * @namespace SkinningPipelineStage\n *\n * @private\n */\n\nconst SkinningPipelineStage = {\n  name: \"SkinningPipelineStage\", // Helps with debugging\n\n  FUNCTION_ID_GET_SKINNING_MATRIX: \"getSkinningMatrix\",\n  FUNCTION_SIGNATURE_GET_SKINNING_MATRIX: \"mat4 getSkinningMatrix()\",\n};\n\n/**\n * This pipeline stage processes the joint matrices of a skinned primitive, adding\n * the relevant functions and uniforms to the shaders. The joint and weight attributes\n * themselves are processed in the geometry pipeline stage.\n *\n * Processes a primitive. This stage modifies the following parts of the render resources:\n * <ul>\n *  <li> adds the uniform declaration for the joint matrices in the vertex shader</li>\n *  <li> adds the function to compute the skinning matrix in the vertex shader</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @private\n */\nSkinningPipelineStage.process = function (renderResources, primitive) {\n  const shaderBuilder = renderResources.shaderBuilder;\n\n  shaderBuilder.addDefine(\"HAS_SKINNING\", undefined, ShaderDestination.VERTEX);\n  addGetSkinningMatrixFunction(shaderBuilder, primitive);\n\n  const runtimeNode = renderResources.runtimeNode;\n  const jointMatrices = runtimeNode.computedJointMatrices;\n\n  shaderBuilder.addUniform(\n    \"mat4\",\n    `u_jointMatrices[${jointMatrices.length}]`,\n    ShaderDestination.VERTEX\n  );\n\n  shaderBuilder.addVertexLines(SkinningStageVS);\n\n  const uniformMap = {\n    u_jointMatrices: function () {\n      return runtimeNode.computedJointMatrices;\n    },\n  };\n\n  renderResources.uniformMap = combine(uniformMap, renderResources.uniformMap);\n};\n\nfunction getMaximumAttributeSetIndex(primitive) {\n  let setIndex = -1;\n  const attributes = primitive.attributes;\n  const length = attributes.length;\n  for (let i = 0; i < length; i++) {\n    const attribute = attributes[i];\n    const isJointsOrWeights =\n      attribute.semantic === VertexAttributeSemantic.JOINTS ||\n      attribute.semantic === VertexAttributeSemantic.WEIGHTS;\n\n    if (!isJointsOrWeights) {\n      continue;\n    }\n\n    setIndex = Math.max(setIndex, attribute.setIndex);\n  }\n\n  return setIndex;\n}\n\nfunction addGetSkinningMatrixFunction(shaderBuilder, primitive) {\n  shaderBuilder.addFunction(\n    SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX,\n    SkinningPipelineStage.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,\n    ShaderDestination.VERTEX\n  );\n\n  const initialLine = \"mat4 skinnedMatrix = mat4(0);\";\n  shaderBuilder.addFunctionLines(\n    SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX,\n    [initialLine]\n  );\n\n  let setIndex;\n  let componentIndex;\n  const componentStrings = [\"x\", \"y\", \"z\", \"w\"];\n  const maximumSetIndex = getMaximumAttributeSetIndex(primitive);\n  for (setIndex = 0; setIndex <= maximumSetIndex; setIndex++) {\n    for (componentIndex = 0; componentIndex <= 3; componentIndex++) {\n      const component = componentStrings[componentIndex];\n      // Example: skinnedMatrix += a_weights_0.x * u_jointMatrices[int(a_joints_0.x)];\n      const line = `skinnedMatrix += a_weights_${setIndex}.${component} * u_jointMatrices[int(a_joints_${setIndex}.${component})];`;\n      shaderBuilder.addFunctionLines(\n        SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX,\n        [line]\n      );\n    }\n  }\n\n  const returnLine = \"return skinnedMatrix;\";\n  shaderBuilder.addFunctionLines(\n    SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX,\n    [returnLine]\n  );\n}\n\nexport default SkinningPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void verticalExaggerationStage(\\n\\\n  inout ProcessedAttributes attributes\\n\\\n) {\\n\\\n  // Compute the distance from the camera to the local center of curvature.\\n\\\n  vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0);\\n\\\n  vec2 vertexAzimuth = normalize(vertexPositionENU.xy);\\n\\\n  // Curvature = 1 / radius of curvature.\\n\\\n  float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature);\\n\\\n  float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight;\\n\\\n\\n\\\n  // Compute the approximate ellipsoid normal at the vertex position.\\n\\\n  // Uses a circular approximation for the Earth curvature along the geodesic.\\n\\\n  vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz;\\n\\\n  vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC;\\n\\\n  vec3 vertexNormal = normalize(centerToVertex);\\n\\\n\\n\\\n  // Estimate the (sine of the) angle between the camera direction and the vertex normal\\n\\\n  float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC);\\n\\\n  float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC);\\n\\\n  float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance);\\n\\\n  bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta;\\n\\\n\\n\\\n  // Approximate the change in height above the ellipsoid, from camera to vertex position.\\n\\\n  float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal);\\n\\\n  float smallAngleVersine = 0.5 * sinTheta * sinTheta;\\n\\\n  float versine = isSmallAngle ? smallAngleVersine : exactVersine;\\n\\\n  float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine;\\n\\\n  float vertexHeight = czm_eyeHeight + dHeight;\\n\\\n\\n\\\n  // Transform the approximate vertex normal to model coordinates.\\n\\\n  vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz;\\n\\\n  vertexNormalMC = normalize(vertexNormalMC);\\n\\\n\\n\\\n  // Compute the exaggeration and apply it along the approximate vertex normal.\\n\\\n  float stretch = u_verticalExaggerationAndRelativeHeight.x;\\n\\\n  float shift = u_verticalExaggerationAndRelativeHeight.y;\\n\\\n  float exaggeration = (vertexHeight - shift) * (stretch - 1.0);\\n\\\n  attributes.positionMC += exaggeration * vertexNormalMC;\\n\\\n}\\n\\\n\";\n", "import Cartesian2 from \"../../Core/Cartesian2.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport VerticalExaggerationStageVS from \"../../Shaders/Model/VerticalExaggerationStageVS.js\";\n\n/**\n * The custom shader pipeline stage takes GLSL callbacks from the\n * {@link CustomShader} and inserts them into the overall shader code for the\n * {@link Model}. The input to the callback is a struct with many\n * properties that depend on the attributes of the primitive. This shader code\n * is automatically generated by this stage.\n *\n * @namespace VerticalExaggerationPipelineStage\n *\n * @private\n */\nconst VerticalExaggerationPipelineStage = {\n  name: \"VerticalExaggerationPipelineStage\", // Helps with debugging\n};\n\nconst scratchExaggerationUniform = new Cartesian2();\n\n/**\n * Add vertical exaggeration to a shader\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {ModelComponents.Primitive} primitive The primitive to be rendered\n * @param {FrameState} frameState The frame state.\n * @private\n */\nVerticalExaggerationPipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  const { shaderBuilder, uniformMap } = renderResources;\n\n  shaderBuilder.addVertexLines(VerticalExaggerationStageVS);\n\n  shaderBuilder.addDefine(\n    \"HAS_VERTICAL_EXAGGERATION\",\n    undefined,\n    ShaderDestination.VERTEX\n  );\n\n  shaderBuilder.addUniform(\n    \"vec2\",\n    \"u_verticalExaggerationAndRelativeHeight\",\n    ShaderDestination.VERTEX\n  );\n\n  uniformMap.u_verticalExaggerationAndRelativeHeight = function () {\n    return Cartesian2.fromElements(\n      frameState.verticalExaggeration,\n      frameState.verticalExaggerationRelativeHeight,\n      scratchExaggerationUniform\n    );\n  };\n};\n\nexport default VerticalExaggerationPipelineStage;\n", "import defined from \"./defined.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\n/**\n * Functions for generating indices for model wireframes. The indices are\n * outputted as typed arrays, which can then be put into buffers for rendering.\n *\n * @namespace WireframeIndexGenerator\n * @private\n */\nconst WireframeIndexGenerator = {};\n\nfunction createWireframeFromTriangles(vertexCount) {\n  const wireframeIndices = IndexDatatype.createTypedArray(\n    vertexCount,\n    vertexCount * 2\n  );\n  const length = vertexCount;\n  let index = 0;\n  for (let i = 0; i < length; i += 3) {\n    wireframeIndices[index++] = i;\n    wireframeIndices[index++] = i + 1;\n    wireframeIndices[index++] = i + 1;\n    wireframeIndices[index++] = i + 2;\n    wireframeIndices[index++] = i + 2;\n    wireframeIndices[index++] = i;\n  }\n\n  return wireframeIndices;\n}\n\nfunction createWireframeFromTriangleIndices(vertexCount, originalIndices) {\n  const originalIndicesCount = originalIndices.length;\n  const wireframeIndices = IndexDatatype.createTypedArray(\n    vertexCount,\n    originalIndicesCount * 2\n  );\n  let index = 0;\n  for (let i = 0; i < originalIndicesCount; i += 3) {\n    const point0 = originalIndices[i];\n    const point1 = originalIndices[i + 1];\n    const point2 = originalIndices[i + 2];\n\n    wireframeIndices[index++] = point0;\n    wireframeIndices[index++] = point1;\n    wireframeIndices[index++] = point1;\n    wireframeIndices[index++] = point2;\n    wireframeIndices[index++] = point2;\n    wireframeIndices[index++] = point0;\n  }\n\n  return wireframeIndices;\n}\n\nfunction createWireframeFromTriangleStrip(vertexCount) {\n  const numberOfTriangles = vertexCount - 2;\n  const wireframeIndicesCount = 2 + numberOfTriangles * 4;\n  const wireframeIndices = IndexDatatype.createTypedArray(\n    vertexCount,\n    wireframeIndicesCount\n  );\n  let index = 0;\n\n  // Handle the first edge\n  wireframeIndices[index++] = 0;\n  wireframeIndices[index++] = 1;\n\n  // Add two edges for every triangle in the strip\n  for (let i = 0; i < numberOfTriangles; i++) {\n    wireframeIndices[index++] = i + 1;\n    wireframeIndices[index++] = i + 2;\n    wireframeIndices[index++] = i + 2;\n    wireframeIndices[index++] = i;\n  }\n\n  return wireframeIndices;\n}\n\nfunction createWireframeFromTriangleStripIndices(vertexCount, originalIndices) {\n  const originalIndicesCount = originalIndices.length;\n  const numberOfTriangles = originalIndicesCount - 2;\n  const wireframeIndicesCount = 2 + numberOfTriangles * 4;\n  const wireframeIndices = IndexDatatype.createTypedArray(\n    vertexCount,\n    wireframeIndicesCount\n  );\n  let index = 0;\n\n  // Handle the first edge\n  wireframeIndices[index++] = originalIndices[0];\n  wireframeIndices[index++] = originalIndices[1];\n\n  // Add two edges for every triangle in the strip\n  for (let i = 0; i < numberOfTriangles; i++) {\n    const point0 = originalIndices[i];\n    const point1 = originalIndices[i + 1];\n    const point2 = originalIndices[i + 2];\n\n    wireframeIndices[index++] = point1;\n    wireframeIndices[index++] = point2;\n    wireframeIndices[index++] = point2;\n    wireframeIndices[index++] = point0;\n  }\n\n  return wireframeIndices;\n}\n\nfunction createWireframeFromTriangleFan(vertexCount) {\n  const numberOfTriangles = vertexCount - 2;\n  const wireframeIndicesCount = 2 + numberOfTriangles * 4;\n  const wireframeIndices = IndexDatatype.createTypedArray(\n    vertexCount,\n    wireframeIndicesCount\n  );\n  let index = 0;\n\n  // Handle the first edge\n  wireframeIndices[index++] = 0;\n  wireframeIndices[index++] = 1;\n\n  // Add two edges for every triangle in the fan\n  for (let i = 0; i < numberOfTriangles; i++) {\n    wireframeIndices[index++] = i + 1;\n    wireframeIndices[index++] = i + 2;\n    wireframeIndices[index++] = i + 2;\n    wireframeIndices[index++] = 0;\n  }\n\n  return wireframeIndices;\n}\n\nfunction createWireframeFromTriangleFanIndices(vertexCount, originalIndices) {\n  const originalIndicesCount = originalIndices.length;\n  const numberOfTriangles = originalIndicesCount - 2;\n  const wireframeIndicesCount = 2 + numberOfTriangles * 4;\n  const wireframeIndices = IndexDatatype.createTypedArray(\n    vertexCount,\n    wireframeIndicesCount\n  );\n  let index = 0;\n\n  // Handle the first edge\n  const firstPoint = originalIndices[0];\n  wireframeIndices[index++] = firstPoint;\n  wireframeIndices[index++] = originalIndices[1];\n\n  // Add two edges for every triangle in the fan\n  for (let i = 0; i < numberOfTriangles; i++) {\n    const point1 = originalIndices[i + 1];\n    const point2 = originalIndices[i + 2];\n\n    wireframeIndices[index++] = point1;\n    wireframeIndices[index++] = point2;\n    wireframeIndices[index++] = point2;\n    wireframeIndices[index++] = firstPoint;\n  }\n\n  return wireframeIndices;\n}\n\n/**\n * Generates a wireframe index buffer for a primitive, either by reindexing the existing indices\n * or creating them from scratch if the model had none.\n *\n * @param {PrimitiveType} primitiveType The primitive type.\n * @param {number} vertexCount The number of vertices in the primitive.\n * @param {Uint8Array|Uint16Array|Uint32Array} [originalIndices] A typed array containing the original indices of the primitive.\n *\n * @return {Uint16Array|Uint32Array} A typed array with the wireframe indices, or undefined if the primitive type does not use triangles.\n *\n * @private\n */\nWireframeIndexGenerator.createWireframeIndices = function (\n  primitiveType,\n  vertexCount,\n  originalIndices\n) {\n  const hasOriginalIndices = defined(originalIndices);\n  if (primitiveType === PrimitiveType.TRIANGLES) {\n    return hasOriginalIndices\n      ? createWireframeFromTriangleIndices(vertexCount, originalIndices)\n      : createWireframeFromTriangles(vertexCount);\n  }\n\n  if (primitiveType === PrimitiveType.TRIANGLE_STRIP) {\n    return hasOriginalIndices\n      ? createWireframeFromTriangleStripIndices(vertexCount, originalIndices)\n      : createWireframeFromTriangleStrip(vertexCount);\n  }\n\n  if (primitiveType === PrimitiveType.TRIANGLE_FAN) {\n    return hasOriginalIndices\n      ? createWireframeFromTriangleFanIndices(vertexCount, originalIndices)\n      : createWireframeFromTriangleFan(vertexCount);\n  }\n\n  return undefined;\n};\n\n/**\n * Gets the number of indices in the wireframe index buffer of a primitive type.\n *\n * @param {PrimitiveType} primitiveType The primitive type.\n * @param {number} originalCount The original number of vertices or indices in the primitive.\n * @return {number} The number of indices in the primitive's wireframe.\n *\n * @private\n */\nWireframeIndexGenerator.getWireframeIndicesCount = function (\n  primitiveType,\n  originalCount\n) {\n  // For TRIANGLES, the wireframe takes every triangle (i.e. three of the original\n  // indices) and turns it into lines. Each triangle has three lines, and each line\n  // requires two indices, so the final count is twice the original.\n  if (primitiveType === PrimitiveType.TRIANGLES) {\n    return originalCount * 2;\n  }\n\n  // For TRIANGLE_STRIP and TRIANGLE_FAN, the number of triangles in the primitive\n  // is equal to the total number of vertices minus two. This is because after the\n  // first edge is specified by the first two indices, every point afterwards\n  // contributes two more edges with two of the previous points, forming a new triangle.\n  // Each of these edges requires two indices, so each triangle in the primitive\n  // results in four indices in addition to the first two.\n  if (\n    primitiveType === PrimitiveType.TRIANGLE_STRIP ||\n    primitiveType === PrimitiveType.TRIANGLE_FAN\n  ) {\n    const numberOfTriangles = originalCount - 2;\n    return 2 + numberOfTriangles * 4;\n  }\n\n  return originalCount;\n};\n\nexport default WireframeIndexGenerator;\n", "import Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\nimport defined from \"../../Core/defined.js\";\nimport IndexDatatype from \"../../Core/IndexDatatype.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport PrimitiveType from \"../../Core/PrimitiveType.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\nimport WireframeIndexGenerator from \"../../Core/WireframeIndexGenerator.js\";\n\n/**\n * The wireframe pipeline stage generates a new index buffer for rendering the\n * structure of the mesh with gl.LINES.\n *\n * @namespace WireframePipelineStage\n * @private\n */\nconst WireframePipelineStage = {\n  name: \"WireframePipelineStage\", // Helps with debugging\n};\n\n/**\n * Process a primitive. This modifies the render resources as follows:\n * <ul>\n *   <li>Adds a define to the fragment shader to prevent extra shading of the lines.</li>\n *   <li>Adds a separate index buffer for wireframe indices</li>\n *   <li>Updates the primitive type and count for rendering with gl.LINES</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this node\n * @param {ModelComponents.primitive} primitive The primitive\n * @param {FrameState} frameState The frame state\n */\nWireframePipelineStage.process = function (\n  renderResources,\n  primitive,\n  frameState\n) {\n  // Applying normal mapping to the lines will result in rendering\n  // errors on Linux. This define is added to disable normal\n  // mapping in the shader.\n  const shaderBuilder = renderResources.shaderBuilder;\n  shaderBuilder.addDefine(\n    \"HAS_WIREFRAME\",\n    undefined,\n    ShaderDestination.FRAGMENT\n  );\n\n  const model = renderResources.model;\n  const wireframeIndexBuffer = createWireframeIndexBuffer(\n    primitive,\n    renderResources.indices,\n    frameState\n  );\n  model._pipelineResources.push(wireframeIndexBuffer);\n  renderResources.wireframeIndexBuffer = wireframeIndexBuffer;\n\n  // We only need to count memory for the generated buffer. In WebGL 1, the CPU\n  // copy of the original indices is already counted in the geometry stage,\n  // and in WebGL 2, the CPU copy of the original indices (generated from the\n  // data of the original buffer) is discarded after generating the wireframe\n  // indices.\n  const hasCpuCopy = false;\n  model.statistics.addBuffer(wireframeIndexBuffer, hasCpuCopy);\n\n  // Update render resources so we render LINES with the correct index count\n  const originalPrimitiveType = renderResources.primitiveType;\n  const originalCount = renderResources.count;\n  renderResources.primitiveType = PrimitiveType.LINES;\n  renderResources.count = WireframeIndexGenerator.getWireframeIndicesCount(\n    originalPrimitiveType,\n    originalCount\n  );\n};\n\nfunction createWireframeIndexBuffer(primitive, indices, frameState) {\n  const positionAttribute = ModelUtility.getAttributeBySemantic(\n    primitive,\n    VertexAttributeSemantic.POSITION\n  );\n  const vertexCount = positionAttribute.count;\n  const webgl2 = frameState.context.webgl2;\n\n  let originalIndices;\n  if (defined(indices)) {\n    const indicesBuffer = indices.buffer;\n    const indicesCount = indices.count;\n    if (defined(indicesBuffer) && webgl2) {\n      const useUint8Array = indicesBuffer.sizeInBytes === indicesCount;\n      originalIndices = useUint8Array\n        ? new Uint8Array(indicesCount)\n        : IndexDatatype.createTypedArray(vertexCount, indicesCount);\n\n      indicesBuffer.getBufferData(originalIndices);\n    } else {\n      originalIndices = indices.typedArray;\n    }\n  }\n\n  const primitiveType = primitive.primitiveType;\n  const wireframeIndices = WireframeIndexGenerator.createWireframeIndices(\n    primitiveType,\n    vertexCount,\n    originalIndices\n  );\n  const indexDatatype = IndexDatatype.fromSizeInBytes(\n    wireframeIndices.BYTES_PER_ELEMENT\n  );\n\n  return Buffer.createIndexBuffer({\n    context: frameState.context,\n    typedArray: wireframeIndices,\n    usage: BufferUsage.STATIC_DRAW,\n    indexDatatype: indexDatatype,\n  });\n}\n\nexport default WireframePipelineStage;\n", "import Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport PrimitiveType from \"../../Core/PrimitiveType.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport AlphaPipelineStage from \"./AlphaPipelineStage.js\";\nimport BatchTexturePipelineStage from \"./BatchTexturePipelineStage.js\";\nimport ClassificationPipelineStage from \"./ClassificationPipelineStage.js\";\nimport CPUStylingPipelineStage from \"./CPUStylingPipelineStage.js\";\nimport CustomShaderMode from \"./CustomShaderMode.js\";\nimport CustomShaderPipelineStage from \"./CustomShaderPipelineStage.js\";\nimport DequantizationPipelineStage from \"./DequantizationPipelineStage.js\";\nimport FeatureIdPipelineStage from \"./FeatureIdPipelineStage.js\";\nimport GeometryPipelineStage from \"./GeometryPipelineStage.js\";\nimport LightingPipelineStage from \"./LightingPipelineStage.js\";\nimport MaterialPipelineStage from \"./MaterialPipelineStage.js\";\nimport MetadataPipelineStage from \"./MetadataPipelineStage.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport MorphTargetsPipelineStage from \"./MorphTargetsPipelineStage.js\";\nimport PickingPipelineStage from \"./PickingPipelineStage.js\";\nimport PointCloudStylingPipelineStage from \"./PointCloudStylingPipelineStage.js\";\nimport PrimitiveOutlinePipelineStage from \"./PrimitiveOutlinePipelineStage.js\";\nimport PrimitiveStatisticsPipelineStage from \"./PrimitiveStatisticsPipelineStage.js\";\nimport SceneMode2DPipelineStage from \"./SceneMode2DPipelineStage.js\";\nimport SelectedFeatureIdPipelineStage from \"./SelectedFeatureIdPipelineStage.js\";\nimport SkinningPipelineStage from \"./SkinningPipelineStage.js\";\nimport VerticalExaggerationPipelineStage from \"./VerticalExaggerationPipelineStage.js\";\nimport WireframePipelineStage from \"./WireframePipelineStage.js\";\n\n/**\n * In memory representation of a single primitive, that is, a primitive\n * and its corresponding mesh.\n *\n * @param {object} options An object containing the following options:\n * @param {ModelComponents.Primitive} options.primitive The primitive component.\n * @param {ModelComponents.Node} options.node The node that this primitive belongs to.\n * @param {Model} options.model The {@link Model} this primitive belongs to.\n *\n * @alias ModelRuntimePrimitive\n * @constructor\n *\n * @private\n */\nfunction ModelRuntimePrimitive(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const primitive = options.primitive;\n  const node = options.node;\n  const model = options.model;\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.primitive\", primitive);\n  Check.typeOf.object(\"options.node\", node);\n  Check.typeOf.object(\"options.model\", model);\n  //>>includeEnd('debug');\n\n  /**\n   * The primitive component associated with this primitive.\n   *\n   * @type {ModelComponents.Primitive}\n   *\n   * @private\n   */\n  this.primitive = primitive;\n\n  /**\n   * A reference to the node this primitive belongs to.\n   *\n   * @type {ModelComponents.Node}\n   *\n   * @private\n   */\n  this.node = node;\n\n  /**\n   * A reference to the model\n   *\n   * @type {Model}\n   *\n   * @private\n   */\n  this.model = model;\n\n  /**\n   * Pipeline stages to apply to this primitive. This\n   * is an array of classes, each with a static method called\n   * <code>process()</code>\n   *\n   * @type {Object[]}\n   * @readonly\n   *\n   * @private\n   */\n  this.pipelineStages = [];\n\n  /**\n   * The generated {@link ModelDrawCommand} or {@link ClassificationModelDrawCommand}\n   * associated with this primitive.\n   *\n   * @type {ModelDrawCommand|ClassificationModelDrawCommand}\n   *\n   * @private\n   */\n  this.drawCommand = undefined;\n\n  /**\n   * The bounding sphere of this primitive in object-space.\n   *\n   * @type {BoundingSphere}\n   *\n   * @private\n   */\n  this.boundingSphere = undefined;\n\n  /**\n   * The bounding sphere of this primitive in 2D world space.\n   *\n   * @type {BoundingSphere}\n   *\n   * @private\n   */\n  this.boundingSphere2D = undefined;\n\n  /**\n   * A buffer containing the primitive's positions projected to 2D world\n   * coordinates. This is generated by SceneMode2DPipelineStage and used for\n   * rendering in 2D / CV mode. The memory is managed by Model; this is just\n   * a reference.\n   *\n   * @type {Buffer}\n   *\n   * @private\n   */\n  this.positionBuffer2D = undefined;\n\n  /**\n   * An array containing the lengths of the vertex batches for classification.\n   * Vertices with the same feature ID are batched together, and each batch is\n   * drawn with a different draw command in order to properly classify other\n   * assets.\n   * <p>\n   * This is generated by ClassificationPipelineStage. The memory is managed by\n   * Model; this is just a reference.\n   * </p>\n   *\n   * @type {number[]}\n   *\n   * @private\n   */\n  this.batchLengths = undefined;\n\n  /**\n   * An array containing the offsets of the vertex batches for classification.\n   * Vertices with the same feature ID are batched together, and each batch is\n   * drawn with a different draw command in order to properly classify other\n   * assets.\n   * <p>\n   * This is generated by ClassificationPipelineStage. The memory is managed by\n   * Model; this is just a reference.\n   * </p>\n   *\n   * @type {number[]}\n   *\n   * @private\n   */\n  this.batchOffsets = undefined;\n\n  /**\n   * Update stages to apply to this primitive.\n   *\n   * @type {Object[]}\n   * @readonly\n   *\n   * @private\n   */\n  this.updateStages = [];\n}\n\n/**\n * Configure the primitive pipeline stages. If the pipeline needs to be re-run,\n * call this method again to ensure the correct sequence of pipeline stages are\n * used.\n *\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nModelRuntimePrimitive.prototype.configurePipeline = function (frameState) {\n  const pipelineStages = this.pipelineStages;\n  pipelineStages.length = 0;\n\n  const primitive = this.primitive;\n  const node = this.node;\n  const model = this.model;\n\n  const customShader = model.customShader;\n  const style = model.style;\n\n  const useWebgl2 = frameState.context.webgl2;\n  const mode = frameState.mode;\n  const use2D =\n    mode !== SceneMode.SCENE3D && !frameState.scene3DOnly && model._projectTo2D;\n  const exaggerateTerrain = frameState.verticalExaggeration !== 1.0;\n\n  const hasMorphTargets =\n    defined(primitive.morphTargets) && primitive.morphTargets.length > 0;\n  const hasSkinning = defined(node.skin);\n  const hasCustomShader = defined(customShader);\n  const hasCustomFragmentShader =\n    hasCustomShader && defined(customShader.fragmentShaderText);\n  const materialsEnabled =\n    !hasCustomFragmentShader ||\n    customShader.mode !== CustomShaderMode.REPLACE_MATERIAL;\n  const hasQuantization = ModelUtility.hasQuantizedAttributes(\n    primitive.attributes\n  );\n  const generateWireframeIndices =\n    model.debugWireframe &&\n    PrimitiveType.isTriangles(primitive.primitiveType) &&\n    // Generating index buffers for wireframes is always possible in WebGL2.\n    // However, this will only work in WebGL1 if the model was constructed with\n    // enableDebugWireframe set to true.\n    (model._enableDebugWireframe || useWebgl2);\n\n  const pointCloudShading = model.pointCloudShading;\n  const hasAttenuation =\n    defined(pointCloudShading) && pointCloudShading.attenuation;\n  const hasPointCloudBackFaceCulling =\n    defined(pointCloudShading) && pointCloudShading.backFaceCulling;\n  const hasPointCloudStyle =\n    primitive.primitiveType === PrimitiveType.POINTS &&\n    (defined(style) || hasAttenuation || hasPointCloudBackFaceCulling);\n\n  const hasOutlines =\n    model._enableShowOutline && defined(primitive.outlineCoordinates);\n\n  const featureIdFlags = inspectFeatureIds(model, node, primitive);\n\n  const hasClassification = defined(model.classificationType);\n\n  // Start of pipeline -----------------------------------------------------\n  if (use2D) {\n    pipelineStages.push(SceneMode2DPipelineStage);\n  }\n\n  pipelineStages.push(GeometryPipelineStage);\n\n  if (generateWireframeIndices) {\n    pipelineStages.push(WireframePipelineStage);\n  }\n\n  if (hasClassification) {\n    pipelineStages.push(ClassificationPipelineStage);\n  }\n\n  if (hasMorphTargets) {\n    pipelineStages.push(MorphTargetsPipelineStage);\n  }\n\n  if (hasSkinning) {\n    pipelineStages.push(SkinningPipelineStage);\n  }\n\n  if (hasPointCloudStyle) {\n    pipelineStages.push(PointCloudStylingPipelineStage);\n  }\n\n  if (hasQuantization) {\n    pipelineStages.push(DequantizationPipelineStage);\n  }\n\n  if (materialsEnabled) {\n    pipelineStages.push(MaterialPipelineStage);\n  }\n\n  // These stages are always run to ensure structs\n  // are declared to avoid compilation errors.\n  pipelineStages.push(FeatureIdPipelineStage);\n  pipelineStages.push(MetadataPipelineStage);\n\n  if (featureIdFlags.hasPropertyTable) {\n    pipelineStages.push(SelectedFeatureIdPipelineStage);\n    pipelineStages.push(BatchTexturePipelineStage);\n    pipelineStages.push(CPUStylingPipelineStage);\n  }\n\n  if (exaggerateTerrain) {\n    pipelineStages.push(VerticalExaggerationPipelineStage);\n  }\n\n  if (hasCustomShader) {\n    pipelineStages.push(CustomShaderPipelineStage);\n  }\n\n  pipelineStages.push(LightingPipelineStage);\n\n  if (model.allowPicking) {\n    pipelineStages.push(PickingPipelineStage);\n  }\n\n  if (hasOutlines) {\n    pipelineStages.push(PrimitiveOutlinePipelineStage);\n  }\n\n  pipelineStages.push(AlphaPipelineStage);\n\n  pipelineStages.push(PrimitiveStatisticsPipelineStage);\n\n  return;\n};\n\nfunction inspectFeatureIds(model, node, primitive) {\n  let featureIds;\n  // Check instances first, as this is the most specific type of\n  // feature ID\n  if (defined(node.instances)) {\n    featureIds = ModelUtility.getFeatureIdsByLabel(\n      node.instances.featureIds,\n      model.instanceFeatureIdLabel\n    );\n\n    if (defined(featureIds)) {\n      return {\n        hasFeatureIds: true,\n        hasPropertyTable: defined(featureIds.propertyTableId),\n      };\n    }\n  }\n\n  featureIds = ModelUtility.getFeatureIdsByLabel(\n    primitive.featureIds,\n    model.featureIdLabel\n  );\n  if (defined(featureIds)) {\n    return {\n      hasFeatureIds: true,\n      hasPropertyTable: defined(featureIds.propertyTableId),\n    };\n  }\n\n  return {\n    hasFeatureIds: false,\n    hasPropertyTable: false,\n  };\n}\n\nexport default ModelRuntimePrimitive;\n", "import Matrix4 from \"../../Core/Matrix4.js\";\nimport Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\n\n/**\n * An in-memory representation of a skin that affects nodes in the {@link ModelSceneGraph}.\n * Skins should only be initialized after all of the {@link ModelRuntimeNode}s have been instantiated\n * by the scene graph.\n *\n * @param {object} options An object containing the following options:\n * @param {ModelComponents.Skin} options.skin The corresponding skin components from the 3D model\n * @param {ModelSceneGraph} options.sceneGraph The scene graph this skin belongs to.\n *\n * @alias ModelSkin\n * @constructor\n *\n * @private\n */\nfunction ModelSkin(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.skin\", options.skin);\n  Check.typeOf.object(\"options.sceneGraph\", options.sceneGraph);\n  //>>includeEnd('debug');\n\n  this._sceneGraph = options.sceneGraph;\n  const skin = options.skin;\n\n  this._skin = skin;\n\n  this._inverseBindMatrices = undefined;\n  this._joints = [];\n  this._jointMatrices = [];\n\n  initialize(this);\n}\n\nObject.defineProperties(ModelSkin.prototype, {\n  /**\n   * The internal skin this runtime skin represents.\n   *\n   * @memberof ModelSkin.prototype\n   * @type {ModelComponents.Skin}\n   * @readonly\n   *\n   * @private\n   */\n  skin: {\n    get: function () {\n      return this._skin;\n    },\n  },\n\n  /**\n   * The scene graph this skin belongs to.\n   *\n   * @memberof ModelSkin.prototype\n   * @type {ModelSceneGraph}\n   * @readonly\n   *\n   * @private\n   */\n  sceneGraph: {\n    get: function () {\n      return this._sceneGraph;\n    },\n  },\n\n  /**\n   * The inverse bind matrices of the skin.\n   *\n   * @memberof ModelSkin.prototype\n   * @type {Matrix4[]}\n   * @readonly\n   *\n   * @private\n   */\n  inverseBindMatrices: {\n    get: function () {\n      return this._inverseBindMatrices;\n    },\n  },\n\n  /**\n   * The joints of the skin.\n   *\n   * @memberof ModelSkin.prototype\n   * @type {ModelRuntimeNode[]}\n   * @readonly\n   *\n   * @private\n   */\n  joints: {\n    get: function () {\n      return this._joints;\n    },\n  },\n\n  /**\n   * The joint matrices for the skin, where each joint matrix is computed as\n   * jointMatrix = jointWorldTransform * inverseBindMatrix.\n   *\n   * Each node that references this skin is responsible for pre-multiplying its inverse\n   * world transform to the joint matrices for its own use.\n   *\n   * @memberof ModelSkin.prototype\n   * @type {Matrix4[]}\n   * @readonly\n   *\n   * @private\n   */\n  jointMatrices: {\n    get: function () {\n      return this._jointMatrices;\n    },\n  },\n});\n\nfunction initialize(runtimeSkin) {\n  const skin = runtimeSkin.skin;\n  const inverseBindMatrices = skin.inverseBindMatrices;\n  runtimeSkin._inverseBindMatrices = inverseBindMatrices;\n\n  const joints = skin.joints;\n  const length = joints.length;\n\n  const runtimeNodes = runtimeSkin.sceneGraph._runtimeNodes;\n  const runtimeJoints = runtimeSkin.joints;\n  const runtimeJointMatrices = runtimeSkin._jointMatrices;\n  for (let i = 0; i < length; i++) {\n    const jointIndex = joints[i].index;\n    const runtimeNode = runtimeNodes[jointIndex];\n    runtimeJoints.push(runtimeNode);\n\n    const inverseBindMatrix = inverseBindMatrices[i];\n    const jointMatrix = computeJointMatrix(\n      runtimeNode,\n      inverseBindMatrix,\n      new Matrix4()\n    );\n    runtimeJointMatrices.push(jointMatrix);\n  }\n}\n\nfunction computeJointMatrix(joint, inverseBindMatrix, result) {\n  const jointWorldTransform = Matrix4.multiplyTransformation(\n    joint.transformToRoot,\n    joint.transform,\n    result\n  );\n\n  result = Matrix4.multiplyTransformation(\n    jointWorldTransform,\n    inverseBindMatrix,\n    result\n  );\n\n  return result;\n}\n\n/**\n * Updates the joint matrices for the skin.\n *\n * @private\n */\nModelSkin.prototype.updateJointMatrices = function () {\n  const jointMatrices = this._jointMatrices;\n  const length = jointMatrices.length;\n  for (let i = 0; i < length; i++) {\n    const joint = this.joints[i];\n    const inverseBindMatrix = this.inverseBindMatrices[i];\n    jointMatrices[i] = computeJointMatrix(\n      joint,\n      inverseBindMatrix,\n      jointMatrices[i]\n    );\n  }\n};\n\nexport default ModelSkin;\n", "/**\n * Options for configuring the {@link AlphaPipelineStage}\n *\n * @alias ModelAlphaOptions\n * @constructor\n *\n * @private\n */\nfunction ModelAlphaOptions() {\n  /**\n   * Which render pass will render the model.\n   *\n   * @type {Pass}\n   * @private\n   */\n  this.pass = undefined;\n  /**\n   * Determines the alpha threshold below which fragments are discarded\n   *\n   * @type {number}\n   * @private\n   */\n  this.alphaCutoff = undefined;\n}\n\nexport default ModelAlphaOptions;\n", "import Check from \"../../Core/Check.js\";\nimport ModelAlphaOptions from \"./ModelAlphaOptions.js\";\nimport RenderState from \"../../Renderer/RenderState.js\";\nimport ShaderBuilder from \"../../Renderer/ShaderBuilder.js\";\nimport DepthFunction from \"../DepthFunction.js\";\n\n/**\n * Model render resources are for setting details that are consistent across\n * the entire model.\n *\n * @constructor\n * @param {Model} model The model that will be rendered\n *\n * @private\n */\nfunction ModelRenderResources(model) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"model\", model);\n  //>>includeEnd('debug');\n\n  /**\n   * An object used to build a shader incrementally. Each pipeline stage\n   * may add lines of shader code to this object.\n   *\n   * @type {ShaderBuilder}\n   * @readonly\n   *\n   * @private\n   */\n  this.shaderBuilder = new ShaderBuilder();\n\n  /**\n   * A reference to the model.\n   *\n   * @type {Model}\n   * @readonly\n   *\n   * @private\n   */\n  this.model = model;\n\n  /**\n   * A dictionary mapping uniform name to functions that return the uniform\n   * values.\n   *\n   * @type {Object<string, Function>}\n   * @readonly\n   *\n   * @private\n   */\n  this.uniformMap = {};\n\n  /**\n   * Options for configuring the alpha stage such as pass and alpha cutoff.\n   *\n   * @type {ModelAlphaOptions}\n   * @readonly\n   *\n   * @private\n   */\n  this.alphaOptions = new ModelAlphaOptions();\n\n  /**\n   * An object storing options for creating a {@link RenderState}.\n   * The pipeline stages simply set the options, the render state is created\n   * when the {@link DrawCommand} is constructed.\n   *\n   * @type {object}\n   * @readonly\n   *\n   * @private\n   */\n  this.renderStateOptions = RenderState.getState(\n    RenderState.fromCache({\n      depthTest: {\n        enabled: true,\n        func: DepthFunction.LESS_OR_EQUAL,\n      },\n    })\n  );\n\n  /**\n   * Whether the model has a silhouette. This value indicates what draw commands\n   * are needed and is set by ModelSilhouettePipelineStage.\n   *\n   * @type {boolean}\n   * @default false\n   *\n   * @private\n   */\n  this.hasSilhouette = false;\n\n  /**\n   * Whether the model is part of a tileset that uses the skipLevelOfDetail\n   * optimization. This value indicates what draw commands are needed and\n   * is set by TilesetPipelineStage.\n   *\n   * @type {boolean}\n   * @default false\n   *\n   * @private\n   */\n  this.hasSkipLevelOfDetail = false;\n}\n\nexport default ModelRenderResources;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void silhouetteStage(inout vec4 color) {\\n\\\n    if(model_silhouettePass) {\\n\\\n        color = czm_gammaCorrect(model_silhouetteColor);\\n\\\n    }\\n\\\n}\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) {\\n\\\n     #ifdef HAS_NORMALS\\n\\\n     if(model_silhouettePass) {\\n\\\n          vec3 normal = normalize(czm_normal3D * attributes.normalMC);\\n\\\n          normal.x *= czm_projection[0][0];\\n\\\n          normal.y *= czm_projection[1][1];\\n\\\n          positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z;\\n\\\n    }\\n\\\n    #endif\\n\\\n}\\n\\\n\";\n", "import combine from \"../../Core/combine.js\";\nimport defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport ModelSilhouetteStageFS from \"../../Shaders/Model/ModelSilhouetteStageFS.js\";\nimport ModelSilhouetteStageVS from \"../../Shaders/Model/ModelSilhouetteStageVS.js\";\n\n/**\n * The model silhouette pipeline stage is responsible applying silhouettes to the model.\n *\n * @namespace ModelSilhouettePipelineStage\n *\n * @private\n */\nconst ModelSilhouettePipelineStage = {\n  name: \"ModelSilhouettePipelineStage\", // Helps with debugging\n};\n\n/**\n * Tracks how many silhouettes have been created. This value is used to\n * assign a reference number to the stencil.\n *\n * @type {number}\n * @private\n */\nModelSilhouettePipelineStage.silhouettesLength = 0;\n\n/**\n * Process a model. This modifies the following parts of the render resources:\n *\n * <ul>\n *  <li>defines the silhouette ID for the model, if it doesn't yet exist\n *  <li>adds a define to the shaders to indicate that the model uses silhouettes</li>\n *  <li>adds a function to the vertex shader to create the silhouette around the model</li>\n *  <li>adds a function to the fragment shader to apply color to the silhouette</li>\n *  <li>adds the uniforms to the shaders for the corresponding silhouette properties</li>\n *  <li>adds a uniform to distinguish which draw command is used to render the silhouette</li>\n *  <li>sets a variable in the render resources denoting whether the model has a silhouette</li>\n * </ul>\n *\n * <p>\n * Note that the model must have a normal attribute in order to use silhouettes. The flag for this is\n * added to the shader in GeometryPipelineStage.\n * </p>\n *\n * @param {ModelRenderResources} renderResources The render resources for this model.\n * @param {Model} model The model.\n * @param {FrameState} frameState The frameState.\n *\n * @private\n */\nModelSilhouettePipelineStage.process = function (\n  renderResources,\n  model,\n  frameState\n) {\n  if (!defined(model._silhouetteId)) {\n    model._silhouetteId = ++ModelSilhouettePipelineStage.silhouettesLength;\n  }\n\n  const shaderBuilder = renderResources.shaderBuilder;\n  shaderBuilder.addDefine(\"HAS_SILHOUETTE\", undefined, ShaderDestination.BOTH);\n\n  shaderBuilder.addVertexLines(ModelSilhouetteStageVS);\n  shaderBuilder.addFragmentLines(ModelSilhouetteStageFS);\n\n  shaderBuilder.addUniform(\n    \"vec4\",\n    \"model_silhouetteColor\",\n    ShaderDestination.FRAGMENT\n  );\n\n  shaderBuilder.addUniform(\n    \"float\",\n    \"model_silhouetteSize\",\n    ShaderDestination.VERTEX\n  );\n\n  // Rendering silhouettes requires two draw commands:\n  // - First, the model is rendered as normal, writing to the stencil buffer.\n  // - Second, the silhouette is drawn, and the stencil buffer is used to cutout\n  //   the part that overlaps the regular model.\n  //\n  // To avoid creating a second shader program to handle silhouettes, a uniform\n  // is used to distinguish between the two draw commands. The second command will set\n  // this uniform true, such that only it applies the silhouette stage.\n  shaderBuilder.addUniform(\n    \"bool\",\n    \"model_silhouettePass\",\n    ShaderDestination.BOTH\n  );\n\n  const uniformMap = {\n    model_silhouetteColor: function () {\n      return model.silhouetteColor;\n    },\n    model_silhouetteSize: function () {\n      return model.silhouetteSize;\n    },\n    model_silhouettePass: function () {\n      // This will be set to true by the draw command that draws the silhouette.\n      return false;\n    },\n  };\n\n  renderResources.uniformMap = combine(uniformMap, renderResources.uniformMap);\n  renderResources.hasSilhouette = true;\n};\n\nexport default ModelSilhouettePipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void modelSplitterStage()\\n\\\n{\\n\\\n    // Don't split when rendering the shadow map, because it is rendered from\\n\\\n    // the perspective of a totally different camera.\\n\\\n#ifndef SHADOW_MAP\\n\\\n    if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;\\n\\\n    if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "import combine from \"../../Core/combine.js\";\nimport ModelSplitterStageFS from \"../../Shaders/Model/ModelSplitterStageFS.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\n\n/**\n * The model splitting pipeline stage is responsible for discarding fragments on the wrong side of the splitter.\n *\n * @namespace ModelSplitterPipelineStage\n *\n * @private\n */\nconst ModelSplitterPipelineStage = {\n  name: \"ModelSplitterPipelineStage\", // Helps with debugging\n\n  SPLIT_DIRECTION_UNIFORM_NAME: \"model_splitDirection\",\n};\n\n/**\n * Process a model. This modifies the following parts of the render resources:\n *\n * <ul>\n *  <li>adds a define to the fragment shader to indicate that the model is split</li>\n *  <li>adds a function to the fragment shader to discard the fragment if it's on the wrong side of the splitter.</li>\n *  <li>adds a uniform indicating the \"splitDirection\" (side of the screen on which to show the model)\n *</ul>\n *\n * @param {ModelRenderResources} renderResources The render resources for this model.\n * @param {Model} model The model.\n * @param {FrameState} frameState The frameState.\n *\n * @private\n */\nModelSplitterPipelineStage.process = function (\n  renderResources,\n  model,\n  frameState\n) {\n  const shaderBuilder = renderResources.shaderBuilder;\n\n  shaderBuilder.addDefine(\n    \"HAS_MODEL_SPLITTER\",\n    undefined,\n    ShaderDestination.FRAGMENT\n  );\n  shaderBuilder.addFragmentLines(ModelSplitterStageFS);\n\n  const stageUniforms = {};\n\n  shaderBuilder.addUniform(\n    \"float\",\n    ModelSplitterPipelineStage.SPLIT_DIRECTION_UNIFORM_NAME,\n    ShaderDestination.FRAGMENT\n  );\n  stageUniforms[\n    ModelSplitterPipelineStage.SPLIT_DIRECTION_UNIFORM_NAME\n  ] = function () {\n    return model.splitDirection;\n  };\n\n  renderResources.uniformMap = combine(\n    stageUniforms,\n    renderResources.uniformMap\n  );\n};\n\nexport default ModelSplitterPipelineStage;\n", "import Check from \"../../Core/Check.js\";\nimport clone from \"../../Core/clone.js\";\n\n/**\n * A model is made up of one or more nodes in the scene graph. Some details\n * such as instancing are computed on a per-node basis. This class provides\n * a place to store such details. It also inherits some properties from\n * the model render resources.\n *\n * @constructor\n *\n * @param {ModelRenderResources} modelRenderResources The model resources to inherit\n * @param {ModelRuntimeNode} runtimeNode The in-memory representation of the scene graph node.\n *\n * @private\n */\nfunction NodeRenderResources(modelRenderResources, runtimeNode) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"modelRenderResources\", modelRenderResources);\n  Check.typeOf.object(\"runtimeNode\", runtimeNode);\n  //>>includeEnd('debug');\n\n  // Properties inherited from the ModelRenderResources.\n  /**\n   * A reference to the model. Inherited from the model render resources.\n   *\n   * @type {Model}\n   * @readonly\n   *\n   * @private\n   */\n  this.model = modelRenderResources.model;\n  /**\n   * An object used to build a shader incrementally. This is cloned from the\n   * model render resources because each node can compute a different shader.\n   *\n   * @type {ShaderBuilder}\n   * @readonly\n   *\n   * @private\n   */\n  this.shaderBuilder = modelRenderResources.shaderBuilder.clone();\n\n  /**\n   * A dictionary mapping uniform name to functions that return the uniform\n   * values. Inherited from the model render resources.\n   *\n   * @type {Object<string, Function>}\n   * @readonly\n   *\n   * @private\n   */\n  this.uniformMap = clone(modelRenderResources.uniformMap);\n\n  /**\n   * Options for configuring the alpha stage such as pass and alpha cutoff.\n   * Inherited from the model render resources.\n   *\n   * @type {ModelAlphaOptions}\n   * @readonly\n   *\n   * @private\n   */\n  this.alphaOptions = clone(modelRenderResources.alphaOptions);\n\n  /**\n   * An object storing options for creating a {@link RenderState}.\n   * The pipeline stages simply set the options, the render state is created\n   * when the {@link DrawCommand} is constructed. Inherited from the model\n   * render resources.\n   *\n   * @type {object}\n   * @readonly\n   *\n   * @private\n   */\n  this.renderStateOptions = clone(\n    modelRenderResources.renderStateOptions,\n    true\n  );\n\n  /**\n   * Whether the model has a silhouette. This value indicates what draw commands\n   * are needed. Inherited from the model render resources.\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  this.hasSilhouette = modelRenderResources.hasSilhouette;\n\n  /**\n   * Whether the model is part of a tileset that uses the skipLevelOfDetail\n   * optimization. This value indicates what draw commands are needed.\n   * Inherited from the model render resources.\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  this.hasSkipLevelOfDetail = modelRenderResources.hasSkipLevelOfDetail;\n\n  // Other properties.\n  /**\n   * A reference to the runtime node\n   *\n   * @type {ModelRuntimeNode}\n   * @readonly\n   *\n   * @private\n   */\n  this.runtimeNode = runtimeNode;\n\n  /**\n   * An array of objects describing vertex attributes that will eventually\n   * be used to create a {@link VertexArray} for the draw command. Attributes\n   * at the node level may be needed for extensions such as EXT_mesh_gpu_instancing.\n   *\n   * @type {Object[]}\n   * @readonly\n   *\n   * @private\n   */\n  this.attributes = [];\n\n  /**\n   * The index to give to the next vertex attribute added to the attributes array.\n   * POSITION takes index 0.\n   *\n   * @type {number}\n   *\n   * @private\n   */\n  this.attributeIndex = 1;\n\n  /**\n   * The set index to assign to feature ID vertex attribute(s) created from the\n   * offset/repeat in the feature ID attribute.\n   *\n   * @type {number}\n   * @default 0\n   *\n   * @private\n   */\n  this.featureIdVertexAttributeSetIndex = 0;\n\n  /**\n   * The number of instances. This value is set by InstancingPipelineStage.\n   *\n   * @type {number}\n   * @default 0\n   *\n   * @private\n   */\n  this.instanceCount = 0;\n}\n\nexport default NodeRenderResources;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport LightingModel from \"./LightingModel.js\";\n\n/**\n * Options for configuring the {@link LightingPipelineStage}\n *\n * @param {object} options An object containing the following options\n * @param {LightingModel} [options.lightingModel=LightingModel.UNLIT] The lighting model to use\n *\n * @alias ModelLightingOptions\n * @constructor\n *\n * @private\n */\nfunction ModelLightingOptions(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * The lighting model to use, such as UNLIT or PBR. This is determined by\n   * the primitive's material.\n   *\n   * @type {LightingModel}\n   *\n   * @private\n   */\n  this.lightingModel = defaultValue(options.lightingModel, LightingModel.UNLIT);\n}\n\nexport default ModelLightingOptions;\n", "import BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Check from \"../../Core/Check.js\";\nimport clone from \"../../Core/clone.js\";\nimport defined from \"../../Core/defined.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport ModelLightingOptions from \"./ModelLightingOptions.js\";\n\n/**\n * Each node may have many mesh primitives. Most model pipeline stages operate\n * at the primitive level. Again, properties are inherited from the parent.\n *\n * @param {NodeRenderResources} nodeRenderResources The node resources to inherit from\n * @param {ModelRuntimePrimitive} runtimePrimitive The primitive.\n *\n * @private\n */\nfunction PrimitiveRenderResources(nodeRenderResources, runtimePrimitive) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"nodeRenderResources\", nodeRenderResources);\n  Check.typeOf.object(\"runtimePrimitive\", runtimePrimitive);\n  //>>includeEnd('debug');\n\n  // Properties inherited from NodeRenderResources.\n  /**\n   * A reference to the model. Inherited from the node render resources.\n   *\n   * @type {Model}\n   * @readonly\n   *\n   * @private\n   */\n  this.model = nodeRenderResources.model;\n\n  /**\n   * A reference to the runtime node. Inherited from the node render resources.\n   *\n   * @type {ModelRuntimeNode}\n   * @readonly\n   *\n   * @private\n   */\n  this.runtimeNode = nodeRenderResources.runtimeNode;\n\n  /**\n   * The vertex attributes. This is shallow cloned from the node render\n   * resources as the primitive will add additional properties.\n   *\n   * @type {Object[]}\n   * @readonly\n   *\n   * @private\n   */\n  this.attributes = nodeRenderResources.attributes.slice();\n\n  /**\n   * The index to give to the next vertex attribute added to the attributes\n   * array. POSITION takes index 0. Inherited from the node render resources.\n   *\n   * @type {number}\n   *\n   * @private\n   */\n  this.attributeIndex = nodeRenderResources.attributeIndex;\n\n  /**\n   * The set index to assign to feature ID vertex attribute(s) created from the\n   * offset/repeat in the feature ID attribute. Inherited from the node render\n   * resources.\n   *\n   * @type {number}\n   *\n   * @private\n   */\n  this.featureIdVertexAttributeSetIndex =\n    nodeRenderResources.featureIdVertexAttributeSetIndex;\n\n  /**\n   * A dictionary mapping uniform name to functions that return the uniform\n   * values. Inherited from the node render resources.\n   *\n   * @type {Object<string, Function>}\n   * @readonly\n   *\n   * @private\n   */\n  this.uniformMap = clone(nodeRenderResources.uniformMap);\n\n  /**\n   * Options for configuring the alpha stage such as pass and alpha cutoff.\n   * Inherited from the node render resources.\n   *\n   * @type {ModelAlphaOptions}\n   * @readonly\n   *\n   * @private\n   */\n  this.alphaOptions = clone(nodeRenderResources.alphaOptions);\n\n  /**\n   * An object storing options for creating a {@link RenderState}.\n   * The pipeline stages simply set the options; the actual render state\n   * is created when the {@link DrawCommand} is constructed. Inherited from\n   * the node render resources.\n   *\n   * @type {object}\n   * @readonly\n   *\n   * @private\n   */\n  this.renderStateOptions = clone(nodeRenderResources.renderStateOptions, true);\n\n  /**\n   * Whether the model has a silhouette. This value indicates what draw commands\n   * are needed. Inherited from the node render resources.\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  this.hasSilhouette = nodeRenderResources.hasSilhouette;\n\n  /**\n   * Whether the model is part of a tileset that uses the skipLevelOfDetail\n   * optimization. This value indicates what draw commands are needed.\n   * Inherited from the node render resources.\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  this.hasSkipLevelOfDetail = nodeRenderResources.hasSkipLevelOfDetail;\n\n  /**\n   * An object used to build a shader incrementally. This is cloned from the\n   * node render resources because each primitive can compute a different shader.\n   *\n   * @type {ShaderBuilder}\n   * @readonly\n   *\n   * @private\n   */\n  this.shaderBuilder = nodeRenderResources.shaderBuilder.clone();\n\n  /**\n   * The number of instances. Default is 0, if instancing is not used.\n   * Inherited from the node render resources.\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  this.instanceCount = nodeRenderResources.instanceCount;\n\n  // Other properties\n  /**\n   * A reference to the runtime primitive.\n   *\n   * @type {ModelRuntimePrimitive}\n   * @readonly\n   *\n   * @private\n   */\n  this.runtimePrimitive = runtimePrimitive;\n\n  /**\n   * The primitive associated with the render resources.\n   *\n   * @type {ModelComponents.Primitive}\n   * @readonly\n   *\n   * @private\n   */\n  const primitive = runtimePrimitive.primitive;\n\n  /**\n   * The number of indices in the primitive. The interpretation of this\n   * depends on the primitive type.\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  this.count = defined(primitive.indices)\n    ? primitive.indices.count\n    : ModelUtility.getAttributeBySemantic(primitive, \"POSITION\").count;\n\n  /**\n   * Whether or not this primitive has a property table for storing metadata.\n   * When present, picking and styling can use this. This value is set by\n   * SelectedFeatureIdPipelineStage.\n   *\n   * @type {boolean}\n   * @default false\n   *\n   * @private\n   */\n  this.hasPropertyTable = false;\n\n  /**\n   * The indices for this primitive.\n   *\n   * @type {ModelComponents.Indices}\n   * @readonly\n   *\n   * @private\n   */\n  this.indices = primitive.indices;\n\n  /**\n   * Additional index buffer for wireframe mode (if enabled). This value is set\n   * by WireframePipelineStage.\n   *\n   * @type {Buffer}\n   * @readonly\n   *\n   * @private\n   */\n  this.wireframeIndexBuffer = undefined;\n\n  /**\n   * The primitive type such as TRIANGLES or POINTS.\n   *\n   * @type {PrimitiveType}\n   * @readonly\n   *\n   * @private\n   */\n  this.primitiveType = primitive.primitiveType;\n\n  const positionMinMax = ModelUtility.getPositionMinMax(\n    primitive,\n    this.runtimeNode.instancingTranslationMin,\n    this.runtimeNode.instancingTranslationMax\n  );\n\n  /**\n   * The minimum position value for this primitive.\n   *\n   * @type {Cartesian3}\n   * @readonly\n   *\n   * @private\n   */\n  this.positionMin = Cartesian3.clone(positionMinMax.min, new Cartesian3());\n\n  /**\n   * The maximum position value for this primitive.\n   *\n   * @type {Cartesian3}\n   * @readonly\n   *\n   * @private\n   */\n  this.positionMax = Cartesian3.clone(positionMinMax.max, new Cartesian3());\n\n  /**\n   * The bounding sphere that contains all the vertices in this primitive.\n   *\n   * @type {BoundingSphere}\n   * @readonly\n   *\n   * @private\n   */\n  this.boundingSphere = BoundingSphere.fromCornerPoints(\n    this.positionMin,\n    this.positionMax,\n    new BoundingSphere()\n  );\n\n  /**\n   * Options for configuring the lighting stage, such as selecting between\n   * unlit and PBR shading.\n   *\n   * @type {ModelLightingOptions}\n   * @readonly\n   *\n   * @private\n   */\n  this.lightingOptions = new ModelLightingOptions();\n\n  /**\n   * The shader variable to use for picking. If picking is enabled, this value\n   * is set by PickingPipelineStage.\n   *\n   * @type {string}\n   *\n   * @private\n   */\n  this.pickId = undefined;\n}\n\nexport default PrimitiveRenderResources;\n", "import BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport Transforms from \"../../Core/Transforms.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport SplitDirection from \"../SplitDirection.js\";\nimport buildDrawCommand from \"./buildDrawCommand.js\";\nimport TilesetPipelineStage from \"./TilesetPipelineStage.js\";\nimport ImageBasedLightingPipelineStage from \"./ImageBasedLightingPipelineStage.js\";\nimport ModelArticulation from \"./ModelArticulation.js\";\nimport ModelColorPipelineStage from \"./ModelColorPipelineStage.js\";\nimport ModelClippingPlanesPipelineStage from \"./ModelClippingPlanesPipelineStage.js\";\nimport ModelNode from \"./ModelNode.js\";\nimport ModelRuntimeNode from \"./ModelRuntimeNode.js\";\nimport ModelRuntimePrimitive from \"./ModelRuntimePrimitive.js\";\nimport ModelSkin from \"./ModelSkin.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport ModelRenderResources from \"./ModelRenderResources.js\";\nimport ModelSilhouettePipelineStage from \"./ModelSilhouettePipelineStage.js\";\nimport ModelSplitterPipelineStage from \"./ModelSplitterPipelineStage.js\";\nimport ModelType from \"./ModelType.js\";\nimport NodeRenderResources from \"./NodeRenderResources.js\";\nimport PrimitiveRenderResources from \"./PrimitiveRenderResources.js\";\n\n/**\n * An in memory representation of the scene graph for a {@link Model}\n *\n * @param {object} options An object containing the following options\n * @param {Model} options.model The model this scene graph belongs to\n * @param {ModelComponents} options.modelComponents The model components describing the model\n *\n * @alias ModelSceneGraph\n * @constructor\n *\n * @private\n */\nfunction ModelSceneGraph(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const components = options.modelComponents;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.model\", options.model);\n  Check.typeOf.object(\"options.modelComponents\", components);\n  //>>includeEnd('debug');\n\n  /**\n   * A reference to the {@link Model} that owns this scene graph.\n   *\n   * @type {Model}\n   * @readonly\n   *\n   * @private\n   */\n  this._model = options.model;\n\n  /**\n   * The model components that represent the contents of the 3D model file.\n   *\n   * @type {ModelComponents}\n   * @readonly\n   *\n   * @private\n   */\n  this._components = components;\n\n  /**\n   * Pipeline stages to apply across the model.\n   *\n   * @type {Object[]}\n   * @readonly\n   *\n   * @private\n   */\n  this._pipelineStages = [];\n\n  /**\n   * Update stages to apply across the model.\n   *\n   * @type {Object[]}\n   * @readonly\n   *\n   * @private\n   */\n  this._updateStages = [];\n\n  /**\n   * The runtime nodes that make up the scene graph\n   *\n   * @type {ModelRuntimeNode[]}\n   * @readonly\n   *\n   * @private\n   */\n  this._runtimeNodes = [];\n\n  /**\n   * The indices of the root nodes in the runtime nodes array.\n   *\n   * @type {number[]}\n   * @readonly\n   *\n   * @private\n   */\n  this._rootNodes = [];\n\n  /**\n   * The indices of the skinned nodes in the runtime nodes array. These refer\n   * to the nodes that will be manipulated by their skin, as opposed to the nodes\n   * acting as joints for the skin.\n   *\n   * @type {number[]}\n   * @readonly\n   *\n   * @private\n   */\n  this._skinnedNodes = [];\n\n  /**\n   * The runtime skins that affect nodes in the scene graph.\n   *\n   * @type {ModelSkin[]}\n   * @readonly\n   *\n   * @private\n   */\n  this._runtimeSkins = [];\n\n  /**\n   * Pipeline stages to apply to this model. This\n   * is an array of classes, each with a static method called\n   * <code>process()</code>\n   *\n   * @type {Object[]}\n   * @readonly\n   *\n   * @private\n   */\n  this.modelPipelineStages = [];\n\n  // The scene graph's bounding sphere is model space, so that\n  // the model's bounding sphere can be recomputed when given a\n  // new model matrix.\n  this._boundingSphere = undefined;\n\n  // The 2D bounding sphere is in world space. This is checked\n  // by the draw commands to see if the model is over the IDL,\n  // and if so, renders the primitives using extra commands.\n  this._boundingSphere2D = undefined;\n\n  this._computedModelMatrix = Matrix4.clone(Matrix4.IDENTITY);\n  this._computedModelMatrix2D = Matrix4.clone(Matrix4.IDENTITY);\n\n  this._axisCorrectionMatrix = ModelUtility.getAxisCorrectionMatrix(\n    components.upAxis,\n    components.forwardAxis,\n    new Matrix4()\n  );\n\n  // Store articulations from the AGI_articulations extension\n  // by name in a dictionary for easy retrieval.\n  this._runtimeArticulations = {};\n\n  initialize(this);\n}\n\nObject.defineProperties(ModelSceneGraph.prototype, {\n  /**\n   * The model components this scene graph represents.\n   *\n   * @type {ModelComponents}\n   * @readonly\n   *\n   * @private\n   */\n  components: {\n    get: function () {\n      return this._components;\n    },\n  },\n\n  /**\n   * The axis-corrected model matrix.\n   *\n   * @type {Matrix4}\n   * @readonly\n   *\n   * @private\n   */\n  computedModelMatrix: {\n    get: function () {\n      return this._computedModelMatrix;\n    },\n  },\n\n  /**\n   * A matrix to correct from y-up in some model formats (e.g. glTF) to the\n   * z-up coordinate system Cesium uses.\n   *\n   * @type {Matrix4}\n   * @readonly\n   *\n   * @private\n   */\n  axisCorrectionMatrix: {\n    get: function () {\n      return this._axisCorrectionMatrix;\n    },\n  },\n\n  /**\n   * The bounding sphere containing all the primitives in the scene graph\n   * in model space.\n   *\n   * @type {BoundingSphere}\n   * @readonly\n   *\n   * @private\n   */\n  boundingSphere: {\n    get: function () {\n      return this._boundingSphere;\n    },\n  },\n});\n\nfunction initialize(sceneGraph) {\n  const components = sceneGraph._components;\n  const scene = components.scene;\n  const model = sceneGraph._model;\n\n  // If the model has a height reference that modifies the model matrix,\n  // it will be accounted for in updateModelMatrix.\n  const modelMatrix = model.modelMatrix;\n  computeModelMatrix(sceneGraph, modelMatrix);\n\n  const articulations = components.articulations;\n  const articulationsLength = articulations.length;\n\n  const runtimeArticulations = sceneGraph._runtimeArticulations;\n  for (let i = 0; i < articulationsLength; i++) {\n    const articulation = articulations[i];\n    const runtimeArticulation = new ModelArticulation({\n      articulation: articulation,\n      sceneGraph: sceneGraph,\n    });\n\n    const name = runtimeArticulation.name;\n    runtimeArticulations[name] = runtimeArticulation;\n  }\n\n  const nodes = components.nodes;\n  const nodesLength = nodes.length;\n\n  // Initialize this array to be the same size as the nodes array in\n  // the model file. This is so the node indices remain the same. However,\n  // only nodes reachable from the scene's root node will be populated, the\n  // rest will be undefined\n  sceneGraph._runtimeNodes = new Array(nodesLength);\n\n  const rootNodes = scene.nodes;\n  const rootNodesLength = rootNodes.length;\n  const transformToRoot = Matrix4.IDENTITY;\n  for (let i = 0; i < rootNodesLength; i++) {\n    const rootNode = scene.nodes[i];\n\n    const rootNodeIndex = traverseAndCreateSceneGraph(\n      sceneGraph,\n      rootNode,\n      transformToRoot\n    );\n\n    sceneGraph._rootNodes.push(rootNodeIndex);\n  }\n\n  // Handle skins after all runtime nodes are created\n  const skins = components.skins;\n  const runtimeSkins = sceneGraph._runtimeSkins;\n\n  const skinsLength = skins.length;\n  for (let i = 0; i < skinsLength; i++) {\n    const skin = skins[i];\n    runtimeSkins.push(\n      new ModelSkin({\n        skin: skin,\n        sceneGraph: sceneGraph,\n      })\n    );\n  }\n\n  const skinnedNodes = sceneGraph._skinnedNodes;\n  const skinnedNodesLength = skinnedNodes.length;\n  for (let i = 0; i < skinnedNodesLength; i++) {\n    const skinnedNodeIndex = skinnedNodes[i];\n    const skinnedNode = sceneGraph._runtimeNodes[skinnedNodeIndex];\n\n    // Use the index of the skin in the model components to find\n    // the corresponding runtime skin.\n    const skin = nodes[skinnedNodeIndex].skin;\n    const skinIndex = skin.index;\n\n    skinnedNode._runtimeSkin = runtimeSkins[skinIndex];\n    skinnedNode.updateJointMatrices();\n  }\n\n  // Ensure articulations are applied with their initial values to their target nodes.\n  sceneGraph.applyArticulations();\n}\n\nfunction computeModelMatrix(sceneGraph, modelMatrix) {\n  const components = sceneGraph._components;\n  const model = sceneGraph._model;\n\n  sceneGraph._computedModelMatrix = Matrix4.multiplyTransformation(\n    modelMatrix,\n    components.transform,\n    sceneGraph._computedModelMatrix\n  );\n\n  sceneGraph._computedModelMatrix = Matrix4.multiplyTransformation(\n    sceneGraph._computedModelMatrix,\n    sceneGraph._axisCorrectionMatrix,\n    sceneGraph._computedModelMatrix\n  );\n\n  sceneGraph._computedModelMatrix = Matrix4.multiplyByUniformScale(\n    sceneGraph._computedModelMatrix,\n    model.computedScale,\n    sceneGraph._computedModelMatrix\n  );\n}\n\nconst scratchComputedTranslation = new Cartesian3();\n\nfunction computeModelMatrix2D(sceneGraph, frameState) {\n  const computedModelMatrix = sceneGraph._computedModelMatrix;\n  const translation = Matrix4.getTranslation(\n    computedModelMatrix,\n    scratchComputedTranslation\n  );\n\n  if (!Cartesian3.equals(translation, Cartesian3.ZERO)) {\n    sceneGraph._computedModelMatrix2D = Transforms.basisTo2D(\n      frameState.mapProjection,\n      computedModelMatrix,\n      sceneGraph._computedModelMatrix2D\n    );\n  } else {\n    const center = sceneGraph.boundingSphere.center;\n    const to2D = Transforms.wgs84To2DModelMatrix(\n      frameState.mapProjection,\n      center,\n      sceneGraph._computedModelMatrix2D\n    );\n    sceneGraph._computedModelMatrix2D = Matrix4.multiply(\n      to2D,\n      computedModelMatrix,\n      sceneGraph._computedModelMatrix2D\n    );\n  }\n\n  sceneGraph._boundingSphere2D = BoundingSphere.transform(\n    sceneGraph._boundingSphere,\n    sceneGraph._computedModelMatrix2D,\n    sceneGraph._boundingSphere2D\n  );\n}\n\n/**\n * Recursively traverse through the nodes in the scene graph to create\n * their runtime versions, using a post-order depth-first traversal.\n *\n * @param {ModelSceneGraph} sceneGraph The scene graph\n * @param {ModelComponents.Node} node The current node\n * @param {Matrix4} transformToRoot The transforms of this node's ancestors.\n * @returns {number} The index of this node in the runtimeNodes array.\n *\n * @private\n */\nfunction traverseAndCreateSceneGraph(sceneGraph, node, transformToRoot) {\n  // The indices of the children of this node in the runtimeNodes array.\n  const childrenIndices = [];\n  const transform = ModelUtility.getNodeTransform(node);\n\n  // Traverse through scene graph.\n  const childrenLength = node.children.length;\n  for (let i = 0; i < childrenLength; i++) {\n    const childNode = node.children[i];\n    const childNodeTransformToRoot = Matrix4.multiplyTransformation(\n      transformToRoot,\n      transform,\n      new Matrix4()\n    );\n\n    const childIndex = traverseAndCreateSceneGraph(\n      sceneGraph,\n      childNode,\n      childNodeTransformToRoot\n    );\n    childrenIndices.push(childIndex);\n  }\n\n  // Process node and mesh primitives.\n  const runtimeNode = new ModelRuntimeNode({\n    node: node,\n    transform: transform,\n    transformToRoot: transformToRoot,\n    children: childrenIndices,\n    sceneGraph: sceneGraph,\n  });\n\n  const primitivesLength = node.primitives.length;\n  for (let i = 0; i < primitivesLength; i++) {\n    runtimeNode.runtimePrimitives.push(\n      new ModelRuntimePrimitive({\n        primitive: node.primitives[i],\n        node: node,\n        model: sceneGraph._model,\n      })\n    );\n  }\n\n  const index = node.index;\n  sceneGraph._runtimeNodes[index] = runtimeNode;\n  if (defined(node.skin)) {\n    sceneGraph._skinnedNodes.push(index);\n  }\n\n  // Create and store the public version of the runtime node.\n  const name = node.name;\n  if (defined(name)) {\n    const model = sceneGraph._model;\n    const publicNode = new ModelNode(model, runtimeNode);\n    model._nodesByName[name] = publicNode;\n  }\n\n  return index;\n}\n\nconst scratchModelPositionMin = new Cartesian3();\nconst scratchModelPositionMax = new Cartesian3();\nconst scratchPrimitivePositionMin = new Cartesian3();\nconst scratchPrimitivePositionMax = new Cartesian3();\n/**\n * Generates the {@link ModelDrawCommand} for each primitive in the model.\n * If the model is used for classification, a {@link ClassificationModelDrawCommand}\n * is generated for each primitive instead.\n *\n * @param {FrameState} frameState The current frame state. This is needed to\n * allocate GPU resources as needed.\n *\n * @private\n */\nModelSceneGraph.prototype.buildDrawCommands = function (frameState) {\n  const model = this._model;\n  const modelRenderResources = new ModelRenderResources(model);\n\n  // Reset the memory counts before running the pipeline\n  model.statistics.clear();\n\n  this.configurePipeline(frameState);\n  const modelPipelineStages = this.modelPipelineStages;\n\n  let i, j, k;\n  for (i = 0; i < modelPipelineStages.length; i++) {\n    const modelPipelineStage = modelPipelineStages[i];\n    modelPipelineStage.process(modelRenderResources, model, frameState);\n  }\n\n  const modelPositionMin = Cartesian3.fromElements(\n    Number.MAX_VALUE,\n    Number.MAX_VALUE,\n    Number.MAX_VALUE,\n    scratchModelPositionMin\n  );\n  const modelPositionMax = Cartesian3.fromElements(\n    -Number.MAX_VALUE,\n    -Number.MAX_VALUE,\n    -Number.MAX_VALUE,\n    scratchModelPositionMax\n  );\n\n  for (i = 0; i < this._runtimeNodes.length; i++) {\n    const runtimeNode = this._runtimeNodes[i];\n\n    // If a node in the model was unreachable from the scene graph, there will\n    // be no corresponding runtime node and therefore should be skipped.\n    if (!defined(runtimeNode)) {\n      continue;\n    }\n\n    runtimeNode.configurePipeline();\n    const nodePipelineStages = runtimeNode.pipelineStages;\n\n    const nodeRenderResources = new NodeRenderResources(\n      modelRenderResources,\n      runtimeNode\n    );\n\n    for (j = 0; j < nodePipelineStages.length; j++) {\n      const nodePipelineStage = nodePipelineStages[j];\n\n      nodePipelineStage.process(\n        nodeRenderResources,\n        runtimeNode.node,\n        frameState\n      );\n    }\n\n    const nodeTransform = runtimeNode.computedTransform;\n    for (j = 0; j < runtimeNode.runtimePrimitives.length; j++) {\n      const runtimePrimitive = runtimeNode.runtimePrimitives[j];\n\n      runtimePrimitive.configurePipeline(frameState);\n      const primitivePipelineStages = runtimePrimitive.pipelineStages;\n\n      const primitiveRenderResources = new PrimitiveRenderResources(\n        nodeRenderResources,\n        runtimePrimitive\n      );\n\n      for (k = 0; k < primitivePipelineStages.length; k++) {\n        const primitivePipelineStage = primitivePipelineStages[k];\n\n        primitivePipelineStage.process(\n          primitiveRenderResources,\n          runtimePrimitive.primitive,\n          frameState\n        );\n      }\n\n      runtimePrimitive.boundingSphere = BoundingSphere.clone(\n        primitiveRenderResources.boundingSphere,\n        new BoundingSphere()\n      );\n\n      const primitivePositionMin = Matrix4.multiplyByPoint(\n        nodeTransform,\n        primitiveRenderResources.positionMin,\n        scratchPrimitivePositionMin\n      );\n      const primitivePositionMax = Matrix4.multiplyByPoint(\n        nodeTransform,\n        primitiveRenderResources.positionMax,\n        scratchPrimitivePositionMax\n      );\n\n      Cartesian3.minimumByComponent(\n        modelPositionMin,\n        primitivePositionMin,\n        modelPositionMin\n      );\n      Cartesian3.maximumByComponent(\n        modelPositionMax,\n        primitivePositionMax,\n        modelPositionMax\n      );\n\n      const drawCommand = buildDrawCommand(\n        primitiveRenderResources,\n        frameState\n      );\n      runtimePrimitive.drawCommand = drawCommand;\n    }\n  }\n\n  this._boundingSphere = BoundingSphere.fromCornerPoints(\n    modelPositionMin,\n    modelPositionMax,\n    new BoundingSphere()\n  );\n\n  this._boundingSphere = BoundingSphere.transformWithoutScale(\n    this._boundingSphere,\n    this._axisCorrectionMatrix,\n    this._boundingSphere\n  );\n\n  this._boundingSphere = BoundingSphere.transform(\n    this._boundingSphere,\n    this._components.transform,\n    this._boundingSphere\n  );\n\n  model._boundingSphere = BoundingSphere.transform(\n    this._boundingSphere,\n    model.modelMatrix,\n    model._boundingSphere\n  );\n\n  model._initialRadius = model._boundingSphere.radius;\n  model._boundingSphere.radius *= model._clampedScale;\n};\n\n/**\n * Configure the model pipeline stages. If the pipeline needs to be re-run, call\n * this method again to ensure the correct sequence of pipeline stages are\n * used.\n *\n * @private\n */\nModelSceneGraph.prototype.configurePipeline = function (frameState) {\n  const modelPipelineStages = this.modelPipelineStages;\n  modelPipelineStages.length = 0;\n\n  const model = this._model;\n\n  if (defined(model.color)) {\n    modelPipelineStages.push(ModelColorPipelineStage);\n  }\n\n  // Skip these pipeline stages for classification models.\n  if (defined(model.classificationType)) {\n    return;\n  }\n\n  if (model.imageBasedLighting.enabled) {\n    modelPipelineStages.push(ImageBasedLightingPipelineStage);\n  }\n\n  if (model.isClippingEnabled()) {\n    modelPipelineStages.push(ModelClippingPlanesPipelineStage);\n  }\n\n  if (model.hasSilhouette(frameState)) {\n    modelPipelineStages.push(ModelSilhouettePipelineStage);\n  }\n\n  if (\n    defined(model.splitDirection) &&\n    model.splitDirection !== SplitDirection.NONE\n  ) {\n    modelPipelineStages.push(ModelSplitterPipelineStage);\n  }\n\n  if (ModelType.is3DTiles(model.type)) {\n    modelPipelineStages.push(TilesetPipelineStage);\n  }\n};\n\nModelSceneGraph.prototype.update = function (frameState, updateForAnimations) {\n  let i, j, k;\n\n  for (i = 0; i < this._runtimeNodes.length; i++) {\n    const runtimeNode = this._runtimeNodes[i];\n\n    // If a node in the model was unreachable from the scene graph, there will\n    // be no corresponding runtime node and therefore should be skipped.\n    if (!defined(runtimeNode)) {\n      continue;\n    }\n\n    for (j = 0; j < runtimeNode.updateStages.length; j++) {\n      const nodeUpdateStage = runtimeNode.updateStages[j];\n      nodeUpdateStage.update(runtimeNode, this, frameState);\n    }\n\n    const disableAnimations =\n      frameState.mode !== SceneMode.SCENE3D && this._model._projectTo2D;\n    if (updateForAnimations && !disableAnimations) {\n      this.updateJointMatrices();\n    }\n\n    for (j = 0; j < runtimeNode.runtimePrimitives.length; j++) {\n      const runtimePrimitive = runtimeNode.runtimePrimitives[j];\n      for (k = 0; k < runtimePrimitive.updateStages.length; k++) {\n        const stage = runtimePrimitive.updateStages[k];\n        stage.update(runtimePrimitive, this);\n      }\n    }\n  }\n};\n\nModelSceneGraph.prototype.updateModelMatrix = function (\n  modelMatrix,\n  frameState\n) {\n  computeModelMatrix(this, modelMatrix);\n  if (frameState.mode !== SceneMode.SCENE3D) {\n    computeModelMatrix2D(this, frameState);\n  }\n\n  // Mark all root nodes as dirty. Any and all children will be\n  // affected recursively in the update stage.\n  const rootNodes = this._rootNodes;\n  for (let i = 0; i < rootNodes.length; i++) {\n    const node = this._runtimeNodes[rootNodes[i]];\n    node._transformDirty = true;\n  }\n};\n\n/**\n * Updates the joint matrices for the skins and nodes of the model.\n *\n * @private\n */\nModelSceneGraph.prototype.updateJointMatrices = function () {\n  const skinnedNodes = this._skinnedNodes;\n  const length = skinnedNodes.length;\n\n  for (let i = 0; i < length; i++) {\n    const nodeIndex = skinnedNodes[i];\n    const runtimeNode = this._runtimeNodes[nodeIndex];\n    runtimeNode.updateJointMatrices();\n  }\n};\n\n/**\n * A callback to be applied once at each runtime primitive in the\n * scene graph\n * @callback traverseSceneGraphCallback\n *\n * @param {ModelRuntimePrimitive} runtimePrimitive The runtime primitive for the current step of the traversal\n * @param {object} [options] A dictionary of additional options to be passed to the callback, or undefined if the callback does not need any additional information.\n *\n * @private\n */\n\n/**\n * Recursively traverse through the runtime nodes in the scene graph\n * using a post-order depth-first traversal to perform a callback on\n * their runtime primitives.\n *\n * @param {ModelSceneGraph} sceneGraph The scene graph.\n * @param {ModelRuntimeNode} runtimeNode The current runtime node.\n * @param {boolean} visibleNodesOnly Whether to only traverse nodes that are visible.\n * @param {traverseSceneGraphCallback} callback The callback to perform on the runtime primitives of the node.\n * @param {object} [callbackOptions] A dictionary of additional options to be passed to the callback, if needed.\n *\n * @private\n */\nfunction traverseSceneGraph(\n  sceneGraph,\n  runtimeNode,\n  visibleNodesOnly,\n  callback,\n  callbackOptions\n) {\n  if (visibleNodesOnly && !runtimeNode.show) {\n    return;\n  }\n\n  const childrenLength = runtimeNode.children.length;\n  for (let i = 0; i < childrenLength; i++) {\n    const childRuntimeNode = runtimeNode.getChild(i);\n    traverseSceneGraph(\n      sceneGraph,\n      childRuntimeNode,\n      visibleNodesOnly,\n      callback,\n      callbackOptions\n    );\n  }\n\n  const runtimePrimitives = runtimeNode.runtimePrimitives;\n  const runtimePrimitivesLength = runtimePrimitives.length;\n  for (let j = 0; j < runtimePrimitivesLength; j++) {\n    const runtimePrimitive = runtimePrimitives[j];\n    callback(runtimePrimitive, callbackOptions);\n  }\n}\n\nfunction forEachRuntimePrimitive(\n  sceneGraph,\n  visibleNodesOnly,\n  callback,\n  callbackOptions\n) {\n  const rootNodes = sceneGraph._rootNodes;\n  const rootNodesLength = rootNodes.length;\n  for (let i = 0; i < rootNodesLength; i++) {\n    const rootNodeIndex = rootNodes[i];\n    const runtimeNode = sceneGraph._runtimeNodes[rootNodeIndex];\n    traverseSceneGraph(\n      sceneGraph,\n      runtimeNode,\n      visibleNodesOnly,\n      callback,\n      callbackOptions\n    );\n  }\n}\n\nconst scratchBackFaceCullingOptions = {\n  backFaceCulling: undefined,\n};\n\n/**\n * Traverses through all draw commands and changes the back-face culling setting.\n *\n * @param {boolean} backFaceCulling The new value for the back-face culling setting.\n *\n * @private\n */\nModelSceneGraph.prototype.updateBackFaceCulling = function (backFaceCulling) {\n  const backFaceCullingOptions = scratchBackFaceCullingOptions;\n  backFaceCullingOptions.backFaceCulling = backFaceCulling;\n  forEachRuntimePrimitive(\n    this,\n    false,\n    updatePrimitiveBackFaceCulling,\n    backFaceCullingOptions\n  );\n};\n\n// Callback is defined here to avoid allocating a closure in the render loop\nfunction updatePrimitiveBackFaceCulling(runtimePrimitive, options) {\n  const drawCommand = runtimePrimitive.drawCommand;\n  drawCommand.backFaceCulling = options.backFaceCulling;\n}\n\nconst scratchShadowOptions = {\n  shadowMode: undefined,\n};\n\n/**\n * Traverses through all draw commands and changes the shadow settings.\n *\n * @param {ShadowMode} shadowMode The new shadow settings.\n *\n * @private\n */\nModelSceneGraph.prototype.updateShadows = function (shadowMode) {\n  const shadowOptions = scratchShadowOptions;\n  shadowOptions.shadowMode = shadowMode;\n  forEachRuntimePrimitive(this, false, updatePrimitiveShadows, shadowOptions);\n};\n\n// Callback is defined here to avoid allocating a closure in the render loop\nfunction updatePrimitiveShadows(runtimePrimitive, options) {\n  const drawCommand = runtimePrimitive.drawCommand;\n  drawCommand.shadows = options.shadowMode;\n}\n\nconst scratchShowBoundingVolumeOptions = {\n  debugShowBoundingVolume: undefined,\n};\n\n/**\n * Traverses through all draw commands and changes whether to show the debug bounding volume.\n *\n * @param {boolean} debugShowBoundingVolume The new value for showing the debug bounding volume.\n *\n * @private\n */\nModelSceneGraph.prototype.updateShowBoundingVolume = function (\n  debugShowBoundingVolume\n) {\n  const showBoundingVolumeOptions = scratchShowBoundingVolumeOptions;\n  showBoundingVolumeOptions.debugShowBoundingVolume = debugShowBoundingVolume;\n\n  forEachRuntimePrimitive(\n    this,\n    false,\n    updatePrimitiveShowBoundingVolume,\n    showBoundingVolumeOptions\n  );\n};\n\n// Callback is defined here to avoid allocating a closure in the render loop\nfunction updatePrimitiveShowBoundingVolume(runtimePrimitive, options) {\n  const drawCommand = runtimePrimitive.drawCommand;\n  drawCommand.debugShowBoundingVolume = options.debugShowBoundingVolume;\n}\n\nconst scratchSilhouetteCommands = [];\nconst scratchPushDrawCommandOptions = {\n  frameState: undefined,\n  hasSilhouette: undefined,\n};\n\n/**\n * Traverses through the scene graph and pushes the draw commands associated\n * with each primitive to the frame state's command list.\n *\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nModelSceneGraph.prototype.pushDrawCommands = function (frameState) {\n  // If a model has silhouettes, the commands that draw the silhouettes for\n  // each primitive can only be invoked after the entire model has drawn.\n  // Otherwise, the silhouette may draw on top of the model. This requires\n  // gathering the original commands and the silhouette commands separately.\n  const silhouetteCommands = scratchSilhouetteCommands;\n  silhouetteCommands.length = 0;\n\n  // Since this function is called each frame, the options object is\n  // preallocated in a scratch variable\n  const pushDrawCommandOptions = scratchPushDrawCommandOptions;\n  pushDrawCommandOptions.hasSilhouette = this._model.hasSilhouette(frameState);\n  pushDrawCommandOptions.frameState = frameState;\n\n  forEachRuntimePrimitive(\n    this,\n    true,\n    pushPrimitiveDrawCommands,\n    pushDrawCommandOptions\n  );\n\n  frameState.commandList.push.apply(frameState.commandList, silhouetteCommands);\n};\n\n// Callback is defined here to avoid allocating a closure in the render loop\nfunction pushPrimitiveDrawCommands(runtimePrimitive, options) {\n  const frameState = options.frameState;\n  const hasSilhouette = options.hasSilhouette;\n\n  const passes = frameState.passes;\n  const silhouetteCommands = scratchSilhouetteCommands;\n  const primitiveDrawCommand = runtimePrimitive.drawCommand;\n\n  primitiveDrawCommand.pushCommands(frameState, frameState.commandList);\n\n  // If a model has silhouettes, the commands that draw the silhouettes for\n  // each primitive can only be invoked after the entire model has drawn.\n  // Otherwise, the silhouette may draw on top of the model. This requires\n  // gathering the original commands and the silhouette commands separately.\n  if (hasSilhouette && !passes.pick) {\n    primitiveDrawCommand.pushSilhouetteCommands(frameState, silhouetteCommands);\n  }\n}\n\n/**\n * Sets the current value of an articulation stage.\n *\n * @param {string} articulationStageKey The name of the articulation, a space, and the name of the stage.\n * @param {number} value The numeric value of this stage of the articulation.\n *\n * @private\n */\nModelSceneGraph.prototype.setArticulationStage = function (\n  articulationStageKey,\n  value\n) {\n  const names = articulationStageKey.split(\" \");\n  if (names.length !== 2) {\n    return;\n  }\n\n  const articulationName = names[0];\n  const stageName = names[1];\n\n  const runtimeArticulation = this._runtimeArticulations[articulationName];\n  if (defined(runtimeArticulation)) {\n    runtimeArticulation.setArticulationStage(stageName, value);\n  }\n};\n\n/**\n * Applies any modified articulation stages to the matrix of each node that participates\n * in any articulation.  Note that this will overwrite any nodeTransformations on participating nodes.\n *\n * @private\n */\nModelSceneGraph.prototype.applyArticulations = function () {\n  const runtimeArticulations = this._runtimeArticulations;\n  for (const articulationName in runtimeArticulations) {\n    if (runtimeArticulations.hasOwnProperty(articulationName)) {\n      const articulation = runtimeArticulations[articulationName];\n      articulation.apply();\n    }\n  }\n};\n\nexport default ModelSceneGraph;\n", "import AssociativeArray from \"../../Core/AssociativeArray.js\";\nimport Check from \"../../Core/Check.js\";\n\n/**\n * Rendering statistics for a single model.\n *\n * @alias ModelStatistics\n * @constructor\n *\n * @see Cesium3DTilesetStatistics\n *\n * @private\n */\nfunction ModelStatistics() {\n  /**\n   * Total number of points across all POINTS primitives in this model.\n   *\n   * @type {number}\n   * @private\n   */\n  this.pointsLength = 0;\n\n  /**\n   * Total number of triangles across all TRIANGLES, TRIANGLE_STRIP or\n   * TRIANGLE_FAN primitives in this model.\n   *\n   * @type {number}\n   * @private\n   */\n  this.trianglesLength = 0;\n\n  /**\n   * Total size of all geometry buffers in bytes. This accounts for the vertex\n   * attributes (which includes feature IDs and property attributes) and index\n   * buffers of all the model's primitives. Any attributes generated by the\n   * pipeline are included in this total.\n   *\n   * @type {number}\n   * @private\n   */\n  this.geometryByteLength = 0;\n\n  /**\n   * Total size of all textures in bytes. This includes materials,\n   * feature ID textures, and property textures.\n   *\n   * @type {number}\n   * @private\n   */\n  this.texturesByteLength = 0;\n\n  /**\n   * Total size of property tables. This excludes the batch textures used for\n   * picking and styling.\n   *\n   * @type {number}\n   * @private\n   */\n  this.propertyTablesByteLength = 0;\n\n  // Sets of buffers and textures that have already been counted.\n  // This is to prevent double-counting cached assets.\n  this._bufferIdSet = {};\n  this._textureIdSet = {};\n\n  // Associated array of batch textures that have already been counted.\n  // This allows for quick look-up to check if a texture has been counted,\n  // while also allowing for dynamic texture counting.\n  this._batchTextureIdMap = new AssociativeArray();\n}\n\nObject.defineProperties(ModelStatistics.prototype, {\n  /**\n   * Total size of the batch textures used for picking and styling.\n   * Batch textures are created asynchronously, so this iterates\n   * over the textures to ensure their memory values are accurate.\n   *\n   * @memberof ModelStatistics.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  batchTexturesByteLength: {\n    get: function () {\n      const length = this._batchTextureIdMap.length;\n      const values = this._batchTextureIdMap.values;\n\n      let memory = 0;\n      for (let i = 0; i < length; i++) {\n        memory += values[i].byteLength;\n      }\n\n      return memory;\n    },\n  },\n});\n\n/**\n * Reset the memory counts for this model. This should be called each time the\n * draw command pipeline is rebuilt.\n *\n * @private\n */\nModelStatistics.prototype.clear = function () {\n  this.pointsLength = 0;\n  this.trianglesLength = 0;\n  this.geometryByteLength = 0;\n  this.texturesByteLength = 0;\n  this.propertyTablesByteLength = 0;\n\n  this._bufferIdSet = {};\n  this._textureIdSet = {};\n  this._batchTextureIdMap.removeAll();\n};\n\n/**\n * Counts the given buffer's memory in bytes. If a buffer has\n * already been counted by these statistics, it will not be\n * counted again.\n *\n * @param {Buffer} buffer The GPU buffer associated with the model.\n * @param {boolean} hasCpuCopy Whether the buffer has a copy on the CPU via typed array.\n *\n * @private\n */\nModelStatistics.prototype.addBuffer = function (buffer, hasCpuCopy) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"buffer\", buffer);\n  Check.typeOf.bool(\"hasCpuCopy\", hasCpuCopy);\n  //>>includeEnd('debug');\n\n  if (!this._bufferIdSet.hasOwnProperty(buffer._id)) {\n    // If there's a CPU copy, count the memory twice.\n    const copies = hasCpuCopy ? 2 : 1;\n    this.geometryByteLength += buffer.sizeInBytes * copies;\n  }\n\n  // Simulate set insertion.\n  this._bufferIdSet[buffer._id] = true;\n};\n\n/**\n * Counts the given texture's memory in bytes. If a texture has\n * already been counted by these statistics, it will not be\n * counted again.\n * <p>\n * This is used to count the materials and property textures of\n * a model. Batch textures function differently and are counted\n * using <code>addBatchTexture</code> instead.\n * </p>\n *\n * @param {Texture} texture The texture associated with the model.\n *\n * @private\n */\nModelStatistics.prototype.addTexture = function (texture) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"texture\", texture);\n  //>>includeEnd('debug');\n\n  if (!this._textureIdSet.hasOwnProperty(texture._id)) {\n    this.texturesByteLength += texture.sizeInBytes;\n  }\n\n  // Simulate set insertion.\n  this._textureIdSet[texture._id] = true;\n};\n\n/**\n * Counts the batch texture's memory in bytes. If a batch texture\n * has already been counted by these statistics, it will not be\n * counted again.\n * <p>\n * Batch textures are handled differently than other textures. They\n * include the batch and pick textures for the feature table, which\n * are created dynamically. As such, they may not have both textures\n * loaded by the time they are added to the statistics. Their memory\n * will thus be counted dynamically.\n * </p>\n *\n * @param {BatchTexture} batchTexture The batch texture associated with the model.\n *\n * @private\n */\nModelStatistics.prototype.addBatchTexture = function (batchTexture) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"batchTexture\", batchTexture);\n  //>>includeEnd('debug');\n\n  if (!this._batchTextureIdMap.contains(batchTexture._id)) {\n    this._batchTextureIdMap.set(batchTexture._id, batchTexture);\n  }\n};\n\nexport default ModelStatistics;\n", "import AttributeCompression from \"../../Core/AttributeCompression.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Color from \"../../Core/Color.js\";\nimport Check from \"../../Core/Check.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport PrimitiveType from \"../../Core/PrimitiveType.js\";\nimport WebGLConstants from \"../../Core/WebGLConstants.js\";\nimport MersenneTwister from \"mersenne-twister\";\nimport Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\nimport AlphaMode from \"../AlphaMode.js\";\nimport AttributeType from \"../AttributeType.js\";\nimport Axis from \"../Axis.js\";\nimport parseBatchTable from \"../parseBatchTable.js\";\nimport DracoLoader from \"../DracoLoader.js\";\nimport StructuralMetadata from \"../StructuralMetadata.js\";\nimport ResourceLoader from \"../ResourceLoader.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport PntsParser from \"../PntsParser.js\";\nimport ResourceLoaderState from \"../ResourceLoaderState.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\n\nconst Components = ModelComponents.Components;\nconst Scene = ModelComponents.Scene;\nconst Node = ModelComponents.Node;\nconst Primitive = ModelComponents.Primitive;\nconst Attribute = ModelComponents.Attribute;\nconst Quantization = ModelComponents.Quantization;\nconst FeatureIdAttribute = ModelComponents.FeatureIdAttribute;\nconst Material = ModelComponents.Material;\nconst MetallicRoughness = ModelComponents.MetallicRoughness;\n\n/**\n * Loads a .pnts point cloud and transcodes it into a {@link ModelComponents}\n *\n * @alias PntsLoader\n * @constructor\n * @augments ResourceLoader\n * @private\n *\n * @param {object} options An object containing the following properties\n * @param {ArrayBuffer} options.arrayBuffer The array buffer of the pnts contents\n * @param {number} [options.byteOffset] The byte offset to the beginning of the pnts contents in the array buffer\n * @param {boolean} [options.loadAttributesFor2D=false] If true, load the positions buffer as a typed array for accurately projecting models to 2D.\n */\nfunction PntsLoader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const arrayBuffer = options.arrayBuffer;\n  const byteOffset = defaultValue(options.byteOffset, 0);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.arrayBuffer\", arrayBuffer);\n  //>>includeEnd('debug');\n\n  this._arrayBuffer = arrayBuffer;\n  this._byteOffset = byteOffset;\n  this._loadAttributesFor2D = defaultValue(options.loadAttributesFor2D, false);\n\n  this._parsedContent = undefined;\n  this._decodePromise = undefined;\n  this._decodedAttributes = undefined;\n\n  this._promise = undefined;\n  this._error = undefined;\n  this._state = ResourceLoaderState.UNLOADED;\n  this._buffers = [];\n\n  // The batch table object contains a json and a binary component access using keys of the same name.\n  this._components = undefined;\n  this._transform = Matrix4.IDENTITY;\n}\n\nif (defined(Object.create)) {\n  PntsLoader.prototype = Object.create(ResourceLoader.prototype);\n  PntsLoader.prototype.constructor = PntsLoader;\n}\n\nObject.defineProperties(PntsLoader.prototype, {\n  /**\n   * The cache key of the resource\n   *\n   * @memberof PntsLoader.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  cacheKey: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * The loaded components.\n   *\n   * @memberof PntsLoader.prototype\n   *\n   * @type {ModelComponents.Components}\n   * @readonly\n   * @private\n   */\n  components: {\n    get: function () {\n      return this._components;\n    },\n  },\n\n  /**\n   * A world-space transform to apply to the primitives.\n   * See {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/PointCloud#global-semantics}\n   *\n   * @memberof PntsLoader.prototype\n   *\n   * @type {Matrix4}\n   * @readonly\n   * @private\n   */\n  transform: {\n    get: function () {\n      return this._transform;\n    },\n  },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise<PntsLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nPntsLoader.prototype.load = function () {\n  if (defined(this._promise)) {\n    return this._promise;\n  }\n\n  this._parsedContent = PntsParser.parse(this._arrayBuffer, this._byteOffset);\n  this._state = ResourceLoaderState.PROCESSING;\n\n  this._promise = Promise.resolve(this);\n};\n\nPntsLoader.prototype.process = function (frameState) {\n  if (defined(this._error)) {\n    const error = this._error;\n    this._error = undefined;\n    throw error;\n  }\n\n  if (this._state === ResourceLoaderState.READY) {\n    return true;\n  }\n\n  if (this._state === ResourceLoaderState.PROCESSING) {\n    if (defined(this._decodePromise)) {\n      return false;\n    }\n\n    this._decodePromise = decodeDraco(this, frameState.context);\n  }\n\n  return false;\n};\n\nfunction decodeDraco(loader, context) {\n  const parsedContent = loader._parsedContent;\n  const draco = parsedContent.draco;\n\n  let decodePromise;\n  if (!defined(draco)) {\n    // The draco extension wasn't present,\n    decodePromise = Promise.resolve();\n  } else {\n    decodePromise = DracoLoader.decodePointCloud(draco, context);\n  }\n\n  if (!defined(decodePromise)) {\n    // Could not schedule Draco decoding this frame.\n    return;\n  }\n\n  loader._decodePromise = decodePromise;\n  return decodePromise\n    .then(function (decodeDracoResult) {\n      if (loader.isDestroyed()) {\n        return;\n      }\n\n      if (defined(decodeDracoResult)) {\n        processDracoAttributes(loader, draco, decodeDracoResult);\n      }\n      makeComponents(loader, context);\n      loader._state = ResourceLoaderState.READY;\n      return loader;\n    })\n    .catch(function (error) {\n      loader.unload();\n      loader._state = ResourceLoaderState.FAILED;\n      const errorMessage = \"Failed to load Draco pnts\";\n      // This error will be thrown next time process is called;\n      loader._error = loader.getError(errorMessage, error);\n    });\n}\n\nfunction processDracoAttributes(loader, draco, result) {\n  loader._state = ResourceLoaderState.READY;\n  const parsedContent = loader._parsedContent;\n\n  let attribute;\n  if (defined(result.POSITION)) {\n    attribute = {\n      name: \"POSITION\",\n      semantic: VertexAttributeSemantic.POSITION,\n      typedArray: result.POSITION.array,\n      componentDatatype: ComponentDatatype.FLOAT,\n      type: AttributeType.VEC3,\n      isQuantized: false,\n    };\n\n    if (defined(result.POSITION.data.quantization)) {\n      // Draco quantization range == quantized volume scale - size in meters of the quantized volume\n      // Internal quantized range is the range of values of the quantized data, e.g. 255 for 8-bit, 1023 for 10-bit, etc\n      const quantization = result.POSITION.data.quantization;\n      const range = quantization.range;\n      const quantizedVolumeScale = Cartesian3.fromElements(range, range, range);\n      const quantizedVolumeOffset = Cartesian3.unpack(quantization.minValues);\n      const quantizedRange = (1 << quantization.quantizationBits) - 1.0;\n\n      attribute.isQuantized = true;\n      attribute.quantizedRange = quantizedRange;\n      attribute.quantizedVolumeOffset = quantizedVolumeOffset;\n      attribute.quantizedVolumeScale = quantizedVolumeScale;\n      attribute.quantizedComponentDatatype =\n        quantizedRange <= 255\n          ? ComponentDatatype.UNSIGNED_BYTE\n          : ComponentDatatype.UNSIGNED_SHORT;\n      attribute.quantizedType = AttributeType.VEC3;\n    }\n\n    parsedContent.positions = attribute;\n  }\n\n  if (defined(result.NORMAL)) {\n    attribute = {\n      name: \"NORMAL\",\n      semantic: VertexAttributeSemantic.NORMAL,\n      typedArray: result.NORMAL.array,\n      componentDatatype: ComponentDatatype.FLOAT,\n      type: AttributeType.VEC3,\n      isQuantized: false,\n      octEncoded: false,\n      octEncodedZXY: false,\n    };\n\n    if (defined(result.NORMAL.data.quantization)) {\n      const octEncodedRange =\n        (1 << result.NORMAL.data.quantization.quantizationBits) - 1.0;\n      attribute.quantizedRange = octEncodedRange;\n      attribute.octEncoded = true;\n      attribute.octEncodedZXY = true;\n      attribute.quantizedComponentDatatype = ComponentDatatype.UNSIGNED_BYTE;\n      attribute.quantizedType = AttributeType.VEC2;\n    }\n\n    parsedContent.normals = attribute;\n  }\n\n  if (defined(result.RGBA)) {\n    parsedContent.colors = {\n      name: \"COLOR\",\n      semantic: VertexAttributeSemantic.COLOR,\n      setIndex: 0,\n      typedArray: result.RGBA.array,\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      type: AttributeType.VEC4,\n      normalized: true,\n      isTranslucent: true,\n    };\n  } else if (defined(result.RGB)) {\n    parsedContent.colors = {\n      name: \"COLOR\",\n      semantic: VertexAttributeSemantic.COLOR,\n      setIndex: 0,\n      typedArray: result.RGB.array,\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      type: AttributeType.VEC3,\n      normalized: true,\n      isTranslucent: false,\n    };\n  }\n\n  // Transcode Batch ID (3D Tiles 1.0) -> Feature ID (3D Tiles Next)\n  if (defined(result.BATCH_ID)) {\n    const batchIds = result.BATCH_ID.array;\n    parsedContent.batchIds = {\n      name: \"_FEATURE_ID\",\n      semantic: VertexAttributeSemantic.FEATURE_ID,\n      setIndex: 0,\n      typedArray: batchIds,\n      componentDatatype: ComponentDatatype.fromTypedArray(batchIds),\n      type: AttributeType.SCALAR,\n    };\n  }\n\n  let batchTableJson = parsedContent.batchTableJson;\n\n  const batchTableProperties = draco.batchTableProperties;\n  for (const name in batchTableProperties) {\n    if (batchTableProperties.hasOwnProperty(name)) {\n      const property = result[name];\n\n      if (!defined(batchTableJson)) {\n        batchTableJson = {};\n      }\n\n      parsedContent.hasDracoBatchTable = true;\n\n      const data = property.data;\n      batchTableJson[name] = {\n        byteOffset: data.byteOffset,\n        // Draco returns the results like glTF values, but here\n        // we want to transcode to a batch table. It's redundant\n        // but necessary to use parseBatchTable()\n        type: transcodeAttributeType(data.componentsPerAttribute),\n        componentType: transcodeComponentType(data.componentDatatype),\n        // Each property is stored as a separate typed array, so\n        // store it here. parseBatchTable() will check for this\n        // instead of the entire binary body.\n        typedArray: property.array,\n      };\n    }\n  }\n  parsedContent.batchTableJson = batchTableJson;\n}\n\nfunction transcodeAttributeType(componentsPerAttribute) {\n  switch (componentsPerAttribute) {\n    case 1:\n      return \"SCALAR\";\n    case 2:\n      return \"VEC2\";\n    case 3:\n      return \"VEC3\";\n    case 4:\n      return \"VEC4\";\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\n        \"componentsPerAttribute must be a number from 1-4\"\n      );\n    //>>includeEnd('debug');\n  }\n}\n\nfunction transcodeComponentType(value) {\n  switch (value) {\n    case WebGLConstants.BYTE:\n      return \"BYTE\";\n    case WebGLConstants.UNSIGNED_BYTE:\n      return \"UNSIGNED_BYTE\";\n    case WebGLConstants.SHORT:\n      return \"SHORT\";\n    case WebGLConstants.UNSIGNED_SHORT:\n      return \"UNSIGNED_SHORT\";\n    case WebGLConstants.INT:\n      return \"INT\";\n    case WebGLConstants.UNSIGNED_INT:\n      return \"UNSIGNED_INT\";\n    case WebGLConstants.DOUBLE:\n      return \"DOUBLE\";\n    case WebGLConstants.FLOAT:\n      return \"FLOAT\";\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(\"value is not a valid WebGL constant\");\n    //>>includeEnd('debug');\n  }\n}\n\nfunction makeAttribute(loader, attributeInfo, context) {\n  let typedArray = attributeInfo.typedArray;\n  let quantization;\n  if (attributeInfo.octEncoded) {\n    quantization = new Quantization();\n    quantization.octEncoded = attributeInfo.octEncoded;\n    quantization.octEncodedZXY = attributeInfo.octEncodedZXY;\n    quantization.normalizationRange = attributeInfo.quantizedRange;\n    quantization.type = attributeInfo.quantizedType;\n    quantization.componentDatatype = attributeInfo.quantizedComponentDatatype;\n  }\n  if (attributeInfo.isQuantized) {\n    quantization = new Quantization();\n    const normalizationRange = attributeInfo.quantizedRange;\n    quantization.normalizationRange = normalizationRange;\n    // volume offset sometimes requires 64-bit precision so this is handled\n    // in the components.transform matrix.\n    quantization.quantizedVolumeOffset = Cartesian3.ZERO;\n    const quantizedVolumeDimensions = attributeInfo.quantizedVolumeScale;\n    quantization.quantizedVolumeDimensions = quantizedVolumeDimensions;\n    quantization.quantizedVolumeStepSize = Cartesian3.divideByScalar(\n      quantizedVolumeDimensions,\n      normalizationRange,\n      new Cartesian3()\n    );\n    quantization.componentDatatype = attributeInfo.quantizedComponentDatatype;\n    quantization.type = attributeInfo.quantizedType;\n  }\n\n  const attribute = new Attribute();\n  attribute.name = attributeInfo.name;\n  attribute.semantic = attributeInfo.semantic;\n  attribute.setIndex = attributeInfo.setIndex;\n  attribute.componentDatatype = attributeInfo.componentDatatype;\n  attribute.type = attributeInfo.type;\n  attribute.normalized = defaultValue(attributeInfo.normalized, false);\n  attribute.min = attributeInfo.min;\n  attribute.max = attributeInfo.max;\n  attribute.quantization = quantization;\n\n  if (attributeInfo.isRGB565) {\n    typedArray = AttributeCompression.decodeRGB565(typedArray);\n  }\n\n  if (defined(attributeInfo.constantColor)) {\n    const packedColor = new Array(4);\n    attribute.constant = Color.pack(attributeInfo.constantColor, packedColor);\n  } else {\n    const buffer = Buffer.createVertexBuffer({\n      typedArray: typedArray,\n      context: context,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    buffer.vertexArrayDestroyable = false;\n    loader._buffers.push(buffer);\n    attribute.buffer = buffer;\n  }\n\n  const loadAttributesFor2D = loader._loadAttributesFor2D;\n  if (\n    attribute.semantic === VertexAttributeSemantic.POSITION &&\n    loadAttributesFor2D\n  ) {\n    attribute.typedArray = typedArray;\n  }\n\n  return attribute;\n}\n\nlet randomNumberGenerator;\nlet randomValues;\n\nfunction getRandomValues(samplesLength) {\n  // Use same random values across all runs\n  if (!defined(randomValues)) {\n    // Use MersenneTwister directly to avoid interfering with CesiumMath.nextRandomNumber()\n    // See https://github.com/CesiumGS/cesium/issues/9730\n    randomNumberGenerator = new MersenneTwister(0);\n    randomValues = new Array(samplesLength);\n    for (let i = 0; i < samplesLength; ++i) {\n      randomValues[i] = randomNumberGenerator.random();\n    }\n  }\n  return randomValues;\n}\n\nconst scratchMin = new Cartesian3();\nconst scratchMax = new Cartesian3();\nconst scratchPosition = new Cartesian3();\nfunction computeApproximateExtrema(positions) {\n  const positionsArray = positions.typedArray;\n  const maximumSamplesLength = 20;\n  const pointsLength = positionsArray.length / 3;\n  const samplesLength = Math.min(pointsLength, maximumSamplesLength);\n  const randomValues = getRandomValues(maximumSamplesLength);\n  const maxValue = Number.MAX_VALUE;\n  const minValue = -Number.MAX_VALUE;\n  let min = Cartesian3.fromElements(maxValue, maxValue, maxValue, scratchMin);\n  let max = Cartesian3.fromElements(minValue, minValue, minValue, scratchMax);\n  let i;\n  let index;\n  let position;\n  if (positions.isQuantized) {\n    // The quantized volume offset is not used here since it will become part of\n    // the model matrix.\n    min = Cartesian3.ZERO;\n    max = positions.quantizedVolumeScale;\n  } else {\n    for (i = 0; i < samplesLength; ++i) {\n      index = Math.floor(randomValues[i] * pointsLength);\n      position = Cartesian3.unpack(positionsArray, index * 3, scratchPosition);\n\n      Cartesian3.minimumByComponent(min, position, min);\n      Cartesian3.maximumByComponent(max, position, max);\n    }\n  }\n\n  positions.min = Cartesian3.clone(min);\n  positions.max = Cartesian3.clone(max);\n}\n\n// By default, point clouds are rendered as dark gray.\nconst defaultColorAttribute = {\n  name: VertexAttributeSemantic.COLOR,\n  semantic: VertexAttributeSemantic.COLOR,\n  setIndex: 0,\n  constantColor: Color.DARKGRAY,\n  componentDatatype: ComponentDatatype.FLOAT,\n  type: AttributeType.VEC4,\n  isQuantized: false,\n  isTranslucent: false,\n};\n\nfunction makeAttributes(loader, parsedContent, context) {\n  const attributes = [];\n  let attribute;\n  const positions = parsedContent.positions;\n  if (defined(positions)) {\n    computeApproximateExtrema(positions);\n    attribute = makeAttribute(loader, positions, context);\n    attribute.count = parsedContent.pointsLength;\n    attributes.push(attribute);\n  }\n\n  if (defined(parsedContent.normals)) {\n    attribute = makeAttribute(loader, parsedContent.normals, context);\n    attributes.push(attribute);\n  }\n\n  if (defined(parsedContent.colors)) {\n    attribute = makeAttribute(loader, parsedContent.colors, context);\n    attributes.push(attribute);\n  } else {\n    attribute = makeAttribute(loader, defaultColorAttribute, context);\n    attributes.push(attribute);\n  }\n\n  if (defined(parsedContent.batchIds)) {\n    attribute = makeAttribute(loader, parsedContent.batchIds, context);\n    attributes.push(attribute);\n  }\n\n  return attributes;\n}\n\nfunction makeStructuralMetadata(parsedContent, customAttributeOutput) {\n  const batchLength = parsedContent.batchLength;\n  const pointsLength = parsedContent.pointsLength;\n  const batchTableBinary = parsedContent.batchTableBinary;\n\n  // If there are batch IDs, parse as a property table. Otherwise, parse\n  // as property attributes.\n  const parseAsPropertyAttributes = !defined(parsedContent.batchIds);\n\n  if (defined(batchTableBinary) || parsedContent.hasDracoBatchTable) {\n    const count = defaultValue(batchLength, pointsLength);\n    return parseBatchTable({\n      count: count,\n      batchTable: parsedContent.batchTableJson,\n      binaryBody: batchTableBinary,\n      parseAsPropertyAttributes: parseAsPropertyAttributes,\n      customAttributeOutput: customAttributeOutput,\n    });\n  }\n\n  return new StructuralMetadata({\n    schema: {},\n    propertyTables: [],\n  });\n}\n\nfunction makeComponents(loader, context) {\n  const parsedContent = loader._parsedContent;\n\n  const metallicRoughness = new MetallicRoughness();\n  metallicRoughness.metallicFactor = 0;\n  metallicRoughness.roughnessFactor = 0.9;\n\n  const material = new Material();\n  material.metallicRoughness = metallicRoughness;\n\n  const colors = parsedContent.colors;\n  if (defined(colors) && colors.isTranslucent) {\n    material.alphaMode = AlphaMode.BLEND;\n  }\n\n  // Render point clouds as unlit, unless normals are present, in which case\n  // render as a PBR material.\n  const isUnlit = !defined(parsedContent.normals);\n  material.unlit = isUnlit;\n\n  const primitive = new Primitive();\n  primitive.attributes = makeAttributes(loader, parsedContent, context);\n  primitive.primitiveType = PrimitiveType.POINTS;\n  primitive.material = material;\n\n  if (defined(parsedContent.batchIds)) {\n    const featureIdAttribute = new FeatureIdAttribute();\n    featureIdAttribute.propertyTableId = 0;\n    featureIdAttribute.setIndex = 0;\n    featureIdAttribute.positionalLabel = \"featureId_0\";\n    primitive.featureIds.push(featureIdAttribute);\n  }\n\n  const node = new Node();\n  node.index = 0;\n  node.primitives = [primitive];\n\n  const scene = new Scene();\n  scene.nodes = [node];\n  scene.upAxis = Axis.Z;\n  scene.forwardAxis = Axis.X;\n\n  const components = new Components();\n  components.scene = scene;\n  components.nodes = [node];\n\n  // Per-point features will be parsed as property attributes and handled on\n  // the GPU since CPU styling would be too expensive. However, if batch IDs\n  // exist, features will be parsed as a property table.\n  //\n  // Property attributes refer to a custom attribute that will\n  // store the values; such attributes will be populated in this array\n  // as needed.\n  const customAttributeOutput = [];\n  components.structuralMetadata = makeStructuralMetadata(\n    parsedContent,\n    customAttributeOutput\n  );\n\n  if (customAttributeOutput.length > 0) {\n    addPropertyAttributesToPrimitive(\n      loader,\n      primitive,\n      customAttributeOutput,\n      context\n    );\n  }\n\n  if (defined(parsedContent.rtcCenter)) {\n    components.transform = Matrix4.multiplyByTranslation(\n      components.transform,\n      parsedContent.rtcCenter,\n      components.transform\n    );\n  }\n\n  const positions = parsedContent.positions;\n  if (defined(positions) && positions.isQuantized) {\n    // The volume offset is sometimes in ECEF, so this is applied here rather\n    // than the dequantization shader to avoid jitter\n    components.transform = Matrix4.multiplyByTranslation(\n      components.transform,\n      positions.quantizedVolumeOffset,\n      components.transform\n    );\n  }\n\n  loader._components = components;\n\n  // Free the parsed content and array buffer so we don't hold onto the large arrays.\n  loader._parsedContent = undefined;\n  loader._arrayBuffer = undefined;\n}\n\nfunction addPropertyAttributesToPrimitive(\n  loader,\n  primitive,\n  customAttributes,\n  context\n) {\n  const attributes = primitive.attributes;\n\n  const length = customAttributes.length;\n  for (let i = 0; i < length; i++) {\n    const customAttribute = customAttributes[i];\n\n    // Upload the typed array to the GPU and free the CPU copy.\n    const buffer = Buffer.createVertexBuffer({\n      typedArray: customAttribute.typedArray,\n      context: context,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    buffer.vertexArrayDestroyable = false;\n    loader._buffers.push(buffer);\n    customAttribute.buffer = buffer;\n    customAttribute.typedArray = undefined;\n\n    attributes.push(customAttribute);\n  }\n\n  // The batch table is always transcoded as a single property attribute, so\n  // it will always be index 0\n  primitive.propertyAttributeIds = [0];\n}\n\nPntsLoader.prototype.unload = function () {\n  const buffers = this._buffers;\n  for (let i = 0; i < buffers.length; i++) {\n    buffers[i].destroy();\n  }\n  buffers.length = 0;\n\n  this._components = undefined;\n  this._parsedContent = undefined;\n  this._arrayBuffer = undefined;\n};\n\nexport default PntsLoader;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport combine from \"../Core/combine.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport AttributeType from \"./AttributeType.js\";\nimport Cesium3DTileFeatureTable from \"./Cesium3DTileFeatureTable.js\";\nimport VertexAttributeSemantic from \"./VertexAttributeSemantic.js\";\n\n/**\n * Handles parsing of a Point Cloud\n *\n * @namespace PntsParser\n * @private\n */\nconst PntsParser = {};\n\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\n\n/**\n * Parses the contents of a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/PointCloud|Point Cloud}.\n *\n * @private\n *\n * @param {*} arrayBuffer The array buffer containing the pnts\n * @param {*} [byteOffset=0] The byte offset of the beginning of the pnts in the array buffer\n * @returns {object} An object containing a parsed representation of the point cloud\n */\nPntsParser.parse = function (arrayBuffer, byteOffset) {\n  byteOffset = defaultValue(byteOffset, 0);\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"arrayBuffer\", arrayBuffer);\n  //>>includeEnd('debug');\n\n  const uint8Array = new Uint8Array(arrayBuffer);\n  const view = new DataView(arrayBuffer);\n  byteOffset += sizeOfUint32; // Skip magic\n\n  const version = view.getUint32(byteOffset, true);\n  if (version !== 1) {\n    throw new RuntimeError(\n      `Only Point Cloud tile version 1 is supported.  Version ${version} is not.`\n    );\n  }\n  byteOffset += sizeOfUint32;\n\n  // Skip byteLength\n  byteOffset += sizeOfUint32;\n\n  const featureTableJsonByteLength = view.getUint32(byteOffset, true);\n  if (featureTableJsonByteLength === 0) {\n    throw new RuntimeError(\n      \"Feature table must have a byte length greater than zero\"\n    );\n  }\n  byteOffset += sizeOfUint32;\n\n  const featureTableBinaryByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  const batchTableJsonByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n  const batchTableBinaryByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  const featureTableJson = getJsonFromTypedArray(\n    uint8Array,\n    byteOffset,\n    featureTableJsonByteLength\n  );\n  byteOffset += featureTableJsonByteLength;\n\n  const featureTableBinary = new Uint8Array(\n    arrayBuffer,\n    byteOffset,\n    featureTableBinaryByteLength\n  );\n  byteOffset += featureTableBinaryByteLength;\n\n  // Get the batch table JSON and binary\n  let batchTableJson;\n  let batchTableBinary;\n  if (batchTableJsonByteLength > 0) {\n    // Has a batch table JSON\n    batchTableJson = getJsonFromTypedArray(\n      uint8Array,\n      byteOffset,\n      batchTableJsonByteLength\n    );\n    byteOffset += batchTableJsonByteLength;\n\n    if (batchTableBinaryByteLength > 0) {\n      // Has a batch table binary\n      batchTableBinary = new Uint8Array(\n        arrayBuffer,\n        byteOffset,\n        batchTableBinaryByteLength\n      );\n      byteOffset += batchTableBinaryByteLength;\n    }\n  }\n\n  const featureTable = new Cesium3DTileFeatureTable(\n    featureTableJson,\n    featureTableBinary\n  );\n\n  const pointsLength = featureTable.getGlobalProperty(\"POINTS_LENGTH\");\n  featureTable.featuresLength = pointsLength;\n\n  if (!defined(pointsLength)) {\n    throw new RuntimeError(\n      \"Feature table global property: POINTS_LENGTH must be defined\"\n    );\n  }\n\n  let rtcCenter = featureTable.getGlobalProperty(\n    \"RTC_CENTER\",\n    ComponentDatatype.FLOAT,\n    3\n  );\n  if (defined(rtcCenter)) {\n    rtcCenter = Cartesian3.unpack(rtcCenter);\n  }\n\n  // Start with the draco compressed properties and add in uncompressed\n  // properties.\n  const parsedContent = parseDracoProperties(featureTable, batchTableJson);\n  parsedContent.rtcCenter = rtcCenter;\n  parsedContent.pointsLength = pointsLength;\n\n  if (!parsedContent.hasPositions) {\n    const positions = parsePositions(featureTable);\n    parsedContent.positions = positions;\n    parsedContent.hasPositions =\n      parsedContent.hasPositions || defined(positions);\n  }\n\n  if (!parsedContent.hasPositions) {\n    throw new RuntimeError(\n      \"Either POSITION or POSITION_QUANTIZED must be defined.\"\n    );\n  }\n\n  if (!parsedContent.hasNormals) {\n    const normals = parseNormals(featureTable);\n    parsedContent.normals = normals;\n    parsedContent.hasNormals = parsedContent.hasNormals || defined(normals);\n  }\n\n  if (!parsedContent.hasColors) {\n    const colors = parseColors(featureTable);\n    parsedContent.colors = colors;\n    parsedContent.hasColors = parsedContent.hasColors || defined(colors);\n    parsedContent.hasConstantColor = defined(parsedContent.constantColor);\n    parsedContent.isTranslucent = defined(colors) && colors.isTranslucent;\n  }\n\n  if (!parsedContent.hasBatchIds) {\n    const batchIds = parseBatchIds(featureTable);\n    parsedContent.batchIds = batchIds;\n    parsedContent.hasBatchIds = parsedContent.hasBatchIds || defined(batchIds);\n  }\n\n  if (parsedContent.hasBatchIds) {\n    const batchLength = featureTable.getGlobalProperty(\"BATCH_LENGTH\");\n    if (!defined(batchLength)) {\n      throw new RuntimeError(\n        \"Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.\"\n      );\n    }\n    parsedContent.batchLength = batchLength;\n  }\n\n  if (defined(batchTableBinary)) {\n    // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed\n    batchTableBinary = new Uint8Array(batchTableBinary);\n    parsedContent.batchTableJson = batchTableJson;\n    parsedContent.batchTableBinary = batchTableBinary;\n  }\n\n  return parsedContent;\n};\n\nfunction parseDracoProperties(featureTable, batchTableJson) {\n  const featureTableJson = featureTable.json;\n  let dracoBuffer;\n  let dracoFeatureTableProperties;\n  let dracoBatchTableProperties;\n\n  const featureTableDraco = defined(featureTableJson.extensions)\n    ? featureTableJson.extensions[\"3DTILES_draco_point_compression\"]\n    : undefined;\n  const batchTableDraco =\n    defined(batchTableJson) && defined(batchTableJson.extensions)\n      ? batchTableJson.extensions[\"3DTILES_draco_point_compression\"]\n      : undefined;\n\n  if (defined(batchTableDraco)) {\n    dracoBatchTableProperties = batchTableDraco.properties;\n  }\n\n  let hasPositions;\n  let hasColors;\n  let hasNormals;\n  let hasBatchIds;\n  let isTranslucent;\n  if (defined(featureTableDraco)) {\n    dracoFeatureTableProperties = featureTableDraco.properties;\n    const dracoByteOffset = featureTableDraco.byteOffset;\n    const dracoByteLength = featureTableDraco.byteLength;\n    if (\n      !defined(dracoFeatureTableProperties) ||\n      !defined(dracoByteOffset) ||\n      !defined(dracoByteLength)\n    ) {\n      throw new RuntimeError(\n        \"Draco properties, byteOffset, and byteLength must be defined\"\n      );\n    }\n    dracoBuffer = featureTable.buffer.slice(\n      dracoByteOffset,\n      dracoByteOffset + dracoByteLength\n    );\n    hasPositions = defined(dracoFeatureTableProperties.POSITION);\n    hasColors =\n      defined(dracoFeatureTableProperties.RGB) ||\n      defined(dracoFeatureTableProperties.RGBA);\n    hasNormals = defined(dracoFeatureTableProperties.NORMAL);\n    hasBatchIds = defined(dracoFeatureTableProperties.BATCH_ID);\n    isTranslucent = defined(dracoFeatureTableProperties.RGBA);\n  }\n\n  let draco;\n  if (defined(dracoBuffer)) {\n    draco = {\n      buffer: dracoBuffer,\n      featureTableProperties: dracoFeatureTableProperties,\n      batchTableProperties: dracoBatchTableProperties,\n      properties: combine(\n        dracoFeatureTableProperties,\n        dracoBatchTableProperties\n      ),\n      dequantizeInShader: true,\n    };\n  }\n\n  return {\n    draco: draco,\n    hasPositions: hasPositions,\n    hasColors: hasColors,\n    isTranslucent: isTranslucent,\n    hasNormals: hasNormals,\n    hasBatchIds: hasBatchIds,\n  };\n}\n\nfunction parsePositions(featureTable) {\n  const featureTableJson = featureTable.json;\n\n  let positions;\n  if (defined(featureTableJson.POSITION)) {\n    positions = featureTable.getPropertyArray(\n      \"POSITION\",\n      ComponentDatatype.FLOAT,\n      3\n    );\n\n    return {\n      name: VertexAttributeSemantic.POSITION,\n      semantic: VertexAttributeSemantic.POSITION,\n      typedArray: positions,\n      isQuantized: false,\n      componentDatatype: ComponentDatatype.FLOAT,\n      type: AttributeType.VEC3,\n    };\n  } else if (defined(featureTableJson.POSITION_QUANTIZED)) {\n    positions = featureTable.getPropertyArray(\n      \"POSITION_QUANTIZED\",\n      ComponentDatatype.UNSIGNED_SHORT,\n      3\n    );\n\n    const quantizedVolumeScale = featureTable.getGlobalProperty(\n      \"QUANTIZED_VOLUME_SCALE\",\n      ComponentDatatype.FLOAT,\n      3\n    );\n    if (!defined(quantizedVolumeScale)) {\n      throw new RuntimeError(\n        \"Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.\"\n      );\n    }\n    const quantizedRange = (1 << 16) - 1;\n\n    const quantizedVolumeOffset = featureTable.getGlobalProperty(\n      \"QUANTIZED_VOLUME_OFFSET\",\n      ComponentDatatype.FLOAT,\n      3\n    );\n    if (!defined(quantizedVolumeOffset)) {\n      throw new RuntimeError(\n        \"Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.\"\n      );\n    }\n\n    return {\n      name: VertexAttributeSemantic.POSITION,\n      semantic: VertexAttributeSemantic.POSITION,\n      typedArray: positions,\n      isQuantized: true,\n      componentDatatype: ComponentDatatype.FLOAT,\n      type: AttributeType.VEC3,\n      quantizedRange: quantizedRange,\n      quantizedVolumeOffset: Cartesian3.unpack(quantizedVolumeOffset),\n      quantizedVolumeScale: Cartesian3.unpack(quantizedVolumeScale),\n      quantizedComponentDatatype: ComponentDatatype.UNSIGNED_SHORT,\n      quantizedType: AttributeType.VEC3,\n    };\n  }\n}\n\nfunction parseColors(featureTable) {\n  const featureTableJson = featureTable.json;\n\n  let colors;\n  if (defined(featureTableJson.RGBA)) {\n    colors = featureTable.getPropertyArray(\n      \"RGBA\",\n      ComponentDatatype.UNSIGNED_BYTE,\n      4\n    );\n    return {\n      name: VertexAttributeSemantic.COLOR,\n      semantic: VertexAttributeSemantic.COLOR,\n      setIndex: 0,\n      typedArray: colors,\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      type: AttributeType.VEC4,\n      normalized: true,\n      isRGB565: false,\n      isTranslucent: true,\n    };\n  } else if (defined(featureTableJson.RGB)) {\n    colors = featureTable.getPropertyArray(\n      \"RGB\",\n      ComponentDatatype.UNSIGNED_BYTE,\n      3\n    );\n    return {\n      name: \"COLOR\",\n      semantic: VertexAttributeSemantic.COLOR,\n      setIndex: 0,\n      typedArray: colors,\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      type: AttributeType.VEC3,\n      normalized: true,\n      isRGB565: false,\n      isTranslucent: false,\n    };\n  } else if (defined(featureTableJson.RGB565)) {\n    colors = featureTable.getPropertyArray(\n      \"RGB565\",\n      ComponentDatatype.UNSIGNED_SHORT,\n      1\n    );\n    return {\n      name: \"COLOR\",\n      semantic: VertexAttributeSemantic.COLOR,\n      setIndex: 0,\n      typedArray: colors,\n      // These settings are for the Model implementation\n      // which decodes on the CPU and uploads a VEC3 of float colors.\n      // PointCloud does the decoding on the GPU so uploads a\n      // UNSIGNED_SHORT instead.\n      componentDatatype: ComponentDatatype.FLOAT,\n      type: AttributeType.VEC3,\n      normalized: false,\n      isRGB565: true,\n      isTranslucent: false,\n    };\n  } else if (defined(featureTableJson.CONSTANT_RGBA)) {\n    const constantRGBA = featureTable.getGlobalProperty(\n      \"CONSTANT_RGBA\",\n      ComponentDatatype.UNSIGNED_BYTE,\n      4\n    );\n\n    const alpha = constantRGBA[3];\n    const constantColor = Color.fromBytes(\n      constantRGBA[0],\n      constantRGBA[1],\n      constantRGBA[2],\n      alpha\n    );\n\n    const isTranslucent = alpha < 255;\n    return {\n      name: VertexAttributeSemantic.COLOR,\n      semantic: VertexAttributeSemantic.COLOR,\n      setIndex: 0,\n      constantColor: constantColor,\n      componentDatatype: ComponentDatatype.FLOAT,\n      type: AttributeType.VEC4,\n      isQuantized: false,\n      isTranslucent: isTranslucent,\n    };\n  }\n\n  return undefined;\n}\n\nfunction parseNormals(featureTable) {\n  const featureTableJson = featureTable.json;\n  let normals;\n  if (defined(featureTableJson.NORMAL)) {\n    normals = featureTable.getPropertyArray(\n      \"NORMAL\",\n      ComponentDatatype.FLOAT,\n      3\n    );\n    return {\n      name: VertexAttributeSemantic.NORMAL,\n      semantic: VertexAttributeSemantic.NORMAL,\n      typedArray: normals,\n      octEncoded: false,\n      octEncodedZXY: false,\n      componentDatatype: ComponentDatatype.FLOAT,\n      type: AttributeType.VEC3,\n    };\n  } else if (defined(featureTableJson.NORMAL_OCT16P)) {\n    normals = featureTable.getPropertyArray(\n      \"NORMAL_OCT16P\",\n      ComponentDatatype.UNSIGNED_BYTE,\n      2\n    );\n    const quantizationBits = 8;\n    return {\n      name: VertexAttributeSemantic.NORMAL,\n      semantic: VertexAttributeSemantic.NORMAL,\n      typedArray: normals,\n      octEncoded: true,\n      octEncodedZXY: false,\n      quantizedRange: (1 << quantizationBits) - 1,\n      quantizedType: AttributeType.VEC2,\n      quantizedComponentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentDatatype: ComponentDatatype.FLOAT,\n      type: AttributeType.VEC3,\n    };\n  }\n\n  return undefined;\n}\n\nfunction parseBatchIds(featureTable) {\n  const featureTableJson = featureTable.json;\n  if (defined(featureTableJson.BATCH_ID)) {\n    const batchIds = featureTable.getPropertyArray(\n      \"BATCH_ID\",\n      ComponentDatatype.UNSIGNED_SHORT,\n      1\n    );\n    return {\n      name: VertexAttributeSemantic.FEATURE_ID,\n      semantic: VertexAttributeSemantic.FEATURE_ID,\n      setIndex: 0,\n      typedArray: batchIds,\n      componentDatatype: ComponentDatatype.fromTypedArray(batchIds),\n      type: AttributeType.SCALAR,\n    };\n  }\n\n  return undefined;\n}\n\nexport default PntsParser;\n", "import BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Cartographic from \"../../Core/Cartographic.js\";\nimport Check from \"../../Core/Check.js\";\nimport Credit from \"../../Core/Credit.js\";\nimport Color from \"../../Core/Color.js\";\nimport defined from \"../../Core/defined.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DistanceDisplayCondition from \"../../Core/DistanceDisplayCondition.js\";\nimport Event from \"../../Core/Event.js\";\nimport Matrix3 from \"../../Core/Matrix3.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport Resource from \"../../Core/Resource.js\";\nimport RuntimeError from \"../../Core/RuntimeError.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport ClippingPlaneCollection from \"../ClippingPlaneCollection.js\";\nimport ColorBlendMode from \"../ColorBlendMode.js\";\nimport GltfLoader from \"../GltfLoader.js\";\nimport HeightReference from \"../HeightReference.js\";\nimport ImageBasedLighting from \"../ImageBasedLighting.js\";\nimport PointCloudShading from \"../PointCloudShading.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport SceneTransforms from \"../SceneTransforms.js\";\nimport ShadowMode from \"../ShadowMode.js\";\nimport SplitDirection from \"../SplitDirection.js\";\nimport B3dmLoader from \"./B3dmLoader.js\";\nimport GeoJsonLoader from \"./GeoJsonLoader.js\";\nimport I3dmLoader from \"./I3dmLoader.js\";\nimport ModelAnimationCollection from \"./ModelAnimationCollection.js\";\nimport ModelFeatureTable from \"./ModelFeatureTable.js\";\nimport ModelSceneGraph from \"./ModelSceneGraph.js\";\nimport ModelStatistics from \"./ModelStatistics.js\";\nimport ModelType from \"./ModelType.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport oneTimeWarning from \"../../Core/oneTimeWarning.js\";\nimport PntsLoader from \"./PntsLoader.js\";\nimport StyleCommandsNeeded from \"./StyleCommandsNeeded.js\";\n\n/**\n * <div class=\"notice\">\n * To construct a Model, call {@link Model.fromGltfAsync}. Do not call the constructor directly.\n * </div>\n * A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL.\n * <p>\n * Cesium supports glTF assets with the following extensions:\n * <ul>\n *  <li>\n *  {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations}\n *  </li>\n *  <li>\n *  {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline}\n *  </li>\n *  <li>\n *  {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/CESIUM_RTC/README.md|CESIUM_RTC}\n *  </li>\n *  <li>\n *  {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_instance_features|EXT_instance_features}\n *  </li>\n *  <li>\n *  {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_mesh_features|EXT_mesh_features}\n *  </li>\n *  <li>\n *  {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_mesh_gpu_instancing|EXT_mesh_gpu_instancing}\n *  </li>\n *  <li>\n *  {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_meshopt_compression|EXT_meshopt_compression}\n *  </li>\n *  <li>\n *  {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata}\n *  </li>\n *  <li>\n *  {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_texture_webp|EXT_texture_webp}\n *  </li>\n *  <li>\n *  {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression}\n *  </li>\n *  <li>\n *  {@link https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Archived/KHR_techniques_webgl/README.md|KHR_techniques_webgl}\n *  </li>\n *  <li>\n *  {@link https://github.com/KhronosGroup/glTF/blob/main/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common}\n *  </li>\n *  <li>\n *  {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Archived/KHR_materials_pbrSpecularGlossiness|KHR_materials_pbrSpecularGlossiness}\n *  </li>\n *  <li>\n *  {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit}\n *  </li>\n *  <li>\n *  {@link https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_mesh_quantization|KHR_mesh_quantization}\n *  </li>\n *  <li>\n *  {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_basisu|KHR_texture_basisu}\n *  </li>\n *  <li>\n *  {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform}\n *  </li>\n *  <li>\n *  {@link https://github.com/KhronosGroup/glTF/blob/main/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes}\n *  </li>\n * </ul>\n * </p>\n * <p>\n * Note: for models with compressed textures using the KHR_texture_basisu extension, we recommend power of 2 textures in both dimensions\n * for maximum compatibility. This is because some samplers require power of 2 textures ({@link https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL|Using textures in WebGL})\n * and KHR_texture_basisu requires multiple of 4 dimensions ({@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_basisu/README.md#additional-requirements|KHR_texture_basisu additional requirements}).\n * </p>\n *\n * @alias Model\n * @internalConstructor\n *\n * @privateParam {ResourceLoader} options.loader The loader used to load resources for this model.\n * @privateParam {ModelType} options.type Type of this model, to distinguish individual glTF files from 3D Tiles internally. \n * @privateParam {object} options Object with the following properties:\n * @privateParam {Resource} options.resource The Resource to the 3D model.\n * @privateParam {boolean} [options.show=true] Whether or not to render the model.\n * @privateParam {Matrix4} [options.modelMatrix=Matrix4.IDENTITY]  The 4x4 transformation matrix that transforms the model from model to world coordinates.\n * @privateParam {number} [options.scale=1.0] A uniform scale applied to this model.\n * @privateParam {number} [options.minimumPixelSize=0.0] The approximate minimum pixel size of the model regardless of zoom.\n * @privateParam {number} [options.maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize.\n * @privateParam {object} [options.id] A user-defined object to return when the model is picked with {@link Scene#pick}.\n * @privateParam {boolean} [options.allowPicking=true] When <code>true</code>, each primitive is pickable with {@link Scene#pick}.\n * @privateParam {boolean} [options.clampAnimations=true] Determines if the model's animations should hold a pose over frames where no keyframes are specified.\n * @privateParam {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the model casts or receives shadows from light sources.\n * @privateParam {boolean} [options.debugShowBoundingVolume=false] For debugging only. Draws the bounding sphere for each draw command in the model.\n * @privateParam {boolean} [options.enableDebugWireframe=false] For debugging only. This must be set to true for debugWireframe to work in WebGL1. This cannot be set after the model has loaded.\n * @privateParam {boolean} [options.debugWireframe=false] For debugging only. Draws the model in wireframe. Will only work for WebGL1 if enableDebugWireframe is set to true.\n * @privateParam {boolean} [options.cull=true]  Whether or not to cull the model using frustum/horizon culling. If the model is part of a 3D Tiles tileset, this property will always be false, since the 3D Tiles culling system is used.\n * @privateParam {boolean} [options.opaquePass=Pass.OPAQUE] The pass to use in the {@link DrawCommand} for the opaque portions of the model.\n * @privateParam {CustomShader} [options.customShader] A custom shader. This will add user-defined GLSL code to the vertex and fragment shaders. Using custom shaders with a {@link Cesium3DTileStyle} may lead to undefined behavior.\n * @privateParam {Cesium3DTileContent} [options.content] The tile content this model belongs to. This property will be undefined if model is not loaded as part of a tileset.\n * @privateParam {HeightReference} [options.heightReference=HeightReference.NONE] Determines how the model is drawn relative to terrain.\n * @privateParam {Scene} [options.scene] Must be passed in for models that use the height reference property.\n * @privateParam {DistanceDisplayCondition} [options.distanceDisplayCondition] The condition specifying at what distance from the camera that this model will be displayed.\n * @privateParam {Color} [options.color] A color that blends with the model's rendered color.\n * @privateParam {ColorBlendMode} [options.colorBlendMode=ColorBlendMode.HIGHLIGHT] Defines how the color blends with the model.\n * @privateParam {number} [options.colorBlendAmount=0.5] Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.\n * @privateParam {Color} [options.silhouetteColor=Color.RED] The silhouette color. If more than 256 models have silhouettes enabled, there is a small chance that overlapping models will have minor artifacts.\n * @privateParam {number} [options.silhouetteSize=0.0] The size of the silhouette in pixels.\n * @privateParam {boolean} [options.enableShowOutline=true] Whether to enable outlines for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set to false to avoid the additional processing of geometry at load time. When false, the showOutlines and outlineColor options are ignored.\n * @privateParam {boolean} [options.showOutline=true] Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed.\n * @privateParam {Color} [options.outlineColor=Color.BLACK] The color to use when rendering outlines.\n * @privateParam {ClippingPlaneCollection} [options.clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the model.\n * @privateParam {Cartesian3} [options.lightColor] The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.\n * @privateParam {ImageBasedLighting} [options.imageBasedLighting] The properties for managing image-based lighting on this model.\n * @privateParam {boolean} [options.backFaceCulling=true] Whether to cull back-facing geometry. When true, back face culling is determined by the material's doubleSided property; when false, back face culling is disabled. Back faces are not culled if the model's color is translucent.\n * @privateParam {Credit|string} [options.credit] A credit for the data source, which is displayed on the canvas.\n * @privateParam {boolean} [options.showCreditsOnScreen=false] Whether to display the credits of this model on screen.\n * @privateParam {SplitDirection} [options.splitDirection=SplitDirection.NONE] The {@link SplitDirection} split to apply to this model.\n * @privateParam {boolean} [options.projectTo2D=false] Whether to accurately project the model's positions in 2D. If this is true, the model will be projected accurately to 2D, but it will use more memory to do so. If this is false, the model will use less memory and will still render in 2D / CV mode, but its positions may be inaccurate. This disables minimumPixelSize and prevents future modification to the model matrix. This also cannot be set after the model has loaded.\n * @privateParam {string|number} [options.featureIdLabel=\"featureId_0\"] Label of the feature ID set to use for picking and styling. For EXT_mesh_features, this is the feature ID's label property, or \"featureId_N\" (where N is the index in the featureIds array) when not specified. EXT_feature_metadata did not have a label field, so such feature ID sets are always labeled \"featureId_N\" where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string \"featureId_N\" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.\n * @privateParam {string|number} [options.instanceFeatureIdLabel=\"instanceFeatureId_0\"] Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string \"instanceFeatureId_N\" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.\n * @privateParam {object} [options.pointCloudShading] Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.\n * @privateParam {ClassificationType} [options.classificationType] Determines whether terrain, 3D Tiles or both will be classified by this model. This cannot be set after the model has loaded.\n \n *\n * @see Model.fromGltfAsync\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=3D%20Models.html|Cesium Sandcastle Models Demo}\n */\nfunction Model(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.loader\", options.loader);\n  Check.typeOf.object(\"options.resource\", options.resource);\n  //>>includeEnd('debug');\n\n  /**\n   * The loader used to load resources for this model.\n   *\n   * @type {ResourceLoader}\n   * @private\n   */\n  this._loader = options.loader;\n  this._resource = options.resource;\n\n  /**\n   * Type of this model, to distinguish individual glTF files from 3D Tiles\n   * internally.\n   *\n   * @type {ModelType}\n   * @readonly\n   *\n   * @private\n   */\n  this.type = defaultValue(options.type, ModelType.GLTF);\n\n  /**\n   * The 4x4 transformation matrix that transforms the model from model to world coordinates.\n   * When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's Cartesian WGS84 coordinates.\n   * Local reference frames can be used by providing a different transformation matrix, like that returned\n   * by {@link Transforms.eastNorthUpToFixedFrame}.\n   * \n   * @type {Matrix4}\n\n   * @default {@link Matrix4.IDENTITY}\n   *\n   * @example\n   * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);\n   * m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);\n   */\n  this.modelMatrix = Matrix4.clone(\n    defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n  );\n  this._modelMatrix = Matrix4.clone(this.modelMatrix);\n  this._scale = defaultValue(options.scale, 1.0);\n\n  this._minimumPixelSize = defaultValue(options.minimumPixelSize, 0.0);\n\n  this._maximumScale = options.maximumScale;\n\n  /**\n   * The scale value after being clamped by the maximum scale parameter.\n   * Used to adjust bounding spheres without repeated calculation.\n   *\n   * @type {number}\n   * @private\n   */\n  this._clampedScale = defined(this._maximumScale)\n    ? Math.min(this._scale, this._maximumScale)\n    : this._scale;\n\n  this._computedScale = this._clampedScale;\n\n  /**\n   * Whether or not the ModelSceneGraph should call updateModelMatrix.\n   * This will be true if any of the model matrix, scale, minimum pixel size, or maximum scale are dirty.\n   *\n   * @type {number}\n   * @private\n   */\n  this._updateModelMatrix = false;\n\n  /**\n   * If defined, this matrix is used to transform miscellaneous properties like\n   * clipping planes and image-based lighting instead of the modelMatrix. This is\n   * so that when models are part of a tileset, these properties get transformed\n   * relative to a common reference (such as the root).\n   *\n   * @type {Matrix4}\n   * @private\n   */\n  this.referenceMatrix = undefined;\n  this._iblReferenceFrameMatrix = Matrix3.clone(Matrix3.IDENTITY); // Derived from reference matrix and the current view matrix\n\n  this._resourcesLoaded = false;\n  this._drawCommandsBuilt = false;\n\n  this._ready = false;\n  this._customShader = options.customShader;\n  this._content = options.content;\n\n  this._texturesLoaded = false;\n  this._defaultTexture = undefined;\n\n  this._activeAnimations = new ModelAnimationCollection(this);\n  this._clampAnimations = defaultValue(options.clampAnimations, true);\n\n  // This flag is true when the Cesium API, not a glTF animation, changes\n  // the transform of a node in the model.\n  this._userAnimationDirty = false;\n\n  this._id = options.id;\n  this._idDirty = false;\n\n  this._color = Color.clone(options.color);\n  this._colorBlendMode = defaultValue(\n    options.colorBlendMode,\n    ColorBlendMode.HIGHLIGHT\n  );\n  this._colorBlendAmount = defaultValue(options.colorBlendAmount, 0.5);\n\n  const silhouetteColor = defaultValue(options.silhouetteColor, Color.RED);\n  this._silhouetteColor = Color.clone(silhouetteColor);\n  this._silhouetteSize = defaultValue(options.silhouetteSize, 0.0);\n  this._silhouetteDirty = false;\n\n  // If silhouettes are used for the model, this will be set to the number\n  // of the stencil buffer used for rendering the silhouette. This is set\n  // by ModelSilhouettePipelineStage, not by Model itself.\n  this._silhouetteId = undefined;\n\n  this._cull = defaultValue(options.cull, true);\n  this._opaquePass = defaultValue(options.opaquePass, Pass.OPAQUE);\n  this._allowPicking = defaultValue(options.allowPicking, true);\n  this._show = defaultValue(options.show, true);\n\n  this._style = undefined;\n  this._styleDirty = false;\n  this._styleCommandsNeeded = undefined;\n\n  let featureIdLabel = defaultValue(options.featureIdLabel, \"featureId_0\");\n  if (typeof featureIdLabel === \"number\") {\n    featureIdLabel = `featureId_${featureIdLabel}`;\n  }\n  this._featureIdLabel = featureIdLabel;\n\n  let instanceFeatureIdLabel = defaultValue(\n    options.instanceFeatureIdLabel,\n    \"instanceFeatureId_0\"\n  );\n  if (typeof instanceFeatureIdLabel === \"number\") {\n    instanceFeatureIdLabel = `instanceFeatureId_${instanceFeatureIdLabel}`;\n  }\n  this._instanceFeatureIdLabel = instanceFeatureIdLabel;\n\n  this._featureTables = [];\n  this._featureTableId = undefined;\n  this._featureTableIdDirty = true;\n\n  // Keeps track of resources that need to be destroyed when the draw commands are reset.\n  this._pipelineResources = [];\n\n  // Keeps track of resources that need to be destroyed when the Model is destroyed.\n  this._modelResources = [];\n\n  // Keeps track of the pick IDs for this model. These are stored and destroyed in the\n  // pipeline resources array; the purpose of this array is to separate them from other\n  // resources and update their ID objects when necessary.\n  this._pickIds = [];\n\n  // The model's bounding sphere and its initial radius are computed\n  // in ModelSceneGraph.\n  this._boundingSphere = new BoundingSphere();\n  this._initialRadius = undefined;\n\n  this._heightReference = defaultValue(\n    options.heightReference,\n    HeightReference.NONE\n  );\n  this._heightDirty = this._heightReference !== HeightReference.NONE;\n  this._removeUpdateHeightCallback = undefined;\n\n  this._verticalExaggerationOn = false;\n\n  this._clampedModelMatrix = undefined; // For use with height reference\n\n  const scene = options.scene;\n  if (defined(scene) && defined(scene.terrainProviderChanged)) {\n    this._terrainProviderChangedCallback = scene.terrainProviderChanged.addEventListener(\n      function () {\n        this._heightDirty = true;\n      },\n      this\n    );\n  }\n  this._scene = scene;\n\n  this._distanceDisplayCondition = options.distanceDisplayCondition;\n\n  const pointCloudShading = new PointCloudShading(options.pointCloudShading);\n  this._pointCloudShading = pointCloudShading;\n  this._attenuation = pointCloudShading.attenuation;\n  this._pointCloudBackFaceCulling = pointCloudShading.backFaceCulling;\n\n  // If the given clipping planes don't have an owner, make this model its owner.\n  // Otherwise, the clipping planes are passed down from a tileset.\n  const clippingPlanes = options.clippingPlanes;\n  if (defined(clippingPlanes) && clippingPlanes.owner === undefined) {\n    ClippingPlaneCollection.setOwner(clippingPlanes, this, \"_clippingPlanes\");\n  } else {\n    this._clippingPlanes = clippingPlanes;\n  }\n  this._clippingPlanesState = 0; // If this value changes, the shaders need to be regenerated.\n  this._clippingPlanesMatrix = Matrix4.clone(Matrix4.IDENTITY); // Derived from reference matrix and the current view matrix\n\n  this._lightColor = Cartesian3.clone(options.lightColor);\n\n  this._imageBasedLighting = defined(options.imageBasedLighting)\n    ? options.imageBasedLighting\n    : new ImageBasedLighting();\n  this._shouldDestroyImageBasedLighting = !defined(options.imageBasedLighting);\n\n  this._backFaceCulling = defaultValue(options.backFaceCulling, true);\n  this._backFaceCullingDirty = false;\n\n  this._shadows = defaultValue(options.shadows, ShadowMode.ENABLED);\n  this._shadowsDirty = false;\n\n  this._debugShowBoundingVolumeDirty = false;\n  this._debugShowBoundingVolume = defaultValue(\n    options.debugShowBoundingVolume,\n    false\n  );\n\n  this._enableDebugWireframe = defaultValue(\n    options.enableDebugWireframe,\n    false\n  );\n  this._enableShowOutline = defaultValue(options.enableShowOutline, true);\n  this._debugWireframe = defaultValue(options.debugWireframe, false);\n\n  // Warning for improper setup of debug wireframe\n  if (\n    this._debugWireframe === true &&\n    this._enableDebugWireframe === false &&\n    this.type === ModelType.GLTF\n  ) {\n    oneTimeWarning(\n      \"model-debug-wireframe-ignored\",\n      \"enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.\"\n    );\n  }\n\n  // Credit specified by the user.\n  let credit = options.credit;\n  if (typeof credit === \"string\") {\n    credit = new Credit(credit);\n  }\n\n  this._credits = [];\n  this._credit = credit;\n\n  // Credits to be added from the Resource (if it is an IonResource)\n  this._resourceCredits = [];\n\n  // Credits parsed from the glTF by GltfLoader.\n  this._gltfCredits = [];\n\n  this._showCreditsOnScreen = defaultValue(options.showCreditsOnScreen, false);\n  this._showCreditsOnScreenDirty = true;\n\n  this._splitDirection = defaultValue(\n    options.splitDirection,\n    SplitDirection.NONE\n  );\n\n  this._enableShowOutline = defaultValue(options.enableShowOutline, true);\n\n  /**\n   * Whether to display the outline for models using the\n   * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension.\n   * When true, outlines are displayed. When false, outlines are not displayed.\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  this.showOutline = defaultValue(options.showOutline, true);\n\n  /**\n   * The color to use when rendering outlines.\n   *\n   * @type {Color}\n   *\n   * @default Color.BLACK\n   */\n  this.outlineColor = defaultValue(options.outlineColor, Color.BLACK);\n\n  this._classificationType = options.classificationType;\n\n  this._statistics = new ModelStatistics();\n\n  this._sceneMode = undefined;\n  this._projectTo2D = defaultValue(options.projectTo2D, false);\n\n  this._skipLevelOfDetail = false;\n  this._ignoreCommands = defaultValue(options.ignoreCommands, false);\n\n  this._errorEvent = new Event();\n  this._readyEvent = new Event();\n  this._texturesReadyEvent = new Event();\n\n  this._sceneGraph = undefined;\n  this._nodesByName = {}; // Stores the nodes by their names in the glTF.\n\n  /**\n   * Used for picking primitives that wrap a model.\n   *\n   * @private\n   */\n  this.pickObject = options.pickObject;\n}\n\nfunction handleError(model, error) {\n  if (model._errorEvent.numberOfListeners > 0) {\n    model._errorEvent.raiseEvent(error);\n    return;\n  }\n\n  console.log(error);\n}\n\nfunction createModelFeatureTables(model, structuralMetadata) {\n  const featureTables = model._featureTables;\n\n  const propertyTables = structuralMetadata.propertyTables;\n  const length = propertyTables.length;\n  for (let i = 0; i < length; i++) {\n    const propertyTable = propertyTables[i];\n    const modelFeatureTable = new ModelFeatureTable({\n      model: model,\n      propertyTable: propertyTable,\n    });\n\n    featureTables.push(modelFeatureTable);\n  }\n\n  return featureTables;\n}\n\nfunction selectFeatureTableId(components, model) {\n  const featureIdLabel = model._featureIdLabel;\n  const instanceFeatureIdLabel = model._instanceFeatureIdLabel;\n\n  let i, j;\n  let featureIdAttribute;\n\n  let node;\n  // Scan the nodes till we find one with instances, get the feature table ID\n  // if the feature ID attribute of the user-selected index is present.\n  for (i = 0; i < components.nodes.length; i++) {\n    node = components.nodes[i];\n    if (defined(node.instances)) {\n      featureIdAttribute = ModelUtility.getFeatureIdsByLabel(\n        node.instances.featureIds,\n        instanceFeatureIdLabel\n      );\n      if (\n        defined(featureIdAttribute) &&\n        defined(featureIdAttribute.propertyTableId)\n      ) {\n        return featureIdAttribute.propertyTableId;\n      }\n    }\n  }\n\n  // Scan the primitives till we find one with textures or attributes, get the feature table ID\n  // if the feature ID attribute/texture of the user-selected index is present.\n  for (i = 0; i < components.nodes.length; i++) {\n    node = components.nodes[i];\n    for (j = 0; j < node.primitives.length; j++) {\n      const primitive = node.primitives[j];\n      const featureIds = ModelUtility.getFeatureIdsByLabel(\n        primitive.featureIds,\n        featureIdLabel\n      );\n\n      if (defined(featureIds)) {\n        return featureIds.propertyTableId;\n      }\n    }\n  }\n\n  // If there's only one feature table, then select it by default. This is\n  // to ensure backwards compatibility with the older handling of b3dm models.\n  if (model._featureTables.length === 1) {\n    return 0;\n  }\n}\n\n/**\n *  Returns whether the alpha state has changed between invisible,\n *  translucent, or opaque.\n *\n *  @private\n */\nfunction isColorAlphaDirty(currentColor, previousColor) {\n  if (!defined(currentColor) && !defined(previousColor)) {\n    return false;\n  }\n\n  if (defined(currentColor) !== defined(previousColor)) {\n    return true;\n  }\n\n  const currentAlpha = currentColor.alpha;\n  const previousAlpha = previousColor.alpha;\n  return (\n    Math.floor(currentAlpha) !== Math.floor(previousAlpha) ||\n    Math.ceil(currentAlpha) !== Math.ceil(previousAlpha)\n  );\n}\n\nObject.defineProperties(Model.prototype, {\n  /**\n   * When <code>true</code>, this model is ready to render, i.e., the external binary, image,\n   * and shader files were downloaded and the WebGL resources were created.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the model encounters an asynchronous rendering error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link ModelError}.\n   * @memberof Model.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the model is loaded and ready for rendering, i.e. when the external resources\n   * have been downloaded and the WebGL resources are created. Event listeners\n   * are passed an instance of the {@link Model}.\n   *\n   * <p>\n   * If {@link Model.incrementallyLoadTextures} is true, this event will be raised before all textures are loaded and ready for rendering. Subscribe to {@link Model.texturesReadyEvent} to be notified when the textures are ready.\n   * </p>\n   *\n   * @memberof Model.prototype\n   * @type {Event}\n   * @readonly\n   */\n  readyEvent: {\n    get: function () {\n      return this._readyEvent;\n    },\n  },\n\n  /**\n   * Returns true if textures are loaded separately from the other glTF resources.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  incrementallyLoadTextures: {\n    get: function () {\n      return defaultValue(this._loader.incrementallyLoadTextures, false);\n    },\n  },\n\n  /**\n   * Gets an event that, if {@link Model.incrementallyLoadTextures} is true, is raised when the model textures are loaded and ready for rendering, i.e. when the external resources\n   * have been downloaded and the WebGL resources are created. Event listeners\n   * are passed an instance of the {@link Model}.\n   *\n   * @memberof Model.prototype\n   * @type {Event}\n   * @readonly\n   */\n  texturesReadyEvent: {\n    get: function () {\n      return this._texturesReadyEvent;\n    },\n  },\n\n  /**\n   * @private\n   */\n  loader: {\n    get: function () {\n      return this._loader;\n    },\n  },\n\n  /**\n   * Get the estimated memory usage statistics for this model.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {ModelStatistics}\n   * @readonly\n   *\n   * @private\n   */\n  statistics: {\n    get: function () {\n      return this._statistics;\n    },\n  },\n\n  /**\n   * The currently playing glTF animations.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {ModelAnimationCollection}\n   * @readonly\n   */\n  activeAnimations: {\n    get: function () {\n      return this._activeAnimations;\n    },\n  },\n\n  /**\n   * Determines if the model's animations should hold a pose over frames where no keyframes are specified.\n   *\n   * @memberof Model.prototype\n   * @type {boolean}\n   *\n   * @default true\n   */\n  clampAnimations: {\n    get: function () {\n      return this._clampAnimations;\n    },\n    set: function (value) {\n      this._clampAnimations = value;\n    },\n  },\n\n  /**\n   * Whether or not to cull the model using frustum/horizon culling. If the model is part of a 3D Tiles tileset, this property\n   * will always be false, since the 3D Tiles culling system is used.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  cull: {\n    get: function () {\n      return this._cull;\n    },\n  },\n\n  /**\n   * The pass to use in the {@link DrawCommand} for the opaque portions of the model.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {Pass}\n   * @readonly\n   *\n   * @private\n   */\n  opaquePass: {\n    get: function () {\n      return this._opaquePass;\n    },\n  },\n\n  /**\n   * Point cloud shading settings for controlling point cloud attenuation\n   * and lighting. For 3D Tiles, this is inherited from the\n   * {@link Cesium3DTileset}.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {PointCloudShading}\n   */\n  pointCloudShading: {\n    get: function () {\n      return this._pointCloudShading;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"pointCloudShading\", value);\n      //>>includeEnd('debug');\n      if (value !== this._pointCloudShading) {\n        this.resetDrawCommands();\n      }\n      this._pointCloudShading = value;\n    },\n  },\n\n  /**\n   * The model's custom shader, if it exists. Using custom shaders with a {@link Cesium3DTileStyle}\n   * may lead to undefined behavior.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {CustomShader}\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  customShader: {\n    get: function () {\n      return this._customShader;\n    },\n    set: function (value) {\n      if (value !== this._customShader) {\n        this.resetDrawCommands();\n      }\n      this._customShader = value;\n    },\n  },\n\n  /**\n   * The scene graph of this model.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {ModelSceneGraph}\n   * @private\n   */\n  sceneGraph: {\n    get: function () {\n      return this._sceneGraph;\n    },\n  },\n\n  /**\n   * The tile content this model belongs to, if it is loaded as part of a {@link Cesium3DTileset}.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {Cesium3DTileContent}\n   * @readonly\n   *\n   * @private\n   */\n  content: {\n    get: function () {\n      return this._content;\n    },\n  },\n\n  /**\n   * The height reference of the model, which determines how the model is drawn\n   * relative to terrain.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {HeightReference}\n   * @default {HeightReference.NONE}\n   *\n   */\n  heightReference: {\n    get: function () {\n      return this._heightReference;\n    },\n    set: function (value) {\n      if (value !== this._heightReference) {\n        this._heightDirty = true;\n      }\n      this._heightReference = value;\n    },\n  },\n\n  /**\n   * Gets or sets the distance display condition, which specifies at what distance\n   * from the camera this model will be displayed.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {DistanceDisplayCondition}\n   *\n   * @default undefined\n   *\n   */\n  distanceDisplayCondition: {\n    get: function () {\n      return this._distanceDisplayCondition;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value) && value.far <= value.near) {\n        throw new DeveloperError(\"far must be greater than near\");\n      }\n      //>>includeEnd('debug');\n      this._distanceDisplayCondition = DistanceDisplayCondition.clone(\n        value,\n        this._distanceDisplayCondition\n      );\n    },\n  },\n\n  /**\n   * The structural metadata from the EXT_structural_metadata extension\n   *\n   * @memberof Model.prototype\n   *\n   * @type {StructuralMetadata}\n   * @readonly\n   *\n   * @private\n   */\n  structuralMetadata: {\n    get: function () {\n      return this._sceneGraph.components.structuralMetadata;\n    },\n  },\n\n  /**\n   * The ID for the feature table to use for picking and styling in this model.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {number}\n   *\n   * @private\n   */\n  featureTableId: {\n    get: function () {\n      return this._featureTableId;\n    },\n    set: function (value) {\n      this._featureTableId = value;\n    },\n  },\n\n  /**\n   * The feature tables for this model.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {Array}\n   * @readonly\n   *\n   * @private\n   */\n  featureTables: {\n    get: function () {\n      return this._featureTables;\n    },\n    set: function (value) {\n      this._featureTables = value;\n    },\n  },\n\n  /**\n   * A user-defined object that is returned when the model is picked.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {object}\n   *\n   * @default undefined\n   *\n   * @see Scene#pick\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n    set: function (value) {\n      if (value !== this._id) {\n        this._idDirty = true;\n      }\n\n      this._id = value;\n    },\n  },\n\n  /**\n   * When <code>true</code>, each primitive is pickable with {@link Scene#pick}.  When <code>false</code>, GPU memory is saved.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  allowPicking: {\n    get: function () {\n      return this._allowPicking;\n    },\n  },\n\n  /**\n   * The style to apply to the features in the model. Cannot be applied if a {@link CustomShader} is also applied.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {Cesium3DTileStyle}\n   */\n  style: {\n    get: function () {\n      return this._style;\n    },\n    set: function (value) {\n      this._style = value;\n      this._styleDirty = true;\n    },\n  },\n\n  /**\n   * The color to blend with the model's rendered color.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {Color}\n   *\n   * @default undefined\n   */\n  color: {\n    get: function () {\n      return this._color;\n    },\n    set: function (value) {\n      if (isColorAlphaDirty(value, this._color)) {\n        this.resetDrawCommands();\n      }\n      this._color = Color.clone(value, this._color);\n    },\n  },\n\n  /**\n   * Defines how the color blends with the model.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {Cesium3DTileColorBlendMode|ColorBlendMode}\n   *\n   * @default ColorBlendMode.HIGHLIGHT\n   */\n  colorBlendMode: {\n    get: function () {\n      return this._colorBlendMode;\n    },\n    set: function (value) {\n      this._colorBlendMode = value;\n    },\n  },\n\n  /**\n   * Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {number}\n   *\n   * @default 0.5\n   */\n  colorBlendAmount: {\n    get: function () {\n      return this._colorBlendAmount;\n    },\n    set: function (value) {\n      this._colorBlendAmount = value;\n    },\n  },\n\n  /**\n   * The silhouette color.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {Color}\n   *\n   * @default Color.RED\n   */\n  silhouetteColor: {\n    get: function () {\n      return this._silhouetteColor;\n    },\n    set: function (value) {\n      if (!Color.equals(value, this._silhouetteColor)) {\n        const alphaDirty = isColorAlphaDirty(value, this._silhouetteColor);\n        this._silhouetteDirty = this._silhouetteDirty || alphaDirty;\n      }\n\n      this._silhouetteColor = Color.clone(value, this._silhouetteColor);\n    },\n  },\n\n  /**\n   * The size of the silhouette in pixels.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {number}\n   *\n   * @default 0.0\n   */\n  silhouetteSize: {\n    get: function () {\n      return this._silhouetteSize;\n    },\n    set: function (value) {\n      if (value !== this._silhouetteSize) {\n        const currentSize = this._silhouetteSize;\n        const sizeDirty =\n          (value > 0.0 && currentSize === 0.0) ||\n          (value === 0.0 && currentSize > 0.0);\n        this._silhouetteDirty = this._silhouetteDirty || sizeDirty;\n\n        // Back-face culling needs to be updated in case the silhouette size\n        // is greater than zero.\n        this._backFaceCullingDirty = this._backFaceCullingDirty || sizeDirty;\n      }\n\n      this._silhouetteSize = value;\n    },\n  },\n\n  /**\n   * Gets the model's bounding sphere in world space. This does not take into account\n   * glTF animations, skins, or morph targets. It also does not account for\n   * {@link Model#minimumPixelSize}.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {BoundingSphere}\n   * @readonly\n   */\n  boundingSphere: {\n    get: function () {\n      //>>includeStart('debug', pragmas.debug);\n      if (!this._ready) {\n        throw new DeveloperError(\n          \"The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.\"\n        );\n      }\n      //>>includeEnd('debug');\n\n      const modelMatrix = defined(this._clampedModelMatrix)\n        ? this._clampedModelMatrix\n        : this.modelMatrix;\n      updateBoundingSphere(this, modelMatrix);\n\n      return this._boundingSphere;\n    },\n  },\n\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the bounding sphere for each draw command in the model.\n   * </p>\n   *\n   * @memberof Model.prototype\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  debugShowBoundingVolume: {\n    get: function () {\n      return this._debugShowBoundingVolume;\n    },\n    set: function (value) {\n      if (this._debugShowBoundingVolume !== value) {\n        this._debugShowBoundingVolumeDirty = true;\n      }\n      this._debugShowBoundingVolume = value;\n    },\n  },\n\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the model in wireframe.\n   * </p>\n   *\n   * @memberof Model.prototype\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  debugWireframe: {\n    get: function () {\n      return this._debugWireframe;\n    },\n    set: function (value) {\n      if (this._debugWireframe !== value) {\n        this.resetDrawCommands();\n      }\n      this._debugWireframe = value;\n\n      // Warning for improper setup of debug wireframe\n      if (\n        this._debugWireframe === true &&\n        this._enableDebugWireframe === false &&\n        this.type === ModelType.GLTF\n      ) {\n        oneTimeWarning(\n          \"model-debug-wireframe-ignored\",\n          \"enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.\"\n        );\n      }\n    },\n  },\n\n  /**\n   * Whether or not to render the model.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  show: {\n    get: function () {\n      return this._show;\n    },\n    set: function (value) {\n      this._show = value;\n    },\n  },\n\n  /**\n   * Label of the feature ID set to use for picking and styling.\n   * <p>\n   * For EXT_mesh_features, this is the feature ID's label property, or\n   * \"featureId_N\" (where N is the index in the featureIds array) when not\n   * specified. EXT_feature_metadata did not have a label field, so such\n   * feature ID sets are always labeled \"featureId_N\" where N is the index in\n   * the list of all feature Ids, where feature ID attributes are listed before\n   * feature ID textures.\n   * </p>\n   * <p>\n   * If featureIdLabel is set to an integer N, it is converted to\n   * the string \"featureId_N\" automatically. If both per-primitive and\n   * per-instance feature IDs are present, the instance feature IDs take\n   * priority.\n   * </p>\n   *\n   * @memberof Model.prototype\n   *\n   * @type {string}\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  featureIdLabel: {\n    get: function () {\n      return this._featureIdLabel;\n    },\n    set: function (value) {\n      // indices get converted into featureId_N\n      if (typeof value === \"number\") {\n        value = `featureId_${value}`;\n      }\n\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.string(\"value\", value);\n      //>>includeEnd('debug');\n\n      if (value !== this._featureIdLabel) {\n        this._featureTableIdDirty = true;\n      }\n\n      this._featureIdLabel = value;\n    },\n  },\n\n  /**\n   * Label of the instance feature ID set used for picking and styling.\n   * <p>\n   * If instanceFeatureIdLabel is set to an integer N, it is converted to\n   * the string \"instanceFeatureId_N\" automatically.\n   * If both per-primitive and per-instance feature IDs are present, the\n   * instance feature IDs take priority.\n   * </p>\n   *\n   * @memberof Model.prototype\n   *\n   * @type {string}\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  instanceFeatureIdLabel: {\n    get: function () {\n      return this._instanceFeatureIdLabel;\n    },\n    set: function (value) {\n      // indices get converted into instanceFeatureId_N\n      if (typeof value === \"number\") {\n        value = `instanceFeatureId_${value}`;\n      }\n\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.string(\"value\", value);\n      //>>includeEnd('debug');\n\n      if (value !== this._instanceFeatureIdLabel) {\n        this._featureTableIdDirty = true;\n      }\n\n      this._instanceFeatureIdLabel = value;\n    },\n  },\n\n  /**\n   * The {@link ClippingPlaneCollection} used to selectively disable rendering the model.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {ClippingPlaneCollection}\n   */\n  clippingPlanes: {\n    get: function () {\n      return this._clippingPlanes;\n    },\n    set: function (value) {\n      if (value !== this._clippingPlanes) {\n        // Handle destroying old clipping planes, new clipping planes ownership\n        ClippingPlaneCollection.setOwner(value, this, \"_clippingPlanes\");\n        this.resetDrawCommands();\n      }\n    },\n  },\n\n  /**\n   * The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.\n   * <p>\n   * Disabling additional light sources by setting\n   * <code>model.imageBasedLighting.imageBasedLightingFactor = new Cartesian2(0.0, 0.0)</code>\n   * will make the model much darker. Here, increasing the intensity of the light source will make the model brighter.\n   * </p>\n   * @memberof Model.prototype\n   *\n   * @type {Cartesian3}\n   *\n   * @default undefined\n   */\n  lightColor: {\n    get: function () {\n      return this._lightColor;\n    },\n    set: function (value) {\n      if (defined(value) !== defined(this._lightColor)) {\n        this.resetDrawCommands();\n      }\n\n      this._lightColor = Cartesian3.clone(value, this._lightColor);\n    },\n  },\n\n  /**\n   * The properties for managing image-based lighting on this model.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {ImageBasedLighting}\n   */\n  imageBasedLighting: {\n    get: function () {\n      return this._imageBasedLighting;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.object(\"imageBasedLighting\", this._imageBasedLighting);\n      //>>includeEnd('debug');\n\n      if (value !== this._imageBasedLighting) {\n        if (\n          this._shouldDestroyImageBasedLighting &&\n          !this._imageBasedLighting.isDestroyed()\n        ) {\n          this._imageBasedLighting.destroy();\n        }\n        this._imageBasedLighting = value;\n        this._shouldDestroyImageBasedLighting = false;\n        this.resetDrawCommands();\n      }\n    },\n  },\n\n  /**\n   * Whether to cull back-facing geometry. When true, back face culling is\n   * determined by the material's doubleSided property; when false, back face\n   * culling is disabled. Back faces are not culled if {@link Model#color}\n   * is translucent or {@link Model#silhouetteSize} is greater than 0.0.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  backFaceCulling: {\n    get: function () {\n      return this._backFaceCulling;\n    },\n    set: function (value) {\n      if (value !== this._backFaceCulling) {\n        this._backFaceCullingDirty = true;\n      }\n\n      this._backFaceCulling = value;\n    },\n  },\n\n  /**\n   * A uniform scale applied to this model before the {@link Model#modelMatrix}.\n   * Values greater than <code>1.0</code> increase the size of the model; values\n   * less than <code>1.0</code> decrease.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {number}\n   *\n   * @default 1.0\n   */\n  scale: {\n    get: function () {\n      return this._scale;\n    },\n    set: function (value) {\n      if (value !== this._scale) {\n        this._updateModelMatrix = true;\n      }\n      this._scale = value;\n    },\n  },\n\n  /**\n   * The true scale of the model after being affected by the model's scale,\n   * minimum pixel size, and maximum scale parameters.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  computedScale: {\n    get: function () {\n      return this._computedScale;\n    },\n  },\n\n  /**\n   * The approximate minimum pixel size of the model regardless of zoom.\n   * This can be used to ensure that a model is visible even when the viewer\n   * zooms out.  When <code>0.0</code>, no minimum size is enforced.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {number}\n   *\n   * @default 0.0\n   */\n  minimumPixelSize: {\n    get: function () {\n      return this._minimumPixelSize;\n    },\n    set: function (value) {\n      if (value !== this._minimumPixelSize) {\n        this._updateModelMatrix = true;\n      }\n      this._minimumPixelSize = value;\n    },\n  },\n\n  /**\n   * The maximum scale size for a model. This can be used to give\n   * an upper limit to the {@link Model#minimumPixelSize}, ensuring that the model\n   * is never an unreasonable scale.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {number}\n   */\n  maximumScale: {\n    get: function () {\n      return this._maximumScale;\n    },\n    set: function (value) {\n      if (value !== this._maximumScale) {\n        this._updateModelMatrix = true;\n      }\n      this._maximumScale = value;\n    },\n  },\n\n  /**\n   * Determines whether the model casts or receives shadows from light sources.\n\n   * @memberof Model.prototype\n   *\n   * @type {ShadowMode}\n   *\n   * @default ShadowMode.ENABLED\n   */\n  shadows: {\n    get: function () {\n      return this._shadows;\n    },\n    set: function (value) {\n      if (value !== this._shadows) {\n        this._shadowsDirty = true;\n      }\n\n      this._shadows = value;\n    },\n  },\n\n  /**\n   * Gets the credit that will be displayed for the model.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n\n  /**\n   * Gets or sets whether the credits of the model will be displayed\n   * on the screen.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  showCreditsOnScreen: {\n    get: function () {\n      return this._showCreditsOnScreen;\n    },\n    set: function (value) {\n      if (this._showCreditsOnScreen !== value) {\n        this._showCreditsOnScreenDirty = true;\n      }\n\n      this._showCreditsOnScreen = value;\n    },\n  },\n\n  /**\n   * The {@link SplitDirection} to apply to this model.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {SplitDirection}\n   *\n   * @default {@link SplitDirection.NONE}\n   */\n  splitDirection: {\n    get: function () {\n      return this._splitDirection;\n    },\n    set: function (value) {\n      if (this._splitDirection !== value) {\n        this.resetDrawCommands();\n      }\n      this._splitDirection = value;\n    },\n  },\n\n  /**\n   * Gets the model's classification type. This determines whether terrain,\n   * 3D Tiles, or both will be classified by this model.\n   * <p>\n   * Additionally, there are a few requirements/limitations:\n   * <ul>\n   *     <li>The glTF cannot contain morph targets, skins, or animations.</li>\n   *     <li>The glTF cannot contain the <code>EXT_mesh_gpu_instancing</code> extension.</li>\n   *     <li>Only meshes with TRIANGLES can be used to classify other assets.</li>\n   *     <li>The position attribute is required.</li>\n   *     <li>If feature IDs and an index buffer are both present, all indices with the same feature id must occupy contiguous sections of the index buffer.</li>\n   *     <li>If feature IDs are present without an index buffer, all positions with the same feature id must occupy contiguous sections of the position buffer.</li>\n   * </ul>\n   * </p>\n   *\n   * @memberof Model.prototype\n   *\n   * @type {ClassificationType}\n   * @default undefined\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   * @readonly\n   */\n  classificationType: {\n    get: function () {\n      return this._classificationType;\n    },\n  },\n\n  /**\n   * Reference to the pick IDs. This is only used internally, e.g. for\n   * per-feature post-processing in {@link PostProcessStage}.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {PickId[]}\n   * @readonly\n   *\n   * @private\n   */\n  pickIds: {\n    get: function () {\n      return this._pickIds;\n    },\n  },\n\n  /**\n   * The {@link StyleCommandsNeeded} for the style currently applied to\n   * the features in the model. This is used internally by the {@link ModelDrawCommand}\n   * when determining which commands to submit in an update.\n   *\n   * @memberof Model.prototype\n   *\n   * @type {StyleCommandsNeeded}\n   * @readonly\n   *\n   * @private\n   */\n  styleCommandsNeeded: {\n    get: function () {\n      return this._styleCommandsNeeded;\n    },\n  },\n});\n\n/**\n * Returns the node with the given <code>name</code> in the glTF. This is used to\n * modify a node's transform for user-defined animation.\n *\n * @param {string} name The name of the node in the glTF.\n * @returns {ModelNode} The node, or <code>undefined</code> if no node with the <code>name</code> exists.\n *\n * @exception {DeveloperError} The model is not loaded.  Use Model.readyEvent or wait for Model.ready to be true.\n *\n * @example\n * // Apply non-uniform scale to node \"Hand\"\n * const node = model.getNode(\"Hand\");\n * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);\n */\nModel.prototype.getNode = function (name) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!this._ready) {\n    throw new DeveloperError(\n      \"The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.\"\n    );\n  }\n  Check.typeOf.string(\"name\", name);\n  //>>includeEnd('debug');\n\n  return this._nodesByName[name];\n};\n\n/**\n * Sets the current value of an articulation stage.  After setting one or\n * multiple stage values, call Model.applyArticulations() to\n * cause the node matrices to be recalculated.\n *\n * @param {string} articulationStageKey The name of the articulation, a space, and the name of the stage.\n * @param {number} value The numeric value of this stage of the articulation.\n *\n * @exception {DeveloperError} The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.\n *\n * @see Model#applyArticulations\n *\n * @example\n * // Sets the value of the stage named \"MoveX\" belonging to the articulation named \"SampleArticulation\"\n * model.setArticulationStage(\"SampleArticulation MoveX\", 50.0);\n */\nModel.prototype.setArticulationStage = function (articulationStageKey, value) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"value\", value);\n  if (!this._ready) {\n    throw new DeveloperError(\n      \"The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._sceneGraph.setArticulationStage(articulationStageKey, value);\n};\n\n/**\n * Applies any modified articulation stages to the matrix of each node that\n * participates in any articulation. Note that this will overwrite any node\n * transformations on participating nodes.\n *\n * @exception {DeveloperError} The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.\n */\nModel.prototype.applyArticulations = function () {\n  //>>includeStart('debug', pragmas.debug);\n  if (!this._ready) {\n    throw new DeveloperError(\n      \"The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._sceneGraph.applyArticulations();\n};\n\n/**\n * Marks the model's {@link Model#style} as dirty, which forces all features\n * to re-evaluate the style in the next frame the model is visible.\n */\nModel.prototype.makeStyleDirty = function () {\n  this._styleDirty = true;\n};\n\n/**\n * Resets the draw commands for this model.\n *\n * @private\n */\nModel.prototype.resetDrawCommands = function () {\n  this._drawCommandsBuilt = false;\n};\n\nconst scratchIBLReferenceFrameMatrix4 = new Matrix4();\nconst scratchIBLReferenceFrameMatrix3 = new Matrix3();\nconst scratchClippingPlanesMatrix = new Matrix4();\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly.  This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {RuntimeError} Failed to load external reference.\n */\nModel.prototype.update = function (frameState) {\n  let finishedProcessing = false;\n  try {\n    // Keep processing the model every frame until the main resources\n    // (buffer views) and textures (which may be loaded asynchronously)\n    // are processed.\n    finishedProcessing = processLoader(this, frameState);\n  } catch (error) {\n    if (\n      !this._loader.incrementallyLoadTextures &&\n      error.name === \"TextureError\"\n    ) {\n      handleError(this, error);\n    } else {\n      const runtimeError = ModelUtility.getError(\n        \"model\",\n        this._resource,\n        error\n      );\n      handleError(this, runtimeError);\n    }\n  }\n\n  // A custom shader may have to load texture uniforms.\n  updateCustomShader(this, frameState);\n\n  // The image-based lighting may have to load texture uniforms\n  // for specular maps.\n  updateImageBasedLighting(this, frameState);\n\n  if (!this._resourcesLoaded && finishedProcessing) {\n    this._resourcesLoaded = true;\n\n    const components = this._loader.components;\n    if (!defined(components)) {\n      if (this._loader.isUnloaded()) {\n        return;\n      }\n\n      const error = ModelUtility.getError(\n        \"model\",\n        this._resource,\n        new RuntimeError(\"Failed to load model.\")\n      );\n      handleError(error);\n      this._rejectLoad = this._rejectLoad && this._rejectLoad(error);\n    }\n\n    const structuralMetadata = components.structuralMetadata;\n    if (\n      defined(structuralMetadata) &&\n      structuralMetadata.propertyTableCount > 0\n    ) {\n      createModelFeatureTables(this, structuralMetadata);\n    }\n\n    const sceneGraph = new ModelSceneGraph({\n      model: this,\n      modelComponents: components,\n    });\n\n    this._sceneGraph = sceneGraph;\n    this._gltfCredits = sceneGraph.components.asset.credits;\n  }\n\n  // Short-circuit if the model resources aren't ready or the scene\n  // is currently morphing.\n  if (!this._resourcesLoaded || frameState.mode === SceneMode.MORPHING) {\n    return;\n  }\n\n  updateFeatureTableId(this);\n  updateStyle(this);\n  updateFeatureTables(this, frameState);\n  updatePointCloudShading(this);\n  updateSilhouette(this, frameState);\n  updateSkipLevelOfDetail(this, frameState);\n  updateClippingPlanes(this, frameState);\n  updateSceneMode(this, frameState);\n  updateVerticalExaggeration(this, frameState);\n\n  this._defaultTexture = frameState.context.defaultTexture;\n\n  buildDrawCommands(this, frameState);\n  updateModelMatrix(this, frameState);\n\n  // Many features (e.g. image-based lighting, clipping planes) depend on the model\n  // matrix being updated for the current height reference, so update it first.\n  updateClamping(this);\n\n  updateBoundingSphereAndScale(this, frameState);\n  updateReferenceMatrices(this, frameState);\n\n  // This check occurs after the bounding sphere has been updated so that\n  // zooming to the bounding sphere can account for any modifications\n  // from the clamp-to-ground setting.\n  if (!this._ready) {\n    // Set the model as ready after the first frame render since the user might set up events subscribed to\n    // the post render event, and the model may not be ready for those past the first frame.\n    frameState.afterRender.push(() => {\n      this._ready = true;\n      this._readyEvent.raiseEvent(this);\n    });\n\n    // Don't render until the next frame after the ready event has been raised.\n    return;\n  }\n\n  if (\n    this._loader.incrementallyLoadTextures &&\n    !this._texturesLoaded &&\n    this._loader.texturesLoaded\n  ) {\n    // Re-run the pipeline so texture memory statistics are re-computed\n    this.resetDrawCommands();\n\n    this._texturesLoaded = true;\n    this._texturesReadyEvent.raiseEvent(this);\n  }\n\n  updatePickIds(this);\n\n  // Update the scene graph and draw commands for any changes in model's properties\n  // (e.g. model matrix, back-face culling)\n  updateSceneGraph(this, frameState);\n  updateShowCreditsOnScreen(this);\n  submitDrawCommands(this, frameState);\n};\n\nfunction processLoader(model, frameState) {\n  if (\n    !model._resourcesLoaded ||\n    (model._loader.incrementallyLoadTextures && !model._texturesLoaded)\n  ) {\n    // Ensures frames continue to render in requestRender mode while resources are processing\n    frameState.afterRender.push(() => true);\n    return model._loader.process(frameState);\n  }\n\n  return true;\n}\n\nfunction updateCustomShader(model, frameState) {\n  if (defined(model._customShader)) {\n    model._customShader.update(frameState);\n  }\n}\n\nfunction updateImageBasedLighting(model, frameState) {\n  model._imageBasedLighting.update(frameState);\n  if (model._imageBasedLighting.shouldRegenerateShaders) {\n    model.resetDrawCommands();\n  }\n}\n\nfunction updateFeatureTableId(model) {\n  if (!model._featureTableIdDirty) {\n    return;\n  }\n  model._featureTableIdDirty = false;\n\n  const components = model._sceneGraph.components;\n  const structuralMetadata = components.structuralMetadata;\n\n  if (\n    defined(structuralMetadata) &&\n    structuralMetadata.propertyTableCount > 0\n  ) {\n    model.featureTableId = selectFeatureTableId(components, model);\n\n    // Mark the style dirty to re-apply it and reflect the new feature ID table.\n    model._styleDirty = true;\n\n    // Trigger a rebuild of the draw commands.\n    model.resetDrawCommands();\n  }\n}\n\nfunction updateStyle(model) {\n  if (model._styleDirty) {\n    model.applyStyle(model._style);\n    model._styleDirty = false;\n  }\n}\n\nfunction updateFeatureTables(model, frameState) {\n  const featureTables = model._featureTables;\n  const length = featureTables.length;\n\n  let styleCommandsNeededDirty = false;\n  for (let i = 0; i < length; i++) {\n    featureTables[i].update(frameState);\n    // Check if the types of style commands needed have changed and trigger a reset of the draw commands\n    // to ensure that translucent and opaque features are handled in the correct passes.\n    if (featureTables[i].styleCommandsNeededDirty) {\n      styleCommandsNeededDirty = true;\n    }\n  }\n\n  if (styleCommandsNeededDirty) {\n    updateStyleCommandsNeeded(model);\n  }\n}\n\nfunction updateStyleCommandsNeeded(model) {\n  const featureTable = model.featureTables[model.featureTableId];\n  model._styleCommandsNeeded = StyleCommandsNeeded.getStyleCommandsNeeded(\n    featureTable.featuresLength,\n    featureTable.batchTexture.translucentFeaturesLength\n  );\n}\n\nfunction updatePointCloudShading(model) {\n  const pointCloudShading = model.pointCloudShading;\n\n  // Check if the shader needs to be updated for point cloud attenuation\n  // settings.\n  if (pointCloudShading.attenuation !== model._attenuation) {\n    model.resetDrawCommands();\n    model._attenuation = pointCloudShading.attenuation;\n  }\n\n  if (pointCloudShading.backFaceCulling !== model._pointCloudBackFaceCulling) {\n    model.resetDrawCommands();\n    model._pointCloudBackFaceCulling = pointCloudShading.backFaceCulling;\n  }\n}\n\nfunction updateSilhouette(model, frameState) {\n  if (model._silhouetteDirty) {\n    // Only rebuild draw commands if silhouettes are supported in the first place.\n    if (supportsSilhouettes(frameState)) {\n      model.resetDrawCommands();\n    }\n\n    model._silhouetteDirty = false;\n  }\n}\n\nfunction updateSkipLevelOfDetail(model, frameState) {\n  const skipLevelOfDetail = model.hasSkipLevelOfDetail(frameState);\n  if (skipLevelOfDetail !== model._skipLevelOfDetail) {\n    model.resetDrawCommands();\n    model._skipLevelOfDetail = skipLevelOfDetail;\n  }\n}\n\nfunction updateClippingPlanes(model, frameState) {\n  // Update the clipping planes collection / state for this model to detect any changes.\n  let currentClippingPlanesState = 0;\n  if (model.isClippingEnabled()) {\n    if (model._clippingPlanes.owner === model) {\n      model._clippingPlanes.update(frameState);\n    }\n    currentClippingPlanesState = model._clippingPlanes.clippingPlanesState;\n  }\n\n  if (currentClippingPlanesState !== model._clippingPlanesState) {\n    model.resetDrawCommands();\n    model._clippingPlanesState = currentClippingPlanesState;\n  }\n}\n\nfunction updateSceneMode(model, frameState) {\n  if (frameState.mode !== model._sceneMode) {\n    if (model._projectTo2D) {\n      model.resetDrawCommands();\n    } else {\n      model._updateModelMatrix = true;\n    }\n    model._sceneMode = frameState.mode;\n  }\n}\n\nfunction updateVerticalExaggeration(model, frameState) {\n  const verticalExaggerationNeeded = frameState.verticalExaggeration !== 1.0;\n  if (model._verticalExaggerationOn !== verticalExaggerationNeeded) {\n    model.resetDrawCommands();\n    model._verticalExaggerationOn = verticalExaggerationNeeded;\n  }\n}\n\nfunction buildDrawCommands(model, frameState) {\n  if (!model._drawCommandsBuilt) {\n    model.destroyPipelineResources();\n    model._sceneGraph.buildDrawCommands(frameState);\n    model._drawCommandsBuilt = true;\n  }\n}\n\nfunction updateModelMatrix(model, frameState) {\n  // This is done without a dirty flag so that the model matrix can be updated in-place\n  // without needing to use a setter.\n  if (!Matrix4.equals(model.modelMatrix, model._modelMatrix)) {\n    //>>includeStart('debug', pragmas.debug);\n    if (frameState.mode !== SceneMode.SCENE3D && model._projectTo2D) {\n      throw new DeveloperError(\n        \"Model.modelMatrix cannot be changed in 2D or Columbus View if projectTo2D is true.\"\n      );\n    }\n    //>>includeEnd('debug');\n    model._updateModelMatrix = true;\n    model._modelMatrix = Matrix4.clone(model.modelMatrix, model._modelMatrix);\n  }\n}\n\nconst scratchPosition = new Cartesian3();\nconst scratchCartographic = new Cartographic();\n\nfunction updateClamping(model) {\n  if (\n    !model._updateModelMatrix &&\n    !model._heightDirty &&\n    model._minimumPixelSize === 0.0\n  ) {\n    return;\n  }\n\n  if (defined(model._removeUpdateHeightCallback)) {\n    model._removeUpdateHeightCallback();\n    model._removeUpdateHeightCallback = undefined;\n  }\n\n  const scene = model._scene;\n  if (\n    !defined(scene) ||\n    !defined(scene.globe) ||\n    model.heightReference === HeightReference.NONE\n  ) {\n    //>>includeStart('debug', pragmas.debug);\n    if (model.heightReference !== HeightReference.NONE) {\n      throw new DeveloperError(\n        \"Height reference is not supported without a scene and globe.\"\n      );\n    }\n    //>>includeEnd('debug');\n    model._clampedModelMatrix = undefined;\n    return;\n  }\n\n  const globe = scene.globe;\n  const ellipsoid = globe.ellipsoid;\n\n  // Compute cartographic position so we don't recompute every update\n  const modelMatrix = model.modelMatrix;\n  scratchPosition.x = modelMatrix[12];\n  scratchPosition.y = modelMatrix[13];\n  scratchPosition.z = modelMatrix[14];\n  const cartoPosition = ellipsoid.cartesianToCartographic(scratchPosition);\n\n  if (!defined(model._clampedModelMatrix)) {\n    model._clampedModelMatrix = Matrix4.clone(modelMatrix, new Matrix4());\n  }\n\n  // Install callback to handle updating of terrain tiles\n  const surface = globe._surface;\n  model._removeUpdateHeightCallback = surface.updateHeight(\n    cartoPosition,\n    getUpdateHeightCallback(model, ellipsoid, cartoPosition)\n  );\n\n  // Set the correct height now\n  const height = globe.getHeight(cartoPosition);\n  if (defined(height)) {\n    // Get callback with cartoPosition being the non-clamped position\n    const callback = getUpdateHeightCallback(model, ellipsoid, cartoPosition);\n\n    // Compute the clamped cartesian and call updateHeight callback\n    Cartographic.clone(cartoPosition, scratchCartographic);\n    scratchCartographic.height = height;\n    ellipsoid.cartographicToCartesian(scratchCartographic, scratchPosition);\n    callback(scratchPosition);\n  }\n\n  model._heightDirty = false;\n  model._updateModelMatrix = true;\n}\n\nfunction updateBoundingSphereAndScale(model, frameState) {\n  if (!model._updateModelMatrix && model._minimumPixelSize === 0.0) {\n    return;\n  }\n\n  const modelMatrix = defined(model._clampedModelMatrix)\n    ? model._clampedModelMatrix\n    : model.modelMatrix;\n\n  updateBoundingSphere(model, modelMatrix);\n  updateComputedScale(model, modelMatrix, frameState);\n}\n\nfunction updateBoundingSphere(model, modelMatrix) {\n  model._clampedScale = defined(model._maximumScale)\n    ? Math.min(model._scale, model._maximumScale)\n    : model._scale;\n\n  model._boundingSphere.center = Cartesian3.multiplyByScalar(\n    model._sceneGraph.boundingSphere.center,\n    model._clampedScale,\n    model._boundingSphere.center\n  );\n  model._boundingSphere.radius = model._initialRadius * model._clampedScale;\n\n  model._boundingSphere = BoundingSphere.transform(\n    model._boundingSphere,\n    modelMatrix,\n    model._boundingSphere\n  );\n}\n\nfunction updateComputedScale(model, modelMatrix, frameState) {\n  let scale = model.scale;\n\n  if (model.minimumPixelSize !== 0.0 && !model._projectTo2D) {\n    // Compute size of bounding sphere in pixels\n    const context = frameState.context;\n    const maxPixelSize = Math.max(\n      context.drawingBufferWidth,\n      context.drawingBufferHeight\n    );\n\n    Matrix4.getTranslation(modelMatrix, scratchPosition);\n\n    if (model._sceneMode !== SceneMode.SCENE3D) {\n      SceneTransforms.computeActualWgs84Position(\n        frameState,\n        scratchPosition,\n        scratchPosition\n      );\n    }\n\n    const radius = model._boundingSphere.radius;\n    const metersPerPixel = scaleInPixels(scratchPosition, radius, frameState);\n\n    // metersPerPixel is always > 0.0\n    const pixelsPerMeter = 1.0 / metersPerPixel;\n    const diameterInPixels = Math.min(\n      pixelsPerMeter * (2.0 * radius),\n      maxPixelSize\n    );\n\n    // Maintain model's minimum pixel size\n    if (diameterInPixels < model.minimumPixelSize) {\n      scale =\n        (model.minimumPixelSize * metersPerPixel) /\n        (2.0 * model._initialRadius);\n    }\n  }\n\n  model._computedScale = defined(model.maximumScale)\n    ? Math.min(model.maximumScale, scale)\n    : scale;\n}\n\nfunction updatePickIds(model) {\n  if (!model._idDirty) {\n    return;\n  }\n  model._idDirty = false;\n\n  const id = model._id;\n  const pickIds = model._pickIds;\n  const length = pickIds.length;\n  for (let i = 0; i < length; ++i) {\n    pickIds[i].object.id = id;\n  }\n}\n\nfunction updateReferenceMatrices(model, frameState) {\n  const modelMatrix = defined(model._clampedModelMatrix)\n    ? model._clampedModelMatrix\n    : model.modelMatrix;\n  const referenceMatrix = defaultValue(model.referenceMatrix, modelMatrix);\n  const context = frameState.context;\n\n  const ibl = model._imageBasedLighting;\n  if (ibl.useSphericalHarmonicCoefficients || ibl.useSpecularEnvironmentMaps) {\n    let iblReferenceFrameMatrix3 = scratchIBLReferenceFrameMatrix3;\n    let iblReferenceFrameMatrix4 = scratchIBLReferenceFrameMatrix4;\n\n    iblReferenceFrameMatrix4 = Matrix4.multiply(\n      context.uniformState.view3D,\n      referenceMatrix,\n      iblReferenceFrameMatrix4\n    );\n    iblReferenceFrameMatrix3 = Matrix4.getMatrix3(\n      iblReferenceFrameMatrix4,\n      iblReferenceFrameMatrix3\n    );\n    iblReferenceFrameMatrix3 = Matrix3.getRotation(\n      iblReferenceFrameMatrix3,\n      iblReferenceFrameMatrix3\n    );\n    model._iblReferenceFrameMatrix = Matrix3.transpose(\n      iblReferenceFrameMatrix3,\n      model._iblReferenceFrameMatrix\n    );\n  }\n\n  if (model.isClippingEnabled()) {\n    let clippingPlanesMatrix = scratchClippingPlanesMatrix;\n    clippingPlanesMatrix = Matrix4.multiply(\n      context.uniformState.view3D,\n      referenceMatrix,\n      clippingPlanesMatrix\n    );\n    clippingPlanesMatrix = Matrix4.multiply(\n      clippingPlanesMatrix,\n      model._clippingPlanes.modelMatrix,\n      clippingPlanesMatrix\n    );\n    model._clippingPlanesMatrix = Matrix4.inverseTranspose(\n      clippingPlanesMatrix,\n      model._clippingPlanesMatrix\n    );\n  }\n}\n\nfunction updateSceneGraph(model, frameState) {\n  const sceneGraph = model._sceneGraph;\n  if (model._updateModelMatrix || model._minimumPixelSize !== 0.0) {\n    const modelMatrix = defined(model._clampedModelMatrix)\n      ? model._clampedModelMatrix\n      : model.modelMatrix;\n    sceneGraph.updateModelMatrix(modelMatrix, frameState);\n    model._updateModelMatrix = false;\n  }\n\n  if (model._backFaceCullingDirty) {\n    sceneGraph.updateBackFaceCulling(model._backFaceCulling);\n    model._backFaceCullingDirty = false;\n  }\n\n  if (model._shadowsDirty) {\n    sceneGraph.updateShadows(model._shadows);\n    model._shadowsDirty = false;\n  }\n\n  if (model._debugShowBoundingVolumeDirty) {\n    sceneGraph.updateShowBoundingVolume(model._debugShowBoundingVolume);\n    model._debugShowBoundingVolumeDirty = false;\n  }\n\n  let updateForAnimations = false;\n  // Animations are disabled for classification models.\n  if (!defined(model.classificationType)) {\n    updateForAnimations =\n      model._userAnimationDirty || model._activeAnimations.update(frameState);\n  }\n  sceneGraph.update(frameState, updateForAnimations);\n  model._userAnimationDirty = false;\n}\n\nfunction updateShowCreditsOnScreen(model) {\n  if (!model._showCreditsOnScreenDirty) {\n    return;\n  }\n  model._showCreditsOnScreenDirty = false;\n  model._credits.length = 0;\n\n  const showOnScreen = model._showCreditsOnScreen;\n  if (defined(model._credit)) {\n    const credit = Credit.clone(model._credit);\n    credit.showOnScreen = credit.showOnScreen || showOnScreen;\n    model._credits.push(credit);\n  }\n\n  const resourceCredits = model._resourceCredits;\n  const resourceCreditsLength = resourceCredits.length;\n  for (let i = 0; i < resourceCreditsLength; i++) {\n    const credit = Credit.clone(resourceCredits[i]);\n    credit.showOnScreen = credit.showOnScreen || showOnScreen;\n    model._credits.push(credit);\n  }\n\n  const gltfCredits = model._gltfCredits;\n  const gltfCreditsLength = gltfCredits.length;\n  for (let i = 0; i < gltfCreditsLength; i++) {\n    const credit = Credit.clone(gltfCredits[i]);\n    credit.showOnScreen = credit.showOnScreen || showOnScreen;\n    model._credits.push(credit);\n  }\n}\n\nfunction submitDrawCommands(model, frameState) {\n  // Check that show is true after draw commands are built;\n  // we want the user to be able to instantly see the model\n  // when show is set to true.\n\n  const displayConditionPassed = passesDistanceDisplayCondition(\n    model,\n    frameState\n  );\n\n  const invisible = model.isInvisible();\n  const silhouette = model.hasSilhouette(frameState);\n\n  // If the model is invisible but has a silhouette, it still\n  // needs to draw in order to write to the stencil buffer and\n  // render the silhouette.\n  const showModel =\n    model._show &&\n    model._computedScale !== 0 &&\n    displayConditionPassed &&\n    (!invisible || silhouette);\n\n  const passes = frameState.passes;\n  const submitCommandsForPass =\n    passes.render || (passes.pick && model.allowPicking);\n\n  if (showModel && !model._ignoreCommands && submitCommandsForPass) {\n    addCreditsToCreditDisplay(model, frameState);\n    model._sceneGraph.pushDrawCommands(frameState);\n  }\n}\n\nconst scratchBoundingSphere = new BoundingSphere();\n\nfunction scaleInPixels(positionWC, radius, frameState) {\n  scratchBoundingSphere.center = positionWC;\n  scratchBoundingSphere.radius = radius;\n  return frameState.camera.getPixelSize(\n    scratchBoundingSphere,\n    frameState.context.drawingBufferWidth,\n    frameState.context.drawingBufferHeight\n  );\n}\n\nfunction getUpdateHeightCallback(model, ellipsoid, cartoPosition) {\n  return function (clampedPosition) {\n    if (model.heightReference === HeightReference.RELATIVE_TO_GROUND) {\n      const clampedCart = ellipsoid.cartesianToCartographic(\n        clampedPosition,\n        scratchCartographic\n      );\n      clampedCart.height += cartoPosition.height;\n      ellipsoid.cartographicToCartesian(clampedCart, clampedPosition);\n    }\n\n    const clampedModelMatrix = model._clampedModelMatrix;\n\n    // Modify clamped model matrix to use new height\n    Matrix4.clone(model.modelMatrix, clampedModelMatrix);\n    clampedModelMatrix[12] = clampedPosition.x;\n    clampedModelMatrix[13] = clampedPosition.y;\n    clampedModelMatrix[14] = clampedPosition.z;\n\n    model._heightDirty = true;\n  };\n}\n\nconst scratchDisplayConditionCartesian = new Cartesian3();\n\nfunction passesDistanceDisplayCondition(model, frameState) {\n  const condition = model.distanceDisplayCondition;\n  if (!defined(condition)) {\n    return true;\n  }\n\n  const nearSquared = condition.near * condition.near;\n  const farSquared = condition.far * condition.far;\n  let distanceSquared;\n\n  if (frameState.mode === SceneMode.SCENE2D) {\n    const frustum2DWidth =\n      frameState.camera.frustum.right - frameState.camera.frustum.left;\n    const distance = frustum2DWidth * 0.5;\n    distanceSquared = distance * distance;\n  } else {\n    // Distance to center of primitive's reference frame\n    const position = Matrix4.getTranslation(\n      model.modelMatrix,\n      scratchDisplayConditionCartesian\n    );\n\n    // This will project the position if the scene is in Columbus View,\n    // but leave the position as-is in 3D mode.\n    SceneTransforms.computeActualWgs84Position(frameState, position, position);\n\n    distanceSquared = Cartesian3.distanceSquared(\n      position,\n      frameState.camera.positionWC\n    );\n  }\n\n  return distanceSquared >= nearSquared && distanceSquared <= farSquared;\n}\n\nfunction addCreditsToCreditDisplay(model, frameState) {\n  const creditDisplay = frameState.creditDisplay;\n  const credits = model._credits;\n  const creditsLength = credits.length;\n  for (let c = 0; c < creditsLength; c++) {\n    creditDisplay.addCreditToNextFrame(credits[c]);\n  }\n}\n\n/**\n * Gets whether or not the model is translucent based on its assigned model color.\n * If the model color's alpha is equal to zero, then it is considered invisible,\n * not translucent.\n *\n * @returns {boolean} <code>true</code> if the model is translucent, otherwise <code>false</code>.\n * @private\n */\nModel.prototype.isTranslucent = function () {\n  const color = this.color;\n  return defined(color) && color.alpha > 0.0 && color.alpha < 1.0;\n};\n\n/**\n * Gets whether or not the model is invisible, i.e. if the model color's alpha\n * is equal to zero.\n *\n * @returns {boolean} <code>true</code> if the model is invisible, otherwise <code>false</code>.\n * @private\n */\nModel.prototype.isInvisible = function () {\n  const color = this.color;\n  return defined(color) && color.alpha === 0.0;\n};\n\nfunction supportsSilhouettes(frameState) {\n  return frameState.context.stencilBuffer;\n}\n\n/**\n * Gets whether or not the model has a silhouette. This accounts for whether\n * silhouettes are supported (i.e. the context supports stencil buffers).\n * <p>\n * If the model classifies another model, its silhouette will be disabled.\n * </p>\n *\n * @param {FrameState} The frame state.\n * @returns {boolean} <code>true</code> if the model has silhouettes, otherwise <code>false</code>.\n * @private\n */\nModel.prototype.hasSilhouette = function (frameState) {\n  return (\n    supportsSilhouettes(frameState) &&\n    this._silhouetteSize > 0.0 &&\n    this._silhouetteColor.alpha > 0.0 &&\n    !defined(this._classificationType)\n  );\n};\n\n/**\n * Gets whether or not the model is part of a tileset that uses the\n * skipLevelOfDetail optimization. This accounts for whether skipLevelOfDetail\n * is supported (i.e. the context supports stencil buffers).\n *\n * @param {FrameState} frameState The frame state.\n * @returns {boolean} <code>true</code> if the model is part of a tileset that uses the skipLevelOfDetail optimization, <code>false</code> otherwise.\n * @private\n */\nModel.prototype.hasSkipLevelOfDetail = function (frameState) {\n  if (!ModelType.is3DTiles(this.type)) {\n    return false;\n  }\n\n  const supportsSkipLevelOfDetail = frameState.context.stencilBuffer;\n  const tileset = this._content.tileset;\n  return supportsSkipLevelOfDetail && tileset.isSkippingLevelOfDetail;\n};\n\n/**\n * Gets whether or not clipping planes are enabled for this model.\n *\n * @returns {boolean} <code>true</code> if clipping planes are enabled for this model, <code>false</code>.\n * @private\n */\nModel.prototype.isClippingEnabled = function () {\n  const clippingPlanes = this._clippingPlanes;\n  return (\n    defined(clippingPlanes) &&\n    clippingPlanes.enabled &&\n    clippingPlanes.length !== 0\n  );\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see Model#destroy\n */\nModel.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * model = model && model.destroy();\n *\n * @see Model#isDestroyed\n */\nModel.prototype.destroy = function () {\n  const loader = this._loader;\n  if (defined(loader)) {\n    loader.destroy();\n  }\n\n  const featureTables = this._featureTables;\n  if (defined(featureTables)) {\n    const length = featureTables.length;\n    for (let i = 0; i < length; i++) {\n      featureTables[i].destroy();\n    }\n  }\n\n  this.destroyPipelineResources();\n  this.destroyModelResources();\n\n  // Remove callbacks for height reference behavior.\n  if (defined(this._removeUpdateHeightCallback)) {\n    this._removeUpdateHeightCallback();\n    this._removeUpdateHeightCallback = undefined;\n  }\n\n  if (defined(this._terrainProviderChangedCallback)) {\n    this._terrainProviderChangedCallback();\n    this._terrainProviderChangedCallback = undefined;\n  }\n\n  // Only destroy the ClippingPlaneCollection if this is the owner.\n  const clippingPlaneCollection = this._clippingPlanes;\n  if (\n    defined(clippingPlaneCollection) &&\n    !clippingPlaneCollection.isDestroyed() &&\n    clippingPlaneCollection.owner === this\n  ) {\n    clippingPlaneCollection.destroy();\n  }\n  this._clippingPlanes = undefined;\n\n  // Only destroy the ImageBasedLighting if this is the owner.\n  if (\n    this._shouldDestroyImageBasedLighting &&\n    !this._imageBasedLighting.isDestroyed()\n  ) {\n    this._imageBasedLighting.destroy();\n  }\n  this._imageBasedLighting = undefined;\n\n  destroyObject(this);\n};\n\n/**\n * Destroys resources generated in the pipeline stages\n * that must be destroyed when draw commands are rebuilt.\n * @private\n */\nModel.prototype.destroyPipelineResources = function () {\n  const resources = this._pipelineResources;\n  for (let i = 0; i < resources.length; i++) {\n    resources[i].destroy();\n  }\n  this._pipelineResources.length = 0;\n  this._pickIds.length = 0;\n};\n\n/**\n * Destroys resources generated in the pipeline stages\n * that exist for the lifetime of the model.\n * @private\n */\nModel.prototype.destroyModelResources = function () {\n  const resources = this._modelResources;\n  for (let i = 0; i < resources.length; i++) {\n    resources[i].destroy();\n  }\n  this._modelResources.length = 0;\n};\n\n/**\n * <p>\n * Asynchronously creates a model from a glTF asset. This function returns a promise that resolves when the model is ready to render, i.e., when the external binary, image,\n * and shader files are downloaded and the WebGL resources are created.\n * </p>\n * <p>\n * The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the .glb extension.\n *\n * @param {object} options Object with the following properties:\n * @param {string|Resource} options.url The url to the .gltf or .glb file.\n * @param {string|Resource} [options.basePath=''] The base path that paths in the glTF JSON are relative to.\n * @param {boolean} [options.show=true] Whether or not to render the model.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the model from model to world coordinates.\n * @param {number} [options.scale=1.0] A uniform scale applied to this model.\n * @param {number} [options.minimumPixelSize=0.0] The approximate minimum pixel size of the model regardless of zoom.\n * @param {number} [options.maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize.\n * @param {object} [options.id] A user-defined object to return when the model is picked with {@link Scene#pick}.\n * @param {boolean} [options.allowPicking=true] When <code>true</code>, each primitive is pickable with {@link Scene#pick}.\n * @param {boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded.\n * @param {boolean} [options.asynchronous=true] Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded.\n * @param {boolean} [options.clampAnimations=true] Determines if the model's animations should hold a pose over frames where no keyframes are specified.\n * @param {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the model casts or receives shadows from light sources.\n * @param {boolean} [options.releaseGltfJson=false] When true, the glTF JSON is released once the glTF is loaded. This is is especially useful for cases like 3D Tiles, where each .gltf model is unique and caching the glTF JSON is not effective.\n * @param {boolean} [options.debugShowBoundingVolume=false] For debugging only. Draws the bounding sphere for each draw command in the model.\n * @param {boolean} [options.enableDebugWireframe=false] For debugging only. This must be set to true for debugWireframe to work in WebGL1. This cannot be set after the model has loaded.\n * @param {boolean} [options.debugWireframe=false] For debugging only. Draws the model in wireframe. Will only work for WebGL1 if enableDebugWireframe is set to true.\n * @param {boolean} [options.cull=true]  Whether or not to cull the model using frustum/horizon culling. If the model is part of a 3D Tiles tileset, this property will always be false, since the 3D Tiles culling system is used.\n * @param {boolean} [options.opaquePass=Pass.OPAQUE] The pass to use in the {@link DrawCommand} for the opaque portions of the model.\n * @param {Axis} [options.upAxis=Axis.Y] The up-axis of the glTF model.\n * @param {Axis} [options.forwardAxis=Axis.Z] The forward-axis of the glTF model.\n * @param {CustomShader} [options.customShader] A custom shader. This will add user-defined GLSL code to the vertex and fragment shaders. Using custom shaders with a {@link Cesium3DTileStyle} may lead to undefined behavior.\n * @param {Cesium3DTileContent} [options.content] The tile content this model belongs to. This property will be undefined if model is not loaded as part of a tileset.\n * @param {HeightReference} [options.heightReference=HeightReference.NONE] Determines how the model is drawn relative to terrain.\n * @param {Scene} [options.scene] Must be passed in for models that use the height reference property.\n * @param {DistanceDisplayCondition} [options.distanceDisplayCondition] The condition specifying at what distance from the camera that this model will be displayed.\n * @param {Color} [options.color] A color that blends with the model's rendered color.\n * @param {ColorBlendMode} [options.colorBlendMode=ColorBlendMode.HIGHLIGHT] Defines how the color blends with the model.\n * @param {number} [options.colorBlendAmount=0.5] Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.\n * @param {Color} [options.silhouetteColor=Color.RED] The silhouette color. If more than 256 models have silhouettes enabled, there is a small chance that overlapping models will have minor artifacts.\n * @param {number} [options.silhouetteSize=0.0] The size of the silhouette in pixels.\n * @param {boolean} [options.enableShowOutline=true] Whether to enable outlines for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set false to avoid post-processing geometry at load time. When false, the showOutlines and outlineColor options are ignored.\n * @param {boolean} [options.showOutline=true] Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed.\n * @param {Color} [options.outlineColor=Color.BLACK] The color to use when rendering outlines.\n * @param {ClippingPlaneCollection} [options.clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the model.\n * @param {Cartesian3} [options.lightColor] The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.\n * @param {ImageBasedLighting} [options.imageBasedLighting] The properties for managing image-based lighting on this model.\n * @param {boolean} [options.backFaceCulling=true] Whether to cull back-facing geometry. When true, back face culling is determined by the material's doubleSided property; when false, back face culling is disabled. Back faces are not culled if the model's color is translucent.\n * @param {Credit|string} [options.credit] A credit for the data source, which is displayed on the canvas.\n * @param {boolean} [options.showCreditsOnScreen=false] Whether to display the credits of this model on screen.\n * @param {SplitDirection} [options.splitDirection=SplitDirection.NONE] The {@link SplitDirection} split to apply to this model.\n * @param {boolean} [options.projectTo2D=false] Whether to accurately project the model's positions in 2D. If this is true, the model will be projected accurately to 2D, but it will use more memory to do so. If this is false, the model will use less memory and will still render in 2D / CV mode, but its positions may be inaccurate. This disables minimumPixelSize and prevents future modification to the model matrix. This also cannot be set after the model has loaded.\n * @param {string|number} [options.featureIdLabel=\"featureId_0\"] Label of the feature ID set to use for picking and styling. For EXT_mesh_features, this is the feature ID's label property, or \"featureId_N\" (where N is the index in the featureIds array) when not specified. EXT_feature_metadata did not have a label field, so such feature ID sets are always labeled \"featureId_N\" where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string \"featureId_N\" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.\n * @param {string|number} [options.instanceFeatureIdLabel=\"instanceFeatureId_0\"] Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string \"instanceFeatureId_N\" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.\n * @param {object} [options.pointCloudShading] Options for constructing a {@link PointCloudShading} object to control point attenuation and lighting.\n * @param {ClassificationType} [options.classificationType] Determines whether terrain, 3D Tiles or both will be classified by this model. This cannot be set after the model has loaded.\n * @param {Model.GltfCallback} [options.gltfCallback] A function that is called with the loaded gltf object once loaded.\n *\n * @returns {Promise<Model>} A promise that resolves to the created model when it is ready to render.\n *\n * @exception {RuntimeError} The model failed to load.\n * @exception {RuntimeError} Unsupported glTF version.\n * @exception {RuntimeError} Unsupported glTF Extension\n *\n * @example\n * // Load a model and add it to the scene\n * try {\n *  const model = await Cesium.Model.fromGltfAsync({\n *    url: \"../../SampleData/models/CesiumMan/Cesium_Man.glb\"\n *  });\n *  viewer.scene.primitives.add(model);\n * } catch (error) {\n *  console.log(`Failed to load model. ${error}`);\n * }\n *\n * @example\n * // Position a model with modelMatrix and display it with a minimum size of 128 pixels\n * const position = Cesium.Cartesian3.fromDegrees(\n *   -123.0744619,\n *   44.0503706,\n *   5000.0\n * );\n * const headingPositionRoll = new Cesium.HeadingPitchRoll();\n * const fixedFrameTransform = Cesium.Transforms.localFrameToFixedFrameGenerator(\n *   \"north\",\n *   \"west\"\n * );\n * try {\n *  const model = await Cesium.Model.fromGltfAsync({\n *    url: \"../../SampleData/models/CesiumAir/Cesium_Air.glb\",\n *    modelMatrix: Cesium.Transforms.headingPitchRollToFixedFrame(\n *      position,\n *      headingPositionRoll,\n *      Cesium.Ellipsoid.WGS84,\n *      fixedFrameTransform\n *    ),\n *    minimumPixelSize: 128,\n *  });\n *  viewer.scene.primitives.add(model);\n * } catch (error) {\n *  console.log(`Failed to load model. ${error}`);\n * }\n *\n * @example\n * // Load a model and play the last animation at half speed\n * let animations;\n * try {\n *  const model = await Cesium.Model.fromGltfAsync({\n *    url: \"../../SampleData/models/CesiumMan/Cesium_Man.glb\",\n *    gltfCallback: gltf => {\n *      animations = gltf.animations\n *    }\n *  });\n *  viewer.scene.primitives.add(model);\n *  model.readyEvent.addEventListener(() => {\n *    model.activeAnimations.add({\n *      index: animations.length - 1,\n *      loop: Cesium.ModelAnimationLoop.REPEAT,\n *      multiplier: 0.5,\n *    });\n *  });\n * } catch (error) {\n *  console.log(`Failed to load model. ${error}`);\n * }\n */\nModel.fromGltfAsync = async function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options.url) && !defined(options.gltf)) {\n    throw new DeveloperError(\"options.url is required.\");\n  }\n  //>>includeEnd('debug');\n\n  // options.gltf is used internally for 3D Tiles. It can be a Resource, a URL\n  // to a glTF/glb file, a binary glTF buffer, or a JSON object containing the\n  // glTF contents.\n  const gltf = defaultValue(options.url, options.gltf);\n\n  const loaderOptions = {\n    releaseGltfJson: options.releaseGltfJson,\n    asynchronous: options.asynchronous,\n    incrementallyLoadTextures: options.incrementallyLoadTextures,\n    upAxis: options.upAxis,\n    forwardAxis: options.forwardAxis,\n    loadAttributesFor2D: options.projectTo2D,\n    loadIndicesForWireframe: options.enableDebugWireframe,\n    loadPrimitiveOutline: options.enableShowOutline,\n    loadForClassification: defined(options.classificationType),\n  };\n\n  const basePath = defaultValue(options.basePath, \"\");\n  const baseResource = Resource.createIfNeeded(basePath);\n\n  if (defined(gltf.asset)) {\n    loaderOptions.gltfJson = gltf;\n    loaderOptions.baseResource = baseResource;\n    loaderOptions.gltfResource = baseResource;\n  } else if (gltf instanceof Uint8Array) {\n    loaderOptions.typedArray = gltf;\n    loaderOptions.baseResource = baseResource;\n    loaderOptions.gltfResource = baseResource;\n  } else {\n    loaderOptions.gltfResource = Resource.createIfNeeded(gltf);\n  }\n\n  const loader = new GltfLoader(loaderOptions);\n\n  const is3DTiles = defined(options.content);\n  const type = is3DTiles ? ModelType.TILE_GLTF : ModelType.GLTF;\n\n  const resource = loaderOptions.gltfResource;\n\n  const modelOptions = makeModelOptions(loader, type, options);\n  modelOptions.resource = resource;\n\n  try {\n    // This load the gltf JSON and ensures the gltf is valid\n    // Further resource loading is handled synchronously in loader.process(), and requires\n    // hooking into model's update() as the frameState is needed\n    await loader.load();\n  } catch (error) {\n    loader.destroy();\n    throw ModelUtility.getError(\"model\", resource, error);\n  }\n\n  const gltfCallback = options.gltfCallback;\n  if (defined(gltfCallback)) {\n    //>>includeStart('debug', pragmas.debug);\n    Check.typeOf.func(\"options.gltfCallback\", gltfCallback);\n    //>>includeEnd('debug');\n\n    gltfCallback(loader.gltfJson);\n  }\n\n  const model = new Model(modelOptions);\n\n  const resourceCredits = model._resource.credits;\n  if (defined(resourceCredits)) {\n    const length = resourceCredits.length;\n    for (let i = 0; i < length; i++) {\n      model._resourceCredits.push(Credit.clone(resourceCredits[i]));\n    }\n  }\n\n  return model;\n};\n\n/*\n * @private\n */\nModel.fromB3dm = async function (options) {\n  const loaderOptions = {\n    b3dmResource: options.resource,\n    arrayBuffer: options.arrayBuffer,\n    byteOffset: options.byteOffset,\n    releaseGltfJson: options.releaseGltfJson,\n    asynchronous: options.asynchronous,\n    incrementallyLoadTextures: options.incrementallyLoadTextures,\n    upAxis: options.upAxis,\n    forwardAxis: options.forwardAxis,\n    loadAttributesFor2D: options.projectTo2D,\n    loadIndicesForWireframe: options.enableDebugWireframe,\n    loadPrimitiveOutline: options.enableShowOutline,\n    loadForClassification: defined(options.classificationType),\n  };\n\n  const loader = new B3dmLoader(loaderOptions);\n\n  try {\n    await loader.load();\n\n    const modelOptions = makeModelOptions(loader, ModelType.TILE_B3DM, options);\n    const model = new Model(modelOptions);\n    return model;\n  } catch (error) {\n    loader.destroy();\n    throw error;\n  }\n};\n\n/**\n * @private\n */\nModel.fromPnts = async function (options) {\n  const loaderOptions = {\n    arrayBuffer: options.arrayBuffer,\n    byteOffset: options.byteOffset,\n    loadAttributesFor2D: options.projectTo2D,\n  };\n  const loader = new PntsLoader(loaderOptions);\n\n  try {\n    await loader.load();\n    const modelOptions = makeModelOptions(loader, ModelType.TILE_PNTS, options);\n    const model = new Model(modelOptions);\n    return model;\n  } catch (error) {\n    loader.destroy();\n    throw error;\n  }\n};\n\n/*\n * @private\n */\nModel.fromI3dm = async function (options) {\n  const loaderOptions = {\n    i3dmResource: options.resource,\n    arrayBuffer: options.arrayBuffer,\n    byteOffset: options.byteOffset,\n    releaseGltfJson: options.releaseGltfJson,\n    asynchronous: options.asynchronous,\n    incrementallyLoadTextures: options.incrementallyLoadTextures,\n    upAxis: options.upAxis,\n    forwardAxis: options.forwardAxis,\n    loadAttributesFor2D: options.projectTo2D,\n    loadIndicesForWireframe: options.enableDebugWireframe,\n    loadPrimitiveOutline: options.enableShowOutline,\n  };\n  const loader = new I3dmLoader(loaderOptions);\n\n  try {\n    await loader.load();\n\n    const modelOptions = makeModelOptions(loader, ModelType.TILE_I3DM, options);\n    const model = new Model(modelOptions);\n    return model;\n  } catch (error) {\n    loader.destroy();\n    throw error;\n  }\n};\n\n/*\n * @private\n */\nModel.fromGeoJson = async function (options) {\n  const loaderOptions = {\n    geoJson: options.geoJson,\n  };\n  const loader = new GeoJsonLoader(loaderOptions);\n  const modelOptions = makeModelOptions(\n    loader,\n    ModelType.TILE_GEOJSON,\n    options\n  );\n  const model = new Model(modelOptions);\n  return model;\n};\n\nconst scratchColor = new Color();\n\n/**\n * @private\n */\nModel.prototype.applyColorAndShow = function (style) {\n  const previousColor = Color.clone(this._color, scratchColor);\n  const hasColorStyle = defined(style) && defined(style.color);\n  const hasShowStyle = defined(style) && defined(style.show);\n\n  this._color = hasColorStyle\n    ? style.color.evaluateColor(undefined, this._color)\n    : Color.clone(Color.WHITE, this._color);\n  this._show = hasShowStyle ? style.show.evaluate(undefined) : true;\n\n  if (isColorAlphaDirty(previousColor, this._color)) {\n    this.resetDrawCommands();\n  }\n};\n\n/**\n * @private\n */\nModel.prototype.applyStyle = function (style) {\n  const isPnts = this.type === ModelType.TILE_PNTS;\n\n  const hasFeatureTable =\n    defined(this.featureTableId) &&\n    this.featureTables[this.featureTableId].featuresLength > 0;\n\n  const propertyAttributes = defined(this.structuralMetadata)\n    ? this.structuralMetadata.propertyAttributes\n    : undefined;\n  const hasPropertyAttributes =\n    defined(propertyAttributes) && defined(propertyAttributes[0]);\n\n  // Point clouds will be styled on the GPU unless they contain a batch table.\n  // That is, CPU styling will not be applied if:\n  // - points have no metadata at all, or\n  // - points have metadata stored as a property attribute\n  if (isPnts && (!hasFeatureTable || hasPropertyAttributes)) {\n    // Commands are rebuilt for point cloud styling since the new style may\n    // contain different shader functions.\n    this.resetDrawCommands();\n    return;\n  }\n\n  // The style is only set by the ModelFeatureTable. If there are no features,\n  // the color and show from the style are directly applied.\n  if (hasFeatureTable) {\n    const featureTable = this.featureTables[this.featureTableId];\n    featureTable.applyStyle(style);\n    updateStyleCommandsNeeded(this, style);\n  } else {\n    this.applyColorAndShow(style);\n    this._styleCommandsNeeded = undefined;\n  }\n};\n\nfunction makeModelOptions(loader, modelType, options) {\n  return {\n    loader: loader,\n    type: modelType,\n    resource: options.resource,\n    show: options.show,\n    modelMatrix: options.modelMatrix,\n    scale: options.scale,\n    minimumPixelSize: options.minimumPixelSize,\n    maximumScale: options.maximumScale,\n    id: options.id,\n    allowPicking: options.allowPicking,\n    clampAnimations: options.clampAnimations,\n    shadows: options.shadows,\n    debugShowBoundingVolume: options.debugShowBoundingVolume,\n    enableDebugWireframe: options.enableDebugWireframe,\n    debugWireframe: options.debugWireframe,\n    cull: options.cull,\n    opaquePass: options.opaquePass,\n    customShader: options.customShader,\n    content: options.content,\n    heightReference: options.heightReference,\n    scene: options.scene,\n    distanceDisplayCondition: options.distanceDisplayCondition,\n    color: options.color,\n    colorBlendAmount: options.colorBlendAmount,\n    colorBlendMode: options.colorBlendMode,\n    silhouetteColor: options.silhouetteColor,\n    silhouetteSize: options.silhouetteSize,\n    enableShowOutline: options.enableShowOutline,\n    showOutline: options.showOutline,\n    outlineColor: options.outlineColor,\n    clippingPlanes: options.clippingPlanes,\n    lightColor: options.lightColor,\n    imageBasedLighting: options.imageBasedLighting,\n    backFaceCulling: options.backFaceCulling,\n    credit: options.credit,\n    showCreditsOnScreen: options.showCreditsOnScreen,\n    splitDirection: options.splitDirection,\n    projectTo2D: options.projectTo2D,\n    featureIdLabel: options.featureIdLabel,\n    instanceFeatureIdLabel: options.instanceFeatureIdLabel,\n    pointCloudShading: options.pointCloudShading,\n    classificationType: options.classificationType,\n    pickObject: options.pickObject,\n  };\n}\n\n/**\n * Interface for the function that is called with the loaded gltf object once loaded.\n * @callback Model.GltfCallback\n *\n * @param {object} gltf The gltf object\n */\n\nexport default Model;\n", "import Color from \"../../Core/Color.js\";\nimport combine from \"../../Core/combine.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport ModelAnimationLoop from \"../ModelAnimationLoop.js\";\nimport Model from \"./Model.js\";\n\n/**\n * Represents the contents of a glTF, glb or\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel|Batched 3D Model}\n * tile in a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles} tileset.\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n * This object is normally not instantiated directly, use {@link Model3DTileContent.fromGltf}, {@link Model3DTileContent.fromB3dm}, {@link Model3DTileContent.fromI3dm}, {@link Model3DTileContent.fromPnts}, or {@link Model3DTileContent.fromGeoJson}.\n *\n * @alias Model3DTileContent\n * @constructor\n * @private\n */\nfunction Model3DTileContent(tileset, tile, resource) {\n  this._tileset = tileset;\n  this._tile = tile;\n  this._resource = resource;\n\n  this._model = undefined;\n  this._metadata = undefined;\n  this._group = undefined;\n  this._ready = false;\n}\n\nObject.defineProperties(Model3DTileContent.prototype, {\n  featuresLength: {\n    get: function () {\n      const model = this._model;\n      const featureTables = model.featureTables;\n      const featureTableId = model.featureTableId;\n\n      if (defined(featureTables) && defined(featureTables[featureTableId])) {\n        return featureTables[featureTableId].featuresLength;\n      }\n\n      return 0;\n    },\n  },\n\n  pointsLength: {\n    get: function () {\n      return this._model.statistics.pointsLength;\n    },\n  },\n\n  trianglesLength: {\n    get: function () {\n      return this._model.statistics.trianglesLength;\n    },\n  },\n\n  geometryByteLength: {\n    get: function () {\n      return this._model.statistics.geometryByteLength;\n    },\n  },\n\n  texturesByteLength: {\n    get: function () {\n      return this._model.statistics.texturesByteLength;\n    },\n  },\n\n  batchTableByteLength: {\n    get: function () {\n      const statistics = this._model.statistics;\n      return (\n        statistics.propertyTablesByteLength + statistics.batchTexturesByteLength\n      );\n    },\n  },\n\n  innerContents: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Returns true when the tile's content is ready to render; otherwise false\n   *\n   * @memberof Model3DTileContent.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n\n  tileset: {\n    get: function () {\n      return this._tileset;\n    },\n  },\n\n  tile: {\n    get: function () {\n      return this._tile;\n    },\n  },\n\n  url: {\n    get: function () {\n      return this._resource.getUrlComponent(true);\n    },\n  },\n\n  batchTable: {\n    get: function () {\n      const model = this._model;\n      const featureTables = model.featureTables;\n      const featureTableId = model.featureTableId;\n\n      if (defined(featureTables) && defined(featureTables[featureTableId])) {\n        return featureTables[featureTableId];\n      }\n\n      return undefined;\n    },\n  },\n\n  metadata: {\n    get: function () {\n      return this._metadata;\n    },\n    set: function (value) {\n      this._metadata = value;\n    },\n  },\n\n  group: {\n    get: function () {\n      return this._group;\n    },\n    set: function (value) {\n      this._group = value;\n    },\n  },\n});\n\nModel3DTileContent.prototype.getFeature = function (featureId) {\n  const model = this._model;\n  const featureTableId = model.featureTableId;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(featureTableId)) {\n    throw new DeveloperError(\n      \"No feature ID set is selected. Make sure Cesium3DTileset.featureIdLabel or Cesium3DTileset.instanceFeatureIdLabel is defined\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const featureTable = model.featureTables[featureTableId];\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(featureTable)) {\n    throw new DeveloperError(\n      \"No feature table found for the selected feature ID set\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  //>>includeStart('debug', pragmas.debug);\n  const featuresLength = featureTable.featuresLength;\n  if (!defined(featureId) || featureId < 0 || featureId >= featuresLength) {\n    throw new DeveloperError(\n      `featureId is required and must be between 0 and featuresLength - 1 (${\n        featuresLength - 1\n      }).`\n    );\n  }\n  //>>includeEnd('debug');\n  return featureTable.getFeature(featureId);\n};\n\nModel3DTileContent.prototype.hasProperty = function (featureId, name) {\n  const model = this._model;\n  const featureTableId = model.featureTableId;\n  if (!defined(featureTableId)) {\n    return false;\n  }\n\n  const featureTable = model.featureTables[featureTableId];\n  return featureTable.hasProperty(featureId, name);\n};\n\nModel3DTileContent.prototype.applyDebugSettings = function (enabled, color) {\n  color = enabled ? color : Color.WHITE;\n  if (this.featuresLength === 0) {\n    this._model.color = color;\n  } else if (defined(this.batchTable)) {\n    this.batchTable.setAllColor(color);\n  }\n};\n\nModel3DTileContent.prototype.applyStyle = function (style) {\n  // the setter will call model.applyStyle()\n  this._model.style = style;\n};\n\nModel3DTileContent.prototype.update = function (tileset, frameState) {\n  const model = this._model;\n  const tile = this._tile;\n\n  model.colorBlendAmount = tileset.colorBlendAmount;\n  model.colorBlendMode = tileset.colorBlendMode;\n  model.modelMatrix = tile.computedTransform;\n  model.customShader = tileset.customShader;\n  model.featureIdLabel = tileset.featureIdLabel;\n  model.instanceFeatureIdLabel = tileset.instanceFeatureIdLabel;\n  model.lightColor = tileset.lightColor;\n  model.imageBasedLighting = tileset.imageBasedLighting;\n  model.backFaceCulling = tileset.backFaceCulling;\n  model.shadows = tileset.shadows;\n  model.showCreditsOnScreen = tileset.showCreditsOnScreen;\n  model.splitDirection = tileset.splitDirection;\n  model.debugWireframe = tileset.debugWireframe;\n  model.showOutline = tileset.showOutline;\n  model.outlineColor = tileset.outlineColor;\n  model.pointCloudShading = tileset.pointCloudShading;\n\n  // Updating clipping planes requires more effort because of ownership checks\n  const tilesetClippingPlanes = tileset.clippingPlanes;\n  model.referenceMatrix = tileset.clippingPlanesOriginMatrix;\n  if (defined(tilesetClippingPlanes) && tile.clippingPlanesDirty) {\n    // Dereference the clipping planes from the model if they are irrelevant.\n    model._clippingPlanes =\n      tilesetClippingPlanes.enabled && tile._isClipped\n        ? tilesetClippingPlanes\n        : undefined;\n  }\n\n  // If the model references a different ClippingPlaneCollection from the tileset,\n  // update the model to use the new ClippingPlaneCollection.\n  if (\n    defined(tilesetClippingPlanes) &&\n    defined(model._clippingPlanes) &&\n    model._clippingPlanes !== tilesetClippingPlanes\n  ) {\n    model._clippingPlanes = tilesetClippingPlanes;\n    model._clippingPlanesState = 0;\n  }\n\n  model.update(frameState);\n\n  if (!this._ready && model.ready) {\n    // Animation can only be added once the model is ready\n    model.activeAnimations.addAll({\n      loop: ModelAnimationLoop.REPEAT,\n    });\n\n    this._ready = true;\n  }\n};\n\nModel3DTileContent.prototype.isDestroyed = function () {\n  return false;\n};\n\nModel3DTileContent.prototype.destroy = function () {\n  this._model = this._model && this._model.destroy();\n  return destroyObject(this);\n};\n\nModel3DTileContent.fromGltf = async function (tileset, tile, resource, gltf) {\n  const content = new Model3DTileContent(tileset, tile, resource);\n\n  const additionalOptions = {\n    gltf: gltf,\n    basePath: resource,\n  };\n\n  const modelOptions = makeModelOptions(\n    tileset,\n    tile,\n    content,\n    additionalOptions\n  );\n\n  const classificationType = tileset.vectorClassificationOnly\n    ? undefined\n    : tileset.classificationType;\n\n  modelOptions.classificationType = classificationType;\n\n  const model = await Model.fromGltfAsync(modelOptions);\n  content._model = model;\n\n  return content;\n};\n\nModel3DTileContent.fromB3dm = async function (\n  tileset,\n  tile,\n  resource,\n  arrayBuffer,\n  byteOffset\n) {\n  const content = new Model3DTileContent(tileset, tile, resource);\n\n  const additionalOptions = {\n    arrayBuffer: arrayBuffer,\n    byteOffset: byteOffset,\n    resource: resource,\n  };\n\n  const modelOptions = makeModelOptions(\n    tileset,\n    tile,\n    content,\n    additionalOptions\n  );\n\n  const classificationType = tileset.vectorClassificationOnly\n    ? undefined\n    : tileset.classificationType;\n\n  modelOptions.classificationType = classificationType;\n\n  const model = await Model.fromB3dm(modelOptions);\n  content._model = model;\n\n  return content;\n};\n\nModel3DTileContent.fromI3dm = async function (\n  tileset,\n  tile,\n  resource,\n  arrayBuffer,\n  byteOffset\n) {\n  const content = new Model3DTileContent(tileset, tile, resource);\n\n  const additionalOptions = {\n    arrayBuffer: arrayBuffer,\n    byteOffset: byteOffset,\n    resource: resource,\n  };\n\n  const modelOptions = makeModelOptions(\n    tileset,\n    tile,\n    content,\n    additionalOptions\n  );\n\n  const model = await Model.fromI3dm(modelOptions);\n  content._model = model;\n\n  return content;\n};\n\nModel3DTileContent.fromPnts = async function (\n  tileset,\n  tile,\n  resource,\n  arrayBuffer,\n  byteOffset\n) {\n  const content = new Model3DTileContent(tileset, tile, resource);\n\n  const additionalOptions = {\n    arrayBuffer: arrayBuffer,\n    byteOffset: byteOffset,\n    resource: resource,\n  };\n\n  const modelOptions = makeModelOptions(\n    tileset,\n    tile,\n    content,\n    additionalOptions\n  );\n  const model = await Model.fromPnts(modelOptions);\n  content._model = model;\n\n  return content;\n};\n\nModel3DTileContent.fromGeoJson = async function (\n  tileset,\n  tile,\n  resource,\n  geoJson\n) {\n  const content = new Model3DTileContent(tileset, tile, resource);\n\n  const additionalOptions = {\n    geoJson: geoJson,\n    resource: resource,\n  };\n\n  const modelOptions = makeModelOptions(\n    tileset,\n    tile,\n    content,\n    additionalOptions\n  );\n  const model = await Model.fromGeoJson(modelOptions);\n  content._model = model;\n\n  return content;\n};\n\nfunction makeModelOptions(tileset, tile, content, additionalOptions) {\n  const mainOptions = {\n    cull: false, // The model is already culled by 3D Tiles\n    releaseGltfJson: true, // Models are unique and will not benefit from caching so save memory\n    opaquePass: Pass.CESIUM_3D_TILE, // Draw opaque portions of the model during the 3D Tiles pass\n    modelMatrix: tile.computedTransform,\n    upAxis: tileset._modelUpAxis,\n    forwardAxis: tileset._modelForwardAxis,\n    incrementallyLoadTextures: false,\n    customShader: tileset.customShader,\n    content: content,\n    colorBlendMode: tileset.colorBlendMode,\n    colorBlendAmount: tileset.colorBlendAmount,\n    lightColor: tileset.lightColor,\n    imageBasedLighting: tileset.imageBasedLighting,\n    featureIdLabel: tileset.featureIdLabel,\n    instanceFeatureIdLabel: tileset.instanceFeatureIdLabel,\n    pointCloudShading: tileset.pointCloudShading,\n    clippingPlanes: tileset.clippingPlanes,\n    backFaceCulling: tileset.backFaceCulling,\n    shadows: tileset.shadows,\n    showCreditsOnScreen: tileset.showCreditsOnScreen,\n    splitDirection: tileset.splitDirection,\n    enableDebugWireframe: tileset._enableDebugWireframe,\n    debugWireframe: tileset.debugWireframe,\n    projectTo2D: tileset._projectTo2D,\n    enableShowOutline: tileset._enableShowOutline,\n    showOutline: tileset.showOutline,\n    outlineColor: tileset.outlineColor,\n  };\n\n  return combine(additionalOptions, mainOptions);\n}\n\nexport default Model3DTileContent;\n", "import destroyObject from \"../Core/destroyObject.js\";\n\n/**\n * Represents content for a tile in a\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles} tileset whose\n * content points to another 3D Tiles tileset.\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n *\n * @alias Tileset3DTileContent\n * @constructor\n *\n * @private\n */\nfunction Tileset3DTileContent(tileset, tile, resource) {\n  this._tileset = tileset;\n  this._tile = tile;\n  this._resource = resource;\n\n  this.featurePropertiesDirty = false;\n\n  this._metadata = undefined;\n  this._group = undefined;\n\n  this._ready = false;\n}\n\nObject.defineProperties(Tileset3DTileContent.prototype, {\n  featuresLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  pointsLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  trianglesLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  geometryByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  texturesByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  batchTableByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  innerContents: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Returns true when the tile's content is ready to render; otherwise false\n   *\n   * @memberof Tileset3DTileContent.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n\n  tileset: {\n    get: function () {\n      return this._tileset;\n    },\n  },\n\n  tile: {\n    get: function () {\n      return this._tile;\n    },\n  },\n\n  url: {\n    get: function () {\n      return this._resource.getUrlComponent(true);\n    },\n  },\n\n  batchTable: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  metadata: {\n    get: function () {\n      return this._metadata;\n    },\n    set: function (value) {\n      this._metadata = value;\n    },\n  },\n\n  group: {\n    get: function () {\n      return this._group;\n    },\n    set: function (value) {\n      this._group = value;\n    },\n  },\n});\n\n/**\n * Creates an instance of Tileset3DTileContent from a parsed JSON object\n * @param {Cesium3DTileset} tileset\n * @param {Cesium3DTile} tile\n * @param {Resource} resource\n * @param {object} json\n * @returns {Tileset3DTileContent}\n */\nTileset3DTileContent.fromJson = function (tileset, tile, resource, json) {\n  const content = new Tileset3DTileContent(tileset, tile, resource);\n  content._tileset.loadTileset(content._resource, json, content._tile);\n  content._ready = true;\n\n  return content;\n};\n\n/**\n * Part of the {@link Cesium3DTileContent} interface.  <code>Tileset3DTileContent</code>\n * always returns <code>false</code> since a tile of this type does not have any features.\n */\nTileset3DTileContent.prototype.hasProperty = function (batchId, name) {\n  return false;\n};\n\n/**\n * Part of the {@link Cesium3DTileContent} interface.  <code>Tileset3DTileContent</code>\n * always returns <code>undefined</code> since a tile of this type does not have any features.\n */\nTileset3DTileContent.prototype.getFeature = function (batchId) {\n  return undefined;\n};\n\nTileset3DTileContent.prototype.applyDebugSettings = function (\n  enabled,\n  color\n) {};\n\nTileset3DTileContent.prototype.applyStyle = function (style) {};\n\nTileset3DTileContent.prototype.update = function (tileset, frameState) {};\n\nTileset3DTileContent.prototype.isDestroyed = function () {\n  return false;\n};\n\nTileset3DTileContent.prototype.destroy = function () {\n  return destroyObject(this);\n};\nexport default Tileset3DTileContent;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D u_atlas;\\n\\\n\\n\\\n#ifdef VECTOR_TILE\\n\\\nuniform vec4 u_highlightColor;\\n\\\n#endif\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\nin vec4 v_pickColor;\\n\\\nin vec4 v_color;\\n\\\n\\n\\\n#ifdef SDF\\n\\\nin vec4 v_outlineColor;\\n\\\nin float v_outlineWidth;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef FRAGMENT_DEPTH_CHECK\\n\\\nin vec4 v_textureCoordinateBounds;                  // the min and max x and y values for the texture coordinates\\n\\\nin vec4 v_originTextureCoordinateAndTranslate;      // texture coordinate at the origin, billboard translate (used for label glyphs)\\n\\\nin vec4 v_compressed;                               // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize\\n\\\nin mat2 v_rotationMatrix;\\n\\\n\\n\\\nconst float SHIFT_LEFT12 = 4096.0;\\n\\\nconst float SHIFT_LEFT1 = 2.0;\\n\\\n\\n\\\nconst float SHIFT_RIGHT12 = 1.0 / 4096.0;\\n\\\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\\n\\\n\\n\\\nfloat getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)\\n\\\n{\\n\\\n    vec2 lookupVector = imageSize * (depthLookupST - adjustedST);\\n\\\n    lookupVector = v_rotationMatrix * lookupVector;\\n\\\n    vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle.  Will be zero for billboards because dimensions and imageSize will be equal\\n\\\n\\n\\\n    vec2 translation = v_originTextureCoordinateAndTranslate.zw;\\n\\\n\\n\\\n    if (applyTranslate)\\n\\\n    {\\n\\\n        // this is only needed for labels where the horizontal origin is not LEFT\\n\\\n        // it moves the label back to where the \\\"origin\\\" should be since all label glyphs are set to HorizontalOrigin.LEFT\\n\\\n        translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));\\n\\\n    }\\n\\\n\\n\\\n    vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;\\n\\\n    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));\\n\\\n\\n\\\n    if (logDepthOrDepth == 0.0)\\n\\\n    {\\n\\\n        return 0.0; // not on the globe\\n\\\n    }\\n\\\n\\n\\\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\\n\\\n    return eyeCoordinate.z / eyeCoordinate.w;\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\n\\n\\\n#ifdef SDF\\n\\\n\\n\\\n// Get the distance from the edge of a glyph at a given position sampling an SDF texture.\\n\\\nfloat getDistance(vec2 position)\\n\\\n{\\n\\\n    return texture(u_atlas, position).r;\\n\\\n}\\n\\\n\\n\\\n// Samples the sdf texture at the given position and produces a color based on the fill color and the outline.\\n\\\nvec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)\\n\\\n{\\n\\\n    float distance = getDistance(position);\\n\\\n\\n\\\n    if (outlineWidth > 0.0)\\n\\\n    {\\n\\\n        // Don't get the outline edge exceed the SDF_EDGE\\n\\\n        float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);\\n\\\n        float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);\\n\\\n        vec4 sdfColor = mix(outlineColor, v_color, outlineFactor);\\n\\\n        float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);\\n\\\n        return vec4(sdfColor.rgb, sdfColor.a * alpha);\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);\\n\\\n        return vec4(v_color.rgb, v_color.a * alpha);\\n\\\n    }\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 color = texture(u_atlas, v_textureCoordinates);\\n\\\n\\n\\\n#ifdef SDF\\n\\\n    float outlineWidth = v_outlineWidth;\\n\\\n    vec4 outlineColor = v_outlineColor;\\n\\\n\\n\\\n    // Get the current distance\\n\\\n    float distance = getDistance(v_textureCoordinates);\\n\\\n\\n\\\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\\n\\\n    float smoothing = fwidth(distance);\\n\\\n    // Get an offset that is approximately half the distance to the neighbor pixels\\n\\\n    // 0.354 is approximately half of 1/sqrt(2)\\n\\\n    vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));\\n\\\n\\n\\\n    // Sample the center point\\n\\\n    vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);\\n\\\n\\n\\\n    // Sample the 4 neighbors\\n\\\n    vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);\\n\\\n    vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);\\n\\\n    vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);\\n\\\n    vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);\\n\\\n\\n\\\n    // Equally weight the center sample and the 4 neighboring samples\\n\\\n    color = (center + color1 + color2 + color3 + color4)/5.0;\\n\\\n#else\\n\\\n    // If no derivatives available (IE 10?), just do a single sample\\n\\\n    float smoothing = 1.0/32.0;\\n\\\n    color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);\\n\\\n#endif\\n\\\n\\n\\\n    color = czm_gammaCorrect(color);\\n\\\n#else\\n\\\n    color = czm_gammaCorrect(color);\\n\\\n    color *= czm_gammaCorrect(v_color);\\n\\\n#endif\\n\\\n\\n\\\n// Fully transparent parts of the billboard are not pickable.\\n\\\n#if !defined(OPAQUE) && !defined(TRANSLUCENT)\\n\\\n    if (color.a < 0.005)   // matches 0/255 and 1/255\\n\\\n    {\\n\\\n        discard;\\n\\\n    }\\n\\\n#else\\n\\\n// The billboard is rendered twice. The opaque pass discards translucent fragments\\n\\\n// and the translucent pass discards opaque fragments.\\n\\\n#ifdef OPAQUE\\n\\\n    if (color.a < 0.995)   // matches < 254/255\\n\\\n    {\\n\\\n        discard;\\n\\\n    }\\n\\\n#else\\n\\\n    if (color.a >= 0.995)  // matches 254/255 and 255/255\\n\\\n    {\\n\\\n        discard;\\n\\\n    }\\n\\\n#endif\\n\\\n#endif\\n\\\n\\n\\\n#ifdef VECTOR_TILE\\n\\\n    color *= u_highlightColor;\\n\\\n#endif\\n\\\n    out_FragColor = color;\\n\\\n\\n\\\n#ifdef LOG_DEPTH\\n\\\n    czm_writeLogDepth();\\n\\\n#endif\\n\\\n\\n\\\n#ifdef FRAGMENT_DEPTH_CHECK\\n\\\n    float temp = v_compressed.y;\\n\\\n\\n\\\n    temp = temp * SHIFT_RIGHT1;\\n\\\n\\n\\\n    float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;\\n\\\n    bool enableDepthTest = temp2 != 0.0;\\n\\\n    bool applyTranslate = floor(temp) != 0.0;\\n\\\n\\n\\\n    if (enableDepthTest) {\\n\\\n        temp = v_compressed.z;\\n\\\n        temp = temp * SHIFT_RIGHT12;\\n\\\n\\n\\\n        vec2 dimensions;\\n\\\n        dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;\\n\\\n        dimensions.x = floor(temp);\\n\\\n\\n\\\n        temp = v_compressed.w;\\n\\\n        temp = temp * SHIFT_RIGHT12;\\n\\\n\\n\\\n        vec2 imageSize;\\n\\\n        imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;\\n\\\n        imageSize.x = floor(temp);\\n\\\n\\n\\\n        vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;\\n\\\n        adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);\\n\\\n\\n\\\n        float epsilonEyeDepth = v_compressed.x + czm_epsilon1;\\n\\\n        float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);\\n\\\n\\n\\\n        // negative values go into the screen\\n\\\n        if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)\\n\\\n        {\\n\\\n            float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner\\n\\\n            if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)\\n\\\n            {\\n\\\n                float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner\\n\\\n                if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)\\n\\\n                {\\n\\\n                    discard;\\n\\\n                }\\n\\\n            }\\n\\\n        }\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef INSTANCED\\n\\\nin vec2 direction;\\n\\\n#endif\\n\\\nin vec4 positionHighAndScale;\\n\\\nin vec4 positionLowAndRotation;\\n\\\nin vec4 compressedAttribute0;                       // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset)\\n\\\nin vec4 compressedAttribute1;                       // aligned axis, translucency by distance, image width\\n\\\nin vec4 compressedAttribute2;                       // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free\\n\\\nin vec4 eyeOffset;                                  // eye offset in meters, 4 bytes free (texture range)\\n\\\nin vec4 scaleByDistance;                            // near, nearScale, far, farScale\\n\\\nin vec4 pixelOffsetScaleByDistance;                 // near, nearScale, far, farScale\\n\\\nin vec4 compressedAttribute3;                       // distance display condition near, far, disableDepthTestDistance, dimensions\\n\\\nin vec2 sdf;                                        // sdf outline color (rgb) and width (w)\\n\\\n#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)\\n\\\nin vec4 textureCoordinateBoundsOrLabelTranslate;    // the min and max x and y values for the texture coordinates\\n\\\n#endif\\n\\\n#ifdef VECTOR_TILE\\n\\\nin float a_batchId;\\n\\\n#endif\\n\\\n\\n\\\nout vec2 v_textureCoordinates;\\n\\\n#ifdef FRAGMENT_DEPTH_CHECK\\n\\\nout vec4 v_textureCoordinateBounds;\\n\\\nout vec4 v_originTextureCoordinateAndTranslate;\\n\\\nout vec4 v_compressed;                                 // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize\\n\\\nout mat2 v_rotationMatrix;\\n\\\n#endif\\n\\\n\\n\\\nout vec4 v_pickColor;\\n\\\nout vec4 v_color;\\n\\\n#ifdef SDF\\n\\\nout vec4 v_outlineColor;\\n\\\nout float v_outlineWidth;\\n\\\n#endif\\n\\\n\\n\\\nconst float UPPER_BOUND = 32768.0;\\n\\\n\\n\\\nconst float SHIFT_LEFT16 = 65536.0;\\n\\\nconst float SHIFT_LEFT12 = 4096.0;\\n\\\nconst float SHIFT_LEFT8 = 256.0;\\n\\\nconst float SHIFT_LEFT7 = 128.0;\\n\\\nconst float SHIFT_LEFT5 = 32.0;\\n\\\nconst float SHIFT_LEFT3 = 8.0;\\n\\\nconst float SHIFT_LEFT2 = 4.0;\\n\\\nconst float SHIFT_LEFT1 = 2.0;\\n\\\n\\n\\\nconst float SHIFT_RIGHT12 = 1.0 / 4096.0;\\n\\\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\\n\\\nconst float SHIFT_RIGHT7 = 1.0 / 128.0;\\n\\\nconst float SHIFT_RIGHT5 = 1.0 / 32.0;\\n\\\nconst float SHIFT_RIGHT3 = 1.0 / 8.0;\\n\\\nconst float SHIFT_RIGHT2 = 1.0 / 4.0;\\n\\\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\\n\\\n\\n\\\nvec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp)\\n\\\n{\\n\\\n    // Note the halfSize cannot be computed in JavaScript because it is sent via\\n\\\n    // compressed vertex attributes that coerce it to an integer.\\n\\\n    vec2 halfSize = imageSize * scale * 0.5;\\n\\\n    halfSize *= ((direction * 2.0) - 1.0);\\n\\\n\\n\\\n    vec2 originTranslate = origin * abs(halfSize);\\n\\\n\\n\\\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\\n\\\n    if (validAlignedAxis || rotation != 0.0)\\n\\\n    {\\n\\\n        float angle = rotation;\\n\\\n        if (validAlignedAxis)\\n\\\n        {\\n\\\n            vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0);\\n\\\n            angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /\\n\\\n                    (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));\\n\\\n        }\\n\\\n\\n\\\n        float cosTheta = cos(angle);\\n\\\n        float sinTheta = sin(angle);\\n\\\n        rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\\n\\\n        halfSize = rotationMatrix * halfSize;\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n    mpp = czm_metersPerPixel(positionEC);\\n\\\n    positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);\\n\\\n    positionEC.xy += (translate + pixelOffset) * mpp;\\n\\\n\\n\\\n    return positionEC;\\n\\\n}\\n\\\n\\n\\\n#ifdef VERTEX_DEPTH_CHECK\\n\\\nfloat getGlobeDepth(vec4 positionEC)\\n\\\n{\\n\\\n    vec4 posWC = czm_eyeToWindowCoordinates(positionEC);\\n\\\n\\n\\\n    float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));\\n\\\n\\n\\\n    if (globeDepth == 0.0)\\n\\\n    {\\n\\\n        return 0.0; // not on the globe\\n\\\n    }\\n\\\n\\n\\\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);\\n\\\n    return eyeCoordinate.z / eyeCoordinate.w;\\n\\\n}\\n\\\n#endif\\n\\\nvoid main()\\n\\\n{\\n\\\n    // Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition\\n\\\n\\n\\\n    // unpack attributes\\n\\\n    vec3 positionHigh = positionHighAndScale.xyz;\\n\\\n    vec3 positionLow = positionLowAndRotation.xyz;\\n\\\n    float scale = positionHighAndScale.w;\\n\\\n\\n\\\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\\n\\\n    float rotation = positionLowAndRotation.w;\\n\\\n#else\\n\\\n    float rotation = 0.0;\\n\\\n#endif\\n\\\n\\n\\\n    float compressed = compressedAttribute0.x;\\n\\\n\\n\\\n    vec2 pixelOffset;\\n\\\n    pixelOffset.x = floor(compressed * SHIFT_RIGHT7);\\n\\\n    compressed -= pixelOffset.x * SHIFT_LEFT7;\\n\\\n    pixelOffset.x -= UPPER_BOUND;\\n\\\n\\n\\\n    vec2 origin;\\n\\\n    origin.x = floor(compressed * SHIFT_RIGHT5);\\n\\\n    compressed -= origin.x * SHIFT_LEFT5;\\n\\\n\\n\\\n    origin.y = floor(compressed * SHIFT_RIGHT3);\\n\\\n    compressed -= origin.y * SHIFT_LEFT3;\\n\\\n\\n\\\n#ifdef FRAGMENT_DEPTH_CHECK\\n\\\n    vec2 depthOrigin = origin.xy;\\n\\\n#endif\\n\\\n    origin -= vec2(1.0);\\n\\\n\\n\\\n    float show = floor(compressed * SHIFT_RIGHT2);\\n\\\n    compressed -= show * SHIFT_LEFT2;\\n\\\n\\n\\\n#ifdef INSTANCED\\n\\\n    vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);\\n\\\n    vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);\\n\\\n    vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\\n\\\n#else\\n\\\n    vec2 direction;\\n\\\n    direction.x = floor(compressed * SHIFT_RIGHT1);\\n\\\n    direction.y = compressed - direction.x * SHIFT_LEFT1;\\n\\\n\\n\\\n    vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\\n\\\n#endif\\n\\\n\\n\\\n    float temp = compressedAttribute0.y  * SHIFT_RIGHT8;\\n\\\n    pixelOffset.y = -(floor(temp) - UPPER_BOUND);\\n\\\n\\n\\\n    vec2 translate;\\n\\\n    translate.y = (temp - floor(temp)) * SHIFT_LEFT16;\\n\\\n\\n\\\n    temp = compressedAttribute0.z * SHIFT_RIGHT8;\\n\\\n    translate.x = floor(temp) - UPPER_BOUND;\\n\\\n\\n\\\n    translate.y += (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    translate.y -= UPPER_BOUND;\\n\\\n\\n\\\n    temp = compressedAttribute1.x * SHIFT_RIGHT8;\\n\\\n    float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);\\n\\\n\\n\\\n    vec2 imageSize = vec2(floor(temp), temp2);\\n\\\n\\n\\\n#ifdef FRAGMENT_DEPTH_CHECK\\n\\\n    float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));\\n\\\n    float applyTranslate = 0.0;\\n\\\n    if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false\\n\\\n    {\\n\\\n        applyTranslate = 1.0;\\n\\\n        labelHorizontalOrigin -= 2.0;\\n\\\n        depthOrigin.x = labelHorizontalOrigin + 1.0;\\n\\\n    }\\n\\\n\\n\\\n    depthOrigin = vec2(1.0) - (depthOrigin * 0.5);\\n\\\n#endif\\n\\\n\\n\\\n#ifdef EYE_DISTANCE_TRANSLUCENCY\\n\\\n    vec4 translucencyByDistance;\\n\\\n    translucencyByDistance.x = compressedAttribute1.z;\\n\\\n    translucencyByDistance.z = compressedAttribute1.w;\\n\\\n\\n\\\n    translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\\n\\\n\\n\\\n    temp = compressedAttribute1.y * SHIFT_RIGHT8;\\n\\\n    translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\\n\\\n#endif\\n\\\n\\n\\\n#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)\\n\\\n    temp = compressedAttribute3.w;\\n\\\n    temp = temp * SHIFT_RIGHT12;\\n\\\n\\n\\\n    vec2 dimensions;\\n\\\n    dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;\\n\\\n    dimensions.x = floor(temp);\\n\\\n#endif\\n\\\n\\n\\\n#ifdef ALIGNED_AXIS\\n\\\n    vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));\\n\\\n    temp = compressedAttribute2.z * SHIFT_RIGHT5;\\n\\\n    bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;\\n\\\n#else\\n\\\n    vec3 alignedAxis = vec3(0.0);\\n\\\n    bool validAlignedAxis = false;\\n\\\n#endif\\n\\\n\\n\\\n    vec4 pickColor;\\n\\\n    vec4 color;\\n\\\n\\n\\\n    temp = compressedAttribute2.y;\\n\\\n    temp = temp * SHIFT_RIGHT8;\\n\\\n    pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    temp = floor(temp) * SHIFT_RIGHT8;\\n\\\n    pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    pickColor.r = floor(temp);\\n\\\n\\n\\\n    temp = compressedAttribute2.x;\\n\\\n    temp = temp * SHIFT_RIGHT8;\\n\\\n    color.b = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    temp = floor(temp) * SHIFT_RIGHT8;\\n\\\n    color.g = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    color.r = floor(temp);\\n\\\n\\n\\\n    temp = compressedAttribute2.z * SHIFT_RIGHT8;\\n\\\n    bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;\\n\\\n    temp = floor(temp) * SHIFT_RIGHT8;\\n\\\n\\n\\\n    pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    pickColor /= 255.0;\\n\\\n\\n\\\n    color.a = floor(temp);\\n\\\n    color /= 255.0;\\n\\\n\\n\\\n    ///////////////////////////////////////////////////////////////////////////\\n\\\n\\n\\\n    vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\\n\\\n    vec4 positionEC = czm_modelViewRelativeToEye * p;\\n\\\n\\n\\\n#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)\\n\\\n    float eyeDepth = positionEC.z;\\n\\\n#endif\\n\\\n\\n\\\n    positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\\n\\\n    positionEC.xyz *= show;\\n\\\n\\n\\\n    ///////////////////////////////////////////////////////////////////////////\\n\\\n\\n\\\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\\n\\\n    float lengthSq;\\n\\\n    if (czm_sceneMode == czm_sceneMode2D)\\n\\\n    {\\n\\\n        // 2D camera distance is a special case\\n\\\n        // treat all billboards as flattened to the z=0.0 plane\\n\\\n        lengthSq = czm_eyeHeight2D.y;\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        lengthSq = dot(positionEC.xyz, positionEC.xyz);\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n#ifdef EYE_DISTANCE_SCALING\\n\\\n    float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);\\n\\\n    scale *= distanceScale;\\n\\\n    translate *= distanceScale;\\n\\\n    // push vertex behind near plane for clipping\\n\\\n    if (scale == 0.0)\\n\\\n    {\\n\\\n        positionEC.xyz = vec3(0.0);\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n    float translucency = 1.0;\\n\\\n#ifdef EYE_DISTANCE_TRANSLUCENCY\\n\\\n    translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\\n\\\n    // push vertex behind near plane for clipping\\n\\\n    if (translucency == 0.0)\\n\\\n    {\\n\\\n        positionEC.xyz = vec3(0.0);\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\\n\\\n    float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\\n\\\n    pixelOffset *= pixelOffsetScale;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef DISTANCE_DISPLAY_CONDITION\\n\\\n    float nearSq = compressedAttribute3.x;\\n\\\n    float farSq = compressedAttribute3.y;\\n\\\n    if (lengthSq < nearSq || lengthSq > farSq)\\n\\\n    {\\n\\\n        positionEC.xyz = vec3(0.0);\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n    mat2 rotationMatrix;\\n\\\n    float mpp;\\n\\\n\\n\\\n#ifdef DISABLE_DEPTH_DISTANCE\\n\\\n    float disableDepthTestDistance = compressedAttribute3.z;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef VERTEX_DEPTH_CHECK\\n\\\nif (lengthSq < disableDepthTestDistance) {\\n\\\n    float depthsilon = 10.0;\\n\\\n\\n\\\n    vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;\\n\\\n    vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\\n\\\n    float globeDepth1 = getGlobeDepth(pEC1);\\n\\\n\\n\\\n    if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)\\n\\\n    {\\n\\\n        vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\\n\\\n        float globeDepth2 = getGlobeDepth(pEC2);\\n\\\n\\n\\\n        if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)\\n\\\n        {\\n\\\n            vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\\n\\\n            float globeDepth3 = getGlobeDepth(pEC3);\\n\\\n            if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)\\n\\\n            {\\n\\\n                positionEC.xyz = vec3(0.0);\\n\\\n            }\\n\\\n        }\\n\\\n    }\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\n    positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\\n\\\n    gl_Position = czm_projection * positionEC;\\n\\\n    v_textureCoordinates = textureCoordinates;\\n\\\n\\n\\\n#ifdef LOG_DEPTH\\n\\\n    czm_vertexLogDepth();\\n\\\n#endif\\n\\\n\\n\\\n#ifdef DISABLE_DEPTH_DISTANCE\\n\\\n    if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\\n\\\n    {\\n\\\n        disableDepthTestDistance = czm_minimumDisableDepthTestDistance;\\n\\\n    }\\n\\\n\\n\\\n    if (disableDepthTestDistance != 0.0)\\n\\\n    {\\n\\\n        // Don't try to \\\"multiply both sides\\\" by w.  Greater/less-than comparisons won't work for negative values of w.\\n\\\n        float zclip = gl_Position.z / gl_Position.w;\\n\\\n        bool clipped = (zclip < -1.0 || zclip > 1.0);\\n\\\n        if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\\n\\\n        {\\n\\\n            // Position z on the near plane.\\n\\\n            gl_Position.z = -gl_Position.w;\\n\\\n#ifdef LOG_DEPTH\\n\\\n            v_depthFromNearPlusOne = 1.0;\\n\\\n#endif\\n\\\n        }\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n#ifdef FRAGMENT_DEPTH_CHECK\\n\\\n    if (sizeInMeters) {\\n\\\n        translate /= mpp;\\n\\\n        dimensions /= mpp;\\n\\\n        imageSize /= mpp;\\n\\\n    }\\n\\\n\\n\\\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\\n\\\n    v_rotationMatrix = rotationMatrix;\\n\\\n#else\\n\\\n    v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);\\n\\\n#endif\\n\\\n\\n\\\n    float enableDepthCheck = 0.0;\\n\\\n    if (lengthSq < disableDepthTestDistance)\\n\\\n    {\\n\\\n        enableDepthCheck = 1.0;\\n\\\n    }\\n\\\n\\n\\\n    float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));\\n\\\n    float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));\\n\\\n\\n\\\n    float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));\\n\\\n    float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));\\n\\\n\\n\\\n    v_compressed.x = eyeDepth;\\n\\\n    v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;\\n\\\n    v_compressed.z = dw * SHIFT_LEFT12 + dh;\\n\\\n    v_compressed.w = iw * SHIFT_LEFT12 + ih;\\n\\\n    v_originTextureCoordinateAndTranslate.xy = depthOrigin;\\n\\\n    v_originTextureCoordinateAndTranslate.zw = translate;\\n\\\n    v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;\\n\\\n\\n\\\n#endif\\n\\\n\\n\\\n#ifdef SDF\\n\\\n    vec4 outlineColor;\\n\\\n    float outlineWidth;\\n\\\n\\n\\\n    temp = sdf.x;\\n\\\n    temp = temp * SHIFT_RIGHT8;\\n\\\n    outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    temp = floor(temp) * SHIFT_RIGHT8;\\n\\\n    outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    outlineColor.r = floor(temp);\\n\\\n\\n\\\n    temp = sdf.y;\\n\\\n    temp = temp * SHIFT_RIGHT8;\\n\\\n    float temp3 = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    temp = floor(temp) * SHIFT_RIGHT8;\\n\\\n    outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    outlineColor.a = floor(temp);\\n\\\n    outlineColor /= 255.0;\\n\\\n\\n\\\n    v_outlineWidth = outlineWidth / 255.0;\\n\\\n    v_outlineColor = outlineColor;\\n\\\n    v_outlineColor.a *= translucency;\\n\\\n#endif\\n\\\n\\n\\\n    v_pickColor = pickColor;\\n\\\n\\n\\\n    v_color = color;\\n\\\n    v_color.a *= translucency;\\n\\\n\\n\\\n}\\n\\\n\";\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport Resource from \"../Core/Resource.js\";\nimport HeightReference from \"./HeightReference.js\";\nimport HorizontalOrigin from \"./HorizontalOrigin.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport SceneTransforms from \"./SceneTransforms.js\";\nimport VerticalOrigin from \"./VerticalOrigin.js\";\n\n/**\n * <div class=\"notice\">\n * A billboard is created and its initial\n * properties are set by calling {@link BillboardCollection#add}. Do not call the constructor directly.\n * </div>\n * A viewport-aligned image positioned in the 3D scene, that is created\n * and rendered using a {@link BillboardCollection}.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Billboard.png' width='400' height='300' /><br />\n * Example billboards\n * </div>\n *\n * @alias Billboard\n *\n * @performance Reading a property, e.g., {@link Billboard#show}, is constant time.\n * Assigning to a property is constant time but results in\n * CPU to GPU traffic when {@link BillboardCollection#update} is called.  The per-billboard traffic is\n * the same regardless of how many properties were updated.  If most billboards in a collection need to be\n * updated, it may be more efficient to clear the collection with {@link BillboardCollection#removeAll}\n * and add new billboards instead of modifying each one.\n *\n * @exception {DeveloperError} scaleByDistance.far must be greater than scaleByDistance.near\n * @exception {DeveloperError} translucencyByDistance.far must be greater than translucencyByDistance.near\n * @exception {DeveloperError} pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near\n * @exception {DeveloperError} distanceDisplayCondition.far must be greater than distanceDisplayCondition.near\n *\n * @see BillboardCollection\n * @see BillboardCollection#add\n * @see Label\n *\n * @internalConstructor\n * @class\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Billboards.html|Cesium Sandcastle Billboard Demo}\n */\nfunction Billboard(options, billboardCollection) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    defined(options.disableDepthTestDistance) &&\n    options.disableDepthTestDistance < 0.0\n  ) {\n    throw new DeveloperError(\n      \"disableDepthTestDistance must be greater than or equal to 0.0.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  let translucencyByDistance = options.translucencyByDistance;\n  let pixelOffsetScaleByDistance = options.pixelOffsetScaleByDistance;\n  let scaleByDistance = options.scaleByDistance;\n  let distanceDisplayCondition = options.distanceDisplayCondition;\n  if (defined(translucencyByDistance)) {\n    //>>includeStart('debug', pragmas.debug);\n    if (translucencyByDistance.far <= translucencyByDistance.near) {\n      throw new DeveloperError(\n        \"translucencyByDistance.far must be greater than translucencyByDistance.near.\"\n      );\n    }\n    //>>includeEnd('debug');\n    translucencyByDistance = NearFarScalar.clone(translucencyByDistance);\n  }\n  if (defined(pixelOffsetScaleByDistance)) {\n    //>>includeStart('debug', pragmas.debug);\n    if (pixelOffsetScaleByDistance.far <= pixelOffsetScaleByDistance.near) {\n      throw new DeveloperError(\n        \"pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.\"\n      );\n    }\n    //>>includeEnd('debug');\n    pixelOffsetScaleByDistance = NearFarScalar.clone(\n      pixelOffsetScaleByDistance\n    );\n  }\n  if (defined(scaleByDistance)) {\n    //>>includeStart('debug', pragmas.debug);\n    if (scaleByDistance.far <= scaleByDistance.near) {\n      throw new DeveloperError(\n        \"scaleByDistance.far must be greater than scaleByDistance.near.\"\n      );\n    }\n    //>>includeEnd('debug');\n    scaleByDistance = NearFarScalar.clone(scaleByDistance);\n  }\n  if (defined(distanceDisplayCondition)) {\n    //>>includeStart('debug', pragmas.debug);\n    if (distanceDisplayCondition.far <= distanceDisplayCondition.near) {\n      throw new DeveloperError(\n        \"distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.\"\n      );\n    }\n    //>>includeEnd('debug');\n    distanceDisplayCondition = DistanceDisplayCondition.clone(\n      distanceDisplayCondition\n    );\n  }\n\n  this._show = defaultValue(options.show, true);\n  this._position = Cartesian3.clone(\n    defaultValue(options.position, Cartesian3.ZERO)\n  );\n  this._actualPosition = Cartesian3.clone(this._position); // For columbus view and 2D\n  this._pixelOffset = Cartesian2.clone(\n    defaultValue(options.pixelOffset, Cartesian2.ZERO)\n  );\n  this._translate = new Cartesian2(0.0, 0.0); // used by labels for glyph vertex translation\n  this._eyeOffset = Cartesian3.clone(\n    defaultValue(options.eyeOffset, Cartesian3.ZERO)\n  );\n  this._heightReference = defaultValue(\n    options.heightReference,\n    HeightReference.NONE\n  );\n  this._verticalOrigin = defaultValue(\n    options.verticalOrigin,\n    VerticalOrigin.CENTER\n  );\n  this._horizontalOrigin = defaultValue(\n    options.horizontalOrigin,\n    HorizontalOrigin.CENTER\n  );\n  this._scale = defaultValue(options.scale, 1.0);\n  this._color = Color.clone(defaultValue(options.color, Color.WHITE));\n  this._rotation = defaultValue(options.rotation, 0.0);\n  this._alignedAxis = Cartesian3.clone(\n    defaultValue(options.alignedAxis, Cartesian3.ZERO)\n  );\n  this._width = options.width;\n  this._height = options.height;\n  this._scaleByDistance = scaleByDistance;\n  this._translucencyByDistance = translucencyByDistance;\n  this._pixelOffsetScaleByDistance = pixelOffsetScaleByDistance;\n  this._sizeInMeters = defaultValue(options.sizeInMeters, false);\n  this._distanceDisplayCondition = distanceDisplayCondition;\n  this._disableDepthTestDistance = options.disableDepthTestDistance;\n  this._id = options.id;\n  this._collection = defaultValue(options.collection, billboardCollection);\n\n  this._pickId = undefined;\n  this._pickPrimitive = defaultValue(options._pickPrimitive, this);\n  this._billboardCollection = billboardCollection;\n  this._dirty = false;\n  this._index = -1; //Used only by BillboardCollection\n  this._batchIndex = undefined; // Used only by Vector3DTilePoints and BillboardCollection\n\n  this._imageIndex = -1;\n  this._imageIndexPromise = undefined;\n  this._imageId = undefined;\n  this._image = undefined;\n  this._imageSubRegion = undefined;\n  this._imageWidth = undefined;\n  this._imageHeight = undefined;\n\n  this._labelDimensions = undefined;\n  this._labelHorizontalOrigin = undefined;\n  this._labelTranslate = undefined;\n\n  const image = options.image;\n  let imageId = options.imageId;\n  if (defined(image)) {\n    if (!defined(imageId)) {\n      if (typeof image === \"string\") {\n        imageId = image;\n      } else if (defined(image.src)) {\n        imageId = image.src;\n      } else {\n        imageId = createGuid();\n      }\n    }\n\n    this._imageId = imageId;\n    this._image = image;\n  }\n\n  if (defined(options.imageSubRegion)) {\n    this._imageId = imageId;\n    this._imageSubRegion = options.imageSubRegion;\n  }\n\n  if (defined(this._billboardCollection._textureAtlas)) {\n    this._loadImage();\n  }\n\n  this._actualClampedPosition = undefined;\n  this._removeCallbackFunc = undefined;\n  this._mode = SceneMode.SCENE3D;\n\n  this._clusterShow = true;\n  this._outlineColor = Color.clone(\n    defaultValue(options.outlineColor, Color.BLACK)\n  );\n  this._outlineWidth = defaultValue(options.outlineWidth, 0.0);\n\n  this._updateClamping();\n}\n\nconst SHOW_INDEX = (Billboard.SHOW_INDEX = 0);\nconst POSITION_INDEX = (Billboard.POSITION_INDEX = 1);\nconst PIXEL_OFFSET_INDEX = (Billboard.PIXEL_OFFSET_INDEX = 2);\nconst EYE_OFFSET_INDEX = (Billboard.EYE_OFFSET_INDEX = 3);\nconst HORIZONTAL_ORIGIN_INDEX = (Billboard.HORIZONTAL_ORIGIN_INDEX = 4);\nconst VERTICAL_ORIGIN_INDEX = (Billboard.VERTICAL_ORIGIN_INDEX = 5);\nconst SCALE_INDEX = (Billboard.SCALE_INDEX = 6);\nconst IMAGE_INDEX_INDEX = (Billboard.IMAGE_INDEX_INDEX = 7);\nconst COLOR_INDEX = (Billboard.COLOR_INDEX = 8);\nconst ROTATION_INDEX = (Billboard.ROTATION_INDEX = 9);\nconst ALIGNED_AXIS_INDEX = (Billboard.ALIGNED_AXIS_INDEX = 10);\nconst SCALE_BY_DISTANCE_INDEX = (Billboard.SCALE_BY_DISTANCE_INDEX = 11);\nconst TRANSLUCENCY_BY_DISTANCE_INDEX = (Billboard.TRANSLUCENCY_BY_DISTANCE_INDEX = 12);\nconst PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX = (Billboard.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX = 13);\nconst DISTANCE_DISPLAY_CONDITION = (Billboard.DISTANCE_DISPLAY_CONDITION = 14);\nconst DISABLE_DEPTH_DISTANCE = (Billboard.DISABLE_DEPTH_DISTANCE = 15);\nBillboard.TEXTURE_COORDINATE_BOUNDS = 16;\nconst SDF_INDEX = (Billboard.SDF_INDEX = 17);\nBillboard.NUMBER_OF_PROPERTIES = 18;\n\nfunction makeDirty(billboard, propertyChanged) {\n  const billboardCollection = billboard._billboardCollection;\n  if (defined(billboardCollection)) {\n    billboardCollection._updateBillboard(billboard, propertyChanged);\n    billboard._dirty = true;\n  }\n}\n\nObject.defineProperties(Billboard.prototype, {\n  /**\n   * Determines if this billboard will be shown.  Use this to hide or show a billboard, instead\n   * of removing it and re-adding it to the collection.\n   * @memberof Billboard.prototype\n   * @type {boolean}\n   * @default true\n   */\n  show: {\n    get: function () {\n      return this._show;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.bool(\"value\", value);\n      //>>includeEnd('debug');\n\n      if (this._show !== value) {\n        this._show = value;\n        makeDirty(this, SHOW_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the Cartesian position of this billboard.\n   * @memberof Billboard.prototype\n   * @type {Cartesian3}\n   */\n  position: {\n    get: function () {\n      return this._position;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug)\n      Check.typeOf.object(\"value\", value);\n      //>>includeEnd('debug');\n\n      const position = this._position;\n      if (!Cartesian3.equals(position, value)) {\n        Cartesian3.clone(value, position);\n        Cartesian3.clone(value, this._actualPosition);\n        this._updateClamping();\n        makeDirty(this, POSITION_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the height reference of this billboard.\n   * @memberof Billboard.prototype\n   * @type {HeightReference}\n   * @default HeightReference.NONE\n   */\n  heightReference: {\n    get: function () {\n      return this._heightReference;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug)\n      Check.typeOf.number(\"value\", value);\n      //>>includeEnd('debug');\n\n      const heightReference = this._heightReference;\n      if (value !== heightReference) {\n        this._heightReference = value;\n        this._updateClamping();\n        makeDirty(this, POSITION_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the pixel offset in screen space from the origin of this billboard.  This is commonly used\n   * to align multiple billboards and labels at the same position, e.g., an image and text.  The\n   * screen space origin is the top, left corner of the canvas; <code>x</code> increases from\n   * left to right, and <code>y</code> increases from top to bottom.\n   * <br /><br />\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>\n   * <td align='center'><code>b.pixeloffset = new Cartesian2(50, 25);</code><br/><img src='Images/Billboard.setPixelOffset.x50y-25.png' width='250' height='188' /></td>\n   * </tr></table>\n   * The billboard's origin is indicated by the yellow point.\n   * </div>\n   * @memberof Billboard.prototype\n   * @type {Cartesian2}\n   */\n  pixelOffset: {\n    get: function () {\n      return this._pixelOffset;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.object(\"value\", value);\n      //>>includeEnd('debug');\n\n      const pixelOffset = this._pixelOffset;\n      if (!Cartesian2.equals(pixelOffset, value)) {\n        Cartesian2.clone(value, pixelOffset);\n        makeDirty(this, PIXEL_OFFSET_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets near and far scaling properties of a Billboard based on the billboard's distance from the camera.\n   * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the billboard's scale remains clamped to the nearest bound.  If undefined,\n   * scaleByDistance will be disabled.\n   * @memberof Billboard.prototype\n   * @type {NearFarScalar}\n   *\n   * @example\n   * // Example 1.\n   * // Set a billboard's scaleByDistance to scale by 1.5 when the\n   * // camera is 1500 meters from the billboard and disappear as\n   * // the camera distance approaches 8.0e6 meters.\n   * b.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);\n   *\n   * @example\n   * // Example 2.\n   * // disable scaling by distance\n   * b.scaleByDistance = undefined;\n   */\n  scaleByDistance: {\n    get: function () {\n      return this._scaleByDistance;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value)) {\n        Check.typeOf.object(\"value\", value);\n        if (value.far <= value.near) {\n          throw new DeveloperError(\n            \"far distance must be greater than near distance.\"\n          );\n        }\n      }\n      //>>includeEnd('debug');\n\n      const scaleByDistance = this._scaleByDistance;\n      if (!NearFarScalar.equals(scaleByDistance, value)) {\n        this._scaleByDistance = NearFarScalar.clone(value, scaleByDistance);\n        makeDirty(this, SCALE_BY_DISTANCE_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets near and far translucency properties of a Billboard based on the billboard's distance from the camera.\n   * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the billboard's translucency remains clamped to the nearest bound.  If undefined,\n   * translucencyByDistance will be disabled.\n   * @memberof Billboard.prototype\n   * @type {NearFarScalar}\n   *\n   * @example\n   * // Example 1.\n   * // Set a billboard's translucency to 1.0 when the\n   * // camera is 1500 meters from the billboard and disappear as\n   * // the camera distance approaches 8.0e6 meters.\n   * b.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);\n   *\n   * @example\n   * // Example 2.\n   * // disable translucency by distance\n   * b.translucencyByDistance = undefined;\n   */\n  translucencyByDistance: {\n    get: function () {\n      return this._translucencyByDistance;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value)) {\n        Check.typeOf.object(\"value\", value);\n        if (value.far <= value.near) {\n          throw new DeveloperError(\n            \"far distance must be greater than near distance.\"\n          );\n        }\n      }\n      //>>includeEnd('debug');\n\n      const translucencyByDistance = this._translucencyByDistance;\n      if (!NearFarScalar.equals(translucencyByDistance, value)) {\n        this._translucencyByDistance = NearFarScalar.clone(\n          value,\n          translucencyByDistance\n        );\n        makeDirty(this, TRANSLUCENCY_BY_DISTANCE_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets near and far pixel offset scaling properties of a Billboard based on the billboard's distance from the camera.\n   * A billboard's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the billboard's pixel offset scale remains clamped to the nearest bound.  If undefined,\n   * pixelOffsetScaleByDistance will be disabled.\n   * @memberof Billboard.prototype\n   * @type {NearFarScalar}\n   *\n   * @example\n   * // Example 1.\n   * // Set a billboard's pixel offset scale to 0.0 when the\n   * // camera is 1500 meters from the billboard and scale pixel offset to 10.0 pixels\n   * // in the y direction the camera distance approaches 8.0e6 meters.\n   * b.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);\n   * b.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);\n   *\n   * @example\n   * // Example 2.\n   * // disable pixel offset by distance\n   * b.pixelOffsetScaleByDistance = undefined;\n   */\n  pixelOffsetScaleByDistance: {\n    get: function () {\n      return this._pixelOffsetScaleByDistance;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value)) {\n        Check.typeOf.object(\"value\", value);\n        if (value.far <= value.near) {\n          throw new DeveloperError(\n            \"far distance must be greater than near distance.\"\n          );\n        }\n      }\n      //>>includeEnd('debug');\n\n      const pixelOffsetScaleByDistance = this._pixelOffsetScaleByDistance;\n      if (!NearFarScalar.equals(pixelOffsetScaleByDistance, value)) {\n        this._pixelOffsetScaleByDistance = NearFarScalar.clone(\n          value,\n          pixelOffsetScaleByDistance\n        );\n        makeDirty(this, PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the 3D Cartesian offset applied to this billboard in eye coordinates.  Eye coordinates is a left-handed\n   * coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and\n   * <code>z</code> points into the screen.  Eye coordinates use the same scale as world and model coordinates,\n   * which is typically meters.\n   * <br /><br />\n   * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to\n   * arrange a billboard above its corresponding 3D model.\n   * <br /><br />\n   * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always\n   * appear on top of the Earth regardless of the viewer's or Earth's orientation.\n   * <br /><br />\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>\n   * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>\n   * </tr></table>\n   * <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />\n   * </div>\n   * @memberof Billboard.prototype\n   * @type {Cartesian3}\n   */\n  eyeOffset: {\n    get: function () {\n      return this._eyeOffset;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.object(\"value\", value);\n      //>>includeEnd('debug');\n\n      const eyeOffset = this._eyeOffset;\n      if (!Cartesian3.equals(eyeOffset, value)) {\n        Cartesian3.clone(value, eyeOffset);\n        makeDirty(this, EYE_OFFSET_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the horizontal origin of this billboard, which determines if the billboard is\n   * to the left, center, or right of its anchor position.\n   * <br /><br />\n   * <div align='center'>\n   * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />\n   * </div>\n   * @memberof Billboard.prototype\n   * @type {HorizontalOrigin}\n   * @example\n   * // Use a bottom, left origin\n   * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;\n   * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;\n   */\n  horizontalOrigin: {\n    get: function () {\n      return this._horizontalOrigin;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number(\"value\", value);\n      //>>includeEnd('debug');\n\n      if (this._horizontalOrigin !== value) {\n        this._horizontalOrigin = value;\n        makeDirty(this, HORIZONTAL_ORIGIN_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the vertical origin of this billboard, which determines if the billboard is\n   * to the above, below, or at the center of its anchor position.\n   * <br /><br />\n   * <div align='center'>\n   * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />\n   * </div>\n   * @memberof Billboard.prototype\n   * @type {VerticalOrigin}\n   * @example\n   * // Use a bottom, left origin\n   * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;\n   * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;\n   */\n  verticalOrigin: {\n    get: function () {\n      return this._verticalOrigin;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number(\"value\", value);\n      //>>includeEnd('debug');\n\n      if (this._verticalOrigin !== value) {\n        this._verticalOrigin = value;\n        makeDirty(this, VERTICAL_ORIGIN_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the uniform scale that is multiplied with the billboard's image size in pixels.\n   * A scale of <code>1.0</code> does not change the size of the billboard; a scale greater than\n   * <code>1.0</code> enlarges the billboard; a positive scale less than <code>1.0</code> shrinks\n   * the billboard.\n   * <br /><br />\n   * <div align='center'>\n   * <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>\n   * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,\n   * and <code>2.0</code>.\n   * </div>\n   * @memberof Billboard.prototype\n   * @type {number}\n   */\n  scale: {\n    get: function () {\n      return this._scale;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number(\"value\", value);\n      //>>includeEnd('debug');\n\n      if (this._scale !== value) {\n        this._scale = value;\n        makeDirty(this, SCALE_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the color that is multiplied with the billboard's texture.  This has two common use cases.  First,\n   * the same white texture may be used by many different billboards, each with a different color, to create\n   * colored billboards.  Second, the color's alpha component can be used to make the billboard translucent as shown below.\n   * An alpha of <code>0.0</code> makes the billboard transparent, and <code>1.0</code> makes the billboard opaque.\n   * <br /><br />\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>\n   * <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>\n   * </tr></table>\n   * </div>\n   * <br />\n   * The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,\n   * <code>blue</code>, and <code>alpha</code> properties as shown in Example 1.  These components range from <code>0.0</code>\n   * (no intensity) to <code>1.0</code> (full intensity).\n   * @memberof Billboard.prototype\n   * @type {Color}\n   *\n   * @example\n   * // Example 1. Assign yellow.\n   * b.color = Cesium.Color.YELLOW;\n   *\n   * @example\n   * // Example 2. Make a billboard 50% translucent.\n   * b.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);\n   */\n  color: {\n    get: function () {\n      return this._color;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.object(\"value\", value);\n      //>>includeEnd('debug');\n\n      const color = this._color;\n      if (!Color.equals(color, value)) {\n        Color.clone(value, color);\n        makeDirty(this, COLOR_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the rotation angle in radians.\n   * @memberof Billboard.prototype\n   * @type {number}\n   */\n  rotation: {\n    get: function () {\n      return this._rotation;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number(\"value\", value);\n      //>>includeEnd('debug');\n\n      if (this._rotation !== value) {\n        this._rotation = value;\n        makeDirty(this, ROTATION_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the aligned axis in world space. The aligned axis is the unit vector that the billboard up vector points towards.\n   * The default is the zero vector, which means the billboard is aligned to the screen up vector.\n   * @memberof Billboard.prototype\n   * @type {Cartesian3}\n   * @example\n   * // Example 1.\n   * // Have the billboard up vector point north\n   * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;\n   *\n   * @example\n   * // Example 2.\n   * // Have the billboard point east.\n   * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;\n   * billboard.rotation = -Cesium.Math.PI_OVER_TWO;\n   *\n   * @example\n   * // Example 3.\n   * // Reset the aligned axis\n   * billboard.alignedAxis = Cesium.Cartesian3.ZERO;\n   */\n  alignedAxis: {\n    get: function () {\n      return this._alignedAxis;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.object(\"value\", value);\n      //>>includeEnd('debug');\n\n      const alignedAxis = this._alignedAxis;\n      if (!Cartesian3.equals(alignedAxis, value)) {\n        Cartesian3.clone(value, alignedAxis);\n        makeDirty(this, ALIGNED_AXIS_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets a width for the billboard. If undefined, the image width will be used.\n   * @memberof Billboard.prototype\n   * @type {number}\n   */\n  width: {\n    get: function () {\n      return defaultValue(this._width, this._imageWidth);\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value)) {\n        Check.typeOf.number(\"value\", value);\n      }\n      //>>includeEnd('debug');\n      if (this._width !== value) {\n        this._width = value;\n        makeDirty(this, IMAGE_INDEX_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets a height for the billboard. If undefined, the image height will be used.\n   * @memberof Billboard.prototype\n   * @type {number}\n   */\n  height: {\n    get: function () {\n      return defaultValue(this._height, this._imageHeight);\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value)) {\n        Check.typeOf.number(\"value\", value);\n      }\n      //>>includeEnd('debug');\n      if (this._height !== value) {\n        this._height = value;\n        makeDirty(this, IMAGE_INDEX_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets if the billboard size is in meters or pixels. <code>true</code> to size the billboard in meters;\n   * otherwise, the size is in pixels.\n   * @memberof Billboard.prototype\n   * @type {boolean}\n   * @default false\n   */\n  sizeInMeters: {\n    get: function () {\n      return this._sizeInMeters;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.bool(\"value\", value);\n      //>>includeEnd('debug');\n      if (this._sizeInMeters !== value) {\n        this._sizeInMeters = value;\n        makeDirty(this, COLOR_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the condition specifying at what distance from the camera that this billboard will be displayed.\n   * @memberof Billboard.prototype\n   * @type {DistanceDisplayCondition}\n   * @default undefined\n   */\n  distanceDisplayCondition: {\n    get: function () {\n      return this._distanceDisplayCondition;\n    },\n    set: function (value) {\n      if (\n        !DistanceDisplayCondition.equals(value, this._distanceDisplayCondition)\n      ) {\n        //>>includeStart('debug', pragmas.debug);\n        if (defined(value)) {\n          Check.typeOf.object(\"value\", value);\n          if (value.far <= value.near) {\n            throw new DeveloperError(\n              \"far distance must be greater than near distance.\"\n            );\n          }\n        }\n        //>>includeEnd('debug');\n        this._distanceDisplayCondition = DistanceDisplayCondition.clone(\n          value,\n          this._distanceDisplayCondition\n        );\n        makeDirty(this, DISTANCE_DISPLAY_CONDITION);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.\n   * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.\n   * @memberof Billboard.prototype\n   * @type {number}\n   */\n  disableDepthTestDistance: {\n    get: function () {\n      return this._disableDepthTestDistance;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value)) {\n        Check.typeOf.number(\"value\", value);\n        if (value < 0.0) {\n          throw new DeveloperError(\n            \"disableDepthTestDistance must be greater than or equal to 0.0.\"\n          );\n        }\n      }\n      //>>includeEnd('debug');\n      if (this._disableDepthTestDistance !== value) {\n        this._disableDepthTestDistance = value;\n        makeDirty(this, DISABLE_DEPTH_DISTANCE);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the user-defined object returned when the billboard is picked.\n   * @memberof Billboard.prototype\n   * @type {object}\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n    set: function (value) {\n      this._id = value;\n      if (defined(this._pickId)) {\n        this._pickId.object.id = value;\n      }\n    },\n  },\n\n  /**\n   * The primitive to return when picking this billboard.\n   * @memberof Billboard.prototype\n   * @private\n   */\n  pickPrimitive: {\n    get: function () {\n      return this._pickPrimitive;\n    },\n    set: function (value) {\n      this._pickPrimitive = value;\n      if (defined(this._pickId)) {\n        this._pickId.object.primitive = value;\n      }\n    },\n  },\n\n  /**\n   * @private\n   */\n  pickId: {\n    get: function () {\n      return this._pickId;\n    },\n  },\n\n  /**\n   * <p>\n   * Gets or sets the image to be used for this billboard.  If a texture has already been created for the\n   * given image, the existing texture is used.\n   * </p>\n   * <p>\n   * This property can be set to a loaded Image, a URL which will be loaded as an Image automatically,\n   * a canvas, or another billboard's image property (from the same billboard collection).\n   * </p>\n   *\n   * @memberof Billboard.prototype\n   * @type {string}\n   * @example\n   * // load an image from a URL\n   * b.image = 'some/image/url.png';\n   *\n   * // assuming b1 and b2 are billboards in the same billboard collection,\n   * // use the same image for both billboards.\n   * b2.image = b1.image;\n   */\n  image: {\n    get: function () {\n      return this._imageId;\n    },\n    set: function (value) {\n      if (!defined(value)) {\n        this._imageIndex = -1;\n        this._imageSubRegion = undefined;\n        this._imageId = undefined;\n        this._image = undefined;\n        this._imageIndexPromise = undefined;\n        makeDirty(this, IMAGE_INDEX_INDEX);\n      } else if (typeof value === \"string\") {\n        this.setImage(value, value);\n      } else if (value instanceof Resource) {\n        this.setImage(value.url, value);\n      } else if (defined(value.src)) {\n        this.setImage(value.src, value);\n      } else {\n        this.setImage(createGuid(), value);\n      }\n    },\n  },\n\n  /**\n   * When <code>true</code>, this billboard is ready to render, i.e., the image\n   * has been downloaded and the WebGL resources are created.\n   *\n   * @memberof Billboard.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  ready: {\n    get: function () {\n      return this._imageIndex !== -1;\n    },\n  },\n\n  /**\n   * Keeps track of the position of the billboard based on the height reference.\n   * @memberof Billboard.prototype\n   * @type {Cartesian3}\n   * @private\n   */\n  _clampedPosition: {\n    get: function () {\n      return this._actualClampedPosition;\n    },\n    set: function (value) {\n      this._actualClampedPosition = Cartesian3.clone(\n        value,\n        this._actualClampedPosition\n      );\n      makeDirty(this, POSITION_INDEX);\n    },\n  },\n\n  /**\n   * Determines whether or not this billboard will be shown or hidden because it was clustered.\n   * @memberof Billboard.prototype\n   * @type {boolean}\n   * @private\n   */\n  clusterShow: {\n    get: function () {\n      return this._clusterShow;\n    },\n    set: function (value) {\n      if (this._clusterShow !== value) {\n        this._clusterShow = value;\n        makeDirty(this, SHOW_INDEX);\n      }\n    },\n  },\n\n  /**\n   * The outline color of this Billboard.  Effective only for SDF billboards like Label glyphs.\n   * @memberof Billboard.prototype\n   * @type {Color}\n   * @private\n   */\n  outlineColor: {\n    get: function () {\n      return this._outlineColor;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      const outlineColor = this._outlineColor;\n      if (!Color.equals(outlineColor, value)) {\n        Color.clone(value, outlineColor);\n        makeDirty(this, SDF_INDEX);\n      }\n    },\n  },\n\n  /**\n   * The outline width of this Billboard in pixels.  Effective only for SDF billboards like Label glyphs.\n   * @memberof Billboard.prototype\n   * @type {number}\n   * @private\n   */\n  outlineWidth: {\n    get: function () {\n      return this._outlineWidth;\n    },\n    set: function (value) {\n      if (this._outlineWidth !== value) {\n        this._outlineWidth = value;\n        makeDirty(this, SDF_INDEX);\n      }\n    },\n  },\n});\n\nBillboard.prototype.getPickId = function (context) {\n  if (!defined(this._pickId)) {\n    this._pickId = context.createPickId({\n      primitive: this._pickPrimitive,\n      collection: this._collection,\n      id: this._id,\n    });\n  }\n\n  return this._pickId;\n};\n\nBillboard.prototype._updateClamping = function () {\n  Billboard._updateClamping(this._billboardCollection, this);\n};\n\nconst scratchCartographic = new Cartographic();\nconst scratchPosition = new Cartesian3();\n\nBillboard._updateClamping = function (collection, owner) {\n  const scene = collection._scene;\n  if (!defined(scene) || !defined(scene.globe)) {\n    //>>includeStart('debug', pragmas.debug);\n    if (owner._heightReference !== HeightReference.NONE) {\n      throw new DeveloperError(\n        \"Height reference is not supported without a scene and globe.\"\n      );\n    }\n    //>>includeEnd('debug');\n    return;\n  }\n\n  const globe = scene.globe;\n  const ellipsoid = globe.ellipsoid;\n  const surface = globe._surface;\n\n  const mode = scene.frameState.mode;\n\n  const modeChanged = mode !== owner._mode;\n  owner._mode = mode;\n\n  if (\n    (owner._heightReference === HeightReference.NONE || modeChanged) &&\n    defined(owner._removeCallbackFunc)\n  ) {\n    owner._removeCallbackFunc();\n    owner._removeCallbackFunc = undefined;\n    owner._clampedPosition = undefined;\n  }\n\n  if (\n    owner._heightReference === HeightReference.NONE ||\n    !defined(owner._position)\n  ) {\n    return;\n  }\n\n  const position = ellipsoid.cartesianToCartographic(owner._position);\n  if (!defined(position)) {\n    owner._actualClampedPosition = undefined;\n    return;\n  }\n\n  if (defined(owner._removeCallbackFunc)) {\n    owner._removeCallbackFunc();\n  }\n\n  function updateFunction(clampedPosition) {\n    if (owner._heightReference === HeightReference.RELATIVE_TO_GROUND) {\n      if (owner._mode === SceneMode.SCENE3D) {\n        const clampedCart = ellipsoid.cartesianToCartographic(\n          clampedPosition,\n          scratchCartographic\n        );\n        clampedCart.height += position.height;\n        ellipsoid.cartographicToCartesian(clampedCart, clampedPosition);\n      } else {\n        clampedPosition.x += position.height;\n      }\n    }\n    owner._clampedPosition = Cartesian3.clone(\n      clampedPosition,\n      owner._clampedPosition\n    );\n  }\n  owner._removeCallbackFunc = surface.updateHeight(position, updateFunction);\n\n  Cartographic.clone(position, scratchCartographic);\n  const height = globe.getHeight(position);\n  if (defined(height)) {\n    scratchCartographic.height = height;\n  }\n\n  ellipsoid.cartographicToCartesian(scratchCartographic, scratchPosition);\n\n  updateFunction(scratchPosition);\n};\n\nBillboard.prototype._loadImage = function () {\n  const atlas = this._billboardCollection._textureAtlas;\n\n  const imageId = this._imageId;\n  const image = this._image;\n  const imageSubRegion = this._imageSubRegion;\n  let imageIndexPromise;\n\n  const that = this;\n  function completeImageLoad(index) {\n    if (\n      that._imageId !== imageId ||\n      that._image !== image ||\n      !BoundingRectangle.equals(that._imageSubRegion, imageSubRegion)\n    ) {\n      // another load occurred before this one finished, ignore the index\n      return;\n    }\n\n    // fill in imageWidth and imageHeight\n    const textureCoordinates = atlas.textureCoordinates[index];\n    that._imageWidth = atlas.texture.width * textureCoordinates.width;\n    that._imageHeight = atlas.texture.height * textureCoordinates.height;\n\n    that._imageIndex = index;\n    that._ready = true;\n    that._image = undefined;\n    that._imageIndexPromise = undefined;\n    makeDirty(that, IMAGE_INDEX_INDEX);\n\n    const scene = that._billboardCollection._scene;\n    if (!defined(scene)) {\n      return;\n    }\n    // Request a new render in request render mode\n    scene.frameState.afterRender.push(() => true);\n  }\n\n  if (defined(image)) {\n    imageIndexPromise = atlas.addImage(imageId, image);\n  }\n  if (defined(imageSubRegion)) {\n    imageIndexPromise = atlas.addSubRegion(imageId, imageSubRegion);\n  }\n\n  this._imageIndexPromise = imageIndexPromise;\n\n  if (!defined(imageIndexPromise)) {\n    return;\n  }\n\n  // If the promise has already successfully resolved, we can return immediately without waiting a frame\n  const index = atlas.getImageIndex(imageId);\n  if (defined(index) && !defined(imageSubRegion)) {\n    completeImageLoad(index);\n    return;\n  }\n\n  imageIndexPromise.then(completeImageLoad).catch(function (error) {\n    console.error(`Error loading image for billboard: ${error}`);\n    that._imageIndexPromise = undefined;\n  });\n};\n\n/**\n * <p>\n * Sets the image to be used for this billboard.  If a texture has already been created for the\n * given id, the existing texture is used.\n * </p>\n * <p>\n * This function is useful for dynamically creating textures that are shared across many billboards.\n * Only the first billboard will actually call the function and create the texture, while subsequent\n * billboards created with the same id will simply re-use the existing texture.\n * </p>\n * <p>\n * To load an image from a URL, setting the {@link Billboard#image} property is more convenient.\n * </p>\n *\n * @param {string} id The id of the image.  This can be any string that uniquely identifies the image.\n * @param {HTMLImageElement|HTMLCanvasElement|string|Resource|Billboard.CreateImageCallback} image The image to load.  This parameter\n *        can either be a loaded Image or Canvas, a URL which will be loaded as an Image automatically,\n *        or a function which will be called to create the image if it hasn't been loaded already.\n * @example\n * // create a billboard image dynamically\n * function drawImage(id) {\n *   // create and draw an image using a canvas\n *   const canvas = document.createElement('canvas');\n *   const context2D = canvas.getContext('2d');\n *   // ... draw image\n *   return canvas;\n * }\n * // drawImage will be called to create the texture\n * b.setImage('myImage', drawImage);\n *\n * // subsequent billboards created in the same collection using the same id will use the existing\n * // texture, without the need to create the canvas or draw the image\n * b2.setImage('myImage', drawImage);\n */\nBillboard.prototype.setImage = function (id, image) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(id)) {\n    throw new DeveloperError(\"id is required.\");\n  }\n  if (!defined(image)) {\n    throw new DeveloperError(\"image is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (this._imageId === id) {\n    return;\n  }\n\n  this._imageIndex = -1;\n  this._imageSubRegion = undefined;\n  this._imageId = id;\n  this._image = image;\n\n  if (defined(this._billboardCollection._textureAtlas)) {\n    this._loadImage();\n  }\n};\n\n/**\n * Uses a sub-region of the image with the given id as the image for this billboard,\n * measured in pixels from the bottom-left.\n *\n * @param {string} id The id of the image to use.\n * @param {BoundingRectangle} subRegion The sub-region of the image.\n *\n * @exception {RuntimeError} image with id must be in the atlas\n */\nBillboard.prototype.setImageSubRegion = function (id, subRegion) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(id)) {\n    throw new DeveloperError(\"id is required.\");\n  }\n  if (!defined(subRegion)) {\n    throw new DeveloperError(\"subRegion is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (\n    this._imageId === id &&\n    BoundingRectangle.equals(this._imageSubRegion, subRegion)\n  ) {\n    return;\n  }\n\n  this._imageIndex = -1;\n  this._imageId = id;\n  this._imageSubRegion = BoundingRectangle.clone(subRegion);\n\n  if (defined(this._billboardCollection._textureAtlas)) {\n    this._loadImage();\n  }\n};\n\nBillboard.prototype._setTranslate = function (value) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const translate = this._translate;\n  if (!Cartesian2.equals(translate, value)) {\n    Cartesian2.clone(value, translate);\n    makeDirty(this, PIXEL_OFFSET_INDEX);\n  }\n};\n\nBillboard.prototype._getActualPosition = function () {\n  return defined(this._clampedPosition)\n    ? this._clampedPosition\n    : this._actualPosition;\n};\n\nBillboard.prototype._setActualPosition = function (value) {\n  if (!defined(this._clampedPosition)) {\n    Cartesian3.clone(value, this._actualPosition);\n  }\n  makeDirty(this, POSITION_INDEX);\n};\n\nconst tempCartesian3 = new Cartesian4();\nBillboard._computeActualPosition = function (\n  billboard,\n  position,\n  frameState,\n  modelMatrix\n) {\n  if (defined(billboard._clampedPosition)) {\n    if (frameState.mode !== billboard._mode) {\n      billboard._updateClamping();\n    }\n    return billboard._clampedPosition;\n  } else if (frameState.mode === SceneMode.SCENE3D) {\n    return position;\n  }\n\n  Matrix4.multiplyByPoint(modelMatrix, position, tempCartesian3);\n  return SceneTransforms.computeActualWgs84Position(frameState, tempCartesian3);\n};\n\nconst scratchCartesian3 = new Cartesian3();\n\n// This function is basically a stripped-down JavaScript version of BillboardCollectionVS.glsl\nBillboard._computeScreenSpacePosition = function (\n  modelMatrix,\n  position,\n  eyeOffset,\n  pixelOffset,\n  scene,\n  result\n) {\n  // Model to world coordinates\n  const positionWorld = Matrix4.multiplyByPoint(\n    modelMatrix,\n    position,\n    scratchCartesian3\n  );\n\n  // World to window coordinates\n  const positionWC = SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates(\n    scene,\n    positionWorld,\n    eyeOffset,\n    result\n  );\n  if (!defined(positionWC)) {\n    return undefined;\n  }\n\n  // Apply pixel offset\n  Cartesian2.add(positionWC, pixelOffset, positionWC);\n\n  return positionWC;\n};\n\nconst scratchPixelOffset = new Cartesian2(0.0, 0.0);\n\n/**\n * Computes the screen-space position of the billboard's origin, taking into account eye and pixel offsets.\n * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from\n * left to right, and <code>y</code> increases from top to bottom.\n *\n * @param {Scene} scene The scene.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The screen-space position of the billboard.\n *\n * @exception {DeveloperError} Billboard must be in a collection.\n *\n * @example\n * console.log(b.computeScreenSpacePosition(scene).toString());\n *\n * @see Billboard#eyeOffset\n * @see Billboard#pixelOffset\n */\nBillboard.prototype.computeScreenSpacePosition = function (scene, result) {\n  const billboardCollection = this._billboardCollection;\n  if (!defined(result)) {\n    result = new Cartesian2();\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(billboardCollection)) {\n    throw new DeveloperError(\n      \"Billboard must be in a collection.  Was it removed?\"\n    );\n  }\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  // pixel offset for screen space computation is the pixelOffset + screen space translate\n  Cartesian2.clone(this._pixelOffset, scratchPixelOffset);\n  Cartesian2.add(scratchPixelOffset, this._translate, scratchPixelOffset);\n\n  let modelMatrix = billboardCollection.modelMatrix;\n  let position = this._position;\n  if (defined(this._clampedPosition)) {\n    position = this._clampedPosition;\n    if (scene.mode !== SceneMode.SCENE3D) {\n      // position needs to be in world coordinates\n      const projection = scene.mapProjection;\n      const ellipsoid = projection.ellipsoid;\n      const cart = projection.unproject(position, scratchCartographic);\n      position = ellipsoid.cartographicToCartesian(cart, scratchCartesian3);\n      modelMatrix = Matrix4.IDENTITY;\n    }\n  }\n\n  const windowCoordinates = Billboard._computeScreenSpacePosition(\n    modelMatrix,\n    position,\n    this._eyeOffset,\n    scratchPixelOffset,\n    scene,\n    result\n  );\n  return windowCoordinates;\n};\n\n/**\n * Gets a billboard's screen space bounding box centered around screenSpacePosition.\n * @param {Billboard} billboard The billboard to get the screen space bounding box for.\n * @param {Cartesian2} screenSpacePosition The screen space center of the label.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The screen space bounding box.\n *\n * @private\n */\nBillboard.getScreenSpaceBoundingBox = function (\n  billboard,\n  screenSpacePosition,\n  result\n) {\n  let width = billboard.width;\n  let height = billboard.height;\n\n  const scale = billboard.scale;\n  width *= scale;\n  height *= scale;\n\n  let x = screenSpacePosition.x;\n  if (billboard.horizontalOrigin === HorizontalOrigin.RIGHT) {\n    x -= width;\n  } else if (billboard.horizontalOrigin === HorizontalOrigin.CENTER) {\n    x -= width * 0.5;\n  }\n\n  let y = screenSpacePosition.y;\n  if (\n    billboard.verticalOrigin === VerticalOrigin.BOTTOM ||\n    billboard.verticalOrigin === VerticalOrigin.BASELINE\n  ) {\n    y -= height;\n  } else if (billboard.verticalOrigin === VerticalOrigin.CENTER) {\n    y -= height * 0.5;\n  }\n\n  if (!defined(result)) {\n    result = new BoundingRectangle();\n  }\n\n  result.x = x;\n  result.y = y;\n  result.width = width;\n  result.height = height;\n\n  return result;\n};\n\n/**\n * Determines if this billboard equals another billboard.  Billboards are equal if all their properties\n * are equal.  Billboards in different collections can be equal.\n *\n * @param {Billboard} other The billboard to compare for equality.\n * @returns {boolean} <code>true</code> if the billboards are equal; otherwise, <code>false</code>.\n */\nBillboard.prototype.equals = function (other) {\n  return (\n    this === other ||\n    (defined(other) &&\n      this._id === other._id &&\n      Cartesian3.equals(this._position, other._position) &&\n      this._imageId === other._imageId &&\n      this._show === other._show &&\n      this._scale === other._scale &&\n      this._verticalOrigin === other._verticalOrigin &&\n      this._horizontalOrigin === other._horizontalOrigin &&\n      this._heightReference === other._heightReference &&\n      BoundingRectangle.equals(this._imageSubRegion, other._imageSubRegion) &&\n      Color.equals(this._color, other._color) &&\n      Cartesian2.equals(this._pixelOffset, other._pixelOffset) &&\n      Cartesian2.equals(this._translate, other._translate) &&\n      Cartesian3.equals(this._eyeOffset, other._eyeOffset) &&\n      NearFarScalar.equals(this._scaleByDistance, other._scaleByDistance) &&\n      NearFarScalar.equals(\n        this._translucencyByDistance,\n        other._translucencyByDistance\n      ) &&\n      NearFarScalar.equals(\n        this._pixelOffsetScaleByDistance,\n        other._pixelOffsetScaleByDistance\n      ) &&\n      DistanceDisplayCondition.equals(\n        this._distanceDisplayCondition,\n        other._distanceDisplayCondition\n      ) &&\n      this._disableDepthTestDistance === other._disableDepthTestDistance)\n  );\n};\n\nBillboard.prototype._destroy = function () {\n  if (defined(this._customData)) {\n    this._billboardCollection._scene.globe._surface.removeTileCustomData(\n      this._customData\n    );\n    this._customData = undefined;\n  }\n\n  if (defined(this._removeCallbackFunc)) {\n    this._removeCallbackFunc();\n    this._removeCallbackFunc = undefined;\n  }\n\n  this.image = undefined;\n  this._pickId = this._pickId && this._pickId.destroy();\n  this._billboardCollection = undefined;\n};\n\n/**\n * A function that creates an image.\n * @callback Billboard.CreateImageCallback\n * @param {string} id The identifier of the image to load.\n * @returns {HTMLImageElement|HTMLCanvasElement|Promise<HTMLImageElement|HTMLCanvasElement>} The image, or a promise that will resolve to an image.\n */\nexport default Billboard;\n", "/**\n * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene.\n *\n * @enum {number}\n */\nconst BlendOption = {\n  /**\n   * The billboards, points, or labels in the collection are completely opaque.\n   * @type {number}\n   * @constant\n   */\n  OPAQUE: 0,\n\n  /**\n   * The billboards, points, or labels in the collection are completely translucent.\n   * @type {number}\n   * @constant\n   */\n  TRANSLUCENT: 1,\n\n  /**\n   * The billboards, points, or labels in the collection are both opaque and translucent.\n   * @type {number}\n   * @constant\n   */\n  OPAQUE_AND_TRANSLUCENT: 2,\n};\nexport default Object.freeze(BlendOption);\n", "/**\n * Settings for the generation of signed distance field glyphs\n *\n * @private\n */\nconst SDFSettings = {\n  /**\n   * The font size in pixels\n   *\n   * @type {number}\n   * @constant\n   */\n  FONT_SIZE: 48.0,\n\n  /**\n   * Whitespace padding around glyphs.\n   *\n   * @type {number}\n   * @constant\n   */\n  PADDING: 10.0,\n\n  /**\n   * How many pixels around the glyph shape to use for encoding distance\n   *\n   * @type {number}\n   * @constant\n   */\n  RADIUS: 8.0,\n\n  /**\n   * How much of the radius (relative) is used for the inside part the glyph.\n   *\n   * @type {number}\n   * @constant\n   */\n  CUTOFF: 0.25,\n};\nexport default Object.freeze(SDFSettings);\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Framebuffer from \"../Renderer/Framebuffer.js\";\nimport Texture from \"../Renderer/Texture.js\";\n\n// The atlas is made up of regions of space called nodes that contain images or child nodes.\nfunction TextureAtlasNode(\n  bottomLeft,\n  topRight,\n  childNode1,\n  childNode2,\n  imageIndex\n) {\n  this.bottomLeft = defaultValue(bottomLeft, Cartesian2.ZERO);\n  this.topRight = defaultValue(topRight, Cartesian2.ZERO);\n  this.childNode1 = childNode1;\n  this.childNode2 = childNode2;\n  this.imageIndex = imageIndex;\n}\n\nconst defaultInitialSize = new Cartesian2(16.0, 16.0);\n\n/**\n * A TextureAtlas stores multiple images in one square texture and keeps\n * track of the texture coordinates for each image. TextureAtlas is dynamic,\n * meaning new images can be added at any point in time.\n * Texture coordinates are subject to change if the texture atlas resizes, so it is\n * important to check {@link TextureAtlas#getGUID} before using old values.\n *\n * @alias TextureAtlas\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Scene} options.context The context in which the texture gets created.\n * @param {PixelFormat} [options.pixelFormat=PixelFormat.RGBA] The pixel format of the texture.\n * @param {number} [options.borderWidthInPixels=1] The amount of spacing between adjacent images in pixels.\n * @param {Cartesian2} [options.initialSize=new Cartesian2(16.0, 16.0)] The initial side lengths of the texture.\n *\n * @exception {DeveloperError} borderWidthInPixels must be greater than or equal to zero.\n * @exception {DeveloperError} initialSize must be greater than zero.\n *\n * @private\n */\nfunction TextureAtlas(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const borderWidthInPixels = defaultValue(options.borderWidthInPixels, 1.0);\n  const initialSize = defaultValue(options.initialSize, defaultInitialSize);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options.context)) {\n    throw new DeveloperError(\"context is required.\");\n  }\n  if (borderWidthInPixels < 0) {\n    throw new DeveloperError(\n      \"borderWidthInPixels must be greater than or equal to zero.\"\n    );\n  }\n  if (initialSize.x < 1 || initialSize.y < 1) {\n    throw new DeveloperError(\"initialSize must be greater than zero.\");\n  }\n  //>>includeEnd('debug');\n\n  this._context = options.context;\n  this._pixelFormat = defaultValue(options.pixelFormat, PixelFormat.RGBA);\n  this._borderWidthInPixels = borderWidthInPixels;\n  this._textureCoordinates = [];\n  this._guid = createGuid();\n  this._idHash = {};\n  this._indexHash = {};\n  this._initialSize = initialSize;\n\n  this._root = undefined;\n}\n\nObject.defineProperties(TextureAtlas.prototype, {\n  /**\n   * The amount of spacing between adjacent images in pixels.\n   * @memberof TextureAtlas.prototype\n   * @type {number}\n   */\n  borderWidthInPixels: {\n    get: function () {\n      return this._borderWidthInPixels;\n    },\n  },\n\n  /**\n   * An array of {@link BoundingRectangle} texture coordinate regions for all the images in the texture atlas.\n   * The x and y values of the rectangle correspond to the bottom-left corner of the texture coordinate.\n   * The coordinates are in the order that the corresponding images were added to the atlas.\n   * @memberof TextureAtlas.prototype\n   * @type {BoundingRectangle[]}\n   */\n  textureCoordinates: {\n    get: function () {\n      return this._textureCoordinates;\n    },\n  },\n\n  /**\n   * The texture that all of the images are being written to.\n   * @memberof TextureAtlas.prototype\n   * @type {Texture}\n   */\n  texture: {\n    get: function () {\n      if (!defined(this._texture)) {\n        this._texture = new Texture({\n          context: this._context,\n          width: this._initialSize.x,\n          height: this._initialSize.y,\n          pixelFormat: this._pixelFormat,\n        });\n      }\n      return this._texture;\n    },\n  },\n\n  /**\n   * The number of images in the texture atlas. This value increases\n   * every time addImage or addImages is called.\n   * Texture coordinates are subject to change if the texture atlas resizes, so it is\n   * important to check {@link TextureAtlas#getGUID} before using old values.\n   * @memberof TextureAtlas.prototype\n   * @type {number}\n   */\n  numberOfImages: {\n    get: function () {\n      return this._textureCoordinates.length;\n    },\n  },\n\n  /**\n   * The atlas' globally unique identifier (GUID).\n   * The GUID changes whenever the texture atlas is modified.\n   * Classes that use a texture atlas should check if the GUID\n   * has changed before processing the atlas data.\n   * @memberof TextureAtlas.prototype\n   * @type {string}\n   */\n  guid: {\n    get: function () {\n      return this._guid;\n    },\n  },\n});\n\n// Builds a larger texture and copies the old texture into the new one.\nfunction resizeAtlas(textureAtlas, image) {\n  const context = textureAtlas._context;\n  const numImages = textureAtlas.numberOfImages;\n  const scalingFactor = 2.0;\n  const borderWidthInPixels = textureAtlas._borderWidthInPixels;\n  if (numImages > 0) {\n    const oldAtlasWidth = textureAtlas._texture.width;\n    const oldAtlasHeight = textureAtlas._texture.height;\n    const atlasWidth =\n      scalingFactor * (oldAtlasWidth + image.width + borderWidthInPixels);\n    const atlasHeight =\n      scalingFactor * (oldAtlasHeight + image.height + borderWidthInPixels);\n    const widthRatio = oldAtlasWidth / atlasWidth;\n    const heightRatio = oldAtlasHeight / atlasHeight;\n\n    // Create new node structure, putting the old root node in the bottom left.\n    const nodeBottomRight = new TextureAtlasNode(\n      new Cartesian2(oldAtlasWidth + borderWidthInPixels, borderWidthInPixels),\n      new Cartesian2(atlasWidth, oldAtlasHeight)\n    );\n    const nodeBottomHalf = new TextureAtlasNode(\n      new Cartesian2(),\n      new Cartesian2(atlasWidth, oldAtlasHeight),\n      textureAtlas._root,\n      nodeBottomRight\n    );\n    const nodeTopHalf = new TextureAtlasNode(\n      new Cartesian2(borderWidthInPixels, oldAtlasHeight + borderWidthInPixels),\n      new Cartesian2(atlasWidth, atlasHeight)\n    );\n    const nodeMain = new TextureAtlasNode(\n      new Cartesian2(),\n      new Cartesian2(atlasWidth, atlasHeight),\n      nodeBottomHalf,\n      nodeTopHalf\n    );\n\n    // Resize texture coordinates.\n    for (let i = 0; i < textureAtlas._textureCoordinates.length; i++) {\n      const texCoord = textureAtlas._textureCoordinates[i];\n      if (defined(texCoord)) {\n        texCoord.x *= widthRatio;\n        texCoord.y *= heightRatio;\n        texCoord.width *= widthRatio;\n        texCoord.height *= heightRatio;\n      }\n    }\n\n    // Copy larger texture.\n    const newTexture = new Texture({\n      context: textureAtlas._context,\n      width: atlasWidth,\n      height: atlasHeight,\n      pixelFormat: textureAtlas._pixelFormat,\n    });\n\n    const framebuffer = new Framebuffer({\n      context: context,\n      colorTextures: [textureAtlas._texture],\n      destroyAttachments: false,\n    });\n\n    framebuffer._bind();\n    newTexture.copyFromFramebuffer(0, 0, 0, 0, atlasWidth, atlasHeight);\n    framebuffer._unBind();\n    framebuffer.destroy();\n    textureAtlas._texture =\n      textureAtlas._texture && textureAtlas._texture.destroy();\n    textureAtlas._texture = newTexture;\n    textureAtlas._root = nodeMain;\n  } else {\n    // First image exceeds initialSize\n    let initialWidth = scalingFactor * (image.width + 2 * borderWidthInPixels);\n    let initialHeight =\n      scalingFactor * (image.height + 2 * borderWidthInPixels);\n    if (initialWidth < textureAtlas._initialSize.x) {\n      initialWidth = textureAtlas._initialSize.x;\n    }\n    if (initialHeight < textureAtlas._initialSize.y) {\n      initialHeight = textureAtlas._initialSize.y;\n    }\n    textureAtlas._texture =\n      textureAtlas._texture && textureAtlas._texture.destroy();\n    textureAtlas._texture = new Texture({\n      context: textureAtlas._context,\n      width: initialWidth,\n      height: initialHeight,\n      pixelFormat: textureAtlas._pixelFormat,\n    });\n    textureAtlas._root = new TextureAtlasNode(\n      new Cartesian2(borderWidthInPixels, borderWidthInPixels),\n      new Cartesian2(initialWidth, initialHeight)\n    );\n  }\n}\n\n// A recursive function that finds the best place to insert\n// a new image based on existing image 'nodes'.\n// Inspired by: http://blackpawn.com/texts/lightmaps/default.html\nfunction findNode(textureAtlas, node, image) {\n  if (!defined(node)) {\n    return undefined;\n  }\n\n  // If a leaf node\n  if (!defined(node.childNode1) && !defined(node.childNode2)) {\n    // Node already contains an image, don't add to it.\n    if (defined(node.imageIndex)) {\n      return undefined;\n    }\n\n    const nodeWidth = node.topRight.x - node.bottomLeft.x;\n    const nodeHeight = node.topRight.y - node.bottomLeft.y;\n    const widthDifference = nodeWidth - image.width;\n    const heightDifference = nodeHeight - image.height;\n\n    // Node is smaller than the image.\n    if (widthDifference < 0 || heightDifference < 0) {\n      return undefined;\n    }\n\n    // If the node is the same size as the image, return the node\n    if (widthDifference === 0 && heightDifference === 0) {\n      return node;\n    }\n\n    // Vertical split (childNode1 = left half, childNode2 = right half).\n    if (widthDifference > heightDifference) {\n      node.childNode1 = new TextureAtlasNode(\n        new Cartesian2(node.bottomLeft.x, node.bottomLeft.y),\n        new Cartesian2(node.bottomLeft.x + image.width, node.topRight.y)\n      );\n      // Only make a second child if the border gives enough space.\n      const childNode2BottomLeftX =\n        node.bottomLeft.x + image.width + textureAtlas._borderWidthInPixels;\n      if (childNode2BottomLeftX < node.topRight.x) {\n        node.childNode2 = new TextureAtlasNode(\n          new Cartesian2(childNode2BottomLeftX, node.bottomLeft.y),\n          new Cartesian2(node.topRight.x, node.topRight.y)\n        );\n      }\n    }\n    // Horizontal split (childNode1 = bottom half, childNode2 = top half).\n    else {\n      node.childNode1 = new TextureAtlasNode(\n        new Cartesian2(node.bottomLeft.x, node.bottomLeft.y),\n        new Cartesian2(node.topRight.x, node.bottomLeft.y + image.height)\n      );\n      // Only make a second child if the border gives enough space.\n      const childNode2BottomLeftY =\n        node.bottomLeft.y + image.height + textureAtlas._borderWidthInPixels;\n      if (childNode2BottomLeftY < node.topRight.y) {\n        node.childNode2 = new TextureAtlasNode(\n          new Cartesian2(node.bottomLeft.x, childNode2BottomLeftY),\n          new Cartesian2(node.topRight.x, node.topRight.y)\n        );\n      }\n    }\n    return findNode(textureAtlas, node.childNode1, image);\n  }\n\n  // If not a leaf node\n  return (\n    findNode(textureAtlas, node.childNode1, image) ||\n    findNode(textureAtlas, node.childNode2, image)\n  );\n}\n\n// Adds image of given index to the texture atlas. Called from addImage and addImages.\nfunction addImage(textureAtlas, image, index) {\n  const node = findNode(textureAtlas, textureAtlas._root, image);\n  if (defined(node)) {\n    // Found a node that can hold the image.\n    node.imageIndex = index;\n\n    // Add texture coordinate and write to texture\n    const atlasWidth = textureAtlas._texture.width;\n    const atlasHeight = textureAtlas._texture.height;\n    const nodeWidth = node.topRight.x - node.bottomLeft.x;\n    const nodeHeight = node.topRight.y - node.bottomLeft.y;\n    const x = node.bottomLeft.x / atlasWidth;\n    const y = node.bottomLeft.y / atlasHeight;\n    const w = nodeWidth / atlasWidth;\n    const h = nodeHeight / atlasHeight;\n    textureAtlas._textureCoordinates[index] = new BoundingRectangle(x, y, w, h);\n    textureAtlas._texture.copyFrom({\n      source: image,\n      xOffset: node.bottomLeft.x,\n      yOffset: node.bottomLeft.y,\n    });\n  } else {\n    // No node found, must resize the texture atlas.\n    resizeAtlas(textureAtlas, image);\n    addImage(textureAtlas, image, index);\n  }\n\n  textureAtlas._guid = createGuid();\n}\n\nfunction getIndex(atlas, image) {\n  if (!defined(atlas) || atlas.isDestroyed()) {\n    return -1;\n  }\n\n  const index = atlas.numberOfImages;\n\n  addImage(atlas, image, index);\n\n  return index;\n}\n\n/**\n * If the image is already in the atlas, the existing index is returned. Otherwise, the result is undefined.\n *\n * @param {string} id An identifier to detect whether the image already exists in the atlas.\n * @returns {number|undefined} The image index, or undefined if the image does not exist in the atlas.\n */\nTextureAtlas.prototype.getImageIndex = function (id) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(id)) {\n    throw new DeveloperError(\"id is required.\");\n  }\n  //>>includeEnd('debug');\n\n  return this._indexHash[id];\n};\n\n/**\n * Adds an image to the atlas synchronously.  If the image is already in the atlas, the atlas is unchanged and\n * the existing index is used.\n *\n * @param {string} id An identifier to detect whether the image already exists in the atlas.\n * @param {HTMLImageElement|HTMLCanvasElement} image An image or canvas to add to the texture atlas.\n * @returns {number} The image index.\n */\nTextureAtlas.prototype.addImageSync = function (id, image) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(id)) {\n    throw new DeveloperError(\"id is required.\");\n  }\n  if (!defined(image)) {\n    throw new DeveloperError(\"image is required.\");\n  }\n  //>>includeEnd('debug');\n\n  let index = this._indexHash[id];\n  if (defined(index)) {\n    // we're already aware of this source\n    return index;\n  }\n\n  index = getIndex(this, image);\n  // store the promise\n  this._idHash[id] = Promise.resolve(index);\n  this._indexHash[id] = index;\n  // but return the value synchronously\n  return index;\n};\n\n/**\n * Adds an image to the atlas.  If the image is already in the atlas, the atlas is unchanged and\n * the existing index is used.\n *\n * @param {string} id An identifier to detect whether the image already exists in the atlas.\n * @param {HTMLImageElement|HTMLCanvasElement|string|Resource|Promise|TextureAtlas.CreateImageCallback} image An image or canvas to add to the texture atlas,\n *        or a URL to an Image, or a Promise for an image, or a function that creates an image.\n * @returns {Promise<number>} A Promise for the image index.\n */\nTextureAtlas.prototype.addImage = function (id, image) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(id)) {\n    throw new DeveloperError(\"id is required.\");\n  }\n  if (!defined(image)) {\n    throw new DeveloperError(\"image is required.\");\n  }\n  //>>includeEnd('debug');\n\n  let indexPromise = this._idHash[id];\n  if (defined(indexPromise)) {\n    // we're already aware of this source\n    return indexPromise;\n  }\n\n  // not in atlas, create the promise for the index\n\n  if (typeof image === \"function\") {\n    // if image is a function, call it\n    image = image(id);\n    //>>includeStart('debug', pragmas.debug);\n    if (!defined(image)) {\n      throw new DeveloperError(\"image is required.\");\n    }\n    //>>includeEnd('debug');\n  } else if (typeof image === \"string\" || image instanceof Resource) {\n    // Get a resource\n    const resource = Resource.createIfNeeded(image);\n    image = resource.fetchImage();\n  }\n\n  const that = this;\n  indexPromise = Promise.resolve(image).then(function (image) {\n    const index = getIndex(that, image);\n    that._indexHash[id] = index;\n    return index;\n  });\n\n  // store the promise\n  this._idHash[id] = indexPromise;\n\n  return indexPromise;\n};\n\n/**\n * Add a sub-region of an existing atlas image as additional image indices.\n *\n * @param {string} id The identifier of the existing image.\n * @param {BoundingRectangle} subRegion An {@link BoundingRectangle} sub-region measured in pixels from the bottom-left.\n *\n * @returns {Promise<number>} A Promise for the image index.\n */\nTextureAtlas.prototype.addSubRegion = function (id, subRegion) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(id)) {\n    throw new DeveloperError(\"id is required.\");\n  }\n  if (!defined(subRegion)) {\n    throw new DeveloperError(\"subRegion is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const indexPromise = this._idHash[id];\n  if (!defined(indexPromise)) {\n    throw new RuntimeError(`image with id \"${id}\" not found in the atlas.`);\n  }\n\n  const that = this;\n  return Promise.resolve(indexPromise).then(function (index) {\n    if (index === -1) {\n      // the atlas is destroyed\n      return -1;\n    }\n    const atlasWidth = that._texture.width;\n    const atlasHeight = that._texture.height;\n\n    const baseRegion = that._textureCoordinates[index];\n    const x = baseRegion.x + subRegion.x / atlasWidth;\n    const y = baseRegion.y + subRegion.y / atlasHeight;\n    const w = subRegion.width / atlasWidth;\n    const h = subRegion.height / atlasHeight;\n    const newIndex =\n      that._textureCoordinates.push(new BoundingRectangle(x, y, w, h)) - 1;\n    that._indexHash[id] = newIndex;\n\n    that._guid = createGuid();\n\n    return newIndex;\n  });\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see TextureAtlas#destroy\n */\nTextureAtlas.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * atlas = atlas && atlas.destroy();\n *\n * @see TextureAtlas#isDestroyed\n */\nTextureAtlas.prototype.destroy = function () {\n  this._texture = this._texture && this._texture.destroy();\n  return destroyObject(this);\n};\n\n/**\n * A function that creates an image.\n * @callback TextureAtlas.CreateImageCallback\n * @param {string} id The identifier of the image to load.\n * @returns {HTMLImageElement|Promise<HTMLImageElement>} The image, or a promise that will resolve to an image.\n */\nexport default TextureAtlas;\n", "import AttributeCompression from \"../Core/AttributeCompression.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EncodedCartesian3 from \"../Core/EncodedCartesian3.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArrayFacade from \"../Renderer/VertexArrayFacade.js\";\nimport BillboardCollectionFS from \"../Shaders/BillboardCollectionFS.js\";\nimport BillboardCollectionVS from \"../Shaders/BillboardCollectionVS.js\";\nimport Billboard from \"./Billboard.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport BlendOption from \"./BlendOption.js\";\nimport HeightReference from \"./HeightReference.js\";\nimport HorizontalOrigin from \"./HorizontalOrigin.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport SDFSettings from \"./SDFSettings.js\";\nimport TextureAtlas from \"./TextureAtlas.js\";\nimport VerticalOrigin from \"./VerticalOrigin.js\";\n\nconst SHOW_INDEX = Billboard.SHOW_INDEX;\nconst POSITION_INDEX = Billboard.POSITION_INDEX;\nconst PIXEL_OFFSET_INDEX = Billboard.PIXEL_OFFSET_INDEX;\nconst EYE_OFFSET_INDEX = Billboard.EYE_OFFSET_INDEX;\nconst HORIZONTAL_ORIGIN_INDEX = Billboard.HORIZONTAL_ORIGIN_INDEX;\nconst VERTICAL_ORIGIN_INDEX = Billboard.VERTICAL_ORIGIN_INDEX;\nconst SCALE_INDEX = Billboard.SCALE_INDEX;\nconst IMAGE_INDEX_INDEX = Billboard.IMAGE_INDEX_INDEX;\nconst COLOR_INDEX = Billboard.COLOR_INDEX;\nconst ROTATION_INDEX = Billboard.ROTATION_INDEX;\nconst ALIGNED_AXIS_INDEX = Billboard.ALIGNED_AXIS_INDEX;\nconst SCALE_BY_DISTANCE_INDEX = Billboard.SCALE_BY_DISTANCE_INDEX;\nconst TRANSLUCENCY_BY_DISTANCE_INDEX = Billboard.TRANSLUCENCY_BY_DISTANCE_INDEX;\nconst PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX =\n  Billboard.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX;\nconst DISTANCE_DISPLAY_CONDITION_INDEX = Billboard.DISTANCE_DISPLAY_CONDITION;\nconst DISABLE_DEPTH_DISTANCE = Billboard.DISABLE_DEPTH_DISTANCE;\nconst TEXTURE_COORDINATE_BOUNDS = Billboard.TEXTURE_COORDINATE_BOUNDS;\nconst SDF_INDEX = Billboard.SDF_INDEX;\nconst NUMBER_OF_PROPERTIES = Billboard.NUMBER_OF_PROPERTIES;\n\nlet attributeLocations;\n\nconst attributeLocationsBatched = {\n  positionHighAndScale: 0,\n  positionLowAndRotation: 1,\n  compressedAttribute0: 2, // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates\n  compressedAttribute1: 3, // aligned axis, translucency by distance, image width\n  compressedAttribute2: 4, // image height, color, pick color, size in meters, valid aligned axis, 13 bits free\n  eyeOffset: 5, // 4 bytes free\n  scaleByDistance: 6,\n  pixelOffsetScaleByDistance: 7,\n  compressedAttribute3: 8,\n  textureCoordinateBoundsOrLabelTranslate: 9,\n  a_batchId: 10,\n  sdf: 11,\n};\n\nconst attributeLocationsInstanced = {\n  direction: 0,\n  positionHighAndScale: 1,\n  positionLowAndRotation: 2, // texture offset in w\n  compressedAttribute0: 3,\n  compressedAttribute1: 4,\n  compressedAttribute2: 5,\n  eyeOffset: 6, // texture range in w\n  scaleByDistance: 7,\n  pixelOffsetScaleByDistance: 8,\n  compressedAttribute3: 9,\n  textureCoordinateBoundsOrLabelTranslate: 10,\n  a_batchId: 11,\n  sdf: 12,\n};\n\n/**\n * A renderable collection of billboards.  Billboards are viewport-aligned\n * images positioned in the 3D scene.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Billboard.png' width='400' height='300' /><br />\n * Example billboards\n * </div>\n * <br /><br />\n * Billboards are added and removed from the collection using {@link BillboardCollection#add}\n * and {@link BillboardCollection#remove}.  Billboards in a collection automatically share textures\n * for images with the same identifier.\n *\n * @alias BillboardCollection\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each billboard from model to world coordinates.\n * @param {boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {Scene} [options.scene] Must be passed in for billboards that use the height reference property or will be depth tested against the globe.\n * @param {BlendOption} [options.blendOption=BlendOption.OPAQUE_AND_TRANSLUCENT] The billboard blending option. The default\n * is used for rendering both opaque and translucent billboards. However, if either all of the billboards are completely opaque or all are completely translucent,\n * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.\n * @param {boolean} [options.show=true] Determines if the billboards in the collection will be shown.\n *\n * @performance For best performance, prefer a few collections, each with many billboards, to\n * many collections with only a few billboards each.  Organize collections so that billboards\n * with the same update frequency are in the same collection, i.e., billboards that do not\n * change should be in one collection; billboards that change every frame should be in another\n * collection; and so on.\n *\n * @see BillboardCollection#add\n * @see BillboardCollection#remove\n * @see Billboard\n * @see LabelCollection\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Billboards.html|Cesium Sandcastle Billboard Demo}\n *\n * @example\n * // Create a billboard collection with two billboards\n * const billboards = scene.primitives.add(new Cesium.BillboardCollection());\n * billboards.add({\n *   position : new Cesium.Cartesian3(1.0, 2.0, 3.0),\n *   image : 'url/to/image'\n * });\n * billboards.add({\n *   position : new Cesium.Cartesian3(4.0, 5.0, 6.0),\n *   image : 'url/to/another/image'\n * });\n */\nfunction BillboardCollection(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._scene = options.scene;\n  this._batchTable = options.batchTable;\n\n  this._textureAtlas = undefined;\n  this._textureAtlasGUID = undefined;\n  this._destroyTextureAtlas = true;\n  this._sp = undefined;\n  this._spTranslucent = undefined;\n  this._rsOpaque = undefined;\n  this._rsTranslucent = undefined;\n  this._vaf = undefined;\n\n  this._billboards = [];\n  this._billboardsToUpdate = [];\n  this._billboardsToUpdateIndex = 0;\n  this._billboardsRemoved = false;\n  this._createVertexArray = false;\n\n  this._shaderRotation = false;\n  this._compiledShaderRotation = false;\n\n  this._shaderAlignedAxis = false;\n  this._compiledShaderAlignedAxis = false;\n\n  this._shaderScaleByDistance = false;\n  this._compiledShaderScaleByDistance = false;\n\n  this._shaderTranslucencyByDistance = false;\n  this._compiledShaderTranslucencyByDistance = false;\n\n  this._shaderPixelOffsetScaleByDistance = false;\n  this._compiledShaderPixelOffsetScaleByDistance = false;\n\n  this._shaderDistanceDisplayCondition = false;\n  this._compiledShaderDistanceDisplayCondition = false;\n\n  this._shaderDisableDepthDistance = false;\n  this._compiledShaderDisableDepthDistance = false;\n\n  this._shaderClampToGround = false;\n  this._compiledShaderClampToGround = false;\n\n  this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES);\n\n  this._maxSize = 0.0;\n  this._maxEyeOffset = 0.0;\n  this._maxScale = 1.0;\n  this._maxPixelOffset = 0.0;\n  this._allHorizontalCenter = true;\n  this._allVerticalCenter = true;\n  this._allSizedInMeters = true;\n\n  this._baseVolume = new BoundingSphere();\n  this._baseVolumeWC = new BoundingSphere();\n  this._baseVolume2D = new BoundingSphere();\n  this._boundingVolume = new BoundingSphere();\n  this._boundingVolumeDirty = false;\n\n  this._colorCommands = [];\n\n  /**\n   * Determines if billboards in this collection will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  /**\n   * The 4x4 transformation matrix that transforms each billboard in this collection from model to world coordinates.\n   * When this is the identity matrix, the billboards are drawn in world coordinates, i.e., Earth's WGS84 coordinates.\n   * Local reference frames can be used by providing a different transformation matrix, like that returned\n   * by {@link Transforms.eastNorthUpToFixedFrame}.\n   *\n   * @type {Matrix4}\n   * @default {@link Matrix4.IDENTITY}\n   *\n   *\n   * @example\n   * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);\n   * billboards.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);\n   * billboards.add({\n   *   image : 'url/to/image',\n   *   position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center\n   * });\n   * billboards.add({\n   *   image : 'url/to/image',\n   *   position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east\n   * });\n   * billboards.add({\n   *   image : 'url/to/image',\n   *   position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north\n   * });\n   * billboards.add({\n   *   image : 'url/to/image',\n   *   position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up\n   * });\n   *\n   * @see Transforms.eastNorthUpToFixedFrame\n   */\n  this.modelMatrix = Matrix4.clone(\n    defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n  );\n  this._modelMatrix = Matrix4.clone(Matrix4.IDENTITY);\n\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the bounding sphere for each draw command in the primitive.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowBoundingVolume = defaultValue(\n    options.debugShowBoundingVolume,\n    false\n  );\n\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the texture atlas for this BillboardCollection as a fullscreen quad.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowTextureAtlas = defaultValue(\n    options.debugShowTextureAtlas,\n    false\n  );\n\n  /**\n   * The billboard blending option. The default is used for rendering both opaque and translucent billboards.\n   * However, if either all of the billboards are completely opaque or all are completely translucent,\n   * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve\n   * performance by up to 2x.\n   * @type {BlendOption}\n   * @default BlendOption.OPAQUE_AND_TRANSLUCENT\n   */\n  this.blendOption = defaultValue(\n    options.blendOption,\n    BlendOption.OPAQUE_AND_TRANSLUCENT\n  );\n  this._blendOption = undefined;\n\n  this._mode = SceneMode.SCENE3D;\n\n  // The buffer usage for each attribute is determined based on the usage of the attribute over time.\n  this._buffersUsage = [\n    BufferUsage.STATIC_DRAW, // SHOW_INDEX\n    BufferUsage.STATIC_DRAW, // POSITION_INDEX\n    BufferUsage.STATIC_DRAW, // PIXEL_OFFSET_INDEX\n    BufferUsage.STATIC_DRAW, // EYE_OFFSET_INDEX\n    BufferUsage.STATIC_DRAW, // HORIZONTAL_ORIGIN_INDEX\n    BufferUsage.STATIC_DRAW, // VERTICAL_ORIGIN_INDEX\n    BufferUsage.STATIC_DRAW, // SCALE_INDEX\n    BufferUsage.STATIC_DRAW, // IMAGE_INDEX_INDEX\n    BufferUsage.STATIC_DRAW, // COLOR_INDEX\n    BufferUsage.STATIC_DRAW, // ROTATION_INDEX\n    BufferUsage.STATIC_DRAW, // ALIGNED_AXIS_INDEX\n    BufferUsage.STATIC_DRAW, // SCALE_BY_DISTANCE_INDEX\n    BufferUsage.STATIC_DRAW, // TRANSLUCENCY_BY_DISTANCE_INDEX\n    BufferUsage.STATIC_DRAW, // PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX\n    BufferUsage.STATIC_DRAW, // DISTANCE_DISPLAY_CONDITION_INDEX\n    BufferUsage.STATIC_DRAW, // TEXTURE_COORDINATE_BOUNDS\n  ];\n\n  this._highlightColor = Color.clone(Color.WHITE); // Only used by Vector3DTilePoints\n\n  const that = this;\n  this._uniforms = {\n    u_atlas: function () {\n      return that._textureAtlas.texture;\n    },\n    u_highlightColor: function () {\n      return that._highlightColor;\n    },\n  };\n\n  const scene = this._scene;\n  if (defined(scene) && defined(scene.terrainProviderChanged)) {\n    this._removeCallbackFunc = scene.terrainProviderChanged.addEventListener(\n      function () {\n        const billboards = this._billboards;\n        const length = billboards.length;\n        for (let i = 0; i < length; ++i) {\n          if (defined(billboards[i])) {\n            billboards[i]._updateClamping();\n          }\n        }\n      },\n      this\n    );\n  }\n}\n\nObject.defineProperties(BillboardCollection.prototype, {\n  /**\n   * Returns the number of billboards in this collection.  This is commonly used with\n   * {@link BillboardCollection#get} to iterate over all the billboards\n   * in the collection.\n   * @memberof BillboardCollection.prototype\n   * @type {number}\n   */\n  length: {\n    get: function () {\n      removeBillboards(this);\n      return this._billboards.length;\n    },\n  },\n\n  /**\n   * Gets or sets the textureAtlas.\n   * @memberof BillboardCollection.prototype\n   * @type {TextureAtlas}\n   * @private\n   */\n  textureAtlas: {\n    get: function () {\n      return this._textureAtlas;\n    },\n    set: function (value) {\n      if (this._textureAtlas !== value) {\n        this._textureAtlas =\n          this._destroyTextureAtlas &&\n          this._textureAtlas &&\n          this._textureAtlas.destroy();\n        this._textureAtlas = value;\n        this._createVertexArray = true; // New per-billboard texture coordinates\n      }\n    },\n  },\n\n  /**\n   * Gets or sets a value which determines if the texture atlas is\n   * destroyed when the collection is destroyed.\n   *\n   * If the texture atlas is used by more than one collection, set this to <code>false</code>,\n   * and explicitly destroy the atlas to avoid attempting to destroy it multiple times.\n   *\n   * @memberof BillboardCollection.prototype\n   * @type {boolean}\n   * @private\n   *\n   * @example\n   * // Set destroyTextureAtlas\n   * // Destroy a billboard collection but not its texture atlas.\n   *\n   * const atlas = new TextureAtlas({\n   *   scene : scene,\n   *   images : images\n   * });\n   * billboards.textureAtlas = atlas;\n   * billboards.destroyTextureAtlas = false;\n   * billboards = billboards.destroy();\n   * console.log(atlas.isDestroyed()); // False\n   */\n  destroyTextureAtlas: {\n    get: function () {\n      return this._destroyTextureAtlas;\n    },\n    set: function (value) {\n      this._destroyTextureAtlas = value;\n    },\n  },\n});\n\nfunction destroyBillboards(billboards) {\n  const length = billboards.length;\n  for (let i = 0; i < length; ++i) {\n    if (billboards[i]) {\n      billboards[i]._destroy();\n    }\n  }\n}\n\n/**\n * Creates and adds a billboard with the specified initial properties to the collection.\n * The added billboard is returned so it can be modified or removed from the collection later.\n *\n * @param {object}[options] A template describing the billboard's properties as shown in Example 1.\n * @returns {Billboard} The billboard that was added to the collection.\n *\n * @performance Calling <code>add</code> is expected constant time.  However, the collection's vertex buffer\n * is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead.  For\n * best performance, add as many billboards as possible before calling <code>update</code>.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Example 1:  Add a billboard, specifying all the default values.\n * const b = billboards.add({\n *   show : true,\n *   position : Cesium.Cartesian3.ZERO,\n *   pixelOffset : Cesium.Cartesian2.ZERO,\n *   eyeOffset : Cesium.Cartesian3.ZERO,\n *   heightReference : Cesium.HeightReference.NONE,\n *   horizontalOrigin : Cesium.HorizontalOrigin.CENTER,\n *   verticalOrigin : Cesium.VerticalOrigin.CENTER,\n *   scale : 1.0,\n *   image : 'url/to/image',\n *   imageSubRegion : undefined,\n *   color : Cesium.Color.WHITE,\n *   id : undefined,\n *   rotation : 0.0,\n *   alignedAxis : Cesium.Cartesian3.ZERO,\n *   width : undefined,\n *   height : undefined,\n *   scaleByDistance : undefined,\n *   translucencyByDistance : undefined,\n *   pixelOffsetScaleByDistance : undefined,\n *   sizeInMeters : false,\n *   distanceDisplayCondition : undefined\n * });\n *\n * @example\n * // Example 2:  Specify only the billboard's cartographic position.\n * const b = billboards.add({\n *   position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)\n * });\n *\n * @see BillboardCollection#remove\n * @see BillboardCollection#removeAll\n */\nBillboardCollection.prototype.add = function (options) {\n  const billboard = new Billboard(options, this);\n  billboard._index = this._billboards.length;\n\n  this._billboards.push(billboard);\n  this._createVertexArray = true;\n\n  return billboard;\n};\n\n/**\n * Removes a billboard from the collection.\n *\n * @param {Billboard} billboard The billboard to remove.\n * @returns {boolean} <code>true</code> if the billboard was removed; <code>false</code> if the billboard was not found in the collection.\n *\n * @performance Calling <code>remove</code> is expected constant time.  However, the collection's vertex buffer\n * is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead.  For\n * best performance, remove as many billboards as possible before calling <code>update</code>.\n * If you intend to temporarily hide a billboard, it is usually more efficient to call\n * {@link Billboard#show} instead of removing and re-adding the billboard.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * const b = billboards.add(...);\n * billboards.remove(b);  // Returns true\n *\n * @see BillboardCollection#add\n * @see BillboardCollection#removeAll\n * @see Billboard#show\n */\nBillboardCollection.prototype.remove = function (billboard) {\n  if (this.contains(billboard)) {\n    this._billboards[billboard._index] = undefined; // Removed later\n    this._billboardsRemoved = true;\n    this._createVertexArray = true;\n    billboard._destroy();\n    return true;\n  }\n\n  return false;\n};\n\n/**\n * Removes all billboards from the collection.\n *\n * @performance <code>O(n)</code>.  It is more efficient to remove all the billboards\n * from a collection and then add new ones than to create a new collection entirely.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * billboards.add(...);\n * billboards.add(...);\n * billboards.removeAll();\n *\n * @see BillboardCollection#add\n * @see BillboardCollection#remove\n */\nBillboardCollection.prototype.removeAll = function () {\n  destroyBillboards(this._billboards);\n  this._billboards = [];\n  this._billboardsToUpdate = [];\n  this._billboardsToUpdateIndex = 0;\n  this._billboardsRemoved = false;\n\n  this._createVertexArray = true;\n};\n\nfunction removeBillboards(billboardCollection) {\n  if (billboardCollection._billboardsRemoved) {\n    billboardCollection._billboardsRemoved = false;\n\n    const newBillboards = [];\n    const billboards = billboardCollection._billboards;\n    const length = billboards.length;\n    for (let i = 0, j = 0; i < length; ++i) {\n      const billboard = billboards[i];\n      if (defined(billboard)) {\n        billboard._index = j++;\n        newBillboards.push(billboard);\n      }\n    }\n\n    billboardCollection._billboards = newBillboards;\n  }\n}\n\nBillboardCollection.prototype._updateBillboard = function (\n  billboard,\n  propertyChanged\n) {\n  if (!billboard._dirty) {\n    this._billboardsToUpdate[this._billboardsToUpdateIndex++] = billboard;\n  }\n\n  ++this._propertiesChanged[propertyChanged];\n};\n\n/**\n * Check whether this collection contains a given billboard.\n *\n * @param {Billboard} [billboard] The billboard to check for.\n * @returns {boolean} true if this collection contains the billboard, false otherwise.\n *\n * @see BillboardCollection#get\n */\nBillboardCollection.prototype.contains = function (billboard) {\n  return defined(billboard) && billboard._billboardCollection === this;\n};\n\n/**\n * Returns the billboard in the collection at the specified index.  Indices are zero-based\n * and increase as billboards are added.  Removing a billboard shifts all billboards after\n * it to the left, changing their indices.  This function is commonly used with\n * {@link BillboardCollection#length} to iterate over all the billboards\n * in the collection.\n *\n * @param {number} index The zero-based index of the billboard.\n * @returns {Billboard} The billboard at the specified index.\n *\n * @performance Expected constant time.  If billboards were removed from the collection and\n * {@link BillboardCollection#update} was not called, an implicit <code>O(n)</code>\n * operation is performed.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Toggle the show property of every billboard in the collection\n * const len = billboards.length;\n * for (let i = 0; i < len; ++i) {\n *   const b = billboards.get(i);\n *   b.show = !b.show;\n * }\n *\n * @see BillboardCollection#length\n */\nBillboardCollection.prototype.get = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"index\", index);\n  //>>includeEnd('debug');\n\n  removeBillboards(this);\n  return this._billboards[index];\n};\n\nlet getIndexBuffer;\n\nfunction getIndexBufferBatched(context) {\n  const sixteenK = 16 * 1024;\n\n  let indexBuffer = context.cache.billboardCollection_indexBufferBatched;\n  if (defined(indexBuffer)) {\n    return indexBuffer;\n  }\n\n  // Subtract 6 because the last index is reserverd for primitive restart.\n  // https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.18\n  const length = sixteenK * 6 - 6;\n  const indices = new Uint16Array(length);\n  for (let i = 0, j = 0; i < length; i += 6, j += 4) {\n    indices[i] = j;\n    indices[i + 1] = j + 1;\n    indices[i + 2] = j + 2;\n\n    indices[i + 3] = j + 0;\n    indices[i + 4] = j + 2;\n    indices[i + 5] = j + 3;\n  }\n\n  // PERFORMANCE_IDEA:  Should we reference count billboard collections, and eventually delete this?\n  // Is this too much memory to allocate up front?  Should we dynamically grow it?\n  indexBuffer = Buffer.createIndexBuffer({\n    context: context,\n    typedArray: indices,\n    usage: BufferUsage.STATIC_DRAW,\n    indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n  });\n  indexBuffer.vertexArrayDestroyable = false;\n  context.cache.billboardCollection_indexBufferBatched = indexBuffer;\n  return indexBuffer;\n}\n\nfunction getIndexBufferInstanced(context) {\n  let indexBuffer = context.cache.billboardCollection_indexBufferInstanced;\n  if (defined(indexBuffer)) {\n    return indexBuffer;\n  }\n\n  indexBuffer = Buffer.createIndexBuffer({\n    context: context,\n    typedArray: new Uint16Array([0, 1, 2, 0, 2, 3]),\n    usage: BufferUsage.STATIC_DRAW,\n    indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n  });\n\n  indexBuffer.vertexArrayDestroyable = false;\n  context.cache.billboardCollection_indexBufferInstanced = indexBuffer;\n  return indexBuffer;\n}\n\nfunction getVertexBufferInstanced(context) {\n  let vertexBuffer = context.cache.billboardCollection_vertexBufferInstanced;\n  if (defined(vertexBuffer)) {\n    return vertexBuffer;\n  }\n\n  vertexBuffer = Buffer.createVertexBuffer({\n    context: context,\n    typedArray: new Float32Array([0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0]),\n    usage: BufferUsage.STATIC_DRAW,\n  });\n\n  vertexBuffer.vertexArrayDestroyable = false;\n  context.cache.billboardCollection_vertexBufferInstanced = vertexBuffer;\n  return vertexBuffer;\n}\n\nBillboardCollection.prototype.computeNewBuffersUsage = function () {\n  const buffersUsage = this._buffersUsage;\n  let usageChanged = false;\n\n  const properties = this._propertiesChanged;\n  for (let k = 0; k < NUMBER_OF_PROPERTIES; ++k) {\n    const newUsage =\n      properties[k] === 0 ? BufferUsage.STATIC_DRAW : BufferUsage.STREAM_DRAW;\n    usageChanged = usageChanged || buffersUsage[k] !== newUsage;\n    buffersUsage[k] = newUsage;\n  }\n\n  return usageChanged;\n};\n\nfunction createVAF(\n  context,\n  numberOfBillboards,\n  buffersUsage,\n  instanced,\n  batchTable,\n  sdf\n) {\n  const attributes = [\n    {\n      index: attributeLocations.positionHighAndScale,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      usage: buffersUsage[POSITION_INDEX],\n    },\n    {\n      index: attributeLocations.positionLowAndRotation,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      usage: buffersUsage[POSITION_INDEX],\n    },\n    {\n      index: attributeLocations.compressedAttribute0,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      usage: buffersUsage[PIXEL_OFFSET_INDEX],\n    },\n    {\n      index: attributeLocations.compressedAttribute1,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      usage: buffersUsage[TRANSLUCENCY_BY_DISTANCE_INDEX],\n    },\n    {\n      index: attributeLocations.compressedAttribute2,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      usage: buffersUsage[COLOR_INDEX],\n    },\n    {\n      index: attributeLocations.eyeOffset,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      usage: buffersUsage[EYE_OFFSET_INDEX],\n    },\n    {\n      index: attributeLocations.scaleByDistance,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      usage: buffersUsage[SCALE_BY_DISTANCE_INDEX],\n    },\n    {\n      index: attributeLocations.pixelOffsetScaleByDistance,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      usage: buffersUsage[PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX],\n    },\n    {\n      index: attributeLocations.compressedAttribute3,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      usage: buffersUsage[DISTANCE_DISPLAY_CONDITION_INDEX],\n    },\n    {\n      index: attributeLocations.textureCoordinateBoundsOrLabelTranslate,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      usage: buffersUsage[TEXTURE_COORDINATE_BOUNDS],\n    },\n  ];\n\n  // Instancing requires one non-instanced attribute.\n  if (instanced) {\n    attributes.push({\n      index: attributeLocations.direction,\n      componentsPerAttribute: 2,\n      componentDatatype: ComponentDatatype.FLOAT,\n      vertexBuffer: getVertexBufferInstanced(context),\n    });\n  }\n\n  if (defined(batchTable)) {\n    attributes.push({\n      index: attributeLocations.a_batchId,\n      componentsPerAttribute: 1,\n      componentDatatype: ComponentDatatype.FLOAT,\n      bufferUsage: BufferUsage.STATIC_DRAW,\n    });\n  }\n\n  if (sdf) {\n    attributes.push({\n      index: attributeLocations.sdf,\n      componentsPerAttribute: 2,\n      componentDatatype: ComponentDatatype.FLOAT,\n      usage: buffersUsage[SDF_INDEX],\n    });\n  }\n\n  // When instancing is enabled, only one vertex is needed for each billboard.\n  const sizeInVertices = instanced\n    ? numberOfBillboards\n    : 4 * numberOfBillboards;\n  return new VertexArrayFacade(context, attributes, sizeInVertices, instanced);\n}\n\n///////////////////////////////////////////////////////////////////////////\n\n// Four vertices per billboard.  Each has the same position, etc., but a different screen-space direction vector.\n\n// PERFORMANCE_IDEA:  Save memory if a property is the same for all billboards, use a latched attribute state,\n// instead of storing it in a vertex buffer.\n\nconst writePositionScratch = new EncodedCartesian3();\n\nfunction writePositionScaleAndRotation(\n  billboardCollection,\n  frameState,\n  textureAtlasCoordinates,\n  vafWriters,\n  billboard\n) {\n  let i;\n  const positionHighWriter =\n    vafWriters[attributeLocations.positionHighAndScale];\n  const positionLowWriter =\n    vafWriters[attributeLocations.positionLowAndRotation];\n  const position = billboard._getActualPosition();\n\n  if (billboardCollection._mode === SceneMode.SCENE3D) {\n    BoundingSphere.expand(\n      billboardCollection._baseVolume,\n      position,\n      billboardCollection._baseVolume\n    );\n    billboardCollection._boundingVolumeDirty = true;\n  }\n\n  EncodedCartesian3.fromCartesian(position, writePositionScratch);\n  const scale = billboard.scale;\n  const rotation = billboard.rotation;\n\n  if (rotation !== 0.0) {\n    billboardCollection._shaderRotation = true;\n  }\n\n  billboardCollection._maxScale = Math.max(\n    billboardCollection._maxScale,\n    scale\n  );\n\n  const high = writePositionScratch.high;\n  const low = writePositionScratch.low;\n\n  if (billboardCollection._instanced) {\n    i = billboard._index;\n    positionHighWriter(i, high.x, high.y, high.z, scale);\n    positionLowWriter(i, low.x, low.y, low.z, rotation);\n  } else {\n    i = billboard._index * 4;\n    positionHighWriter(i + 0, high.x, high.y, high.z, scale);\n    positionHighWriter(i + 1, high.x, high.y, high.z, scale);\n    positionHighWriter(i + 2, high.x, high.y, high.z, scale);\n    positionHighWriter(i + 3, high.x, high.y, high.z, scale);\n\n    positionLowWriter(i + 0, low.x, low.y, low.z, rotation);\n    positionLowWriter(i + 1, low.x, low.y, low.z, rotation);\n    positionLowWriter(i + 2, low.x, low.y, low.z, rotation);\n    positionLowWriter(i + 3, low.x, low.y, low.z, rotation);\n  }\n}\n\nconst scratchCartesian2 = new Cartesian2();\n\nconst UPPER_BOUND = 32768.0; // 2^15\n\nconst LEFT_SHIFT16 = 65536.0; // 2^16\nconst LEFT_SHIFT12 = 4096.0; // 2^12\nconst LEFT_SHIFT8 = 256.0; // 2^8\nconst LEFT_SHIFT7 = 128.0;\nconst LEFT_SHIFT5 = 32.0;\nconst LEFT_SHIFT3 = 8.0;\nconst LEFT_SHIFT2 = 4.0;\n\nconst RIGHT_SHIFT8 = 1.0 / 256.0;\n\nconst LOWER_LEFT = 0.0;\nconst LOWER_RIGHT = 2.0;\nconst UPPER_RIGHT = 3.0;\nconst UPPER_LEFT = 1.0;\n\nfunction writeCompressedAttrib0(\n  billboardCollection,\n  frameState,\n  textureAtlasCoordinates,\n  vafWriters,\n  billboard\n) {\n  let i;\n  const writer = vafWriters[attributeLocations.compressedAttribute0];\n  const pixelOffset = billboard.pixelOffset;\n  const pixelOffsetX = pixelOffset.x;\n  const pixelOffsetY = pixelOffset.y;\n\n  const translate = billboard._translate;\n  const translateX = translate.x;\n  const translateY = translate.y;\n\n  billboardCollection._maxPixelOffset = Math.max(\n    billboardCollection._maxPixelOffset,\n    Math.abs(pixelOffsetX + translateX),\n    Math.abs(-pixelOffsetY + translateY)\n  );\n\n  const horizontalOrigin = billboard.horizontalOrigin;\n  let verticalOrigin = billboard._verticalOrigin;\n  let show = billboard.show && billboard.clusterShow;\n\n  // If the color alpha is zero, do not show this billboard.  This lets us avoid providing\n  // color during the pick pass and also eliminates a discard in the fragment shader.\n  if (billboard.color.alpha === 0.0) {\n    show = false;\n  }\n\n  // Raw billboards don't distinguish between BASELINE and BOTTOM, only LabelCollection does that.\n  if (verticalOrigin === VerticalOrigin.BASELINE) {\n    verticalOrigin = VerticalOrigin.BOTTOM;\n  }\n\n  billboardCollection._allHorizontalCenter =\n    billboardCollection._allHorizontalCenter &&\n    horizontalOrigin === HorizontalOrigin.CENTER;\n  billboardCollection._allVerticalCenter =\n    billboardCollection._allVerticalCenter &&\n    verticalOrigin === VerticalOrigin.CENTER;\n\n  let bottomLeftX = 0;\n  let bottomLeftY = 0;\n  let width = 0;\n  let height = 0;\n  const index = billboard._imageIndex;\n  if (index !== -1) {\n    const imageRectangle = textureAtlasCoordinates[index];\n\n    //>>includeStart('debug', pragmas.debug);\n    if (!defined(imageRectangle)) {\n      throw new DeveloperError(`Invalid billboard image index: ${index}`);\n    }\n    //>>includeEnd('debug');\n\n    bottomLeftX = imageRectangle.x;\n    bottomLeftY = imageRectangle.y;\n    width = imageRectangle.width;\n    height = imageRectangle.height;\n  }\n  const topRightX = bottomLeftX + width;\n  const topRightY = bottomLeftY + height;\n\n  let compressed0 =\n    Math.floor(\n      CesiumMath.clamp(pixelOffsetX, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND\n    ) * LEFT_SHIFT7;\n  compressed0 += (horizontalOrigin + 1.0) * LEFT_SHIFT5;\n  compressed0 += (verticalOrigin + 1.0) * LEFT_SHIFT3;\n  compressed0 += (show ? 1.0 : 0.0) * LEFT_SHIFT2;\n\n  let compressed1 =\n    Math.floor(\n      CesiumMath.clamp(pixelOffsetY, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND\n    ) * LEFT_SHIFT8;\n  let compressed2 =\n    Math.floor(\n      CesiumMath.clamp(translateX, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND\n    ) * LEFT_SHIFT8;\n\n  const tempTanslateY =\n    (CesiumMath.clamp(translateY, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND) *\n    RIGHT_SHIFT8;\n  const upperTranslateY = Math.floor(tempTanslateY);\n  const lowerTranslateY = Math.floor(\n    (tempTanslateY - upperTranslateY) * LEFT_SHIFT8\n  );\n\n  compressed1 += upperTranslateY;\n  compressed2 += lowerTranslateY;\n\n  scratchCartesian2.x = bottomLeftX;\n  scratchCartesian2.y = bottomLeftY;\n  const compressedTexCoordsLL = AttributeCompression.compressTextureCoordinates(\n    scratchCartesian2\n  );\n  scratchCartesian2.x = topRightX;\n  const compressedTexCoordsLR = AttributeCompression.compressTextureCoordinates(\n    scratchCartesian2\n  );\n  scratchCartesian2.y = topRightY;\n  const compressedTexCoordsUR = AttributeCompression.compressTextureCoordinates(\n    scratchCartesian2\n  );\n  scratchCartesian2.x = bottomLeftX;\n  const compressedTexCoordsUL = AttributeCompression.compressTextureCoordinates(\n    scratchCartesian2\n  );\n\n  if (billboardCollection._instanced) {\n    i = billboard._index;\n    writer(i, compressed0, compressed1, compressed2, compressedTexCoordsLL);\n  } else {\n    i = billboard._index * 4;\n    writer(\n      i + 0,\n      compressed0 + LOWER_LEFT,\n      compressed1,\n      compressed2,\n      compressedTexCoordsLL\n    );\n    writer(\n      i + 1,\n      compressed0 + LOWER_RIGHT,\n      compressed1,\n      compressed2,\n      compressedTexCoordsLR\n    );\n    writer(\n      i + 2,\n      compressed0 + UPPER_RIGHT,\n      compressed1,\n      compressed2,\n      compressedTexCoordsUR\n    );\n    writer(\n      i + 3,\n      compressed0 + UPPER_LEFT,\n      compressed1,\n      compressed2,\n      compressedTexCoordsUL\n    );\n  }\n}\n\nfunction writeCompressedAttrib1(\n  billboardCollection,\n  frameState,\n  textureAtlasCoordinates,\n  vafWriters,\n  billboard\n) {\n  let i;\n  const writer = vafWriters[attributeLocations.compressedAttribute1];\n  const alignedAxis = billboard.alignedAxis;\n  if (!Cartesian3.equals(alignedAxis, Cartesian3.ZERO)) {\n    billboardCollection._shaderAlignedAxis = true;\n  }\n\n  let near = 0.0;\n  let nearValue = 1.0;\n  let far = 1.0;\n  let farValue = 1.0;\n\n  const translucency = billboard.translucencyByDistance;\n  if (defined(translucency)) {\n    near = translucency.near;\n    nearValue = translucency.nearValue;\n    far = translucency.far;\n    farValue = translucency.farValue;\n\n    if (nearValue !== 1.0 || farValue !== 1.0) {\n      // translucency by distance calculation in shader need not be enabled\n      // until a billboard with near and far !== 1.0 is found\n      billboardCollection._shaderTranslucencyByDistance = true;\n    }\n  }\n\n  let width = 0;\n  const index = billboard._imageIndex;\n  if (index !== -1) {\n    const imageRectangle = textureAtlasCoordinates[index];\n\n    //>>includeStart('debug', pragmas.debug);\n    if (!defined(imageRectangle)) {\n      throw new DeveloperError(`Invalid billboard image index: ${index}`);\n    }\n    //>>includeEnd('debug');\n\n    width = imageRectangle.width;\n  }\n\n  const textureWidth = billboardCollection._textureAtlas.texture.width;\n  const imageWidth = Math.round(\n    defaultValue(billboard.width, textureWidth * width)\n  );\n  billboardCollection._maxSize = Math.max(\n    billboardCollection._maxSize,\n    imageWidth\n  );\n\n  let compressed0 = CesiumMath.clamp(imageWidth, 0.0, LEFT_SHIFT16);\n  let compressed1 = 0.0;\n\n  if (\n    Math.abs(Cartesian3.magnitudeSquared(alignedAxis) - 1.0) <\n    CesiumMath.EPSILON6\n  ) {\n    compressed1 = AttributeCompression.octEncodeFloat(alignedAxis);\n  }\n\n  nearValue = CesiumMath.clamp(nearValue, 0.0, 1.0);\n  nearValue = nearValue === 1.0 ? 255.0 : (nearValue * 255.0) | 0;\n  compressed0 = compressed0 * LEFT_SHIFT8 + nearValue;\n\n  farValue = CesiumMath.clamp(farValue, 0.0, 1.0);\n  farValue = farValue === 1.0 ? 255.0 : (farValue * 255.0) | 0;\n  compressed1 = compressed1 * LEFT_SHIFT8 + farValue;\n\n  if (billboardCollection._instanced) {\n    i = billboard._index;\n    writer(i, compressed0, compressed1, near, far);\n  } else {\n    i = billboard._index * 4;\n    writer(i + 0, compressed0, compressed1, near, far);\n    writer(i + 1, compressed0, compressed1, near, far);\n    writer(i + 2, compressed0, compressed1, near, far);\n    writer(i + 3, compressed0, compressed1, near, far);\n  }\n}\n\nfunction writeCompressedAttrib2(\n  billboardCollection,\n  frameState,\n  textureAtlasCoordinates,\n  vafWriters,\n  billboard\n) {\n  let i;\n  const writer = vafWriters[attributeLocations.compressedAttribute2];\n  const color = billboard.color;\n  const pickColor = !defined(billboardCollection._batchTable)\n    ? billboard.getPickId(frameState.context).color\n    : Color.WHITE;\n  const sizeInMeters = billboard.sizeInMeters ? 1.0 : 0.0;\n  const validAlignedAxis =\n    Math.abs(Cartesian3.magnitudeSquared(billboard.alignedAxis) - 1.0) <\n    CesiumMath.EPSILON6\n      ? 1.0\n      : 0.0;\n\n  billboardCollection._allSizedInMeters =\n    billboardCollection._allSizedInMeters && sizeInMeters === 1.0;\n\n  let height = 0;\n  const index = billboard._imageIndex;\n  if (index !== -1) {\n    const imageRectangle = textureAtlasCoordinates[index];\n\n    //>>includeStart('debug', pragmas.debug);\n    if (!defined(imageRectangle)) {\n      throw new DeveloperError(`Invalid billboard image index: ${index}`);\n    }\n    //>>includeEnd('debug');\n\n    height = imageRectangle.height;\n  }\n\n  const dimensions = billboardCollection._textureAtlas.texture.dimensions;\n  const imageHeight = Math.round(\n    defaultValue(billboard.height, dimensions.y * height)\n  );\n  billboardCollection._maxSize = Math.max(\n    billboardCollection._maxSize,\n    imageHeight\n  );\n  let labelHorizontalOrigin = defaultValue(\n    billboard._labelHorizontalOrigin,\n    -2\n  );\n  labelHorizontalOrigin += 2;\n  const compressed3 = imageHeight * LEFT_SHIFT2 + labelHorizontalOrigin;\n\n  let red = Color.floatToByte(color.red);\n  let green = Color.floatToByte(color.green);\n  let blue = Color.floatToByte(color.blue);\n  const compressed0 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;\n\n  red = Color.floatToByte(pickColor.red);\n  green = Color.floatToByte(pickColor.green);\n  blue = Color.floatToByte(pickColor.blue);\n  const compressed1 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;\n\n  let compressed2 =\n    Color.floatToByte(color.alpha) * LEFT_SHIFT16 +\n    Color.floatToByte(pickColor.alpha) * LEFT_SHIFT8;\n  compressed2 += sizeInMeters * 2.0 + validAlignedAxis;\n\n  if (billboardCollection._instanced) {\n    i = billboard._index;\n    writer(i, compressed0, compressed1, compressed2, compressed3);\n  } else {\n    i = billboard._index * 4;\n    writer(i + 0, compressed0, compressed1, compressed2, compressed3);\n    writer(i + 1, compressed0, compressed1, compressed2, compressed3);\n    writer(i + 2, compressed0, compressed1, compressed2, compressed3);\n    writer(i + 3, compressed0, compressed1, compressed2, compressed3);\n  }\n}\n\nfunction writeEyeOffset(\n  billboardCollection,\n  frameState,\n  textureAtlasCoordinates,\n  vafWriters,\n  billboard\n) {\n  let i;\n  const writer = vafWriters[attributeLocations.eyeOffset];\n  const eyeOffset = billboard.eyeOffset;\n\n  // For billboards that are clamped to ground, move it slightly closer to the camera\n  let eyeOffsetZ = eyeOffset.z;\n  if (billboard._heightReference !== HeightReference.NONE) {\n    eyeOffsetZ *= 1.005;\n  }\n  billboardCollection._maxEyeOffset = Math.max(\n    billboardCollection._maxEyeOffset,\n    Math.abs(eyeOffset.x),\n    Math.abs(eyeOffset.y),\n    Math.abs(eyeOffsetZ)\n  );\n\n  if (billboardCollection._instanced) {\n    let width = 0;\n    let height = 0;\n    const index = billboard._imageIndex;\n    if (index !== -1) {\n      const imageRectangle = textureAtlasCoordinates[index];\n\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(imageRectangle)) {\n        throw new DeveloperError(`Invalid billboard image index: ${index}`);\n      }\n      //>>includeEnd('debug');\n\n      width = imageRectangle.width;\n      height = imageRectangle.height;\n    }\n\n    scratchCartesian2.x = width;\n    scratchCartesian2.y = height;\n    const compressedTexCoordsRange = AttributeCompression.compressTextureCoordinates(\n      scratchCartesian2\n    );\n\n    i = billboard._index;\n    writer(i, eyeOffset.x, eyeOffset.y, eyeOffsetZ, compressedTexCoordsRange);\n  } else {\n    i = billboard._index * 4;\n    writer(i + 0, eyeOffset.x, eyeOffset.y, eyeOffsetZ, 0.0);\n    writer(i + 1, eyeOffset.x, eyeOffset.y, eyeOffsetZ, 0.0);\n    writer(i + 2, eyeOffset.x, eyeOffset.y, eyeOffsetZ, 0.0);\n    writer(i + 3, eyeOffset.x, eyeOffset.y, eyeOffsetZ, 0.0);\n  }\n}\n\nfunction writeScaleByDistance(\n  billboardCollection,\n  frameState,\n  textureAtlasCoordinates,\n  vafWriters,\n  billboard\n) {\n  let i;\n  const writer = vafWriters[attributeLocations.scaleByDistance];\n  let near = 0.0;\n  let nearValue = 1.0;\n  let far = 1.0;\n  let farValue = 1.0;\n\n  const scale = billboard.scaleByDistance;\n  if (defined(scale)) {\n    near = scale.near;\n    nearValue = scale.nearValue;\n    far = scale.far;\n    farValue = scale.farValue;\n\n    if (nearValue !== 1.0 || farValue !== 1.0) {\n      // scale by distance calculation in shader need not be enabled\n      // until a billboard with near and far !== 1.0 is found\n      billboardCollection._shaderScaleByDistance = true;\n    }\n  }\n\n  if (billboardCollection._instanced) {\n    i = billboard._index;\n    writer(i, near, nearValue, far, farValue);\n  } else {\n    i = billboard._index * 4;\n    writer(i + 0, near, nearValue, far, farValue);\n    writer(i + 1, near, nearValue, far, farValue);\n    writer(i + 2, near, nearValue, far, farValue);\n    writer(i + 3, near, nearValue, far, farValue);\n  }\n}\n\nfunction writePixelOffsetScaleByDistance(\n  billboardCollection,\n  frameState,\n  textureAtlasCoordinates,\n  vafWriters,\n  billboard\n) {\n  let i;\n  const writer = vafWriters[attributeLocations.pixelOffsetScaleByDistance];\n  let near = 0.0;\n  let nearValue = 1.0;\n  let far = 1.0;\n  let farValue = 1.0;\n\n  const pixelOffsetScale = billboard.pixelOffsetScaleByDistance;\n  if (defined(pixelOffsetScale)) {\n    near = pixelOffsetScale.near;\n    nearValue = pixelOffsetScale.nearValue;\n    far = pixelOffsetScale.far;\n    farValue = pixelOffsetScale.farValue;\n\n    if (nearValue !== 1.0 || farValue !== 1.0) {\n      // pixelOffsetScale by distance calculation in shader need not be enabled\n      // until a billboard with near and far !== 1.0 is found\n      billboardCollection._shaderPixelOffsetScaleByDistance = true;\n    }\n  }\n\n  if (billboardCollection._instanced) {\n    i = billboard._index;\n    writer(i, near, nearValue, far, farValue);\n  } else {\n    i = billboard._index * 4;\n    writer(i + 0, near, nearValue, far, farValue);\n    writer(i + 1, near, nearValue, far, farValue);\n    writer(i + 2, near, nearValue, far, farValue);\n    writer(i + 3, near, nearValue, far, farValue);\n  }\n}\n\nfunction writeCompressedAttribute3(\n  billboardCollection,\n  frameState,\n  textureAtlasCoordinates,\n  vafWriters,\n  billboard\n) {\n  let i;\n  const writer = vafWriters[attributeLocations.compressedAttribute3];\n  let near = 0.0;\n  let far = Number.MAX_VALUE;\n\n  const distanceDisplayCondition = billboard.distanceDisplayCondition;\n  if (defined(distanceDisplayCondition)) {\n    near = distanceDisplayCondition.near;\n    far = distanceDisplayCondition.far;\n\n    near *= near;\n    far *= far;\n\n    billboardCollection._shaderDistanceDisplayCondition = true;\n  }\n\n  let disableDepthTestDistance = billboard.disableDepthTestDistance;\n  const clampToGround =\n    billboard.heightReference === HeightReference.CLAMP_TO_GROUND &&\n    frameState.context.depthTexture;\n  if (!defined(disableDepthTestDistance)) {\n    disableDepthTestDistance = clampToGround ? 5000.0 : 0.0;\n  }\n\n  disableDepthTestDistance *= disableDepthTestDistance;\n  if (clampToGround || disableDepthTestDistance > 0.0) {\n    billboardCollection._shaderDisableDepthDistance = true;\n    if (disableDepthTestDistance === Number.POSITIVE_INFINITY) {\n      disableDepthTestDistance = -1.0;\n    }\n  }\n\n  let imageHeight;\n  let imageWidth;\n\n  if (!defined(billboard._labelDimensions)) {\n    let height = 0;\n    let width = 0;\n    const index = billboard._imageIndex;\n    if (index !== -1) {\n      const imageRectangle = textureAtlasCoordinates[index];\n\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(imageRectangle)) {\n        throw new DeveloperError(`Invalid billboard image index: ${index}`);\n      }\n      //>>includeEnd('debug');\n\n      height = imageRectangle.height;\n      width = imageRectangle.width;\n    }\n\n    imageHeight = Math.round(\n      defaultValue(\n        billboard.height,\n        billboardCollection._textureAtlas.texture.dimensions.y * height\n      )\n    );\n\n    const textureWidth = billboardCollection._textureAtlas.texture.width;\n    imageWidth = Math.round(\n      defaultValue(billboard.width, textureWidth * width)\n    );\n  } else {\n    imageWidth = billboard._labelDimensions.x;\n    imageHeight = billboard._labelDimensions.y;\n  }\n\n  const w = Math.floor(CesiumMath.clamp(imageWidth, 0.0, LEFT_SHIFT12));\n  const h = Math.floor(CesiumMath.clamp(imageHeight, 0.0, LEFT_SHIFT12));\n  const dimensions = w * LEFT_SHIFT12 + h;\n\n  if (billboardCollection._instanced) {\n    i = billboard._index;\n    writer(i, near, far, disableDepthTestDistance, dimensions);\n  } else {\n    i = billboard._index * 4;\n    writer(i + 0, near, far, disableDepthTestDistance, dimensions);\n    writer(i + 1, near, far, disableDepthTestDistance, dimensions);\n    writer(i + 2, near, far, disableDepthTestDistance, dimensions);\n    writer(i + 3, near, far, disableDepthTestDistance, dimensions);\n  }\n}\n\nfunction writeTextureCoordinateBoundsOrLabelTranslate(\n  billboardCollection,\n  frameState,\n  textureAtlasCoordinates,\n  vafWriters,\n  billboard\n) {\n  if (billboard.heightReference === HeightReference.CLAMP_TO_GROUND) {\n    const scene = billboardCollection._scene;\n    const context = frameState.context;\n    const globeTranslucent = frameState.globeTranslucencyState.translucent;\n    const depthTestAgainstTerrain =\n      defined(scene.globe) && scene.globe.depthTestAgainstTerrain;\n\n    // Only do manual depth test if the globe is opaque and writes depth\n    billboardCollection._shaderClampToGround =\n      context.depthTexture && !globeTranslucent && depthTestAgainstTerrain;\n  }\n  let i;\n  const writer =\n    vafWriters[attributeLocations.textureCoordinateBoundsOrLabelTranslate];\n\n  if (ContextLimits.maximumVertexTextureImageUnits > 0) {\n    //write _labelTranslate, used by depth testing in the vertex shader\n    let translateX = 0;\n    let translateY = 0;\n    if (defined(billboard._labelTranslate)) {\n      translateX = billboard._labelTranslate.x;\n      translateY = billboard._labelTranslate.y;\n    }\n    if (billboardCollection._instanced) {\n      i = billboard._index;\n      writer(i, translateX, translateY, 0.0, 0.0);\n    } else {\n      i = billboard._index * 4;\n      writer(i + 0, translateX, translateY, 0.0, 0.0);\n      writer(i + 1, translateX, translateY, 0.0, 0.0);\n      writer(i + 2, translateX, translateY, 0.0, 0.0);\n      writer(i + 3, translateX, translateY, 0.0, 0.0);\n    }\n    return;\n  }\n\n  //write texture coordinate bounds, used by depth testing in fragment shader\n  let minX = 0;\n  let minY = 0;\n  let width = 0;\n  let height = 0;\n  const index = billboard._imageIndex;\n  if (index !== -1) {\n    const imageRectangle = textureAtlasCoordinates[index];\n\n    //>>includeStart('debug', pragmas.debug);\n    if (!defined(imageRectangle)) {\n      throw new DeveloperError(`Invalid billboard image index: ${index}`);\n    }\n    //>>includeEnd('debug');\n\n    minX = imageRectangle.x;\n    minY = imageRectangle.y;\n    width = imageRectangle.width;\n    height = imageRectangle.height;\n  }\n  const maxX = minX + width;\n  const maxY = minY + height;\n\n  if (billboardCollection._instanced) {\n    i = billboard._index;\n    writer(i, minX, minY, maxX, maxY);\n  } else {\n    i = billboard._index * 4;\n    writer(i + 0, minX, minY, maxX, maxY);\n    writer(i + 1, minX, minY, maxX, maxY);\n    writer(i + 2, minX, minY, maxX, maxY);\n    writer(i + 3, minX, minY, maxX, maxY);\n  }\n}\n\nfunction writeBatchId(\n  billboardCollection,\n  frameState,\n  textureAtlasCoordinates,\n  vafWriters,\n  billboard\n) {\n  if (!defined(billboardCollection._batchTable)) {\n    return;\n  }\n\n  const writer = vafWriters[attributeLocations.a_batchId];\n  const id = billboard._batchIndex;\n\n  let i;\n  if (billboardCollection._instanced) {\n    i = billboard._index;\n    writer(i, id);\n  } else {\n    i = billboard._index * 4;\n    writer(i + 0, id);\n    writer(i + 1, id);\n    writer(i + 2, id);\n    writer(i + 3, id);\n  }\n}\n\nfunction writeSDF(\n  billboardCollection,\n  frameState,\n  textureAtlasCoordinates,\n  vafWriters,\n  billboard\n) {\n  if (!billboardCollection._sdf) {\n    return;\n  }\n\n  let i;\n  const writer = vafWriters[attributeLocations.sdf];\n\n  const outlineColor = billboard.outlineColor;\n  const outlineWidth = billboard.outlineWidth;\n\n  const red = Color.floatToByte(outlineColor.red);\n  const green = Color.floatToByte(outlineColor.green);\n  const blue = Color.floatToByte(outlineColor.blue);\n  const compressed0 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;\n\n  // Compute the relative outline distance\n  const outlineDistance = outlineWidth / SDFSettings.RADIUS;\n  const compressed1 =\n    Color.floatToByte(outlineColor.alpha) * LEFT_SHIFT16 +\n    Color.floatToByte(outlineDistance) * LEFT_SHIFT8;\n\n  if (billboardCollection._instanced) {\n    i = billboard._index;\n    writer(i, compressed0, compressed1);\n  } else {\n    i = billboard._index * 4;\n    writer(i + 0, compressed0 + LOWER_LEFT, compressed1);\n    writer(i + 1, compressed0 + LOWER_RIGHT, compressed1);\n    writer(i + 2, compressed0 + UPPER_RIGHT, compressed1);\n    writer(i + 3, compressed0 + UPPER_LEFT, compressed1);\n  }\n}\n\nfunction writeBillboard(\n  billboardCollection,\n  frameState,\n  textureAtlasCoordinates,\n  vafWriters,\n  billboard\n) {\n  writePositionScaleAndRotation(\n    billboardCollection,\n    frameState,\n    textureAtlasCoordinates,\n    vafWriters,\n    billboard\n  );\n  writeCompressedAttrib0(\n    billboardCollection,\n    frameState,\n    textureAtlasCoordinates,\n    vafWriters,\n    billboard\n  );\n  writeCompressedAttrib1(\n    billboardCollection,\n    frameState,\n    textureAtlasCoordinates,\n    vafWriters,\n    billboard\n  );\n  writeCompressedAttrib2(\n    billboardCollection,\n    frameState,\n    textureAtlasCoordinates,\n    vafWriters,\n    billboard\n  );\n  writeEyeOffset(\n    billboardCollection,\n    frameState,\n    textureAtlasCoordinates,\n    vafWriters,\n    billboard\n  );\n  writeScaleByDistance(\n    billboardCollection,\n    frameState,\n    textureAtlasCoordinates,\n    vafWriters,\n    billboard\n  );\n  writePixelOffsetScaleByDistance(\n    billboardCollection,\n    frameState,\n    textureAtlasCoordinates,\n    vafWriters,\n    billboard\n  );\n  writeCompressedAttribute3(\n    billboardCollection,\n    frameState,\n    textureAtlasCoordinates,\n    vafWriters,\n    billboard\n  );\n  writeTextureCoordinateBoundsOrLabelTranslate(\n    billboardCollection,\n    frameState,\n    textureAtlasCoordinates,\n    vafWriters,\n    billboard\n  );\n  writeBatchId(\n    billboardCollection,\n    frameState,\n    textureAtlasCoordinates,\n    vafWriters,\n    billboard\n  );\n  writeSDF(\n    billboardCollection,\n    frameState,\n    textureAtlasCoordinates,\n    vafWriters,\n    billboard\n  );\n}\n\nfunction recomputeActualPositions(\n  billboardCollection,\n  billboards,\n  length,\n  frameState,\n  modelMatrix,\n  recomputeBoundingVolume\n) {\n  let boundingVolume;\n  if (frameState.mode === SceneMode.SCENE3D) {\n    boundingVolume = billboardCollection._baseVolume;\n    billboardCollection._boundingVolumeDirty = true;\n  } else {\n    boundingVolume = billboardCollection._baseVolume2D;\n  }\n\n  const positions = [];\n  for (let i = 0; i < length; ++i) {\n    const billboard = billboards[i];\n    const position = billboard.position;\n    const actualPosition = Billboard._computeActualPosition(\n      billboard,\n      position,\n      frameState,\n      modelMatrix\n    );\n    if (defined(actualPosition)) {\n      billboard._setActualPosition(actualPosition);\n\n      if (recomputeBoundingVolume) {\n        positions.push(actualPosition);\n      } else {\n        BoundingSphere.expand(boundingVolume, actualPosition, boundingVolume);\n      }\n    }\n  }\n\n  if (recomputeBoundingVolume) {\n    BoundingSphere.fromPoints(positions, boundingVolume);\n  }\n}\n\nfunction updateMode(billboardCollection, frameState) {\n  const mode = frameState.mode;\n\n  const billboards = billboardCollection._billboards;\n  const billboardsToUpdate = billboardCollection._billboardsToUpdate;\n  const modelMatrix = billboardCollection._modelMatrix;\n\n  if (\n    billboardCollection._createVertexArray ||\n    billboardCollection._mode !== mode ||\n    (mode !== SceneMode.SCENE3D &&\n      !Matrix4.equals(modelMatrix, billboardCollection.modelMatrix))\n  ) {\n    billboardCollection._mode = mode;\n    Matrix4.clone(billboardCollection.modelMatrix, modelMatrix);\n    billboardCollection._createVertexArray = true;\n\n    if (\n      mode === SceneMode.SCENE3D ||\n      mode === SceneMode.SCENE2D ||\n      mode === SceneMode.COLUMBUS_VIEW\n    ) {\n      recomputeActualPositions(\n        billboardCollection,\n        billboards,\n        billboards.length,\n        frameState,\n        modelMatrix,\n        true\n      );\n    }\n  } else if (mode === SceneMode.MORPHING) {\n    recomputeActualPositions(\n      billboardCollection,\n      billboards,\n      billboards.length,\n      frameState,\n      modelMatrix,\n      true\n    );\n  } else if (mode === SceneMode.SCENE2D || mode === SceneMode.COLUMBUS_VIEW) {\n    recomputeActualPositions(\n      billboardCollection,\n      billboardsToUpdate,\n      billboardCollection._billboardsToUpdateIndex,\n      frameState,\n      modelMatrix,\n      false\n    );\n  }\n}\n\nfunction updateBoundingVolume(collection, frameState, boundingVolume) {\n  let pixelScale = 1.0;\n  if (!collection._allSizedInMeters || collection._maxPixelOffset !== 0.0) {\n    pixelScale = frameState.camera.getPixelSize(\n      boundingVolume,\n      frameState.context.drawingBufferWidth,\n      frameState.context.drawingBufferHeight\n    );\n  }\n\n  let size = pixelScale * collection._maxScale * collection._maxSize * 2.0;\n  if (collection._allHorizontalCenter && collection._allVerticalCenter) {\n    size *= 0.5;\n  }\n\n  const offset =\n    pixelScale * collection._maxPixelOffset + collection._maxEyeOffset;\n  boundingVolume.radius += size + offset;\n}\n\nfunction createDebugCommand(billboardCollection, context) {\n  const fs =\n    \"uniform sampler2D billboard_texture; \\n\" +\n    \"in vec2 v_textureCoordinates; \\n\" +\n    \"void main() \\n\" +\n    \"{ \\n\" +\n    \"    out_FragColor = texture(billboard_texture, v_textureCoordinates); \\n\" +\n    \"} \\n\";\n\n  const drawCommand = context.createViewportQuadCommand(fs, {\n    uniformMap: {\n      billboard_texture: function () {\n        return billboardCollection._textureAtlas.texture;\n      },\n    },\n  });\n  drawCommand.pass = Pass.OVERLAY;\n  return drawCommand;\n}\n\nconst scratchWriterArray = [];\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly.  This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {RuntimeError} image with id must be in the atlas.\n */\nBillboardCollection.prototype.update = function (frameState) {\n  removeBillboards(this);\n\n  if (!this.show) {\n    return;\n  }\n\n  let billboards = this._billboards;\n  let billboardsLength = billboards.length;\n\n  const context = frameState.context;\n  this._instanced = context.instancedArrays;\n  attributeLocations = this._instanced\n    ? attributeLocationsInstanced\n    : attributeLocationsBatched;\n  getIndexBuffer = this._instanced\n    ? getIndexBufferInstanced\n    : getIndexBufferBatched;\n\n  let textureAtlas = this._textureAtlas;\n  if (!defined(textureAtlas)) {\n    textureAtlas = this._textureAtlas = new TextureAtlas({\n      context: context,\n    });\n\n    for (let ii = 0; ii < billboardsLength; ++ii) {\n      billboards[ii]._loadImage();\n    }\n  }\n\n  const textureAtlasCoordinates = textureAtlas.textureCoordinates;\n  if (textureAtlasCoordinates.length === 0) {\n    // Can't write billboard vertices until we have texture coordinates\n    // provided by a texture atlas\n    return;\n  }\n\n  updateMode(this, frameState);\n\n  billboards = this._billboards;\n  billboardsLength = billboards.length;\n  const billboardsToUpdate = this._billboardsToUpdate;\n  const billboardsToUpdateLength = this._billboardsToUpdateIndex;\n\n  const properties = this._propertiesChanged;\n\n  const textureAtlasGUID = textureAtlas.guid;\n  const createVertexArray =\n    this._createVertexArray || this._textureAtlasGUID !== textureAtlasGUID;\n  this._textureAtlasGUID = textureAtlasGUID;\n\n  let vafWriters;\n  const pass = frameState.passes;\n  const picking = pass.pick;\n\n  // PERFORMANCE_IDEA: Round robin multiple buffers.\n  if (createVertexArray || (!picking && this.computeNewBuffersUsage())) {\n    this._createVertexArray = false;\n\n    for (let k = 0; k < NUMBER_OF_PROPERTIES; ++k) {\n      properties[k] = 0;\n    }\n\n    this._vaf = this._vaf && this._vaf.destroy();\n\n    if (billboardsLength > 0) {\n      // PERFORMANCE_IDEA:  Instead of creating a new one, resize like std::vector.\n      this._vaf = createVAF(\n        context,\n        billboardsLength,\n        this._buffersUsage,\n        this._instanced,\n        this._batchTable,\n        this._sdf\n      );\n      vafWriters = this._vaf.writers;\n\n      // Rewrite entire buffer if billboards were added or removed.\n      for (let i = 0; i < billboardsLength; ++i) {\n        const billboard = this._billboards[i];\n        billboard._dirty = false; // In case it needed an update.\n        writeBillboard(\n          this,\n          frameState,\n          textureAtlasCoordinates,\n          vafWriters,\n          billboard\n        );\n      }\n\n      // Different billboard collections share the same index buffer.\n      this._vaf.commit(getIndexBuffer(context));\n    }\n\n    this._billboardsToUpdateIndex = 0;\n  } else if (billboardsToUpdateLength > 0) {\n    // Billboards were modified, but none were added or removed.\n    const writers = scratchWriterArray;\n    writers.length = 0;\n\n    if (\n      properties[POSITION_INDEX] ||\n      properties[ROTATION_INDEX] ||\n      properties[SCALE_INDEX]\n    ) {\n      writers.push(writePositionScaleAndRotation);\n    }\n\n    if (\n      properties[IMAGE_INDEX_INDEX] ||\n      properties[PIXEL_OFFSET_INDEX] ||\n      properties[HORIZONTAL_ORIGIN_INDEX] ||\n      properties[VERTICAL_ORIGIN_INDEX] ||\n      properties[SHOW_INDEX]\n    ) {\n      writers.push(writeCompressedAttrib0);\n      if (this._instanced) {\n        writers.push(writeEyeOffset);\n      }\n    }\n\n    if (\n      properties[IMAGE_INDEX_INDEX] ||\n      properties[ALIGNED_AXIS_INDEX] ||\n      properties[TRANSLUCENCY_BY_DISTANCE_INDEX]\n    ) {\n      writers.push(writeCompressedAttrib1);\n      writers.push(writeCompressedAttrib2);\n    }\n\n    if (properties[IMAGE_INDEX_INDEX] || properties[COLOR_INDEX]) {\n      writers.push(writeCompressedAttrib2);\n    }\n\n    if (properties[EYE_OFFSET_INDEX]) {\n      writers.push(writeEyeOffset);\n    }\n\n    if (properties[SCALE_BY_DISTANCE_INDEX]) {\n      writers.push(writeScaleByDistance);\n    }\n\n    if (properties[PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX]) {\n      writers.push(writePixelOffsetScaleByDistance);\n    }\n\n    if (\n      properties[DISTANCE_DISPLAY_CONDITION_INDEX] ||\n      properties[DISABLE_DEPTH_DISTANCE] ||\n      properties[IMAGE_INDEX_INDEX] ||\n      properties[POSITION_INDEX]\n    ) {\n      writers.push(writeCompressedAttribute3);\n    }\n\n    if (properties[IMAGE_INDEX_INDEX] || properties[POSITION_INDEX]) {\n      writers.push(writeTextureCoordinateBoundsOrLabelTranslate);\n    }\n\n    if (properties[SDF_INDEX]) {\n      writers.push(writeSDF);\n    }\n\n    const numWriters = writers.length;\n    vafWriters = this._vaf.writers;\n\n    if (billboardsToUpdateLength / billboardsLength > 0.1) {\n      // If more than 10% of billboard change, rewrite the entire buffer.\n\n      // PERFORMANCE_IDEA:  I totally made up 10% :).\n\n      for (let m = 0; m < billboardsToUpdateLength; ++m) {\n        const b = billboardsToUpdate[m];\n        b._dirty = false;\n\n        for (let n = 0; n < numWriters; ++n) {\n          writers[n](this, frameState, textureAtlasCoordinates, vafWriters, b);\n        }\n      }\n      this._vaf.commit(getIndexBuffer(context));\n    } else {\n      for (let h = 0; h < billboardsToUpdateLength; ++h) {\n        const bb = billboardsToUpdate[h];\n        bb._dirty = false;\n\n        for (let o = 0; o < numWriters; ++o) {\n          writers[o](this, frameState, textureAtlasCoordinates, vafWriters, bb);\n        }\n\n        if (this._instanced) {\n          this._vaf.subCommit(bb._index, 1);\n        } else {\n          this._vaf.subCommit(bb._index * 4, 4);\n        }\n      }\n      this._vaf.endSubCommits();\n    }\n\n    this._billboardsToUpdateIndex = 0;\n  }\n\n  // If the number of total billboards ever shrinks considerably\n  // Truncate billboardsToUpdate so that we free memory that we're\n  // not going to be using.\n  if (billboardsToUpdateLength > billboardsLength * 1.5) {\n    billboardsToUpdate.length = billboardsLength;\n  }\n\n  if (!defined(this._vaf) || !defined(this._vaf.va)) {\n    return;\n  }\n\n  if (this._boundingVolumeDirty) {\n    this._boundingVolumeDirty = false;\n    BoundingSphere.transform(\n      this._baseVolume,\n      this.modelMatrix,\n      this._baseVolumeWC\n    );\n  }\n\n  let boundingVolume;\n  let modelMatrix = Matrix4.IDENTITY;\n  if (frameState.mode === SceneMode.SCENE3D) {\n    modelMatrix = this.modelMatrix;\n    boundingVolume = BoundingSphere.clone(\n      this._baseVolumeWC,\n      this._boundingVolume\n    );\n  } else {\n    boundingVolume = BoundingSphere.clone(\n      this._baseVolume2D,\n      this._boundingVolume\n    );\n  }\n  updateBoundingVolume(this, frameState, boundingVolume);\n\n  const blendOptionChanged = this._blendOption !== this.blendOption;\n  this._blendOption = this.blendOption;\n\n  if (blendOptionChanged) {\n    if (\n      this._blendOption === BlendOption.OPAQUE ||\n      this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT\n    ) {\n      this._rsOpaque = RenderState.fromCache({\n        depthTest: {\n          enabled: true,\n          func: WebGLConstants.LESS,\n        },\n        depthMask: true,\n      });\n    } else {\n      this._rsOpaque = undefined;\n    }\n\n    // If OPAQUE_AND_TRANSLUCENT is in use, only the opaque pass gets the benefit of the depth buffer,\n    // not the translucent pass.  Otherwise, if the TRANSLUCENT pass is on its own, it turns on\n    // a depthMask in lieu of full depth sorting (because it has opaque-ish fragments that look bad in OIT).\n    // When the TRANSLUCENT depth mask is in use, label backgrounds require the depth func to be LEQUAL.\n    const useTranslucentDepthMask =\n      this._blendOption === BlendOption.TRANSLUCENT;\n\n    if (\n      this._blendOption === BlendOption.TRANSLUCENT ||\n      this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT\n    ) {\n      this._rsTranslucent = RenderState.fromCache({\n        depthTest: {\n          enabled: true,\n          func: useTranslucentDepthMask\n            ? WebGLConstants.LEQUAL\n            : WebGLConstants.LESS,\n        },\n        depthMask: useTranslucentDepthMask,\n        blending: BlendingState.ALPHA_BLEND,\n      });\n    } else {\n      this._rsTranslucent = undefined;\n    }\n  }\n\n  this._shaderDisableDepthDistance =\n    this._shaderDisableDepthDistance ||\n    frameState.minimumDisableDepthTestDistance !== 0.0;\n\n  let vsSource;\n  let fsSource;\n  let vs;\n  let fs;\n  let vertDefines;\n\n  const supportVSTextureReads =\n    ContextLimits.maximumVertexTextureImageUnits > 0;\n\n  if (\n    blendOptionChanged ||\n    this._shaderRotation !== this._compiledShaderRotation ||\n    this._shaderAlignedAxis !== this._compiledShaderAlignedAxis ||\n    this._shaderScaleByDistance !== this._compiledShaderScaleByDistance ||\n    this._shaderTranslucencyByDistance !==\n      this._compiledShaderTranslucencyByDistance ||\n    this._shaderPixelOffsetScaleByDistance !==\n      this._compiledShaderPixelOffsetScaleByDistance ||\n    this._shaderDistanceDisplayCondition !==\n      this._compiledShaderDistanceDisplayCondition ||\n    this._shaderDisableDepthDistance !==\n      this._compiledShaderDisableDepthDistance ||\n    this._shaderClampToGround !== this._compiledShaderClampToGround ||\n    this._sdf !== this._compiledSDF\n  ) {\n    vsSource = BillboardCollectionVS;\n    fsSource = BillboardCollectionFS;\n\n    vertDefines = [];\n    if (defined(this._batchTable)) {\n      vertDefines.push(\"VECTOR_TILE\");\n      vsSource = this._batchTable.getVertexShaderCallback(\n        false,\n        \"a_batchId\",\n        undefined\n      )(vsSource);\n      fsSource = this._batchTable.getFragmentShaderCallback(\n        false,\n        undefined\n      )(fsSource);\n    }\n\n    vs = new ShaderSource({\n      defines: vertDefines,\n      sources: [vsSource],\n    });\n    if (this._instanced) {\n      vs.defines.push(\"INSTANCED\");\n    }\n    if (this._shaderRotation) {\n      vs.defines.push(\"ROTATION\");\n    }\n    if (this._shaderAlignedAxis) {\n      vs.defines.push(\"ALIGNED_AXIS\");\n    }\n    if (this._shaderScaleByDistance) {\n      vs.defines.push(\"EYE_DISTANCE_SCALING\");\n    }\n    if (this._shaderTranslucencyByDistance) {\n      vs.defines.push(\"EYE_DISTANCE_TRANSLUCENCY\");\n    }\n    if (this._shaderPixelOffsetScaleByDistance) {\n      vs.defines.push(\"EYE_DISTANCE_PIXEL_OFFSET\");\n    }\n    if (this._shaderDistanceDisplayCondition) {\n      vs.defines.push(\"DISTANCE_DISPLAY_CONDITION\");\n    }\n    if (this._shaderDisableDepthDistance) {\n      vs.defines.push(\"DISABLE_DEPTH_DISTANCE\");\n    }\n    if (this._shaderClampToGround) {\n      if (supportVSTextureReads) {\n        vs.defines.push(\"VERTEX_DEPTH_CHECK\");\n      } else {\n        vs.defines.push(\"FRAGMENT_DEPTH_CHECK\");\n      }\n    }\n\n    const sdfEdge = 1.0 - SDFSettings.CUTOFF;\n\n    if (this._sdf) {\n      vs.defines.push(\"SDF\");\n    }\n\n    const vectorFragDefine = defined(this._batchTable) ? \"VECTOR_TILE\" : \"\";\n\n    if (this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT) {\n      fs = new ShaderSource({\n        defines: [\"OPAQUE\", vectorFragDefine],\n        sources: [fsSource],\n      });\n      if (this._shaderClampToGround) {\n        if (supportVSTextureReads) {\n          fs.defines.push(\"VERTEX_DEPTH_CHECK\");\n        } else {\n          fs.defines.push(\"FRAGMENT_DEPTH_CHECK\");\n        }\n      }\n\n      if (this._sdf) {\n        fs.defines.push(\"SDF\");\n        fs.defines.push(`SDF_EDGE ${sdfEdge}`);\n      }\n\n      this._sp = ShaderProgram.replaceCache({\n        context: context,\n        shaderProgram: this._sp,\n        vertexShaderSource: vs,\n        fragmentShaderSource: fs,\n        attributeLocations: attributeLocations,\n      });\n\n      fs = new ShaderSource({\n        defines: [\"TRANSLUCENT\", vectorFragDefine],\n        sources: [fsSource],\n      });\n      if (this._shaderClampToGround) {\n        if (supportVSTextureReads) {\n          fs.defines.push(\"VERTEX_DEPTH_CHECK\");\n        } else {\n          fs.defines.push(\"FRAGMENT_DEPTH_CHECK\");\n        }\n      }\n      if (this._sdf) {\n        fs.defines.push(\"SDF\");\n        fs.defines.push(`SDF_EDGE ${sdfEdge}`);\n      }\n      this._spTranslucent = ShaderProgram.replaceCache({\n        context: context,\n        shaderProgram: this._spTranslucent,\n        vertexShaderSource: vs,\n        fragmentShaderSource: fs,\n        attributeLocations: attributeLocations,\n      });\n    }\n\n    if (this._blendOption === BlendOption.OPAQUE) {\n      fs = new ShaderSource({\n        defines: [vectorFragDefine],\n        sources: [fsSource],\n      });\n      if (this._shaderClampToGround) {\n        if (supportVSTextureReads) {\n          fs.defines.push(\"VERTEX_DEPTH_CHECK\");\n        } else {\n          fs.defines.push(\"FRAGMENT_DEPTH_CHECK\");\n        }\n      }\n      if (this._sdf) {\n        fs.defines.push(\"SDF\");\n        fs.defines.push(`SDF_EDGE ${sdfEdge}`);\n      }\n      this._sp = ShaderProgram.replaceCache({\n        context: context,\n        shaderProgram: this._sp,\n        vertexShaderSource: vs,\n        fragmentShaderSource: fs,\n        attributeLocations: attributeLocations,\n      });\n    }\n\n    if (this._blendOption === BlendOption.TRANSLUCENT) {\n      fs = new ShaderSource({\n        defines: [vectorFragDefine],\n        sources: [fsSource],\n      });\n      if (this._shaderClampToGround) {\n        if (supportVSTextureReads) {\n          fs.defines.push(\"VERTEX_DEPTH_CHECK\");\n        } else {\n          fs.defines.push(\"FRAGMENT_DEPTH_CHECK\");\n        }\n      }\n      if (this._sdf) {\n        fs.defines.push(\"SDF\");\n        fs.defines.push(`SDF_EDGE ${sdfEdge}`);\n      }\n      this._spTranslucent = ShaderProgram.replaceCache({\n        context: context,\n        shaderProgram: this._spTranslucent,\n        vertexShaderSource: vs,\n        fragmentShaderSource: fs,\n        attributeLocations: attributeLocations,\n      });\n    }\n\n    this._compiledShaderRotation = this._shaderRotation;\n    this._compiledShaderAlignedAxis = this._shaderAlignedAxis;\n    this._compiledShaderScaleByDistance = this._shaderScaleByDistance;\n    this._compiledShaderTranslucencyByDistance = this._shaderTranslucencyByDistance;\n    this._compiledShaderPixelOffsetScaleByDistance = this._shaderPixelOffsetScaleByDistance;\n    this._compiledShaderDistanceDisplayCondition = this._shaderDistanceDisplayCondition;\n    this._compiledShaderDisableDepthDistance = this._shaderDisableDepthDistance;\n    this._compiledShaderClampToGround = this._shaderClampToGround;\n    this._compiledSDF = this._sdf;\n  }\n\n  const commandList = frameState.commandList;\n\n  if (pass.render || pass.pick) {\n    const colorList = this._colorCommands;\n\n    const opaque = this._blendOption === BlendOption.OPAQUE;\n    const opaqueAndTranslucent =\n      this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT;\n\n    const va = this._vaf.va;\n    const vaLength = va.length;\n\n    let uniforms = this._uniforms;\n    let pickId;\n    if (defined(this._batchTable)) {\n      uniforms = this._batchTable.getUniformMapCallback()(uniforms);\n      pickId = this._batchTable.getPickId();\n    } else {\n      pickId = \"v_pickColor\";\n    }\n\n    colorList.length = vaLength;\n    const totalLength = opaqueAndTranslucent ? vaLength * 2 : vaLength;\n    for (let j = 0; j < totalLength; ++j) {\n      let command = colorList[j];\n      if (!defined(command)) {\n        command = colorList[j] = new DrawCommand();\n      }\n\n      const opaqueCommand = opaque || (opaqueAndTranslucent && j % 2 === 0);\n\n      command.pass =\n        opaqueCommand || !opaqueAndTranslucent ? Pass.OPAQUE : Pass.TRANSLUCENT;\n      command.owner = this;\n\n      const index = opaqueAndTranslucent ? Math.floor(j / 2.0) : j;\n      command.boundingVolume = boundingVolume;\n      command.modelMatrix = modelMatrix;\n      command.count = va[index].indicesCount;\n      command.shaderProgram = opaqueCommand ? this._sp : this._spTranslucent;\n      command.uniformMap = uniforms;\n      command.vertexArray = va[index].va;\n      command.renderState = opaqueCommand\n        ? this._rsOpaque\n        : this._rsTranslucent;\n      command.debugShowBoundingVolume = this.debugShowBoundingVolume;\n      command.pickId = pickId;\n\n      if (this._instanced) {\n        command.count = 6;\n        command.instanceCount = billboardsLength;\n      }\n\n      commandList.push(command);\n    }\n\n    if (this.debugShowTextureAtlas) {\n      if (!defined(this.debugCommand)) {\n        this.debugCommand = createDebugCommand(this, frameState.context);\n      }\n\n      commandList.push(this.debugCommand);\n    }\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see BillboardCollection#destroy\n */\nBillboardCollection.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * billboards = billboards && billboards.destroy();\n *\n * @see BillboardCollection#isDestroyed\n */\nBillboardCollection.prototype.destroy = function () {\n  if (defined(this._removeCallbackFunc)) {\n    this._removeCallbackFunc();\n    this._removeCallbackFunc = undefined;\n  }\n\n  this._textureAtlas =\n    this._destroyTextureAtlas &&\n    this._textureAtlas &&\n    this._textureAtlas.destroy();\n  this._sp = this._sp && this._sp.destroy();\n  this._spTranslucent = this._spTranslucent && this._spTranslucent.destroy();\n  this._vaf = this._vaf && this._vaf.destroy();\n  destroyBillboards(this._billboards);\n\n  return destroyObject(this);\n};\nexport default BillboardCollection;\n", "/**\n * Creates a {@link createBillboardPointCallback.CanvasFunction} that will create a canvas with a point.\n *\n * @param {number} centerAlpha The alpha of the center of the point. The value must be in the range [0.0, 1.0].\n * @param {string} cssColor The CSS color string.\n * @param {string} cssOutlineColor The CSS color of the point outline.\n * @param {number} cssOutlineWidth The width of the outline in pixels.\n * @param {number} pixelSize The size of the point in pixels.\n * @return {createBillboardPointCallback.CanvasFunction} The function that will return a canvas with the point drawn on it.\n *\n * @private\n */\nfunction createBillboardPointCallback(\n  centerAlpha,\n  cssColor,\n  cssOutlineColor,\n  cssOutlineWidth,\n  pixelSize\n) {\n  return function () {\n    const canvas = document.createElement(\"canvas\");\n\n    const length = pixelSize + 2 * cssOutlineWidth;\n    canvas.height = canvas.width = length;\n\n    const context2D = canvas.getContext(\"2d\");\n    context2D.clearRect(0, 0, length, length);\n\n    if (cssOutlineWidth !== 0) {\n      context2D.beginPath();\n      context2D.arc(length / 2, length / 2, length / 2, 0, 2 * Math.PI, true);\n      context2D.closePath();\n      context2D.fillStyle = cssOutlineColor;\n      context2D.fill();\n      // Punch a hole in the center if needed.\n      if (centerAlpha < 1.0) {\n        context2D.save();\n        context2D.globalCompositeOperation = \"destination-out\";\n        context2D.beginPath();\n        context2D.arc(\n          length / 2,\n          length / 2,\n          pixelSize / 2,\n          0,\n          2 * Math.PI,\n          true\n        );\n        context2D.closePath();\n        context2D.fillStyle = \"black\";\n        context2D.fill();\n        context2D.restore();\n      }\n    }\n\n    context2D.beginPath();\n    context2D.arc(length / 2, length / 2, pixelSize / 2, 0, 2 * Math.PI, true);\n    context2D.closePath();\n    context2D.fillStyle = cssColor;\n    context2D.fill();\n\n    return canvas;\n  };\n}\n\n/**\n * A function that returns a canvas containing an image of a point.\n * @callback createBillboardPointCallback.CanvasFunction\n * @returns {HTMLCanvasElement} The result of the calculation.\n */\nexport default createBillboardPointCallback;\n", "import Cartographic from \"../Core/Cartographic.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Cesium3DTileFeature from \"./Cesium3DTileFeature.js\";\nimport createBillboardPointCallback from \"./createBillboardPointCallback.js\";\n\n/**\n * A point feature of a {@link Cesium3DTileset}.\n * <p>\n * Provides access to a feature's properties stored in the tile's batch table, as well\n * as the ability to show/hide a feature and change its point properties\n * </p>\n * <p>\n * Modifications to a <code>Cesium3DTilePointFeature</code> object have the lifetime of the tile's\n * content.  If the tile's content is unloaded, e.g., due to it going out of view and needing\n * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any\n * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications.\n * </p>\n * <p>\n * Do not construct this directly.  Access it through {@link Cesium3DTileContent#getFeature}\n * or picking using {@link Scene#pick} and {@link Scene#pickPosition}.\n * </p>\n *\n * @alias Cesium3DTilePointFeature\n * @constructor\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * // On mouse over, display all the properties for a feature in the console log.\n * handler.setInputAction(function(movement) {\n *     const feature = scene.pick(movement.endPosition);\n *     if (feature instanceof Cesium.Cesium3DTilePointFeature) {\n *         const propertyIds = feature.getPropertyIds();\n *         const length = propertyIds.length;\n *         for (let i = 0; i < length; ++i) {\n *             const propertyId = propertyIds[i];\n *             console.log(`{propertyId}: ${feature.getProperty(propertyId)}`);\n *         }\n *     }\n * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);\n */\nfunction Cesium3DTilePointFeature(\n  content,\n  batchId,\n  billboard,\n  label,\n  polyline\n) {\n  this._content = content;\n  this._billboard = billboard;\n  this._label = label;\n  this._polyline = polyline;\n\n  this._batchId = batchId;\n  this._billboardImage = undefined;\n  this._billboardColor = undefined;\n  this._billboardOutlineColor = undefined;\n  this._billboardOutlineWidth = undefined;\n  this._billboardSize = undefined;\n  this._pointSize = undefined;\n  this._color = undefined;\n  this._pointSize = undefined;\n  this._pointOutlineColor = undefined;\n  this._pointOutlineWidth = undefined;\n  this._heightOffset = undefined;\n\n  this._pickIds = new Array(3);\n\n  setBillboardImage(this);\n}\n\nconst scratchCartographic = new Cartographic();\n\nObject.defineProperties(Cesium3DTilePointFeature.prototype, {\n  /**\n   * Gets or sets if the feature will be shown. This is set for all features\n   * when a style's show is evaluated.\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  show: {\n    get: function () {\n      return this._label.show;\n    },\n    set: function (value) {\n      this._label.show = value;\n      this._billboard.show = value;\n      this._polyline.show = value;\n    },\n  },\n\n  /**\n   * Gets or sets the color of the point of this feature.\n   * <p>\n   * Only applied when <code>image</code> is <code>undefined</code>.\n   * </p>\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {Color}\n   */\n  color: {\n    get: function () {\n      return this._color;\n    },\n    set: function (value) {\n      this._color = Color.clone(value, this._color);\n      setBillboardImage(this);\n    },\n  },\n\n  /**\n   * Gets or sets the point size of this feature.\n   * <p>\n   * Only applied when <code>image</code> is <code>undefined</code>.\n   * </p>\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {number}\n   */\n  pointSize: {\n    get: function () {\n      return this._pointSize;\n    },\n    set: function (value) {\n      this._pointSize = value;\n      setBillboardImage(this);\n    },\n  },\n\n  /**\n   * Gets or sets the point outline color of this feature.\n   * <p>\n   * Only applied when <code>image</code> is <code>undefined</code>.\n   * </p>\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {Color}\n   */\n  pointOutlineColor: {\n    get: function () {\n      return this._pointOutlineColor;\n    },\n    set: function (value) {\n      this._pointOutlineColor = Color.clone(value, this._pointOutlineColor);\n      setBillboardImage(this);\n    },\n  },\n\n  /**\n   * Gets or sets the point outline width in pixels of this feature.\n   * <p>\n   * Only applied when <code>image</code> is <code>undefined</code>.\n   * </p>\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {number}\n   */\n  pointOutlineWidth: {\n    get: function () {\n      return this._pointOutlineWidth;\n    },\n    set: function (value) {\n      this._pointOutlineWidth = value;\n      setBillboardImage(this);\n    },\n  },\n\n  /**\n   * Gets or sets the label color of this feature.\n   * <p>\n   * The color will be applied to the label if <code>labelText</code> is defined.\n   * </p>\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {Color}\n   */\n  labelColor: {\n    get: function () {\n      return this._label.fillColor;\n    },\n    set: function (value) {\n      this._label.fillColor = value;\n      this._polyline.show = this._label.show && value.alpha > 0.0;\n    },\n  },\n\n  /**\n   * Gets or sets the label outline color of this feature.\n   * <p>\n   * The outline color will be applied to the label if <code>labelText</code> is defined.\n   * </p>\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {Color}\n   */\n  labelOutlineColor: {\n    get: function () {\n      return this._label.outlineColor;\n    },\n    set: function (value) {\n      this._label.outlineColor = value;\n    },\n  },\n\n  /**\n   * Gets or sets the outline width in pixels of this feature.\n   * <p>\n   * The outline width will be applied to the point if <code>labelText</code> is defined.\n   * </p>\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {number}\n   */\n  labelOutlineWidth: {\n    get: function () {\n      return this._label.outlineWidth;\n    },\n    set: function (value) {\n      this._label.outlineWidth = value;\n    },\n  },\n\n  /**\n   * Gets or sets the font of this feature.\n   * <p>\n   * Only applied when the <code>labelText</code> is defined.\n   * </p>\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {string}\n   */\n  font: {\n    get: function () {\n      return this._label.font;\n    },\n    set: function (value) {\n      this._label.font = value;\n    },\n  },\n\n  /**\n   * Gets or sets the fill and outline style of this feature.\n   * <p>\n   * Only applied when <code>labelText</code> is defined.\n   * </p>\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {LabelStyle}\n   */\n  labelStyle: {\n    get: function () {\n      return this._label.style;\n    },\n    set: function (value) {\n      this._label.style = value;\n    },\n  },\n\n  /**\n   * Gets or sets the text for this feature.\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {string}\n   */\n  labelText: {\n    get: function () {\n      return this._label.text;\n    },\n    set: function (value) {\n      if (!defined(value)) {\n        value = \"\";\n      }\n      this._label.text = value;\n    },\n  },\n\n  /**\n   * Gets or sets the background color of the text for this feature.\n   * <p>\n   * Only applied when <code>labelText</code> is defined.\n   * </p>\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {Color}\n   */\n  backgroundColor: {\n    get: function () {\n      return this._label.backgroundColor;\n    },\n    set: function (value) {\n      this._label.backgroundColor = value;\n    },\n  },\n\n  /**\n   * Gets or sets the background padding of the text for this feature.\n   * <p>\n   * Only applied when <code>labelText</code> is defined.\n   * </p>\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {Cartesian2}\n   */\n  backgroundPadding: {\n    get: function () {\n      return this._label.backgroundPadding;\n    },\n    set: function (value) {\n      this._label.backgroundPadding = value;\n    },\n  },\n\n  /**\n   * Gets or sets whether to display the background of the text for this feature.\n   * <p>\n   * Only applied when <code>labelText</code> is defined.\n   * </p>\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {boolean}\n   */\n  backgroundEnabled: {\n    get: function () {\n      return this._label.showBackground;\n    },\n    set: function (value) {\n      this._label.showBackground = value;\n    },\n  },\n\n  /**\n   * Gets or sets the near and far scaling properties for this feature.\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {NearFarScalar}\n   */\n  scaleByDistance: {\n    get: function () {\n      return this._label.scaleByDistance;\n    },\n    set: function (value) {\n      this._label.scaleByDistance = value;\n      this._billboard.scaleByDistance = value;\n    },\n  },\n\n  /**\n   * Gets or sets the near and far translucency properties for this feature.\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {NearFarScalar}\n   */\n  translucencyByDistance: {\n    get: function () {\n      return this._label.translucencyByDistance;\n    },\n    set: function (value) {\n      this._label.translucencyByDistance = value;\n      this._billboard.translucencyByDistance = value;\n    },\n  },\n\n  /**\n   * Gets or sets the condition specifying at what distance from the camera that this feature will be displayed.\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {DistanceDisplayCondition}\n   */\n  distanceDisplayCondition: {\n    get: function () {\n      return this._label.distanceDisplayCondition;\n    },\n    set: function (value) {\n      this._label.distanceDisplayCondition = value;\n      this._polyline.distanceDisplayCondition = value;\n      this._billboard.distanceDisplayCondition = value;\n    },\n  },\n\n  /**\n   * Gets or sets the height offset in meters of this feature.\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {number}\n   */\n  heightOffset: {\n    get: function () {\n      return this._heightOffset;\n    },\n    set: function (value) {\n      const offset = defaultValue(this._heightOffset, 0.0);\n\n      const ellipsoid = this._content.tileset.ellipsoid;\n      const cart = ellipsoid.cartesianToCartographic(\n        this._billboard.position,\n        scratchCartographic\n      );\n      cart.height = cart.height - offset + value;\n      const newPosition = ellipsoid.cartographicToCartesian(cart);\n\n      this._billboard.position = newPosition;\n      this._label.position = this._billboard.position;\n      this._polyline.positions = [this._polyline.positions[0], newPosition];\n\n      this._heightOffset = value;\n    },\n  },\n\n  /**\n   * Gets or sets whether the anchor line is displayed.\n   * <p>\n   * Only applied when <code>heightOffset</code> is defined.\n   * </p>\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {boolean}\n   */\n  anchorLineEnabled: {\n    get: function () {\n      return this._polyline.show;\n    },\n    set: function (value) {\n      this._polyline.show = value;\n    },\n  },\n\n  /**\n   * Gets or sets the color for the anchor line.\n   * <p>\n   * Only applied when <code>heightOffset</code> is defined.\n   * </p>\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {Color}\n   */\n  anchorLineColor: {\n    get: function () {\n      return this._polyline.material.uniforms.color;\n    },\n    set: function (value) {\n      this._polyline.material.uniforms.color = Color.clone(\n        value,\n        this._polyline.material.uniforms.color\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the image of this feature.\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {string}\n   */\n  image: {\n    get: function () {\n      return this._billboardImage;\n    },\n    set: function (value) {\n      const imageChanged = this._billboardImage !== value;\n      this._billboardImage = value;\n      if (imageChanged) {\n        setBillboardImage(this);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the distance where depth testing will be disabled.\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {number}\n   */\n  disableDepthTestDistance: {\n    get: function () {\n      return this._label.disableDepthTestDistance;\n    },\n    set: function (value) {\n      this._label.disableDepthTestDistance = value;\n      this._billboard.disableDepthTestDistance = value;\n    },\n  },\n\n  /**\n   * Gets or sets the horizontal origin of this point, which determines if the point is\n   * to the left, center, or right of its anchor position.\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {HorizontalOrigin}\n   */\n  horizontalOrigin: {\n    get: function () {\n      return this._billboard.horizontalOrigin;\n    },\n    set: function (value) {\n      this._billboard.horizontalOrigin = value;\n    },\n  },\n\n  /**\n   * Gets or sets the vertical origin of this point, which determines if the point is\n   * to the bottom, center, or top of its anchor position.\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {VerticalOrigin}\n   */\n  verticalOrigin: {\n    get: function () {\n      return this._billboard.verticalOrigin;\n    },\n    set: function (value) {\n      this._billboard.verticalOrigin = value;\n    },\n  },\n\n  /**\n   * Gets or sets the horizontal origin of this point's text, which determines if the point's text is\n   * to the left, center, or right of its anchor position.\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {HorizontalOrigin}\n   */\n  labelHorizontalOrigin: {\n    get: function () {\n      return this._label.horizontalOrigin;\n    },\n    set: function (value) {\n      this._label.horizontalOrigin = value;\n    },\n  },\n\n  /**\n   * Get or sets the vertical origin of this point's text, which determines if the point's text is\n   * to the bottom, center, top, or baseline of it's anchor point.\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {VerticalOrigin}\n   */\n  labelVerticalOrigin: {\n    get: function () {\n      return this._label.verticalOrigin;\n    },\n    set: function (value) {\n      this._label.verticalOrigin = value;\n    },\n  },\n\n  /**\n   * Gets the content of the tile containing the feature.\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {Cesium3DTileContent}\n   *\n   * @readonly\n   * @private\n   */\n  content: {\n    get: function () {\n      return this._content;\n    },\n  },\n\n  /**\n   * Gets the tileset containing the feature.\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {Cesium3DTileset}\n   *\n   * @readonly\n   */\n  tileset: {\n    get: function () {\n      return this._content.tileset;\n    },\n  },\n\n  /**\n   * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns\n   * the tileset containing the feature.\n   *\n   * @memberof Cesium3DTilePointFeature.prototype\n   *\n   * @type {Cesium3DTileset}\n   *\n   * @readonly\n   */\n  primitive: {\n    get: function () {\n      return this._content.tileset;\n    },\n  },\n\n  /**\n   * @private\n   */\n  pickIds: {\n    get: function () {\n      const ids = this._pickIds;\n      ids[0] = this._billboard.pickId;\n      ids[1] = this._label.pickId;\n      ids[2] = this._polyline.pickId;\n      return ids;\n    },\n  },\n});\n\nCesium3DTilePointFeature.defaultColor = Color.WHITE;\nCesium3DTilePointFeature.defaultPointOutlineColor = Color.BLACK;\nCesium3DTilePointFeature.defaultPointOutlineWidth = 0.0;\nCesium3DTilePointFeature.defaultPointSize = 8.0;\n\nfunction setBillboardImage(feature) {\n  const b = feature._billboard;\n  if (defined(feature._billboardImage) && feature._billboardImage !== b.image) {\n    b.image = feature._billboardImage;\n    return;\n  }\n\n  if (defined(feature._billboardImage)) {\n    return;\n  }\n\n  const newColor = defaultValue(\n    feature._color,\n    Cesium3DTilePointFeature.defaultColor\n  );\n  const newOutlineColor = defaultValue(\n    feature._pointOutlineColor,\n    Cesium3DTilePointFeature.defaultPointOutlineColor\n  );\n  const newOutlineWidth = defaultValue(\n    feature._pointOutlineWidth,\n    Cesium3DTilePointFeature.defaultPointOutlineWidth\n  );\n  const newPointSize = defaultValue(\n    feature._pointSize,\n    Cesium3DTilePointFeature.defaultPointSize\n  );\n\n  const currentColor = feature._billboardColor;\n  const currentOutlineColor = feature._billboardOutlineColor;\n  const currentOutlineWidth = feature._billboardOutlineWidth;\n  const currentPointSize = feature._billboardSize;\n\n  if (\n    Color.equals(newColor, currentColor) &&\n    Color.equals(newOutlineColor, currentOutlineColor) &&\n    newOutlineWidth === currentOutlineWidth &&\n    newPointSize === currentPointSize\n  ) {\n    return;\n  }\n\n  feature._billboardColor = Color.clone(newColor, feature._billboardColor);\n  feature._billboardOutlineColor = Color.clone(\n    newOutlineColor,\n    feature._billboardOutlineColor\n  );\n  feature._billboardOutlineWidth = newOutlineWidth;\n  feature._billboardSize = newPointSize;\n\n  const centerAlpha = newColor.alpha;\n  const cssColor = newColor.toCssColorString();\n  const cssOutlineColor = newOutlineColor.toCssColorString();\n  const textureId = JSON.stringify([\n    cssColor,\n    newPointSize,\n    cssOutlineColor,\n    newOutlineWidth,\n  ]);\n\n  b.setImage(\n    textureId,\n    createBillboardPointCallback(\n      centerAlpha,\n      cssColor,\n      cssOutlineColor,\n      newOutlineWidth,\n      newPointSize\n    )\n  );\n}\n\n/**\n * Returns whether the feature contains this property. This includes properties from this feature's\n * class and inherited classes when using a batch table hierarchy.\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy}\n *\n * @param {string} name The case-sensitive name of the property.\n * @returns {boolean} Whether the feature contains this property.\n */\nCesium3DTilePointFeature.prototype.hasProperty = function (name) {\n  return this._content.batchTable.hasProperty(this._batchId, name);\n};\n\n/**\n * Returns an array of property IDs for the feature. This includes properties from this feature's\n * class and inherited classes when using a batch table hierarchy.\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy}\n *\n * @param {string[]} [results] An array into which to store the results.\n * @returns {string[]} The IDs of the feature's properties.\n */\nCesium3DTilePointFeature.prototype.getPropertyIds = function (results) {\n  return this._content.batchTable.getPropertyIds(this._batchId, results);\n};\n\n/**\n * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's\n * class and inherited classes when using a batch table hierarchy.\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy}\n *\n * @param {string} name The case-sensitive name of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n *\n * @example\n * // Display all the properties for a feature in the console log.\n * const propertyIds = feature.getPropertyIds();\n * const length = propertyIds.length;\n * for (let i = 0; i < length; ++i) {\n *     const propertyId = propertyIds[i];\n *     console.log(`{propertyId} : ${feature.getProperty(propertyId)}`);\n * }\n */\nCesium3DTilePointFeature.prototype.getProperty = function (name) {\n  return this._content.batchTable.getProperty(this._batchId, name);\n};\n\n/**\n * Returns a copy of the value of the feature's property with the given name.\n * If the feature is contained within a tileset that has metadata (3D Tiles 1.1)\n * or uses the <code>3DTILES_metadata</code> extension, tileset, group and tile metadata is\n * inherited.\n * <p>\n * To resolve name conflicts, this method resolves names from most specific to\n * least specific by metadata granularity in the order: feature, tile, group,\n * tileset. Within each granularity, semantics are resolved first, then other\n * properties.\n * </p>\n * @param {string} name The case-sensitive name of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nCesium3DTilePointFeature.prototype.getPropertyInherited = function (name) {\n  return Cesium3DTileFeature.getPropertyInherited(\n    this._content,\n    this._batchId,\n    name\n  );\n};\n\n/**\n * Sets the value of the feature's property with the given name.\n * <p>\n * If a property with the given name doesn't exist, it is created.\n * </p>\n *\n * @param {string} name The case-sensitive name of the property.\n * @param {*} value The value of the property that will be copied.\n *\n * @exception {DeveloperError} Inherited batch table hierarchy property is read only.\n *\n * @example\n * const height = feature.getProperty('Height'); // e.g., the height of a building\n *\n * @example\n * const name = 'clicked';\n * if (feature.getProperty(name)) {\n *     console.log('already clicked');\n * } else {\n *     feature.setProperty(name, true);\n *     console.log('first click');\n * }\n */\nCesium3DTilePointFeature.prototype.setProperty = function (name, value) {\n  this._content.batchTable.setProperty(this._batchId, name, value);\n\n  // PERFORMANCE_IDEA: Probably overkill, but maybe only mark the tile dirty if the\n  // property is in one of the style's expressions or - if it can be done quickly -\n  // if the new property value changed the result of an expression.\n  this._content.featurePropertiesDirty = true;\n};\n\n/**\n * Returns whether the feature's class name equals <code>className</code>. Unlike {@link Cesium3DTilePointFeature#isClass}\n * this function only checks the feature's exact class and not inherited classes.\n * <p>\n * This function returns <code>false</code> if no batch table hierarchy is present.\n * </p>\n *\n * @param {string} className The name to check against.\n * @returns {boolean} Whether the feature's class name equals <code>className</code>\n *\n * @private\n */\nCesium3DTilePointFeature.prototype.isExactClass = function (className) {\n  return this._content.batchTable.isExactClass(this._batchId, className);\n};\n\n/**\n * Returns whether the feature's class or any inherited classes are named <code>className</code>.\n * <p>\n * This function returns <code>false</code> if no batch table hierarchy is present.\n * </p>\n *\n * @param {string} className The name to check against.\n * @returns {boolean} Whether the feature's class or inherited classes are named <code>className</code>\n *\n * @private\n */\nCesium3DTilePointFeature.prototype.isClass = function (className) {\n  return this._content.batchTable.isClass(this._batchId, className);\n};\n\n/**\n * Returns the feature's class name.\n * <p>\n * This function returns <code>undefined</code> if no batch table hierarchy is present.\n * </p>\n *\n * @returns {string} The feature's class name.\n *\n * @private\n */\nCesium3DTilePointFeature.prototype.getExactClassName = function () {\n  return this._content.batchTable.getExactClassName(this._batchId);\n};\nexport default Cesium3DTilePointFeature;\n", "import Color from \"./Color.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\nfunction measureText(context2D, textString, font, stroke, fill) {\n  const metrics = context2D.measureText(textString);\n  const isSpace = !/\\S/.test(textString);\n\n  if (!isSpace) {\n    const fontSize = document.defaultView\n      .getComputedStyle(context2D.canvas)\n      .getPropertyValue(\"font-size\")\n      .replace(\"px\", \"\");\n    const canvas = document.createElement(\"canvas\");\n    const padding = 100;\n    const width = (metrics.width + padding) | 0;\n    const height = 3 * fontSize;\n    const baseline = height / 2;\n    canvas.width = width;\n    canvas.height = height;\n\n    const ctx = canvas.getContext(\"2d\");\n    ctx.font = font;\n    ctx.fillStyle = \"white\";\n    ctx.fillRect(0, 0, canvas.width + 1, canvas.height + 1);\n\n    if (stroke) {\n      ctx.strokeStyle = \"black\";\n      ctx.lineWidth = context2D.lineWidth;\n      ctx.strokeText(textString, padding / 2, baseline);\n    }\n\n    if (fill) {\n      ctx.fillStyle = \"black\";\n      ctx.fillText(textString, padding / 2, baseline);\n    }\n\n    // Context image data has width * height * 4 elements, because\n    // each pixel's R, G, B and A are consecutive values in the array.\n    const pixelData = ctx.getImageData(0, 0, width, height).data;\n    const length = pixelData.length;\n    const width4 = width * 4;\n    let i, j;\n\n    let ascent, descent;\n    // Find the number of rows (from the top) until the first non-white pixel\n    for (i = 0; i < length; ++i) {\n      if (pixelData[i] !== 255) {\n        ascent = (i / width4) | 0;\n        break;\n      }\n    }\n\n    // Find the number of rows (from the bottom) until the first non-white pixel\n    for (i = length - 1; i >= 0; --i) {\n      if (pixelData[i] !== 255) {\n        descent = (i / width4) | 0;\n        break;\n      }\n    }\n\n    let minx = -1;\n    // For each column, for each row, check for first non-white pixel\n    for (i = 0; i < width && minx === -1; ++i) {\n      for (j = 0; j < height; ++j) {\n        const pixelIndex = i * 4 + j * width4;\n        if (\n          pixelData[pixelIndex] !== 255 ||\n          pixelData[pixelIndex + 1] !== 255 ||\n          pixelData[pixelIndex + 2] !== 255 ||\n          pixelData[pixelIndex + 3] !== 255\n        ) {\n          minx = i;\n          break;\n        }\n      }\n    }\n\n    return {\n      width: metrics.width,\n      height: descent - ascent,\n      ascent: baseline - ascent,\n      descent: descent - baseline,\n      minx: minx - padding / 2,\n    };\n  }\n\n  return {\n    width: metrics.width,\n    height: 0,\n    ascent: 0,\n    descent: 0,\n    minx: 0,\n  };\n}\n\nlet imageSmoothingEnabledName;\n\n/**\n * Writes the given text into a new canvas.  The canvas will be sized to fit the text.\n * If text is blank, returns undefined.\n *\n * @param {string} text The text to write.\n * @param {object} [options] Object with the following properties:\n * @param {string} [options.font='10px sans-serif'] The CSS font to use.\n * @param {string} [options.textBaseline='bottom'] The baseline of the text.\n * @param {boolean} [options.fill=true] Whether to fill the text.\n * @param {boolean} [options.stroke=false] Whether to stroke the text.\n * @param {Color} [options.fillColor=Color.WHITE] The fill color.\n * @param {Color} [options.strokeColor=Color.BLACK] The stroke color.\n * @param {number} [options.strokeWidth=1] The stroke width.\n * @param {Color} [options.backgroundColor=Color.TRANSPARENT] The background color of the canvas.\n * @param {number} [options.padding=0] The pixel size of the padding to add around the text.\n * @returns {HTMLCanvasElement|undefined} A new canvas with the given text drawn into it.  The dimensions object\n *                   from measureText will also be added to the returned canvas. If text is\n *                   blank, returns undefined.\n * @function writeTextToCanvas\n */\nfunction writeTextToCanvas(text, options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(text)) {\n    throw new DeveloperError(\"text is required.\");\n  }\n  //>>includeEnd('debug');\n  if (text === \"\") {\n    return undefined;\n  }\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const font = defaultValue(options.font, \"10px sans-serif\");\n  const stroke = defaultValue(options.stroke, false);\n  const fill = defaultValue(options.fill, true);\n  const strokeWidth = defaultValue(options.strokeWidth, 1);\n  const backgroundColor = defaultValue(\n    options.backgroundColor,\n    Color.TRANSPARENT\n  );\n  const padding = defaultValue(options.padding, 0);\n  const doublePadding = padding * 2.0;\n\n  const canvas = document.createElement(\"canvas\");\n  canvas.width = 1;\n  canvas.height = 1;\n  canvas.style.font = font;\n  // Since multiple read-back operations are expected for labels, use the willReadFrequently option \u2013 See https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently\n  const context2D = canvas.getContext(\"2d\", { willReadFrequently: true });\n\n  if (!defined(imageSmoothingEnabledName)) {\n    if (defined(context2D.imageSmoothingEnabled)) {\n      imageSmoothingEnabledName = \"imageSmoothingEnabled\";\n    } else if (defined(context2D.mozImageSmoothingEnabled)) {\n      imageSmoothingEnabledName = \"mozImageSmoothingEnabled\";\n    } else if (defined(context2D.webkitImageSmoothingEnabled)) {\n      imageSmoothingEnabledName = \"webkitImageSmoothingEnabled\";\n    } else if (defined(context2D.msImageSmoothingEnabled)) {\n      imageSmoothingEnabledName = \"msImageSmoothingEnabled\";\n    }\n  }\n\n  context2D.font = font;\n  context2D.lineJoin = \"round\";\n  context2D.lineWidth = strokeWidth;\n  context2D[imageSmoothingEnabledName] = false;\n\n  // in order for measureText to calculate style, the canvas has to be\n  // (temporarily) added to the DOM.\n  canvas.style.visibility = \"hidden\";\n  document.body.appendChild(canvas);\n\n  const dimensions = measureText(context2D, text, font, stroke, fill);\n  // Set canvas.dimensions to be accessed in LabelCollection\n  canvas.dimensions = dimensions;\n\n  document.body.removeChild(canvas);\n  canvas.style.visibility = \"\";\n\n  // Some characters, such as the letter j, have a non-zero starting position.\n  // This value is used for kerning later, but we need to take it into account\n  // now in order to draw the text completely on the canvas\n  const x = -dimensions.minx;\n\n  // Expand the width to include the starting position.\n  const width = Math.ceil(dimensions.width) + x + doublePadding;\n\n  // While the height of the letter is correct, we need to adjust\n  // where we start drawing it so that letters like j and y properly dip\n  // below the line.\n\n  const height = dimensions.height + doublePadding;\n  const baseline = height - dimensions.ascent + padding;\n  const y = height - baseline + doublePadding;\n\n  canvas.width = width;\n  canvas.height = height;\n\n  // Properties must be explicitly set again after changing width and height\n  context2D.font = font;\n  context2D.lineJoin = \"round\";\n  context2D.lineWidth = strokeWidth;\n  context2D[imageSmoothingEnabledName] = false;\n\n  // Draw background\n  if (backgroundColor !== Color.TRANSPARENT) {\n    context2D.fillStyle = backgroundColor.toCssColorString();\n    context2D.fillRect(0, 0, canvas.width, canvas.height);\n  }\n\n  if (stroke) {\n    const strokeColor = defaultValue(options.strokeColor, Color.BLACK);\n    context2D.strokeStyle = strokeColor.toCssColorString();\n    context2D.strokeText(text, x + padding, y);\n  }\n\n  if (fill) {\n    const fillColor = defaultValue(options.fillColor, Color.WHITE);\n    context2D.fillStyle = fillColor.toCssColorString();\n    context2D.fillText(text, x + padding, y);\n  }\n\n  return canvas;\n}\nexport default writeTextToCanvas;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport writeTextToCanvas from \"../Core/writeTextToCanvas.js\";\nimport bitmapSDF from \"bitmap-sdf\";\nimport BillboardCollection from \"./BillboardCollection.js\";\nimport BlendOption from \"./BlendOption.js\";\nimport HeightReference from \"./HeightReference.js\";\nimport HorizontalOrigin from \"./HorizontalOrigin.js\";\nimport Label from \"./Label.js\";\nimport LabelStyle from \"./LabelStyle.js\";\nimport SDFSettings from \"./SDFSettings.js\";\nimport TextureAtlas from \"./TextureAtlas.js\";\nimport VerticalOrigin from \"./VerticalOrigin.js\";\nimport GraphemeSplitter from \"grapheme-splitter\";\n\n// A glyph represents a single character in a particular label.  It may or may\n// not have a billboard, depending on whether the texture info has an index into\n// the the label collection's texture atlas.  Invisible characters have no texture, and\n// no billboard.  However, it always has a valid dimensions object.\nfunction Glyph() {\n  this.textureInfo = undefined;\n  this.dimensions = undefined;\n  this.billboard = undefined;\n}\n\n// GlyphTextureInfo represents a single character, drawn in a particular style,\n// shared and reference counted across all labels.  It may or may not have an\n// index into the label collection's texture atlas, depending on whether the character\n// has both width and height, but it always has a valid dimensions object.\nfunction GlyphTextureInfo(labelCollection, index, dimensions) {\n  this.labelCollection = labelCollection;\n  this.index = index;\n  this.dimensions = dimensions;\n}\n\n// Traditionally, leading is %20 of the font size.\nconst defaultLineSpacingPercent = 1.2;\nconst whitePixelCanvasId = \"ID_WHITE_PIXEL\";\nconst whitePixelSize = new Cartesian2(4, 4);\nconst whitePixelBoundingRegion = new BoundingRectangle(1, 1, 1, 1);\n\nfunction addWhitePixelCanvas(textureAtlas) {\n  const canvas = document.createElement(\"canvas\");\n  canvas.width = whitePixelSize.x;\n  canvas.height = whitePixelSize.y;\n\n  const context2D = canvas.getContext(\"2d\");\n  context2D.fillStyle = \"#fff\";\n  context2D.fillRect(0, 0, canvas.width, canvas.height);\n\n  // Canvas operations take a frame to draw. Use the asynchronous add function which resolves a promise and allows the draw to complete,\n  // but there's no need to wait on the promise before operation can continue\n  return textureAtlas.addImage(whitePixelCanvasId, canvas);\n}\n\n// reusable object for calling writeTextToCanvas\nconst writeTextToCanvasParameters = {};\nfunction createGlyphCanvas(\n  character,\n  font,\n  fillColor,\n  outlineColor,\n  outlineWidth,\n  style,\n  verticalOrigin\n) {\n  writeTextToCanvasParameters.font = font;\n  writeTextToCanvasParameters.fillColor = fillColor;\n  writeTextToCanvasParameters.strokeColor = outlineColor;\n  writeTextToCanvasParameters.strokeWidth = outlineWidth;\n  // Setting the padding to something bigger is necessary to get enough space for the outlining.\n  writeTextToCanvasParameters.padding = SDFSettings.PADDING;\n\n  if (verticalOrigin === VerticalOrigin.CENTER) {\n    writeTextToCanvasParameters.textBaseline = \"middle\";\n  } else if (verticalOrigin === VerticalOrigin.TOP) {\n    writeTextToCanvasParameters.textBaseline = \"top\";\n  } else {\n    // VerticalOrigin.BOTTOM and VerticalOrigin.BASELINE\n    writeTextToCanvasParameters.textBaseline = \"bottom\";\n  }\n\n  writeTextToCanvasParameters.fill =\n    style === LabelStyle.FILL || style === LabelStyle.FILL_AND_OUTLINE;\n  writeTextToCanvasParameters.stroke =\n    style === LabelStyle.OUTLINE || style === LabelStyle.FILL_AND_OUTLINE;\n  writeTextToCanvasParameters.backgroundColor = Color.BLACK;\n\n  return writeTextToCanvas(character, writeTextToCanvasParameters);\n}\n\nfunction unbindGlyph(labelCollection, glyph) {\n  glyph.textureInfo = undefined;\n  glyph.dimensions = undefined;\n\n  const billboard = glyph.billboard;\n  if (defined(billboard)) {\n    billboard.show = false;\n    billboard.image = undefined;\n    if (defined(billboard._removeCallbackFunc)) {\n      billboard._removeCallbackFunc();\n      billboard._removeCallbackFunc = undefined;\n    }\n    labelCollection._spareBillboards.push(billboard);\n    glyph.billboard = undefined;\n  }\n}\n\nfunction addGlyphToTextureAtlas(textureAtlas, id, canvas, glyphTextureInfo) {\n  glyphTextureInfo.index = textureAtlas.addImageSync(id, canvas);\n}\n\nconst splitter = new GraphemeSplitter();\n\nfunction rebindAllGlyphs(labelCollection, label) {\n  const text = label._renderedText;\n  const graphemes = splitter.splitGraphemes(text);\n  const textLength = graphemes.length;\n  const glyphs = label._glyphs;\n  const glyphsLength = glyphs.length;\n\n  let glyph;\n  let glyphIndex;\n  let textIndex;\n\n  // Compute a font size scale relative to the sdf font generated size.\n  label._relativeSize = label._fontSize / SDFSettings.FONT_SIZE;\n\n  // if we have more glyphs than needed, unbind the extras.\n  if (textLength < glyphsLength) {\n    for (glyphIndex = textLength; glyphIndex < glyphsLength; ++glyphIndex) {\n      unbindGlyph(labelCollection, glyphs[glyphIndex]);\n    }\n  }\n\n  // presize glyphs to match the new text length\n  glyphs.length = textLength;\n\n  const showBackground =\n    label.show && label._showBackground && text.split(\"\\n\").join(\"\").length > 0;\n  let backgroundBillboard = label._backgroundBillboard;\n  const backgroundBillboardCollection =\n    labelCollection._backgroundBillboardCollection;\n  if (!showBackground) {\n    if (defined(backgroundBillboard)) {\n      backgroundBillboardCollection.remove(backgroundBillboard);\n      label._backgroundBillboard = backgroundBillboard = undefined;\n    }\n  } else {\n    if (!defined(backgroundBillboard)) {\n      backgroundBillboard = backgroundBillboardCollection.add({\n        collection: labelCollection,\n        image: whitePixelCanvasId,\n        imageSubRegion: whitePixelBoundingRegion,\n      });\n      label._backgroundBillboard = backgroundBillboard;\n    }\n\n    backgroundBillboard.color = label._backgroundColor;\n    backgroundBillboard.show = label._show;\n    backgroundBillboard.position = label._position;\n    backgroundBillboard.eyeOffset = label._eyeOffset;\n    backgroundBillboard.pixelOffset = label._pixelOffset;\n    backgroundBillboard.horizontalOrigin = HorizontalOrigin.LEFT;\n    backgroundBillboard.verticalOrigin = label._verticalOrigin;\n    backgroundBillboard.heightReference = label._heightReference;\n    backgroundBillboard.scale = label.totalScale;\n    backgroundBillboard.pickPrimitive = label;\n    backgroundBillboard.id = label._id;\n    backgroundBillboard.translucencyByDistance = label._translucencyByDistance;\n    backgroundBillboard.pixelOffsetScaleByDistance =\n      label._pixelOffsetScaleByDistance;\n    backgroundBillboard.scaleByDistance = label._scaleByDistance;\n    backgroundBillboard.distanceDisplayCondition =\n      label._distanceDisplayCondition;\n    backgroundBillboard.disableDepthTestDistance =\n      label._disableDepthTestDistance;\n    backgroundBillboard.clusterShow = label.clusterShow;\n  }\n\n  const glyphTextureCache = labelCollection._glyphTextureCache;\n\n  // walk the text looking for new characters (creating new glyphs for each)\n  // or changed characters (rebinding existing glyphs)\n  for (textIndex = 0; textIndex < textLength; ++textIndex) {\n    const character = graphemes[textIndex];\n    const verticalOrigin = label._verticalOrigin;\n\n    const id = JSON.stringify([\n      character,\n      label._fontFamily,\n      label._fontStyle,\n      label._fontWeight,\n      +verticalOrigin,\n    ]);\n\n    let glyphTextureInfo = glyphTextureCache[id];\n    if (!defined(glyphTextureInfo)) {\n      const glyphFont = `${label._fontStyle} ${label._fontWeight} ${SDFSettings.FONT_SIZE}px ${label._fontFamily}`;\n\n      const canvas = createGlyphCanvas(\n        character,\n        glyphFont,\n        Color.WHITE,\n        Color.WHITE,\n        0.0,\n        LabelStyle.FILL,\n        verticalOrigin\n      );\n\n      glyphTextureInfo = new GlyphTextureInfo(\n        labelCollection,\n        -1,\n        canvas.dimensions\n      );\n      glyphTextureCache[id] = glyphTextureInfo;\n\n      if (canvas.width > 0 && canvas.height > 0) {\n        const sdfValues = bitmapSDF(canvas, {\n          cutoff: SDFSettings.CUTOFF,\n          radius: SDFSettings.RADIUS,\n        });\n\n        // Context is originally created in writeTextToCanvas()\n        const ctx = canvas.getContext(\"2d\");\n        const canvasWidth = canvas.width;\n        const canvasHeight = canvas.height;\n        const imgData = ctx.getImageData(0, 0, canvasWidth, canvasHeight);\n        for (let i = 0; i < canvasWidth; i++) {\n          for (let j = 0; j < canvasHeight; j++) {\n            const baseIndex = j * canvasWidth + i;\n            const alpha = sdfValues[baseIndex] * 255;\n            const imageIndex = baseIndex * 4;\n            imgData.data[imageIndex + 0] = alpha;\n            imgData.data[imageIndex + 1] = alpha;\n            imgData.data[imageIndex + 2] = alpha;\n            imgData.data[imageIndex + 3] = alpha;\n          }\n        }\n        ctx.putImageData(imgData, 0, 0);\n        if (character !== \" \") {\n          addGlyphToTextureAtlas(\n            labelCollection._textureAtlas,\n            id,\n            canvas,\n            glyphTextureInfo\n          );\n        }\n      }\n    }\n\n    glyph = glyphs[textIndex];\n\n    if (defined(glyph)) {\n      // clean up leftover information from the previous glyph\n      if (glyphTextureInfo.index === -1) {\n        // no texture, and therefore no billboard, for this glyph.\n        // so, completely unbind glyph.\n        unbindGlyph(labelCollection, glyph);\n      } else if (defined(glyph.textureInfo)) {\n        // we have a texture and billboard.  If we had one before, release\n        // our reference to that texture info, but reuse the billboard.\n        glyph.textureInfo = undefined;\n      }\n    } else {\n      // create a glyph object\n      glyph = new Glyph();\n      glyphs[textIndex] = glyph;\n    }\n\n    glyph.textureInfo = glyphTextureInfo;\n    glyph.dimensions = glyphTextureInfo.dimensions;\n\n    // if we have a texture, configure the existing billboard, or obtain one\n    if (glyphTextureInfo.index !== -1) {\n      let billboard = glyph.billboard;\n      const spareBillboards = labelCollection._spareBillboards;\n      if (!defined(billboard)) {\n        if (spareBillboards.length > 0) {\n          billboard = spareBillboards.pop();\n        } else {\n          billboard = labelCollection._billboardCollection.add({\n            collection: labelCollection,\n          });\n          billboard._labelDimensions = new Cartesian2();\n          billboard._labelTranslate = new Cartesian2();\n        }\n        glyph.billboard = billboard;\n      }\n\n      billboard.show = label._show;\n      billboard.position = label._position;\n      billboard.eyeOffset = label._eyeOffset;\n      billboard.pixelOffset = label._pixelOffset;\n      billboard.horizontalOrigin = HorizontalOrigin.LEFT;\n      billboard.verticalOrigin = label._verticalOrigin;\n      billboard.heightReference = label._heightReference;\n      billboard.scale = label.totalScale;\n      billboard.pickPrimitive = label;\n      billboard.id = label._id;\n      billboard.image = id;\n      billboard.translucencyByDistance = label._translucencyByDistance;\n      billboard.pixelOffsetScaleByDistance = label._pixelOffsetScaleByDistance;\n      billboard.scaleByDistance = label._scaleByDistance;\n      billboard.distanceDisplayCondition = label._distanceDisplayCondition;\n      billboard.disableDepthTestDistance = label._disableDepthTestDistance;\n      billboard._batchIndex = label._batchIndex;\n      billboard.outlineColor = label.outlineColor;\n      if (label.style === LabelStyle.FILL_AND_OUTLINE) {\n        billboard.color = label._fillColor;\n        billboard.outlineWidth = label.outlineWidth;\n      } else if (label.style === LabelStyle.FILL) {\n        billboard.color = label._fillColor;\n        billboard.outlineWidth = 0.0;\n      } else if (label.style === LabelStyle.OUTLINE) {\n        billboard.color = Color.TRANSPARENT;\n        billboard.outlineWidth = label.outlineWidth;\n      }\n    }\n  }\n\n  // changing glyphs will cause the position of the\n  // glyphs to change, since different characters have different widths\n  label._repositionAllGlyphs = true;\n}\n\nfunction calculateWidthOffset(lineWidth, horizontalOrigin, backgroundPadding) {\n  if (horizontalOrigin === HorizontalOrigin.CENTER) {\n    return -lineWidth / 2;\n  } else if (horizontalOrigin === HorizontalOrigin.RIGHT) {\n    return -(lineWidth + backgroundPadding.x);\n  }\n  return backgroundPadding.x;\n}\n\n// reusable Cartesian2 instances\nconst glyphPixelOffset = new Cartesian2();\nconst scratchBackgroundPadding = new Cartesian2();\n\nfunction repositionAllGlyphs(label) {\n  const glyphs = label._glyphs;\n  const text = label._renderedText;\n  let glyph;\n  let dimensions;\n  let lastLineWidth = 0;\n  let maxLineWidth = 0;\n  const lineWidths = [];\n  let maxGlyphDescent = Number.NEGATIVE_INFINITY;\n  let maxGlyphY = 0;\n  let numberOfLines = 1;\n  let glyphIndex;\n  const glyphLength = glyphs.length;\n\n  const backgroundBillboard = label._backgroundBillboard;\n  const backgroundPadding = Cartesian2.clone(\n    defined(backgroundBillboard) ? label._backgroundPadding : Cartesian2.ZERO,\n    scratchBackgroundPadding\n  );\n\n  // We need to scale the background padding, which is specified in pixels by the inverse of the relative size so it is scaled properly.\n  backgroundPadding.x /= label._relativeSize;\n  backgroundPadding.y /= label._relativeSize;\n\n  for (glyphIndex = 0; glyphIndex < glyphLength; ++glyphIndex) {\n    if (text.charAt(glyphIndex) === \"\\n\") {\n      lineWidths.push(lastLineWidth);\n      ++numberOfLines;\n      lastLineWidth = 0;\n    } else {\n      glyph = glyphs[glyphIndex];\n      dimensions = glyph.dimensions;\n      maxGlyphY = Math.max(maxGlyphY, dimensions.height - dimensions.descent);\n      maxGlyphDescent = Math.max(maxGlyphDescent, dimensions.descent);\n\n      //Computing the line width must also account for the kerning that occurs between letters.\n      lastLineWidth += dimensions.width - dimensions.minx;\n      if (glyphIndex < glyphLength - 1) {\n        lastLineWidth += glyphs[glyphIndex + 1].dimensions.minx;\n      }\n      maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n    }\n  }\n  lineWidths.push(lastLineWidth);\n  const maxLineHeight = maxGlyphY + maxGlyphDescent;\n\n  const scale = label.totalScale;\n  const horizontalOrigin = label._horizontalOrigin;\n  const verticalOrigin = label._verticalOrigin;\n  let lineIndex = 0;\n  let lineWidth = lineWidths[lineIndex];\n  let widthOffset = calculateWidthOffset(\n    lineWidth,\n    horizontalOrigin,\n    backgroundPadding\n  );\n  const lineSpacing =\n    (defined(label._lineHeight)\n      ? label._lineHeight\n      : defaultLineSpacingPercent * label._fontSize) / label._relativeSize;\n  const otherLinesHeight = lineSpacing * (numberOfLines - 1);\n  let totalLineWidth = maxLineWidth;\n  let totalLineHeight = maxLineHeight + otherLinesHeight;\n\n  if (defined(backgroundBillboard)) {\n    totalLineWidth += backgroundPadding.x * 2;\n    totalLineHeight += backgroundPadding.y * 2;\n    backgroundBillboard._labelHorizontalOrigin = horizontalOrigin;\n  }\n\n  glyphPixelOffset.x = widthOffset * scale;\n  glyphPixelOffset.y = 0;\n\n  let firstCharOfLine = true;\n\n  let lineOffsetY = 0;\n  for (glyphIndex = 0; glyphIndex < glyphLength; ++glyphIndex) {\n    if (text.charAt(glyphIndex) === \"\\n\") {\n      ++lineIndex;\n      lineOffsetY += lineSpacing;\n      lineWidth = lineWidths[lineIndex];\n      widthOffset = calculateWidthOffset(\n        lineWidth,\n        horizontalOrigin,\n        backgroundPadding\n      );\n      glyphPixelOffset.x = widthOffset * scale;\n      firstCharOfLine = true;\n    } else {\n      glyph = glyphs[glyphIndex];\n      dimensions = glyph.dimensions;\n\n      if (verticalOrigin === VerticalOrigin.TOP) {\n        glyphPixelOffset.y =\n          dimensions.height - maxGlyphY - backgroundPadding.y;\n        glyphPixelOffset.y += SDFSettings.PADDING;\n      } else if (verticalOrigin === VerticalOrigin.CENTER) {\n        glyphPixelOffset.y =\n          (otherLinesHeight + dimensions.height - maxGlyphY) / 2;\n      } else if (verticalOrigin === VerticalOrigin.BASELINE) {\n        glyphPixelOffset.y = otherLinesHeight;\n        glyphPixelOffset.y -= SDFSettings.PADDING;\n      } else {\n        // VerticalOrigin.BOTTOM\n        glyphPixelOffset.y =\n          otherLinesHeight + maxGlyphDescent + backgroundPadding.y;\n        glyphPixelOffset.y -= SDFSettings.PADDING;\n      }\n      glyphPixelOffset.y =\n        (glyphPixelOffset.y - dimensions.descent - lineOffsetY) * scale;\n\n      // Handle any offsets for the first character of the line since the bounds might not be right on the bottom left pixel.\n      if (firstCharOfLine) {\n        glyphPixelOffset.x -= SDFSettings.PADDING * scale;\n        firstCharOfLine = false;\n      }\n\n      if (defined(glyph.billboard)) {\n        glyph.billboard._setTranslate(glyphPixelOffset);\n        glyph.billboard._labelDimensions.x = totalLineWidth;\n        glyph.billboard._labelDimensions.y = totalLineHeight;\n        glyph.billboard._labelHorizontalOrigin = horizontalOrigin;\n      }\n\n      //Compute the next x offset taking into account the kerning performed\n      //on both the current letter as well as the next letter to be drawn\n      //as well as any applied scale.\n      if (glyphIndex < glyphLength - 1) {\n        const nextGlyph = glyphs[glyphIndex + 1];\n        glyphPixelOffset.x +=\n          (dimensions.width - dimensions.minx + nextGlyph.dimensions.minx) *\n          scale;\n      }\n    }\n  }\n\n  if (defined(backgroundBillboard) && text.split(\"\\n\").join(\"\").length > 0) {\n    if (horizontalOrigin === HorizontalOrigin.CENTER) {\n      widthOffset = -maxLineWidth / 2 - backgroundPadding.x;\n    } else if (horizontalOrigin === HorizontalOrigin.RIGHT) {\n      widthOffset = -(maxLineWidth + backgroundPadding.x * 2);\n    } else {\n      widthOffset = 0;\n    }\n    glyphPixelOffset.x = widthOffset * scale;\n\n    if (verticalOrigin === VerticalOrigin.TOP) {\n      glyphPixelOffset.y = maxLineHeight - maxGlyphY - maxGlyphDescent;\n    } else if (verticalOrigin === VerticalOrigin.CENTER) {\n      glyphPixelOffset.y = (maxLineHeight - maxGlyphY) / 2 - maxGlyphDescent;\n    } else if (verticalOrigin === VerticalOrigin.BASELINE) {\n      glyphPixelOffset.y = -backgroundPadding.y - maxGlyphDescent;\n    } else {\n      // VerticalOrigin.BOTTOM\n      glyphPixelOffset.y = 0;\n    }\n    glyphPixelOffset.y = glyphPixelOffset.y * scale;\n\n    backgroundBillboard.width = totalLineWidth;\n    backgroundBillboard.height = totalLineHeight;\n    backgroundBillboard._setTranslate(glyphPixelOffset);\n    backgroundBillboard._labelTranslate = Cartesian2.clone(\n      glyphPixelOffset,\n      backgroundBillboard._labelTranslate\n    );\n  }\n\n  if (label.heightReference === HeightReference.CLAMP_TO_GROUND) {\n    for (glyphIndex = 0; glyphIndex < glyphLength; ++glyphIndex) {\n      glyph = glyphs[glyphIndex];\n      const billboard = glyph.billboard;\n      if (defined(billboard)) {\n        billboard._labelTranslate = Cartesian2.clone(\n          glyphPixelOffset,\n          billboard._labelTranslate\n        );\n      }\n    }\n  }\n}\n\nfunction destroyLabel(labelCollection, label) {\n  const glyphs = label._glyphs;\n  for (let i = 0, len = glyphs.length; i < len; ++i) {\n    unbindGlyph(labelCollection, glyphs[i]);\n  }\n  if (defined(label._backgroundBillboard)) {\n    labelCollection._backgroundBillboardCollection.remove(\n      label._backgroundBillboard\n    );\n    label._backgroundBillboard = undefined;\n  }\n  label._labelCollection = undefined;\n\n  if (defined(label._removeCallbackFunc)) {\n    label._removeCallbackFunc();\n  }\n\n  destroyObject(label);\n}\n\n/**\n * A renderable collection of labels.  Labels are viewport-aligned text positioned in the 3D scene.\n * Each label can have a different font, color, scale, etc.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Label.png' width='400' height='300' /><br />\n * Example labels\n * </div>\n * <br /><br />\n * Labels are added and removed from the collection using {@link LabelCollection#add}\n * and {@link LabelCollection#remove}.\n *\n * @alias LabelCollection\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each label from model to world coordinates.\n * @param {boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {Scene} [options.scene] Must be passed in for labels that use the height reference property or will be depth tested against the globe.\n * @param {BlendOption} [options.blendOption=BlendOption.OPAQUE_AND_TRANSLUCENT] The label blending option. The default\n * is used for rendering both opaque and translucent labels. However, if either all of the labels are completely opaque or all are completely translucent,\n * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.\n * @param {boolean} [options.show=true] Determines if the labels in the collection will be shown.\n *\n * @performance For best performance, prefer a few collections, each with many labels, to\n * many collections with only a few labels each.  Avoid having collections where some\n * labels change every frame and others do not; instead, create one or more collections\n * for static labels, and one or more collections for dynamic labels.\n *\n * @see LabelCollection#add\n * @see LabelCollection#remove\n * @see Label\n * @see BillboardCollection\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Labels.html|Cesium Sandcastle Labels Demo}\n *\n * @example\n * // Create a label collection with two labels\n * const labels = scene.primitives.add(new Cesium.LabelCollection());\n * labels.add({\n *   position : new Cesium.Cartesian3(1.0, 2.0, 3.0),\n *   text : 'A label'\n * });\n * labels.add({\n *   position : new Cesium.Cartesian3(4.0, 5.0, 6.0),\n *   text : 'Another label'\n * });\n */\nfunction LabelCollection(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._scene = options.scene;\n  this._batchTable = options.batchTable;\n\n  this._textureAtlas = undefined;\n  this._backgroundTextureAtlas = undefined;\n\n  this._backgroundBillboardCollection = new BillboardCollection({\n    scene: this._scene,\n  });\n  this._backgroundBillboardCollection.destroyTextureAtlas = false;\n\n  this._billboardCollection = new BillboardCollection({\n    scene: this._scene,\n    batchTable: this._batchTable,\n  });\n  this._billboardCollection.destroyTextureAtlas = false;\n  this._billboardCollection._sdf = true;\n\n  this._spareBillboards = [];\n  this._glyphTextureCache = {};\n  this._labels = [];\n  this._labelsToUpdate = [];\n  this._totalGlyphCount = 0;\n\n  this._highlightColor = Color.clone(Color.WHITE); // Only used by Vector3DTilePoints\n\n  /**\n   * Determines if labels in this collection will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  /**\n   * The 4x4 transformation matrix that transforms each label in this collection from model to world coordinates.\n   * When this is the identity matrix, the labels are drawn in world coordinates, i.e., Earth's WGS84 coordinates.\n   * Local reference frames can be used by providing a different transformation matrix, like that returned\n   * by {@link Transforms.eastNorthUpToFixedFrame}.\n   *\n   * @type Matrix4\n   * @default {@link Matrix4.IDENTITY}\n   *\n   * @example\n   * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);\n   * labels.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);\n   * labels.add({\n   *   position : new Cesium.Cartesian3(0.0, 0.0, 0.0),\n   *   text     : 'Center'\n   * });\n   * labels.add({\n   *   position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0),\n   *   text     : 'East'\n   * });\n   * labels.add({\n   *   position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0),\n   *   text     : 'North'\n   * });\n   * labels.add({\n   *   position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0),\n   *   text     : 'Up'\n   * });\n   */\n  this.modelMatrix = Matrix4.clone(\n    defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n  );\n\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the bounding sphere for each draw command in the primitive.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowBoundingVolume = defaultValue(\n    options.debugShowBoundingVolume,\n    false\n  );\n\n  /**\n   * The label blending option. The default is used for rendering both opaque and translucent labels.\n   * However, if either all of the labels are completely opaque or all are completely translucent,\n   * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve\n   * performance by up to 2x.\n   * @type {BlendOption}\n   * @default BlendOption.OPAQUE_AND_TRANSLUCENT\n   */\n  this.blendOption = defaultValue(\n    options.blendOption,\n    BlendOption.OPAQUE_AND_TRANSLUCENT\n  );\n}\n\nObject.defineProperties(LabelCollection.prototype, {\n  /**\n   * Returns the number of labels in this collection.  This is commonly used with\n   * {@link LabelCollection#get} to iterate over all the labels\n   * in the collection.\n   * @memberof LabelCollection.prototype\n   * @type {number}\n   */\n  length: {\n    get: function () {\n      return this._labels.length;\n    },\n  },\n});\n\n/**\n * Creates and adds a label with the specified initial properties to the collection.\n * The added label is returned so it can be modified or removed from the collection later.\n *\n * @param {object} [options] A template describing the label's properties as shown in Example 1.\n * @returns {Label} The label that was added to the collection.\n *\n * @performance Calling <code>add</code> is expected constant time.  However, the collection's vertex buffer\n * is rewritten; this operations is <code>O(n)</code> and also incurs\n * CPU to GPU overhead.  For best performance, add as many billboards as possible before\n * calling <code>update</code>.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Example 1:  Add a label, specifying all the default values.\n * const l = labels.add({\n *   show : true,\n *   position : Cesium.Cartesian3.ZERO,\n *   text : '',\n *   font : '30px sans-serif',\n *   fillColor : Cesium.Color.WHITE,\n *   outlineColor : Cesium.Color.BLACK,\n *   outlineWidth : 1.0,\n *   showBackground : false,\n *   backgroundColor : new Cesium.Color(0.165, 0.165, 0.165, 0.8),\n *   backgroundPadding : new Cesium.Cartesian2(7, 5),\n *   style : Cesium.LabelStyle.FILL,\n *   pixelOffset : Cesium.Cartesian2.ZERO,\n *   eyeOffset : Cesium.Cartesian3.ZERO,\n *   horizontalOrigin : Cesium.HorizontalOrigin.LEFT,\n *   verticalOrigin : Cesium.VerticalOrigin.BASELINE,\n *   scale : 1.0,\n *   translucencyByDistance : undefined,\n *   pixelOffsetScaleByDistance : undefined,\n *   heightReference : HeightReference.NONE,\n *   distanceDisplayCondition : undefined\n * });\n *\n * @example\n * // Example 2:  Specify only the label's cartographic position,\n * // text, and font.\n * const l = labels.add({\n *   position : Cesium.Cartesian3.fromRadians(longitude, latitude, height),\n *   text : 'Hello World',\n *   font : '24px Helvetica',\n * });\n *\n * @see LabelCollection#remove\n * @see LabelCollection#removeAll\n */\nLabelCollection.prototype.add = function (options) {\n  const label = new Label(options, this);\n\n  this._labels.push(label);\n  this._labelsToUpdate.push(label);\n\n  return label;\n};\n\n/**\n * Removes a label from the collection.  Once removed, a label is no longer usable.\n *\n * @param {Label} label The label to remove.\n * @returns {boolean} <code>true</code> if the label was removed; <code>false</code> if the label was not found in the collection.\n *\n * @performance Calling <code>remove</code> is expected constant time.  However, the collection's vertex buffer\n * is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead.  For\n * best performance, remove as many labels as possible before calling <code>update</code>.\n * If you intend to temporarily hide a label, it is usually more efficient to call\n * {@link Label#show} instead of removing and re-adding the label.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * const l = labels.add(...);\n * labels.remove(l);  // Returns true\n *\n * @see LabelCollection#add\n * @see LabelCollection#removeAll\n * @see Label#show\n */\nLabelCollection.prototype.remove = function (label) {\n  if (defined(label) && label._labelCollection === this) {\n    const index = this._labels.indexOf(label);\n    if (index !== -1) {\n      this._labels.splice(index, 1);\n      destroyLabel(this, label);\n      return true;\n    }\n  }\n  return false;\n};\n\n/**\n * Removes all labels from the collection.\n *\n * @performance <code>O(n)</code>.  It is more efficient to remove all the labels\n * from a collection and then add new ones than to create a new collection entirely.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * labels.add(...);\n * labels.add(...);\n * labels.removeAll();\n *\n * @see LabelCollection#add\n * @see LabelCollection#remove\n */\nLabelCollection.prototype.removeAll = function () {\n  const labels = this._labels;\n\n  for (let i = 0, len = labels.length; i < len; ++i) {\n    destroyLabel(this, labels[i]);\n  }\n\n  labels.length = 0;\n};\n\n/**\n * Check whether this collection contains a given label.\n *\n * @param {Label} label The label to check for.\n * @returns {boolean} true if this collection contains the label, false otherwise.\n *\n * @see LabelCollection#get\n *\n */\nLabelCollection.prototype.contains = function (label) {\n  return defined(label) && label._labelCollection === this;\n};\n\n/**\n * Returns the label in the collection at the specified index.  Indices are zero-based\n * and increase as labels are added.  Removing a label shifts all labels after\n * it to the left, changing their indices.  This function is commonly used with\n * {@link LabelCollection#length} to iterate over all the labels\n * in the collection.\n *\n * @param {number} index The zero-based index of the billboard.\n *\n * @returns {Label} The label at the specified index.\n *\n * @performance Expected constant time.  If labels were removed from the collection and\n * {@link Scene#render} was not called, an implicit <code>O(n)</code>\n * operation is performed.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Toggle the show property of every label in the collection\n * const len = labels.length;\n * for (let i = 0; i < len; ++i) {\n *   const l = billboards.get(i);\n *   l.show = !l.show;\n * }\n *\n * @see LabelCollection#length\n */\nLabelCollection.prototype.get = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(index)) {\n    throw new DeveloperError(\"index is required.\");\n  }\n  //>>includeEnd('debug');\n\n  return this._labels[index];\n};\n\n/**\n * @private\n *\n */\nLabelCollection.prototype.update = function (frameState) {\n  if (!this.show) {\n    return;\n  }\n\n  const billboardCollection = this._billboardCollection;\n  const backgroundBillboardCollection = this._backgroundBillboardCollection;\n\n  billboardCollection.modelMatrix = this.modelMatrix;\n  billboardCollection.debugShowBoundingVolume = this.debugShowBoundingVolume;\n  backgroundBillboardCollection.modelMatrix = this.modelMatrix;\n  backgroundBillboardCollection.debugShowBoundingVolume = this.debugShowBoundingVolume;\n\n  const context = frameState.context;\n\n  if (!defined(this._textureAtlas)) {\n    this._textureAtlas = new TextureAtlas({\n      context: context,\n    });\n    billboardCollection.textureAtlas = this._textureAtlas;\n  }\n\n  if (!defined(this._backgroundTextureAtlas)) {\n    this._backgroundTextureAtlas = new TextureAtlas({\n      context: context,\n      initialSize: whitePixelSize,\n    });\n    backgroundBillboardCollection.textureAtlas = this._backgroundTextureAtlas;\n\n    // Request a new render in request render mode after the next frame renders\n    addWhitePixelCanvas(this._backgroundTextureAtlas);\n  }\n\n  const len = this._labelsToUpdate.length;\n  for (let i = 0; i < len; ++i) {\n    const label = this._labelsToUpdate[i];\n    if (label.isDestroyed()) {\n      continue;\n    }\n\n    const preUpdateGlyphCount = label._glyphs.length;\n\n    if (label._rebindAllGlyphs) {\n      rebindAllGlyphs(this, label);\n      label._rebindAllGlyphs = false;\n    }\n\n    if (label._repositionAllGlyphs) {\n      repositionAllGlyphs(label);\n      label._repositionAllGlyphs = false;\n    }\n\n    const glyphCountDifference = label._glyphs.length - preUpdateGlyphCount;\n    this._totalGlyphCount += glyphCountDifference;\n  }\n\n  const blendOption =\n    backgroundBillboardCollection.length > 0\n      ? BlendOption.TRANSLUCENT\n      : this.blendOption;\n  billboardCollection.blendOption = blendOption;\n  backgroundBillboardCollection.blendOption = blendOption;\n\n  billboardCollection._highlightColor = this._highlightColor;\n  backgroundBillboardCollection._highlightColor = this._highlightColor;\n\n  this._labelsToUpdate.length = 0;\n  backgroundBillboardCollection.update(frameState);\n  billboardCollection.update(frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see LabelCollection#destroy\n */\nLabelCollection.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * labels = labels && labels.destroy();\n *\n * @see LabelCollection#isDestroyed\n */\nLabelCollection.prototype.destroy = function () {\n  this.removeAll();\n  this._billboardCollection = this._billboardCollection.destroy();\n  this._textureAtlas = this._textureAtlas && this._textureAtlas.destroy();\n  this._backgroundBillboardCollection = this._backgroundBillboardCollection.destroy();\n  this._backgroundTextureAtlas =\n    this._backgroundTextureAtlas && this._backgroundTextureAtlas.destroy();\n\n  return destroyObject(this);\n};\nexport default LabelCollection;\n", "/**\n * Describes how to draw a label.\n *\n * @enum {number}\n *\n * @see Label#style\n */\nconst LabelStyle = {\n  /**\n   * Fill the text of the label, but do not outline.\n   *\n   * @type {number}\n   * @constant\n   */\n  FILL: 0,\n\n  /**\n   * Outline the text of the label, but do not fill.\n   *\n   * @type {number}\n   * @constant\n   */\n  OUTLINE: 1,\n\n  /**\n   * Fill and outline the text of the label.\n   *\n   * @type {number}\n   * @constant\n   */\n  FILL_AND_OUTLINE: 2,\n};\nexport default Object.freeze(LabelStyle);\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport Billboard from \"./Billboard.js\";\nimport HeightReference from \"./HeightReference.js\";\nimport HorizontalOrigin from \"./HorizontalOrigin.js\";\nimport LabelStyle from \"./LabelStyle.js\";\nimport SDFSettings from \"./SDFSettings.js\";\nimport VerticalOrigin from \"./VerticalOrigin.js\";\n\nconst fontInfoCache = {};\nlet fontInfoCacheLength = 0;\nconst fontInfoCacheMaxSize = 256;\nconst defaultBackgroundColor = new Color(0.165, 0.165, 0.165, 0.8);\nconst defaultBackgroundPadding = new Cartesian2(7, 5);\n\nconst textTypes = Object.freeze({\n  LTR: 0,\n  RTL: 1,\n  WEAK: 2,\n  BRACKETS: 3,\n});\n\nfunction rebindAllGlyphs(label) {\n  if (!label._rebindAllGlyphs && !label._repositionAllGlyphs) {\n    // only push label if it's not already been marked dirty\n    label._labelCollection._labelsToUpdate.push(label);\n  }\n  label._rebindAllGlyphs = true;\n}\n\nfunction repositionAllGlyphs(label) {\n  if (!label._rebindAllGlyphs && !label._repositionAllGlyphs) {\n    // only push label if it's not already been marked dirty\n    label._labelCollection._labelsToUpdate.push(label);\n  }\n  label._repositionAllGlyphs = true;\n}\n\nfunction getCSSValue(element, property) {\n  return document.defaultView\n    .getComputedStyle(element, null)\n    .getPropertyValue(property);\n}\n\nfunction parseFont(label) {\n  let fontInfo = fontInfoCache[label._font];\n  if (!defined(fontInfo)) {\n    const div = document.createElement(\"div\");\n    div.style.position = \"absolute\";\n    div.style.opacity = 0;\n    div.style.font = label._font;\n    document.body.appendChild(div);\n\n    let lineHeight = parseFloat(getCSSValue(div, \"line-height\"));\n    if (isNaN(lineHeight)) {\n      // line-height isn't a number, i.e. 'normal'; apply default line-spacing\n      lineHeight = undefined;\n    }\n\n    fontInfo = {\n      family: getCSSValue(div, \"font-family\"),\n      size: getCSSValue(div, \"font-size\").replace(\"px\", \"\"),\n      style: getCSSValue(div, \"font-style\"),\n      weight: getCSSValue(div, \"font-weight\"),\n      lineHeight: lineHeight,\n    };\n\n    document.body.removeChild(div);\n    if (fontInfoCacheLength < fontInfoCacheMaxSize) {\n      fontInfoCache[label._font] = fontInfo;\n      fontInfoCacheLength++;\n    }\n  }\n  label._fontFamily = fontInfo.family;\n  label._fontSize = fontInfo.size;\n  label._fontStyle = fontInfo.style;\n  label._fontWeight = fontInfo.weight;\n  label._lineHeight = fontInfo.lineHeight;\n}\n\n/**\n * <div class=\"notice\">\n * Create labels by calling {@link LabelCollection#add}. Do not call the constructor directly.\n * </div>\n *\n * @alias Label\n * @internalConstructor\n * @class\n *\n * @exception {DeveloperError} translucencyByDistance.far must be greater than translucencyByDistance.near\n * @exception {DeveloperError} pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near\n * @exception {DeveloperError} distanceDisplayCondition.far must be greater than distanceDisplayCondition.near\n *\n * @see LabelCollection\n * @see LabelCollection#add\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Labels.html|Cesium Sandcastle Labels Demo}\n */\nfunction Label(options, labelCollection) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    defined(options.disableDepthTestDistance) &&\n    options.disableDepthTestDistance < 0.0\n  ) {\n    throw new DeveloperError(\n      \"disableDepthTestDistance must be greater than 0.0.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  let translucencyByDistance = options.translucencyByDistance;\n  let pixelOffsetScaleByDistance = options.pixelOffsetScaleByDistance;\n  let scaleByDistance = options.scaleByDistance;\n  let distanceDisplayCondition = options.distanceDisplayCondition;\n  if (defined(translucencyByDistance)) {\n    //>>includeStart('debug', pragmas.debug);\n    if (translucencyByDistance.far <= translucencyByDistance.near) {\n      throw new DeveloperError(\n        \"translucencyByDistance.far must be greater than translucencyByDistance.near.\"\n      );\n    }\n    //>>includeEnd('debug');\n    translucencyByDistance = NearFarScalar.clone(translucencyByDistance);\n  }\n  if (defined(pixelOffsetScaleByDistance)) {\n    //>>includeStart('debug', pragmas.debug);\n    if (pixelOffsetScaleByDistance.far <= pixelOffsetScaleByDistance.near) {\n      throw new DeveloperError(\n        \"pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.\"\n      );\n    }\n    //>>includeEnd('debug');\n    pixelOffsetScaleByDistance = NearFarScalar.clone(\n      pixelOffsetScaleByDistance\n    );\n  }\n  if (defined(scaleByDistance)) {\n    //>>includeStart('debug', pragmas.debug);\n    if (scaleByDistance.far <= scaleByDistance.near) {\n      throw new DeveloperError(\n        \"scaleByDistance.far must be greater than scaleByDistance.near.\"\n      );\n    }\n    //>>includeEnd('debug');\n    scaleByDistance = NearFarScalar.clone(scaleByDistance);\n  }\n  if (defined(distanceDisplayCondition)) {\n    //>>includeStart('debug', pragmas.debug);\n    if (distanceDisplayCondition.far <= distanceDisplayCondition.near) {\n      throw new DeveloperError(\n        \"distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.\"\n      );\n    }\n    //>>includeEnd('debug');\n    distanceDisplayCondition = DistanceDisplayCondition.clone(\n      distanceDisplayCondition\n    );\n  }\n\n  this._renderedText = undefined;\n  this._text = undefined;\n  this._show = defaultValue(options.show, true);\n  this._font = defaultValue(options.font, \"30px sans-serif\");\n  this._fillColor = Color.clone(defaultValue(options.fillColor, Color.WHITE));\n  this._outlineColor = Color.clone(\n    defaultValue(options.outlineColor, Color.BLACK)\n  );\n  this._outlineWidth = defaultValue(options.outlineWidth, 1.0);\n  this._showBackground = defaultValue(options.showBackground, false);\n  this._backgroundColor = Color.clone(\n    defaultValue(options.backgroundColor, defaultBackgroundColor)\n  );\n  this._backgroundPadding = Cartesian2.clone(\n    defaultValue(options.backgroundPadding, defaultBackgroundPadding)\n  );\n  this._style = defaultValue(options.style, LabelStyle.FILL);\n  this._verticalOrigin = defaultValue(\n    options.verticalOrigin,\n    VerticalOrigin.BASELINE\n  );\n  this._horizontalOrigin = defaultValue(\n    options.horizontalOrigin,\n    HorizontalOrigin.LEFT\n  );\n  this._pixelOffset = Cartesian2.clone(\n    defaultValue(options.pixelOffset, Cartesian2.ZERO)\n  );\n  this._eyeOffset = Cartesian3.clone(\n    defaultValue(options.eyeOffset, Cartesian3.ZERO)\n  );\n  this._position = Cartesian3.clone(\n    defaultValue(options.position, Cartesian3.ZERO)\n  );\n  this._scale = defaultValue(options.scale, 1.0);\n  this._id = options.id;\n  this._translucencyByDistance = translucencyByDistance;\n  this._pixelOffsetScaleByDistance = pixelOffsetScaleByDistance;\n  this._scaleByDistance = scaleByDistance;\n  this._heightReference = defaultValue(\n    options.heightReference,\n    HeightReference.NONE\n  );\n  this._distanceDisplayCondition = distanceDisplayCondition;\n  this._disableDepthTestDistance = options.disableDepthTestDistance;\n\n  this._labelCollection = labelCollection;\n  this._glyphs = [];\n  this._backgroundBillboard = undefined;\n  this._batchIndex = undefined; // Used only by Vector3DTilePoints and BillboardCollection\n\n  this._rebindAllGlyphs = true;\n  this._repositionAllGlyphs = true;\n\n  this._actualClampedPosition = undefined;\n  this._removeCallbackFunc = undefined;\n  this._mode = undefined;\n\n  this._clusterShow = true;\n\n  this.text = defaultValue(options.text, \"\");\n\n  this._relativeSize = 1.0;\n\n  parseFont(this);\n\n  this._updateClamping();\n}\n\nObject.defineProperties(Label.prototype, {\n  /**\n   * Determines if this label will be shown.  Use this to hide or show a label, instead\n   * of removing it and re-adding it to the collection.\n   * @memberof Label.prototype\n   * @type {boolean}\n   * @default true\n   */\n  show: {\n    get: function () {\n      return this._show;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (this._show !== value) {\n        this._show = value;\n\n        const glyphs = this._glyphs;\n        for (let i = 0, len = glyphs.length; i < len; i++) {\n          const billboard = glyphs[i].billboard;\n          if (defined(billboard)) {\n            billboard.show = value;\n          }\n        }\n        const backgroundBillboard = this._backgroundBillboard;\n        if (defined(backgroundBillboard)) {\n          backgroundBillboard.show = value;\n        }\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the Cartesian position of this label.\n   * @memberof Label.prototype\n   * @type {Cartesian3}\n   */\n  position: {\n    get: function () {\n      return this._position;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      const position = this._position;\n      if (!Cartesian3.equals(position, value)) {\n        Cartesian3.clone(value, position);\n\n        const glyphs = this._glyphs;\n        for (let i = 0, len = glyphs.length; i < len; i++) {\n          const billboard = glyphs[i].billboard;\n          if (defined(billboard)) {\n            billboard.position = value;\n          }\n        }\n        const backgroundBillboard = this._backgroundBillboard;\n        if (defined(backgroundBillboard)) {\n          backgroundBillboard.position = value;\n        }\n\n        this._updateClamping();\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the height reference of this billboard.\n   * @memberof Label.prototype\n   * @type {HeightReference}\n   * @default HeightReference.NONE\n   */\n  heightReference: {\n    get: function () {\n      return this._heightReference;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (value !== this._heightReference) {\n        this._heightReference = value;\n\n        const glyphs = this._glyphs;\n        for (let i = 0, len = glyphs.length; i < len; i++) {\n          const billboard = glyphs[i].billboard;\n          if (defined(billboard)) {\n            billboard.heightReference = value;\n          }\n        }\n        const backgroundBillboard = this._backgroundBillboard;\n        if (defined(backgroundBillboard)) {\n          backgroundBillboard.heightReference = value;\n        }\n\n        repositionAllGlyphs(this);\n\n        this._updateClamping();\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the text of this label.\n   * @memberof Label.prototype\n   * @type {string}\n   */\n  text: {\n    get: function () {\n      return this._text;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (this._text !== value) {\n        this._text = value;\n\n        // Strip soft-hyphen (auto-wrap) characters from input string\n        const renderedValue = value.replace(/\\u00ad/g, \"\");\n        this._renderedText = Label.enableRightToLeftDetection\n          ? reverseRtl(renderedValue)\n          : renderedValue;\n        rebindAllGlyphs(this);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the font used to draw this label. Fonts are specified using the same syntax as the CSS 'font' property.\n   * @memberof Label.prototype\n   * @type {string}\n   * @default '30px sans-serif'\n   * @see {@link http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#text-styles|HTML canvas 2D context text styles}\n   */\n  font: {\n    get: function () {\n      return this._font;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (this._font !== value) {\n        this._font = value;\n        rebindAllGlyphs(this);\n        parseFont(this);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the fill color of this label.\n   * @memberof Label.prototype\n   * @type {Color}\n   * @default Color.WHITE\n   * @see {@link http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#fill-and-stroke-styles|HTML canvas 2D context fill and stroke styles}\n   */\n  fillColor: {\n    get: function () {\n      return this._fillColor;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      const fillColor = this._fillColor;\n      if (!Color.equals(fillColor, value)) {\n        Color.clone(value, fillColor);\n        rebindAllGlyphs(this);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the outline color of this label.\n   * @memberof Label.prototype\n   * @type {Color}\n   * @default Color.BLACK\n   * @see {@link http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#fill-and-stroke-styles|HTML canvas 2D context fill and stroke styles}\n   */\n  outlineColor: {\n    get: function () {\n      return this._outlineColor;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      const outlineColor = this._outlineColor;\n      if (!Color.equals(outlineColor, value)) {\n        Color.clone(value, outlineColor);\n        rebindAllGlyphs(this);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the outline width of this label.\n   * @memberof Label.prototype\n   * @type {number}\n   * @default 1.0\n   * @see {@link http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#fill-and-stroke-styles|HTML canvas 2D context fill and stroke styles}\n   */\n  outlineWidth: {\n    get: function () {\n      return this._outlineWidth;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (this._outlineWidth !== value) {\n        this._outlineWidth = value;\n        rebindAllGlyphs(this);\n      }\n    },\n  },\n\n  /**\n   * Determines if a background behind this label will be shown.\n   * @memberof Label.prototype\n   * @default false\n   * @type {boolean}\n   */\n  showBackground: {\n    get: function () {\n      return this._showBackground;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (this._showBackground !== value) {\n        this._showBackground = value;\n        rebindAllGlyphs(this);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the background color of this label.\n   * @memberof Label.prototype\n   * @type {Color}\n   * @default new Color(0.165, 0.165, 0.165, 0.8)\n   */\n  backgroundColor: {\n    get: function () {\n      return this._backgroundColor;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      const backgroundColor = this._backgroundColor;\n      if (!Color.equals(backgroundColor, value)) {\n        Color.clone(value, backgroundColor);\n\n        const backgroundBillboard = this._backgroundBillboard;\n        if (defined(backgroundBillboard)) {\n          backgroundBillboard.color = backgroundColor;\n        }\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the background padding, in pixels, of this label.  The <code>x</code> value\n   * controls horizontal padding, and the <code>y</code> value controls vertical padding.\n   * @memberof Label.prototype\n   * @type {Cartesian2}\n   * @default new Cartesian2(7, 5)\n   */\n  backgroundPadding: {\n    get: function () {\n      return this._backgroundPadding;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      const backgroundPadding = this._backgroundPadding;\n      if (!Cartesian2.equals(backgroundPadding, value)) {\n        Cartesian2.clone(value, backgroundPadding);\n        repositionAllGlyphs(this);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the style of this label.\n   * @memberof Label.prototype\n   * @type {LabelStyle}\n   * @default LabelStyle.FILL\n   */\n  style: {\n    get: function () {\n      return this._style;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (this._style !== value) {\n        this._style = value;\n        rebindAllGlyphs(this);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the pixel offset in screen space from the origin of this label.  This is commonly used\n   * to align multiple labels and billboards at the same position, e.g., an image and text.  The\n   * screen space origin is the top, left corner of the canvas; <code>x</code> increases from\n   * left to right, and <code>y</code> increases from top to bottom.\n   * <br /><br />\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>\n   * <td align='center'><code>l.pixeloffset = new Cartesian2(25, 75);</code><br/><img src='Images/Label.setPixelOffset.x50y-25.png' width='250' height='188' /></td>\n   * </tr></table>\n   * The label's origin is indicated by the yellow point.\n   * </div>\n   * @memberof Label.prototype\n   * @type {Cartesian2}\n   * @default Cartesian2.ZERO\n   */\n  pixelOffset: {\n    get: function () {\n      return this._pixelOffset;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      const pixelOffset = this._pixelOffset;\n      if (!Cartesian2.equals(pixelOffset, value)) {\n        Cartesian2.clone(value, pixelOffset);\n\n        const glyphs = this._glyphs;\n        for (let i = 0, len = glyphs.length; i < len; i++) {\n          const glyph = glyphs[i];\n          if (defined(glyph.billboard)) {\n            glyph.billboard.pixelOffset = value;\n          }\n        }\n        const backgroundBillboard = this._backgroundBillboard;\n        if (defined(backgroundBillboard)) {\n          backgroundBillboard.pixelOffset = value;\n        }\n      }\n    },\n  },\n\n  /**\n   * Gets or sets near and far translucency properties of a Label based on the Label's distance from the camera.\n   * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the label's translucency remains clamped to the nearest bound.  If undefined,\n   * translucencyByDistance will be disabled.\n   * @memberof Label.prototype\n   * @type {NearFarScalar}\n   *\n   * @example\n   * // Example 1.\n   * // Set a label's translucencyByDistance to 1.0 when the\n   * // camera is 1500 meters from the label and disappear as\n   * // the camera distance approaches 8.0e6 meters.\n   * text.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);\n   *\n   * @example\n   * // Example 2.\n   * // disable translucency by distance\n   * text.translucencyByDistance = undefined;\n   */\n  translucencyByDistance: {\n    get: function () {\n      return this._translucencyByDistance;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value) && value.far <= value.near) {\n        throw new DeveloperError(\n          \"far distance must be greater than near distance.\"\n        );\n      }\n      //>>includeEnd('debug');\n\n      const translucencyByDistance = this._translucencyByDistance;\n      if (!NearFarScalar.equals(translucencyByDistance, value)) {\n        this._translucencyByDistance = NearFarScalar.clone(\n          value,\n          translucencyByDistance\n        );\n\n        const glyphs = this._glyphs;\n        for (let i = 0, len = glyphs.length; i < len; i++) {\n          const glyph = glyphs[i];\n          if (defined(glyph.billboard)) {\n            glyph.billboard.translucencyByDistance = value;\n          }\n        }\n        const backgroundBillboard = this._backgroundBillboard;\n        if (defined(backgroundBillboard)) {\n          backgroundBillboard.translucencyByDistance = value;\n        }\n      }\n    },\n  },\n\n  /**\n   * Gets or sets near and far pixel offset scaling properties of a Label based on the Label's distance from the camera.\n   * A label's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the label's pixel offset scaling remains clamped to the nearest bound.  If undefined,\n   * pixelOffsetScaleByDistance will be disabled.\n   * @memberof Label.prototype\n   * @type {NearFarScalar}\n   *\n   * @example\n   * // Example 1.\n   * // Set a label's pixel offset scale to 0.0 when the\n   * // camera is 1500 meters from the label and scale pixel offset to 10.0 pixels\n   * // in the y direction the camera distance approaches 8.0e6 meters.\n   * text.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);\n   * text.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);\n   *\n   * @example\n   * // Example 2.\n   * // disable pixel offset by distance\n   * text.pixelOffsetScaleByDistance = undefined;\n   */\n  pixelOffsetScaleByDistance: {\n    get: function () {\n      return this._pixelOffsetScaleByDistance;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value) && value.far <= value.near) {\n        throw new DeveloperError(\n          \"far distance must be greater than near distance.\"\n        );\n      }\n      //>>includeEnd('debug');\n\n      const pixelOffsetScaleByDistance = this._pixelOffsetScaleByDistance;\n      if (!NearFarScalar.equals(pixelOffsetScaleByDistance, value)) {\n        this._pixelOffsetScaleByDistance = NearFarScalar.clone(\n          value,\n          pixelOffsetScaleByDistance\n        );\n\n        const glyphs = this._glyphs;\n        for (let i = 0, len = glyphs.length; i < len; i++) {\n          const glyph = glyphs[i];\n          if (defined(glyph.billboard)) {\n            glyph.billboard.pixelOffsetScaleByDistance = value;\n          }\n        }\n        const backgroundBillboard = this._backgroundBillboard;\n        if (defined(backgroundBillboard)) {\n          backgroundBillboard.pixelOffsetScaleByDistance = value;\n        }\n      }\n    },\n  },\n\n  /**\n   * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.\n   * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the label's scale remains clamped to the nearest bound.  If undefined,\n   * scaleByDistance will be disabled.\n   * @memberof Label.prototype\n   * @type {NearFarScalar}\n   *\n   * @example\n   * // Example 1.\n   * // Set a label's scaleByDistance to scale by 1.5 when the\n   * // camera is 1500 meters from the label and disappear as\n   * // the camera distance approaches 8.0e6 meters.\n   * label.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);\n   *\n   * @example\n   * // Example 2.\n   * // disable scaling by distance\n   * label.scaleByDistance = undefined;\n   */\n  scaleByDistance: {\n    get: function () {\n      return this._scaleByDistance;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value) && value.far <= value.near) {\n        throw new DeveloperError(\n          \"far distance must be greater than near distance.\"\n        );\n      }\n      //>>includeEnd('debug');\n\n      const scaleByDistance = this._scaleByDistance;\n      if (!NearFarScalar.equals(scaleByDistance, value)) {\n        this._scaleByDistance = NearFarScalar.clone(value, scaleByDistance);\n\n        const glyphs = this._glyphs;\n        for (let i = 0, len = glyphs.length; i < len; i++) {\n          const glyph = glyphs[i];\n          if (defined(glyph.billboard)) {\n            glyph.billboard.scaleByDistance = value;\n          }\n        }\n        const backgroundBillboard = this._backgroundBillboard;\n        if (defined(backgroundBillboard)) {\n          backgroundBillboard.scaleByDistance = value;\n        }\n      }\n    },\n  },\n\n  /**\n   * Gets and sets the 3D Cartesian offset applied to this label in eye coordinates.  Eye coordinates is a left-handed\n   * coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and\n   * <code>z</code> points into the screen.  Eye coordinates use the same scale as world and model coordinates,\n   * which is typically meters.\n   * <br /><br />\n   * An eye offset is commonly used to arrange multiple label or objects at the same position, e.g., to\n   * arrange a label above its corresponding 3D model.\n   * <br /><br />\n   * Below, the label is positioned at the center of the Earth but an eye offset makes it always\n   * appear on top of the Earth regardless of the viewer's or Earth's orientation.\n   * <br /><br />\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>\n   * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>\n   * </tr></table>\n   * <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />\n   * </div>\n   * @memberof Label.prototype\n   * @type {Cartesian3}\n   * @default Cartesian3.ZERO\n   */\n  eyeOffset: {\n    get: function () {\n      return this._eyeOffset;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      const eyeOffset = this._eyeOffset;\n      if (!Cartesian3.equals(eyeOffset, value)) {\n        Cartesian3.clone(value, eyeOffset);\n\n        const glyphs = this._glyphs;\n        for (let i = 0, len = glyphs.length; i < len; i++) {\n          const glyph = glyphs[i];\n          if (defined(glyph.billboard)) {\n            glyph.billboard.eyeOffset = value;\n          }\n        }\n        const backgroundBillboard = this._backgroundBillboard;\n        if (defined(backgroundBillboard)) {\n          backgroundBillboard.eyeOffset = value;\n        }\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the horizontal origin of this label, which determines if the label is drawn\n   * to the left, center, or right of its anchor position.\n   * <br /><br />\n   * <div align='center'>\n   * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />\n   * </div>\n   * @memberof Label.prototype\n   * @type {HorizontalOrigin}\n   * @default HorizontalOrigin.LEFT\n   * @example\n   * // Use a top, right origin\n   * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;\n   * l.verticalOrigin = Cesium.VerticalOrigin.TOP;\n   */\n  horizontalOrigin: {\n    get: function () {\n      return this._horizontalOrigin;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (this._horizontalOrigin !== value) {\n        this._horizontalOrigin = value;\n        repositionAllGlyphs(this);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the vertical origin of this label, which determines if the label is\n   * to the above, below, or at the center of its anchor position.\n   * <br /><br />\n   * <div align='center'>\n   * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />\n   * </div>\n   * @memberof Label.prototype\n   * @type {VerticalOrigin}\n   * @default VerticalOrigin.BASELINE\n   * @example\n   * // Use a top, right origin\n   * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;\n   * l.verticalOrigin = Cesium.VerticalOrigin.TOP;\n   */\n  verticalOrigin: {\n    get: function () {\n      return this._verticalOrigin;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (this._verticalOrigin !== value) {\n        this._verticalOrigin = value;\n\n        const glyphs = this._glyphs;\n        for (let i = 0, len = glyphs.length; i < len; i++) {\n          const glyph = glyphs[i];\n          if (defined(glyph.billboard)) {\n            glyph.billboard.verticalOrigin = value;\n          }\n        }\n        const backgroundBillboard = this._backgroundBillboard;\n        if (defined(backgroundBillboard)) {\n          backgroundBillboard.verticalOrigin = value;\n        }\n\n        repositionAllGlyphs(this);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the uniform scale that is multiplied with the label's size in pixels.\n   * A scale of <code>1.0</code> does not change the size of the label; a scale greater than\n   * <code>1.0</code> enlarges the label; a positive scale less than <code>1.0</code> shrinks\n   * the label.\n   * <br /><br />\n   * Applying a large scale value may pixelate the label.  To make text larger without pixelation,\n   * use a larger font size when calling {@link Label#font} instead.\n   * <br /><br />\n   * <div align='center'>\n   * <img src='Images/Label.setScale.png' width='400' height='300' /><br/>\n   * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,\n   * and <code>2.0</code>.\n   * </div>\n   * @memberof Label.prototype\n   * @type {number}\n   * @default 1.0\n   */\n  scale: {\n    get: function () {\n      return this._scale;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (this._scale !== value) {\n        this._scale = value;\n\n        const glyphs = this._glyphs;\n        for (let i = 0, len = glyphs.length; i < len; i++) {\n          const glyph = glyphs[i];\n          if (defined(glyph.billboard)) {\n            glyph.billboard.scale = value * this._relativeSize;\n          }\n        }\n        const backgroundBillboard = this._backgroundBillboard;\n        if (defined(backgroundBillboard)) {\n          backgroundBillboard.scale = value * this._relativeSize;\n        }\n\n        repositionAllGlyphs(this);\n      }\n    },\n  },\n\n  /**\n   * Gets the total scale of the label, which is the label's scale multiplied by the computed relative size\n   * of the desired font compared to the generated glyph size.\n   * @memberof Label.prototype\n   * @type {number}\n   * @default 1.0\n   */\n  totalScale: {\n    get: function () {\n      return this._scale * this._relativeSize;\n    },\n  },\n\n  /**\n   * Gets or sets the condition specifying at what distance from the camera that this label will be displayed.\n   * @memberof Label.prototype\n   * @type {DistanceDisplayCondition}\n   * @default undefined\n   */\n  distanceDisplayCondition: {\n    get: function () {\n      return this._distanceDisplayCondition;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value) && value.far <= value.near) {\n        throw new DeveloperError(\"far must be greater than near\");\n      }\n      //>>includeEnd('debug');\n      if (\n        !DistanceDisplayCondition.equals(value, this._distanceDisplayCondition)\n      ) {\n        this._distanceDisplayCondition = DistanceDisplayCondition.clone(\n          value,\n          this._distanceDisplayCondition\n        );\n\n        const glyphs = this._glyphs;\n        for (let i = 0, len = glyphs.length; i < len; i++) {\n          const glyph = glyphs[i];\n          if (defined(glyph.billboard)) {\n            glyph.billboard.distanceDisplayCondition = value;\n          }\n        }\n        const backgroundBillboard = this._backgroundBillboard;\n        if (defined(backgroundBillboard)) {\n          backgroundBillboard.distanceDisplayCondition = value;\n        }\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.\n   * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.\n   * @memberof Label.prototype\n   * @type {number}\n   */\n  disableDepthTestDistance: {\n    get: function () {\n      return this._disableDepthTestDistance;\n    },\n    set: function (value) {\n      if (this._disableDepthTestDistance !== value) {\n        //>>includeStart('debug', pragmas.debug);\n        if (defined(value) && value < 0.0) {\n          throw new DeveloperError(\n            \"disableDepthTestDistance must be greater than 0.0.\"\n          );\n        }\n        //>>includeEnd('debug');\n        this._disableDepthTestDistance = value;\n\n        const glyphs = this._glyphs;\n        for (let i = 0, len = glyphs.length; i < len; i++) {\n          const glyph = glyphs[i];\n          if (defined(glyph.billboard)) {\n            glyph.billboard.disableDepthTestDistance = value;\n          }\n        }\n        const backgroundBillboard = this._backgroundBillboard;\n        if (defined(backgroundBillboard)) {\n          backgroundBillboard.disableDepthTestDistance = value;\n        }\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the user-defined value returned when the label is picked.\n   * @memberof Label.prototype\n   * @type {*}\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n    set: function (value) {\n      if (this._id !== value) {\n        this._id = value;\n\n        const glyphs = this._glyphs;\n        for (let i = 0, len = glyphs.length; i < len; i++) {\n          const glyph = glyphs[i];\n          if (defined(glyph.billboard)) {\n            glyph.billboard.id = value;\n          }\n        }\n        const backgroundBillboard = this._backgroundBillboard;\n        if (defined(backgroundBillboard)) {\n          backgroundBillboard.id = value;\n        }\n      }\n    },\n  },\n\n  /**\n   * @private\n   */\n  pickId: {\n    get: function () {\n      if (this._glyphs.length === 0 || !defined(this._glyphs[0].billboard)) {\n        return undefined;\n      }\n      return this._glyphs[0].billboard.pickId;\n    },\n  },\n\n  /**\n   * Keeps track of the position of the label based on the height reference.\n   * @memberof Label.prototype\n   * @type {Cartesian3}\n   * @private\n   */\n  _clampedPosition: {\n    get: function () {\n      return this._actualClampedPosition;\n    },\n    set: function (value) {\n      this._actualClampedPosition = Cartesian3.clone(\n        value,\n        this._actualClampedPosition\n      );\n\n      const glyphs = this._glyphs;\n      for (let i = 0, len = glyphs.length; i < len; i++) {\n        const glyph = glyphs[i];\n        if (defined(glyph.billboard)) {\n          // Set all the private values here, because we already clamped to ground\n          //  so we don't want to do it again for every glyph\n          glyph.billboard._clampedPosition = value;\n        }\n      }\n      const backgroundBillboard = this._backgroundBillboard;\n      if (defined(backgroundBillboard)) {\n        backgroundBillboard._clampedPosition = value;\n      }\n    },\n  },\n\n  /**\n   * Determines whether or not this label will be shown or hidden because it was clustered.\n   * @memberof Label.prototype\n   * @type {boolean}\n   * @default true\n   * @private\n   */\n  clusterShow: {\n    get: function () {\n      return this._clusterShow;\n    },\n    set: function (value) {\n      if (this._clusterShow !== value) {\n        this._clusterShow = value;\n\n        const glyphs = this._glyphs;\n        for (let i = 0, len = glyphs.length; i < len; i++) {\n          const glyph = glyphs[i];\n          if (defined(glyph.billboard)) {\n            glyph.billboard.clusterShow = value;\n          }\n        }\n        const backgroundBillboard = this._backgroundBillboard;\n        if (defined(backgroundBillboard)) {\n          backgroundBillboard.clusterShow = value;\n        }\n      }\n    },\n  },\n});\n\nLabel.prototype._updateClamping = function () {\n  Billboard._updateClamping(this._labelCollection, this);\n};\n\n/**\n * Computes the screen-space position of the label's origin, taking into account eye and pixel offsets.\n * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from\n * left to right, and <code>y</code> increases from top to bottom.\n *\n * @param {Scene} scene The scene the label is in.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The screen-space position of the label.\n *\n *\n * @example\n * console.log(l.computeScreenSpacePosition(scene).toString());\n *\n * @see Label#eyeOffset\n * @see Label#pixelOffset\n */\nLabel.prototype.computeScreenSpacePosition = function (scene, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian2();\n  }\n\n  const labelCollection = this._labelCollection;\n  const modelMatrix = labelCollection.modelMatrix;\n  const actualPosition = defined(this._actualClampedPosition)\n    ? this._actualClampedPosition\n    : this._position;\n\n  const windowCoordinates = Billboard._computeScreenSpacePosition(\n    modelMatrix,\n    actualPosition,\n    this._eyeOffset,\n    this._pixelOffset,\n    scene,\n    result\n  );\n  return windowCoordinates;\n};\n\n/**\n * Gets a label's screen space bounding box centered around screenSpacePosition.\n * @param {Label} label The label to get the screen space bounding box for.\n * @param {Cartesian2} screenSpacePosition The screen space center of the label.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The screen space bounding box.\n *\n * @private\n */\nLabel.getScreenSpaceBoundingBox = function (\n  label,\n  screenSpacePosition,\n  result\n) {\n  let x = 0;\n  let y = 0;\n  let width = 0;\n  let height = 0;\n  const scale = label.totalScale;\n\n  const backgroundBillboard = label._backgroundBillboard;\n  if (defined(backgroundBillboard)) {\n    x = screenSpacePosition.x + backgroundBillboard._translate.x;\n    y = screenSpacePosition.y - backgroundBillboard._translate.y;\n    width = backgroundBillboard.width * scale;\n    height = backgroundBillboard.height * scale;\n\n    if (\n      label.verticalOrigin === VerticalOrigin.BOTTOM ||\n      label.verticalOrigin === VerticalOrigin.BASELINE\n    ) {\n      y -= height;\n    } else if (label.verticalOrigin === VerticalOrigin.CENTER) {\n      y -= height * 0.5;\n    }\n  } else {\n    x = Number.POSITIVE_INFINITY;\n    y = Number.POSITIVE_INFINITY;\n    let maxX = 0;\n    let maxY = 0;\n    const glyphs = label._glyphs;\n    const length = glyphs.length;\n    for (let i = 0; i < length; ++i) {\n      const glyph = glyphs[i];\n      const billboard = glyph.billboard;\n      if (!defined(billboard)) {\n        continue;\n      }\n\n      const glyphX = screenSpacePosition.x + billboard._translate.x;\n      let glyphY = screenSpacePosition.y - billboard._translate.y;\n      const glyphWidth = glyph.dimensions.width * scale;\n      const glyphHeight = glyph.dimensions.height * scale;\n\n      if (\n        label.verticalOrigin === VerticalOrigin.BOTTOM ||\n        label.verticalOrigin === VerticalOrigin.BASELINE\n      ) {\n        glyphY -= glyphHeight;\n      } else if (label.verticalOrigin === VerticalOrigin.CENTER) {\n        glyphY -= glyphHeight * 0.5;\n      }\n\n      if (label._verticalOrigin === VerticalOrigin.TOP) {\n        glyphY += SDFSettings.PADDING * scale;\n      } else if (\n        label._verticalOrigin === VerticalOrigin.BOTTOM ||\n        label._verticalOrigin === VerticalOrigin.BASELINE\n      ) {\n        glyphY -= SDFSettings.PADDING * scale;\n      }\n\n      x = Math.min(x, glyphX);\n      y = Math.min(y, glyphY);\n      maxX = Math.max(maxX, glyphX + glyphWidth);\n      maxY = Math.max(maxY, glyphY + glyphHeight);\n    }\n\n    width = maxX - x;\n    height = maxY - y;\n  }\n\n  if (!defined(result)) {\n    result = new BoundingRectangle();\n  }\n\n  result.x = x;\n  result.y = y;\n  result.width = width;\n  result.height = height;\n\n  return result;\n};\n\n/**\n * Determines if this label equals another label.  Labels are equal if all their properties\n * are equal.  Labels in different collections can be equal.\n *\n * @param {Label} other The label to compare for equality.\n * @returns {boolean} <code>true</code> if the labels are equal; otherwise, <code>false</code>.\n */\nLabel.prototype.equals = function (other) {\n  return (\n    this === other ||\n    (defined(other) &&\n      this._show === other._show &&\n      this._scale === other._scale &&\n      this._outlineWidth === other._outlineWidth &&\n      this._showBackground === other._showBackground &&\n      this._style === other._style &&\n      this._verticalOrigin === other._verticalOrigin &&\n      this._horizontalOrigin === other._horizontalOrigin &&\n      this._heightReference === other._heightReference &&\n      this._renderedText === other._renderedText &&\n      this._font === other._font &&\n      Cartesian3.equals(this._position, other._position) &&\n      Color.equals(this._fillColor, other._fillColor) &&\n      Color.equals(this._outlineColor, other._outlineColor) &&\n      Color.equals(this._backgroundColor, other._backgroundColor) &&\n      Cartesian2.equals(this._backgroundPadding, other._backgroundPadding) &&\n      Cartesian2.equals(this._pixelOffset, other._pixelOffset) &&\n      Cartesian3.equals(this._eyeOffset, other._eyeOffset) &&\n      NearFarScalar.equals(\n        this._translucencyByDistance,\n        other._translucencyByDistance\n      ) &&\n      NearFarScalar.equals(\n        this._pixelOffsetScaleByDistance,\n        other._pixelOffsetScaleByDistance\n      ) &&\n      NearFarScalar.equals(this._scaleByDistance, other._scaleByDistance) &&\n      DistanceDisplayCondition.equals(\n        this._distanceDisplayCondition,\n        other._distanceDisplayCondition\n      ) &&\n      this._disableDepthTestDistance === other._disableDepthTestDistance &&\n      this._id === other._id)\n  );\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n */\nLabel.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Determines whether or not run the algorithm, that match the text of the label to right-to-left languages\n * @memberof Label\n * @type {boolean}\n * @default false\n *\n * @example\n * // Example 1.\n * // Set a label's rightToLeft before init\n * Cesium.Label.enableRightToLeftDetection = true;\n * const myLabelEntity = viewer.entities.add({\n *   label: {\n *     id: 'my label',\n *     text: '\u05D6\u05D4 \u05D8\u05E7\u05E1\u05D8 \u05D1\u05E2\u05D1\u05E8\u05D9\u05EA \\n \u05D5\u05E2\u05DB\u05E9\u05D9\u05D5 \u05D9\u05D5\u05E8\u05D3\u05D9\u05DD \u05E9\u05D5\u05E8\u05D4',\n *   }\n * });\n *\n * @example\n * // Example 2.\n * const myLabelEntity = viewer.entities.add({\n *   label: {\n *     id: 'my label',\n *     text: 'English text'\n *   }\n * });\n * // Set a label's rightToLeft after init\n * Cesium.Label.enableRightToLeftDetection = true;\n * myLabelEntity.text = '\u05D8\u05E7\u05E1\u05D8 \u05D7\u05D3\u05E9';\n */\nLabel.enableRightToLeftDetection = false;\n\nfunction convertTextToTypes(text, rtlChars) {\n  const ltrChars = /[a-zA-Z0-9]/;\n  const bracketsChars = /[()[\\]{}<>]/;\n  const parsedText = [];\n  let word = \"\";\n  let lastType = textTypes.LTR;\n  let currentType = \"\";\n  const textLength = text.length;\n  for (let textIndex = 0; textIndex < textLength; ++textIndex) {\n    const character = text.charAt(textIndex);\n    if (rtlChars.test(character)) {\n      currentType = textTypes.RTL;\n    } else if (ltrChars.test(character)) {\n      currentType = textTypes.LTR;\n    } else if (bracketsChars.test(character)) {\n      currentType = textTypes.BRACKETS;\n    } else {\n      currentType = textTypes.WEAK;\n    }\n\n    if (textIndex === 0) {\n      lastType = currentType;\n    }\n\n    if (lastType === currentType && currentType !== textTypes.BRACKETS) {\n      word += character;\n    } else {\n      if (word !== \"\") {\n        parsedText.push({ Type: lastType, Word: word });\n      }\n      lastType = currentType;\n      word = character;\n    }\n  }\n  parsedText.push({ Type: currentType, Word: word });\n  return parsedText;\n}\n\nfunction reverseWord(word) {\n  return word.split(\"\").reverse().join(\"\");\n}\n\nfunction spliceWord(result, pointer, word) {\n  return result.slice(0, pointer) + word + result.slice(pointer);\n}\n\nfunction reverseBrackets(bracket) {\n  switch (bracket) {\n    case \"(\":\n      return \")\";\n    case \")\":\n      return \"(\";\n    case \"[\":\n      return \"]\";\n    case \"]\":\n      return \"[\";\n    case \"{\":\n      return \"}\";\n    case \"}\":\n      return \"{\";\n    case \"<\":\n      return \">\";\n    case \">\":\n      return \"<\";\n  }\n}\n\n//To add another language, simply add its Unicode block range(s) to the below regex.\nconst hebrew = \"\\u05D0-\\u05EA\";\nconst arabic = \"\\u0600-\\u06FF\\u0750-\\u077F\\u08A0-\\u08FF\";\nconst rtlChars = new RegExp(`[${hebrew}${arabic}]`);\n\n/**\n *\n * @param {string} value the text to parse and reorder\n * @returns {string} the text as rightToLeft direction\n * @private\n */\nfunction reverseRtl(value) {\n  const texts = value.split(\"\\n\");\n  let result = \"\";\n  for (let i = 0; i < texts.length; i++) {\n    const text = texts[i];\n    // first character of the line is a RTL character, so need to manage different cases\n    const rtlDir = rtlChars.test(text.charAt(0));\n    const parsedText = convertTextToTypes(text, rtlChars);\n\n    let splicePointer = 0;\n    let line = \"\";\n    for (let wordIndex = 0; wordIndex < parsedText.length; ++wordIndex) {\n      const subText = parsedText[wordIndex];\n      const reverse =\n        subText.Type === textTypes.BRACKETS\n          ? reverseBrackets(subText.Word)\n          : reverseWord(subText.Word);\n      if (rtlDir) {\n        if (subText.Type === textTypes.RTL) {\n          line = reverse + line;\n          splicePointer = 0;\n        } else if (subText.Type === textTypes.LTR) {\n          line = spliceWord(line, splicePointer, subText.Word);\n          splicePointer += subText.Word.length;\n        } else if (\n          subText.Type === textTypes.WEAK ||\n          subText.Type === textTypes.BRACKETS\n        ) {\n          // current word is weak, last one was bracket\n          if (\n            subText.Type === textTypes.WEAK &&\n            parsedText[wordIndex - 1].Type === textTypes.BRACKETS\n          ) {\n            line = reverse + line;\n          }\n          // current word is weak or bracket, last one was rtl\n          else if (parsedText[wordIndex - 1].Type === textTypes.RTL) {\n            line = reverse + line;\n            splicePointer = 0;\n          }\n          // current word is weak or bracket, there is at least one more word\n          else if (parsedText.length > wordIndex + 1) {\n            // next word is rtl\n            if (parsedText[wordIndex + 1].Type === textTypes.RTL) {\n              line = reverse + line;\n              splicePointer = 0;\n            } else {\n              line = spliceWord(line, splicePointer, subText.Word);\n              splicePointer += subText.Word.length;\n            }\n          }\n          // current word is weak or bracket, and it the last in this line\n          else {\n            line = spliceWord(line, 0, reverse);\n          }\n        }\n      }\n      // ltr line, rtl word\n      else if (subText.Type === textTypes.RTL) {\n        line = spliceWord(line, splicePointer, reverse);\n      }\n      // ltr line, ltr word\n      else if (subText.Type === textTypes.LTR) {\n        line += subText.Word;\n        splicePointer = line.length;\n      }\n      // ltr line, weak or bracket word\n      else if (\n        subText.Type === textTypes.WEAK ||\n        subText.Type === textTypes.BRACKETS\n      ) {\n        // not first word in line\n        if (wordIndex > 0) {\n          // last word was rtl\n          if (parsedText[wordIndex - 1].Type === textTypes.RTL) {\n            // there is at least one more word\n            if (parsedText.length > wordIndex + 1) {\n              // next word is rtl\n              if (parsedText[wordIndex + 1].Type === textTypes.RTL) {\n                line = spliceWord(line, splicePointer, reverse);\n              } else {\n                line += subText.Word;\n                splicePointer = line.length;\n              }\n            } else {\n              line += subText.Word;\n            }\n          } else {\n            line += subText.Word;\n            splicePointer = line.length;\n          }\n        } else {\n          line += subText.Word;\n          splicePointer = line.length;\n        }\n      }\n    }\n\n    result += line;\n    if (i < texts.length - 1) {\n      result += \"\\n\";\n    }\n  }\n  return result;\n}\nexport default Label;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 position3DHigh;\\n\\\nin vec3 position3DLow;\\n\\\nin vec3 position2DHigh;\\n\\\nin vec3 position2DLow;\\n\\\nin vec3 prevPosition3DHigh;\\n\\\nin vec3 prevPosition3DLow;\\n\\\nin vec3 prevPosition2DHigh;\\n\\\nin vec3 prevPosition2DLow;\\n\\\nin vec3 nextPosition3DHigh;\\n\\\nin vec3 nextPosition3DLow;\\n\\\nin vec3 nextPosition2DHigh;\\n\\\nin vec3 nextPosition2DLow;\\n\\\nin vec4 texCoordExpandAndBatchIndex;\\n\\\n\\n\\\nout vec2  v_st;\\n\\\nout float v_width;\\n\\\nout vec4 v_pickColor;\\n\\\nout float v_polylineAngle;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    float texCoord = texCoordExpandAndBatchIndex.x;\\n\\\n    float expandDir = texCoordExpandAndBatchIndex.y;\\n\\\n    bool usePrev = texCoordExpandAndBatchIndex.z < 0.0;\\n\\\n    float batchTableIndex = texCoordExpandAndBatchIndex.w;\\n\\\n\\n\\\n    vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);\\n\\\n    float width = widthAndShow.x + 0.5;\\n\\\n    float show = widthAndShow.y;\\n\\\n\\n\\\n    if (width < 1.0)\\n\\\n    {\\n\\\n        show = 0.0;\\n\\\n    }\\n\\\n\\n\\\n    vec4 pickColor = batchTable_getPickColor(batchTableIndex);\\n\\\n\\n\\\n    vec4 p, prev, next;\\n\\\n    if (czm_morphTime == 1.0)\\n\\\n    {\\n\\\n        p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\\n\\\n        prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\\n\\\n        next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\\n\\\n    }\\n\\\n    else if (czm_morphTime == 0.0)\\n\\\n    {\\n\\\n        p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\\n\\\n        prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\\n\\\n        next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        p = czm_columbusViewMorph(\\n\\\n                czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\\n\\\n                czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\\n\\\n                czm_morphTime);\\n\\\n        prev = czm_columbusViewMorph(\\n\\\n                czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\\n\\\n                czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\\n\\\n                czm_morphTime);\\n\\\n        next = czm_columbusViewMorph(\\n\\\n                czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\\n\\\n                czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\\n\\\n                czm_morphTime);\\n\\\n    }\\n\\\n\\n\\\n    #ifdef DISTANCE_DISPLAY_CONDITION\\n\\\n        vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);\\n\\\n        vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);\\n\\\n        vec3 centerLow = centerLowAndRadius.xyz;\\n\\\n        float radius = centerLowAndRadius.w;\\n\\\n        vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);\\n\\\n\\n\\\n        float lengthSq;\\n\\\n        if (czm_sceneMode == czm_sceneMode2D)\\n\\\n        {\\n\\\n            lengthSq = czm_eyeHeight2D.y;\\n\\\n        }\\n\\\n        else\\n\\\n        {\\n\\\n            vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);\\n\\\n            lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);\\n\\\n        }\\n\\\n\\n\\\n        float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\\n\\\n        float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\\n\\\n        if (lengthSq < nearSq || lengthSq > farSq)\\n\\\n        {\\n\\\n            show = 0.0;\\n\\\n        }\\n\\\n    #endif\\n\\\n\\n\\\n    float polylineAngle;\\n\\\n    vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);\\n\\\n    gl_Position = czm_viewportOrthographic * positionWC * show;\\n\\\n\\n\\\n    v_st.s = texCoord;\\n\\\n    v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);\\n\\\n\\n\\\n    v_width = width;\\n\\\n    v_pickColor = pickColor;\\n\\\n    v_polylineAngle = polylineAngle;\\n\\\n}\\n\\\n\";\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidGeodesic from \"./EllipsoidGeodesic.js\";\nimport EllipsoidRhumbLine from \"./EllipsoidRhumbLine.js\";\nimport IntersectionTests from \"./IntersectionTests.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Plane from \"./Plane.js\";\n\n/**\n * @private\n */\nconst PolylinePipeline = {};\n\nPolylinePipeline.numberOfPoints = function (p0, p1, minDistance) {\n  const distance = Cartesian3.distance(p0, p1);\n  return Math.ceil(distance / minDistance);\n};\n\nPolylinePipeline.numberOfPointsRhumbLine = function (p0, p1, granularity) {\n  const radiansDistanceSquared =\n    Math.pow(p0.longitude - p1.longitude, 2) +\n    Math.pow(p0.latitude - p1.latitude, 2);\n\n  return Math.max(\n    1,\n    Math.ceil(Math.sqrt(radiansDistanceSquared / (granularity * granularity)))\n  );\n};\n\nconst cartoScratch = new Cartographic();\nPolylinePipeline.extractHeights = function (positions, ellipsoid) {\n  const length = positions.length;\n  const heights = new Array(length);\n  for (let i = 0; i < length; i++) {\n    const p = positions[i];\n    heights[i] = ellipsoid.cartesianToCartographic(p, cartoScratch).height;\n  }\n  return heights;\n};\n\nconst wrapLongitudeInversMatrix = new Matrix4();\nconst wrapLongitudeOrigin = new Cartesian3();\nconst wrapLongitudeXZNormal = new Cartesian3();\nconst wrapLongitudeXZPlane = new Plane(Cartesian3.UNIT_X, 0.0);\nconst wrapLongitudeYZNormal = new Cartesian3();\nconst wrapLongitudeYZPlane = new Plane(Cartesian3.UNIT_X, 0.0);\nconst wrapLongitudeIntersection = new Cartesian3();\nconst wrapLongitudeOffset = new Cartesian3();\n\nconst subdivideHeightsScratchArray = [];\n\nfunction subdivideHeights(numPoints, h0, h1) {\n  const heights = subdivideHeightsScratchArray;\n  heights.length = numPoints;\n\n  let i;\n  if (h0 === h1) {\n    for (i = 0; i < numPoints; i++) {\n      heights[i] = h0;\n    }\n    return heights;\n  }\n\n  const dHeight = h1 - h0;\n  const heightPerVertex = dHeight / numPoints;\n\n  for (i = 0; i < numPoints; i++) {\n    const h = h0 + i * heightPerVertex;\n    heights[i] = h;\n  }\n\n  return heights;\n}\n\nconst carto1 = new Cartographic();\nconst carto2 = new Cartographic();\nconst cartesian = new Cartesian3();\nconst scaleFirst = new Cartesian3();\nconst scaleLast = new Cartesian3();\nconst ellipsoidGeodesic = new EllipsoidGeodesic();\nlet ellipsoidRhumb = new EllipsoidRhumbLine();\n\n//Returns subdivided line scaled to ellipsoid surface starting at p1 and ending at p2.\n//Result includes p1, but not include p2.  This function is called for a sequence of line segments,\n//and this prevents duplication of end point.\nfunction generateCartesianArc(\n  p0,\n  p1,\n  minDistance,\n  ellipsoid,\n  h0,\n  h1,\n  array,\n  offset\n) {\n  const first = ellipsoid.scaleToGeodeticSurface(p0, scaleFirst);\n  const last = ellipsoid.scaleToGeodeticSurface(p1, scaleLast);\n  const numPoints = PolylinePipeline.numberOfPoints(p0, p1, minDistance);\n  const start = ellipsoid.cartesianToCartographic(first, carto1);\n  const end = ellipsoid.cartesianToCartographic(last, carto2);\n  const heights = subdivideHeights(numPoints, h0, h1);\n\n  ellipsoidGeodesic.setEndPoints(start, end);\n  const surfaceDistanceBetweenPoints =\n    ellipsoidGeodesic.surfaceDistance / numPoints;\n\n  let index = offset;\n  start.height = h0;\n  let cart = ellipsoid.cartographicToCartesian(start, cartesian);\n  Cartesian3.pack(cart, array, index);\n  index += 3;\n\n  for (let i = 1; i < numPoints; i++) {\n    const carto = ellipsoidGeodesic.interpolateUsingSurfaceDistance(\n      i * surfaceDistanceBetweenPoints,\n      carto2\n    );\n    carto.height = heights[i];\n    cart = ellipsoid.cartographicToCartesian(carto, cartesian);\n    Cartesian3.pack(cart, array, index);\n    index += 3;\n  }\n\n  return index;\n}\n\n//Returns subdivided line scaled to ellipsoid surface starting at p1 and ending at p2.\n//Result includes p1, but not include p2.  This function is called for a sequence of line segments,\n//and this prevents duplication of end point.\nfunction generateCartesianRhumbArc(\n  p0,\n  p1,\n  granularity,\n  ellipsoid,\n  h0,\n  h1,\n  array,\n  offset\n) {\n  const start = ellipsoid.cartesianToCartographic(p0, carto1);\n  const end = ellipsoid.cartesianToCartographic(p1, carto2);\n  const numPoints = PolylinePipeline.numberOfPointsRhumbLine(\n    start,\n    end,\n    granularity\n  );\n  start.height = 0.0;\n  end.height = 0.0;\n  const heights = subdivideHeights(numPoints, h0, h1);\n\n  if (!ellipsoidRhumb.ellipsoid.equals(ellipsoid)) {\n    ellipsoidRhumb = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);\n  }\n  ellipsoidRhumb.setEndPoints(start, end);\n  const surfaceDistanceBetweenPoints =\n    ellipsoidRhumb.surfaceDistance / numPoints;\n\n  let index = offset;\n  start.height = h0;\n  let cart = ellipsoid.cartographicToCartesian(start, cartesian);\n  Cartesian3.pack(cart, array, index);\n  index += 3;\n\n  for (let i = 1; i < numPoints; i++) {\n    const carto = ellipsoidRhumb.interpolateUsingSurfaceDistance(\n      i * surfaceDistanceBetweenPoints,\n      carto2\n    );\n    carto.height = heights[i];\n    cart = ellipsoid.cartographicToCartesian(carto, cartesian);\n    Cartesian3.pack(cart, array, index);\n    index += 3;\n  }\n\n  return index;\n}\n\n/**\n * Breaks a {@link Polyline} into segments such that it does not cross the &plusmn;180 degree meridian of an ellipsoid.\n *\n * @param {Cartesian3[]} positions The polyline's Cartesian positions.\n * @param {Matrix4} [modelMatrix=Matrix4.IDENTITY] The polyline's model matrix. Assumed to be an affine\n * transformation matrix, where the upper left 3x3 elements are a rotation matrix, and\n * the upper three elements in the fourth column are the translation.  The bottom row is assumed to be [0, 0, 0, 1].\n * The matrix is not verified to be in the proper form.\n * @returns {object} An object with a <code>positions</code> property that is an array of positions and a\n * <code>segments</code> property.\n *\n *\n * @example\n * const polylines = new Cesium.PolylineCollection();\n * const polyline = polylines.add(...);\n * const positions = polyline.positions;\n * const modelMatrix = polylines.modelMatrix;\n * const segments = Cesium.PolylinePipeline.wrapLongitude(positions, modelMatrix);\n *\n * @see PolygonPipeline.wrapLongitude\n * @see Polyline\n * @see PolylineCollection\n */\nPolylinePipeline.wrapLongitude = function (positions, modelMatrix) {\n  const cartesians = [];\n  const segments = [];\n\n  if (defined(positions) && positions.length > 0) {\n    modelMatrix = defaultValue(modelMatrix, Matrix4.IDENTITY);\n    const inverseModelMatrix = Matrix4.inverseTransformation(\n      modelMatrix,\n      wrapLongitudeInversMatrix\n    );\n\n    const origin = Matrix4.multiplyByPoint(\n      inverseModelMatrix,\n      Cartesian3.ZERO,\n      wrapLongitudeOrigin\n    );\n    const xzNormal = Cartesian3.normalize(\n      Matrix4.multiplyByPointAsVector(\n        inverseModelMatrix,\n        Cartesian3.UNIT_Y,\n        wrapLongitudeXZNormal\n      ),\n      wrapLongitudeXZNormal\n    );\n    const xzPlane = Plane.fromPointNormal(\n      origin,\n      xzNormal,\n      wrapLongitudeXZPlane\n    );\n    const yzNormal = Cartesian3.normalize(\n      Matrix4.multiplyByPointAsVector(\n        inverseModelMatrix,\n        Cartesian3.UNIT_X,\n        wrapLongitudeYZNormal\n      ),\n      wrapLongitudeYZNormal\n    );\n    const yzPlane = Plane.fromPointNormal(\n      origin,\n      yzNormal,\n      wrapLongitudeYZPlane\n    );\n\n    let count = 1;\n    cartesians.push(Cartesian3.clone(positions[0]));\n    let prev = cartesians[0];\n\n    const length = positions.length;\n    for (let i = 1; i < length; ++i) {\n      const cur = positions[i];\n\n      // intersects the IDL if either endpoint is on the negative side of the yz-plane\n      if (\n        Plane.getPointDistance(yzPlane, prev) < 0.0 ||\n        Plane.getPointDistance(yzPlane, cur) < 0.0\n      ) {\n        // and intersects the xz-plane\n        const intersection = IntersectionTests.lineSegmentPlane(\n          prev,\n          cur,\n          xzPlane,\n          wrapLongitudeIntersection\n        );\n        if (defined(intersection)) {\n          // move point on the xz-plane slightly away from the plane\n          const offset = Cartesian3.multiplyByScalar(\n            xzNormal,\n            5.0e-9,\n            wrapLongitudeOffset\n          );\n          if (Plane.getPointDistance(xzPlane, prev) < 0.0) {\n            Cartesian3.negate(offset, offset);\n          }\n\n          cartesians.push(\n            Cartesian3.add(intersection, offset, new Cartesian3())\n          );\n          segments.push(count + 1);\n\n          Cartesian3.negate(offset, offset);\n          cartesians.push(\n            Cartesian3.add(intersection, offset, new Cartesian3())\n          );\n          count = 1;\n        }\n      }\n\n      cartesians.push(Cartesian3.clone(positions[i]));\n      count++;\n\n      prev = cur;\n    }\n\n    segments.push(count);\n  }\n\n  return {\n    positions: cartesians,\n    lengths: segments,\n  };\n};\n\n/**\n * Subdivides polyline and raises all points to the specified height.  Returns an array of numbers to represent the positions.\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.\n * @param {number|number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.\n * @param {number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.\n * @returns {number[]} A new array of positions of type {number} that have been subdivided and raised to the surface of the ellipsoid.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromDegreesArray([\n *   -105.0, 40.0,\n *   -100.0, 38.0,\n *   -105.0, 35.0,\n *   -100.0, 32.0\n * ]);\n * const surfacePositions = Cesium.PolylinePipeline.generateArc({\n *   positons: positions\n * });\n */\nPolylinePipeline.generateArc = function (options) {\n  if (!defined(options)) {\n    options = {};\n  }\n  const positions = options.positions;\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(positions)) {\n    throw new DeveloperError(\"options.positions is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const length = positions.length;\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  let height = defaultValue(options.height, 0);\n  const hasHeightArray = Array.isArray(height);\n\n  if (length < 1) {\n    return [];\n  } else if (length === 1) {\n    const p = ellipsoid.scaleToGeodeticSurface(positions[0], scaleFirst);\n    height = hasHeightArray ? height[0] : height;\n    if (height !== 0) {\n      const n = ellipsoid.geodeticSurfaceNormal(p, cartesian);\n      Cartesian3.multiplyByScalar(n, height, n);\n      Cartesian3.add(p, n, p);\n    }\n\n    return [p.x, p.y, p.z];\n  }\n\n  let minDistance = options.minDistance;\n  if (!defined(minDistance)) {\n    const granularity = defaultValue(\n      options.granularity,\n      CesiumMath.RADIANS_PER_DEGREE\n    );\n    minDistance = CesiumMath.chordLength(granularity, ellipsoid.maximumRadius);\n  }\n\n  let numPoints = 0;\n  let i;\n\n  for (i = 0; i < length - 1; i++) {\n    numPoints += PolylinePipeline.numberOfPoints(\n      positions[i],\n      positions[i + 1],\n      minDistance\n    );\n  }\n\n  const arrayLength = (numPoints + 1) * 3;\n  const newPositions = new Array(arrayLength);\n  let offset = 0;\n\n  for (i = 0; i < length - 1; i++) {\n    const p0 = positions[i];\n    const p1 = positions[i + 1];\n\n    const h0 = hasHeightArray ? height[i] : height;\n    const h1 = hasHeightArray ? height[i + 1] : height;\n\n    offset = generateCartesianArc(\n      p0,\n      p1,\n      minDistance,\n      ellipsoid,\n      h0,\n      h1,\n      newPositions,\n      offset\n    );\n  }\n\n  subdivideHeightsScratchArray.length = 0;\n\n  const lastPoint = positions[length - 1];\n  const carto = ellipsoid.cartesianToCartographic(lastPoint, carto1);\n  carto.height = hasHeightArray ? height[length - 1] : height;\n  const cart = ellipsoid.cartographicToCartesian(carto, cartesian);\n  Cartesian3.pack(cart, newPositions, arrayLength - 3);\n\n  return newPositions;\n};\n\nconst scratchCartographic0 = new Cartographic();\nconst scratchCartographic1 = new Cartographic();\n\n/**\n * Subdivides polyline and raises all points to the specified height using Rhumb lines.  Returns an array of numbers to represent the positions.\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.\n * @param {number|number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.\n * @param {number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.\n * @returns {number[]} A new array of positions of type {number} that have been subdivided and raised to the surface of the ellipsoid.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromDegreesArray([\n *   -105.0, 40.0,\n *   -100.0, 38.0,\n *   -105.0, 35.0,\n *   -100.0, 32.0\n * ]);\n * const surfacePositions = Cesium.PolylinePipeline.generateRhumbArc({\n *   positons: positions\n * });\n */\nPolylinePipeline.generateRhumbArc = function (options) {\n  if (!defined(options)) {\n    options = {};\n  }\n  const positions = options.positions;\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(positions)) {\n    throw new DeveloperError(\"options.positions is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const length = positions.length;\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  let height = defaultValue(options.height, 0);\n  const hasHeightArray = Array.isArray(height);\n\n  if (length < 1) {\n    return [];\n  } else if (length === 1) {\n    const p = ellipsoid.scaleToGeodeticSurface(positions[0], scaleFirst);\n    height = hasHeightArray ? height[0] : height;\n    if (height !== 0) {\n      const n = ellipsoid.geodeticSurfaceNormal(p, cartesian);\n      Cartesian3.multiplyByScalar(n, height, n);\n      Cartesian3.add(p, n, p);\n    }\n\n    return [p.x, p.y, p.z];\n  }\n\n  const granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n\n  let numPoints = 0;\n  let i;\n\n  let c0 = ellipsoid.cartesianToCartographic(\n    positions[0],\n    scratchCartographic0\n  );\n  let c1;\n  for (i = 0; i < length - 1; i++) {\n    c1 = ellipsoid.cartesianToCartographic(\n      positions[i + 1],\n      scratchCartographic1\n    );\n    numPoints += PolylinePipeline.numberOfPointsRhumbLine(c0, c1, granularity);\n    c0 = Cartographic.clone(c1, scratchCartographic0);\n  }\n\n  const arrayLength = (numPoints + 1) * 3;\n  const newPositions = new Array(arrayLength);\n  let offset = 0;\n\n  for (i = 0; i < length - 1; i++) {\n    const p0 = positions[i];\n    const p1 = positions[i + 1];\n\n    const h0 = hasHeightArray ? height[i] : height;\n    const h1 = hasHeightArray ? height[i + 1] : height;\n\n    offset = generateCartesianRhumbArc(\n      p0,\n      p1,\n      granularity,\n      ellipsoid,\n      h0,\n      h1,\n      newPositions,\n      offset\n    );\n  }\n\n  subdivideHeightsScratchArray.length = 0;\n\n  const lastPoint = positions[length - 1];\n  const carto = ellipsoid.cartesianToCartographic(lastPoint, carto1);\n  carto.height = hasHeightArray ? height[length - 1] : height;\n  const cart = ellipsoid.cartographicToCartesian(carto, cartesian);\n  Cartesian3.pack(cart, newPositions, arrayLength - 3);\n\n  return newPositions;\n};\n\n/**\n * Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions.\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.\n * @param {number|number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.\n * @param {number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.\n * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromDegreesArray([\n *   -105.0, 40.0,\n *   -100.0, 38.0,\n *   -105.0, 35.0,\n *   -100.0, 32.0\n * ]);\n * const surfacePositions = Cesium.PolylinePipeline.generateCartesianArc({\n *   positons: positions\n * });\n */\nPolylinePipeline.generateCartesianArc = function (options) {\n  const numberArray = PolylinePipeline.generateArc(options);\n  const size = numberArray.length / 3;\n  const newPositions = new Array(size);\n  for (let i = 0; i < size; i++) {\n    newPositions[i] = Cartesian3.unpack(numberArray, i * 3);\n  }\n  return newPositions;\n};\n\n/**\n * Subdivides polyline and raises all points to the specified height using Rhumb Lines. Returns an array of new {Cartesian3} positions.\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.\n * @param {number|number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.\n * @param {number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.\n * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromDegreesArray([\n *   -105.0, 40.0,\n *   -100.0, 38.0,\n *   -105.0, 35.0,\n *   -100.0, 32.0\n * ]);\n * const surfacePositions = Cesium.PolylinePipeline.generateCartesianRhumbArc({\n *   positons: positions\n * });\n */\nPolylinePipeline.generateCartesianRhumbArc = function (options) {\n  const numberArray = PolylinePipeline.generateRhumbArc(options);\n  const size = numberArray.length / 3;\n  const newPositions = new Array(size);\n  for (let i = 0; i < size; i++) {\n    newPositions[i] = Cartesian3.unpack(numberArray, i * 3);\n  }\n  return newPositions;\n};\nexport default PolylinePipeline;\n", "import arrayRemoveDuplicates from \"../Core/arrayRemoveDuplicates.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PolylinePipeline from \"../Core/PolylinePipeline.js\";\nimport Material from \"./Material.js\";\n\n/**\n * <div class=\"notice\">\n * Create this by calling {@link PolylineCollection#add}. Do not call the constructor directly.\n * </div>\n *\n * A renderable polyline.\n *\n * @alias Polyline\n * @internalConstructor\n * @class\n *\n * @privateParam {object} options Object with the following properties:\n * @privateParam {boolean} [options.show=true] <code>true</code> if this polyline will be shown; otherwise, <code>false</code>.\n * @privateParam {number} [options.width=1.0] The width of the polyline in pixels.\n * @privateParam {boolean} [options.loop=false] Whether a line segment will be added between the last and first line positions to make this line a loop.\n * @privateParam {Material} [options.material=Material.ColorType] The material.\n * @privateParam {Cartesian3[]} [options.positions] The positions.\n * @privateParam {object} [options.id] The user-defined object to be returned when this polyline is picked.\n * @privateParam {DistanceDisplayCondition} [options.distanceDisplayCondition] The condition specifying at what distance from the camera that this polyline will be displayed.\n * @privateParam {PolylineCollection} polylineCollection The renderable polyline collection.\n *\n * @see PolylineCollection\n *\n */\nfunction Polyline(options, polylineCollection) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._show = defaultValue(options.show, true);\n  this._width = defaultValue(options.width, 1.0);\n  this._loop = defaultValue(options.loop, false);\n  this._distanceDisplayCondition = options.distanceDisplayCondition;\n\n  this._material = options.material;\n  if (!defined(this._material)) {\n    this._material = Material.fromType(Material.ColorType, {\n      color: new Color(1.0, 1.0, 1.0, 1.0),\n    });\n  }\n\n  let positions = options.positions;\n  if (!defined(positions)) {\n    positions = [];\n  }\n\n  this._positions = positions;\n  this._actualPositions = arrayRemoveDuplicates(\n    positions,\n    Cartesian3.equalsEpsilon\n  );\n\n  if (this._loop && this._actualPositions.length > 2) {\n    if (this._actualPositions === this._positions) {\n      this._actualPositions = positions.slice();\n    }\n    this._actualPositions.push(Cartesian3.clone(this._actualPositions[0]));\n  }\n\n  this._length = this._actualPositions.length;\n  this._id = options.id;\n\n  let modelMatrix;\n  if (defined(polylineCollection)) {\n    modelMatrix = Matrix4.clone(polylineCollection.modelMatrix);\n  }\n\n  this._modelMatrix = modelMatrix;\n  this._segments = PolylinePipeline.wrapLongitude(\n    this._actualPositions,\n    modelMatrix\n  );\n\n  this._actualLength = undefined;\n\n  // eslint-disable-next-line no-use-before-define\n  this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES);\n  this._polylineCollection = polylineCollection;\n  this._dirty = false;\n  this._pickId = undefined;\n  this._boundingVolume = BoundingSphere.fromPoints(this._actualPositions);\n  this._boundingVolumeWC = BoundingSphere.transform(\n    this._boundingVolume,\n    this._modelMatrix\n  );\n  this._boundingVolume2D = new BoundingSphere(); // modified in PolylineCollection\n}\n\nconst POSITION_INDEX = (Polyline.POSITION_INDEX = 0);\nconst SHOW_INDEX = (Polyline.SHOW_INDEX = 1);\nconst WIDTH_INDEX = (Polyline.WIDTH_INDEX = 2);\nconst MATERIAL_INDEX = (Polyline.MATERIAL_INDEX = 3);\nconst POSITION_SIZE_INDEX = (Polyline.POSITION_SIZE_INDEX = 4);\nconst DISTANCE_DISPLAY_CONDITION = (Polyline.DISTANCE_DISPLAY_CONDITION = 5);\nconst NUMBER_OF_PROPERTIES = (Polyline.NUMBER_OF_PROPERTIES = 6);\n\nfunction makeDirty(polyline, propertyChanged) {\n  ++polyline._propertiesChanged[propertyChanged];\n  const polylineCollection = polyline._polylineCollection;\n  if (defined(polylineCollection)) {\n    polylineCollection._updatePolyline(polyline, propertyChanged);\n    polyline._dirty = true;\n  }\n}\n\nObject.defineProperties(Polyline.prototype, {\n  /**\n   * Determines if this polyline will be shown.  Use this to hide or show a polyline, instead\n   * of removing it and re-adding it to the collection.\n   * @memberof Polyline.prototype\n   * @type {boolean}\n   */\n  show: {\n    get: function () {\n      return this._show;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (value !== this._show) {\n        this._show = value;\n        makeDirty(this, SHOW_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the positions of the polyline.\n   * @memberof Polyline.prototype\n   * @type {Cartesian3[]}\n   * @example\n   * polyline.positions = Cesium.Cartesian3.fromDegreesArray([\n   *     0.0, 0.0,\n   *     10.0, 0.0,\n   *     0.0, 20.0\n   * ]);\n   */\n  positions: {\n    get: function () {\n      return this._positions;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      let positions = arrayRemoveDuplicates(value, Cartesian3.equalsEpsilon);\n\n      if (this._loop && positions.length > 2) {\n        if (positions === value) {\n          positions = value.slice();\n        }\n        positions.push(Cartesian3.clone(positions[0]));\n      }\n\n      if (\n        this._actualPositions.length !== positions.length ||\n        this._actualPositions.length !== this._length\n      ) {\n        makeDirty(this, POSITION_SIZE_INDEX);\n      }\n\n      this._positions = value;\n      this._actualPositions = positions;\n      this._length = positions.length;\n      this._boundingVolume = BoundingSphere.fromPoints(\n        this._actualPositions,\n        this._boundingVolume\n      );\n      this._boundingVolumeWC = BoundingSphere.transform(\n        this._boundingVolume,\n        this._modelMatrix,\n        this._boundingVolumeWC\n      );\n      makeDirty(this, POSITION_INDEX);\n\n      this.update();\n    },\n  },\n\n  /**\n   * Gets or sets the surface appearance of the polyline.  This can be one of several built-in {@link Material} objects or a custom material, scripted with\n   * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.\n   * @memberof Polyline.prototype\n   * @type {Material}\n   */\n  material: {\n    get: function () {\n      return this._material;\n    },\n    set: function (material) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(material)) {\n        throw new DeveloperError(\"material is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (this._material !== material) {\n        this._material = material;\n        makeDirty(this, MATERIAL_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the width of the polyline.\n   * @memberof Polyline.prototype\n   * @type {number}\n   */\n  width: {\n    get: function () {\n      return this._width;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug)\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      const width = this._width;\n      if (value !== width) {\n        this._width = value;\n        makeDirty(this, WIDTH_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets whether a line segment will be added between the first and last polyline positions.\n   * @memberof Polyline.prototype\n   * @type {boolean}\n   */\n  loop: {\n    get: function () {\n      return this._loop;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug)\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (value !== this._loop) {\n        let positions = this._actualPositions;\n        if (value) {\n          if (\n            positions.length > 2 &&\n            !Cartesian3.equals(positions[0], positions[positions.length - 1])\n          ) {\n            if (positions.length === this._positions.length) {\n              this._actualPositions = positions = this._positions.slice();\n            }\n            positions.push(Cartesian3.clone(positions[0]));\n          }\n        } else if (\n          positions.length > 2 &&\n          Cartesian3.equals(positions[0], positions[positions.length - 1])\n        ) {\n          if (positions.length - 1 === this._positions.length) {\n            this._actualPositions = this._positions;\n          } else {\n            positions.pop();\n          }\n        }\n\n        this._loop = value;\n        makeDirty(this, POSITION_SIZE_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the user-defined value returned when the polyline is picked.\n   * @memberof Polyline.prototype\n   * @type {*}\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n    set: function (value) {\n      this._id = value;\n      if (defined(this._pickId)) {\n        this._pickId.object.id = value;\n      }\n    },\n  },\n\n  /**\n   * @private\n   */\n  pickId: {\n    get: function () {\n      return this._pickId;\n    },\n  },\n\n  /**\n   * Gets the destruction status of this polyline\n   * @memberof Polyline.prototype\n   * @type {boolean}\n   * @default false\n   * @private\n   */\n  isDestroyed: {\n    get: function () {\n      return !defined(this._polylineCollection);\n    },\n  },\n\n  /**\n   * Gets or sets the condition specifying at what distance from the camera that this polyline will be displayed.\n   * @memberof Polyline.prototype\n   * @type {DistanceDisplayCondition}\n   * @default undefined\n   */\n  distanceDisplayCondition: {\n    get: function () {\n      return this._distanceDisplayCondition;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value) && value.far <= value.near) {\n        throw new DeveloperError(\n          \"far distance must be greater than near distance.\"\n        );\n      }\n      //>>includeEnd('debug');\n      if (\n        !DistanceDisplayCondition.equals(value, this._distanceDisplayCondition)\n      ) {\n        this._distanceDisplayCondition = DistanceDisplayCondition.clone(\n          value,\n          this._distanceDisplayCondition\n        );\n        makeDirty(this, DISTANCE_DISPLAY_CONDITION);\n      }\n    },\n  },\n});\n\n/**\n * @private\n */\nPolyline.prototype.update = function () {\n  let modelMatrix = Matrix4.IDENTITY;\n  if (defined(this._polylineCollection)) {\n    modelMatrix = this._polylineCollection.modelMatrix;\n  }\n\n  const segmentPositionsLength = this._segments.positions.length;\n  const segmentLengths = this._segments.lengths;\n\n  const positionsChanged =\n    this._propertiesChanged[POSITION_INDEX] > 0 ||\n    this._propertiesChanged[POSITION_SIZE_INDEX] > 0;\n  if (!Matrix4.equals(modelMatrix, this._modelMatrix) || positionsChanged) {\n    this._segments = PolylinePipeline.wrapLongitude(\n      this._actualPositions,\n      modelMatrix\n    );\n    this._boundingVolumeWC = BoundingSphere.transform(\n      this._boundingVolume,\n      modelMatrix,\n      this._boundingVolumeWC\n    );\n  }\n\n  this._modelMatrix = Matrix4.clone(modelMatrix, this._modelMatrix);\n\n  if (this._segments.positions.length !== segmentPositionsLength) {\n    // number of positions changed\n    makeDirty(this, POSITION_SIZE_INDEX);\n  } else {\n    const length = segmentLengths.length;\n    for (let i = 0; i < length; ++i) {\n      if (segmentLengths[i] !== this._segments.lengths[i]) {\n        // indices changed\n        makeDirty(this, POSITION_SIZE_INDEX);\n        break;\n      }\n    }\n  }\n};\n\n/**\n * @private\n */\nPolyline.prototype.getPickId = function (context) {\n  if (!defined(this._pickId)) {\n    this._pickId = context.createPickId({\n      primitive: this,\n      collection: this._polylineCollection,\n      id: this._id,\n    });\n  }\n  return this._pickId;\n};\n\nPolyline.prototype._clean = function () {\n  this._dirty = false;\n  const properties = this._propertiesChanged;\n  for (let k = 0; k < NUMBER_OF_PROPERTIES - 1; ++k) {\n    properties[k] = 0;\n  }\n};\n\nPolyline.prototype._destroy = function () {\n  this._pickId = this._pickId && this._pickId.destroy();\n  this._material = this._material && this._material.destroy();\n  this._polylineCollection = undefined;\n};\nexport default Polyline;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Color from \"../Core/Color.js\";\nimport combine from \"../Core/combine.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EncodedCartesian3 from \"../Core/EncodedCartesian3.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Plane from \"../Core/Plane.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport PolylineCommon from \"../Shaders/PolylineCommon.js\";\nimport PolylineFS from \"../Shaders/PolylineFS.js\";\nimport PolylineVS from \"../Shaders/PolylineVS.js\";\nimport BatchTable from \"./BatchTable.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport Material from \"./Material.js\";\nimport Polyline from \"./Polyline.js\";\nimport SceneMode from \"./SceneMode.js\";\n\nconst SHOW_INDEX = Polyline.SHOW_INDEX;\nconst WIDTH_INDEX = Polyline.WIDTH_INDEX;\nconst POSITION_INDEX = Polyline.POSITION_INDEX;\nconst MATERIAL_INDEX = Polyline.MATERIAL_INDEX;\n//POSITION_SIZE_INDEX is needed for when the polyline's position array changes size.\n//When it does, we need to recreate the indicesBuffer.\nconst POSITION_SIZE_INDEX = Polyline.POSITION_SIZE_INDEX;\nconst DISTANCE_DISPLAY_CONDITION = Polyline.DISTANCE_DISPLAY_CONDITION;\nconst NUMBER_OF_PROPERTIES = Polyline.NUMBER_OF_PROPERTIES;\n\nconst attributeLocations = {\n  texCoordExpandAndBatchIndex: 0,\n  position3DHigh: 1,\n  position3DLow: 2,\n  position2DHigh: 3,\n  position2DLow: 4,\n  prevPosition3DHigh: 5,\n  prevPosition3DLow: 6,\n  prevPosition2DHigh: 7,\n  prevPosition2DLow: 8,\n  nextPosition3DHigh: 9,\n  nextPosition3DLow: 10,\n  nextPosition2DHigh: 11,\n  nextPosition2DLow: 12,\n};\n\n/**\n * A renderable collection of polylines.\n * <br /><br />\n * <div align=\"center\">\n * <img src=\"Images/Polyline.png\" width=\"400\" height=\"300\" /><br />\n * Example polylines\n * </div>\n * <br /><br />\n * Polylines are added and removed from the collection using {@link PolylineCollection#add}\n * and {@link PolylineCollection#remove}.\n *\n * @alias PolylineCollection\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each polyline from model to world coordinates.\n * @param {boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {boolean} [options.show=true] Determines if the polylines in the collection will be shown.\n *\n * @performance For best performance, prefer a few collections, each with many polylines, to\n * many collections with only a few polylines each.  Organize collections so that polylines\n * with the same update frequency are in the same collection, i.e., polylines that do not\n * change should be in one collection; polylines that change every frame should be in another\n * collection; and so on.\n *\n * @see PolylineCollection#add\n * @see PolylineCollection#remove\n * @see Polyline\n * @see LabelCollection\n *\n * @example\n * // Create a polyline collection with two polylines\n * const polylines = new Cesium.PolylineCollection();\n * polylines.add({\n *   positions : Cesium.Cartesian3.fromDegreesArray([\n *     -75.10, 39.57,\n *     -77.02, 38.53,\n *     -80.50, 35.14,\n *     -80.12, 25.46]),\n *   width : 2\n * });\n *\n * polylines.add({\n *   positions : Cesium.Cartesian3.fromDegreesArray([\n *     -73.10, 37.57,\n *     -75.02, 36.53,\n *     -78.50, 33.14,\n *     -78.12, 23.46]),\n *   width : 4\n * });\n */\nfunction PolylineCollection(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * Determines if polylines in this collection will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  /**\n   * The 4x4 transformation matrix that transforms each polyline in this collection from model to world coordinates.\n   * When this is the identity matrix, the polylines are drawn in world coordinates, i.e., Earth's WGS84 coordinates.\n   * Local reference frames can be used by providing a different transformation matrix, like that returned\n   * by {@link Transforms.eastNorthUpToFixedFrame}.\n   *\n   * @type {Matrix4}\n   * @default {@link Matrix4.IDENTITY}\n   */\n  this.modelMatrix = Matrix4.clone(\n    defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n  );\n  this._modelMatrix = Matrix4.clone(Matrix4.IDENTITY);\n\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the bounding sphere for each draw command in the primitive.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowBoundingVolume = defaultValue(\n    options.debugShowBoundingVolume,\n    false\n  );\n\n  this._opaqueRS = undefined;\n  this._translucentRS = undefined;\n\n  this._colorCommands = [];\n\n  this._polylinesUpdated = false;\n  this._polylinesRemoved = false;\n  this._createVertexArray = false;\n  this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES);\n  this._polylines = [];\n  this._polylineBuckets = {};\n\n  // The buffer usage is determined based on the usage of the attribute over time.\n  this._positionBufferUsage = {\n    bufferUsage: BufferUsage.STATIC_DRAW,\n    frameCount: 0,\n  };\n\n  this._mode = undefined;\n\n  this._polylinesToUpdate = [];\n  this._vertexArrays = [];\n  this._positionBuffer = undefined;\n  this._texCoordExpandAndBatchIndexBuffer = undefined;\n\n  this._batchTable = undefined;\n  this._createBatchTable = false;\n\n  // Only used by Vector3DTilePoints\n  this._useHighlightColor = false;\n  this._highlightColor = Color.clone(Color.WHITE);\n\n  const that = this;\n  this._uniformMap = {\n    u_highlightColor: function () {\n      return that._highlightColor;\n    },\n  };\n}\n\nObject.defineProperties(PolylineCollection.prototype, {\n  /**\n   * Returns the number of polylines in this collection.  This is commonly used with\n   * {@link PolylineCollection#get} to iterate over all the polylines\n   * in the collection.\n   * @memberof PolylineCollection.prototype\n   * @type {number}\n   */\n  length: {\n    get: function () {\n      removePolylines(this);\n      return this._polylines.length;\n    },\n  },\n});\n\n/**\n     * Creates and adds a polyline with the specified initial properties to the collection.\n     * The added polyline is returned so it can be modified or removed from the collection later.\n     *\n     * @param {object}[options] A template describing the polyline's properties as shown in Example 1.\n     * @returns {Polyline} The polyline that was added to the collection.\n     *\n     * @performance After calling <code>add</code>, {@link PolylineCollection#update} is called and\n     * the collection's vertex buffer is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead.\n     * For best performance, add as many polylines as possible before calling <code>update</code>.\n     *\n     * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n     *\n     *\n     * @example\n     * // Example 1:  Add a polyline, specifying all the default values.\n     * const p = polylines.add({\n     *   show : true,\n     *   positions : ellipsoid.cartographicArrayToCartesianArray([\n           Cesium.Cartographic.fromDegrees(-75.10, 39.57),\n           Cesium.Cartographic.fromDegrees(-77.02, 38.53)]),\n     *   width : 1\n     * });\n     *\n     * @see PolylineCollection#remove\n     * @see PolylineCollection#removeAll\n     * @see PolylineCollection#update\n     */\nPolylineCollection.prototype.add = function (options) {\n  const p = new Polyline(options, this);\n  p._index = this._polylines.length;\n  this._polylines.push(p);\n  this._createVertexArray = true;\n  this._createBatchTable = true;\n  return p;\n};\n\n/**\n * Removes a polyline from the collection.\n *\n * @param {Polyline} polyline The polyline to remove.\n * @returns {boolean} <code>true</code> if the polyline was removed; <code>false</code> if the polyline was not found in the collection.\n *\n * @performance After calling <code>remove</code>, {@link PolylineCollection#update} is called and\n * the collection's vertex buffer is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead.\n * For best performance, remove as many polylines as possible before calling <code>update</code>.\n * If you intend to temporarily hide a polyline, it is usually more efficient to call\n * {@link Polyline#show} instead of removing and re-adding the polyline.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * const p = polylines.add(...);\n * polylines.remove(p);  // Returns true\n *\n * @see PolylineCollection#add\n * @see PolylineCollection#removeAll\n * @see PolylineCollection#update\n * @see Polyline#show\n */\nPolylineCollection.prototype.remove = function (polyline) {\n  if (this.contains(polyline)) {\n    this._polylinesRemoved = true;\n    this._createVertexArray = true;\n    this._createBatchTable = true;\n    if (defined(polyline._bucket)) {\n      const bucket = polyline._bucket;\n      bucket.shaderProgram =\n        bucket.shaderProgram && bucket.shaderProgram.destroy();\n    }\n    polyline._destroy();\n    return true;\n  }\n\n  return false;\n};\n\n/**\n * Removes all polylines from the collection.\n *\n * @performance <code>O(n)</code>.  It is more efficient to remove all the polylines\n * from a collection and then add new ones than to create a new collection entirely.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * polylines.add(...);\n * polylines.add(...);\n * polylines.removeAll();\n *\n * @see PolylineCollection#add\n * @see PolylineCollection#remove\n * @see PolylineCollection#update\n */\nPolylineCollection.prototype.removeAll = function () {\n  releaseShaders(this);\n  destroyPolylines(this);\n  this._polylineBuckets = {};\n  this._polylinesRemoved = false;\n  this._polylines.length = 0;\n  this._polylinesToUpdate.length = 0;\n  this._createVertexArray = true;\n};\n\n/**\n * Determines if this collection contains the specified polyline.\n *\n * @param {Polyline} polyline The polyline to check for.\n * @returns {boolean} true if this collection contains the polyline, false otherwise.\n *\n * @see PolylineCollection#get\n */\nPolylineCollection.prototype.contains = function (polyline) {\n  return defined(polyline) && polyline._polylineCollection === this;\n};\n\n/**\n * Returns the polyline in the collection at the specified index.  Indices are zero-based\n * and increase as polylines are added.  Removing a polyline shifts all polylines after\n * it to the left, changing their indices.  This function is commonly used with\n * {@link PolylineCollection#length} to iterate over all the polylines\n * in the collection.\n *\n * @param {number} index The zero-based index of the polyline.\n * @returns {Polyline} The polyline at the specified index.\n *\n * @performance If polylines were removed from the collection and\n * {@link PolylineCollection#update} was not called, an implicit <code>O(n)</code>\n * operation is performed.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * // Toggle the show property of every polyline in the collection\n * const len = polylines.length;\n * for (let i = 0; i < len; ++i) {\n *   const p = polylines.get(i);\n *   p.show = !p.show;\n * }\n *\n * @see PolylineCollection#length\n */\nPolylineCollection.prototype.get = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(index)) {\n    throw new DeveloperError(\"index is required.\");\n  }\n  //>>includeEnd('debug');\n\n  removePolylines(this);\n  return this._polylines[index];\n};\n\nfunction createBatchTable(collection, context) {\n  if (defined(collection._batchTable)) {\n    collection._batchTable.destroy();\n  }\n\n  const attributes = [\n    {\n      functionName: \"batchTable_getWidthAndShow\",\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 2,\n    },\n    {\n      functionName: \"batchTable_getPickColor\",\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 4,\n      normalize: true,\n    },\n    {\n      functionName: \"batchTable_getCenterHigh\",\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n    },\n    {\n      functionName: \"batchTable_getCenterLowAndRadius\",\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 4,\n    },\n    {\n      functionName: \"batchTable_getDistanceDisplayCondition\",\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n    },\n  ];\n\n  collection._batchTable = new BatchTable(\n    context,\n    attributes,\n    collection._polylines.length\n  );\n}\n\nconst scratchUpdatePolylineEncodedCartesian = new EncodedCartesian3();\nconst scratchUpdatePolylineCartesian4 = new Cartesian4();\nconst scratchNearFarCartesian2 = new Cartesian2();\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly.  This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {RuntimeError} Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.\n */\nPolylineCollection.prototype.update = function (frameState) {\n  removePolylines(this);\n\n  if (this._polylines.length === 0 || !this.show) {\n    return;\n  }\n\n  updateMode(this, frameState);\n\n  const context = frameState.context;\n  const projection = frameState.mapProjection;\n  let polyline;\n  let properties = this._propertiesChanged;\n\n  if (this._createBatchTable) {\n    if (ContextLimits.maximumVertexTextureImageUnits === 0) {\n      throw new RuntimeError(\n        \"Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.\"\n      );\n    }\n    createBatchTable(this, context);\n    this._createBatchTable = false;\n  }\n\n  if (this._createVertexArray || computeNewBuffersUsage(this)) {\n    createVertexArrays(this, context, projection);\n  } else if (this._polylinesUpdated) {\n    // Polylines were modified, but no polylines were added or removed.\n    const polylinesToUpdate = this._polylinesToUpdate;\n    if (this._mode !== SceneMode.SCENE3D) {\n      const updateLength = polylinesToUpdate.length;\n      for (let i = 0; i < updateLength; ++i) {\n        polyline = polylinesToUpdate[i];\n        polyline.update();\n      }\n    }\n\n    // if a polyline's positions size changes, we need to recreate the vertex arrays and vertex buffers because the indices will be different.\n    // if a polyline's material changes, we need to recreate the VAOs and VBOs because they will be batched differently.\n    if (properties[POSITION_SIZE_INDEX] || properties[MATERIAL_INDEX]) {\n      createVertexArrays(this, context, projection);\n    } else {\n      const length = polylinesToUpdate.length;\n      const polylineBuckets = this._polylineBuckets;\n      for (let ii = 0; ii < length; ++ii) {\n        polyline = polylinesToUpdate[ii];\n        properties = polyline._propertiesChanged;\n        const bucket = polyline._bucket;\n        let index = 0;\n        for (const x in polylineBuckets) {\n          if (polylineBuckets.hasOwnProperty(x)) {\n            if (polylineBuckets[x] === bucket) {\n              if (properties[POSITION_INDEX]) {\n                bucket.writeUpdate(\n                  index,\n                  polyline,\n                  this._positionBuffer,\n                  projection\n                );\n              }\n              break;\n            }\n            index += polylineBuckets[x].lengthOfPositions;\n          }\n        }\n\n        if (properties[SHOW_INDEX] || properties[WIDTH_INDEX]) {\n          this._batchTable.setBatchedAttribute(\n            polyline._index,\n            0,\n            new Cartesian2(polyline._width, polyline._show)\n          );\n        }\n\n        if (this._batchTable.attributes.length > 2) {\n          if (properties[POSITION_INDEX] || properties[POSITION_SIZE_INDEX]) {\n            const boundingSphere =\n              frameState.mode === SceneMode.SCENE2D\n                ? polyline._boundingVolume2D\n                : polyline._boundingVolumeWC;\n            const encodedCenter = EncodedCartesian3.fromCartesian(\n              boundingSphere.center,\n              scratchUpdatePolylineEncodedCartesian\n            );\n            const low = Cartesian4.fromElements(\n              encodedCenter.low.x,\n              encodedCenter.low.y,\n              encodedCenter.low.z,\n              boundingSphere.radius,\n              scratchUpdatePolylineCartesian4\n            );\n            this._batchTable.setBatchedAttribute(\n              polyline._index,\n              2,\n              encodedCenter.high\n            );\n            this._batchTable.setBatchedAttribute(polyline._index, 3, low);\n          }\n\n          if (properties[DISTANCE_DISPLAY_CONDITION]) {\n            const nearFarCartesian = scratchNearFarCartesian2;\n            nearFarCartesian.x = 0.0;\n            nearFarCartesian.y = Number.MAX_VALUE;\n\n            const distanceDisplayCondition = polyline.distanceDisplayCondition;\n            if (defined(distanceDisplayCondition)) {\n              nearFarCartesian.x = distanceDisplayCondition.near;\n              nearFarCartesian.y = distanceDisplayCondition.far;\n            }\n\n            this._batchTable.setBatchedAttribute(\n              polyline._index,\n              4,\n              nearFarCartesian\n            );\n          }\n        }\n\n        polyline._clean();\n      }\n    }\n    polylinesToUpdate.length = 0;\n    this._polylinesUpdated = false;\n  }\n\n  properties = this._propertiesChanged;\n  for (let k = 0; k < NUMBER_OF_PROPERTIES; ++k) {\n    properties[k] = 0;\n  }\n\n  let modelMatrix = Matrix4.IDENTITY;\n  if (frameState.mode === SceneMode.SCENE3D) {\n    modelMatrix = this.modelMatrix;\n  }\n\n  const pass = frameState.passes;\n  const useDepthTest = frameState.morphTime !== 0.0;\n\n  if (\n    !defined(this._opaqueRS) ||\n    this._opaqueRS.depthTest.enabled !== useDepthTest\n  ) {\n    this._opaqueRS = RenderState.fromCache({\n      depthMask: useDepthTest,\n      depthTest: {\n        enabled: useDepthTest,\n      },\n    });\n  }\n\n  if (\n    !defined(this._translucentRS) ||\n    this._translucentRS.depthTest.enabled !== useDepthTest\n  ) {\n    this._translucentRS = RenderState.fromCache({\n      blending: BlendingState.ALPHA_BLEND,\n      depthMask: !useDepthTest,\n      depthTest: {\n        enabled: useDepthTest,\n      },\n    });\n  }\n\n  this._batchTable.update(frameState);\n\n  if (pass.render || pass.pick) {\n    const colorList = this._colorCommands;\n    createCommandLists(this, frameState, colorList, modelMatrix);\n  }\n};\n\nconst boundingSphereScratch = new BoundingSphere();\nconst boundingSphereScratch2 = new BoundingSphere();\n\nfunction createCommandLists(\n  polylineCollection,\n  frameState,\n  commands,\n  modelMatrix\n) {\n  const context = frameState.context;\n  const commandList = frameState.commandList;\n\n  const commandsLength = commands.length;\n  let commandIndex = 0;\n  let cloneBoundingSphere = true;\n\n  const vertexArrays = polylineCollection._vertexArrays;\n  const debugShowBoundingVolume = polylineCollection.debugShowBoundingVolume;\n\n  const batchTable = polylineCollection._batchTable;\n  const uniformCallback = batchTable.getUniformMapCallback();\n\n  const length = vertexArrays.length;\n  for (let m = 0; m < length; ++m) {\n    const va = vertexArrays[m];\n    const buckets = va.buckets;\n    const bucketLength = buckets.length;\n\n    for (let n = 0; n < bucketLength; ++n) {\n      const bucketLocator = buckets[n];\n\n      let offset = bucketLocator.offset;\n      const sp = bucketLocator.bucket.shaderProgram;\n\n      const polylines = bucketLocator.bucket.polylines;\n      const polylineLength = polylines.length;\n      let currentId;\n      let currentMaterial;\n      let count = 0;\n      let command;\n      let uniformMap;\n\n      for (let s = 0; s < polylineLength; ++s) {\n        const polyline = polylines[s];\n        const mId = createMaterialId(polyline._material);\n        if (mId !== currentId) {\n          if (defined(currentId) && count > 0) {\n            const translucent = currentMaterial.isTranslucent();\n\n            if (commandIndex >= commandsLength) {\n              command = new DrawCommand({\n                owner: polylineCollection,\n              });\n              commands.push(command);\n            } else {\n              command = commands[commandIndex];\n            }\n\n            ++commandIndex;\n\n            uniformMap = combine(\n              uniformCallback(currentMaterial._uniforms),\n              polylineCollection._uniformMap\n            );\n\n            command.boundingVolume = BoundingSphere.clone(\n              boundingSphereScratch,\n              command.boundingVolume\n            );\n            command.modelMatrix = modelMatrix;\n            command.shaderProgram = sp;\n            command.vertexArray = va.va;\n            command.renderState = translucent\n              ? polylineCollection._translucentRS\n              : polylineCollection._opaqueRS;\n            command.pass = translucent ? Pass.TRANSLUCENT : Pass.OPAQUE;\n            command.debugShowBoundingVolume = debugShowBoundingVolume;\n            command.pickId = \"v_pickColor\";\n\n            command.uniformMap = uniformMap;\n            command.count = count;\n            command.offset = offset;\n\n            offset += count;\n            count = 0;\n            cloneBoundingSphere = true;\n\n            commandList.push(command);\n          }\n\n          currentMaterial = polyline._material;\n          currentMaterial.update(context);\n          currentId = mId;\n        }\n\n        const locators = polyline._locatorBuckets;\n        const locatorLength = locators.length;\n        for (let t = 0; t < locatorLength; ++t) {\n          const locator = locators[t];\n          if (locator.locator === bucketLocator) {\n            count += locator.count;\n          }\n        }\n\n        let boundingVolume;\n        if (frameState.mode === SceneMode.SCENE3D) {\n          boundingVolume = polyline._boundingVolumeWC;\n        } else if (frameState.mode === SceneMode.COLUMBUS_VIEW) {\n          boundingVolume = polyline._boundingVolume2D;\n        } else if (frameState.mode === SceneMode.SCENE2D) {\n          if (defined(polyline._boundingVolume2D)) {\n            boundingVolume = BoundingSphere.clone(\n              polyline._boundingVolume2D,\n              boundingSphereScratch2\n            );\n            boundingVolume.center.x = 0.0;\n          }\n        } else if (\n          defined(polyline._boundingVolumeWC) &&\n          defined(polyline._boundingVolume2D)\n        ) {\n          boundingVolume = BoundingSphere.union(\n            polyline._boundingVolumeWC,\n            polyline._boundingVolume2D,\n            boundingSphereScratch2\n          );\n        }\n\n        if (cloneBoundingSphere) {\n          cloneBoundingSphere = false;\n          BoundingSphere.clone(boundingVolume, boundingSphereScratch);\n        } else {\n          BoundingSphere.union(\n            boundingVolume,\n            boundingSphereScratch,\n            boundingSphereScratch\n          );\n        }\n      }\n\n      if (defined(currentId) && count > 0) {\n        if (commandIndex >= commandsLength) {\n          command = new DrawCommand({\n            owner: polylineCollection,\n          });\n          commands.push(command);\n        } else {\n          command = commands[commandIndex];\n        }\n\n        ++commandIndex;\n\n        uniformMap = combine(\n          uniformCallback(currentMaterial._uniforms),\n          polylineCollection._uniformMap\n        );\n\n        command.boundingVolume = BoundingSphere.clone(\n          boundingSphereScratch,\n          command.boundingVolume\n        );\n        command.modelMatrix = modelMatrix;\n        command.shaderProgram = sp;\n        command.vertexArray = va.va;\n        command.renderState = currentMaterial.isTranslucent()\n          ? polylineCollection._translucentRS\n          : polylineCollection._opaqueRS;\n        command.pass = currentMaterial.isTranslucent()\n          ? Pass.TRANSLUCENT\n          : Pass.OPAQUE;\n        command.debugShowBoundingVolume = debugShowBoundingVolume;\n        command.pickId = \"v_pickColor\";\n\n        command.uniformMap = uniformMap;\n        command.count = count;\n        command.offset = offset;\n\n        cloneBoundingSphere = true;\n\n        commandList.push(command);\n      }\n\n      currentId = undefined;\n    }\n  }\n\n  commands.length = commandIndex;\n}\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see PolylineCollection#destroy\n */\nPolylineCollection.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * polylines = polylines && polylines.destroy();\n *\n * @see PolylineCollection#isDestroyed\n */\nPolylineCollection.prototype.destroy = function () {\n  destroyVertexArrays(this);\n  releaseShaders(this);\n  destroyPolylines(this);\n  this._batchTable = this._batchTable && this._batchTable.destroy();\n  return destroyObject(this);\n};\n\nfunction computeNewBuffersUsage(collection) {\n  let usageChanged = false;\n  const properties = collection._propertiesChanged;\n  const bufferUsage = collection._positionBufferUsage;\n  if (properties[POSITION_INDEX]) {\n    if (bufferUsage.bufferUsage !== BufferUsage.STREAM_DRAW) {\n      usageChanged = true;\n      bufferUsage.bufferUsage = BufferUsage.STREAM_DRAW;\n      bufferUsage.frameCount = 100;\n    } else {\n      bufferUsage.frameCount = 100;\n    }\n  } else if (bufferUsage.bufferUsage !== BufferUsage.STATIC_DRAW) {\n    if (bufferUsage.frameCount === 0) {\n      usageChanged = true;\n      bufferUsage.bufferUsage = BufferUsage.STATIC_DRAW;\n    } else {\n      bufferUsage.frameCount--;\n    }\n  }\n\n  return usageChanged;\n}\n\nconst emptyVertexBuffer = [0.0, 0.0, 0.0];\n\nfunction createVertexArrays(collection, context, projection) {\n  collection._createVertexArray = false;\n  releaseShaders(collection);\n  destroyVertexArrays(collection);\n  sortPolylinesIntoBuckets(collection);\n\n  //stores all of the individual indices arrays.\n  const totalIndices = [[]];\n  let indices = totalIndices[0];\n\n  const batchTable = collection._batchTable;\n  const useHighlightColor = collection._useHighlightColor;\n\n  //used to determine the vertexBuffer offset if the indicesArray goes over 64k.\n  //if it's the same polyline while it goes over 64k, the offset needs to backtrack componentsPerAttribute * componentDatatype bytes\n  //so that the polyline looks contiguous.\n  //if the polyline ends at the 64k mark, then the offset is just 64k * componentsPerAttribute * componentDatatype\n  const vertexBufferOffset = [0];\n  let offset = 0;\n  const vertexArrayBuckets = [[]];\n  let totalLength = 0;\n  const polylineBuckets = collection._polylineBuckets;\n  let x;\n  let bucket;\n  for (x in polylineBuckets) {\n    if (polylineBuckets.hasOwnProperty(x)) {\n      bucket = polylineBuckets[x];\n      bucket.updateShader(context, batchTable, useHighlightColor);\n      totalLength += bucket.lengthOfPositions;\n    }\n  }\n\n  if (totalLength > 0) {\n    const mode = collection._mode;\n\n    const positionArray = new Float32Array(6 * totalLength * 3);\n    const texCoordExpandAndBatchIndexArray = new Float32Array(totalLength * 4);\n    let position3DArray;\n\n    let positionIndex = 0;\n    let colorIndex = 0;\n    let texCoordExpandAndBatchIndexIndex = 0;\n    for (x in polylineBuckets) {\n      if (polylineBuckets.hasOwnProperty(x)) {\n        bucket = polylineBuckets[x];\n        bucket.write(\n          positionArray,\n          texCoordExpandAndBatchIndexArray,\n          positionIndex,\n          colorIndex,\n          texCoordExpandAndBatchIndexIndex,\n          batchTable,\n          context,\n          projection\n        );\n\n        if (mode === SceneMode.MORPHING) {\n          if (!defined(position3DArray)) {\n            position3DArray = new Float32Array(6 * totalLength * 3);\n          }\n          bucket.writeForMorph(position3DArray, positionIndex);\n        }\n\n        const bucketLength = bucket.lengthOfPositions;\n        positionIndex += 6 * bucketLength * 3;\n        colorIndex += bucketLength * 4;\n        texCoordExpandAndBatchIndexIndex += bucketLength * 4;\n        offset = bucket.updateIndices(\n          totalIndices,\n          vertexBufferOffset,\n          vertexArrayBuckets,\n          offset\n        );\n      }\n    }\n\n    const positionBufferUsage = collection._positionBufferUsage.bufferUsage;\n    const texCoordExpandAndBatchIndexBufferUsage = BufferUsage.STATIC_DRAW;\n\n    collection._positionBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: positionArray,\n      usage: positionBufferUsage,\n    });\n    let position3DBuffer;\n    if (defined(position3DArray)) {\n      position3DBuffer = Buffer.createVertexBuffer({\n        context: context,\n        typedArray: position3DArray,\n        usage: positionBufferUsage,\n      });\n    }\n    collection._texCoordExpandAndBatchIndexBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: texCoordExpandAndBatchIndexArray,\n      usage: texCoordExpandAndBatchIndexBufferUsage,\n    });\n\n    const positionSizeInBytes = 3 * Float32Array.BYTES_PER_ELEMENT;\n    const texCoordExpandAndBatchIndexSizeInBytes =\n      4 * Float32Array.BYTES_PER_ELEMENT;\n\n    let vbo = 0;\n    const numberOfIndicesArrays = totalIndices.length;\n    for (let k = 0; k < numberOfIndicesArrays; ++k) {\n      indices = totalIndices[k];\n\n      if (indices.length > 0) {\n        const indicesArray = new Uint16Array(indices);\n        const indexBuffer = Buffer.createIndexBuffer({\n          context: context,\n          typedArray: indicesArray,\n          usage: BufferUsage.STATIC_DRAW,\n          indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n        });\n\n        vbo += vertexBufferOffset[k];\n\n        const positionHighOffset =\n          6 *\n          (k * (positionSizeInBytes * CesiumMath.SIXTY_FOUR_KILOBYTES) -\n            vbo * positionSizeInBytes); //componentsPerAttribute(3) * componentDatatype(4)\n        const positionLowOffset = positionSizeInBytes + positionHighOffset;\n        const prevPositionHighOffset = positionSizeInBytes + positionLowOffset;\n        const prevPositionLowOffset =\n          positionSizeInBytes + prevPositionHighOffset;\n        const nextPositionHighOffset =\n          positionSizeInBytes + prevPositionLowOffset;\n        const nextPositionLowOffset =\n          positionSizeInBytes + nextPositionHighOffset;\n        const vertexTexCoordExpandAndBatchIndexBufferOffset =\n          k *\n            (texCoordExpandAndBatchIndexSizeInBytes *\n              CesiumMath.SIXTY_FOUR_KILOBYTES) -\n          vbo * texCoordExpandAndBatchIndexSizeInBytes;\n\n        const attributes = [\n          {\n            index: attributeLocations.position3DHigh,\n            componentsPerAttribute: 3,\n            componentDatatype: ComponentDatatype.FLOAT,\n            offsetInBytes: positionHighOffset,\n            strideInBytes: 6 * positionSizeInBytes,\n          },\n          {\n            index: attributeLocations.position3DLow,\n            componentsPerAttribute: 3,\n            componentDatatype: ComponentDatatype.FLOAT,\n            offsetInBytes: positionLowOffset,\n            strideInBytes: 6 * positionSizeInBytes,\n          },\n          {\n            index: attributeLocations.position2DHigh,\n            componentsPerAttribute: 3,\n            componentDatatype: ComponentDatatype.FLOAT,\n            offsetInBytes: positionHighOffset,\n            strideInBytes: 6 * positionSizeInBytes,\n          },\n          {\n            index: attributeLocations.position2DLow,\n            componentsPerAttribute: 3,\n            componentDatatype: ComponentDatatype.FLOAT,\n            offsetInBytes: positionLowOffset,\n            strideInBytes: 6 * positionSizeInBytes,\n          },\n          {\n            index: attributeLocations.prevPosition3DHigh,\n            componentsPerAttribute: 3,\n            componentDatatype: ComponentDatatype.FLOAT,\n            offsetInBytes: prevPositionHighOffset,\n            strideInBytes: 6 * positionSizeInBytes,\n          },\n          {\n            index: attributeLocations.prevPosition3DLow,\n            componentsPerAttribute: 3,\n            componentDatatype: ComponentDatatype.FLOAT,\n            offsetInBytes: prevPositionLowOffset,\n            strideInBytes: 6 * positionSizeInBytes,\n          },\n          {\n            index: attributeLocations.prevPosition2DHigh,\n            componentsPerAttribute: 3,\n            componentDatatype: ComponentDatatype.FLOAT,\n            offsetInBytes: prevPositionHighOffset,\n            strideInBytes: 6 * positionSizeInBytes,\n          },\n          {\n            index: attributeLocations.prevPosition2DLow,\n            componentsPerAttribute: 3,\n            componentDatatype: ComponentDatatype.FLOAT,\n            offsetInBytes: prevPositionLowOffset,\n            strideInBytes: 6 * positionSizeInBytes,\n          },\n          {\n            index: attributeLocations.nextPosition3DHigh,\n            componentsPerAttribute: 3,\n            componentDatatype: ComponentDatatype.FLOAT,\n            offsetInBytes: nextPositionHighOffset,\n            strideInBytes: 6 * positionSizeInBytes,\n          },\n          {\n            index: attributeLocations.nextPosition3DLow,\n            componentsPerAttribute: 3,\n            componentDatatype: ComponentDatatype.FLOAT,\n            offsetInBytes: nextPositionLowOffset,\n            strideInBytes: 6 * positionSizeInBytes,\n          },\n          {\n            index: attributeLocations.nextPosition2DHigh,\n            componentsPerAttribute: 3,\n            componentDatatype: ComponentDatatype.FLOAT,\n            offsetInBytes: nextPositionHighOffset,\n            strideInBytes: 6 * positionSizeInBytes,\n          },\n          {\n            index: attributeLocations.nextPosition2DLow,\n            componentsPerAttribute: 3,\n            componentDatatype: ComponentDatatype.FLOAT,\n            offsetInBytes: nextPositionLowOffset,\n            strideInBytes: 6 * positionSizeInBytes,\n          },\n          {\n            index: attributeLocations.texCoordExpandAndBatchIndex,\n            componentsPerAttribute: 4,\n            componentDatatype: ComponentDatatype.FLOAT,\n            vertexBuffer: collection._texCoordExpandAndBatchIndexBuffer,\n            offsetInBytes: vertexTexCoordExpandAndBatchIndexBufferOffset,\n          },\n        ];\n\n        let bufferProperty3D;\n        let buffer3D;\n        let buffer2D;\n        let bufferProperty2D;\n\n        if (mode === SceneMode.SCENE3D) {\n          buffer3D = collection._positionBuffer;\n          bufferProperty3D = \"vertexBuffer\";\n          buffer2D = emptyVertexBuffer;\n          bufferProperty2D = \"value\";\n        } else if (\n          mode === SceneMode.SCENE2D ||\n          mode === SceneMode.COLUMBUS_VIEW\n        ) {\n          buffer3D = emptyVertexBuffer;\n          bufferProperty3D = \"value\";\n          buffer2D = collection._positionBuffer;\n          bufferProperty2D = \"vertexBuffer\";\n        } else {\n          buffer3D = position3DBuffer;\n          bufferProperty3D = \"vertexBuffer\";\n          buffer2D = collection._positionBuffer;\n          bufferProperty2D = \"vertexBuffer\";\n        }\n\n        attributes[0][bufferProperty3D] = buffer3D;\n        attributes[1][bufferProperty3D] = buffer3D;\n        attributes[2][bufferProperty2D] = buffer2D;\n        attributes[3][bufferProperty2D] = buffer2D;\n        attributes[4][bufferProperty3D] = buffer3D;\n        attributes[5][bufferProperty3D] = buffer3D;\n        attributes[6][bufferProperty2D] = buffer2D;\n        attributes[7][bufferProperty2D] = buffer2D;\n        attributes[8][bufferProperty3D] = buffer3D;\n        attributes[9][bufferProperty3D] = buffer3D;\n        attributes[10][bufferProperty2D] = buffer2D;\n        attributes[11][bufferProperty2D] = buffer2D;\n\n        const va = new VertexArray({\n          context: context,\n          attributes: attributes,\n          indexBuffer: indexBuffer,\n        });\n        collection._vertexArrays.push({\n          va: va,\n          buckets: vertexArrayBuckets[k],\n        });\n      }\n    }\n  }\n}\n\nfunction replacer(key, value) {\n  if (value instanceof Texture) {\n    return value.id;\n  }\n\n  return value;\n}\n\nconst scratchUniformArray = [];\nfunction createMaterialId(material) {\n  const uniforms = Material._uniformList[material.type];\n  const length = uniforms.length;\n  scratchUniformArray.length = 2.0 * length;\n\n  let index = 0;\n  for (let i = 0; i < length; ++i) {\n    const uniform = uniforms[i];\n    scratchUniformArray[index] = uniform;\n    scratchUniformArray[index + 1] = material._uniforms[uniform]();\n    index += 2;\n  }\n\n  return `${material.type}:${JSON.stringify(scratchUniformArray, replacer)}`;\n}\n\nfunction sortPolylinesIntoBuckets(collection) {\n  const mode = collection._mode;\n  const modelMatrix = collection._modelMatrix;\n\n  const polylineBuckets = (collection._polylineBuckets = {});\n  const polylines = collection._polylines;\n  const length = polylines.length;\n  for (let i = 0; i < length; ++i) {\n    const p = polylines[i];\n    if (p._actualPositions.length > 1) {\n      p.update();\n      const material = p.material;\n      let value = polylineBuckets[material.type];\n      if (!defined(value)) {\n        value = polylineBuckets[material.type] = new PolylineBucket(\n          material,\n          mode,\n          modelMatrix\n        );\n      }\n      value.addPolyline(p);\n    }\n  }\n}\n\nfunction updateMode(collection, frameState) {\n  const mode = frameState.mode;\n\n  if (\n    collection._mode !== mode ||\n    !Matrix4.equals(collection._modelMatrix, collection.modelMatrix)\n  ) {\n    collection._mode = mode;\n    collection._modelMatrix = Matrix4.clone(collection.modelMatrix);\n    collection._createVertexArray = true;\n  }\n}\n\nfunction removePolylines(collection) {\n  if (collection._polylinesRemoved) {\n    collection._polylinesRemoved = false;\n    const definedPolylines = [];\n    const definedPolylinesToUpdate = [];\n    let polyIndex = 0;\n    let polyline;\n\n    const length = collection._polylines.length;\n    for (let i = 0; i < length; ++i) {\n      polyline = collection._polylines[i];\n      if (!polyline.isDestroyed) {\n        polyline._index = polyIndex++;\n        definedPolylinesToUpdate.push(polyline);\n        definedPolylines.push(polyline);\n      }\n    }\n\n    collection._polylines = definedPolylines;\n    collection._polylinesToUpdate = definedPolylinesToUpdate;\n  }\n}\n\nfunction releaseShaders(collection) {\n  const polylines = collection._polylines;\n  const length = polylines.length;\n  for (let i = 0; i < length; ++i) {\n    if (!polylines[i].isDestroyed) {\n      const bucket = polylines[i]._bucket;\n      if (defined(bucket)) {\n        bucket.shaderProgram =\n          bucket.shaderProgram && bucket.shaderProgram.destroy();\n      }\n    }\n  }\n}\n\nfunction destroyVertexArrays(collection) {\n  const length = collection._vertexArrays.length;\n  for (let t = 0; t < length; ++t) {\n    collection._vertexArrays[t].va.destroy();\n  }\n  collection._vertexArrays.length = 0;\n}\n\nPolylineCollection.prototype._updatePolyline = function (\n  polyline,\n  propertyChanged\n) {\n  this._polylinesUpdated = true;\n  if (!polyline._dirty) {\n    this._polylinesToUpdate.push(polyline);\n  }\n  ++this._propertiesChanged[propertyChanged];\n};\n\nfunction destroyPolylines(collection) {\n  const polylines = collection._polylines;\n  const length = polylines.length;\n  for (let i = 0; i < length; ++i) {\n    if (!polylines[i].isDestroyed) {\n      polylines[i]._destroy();\n    }\n  }\n}\n\nfunction VertexArrayBucketLocator(count, offset, bucket) {\n  this.count = count;\n  this.offset = offset;\n  this.bucket = bucket;\n}\n\nfunction PolylineBucket(material, mode, modelMatrix) {\n  this.polylines = [];\n  this.lengthOfPositions = 0;\n  this.material = material;\n  this.shaderProgram = undefined;\n  this.mode = mode;\n  this.modelMatrix = modelMatrix;\n}\n\nPolylineBucket.prototype.addPolyline = function (p) {\n  const polylines = this.polylines;\n  polylines.push(p);\n  p._actualLength = this.getPolylinePositionsLength(p);\n  this.lengthOfPositions += p._actualLength;\n  p._bucket = this;\n};\n\nPolylineBucket.prototype.updateShader = function (\n  context,\n  batchTable,\n  useHighlightColor\n) {\n  if (defined(this.shaderProgram)) {\n    return;\n  }\n\n  const defines = [\"DISTANCE_DISPLAY_CONDITION\"];\n  if (useHighlightColor) {\n    defines.push(\"VECTOR_TILE\");\n  }\n\n  // Check for use of v_polylineAngle in material shader\n  if (\n    this.material.shaderSource.search(/in\\s+float\\s+v_polylineAngle;/g) !== -1\n  ) {\n    defines.push(\"POLYLINE_DASH\");\n  }\n\n  if (!FeatureDetection.isInternetExplorer()) {\n    defines.push(\"CLIP_POLYLINE\");\n  }\n\n  const fs = new ShaderSource({\n    defines: defines,\n    sources: [\"in vec4 v_pickColor;\\n\", this.material.shaderSource, PolylineFS],\n  });\n\n  const vsSource = batchTable.getVertexShaderCallback()(PolylineVS);\n  const vs = new ShaderSource({\n    defines: defines,\n    sources: [PolylineCommon, vsSource],\n  });\n\n  this.shaderProgram = ShaderProgram.fromCache({\n    context: context,\n    vertexShaderSource: vs,\n    fragmentShaderSource: fs,\n    attributeLocations: attributeLocations,\n  });\n};\n\nfunction intersectsIDL(polyline) {\n  return (\n    Cartesian3.dot(Cartesian3.UNIT_X, polyline._boundingVolume.center) < 0 ||\n    polyline._boundingVolume.intersectPlane(Plane.ORIGIN_ZX_PLANE) ===\n      Intersect.INTERSECTING\n  );\n}\n\nPolylineBucket.prototype.getPolylinePositionsLength = function (polyline) {\n  let length;\n  if (this.mode === SceneMode.SCENE3D || !intersectsIDL(polyline)) {\n    length = polyline._actualPositions.length;\n    return length * 4.0 - 4.0;\n  }\n\n  let count = 0;\n  const segmentLengths = polyline._segments.lengths;\n  length = segmentLengths.length;\n  for (let i = 0; i < length; ++i) {\n    count += segmentLengths[i] * 4.0 - 4.0;\n  }\n\n  return count;\n};\n\nconst scratchWritePosition = new Cartesian3();\nconst scratchWritePrevPosition = new Cartesian3();\nconst scratchWriteNextPosition = new Cartesian3();\nconst scratchWriteVector = new Cartesian3();\nconst scratchPickColorCartesian = new Cartesian4();\nconst scratchWidthShowCartesian = new Cartesian2();\n\nPolylineBucket.prototype.write = function (\n  positionArray,\n  texCoordExpandAndBatchIndexArray,\n  positionIndex,\n  colorIndex,\n  texCoordExpandAndBatchIndexIndex,\n  batchTable,\n  context,\n  projection\n) {\n  const mode = this.mode;\n  const maxLon = projection.ellipsoid.maximumRadius * CesiumMath.PI;\n\n  const polylines = this.polylines;\n  const length = polylines.length;\n  for (let i = 0; i < length; ++i) {\n    const polyline = polylines[i];\n    const width = polyline.width;\n    const show = polyline.show && width > 0.0;\n    const polylineBatchIndex = polyline._index;\n    const segments = this.getSegments(polyline, projection);\n    const positions = segments.positions;\n    const lengths = segments.lengths;\n    const positionsLength = positions.length;\n\n    const pickColor = polyline.getPickId(context).color;\n\n    let segmentIndex = 0;\n    let count = 0;\n    let position;\n\n    for (let j = 0; j < positionsLength; ++j) {\n      if (j === 0) {\n        if (polyline._loop) {\n          position = positions[positionsLength - 2];\n        } else {\n          position = scratchWriteVector;\n          Cartesian3.subtract(positions[0], positions[1], position);\n          Cartesian3.add(positions[0], position, position);\n        }\n      } else {\n        position = positions[j - 1];\n      }\n\n      Cartesian3.clone(position, scratchWritePrevPosition);\n      Cartesian3.clone(positions[j], scratchWritePosition);\n\n      if (j === positionsLength - 1) {\n        if (polyline._loop) {\n          position = positions[1];\n        } else {\n          position = scratchWriteVector;\n          Cartesian3.subtract(\n            positions[positionsLength - 1],\n            positions[positionsLength - 2],\n            position\n          );\n          Cartesian3.add(positions[positionsLength - 1], position, position);\n        }\n      } else {\n        position = positions[j + 1];\n      }\n\n      Cartesian3.clone(position, scratchWriteNextPosition);\n\n      const segmentLength = lengths[segmentIndex];\n      if (j === count + segmentLength) {\n        count += segmentLength;\n        ++segmentIndex;\n      }\n\n      const segmentStart = j - count === 0;\n      const segmentEnd = j === count + lengths[segmentIndex] - 1;\n\n      if (mode === SceneMode.SCENE2D) {\n        scratchWritePrevPosition.z = 0.0;\n        scratchWritePosition.z = 0.0;\n        scratchWriteNextPosition.z = 0.0;\n      }\n\n      if (mode === SceneMode.SCENE2D || mode === SceneMode.MORPHING) {\n        if (\n          (segmentStart || segmentEnd) &&\n          maxLon - Math.abs(scratchWritePosition.x) < 1.0\n        ) {\n          if (\n            (scratchWritePosition.x < 0.0 &&\n              scratchWritePrevPosition.x > 0.0) ||\n            (scratchWritePosition.x > 0.0 && scratchWritePrevPosition.x < 0.0)\n          ) {\n            Cartesian3.clone(scratchWritePosition, scratchWritePrevPosition);\n          }\n\n          if (\n            (scratchWritePosition.x < 0.0 &&\n              scratchWriteNextPosition.x > 0.0) ||\n            (scratchWritePosition.x > 0.0 && scratchWriteNextPosition.x < 0.0)\n          ) {\n            Cartesian3.clone(scratchWritePosition, scratchWriteNextPosition);\n          }\n        }\n      }\n\n      const startK = segmentStart ? 2 : 0;\n      const endK = segmentEnd ? 2 : 4;\n\n      for (let k = startK; k < endK; ++k) {\n        EncodedCartesian3.writeElements(\n          scratchWritePosition,\n          positionArray,\n          positionIndex\n        );\n        EncodedCartesian3.writeElements(\n          scratchWritePrevPosition,\n          positionArray,\n          positionIndex + 6\n        );\n        EncodedCartesian3.writeElements(\n          scratchWriteNextPosition,\n          positionArray,\n          positionIndex + 12\n        );\n\n        const direction = k - 2 < 0 ? -1.0 : 1.0;\n        texCoordExpandAndBatchIndexArray[texCoordExpandAndBatchIndexIndex] =\n          j / (positionsLength - 1); // s tex coord\n        texCoordExpandAndBatchIndexArray[texCoordExpandAndBatchIndexIndex + 1] =\n          2 * (k % 2) - 1; // expand direction\n        texCoordExpandAndBatchIndexArray[\n          texCoordExpandAndBatchIndexIndex + 2\n        ] = direction;\n        texCoordExpandAndBatchIndexArray[\n          texCoordExpandAndBatchIndexIndex + 3\n        ] = polylineBatchIndex;\n\n        positionIndex += 6 * 3;\n        texCoordExpandAndBatchIndexIndex += 4;\n      }\n    }\n\n    const colorCartesian = scratchPickColorCartesian;\n    colorCartesian.x = Color.floatToByte(pickColor.red);\n    colorCartesian.y = Color.floatToByte(pickColor.green);\n    colorCartesian.z = Color.floatToByte(pickColor.blue);\n    colorCartesian.w = Color.floatToByte(pickColor.alpha);\n\n    const widthShowCartesian = scratchWidthShowCartesian;\n    widthShowCartesian.x = width;\n    widthShowCartesian.y = show ? 1.0 : 0.0;\n\n    const boundingSphere =\n      mode === SceneMode.SCENE2D\n        ? polyline._boundingVolume2D\n        : polyline._boundingVolumeWC;\n    const encodedCenter = EncodedCartesian3.fromCartesian(\n      boundingSphere.center,\n      scratchUpdatePolylineEncodedCartesian\n    );\n    const high = encodedCenter.high;\n    const low = Cartesian4.fromElements(\n      encodedCenter.low.x,\n      encodedCenter.low.y,\n      encodedCenter.low.z,\n      boundingSphere.radius,\n      scratchUpdatePolylineCartesian4\n    );\n\n    const nearFarCartesian = scratchNearFarCartesian2;\n    nearFarCartesian.x = 0.0;\n    nearFarCartesian.y = Number.MAX_VALUE;\n\n    const distanceDisplayCondition = polyline.distanceDisplayCondition;\n    if (defined(distanceDisplayCondition)) {\n      nearFarCartesian.x = distanceDisplayCondition.near;\n      nearFarCartesian.y = distanceDisplayCondition.far;\n    }\n\n    batchTable.setBatchedAttribute(polylineBatchIndex, 0, widthShowCartesian);\n    batchTable.setBatchedAttribute(polylineBatchIndex, 1, colorCartesian);\n\n    if (batchTable.attributes.length > 2) {\n      batchTable.setBatchedAttribute(polylineBatchIndex, 2, high);\n      batchTable.setBatchedAttribute(polylineBatchIndex, 3, low);\n      batchTable.setBatchedAttribute(polylineBatchIndex, 4, nearFarCartesian);\n    }\n  }\n};\n\nconst morphPositionScratch = new Cartesian3();\nconst morphPrevPositionScratch = new Cartesian3();\nconst morphNextPositionScratch = new Cartesian3();\nconst morphVectorScratch = new Cartesian3();\n\nPolylineBucket.prototype.writeForMorph = function (\n  positionArray,\n  positionIndex\n) {\n  const modelMatrix = this.modelMatrix;\n  const polylines = this.polylines;\n  const length = polylines.length;\n  for (let i = 0; i < length; ++i) {\n    const polyline = polylines[i];\n    const positions = polyline._segments.positions;\n    const lengths = polyline._segments.lengths;\n    const positionsLength = positions.length;\n\n    let segmentIndex = 0;\n    let count = 0;\n\n    for (let j = 0; j < positionsLength; ++j) {\n      let prevPosition;\n      if (j === 0) {\n        if (polyline._loop) {\n          prevPosition = positions[positionsLength - 2];\n        } else {\n          prevPosition = morphVectorScratch;\n          Cartesian3.subtract(positions[0], positions[1], prevPosition);\n          Cartesian3.add(positions[0], prevPosition, prevPosition);\n        }\n      } else {\n        prevPosition = positions[j - 1];\n      }\n\n      prevPosition = Matrix4.multiplyByPoint(\n        modelMatrix,\n        prevPosition,\n        morphPrevPositionScratch\n      );\n\n      const position = Matrix4.multiplyByPoint(\n        modelMatrix,\n        positions[j],\n        morphPositionScratch\n      );\n\n      let nextPosition;\n      if (j === positionsLength - 1) {\n        if (polyline._loop) {\n          nextPosition = positions[1];\n        } else {\n          nextPosition = morphVectorScratch;\n          Cartesian3.subtract(\n            positions[positionsLength - 1],\n            positions[positionsLength - 2],\n            nextPosition\n          );\n          Cartesian3.add(\n            positions[positionsLength - 1],\n            nextPosition,\n            nextPosition\n          );\n        }\n      } else {\n        nextPosition = positions[j + 1];\n      }\n\n      nextPosition = Matrix4.multiplyByPoint(\n        modelMatrix,\n        nextPosition,\n        morphNextPositionScratch\n      );\n\n      const segmentLength = lengths[segmentIndex];\n      if (j === count + segmentLength) {\n        count += segmentLength;\n        ++segmentIndex;\n      }\n\n      const segmentStart = j - count === 0;\n      const segmentEnd = j === count + lengths[segmentIndex] - 1;\n\n      const startK = segmentStart ? 2 : 0;\n      const endK = segmentEnd ? 2 : 4;\n\n      for (let k = startK; k < endK; ++k) {\n        EncodedCartesian3.writeElements(position, positionArray, positionIndex);\n        EncodedCartesian3.writeElements(\n          prevPosition,\n          positionArray,\n          positionIndex + 6\n        );\n        EncodedCartesian3.writeElements(\n          nextPosition,\n          positionArray,\n          positionIndex + 12\n        );\n\n        positionIndex += 6 * 3;\n      }\n    }\n  }\n};\n\nconst scratchSegmentLengths = new Array(1);\n\nPolylineBucket.prototype.updateIndices = function (\n  totalIndices,\n  vertexBufferOffset,\n  vertexArrayBuckets,\n  offset\n) {\n  let vaCount = vertexArrayBuckets.length - 1;\n  let bucketLocator = new VertexArrayBucketLocator(0, offset, this);\n  vertexArrayBuckets[vaCount].push(bucketLocator);\n  let count = 0;\n  let indices = totalIndices[totalIndices.length - 1];\n  let indicesCount = 0;\n  if (indices.length > 0) {\n    indicesCount = indices[indices.length - 1] + 1;\n  }\n  const polylines = this.polylines;\n  const length = polylines.length;\n  for (let i = 0; i < length; ++i) {\n    const polyline = polylines[i];\n    polyline._locatorBuckets = [];\n\n    let segments;\n    if (this.mode === SceneMode.SCENE3D) {\n      segments = scratchSegmentLengths;\n      const positionsLength = polyline._actualPositions.length;\n      if (positionsLength > 0) {\n        segments[0] = positionsLength;\n      } else {\n        continue;\n      }\n    } else {\n      segments = polyline._segments.lengths;\n    }\n\n    const numberOfSegments = segments.length;\n    if (numberOfSegments > 0) {\n      let segmentIndexCount = 0;\n      for (let j = 0; j < numberOfSegments; ++j) {\n        const segmentLength = segments[j] - 1.0;\n        for (let k = 0; k < segmentLength; ++k) {\n          if (indicesCount + 4 > CesiumMath.SIXTY_FOUR_KILOBYTES) {\n            polyline._locatorBuckets.push({\n              locator: bucketLocator,\n              count: segmentIndexCount,\n            });\n            segmentIndexCount = 0;\n            vertexBufferOffset.push(4);\n            indices = [];\n            totalIndices.push(indices);\n            indicesCount = 0;\n            bucketLocator.count = count;\n            count = 0;\n            offset = 0;\n            bucketLocator = new VertexArrayBucketLocator(0, 0, this);\n            vertexArrayBuckets[++vaCount] = [bucketLocator];\n          }\n\n          indices.push(indicesCount, indicesCount + 2, indicesCount + 1);\n          indices.push(indicesCount + 1, indicesCount + 2, indicesCount + 3);\n\n          segmentIndexCount += 6;\n          count += 6;\n          offset += 6;\n          indicesCount += 4;\n        }\n      }\n\n      polyline._locatorBuckets.push({\n        locator: bucketLocator,\n        count: segmentIndexCount,\n      });\n\n      if (indicesCount + 4 > CesiumMath.SIXTY_FOUR_KILOBYTES) {\n        vertexBufferOffset.push(0);\n        indices = [];\n        totalIndices.push(indices);\n        indicesCount = 0;\n        bucketLocator.count = count;\n        offset = 0;\n        count = 0;\n        bucketLocator = new VertexArrayBucketLocator(0, 0, this);\n        vertexArrayBuckets[++vaCount] = [bucketLocator];\n      }\n    }\n    polyline._clean();\n  }\n  bucketLocator.count = count;\n  return offset;\n};\n\nPolylineBucket.prototype.getPolylineStartIndex = function (polyline) {\n  const polylines = this.polylines;\n  let positionIndex = 0;\n  const length = polylines.length;\n  for (let i = 0; i < length; ++i) {\n    const p = polylines[i];\n    if (p === polyline) {\n      break;\n    }\n    positionIndex += p._actualLength;\n  }\n  return positionIndex;\n};\n\nconst scratchSegments = {\n  positions: undefined,\n  lengths: undefined,\n};\nconst scratchLengths = new Array(1);\nconst pscratch = new Cartesian3();\nconst scratchCartographic = new Cartographic();\n\nPolylineBucket.prototype.getSegments = function (polyline, projection) {\n  let positions = polyline._actualPositions;\n\n  if (this.mode === SceneMode.SCENE3D) {\n    scratchLengths[0] = positions.length;\n    scratchSegments.positions = positions;\n    scratchSegments.lengths = scratchLengths;\n    return scratchSegments;\n  }\n\n  if (intersectsIDL(polyline)) {\n    positions = polyline._segments.positions;\n  }\n\n  const ellipsoid = projection.ellipsoid;\n  const newPositions = [];\n  const modelMatrix = this.modelMatrix;\n  const length = positions.length;\n  let position;\n  let p = pscratch;\n\n  for (let n = 0; n < length; ++n) {\n    position = positions[n];\n    p = Matrix4.multiplyByPoint(modelMatrix, position, p);\n    newPositions.push(\n      projection.project(\n        ellipsoid.cartesianToCartographic(p, scratchCartographic)\n      )\n    );\n  }\n\n  if (newPositions.length > 0) {\n    polyline._boundingVolume2D = BoundingSphere.fromPoints(\n      newPositions,\n      polyline._boundingVolume2D\n    );\n    const center2D = polyline._boundingVolume2D.center;\n    polyline._boundingVolume2D.center = new Cartesian3(\n      center2D.z,\n      center2D.x,\n      center2D.y\n    );\n  }\n\n  scratchSegments.positions = newPositions;\n  scratchSegments.lengths = polyline._segments.lengths;\n  return scratchSegments;\n};\n\nlet scratchPositionsArray;\n\nPolylineBucket.prototype.writeUpdate = function (\n  index,\n  polyline,\n  positionBuffer,\n  projection\n) {\n  const mode = this.mode;\n  const maxLon = projection.ellipsoid.maximumRadius * CesiumMath.PI;\n\n  let positionsLength = polyline._actualLength;\n  if (positionsLength) {\n    index += this.getPolylineStartIndex(polyline);\n\n    let positionArray = scratchPositionsArray;\n    const positionsArrayLength = 6 * positionsLength * 3;\n\n    if (\n      !defined(positionArray) ||\n      positionArray.length < positionsArrayLength\n    ) {\n      positionArray = scratchPositionsArray = new Float32Array(\n        positionsArrayLength\n      );\n    } else if (positionArray.length > positionsArrayLength) {\n      positionArray = new Float32Array(\n        positionArray.buffer,\n        0,\n        positionsArrayLength\n      );\n    }\n\n    const segments = this.getSegments(polyline, projection);\n    const positions = segments.positions;\n    const lengths = segments.lengths;\n\n    let positionIndex = 0;\n    let segmentIndex = 0;\n    let count = 0;\n    let position;\n\n    positionsLength = positions.length;\n    for (let i = 0; i < positionsLength; ++i) {\n      if (i === 0) {\n        if (polyline._loop) {\n          position = positions[positionsLength - 2];\n        } else {\n          position = scratchWriteVector;\n          Cartesian3.subtract(positions[0], positions[1], position);\n          Cartesian3.add(positions[0], position, position);\n        }\n      } else {\n        position = positions[i - 1];\n      }\n\n      Cartesian3.clone(position, scratchWritePrevPosition);\n      Cartesian3.clone(positions[i], scratchWritePosition);\n\n      if (i === positionsLength - 1) {\n        if (polyline._loop) {\n          position = positions[1];\n        } else {\n          position = scratchWriteVector;\n          Cartesian3.subtract(\n            positions[positionsLength - 1],\n            positions[positionsLength - 2],\n            position\n          );\n          Cartesian3.add(positions[positionsLength - 1], position, position);\n        }\n      } else {\n        position = positions[i + 1];\n      }\n\n      Cartesian3.clone(position, scratchWriteNextPosition);\n\n      const segmentLength = lengths[segmentIndex];\n      if (i === count + segmentLength) {\n        count += segmentLength;\n        ++segmentIndex;\n      }\n\n      const segmentStart = i - count === 0;\n      const segmentEnd = i === count + lengths[segmentIndex] - 1;\n\n      if (mode === SceneMode.SCENE2D) {\n        scratchWritePrevPosition.z = 0.0;\n        scratchWritePosition.z = 0.0;\n        scratchWriteNextPosition.z = 0.0;\n      }\n\n      if (mode === SceneMode.SCENE2D || mode === SceneMode.MORPHING) {\n        if (\n          (segmentStart || segmentEnd) &&\n          maxLon - Math.abs(scratchWritePosition.x) < 1.0\n        ) {\n          if (\n            (scratchWritePosition.x < 0.0 &&\n              scratchWritePrevPosition.x > 0.0) ||\n            (scratchWritePosition.x > 0.0 && scratchWritePrevPosition.x < 0.0)\n          ) {\n            Cartesian3.clone(scratchWritePosition, scratchWritePrevPosition);\n          }\n\n          if (\n            (scratchWritePosition.x < 0.0 &&\n              scratchWriteNextPosition.x > 0.0) ||\n            (scratchWritePosition.x > 0.0 && scratchWriteNextPosition.x < 0.0)\n          ) {\n            Cartesian3.clone(scratchWritePosition, scratchWriteNextPosition);\n          }\n        }\n      }\n\n      const startJ = segmentStart ? 2 : 0;\n      const endJ = segmentEnd ? 2 : 4;\n\n      for (let j = startJ; j < endJ; ++j) {\n        EncodedCartesian3.writeElements(\n          scratchWritePosition,\n          positionArray,\n          positionIndex\n        );\n        EncodedCartesian3.writeElements(\n          scratchWritePrevPosition,\n          positionArray,\n          positionIndex + 6\n        );\n        EncodedCartesian3.writeElements(\n          scratchWriteNextPosition,\n          positionArray,\n          positionIndex + 12\n        );\n        positionIndex += 6 * 3;\n      }\n    }\n\n    positionBuffer.copyFromArrayView(\n      positionArray,\n      6 * 3 * Float32Array.BYTES_PER_ELEMENT * index\n    );\n  }\n};\nexport default PolylineCollection;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\nimport BillboardCollection from \"./BillboardCollection.js\";\nimport Cesium3DTilePointFeature from \"./Cesium3DTilePointFeature.js\";\nimport HorizontalOrigin from \"./HorizontalOrigin.js\";\nimport LabelCollection from \"./LabelCollection.js\";\nimport LabelStyle from \"./LabelStyle.js\";\nimport PolylineCollection from \"./PolylineCollection.js\";\nimport VerticalOrigin from \"./VerticalOrigin.js\";\n\n/**\n * Creates a batch of points or billboards and labels.\n *\n * @alias Vector3DTilePoints\n * @constructor\n *\n * @param {object} options An object with following properties:\n * @param {Uint16Array} options.positions The positions of the polygons.\n * @param {number} options.minimumHeight The minimum height of the terrain covered by the tile.\n * @param {number} options.maximumHeight The maximum height of the terrain covered by the tile.\n * @param {Rectangle} options.rectangle The rectangle containing the tile.\n * @param {Cesium3DTileBatchTable} options.batchTable The batch table for the tile containing the batched polygons.\n * @param {Uint16Array} options.batchIds The batch ids for each polygon.\n *\n * @private\n */\nfunction Vector3DTilePoints(options) {\n  // released after the first update\n  this._positions = options.positions;\n\n  this._batchTable = options.batchTable;\n  this._batchIds = options.batchIds;\n\n  this._rectangle = options.rectangle;\n  this._minHeight = options.minimumHeight;\n  this._maxHeight = options.maximumHeight;\n\n  this._billboardCollection = new BillboardCollection({\n    batchTable: options.batchTable,\n  });\n  this._labelCollection = new LabelCollection({\n    batchTable: options.batchTable,\n  });\n  this._polylineCollection = new PolylineCollection();\n  this._polylineCollection._useHighlightColor = true;\n\n  this._packedBuffer = undefined;\n\n  this._ready = false;\n  this._promise = undefined;\n  this._error = undefined;\n}\n\nObject.defineProperties(Vector3DTilePoints.prototype, {\n  /**\n   * Returns true if the points are ready to render\n   *\n   * @memberof Vector3DTilePoints.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n\n  /**\n   * Gets the number of points.\n   *\n   * @memberof Vector3DTilePoints.prototype\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  pointsLength: {\n    get: function () {\n      return this._billboardCollection.length;\n    },\n  },\n\n  /**\n   * Gets the texture atlas memory in bytes.\n   *\n   * @memberof Vector3DTilePoints.prototype\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  texturesByteLength: {\n    get: function () {\n      const billboardSize = this._billboardCollection.textureAtlas.texture\n        .sizeInBytes;\n      const labelSize = this._labelCollection._textureAtlas.texture.sizeInBytes;\n      return billboardSize + labelSize;\n    },\n  },\n});\n\nfunction packBuffer(points, ellipsoid) {\n  const rectangle = points._rectangle;\n  const minimumHeight = points._minHeight;\n  const maximumHeight = points._maxHeight;\n\n  const packedLength = 2 + Rectangle.packedLength + Ellipsoid.packedLength;\n  const packedBuffer = new Float64Array(packedLength);\n\n  let offset = 0;\n  packedBuffer[offset++] = minimumHeight;\n  packedBuffer[offset++] = maximumHeight;\n\n  Rectangle.pack(rectangle, packedBuffer, offset);\n  offset += Rectangle.packedLength;\n\n  Ellipsoid.pack(ellipsoid, packedBuffer, offset);\n\n  return packedBuffer;\n}\n\nconst createVerticesTaskProcessor = new TaskProcessor(\n  \"createVectorTilePoints\",\n  5\n);\nconst scratchPosition = new Cartesian3();\n\nfunction createPoints(points, ellipsoid) {\n  let positions = points._positions;\n  let packedBuffer = points._packedBuffer;\n\n  if (!defined(packedBuffer)) {\n    // Copy because they may be the views on the same buffer.\n    positions = points._positions = positions.slice();\n    points._batchIds = points._batchIds.slice();\n\n    packedBuffer = points._packedBuffer = packBuffer(points, ellipsoid);\n  }\n\n  const transferrableObjects = [positions.buffer, packedBuffer.buffer];\n  const parameters = {\n    positions: positions.buffer,\n    packedBuffer: packedBuffer.buffer,\n  };\n\n  const verticesPromise = createVerticesTaskProcessor.scheduleTask(\n    parameters,\n    transferrableObjects\n  );\n  if (!defined(verticesPromise)) {\n    // Postponed\n    return;\n  }\n\n  return verticesPromise\n    .then((result) => {\n      if (points.isDestroyed()) {\n        return;\n      }\n\n      points._positions = new Float64Array(result.positions);\n      const billboardCollection = points._billboardCollection;\n      const labelCollection = points._labelCollection;\n      const polylineCollection = points._polylineCollection;\n      positions = points._positions;\n      const batchIds = points._batchIds;\n      const numberOfPoints = positions.length / 3;\n\n      for (let i = 0; i < numberOfPoints; ++i) {\n        const id = batchIds[i];\n\n        const position = Cartesian3.unpack(positions, i * 3, scratchPosition);\n\n        const b = billboardCollection.add();\n        b.position = position;\n        b._batchIndex = id;\n\n        const l = labelCollection.add();\n        l.text = \" \";\n        l.position = position;\n        l._batchIndex = id;\n\n        const p = polylineCollection.add();\n        p.positions = [Cartesian3.clone(position), Cartesian3.clone(position)];\n      }\n\n      points._positions = undefined;\n      points._packedBuffer = undefined;\n      points._ready = true;\n    })\n    .catch((error) => {\n      if (points.isDestroyed()) {\n        return;\n      }\n\n      // Throw the error next frame\n      points._error = error;\n    });\n}\n\n/**\n * Creates features for each point and places it at the batch id index of features.\n *\n * @param {Vector3DTileContent} content The vector tile content.\n * @param {Cesium3DTileFeature[]} features An array of features where the point features will be placed.\n */\nVector3DTilePoints.prototype.createFeatures = function (content, features) {\n  const billboardCollection = this._billboardCollection;\n  const labelCollection = this._labelCollection;\n  const polylineCollection = this._polylineCollection;\n\n  const batchIds = this._batchIds;\n  const length = batchIds.length;\n  for (let i = 0; i < length; ++i) {\n    const batchId = batchIds[i];\n\n    const billboard = billboardCollection.get(i);\n    const label = labelCollection.get(i);\n    const polyline = polylineCollection.get(i);\n\n    features[batchId] = new Cesium3DTilePointFeature(\n      content,\n      batchId,\n      billboard,\n      label,\n      polyline\n    );\n  }\n};\n\n/**\n * Colors the entire tile when enabled is true. The resulting color will be (batch table color * color).\n *\n * @param {boolean} enabled Whether to enable debug coloring.\n * @param {Color} color The debug color.\n */\nVector3DTilePoints.prototype.applyDebugSettings = function (enabled, color) {\n  if (enabled) {\n    Color.clone(color, this._billboardCollection._highlightColor);\n    Color.clone(color, this._labelCollection._highlightColor);\n    Color.clone(color, this._polylineCollection._highlightColor);\n  } else {\n    Color.clone(Color.WHITE, this._billboardCollection._highlightColor);\n    Color.clone(Color.WHITE, this._labelCollection._highlightColor);\n    Color.clone(Color.WHITE, this._polylineCollection._highlightColor);\n  }\n};\n\nfunction clearStyle(polygons, features) {\n  const batchIds = polygons._batchIds;\n  const length = batchIds.length;\n  for (let i = 0; i < length; ++i) {\n    const batchId = batchIds[i];\n    const feature = features[batchId];\n\n    feature.show = true;\n    feature.pointSize = Cesium3DTilePointFeature.defaultPointSize;\n    feature.color = Cesium3DTilePointFeature.defaultColor;\n    feature.pointOutlineColor =\n      Cesium3DTilePointFeature.defaultPointOutlineColor;\n    feature.pointOutlineWidth =\n      Cesium3DTilePointFeature.defaultPointOutlineWidth;\n    feature.labelColor = Color.WHITE;\n    feature.labelOutlineColor = Color.WHITE;\n    feature.labelOutlineWidth = 1.0;\n    feature.font = \"30px sans-serif\";\n    feature.labelStyle = LabelStyle.FILL;\n    feature.labelText = undefined;\n    feature.backgroundColor = new Color(0.165, 0.165, 0.165, 0.8);\n    feature.backgroundPadding = new Cartesian2(7, 5);\n    feature.backgroundEnabled = false;\n    feature.scaleByDistance = undefined;\n    feature.translucencyByDistance = undefined;\n    feature.distanceDisplayCondition = undefined;\n    feature.heightOffset = 0.0;\n    feature.anchorLineEnabled = false;\n    feature.anchorLineColor = Color.WHITE;\n    feature.image = undefined;\n    feature.disableDepthTestDistance = 0.0;\n    feature.horizontalOrigin = HorizontalOrigin.CENTER;\n    feature.verticalOrigin = VerticalOrigin.CENTER;\n    feature.labelHorizontalOrigin = HorizontalOrigin.RIGHT;\n    feature.labelVerticalOrigin = VerticalOrigin.BASELINE;\n  }\n}\n\nconst scratchColor = new Color();\nconst scratchColor2 = new Color();\nconst scratchColor3 = new Color();\nconst scratchColor4 = new Color();\nconst scratchColor5 = new Color();\nconst scratchColor6 = new Color();\nconst scratchScaleByDistance = new NearFarScalar();\nconst scratchTranslucencyByDistance = new NearFarScalar();\nconst scratchDistanceDisplayCondition = new DistanceDisplayCondition();\n\n/**\n * Apply a style to the content.\n *\n * @param {Cesium3DTileStyle} style The style.\n * @param {Cesium3DTileFeature[]} features The array of features.\n */\nVector3DTilePoints.prototype.applyStyle = function (style, features) {\n  if (!defined(style)) {\n    clearStyle(this, features);\n    return;\n  }\n\n  const batchIds = this._batchIds;\n  const length = batchIds.length;\n  for (let i = 0; i < length; ++i) {\n    const batchId = batchIds[i];\n    const feature = features[batchId];\n\n    if (defined(style.show)) {\n      feature.show = style.show.evaluate(feature);\n    }\n\n    if (defined(style.pointSize)) {\n      feature.pointSize = style.pointSize.evaluate(feature);\n    }\n\n    if (defined(style.color)) {\n      feature.color = style.color.evaluateColor(feature, scratchColor);\n    }\n\n    if (defined(style.pointOutlineColor)) {\n      feature.pointOutlineColor = style.pointOutlineColor.evaluateColor(\n        feature,\n        scratchColor2\n      );\n    }\n\n    if (defined(style.pointOutlineWidth)) {\n      feature.pointOutlineWidth = style.pointOutlineWidth.evaluate(feature);\n    }\n\n    if (defined(style.labelColor)) {\n      feature.labelColor = style.labelColor.evaluateColor(\n        feature,\n        scratchColor3\n      );\n    }\n\n    if (defined(style.labelOutlineColor)) {\n      feature.labelOutlineColor = style.labelOutlineColor.evaluateColor(\n        feature,\n        scratchColor4\n      );\n    }\n\n    if (defined(style.labelOutlineWidth)) {\n      feature.labelOutlineWidth = style.labelOutlineWidth.evaluate(feature);\n    }\n\n    if (defined(style.font)) {\n      feature.font = style.font.evaluate(feature);\n    }\n\n    if (defined(style.labelStyle)) {\n      feature.labelStyle = style.labelStyle.evaluate(feature);\n    }\n\n    if (defined(style.labelText)) {\n      feature.labelText = style.labelText.evaluate(feature);\n    } else {\n      feature.labelText = undefined;\n    }\n\n    if (defined(style.backgroundColor)) {\n      feature.backgroundColor = style.backgroundColor.evaluateColor(\n        feature,\n        scratchColor5\n      );\n    }\n\n    if (defined(style.backgroundPadding)) {\n      feature.backgroundPadding = style.backgroundPadding.evaluate(feature);\n    }\n\n    if (defined(style.backgroundEnabled)) {\n      feature.backgroundEnabled = style.backgroundEnabled.evaluate(feature);\n    }\n\n    if (defined(style.scaleByDistance)) {\n      const scaleByDistanceCart4 = style.scaleByDistance.evaluate(feature);\n      if (defined(scaleByDistanceCart4)) {\n        scratchScaleByDistance.near = scaleByDistanceCart4.x;\n        scratchScaleByDistance.nearValue = scaleByDistanceCart4.y;\n        scratchScaleByDistance.far = scaleByDistanceCart4.z;\n        scratchScaleByDistance.farValue = scaleByDistanceCart4.w;\n        feature.scaleByDistance = scratchScaleByDistance;\n      } else {\n        feature.scaleByDistance = undefined;\n      }\n    } else {\n      feature.scaleByDistance = undefined;\n    }\n\n    if (defined(style.translucencyByDistance)) {\n      const translucencyByDistanceCart4 = style.translucencyByDistance.evaluate(\n        feature\n      );\n      if (defined(translucencyByDistanceCart4)) {\n        scratchTranslucencyByDistance.near = translucencyByDistanceCart4.x;\n        scratchTranslucencyByDistance.nearValue = translucencyByDistanceCart4.y;\n        scratchTranslucencyByDistance.far = translucencyByDistanceCart4.z;\n        scratchTranslucencyByDistance.farValue = translucencyByDistanceCart4.w;\n        feature.translucencyByDistance = scratchTranslucencyByDistance;\n      } else {\n        feature.translucencyByDistance = undefined;\n      }\n    } else {\n      feature.translucencyByDistance = undefined;\n    }\n\n    if (defined(style.distanceDisplayCondition)) {\n      const distanceDisplayConditionCart2 = style.distanceDisplayCondition.evaluate(\n        feature\n      );\n      if (defined(distanceDisplayConditionCart2)) {\n        scratchDistanceDisplayCondition.near = distanceDisplayConditionCart2.x;\n        scratchDistanceDisplayCondition.far = distanceDisplayConditionCart2.y;\n        feature.distanceDisplayCondition = scratchDistanceDisplayCondition;\n      } else {\n        feature.distanceDisplayCondition = undefined;\n      }\n    } else {\n      feature.distanceDisplayCondition = undefined;\n    }\n\n    if (defined(style.heightOffset)) {\n      feature.heightOffset = style.heightOffset.evaluate(feature);\n    }\n\n    if (defined(style.anchorLineEnabled)) {\n      feature.anchorLineEnabled = style.anchorLineEnabled.evaluate(feature);\n    }\n\n    if (defined(style.anchorLineColor)) {\n      feature.anchorLineColor = style.anchorLineColor.evaluateColor(\n        feature,\n        scratchColor6\n      );\n    }\n\n    if (defined(style.image)) {\n      feature.image = style.image.evaluate(feature);\n    } else {\n      feature.image = undefined;\n    }\n\n    if (defined(style.disableDepthTestDistance)) {\n      feature.disableDepthTestDistance = style.disableDepthTestDistance.evaluate(\n        feature\n      );\n    }\n\n    if (defined(style.horizontalOrigin)) {\n      feature.horizontalOrigin = style.horizontalOrigin.evaluate(feature);\n    }\n\n    if (defined(style.verticalOrigin)) {\n      feature.verticalOrigin = style.verticalOrigin.evaluate(feature);\n    }\n\n    if (defined(style.labelHorizontalOrigin)) {\n      feature.labelHorizontalOrigin = style.labelHorizontalOrigin.evaluate(\n        feature\n      );\n    }\n\n    if (defined(style.labelVerticalOrigin)) {\n      feature.labelVerticalOrigin = style.labelVerticalOrigin.evaluate(feature);\n    }\n  }\n};\n\n/**\n * @private\n */\nVector3DTilePoints.prototype.update = function (frameState) {\n  if (!this._ready) {\n    if (!defined(this._promise)) {\n      this._promise = createPoints(this, frameState.mapProjection.ellipsoid);\n    }\n\n    if (defined(this._error)) {\n      const error = this._error;\n      this._error = undefined;\n      throw error;\n    }\n\n    return;\n  }\n\n  this._polylineCollection.update(frameState);\n  this._billboardCollection.update(frameState);\n  this._labelCollection.update(frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nVector3DTilePoints.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nVector3DTilePoints.prototype.destroy = function () {\n  this._billboardCollection =\n    this._billboardCollection && this._billboardCollection.destroy();\n  this._labelCollection =\n    this._labelCollection && this._labelCollection.destroy();\n  this._polylineCollection =\n    this._polylineCollection && this._polylineCollection.destroy();\n  return destroyObject(this);\n};\nexport default Vector3DTilePoints;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\nimport ClassificationType from \"./ClassificationType.js\";\nimport Vector3DTileBatch from \"./Vector3DTileBatch.js\";\nimport Vector3DTilePrimitive from \"./Vector3DTilePrimitive.js\";\n\n/**\n * Creates a batch of pre-triangulated polygons draped on terrain and/or 3D Tiles.\n *\n * @alias Vector3DTilePolygons\n * @constructor\n *\n * @param {object} options An object with following properties:\n * @param {Float32Array|Uint16Array} options.positions The positions of the polygons. The positions must be contiguous\n * so that the positions for polygon n are in [c, c + counts[n]] where c = sum{counts[0], counts[n - 1]} and they are the outer ring of\n * the polygon in counter-clockwise order.\n * @param {Uint32Array} options.counts The number of positions in the each polygon.\n * @param {Uint32Array} options.indices The indices of the triangulated polygons. The indices must be contiguous so that\n * the indices for polygon n are in [i, i + indexCounts[n]] where i = sum{indexCounts[0], indexCounts[n - 1]}.\n * @param {Uint32Array} options.indexCounts The number of indices for each polygon.\n * @param {number} options.minimumHeight The minimum height of the terrain covered by the tile.\n * @param {number} options.maximumHeight The maximum height of the terrain covered by the tile.\n * @param {Float32Array} [options.polygonMinimumHeights] An array containing the minimum heights for each polygon.\n * @param {Float32Array} [options.polygonMaximumHeights] An array containing the maximum heights for each polygon.\n * @param {Rectangle} options.rectangle The rectangle containing the tile.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid.\n * @param {Cartesian3} [options.center=Cartesian3.ZERO] The RTC center.\n * @param {Cesium3DTileBatchTable} options.batchTable The batch table for the tile containing the batched polygons.\n * @param {Uint16Array} options.batchIds The batch ids for each polygon.\n * @param {BoundingSphere} options.boundingVolume The bounding volume for the entire batch of polygons.\n *\n * @private\n */\nfunction Vector3DTilePolygons(options) {\n  // All of the private properties will be released except _primitive after the Vector3DTilePrimitive is created.\n  this._batchTable = options.batchTable;\n\n  this._batchIds = options.batchIds;\n  this._positions = options.positions;\n  this._counts = options.counts;\n\n  this._indices = options.indices;\n  this._indexCounts = options.indexCounts;\n  this._indexOffsets = undefined;\n\n  this._batchTableColors = undefined;\n  this._packedBuffer = undefined;\n\n  this._batchedPositions = undefined;\n  this._transferrableBatchIds = undefined;\n  this._vertexBatchIds = undefined;\n\n  this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  this._minimumHeight = options.minimumHeight;\n  this._maximumHeight = options.maximumHeight;\n  this._polygonMinimumHeights = options.polygonMinimumHeights;\n  this._polygonMaximumHeights = options.polygonMaximumHeights;\n  this._center = defaultValue(options.center, Cartesian3.ZERO);\n  this._rectangle = options.rectangle;\n\n  this._center = undefined;\n\n  this._boundingVolume = options.boundingVolume;\n  this._boundingVolumes = undefined;\n\n  this._batchedIndices = undefined;\n\n  this._ready = false;\n  this._promise = undefined;\n  this._error = undefined;\n  this._primitive = undefined;\n\n  /**\n   * Draws the wireframe of the classification meshes.\n   * @type {boolean}\n   * @default false\n   */\n  this.debugWireframe = false;\n\n  /**\n   * Forces a re-batch instead of waiting after a number of frames have been rendered. For testing only.\n   * @type {boolean}\n   * @default false\n   */\n  this.forceRebatch = false;\n\n  /**\n   * What this tile will classify.\n   * @type {ClassificationType}\n   * @default ClassificationType.BOTH\n   */\n  this.classificationType = ClassificationType.BOTH;\n}\n\nObject.defineProperties(Vector3DTilePolygons.prototype, {\n  /**\n   * Gets the number of triangles.\n   *\n   * @memberof Vector3DTilePolygons.prototype\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  trianglesLength: {\n    get: function () {\n      if (defined(this._primitive)) {\n        return this._primitive.trianglesLength;\n      }\n      return 0;\n    },\n  },\n\n  /**\n   * Gets the geometry memory in bytes.\n   *\n   * @memberof Vector3DTilePolygons.prototype\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  geometryByteLength: {\n    get: function () {\n      if (defined(this._primitive)) {\n        return this._primitive.geometryByteLength;\n      }\n      return 0;\n    },\n  },\n\n  /**\n   * Returns true when the primitive is ready to render.\n   * @memberof Vector3DTilePolygons.prototype\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n});\n\nfunction packBuffer(polygons) {\n  const packedBuffer = new Float64Array(\n    3 +\n      Cartesian3.packedLength +\n      Ellipsoid.packedLength +\n      Rectangle.packedLength\n  );\n\n  let offset = 0;\n  packedBuffer[offset++] = polygons._indices.BYTES_PER_ELEMENT;\n\n  packedBuffer[offset++] = polygons._minimumHeight;\n  packedBuffer[offset++] = polygons._maximumHeight;\n\n  Cartesian3.pack(polygons._center, packedBuffer, offset);\n  offset += Cartesian3.packedLength;\n\n  Ellipsoid.pack(polygons._ellipsoid, packedBuffer, offset);\n  offset += Ellipsoid.packedLength;\n\n  Rectangle.pack(polygons._rectangle, packedBuffer, offset);\n\n  return packedBuffer;\n}\n\nfunction unpackBuffer(polygons, packedBuffer) {\n  let offset = 1;\n\n  const numBVS = packedBuffer[offset++];\n  const bvs = (polygons._boundingVolumes = new Array(numBVS));\n\n  for (let i = 0; i < numBVS; ++i) {\n    bvs[i] = OrientedBoundingBox.unpack(packedBuffer, offset);\n    offset += OrientedBoundingBox.packedLength;\n  }\n\n  const numBatchedIndices = packedBuffer[offset++];\n  const bis = (polygons._batchedIndices = new Array(numBatchedIndices));\n\n  for (let j = 0; j < numBatchedIndices; ++j) {\n    const color = Color.unpack(packedBuffer, offset);\n    offset += Color.packedLength;\n\n    const indexOffset = packedBuffer[offset++];\n    const count = packedBuffer[offset++];\n\n    const length = packedBuffer[offset++];\n    const batchIds = new Array(length);\n\n    for (let k = 0; k < length; ++k) {\n      batchIds[k] = packedBuffer[offset++];\n    }\n\n    bis[j] = new Vector3DTileBatch({\n      color: color,\n      offset: indexOffset,\n      count: count,\n      batchIds: batchIds,\n    });\n  }\n}\n\nconst createVerticesTaskProcessor = new TaskProcessor(\n  \"createVectorTilePolygons\",\n  5\n);\nconst scratchColor = new Color();\n\nfunction createPrimitive(polygons) {\n  if (defined(polygons._primitive)) {\n    return;\n  }\n\n  let positions = polygons._positions;\n  let counts = polygons._counts;\n  let indexCounts = polygons._indexCounts;\n  let indices = polygons._indices;\n\n  let batchIds = polygons._transferrableBatchIds;\n  let batchTableColors = polygons._batchTableColors;\n\n  let packedBuffer = polygons._packedBuffer;\n\n  if (!defined(batchTableColors)) {\n    // Copy because they may be the views on the same buffer.\n    positions = polygons._positions = polygons._positions.slice();\n    counts = polygons._counts = polygons._counts.slice();\n    indexCounts = polygons._indexCounts = polygons._indexCounts.slice();\n    indices = polygons._indices = polygons._indices.slice();\n\n    polygons._center = polygons._ellipsoid.cartographicToCartesian(\n      Rectangle.center(polygons._rectangle)\n    );\n\n    batchIds = polygons._transferrableBatchIds = new Uint32Array(\n      polygons._batchIds\n    );\n    batchTableColors = polygons._batchTableColors = new Uint32Array(\n      batchIds.length\n    );\n    const batchTable = polygons._batchTable;\n\n    const length = batchTableColors.length;\n    for (let i = 0; i < length; ++i) {\n      const color = batchTable.getColor(i, scratchColor);\n      batchTableColors[i] = color.toRgba();\n    }\n\n    packedBuffer = polygons._packedBuffer = packBuffer(polygons);\n  }\n\n  const transferrableObjects = [\n    positions.buffer,\n    counts.buffer,\n    indexCounts.buffer,\n    indices.buffer,\n    batchIds.buffer,\n    batchTableColors.buffer,\n    packedBuffer.buffer,\n  ];\n  const parameters = {\n    packedBuffer: packedBuffer.buffer,\n    positions: positions.buffer,\n    counts: counts.buffer,\n    indexCounts: indexCounts.buffer,\n    indices: indices.buffer,\n    batchIds: batchIds.buffer,\n    batchTableColors: batchTableColors.buffer,\n  };\n\n  let minimumHeights = polygons._polygonMinimumHeights;\n  let maximumHeights = polygons._polygonMaximumHeights;\n  if (defined(minimumHeights) && defined(maximumHeights)) {\n    minimumHeights = minimumHeights.slice();\n    maximumHeights = maximumHeights.slice();\n\n    transferrableObjects.push(minimumHeights.buffer, maximumHeights.buffer);\n    parameters.minimumHeights = minimumHeights;\n    parameters.maximumHeights = maximumHeights;\n  }\n\n  const verticesPromise = createVerticesTaskProcessor.scheduleTask(\n    parameters,\n    transferrableObjects\n  );\n  if (!defined(verticesPromise)) {\n    // Postponed\n    return;\n  }\n\n  return verticesPromise\n    .then((result) => {\n      if (polygons.isDestroyed()) {\n        return;\n      }\n\n      polygons._positions = undefined;\n      polygons._counts = undefined;\n      polygons._polygonMinimumHeights = undefined;\n      polygons._polygonMaximumHeights = undefined;\n\n      const packedBuffer = new Float64Array(result.packedBuffer);\n      const indexDatatype = packedBuffer[0];\n      unpackBuffer(polygons, packedBuffer);\n\n      polygons._indices =\n        IndexDatatype.getSizeInBytes(indexDatatype) === 2\n          ? new Uint16Array(result.indices)\n          : new Uint32Array(result.indices);\n      polygons._indexOffsets = new Uint32Array(result.indexOffsets);\n      polygons._indexCounts = new Uint32Array(result.indexCounts);\n\n      // will be released\n      polygons._batchedPositions = new Float32Array(result.positions);\n      polygons._vertexBatchIds = new Uint16Array(result.batchIds);\n\n      finishPrimitive(polygons);\n\n      polygons._ready = true;\n    })\n    .catch((error) => {\n      if (polygons.isDestroyed()) {\n        return;\n      }\n\n      // Throw the error next frame\n      polygons._error = error;\n    });\n}\n\nfunction finishPrimitive(polygons) {\n  if (!defined(polygons._primitive)) {\n    polygons._primitive = new Vector3DTilePrimitive({\n      batchTable: polygons._batchTable,\n      positions: polygons._batchedPositions,\n      batchIds: polygons._batchIds,\n      vertexBatchIds: polygons._vertexBatchIds,\n      indices: polygons._indices,\n      indexOffsets: polygons._indexOffsets,\n      indexCounts: polygons._indexCounts,\n      batchedIndices: polygons._batchedIndices,\n      boundingVolume: polygons._boundingVolume,\n      boundingVolumes: polygons._boundingVolumes,\n      center: polygons._center,\n    });\n\n    polygons._batchTable = undefined;\n    polygons._batchIds = undefined;\n    polygons._positions = undefined;\n    polygons._counts = undefined;\n    polygons._indices = undefined;\n    polygons._indexCounts = undefined;\n    polygons._indexOffsets = undefined;\n    polygons._batchTableColors = undefined;\n    polygons._packedBuffer = undefined;\n    polygons._batchedPositions = undefined;\n    polygons._transferrableBatchIds = undefined;\n    polygons._vertexBatchIds = undefined;\n    polygons._ellipsoid = undefined;\n    polygons._minimumHeight = undefined;\n    polygons._maximumHeight = undefined;\n    polygons._polygonMinimumHeights = undefined;\n    polygons._polygonMaximumHeights = undefined;\n    polygons._center = undefined;\n    polygons._rectangle = undefined;\n    polygons._boundingVolume = undefined;\n    polygons._boundingVolumes = undefined;\n    polygons._batchedIndices = undefined;\n  }\n}\n\n/**\n * Creates features for each polygon and places it at the batch id index of features.\n *\n * @param {Vector3DTileContent} content The vector tile content.\n * @param {Cesium3DTileFeature[]} features An array of features where the polygon features will be placed.\n */\nVector3DTilePolygons.prototype.createFeatures = function (content, features) {\n  this._primitive.createFeatures(content, features);\n};\n\n/**\n * Colors the entire tile when enabled is true. The resulting color will be (polygon batch table color * color).\n *\n * @param {boolean} enabled Whether to enable debug coloring.\n * @param {Color} color The debug color.\n */\nVector3DTilePolygons.prototype.applyDebugSettings = function (enabled, color) {\n  this._primitive.applyDebugSettings(enabled, color);\n};\n\n/**\n * Apply a style to the content.\n *\n * @param {Cesium3DTileStyle} style The style.\n * @param {Cesium3DTileFeature[]} features The array of features.\n */\nVector3DTilePolygons.prototype.applyStyle = function (style, features) {\n  this._primitive.applyStyle(style, features);\n};\n\n/**\n * Call when updating the color of a polygon with batchId changes color. The polygons will need to be re-batched\n * on the next update.\n *\n * @param {number} batchId The batch id of the polygon whose color has changed.\n * @param {Color} color The new polygon color.\n */\nVector3DTilePolygons.prototype.updateCommands = function (batchId, color) {\n  this._primitive.updateCommands(batchId, color);\n};\n\n/**\n * Updates the batches and queues the commands for rendering.\n *\n * @param {FrameState} frameState The current frame state.\n */\nVector3DTilePolygons.prototype.update = function (frameState) {\n  if (!this._ready) {\n    if (!defined(this._promise)) {\n      this._promise = createPrimitive(this);\n    }\n\n    if (defined(this._error)) {\n      const error = this._error;\n      this._error = undefined;\n      throw error;\n    }\n\n    return;\n  }\n\n  this._primitive.debugWireframe = this.debugWireframe;\n  this._primitive.forceRebatch = this.forceRebatch;\n  this._primitive.classificationType = this.classificationType;\n  this._primitive.update(frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nVector3DTilePolygons.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nVector3DTilePolygons.prototype.destroy = function () {\n  this._primitive = this._primitive && this._primitive.destroy();\n  return destroyObject(this);\n};\nexport default Vector3DTilePolygons;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec4 currentPosition;\\n\\\nin vec4 previousPosition;\\n\\\nin vec4 nextPosition;\\n\\\nin vec2 expandAndWidth;\\n\\\nin float a_batchId;\\n\\\n\\n\\\nuniform mat4 u_modifiedModelView;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    float expandDir = expandAndWidth.x;\\n\\\n    float width = abs(expandAndWidth.y) + 0.5;\\n\\\n    bool usePrev = expandAndWidth.y < 0.0;\\n\\\n\\n\\\n    vec4 p = u_modifiedModelView * currentPosition;\\n\\\n    vec4 prev = u_modifiedModelView * previousPosition;\\n\\\n    vec4 next = u_modifiedModelView * nextPosition;\\n\\\n\\n\\\n    float angle;\\n\\\n    vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);\\n\\\n    gl_Position = czm_viewportOrthographic * positionWC;\\n\\\n}\\n\\\n\";\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport PolylineCommon from \"../Shaders/PolylineCommon.js\";\nimport Vector3DTilePolylinesVS from \"../Shaders/Vector3DTilePolylinesVS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport Cesium3DTileFeature from \"./Cesium3DTileFeature.js\";\n\n/**\n * Creates a batch of polylines that have been subdivided to be draped on terrain.\n *\n * @alias Vector3DTilePolylines\n * @constructor\n *\n * @param {object} options An object with following properties:\n * @param {Uint16Array} options.positions The positions of the polylines\n * @param {Uint32Array} options.counts The number or positions in the each polyline.\n * @param {Uint16Array} options.widths The width of each polyline.\n * @param {number} options.minimumHeight The minimum height of the terrain covered by the tile.\n * @param {number} options.maximumHeight The maximum height of the terrain covered by the tile.\n * @param {Rectangle} options.rectangle The rectangle containing the tile.\n * @param {Cartesian3} [options.center=Cartesian3.ZERO] The RTC center.\n * @param {Cesium3DTileBatchTable} options.batchTable The batch table for the tile containing the batched polylines.\n * @param {Uint16Array} options.batchIds The batch ids for each polyline.\n * @param {BoundingSphere} options.boundingVolume The bounding volume for the entire batch of polylines.\n * @param {boolean} options.keepDecodedPositions Whether to keep decoded positions in memory.\n *\n * @private\n */\nfunction Vector3DTilePolylines(options) {\n  // these arrays are all released after the first update.\n  this._positions = options.positions;\n  this._widths = options.widths;\n  this._counts = options.counts;\n  this._batchIds = options.batchIds;\n\n  this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  this._minimumHeight = options.minimumHeight;\n  this._maximumHeight = options.maximumHeight;\n  this._center = options.center;\n  this._rectangle = options.rectangle;\n\n  this._boundingVolume = options.boundingVolume;\n  this._batchTable = options.batchTable;\n\n  this._va = undefined;\n  this._sp = undefined;\n  this._rs = undefined;\n  this._uniformMap = undefined;\n  this._command = undefined;\n\n  this._transferrableBatchIds = undefined;\n  this._packedBuffer = undefined;\n\n  this._keepDecodedPositions = options.keepDecodedPositions;\n  this._decodedPositions = undefined;\n  this._decodedPositionOffsets = undefined;\n\n  this._currentPositions = undefined;\n  this._previousPositions = undefined;\n  this._nextPositions = undefined;\n  this._expandAndWidth = undefined;\n  this._vertexBatchIds = undefined;\n  this._indices = undefined;\n\n  this._constantColor = Color.clone(Color.WHITE);\n  this._highlightColor = this._constantColor;\n\n  this._trianglesLength = 0;\n  this._geometryByteLength = 0;\n\n  this._ready = false;\n  this._promise = undefined;\n  this._error = undefined;\n}\n\nObject.defineProperties(Vector3DTilePolylines.prototype, {\n  /**\n   * Gets the number of triangles.\n   *\n   * @memberof Vector3DTilePolylines.prototype\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  trianglesLength: {\n    get: function () {\n      return this._trianglesLength;\n    },\n  },\n\n  /**\n   * Gets the geometry memory in bytes.\n   *\n   * @memberof Vector3DTilePolylines.prototype\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  geometryByteLength: {\n    get: function () {\n      return this._geometryByteLength;\n    },\n  },\n\n  /**\n   * Returns true when the primitive is ready to render.\n   * @memberof Vector3DTilePolylines.prototype\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n});\n\nfunction packBuffer(polylines) {\n  const rectangle = polylines._rectangle;\n  const minimumHeight = polylines._minimumHeight;\n  const maximumHeight = polylines._maximumHeight;\n  const ellipsoid = polylines._ellipsoid;\n  const center = polylines._center;\n\n  const packedLength =\n    2 +\n    Rectangle.packedLength +\n    Ellipsoid.packedLength +\n    Cartesian3.packedLength;\n  const packedBuffer = new Float64Array(packedLength);\n\n  let offset = 0;\n  packedBuffer[offset++] = minimumHeight;\n  packedBuffer[offset++] = maximumHeight;\n\n  Rectangle.pack(rectangle, packedBuffer, offset);\n  offset += Rectangle.packedLength;\n\n  Ellipsoid.pack(ellipsoid, packedBuffer, offset);\n  offset += Ellipsoid.packedLength;\n\n  Cartesian3.pack(center, packedBuffer, offset);\n\n  return packedBuffer;\n}\n\nconst createVerticesTaskProcessor = new TaskProcessor(\n  \"createVectorTilePolylines\",\n  5\n);\nconst attributeLocations = {\n  previousPosition: 0,\n  currentPosition: 1,\n  nextPosition: 2,\n  expandAndWidth: 3,\n  a_batchId: 4,\n};\n\nfunction createVertexArray(polylines, context) {\n  if (defined(polylines._va)) {\n    return;\n  }\n\n  let positions = polylines._positions;\n  let widths = polylines._widths;\n  let counts = polylines._counts;\n  let batchIds = polylines._transferrableBatchIds;\n\n  let packedBuffer = polylines._packedBuffer;\n\n  if (!defined(packedBuffer)) {\n    // Copy because they may be the views on the same buffer.\n    positions = polylines._positions = positions.slice();\n    widths = polylines._widths = widths.slice();\n    counts = polylines._counts = counts.slice();\n\n    batchIds = polylines._transferrableBatchIds = polylines._batchIds.slice();\n\n    packedBuffer = polylines._packedBuffer = packBuffer(polylines);\n  }\n\n  const transferrableObjects = [\n    positions.buffer,\n    widths.buffer,\n    counts.buffer,\n    batchIds.buffer,\n    packedBuffer.buffer,\n  ];\n  const parameters = {\n    positions: positions.buffer,\n    widths: widths.buffer,\n    counts: counts.buffer,\n    batchIds: batchIds.buffer,\n    packedBuffer: packedBuffer.buffer,\n    keepDecodedPositions: polylines._keepDecodedPositions,\n  };\n\n  const verticesPromise = createVerticesTaskProcessor.scheduleTask(\n    parameters,\n    transferrableObjects\n  );\n  if (!defined(verticesPromise)) {\n    // Postponed\n    return;\n  }\n\n  return verticesPromise\n    .then(function (result) {\n      if (polylines.isDestroyed()) {\n        return;\n      }\n\n      if (polylines._keepDecodedPositions) {\n        polylines._decodedPositions = new Float64Array(result.decodedPositions);\n        polylines._decodedPositionOffsets = new Uint32Array(\n          result.decodedPositionOffsets\n        );\n      }\n\n      polylines._currentPositions = new Float32Array(result.currentPositions);\n      polylines._previousPositions = new Float32Array(result.previousPositions);\n      polylines._nextPositions = new Float32Array(result.nextPositions);\n      polylines._expandAndWidth = new Float32Array(result.expandAndWidth);\n      polylines._vertexBatchIds = new Uint16Array(result.batchIds);\n\n      const indexDatatype = result.indexDatatype;\n      polylines._indices =\n        indexDatatype === IndexDatatype.UNSIGNED_SHORT\n          ? new Uint16Array(result.indices)\n          : new Uint32Array(result.indices);\n\n      finishVertexArray(polylines, context);\n\n      polylines._ready = true;\n    })\n    .catch((error) => {\n      if (polylines.isDestroyed()) {\n        return;\n      }\n\n      // Throw the error next frame\n      polylines._error = error;\n    });\n}\n\nfunction finishVertexArray(polylines, context) {\n  if (!defined(polylines._va)) {\n    const curPositions = polylines._currentPositions;\n    const prevPositions = polylines._previousPositions;\n    const nextPositions = polylines._nextPositions;\n    const expandAndWidth = polylines._expandAndWidth;\n    const vertexBatchIds = polylines._vertexBatchIds;\n    const indices = polylines._indices;\n\n    let byteLength =\n      prevPositions.byteLength +\n      curPositions.byteLength +\n      nextPositions.byteLength;\n    byteLength +=\n      expandAndWidth.byteLength +\n      vertexBatchIds.byteLength +\n      indices.byteLength;\n    polylines._trianglesLength = indices.length / 3;\n    polylines._geometryByteLength = byteLength;\n\n    const prevPositionBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: prevPositions,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    const curPositionBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: curPositions,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    const nextPositionBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: nextPositions,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    const expandAndWidthBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: expandAndWidth,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    const idBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: vertexBatchIds,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n\n    const indexBuffer = Buffer.createIndexBuffer({\n      context: context,\n      typedArray: indices,\n      usage: BufferUsage.STATIC_DRAW,\n      indexDatatype:\n        indices.BYTES_PER_ELEMENT === 2\n          ? IndexDatatype.UNSIGNED_SHORT\n          : IndexDatatype.UNSIGNED_INT,\n    });\n\n    const vertexAttributes = [\n      {\n        index: attributeLocations.previousPosition,\n        vertexBuffer: prevPositionBuffer,\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n      },\n      {\n        index: attributeLocations.currentPosition,\n        vertexBuffer: curPositionBuffer,\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n      },\n      {\n        index: attributeLocations.nextPosition,\n        vertexBuffer: nextPositionBuffer,\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n      },\n      {\n        index: attributeLocations.expandAndWidth,\n        vertexBuffer: expandAndWidthBuffer,\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 2,\n      },\n      {\n        index: attributeLocations.a_batchId,\n        vertexBuffer: idBuffer,\n        componentDatatype: ComponentDatatype.UNSIGNED_SHORT,\n        componentsPerAttribute: 1,\n      },\n    ];\n\n    polylines._va = new VertexArray({\n      context: context,\n      attributes: vertexAttributes,\n      indexBuffer: indexBuffer,\n    });\n\n    polylines._positions = undefined;\n    polylines._widths = undefined;\n    polylines._counts = undefined;\n\n    polylines._ellipsoid = undefined;\n    polylines._minimumHeight = undefined;\n    polylines._maximumHeight = undefined;\n    polylines._rectangle = undefined;\n\n    polylines._transferrableBatchIds = undefined;\n    polylines._packedBuffer = undefined;\n\n    polylines._currentPositions = undefined;\n    polylines._previousPositions = undefined;\n    polylines._nextPositions = undefined;\n    polylines._expandAndWidth = undefined;\n    polylines._vertexBatchIds = undefined;\n    polylines._indices = undefined;\n  }\n}\n\nconst modifiedModelViewScratch = new Matrix4();\nconst rtcScratch = new Cartesian3();\n\nfunction createUniformMap(primitive, context) {\n  if (defined(primitive._uniformMap)) {\n    return;\n  }\n\n  primitive._uniformMap = {\n    u_modifiedModelView: function () {\n      const viewMatrix = context.uniformState.view;\n      Matrix4.clone(viewMatrix, modifiedModelViewScratch);\n      Matrix4.multiplyByPoint(\n        modifiedModelViewScratch,\n        primitive._center,\n        rtcScratch\n      );\n      Matrix4.setTranslation(\n        modifiedModelViewScratch,\n        rtcScratch,\n        modifiedModelViewScratch\n      );\n      return modifiedModelViewScratch;\n    },\n    u_highlightColor: function () {\n      return primitive._highlightColor;\n    },\n  };\n}\n\nfunction createRenderStates(primitive) {\n  if (defined(primitive._rs)) {\n    return;\n  }\n\n  const polygonOffset = {\n    enabled: true,\n    factor: -5.0,\n    units: -5.0,\n  };\n\n  primitive._rs = RenderState.fromCache({\n    blending: BlendingState.ALPHA_BLEND,\n    depthMask: false,\n    depthTest: {\n      enabled: true,\n    },\n    polygonOffset: polygonOffset,\n  });\n}\n\nconst PolylineFS =\n  \"uniform vec4 u_highlightColor; \\n\" +\n  \"void main()\\n\" +\n  \"{\\n\" +\n  \"    out_FragColor = u_highlightColor;\\n\" +\n  \"}\\n\";\n\nfunction createShaders(primitive, context) {\n  if (defined(primitive._sp)) {\n    return;\n  }\n\n  const batchTable = primitive._batchTable;\n\n  const vsSource = batchTable.getVertexShaderCallback(\n    false,\n    \"a_batchId\",\n    undefined\n  )(Vector3DTilePolylinesVS);\n  const fsSource = batchTable.getFragmentShaderCallback(\n    false,\n    undefined,\n    false\n  )(PolylineFS);\n\n  const vs = new ShaderSource({\n    defines: [\n      \"VECTOR_TILE\",\n      !FeatureDetection.isInternetExplorer() ? \"CLIP_POLYLINE\" : \"\",\n    ],\n    sources: [PolylineCommon, vsSource],\n  });\n  const fs = new ShaderSource({\n    defines: [\"VECTOR_TILE\"],\n    sources: [fsSource],\n  });\n\n  primitive._sp = ShaderProgram.fromCache({\n    context: context,\n    vertexShaderSource: vs,\n    fragmentShaderSource: fs,\n    attributeLocations: attributeLocations,\n  });\n}\n\nfunction queueCommands(primitive, frameState) {\n  if (!defined(primitive._command)) {\n    const uniformMap = primitive._batchTable.getUniformMapCallback()(\n      primitive._uniformMap\n    );\n    primitive._command = new DrawCommand({\n      owner: primitive,\n      vertexArray: primitive._va,\n      renderState: primitive._rs,\n      shaderProgram: primitive._sp,\n      uniformMap: uniformMap,\n      boundingVolume: primitive._boundingVolume,\n      pass: Pass.TRANSLUCENT,\n      pickId: primitive._batchTable.getPickId(),\n    });\n  }\n\n  frameState.commandList.push(primitive._command);\n}\n\nVector3DTilePolylines.getPolylinePositions = function (polylines, batchId) {\n  const batchIds = polylines._batchIds;\n  const positions = polylines._decodedPositions;\n  const offsets = polylines._decodedPositionOffsets;\n\n  if (!defined(batchIds) || !defined(positions)) {\n    return undefined;\n  }\n\n  let i;\n  let j;\n  const polylinesLength = batchIds.length;\n  let positionsLength = 0;\n  let resultCounter = 0;\n\n  for (i = 0; i < polylinesLength; ++i) {\n    if (batchIds[i] === batchId) {\n      positionsLength += offsets[i + 1] - offsets[i];\n    }\n  }\n\n  if (positionsLength === 0) {\n    return undefined;\n  }\n\n  const results = new Float64Array(positionsLength * 3);\n\n  for (i = 0; i < polylinesLength; ++i) {\n    if (batchIds[i] === batchId) {\n      const offset = offsets[i];\n      const count = offsets[i + 1] - offset;\n      for (j = 0; j < count; ++j) {\n        const decodedOffset = (offset + j) * 3;\n        results[resultCounter++] = positions[decodedOffset];\n        results[resultCounter++] = positions[decodedOffset + 1];\n        results[resultCounter++] = positions[decodedOffset + 2];\n      }\n    }\n  }\n\n  return results;\n};\n\n/**\n * Get the polyline positions for the given feature.\n *\n * @param {number} batchId The batch ID of the feature.\n */\nVector3DTilePolylines.prototype.getPositions = function (batchId) {\n  return Vector3DTilePolylines.getPolylinePositions(this, batchId);\n};\n\n/**\n * Creates features for each polyline and places it at the batch id index of features.\n *\n * @param {Vector3DTileContent} content The vector tile content.\n * @param {Cesium3DTileFeature[]} features An array of features where the polygon features will be placed.\n */\nVector3DTilePolylines.prototype.createFeatures = function (content, features) {\n  const batchIds = this._batchIds;\n  const length = batchIds.length;\n  for (let i = 0; i < length; ++i) {\n    const batchId = batchIds[i];\n    features[batchId] = new Cesium3DTileFeature(content, batchId);\n  }\n};\n\n/**\n * Colors the entire tile when enabled is true. The resulting color will be (polyline batch table color * color).\n *\n * @param {boolean} enabled Whether to enable debug coloring.\n * @param {Color} color The debug color.\n */\nVector3DTilePolylines.prototype.applyDebugSettings = function (enabled, color) {\n  this._highlightColor = enabled ? color : this._constantColor;\n};\n\nfunction clearStyle(polygons, features) {\n  const batchIds = polygons._batchIds;\n  const length = batchIds.length;\n  for (let i = 0; i < length; ++i) {\n    const batchId = batchIds[i];\n    const feature = features[batchId];\n\n    feature.show = true;\n    feature.color = Color.WHITE;\n  }\n}\n\nconst scratchColor = new Color();\n\nconst DEFAULT_COLOR_VALUE = Color.WHITE;\nconst DEFAULT_SHOW_VALUE = true;\n\n/**\n * Apply a style to the content.\n *\n * @param {Cesium3DTileStyle} style The style.\n * @param {Cesium3DTileFeature[]} features The array of features.\n */\nVector3DTilePolylines.prototype.applyStyle = function (style, features) {\n  if (!defined(style)) {\n    clearStyle(this, features);\n    return;\n  }\n\n  const batchIds = this._batchIds;\n  const length = batchIds.length;\n  for (let i = 0; i < length; ++i) {\n    const batchId = batchIds[i];\n    const feature = features[batchId];\n\n    feature.color = defined(style.color)\n      ? style.color.evaluateColor(feature, scratchColor)\n      : DEFAULT_COLOR_VALUE;\n    feature.show = defined(style.show)\n      ? style.show.evaluate(feature)\n      : DEFAULT_SHOW_VALUE;\n  }\n};\n\n/**\n * Updates the batches and queues the commands for rendering.\n *\n * @param {FrameState} frameState The current frame state.\n */\nVector3DTilePolylines.prototype.update = function (frameState) {\n  const context = frameState.context;\n  if (!this._ready) {\n    if (!defined(this._promise)) {\n      this._promise = createVertexArray(this, context);\n    }\n\n    if (defined(this._error)) {\n      const error = this._error;\n      this._error = undefined;\n      throw error;\n    }\n\n    return;\n  }\n\n  createUniformMap(this, context);\n  createShaders(this, context);\n  createRenderStates(this);\n\n  const passes = frameState.passes;\n  if (passes.render || passes.pick) {\n    queueCommands(this, frameState);\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nVector3DTilePolylines.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nVector3DTilePolylines.prototype.destroy = function () {\n  this._va = this._va && this._va.destroy();\n  this._sp = this._sp && this._sp.destroy();\n  return destroyObject(this);\n};\nexport default Vector3DTilePolylines;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 startEllipsoidNormal;\\n\\\nin vec3 endEllipsoidNormal;\\n\\\nin vec4 startPositionAndHeight;\\n\\\nin vec4 endPositionAndHeight;\\n\\\nin vec4 startFaceNormalAndVertexCorner;\\n\\\nin vec4 endFaceNormalAndHalfWidth;\\n\\\nin float a_batchId;\\n\\\n\\n\\\nuniform mat4 u_modifiedModelView;\\n\\\nuniform vec2 u_minimumMaximumVectorHeights;\\n\\\n\\n\\\nout vec4 v_startPlaneEC;\\n\\\nout vec4 v_endPlaneEC;\\n\\\nout vec4 v_rightPlaneEC;\\n\\\nout float v_halfWidth;\\n\\\nout vec3 v_volumeUpEC;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    // vertex corner IDs\\n\\\n    //          3-----------7\\n\\\n    //         /|   left   /|\\n\\\n    //        / | 1       / |\\n\\\n    //       2-----------6  5  end\\n\\\n    //       | /         | /\\n\\\n    // start |/  right   |/\\n\\\n    //       0-----------4\\n\\\n    //\\n\\\n    float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end\\n\\\n    float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top\\n\\\n\\n\\\n    vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;\\n\\\n    vec3 right = normalize(cross(forward, startEllipsoidNormal));\\n\\\n\\n\\\n    vec4 position = vec4(startPositionAndHeight.xyz, 1.0);\\n\\\n    position.xyz += forward * isEnd;\\n\\\n\\n\\\n    v_volumeUpEC = czm_normal * normalize(cross(right, forward));\\n\\\n\\n\\\n    // Push for volume height\\n\\\n    float offset;\\n\\\n    vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);\\n\\\n\\n\\\n    // offset height to create volume\\n\\\n    offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);\\n\\\n    offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;\\n\\\n    position.xyz += offset * ellipsoidNormal;\\n\\\n\\n\\\n    // move from RTC to EC\\n\\\n    position = u_modifiedModelView * position;\\n\\\n    right = czm_normal * right;\\n\\\n\\n\\\n    // Push for width in a direction that is in the start or end plane and in a plane with right\\n\\\n    // N = normalEC (\\\"right-facing\\\" direction for push)\\n\\\n    // R = right\\n\\\n    // p = angle between N and R\\n\\\n    // w = distance to push along R if R == N\\n\\\n    // d = distance to push along N\\n\\\n    //\\n\\\n    //   N   R\\n\\\n    //  { \\ p| }      * cos(p) = dot(N, R) = w / d\\n\\\n    //  d\\ \\ |  |w    * d = w / dot(N, R)\\n\\\n    //    { \\| }\\n\\\n    //       o---------- polyline segment ---->\\n\\\n    //\\n\\\n    vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);\\n\\\n    scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));\\n\\\n    vec3 miterPushNormal = czm_normal * normalize(scratchNormal);\\n\\\n\\n\\\n    offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC\\n\\\n    offset = offset / dot(miterPushNormal, right);\\n\\\n    position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));\\n\\\n\\n\\\n    gl_Position = czm_depthClamp(czm_projection * position);\\n\\\n\\n\\\n    position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);\\n\\\n    vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;\\n\\\n    v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));\\n\\\n    v_rightPlaneEC = vec4(right, -dot(right, position.xyz));\\n\\\n\\n\\\n    position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);\\n\\\n    vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;\\n\\\n    v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));\\n\\\n    v_halfWidth = endFaceNormalAndHalfWidth.w;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec4 v_startPlaneEC;\\n\\\nin vec4 v_endPlaneEC;\\n\\\nin vec4 v_rightPlaneEC;\\n\\\nin float v_halfWidth;\\n\\\nin vec3 v_volumeUpEC;\\n\\\n\\n\\\nuniform vec4 u_highlightColor;\\n\\\nvoid main()\\n\\\n{\\n\\\n    float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));\\n\\\n\\n\\\n    // Discard for sky\\n\\\n    if (logDepthOrDepth == 0.0) {\\n\\\n#ifdef DEBUG_SHOW_VOLUME\\n\\\n        out_FragColor = vec4(0.0, 0.0, 1.0, 0.5);\\n\\\n        return;\\n\\\n#else // DEBUG_SHOW_VOLUME\\n\\\n        discard;\\n\\\n#endif // DEBUG_SHOW_VOLUME\\n\\\n    }\\n\\\n\\n\\\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\\n\\\n    eyeCoordinate /= eyeCoordinate.w;\\n\\\n\\n\\\n    float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);\\n\\\n\\n\\\n    // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction\\n\\\n    halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));\\n\\\n\\n\\\n    // Check distance of the eye coordinate against the right-facing plane\\n\\\n    float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);\\n\\\n\\n\\\n    // Check eye coordinate against the mitering planes\\n\\\n    float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);\\n\\\n    float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);\\n\\\n\\n\\\n    if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {\\n\\\n#ifdef DEBUG_SHOW_VOLUME\\n\\\n        out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);\\n\\\n        return;\\n\\\n#else // DEBUG_SHOW_VOLUME\\n\\\n        discard;\\n\\\n#endif // DEBUG_SHOW_VOLUME\\n\\\n    }\\n\\\n    out_FragColor = u_highlightColor;\\n\\\n\\n\\\n    czm_writeDepthClamp();\\n\\\n}\\n\\\n\";\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport PolylineCommon from \"../Shaders/PolylineCommon.js\";\nimport Vector3DTileClampedPolylinesVS from \"../Shaders/Vector3DTileClampedPolylinesVS.js\";\nimport Vector3DTileClampedPolylinesFS from \"../Shaders/Vector3DTileClampedPolylinesFS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport Cesium3DTileFeature from \"./Cesium3DTileFeature.js\";\nimport ClassificationType from \"./ClassificationType.js\";\nimport CullFace from \"./CullFace.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\nimport Vector3DTilePolylines from \"./Vector3DTilePolylines.js\";\n\n/**\n * Creates a batch of polylines as volumes with shader-adjustable width.\n *\n * @alias Vector3DTileClampedPolylines\n * @constructor\n *\n * @param {object} options An object with following properties:\n * @param {Uint16Array} options.positions The positions of the polylines\n * @param {Uint32Array} options.counts The number or positions in the each polyline.\n * @param {Uint16Array} options.widths The width of each polyline.\n * @param {number} options.minimumHeight The minimum height of the tile's region.\n * @param {number} options.maximumHeight The maximum height of the tile's region.\n * @param {Rectangle} options.rectangle The rectangle containing the tile.\n * @param {Cartesian3} [options.center=Cartesian3.ZERO] The RTC center.\n * @param {Cesium3DTileBatchTable} options.batchTable The batch table for the tile containing the batched polylines.\n * @param {Uint16Array} options.batchIds The batch ids for each polyline.\n * @param {ClassificationType} options.classificationType The classification type.\n * @param {boolean} options.keepDecodedPositions Whether to keep decoded positions in memory.\n *\n * @private\n */\nfunction Vector3DTileClampedPolylines(options) {\n  // these arrays hold data from the tile payload\n  // and are all released after the first update.\n  this._positions = options.positions;\n  this._widths = options.widths;\n  this._counts = options.counts;\n  this._batchIds = options.batchIds;\n\n  this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  this._minimumHeight = options.minimumHeight;\n  this._maximumHeight = options.maximumHeight;\n  this._center = options.center;\n  this._rectangle = options.rectangle;\n\n  this._batchTable = options.batchTable;\n\n  this._va = undefined;\n  this._sp = undefined;\n  this._rs = undefined;\n  this._uniformMap = undefined;\n  this._command = undefined;\n\n  this._transferrableBatchIds = undefined;\n  this._packedBuffer = undefined;\n  this._minimumMaximumVectorHeights = new Cartesian2(\n    ApproximateTerrainHeights._defaultMinTerrainHeight,\n    ApproximateTerrainHeights._defaultMaxTerrainHeight\n  );\n  this._boundingVolume = OrientedBoundingBox.fromRectangle(\n    options.rectangle,\n    ApproximateTerrainHeights._defaultMinTerrainHeight,\n    ApproximateTerrainHeights._defaultMaxTerrainHeight,\n    this._ellipsoid\n  );\n  this._classificationType = options.classificationType;\n\n  this._keepDecodedPositions = options.keepDecodedPositions;\n  this._decodedPositions = undefined;\n  this._decodedPositionOffsets = undefined;\n\n  // Fat vertices - all information for each volume packed to a vec3 and 5 vec4s\n  this._startEllipsoidNormals = undefined;\n  this._endEllipsoidNormals = undefined;\n  this._startPositionAndHeights = undefined;\n  this._startFaceNormalAndVertexCornerIds = undefined;\n  this._endPositionAndHeights = undefined;\n  this._endFaceNormalAndHalfWidths = undefined;\n  this._vertexBatchIds = undefined;\n\n  this._indices = undefined;\n\n  this._constantColor = Color.clone(Color.WHITE);\n  this._highlightColor = this._constantColor;\n\n  this._trianglesLength = 0;\n  this._geometryByteLength = 0;\n\n  this._ready = false;\n  this._promise = undefined;\n  this._error = undefined;\n}\n\nObject.defineProperties(Vector3DTileClampedPolylines.prototype, {\n  /**\n   * Gets the number of triangles.\n   *\n   * @memberof Vector3DTileClampedPolylines.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  trianglesLength: {\n    get: function () {\n      return this._trianglesLength;\n    },\n  },\n\n  /**\n   * Gets the geometry memory in bytes.\n   *\n   * @memberof Vector3DTileClampedPolylines.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  geometryByteLength: {\n    get: function () {\n      return this._geometryByteLength;\n    },\n  },\n\n  /**\n   * Returns true when the primitive is ready to render.\n   * @memberof Vector3DTileClampedPolylines.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n});\n\nfunction updateMinimumMaximumHeights(polylines, rectangle, ellipsoid) {\n  const result = ApproximateTerrainHeights.getMinimumMaximumHeights(\n    rectangle,\n    ellipsoid\n  );\n  const min = result.minimumTerrainHeight;\n  const max = result.maximumTerrainHeight;\n  const minimumMaximumVectorHeights = polylines._minimumMaximumVectorHeights;\n  minimumMaximumVectorHeights.x = min;\n  minimumMaximumVectorHeights.y = max;\n\n  const obb = polylines._boundingVolume;\n  const rect = polylines._rectangle;\n  OrientedBoundingBox.fromRectangle(rect, min, max, ellipsoid, obb);\n}\n\nfunction packBuffer(polylines) {\n  const rectangle = polylines._rectangle;\n  const minimumHeight = polylines._minimumHeight;\n  const maximumHeight = polylines._maximumHeight;\n  const ellipsoid = polylines._ellipsoid;\n  const center = polylines._center;\n\n  const packedLength =\n    2 +\n    Rectangle.packedLength +\n    Ellipsoid.packedLength +\n    Cartesian3.packedLength;\n  const packedBuffer = new Float64Array(packedLength);\n\n  let offset = 0;\n  packedBuffer[offset++] = minimumHeight;\n  packedBuffer[offset++] = maximumHeight;\n\n  Rectangle.pack(rectangle, packedBuffer, offset);\n  offset += Rectangle.packedLength;\n\n  Ellipsoid.pack(ellipsoid, packedBuffer, offset);\n  offset += Ellipsoid.packedLength;\n\n  Cartesian3.pack(center, packedBuffer, offset);\n\n  return packedBuffer;\n}\n\nconst createVerticesTaskProcessor = new TaskProcessor(\n  \"createVectorTileClampedPolylines\"\n);\nconst attributeLocations = {\n  startEllipsoidNormal: 0,\n  endEllipsoidNormal: 1,\n  startPositionAndHeight: 2,\n  endPositionAndHeight: 3,\n  startFaceNormalAndVertexCorner: 4,\n  endFaceNormalAndHalfWidth: 5,\n  a_batchId: 6,\n};\n\nfunction createVertexArray(polylines, context) {\n  if (defined(polylines._va)) {\n    return;\n  }\n\n  let positions = polylines._positions;\n  let widths = polylines._widths;\n  let counts = polylines._counts;\n  let batchIds = polylines._transferrableBatchIds;\n\n  let packedBuffer = polylines._packedBuffer;\n\n  if (!defined(packedBuffer)) {\n    // Copy because they may be the views on the same buffer.\n    positions = polylines._positions = positions.slice();\n    widths = polylines._widths = widths.slice();\n    counts = polylines._counts = counts.slice();\n\n    batchIds = polylines._transferrableBatchIds = polylines._batchIds.slice();\n\n    packedBuffer = polylines._packedBuffer = packBuffer(polylines);\n  }\n\n  const transferrableObjects = [\n    positions.buffer,\n    widths.buffer,\n    counts.buffer,\n    batchIds.buffer,\n    packedBuffer.buffer,\n  ];\n  const parameters = {\n    positions: positions.buffer,\n    widths: widths.buffer,\n    counts: counts.buffer,\n    batchIds: batchIds.buffer,\n    packedBuffer: packedBuffer.buffer,\n    keepDecodedPositions: polylines._keepDecodedPositions,\n  };\n\n  const verticesPromise = createVerticesTaskProcessor.scheduleTask(\n    parameters,\n    transferrableObjects\n  );\n  if (!defined(verticesPromise)) {\n    // Postponed\n    return;\n  }\n\n  return verticesPromise\n    .then(function (result) {\n      if (polylines.isDestroyed()) {\n        return;\n      }\n\n      if (polylines._keepDecodedPositions) {\n        polylines._decodedPositions = new Float64Array(result.decodedPositions);\n        polylines._decodedPositionOffsets = new Uint32Array(\n          result.decodedPositionOffsets\n        );\n      }\n\n      polylines._startEllipsoidNormals = new Float32Array(\n        result.startEllipsoidNormals\n      );\n      polylines._endEllipsoidNormals = new Float32Array(\n        result.endEllipsoidNormals\n      );\n      polylines._startPositionAndHeights = new Float32Array(\n        result.startPositionAndHeights\n      );\n      polylines._startFaceNormalAndVertexCornerIds = new Float32Array(\n        result.startFaceNormalAndVertexCornerIds\n      );\n      polylines._endPositionAndHeights = new Float32Array(\n        result.endPositionAndHeights\n      );\n      polylines._endFaceNormalAndHalfWidths = new Float32Array(\n        result.endFaceNormalAndHalfWidths\n      );\n      polylines._vertexBatchIds = new Uint16Array(result.vertexBatchIds);\n\n      const indexDatatype = result.indexDatatype;\n      polylines._indices =\n        indexDatatype === IndexDatatype.UNSIGNED_SHORT\n          ? new Uint16Array(result.indices)\n          : new Uint32Array(result.indices);\n\n      finishVertexArray(polylines, context);\n      polylines._ready = true;\n    })\n    .catch((error) => {\n      if (polylines.isDestroyed()) {\n        return;\n      }\n\n      // Throw the error next frame\n      polylines._error = error;\n    });\n}\n\nfunction finishVertexArray(polylines, context) {\n  if (!defined(polylines._va)) {\n    const startEllipsoidNormals = polylines._startEllipsoidNormals;\n    const endEllipsoidNormals = polylines._endEllipsoidNormals;\n    const startPositionAndHeights = polylines._startPositionAndHeights;\n    const endPositionAndHeights = polylines._endPositionAndHeights;\n    const startFaceNormalAndVertexCornerIds =\n      polylines._startFaceNormalAndVertexCornerIds;\n    const endFaceNormalAndHalfWidths = polylines._endFaceNormalAndHalfWidths;\n    const batchIdAttribute = polylines._vertexBatchIds;\n\n    const indices = polylines._indices;\n\n    let byteLength =\n      startEllipsoidNormals.byteLength + endEllipsoidNormals.byteLength;\n    byteLength +=\n      startPositionAndHeights.byteLength + endPositionAndHeights.byteLength;\n    byteLength +=\n      startFaceNormalAndVertexCornerIds.byteLength +\n      endFaceNormalAndHalfWidths.byteLength;\n    byteLength += batchIdAttribute.byteLength + indices.byteLength;\n\n    polylines._trianglesLength = indices.length / 3;\n    polylines._geometryByteLength = byteLength;\n\n    const startEllipsoidNormalsBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: startEllipsoidNormals,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    const endEllipsoidNormalsBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: endEllipsoidNormals,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    const startPositionAndHeightsBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: startPositionAndHeights,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    const endPositionAndHeightsBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: endPositionAndHeights,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    const startFaceNormalAndVertexCornerIdsBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: startFaceNormalAndVertexCornerIds,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    const endFaceNormalAndHalfWidthsBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: endFaceNormalAndHalfWidths,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    const batchIdAttributeBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: batchIdAttribute,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n\n    const indexBuffer = Buffer.createIndexBuffer({\n      context: context,\n      typedArray: indices,\n      usage: BufferUsage.STATIC_DRAW,\n      indexDatatype:\n        indices.BYTES_PER_ELEMENT === 2\n          ? IndexDatatype.UNSIGNED_SHORT\n          : IndexDatatype.UNSIGNED_INT,\n    });\n\n    const vertexAttributes = [\n      {\n        index: attributeLocations.startEllipsoidNormal,\n        vertexBuffer: startEllipsoidNormalsBuffer,\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n      },\n      {\n        index: attributeLocations.endEllipsoidNormal,\n        vertexBuffer: endEllipsoidNormalsBuffer,\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n      },\n      {\n        index: attributeLocations.startPositionAndHeight,\n        vertexBuffer: startPositionAndHeightsBuffer,\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 4,\n      },\n      {\n        index: attributeLocations.endPositionAndHeight,\n        vertexBuffer: endPositionAndHeightsBuffer,\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 4,\n      },\n      {\n        index: attributeLocations.startFaceNormalAndVertexCorner,\n        vertexBuffer: startFaceNormalAndVertexCornerIdsBuffer,\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 4,\n      },\n      {\n        index: attributeLocations.endFaceNormalAndHalfWidth,\n        vertexBuffer: endFaceNormalAndHalfWidthsBuffer,\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 4,\n      },\n      {\n        index: attributeLocations.a_batchId,\n        vertexBuffer: batchIdAttributeBuffer,\n        componentDatatype: ComponentDatatype.UNSIGNED_SHORT,\n        componentsPerAttribute: 1,\n      },\n    ];\n\n    polylines._va = new VertexArray({\n      context: context,\n      attributes: vertexAttributes,\n      indexBuffer: indexBuffer,\n    });\n\n    polylines._positions = undefined;\n    polylines._widths = undefined;\n    polylines._counts = undefined;\n\n    polylines._ellipsoid = undefined;\n    polylines._minimumHeight = undefined;\n    polylines._maximumHeight = undefined;\n    polylines._rectangle = undefined;\n\n    polylines._transferrableBatchIds = undefined;\n    polylines._packedBuffer = undefined;\n\n    polylines._startEllipsoidNormals = undefined;\n    polylines._endEllipsoidNormals = undefined;\n    polylines._startPositionAndHeights = undefined;\n    polylines._startFaceNormalAndVertexCornerIds = undefined;\n    polylines._endPositionAndHeights = undefined;\n    polylines._endFaceNormalAndHalfWidths = undefined;\n    polylines._vertexBatchIds = undefined;\n\n    polylines._indices = undefined;\n  }\n}\n\nconst modifiedModelViewScratch = new Matrix4();\nconst rtcScratch = new Cartesian3();\n\nfunction createUniformMap(primitive, context) {\n  if (defined(primitive._uniformMap)) {\n    return;\n  }\n\n  primitive._uniformMap = {\n    u_modifiedModelView: function () {\n      const viewMatrix = context.uniformState.view;\n      Matrix4.clone(viewMatrix, modifiedModelViewScratch);\n      Matrix4.multiplyByPoint(\n        modifiedModelViewScratch,\n        primitive._center,\n        rtcScratch\n      );\n      Matrix4.setTranslation(\n        modifiedModelViewScratch,\n        rtcScratch,\n        modifiedModelViewScratch\n      );\n      return modifiedModelViewScratch;\n    },\n    u_highlightColor: function () {\n      return primitive._highlightColor;\n    },\n    u_minimumMaximumVectorHeights: function () {\n      return primitive._minimumMaximumVectorHeights;\n    },\n  };\n}\n\nfunction getRenderState(mask3DTiles) {\n  /**\n   * Cull front faces of each volume (relative to camera) to prevent\n   * classification drawing from both the front and back faces, double-draw.\n   * The geometry is \"inverted\" (inside-out winding order for the indices) but\n   * the vertex shader seems to re-invert so that the triangles face \"out\" again.\n   * So cull FRONT faces.\n   */\n  return RenderState.fromCache({\n    cull: {\n      enabled: true,\n      face: CullFace.FRONT,\n    },\n    blending: BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,\n    depthMask: false,\n    stencilTest: {\n      enabled: mask3DTiles,\n      frontFunction: StencilFunction.EQUAL,\n      frontOperation: {\n        fail: StencilOperation.KEEP,\n        zFail: StencilOperation.KEEP,\n        zPass: StencilOperation.KEEP,\n      },\n      backFunction: StencilFunction.EQUAL,\n      backOperation: {\n        fail: StencilOperation.KEEP,\n        zFail: StencilOperation.KEEP,\n        zPass: StencilOperation.KEEP,\n      },\n      reference: StencilConstants.CESIUM_3D_TILE_MASK,\n      mask: StencilConstants.CESIUM_3D_TILE_MASK,\n    },\n  });\n}\n\nfunction createRenderStates(primitive) {\n  if (defined(primitive._rs)) {\n    return;\n  }\n\n  primitive._rs = getRenderState(false);\n  primitive._rs3DTiles = getRenderState(true);\n}\n\nfunction createShaders(primitive, context) {\n  if (defined(primitive._sp)) {\n    return;\n  }\n\n  const batchTable = primitive._batchTable;\n\n  const vsSource = batchTable.getVertexShaderCallback(\n    false,\n    \"a_batchId\",\n    undefined\n  )(Vector3DTileClampedPolylinesVS);\n  const fsSource = batchTable.getFragmentShaderCallback(\n    false,\n    undefined,\n    true\n  )(Vector3DTileClampedPolylinesFS);\n\n  const vs = new ShaderSource({\n    defines: [\n      \"VECTOR_TILE\",\n      !FeatureDetection.isInternetExplorer() ? \"CLIP_POLYLINE\" : \"\",\n    ],\n    sources: [PolylineCommon, vsSource],\n  });\n  const fs = new ShaderSource({\n    defines: [\"VECTOR_TILE\"],\n    sources: [fsSource],\n  });\n\n  primitive._sp = ShaderProgram.fromCache({\n    context: context,\n    vertexShaderSource: vs,\n    fragmentShaderSource: fs,\n    attributeLocations: attributeLocations,\n  });\n}\n\nfunction queueCommands(primitive, frameState) {\n  let command = primitive._command;\n  if (!defined(primitive._command)) {\n    const uniformMap = primitive._batchTable.getUniformMapCallback()(\n      primitive._uniformMap\n    );\n    command = primitive._command = new DrawCommand({\n      owner: primitive,\n      vertexArray: primitive._va,\n      renderState: primitive._rs,\n      shaderProgram: primitive._sp,\n      uniformMap: uniformMap,\n      boundingVolume: primitive._boundingVolume,\n      pass: Pass.TERRAIN_CLASSIFICATION,\n      pickId: primitive._batchTable.getPickId(),\n    });\n\n    const derivedTilesetCommand = DrawCommand.shallowClone(\n      command,\n      command.derivedCommands.tileset\n    );\n    derivedTilesetCommand.renderState = primitive._rs3DTiles;\n    derivedTilesetCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n    command.derivedCommands.tileset = derivedTilesetCommand;\n  }\n\n  const classificationType = primitive._classificationType;\n  if (\n    classificationType === ClassificationType.TERRAIN ||\n    classificationType === ClassificationType.BOTH\n  ) {\n    frameState.commandList.push(command);\n  }\n  if (\n    classificationType === ClassificationType.CESIUM_3D_TILE ||\n    classificationType === ClassificationType.BOTH\n  ) {\n    frameState.commandList.push(command.derivedCommands.tileset);\n  }\n}\n\n/**\n * Get the polyline positions for the given feature.\n *\n * @param {number} batchId The batch ID of the feature.\n */\nVector3DTileClampedPolylines.prototype.getPositions = function (batchId) {\n  return Vector3DTilePolylines.getPolylinePositions(this, batchId);\n};\n\n/**\n * Creates features for each polyline and places it at the batch id index of features.\n *\n * @param {Vector3DTileContent} content The vector tile content.\n * @param {Cesium3DTileFeature[]} features An array of features where the polygon features will be placed.\n */\nVector3DTileClampedPolylines.prototype.createFeatures = function (\n  content,\n  features\n) {\n  const batchIds = this._batchIds;\n  const length = batchIds.length;\n  for (let i = 0; i < length; ++i) {\n    const batchId = batchIds[i];\n    features[batchId] = new Cesium3DTileFeature(content, batchId);\n  }\n};\n\n/**\n * Colors the entire tile when enabled is true. The resulting color will be (polyline batch table color * color).\n *\n * @param {boolean} enabled Whether to enable debug coloring.\n * @param {Color} color The debug color.\n */\nVector3DTileClampedPolylines.prototype.applyDebugSettings = function (\n  enabled,\n  color\n) {\n  this._highlightColor = enabled ? color : this._constantColor;\n};\n\nfunction clearStyle(polygons, features) {\n  const batchIds = polygons._batchIds;\n  const length = batchIds.length;\n  for (let i = 0; i < length; ++i) {\n    const batchId = batchIds[i];\n    const feature = features[batchId];\n\n    feature.show = true;\n    feature.color = Color.WHITE;\n  }\n}\n\nconst scratchColor = new Color();\n\nconst DEFAULT_COLOR_VALUE = Color.WHITE;\nconst DEFAULT_SHOW_VALUE = true;\n\n/**\n * Apply a style to the content.\n *\n * @param {Cesium3DTileStyle} style The style.\n * @param {Cesium3DTileFeature[]} features The dictionary of features.\n */\nVector3DTileClampedPolylines.prototype.applyStyle = function (style, features) {\n  if (!defined(style)) {\n    clearStyle(this, features);\n    return;\n  }\n\n  const batchIds = this._batchIds;\n  const length = batchIds.length;\n  for (let i = 0; i < length; ++i) {\n    const batchId = batchIds[i];\n    const feature = features[batchId];\n\n    feature.color = defined(style.color)\n      ? style.color.evaluateColor(feature, scratchColor)\n      : DEFAULT_COLOR_VALUE;\n    feature.show = defined(style.show)\n      ? style.show.evaluate(feature)\n      : DEFAULT_SHOW_VALUE;\n  }\n};\n\nfunction initialize(polylines) {\n  return ApproximateTerrainHeights.initialize()\n    .then(function () {\n      updateMinimumMaximumHeights(\n        polylines,\n        polylines._rectangle,\n        polylines._ellipsoid\n      );\n    })\n    .catch((error) => {\n      if (polylines.isDestroyed()) {\n        return;\n      }\n\n      // Throw the error next frame\n      polylines._error = error;\n    });\n}\n\n/**\n * Updates the batches and queues the commands for rendering.\n *\n * @param {FrameState} frameState The current frame state.\n */\nVector3DTileClampedPolylines.prototype.update = function (frameState) {\n  const context = frameState.context;\n  if (!this._ready) {\n    if (!defined(this._promise)) {\n      this._promise = initialize(this).then(createVertexArray(this, context));\n    }\n\n    if (defined(this._error)) {\n      const error = this._error;\n      this._error = undefined;\n      throw error;\n    }\n\n    return;\n  }\n\n  createUniformMap(this, context);\n  createShaders(this, context);\n  createRenderStates(this);\n\n  const passes = frameState.passes;\n  if (passes.render || passes.pick) {\n    queueCommands(this, frameState);\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nVector3DTileClampedPolylines.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nVector3DTileClampedPolylines.prototype.destroy = function () {\n  this._va = this._va && this._va.destroy();\n  this._sp = this._sp && this._sp.destroy();\n  return destroyObject(this);\n};\nexport default Vector3DTileClampedPolylines;\n", "import AttributeCompression from \"./AttributeCompression.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport CesiumMath from \"./Math.js\";\n\nconst maxShort = 32767;\n\nconst scratchBVCartographic = new Cartographic();\nconst scratchEncodedPosition = new Cartesian3();\n\nfunction decodeVectorPolylinePositions(\n  positions,\n  rectangle,\n  minimumHeight,\n  maximumHeight,\n  ellipsoid\n) {\n  const positionsLength = positions.length / 3;\n  const uBuffer = positions.subarray(0, positionsLength);\n  const vBuffer = positions.subarray(positionsLength, 2 * positionsLength);\n  const heightBuffer = positions.subarray(\n    2 * positionsLength,\n    3 * positionsLength\n  );\n  AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);\n\n  const decoded = new Float64Array(positions.length);\n  for (let i = 0; i < positionsLength; ++i) {\n    const u = uBuffer[i];\n    const v = vBuffer[i];\n    const h = heightBuffer[i];\n\n    const lon = CesiumMath.lerp(rectangle.west, rectangle.east, u / maxShort);\n    const lat = CesiumMath.lerp(rectangle.south, rectangle.north, v / maxShort);\n    const alt = CesiumMath.lerp(minimumHeight, maximumHeight, h / maxShort);\n\n    const cartographic = Cartographic.fromRadians(\n      lon,\n      lat,\n      alt,\n      scratchBVCartographic\n    );\n    const decodedPosition = ellipsoid.cartographicToCartesian(\n      cartographic,\n      scratchEncodedPosition\n    );\n    Cartesian3.pack(decodedPosition, decoded, i * 3);\n  }\n  return decoded;\n}\nexport default decodeVectorPolylinePositions;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Cesium3DTileBatchTable from \"./Cesium3DTileBatchTable.js\";\nimport Cesium3DTileFeatureTable from \"./Cesium3DTileFeatureTable.js\";\nimport Vector3DTilePoints from \"./Vector3DTilePoints.js\";\nimport Vector3DTilePolygons from \"./Vector3DTilePolygons.js\";\nimport Vector3DTilePolylines from \"./Vector3DTilePolylines.js\";\nimport Vector3DTileClampedPolylines from \"./Vector3DTileClampedPolylines.js\";\nimport decodeVectorPolylinePositions from \"../Core/decodeVectorPolylinePositions.js\";\n\n/**\n * Represents the contents of a\n * {@link https://github.com/CesiumGS/3d-tiles/tree/vctr/TileFormats/VectorData|Vector}\n * tile in a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles} tileset.\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n *\n * @alias Vector3DTileContent\n * @constructor\n *\n * @private\n */\nfunction Vector3DTileContent(tileset, tile, resource, arrayBuffer, byteOffset) {\n  this._tileset = tileset;\n  this._tile = tile;\n  this._resource = resource;\n\n  this._polygons = undefined;\n  this._polylines = undefined;\n  this._points = undefined;\n\n  this._metadata = undefined;\n\n  this._batchTable = undefined;\n  this._features = undefined;\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface.\n   */\n  this.featurePropertiesDirty = false;\n  this._group = undefined;\n\n  this._ready = false;\n\n  initialize(this, arrayBuffer, byteOffset);\n}\n\nObject.defineProperties(Vector3DTileContent.prototype, {\n  featuresLength: {\n    get: function () {\n      return defined(this._batchTable) ? this._batchTable.featuresLength : 0;\n    },\n  },\n\n  pointsLength: {\n    get: function () {\n      if (defined(this._points)) {\n        return this._points.pointsLength;\n      }\n      return 0;\n    },\n  },\n\n  trianglesLength: {\n    get: function () {\n      let trianglesLength = 0;\n      if (defined(this._polygons)) {\n        trianglesLength += this._polygons.trianglesLength;\n      }\n      if (defined(this._polylines)) {\n        trianglesLength += this._polylines.trianglesLength;\n      }\n      return trianglesLength;\n    },\n  },\n\n  geometryByteLength: {\n    get: function () {\n      let geometryByteLength = 0;\n      if (defined(this._polygons)) {\n        geometryByteLength += this._polygons.geometryByteLength;\n      }\n      if (defined(this._polylines)) {\n        geometryByteLength += this._polylines.geometryByteLength;\n      }\n      return geometryByteLength;\n    },\n  },\n\n  texturesByteLength: {\n    get: function () {\n      if (defined(this._points)) {\n        return this._points.texturesByteLength;\n      }\n      return 0;\n    },\n  },\n\n  batchTableByteLength: {\n    get: function () {\n      return defined(this._batchTable)\n        ? this._batchTable.batchTableByteLength\n        : 0;\n    },\n  },\n\n  innerContents: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Returns true when the tile's content is ready to render; otherwise false\n   *\n   * @memberof Vector3DTileContent.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n\n  tileset: {\n    get: function () {\n      return this._tileset;\n    },\n  },\n\n  tile: {\n    get: function () {\n      return this._tile;\n    },\n  },\n\n  url: {\n    get: function () {\n      return this._resource.getUrlComponent(true);\n    },\n  },\n\n  metadata: {\n    get: function () {\n      return this._metadata;\n    },\n    set: function (value) {\n      this._metadata = value;\n    },\n  },\n\n  batchTable: {\n    get: function () {\n      return this._batchTable;\n    },\n  },\n\n  group: {\n    get: function () {\n      return this._group;\n    },\n    set: function (value) {\n      this._group = value;\n    },\n  },\n});\n\nfunction createColorChangedCallback(content) {\n  return function (batchId, color) {\n    if (defined(content._polygons)) {\n      content._polygons.updateCommands(batchId, color);\n    }\n  };\n}\n\nfunction getBatchIds(featureTableJson, featureTableBinary) {\n  let polygonBatchIds;\n  let polylineBatchIds;\n  let pointBatchIds;\n  let i;\n\n  const numberOfPolygons = defaultValue(featureTableJson.POLYGONS_LENGTH, 0);\n  const numberOfPolylines = defaultValue(featureTableJson.POLYLINES_LENGTH, 0);\n  const numberOfPoints = defaultValue(featureTableJson.POINTS_LENGTH, 0);\n\n  if (numberOfPolygons > 0 && defined(featureTableJson.POLYGON_BATCH_IDS)) {\n    const polygonBatchIdsByteOffset =\n      featureTableBinary.byteOffset +\n      featureTableJson.POLYGON_BATCH_IDS.byteOffset;\n    polygonBatchIds = new Uint16Array(\n      featureTableBinary.buffer,\n      polygonBatchIdsByteOffset,\n      numberOfPolygons\n    );\n  }\n\n  if (numberOfPolylines > 0 && defined(featureTableJson.POLYLINE_BATCH_IDS)) {\n    const polylineBatchIdsByteOffset =\n      featureTableBinary.byteOffset +\n      featureTableJson.POLYLINE_BATCH_IDS.byteOffset;\n    polylineBatchIds = new Uint16Array(\n      featureTableBinary.buffer,\n      polylineBatchIdsByteOffset,\n      numberOfPolylines\n    );\n  }\n\n  if (numberOfPoints > 0 && defined(featureTableJson.POINT_BATCH_IDS)) {\n    const pointBatchIdsByteOffset =\n      featureTableBinary.byteOffset +\n      featureTableJson.POINT_BATCH_IDS.byteOffset;\n    pointBatchIds = new Uint16Array(\n      featureTableBinary.buffer,\n      pointBatchIdsByteOffset,\n      numberOfPoints\n    );\n  }\n\n  const atLeastOneDefined =\n    defined(polygonBatchIds) ||\n    defined(polylineBatchIds) ||\n    defined(pointBatchIds);\n  const atLeastOneUndefined =\n    (numberOfPolygons > 0 && !defined(polygonBatchIds)) ||\n    (numberOfPolylines > 0 && !defined(polylineBatchIds)) ||\n    (numberOfPoints > 0 && !defined(pointBatchIds));\n\n  if (atLeastOneDefined && atLeastOneUndefined) {\n    throw new RuntimeError(\n      \"If one group of batch ids is defined, then all batch ids must be defined\"\n    );\n  }\n\n  const allUndefinedBatchIds =\n    !defined(polygonBatchIds) &&\n    !defined(polylineBatchIds) &&\n    !defined(pointBatchIds);\n  if (allUndefinedBatchIds) {\n    let id = 0;\n    if (!defined(polygonBatchIds) && numberOfPolygons > 0) {\n      polygonBatchIds = new Uint16Array(numberOfPolygons);\n      for (i = 0; i < numberOfPolygons; ++i) {\n        polygonBatchIds[i] = id++;\n      }\n    }\n    if (!defined(polylineBatchIds) && numberOfPolylines > 0) {\n      polylineBatchIds = new Uint16Array(numberOfPolylines);\n      for (i = 0; i < numberOfPolylines; ++i) {\n        polylineBatchIds[i] = id++;\n      }\n    }\n    if (!defined(pointBatchIds) && numberOfPoints > 0) {\n      pointBatchIds = new Uint16Array(numberOfPoints);\n      for (i = 0; i < numberOfPoints; ++i) {\n        pointBatchIds[i] = id++;\n      }\n    }\n  }\n\n  return {\n    polygons: polygonBatchIds,\n    polylines: polylineBatchIds,\n    points: pointBatchIds,\n  };\n}\n\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\n\nfunction createFloatingPolylines(options) {\n  return new Vector3DTilePolylines(options);\n}\n\nfunction createClampedPolylines(options) {\n  return new Vector3DTileClampedPolylines(options);\n}\n\nfunction initialize(content, arrayBuffer, byteOffset) {\n  byteOffset = defaultValue(byteOffset, 0);\n\n  const uint8Array = new Uint8Array(arrayBuffer);\n  const view = new DataView(arrayBuffer);\n  byteOffset += sizeOfUint32; // Skip magic number\n\n  const version = view.getUint32(byteOffset, true);\n  if (version !== 1) {\n    throw new RuntimeError(\n      `Only Vector tile version 1 is supported.  Version ${version} is not.`\n    );\n  }\n  byteOffset += sizeOfUint32;\n\n  const byteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  if (byteLength === 0) {\n    content._ready = true;\n    return;\n  }\n\n  const featureTableJSONByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  if (featureTableJSONByteLength === 0) {\n    throw new RuntimeError(\n      \"Feature table must have a byte length greater than zero\"\n    );\n  }\n\n  const featureTableBinaryByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n  const batchTableJSONByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n  const batchTableBinaryByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n  const indicesByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n  const positionByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n  const polylinePositionByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n  const pointsPositionByteLength = view.getUint32(byteOffset, true);\n  byteOffset += sizeOfUint32;\n\n  const featureTableJson = getJsonFromTypedArray(\n    uint8Array,\n    byteOffset,\n    featureTableJSONByteLength\n  );\n  byteOffset += featureTableJSONByteLength;\n\n  const featureTableBinary = new Uint8Array(\n    arrayBuffer,\n    byteOffset,\n    featureTableBinaryByteLength\n  );\n  byteOffset += featureTableBinaryByteLength;\n\n  let batchTableJson;\n  let batchTableBinary;\n  if (batchTableJSONByteLength > 0) {\n    // PERFORMANCE_IDEA: is it possible to allocate this on-demand?  Perhaps keep the\n    // arraybuffer/string compressed in memory and then decompress it when it is first accessed.\n    //\n    // We could also make another request for it, but that would make the property set/get\n    // API async, and would double the number of numbers in some cases.\n    batchTableJson = getJsonFromTypedArray(\n      uint8Array,\n      byteOffset,\n      batchTableJSONByteLength\n    );\n    byteOffset += batchTableJSONByteLength;\n\n    if (batchTableBinaryByteLength > 0) {\n      // Has a batch table binary\n      batchTableBinary = new Uint8Array(\n        arrayBuffer,\n        byteOffset,\n        batchTableBinaryByteLength\n      );\n      // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed\n      batchTableBinary = new Uint8Array(batchTableBinary);\n      byteOffset += batchTableBinaryByteLength;\n    }\n  }\n\n  const numberOfPolygons = defaultValue(featureTableJson.POLYGONS_LENGTH, 0);\n  const numberOfPolylines = defaultValue(featureTableJson.POLYLINES_LENGTH, 0);\n  const numberOfPoints = defaultValue(featureTableJson.POINTS_LENGTH, 0);\n  const totalPrimitives = numberOfPolygons + numberOfPolylines + numberOfPoints;\n\n  const batchTable = new Cesium3DTileBatchTable(\n    content,\n    totalPrimitives,\n    batchTableJson,\n    batchTableBinary,\n    createColorChangedCallback(content)\n  );\n  content._batchTable = batchTable;\n\n  if (totalPrimitives === 0) {\n    return;\n  }\n\n  const featureTable = new Cesium3DTileFeatureTable(\n    featureTableJson,\n    featureTableBinary\n  );\n  const region = featureTable.getGlobalProperty(\"REGION\");\n  if (!defined(region)) {\n    throw new RuntimeError(\n      \"Feature table global property: REGION must be defined\"\n    );\n  }\n  const rectangle = Rectangle.unpack(region);\n  const minHeight = region[4];\n  const maxHeight = region[5];\n\n  const modelMatrix = content._tile.computedTransform;\n\n  let center = featureTable.getGlobalProperty(\n    \"RTC_CENTER\",\n    ComponentDatatype.FLOAT,\n    3\n  );\n  if (defined(center)) {\n    center = Cartesian3.unpack(center);\n    Matrix4.multiplyByPoint(modelMatrix, center, center);\n  } else {\n    center = Rectangle.center(rectangle);\n    center.height = CesiumMath.lerp(minHeight, maxHeight, 0.5);\n    center = Ellipsoid.WGS84.cartographicToCartesian(center);\n  }\n\n  const batchIds = getBatchIds(featureTableJson, featureTableBinary);\n  byteOffset += (4 - (byteOffset % 4)) % 4;\n\n  if (numberOfPolygons > 0) {\n    featureTable.featuresLength = numberOfPolygons;\n\n    const polygonCounts = defaultValue(\n      featureTable.getPropertyArray(\n        \"POLYGON_COUNTS\",\n        ComponentDatatype.UNSIGNED_INT,\n        1\n      ),\n      featureTable.getPropertyArray(\n        \"POLYGON_COUNT\",\n        ComponentDatatype.UNSIGNED_INT,\n        1\n      ) // Workaround for old vector tilesets using the non-plural name\n    );\n\n    if (!defined(polygonCounts)) {\n      throw new RuntimeError(\n        \"Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0\"\n      );\n    }\n\n    const polygonIndexCounts = defaultValue(\n      featureTable.getPropertyArray(\n        \"POLYGON_INDEX_COUNTS\",\n        ComponentDatatype.UNSIGNED_INT,\n        1\n      ),\n      featureTable.getPropertyArray(\n        \"POLYGON_INDEX_COUNT\",\n        ComponentDatatype.UNSIGNED_INT,\n        1\n      ) // Workaround for old vector tilesets using the non-plural name\n    );\n\n    if (!defined(polygonIndexCounts)) {\n      throw new RuntimeError(\n        \"Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0\"\n      );\n    }\n\n    // Use the counts array to determine how many position values we want. If we used the byte length then\n    // zero padding values would be included and cause the delta zig-zag decoding to fail\n    const numPolygonPositions = polygonCounts.reduce(function (total, count) {\n      return total + count * 2;\n    }, 0);\n\n    const numPolygonIndices = polygonIndexCounts.reduce(function (\n      total,\n      count\n    ) {\n      return total + count;\n    },\n    0);\n\n    const indices = new Uint32Array(arrayBuffer, byteOffset, numPolygonIndices);\n    byteOffset += indicesByteLength;\n\n    const polygonPositions = new Uint16Array(\n      arrayBuffer,\n      byteOffset,\n      numPolygonPositions\n    );\n    byteOffset += positionByteLength;\n\n    let polygonMinimumHeights;\n    let polygonMaximumHeights;\n    if (\n      defined(featureTableJson.POLYGON_MINIMUM_HEIGHTS) &&\n      defined(featureTableJson.POLYGON_MAXIMUM_HEIGHTS)\n    ) {\n      polygonMinimumHeights = featureTable.getPropertyArray(\n        \"POLYGON_MINIMUM_HEIGHTS\",\n        ComponentDatatype.FLOAT,\n        1\n      );\n      polygonMaximumHeights = featureTable.getPropertyArray(\n        \"POLYGON_MAXIMUM_HEIGHTS\",\n        ComponentDatatype.FLOAT,\n        1\n      );\n    }\n\n    content._polygons = new Vector3DTilePolygons({\n      positions: polygonPositions,\n      counts: polygonCounts,\n      indexCounts: polygonIndexCounts,\n      indices: indices,\n      minimumHeight: minHeight,\n      maximumHeight: maxHeight,\n      polygonMinimumHeights: polygonMinimumHeights,\n      polygonMaximumHeights: polygonMaximumHeights,\n      center: center,\n      rectangle: rectangle,\n      boundingVolume: content.tile.boundingVolume.boundingVolume,\n      batchTable: batchTable,\n      batchIds: batchIds.polygons,\n      modelMatrix: modelMatrix,\n    });\n  }\n\n  if (numberOfPolylines > 0) {\n    featureTable.featuresLength = numberOfPolylines;\n\n    const polylineCounts = defaultValue(\n      featureTable.getPropertyArray(\n        \"POLYLINE_COUNTS\",\n        ComponentDatatype.UNSIGNED_INT,\n        1\n      ),\n      featureTable.getPropertyArray(\n        \"POLYLINE_COUNT\",\n        ComponentDatatype.UNSIGNED_INT,\n        1\n      ) // Workaround for old vector tilesets using the non-plural name\n    );\n\n    if (!defined(polylineCounts)) {\n      throw new RuntimeError(\n        \"Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0\"\n      );\n    }\n\n    let widths = featureTable.getPropertyArray(\n      \"POLYLINE_WIDTHS\",\n      ComponentDatatype.UNSIGNED_SHORT,\n      1\n    );\n    if (!defined(widths)) {\n      widths = new Uint16Array(numberOfPolylines);\n      for (let i = 0; i < numberOfPolylines; ++i) {\n        widths[i] = 2.0;\n      }\n    }\n\n    // Use the counts array to determine how many position values we want. If we used the byte length then\n    // zero padding values would be included and cause the delta zig-zag decoding to fail\n    const numPolylinePositions = polylineCounts.reduce(function (total, count) {\n      return total + count * 3;\n    }, 0);\n    const polylinePositions = new Uint16Array(\n      arrayBuffer,\n      byteOffset,\n      numPolylinePositions\n    );\n    byteOffset += polylinePositionByteLength;\n\n    const tileset = content._tileset;\n    const examineVectorLinesFunction = tileset.examineVectorLinesFunction;\n    if (defined(examineVectorLinesFunction)) {\n      const decodedPositions = decodeVectorPolylinePositions(\n        new Uint16Array(polylinePositions),\n        rectangle,\n        minHeight,\n        maxHeight,\n        Ellipsoid.WGS84\n      );\n      examineVectorLines(\n        decodedPositions,\n        polylineCounts,\n        batchIds.polylines,\n        batchTable,\n        content.url,\n        examineVectorLinesFunction\n      );\n    }\n\n    let createPolylines = createFloatingPolylines;\n    if (defined(tileset.classificationType)) {\n      createPolylines = createClampedPolylines;\n    }\n\n    content._polylines = createPolylines({\n      positions: polylinePositions,\n      widths: widths,\n      counts: polylineCounts,\n      batchIds: batchIds.polylines,\n      minimumHeight: minHeight,\n      maximumHeight: maxHeight,\n      center: center,\n      rectangle: rectangle,\n      boundingVolume: content.tile.boundingVolume.boundingVolume,\n      batchTable: batchTable,\n      classificationType: tileset.classificationType,\n      keepDecodedPositions: tileset.vectorKeepDecodedPositions,\n    });\n  }\n\n  if (numberOfPoints > 0) {\n    const pointPositions = new Uint16Array(\n      arrayBuffer,\n      byteOffset,\n      numberOfPoints * 3\n    );\n    byteOffset += pointsPositionByteLength;\n    content._points = new Vector3DTilePoints({\n      positions: pointPositions,\n      batchIds: batchIds.points,\n      minimumHeight: minHeight,\n      maximumHeight: maxHeight,\n      rectangle: rectangle,\n      batchTable: batchTable,\n    });\n  }\n}\n\nfunction createFeatures(content) {\n  const featuresLength = content.featuresLength;\n  if (!defined(content._features) && featuresLength > 0) {\n    const features = new Array(featuresLength);\n\n    if (defined(content._polygons)) {\n      content._polygons.createFeatures(content, features);\n    }\n    if (defined(content._polylines)) {\n      content._polylines.createFeatures(content, features);\n    }\n    if (defined(content._points)) {\n      content._points.createFeatures(content, features);\n    }\n    content._features = features;\n  }\n}\n\nVector3DTileContent.prototype.hasProperty = function (batchId, name) {\n  return this._batchTable.hasProperty(batchId, name);\n};\n\nVector3DTileContent.prototype.getFeature = function (batchId) {\n  //>>includeStart('debug', pragmas.debug);\n  const featuresLength = this.featuresLength;\n  if (!defined(batchId) || batchId < 0 || batchId >= featuresLength) {\n    throw new DeveloperError(\n      `batchId is required and between zero and featuresLength - 1 (${\n        featuresLength - 1\n      }).`\n    );\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(this._features)) {\n    createFeatures(this);\n  }\n\n  return this._features[batchId];\n};\n\nVector3DTileContent.prototype.applyDebugSettings = function (enabled, color) {\n  if (defined(this._polygons)) {\n    this._polygons.applyDebugSettings(enabled, color);\n  }\n  if (defined(this._polylines)) {\n    this._polylines.applyDebugSettings(enabled, color);\n  }\n  if (defined(this._points)) {\n    this._points.applyDebugSettings(enabled, color);\n  }\n};\n\nVector3DTileContent.prototype.applyStyle = function (style) {\n  if (!defined(this._features)) {\n    createFeatures(this);\n  }\n  if (defined(this._polygons)) {\n    this._polygons.applyStyle(style, this._features);\n  }\n  if (defined(this._polylines)) {\n    this._polylines.applyStyle(style, this._features);\n  }\n  if (defined(this._points)) {\n    this._points.applyStyle(style, this._features);\n  }\n};\n\nVector3DTileContent.prototype.update = function (tileset, frameState) {\n  let ready = true;\n  if (defined(this._polygons)) {\n    this._polygons.classificationType = this._tileset.classificationType;\n    this._polygons.debugWireframe = this._tileset.debugWireframe;\n    this._polygons.update(frameState);\n    ready = ready && this._polygons.ready;\n  }\n  if (defined(this._polylines)) {\n    this._polylines.update(frameState);\n    ready = ready && this._polylines.ready;\n  }\n  if (defined(this._points)) {\n    this._points.update(frameState);\n    ready = ready && this._points.ready;\n  }\n  if (defined(this._batchTable) && ready) {\n    if (!defined(this._features)) {\n      createFeatures(this);\n    }\n    this._batchTable.update(tileset, frameState);\n    this._ready = true;\n  }\n};\n\nVector3DTileContent.prototype.getPolylinePositions = function (batchId) {\n  const polylines = this._polylines;\n  if (!defined(polylines)) {\n    return undefined;\n  }\n\n  return polylines.getPositions(batchId);\n};\n\nVector3DTileContent.prototype.isDestroyed = function () {\n  return false;\n};\n\nVector3DTileContent.prototype.destroy = function () {\n  this._polygons = this._polygons && this._polygons.destroy();\n  this._polylines = this._polylines && this._polylines.destroy();\n  this._points = this._points && this._points.destroy();\n  this._batchTable = this._batchTable && this._batchTable.destroy();\n  return destroyObject(this);\n};\n\nfunction examineVectorLines(\n  positions,\n  counts,\n  batchIds,\n  batchTable,\n  url,\n  callback\n) {\n  const countsLength = counts.length;\n  let polylineStart = 0;\n  for (let i = 0; i < countsLength; i++) {\n    const count = counts[i] * 3;\n    const linePositions = positions.slice(polylineStart, polylineStart + count);\n    polylineStart += count;\n\n    callback(linePositions, batchIds[i], url, batchTable);\n  }\n}\n\nexport default Vector3DTileContent;\n", "import Composite3DTileContent from \"./Composite3DTileContent.js\";\nimport Geometry3DTileContent from \"./Geometry3DTileContent.js\";\nimport Implicit3DTileContent from \"./Implicit3DTileContent.js\";\nimport Model3DTileContent from \"./Model/Model3DTileContent.js\";\nimport Tileset3DTileContent from \"./Tileset3DTileContent.js\";\nimport Vector3DTileContent from \"./Vector3DTileContent.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * Maps a tile's magic field in its header to a new content object for the tile's payload.\n *\n * @private\n */\nconst Cesium3DTileContentFactory = {\n  b3dm: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n    return Model3DTileContent.fromB3dm(\n      tileset,\n      tile,\n      resource,\n      arrayBuffer,\n      byteOffset\n    );\n  },\n  pnts: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n    return Model3DTileContent.fromPnts(\n      tileset,\n      tile,\n      resource,\n      arrayBuffer,\n      byteOffset\n    );\n  },\n  i3dm: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n    return Model3DTileContent.fromI3dm(\n      tileset,\n      tile,\n      resource,\n      arrayBuffer,\n      byteOffset\n    );\n  },\n  cmpt: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n    // Send in the factory in order to avoid a cyclical dependency\n    return Composite3DTileContent.fromTileType(\n      tileset,\n      tile,\n      resource,\n      arrayBuffer,\n      byteOffset,\n      Cesium3DTileContentFactory\n    );\n  },\n  externalTileset: function (tileset, tile, resource, json) {\n    return Tileset3DTileContent.fromJson(tileset, tile, resource, json);\n  },\n  geom: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n    return new Geometry3DTileContent(\n      tileset,\n      tile,\n      resource,\n      arrayBuffer,\n      byteOffset\n    );\n  },\n  vctr: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n    return new Vector3DTileContent(\n      tileset,\n      tile,\n      resource,\n      arrayBuffer,\n      byteOffset\n    );\n  },\n  subt: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n    return Implicit3DTileContent.fromSubtreeJson(\n      tileset,\n      tile,\n      resource,\n      undefined,\n      arrayBuffer,\n      byteOffset\n    );\n  },\n  subtreeJson: function (tileset, tile, resource, json) {\n    return Implicit3DTileContent.fromSubtreeJson(tileset, tile, resource, json);\n  },\n  glb: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n    const arrayBufferByteLength = arrayBuffer.byteLength;\n    if (arrayBufferByteLength < 12) {\n      throw new RuntimeError(\"Invalid glb content\");\n    }\n    const dataView = new DataView(arrayBuffer, byteOffset);\n    const byteLength = dataView.getUint32(8, true);\n    const glb = new Uint8Array(arrayBuffer, byteOffset, byteLength);\n    return Model3DTileContent.fromGltf(tileset, tile, resource, glb);\n  },\n  gltf: function (tileset, tile, resource, json) {\n    return Model3DTileContent.fromGltf(tileset, tile, resource, json);\n  },\n  geoJson: function (tileset, tile, resource, json) {\n    return Model3DTileContent.fromGeoJson(tileset, tile, resource, json);\n  },\n};\nexport default Cesium3DTileContentFactory;\n", "/**\n * @private\n */\nconst Cesium3DTileContentState = {\n  UNLOADED: 0, // Has never been requested\n  LOADING: 1, // Is waiting on a pending request\n  PROCESSING: 2, // Request received.  Contents are being processed for rendering.  Depending on the content, it might make its own requests for external data.\n  READY: 3, // Ready to render.\n  EXPIRED: 4, // Is expired and will be unloaded once new content is loaded.\n  FAILED: 5, // Request failed.\n};\nexport default Object.freeze(Cesium3DTileContentState);\n", "/**\n * An enum to indicate the different types of {@link Cesium3DTileContent}.\n * For binary files, the enum value is the magic number of the binary file\n * unless otherwise noted. For JSON files, the enum value is a unique name\n * for internal use.\n *\n * @enum {string}\n * @see Cesium3DTileContent\n *\n * @private\n */\nconst Cesium3DTileContentType = {\n  /**\n   * A Batched 3D Model. This is a binary format with\n   * magic number <code>b3dm</code>\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  BATCHED_3D_MODEL: \"b3dm\",\n  /**\n   * An Instanced 3D Model. This is a binary format with magic number\n   * <code>i3dm</code>\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  INSTANCED_3D_MODEL: \"i3dm\",\n  /**\n   * A Composite model. This is a binary format with magic number\n   * <code>cmpt</code>\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  COMPOSITE: \"cmpt\",\n  /**\n   * A Point Cloud model. This is a binary format with magic number\n   * <code>pnts</code>\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  POINT_CLOUD: \"pnts\",\n  /**\n   * Vector tiles. This is a binary format with magic number\n   * <code>vctr</code>\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  VECTOR: \"vctr\",\n  /**\n   * Geometry tiles. This is a binary format with magic number\n   * <code>geom</code>\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  GEOMETRY: \"geom\",\n  /**\n   * A glTF model in JSON + external BIN form. This is treated\n   * as a JSON format.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  GLTF: \"gltf\",\n  /**\n   * The binary form of a glTF file. Internally, the magic number is\n   * changed from <code>glTF</code> to <code>glb</code> to distinguish it from\n   * the JSON glTF format.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  GLTF_BINARY: \"glb\",\n  /**\n   * For implicit tiling, availability bitstreams are stored in binary subtree files.\n   * The magic number is <code>subt</code>\n   *\n   * @type {string}\n   * @constant\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  IMPLICIT_SUBTREE: \"subt\",\n  /**\n   * For implicit tiling. Subtrees can also be represented as JSON files.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  IMPLICIT_SUBTREE_JSON: \"subtreeJson\",\n  /**\n   * Contents can reference another tileset.json to use\n   * as an external tileset. This is a JSON-based format.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  EXTERNAL_TILESET: \"externalTileset\",\n  /**\n   * Multiple contents are handled separately from the other content types\n   * due to differences in request scheduling.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  MULTIPLE_CONTENT: \"multipleContent\",\n  /**\n   * GeoJSON content for <code>MAXAR_content_geojson</code> extension.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  GEOJSON: \"geoJson\",\n  /**\n   * Binary voxel content for <code>3DTILES_content_voxels</code> extension.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  VOXEL_BINARY: \"voxl\",\n  /**\n   * Binary voxel content for <code>3DTILES_content_voxels</code> extension.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  VOXEL_JSON: \"voxelJson\",\n};\n\n/**\n * Check if a content is one of the supported binary formats. Otherwise,\n * the caller can assume a JSON format.\n * @param {Cesium3DTileContentType} contentType The content type of the content payload.\n * @return {boolean} <code>true</code> if the content type is a binary format, or <code>false</code> if the content type is a JSON format.\n * @private\n */\nCesium3DTileContentType.isBinaryFormat = function (contentType) {\n  switch (contentType) {\n    case Cesium3DTileContentType.BATCHED_3D_MODEL:\n    case Cesium3DTileContentType.INSTANCED_3D_MODEL:\n    case Cesium3DTileContentType.COMPOSITE:\n    case Cesium3DTileContentType.POINT_CLOUD:\n    case Cesium3DTileContentType.VECTOR:\n    case Cesium3DTileContentType.GEOMETRY:\n    case Cesium3DTileContentType.IMPLICIT_SUBTREE:\n    case Cesium3DTileContentType.VOXEL_BINARY:\n    case Cesium3DTileContentType.GLTF_BINARY:\n      return true;\n    default:\n      return false;\n  }\n};\n\nexport default Object.freeze(Cesium3DTileContentType);\n", "/**\n * Hint defining optimization support for a 3D tile\n *\n * @enum {number}\n *\n * @private\n */\nconst Cesium3DTileOptimizationHint = {\n  NOT_COMPUTED: -1,\n  USE_OPTIMIZATION: 1,\n  SKIP_OPTIMIZATION: 0,\n};\nexport default Object.freeze(Cesium3DTileOptimizationHint);\n", "/**\n * The pass in which a 3D Tileset is updated.\n *\n * @private\n */\nconst Cesium3DTilePass = {\n  RENDER: 0,\n  PICK: 1,\n  SHADOW: 2,\n  PRELOAD: 3,\n  PRELOAD_FLIGHT: 4,\n  REQUEST_RENDER_MODE_DEFER_CHECK: 5,\n  MOST_DETAILED_PRELOAD: 6,\n  MOST_DETAILED_PICK: 7,\n  NUMBER_OF_PASSES: 8,\n};\n\nconst passOptions = new Array(Cesium3DTilePass.NUMBER_OF_PASSES);\n\npassOptions[Cesium3DTilePass.RENDER] = Object.freeze({\n  pass: Cesium3DTilePass.RENDER,\n  isRender: true,\n  requestTiles: true,\n  ignoreCommands: false,\n});\n\npassOptions[Cesium3DTilePass.PICK] = Object.freeze({\n  pass: Cesium3DTilePass.PICK,\n  isRender: false,\n  requestTiles: false,\n  ignoreCommands: false,\n});\n\npassOptions[Cesium3DTilePass.SHADOW] = Object.freeze({\n  pass: Cesium3DTilePass.SHADOW,\n  isRender: false,\n  requestTiles: true,\n  ignoreCommands: false,\n});\n\npassOptions[Cesium3DTilePass.PRELOAD] = Object.freeze({\n  pass: Cesium3DTilePass.PRELOAD,\n  isRender: false,\n  requestTiles: true,\n  ignoreCommands: true,\n});\n\npassOptions[Cesium3DTilePass.PRELOAD_FLIGHT] = Object.freeze({\n  pass: Cesium3DTilePass.PRELOAD_FLIGHT,\n  isRender: false,\n  requestTiles: true,\n  ignoreCommands: true,\n});\n\npassOptions[Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK] = Object.freeze({\n  pass: Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK,\n  isRender: false,\n  requestTiles: true,\n  ignoreCommands: true,\n});\n\npassOptions[Cesium3DTilePass.MOST_DETAILED_PRELOAD] = Object.freeze({\n  pass: Cesium3DTilePass.MOST_DETAILED_PRELOAD,\n  isRender: false,\n  requestTiles: true,\n  ignoreCommands: true,\n});\n\npassOptions[Cesium3DTilePass.MOST_DETAILED_PICK] = Object.freeze({\n  pass: Cesium3DTilePass.MOST_DETAILED_PICK,\n  isRender: false,\n  requestTiles: false,\n  ignoreCommands: false,\n});\n\nCesium3DTilePass.getPassOptions = function (pass) {\n  return passOptions[pass];\n};\nexport default Object.freeze(Cesium3DTilePass);\n", "import destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * Represents empty content for tiles in a\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles} tileset that\n * do not have content, e.g., because they are used to optimize hierarchical culling.\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n *\n * @alias Empty3DTileContent\n * @constructor\n *\n * @private\n */\nfunction Empty3DTileContent(tileset, tile) {\n  this._tileset = tileset;\n  this._tile = tile;\n\n  this.featurePropertiesDirty = false;\n}\n\nObject.defineProperties(Empty3DTileContent.prototype, {\n  featuresLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  pointsLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  trianglesLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  geometryByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  texturesByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  batchTableByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  innerContents: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Returns true when the tile's content is ready to render; otherwise false\n   *\n   * @memberof Empty3DTileContent.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  ready: {\n    get: function () {\n      return true;\n    },\n  },\n\n  tileset: {\n    get: function () {\n      return this._tileset;\n    },\n  },\n\n  tile: {\n    get: function () {\n      return this._tile;\n    },\n  },\n\n  url: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  metadata: {\n    get: function () {\n      return undefined;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      throw new DeveloperError(\n        \"Empty3DTileContent cannot have content metadata\"\n      );\n      //>>includeEnd('debug');\n    },\n  },\n\n  batchTable: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  group: {\n    get: function () {\n      return undefined;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      throw new DeveloperError(\"Empty3DTileContent cannot have group metadata\");\n      //>>includeEnd('debug');\n    },\n  },\n});\n\n/**\n * Part of the {@link Cesium3DTileContent} interface.  <code>Empty3DTileContent</code>\n * always returns <code>false</code> since a tile of this type does not have any features.\n */\nEmpty3DTileContent.prototype.hasProperty = function (batchId, name) {\n  return false;\n};\n\n/**\n * Part of the {@link Cesium3DTileContent} interface.  <code>Empty3DTileContent</code>\n * always returns <code>undefined</code> since a tile of this type does not have any features.\n */\nEmpty3DTileContent.prototype.getFeature = function (batchId) {\n  return undefined;\n};\n\nEmpty3DTileContent.prototype.applyDebugSettings = function (enabled, color) {};\n\nEmpty3DTileContent.prototype.applyStyle = function (style) {};\n\nEmpty3DTileContent.prototype.update = function (tileset, frameState) {};\n\nEmpty3DTileContent.prototype.isDestroyed = function () {\n  return false;\n};\n\nEmpty3DTileContent.prototype.destroy = function () {\n  return destroyObject(this);\n};\nexport default Empty3DTileContent;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport MetadataEntity from \"./MetadataEntity.js\";\n\n/**\n * Metadata about the content of a 3D Tile. This represents the content metadata JSON (3D Tiles 1.1)\n * or the <code>3DTILES_metadata</code> extension on a single {@link Cesium3DTileContent}\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.content Either the content metadata JSON (3D Tiles 1.1) or the extension JSON attached to the content.\n * @param {MetadataClass} options.class The class that the content metadata conforms to.\n *\n * @alias ContentMetadata\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ContentMetadata(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const content = options.content;\n  const metadataClass = options.class;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.content\", content);\n  Check.typeOf.object(\"options.class\", metadataClass);\n  //>>includeEnd('debug');\n\n  this._class = metadataClass;\n  this._properties = content.properties;\n  this._extensions = content.extensions;\n  this._extras = content.extras;\n}\n\nObject.defineProperties(ContentMetadata.prototype, {\n  /**\n   * The class that properties conform to.\n   *\n   * @memberof ContentMetadata.prototype\n   * @type {MetadataClass}\n   * @readonly\n   * @private\n   */\n  class: {\n    get: function () {\n      return this._class;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof ContentMetadata.prototype\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof ContentMetadata.prototype\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\n/**\n * Returns whether the content has this property.\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {boolean} Whether the content has this property.\n * @private\n */\nContentMetadata.prototype.hasProperty = function (propertyId) {\n  return MetadataEntity.hasProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Returns whether the content has a property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {boolean} Whether the content has a property with the given semantic.\n * @private\n */\nContentMetadata.prototype.hasPropertyBySemantic = function (semantic) {\n  return MetadataEntity.hasPropertyBySemantic(\n    semantic,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {string[]} [results] An array into which to store the results.\n * @returns {string[]} The property IDs.\n * @private\n */\nContentMetadata.prototype.getPropertyIds = function (results) {\n  return MetadataEntity.getPropertyIds(this._properties, this._class, results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the content does not have this property.\n * @private\n */\nContentMetadata.prototype.getProperty = function (propertyId) {\n  return MetadataEntity.getProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nContentMetadata.prototype.setProperty = function (propertyId, value) {\n  return MetadataEntity.setProperty(\n    propertyId,\n    value,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the content does not have this semantic.\n * @private\n */\nContentMetadata.prototype.getPropertyBySemantic = function (semantic) {\n  return MetadataEntity.getPropertyBySemantic(\n    semantic,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nContentMetadata.prototype.setPropertyBySemantic = function (semantic, value) {\n  return MetadataEntity.setPropertyBySemantic(\n    semantic,\n    value,\n    this._properties,\n    this._class\n  );\n};\n\nexport default ContentMetadata;\n", "import ContentMetadata from \"./ContentMetadata.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\n\n/**\n * Check if a content has metadata, either defined in its metadata field (3D Tiles 1.1) or in\n * the <code>3DTILES_metadata</code> extension. If defined, get the content metadata\n * with the corresponding class.\n *\n * @function\n *\n * @param {Cesium3DTileset} tileset The tileset to query for content metadata\n * @param {object} contentHeader the JSON header for a {@link Cesium3DTileContent}\n * @return {ContentMetadata} the content metadata, or <code>undefined</code> if not found\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction findContentMetadata(tileset, contentHeader) {\n  const metadataJson = hasExtension(contentHeader, \"3DTILES_metadata\")\n    ? contentHeader.extensions[\"3DTILES_metadata\"]\n    : contentHeader.metadata;\n\n  if (!defined(metadataJson)) {\n    return undefined;\n  }\n\n  if (!defined(tileset.schema)) {\n    findContentMetadata._oneTimeWarning(\n      \"findContentMetadata-missing-root-schema\",\n      \"Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.\"\n    );\n    return undefined;\n  }\n\n  const classes = defaultValue(\n    tileset.schema.classes,\n    defaultValue.EMPTY_OBJECT\n  );\n  if (defined(metadataJson.class)) {\n    const contentClass = classes[metadataJson.class];\n    return new ContentMetadata({\n      content: metadataJson,\n      class: contentClass,\n    });\n  }\n\n  return undefined;\n}\n\n// Exposed for testing\nfindContentMetadata._oneTimeWarning = oneTimeWarning;\nexport default findContentMetadata;\n", "import defined from \"../Core/defined.js\";\nimport hasExtension from \"./hasExtension.js\";\n\n/**\n * Check if a content has metadata, either defined in its metadata field (3D Tiles 1.1)\n * or in the <code>3DTILES_metadata</code> extension. If so, look up the group with the\n * corresponding ID.\n *\n * @function\n *\n * @param {Cesium3DTileset} tileset The tileset to query for group metadata\n * @param {object} contentHeader the JSON header for a {@link Cesium3DTileContent}\n * @return {GroupMetadata} the group metadata, or <code>undefined</code> if not found\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction findGroupMetadata(tileset, contentHeader) {\n  const metadataExtension = tileset.metadataExtension;\n  if (!defined(metadataExtension)) {\n    return undefined;\n  }\n  const groups = metadataExtension.groups;\n\n  const group = hasExtension(contentHeader, \"3DTILES_metadata\")\n    ? contentHeader.extensions[\"3DTILES_metadata\"].group\n    : contentHeader.group;\n\n  if (typeof group === \"number\") {\n    return groups[group];\n  }\n\n  const index = metadataExtension.groupIds.findIndex(function (id) {\n    return id === group;\n  });\n\n  return index >= 0 ? groups[index] : undefined;\n}\n\nexport default findGroupMetadata;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport MetadataEntity from \"./MetadataEntity.js\";\n\n/**\n * Metadata about a 3D Tile. This represents the tile metadata JSON (3D Tiles 1.1)\n * or the <code>3DTILES_metadata</code> extension on a single {@link Cesium3DTile}\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.tile Either the tile metadata JSON (3D Tiles 1.1), or the extension JSON attached to the tile.\n * @param {MetadataClass} options.class The class that the tile metadata conforms to.\n *\n * @alias TileMetadata\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction TileMetadata(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const tile = options.tile;\n  const metadataClass = options.class;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.tile\", tile);\n  Check.typeOf.object(\"options.class\", metadataClass);\n  //>>includeEnd('debug');\n\n  this._class = metadataClass;\n  this._properties = tile.properties;\n  this._extensions = tile.extensions;\n  this._extras = tile.extras;\n}\n\nObject.defineProperties(TileMetadata.prototype, {\n  /**\n   * The class that properties conform to.\n   *\n   * @memberof TileMetadata.prototype\n   * @type {MetadataClass}\n   * @readonly\n   * @private\n   */\n  class: {\n    get: function () {\n      return this._class;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof TileMetadata.prototype\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof TileMetadata.prototype\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\n/**\n * Returns whether the tile has this property.\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {boolean} Whether the tile has this property.\n * @private\n */\nTileMetadata.prototype.hasProperty = function (propertyId) {\n  return MetadataEntity.hasProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Returns whether the tile has a property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {boolean} Whether the tile has a property with the given semantic.\n * @private\n */\nTileMetadata.prototype.hasPropertyBySemantic = function (semantic) {\n  return MetadataEntity.hasPropertyBySemantic(\n    semantic,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {string[]} [results] An array into which to store the results.\n * @returns {string[]} The property IDs.\n * @private\n */\nTileMetadata.prototype.getPropertyIds = function (results) {\n  return MetadataEntity.getPropertyIds(this._properties, this._class, results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the tile does not have this property.\n * @private\n */\nTileMetadata.prototype.getProperty = function (propertyId) {\n  return MetadataEntity.getProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nTileMetadata.prototype.setProperty = function (propertyId, value) {\n  return MetadataEntity.setProperty(\n    propertyId,\n    value,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the tile does not have this semantic.\n * @private\n */\nTileMetadata.prototype.getPropertyBySemantic = function (semantic) {\n  return MetadataEntity.getPropertyBySemantic(\n    semantic,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nTileMetadata.prototype.setPropertyBySemantic = function (semantic, value) {\n  return MetadataEntity.setPropertyBySemantic(\n    semantic,\n    value,\n    this._properties,\n    this._class\n  );\n};\n\nexport default TileMetadata;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport TileMetadata from \"./TileMetadata.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\n\n/**\n * Check if a tile has metadata, either defined in its metadata field (3D Tiles 1.1)\n * or in the <code>3DTILES_metadata</code> extension. If defined, get the tile metadata\n * with the corresponding class.\n * <p>\n * This assumes that tileset.metadata has been created before any tiles are constructed.\n * </p>\n * @function\n *\n * @param {Cesium3DTileset} tileset The tileset to query for tile metadata\n * @param {object} tileHeader the JSON header for a {@link Cesium3DTile}\n * @return {TileMetadata} the tile metadata, or <code>undefined</code> if not found\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction findTileMetadata(tileset, tileHeader) {\n  const metadataJson = hasExtension(tileHeader, \"3DTILES_metadata\")\n    ? tileHeader.extensions[\"3DTILES_metadata\"]\n    : tileHeader.metadata;\n\n  if (!defined(metadataJson)) {\n    return undefined;\n  }\n\n  if (!defined(tileset.schema)) {\n    findTileMetadata._oneTimeWarning(\n      \"findTileMetadata-missing-root-schema\",\n      \"Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.\"\n    );\n    return undefined;\n  }\n\n  const classes = defaultValue(\n    tileset.schema.classes,\n    defaultValue.EMPTY_OBJECT\n  );\n  if (defined(metadataJson.class)) {\n    const tileClass = classes[metadataJson.class];\n    return new TileMetadata({\n      tile: metadataJson,\n      class: tileClass,\n    });\n  }\n\n  return undefined;\n}\n\n// Exposed for testing\nfindTileMetadata._oneTimeWarning = oneTimeWarning;\nexport default findTileMetadata;\n", "import defined from \"../Core/defined.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport getMagic from \"../Core/getMagic.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Cesium3DTileContentType from \"./Cesium3DTileContentType.js\";\n\n/**\n * Results of the preprocess3DTileContent() function. This includes the\n * {@link Cesium3DTileContentType} and the payload. The payload is either\n * binary or JSON depending on the content type.\n *\n * @typedef {object} PreprocessedContent\n * @property {Cesium3DTileContentType} contentType The type of the content\n * @property {Uint8Array} [binaryPayload] For binary files, the payload is returned as a typed array with byteOffset of 0\n * @property {object} [jsonPayload] For JSON files, the results are returned as a JSON object.\n * @private\n */\n\n/**\n * Preprocess a {@link Cesium3DTileContent}, to determine the type of content\n * and to parse JSON files into objects.\n *\n * @param {ArrayBuffer} arrayBuffer The raw binary payload\n * @return {PreprocessedContent}\n * @private\n */\nfunction preprocess3DTileContent(arrayBuffer) {\n  const uint8Array = new Uint8Array(arrayBuffer);\n  let contentType = getMagic(uint8Array);\n\n  // We use glTF for JSON glTF files. For binary glTF, we rename this\n  // to glb to disambiguate\n  if (contentType === \"glTF\") {\n    contentType = \"glb\";\n  }\n\n  if (Cesium3DTileContentType.isBinaryFormat(contentType)) {\n    return {\n      // For binary files, the enum value is the magic number\n      contentType: contentType,\n      binaryPayload: uint8Array,\n    };\n  }\n\n  const json = getJsonContent(uint8Array);\n  if (defined(json.root)) {\n    // Most likely a tileset JSON\n    return {\n      contentType: Cesium3DTileContentType.EXTERNAL_TILESET,\n      jsonPayload: json,\n    };\n  }\n\n  if (defined(json.asset)) {\n    // Most likely a glTF. Tileset JSON also has an \"asset\" property\n    // so this check needs to happen second\n    return {\n      contentType: Cesium3DTileContentType.GLTF,\n      jsonPayload: json,\n    };\n  }\n\n  if (defined(json.tileAvailability)) {\n    // Most likely a subtree JSON.\n    return {\n      contentType: Cesium3DTileContentType.IMPLICIT_SUBTREE_JSON,\n      jsonPayload: json,\n    };\n  }\n\n  if (defined(json.type)) {\n    // Most likely a GeoJSON\n    return {\n      contentType: Cesium3DTileContentType.GEOJSON,\n      jsonPayload: json,\n    };\n  }\n\n  if (defined(json.voxelTable)) {\n    // Most likely a voxel JSON\n    return {\n      contentType: Cesium3DTileContentType.VOXEL_JSON,\n      jsonPayload: json,\n    };\n  }\n\n  throw new RuntimeError(\"Invalid tile content.\");\n}\n\nfunction getJsonContent(uint8Array) {\n  let json;\n\n  try {\n    json = getJsonFromTypedArray(uint8Array);\n  } catch (error) {\n    throw new RuntimeError(\"Invalid tile content.\");\n  }\n\n  return json;\n}\n\nexport default preprocess3DTileContent;\n", "import defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Request from \"../Core/Request.js\";\nimport RequestScheduler from \"../Core/RequestScheduler.js\";\nimport RequestState from \"../Core/RequestState.js\";\nimport RequestType from \"../Core/RequestType.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Cesium3DContentGroup from \"./Cesium3DContentGroup.js\";\nimport Cesium3DTileContentType from \"./Cesium3DTileContentType.js\";\nimport Cesium3DTileContentFactory from \"./Cesium3DTileContentFactory.js\";\nimport findContentMetadata from \"./findContentMetadata.js\";\nimport findGroupMetadata from \"./findGroupMetadata.js\";\nimport preprocess3DTileContent from \"./preprocess3DTileContent.js\";\n\n/**\n * A collection of contents for tiles that have multiple contents, either via the tile JSON (3D Tiles 1.1) or the <code>3DTILES_multiple_contents</code> extension.\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_multiple_contents|3DTILES_multiple_contents extension}\n *\n * @alias Multiple3DTileContent\n * @constructor\n *\n * @param {Cesium3DTileset} tileset The tileset this content belongs to\n * @param {Cesium3DTile} tile The content this content belongs to\n * @param {Resource} tilesetResource The resource that points to the tileset. This will be used to derive each inner content's resource.\n * @param {object} contentsJson Either the tile JSON containing the contents array (3D Tiles 1.1), or <code>3DTILES_multiple_contents</code> extension JSON\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction Multiple3DTileContent(tileset, tile, tilesetResource, contentsJson) {\n  this._tileset = tileset;\n  this._tile = tile;\n  this._tilesetResource = tilesetResource;\n  this._contents = [];\n  this._contentsCreated = false;\n\n  // An older version of 3DTILES_multiple_contents used \"content\" instead of \"contents\"\n  const contentHeaders = defined(contentsJson.contents)\n    ? contentsJson.contents\n    : contentsJson.content;\n\n  this._innerContentHeaders = contentHeaders;\n  this._requestsInFlight = 0;\n\n  // How many times cancelPendingRequests() has been called. This is\n  // used to help short-circuit computations after a tile was canceled.\n  this._cancelCount = 0;\n\n  const contentCount = this._innerContentHeaders.length;\n  this._arrayFetchPromises = new Array(contentCount);\n  this._requests = new Array(contentCount);\n  this._ready = false;\n\n  this._innerContentResources = new Array(contentCount);\n  this._serverKeys = new Array(contentCount);\n\n  for (let i = 0; i < contentCount; i++) {\n    const contentResource = tilesetResource.getDerivedResource({\n      url: contentHeaders[i].uri,\n    });\n\n    const serverKey = RequestScheduler.getServerKey(\n      contentResource.getUrlComponent()\n    );\n\n    this._innerContentResources[i] = contentResource;\n    this._serverKeys[i] = serverKey;\n  }\n}\n\nObject.defineProperties(Multiple3DTileContent.prototype, {\n  /**\n   * Part of the {@link Cesium3DTileContent} interface.  <code>Multiple3DTileContent</code> checks if any of the inner contents have dirty featurePropertiesDirty.\n   * @memberof Multiple3DTileContent.prototype\n   *\n   * @type {boolean}\n   *\n   * @private\n   */\n  featurePropertiesDirty: {\n    get: function () {\n      const contents = this._contents;\n      const length = contents.length;\n      for (let i = 0; i < length; ++i) {\n        if (contents[i].featurePropertiesDirty) {\n          return true;\n        }\n      }\n\n      return false;\n    },\n    set: function (value) {\n      const contents = this._contents;\n      const length = contents.length;\n      for (let i = 0; i < length; ++i) {\n        contents[i].featurePropertiesDirty = value;\n      }\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface.  <code>Multiple3DTileContent</code>\n   * always returns <code>0</code>.  Instead call <code>featuresLength</code> for a specific inner content.\n   *\n   * @memberof Multiple3DTileContent.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  featuresLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface.  <code>Multiple3DTileContent</code>\n   * always returns <code>0</code>.  Instead, call <code>pointsLength</code> for a specific inner content.\n   *\n   * @memberof Multiple3DTileContent.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  pointsLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface.  <code>Multiple3DTileContent</code>\n   * always returns <code>0</code>.  Instead call <code>trianglesLength</code> for a specific inner content.\n   *\n   * @memberof Multiple3DTileContent.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  trianglesLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface.  <code>Multiple3DTileContent</code>\n   * always returns <code>0</code>.  Instead call <code>geometryByteLength</code> for a specific inner content.\n   *\n   * @memberof Multiple3DTileContent.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  geometryByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code>\n   * always returns <code>0</code>.  Instead call <code>texturesByteLength</code> for a specific inner content.\n   *\n   * @memberof Multiple3DTileContent.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  texturesByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface.  <code>Multiple3DTileContent</code>\n   * always returns <code>0</code>.  Instead call <code>batchTableByteLength</code> for a specific inner content.\n   *\n   * @memberof Multiple3DTileContent.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  batchTableByteLength: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  innerContents: {\n    get: function () {\n      return this._contents;\n    },\n  },\n\n  /**\n   * Returns true when the tile's content is ready to render; otherwise false\n   *\n   * @memberof Multiple3DTileContent.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  ready: {\n    get: function () {\n      if (!this._contentsCreated) {\n        return false;\n      }\n\n      return this._ready;\n    },\n  },\n\n  tileset: {\n    get: function () {\n      return this._tileset;\n    },\n  },\n\n  tile: {\n    get: function () {\n      return this._tile;\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface.\n   * Unlike other content types, <code>Multiple3DTileContent</code> does not\n   * have a single URL, so this returns undefined.\n   * @memberof Multiple3DTileContent.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  url: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code>\n   * always returns <code>undefined</code>.  Instead call <code>metadata</code> for a specific inner content.\n   * @memberof Multiple3DTileContent.prototype\n   * @private\n   */\n  metadata: {\n    get: function () {\n      return undefined;\n    },\n    set: function () {\n      //>>includeStart('debug', pragmas.debug);\n      throw new DeveloperError(\"Multiple3DTileContent cannot have metadata\");\n      //>>includeEnd('debug');\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code>\n   * always returns <code>undefined</code>.  Instead call <code>batchTable</code> for a specific inner content.\n   * @memberof Multiple3DTileContent.prototype\n   * @private\n   */\n  batchTable: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code>\n   * always returns <code>undefined</code>.  Instead call <code>group</code> for a specific inner content.\n   * @memberof Multiple3DTileContent.prototype\n   * @private\n   */\n  group: {\n    get: function () {\n      return undefined;\n    },\n    set: function () {\n      //>>includeStart('debug', pragmas.debug);\n      throw new DeveloperError(\n        \"Multiple3DTileContent cannot have group metadata\"\n      );\n      //>>includeEnd('debug');\n    },\n  },\n\n  /**\n   * Get an array of the inner content URLs, regardless of whether they've\n   * been fetched or not. This is intended for use with\n   * {@link Cesium3DTileset#debugShowUrl}.\n   * @memberof Multiple3DTileContent.prototype\n   *\n   * @type {string[]}\n   * @readonly\n   * @private\n   */\n  innerContentUrls: {\n    get: function () {\n      return this._innerContentHeaders.map(function (contentHeader) {\n        return contentHeader.uri;\n      });\n    },\n  },\n});\n\nfunction updatePendingRequests(multipleContents, deltaRequestCount) {\n  multipleContents._requestsInFlight += deltaRequestCount;\n  multipleContents.tileset.statistics.numberOfPendingRequests += deltaRequestCount;\n}\n\nfunction cancelPendingRequests(multipleContents, originalContentState) {\n  multipleContents._cancelCount++;\n\n  // reset the tile's content state to try again later.\n  multipleContents._tile._contentState = originalContentState;\n\n  const statistics = multipleContents.tileset.statistics;\n\n  statistics.numberOfPendingRequests -= multipleContents._requestsInFlight;\n  statistics.numberOfAttemptedRequests += multipleContents._requestsInFlight;\n  multipleContents._requestsInFlight = 0;\n\n  // Discard the request promises.\n  const contentCount = multipleContents._innerContentHeaders.length;\n  multipleContents._arrayFetchPromises = new Array(contentCount);\n}\n\n/**\n * Request the inner contents of this <code>Multiple3DTileContent</code>. This must be called once a frame until\n * {@link Multiple3DTileContent#contentsFetchedPromise} is defined. This promise\n * becomes available as soon as all requests are scheduled.\n * <p>\n * This method also updates the tile statistics' pending request count if the\n * requests are successfully scheduled.\n * </p>\n *\n * @return {Promise<void>|undefined} A promise that resolves when the request completes, or undefined if there is no request needed, or the request cannot be scheduled.\n * @private\n */\nMultiple3DTileContent.prototype.requestInnerContents = function () {\n  // It's possible for these promises to leak content array buffers if the\n  // camera moves before they all are scheduled. To prevent this leak, check\n  // if we can schedule all the requests at once. If not, no requests are\n  // scheduled\n  if (!canScheduleAllRequests(this._serverKeys)) {\n    this.tileset.statistics.numberOfAttemptedRequests += this._serverKeys.length;\n    return;\n  }\n\n  const contentHeaders = this._innerContentHeaders;\n  updatePendingRequests(this, contentHeaders.length);\n\n  const originalCancelCount = this._cancelCount;\n  for (let i = 0; i < contentHeaders.length; i++) {\n    // The cancel count is needed to avoid a race condition where a content\n    // is canceled multiple times.\n    this._arrayFetchPromises[i] = requestInnerContent(\n      this,\n      i,\n      originalCancelCount,\n      this._tile._contentState\n    );\n  }\n\n  return createInnerContents(this);\n};\n\n/**\n * Check if all requests for inner contents can be scheduled at once. This is slower, but it avoids a potential memory leak.\n * @param {string[]} serverKeys The server keys for all of the inner contents\n * @return {boolean} True if the request scheduler has enough open slots for all inner contents\n * @private\n */\nfunction canScheduleAllRequests(serverKeys) {\n  const requestCountsByServer = {};\n  for (let i = 0; i < serverKeys.length; i++) {\n    const serverKey = serverKeys[i];\n    if (defined(requestCountsByServer[serverKey])) {\n      requestCountsByServer[serverKey]++;\n    } else {\n      requestCountsByServer[serverKey] = 1;\n    }\n  }\n\n  for (const key in requestCountsByServer) {\n    if (\n      requestCountsByServer.hasOwnProperty(key) &&\n      !RequestScheduler.serverHasOpenSlots(key, requestCountsByServer[key])\n    ) {\n      return false;\n    }\n  }\n  return RequestScheduler.heapHasOpenSlots(serverKeys.length);\n}\n\nfunction requestInnerContent(\n  multipleContents,\n  index,\n  originalCancelCount,\n  originalContentState\n) {\n  // it is important to clone here. The fetchArrayBuffer() below here uses\n  // throttling, but other uses of the resources do not.\n  const contentResource = multipleContents._innerContentResources[\n    index\n  ].clone();\n  const tile = multipleContents.tile;\n\n  // Always create a new request. If the tile gets canceled, this\n  // avoids getting stuck in the canceled state.\n  const priorityFunction = function () {\n    return tile._priority;\n  };\n  const serverKey = multipleContents._serverKeys[index];\n  const request = new Request({\n    throttle: true,\n    throttleByServer: true,\n    type: RequestType.TILES3D,\n    priorityFunction: priorityFunction,\n    serverKey: serverKey,\n  });\n  contentResource.request = request;\n  multipleContents._requests[index] = request;\n\n  const promise = contentResource.fetchArrayBuffer();\n  if (!defined(promise)) {\n    return;\n  }\n\n  return promise\n    .then(function (arrayBuffer) {\n      // Pending requests have already been canceled.\n      if (originalCancelCount < multipleContents._cancelCount) {\n        return;\n      }\n\n      if (\n        contentResource.request.cancelled ||\n        contentResource.request.state === RequestState.CANCELLED\n      ) {\n        cancelPendingRequests(multipleContents, originalContentState);\n        return;\n      }\n\n      updatePendingRequests(multipleContents, -1);\n      return arrayBuffer;\n    })\n    .catch(function (error) {\n      // Pending requests have already been canceled.\n      if (originalCancelCount < multipleContents._cancelCount) {\n        return;\n      }\n\n      if (\n        contentResource.request.cancelled ||\n        contentResource.request.state === RequestState.CANCELLED\n      ) {\n        cancelPendingRequests(multipleContents, originalContentState);\n        return;\n      }\n\n      updatePendingRequests(multipleContents, -1);\n      handleInnerContentFailed(multipleContents, index, error);\n    });\n}\n\nasync function createInnerContents(multipleContents) {\n  const originalCancelCount = multipleContents._cancelCount;\n  const arrayBuffers = await Promise.all(multipleContents._arrayFetchPromises);\n  // Request have been cancelled\n  if (originalCancelCount < multipleContents._cancelCount) {\n    return;\n  }\n\n  const promises = arrayBuffers.map((arrayBuffer, i) =>\n    createInnerContent(multipleContents, arrayBuffer, i)\n  );\n\n  // Even if we had a partial success (in which case the inner promise will be handled, but the content will not be returned), mark that we finished creating\n  // contents\n  const contents = await Promise.all(promises);\n  multipleContents._contentsCreated = true;\n  multipleContents._contents = contents.filter(defined);\n  return contents;\n}\n\nasync function createInnerContent(multipleContents, arrayBuffer, index) {\n  if (!defined(arrayBuffer)) {\n    // Content was not fetched. The error was handled in\n    // the fetch promise. Return undefined to indicate partial failure.\n    return;\n  }\n\n  try {\n    const preprocessed = preprocess3DTileContent(arrayBuffer);\n\n    if (preprocessed.contentType === Cesium3DTileContentType.EXTERNAL_TILESET) {\n      throw new RuntimeError(\n        \"External tilesets are disallowed inside multiple contents\"\n      );\n    }\n\n    multipleContents._disableSkipLevelOfDetail =\n      multipleContents._disableSkipLevelOfDetail ||\n      preprocessed.contentType === Cesium3DTileContentType.GEOMETRY ||\n      preprocessed.contentType === Cesium3DTileContentType.VECTOR;\n\n    const tileset = multipleContents._tileset;\n    const resource = multipleContents._innerContentResources[index];\n    const tile = multipleContents._tile;\n\n    let content;\n    const contentFactory = Cesium3DTileContentFactory[preprocessed.contentType];\n    if (defined(preprocessed.binaryPayload)) {\n      content = await Promise.resolve(\n        contentFactory(\n          tileset,\n          tile,\n          resource,\n          preprocessed.binaryPayload.buffer,\n          0\n        )\n      );\n    } else {\n      // JSON formats\n      content = await Promise.resolve(\n        contentFactory(tileset, tile, resource, preprocessed.jsonPayload)\n      );\n    }\n\n    const contentHeader = multipleContents._innerContentHeaders[index];\n\n    if (tile.hasImplicitContentMetadata) {\n      const subtree = tile.implicitSubtree;\n      const coordinates = tile.implicitCoordinates;\n      content.metadata = subtree.getContentMetadataView(coordinates, index);\n    } else if (!tile.hasImplicitContent) {\n      content.metadata = findContentMetadata(tileset, contentHeader);\n    }\n\n    const groupMetadata = findGroupMetadata(tileset, contentHeader);\n    if (defined(groupMetadata)) {\n      content.group = new Cesium3DContentGroup({\n        metadata: groupMetadata,\n      });\n    }\n    return content;\n  } catch (error) {\n    handleInnerContentFailed(multipleContents, index, error);\n  }\n}\n\nfunction handleInnerContentFailed(multipleContents, index, error) {\n  const tileset = multipleContents._tileset;\n  const url = multipleContents._innerContentResources[index].url;\n  const message = defined(error.message) ? error.message : error.toString();\n  if (tileset.tileFailed.numberOfListeners > 0) {\n    tileset.tileFailed.raiseEvent({\n      url: url,\n      message: message,\n    });\n  } else {\n    console.log(`A content failed to load: ${url}`);\n    console.log(`Error: ${message}`);\n  }\n}\n\n/**\n * Cancel all requests for inner contents. This is called by the tile\n * when a tile goes out of view.\n *\n * @private\n */\nMultiple3DTileContent.prototype.cancelRequests = function () {\n  for (let i = 0; i < this._requests.length; i++) {\n    const request = this._requests[i];\n    if (defined(request)) {\n      request.cancel();\n    }\n  }\n};\n\n/**\n * Part of the {@link Cesium3DTileContent} interface.  <code>Multiple3DTileContent</code>\n * always returns <code>false</code>.  Instead call <code>hasProperty</code> for a specific inner content\n * @private\n */\nMultiple3DTileContent.prototype.hasProperty = function (batchId, name) {\n  return false;\n};\n\n/**\n * Part of the {@link Cesium3DTileContent} interface.  <code>Multiple3DTileContent</code>\n * always returns <code>undefined</code>.  Instead call <code>getFeature</code> for a specific inner content\n * @private\n */\nMultiple3DTileContent.prototype.getFeature = function (batchId) {\n  return undefined;\n};\n\nMultiple3DTileContent.prototype.applyDebugSettings = function (enabled, color) {\n  const contents = this._contents;\n  const length = contents.length;\n  for (let i = 0; i < length; ++i) {\n    contents[i].applyDebugSettings(enabled, color);\n  }\n};\n\nMultiple3DTileContent.prototype.applyStyle = function (style) {\n  const contents = this._contents;\n  const length = contents.length;\n  for (let i = 0; i < length; ++i) {\n    contents[i].applyStyle(style);\n  }\n};\n\nMultiple3DTileContent.prototype.update = function (tileset, frameState) {\n  const contents = this._contents;\n  const length = contents.length;\n  let ready = true;\n  for (let i = 0; i < length; ++i) {\n    contents[i].update(tileset, frameState);\n    ready = ready && contents[i].ready;\n  }\n\n  if (!this._ready && ready) {\n    this._ready = true;\n  }\n};\n\nMultiple3DTileContent.prototype.isDestroyed = function () {\n  return false;\n};\n\nMultiple3DTileContent.prototype.destroy = function () {\n  const contents = this._contents;\n  const length = contents.length;\n  for (let i = 0; i < length; ++i) {\n    contents[i].destroy();\n  }\n  return destroyObject(this);\n};\n\nexport default Multiple3DTileContent;\n", "import earcut from \"earcut\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidRhumbLine from \"./EllipsoidRhumbLine.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport WindingOrder from \"./WindingOrder.js\";\n\nconst scaleToGeodeticHeightN = new Cartesian3();\nconst scaleToGeodeticHeightP = new Cartesian3();\n\n/**\n * @private\n */\nconst PolygonPipeline = {};\n\n/**\n * @exception {DeveloperError} At least three positions are required.\n */\nPolygonPipeline.computeArea2D = function (positions) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"positions\", positions);\n  Check.typeOf.number.greaterThanOrEquals(\n    \"positions.length\",\n    positions.length,\n    3\n  );\n  //>>includeEnd('debug');\n\n  const length = positions.length;\n  let area = 0.0;\n\n  for (let i0 = length - 1, i1 = 0; i1 < length; i0 = i1++) {\n    const v0 = positions[i0];\n    const v1 = positions[i1];\n\n    area += v0.x * v1.y - v1.x * v0.y;\n  }\n\n  return area * 0.5;\n};\n\n/**\n * @returns {WindingOrder} The winding order.\n *\n * @exception {DeveloperError} At least three positions are required.\n */\nPolygonPipeline.computeWindingOrder2D = function (positions) {\n  const area = PolygonPipeline.computeArea2D(positions);\n  return area > 0.0 ? WindingOrder.COUNTER_CLOCKWISE : WindingOrder.CLOCKWISE;\n};\n\n/**\n * Triangulate a polygon.\n *\n * @param {Cartesian2[]} positions Cartesian2 array containing the vertices of the polygon\n * @param {number[]} [holes] An array of the staring indices of the holes.\n * @returns {number[]} Index array representing triangles that fill the polygon\n */\nPolygonPipeline.triangulate = function (positions, holes) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"positions\", positions);\n  //>>includeEnd('debug');\n\n  const flattenedPositions = Cartesian2.packArray(positions);\n  return earcut(flattenedPositions, holes, 2);\n};\n\nconst subdivisionV0Scratch = new Cartesian3();\nconst subdivisionV1Scratch = new Cartesian3();\nconst subdivisionV2Scratch = new Cartesian3();\nconst subdivisionS0Scratch = new Cartesian3();\nconst subdivisionS1Scratch = new Cartesian3();\nconst subdivisionS2Scratch = new Cartesian3();\nconst subdivisionMidScratch = new Cartesian3();\nconst subdivisionT0Scratch = new Cartesian2();\nconst subdivisionT1Scratch = new Cartesian2();\nconst subdivisionT2Scratch = new Cartesian2();\nconst subdivisionTexcoordMidScratch = new Cartesian2();\n\n/**\n * Subdivides positions and raises points to the surface of the ellipsoid.\n *\n * @param {Ellipsoid} ellipsoid The ellipsoid the polygon in on.\n * @param {Cartesian3[]} positions An array of {@link Cartesian3} positions of the polygon.\n * @param {number[]} indices An array of indices that determines the triangles in the polygon.\n * @param {Cartesian2[]} texcoords An optional array of {@link Cartesian2} texture coordinates of the polygon.\n * @param {number} [granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n *\n * @exception {DeveloperError} At least three indices are required.\n * @exception {DeveloperError} The number of indices must be divisable by three.\n * @exception {DeveloperError} Granularity must be greater than zero.\n */\nPolygonPipeline.computeSubdivision = function (\n  ellipsoid,\n  positions,\n  indices,\n  texcoords,\n  granularity\n) {\n  granularity = defaultValue(granularity, CesiumMath.RADIANS_PER_DEGREE);\n\n  const hasTexcoords = defined(texcoords);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"ellipsoid\", ellipsoid);\n  Check.defined(\"positions\", positions);\n  Check.defined(\"indices\", indices);\n  Check.typeOf.number.greaterThanOrEquals(\"indices.length\", indices.length, 3);\n  Check.typeOf.number.equals(\"indices.length % 3\", \"0\", indices.length % 3, 0);\n  Check.typeOf.number.greaterThan(\"granularity\", granularity, 0.0);\n  //>>includeEnd('debug');\n\n  // triangles that need (or might need) to be subdivided.\n  const triangles = indices.slice(0);\n\n  // New positions due to edge splits are appended to the positions list.\n  let i;\n  const length = positions.length;\n  const subdividedPositions = new Array(length * 3);\n  const subdividedTexcoords = new Array(length * 2);\n  let q = 0;\n  let p = 0;\n  for (i = 0; i < length; i++) {\n    const item = positions[i];\n    subdividedPositions[q++] = item.x;\n    subdividedPositions[q++] = item.y;\n    subdividedPositions[q++] = item.z;\n\n    if (hasTexcoords) {\n      const texcoordItem = texcoords[i];\n      subdividedTexcoords[p++] = texcoordItem.x;\n      subdividedTexcoords[p++] = texcoordItem.y;\n    }\n  }\n\n  const subdividedIndices = [];\n\n  // Used to make sure shared edges are not split more than once.\n  const edges = {};\n\n  const radius = ellipsoid.maximumRadius;\n  const minDistance = CesiumMath.chordLength(granularity, radius);\n  const minDistanceSqrd = minDistance * minDistance;\n\n  while (triangles.length > 0) {\n    const i2 = triangles.pop();\n    const i1 = triangles.pop();\n    const i0 = triangles.pop();\n\n    const v0 = Cartesian3.fromArray(\n      subdividedPositions,\n      i0 * 3,\n      subdivisionV0Scratch\n    );\n    const v1 = Cartesian3.fromArray(\n      subdividedPositions,\n      i1 * 3,\n      subdivisionV1Scratch\n    );\n    const v2 = Cartesian3.fromArray(\n      subdividedPositions,\n      i2 * 3,\n      subdivisionV2Scratch\n    );\n\n    let t0, t1, t2;\n    if (hasTexcoords) {\n      t0 = Cartesian2.fromArray(\n        subdividedTexcoords,\n        i0 * 2,\n        subdivisionT0Scratch\n      );\n      t1 = Cartesian2.fromArray(\n        subdividedTexcoords,\n        i1 * 2,\n        subdivisionT1Scratch\n      );\n      t2 = Cartesian2.fromArray(\n        subdividedTexcoords,\n        i2 * 2,\n        subdivisionT2Scratch\n      );\n    }\n\n    const s0 = Cartesian3.multiplyByScalar(\n      Cartesian3.normalize(v0, subdivisionS0Scratch),\n      radius,\n      subdivisionS0Scratch\n    );\n    const s1 = Cartesian3.multiplyByScalar(\n      Cartesian3.normalize(v1, subdivisionS1Scratch),\n      radius,\n      subdivisionS1Scratch\n    );\n    const s2 = Cartesian3.multiplyByScalar(\n      Cartesian3.normalize(v2, subdivisionS2Scratch),\n      radius,\n      subdivisionS2Scratch\n    );\n\n    const g0 = Cartesian3.magnitudeSquared(\n      Cartesian3.subtract(s0, s1, subdivisionMidScratch)\n    );\n    const g1 = Cartesian3.magnitudeSquared(\n      Cartesian3.subtract(s1, s2, subdivisionMidScratch)\n    );\n    const g2 = Cartesian3.magnitudeSquared(\n      Cartesian3.subtract(s2, s0, subdivisionMidScratch)\n    );\n\n    const max = Math.max(g0, g1, g2);\n    let edge;\n    let mid;\n    let midTexcoord;\n\n    // if the max length squared of a triangle edge is greater than the chord length of squared\n    // of the granularity, subdivide the triangle\n    if (max > minDistanceSqrd) {\n      if (g0 === max) {\n        edge = `${Math.min(i0, i1)} ${Math.max(i0, i1)}`;\n\n        i = edges[edge];\n        if (!defined(i)) {\n          mid = Cartesian3.add(v0, v1, subdivisionMidScratch);\n          Cartesian3.multiplyByScalar(mid, 0.5, mid);\n          subdividedPositions.push(mid.x, mid.y, mid.z);\n          i = subdividedPositions.length / 3 - 1;\n          edges[edge] = i;\n\n          if (hasTexcoords) {\n            midTexcoord = Cartesian2.add(t0, t1, subdivisionTexcoordMidScratch);\n            Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\n            subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\n          }\n        }\n\n        triangles.push(i0, i, i2);\n        triangles.push(i, i1, i2);\n      } else if (g1 === max) {\n        edge = `${Math.min(i1, i2)} ${Math.max(i1, i2)}`;\n\n        i = edges[edge];\n        if (!defined(i)) {\n          mid = Cartesian3.add(v1, v2, subdivisionMidScratch);\n          Cartesian3.multiplyByScalar(mid, 0.5, mid);\n          subdividedPositions.push(mid.x, mid.y, mid.z);\n          i = subdividedPositions.length / 3 - 1;\n          edges[edge] = i;\n\n          if (hasTexcoords) {\n            midTexcoord = Cartesian2.add(t1, t2, subdivisionTexcoordMidScratch);\n            Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\n            subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\n          }\n        }\n\n        triangles.push(i1, i, i0);\n        triangles.push(i, i2, i0);\n      } else if (g2 === max) {\n        edge = `${Math.min(i2, i0)} ${Math.max(i2, i0)}`;\n\n        i = edges[edge];\n        if (!defined(i)) {\n          mid = Cartesian3.add(v2, v0, subdivisionMidScratch);\n          Cartesian3.multiplyByScalar(mid, 0.5, mid);\n          subdividedPositions.push(mid.x, mid.y, mid.z);\n          i = subdividedPositions.length / 3 - 1;\n          edges[edge] = i;\n\n          if (hasTexcoords) {\n            midTexcoord = Cartesian2.add(t2, t0, subdivisionTexcoordMidScratch);\n            Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\n            subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\n          }\n        }\n\n        triangles.push(i2, i, i1);\n        triangles.push(i, i0, i1);\n      }\n    } else {\n      subdividedIndices.push(i0);\n      subdividedIndices.push(i1);\n      subdividedIndices.push(i2);\n    }\n  }\n\n  const geometryOptions = {\n    attributes: {\n      position: new GeometryAttribute({\n        componentDatatype: ComponentDatatype.DOUBLE,\n        componentsPerAttribute: 3,\n        values: subdividedPositions,\n      }),\n    },\n    indices: subdividedIndices,\n    primitiveType: PrimitiveType.TRIANGLES,\n  };\n\n  if (hasTexcoords) {\n    geometryOptions.attributes.st = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n      values: subdividedTexcoords,\n    });\n  }\n\n  return new Geometry(geometryOptions);\n};\n\nconst subdivisionC0Scratch = new Cartographic();\nconst subdivisionC1Scratch = new Cartographic();\nconst subdivisionC2Scratch = new Cartographic();\nconst subdivisionCartographicScratch = new Cartographic();\n\n/**\n * Subdivides positions on rhumb lines and raises points to the surface of the ellipsoid.\n *\n * @param {Ellipsoid} ellipsoid The ellipsoid the polygon in on.\n * @param {Cartesian3[]} positions An array of {@link Cartesian3} positions of the polygon.\n * @param {number[]} indices An array of indices that determines the triangles in the polygon.\n * @param {Cartesian2[]} texcoords An optional array of {@link Cartesian2} texture coordinates of the polygon.\n * @param {number} [granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n *\n * @exception {DeveloperError} At least three indices are required.\n * @exception {DeveloperError} The number of indices must be divisable by three.\n * @exception {DeveloperError} Granularity must be greater than zero.\n */\nPolygonPipeline.computeRhumbLineSubdivision = function (\n  ellipsoid,\n  positions,\n  indices,\n  texcoords,\n  granularity\n) {\n  granularity = defaultValue(granularity, CesiumMath.RADIANS_PER_DEGREE);\n\n  const hasTexcoords = defined(texcoords);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"ellipsoid\", ellipsoid);\n  Check.defined(\"positions\", positions);\n  Check.defined(\"indices\", indices);\n  Check.typeOf.number.greaterThanOrEquals(\"indices.length\", indices.length, 3);\n  Check.typeOf.number.equals(\"indices.length % 3\", \"0\", indices.length % 3, 0);\n  Check.typeOf.number.greaterThan(\"granularity\", granularity, 0.0);\n  //>>includeEnd('debug');\n\n  // triangles that need (or might need) to be subdivided.\n  const triangles = indices.slice(0);\n\n  // New positions due to edge splits are appended to the positions list.\n  let i;\n  const length = positions.length;\n  const subdividedPositions = new Array(length * 3);\n  const subdividedTexcoords = new Array(length * 2);\n  let q = 0;\n  let p = 0;\n  for (i = 0; i < length; i++) {\n    const item = positions[i];\n    subdividedPositions[q++] = item.x;\n    subdividedPositions[q++] = item.y;\n    subdividedPositions[q++] = item.z;\n\n    if (hasTexcoords) {\n      const texcoordItem = texcoords[i];\n      subdividedTexcoords[p++] = texcoordItem.x;\n      subdividedTexcoords[p++] = texcoordItem.y;\n    }\n  }\n\n  const subdividedIndices = [];\n\n  // Used to make sure shared edges are not split more than once.\n  const edges = {};\n\n  const radius = ellipsoid.maximumRadius;\n  const minDistance = CesiumMath.chordLength(granularity, radius);\n\n  const rhumb0 = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);\n  const rhumb1 = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);\n  const rhumb2 = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);\n\n  while (triangles.length > 0) {\n    const i2 = triangles.pop();\n    const i1 = triangles.pop();\n    const i0 = triangles.pop();\n\n    const v0 = Cartesian3.fromArray(\n      subdividedPositions,\n      i0 * 3,\n      subdivisionV0Scratch\n    );\n    const v1 = Cartesian3.fromArray(\n      subdividedPositions,\n      i1 * 3,\n      subdivisionV1Scratch\n    );\n    const v2 = Cartesian3.fromArray(\n      subdividedPositions,\n      i2 * 3,\n      subdivisionV2Scratch\n    );\n\n    let t0, t1, t2;\n    if (hasTexcoords) {\n      t0 = Cartesian2.fromArray(\n        subdividedTexcoords,\n        i0 * 2,\n        subdivisionT0Scratch\n      );\n      t1 = Cartesian2.fromArray(\n        subdividedTexcoords,\n        i1 * 2,\n        subdivisionT1Scratch\n      );\n      t2 = Cartesian2.fromArray(\n        subdividedTexcoords,\n        i2 * 2,\n        subdivisionT2Scratch\n      );\n    }\n\n    const c0 = ellipsoid.cartesianToCartographic(v0, subdivisionC0Scratch);\n    const c1 = ellipsoid.cartesianToCartographic(v1, subdivisionC1Scratch);\n    const c2 = ellipsoid.cartesianToCartographic(v2, subdivisionC2Scratch);\n\n    rhumb0.setEndPoints(c0, c1);\n    const g0 = rhumb0.surfaceDistance;\n    rhumb1.setEndPoints(c1, c2);\n    const g1 = rhumb1.surfaceDistance;\n    rhumb2.setEndPoints(c2, c0);\n    const g2 = rhumb2.surfaceDistance;\n\n    const max = Math.max(g0, g1, g2);\n    let edge;\n    let mid;\n    let midHeight;\n    let midCartesian3;\n    let midTexcoord;\n\n    // if the max length squared of a triangle edge is greater than granularity, subdivide the triangle\n    if (max > minDistance) {\n      if (g0 === max) {\n        edge = `${Math.min(i0, i1)} ${Math.max(i0, i1)}`;\n\n        i = edges[edge];\n        if (!defined(i)) {\n          mid = rhumb0.interpolateUsingFraction(\n            0.5,\n            subdivisionCartographicScratch\n          );\n          midHeight = (c0.height + c1.height) * 0.5;\n          midCartesian3 = Cartesian3.fromRadians(\n            mid.longitude,\n            mid.latitude,\n            midHeight,\n            ellipsoid,\n            subdivisionMidScratch\n          );\n          subdividedPositions.push(\n            midCartesian3.x,\n            midCartesian3.y,\n            midCartesian3.z\n          );\n          i = subdividedPositions.length / 3 - 1;\n          edges[edge] = i;\n\n          if (hasTexcoords) {\n            midTexcoord = Cartesian2.add(t0, t1, subdivisionTexcoordMidScratch);\n            Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\n            subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\n          }\n        }\n\n        triangles.push(i0, i, i2);\n        triangles.push(i, i1, i2);\n      } else if (g1 === max) {\n        edge = `${Math.min(i1, i2)} ${Math.max(i1, i2)}`;\n\n        i = edges[edge];\n        if (!defined(i)) {\n          mid = rhumb1.interpolateUsingFraction(\n            0.5,\n            subdivisionCartographicScratch\n          );\n          midHeight = (c1.height + c2.height) * 0.5;\n          midCartesian3 = Cartesian3.fromRadians(\n            mid.longitude,\n            mid.latitude,\n            midHeight,\n            ellipsoid,\n            subdivisionMidScratch\n          );\n          subdividedPositions.push(\n            midCartesian3.x,\n            midCartesian3.y,\n            midCartesian3.z\n          );\n          i = subdividedPositions.length / 3 - 1;\n          edges[edge] = i;\n\n          if (hasTexcoords) {\n            midTexcoord = Cartesian2.add(t1, t2, subdivisionTexcoordMidScratch);\n            Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\n            subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\n          }\n        }\n\n        triangles.push(i1, i, i0);\n        triangles.push(i, i2, i0);\n      } else if (g2 === max) {\n        edge = `${Math.min(i2, i0)} ${Math.max(i2, i0)}`;\n\n        i = edges[edge];\n        if (!defined(i)) {\n          mid = rhumb2.interpolateUsingFraction(\n            0.5,\n            subdivisionCartographicScratch\n          );\n          midHeight = (c2.height + c0.height) * 0.5;\n          midCartesian3 = Cartesian3.fromRadians(\n            mid.longitude,\n            mid.latitude,\n            midHeight,\n            ellipsoid,\n            subdivisionMidScratch\n          );\n          subdividedPositions.push(\n            midCartesian3.x,\n            midCartesian3.y,\n            midCartesian3.z\n          );\n          i = subdividedPositions.length / 3 - 1;\n          edges[edge] = i;\n\n          if (hasTexcoords) {\n            midTexcoord = Cartesian2.add(t2, t0, subdivisionTexcoordMidScratch);\n            Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\n            subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\n          }\n        }\n\n        triangles.push(i2, i, i1);\n        triangles.push(i, i0, i1);\n      }\n    } else {\n      subdividedIndices.push(i0);\n      subdividedIndices.push(i1);\n      subdividedIndices.push(i2);\n    }\n  }\n\n  const geometryOptions = {\n    attributes: {\n      position: new GeometryAttribute({\n        componentDatatype: ComponentDatatype.DOUBLE,\n        componentsPerAttribute: 3,\n        values: subdividedPositions,\n      }),\n    },\n    indices: subdividedIndices,\n    primitiveType: PrimitiveType.TRIANGLES,\n  };\n\n  if (hasTexcoords) {\n    geometryOptions.attributes.st = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n      values: subdividedTexcoords,\n    });\n  }\n\n  return new Geometry(geometryOptions);\n};\n\n/**\n * Scales each position of a geometry's position attribute to a height, in place.\n *\n * @param {number[]} positions The array of numbers representing the positions to be scaled\n * @param {number} [height=0.0] The desired height to add to the positions\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.\n * @param {boolean} [scaleToSurface=true] <code>true</code> if the positions need to be scaled to the surface before the height is added.\n * @returns {number[]} The input array of positions, scaled to height\n */\nPolygonPipeline.scaleToGeodeticHeight = function (\n  positions,\n  height,\n  ellipsoid,\n  scaleToSurface\n) {\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n  let n = scaleToGeodeticHeightN;\n  let p = scaleToGeodeticHeightP;\n\n  height = defaultValue(height, 0.0);\n  scaleToSurface = defaultValue(scaleToSurface, true);\n\n  if (defined(positions)) {\n    const length = positions.length;\n\n    for (let i = 0; i < length; i += 3) {\n      Cartesian3.fromArray(positions, i, p);\n\n      if (scaleToSurface) {\n        p = ellipsoid.scaleToGeodeticSurface(p, p);\n      }\n\n      if (height !== 0) {\n        n = ellipsoid.geodeticSurfaceNormal(p, n);\n\n        Cartesian3.multiplyByScalar(n, height, n);\n        Cartesian3.add(p, n, p);\n      }\n\n      positions[i] = p.x;\n      positions[i + 1] = p.y;\n      positions[i + 2] = p.z;\n    }\n  }\n\n  return positions;\n};\nexport default PolygonPipeline;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix2 from \"./Matrix2.js\";\nimport Rectangle from \"./Rectangle.js\";\n\nconst cos = Math.cos;\nconst sin = Math.sin;\nconst sqrt = Math.sqrt;\n\n/**\n * @private\n */\nconst RectangleGeometryLibrary = {};\n\n/**\n * @private\n */\nRectangleGeometryLibrary.computePosition = function (\n  computedOptions,\n  ellipsoid,\n  computeST,\n  row,\n  col,\n  position,\n  st\n) {\n  const radiiSquared = ellipsoid.radiiSquared;\n  const nwCorner = computedOptions.nwCorner;\n  const rectangle = computedOptions.boundingRectangle;\n\n  let stLatitude =\n    nwCorner.latitude -\n    computedOptions.granYCos * row +\n    col * computedOptions.granXSin;\n  const cosLatitude = cos(stLatitude);\n  const nZ = sin(stLatitude);\n  const kZ = radiiSquared.z * nZ;\n\n  let stLongitude =\n    nwCorner.longitude +\n    row * computedOptions.granYSin +\n    col * computedOptions.granXCos;\n  const nX = cosLatitude * cos(stLongitude);\n  const nY = cosLatitude * sin(stLongitude);\n\n  const kX = radiiSquared.x * nX;\n  const kY = radiiSquared.y * nY;\n\n  const gamma = sqrt(kX * nX + kY * nY + kZ * nZ);\n\n  position.x = kX / gamma;\n  position.y = kY / gamma;\n  position.z = kZ / gamma;\n\n  if (computeST) {\n    const stNwCorner = computedOptions.stNwCorner;\n    if (defined(stNwCorner)) {\n      stLatitude =\n        stNwCorner.latitude -\n        computedOptions.stGranYCos * row +\n        col * computedOptions.stGranXSin;\n      stLongitude =\n        stNwCorner.longitude +\n        row * computedOptions.stGranYSin +\n        col * computedOptions.stGranXCos;\n\n      st.x = (stLongitude - computedOptions.stWest) * computedOptions.lonScalar;\n      st.y = (stLatitude - computedOptions.stSouth) * computedOptions.latScalar;\n    } else {\n      st.x = (stLongitude - rectangle.west) * computedOptions.lonScalar;\n      st.y = (stLatitude - rectangle.south) * computedOptions.latScalar;\n    }\n  }\n};\n\nconst rotationMatrixScratch = new Matrix2();\nlet nwCartesian = new Cartesian3();\nconst centerScratch = new Cartographic();\nlet centerCartesian = new Cartesian3();\nconst proj = new GeographicProjection();\n\nfunction getRotationOptions(\n  nwCorner,\n  rotation,\n  granularityX,\n  granularityY,\n  center,\n  width,\n  height\n) {\n  const cosRotation = Math.cos(rotation);\n  const granYCos = granularityY * cosRotation;\n  const granXCos = granularityX * cosRotation;\n\n  const sinRotation = Math.sin(rotation);\n  const granYSin = granularityY * sinRotation;\n  const granXSin = granularityX * sinRotation;\n\n  nwCartesian = proj.project(nwCorner, nwCartesian);\n\n  nwCartesian = Cartesian3.subtract(nwCartesian, centerCartesian, nwCartesian);\n  const rotationMatrix = Matrix2.fromRotation(rotation, rotationMatrixScratch);\n  nwCartesian = Matrix2.multiplyByVector(\n    rotationMatrix,\n    nwCartesian,\n    nwCartesian\n  );\n  nwCartesian = Cartesian3.add(nwCartesian, centerCartesian, nwCartesian);\n  nwCorner = proj.unproject(nwCartesian, nwCorner);\n\n  width -= 1;\n  height -= 1;\n\n  const latitude = nwCorner.latitude;\n  const latitude0 = latitude + width * granXSin;\n  const latitude1 = latitude - granYCos * height;\n  const latitude2 = latitude - granYCos * height + width * granXSin;\n\n  const north = Math.max(latitude, latitude0, latitude1, latitude2);\n  const south = Math.min(latitude, latitude0, latitude1, latitude2);\n\n  const longitude = nwCorner.longitude;\n  const longitude0 = longitude + width * granXCos;\n  const longitude1 = longitude + height * granYSin;\n  const longitude2 = longitude + height * granYSin + width * granXCos;\n\n  const east = Math.max(longitude, longitude0, longitude1, longitude2);\n  const west = Math.min(longitude, longitude0, longitude1, longitude2);\n\n  return {\n    north: north,\n    south: south,\n    east: east,\n    west: west,\n    granYCos: granYCos,\n    granYSin: granYSin,\n    granXCos: granXCos,\n    granXSin: granXSin,\n    nwCorner: nwCorner,\n  };\n}\n\n/**\n * @private\n */\nRectangleGeometryLibrary.computeOptions = function (\n  rectangle,\n  granularity,\n  rotation,\n  stRotation,\n  boundingRectangleScratch,\n  nwCornerResult,\n  stNwCornerResult\n) {\n  let east = rectangle.east;\n  let west = rectangle.west;\n  let north = rectangle.north;\n  let south = rectangle.south;\n\n  let northCap = false;\n  let southCap = false;\n\n  if (north === CesiumMath.PI_OVER_TWO) {\n    northCap = true;\n  }\n  if (south === -CesiumMath.PI_OVER_TWO) {\n    southCap = true;\n  }\n\n  let dx;\n  const dy = north - south;\n  if (west > east) {\n    dx = CesiumMath.TWO_PI - west + east;\n  } else {\n    dx = east - west;\n  }\n\n  const width = Math.ceil(dx / granularity) + 1;\n  const height = Math.ceil(dy / granularity) + 1;\n  const granularityX = dx / (width - 1);\n  const granularityY = dy / (height - 1);\n\n  const nwCorner = Rectangle.northwest(rectangle, nwCornerResult);\n  const center = Rectangle.center(rectangle, centerScratch);\n  if (rotation !== 0 || stRotation !== 0) {\n    if (center.longitude < nwCorner.longitude) {\n      center.longitude += CesiumMath.TWO_PI;\n    }\n    centerCartesian = proj.project(center, centerCartesian);\n  }\n\n  const granYCos = granularityY;\n  const granXCos = granularityX;\n  const granYSin = 0.0;\n  const granXSin = 0.0;\n\n  const boundingRectangle = Rectangle.clone(\n    rectangle,\n    boundingRectangleScratch\n  );\n\n  const computedOptions = {\n    granYCos: granYCos,\n    granYSin: granYSin,\n    granXCos: granXCos,\n    granXSin: granXSin,\n    nwCorner: nwCorner,\n    boundingRectangle: boundingRectangle,\n    width: width,\n    height: height,\n    northCap: northCap,\n    southCap: southCap,\n  };\n\n  if (rotation !== 0) {\n    const rotationOptions = getRotationOptions(\n      nwCorner,\n      rotation,\n      granularityX,\n      granularityY,\n      center,\n      width,\n      height\n    );\n    north = rotationOptions.north;\n    south = rotationOptions.south;\n    east = rotationOptions.east;\n    west = rotationOptions.west;\n\n    //>>includeStart('debug', pragmas.debug);\n    if (\n      north < -CesiumMath.PI_OVER_TWO ||\n      north > CesiumMath.PI_OVER_TWO ||\n      south < -CesiumMath.PI_OVER_TWO ||\n      south > CesiumMath.PI_OVER_TWO\n    ) {\n      throw new DeveloperError(\n        \"Rotated rectangle is invalid.  It crosses over either the north or south pole.\"\n      );\n    }\n    //>>includeEnd('debug')\n\n    computedOptions.granYCos = rotationOptions.granYCos;\n    computedOptions.granYSin = rotationOptions.granYSin;\n    computedOptions.granXCos = rotationOptions.granXCos;\n    computedOptions.granXSin = rotationOptions.granXSin;\n\n    boundingRectangle.north = north;\n    boundingRectangle.south = south;\n    boundingRectangle.east = east;\n    boundingRectangle.west = west;\n  }\n\n  if (stRotation !== 0) {\n    rotation = rotation - stRotation;\n    const stNwCorner = Rectangle.northwest(boundingRectangle, stNwCornerResult);\n\n    const stRotationOptions = getRotationOptions(\n      stNwCorner,\n      rotation,\n      granularityX,\n      granularityY,\n      center,\n      width,\n      height\n    );\n\n    computedOptions.stGranYCos = stRotationOptions.granYCos;\n    computedOptions.stGranXCos = stRotationOptions.granXCos;\n    computedOptions.stGranYSin = stRotationOptions.granYSin;\n    computedOptions.stGranXSin = stRotationOptions.granXSin;\n    computedOptions.stNwCorner = stNwCorner;\n    computedOptions.stWest = stRotationOptions.west;\n    computedOptions.stSouth = stRotationOptions.south;\n  }\n\n  return computedOptions;\n};\nexport default RectangleGeometryLibrary;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport RectangleGeometryLibrary from \"./RectangleGeometryLibrary.js\";\n\nconst bottomBoundingSphere = new BoundingSphere();\nconst topBoundingSphere = new BoundingSphere();\nconst positionScratch = new Cartesian3();\nconst rectangleScratch = new Rectangle();\n\nfunction constructRectangle(geometry, computedOptions) {\n  const ellipsoid = geometry._ellipsoid;\n  const height = computedOptions.height;\n  const width = computedOptions.width;\n  const northCap = computedOptions.northCap;\n  const southCap = computedOptions.southCap;\n\n  let rowHeight = height;\n  let widthMultiplier = 2;\n  let size = 0;\n  let corners = 4;\n  if (northCap) {\n    widthMultiplier -= 1;\n    rowHeight -= 1;\n    size += 1;\n    corners -= 2;\n  }\n  if (southCap) {\n    widthMultiplier -= 1;\n    rowHeight -= 1;\n    size += 1;\n    corners -= 2;\n  }\n  size += widthMultiplier * width + 2 * rowHeight - corners;\n\n  const positions = new Float64Array(size * 3);\n\n  let posIndex = 0;\n  let row = 0;\n  let col;\n  const position = positionScratch;\n  if (northCap) {\n    RectangleGeometryLibrary.computePosition(\n      computedOptions,\n      ellipsoid,\n      false,\n      row,\n      0,\n      position\n    );\n    positions[posIndex++] = position.x;\n    positions[posIndex++] = position.y;\n    positions[posIndex++] = position.z;\n  } else {\n    for (col = 0; col < width; col++) {\n      RectangleGeometryLibrary.computePosition(\n        computedOptions,\n        ellipsoid,\n        false,\n        row,\n        col,\n        position\n      );\n      positions[posIndex++] = position.x;\n      positions[posIndex++] = position.y;\n      positions[posIndex++] = position.z;\n    }\n  }\n\n  col = width - 1;\n  for (row = 1; row < height; row++) {\n    RectangleGeometryLibrary.computePosition(\n      computedOptions,\n      ellipsoid,\n      false,\n      row,\n      col,\n      position\n    );\n    positions[posIndex++] = position.x;\n    positions[posIndex++] = position.y;\n    positions[posIndex++] = position.z;\n  }\n\n  row = height - 1;\n  if (!southCap) {\n    // if southCap is true, we dont need to add any more points because the south pole point was added by the iteration above\n    for (col = width - 2; col >= 0; col--) {\n      RectangleGeometryLibrary.computePosition(\n        computedOptions,\n        ellipsoid,\n        false,\n        row,\n        col,\n        position\n      );\n      positions[posIndex++] = position.x;\n      positions[posIndex++] = position.y;\n      positions[posIndex++] = position.z;\n    }\n  }\n\n  col = 0;\n  for (row = height - 2; row > 0; row--) {\n    RectangleGeometryLibrary.computePosition(\n      computedOptions,\n      ellipsoid,\n      false,\n      row,\n      col,\n      position\n    );\n    positions[posIndex++] = position.x;\n    positions[posIndex++] = position.y;\n    positions[posIndex++] = position.z;\n  }\n\n  const indicesSize = (positions.length / 3) * 2;\n  const indices = IndexDatatype.createTypedArray(\n    positions.length / 3,\n    indicesSize\n  );\n\n  let index = 0;\n  for (let i = 0; i < positions.length / 3 - 1; i++) {\n    indices[index++] = i;\n    indices[index++] = i + 1;\n  }\n  indices[index++] = positions.length / 3 - 1;\n  indices[index++] = 0;\n\n  const geo = new Geometry({\n    attributes: new GeometryAttributes(),\n    primitiveType: PrimitiveType.LINES,\n  });\n\n  geo.attributes.position = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.DOUBLE,\n    componentsPerAttribute: 3,\n    values: positions,\n  });\n  geo.indices = indices;\n\n  return geo;\n}\n\nfunction constructExtrudedRectangle(rectangleGeometry, computedOptions) {\n  const maxHeight = rectangleGeometry._surfaceHeight;\n  const minHeight = rectangleGeometry._extrudedHeight;\n  const ellipsoid = rectangleGeometry._ellipsoid;\n  const geo = constructRectangle(rectangleGeometry, computedOptions);\n\n  const height = computedOptions.height;\n  const width = computedOptions.width;\n\n  const topPositions = PolygonPipeline.scaleToGeodeticHeight(\n    geo.attributes.position.values,\n    maxHeight,\n    ellipsoid,\n    false\n  );\n  let length = topPositions.length;\n  const positions = new Float64Array(length * 2);\n  positions.set(topPositions);\n  const bottomPositions = PolygonPipeline.scaleToGeodeticHeight(\n    geo.attributes.position.values,\n    minHeight,\n    ellipsoid\n  );\n  positions.set(bottomPositions, length);\n  geo.attributes.position.values = positions;\n\n  const northCap = computedOptions.northCap;\n  const southCap = computedOptions.southCap;\n  let corners = 4;\n  if (northCap) {\n    corners -= 1;\n  }\n  if (southCap) {\n    corners -= 1;\n  }\n\n  const indicesSize = (positions.length / 3 + corners) * 2;\n  const indices = IndexDatatype.createTypedArray(\n    positions.length / 3,\n    indicesSize\n  );\n  length = positions.length / 6;\n  let index = 0;\n  for (let i = 0; i < length - 1; i++) {\n    indices[index++] = i;\n    indices[index++] = i + 1;\n    indices[index++] = i + length;\n    indices[index++] = i + length + 1;\n  }\n  indices[index++] = length - 1;\n  indices[index++] = 0;\n  indices[index++] = length + length - 1;\n  indices[index++] = length;\n\n  indices[index++] = 0;\n  indices[index++] = length;\n\n  let bottomCorner;\n  if (northCap) {\n    bottomCorner = height - 1;\n  } else {\n    const topRightCorner = width - 1;\n    indices[index++] = topRightCorner;\n    indices[index++] = topRightCorner + length;\n    bottomCorner = width + height - 2;\n  }\n\n  indices[index++] = bottomCorner;\n  indices[index++] = bottomCorner + length;\n\n  if (!southCap) {\n    const bottomLeftCorner = width + bottomCorner - 1;\n    indices[index++] = bottomLeftCorner;\n    indices[index] = bottomLeftCorner + length;\n  }\n\n  geo.indices = indices;\n\n  return geo;\n}\n\n/**\n * A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin.\n *\n * @alias RectangleOutlineGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {number} [options.height=0.0] The distance in meters between the rectangle and the ellipsoid surface.\n * @param {number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.\n * @param {number} [options.extrudedHeight] The distance in meters between the rectangle's extruded face and the ellipsoid surface.\n *\n * @exception {DeveloperError} <code>options.rectangle.north</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].\n * @exception {DeveloperError} <code>options.rectangle.south</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].\n * @exception {DeveloperError} <code>options.rectangle.east</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].\n * @exception {DeveloperError} <code>options.rectangle.west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].\n * @exception {DeveloperError} <code>options.rectangle.north</code> must be greater than <code>rectangle.south</code>.\n *\n * @see RectangleOutlineGeometry#createGeometry\n *\n * @example\n * const rectangle = new Cesium.RectangleOutlineGeometry({\n *   ellipsoid : Cesium.Ellipsoid.WGS84,\n *   rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),\n *   height : 10000.0\n * });\n * const geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle);\n */\nfunction RectangleOutlineGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const rectangle = options.rectangle;\n  const granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  const rotation = defaultValue(options.rotation, 0.0);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(rectangle)) {\n    throw new DeveloperError(\"rectangle is required.\");\n  }\n  Rectangle.validate(rectangle);\n  if (rectangle.north < rectangle.south) {\n    throw new DeveloperError(\n      \"options.rectangle.north must be greater than options.rectangle.south\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const height = defaultValue(options.height, 0.0);\n  const extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n  this._rectangle = Rectangle.clone(rectangle);\n  this._granularity = granularity;\n  this._ellipsoid = ellipsoid;\n  this._surfaceHeight = Math.max(height, extrudedHeight);\n  this._rotation = rotation;\n  this._extrudedHeight = Math.min(height, extrudedHeight);\n  this._offsetAttribute = options.offsetAttribute;\n  this._workerName = \"createRectangleOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nRectangleOutlineGeometry.packedLength =\n  Rectangle.packedLength + Ellipsoid.packedLength + 5;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {RectangleOutlineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nRectangleOutlineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required\");\n  }\n\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  Rectangle.pack(value._rectangle, array, startingIndex);\n  startingIndex += Rectangle.packedLength;\n\n  Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  array[startingIndex++] = value._granularity;\n  array[startingIndex++] = value._surfaceHeight;\n  array[startingIndex++] = value._rotation;\n  array[startingIndex++] = value._extrudedHeight;\n  array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n  return array;\n};\n\nconst scratchRectangle = new Rectangle();\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchOptions = {\n  rectangle: scratchRectangle,\n  ellipsoid: scratchEllipsoid,\n  granularity: undefined,\n  height: undefined,\n  rotation: undefined,\n  extrudedHeight: undefined,\n  offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {RectangleOutlineGeometry} [result] The object into which to store the result.\n * @returns {RectangleOutlineGeometry} The modified result parameter or a new Quaternion instance if one was not provided.\n */\nRectangleOutlineGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const rectangle = Rectangle.unpack(array, startingIndex, scratchRectangle);\n  startingIndex += Rectangle.packedLength;\n\n  const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n  startingIndex += Ellipsoid.packedLength;\n\n  const granularity = array[startingIndex++];\n  const height = array[startingIndex++];\n  const rotation = array[startingIndex++];\n  const extrudedHeight = array[startingIndex++];\n  const offsetAttribute = array[startingIndex];\n\n  if (!defined(result)) {\n    scratchOptions.granularity = granularity;\n    scratchOptions.height = height;\n    scratchOptions.rotation = rotation;\n    scratchOptions.extrudedHeight = extrudedHeight;\n    scratchOptions.offsetAttribute =\n      offsetAttribute === -1 ? undefined : offsetAttribute;\n\n    return new RectangleOutlineGeometry(scratchOptions);\n  }\n\n  result._rectangle = Rectangle.clone(rectangle, result._rectangle);\n  result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n  result._surfaceHeight = height;\n  result._rotation = rotation;\n  result._extrudedHeight = extrudedHeight;\n  result._offsetAttribute =\n    offsetAttribute === -1 ? undefined : offsetAttribute;\n\n  return result;\n};\n\nconst nwScratch = new Cartographic();\n/**\n * Computes the geometric representation of an outline of a rectangle, including its vertices, indices, and a bounding sphere.\n *\n * @param {RectangleOutlineGeometry} rectangleGeometry A description of the rectangle outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n *\n * @exception {DeveloperError} Rotated rectangle is invalid.\n */\nRectangleOutlineGeometry.createGeometry = function (rectangleGeometry) {\n  const rectangle = rectangleGeometry._rectangle;\n  const ellipsoid = rectangleGeometry._ellipsoid;\n  const computedOptions = RectangleGeometryLibrary.computeOptions(\n    rectangle,\n    rectangleGeometry._granularity,\n    rectangleGeometry._rotation,\n    0,\n    rectangleScratch,\n    nwScratch\n  );\n\n  let geometry;\n  let boundingSphere;\n\n  if (\n    CesiumMath.equalsEpsilon(\n      rectangle.north,\n      rectangle.south,\n      CesiumMath.EPSILON10\n    ) ||\n    CesiumMath.equalsEpsilon(\n      rectangle.east,\n      rectangle.west,\n      CesiumMath.EPSILON10\n    )\n  ) {\n    return undefined;\n  }\n\n  const surfaceHeight = rectangleGeometry._surfaceHeight;\n  const extrudedHeight = rectangleGeometry._extrudedHeight;\n  const extrude = !CesiumMath.equalsEpsilon(\n    surfaceHeight,\n    extrudedHeight,\n    0,\n    CesiumMath.EPSILON2\n  );\n  let offsetValue;\n  if (extrude) {\n    geometry = constructExtrudedRectangle(rectangleGeometry, computedOptions);\n    if (defined(rectangleGeometry._offsetAttribute)) {\n      const size = geometry.attributes.position.values.length / 3;\n      let offsetAttribute = new Uint8Array(size);\n      if (rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.TOP) {\n        offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\n      } else {\n        offsetValue =\n          rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n            ? 0\n            : 1;\n        offsetAttribute = offsetAttribute.fill(offsetValue);\n      }\n\n      geometry.attributes.applyOffset = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n        componentsPerAttribute: 1,\n        values: offsetAttribute,\n      });\n    }\n    const topBS = BoundingSphere.fromRectangle3D(\n      rectangle,\n      ellipsoid,\n      surfaceHeight,\n      topBoundingSphere\n    );\n    const bottomBS = BoundingSphere.fromRectangle3D(\n      rectangle,\n      ellipsoid,\n      extrudedHeight,\n      bottomBoundingSphere\n    );\n    boundingSphere = BoundingSphere.union(topBS, bottomBS);\n  } else {\n    geometry = constructRectangle(rectangleGeometry, computedOptions);\n    geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n      geometry.attributes.position.values,\n      surfaceHeight,\n      ellipsoid,\n      false\n    );\n\n    if (defined(rectangleGeometry._offsetAttribute)) {\n      const length = geometry.attributes.position.values.length;\n      offsetValue =\n        rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n          ? 0\n          : 1;\n      const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n      geometry.attributes.applyOffset = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n        componentsPerAttribute: 1,\n        values: applyOffset,\n      });\n    }\n\n    boundingSphere = BoundingSphere.fromRectangle3D(\n      rectangle,\n      ellipsoid,\n      surfaceHeight\n    );\n  }\n\n  return new Geometry({\n    attributes: geometry.attributes,\n    indices: geometry.indices,\n    primitiveType: PrimitiveType.LINES,\n    boundingSphere: boundingSphere,\n    offsetAttribute: rectangleGeometry._offsetAttribute,\n  });\n};\nexport default RectangleOutlineGeometry;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport IntersectionTests from \"../Core/IntersectionTests.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport Plane from \"../Core/Plane.js\";\nimport Ray from \"../Core/Ray.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport RectangleOutlineGeometry from \"../Core/RectangleOutlineGeometry.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * A tile bounding volume specified as a longitude/latitude/height region.\n * @alias TileBoundingRegion\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Rectangle} options.rectangle The rectangle specifying the longitude and latitude range of the region.\n * @param {number} [options.minimumHeight=0.0] The minimum height of the region.\n * @param {number} [options.maximumHeight=0.0] The maximum height of the region.\n * @param {Ellipsoid} [options.ellipsoid=Cesium.Ellipsoid.WGS84] The ellipsoid.\n * @param {boolean} [options.computeBoundingVolumes=true] True to compute the {@link TileBoundingRegion#boundingVolume} and\n *                  {@link TileBoundingVolume#boundingSphere}. If false, these properties will be undefined.\n *\n * @private\n */\nfunction TileBoundingRegion(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options\", options);\n  Check.typeOf.object(\"options.rectangle\", options.rectangle);\n  //>>includeEnd('debug');\n\n  this.rectangle = Rectangle.clone(options.rectangle);\n  this.minimumHeight = defaultValue(options.minimumHeight, 0.0);\n  this.maximumHeight = defaultValue(options.maximumHeight, 0.0);\n\n  /**\n   * The world coordinates of the southwest corner of the tile's rectangle.\n   *\n   * @type {Cartesian3}\n   * @default Cartesian3()\n   */\n  this.southwestCornerCartesian = new Cartesian3();\n\n  /**\n   * The world coordinates of the northeast corner of the tile's rectangle.\n   *\n   * @type {Cartesian3}\n   * @default Cartesian3()\n   */\n  this.northeastCornerCartesian = new Cartesian3();\n\n  /**\n   * A normal that, along with southwestCornerCartesian, defines a plane at the western edge of\n   * the tile.  Any position above (in the direction of the normal) this plane is outside the tile.\n   *\n   * @type {Cartesian3}\n   * @default Cartesian3()\n   */\n  this.westNormal = new Cartesian3();\n\n  /**\n   * A normal that, along with southwestCornerCartesian, defines a plane at the southern edge of\n   * the tile.  Any position above (in the direction of the normal) this plane is outside the tile.\n   * Because points of constant latitude do not necessary lie in a plane, positions below this\n   * plane are not necessarily inside the tile, but they are close.\n   *\n   * @type {Cartesian3}\n   * @default Cartesian3()\n   */\n  this.southNormal = new Cartesian3();\n\n  /**\n   * A normal that, along with northeastCornerCartesian, defines a plane at the eastern edge of\n   * the tile.  Any position above (in the direction of the normal) this plane is outside the tile.\n   *\n   * @type {Cartesian3}\n   * @default Cartesian3()\n   */\n  this.eastNormal = new Cartesian3();\n\n  /**\n   * A normal that, along with northeastCornerCartesian, defines a plane at the eastern edge of\n   * the tile.  Any position above (in the direction of the normal) this plane is outside the tile.\n   * Because points of constant latitude do not necessary lie in a plane, positions below this\n   * plane are not necessarily inside the tile, but they are close.\n   *\n   * @type {Cartesian3}\n   * @default Cartesian3()\n   */\n  this.northNormal = new Cartesian3();\n\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  computeBox(this, options.rectangle, ellipsoid);\n\n  this._orientedBoundingBox = undefined;\n  this._boundingSphere = undefined;\n\n  if (defaultValue(options.computeBoundingVolumes, true)) {\n    this.computeBoundingVolumes(ellipsoid);\n  }\n}\n\nObject.defineProperties(TileBoundingRegion.prototype, {\n  /**\n   * The underlying bounding volume\n   *\n   * @memberof TileBoundingRegion.prototype\n   *\n   * @type {object}\n   * @readonly\n   */\n  boundingVolume: {\n    get: function () {\n      return this._orientedBoundingBox;\n    },\n  },\n  /**\n   * The underlying bounding sphere\n   *\n   * @memberof TileBoundingRegion.prototype\n   *\n   * @type {BoundingSphere}\n   * @readonly\n   */\n  boundingSphere: {\n    get: function () {\n      return this._boundingSphere;\n    },\n  },\n});\n\nTileBoundingRegion.prototype.computeBoundingVolumes = function (ellipsoid) {\n  // An oriented bounding box that encloses this tile's region.  This is used to calculate tile visibility.\n  this._orientedBoundingBox = OrientedBoundingBox.fromRectangle(\n    this.rectangle,\n    this.minimumHeight,\n    this.maximumHeight,\n    ellipsoid\n  );\n\n  this._boundingSphere = BoundingSphere.fromOrientedBoundingBox(\n    this._orientedBoundingBox\n  );\n};\n\nconst cartesian3Scratch = new Cartesian3();\nconst cartesian3Scratch2 = new Cartesian3();\nconst cartesian3Scratch3 = new Cartesian3();\nconst westNormalScratch = new Cartesian3();\nconst eastWestNormalScratch = new Cartesian3();\nconst westernMidpointScratch = new Cartesian3();\nconst easternMidpointScratch = new Cartesian3();\nconst cartographicScratch = new Cartographic();\nconst planeScratch = new Plane(Cartesian3.UNIT_X, 0.0);\nconst rayScratch = new Ray();\n\nfunction computeBox(tileBB, rectangle, ellipsoid) {\n  ellipsoid.cartographicToCartesian(\n    Rectangle.southwest(rectangle),\n    tileBB.southwestCornerCartesian\n  );\n  ellipsoid.cartographicToCartesian(\n    Rectangle.northeast(rectangle),\n    tileBB.northeastCornerCartesian\n  );\n\n  // The middle latitude on the western edge.\n  cartographicScratch.longitude = rectangle.west;\n  cartographicScratch.latitude = (rectangle.south + rectangle.north) * 0.5;\n  cartographicScratch.height = 0.0;\n  const westernMidpointCartesian = ellipsoid.cartographicToCartesian(\n    cartographicScratch,\n    westernMidpointScratch\n  );\n\n  // Compute the normal of the plane on the western edge of the tile.\n  const westNormal = Cartesian3.cross(\n    westernMidpointCartesian,\n    Cartesian3.UNIT_Z,\n    westNormalScratch\n  );\n  Cartesian3.normalize(westNormal, tileBB.westNormal);\n\n  // The middle latitude on the eastern edge.\n  cartographicScratch.longitude = rectangle.east;\n  const easternMidpointCartesian = ellipsoid.cartographicToCartesian(\n    cartographicScratch,\n    easternMidpointScratch\n  );\n\n  // Compute the normal of the plane on the eastern edge of the tile.\n  const eastNormal = Cartesian3.cross(\n    Cartesian3.UNIT_Z,\n    easternMidpointCartesian,\n    cartesian3Scratch\n  );\n  Cartesian3.normalize(eastNormal, tileBB.eastNormal);\n\n  let westVector = Cartesian3.subtract(\n    westernMidpointCartesian,\n    easternMidpointCartesian,\n    cartesian3Scratch\n  );\n\n  if (Cartesian3.magnitude(westVector) === 0.0) {\n    westVector = Cartesian3.clone(westNormal, westVector);\n  }\n\n  const eastWestNormal = Cartesian3.normalize(\n    westVector,\n    eastWestNormalScratch\n  );\n\n  // Compute the normal of the plane bounding the southern edge of the tile.\n  const south = rectangle.south;\n  let southSurfaceNormal;\n\n  if (south > 0.0) {\n    // Compute a plane that doesn't cut through the tile.\n    cartographicScratch.longitude = (rectangle.west + rectangle.east) * 0.5;\n    cartographicScratch.latitude = south;\n    const southCenterCartesian = ellipsoid.cartographicToCartesian(\n      cartographicScratch,\n      rayScratch.origin\n    );\n    Cartesian3.clone(eastWestNormal, rayScratch.direction);\n    const westPlane = Plane.fromPointNormal(\n      tileBB.southwestCornerCartesian,\n      tileBB.westNormal,\n      planeScratch\n    );\n    // Find a point that is on the west and the south planes\n    IntersectionTests.rayPlane(\n      rayScratch,\n      westPlane,\n      tileBB.southwestCornerCartesian\n    );\n    southSurfaceNormal = ellipsoid.geodeticSurfaceNormal(\n      southCenterCartesian,\n      cartesian3Scratch2\n    );\n  } else {\n    southSurfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic(\n      Rectangle.southeast(rectangle),\n      cartesian3Scratch2\n    );\n  }\n  const southNormal = Cartesian3.cross(\n    southSurfaceNormal,\n    westVector,\n    cartesian3Scratch3\n  );\n  Cartesian3.normalize(southNormal, tileBB.southNormal);\n\n  // Compute the normal of the plane bounding the northern edge of the tile.\n  const north = rectangle.north;\n  let northSurfaceNormal;\n\n  if (north < 0.0) {\n    // Compute a plane that doesn't cut through the tile.\n    cartographicScratch.longitude = (rectangle.west + rectangle.east) * 0.5;\n    cartographicScratch.latitude = north;\n    const northCenterCartesian = ellipsoid.cartographicToCartesian(\n      cartographicScratch,\n      rayScratch.origin\n    );\n    Cartesian3.negate(eastWestNormal, rayScratch.direction);\n    const eastPlane = Plane.fromPointNormal(\n      tileBB.northeastCornerCartesian,\n      tileBB.eastNormal,\n      planeScratch\n    );\n    // Find a point that is on the east and the north planes\n    IntersectionTests.rayPlane(\n      rayScratch,\n      eastPlane,\n      tileBB.northeastCornerCartesian\n    );\n    northSurfaceNormal = ellipsoid.geodeticSurfaceNormal(\n      northCenterCartesian,\n      cartesian3Scratch2\n    );\n  } else {\n    northSurfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic(\n      Rectangle.northwest(rectangle),\n      cartesian3Scratch2\n    );\n  }\n  const northNormal = Cartesian3.cross(\n    westVector,\n    northSurfaceNormal,\n    cartesian3Scratch3\n  );\n  Cartesian3.normalize(northNormal, tileBB.northNormal);\n}\n\nconst southwestCornerScratch = new Cartesian3();\nconst northeastCornerScratch = new Cartesian3();\nconst negativeUnitY = new Cartesian3(0.0, -1.0, 0.0);\nconst negativeUnitZ = new Cartesian3(0.0, 0.0, -1.0);\nconst vectorScratch = new Cartesian3();\n\nfunction distanceToCameraRegion(tileBB, frameState) {\n  const camera = frameState.camera;\n  const cameraCartesianPosition = camera.positionWC;\n  const cameraCartographicPosition = camera.positionCartographic;\n\n  let result = 0.0;\n  if (!Rectangle.contains(tileBB.rectangle, cameraCartographicPosition)) {\n    let southwestCornerCartesian = tileBB.southwestCornerCartesian;\n    let northeastCornerCartesian = tileBB.northeastCornerCartesian;\n    let westNormal = tileBB.westNormal;\n    let southNormal = tileBB.southNormal;\n    let eastNormal = tileBB.eastNormal;\n    let northNormal = tileBB.northNormal;\n\n    if (frameState.mode !== SceneMode.SCENE3D) {\n      southwestCornerCartesian = frameState.mapProjection.project(\n        Rectangle.southwest(tileBB.rectangle),\n        southwestCornerScratch\n      );\n      southwestCornerCartesian.z = southwestCornerCartesian.y;\n      southwestCornerCartesian.y = southwestCornerCartesian.x;\n      southwestCornerCartesian.x = 0.0;\n      northeastCornerCartesian = frameState.mapProjection.project(\n        Rectangle.northeast(tileBB.rectangle),\n        northeastCornerScratch\n      );\n      northeastCornerCartesian.z = northeastCornerCartesian.y;\n      northeastCornerCartesian.y = northeastCornerCartesian.x;\n      northeastCornerCartesian.x = 0.0;\n      westNormal = negativeUnitY;\n      eastNormal = Cartesian3.UNIT_Y;\n      southNormal = negativeUnitZ;\n      northNormal = Cartesian3.UNIT_Z;\n    }\n\n    const vectorFromSouthwestCorner = Cartesian3.subtract(\n      cameraCartesianPosition,\n      southwestCornerCartesian,\n      vectorScratch\n    );\n    const distanceToWestPlane = Cartesian3.dot(\n      vectorFromSouthwestCorner,\n      westNormal\n    );\n    const distanceToSouthPlane = Cartesian3.dot(\n      vectorFromSouthwestCorner,\n      southNormal\n    );\n\n    const vectorFromNortheastCorner = Cartesian3.subtract(\n      cameraCartesianPosition,\n      northeastCornerCartesian,\n      vectorScratch\n    );\n    const distanceToEastPlane = Cartesian3.dot(\n      vectorFromNortheastCorner,\n      eastNormal\n    );\n    const distanceToNorthPlane = Cartesian3.dot(\n      vectorFromNortheastCorner,\n      northNormal\n    );\n\n    if (distanceToWestPlane > 0.0) {\n      result += distanceToWestPlane * distanceToWestPlane;\n    } else if (distanceToEastPlane > 0.0) {\n      result += distanceToEastPlane * distanceToEastPlane;\n    }\n\n    if (distanceToSouthPlane > 0.0) {\n      result += distanceToSouthPlane * distanceToSouthPlane;\n    } else if (distanceToNorthPlane > 0.0) {\n      result += distanceToNorthPlane * distanceToNorthPlane;\n    }\n  }\n\n  let cameraHeight;\n  let minimumHeight;\n  let maximumHeight;\n  if (frameState.mode === SceneMode.SCENE3D) {\n    cameraHeight = cameraCartographicPosition.height;\n    minimumHeight = tileBB.minimumHeight;\n    maximumHeight = tileBB.maximumHeight;\n  } else {\n    cameraHeight = cameraCartesianPosition.x;\n    minimumHeight = 0.0;\n    maximumHeight = 0.0;\n  }\n\n  if (cameraHeight > maximumHeight) {\n    const distanceAboveTop = cameraHeight - maximumHeight;\n    result += distanceAboveTop * distanceAboveTop;\n  } else if (cameraHeight < minimumHeight) {\n    const distanceBelowBottom = minimumHeight - cameraHeight;\n    result += distanceBelowBottom * distanceBelowBottom;\n  }\n\n  return Math.sqrt(result);\n}\n\n/**\n * Gets the distance from the camera to the closest point on the tile.  This is used for level of detail selection.\n *\n * @param {FrameState} frameState The state information of the current rendering frame.\n * @returns {number} The distance from the camera to the closest point on the tile, in meters.\n */\nTileBoundingRegion.prototype.distanceToCamera = function (frameState) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"frameState\", frameState);\n  //>>includeEnd('debug');\n\n  const regionResult = distanceToCameraRegion(this, frameState);\n  if (\n    frameState.mode === SceneMode.SCENE3D &&\n    defined(this._orientedBoundingBox)\n  ) {\n    const obbResult = Math.sqrt(\n      this._orientedBoundingBox.distanceSquaredTo(frameState.camera.positionWC)\n    );\n    return Math.max(regionResult, obbResult);\n  }\n  return regionResult;\n};\n\n/**\n * Determines which side of a plane this box is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\n *                      the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\n *                      on the opposite side, and {@link Intersect.INTERSECTING} if the box\n *                      intersects the plane.\n */\nTileBoundingRegion.prototype.intersectPlane = function (plane) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"plane\", plane);\n  //>>includeEnd('debug');\n  return this._orientedBoundingBox.intersectPlane(plane);\n};\n\n/**\n * Creates a debug primitive that shows the outline of the tile bounding region.\n *\n * @param {Color} color The desired color of the primitive's mesh\n * @return {Primitive}\n *\n * @private\n */\nTileBoundingRegion.prototype.createDebugVolume = function (color) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"color\", color);\n  //>>includeEnd('debug');\n\n  const modelMatrix = new Matrix4.clone(Matrix4.IDENTITY);\n  const geometry = new RectangleOutlineGeometry({\n    rectangle: this.rectangle,\n    height: this.minimumHeight,\n    extrudedHeight: this.maximumHeight,\n  });\n  const instance = new GeometryInstance({\n    geometry: geometry,\n    id: \"outline\",\n    modelMatrix: modelMatrix,\n    attributes: {\n      color: ColorGeometryInstanceAttribute.fromColor(color),\n    },\n  });\n\n  return new Primitive({\n    geometryInstances: instance,\n    appearance: new PerInstanceColorAppearance({\n      translucent: false,\n      flat: true,\n    }),\n    asynchronous: false,\n  });\n};\nexport default TileBoundingRegion;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport OrientedBoundingBox from \"./OrientedBoundingBox.js\";\n\n/**\n * @private\n */\nconst CoplanarPolygonGeometryLibrary = {};\n\nconst scratchIntersectionPoint = new Cartesian3();\nconst scratchXAxis = new Cartesian3();\nconst scratchYAxis = new Cartesian3();\nconst scratchZAxis = new Cartesian3();\nconst obbScratch = new OrientedBoundingBox();\n\nCoplanarPolygonGeometryLibrary.validOutline = function (positions) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"positions\", positions);\n  //>>includeEnd('debug');\n\n  const orientedBoundingBox = OrientedBoundingBox.fromPoints(\n    positions,\n    obbScratch\n  );\n  const halfAxes = orientedBoundingBox.halfAxes;\n  const xAxis = Matrix3.getColumn(halfAxes, 0, scratchXAxis);\n  const yAxis = Matrix3.getColumn(halfAxes, 1, scratchYAxis);\n  const zAxis = Matrix3.getColumn(halfAxes, 2, scratchZAxis);\n\n  const xMag = Cartesian3.magnitude(xAxis);\n  const yMag = Cartesian3.magnitude(yAxis);\n  const zMag = Cartesian3.magnitude(zAxis);\n\n  // If all the points are on a line return undefined because we can't draw a polygon\n  return !(\n    (xMag === 0 && (yMag === 0 || zMag === 0)) ||\n    (yMag === 0 && zMag === 0)\n  );\n};\n\n// call after removeDuplicates\nCoplanarPolygonGeometryLibrary.computeProjectTo2DArguments = function (\n  positions,\n  centerResult,\n  planeAxis1Result,\n  planeAxis2Result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"positions\", positions);\n  Check.defined(\"centerResult\", centerResult);\n  Check.defined(\"planeAxis1Result\", planeAxis1Result);\n  Check.defined(\"planeAxis2Result\", planeAxis2Result);\n  //>>includeEnd('debug');\n\n  const orientedBoundingBox = OrientedBoundingBox.fromPoints(\n    positions,\n    obbScratch\n  );\n  const halfAxes = orientedBoundingBox.halfAxes;\n  const xAxis = Matrix3.getColumn(halfAxes, 0, scratchXAxis);\n  const yAxis = Matrix3.getColumn(halfAxes, 1, scratchYAxis);\n  const zAxis = Matrix3.getColumn(halfAxes, 2, scratchZAxis);\n\n  const xMag = Cartesian3.magnitude(xAxis);\n  const yMag = Cartesian3.magnitude(yAxis);\n  const zMag = Cartesian3.magnitude(zAxis);\n  const min = Math.min(xMag, yMag, zMag);\n\n  // If all the points are on a line return undefined because we can't draw a polygon\n  if (\n    (xMag === 0 && (yMag === 0 || zMag === 0)) ||\n    (yMag === 0 && zMag === 0)\n  ) {\n    return false;\n  }\n\n  let planeAxis1;\n  let planeAxis2;\n\n  if (min === yMag || min === zMag) {\n    planeAxis1 = xAxis;\n  }\n  if (min === xMag) {\n    planeAxis1 = yAxis;\n  } else if (min === zMag) {\n    planeAxis2 = yAxis;\n  }\n  if (min === xMag || min === yMag) {\n    planeAxis2 = zAxis;\n  }\n\n  Cartesian3.normalize(planeAxis1, planeAxis1Result);\n  Cartesian3.normalize(planeAxis2, planeAxis2Result);\n  Cartesian3.clone(orientedBoundingBox.center, centerResult);\n  return true;\n};\n\nfunction projectTo2D(position, center, axis1, axis2, result) {\n  const v = Cartesian3.subtract(position, center, scratchIntersectionPoint);\n  const x = Cartesian3.dot(axis1, v);\n  const y = Cartesian3.dot(axis2, v);\n\n  return Cartesian2.fromElements(x, y, result);\n}\n\nCoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction = function (\n  center,\n  axis1,\n  axis2\n) {\n  return function (positions) {\n    const positionResults = new Array(positions.length);\n    for (let i = 0; i < positions.length; i++) {\n      positionResults[i] = projectTo2D(positions[i], center, axis1, axis2);\n    }\n\n    return positionResults;\n  };\n};\n\nCoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction = function (\n  center,\n  axis1,\n  axis2\n) {\n  return function (position, result) {\n    return projectTo2D(position, center, axis1, axis2, result);\n  };\n};\nexport default CoplanarPolygonGeometryLibrary;\n", "/**\n * A queue that can enqueue items at the end, and dequeue items from the front.\n *\n * @alias Queue\n * @constructor\n */\nfunction Queue() {\n  this._array = [];\n  this._offset = 0;\n  this._length = 0;\n}\n\nObject.defineProperties(Queue.prototype, {\n  /**\n   * The length of the queue.\n   *\n   * @memberof Queue.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  length: {\n    get: function () {\n      return this._length;\n    },\n  },\n});\n\n/**\n * Enqueues the specified item.\n *\n * @param {*} item The item to enqueue.\n */\nQueue.prototype.enqueue = function (item) {\n  this._array.push(item);\n  this._length++;\n};\n\n/**\n * Dequeues an item.  Returns undefined if the queue is empty.\n *\n * @returns {*} The the dequeued item.\n */\nQueue.prototype.dequeue = function () {\n  if (this._length === 0) {\n    return undefined;\n  }\n\n  const array = this._array;\n  let offset = this._offset;\n  const item = array[offset];\n  array[offset] = undefined;\n\n  offset++;\n  if (offset > 10 && offset * 2 > array.length) {\n    //compact array\n    this._array = array.slice(offset);\n    offset = 0;\n  }\n\n  this._offset = offset;\n  this._length--;\n\n  return item;\n};\n\n/**\n * Returns the item at the front of the queue.  Returns undefined if the queue is empty.\n *\n * @returns {*} The item at the front of the queue.\n */\nQueue.prototype.peek = function () {\n  if (this._length === 0) {\n    return undefined;\n  }\n\n  return this._array[this._offset];\n};\n\n/**\n * Check whether this queue contains the specified item.\n *\n * @param {*} item The item to search for.\n */\nQueue.prototype.contains = function (item) {\n  return this._array.indexOf(item) !== -1;\n};\n\n/**\n * Remove all items from the queue.\n */\nQueue.prototype.clear = function () {\n  this._array.length = this._offset = this._length = 0;\n};\n\n/**\n * Sort the items in the queue in-place.\n *\n * @param {Queue.Comparator} compareFunction A function that defines the sort order.\n */\nQueue.prototype.sort = function (compareFunction) {\n  if (this._offset > 0) {\n    //compact array\n    this._array = this._array.slice(this._offset);\n    this._offset = 0;\n  }\n\n  this._array.sort(compareFunction);\n};\n\n/**\n * A function used to compare two items while sorting a queue.\n * @callback Queue.Comparator\n *\n * @param {*} a An item in the array.\n * @param {*} b An item in the array.\n * @returns {number} Returns a negative value if <code>a</code> is less than <code>b</code>,\n *          a positive value if <code>a</code> is greater than <code>b</code>, or\n *          0 if <code>a</code> is equal to <code>b</code>.\n *\n * @example\n * function compareNumbers(a, b) {\n *     return a - b;\n * }\n */\nexport default Queue;\n", "import ArcType from \"./ArcType.js\";\nimport arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidRhumbLine from \"./EllipsoidRhumbLine.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport IntersectionTests from \"./IntersectionTests.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Plane from \"./Plane.js\";\nimport PolygonHierarchy from \"./PolygonHierarchy.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Queue from \"./Queue.js\";\nimport WindingOrder from \"./WindingOrder.js\";\n\n/**\n * @private\n */\nconst PolygonGeometryLibrary = {};\n\nPolygonGeometryLibrary.computeHierarchyPackedLength = function (\n  polygonHierarchy,\n  CartesianX\n) {\n  let numComponents = 0;\n  const stack = [polygonHierarchy];\n  while (stack.length > 0) {\n    const hierarchy = stack.pop();\n    if (!defined(hierarchy)) {\n      continue;\n    }\n\n    numComponents += 2;\n\n    const positions = hierarchy.positions;\n    const holes = hierarchy.holes;\n\n    if (defined(positions) && positions.length > 0) {\n      numComponents += positions.length * CartesianX.packedLength;\n    }\n\n    if (defined(holes)) {\n      const length = holes.length;\n      for (let i = 0; i < length; ++i) {\n        stack.push(holes[i]);\n      }\n    }\n  }\n\n  return numComponents;\n};\n\nPolygonGeometryLibrary.packPolygonHierarchy = function (\n  polygonHierarchy,\n  array,\n  startingIndex,\n  CartesianX\n) {\n  const stack = [polygonHierarchy];\n  while (stack.length > 0) {\n    const hierarchy = stack.pop();\n    if (!defined(hierarchy)) {\n      continue;\n    }\n\n    const positions = hierarchy.positions;\n    const holes = hierarchy.holes;\n\n    array[startingIndex++] = defined(positions) ? positions.length : 0;\n    array[startingIndex++] = defined(holes) ? holes.length : 0;\n\n    if (defined(positions)) {\n      const positionsLength = positions.length;\n      for (\n        let i = 0;\n        i < positionsLength;\n        ++i, startingIndex += CartesianX.packedLength\n      ) {\n        CartesianX.pack(positions[i], array, startingIndex);\n      }\n    }\n\n    if (defined(holes)) {\n      const holesLength = holes.length;\n      for (let j = 0; j < holesLength; ++j) {\n        stack.push(holes[j]);\n      }\n    }\n  }\n\n  return startingIndex;\n};\n\nPolygonGeometryLibrary.unpackPolygonHierarchy = function (\n  array,\n  startingIndex,\n  CartesianX\n) {\n  const positionsLength = array[startingIndex++];\n  const holesLength = array[startingIndex++];\n\n  const positions = new Array(positionsLength);\n  const holes = holesLength > 0 ? new Array(holesLength) : undefined;\n\n  for (\n    let i = 0;\n    i < positionsLength;\n    ++i, startingIndex += CartesianX.packedLength\n  ) {\n    positions[i] = CartesianX.unpack(array, startingIndex);\n  }\n\n  for (let j = 0; j < holesLength; ++j) {\n    holes[j] = PolygonGeometryLibrary.unpackPolygonHierarchy(\n      array,\n      startingIndex,\n      CartesianX\n    );\n    startingIndex = holes[j].startingIndex;\n    delete holes[j].startingIndex;\n  }\n\n  return {\n    positions: positions,\n    holes: holes,\n    startingIndex: startingIndex,\n  };\n};\n\nconst distance2DScratch = new Cartesian2();\nfunction getPointAtDistance2D(p0, p1, distance, length) {\n  Cartesian2.subtract(p1, p0, distance2DScratch);\n  Cartesian2.multiplyByScalar(\n    distance2DScratch,\n    distance / length,\n    distance2DScratch\n  );\n  Cartesian2.add(p0, distance2DScratch, distance2DScratch);\n  return [distance2DScratch.x, distance2DScratch.y];\n}\n\nconst distanceScratch = new Cartesian3();\nfunction getPointAtDistance(p0, p1, distance, length) {\n  Cartesian3.subtract(p1, p0, distanceScratch);\n  Cartesian3.multiplyByScalar(\n    distanceScratch,\n    distance / length,\n    distanceScratch\n  );\n  Cartesian3.add(p0, distanceScratch, distanceScratch);\n  return [distanceScratch.x, distanceScratch.y, distanceScratch.z];\n}\n\nPolygonGeometryLibrary.subdivideLineCount = function (p0, p1, minDistance) {\n  const distance = Cartesian3.distance(p0, p1);\n  const n = distance / minDistance;\n  const countDivide = Math.max(0, Math.ceil(CesiumMath.log2(n)));\n  return Math.pow(2, countDivide);\n};\n\nconst scratchCartographic0 = new Cartographic();\nconst scratchCartographic1 = new Cartographic();\nconst scratchCartographic2 = new Cartographic();\nconst scratchCartesian0 = new Cartesian3();\nconst scratchRhumbLine = new EllipsoidRhumbLine();\nPolygonGeometryLibrary.subdivideRhumbLineCount = function (\n  ellipsoid,\n  p0,\n  p1,\n  minDistance\n) {\n  const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);\n  const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);\n  const rhumb = new EllipsoidRhumbLine(c0, c1, ellipsoid);\n  const n = rhumb.surfaceDistance / minDistance;\n  const countDivide = Math.max(0, Math.ceil(CesiumMath.log2(n)));\n  return Math.pow(2, countDivide);\n};\n\n/**\n * Subdivides texture coordinates based on the subdivision of the associated world positions.\n *\n * @param {Cartesian2} t0 First texture coordinate.\n * @param {Cartesian2} t1 Second texture coordinate.\n * @param {Cartesian3} p0 First world position.\n * @param {Cartesian3} p1 Second world position.\n * @param {number} minDistance Minimum distance for a segment.\n * @param {Cartesian2[]} result The subdivided texture coordinates.\n *\n * @private\n */\nPolygonGeometryLibrary.subdivideTexcoordLine = function (\n  t0,\n  t1,\n  p0,\n  p1,\n  minDistance,\n  result\n) {\n  // Compute the number of subdivisions.\n  const subdivisions = PolygonGeometryLibrary.subdivideLineCount(\n    p0,\n    p1,\n    minDistance\n  );\n\n  // Compute the distance between each subdivided point.\n  const length2D = Cartesian2.distance(t0, t1);\n  const distanceBetweenCoords = length2D / subdivisions;\n\n  // Resize the result array.\n  const texcoords = result;\n  texcoords.length = subdivisions * 2;\n\n  // Compute texture coordinates using linear interpolation.\n  let index = 0;\n  for (let i = 0; i < subdivisions; i++) {\n    const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);\n    texcoords[index++] = t[0];\n    texcoords[index++] = t[1];\n  }\n\n  return texcoords;\n};\n\nPolygonGeometryLibrary.subdivideLine = function (p0, p1, minDistance, result) {\n  const numVertices = PolygonGeometryLibrary.subdivideLineCount(\n    p0,\n    p1,\n    minDistance\n  );\n  const length = Cartesian3.distance(p0, p1);\n  const distanceBetweenVertices = length / numVertices;\n\n  if (!defined(result)) {\n    result = [];\n  }\n\n  const positions = result;\n  positions.length = numVertices * 3;\n\n  let index = 0;\n  for (let i = 0; i < numVertices; i++) {\n    const p = getPointAtDistance(p0, p1, i * distanceBetweenVertices, length);\n    positions[index++] = p[0];\n    positions[index++] = p[1];\n    positions[index++] = p[2];\n  }\n\n  return positions;\n};\n\n/**\n * Subdivides texture coordinates based on the subdivision of the associated world positions using a rhumb line.\n *\n * @param {Cartesian2} t0 First texture coordinate.\n * @param {Cartesian2} t1 Second texture coordinate.\n * @param {Ellipsoid} ellipsoid The ellipsoid.\n * @param {Cartesian3} p0 First world position.\n * @param {Cartesian3} p1 Second world position.\n * @param {number} minDistance Minimum distance for a segment.\n * @param {Cartesian2[]} result The subdivided texture coordinates.\n *\n * @private\n */\nPolygonGeometryLibrary.subdivideTexcoordRhumbLine = function (\n  t0,\n  t1,\n  ellipsoid,\n  p0,\n  p1,\n  minDistance,\n  result\n) {\n  // Compute the surface distance.\n  const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);\n  const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);\n  scratchRhumbLine.setEndPoints(c0, c1);\n  const n = scratchRhumbLine.surfaceDistance / minDistance;\n\n  // Compute the number of subdivisions.\n  const countDivide = Math.max(0, Math.ceil(CesiumMath.log2(n)));\n  const subdivisions = Math.pow(2, countDivide);\n\n  // Compute the distance between each subdivided point.\n  const length2D = Cartesian2.distance(t0, t1);\n  const distanceBetweenCoords = length2D / subdivisions;\n\n  // Resize the result array.\n  const texcoords = result;\n  texcoords.length = subdivisions * 2;\n\n  // Compute texture coordinates using linear interpolation.\n  let index = 0;\n  for (let i = 0; i < subdivisions; i++) {\n    const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);\n    texcoords[index++] = t[0];\n    texcoords[index++] = t[1];\n  }\n\n  return texcoords;\n};\n\nPolygonGeometryLibrary.subdivideRhumbLine = function (\n  ellipsoid,\n  p0,\n  p1,\n  minDistance,\n  result\n) {\n  const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);\n  const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);\n  const rhumb = new EllipsoidRhumbLine(c0, c1, ellipsoid);\n\n  const n = rhumb.surfaceDistance / minDistance;\n  const countDivide = Math.max(0, Math.ceil(CesiumMath.log2(n)));\n  const numVertices = Math.pow(2, countDivide);\n  const distanceBetweenVertices = rhumb.surfaceDistance / numVertices;\n\n  if (!defined(result)) {\n    result = [];\n  }\n\n  const positions = result;\n  positions.length = numVertices * 3;\n\n  let index = 0;\n  for (let i = 0; i < numVertices; i++) {\n    const c = rhumb.interpolateUsingSurfaceDistance(\n      i * distanceBetweenVertices,\n      scratchCartographic2\n    );\n    const p = ellipsoid.cartographicToCartesian(c, scratchCartesian0);\n    positions[index++] = p.x;\n    positions[index++] = p.y;\n    positions[index++] = p.z;\n  }\n\n  return positions;\n};\n\nconst scaleToGeodeticHeightN1 = new Cartesian3();\nconst scaleToGeodeticHeightN2 = new Cartesian3();\nconst scaleToGeodeticHeightP1 = new Cartesian3();\nconst scaleToGeodeticHeightP2 = new Cartesian3();\n\nPolygonGeometryLibrary.scaleToGeodeticHeightExtruded = function (\n  geometry,\n  maxHeight,\n  minHeight,\n  ellipsoid,\n  perPositionHeight\n) {\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n  const n1 = scaleToGeodeticHeightN1;\n  let n2 = scaleToGeodeticHeightN2;\n  const p = scaleToGeodeticHeightP1;\n  let p2 = scaleToGeodeticHeightP2;\n\n  if (\n    defined(geometry) &&\n    defined(geometry.attributes) &&\n    defined(geometry.attributes.position)\n  ) {\n    const positions = geometry.attributes.position.values;\n    const length = positions.length / 2;\n\n    for (let i = 0; i < length; i += 3) {\n      Cartesian3.fromArray(positions, i, p);\n\n      ellipsoid.geodeticSurfaceNormal(p, n1);\n      p2 = ellipsoid.scaleToGeodeticSurface(p, p2);\n      n2 = Cartesian3.multiplyByScalar(n1, minHeight, n2);\n      n2 = Cartesian3.add(p2, n2, n2);\n      positions[i + length] = n2.x;\n      positions[i + 1 + length] = n2.y;\n      positions[i + 2 + length] = n2.z;\n\n      if (perPositionHeight) {\n        p2 = Cartesian3.clone(p, p2);\n      }\n      n2 = Cartesian3.multiplyByScalar(n1, maxHeight, n2);\n      n2 = Cartesian3.add(p2, n2, n2);\n      positions[i] = n2.x;\n      positions[i + 1] = n2.y;\n      positions[i + 2] = n2.z;\n    }\n  }\n  return geometry;\n};\n\nPolygonGeometryLibrary.polygonOutlinesFromHierarchy = function (\n  polygonHierarchy,\n  scaleToEllipsoidSurface,\n  ellipsoid\n) {\n  // create from a polygon hierarchy\n  // Algorithm adapted from http://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf\n  const polygons = [];\n  const queue = new Queue();\n  queue.enqueue(polygonHierarchy);\n  let i;\n  let j;\n  let length;\n  while (queue.length !== 0) {\n    const outerNode = queue.dequeue();\n    let outerRing = outerNode.positions;\n    if (scaleToEllipsoidSurface) {\n      length = outerRing.length;\n      for (i = 0; i < length; i++) {\n        ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);\n      }\n    }\n    outerRing = arrayRemoveDuplicates(\n      outerRing,\n      Cartesian3.equalsEpsilon,\n      true\n    );\n    if (outerRing.length < 3) {\n      continue;\n    }\n\n    const numChildren = outerNode.holes ? outerNode.holes.length : 0;\n    // The outer polygon contains inner polygons\n    for (i = 0; i < numChildren; i++) {\n      const hole = outerNode.holes[i];\n      let holePositions = hole.positions;\n      if (scaleToEllipsoidSurface) {\n        length = holePositions.length;\n        for (j = 0; j < length; ++j) {\n          ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);\n        }\n      }\n      holePositions = arrayRemoveDuplicates(\n        holePositions,\n        Cartesian3.equalsEpsilon,\n        true\n      );\n      if (holePositions.length < 3) {\n        continue;\n      }\n      polygons.push(holePositions);\n\n      let numGrandchildren = 0;\n      if (defined(hole.holes)) {\n        numGrandchildren = hole.holes.length;\n      }\n\n      for (j = 0; j < numGrandchildren; j++) {\n        queue.enqueue(hole.holes[j]);\n      }\n    }\n\n    polygons.push(outerRing);\n  }\n\n  return polygons;\n};\n\nconst scratchRhumbIntersection = new Cartographic();\nfunction computeEquatorIntersectionRhumb(start, end, ellipsoid) {\n  const c0 = ellipsoid.cartesianToCartographic(start, scratchCartographic0);\n  const c1 = ellipsoid.cartesianToCartographic(end, scratchCartographic1);\n\n  if (Math.sign(c0.latitude) === Math.sign(c1.latitude)) {\n    return;\n  }\n\n  scratchRhumbLine.setEndPoints(c0, c1);\n\n  const intersection = scratchRhumbLine.findIntersectionWithLatitude(\n    0,\n    scratchRhumbIntersection\n  );\n\n  if (!defined(intersection)) {\n    return;\n  }\n\n  let minLongitude = Math.min(c0.longitude, c1.longitude);\n  let maxLongitude = Math.max(c0.longitude, c1.longitude);\n\n  if (Math.abs(maxLongitude - minLongitude) > CesiumMath.PI) {\n    // Crosses IDL, flip min and max\n    const swap = minLongitude;\n    minLongitude = maxLongitude;\n    maxLongitude = swap;\n  }\n\n  if (\n    intersection.longitude < minLongitude ||\n    intersection.longitude > maxLongitude\n  ) {\n    return;\n  }\n\n  return ellipsoid.cartographicToCartesian(intersection);\n}\n\nfunction computeEquatorIntersection(start, end, ellipsoid, arcType) {\n  if (arcType === ArcType.RHUMB) {\n    return computeEquatorIntersectionRhumb(start, end, ellipsoid);\n  }\n\n  const intersection = IntersectionTests.lineSegmentPlane(\n    start,\n    end,\n    Plane.ORIGIN_XY_PLANE\n  );\n\n  if (!defined(intersection)) {\n    return;\n  }\n\n  return ellipsoid.scaleToGeodeticSurface(intersection, intersection);\n}\n\nconst scratchCartographic = new Cartographic();\nfunction computeEdgesOnPlane(positions, ellipsoid, arcType) {\n  const edgesOnPlane = [];\n  let startPoint,\n    endPoint,\n    type,\n    next,\n    intersection,\n    i = 0;\n  while (i < positions.length) {\n    startPoint = positions[i];\n    endPoint = positions[(i + 1) % positions.length];\n\n    type = CesiumMath.sign(startPoint.z);\n    next = CesiumMath.sign(endPoint.z);\n\n    const getLongitude = (position) => {\n      const cartographic = ellipsoid.cartesianToCartographic(\n        position,\n        scratchCartographic\n      );\n      return cartographic.longitude;\n    };\n\n    if (type === 0) {\n      // The start position is on the split\n      edgesOnPlane.push({\n        position: i,\n        type: type,\n        visited: false,\n        next: next,\n        theta: getLongitude(startPoint),\n      });\n    } else if (next !== 0) {\n      intersection = computeEquatorIntersection(\n        startPoint,\n        endPoint,\n        ellipsoid,\n        arcType\n      );\n\n      ++i;\n      if (!defined(intersection)) {\n        // The line segment is entirely above or below\n        continue;\n      }\n\n      // The line segment passed through\n      positions.splice(i, 0, intersection);\n      edgesOnPlane.push({\n        position: i,\n        type: type,\n        visited: false,\n        next: next,\n        theta: getLongitude(intersection),\n      });\n    }\n\n    ++i;\n  }\n\n  return edgesOnPlane;\n}\n\nfunction wirePolygon(\n  polygons,\n  polygonIndex,\n  positions,\n  edgesOnPlane,\n  toDelete,\n  startIndex,\n  abovePlane\n) {\n  const polygon = [];\n  let i = startIndex;\n  const getMatchingEdge = (i) => (edge) => edge.position === i;\n  const polygonsToWire = [];\n  do {\n    const position = positions[i];\n    polygon.push(position);\n\n    const edgeIndex = edgesOnPlane.findIndex(getMatchingEdge(i));\n    const edge = edgesOnPlane[edgeIndex];\n    if (!defined(edge)) {\n      // The current segment does not intersect\n      ++i;\n      continue;\n    }\n\n    const { visited: hasBeenVisited, type, next } = edge;\n    edge.visited = true;\n\n    if (type === 0) {\n      if (next === 0) {\n        // Special case where we'll need to backtrack along the edge\n        const previousEdge = edgesOnPlane[edgeIndex - (abovePlane ? 1 : -1)];\n        if (previousEdge?.position === i + 1) {\n          previousEdge.visited = true;\n        } else {\n          ++i;\n          continue;\n        }\n      }\n\n      // Special case where 3 polygons meet\n      if (\n        (!hasBeenVisited && abovePlane && next > 0) ||\n        (startIndex === i && !abovePlane && next < 0)\n      ) {\n        ++i;\n        continue;\n      }\n    }\n\n    const followEdge = abovePlane ? type >= 0 : type <= 0;\n    if (!followEdge) {\n      ++i;\n      continue;\n    }\n\n    if (!hasBeenVisited) {\n      // Wire another polygon starting at this position on the other side of the edge\n      polygonsToWire.push(i);\n    }\n\n    // Continue counter-clockwise to the next edge\n    const nextEdgeIndex = edgeIndex + (abovePlane ? 1 : -1);\n    const nextEdge = edgesOnPlane[nextEdgeIndex];\n    if (!defined(nextEdge)) {\n      ++i;\n      continue;\n    }\n\n    i = nextEdge.position;\n  } while (\n    i < positions.length &&\n    i >= 0 &&\n    i !== startIndex &&\n    polygon.length < positions.length\n  );\n\n  polygons.splice(polygonIndex, toDelete, polygon);\n\n  for (const index of polygonsToWire) {\n    polygonIndex = wirePolygon(\n      polygons,\n      ++polygonIndex,\n      positions,\n      edgesOnPlane,\n      0,\n      index,\n      !abovePlane\n    );\n  }\n\n  return polygonIndex;\n}\n\n/**\n * Splits an array of polygons, defined as a list of Cartesian3 positions in counter-clockwise winding order, along the equator.\n *\n * @param {Array<Cartesian3[]>} outerRings An array of polygons, defined as a list of Cartesian3 positions in counter-clockwise winding order.\n * @param {Ellipsoid} ellipsoid The ellipsoid to be used as a reference.\n * @param {ArcType} arcType The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\n * @param {Array<Cartesian3[]>} [result] An array of split polygons.\n *\n * @returns {Array<Cartesian3[]>} An array of split polygons.\n */\nPolygonGeometryLibrary.splitPolygonsOnEquator = function (\n  outerRings,\n  ellipsoid,\n  arcType,\n  result\n) {\n  if (!defined(result)) {\n    result = [];\n  }\n\n  result.splice(0, 0, ...outerRings);\n  result.length = outerRings.length;\n\n  let currentPolygon = 0;\n  while (currentPolygon < result.length) {\n    // Adapted from https://www.sciencedirect.com/science/article/abs/pii/B9780125434577500589#:~:text=If%20the%20plane%20intersects%20the,tree%20and%20polygon%20intersection%20libraries\n    const outerRing = result[currentPolygon];\n    const positions = outerRing.slice();\n\n    if (outerRing.length < 3) {\n      result[currentPolygon] = positions;\n      ++currentPolygon;\n      continue;\n    }\n\n    // Step 1: Get all edges which intersect the split line, splciing any found intersections points into the list of positions\n    const edgesOnPlane = computeEdgesOnPlane(positions, ellipsoid, arcType);\n    // If nothing intersected (no point were added), or there is only a single point on the plane, use the original polygon\n    if (positions.length === outerRing.length || edgesOnPlane.length <= 1) {\n      result[currentPolygon] = positions;\n      ++currentPolygon;\n      continue;\n    }\n\n    // Step 2: Sort the edges along the split line by the distance between their starting points and the starting point of the split line.\n    edgesOnPlane.sort((a, b) => {\n      return a.theta - b.theta;\n    });\n\n    // Step 3: Rewire polygons, splicing each polygon into the array of results\n    const north = positions[0].z >= 0.0;\n    currentPolygon = wirePolygon(\n      result,\n      currentPolygon,\n      positions,\n      edgesOnPlane,\n      1,\n      0,\n      north\n    );\n  }\n\n  return result;\n};\n\nPolygonGeometryLibrary.polygonsFromHierarchy = function (\n  polygonHierarchy,\n  keepDuplicates,\n  projectPointsTo2D,\n  scaleToEllipsoidSurface,\n  ellipsoid,\n  splitPolygons\n) {\n  // create from a polygon hierarchy\n  // Algorithm adapted from http://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf\n  const hierarchy = [];\n  const polygons = [];\n\n  const queue = new Queue();\n  queue.enqueue(polygonHierarchy);\n\n  let split = defined(splitPolygons);\n\n  while (queue.length !== 0) {\n    const outerNode = queue.dequeue();\n    let outerRing = outerNode.positions;\n    const holes = outerNode.holes;\n\n    let i;\n    let length;\n    if (scaleToEllipsoidSurface) {\n      length = outerRing.length;\n      for (i = 0; i < length; i++) {\n        ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);\n      }\n    }\n\n    if (!keepDuplicates) {\n      outerRing = arrayRemoveDuplicates(\n        outerRing,\n        Cartesian3.equalsEpsilon,\n        true\n      );\n    }\n    if (outerRing.length < 3) {\n      continue;\n    }\n\n    let positions2D = projectPointsTo2D(outerRing);\n    if (!defined(positions2D)) {\n      continue;\n    }\n    const holeIndices = [];\n\n    let originalWindingOrder = PolygonPipeline.computeWindingOrder2D(\n      positions2D\n    );\n    if (originalWindingOrder === WindingOrder.CLOCKWISE) {\n      positions2D.reverse();\n      outerRing = outerRing.slice().reverse();\n    }\n\n    if (split) {\n      split = false;\n      let polygons = [outerRing];\n      polygons = splitPolygons(polygons, polygons);\n\n      if (polygons.length > 1) {\n        for (const positions of polygons) {\n          queue.enqueue(new PolygonHierarchy(positions, holes));\n        }\n\n        continue;\n      }\n    }\n\n    let positions = outerRing.slice();\n    const numChildren = defined(holes) ? holes.length : 0;\n    const polygonHoles = [];\n    let j;\n\n    for (i = 0; i < numChildren; i++) {\n      const hole = holes[i];\n      let holePositions = hole.positions;\n      if (scaleToEllipsoidSurface) {\n        length = holePositions.length;\n        for (j = 0; j < length; ++j) {\n          ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);\n        }\n      }\n\n      if (!keepDuplicates) {\n        holePositions = arrayRemoveDuplicates(\n          holePositions,\n          Cartesian3.equalsEpsilon,\n          true\n        );\n      }\n      if (holePositions.length < 3) {\n        continue;\n      }\n\n      const holePositions2D = projectPointsTo2D(holePositions);\n      if (!defined(holePositions2D)) {\n        continue;\n      }\n\n      originalWindingOrder = PolygonPipeline.computeWindingOrder2D(\n        holePositions2D\n      );\n      if (originalWindingOrder === WindingOrder.CLOCKWISE) {\n        holePositions2D.reverse();\n        holePositions = holePositions.slice().reverse();\n      }\n\n      polygonHoles.push(holePositions);\n      holeIndices.push(positions.length);\n      positions = positions.concat(holePositions);\n      positions2D = positions2D.concat(holePositions2D);\n\n      let numGrandchildren = 0;\n      if (defined(hole.holes)) {\n        numGrandchildren = hole.holes.length;\n      }\n\n      for (j = 0; j < numGrandchildren; j++) {\n        queue.enqueue(hole.holes[j]);\n      }\n    }\n\n    hierarchy.push({\n      outerRing: outerRing,\n      holes: polygonHoles,\n    });\n    polygons.push({\n      positions: positions,\n      positions2D: positions2D,\n      holes: holeIndices,\n    });\n  }\n\n  return {\n    hierarchy: hierarchy,\n    polygons: polygons,\n  };\n};\n\nconst computeBoundingRectangleCartesian2 = new Cartesian2();\nconst computeBoundingRectangleCartesian3 = new Cartesian3();\nconst computeBoundingRectangleQuaternion = new Quaternion();\nconst computeBoundingRectangleMatrix3 = new Matrix3();\nPolygonGeometryLibrary.computeBoundingRectangle = function (\n  planeNormal,\n  projectPointTo2D,\n  positions,\n  angle,\n  result\n) {\n  const rotation = Quaternion.fromAxisAngle(\n    planeNormal,\n    angle,\n    computeBoundingRectangleQuaternion\n  );\n  const textureMatrix = Matrix3.fromQuaternion(\n    rotation,\n    computeBoundingRectangleMatrix3\n  );\n\n  let minX = Number.POSITIVE_INFINITY;\n  let maxX = Number.NEGATIVE_INFINITY;\n  let minY = Number.POSITIVE_INFINITY;\n  let maxY = Number.NEGATIVE_INFINITY;\n\n  const length = positions.length;\n  for (let i = 0; i < length; ++i) {\n    const p = Cartesian3.clone(\n      positions[i],\n      computeBoundingRectangleCartesian3\n    );\n    Matrix3.multiplyByVector(textureMatrix, p, p);\n    const st = projectPointTo2D(p, computeBoundingRectangleCartesian2);\n\n    if (defined(st)) {\n      minX = Math.min(minX, st.x);\n      maxX = Math.max(maxX, st.x);\n\n      minY = Math.min(minY, st.y);\n      maxY = Math.max(maxY, st.y);\n    }\n  }\n\n  result.x = minX;\n  result.y = minY;\n  result.width = maxX - minX;\n  result.height = maxY - minY;\n  return result;\n};\n\nPolygonGeometryLibrary.createGeometryFromPositions = function (\n  ellipsoid,\n  polygon,\n  textureCoordinates,\n  granularity,\n  perPositionHeight,\n  vertexFormat,\n  arcType\n) {\n  let indices = PolygonPipeline.triangulate(polygon.positions2D, polygon.holes);\n\n  /* If polygon is completely unrenderable, just use the first three vertices */\n  if (indices.length < 3) {\n    indices = [0, 1, 2];\n  }\n\n  const positions = polygon.positions;\n\n  const hasTexcoords = defined(textureCoordinates);\n  const texcoords = hasTexcoords ? textureCoordinates.positions : undefined;\n\n  if (perPositionHeight) {\n    const length = positions.length;\n    const flattenedPositions = new Array(length * 3);\n    let index = 0;\n    for (let i = 0; i < length; i++) {\n      const p = positions[i];\n      flattenedPositions[index++] = p.x;\n      flattenedPositions[index++] = p.y;\n      flattenedPositions[index++] = p.z;\n    }\n\n    const geometryOptions = {\n      attributes: {\n        position: new GeometryAttribute({\n          componentDatatype: ComponentDatatype.DOUBLE,\n          componentsPerAttribute: 3,\n          values: flattenedPositions,\n        }),\n      },\n      indices: indices,\n      primitiveType: PrimitiveType.TRIANGLES,\n    };\n\n    if (hasTexcoords) {\n      geometryOptions.attributes.st = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 2,\n        values: Cartesian2.packArray(texcoords),\n      });\n    }\n\n    const geometry = new Geometry(geometryOptions);\n\n    if (vertexFormat.normal) {\n      return GeometryPipeline.computeNormal(geometry);\n    }\n\n    return geometry;\n  }\n\n  if (arcType === ArcType.GEODESIC) {\n    return PolygonPipeline.computeSubdivision(\n      ellipsoid,\n      positions,\n      indices,\n      texcoords,\n      granularity\n    );\n  } else if (arcType === ArcType.RHUMB) {\n    return PolygonPipeline.computeRhumbLineSubdivision(\n      ellipsoid,\n      positions,\n      indices,\n      texcoords,\n      granularity\n    );\n  }\n};\n\nconst computeWallTexcoordsSubdivided = [];\nconst computeWallIndicesSubdivided = [];\nconst p1Scratch = new Cartesian3();\nconst p2Scratch = new Cartesian3();\n\nPolygonGeometryLibrary.computeWallGeometry = function (\n  positions,\n  textureCoordinates,\n  ellipsoid,\n  granularity,\n  perPositionHeight,\n  arcType\n) {\n  let edgePositions;\n  let topEdgeLength;\n  let i;\n  let p1;\n  let p2;\n  let t1;\n  let t2;\n  let edgeTexcoords;\n  let topEdgeTexcoordLength;\n\n  let length = positions.length;\n  let index = 0;\n  let textureIndex = 0;\n\n  const hasTexcoords = defined(textureCoordinates);\n  const texcoords = hasTexcoords ? textureCoordinates.positions : undefined;\n\n  if (!perPositionHeight) {\n    const minDistance = CesiumMath.chordLength(\n      granularity,\n      ellipsoid.maximumRadius\n    );\n\n    let numVertices = 0;\n    if (arcType === ArcType.GEODESIC) {\n      for (i = 0; i < length; i++) {\n        numVertices += PolygonGeometryLibrary.subdivideLineCount(\n          positions[i],\n          positions[(i + 1) % length],\n          minDistance\n        );\n      }\n    } else if (arcType === ArcType.RHUMB) {\n      for (i = 0; i < length; i++) {\n        numVertices += PolygonGeometryLibrary.subdivideRhumbLineCount(\n          ellipsoid,\n          positions[i],\n          positions[(i + 1) % length],\n          minDistance\n        );\n      }\n    }\n\n    topEdgeLength = (numVertices + length) * 3;\n    edgePositions = new Array(topEdgeLength * 2);\n\n    if (hasTexcoords) {\n      topEdgeTexcoordLength = (numVertices + length) * 2;\n      edgeTexcoords = new Array(topEdgeTexcoordLength * 2);\n    }\n\n    for (i = 0; i < length; i++) {\n      p1 = positions[i];\n      p2 = positions[(i + 1) % length];\n\n      let tempPositions;\n      let tempTexcoords;\n\n      if (hasTexcoords) {\n        t1 = texcoords[i];\n        t2 = texcoords[(i + 1) % length];\n      }\n\n      if (arcType === ArcType.GEODESIC) {\n        tempPositions = PolygonGeometryLibrary.subdivideLine(\n          p1,\n          p2,\n          minDistance,\n          computeWallIndicesSubdivided\n        );\n        if (hasTexcoords) {\n          tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordLine(\n            t1,\n            t2,\n            p1,\n            p2,\n            minDistance,\n            computeWallTexcoordsSubdivided\n          );\n        }\n      } else if (arcType === ArcType.RHUMB) {\n        tempPositions = PolygonGeometryLibrary.subdivideRhumbLine(\n          ellipsoid,\n          p1,\n          p2,\n          minDistance,\n          computeWallIndicesSubdivided\n        );\n        if (hasTexcoords) {\n          tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordRhumbLine(\n            t1,\n            t2,\n            ellipsoid,\n            p1,\n            p2,\n            minDistance,\n            computeWallTexcoordsSubdivided\n          );\n        }\n      }\n      const tempPositionsLength = tempPositions.length;\n      for (let j = 0; j < tempPositionsLength; ++j, ++index) {\n        edgePositions[index] = tempPositions[j];\n        edgePositions[index + topEdgeLength] = tempPositions[j];\n      }\n\n      edgePositions[index] = p2.x;\n      edgePositions[index + topEdgeLength] = p2.x;\n      ++index;\n\n      edgePositions[index] = p2.y;\n      edgePositions[index + topEdgeLength] = p2.y;\n      ++index;\n\n      edgePositions[index] = p2.z;\n      edgePositions[index + topEdgeLength] = p2.z;\n      ++index;\n\n      if (hasTexcoords) {\n        const tempTexcoordsLength = tempTexcoords.length;\n        for (let k = 0; k < tempTexcoordsLength; ++k, ++textureIndex) {\n          edgeTexcoords[textureIndex] = tempTexcoords[k];\n          edgeTexcoords[textureIndex + topEdgeTexcoordLength] =\n            tempTexcoords[k];\n        }\n\n        edgeTexcoords[textureIndex] = t2.x;\n        edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.x;\n        ++textureIndex;\n\n        edgeTexcoords[textureIndex] = t2.y;\n        edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.y;\n        ++textureIndex;\n      }\n    }\n  } else {\n    topEdgeLength = length * 3 * 2;\n    edgePositions = new Array(topEdgeLength * 2);\n\n    if (hasTexcoords) {\n      topEdgeTexcoordLength = length * 2 * 2;\n      edgeTexcoords = new Array(topEdgeTexcoordLength * 2);\n    }\n\n    for (i = 0; i < length; i++) {\n      p1 = positions[i];\n      p2 = positions[(i + 1) % length];\n      edgePositions[index] = edgePositions[index + topEdgeLength] = p1.x;\n      ++index;\n      edgePositions[index] = edgePositions[index + topEdgeLength] = p1.y;\n      ++index;\n      edgePositions[index] = edgePositions[index + topEdgeLength] = p1.z;\n      ++index;\n      edgePositions[index] = edgePositions[index + topEdgeLength] = p2.x;\n      ++index;\n      edgePositions[index] = edgePositions[index + topEdgeLength] = p2.y;\n      ++index;\n      edgePositions[index] = edgePositions[index + topEdgeLength] = p2.z;\n      ++index;\n\n      if (hasTexcoords) {\n        t1 = texcoords[i];\n        t2 = texcoords[(i + 1) % length];\n        edgeTexcoords[textureIndex] = edgeTexcoords[\n          textureIndex + topEdgeTexcoordLength\n        ] = t1.x;\n        ++textureIndex;\n        edgeTexcoords[textureIndex] = edgeTexcoords[\n          textureIndex + topEdgeTexcoordLength\n        ] = t1.y;\n        ++textureIndex;\n        edgeTexcoords[textureIndex] = edgeTexcoords[\n          textureIndex + topEdgeTexcoordLength\n        ] = t2.x;\n        ++textureIndex;\n        edgeTexcoords[textureIndex] = edgeTexcoords[\n          textureIndex + topEdgeTexcoordLength\n        ] = t2.y;\n        ++textureIndex;\n      }\n    }\n  }\n\n  length = edgePositions.length;\n  const indices = IndexDatatype.createTypedArray(\n    length / 3,\n    length - positions.length * 6\n  );\n  let edgeIndex = 0;\n  length /= 6;\n\n  for (i = 0; i < length; i++) {\n    const UL = i;\n    const UR = UL + 1;\n    const LL = UL + length;\n    const LR = LL + 1;\n\n    p1 = Cartesian3.fromArray(edgePositions, UL * 3, p1Scratch);\n    p2 = Cartesian3.fromArray(edgePositions, UR * 3, p2Scratch);\n    if (\n      Cartesian3.equalsEpsilon(\n        p1,\n        p2,\n        CesiumMath.EPSILON10,\n        CesiumMath.EPSILON10\n      )\n    ) {\n      //skip corner\n      continue;\n    }\n\n    indices[edgeIndex++] = UL;\n    indices[edgeIndex++] = LL;\n    indices[edgeIndex++] = UR;\n    indices[edgeIndex++] = UR;\n    indices[edgeIndex++] = LL;\n    indices[edgeIndex++] = LR;\n  }\n\n  const geometryOptions = {\n    attributes: new GeometryAttributes({\n      position: new GeometryAttribute({\n        componentDatatype: ComponentDatatype.DOUBLE,\n        componentsPerAttribute: 3,\n        values: edgePositions,\n      }),\n    }),\n    indices: indices,\n    primitiveType: PrimitiveType.TRIANGLES,\n  };\n\n  if (hasTexcoords) {\n    geometryOptions.attributes.st = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n      values: edgeTexcoords,\n    });\n  }\n\n  const geometry = new Geometry(geometryOptions);\n\n  return geometry;\n};\nexport default PolygonGeometryLibrary;\n", "import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CoplanarPolygonGeometryLibrary from \"./CoplanarPolygonGeometryLibrary.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryInstance from \"./GeometryInstance.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport PolygonGeometryLibrary from \"./PolygonGeometryLibrary.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\nfunction createGeometryFromPositions(positions) {\n  const length = positions.length;\n  const flatPositions = new Float64Array(length * 3);\n  const indices = IndexDatatype.createTypedArray(length, length * 2);\n\n  let positionIndex = 0;\n  let index = 0;\n\n  for (let i = 0; i < length; i++) {\n    const position = positions[i];\n    flatPositions[positionIndex++] = position.x;\n    flatPositions[positionIndex++] = position.y;\n    flatPositions[positionIndex++] = position.z;\n\n    indices[index++] = i;\n    indices[index++] = (i + 1) % length;\n  }\n\n  const attributes = new GeometryAttributes({\n    position: new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: flatPositions,\n    }),\n  });\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: PrimitiveType.LINES,\n  });\n}\n\n/**\n * A description of the outline of a polygon composed of arbitrary coplanar positions.\n *\n * @alias CoplanarPolygonOutlineGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.\n *\n * @see CoplanarPolygonOutlineGeometry.createGeometry\n *\n * @example\n * const polygonOutline = new Cesium.CoplanarPolygonOutlineGeometry({\n *   positions : Cesium.Cartesian3.fromDegreesArrayHeights([\n *      -90.0, 30.0, 0.0,\n *      -90.0, 30.0, 1000.0,\n *      -80.0, 30.0, 1000.0,\n *      -80.0, 30.0, 0.0\n *   ])\n * });\n * const geometry = Cesium.CoplanarPolygonOutlineGeometry.createGeometry(polygonOutline);\n */\nfunction CoplanarPolygonOutlineGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const polygonHierarchy = options.polygonHierarchy;\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.polygonHierarchy\", polygonHierarchy);\n  //>>includeEnd('debug');\n\n  this._polygonHierarchy = polygonHierarchy;\n  this._workerName = \"createCoplanarPolygonOutlineGeometry\";\n\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  this.packedLength =\n    PolygonGeometryLibrary.computeHierarchyPackedLength(\n      polygonHierarchy,\n      Cartesian3\n    ) + 1;\n}\n\n/**\n * A description of a coplanar polygon outline from an array of positions.\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.\n * @returns {CoplanarPolygonOutlineGeometry}\n */\nCoplanarPolygonOutlineGeometry.fromPositions = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.positions\", options.positions);\n  //>>includeEnd('debug');\n\n  const newOptions = {\n    polygonHierarchy: {\n      positions: options.positions,\n    },\n  };\n  return new CoplanarPolygonOutlineGeometry(newOptions);\n};\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CoplanarPolygonOutlineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nCoplanarPolygonOutlineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\n    value._polygonHierarchy,\n    array,\n    startingIndex,\n    Cartesian3\n  );\n\n  array[startingIndex] = value.packedLength;\n\n  return array;\n};\n\nconst scratchOptions = {\n  polygonHierarchy: {},\n};\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CoplanarPolygonOutlineGeometry} [result] The object into which to store the result.\n * @returns {CoplanarPolygonOutlineGeometry} The modified result parameter or a new CoplanarPolygonOutlineGeometry instance if one was not provided.\n */\nCoplanarPolygonOutlineGeometry.unpack = function (\n  array,\n  startingIndex,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy(\n    array,\n    startingIndex,\n    Cartesian3\n  );\n  startingIndex = polygonHierarchy.startingIndex;\n  delete polygonHierarchy.startingIndex;\n  const packedLength = array[startingIndex];\n\n  if (!defined(result)) {\n    result = new CoplanarPolygonOutlineGeometry(scratchOptions);\n  }\n\n  result._polygonHierarchy = polygonHierarchy;\n  result.packedLength = packedLength;\n\n  return result;\n};\n\n/**\n * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.\n *\n * @param {CoplanarPolygonOutlineGeometry} polygonGeometry A description of the polygon.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCoplanarPolygonOutlineGeometry.createGeometry = function (polygonGeometry) {\n  const polygonHierarchy = polygonGeometry._polygonHierarchy;\n\n  let outerPositions = polygonHierarchy.positions;\n  outerPositions = arrayRemoveDuplicates(\n    outerPositions,\n    Cartesian3.equalsEpsilon,\n    true\n  );\n  if (outerPositions.length < 3) {\n    return;\n  }\n  const isValid = CoplanarPolygonGeometryLibrary.validOutline(outerPositions);\n  if (!isValid) {\n    return undefined;\n  }\n\n  const polygons = PolygonGeometryLibrary.polygonOutlinesFromHierarchy(\n    polygonHierarchy,\n    false\n  );\n\n  if (polygons.length === 0) {\n    return undefined;\n  }\n\n  const geometries = [];\n\n  for (let i = 0; i < polygons.length; i++) {\n    const geometryInstance = new GeometryInstance({\n      geometry: createGeometryFromPositions(polygons[i]),\n    });\n    geometries.push(geometryInstance);\n  }\n\n  const geometry = GeometryPipeline.combineInstances(geometries)[0];\n  const boundingSphere = BoundingSphere.fromPoints(polygonHierarchy.positions);\n\n  return new Geometry({\n    attributes: geometry.attributes,\n    indices: geometry.indices,\n    primitiveType: geometry.primitiveType,\n    boundingSphere: boundingSphere,\n  });\n};\nexport default CoplanarPolygonOutlineGeometry;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defined from \"../Core/defined.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Plane from \"../Core/Plane.js\";\nimport CoplanarPolygonOutlineGeometry from \"../Core/CoplanarPolygonOutlineGeometry.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Check from \"../Core/Check.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\nimport S2Cell from \"../Core/S2Cell.js\";\nlet centerCartographicScratch = new Cartographic();\n/**\n * A tile bounding volume specified as an S2 cell token with minimum and maximum heights.\n * The bounding volume is a k DOP. A k-DOP is the Boolean intersection of extents along k directions.\n *\n * @alias TileBoundingS2Cell\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {string} options.token The token of the S2 cell.\n * @param {number} [options.minimumHeight=0.0] The minimum height of the bounding volume.\n * @param {number} [options.maximumHeight=0.0] The maximum height of the bounding volume.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid.\n * @param {boolean} [options.computeBoundingVolumes=true] True to compute the {@link TileBoundingS2Cell#boundingVolume} and\n *                  {@link TileBoundingS2Cell#boundingSphere}. If false, these properties will be undefined.\n *\n * @private\n */\nfunction TileBoundingS2Cell(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options\", options);\n  Check.typeOf.string(\"options.token\", options.token);\n  //>>includeEnd('debug');\n\n  const s2Cell = S2Cell.fromToken(options.token);\n  const minimumHeight = defaultValue(options.minimumHeight, 0.0);\n  const maximumHeight = defaultValue(options.maximumHeight, 0.0);\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n  this.s2Cell = s2Cell;\n  this.minimumHeight = minimumHeight;\n  this.maximumHeight = maximumHeight;\n  this.ellipsoid = ellipsoid;\n\n  const boundingPlanes = computeBoundingPlanes(\n    s2Cell,\n    minimumHeight,\n    maximumHeight,\n    ellipsoid\n  );\n  this._boundingPlanes = boundingPlanes;\n\n  // Pre-compute vertices to speed up the plane intersection test.\n  const vertices = computeVertices(boundingPlanes);\n  this._vertices = vertices;\n\n  // Pre-compute edge normals to speed up the point-polygon distance check in distanceToCamera.\n  this._edgeNormals = new Array(6);\n\n  this._edgeNormals[0] = computeEdgeNormals(\n    boundingPlanes[0],\n    vertices.slice(0, 4)\n  );\n  let i;\n  // Based on the way the edge normals are computed, the edge normals all point away from the \"face\"\n  // of the polyhedron they surround, except the plane for the top plane. Therefore, we negate the normals\n  // for the top plane.\n  for (i = 0; i < 4; i++) {\n    this._edgeNormals[0][i] = Cartesian3.negate(\n      this._edgeNormals[0][i],\n      this._edgeNormals[0][i]\n    );\n  }\n\n  this._edgeNormals[1] = computeEdgeNormals(\n    boundingPlanes[1],\n    vertices.slice(4, 8)\n  );\n  for (i = 0; i < 4; i++) {\n    // For each plane, iterate through the vertices in CCW order.\n    this._edgeNormals[2 + i] = computeEdgeNormals(boundingPlanes[2 + i], [\n      vertices[i % 4],\n      vertices[(i + 1) % 4],\n      vertices[4 + ((i + 1) % 4)],\n      vertices[4 + i],\n    ]);\n  }\n\n  this._planeVertices = [\n    this._vertices.slice(0, 4),\n    this._vertices.slice(4, 8),\n  ];\n  for (i = 0; i < 4; i++) {\n    this._planeVertices.push([\n      this._vertices[i % 4],\n      this._vertices[(i + 1) % 4],\n      this._vertices[4 + ((i + 1) % 4)],\n      this._vertices[4 + i],\n    ]);\n  }\n\n  const center = s2Cell.getCenter();\n  centerCartographicScratch = ellipsoid.cartesianToCartographic(\n    center,\n    centerCartographicScratch\n  );\n  centerCartographicScratch.height = (maximumHeight + minimumHeight) / 2;\n  this.center = ellipsoid.cartographicToCartesian(\n    centerCartographicScratch,\n    center\n  );\n\n  this._boundingSphere = BoundingSphere.fromPoints(vertices);\n}\n\nconst centerGeodeticNormalScratch = new Cartesian3();\nconst topCartographicScratch = new Cartographic();\nconst topScratch = new Cartesian3();\nconst vertexCartographicScratch = new Cartographic();\nconst vertexScratch = new Cartesian3();\nconst vertexGeodeticNormalScratch = new Cartesian3();\nconst sideNormalScratch = new Cartesian3();\nconst sideScratch = new Cartesian3();\n/**\n * Computes bounding planes of the kDOP.\n * @private\n */\nfunction computeBoundingPlanes(\n  s2Cell,\n  minimumHeight,\n  maximumHeight,\n  ellipsoid\n) {\n  const planes = new Array(6);\n  const centerPoint = s2Cell.getCenter();\n\n  // Compute top plane.\n  // - Get geodetic surface normal at the center of the S2 cell.\n  // - Get center point at maximum height of bounding volume.\n  // - Create top plane from surface normal and top point.\n  const centerSurfaceNormal = ellipsoid.geodeticSurfaceNormal(\n    centerPoint,\n    centerGeodeticNormalScratch\n  );\n  const topCartographic = ellipsoid.cartesianToCartographic(\n    centerPoint,\n    topCartographicScratch\n  );\n  topCartographic.height = maximumHeight;\n  const top = ellipsoid.cartographicToCartesian(topCartographic, topScratch);\n  const topPlane = Plane.fromPointNormal(top, centerSurfaceNormal);\n  planes[0] = topPlane;\n\n  // Compute bottom plane.\n  // - Iterate through bottom vertices\n  //   - Get distance from vertex to top plane\n  // - Find longest distance from vertex to top plane\n  // - Translate top plane by the distance\n  let maxDistance = 0;\n  let i;\n  const vertices = [];\n  let vertex, vertexCartographic;\n  for (i = 0; i < 4; i++) {\n    vertex = s2Cell.getVertex(i);\n    vertices[i] = vertex;\n    vertexCartographic = ellipsoid.cartesianToCartographic(\n      vertex,\n      vertexCartographicScratch\n    );\n    vertexCartographic.height = minimumHeight;\n    const distance = Plane.getPointDistance(\n      topPlane,\n      ellipsoid.cartographicToCartesian(vertexCartographic, vertexScratch)\n    );\n    if (distance < maxDistance) {\n      maxDistance = distance;\n    }\n  }\n  const bottomPlane = Plane.clone(topPlane);\n  // Negate the normal of the bottom plane since we want all normals to point \"outwards\".\n  bottomPlane.normal = Cartesian3.negate(\n    bottomPlane.normal,\n    bottomPlane.normal\n  );\n  bottomPlane.distance = bottomPlane.distance * -1 + maxDistance;\n  planes[1] = bottomPlane;\n\n  // Compute side planes.\n  // - Iterate through vertices (in CCW order, by default)\n  //   - Get a vertex and another vertex adjacent to it.\n  //   - Compute geodetic surface normal at one vertex.\n  //   - Compute vector between vertices.\n  //   - Compute normal of side plane. (cross product of top dir and side dir)\n  for (i = 0; i < 4; i++) {\n    vertex = vertices[i];\n    const adjacentVertex = vertices[(i + 1) % 4];\n    const geodeticNormal = ellipsoid.geodeticSurfaceNormal(\n      vertex,\n      vertexGeodeticNormalScratch\n    );\n    const side = Cartesian3.subtract(adjacentVertex, vertex, sideScratch);\n    let sideNormal = Cartesian3.cross(side, geodeticNormal, sideNormalScratch);\n    sideNormal = Cartesian3.normalize(sideNormal, sideNormal);\n    planes[2 + i] = Plane.fromPointNormal(vertex, sideNormal);\n  }\n\n  return planes;\n}\n\nlet n0Scratch = new Cartesian3();\nlet n1Scratch = new Cartesian3();\nlet n2Scratch = new Cartesian3();\nlet x0Scratch = new Cartesian3();\nlet x1Scratch = new Cartesian3();\nlet x2Scratch = new Cartesian3();\nconst t0Scratch = new Cartesian3();\nconst t1Scratch = new Cartesian3();\nconst t2Scratch = new Cartesian3();\nlet f0Scratch = new Cartesian3();\nlet f1Scratch = new Cartesian3();\nlet f2Scratch = new Cartesian3();\nlet sScratch = new Cartesian3();\nconst matrixScratch = new Matrix3();\n/**\n * Computes intersection of 3 planes.\n * @private\n */\nfunction computeIntersection(p0, p1, p2) {\n  n0Scratch = p0.normal;\n  n1Scratch = p1.normal;\n  n2Scratch = p2.normal;\n\n  x0Scratch = Cartesian3.multiplyByScalar(p0.normal, -p0.distance, x0Scratch);\n  x1Scratch = Cartesian3.multiplyByScalar(p1.normal, -p1.distance, x1Scratch);\n  x2Scratch = Cartesian3.multiplyByScalar(p2.normal, -p2.distance, x2Scratch);\n\n  f0Scratch = Cartesian3.multiplyByScalar(\n    Cartesian3.cross(n1Scratch, n2Scratch, t0Scratch),\n    Cartesian3.dot(x0Scratch, n0Scratch),\n    f0Scratch\n  );\n  f1Scratch = Cartesian3.multiplyByScalar(\n    Cartesian3.cross(n2Scratch, n0Scratch, t1Scratch),\n    Cartesian3.dot(x1Scratch, n1Scratch),\n    f1Scratch\n  );\n  f2Scratch = Cartesian3.multiplyByScalar(\n    Cartesian3.cross(n0Scratch, n1Scratch, t2Scratch),\n    Cartesian3.dot(x2Scratch, n2Scratch),\n    f2Scratch\n  );\n\n  matrixScratch[0] = n0Scratch.x;\n  matrixScratch[1] = n1Scratch.x;\n  matrixScratch[2] = n2Scratch.x;\n  matrixScratch[3] = n0Scratch.y;\n  matrixScratch[4] = n1Scratch.y;\n  matrixScratch[5] = n2Scratch.y;\n  matrixScratch[6] = n0Scratch.z;\n  matrixScratch[7] = n1Scratch.z;\n  matrixScratch[8] = n2Scratch.z;\n  const determinant = Matrix3.determinant(matrixScratch);\n  sScratch = Cartesian3.add(f0Scratch, f1Scratch, sScratch);\n  sScratch = Cartesian3.add(sScratch, f2Scratch, sScratch);\n  return new Cartesian3(\n    sScratch.x / determinant,\n    sScratch.y / determinant,\n    sScratch.z / determinant\n  );\n}\n/**\n * Compute the vertices of the kDOP.\n * @private\n */\nfunction computeVertices(boundingPlanes) {\n  const vertices = new Array(8);\n  for (let i = 0; i < 4; i++) {\n    // Vertices on the top plane.\n    vertices[i] = computeIntersection(\n      boundingPlanes[0],\n      boundingPlanes[2 + ((i + 3) % 4)],\n      boundingPlanes[2 + (i % 4)]\n    );\n    // Vertices on the bottom plane.\n    vertices[i + 4] = computeIntersection(\n      boundingPlanes[1],\n      boundingPlanes[2 + ((i + 3) % 4)],\n      boundingPlanes[2 + (i % 4)]\n    );\n  }\n  return vertices;\n}\n\nlet edgeScratch = new Cartesian3();\nlet edgeNormalScratch = new Cartesian3();\n/**\n * Compute edge normals on a plane.\n * @private\n */\nfunction computeEdgeNormals(plane, vertices) {\n  const edgeNormals = [];\n  for (let i = 0; i < 4; i++) {\n    edgeScratch = Cartesian3.subtract(\n      vertices[(i + 1) % 4],\n      vertices[i],\n      edgeScratch\n    );\n    edgeNormalScratch = Cartesian3.cross(\n      plane.normal,\n      edgeScratch,\n      edgeNormalScratch\n    );\n    edgeNormalScratch = Cartesian3.normalize(\n      edgeNormalScratch,\n      edgeNormalScratch\n    );\n    edgeNormals[i] = Cartesian3.clone(edgeNormalScratch);\n  }\n  return edgeNormals;\n}\n\nObject.defineProperties(TileBoundingS2Cell.prototype, {\n  /**\n   * The underlying bounding volume.\n   *\n   * @memberof TileOrientedBoundingBox.prototype\n   *\n   * @type {object}\n   * @readonly\n   */\n  boundingVolume: {\n    get: function () {\n      return this;\n    },\n  },\n  /**\n   * The underlying bounding sphere.\n   *\n   * @memberof TileOrientedBoundingBox.prototype\n   *\n   * @type {BoundingSphere}\n   * @readonly\n   */\n  boundingSphere: {\n    get: function () {\n      return this._boundingSphere;\n    },\n  },\n});\n\nconst facePointScratch = new Cartesian3();\n/**\n * The distance to point check for this kDOP involves checking the signed distance of the point to each bounding\n * plane. A plane qualifies for a distance check if the point being tested against is in the half-space in the direction\n * of the normal i.e. if the signed distance of the point from the plane is greater than 0.\n *\n * There are 4 possible cases for a point if it is outside the polyhedron:\n *\n *   \\     X     /     X \\           /       \\           /       \\           /\n * ---\\---------/---   ---\\---------/---   ---X---------/---   ---\\---------/---\n *     \\       /           \\       /           \\       /           \\       /\n *   ---\\-----/---       ---\\-----/---       ---\\-----/---       ---\\-----/---\n *       \\   /               \\   /               \\   /               \\   /\n *                                                                    \\ /\n *                                                                     \\\n *                                                                    / \\\n *                                                                   / X \\\n *\n *         I                  II                  III                 IV\n *\n * Case I: There is only one plane selected.\n * In this case, we project the point onto the plane and do a point polygon distance check to find the closest point on the polygon.\n * The point may lie inside the \"face\" of the polygon or outside. If it is outside, we need to determine which edges to test against.\n *\n * Case II: There are two planes selected.\n * In this case, the point will lie somewhere on the line created at the intersection of the selected planes or one of the planes.\n *\n * Case III: There are three planes selected.\n * In this case, the point will lie on the vertex, at the intersection of the selected planes.\n *\n * Case IV: There are more than three planes selected.\n * Since we are on an ellipsoid, this will only happen in the bottom plane, which is what we will use for the distance test.\n */\nTileBoundingS2Cell.prototype.distanceToCamera = function (frameState) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"frameState\", frameState);\n  //>>includeEnd('debug');\n\n  const point = frameState.camera.positionWC;\n\n  const selectedPlaneIndices = [];\n  const vertices = [];\n  let edgeNormals;\n\n  if (Plane.getPointDistance(this._boundingPlanes[0], point) > 0) {\n    selectedPlaneIndices.push(0);\n    vertices.push(this._planeVertices[0]);\n    edgeNormals = this._edgeNormals[0];\n  } else if (Plane.getPointDistance(this._boundingPlanes[1], point) > 0) {\n    selectedPlaneIndices.push(1);\n    vertices.push(this._planeVertices[1]);\n    edgeNormals = this._edgeNormals[1];\n  }\n\n  let i;\n  let sidePlaneIndex;\n  for (i = 0; i < 4; i++) {\n    sidePlaneIndex = 2 + i;\n    if (\n      Plane.getPointDistance(this._boundingPlanes[sidePlaneIndex], point) > 0\n    ) {\n      selectedPlaneIndices.push(sidePlaneIndex);\n      // Store vertices in CCW order.\n      vertices.push(this._planeVertices[sidePlaneIndex]);\n      edgeNormals = this._edgeNormals[sidePlaneIndex];\n    }\n  }\n\n  // Check if inside all planes.\n  if (selectedPlaneIndices.length === 0) {\n    return 0.0;\n  }\n\n  // We use the skip variable when the side plane indices are non-consecutive.\n  let facePoint;\n  let selectedPlane;\n  if (selectedPlaneIndices.length === 1) {\n    // Handles Case I\n    selectedPlane = this._boundingPlanes[selectedPlaneIndices[0]];\n    facePoint = closestPointPolygon(\n      Plane.projectPointOntoPlane(selectedPlane, point, facePointScratch),\n      vertices[0],\n      selectedPlane,\n      edgeNormals\n    );\n\n    return Cartesian3.distance(facePoint, point);\n  } else if (selectedPlaneIndices.length === 2) {\n    // Handles Case II\n    // Since we are on the ellipsoid, the dihedral angle between a top plane and a side plane\n    // will always be acute, so we can do a faster check there.\n    if (selectedPlaneIndices[0] === 0) {\n      const edge = [\n        this._vertices[\n          4 * selectedPlaneIndices[0] + (selectedPlaneIndices[1] - 2)\n        ],\n        this._vertices[\n          4 * selectedPlaneIndices[0] + ((selectedPlaneIndices[1] - 2 + 1) % 4)\n        ],\n      ];\n      facePoint = closestPointLineSegment(point, edge[0], edge[1]);\n      return Cartesian3.distance(facePoint, point);\n    }\n    let minimumDistance = Number.MAX_VALUE;\n    let distance;\n    for (i = 0; i < 2; i++) {\n      selectedPlane = this._boundingPlanes[selectedPlaneIndices[i]];\n      facePoint = closestPointPolygon(\n        Plane.projectPointOntoPlane(selectedPlane, point, facePointScratch),\n        vertices[i],\n        selectedPlane,\n        this._edgeNormals[selectedPlaneIndices[i]]\n      );\n\n      distance = Cartesian3.distanceSquared(facePoint, point);\n      if (distance < minimumDistance) {\n        minimumDistance = distance;\n      }\n    }\n    return Math.sqrt(minimumDistance);\n  } else if (selectedPlaneIndices.length > 3) {\n    // Handles Case IV\n    facePoint = closestPointPolygon(\n      Plane.projectPointOntoPlane(\n        this._boundingPlanes[1],\n        point,\n        facePointScratch\n      ),\n      this._planeVertices[1],\n      this._boundingPlanes[1],\n      this._edgeNormals[1]\n    );\n    return Cartesian3.distance(facePoint, point);\n  }\n\n  // Handles Case III\n  const skip =\n    selectedPlaneIndices[1] === 2 && selectedPlaneIndices[2] === 5 ? 0 : 1;\n\n  // Vertex is on top plane.\n  if (selectedPlaneIndices[0] === 0) {\n    return Cartesian3.distance(\n      point,\n      this._vertices[(selectedPlaneIndices[1] - 2 + skip) % 4]\n    );\n  }\n\n  // Vertex is on bottom plane.\n  return Cartesian3.distance(\n    point,\n    this._vertices[4 + ((selectedPlaneIndices[1] - 2 + skip) % 4)]\n  );\n};\n\nconst dScratch = new Cartesian3();\nconst pL0Scratch = new Cartesian3();\n/**\n * Finds point on a line segment closest to a given point.\n * @private\n */\nfunction closestPointLineSegment(p, l0, l1) {\n  const d = Cartesian3.subtract(l1, l0, dScratch);\n  const pL0 = Cartesian3.subtract(p, l0, pL0Scratch);\n  let t = Cartesian3.dot(d, pL0);\n\n  if (t <= 0) {\n    return l0;\n  }\n\n  const dMag = Cartesian3.dot(d, d);\n  if (t >= dMag) {\n    return l1;\n  }\n\n  t = t / dMag;\n  return new Cartesian3(\n    (1 - t) * l0.x + t * l1.x,\n    (1 - t) * l0.y + t * l1.y,\n    (1 - t) * l0.z + t * l1.z\n  );\n}\n\nconst edgePlaneScratch = new Plane(Cartesian3.UNIT_X, 0.0);\n/**\n * Finds closes point on the polygon, created by the given vertices, from\n * a point. The test point and the polygon are all on the same plane.\n * @private\n */\nfunction closestPointPolygon(p, vertices, plane, edgeNormals) {\n  let minDistance = Number.MAX_VALUE;\n  let distance;\n  let closestPoint;\n  let closestPointOnEdge;\n\n  for (let i = 0; i < vertices.length; i++) {\n    const edgePlane = Plane.fromPointNormal(\n      vertices[i],\n      edgeNormals[i],\n      edgePlaneScratch\n    );\n    const edgePlaneDistance = Plane.getPointDistance(edgePlane, p);\n\n    // Skip checking against the edge if the point is not in the half-space that the\n    // edgePlane's normal points towards i.e. if the edgePlane is facing away from the point.\n    if (edgePlaneDistance < 0) {\n      continue;\n    }\n\n    closestPointOnEdge = closestPointLineSegment(\n      p,\n      vertices[i],\n      vertices[(i + 1) % 4]\n    );\n\n    distance = Cartesian3.distance(p, closestPointOnEdge);\n    if (distance < minDistance) {\n      minDistance = distance;\n      closestPoint = closestPointOnEdge;\n    }\n  }\n\n  if (!defined(closestPoint)) {\n    return p;\n  }\n  return closestPoint;\n}\n\n/**\n * Determines which side of a plane this volume is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire volume is on the side of the plane\n *                      the normal is pointing, {@link Intersect.OUTSIDE} if the entire volume is\n *                      on the opposite side, and {@link Intersect.INTERSECTING} if the volume\n *                      intersects the plane.\n */\nTileBoundingS2Cell.prototype.intersectPlane = function (plane) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"plane\", plane);\n  //>>includeEnd('debug');\n\n  let plusCount = 0;\n  let negCount = 0;\n  for (let i = 0; i < this._vertices.length; i++) {\n    const distanceToPlane =\n      Cartesian3.dot(plane.normal, this._vertices[i]) + plane.distance;\n    if (distanceToPlane < 0) {\n      negCount++;\n    } else {\n      plusCount++;\n    }\n  }\n\n  if (plusCount === this._vertices.length) {\n    return Intersect.INSIDE;\n  } else if (negCount === this._vertices.length) {\n    return Intersect.OUTSIDE;\n  }\n  return Intersect.INTERSECTING;\n};\n\n/**\n * Creates a debug primitive that shows the outline of the tile bounding\n * volume.\n *\n * @param {Color} color The desired color of the primitive's mesh\n * @return {Primitive}\n */\nTileBoundingS2Cell.prototype.createDebugVolume = function (color) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"color\", color);\n  //>>includeEnd('debug');\n\n  const modelMatrix = new Matrix4.clone(Matrix4.IDENTITY);\n  const topPlanePolygon = new CoplanarPolygonOutlineGeometry({\n    polygonHierarchy: {\n      positions: this._planeVertices[0],\n    },\n  });\n  const topPlaneGeometry = CoplanarPolygonOutlineGeometry.createGeometry(\n    topPlanePolygon\n  );\n  const topPlaneInstance = new GeometryInstance({\n    geometry: topPlaneGeometry,\n    id: \"outline\",\n    modelMatrix: modelMatrix,\n    attributes: {\n      color: ColorGeometryInstanceAttribute.fromColor(color),\n    },\n  });\n\n  const bottomPlanePolygon = new CoplanarPolygonOutlineGeometry({\n    polygonHierarchy: {\n      positions: this._planeVertices[1],\n    },\n  });\n  const bottomPlaneGeometry = CoplanarPolygonOutlineGeometry.createGeometry(\n    bottomPlanePolygon\n  );\n  const bottomPlaneInstance = new GeometryInstance({\n    geometry: bottomPlaneGeometry,\n    id: \"outline\",\n    modelMatrix: modelMatrix,\n    attributes: {\n      color: ColorGeometryInstanceAttribute.fromColor(color),\n    },\n  });\n\n  const sideInstances = [];\n  for (let i = 0; i < 4; i++) {\n    const sidePlanePolygon = new CoplanarPolygonOutlineGeometry({\n      polygonHierarchy: {\n        positions: this._planeVertices[2 + i],\n      },\n    });\n    const sidePlaneGeometry = CoplanarPolygonOutlineGeometry.createGeometry(\n      sidePlanePolygon\n    );\n    sideInstances[i] = new GeometryInstance({\n      geometry: sidePlaneGeometry,\n      id: \"outline\",\n      modelMatrix: modelMatrix,\n      attributes: {\n        color: ColorGeometryInstanceAttribute.fromColor(color),\n      },\n    });\n  }\n\n  return new Primitive({\n    geometryInstances: [\n      sideInstances[0],\n      sideInstances[1],\n      sideInstances[2],\n      sideInstances[3],\n      bottomPlaneInstance,\n      topPlaneInstance,\n    ],\n    appearance: new PerInstanceColorAppearance({\n      translucent: false,\n      flat: true,\n    }),\n    asynchronous: false,\n  });\n};\n\nexport default TileBoundingS2Cell;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\nconst defaultRadii = new Cartesian3(1.0, 1.0, 1.0);\nconst cos = Math.cos;\nconst sin = Math.sin;\n\n/**\n * A description of the outline of an ellipsoid centered at the origin.\n *\n * @alias EllipsoidOutlineGeometry\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Cartesian3} [options.radii=Cartesian3(1.0, 1.0, 1.0)] The radii of the ellipsoid in the x, y, and z directions.\n * @param {Cartesian3} [options.innerRadii=options.radii] The inner radii of the ellipsoid in the x, y, and z directions.\n * @param {number} [options.minimumClock=0.0] The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\n * @param {number} [options.maximumClock=2*PI] The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\n * @param {number} [options.minimumCone=0.0] The minimum angle measured from the positive z-axis and toward the negative z-axis.\n * @param {number} [options.maximumCone=PI] The maximum angle measured from the positive z-axis and toward the negative z-axis.\n * @param {number} [options.stackPartitions=10] The count of stacks for the ellipsoid (1 greater than the number of parallel lines).\n * @param {number} [options.slicePartitions=8] The count of slices for the ellipsoid (Equal to the number of radial lines).\n * @param {number} [options.subdivisions=128] The number of points per line, determining the granularity of the curvature.\n *\n * @exception {DeveloperError} options.stackPartitions must be greater than or equal to one.\n * @exception {DeveloperError} options.slicePartitions must be greater than or equal to zero.\n * @exception {DeveloperError} options.subdivisions must be greater than or equal to zero.\n *\n * @example\n * const ellipsoid = new Cesium.EllipsoidOutlineGeometry({\n *   radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0),\n *   stackPartitions: 6,\n *   slicePartitions: 5\n * });\n * const geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid);\n */\nfunction EllipsoidOutlineGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const radii = defaultValue(options.radii, defaultRadii);\n  const innerRadii = defaultValue(options.innerRadii, radii);\n  const minimumClock = defaultValue(options.minimumClock, 0.0);\n  const maximumClock = defaultValue(options.maximumClock, CesiumMath.TWO_PI);\n  const minimumCone = defaultValue(options.minimumCone, 0.0);\n  const maximumCone = defaultValue(options.maximumCone, CesiumMath.PI);\n  const stackPartitions = Math.round(defaultValue(options.stackPartitions, 10));\n  const slicePartitions = Math.round(defaultValue(options.slicePartitions, 8));\n  const subdivisions = Math.round(defaultValue(options.subdivisions, 128));\n\n  //>>includeStart('debug', pragmas.debug);\n  if (stackPartitions < 1) {\n    throw new DeveloperError(\"options.stackPartitions cannot be less than 1\");\n  }\n  if (slicePartitions < 0) {\n    throw new DeveloperError(\"options.slicePartitions cannot be less than 0\");\n  }\n  if (subdivisions < 0) {\n    throw new DeveloperError(\n      \"options.subdivisions must be greater than or equal to zero.\"\n    );\n  }\n  if (\n    defined(options.offsetAttribute) &&\n    options.offsetAttribute === GeometryOffsetAttribute.TOP\n  ) {\n    throw new DeveloperError(\n      \"GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._radii = Cartesian3.clone(radii);\n  this._innerRadii = Cartesian3.clone(innerRadii);\n  this._minimumClock = minimumClock;\n  this._maximumClock = maximumClock;\n  this._minimumCone = minimumCone;\n  this._maximumCone = maximumCone;\n  this._stackPartitions = stackPartitions;\n  this._slicePartitions = slicePartitions;\n  this._subdivisions = subdivisions;\n  this._offsetAttribute = options.offsetAttribute;\n  this._workerName = \"createEllipsoidOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nEllipsoidOutlineGeometry.packedLength = 2 * Cartesian3.packedLength + 8;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {EllipsoidOutlineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nEllipsoidOutlineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required\");\n  }\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  Cartesian3.pack(value._radii, array, startingIndex);\n  startingIndex += Cartesian3.packedLength;\n\n  Cartesian3.pack(value._innerRadii, array, startingIndex);\n  startingIndex += Cartesian3.packedLength;\n\n  array[startingIndex++] = value._minimumClock;\n  array[startingIndex++] = value._maximumClock;\n  array[startingIndex++] = value._minimumCone;\n  array[startingIndex++] = value._maximumCone;\n  array[startingIndex++] = value._stackPartitions;\n  array[startingIndex++] = value._slicePartitions;\n  array[startingIndex++] = value._subdivisions;\n  array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n  return array;\n};\n\nconst scratchRadii = new Cartesian3();\nconst scratchInnerRadii = new Cartesian3();\nconst scratchOptions = {\n  radii: scratchRadii,\n  innerRadii: scratchInnerRadii,\n  minimumClock: undefined,\n  maximumClock: undefined,\n  minimumCone: undefined,\n  maximumCone: undefined,\n  stackPartitions: undefined,\n  slicePartitions: undefined,\n  subdivisions: undefined,\n  offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {EllipsoidOutlineGeometry} [result] The object into which to store the result.\n * @returns {EllipsoidOutlineGeometry} The modified result parameter or a new EllipsoidOutlineGeometry instance if one was not provided.\n */\nEllipsoidOutlineGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const radii = Cartesian3.unpack(array, startingIndex, scratchRadii);\n  startingIndex += Cartesian3.packedLength;\n\n  const innerRadii = Cartesian3.unpack(array, startingIndex, scratchInnerRadii);\n  startingIndex += Cartesian3.packedLength;\n\n  const minimumClock = array[startingIndex++];\n  const maximumClock = array[startingIndex++];\n  const minimumCone = array[startingIndex++];\n  const maximumCone = array[startingIndex++];\n  const stackPartitions = array[startingIndex++];\n  const slicePartitions = array[startingIndex++];\n  const subdivisions = array[startingIndex++];\n  const offsetAttribute = array[startingIndex];\n\n  if (!defined(result)) {\n    scratchOptions.minimumClock = minimumClock;\n    scratchOptions.maximumClock = maximumClock;\n    scratchOptions.minimumCone = minimumCone;\n    scratchOptions.maximumCone = maximumCone;\n    scratchOptions.stackPartitions = stackPartitions;\n    scratchOptions.slicePartitions = slicePartitions;\n    scratchOptions.subdivisions = subdivisions;\n    scratchOptions.offsetAttribute =\n      offsetAttribute === -1 ? undefined : offsetAttribute;\n    return new EllipsoidOutlineGeometry(scratchOptions);\n  }\n\n  result._radii = Cartesian3.clone(radii, result._radii);\n  result._innerRadii = Cartesian3.clone(innerRadii, result._innerRadii);\n  result._minimumClock = minimumClock;\n  result._maximumClock = maximumClock;\n  result._minimumCone = minimumCone;\n  result._maximumCone = maximumCone;\n  result._stackPartitions = stackPartitions;\n  result._slicePartitions = slicePartitions;\n  result._subdivisions = subdivisions;\n  result._offsetAttribute =\n    offsetAttribute === -1 ? undefined : offsetAttribute;\n\n  return result;\n};\n\n/**\n * Computes the geometric representation of an outline of an ellipsoid, including its vertices, indices, and a bounding sphere.\n *\n * @param {EllipsoidOutlineGeometry} ellipsoidGeometry A description of the ellipsoid outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nEllipsoidOutlineGeometry.createGeometry = function (ellipsoidGeometry) {\n  const radii = ellipsoidGeometry._radii;\n  if (radii.x <= 0 || radii.y <= 0 || radii.z <= 0) {\n    return;\n  }\n\n  const innerRadii = ellipsoidGeometry._innerRadii;\n  if (innerRadii.x <= 0 || innerRadii.y <= 0 || innerRadii.z <= 0) {\n    return;\n  }\n\n  const minimumClock = ellipsoidGeometry._minimumClock;\n  const maximumClock = ellipsoidGeometry._maximumClock;\n  const minimumCone = ellipsoidGeometry._minimumCone;\n  const maximumCone = ellipsoidGeometry._maximumCone;\n  const subdivisions = ellipsoidGeometry._subdivisions;\n  const ellipsoid = Ellipsoid.fromCartesian3(radii);\n\n  // Add an extra slice and stack to remain consistent with EllipsoidGeometry\n  let slicePartitions = ellipsoidGeometry._slicePartitions + 1;\n  let stackPartitions = ellipsoidGeometry._stackPartitions + 1;\n\n  slicePartitions = Math.round(\n    (slicePartitions * Math.abs(maximumClock - minimumClock)) /\n      CesiumMath.TWO_PI\n  );\n  stackPartitions = Math.round(\n    (stackPartitions * Math.abs(maximumCone - minimumCone)) / CesiumMath.PI\n  );\n\n  if (slicePartitions < 2) {\n    slicePartitions = 2;\n  }\n  if (stackPartitions < 2) {\n    stackPartitions = 2;\n  }\n\n  let extraIndices = 0;\n  let vertexMultiplier = 1.0;\n  const hasInnerSurface =\n    innerRadii.x !== radii.x ||\n    innerRadii.y !== radii.y ||\n    innerRadii.z !== radii.z;\n  let isTopOpen = false;\n  let isBotOpen = false;\n  if (hasInnerSurface) {\n    vertexMultiplier = 2.0;\n    // Add 2x slicePartitions to connect the top/bottom of the outer to\n    // the top/bottom of the inner\n    if (minimumCone > 0.0) {\n      isTopOpen = true;\n      extraIndices += slicePartitions;\n    }\n    if (maximumCone < Math.PI) {\n      isBotOpen = true;\n      extraIndices += slicePartitions;\n    }\n  }\n\n  const vertexCount =\n    subdivisions * vertexMultiplier * (stackPartitions + slicePartitions);\n  const positions = new Float64Array(vertexCount * 3);\n\n  // Multiply by two because two points define each line segment\n  const numIndices =\n    2 *\n    (vertexCount +\n      extraIndices -\n      (slicePartitions + stackPartitions) * vertexMultiplier);\n  const indices = IndexDatatype.createTypedArray(vertexCount, numIndices);\n\n  let i;\n  let j;\n  let theta;\n  let phi;\n  let index = 0;\n\n  // Calculate sin/cos phi\n  const sinPhi = new Array(stackPartitions);\n  const cosPhi = new Array(stackPartitions);\n  for (i = 0; i < stackPartitions; i++) {\n    phi =\n      minimumCone + (i * (maximumCone - minimumCone)) / (stackPartitions - 1);\n    sinPhi[i] = sin(phi);\n    cosPhi[i] = cos(phi);\n  }\n\n  // Calculate sin/cos theta\n  const sinTheta = new Array(subdivisions);\n  const cosTheta = new Array(subdivisions);\n  for (i = 0; i < subdivisions; i++) {\n    theta =\n      minimumClock + (i * (maximumClock - minimumClock)) / (subdivisions - 1);\n    sinTheta[i] = sin(theta);\n    cosTheta[i] = cos(theta);\n  }\n\n  // Calculate the latitude lines on the outer surface\n  for (i = 0; i < stackPartitions; i++) {\n    for (j = 0; j < subdivisions; j++) {\n      positions[index++] = radii.x * sinPhi[i] * cosTheta[j];\n      positions[index++] = radii.y * sinPhi[i] * sinTheta[j];\n      positions[index++] = radii.z * cosPhi[i];\n    }\n  }\n\n  // Calculate the latitude lines on the inner surface\n  if (hasInnerSurface) {\n    for (i = 0; i < stackPartitions; i++) {\n      for (j = 0; j < subdivisions; j++) {\n        positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];\n        positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];\n        positions[index++] = innerRadii.z * cosPhi[i];\n      }\n    }\n  }\n\n  // Calculate sin/cos phi\n  sinPhi.length = subdivisions;\n  cosPhi.length = subdivisions;\n  for (i = 0; i < subdivisions; i++) {\n    phi = minimumCone + (i * (maximumCone - minimumCone)) / (subdivisions - 1);\n    sinPhi[i] = sin(phi);\n    cosPhi[i] = cos(phi);\n  }\n\n  // Calculate sin/cos theta for each slice partition\n  sinTheta.length = slicePartitions;\n  cosTheta.length = slicePartitions;\n  for (i = 0; i < slicePartitions; i++) {\n    theta =\n      minimumClock +\n      (i * (maximumClock - minimumClock)) / (slicePartitions - 1);\n    sinTheta[i] = sin(theta);\n    cosTheta[i] = cos(theta);\n  }\n\n  // Calculate the longitude lines on the outer surface\n  for (i = 0; i < subdivisions; i++) {\n    for (j = 0; j < slicePartitions; j++) {\n      positions[index++] = radii.x * sinPhi[i] * cosTheta[j];\n      positions[index++] = radii.y * sinPhi[i] * sinTheta[j];\n      positions[index++] = radii.z * cosPhi[i];\n    }\n  }\n\n  // Calculate the longitude lines on the inner surface\n  if (hasInnerSurface) {\n    for (i = 0; i < subdivisions; i++) {\n      for (j = 0; j < slicePartitions; j++) {\n        positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];\n        positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];\n        positions[index++] = innerRadii.z * cosPhi[i];\n      }\n    }\n  }\n\n  // Create indices for the latitude lines\n  index = 0;\n  for (i = 0; i < stackPartitions * vertexMultiplier; i++) {\n    const topOffset = i * subdivisions;\n    for (j = 0; j < subdivisions - 1; j++) {\n      indices[index++] = topOffset + j;\n      indices[index++] = topOffset + j + 1;\n    }\n  }\n\n  // Create indices for the outer longitude lines\n  let offset = stackPartitions * subdivisions * vertexMultiplier;\n  for (i = 0; i < slicePartitions; i++) {\n    for (j = 0; j < subdivisions - 1; j++) {\n      indices[index++] = offset + i + j * slicePartitions;\n      indices[index++] = offset + i + (j + 1) * slicePartitions;\n    }\n  }\n\n  // Create indices for the inner longitude lines\n  if (hasInnerSurface) {\n    offset =\n      stackPartitions * subdivisions * vertexMultiplier +\n      slicePartitions * subdivisions;\n    for (i = 0; i < slicePartitions; i++) {\n      for (j = 0; j < subdivisions - 1; j++) {\n        indices[index++] = offset + i + j * slicePartitions;\n        indices[index++] = offset + i + (j + 1) * slicePartitions;\n      }\n    }\n  }\n\n  if (hasInnerSurface) {\n    let outerOffset = stackPartitions * subdivisions * vertexMultiplier;\n    let innerOffset = outerOffset + subdivisions * slicePartitions;\n    if (isTopOpen) {\n      // Draw lines from the top of the inner surface to the top of the outer surface\n      for (i = 0; i < slicePartitions; i++) {\n        indices[index++] = outerOffset + i;\n        indices[index++] = innerOffset + i;\n      }\n    }\n\n    if (isBotOpen) {\n      // Draw lines from the top of the inner surface to the top of the outer surface\n      outerOffset += subdivisions * slicePartitions - slicePartitions;\n      innerOffset += subdivisions * slicePartitions - slicePartitions;\n      for (i = 0; i < slicePartitions; i++) {\n        indices[index++] = outerOffset + i;\n        indices[index++] = innerOffset + i;\n      }\n    }\n  }\n\n  const attributes = new GeometryAttributes({\n    position: new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: positions,\n    }),\n  });\n\n  if (defined(ellipsoidGeometry._offsetAttribute)) {\n    const length = positions.length;\n    const offsetValue =\n      ellipsoidGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n        ? 0\n        : 1;\n    const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n    attributes.applyOffset = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 1,\n      values: applyOffset,\n    });\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: PrimitiveType.LINES,\n    boundingSphere: BoundingSphere.fromEllipsoid(ellipsoid),\n    offsetAttribute: ellipsoidGeometry._offsetAttribute,\n  });\n};\nexport default EllipsoidOutlineGeometry;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport EllipsoidOutlineGeometry from \"./EllipsoidOutlineGeometry.js\";\n\n/**\n * A description of the outline of a sphere.\n *\n * @alias SphereOutlineGeometry\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {number} [options.radius=1.0] The radius of the sphere.\n * @param {number} [options.stackPartitions=10] The count of stacks for the sphere (1 greater than the number of parallel lines).\n * @param {number} [options.slicePartitions=8] The count of slices for the sphere (Equal to the number of radial lines).\n * @param {number} [options.subdivisions=200] The number of points per line, determining the granularity of the curvature .\n *\n * @exception {DeveloperError} options.stackPartitions must be greater than or equal to one.\n * @exception {DeveloperError} options.slicePartitions must be greater than or equal to zero.\n * @exception {DeveloperError} options.subdivisions must be greater than or equal to zero.\n *\n * @example\n * const sphere = new Cesium.SphereOutlineGeometry({\n *   radius : 100.0,\n *   stackPartitions : 6,\n *   slicePartitions: 5\n * });\n * const geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere);\n */\nfunction SphereOutlineGeometry(options) {\n  const radius = defaultValue(options.radius, 1.0);\n  const radii = new Cartesian3(radius, radius, radius);\n  const ellipsoidOptions = {\n    radii: radii,\n    stackPartitions: options.stackPartitions,\n    slicePartitions: options.slicePartitions,\n    subdivisions: options.subdivisions,\n  };\n\n  this._ellipsoidGeometry = new EllipsoidOutlineGeometry(ellipsoidOptions);\n  this._workerName = \"createSphereOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nSphereOutlineGeometry.packedLength = EllipsoidOutlineGeometry.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {SphereOutlineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nSphereOutlineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  //>>includeEnd('debug');\n\n  return EllipsoidOutlineGeometry.pack(\n    value._ellipsoidGeometry,\n    array,\n    startingIndex\n  );\n};\n\nconst scratchEllipsoidGeometry = new EllipsoidOutlineGeometry();\nconst scratchOptions = {\n  radius: undefined,\n  radii: new Cartesian3(),\n  stackPartitions: undefined,\n  slicePartitions: undefined,\n  subdivisions: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {SphereOutlineGeometry} [result] The object into which to store the result.\n * @returns {SphereOutlineGeometry} The modified result parameter or a new SphereOutlineGeometry instance if one was not provided.\n */\nSphereOutlineGeometry.unpack = function (array, startingIndex, result) {\n  const ellipsoidGeometry = EllipsoidOutlineGeometry.unpack(\n    array,\n    startingIndex,\n    scratchEllipsoidGeometry\n  );\n  scratchOptions.stackPartitions = ellipsoidGeometry._stackPartitions;\n  scratchOptions.slicePartitions = ellipsoidGeometry._slicePartitions;\n  scratchOptions.subdivisions = ellipsoidGeometry._subdivisions;\n\n  if (!defined(result)) {\n    scratchOptions.radius = ellipsoidGeometry._radii.x;\n    return new SphereOutlineGeometry(scratchOptions);\n  }\n\n  Cartesian3.clone(ellipsoidGeometry._radii, scratchOptions.radii);\n  result._ellipsoidGeometry = new EllipsoidOutlineGeometry(scratchOptions);\n  return result;\n};\n\n/**\n * Computes the geometric representation of an outline of a sphere, including its vertices, indices, and a bounding sphere.\n *\n * @param {SphereOutlineGeometry} sphereGeometry A description of the sphere outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nSphereOutlineGeometry.createGeometry = function (sphereGeometry) {\n  return EllipsoidOutlineGeometry.createGeometry(\n    sphereGeometry._ellipsoidGeometry\n  );\n};\nexport default SphereOutlineGeometry;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport SphereOutlineGeometry from \"../Core/SphereOutlineGeometry.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\n\n/**\n * A tile bounding volume specified as a sphere.\n * @alias TileBoundingSphere\n * @constructor\n *\n * @param {Cartesian3} [center=Cartesian3.ZERO] The center of the bounding sphere.\n * @param {number} [radius=0.0] The radius of the bounding sphere.\n *\n * @private\n */\nfunction TileBoundingSphere(center, radius) {\n  if (radius === 0) {\n    radius = CesiumMath.EPSILON7;\n  }\n  this._boundingSphere = new BoundingSphere(center, radius);\n}\n\nObject.defineProperties(TileBoundingSphere.prototype, {\n  /**\n   * The center of the bounding sphere\n   *\n   * @memberof TileBoundingSphere.prototype\n   *\n   * @type {Cartesian3}\n   * @readonly\n   */\n  center: {\n    get: function () {\n      return this._boundingSphere.center;\n    },\n  },\n\n  /**\n   * The radius of the bounding sphere\n   *\n   * @memberof TileBoundingSphere.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  radius: {\n    get: function () {\n      return this._boundingSphere.radius;\n    },\n  },\n\n  /**\n   * The underlying bounding volume\n   *\n   * @memberof TileBoundingSphere.prototype\n   *\n   * @type {object}\n   * @readonly\n   */\n  boundingVolume: {\n    get: function () {\n      return this._boundingSphere;\n    },\n  },\n  /**\n   * The underlying bounding sphere\n   *\n   * @memberof TileBoundingSphere.prototype\n   *\n   * @type {BoundingSphere}\n   * @readonly\n   */\n  boundingSphere: {\n    get: function () {\n      return this._boundingSphere;\n    },\n  },\n});\n\n/**\n * Computes the distance between this bounding sphere and the camera attached to frameState.\n *\n * @param {FrameState} frameState The frameState to which the camera is attached.\n * @returns {number} The distance between the camera and the bounding sphere in meters. Returns 0 if the camera is inside the bounding volume.\n *\n */\nTileBoundingSphere.prototype.distanceToCamera = function (frameState) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"frameState\", frameState);\n  //>>includeEnd('debug');\n  const boundingSphere = this._boundingSphere;\n  return Math.max(\n    0.0,\n    Cartesian3.distance(boundingSphere.center, frameState.camera.positionWC) -\n      boundingSphere.radius\n  );\n};\n\n/**\n * Determines which side of a plane this sphere is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire sphere is on the side of the plane\n *                      the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is\n *                      on the opposite side, and {@link Intersect.INTERSECTING} if the sphere\n *                      intersects the plane.\n */\nTileBoundingSphere.prototype.intersectPlane = function (plane) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"plane\", plane);\n  //>>includeEnd('debug');\n  return BoundingSphere.intersectPlane(this._boundingSphere, plane);\n};\n\n/**\n * Update the bounding sphere after the tile is transformed.\n *\n * @param {Cartesian3} center The center of the bounding sphere.\n * @param {number} radius The radius of the bounding sphere.\n */\nTileBoundingSphere.prototype.update = function (center, radius) {\n  Cartesian3.clone(center, this._boundingSphere.center);\n  this._boundingSphere.radius = radius;\n};\n\n/**\n * Creates a debug primitive that shows the outline of the sphere.\n *\n * @param {Color} color The desired color of the primitive's mesh\n * @return {Primitive}\n */\nTileBoundingSphere.prototype.createDebugVolume = function (color) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"color\", color);\n  //>>includeEnd('debug');\n  const geometry = new SphereOutlineGeometry({\n    radius: this.radius,\n  });\n  const modelMatrix = Matrix4.fromTranslation(\n    this.center,\n    new Matrix4.clone(Matrix4.IDENTITY)\n  );\n  const instance = new GeometryInstance({\n    geometry: geometry,\n    id: \"outline\",\n    modelMatrix: modelMatrix,\n    attributes: {\n      color: ColorGeometryInstanceAttribute.fromColor(color),\n    },\n  });\n\n  return new Primitive({\n    geometryInstances: instance,\n    appearance: new PerInstanceColorAppearance({\n      translucent: false,\n      flat: true,\n    }),\n    asynchronous: false,\n  });\n};\nexport default TileBoundingSphere;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport BoxOutlineGeometry from \"../Core/BoxOutlineGeometry.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\n\nconst scratchU = new Cartesian3();\nconst scratchV = new Cartesian3();\nconst scratchW = new Cartesian3();\nconst scratchCartesian = new Cartesian3();\n\nfunction computeMissingVector(a, b, result) {\n  result = Cartesian3.cross(a, b, result);\n  const magnitude = Cartesian3.magnitude(result);\n  return Cartesian3.multiplyByScalar(\n    result,\n    CesiumMath.EPSILON7 / magnitude,\n    result\n  );\n}\n\nfunction findOrthogonalVector(a, result) {\n  const temp = Cartesian3.normalize(a, scratchCartesian);\n  const b = Cartesian3.equalsEpsilon(\n    temp,\n    Cartesian3.UNIT_X,\n    CesiumMath.EPSILON6\n  )\n    ? Cartesian3.UNIT_Y\n    : Cartesian3.UNIT_X;\n  return computeMissingVector(a, b, result);\n}\n\nfunction checkHalfAxes(halfAxes) {\n  let u = Matrix3.getColumn(halfAxes, 0, scratchU);\n  let v = Matrix3.getColumn(halfAxes, 1, scratchV);\n  let w = Matrix3.getColumn(halfAxes, 2, scratchW);\n\n  const uZero = Cartesian3.equals(u, Cartesian3.ZERO);\n  const vZero = Cartesian3.equals(v, Cartesian3.ZERO);\n  const wZero = Cartesian3.equals(w, Cartesian3.ZERO);\n\n  if (!uZero && !vZero && !wZero) {\n    return halfAxes;\n  }\n  if (uZero && vZero && wZero) {\n    halfAxes[0] = CesiumMath.EPSILON7;\n    halfAxes[4] = CesiumMath.EPSILON7;\n    halfAxes[8] = CesiumMath.EPSILON7;\n    return halfAxes;\n  }\n  if (uZero && !vZero && !wZero) {\n    u = computeMissingVector(v, w, u);\n  } else if (!uZero && vZero && !wZero) {\n    v = computeMissingVector(u, w, v);\n  } else if (!uZero && !vZero && wZero) {\n    w = computeMissingVector(v, u, w);\n  } else if (!uZero) {\n    v = findOrthogonalVector(u, v);\n    w = computeMissingVector(v, u, w);\n  } else if (!vZero) {\n    u = findOrthogonalVector(v, u);\n    w = computeMissingVector(v, u, w);\n  } else if (!wZero) {\n    u = findOrthogonalVector(w, u);\n    v = computeMissingVector(w, u, v);\n  }\n\n  Matrix3.setColumn(halfAxes, 0, u, halfAxes);\n  Matrix3.setColumn(halfAxes, 1, v, halfAxes);\n  Matrix3.setColumn(halfAxes, 2, w, halfAxes);\n\n  return halfAxes;\n}\n\n/**\n * A tile bounding volume specified as an oriented bounding box.\n * @alias TileOrientedBoundingBox\n * @constructor\n *\n * @param {Cartesian3} [center=Cartesian3.ZERO] The center of the box.\n * @param {Matrix3} [halfAxes=Matrix3.ZERO] The three orthogonal half-axes of the bounding box.\n *                                          Equivalently, the transformation matrix, to rotate and scale a 2x2x2\n *                                          cube centered at the origin.\n *\n * @private\n */\nfunction TileOrientedBoundingBox(center, halfAxes) {\n  halfAxes = checkHalfAxes(halfAxes);\n  this._orientedBoundingBox = new OrientedBoundingBox(center, halfAxes);\n  this._boundingSphere = BoundingSphere.fromOrientedBoundingBox(\n    this._orientedBoundingBox\n  );\n}\n\nObject.defineProperties(TileOrientedBoundingBox.prototype, {\n  /**\n   * The underlying bounding volume.\n   *\n   * @memberof TileOrientedBoundingBox.prototype\n   *\n   * @type {OrientedBoundingBox}\n   * @readonly\n   */\n  boundingVolume: {\n    get: function () {\n      return this._orientedBoundingBox;\n    },\n  },\n  /**\n   * The underlying bounding sphere.\n   *\n   * @memberof TileOrientedBoundingBox.prototype\n   *\n   * @type {BoundingSphere}\n   * @readonly\n   */\n  boundingSphere: {\n    get: function () {\n      return this._boundingSphere;\n    },\n  },\n});\n\n/**\n * Computes the distance between this bounding box and the camera attached to frameState.\n *\n * @param {FrameState} frameState The frameState to which the camera is attached.\n * @returns {number} The distance between the camera and the bounding box in meters. Returns 0 if the camera is inside the bounding volume.\n */\nTileOrientedBoundingBox.prototype.distanceToCamera = function (frameState) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"frameState\", frameState);\n  //>>includeEnd('debug');\n  return Math.sqrt(\n    this._orientedBoundingBox.distanceSquaredTo(frameState.camera.positionWC)\n  );\n};\n\n/**\n * Determines which side of a plane this box is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\n *                      the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\n *                      on the opposite side, and {@link Intersect.INTERSECTING} if the box\n *                      intersects the plane.\n */\nTileOrientedBoundingBox.prototype.intersectPlane = function (plane) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"plane\", plane);\n  //>>includeEnd('debug');\n  return this._orientedBoundingBox.intersectPlane(plane);\n};\n\n/**\n * Update the bounding box after the tile is transformed.\n *\n * @param {Cartesian3} center The center of the box.\n * @param {Matrix3} halfAxes The three orthogonal half-axes of the bounding box.\n *                           Equivalently, the transformation matrix, to rotate and scale a 2x2x2\n *                           cube centered at the origin.\n */\nTileOrientedBoundingBox.prototype.update = function (center, halfAxes) {\n  Cartesian3.clone(center, this._orientedBoundingBox.center);\n  halfAxes = checkHalfAxes(halfAxes);\n  Matrix3.clone(halfAxes, this._orientedBoundingBox.halfAxes);\n  BoundingSphere.fromOrientedBoundingBox(\n    this._orientedBoundingBox,\n    this._boundingSphere\n  );\n};\n\n/**\n * Creates a debug primitive that shows the outline of the box.\n *\n * @param {Color} color The desired color of the primitive's mesh\n * @return {Primitive}\n */\nTileOrientedBoundingBox.prototype.createDebugVolume = function (color) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"color\", color);\n  //>>includeEnd('debug');\n\n  const geometry = new BoxOutlineGeometry({\n    // Make a 2x2x2 cube\n    minimum: new Cartesian3(-1.0, -1.0, -1.0),\n    maximum: new Cartesian3(1.0, 1.0, 1.0),\n  });\n  const modelMatrix = Matrix4.fromRotationTranslation(\n    this.boundingVolume.halfAxes,\n    this.boundingVolume.center\n  );\n  const instance = new GeometryInstance({\n    geometry: geometry,\n    id: \"outline\",\n    modelMatrix: modelMatrix,\n    attributes: {\n      color: ColorGeometryInstanceAttribute.fromColor(color),\n    },\n  });\n\n  return new Primitive({\n    geometryInstances: instance,\n    appearance: new PerInstanceColorAppearance({\n      translucent: false,\n      flat: true,\n    }),\n    asynchronous: false,\n  });\n};\nexport default TileOrientedBoundingBox;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport CullingVolume from \"../Core/CullingVolume.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Request from \"../Core/Request.js\";\nimport RequestScheduler from \"../Core/RequestScheduler.js\";\nimport RequestState from \"../Core/RequestState.js\";\nimport RequestType from \"../Core/RequestType.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Cesium3DContentGroup from \"./Cesium3DContentGroup.js\";\nimport Cesium3DTileContentFactory from \"./Cesium3DTileContentFactory.js\";\nimport Cesium3DTileContentState from \"./Cesium3DTileContentState.js\";\nimport Cesium3DTileContentType from \"./Cesium3DTileContentType.js\";\nimport Cesium3DTileOptimizationHint from \"./Cesium3DTileOptimizationHint.js\";\nimport Cesium3DTilePass from \"./Cesium3DTilePass.js\";\nimport Cesium3DTileRefine from \"./Cesium3DTileRefine.js\";\nimport Empty3DTileContent from \"./Empty3DTileContent.js\";\nimport findContentMetadata from \"./findContentMetadata.js\";\nimport findGroupMetadata from \"./findGroupMetadata.js\";\nimport findTileMetadata from \"./findTileMetadata.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport Multiple3DTileContent from \"./Multiple3DTileContent.js\";\nimport BoundingVolumeSemantics from \"./BoundingVolumeSemantics.js\";\nimport preprocess3DTileContent from \"./preprocess3DTileContent.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport TileBoundingRegion from \"./TileBoundingRegion.js\";\nimport TileBoundingS2Cell from \"./TileBoundingS2Cell.js\";\nimport TileBoundingSphere from \"./TileBoundingSphere.js\";\nimport TileOrientedBoundingBox from \"./TileOrientedBoundingBox.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport VerticalExaggeration from \"../Core/VerticalExaggeration.js\";\n\n/**\n * A tile in a {@link Cesium3DTileset}.  When a tile is first created, its content is not loaded;\n * the content is loaded on-demand when needed based on the view.\n * <p>\n * Do not construct this directly, instead access tiles through {@link Cesium3DTileset#tileVisible}.\n * </p>\n *\n * @alias Cesium3DTile\n * @constructor\n * @param {Cesium3DTileset} tileset The tileset\n * @param {Resource} baseResource The base resource for the tileset\n * @param {object} header The JSON header for the tile\n * @param {Cesium3DTile} parent The parent tile of the new tile\n */\nfunction Cesium3DTile(tileset, baseResource, header, parent) {\n  this._tileset = tileset;\n  this._header = header;\n\n  const hasContentsArray = defined(header.contents);\n  const hasMultipleContents =\n    (hasContentsArray && header.contents.length > 1) ||\n    hasExtension(header, \"3DTILES_multiple_contents\");\n\n  // In the 1.0 schema, content is stored in tile.content instead of tile.contents\n  const contentHeader =\n    hasContentsArray && !hasMultipleContents\n      ? header.contents[0]\n      : header.content;\n\n  this._contentHeader = contentHeader;\n\n  /**\n   * The local transform of this tile.\n   * @type {Matrix4}\n   */\n  this.transform = defined(header.transform)\n    ? Matrix4.unpack(header.transform)\n    : Matrix4.clone(Matrix4.IDENTITY);\n\n  const parentTransform = defined(parent)\n    ? parent.computedTransform\n    : tileset.modelMatrix;\n  const computedTransform = Matrix4.multiply(\n    parentTransform,\n    this.transform,\n    new Matrix4()\n  );\n\n  const parentInitialTransform = defined(parent)\n    ? parent._initialTransform\n    : Matrix4.IDENTITY;\n  this._initialTransform = Matrix4.multiply(\n    parentInitialTransform,\n    this.transform,\n    new Matrix4()\n  );\n\n  /**\n   * The final computed transform of this tile.\n   * @type {Matrix4}\n   * @readonly\n   */\n  this.computedTransform = computedTransform;\n\n  /**\n   * When tile metadata is present (3D Tiles 1.1) or the <code>3DTILES_metadata</code> extension is used,\n   * this stores a {@link TileMetadata} object for accessing tile metadata.\n   *\n   * @type {TileMetadata}\n   * @readonly\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  this.metadata = findTileMetadata(tileset, header);\n\n  this._verticalExaggeration = 1.0;\n  this._verticalExaggerationRelativeHeight = 0.0;\n\n  // Important: tile metadata must be parsed before this line so that the\n  // metadata semantics TILE_BOUNDING_BOX, TILE_BOUNDING_REGION, or TILE_BOUNDING_SPHERE\n  // can override header.boundingVolume (if necessary)\n  this._boundingVolume = this.createBoundingVolume(\n    header.boundingVolume,\n    computedTransform\n  );\n  this._boundingVolume2D = undefined;\n\n  let contentBoundingVolume;\n\n  if (defined(contentHeader) && defined(contentHeader.boundingVolume)) {\n    // Non-leaf tiles may have a content bounding-volume, which is a tight-fit bounding volume\n    // around only the features in the tile.  This box is useful for culling for rendering,\n    // but not for culling for traversing the tree since it does not guarantee spatial coherence, i.e.,\n    // since it only bounds features in the tile, not the entire tile, children may be\n    // outside of this box.\n    contentBoundingVolume = this.createBoundingVolume(\n      contentHeader.boundingVolume,\n      computedTransform\n    );\n  }\n  this._contentBoundingVolume = contentBoundingVolume;\n  this._contentBoundingVolume2D = undefined;\n\n  let viewerRequestVolume;\n  if (defined(header.viewerRequestVolume)) {\n    viewerRequestVolume = this.createBoundingVolume(\n      header.viewerRequestVolume,\n      computedTransform\n    );\n  }\n  this._viewerRequestVolume = viewerRequestVolume;\n\n  /**\n   * The error, in meters, introduced if this tile is rendered and its children are not.\n   * This is used to compute screen space error, i.e., the error measured in pixels.\n   *\n   * @type {number}\n   * @readonly\n   */\n  this.geometricError = header.geometricError;\n  this._geometricError = header.geometricError;\n\n  if (!defined(this._geometricError)) {\n    this._geometricError = defined(parent)\n      ? parent._geometricError\n      : tileset._geometricError;\n    Cesium3DTile._deprecationWarning(\n      \"geometricErrorUndefined\",\n      \"Required property geometricError is undefined for this tile. Using parent's geometric error instead.\"\n    );\n  }\n\n  this.updateGeometricErrorScale();\n\n  let refine;\n  if (defined(header.refine)) {\n    if (header.refine === \"replace\" || header.refine === \"add\") {\n      Cesium3DTile._deprecationWarning(\n        \"lowercase-refine\",\n        `This tile uses a lowercase refine \"${\n          header.refine\n        }\". Instead use \"${header.refine.toUpperCase()}\".`\n      );\n    }\n    refine =\n      header.refine.toUpperCase() === \"REPLACE\"\n        ? Cesium3DTileRefine.REPLACE\n        : Cesium3DTileRefine.ADD;\n  } else if (defined(parent)) {\n    // Inherit from parent tile if omitted.\n    refine = parent.refine;\n  } else {\n    refine = Cesium3DTileRefine.REPLACE;\n  }\n\n  /**\n   * Specifies the type of refinement that is used when traversing this tile for rendering.\n   *\n   * @type {Cesium3DTileRefine}\n   * @readonly\n   * @private\n   */\n  this.refine = refine;\n\n  /**\n   * Gets the tile's children.\n   *\n   * @type {Cesium3DTile[]}\n   * @readonly\n   */\n  this.children = [];\n\n  /**\n   * This tile's parent or <code>undefined</code> if this tile is the root.\n   * <p>\n   * When a tile's content points to an external tileset JSON file, the external tileset's\n   * root tile's parent is not <code>undefined</code>; instead, the parent references\n   * the tile (with its content pointing to an external tileset JSON file) as if the two tilesets were merged.\n   * </p>\n   *\n   * @type {Cesium3DTile}\n   * @readonly\n   */\n  this.parent = parent;\n\n  let content;\n  let hasEmptyContent = false;\n  let contentState;\n  let contentResource;\n  let serverKey;\n\n  baseResource = Resource.createIfNeeded(baseResource);\n\n  if (hasMultipleContents) {\n    contentState = Cesium3DTileContentState.UNLOADED;\n    // Each content may have its own URI, but they all need to be resolved\n    // relative to the tileset, so the base resource is used.\n    contentResource = baseResource.clone();\n  } else if (defined(contentHeader)) {\n    let contentHeaderUri = contentHeader.uri;\n    if (defined(contentHeader.url)) {\n      Cesium3DTile._deprecationWarning(\n        \"contentUrl\",\n        'This tileset JSON uses the \"content.url\" property which has been deprecated. Use \"content.uri\" instead.'\n      );\n      contentHeaderUri = contentHeader.url;\n    }\n    if (contentHeaderUri === \"\") {\n      Cesium3DTile._deprecationWarning(\n        \"contentUriEmpty\",\n        \"content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead\"\n      );\n      content = new Empty3DTileContent(tileset, this);\n      hasEmptyContent = true;\n      contentState = Cesium3DTileContentState.READY;\n    } else {\n      contentState = Cesium3DTileContentState.UNLOADED;\n      contentResource = baseResource.getDerivedResource({\n        url: contentHeaderUri,\n      });\n      serverKey = RequestScheduler.getServerKey(\n        contentResource.getUrlComponent()\n      );\n    }\n  } else {\n    content = new Empty3DTileContent(tileset, this);\n    hasEmptyContent = true;\n    contentState = Cesium3DTileContentState.READY;\n  }\n\n  this._content = content;\n  this._contentResource = contentResource;\n  this._contentState = contentState;\n  this._expiredContent = undefined;\n\n  this._serverKey = serverKey;\n\n  /**\n   * When <code>true</code>, the tile has no content.\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  this.hasEmptyContent = hasEmptyContent;\n\n  /**\n   * When <code>true</code>, the tile's content points to an external tileset.\n   * <p>\n   * This is <code>false</code> until the tile's content is loaded.\n   * </p>\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  this.hasTilesetContent = false;\n\n  /**\n   * When <code>true</code>, the tile's content is an implicit tileset.\n   * <p>\n   * This is <code>false</code> until the tile's implicit content is loaded.\n   * </p>\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  this.hasImplicitContent = false;\n\n  /**\n   * When <code>true</code>, the tile contains content metadata from implicit tiling. This flag is set\n   * for tiles transcoded by <code>Implicit3DTileContent</code>.\n   * <p>\n   * This is <code>false</code> until the tile's content is loaded.\n   * </p>\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  this.hasImplicitContentMetadata = false;\n\n  /**\n   * When <code>true</code>, the tile has multiple contents, either in the tile JSON (3D Tiles 1.1)\n   * or via the <code>3DTILES_multiple_contents</code> extension.\n   *\n   * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_multiple_contents|3DTILES_multiple_contents extension}\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  this.hasMultipleContents = hasMultipleContents;\n\n  /**\n   * The node in the tileset's LRU cache, used to determine when to unload a tile's content.\n   *\n   * See {@link Cesium3DTilesetCache}\n   *\n   * @type {DoublyLinkedListNode}\n   * @readonly\n   *\n   * @private\n   */\n  this.cacheNode = undefined;\n\n  const expire = header.expire;\n  let expireDuration;\n  let expireDate;\n  if (defined(expire)) {\n    expireDuration = expire.duration;\n    if (defined(expire.date)) {\n      expireDate = JulianDate.fromIso8601(expire.date);\n    }\n  }\n\n  /**\n   * The time in seconds after the tile's content is ready when the content expires and new content is requested.\n   *\n   * @type {number}\n   */\n  this.expireDuration = expireDuration;\n\n  /**\n   * The date when the content expires and new content is requested.\n   *\n   * @type {JulianDate}\n   */\n  this.expireDate = expireDate;\n\n  /**\n   * The time when a style was last applied to this tile.\n   *\n   * @type {number}\n   *\n   * @private\n   */\n  this.lastStyleTime = 0.0;\n\n  /**\n   * Marks whether the tile's children bounds are fully contained within the tile's bounds\n   *\n   * @type {Cesium3DTileOptimizationHint}\n   *\n   * @private\n   */\n  this._optimChildrenWithinParent = Cesium3DTileOptimizationHint.NOT_COMPUTED;\n\n  /**\n   * Tracks if the tile's relationship with a ClippingPlaneCollection has changed with regards\n   * to the ClippingPlaneCollection's state.\n   *\n   * @type {boolean}\n   *\n   * @private\n   */\n  this.clippingPlanesDirty = false;\n\n  /**\n   * Tracks if the tile's request should be deferred until all non-deferred\n   * tiles load.\n   *\n   * @type {boolean}\n   *\n   * @private\n   */\n  this.priorityDeferred = false;\n\n  /**\n   * For implicit tiling, an ImplicitTileset object will be attached to a\n   * placeholder tile with either implicit tiling in the JSON (3D Tiles 1.1)\n   * or the <code>3DTILES_implicit_tiling</code> extension.\n   * This way the {@link Implicit3DTileContent} can access the tile later once the content is fetched.\n   *\n   * @type {ImplicitTileset|undefined}\n   *\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  this.implicitTileset = undefined;\n\n  /**\n   * For implicit tiling, the (level, x, y, [z]) coordinates within the\n   * implicit tileset are stored in the tile.\n   *\n   * @type {ImplicitTileCoordinates|undefined}\n   *\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  this.implicitCoordinates = undefined;\n\n  /**\n   * For implicit tiling, each transcoded tile will hold a weak reference to\n   * the {@link ImplicitSubtree}.\n   *\n   * @type {ImplicitSubtree|undefined}\n   *\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  this.implicitSubtree = undefined;\n\n  // Members that are updated every frame for tree traversal and rendering optimizations:\n  this._distanceToCamera = 0.0;\n  this._centerZDepth = 0.0;\n  this._screenSpaceError = 0.0;\n  this._screenSpaceErrorProgressiveResolution = 0.0; // The screen space error at a given screen height of tileset.progressiveResolutionHeightFraction * screenHeight\n  this._visibilityPlaneMask = 0;\n  this._visible = false;\n  this._inRequestVolume = false;\n\n  this._finalResolution = true;\n  this._depth = 0;\n  this._stackLength = 0;\n  this._selectionDepth = 0;\n\n  this._updatedVisibilityFrame = 0;\n  this._touchedFrame = 0;\n  this._visitedFrame = 0;\n  this._selectedFrame = 0;\n  this._requestedFrame = 0;\n  this._ancestorWithContent = undefined;\n  this._ancestorWithContentAvailable = undefined;\n  this._refines = false;\n  this._shouldSelect = false;\n  this._isClipped = true;\n  this._clippingPlanesState = 0; // encapsulates (_isClipped, clippingPlanes.enabled) and number/function\n  this._debugBoundingVolume = undefined;\n  this._debugContentBoundingVolume = undefined;\n  this._debugViewerRequestVolume = undefined;\n  this._debugColor = Color.fromRandom({ alpha: 1.0 });\n  this._debugColorizeTiles = false;\n\n  this._priority = 0.0; // The priority used for request sorting\n  this._priorityHolder = this; // Reference to the ancestor up the tree that holds the _foveatedFactor and _distanceToCamera for all tiles in the refinement chain.\n  this._priorityProgressiveResolution = false;\n  this._priorityProgressiveResolutionScreenSpaceErrorLeaf = false;\n  this._priorityReverseScreenSpaceError = 0.0;\n  this._foveatedFactor = 0.0;\n  this._wasMinPriorityChild = false; // Needed for knowing when to continue a refinement chain. Gets reset in updateTile in traversal and gets set in updateAndPushChildren in traversal.\n\n  this._loadTimestamp = new JulianDate();\n\n  this._commandsLength = 0;\n\n  this._color = undefined;\n  this._colorDirty = false;\n\n  this._request = undefined;\n}\n\n// This can be overridden for testing purposes\nCesium3DTile._deprecationWarning = deprecationWarning;\n\nObject.defineProperties(Cesium3DTile.prototype, {\n  /**\n   * The tileset containing this tile.\n   *\n   * @memberof Cesium3DTile.prototype\n   *\n   * @type {Cesium3DTileset}\n   * @readonly\n   */\n  tileset: {\n    get: function () {\n      return this._tileset;\n    },\n  },\n\n  /**\n   * The tile's content.  This represents the actual tile's payload,\n   * not the content's metadata in the tileset JSON file.\n   *\n   * @memberof Cesium3DTile.prototype\n   *\n   * @type {Cesium3DTileContent}\n   * @readonly\n   */\n  content: {\n    get: function () {\n      return this._content;\n    },\n  },\n\n  /**\n   * Get the tile's bounding volume.\n   *\n   * @memberof Cesium3DTile.prototype\n   *\n   * @type {TileBoundingVolume}\n   * @readonly\n   * @private\n   */\n  boundingVolume: {\n    get: function () {\n      return this._boundingVolume;\n    },\n  },\n\n  /**\n   * Get the bounding volume of the tile's contents.  This defaults to the\n   * tile's bounding volume when the content's bounding volume is\n   * <code>undefined</code>.\n   *\n   * @memberof Cesium3DTile.prototype\n   *\n   * @type {TileBoundingVolume}\n   * @readonly\n   * @private\n   */\n  contentBoundingVolume: {\n    get: function () {\n      return defaultValue(this._contentBoundingVolume, this._boundingVolume);\n    },\n  },\n\n  /**\n   * Get the bounding sphere derived from the tile's bounding volume.\n   *\n   * @memberof Cesium3DTile.prototype\n   *\n   * @type {BoundingSphere}\n   * @readonly\n   */\n  boundingSphere: {\n    get: function () {\n      return this._boundingVolume.boundingSphere;\n    },\n  },\n\n  /**\n   * Determines if the tile is visible within the current field of view\n   *\n   * @memberof Cesium3DTile.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  isVisible: {\n    get: function () {\n      return this._visible && this._inRequestVolume;\n    },\n  },\n\n  /**\n   * Returns the <code>extras</code> property in the tileset JSON for this tile, which contains application specific metadata.\n   * Returns <code>undefined</code> if <code>extras</code> does not exist.\n   *\n   * @memberof Cesium3DTile.prototype\n   *\n   * @type {object}\n   * @readonly\n   * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#specifying-extensions-and-application-specific-extras|Extras in the 3D Tiles specification.}\n   */\n  extras: {\n    get: function () {\n      return this._header.extras;\n    },\n  },\n\n  /**\n   * Gets or sets the tile's highlight color.\n   *\n   * @memberof Cesium3DTile.prototype\n   *\n   * @type {Color}\n   *\n   * @default {@link Color.WHITE}\n   *\n   * @private\n   */\n  color: {\n    get: function () {\n      if (!defined(this._color)) {\n        this._color = new Color();\n      }\n      return Color.clone(this._color);\n    },\n    set: function (value) {\n      this._color = Color.clone(value, this._color);\n      this._colorDirty = true;\n    },\n  },\n\n  /**\n   * Determines if the tile's content is renderable. <code>false</code> if the\n   * tile has empty content or if it points to an external tileset or implicit content\n   *\n   * @memberof Cesium3DTile.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  hasRenderableContent: {\n    get: function () {\n      return (\n        !this.hasEmptyContent &&\n        !this.hasTilesetContent &&\n        !this.hasImplicitContent\n      );\n    },\n  },\n\n  /**\n   * Determines if the tile has available content to render.  <code>true</code> if the tile's\n   * content is ready or if it has expired content that renders while new content loads; otherwise,\n   * <code>false</code>.\n   *\n   * @memberof Cesium3DTile.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  contentAvailable: {\n    get: function () {\n      return (\n        (this.contentReady && this.hasRenderableContent) ||\n        (defined(this._expiredContent) && !this.contentFailed)\n      );\n    },\n  },\n\n  /**\n   * Determines if the tile's content is ready. This is automatically <code>true</code> for\n   * tile's with empty content.\n   *\n   * @memberof Cesium3DTile.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  contentReady: {\n    get: function () {\n      return this._contentState === Cesium3DTileContentState.READY;\n    },\n  },\n\n  /**\n   * Determines if the tile's content has not be requested. <code>true</code> if tile's\n   * content has not be requested; otherwise, <code>false</code>.\n   *\n   * @memberof Cesium3DTile.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  contentUnloaded: {\n    get: function () {\n      return this._contentState === Cesium3DTileContentState.UNLOADED;\n    },\n  },\n\n  /**\n   * Determines if the tile has renderable content which is unloaded\n   *\n   * @memberof Cesium3DTile.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  hasUnloadedRenderableContent: {\n    get: function () {\n      return this.hasRenderableContent && this.contentUnloaded;\n    },\n  },\n\n  /**\n   * Determines if the tile's content is expired. <code>true</code> if tile's\n   * content is expired; otherwise, <code>false</code>.\n   *\n   * @memberof Cesium3DTile.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  contentExpired: {\n    get: function () {\n      return this._contentState === Cesium3DTileContentState.EXPIRED;\n    },\n  },\n\n  /**\n   * Determines if the tile's content failed to load.  <code>true</code> if the tile's\n   * content failed to load; otherwise, <code>false</code>.\n   *\n   * @memberof Cesium3DTile.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @private\n   */\n  contentFailed: {\n    get: function () {\n      return this._contentState === Cesium3DTileContentState.FAILED;\n    },\n  },\n\n  /**\n   * Returns the number of draw commands used by this tile.\n   *\n   * @readonly\n   *\n   * @private\n   */\n  commandsLength: {\n    get: function () {\n      return this._commandsLength;\n    },\n  },\n});\n\nconst scratchCartesian = new Cartesian3();\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @param {FrameState} frameState\n * @returns {Boolean}\n */\nfunction isPriorityDeferred(tile, frameState) {\n  const { tileset, boundingSphere } = tile;\n  const { radius, center } = boundingSphere;\n  const { camera } = frameState;\n\n  // If closest point on line is inside the sphere then set foveatedFactor to 0.\n  // Otherwise, the dot product is with the line from camera to the point on the sphere that is closest to the line.\n  const scaledCameraDirection = Cartesian3.multiplyByScalar(\n    camera.directionWC,\n    tile._centerZDepth,\n    scratchCartesian\n  );\n  const closestPointOnLine = Cartesian3.add(\n    camera.positionWC,\n    scaledCameraDirection,\n    scratchCartesian\n  );\n  // The distance from the camera's view direction to the tile.\n  const toLine = Cartesian3.subtract(\n    closestPointOnLine,\n    center,\n    scratchCartesian\n  );\n  const distanceToCenterLine = Cartesian3.magnitude(toLine);\n  const notTouchingSphere = distanceToCenterLine > radius;\n\n  // If camera's direction vector is inside the bounding sphere then consider\n  // this tile right along the line of sight and set _foveatedFactor to 0.\n  // Otherwise,_foveatedFactor is one minus the dot product of the camera's direction\n  // and the vector between the camera and the point on the bounding sphere closest to the view line.\n  if (notTouchingSphere) {\n    const toLineNormalized = Cartesian3.normalize(toLine, scratchCartesian);\n    const scaledToLine = Cartesian3.multiplyByScalar(\n      toLineNormalized,\n      radius,\n      scratchCartesian\n    );\n    const closestOnSphere = Cartesian3.add(\n      center,\n      scaledToLine,\n      scratchCartesian\n    );\n    const toClosestOnSphere = Cartesian3.subtract(\n      closestOnSphere,\n      camera.positionWC,\n      scratchCartesian\n    );\n    const toClosestOnSphereNormalize = Cartesian3.normalize(\n      toClosestOnSphere,\n      scratchCartesian\n    );\n    tile._foveatedFactor =\n      1.0 -\n      Math.abs(Cartesian3.dot(camera.directionWC, toClosestOnSphereNormalize));\n  } else {\n    tile._foveatedFactor = 0.0;\n  }\n\n  // Skip this feature if: non-skipLevelOfDetail and replace refine, if the foveated settings are turned off, if tile is progressive resolution and replace refine and skipLevelOfDetail (will help get rid of ancestor artifacts faster)\n  // Or if the tile is a preload of any kind\n  const replace = tile.refine === Cesium3DTileRefine.REPLACE;\n  const skipLevelOfDetail = tileset.isSkippingLevelOfDetail;\n  if (\n    (replace && !skipLevelOfDetail) ||\n    !tileset.foveatedScreenSpaceError ||\n    tileset.foveatedConeSize === 1.0 ||\n    (tile._priorityProgressiveResolution && replace && skipLevelOfDetail) ||\n    tileset._pass === Cesium3DTilePass.PRELOAD_FLIGHT ||\n    tileset._pass === Cesium3DTilePass.PRELOAD\n  ) {\n    return false;\n  }\n\n  const maximumFovatedFactor = 1.0 - Math.cos(camera.frustum.fov * 0.5); // 0.14 for fov = 60. NOTE very hard to defer vertically foveated tiles since max is based on fovy (which is fov). Lowering the 0.5 to a smaller fraction of the screen height will start to defer vertically foveated tiles.\n  const foveatedConeFactor = tileset.foveatedConeSize * maximumFovatedFactor;\n\n  // If it's inside the user-defined view cone, then it should not be deferred.\n  if (tile._foveatedFactor <= foveatedConeFactor) {\n    return false;\n  }\n\n  // Relax SSE based on how big the angle is between the tile and the edge of the foveated cone.\n  const range = maximumFovatedFactor - foveatedConeFactor;\n  const normalizedFoveatedFactor = CesiumMath.clamp(\n    (tile._foveatedFactor - foveatedConeFactor) / range,\n    0.0,\n    1.0\n  );\n  const sseRelaxation = tileset.foveatedInterpolationCallback(\n    tileset.foveatedMinimumScreenSpaceErrorRelaxation,\n    tileset.memoryAdjustedScreenSpaceError,\n    normalizedFoveatedFactor\n  );\n  const sse =\n    tile._screenSpaceError === 0.0 && defined(tile.parent)\n      ? tile.parent._screenSpaceError * 0.5\n      : tile._screenSpaceError;\n\n  return tileset.memoryAdjustedScreenSpaceError - sseRelaxation <= sse;\n}\n\nconst scratchJulianDate = new JulianDate();\n\n/**\n * Get the tile's screen space error.\n *\n * @private\n * @param {FrameState} frameState\n * @param {Boolean} useParentGeometricError\n * @param {number} progressiveResolutionHeightFraction\n */\nCesium3DTile.prototype.getScreenSpaceError = function (\n  frameState,\n  useParentGeometricError,\n  progressiveResolutionHeightFraction\n) {\n  const tileset = this._tileset;\n  const heightFraction = defaultValue(progressiveResolutionHeightFraction, 1.0);\n  const parentGeometricError = defined(this.parent)\n    ? this.parent.geometricError\n    : tileset._scaledGeometricError;\n  const geometricError = useParentGeometricError\n    ? parentGeometricError\n    : this.geometricError;\n  if (geometricError === 0.0) {\n    // Leaf tiles do not have any error so save the computation\n    return 0.0;\n  }\n  const { camera, context } = frameState;\n  let frustum = camera.frustum;\n  const width = context.drawingBufferWidth;\n  const height = context.drawingBufferHeight * heightFraction;\n  let error;\n  if (\n    frameState.mode === SceneMode.SCENE2D ||\n    frustum instanceof OrthographicFrustum\n  ) {\n    const offCenterFrustum = frustum.offCenterFrustum;\n    if (defined(offCenterFrustum)) {\n      frustum = offCenterFrustum;\n    }\n    const pixelSize =\n      Math.max(frustum.top - frustum.bottom, frustum.right - frustum.left) /\n      Math.max(width, height);\n    error = geometricError / pixelSize;\n  } else {\n    // Avoid divide by zero when viewer is inside the tile\n    const distance = Math.max(this._distanceToCamera, CesiumMath.EPSILON7);\n    const sseDenominator = frustum.sseDenominator;\n    error = (geometricError * height) / (distance * sseDenominator);\n    if (tileset.dynamicScreenSpaceError) {\n      const density = tileset._dynamicScreenSpaceErrorComputedDensity;\n      const factor = tileset.dynamicScreenSpaceErrorFactor;\n      const dynamicError = CesiumMath.fog(distance, density) * factor;\n      error -= dynamicError;\n    }\n  }\n\n  error /= frameState.pixelRatio;\n\n  return error;\n};\n\n/**\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {Cesium3DTile} tile\n * @returns {Boolean}\n */\nfunction isPriorityProgressiveResolution(tileset, tile) {\n  if (\n    tileset.progressiveResolutionHeightFraction <= 0.0 ||\n    tileset.progressiveResolutionHeightFraction > 0.5\n  ) {\n    return false;\n  }\n\n  const maximumScreenSpaceError = tileset.memoryAdjustedScreenSpaceError;\n  let isProgressiveResolutionTile =\n    tile._screenSpaceErrorProgressiveResolution > maximumScreenSpaceError; // Mark non-SSE leaves\n  tile._priorityProgressiveResolutionScreenSpaceErrorLeaf = false; // Needed for skipLOD\n  const parent = tile.parent;\n  const tilePasses =\n    tile._screenSpaceErrorProgressiveResolution <= maximumScreenSpaceError;\n  const parentFails =\n    defined(parent) &&\n    parent._screenSpaceErrorProgressiveResolution > maximumScreenSpaceError;\n  if (tilePasses && parentFails) {\n    // A progressive resolution SSE leaf, promote its priority as well\n    tile._priorityProgressiveResolutionScreenSpaceErrorLeaf = true;\n    isProgressiveResolutionTile = true;\n  }\n  return isProgressiveResolutionTile;\n}\n\n/**\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {Cesium3DTile} tile\n * @returns {number}\n */\nfunction getPriorityReverseScreenSpaceError(tileset, tile) {\n  const parent = tile.parent;\n  const useParentScreenSpaceError =\n    defined(parent) &&\n    (!tileset.isSkippingLevelOfDetail ||\n      tile._screenSpaceError === 0.0 ||\n      parent.hasTilesetContent ||\n      parent.hasImplicitContent);\n  const screenSpaceError = useParentScreenSpaceError\n    ? parent._screenSpaceError\n    : tile._screenSpaceError;\n  return tileset.root._screenSpaceError - screenSpaceError;\n}\n\n/**\n * Update the tile's visibility.\n *\n * @private\n * @param {FrameState} frameState\n */\nCesium3DTile.prototype.updateVisibility = function (frameState) {\n  const { parent, tileset } = this;\n  if (this._updatedVisibilityFrame === tileset._updatedVisibilityFrame) {\n    // The tile has already been updated for this frame\n    return;\n  }\n\n  const parentTransform = defined(parent)\n    ? parent.computedTransform\n    : tileset.modelMatrix;\n  const parentVisibilityPlaneMask = defined(parent)\n    ? parent._visibilityPlaneMask\n    : CullingVolume.MASK_INDETERMINATE;\n  this.updateTransform(parentTransform, frameState);\n  this._distanceToCamera = this.distanceToTile(frameState);\n  this._centerZDepth = this.distanceToTileCenter(frameState);\n  this._screenSpaceError = this.getScreenSpaceError(frameState, false);\n  this._screenSpaceErrorProgressiveResolution = this.getScreenSpaceError(\n    frameState,\n    false,\n    tileset.progressiveResolutionHeightFraction\n  );\n  this._visibilityPlaneMask = this.visibility(\n    frameState,\n    parentVisibilityPlaneMask\n  ); // Use parent's plane mask to speed up visibility test\n  this._visible = this._visibilityPlaneMask !== CullingVolume.MASK_OUTSIDE;\n  this._inRequestVolume = this.insideViewerRequestVolume(frameState);\n  this._priorityReverseScreenSpaceError = getPriorityReverseScreenSpaceError(\n    tileset,\n    this\n  );\n  this._priorityProgressiveResolution = isPriorityProgressiveResolution(\n    tileset,\n    this\n  );\n  this.priorityDeferred = isPriorityDeferred(this, frameState);\n\n  this._updatedVisibilityFrame = tileset._updatedVisibilityFrame;\n};\n\n/**\n * Update whether the tile has expired.\n *\n * @private\n */\nCesium3DTile.prototype.updateExpiration = function () {\n  if (\n    defined(this.expireDate) &&\n    this.contentReady &&\n    !this.hasEmptyContent &&\n    !this.hasMultipleContents\n  ) {\n    const now = JulianDate.now(scratchJulianDate);\n    if (JulianDate.lessThan(this.expireDate, now)) {\n      this._contentState = Cesium3DTileContentState.EXPIRED;\n      this._expiredContent = this._content;\n    }\n  }\n};\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n */\nfunction updateExpireDate(tile) {\n  if (!defined(tile.expireDuration)) {\n    return;\n  }\n  const expireDurationDate = JulianDate.now(scratchJulianDate);\n  JulianDate.addSeconds(\n    expireDurationDate,\n    tile.expireDuration,\n    expireDurationDate\n  );\n\n  if (defined(tile.expireDate)) {\n    if (JulianDate.lessThan(tile.expireDate, expireDurationDate)) {\n      JulianDate.clone(expireDurationDate, tile.expireDate);\n    }\n  } else {\n    tile.expireDate = JulianDate.clone(expireDurationDate);\n  }\n}\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @returns {Function}\n */\nfunction createPriorityFunction(tile) {\n  return function () {\n    return tile._priority;\n  };\n}\n\n/**\n * Requests the tile's content.\n * <p>\n * The request may not be made if the Cesium Request Scheduler can't prioritize it.\n * </p>\n *\n * @return {Promise<Cesium3DTileContent>|undefined} A promise that resolves when the request completes, or undefined if there is no request needed, or the request cannot be scheduled.\n * @private\n */\nCesium3DTile.prototype.requestContent = function () {\n  // empty contents don't require any HTTP requests\n  if (this.hasEmptyContent) {\n    return;\n  }\n\n  if (this.hasMultipleContents) {\n    return requestMultipleContents(this);\n  }\n\n  return requestSingleContent(this);\n};\n\n/**\n * Multiple {@link Cesium3DTileContent}s are allowed within a single tile either through\n * the tile JSON (3D Tiles 1.1) or the <code>3DTILES_multiple_contents</code> extension.\n * Due to differences in request scheduling, this is handled separately.\n * <p>\n * This implementation of multiple contents does not\n * support tile expiry like requestSingleContent does. If this changes,\n * note that the resource.setQueryParameters() details must go inside {@link Multiple3DTileContent} since that is per-request.\n * </p>\n *\n * @private\n * @param {Cesium3DTile} tile\n * @returns {Promise<Cesium3DTileContent>|Promise<undefined>|undefined} A promise that resolves to the tile content once loaded, or a promise that resolves to undefined if the request was cancelled mid-flight, or undefined if the request cannot be scheduled this frame\n */\nfunction requestMultipleContents(tile) {\n  let multipleContents = tile._content;\n  const tileset = tile._tileset;\n\n  if (!defined(multipleContents)) {\n    // Create the content object immediately, it will handle scheduling\n    // requests for inner contents.\n    const contentsJson = hasExtension(tile._header, \"3DTILES_multiple_contents\")\n      ? tile._header.extensions[\"3DTILES_multiple_contents\"]\n      : tile._header;\n\n    multipleContents = new Multiple3DTileContent(\n      tileset,\n      tile,\n      tile._contentResource.clone(),\n      contentsJson\n    );\n    tile._content = multipleContents;\n  }\n\n  const promise = multipleContents.requestInnerContents();\n\n  if (!defined(promise)) {\n    // Request could not all be scheduled this frame\n    return;\n  }\n\n  tile._contentState = Cesium3DTileContentState.LOADING;\n  return promise\n    .then((content) => {\n      if (tile.isDestroyed()) {\n        // Tile is unloaded before the content can process\n        return;\n      }\n\n      // Tile was canceled, try again later\n      if (!defined(content)) {\n        return;\n      }\n\n      tile._contentState = Cesium3DTileContentState.PROCESSING;\n      return multipleContents;\n    })\n    .catch((error) => {\n      if (tile.isDestroyed()) {\n        // Tile is unloaded before the content can process\n        return;\n      }\n\n      tile._contentState = Cesium3DTileContentState.FAILED;\n      throw error;\n    });\n}\n\nasync function processArrayBuffer(\n  tile,\n  tileset,\n  request,\n  expired,\n  requestPromise\n) {\n  const previousState = tile._contentState;\n  tile._contentState = Cesium3DTileContentState.LOADING;\n  ++tileset.statistics.numberOfPendingRequests;\n\n  let arrayBuffer;\n  try {\n    arrayBuffer = await requestPromise;\n  } catch (error) {\n    --tileset.statistics.numberOfPendingRequests;\n    if (tile.isDestroyed()) {\n      // Tile is unloaded before the content can process\n      return;\n    }\n\n    if (request.cancelled || request.state === RequestState.CANCELLED) {\n      // Cancelled due to low priority - try again later.\n      tile._contentState = previousState;\n      ++tileset.statistics.numberOfAttemptedRequests;\n      return;\n    }\n\n    tile._contentState = Cesium3DTileContentState.FAILED;\n    throw error;\n  }\n\n  if (tile.isDestroyed()) {\n    --tileset.statistics.numberOfPendingRequests;\n    // Tile is unloaded before the content can process\n    return;\n  }\n\n  if (request.cancelled || request.state === RequestState.CANCELLED) {\n    // Cancelled due to low priority - try again later.\n    tile._contentState = previousState;\n    --tileset.statistics.numberOfPendingRequests;\n    ++tileset.statistics.numberOfAttemptedRequests;\n    return;\n  }\n\n  try {\n    const content = await makeContent(tile, arrayBuffer);\n    --tileset.statistics.numberOfPendingRequests;\n\n    if (tile.isDestroyed()) {\n      // Tile is unloaded before the content can process\n      return;\n    }\n\n    if (expired) {\n      tile.expireDate = undefined;\n    }\n\n    tile._content = content;\n    tile._contentState = Cesium3DTileContentState.PROCESSING;\n\n    return content;\n  } catch (error) {\n    --tileset.statistics.numberOfPendingRequests;\n    if (tile.isDestroyed()) {\n      // Tile is unloaded before the content can process\n      return;\n    }\n\n    tile._contentState = Cesium3DTileContentState.FAILED;\n    throw error;\n  }\n}\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @returns {Promise<Cesium3DTileContent>|Promise<undefined>|undefined} A promise that resolves to the tile content once loaded; a promise that resolves to undefined if the tile was destroyed before processing can happen or the request was cancelled mid-flight; or undefined if the request cannot be scheduled this frame.\n */\nfunction requestSingleContent(tile) {\n  // it is important to clone here. The fetchArrayBuffer() below uses\n  // throttling, but other uses of the resources do not.\n  const resource = tile._contentResource.clone();\n  const expired = tile.contentExpired;\n  if (expired) {\n    // Append a query parameter of the tile expiration date to prevent caching\n    resource.setQueryParameters({\n      expired: tile.expireDate.toString(),\n    });\n  }\n\n  const request = new Request({\n    throttle: true,\n    throttleByServer: true,\n    type: RequestType.TILES3D,\n    priorityFunction: createPriorityFunction(tile),\n    serverKey: tile._serverKey,\n  });\n\n  tile._request = request;\n  resource.request = request;\n  const tileset = tile._tileset;\n  const promise = resource.fetchArrayBuffer();\n  if (!defined(promise)) {\n    ++tileset.statistics.numberOfAttemptedRequests;\n    return;\n  }\n\n  return processArrayBuffer(tile, tileset, request, expired, promise);\n}\n\n/**\n * Given a downloaded content payload, construct a {@link Cesium3DTileContent}.\n * <p>\n * This is only used for single contents.\n * </p>\n *\n * @param {Cesium3DTile} tile The tile\n * @param {ArrayBuffer} arrayBuffer The downloaded payload containing data for the content\n * @return {Promise<Cesium3DTileContent>} A content object\n * @private\n */\nasync function makeContent(tile, arrayBuffer) {\n  const preprocessed = preprocess3DTileContent(arrayBuffer);\n\n  // Vector and Geometry tile rendering do not support the skip LOD optimization.\n  const tileset = tile._tileset;\n  tileset._disableSkipLevelOfDetail =\n    tileset._disableSkipLevelOfDetail ||\n    preprocessed.contentType === Cesium3DTileContentType.GEOMETRY ||\n    preprocessed.contentType === Cesium3DTileContentType.VECTOR;\n\n  if (\n    preprocessed.contentType === Cesium3DTileContentType.IMPLICIT_SUBTREE ||\n    preprocessed.contentType === Cesium3DTileContentType.IMPLICIT_SUBTREE_JSON\n  ) {\n    tile.hasImplicitContent = true;\n  }\n\n  if (preprocessed.contentType === Cesium3DTileContentType.EXTERNAL_TILESET) {\n    tile.hasTilesetContent = true;\n  }\n\n  let content;\n  const contentFactory = Cesium3DTileContentFactory[preprocessed.contentType];\n  if (tile.isDestroyed()) {\n    return;\n  }\n\n  if (defined(preprocessed.binaryPayload)) {\n    content = await Promise.resolve(\n      contentFactory(\n        tileset,\n        tile,\n        tile._contentResource,\n        preprocessed.binaryPayload.buffer,\n        0\n      )\n    );\n  } else {\n    // JSON formats\n    content = await Promise.resolve(\n      contentFactory(\n        tileset,\n        tile,\n        tile._contentResource,\n        preprocessed.jsonPayload\n      )\n    );\n  }\n\n  const contentHeader = tile._contentHeader;\n\n  if (tile.hasImplicitContentMetadata) {\n    const subtree = tile.implicitSubtree;\n    const coordinates = tile.implicitCoordinates;\n    content.metadata = subtree.getContentMetadataView(coordinates, 0);\n  } else if (!tile.hasImplicitContent) {\n    content.metadata = findContentMetadata(tileset, contentHeader);\n  }\n\n  const groupMetadata = findGroupMetadata(tileset, contentHeader);\n  if (defined(groupMetadata)) {\n    content.group = new Cesium3DContentGroup({\n      metadata: groupMetadata,\n    });\n  }\n\n  return content;\n}\n\n/**\n * Cancel requests for the tile's contents. This is called when the tile\n * goes out of view.\n *\n * @private\n */\nCesium3DTile.prototype.cancelRequests = function () {\n  if (this.hasMultipleContents) {\n    this._content.cancelRequests();\n  } else {\n    this._request.cancel();\n  }\n};\n\n/**\n * Unloads the tile's content.\n *\n * @private\n */\nCesium3DTile.prototype.unloadContent = function () {\n  if (!this.hasRenderableContent) {\n    return;\n  }\n\n  this._content = this._content && this._content.destroy();\n  this._contentState = Cesium3DTileContentState.UNLOADED;\n\n  this.lastStyleTime = 0.0;\n  this.clippingPlanesDirty = this._clippingPlanesState === 0;\n  this._clippingPlanesState = 0;\n\n  this._debugColorizeTiles = false;\n\n  this._debugBoundingVolume =\n    this._debugBoundingVolume && this._debugBoundingVolume.destroy();\n  this._debugContentBoundingVolume =\n    this._debugContentBoundingVolume &&\n    this._debugContentBoundingVolume.destroy();\n  this._debugViewerRequestVolume =\n    this._debugViewerRequestVolume && this._debugViewerRequestVolume.destroy();\n};\n\nconst scratchProjectedBoundingSphere = new BoundingSphere();\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @param {FrameState} frameState\n * @returns {TileBoundingVolume}\n */\nfunction getBoundingVolume(tile, frameState) {\n  if (\n    frameState.mode !== SceneMode.SCENE3D &&\n    !defined(tile._boundingVolume2D)\n  ) {\n    const boundingSphere = tile._boundingVolume.boundingSphere;\n    const sphere = BoundingSphere.projectTo2D(\n      boundingSphere,\n      frameState.mapProjection,\n      scratchProjectedBoundingSphere\n    );\n    tile._boundingVolume2D = new TileBoundingSphere(\n      sphere.center,\n      sphere.radius\n    );\n  }\n\n  return frameState.mode !== SceneMode.SCENE3D\n    ? tile._boundingVolume2D\n    : tile._boundingVolume;\n}\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @param {FrameState} frameState\n * @returns {TileBoundingVolume}\n */\nfunction getContentBoundingVolume(tile, frameState) {\n  if (\n    frameState.mode !== SceneMode.SCENE3D &&\n    !defined(tile._contentBoundingVolume2D)\n  ) {\n    const boundingSphere = tile._contentBoundingVolume.boundingSphere;\n    const sphere = BoundingSphere.projectTo2D(\n      boundingSphere,\n      frameState.mapProjection,\n      scratchProjectedBoundingSphere\n    );\n    tile._contentBoundingVolume2D = new TileBoundingSphere(\n      sphere.center,\n      sphere.radius\n    );\n  }\n  return frameState.mode !== SceneMode.SCENE3D\n    ? tile._contentBoundingVolume2D\n    : tile._contentBoundingVolume;\n}\n\n/**\n * Determines whether the tile's bounding volume intersects the culling volume.\n *\n * @param {FrameState} frameState The frame state.\n * @param {number} parentVisibilityPlaneMask The parent's plane mask to speed up the visibility check.\n * @returns {number} A plane mask as described above in {@link CullingVolume#computeVisibilityWithPlaneMask}.\n *\n * @private\n */\nCesium3DTile.prototype.visibility = function (\n  frameState,\n  parentVisibilityPlaneMask\n) {\n  const cullingVolume = frameState.cullingVolume;\n  const boundingVolume = getBoundingVolume(this, frameState);\n\n  const tileset = this._tileset;\n  const clippingPlanes = tileset.clippingPlanes;\n  if (defined(clippingPlanes) && clippingPlanes.enabled) {\n    const intersection = clippingPlanes.computeIntersectionWithBoundingVolume(\n      boundingVolume,\n      tileset.clippingPlanesOriginMatrix\n    );\n    this._isClipped = intersection !== Intersect.INSIDE;\n    if (intersection === Intersect.OUTSIDE) {\n      return CullingVolume.MASK_OUTSIDE;\n    }\n  }\n\n  return cullingVolume.computeVisibilityWithPlaneMask(\n    boundingVolume,\n    parentVisibilityPlaneMask\n  );\n};\n\n/**\n * Assuming the tile's bounding volume intersects the culling volume, determines\n * whether the tile's content's bounding volume intersects the culling volume.\n *\n * @param {FrameState} frameState The frame state.\n * @returns {Intersect} The result of the intersection: the tile's content is completely outside, completely inside, or intersecting the culling volume.\n *\n * @private\n */\nCesium3DTile.prototype.contentVisibility = function (frameState) {\n  // Assumes the tile's bounding volume intersects the culling volume already, so\n  // just return Intersect.INSIDE if there is no content bounding volume.\n  if (!defined(this._contentBoundingVolume)) {\n    return Intersect.INSIDE;\n  }\n\n  if (this._visibilityPlaneMask === CullingVolume.MASK_INSIDE) {\n    // The tile's bounding volume is completely inside the culling volume so\n    // the content bounding volume must also be inside.\n    return Intersect.INSIDE;\n  }\n\n  // PERFORMANCE_IDEA: is it possible to burn less CPU on this test since we know the\n  // tile's (not the content's) bounding volume intersects the culling volume?\n  const cullingVolume = frameState.cullingVolume;\n  const boundingVolume = getContentBoundingVolume(this, frameState);\n\n  const tileset = this._tileset;\n  const clippingPlanes = tileset.clippingPlanes;\n  if (defined(clippingPlanes) && clippingPlanes.enabled) {\n    const intersection = clippingPlanes.computeIntersectionWithBoundingVolume(\n      boundingVolume,\n      tileset.clippingPlanesOriginMatrix\n    );\n    this._isClipped = intersection !== Intersect.INSIDE;\n    if (intersection === Intersect.OUTSIDE) {\n      return Intersect.OUTSIDE;\n    }\n  }\n\n  return cullingVolume.computeVisibility(boundingVolume);\n};\n\n/**\n * Computes the (potentially approximate) distance from the closest point of the tile's bounding volume to the camera.\n *\n * @param {FrameState} frameState The frame state.\n * @returns {number} The distance, in meters, or zero if the camera is inside the bounding volume.\n *\n * @private\n */\nCesium3DTile.prototype.distanceToTile = function (frameState) {\n  const boundingVolume = getBoundingVolume(this, frameState);\n  return boundingVolume.distanceToCamera(frameState);\n};\n\nconst scratchToTileCenter = new Cartesian3();\n\n/**\n * Computes the distance from the center of the tile's bounding volume to the camera's plane defined by its position and view direction.\n *\n * @param {FrameState} frameState The frame state.\n * @returns {number} The distance, in meters.\n *\n * @private\n */\nCesium3DTile.prototype.distanceToTileCenter = function (frameState) {\n  const tileBoundingVolume = getBoundingVolume(this, frameState);\n  const boundingVolume = tileBoundingVolume.boundingVolume; // Gets the underlying OrientedBoundingBox or BoundingSphere\n  const toCenter = Cartesian3.subtract(\n    boundingVolume.center,\n    frameState.camera.positionWC,\n    scratchToTileCenter\n  );\n  return Cartesian3.dot(frameState.camera.directionWC, toCenter);\n};\n\n/**\n * Checks if the camera is inside the viewer request volume.\n *\n * @param {FrameState} frameState The frame state.\n * @returns {boolean} Whether the camera is inside the volume.\n *\n * @private\n */\nCesium3DTile.prototype.insideViewerRequestVolume = function (frameState) {\n  const viewerRequestVolume = this._viewerRequestVolume;\n  return (\n    !defined(viewerRequestVolume) ||\n    viewerRequestVolume.distanceToCamera(frameState) === 0.0\n  );\n};\n\nconst scratchMatrix = new Matrix3();\nconst scratchScale = new Cartesian3();\nconst scratchHalfAxes = new Matrix3();\nconst scratchCenter = new Cartesian3();\nconst scratchRectangle = new Rectangle();\nconst scratchOrientedBoundingBox = new OrientedBoundingBox();\nconst scratchTransform = new Matrix4();\n\n/**\n * @private\n * @param {Array} box An array of 12 numbers that define an oriented bounding box\n * @param {Matrix4} transform\n * @param {TileBoundingVolume} [result]\n * @returns {TileOrientedBoundingBox}\n */\nfunction createBox(box, transform, result) {\n  let center = Cartesian3.fromElements(box[0], box[1], box[2], scratchCenter);\n  let halfAxes = Matrix3.fromArray(box, 3, scratchHalfAxes);\n\n  // Find the transformed center and halfAxes\n  center = Matrix4.multiplyByPoint(transform, center, center);\n  const rotationScale = Matrix4.getMatrix3(transform, scratchMatrix);\n  halfAxes = Matrix3.multiply(rotationScale, halfAxes, halfAxes);\n\n  if (defined(result)) {\n    result.update(center, halfAxes);\n    return result;\n  }\n  return new TileOrientedBoundingBox(center, halfAxes);\n}\n\n/**\n * @private\n * @param {Array} region An array of six numbers that define a bounding geographic region in EPSG:4979 coordinates with the order [west, south, east, north, minimum height, maximum height]\n * @param {Matrix4} transform\n * @param {Matrix4} initialTransform\n * @param {TileOrientedBoundingBox} [result]\n * @returns {TileOrientedBoundingBox}\n */\nfunction createBoxFromTransformedRegion(\n  region,\n  transform,\n  initialTransform,\n  result\n) {\n  const rectangle = Rectangle.unpack(region, 0, scratchRectangle);\n  const minimumHeight = region[4];\n  const maximumHeight = region[5];\n\n  const orientedBoundingBox = OrientedBoundingBox.fromRectangle(\n    rectangle,\n    minimumHeight,\n    maximumHeight,\n    Ellipsoid.WGS84,\n    scratchOrientedBoundingBox\n  );\n  let center = orientedBoundingBox.center;\n  let halfAxes = orientedBoundingBox.halfAxes;\n\n  // A region bounding volume is not transformed by the transform in the tileset JSON,\n  // but may be transformed by additional transforms applied in Cesium.\n  // This is why the transform is calculated as the difference between the initial transform and the current transform.\n  transform = Matrix4.multiplyTransformation(\n    transform,\n    Matrix4.inverseTransformation(initialTransform, scratchTransform),\n    scratchTransform\n  );\n  center = Matrix4.multiplyByPoint(transform, center, center);\n  const rotationScale = Matrix4.getMatrix3(transform, scratchMatrix);\n  halfAxes = Matrix3.multiply(rotationScale, halfAxes, halfAxes);\n\n  if (defined(result) && result instanceof TileOrientedBoundingBox) {\n    result.update(center, halfAxes);\n    return result;\n  }\n\n  return new TileOrientedBoundingBox(center, halfAxes);\n}\n\n/**\n * @private\n * @param {Array} region An array of six numbers that define a bounding geographic region in EPSG:4979 coordinates with the order [west, south, east, north, minimum height, maximum height]\n * @param {Matrix4} transform\n * @param {Matrix4} initialTransform\n * @param {TileBoundingVolume} [result]\n * @returns {TileBoundingVolume}\n */\nfunction createRegion(region, transform, initialTransform, result) {\n  if (\n    !Matrix4.equalsEpsilon(transform, initialTransform, CesiumMath.EPSILON8)\n  ) {\n    return createBoxFromTransformedRegion(\n      region,\n      transform,\n      initialTransform,\n      result\n    );\n  }\n\n  const rectangleRegion = Rectangle.unpack(region, 0, scratchRectangle);\n\n  if (defined(result)) {\n    result.rectangle = Rectangle.clone(rectangleRegion, result.rectangle);\n    result.minimumHeight = region[4];\n    result.maximumHeight = region[5];\n    // The TileBoundingRegion was already constructed with the default\n    // WGS84 ellipsoid, so keep it consistent when updating.\n    result.computeBoundingVolumes(Ellipsoid.WGS84);\n    return result;\n  }\n\n  return new TileBoundingRegion({\n    rectangle: rectangleRegion,\n    minimumHeight: region[4],\n    maximumHeight: region[5],\n  });\n}\n\n/**\n * @private\n * @param {Array} sphere An array of four numbers that define a bounding sphere\n * @param {Matrix4} transform\n * @param {TileBoundingVolume} [result]\n * @returns {TileBoundingSphere}\n */\nfunction createSphere(sphere, transform, result) {\n  let center = Cartesian3.fromElements(\n    sphere[0],\n    sphere[1],\n    sphere[2],\n    scratchCenter\n  );\n  let radius = sphere[3];\n\n  // Find the transformed center and radius\n  center = Matrix4.multiplyByPoint(transform, center, center);\n  const scale = Matrix4.getScale(transform, scratchScale);\n  const uniformScale = Cartesian3.maximumComponent(scale);\n  radius *= uniformScale;\n\n  if (defined(result)) {\n    result.update(center, radius);\n    return result;\n  }\n  return new TileBoundingSphere(center, radius);\n}\n\n/**\n * Create a bounding volume from the tile's bounding volume header.\n *\n * @param {object} boundingVolumeHeader The tile's bounding volume header.\n * @param {Matrix4} transform The transform to apply to the bounding volume.\n * @param {TileBoundingVolume} [result] The object onto which to store the result.\n *\n * @returns {TileBoundingVolume} The modified result parameter or a new TileBoundingVolume instance if none was provided.\n *\n * @private\n */\nCesium3DTile.prototype.createBoundingVolume = function (\n  boundingVolumeHeader,\n  transform,\n  result\n) {\n  // if explicit tile metadata includes TILE_BOUNDING_BOX, TILE_BOUNDING_REGION,\n  // or TILE_BOUNDING_SPHERE, override tile.boundingVolume.\n  const tileMetadata = this.metadata;\n  let metadataBoundingVolumeHeader;\n  if (defined(tileMetadata)) {\n    metadataBoundingVolumeHeader = BoundingVolumeSemantics.parseBoundingVolumeSemantic(\n      \"TILE\",\n      tileMetadata\n    );\n  }\n  if (defined(metadataBoundingVolumeHeader)) {\n    boundingVolumeHeader = metadataBoundingVolumeHeader;\n  }\n\n  if (!defined(boundingVolumeHeader)) {\n    throw new RuntimeError(\"boundingVolume must be defined\");\n  }\n\n  if (hasExtension(boundingVolumeHeader, \"3DTILES_bounding_volume_S2\")) {\n    return new TileBoundingS2Cell(\n      boundingVolumeHeader.extensions[\"3DTILES_bounding_volume_S2\"]\n    );\n  }\n\n  const { box, region, sphere } = boundingVolumeHeader;\n  if (defined(box)) {\n    const tileOrientedBoundingBox = createBox(box, transform, result);\n    if (this._verticalExaggeration !== 1.0) {\n      exaggerateBoundingBox(\n        tileOrientedBoundingBox,\n        this._verticalExaggeration,\n        this._verticalExaggerationRelativeHeight\n      );\n    }\n    return tileOrientedBoundingBox;\n  }\n  if (defined(region)) {\n    const tileBoundingVolume = createRegion(\n      region,\n      transform,\n      this._initialTransform,\n      result\n    );\n    if (this._verticalExaggeration === 1.0) {\n      return tileBoundingVolume;\n    }\n    if (tileBoundingVolume instanceof TileOrientedBoundingBox) {\n      exaggerateBoundingBox(\n        tileBoundingVolume,\n        this._verticalExaggeration,\n        this._verticalExaggerationRelativeHeight\n      );\n    } else {\n      tileBoundingVolume.minimumHeight = VerticalExaggeration.getHeight(\n        tileBoundingVolume.minimumHeight,\n        this._verticalExaggeration,\n        this._verticalExaggerationRelativeHeight\n      );\n      tileBoundingVolume.maximumHeight = VerticalExaggeration.getHeight(\n        tileBoundingVolume.maximumHeight,\n        this._verticalExaggeration,\n        this._verticalExaggerationRelativeHeight\n      );\n      tileBoundingVolume.computeBoundingVolumes(Ellipsoid.WGS84);\n    }\n    return tileBoundingVolume;\n  }\n  if (defined(sphere)) {\n    const tileBoundingSphere = createSphere(sphere, transform, result);\n    if (this._verticalExaggeration !== 1.0) {\n      const exaggeratedCenter = VerticalExaggeration.getPosition(\n        tileBoundingSphere.center,\n        Ellipsoid.WGS84,\n        this._verticalExaggeration,\n        this._verticalExaggerationRelativeHeight,\n        scratchCenter\n      );\n      const exaggeratedRadius =\n        tileBoundingSphere.radius * this._verticalExaggeration;\n      tileBoundingSphere.update(exaggeratedCenter, exaggeratedRadius);\n    }\n    return tileBoundingSphere;\n  }\n  throw new RuntimeError(\n    \"boundingVolume must contain a sphere, region, or box\"\n  );\n};\n\nconst scratchExaggeratedCorners = Cartesian3.unpackArray(\n  new Array(8 * 3).fill(0)\n);\n\n/**\n * Exaggerates the bounding box of a tile based on the provided exaggeration factors.\n *\n * @private\n * @param {TileOrientedBoundingBox} tileOrientedBoundingBox - The oriented bounding box of the tile.\n * @param {number} exaggeration - The exaggeration factor to apply to the tile's bounding box.\n * @param {number} exaggerationRelativeHeight - The height relative to which exaggeration will be applied.\n */\nfunction exaggerateBoundingBox(\n  tileOrientedBoundingBox,\n  exaggeration,\n  exaggerationRelativeHeight\n) {\n  const exaggeratedCorners = tileOrientedBoundingBox.boundingVolume\n    .computeCorners(scratchExaggeratedCorners)\n    .map((corner) =>\n      VerticalExaggeration.getPosition(\n        corner,\n        Ellipsoid.WGS84,\n        exaggeration,\n        exaggerationRelativeHeight,\n        corner\n      )\n    );\n  const exaggeratedBox = OrientedBoundingBox.fromPoints(\n    exaggeratedCorners,\n    scratchOrientedBoundingBox\n  );\n  tileOrientedBoundingBox.update(\n    exaggeratedBox.center,\n    exaggeratedBox.halfAxes\n  );\n}\n\n/**\n * Update the tile's transform. The transform is applied to the tile's bounding volumes.\n *\n * @private\n * @param {Matrix4} parentTransform\n * @param {FrameState} [frameState]\n */\nCesium3DTile.prototype.updateTransform = function (\n  parentTransform,\n  frameState\n) {\n  parentTransform = defaultValue(parentTransform, Matrix4.IDENTITY);\n  const computedTransform = Matrix4.multiplyTransformation(\n    parentTransform,\n    this.transform,\n    scratchTransform\n  );\n  const transformChanged = !Matrix4.equals(\n    computedTransform,\n    this.computedTransform\n  );\n  const exaggerationChanged =\n    defined(frameState) &&\n    (this._verticalExaggeration !== frameState.verticalExaggeration ||\n      this._verticalExaggerationRelativeHeight !==\n        frameState.verticalExaggerationRelativeHeight);\n\n  if (!transformChanged && !exaggerationChanged) {\n    return;\n  }\n  if (transformChanged) {\n    Matrix4.clone(computedTransform, this.computedTransform);\n  }\n  if (exaggerationChanged) {\n    this._verticalExaggeration = frameState.verticalExaggeration;\n    this._verticalExaggerationRelativeHeight =\n      frameState.verticalExaggerationRelativeHeight;\n  }\n\n  // Update the bounding volumes\n  const header = this._header;\n  const contentHeader = this._contentHeader;\n  this._boundingVolume = this.createBoundingVolume(\n    header.boundingVolume,\n    this.computedTransform,\n    this._boundingVolume\n  );\n  if (defined(this._contentBoundingVolume)) {\n    this._contentBoundingVolume = this.createBoundingVolume(\n      contentHeader.boundingVolume,\n      this.computedTransform,\n      this._contentBoundingVolume\n    );\n  }\n  if (defined(this._viewerRequestVolume)) {\n    this._viewerRequestVolume = this.createBoundingVolume(\n      header.viewerRequestVolume,\n      this.computedTransform,\n      this._viewerRequestVolume\n    );\n  }\n\n  this.updateGeometricErrorScale();\n\n  // Destroy the debug bounding volumes. They will be generated fresh.\n  this._debugBoundingVolume =\n    this._debugBoundingVolume && this._debugBoundingVolume.destroy();\n  this._debugContentBoundingVolume =\n    this._debugContentBoundingVolume &&\n    this._debugContentBoundingVolume.destroy();\n  this._debugViewerRequestVolume =\n    this._debugViewerRequestVolume && this._debugViewerRequestVolume.destroy();\n};\n\nCesium3DTile.prototype.updateGeometricErrorScale = function () {\n  const scale = Matrix4.getScale(this.computedTransform, scratchScale);\n  const uniformScale = Cartesian3.maximumComponent(scale);\n  this.geometricError = this._geometricError * uniformScale;\n\n  if (!defined(this.parent)) {\n    // Update the tileset's geometric error\n    const tileset = this._tileset;\n    tileset._scaledGeometricError = tileset._geometricError * uniformScale;\n  }\n};\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @param {Cesium3DTileset} tileset\n * @param {FrameState} frameState\n * @param {object} passOptions\n */\nfunction applyDebugSettings(tile, tileset, frameState, passOptions) {\n  if (!passOptions.isRender) {\n    return;\n  }\n\n  const hasContentBoundingVolume =\n    defined(tile._contentHeader) && defined(tile._contentHeader.boundingVolume);\n\n  const showVolume =\n    tileset.debugShowBoundingVolume ||\n    (tileset.debugShowContentBoundingVolume && !hasContentBoundingVolume);\n  if (showVolume) {\n    let color;\n    if (!tile._finalResolution) {\n      color = Color.YELLOW;\n    } else if (!tile.hasRenderableContent) {\n      color = Color.DARKGRAY;\n    } else {\n      color = Color.WHITE;\n    }\n    if (!defined(tile._debugBoundingVolume)) {\n      tile._debugBoundingVolume = tile._boundingVolume.createDebugVolume(color);\n    }\n    tile._debugBoundingVolume.update(frameState);\n    const attributes = tile._debugBoundingVolume.getGeometryInstanceAttributes(\n      \"outline\"\n    );\n    attributes.color = ColorGeometryInstanceAttribute.toValue(\n      color,\n      attributes.color\n    );\n  } else if (!showVolume && defined(tile._debugBoundingVolume)) {\n    tile._debugBoundingVolume = tile._debugBoundingVolume.destroy();\n  }\n\n  if (tileset.debugShowContentBoundingVolume && hasContentBoundingVolume) {\n    if (!defined(tile._debugContentBoundingVolume)) {\n      tile._debugContentBoundingVolume = tile._contentBoundingVolume.createDebugVolume(\n        Color.BLUE\n      );\n    }\n    tile._debugContentBoundingVolume.update(frameState);\n  } else if (\n    !tileset.debugShowContentBoundingVolume &&\n    defined(tile._debugContentBoundingVolume)\n  ) {\n    tile._debugContentBoundingVolume = tile._debugContentBoundingVolume.destroy();\n  }\n\n  if (\n    tileset.debugShowViewerRequestVolume &&\n    defined(tile._viewerRequestVolume)\n  ) {\n    if (!defined(tile._debugViewerRequestVolume)) {\n      tile._debugViewerRequestVolume = tile._viewerRequestVolume.createDebugVolume(\n        Color.YELLOW\n      );\n    }\n    tile._debugViewerRequestVolume.update(frameState);\n  } else if (\n    !tileset.debugShowViewerRequestVolume &&\n    defined(tile._debugViewerRequestVolume)\n  ) {\n    tile._debugViewerRequestVolume = tile._debugViewerRequestVolume.destroy();\n  }\n\n  const debugColorizeTilesOn =\n    (tileset.debugColorizeTiles && !tile._debugColorizeTiles) ||\n    defined(tileset._heatmap.tilePropertyName);\n  const debugColorizeTilesOff =\n    !tileset.debugColorizeTiles && tile._debugColorizeTiles;\n\n  if (debugColorizeTilesOn) {\n    tileset._heatmap.colorize(tile, frameState); // Skipped if tileset._heatmap.tilePropertyName is undefined\n    tile._debugColorizeTiles = true;\n    tile.color = tile._debugColor;\n  } else if (debugColorizeTilesOff) {\n    tile._debugColorizeTiles = false;\n    tile.color = Color.WHITE;\n  }\n\n  if (tile._colorDirty) {\n    tile._colorDirty = false;\n    tile._content.applyDebugSettings(true, tile._color);\n  }\n\n  if (debugColorizeTilesOff) {\n    tileset.makeStyleDirty(); // Re-apply style now that colorize is switched off\n  }\n}\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @param {Cesium3DTileset} tileset\n * @param {FrameState} frameState\n */\nfunction updateContent(tile, tileset, frameState) {\n  const expiredContent = tile._expiredContent;\n\n  // expired content is not supported for multiple contents\n  if (!tile.hasMultipleContents && defined(expiredContent)) {\n    if (!tile.contentReady) {\n      // Render the expired content while the content loads\n      try {\n        expiredContent.update(tileset, frameState);\n      } catch (error) {\n        // Eat error for expired content\n      }\n      return;\n    }\n\n    // New content is ready, destroy expired content\n    tile._expiredContent.destroy();\n    tile._expiredContent = undefined;\n  }\n\n  if (!defined(tile.content)) {\n    // Implicit placeholder tile\n    return;\n  }\n\n  try {\n    tile.content.update(tileset, frameState);\n  } catch (error) {\n    tile._contentState = Cesium3DTileContentState.FAILED;\n    throw error;\n  }\n}\n\n/**\n * Compute and compare ClippingPlanes state:\n *  - enabled-ness - are clipping planes enabled? is this tile clipped?\n *  - clipping plane count\n *  - clipping function (union v. intersection)\n\n * @private\n * @param {Cesium3DTile} tile\n * @param {Cesium3DTileset} tileset\n */\nfunction updateClippingPlanes(tile, tileset) {\n  const clippingPlanes = tileset.clippingPlanes;\n  let currentClippingPlanesState = 0;\n  if (defined(clippingPlanes) && tile._isClipped && clippingPlanes.enabled) {\n    currentClippingPlanesState = clippingPlanes.clippingPlanesState;\n  }\n  // If clippingPlaneState for tile changed, mark clippingPlanesDirty so content can update\n  if (currentClippingPlanesState !== tile._clippingPlanesState) {\n    tile._clippingPlanesState = currentClippingPlanesState;\n    tile.clippingPlanesDirty = true;\n  }\n}\n\n/**\n * Get the draw commands needed to render this tile.\n *\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {FrameState} frameState\n * @param {object} passOptions\n */\nCesium3DTile.prototype.update = function (tileset, frameState, passOptions) {\n  const { commandList } = frameState;\n  const commandStart = commandList.length;\n\n  updateClippingPlanes(this, tileset);\n  applyDebugSettings(this, tileset, frameState, passOptions);\n  updateContent(this, tileset, frameState);\n\n  const commandEnd = commandList.length;\n  this._commandsLength = commandEnd - commandStart;\n\n  for (let i = commandStart; i < commandEnd; ++i) {\n    const command = commandList[i];\n    const translucent = command.pass === Pass.TRANSLUCENT;\n    command.depthForTranslucentClassification = translucent;\n  }\n\n  this.clippingPlanesDirty = false; // reset after content update\n};\n\nconst scratchCommandList = [];\n\n/**\n * Processes the tile's content, e.g., create WebGL resources, to move from the PROCESSING to READY state.\n *\n * @param {Cesium3DTileset} tileset The tileset containing this tile.\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nCesium3DTile.prototype.process = function (tileset, frameState) {\n  if (!this.contentExpired && !this.contentReady && this._content.ready) {\n    updateExpireDate(this);\n\n    // Refresh style for expired content\n    this._selectedFrame = 0;\n    this.lastStyleTime = 0.0;\n\n    JulianDate.now(this._loadTimestamp);\n    this._contentState = Cesium3DTileContentState.READY;\n\n    if (!this.hasTilesetContent && !this.hasImplicitContent) {\n      // RESEARCH_IDEA: ability to unload tiles (without content) for an\n      // external tileset when all the tiles are unloaded.\n      tileset._statistics.incrementLoadCounts(this.content);\n      ++tileset._statistics.numberOfTilesWithContentReady;\n      ++tileset._statistics.numberOfLoadedTilesTotal;\n\n      // Add to the tile cache. Previously expired tiles are already in the cache and won't get re-added.\n      tileset._cache.add(this);\n    }\n  }\n\n  const savedCommandList = frameState.commandList;\n  frameState.commandList = scratchCommandList;\n\n  try {\n    this._content.update(tileset, frameState);\n  } catch (error) {\n    this._contentState = Cesium3DTileContentState.FAILED;\n    throw error;\n  }\n\n  scratchCommandList.length = 0;\n  frameState.commandList = savedCommandList;\n};\n\n/**\n * @private\n * @param {number} normalizedValue\n * @param {number} numberOfDigits\n * @param {number} leftShift\n * @returns {number}\n */\nfunction isolateDigits(normalizedValue, numberOfDigits, leftShift) {\n  const scaled = normalizedValue * Math.pow(10, numberOfDigits);\n  const integer = parseInt(scaled);\n  return integer * Math.pow(10, leftShift);\n}\n\n/**\n * @private\n * @param {number} value\n * @param {number} minimum\n * @param {number} maximum\n * @returns {number}\n */\nfunction priorityNormalizeAndClamp(value, minimum, maximum) {\n  // Subtract epsilon since we only want decimal digits present in the output.\n  return Math.max(\n    CesiumMath.normalize(value, minimum, maximum) - CesiumMath.EPSILON7,\n    0.0\n  );\n}\n\n/**\n * Sets the priority of the tile based on distance and depth\n * @private\n */\nCesium3DTile.prototype.updatePriority = function () {\n  const tileset = this.tileset;\n  const preferLeaves = tileset.preferLeaves;\n  const minimumPriority = tileset._minimumPriority;\n  const maximumPriority = tileset._maximumPriority;\n\n  // Combine priority systems together by mapping them into a base 10 number where each priority controls a specific set of digits in the number.\n  // For number priorities, map them to a 0.xxxxx number then left shift it up into a set number of digits before the decimal point. Chop of the fractional part then left shift again into the position it needs to go.\n  // For blending number priorities, normalize them to 0-1 and interpolate to get a combined 0-1 number, then proceed as normal.\n  // Booleans can just be 0 or 10^leftshift.\n  // Think of digits as penalties since smaller numbers are higher priority. If a tile has some large quantity or has a flag raised it's (usually) penalized for it, expressed as a higher number for the digit.\n  // Priority number format: preloadFlightDigits(1) | foveatedDeferDigits(1) | foveatedDigits(4) | preloadProgressiveResolutionDigits(1) | preferredSortingDigits(4) . depthDigits(the decimal digits)\n  // Certain flags like preferLeaves will flip / turn off certain digits to get desired load order.\n\n  // Setup leftShifts, digit counts, and scales (for booleans)\n  const digitsForANumber = 4;\n  const digitsForABoolean = 1;\n\n  const preferredSortingLeftShift = 0;\n  const preferredSortingDigitsCount = digitsForANumber;\n\n  const foveatedLeftShift =\n    preferredSortingLeftShift + preferredSortingDigitsCount;\n  const foveatedDigitsCount = digitsForANumber;\n\n  const preloadProgressiveResolutionLeftShift =\n    foveatedLeftShift + foveatedDigitsCount;\n  const preloadProgressiveResolutionDigitsCount = digitsForABoolean;\n  const preloadProgressiveResolutionScale = Math.pow(\n    10,\n    preloadProgressiveResolutionLeftShift\n  );\n\n  const foveatedDeferLeftShift =\n    preloadProgressiveResolutionLeftShift +\n    preloadProgressiveResolutionDigitsCount;\n  const foveatedDeferDigitsCount = digitsForABoolean;\n  const foveatedDeferScale = Math.pow(10, foveatedDeferLeftShift);\n\n  const preloadFlightLeftShift =\n    foveatedDeferLeftShift + foveatedDeferDigitsCount;\n  const preloadFlightScale = Math.pow(10, preloadFlightLeftShift);\n\n  // Compute the digits for each priority\n  let depthDigits = priorityNormalizeAndClamp(\n    this._depth,\n    minimumPriority.depth,\n    maximumPriority.depth\n  );\n  depthDigits = preferLeaves ? 1.0 - depthDigits : depthDigits;\n\n  // Map 0-1 then convert to digit. Include a distance sort when doing non-skipLOD and replacement refinement, helps things like non-skipLOD photogrammetry\n  const useDistance =\n    !tileset.isSkippingLevelOfDetail &&\n    this.refine === Cesium3DTileRefine.REPLACE;\n  const normalizedPreferredSorting = useDistance\n    ? priorityNormalizeAndClamp(\n        this._priorityHolder._distanceToCamera,\n        minimumPriority.distance,\n        maximumPriority.distance\n      )\n    : priorityNormalizeAndClamp(\n        this._priorityReverseScreenSpaceError,\n        minimumPriority.reverseScreenSpaceError,\n        maximumPriority.reverseScreenSpaceError\n      );\n  const preferredSortingDigits = isolateDigits(\n    normalizedPreferredSorting,\n    preferredSortingDigitsCount,\n    preferredSortingLeftShift\n  );\n\n  const preloadProgressiveResolutionDigits = this._priorityProgressiveResolution\n    ? 0\n    : preloadProgressiveResolutionScale;\n\n  const normalizedFoveatedFactor = priorityNormalizeAndClamp(\n    this._priorityHolder._foveatedFactor,\n    minimumPriority.foveatedFactor,\n    maximumPriority.foveatedFactor\n  );\n  const foveatedDigits = isolateDigits(\n    normalizedFoveatedFactor,\n    foveatedDigitsCount,\n    foveatedLeftShift\n  );\n\n  const foveatedDeferDigits = this.priorityDeferred ? foveatedDeferScale : 0;\n\n  const preloadFlightDigits =\n    tileset._pass === Cesium3DTilePass.PRELOAD_FLIGHT ? 0 : preloadFlightScale;\n\n  // Get the final base 10 number\n  this._priority =\n    depthDigits +\n    preferredSortingDigits +\n    preloadProgressiveResolutionDigits +\n    foveatedDigits +\n    foveatedDeferDigits +\n    preloadFlightDigits;\n};\n\n/**\n * @private\n */\nCesium3DTile.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * @private\n */\nCesium3DTile.prototype.destroy = function () {\n  // For the interval between new content being requested and downloaded, expiredContent === content, so don't destroy twice\n  this._content = this._content && this._content.destroy();\n  this._expiredContent =\n    this._expiredContent &&\n    !this._expiredContent.isDestroyed() &&\n    this._expiredContent.destroy();\n  this._debugBoundingVolume =\n    this._debugBoundingVolume && this._debugBoundingVolume.destroy();\n  this._debugContentBoundingVolume =\n    this._debugContentBoundingVolume &&\n    this._debugContentBoundingVolume.destroy();\n  this._debugViewerRequestVolume =\n    this._debugViewerRequestVolume && this._debugViewerRequestVolume.destroy();\n  return destroyObject(this);\n};\n\nexport default Cesium3DTile;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport MetadataEntity from \"./MetadataEntity.js\";\n\n/**\n * Metadata about a group of {@link Cesium3DTileContent}\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {string} options.id The ID of the group.\n * @param {object} options.group The group JSON object.\n * @param {MetadataClass} options.class The class that group metadata conforms to.\n *\n * @alias GroupMetadata\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction GroupMetadata(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const id = options.id;\n  const group = options.group;\n  const metadataClass = options.class;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.group\", group);\n  Check.typeOf.object(\"options.class\", metadataClass);\n  //>>includeEnd('debug');\n\n  const properties = defined(group.properties) ? group.properties : {};\n\n  this._class = metadataClass;\n  this._properties = properties;\n  this._id = id;\n  this._extras = group.extras;\n  this._extensions = group.extensions;\n}\n\nObject.defineProperties(GroupMetadata.prototype, {\n  /**\n   * The class that properties conform to.\n   *\n   * @memberof GroupMetadata.prototype\n   * @type {MetadataClass}\n   * @readonly\n   * @private\n   */\n  class: {\n    get: function () {\n      return this._class;\n    },\n  },\n\n  /**\n   * The ID of the group.\n   *\n   * @memberof GroupMetadata.prototype\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof GroupMetadata.prototype\n   * @type {*}\n   * @readonly\n   * @private\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof GroupMetadata.prototype\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\n/**\n * Returns whether the group has this property.\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {boolean} Whether the group has this property.\n * @private\n */\nGroupMetadata.prototype.hasProperty = function (propertyId) {\n  return MetadataEntity.hasProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Returns whether the group has a property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {boolean} Whether the group has a property with the given semantic.\n * @private\n */\nGroupMetadata.prototype.hasPropertyBySemantic = function (semantic) {\n  return MetadataEntity.hasPropertyBySemantic(\n    semantic,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {string[]} [results] An array into which to store the results.\n * @returns {string[]} The property IDs.\n * @private\n */\nGroupMetadata.prototype.getPropertyIds = function (results) {\n  return MetadataEntity.getPropertyIds(this._properties, this._class, results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the group does not have this property.\n * @private\n */\nGroupMetadata.prototype.getProperty = function (propertyId) {\n  return MetadataEntity.getProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nGroupMetadata.prototype.setProperty = function (propertyId, value) {\n  return MetadataEntity.setProperty(\n    propertyId,\n    value,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the group does not have this semantic.\n * @private\n */\nGroupMetadata.prototype.getPropertyBySemantic = function (semantic) {\n  return MetadataEntity.getPropertyBySemantic(\n    semantic,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nGroupMetadata.prototype.setPropertyBySemantic = function (semantic, value) {\n  return MetadataEntity.setPropertyBySemantic(\n    semantic,\n    value,\n    this._properties,\n    this._class\n  );\n};\n\nexport default GroupMetadata;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport MetadataEntity from \"./MetadataEntity.js\";\n\n/**\n * Metadata about the tileset.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.tileset The tileset metadata JSON object.\n * @param {MetadataClass} options.class The class that tileset metadata conforms to.\n *\n * @alias TilesetMetadata\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction TilesetMetadata(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const tileset = options.tileset;\n  const metadataClass = options.class;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.tileset\", tileset);\n  Check.typeOf.object(\"options.class\", metadataClass);\n  //>>includeEnd('debug');\n\n  const properties = defined(tileset.properties) ? tileset.properties : {};\n\n  this._class = metadataClass;\n  this._properties = properties;\n  this._extras = tileset.extras;\n  this._extensions = tileset.extensions;\n}\n\nObject.defineProperties(TilesetMetadata.prototype, {\n  /**\n   * The class that properties conform to.\n   *\n   * @memberof TilesetMetadata.prototype\n   * @type {MetadataClass}\n   * @readonly\n   * @private\n   */\n  class: {\n    get: function () {\n      return this._class;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof TilesetMetadata.prototype\n   * @type {*}\n   * @readonly\n   * @private\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof TilesetMetadata.prototype\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\n/**\n * Returns whether the tileset has this property.\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {boolean} Whether the tileset has this property.\n * @private\n */\nTilesetMetadata.prototype.hasProperty = function (propertyId) {\n  return MetadataEntity.hasProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Returns whether the tileset has a property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {boolean} Whether the tileset has a property with the given semantic.\n * @private\n */\nTilesetMetadata.prototype.hasPropertyBySemantic = function (semantic) {\n  return MetadataEntity.hasPropertyBySemantic(\n    semantic,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {string[]} [results] An array into which to store the results.\n * @returns {string[]} The property IDs.\n * @private\n */\nTilesetMetadata.prototype.getPropertyIds = function (results) {\n  return MetadataEntity.getPropertyIds(this._properties, this._class, results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the tileset does not have this property.\n * @private\n */\nTilesetMetadata.prototype.getProperty = function (propertyId) {\n  return MetadataEntity.getProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {string} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nTilesetMetadata.prototype.setProperty = function (propertyId, value) {\n  return MetadataEntity.setProperty(\n    propertyId,\n    value,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the tileset does not have this semantic.\n * @private\n */\nTilesetMetadata.prototype.getPropertyBySemantic = function (semantic) {\n  return MetadataEntity.getPropertyBySemantic(\n    semantic,\n    this._properties,\n    this._class\n  );\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {string} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nTilesetMetadata.prototype.setPropertyBySemantic = function (semantic, value) {\n  return MetadataEntity.setPropertyBySemantic(\n    semantic,\n    value,\n    this._properties,\n    this._class\n  );\n};\n\nexport default TilesetMetadata;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport GroupMetadata from \"./GroupMetadata.js\";\nimport TilesetMetadata from \"./TilesetMetadata.js\";\n\n/**\n * An object containing metadata about a 3D Tileset.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles.\n * </p>\n * <p>\n * This object represents the tileset JSON (3D Tiles 1.1) or the <code>3DTILES_metadata</code> object that contains\n * the schema ({@link MetadataSchema}), tileset metadata ({@link TilesetMetadata}), group metadata (dictionary of {@link GroupMetadata}), and metadata statistics (dictionary)\n * </p>\n *\n * @param {object} options Object with the following properties:\n * @param {object} options.metadataJson Either the tileset JSON (3D Tiles 1.1) or the <code>3DTILES_metadata</code> extension object that contains the tileset metadata.\n * @param {MetadataSchema} options.schema The parsed schema.\n *\n * @alias Cesium3DTilesetMetadata\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction Cesium3DTilesetMetadata(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const metadataJson = options.metadataJson;\n\n  // The calling code is responsible for loading the schema.\n  // This keeps metadata parsing synchronous.\n  const schema = options.schema;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.metadataJson\", metadataJson);\n  Check.typeOf.object(\"options.schema\", schema);\n  //>>includeEnd('debug');\n\n  // An older schema stored the tileset metadata in the \"tileset\" property.\n  const metadata = defaultValue(metadataJson.metadata, metadataJson.tileset);\n\n  let tileset;\n  if (defined(metadata)) {\n    tileset = new TilesetMetadata({\n      tileset: metadata,\n      class: schema.classes[metadata.class],\n    });\n  }\n\n  let groupIds = [];\n  const groups = [];\n  const groupsJson = metadataJson.groups;\n  if (Array.isArray(groupsJson)) {\n    const length = groupsJson.length;\n    for (let i = 0; i < length; i++) {\n      const group = groupsJson[i];\n      groups.push(\n        new GroupMetadata({\n          group: group,\n          class: schema.classes[group.class],\n        })\n      );\n    }\n  } else if (defined(groupsJson)) {\n    // An older version of group metadata stored groups in a dictionary\n    // instead of an array.\n    groupIds = Object.keys(groupsJson).sort();\n    const length = groupIds.length;\n    for (let i = 0; i < length; i++) {\n      const groupId = groupIds[i];\n      if (groupsJson.hasOwnProperty(groupId)) {\n        const group = groupsJson[groupId];\n        groups.push(\n          new GroupMetadata({\n            id: groupId,\n            group: groupsJson[groupId],\n            class: schema.classes[group.class],\n          })\n        );\n      }\n    }\n  }\n\n  this._schema = schema;\n  this._groups = groups;\n  this._groupIds = groupIds;\n  this._tileset = tileset;\n\n  this._statistics = metadataJson.statistics;\n  this._extras = metadataJson.extras;\n  this._extensions = metadataJson.extensions;\n}\n\nObject.defineProperties(Cesium3DTilesetMetadata.prototype, {\n  /**\n   * Schema containing classes and enums.\n   *\n   * @memberof Cesium3DTilesetMetadata.prototype\n   * @type {MetadataSchema}\n   * @readonly\n   * @private\n   */\n  schema: {\n    get: function () {\n      return this._schema;\n    },\n  },\n\n  /**\n   * Metadata about groups of content.\n   *\n   * @memberof Cesium3DTilesetMetadata.prototype\n   * @type {GroupMetadata[]}\n   * @readonly\n   * @private\n   */\n  groups: {\n    get: function () {\n      return this._groups;\n    },\n  },\n\n  /**\n   * The IDs of the group metadata in the corresponding groups dictionary.\n   * Only populated if using the legacy schema.\n   *\n   * @memberof Cesium3DTilesetMetadata.prototype\n   * @type {}\n   * @readonly\n   * @private\n   */\n  groupIds: {\n    get: function () {\n      return this._groupIds;\n    },\n  },\n\n  /**\n   * Metadata about the tileset as a whole.\n   *\n   * @memberof Cesium3DTilesetMetadata.prototype\n   * @type {TilesetMetadata}\n   * @readonly\n   * @private\n   */\n  tileset: {\n    get: function () {\n      return this._tileset;\n    },\n  },\n\n  /**\n   * Statistics about the metadata.\n   * <p>\n   * See the {@link https://github.com/CesiumGS/3d-tiles/blob/main/extensions/3DTILES_metadata/schema/statistics.schema.json|statistics schema reference}\n   * in the 3D Tiles spec for the full set of properties.\n   * </p>\n   *\n   * @memberof Cesium3DTilesetMetadata.prototype\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  statistics: {\n    get: function () {\n      return this._statistics;\n    },\n  },\n\n  /**\n   * Extra user-defined properties.\n   *\n   * @memberof Cesium3DTilesetMetadata.prototype\n   * @type {*}\n   * @readonly\n   * @private\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * An object containing extensions.\n   *\n   * @memberof Cesium3DTilesetMetadata.prototype\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n});\n\nexport default Cesium3DTilesetMetadata;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Cesium3DTileOptimizationHint from \"./Cesium3DTileOptimizationHint.js\";\nimport TileBoundingRegion from \"./TileBoundingRegion.js\";\nimport TileOrientedBoundingBox from \"./TileOrientedBoundingBox.js\";\n\n/**\n * Utility functions for computing optimization hints for a {@link Cesium3DTileset}.\n *\n * @namespace Cesium3DTileOptimizations\n *\n * @private\n */\nconst Cesium3DTileOptimizations = {};\n\nconst scratchAxis = new Cartesian3();\n\n/**\n * Evaluates support for the childrenWithinParent optimization. This is used to more tightly cull tilesets if\n * children bounds are fully contained within the parent. Currently, support for the optimization only works for\n * oriented bounding boxes, so both the child and parent tile must be either a {@link TileOrientedBoundingBox} or\n * {@link TileBoundingRegion}. The purpose of this check is to prevent use of a culling optimization when the child\n * bounds exceed those of the parent. If the child bounds are greater, it is more likely that the optimization will\n * waste CPU cycles. Bounding spheres are not supported for the reason that the child bounds can very often be\n * partially outside of the parent bounds.\n *\n * @param {Cesium3DTile} tile The tile to check.\n * @returns {boolean} Whether the childrenWithinParent optimization is supported.\n */\nCesium3DTileOptimizations.checkChildrenWithinParent = function (tile) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"tile\", tile);\n  //>>includeEnd('debug');\n\n  const children = tile.children;\n  const length = children.length;\n\n  // Check if the parent has an oriented bounding box.\n  const boundingVolume = tile.boundingVolume;\n  if (\n    boundingVolume instanceof TileOrientedBoundingBox ||\n    boundingVolume instanceof TileBoundingRegion\n  ) {\n    const orientedBoundingBox = boundingVolume._orientedBoundingBox;\n    tile._optimChildrenWithinParent =\n      Cesium3DTileOptimizationHint.USE_OPTIMIZATION;\n    for (let i = 0; i < length; ++i) {\n      const child = children[i];\n\n      // Check if the child has an oriented bounding box.\n      const childBoundingVolume = child.boundingVolume;\n      if (\n        !(\n          childBoundingVolume instanceof TileOrientedBoundingBox ||\n          childBoundingVolume instanceof TileBoundingRegion\n        )\n      ) {\n        // Do not support if the parent and child both do not have oriented bounding boxes.\n        tile._optimChildrenWithinParent =\n          Cesium3DTileOptimizationHint.SKIP_OPTIMIZATION;\n        break;\n      }\n\n      const childOrientedBoundingBox = childBoundingVolume._orientedBoundingBox;\n\n      // Compute the axis from the parent to the child.\n      const axis = Cartesian3.subtract(\n        childOrientedBoundingBox.center,\n        orientedBoundingBox.center,\n        scratchAxis\n      );\n      const axisLength = Cartesian3.magnitude(axis);\n      Cartesian3.divideByScalar(axis, axisLength, axis);\n\n      // Project the bounding box of the parent onto the axis. Because the axis is a ray from the parent\n      // to the child, the projection parameterized along the ray will be (+/- proj1).\n      const proj1 =\n        Math.abs(orientedBoundingBox.halfAxes[0] * axis.x) +\n        Math.abs(orientedBoundingBox.halfAxes[1] * axis.y) +\n        Math.abs(orientedBoundingBox.halfAxes[2] * axis.z) +\n        Math.abs(orientedBoundingBox.halfAxes[3] * axis.x) +\n        Math.abs(orientedBoundingBox.halfAxes[4] * axis.y) +\n        Math.abs(orientedBoundingBox.halfAxes[5] * axis.z) +\n        Math.abs(orientedBoundingBox.halfAxes[6] * axis.x) +\n        Math.abs(orientedBoundingBox.halfAxes[7] * axis.y) +\n        Math.abs(orientedBoundingBox.halfAxes[8] * axis.z);\n\n      // Project the bounding box of the child onto the axis. Because the axis is a ray from the parent\n      // to the child, the projection parameterized along the ray will be (+/- proj2) + axis.length.\n      const proj2 =\n        Math.abs(childOrientedBoundingBox.halfAxes[0] * axis.x) +\n        Math.abs(childOrientedBoundingBox.halfAxes[1] * axis.y) +\n        Math.abs(childOrientedBoundingBox.halfAxes[2] * axis.z) +\n        Math.abs(childOrientedBoundingBox.halfAxes[3] * axis.x) +\n        Math.abs(childOrientedBoundingBox.halfAxes[4] * axis.y) +\n        Math.abs(childOrientedBoundingBox.halfAxes[5] * axis.z) +\n        Math.abs(childOrientedBoundingBox.halfAxes[6] * axis.x) +\n        Math.abs(childOrientedBoundingBox.halfAxes[7] * axis.y) +\n        Math.abs(childOrientedBoundingBox.halfAxes[8] * axis.z);\n\n      // If the child extends the parent's bounds, the optimization is not valid and we skip it.\n      if (proj1 <= proj2 + axisLength) {\n        tile._optimChildrenWithinParent =\n          Cesium3DTileOptimizationHint.SKIP_OPTIMIZATION;\n        break;\n      }\n    }\n  }\n\n  return (\n    tile._optimChildrenWithinParent ===\n    Cesium3DTileOptimizationHint.USE_OPTIMIZATION\n  );\n};\nexport default Cesium3DTileOptimizations;\n", "import defined from \"./defined.js\";\n\n/**\n * @private\n */\nfunction DoublyLinkedList() {\n  this.head = undefined;\n  this.tail = undefined;\n  this._length = 0;\n}\n\nObject.defineProperties(DoublyLinkedList.prototype, {\n  length: {\n    get: function () {\n      return this._length;\n    },\n  },\n});\n\n/**\n * @private\n */\nfunction DoublyLinkedListNode(item, previous, next) {\n  this.item = item;\n  this.previous = previous;\n  this.next = next;\n}\n\n/**\n * Adds the item to the end of the list\n * @param {*} [item]\n * @return {DoublyLinkedListNode}\n */\nDoublyLinkedList.prototype.add = function (item) {\n  const node = new DoublyLinkedListNode(item, this.tail, undefined);\n\n  if (defined(this.tail)) {\n    this.tail.next = node;\n    this.tail = node;\n  } else {\n    this.head = node;\n    this.tail = node;\n  }\n\n  ++this._length;\n\n  return node;\n};\n\nfunction remove(list, node) {\n  if (defined(node.previous) && defined(node.next)) {\n    node.previous.next = node.next;\n    node.next.previous = node.previous;\n  } else if (defined(node.previous)) {\n    // Remove last node\n    node.previous.next = undefined;\n    list.tail = node.previous;\n  } else if (defined(node.next)) {\n    // Remove first node\n    node.next.previous = undefined;\n    list.head = node.next;\n  } else {\n    // Remove last node in the linked list\n    list.head = undefined;\n    list.tail = undefined;\n  }\n\n  node.next = undefined;\n  node.previous = undefined;\n}\n\n/**\n * Removes the given node from the list\n * @param {DoublyLinkedListNode} node\n */\nDoublyLinkedList.prototype.remove = function (node) {\n  if (!defined(node)) {\n    return;\n  }\n\n  remove(this, node);\n\n  --this._length;\n};\n\n/**\n * Moves nextNode after node\n * @param {DoublyLinkedListNode} node\n * @param {DoublyLinkedListNode} nextNode\n */\nDoublyLinkedList.prototype.splice = function (node, nextNode) {\n  if (node === nextNode) {\n    return;\n  }\n\n  // Remove nextNode, then insert after node\n  remove(this, nextNode);\n\n  const oldNodeNext = node.next;\n  node.next = nextNode;\n\n  // nextNode is the new tail\n  if (this.tail === node) {\n    this.tail = nextNode;\n  } else {\n    oldNodeNext.previous = nextNode;\n  }\n\n  nextNode.next = oldNodeNext;\n  nextNode.previous = node;\n};\nexport default DoublyLinkedList;\n", "import defined from \"../Core/defined.js\";\nimport DoublyLinkedList from \"../Core/DoublyLinkedList.js\";\n\n/**\n * Stores tiles with content loaded.\n *\n * @private\n */\nfunction Cesium3DTilesetCache() {\n  // [head, sentinel) -> tiles that weren't selected this frame and may be removed from the cache\n  // (sentinel, tail] -> tiles that were selected this frame\n  this._list = new DoublyLinkedList();\n  this._sentinel = this._list.add();\n  this._trimTiles = false;\n}\n\nCesium3DTilesetCache.prototype.reset = function () {\n  // Move sentinel node to the tail so, at the start of the frame, all tiles\n  // may be potentially replaced.  Tiles are moved to the right of the sentinel\n  // when they are selected so they will not be replaced.\n  this._list.splice(this._list.tail, this._sentinel);\n};\n\nCesium3DTilesetCache.prototype.touch = function (tile) {\n  const node = tile.cacheNode;\n  if (defined(node)) {\n    this._list.splice(this._sentinel, node);\n  }\n};\n\nCesium3DTilesetCache.prototype.add = function (tile) {\n  if (!defined(tile.cacheNode)) {\n    tile.cacheNode = this._list.add(tile);\n  }\n};\n\nCesium3DTilesetCache.prototype.unloadTile = function (\n  tileset,\n  tile,\n  unloadCallback\n) {\n  const node = tile.cacheNode;\n  if (!defined(node)) {\n    return;\n  }\n\n  this._list.remove(node);\n  tile.cacheNode = undefined;\n  unloadCallback(tileset, tile);\n};\n\nCesium3DTilesetCache.prototype.unloadTiles = function (\n  tileset,\n  unloadCallback\n) {\n  const trimTiles = this._trimTiles;\n  this._trimTiles = false;\n\n  const list = this._list;\n\n  // Traverse the list only to the sentinel since tiles/nodes to the\n  // right of the sentinel were used this frame.\n  //\n  // The sub-list to the left of the sentinel is ordered from LRU to MRU.\n  const sentinel = this._sentinel;\n  let node = list.head;\n  while (\n    node !== sentinel &&\n    (tileset.totalMemoryUsageInBytes > tileset.cacheBytes || trimTiles)\n  ) {\n    const tile = node.item;\n    node = node.next;\n    this.unloadTile(tileset, tile, unloadCallback);\n  }\n};\n\nCesium3DTilesetCache.prototype.trim = function () {\n  this._trimTiles = true;\n};\nexport default Cesium3DTilesetCache;\n", "import Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\n\n/**\n * A heatmap colorizer in a {@link Cesium3DTileset}. A tileset can colorize its visible tiles in a heatmap style.\n *\n * @alias Cesium3DTilesetHeatmap\n * @constructor\n * @private\n */\nfunction Cesium3DTilesetHeatmap(tilePropertyName) {\n  /**\n   * The tile variable to track for heatmap colorization.\n   * Tile's will be colorized relative to the other visible tile's values for this variable.\n   *\n   * @type {string}\n   */\n  this.tilePropertyName = tilePropertyName;\n\n  // Members that are updated every time a tile is colorized\n  this._minimum = Number.MAX_VALUE;\n  this._maximum = -Number.MAX_VALUE;\n\n  // Members that are updated once every frame\n  this._previousMinimum = Number.MAX_VALUE;\n  this._previousMaximum = -Number.MAX_VALUE;\n\n  // If defined uses a reference minimum maximum to colorize by instead of using last frames minimum maximum of rendered tiles.\n  // For example, the _loadTimestamp can get a better colorization using setReferenceMinimumMaximum in order to take accurate colored timing diffs of various scenes.\n  this._referenceMinimum = {};\n  this._referenceMaximum = {};\n}\n\n/**\n * Convert to a usable heatmap value (i.e. a number). Ensures that tile values that aren't stored as numbers can be used for colorization.\n * @private\n */\nfunction getHeatmapValue(tileValue, tilePropertyName) {\n  let value;\n  if (tilePropertyName === \"_loadTimestamp\") {\n    value = JulianDate.toDate(tileValue).getTime();\n  } else {\n    value = tileValue;\n  }\n  return value;\n}\n\n/**\n * Sets the reference minimum and maximum for the variable name. Converted to numbers before they are stored.\n *\n * @param {object} minimum The minimum reference value.\n * @param {object} maximum The maximum reference value.\n * @param {string} tilePropertyName The tile variable that will use these reference values when it is colorized.\n */\nCesium3DTilesetHeatmap.prototype.setReferenceMinimumMaximum = function (\n  minimum,\n  maximum,\n  tilePropertyName\n) {\n  this._referenceMinimum[tilePropertyName] = getHeatmapValue(\n    minimum,\n    tilePropertyName\n  );\n  this._referenceMaximum[tilePropertyName] = getHeatmapValue(\n    maximum,\n    tilePropertyName\n  );\n};\n\nfunction getHeatmapValueAndUpdateMinimumMaximum(heatmap, tile) {\n  const tilePropertyName = heatmap.tilePropertyName;\n  if (defined(tilePropertyName)) {\n    const heatmapValue = getHeatmapValue(\n      tile[tilePropertyName],\n      tilePropertyName\n    );\n    if (!defined(heatmapValue)) {\n      heatmap.tilePropertyName = undefined;\n      return heatmapValue;\n    }\n    heatmap._maximum = Math.max(heatmapValue, heatmap._maximum);\n    heatmap._minimum = Math.min(heatmapValue, heatmap._minimum);\n    return heatmapValue;\n  }\n}\n\nconst heatmapColors = [\n  new Color(0.1, 0.1, 0.1, 1), // Dark Gray\n  new Color(0.153, 0.278, 0.878, 1), // Blue\n  new Color(0.827, 0.231, 0.49, 1), // Pink\n  new Color(0.827, 0.188, 0.22, 1), // Red\n  new Color(1.0, 0.592, 0.259, 1), // Orange\n  new Color(1.0, 0.843, 0.0, 1),\n]; // Yellow\n/**\n * Colorize the tile in heat map style based on where it lies within the minimum maximum window.\n * Heatmap colors are black, blue, pink, red, orange, yellow. 'Cold' or low numbers will be black and blue, 'Hot' or high numbers will be orange and yellow,\n * @param {Cesium3DTile} tile The tile to colorize relative to last frame's minimum and maximum values of all visible tiles.\n * @param {FrameState} frameState The frame state.\n */\nCesium3DTilesetHeatmap.prototype.colorize = function (tile, frameState) {\n  const tilePropertyName = this.tilePropertyName;\n  if (\n    !defined(tilePropertyName) ||\n    !tile.contentAvailable ||\n    tile._selectedFrame !== frameState.frameNumber\n  ) {\n    return;\n  }\n\n  const heatmapValue = getHeatmapValueAndUpdateMinimumMaximum(this, tile);\n  const minimum = this._previousMinimum;\n  const maximum = this._previousMaximum;\n\n  if (minimum === Number.MAX_VALUE || maximum === -Number.MAX_VALUE) {\n    return;\n  }\n\n  // Shift the minimum maximum window down to 0\n  const shiftedMax = maximum - minimum + CesiumMath.EPSILON7; // Prevent divide by 0\n  const shiftedValue = CesiumMath.clamp(\n    heatmapValue - minimum,\n    0.0,\n    shiftedMax\n  );\n\n  // Get position between minimum and maximum and convert that to a position in the color array\n  const zeroToOne = shiftedValue / shiftedMax;\n  const lastIndex = heatmapColors.length - 1.0;\n  const colorPosition = zeroToOne * lastIndex;\n\n  // Take floor and ceil of the value to get the two colors to lerp between, lerp using the fractional portion\n  const colorPositionFloor = Math.floor(colorPosition);\n  const colorPositionCeil = Math.ceil(colorPosition);\n  const t = colorPosition - colorPositionFloor;\n  const colorZero = heatmapColors[colorPositionFloor];\n  const colorOne = heatmapColors[colorPositionCeil];\n\n  // Perform the lerp\n  const finalColor = Color.clone(Color.WHITE);\n  finalColor.red = CesiumMath.lerp(colorZero.red, colorOne.red, t);\n  finalColor.green = CesiumMath.lerp(colorZero.green, colorOne.green, t);\n  finalColor.blue = CesiumMath.lerp(colorZero.blue, colorOne.blue, t);\n  tile._debugColor = finalColor;\n};\n\n/**\n * Resets the tracked minimum maximum values for heatmap colorization. Happens right before tileset traversal.\n */\nCesium3DTilesetHeatmap.prototype.resetMinimumMaximum = function () {\n  // For heat map colorization\n  const tilePropertyName = this.tilePropertyName;\n  if (defined(tilePropertyName)) {\n    const referenceMinimum = this._referenceMinimum[tilePropertyName];\n    const referenceMaximum = this._referenceMaximum[tilePropertyName];\n    const useReference = defined(referenceMinimum) && defined(referenceMaximum);\n    this._previousMinimum = useReference ? referenceMinimum : this._minimum;\n    this._previousMaximum = useReference ? referenceMaximum : this._maximum;\n    this._minimum = Number.MAX_VALUE;\n    this._maximum = -Number.MAX_VALUE;\n  }\n};\nexport default Cesium3DTilesetHeatmap;\n", "import defined from \"../Core/defined.js\";\n\n/**\n * @private\n */\nfunction Cesium3DTilesetStatistics() {\n  // Rendering statistics\n  this.selected = 0;\n  this.visited = 0;\n  // Loading statistics\n  this.numberOfCommands = 0;\n  this.numberOfAttemptedRequests = 0;\n  this.numberOfPendingRequests = 0;\n  this.numberOfTilesProcessing = 0;\n  this.numberOfTilesWithContentReady = 0; // Number of tiles with content loaded, does not include empty tiles\n  this.numberOfTilesTotal = 0; // Number of tiles in tileset JSON (and other tileset JSON files as they are loaded)\n  this.numberOfLoadedTilesTotal = 0; // Running total of loaded tiles for the lifetime of the session\n  // Features statistics\n  this.numberOfFeaturesSelected = 0; // Number of features rendered\n  this.numberOfFeaturesLoaded = 0; // Number of features in memory\n  this.numberOfPointsSelected = 0;\n  this.numberOfPointsLoaded = 0;\n  this.numberOfTrianglesSelected = 0;\n  // Styling statistics\n  this.numberOfTilesStyled = 0;\n  this.numberOfFeaturesStyled = 0;\n  // Optimization statistics\n  this.numberOfTilesCulledWithChildrenUnion = 0;\n  // Memory statistics\n  this.geometryByteLength = 0;\n  this.texturesByteLength = 0;\n  this.batchTableByteLength = 0; // batch textures and any binary metadata properties not otherwise accounted for\n}\n\nCesium3DTilesetStatistics.prototype.clear = function () {\n  this.selected = 0;\n  this.visited = 0;\n  this.numberOfCommands = 0;\n  this.numberOfAttemptedRequests = 0;\n  this.numberOfFeaturesSelected = 0;\n  this.numberOfPointsSelected = 0;\n  this.numberOfTrianglesSelected = 0;\n  this.numberOfTilesStyled = 0;\n  this.numberOfFeaturesStyled = 0;\n  this.numberOfTilesCulledWithChildrenUnion = 0;\n};\n\nfunction updatePointAndFeatureCounts(statistics, content, decrement, load) {\n  const contents = content.innerContents;\n  const pointsLength = content.pointsLength;\n  const trianglesLength = content.trianglesLength;\n  const featuresLength = content.featuresLength;\n  const geometryByteLength = content.geometryByteLength;\n  const texturesByteLength = content.texturesByteLength;\n  const batchTableByteLength = content.batchTableByteLength;\n\n  if (load) {\n    statistics.numberOfFeaturesLoaded += decrement\n      ? -featuresLength\n      : featuresLength;\n    statistics.numberOfPointsLoaded += decrement ? -pointsLength : pointsLength;\n    statistics.geometryByteLength += decrement\n      ? -geometryByteLength\n      : geometryByteLength;\n    statistics.texturesByteLength += decrement\n      ? -texturesByteLength\n      : texturesByteLength;\n    statistics.batchTableByteLength += decrement\n      ? -batchTableByteLength\n      : batchTableByteLength;\n  } else {\n    statistics.numberOfFeaturesSelected += decrement\n      ? -featuresLength\n      : featuresLength;\n    statistics.numberOfPointsSelected += decrement\n      ? -pointsLength\n      : pointsLength;\n    statistics.numberOfTrianglesSelected += decrement\n      ? -trianglesLength\n      : trianglesLength;\n  }\n\n  if (defined(contents)) {\n    const length = contents.length;\n    for (let i = 0; i < length; ++i) {\n      updatePointAndFeatureCounts(statistics, contents[i], decrement, load);\n    }\n  }\n}\n\nCesium3DTilesetStatistics.prototype.incrementSelectionCounts = function (\n  content\n) {\n  updatePointAndFeatureCounts(this, content, false, false);\n};\n\nCesium3DTilesetStatistics.prototype.incrementLoadCounts = function (content) {\n  updatePointAndFeatureCounts(this, content, false, true);\n};\n\nCesium3DTilesetStatistics.prototype.decrementLoadCounts = function (content) {\n  updatePointAndFeatureCounts(this, content, true, true);\n};\n\nCesium3DTilesetStatistics.clone = function (statistics, result) {\n  result.selected = statistics.selected;\n  result.visited = statistics.visited;\n  result.numberOfCommands = statistics.numberOfCommands;\n  result.selected = statistics.selected;\n  result.numberOfAttemptedRequests = statistics.numberOfAttemptedRequests;\n  result.numberOfPendingRequests = statistics.numberOfPendingRequests;\n  result.numberOfTilesProcessing = statistics.numberOfTilesProcessing;\n  result.numberOfTilesWithContentReady =\n    statistics.numberOfTilesWithContentReady;\n  result.numberOfTilesTotal = statistics.numberOfTilesTotal;\n  result.numberOfFeaturesSelected = statistics.numberOfFeaturesSelected;\n  result.numberOfFeaturesLoaded = statistics.numberOfFeaturesLoaded;\n  result.numberOfPointsSelected = statistics.numberOfPointsSelected;\n  result.numberOfPointsLoaded = statistics.numberOfPointsLoaded;\n  result.numberOfTrianglesSelected = statistics.numberOfTrianglesSelected;\n  result.numberOfTilesStyled = statistics.numberOfTilesStyled;\n  result.numberOfFeaturesStyled = statistics.numberOfFeaturesStyled;\n  result.numberOfTilesCulledWithChildrenUnion =\n    statistics.numberOfTilesCulledWithChildrenUnion;\n  result.geometryByteLength = statistics.geometryByteLength;\n  result.texturesByteLength = statistics.texturesByteLength;\n  result.batchTableByteLength = statistics.batchTableByteLength;\n};\nexport default Cesium3DTilesetStatistics;\n", "import defined from \"../Core/defined.js\";\n\n/**\n * @private\n */\nfunction Cesium3DTileStyleEngine() {\n  this._style = undefined; // The style provided by the user\n  this._styleDirty = false; // true when the style is reassigned\n  this._lastStyleTime = 0; // The \"time\" when the last style was assigned\n}\n\nObject.defineProperties(Cesium3DTileStyleEngine.prototype, {\n  style: {\n    get: function () {\n      return this._style;\n    },\n    set: function (value) {\n      if (value === this._style) {\n        return;\n      }\n      this._style = value;\n      this._styleDirty = true;\n    },\n  },\n});\n\nCesium3DTileStyleEngine.prototype.makeDirty = function () {\n  this._styleDirty = true;\n};\n\nCesium3DTileStyleEngine.prototype.resetDirty = function () {\n  this._styleDirty = false;\n};\n\nCesium3DTileStyleEngine.prototype.applyStyle = function (tileset) {\n  if (!defined(tileset.root)) {\n    return;\n  }\n\n  if (defined(this._style) && !this._style._ready) {\n    return;\n  }\n\n  const styleDirty = this._styleDirty;\n\n  if (styleDirty) {\n    // Increase \"time\", so the style is applied to all visible tiles\n    ++this._lastStyleTime;\n  }\n\n  const lastStyleTime = this._lastStyleTime;\n  const statistics = tileset._statistics;\n\n  // If a new style was assigned, loop through all the visible tiles; otherwise, loop through\n  // only the tiles that are newly visible, i.e., they are visible this frame, but were not\n  // visible last frame.  In many cases, the newly selected tiles list will be short or empty.\n  const tiles = styleDirty\n    ? tileset._selectedTiles\n    : tileset._selectedTilesToStyle;\n  // PERFORMANCE_IDEA: does mouse-over picking basically trash this?  We need to style on\n  // pick, for example, because a feature's show may be false.\n\n  const length = tiles.length;\n  for (let i = 0; i < length; ++i) {\n    const tile = tiles[i];\n    if (tile.lastStyleTime !== lastStyleTime) {\n      // Apply the style to this tile if it wasn't already applied because:\n      //   1) the user assigned a new style to the tileset\n      //   2) this tile is now visible, but it wasn't visible when the style was first assigned\n      const content = tile.content;\n      tile.lastStyleTime = lastStyleTime;\n      content.applyStyle(this._style);\n      statistics.numberOfFeaturesStyled += content.featuresLength;\n      ++statistics.numberOfTilesStyled;\n    }\n  }\n};\nexport default Cesium3DTileStyleEngine;\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport defined from \"../Core/defined.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport ImplicitSubdivisionScheme from \"./ImplicitSubdivisionScheme.js\";\n\n/**\n * An ImplicitTileset is a simple struct that stores information about the\n * structure of a single implicit tileset. This includes template URIs for\n * locating resources, details from the implicit root tile (bounding volume,\n * geometricError, etc.), and details about the subtrees (e.g. subtreeLevels,\n * subdivisionScheme).\n *\n * @alias ImplicitTileset\n * @constructor\n *\n * @param {Resource} baseResource The base resource for the tileset\n * @param {object} tileJson The JSON header of the tile with either implicit tiling (3D Tiles 1.1) or the 3DTILES_implicit_tiling extension.\n * @param {MetadataSchema} [metadataSchema] The metadata schema containing the implicit tile metadata class.\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ImplicitTileset(baseResource, tileJson, metadataSchema) {\n  const implicitTiling = hasExtension(tileJson, \"3DTILES_implicit_tiling\")\n    ? tileJson.extensions[\"3DTILES_implicit_tiling\"]\n    : tileJson.implicitTiling;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"implicitTiling\", implicitTiling);\n  //>>includeEnd('debug');\n\n  /**\n   * The base resource for the tileset. This is stored here as it is needed\n   * later when expanding Implicit3DTileContents so tile URLs are relative\n   * to the tileset, not the subtree file.\n   *\n   * @type {Resource}\n   * @readonly\n   * @private\n   */\n  this.baseResource = baseResource;\n\n  /**\n   * The geometric error of the root tile\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  this.geometricError = tileJson.geometricError;\n\n  /**\n   * The metadata schema containing the implicit tile metadata class.\n   *\n   * @type {MetadataSchema|undefined}\n   * @readonly\n   * @private\n   */\n  this.metadataSchema = metadataSchema;\n\n  // Due to using explicit tile metadata to store a tight bounding box\n  // in some cases (see https://github.com/CesiumGS/cesium/pull/11365)\n  // it's important that this bounding volume is computed from the tile JSON\n  // (which is the original, possibly loose bounding volume) rather than\n  // tile.boundingVolume which is the tighter one.\n  const boundingVolume = tileJson.boundingVolume;\n  if (\n    !defined(boundingVolume.box) &&\n    !defined(boundingVolume.region) &&\n    !hasExtension(boundingVolume, \"3DTILES_bounding_volume_S2\") &&\n    !hasExtension(boundingVolume, \"3DTILES_bounding_volume_cylinder\")\n  ) {\n    throw new RuntimeError(\n      \"Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling\"\n    );\n  }\n\n  /**\n   * The JSON representation of a bounding volume. This is either a box or a\n   * region.\n   *\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  this.boundingVolume = boundingVolume;\n\n  /**\n   * The refine strategy as a string, either 'ADD' or 'REPLACE'\n   *\n   * @type {string}\n   * @readonly\n   * @private\n   */\n  this.refine = tileJson.refine;\n\n  /**\n   * Template URI for the subtree resources, e.g.\n   * <code>https://example.com/{level}/{x}/{y}.subtree</code>\n   *\n   * @type {Resource}\n   * @readonly\n   * @private\n   */\n\n  this.subtreeUriTemplate = new Resource({ url: implicitTiling.subtrees.uri });\n\n  /**\n   * Template URIs for locating content resources, e.g.\n   * <code>https://example.com/{level}/{x}/{y}.b3dm</code>.\n   * <p>\n   * This is an array to support multiple contents.\n   * </p>\n   *\n   * @type {Resource[]}\n   * @readonly\n   * @private\n   */\n  this.contentUriTemplates = [];\n\n  /**\n   * Store a copy of the content headers, so properties such as\n   * <code>extras</code> or <code>extensions</code> are preserved when\n   * {@link Cesium3DTile}s are created for each tile.\n   * <p>\n   * This is an array to support multiple contents.\n   * </p>\n   *\n   * @type {Object[]}\n   * @readonly\n   * @private\n   */\n  this.contentHeaders = [];\n\n  const contentHeaders = gatherContentHeaders(tileJson);\n  for (let i = 0; i < contentHeaders.length; i++) {\n    const contentHeader = contentHeaders[i];\n    this.contentHeaders.push(clone(contentHeader, true));\n    const contentResource = new Resource({ url: contentHeader.uri });\n    this.contentUriTemplates.push(contentResource);\n  }\n\n  /**\n   * The maximum number of contents as well as content availability bitstreams.\n   * This is used for loop bounds when checking content availability.\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  this.contentCount = this.contentHeaders.length;\n\n  /**\n   * Stores a copy of the root implicit tile's JSON header. This is used\n   * as a template for creating {@link Cesium3DTile}s. The following properties\n   * are removed:\n   *\n   * <ul>\n   * <li><code>tile.implicitTiling</code> to prevent infinite loops of implicit tiling</li>\n   * <li><code>tile.extensions[\"3DTILES_implicit_tiling\"]</code>, if used instead of tile.implicitTiling</li>\n   * <li><code>tile.contents</code>, since contents are handled separately</li>\n   * <li><code>tile.content</code>, if used instead of tile.contents</li>\n   * <li><code>tile.extensions[\"3DTILES_multiple_contents\"]</code>, if used instead of tile.contents or tile.content</li>\n   * </ul>\n   *\n   * @type {object}\n   * @readonly\n   * @private\n   */\n  this.tileHeader = makeTileHeaderTemplate(tileJson);\n\n  /**\n   * The subdivision scheme for this implicit tileset; either OCTREE or QUADTREE\n   *\n   * @type {ImplicitSubdivisionScheme}\n   * @readonly\n   * @private\n   */\n  this.subdivisionScheme =\n    ImplicitSubdivisionScheme[implicitTiling.subdivisionScheme];\n\n  /**\n   * The branching factor for this tileset. Either 4 for quadtrees or 8 for\n   * octrees.\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  this.branchingFactor = ImplicitSubdivisionScheme.getBranchingFactor(\n    this.subdivisionScheme\n  );\n\n  /**\n   * How many distinct levels within each subtree. For example, a quadtree\n   * with subtreeLevels = 2 will have 5 nodes per quadtree (1 root + 4 children)\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  this.subtreeLevels = implicitTiling.subtreeLevels;\n\n  /**\n   * The number of levels containing available tiles in the tileset.\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  if (defined(implicitTiling.availableLevels)) {\n    this.availableLevels = implicitTiling.availableLevels;\n  } else {\n    this.availableLevels = implicitTiling.maximumLevel + 1;\n  }\n}\n\n/**\n * Gather JSON headers for all contents in the tile.\n * This handles both regular tiles and tiles with multiple contents, either\n * in the contents array (3D Tiles 1.1) or the `3DTILES_multiple_contents` extension\n *\n * @param {object} tileJson The JSON header of the tile with either implicit tiling (3D Tiles 1.1) or the 3DTILES_implicit_tiling extension.\n * @return {Object[]} An array of JSON headers for the contents of each tile\n * @private\n */\nfunction gatherContentHeaders(tileJson) {\n  if (hasExtension(tileJson, \"3DTILES_multiple_contents\")) {\n    const extension = tileJson.extensions[\"3DTILES_multiple_contents\"];\n    return defined(extension.contents) ? extension.contents : extension.content;\n  }\n\n  if (defined(tileJson.contents)) {\n    return tileJson.contents;\n  }\n\n  if (defined(tileJson.content)) {\n    return [tileJson.content];\n  }\n\n  return [];\n}\n\nfunction makeTileHeaderTemplate(tileJson) {\n  const template = clone(tileJson, true);\n\n  // Remove the implicit tiling extension to prevent infinite loops,\n  // as well as content-related properties since content is handled separately\n  if (defined(template.extensions)) {\n    delete template.extensions[\"3DTILES_implicit_tiling\"];\n    delete template.extensions[\"3DTILES_multiple_contents\"];\n\n    // if there are no other extensions, remove the extensions property to\n    // keep each tile simple\n    if (Object.keys(template.extensions).length === 0) {\n      delete template.extensions;\n    }\n  }\n\n  delete template.implicitTiling;\n  delete template.contents;\n  delete template.content;\n\n  return template;\n}\n\nexport default ImplicitTileset;\n", "import Check from \"./Check.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Morton Order (aka Z-Order Curve) helper functions.\n * @see {@link https://en.wikipedia.org/wiki/Z-order_curve}\n *\n * @namespace MortonOrder\n * @private\n */\nconst MortonOrder = {};\n\n/**\n * Inserts one 0 bit of spacing between a number's bits. This is the opposite of removeOneSpacing.\n *\n * Example:\n *  input: 6\n *  input (binary):  110\n *  output (binary): 10100\n *                    ^ ^ (added)\n *  output: 20\n *\n * @private\n * @param {number} v A 16-bit unsigned integer.\n * @returns {number} A 32-bit unsigned integer.\n * @see {@link https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/}\n * @private\n */\nfunction insertOneSpacing(v) {\n  v = (v ^ (v << 8)) & 0x00ff00ff;\n  v = (v ^ (v << 4)) & 0x0f0f0f0f;\n  v = (v ^ (v << 2)) & 0x33333333;\n  v = (v ^ (v << 1)) & 0x55555555;\n  return v;\n}\n\n/**\n * Inserts two 0 bits of spacing between a number's bits. This is the opposite of removeTwoSpacing.\n *\n * Example:\n *  input: 6\n *  input (binary):  110\n *  output (binary): 1001000\n *                    ^^ ^^ (added)\n *  output: 72\n *\n * @private\n * @param {number} v A 10-bit unsigned integer.\n * @returns {number} A 30-bit unsigned integer.\n * @see {@link https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/}\n */\nfunction insertTwoSpacing(v) {\n  v = (v ^ (v << 16)) & 0x030000ff;\n  v = (v ^ (v << 8)) & 0x0300f00f;\n  v = (v ^ (v << 4)) & 0x030c30c3;\n  v = (v ^ (v << 2)) & 0x09249249;\n  return v;\n}\n\n/**\n * Removes one bit of spacing between bits. This is the opposite of insertOneSpacing.\n *\n * Example:\n *  input: 20\n *  input (binary):  10100\n *                    ^ ^ (removed)\n *  output (binary): 110\n *  output: 6\n *\n * @private\n * @param {number} v A 32-bit unsigned integer.\n * @returns {number} A 16-bit unsigned integer.\n * @see {@link https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/}\n */\nfunction removeOneSpacing(v) {\n  v &= 0x55555555;\n  v = (v ^ (v >> 1)) & 0x33333333;\n  v = (v ^ (v >> 2)) & 0x0f0f0f0f;\n  v = (v ^ (v >> 4)) & 0x00ff00ff;\n  v = (v ^ (v >> 8)) & 0x0000ffff;\n  return v;\n}\n\n/**\n * Removes two bits of spacing between bits. This is the opposite of insertTwoSpacing.\n *\n * Example:\n *  input: 72\n *  input (binary):  1001000\n *                    ^^ ^^ (removed)\n *  output (binary): 110\n *  output: 6\n *\n * @private\n * @param {number} v A 30-bit unsigned integer.\n * @returns {number} A 10-bit unsigned integer.\n * @see {@link https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/}\n */\nfunction removeTwoSpacing(v) {\n  v &= 0x09249249;\n  v = (v ^ (v >> 2)) & 0x030c30c3;\n  v = (v ^ (v >> 4)) & 0x0300f00f;\n  v = (v ^ (v >> 8)) & 0xff0000ff;\n  v = (v ^ (v >> 16)) & 0x000003ff;\n  return v;\n}\n\n/**\n * Computes the Morton index from 2D coordinates. This is equivalent to interleaving their bits.\n * The inputs must be 16-bit unsigned integers (resulting in 32-bit Morton index) due to 32-bit bitwise operator limitation in JavaScript.\n *\n * @param {number} x The X coordinate in the range [0, (2^16)-1].\n * @param {number} y The Y coordinate in the range [0, (2^16)-1].\n * @returns {number} The Morton index.\n * @private\n */\nMortonOrder.encode2D = function (x, y) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"x\", x);\n  Check.typeOf.number(\"y\", y);\n  if (x < 0 || x > 65535 || y < 0 || y > 65535) {\n    throw new DeveloperError(\"inputs must be 16-bit unsigned integers\");\n  }\n  //>>includeEnd('debug');\n\n  // Note: JavaScript bitwise operations return signed 32-bit integers, so the\n  // final result needs to be reintepreted as an unsigned integer using >>> 0.\n  // This is not needed for encode3D because the result is guaranteed to be at most\n  // 30 bits and thus will always be interpreted as an unsigned value.\n  return (insertOneSpacing(x) | (insertOneSpacing(y) << 1)) >>> 0;\n};\n\n/**\n * Computes the 2D coordinates from a Morton index. This is equivalent to deinterleaving their bits.\n * The input must be a 32-bit unsigned integer (resulting in 16 bits per coordinate) due to 32-bit bitwise operator limitation in JavaScript.\n *\n * @param {number} mortonIndex The Morton index in the range [0, (2^32)-1].\n * @param {number[]} [result] The array onto which to store the result.\n * @returns {number[]} An array containing the 2D coordinates correspoding to the Morton index.\n * @private\n */\nMortonOrder.decode2D = function (mortonIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"mortonIndex\", mortonIndex);\n  if (mortonIndex < 0 || mortonIndex > 4294967295) {\n    throw new DeveloperError(\"input must be a 32-bit unsigned integer\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Array(2);\n  }\n\n  result[0] = removeOneSpacing(mortonIndex);\n  result[1] = removeOneSpacing(mortonIndex >> 1);\n  return result;\n};\n\n/**\n * Computes the Morton index from 3D coordinates. This is equivalent to interleaving their bits.\n * The inputs must be 10-bit unsigned integers (resulting in 30-bit Morton index) due to 32-bit bitwise operator limitation in JavaScript.\n *\n * @param {number} x The X coordinate in the range [0, (2^10)-1].\n * @param {number} y The Y coordinate in the range [0, (2^10)-1].\n * @param {number} z The Z coordinate in the range [0, (2^10)-1].\n * @returns {number} The Morton index.\n * @private\n */\nMortonOrder.encode3D = function (x, y, z) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"x\", x);\n  Check.typeOf.number(\"y\", y);\n  Check.typeOf.number(\"z\", z);\n  if (x < 0 || x > 1023 || y < 0 || y > 1023 || z < 0 || z > 1023) {\n    throw new DeveloperError(\"inputs must be 10-bit unsigned integers\");\n  }\n  //>>includeEnd('debug');\n\n  return (\n    insertTwoSpacing(x) |\n    (insertTwoSpacing(y) << 1) |\n    (insertTwoSpacing(z) << 2)\n  );\n};\n\n/**\n * Computes the 3D coordinates from a Morton index. This is equivalent to deinterleaving their bits.\n * The input must be a 30-bit unsigned integer (resulting in 10 bits per coordinate) due to 32-bit bitwise operator limitation in JavaScript.\n *\n * @param {number} mortonIndex The Morton index in the range [0, (2^30)-1].\n * @param {number[]} [result] The array onto which to store the result.\n * @returns {number[]} An array containing the 3D coordinates corresponding to the Morton index.\n * @private\n */\nMortonOrder.decode3D = function (mortonIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"mortonIndex\", mortonIndex);\n  if (mortonIndex < 0 || mortonIndex > 1073741823) {\n    throw new DeveloperError(\"input must be a 30-bit unsigned integer\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Array(3);\n  }\n\n  result[0] = removeTwoSpacing(mortonIndex);\n  result[1] = removeTwoSpacing(mortonIndex >> 1);\n  result[2] = removeTwoSpacing(mortonIndex >> 2);\n  return result;\n};\n\nexport default MortonOrder;\n", "import CesiumMath from \"../Core/Math.js\";\nimport Check from \"../Core/Check.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport MortonOrder from \"../Core/MortonOrder.js\";\nimport ImplicitSubdivisionScheme from \"./ImplicitSubdivisionScheme.js\";\n\n/**\n * The coordinates for a tile in an implicit tileset. The coordinates\n * are (level, x, y) for quadtrees or (level, x, y, z) for octrees.\n * <p>\n * Level numbers are 0-indexed and typically start at the root of the implicit\n * tileset (the tile with either implicitTiling in its JSON (3D Tiles 1.1) or\n * the <code>3DTILES_implicit_tiling</code> extension).\n * This object can also represent the relative offset from one set of coordinates\n * to another. See {@link ImplicitTileCoordinates#getOffsetCoordinates}. The term\n * local coordinates refers to coordinates that are relative to the root of a\n * subtree and the term global coordinates refers to coordinates relative to the\n * root of an implicit tileset.\n * </p>\n * <p>\n * For box bounding volumes, x, y, z increase along the +x, +y, and +z\n * directions defined by the half axes.\n * </p>\n * <p>\n * For region bounding volumes, x increases in the +longitude direction, y\n * increases in the +latitude direction, and z increases in the +height\n * direction.\n * </p>\n * <p>\n * Care must be taken when converting between implicit coordinates and Morton\n * indices because there is a 16-bit limit on {@link MortonOrder#encode2D} and\n * a 10-bit limit on {@link MortonOrder#encode3D}. Typically these conversions\n * should be done on local coordinates, not global coordinates, and the maximum\n * number of levels in the subtree should be 15 for quadtree and 9 for octree (to\n * account for the extra level needed by child subtree coordinates).\n * </p>\n *\n * @alias ImplicitTileCoordinates\n * @constructor\n *\n * @param {object} options An object with the following properties:\n * @param {ImplicitSubdivisionScheme} options.subdivisionScheme Whether the coordinates are for a quadtree or octree\n * @param {number} options.subtreeLevels The number of distinct levels within the coordinate's subtree\n * @param {number} options.level The level of a tile relative to the tile with the extension\n * @param {number} options.x The x coordinate of the tile\n * @param {number} options.y The y coordinate of the tile\n * @param {number} [options.z] The z coordinate of the tile. Only required when options.subdivisionScheme is ImplicitSubdivisionScheme.OCTREE\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ImplicitTileCoordinates(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"options.subdivisionScheme\", options.subdivisionScheme);\n  Check.typeOf.number(\"options.subtreeLevels\", options.subtreeLevels);\n  Check.typeOf.number(\"options.level\", options.level);\n  Check.typeOf.number(\"options.x\", options.x);\n  Check.typeOf.number(\"options.y\", options.y);\n  if (options.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n    Check.typeOf.number(\"options.z\", options.z);\n  }\n  // Check for values that are negative\n  if (options.level < 0) {\n    throw new DeveloperError(\"level must be non-negative\");\n  }\n  if (options.x < 0) {\n    throw new DeveloperError(\"x must be non-negative\");\n  }\n  if (options.y < 0) {\n    throw new DeveloperError(\"y must be non-negative\");\n  }\n  if (options.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n    if (options.z < 0) {\n      throw new DeveloperError(\"z must be non-negative\");\n    }\n  }\n\n  // Check for values that are too large\n  const dimensionAtLevel = 1 << options.level;\n  if (options.x >= dimensionAtLevel) {\n    throw new DeveloperError(\"x is out of range\");\n  }\n  if (options.y >= dimensionAtLevel) {\n    throw new DeveloperError(\"y is out of range\");\n  }\n  if (options.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n    if (options.z >= dimensionAtLevel) {\n      throw new DeveloperError(\"z is out of range\");\n    }\n  }\n  //>>includeEnd('debug');\n\n  /**\n   * Whether the tileset is a quadtree or octree\n   *\n   * @type {ImplicitSubdivisionScheme}\n   * @readonly\n   * @private\n   */\n  this.subdivisionScheme = options.subdivisionScheme;\n\n  /**\n   * The number of distinct levels within the coordinate's subtree\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  this.subtreeLevels = options.subtreeLevels;\n\n  /**\n   * Level of this tile, relative to the tile with implicit tiling in its JSON\n   * (3D Tiles 1.1) or the <code>3DTILES_implicit_tiling</code> extension.\n   * Level numbers start at 0.\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  this.level = options.level;\n\n  /**\n   * X coordinate of this tile\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  this.x = options.x;\n\n  /**\n   * Y coordinate of this tile\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  this.y = options.y;\n\n  /**\n   * Z coordinate of this tile. Only defined for octrees.\n   *\n   * @type {number|undefined}\n   * @readonly\n   * @private\n   */\n  this.z = undefined;\n  if (options.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n    this.z = options.z;\n  }\n}\n\nObject.defineProperties(ImplicitTileCoordinates.prototype, {\n  /**\n   * An index in the range of [0, branchingFactor) that indicates\n   * which child of the parent cell these coordinates correspond to.\n   * This can be viewed as a morton index within the parent tile.\n   * <p>\n   * This is the last 3 bits of the morton index of the tile, but it can\n   * be computed more directly by concatenating the bits [z0] y0 x0\n   * </p>\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  childIndex: {\n    get: function () {\n      let childIndex = 0;\n      childIndex |= this.x & 1;\n      childIndex |= (this.y & 1) << 1;\n      if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n        childIndex |= (this.z & 1) << 2;\n      }\n\n      return childIndex;\n    },\n  },\n\n  /**\n   * Get the Morton index for this tile within the current level by interleaving\n   * the bits of the x, y and z coordinates.\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  mortonIndex: {\n    get: function () {\n      if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n        return MortonOrder.encode3D(this.x, this.y, this.z);\n      }\n      return MortonOrder.encode2D(this.x, this.y);\n    },\n  },\n\n  /**\n   * Get the tile index by adding the Morton index to the level offset\n   *\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  tileIndex: {\n    get: function () {\n      const levelOffset =\n        this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE\n          ? // (8^N - 1) / (8-1)\n            ((1 << (3 * this.level)) - 1) / 7\n          : // (4^N - 1) / (4-1)\n            ((1 << (2 * this.level)) - 1) / 3;\n\n      const mortonIndex = this.mortonIndex;\n      return levelOffset + mortonIndex;\n    },\n  },\n});\n\n/**\n * Check that the two coordinates are compatible\n * @param {ImplicitTileCoordinates} a\n * @param {ImplicitTileCoordinates} b\n * @private\n */\nfunction checkMatchingSubtreeShape(a, b) {\n  if (a.subdivisionScheme !== b.subdivisionScheme) {\n    throw new DeveloperError(\"coordinates must have same subdivisionScheme\");\n  }\n  if (a.subtreeLevels !== b.subtreeLevels) {\n    throw new DeveloperError(\"coordinates must have same subtreeLevels\");\n  }\n}\n\n/**\n * Compute the coordinates of a tile deeper in the tree with a (level, x, y, [z]) relative offset.\n *\n * @param {ImplicitTileCoordinates} offsetCoordinates The offset from the ancestor\n * @returns {ImplicitTileCoordinates} The coordinates of the descendant\n * @private\n */\nImplicitTileCoordinates.prototype.getDescendantCoordinates = function (\n  offsetCoordinates\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"offsetCoordinates\", offsetCoordinates);\n  checkMatchingSubtreeShape(this, offsetCoordinates);\n  //>>includeEnd('debug');\n\n  const descendantLevel = this.level + offsetCoordinates.level;\n  const descendantX = (this.x << offsetCoordinates.level) + offsetCoordinates.x;\n  const descendantY = (this.y << offsetCoordinates.level) + offsetCoordinates.y;\n\n  if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n    const descendantZ =\n      (this.z << offsetCoordinates.level) + offsetCoordinates.z;\n\n    return new ImplicitTileCoordinates({\n      subdivisionScheme: this.subdivisionScheme,\n      subtreeLevels: this.subtreeLevels,\n      level: descendantLevel,\n      x: descendantX,\n      y: descendantY,\n      z: descendantZ,\n    });\n  }\n\n  // Quadtree\n  return new ImplicitTileCoordinates({\n    subdivisionScheme: this.subdivisionScheme,\n    subtreeLevels: this.subtreeLevels,\n    level: descendantLevel,\n    x: descendantX,\n    y: descendantY,\n  });\n};\n\n/**\n * Compute the coordinates of a tile higher up in the tree by going up a number of levels.\n *\n * @param {number} offsetLevels The number of levels to go up in the tree\n * @returns {ImplicitTileCoordinates} The coordinates of the ancestor\n * @private\n */\nImplicitTileCoordinates.prototype.getAncestorCoordinates = function (\n  offsetLevels\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"offsetLevels\", offsetLevels);\n  if (offsetLevels < 0) {\n    throw new DeveloperError(\"offsetLevels must be non-negative\");\n  }\n  if (offsetLevels > this.level) {\n    throw new DeveloperError(\"ancestor cannot be above the tileset root\");\n  }\n  //>>includeEnd('debug');\n\n  const divisor = 1 << offsetLevels;\n  const ancestorLevel = this.level - offsetLevels;\n  const ancestorX = Math.floor(this.x / divisor);\n  const ancestorY = Math.floor(this.y / divisor);\n\n  if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n    const ancestorZ = Math.floor(this.z / divisor);\n\n    return new ImplicitTileCoordinates({\n      subdivisionScheme: this.subdivisionScheme,\n      subtreeLevels: this.subtreeLevels,\n      level: ancestorLevel,\n      x: ancestorX,\n      y: ancestorY,\n      z: ancestorZ,\n    });\n  }\n\n  // Quadtree\n  return new ImplicitTileCoordinates({\n    subdivisionScheme: this.subdivisionScheme,\n    subtreeLevels: this.subtreeLevels,\n    level: ancestorLevel,\n    x: ancestorX,\n    y: ancestorY,\n  });\n};\n\n/**\n * Compute the (level, x, y, [z]) offset to a descendant\n *\n * @param {ImplicitTileCoordinates} descendantCoordinates The descendant coordinates\n * @returns {ImplicitTileCoordinates} The offset between the ancestor and the descendant\n */\nImplicitTileCoordinates.prototype.getOffsetCoordinates = function (\n  descendantCoordinates\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"descendantCoordinates\", descendantCoordinates);\n  if (\n    !this.isEqual(descendantCoordinates) &&\n    !this.isAncestor(descendantCoordinates)\n  ) {\n    throw new DeveloperError(\"this is not an ancestor of descendant\");\n  }\n  checkMatchingSubtreeShape(this, descendantCoordinates);\n  //>>includeEnd('debug');\n\n  const offsetLevel = descendantCoordinates.level - this.level;\n  const dimensionAtOffsetLevel = 1 << offsetLevel;\n\n  const offsetX = descendantCoordinates.x % dimensionAtOffsetLevel;\n  const offsetY = descendantCoordinates.y % dimensionAtOffsetLevel;\n\n  if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n    const offsetZ = descendantCoordinates.z % dimensionAtOffsetLevel;\n\n    return new ImplicitTileCoordinates({\n      subdivisionScheme: this.subdivisionScheme,\n      subtreeLevels: this.subtreeLevels,\n      level: offsetLevel,\n      x: offsetX,\n      y: offsetY,\n      z: offsetZ,\n    });\n  }\n\n  // Quadtree\n  return new ImplicitTileCoordinates({\n    subdivisionScheme: this.subdivisionScheme,\n    subtreeLevels: this.subtreeLevels,\n    level: offsetLevel,\n    x: offsetX,\n    y: offsetY,\n  });\n};\n\n/**\n * Given the morton index of the child, compute the coordinates of the child.\n * This is a special case of {@link ImplicitTileCoordinates#getDescendantCoordinates}.\n *\n * @param {number} childIndex The morton index of the child tile relative to its parent\n * @returns {ImplicitTileCoordinates} The tile coordinates of the child\n * @private\n */\nImplicitTileCoordinates.prototype.getChildCoordinates = function (childIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"childIndex\", childIndex);\n  const branchingFactor = ImplicitSubdivisionScheme.getBranchingFactor(\n    this.subdivisionScheme\n  );\n  if (childIndex < 0 || branchingFactor <= childIndex) {\n    throw new DeveloperError(\n      `childIndex must be at least 0 and less than ${branchingFactor}`\n    );\n  }\n  //>>includeEnd('debug');\n\n  const level = this.level + 1;\n  const x = 2 * this.x + (childIndex % 2);\n  const y = 2 * this.y + (Math.floor(childIndex / 2) % 2);\n\n  if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n    const z = 2 * this.z + (Math.floor(childIndex / 4) % 2);\n    return new ImplicitTileCoordinates({\n      subdivisionScheme: this.subdivisionScheme,\n      subtreeLevels: this.subtreeLevels,\n      level: level,\n      x: x,\n      y: y,\n      z: z,\n    });\n  }\n\n  // Quadtree\n  return new ImplicitTileCoordinates({\n    subdivisionScheme: this.subdivisionScheme,\n    subtreeLevels: this.subtreeLevels,\n    level: level,\n    x: x,\n    y: y,\n  });\n};\n\n/**\n * Get the coordinates of the subtree that contains this tile. If the tile is\n * the root of the subtree, the root of the subtree is returned.\n *\n * @returns {ImplicitTileCoordinates} The subtree that contains this tile\n * @private\n */\nImplicitTileCoordinates.prototype.getSubtreeCoordinates = function () {\n  return this.getAncestorCoordinates(this.level % this.subtreeLevels);\n};\n\n/**\n * Get the coordinates of the parent subtree that contains this tile\n *\n * @returns {ImplicitTileCoordinates} The parent subtree that contains this tile\n * @private\n */\nImplicitTileCoordinates.prototype.getParentSubtreeCoordinates = function () {\n  return this.getAncestorCoordinates(\n    (this.level % this.subtreeLevels) + this.subtreeLevels\n  );\n};\n\n/**\n * Returns whether this tile is an ancestor of another tile\n *\n * @param {ImplicitTileCoordinates} descendantCoordinates the descendant coordinates\n * @returns {boolean} <code>true</code> if this tile is an ancestor of the other tile\n * @private\n */\nImplicitTileCoordinates.prototype.isAncestor = function (\n  descendantCoordinates\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"descendantCoordinates\", descendantCoordinates);\n  checkMatchingSubtreeShape(this, descendantCoordinates);\n  //>>includeEnd('debug');\n\n  const levelDifference = descendantCoordinates.level - this.level;\n  if (levelDifference <= 0) {\n    return false;\n  }\n\n  const ancestorX = descendantCoordinates.x >> levelDifference;\n  const ancestorY = descendantCoordinates.y >> levelDifference;\n  const isAncestorX = this.x === ancestorX;\n  const isAncestorY = this.y === ancestorY;\n\n  if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n    const ancestorZ = descendantCoordinates.z >> levelDifference;\n    const isAncestorZ = this.z === ancestorZ;\n    return isAncestorX && isAncestorY && isAncestorZ;\n  }\n\n  // Quadtree\n  return isAncestorX && isAncestorY;\n};\n\n/**\n * Returns whether the provided coordinates are equal to this coordinate\n *\n * @param {ImplicitTileCoordinates} otherCoordinates the other coordinates\n * @returns {boolean} <code>true</code> if the coordinates are equal\n * @private\n */\nImplicitTileCoordinates.prototype.isEqual = function (otherCoordinates) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"otherCoordinates\", otherCoordinates);\n  //>>includeEnd('debug');\n\n  return (\n    this.subdivisionScheme === otherCoordinates.subdivisionScheme &&\n    this.subtreeLevels === otherCoordinates.subtreeLevels &&\n    this.level === otherCoordinates.level &&\n    this.x === otherCoordinates.x &&\n    this.y === otherCoordinates.y &&\n    (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE\n      ? this.z === otherCoordinates.z\n      : true)\n  );\n};\n\n/**\n * Returns whether this tile is the root of the implicit tileset\n *\n * @returns {boolean} <code>true</code> if this tile is the root\n * @private\n */\nImplicitTileCoordinates.prototype.isImplicitTilesetRoot = function () {\n  return this.level === 0;\n};\n\n/**\n * Returns whether this tile is the root of the subtree\n *\n * @returns {boolean} <code>true</code> if this tile is the root of the subtree\n * @private\n */\nImplicitTileCoordinates.prototype.isSubtreeRoot = function () {\n  return this.level % this.subtreeLevels === 0;\n};\n\n/**\n * Returns whether this tile is on the last row of tiles in the subtree\n *\n * @returns {boolean} <code>true</code> if this tile is on the last row of tiles in the subtree\n * @private\n */\nImplicitTileCoordinates.prototype.isBottomOfSubtree = function () {\n  return this.level % this.subtreeLevels === this.subtreeLevels - 1;\n};\n\n/**\n * Get a dictionary of values for templating into an implicit template URI.\n *\n * @returns {object} An object suitable for use with {@link Resource#getDerivedResource}\n * @private\n */\nImplicitTileCoordinates.prototype.getTemplateValues = function () {\n  const values = {\n    level: this.level,\n    x: this.x,\n    y: this.y,\n  };\n  if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n    values.z = this.z;\n  }\n\n  return values;\n};\n\nconst scratchCoordinatesArray = [0, 0, 0];\n\n/**\n * Given a level number, morton index, and whether the tileset is an\n * octree/quadtree, compute the (level, x, y, [z]) coordinates\n *\n * @param {ImplicitSubdivisionScheme} subdivisionScheme Whether the coordinates are for a quadtree or octree\n * @param {number} subtreeLevels The number of distinct levels within the coordinate's subtree\n * @param {number} level The level of the tree\n * @param {number} mortonIndex The morton index of the tile.\n * @returns {ImplicitTileCoordinates} The coordinates of the tile with the given Morton index\n * @private\n */\nImplicitTileCoordinates.fromMortonIndex = function (\n  subdivisionScheme,\n  subtreeLevels,\n  level,\n  mortonIndex\n) {\n  let coordinatesArray;\n  if (subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n    coordinatesArray = MortonOrder.decode3D(\n      mortonIndex,\n      scratchCoordinatesArray\n    );\n    return new ImplicitTileCoordinates({\n      subdivisionScheme: subdivisionScheme,\n      subtreeLevels: subtreeLevels,\n      level: level,\n      x: coordinatesArray[0],\n      y: coordinatesArray[1],\n      z: coordinatesArray[2],\n    });\n  }\n\n  coordinatesArray = MortonOrder.decode2D(mortonIndex, scratchCoordinatesArray);\n  return new ImplicitTileCoordinates({\n    subdivisionScheme: subdivisionScheme,\n    subtreeLevels: subtreeLevels,\n    level: level,\n    x: coordinatesArray[0],\n    y: coordinatesArray[1],\n  });\n};\n\n/**\n * Given a tile index and whether the tileset is an octree/quadtree, compute\n * the (level, x, y, [z]) coordinates\n *\n * @param {ImplicitSubdivisionScheme} subdivisionScheme Whether the coordinates are for a quadtree or octree\n * @param {number} subtreeLevels The number of distinct levels within the coordinate's subtree\n * @param {number} tileIndex The tile's index\n * @returns {ImplicitTileCoordinates} The coordinates of the tile with the given tile index\n * @private\n */\nImplicitTileCoordinates.fromTileIndex = function (\n  subdivisionScheme,\n  subtreeLevels,\n  tileIndex\n) {\n  let level;\n  let levelOffset;\n  let mortonIndex;\n\n  if (subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n    // Node count up to octree level: (8^L - 1) / (8-1)\n    // (8^L - 1) / (8-1) <= X < (8^(L+1) - 1) / (8-1)\n    // 8^L <= (7x + 1) < 8^(L+1)\n    // L <= log8(7x + 1) < L + 1\n    // L = floor(log8(7x + 1))\n    // L = floor(log2(7x + 1) / log2(8))\n    // L = floor(log2(7x + 1) / 3)\n    level = Math.floor(CesiumMath.log2(7 * tileIndex + 1) / 3);\n    levelOffset = ((1 << (3 * level)) - 1) / 7;\n    mortonIndex = tileIndex - levelOffset;\n  } else {\n    // Node count up to quadtree level: (4^L - 1) / (4-1)\n    // (4^L - 1) / (4-1) <= X < (4^(L+1) - 1) / (4-1)\n    // 4^L <= (3x + 1) < 4^(L+1)\n    // L <= log4(3x + 1) < L + 1\n    // L = floor(log4(3x + 1))\n    // L = floor(log2(3x + 1) / log2(4))\n    // L = floor(log2(3x + 1) / 2)\n    level = Math.floor(CesiumMath.log2(3 * tileIndex + 1) / 2);\n    levelOffset = ((1 << (2 * level)) - 1) / 3;\n    mortonIndex = tileIndex - levelOffset;\n  }\n\n  return ImplicitTileCoordinates.fromMortonIndex(\n    subdivisionScheme,\n    subtreeLevels,\n    level,\n    mortonIndex\n  );\n};\n\nexport default ImplicitTileCoordinates;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport Cesium3DTileOptimizationHint from \"./Cesium3DTileOptimizationHint.js\";\nimport Cesium3DTileRefine from \"./Cesium3DTileRefine.js\";\n\n/**\n * Traverses a {@link Cesium3DTileset} to determine which tiles to load and render.\n * This type describes an interface and is not intended to be instantiated directly.\n *\n * @alias Cesium3DTilesetTraversal\n * @constructor\n * @abstract\n *\n * @see Cesium3DTilesetBaseTraversal\n * @see Cesium3DTilesetSkipTraversal\n * @see Cesium3DTilesetMostDetailedTraversal\n *\n * @private\n */\nfunction Cesium3DTilesetTraversal() {}\n\n/**\n * Traverses a {@link Cesium3DTileset} to determine which tiles to load and render.\n *\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {FrameState} frameState\n */\nCesium3DTilesetTraversal.selectTiles = function (tileset, frameState) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Sort by farthest child first since this is going on a stack\n *\n * @private\n * @param {Cesium3DTile} a\n * @param {Cesium3DTile} b\n * @returns {number}\n */\nCesium3DTilesetTraversal.sortChildrenByDistanceToCamera = function (a, b) {\n  if (b._distanceToCamera === 0 && a._distanceToCamera === 0) {\n    return b._centerZDepth - a._centerZDepth;\n  }\n\n  return b._distanceToCamera - a._distanceToCamera;\n};\n\n/**\n * Determine if a tile can and should be traversed for children tiles that\n * would contribute to rendering the current view\n *\n * @private\n * @param {Cesium3DTile} tile\n * @returns {boolean}\n */\nCesium3DTilesetTraversal.canTraverse = function (tile) {\n  if (tile.children.length === 0) {\n    return false;\n  }\n  if (tile.hasTilesetContent || tile.hasImplicitContent) {\n    // Traverse external tileset to visit its root tile\n    // Don't traverse if the subtree is expired because it will be destroyed\n    return !tile.contentExpired;\n  }\n  return tile._screenSpaceError > tile.tileset.memoryAdjustedScreenSpaceError;\n};\n\n/**\n * Mark a tile as selected, and add it to the tileset's list of selected tiles\n *\n * @private\n * @param {Cesium3DTile} tile\n * @param {FrameState} frameState\n */\nCesium3DTilesetTraversal.selectTile = function (tile, frameState) {\n  if (tile.contentVisibility(frameState) === Intersect.OUTSIDE) {\n    return;\n  }\n\n  const { content, tileset } = tile;\n  if (content.featurePropertiesDirty) {\n    // A feature's property in this tile changed, the tile needs to be re-styled.\n    content.featurePropertiesDirty = false;\n    tile.lastStyleTime = 0; // Force applying the style to this tile\n    tileset._selectedTilesToStyle.push(tile);\n  } else if (tile._selectedFrame < frameState.frameNumber - 1) {\n    // Tile is newly selected; it is selected this frame, but was not selected last frame.\n    tileset._selectedTilesToStyle.push(tile);\n  }\n  tile._selectedFrame = frameState.frameNumber;\n  tileset._selectedTiles.push(tile);\n};\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @param {FrameState} frameState\n */\nCesium3DTilesetTraversal.visitTile = function (tile, frameState) {\n  ++tile.tileset._statistics.visited;\n  tile._visitedFrame = frameState.frameNumber;\n};\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @param {FrameState} frameState\n */\nCesium3DTilesetTraversal.touchTile = function (tile, frameState) {\n  if (tile._touchedFrame === frameState.frameNumber) {\n    // Prevents another pass from touching the frame again\n    return;\n  }\n  tile.tileset._cache.touch(tile);\n  tile._touchedFrame = frameState.frameNumber;\n};\n\n/**\n * Add a tile to the list of requested tiles, if appropriate\n *\n * @private\n * @param {Cesium3DTile} tile\n * @param {FrameState} frameState\n */\nCesium3DTilesetTraversal.loadTile = function (tile, frameState) {\n  const { tileset } = tile;\n  if (\n    tile._requestedFrame === frameState.frameNumber ||\n    (!tile.hasUnloadedRenderableContent && !tile.contentExpired)\n  ) {\n    return;\n  }\n\n  if (!isOnScreenLongEnough(tile, frameState)) {\n    return;\n  }\n\n  const cameraHasNotStoppedMovingLongEnough =\n    frameState.camera.timeSinceMoved < tileset.foveatedTimeDelay;\n  if (tile.priorityDeferred && cameraHasNotStoppedMovingLongEnough) {\n    return;\n  }\n\n  tile._requestedFrame = frameState.frameNumber;\n  tileset._requestedTiles.push(tile);\n};\n\n/**\n * Prevent unnecessary loads while camera is moving by getting the ratio of travel distance to tile size.\n *\n * @private\n * @param {Cesium3DTile} tile\n * @param {FrameState} frameState\n * @returns {boolean}\n */\nfunction isOnScreenLongEnough(tile, frameState) {\n  const { tileset } = tile;\n  if (!tileset._cullRequestsWhileMoving) {\n    return true;\n  }\n\n  const {\n    positionWCDeltaMagnitude,\n    positionWCDeltaMagnitudeLastFrame,\n  } = frameState.camera;\n  const deltaMagnitude =\n    positionWCDeltaMagnitude !== 0.0\n      ? positionWCDeltaMagnitude\n      : positionWCDeltaMagnitudeLastFrame;\n\n  // How do n frames of this movement compare to the tile's physical size.\n  const diameter = Math.max(tile.boundingSphere.radius * 2.0, 1.0);\n  const movementRatio =\n    (tileset.cullRequestsWhileMovingMultiplier * deltaMagnitude) / diameter;\n\n  return movementRatio < 1.0;\n}\n\n/**\n * Reset some of the tile's flags and re-evaluate visibility and priority\n *\n * @private\n * @param {Cesium3DTile} tile\n * @param {FrameState} frameState\n */\nCesium3DTilesetTraversal.updateTile = function (tile, frameState) {\n  updateTileVisibility(tile, frameState);\n  tile.updateExpiration();\n\n  tile._wasMinPriorityChild = false;\n  tile._priorityHolder = tile;\n  updateMinimumMaximumPriority(tile);\n\n  // SkipLOD\n  tile._shouldSelect = false;\n  tile._finalResolution = true;\n};\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @param {FrameState} frameState\n */\nfunction updateTileVisibility(tile, frameState) {\n  tile.updateVisibility(frameState);\n\n  if (!tile.isVisible) {\n    return;\n  }\n\n  const hasChildren = tile.children.length > 0;\n  if ((tile.hasTilesetContent || tile.hasImplicitContent) && hasChildren) {\n    // Use the root tile's visibility instead of this tile's visibility.\n    // The root tile may be culled by the children bounds optimization in which\n    // case this tile should also be culled.\n    const child = tile.children[0];\n    updateTileVisibility(child, frameState);\n    tile._visible = child._visible;\n    return;\n  }\n\n  if (meetsScreenSpaceErrorEarly(tile, frameState)) {\n    tile._visible = false;\n    return;\n  }\n\n  // Optimization - if none of the tile's children are visible then this tile isn't visible\n  const replace = tile.refine === Cesium3DTileRefine.REPLACE;\n  const useOptimization =\n    tile._optimChildrenWithinParent ===\n    Cesium3DTileOptimizationHint.USE_OPTIMIZATION;\n  if (replace && useOptimization && hasChildren) {\n    if (!anyChildrenVisible(tile, frameState)) {\n      ++tile.tileset._statistics.numberOfTilesCulledWithChildrenUnion;\n      tile._visible = false;\n      return;\n    }\n  }\n}\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @param {FrameState} frameState\n * @returns {boolean}\n */\nfunction meetsScreenSpaceErrorEarly(tile, frameState) {\n  const { parent, tileset } = tile;\n  if (\n    !defined(parent) ||\n    parent.hasTilesetContent ||\n    parent.hasImplicitContent ||\n    parent.refine !== Cesium3DTileRefine.ADD\n  ) {\n    return false;\n  }\n\n  // Use parent's geometric error with child's box to see if the tile already meet the SSE\n  return (\n    tile.getScreenSpaceError(frameState, true) <=\n    tileset.memoryAdjustedScreenSpaceError\n  );\n}\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @param {FrameState} frameState\n * @returns {boolean}\n */\nfunction anyChildrenVisible(tile, frameState) {\n  let anyVisible = false;\n  const children = tile.children;\n  for (let i = 0; i < children.length; ++i) {\n    const child = children[i];\n    child.updateVisibility(frameState);\n    anyVisible = anyVisible || child.isVisible;\n  }\n  return anyVisible;\n}\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n */\nfunction updateMinimumMaximumPriority(tile) {\n  const minimumPriority = tile.tileset._minimumPriority;\n  const maximumPriority = tile.tileset._maximumPriority;\n  const priorityHolder = tile._priorityHolder;\n\n  maximumPriority.distance = Math.max(\n    priorityHolder._distanceToCamera,\n    maximumPriority.distance\n  );\n  minimumPriority.distance = Math.min(\n    priorityHolder._distanceToCamera,\n    minimumPriority.distance\n  );\n  maximumPriority.depth = Math.max(tile._depth, maximumPriority.depth);\n  minimumPriority.depth = Math.min(tile._depth, minimumPriority.depth);\n  maximumPriority.foveatedFactor = Math.max(\n    priorityHolder._foveatedFactor,\n    maximumPriority.foveatedFactor\n  );\n  minimumPriority.foveatedFactor = Math.min(\n    priorityHolder._foveatedFactor,\n    minimumPriority.foveatedFactor\n  );\n  maximumPriority.reverseScreenSpaceError = Math.max(\n    tile._priorityReverseScreenSpaceError,\n    maximumPriority.reverseScreenSpaceError\n  );\n  minimumPriority.reverseScreenSpaceError = Math.min(\n    tile._priorityReverseScreenSpaceError,\n    minimumPriority.reverseScreenSpaceError\n  );\n}\n\nexport default Cesium3DTilesetTraversal;\n", "import Intersect from \"../Core/Intersect.js\";\nimport ManagedArray from \"../Core/ManagedArray.js\";\nimport Cesium3DTileRefine from \"./Cesium3DTileRefine.js\";\nimport Cesium3DTilesetTraversal from \"./Cesium3DTilesetTraversal.js\";\n\n/**\n * Traversal that loads all leaves that intersect the camera frustum.\n * Used to determine ray-tileset intersections during a pickFromRayMostDetailed call.\n *\n * @alias Cesium3DTilesetMostDetailedTraversal\n * @constructor\n *\n * @private\n */\nfunction Cesium3DTilesetMostDetailedTraversal() {}\n\nconst traversal = {\n  stack: new ManagedArray(),\n  stackMaximumLength: 0,\n};\n\n/**\n * Traverses a {@link Cesium3DTileset} to determine which tiles to load and render.\n *\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {FrameState} frameState\n * @returns {boolean} Whether the appropriate tile is ready for picking\n */\nCesium3DTilesetMostDetailedTraversal.selectTiles = function (\n  tileset,\n  frameState\n) {\n  tileset._selectedTiles.length = 0;\n  tileset._requestedTiles.length = 0;\n  tileset.hasMixedContent = false;\n\n  let ready = true;\n\n  const root = tileset.root;\n  root.updateVisibility(frameState);\n\n  if (!root.isVisible) {\n    return ready;\n  }\n\n  const { touchTile, visitTile } = Cesium3DTilesetTraversal;\n\n  const stack = traversal.stack;\n  stack.push(root);\n\n  while (stack.length > 0) {\n    traversal.stackMaximumLength = Math.max(\n      traversal.stackMaximumLength,\n      stack.length\n    );\n\n    const tile = stack.pop();\n    const add = tile.refine === Cesium3DTileRefine.ADD;\n    const replace = tile.refine === Cesium3DTileRefine.REPLACE;\n    const traverse = canTraverse(tile);\n\n    if (traverse) {\n      updateAndPushChildren(tile, stack, frameState);\n    }\n\n    if (add || (replace && !traverse)) {\n      loadTile(tileset, tile);\n      touchTile(tile, frameState);\n      selectDesiredTile(tile, frameState);\n\n      if (tile.hasRenderableContent && !tile.contentAvailable) {\n        ready = false;\n      }\n    }\n\n    visitTile(tile, frameState);\n  }\n\n  traversal.stack.trim(traversal.stackMaximumLength);\n\n  return ready;\n};\n\nfunction canTraverse(tile) {\n  if (tile.children.length === 0) {\n    return false;\n  }\n\n  if (tile.hasTilesetContent || tile.hasImplicitContent) {\n    // Traverse external tileset to visit its root tile\n    // Don't traverse if the subtree is expired because it will be destroyed\n    return !tile.contentExpired;\n  }\n\n  if (tile.hasEmptyContent) {\n    return true;\n  }\n\n  return true; // Keep traversing until a leaf is hit\n}\n\nfunction updateAndPushChildren(tile, stack, frameState) {\n  const { children } = tile;\n\n  for (let i = 0; i < children.length; ++i) {\n    const child = children[i];\n    child.updateVisibility(frameState);\n    if (child.isVisible) {\n      stack.push(child);\n    }\n  }\n}\n\nfunction loadTile(tileset, tile) {\n  if (tile.hasUnloadedRenderableContent || tile.contentExpired) {\n    tile._priority = 0.0; // Highest priority\n    tileset._requestedTiles.push(tile);\n  }\n}\n\nfunction selectDesiredTile(tile, frameState) {\n  if (\n    tile.contentAvailable &&\n    tile.contentVisibility(frameState) !== Intersect.OUTSIDE\n  ) {\n    tile.tileset._selectedTiles.push(tile);\n  }\n}\n\nexport default Cesium3DTilesetMostDetailedTraversal;\n", "import defined from \"../Core/defined.js\";\nimport ManagedArray from \"../Core/ManagedArray.js\";\nimport Cesium3DTileRefine from \"./Cesium3DTileRefine.js\";\nimport Cesium3DTilesetTraversal from \"./Cesium3DTilesetTraversal.js\";\n\n/**\n * Depth-first traversal that traverses all visible tiles and marks tiles for selection.\n * A tile does not refine until all children are loaded.\n * This is the traditional replacement refinement approach and is called the base traversal.\n *\n * @alias Cesium3DTilesetBaseTraversal\n * @constructor\n *\n * @private\n */\nfunction Cesium3DTilesetBaseTraversal() {}\n\nconst traversal = {\n  stack: new ManagedArray(),\n  stackMaximumLength: 0,\n};\n\nconst emptyTraversal = {\n  stack: new ManagedArray(),\n  stackMaximumLength: 0,\n};\n\n/**\n * Traverses a {@link Cesium3DTileset} to determine which tiles to load and render.\n *\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {FrameState} frameState\n */\nCesium3DTilesetBaseTraversal.selectTiles = function (tileset, frameState) {\n  tileset._requestedTiles.length = 0;\n\n  if (tileset.debugFreezeFrame) {\n    return;\n  }\n\n  tileset._selectedTiles.length = 0;\n  tileset._selectedTilesToStyle.length = 0;\n  tileset._emptyTiles.length = 0;\n  tileset.hasMixedContent = false;\n\n  const root = tileset.root;\n  Cesium3DTilesetTraversal.updateTile(root, frameState);\n\n  if (!root.isVisible) {\n    return;\n  }\n\n  if (\n    root.getScreenSpaceError(frameState, true) <=\n    tileset.memoryAdjustedScreenSpaceError\n  ) {\n    return;\n  }\n\n  executeTraversal(root, frameState);\n\n  traversal.stack.trim(traversal.stackMaximumLength);\n  emptyTraversal.stack.trim(emptyTraversal.stackMaximumLength);\n\n  // Update the priority for any requests found during traversal\n  // Update after traversal so that min and max values can be used to normalize priority values\n  const requestedTiles = tileset._requestedTiles;\n  for (let i = 0; i < requestedTiles.length; ++i) {\n    requestedTiles[i].updatePriority();\n  }\n};\n\n/**\n * Mark a tile as selected if it has content available.\n *\n * @private\n * @param {Cesium3DTile} tile\n * @param {FrameState} frameState\n */\nfunction selectDesiredTile(tile, frameState) {\n  if (tile.contentAvailable) {\n    Cesium3DTilesetTraversal.selectTile(tile, frameState);\n  }\n}\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @param {ManagedArray} stack\n * @param {FrameState} frameState\n * @returns {boolean}\n */\nfunction updateAndPushChildren(tile, stack, frameState) {\n  const replace = tile.refine === Cesium3DTileRefine.REPLACE;\n  const { tileset, children } = tile;\n  const { updateTile, loadTile, touchTile } = Cesium3DTilesetTraversal;\n\n  for (let i = 0; i < children.length; ++i) {\n    updateTile(children[i], frameState);\n  }\n\n  // Sort by distance to take advantage of early Z and reduce artifacts for skipLevelOfDetail\n  children.sort(Cesium3DTilesetTraversal.sortChildrenByDistanceToCamera);\n\n  // For traditional replacement refinement only refine if all children are loaded.\n  // Empty tiles are exempt since it looks better if children stream in as they are loaded to fill the empty space.\n  const checkRefines = replace && tile.hasRenderableContent;\n  let refines = true;\n\n  let anyChildrenVisible = false;\n\n  // Determining min child\n  let minIndex = -1;\n  let minimumPriority = Number.MAX_VALUE;\n\n  for (let i = 0; i < children.length; ++i) {\n    const child = children[i];\n    if (child.isVisible) {\n      stack.push(child);\n      if (child._foveatedFactor < minimumPriority) {\n        minIndex = i;\n        minimumPriority = child._foveatedFactor;\n      }\n      anyChildrenVisible = true;\n    } else if (checkRefines || tileset.loadSiblings) {\n      // Keep non-visible children loaded since they are still needed before the parent can refine.\n      // Or loadSiblings is true so always load tiles regardless of visibility.\n      if (child._foveatedFactor < minimumPriority) {\n        minIndex = i;\n        minimumPriority = child._foveatedFactor;\n      }\n      loadTile(child, frameState);\n      touchTile(child, frameState);\n    }\n    if (checkRefines) {\n      let childRefines;\n      if (!child._inRequestVolume) {\n        childRefines = false;\n      } else if (!child.hasRenderableContent) {\n        childRefines = executeEmptyTraversal(child, frameState);\n      } else {\n        childRefines = child.contentAvailable;\n      }\n      refines = refines && childRefines;\n    }\n  }\n\n  if (!anyChildrenVisible) {\n    refines = false;\n  }\n\n  if (minIndex !== -1 && replace) {\n    // An ancestor will hold the _foveatedFactor and _distanceToCamera for descendants between itself and its highest priority descendant. Siblings of a min children along the way use this ancestor as their priority holder as well.\n    // Priority of all tiles that refer to the _foveatedFactor and _distanceToCamera stored in the common ancestor will be differentiated based on their _depth.\n    const minPriorityChild = children[minIndex];\n    minPriorityChild._wasMinPriorityChild = true;\n    const priorityHolder =\n      (tile._wasMinPriorityChild || tile === tileset.root) &&\n      minimumPriority <= tile._priorityHolder._foveatedFactor\n        ? tile._priorityHolder\n        : tile; // This is where priority dependency chains are wired up or started anew.\n    priorityHolder._foveatedFactor = Math.min(\n      minPriorityChild._foveatedFactor,\n      priorityHolder._foveatedFactor\n    );\n    priorityHolder._distanceToCamera = Math.min(\n      minPriorityChild._distanceToCamera,\n      priorityHolder._distanceToCamera\n    );\n\n    for (let i = 0; i < children.length; ++i) {\n      children[i]._priorityHolder = priorityHolder;\n    }\n  }\n\n  return refines;\n}\n\n/**\n * Depth-first traversal that traverses all visible tiles and marks tiles for selection.\n * A tile does not refine until all children are loaded.\n * This is the traditional replacement refinement approach and is called the base traversal.\n *\n * @private\n * @param {Cesium3DTile} root\n * @param {FrameState} frameState\n */\nfunction executeTraversal(root, frameState) {\n  const { tileset } = root;\n\n  const {\n    canTraverse,\n    loadTile,\n    visitTile,\n    touchTile,\n  } = Cesium3DTilesetTraversal;\n  const stack = traversal.stack;\n  stack.push(root);\n\n  while (stack.length > 0) {\n    traversal.stackMaximumLength = Math.max(\n      traversal.stackMaximumLength,\n      stack.length\n    );\n\n    const tile = stack.pop();\n\n    const parent = tile.parent;\n    const parentRefines = !defined(parent) || parent._refines;\n\n    tile._refines = canTraverse(tile)\n      ? updateAndPushChildren(tile, stack, frameState) && parentRefines\n      : false;\n\n    const stoppedRefining = !tile._refines && parentRefines;\n\n    if (!tile.hasRenderableContent) {\n      // Add empty tile just to show its debug bounding volume\n      // If the tile has tileset content load the external tileset\n      tileset._emptyTiles.push(tile);\n      loadTile(tile, frameState);\n      if (stoppedRefining) {\n        selectDesiredTile(tile, frameState);\n      }\n    } else if (tile.refine === Cesium3DTileRefine.ADD) {\n      // Additive tiles are always loaded and selected\n      selectDesiredTile(tile, frameState);\n      loadTile(tile, frameState);\n    } else if (tile.refine === Cesium3DTileRefine.REPLACE) {\n      loadTile(tile, frameState);\n      if (stoppedRefining) {\n        selectDesiredTile(tile, frameState);\n      }\n    }\n\n    visitTile(tile, frameState);\n    touchTile(tile, frameState);\n  }\n}\n\n/**\n * Depth-first traversal that checks if all nearest descendants with content are loaded.\n * Ignores visibility.\n *\n * @private\n * @param {Cesium3DTile} root\n * @param {FrameState} frameState\n * @returns {boolean}\n */\nfunction executeEmptyTraversal(root, frameState) {\n  const {\n    canTraverse,\n    updateTile,\n    loadTile,\n    touchTile,\n  } = Cesium3DTilesetTraversal;\n  let allDescendantsLoaded = true;\n  const stack = emptyTraversal.stack;\n  stack.push(root);\n\n  while (stack.length > 0) {\n    emptyTraversal.stackMaximumLength = Math.max(\n      emptyTraversal.stackMaximumLength,\n      stack.length\n    );\n\n    const tile = stack.pop();\n    const children = tile.children;\n    const childrenLength = children.length;\n\n    // Only traverse if the tile is empty - traversal stops at descendants with content\n    const traverse = !tile.hasRenderableContent && canTraverse(tile);\n    const emptyLeaf = !tile.hasRenderableContent && tile.children.length === 0;\n\n    // Traversal stops but the tile does not have content yet\n    // There will be holes if the parent tries to refine to its children, so don't refine\n    // One exception: a parent may refine even if one of its descendants is an empty leaf\n    if (!traverse && !tile.contentAvailable && !emptyLeaf) {\n      allDescendantsLoaded = false;\n    }\n\n    updateTile(tile, frameState);\n    if (!tile.isVisible) {\n      // Load tiles that aren't visible since they are still needed for the parent to refine\n      loadTile(tile, frameState);\n      touchTile(tile, frameState);\n    }\n\n    if (traverse) {\n      for (let i = 0; i < childrenLength; ++i) {\n        const child = children[i];\n        stack.push(child);\n      }\n    }\n  }\n\n  return allDescendantsLoaded;\n}\n\nexport default Cesium3DTilesetBaseTraversal;\n", "import defined from \"../Core/defined.js\";\nimport ManagedArray from \"../Core/ManagedArray.js\";\nimport Cesium3DTileRefine from \"./Cesium3DTileRefine.js\";\nimport Cesium3DTilesetTraversal from \"./Cesium3DTilesetTraversal.js\";\n\n/**\n * Depth-first traversal that traverses all visible tiles and marks tiles for selection.\n * Allows for skipping levels of the tree and rendering children and parent tiles simultaneously.\n *\n * @alias Cesium3DTilesetSkipTraversal\n * @constructor\n *\n * @private\n */\nfunction Cesium3DTilesetSkipTraversal() {}\n\nconst traversal = {\n  stack: new ManagedArray(),\n  stackMaximumLength: 0,\n};\n\nconst descendantTraversal = {\n  stack: new ManagedArray(),\n  stackMaximumLength: 0,\n};\n\nconst selectionTraversal = {\n  stack: new ManagedArray(),\n  stackMaximumLength: 0,\n  ancestorStack: new ManagedArray(),\n  ancestorStackMaximumLength: 0,\n};\n\nconst descendantSelectionDepth = 2;\n\n/**\n * Traverses a {@link Cesium3DTileset} to determine which tiles to load and render.\n *\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {FrameState} frameState\n */\nCesium3DTilesetSkipTraversal.selectTiles = function (tileset, frameState) {\n  tileset._requestedTiles.length = 0;\n\n  if (tileset.debugFreezeFrame) {\n    return;\n  }\n\n  tileset._selectedTiles.length = 0;\n  tileset._selectedTilesToStyle.length = 0;\n  tileset._emptyTiles.length = 0;\n  tileset.hasMixedContent = false;\n\n  const root = tileset.root;\n  Cesium3DTilesetTraversal.updateTile(root, frameState);\n\n  if (!root.isVisible) {\n    return;\n  }\n\n  if (\n    root.getScreenSpaceError(frameState, true) <=\n    tileset.memoryAdjustedScreenSpaceError\n  ) {\n    return;\n  }\n\n  executeTraversal(root, frameState);\n  traverseAndSelect(root, frameState);\n\n  traversal.stack.trim(traversal.stackMaximumLength);\n  descendantTraversal.stack.trim(descendantTraversal.stackMaximumLength);\n  selectionTraversal.stack.trim(selectionTraversal.stackMaximumLength);\n  selectionTraversal.ancestorStack.trim(\n    selectionTraversal.ancestorStackMaximumLength\n  );\n\n  // Update the priority for any requests found during traversal\n  // Update after traversal so that min and max values can be used to normalize priority values\n  const requestedTiles = tileset._requestedTiles;\n  for (let i = 0; i < requestedTiles.length; ++i) {\n    requestedTiles[i].updatePriority();\n  }\n};\n\n/**\n * Mark descendant tiles for rendering, and update as needed\n *\n * @private\n * @param {Cesium3DTile} root\n * @param {FrameState} frameState\n */\nfunction selectDescendants(root, frameState) {\n  const { updateTile, touchTile, selectTile } = Cesium3DTilesetTraversal;\n  const stack = descendantTraversal.stack;\n  stack.push(root);\n  while (stack.length > 0) {\n    descendantTraversal.stackMaximumLength = Math.max(\n      descendantTraversal.stackMaximumLength,\n      stack.length\n    );\n    const tile = stack.pop();\n    const children = tile.children;\n    for (let i = 0; i < children.length; ++i) {\n      const child = children[i];\n      if (child.isVisible) {\n        if (child.contentAvailable) {\n          updateTile(child, frameState);\n          touchTile(child, frameState);\n          selectTile(child, frameState);\n        } else if (child._depth - root._depth < descendantSelectionDepth) {\n          // Continue traversing, but not too far\n          stack.push(child);\n        }\n      }\n    }\n  }\n}\n\n/**\n * Mark a tile as selected if it has content available.\n * If its content is not available, and we are skipping levels of detail,\n * select an ancestor or descendant tile instead\n *\n * @private\n * @param {Cesium3DTile} tile\n * @param {FrameState} frameState\n */\nfunction selectDesiredTile(tile, frameState) {\n  // If this tile is not loaded attempt to select its ancestor instead\n  const loadedTile = tile.contentAvailable\n    ? tile\n    : tile._ancestorWithContentAvailable;\n  if (defined(loadedTile)) {\n    // Tiles will actually be selected in traverseAndSelect\n    loadedTile._shouldSelect = true;\n  } else {\n    // If no ancestors are ready traverse down and select tiles to minimize empty regions.\n    // This happens often for immediatelyLoadDesiredLevelOfDetail where parent tiles are not necessarily loaded before zooming out.\n    selectDescendants(tile, frameState);\n  }\n}\n\n/**\n * Update links to the ancestor tiles that have content\n *\n * @private\n * @param {Cesium3DTile} tile\n * @param {FrameState} frameState\n */\nfunction updateTileAncestorContentLinks(tile, frameState) {\n  tile._ancestorWithContent = undefined;\n  tile._ancestorWithContentAvailable = undefined;\n\n  const { parent } = tile;\n  if (!defined(parent)) {\n    return;\n  }\n  const parentHasContent =\n    !parent.hasUnloadedRenderableContent ||\n    parent._requestedFrame === frameState.frameNumber;\n\n  // ancestorWithContent is an ancestor that has content or has the potential to have\n  // content. Used in conjunction with tileset.skipLevels to know when to skip a tile.\n  tile._ancestorWithContent = parentHasContent\n    ? parent\n    : parent._ancestorWithContent;\n\n  // ancestorWithContentAvailable is an ancestor that is rendered if a desired tile is not loaded\n  tile._ancestorWithContentAvailable = parent.contentAvailable\n    ? parent\n    : parent._ancestorWithContentAvailable;\n}\n\n/**\n * Determine if a tile has reached the limit of level of detail skipping.\n * If so, it should _not_ be skipped: it should be loaded and rendered\n *\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {Cesium3DTile} tile\n * @returns {boolean} true if this tile should not be skipped\n */\nfunction reachedSkippingThreshold(tileset, tile) {\n  const ancestor = tile._ancestorWithContent;\n  return (\n    !tileset.immediatelyLoadDesiredLevelOfDetail &&\n    (tile._priorityProgressiveResolutionScreenSpaceErrorLeaf ||\n      (defined(ancestor) &&\n        tile._screenSpaceError <\n          ancestor._screenSpaceError / tileset.skipScreenSpaceErrorFactor &&\n        tile._depth > ancestor._depth + tileset.skipLevels))\n  );\n}\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @param {ManagedArray} stack\n * @param {FrameState} frameState\n * @returns {boolean}\n */\nfunction updateAndPushChildren(tile, stack, frameState) {\n  const { tileset, children } = tile;\n  const { updateTile, loadTile, touchTile } = Cesium3DTilesetTraversal;\n\n  for (let i = 0; i < children.length; ++i) {\n    updateTile(children[i], frameState);\n  }\n\n  // Sort by distance to take advantage of early Z and reduce artifacts\n  children.sort(Cesium3DTilesetTraversal.sortChildrenByDistanceToCamera);\n\n  let anyChildrenVisible = false;\n\n  for (let i = 0; i < children.length; ++i) {\n    const child = children[i];\n    if (child.isVisible) {\n      stack.push(child);\n      anyChildrenVisible = true;\n    } else if (tileset.loadSiblings) {\n      loadTile(child, frameState);\n      touchTile(child, frameState);\n    }\n  }\n\n  return anyChildrenVisible;\n}\n\n/**\n * Determine if a tile is part of the base traversal.\n * If not, this tile could be considered for level of detail skipping\n *\n * @private\n * @param {Cesium3DTile} tile\n * @param {number} baseScreenSpaceError\n * @returns {boolean}\n */\nfunction inBaseTraversal(tile, baseScreenSpaceError) {\n  const { tileset } = tile;\n  if (tileset.immediatelyLoadDesiredLevelOfDetail) {\n    return false;\n  }\n  if (!defined(tile._ancestorWithContent)) {\n    // Include root or near-root tiles in the base traversal so there is something to select up to\n    return true;\n  }\n  if (tile._screenSpaceError === 0.0) {\n    // If a leaf, use parent's SSE\n    return tile.parent._screenSpaceError > baseScreenSpaceError;\n  }\n  return tile._screenSpaceError > baseScreenSpaceError;\n}\n\n/**\n * Depth-first traversal that traverses all visible tiles and marks tiles for selection.\n * Tiles that have a greater screen space error than the base screen space error are part of the base traversal,\n * all other tiles are part of the skip traversal. The skip traversal allows for skipping levels of the tree\n * and rendering children and parent tiles simultaneously.\n *\n * @private\n * @param {Cesium3DTile} root\n * @param {FrameState} frameState\n */\nfunction executeTraversal(root, frameState) {\n  const { tileset } = root;\n  const baseScreenSpaceError = tileset.immediatelyLoadDesiredLevelOfDetail\n    ? Number.MAX_VALUE\n    : Math.max(\n        tileset.baseScreenSpaceError,\n        tileset.memoryAdjustedScreenSpaceError\n      );\n  const {\n    canTraverse,\n    loadTile,\n    visitTile,\n    touchTile,\n  } = Cesium3DTilesetTraversal;\n  const stack = traversal.stack;\n  stack.push(root);\n\n  while (stack.length > 0) {\n    traversal.stackMaximumLength = Math.max(\n      traversal.stackMaximumLength,\n      stack.length\n    );\n\n    const tile = stack.pop();\n\n    updateTileAncestorContentLinks(tile, frameState);\n    const parent = tile.parent;\n    const parentRefines = !defined(parent) || parent._refines;\n\n    tile._refines = canTraverse(tile)\n      ? updateAndPushChildren(tile, stack, frameState) && parentRefines\n      : false;\n\n    const stoppedRefining = !tile._refines && parentRefines;\n\n    if (!tile.hasRenderableContent) {\n      // Add empty tile just to show its debug bounding volume\n      // If the tile has tileset content load the external tileset\n      // If the tile cannot refine further select its nearest loaded ancestor\n      tileset._emptyTiles.push(tile);\n      loadTile(tile, frameState);\n      if (stoppedRefining) {\n        selectDesiredTile(tile, frameState);\n      }\n    } else if (tile.refine === Cesium3DTileRefine.ADD) {\n      // Additive tiles are always loaded and selected\n      selectDesiredTile(tile, frameState);\n      loadTile(tile, frameState);\n    } else if (tile.refine === Cesium3DTileRefine.REPLACE) {\n      if (inBaseTraversal(tile, baseScreenSpaceError)) {\n        // Always load tiles in the base traversal\n        // Select tiles that can't refine further\n        loadTile(tile, frameState);\n        if (stoppedRefining) {\n          selectDesiredTile(tile, frameState);\n        }\n      } else if (stoppedRefining) {\n        // In skip traversal, load and select tiles that can't refine further\n        selectDesiredTile(tile, frameState);\n        loadTile(tile, frameState);\n      } else if (reachedSkippingThreshold(tileset, tile)) {\n        // In skip traversal, load tiles that aren't skipped\n        loadTile(tile, frameState);\n      }\n    }\n\n    visitTile(tile, frameState);\n    touchTile(tile, frameState);\n  }\n}\n\n/**\n * Traverse the tree and check if their selected frame is the current frame. If so, add it to a selection queue.\n * This is a preorder traversal so children tiles are selected before ancestor tiles.\n *\n * The reason for the preorder traversal is so that tiles can easily be marked with their\n * selection depth. A tile's _selectionDepth is its depth in the tree where all non-selected tiles are removed.\n * This property is important for use in the stencil test because we want to render deeper tiles on top of their\n * ancestors. If a tileset is very deep, the depth is unlikely to fit into the stencil buffer.\n *\n * We want to select children before their ancestors because there is no guarantee on the relationship between\n * the children's z-depth and the ancestor's z-depth. We cannot rely on Z because we want the child to appear on top\n * of ancestor regardless of true depth. The stencil tests used require children to be drawn first.\n *\n * NOTE: 3D Tiles uses 3 bits from the stencil buffer meaning this will not work when there is a chain of\n * selected tiles that is deeper than 7. This is not very likely.\n *\n * @private\n * @param {Cesium3DTile} root\n * @param {FrameState} frameState\n */\nfunction traverseAndSelect(root, frameState) {\n  const { selectTile, canTraverse } = Cesium3DTilesetTraversal;\n  const { stack, ancestorStack } = selectionTraversal;\n  let lastAncestor;\n\n  stack.push(root);\n\n  while (stack.length > 0 || ancestorStack.length > 0) {\n    selectionTraversal.stackMaximumLength = Math.max(\n      selectionTraversal.stackMaximumLength,\n      stack.length\n    );\n    selectionTraversal.ancestorStackMaximumLength = Math.max(\n      selectionTraversal.ancestorStackMaximumLength,\n      ancestorStack.length\n    );\n\n    if (ancestorStack.length > 0) {\n      const waitingTile = ancestorStack.peek();\n      if (waitingTile._stackLength === stack.length) {\n        ancestorStack.pop();\n        if (waitingTile !== lastAncestor) {\n          waitingTile._finalResolution = false;\n        }\n        selectTile(waitingTile, frameState);\n        continue;\n      }\n    }\n\n    const tile = stack.pop();\n    if (!defined(tile)) {\n      // stack is empty but ancestorStack isn't\n      continue;\n    }\n\n    const traverse = canTraverse(tile);\n\n    if (tile._shouldSelect) {\n      if (tile.refine === Cesium3DTileRefine.ADD) {\n        selectTile(tile, frameState);\n      } else {\n        tile._selectionDepth = ancestorStack.length;\n        if (tile._selectionDepth > 0) {\n          tile.tileset.hasMixedContent = true;\n        }\n        lastAncestor = tile;\n        if (!traverse) {\n          selectTile(tile, frameState);\n          continue;\n        }\n        ancestorStack.push(tile);\n        tile._stackLength = stack.length;\n      }\n    }\n\n    if (traverse) {\n      const children = tile.children;\n      for (let i = 0; i < children.length; ++i) {\n        const child = children[i];\n        if (child.isVisible) {\n          stack.push(child);\n        }\n      }\n    }\n  }\n}\n\nexport default Cesium3DTilesetSkipTraversal;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Event from \"../Core/Event.js\";\nimport ImageBasedLighting from \"./ImageBasedLighting.js\";\nimport IonResource from \"../Core/IonResource.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport ManagedArray from \"../Core/ManagedArray.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport Axis from \"./Axis.js\";\nimport Cesium3DTile from \"./Cesium3DTile.js\";\nimport Cesium3DTileColorBlendMode from \"./Cesium3DTileColorBlendMode.js\";\nimport Cesium3DTileContentState from \"./Cesium3DTileContentState.js\";\nimport Cesium3DTilesetMetadata from \"./Cesium3DTilesetMetadata.js\";\nimport Cesium3DTileOptimizations from \"./Cesium3DTileOptimizations.js\";\nimport Cesium3DTilePass from \"./Cesium3DTilePass.js\";\nimport Cesium3DTileRefine from \"./Cesium3DTileRefine.js\";\nimport Cesium3DTilesetCache from \"./Cesium3DTilesetCache.js\";\nimport Cesium3DTilesetHeatmap from \"./Cesium3DTilesetHeatmap.js\";\nimport Cesium3DTilesetStatistics from \"./Cesium3DTilesetStatistics.js\";\nimport Cesium3DTileStyleEngine from \"./Cesium3DTileStyleEngine.js\";\nimport ClippingPlaneCollection from \"./ClippingPlaneCollection.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport ImplicitTileset from \"./ImplicitTileset.js\";\nimport ImplicitTileCoordinates from \"./ImplicitTileCoordinates.js\";\nimport LabelCollection from \"./LabelCollection.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport PointCloudEyeDomeLighting from \"./PointCloudEyeDomeLighting.js\";\nimport PointCloudShading from \"./PointCloudShading.js\";\nimport ResourceCache from \"./ResourceCache.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowMode from \"./ShadowMode.js\";\nimport SplitDirection from \"./SplitDirection.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport TileBoundingRegion from \"./TileBoundingRegion.js\";\nimport TileBoundingSphere from \"./TileBoundingSphere.js\";\nimport TileOrientedBoundingBox from \"./TileOrientedBoundingBox.js\";\nimport Cesium3DTilesetMostDetailedTraversal from \"./Cesium3DTilesetMostDetailedTraversal.js\";\nimport Cesium3DTilesetBaseTraversal from \"./Cesium3DTilesetBaseTraversal.js\";\nimport Cesium3DTilesetSkipTraversal from \"./Cesium3DTilesetSkipTraversal.js\";\n\n/**\n * @typedef {Object} Cesium3DTileset.ConstructorOptions\n *\n * Initialization options for the Cesium3DTileset constructor\n *\n * @property {boolean} [show=true] Determines if the tileset will be shown.\n * @property {Matrix4} [modelMatrix=Matrix4.IDENTITY] A 4x4 transformation matrix that transforms the tileset's root tile.\n * @property {Axis} [modelUpAxis=Axis.Y] Which axis is considered up when loading models for tile contents.\n * @property {Axis} [modelForwardAxis=Axis.X] Which axis is considered forward when loading models for tile contents.\n * @property {ShadowMode} [shadows=ShadowMode.ENABLED] Determines whether the tileset casts or receives shadows from light sources.\n * @property {number} [maximumScreenSpaceError=16] The maximum screen space error used to drive level of detail refinement.\n * @property {number} [cacheBytes=536870912] The size (in bytes) to which the tile cache will be trimmed, if the cache contains tiles not needed for the current view.\n * @property {number} [maximumCacheOverflowBytes=536870912] The maximum additional memory (in bytes) to allow for cache headroom, if more than {@link Cesium3DTileset#cacheBytes} are needed for the current view.\n * @property {boolean} [cullWithChildrenBounds=true] Optimization option. Whether to cull tiles using the union of their children bounding volumes.\n * @property {boolean} [cullRequestsWhileMoving=true] Optimization option. Don't request tiles that will likely be unused when they come back because of the camera's movement. This optimization only applies to stationary tilesets.\n * @property {number} [cullRequestsWhileMovingMultiplier=60.0] Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.\n * @property {boolean} [preloadWhenHidden=false] Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them.\n * @property {boolean} [preloadFlightDestinations=true] Optimization option. Preload tiles at the camera's flight destination while the camera is in flight.\n * @property {boolean} [preferLeaves=false] Optimization option. Prefer loading of leaves first.\n * @property {boolean} [dynamicScreenSpaceError=false] Optimization option. Reduce the screen space error for tiles that are further away from the camera.\n * @property {number} [dynamicScreenSpaceErrorDensity=0.00278] Density used to adjust the dynamic screen space error, similar to fog density.\n * @property {number} [dynamicScreenSpaceErrorFactor=4.0] A factor used to increase the computed dynamic screen space error.\n * @property {number} [dynamicScreenSpaceErrorHeightFalloff=0.25] A ratio of the tileset's height at which the density starts to falloff.\n * @property {number} [progressiveResolutionHeightFraction=0.3] Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of <code>progressiveResolutionHeightFraction*screenHeight</code> will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load.\n * @property {boolean} [foveatedScreenSpaceError=true] Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the screen space error for tiles around the edge of the screen. Screen space error returns to normal once all the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded.\n * @property {number} [foveatedConeSize=0.1] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred. Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and their screen space error. This is controlled by {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}. Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, disabling the effect.\n * @property {number} [foveatedMinimumScreenSpaceErrorRelaxation=0.0] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone. The screen space error will be raised starting with tileset value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}.\n * @property {Cesium3DTileset.foveatedInterpolationCallback} [foveatedInterpolationCallback=Math.lerp] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}\n * @property {number} [foveatedTimeDelay=0.2] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how long in seconds to wait after the camera stops moving before deferred tiles start loading in. This time delay prevents requesting tiles around the edges of the screen when the camera is moving. Setting this to 0.0 will immediately request all tiles in any given view.\n * @property {boolean} [skipLevelOfDetail=false] Optimization option. Determines if level of detail skipping should be applied during the traversal.\n * @property {number} [baseScreenSpaceError=1024] When <code>skipLevelOfDetail</code> is <code>true</code>, the screen space error that must be reached before skipping levels of detail.\n * @property {number} [skipScreenSpaceErrorFactor=16] When <code>skipLevelOfDetail</code> is <code>true</code>, a multiplier defining the minimum screen space error to skip. Used in conjunction with <code>skipLevels</code> to determine which tiles to load.\n * @property {number} [skipLevels=1] When <code>skipLevelOfDetail</code> is <code>true</code>, a constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped. Used in conjunction with <code>skipScreenSpaceErrorFactor</code> to determine which tiles to load.\n * @property {boolean} [immediatelyLoadDesiredLevelOfDetail=false] When <code>skipLevelOfDetail</code> is <code>true</code>, only tiles that meet the maximum screen space error will ever be downloaded. Skipping factors are ignored and just the desired tiles are loaded.\n * @property {boolean} [loadSiblings=false] When <code>skipLevelOfDetail</code> is <code>true</code>, determines whether siblings of visible tiles are always downloaded during traversal.\n * @property {ClippingPlaneCollection} [clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.\n * @property {ClassificationType} [classificationType] Determines whether terrain, 3D Tiles or both will be classified by this tileset. See {@link Cesium3DTileset#classificationType} for details about restrictions and limitations.\n * @property {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid determining the size and shape of the globe.\n * @property {object} [pointCloudShading] Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.\n * @property {Cartesian3} [lightColor] The light color when shading models. When <code>undefined</code> the scene's light color is used instead.\n * @property {ImageBasedLighting} [imageBasedLighting] The properties for managing image-based lighting for this tileset.\n * @property {boolean} [backFaceCulling=true] Whether to cull back-facing geometry. When true, back face culling is determined by the glTF material's doubleSided property; when false, back face culling is disabled.\n * @property {boolean} [enableShowOutline=true] Whether to enable outlines for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set to false to avoid the additional processing of geometry at load time. When false, the showOutlines and outlineColor options are ignored.\n * @property {boolean} [showOutline=true] Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed.\n * @property {Color} [outlineColor=Color.BLACK] The color to use when rendering outlines.\n * @property {boolean} [vectorClassificationOnly=false] Indicates that only the tileset's vector tiles should be used for classification.\n * @property {boolean} [vectorKeepDecodedPositions=false] Whether vector tiles should keep decoded positions in memory. This is used with {@link Cesium3DTileFeature.getPolylinePositions}.\n * @property {string|number} [featureIdLabel=\"featureId_0\"] Label of the feature ID set to use for picking and styling. For EXT_mesh_features, this is the feature ID's label property, or \"featureId_N\" (where N is the index in the featureIds array) when not specified. EXT_feature_metadata did not have a label field, so such feature ID sets are always labeled \"featureId_N\" where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string \"featureId_N\" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.\n * @property {string|number} [instanceFeatureIdLabel=\"instanceFeatureId_0\"] Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string \"instanceFeatureId_N\" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.\n * @property {boolean} [showCreditsOnScreen=false] Whether to display the credits of this tileset on screen.\n * @property {SplitDirection} [splitDirection=SplitDirection.NONE] The {@link SplitDirection} split to apply to this tileset.\n * @property {boolean} [projectTo2D=false] Whether to accurately project the tileset to 2D. If this is true, the tileset will be projected accurately to 2D, but it will use more memory to do so. If this is false, the tileset will use less memory and will still render in 2D / CV mode, but its projected positions may be inaccurate. This cannot be set after the tileset has loaded.\n * @property {string} [debugHeatmapTilePropertyName] The tile variable to colorize as a heatmap. All rendered tiles will be colorized relative to each other's specified variable value.\n * @property {boolean} [debugFreezeFrame=false] For debugging only. Determines if only the tiles from last frame should be used for rendering.\n * @property {boolean} [debugColorizeTiles=false] For debugging only. When true, assigns a random color to each tile.\n * @property {boolean} [enableDebugWireframe] For debugging only. This must be true for debugWireframe to work in WebGL1. This cannot be set after the tileset has loaded.\n * @property {boolean} [debugWireframe=false] For debugging only. When true, render's each tile's content as a wireframe.\n * @property {boolean} [debugShowBoundingVolume=false] For debugging only. When true, renders the bounding volume for each tile.\n * @property {boolean} [debugShowContentBoundingVolume=false] For debugging only. When true, renders the bounding volume for each tile's content.\n * @property {boolean} [debugShowViewerRequestVolume=false] For debugging only. When true, renders the viewer request volume for each tile.\n * @property {boolean} [debugShowGeometricError=false] For debugging only. When true, draws labels to indicate the geometric error of each tile.\n * @property {boolean} [debugShowRenderingStatistics=false] For debugging only. When true, draws labels to indicate the number of commands, points, triangles and features for each tile.\n * @property {boolean} [debugShowMemoryUsage=false] For debugging only. When true, draws labels to indicate the texture and geometry memory in megabytes used by each tile.\n * @property {boolean} [debugShowUrl=false] For debugging only. When true, draws labels to indicate the url of each tile.\n */\n\n/**\n * A {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles tileset},\n * used for streaming massive heterogeneous 3D geospatial datasets.\n *\n * <div class=\"notice\">\n * This object is normally not instantiated directly, use {@link Cesium3DTileset.fromUrl}.\n * </div>\n *\n * @alias Cesium3DTileset\n * @constructor\n *\n * @param {Cesium3DTileset.ConstructorOptions} options An object describing initialization options\n *\n * @exception {DeveloperError} The tileset must be 3D Tiles version 0.0 or 1.0.\n *\n * @example\n * try {\n *   const tileset = await Cesium.Cesium3DTileset.fromUrl(\n *      \"http://localhost:8002/tilesets/Seattle/tileset.json\"\n *   );\n *   scene.primitives.add(tileset);\n * } catch (error) {\n *   console.error(`Error creating tileset: ${error}`);\n * }\n *\n * @example\n * // Common setting for the skipLevelOfDetail optimization\n * const tileset = await Cesium.Cesium3DTileset.fromUrl(\n *   \"http://localhost:8002/tilesets/Seattle/tileset.json\", {\n *      skipLevelOfDetail: true,\n *      baseScreenSpaceError: 1024,\n *      skipScreenSpaceErrorFactor: 16,\n *      skipLevels: 1,\n *      immediatelyLoadDesiredLevelOfDetail: false,\n *      loadSiblings: false,\n *      cullWithChildrenBounds: true\n * });\n * scene.primitives.add(tileset);\n *\n * @example\n * // Common settings for the dynamicScreenSpaceError optimization\n * const tileset = await Cesium.Cesium3DTileset.fromUrl(\n *   \"http://localhost:8002/tilesets/Seattle/tileset.json\", {\n *      dynamicScreenSpaceError: true,\n *      dynamicScreenSpaceErrorDensity: 0.00278,\n *      dynamicScreenSpaceErrorFactor: 4.0,\n *      dynamicScreenSpaceErrorHeightFalloff: 0.25\n * });\n * scene.primitives.add(tileset);\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles specification}\n */\nfunction Cesium3DTileset(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._url = undefined;\n  this._basePath = undefined;\n  this._root = undefined;\n  this._resource = undefined;\n  this._asset = undefined; // Metadata for the entire tileset\n  this._properties = undefined; // Metadata for per-model/point/etc properties\n  this._geometricError = undefined; // Geometric error when the tree is not rendered at all\n  this._scaledGeometricError = undefined; // Geometric error scaled by root tile scale\n  this._extensionsUsed = undefined;\n  this._extensions = undefined;\n  this._modelUpAxis = undefined;\n  this._modelForwardAxis = undefined;\n  this._cache = new Cesium3DTilesetCache();\n  this._processingQueue = [];\n  this._selectedTiles = [];\n  this._emptyTiles = [];\n  this._requestedTiles = [];\n  this._selectedTilesToStyle = [];\n  this._loadTimestamp = undefined;\n  this._timeSinceLoad = 0.0;\n  this._updatedVisibilityFrame = 0;\n  this._updatedModelMatrixFrame = 0;\n  this._modelMatrixChanged = false;\n  this._previousModelMatrix = undefined;\n  this._extras = undefined;\n  this._credits = undefined;\n\n  this._showCreditsOnScreen = defaultValue(options.showCreditsOnScreen, false);\n\n  this._cullWithChildrenBounds = defaultValue(\n    options.cullWithChildrenBounds,\n    true\n  );\n  this._allTilesAdditive = true;\n\n  this._hasMixedContent = false;\n\n  this._stencilClearCommand = undefined;\n  this._backfaceCommands = new ManagedArray();\n\n  this._maximumScreenSpaceError = defaultValue(\n    options.maximumScreenSpaceError,\n    16\n  );\n  this._memoryAdjustedScreenSpaceError = this._maximumScreenSpaceError;\n\n  this._cacheBytes = defaultValue(options.cacheBytes, 512 * 1024 * 1024);\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThanOrEquals(\"cacheBytes\", this._cacheBytes, 0);\n  //>>includeEnd('debug');\n\n  const maximumCacheOverflowBytes = defaultValue(\n    options.maximumCacheOverflowBytes,\n    512 * 1024 * 1024\n  );\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThanOrEquals(\n    \"maximumCacheOverflowBytes\",\n    maximumCacheOverflowBytes,\n    0\n  );\n  //>>includeEnd('debug');\n  this._maximumCacheOverflowBytes = maximumCacheOverflowBytes;\n\n  this._styleEngine = new Cesium3DTileStyleEngine();\n  this._styleApplied = false;\n\n  this._modelMatrix = defined(options.modelMatrix)\n    ? Matrix4.clone(options.modelMatrix)\n    : Matrix4.clone(Matrix4.IDENTITY);\n\n  this._statistics = new Cesium3DTilesetStatistics();\n  this._statisticsLast = new Cesium3DTilesetStatistics();\n  this._statisticsPerPass = new Array(Cesium3DTilePass.NUMBER_OF_PASSES);\n\n  for (let i = 0; i < Cesium3DTilePass.NUMBER_OF_PASSES; ++i) {\n    this._statisticsPerPass[i] = new Cesium3DTilesetStatistics();\n  }\n\n  this._requestedTilesInFlight = [];\n\n  this._maximumPriority = {\n    foveatedFactor: -Number.MAX_VALUE,\n    depth: -Number.MAX_VALUE,\n    distance: -Number.MAX_VALUE,\n    reverseScreenSpaceError: -Number.MAX_VALUE,\n  };\n  this._minimumPriority = {\n    foveatedFactor: Number.MAX_VALUE,\n    depth: Number.MAX_VALUE,\n    distance: Number.MAX_VALUE,\n    reverseScreenSpaceError: Number.MAX_VALUE,\n  };\n  this._heatmap = new Cesium3DTilesetHeatmap(\n    options.debugHeatmapTilePropertyName\n  );\n\n  /**\n   * Optimization option. Don't request tiles that will likely be unused when they come back because of the camera's movement. This optimization only applies to stationary tilesets.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.cullRequestsWhileMoving = defaultValue(\n    options.cullRequestsWhileMoving,\n    true\n  );\n  this._cullRequestsWhileMoving = false;\n\n  /**\n   * Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.\n   *\n   * @type {number}\n   * @default 60.0\n   */\n  this.cullRequestsWhileMovingMultiplier = defaultValue(\n    options.cullRequestsWhileMovingMultiplier,\n    60.0\n  );\n\n  /**\n   * Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of <code>progressiveResolutionHeightFraction*screenHeight</code> will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load.\n   *\n   * @type {number}\n   * @default 0.3\n   */\n  this.progressiveResolutionHeightFraction = CesiumMath.clamp(\n    defaultValue(options.progressiveResolutionHeightFraction, 0.3),\n    0.0,\n    0.5\n  );\n\n  /**\n   * Optimization option. Prefer loading of leaves first.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.preferLeaves = defaultValue(options.preferLeaves, false);\n\n  this._tilesLoaded = false;\n  this._initialTilesLoaded = false;\n\n  this._tileDebugLabels = undefined;\n\n  this._classificationType = options.classificationType;\n\n  this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n  this._initialClippingPlanesOriginMatrix = Matrix4.IDENTITY; // Computed from the tileset JSON.\n  this._clippingPlanesOriginMatrix = undefined; // Combines the above with any run-time transforms.\n  this._clippingPlanesOriginMatrixDirty = true;\n\n  this._vectorClassificationOnly = defaultValue(\n    options.vectorClassificationOnly,\n    false\n  );\n\n  this._vectorKeepDecodedPositions = defaultValue(\n    options.vectorKeepDecodedPositions,\n    false\n  );\n\n  /**\n   * Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.preloadWhenHidden = defaultValue(options.preloadWhenHidden, false);\n\n  /**\n   * Optimization option. Fetch tiles at the camera's flight destination while the camera is in flight.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.preloadFlightDestinations = defaultValue(\n    options.preloadFlightDestinations,\n    true\n  );\n  this._pass = undefined; // Cesium3DTilePass\n\n  /**\n   * Optimization option. Whether the tileset should refine based on a dynamic screen space error. Tiles that are further\n   * away will be rendered with lower detail than closer tiles. This improves performance by rendering fewer\n   * tiles and making less requests, but may result in a slight drop in visual quality for tiles in the distance.\n   * The algorithm is biased towards \"street views\" where the camera is close to the ground plane of the tileset and looking\n   * at the horizon. In addition results are more accurate for tightly fitting bounding volumes like box and region.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.dynamicScreenSpaceError = defaultValue(\n    options.dynamicScreenSpaceError,\n    false\n  );\n\n  /**\n   * Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the\n   * screen space error for tiles around the edge of the screen. Screen space error returns to normal once all\n   * the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.foveatedScreenSpaceError = defaultValue(\n    options.foveatedScreenSpaceError,\n    true\n  );\n  this._foveatedConeSize = defaultValue(options.foveatedConeSize, 0.1);\n  this._foveatedMinimumScreenSpaceErrorRelaxation = defaultValue(\n    options.foveatedMinimumScreenSpaceErrorRelaxation,\n    0.0\n  );\n\n  /**\n   * Gets or sets a callback to control how much to raise the screen space error for tiles outside the foveated cone,\n   * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}.\n   *\n   * @type {Cesium3DTileset.foveatedInterpolationCallback}\n   */\n  this.foveatedInterpolationCallback = defaultValue(\n    options.foveatedInterpolationCallback,\n    CesiumMath.lerp\n  );\n\n  /**\n   * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control\n   * how long in seconds to wait after the camera stops moving before deferred tiles start loading in.\n   * This time delay prevents requesting tiles around the edges of the screen when the camera is moving.\n   * Setting this to 0.0 will immediately request all tiles in any given view.\n   *\n   * @type {number}\n   * @default 0.2\n   */\n  this.foveatedTimeDelay = defaultValue(options.foveatedTimeDelay, 0.2);\n\n  /**\n   * A scalar that determines the density used to adjust the dynamic screen space error, similar to {@link Fog}. Increasing this\n   * value has the effect of increasing the maximum screen space error for all tiles, but in a non-linear fashion.\n   * The error starts at 0.0 and increases exponentially until a midpoint is reached, and then approaches 1.0 asymptotically.\n   * This has the effect of keeping high detail in the closer tiles and lower detail in the further tiles, with all tiles\n   * beyond a certain distance all roughly having an error of 1.0.\n   * <p>\n   * The dynamic error is in the range [0.0, 1.0) and is multiplied by <code>dynamicScreenSpaceErrorFactor</code> to produce the\n   * final dynamic error. This dynamic error is then subtracted from the tile's actual screen space error.\n   * </p>\n   * <p>\n   * Increasing <code>dynamicScreenSpaceErrorDensity</code> has the effect of moving the error midpoint closer to the camera.\n   * It is analogous to moving fog closer to the camera.\n   * </p>\n   *\n   * @type {number}\n   * @default 0.00278\n   */\n  this.dynamicScreenSpaceErrorDensity = 0.00278;\n\n  /**\n   * A factor used to increase the screen space error of tiles for dynamic screen space error. As this value increases less tiles\n   * are requested for rendering and tiles in the distance will have lower detail. If set to zero, the feature will be disabled.\n   *\n   * @type {number}\n   * @default 4.0\n   */\n  this.dynamicScreenSpaceErrorFactor = 4.0;\n\n  /**\n   * A ratio of the tileset's height at which the density starts to falloff. If the camera is below this height the\n   * full computed density is applied, otherwise the density falls off. This has the effect of higher density at\n   * street level views.\n   * <p>\n   * Valid values are between 0.0 and 1.0.\n   * </p>\n   *\n   * @type {number}\n   * @default 0.25\n   */\n  this.dynamicScreenSpaceErrorHeightFalloff = 0.25;\n\n  this._dynamicScreenSpaceErrorComputedDensity = 0.0; // Updated based on the camera position and direction\n\n  /**\n   * Determines whether the tileset casts or receives shadows from light sources.\n   * <p>\n   * Enabling shadows has a performance impact. A tileset that casts shadows must be rendered twice, once from the camera and again from the light's point of view.\n   * </p>\n   * <p>\n   * Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>.\n   * </p>\n   *\n   * @type {ShadowMode}\n   * @default ShadowMode.ENABLED\n   */\n  this.shadows = defaultValue(options.shadows, ShadowMode.ENABLED);\n\n  /**\n   * Determines if the tileset will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  /**\n   * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from\n   * the original feature, e.g. glTF material or per-point color in the tile.\n   *\n   * @type {Cesium3DTileColorBlendMode}\n   * @default Cesium3DTileColorBlendMode.HIGHLIGHT\n   */\n  this.colorBlendMode = Cesium3DTileColorBlendMode.HIGHLIGHT;\n\n  /**\n   * Defines the value used to linearly interpolate between the source color and feature color when the {@link Cesium3DTileset#colorBlendMode} is <code>MIX</code>.\n   * A value of 0.0 results in the source color while a value of 1.0 results in the feature color, with any value in-between\n   * resulting in a mix of the source color and feature color.\n   *\n   * @type {number}\n   * @default 0.5\n   */\n  this.colorBlendAmount = 0.5;\n\n  this._pointCloudShading = new PointCloudShading(options.pointCloudShading);\n  this._pointCloudEyeDomeLighting = new PointCloudEyeDomeLighting();\n\n  /**\n   * The event fired to indicate progress of loading new tiles.  This event is fired when a new tile\n   * is requested, when a requested tile is finished downloading, and when a downloaded tile has been\n   * processed and is ready to render.\n   * <p>\n   * The number of pending tile requests, <code>numberOfPendingRequests</code>, and number of tiles\n   * processing, <code>numberOfTilesProcessing</code> are passed to the event listener.\n   * </p>\n   * <p>\n   * This event is fired at the end of the frame after the scene is rendered.\n   * </p>\n   *\n   * @type {Event}\n   * @default new Event()\n   *\n   * @example\n   * tileset.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) {\n   *     if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) {\n   *         console.log('Stopped loading');\n   *         return;\n   *     }\n   *\n   *     console.log(`Loading: requests: ${numberOfPendingRequests}, processing: ${numberOfTilesProcessing}`);\n   * });\n   */\n  this.loadProgress = new Event();\n\n  /**\n   * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. The tileset\n   * is completely loaded for this view.\n   * <p>\n   * This event is fired at the end of the frame after the scene is rendered.\n   * </p>\n   *\n   * @type {Event}\n   * @default new Event()\n   *\n   * @example\n   * tileset.allTilesLoaded.addEventListener(function() {\n   *     console.log('All tiles are loaded');\n   * });\n   *\n   * @see Cesium3DTileset#tilesLoaded\n   */\n  this.allTilesLoaded = new Event();\n\n  /**\n   * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. This event\n   * is fired once when all tiles in the initial view are loaded.\n   * <p>\n   * This event is fired at the end of the frame after the scene is rendered.\n   * </p>\n   *\n   * @type {Event}\n   * @default new Event()\n   *\n   * @example\n   * tileset.initialTilesLoaded.addEventListener(function() {\n   *     console.log('Initial tiles are loaded');\n   * });\n   *\n   * @see Cesium3DTileset#allTilesLoaded\n   */\n  this.initialTilesLoaded = new Event();\n\n  /**\n   * The event fired to indicate that a tile's content was loaded.\n   * <p>\n   * The loaded {@link Cesium3DTile} is passed to the event listener.\n   * </p>\n   * <p>\n   * This event is fired during the tileset traversal while the frame is being rendered\n   * so that updates to the tile take effect in the same frame.  Do not create or modify\n   * Cesium entities or primitives during the event listener.\n   * </p>\n   *\n   * @type {Event}\n   * @default new Event()\n   *\n   * @example\n   * tileset.tileLoad.addEventListener(function(tile) {\n   *     console.log('A tile was loaded.');\n   * });\n   */\n  this.tileLoad = new Event();\n\n  /**\n   * The event fired to indicate that a tile's content was unloaded.\n   * <p>\n   * The unloaded {@link Cesium3DTile} is passed to the event listener.\n   * </p>\n   * <p>\n   * This event is fired immediately before the tile's content is unloaded while the frame is being\n   * rendered so that the event listener has access to the tile's content.  Do not create\n   * or modify Cesium entities or primitives during the event listener.\n   * </p>\n   *\n   * @type {Event}\n   * @default new Event()\n   *\n   * @example\n   * tileset.tileUnload.addEventListener(function(tile) {\n   *     console.log('A tile was unloaded from the cache.');\n   * });\n   *\n   * @see Cesium3DTileset#cacheBytes\n   * @see Cesium3DTileset#trimLoadedTiles\n   */\n  this.tileUnload = new Event();\n\n  /**\n   * The event fired to indicate that a tile's content failed to load.\n   * <p>\n   * If there are no event listeners, error messages will be logged to the console.\n   * </p>\n   * <p>\n   * The error object passed to the listener contains two properties:\n   * <ul>\n   * <li><code>url</code>: the url of the failed tile.</li>\n   * <li><code>message</code>: the error message.</li>\n   * </ul>\n   * <p>\n   * If multiple contents are present, this event is raised once per inner content with errors.\n   * </p>\n   *\n   * @type {Event}\n   * @default new Event()\n   *\n   * @example\n   * tileset.tileFailed.addEventListener(function(error) {\n   *     console.log(`An error occurred loading tile: ${error.url}`);\n   *     console.log(`Error: ${error.message}`);\n   * });\n   */\n  this.tileFailed = new Event();\n\n  /**\n   * This event fires once for each visible tile in a frame.  This can be used to manually\n   * style a tileset.\n   * <p>\n   * The visible {@link Cesium3DTile} is passed to the event listener.\n   * </p>\n   * <p>\n   * This event is fired during the tileset traversal while the frame is being rendered\n   * so that updates to the tile take effect in the same frame.  Do not create or modify\n   * Cesium entities or primitives during the event listener.\n   * </p>\n   *\n   * @type {Event}\n   * @default new Event()\n   *\n   * @example\n   * tileset.tileVisible.addEventListener(function(tile) {\n   *     if (tile.content instanceof Cesium.Model3DTileContent) {\n   *         console.log('A 3D model tile is visible.');\n   *     }\n   * });\n   *\n   * @example\n   * // Apply a red style and then manually set random colors for every other feature when the tile becomes visible.\n   * tileset.style = new Cesium.Cesium3DTileStyle({\n   *     color : 'color(\"red\")'\n   * });\n   * tileset.tileVisible.addEventListener(function(tile) {\n   *     const content = tile.content;\n   *     const featuresLength = content.featuresLength;\n   *     for (let i = 0; i < featuresLength; i+=2) {\n   *         content.getFeature(i).color = Cesium.Color.fromRandom();\n   *     }\n   * });\n   */\n  this.tileVisible = new Event();\n\n  /**\n   * Optimization option. Determines if level of detail skipping should be applied during the traversal.\n   * <p>\n   * The common strategy for replacement-refinement traversal is to store all levels of the tree in memory and require\n   * all children to be loaded before the parent can refine. With this optimization levels of the tree can be skipped\n   * entirely and children can be rendered alongside their parents. The tileset requires significantly less memory when\n   * using this optimization.\n   * </p>\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.skipLevelOfDetail = defaultValue(options.skipLevelOfDetail, false);\n\n  this._disableSkipLevelOfDetail = false;\n\n  /**\n   * The screen space error that must be reached before skipping levels of detail.\n   * <p>\n   * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.\n   * </p>\n   *\n   * @type {number}\n   * @default 1024\n   */\n  this.baseScreenSpaceError = defaultValue(options.baseScreenSpaceError, 1024);\n\n  /**\n   * Multiplier defining the minimum screen space error to skip.\n   * For example, if a tile has screen space error of 100, no tiles will be loaded unless they\n   * are leaves or have a screen space error <code><= 100 / skipScreenSpaceErrorFactor</code>.\n   * <p>\n   * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.\n   * </p>\n   *\n   * @type {number}\n   * @default 16\n   */\n  this.skipScreenSpaceErrorFactor = defaultValue(\n    options.skipScreenSpaceErrorFactor,\n    16\n  );\n\n  /**\n   * Constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped.\n   * For example, if a tile is level 1, no tiles will be loaded unless they are at level greater than 2.\n   * <p>\n   * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.\n   * </p>\n   *\n   * @type {number}\n   * @default 1\n   */\n  this.skipLevels = defaultValue(options.skipLevels, 1);\n\n  /**\n   * When true, only tiles that meet the maximum screen space error will ever be downloaded.\n   * Skipping factors are ignored and just the desired tiles are loaded.\n   * <p>\n   * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.\n   * </p>\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.immediatelyLoadDesiredLevelOfDetail = defaultValue(\n    options.immediatelyLoadDesiredLevelOfDetail,\n    false\n  );\n\n  /**\n   * Determines whether siblings of visible tiles are always downloaded during traversal.\n   * This may be useful for ensuring that tiles are already available when the viewer turns left/right.\n   * <p>\n   * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.\n   * </p>\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.loadSiblings = defaultValue(options.loadSiblings, false);\n\n  this._clippingPlanes = undefined;\n  this.clippingPlanes = options.clippingPlanes;\n\n  if (defined(options.imageBasedLighting)) {\n    this._imageBasedLighting = options.imageBasedLighting;\n    this._shouldDestroyImageBasedLighting = false;\n  } else {\n    this._imageBasedLighting = new ImageBasedLighting();\n    this._shouldDestroyImageBasedLighting = true;\n  }\n\n  /**\n   * The light color when shading models. When <code>undefined</code> the scene's light color is used instead.\n   * <p>\n   * For example, disabling additional light sources by setting\n   * <code>tileset.imageBasedLighting.imageBasedLightingFactor = new Cartesian2(0.0, 0.0)</code>\n   * will make the tileset much darker. Here, increasing the intensity of the light source will make the tileset brighter.\n   * </p>\n   *\n   * @type {Cartesian3}\n   * @default undefined\n   */\n  this.lightColor = options.lightColor;\n\n  /**\n   * Whether to cull back-facing geometry. When true, back face culling is determined\n   * by the glTF material's doubleSided property; when false, back face culling is disabled.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.backFaceCulling = defaultValue(options.backFaceCulling, true);\n\n  this._enableShowOutline = defaultValue(options.enableShowOutline, true);\n\n  /**\n   * Whether to display the outline for models using the\n   * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension.\n   * When true, outlines are displayed. When false, outlines are not displayed.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.showOutline = defaultValue(options.showOutline, true);\n\n  /**\n   * The color to use when rendering outlines.\n   *\n   * @type {Color}\n   * @default Color.BLACK\n   */\n  this.outlineColor = defaultValue(options.outlineColor, Color.BLACK);\n\n  /**\n   * The {@link SplitDirection} to apply to this tileset.\n   *\n   * @type {SplitDirection}\n   * @default {@link SplitDirection.NONE}\n   */\n  this.splitDirection = defaultValue(\n    options.splitDirection,\n    SplitDirection.NONE\n  );\n\n  this._projectTo2D = defaultValue(options.projectTo2D, false);\n\n  /**\n   * This property is for debugging only; it is not optimized for production use.\n   * <p>\n   * Determines if only the tiles from last frame should be used for rendering.  This\n   * effectively \"freezes\" the tileset to the previous frame so it is possible to zoom\n   * out and see what was rendered.\n   * </p>\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.debugFreezeFrame = defaultValue(options.debugFreezeFrame, false);\n\n  /**\n   * This property is for debugging only; it is not optimized for production use.\n   * <p>\n   * When true, assigns a random color to each tile.  This is useful for visualizing\n   * what features belong to what tiles, especially with additive refinement where features\n   * from parent tiles may be interleaved with features from child tiles.\n   * </p>\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.debugColorizeTiles = defaultValue(options.debugColorizeTiles, false);\n\n  this._enableDebugWireframe = defaultValue(\n    options.enableDebugWireframe,\n    false\n  );\n\n  /**\n   * This property is for debugging only; it is not optimized for production use.\n   * <p>\n   * When true, renders each tile's content as a wireframe.\n   * </p>\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.debugWireframe = defaultValue(options.debugWireframe, false);\n\n  // Warning for improper setup of debug wireframe\n  if (this.debugWireframe === true && this._enableDebugWireframe === false) {\n    oneTimeWarning(\n      \"tileset-debug-wireframe-ignored\",\n      \"enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored.\"\n    );\n  }\n\n  /**\n   * This property is for debugging only; it is not optimized for production use.\n   * <p>\n   * When true, renders the bounding volume for each visible tile.  The bounding volume is\n   * white if the tile has a content bounding volume or is empty; otherwise, it is red.  Tiles that don't meet the\n   * screen space error and are still refining to their descendants are yellow.\n   * </p>\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.debugShowBoundingVolume = defaultValue(\n    options.debugShowBoundingVolume,\n    false\n  );\n\n  /**\n   * This property is for debugging only; it is not optimized for production use.\n   * <p>\n   * When true, renders the bounding volume for each visible tile's content. The bounding volume is\n   * blue if the tile has a content bounding volume; otherwise it is red.\n   * </p>\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.debugShowContentBoundingVolume = defaultValue(\n    options.debugShowContentBoundingVolume,\n    false\n  );\n\n  /**\n   * This property is for debugging only; it is not optimized for production use.\n   * <p>\n   * When true, renders the viewer request volume for each tile.\n   * </p>\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.debugShowViewerRequestVolume = defaultValue(\n    options.debugShowViewerRequestVolume,\n    false\n  );\n\n  /**\n   * @private\n   * @type {LabelCollection|undefined}\n   */\n  this._tileDebugLabels = undefined;\n  this.debugPickedTileLabelOnly = false;\n  this.debugPickedTile = undefined;\n  this.debugPickPosition = undefined;\n\n  /**\n   * This property is for debugging only; it is not optimized for production use.\n   * <p>\n   * When true, draws labels to indicate the geometric error of each tile.\n   * </p>\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.debugShowGeometricError = defaultValue(\n    options.debugShowGeometricError,\n    false\n  );\n\n  /**\n   * This property is for debugging only; it is not optimized for production use.\n   * <p>\n   * When true, draws labels to indicate the number of commands, points, triangles and features of each tile.\n   * </p>\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.debugShowRenderingStatistics = defaultValue(\n    options.debugShowRenderingStatistics,\n    false\n  );\n\n  /**\n   * This property is for debugging only; it is not optimized for production use.\n   * <p>\n   * When true, draws labels to indicate the geometry and texture memory usage of each tile.\n   * </p>\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.debugShowMemoryUsage = defaultValue(options.debugShowMemoryUsage, false);\n\n  /**\n   * This property is for debugging only; it is not optimized for production use.\n   * <p>\n   * When true, draws labels to indicate the url of each tile.\n   * </p>\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.debugShowUrl = defaultValue(options.debugShowUrl, false);\n\n  /**\n   * Function for examining vector lines as they are being streamed.\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @type {Function}\n   */\n  this.examineVectorLinesFunction = undefined;\n\n  // this is the underlying Cesium3DTileMetadata object, whether it came from\n  // the 3DTILES_metadata extension or a 3D Tiles 1.1 tileset JSON. Getters\n  // like tileset.metadata and tileset.schema will delegate to this object.\n  this._metadataExtension = undefined;\n\n  this._customShader = options.customShader;\n\n  let featureIdLabel = defaultValue(options.featureIdLabel, \"featureId_0\");\n  if (typeof featureIdLabel === \"number\") {\n    featureIdLabel = `featureId_${featureIdLabel}`;\n  }\n  this._featureIdLabel = featureIdLabel;\n\n  let instanceFeatureIdLabel = defaultValue(\n    options.instanceFeatureIdLabel,\n    \"instanceFeatureId_0\"\n  );\n  if (typeof instanceFeatureIdLabel === \"number\") {\n    instanceFeatureIdLabel = `instanceFeatureId_${instanceFeatureIdLabel}`;\n  }\n  this._instanceFeatureIdLabel = instanceFeatureIdLabel;\n}\n\nObject.defineProperties(Cesium3DTileset.prototype, {\n  /**\n   * NOTE: This getter exists so that `Picking.js` can differentiate between\n   *       PrimitiveCollection and Cesium3DTileset objects without inflating\n   *       the size of the module via `instanceof Cesium3DTileset`\n   * @private\n   */\n  isCesium3DTileset: {\n    get: function () {\n      return true;\n    },\n  },\n\n  /**\n   * Gets the tileset's asset object property, which contains metadata about the tileset.\n   * <p>\n   * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#reference-asset|asset schema reference}\n   * in the 3D Tiles spec for the full set of properties.\n   * </p>\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {object}\n   * @readonly\n   */\n  asset: {\n    get: function () {\n      return this._asset;\n    },\n  },\n\n  /**\n   * Gets the tileset's extensions object property.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {object}\n   * @readonly\n   */\n  extensions: {\n    get: function () {\n      return this._extensions;\n    },\n  },\n\n  /**\n   * The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {ClippingPlaneCollection}\n   */\n  clippingPlanes: {\n    get: function () {\n      return this._clippingPlanes;\n    },\n    set: function (value) {\n      ClippingPlaneCollection.setOwner(value, this, \"_clippingPlanes\");\n    },\n  },\n\n  /**\n   * Gets the tileset's properties dictionary object, which contains metadata about per-feature properties.\n   * <p>\n   * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#reference-properties|properties schema reference}\n   * in the 3D Tiles spec for the full set of properties.\n   * </p>\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {object}\n   * @readonly\n   *\n   * @example\n   * console.log(`Maximum building height: ${tileset.properties.height.maximum}`);\n   * console.log(`Minimum building height: ${tileset.properties.height.minimum}`);\n   *\n   * @see Cesium3DTileFeature#getProperty\n   * @see Cesium3DTileFeature#setProperty\n   */\n  properties: {\n    get: function () {\n      return this._properties;\n    },\n  },\n\n  /**\n   * When <code>true</code>, all tiles that meet the screen space error this frame are loaded. The tileset is\n   * completely loaded for this view.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   *\n   * @see Cesium3DTileset#allTilesLoaded\n   */\n  tilesLoaded: {\n    get: function () {\n      return this._tilesLoaded;\n    },\n  },\n\n  /**\n   * The resource used to fetch the tileset JSON file\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {Resource}\n   * @readonly\n   */\n  resource: {\n    get: function () {\n      return this._resource;\n    },\n  },\n\n  /**\n   * The base path that non-absolute paths in tileset JSON file are relative to.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {string}\n   * @readonly\n   * @deprecated\n   */\n  basePath: {\n    get: function () {\n      deprecationWarning(\n        \"Cesium3DTileset.basePath\",\n        \"Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead.\"\n      );\n      return this._basePath;\n    },\n  },\n\n  /**\n   * The style, defined using the\n   * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language},\n   * applied to each feature in the tileset.\n   * <p>\n   * Assign <code>undefined</code> to remove the style, which will restore the visual\n   * appearance of the tileset to its default when no style was applied.\n   * </p>\n   * <p>\n   * The style is applied to a tile before the {@link Cesium3DTileset#tileVisible}\n   * event is raised, so code in <code>tileVisible</code> can manually set a feature's\n   * properties (e.g. color and show) after the style is applied. When\n   * a new style is assigned any manually set properties are overwritten.\n   * </p>\n   * <p>\n   * Use an always \"true\" condition to specify the Color for all objects that are not\n   * overridden by pre-existing conditions. Otherwise, the default color Cesium.Color.White\n   * will be used. Similarly, use an always \"true\" condition to specify the show property\n   * for all objects that are not overridden by pre-existing conditions. Otherwise, the\n   * default show value true will be used.\n   * </p>\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {Cesium3DTileStyle|undefined}\n   *\n   * @default undefined\n   *\n   * @example\n   * tileset.style = new Cesium.Cesium3DTileStyle({\n   *    color : {\n   *        conditions : [\n   *            ['${Height} >= 100', 'color(\"purple\", 0.5)'],\n   *            ['${Height} >= 50', 'color(\"red\")'],\n   *            ['true', 'color(\"blue\")']\n   *        ]\n   *    },\n   *    show : '${Height} > 0',\n   *    meta : {\n   *        description : '\"Building id ${id} has height ${Height}.\"'\n   *    }\n   * });\n   *\n   * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}\n   */\n  style: {\n    get: function () {\n      return this._styleEngine.style;\n    },\n    set: function (value) {\n      this._styleEngine.style = value;\n    },\n  },\n\n  /**\n   * A custom shader to apply to all tiles in the tileset. Only used for\n   * contents that use {@link Model}. Using custom shaders with a\n   * {@link Cesium3DTileStyle} may lead to undefined behavior.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {CustomShader|undefined}\n   *\n   * @default undefined\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  customShader: {\n    get: function () {\n      return this._customShader;\n    },\n    set: function (value) {\n      this._customShader = value;\n    },\n  },\n\n  /**\n   * Whether the tileset is rendering different levels of detail in the same view.\n   * Only relevant if {@link Cesium3DTileset.isSkippingLevelOfDetail} is true.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {boolean}\n   * @private\n   */\n  hasMixedContent: {\n    get: function () {\n      return this._hasMixedContent;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.bool(\"value\", value);\n      //>>includeEnd('debug');\n\n      this._hasMixedContent = value;\n    },\n  },\n\n  /**\n   * Whether this tileset is actually skipping levels of detail.\n   * The user option may have been disabled if all tiles are using additive refinement,\n   * or if some tiles have a content type for which rendering does not support skipping\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {boolean}\n   * @private\n   * @readonly\n   */\n  isSkippingLevelOfDetail: {\n    get: function () {\n      return (\n        this.skipLevelOfDetail &&\n        !defined(this._classificationType) &&\n        !this._disableSkipLevelOfDetail &&\n        !this._allTilesAdditive\n      );\n    },\n  },\n\n  /**\n   * The tileset's schema, groups, tileset metadata and other details from the\n   * 3DTILES_metadata extension or a 3D Tiles 1.1 tileset JSON. This getter is\n   * for internal use by other classes.\n   *\n   * @memberof Cesium3DTileset.prototype\n   * @type {Cesium3DTilesetMetadata}\n   * @private\n   * @readonly\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  metadataExtension: {\n    get: function () {\n      return this._metadataExtension;\n    },\n  },\n\n  /**\n   * The metadata properties attached to the tileset as a whole.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {TilesetMetadata}\n   * @private\n   * @readonly\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  metadata: {\n    get: function () {\n      if (defined(this._metadataExtension)) {\n        return this._metadataExtension.tileset;\n      }\n\n      return undefined;\n    },\n  },\n\n  /**\n   * The metadata schema used in this tileset. Shorthand for\n   * <code>tileset.metadataExtension.schema</code>\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {MetadataSchema}\n   * @private\n   * @readonly\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  schema: {\n    get: function () {\n      if (defined(this._metadataExtension)) {\n        return this._metadataExtension.schema;\n      }\n\n      return undefined;\n    },\n  },\n\n  /**\n   * The maximum screen space error used to drive level of detail refinement.  This value helps determine when a tile\n   * refines to its descendants, and therefore plays a major role in balancing performance with visual quality.\n   * <p>\n   * A tile's screen space error is roughly equivalent to the number of pixels wide that would be drawn if a sphere with a\n   * radius equal to the tile's <b>geometric error</b> were rendered at the tile's position. If this value exceeds\n   * <code>maximumScreenSpaceError</code> the tile refines to its descendants.\n   * </p>\n   * <p>\n   * Depending on the tileset, <code>maximumScreenSpaceError</code> may need to be tweaked to achieve the right balance.\n   * Higher values provide better performance but lower visual quality.\n   * </p>\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {number}\n   * @default 16\n   *\n   * @exception {DeveloperError} <code>maximumScreenSpaceError</code> must be greater than or equal to zero.\n   */\n  maximumScreenSpaceError: {\n    get: function () {\n      return this._maximumScreenSpaceError;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\n        \"maximumScreenSpaceError\",\n        value,\n        0\n      );\n      //>>includeEnd('debug');\n\n      this._maximumScreenSpaceError = value;\n      this._memoryAdjustedScreenSpaceError = value;\n    },\n  },\n\n  /**\n   * The amount of GPU memory (in bytes) used to cache tiles. This memory usage is estimated from\n   * geometry, textures, and batch table textures of loaded tiles. For point clouds, this value also\n   * includes per-point metadata.\n   * <p>\n   * Tiles not in view are unloaded to enforce this.\n   * </p>\n   * <p>\n   * If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.\n   * </p>\n   * <p>\n   * If tiles sized more than <code>cacheBytes</code> are needed to meet the\n   * desired screen space error, determined by {@link Cesium3DTileset#maximumScreenSpaceError},\n   * for the current view, then the memory usage of the tiles loaded will exceed\n   * <code>cacheBytes</code> by up to <code>maximumCacheOverflowBytes</code>.\n   * For example, if <code>cacheBytes</code> is 500000, but 600000 bytes\n   * of tiles are needed to meet the screen space error, then 600000 bytes of tiles\n   * may be loaded (if <code>maximumCacheOverflowBytes</code> is at least 100000).\n   * When these tiles go out of view, they will be unloaded.\n   * </p>\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {number}\n   * @default 536870912\n   *\n   * @exception {DeveloperError} <code>cacheBytes</code> must be typeof 'number' and greater than or equal to 0\n   * @see Cesium3DTileset#totalMemoryUsageInBytes\n   */\n  cacheBytes: {\n    get: function () {\n      return this._cacheBytes;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"value\", value, 0);\n      //>>includeEnd('debug');\n\n      this._cacheBytes = value;\n    },\n  },\n\n  /**\n   * The maximum additional amount of GPU memory (in bytes) that will be used to cache tiles.\n   * <p>\n   * If tiles sized more than <code>cacheBytes</code> plus <code>maximumCacheOverflowBytes</code>\n   * are needed to meet the desired screen space error, determined by\n   * {@link Cesium3DTileset#maximumScreenSpaceError} for the current view, then\n   * {@link Cesium3DTileset#memoryAdjustedScreenSpaceError} will be adjusted\n   * until the tiles required to meet the adjusted screen space error use less\n   * than <code>cacheBytes</code> plus <code>maximumCacheOverflowBytes</code>.\n   * </p>\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {number}\n   * @default 536870912\n   *\n   * @exception {DeveloperError} <code>maximumCacheOverflowBytes</code> must be typeof 'number' and greater than or equal to 0\n   * @see Cesium3DTileset#totalMemoryUsageInBytes\n   */\n  maximumCacheOverflowBytes: {\n    get: function () {\n      return this._maximumCacheOverflowBytes;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"value\", value, 0);\n      //>>includeEnd('debug');\n\n      this._maximumCacheOverflowBytes = value;\n    },\n  },\n\n  /**\n   * If loading the level of detail required by @{link Cesium3DTileset#maximumScreenSpaceError}\n   * results in the memory usage exceeding @{link Cesium3DTileset#cacheBytes}\n   * plus @{link Cesium3DTileset#maximumCacheOverflowBytes}, level of detail refinement\n   * will instead use this (larger) adjusted screen space error to achieve the\n   * best possible visual quality within the available memory\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @private\n   */\n  memoryAdjustedScreenSpaceError: {\n    get: function () {\n      return this._memoryAdjustedScreenSpaceError;\n    },\n  },\n\n  /**\n   * Options for controlling point size based on geometric error and eye dome lighting.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {PointCloudShading}\n   */\n  pointCloudShading: {\n    get: function () {\n      return this._pointCloudShading;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"pointCloudShading\", value);\n      //>>includeEnd('debug');\n      this._pointCloudShading = value;\n    },\n  },\n\n  /**\n   * The root tile.\n   *\n   * @memberOf Cesium3DTileset.prototype\n   *\n   * @type {Cesium3DTile}\n   * @readonly\n   */\n  root: {\n    get: function () {\n      return this._root;\n    },\n  },\n\n  /**\n   * The tileset's bounding sphere.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {BoundingSphere}\n   * @readonly\n   *\n   * @example\n   * const tileset = await Cesium.Cesium3DTileset.fromUrl(\"http://localhost:8002/tilesets/Seattle/tileset.json\");\n   *\n   * viewer.scene.primitives.add(tileset);\n   *\n   * // Set the camera to view the newly added tileset\n   * viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));\n   */\n  boundingSphere: {\n    get: function () {\n      this._root.updateTransform(this._modelMatrix);\n      return this._root.boundingSphere;\n    },\n  },\n\n  /**\n   * A 4x4 transformation matrix that transforms the entire tileset.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {Matrix4}\n   * @default Matrix4.IDENTITY\n   *\n   * @example\n   * // Adjust a tileset's height from the globe's surface.\n   * const heightOffset = 20.0;\n   * const boundingSphere = tileset.boundingSphere;\n   * const cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);\n   * const surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);\n   * const offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset);\n   * const translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());\n   * tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);\n   */\n  modelMatrix: {\n    get: function () {\n      return this._modelMatrix;\n    },\n    set: function (value) {\n      this._modelMatrix = Matrix4.clone(value, this._modelMatrix);\n    },\n  },\n\n  /**\n   * Returns the time, in milliseconds, since the tileset was loaded and first updated.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  timeSinceLoad: {\n    get: function () {\n      return this._timeSinceLoad;\n    },\n  },\n\n  /**\n   * The total amount of GPU memory in bytes used by the tileset. This value is estimated from\n   * geometry, texture, batch table textures, and binary metadata of loaded tiles.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @see Cesium3DTileset#cacheBytes\n   */\n  totalMemoryUsageInBytes: {\n    get: function () {\n      const statistics = this._statistics;\n      return (\n        statistics.texturesByteLength +\n        statistics.geometryByteLength +\n        statistics.batchTableByteLength\n      );\n    },\n  },\n\n  /**\n   * @private\n   */\n  clippingPlanesOriginMatrix: {\n    get: function () {\n      if (!defined(this._clippingPlanesOriginMatrix)) {\n        return Matrix4.IDENTITY;\n      }\n\n      if (this._clippingPlanesOriginMatrixDirty) {\n        Matrix4.multiply(\n          this.root.computedTransform,\n          this._initialClippingPlanesOriginMatrix,\n          this._clippingPlanesOriginMatrix\n        );\n        this._clippingPlanesOriginMatrixDirty = false;\n      }\n\n      return this._clippingPlanesOriginMatrix;\n    },\n  },\n\n  /**\n   * @private\n   */\n  styleEngine: {\n    get: function () {\n      return this._styleEngine;\n    },\n  },\n\n  /**\n   * @private\n   */\n  statistics: {\n    get: function () {\n      return this._statistics;\n    },\n  },\n\n  /**\n   * Determines whether terrain, 3D Tiles, or both will be classified by this tileset.\n   * <p>\n   * This option is only applied to tilesets containing batched 3D models,\n   * glTF content, geometry data, or vector data. Even when undefined, vector\n   * and geometry data must render as classifications and will default to\n   * rendering on both terrain and other 3D Tiles tilesets.\n   * </p>\n   * <p>\n   * When enabled for batched 3D model and glTF tilesets, there are a few\n   * requirements/limitations on the glTF:\n   * <ul>\n   *     <li>The glTF cannot contain morph targets, skins, or animations.</li>\n   *     <li>The glTF cannot contain the <code>EXT_mesh_gpu_instancing</code> extension.</li>\n   *     <li>Only meshes with TRIANGLES can be used to classify other assets.</li>\n   *     <li>The <code>POSITION</code> semantic is required.</li>\n   *     <li>If <code>_BATCHID</code>s and an index buffer are both present, all indices with the same batch id must occupy contiguous sections of the index buffer.</li>\n   *     <li>If <code>_BATCHID</code>s are present with no index buffer, all positions with the same batch id must occupy contiguous sections of the position buffer.</li>\n   * </ul>\n   * </p>\n   * <p>\n   * Additionally, classification is not supported for points or instanced 3D\n   * models.\n   * </p>\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {ClassificationType}\n   * @default undefined\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   * @readonly\n   */\n  classificationType: {\n    get: function () {\n      return this._classificationType;\n    },\n  },\n\n  /**\n   * Gets an ellipsoid describing the shape of the globe.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {Ellipsoid}\n   * @readonly\n   */\n  ellipsoid: {\n    get: function () {\n      return this._ellipsoid;\n    },\n  },\n\n  /**\n   * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred.\n   * Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}.\n   * Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, essentially disabling the effect.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {number}\n   * @default 0.3\n   */\n  foveatedConeSize: {\n    get: function () {\n      return this._foveatedConeSize;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"foveatedConeSize\", value, 0.0);\n      Check.typeOf.number.lessThanOrEquals(\"foveatedConeSize\", value, 1.0);\n      //>>includeEnd('debug');\n\n      this._foveatedConeSize = value;\n    },\n  },\n\n  /**\n   * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone.\n   * The screen space error will be raised starting with this value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {number}\n   * @default 0.0\n   */\n  foveatedMinimumScreenSpaceErrorRelaxation: {\n    get: function () {\n      return this._foveatedMinimumScreenSpaceErrorRelaxation;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\n        \"foveatedMinimumScreenSpaceErrorRelaxation\",\n        value,\n        0.0\n      );\n      Check.typeOf.number.lessThanOrEquals(\n        \"foveatedMinimumScreenSpaceErrorRelaxation\",\n        value,\n        this.maximumScreenSpaceError\n      );\n      //>>includeEnd('debug');\n\n      this._foveatedMinimumScreenSpaceErrorRelaxation = value;\n    },\n  },\n\n  /**\n   * Returns the <code>extras</code> property at the top-level of the tileset JSON, which contains application specific metadata.\n   * Returns <code>undefined</code> if <code>extras</code> does not exist.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {*}\n   * @readonly\n   *\n   * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#specifying-extensions-and-application-specific-extras|Extras in the 3D Tiles specification.}\n   */\n  extras: {\n    get: function () {\n      return this._extras;\n    },\n  },\n\n  /**\n   * The properties for managing image-based lighting on this tileset.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {ImageBasedLighting}\n   */\n  imageBasedLighting: {\n    get: function () {\n      return this._imageBasedLighting;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.object(\"imageBasedLighting\", this._imageBasedLighting);\n      //>>includeEnd('debug');\n      if (value !== this._imageBasedLighting) {\n        if (\n          this._shouldDestroyImageBasedLighting &&\n          !this._imageBasedLighting.isDestroyed()\n        ) {\n          this._imageBasedLighting.destroy();\n        }\n        this._imageBasedLighting = value;\n        this._shouldDestroyImageBasedLighting = false;\n      }\n    },\n  },\n\n  /**\n   * Indicates that only the tileset's vector tiles should be used for classification.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  vectorClassificationOnly: {\n    get: function () {\n      return this._vectorClassificationOnly;\n    },\n  },\n\n  /**\n   * Whether vector tiles should keep decoded positions in memory.\n   * This is used with {@link Cesium3DTileFeature.getPolylinePositions}.\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  vectorKeepDecodedPositions: {\n    get: function () {\n      return this._vectorKeepDecodedPositions;\n    },\n  },\n\n  /**\n   * Determines whether the credits of the tileset will be displayed on the screen\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {boolean}\n   * @default false\n   */\n  showCreditsOnScreen: {\n    get: function () {\n      return this._showCreditsOnScreen;\n    },\n    set: function (value) {\n      this._showCreditsOnScreen = value;\n      createCredits(this);\n    },\n  },\n\n  /**\n   * Label of the feature ID set to use for picking and styling.\n   * <p>\n   * For EXT_mesh_features, this is the feature ID's label property, or\n   * \"featureId_N\" (where N is the index in the featureIds array) when not\n   * specified. EXT_feature_metadata did not have a label field, so such\n   * feature ID sets are always labeled \"featureId_N\" where N is the index in\n   * the list of all feature Ids, where feature ID attributes are listed before\n   * feature ID textures.\n   * </p>\n   * <p>\n   * If featureIdLabel is set to an integer N, it is converted to\n   * the string \"featureId_N\" automatically. If both per-primitive and\n   * per-instance feature IDs are present, the instance feature IDs take\n   * priority.\n   * </p>\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {string}\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  featureIdLabel: {\n    get: function () {\n      return this._featureIdLabel;\n    },\n    set: function (value) {\n      // indices get converted into featureId_N\n      if (typeof value === \"number\") {\n        value = `featureId_${value}`;\n      }\n\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.string(\"value\", value);\n      //>>includeEnd('debug');\n\n      this._featureIdLabel = value;\n    },\n  },\n\n  /**\n   * Label of the instance feature ID set used for picking and styling.\n   * <p>\n   * If instanceFeatureIdLabel is set to an integer N, it is converted to\n   * the string \"instanceFeatureId_N\" automatically.\n   * If both per-primitive and per-instance feature IDs are present, the\n   * instance feature IDs take priority.\n   * </p>\n   *\n   * @memberof Cesium3DTileset.prototype\n   *\n   * @type {string}\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  instanceFeatureIdLabel: {\n    get: function () {\n      return this._instanceFeatureIdLabel;\n    },\n    set: function (value) {\n      // indices get converted into instanceFeatureId_N\n      if (typeof value === \"number\") {\n        value = `instanceFeatureId_${value}`;\n      }\n\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.string(\"value\", value);\n      //>>includeEnd('debug');\n\n      this._instanceFeatureIdLabel = value;\n    },\n  },\n});\n\n/**\n * Creates a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles tileset},\n * used for streaming massive heterogeneous 3D geospatial datasets, from a Cesium ion asset ID.\n *\n * @param {number} assetId The Cesium ion asset id.\n * @param {Cesium3DTileset.ConstructorOptions} [options] An object describing initialization options\n * @returns {Promise<Cesium3DTileset>}\n *\n * @exception {DeveloperError} The tileset must be 3D Tiles version 0.0 or 1.0.\n *\n * @see Cesium3DTileset#fromUrl\n *\n * @example\n * // Load a Cesium3DTileset with a Cesium ion asset ID of 124624234\n * try {\n *   const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(124624234);\n *   scene.primitives.add(tileset);\n * } catch (error) {\n *   console.error(`Error creating tileset: ${error}`);\n * }\n */\nCesium3DTileset.fromIonAssetId = async function (assetId, options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"assetId\", assetId);\n  //>>includeEnd('debug');\n\n  const resource = await IonResource.fromAssetId(assetId);\n  return Cesium3DTileset.fromUrl(resource, options);\n};\n\n/**\n * Creates a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles tileset},\n * used for streaming massive heterogeneous 3D geospatial datasets.\n *\n * @param {Resource|string} url The url to a tileset JSON file.\n * @param {Cesium3DTileset.ConstructorOptions} [options] An object describing initialization options\n * @returns {Promise<Cesium3DTileset>}\n *\n * @exception {DeveloperError} The tileset must be 3D Tiles version 0.0 or 1.0.\n *\n * @see Cesium3DTileset#fromIonAssetId\n *\n * @example\n * try {\n *   const tileset = await Cesium.Cesium3DTileset.fromUrl(\n *      \"http://localhost:8002/tilesets/Seattle/tileset.json\"\n *   );\n *   scene.primitives.add(tileset);\n * } catch (error) {\n *   console.error(`Error creating tileset: ${error}`);\n * }\n *\n * @example\n * // Common setting for the skipLevelOfDetail optimization\n * const tileset = await Cesium.Cesium3DTileset.fromUrl(\n *   \"http://localhost:8002/tilesets/Seattle/tileset.json\", {\n *      skipLevelOfDetail: true,\n *      baseScreenSpaceError: 1024,\n *      skipScreenSpaceErrorFactor: 16,\n *      skipLevels: 1,\n *      immediatelyLoadDesiredLevelOfDetail: false,\n *      loadSiblings: false,\n *      cullWithChildrenBounds: true\n * });\n * scene.primitives.add(tileset);\n *\n * @example\n * // Common settings for the dynamicScreenSpaceError optimization\n * const tileset = await Cesium.Cesium3DTileset.fromUrl(\n *   \"http://localhost:8002/tilesets/Seattle/tileset.json\", {\n *      dynamicScreenSpaceError: true,\n *      dynamicScreenSpaceErrorDensity: 0.00278,\n *      dynamicScreenSpaceErrorFactor: 4.0,\n *      dynamicScreenSpaceErrorHeightFalloff: 0.25\n * });\n * scene.primitives.add(tileset);\n */\nCesium3DTileset.fromUrl = async function (url, options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"url\", url);\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const resource = Resource.createIfNeeded(url);\n  let basePath;\n  if (resource.extension === \"json\") {\n    basePath = resource.getBaseUri(true);\n  } else if (resource.isDataUri) {\n    basePath = \"\";\n  }\n\n  const tilesetJson = await Cesium3DTileset.loadJson(resource);\n  const metadataExtension = await processMetadataExtension(\n    resource,\n    tilesetJson\n  );\n\n  const tileset = new Cesium3DTileset(options);\n  tileset._resource = resource;\n  tileset._url = resource.url;\n  tileset._basePath = basePath;\n  tileset._metadataExtension = metadataExtension;\n  // Set these before loading the tileset since _geometricError\n  // and _scaledGeometricError get accessed during tile creation\n  tileset._geometricError = tilesetJson.geometricError;\n  tileset._scaledGeometricError = tilesetJson.geometricError;\n\n  const asset = tilesetJson.asset;\n  tileset._asset = asset;\n  tileset._extras = tilesetJson.extras;\n\n  createCredits(tileset);\n\n  // Handle legacy gltfUpAxis option\n  const gltfUpAxis = defined(tilesetJson.asset.gltfUpAxis)\n    ? Axis.fromName(tilesetJson.asset.gltfUpAxis)\n    : Axis.Y;\n  const modelUpAxis = defaultValue(options.modelUpAxis, gltfUpAxis);\n  const modelForwardAxis = defaultValue(options.modelForwardAxis, Axis.X);\n\n  tileset._properties = tilesetJson.properties;\n  tileset._extensionsUsed = tilesetJson.extensionsUsed;\n  tileset._extensions = tilesetJson.extensions;\n  tileset._modelUpAxis = modelUpAxis;\n  tileset._modelForwardAxis = modelForwardAxis;\n\n  tileset._root = tileset.loadTileset(resource, tilesetJson);\n\n  // Save the original, untransformed bounding volume position so we can apply\n  // the tile transform and model matrix at run time\n  const boundingVolume = tileset._root.createBoundingVolume(\n    tilesetJson.root.boundingVolume,\n    Matrix4.IDENTITY\n  );\n  const clippingPlanesOrigin = boundingVolume.boundingSphere.center;\n  // If this origin is above the surface of the earth\n  // we want to apply an ENU orientation as our best guess of orientation.\n  // Otherwise, we assume it gets its position/orientation completely from the\n  // root tile transform and the tileset's model matrix\n  const originCartographic = tileset._ellipsoid.cartesianToCartographic(\n    clippingPlanesOrigin\n  );\n  if (\n    defined(originCartographic) &&\n    originCartographic.height >\n      ApproximateTerrainHeights._defaultMinTerrainHeight\n  ) {\n    tileset._initialClippingPlanesOriginMatrix = Transforms.eastNorthUpToFixedFrame(\n      clippingPlanesOrigin\n    );\n  }\n  tileset._clippingPlanesOriginMatrix = Matrix4.clone(\n    tileset._initialClippingPlanesOriginMatrix\n  );\n\n  return tileset;\n};\n\n/**\n * Provides a hook to override the method used to request the tileset json\n * useful when fetching tilesets from remote servers\n * @param {Resource|string} tilesetUrl The url of the json file to be fetched\n * @returns {Promise<object>} A promise that resolves with the fetched json data\n */\nCesium3DTileset.loadJson = function (tilesetUrl) {\n  const resource = Resource.createIfNeeded(tilesetUrl);\n  return resource.fetchJson();\n};\n\n/**\n * Marks the tileset's {@link Cesium3DTileset#style} as dirty, which forces all\n * features to re-evaluate the style in the next frame each is visible.\n */\nCesium3DTileset.prototype.makeStyleDirty = function () {\n  this._styleEngine.makeDirty();\n};\n\n/**\n * Loads the main tileset JSON file or a tileset JSON file referenced from a tile.\n *\n * @private\n */\nCesium3DTileset.prototype.loadTileset = function (\n  resource,\n  tilesetJson,\n  parentTile\n) {\n  const asset = tilesetJson.asset;\n  if (!defined(asset)) {\n    throw new RuntimeError(\"Tileset must have an asset property.\");\n  }\n  if (\n    asset.version !== \"0.0\" &&\n    asset.version !== \"1.0\" &&\n    asset.version !== \"1.1\"\n  ) {\n    throw new RuntimeError(\n      \"The tileset must be 3D Tiles version 0.0, 1.0, or 1.1\"\n    );\n  }\n\n  if (defined(tilesetJson.extensionsRequired)) {\n    Cesium3DTileset.checkSupportedExtensions(tilesetJson.extensionsRequired);\n  }\n\n  const statistics = this._statistics;\n\n  const tilesetVersion = asset.tilesetVersion;\n  if (defined(tilesetVersion)) {\n    // Append the tileset version to the resource\n    this._basePath += `?v=${tilesetVersion}`;\n    resource = resource.clone();\n    resource.setQueryParameters({ v: tilesetVersion });\n  }\n\n  // A tileset JSON file referenced from a tile may exist in a different directory than the root tileset.\n  // Get the basePath relative to the external tileset.\n  const rootTile = makeTile(this, resource, tilesetJson.root, parentTile);\n\n  // If there is a parentTile, add the root of the currently loading tileset\n  // to parentTile's children, and update its _depth.\n  if (defined(parentTile)) {\n    parentTile.children.push(rootTile);\n    rootTile._depth = parentTile._depth + 1;\n  }\n\n  const stack = [];\n  stack.push(rootTile);\n\n  while (stack.length > 0) {\n    const tile = stack.pop();\n    ++statistics.numberOfTilesTotal;\n    this._allTilesAdditive =\n      this._allTilesAdditive && tile.refine === Cesium3DTileRefine.ADD;\n    const children = tile._header.children;\n    if (defined(children)) {\n      for (let i = 0; i < children.length; ++i) {\n        const childHeader = children[i];\n        const childTile = makeTile(this, resource, childHeader, tile);\n        tile.children.push(childTile);\n        childTile._depth = tile._depth + 1;\n        stack.push(childTile);\n      }\n    }\n\n    if (this._cullWithChildrenBounds) {\n      Cesium3DTileOptimizations.checkChildrenWithinParent(tile);\n    }\n  }\n\n  return rootTile;\n};\n\n/**\n * Make a {@link Cesium3DTile} for a specific tile. If the tile's header has implicit\n * tiling (3D Tiles 1.1) or uses the <code>3DTILES_implicit_tiling</code> extension,\n * it creates a placeholder tile instead for lazy evaluation of the implicit tileset.\n *\n * @param {Cesium3DTileset} tileset The tileset\n * @param {Resource} baseResource The base resource for the tileset\n * @param {object} tileHeader The JSON header for the tile\n * @param {Cesium3DTile} [parentTile] The parent tile of the new tile\n * @returns {Cesium3DTile} The newly created tile\n *\n * @private\n */\nfunction makeTile(tileset, baseResource, tileHeader, parentTile) {\n  const hasImplicitTiling =\n    defined(tileHeader.implicitTiling) ||\n    hasExtension(tileHeader, \"3DTILES_implicit_tiling\");\n\n  if (!hasImplicitTiling) {\n    return new Cesium3DTile(tileset, baseResource, tileHeader, parentTile);\n  }\n\n  const metadataSchema = tileset.schema;\n\n  const implicitTileset = new ImplicitTileset(\n    baseResource,\n    tileHeader,\n    metadataSchema\n  );\n  const rootCoordinates = new ImplicitTileCoordinates({\n    subdivisionScheme: implicitTileset.subdivisionScheme,\n    subtreeLevels: implicitTileset.subtreeLevels,\n    level: 0,\n    x: 0,\n    y: 0,\n    // The constructor will only use this for octrees.\n    z: 0,\n  });\n\n  // Create a placeholder Cesium3DTile that has an ImplicitTileset\n  // object and whose content will resolve to an Implicit3DTileContent\n  const contentUri = implicitTileset.subtreeUriTemplate.getDerivedResource({\n    templateValues: rootCoordinates.getTemplateValues(),\n  }).url;\n\n  const deepCopy = true;\n  const tileJson = clone(tileHeader, deepCopy);\n  // Replace contents with the subtree\n  tileJson.contents = [\n    {\n      uri: contentUri,\n    },\n  ];\n\n  delete tileJson.content;\n\n  // The placeholder tile does not have any extensions. If there are any\n  // extensions beyond 3DTILES_implicit_tiling, Implicit3DTileContent will\n  // copy them to the transcoded tiles.\n  delete tileJson.extensions;\n\n  const tile = new Cesium3DTile(tileset, baseResource, tileJson, parentTile);\n  tile.implicitTileset = implicitTileset;\n  tile.implicitCoordinates = rootCoordinates;\n  return tile;\n}\n\n/**\n * If tileset metadata is present, initialize the {@link Cesium3DTilesetMetadata}\n * instance. This is asynchronous since metadata schemas may be external.\n *\n * @param {Cesium3DTileset} tileset The tileset\n * @param {object} tilesetJson The tileset JSON\n * @return {Promise<Cesium3DTilesetMetadata>} The loaded Cesium3DTilesetMetadata\n * @private\n */\nasync function processMetadataExtension(resource, tilesetJson) {\n  const metadataJson = hasExtension(tilesetJson, \"3DTILES_metadata\")\n    ? tilesetJson.extensions[\"3DTILES_metadata\"]\n    : tilesetJson;\n\n  let schemaLoader;\n  if (defined(metadataJson.schemaUri)) {\n    resource = resource.getDerivedResource({\n      url: metadataJson.schemaUri,\n    });\n    schemaLoader = ResourceCache.getSchemaLoader({\n      resource: resource,\n    });\n  } else if (defined(metadataJson.schema)) {\n    schemaLoader = ResourceCache.getSchemaLoader({\n      schema: metadataJson.schema,\n    });\n  } else {\n    return;\n  }\n\n  await schemaLoader.load();\n\n  const metadataExtension = new Cesium3DTilesetMetadata({\n    schema: schemaLoader.schema,\n    metadataJson: metadataJson,\n  });\n\n  ResourceCache.unload(schemaLoader);\n\n  return metadataExtension;\n}\n\nconst scratchPositionNormal = new Cartesian3();\nconst scratchCartographic = new Cartographic();\nconst scratchMatrix = new Matrix4();\nconst scratchCenter = new Cartesian3();\nconst scratchPosition = new Cartesian3();\nconst scratchDirection = new Cartesian3();\n\n/**\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {FrameState} frameState\n */\nfunction updateDynamicScreenSpaceError(tileset, frameState) {\n  let up;\n  let direction;\n  let height;\n  let minimumHeight;\n  let maximumHeight;\n\n  const camera = frameState.camera;\n  const root = tileset._root;\n  const tileBoundingVolume = root.contentBoundingVolume;\n\n  if (tileBoundingVolume instanceof TileBoundingRegion) {\n    up = Cartesian3.normalize(camera.positionWC, scratchPositionNormal);\n    direction = camera.directionWC;\n    height = camera.positionCartographic.height;\n    minimumHeight = tileBoundingVolume.minimumHeight;\n    maximumHeight = tileBoundingVolume.maximumHeight;\n  } else {\n    // Transform camera position and direction into the local coordinate system of the tileset\n    const transformLocal = Matrix4.inverseTransformation(\n      root.computedTransform,\n      scratchMatrix\n    );\n    const ellipsoid = frameState.mapProjection.ellipsoid;\n    const boundingVolume = tileBoundingVolume.boundingVolume;\n    const centerLocal = Matrix4.multiplyByPoint(\n      transformLocal,\n      boundingVolume.center,\n      scratchCenter\n    );\n    if (Cartesian3.magnitude(centerLocal) > ellipsoid.minimumRadius) {\n      // The tileset is defined in WGS84. Approximate the minimum and maximum height.\n      const centerCartographic = Cartographic.fromCartesian(\n        centerLocal,\n        ellipsoid,\n        scratchCartographic\n      );\n      up = Cartesian3.normalize(camera.positionWC, scratchPositionNormal);\n      direction = camera.directionWC;\n      height = camera.positionCartographic.height;\n      minimumHeight = 0.0;\n      maximumHeight = centerCartographic.height * 2.0;\n    } else {\n      // The tileset is defined in local coordinates (z-up)\n      const positionLocal = Matrix4.multiplyByPoint(\n        transformLocal,\n        camera.positionWC,\n        scratchPosition\n      );\n      up = Cartesian3.UNIT_Z;\n      direction = Matrix4.multiplyByPointAsVector(\n        transformLocal,\n        camera.directionWC,\n        scratchDirection\n      );\n      direction = Cartesian3.normalize(direction, direction);\n      height = positionLocal.z;\n      if (tileBoundingVolume instanceof TileOrientedBoundingBox) {\n        // Assuming z-up, the last component stores the half-height of the box\n        const boxHeight = root._header.boundingVolume.box[11];\n        minimumHeight = centerLocal.z - boxHeight;\n        maximumHeight = centerLocal.z + boxHeight;\n      } else if (tileBoundingVolume instanceof TileBoundingSphere) {\n        const radius = boundingVolume.radius;\n        minimumHeight = centerLocal.z - radius;\n        maximumHeight = centerLocal.z + radius;\n      }\n    }\n  }\n\n  // The range where the density starts to lessen. Start at the quarter height of the tileset.\n  const heightFalloff = tileset.dynamicScreenSpaceErrorHeightFalloff;\n  const heightClose =\n    minimumHeight + (maximumHeight - minimumHeight) * heightFalloff;\n  const heightFar = maximumHeight;\n\n  const t = CesiumMath.clamp(\n    (height - heightClose) / (heightFar - heightClose),\n    0.0,\n    1.0\n  );\n\n  // Increase density as the camera tilts towards the horizon\n  let horizonFactor = 1.0 - Math.abs(Cartesian3.dot(direction, up));\n\n  // Weaken the horizon factor as the camera height increases, implying the camera is further away from the tileset.\n  // The goal is to increase density for the \"street view\", not when viewing the tileset from a distance.\n  horizonFactor = horizonFactor * (1.0 - t);\n\n  tileset._dynamicScreenSpaceErrorComputedDensity =\n    tileset.dynamicScreenSpaceErrorDensity * horizonFactor;\n}\n\n/**\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {Cesium3DTile} tile\n */\nfunction requestContent(tileset, tile) {\n  if (tile.hasEmptyContent) {\n    return;\n  }\n\n  const { statistics } = tileset;\n  const contentExpired = tile.contentExpired;\n\n  const promise = tile.requestContent();\n  if (!defined(promise)) {\n    return;\n  }\n\n  promise\n    .then((content) => {\n      if (!defined(content) || tile.isDestroyed() || tileset.isDestroyed()) {\n        return;\n      }\n\n      tileset._processingQueue.push(tile);\n      ++statistics.numberOfTilesProcessing;\n    })\n    .catch((error) => {\n      handleTileFailure(error, tileset, tile);\n    });\n\n  if (contentExpired) {\n    if (tile.hasTilesetContent || tile.hasImplicitContent) {\n      destroySubtree(tileset, tile);\n    } else {\n      statistics.decrementLoadCounts(tile.content);\n      --statistics.numberOfTilesWithContentReady;\n    }\n  }\n\n  tileset._requestedTilesInFlight.push(tile);\n}\n\nfunction sortTilesByPriority(a, b) {\n  return a._priority - b._priority;\n}\n\n/**\n * Perform any pass invariant tasks here. Called after the render pass.\n * @private\n * @param {FrameState} frameState\n */\nCesium3DTileset.prototype.postPassesUpdate = function (frameState) {\n  if (!defined(this._root)) {\n    return;\n  }\n\n  cancelOutOfViewRequests(this, frameState);\n  raiseLoadProgressEvent(this, frameState);\n  this._cache.unloadTiles(this, unloadTile);\n\n  // If the style wasn't able to be applied this frame (for example,\n  // the tileset was hidden), keep it dirty so the engine can try\n  // to apply the style next frame.\n  if (this._styleApplied) {\n    this._styleEngine.resetDirty();\n  }\n  this._styleApplied = false;\n};\n\n/**\n * Perform any pass invariant tasks here. Called before any passes are executed.\n * @private\n * @param {FrameState} frameState\n */\nCesium3DTileset.prototype.prePassesUpdate = function (frameState) {\n  if (!defined(this._root)) {\n    return;\n  }\n\n  processTiles(this, frameState);\n\n  // Update clipping planes\n  const clippingPlanes = this._clippingPlanes;\n  this._clippingPlanesOriginMatrixDirty = true;\n  if (defined(clippingPlanes) && clippingPlanes.enabled) {\n    clippingPlanes.update(frameState);\n  }\n\n  if (!defined(this._loadTimestamp)) {\n    this._loadTimestamp = JulianDate.clone(frameState.time);\n  }\n  this._timeSinceLoad = Math.max(\n    JulianDate.secondsDifference(frameState.time, this._loadTimestamp) * 1000,\n    0.0\n  );\n\n  if (this.dynamicScreenSpaceError) {\n    updateDynamicScreenSpaceError(this, frameState);\n  }\n\n  if (frameState.newFrame) {\n    this._cache.reset();\n  }\n};\n\n/**\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {FrameState} frameState\n */\nfunction cancelOutOfViewRequests(tileset, frameState) {\n  const requestedTilesInFlight = tileset._requestedTilesInFlight;\n  let removeCount = 0;\n  for (let i = 0; i < requestedTilesInFlight.length; ++i) {\n    const tile = requestedTilesInFlight[i];\n\n    // NOTE: This is framerate dependant so make sure the threshold check is small\n    const outOfView = frameState.frameNumber - tile._touchedFrame >= 1;\n    if (tile._contentState !== Cesium3DTileContentState.LOADING) {\n      // No longer fetching from host, don't need to track it anymore. Gets marked as LOADING in Cesium3DTile::requestContent().\n      ++removeCount;\n      continue;\n    } else if (outOfView) {\n      // RequestScheduler will take care of cancelling it\n      tile.cancelRequests();\n      ++removeCount;\n      continue;\n    }\n\n    if (removeCount > 0) {\n      requestedTilesInFlight[i - removeCount] = tile;\n    }\n  }\n\n  requestedTilesInFlight.length -= removeCount;\n}\n\n/**\n * Sort requests by priority before making any requests.\n * This makes it less likely that requests will be cancelled after being issued.\n * @private\n * @param {Cesium3DTileset} tileset\n */\nfunction requestTiles(tileset) {\n  const requestedTiles = tileset._requestedTiles;\n  requestedTiles.sort(sortTilesByPriority);\n  for (let i = 0; i < requestedTiles.length; ++i) {\n    requestContent(tileset, requestedTiles[i]);\n  }\n}\n\n/**\n * @private\n * @param {Error} error\n * @param {Cesium3DTileset} tileset\n * @param {Cesium3DTile} tile\n */\nfunction handleTileFailure(error, tileset, tile) {\n  if (tileset.isDestroyed()) {\n    return;\n  }\n\n  let url;\n  if (!tile.isDestroyed()) {\n    url = tile._contentResource.url;\n  }\n\n  const message = defined(error.message) ? error.message : error.toString();\n  if (tileset.tileFailed.numberOfListeners > 0) {\n    tileset.tileFailed.raiseEvent({\n      url: url,\n      message: message,\n    });\n  } else {\n    console.log(`A 3D tile failed to load: ${url}`);\n    console.log(`Error: ${message}`);\n  }\n}\n\n/**\n * @private\n * @param {Cesium3DTileset} tileset\n */\nfunction filterProcessingQueue(tileset) {\n  const tiles = tileset._processingQueue;\n\n  let removeCount = 0;\n  for (let i = 0; i < tiles.length; ++i) {\n    const tile = tiles[i];\n    if (\n      tile.isDestroyed() ||\n      tile._contentState !== Cesium3DTileContentState.PROCESSING\n    ) {\n      ++removeCount;\n      continue;\n    }\n    if (removeCount > 0) {\n      tiles[i - removeCount] = tile;\n    }\n  }\n  tiles.length -= removeCount;\n}\n\n/**\n * Process tiles in the PROCESSING state so they will eventually move to the READY state.\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {Cesium3DTile} tile\n */\nfunction processTiles(tileset, frameState) {\n  filterProcessingQueue(tileset);\n  const tiles = tileset._processingQueue;\n\n  const { cacheBytes, maximumCacheOverflowBytes, statistics } = tileset;\n  const cacheByteLimit = cacheBytes + maximumCacheOverflowBytes;\n\n  let memoryExceeded = false;\n  for (let i = 0; i < tiles.length; ++i) {\n    if (tileset.totalMemoryUsageInBytes > cacheByteLimit) {\n      memoryExceeded = true;\n      break;\n    }\n\n    const tile = tiles[i];\n    try {\n      tile.process(tileset, frameState);\n\n      if (tile.contentReady) {\n        --statistics.numberOfTilesProcessing;\n        tileset.tileLoad.raiseEvent(tile);\n      }\n    } catch (error) {\n      --statistics.numberOfTilesProcessing;\n      handleTileFailure(error, tileset, tile);\n    }\n  }\n\n  if (tileset.totalMemoryUsageInBytes < cacheBytes) {\n    decreaseScreenSpaceError(tileset);\n  } else if (memoryExceeded && tiles.length > 0) {\n    increaseScreenSpaceError(tileset);\n  }\n}\n\nfunction increaseScreenSpaceError(tileset) {\n  //>>includeStart('debug', pragmas.debug);\n  oneTimeWarning(\n    \"increase-screenSpaceError\",\n    `The tiles needed to meet maximumScreenSpaceError would use more memory than allocated for this tileset.\n    The tileset will be rendered with a larger screen space error (see memoryAdjustedScreenSpaceError).\n    Consider using larger values for cacheBytes and maximumCacheOverflowBytes.`\n  );\n  //>>includeEnd('debug');\n\n  tileset._memoryAdjustedScreenSpaceError *= 1.02;\n  const tiles = tileset._processingQueue;\n  for (let i = 0; i < tiles.length; ++i) {\n    tiles[i].updatePriority();\n  }\n  tiles.sort(sortTilesByPriority);\n}\n\nfunction decreaseScreenSpaceError(tileset) {\n  tileset._memoryAdjustedScreenSpaceError = Math.max(\n    tileset.memoryAdjustedScreenSpaceError / 1.02,\n    tileset.maximumScreenSpaceError\n  );\n}\n\nconst scratchCartesian = new Cartesian3();\n\nconst stringOptions = {\n  maximumFractionDigits: 3,\n};\n\n/**\n * @private\n * @param {number} memorySizeInBytes\n * @returns {string}\n */\nfunction formatMemoryString(memorySizeInBytes) {\n  const memoryInMegabytes = memorySizeInBytes / 1048576;\n  if (memoryInMegabytes < 1.0) {\n    return memoryInMegabytes.toLocaleString(undefined, stringOptions);\n  }\n  return Math.round(memoryInMegabytes).toLocaleString();\n}\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @returns {Cartesian3}\n */\nfunction computeTileLabelPosition(tile) {\n  const { halfAxes, radius, center } = tile.boundingVolume.boundingVolume;\n\n  let position = Cartesian3.clone(center, scratchCartesian);\n  if (defined(halfAxes)) {\n    position.x += 0.75 * (halfAxes[0] + halfAxes[3] + halfAxes[6]);\n    position.y += 0.75 * (halfAxes[1] + halfAxes[4] + halfAxes[7]);\n    position.z += 0.75 * (halfAxes[2] + halfAxes[5] + halfAxes[8]);\n  } else if (defined(radius)) {\n    let normal = Cartesian3.normalize(center, scratchCartesian);\n    normal = Cartesian3.multiplyByScalar(\n      normal,\n      0.75 * radius,\n      scratchCartesian\n    );\n    position = Cartesian3.add(normal, center, scratchCartesian);\n  }\n  return position;\n}\n\n/**\n * @private\n * @param {Cesium3DTile} tile\n * @param {Cesium3DTileset} tileset\n * @param {Cartesian3} position\n * @returns {Label}\n */\nfunction addTileDebugLabel(tile, tileset, position) {\n  let labelString = \"\";\n  let attributes = 0;\n\n  if (tileset.debugShowGeometricError) {\n    labelString += `\\nGeometric error: ${tile.geometricError}`;\n    attributes++;\n  }\n\n  if (tileset.debugShowRenderingStatistics) {\n    labelString += `\\nCommands: ${tile.commandsLength}`;\n    attributes++;\n\n    // Don't display number of points or triangles if 0.\n    const numberOfPoints = tile.content.pointsLength;\n    if (numberOfPoints > 0) {\n      labelString += `\\nPoints: ${tile.content.pointsLength}`;\n      attributes++;\n    }\n\n    const numberOfTriangles = tile.content.trianglesLength;\n    if (numberOfTriangles > 0) {\n      labelString += `\\nTriangles: ${tile.content.trianglesLength}`;\n      attributes++;\n    }\n\n    labelString += `\\nFeatures: ${tile.content.featuresLength}`;\n    attributes++;\n  }\n\n  if (tileset.debugShowMemoryUsage) {\n    labelString += `\\nTexture Memory: ${formatMemoryString(\n      tile.content.texturesByteLength\n    )}`;\n    labelString += `\\nGeometry Memory: ${formatMemoryString(\n      tile.content.geometryByteLength\n    )}`;\n    attributes += 2;\n  }\n\n  if (tileset.debugShowUrl) {\n    if (tile.hasMultipleContents) {\n      labelString += \"\\nUrls:\";\n      const urls = tile.content.innerContentUrls;\n      for (let i = 0; i < urls.length; i++) {\n        labelString += `\\n- ${urls[i]}`;\n      }\n      attributes += urls.length;\n    } else {\n      labelString += `\\nUrl: ${tile._contentHeader.uri}`;\n      attributes++;\n    }\n  }\n\n  const newLabel = {\n    text: labelString.substring(1),\n    position: position,\n    font: `${19 - attributes}px sans-serif`,\n    showBackground: true,\n    disableDepthTestDistance: Number.POSITIVE_INFINITY,\n  };\n\n  return tileset._tileDebugLabels.add(newLabel);\n}\n\n/**\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {FrameState} frameState\n */\nfunction updateTileDebugLabels(tileset, frameState) {\n  const selectedTiles = tileset._selectedTiles;\n  const selectedLength = selectedTiles.length;\n  const emptyTiles = tileset._emptyTiles;\n  const emptyLength = emptyTiles.length;\n  tileset._tileDebugLabels.removeAll();\n\n  if (tileset.debugPickedTileLabelOnly) {\n    if (defined(tileset.debugPickedTile)) {\n      const position = defined(tileset.debugPickPosition)\n        ? tileset.debugPickPosition\n        : computeTileLabelPosition(tileset.debugPickedTile);\n      const label = addTileDebugLabel(\n        tileset.debugPickedTile,\n        tileset,\n        position\n      );\n      label.pixelOffset = new Cartesian2(15, -15); // Offset to avoid picking the label.\n    }\n  } else {\n    for (let i = 0; i < selectedLength; ++i) {\n      const tile = selectedTiles[i];\n      addTileDebugLabel(tile, tileset, computeTileLabelPosition(tile));\n    }\n    for (let i = 0; i < emptyLength; ++i) {\n      const tile = emptyTiles[i];\n      if (tile.hasTilesetContent || tile.hasImplicitContent) {\n        addTileDebugLabel(tile, tileset, computeTileLabelPosition(tile));\n      }\n    }\n  }\n  tileset._tileDebugLabels.update(frameState);\n}\n\n/**\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {FrameState} frameState\n * @param {object} passOptions\n */\nfunction updateTiles(tileset, frameState, passOptions) {\n  tileset._styleEngine.applyStyle(tileset);\n  tileset._styleApplied = true;\n\n  const { commandList, context } = frameState;\n  const numberOfInitialCommands = commandList.length;\n  const selectedTiles = tileset._selectedTiles;\n\n  const bivariateVisibilityTest =\n    tileset.isSkippingLevelOfDetail &&\n    tileset._hasMixedContent &&\n    context.stencilBuffer &&\n    selectedTiles.length > 0;\n\n  tileset._backfaceCommands.length = 0;\n\n  if (bivariateVisibilityTest) {\n    if (!defined(tileset._stencilClearCommand)) {\n      tileset._stencilClearCommand = new ClearCommand({\n        stencil: 0,\n        pass: Pass.CESIUM_3D_TILE,\n        renderState: RenderState.fromCache({\n          stencilMask: StencilConstants.SKIP_LOD_MASK,\n        }),\n      });\n    }\n    commandList.push(tileset._stencilClearCommand);\n  }\n\n  const { statistics, tileVisible } = tileset;\n  const isRender = passOptions.isRender;\n  const lengthBeforeUpdate = commandList.length;\n\n  for (let i = 0; i < selectedTiles.length; ++i) {\n    const tile = selectedTiles[i];\n    // Raise the tileVisible event before update in case the tileVisible event\n    // handler makes changes that update needs to apply to WebGL resources\n    if (isRender) {\n      tileVisible.raiseEvent(tile);\n    }\n    tile.update(tileset, frameState, passOptions);\n    statistics.incrementSelectionCounts(tile.content);\n    ++statistics.selected;\n  }\n  const emptyTiles = tileset._emptyTiles;\n  for (let i = 0; i < emptyTiles.length; ++i) {\n    const tile = emptyTiles[i];\n    tile.update(tileset, frameState, passOptions);\n  }\n\n  let addedCommandsLength = commandList.length - lengthBeforeUpdate;\n\n  tileset._backfaceCommands.trim();\n\n  if (bivariateVisibilityTest) {\n    /*\n     * Consider 'effective leaf' tiles as selected tiles that have no selected descendants. They may have children,\n     * but they are currently our effective leaves because they do not have selected descendants. These tiles\n     * are those where with tile._finalResolution === true.\n     * Let 'unresolved' tiles be those with tile._finalResolution === false.\n     *\n     * 1. Render just the backfaces of unresolved tiles in order to lay down z\n     * 2. Render all frontfaces wherever tile._selectionDepth > stencilBuffer.\n     *    Replace stencilBuffer with tile._selectionDepth, when passing the z test.\n     *    Because children are always drawn before ancestors {@link Cesium3DTilesetTraversal#traverseAndSelect},\n     *    this effectively draws children first and does not draw ancestors if a descendant has already\n     *    been drawn at that pixel.\n     *    Step 1 prevents child tiles from appearing on top when they are truly behind ancestor content.\n     *    If they are behind the backfaces of the ancestor, then they will not be drawn.\n     *\n     * NOTE: Step 2 sometimes causes visual artifacts when backfacing child content has some faces that\n     * partially face the camera and are inside of the ancestor content. Because they are inside, they will\n     * not be culled by the depth writes in Step 1, and because they partially face the camera, the stencil tests\n     * will draw them on top of the ancestor content.\n     *\n     * NOTE: Because we always render backfaces of unresolved tiles, if the camera is looking at the backfaces\n     * of an object, they will always be drawn while loading, even if backface culling is enabled.\n     */\n\n    const backfaceCommands = tileset._backfaceCommands.values;\n    const backfaceCommandsLength = backfaceCommands.length;\n\n    commandList.length += backfaceCommandsLength;\n\n    // copy commands to the back of the commandList\n    for (let i = addedCommandsLength - 1; i >= 0; --i) {\n      commandList[lengthBeforeUpdate + backfaceCommandsLength + i] =\n        commandList[lengthBeforeUpdate + i];\n    }\n\n    // move backface commands to the front of the commandList\n    for (let i = 0; i < backfaceCommandsLength; ++i) {\n      commandList[lengthBeforeUpdate + i] = backfaceCommands[i];\n    }\n  }\n\n  // Number of commands added by each update above\n  addedCommandsLength = commandList.length - numberOfInitialCommands;\n  statistics.numberOfCommands = addedCommandsLength;\n\n  if (!isRender) {\n    return;\n  }\n\n  // Only run EDL if simple attenuation is on\n  if (\n    tileset.pointCloudShading.attenuation &&\n    tileset.pointCloudShading.eyeDomeLighting &&\n    addedCommandsLength > 0\n  ) {\n    tileset._pointCloudEyeDomeLighting.update(\n      frameState,\n      numberOfInitialCommands,\n      tileset.pointCloudShading,\n      tileset.boundingSphere\n    );\n  }\n\n  if (\n    tileset.debugShowGeometricError ||\n    tileset.debugShowRenderingStatistics ||\n    tileset.debugShowMemoryUsage ||\n    tileset.debugShowUrl\n  ) {\n    if (!defined(tileset._tileDebugLabels)) {\n      tileset._tileDebugLabels = new LabelCollection();\n    }\n    updateTileDebugLabels(tileset, frameState);\n  } else {\n    tileset._tileDebugLabels =\n      tileset._tileDebugLabels && tileset._tileDebugLabels.destroy();\n  }\n}\n\nconst scratchStack = [];\n\n/**\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {Cesium3DTile} tile\n */\nfunction destroySubtree(tileset, tile) {\n  const root = tile;\n  const stack = scratchStack;\n  stack.push(tile);\n  while (stack.length > 0) {\n    tile = stack.pop();\n    const children = tile.children;\n    for (let i = 0; i < children.length; ++i) {\n      stack.push(children[i]);\n    }\n    if (tile !== root) {\n      destroyTile(tileset, tile);\n      --tileset._statistics.numberOfTilesTotal;\n    }\n  }\n  root.children = [];\n}\n\n/**\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {Cesium3DTile} tile\n */\nfunction unloadTile(tileset, tile) {\n  tileset.tileUnload.raiseEvent(tile);\n  tileset._statistics.decrementLoadCounts(tile.content);\n  --tileset._statistics.numberOfTilesWithContentReady;\n  tile.unloadContent();\n}\n\n/**\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {Cesium3DTile} tile\n */\nfunction destroyTile(tileset, tile) {\n  tileset._cache.unloadTile(tileset, tile, unloadTile);\n  tile.destroy();\n}\n\n/**\n * Unloads all tiles that weren't selected the previous frame.  This can be used to\n * explicitly manage the tile cache and reduce the total number of tiles loaded below\n * {@link Cesium3DTileset#cacheBytes}.\n * <p>\n * Tile unloads occur at the next frame to keep all the WebGL delete calls\n * within the render loop.\n * </p>\n */\nCesium3DTileset.prototype.trimLoadedTiles = function () {\n  this._cache.trim();\n};\n\n/**\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {FrameState} frameState\n */\nfunction raiseLoadProgressEvent(tileset, frameState) {\n  const statistics = tileset._statistics;\n  const statisticsLast = tileset._statisticsLast;\n\n  const numberOfPendingRequests = statistics.numberOfPendingRequests;\n  const numberOfTilesProcessing = statistics.numberOfTilesProcessing;\n  const lastNumberOfPendingRequest = statisticsLast.numberOfPendingRequests;\n  const lastNumberOfTilesProcessing = statisticsLast.numberOfTilesProcessing;\n\n  Cesium3DTilesetStatistics.clone(statistics, statisticsLast);\n\n  const progressChanged =\n    numberOfPendingRequests !== lastNumberOfPendingRequest ||\n    numberOfTilesProcessing !== lastNumberOfTilesProcessing;\n\n  if (progressChanged) {\n    frameState.afterRender.push(function () {\n      tileset.loadProgress.raiseEvent(\n        numberOfPendingRequests,\n        numberOfTilesProcessing\n      );\n\n      return true;\n    });\n  }\n\n  tileset._tilesLoaded =\n    statistics.numberOfPendingRequests === 0 &&\n    statistics.numberOfTilesProcessing === 0 &&\n    statistics.numberOfAttemptedRequests === 0;\n\n  // Events are raised (added to the afterRender queue) here since promises\n  // may resolve outside of the update loop that then raise events, e.g.,\n  // model's readyEvent\n  if (progressChanged && tileset._tilesLoaded) {\n    frameState.afterRender.push(function () {\n      tileset.allTilesLoaded.raiseEvent();\n      return true;\n    });\n    if (!tileset._initialTilesLoaded) {\n      tileset._initialTilesLoaded = true;\n      frameState.afterRender.push(function () {\n        tileset.initialTilesLoaded.raiseEvent();\n        return true;\n      });\n    }\n  }\n}\n\n/**\n * @private\n * @param {Cesium3DTileset} tileset\n */\nfunction resetMinimumMaximum(tileset) {\n  tileset._heatmap.resetMinimumMaximum();\n  tileset._minimumPriority.depth = Number.MAX_VALUE;\n  tileset._maximumPriority.depth = -Number.MAX_VALUE;\n  tileset._minimumPriority.foveatedFactor = Number.MAX_VALUE;\n  tileset._maximumPriority.foveatedFactor = -Number.MAX_VALUE;\n  tileset._minimumPriority.distance = Number.MAX_VALUE;\n  tileset._maximumPriority.distance = -Number.MAX_VALUE;\n  tileset._minimumPriority.reverseScreenSpaceError = Number.MAX_VALUE;\n  tileset._maximumPriority.reverseScreenSpaceError = -Number.MAX_VALUE;\n}\n\n/**\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {FrameState} frameState\n */\nfunction detectModelMatrixChanged(tileset, frameState) {\n  if (\n    frameState.frameNumber === tileset._updatedModelMatrixFrame &&\n    defined(tileset._previousModelMatrix)\n  ) {\n    return;\n  }\n\n  tileset._updatedModelMatrixFrame = frameState.frameNumber;\n  tileset._modelMatrixChanged = !Matrix4.equals(\n    tileset.modelMatrix,\n    tileset._previousModelMatrix\n  );\n  if (tileset._modelMatrixChanged) {\n    tileset._previousModelMatrix = Matrix4.clone(\n      tileset.modelMatrix,\n      tileset._previousModelMatrix\n    );\n  }\n}\n\n/**\n * @private\n * @param {Cesium3DTileset} tileset\n * @param {FrameState} frameState\n * @param {Cesium3DTilesetStatistics} passStatistics\n * @param {object} passOptions\n * @returns {boolean}\n */\nfunction update(tileset, frameState, passStatistics, passOptions) {\n  if (frameState.mode === SceneMode.MORPHING) {\n    return false;\n  }\n\n  if (!defined(tileset._root)) {\n    return false;\n  }\n\n  const statistics = tileset._statistics;\n  statistics.clear();\n\n  // Resets the visibility check for each pass\n  ++tileset._updatedVisibilityFrame;\n\n  // Update any tracked min max values\n  resetMinimumMaximum(tileset);\n\n  detectModelMatrixChanged(tileset, frameState);\n  tileset._cullRequestsWhileMoving =\n    tileset.cullRequestsWhileMoving && !tileset._modelMatrixChanged;\n\n  const ready = tileset\n    .getTraversal(passOptions)\n    .selectTiles(tileset, frameState);\n\n  if (passOptions.requestTiles) {\n    requestTiles(tileset);\n  }\n\n  updateTiles(tileset, frameState, passOptions);\n\n  // Update pass statistics\n  Cesium3DTilesetStatistics.clone(statistics, passStatistics);\n\n  if (passOptions.isRender) {\n    const credits = tileset._credits;\n    if (defined(credits) && statistics.selected !== 0) {\n      for (let i = 0; i < credits.length; ++i) {\n        const credit = credits[i];\n        frameState.creditDisplay.addCreditToNextFrame(credit);\n      }\n    }\n  }\n\n  return ready;\n}\n\nfunction createCredits(tileset) {\n  let credits = tileset._credits;\n  if (!defined(credits)) {\n    credits = [];\n  }\n  credits.length = 0;\n\n  if (defined(tileset.resource.credits)) {\n    tileset.resource.credits.forEach((credit) => {\n      credits.push(Credit.clone(credit));\n    });\n  }\n\n  const assetExtras = tileset.asset.extras;\n  if (\n    defined(assetExtras) &&\n    defined(assetExtras.cesium) &&\n    defined(assetExtras.cesium.credits)\n  ) {\n    const extraCredits = assetExtras.cesium.credits;\n    for (let i = 0; i < extraCredits.length; ++i) {\n      const credit = extraCredits[i];\n      credits.push(new Credit(credit.html));\n    }\n  }\n\n  credits.forEach(\n    (credit) =>\n      (credit.showOnScreen =\n        credit.showOnScreen || tileset._showCreditsOnScreen)\n  );\n\n  tileset._credits = credits;\n}\n\n/**\n * @private\n * @param {object} passOptions\n * @returns {Cesium3DTilesetTraversal}\n */\nCesium3DTileset.prototype.getTraversal = function (passOptions) {\n  const { pass } = passOptions;\n  if (\n    pass === Cesium3DTilePass.MOST_DETAILED_PRELOAD ||\n    pass === Cesium3DTilePass.MOST_DETAILED_PICK\n  ) {\n    return Cesium3DTilesetMostDetailedTraversal;\n  }\n  return this.isSkippingLevelOfDetail\n    ? Cesium3DTilesetSkipTraversal\n    : Cesium3DTilesetBaseTraversal;\n};\n\n/**\n * @private\n * @param {FrameState} frameState\n */\nCesium3DTileset.prototype.update = function (frameState) {\n  this.updateForPass(frameState, frameState.tilesetPassState);\n};\n\n/**\n * @private\n * @param {FrameState} frameState\n * @param {object} tilesetPassState\n */\nCesium3DTileset.prototype.updateForPass = function (\n  frameState,\n  tilesetPassState\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"frameState\", frameState);\n  Check.typeOf.object(\"tilesetPassState\", tilesetPassState);\n  //>>includeEnd('debug');\n\n  const pass = tilesetPassState.pass;\n  if (\n    (pass === Cesium3DTilePass.PRELOAD &&\n      (!this.preloadWhenHidden || this.show)) ||\n    (pass === Cesium3DTilePass.PRELOAD_FLIGHT &&\n      (!this.preloadFlightDestinations ||\n        (!this.show && !this.preloadWhenHidden))) ||\n    (pass === Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK &&\n      ((!this._cullRequestsWhileMoving && this.foveatedTimeDelay <= 0) ||\n        !this.show))\n  ) {\n    return;\n  }\n\n  const originalCommandList = frameState.commandList;\n  const originalCamera = frameState.camera;\n  const originalCullingVolume = frameState.cullingVolume;\n\n  tilesetPassState.ready = false;\n\n  const passOptions = Cesium3DTilePass.getPassOptions(pass);\n  const ignoreCommands = passOptions.ignoreCommands;\n\n  const commandList = defaultValue(\n    tilesetPassState.commandList,\n    originalCommandList\n  );\n  const commandStart = commandList.length;\n\n  frameState.commandList = commandList;\n  frameState.camera = defaultValue(tilesetPassState.camera, originalCamera);\n  frameState.cullingVolume = defaultValue(\n    tilesetPassState.cullingVolume,\n    originalCullingVolume\n  );\n\n  const passStatistics = this._statisticsPerPass[pass];\n\n  if (this.show || ignoreCommands) {\n    this._pass = pass;\n    tilesetPassState.ready = update(\n      this,\n      frameState,\n      passStatistics,\n      passOptions\n    );\n  }\n\n  if (ignoreCommands) {\n    commandList.length = commandStart;\n  }\n\n  frameState.commandList = originalCommandList;\n  frameState.camera = originalCamera;\n  frameState.cullingVolume = originalCullingVolume;\n};\n\n/**\n * <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.\n * @param {string} extensionName The name of the extension to check.\n *\n * @returns {boolean} <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.\n */\nCesium3DTileset.prototype.hasExtension = function (extensionName) {\n  if (!defined(this._extensionsUsed)) {\n    return false;\n  }\n\n  return this._extensionsUsed.indexOf(extensionName) > -1;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see Cesium3DTileset#destroy\n */\nCesium3DTileset.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * tileset = tileset && tileset.destroy();\n *\n * @see Cesium3DTileset#isDestroyed\n */\nCesium3DTileset.prototype.destroy = function () {\n  this._tileDebugLabels =\n    this._tileDebugLabels && this._tileDebugLabels.destroy();\n  this._clippingPlanes = this._clippingPlanes && this._clippingPlanes.destroy();\n\n  // Traverse the tree and destroy all tiles\n  if (defined(this._root)) {\n    const stack = scratchStack;\n    stack.push(this._root);\n\n    while (stack.length > 0) {\n      const tile = stack.pop();\n      tile.destroy();\n\n      const children = tile.children;\n      for (let i = 0; i < children.length; ++i) {\n        stack.push(children[i]);\n      }\n    }\n  }\n  this._root = undefined;\n\n  if (\n    this._shouldDestroyImageBasedLighting &&\n    !this._imageBasedLighting.isDestroyed()\n  ) {\n    this._imageBasedLighting.destroy();\n  }\n  this._imageBasedLighting = undefined;\n\n  return destroyObject(this);\n};\n\nCesium3DTileset.supportedExtensions = {\n  \"3DTILES_metadata\": true,\n  \"3DTILES_implicit_tiling\": true,\n  \"3DTILES_content_gltf\": true,\n  \"3DTILES_multiple_contents\": true,\n  \"3DTILES_bounding_volume_S2\": true,\n  \"3DTILES_batch_table_hierarchy\": true,\n  \"3DTILES_draco_point_compression\": true,\n  MAXAR_content_geojson: true,\n};\n\n/**\n * Checks to see if a given extension is supported by Cesium3DTileset. If\n * the extension is not supported by Cesium3DTileset, it throws a RuntimeError.\n *\n * @param {object} extensionsRequired The extensions we wish to check\n *\n * @private\n */\nCesium3DTileset.checkSupportedExtensions = function (extensionsRequired) {\n  for (let i = 0; i < extensionsRequired.length; i++) {\n    if (!Cesium3DTileset.supportedExtensions[extensionsRequired[i]]) {\n      throw new RuntimeError(\n        `Unsupported 3D Tiles Extension: ${extensionsRequired[i]}`\n      );\n    }\n  }\n};\n\n/**\n * Optimization option. Used as a callback when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone,\n * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}.\n *\n * @callback Cesium3DTileset.foveatedInterpolationCallback\n * @default Math.lerp\n *\n * @param {number} p The start value to interpolate.\n * @param {number} q The end value to interpolate.\n * @param {number} time The time of interpolation generally in the range <code>[0.0, 1.0]</code>.\n * @returns {number} The interpolated value.\n */\nexport default Cesium3DTileset;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Resource from \"../Core/Resource.js\";\nimport Cesium3DTileset from \"../Scene/Cesium3DTileset.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport Property from \"./Property.js\";\n\nconst modelMatrixScratch = new Matrix4();\n\n/**\n * A {@link Visualizer} which maps {@link Entity#tileset} to a {@link Cesium3DTileset}.\n * @alias Cesium3DTilesetVisualizer\n * @constructor\n *\n * @param {Scene} scene The scene the primitives will be rendered in.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n */\nfunction Cesium3DTilesetVisualizer(scene, entityCollection) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  if (!defined(entityCollection)) {\n    throw new DeveloperError(\"entityCollection is required.\");\n  }\n  //>>includeEnd('debug');\n\n  entityCollection.collectionChanged.addEventListener(\n    Cesium3DTilesetVisualizer.prototype._onCollectionChanged,\n    this\n  );\n\n  this._scene = scene;\n  this._primitives = scene.primitives;\n  this._entityCollection = entityCollection;\n  this._tilesetHash = {};\n  this._entitiesToVisualize = new AssociativeArray();\n  this._onCollectionChanged(entityCollection, entityCollection.values, [], []);\n}\n\n/**\n * Updates models created this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {boolean} This function always returns true.\n */\nCesium3DTilesetVisualizer.prototype.update = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const entities = this._entitiesToVisualize.values;\n  const tilesetHash = this._tilesetHash;\n  const primitives = this._primitives;\n\n  for (let i = 0, len = entities.length; i < len; i++) {\n    const entity = entities[i];\n    const tilesetGraphics = entity._tileset;\n\n    let resource;\n    const tilesetData = tilesetHash[entity.id];\n    const show =\n      entity.isShowing &&\n      entity.isAvailable(time) &&\n      Property.getValueOrDefault(tilesetGraphics._show, time, true);\n\n    let modelMatrix;\n    if (show) {\n      modelMatrix = entity.computeModelMatrix(time, modelMatrixScratch);\n      resource = Resource.createIfNeeded(\n        Property.getValueOrUndefined(tilesetGraphics._uri, time)\n      );\n    }\n\n    const tileset = defined(tilesetData)\n      ? tilesetData.tilesetPrimitive\n      : undefined;\n\n    if (!show) {\n      if (defined(tileset)) {\n        tileset.show = false;\n      }\n      continue;\n    }\n\n    if (!defined(tilesetData) || resource.url !== tilesetData.url) {\n      if (defined(tileset)) {\n        primitives.removeAndDestroy(tileset);\n      }\n\n      delete tilesetHash[entity.id];\n\n      createTileset(resource, tilesetHash, entity, primitives);\n    }\n\n    if (!defined(tileset)) {\n      continue;\n    }\n\n    tileset.show = true;\n    if (defined(modelMatrix)) {\n      tileset.modelMatrix = modelMatrix;\n    }\n    tileset.maximumScreenSpaceError = Property.getValueOrDefault(\n      tilesetGraphics.maximumScreenSpaceError,\n      time,\n      tileset.maximumScreenSpaceError\n    );\n  }\n\n  return true;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n */\nCesium3DTilesetVisualizer.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nCesium3DTilesetVisualizer.prototype.destroy = function () {\n  this._entityCollection.collectionChanged.removeEventListener(\n    Cesium3DTilesetVisualizer.prototype._onCollectionChanged,\n    this\n  );\n  const entities = this._entitiesToVisualize.values;\n  const tilesetHash = this._tilesetHash;\n  const primitives = this._primitives;\n  for (let i = entities.length - 1; i > -1; i--) {\n    removeTileset(this, entities[i], tilesetHash, primitives);\n  }\n  return destroyObject(this);\n};\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n *                       BoundingSphereState.PENDING if the result is still being computed, or\n *                       BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nCesium3DTilesetVisualizer.prototype.getBoundingSphere = function (\n  entity,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(entity)) {\n    throw new DeveloperError(\"entity is required.\");\n  }\n  if (!defined(result)) {\n    throw new DeveloperError(\"result is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const tilesetData = this._tilesetHash[entity.id];\n  if (!defined(tilesetData) || tilesetData.loadFail) {\n    return BoundingSphereState.FAILED;\n  }\n\n  const primitive = tilesetData.tilesetPrimitive;\n  if (!defined(primitive)) {\n    return BoundingSphereState.PENDING;\n  }\n\n  if (!primitive.show) {\n    return BoundingSphereState.FAILED;\n  }\n\n  BoundingSphere.clone(primitive.boundingSphere, result);\n\n  return BoundingSphereState.DONE;\n};\n\n/**\n * @private\n */\nCesium3DTilesetVisualizer.prototype._onCollectionChanged = function (\n  entityCollection,\n  added,\n  removed,\n  changed\n) {\n  let i;\n  let entity;\n  const entities = this._entitiesToVisualize;\n  const tilesetHash = this._tilesetHash;\n  const primitives = this._primitives;\n\n  for (i = added.length - 1; i > -1; i--) {\n    entity = added[i];\n    if (defined(entity._tileset)) {\n      entities.set(entity.id, entity);\n    }\n  }\n\n  for (i = changed.length - 1; i > -1; i--) {\n    entity = changed[i];\n    if (defined(entity._tileset)) {\n      entities.set(entity.id, entity);\n    } else {\n      removeTileset(this, entity, tilesetHash, primitives);\n      entities.remove(entity.id);\n    }\n  }\n\n  for (i = removed.length - 1; i > -1; i--) {\n    entity = removed[i];\n    removeTileset(this, entity, tilesetHash, primitives);\n    entities.remove(entity.id);\n  }\n};\n\nfunction removeTileset(visualizer, entity, tilesetHash, primitives) {\n  const tilesetData = tilesetHash[entity.id];\n  if (defined(tilesetData)) {\n    if (defined(tilesetData.tilesetPrimitive)) {\n      primitives.removeAndDestroy(tilesetData.tilesetPrimitive);\n    }\n    delete tilesetHash[entity.id];\n  }\n}\n\nasync function createTileset(resource, tilesetHash, entity, primitives) {\n  tilesetHash[entity.id] = {\n    url: resource.url,\n    loadFail: false,\n  };\n\n  try {\n    const tileset = await Cesium3DTileset.fromUrl(resource);\n    tileset.id = entity;\n    primitives.add(tileset);\n\n    if (!defined(tilesetHash[entity.id])) {\n      return;\n    }\n\n    tilesetHash[entity.id].tilesetPrimitive = tileset;\n  } catch (error) {\n    console.error(error);\n    tilesetHash[entity.id].loadFail = true;\n  }\n}\n\nexport default Cesium3DTilesetVisualizer;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\nconst defaultEvenColor = Color.WHITE;\nconst defaultOddColor = Color.BLACK;\nconst defaultRepeat = new Cartesian2(2.0, 2.0);\n\n/**\n * A {@link MaterialProperty} that maps to checkerboard {@link Material} uniforms.\n * @alias CheckerboardMaterialProperty\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Property|Color} [options.evenColor=Color.WHITE] A Property specifying the first {@link Color}.\n * @param {Property|Color} [options.oddColor=Color.BLACK] A Property specifying the second {@link Color}.\n * @param {Property|Cartesian2} [options.repeat=new Cartesian2(2.0, 2.0)] A {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.\n */\nfunction CheckerboardMaterialProperty(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._definitionChanged = new Event();\n  this._evenColor = undefined;\n  this._evenColorSubscription = undefined;\n  this._oddColor = undefined;\n  this._oddColorSubscription = undefined;\n  this._repeat = undefined;\n  this._repeatSubscription = undefined;\n\n  this.evenColor = options.evenColor;\n  this.oddColor = options.oddColor;\n  this.repeat = options.repeat;\n}\n\nObject.defineProperties(CheckerboardMaterialProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof CheckerboardMaterialProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return (\n        Property.isConstant(this._evenColor) && //\n        Property.isConstant(this._oddColor) && //\n        Property.isConstant(this._repeat)\n      );\n    },\n  },\n\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof CheckerboardMaterialProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the Property specifying the first {@link Color}.\n   * @memberof CheckerboardMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default Color.WHITE\n   */\n  evenColor: createPropertyDescriptor(\"evenColor\"),\n\n  /**\n   * Gets or sets the Property specifying the second {@link Color}.\n   * @memberof CheckerboardMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default Color.BLACK\n   */\n  oddColor: createPropertyDescriptor(\"oddColor\"),\n\n  /**\n   * Gets or sets the {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.\n   * @memberof CheckerboardMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default new Cartesian2(2.0, 2.0)\n   */\n  repeat: createPropertyDescriptor(\"repeat\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {string} The type of material.\n */\nCheckerboardMaterialProperty.prototype.getType = function (time) {\n  return \"Checkerboard\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nCheckerboardMaterialProperty.prototype.getValue = function (time, result) {\n  if (!defined(result)) {\n    result = {};\n  }\n  result.lightColor = Property.getValueOrClonedDefault(\n    this._evenColor,\n    time,\n    defaultEvenColor,\n    result.lightColor\n  );\n  result.darkColor = Property.getValueOrClonedDefault(\n    this._oddColor,\n    time,\n    defaultOddColor,\n    result.darkColor\n  );\n  result.repeat = Property.getValueOrDefault(this._repeat, time, defaultRepeat);\n  return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCheckerboardMaterialProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof CheckerboardMaterialProperty && //\n      Property.equals(this._evenColor, other._evenColor) && //\n      Property.equals(this._oddColor, other._oddColor) && //\n      Property.equals(this._repeat, other._repeat))\n  );\n};\nexport default CheckerboardMaterialProperty;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TimeInterval from \"../Core/TimeInterval.js\";\nimport Entity from \"./Entity.js\";\n\nconst entityOptionsScratch = {\n  id: undefined,\n};\n\nfunction fireChangedEvent(collection) {\n  if (collection._firing) {\n    collection._refire = true;\n    return;\n  }\n\n  if (collection._suspendCount === 0) {\n    const added = collection._addedEntities;\n    const removed = collection._removedEntities;\n    const changed = collection._changedEntities;\n    if (changed.length !== 0 || added.length !== 0 || removed.length !== 0) {\n      collection._firing = true;\n      do {\n        collection._refire = false;\n        const addedArray = added.values.slice(0);\n        const removedArray = removed.values.slice(0);\n        const changedArray = changed.values.slice(0);\n\n        added.removeAll();\n        removed.removeAll();\n        changed.removeAll();\n        collection._collectionChanged.raiseEvent(\n          collection,\n          addedArray,\n          removedArray,\n          changedArray\n        );\n      } while (collection._refire);\n      collection._firing = false;\n    }\n  }\n}\n\n/**\n * An observable collection of {@link Entity} instances where each entity has a unique id.\n * @alias EntityCollection\n * @constructor\n *\n * @param {DataSource|CompositeEntityCollection} [owner] The data source (or composite entity collection) which created this collection.\n */\nfunction EntityCollection(owner) {\n  this._owner = owner;\n  this._entities = new AssociativeArray();\n  this._addedEntities = new AssociativeArray();\n  this._removedEntities = new AssociativeArray();\n  this._changedEntities = new AssociativeArray();\n  this._suspendCount = 0;\n  this._collectionChanged = new Event();\n  this._id = createGuid();\n  this._show = true;\n  this._firing = false;\n  this._refire = false;\n}\n\n/**\n * Prevents {@link EntityCollection#collectionChanged} events from being raised\n * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which\n * point a single event will be raised that covers all suspended operations.\n * This allows for many items to be added and removed efficiently.\n * This function can be safely called multiple times as long as there\n * are corresponding calls to {@link EntityCollection#resumeEvents}.\n */\nEntityCollection.prototype.suspendEvents = function () {\n  this._suspendCount++;\n};\n\n/**\n * Resumes raising {@link EntityCollection#collectionChanged} events immediately\n * when an item is added or removed.  Any modifications made while while events were suspended\n * will be triggered as a single event when this function is called.\n * This function is reference counted and can safely be called multiple times as long as there\n * are corresponding calls to {@link EntityCollection#resumeEvents}.\n *\n * @exception {DeveloperError} resumeEvents can not be called before suspendEvents.\n */\nEntityCollection.prototype.resumeEvents = function () {\n  //>>includeStart('debug', pragmas.debug);\n  if (this._suspendCount === 0) {\n    throw new DeveloperError(\n      \"resumeEvents can not be called before suspendEvents.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._suspendCount--;\n  fireChangedEvent(this);\n};\n\n/**\n * The signature of the event generated by {@link EntityCollection#collectionChanged}.\n * @callback EntityCollection.CollectionChangedEventCallback\n *\n * @param {EntityCollection} collection The collection that triggered the event.\n * @param {Entity[]} added The array of {@link Entity} instances that have been added to the collection.\n * @param {Entity[]} removed The array of {@link Entity} instances that have been removed from the collection.\n * @param {Entity[]} changed The array of {@link Entity} instances that have been modified.\n */\n\nObject.defineProperties(EntityCollection.prototype, {\n  /**\n   * Gets the event that is fired when entities are added or removed from the collection.\n   * The generated event is a {@link EntityCollection.CollectionChangedEventCallback}.\n   * @memberof EntityCollection.prototype\n   * @readonly\n   * @type {Event<EntityCollection.CollectionChangedEventCallback>}\n   */\n  collectionChanged: {\n    get: function () {\n      return this._collectionChanged;\n    },\n  },\n  /**\n   * Gets a globally unique identifier for this collection.\n   * @memberof EntityCollection.prototype\n   * @readonly\n   * @type {string}\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n  /**\n   * Gets the array of Entity instances in the collection.\n   * This array should not be modified directly.\n   * @memberof EntityCollection.prototype\n   * @readonly\n   * @type {Entity[]}\n   */\n  values: {\n    get: function () {\n      return this._entities.values;\n    },\n  },\n  /**\n   * Gets whether or not this entity collection should be\n   * displayed.  When true, each entity is only displayed if\n   * its own show property is also true.\n   * @memberof EntityCollection.prototype\n   * @type {boolean}\n   */\n  show: {\n    get: function () {\n      return this._show;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (value === this._show) {\n        return;\n      }\n\n      //Since entity.isShowing includes the EntityCollection.show state\n      //in its calculation, we need to loop over the entities array\n      //twice, once to get the old showing value and a second time\n      //to raise the changed event.\n      this.suspendEvents();\n\n      let i;\n      const oldShows = [];\n      const entities = this._entities.values;\n      const entitiesLength = entities.length;\n\n      for (i = 0; i < entitiesLength; i++) {\n        oldShows.push(entities[i].isShowing);\n      }\n\n      this._show = value;\n\n      for (i = 0; i < entitiesLength; i++) {\n        const oldShow = oldShows[i];\n        const entity = entities[i];\n        if (oldShow !== entity.isShowing) {\n          entity.definitionChanged.raiseEvent(\n            entity,\n            \"isShowing\",\n            entity.isShowing,\n            oldShow\n          );\n        }\n      }\n\n      this.resumeEvents();\n    },\n  },\n  /**\n   * Gets the owner of this entity collection, ie. the data source or composite entity collection which created it.\n   * @memberof EntityCollection.prototype\n   * @readonly\n   * @type {DataSource|CompositeEntityCollection}\n   */\n  owner: {\n    get: function () {\n      return this._owner;\n    },\n  },\n});\n\n/**\n * Computes the maximum availability of the entities in the collection.\n * If the collection contains a mix of infinitely available data and non-infinite data,\n * it will return the interval pertaining to the non-infinite data only.  If all\n * data is infinite, an infinite interval will be returned.\n *\n * @returns {TimeInterval} The availability of entities in the collection.\n */\nEntityCollection.prototype.computeAvailability = function () {\n  let startTime = Iso8601.MAXIMUM_VALUE;\n  let stopTime = Iso8601.MINIMUM_VALUE;\n  const entities = this._entities.values;\n  for (let i = 0, len = entities.length; i < len; i++) {\n    const entity = entities[i];\n    const availability = entity.availability;\n    if (defined(availability)) {\n      const start = availability.start;\n      const stop = availability.stop;\n      if (\n        JulianDate.lessThan(start, startTime) &&\n        !start.equals(Iso8601.MINIMUM_VALUE)\n      ) {\n        startTime = start;\n      }\n      if (\n        JulianDate.greaterThan(stop, stopTime) &&\n        !stop.equals(Iso8601.MAXIMUM_VALUE)\n      ) {\n        stopTime = stop;\n      }\n    }\n  }\n\n  if (Iso8601.MAXIMUM_VALUE.equals(startTime)) {\n    startTime = Iso8601.MINIMUM_VALUE;\n  }\n  if (Iso8601.MINIMUM_VALUE.equals(stopTime)) {\n    stopTime = Iso8601.MAXIMUM_VALUE;\n  }\n  return new TimeInterval({\n    start: startTime,\n    stop: stopTime,\n  });\n};\n\n/**\n * Add an entity to the collection.\n *\n * @param {Entity | Entity.ConstructorOptions} entity The entity to be added.\n * @returns {Entity} The entity that was added.\n * @exception {DeveloperError} An entity with <entity.id> already exists in this collection.\n */\nEntityCollection.prototype.add = function (entity) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(entity)) {\n    throw new DeveloperError(\"entity is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!(entity instanceof Entity)) {\n    entity = new Entity(entity);\n  }\n\n  const id = entity.id;\n  const entities = this._entities;\n  if (entities.contains(id)) {\n    throw new RuntimeError(\n      `An entity with id ${id} already exists in this collection.`\n    );\n  }\n\n  entity.entityCollection = this;\n  entities.set(id, entity);\n\n  if (!this._removedEntities.remove(id)) {\n    this._addedEntities.set(id, entity);\n  }\n  entity.definitionChanged.addEventListener(\n    EntityCollection.prototype._onEntityDefinitionChanged,\n    this\n  );\n\n  fireChangedEvent(this);\n  return entity;\n};\n\n/**\n * Removes an entity from the collection.\n *\n * @param {Entity} entity The entity to be removed.\n * @returns {boolean} true if the item was removed, false if it did not exist in the collection.\n */\nEntityCollection.prototype.remove = function (entity) {\n  if (!defined(entity)) {\n    return false;\n  }\n  return this.removeById(entity.id);\n};\n\n/**\n * Returns true if the provided entity is in this collection, false otherwise.\n *\n * @param {Entity} entity The entity.\n * @returns {boolean} true if the provided entity is in this collection, false otherwise.\n */\nEntityCollection.prototype.contains = function (entity) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(entity)) {\n    throw new DeveloperError(\"entity is required\");\n  }\n  //>>includeEnd('debug');\n  return this._entities.get(entity.id) === entity;\n};\n\n/**\n * Removes an entity with the provided id from the collection.\n *\n * @param {string} id The id of the entity to remove.\n * @returns {boolean} true if the item was removed, false if no item with the provided id existed in the collection.\n */\nEntityCollection.prototype.removeById = function (id) {\n  if (!defined(id)) {\n    return false;\n  }\n\n  const entities = this._entities;\n  const entity = entities.get(id);\n  if (!this._entities.remove(id)) {\n    return false;\n  }\n\n  if (!this._addedEntities.remove(id)) {\n    this._removedEntities.set(id, entity);\n    this._changedEntities.remove(id);\n  }\n  this._entities.remove(id);\n  entity.definitionChanged.removeEventListener(\n    EntityCollection.prototype._onEntityDefinitionChanged,\n    this\n  );\n  fireChangedEvent(this);\n\n  return true;\n};\n\n/**\n * Removes all Entities from the collection.\n */\nEntityCollection.prototype.removeAll = function () {\n  //The event should only contain items added before events were suspended\n  //and the contents of the collection.\n  const entities = this._entities;\n  const entitiesLength = entities.length;\n  const array = entities.values;\n\n  const addedEntities = this._addedEntities;\n  const removed = this._removedEntities;\n\n  for (let i = 0; i < entitiesLength; i++) {\n    const existingItem = array[i];\n    const existingItemId = existingItem.id;\n    const addedItem = addedEntities.get(existingItemId);\n    if (!defined(addedItem)) {\n      existingItem.definitionChanged.removeEventListener(\n        EntityCollection.prototype._onEntityDefinitionChanged,\n        this\n      );\n      removed.set(existingItemId, existingItem);\n    }\n  }\n\n  entities.removeAll();\n  addedEntities.removeAll();\n  this._changedEntities.removeAll();\n  fireChangedEvent(this);\n};\n\n/**\n * Gets an entity with the specified id.\n *\n * @param {string} id The id of the entity to retrieve.\n * @returns {Entity|undefined} The entity with the provided id or undefined if the id did not exist in the collection.\n */\nEntityCollection.prototype.getById = function (id) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(id)) {\n    throw new DeveloperError(\"id is required.\");\n  }\n  //>>includeEnd('debug');\n\n  return this._entities.get(id);\n};\n\n/**\n * Gets an entity with the specified id or creates it and adds it to the collection if it does not exist.\n *\n * @param {string} id The id of the entity to retrieve or create.\n * @returns {Entity} The new or existing object.\n */\nEntityCollection.prototype.getOrCreateEntity = function (id) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(id)) {\n    throw new DeveloperError(\"id is required.\");\n  }\n  //>>includeEnd('debug');\n\n  let entity = this._entities.get(id);\n  if (!defined(entity)) {\n    entityOptionsScratch.id = id;\n    entity = new Entity(entityOptionsScratch);\n    this.add(entity);\n  }\n  return entity;\n};\n\nEntityCollection.prototype._onEntityDefinitionChanged = function (entity) {\n  const id = entity.id;\n  if (!this._addedEntities.contains(id)) {\n    this._changedEntities.set(id, entity);\n  }\n  fireChangedEvent(this);\n};\nexport default EntityCollection;\n", "import createGuid from \"../Core/createGuid.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Entity from \"./Entity.js\";\nimport EntityCollection from \"./EntityCollection.js\";\n\nconst entityOptionsScratch = {\n  id: undefined,\n};\nconst entityIdScratch = new Array(2);\n\nfunction clean(entity) {\n  const propertyNames = entity.propertyNames;\n  const propertyNamesLength = propertyNames.length;\n  for (let i = 0; i < propertyNamesLength; i++) {\n    entity[propertyNames[i]] = undefined;\n  }\n  entity._name = undefined;\n  entity._availability = undefined;\n}\n\nfunction subscribeToEntity(that, eventHash, collectionId, entity) {\n  entityIdScratch[0] = collectionId;\n  entityIdScratch[1] = entity.id;\n  eventHash[\n    JSON.stringify(entityIdScratch)\n  ] = entity.definitionChanged.addEventListener(\n    CompositeEntityCollection.prototype._onDefinitionChanged,\n    that\n  );\n}\n\nfunction unsubscribeFromEntity(that, eventHash, collectionId, entity) {\n  entityIdScratch[0] = collectionId;\n  entityIdScratch[1] = entity.id;\n  const id = JSON.stringify(entityIdScratch);\n  eventHash[id]();\n  eventHash[id] = undefined;\n}\n\nfunction recomposite(that) {\n  that._shouldRecomposite = true;\n  if (that._suspendCount !== 0) {\n    return;\n  }\n\n  const collections = that._collections;\n  const collectionsLength = collections.length;\n\n  const collectionsCopy = that._collectionsCopy;\n  const collectionsCopyLength = collectionsCopy.length;\n\n  let i;\n  let entity;\n  let entities;\n  let iEntities;\n  let collection;\n  const composite = that._composite;\n  const newEntities = new EntityCollection(that);\n  const eventHash = that._eventHash;\n  let collectionId;\n\n  for (i = 0; i < collectionsCopyLength; i++) {\n    collection = collectionsCopy[i];\n    collection.collectionChanged.removeEventListener(\n      CompositeEntityCollection.prototype._onCollectionChanged,\n      that\n    );\n    entities = collection.values;\n    collectionId = collection.id;\n    for (iEntities = entities.length - 1; iEntities > -1; iEntities--) {\n      entity = entities[iEntities];\n      unsubscribeFromEntity(that, eventHash, collectionId, entity);\n    }\n  }\n\n  for (i = collectionsLength - 1; i >= 0; i--) {\n    collection = collections[i];\n    collection.collectionChanged.addEventListener(\n      CompositeEntityCollection.prototype._onCollectionChanged,\n      that\n    );\n\n    //Merge all of the existing entities.\n    entities = collection.values;\n    collectionId = collection.id;\n    for (iEntities = entities.length - 1; iEntities > -1; iEntities--) {\n      entity = entities[iEntities];\n      subscribeToEntity(that, eventHash, collectionId, entity);\n\n      let compositeEntity = newEntities.getById(entity.id);\n      if (!defined(compositeEntity)) {\n        compositeEntity = composite.getById(entity.id);\n        if (!defined(compositeEntity)) {\n          entityOptionsScratch.id = entity.id;\n          compositeEntity = new Entity(entityOptionsScratch);\n        } else {\n          clean(compositeEntity);\n        }\n        newEntities.add(compositeEntity);\n      }\n      compositeEntity.merge(entity);\n    }\n  }\n  that._collectionsCopy = collections.slice(0);\n\n  composite.suspendEvents();\n  composite.removeAll();\n  const newEntitiesArray = newEntities.values;\n  for (i = 0; i < newEntitiesArray.length; i++) {\n    composite.add(newEntitiesArray[i]);\n  }\n  composite.resumeEvents();\n}\n\n/**\n * Non-destructively composites multiple {@link EntityCollection} instances into a single collection.\n * If a Entity with the same ID exists in multiple collections, it is non-destructively\n * merged into a single new entity instance.  If an entity has the same property in multiple\n * collections, the property of the Entity in the last collection of the list it\n * belongs to is used.  CompositeEntityCollection can be used almost anywhere that a\n * EntityCollection is used.\n *\n * @alias CompositeEntityCollection\n * @constructor\n *\n * @param {EntityCollection[]} [collections] The initial list of EntityCollection instances to merge.\n * @param {DataSource|CompositeEntityCollection} [owner] The data source (or composite entity collection) which created this collection.\n */\nfunction CompositeEntityCollection(collections, owner) {\n  this._owner = owner;\n  this._composite = new EntityCollection(this);\n  this._suspendCount = 0;\n  this._collections = defined(collections) ? collections.slice() : [];\n  this._collectionsCopy = [];\n  this._id = createGuid();\n  this._eventHash = {};\n  recomposite(this);\n  this._shouldRecomposite = false;\n}\n\nObject.defineProperties(CompositeEntityCollection.prototype, {\n  /**\n   * Gets the event that is fired when entities are added or removed from the collection.\n   * The generated event is a {@link EntityCollection.collectionChangedEventCallback}.\n   * @memberof CompositeEntityCollection.prototype\n   * @readonly\n   * @type {Event}\n   */\n  collectionChanged: {\n    get: function () {\n      return this._composite._collectionChanged;\n    },\n  },\n  /**\n   * Gets a globally unique identifier for this collection.\n   * @memberof CompositeEntityCollection.prototype\n   * @readonly\n   * @type {string}\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n  /**\n   * Gets the array of Entity instances in the collection.\n   * This array should not be modified directly.\n   * @memberof CompositeEntityCollection.prototype\n   * @readonly\n   * @type {Entity[]}\n   */\n  values: {\n    get: function () {\n      return this._composite.values;\n    },\n  },\n  /**\n   * Gets the owner of this composite entity collection, ie. the data source or composite entity collection which created it.\n   * @memberof CompositeEntityCollection.prototype\n   * @readonly\n   * @type {DataSource|CompositeEntityCollection}\n   */\n  owner: {\n    get: function () {\n      return this._owner;\n    },\n  },\n});\n\n/**\n * Adds a collection to the composite.\n *\n * @param {EntityCollection} collection the collection to add.\n * @param {number} [index] the index to add the collection at.  If omitted, the collection will\n *                         added on top of all existing collections.\n *\n * @exception {DeveloperError} index, if supplied, must be greater than or equal to zero and less than or equal to the number of collections.\n */\nCompositeEntityCollection.prototype.addCollection = function (\n  collection,\n  index\n) {\n  const hasIndex = defined(index);\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(collection)) {\n    throw new DeveloperError(\"collection is required.\");\n  }\n  if (hasIndex) {\n    if (index < 0) {\n      throw new DeveloperError(\"index must be greater than or equal to zero.\");\n    } else if (index > this._collections.length) {\n      throw new DeveloperError(\n        \"index must be less than or equal to the number of collections.\"\n      );\n    }\n  }\n  //>>includeEnd('debug');\n\n  if (!hasIndex) {\n    index = this._collections.length;\n    this._collections.push(collection);\n  } else {\n    this._collections.splice(index, 0, collection);\n  }\n\n  recomposite(this);\n};\n\n/**\n * Removes a collection from this composite, if present.\n *\n * @param {EntityCollection} collection The collection to remove.\n * @returns {boolean} true if the collection was in the composite and was removed,\n *                    false if the collection was not in the composite.\n */\nCompositeEntityCollection.prototype.removeCollection = function (collection) {\n  const index = this._collections.indexOf(collection);\n  if (index !== -1) {\n    this._collections.splice(index, 1);\n    recomposite(this);\n    return true;\n  }\n  return false;\n};\n\n/**\n * Removes all collections from this composite.\n */\nCompositeEntityCollection.prototype.removeAllCollections = function () {\n  this._collections.length = 0;\n  recomposite(this);\n};\n\n/**\n * Checks to see if the composite contains a given collection.\n *\n * @param {EntityCollection} collection the collection to check for.\n * @returns {boolean} true if the composite contains the collection, false otherwise.\n */\nCompositeEntityCollection.prototype.containsCollection = function (collection) {\n  return this._collections.indexOf(collection) !== -1;\n};\n\n/**\n * Returns true if the provided entity is in this collection, false otherwise.\n *\n * @param {Entity} entity The entity.\n * @returns {boolean} true if the provided entity is in this collection, false otherwise.\n */\nCompositeEntityCollection.prototype.contains = function (entity) {\n  return this._composite.contains(entity);\n};\n\n/**\n * Determines the index of a given collection in the composite.\n *\n * @param {EntityCollection} collection The collection to find the index of.\n * @returns {number} The index of the collection in the composite, or -1 if the collection does not exist in the composite.\n */\nCompositeEntityCollection.prototype.indexOfCollection = function (collection) {\n  return this._collections.indexOf(collection);\n};\n\n/**\n * Gets a collection by index from the composite.\n *\n * @param {number} index the index to retrieve.\n */\nCompositeEntityCollection.prototype.getCollection = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(index)) {\n    throw new DeveloperError(\"index is required.\", \"index\");\n  }\n  //>>includeEnd('debug');\n\n  return this._collections[index];\n};\n\n/**\n * Gets the number of collections in this composite.\n */\nCompositeEntityCollection.prototype.getCollectionsLength = function () {\n  return this._collections.length;\n};\n\nfunction getCollectionIndex(collections, collection) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(collection)) {\n    throw new DeveloperError(\"collection is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const index = collections.indexOf(collection);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (index === -1) {\n    throw new DeveloperError(\"collection is not in this composite.\");\n  }\n  //>>includeEnd('debug');\n\n  return index;\n}\n\nfunction swapCollections(composite, i, j) {\n  const arr = composite._collections;\n  i = CesiumMath.clamp(i, 0, arr.length - 1);\n  j = CesiumMath.clamp(j, 0, arr.length - 1);\n\n  if (i === j) {\n    return;\n  }\n\n  const temp = arr[i];\n  arr[i] = arr[j];\n  arr[j] = temp;\n\n  recomposite(composite);\n}\n\n/**\n * Raises a collection up one position in the composite.\n *\n * @param {EntityCollection} collection the collection to move.\n *\n * @exception {DeveloperError} collection is not in this composite.\n */\nCompositeEntityCollection.prototype.raiseCollection = function (collection) {\n  const index = getCollectionIndex(this._collections, collection);\n  swapCollections(this, index, index + 1);\n};\n\n/**\n * Lowers a collection down one position in the composite.\n *\n * @param {EntityCollection} collection the collection to move.\n *\n * @exception {DeveloperError} collection is not in this composite.\n */\nCompositeEntityCollection.prototype.lowerCollection = function (collection) {\n  const index = getCollectionIndex(this._collections, collection);\n  swapCollections(this, index, index - 1);\n};\n\n/**\n * Raises a collection to the top of the composite.\n *\n * @param {EntityCollection} collection the collection to move.\n *\n * @exception {DeveloperError} collection is not in this composite.\n */\nCompositeEntityCollection.prototype.raiseCollectionToTop = function (\n  collection\n) {\n  const index = getCollectionIndex(this._collections, collection);\n  if (index === this._collections.length - 1) {\n    return;\n  }\n  this._collections.splice(index, 1);\n  this._collections.push(collection);\n\n  recomposite(this);\n};\n\n/**\n * Lowers a collection to the bottom of the composite.\n *\n * @param {EntityCollection} collection the collection to move.\n *\n * @exception {DeveloperError} collection is not in this composite.\n */\nCompositeEntityCollection.prototype.lowerCollectionToBottom = function (\n  collection\n) {\n  const index = getCollectionIndex(this._collections, collection);\n  if (index === 0) {\n    return;\n  }\n  this._collections.splice(index, 1);\n  this._collections.splice(0, 0, collection);\n\n  recomposite(this);\n};\n\n/**\n * Prevents {@link EntityCollection#collectionChanged} events from being raised\n * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which\n * point a single event will be raised that covers all suspended operations.\n * This allows for many items to be added and removed efficiently.\n * While events are suspended, recompositing of the collections will\n * also be suspended, as this can be a costly operation.\n * This function can be safely called multiple times as long as there\n * are corresponding calls to {@link EntityCollection#resumeEvents}.\n */\nCompositeEntityCollection.prototype.suspendEvents = function () {\n  this._suspendCount++;\n  this._composite.suspendEvents();\n};\n\n/**\n * Resumes raising {@link EntityCollection#collectionChanged} events immediately\n * when an item is added or removed.  Any modifications made while while events were suspended\n * will be triggered as a single event when this function is called.  This function also ensures\n * the collection is recomposited if events are also resumed.\n * This function is reference counted and can safely be called multiple times as long as there\n * are corresponding calls to {@link EntityCollection#resumeEvents}.\n *\n * @exception {DeveloperError} resumeEvents can not be called before suspendEvents.\n */\nCompositeEntityCollection.prototype.resumeEvents = function () {\n  //>>includeStart('debug', pragmas.debug);\n  if (this._suspendCount === 0) {\n    throw new DeveloperError(\n      \"resumeEvents can not be called before suspendEvents.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._suspendCount--;\n  // recomposite before triggering events (but only if required for performance) that might depend on a composited collection\n  if (this._shouldRecomposite && this._suspendCount === 0) {\n    recomposite(this);\n    this._shouldRecomposite = false;\n  }\n\n  this._composite.resumeEvents();\n};\n\n/**\n * Computes the maximum availability of the entities in the collection.\n * If the collection contains a mix of infinitely available data and non-infinite data,\n * It will return the interval pertaining to the non-infinite data only.  If all\n * data is infinite, an infinite interval will be returned.\n *\n * @returns {TimeInterval} The availability of entities in the collection.\n */\nCompositeEntityCollection.prototype.computeAvailability = function () {\n  return this._composite.computeAvailability();\n};\n\n/**\n * Gets an entity with the specified id.\n *\n * @param {string} id The id of the entity to retrieve.\n * @returns {Entity|undefined} The entity with the provided id or undefined if the id did not exist in the collection.\n */\nCompositeEntityCollection.prototype.getById = function (id) {\n  return this._composite.getById(id);\n};\n\nCompositeEntityCollection.prototype._onCollectionChanged = function (\n  collection,\n  added,\n  removed\n) {\n  const collections = this._collectionsCopy;\n  const collectionsLength = collections.length;\n  const composite = this._composite;\n  composite.suspendEvents();\n\n  let i;\n  let q;\n  let entity;\n  let compositeEntity;\n  const removedLength = removed.length;\n  const eventHash = this._eventHash;\n  const collectionId = collection.id;\n  for (i = 0; i < removedLength; i++) {\n    const removedEntity = removed[i];\n    unsubscribeFromEntity(this, eventHash, collectionId, removedEntity);\n\n    const removedId = removedEntity.id;\n    //Check if the removed entity exists in any of the remaining collections\n    //If so, we clean and remerge it.\n    for (q = collectionsLength - 1; q >= 0; q--) {\n      entity = collections[q].getById(removedId);\n      if (defined(entity)) {\n        if (!defined(compositeEntity)) {\n          compositeEntity = composite.getById(removedId);\n          clean(compositeEntity);\n        }\n        compositeEntity.merge(entity);\n      }\n    }\n    //We never retrieved the compositeEntity, which means it no longer\n    //exists in any of the collections, remove it from the composite.\n    if (!defined(compositeEntity)) {\n      composite.removeById(removedId);\n    }\n    compositeEntity = undefined;\n  }\n\n  const addedLength = added.length;\n  for (i = 0; i < addedLength; i++) {\n    const addedEntity = added[i];\n    subscribeToEntity(this, eventHash, collectionId, addedEntity);\n\n    const addedId = addedEntity.id;\n    //We know the added entity exists in at least one collection,\n    //but we need to check all collections and re-merge in order\n    //to maintain the priority of properties.\n    for (q = collectionsLength - 1; q >= 0; q--) {\n      entity = collections[q].getById(addedId);\n      if (defined(entity)) {\n        if (!defined(compositeEntity)) {\n          compositeEntity = composite.getById(addedId);\n          if (!defined(compositeEntity)) {\n            entityOptionsScratch.id = addedId;\n            compositeEntity = new Entity(entityOptionsScratch);\n            composite.add(compositeEntity);\n          } else {\n            clean(compositeEntity);\n          }\n        }\n        compositeEntity.merge(entity);\n      }\n    }\n    compositeEntity = undefined;\n  }\n\n  composite.resumeEvents();\n};\n\nCompositeEntityCollection.prototype._onDefinitionChanged = function (\n  entity,\n  propertyName,\n  newValue,\n  oldValue\n) {\n  const collections = this._collections;\n  const composite = this._composite;\n\n  const collectionsLength = collections.length;\n  const id = entity.id;\n  const compositeEntity = composite.getById(id);\n  let compositeProperty = compositeEntity[propertyName];\n  const newProperty = !defined(compositeProperty);\n\n  let firstTime = true;\n  for (let q = collectionsLength - 1; q >= 0; q--) {\n    const innerEntity = collections[q].getById(entity.id);\n    if (defined(innerEntity)) {\n      const property = innerEntity[propertyName];\n      if (defined(property)) {\n        if (firstTime) {\n          firstTime = false;\n          //We only want to clone if the property is also mergeable.\n          //This ensures that leaf properties are referenced and not copied,\n          //which is the entire point of compositing.\n          if (defined(property.merge) && defined(property.clone)) {\n            compositeProperty = property.clone(compositeProperty);\n          } else {\n            compositeProperty = property;\n            break;\n          }\n        }\n        compositeProperty.merge(property);\n      }\n    }\n  }\n\n  if (\n    newProperty &&\n    compositeEntity.propertyNames.indexOf(propertyName) === -1\n  ) {\n    compositeEntity.addProperty(propertyName);\n  }\n\n  compositeEntity[propertyName] = compositeProperty;\n};\nexport default CompositeEntityCollection;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * A convenience object that simplifies the common pattern of attaching event listeners\n * to several events, then removing all those listeners at once later, for example, in\n * a destroy method.\n *\n * @alias EventHelper\n * @constructor\n *\n *\n * @example\n * const helper = new Cesium.EventHelper();\n *\n * helper.add(someObject.event, listener1, this);\n * helper.add(otherObject.event, listener2, this);\n *\n * // later...\n * helper.removeAll();\n *\n * @see Event\n */\nfunction EventHelper() {\n  this._removalFunctions = [];\n}\n\n/**\n * Adds a listener to an event, and records the registration to be cleaned up later.\n *\n * @param {Event} event The event to attach to.\n * @param {Function} listener The function to be executed when the event is raised.\n * @param {object} [scope] An optional object scope to serve as the <code>this</code>\n *        pointer in which the listener function will execute.\n * @returns {EventHelper.RemoveCallback} A function that will remove this event listener when invoked.\n *\n * @see Event#addEventListener\n */\nEventHelper.prototype.add = function (event, listener, scope) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(event)) {\n    throw new DeveloperError(\"event is required\");\n  }\n  //>>includeEnd('debug');\n\n  const removalFunction = event.addEventListener(listener, scope);\n  this._removalFunctions.push(removalFunction);\n\n  const that = this;\n  return function () {\n    removalFunction();\n    const removalFunctions = that._removalFunctions;\n    removalFunctions.splice(removalFunctions.indexOf(removalFunction), 1);\n  };\n};\n\n/**\n * Unregisters all previously added listeners.\n *\n * @see Event#removeEventListener\n */\nEventHelper.prototype.removeAll = function () {\n  const removalFunctions = this._removalFunctions;\n  for (let i = 0, len = removalFunctions.length; i < len; ++i) {\n    removalFunctions[i]();\n  }\n  removalFunctions.length = 0;\n};\n\n/**\n * A function that removes a listener.\n * @callback EventHelper.RemoveCallback\n */\nexport default EventHelper;\n", "import binarySearch from \"./binarySearch.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Event from \"./Event.js\";\nimport GregorianDate from \"./GregorianDate.js\";\nimport isLeapYear from \"./isLeapYear.js\";\nimport Iso8601 from \"./Iso8601.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport TimeInterval from \"./TimeInterval.js\";\n\nfunction compareIntervalStartTimes(left, right) {\n  return JulianDate.compare(left.start, right.start);\n}\n\n/**\n * A non-overlapping collection of {@link TimeInterval} instances sorted by start time.\n * @alias TimeIntervalCollection\n * @constructor\n *\n * @param {TimeInterval[]} [intervals] An array of intervals to add to the collection.\n */\nfunction TimeIntervalCollection(intervals) {\n  this._intervals = [];\n  this._changedEvent = new Event();\n\n  if (defined(intervals)) {\n    const length = intervals.length;\n    for (let i = 0; i < length; i++) {\n      this.addInterval(intervals[i]);\n    }\n  }\n}\n\nObject.defineProperties(TimeIntervalCollection.prototype, {\n  /**\n   * Gets an event that is raised whenever the collection of intervals change.\n   * @memberof TimeIntervalCollection.prototype\n   * @type {Event}\n   * @readonly\n   */\n  changedEvent: {\n    get: function () {\n      return this._changedEvent;\n    },\n  },\n\n  /**\n   * Gets the start time of the collection.\n   * @memberof TimeIntervalCollection.prototype\n   * @type {JulianDate}\n   * @readonly\n   */\n  start: {\n    get: function () {\n      const intervals = this._intervals;\n      return intervals.length === 0 ? undefined : intervals[0].start;\n    },\n  },\n\n  /**\n   * Gets whether or not the start time is included in the collection.\n   * @memberof TimeIntervalCollection.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  isStartIncluded: {\n    get: function () {\n      const intervals = this._intervals;\n      return intervals.length === 0 ? false : intervals[0].isStartIncluded;\n    },\n  },\n\n  /**\n   * Gets the stop time of the collection.\n   * @memberof TimeIntervalCollection.prototype\n   * @type {JulianDate}\n   * @readonly\n   */\n  stop: {\n    get: function () {\n      const intervals = this._intervals;\n      const length = intervals.length;\n      return length === 0 ? undefined : intervals[length - 1].stop;\n    },\n  },\n\n  /**\n   * Gets whether or not the stop time is included in the collection.\n   * @memberof TimeIntervalCollection.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  isStopIncluded: {\n    get: function () {\n      const intervals = this._intervals;\n      const length = intervals.length;\n      return length === 0 ? false : intervals[length - 1].isStopIncluded;\n    },\n  },\n\n  /**\n   * Gets the number of intervals in the collection.\n   * @memberof TimeIntervalCollection.prototype\n   * @type {number}\n   * @readonly\n   */\n  length: {\n    get: function () {\n      return this._intervals.length;\n    },\n  },\n\n  /**\n   * Gets whether or not the collection is empty.\n   * @memberof TimeIntervalCollection.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  isEmpty: {\n    get: function () {\n      return this._intervals.length === 0;\n    },\n  },\n});\n\n/**\n * Compares this instance against the provided instance componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {TimeIntervalCollection} [right] The right hand side collection.\n * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals.  If omitted, reference equality is used.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nTimeIntervalCollection.prototype.equals = function (right, dataComparer) {\n  if (this === right) {\n    return true;\n  }\n  if (!(right instanceof TimeIntervalCollection)) {\n    return false;\n  }\n  const intervals = this._intervals;\n  const rightIntervals = right._intervals;\n  const length = intervals.length;\n  if (length !== rightIntervals.length) {\n    return false;\n  }\n  for (let i = 0; i < length; i++) {\n    if (!TimeInterval.equals(intervals[i], rightIntervals[i], dataComparer)) {\n      return false;\n    }\n  }\n  return true;\n};\n\n/**\n * Gets the interval at the specified index.\n *\n * @param {number} index The index of the interval to retrieve.\n * @returns {TimeInterval|undefined} The interval at the specified index, or <code>undefined</code> if no interval exists as that index.\n */\nTimeIntervalCollection.prototype.get = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(index)) {\n    throw new DeveloperError(\"index is required.\");\n  }\n  //>>includeEnd('debug');\n\n  return this._intervals[index];\n};\n\n/**\n * Removes all intervals from the collection.\n */\nTimeIntervalCollection.prototype.removeAll = function () {\n  if (this._intervals.length > 0) {\n    this._intervals.length = 0;\n    this._changedEvent.raiseEvent(this);\n  }\n};\n\n/**\n * Finds and returns the interval that contains the specified date.\n *\n * @param {JulianDate} date The date to search for.\n * @returns {TimeInterval|undefined} The interval containing the specified date, <code>undefined</code> if no such interval exists.\n */\nTimeIntervalCollection.prototype.findIntervalContainingDate = function (date) {\n  const index = this.indexOf(date);\n  return index >= 0 ? this._intervals[index] : undefined;\n};\n\n/**\n * Finds and returns the data for the interval that contains the specified date.\n *\n * @param {JulianDate} date The date to search for.\n * @returns {object} The data for the interval containing the specified date, or <code>undefined</code> if no such interval exists.\n */\nTimeIntervalCollection.prototype.findDataForIntervalContainingDate = function (\n  date\n) {\n  const index = this.indexOf(date);\n  return index >= 0 ? this._intervals[index].data : undefined;\n};\n\n/**\n * Checks if the specified date is inside this collection.\n *\n * @param {JulianDate} julianDate The date to check.\n * @returns {boolean} <code>true</code> if the collection contains the specified date, <code>false</code> otherwise.\n */\nTimeIntervalCollection.prototype.contains = function (julianDate) {\n  return this.indexOf(julianDate) >= 0;\n};\n\nconst indexOfScratch = new TimeInterval();\n\n/**\n * Finds and returns the index of the interval in the collection that contains the specified date.\n *\n * @param {JulianDate} date The date to search for.\n * @returns {number} The index of the interval that contains the specified date, if no such interval exists,\n * it returns a negative number which is the bitwise complement of the index of the next interval that\n * starts after the date, or if no interval starts after the specified date, the bitwise complement of\n * the length of the collection.\n */\nTimeIntervalCollection.prototype.indexOf = function (date) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(date)) {\n    throw new DeveloperError(\"date is required\");\n  }\n  //>>includeEnd('debug');\n\n  const intervals = this._intervals;\n  indexOfScratch.start = date;\n  indexOfScratch.stop = date;\n  let index = binarySearch(\n    intervals,\n    indexOfScratch,\n    compareIntervalStartTimes\n  );\n  if (index >= 0) {\n    if (intervals[index].isStartIncluded) {\n      return index;\n    }\n\n    if (\n      index > 0 &&\n      intervals[index - 1].stop.equals(date) &&\n      intervals[index - 1].isStopIncluded\n    ) {\n      return index - 1;\n    }\n    return ~index;\n  }\n\n  index = ~index;\n  if (\n    index > 0 &&\n    index - 1 < intervals.length &&\n    TimeInterval.contains(intervals[index - 1], date)\n  ) {\n    return index - 1;\n  }\n  return ~index;\n};\n\n/**\n * Returns the first interval in the collection that matches the specified parameters.\n * All parameters are optional and <code>undefined</code> parameters are treated as a don't care condition.\n *\n * @param {object} [options] Object with the following properties:\n * @param {JulianDate} [options.start] The start time of the interval.\n * @param {JulianDate} [options.stop] The stop time of the interval.\n * @param {boolean} [options.isStartIncluded] <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.\n * @param {boolean} [options.isStopIncluded] <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.\n * @returns {TimeInterval|undefined} The first interval in the collection that matches the specified parameters.\n */\nTimeIntervalCollection.prototype.findInterval = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const start = options.start;\n  const stop = options.stop;\n  const isStartIncluded = options.isStartIncluded;\n  const isStopIncluded = options.isStopIncluded;\n\n  const intervals = this._intervals;\n  for (let i = 0, len = intervals.length; i < len; i++) {\n    const interval = intervals[i];\n    if (\n      (!defined(start) || interval.start.equals(start)) &&\n      (!defined(stop) || interval.stop.equals(stop)) &&\n      (!defined(isStartIncluded) ||\n        interval.isStartIncluded === isStartIncluded) &&\n      (!defined(isStopIncluded) || interval.isStopIncluded === isStopIncluded)\n    ) {\n      return intervals[i];\n    }\n  }\n  return undefined;\n};\n\n/**\n * Adds an interval to the collection, merging intervals that contain the same data and\n * splitting intervals of different data as needed in order to maintain a non-overlapping collection.\n * The data in the new interval takes precedence over any existing intervals in the collection.\n *\n * @param {TimeInterval} interval The interval to add.\n * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals.  If omitted, reference equality is used.\n */\nTimeIntervalCollection.prototype.addInterval = function (\n  interval,\n  dataComparer\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(interval)) {\n    throw new DeveloperError(\"interval is required\");\n  }\n  //>>includeEnd('debug');\n\n  if (interval.isEmpty) {\n    return;\n  }\n\n  const intervals = this._intervals;\n\n  // Handle the common case quickly: we're adding a new interval which is after all existing intervals.\n  if (\n    intervals.length === 0 ||\n    JulianDate.greaterThan(interval.start, intervals[intervals.length - 1].stop)\n  ) {\n    intervals.push(interval);\n    this._changedEvent.raiseEvent(this);\n    return;\n  }\n\n  // Keep the list sorted by the start date\n  let index = binarySearch(intervals, interval, compareIntervalStartTimes);\n  if (index < 0) {\n    index = ~index;\n  } else {\n    // interval's start date exactly equals the start date of at least one interval in the collection.\n    // It could actually equal the start date of two intervals if one of them does not actually\n    // include the date.  In that case, the binary search could have found either.  We need to\n    // look at the surrounding intervals and their IsStartIncluded properties in order to make sure\n    // we're working with the correct interval.\n\n    // eslint-disable-next-line no-lonely-if\n    if (\n      index > 0 &&\n      interval.isStartIncluded &&\n      intervals[index - 1].isStartIncluded &&\n      intervals[index - 1].start.equals(interval.start)\n    ) {\n      --index;\n    } else if (\n      index < intervals.length &&\n      !interval.isStartIncluded &&\n      intervals[index].isStartIncluded &&\n      intervals[index].start.equals(interval.start)\n    ) {\n      ++index;\n    }\n  }\n\n  let comparison;\n  if (index > 0) {\n    // Not the first thing in the list, so see if the interval before this one\n    // overlaps this one.\n\n    comparison = JulianDate.compare(intervals[index - 1].stop, interval.start);\n    if (\n      comparison > 0 ||\n      (comparison === 0 &&\n        (intervals[index - 1].isStopIncluded || interval.isStartIncluded))\n    ) {\n      // There is an overlap\n      if (\n        defined(dataComparer)\n          ? dataComparer(intervals[index - 1].data, interval.data)\n          : intervals[index - 1].data === interval.data\n      ) {\n        // Overlapping intervals have the same data, so combine them\n        if (JulianDate.greaterThan(interval.stop, intervals[index - 1].stop)) {\n          interval = new TimeInterval({\n            start: intervals[index - 1].start,\n            stop: interval.stop,\n            isStartIncluded: intervals[index - 1].isStartIncluded,\n            isStopIncluded: interval.isStopIncluded,\n            data: interval.data,\n          });\n        } else {\n          interval = new TimeInterval({\n            start: intervals[index - 1].start,\n            stop: intervals[index - 1].stop,\n            isStartIncluded: intervals[index - 1].isStartIncluded,\n            isStopIncluded:\n              intervals[index - 1].isStopIncluded ||\n              (interval.stop.equals(intervals[index - 1].stop) &&\n                interval.isStopIncluded),\n            data: interval.data,\n          });\n        }\n        intervals.splice(index - 1, 1);\n        --index;\n      } else {\n        // Overlapping intervals have different data.  The new interval\n        // being added 'wins' so truncate the previous interval.\n        // If the existing interval extends past the end of the new one,\n        // split the existing interval into two intervals.\n        comparison = JulianDate.compare(\n          intervals[index - 1].stop,\n          interval.stop\n        );\n        if (\n          comparison > 0 ||\n          (comparison === 0 &&\n            intervals[index - 1].isStopIncluded &&\n            !interval.isStopIncluded)\n        ) {\n          intervals.splice(\n            index,\n            0,\n            new TimeInterval({\n              start: interval.stop,\n              stop: intervals[index - 1].stop,\n              isStartIncluded: !interval.isStopIncluded,\n              isStopIncluded: intervals[index - 1].isStopIncluded,\n              data: intervals[index - 1].data,\n            })\n          );\n        }\n        intervals[index - 1] = new TimeInterval({\n          start: intervals[index - 1].start,\n          stop: interval.start,\n          isStartIncluded: intervals[index - 1].isStartIncluded,\n          isStopIncluded: !interval.isStartIncluded,\n          data: intervals[index - 1].data,\n        });\n      }\n    }\n  }\n\n  while (index < intervals.length) {\n    // Not the last thing in the list, so see if the intervals after this one overlap this one.\n    comparison = JulianDate.compare(interval.stop, intervals[index].start);\n    if (\n      comparison > 0 ||\n      (comparison === 0 &&\n        (interval.isStopIncluded || intervals[index].isStartIncluded))\n    ) {\n      // There is an overlap\n      if (\n        defined(dataComparer)\n          ? dataComparer(intervals[index].data, interval.data)\n          : intervals[index].data === interval.data\n      ) {\n        // Overlapping intervals have the same data, so combine them\n        interval = new TimeInterval({\n          start: interval.start,\n          stop: JulianDate.greaterThan(intervals[index].stop, interval.stop)\n            ? intervals[index].stop\n            : interval.stop,\n          isStartIncluded: interval.isStartIncluded,\n          isStopIncluded: JulianDate.greaterThan(\n            intervals[index].stop,\n            interval.stop\n          )\n            ? intervals[index].isStopIncluded\n            : interval.isStopIncluded,\n          data: interval.data,\n        });\n        intervals.splice(index, 1);\n      } else {\n        // Overlapping intervals have different data.  The new interval\n        // being added 'wins' so truncate the next interval.\n        intervals[index] = new TimeInterval({\n          start: interval.stop,\n          stop: intervals[index].stop,\n          isStartIncluded: !interval.isStopIncluded,\n          isStopIncluded: intervals[index].isStopIncluded,\n          data: intervals[index].data,\n        });\n\n        if (intervals[index].isEmpty) {\n          intervals.splice(index, 1);\n        } else {\n          // Found a partial span, so it is not possible for the next\n          // interval to be spanned at all.  Stop looking.\n          break;\n        }\n      }\n    } else {\n      // Found the last one we're spanning, so stop looking.\n      break;\n    }\n  }\n\n  // Add the new interval\n  intervals.splice(index, 0, interval);\n  this._changedEvent.raiseEvent(this);\n};\n\n/**\n * Removes the specified interval from this interval collection, creating a hole over the specified interval.\n * The data property of the input interval is ignored.\n *\n * @param {TimeInterval} interval The interval to remove.\n * @returns {boolean} <code>true</code> if the interval was removed, <code>false</code> if no part of the interval was in the collection.\n */\nTimeIntervalCollection.prototype.removeInterval = function (interval) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(interval)) {\n    throw new DeveloperError(\"interval is required\");\n  }\n  //>>includeEnd('debug');\n\n  if (interval.isEmpty) {\n    return false;\n  }\n\n  const intervals = this._intervals;\n\n  let index = binarySearch(intervals, interval, compareIntervalStartTimes);\n  if (index < 0) {\n    index = ~index;\n  }\n\n  let result = false;\n\n  // Check for truncation of the end of the previous interval.\n  if (\n    index > 0 &&\n    (JulianDate.greaterThan(intervals[index - 1].stop, interval.start) ||\n      (intervals[index - 1].stop.equals(interval.start) &&\n        intervals[index - 1].isStopIncluded &&\n        interval.isStartIncluded))\n  ) {\n    result = true;\n\n    if (\n      JulianDate.greaterThan(intervals[index - 1].stop, interval.stop) ||\n      (intervals[index - 1].isStopIncluded &&\n        !interval.isStopIncluded &&\n        intervals[index - 1].stop.equals(interval.stop))\n    ) {\n      // Break the existing interval into two pieces\n      intervals.splice(\n        index,\n        0,\n        new TimeInterval({\n          start: interval.stop,\n          stop: intervals[index - 1].stop,\n          isStartIncluded: !interval.isStopIncluded,\n          isStopIncluded: intervals[index - 1].isStopIncluded,\n          data: intervals[index - 1].data,\n        })\n      );\n    }\n    intervals[index - 1] = new TimeInterval({\n      start: intervals[index - 1].start,\n      stop: interval.start,\n      isStartIncluded: intervals[index - 1].isStartIncluded,\n      isStopIncluded: !interval.isStartIncluded,\n      data: intervals[index - 1].data,\n    });\n  }\n\n  // Check if the Start of the current interval should remain because interval.start is the same but\n  // it is not included.\n  if (\n    index < intervals.length &&\n    !interval.isStartIncluded &&\n    intervals[index].isStartIncluded &&\n    interval.start.equals(intervals[index].start)\n  ) {\n    result = true;\n\n    intervals.splice(\n      index,\n      0,\n      new TimeInterval({\n        start: intervals[index].start,\n        stop: intervals[index].start,\n        isStartIncluded: true,\n        isStopIncluded: true,\n        data: intervals[index].data,\n      })\n    );\n    ++index;\n  }\n\n  // Remove any intervals that are completely overlapped by the input interval.\n  while (\n    index < intervals.length &&\n    JulianDate.greaterThan(interval.stop, intervals[index].stop)\n  ) {\n    result = true;\n    intervals.splice(index, 1);\n  }\n\n  // Check for the case where the input interval ends on the same date\n  // as an existing interval.\n  if (index < intervals.length && interval.stop.equals(intervals[index].stop)) {\n    result = true;\n\n    if (!interval.isStopIncluded && intervals[index].isStopIncluded) {\n      // Last point of interval should remain because the stop date is included in\n      // the existing interval but is not included in the input interval.\n      if (\n        index + 1 < intervals.length &&\n        intervals[index + 1].start.equals(interval.stop) &&\n        intervals[index].data === intervals[index + 1].data\n      ) {\n        // Combine single point with the next interval\n        intervals.splice(index, 1);\n        intervals[index] = new TimeInterval({\n          start: intervals[index].start,\n          stop: intervals[index].stop,\n          isStartIncluded: true,\n          isStopIncluded: intervals[index].isStopIncluded,\n          data: intervals[index].data,\n        });\n      } else {\n        intervals[index] = new TimeInterval({\n          start: interval.stop,\n          stop: interval.stop,\n          isStartIncluded: true,\n          isStopIncluded: true,\n          data: intervals[index].data,\n        });\n      }\n    } else {\n      // Interval is completely overlapped\n      intervals.splice(index, 1);\n    }\n  }\n\n  // Truncate any partially-overlapped intervals.\n  if (\n    index < intervals.length &&\n    (JulianDate.greaterThan(interval.stop, intervals[index].start) ||\n      (interval.stop.equals(intervals[index].start) &&\n        interval.isStopIncluded &&\n        intervals[index].isStartIncluded))\n  ) {\n    result = true;\n    intervals[index] = new TimeInterval({\n      start: interval.stop,\n      stop: intervals[index].stop,\n      isStartIncluded: !interval.isStopIncluded,\n      isStopIncluded: intervals[index].isStopIncluded,\n      data: intervals[index].data,\n    });\n  }\n\n  if (result) {\n    this._changedEvent.raiseEvent(this);\n  }\n\n  return result;\n};\n\n/**\n * Creates a new instance that is the intersection of this collection and the provided collection.\n *\n * @param {TimeIntervalCollection} other The collection to intersect with.\n * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals.  If omitted, reference equality is used.\n * @param {TimeInterval.MergeCallback} [mergeCallback] A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.\n * @returns {TimeIntervalCollection} A new TimeIntervalCollection which is the intersection of this collection and the provided collection.\n */\nTimeIntervalCollection.prototype.intersect = function (\n  other,\n  dataComparer,\n  mergeCallback\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(other)) {\n    throw new DeveloperError(\"other is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const result = new TimeIntervalCollection();\n  let left = 0;\n  let right = 0;\n  const intervals = this._intervals;\n  const otherIntervals = other._intervals;\n\n  while (left < intervals.length && right < otherIntervals.length) {\n    const leftInterval = intervals[left];\n    const rightInterval = otherIntervals[right];\n    if (JulianDate.lessThan(leftInterval.stop, rightInterval.start)) {\n      ++left;\n    } else if (JulianDate.lessThan(rightInterval.stop, leftInterval.start)) {\n      ++right;\n    } else {\n      // The following will return an intersection whose data is 'merged' if the callback is defined\n      if (\n        defined(mergeCallback) ||\n        (defined(dataComparer) &&\n          dataComparer(leftInterval.data, rightInterval.data)) ||\n        (!defined(dataComparer) && rightInterval.data === leftInterval.data)\n      ) {\n        const intersection = TimeInterval.intersect(\n          leftInterval,\n          rightInterval,\n          new TimeInterval(),\n          mergeCallback\n        );\n        if (!intersection.isEmpty) {\n          // Since we start with an empty collection for 'result', and there are no overlapping intervals in 'this' (as a rule),\n          // the 'intersection' will never overlap with a previous interval in 'result'.  So, no need to do any additional 'merging'.\n          result.addInterval(intersection, dataComparer);\n        }\n      }\n\n      if (\n        JulianDate.lessThan(leftInterval.stop, rightInterval.stop) ||\n        (leftInterval.stop.equals(rightInterval.stop) &&\n          !leftInterval.isStopIncluded &&\n          rightInterval.isStopIncluded)\n      ) {\n        ++left;\n      } else {\n        ++right;\n      }\n    }\n  }\n  return result;\n};\n\n/**\n * Creates a new instance from a JulianDate array.\n *\n * @param {object} options Object with the following properties:\n * @param {JulianDate[]} options.julianDates An array of ISO 8601 dates.\n * @param {boolean} [options.isStartIncluded=true] <code>true</code> if start time is included in the interval, <code>false</code> otherwise.\n * @param {boolean} [options.isStopIncluded=true] <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.\n * @param {boolean} [options.leadingInterval=false] <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time,  <code>false</code> otherwise.\n * @param {boolean} [options.trailingInterval=false] <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE,  <code>false</code> otherwise.\n * @param {Function} [options.dataCallback] A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection.\n * @param {TimeIntervalCollection} [result] An existing instance to use for the result.\n * @returns {TimeIntervalCollection} The modified result parameter or a new instance if none was provided.\n */\nTimeIntervalCollection.fromJulianDateArray = function (options, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options)) {\n    throw new DeveloperError(\"options is required.\");\n  }\n  if (!defined(options.julianDates)) {\n    throw new DeveloperError(\"options.iso8601Array is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new TimeIntervalCollection();\n  }\n\n  const julianDates = options.julianDates;\n  const length = julianDates.length;\n  const dataCallback = options.dataCallback;\n\n  const isStartIncluded = defaultValue(options.isStartIncluded, true);\n  const isStopIncluded = defaultValue(options.isStopIncluded, true);\n  const leadingInterval = defaultValue(options.leadingInterval, false);\n  const trailingInterval = defaultValue(options.trailingInterval, false);\n  let interval;\n\n  // Add a default interval, which will only end up being used up to first interval\n  let startIndex = 0;\n  if (leadingInterval) {\n    ++startIndex;\n    interval = new TimeInterval({\n      start: Iso8601.MINIMUM_VALUE,\n      stop: julianDates[0],\n      isStartIncluded: true,\n      isStopIncluded: !isStartIncluded,\n    });\n    interval.data = defined(dataCallback)\n      ? dataCallback(interval, result.length)\n      : result.length;\n    result.addInterval(interval);\n  }\n\n  for (let i = 0; i < length - 1; ++i) {\n    let startDate = julianDates[i];\n    const endDate = julianDates[i + 1];\n\n    interval = new TimeInterval({\n      start: startDate,\n      stop: endDate,\n      isStartIncluded: result.length === startIndex ? isStartIncluded : true,\n      isStopIncluded: i === length - 2 ? isStopIncluded : false,\n    });\n    interval.data = defined(dataCallback)\n      ? dataCallback(interval, result.length)\n      : result.length;\n    result.addInterval(interval);\n\n    startDate = endDate;\n  }\n\n  if (trailingInterval) {\n    interval = new TimeInterval({\n      start: julianDates[length - 1],\n      stop: Iso8601.MAXIMUM_VALUE,\n      isStartIncluded: !isStopIncluded,\n      isStopIncluded: true,\n    });\n    interval.data = defined(dataCallback)\n      ? dataCallback(interval, result.length)\n      : result.length;\n    result.addInterval(interval);\n  }\n\n  return result;\n};\n\nconst scratchGregorianDate = new GregorianDate();\nconst monthLengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n/**\n * Adds duration represented as a GregorianDate to a JulianDate\n *\n * @param {JulianDate} julianDate The date.\n * @param {GregorianDate} duration An duration represented as a GregorianDate.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n *\n * @private\n */\nfunction addToDate(julianDate, duration, result) {\n  if (!defined(result)) {\n    result = new JulianDate();\n  }\n  JulianDate.toGregorianDate(julianDate, scratchGregorianDate);\n\n  let millisecond = scratchGregorianDate.millisecond + duration.millisecond;\n  let second = scratchGregorianDate.second + duration.second;\n  let minute = scratchGregorianDate.minute + duration.minute;\n  let hour = scratchGregorianDate.hour + duration.hour;\n  let day = scratchGregorianDate.day + duration.day;\n  let month = scratchGregorianDate.month + duration.month;\n  let year = scratchGregorianDate.year + duration.year;\n\n  if (millisecond >= 1000) {\n    second += Math.floor(millisecond / 1000);\n    millisecond = millisecond % 1000;\n  }\n\n  if (second >= 60) {\n    minute += Math.floor(second / 60);\n    second = second % 60;\n  }\n\n  if (minute >= 60) {\n    hour += Math.floor(minute / 60);\n    minute = minute % 60;\n  }\n\n  if (hour >= 24) {\n    day += Math.floor(hour / 24);\n    hour = hour % 24;\n  }\n\n  // If days is greater than the month's length we need to remove those number of days,\n  //  readjust month and year and repeat until days is less than the month's length.\n  monthLengths[2] = isLeapYear(year) ? 29 : 28;\n  while (day > monthLengths[month] || month >= 13) {\n    if (day > monthLengths[month]) {\n      day -= monthLengths[month];\n      ++month;\n    }\n\n    if (month >= 13) {\n      --month;\n      year += Math.floor(month / 12);\n      month = month % 12;\n      ++month;\n    }\n\n    monthLengths[2] = isLeapYear(year) ? 29 : 28;\n  }\n\n  scratchGregorianDate.millisecond = millisecond;\n  scratchGregorianDate.second = second;\n  scratchGregorianDate.minute = minute;\n  scratchGregorianDate.hour = hour;\n  scratchGregorianDate.day = day;\n  scratchGregorianDate.month = month;\n  scratchGregorianDate.year = year;\n\n  return JulianDate.fromGregorianDate(scratchGregorianDate, result);\n}\n\nconst scratchJulianDate = new JulianDate();\nconst durationRegex = /P(?:([\\d.,]+)Y)?(?:([\\d.,]+)M)?(?:([\\d.,]+)W)?(?:([\\d.,]+)D)?(?:T(?:([\\d.,]+)H)?(?:([\\d.,]+)M)?(?:([\\d.,]+)S)?)?/;\n\n/**\n * Parses ISO8601 duration string\n *\n * @param {string} iso8601 An ISO 8601 duration.\n * @param {GregorianDate} result An existing instance to use for the result.\n * @returns {boolean} True is parsing succeeded, false otherwise\n *\n * @private\n */\nfunction parseDuration(iso8601, result) {\n  if (!defined(iso8601) || iso8601.length === 0) {\n    return false;\n  }\n\n  // Reset object\n  result.year = 0;\n  result.month = 0;\n  result.day = 0;\n  result.hour = 0;\n  result.minute = 0;\n  result.second = 0;\n  result.millisecond = 0;\n\n  if (iso8601[0] === \"P\") {\n    const matches = iso8601.match(durationRegex);\n    if (!defined(matches)) {\n      return false;\n    }\n    if (defined(matches[1])) {\n      // Years\n      result.year = Number(matches[1].replace(\",\", \".\"));\n    }\n    if (defined(matches[2])) {\n      // Months\n      result.month = Number(matches[2].replace(\",\", \".\"));\n    }\n    if (defined(matches[3])) {\n      // Weeks\n      result.day = Number(matches[3].replace(\",\", \".\")) * 7;\n    }\n    if (defined(matches[4])) {\n      // Days\n      result.day += Number(matches[4].replace(\",\", \".\"));\n    }\n    if (defined(matches[5])) {\n      // Hours\n      result.hour = Number(matches[5].replace(\",\", \".\"));\n    }\n    if (defined(matches[6])) {\n      // Weeks\n      result.minute = Number(matches[6].replace(\",\", \".\"));\n    }\n    if (defined(matches[7])) {\n      // Seconds\n      const seconds = Number(matches[7].replace(\",\", \".\"));\n      result.second = Math.floor(seconds);\n      result.millisecond = (seconds % 1) * 1000;\n    }\n  } else {\n    // They can technically specify the duration as a normal date with some caveats. Try our best to load it.\n    if (iso8601[iso8601.length - 1] !== \"Z\") {\n      // It's not a date, its a duration, so it always has to be UTC\n      iso8601 += \"Z\";\n    }\n    JulianDate.toGregorianDate(\n      JulianDate.fromIso8601(iso8601, scratchJulianDate),\n      result\n    );\n  }\n\n  // A duration of 0 will cause an infinite loop, so just make sure something is non-zero\n  return (\n    result.year ||\n    result.month ||\n    result.day ||\n    result.hour ||\n    result.minute ||\n    result.second ||\n    result.millisecond\n  );\n}\n\nconst scratchDuration = new GregorianDate();\n/**\n * Creates a new instance from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} time interval (start/end/duration).\n *\n * @param {object} options Object with the following properties:\n * @param {string} options.iso8601 An ISO 8601 interval.\n * @param {boolean} [options.isStartIncluded=true] <code>true</code> if start time is included in the interval, <code>false</code> otherwise.\n * @param {boolean} [options.isStopIncluded=true] <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.\n * @param {boolean} [options.leadingInterval=false] <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time,  <code>false</code> otherwise.\n * @param {boolean} [options.trailingInterval=false] <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE,  <code>false</code> otherwise.\n * @param {Function} [options.dataCallback] A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection.\n * @param {TimeIntervalCollection} [result] An existing instance to use for the result.\n * @returns {TimeIntervalCollection} The modified result parameter or a new instance if none was provided.\n */\nTimeIntervalCollection.fromIso8601 = function (options, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options)) {\n    throw new DeveloperError(\"options is required.\");\n  }\n  if (!defined(options.iso8601)) {\n    throw new DeveloperError(\"options.iso8601 is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const dates = options.iso8601.split(\"/\");\n  const start = JulianDate.fromIso8601(dates[0]);\n  const stop = JulianDate.fromIso8601(dates[1]);\n  const julianDates = [];\n\n  if (!parseDuration(dates[2], scratchDuration)) {\n    julianDates.push(start, stop);\n  } else {\n    let date = JulianDate.clone(start);\n    julianDates.push(date);\n    while (JulianDate.compare(date, stop) < 0) {\n      date = addToDate(date, scratchDuration);\n      const afterStop = JulianDate.compare(stop, date) <= 0;\n      if (afterStop) {\n        JulianDate.clone(stop, date);\n      }\n\n      julianDates.push(date);\n    }\n  }\n\n  return TimeIntervalCollection.fromJulianDateArray(\n    {\n      julianDates: julianDates,\n      isStartIncluded: options.isStartIncluded,\n      isStopIncluded: options.isStopIncluded,\n      leadingInterval: options.leadingInterval,\n      trailingInterval: options.trailingInterval,\n      dataCallback: options.dataCallback,\n    },\n    result\n  );\n};\n\n/**\n * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date array.\n *\n * @param {object} options Object with the following properties:\n * @param {string[]} options.iso8601Dates An array of ISO 8601 dates.\n * @param {boolean} [options.isStartIncluded=true] <code>true</code> if start time is included in the interval, <code>false</code> otherwise.\n * @param {boolean} [options.isStopIncluded=true] <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.\n * @param {boolean} [options.leadingInterval=false] <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time,  <code>false</code> otherwise.\n * @param {boolean} [options.trailingInterval=false] <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE,  <code>false</code> otherwise.\n * @param {Function} [options.dataCallback] A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection.\n * @param {TimeIntervalCollection} [result] An existing instance to use for the result.\n * @returns {TimeIntervalCollection} The modified result parameter or a new instance if none was provided.\n */\nTimeIntervalCollection.fromIso8601DateArray = function (options, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options)) {\n    throw new DeveloperError(\"options is required.\");\n  }\n  if (!defined(options.iso8601Dates)) {\n    throw new DeveloperError(\"options.iso8601Dates is required.\");\n  }\n  //>>includeEnd('debug');\n\n  return TimeIntervalCollection.fromJulianDateArray(\n    {\n      julianDates: options.iso8601Dates.map(function (date) {\n        return JulianDate.fromIso8601(date);\n      }),\n      isStartIncluded: options.isStartIncluded,\n      isStopIncluded: options.isStopIncluded,\n      leadingInterval: options.leadingInterval,\n      trailingInterval: options.trailingInterval,\n      dataCallback: options.dataCallback,\n    },\n    result\n  );\n};\n\n/**\n * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} duration array.\n *\n * @param {object} options Object with the following properties:\n * @param {JulianDate} options.epoch An date that the durations are relative to.\n * @param {string} options.iso8601Durations An array of ISO 8601 durations.\n * @param {boolean} [options.relativeToPrevious=false] <code>true</code> if durations are relative to previous date, <code>false</code> if always relative to the epoch.\n * @param {boolean} [options.isStartIncluded=true] <code>true</code> if start time is included in the interval, <code>false</code> otherwise.\n * @param {boolean} [options.isStopIncluded=true] <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.\n * @param {boolean} [options.leadingInterval=false] <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time,  <code>false</code> otherwise.\n * @param {boolean} [options.trailingInterval=false] <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE,  <code>false</code> otherwise.\n * @param {Function} [options.dataCallback] A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection.\n * @param {TimeIntervalCollection} [result] An existing instance to use for the result.\n * @returns {TimeIntervalCollection} The modified result parameter or a new instance if none was provided.\n */\nTimeIntervalCollection.fromIso8601DurationArray = function (options, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options)) {\n    throw new DeveloperError(\"options is required.\");\n  }\n  if (!defined(options.epoch)) {\n    throw new DeveloperError(\"options.epoch is required.\");\n  }\n  if (!defined(options.iso8601Durations)) {\n    throw new DeveloperError(\"options.iso8601Durations is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const epoch = options.epoch;\n  const iso8601Durations = options.iso8601Durations;\n  const relativeToPrevious = defaultValue(options.relativeToPrevious, false);\n  const julianDates = [];\n  let date, previousDate;\n\n  const length = iso8601Durations.length;\n  for (let i = 0; i < length; ++i) {\n    // Allow a duration of 0 on the first iteration, because then it is just the epoch\n    if (parseDuration(iso8601Durations[i], scratchDuration) || i === 0) {\n      if (relativeToPrevious && defined(previousDate)) {\n        date = addToDate(previousDate, scratchDuration);\n      } else {\n        date = addToDate(epoch, scratchDuration);\n      }\n      julianDates.push(date);\n      previousDate = date;\n    }\n  }\n\n  return TimeIntervalCollection.fromJulianDateArray(\n    {\n      julianDates: julianDates,\n      isStartIncluded: options.isStartIncluded,\n      isStopIncluded: options.isStopIncluded,\n      leadingInterval: options.leadingInterval,\n      trailingInterval: options.trailingInterval,\n      dataCallback: options.dataCallback,\n    },\n    result\n  );\n};\nexport default TimeIntervalCollection;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport EventHelper from \"../Core/EventHelper.js\";\nimport TimeIntervalCollection from \"../Core/TimeIntervalCollection.js\";\nimport Property from \"./Property.js\";\n\nfunction subscribeAll(property, eventHelper, definitionChanged, intervals) {\n  function callback() {\n    definitionChanged.raiseEvent(property);\n  }\n  const items = [];\n  eventHelper.removeAll();\n  const length = intervals.length;\n  for (let i = 0; i < length; i++) {\n    const interval = intervals.get(i);\n    if (defined(interval.data) && items.indexOf(interval.data) === -1) {\n      eventHelper.add(interval.data.definitionChanged, callback);\n    }\n  }\n}\n\n/**\n * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the\n * data property of each {@link TimeInterval} is another Property instance which is\n * evaluated at the provided time.\n *\n * @alias CompositeProperty\n * @constructor\n *\n *\n * @example\n * const constantProperty = ...;\n * const sampledProperty = ...;\n *\n * //Create a composite property from two previously defined properties\n * //where the property is valid on August 1st, 2012 and uses a constant\n * //property for the first half of the day and a sampled property for the\n * //remaining half.\n * const composite = new Cesium.CompositeProperty();\n * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({\n *     iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T12:00:00.00Z',\n *     data : constantProperty\n * }));\n * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({\n *     iso8601 : '2012-08-01T12:00:00.00Z/2012-08-02T00:00:00.00Z',\n *     isStartIncluded : false,\n *     isStopIncluded : false,\n *     data : sampledProperty\n * }));\n *\n * @see CompositeMaterialProperty\n * @see CompositePositionProperty\n */\nfunction CompositeProperty() {\n  this._eventHelper = new EventHelper();\n  this._definitionChanged = new Event();\n  this._intervals = new TimeIntervalCollection();\n  this._intervals.changedEvent.addEventListener(\n    CompositeProperty.prototype._intervalsChanged,\n    this\n  );\n}\n\nObject.defineProperties(CompositeProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof CompositeProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return this._intervals.isEmpty;\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is changed whenever setValue is called with data different\n   * than the current value.\n   * @memberof CompositeProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets the interval collection.\n   * @memberof CompositeProperty.prototype\n   *\n   * @type {TimeIntervalCollection}\n   */\n  intervals: {\n    get: function () {\n      return this._intervals;\n    },\n  },\n});\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nCompositeProperty.prototype.getValue = function (time, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required\");\n  }\n  //>>includeEnd('debug');\n\n  const innerProperty = this._intervals.findDataForIntervalContainingDate(time);\n  if (defined(innerProperty)) {\n    return innerProperty.getValue(time, result);\n  }\n  return undefined;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCompositeProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof CompositeProperty && //\n      this._intervals.equals(other._intervals, Property.equals))\n  );\n};\n\n/**\n * @private\n */\nCompositeProperty.prototype._intervalsChanged = function () {\n  subscribeAll(\n    this,\n    this._eventHelper,\n    this._definitionChanged,\n    this._intervals\n  );\n  this._definitionChanged.raiseEvent(this);\n};\nexport default CompositeProperty;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport CompositeProperty from \"./CompositeProperty.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link CompositeProperty} which is also a {@link MaterialProperty}.\n *\n * @alias CompositeMaterialProperty\n * @constructor\n */\nfunction CompositeMaterialProperty() {\n  this._definitionChanged = new Event();\n  this._composite = new CompositeProperty();\n  this._composite.definitionChanged.addEventListener(\n    CompositeMaterialProperty.prototype._raiseDefinitionChanged,\n    this\n  );\n}\n\nObject.defineProperties(CompositeMaterialProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof CompositeMaterialProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return this._composite.isConstant;\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is changed whenever setValue is called with data different\n   * than the current value.\n   * @memberof CompositeMaterialProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets the interval collection.\n   * @memberof CompositeMaterialProperty.prototype\n   *\n   * @type {TimeIntervalCollection}\n   */\n  intervals: {\n    get: function () {\n      return this._composite._intervals;\n    },\n  },\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {string} The type of material.\n */\nCompositeMaterialProperty.prototype.getType = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required\");\n  }\n  //>>includeEnd('debug');\n\n  const innerProperty = this._composite._intervals.findDataForIntervalContainingDate(\n    time\n  );\n  if (defined(innerProperty)) {\n    return innerProperty.getType(time);\n  }\n  return undefined;\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nCompositeMaterialProperty.prototype.getValue = function (time, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required\");\n  }\n  //>>includeEnd('debug');\n\n  const innerProperty = this._composite._intervals.findDataForIntervalContainingDate(\n    time\n  );\n  if (defined(innerProperty)) {\n    return innerProperty.getValue(time, result);\n  }\n  return undefined;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCompositeMaterialProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof CompositeMaterialProperty && //\n      this._composite.equals(other._composite, Property.equals))\n  );\n};\n\n/**\n * @private\n */\nCompositeMaterialProperty.prototype._raiseDefinitionChanged = function () {\n  this._definitionChanged.raiseEvent(this);\n};\nexport default CompositeMaterialProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport CompositeProperty from \"./CompositeProperty.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link CompositeProperty} which is also a {@link PositionProperty}.\n *\n * @alias CompositePositionProperty\n * @constructor\n *\n * @param {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined.\n */\nfunction CompositePositionProperty(referenceFrame) {\n  this._referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED);\n  this._definitionChanged = new Event();\n  this._composite = new CompositeProperty();\n  this._composite.definitionChanged.addEventListener(\n    CompositePositionProperty.prototype._raiseDefinitionChanged,\n    this\n  );\n}\n\nObject.defineProperties(CompositePositionProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof CompositePositionProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return this._composite.isConstant;\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is changed whenever setValue is called with data different\n   * than the current value.\n   * @memberof CompositePositionProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets the interval collection.\n   * @memberof CompositePositionProperty.prototype\n   *\n   * @type {TimeIntervalCollection}\n   */\n  intervals: {\n    get: function () {\n      return this._composite.intervals;\n    },\n  },\n  /**\n   * Gets or sets the reference frame which this position presents itself as.\n   * Each PositionProperty making up this object has it's own reference frame,\n   * so this property merely exposes a \"preferred\" reference frame for clients\n   * to use.\n   * @memberof CompositePositionProperty.prototype\n   *\n   * @type {ReferenceFrame}\n   */\n  referenceFrame: {\n    get: function () {\n      return this._referenceFrame;\n    },\n    set: function (value) {\n      this._referenceFrame = value;\n    },\n  },\n});\n\n/**\n * Gets the value of the property at the provided time in the fixed frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nCompositePositionProperty.prototype.getValue = function (time, result) {\n  return this.getValueInReferenceFrame(time, ReferenceFrame.FIXED, result);\n};\n\n/**\n * Gets the value of the property at the provided time and in the provided reference frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nCompositePositionProperty.prototype.getValueInReferenceFrame = function (\n  time,\n  referenceFrame,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required.\");\n  }\n  if (!defined(referenceFrame)) {\n    throw new DeveloperError(\"referenceFrame is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const innerProperty = this._composite._intervals.findDataForIntervalContainingDate(\n    time\n  );\n  if (defined(innerProperty)) {\n    return innerProperty.getValueInReferenceFrame(time, referenceFrame, result);\n  }\n  return undefined;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCompositePositionProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof CompositePositionProperty && //\n      this._referenceFrame === other._referenceFrame && //\n      this._composite.equals(other._composite, Property.equals))\n  );\n};\n\n/**\n * @private\n */\nCompositePositionProperty.prototype._raiseDefinitionChanged = function () {\n  this._definitionChanged.raiseEvent(this);\n};\nexport default CompositePositionProperty;\n", "/**\n * Style options for corners.\n *\n * @demo The {@link https://sandcastle.cesium.com/index.html?src=Corridor.html&label=Geometries|Corridor Demo}\n * demonstrates the three corner types, as used by {@link CorridorGraphics}.\n *\n * @enum {number}\n */\nconst CornerType = {\n  /**\n   * <img src=\"Images/CornerTypeRounded.png\" style=\"vertical-align: middle;\" width=\"186\" height=\"189\" />\n   *\n   * Corner has a smooth edge.\n   * @type {number}\n   * @constant\n   */\n  ROUNDED: 0,\n\n  /**\n   * <img src=\"Images/CornerTypeMitered.png\" style=\"vertical-align: middle;\" width=\"186\" height=\"189\" />\n   *\n   * Corner point is the intersection of adjacent edges.\n   * @type {number}\n   * @constant\n   */\n  MITERED: 1,\n\n  /**\n   * <img src=\"Images/CornerTypeBeveled.png\" style=\"vertical-align: middle;\" width=\"186\" height=\"189\" />\n   *\n   * Corner is clipped.\n   * @type {number}\n   * @constant\n   */\n  BEVELED: 2,\n};\nexport default Object.freeze(CornerType);\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport CornerType from \"./CornerType.js\";\nimport EllipsoidTangentPlane from \"./EllipsoidTangentPlane.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport PolylinePipeline from \"./PolylinePipeline.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Transforms from \"./Transforms.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\n\nconst scratch2Array = [new Cartesian3(), new Cartesian3()];\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchCartesian3 = new Cartesian3();\nconst scratchCartesian4 = new Cartesian3();\nconst scratchCartesian5 = new Cartesian3();\nconst scratchCartesian6 = new Cartesian3();\nconst scratchCartesian7 = new Cartesian3();\nconst scratchCartesian8 = new Cartesian3();\nconst scratchCartesian9 = new Cartesian3();\n\nconst scratch1 = new Cartesian3();\nconst scratch2 = new Cartesian3();\n\n/**\n * @private\n */\nconst PolylineVolumeGeometryLibrary = {};\n\nlet cartographic = new Cartographic();\nfunction scaleToSurface(positions, ellipsoid) {\n  const heights = new Array(positions.length);\n  for (let i = 0; i < positions.length; i++) {\n    const pos = positions[i];\n    cartographic = ellipsoid.cartesianToCartographic(pos, cartographic);\n    heights[i] = cartographic.height;\n    positions[i] = ellipsoid.scaleToGeodeticSurface(pos, pos);\n  }\n  return heights;\n}\n\nfunction subdivideHeights(points, h0, h1, granularity) {\n  const p0 = points[0];\n  const p1 = points[1];\n  const angleBetween = Cartesian3.angleBetween(p0, p1);\n  const numPoints = Math.ceil(angleBetween / granularity);\n  const heights = new Array(numPoints);\n  let i;\n  if (h0 === h1) {\n    for (i = 0; i < numPoints; i++) {\n      heights[i] = h0;\n    }\n    heights.push(h1);\n    return heights;\n  }\n\n  const dHeight = h1 - h0;\n  const heightPerVertex = dHeight / numPoints;\n\n  for (i = 1; i < numPoints; i++) {\n    const h = h0 + i * heightPerVertex;\n    heights[i] = h;\n  }\n\n  heights[0] = h0;\n  heights.push(h1);\n  return heights;\n}\n\nconst nextScratch = new Cartesian3();\nconst prevScratch = new Cartesian3();\n\nfunction computeRotationAngle(start, end, position, ellipsoid) {\n  const tangentPlane = new EllipsoidTangentPlane(position, ellipsoid);\n  const next = tangentPlane.projectPointOntoPlane(\n    Cartesian3.add(position, start, nextScratch),\n    nextScratch\n  );\n  const prev = tangentPlane.projectPointOntoPlane(\n    Cartesian3.add(position, end, prevScratch),\n    prevScratch\n  );\n  const angle = Cartesian2.angleBetween(next, prev);\n\n  return prev.x * next.y - prev.y * next.x >= 0.0 ? -angle : angle;\n}\n\nconst negativeX = new Cartesian3(-1, 0, 0);\nlet transform = new Matrix4();\nconst translation = new Matrix4();\nlet rotationZ = new Matrix3();\nconst scaleMatrix = Matrix3.IDENTITY.clone();\nconst westScratch = new Cartesian3();\nconst finalPosScratch = new Cartesian4();\nconst heightCartesian = new Cartesian3();\nfunction addPosition(\n  center,\n  left,\n  shape,\n  finalPositions,\n  ellipsoid,\n  height,\n  xScalar,\n  repeat\n) {\n  let west = westScratch;\n  let finalPosition = finalPosScratch;\n  transform = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, transform);\n\n  west = Matrix4.multiplyByPointAsVector(transform, negativeX, west);\n  west = Cartesian3.normalize(west, west);\n  const angle = computeRotationAngle(west, left, center, ellipsoid);\n  rotationZ = Matrix3.fromRotationZ(angle, rotationZ);\n\n  heightCartesian.z = height;\n  transform = Matrix4.multiplyTransformation(\n    transform,\n    Matrix4.fromRotationTranslation(rotationZ, heightCartesian, translation),\n    transform\n  );\n  const scale = scaleMatrix;\n  scale[0] = xScalar;\n\n  for (let j = 0; j < repeat; j++) {\n    for (let i = 0; i < shape.length; i += 3) {\n      finalPosition = Cartesian3.fromArray(shape, i, finalPosition);\n      finalPosition = Matrix3.multiplyByVector(\n        scale,\n        finalPosition,\n        finalPosition\n      );\n      finalPosition = Matrix4.multiplyByPoint(\n        transform,\n        finalPosition,\n        finalPosition\n      );\n      finalPositions.push(finalPosition.x, finalPosition.y, finalPosition.z);\n    }\n  }\n\n  return finalPositions;\n}\n\nconst centerScratch = new Cartesian3();\nfunction addPositions(\n  centers,\n  left,\n  shape,\n  finalPositions,\n  ellipsoid,\n  heights,\n  xScalar\n) {\n  for (let i = 0; i < centers.length; i += 3) {\n    const center = Cartesian3.fromArray(centers, i, centerScratch);\n    finalPositions = addPosition(\n      center,\n      left,\n      shape,\n      finalPositions,\n      ellipsoid,\n      heights[i / 3],\n      xScalar,\n      1\n    );\n  }\n  return finalPositions;\n}\n\nfunction convertShapeTo3DDuplicate(shape2D, boundingRectangle) {\n  //orientate 2D shape to XZ plane center at (0, 0, 0), duplicate points\n  const length = shape2D.length;\n  const shape = new Array(length * 6);\n  let index = 0;\n  const xOffset = boundingRectangle.x + boundingRectangle.width / 2;\n  const yOffset = boundingRectangle.y + boundingRectangle.height / 2;\n\n  let point = shape2D[0];\n  shape[index++] = point.x - xOffset;\n  shape[index++] = 0.0;\n  shape[index++] = point.y - yOffset;\n  for (let i = 1; i < length; i++) {\n    point = shape2D[i];\n    const x = point.x - xOffset;\n    const z = point.y - yOffset;\n    shape[index++] = x;\n    shape[index++] = 0.0;\n    shape[index++] = z;\n\n    shape[index++] = x;\n    shape[index++] = 0.0;\n    shape[index++] = z;\n  }\n  point = shape2D[0];\n  shape[index++] = point.x - xOffset;\n  shape[index++] = 0.0;\n  shape[index++] = point.y - yOffset;\n\n  return shape;\n}\n\nfunction convertShapeTo3D(shape2D, boundingRectangle) {\n  //orientate 2D shape to XZ plane center at (0, 0, 0)\n  const length = shape2D.length;\n  const shape = new Array(length * 3);\n  let index = 0;\n  const xOffset = boundingRectangle.x + boundingRectangle.width / 2;\n  const yOffset = boundingRectangle.y + boundingRectangle.height / 2;\n\n  for (let i = 0; i < length; i++) {\n    shape[index++] = shape2D[i].x - xOffset;\n    shape[index++] = 0;\n    shape[index++] = shape2D[i].y - yOffset;\n  }\n\n  return shape;\n}\n\nconst quaterion = new Quaternion();\nconst startPointScratch = new Cartesian3();\nconst rotMatrix = new Matrix3();\nfunction computeRoundCorner(\n  pivot,\n  startPoint,\n  endPoint,\n  cornerType,\n  leftIsOutside,\n  ellipsoid,\n  finalPositions,\n  shape,\n  height,\n  duplicatePoints\n) {\n  const angle = Cartesian3.angleBetween(\n    Cartesian3.subtract(startPoint, pivot, scratch1),\n    Cartesian3.subtract(endPoint, pivot, scratch2)\n  );\n  const granularity =\n    cornerType === CornerType.BEVELED\n      ? 0\n      : Math.ceil(angle / CesiumMath.toRadians(5));\n\n  let m;\n  if (leftIsOutside) {\n    m = Matrix3.fromQuaternion(\n      Quaternion.fromAxisAngle(\n        Cartesian3.negate(pivot, scratch1),\n        angle / (granularity + 1),\n        quaterion\n      ),\n      rotMatrix\n    );\n  } else {\n    m = Matrix3.fromQuaternion(\n      Quaternion.fromAxisAngle(pivot, angle / (granularity + 1), quaterion),\n      rotMatrix\n    );\n  }\n\n  let left;\n  let surfacePoint;\n  startPoint = Cartesian3.clone(startPoint, startPointScratch);\n  if (granularity > 0) {\n    const repeat = duplicatePoints ? 2 : 1;\n    for (let i = 0; i < granularity; i++) {\n      startPoint = Matrix3.multiplyByVector(m, startPoint, startPoint);\n      left = Cartesian3.subtract(startPoint, pivot, scratch1);\n      left = Cartesian3.normalize(left, left);\n      if (!leftIsOutside) {\n        left = Cartesian3.negate(left, left);\n      }\n      surfacePoint = ellipsoid.scaleToGeodeticSurface(startPoint, scratch2);\n      finalPositions = addPosition(\n        surfacePoint,\n        left,\n        shape,\n        finalPositions,\n        ellipsoid,\n        height,\n        1,\n        repeat\n      );\n    }\n  } else {\n    left = Cartesian3.subtract(startPoint, pivot, scratch1);\n    left = Cartesian3.normalize(left, left);\n    if (!leftIsOutside) {\n      left = Cartesian3.negate(left, left);\n    }\n    surfacePoint = ellipsoid.scaleToGeodeticSurface(startPoint, scratch2);\n    finalPositions = addPosition(\n      surfacePoint,\n      left,\n      shape,\n      finalPositions,\n      ellipsoid,\n      height,\n      1,\n      1\n    );\n\n    endPoint = Cartesian3.clone(endPoint, startPointScratch);\n    left = Cartesian3.subtract(endPoint, pivot, scratch1);\n    left = Cartesian3.normalize(left, left);\n    if (!leftIsOutside) {\n      left = Cartesian3.negate(left, left);\n    }\n    surfacePoint = ellipsoid.scaleToGeodeticSurface(endPoint, scratch2);\n    finalPositions = addPosition(\n      surfacePoint,\n      left,\n      shape,\n      finalPositions,\n      ellipsoid,\n      height,\n      1,\n      1\n    );\n  }\n\n  return finalPositions;\n}\n\nPolylineVolumeGeometryLibrary.removeDuplicatesFromShape = function (\n  shapePositions\n) {\n  const length = shapePositions.length;\n  const cleanedPositions = [];\n  for (let i0 = length - 1, i1 = 0; i1 < length; i0 = i1++) {\n    const v0 = shapePositions[i0];\n    const v1 = shapePositions[i1];\n\n    if (!Cartesian2.equals(v0, v1)) {\n      cleanedPositions.push(v1); // Shallow copy!\n    }\n  }\n\n  return cleanedPositions;\n};\n\nPolylineVolumeGeometryLibrary.angleIsGreaterThanPi = function (\n  forward,\n  backward,\n  position,\n  ellipsoid\n) {\n  const tangentPlane = new EllipsoidTangentPlane(position, ellipsoid);\n  const next = tangentPlane.projectPointOntoPlane(\n    Cartesian3.add(position, forward, nextScratch),\n    nextScratch\n  );\n  const prev = tangentPlane.projectPointOntoPlane(\n    Cartesian3.add(position, backward, prevScratch),\n    prevScratch\n  );\n\n  return prev.x * next.y - prev.y * next.x >= 0.0;\n};\n\nconst scratchForwardProjection = new Cartesian3();\nconst scratchBackwardProjection = new Cartesian3();\n\nPolylineVolumeGeometryLibrary.computePositions = function (\n  positions,\n  shape2D,\n  boundingRectangle,\n  geometry,\n  duplicatePoints\n) {\n  const ellipsoid = geometry._ellipsoid;\n  const heights = scaleToSurface(positions, ellipsoid);\n  const granularity = geometry._granularity;\n  const cornerType = geometry._cornerType;\n  const shapeForSides = duplicatePoints\n    ? convertShapeTo3DDuplicate(shape2D, boundingRectangle)\n    : convertShapeTo3D(shape2D, boundingRectangle);\n  const shapeForEnds = duplicatePoints\n    ? convertShapeTo3D(shape2D, boundingRectangle)\n    : undefined;\n  const heightOffset = boundingRectangle.height / 2;\n  const width = boundingRectangle.width / 2;\n  let length = positions.length;\n  let finalPositions = [];\n  let ends = duplicatePoints ? [] : undefined;\n\n  let forward = scratchCartesian1;\n  let backward = scratchCartesian2;\n  let cornerDirection = scratchCartesian3;\n  let surfaceNormal = scratchCartesian4;\n  let pivot = scratchCartesian5;\n  let start = scratchCartesian6;\n  let end = scratchCartesian7;\n  let left = scratchCartesian8;\n  let previousPosition = scratchCartesian9;\n\n  let position = positions[0];\n  let nextPosition = positions[1];\n  surfaceNormal = ellipsoid.geodeticSurfaceNormal(position, surfaceNormal);\n  forward = Cartesian3.subtract(nextPosition, position, forward);\n  forward = Cartesian3.normalize(forward, forward);\n  left = Cartesian3.cross(surfaceNormal, forward, left);\n  left = Cartesian3.normalize(left, left);\n  let h0 = heights[0];\n  let h1 = heights[1];\n  if (duplicatePoints) {\n    ends = addPosition(\n      position,\n      left,\n      shapeForEnds,\n      ends,\n      ellipsoid,\n      h0 + heightOffset,\n      1,\n      1\n    );\n  }\n  previousPosition = Cartesian3.clone(position, previousPosition);\n  position = nextPosition;\n  backward = Cartesian3.negate(forward, backward);\n  let subdividedHeights;\n  let subdividedPositions;\n  for (let i = 1; i < length - 1; i++) {\n    const repeat = duplicatePoints ? 2 : 1;\n    nextPosition = positions[i + 1];\n    if (position.equals(nextPosition)) {\n      oneTimeWarning(\n        \"Positions are too close and are considered equivalent with rounding error.\"\n      );\n      continue;\n    }\n    forward = Cartesian3.subtract(nextPosition, position, forward);\n    forward = Cartesian3.normalize(forward, forward);\n    cornerDirection = Cartesian3.add(forward, backward, cornerDirection);\n    cornerDirection = Cartesian3.normalize(cornerDirection, cornerDirection);\n    surfaceNormal = ellipsoid.geodeticSurfaceNormal(position, surfaceNormal);\n\n    const forwardProjection = Cartesian3.multiplyByScalar(\n      surfaceNormal,\n      Cartesian3.dot(forward, surfaceNormal),\n      scratchForwardProjection\n    );\n    Cartesian3.subtract(forward, forwardProjection, forwardProjection);\n    Cartesian3.normalize(forwardProjection, forwardProjection);\n\n    const backwardProjection = Cartesian3.multiplyByScalar(\n      surfaceNormal,\n      Cartesian3.dot(backward, surfaceNormal),\n      scratchBackwardProjection\n    );\n    Cartesian3.subtract(backward, backwardProjection, backwardProjection);\n    Cartesian3.normalize(backwardProjection, backwardProjection);\n\n    const doCorner = !CesiumMath.equalsEpsilon(\n      Math.abs(Cartesian3.dot(forwardProjection, backwardProjection)),\n      1.0,\n      CesiumMath.EPSILON7\n    );\n\n    if (doCorner) {\n      cornerDirection = Cartesian3.cross(\n        cornerDirection,\n        surfaceNormal,\n        cornerDirection\n      );\n      cornerDirection = Cartesian3.cross(\n        surfaceNormal,\n        cornerDirection,\n        cornerDirection\n      );\n      cornerDirection = Cartesian3.normalize(cornerDirection, cornerDirection);\n      const scalar =\n        1 /\n        Math.max(\n          0.25,\n          Cartesian3.magnitude(\n            Cartesian3.cross(cornerDirection, backward, scratch1)\n          )\n        );\n      const leftIsOutside = PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(\n        forward,\n        backward,\n        position,\n        ellipsoid\n      );\n      if (leftIsOutside) {\n        pivot = Cartesian3.add(\n          position,\n          Cartesian3.multiplyByScalar(\n            cornerDirection,\n            scalar * width,\n            cornerDirection\n          ),\n          pivot\n        );\n        start = Cartesian3.add(\n          pivot,\n          Cartesian3.multiplyByScalar(left, width, start),\n          start\n        );\n        scratch2Array[0] = Cartesian3.clone(previousPosition, scratch2Array[0]);\n        scratch2Array[1] = Cartesian3.clone(start, scratch2Array[1]);\n        subdividedHeights = subdivideHeights(\n          scratch2Array,\n          h0 + heightOffset,\n          h1 + heightOffset,\n          granularity\n        );\n        subdividedPositions = PolylinePipeline.generateArc({\n          positions: scratch2Array,\n          granularity: granularity,\n          ellipsoid: ellipsoid,\n        });\n        finalPositions = addPositions(\n          subdividedPositions,\n          left,\n          shapeForSides,\n          finalPositions,\n          ellipsoid,\n          subdividedHeights,\n          1\n        );\n        left = Cartesian3.cross(surfaceNormal, forward, left);\n        left = Cartesian3.normalize(left, left);\n        end = Cartesian3.add(\n          pivot,\n          Cartesian3.multiplyByScalar(left, width, end),\n          end\n        );\n        if (\n          cornerType === CornerType.ROUNDED ||\n          cornerType === CornerType.BEVELED\n        ) {\n          computeRoundCorner(\n            pivot,\n            start,\n            end,\n            cornerType,\n            leftIsOutside,\n            ellipsoid,\n            finalPositions,\n            shapeForSides,\n            h1 + heightOffset,\n            duplicatePoints\n          );\n        } else {\n          cornerDirection = Cartesian3.negate(cornerDirection, cornerDirection);\n          finalPositions = addPosition(\n            position,\n            cornerDirection,\n            shapeForSides,\n            finalPositions,\n            ellipsoid,\n            h1 + heightOffset,\n            scalar,\n            repeat\n          );\n        }\n        previousPosition = Cartesian3.clone(end, previousPosition);\n      } else {\n        pivot = Cartesian3.add(\n          position,\n          Cartesian3.multiplyByScalar(\n            cornerDirection,\n            scalar * width,\n            cornerDirection\n          ),\n          pivot\n        );\n        start = Cartesian3.add(\n          pivot,\n          Cartesian3.multiplyByScalar(left, -width, start),\n          start\n        );\n        scratch2Array[0] = Cartesian3.clone(previousPosition, scratch2Array[0]);\n        scratch2Array[1] = Cartesian3.clone(start, scratch2Array[1]);\n        subdividedHeights = subdivideHeights(\n          scratch2Array,\n          h0 + heightOffset,\n          h1 + heightOffset,\n          granularity\n        );\n        subdividedPositions = PolylinePipeline.generateArc({\n          positions: scratch2Array,\n          granularity: granularity,\n          ellipsoid: ellipsoid,\n        });\n        finalPositions = addPositions(\n          subdividedPositions,\n          left,\n          shapeForSides,\n          finalPositions,\n          ellipsoid,\n          subdividedHeights,\n          1\n        );\n        left = Cartesian3.cross(surfaceNormal, forward, left);\n        left = Cartesian3.normalize(left, left);\n        end = Cartesian3.add(\n          pivot,\n          Cartesian3.multiplyByScalar(left, -width, end),\n          end\n        );\n        if (\n          cornerType === CornerType.ROUNDED ||\n          cornerType === CornerType.BEVELED\n        ) {\n          computeRoundCorner(\n            pivot,\n            start,\n            end,\n            cornerType,\n            leftIsOutside,\n            ellipsoid,\n            finalPositions,\n            shapeForSides,\n            h1 + heightOffset,\n            duplicatePoints\n          );\n        } else {\n          finalPositions = addPosition(\n            position,\n            cornerDirection,\n            shapeForSides,\n            finalPositions,\n            ellipsoid,\n            h1 + heightOffset,\n            scalar,\n            repeat\n          );\n        }\n        previousPosition = Cartesian3.clone(end, previousPosition);\n      }\n      backward = Cartesian3.negate(forward, backward);\n    } else {\n      finalPositions = addPosition(\n        previousPosition,\n        left,\n        shapeForSides,\n        finalPositions,\n        ellipsoid,\n        h0 + heightOffset,\n        1,\n        1\n      );\n      previousPosition = position;\n    }\n    h0 = h1;\n    h1 = heights[i + 1];\n    position = nextPosition;\n  }\n\n  scratch2Array[0] = Cartesian3.clone(previousPosition, scratch2Array[0]);\n  scratch2Array[1] = Cartesian3.clone(position, scratch2Array[1]);\n  subdividedHeights = subdivideHeights(\n    scratch2Array,\n    h0 + heightOffset,\n    h1 + heightOffset,\n    granularity\n  );\n  subdividedPositions = PolylinePipeline.generateArc({\n    positions: scratch2Array,\n    granularity: granularity,\n    ellipsoid: ellipsoid,\n  });\n  finalPositions = addPositions(\n    subdividedPositions,\n    left,\n    shapeForSides,\n    finalPositions,\n    ellipsoid,\n    subdividedHeights,\n    1\n  );\n  if (duplicatePoints) {\n    ends = addPosition(\n      position,\n      left,\n      shapeForEnds,\n      ends,\n      ellipsoid,\n      h1 + heightOffset,\n      1,\n      1\n    );\n  }\n\n  length = finalPositions.length;\n  const posLength = duplicatePoints ? length + ends.length : length;\n  const combinedPositions = new Float64Array(posLength);\n  combinedPositions.set(finalPositions);\n  if (duplicatePoints) {\n    combinedPositions.set(ends, length);\n  }\n\n  return combinedPositions;\n};\nexport default PolylineVolumeGeometryLibrary;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport CornerType from \"./CornerType.js\";\nimport defined from \"./defined.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport PolylinePipeline from \"./PolylinePipeline.js\";\nimport PolylineVolumeGeometryLibrary from \"./PolylineVolumeGeometryLibrary.js\";\nimport Quaternion from \"./Quaternion.js\";\n\n/**\n * @private\n */\nconst CorridorGeometryLibrary = {};\n\nconst scratch1 = new Cartesian3();\nconst scratch2 = new Cartesian3();\nconst scratch3 = new Cartesian3();\nconst scratch4 = new Cartesian3();\n\nconst scaleArray2 = [new Cartesian3(), new Cartesian3()];\n\nconst cartesian1 = new Cartesian3();\nconst cartesian2 = new Cartesian3();\nconst cartesian3 = new Cartesian3();\nconst cartesian4 = new Cartesian3();\nconst cartesian5 = new Cartesian3();\nconst cartesian6 = new Cartesian3();\nconst cartesian7 = new Cartesian3();\nconst cartesian8 = new Cartesian3();\nconst cartesian9 = new Cartesian3();\nconst cartesian10 = new Cartesian3();\n\nconst quaterion = new Quaternion();\nconst rotMatrix = new Matrix3();\nfunction computeRoundCorner(\n  cornerPoint,\n  startPoint,\n  endPoint,\n  cornerType,\n  leftIsOutside\n) {\n  const angle = Cartesian3.angleBetween(\n    Cartesian3.subtract(startPoint, cornerPoint, scratch1),\n    Cartesian3.subtract(endPoint, cornerPoint, scratch2)\n  );\n  const granularity =\n    cornerType === CornerType.BEVELED\n      ? 1\n      : Math.ceil(angle / CesiumMath.toRadians(5)) + 1;\n\n  const size = granularity * 3;\n  const array = new Array(size);\n\n  array[size - 3] = endPoint.x;\n  array[size - 2] = endPoint.y;\n  array[size - 1] = endPoint.z;\n\n  let m;\n  if (leftIsOutside) {\n    m = Matrix3.fromQuaternion(\n      Quaternion.fromAxisAngle(\n        Cartesian3.negate(cornerPoint, scratch1),\n        angle / granularity,\n        quaterion\n      ),\n      rotMatrix\n    );\n  } else {\n    m = Matrix3.fromQuaternion(\n      Quaternion.fromAxisAngle(cornerPoint, angle / granularity, quaterion),\n      rotMatrix\n    );\n  }\n\n  let index = 0;\n  startPoint = Cartesian3.clone(startPoint, scratch1);\n  for (let i = 0; i < granularity; i++) {\n    startPoint = Matrix3.multiplyByVector(m, startPoint, startPoint);\n    array[index++] = startPoint.x;\n    array[index++] = startPoint.y;\n    array[index++] = startPoint.z;\n  }\n\n  return array;\n}\n\nfunction addEndCaps(calculatedPositions) {\n  let cornerPoint = cartesian1;\n  let startPoint = cartesian2;\n  let endPoint = cartesian3;\n\n  let leftEdge = calculatedPositions[1];\n  startPoint = Cartesian3.fromArray(\n    calculatedPositions[1],\n    leftEdge.length - 3,\n    startPoint\n  );\n  endPoint = Cartesian3.fromArray(calculatedPositions[0], 0, endPoint);\n  cornerPoint = Cartesian3.midpoint(startPoint, endPoint, cornerPoint);\n  const firstEndCap = computeRoundCorner(\n    cornerPoint,\n    startPoint,\n    endPoint,\n    CornerType.ROUNDED,\n    false\n  );\n\n  const length = calculatedPositions.length - 1;\n  const rightEdge = calculatedPositions[length - 1];\n  leftEdge = calculatedPositions[length];\n  startPoint = Cartesian3.fromArray(\n    rightEdge,\n    rightEdge.length - 3,\n    startPoint\n  );\n  endPoint = Cartesian3.fromArray(leftEdge, 0, endPoint);\n  cornerPoint = Cartesian3.midpoint(startPoint, endPoint, cornerPoint);\n  const lastEndCap = computeRoundCorner(\n    cornerPoint,\n    startPoint,\n    endPoint,\n    CornerType.ROUNDED,\n    false\n  );\n\n  return [firstEndCap, lastEndCap];\n}\n\nfunction computeMiteredCorner(\n  position,\n  leftCornerDirection,\n  lastPoint,\n  leftIsOutside\n) {\n  let cornerPoint = scratch1;\n  if (leftIsOutside) {\n    cornerPoint = Cartesian3.add(position, leftCornerDirection, cornerPoint);\n  } else {\n    leftCornerDirection = Cartesian3.negate(\n      leftCornerDirection,\n      leftCornerDirection\n    );\n    cornerPoint = Cartesian3.add(position, leftCornerDirection, cornerPoint);\n  }\n  return [\n    cornerPoint.x,\n    cornerPoint.y,\n    cornerPoint.z,\n    lastPoint.x,\n    lastPoint.y,\n    lastPoint.z,\n  ];\n}\n\nfunction addShiftedPositions(positions, left, scalar, calculatedPositions) {\n  const rightPositions = new Array(positions.length);\n  const leftPositions = new Array(positions.length);\n  const scaledLeft = Cartesian3.multiplyByScalar(left, scalar, scratch1);\n  const scaledRight = Cartesian3.negate(scaledLeft, scratch2);\n  let rightIndex = 0;\n  let leftIndex = positions.length - 1;\n\n  for (let i = 0; i < positions.length; i += 3) {\n    const pos = Cartesian3.fromArray(positions, i, scratch3);\n    const rightPos = Cartesian3.add(pos, scaledRight, scratch4);\n    rightPositions[rightIndex++] = rightPos.x;\n    rightPositions[rightIndex++] = rightPos.y;\n    rightPositions[rightIndex++] = rightPos.z;\n\n    const leftPos = Cartesian3.add(pos, scaledLeft, scratch4);\n    leftPositions[leftIndex--] = leftPos.z;\n    leftPositions[leftIndex--] = leftPos.y;\n    leftPositions[leftIndex--] = leftPos.x;\n  }\n  calculatedPositions.push(rightPositions, leftPositions);\n\n  return calculatedPositions;\n}\n\n/**\n * @private\n */\nCorridorGeometryLibrary.addAttribute = function (\n  attribute,\n  value,\n  front,\n  back\n) {\n  const x = value.x;\n  const y = value.y;\n  const z = value.z;\n  if (defined(front)) {\n    attribute[front] = x;\n    attribute[front + 1] = y;\n    attribute[front + 2] = z;\n  }\n  if (defined(back)) {\n    attribute[back] = z;\n    attribute[back - 1] = y;\n    attribute[back - 2] = x;\n  }\n};\n\nconst scratchForwardProjection = new Cartesian3();\nconst scratchBackwardProjection = new Cartesian3();\n\n/**\n * @private\n */\nCorridorGeometryLibrary.computePositions = function (params) {\n  const granularity = params.granularity;\n  const positions = params.positions;\n  const ellipsoid = params.ellipsoid;\n  const width = params.width / 2;\n  const cornerType = params.cornerType;\n  const saveAttributes = params.saveAttributes;\n  let normal = cartesian1;\n  let forward = cartesian2;\n  let backward = cartesian3;\n  let left = cartesian4;\n  let cornerDirection = cartesian5;\n  let startPoint = cartesian6;\n  let previousPos = cartesian7;\n  let rightPos = cartesian8;\n  let leftPos = cartesian9;\n  let center = cartesian10;\n  let calculatedPositions = [];\n  const calculatedLefts = saveAttributes ? [] : undefined;\n  const calculatedNormals = saveAttributes ? [] : undefined;\n  let position = positions[0]; //add first point\n  let nextPosition = positions[1];\n\n  forward = Cartesian3.normalize(\n    Cartesian3.subtract(nextPosition, position, forward),\n    forward\n  );\n  normal = ellipsoid.geodeticSurfaceNormal(position, normal);\n  left = Cartesian3.normalize(Cartesian3.cross(normal, forward, left), left);\n  if (saveAttributes) {\n    calculatedLefts.push(left.x, left.y, left.z);\n    calculatedNormals.push(normal.x, normal.y, normal.z);\n  }\n  previousPos = Cartesian3.clone(position, previousPos);\n  position = nextPosition;\n  backward = Cartesian3.negate(forward, backward);\n\n  let subdividedPositions;\n  const corners = [];\n  let i;\n  const length = positions.length;\n  for (i = 1; i < length - 1; i++) {\n    // add middle points and corners\n    normal = ellipsoid.geodeticSurfaceNormal(position, normal);\n    nextPosition = positions[i + 1];\n    forward = Cartesian3.normalize(\n      Cartesian3.subtract(nextPosition, position, forward),\n      forward\n    );\n    cornerDirection = Cartesian3.normalize(\n      Cartesian3.add(forward, backward, cornerDirection),\n      cornerDirection\n    );\n\n    const forwardProjection = Cartesian3.multiplyByScalar(\n      normal,\n      Cartesian3.dot(forward, normal),\n      scratchForwardProjection\n    );\n    Cartesian3.subtract(forward, forwardProjection, forwardProjection);\n    Cartesian3.normalize(forwardProjection, forwardProjection);\n\n    const backwardProjection = Cartesian3.multiplyByScalar(\n      normal,\n      Cartesian3.dot(backward, normal),\n      scratchBackwardProjection\n    );\n    Cartesian3.subtract(backward, backwardProjection, backwardProjection);\n    Cartesian3.normalize(backwardProjection, backwardProjection);\n\n    const doCorner = !CesiumMath.equalsEpsilon(\n      Math.abs(Cartesian3.dot(forwardProjection, backwardProjection)),\n      1.0,\n      CesiumMath.EPSILON7\n    );\n\n    if (doCorner) {\n      cornerDirection = Cartesian3.cross(\n        cornerDirection,\n        normal,\n        cornerDirection\n      );\n      cornerDirection = Cartesian3.cross(\n        normal,\n        cornerDirection,\n        cornerDirection\n      );\n      cornerDirection = Cartesian3.normalize(cornerDirection, cornerDirection);\n      const scalar =\n        width /\n        Math.max(\n          0.25,\n          Cartesian3.magnitude(\n            Cartesian3.cross(cornerDirection, backward, scratch1)\n          )\n        );\n      const leftIsOutside = PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(\n        forward,\n        backward,\n        position,\n        ellipsoid\n      );\n      cornerDirection = Cartesian3.multiplyByScalar(\n        cornerDirection,\n        scalar,\n        cornerDirection\n      );\n      if (leftIsOutside) {\n        rightPos = Cartesian3.add(position, cornerDirection, rightPos);\n        center = Cartesian3.add(\n          rightPos,\n          Cartesian3.multiplyByScalar(left, width, center),\n          center\n        );\n        leftPos = Cartesian3.add(\n          rightPos,\n          Cartesian3.multiplyByScalar(left, width * 2, leftPos),\n          leftPos\n        );\n        scaleArray2[0] = Cartesian3.clone(previousPos, scaleArray2[0]);\n        scaleArray2[1] = Cartesian3.clone(center, scaleArray2[1]);\n        subdividedPositions = PolylinePipeline.generateArc({\n          positions: scaleArray2,\n          granularity: granularity,\n          ellipsoid: ellipsoid,\n        });\n        calculatedPositions = addShiftedPositions(\n          subdividedPositions,\n          left,\n          width,\n          calculatedPositions\n        );\n        if (saveAttributes) {\n          calculatedLefts.push(left.x, left.y, left.z);\n          calculatedNormals.push(normal.x, normal.y, normal.z);\n        }\n        startPoint = Cartesian3.clone(leftPos, startPoint);\n        left = Cartesian3.normalize(\n          Cartesian3.cross(normal, forward, left),\n          left\n        );\n        leftPos = Cartesian3.add(\n          rightPos,\n          Cartesian3.multiplyByScalar(left, width * 2, leftPos),\n          leftPos\n        );\n        previousPos = Cartesian3.add(\n          rightPos,\n          Cartesian3.multiplyByScalar(left, width, previousPos),\n          previousPos\n        );\n        if (\n          cornerType === CornerType.ROUNDED ||\n          cornerType === CornerType.BEVELED\n        ) {\n          corners.push({\n            leftPositions: computeRoundCorner(\n              rightPos,\n              startPoint,\n              leftPos,\n              cornerType,\n              leftIsOutside\n            ),\n          });\n        } else {\n          corners.push({\n            leftPositions: computeMiteredCorner(\n              position,\n              Cartesian3.negate(cornerDirection, cornerDirection),\n              leftPos,\n              leftIsOutside\n            ),\n          });\n        }\n      } else {\n        leftPos = Cartesian3.add(position, cornerDirection, leftPos);\n        center = Cartesian3.add(\n          leftPos,\n          Cartesian3.negate(\n            Cartesian3.multiplyByScalar(left, width, center),\n            center\n          ),\n          center\n        );\n        rightPos = Cartesian3.add(\n          leftPos,\n          Cartesian3.negate(\n            Cartesian3.multiplyByScalar(left, width * 2, rightPos),\n            rightPos\n          ),\n          rightPos\n        );\n        scaleArray2[0] = Cartesian3.clone(previousPos, scaleArray2[0]);\n        scaleArray2[1] = Cartesian3.clone(center, scaleArray2[1]);\n        subdividedPositions = PolylinePipeline.generateArc({\n          positions: scaleArray2,\n          granularity: granularity,\n          ellipsoid: ellipsoid,\n        });\n        calculatedPositions = addShiftedPositions(\n          subdividedPositions,\n          left,\n          width,\n          calculatedPositions\n        );\n        if (saveAttributes) {\n          calculatedLefts.push(left.x, left.y, left.z);\n          calculatedNormals.push(normal.x, normal.y, normal.z);\n        }\n        startPoint = Cartesian3.clone(rightPos, startPoint);\n        left = Cartesian3.normalize(\n          Cartesian3.cross(normal, forward, left),\n          left\n        );\n        rightPos = Cartesian3.add(\n          leftPos,\n          Cartesian3.negate(\n            Cartesian3.multiplyByScalar(left, width * 2, rightPos),\n            rightPos\n          ),\n          rightPos\n        );\n        previousPos = Cartesian3.add(\n          leftPos,\n          Cartesian3.negate(\n            Cartesian3.multiplyByScalar(left, width, previousPos),\n            previousPos\n          ),\n          previousPos\n        );\n        if (\n          cornerType === CornerType.ROUNDED ||\n          cornerType === CornerType.BEVELED\n        ) {\n          corners.push({\n            rightPositions: computeRoundCorner(\n              leftPos,\n              startPoint,\n              rightPos,\n              cornerType,\n              leftIsOutside\n            ),\n          });\n        } else {\n          corners.push({\n            rightPositions: computeMiteredCorner(\n              position,\n              cornerDirection,\n              rightPos,\n              leftIsOutside\n            ),\n          });\n        }\n      }\n      backward = Cartesian3.negate(forward, backward);\n    }\n    position = nextPosition;\n  }\n\n  normal = ellipsoid.geodeticSurfaceNormal(position, normal);\n  scaleArray2[0] = Cartesian3.clone(previousPos, scaleArray2[0]);\n  scaleArray2[1] = Cartesian3.clone(position, scaleArray2[1]);\n  subdividedPositions = PolylinePipeline.generateArc({\n    positions: scaleArray2,\n    granularity: granularity,\n    ellipsoid: ellipsoid,\n  });\n  calculatedPositions = addShiftedPositions(\n    subdividedPositions,\n    left,\n    width,\n    calculatedPositions\n  );\n  if (saveAttributes) {\n    calculatedLefts.push(left.x, left.y, left.z);\n    calculatedNormals.push(normal.x, normal.y, normal.z);\n  }\n\n  let endPositions;\n  if (cornerType === CornerType.ROUNDED) {\n    endPositions = addEndCaps(calculatedPositions);\n  }\n\n  return {\n    positions: calculatedPositions,\n    corners: corners,\n    lefts: calculatedLefts,\n    normals: calculatedNormals,\n    endPositions: endPositions,\n  };\n};\nexport default CorridorGeometryLibrary;\n", "import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CornerType from \"./CornerType.js\";\nimport CorridorGeometryLibrary from \"./CorridorGeometryLibrary.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst cartesian1 = new Cartesian3();\nconst cartesian2 = new Cartesian3();\nconst cartesian3 = new Cartesian3();\nconst cartesian4 = new Cartesian3();\nconst cartesian5 = new Cartesian3();\nconst cartesian6 = new Cartesian3();\n\nconst scratch1 = new Cartesian3();\nconst scratch2 = new Cartesian3();\n\nfunction scaleToSurface(positions, ellipsoid) {\n  for (let i = 0; i < positions.length; i++) {\n    positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);\n  }\n  return positions;\n}\n\nfunction addNormals(attr, normal, left, front, back, vertexFormat) {\n  const normals = attr.normals;\n  const tangents = attr.tangents;\n  const bitangents = attr.bitangents;\n  const forward = Cartesian3.normalize(\n    Cartesian3.cross(left, normal, scratch1),\n    scratch1\n  );\n  if (vertexFormat.normal) {\n    CorridorGeometryLibrary.addAttribute(normals, normal, front, back);\n  }\n  if (vertexFormat.tangent) {\n    CorridorGeometryLibrary.addAttribute(tangents, forward, front, back);\n  }\n  if (vertexFormat.bitangent) {\n    CorridorGeometryLibrary.addAttribute(bitangents, left, front, back);\n  }\n}\n\nfunction combine(computedPositions, vertexFormat, ellipsoid) {\n  const positions = computedPositions.positions;\n  const corners = computedPositions.corners;\n  const endPositions = computedPositions.endPositions;\n  const computedLefts = computedPositions.lefts;\n  const computedNormals = computedPositions.normals;\n  const attributes = new GeometryAttributes();\n  let corner;\n  let leftCount = 0;\n  let rightCount = 0;\n  let i;\n  let indicesLength = 0;\n  let length;\n  for (i = 0; i < positions.length; i += 2) {\n    length = positions[i].length - 3;\n    leftCount += length; //subtracting 3 to account for duplicate points at corners\n    indicesLength += length * 2;\n    rightCount += positions[i + 1].length - 3;\n  }\n  leftCount += 3; //add back count for end positions\n  rightCount += 3;\n  for (i = 0; i < corners.length; i++) {\n    corner = corners[i];\n    const leftSide = corners[i].leftPositions;\n    if (defined(leftSide)) {\n      length = leftSide.length;\n      leftCount += length;\n      indicesLength += length;\n    } else {\n      length = corners[i].rightPositions.length;\n      rightCount += length;\n      indicesLength += length;\n    }\n  }\n\n  const addEndPositions = defined(endPositions);\n  let endPositionLength;\n  if (addEndPositions) {\n    endPositionLength = endPositions[0].length - 3;\n    leftCount += endPositionLength;\n    rightCount += endPositionLength;\n    endPositionLength /= 3;\n    indicesLength += endPositionLength * 6;\n  }\n  const size = leftCount + rightCount;\n  const finalPositions = new Float64Array(size);\n  const normals = vertexFormat.normal ? new Float32Array(size) : undefined;\n  const tangents = vertexFormat.tangent ? new Float32Array(size) : undefined;\n  const bitangents = vertexFormat.bitangent\n    ? new Float32Array(size)\n    : undefined;\n  const attr = {\n    normals: normals,\n    tangents: tangents,\n    bitangents: bitangents,\n  };\n  let front = 0;\n  let back = size - 1;\n  let UL, LL, UR, LR;\n  let normal = cartesian1;\n  let left = cartesian2;\n  let rightPos, leftPos;\n  const halfLength = endPositionLength / 2;\n\n  const indices = IndexDatatype.createTypedArray(size / 3, indicesLength);\n  let index = 0;\n  if (addEndPositions) {\n    // add rounded end\n    leftPos = cartesian3;\n    rightPos = cartesian4;\n    const firstEndPositions = endPositions[0];\n    normal = Cartesian3.fromArray(computedNormals, 0, normal);\n    left = Cartesian3.fromArray(computedLefts, 0, left);\n    for (i = 0; i < halfLength; i++) {\n      leftPos = Cartesian3.fromArray(\n        firstEndPositions,\n        (halfLength - 1 - i) * 3,\n        leftPos\n      );\n      rightPos = Cartesian3.fromArray(\n        firstEndPositions,\n        (halfLength + i) * 3,\n        rightPos\n      );\n      CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);\n      CorridorGeometryLibrary.addAttribute(\n        finalPositions,\n        leftPos,\n        undefined,\n        back\n      );\n      addNormals(attr, normal, left, front, back, vertexFormat);\n\n      LL = front / 3;\n      LR = LL + 1;\n      UL = (back - 2) / 3;\n      UR = UL - 1;\n      indices[index++] = UL;\n      indices[index++] = LL;\n      indices[index++] = UR;\n      indices[index++] = UR;\n      indices[index++] = LL;\n      indices[index++] = LR;\n\n      front += 3;\n      back -= 3;\n    }\n  }\n\n  let posIndex = 0;\n  let compIndex = 0;\n  let rightEdge = positions[posIndex++]; //add first two edges\n  let leftEdge = positions[posIndex++];\n  finalPositions.set(rightEdge, front);\n  finalPositions.set(leftEdge, back - leftEdge.length + 1);\n\n  left = Cartesian3.fromArray(computedLefts, compIndex, left);\n  let rightNormal;\n  let leftNormal;\n  length = leftEdge.length - 3;\n  for (i = 0; i < length; i += 3) {\n    rightNormal = ellipsoid.geodeticSurfaceNormal(\n      Cartesian3.fromArray(rightEdge, i, scratch1),\n      scratch1\n    );\n    leftNormal = ellipsoid.geodeticSurfaceNormal(\n      Cartesian3.fromArray(leftEdge, length - i, scratch2),\n      scratch2\n    );\n    normal = Cartesian3.normalize(\n      Cartesian3.add(rightNormal, leftNormal, normal),\n      normal\n    );\n    addNormals(attr, normal, left, front, back, vertexFormat);\n\n    LL = front / 3;\n    LR = LL + 1;\n    UL = (back - 2) / 3;\n    UR = UL - 1;\n    indices[index++] = UL;\n    indices[index++] = LL;\n    indices[index++] = UR;\n    indices[index++] = UR;\n    indices[index++] = LL;\n    indices[index++] = LR;\n\n    front += 3;\n    back -= 3;\n  }\n\n  rightNormal = ellipsoid.geodeticSurfaceNormal(\n    Cartesian3.fromArray(rightEdge, length, scratch1),\n    scratch1\n  );\n  leftNormal = ellipsoid.geodeticSurfaceNormal(\n    Cartesian3.fromArray(leftEdge, length, scratch2),\n    scratch2\n  );\n  normal = Cartesian3.normalize(\n    Cartesian3.add(rightNormal, leftNormal, normal),\n    normal\n  );\n  compIndex += 3;\n  for (i = 0; i < corners.length; i++) {\n    let j;\n    corner = corners[i];\n    const l = corner.leftPositions;\n    const r = corner.rightPositions;\n    let pivot;\n    let start;\n    let outsidePoint = cartesian6;\n    let previousPoint = cartesian3;\n    let nextPoint = cartesian4;\n    normal = Cartesian3.fromArray(computedNormals, compIndex, normal);\n    if (defined(l)) {\n      addNormals(attr, normal, left, undefined, back, vertexFormat);\n      back -= 3;\n      pivot = LR;\n      start = UR;\n      for (j = 0; j < l.length / 3; j++) {\n        outsidePoint = Cartesian3.fromArray(l, j * 3, outsidePoint);\n        indices[index++] = pivot;\n        indices[index++] = start - j - 1;\n        indices[index++] = start - j;\n        CorridorGeometryLibrary.addAttribute(\n          finalPositions,\n          outsidePoint,\n          undefined,\n          back\n        );\n        previousPoint = Cartesian3.fromArray(\n          finalPositions,\n          (start - j - 1) * 3,\n          previousPoint\n        );\n        nextPoint = Cartesian3.fromArray(finalPositions, pivot * 3, nextPoint);\n        left = Cartesian3.normalize(\n          Cartesian3.subtract(previousPoint, nextPoint, left),\n          left\n        );\n        addNormals(attr, normal, left, undefined, back, vertexFormat);\n        back -= 3;\n      }\n      outsidePoint = Cartesian3.fromArray(\n        finalPositions,\n        pivot * 3,\n        outsidePoint\n      );\n      previousPoint = Cartesian3.subtract(\n        Cartesian3.fromArray(finalPositions, start * 3, previousPoint),\n        outsidePoint,\n        previousPoint\n      );\n      nextPoint = Cartesian3.subtract(\n        Cartesian3.fromArray(finalPositions, (start - j) * 3, nextPoint),\n        outsidePoint,\n        nextPoint\n      );\n      left = Cartesian3.normalize(\n        Cartesian3.add(previousPoint, nextPoint, left),\n        left\n      );\n      addNormals(attr, normal, left, front, undefined, vertexFormat);\n      front += 3;\n    } else {\n      addNormals(attr, normal, left, front, undefined, vertexFormat);\n      front += 3;\n      pivot = UR;\n      start = LR;\n      for (j = 0; j < r.length / 3; j++) {\n        outsidePoint = Cartesian3.fromArray(r, j * 3, outsidePoint);\n        indices[index++] = pivot;\n        indices[index++] = start + j;\n        indices[index++] = start + j + 1;\n        CorridorGeometryLibrary.addAttribute(\n          finalPositions,\n          outsidePoint,\n          front\n        );\n        previousPoint = Cartesian3.fromArray(\n          finalPositions,\n          pivot * 3,\n          previousPoint\n        );\n        nextPoint = Cartesian3.fromArray(\n          finalPositions,\n          (start + j) * 3,\n          nextPoint\n        );\n        left = Cartesian3.normalize(\n          Cartesian3.subtract(previousPoint, nextPoint, left),\n          left\n        );\n        addNormals(attr, normal, left, front, undefined, vertexFormat);\n        front += 3;\n      }\n      outsidePoint = Cartesian3.fromArray(\n        finalPositions,\n        pivot * 3,\n        outsidePoint\n      );\n      previousPoint = Cartesian3.subtract(\n        Cartesian3.fromArray(finalPositions, (start + j) * 3, previousPoint),\n        outsidePoint,\n        previousPoint\n      );\n      nextPoint = Cartesian3.subtract(\n        Cartesian3.fromArray(finalPositions, start * 3, nextPoint),\n        outsidePoint,\n        nextPoint\n      );\n      left = Cartesian3.normalize(\n        Cartesian3.negate(Cartesian3.add(nextPoint, previousPoint, left), left),\n        left\n      );\n      addNormals(attr, normal, left, undefined, back, vertexFormat);\n      back -= 3;\n    }\n    rightEdge = positions[posIndex++];\n    leftEdge = positions[posIndex++];\n    rightEdge.splice(0, 3); //remove duplicate points added by corner\n    leftEdge.splice(leftEdge.length - 3, 3);\n    finalPositions.set(rightEdge, front);\n    finalPositions.set(leftEdge, back - leftEdge.length + 1);\n    length = leftEdge.length - 3;\n\n    compIndex += 3;\n    left = Cartesian3.fromArray(computedLefts, compIndex, left);\n    for (j = 0; j < leftEdge.length; j += 3) {\n      rightNormal = ellipsoid.geodeticSurfaceNormal(\n        Cartesian3.fromArray(rightEdge, j, scratch1),\n        scratch1\n      );\n      leftNormal = ellipsoid.geodeticSurfaceNormal(\n        Cartesian3.fromArray(leftEdge, length - j, scratch2),\n        scratch2\n      );\n      normal = Cartesian3.normalize(\n        Cartesian3.add(rightNormal, leftNormal, normal),\n        normal\n      );\n      addNormals(attr, normal, left, front, back, vertexFormat);\n\n      LR = front / 3;\n      LL = LR - 1;\n      UR = (back - 2) / 3;\n      UL = UR + 1;\n      indices[index++] = UL;\n      indices[index++] = LL;\n      indices[index++] = UR;\n      indices[index++] = UR;\n      indices[index++] = LL;\n      indices[index++] = LR;\n\n      front += 3;\n      back -= 3;\n    }\n    front -= 3;\n    back += 3;\n  }\n  normal = Cartesian3.fromArray(\n    computedNormals,\n    computedNormals.length - 3,\n    normal\n  );\n  addNormals(attr, normal, left, front, back, vertexFormat);\n\n  if (addEndPositions) {\n    // add rounded end\n    front += 3;\n    back -= 3;\n    leftPos = cartesian3;\n    rightPos = cartesian4;\n    const lastEndPositions = endPositions[1];\n    for (i = 0; i < halfLength; i++) {\n      leftPos = Cartesian3.fromArray(\n        lastEndPositions,\n        (endPositionLength - i - 1) * 3,\n        leftPos\n      );\n      rightPos = Cartesian3.fromArray(lastEndPositions, i * 3, rightPos);\n      CorridorGeometryLibrary.addAttribute(\n        finalPositions,\n        leftPos,\n        undefined,\n        back\n      );\n      CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);\n      addNormals(attr, normal, left, front, back, vertexFormat);\n\n      LR = front / 3;\n      LL = LR - 1;\n      UR = (back - 2) / 3;\n      UL = UR + 1;\n      indices[index++] = UL;\n      indices[index++] = LL;\n      indices[index++] = UR;\n      indices[index++] = UR;\n      indices[index++] = LL;\n      indices[index++] = LR;\n\n      front += 3;\n      back -= 3;\n    }\n  }\n\n  attributes.position = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.DOUBLE,\n    componentsPerAttribute: 3,\n    values: finalPositions,\n  });\n\n  if (vertexFormat.st) {\n    const st = new Float32Array((size / 3) * 2);\n    let rightSt;\n    let leftSt;\n    let stIndex = 0;\n    if (addEndPositions) {\n      leftCount /= 3;\n      rightCount /= 3;\n      const theta = Math.PI / (endPositionLength + 1);\n      leftSt = 1 / (leftCount - endPositionLength + 1);\n      rightSt = 1 / (rightCount - endPositionLength + 1);\n      let a;\n      const halfEndPos = endPositionLength / 2;\n      for (i = halfEndPos + 1; i < endPositionLength + 1; i++) {\n        // lower left rounded end\n        a = CesiumMath.PI_OVER_TWO + theta * i;\n        st[stIndex++] = rightSt * (1 + Math.cos(a));\n        st[stIndex++] = 0.5 * (1 + Math.sin(a));\n      }\n      for (i = 1; i < rightCount - endPositionLength + 1; i++) {\n        // bottom edge\n        st[stIndex++] = i * rightSt;\n        st[stIndex++] = 0;\n      }\n      for (i = endPositionLength; i > halfEndPos; i--) {\n        // lower right rounded end\n        a = CesiumMath.PI_OVER_TWO - i * theta;\n        st[stIndex++] = 1 - rightSt * (1 + Math.cos(a));\n        st[stIndex++] = 0.5 * (1 + Math.sin(a));\n      }\n      for (i = halfEndPos; i > 0; i--) {\n        // upper right rounded end\n        a = CesiumMath.PI_OVER_TWO - theta * i;\n        st[stIndex++] = 1 - leftSt * (1 + Math.cos(a));\n        st[stIndex++] = 0.5 * (1 + Math.sin(a));\n      }\n      for (i = leftCount - endPositionLength; i > 0; i--) {\n        // top edge\n        st[stIndex++] = i * leftSt;\n        st[stIndex++] = 1;\n      }\n      for (i = 1; i < halfEndPos + 1; i++) {\n        // upper left rounded end\n        a = CesiumMath.PI_OVER_TWO + theta * i;\n        st[stIndex++] = leftSt * (1 + Math.cos(a));\n        st[stIndex++] = 0.5 * (1 + Math.sin(a));\n      }\n    } else {\n      leftCount /= 3;\n      rightCount /= 3;\n      leftSt = 1 / (leftCount - 1);\n      rightSt = 1 / (rightCount - 1);\n      for (i = 0; i < rightCount; i++) {\n        // bottom edge\n        st[stIndex++] = i * rightSt;\n        st[stIndex++] = 0;\n      }\n      for (i = leftCount; i > 0; i--) {\n        // top edge\n        st[stIndex++] = (i - 1) * leftSt;\n        st[stIndex++] = 1;\n      }\n    }\n\n    attributes.st = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n      values: st,\n    });\n  }\n\n  if (vertexFormat.normal) {\n    attributes.normal = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: attr.normals,\n    });\n  }\n\n  if (vertexFormat.tangent) {\n    attributes.tangent = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: attr.tangents,\n    });\n  }\n\n  if (vertexFormat.bitangent) {\n    attributes.bitangent = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: attr.bitangents,\n    });\n  }\n\n  return {\n    attributes: attributes,\n    indices: indices,\n  };\n}\n\nfunction extrudedAttributes(attributes, vertexFormat) {\n  if (\n    !vertexFormat.normal &&\n    !vertexFormat.tangent &&\n    !vertexFormat.bitangent &&\n    !vertexFormat.st\n  ) {\n    return attributes;\n  }\n  const positions = attributes.position.values;\n  let topNormals;\n  let topBitangents;\n  if (vertexFormat.normal || vertexFormat.bitangent) {\n    topNormals = attributes.normal.values;\n    topBitangents = attributes.bitangent.values;\n  }\n  const size = attributes.position.values.length / 18;\n  const threeSize = size * 3;\n  const twoSize = size * 2;\n  const sixSize = threeSize * 2;\n  let i;\n  if (vertexFormat.normal || vertexFormat.bitangent || vertexFormat.tangent) {\n    const normals = vertexFormat.normal\n      ? new Float32Array(threeSize * 6)\n      : undefined;\n    const tangents = vertexFormat.tangent\n      ? new Float32Array(threeSize * 6)\n      : undefined;\n    const bitangents = vertexFormat.bitangent\n      ? new Float32Array(threeSize * 6)\n      : undefined;\n    let topPosition = cartesian1;\n    let bottomPosition = cartesian2;\n    let previousPosition = cartesian3;\n    let normal = cartesian4;\n    let tangent = cartesian5;\n    let bitangent = cartesian6;\n    let attrIndex = sixSize;\n    for (i = 0; i < threeSize; i += 3) {\n      const attrIndexOffset = attrIndex + sixSize;\n      topPosition = Cartesian3.fromArray(positions, i, topPosition);\n      bottomPosition = Cartesian3.fromArray(\n        positions,\n        i + threeSize,\n        bottomPosition\n      );\n      previousPosition = Cartesian3.fromArray(\n        positions,\n        (i + 3) % threeSize,\n        previousPosition\n      );\n      bottomPosition = Cartesian3.subtract(\n        bottomPosition,\n        topPosition,\n        bottomPosition\n      );\n      previousPosition = Cartesian3.subtract(\n        previousPosition,\n        topPosition,\n        previousPosition\n      );\n      normal = Cartesian3.normalize(\n        Cartesian3.cross(bottomPosition, previousPosition, normal),\n        normal\n      );\n      if (vertexFormat.normal) {\n        CorridorGeometryLibrary.addAttribute(normals, normal, attrIndexOffset);\n        CorridorGeometryLibrary.addAttribute(\n          normals,\n          normal,\n          attrIndexOffset + 3\n        );\n        CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex);\n        CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex + 3);\n      }\n      if (vertexFormat.tangent || vertexFormat.bitangent) {\n        bitangent = Cartesian3.fromArray(topNormals, i, bitangent);\n        if (vertexFormat.bitangent) {\n          CorridorGeometryLibrary.addAttribute(\n            bitangents,\n            bitangent,\n            attrIndexOffset\n          );\n          CorridorGeometryLibrary.addAttribute(\n            bitangents,\n            bitangent,\n            attrIndexOffset + 3\n          );\n          CorridorGeometryLibrary.addAttribute(\n            bitangents,\n            bitangent,\n            attrIndex\n          );\n          CorridorGeometryLibrary.addAttribute(\n            bitangents,\n            bitangent,\n            attrIndex + 3\n          );\n        }\n\n        if (vertexFormat.tangent) {\n          tangent = Cartesian3.normalize(\n            Cartesian3.cross(bitangent, normal, tangent),\n            tangent\n          );\n          CorridorGeometryLibrary.addAttribute(\n            tangents,\n            tangent,\n            attrIndexOffset\n          );\n          CorridorGeometryLibrary.addAttribute(\n            tangents,\n            tangent,\n            attrIndexOffset + 3\n          );\n          CorridorGeometryLibrary.addAttribute(tangents, tangent, attrIndex);\n          CorridorGeometryLibrary.addAttribute(\n            tangents,\n            tangent,\n            attrIndex + 3\n          );\n        }\n      }\n      attrIndex += 6;\n    }\n\n    if (vertexFormat.normal) {\n      normals.set(topNormals); //top\n      for (i = 0; i < threeSize; i += 3) {\n        //bottom normals\n        normals[i + threeSize] = -topNormals[i];\n        normals[i + threeSize + 1] = -topNormals[i + 1];\n        normals[i + threeSize + 2] = -topNormals[i + 2];\n      }\n      attributes.normal.values = normals;\n    } else {\n      attributes.normal = undefined;\n    }\n\n    if (vertexFormat.bitangent) {\n      bitangents.set(topBitangents); //top\n      bitangents.set(topBitangents, threeSize); //bottom\n      attributes.bitangent.values = bitangents;\n    } else {\n      attributes.bitangent = undefined;\n    }\n\n    if (vertexFormat.tangent) {\n      const topTangents = attributes.tangent.values;\n      tangents.set(topTangents); //top\n      tangents.set(topTangents, threeSize); //bottom\n      attributes.tangent.values = tangents;\n    }\n  }\n  if (vertexFormat.st) {\n    const topSt = attributes.st.values;\n    const st = new Float32Array(twoSize * 6);\n    st.set(topSt); //top\n    st.set(topSt, twoSize); //bottom\n    let index = twoSize * 2;\n\n    for (let j = 0; j < 2; j++) {\n      st[index++] = topSt[0];\n      st[index++] = topSt[1];\n      for (i = 2; i < twoSize; i += 2) {\n        const s = topSt[i];\n        const t = topSt[i + 1];\n        st[index++] = s;\n        st[index++] = t;\n        st[index++] = s;\n        st[index++] = t;\n      }\n      st[index++] = topSt[0];\n      st[index++] = topSt[1];\n    }\n    attributes.st.values = st;\n  }\n\n  return attributes;\n}\n\nfunction addWallPositions(positions, index, wallPositions) {\n  wallPositions[index++] = positions[0];\n  wallPositions[index++] = positions[1];\n  wallPositions[index++] = positions[2];\n  for (let i = 3; i < positions.length; i += 3) {\n    const x = positions[i];\n    const y = positions[i + 1];\n    const z = positions[i + 2];\n    wallPositions[index++] = x;\n    wallPositions[index++] = y;\n    wallPositions[index++] = z;\n    wallPositions[index++] = x;\n    wallPositions[index++] = y;\n    wallPositions[index++] = z;\n  }\n  wallPositions[index++] = positions[0];\n  wallPositions[index++] = positions[1];\n  wallPositions[index++] = positions[2];\n\n  return wallPositions;\n}\n\nfunction computePositionsExtruded(params, vertexFormat) {\n  const topVertexFormat = new VertexFormat({\n    position: vertexFormat.position,\n    normal:\n      vertexFormat.normal || vertexFormat.bitangent || params.shadowVolume,\n    tangent: vertexFormat.tangent,\n    bitangent: vertexFormat.normal || vertexFormat.bitangent,\n    st: vertexFormat.st,\n  });\n  const ellipsoid = params.ellipsoid;\n  const computedPositions = CorridorGeometryLibrary.computePositions(params);\n  const attr = combine(computedPositions, topVertexFormat, ellipsoid);\n  const height = params.height;\n  const extrudedHeight = params.extrudedHeight;\n  let attributes = attr.attributes;\n  const indices = attr.indices;\n  let positions = attributes.position.values;\n  let length = positions.length;\n  const newPositions = new Float64Array(length * 6);\n  let extrudedPositions = new Float64Array(length);\n  extrudedPositions.set(positions);\n  let wallPositions = new Float64Array(length * 4);\n\n  positions = PolygonPipeline.scaleToGeodeticHeight(\n    positions,\n    height,\n    ellipsoid\n  );\n  wallPositions = addWallPositions(positions, 0, wallPositions);\n  extrudedPositions = PolygonPipeline.scaleToGeodeticHeight(\n    extrudedPositions,\n    extrudedHeight,\n    ellipsoid\n  );\n  wallPositions = addWallPositions(\n    extrudedPositions,\n    length * 2,\n    wallPositions\n  );\n  newPositions.set(positions);\n  newPositions.set(extrudedPositions, length);\n  newPositions.set(wallPositions, length * 2);\n  attributes.position.values = newPositions;\n\n  attributes = extrudedAttributes(attributes, vertexFormat);\n  let i;\n  const size = length / 3;\n  if (params.shadowVolume) {\n    const topNormals = attributes.normal.values;\n    length = topNormals.length;\n\n    let extrudeNormals = new Float32Array(length * 6);\n    for (i = 0; i < length; i++) {\n      topNormals[i] = -topNormals[i];\n    }\n    //only get normals for bottom layer that's going to be pushed down\n    extrudeNormals.set(topNormals, length); //bottom face\n    extrudeNormals = addWallPositions(topNormals, length * 4, extrudeNormals); //bottom wall\n    attributes.extrudeDirection = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: extrudeNormals,\n    });\n    if (!vertexFormat.normal) {\n      attributes.normal = undefined;\n    }\n  }\n  if (defined(params.offsetAttribute)) {\n    let applyOffset = new Uint8Array(size * 6);\n    if (params.offsetAttribute === GeometryOffsetAttribute.TOP) {\n      applyOffset = applyOffset\n        .fill(1, 0, size) // top face\n        .fill(1, size * 2, size * 4); // top wall\n    } else {\n      const applyOffsetValue =\n        params.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n      applyOffset = applyOffset.fill(applyOffsetValue);\n    }\n    attributes.applyOffset = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 1,\n      values: applyOffset,\n    });\n  }\n\n  const iLength = indices.length;\n  const twoSize = size + size;\n  const newIndices = IndexDatatype.createTypedArray(\n    newPositions.length / 3,\n    iLength * 2 + twoSize * 3\n  );\n  newIndices.set(indices);\n  let index = iLength;\n  for (i = 0; i < iLength; i += 3) {\n    // bottom indices\n    const v0 = indices[i];\n    const v1 = indices[i + 1];\n    const v2 = indices[i + 2];\n    newIndices[index++] = v2 + size;\n    newIndices[index++] = v1 + size;\n    newIndices[index++] = v0 + size;\n  }\n\n  let UL, LL, UR, LR;\n\n  for (i = 0; i < twoSize; i += 2) {\n    //wall indices\n    UL = i + twoSize;\n    LL = UL + twoSize;\n    UR = UL + 1;\n    LR = LL + 1;\n    newIndices[index++] = UL;\n    newIndices[index++] = LL;\n    newIndices[index++] = UR;\n    newIndices[index++] = UR;\n    newIndices[index++] = LL;\n    newIndices[index++] = LR;\n  }\n\n  return {\n    attributes: attributes,\n    indices: newIndices,\n  };\n}\n\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchCartographic = new Cartographic();\n\nfunction computeOffsetPoints(\n  position1,\n  position2,\n  ellipsoid,\n  halfWidth,\n  min,\n  max\n) {\n  // Compute direction of offset the point\n  const direction = Cartesian3.subtract(\n    position2,\n    position1,\n    scratchCartesian1\n  );\n  Cartesian3.normalize(direction, direction);\n  const normal = ellipsoid.geodeticSurfaceNormal(position1, scratchCartesian2);\n  const offsetDirection = Cartesian3.cross(\n    direction,\n    normal,\n    scratchCartesian1\n  );\n  Cartesian3.multiplyByScalar(offsetDirection, halfWidth, offsetDirection);\n\n  let minLat = min.latitude;\n  let minLon = min.longitude;\n  let maxLat = max.latitude;\n  let maxLon = max.longitude;\n\n  // Compute 2 offset points\n  Cartesian3.add(position1, offsetDirection, scratchCartesian2);\n  ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);\n\n  let lat = scratchCartographic.latitude;\n  let lon = scratchCartographic.longitude;\n  minLat = Math.min(minLat, lat);\n  minLon = Math.min(minLon, lon);\n  maxLat = Math.max(maxLat, lat);\n  maxLon = Math.max(maxLon, lon);\n\n  Cartesian3.subtract(position1, offsetDirection, scratchCartesian2);\n  ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);\n\n  lat = scratchCartographic.latitude;\n  lon = scratchCartographic.longitude;\n  minLat = Math.min(minLat, lat);\n  minLon = Math.min(minLon, lon);\n  maxLat = Math.max(maxLat, lat);\n  maxLon = Math.max(maxLon, lon);\n\n  min.latitude = minLat;\n  min.longitude = minLon;\n  max.latitude = maxLat;\n  max.longitude = maxLon;\n}\n\nconst scratchCartesianOffset = new Cartesian3();\nconst scratchCartesianEnds = new Cartesian3();\nconst scratchCartographicMin = new Cartographic();\nconst scratchCartographicMax = new Cartographic();\n\nfunction computeRectangle(positions, ellipsoid, width, cornerType, result) {\n  positions = scaleToSurface(positions, ellipsoid);\n  const cleanPositions = arrayRemoveDuplicates(\n    positions,\n    Cartesian3.equalsEpsilon\n  );\n  const length = cleanPositions.length;\n  if (length < 2 || width <= 0) {\n    return new Rectangle();\n  }\n  const halfWidth = width * 0.5;\n\n  scratchCartographicMin.latitude = Number.POSITIVE_INFINITY;\n  scratchCartographicMin.longitude = Number.POSITIVE_INFINITY;\n  scratchCartographicMax.latitude = Number.NEGATIVE_INFINITY;\n  scratchCartographicMax.longitude = Number.NEGATIVE_INFINITY;\n\n  let lat, lon;\n  if (cornerType === CornerType.ROUNDED) {\n    // Compute start cap\n    const first = cleanPositions[0];\n    Cartesian3.subtract(first, cleanPositions[1], scratchCartesianOffset);\n    Cartesian3.normalize(scratchCartesianOffset, scratchCartesianOffset);\n    Cartesian3.multiplyByScalar(\n      scratchCartesianOffset,\n      halfWidth,\n      scratchCartesianOffset\n    );\n    Cartesian3.add(first, scratchCartesianOffset, scratchCartesianEnds);\n\n    ellipsoid.cartesianToCartographic(\n      scratchCartesianEnds,\n      scratchCartographic\n    );\n    lat = scratchCartographic.latitude;\n    lon = scratchCartographic.longitude;\n    scratchCartographicMin.latitude = Math.min(\n      scratchCartographicMin.latitude,\n      lat\n    );\n    scratchCartographicMin.longitude = Math.min(\n      scratchCartographicMin.longitude,\n      lon\n    );\n    scratchCartographicMax.latitude = Math.max(\n      scratchCartographicMax.latitude,\n      lat\n    );\n    scratchCartographicMax.longitude = Math.max(\n      scratchCartographicMax.longitude,\n      lon\n    );\n  }\n\n  // Compute the rest\n  for (let i = 0; i < length - 1; ++i) {\n    computeOffsetPoints(\n      cleanPositions[i],\n      cleanPositions[i + 1],\n      ellipsoid,\n      halfWidth,\n      scratchCartographicMin,\n      scratchCartographicMax\n    );\n  }\n\n  // Compute ending point\n  const last = cleanPositions[length - 1];\n  Cartesian3.subtract(last, cleanPositions[length - 2], scratchCartesianOffset);\n  Cartesian3.normalize(scratchCartesianOffset, scratchCartesianOffset);\n  Cartesian3.multiplyByScalar(\n    scratchCartesianOffset,\n    halfWidth,\n    scratchCartesianOffset\n  );\n  Cartesian3.add(last, scratchCartesianOffset, scratchCartesianEnds);\n  computeOffsetPoints(\n    last,\n    scratchCartesianEnds,\n    ellipsoid,\n    halfWidth,\n    scratchCartographicMin,\n    scratchCartographicMax\n  );\n\n  if (cornerType === CornerType.ROUNDED) {\n    // Compute end cap\n    ellipsoid.cartesianToCartographic(\n      scratchCartesianEnds,\n      scratchCartographic\n    );\n    lat = scratchCartographic.latitude;\n    lon = scratchCartographic.longitude;\n    scratchCartographicMin.latitude = Math.min(\n      scratchCartographicMin.latitude,\n      lat\n    );\n    scratchCartographicMin.longitude = Math.min(\n      scratchCartographicMin.longitude,\n      lon\n    );\n    scratchCartographicMax.latitude = Math.max(\n      scratchCartographicMax.latitude,\n      lat\n    );\n    scratchCartographicMax.longitude = Math.max(\n      scratchCartographicMax.longitude,\n      lon\n    );\n  }\n\n  const rectangle = defined(result) ? result : new Rectangle();\n  rectangle.north = scratchCartographicMax.latitude;\n  rectangle.south = scratchCartographicMin.latitude;\n  rectangle.east = scratchCartographicMax.longitude;\n  rectangle.west = scratchCartographicMin.longitude;\n\n  return rectangle;\n}\n\n/**\n * A description of a corridor. Corridor geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\n *\n * @alias CorridorGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor.\n * @param {number} options.width The distance between the edges of the corridor in meters.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {number} [options.height=0] The distance in meters between the ellipsoid surface and the positions.\n * @param {number} [options.extrudedHeight] The distance in meters between the ellipsoid surface and the extruded face.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.\n *\n * @see CorridorGeometry.createGeometry\n * @see Packable\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Corridor.html|Cesium Sandcastle Corridor Demo}\n *\n * @example\n * const corridor = new Cesium.CorridorGeometry({\n *   vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\n *   positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),\n *   width : 100000\n * });\n */\nfunction CorridorGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const positions = options.positions;\n  const width = options.width;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.positions\", positions);\n  Check.defined(\"options.width\", width);\n  //>>includeEnd('debug');\n\n  const height = defaultValue(options.height, 0.0);\n  const extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n  this._positions = positions;\n  this._ellipsoid = Ellipsoid.clone(\n    defaultValue(options.ellipsoid, Ellipsoid.WGS84)\n  );\n  this._vertexFormat = VertexFormat.clone(\n    defaultValue(options.vertexFormat, VertexFormat.DEFAULT)\n  );\n  this._width = width;\n  this._height = Math.max(height, extrudedHeight);\n  this._extrudedHeight = Math.min(height, extrudedHeight);\n  this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);\n  this._granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  this._shadowVolume = defaultValue(options.shadowVolume, false);\n  this._workerName = \"createCorridorGeometry\";\n  this._offsetAttribute = options.offsetAttribute;\n  this._rectangle = undefined;\n\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  this.packedLength =\n    1 +\n    positions.length * Cartesian3.packedLength +\n    Ellipsoid.packedLength +\n    VertexFormat.packedLength +\n    7;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CorridorGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nCorridorGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const positions = value._positions;\n  const length = positions.length;\n  array[startingIndex++] = length;\n\n  for (let i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    Cartesian3.pack(positions[i], array, startingIndex);\n  }\n\n  Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  VertexFormat.pack(value._vertexFormat, array, startingIndex);\n  startingIndex += VertexFormat.packedLength;\n\n  array[startingIndex++] = value._width;\n  array[startingIndex++] = value._height;\n  array[startingIndex++] = value._extrudedHeight;\n  array[startingIndex++] = value._cornerType;\n  array[startingIndex++] = value._granularity;\n  array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;\n  array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n  return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n  positions: undefined,\n  ellipsoid: scratchEllipsoid,\n  vertexFormat: scratchVertexFormat,\n  width: undefined,\n  height: undefined,\n  extrudedHeight: undefined,\n  cornerType: undefined,\n  granularity: undefined,\n  shadowVolume: undefined,\n  offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CorridorGeometry} [result] The object into which to store the result.\n * @returns {CorridorGeometry} The modified result parameter or a new CorridorGeometry instance if one was not provided.\n */\nCorridorGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const length = array[startingIndex++];\n  const positions = new Array(length);\n\n  for (let i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    positions[i] = Cartesian3.unpack(array, startingIndex);\n  }\n\n  const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n  startingIndex += Ellipsoid.packedLength;\n\n  const vertexFormat = VertexFormat.unpack(\n    array,\n    startingIndex,\n    scratchVertexFormat\n  );\n  startingIndex += VertexFormat.packedLength;\n\n  const width = array[startingIndex++];\n  const height = array[startingIndex++];\n  const extrudedHeight = array[startingIndex++];\n  const cornerType = array[startingIndex++];\n  const granularity = array[startingIndex++];\n  const shadowVolume = array[startingIndex++] === 1.0;\n  const offsetAttribute = array[startingIndex];\n\n  if (!defined(result)) {\n    scratchOptions.positions = positions;\n    scratchOptions.width = width;\n    scratchOptions.height = height;\n    scratchOptions.extrudedHeight = extrudedHeight;\n    scratchOptions.cornerType = cornerType;\n    scratchOptions.granularity = granularity;\n    scratchOptions.shadowVolume = shadowVolume;\n    scratchOptions.offsetAttribute =\n      offsetAttribute === -1 ? undefined : offsetAttribute;\n\n    return new CorridorGeometry(scratchOptions);\n  }\n\n  result._positions = positions;\n  result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n  result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n  result._width = width;\n  result._height = height;\n  result._extrudedHeight = extrudedHeight;\n  result._cornerType = cornerType;\n  result._granularity = granularity;\n  result._shadowVolume = shadowVolume;\n  result._offsetAttribute =\n    offsetAttribute === -1 ? undefined : offsetAttribute;\n\n  return result;\n};\n\n/**\n * Computes the bounding rectangle given the provided options\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor.\n * @param {number} options.width The distance between the edges of the corridor in meters.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.\n * @param {Rectangle} [result] An object in which to store the result.\n *\n * @returns {Rectangle} The result rectangle.\n */\nCorridorGeometry.computeRectangle = function (options, result) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const positions = options.positions;\n  const width = options.width;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.positions\", positions);\n  Check.defined(\"options.width\", width);\n  //>>includeEnd('debug');\n\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  const cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);\n\n  return computeRectangle(positions, ellipsoid, width, cornerType, result);\n};\n\n/**\n * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.\n *\n * @param {CorridorGeometry} corridorGeometry A description of the corridor.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCorridorGeometry.createGeometry = function (corridorGeometry) {\n  let positions = corridorGeometry._positions;\n  const width = corridorGeometry._width;\n  const ellipsoid = corridorGeometry._ellipsoid;\n\n  positions = scaleToSurface(positions, ellipsoid);\n  const cleanPositions = arrayRemoveDuplicates(\n    positions,\n    Cartesian3.equalsEpsilon\n  );\n\n  if (cleanPositions.length < 2 || width <= 0) {\n    return;\n  }\n\n  const height = corridorGeometry._height;\n  const extrudedHeight = corridorGeometry._extrudedHeight;\n  const extrude = !CesiumMath.equalsEpsilon(\n    height,\n    extrudedHeight,\n    0,\n    CesiumMath.EPSILON2\n  );\n\n  const vertexFormat = corridorGeometry._vertexFormat;\n  const params = {\n    ellipsoid: ellipsoid,\n    positions: cleanPositions,\n    width: width,\n    cornerType: corridorGeometry._cornerType,\n    granularity: corridorGeometry._granularity,\n    saveAttributes: true,\n  };\n  let attr;\n  if (extrude) {\n    params.height = height;\n    params.extrudedHeight = extrudedHeight;\n    params.shadowVolume = corridorGeometry._shadowVolume;\n    params.offsetAttribute = corridorGeometry._offsetAttribute;\n    attr = computePositionsExtruded(params, vertexFormat);\n  } else {\n    const computedPositions = CorridorGeometryLibrary.computePositions(params);\n    attr = combine(computedPositions, vertexFormat, ellipsoid);\n    attr.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n      attr.attributes.position.values,\n      height,\n      ellipsoid\n    );\n\n    if (defined(corridorGeometry._offsetAttribute)) {\n      const applyOffsetValue =\n        corridorGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n          ? 0\n          : 1;\n      const length = attr.attributes.position.values.length;\n      const applyOffset = new Uint8Array(length / 3).fill(applyOffsetValue);\n      attr.attributes.applyOffset = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n        componentsPerAttribute: 1,\n        values: applyOffset,\n      });\n    }\n  }\n  const attributes = attr.attributes;\n  const boundingSphere = BoundingSphere.fromVertices(\n    attributes.position.values,\n    undefined,\n    3\n  );\n  if (!vertexFormat.position) {\n    attr.attributes.position.values = undefined;\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: attr.indices,\n    primitiveType: PrimitiveType.TRIANGLES,\n    boundingSphere: boundingSphere,\n    offsetAttribute: corridorGeometry._offsetAttribute,\n  });\n};\n\n/**\n * @private\n */\nCorridorGeometry.createShadowVolume = function (\n  corridorGeometry,\n  minHeightFunc,\n  maxHeightFunc\n) {\n  const granularity = corridorGeometry._granularity;\n  const ellipsoid = corridorGeometry._ellipsoid;\n\n  const minHeight = minHeightFunc(granularity, ellipsoid);\n  const maxHeight = maxHeightFunc(granularity, ellipsoid);\n\n  return new CorridorGeometry({\n    positions: corridorGeometry._positions,\n    width: corridorGeometry._width,\n    cornerType: corridorGeometry._cornerType,\n    ellipsoid: ellipsoid,\n    granularity: granularity,\n    extrudedHeight: minHeight,\n    height: maxHeight,\n    vertexFormat: VertexFormat.POSITION_ONLY,\n    shadowVolume: true,\n  });\n};\n\nObject.defineProperties(CorridorGeometry.prototype, {\n  /**\n   * @private\n   */\n  rectangle: {\n    get: function () {\n      if (!defined(this._rectangle)) {\n        this._rectangle = computeRectangle(\n          this._positions,\n          this._ellipsoid,\n          this._width,\n          this._cornerType\n        );\n      }\n      return this._rectangle;\n    },\n  },\n  /**\n   * For remapping texture coordinates when rendering CorridorGeometries as GroundPrimitives.\n   *\n   * Corridors don't support stRotation,\n   * so just return the corners of the original system.\n   * @private\n   */\n  textureCoordinateRotationPoints: {\n    get: function () {\n      return [0, 0, 0, 1, 1, 0];\n    },\n  },\n});\nexport default CorridorGeometry;\n", "import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CornerType from \"./CornerType.js\";\nimport CorridorGeometryLibrary from \"./CorridorGeometryLibrary.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\nconst cartesian1 = new Cartesian3();\nconst cartesian2 = new Cartesian3();\nconst cartesian3 = new Cartesian3();\n\nfunction scaleToSurface(positions, ellipsoid) {\n  for (let i = 0; i < positions.length; i++) {\n    positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);\n  }\n  return positions;\n}\n\nfunction combine(computedPositions, cornerType) {\n  const wallIndices = [];\n  const positions = computedPositions.positions;\n  const corners = computedPositions.corners;\n  const endPositions = computedPositions.endPositions;\n  const attributes = new GeometryAttributes();\n  let corner;\n  let leftCount = 0;\n  let rightCount = 0;\n  let i;\n  let indicesLength = 0;\n  let length;\n  for (i = 0; i < positions.length; i += 2) {\n    length = positions[i].length - 3;\n    leftCount += length; //subtracting 3 to account for duplicate points at corners\n    indicesLength += (length / 3) * 4;\n    rightCount += positions[i + 1].length - 3;\n  }\n  leftCount += 3; //add back count for end positions\n  rightCount += 3;\n  for (i = 0; i < corners.length; i++) {\n    corner = corners[i];\n    const leftSide = corners[i].leftPositions;\n    if (defined(leftSide)) {\n      length = leftSide.length;\n      leftCount += length;\n      indicesLength += (length / 3) * 2;\n    } else {\n      length = corners[i].rightPositions.length;\n      rightCount += length;\n      indicesLength += (length / 3) * 2;\n    }\n  }\n\n  const addEndPositions = defined(endPositions);\n  let endPositionLength;\n  if (addEndPositions) {\n    endPositionLength = endPositions[0].length - 3;\n    leftCount += endPositionLength;\n    rightCount += endPositionLength;\n    endPositionLength /= 3;\n    indicesLength += endPositionLength * 4;\n  }\n  const size = leftCount + rightCount;\n  const finalPositions = new Float64Array(size);\n  let front = 0;\n  let back = size - 1;\n  let UL, LL, UR, LR;\n  let rightPos, leftPos;\n  const halfLength = endPositionLength / 2;\n\n  const indices = IndexDatatype.createTypedArray(size / 3, indicesLength + 4);\n  let index = 0;\n\n  indices[index++] = front / 3;\n  indices[index++] = (back - 2) / 3;\n  if (addEndPositions) {\n    // add rounded end\n    wallIndices.push(front / 3);\n    leftPos = cartesian1;\n    rightPos = cartesian2;\n    const firstEndPositions = endPositions[0];\n    for (i = 0; i < halfLength; i++) {\n      leftPos = Cartesian3.fromArray(\n        firstEndPositions,\n        (halfLength - 1 - i) * 3,\n        leftPos\n      );\n      rightPos = Cartesian3.fromArray(\n        firstEndPositions,\n        (halfLength + i) * 3,\n        rightPos\n      );\n      CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);\n      CorridorGeometryLibrary.addAttribute(\n        finalPositions,\n        leftPos,\n        undefined,\n        back\n      );\n\n      LL = front / 3;\n      LR = LL + 1;\n      UL = (back - 2) / 3;\n      UR = UL - 1;\n      indices[index++] = UL;\n      indices[index++] = UR;\n      indices[index++] = LL;\n      indices[index++] = LR;\n\n      front += 3;\n      back -= 3;\n    }\n  }\n\n  let posIndex = 0;\n  let rightEdge = positions[posIndex++]; //add first two edges\n  let leftEdge = positions[posIndex++];\n  finalPositions.set(rightEdge, front);\n  finalPositions.set(leftEdge, back - leftEdge.length + 1);\n\n  length = leftEdge.length - 3;\n  wallIndices.push(front / 3, (back - 2) / 3);\n  for (i = 0; i < length; i += 3) {\n    LL = front / 3;\n    LR = LL + 1;\n    UL = (back - 2) / 3;\n    UR = UL - 1;\n    indices[index++] = UL;\n    indices[index++] = UR;\n    indices[index++] = LL;\n    indices[index++] = LR;\n\n    front += 3;\n    back -= 3;\n  }\n\n  for (i = 0; i < corners.length; i++) {\n    let j;\n    corner = corners[i];\n    const l = corner.leftPositions;\n    const r = corner.rightPositions;\n    let start;\n    let outsidePoint = cartesian3;\n    if (defined(l)) {\n      back -= 3;\n      start = UR;\n      wallIndices.push(LR);\n      for (j = 0; j < l.length / 3; j++) {\n        outsidePoint = Cartesian3.fromArray(l, j * 3, outsidePoint);\n        indices[index++] = start - j - 1;\n        indices[index++] = start - j;\n        CorridorGeometryLibrary.addAttribute(\n          finalPositions,\n          outsidePoint,\n          undefined,\n          back\n        );\n        back -= 3;\n      }\n      wallIndices.push(start - Math.floor(l.length / 6));\n      if (cornerType === CornerType.BEVELED) {\n        wallIndices.push((back - 2) / 3 + 1);\n      }\n      front += 3;\n    } else {\n      front += 3;\n      start = LR;\n      wallIndices.push(UR);\n      for (j = 0; j < r.length / 3; j++) {\n        outsidePoint = Cartesian3.fromArray(r, j * 3, outsidePoint);\n        indices[index++] = start + j;\n        indices[index++] = start + j + 1;\n        CorridorGeometryLibrary.addAttribute(\n          finalPositions,\n          outsidePoint,\n          front\n        );\n        front += 3;\n      }\n      wallIndices.push(start + Math.floor(r.length / 6));\n      if (cornerType === CornerType.BEVELED) {\n        wallIndices.push(front / 3 - 1);\n      }\n      back -= 3;\n    }\n    rightEdge = positions[posIndex++];\n    leftEdge = positions[posIndex++];\n    rightEdge.splice(0, 3); //remove duplicate points added by corner\n    leftEdge.splice(leftEdge.length - 3, 3);\n    finalPositions.set(rightEdge, front);\n    finalPositions.set(leftEdge, back - leftEdge.length + 1);\n    length = leftEdge.length - 3;\n\n    for (j = 0; j < leftEdge.length; j += 3) {\n      LR = front / 3;\n      LL = LR - 1;\n      UR = (back - 2) / 3;\n      UL = UR + 1;\n      indices[index++] = UL;\n      indices[index++] = UR;\n      indices[index++] = LL;\n      indices[index++] = LR;\n      front += 3;\n      back -= 3;\n    }\n    front -= 3;\n    back += 3;\n    wallIndices.push(front / 3, (back - 2) / 3);\n  }\n\n  if (addEndPositions) {\n    // add rounded end\n    front += 3;\n    back -= 3;\n    leftPos = cartesian1;\n    rightPos = cartesian2;\n    const lastEndPositions = endPositions[1];\n    for (i = 0; i < halfLength; i++) {\n      leftPos = Cartesian3.fromArray(\n        lastEndPositions,\n        (endPositionLength - i - 1) * 3,\n        leftPos\n      );\n      rightPos = Cartesian3.fromArray(lastEndPositions, i * 3, rightPos);\n      CorridorGeometryLibrary.addAttribute(\n        finalPositions,\n        leftPos,\n        undefined,\n        back\n      );\n      CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);\n\n      LR = front / 3;\n      LL = LR - 1;\n      UR = (back - 2) / 3;\n      UL = UR + 1;\n      indices[index++] = UL;\n      indices[index++] = UR;\n      indices[index++] = LL;\n      indices[index++] = LR;\n\n      front += 3;\n      back -= 3;\n    }\n\n    wallIndices.push(front / 3);\n  } else {\n    wallIndices.push(front / 3, (back - 2) / 3);\n  }\n  indices[index++] = front / 3;\n  indices[index++] = (back - 2) / 3;\n\n  attributes.position = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.DOUBLE,\n    componentsPerAttribute: 3,\n    values: finalPositions,\n  });\n\n  return {\n    attributes: attributes,\n    indices: indices,\n    wallIndices: wallIndices,\n  };\n}\n\nfunction computePositionsExtruded(params) {\n  const ellipsoid = params.ellipsoid;\n  const computedPositions = CorridorGeometryLibrary.computePositions(params);\n  const attr = combine(computedPositions, params.cornerType);\n  const wallIndices = attr.wallIndices;\n  const height = params.height;\n  const extrudedHeight = params.extrudedHeight;\n  const attributes = attr.attributes;\n  const indices = attr.indices;\n  let positions = attributes.position.values;\n  let length = positions.length;\n  let extrudedPositions = new Float64Array(length);\n  extrudedPositions.set(positions);\n  const newPositions = new Float64Array(length * 2);\n\n  positions = PolygonPipeline.scaleToGeodeticHeight(\n    positions,\n    height,\n    ellipsoid\n  );\n  extrudedPositions = PolygonPipeline.scaleToGeodeticHeight(\n    extrudedPositions,\n    extrudedHeight,\n    ellipsoid\n  );\n  newPositions.set(positions);\n  newPositions.set(extrudedPositions, length);\n  attributes.position.values = newPositions;\n\n  length /= 3;\n  if (defined(params.offsetAttribute)) {\n    let applyOffset = new Uint8Array(length * 2);\n    if (params.offsetAttribute === GeometryOffsetAttribute.TOP) {\n      applyOffset = applyOffset.fill(1, 0, length);\n    } else {\n      const applyOffsetValue =\n        params.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n      applyOffset = applyOffset.fill(applyOffsetValue);\n    }\n\n    attributes.applyOffset = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 1,\n      values: applyOffset,\n    });\n  }\n\n  let i;\n  const iLength = indices.length;\n  const newIndices = IndexDatatype.createTypedArray(\n    newPositions.length / 3,\n    (iLength + wallIndices.length) * 2\n  );\n  newIndices.set(indices);\n  let index = iLength;\n  for (i = 0; i < iLength; i += 2) {\n    // bottom indices\n    const v0 = indices[i];\n    const v1 = indices[i + 1];\n    newIndices[index++] = v0 + length;\n    newIndices[index++] = v1 + length;\n  }\n\n  let UL, LL;\n  for (i = 0; i < wallIndices.length; i++) {\n    //wall indices\n    UL = wallIndices[i];\n    LL = UL + length;\n    newIndices[index++] = UL;\n    newIndices[index++] = LL;\n  }\n\n  return {\n    attributes: attributes,\n    indices: newIndices,\n  };\n}\n\n/**\n * A description of a corridor outline.\n *\n * @alias CorridorOutlineGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor outline.\n * @param {number} options.width The distance between the edges of the corridor outline.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {number} [options.height=0] The distance in meters between the positions and the ellipsoid surface.\n * @param {number} [options.extrudedHeight] The distance in meters between the extruded face and the ellipsoid surface.\n * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.\n *\n * @see CorridorOutlineGeometry.createGeometry\n *\n * @example\n * const corridor = new Cesium.CorridorOutlineGeometry({\n *   positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),\n *   width : 100000\n * });\n */\nfunction CorridorOutlineGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const positions = options.positions;\n  const width = options.width;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.positions\", positions);\n  Check.typeOf.number(\"options.width\", width);\n  //>>includeEnd('debug');\n\n  const height = defaultValue(options.height, 0.0);\n  const extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n  this._positions = positions;\n  this._ellipsoid = Ellipsoid.clone(\n    defaultValue(options.ellipsoid, Ellipsoid.WGS84)\n  );\n  this._width = width;\n  this._height = Math.max(height, extrudedHeight);\n  this._extrudedHeight = Math.min(height, extrudedHeight);\n  this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);\n  this._granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  this._offsetAttribute = options.offsetAttribute;\n  this._workerName = \"createCorridorOutlineGeometry\";\n\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  this.packedLength =\n    1 + positions.length * Cartesian3.packedLength + Ellipsoid.packedLength + 6;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CorridorOutlineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nCorridorOutlineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.typeOf.object(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const positions = value._positions;\n  const length = positions.length;\n  array[startingIndex++] = length;\n\n  for (let i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    Cartesian3.pack(positions[i], array, startingIndex);\n  }\n\n  Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  array[startingIndex++] = value._width;\n  array[startingIndex++] = value._height;\n  array[startingIndex++] = value._extrudedHeight;\n  array[startingIndex++] = value._cornerType;\n  array[startingIndex++] = value._granularity;\n  array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n  return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchOptions = {\n  positions: undefined,\n  ellipsoid: scratchEllipsoid,\n  width: undefined,\n  height: undefined,\n  extrudedHeight: undefined,\n  cornerType: undefined,\n  granularity: undefined,\n  offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CorridorOutlineGeometry} [result] The object into which to store the result.\n * @returns {CorridorOutlineGeometry} The modified result parameter or a new CorridorOutlineGeometry instance if one was not provided.\n */\nCorridorOutlineGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const length = array[startingIndex++];\n  const positions = new Array(length);\n\n  for (let i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    positions[i] = Cartesian3.unpack(array, startingIndex);\n  }\n\n  const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n  startingIndex += Ellipsoid.packedLength;\n\n  const width = array[startingIndex++];\n  const height = array[startingIndex++];\n  const extrudedHeight = array[startingIndex++];\n  const cornerType = array[startingIndex++];\n  const granularity = array[startingIndex++];\n  const offsetAttribute = array[startingIndex];\n\n  if (!defined(result)) {\n    scratchOptions.positions = positions;\n    scratchOptions.width = width;\n    scratchOptions.height = height;\n    scratchOptions.extrudedHeight = extrudedHeight;\n    scratchOptions.cornerType = cornerType;\n    scratchOptions.granularity = granularity;\n    scratchOptions.offsetAttribute =\n      offsetAttribute === -1 ? undefined : offsetAttribute;\n    return new CorridorOutlineGeometry(scratchOptions);\n  }\n\n  result._positions = positions;\n  result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n  result._width = width;\n  result._height = height;\n  result._extrudedHeight = extrudedHeight;\n  result._cornerType = cornerType;\n  result._granularity = granularity;\n  result._offsetAttribute =\n    offsetAttribute === -1 ? undefined : offsetAttribute;\n\n  return result;\n};\n\n/**\n * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.\n *\n * @param {CorridorOutlineGeometry} corridorOutlineGeometry A description of the corridor.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCorridorOutlineGeometry.createGeometry = function (corridorOutlineGeometry) {\n  let positions = corridorOutlineGeometry._positions;\n  const width = corridorOutlineGeometry._width;\n  const ellipsoid = corridorOutlineGeometry._ellipsoid;\n\n  positions = scaleToSurface(positions, ellipsoid);\n  const cleanPositions = arrayRemoveDuplicates(\n    positions,\n    Cartesian3.equalsEpsilon\n  );\n\n  if (cleanPositions.length < 2 || width <= 0) {\n    return;\n  }\n\n  const height = corridorOutlineGeometry._height;\n  const extrudedHeight = corridorOutlineGeometry._extrudedHeight;\n  const extrude = !CesiumMath.equalsEpsilon(\n    height,\n    extrudedHeight,\n    0,\n    CesiumMath.EPSILON2\n  );\n\n  const params = {\n    ellipsoid: ellipsoid,\n    positions: cleanPositions,\n    width: width,\n    cornerType: corridorOutlineGeometry._cornerType,\n    granularity: corridorOutlineGeometry._granularity,\n    saveAttributes: false,\n  };\n  let attr;\n  if (extrude) {\n    params.height = height;\n    params.extrudedHeight = extrudedHeight;\n    params.offsetAttribute = corridorOutlineGeometry._offsetAttribute;\n    attr = computePositionsExtruded(params);\n  } else {\n    const computedPositions = CorridorGeometryLibrary.computePositions(params);\n    attr = combine(computedPositions, params.cornerType);\n    attr.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n      attr.attributes.position.values,\n      height,\n      ellipsoid\n    );\n\n    if (defined(corridorOutlineGeometry._offsetAttribute)) {\n      const length = attr.attributes.position.values.length;\n      const offsetValue =\n        corridorOutlineGeometry._offsetAttribute ===\n        GeometryOffsetAttribute.NONE\n          ? 0\n          : 1;\n      const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n      attr.attributes.applyOffset = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n        componentsPerAttribute: 1,\n        values: applyOffset,\n      });\n    }\n  }\n  const attributes = attr.attributes;\n  const boundingSphere = BoundingSphere.fromVertices(\n    attributes.position.values,\n    undefined,\n    3\n  );\n\n  return new Geometry({\n    attributes: attributes,\n    indices: attr.indices,\n    primitiveType: PrimitiveType.LINES,\n    boundingSphere: boundingSphere,\n    offsetAttribute: corridorOutlineGeometry._offsetAttribute,\n  });\n};\nexport default CorridorOutlineGeometry;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GeometryOffsetAttribute from \"../Core/GeometryOffsetAttribute.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport GroundPrimitive from \"../Scene/GroundPrimitive.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport CallbackProperty from \"./CallbackProperty.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport TerrainOffsetProperty from \"./TerrainOffsetProperty.js\";\n\nconst defaultZIndex = new ConstantProperty(0);\n\n/**\n * An abstract class for updating ground geometry entities.\n * @constructor\n * @alias GroundGeometryUpdater\n * @param {object} options An object with the following properties:\n * @param {Entity} options.entity The entity containing the geometry to be visualized.\n * @param {Scene} options.scene The scene where visualization is taking place.\n * @param {object} options.geometryOptions Options for the geometry\n * @param {string} options.geometryPropertyName The geometry property name\n * @param {string[]} options.observedPropertyNames The entity properties this geometry cares about\n */\nfunction GroundGeometryUpdater(options) {\n  GeometryUpdater.call(this, options);\n\n  this._zIndex = 0;\n  this._terrainOffsetProperty = undefined;\n}\n\nif (defined(Object.create)) {\n  GroundGeometryUpdater.prototype = Object.create(GeometryUpdater.prototype);\n  GroundGeometryUpdater.prototype.constructor = GroundGeometryUpdater;\n}\n\nObject.defineProperties(GroundGeometryUpdater.prototype, {\n  /**\n   * Gets the zindex\n   * @type {number}\n   * @memberof GroundGeometryUpdater.prototype\n   * @readonly\n   */\n  zIndex: {\n    get: function () {\n      return this._zIndex;\n    },\n  },\n\n  /**\n   * Gets the terrain offset property\n   * @type {TerrainOffsetProperty}\n   * @memberof GroundGeometryUpdater.prototype\n   * @readonly\n   * @private\n   */\n  terrainOffsetProperty: {\n    get: function () {\n      return this._terrainOffsetProperty;\n    },\n  },\n});\n\nGroundGeometryUpdater.prototype._isOnTerrain = function (entity, geometry) {\n  return (\n    this._fillEnabled &&\n    !defined(geometry.height) &&\n    !defined(geometry.extrudedHeight) &&\n    GroundPrimitive.isSupported(this._scene)\n  );\n};\n\nGroundGeometryUpdater.prototype._getIsClosed = function (options) {\n  const height = options.height;\n  const extrudedHeight = options.extrudedHeight;\n  return height === 0 || (defined(extrudedHeight) && extrudedHeight !== height);\n};\n\nGroundGeometryUpdater.prototype._computeCenter =\n  DeveloperError.throwInstantiationError;\n\nGroundGeometryUpdater.prototype._onEntityPropertyChanged = function (\n  entity,\n  propertyName,\n  newValue,\n  oldValue\n) {\n  GeometryUpdater.prototype._onEntityPropertyChanged.call(\n    this,\n    entity,\n    propertyName,\n    newValue,\n    oldValue\n  );\n  if (this._observedPropertyNames.indexOf(propertyName) === -1) {\n    return;\n  }\n\n  const geometry = this._entity[this._geometryPropertyName];\n  if (!defined(geometry)) {\n    return;\n  }\n  if (\n    defined(geometry.zIndex) &&\n    (defined(geometry.height) || defined(geometry.extrudedHeight))\n  ) {\n    oneTimeWarning(oneTimeWarning.geometryZIndex);\n  }\n\n  this._zIndex = defaultValue(geometry.zIndex, defaultZIndex);\n\n  if (defined(this._terrainOffsetProperty)) {\n    this._terrainOffsetProperty.destroy();\n    this._terrainOffsetProperty = undefined;\n  }\n\n  const heightReferenceProperty = geometry.heightReference;\n  const extrudedHeightReferenceProperty = geometry.extrudedHeightReference;\n\n  if (\n    defined(heightReferenceProperty) ||\n    defined(extrudedHeightReferenceProperty)\n  ) {\n    const centerPosition = new CallbackProperty(\n      this._computeCenter.bind(this),\n      !this._dynamic\n    );\n    this._terrainOffsetProperty = new TerrainOffsetProperty(\n      this._scene,\n      centerPosition,\n      heightReferenceProperty,\n      extrudedHeightReferenceProperty\n    );\n  }\n};\n\n/**\n * Destroys and resources used by the object.  Once an object is destroyed, it should not be used.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nGroundGeometryUpdater.prototype.destroy = function () {\n  if (defined(this._terrainOffsetProperty)) {\n    this._terrainOffsetProperty.destroy();\n    this._terrainOffsetProperty = undefined;\n  }\n\n  GeometryUpdater.prototype.destroy.call(this);\n};\n\n/**\n * @private\n */\nGroundGeometryUpdater.getGeometryHeight = function (height, heightReference) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"heightReference\", heightReference);\n  //>>includeEnd('debug');\n  if (!defined(height)) {\n    if (heightReference !== HeightReference.NONE) {\n      oneTimeWarning(oneTimeWarning.geometryHeightReference);\n    }\n    return;\n  }\n\n  if (heightReference !== HeightReference.CLAMP_TO_GROUND) {\n    return height;\n  }\n  return 0.0;\n};\n\n/**\n * @private\n */\nGroundGeometryUpdater.getGeometryExtrudedHeight = function (\n  extrudedHeight,\n  extrudedHeightReference\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"extrudedHeightReference\", extrudedHeightReference);\n  //>>includeEnd('debug');\n  if (!defined(extrudedHeight)) {\n    if (extrudedHeightReference !== HeightReference.NONE) {\n      oneTimeWarning(oneTimeWarning.geometryExtrudedHeightReference);\n    }\n    return;\n  }\n  if (extrudedHeightReference !== HeightReference.CLAMP_TO_GROUND) {\n    return extrudedHeight;\n  }\n\n  return GroundGeometryUpdater.CLAMP_TO_GROUND;\n};\n\n/**\n * @private\n */\nGroundGeometryUpdater.CLAMP_TO_GROUND = \"clamp\";\n\n/**\n * @private\n */\nGroundGeometryUpdater.computeGeometryOffsetAttribute = function (\n  height,\n  heightReference,\n  extrudedHeight,\n  extrudedHeightReference\n) {\n  if (!defined(height) || !defined(heightReference)) {\n    heightReference = HeightReference.NONE;\n  }\n  if (!defined(extrudedHeight) || !defined(extrudedHeightReference)) {\n    extrudedHeightReference = HeightReference.NONE;\n  }\n  let n = 0;\n  if (heightReference !== HeightReference.NONE) {\n    n++;\n  }\n  if (extrudedHeightReference === HeightReference.RELATIVE_TO_GROUND) {\n    n++;\n  }\n  if (n === 2) {\n    return GeometryOffsetAttribute.ALL;\n  }\n  if (n === 1) {\n    return GeometryOffsetAttribute.TOP;\n  }\n\n  return undefined;\n};\nexport default GroundGeometryUpdater;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport CorridorGeometry from \"../Core/CorridorGeometry.js\";\nimport CorridorOutlineGeometry from \"../Core/CorridorOutlineGeometry.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport GroundGeometryUpdater from \"./GroundGeometryUpdater.js\";\nimport Property from \"./Property.js\";\n\nconst scratchColor = new Color();\nconst defaultOffset = Cartesian3.ZERO;\nconst offsetScratch = new Cartesian3();\nconst scratchRectangle = new Rectangle();\n\nfunction CorridorGeometryOptions(entity) {\n  this.id = entity;\n  this.vertexFormat = undefined;\n  this.positions = undefined;\n  this.width = undefined;\n  this.cornerType = undefined;\n  this.height = undefined;\n  this.extrudedHeight = undefined;\n  this.granularity = undefined;\n  this.offsetAttribute = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for corridors.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias CorridorGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction CorridorGeometryUpdater(entity, scene) {\n  GroundGeometryUpdater.call(this, {\n    entity: entity,\n    scene: scene,\n    geometryOptions: new CorridorGeometryOptions(entity),\n    geometryPropertyName: \"corridor\",\n    observedPropertyNames: [\"availability\", \"corridor\"],\n  });\n\n  this._onEntityPropertyChanged(entity, \"corridor\", entity.corridor, undefined);\n}\n\nif (defined(Object.create)) {\n  CorridorGeometryUpdater.prototype = Object.create(\n    GroundGeometryUpdater.prototype\n  );\n  CorridorGeometryUpdater.prototype.constructor = CorridorGeometryUpdater;\n}\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nCorridorGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._fillEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent a filled geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n\n  const attributes = {\n    show: new ShowGeometryInstanceAttribute(\n      isAvailable &&\n        entity.isShowing &&\n        this._showProperty.getValue(time) &&\n        this._fillProperty.getValue(time)\n    ),\n    distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n      this._distanceDisplayConditionProperty.getValue(time)\n    ),\n    offset: undefined,\n    color: undefined,\n  };\n\n  if (this._materialProperty instanceof ColorMaterialProperty) {\n    let currentColor;\n    if (\n      defined(this._materialProperty.color) &&\n      (this._materialProperty.color.isConstant || isAvailable)\n    ) {\n      currentColor = this._materialProperty.color.getValue(time, scratchColor);\n    }\n    if (!defined(currentColor)) {\n      currentColor = Color.WHITE;\n    }\n    attributes.color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n  }\n\n  if (defined(this._options.offsetAttribute)) {\n    attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n      Property.getValueOrDefault(\n        this._terrainOffsetProperty,\n        time,\n        defaultOffset,\n        offsetScratch\n      )\n    );\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new CorridorGeometry(this._options),\n    attributes: attributes,\n  });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nCorridorGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n  time\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._outlineEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent an outlined geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n  const outlineColor = Property.getValueOrDefault(\n    this._outlineColorProperty,\n    time,\n    Color.BLACK,\n    scratchColor\n  );\n\n  const attributes = {\n    show: new ShowGeometryInstanceAttribute(\n      isAvailable &&\n        entity.isShowing &&\n        this._showProperty.getValue(time) &&\n        this._showOutlineProperty.getValue(time)\n    ),\n    color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n    distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n      this._distanceDisplayConditionProperty.getValue(time)\n    ),\n    offset: undefined,\n  };\n\n  if (defined(this._options.offsetAttribute)) {\n    attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n      Property.getValueOrDefault(\n        this._terrainOffsetProperty,\n        time,\n        defaultOffset,\n        offsetScratch\n      )\n    );\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new CorridorOutlineGeometry(this._options),\n    attributes: attributes,\n  });\n};\n\nCorridorGeometryUpdater.prototype._computeCenter = function (time, result) {\n  const positions = Property.getValueOrUndefined(\n    this._entity.corridor.positions,\n    time\n  );\n  if (!defined(positions) || positions.length === 0) {\n    return;\n  }\n  return Cartesian3.clone(\n    positions[Math.floor(positions.length / 2.0)],\n    result\n  );\n};\n\nCorridorGeometryUpdater.prototype._isHidden = function (entity, corridor) {\n  return (\n    !defined(corridor.positions) ||\n    !defined(corridor.width) ||\n    GeometryUpdater.prototype._isHidden.call(this, entity, corridor)\n  );\n};\n\nCorridorGeometryUpdater.prototype._isDynamic = function (entity, corridor) {\n  return (\n    !corridor.positions.isConstant || //\n    !Property.isConstant(corridor.height) || //\n    !Property.isConstant(corridor.extrudedHeight) || //\n    !Property.isConstant(corridor.granularity) || //\n    !Property.isConstant(corridor.width) || //\n    !Property.isConstant(corridor.outlineWidth) || //\n    !Property.isConstant(corridor.cornerType) || //\n    !Property.isConstant(corridor.zIndex) || //\n    (this._onTerrain &&\n      !Property.isConstant(this._materialProperty) &&\n      !(this._materialProperty instanceof ColorMaterialProperty))\n  );\n};\n\nCorridorGeometryUpdater.prototype._setStaticOptions = function (\n  entity,\n  corridor\n) {\n  let heightValue = Property.getValueOrUndefined(\n    corridor.height,\n    Iso8601.MINIMUM_VALUE\n  );\n  const heightReferenceValue = Property.getValueOrDefault(\n    corridor.heightReference,\n    Iso8601.MINIMUM_VALUE,\n    HeightReference.NONE\n  );\n  let extrudedHeightValue = Property.getValueOrUndefined(\n    corridor.extrudedHeight,\n    Iso8601.MINIMUM_VALUE\n  );\n  const extrudedHeightReferenceValue = Property.getValueOrDefault(\n    corridor.extrudedHeightReference,\n    Iso8601.MINIMUM_VALUE,\n    HeightReference.NONE\n  );\n  if (defined(extrudedHeightValue) && !defined(heightValue)) {\n    heightValue = 0;\n  }\n\n  const options = this._options;\n  options.vertexFormat =\n    this._materialProperty instanceof ColorMaterialProperty\n      ? PerInstanceColorAppearance.VERTEX_FORMAT\n      : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n  options.positions = corridor.positions.getValue(\n    Iso8601.MINIMUM_VALUE,\n    options.positions\n  );\n  options.width = corridor.width.getValue(Iso8601.MINIMUM_VALUE);\n  options.granularity = Property.getValueOrUndefined(\n    corridor.granularity,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.cornerType = Property.getValueOrUndefined(\n    corridor.cornerType,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n    heightValue,\n    heightReferenceValue,\n    extrudedHeightValue,\n    extrudedHeightReferenceValue\n  );\n  options.height = GroundGeometryUpdater.getGeometryHeight(\n    heightValue,\n    heightReferenceValue\n  );\n\n  extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n    extrudedHeightValue,\n    extrudedHeightReferenceValue\n  );\n  if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n    extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n      CorridorGeometry.computeRectangle(options, scratchRectangle)\n    ).minimumTerrainHeight;\n  }\n\n  options.extrudedHeight = extrudedHeightValue;\n};\n\nCorridorGeometryUpdater.DynamicGeometryUpdater = DynamicCorridorGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicCorridorGeometryUpdater(\n  geometryUpdater,\n  primitives,\n  groundPrimitives\n) {\n  DynamicGeometryUpdater.call(\n    this,\n    geometryUpdater,\n    primitives,\n    groundPrimitives\n  );\n}\n\nif (defined(Object.create)) {\n  DynamicCorridorGeometryUpdater.prototype = Object.create(\n    DynamicGeometryUpdater.prototype\n  );\n  DynamicCorridorGeometryUpdater.prototype.constructor = DynamicCorridorGeometryUpdater;\n}\n\nDynamicCorridorGeometryUpdater.prototype._isHidden = function (\n  entity,\n  corridor,\n  time\n) {\n  const options = this._options;\n  return (\n    !defined(options.positions) ||\n    !defined(options.width) ||\n    DynamicGeometryUpdater.prototype._isHidden.call(\n      this,\n      entity,\n      corridor,\n      time\n    )\n  );\n};\n\nDynamicCorridorGeometryUpdater.prototype._setOptions = function (\n  entity,\n  corridor,\n  time\n) {\n  const options = this._options;\n  let heightValue = Property.getValueOrUndefined(corridor.height, time);\n  const heightReferenceValue = Property.getValueOrDefault(\n    corridor.heightReference,\n    time,\n    HeightReference.NONE\n  );\n  let extrudedHeightValue = Property.getValueOrUndefined(\n    corridor.extrudedHeight,\n    time\n  );\n  const extrudedHeightReferenceValue = Property.getValueOrDefault(\n    corridor.extrudedHeightReference,\n    time,\n    HeightReference.NONE\n  );\n  if (defined(extrudedHeightValue) && !defined(heightValue)) {\n    heightValue = 0;\n  }\n\n  options.positions = Property.getValueOrUndefined(corridor.positions, time);\n  options.width = Property.getValueOrUndefined(corridor.width, time);\n  options.granularity = Property.getValueOrUndefined(\n    corridor.granularity,\n    time\n  );\n  options.cornerType = Property.getValueOrUndefined(corridor.cornerType, time);\n  options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n    heightValue,\n    heightReferenceValue,\n    extrudedHeightValue,\n    extrudedHeightReferenceValue\n  );\n  options.height = GroundGeometryUpdater.getGeometryHeight(\n    heightValue,\n    heightReferenceValue\n  );\n\n  extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n    extrudedHeightValue,\n    extrudedHeightReferenceValue\n  );\n  if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n    extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n      CorridorGeometry.computeRectangle(options, scratchRectangle)\n    ).minimumTerrainHeight;\n  }\n\n  options.extrudedHeight = extrudedHeightValue;\n};\nexport default CorridorGeometryUpdater;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * Defines the interface for data sources, which turn arbitrary data into a\n * {@link EntityCollection} for generic consumption. This object is an interface\n * for documentation purposes and is not intended to be instantiated directly.\n * @alias DataSource\n * @constructor\n *\n * @see Entity\n * @see DataSourceDisplay\n */\nfunction DataSource() {\n  DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(DataSource.prototype, {\n  /**\n   * Gets a human-readable name for this instance.\n   * @memberof DataSource.prototype\n   * @type {string}\n   */\n  name: {\n    get: DeveloperError.throwInstantiationError,\n  },\n  /**\n   * Gets the preferred clock settings for this data source.\n   * @memberof DataSource.prototype\n   * @type {DataSourceClock}\n   */\n  clock: {\n    get: DeveloperError.throwInstantiationError,\n  },\n  /**\n   * Gets the collection of {@link Entity} instances.\n   * @memberof DataSource.prototype\n   * @type {EntityCollection}\n   */\n  entities: {\n    get: DeveloperError.throwInstantiationError,\n  },\n  /**\n   * Gets a value indicating if the data source is currently loading data.\n   * @memberof DataSource.prototype\n   * @type {boolean}\n   */\n  isLoading: {\n    get: DeveloperError.throwInstantiationError,\n  },\n  /**\n   * Gets an event that will be raised when the underlying data changes.\n   * @memberof DataSource.prototype\n   * @type {Event}\n   */\n  changedEvent: {\n    get: DeveloperError.throwInstantiationError,\n  },\n  /**\n   * Gets an event that will be raised if an error is encountered during processing.\n   * @memberof DataSource.prototype\n   * @type {Event<function(this, RequestErrorEvent)>}\n   */\n  errorEvent: {\n    get: DeveloperError.throwInstantiationError,\n  },\n  /**\n   * Gets an event that will be raised when the value of isLoading changes.\n   * @memberof DataSource.prototype\n   * @type {Event<function(this, boolean)>}\n   */\n  loadingEvent: {\n    get: DeveloperError.throwInstantiationError,\n  },\n  /**\n   * Gets whether or not this data source should be displayed.\n   * @memberof DataSource.prototype\n   * @type {boolean}\n   */\n  show: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.\n   *\n   * @memberof DataSource.prototype\n   * @type {EntityCluster}\n   */\n  clustering: {\n    get: DeveloperError.throwInstantiationError,\n  },\n});\n\n/**\n * Updates the data source to the provided time.  This function is optional and\n * is not required to be implemented.  It is provided for data sources which\n * retrieve data based on the current animation time or scene state.\n * If implemented, update will be called by {@link DataSourceDisplay} once a frame.\n *\n * @param {JulianDate} time The simulation time.\n * @returns {boolean} True if this data source is ready to be displayed at the provided time, false otherwise.\n */\nDataSource.prototype.update = function (time) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * @private\n */\nDataSource.setLoading = function (dataSource, isLoading) {\n  if (dataSource._isLoading !== isLoading) {\n    if (isLoading) {\n      dataSource._entityCollection.suspendEvents();\n    } else {\n      dataSource._entityCollection.resumeEvents();\n    }\n    dataSource._isLoading = isLoading;\n    dataSource._loading.raiseEvent(dataSource, isLoading);\n  }\n};\nexport default DataSource;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Rectangle from \"./Rectangle.js\";\n\n/**\n * Determine whether or not other objects are visible or hidden behind the visible horizon defined by\n * an {@link Ellipsoid} and a camera position.  The ellipsoid is assumed to be located at the\n * origin of the coordinate system.  This class uses the algorithm described in the\n * {@link https://cesium.com/blog/2013/04/25/Horizon-culling/|Horizon Culling} blog post.\n *\n * @alias EllipsoidalOccluder\n *\n * @param {Ellipsoid} ellipsoid The ellipsoid to use as an occluder.\n * @param {Cartesian3} [cameraPosition] The coordinate of the viewer/camera.  If this parameter is not\n *        specified, {@link EllipsoidalOccluder#cameraPosition} must be called before\n *        testing visibility.\n *\n * @constructor\n *\n * @example\n * // Construct an ellipsoidal occluder with radii 1.0, 1.1, and 0.9.\n * const cameraPosition = new Cesium.Cartesian3(5.0, 6.0, 7.0);\n * const occluderEllipsoid = new Cesium.Ellipsoid(1.0, 1.1, 0.9);\n * const occluder = new Cesium.EllipsoidalOccluder(occluderEllipsoid, cameraPosition);\n *\n * @private\n */\nfunction EllipsoidalOccluder(ellipsoid, cameraPosition) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"ellipsoid\", ellipsoid);\n  //>>includeEnd('debug');\n\n  this._ellipsoid = ellipsoid;\n  this._cameraPosition = new Cartesian3();\n  this._cameraPositionInScaledSpace = new Cartesian3();\n  this._distanceToLimbInScaledSpaceSquared = 0.0;\n\n  // cameraPosition fills in the above values\n  if (defined(cameraPosition)) {\n    this.cameraPosition = cameraPosition;\n  }\n}\n\nObject.defineProperties(EllipsoidalOccluder.prototype, {\n  /**\n   * Gets the occluding ellipsoid.\n   * @memberof EllipsoidalOccluder.prototype\n   * @type {Ellipsoid}\n   */\n  ellipsoid: {\n    get: function () {\n      return this._ellipsoid;\n    },\n  },\n  /**\n   * Gets or sets the position of the camera.\n   * @memberof EllipsoidalOccluder.prototype\n   * @type {Cartesian3}\n   */\n  cameraPosition: {\n    get: function () {\n      return this._cameraPosition;\n    },\n    set: function (cameraPosition) {\n      // See https://cesium.com/blog/2013/04/25/Horizon-culling/\n      const ellipsoid = this._ellipsoid;\n      const cv = ellipsoid.transformPositionToScaledSpace(\n        cameraPosition,\n        this._cameraPositionInScaledSpace\n      );\n      const vhMagnitudeSquared = Cartesian3.magnitudeSquared(cv) - 1.0;\n\n      Cartesian3.clone(cameraPosition, this._cameraPosition);\n      this._cameraPositionInScaledSpace = cv;\n      this._distanceToLimbInScaledSpaceSquared = vhMagnitudeSquared;\n    },\n  },\n});\n\nconst scratchCartesian = new Cartesian3();\n\n/**\n * Determines whether or not a point, the <code>occludee</code>, is hidden from view by the occluder.\n *\n * @param {Cartesian3} occludee The point to test for visibility.\n * @returns {boolean} <code>true</code> if the occludee is visible; otherwise <code>false</code>.\n *\n * @example\n * const cameraPosition = new Cesium.Cartesian3(0, 0, 2.5);\n * const ellipsoid = new Cesium.Ellipsoid(1.0, 1.1, 0.9);\n * const occluder = new Cesium.EllipsoidalOccluder(ellipsoid, cameraPosition);\n * const point = new Cesium.Cartesian3(0, -3, -3);\n * occluder.isPointVisible(point); //returns true\n */\nEllipsoidalOccluder.prototype.isPointVisible = function (occludee) {\n  const ellipsoid = this._ellipsoid;\n  const occludeeScaledSpacePosition = ellipsoid.transformPositionToScaledSpace(\n    occludee,\n    scratchCartesian\n  );\n  return isScaledSpacePointVisible(\n    occludeeScaledSpacePosition,\n    this._cameraPositionInScaledSpace,\n    this._distanceToLimbInScaledSpaceSquared\n  );\n};\n\n/**\n * Determines whether or not a point expressed in the ellipsoid scaled space, is hidden from view by the\n * occluder.  To transform a Cartesian X, Y, Z position in the coordinate system aligned with the ellipsoid\n * into the scaled space, call {@link Ellipsoid#transformPositionToScaledSpace}.\n *\n * @param {Cartesian3} occludeeScaledSpacePosition The point to test for visibility, represented in the scaled space.\n * @returns {boolean} <code>true</code> if the occludee is visible; otherwise <code>false</code>.\n *\n * @example\n * const cameraPosition = new Cesium.Cartesian3(0, 0, 2.5);\n * const ellipsoid = new Cesium.Ellipsoid(1.0, 1.1, 0.9);\n * const occluder = new Cesium.EllipsoidalOccluder(ellipsoid, cameraPosition);\n * const point = new Cesium.Cartesian3(0, -3, -3);\n * const scaledSpacePoint = ellipsoid.transformPositionToScaledSpace(point);\n * occluder.isScaledSpacePointVisible(scaledSpacePoint); //returns true\n */\nEllipsoidalOccluder.prototype.isScaledSpacePointVisible = function (\n  occludeeScaledSpacePosition\n) {\n  return isScaledSpacePointVisible(\n    occludeeScaledSpacePosition,\n    this._cameraPositionInScaledSpace,\n    this._distanceToLimbInScaledSpaceSquared\n  );\n};\n\nconst scratchCameraPositionInScaledSpaceShrunk = new Cartesian3();\n\n/**\n * Similar to {@link EllipsoidalOccluder#isScaledSpacePointVisible} except tests against an\n * ellipsoid that has been shrunk by the minimum height when the minimum height is below\n * the ellipsoid. This is intended to be used with points generated by\n * {@link EllipsoidalOccluder#computeHorizonCullingPointPossiblyUnderEllipsoid} or\n * {@link EllipsoidalOccluder#computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid}.\n *\n * @param {Cartesian3} occludeeScaledSpacePosition The point to test for visibility, represented in the scaled space of the possibly-shrunk ellipsoid.\n * @returns {boolean} <code>true</code> if the occludee is visible; otherwise <code>false</code>.\n */\nEllipsoidalOccluder.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid = function (\n  occludeeScaledSpacePosition,\n  minimumHeight\n) {\n  const ellipsoid = this._ellipsoid;\n  let vhMagnitudeSquared;\n  let cv;\n\n  if (\n    defined(minimumHeight) &&\n    minimumHeight < 0.0 &&\n    ellipsoid.minimumRadius > -minimumHeight\n  ) {\n    // This code is similar to the cameraPosition setter, but unrolled for performance because it will be called a lot.\n    cv = scratchCameraPositionInScaledSpaceShrunk;\n    cv.x = this._cameraPosition.x / (ellipsoid.radii.x + minimumHeight);\n    cv.y = this._cameraPosition.y / (ellipsoid.radii.y + minimumHeight);\n    cv.z = this._cameraPosition.z / (ellipsoid.radii.z + minimumHeight);\n    vhMagnitudeSquared = cv.x * cv.x + cv.y * cv.y + cv.z * cv.z - 1.0;\n  } else {\n    cv = this._cameraPositionInScaledSpace;\n    vhMagnitudeSquared = this._distanceToLimbInScaledSpaceSquared;\n  }\n\n  return isScaledSpacePointVisible(\n    occludeeScaledSpacePosition,\n    cv,\n    vhMagnitudeSquared\n  );\n};\n\n/**\n * Computes a point that can be used for horizon culling from a list of positions.  If the point is below\n * the horizon, all of the positions are guaranteed to be below the horizon as well.  The returned point\n * is expressed in the ellipsoid-scaled space and is suitable for use with\n * {@link EllipsoidalOccluder#isScaledSpacePointVisible}.\n *\n * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.\n *                     A reasonable direction to use is the direction from the center of the ellipsoid to\n *                     the center of the bounding sphere computed from the positions.  The direction need not\n *                     be normalized.\n * @param {Cartesian3[]} positions The positions from which to compute the horizon culling point.  The positions\n *                       must be expressed in a reference frame centered at the ellipsoid and aligned with the\n *                       ellipsoid's axes.\n * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.\n * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space.\n */\nEllipsoidalOccluder.prototype.computeHorizonCullingPoint = function (\n  directionToPoint,\n  positions,\n  result\n) {\n  return computeHorizonCullingPointFromPositions(\n    this._ellipsoid,\n    directionToPoint,\n    positions,\n    result\n  );\n};\n\nconst scratchEllipsoidShrunk = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\n\n/**\n * Similar to {@link EllipsoidalOccluder#computeHorizonCullingPoint} except computes the culling\n * point relative to an ellipsoid that has been shrunk by the minimum height when the minimum height is below\n * the ellipsoid. The returned point is expressed in the possibly-shrunk ellipsoid-scaled space and is suitable\n * for use with {@link EllipsoidalOccluder#isScaledSpacePointVisiblePossiblyUnderEllipsoid}.\n *\n * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.\n *                     A reasonable direction to use is the direction from the center of the ellipsoid to\n *                     the center of the bounding sphere computed from the positions.  The direction need not\n *                     be normalized.\n * @param {Cartesian3[]} positions The positions from which to compute the horizon culling point.  The positions\n *                       must be expressed in a reference frame centered at the ellipsoid and aligned with the\n *                       ellipsoid's axes.\n * @param {number} [minimumHeight] The minimum height of all positions. If this value is undefined, all positions are assumed to be above the ellipsoid.\n * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.\n * @returns {Cartesian3} The computed horizon culling point, expressed in the possibly-shrunk ellipsoid-scaled space.\n */\nEllipsoidalOccluder.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid = function (\n  directionToPoint,\n  positions,\n  minimumHeight,\n  result\n) {\n  const possiblyShrunkEllipsoid = getPossiblyShrunkEllipsoid(\n    this._ellipsoid,\n    minimumHeight,\n    scratchEllipsoidShrunk\n  );\n  return computeHorizonCullingPointFromPositions(\n    possiblyShrunkEllipsoid,\n    directionToPoint,\n    positions,\n    result\n  );\n};\n/**\n * Computes a point that can be used for horizon culling from a list of positions.  If the point is below\n * the horizon, all of the positions are guaranteed to be below the horizon as well.  The returned point\n * is expressed in the ellipsoid-scaled space and is suitable for use with\n * {@link EllipsoidalOccluder#isScaledSpacePointVisible}.\n *\n * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.\n *                     A reasonable direction to use is the direction from the center of the ellipsoid to\n *                     the center of the bounding sphere computed from the positions.  The direction need not\n *                     be normalized.\n * @param {number[]} vertices  The vertices from which to compute the horizon culling point.  The positions\n *                   must be expressed in a reference frame centered at the ellipsoid and aligned with the\n *                   ellipsoid's axes.\n * @param {number} [stride=3]\n * @param {Cartesian3} [center=Cartesian3.ZERO]\n * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.\n * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space.\n */\nEllipsoidalOccluder.prototype.computeHorizonCullingPointFromVertices = function (\n  directionToPoint,\n  vertices,\n  stride,\n  center,\n  result\n) {\n  return computeHorizonCullingPointFromVertices(\n    this._ellipsoid,\n    directionToPoint,\n    vertices,\n    stride,\n    center,\n    result\n  );\n};\n\n/**\n * Similar to {@link EllipsoidalOccluder#computeHorizonCullingPointFromVertices} except computes the culling\n * point relative to an ellipsoid that has been shrunk by the minimum height when the minimum height is below\n * the ellipsoid. The returned point is expressed in the possibly-shrunk ellipsoid-scaled space and is suitable\n * for use with {@link EllipsoidalOccluder#isScaledSpacePointVisiblePossiblyUnderEllipsoid}.\n *\n * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.\n *                     A reasonable direction to use is the direction from the center of the ellipsoid to\n *                     the center of the bounding sphere computed from the positions.  The direction need not\n *                     be normalized.\n * @param {number[]} vertices  The vertices from which to compute the horizon culling point.  The positions\n *                   must be expressed in a reference frame centered at the ellipsoid and aligned with the\n *                   ellipsoid's axes.\n * @param {number} [stride=3]\n * @param {Cartesian3} [center=Cartesian3.ZERO]\n * @param {number} [minimumHeight] The minimum height of all vertices. If this value is undefined, all vertices are assumed to be above the ellipsoid.\n * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.\n * @returns {Cartesian3} The computed horizon culling point, expressed in the possibly-shrunk ellipsoid-scaled space.\n */\nEllipsoidalOccluder.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid = function (\n  directionToPoint,\n  vertices,\n  stride,\n  center,\n  minimumHeight,\n  result\n) {\n  const possiblyShrunkEllipsoid = getPossiblyShrunkEllipsoid(\n    this._ellipsoid,\n    minimumHeight,\n    scratchEllipsoidShrunk\n  );\n  return computeHorizonCullingPointFromVertices(\n    possiblyShrunkEllipsoid,\n    directionToPoint,\n    vertices,\n    stride,\n    center,\n    result\n  );\n};\n\nconst subsampleScratch = [];\n\n/**\n * Computes a point that can be used for horizon culling of a rectangle.  If the point is below\n * the horizon, the ellipsoid-conforming rectangle is guaranteed to be below the horizon as well.\n * The returned point is expressed in the ellipsoid-scaled space and is suitable for use with\n * {@link EllipsoidalOccluder#isScaledSpacePointVisible}.\n *\n * @param {Rectangle} rectangle The rectangle for which to compute the horizon culling point.\n * @param {Ellipsoid} ellipsoid The ellipsoid on which the rectangle is defined.  This may be different from\n *                    the ellipsoid used by this instance for occlusion testing.\n * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.\n * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space.\n */\nEllipsoidalOccluder.prototype.computeHorizonCullingPointFromRectangle = function (\n  rectangle,\n  ellipsoid,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  //>>includeEnd('debug');\n\n  const positions = Rectangle.subsample(\n    rectangle,\n    ellipsoid,\n    0.0,\n    subsampleScratch\n  );\n  const bs = BoundingSphere.fromPoints(positions);\n\n  // If the bounding sphere center is too close to the center of the occluder, it doesn't make\n  // sense to try to horizon cull it.\n  if (Cartesian3.magnitude(bs.center) < 0.1 * ellipsoid.minimumRadius) {\n    return undefined;\n  }\n\n  return this.computeHorizonCullingPoint(bs.center, positions, result);\n};\n\nconst scratchEllipsoidShrunkRadii = new Cartesian3();\n\nfunction getPossiblyShrunkEllipsoid(ellipsoid, minimumHeight, result) {\n  if (\n    defined(minimumHeight) &&\n    minimumHeight < 0.0 &&\n    ellipsoid.minimumRadius > -minimumHeight\n  ) {\n    const ellipsoidShrunkRadii = Cartesian3.fromElements(\n      ellipsoid.radii.x + minimumHeight,\n      ellipsoid.radii.y + minimumHeight,\n      ellipsoid.radii.z + minimumHeight,\n      scratchEllipsoidShrunkRadii\n    );\n    ellipsoid = Ellipsoid.fromCartesian3(ellipsoidShrunkRadii, result);\n  }\n  return ellipsoid;\n}\n\nfunction computeHorizonCullingPointFromPositions(\n  ellipsoid,\n  directionToPoint,\n  positions,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"directionToPoint\", directionToPoint);\n  Check.defined(\"positions\", positions);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  const scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint(\n    ellipsoid,\n    directionToPoint\n  );\n  let resultMagnitude = 0.0;\n\n  for (let i = 0, len = positions.length; i < len; ++i) {\n    const position = positions[i];\n    const candidateMagnitude = computeMagnitude(\n      ellipsoid,\n      position,\n      scaledSpaceDirectionToPoint\n    );\n    if (candidateMagnitude < 0.0) {\n      // all points should face the same direction, but this one doesn't, so return undefined\n      return undefined;\n    }\n    resultMagnitude = Math.max(resultMagnitude, candidateMagnitude);\n  }\n\n  return magnitudeToPoint(scaledSpaceDirectionToPoint, resultMagnitude, result);\n}\n\nconst positionScratch = new Cartesian3();\n\nfunction computeHorizonCullingPointFromVertices(\n  ellipsoid,\n  directionToPoint,\n  vertices,\n  stride,\n  center,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"directionToPoint\", directionToPoint);\n  Check.defined(\"vertices\", vertices);\n  Check.typeOf.number(\"stride\", stride);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  stride = defaultValue(stride, 3);\n  center = defaultValue(center, Cartesian3.ZERO);\n  const scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint(\n    ellipsoid,\n    directionToPoint\n  );\n  let resultMagnitude = 0.0;\n\n  for (let i = 0, len = vertices.length; i < len; i += stride) {\n    positionScratch.x = vertices[i] + center.x;\n    positionScratch.y = vertices[i + 1] + center.y;\n    positionScratch.z = vertices[i + 2] + center.z;\n\n    const candidateMagnitude = computeMagnitude(\n      ellipsoid,\n      positionScratch,\n      scaledSpaceDirectionToPoint\n    );\n    if (candidateMagnitude < 0.0) {\n      // all points should face the same direction, but this one doesn't, so return undefined\n      return undefined;\n    }\n    resultMagnitude = Math.max(resultMagnitude, candidateMagnitude);\n  }\n\n  return magnitudeToPoint(scaledSpaceDirectionToPoint, resultMagnitude, result);\n}\n\nfunction isScaledSpacePointVisible(\n  occludeeScaledSpacePosition,\n  cameraPositionInScaledSpace,\n  distanceToLimbInScaledSpaceSquared\n) {\n  // See https://cesium.com/blog/2013/04/25/Horizon-culling/\n  const cv = cameraPositionInScaledSpace;\n  const vhMagnitudeSquared = distanceToLimbInScaledSpaceSquared;\n  const vt = Cartesian3.subtract(\n    occludeeScaledSpacePosition,\n    cv,\n    scratchCartesian\n  );\n  const vtDotVc = -Cartesian3.dot(vt, cv);\n  // If vhMagnitudeSquared < 0 then we are below the surface of the ellipsoid and\n  // in this case, set the culling plane to be on V.\n  const isOccluded =\n    vhMagnitudeSquared < 0\n      ? vtDotVc > 0\n      : vtDotVc > vhMagnitudeSquared &&\n        (vtDotVc * vtDotVc) / Cartesian3.magnitudeSquared(vt) >\n          vhMagnitudeSquared;\n  return !isOccluded;\n}\n\nconst scaledSpaceScratch = new Cartesian3();\nconst directionScratch = new Cartesian3();\n\nfunction computeMagnitude(ellipsoid, position, scaledSpaceDirectionToPoint) {\n  const scaledSpacePosition = ellipsoid.transformPositionToScaledSpace(\n    position,\n    scaledSpaceScratch\n  );\n  let magnitudeSquared = Cartesian3.magnitudeSquared(scaledSpacePosition);\n  let magnitude = Math.sqrt(magnitudeSquared);\n  const direction = Cartesian3.divideByScalar(\n    scaledSpacePosition,\n    magnitude,\n    directionScratch\n  );\n\n  // For the purpose of this computation, points below the ellipsoid are consider to be on it instead.\n  magnitudeSquared = Math.max(1.0, magnitudeSquared);\n  magnitude = Math.max(1.0, magnitude);\n\n  const cosAlpha = Cartesian3.dot(direction, scaledSpaceDirectionToPoint);\n  const sinAlpha = Cartesian3.magnitude(\n    Cartesian3.cross(direction, scaledSpaceDirectionToPoint, direction)\n  );\n  const cosBeta = 1.0 / magnitude;\n  const sinBeta = Math.sqrt(magnitudeSquared - 1.0) * cosBeta;\n\n  return 1.0 / (cosAlpha * cosBeta - sinAlpha * sinBeta);\n}\n\nfunction magnitudeToPoint(\n  scaledSpaceDirectionToPoint,\n  resultMagnitude,\n  result\n) {\n  // The horizon culling point is undefined if there were no positions from which to compute it,\n  // the directionToPoint is pointing opposite all of the positions,  or if we computed NaN or infinity.\n  if (\n    resultMagnitude <= 0.0 ||\n    resultMagnitude === 1.0 / 0.0 ||\n    resultMagnitude !== resultMagnitude\n  ) {\n    return undefined;\n  }\n\n  return Cartesian3.multiplyByScalar(\n    scaledSpaceDirectionToPoint,\n    resultMagnitude,\n    result\n  );\n}\n\nconst directionToPointScratch = new Cartesian3();\n\nfunction computeScaledSpaceDirectionToPoint(ellipsoid, directionToPoint) {\n  if (Cartesian3.equals(directionToPoint, Cartesian3.ZERO)) {\n    return directionToPoint;\n  }\n\n  ellipsoid.transformPositionToScaledSpace(\n    directionToPoint,\n    directionToPointScratch\n  );\n  return Cartesian3.normalize(directionToPointScratch, directionToPointScratch);\n}\nexport default EllipsoidalOccluder;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport SceneTransforms from \"./SceneTransforms.js\";\n\n/**\n * <div class=\"notice\">\n * A point is created and its initial properties are set by calling {@link PointPrimitiveCollection#add}. Do not call the constructor directly.\n * </div>\n * A graphical point positioned in the 3D scene, that is created\n * and rendered using a {@link PointPrimitiveCollection}.\n *\n * @alias PointPrimitive\n *\n * @performance Reading a property, e.g., {@link PointPrimitive#show}, is constant time.\n * Assigning to a property is constant time but results in\n * CPU to GPU traffic when {@link PointPrimitiveCollection#update} is called.  The per-pointPrimitive traffic is\n * the same regardless of how many properties were updated.  If most pointPrimitives in a collection need to be\n * updated, it may be more efficient to clear the collection with {@link PointPrimitiveCollection#removeAll}\n * and add new pointPrimitives instead of modifying each one.\n *\n * @exception {DeveloperError} scaleByDistance.far must be greater than scaleByDistance.near\n * @exception {DeveloperError} translucencyByDistance.far must be greater than translucencyByDistance.near\n * @exception {DeveloperError} distanceDisplayCondition.far must be greater than distanceDisplayCondition.near\n *\n * @see PointPrimitiveCollection\n * @see PointPrimitiveCollection#add\n *\n * @internalConstructor\n * @class\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Points.html|Cesium Sandcastle Points Demo}\n */\nfunction PointPrimitive(options, pointPrimitiveCollection) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    defined(options.disableDepthTestDistance) &&\n    options.disableDepthTestDistance < 0.0\n  ) {\n    throw new DeveloperError(\n      \"disableDepthTestDistance must be greater than or equal to 0.0.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  let translucencyByDistance = options.translucencyByDistance;\n  let scaleByDistance = options.scaleByDistance;\n  let distanceDisplayCondition = options.distanceDisplayCondition;\n  if (defined(translucencyByDistance)) {\n    //>>includeStart('debug', pragmas.debug);\n    if (translucencyByDistance.far <= translucencyByDistance.near) {\n      throw new DeveloperError(\n        \"translucencyByDistance.far must be greater than translucencyByDistance.near.\"\n      );\n    }\n    //>>includeEnd('debug');\n    translucencyByDistance = NearFarScalar.clone(translucencyByDistance);\n  }\n  if (defined(scaleByDistance)) {\n    //>>includeStart('debug', pragmas.debug);\n    if (scaleByDistance.far <= scaleByDistance.near) {\n      throw new DeveloperError(\n        \"scaleByDistance.far must be greater than scaleByDistance.near.\"\n      );\n    }\n    //>>includeEnd('debug');\n    scaleByDistance = NearFarScalar.clone(scaleByDistance);\n  }\n  if (defined(distanceDisplayCondition)) {\n    //>>includeStart('debug', pragmas.debug);\n    if (distanceDisplayCondition.far <= distanceDisplayCondition.near) {\n      throw new DeveloperError(\n        \"distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.\"\n      );\n    }\n    //>>includeEnd('debug');\n    distanceDisplayCondition = DistanceDisplayCondition.clone(\n      distanceDisplayCondition\n    );\n  }\n\n  this._show = defaultValue(options.show, true);\n  this._position = Cartesian3.clone(\n    defaultValue(options.position, Cartesian3.ZERO)\n  );\n  this._actualPosition = Cartesian3.clone(this._position); // For columbus view and 2D\n  this._color = Color.clone(defaultValue(options.color, Color.WHITE));\n  this._outlineColor = Color.clone(\n    defaultValue(options.outlineColor, Color.TRANSPARENT)\n  );\n  this._outlineWidth = defaultValue(options.outlineWidth, 0.0);\n  this._pixelSize = defaultValue(options.pixelSize, 10.0);\n  this._scaleByDistance = scaleByDistance;\n  this._translucencyByDistance = translucencyByDistance;\n  this._distanceDisplayCondition = distanceDisplayCondition;\n  this._disableDepthTestDistance = defaultValue(\n    options.disableDepthTestDistance,\n    0.0\n  );\n  this._id = options.id;\n  this._collection = defaultValue(options.collection, pointPrimitiveCollection);\n\n  this._clusterShow = true;\n\n  this._pickId = undefined;\n  this._pointPrimitiveCollection = pointPrimitiveCollection;\n  this._dirty = false;\n  this._index = -1; //Used only by PointPrimitiveCollection\n}\n\nconst SHOW_INDEX = (PointPrimitive.SHOW_INDEX = 0);\nconst POSITION_INDEX = (PointPrimitive.POSITION_INDEX = 1);\nconst COLOR_INDEX = (PointPrimitive.COLOR_INDEX = 2);\nconst OUTLINE_COLOR_INDEX = (PointPrimitive.OUTLINE_COLOR_INDEX = 3);\nconst OUTLINE_WIDTH_INDEX = (PointPrimitive.OUTLINE_WIDTH_INDEX = 4);\nconst PIXEL_SIZE_INDEX = (PointPrimitive.PIXEL_SIZE_INDEX = 5);\nconst SCALE_BY_DISTANCE_INDEX = (PointPrimitive.SCALE_BY_DISTANCE_INDEX = 6);\nconst TRANSLUCENCY_BY_DISTANCE_INDEX = (PointPrimitive.TRANSLUCENCY_BY_DISTANCE_INDEX = 7);\nconst DISTANCE_DISPLAY_CONDITION_INDEX = (PointPrimitive.DISTANCE_DISPLAY_CONDITION_INDEX = 8);\nconst DISABLE_DEPTH_DISTANCE_INDEX = (PointPrimitive.DISABLE_DEPTH_DISTANCE_INDEX = 9);\nPointPrimitive.NUMBER_OF_PROPERTIES = 10;\n\nfunction makeDirty(pointPrimitive, propertyChanged) {\n  const pointPrimitiveCollection = pointPrimitive._pointPrimitiveCollection;\n  if (defined(pointPrimitiveCollection)) {\n    pointPrimitiveCollection._updatePointPrimitive(\n      pointPrimitive,\n      propertyChanged\n    );\n    pointPrimitive._dirty = true;\n  }\n}\n\nObject.defineProperties(PointPrimitive.prototype, {\n  /**\n   * Determines if this point will be shown.  Use this to hide or show a point, instead\n   * of removing it and re-adding it to the collection.\n   * @memberof PointPrimitive.prototype\n   * @type {boolean}\n   */\n  show: {\n    get: function () {\n      return this._show;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (this._show !== value) {\n        this._show = value;\n        makeDirty(this, SHOW_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the Cartesian position of this point.\n   * @memberof PointPrimitive.prototype\n   * @type {Cartesian3}\n   */\n  position: {\n    get: function () {\n      return this._position;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug)\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      const position = this._position;\n      if (!Cartesian3.equals(position, value)) {\n        Cartesian3.clone(value, position);\n        Cartesian3.clone(value, this._actualPosition);\n\n        makeDirty(this, POSITION_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets near and far scaling properties of a point based on the point's distance from the camera.\n   * A point's scale will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the point's scale remains clamped to the nearest bound.  This scale\n   * multiplies the pixelSize and outlineWidth to affect the total size of the point.  If undefined,\n   * scaleByDistance will be disabled.\n   * @memberof PointPrimitive.prototype\n   * @type {NearFarScalar}\n   *\n   * @example\n   * // Example 1.\n   * // Set a pointPrimitive's scaleByDistance to scale to 15 when the\n   * // camera is 1500 meters from the pointPrimitive and disappear as\n   * // the camera distance approaches 8.0e6 meters.\n   * p.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 15, 8.0e6, 0.0);\n   *\n   * @example\n   * // Example 2.\n   * // disable scaling by distance\n   * p.scaleByDistance = undefined;\n   */\n  scaleByDistance: {\n    get: function () {\n      return this._scaleByDistance;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value) && value.far <= value.near) {\n        throw new DeveloperError(\n          \"far distance must be greater than near distance.\"\n        );\n      }\n      //>>includeEnd('debug');\n\n      const scaleByDistance = this._scaleByDistance;\n      if (!NearFarScalar.equals(scaleByDistance, value)) {\n        this._scaleByDistance = NearFarScalar.clone(value, scaleByDistance);\n        makeDirty(this, SCALE_BY_DISTANCE_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets near and far translucency properties of a point based on the point's distance from the camera.\n   * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the point's translucency remains clamped to the nearest bound.  If undefined,\n   * translucencyByDistance will be disabled.\n   * @memberof PointPrimitive.prototype\n   * @type {NearFarScalar}\n   *\n   * @example\n   * // Example 1.\n   * // Set a point's translucency to 1.0 when the\n   * // camera is 1500 meters from the point and disappear as\n   * // the camera distance approaches 8.0e6 meters.\n   * p.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);\n   *\n   * @example\n   * // Example 2.\n   * // disable translucency by distance\n   * p.translucencyByDistance = undefined;\n   */\n  translucencyByDistance: {\n    get: function () {\n      return this._translucencyByDistance;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value) && value.far <= value.near) {\n        throw new DeveloperError(\n          \"far distance must be greater than near distance.\"\n        );\n      }\n      //>>includeEnd('debug');\n\n      const translucencyByDistance = this._translucencyByDistance;\n      if (!NearFarScalar.equals(translucencyByDistance, value)) {\n        this._translucencyByDistance = NearFarScalar.clone(\n          value,\n          translucencyByDistance\n        );\n        makeDirty(this, TRANSLUCENCY_BY_DISTANCE_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the inner size of the point in pixels.\n   * @memberof PointPrimitive.prototype\n   * @type {number}\n   */\n  pixelSize: {\n    get: function () {\n      return this._pixelSize;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (this._pixelSize !== value) {\n        this._pixelSize = value;\n        makeDirty(this, PIXEL_SIZE_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the inner color of the point.\n   * The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,\n   * <code>blue</code>, and <code>alpha</code> properties as shown in Example 1.  These components range from <code>0.0</code>\n   * (no intensity) to <code>1.0</code> (full intensity).\n   * @memberof PointPrimitive.prototype\n   * @type {Color}\n   *\n   * @example\n   * // Example 1. Assign yellow.\n   * p.color = Cesium.Color.YELLOW;\n   *\n   * @example\n   * // Example 2. Make a pointPrimitive 50% translucent.\n   * p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);\n   */\n  color: {\n    get: function () {\n      return this._color;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      const color = this._color;\n      if (!Color.equals(color, value)) {\n        Color.clone(value, color);\n        makeDirty(this, COLOR_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the outline color of the point.\n   * @memberof PointPrimitive.prototype\n   * @type {Color}\n   */\n  outlineColor: {\n    get: function () {\n      return this._outlineColor;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      const outlineColor = this._outlineColor;\n      if (!Color.equals(outlineColor, value)) {\n        Color.clone(value, outlineColor);\n        makeDirty(this, OUTLINE_COLOR_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the outline width in pixels.  This width adds to pixelSize,\n   * increasing the total size of the point.\n   * @memberof PointPrimitive.prototype\n   * @type {number}\n   */\n  outlineWidth: {\n    get: function () {\n      return this._outlineWidth;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (this._outlineWidth !== value) {\n        this._outlineWidth = value;\n        makeDirty(this, OUTLINE_WIDTH_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the condition specifying at what distance from the camera that this point will be displayed.\n   * @memberof PointPrimitive.prototype\n   * @type {DistanceDisplayCondition}\n   * @default undefined\n   */\n  distanceDisplayCondition: {\n    get: function () {\n      return this._distanceDisplayCondition;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value) && value.far <= value.near) {\n        throw new DeveloperError(\"far must be greater than near\");\n      }\n      //>>includeEnd('debug');\n      if (\n        !DistanceDisplayCondition.equals(this._distanceDisplayCondition, value)\n      ) {\n        this._distanceDisplayCondition = DistanceDisplayCondition.clone(\n          value,\n          this._distanceDisplayCondition\n        );\n        makeDirty(this, DISTANCE_DISPLAY_CONDITION_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.\n   * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.\n   * @memberof PointPrimitive.prototype\n   * @type {number}\n   * @default 0.0\n   */\n  disableDepthTestDistance: {\n    get: function () {\n      return this._disableDepthTestDistance;\n    },\n    set: function (value) {\n      if (this._disableDepthTestDistance !== value) {\n        //>>includeStart('debug', pragmas.debug);\n        if (!defined(value) || value < 0.0) {\n          throw new DeveloperError(\n            \"disableDepthTestDistance must be greater than or equal to 0.0.\"\n          );\n        }\n        //>>includeEnd('debug');\n        this._disableDepthTestDistance = value;\n        makeDirty(this, DISABLE_DEPTH_DISTANCE_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the user-defined value returned when the point is picked.\n   * @memberof PointPrimitive.prototype\n   * @type {*}\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n    set: function (value) {\n      this._id = value;\n      if (defined(this._pickId)) {\n        this._pickId.object.id = value;\n      }\n    },\n  },\n\n  /**\n   * @private\n   */\n  pickId: {\n    get: function () {\n      return this._pickId;\n    },\n  },\n\n  /**\n   * Determines whether or not this point will be shown or hidden because it was clustered.\n   * @memberof PointPrimitive.prototype\n   * @type {boolean}\n   * @private\n   */\n  clusterShow: {\n    get: function () {\n      return this._clusterShow;\n    },\n    set: function (value) {\n      if (this._clusterShow !== value) {\n        this._clusterShow = value;\n        makeDirty(this, SHOW_INDEX);\n      }\n    },\n  },\n});\n\nPointPrimitive.prototype.getPickId = function (context) {\n  if (!defined(this._pickId)) {\n    this._pickId = context.createPickId({\n      primitive: this,\n      collection: this._collection,\n      id: this._id,\n    });\n  }\n\n  return this._pickId;\n};\n\nPointPrimitive.prototype._getActualPosition = function () {\n  return this._actualPosition;\n};\n\nPointPrimitive.prototype._setActualPosition = function (value) {\n  Cartesian3.clone(value, this._actualPosition);\n  makeDirty(this, POSITION_INDEX);\n};\n\nconst tempCartesian3 = new Cartesian4();\nPointPrimitive._computeActualPosition = function (\n  position,\n  frameState,\n  modelMatrix\n) {\n  if (frameState.mode === SceneMode.SCENE3D) {\n    return position;\n  }\n\n  Matrix4.multiplyByPoint(modelMatrix, position, tempCartesian3);\n  return SceneTransforms.computeActualWgs84Position(frameState, tempCartesian3);\n};\n\nconst scratchCartesian4 = new Cartesian4();\n\n// This function is basically a stripped-down JavaScript version of PointPrimitiveCollectionVS.glsl\nPointPrimitive._computeScreenSpacePosition = function (\n  modelMatrix,\n  position,\n  scene,\n  result\n) {\n  // Model to world coordinates\n  const positionWorld = Matrix4.multiplyByVector(\n    modelMatrix,\n    Cartesian4.fromElements(\n      position.x,\n      position.y,\n      position.z,\n      1,\n      scratchCartesian4\n    ),\n    scratchCartesian4\n  );\n  const positionWC = SceneTransforms.wgs84ToWindowCoordinates(\n    scene,\n    positionWorld,\n    result\n  );\n  return positionWC;\n};\n\n/**\n * Computes the screen-space position of the point's origin.\n * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from\n * left to right, and <code>y</code> increases from top to bottom.\n *\n * @param {Scene} scene The scene.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The screen-space position of the point.\n *\n * @exception {DeveloperError} PointPrimitive must be in a collection.\n *\n * @example\n * console.log(p.computeScreenSpacePosition(scene).toString());\n */\nPointPrimitive.prototype.computeScreenSpacePosition = function (scene, result) {\n  const pointPrimitiveCollection = this._pointPrimitiveCollection;\n  if (!defined(result)) {\n    result = new Cartesian2();\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(pointPrimitiveCollection)) {\n    throw new DeveloperError(\"PointPrimitive must be in a collection.\");\n  }\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const modelMatrix = pointPrimitiveCollection.modelMatrix;\n  const windowCoordinates = PointPrimitive._computeScreenSpacePosition(\n    modelMatrix,\n    this._actualPosition,\n    scene,\n    result\n  );\n  if (!defined(windowCoordinates)) {\n    return undefined;\n  }\n\n  windowCoordinates.y = scene.canvas.clientHeight - windowCoordinates.y;\n  return windowCoordinates;\n};\n\n/**\n * Gets a point's screen space bounding box centered around screenSpacePosition.\n * @param {PointPrimitive} point The point to get the screen space bounding box for.\n * @param {Cartesian2} screenSpacePosition The screen space center of the label.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The screen space bounding box.\n *\n * @private\n */\nPointPrimitive.getScreenSpaceBoundingBox = function (\n  point,\n  screenSpacePosition,\n  result\n) {\n  const size = point.pixelSize;\n  const halfSize = size * 0.5;\n\n  const x = screenSpacePosition.x - halfSize;\n  const y = screenSpacePosition.y - halfSize;\n  const width = size;\n  const height = size;\n\n  if (!defined(result)) {\n    result = new BoundingRectangle();\n  }\n\n  result.x = x;\n  result.y = y;\n  result.width = width;\n  result.height = height;\n\n  return result;\n};\n\n/**\n * Determines if this point equals another point.  Points are equal if all their properties\n * are equal.  Points in different collections can be equal.\n *\n * @param {PointPrimitive} other The point to compare for equality.\n * @returns {boolean} <code>true</code> if the points are equal; otherwise, <code>false</code>.\n */\nPointPrimitive.prototype.equals = function (other) {\n  return (\n    this === other ||\n    (defined(other) &&\n      this._id === other._id &&\n      Cartesian3.equals(this._position, other._position) &&\n      Color.equals(this._color, other._color) &&\n      this._pixelSize === other._pixelSize &&\n      this._outlineWidth === other._outlineWidth &&\n      this._show === other._show &&\n      Color.equals(this._outlineColor, other._outlineColor) &&\n      NearFarScalar.equals(this._scaleByDistance, other._scaleByDistance) &&\n      NearFarScalar.equals(\n        this._translucencyByDistance,\n        other._translucencyByDistance\n      ) &&\n      DistanceDisplayCondition.equals(\n        this._distanceDisplayCondition,\n        other._distanceDisplayCondition\n      ) &&\n      this._disableDepthTestDistance === other._disableDepthTestDistance)\n  );\n};\n\nPointPrimitive.prototype._destroy = function () {\n  this._pickId = this._pickId && this._pickId.destroy();\n  this._pointPrimitiveCollection = undefined;\n};\nexport default PointPrimitive;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec4 v_color;\\n\\\nin vec4 v_outlineColor;\\n\\\nin float v_innerPercent;\\n\\\nin float v_pixelDistance;\\n\\\nin vec4 v_pickColor;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    // The distance in UV space from this fragment to the center of the point, at most 0.5.\\n\\\n    float distanceToCenter = length(gl_PointCoord - vec2(0.5));\\n\\\n    // The max distance stops one pixel shy of the edge to leave space for anti-aliasing.\\n\\\n    float maxDistance = max(0.0, 0.5 - v_pixelDistance);\\n\\\n    float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\\n\\\n    float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\\n\\\n\\n\\\n    vec4 color = mix(v_outlineColor, v_color, innerAlpha);\\n\\\n    color.a *= wholeAlpha;\\n\\\n\\n\\\n// Fully transparent parts of the billboard are not pickable.\\n\\\n#if !defined(OPAQUE) && !defined(TRANSLUCENT)\\n\\\n    if (color.a < 0.005)   // matches 0/255 and 1/255\\n\\\n    {\\n\\\n        discard;\\n\\\n    }\\n\\\n#else\\n\\\n// The billboard is rendered twice. The opaque pass discards translucent fragments\\n\\\n// and the translucent pass discards opaque fragments.\\n\\\n#ifdef OPAQUE\\n\\\n    if (color.a < 0.995)   // matches < 254/255\\n\\\n    {\\n\\\n        discard;\\n\\\n    }\\n\\\n#else\\n\\\n    if (color.a >= 0.995)  // matches 254/255 and 255/255\\n\\\n    {\\n\\\n        discard;\\n\\\n    }\\n\\\n#endif\\n\\\n#endif\\n\\\n\\n\\\n    out_FragColor = czm_gammaCorrect(color);\\n\\\n    czm_writeLogDepth();\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform float u_maxTotalPointSize;\\n\\\n\\n\\\nin vec4 positionHighAndSize;\\n\\\nin vec4 positionLowAndOutline;\\n\\\nin vec4 compressedAttribute0;                       // color, outlineColor, pick color\\n\\\nin vec4 compressedAttribute1;                       // show, translucency by distance, some free space\\n\\\nin vec4 scaleByDistance;                            // near, nearScale, far, farScale\\n\\\nin vec3 distanceDisplayConditionAndDisableDepth;    // near, far, disableDepthTestDistance\\n\\\n\\n\\\nout vec4 v_color;\\n\\\nout vec4 v_outlineColor;\\n\\\nout float v_innerPercent;\\n\\\nout float v_pixelDistance;\\n\\\nout vec4 v_pickColor;\\n\\\n\\n\\\nconst float SHIFT_LEFT8 = 256.0;\\n\\\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition\\n\\\n\\n\\\n    // unpack attributes\\n\\\n    vec3 positionHigh = positionHighAndSize.xyz;\\n\\\n    vec3 positionLow = positionLowAndOutline.xyz;\\n\\\n    float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;\\n\\\n    float totalSize = positionHighAndSize.w + outlineWidthBothSides;\\n\\\n    float outlinePercent = outlineWidthBothSides / totalSize;\\n\\\n    // Scale in response to browser-zoom.\\n\\\n    totalSize *= czm_pixelRatio;\\n\\\n\\n\\\n    float temp = compressedAttribute1.x * SHIFT_RIGHT8;\\n\\\n    float show = floor(temp);\\n\\\n\\n\\\n#ifdef EYE_DISTANCE_TRANSLUCENCY\\n\\\n    vec4 translucencyByDistance;\\n\\\n    translucencyByDistance.x = compressedAttribute1.z;\\n\\\n    translucencyByDistance.z = compressedAttribute1.w;\\n\\\n\\n\\\n    translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\\n\\\n\\n\\\n    temp = compressedAttribute1.y * SHIFT_RIGHT8;\\n\\\n    translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\\n\\\n#endif\\n\\\n\\n\\\n    ///////////////////////////////////////////////////////////////////////////\\n\\\n\\n\\\n    vec4 color;\\n\\\n    vec4 outlineColor;\\n\\\n    vec4 pickColor;\\n\\\n\\n\\\n    // compressedAttribute0.z => pickColor.rgb\\n\\\n\\n\\\n    temp = compressedAttribute0.z * SHIFT_RIGHT8;\\n\\\n    pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    temp = floor(temp) * SHIFT_RIGHT8;\\n\\\n    pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    pickColor.r = floor(temp);\\n\\\n\\n\\\n    // compressedAttribute0.x => color.rgb\\n\\\n\\n\\\n    temp = compressedAttribute0.x * SHIFT_RIGHT8;\\n\\\n    color.b = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    temp = floor(temp) * SHIFT_RIGHT8;\\n\\\n    color.g = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    color.r = floor(temp);\\n\\\n\\n\\\n    // compressedAttribute0.y => outlineColor.rgb\\n\\\n\\n\\\n    temp = compressedAttribute0.y * SHIFT_RIGHT8;\\n\\\n    outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    temp = floor(temp) * SHIFT_RIGHT8;\\n\\\n    outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    outlineColor.r = floor(temp);\\n\\\n\\n\\\n    // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a\\n\\\n\\n\\\n    temp = compressedAttribute0.w * SHIFT_RIGHT8;\\n\\\n    pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    pickColor = pickColor / 255.0;\\n\\\n\\n\\\n    temp = floor(temp) * SHIFT_RIGHT8;\\n\\\n    outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\n    outlineColor /= 255.0;\\n\\\n    color.a = floor(temp);\\n\\\n    color /= 255.0;\\n\\\n\\n\\\n    ///////////////////////////////////////////////////////////////////////////\\n\\\n\\n\\\n    vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\\n\\\n    vec4 positionEC = czm_modelViewRelativeToEye * p;\\n\\\n\\n\\\n    ///////////////////////////////////////////////////////////////////////////\\n\\\n\\n\\\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\\n\\\n    float lengthSq;\\n\\\n    if (czm_sceneMode == czm_sceneMode2D)\\n\\\n    {\\n\\\n        // 2D camera distance is a special case\\n\\\n        // treat all billboards as flattened to the z=0.0 plane\\n\\\n        lengthSq = czm_eyeHeight2D.y;\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        lengthSq = dot(positionEC.xyz, positionEC.xyz);\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n#ifdef EYE_DISTANCE_SCALING\\n\\\n    totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);\\n\\\n#endif\\n\\\n    if (totalSize > 0.0) {\\n\\\n        // Add padding for anti-aliasing on both sides.\\n\\\n        totalSize += 3.0;\\n\\\n    }\\n\\\n\\n\\\n    // Clamp to max point size.\\n\\\n    totalSize = min(totalSize, u_maxTotalPointSize);\\n\\\n    // If size is too small, push vertex behind near plane for clipping.\\n\\\n    // Note that context.minimumAliasedPointSize \\\"will be at most 1.0\\\".\\n\\\n    if (totalSize < 1.0)\\n\\\n    {\\n\\\n        positionEC.xyz = vec3(0.0);\\n\\\n        totalSize = 1.0;\\n\\\n    }\\n\\\n\\n\\\n    float translucency = 1.0;\\n\\\n#ifdef EYE_DISTANCE_TRANSLUCENCY\\n\\\n    translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\\n\\\n    // push vertex behind near plane for clipping\\n\\\n    if (translucency < 0.004)\\n\\\n    {\\n\\\n        positionEC.xyz = vec3(0.0);\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n#ifdef DISTANCE_DISPLAY_CONDITION\\n\\\n    float nearSq = distanceDisplayConditionAndDisableDepth.x;\\n\\\n    float farSq = distanceDisplayConditionAndDisableDepth.y;\\n\\\n    if (lengthSq < nearSq || lengthSq > farSq) {\\n\\\n        // push vertex behind camera to force it to be clipped\\n\\\n        positionEC.xyz = vec3(0.0, 0.0, 1.0);\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n    gl_Position = czm_projection * positionEC;\\n\\\n    czm_vertexLogDepth();\\n\\\n\\n\\\n#ifdef DISABLE_DEPTH_DISTANCE\\n\\\n    float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;\\n\\\n    if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\\n\\\n    {\\n\\\n        disableDepthTestDistance = czm_minimumDisableDepthTestDistance;\\n\\\n    }\\n\\\n\\n\\\n    if (disableDepthTestDistance != 0.0)\\n\\\n    {\\n\\\n        // Don't try to \\\"multiply both sides\\\" by w.  Greater/less-than comparisons won't work for negative values of w.\\n\\\n        float zclip = gl_Position.z / gl_Position.w;\\n\\\n        bool clipped = (zclip < -1.0 || zclip > 1.0);\\n\\\n        if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\\n\\\n        {\\n\\\n            // Position z on the near plane.\\n\\\n            gl_Position.z = -gl_Position.w;\\n\\\n#ifdef LOG_DEPTH\\n\\\n            czm_vertexLogDepth(vec4(czm_currentFrustum.x));\\n\\\n#endif\\n\\\n        }\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n    v_color = color;\\n\\\n    v_color.a *= translucency * show;\\n\\\n    v_outlineColor = outlineColor;\\n\\\n    v_outlineColor.a *= translucency * show;\\n\\\n\\n\\\n    v_innerPercent = 1.0 - outlinePercent;\\n\\\n    v_pixelDistance = 2.0 / totalSize;\\n\\\n    gl_PointSize = totalSize * show;\\n\\\n    gl_Position *= show;\\n\\\n\\n\\\n    v_pickColor = pickColor;\\n\\\n}\\n\\\n\";\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Color from \"../Core/Color.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EncodedCartesian3 from \"../Core/EncodedCartesian3.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArrayFacade from \"../Renderer/VertexArrayFacade.js\";\nimport PointPrimitiveCollectionFS from \"../Shaders/PointPrimitiveCollectionFS.js\";\nimport PointPrimitiveCollectionVS from \"../Shaders/PointPrimitiveCollectionVS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport BlendOption from \"./BlendOption.js\";\nimport PointPrimitive from \"./PointPrimitive.js\";\nimport SceneMode from \"./SceneMode.js\";\n\nconst SHOW_INDEX = PointPrimitive.SHOW_INDEX;\nconst POSITION_INDEX = PointPrimitive.POSITION_INDEX;\nconst COLOR_INDEX = PointPrimitive.COLOR_INDEX;\nconst OUTLINE_COLOR_INDEX = PointPrimitive.OUTLINE_COLOR_INDEX;\nconst OUTLINE_WIDTH_INDEX = PointPrimitive.OUTLINE_WIDTH_INDEX;\nconst PIXEL_SIZE_INDEX = PointPrimitive.PIXEL_SIZE_INDEX;\nconst SCALE_BY_DISTANCE_INDEX = PointPrimitive.SCALE_BY_DISTANCE_INDEX;\nconst TRANSLUCENCY_BY_DISTANCE_INDEX =\n  PointPrimitive.TRANSLUCENCY_BY_DISTANCE_INDEX;\nconst DISTANCE_DISPLAY_CONDITION_INDEX =\n  PointPrimitive.DISTANCE_DISPLAY_CONDITION_INDEX;\nconst DISABLE_DEPTH_DISTANCE_INDEX =\n  PointPrimitive.DISABLE_DEPTH_DISTANCE_INDEX;\nconst NUMBER_OF_PROPERTIES = PointPrimitive.NUMBER_OF_PROPERTIES;\n\nconst attributeLocations = {\n  positionHighAndSize: 0,\n  positionLowAndOutline: 1,\n  compressedAttribute0: 2, // color, outlineColor, pick color\n  compressedAttribute1: 3, // show, translucency by distance, some free space\n  scaleByDistance: 4,\n  distanceDisplayConditionAndDisableDepth: 5,\n};\n\n/**\n * A renderable collection of points.\n * <br /><br />\n * Points are added and removed from the collection using {@link PointPrimitiveCollection#add}\n * and {@link PointPrimitiveCollection#remove}.\n *\n * @alias PointPrimitiveCollection\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each point from model to world coordinates.\n * @param {boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {BlendOption} [options.blendOption=BlendOption.OPAQUE_AND_TRANSLUCENT] The point blending option. The default\n * is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent,\n * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.\n * @param {boolean} [options.show=true] Determines if the primitives in the collection will be shown.\n *\n * @performance For best performance, prefer a few collections, each with many points, to\n * many collections with only a few points each.  Organize collections so that points\n * with the same update frequency are in the same collection, i.e., points that do not\n * change should be in one collection; points that change every frame should be in another\n * collection; and so on.\n *\n *\n * @example\n * // Create a pointPrimitive collection with two points\n * const points = scene.primitives.add(new Cesium.PointPrimitiveCollection());\n * points.add({\n *   position : new Cesium.Cartesian3(1.0, 2.0, 3.0),\n *   color : Cesium.Color.YELLOW\n * });\n * points.add({\n *   position : new Cesium.Cartesian3(4.0, 5.0, 6.0),\n *   color : Cesium.Color.CYAN\n * });\n *\n * @see PointPrimitiveCollection#add\n * @see PointPrimitiveCollection#remove\n * @see PointPrimitive\n */\nfunction PointPrimitiveCollection(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._sp = undefined;\n  this._spTranslucent = undefined;\n  this._rsOpaque = undefined;\n  this._rsTranslucent = undefined;\n  this._vaf = undefined;\n\n  this._pointPrimitives = [];\n  this._pointPrimitivesToUpdate = [];\n  this._pointPrimitivesToUpdateIndex = 0;\n  this._pointPrimitivesRemoved = false;\n  this._createVertexArray = false;\n\n  this._shaderScaleByDistance = false;\n  this._compiledShaderScaleByDistance = false;\n\n  this._shaderTranslucencyByDistance = false;\n  this._compiledShaderTranslucencyByDistance = false;\n\n  this._shaderDistanceDisplayCondition = false;\n  this._compiledShaderDistanceDisplayCondition = false;\n\n  this._shaderDisableDepthDistance = false;\n  this._compiledShaderDisableDepthDistance = false;\n\n  this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES);\n\n  this._maxPixelSize = 1.0;\n\n  this._baseVolume = new BoundingSphere();\n  this._baseVolumeWC = new BoundingSphere();\n  this._baseVolume2D = new BoundingSphere();\n  this._boundingVolume = new BoundingSphere();\n  this._boundingVolumeDirty = false;\n\n  this._colorCommands = [];\n\n  /**\n   * Determines if primitives in this collection will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  /**\n   * The 4x4 transformation matrix that transforms each point in this collection from model to world coordinates.\n   * When this is the identity matrix, the pointPrimitives are drawn in world coordinates, i.e., Earth's WGS84 coordinates.\n   * Local reference frames can be used by providing a different transformation matrix, like that returned\n   * by {@link Transforms.eastNorthUpToFixedFrame}.\n   *\n   * @type {Matrix4}\n   * @default {@link Matrix4.IDENTITY}\n   *\n   *\n   * @example\n   * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);\n   * pointPrimitives.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);\n   * pointPrimitives.add({\n   *   color : Cesium.Color.ORANGE,\n   *   position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center\n   * });\n   * pointPrimitives.add({\n   *   color : Cesium.Color.YELLOW,\n   *   position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east\n   * });\n   * pointPrimitives.add({\n   *   color : Cesium.Color.GREEN,\n   *   position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north\n   * });\n   * pointPrimitives.add({\n   *   color : Cesium.Color.CYAN,\n   *   position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up\n   * });\n   *\n   * @see Transforms.eastNorthUpToFixedFrame\n   */\n  this.modelMatrix = Matrix4.clone(\n    defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n  );\n  this._modelMatrix = Matrix4.clone(Matrix4.IDENTITY);\n\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the bounding sphere for each draw command in the primitive.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowBoundingVolume = defaultValue(\n    options.debugShowBoundingVolume,\n    false\n  );\n\n  /**\n   * The point blending option. The default is used for rendering both opaque and translucent points.\n   * However, if either all of the points are completely opaque or all are completely translucent,\n   * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve\n   * performance by up to 2x.\n   * @type {BlendOption}\n   * @default BlendOption.OPAQUE_AND_TRANSLUCENT\n   */\n  this.blendOption = defaultValue(\n    options.blendOption,\n    BlendOption.OPAQUE_AND_TRANSLUCENT\n  );\n  this._blendOption = undefined;\n\n  this._mode = SceneMode.SCENE3D;\n  this._maxTotalPointSize = 1;\n\n  // The buffer usage for each attribute is determined based on the usage of the attribute over time.\n  this._buffersUsage = [\n    BufferUsage.STATIC_DRAW, // SHOW_INDEX\n    BufferUsage.STATIC_DRAW, // POSITION_INDEX\n    BufferUsage.STATIC_DRAW, // COLOR_INDEX\n    BufferUsage.STATIC_DRAW, // OUTLINE_COLOR_INDEX\n    BufferUsage.STATIC_DRAW, // OUTLINE_WIDTH_INDEX\n    BufferUsage.STATIC_DRAW, // PIXEL_SIZE_INDEX\n    BufferUsage.STATIC_DRAW, // SCALE_BY_DISTANCE_INDEX\n    BufferUsage.STATIC_DRAW, // TRANSLUCENCY_BY_DISTANCE_INDEX\n    BufferUsage.STATIC_DRAW, // DISTANCE_DISPLAY_CONDITION_INDEX\n  ];\n\n  const that = this;\n  this._uniforms = {\n    u_maxTotalPointSize: function () {\n      return that._maxTotalPointSize;\n    },\n  };\n}\n\nObject.defineProperties(PointPrimitiveCollection.prototype, {\n  /**\n   * Returns the number of points in this collection.  This is commonly used with\n   * {@link PointPrimitiveCollection#get} to iterate over all the points\n   * in the collection.\n   * @memberof PointPrimitiveCollection.prototype\n   * @type {number}\n   */\n  length: {\n    get: function () {\n      removePointPrimitives(this);\n      return this._pointPrimitives.length;\n    },\n  },\n});\n\nfunction destroyPointPrimitives(pointPrimitives) {\n  const length = pointPrimitives.length;\n  for (let i = 0; i < length; ++i) {\n    if (pointPrimitives[i]) {\n      pointPrimitives[i]._destroy();\n    }\n  }\n}\n\n/**\n * Creates and adds a point with the specified initial properties to the collection.\n * The added point is returned so it can be modified or removed from the collection later.\n *\n * @param {object}[options] A template describing the point's properties as shown in Example 1.\n * @returns {PointPrimitive} The point that was added to the collection.\n *\n * @performance Calling <code>add</code> is expected constant time.  However, the collection's vertex buffer\n * is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead.  For\n * best performance, add as many pointPrimitives as possible before calling <code>update</code>.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Example 1:  Add a point, specifying all the default values.\n * const p = pointPrimitives.add({\n *   show : true,\n *   position : Cesium.Cartesian3.ZERO,\n *   pixelSize : 10.0,\n *   color : Cesium.Color.WHITE,\n *   outlineColor : Cesium.Color.TRANSPARENT,\n *   outlineWidth : 0.0,\n *   id : undefined\n * });\n *\n * @example\n * // Example 2:  Specify only the point's cartographic position.\n * const p = pointPrimitives.add({\n *   position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)\n * });\n *\n * @see PointPrimitiveCollection#remove\n * @see PointPrimitiveCollection#removeAll\n */\nPointPrimitiveCollection.prototype.add = function (options) {\n  const p = new PointPrimitive(options, this);\n  p._index = this._pointPrimitives.length;\n\n  this._pointPrimitives.push(p);\n  this._createVertexArray = true;\n\n  return p;\n};\n\n/**\n * Removes a point from the collection.\n *\n * @param {PointPrimitive} pointPrimitive The point to remove.\n * @returns {boolean} <code>true</code> if the point was removed; <code>false</code> if the point was not found in the collection.\n *\n * @performance Calling <code>remove</code> is expected constant time.  However, the collection's vertex buffer\n * is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead.  For\n * best performance, remove as many points as possible before calling <code>update</code>.\n * If you intend to temporarily hide a point, it is usually more efficient to call\n * {@link PointPrimitive#show} instead of removing and re-adding the point.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * const p = pointPrimitives.add(...);\n * pointPrimitives.remove(p);  // Returns true\n *\n * @see PointPrimitiveCollection#add\n * @see PointPrimitiveCollection#removeAll\n * @see PointPrimitive#show\n */\nPointPrimitiveCollection.prototype.remove = function (pointPrimitive) {\n  if (this.contains(pointPrimitive)) {\n    this._pointPrimitives[pointPrimitive._index] = null; // Removed later\n    this._pointPrimitivesRemoved = true;\n    this._createVertexArray = true;\n    pointPrimitive._destroy();\n    return true;\n  }\n\n  return false;\n};\n\n/**\n * Removes all points from the collection.\n *\n * @performance <code>O(n)</code>.  It is more efficient to remove all the points\n * from a collection and then add new ones than to create a new collection entirely.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * pointPrimitives.add(...);\n * pointPrimitives.add(...);\n * pointPrimitives.removeAll();\n *\n * @see PointPrimitiveCollection#add\n * @see PointPrimitiveCollection#remove\n */\nPointPrimitiveCollection.prototype.removeAll = function () {\n  destroyPointPrimitives(this._pointPrimitives);\n  this._pointPrimitives = [];\n  this._pointPrimitivesToUpdate = [];\n  this._pointPrimitivesToUpdateIndex = 0;\n  this._pointPrimitivesRemoved = false;\n\n  this._createVertexArray = true;\n};\n\nfunction removePointPrimitives(pointPrimitiveCollection) {\n  if (pointPrimitiveCollection._pointPrimitivesRemoved) {\n    pointPrimitiveCollection._pointPrimitivesRemoved = false;\n\n    const newPointPrimitives = [];\n    const pointPrimitives = pointPrimitiveCollection._pointPrimitives;\n    const length = pointPrimitives.length;\n    for (let i = 0, j = 0; i < length; ++i) {\n      const pointPrimitive = pointPrimitives[i];\n      if (pointPrimitive) {\n        pointPrimitive._index = j++;\n        newPointPrimitives.push(pointPrimitive);\n      }\n    }\n\n    pointPrimitiveCollection._pointPrimitives = newPointPrimitives;\n  }\n}\n\nPointPrimitiveCollection.prototype._updatePointPrimitive = function (\n  pointPrimitive,\n  propertyChanged\n) {\n  if (!pointPrimitive._dirty) {\n    this._pointPrimitivesToUpdate[\n      this._pointPrimitivesToUpdateIndex++\n    ] = pointPrimitive;\n  }\n\n  ++this._propertiesChanged[propertyChanged];\n};\n\n/**\n * Check whether this collection contains a given point.\n *\n * @param {PointPrimitive} [pointPrimitive] The point to check for.\n * @returns {boolean} true if this collection contains the point, false otherwise.\n *\n * @see PointPrimitiveCollection#get\n */\nPointPrimitiveCollection.prototype.contains = function (pointPrimitive) {\n  return (\n    defined(pointPrimitive) && pointPrimitive._pointPrimitiveCollection === this\n  );\n};\n\n/**\n * Returns the point in the collection at the specified index.  Indices are zero-based\n * and increase as points are added.  Removing a point shifts all points after\n * it to the left, changing their indices.  This function is commonly used with\n * {@link PointPrimitiveCollection#length} to iterate over all the points\n * in the collection.\n *\n * @param {number} index The zero-based index of the point.\n * @returns {PointPrimitive} The point at the specified index.\n *\n * @performance Expected constant time.  If points were removed from the collection and\n * {@link PointPrimitiveCollection#update} was not called, an implicit <code>O(n)</code>\n * operation is performed.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Toggle the show property of every point in the collection\n * const len = pointPrimitives.length;\n * for (let i = 0; i < len; ++i) {\n *   const p = pointPrimitives.get(i);\n *   p.show = !p.show;\n * }\n *\n * @see PointPrimitiveCollection#length\n */\nPointPrimitiveCollection.prototype.get = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(index)) {\n    throw new DeveloperError(\"index is required.\");\n  }\n  //>>includeEnd('debug');\n\n  removePointPrimitives(this);\n  return this._pointPrimitives[index];\n};\n\nPointPrimitiveCollection.prototype.computeNewBuffersUsage = function () {\n  const buffersUsage = this._buffersUsage;\n  let usageChanged = false;\n\n  const properties = this._propertiesChanged;\n  for (let k = 0; k < NUMBER_OF_PROPERTIES; ++k) {\n    const newUsage =\n      properties[k] === 0 ? BufferUsage.STATIC_DRAW : BufferUsage.STREAM_DRAW;\n    usageChanged = usageChanged || buffersUsage[k] !== newUsage;\n    buffersUsage[k] = newUsage;\n  }\n\n  return usageChanged;\n};\n\nfunction createVAF(context, numberOfPointPrimitives, buffersUsage) {\n  return new VertexArrayFacade(\n    context,\n    [\n      {\n        index: attributeLocations.positionHighAndSize,\n        componentsPerAttribute: 4,\n        componentDatatype: ComponentDatatype.FLOAT,\n        usage: buffersUsage[POSITION_INDEX],\n      },\n      {\n        index: attributeLocations.positionLowAndShow,\n        componentsPerAttribute: 4,\n        componentDatatype: ComponentDatatype.FLOAT,\n        usage: buffersUsage[POSITION_INDEX],\n      },\n      {\n        index: attributeLocations.compressedAttribute0,\n        componentsPerAttribute: 4,\n        componentDatatype: ComponentDatatype.FLOAT,\n        usage: buffersUsage[COLOR_INDEX],\n      },\n      {\n        index: attributeLocations.compressedAttribute1,\n        componentsPerAttribute: 4,\n        componentDatatype: ComponentDatatype.FLOAT,\n        usage: buffersUsage[TRANSLUCENCY_BY_DISTANCE_INDEX],\n      },\n      {\n        index: attributeLocations.scaleByDistance,\n        componentsPerAttribute: 4,\n        componentDatatype: ComponentDatatype.FLOAT,\n        usage: buffersUsage[SCALE_BY_DISTANCE_INDEX],\n      },\n      {\n        index: attributeLocations.distanceDisplayConditionAndDisableDepth,\n        componentsPerAttribute: 3,\n        componentDatatype: ComponentDatatype.FLOAT,\n        usage: buffersUsage[DISTANCE_DISPLAY_CONDITION_INDEX],\n      },\n    ],\n    numberOfPointPrimitives\n  ); // 1 vertex per pointPrimitive\n}\n\n///////////////////////////////////////////////////////////////////////////\n\n// PERFORMANCE_IDEA:  Save memory if a property is the same for all pointPrimitives, use a latched attribute state,\n// instead of storing it in a vertex buffer.\n\nconst writePositionScratch = new EncodedCartesian3();\n\nfunction writePositionSizeAndOutline(\n  pointPrimitiveCollection,\n  context,\n  vafWriters,\n  pointPrimitive\n) {\n  const i = pointPrimitive._index;\n  const position = pointPrimitive._getActualPosition();\n\n  if (pointPrimitiveCollection._mode === SceneMode.SCENE3D) {\n    BoundingSphere.expand(\n      pointPrimitiveCollection._baseVolume,\n      position,\n      pointPrimitiveCollection._baseVolume\n    );\n    pointPrimitiveCollection._boundingVolumeDirty = true;\n  }\n\n  EncodedCartesian3.fromCartesian(position, writePositionScratch);\n  const pixelSize = pointPrimitive.pixelSize;\n  const outlineWidth = pointPrimitive.outlineWidth;\n\n  pointPrimitiveCollection._maxPixelSize = Math.max(\n    pointPrimitiveCollection._maxPixelSize,\n    pixelSize + outlineWidth\n  );\n\n  const positionHighWriter = vafWriters[attributeLocations.positionHighAndSize];\n  const high = writePositionScratch.high;\n  positionHighWriter(i, high.x, high.y, high.z, pixelSize);\n\n  const positionLowWriter =\n    vafWriters[attributeLocations.positionLowAndOutline];\n  const low = writePositionScratch.low;\n  positionLowWriter(i, low.x, low.y, low.z, outlineWidth);\n}\n\nconst LEFT_SHIFT16 = 65536.0; // 2^16\nconst LEFT_SHIFT8 = 256.0; // 2^8\n\nfunction writeCompressedAttrib0(\n  pointPrimitiveCollection,\n  context,\n  vafWriters,\n  pointPrimitive\n) {\n  const i = pointPrimitive._index;\n\n  const color = pointPrimitive.color;\n  const pickColor = pointPrimitive.getPickId(context).color;\n  const outlineColor = pointPrimitive.outlineColor;\n\n  let red = Color.floatToByte(color.red);\n  let green = Color.floatToByte(color.green);\n  let blue = Color.floatToByte(color.blue);\n  const compressed0 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;\n\n  red = Color.floatToByte(outlineColor.red);\n  green = Color.floatToByte(outlineColor.green);\n  blue = Color.floatToByte(outlineColor.blue);\n  const compressed1 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;\n\n  red = Color.floatToByte(pickColor.red);\n  green = Color.floatToByte(pickColor.green);\n  blue = Color.floatToByte(pickColor.blue);\n  const compressed2 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;\n\n  const compressed3 =\n    Color.floatToByte(color.alpha) * LEFT_SHIFT16 +\n    Color.floatToByte(outlineColor.alpha) * LEFT_SHIFT8 +\n    Color.floatToByte(pickColor.alpha);\n\n  const writer = vafWriters[attributeLocations.compressedAttribute0];\n  writer(i, compressed0, compressed1, compressed2, compressed3);\n}\n\nfunction writeCompressedAttrib1(\n  pointPrimitiveCollection,\n  context,\n  vafWriters,\n  pointPrimitive\n) {\n  const i = pointPrimitive._index;\n\n  let near = 0.0;\n  let nearValue = 1.0;\n  let far = 1.0;\n  let farValue = 1.0;\n\n  const translucency = pointPrimitive.translucencyByDistance;\n  if (defined(translucency)) {\n    near = translucency.near;\n    nearValue = translucency.nearValue;\n    far = translucency.far;\n    farValue = translucency.farValue;\n\n    if (nearValue !== 1.0 || farValue !== 1.0) {\n      // translucency by distance calculation in shader need not be enabled\n      // until a pointPrimitive with near and far !== 1.0 is found\n      pointPrimitiveCollection._shaderTranslucencyByDistance = true;\n    }\n  }\n\n  let show = pointPrimitive.show && pointPrimitive.clusterShow;\n\n  // If the color alphas are zero, do not show this pointPrimitive.  This lets us avoid providing\n  // color during the pick pass and also eliminates a discard in the fragment shader.\n  if (\n    pointPrimitive.color.alpha === 0.0 &&\n    pointPrimitive.outlineColor.alpha === 0.0\n  ) {\n    show = false;\n  }\n\n  nearValue = CesiumMath.clamp(nearValue, 0.0, 1.0);\n  nearValue = nearValue === 1.0 ? 255.0 : (nearValue * 255.0) | 0;\n  const compressed0 = (show ? 1.0 : 0.0) * LEFT_SHIFT8 + nearValue;\n\n  farValue = CesiumMath.clamp(farValue, 0.0, 1.0);\n  farValue = farValue === 1.0 ? 255.0 : (farValue * 255.0) | 0;\n  const compressed1 = farValue;\n\n  const writer = vafWriters[attributeLocations.compressedAttribute1];\n  writer(i, compressed0, compressed1, near, far);\n}\n\nfunction writeScaleByDistance(\n  pointPrimitiveCollection,\n  context,\n  vafWriters,\n  pointPrimitive\n) {\n  const i = pointPrimitive._index;\n  const writer = vafWriters[attributeLocations.scaleByDistance];\n  let near = 0.0;\n  let nearValue = 1.0;\n  let far = 1.0;\n  let farValue = 1.0;\n\n  const scale = pointPrimitive.scaleByDistance;\n  if (defined(scale)) {\n    near = scale.near;\n    nearValue = scale.nearValue;\n    far = scale.far;\n    farValue = scale.farValue;\n\n    if (nearValue !== 1.0 || farValue !== 1.0) {\n      // scale by distance calculation in shader need not be enabled\n      // until a pointPrimitive with near and far !== 1.0 is found\n      pointPrimitiveCollection._shaderScaleByDistance = true;\n    }\n  }\n\n  writer(i, near, nearValue, far, farValue);\n}\n\nfunction writeDistanceDisplayConditionAndDepthDisable(\n  pointPrimitiveCollection,\n  context,\n  vafWriters,\n  pointPrimitive\n) {\n  const i = pointPrimitive._index;\n  const writer =\n    vafWriters[attributeLocations.distanceDisplayConditionAndDisableDepth];\n  let near = 0.0;\n  let far = Number.MAX_VALUE;\n\n  const distanceDisplayCondition = pointPrimitive.distanceDisplayCondition;\n  if (defined(distanceDisplayCondition)) {\n    near = distanceDisplayCondition.near;\n    far = distanceDisplayCondition.far;\n\n    near *= near;\n    far *= far;\n\n    pointPrimitiveCollection._shaderDistanceDisplayCondition = true;\n  }\n\n  let disableDepthTestDistance = pointPrimitive.disableDepthTestDistance;\n  disableDepthTestDistance *= disableDepthTestDistance;\n  if (disableDepthTestDistance > 0.0) {\n    pointPrimitiveCollection._shaderDisableDepthDistance = true;\n    if (disableDepthTestDistance === Number.POSITIVE_INFINITY) {\n      disableDepthTestDistance = -1.0;\n    }\n  }\n\n  writer(i, near, far, disableDepthTestDistance);\n}\n\nfunction writePointPrimitive(\n  pointPrimitiveCollection,\n  context,\n  vafWriters,\n  pointPrimitive\n) {\n  writePositionSizeAndOutline(\n    pointPrimitiveCollection,\n    context,\n    vafWriters,\n    pointPrimitive\n  );\n  writeCompressedAttrib0(\n    pointPrimitiveCollection,\n    context,\n    vafWriters,\n    pointPrimitive\n  );\n  writeCompressedAttrib1(\n    pointPrimitiveCollection,\n    context,\n    vafWriters,\n    pointPrimitive\n  );\n  writeScaleByDistance(\n    pointPrimitiveCollection,\n    context,\n    vafWriters,\n    pointPrimitive\n  );\n  writeDistanceDisplayConditionAndDepthDisable(\n    pointPrimitiveCollection,\n    context,\n    vafWriters,\n    pointPrimitive\n  );\n}\n\nfunction recomputeActualPositions(\n  pointPrimitiveCollection,\n  pointPrimitives,\n  length,\n  frameState,\n  modelMatrix,\n  recomputeBoundingVolume\n) {\n  let boundingVolume;\n  if (frameState.mode === SceneMode.SCENE3D) {\n    boundingVolume = pointPrimitiveCollection._baseVolume;\n    pointPrimitiveCollection._boundingVolumeDirty = true;\n  } else {\n    boundingVolume = pointPrimitiveCollection._baseVolume2D;\n  }\n\n  const positions = [];\n  for (let i = 0; i < length; ++i) {\n    const pointPrimitive = pointPrimitives[i];\n    const position = pointPrimitive.position;\n    const actualPosition = PointPrimitive._computeActualPosition(\n      position,\n      frameState,\n      modelMatrix\n    );\n    if (defined(actualPosition)) {\n      pointPrimitive._setActualPosition(actualPosition);\n\n      if (recomputeBoundingVolume) {\n        positions.push(actualPosition);\n      } else {\n        BoundingSphere.expand(boundingVolume, actualPosition, boundingVolume);\n      }\n    }\n  }\n\n  if (recomputeBoundingVolume) {\n    BoundingSphere.fromPoints(positions, boundingVolume);\n  }\n}\n\nfunction updateMode(pointPrimitiveCollection, frameState) {\n  const mode = frameState.mode;\n\n  const pointPrimitives = pointPrimitiveCollection._pointPrimitives;\n  const pointPrimitivesToUpdate =\n    pointPrimitiveCollection._pointPrimitivesToUpdate;\n  const modelMatrix = pointPrimitiveCollection._modelMatrix;\n\n  if (\n    pointPrimitiveCollection._createVertexArray ||\n    pointPrimitiveCollection._mode !== mode ||\n    (mode !== SceneMode.SCENE3D &&\n      !Matrix4.equals(modelMatrix, pointPrimitiveCollection.modelMatrix))\n  ) {\n    pointPrimitiveCollection._mode = mode;\n    Matrix4.clone(pointPrimitiveCollection.modelMatrix, modelMatrix);\n    pointPrimitiveCollection._createVertexArray = true;\n\n    if (\n      mode === SceneMode.SCENE3D ||\n      mode === SceneMode.SCENE2D ||\n      mode === SceneMode.COLUMBUS_VIEW\n    ) {\n      recomputeActualPositions(\n        pointPrimitiveCollection,\n        pointPrimitives,\n        pointPrimitives.length,\n        frameState,\n        modelMatrix,\n        true\n      );\n    }\n  } else if (mode === SceneMode.MORPHING) {\n    recomputeActualPositions(\n      pointPrimitiveCollection,\n      pointPrimitives,\n      pointPrimitives.length,\n      frameState,\n      modelMatrix,\n      true\n    );\n  } else if (mode === SceneMode.SCENE2D || mode === SceneMode.COLUMBUS_VIEW) {\n    recomputeActualPositions(\n      pointPrimitiveCollection,\n      pointPrimitivesToUpdate,\n      pointPrimitiveCollection._pointPrimitivesToUpdateIndex,\n      frameState,\n      modelMatrix,\n      false\n    );\n  }\n}\n\nfunction updateBoundingVolume(collection, frameState, boundingVolume) {\n  const pixelSize = frameState.camera.getPixelSize(\n    boundingVolume,\n    frameState.context.drawingBufferWidth,\n    frameState.context.drawingBufferHeight\n  );\n  const size = pixelSize * collection._maxPixelSize;\n  boundingVolume.radius += size;\n}\n\nconst scratchWriterArray = [];\n\n/**\n * @private\n */\nPointPrimitiveCollection.prototype.update = function (frameState) {\n  removePointPrimitives(this);\n\n  if (!this.show) {\n    return;\n  }\n\n  this._maxTotalPointSize = ContextLimits.maximumAliasedPointSize;\n\n  updateMode(this, frameState);\n\n  const pointPrimitives = this._pointPrimitives;\n  const pointPrimitivesLength = pointPrimitives.length;\n  const pointPrimitivesToUpdate = this._pointPrimitivesToUpdate;\n  const pointPrimitivesToUpdateLength = this._pointPrimitivesToUpdateIndex;\n\n  const properties = this._propertiesChanged;\n\n  const createVertexArray = this._createVertexArray;\n\n  let vafWriters;\n  const context = frameState.context;\n  const pass = frameState.passes;\n  const picking = pass.pick;\n\n  // PERFORMANCE_IDEA: Round robin multiple buffers.\n  if (createVertexArray || (!picking && this.computeNewBuffersUsage())) {\n    this._createVertexArray = false;\n\n    for (let k = 0; k < NUMBER_OF_PROPERTIES; ++k) {\n      properties[k] = 0;\n    }\n\n    this._vaf = this._vaf && this._vaf.destroy();\n\n    if (pointPrimitivesLength > 0) {\n      // PERFORMANCE_IDEA:  Instead of creating a new one, resize like std::vector.\n      this._vaf = createVAF(context, pointPrimitivesLength, this._buffersUsage);\n      vafWriters = this._vaf.writers;\n\n      // Rewrite entire buffer if pointPrimitives were added or removed.\n      for (let i = 0; i < pointPrimitivesLength; ++i) {\n        const pointPrimitive = this._pointPrimitives[i];\n        pointPrimitive._dirty = false; // In case it needed an update.\n        writePointPrimitive(this, context, vafWriters, pointPrimitive);\n      }\n\n      this._vaf.commit();\n    }\n\n    this._pointPrimitivesToUpdateIndex = 0;\n  } else if (pointPrimitivesToUpdateLength > 0) {\n    // PointPrimitives were modified, but none were added or removed.\n    const writers = scratchWriterArray;\n    writers.length = 0;\n\n    if (\n      properties[POSITION_INDEX] ||\n      properties[OUTLINE_WIDTH_INDEX] ||\n      properties[PIXEL_SIZE_INDEX]\n    ) {\n      writers.push(writePositionSizeAndOutline);\n    }\n\n    if (properties[COLOR_INDEX] || properties[OUTLINE_COLOR_INDEX]) {\n      writers.push(writeCompressedAttrib0);\n    }\n\n    if (properties[SHOW_INDEX] || properties[TRANSLUCENCY_BY_DISTANCE_INDEX]) {\n      writers.push(writeCompressedAttrib1);\n    }\n\n    if (properties[SCALE_BY_DISTANCE_INDEX]) {\n      writers.push(writeScaleByDistance);\n    }\n\n    if (\n      properties[DISTANCE_DISPLAY_CONDITION_INDEX] ||\n      properties[DISABLE_DEPTH_DISTANCE_INDEX]\n    ) {\n      writers.push(writeDistanceDisplayConditionAndDepthDisable);\n    }\n\n    const numWriters = writers.length;\n\n    vafWriters = this._vaf.writers;\n\n    if (pointPrimitivesToUpdateLength / pointPrimitivesLength > 0.1) {\n      // If more than 10% of pointPrimitive change, rewrite the entire buffer.\n\n      // PERFORMANCE_IDEA:  I totally made up 10% :).\n\n      for (let m = 0; m < pointPrimitivesToUpdateLength; ++m) {\n        const b = pointPrimitivesToUpdate[m];\n        b._dirty = false;\n\n        for (let n = 0; n < numWriters; ++n) {\n          writers[n](this, context, vafWriters, b);\n        }\n      }\n      this._vaf.commit();\n    } else {\n      for (let h = 0; h < pointPrimitivesToUpdateLength; ++h) {\n        const bb = pointPrimitivesToUpdate[h];\n        bb._dirty = false;\n\n        for (let o = 0; o < numWriters; ++o) {\n          writers[o](this, context, vafWriters, bb);\n        }\n        this._vaf.subCommit(bb._index, 1);\n      }\n      this._vaf.endSubCommits();\n    }\n\n    this._pointPrimitivesToUpdateIndex = 0;\n  }\n\n  // If the number of total pointPrimitives ever shrinks considerably\n  // Truncate pointPrimitivesToUpdate so that we free memory that we're\n  // not going to be using.\n  if (pointPrimitivesToUpdateLength > pointPrimitivesLength * 1.5) {\n    pointPrimitivesToUpdate.length = pointPrimitivesLength;\n  }\n\n  if (!defined(this._vaf) || !defined(this._vaf.va)) {\n    return;\n  }\n\n  if (this._boundingVolumeDirty) {\n    this._boundingVolumeDirty = false;\n    BoundingSphere.transform(\n      this._baseVolume,\n      this.modelMatrix,\n      this._baseVolumeWC\n    );\n  }\n\n  let boundingVolume;\n  let modelMatrix = Matrix4.IDENTITY;\n  if (frameState.mode === SceneMode.SCENE3D) {\n    modelMatrix = this.modelMatrix;\n    boundingVolume = BoundingSphere.clone(\n      this._baseVolumeWC,\n      this._boundingVolume\n    );\n  } else {\n    boundingVolume = BoundingSphere.clone(\n      this._baseVolume2D,\n      this._boundingVolume\n    );\n  }\n  updateBoundingVolume(this, frameState, boundingVolume);\n\n  const blendOptionChanged = this._blendOption !== this.blendOption;\n  this._blendOption = this.blendOption;\n\n  if (blendOptionChanged) {\n    if (\n      this._blendOption === BlendOption.OPAQUE ||\n      this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT\n    ) {\n      this._rsOpaque = RenderState.fromCache({\n        depthTest: {\n          enabled: true,\n          func: WebGLConstants.LEQUAL,\n        },\n        depthMask: true,\n      });\n    } else {\n      this._rsOpaque = undefined;\n    }\n\n    if (\n      this._blendOption === BlendOption.TRANSLUCENT ||\n      this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT\n    ) {\n      this._rsTranslucent = RenderState.fromCache({\n        depthTest: {\n          enabled: true,\n          func: WebGLConstants.LEQUAL,\n        },\n        depthMask: false,\n        blending: BlendingState.ALPHA_BLEND,\n      });\n    } else {\n      this._rsTranslucent = undefined;\n    }\n  }\n\n  this._shaderDisableDepthDistance =\n    this._shaderDisableDepthDistance ||\n    frameState.minimumDisableDepthTestDistance !== 0.0;\n  let vs;\n  let fs;\n\n  if (\n    blendOptionChanged ||\n    (this._shaderScaleByDistance && !this._compiledShaderScaleByDistance) ||\n    (this._shaderTranslucencyByDistance &&\n      !this._compiledShaderTranslucencyByDistance) ||\n    (this._shaderDistanceDisplayCondition &&\n      !this._compiledShaderDistanceDisplayCondition) ||\n    this._shaderDisableDepthDistance !==\n      this._compiledShaderDisableDepthDistance\n  ) {\n    vs = new ShaderSource({\n      sources: [PointPrimitiveCollectionVS],\n    });\n    if (this._shaderScaleByDistance) {\n      vs.defines.push(\"EYE_DISTANCE_SCALING\");\n    }\n    if (this._shaderTranslucencyByDistance) {\n      vs.defines.push(\"EYE_DISTANCE_TRANSLUCENCY\");\n    }\n    if (this._shaderDistanceDisplayCondition) {\n      vs.defines.push(\"DISTANCE_DISPLAY_CONDITION\");\n    }\n    if (this._shaderDisableDepthDistance) {\n      vs.defines.push(\"DISABLE_DEPTH_DISTANCE\");\n    }\n\n    if (this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT) {\n      fs = new ShaderSource({\n        defines: [\"OPAQUE\"],\n        sources: [PointPrimitiveCollectionFS],\n      });\n      this._sp = ShaderProgram.replaceCache({\n        context: context,\n        shaderProgram: this._sp,\n        vertexShaderSource: vs,\n        fragmentShaderSource: fs,\n        attributeLocations: attributeLocations,\n      });\n\n      fs = new ShaderSource({\n        defines: [\"TRANSLUCENT\"],\n        sources: [PointPrimitiveCollectionFS],\n      });\n      this._spTranslucent = ShaderProgram.replaceCache({\n        context: context,\n        shaderProgram: this._spTranslucent,\n        vertexShaderSource: vs,\n        fragmentShaderSource: fs,\n        attributeLocations: attributeLocations,\n      });\n    }\n\n    if (this._blendOption === BlendOption.OPAQUE) {\n      fs = new ShaderSource({\n        sources: [PointPrimitiveCollectionFS],\n      });\n      this._sp = ShaderProgram.replaceCache({\n        context: context,\n        shaderProgram: this._sp,\n        vertexShaderSource: vs,\n        fragmentShaderSource: fs,\n        attributeLocations: attributeLocations,\n      });\n    }\n\n    if (this._blendOption === BlendOption.TRANSLUCENT) {\n      fs = new ShaderSource({\n        sources: [PointPrimitiveCollectionFS],\n      });\n      this._spTranslucent = ShaderProgram.replaceCache({\n        context: context,\n        shaderProgram: this._spTranslucent,\n        vertexShaderSource: vs,\n        fragmentShaderSource: fs,\n        attributeLocations: attributeLocations,\n      });\n    }\n\n    this._compiledShaderScaleByDistance = this._shaderScaleByDistance;\n    this._compiledShaderTranslucencyByDistance = this._shaderTranslucencyByDistance;\n    this._compiledShaderDistanceDisplayCondition = this._shaderDistanceDisplayCondition;\n    this._compiledShaderDisableDepthDistance = this._shaderDisableDepthDistance;\n  }\n\n  let va;\n  let vaLength;\n  let command;\n  let j;\n\n  const commandList = frameState.commandList;\n\n  if (pass.render || picking) {\n    const colorList = this._colorCommands;\n\n    const opaque = this._blendOption === BlendOption.OPAQUE;\n    const opaqueAndTranslucent =\n      this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT;\n\n    va = this._vaf.va;\n    vaLength = va.length;\n\n    colorList.length = vaLength;\n    const totalLength = opaqueAndTranslucent ? vaLength * 2 : vaLength;\n    for (j = 0; j < totalLength; ++j) {\n      const opaqueCommand = opaque || (opaqueAndTranslucent && j % 2 === 0);\n\n      command = colorList[j];\n      if (!defined(command)) {\n        command = colorList[j] = new DrawCommand();\n      }\n\n      command.primitiveType = PrimitiveType.POINTS;\n      command.pass =\n        opaqueCommand || !opaqueAndTranslucent ? Pass.OPAQUE : Pass.TRANSLUCENT;\n      command.owner = this;\n\n      const index = opaqueAndTranslucent ? Math.floor(j / 2.0) : j;\n      command.boundingVolume = boundingVolume;\n      command.modelMatrix = modelMatrix;\n      command.shaderProgram = opaqueCommand ? this._sp : this._spTranslucent;\n      command.uniformMap = this._uniforms;\n      command.vertexArray = va[index].va;\n      command.renderState = opaqueCommand\n        ? this._rsOpaque\n        : this._rsTranslucent;\n      command.debugShowBoundingVolume = this.debugShowBoundingVolume;\n      command.pickId = \"v_pickColor\";\n\n      commandList.push(command);\n    }\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see PointPrimitiveCollection#destroy\n */\nPointPrimitiveCollection.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * pointPrimitives = pointPrimitives && pointPrimitives.destroy();\n *\n * @see PointPrimitiveCollection#isDestroyed\n */\nPointPrimitiveCollection.prototype.destroy = function () {\n  this._sp = this._sp && this._sp.destroy();\n  this._spTranslucent = this._spTranslucent && this._spTranslucent.destroy();\n  this._spPick = this._spPick && this._spPick.destroy();\n  this._vaf = this._vaf && this._vaf.destroy();\n  destroyPointPrimitives(this._pointPrimitives);\n\n  return destroyObject(this);\n};\nexport default PointPrimitiveCollection;\n", "\nconst ARRAY_TYPES = [\n    Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array,\n    Int32Array, Uint32Array, Float32Array, Float64Array\n];\n\n/** @typedef {Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor} TypedArrayConstructor */\n\nconst VERSION = 1; // serialized format version\nconst HEADER_SIZE = 8;\n\nexport default class KDBush {\n\n    /**\n     * Creates an index from raw `ArrayBuffer` data.\n     * @param {ArrayBuffer} data\n     */\n    static from(data) {\n        if (!(data instanceof ArrayBuffer)) {\n            throw new Error('Data must be an instance of ArrayBuffer.');\n        }\n        const [magic, versionAndType] = new Uint8Array(data, 0, 2);\n        if (magic !== 0xdb) {\n            throw new Error('Data does not appear to be in a KDBush format.');\n        }\n        const version = versionAndType >> 4;\n        if (version !== VERSION) {\n            throw new Error(`Got v${version} data when expected v${VERSION}.`);\n        }\n        const ArrayType = ARRAY_TYPES[versionAndType & 0x0f];\n        if (!ArrayType) {\n            throw new Error('Unrecognized array type.');\n        }\n        const [nodeSize] = new Uint16Array(data, 2, 1);\n        const [numItems] = new Uint32Array(data, 4, 1);\n\n        return new KDBush(numItems, nodeSize, ArrayType, data);\n    }\n\n    /**\n     * Creates an index that will hold a given number of items.\n     * @param {number} numItems\n     * @param {number} [nodeSize=64] Size of the KD-tree node (64 by default).\n     * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).\n     * @param {ArrayBuffer} [data] (For internal use only)\n     */\n    constructor(numItems, nodeSize = 64, ArrayType = Float64Array, data) {\n        if (isNaN(numItems) || numItems < 0) throw new Error(`Unpexpected numItems value: ${numItems}.`);\n\n        this.numItems = +numItems;\n        this.nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);\n        this.ArrayType = ArrayType;\n        this.IndexArrayType = numItems < 65536 ? Uint16Array : Uint32Array;\n\n        const arrayTypeIndex = ARRAY_TYPES.indexOf(this.ArrayType);\n        const coordsByteSize = numItems * 2 * this.ArrayType.BYTES_PER_ELEMENT;\n        const idsByteSize = numItems * this.IndexArrayType.BYTES_PER_ELEMENT;\n        const padCoords = (8 - idsByteSize % 8) % 8;\n\n        if (arrayTypeIndex < 0) {\n            throw new Error(`Unexpected typed array class: ${ArrayType}.`);\n        }\n\n        if (data && (data instanceof ArrayBuffer)) { // reconstruct an index from a buffer\n            this.data = data;\n            this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);\n            this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);\n            this._pos = numItems * 2;\n            this._finished = true;\n        } else { // initialize a new index\n            this.data = new ArrayBuffer(HEADER_SIZE + coordsByteSize + idsByteSize + padCoords);\n            this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);\n            this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);\n            this._pos = 0;\n            this._finished = false;\n\n            // set header\n            new Uint8Array(this.data, 0, 2).set([0xdb, (VERSION << 4) + arrayTypeIndex]);\n            new Uint16Array(this.data, 2, 1)[0] = nodeSize;\n            new Uint32Array(this.data, 4, 1)[0] = numItems;\n        }\n    }\n\n    /**\n     * Add a point to the index.\n     * @param {number} x\n     * @param {number} y\n     * @returns {number} An incremental index associated with the added item (starting from `0`).\n     */\n    add(x, y) {\n        const index = this._pos >> 1;\n        this.ids[index] = index;\n        this.coords[this._pos++] = x;\n        this.coords[this._pos++] = y;\n        return index;\n    }\n\n    /**\n     * Perform indexing of the added points.\n     */\n    finish() {\n        const numAdded = this._pos >> 1;\n        if (numAdded !== this.numItems) {\n            throw new Error(`Added ${numAdded} items when expected ${this.numItems}.`);\n        }\n        // kd-sort both arrays for efficient search\n        sort(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0);\n\n        this._finished = true;\n        return this;\n    }\n\n    /**\n     * Search the index for items within a given bounding box.\n     * @param {number} minX\n     * @param {number} minY\n     * @param {number} maxX\n     * @param {number} maxY\n     * @returns {number[]} An array of indices correponding to the found items.\n     */\n    range(minX, minY, maxX, maxY) {\n        if (!this._finished) throw new Error('Data not yet indexed - call index.finish().');\n\n        const {ids, coords, nodeSize} = this;\n        const stack = [0, ids.length - 1, 0];\n        const result = [];\n\n        // recursively search for items in range in the kd-sorted arrays\n        while (stack.length) {\n            const axis = stack.pop() || 0;\n            const right = stack.pop() || 0;\n            const left = stack.pop() || 0;\n\n            // if we reached \"tree node\", search linearly\n            if (right - left <= nodeSize) {\n                for (let i = left; i <= right; i++) {\n                    const x = coords[2 * i];\n                    const y = coords[2 * i + 1];\n                    if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[i]);\n                }\n                continue;\n            }\n\n            // otherwise find the middle index\n            const m = (left + right) >> 1;\n\n            // include the middle item if it's in range\n            const x = coords[2 * m];\n            const y = coords[2 * m + 1];\n            if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[m]);\n\n            // queue search in halves that intersect the query\n            if (axis === 0 ? minX <= x : minY <= y) {\n                stack.push(left);\n                stack.push(m - 1);\n                stack.push(1 - axis);\n            }\n            if (axis === 0 ? maxX >= x : maxY >= y) {\n                stack.push(m + 1);\n                stack.push(right);\n                stack.push(1 - axis);\n            }\n        }\n\n        return result;\n    }\n\n    /**\n     * Search the index for items within a given radius.\n     * @param {number} qx\n     * @param {number} qy\n     * @param {number} r Query radius.\n     * @returns {number[]} An array of indices correponding to the found items.\n     */\n    within(qx, qy, r) {\n        if (!this._finished) throw new Error('Data not yet indexed - call index.finish().');\n\n        const {ids, coords, nodeSize} = this;\n        const stack = [0, ids.length - 1, 0];\n        const result = [];\n        const r2 = r * r;\n\n        // recursively search for items within radius in the kd-sorted arrays\n        while (stack.length) {\n            const axis = stack.pop() || 0;\n            const right = stack.pop() || 0;\n            const left = stack.pop() || 0;\n\n            // if we reached \"tree node\", search linearly\n            if (right - left <= nodeSize) {\n                for (let i = left; i <= right; i++) {\n                    if (sqDist(coords[2 * i], coords[2 * i + 1], qx, qy) <= r2) result.push(ids[i]);\n                }\n                continue;\n            }\n\n            // otherwise find the middle index\n            const m = (left + right) >> 1;\n\n            // include the middle item if it's in range\n            const x = coords[2 * m];\n            const y = coords[2 * m + 1];\n            if (sqDist(x, y, qx, qy) <= r2) result.push(ids[m]);\n\n            // queue search in halves that intersect the query\n            if (axis === 0 ? qx - r <= x : qy - r <= y) {\n                stack.push(left);\n                stack.push(m - 1);\n                stack.push(1 - axis);\n            }\n            if (axis === 0 ? qx + r >= x : qy + r >= y) {\n                stack.push(m + 1);\n                stack.push(right);\n                stack.push(1 - axis);\n            }\n        }\n\n        return result;\n    }\n}\n\n/**\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType<TypedArrayConstructor>} coords\n * @param {number} nodeSize\n * @param {number} left\n * @param {number} right\n * @param {number} axis\n */\nfunction sort(ids, coords, nodeSize, left, right, axis) {\n    if (right - left <= nodeSize) return;\n\n    const m = (left + right) >> 1; // middle index\n\n    // sort ids and coords around the middle index so that the halves lie\n    // either left/right or top/bottom correspondingly (taking turns)\n    select(ids, coords, m, left, right, axis);\n\n    // recursively kd-sort first half and second half on the opposite axis\n    sort(ids, coords, nodeSize, left, m - 1, 1 - axis);\n    sort(ids, coords, nodeSize, m + 1, right, 1 - axis);\n}\n\n/**\n * Custom Floyd-Rivest selection algorithm: sort ids and coords so that\n * [left..k-1] items are smaller than k-th item (on either x or y axis)\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType<TypedArrayConstructor>} coords\n * @param {number} k\n * @param {number} left\n * @param {number} right\n * @param {number} axis\n */\nfunction select(ids, coords, k, left, right, axis) {\n\n    while (right > left) {\n        if (right - left > 600) {\n            const n = right - left + 1;\n            const m = k - left + 1;\n            const z = Math.log(n);\n            const s = 0.5 * Math.exp(2 * z / 3);\n            const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n            const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n            const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n            select(ids, coords, k, newLeft, newRight, axis);\n        }\n\n        const t = coords[2 * k + axis];\n        let i = left;\n        let j = right;\n\n        swapItem(ids, coords, left, k);\n        if (coords[2 * right + axis] > t) swapItem(ids, coords, left, right);\n\n        while (i < j) {\n            swapItem(ids, coords, i, j);\n            i++;\n            j--;\n            while (coords[2 * i + axis] < t) i++;\n            while (coords[2 * j + axis] > t) j--;\n        }\n\n        if (coords[2 * left + axis] === t) swapItem(ids, coords, left, j);\n        else {\n            j++;\n            swapItem(ids, coords, j, right);\n        }\n\n        if (j <= k) left = j + 1;\n        if (k <= j) right = j - 1;\n    }\n}\n\n/**\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType<TypedArrayConstructor>} coords\n * @param {number} i\n * @param {number} j\n */\nfunction swapItem(ids, coords, i, j) {\n    swap(ids, i, j);\n    swap(coords, 2 * i, 2 * j);\n    swap(coords, 2 * i + 1, 2 * j + 1);\n}\n\n/**\n * @param {InstanceType<TypedArrayConstructor>} arr\n * @param {number} i\n * @param {number} j\n */\nfunction swap(arr, i, j) {\n    const tmp = arr[i];\n    arr[i] = arr[j];\n    arr[j] = tmp;\n}\n\n/**\n * @param {number} ax\n * @param {number} ay\n * @param {number} bx\n * @param {number} by\n */\nfunction sqDist(ax, ay, bx, by) {\n    const dx = ax - bx;\n    const dy = ay - by;\n    return dx * dx + dy * dy;\n}\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport EllipsoidalOccluder from \"../Core/EllipsoidalOccluder.js\";\nimport Event from \"../Core/Event.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Billboard from \"../Scene/Billboard.js\";\nimport BillboardCollection from \"../Scene/BillboardCollection.js\";\nimport Label from \"../Scene/Label.js\";\nimport LabelCollection from \"../Scene/LabelCollection.js\";\nimport PointPrimitive from \"../Scene/PointPrimitive.js\";\nimport PointPrimitiveCollection from \"../Scene/PointPrimitiveCollection.js\";\nimport SceneMode from \"../Scene/SceneMode.js\";\nimport KDBush from \"kdbush\";\n\n/**\n * Defines how screen space objects (billboards, points, labels) are clustered.\n *\n * @param {object} [options] An object with the following properties:\n * @param {boolean} [options.enabled=false] Whether or not to enable clustering.\n * @param {number} [options.pixelRange=80] The pixel range to extend the screen space bounding box.\n * @param {number} [options.minimumClusterSize=2] The minimum number of screen space objects that can be clustered.\n * @param {boolean} [options.clusterBillboards=true] Whether or not to cluster the billboards of an entity.\n * @param {boolean} [options.clusterLabels=true] Whether or not to cluster the labels of an entity.\n * @param {boolean} [options.clusterPoints=true] Whether or not to cluster the points of an entity.\n * @param {boolean} [options.show=true] Determines if the entities in the cluster will be shown.\n *\n * @alias EntityCluster\n * @constructor\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Clustering.html|Cesium Sandcastle Clustering Demo}\n */\nfunction EntityCluster(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._enabled = defaultValue(options.enabled, false);\n  this._pixelRange = defaultValue(options.pixelRange, 80);\n  this._minimumClusterSize = defaultValue(options.minimumClusterSize, 2);\n  this._clusterBillboards = defaultValue(options.clusterBillboards, true);\n  this._clusterLabels = defaultValue(options.clusterLabels, true);\n  this._clusterPoints = defaultValue(options.clusterPoints, true);\n\n  this._labelCollection = undefined;\n  this._billboardCollection = undefined;\n  this._pointCollection = undefined;\n\n  this._clusterBillboardCollection = undefined;\n  this._clusterLabelCollection = undefined;\n  this._clusterPointCollection = undefined;\n\n  this._collectionIndicesByEntity = {};\n\n  this._unusedLabelIndices = [];\n  this._unusedBillboardIndices = [];\n  this._unusedPointIndices = [];\n\n  this._previousClusters = [];\n  this._previousHeight = undefined;\n\n  this._enabledDirty = false;\n  this._clusterDirty = false;\n\n  this._cluster = undefined;\n  this._removeEventListener = undefined;\n\n  this._clusterEvent = new Event();\n\n  /**\n   * Determines if entities in this collection will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n}\n\nfunction expandBoundingBox(bbox, pixelRange) {\n  bbox.x -= pixelRange;\n  bbox.y -= pixelRange;\n  bbox.width += pixelRange * 2.0;\n  bbox.height += pixelRange * 2.0;\n}\n\nconst labelBoundingBoxScratch = new BoundingRectangle();\n\nfunction getBoundingBox(item, coord, pixelRange, entityCluster, result) {\n  if (defined(item._labelCollection) && entityCluster._clusterLabels) {\n    result = Label.getScreenSpaceBoundingBox(item, coord, result);\n  } else if (\n    defined(item._billboardCollection) &&\n    entityCluster._clusterBillboards\n  ) {\n    result = Billboard.getScreenSpaceBoundingBox(item, coord, result);\n  } else if (\n    defined(item._pointPrimitiveCollection) &&\n    entityCluster._clusterPoints\n  ) {\n    result = PointPrimitive.getScreenSpaceBoundingBox(item, coord, result);\n  }\n\n  expandBoundingBox(result, pixelRange);\n\n  if (\n    entityCluster._clusterLabels &&\n    !defined(item._labelCollection) &&\n    defined(item.id) &&\n    hasLabelIndex(entityCluster, item.id.id) &&\n    defined(item.id._label)\n  ) {\n    const labelIndex =\n      entityCluster._collectionIndicesByEntity[item.id.id].labelIndex;\n    const label = entityCluster._labelCollection.get(labelIndex);\n    const labelBBox = Label.getScreenSpaceBoundingBox(\n      label,\n      coord,\n      labelBoundingBoxScratch\n    );\n    expandBoundingBox(labelBBox, pixelRange);\n    result = BoundingRectangle.union(result, labelBBox, result);\n  }\n\n  return result;\n}\n\nfunction addNonClusteredItem(item, entityCluster) {\n  item.clusterShow = true;\n\n  if (\n    !defined(item._labelCollection) &&\n    defined(item.id) &&\n    hasLabelIndex(entityCluster, item.id.id) &&\n    defined(item.id._label)\n  ) {\n    const labelIndex =\n      entityCluster._collectionIndicesByEntity[item.id.id].labelIndex;\n    const label = entityCluster._labelCollection.get(labelIndex);\n    label.clusterShow = true;\n  }\n}\n\nfunction addCluster(position, numPoints, ids, entityCluster) {\n  const cluster = {\n    billboard: entityCluster._clusterBillboardCollection.add(),\n    label: entityCluster._clusterLabelCollection.add(),\n    point: entityCluster._clusterPointCollection.add(),\n  };\n\n  cluster.billboard.show = false;\n  cluster.point.show = false;\n  cluster.label.show = true;\n  cluster.label.text = numPoints.toLocaleString();\n  cluster.label.id = ids;\n  cluster.billboard.position = cluster.label.position = cluster.point.position = position;\n\n  entityCluster._clusterEvent.raiseEvent(ids, cluster);\n}\n\nfunction hasLabelIndex(entityCluster, entityId) {\n  return (\n    defined(entityCluster) &&\n    defined(entityCluster._collectionIndicesByEntity[entityId]) &&\n    defined(entityCluster._collectionIndicesByEntity[entityId].labelIndex)\n  );\n}\n\nfunction getScreenSpacePositions(\n  collection,\n  points,\n  scene,\n  occluder,\n  entityCluster\n) {\n  if (!defined(collection)) {\n    return;\n  }\n\n  const length = collection.length;\n  for (let i = 0; i < length; ++i) {\n    const item = collection.get(i);\n    item.clusterShow = false;\n\n    if (\n      !item.show ||\n      (entityCluster._scene.mode === SceneMode.SCENE3D &&\n        !occluder.isPointVisible(item.position))\n    ) {\n      continue;\n    }\n\n    const canClusterLabels =\n      entityCluster._clusterLabels && defined(item._labelCollection);\n    const canClusterBillboards =\n      entityCluster._clusterBillboards && defined(item.id._billboard);\n    const canClusterPoints =\n      entityCluster._clusterPoints && defined(item.id._point);\n    if (canClusterLabels && (canClusterPoints || canClusterBillboards)) {\n      continue;\n    }\n\n    const coord = item.computeScreenSpacePosition(scene);\n    if (!defined(coord)) {\n      continue;\n    }\n\n    points.push({\n      index: i,\n      collection: collection,\n      clustered: false,\n      coord: coord,\n    });\n  }\n}\n\nconst pointBoundinRectangleScratch = new BoundingRectangle();\nconst totalBoundingRectangleScratch = new BoundingRectangle();\nconst neighborBoundingRectangleScratch = new BoundingRectangle();\n\nfunction createDeclutterCallback(entityCluster) {\n  return function (amount) {\n    if ((defined(amount) && amount < 0.05) || !entityCluster.enabled) {\n      return;\n    }\n\n    const scene = entityCluster._scene;\n\n    const labelCollection = entityCluster._labelCollection;\n    const billboardCollection = entityCluster._billboardCollection;\n    const pointCollection = entityCluster._pointCollection;\n\n    if (\n      (!defined(labelCollection) &&\n        !defined(billboardCollection) &&\n        !defined(pointCollection)) ||\n      (!entityCluster._clusterBillboards &&\n        !entityCluster._clusterLabels &&\n        !entityCluster._clusterPoints)\n    ) {\n      return;\n    }\n\n    let clusteredLabelCollection = entityCluster._clusterLabelCollection;\n    let clusteredBillboardCollection =\n      entityCluster._clusterBillboardCollection;\n    let clusteredPointCollection = entityCluster._clusterPointCollection;\n\n    if (defined(clusteredLabelCollection)) {\n      clusteredLabelCollection.removeAll();\n    } else {\n      clusteredLabelCollection = entityCluster._clusterLabelCollection = new LabelCollection(\n        {\n          scene: scene,\n        }\n      );\n    }\n\n    if (defined(clusteredBillboardCollection)) {\n      clusteredBillboardCollection.removeAll();\n    } else {\n      clusteredBillboardCollection = entityCluster._clusterBillboardCollection = new BillboardCollection(\n        {\n          scene: scene,\n        }\n      );\n    }\n\n    if (defined(clusteredPointCollection)) {\n      clusteredPointCollection.removeAll();\n    } else {\n      clusteredPointCollection = entityCluster._clusterPointCollection = new PointPrimitiveCollection();\n    }\n\n    const pixelRange = entityCluster._pixelRange;\n    const minimumClusterSize = entityCluster._minimumClusterSize;\n\n    const clusters = entityCluster._previousClusters;\n    const newClusters = [];\n\n    const previousHeight = entityCluster._previousHeight;\n    const currentHeight = scene.camera.positionCartographic.height;\n\n    const ellipsoid = scene.mapProjection.ellipsoid;\n    const cameraPosition = scene.camera.positionWC;\n    const occluder = new EllipsoidalOccluder(ellipsoid, cameraPosition);\n\n    const points = [];\n    if (entityCluster._clusterLabels) {\n      getScreenSpacePositions(\n        labelCollection,\n        points,\n        scene,\n        occluder,\n        entityCluster\n      );\n    }\n    if (entityCluster._clusterBillboards) {\n      getScreenSpacePositions(\n        billboardCollection,\n        points,\n        scene,\n        occluder,\n        entityCluster\n      );\n    }\n    if (entityCluster._clusterPoints) {\n      getScreenSpacePositions(\n        pointCollection,\n        points,\n        scene,\n        occluder,\n        entityCluster\n      );\n    }\n\n    let i;\n    let j;\n    let length;\n    let bbox;\n    let neighbors;\n    let neighborLength;\n    let neighborIndex;\n    let neighborPoint;\n    let ids;\n    let numPoints;\n\n    let collection;\n    let collectionIndex;\n\n    if (points.length > 0) {\n      const index = new KDBush(points.length, 64, Uint32Array);\n      for (let p = 0; p < points.length; ++p) {\n        index.add(points[p].coord.x, points[p].coord.y);\n      }\n      index.finish();\n\n      if (currentHeight < previousHeight) {\n        length = clusters.length;\n        for (i = 0; i < length; ++i) {\n          const cluster = clusters[i];\n\n          if (!occluder.isPointVisible(cluster.position)) {\n            continue;\n          }\n\n          const coord = Billboard._computeScreenSpacePosition(\n            Matrix4.IDENTITY,\n            cluster.position,\n            Cartesian3.ZERO,\n            Cartesian2.ZERO,\n            scene\n          );\n          if (!defined(coord)) {\n            continue;\n          }\n\n          const factor = 1.0 - currentHeight / previousHeight;\n          let width = (cluster.width = cluster.width * factor);\n          let height = (cluster.height = cluster.height * factor);\n\n          width = Math.max(width, cluster.minimumWidth);\n          height = Math.max(height, cluster.minimumHeight);\n\n          const minX = coord.x - width * 0.5;\n          const minY = coord.y - height * 0.5;\n          const maxX = coord.x + width;\n          const maxY = coord.y + height;\n\n          neighbors = index.range(minX, minY, maxX, maxY);\n          neighborLength = neighbors.length;\n          numPoints = 0;\n          ids = [];\n\n          for (j = 0; j < neighborLength; ++j) {\n            neighborIndex = neighbors[j];\n            neighborPoint = points[neighborIndex];\n            if (!neighborPoint.clustered) {\n              ++numPoints;\n\n              collection = neighborPoint.collection;\n              collectionIndex = neighborPoint.index;\n              ids.push(collection.get(collectionIndex).id);\n            }\n          }\n\n          if (numPoints >= minimumClusterSize) {\n            addCluster(cluster.position, numPoints, ids, entityCluster);\n            newClusters.push(cluster);\n\n            for (j = 0; j < neighborLength; ++j) {\n              points[neighbors[j]].clustered = true;\n            }\n          }\n        }\n      }\n\n      length = points.length;\n      for (i = 0; i < length; ++i) {\n        const point = points[i];\n        if (point.clustered) {\n          continue;\n        }\n\n        point.clustered = true;\n\n        collection = point.collection;\n        collectionIndex = point.index;\n\n        const item = collection.get(collectionIndex);\n        bbox = getBoundingBox(\n          item,\n          point.coord,\n          pixelRange,\n          entityCluster,\n          pointBoundinRectangleScratch\n        );\n        const totalBBox = BoundingRectangle.clone(\n          bbox,\n          totalBoundingRectangleScratch\n        );\n\n        neighbors = index.range(\n          bbox.x,\n          bbox.y,\n          bbox.x + bbox.width,\n          bbox.y + bbox.height\n        );\n        neighborLength = neighbors.length;\n\n        const clusterPosition = Cartesian3.clone(item.position);\n        numPoints = 1;\n        ids = [item.id];\n\n        for (j = 0; j < neighborLength; ++j) {\n          neighborIndex = neighbors[j];\n          neighborPoint = points[neighborIndex];\n          if (!neighborPoint.clustered) {\n            const neighborItem = neighborPoint.collection.get(\n              neighborPoint.index\n            );\n            const neighborBBox = getBoundingBox(\n              neighborItem,\n              neighborPoint.coord,\n              pixelRange,\n              entityCluster,\n              neighborBoundingRectangleScratch\n            );\n\n            Cartesian3.add(\n              neighborItem.position,\n              clusterPosition,\n              clusterPosition\n            );\n\n            BoundingRectangle.union(totalBBox, neighborBBox, totalBBox);\n            ++numPoints;\n\n            ids.push(neighborItem.id);\n          }\n        }\n\n        if (numPoints >= minimumClusterSize) {\n          const position = Cartesian3.multiplyByScalar(\n            clusterPosition,\n            1.0 / numPoints,\n            clusterPosition\n          );\n          addCluster(position, numPoints, ids, entityCluster);\n          newClusters.push({\n            position: position,\n            width: totalBBox.width,\n            height: totalBBox.height,\n            minimumWidth: bbox.width,\n            minimumHeight: bbox.height,\n          });\n\n          for (j = 0; j < neighborLength; ++j) {\n            points[neighbors[j]].clustered = true;\n          }\n        } else {\n          addNonClusteredItem(item, entityCluster);\n        }\n      }\n    }\n\n    if (clusteredLabelCollection.length === 0) {\n      clusteredLabelCollection.destroy();\n      entityCluster._clusterLabelCollection = undefined;\n    }\n\n    if (clusteredBillboardCollection.length === 0) {\n      clusteredBillboardCollection.destroy();\n      entityCluster._clusterBillboardCollection = undefined;\n    }\n\n    if (clusteredPointCollection.length === 0) {\n      clusteredPointCollection.destroy();\n      entityCluster._clusterPointCollection = undefined;\n    }\n\n    entityCluster._previousClusters = newClusters;\n    entityCluster._previousHeight = currentHeight;\n  };\n}\n\nEntityCluster.prototype._initialize = function (scene) {\n  this._scene = scene;\n\n  const cluster = createDeclutterCallback(this);\n  this._cluster = cluster;\n  this._removeEventListener = scene.camera.changed.addEventListener(cluster);\n};\n\nObject.defineProperties(EntityCluster.prototype, {\n  /**\n   * Gets or sets whether clustering is enabled.\n   * @memberof EntityCluster.prototype\n   * @type {boolean}\n   */\n  enabled: {\n    get: function () {\n      return this._enabled;\n    },\n    set: function (value) {\n      this._enabledDirty = value !== this._enabled;\n      this._enabled = value;\n    },\n  },\n  /**\n   * Gets or sets the pixel range to extend the screen space bounding box.\n   * @memberof EntityCluster.prototype\n   * @type {number}\n   */\n  pixelRange: {\n    get: function () {\n      return this._pixelRange;\n    },\n    set: function (value) {\n      this._clusterDirty = this._clusterDirty || value !== this._pixelRange;\n      this._pixelRange = value;\n    },\n  },\n  /**\n   * Gets or sets the minimum number of screen space objects that can be clustered.\n   * @memberof EntityCluster.prototype\n   * @type {number}\n   */\n  minimumClusterSize: {\n    get: function () {\n      return this._minimumClusterSize;\n    },\n    set: function (value) {\n      this._clusterDirty =\n        this._clusterDirty || value !== this._minimumClusterSize;\n      this._minimumClusterSize = value;\n    },\n  },\n  /**\n   * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster.newClusterCallback}.\n   * @memberof EntityCluster.prototype\n   * @type {Event<EntityCluster.newClusterCallback>}\n   */\n  clusterEvent: {\n    get: function () {\n      return this._clusterEvent;\n    },\n  },\n  /**\n   * Gets or sets whether clustering billboard entities is enabled.\n   * @memberof EntityCluster.prototype\n   * @type {boolean}\n   */\n  clusterBillboards: {\n    get: function () {\n      return this._clusterBillboards;\n    },\n    set: function (value) {\n      this._clusterDirty =\n        this._clusterDirty || value !== this._clusterBillboards;\n      this._clusterBillboards = value;\n    },\n  },\n  /**\n   * Gets or sets whether clustering labels entities is enabled.\n   * @memberof EntityCluster.prototype\n   * @type {boolean}\n   */\n  clusterLabels: {\n    get: function () {\n      return this._clusterLabels;\n    },\n    set: function (value) {\n      this._clusterDirty = this._clusterDirty || value !== this._clusterLabels;\n      this._clusterLabels = value;\n    },\n  },\n  /**\n   * Gets or sets whether clustering point entities is enabled.\n   * @memberof EntityCluster.prototype\n   * @type {boolean}\n   */\n  clusterPoints: {\n    get: function () {\n      return this._clusterPoints;\n    },\n    set: function (value) {\n      this._clusterDirty = this._clusterDirty || value !== this._clusterPoints;\n      this._clusterPoints = value;\n    },\n  },\n});\n\nfunction createGetEntity(\n  collectionProperty,\n  CollectionConstructor,\n  unusedIndicesProperty,\n  entityIndexProperty\n) {\n  return function (entity) {\n    let collection = this[collectionProperty];\n\n    if (!defined(this._collectionIndicesByEntity)) {\n      this._collectionIndicesByEntity = {};\n    }\n\n    let entityIndices = this._collectionIndicesByEntity[entity.id];\n\n    if (!defined(entityIndices)) {\n      entityIndices = this._collectionIndicesByEntity[entity.id] = {\n        billboardIndex: undefined,\n        labelIndex: undefined,\n        pointIndex: undefined,\n      };\n    }\n\n    if (defined(collection) && defined(entityIndices[entityIndexProperty])) {\n      return collection.get(entityIndices[entityIndexProperty]);\n    }\n\n    if (!defined(collection)) {\n      collection = this[collectionProperty] = new CollectionConstructor({\n        scene: this._scene,\n      });\n    }\n\n    let index;\n    let entityItem;\n\n    const unusedIndices = this[unusedIndicesProperty];\n    if (unusedIndices.length > 0) {\n      index = unusedIndices.shift();\n      entityItem = collection.get(index);\n    } else {\n      entityItem = collection.add();\n      index = collection.length - 1;\n    }\n\n    entityIndices[entityIndexProperty] = index;\n\n    const that = this;\n    Promise.resolve().then(function () {\n      that._clusterDirty = true;\n    });\n\n    return entityItem;\n  };\n}\n\nfunction removeEntityIndicesIfUnused(entityCluster, entityId) {\n  const indices = entityCluster._collectionIndicesByEntity[entityId];\n\n  if (\n    !defined(indices.billboardIndex) &&\n    !defined(indices.labelIndex) &&\n    !defined(indices.pointIndex)\n  ) {\n    delete entityCluster._collectionIndicesByEntity[entityId];\n  }\n}\n\n/**\n * Returns a new {@link Label}.\n * @param {Entity} entity The entity that will use the returned {@link Label} for visualization.\n * @returns {Label} The label that will be used to visualize an entity.\n *\n * @private\n */\nEntityCluster.prototype.getLabel = createGetEntity(\n  \"_labelCollection\",\n  LabelCollection,\n  \"_unusedLabelIndices\",\n  \"labelIndex\"\n);\n\n/**\n * Removes the {@link Label} associated with an entity so it can be reused by another entity.\n * @param {Entity} entity The entity that will uses the returned {@link Label} for visualization.\n *\n * @private\n */\nEntityCluster.prototype.removeLabel = function (entity) {\n  const entityIndices =\n    this._collectionIndicesByEntity &&\n    this._collectionIndicesByEntity[entity.id];\n  if (\n    !defined(this._labelCollection) ||\n    !defined(entityIndices) ||\n    !defined(entityIndices.labelIndex)\n  ) {\n    return;\n  }\n\n  const index = entityIndices.labelIndex;\n  entityIndices.labelIndex = undefined;\n  removeEntityIndicesIfUnused(this, entity.id);\n\n  const label = this._labelCollection.get(index);\n  label.show = false;\n  label.text = \"\";\n  label.id = undefined;\n\n  this._unusedLabelIndices.push(index);\n\n  this._clusterDirty = true;\n};\n\n/**\n * Returns a new {@link Billboard}.\n * @param {Entity} entity The entity that will use the returned {@link Billboard} for visualization.\n * @returns {Billboard} The label that will be used to visualize an entity.\n *\n * @private\n */\nEntityCluster.prototype.getBillboard = createGetEntity(\n  \"_billboardCollection\",\n  BillboardCollection,\n  \"_unusedBillboardIndices\",\n  \"billboardIndex\"\n);\n\n/**\n * Removes the {@link Billboard} associated with an entity so it can be reused by another entity.\n * @param {Entity} entity The entity that will uses the returned {@link Billboard} for visualization.\n *\n * @private\n */\nEntityCluster.prototype.removeBillboard = function (entity) {\n  const entityIndices =\n    this._collectionIndicesByEntity &&\n    this._collectionIndicesByEntity[entity.id];\n  if (\n    !defined(this._billboardCollection) ||\n    !defined(entityIndices) ||\n    !defined(entityIndices.billboardIndex)\n  ) {\n    return;\n  }\n\n  const index = entityIndices.billboardIndex;\n  entityIndices.billboardIndex = undefined;\n  removeEntityIndicesIfUnused(this, entity.id);\n\n  const billboard = this._billboardCollection.get(index);\n  billboard.id = undefined;\n  billboard.show = false;\n  billboard.image = undefined;\n\n  this._unusedBillboardIndices.push(index);\n\n  this._clusterDirty = true;\n};\n\n/**\n * Returns a new {@link Point}.\n * @param {Entity} entity The entity that will use the returned {@link Point} for visualization.\n * @returns {Point} The label that will be used to visualize an entity.\n *\n * @private\n */\nEntityCluster.prototype.getPoint = createGetEntity(\n  \"_pointCollection\",\n  PointPrimitiveCollection,\n  \"_unusedPointIndices\",\n  \"pointIndex\"\n);\n\n/**\n * Removes the {@link Point} associated with an entity so it can be reused by another entity.\n * @param {Entity} entity The entity that will uses the returned {@link Point} for visualization.\n *\n * @private\n */\nEntityCluster.prototype.removePoint = function (entity) {\n  const entityIndices =\n    this._collectionIndicesByEntity &&\n    this._collectionIndicesByEntity[entity.id];\n  if (\n    !defined(this._pointCollection) ||\n    !defined(entityIndices) ||\n    !defined(entityIndices.pointIndex)\n  ) {\n    return;\n  }\n\n  const index = entityIndices.pointIndex;\n  entityIndices.pointIndex = undefined;\n  removeEntityIndicesIfUnused(this, entity.id);\n\n  const point = this._pointCollection.get(index);\n  point.show = false;\n  point.id = undefined;\n\n  this._unusedPointIndices.push(index);\n\n  this._clusterDirty = true;\n};\n\nfunction disableCollectionClustering(collection) {\n  if (!defined(collection)) {\n    return;\n  }\n\n  const length = collection.length;\n  for (let i = 0; i < length; ++i) {\n    collection.get(i).clusterShow = true;\n  }\n}\n\nfunction updateEnable(entityCluster) {\n  if (entityCluster.enabled) {\n    return;\n  }\n\n  if (defined(entityCluster._clusterLabelCollection)) {\n    entityCluster._clusterLabelCollection.destroy();\n  }\n  if (defined(entityCluster._clusterBillboardCollection)) {\n    entityCluster._clusterBillboardCollection.destroy();\n  }\n  if (defined(entityCluster._clusterPointCollection)) {\n    entityCluster._clusterPointCollection.destroy();\n  }\n\n  entityCluster._clusterLabelCollection = undefined;\n  entityCluster._clusterBillboardCollection = undefined;\n  entityCluster._clusterPointCollection = undefined;\n\n  disableCollectionClustering(entityCluster._labelCollection);\n  disableCollectionClustering(entityCluster._billboardCollection);\n  disableCollectionClustering(entityCluster._pointCollection);\n}\n\n/**\n * Gets the draw commands for the clustered billboards/points/labels if enabled, otherwise,\n * queues the draw commands for billboards/points/labels created for entities.\n * @private\n */\nEntityCluster.prototype.update = function (frameState) {\n  if (!this.show) {\n    return;\n  }\n\n  // If clustering is enabled before the label collection is updated,\n  // the glyphs haven't been created so the screen space bounding boxes\n  // are incorrect.\n  let commandList;\n  if (\n    defined(this._labelCollection) &&\n    this._labelCollection.length > 0 &&\n    this._labelCollection.get(0)._glyphs.length === 0\n  ) {\n    commandList = frameState.commandList;\n    frameState.commandList = [];\n    this._labelCollection.update(frameState);\n    frameState.commandList = commandList;\n  }\n\n  // If clustering is enabled before the billboard collection is updated,\n  // the images haven't been added to the image atlas so the screen space bounding boxes\n  // are incorrect.\n  if (\n    defined(this._billboardCollection) &&\n    this._billboardCollection.length > 0 &&\n    !defined(this._billboardCollection.get(0).width)\n  ) {\n    commandList = frameState.commandList;\n    frameState.commandList = [];\n    this._billboardCollection.update(frameState);\n    frameState.commandList = commandList;\n  }\n\n  if (this._enabledDirty) {\n    this._enabledDirty = false;\n    updateEnable(this);\n    this._clusterDirty = true;\n  }\n\n  if (this._clusterDirty) {\n    this._clusterDirty = false;\n    this._cluster();\n  }\n\n  if (defined(this._clusterLabelCollection)) {\n    this._clusterLabelCollection.update(frameState);\n  }\n  if (defined(this._clusterBillboardCollection)) {\n    this._clusterBillboardCollection.update(frameState);\n  }\n  if (defined(this._clusterPointCollection)) {\n    this._clusterPointCollection.update(frameState);\n  }\n\n  if (defined(this._labelCollection)) {\n    this._labelCollection.update(frameState);\n  }\n  if (defined(this._billboardCollection)) {\n    this._billboardCollection.update(frameState);\n  }\n  if (defined(this._pointCollection)) {\n    this._pointCollection.update(frameState);\n  }\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed\n * from a data source collection and added to another.\n * </p>\n */\nEntityCluster.prototype.destroy = function () {\n  this._labelCollection =\n    this._labelCollection && this._labelCollection.destroy();\n  this._billboardCollection =\n    this._billboardCollection && this._billboardCollection.destroy();\n  this._pointCollection =\n    this._pointCollection && this._pointCollection.destroy();\n\n  this._clusterLabelCollection =\n    this._clusterLabelCollection && this._clusterLabelCollection.destroy();\n  this._clusterBillboardCollection =\n    this._clusterBillboardCollection &&\n    this._clusterBillboardCollection.destroy();\n  this._clusterPointCollection =\n    this._clusterPointCollection && this._clusterPointCollection.destroy();\n\n  if (defined(this._removeEventListener)) {\n    this._removeEventListener();\n    this._removeEventListener = undefined;\n  }\n\n  this._labelCollection = undefined;\n  this._billboardCollection = undefined;\n  this._pointCollection = undefined;\n\n  this._clusterBillboardCollection = undefined;\n  this._clusterLabelCollection = undefined;\n  this._clusterPointCollection = undefined;\n\n  this._collectionIndicesByEntity = undefined;\n\n  this._unusedLabelIndices = [];\n  this._unusedBillboardIndices = [];\n  this._unusedPointIndices = [];\n\n  this._previousClusters = [];\n  this._previousHeight = undefined;\n\n  this._enabledDirty = false;\n  this._pixelRangeDirty = false;\n  this._minimumClusterSizeDirty = false;\n\n  return undefined;\n};\n\n/**\n * A event listener function used to style clusters.\n * @callback EntityCluster.newClusterCallback\n *\n * @param {Entity[]} clusteredEntities An array of the entities contained in the cluster.\n * @param {object} cluster An object containing the Billboard, Label, and Point\n * primitives that represent this cluster of entities.\n * @param {Billboard} cluster.billboard\n * @param {Label} cluster.label\n * @param {PointPrimitive} cluster.point\n *\n * @example\n * // The default cluster values.\n * dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) {\n *     cluster.label.show = true;\n *     cluster.label.text = entities.length.toLocaleString();\n * });\n */\nexport default EntityCluster;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport DataSource from \"./DataSource.js\";\nimport EntityCluster from \"./EntityCluster.js\";\nimport EntityCollection from \"./EntityCollection.js\";\n\n/**\n * A {@link DataSource} implementation which can be used to manually manage a group of entities.\n *\n * @alias CustomDataSource\n * @constructor\n *\n * @param {string} [name] A human-readable name for this instance.\n *\n * @example\n * const dataSource = new Cesium.CustomDataSource('myData');\n *\n * const entity = dataSource.entities.add({\n *    position : Cesium.Cartesian3.fromDegrees(1, 2, 0),\n *    billboard : {\n *        image : 'image.png'\n *    }\n * });\n *\n * viewer.dataSources.add(dataSource);\n */\nfunction CustomDataSource(name) {\n  this._name = name;\n  this._clock = undefined;\n  this._changed = new Event();\n  this._error = new Event();\n  this._isLoading = false;\n  this._loading = new Event();\n  this._entityCollection = new EntityCollection(this);\n  this._entityCluster = new EntityCluster();\n}\n\nObject.defineProperties(CustomDataSource.prototype, {\n  /**\n   * Gets or sets a human-readable name for this instance.\n   * @memberof CustomDataSource.prototype\n   * @type {string}\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n    set: function (value) {\n      if (this._name !== value) {\n        this._name = value;\n        this._changed.raiseEvent(this);\n      }\n    },\n  },\n  /**\n   * Gets or sets the clock for this instance.\n   * @memberof CustomDataSource.prototype\n   * @type {DataSourceClock}\n   */\n  clock: {\n    get: function () {\n      return this._clock;\n    },\n    set: function (value) {\n      if (this._clock !== value) {\n        this._clock = value;\n        this._changed.raiseEvent(this);\n      }\n    },\n  },\n  /**\n   * Gets the collection of {@link Entity} instances.\n   * @memberof CustomDataSource.prototype\n   * @type {EntityCollection}\n   */\n  entities: {\n    get: function () {\n      return this._entityCollection;\n    },\n  },\n  /**\n   * Gets or sets whether the data source is currently loading data.\n   * @memberof CustomDataSource.prototype\n   * @type {boolean}\n   */\n  isLoading: {\n    get: function () {\n      return this._isLoading;\n    },\n    set: function (value) {\n      DataSource.setLoading(this, value);\n    },\n  },\n  /**\n   * Gets an event that will be raised when the underlying data changes.\n   * @memberof CustomDataSource.prototype\n   * @type {Event}\n   */\n  changedEvent: {\n    get: function () {\n      return this._changed;\n    },\n  },\n  /**\n   * Gets an event that will be raised if an error is encountered during processing.\n   * @memberof CustomDataSource.prototype\n   * @type {Event}\n   */\n  errorEvent: {\n    get: function () {\n      return this._error;\n    },\n  },\n  /**\n   * Gets an event that will be raised when the data source either starts or stops loading.\n   * @memberof CustomDataSource.prototype\n   * @type {Event}\n   */\n  loadingEvent: {\n    get: function () {\n      return this._loading;\n    },\n  },\n  /**\n   * Gets whether or not this data source should be displayed.\n   * @memberof CustomDataSource.prototype\n   * @type {boolean}\n   */\n  show: {\n    get: function () {\n      return this._entityCollection.show;\n    },\n    set: function (value) {\n      this._entityCollection.show = value;\n    },\n  },\n\n  /**\n   * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.\n   *\n   * @memberof CustomDataSource.prototype\n   * @type {EntityCluster}\n   */\n  clustering: {\n    get: function () {\n      return this._entityCluster;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value must be defined.\");\n      }\n      //>>includeEnd('debug');\n      this._entityCluster = value;\n    },\n  },\n});\n\n/**\n * Updates the data source to the provided time.  This function is optional and\n * is not required to be implemented.  It is provided for data sources which\n * retrieve data based on the current animation time or scene state.\n * If implemented, update will be called by {@link DataSourceDisplay} once a frame.\n *\n * @param {JulianDate} time The simulation time.\n * @returns {boolean} True if this data source is ready to be displayed at the provided time, false otherwise.\n */\nCustomDataSource.prototype.update = function (time) {\n  return true;\n};\n\nexport default CustomDataSource;\n", "import CesiumMath from \"./Math.js\";\n\n/**\n * @private\n */\nconst CylinderGeometryLibrary = {};\n\n/**\n * @private\n */\nCylinderGeometryLibrary.computePositions = function (\n  length,\n  topRadius,\n  bottomRadius,\n  slices,\n  fill\n) {\n  const topZ = length * 0.5;\n  const bottomZ = -topZ;\n\n  const twoSlice = slices + slices;\n  const size = fill ? 2 * twoSlice : twoSlice;\n  const positions = new Float64Array(size * 3);\n  let i;\n  let index = 0;\n  let tbIndex = 0;\n  const bottomOffset = fill ? twoSlice * 3 : 0;\n  const topOffset = fill ? (twoSlice + slices) * 3 : slices * 3;\n\n  for (i = 0; i < slices; i++) {\n    const angle = (i / slices) * CesiumMath.TWO_PI;\n    const x = Math.cos(angle);\n    const y = Math.sin(angle);\n    const bottomX = x * bottomRadius;\n    const bottomY = y * bottomRadius;\n    const topX = x * topRadius;\n    const topY = y * topRadius;\n\n    positions[tbIndex + bottomOffset] = bottomX;\n    positions[tbIndex + bottomOffset + 1] = bottomY;\n    positions[tbIndex + bottomOffset + 2] = bottomZ;\n\n    positions[tbIndex + topOffset] = topX;\n    positions[tbIndex + topOffset + 1] = topY;\n    positions[tbIndex + topOffset + 2] = topZ;\n    tbIndex += 3;\n    if (fill) {\n      positions[index++] = bottomX;\n      positions[index++] = bottomY;\n      positions[index++] = bottomZ;\n      positions[index++] = topX;\n      positions[index++] = topY;\n      positions[index++] = topZ;\n    }\n  }\n\n  return positions;\n};\nexport default CylinderGeometryLibrary;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CylinderGeometryLibrary from \"./CylinderGeometryLibrary.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst radiusScratch = new Cartesian2();\nconst normalScratch = new Cartesian3();\nconst bitangentScratch = new Cartesian3();\nconst tangentScratch = new Cartesian3();\nconst positionScratch = new Cartesian3();\n\n/**\n * A description of a cylinder.\n *\n * @alias CylinderGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {number} options.length The length of the cylinder.\n * @param {number} options.topRadius The radius of the top of the cylinder.\n * @param {number} options.bottomRadius The radius of the bottom of the cylinder.\n * @param {number} [options.slices=128] The number of edges around the perimeter of the cylinder.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @exception {DeveloperError} options.slices must be greater than or equal to 3.\n *\n * @see CylinderGeometry.createGeometry\n *\n * @example\n * // create cylinder geometry\n * const cylinder = new Cesium.CylinderGeometry({\n *     length: 200000,\n *     topRadius: 80000,\n *     bottomRadius: 200000,\n * });\n * const geometry = Cesium.CylinderGeometry.createGeometry(cylinder);\n */\nfunction CylinderGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const length = options.length;\n  const topRadius = options.topRadius;\n  const bottomRadius = options.bottomRadius;\n  const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n  const slices = defaultValue(options.slices, 128);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(length)) {\n    throw new DeveloperError(\"options.length must be defined.\");\n  }\n  if (!defined(topRadius)) {\n    throw new DeveloperError(\"options.topRadius must be defined.\");\n  }\n  if (!defined(bottomRadius)) {\n    throw new DeveloperError(\"options.bottomRadius must be defined.\");\n  }\n  if (slices < 3) {\n    throw new DeveloperError(\n      \"options.slices must be greater than or equal to 3.\"\n    );\n  }\n  if (\n    defined(options.offsetAttribute) &&\n    options.offsetAttribute === GeometryOffsetAttribute.TOP\n  ) {\n    throw new DeveloperError(\n      \"GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._length = length;\n  this._topRadius = topRadius;\n  this._bottomRadius = bottomRadius;\n  this._vertexFormat = VertexFormat.clone(vertexFormat);\n  this._slices = slices;\n  this._offsetAttribute = options.offsetAttribute;\n  this._workerName = \"createCylinderGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nCylinderGeometry.packedLength = VertexFormat.packedLength + 5;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CylinderGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nCylinderGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required\");\n  }\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  VertexFormat.pack(value._vertexFormat, array, startingIndex);\n  startingIndex += VertexFormat.packedLength;\n\n  array[startingIndex++] = value._length;\n  array[startingIndex++] = value._topRadius;\n  array[startingIndex++] = value._bottomRadius;\n  array[startingIndex++] = value._slices;\n  array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n  return array;\n};\n\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n  vertexFormat: scratchVertexFormat,\n  length: undefined,\n  topRadius: undefined,\n  bottomRadius: undefined,\n  slices: undefined,\n  offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CylinderGeometry} [result] The object into which to store the result.\n * @returns {CylinderGeometry} The modified result parameter or a new CylinderGeometry instance if one was not provided.\n */\nCylinderGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const vertexFormat = VertexFormat.unpack(\n    array,\n    startingIndex,\n    scratchVertexFormat\n  );\n  startingIndex += VertexFormat.packedLength;\n\n  const length = array[startingIndex++];\n  const topRadius = array[startingIndex++];\n  const bottomRadius = array[startingIndex++];\n  const slices = array[startingIndex++];\n  const offsetAttribute = array[startingIndex];\n\n  if (!defined(result)) {\n    scratchOptions.length = length;\n    scratchOptions.topRadius = topRadius;\n    scratchOptions.bottomRadius = bottomRadius;\n    scratchOptions.slices = slices;\n    scratchOptions.offsetAttribute =\n      offsetAttribute === -1 ? undefined : offsetAttribute;\n    return new CylinderGeometry(scratchOptions);\n  }\n\n  result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n  result._length = length;\n  result._topRadius = topRadius;\n  result._bottomRadius = bottomRadius;\n  result._slices = slices;\n  result._offsetAttribute =\n    offsetAttribute === -1 ? undefined : offsetAttribute;\n\n  return result;\n};\n\n/**\n * Computes the geometric representation of a cylinder, including its vertices, indices, and a bounding sphere.\n *\n * @param {CylinderGeometry} cylinderGeometry A description of the cylinder.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCylinderGeometry.createGeometry = function (cylinderGeometry) {\n  let length = cylinderGeometry._length;\n  const topRadius = cylinderGeometry._topRadius;\n  const bottomRadius = cylinderGeometry._bottomRadius;\n  const vertexFormat = cylinderGeometry._vertexFormat;\n  const slices = cylinderGeometry._slices;\n\n  if (\n    length <= 0 ||\n    topRadius < 0 ||\n    bottomRadius < 0 ||\n    (topRadius === 0 && bottomRadius === 0)\n  ) {\n    return;\n  }\n\n  const twoSlices = slices + slices;\n  const threeSlices = slices + twoSlices;\n  const numVertices = twoSlices + twoSlices;\n\n  const positions = CylinderGeometryLibrary.computePositions(\n    length,\n    topRadius,\n    bottomRadius,\n    slices,\n    true\n  );\n\n  const st = vertexFormat.st ? new Float32Array(numVertices * 2) : undefined;\n  const normals = vertexFormat.normal\n    ? new Float32Array(numVertices * 3)\n    : undefined;\n  const tangents = vertexFormat.tangent\n    ? new Float32Array(numVertices * 3)\n    : undefined;\n  const bitangents = vertexFormat.bitangent\n    ? new Float32Array(numVertices * 3)\n    : undefined;\n\n  let i;\n  const computeNormal =\n    vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent;\n\n  if (computeNormal) {\n    const computeTangent = vertexFormat.tangent || vertexFormat.bitangent;\n\n    let normalIndex = 0;\n    let tangentIndex = 0;\n    let bitangentIndex = 0;\n\n    const theta = Math.atan2(bottomRadius - topRadius, length);\n    const normal = normalScratch;\n    normal.z = Math.sin(theta);\n    const normalScale = Math.cos(theta);\n    let tangent = tangentScratch;\n    let bitangent = bitangentScratch;\n\n    for (i = 0; i < slices; i++) {\n      const angle = (i / slices) * CesiumMath.TWO_PI;\n      const x = normalScale * Math.cos(angle);\n      const y = normalScale * Math.sin(angle);\n      if (computeNormal) {\n        normal.x = x;\n        normal.y = y;\n\n        if (computeTangent) {\n          tangent = Cartesian3.normalize(\n            Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent),\n            tangent\n          );\n        }\n\n        if (vertexFormat.normal) {\n          normals[normalIndex++] = normal.x;\n          normals[normalIndex++] = normal.y;\n          normals[normalIndex++] = normal.z;\n          normals[normalIndex++] = normal.x;\n          normals[normalIndex++] = normal.y;\n          normals[normalIndex++] = normal.z;\n        }\n\n        if (vertexFormat.tangent) {\n          tangents[tangentIndex++] = tangent.x;\n          tangents[tangentIndex++] = tangent.y;\n          tangents[tangentIndex++] = tangent.z;\n          tangents[tangentIndex++] = tangent.x;\n          tangents[tangentIndex++] = tangent.y;\n          tangents[tangentIndex++] = tangent.z;\n        }\n\n        if (vertexFormat.bitangent) {\n          bitangent = Cartesian3.normalize(\n            Cartesian3.cross(normal, tangent, bitangent),\n            bitangent\n          );\n          bitangents[bitangentIndex++] = bitangent.x;\n          bitangents[bitangentIndex++] = bitangent.y;\n          bitangents[bitangentIndex++] = bitangent.z;\n          bitangents[bitangentIndex++] = bitangent.x;\n          bitangents[bitangentIndex++] = bitangent.y;\n          bitangents[bitangentIndex++] = bitangent.z;\n        }\n      }\n    }\n\n    for (i = 0; i < slices; i++) {\n      if (vertexFormat.normal) {\n        normals[normalIndex++] = 0;\n        normals[normalIndex++] = 0;\n        normals[normalIndex++] = -1;\n      }\n      if (vertexFormat.tangent) {\n        tangents[tangentIndex++] = 1;\n        tangents[tangentIndex++] = 0;\n        tangents[tangentIndex++] = 0;\n      }\n      if (vertexFormat.bitangent) {\n        bitangents[bitangentIndex++] = 0;\n        bitangents[bitangentIndex++] = -1;\n        bitangents[bitangentIndex++] = 0;\n      }\n    }\n\n    for (i = 0; i < slices; i++) {\n      if (vertexFormat.normal) {\n        normals[normalIndex++] = 0;\n        normals[normalIndex++] = 0;\n        normals[normalIndex++] = 1;\n      }\n      if (vertexFormat.tangent) {\n        tangents[tangentIndex++] = 1;\n        tangents[tangentIndex++] = 0;\n        tangents[tangentIndex++] = 0;\n      }\n      if (vertexFormat.bitangent) {\n        bitangents[bitangentIndex++] = 0;\n        bitangents[bitangentIndex++] = 1;\n        bitangents[bitangentIndex++] = 0;\n      }\n    }\n  }\n\n  const numIndices = 12 * slices - 12;\n  const indices = IndexDatatype.createTypedArray(numVertices, numIndices);\n  let index = 0;\n  let j = 0;\n  for (i = 0; i < slices - 1; i++) {\n    indices[index++] = j;\n    indices[index++] = j + 2;\n    indices[index++] = j + 3;\n\n    indices[index++] = j;\n    indices[index++] = j + 3;\n    indices[index++] = j + 1;\n\n    j += 2;\n  }\n\n  indices[index++] = twoSlices - 2;\n  indices[index++] = 0;\n  indices[index++] = 1;\n  indices[index++] = twoSlices - 2;\n  indices[index++] = 1;\n  indices[index++] = twoSlices - 1;\n\n  for (i = 1; i < slices - 1; i++) {\n    indices[index++] = twoSlices + i + 1;\n    indices[index++] = twoSlices + i;\n    indices[index++] = twoSlices;\n  }\n\n  for (i = 1; i < slices - 1; i++) {\n    indices[index++] = threeSlices;\n    indices[index++] = threeSlices + i;\n    indices[index++] = threeSlices + i + 1;\n  }\n\n  let textureCoordIndex = 0;\n  if (vertexFormat.st) {\n    const rad = Math.max(topRadius, bottomRadius);\n    for (i = 0; i < numVertices; i++) {\n      const position = Cartesian3.fromArray(positions, i * 3, positionScratch);\n      st[textureCoordIndex++] = (position.x + rad) / (2.0 * rad);\n      st[textureCoordIndex++] = (position.y + rad) / (2.0 * rad);\n    }\n  }\n\n  const attributes = new GeometryAttributes();\n  if (vertexFormat.position) {\n    attributes.position = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: positions,\n    });\n  }\n\n  if (vertexFormat.normal) {\n    attributes.normal = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: normals,\n    });\n  }\n\n  if (vertexFormat.tangent) {\n    attributes.tangent = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: tangents,\n    });\n  }\n\n  if (vertexFormat.bitangent) {\n    attributes.bitangent = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: bitangents,\n    });\n  }\n\n  if (vertexFormat.st) {\n    attributes.st = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n      values: st,\n    });\n  }\n\n  radiusScratch.x = length * 0.5;\n  radiusScratch.y = Math.max(bottomRadius, topRadius);\n\n  const boundingSphere = new BoundingSphere(\n    Cartesian3.ZERO,\n    Cartesian2.magnitude(radiusScratch)\n  );\n\n  if (defined(cylinderGeometry._offsetAttribute)) {\n    length = positions.length;\n    const offsetValue =\n      cylinderGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n        ? 0\n        : 1;\n    const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n    attributes.applyOffset = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 1,\n      values: applyOffset,\n    });\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: PrimitiveType.TRIANGLES,\n    boundingSphere: boundingSphere,\n    offsetAttribute: cylinderGeometry._offsetAttribute,\n  });\n};\n\nlet unitCylinderGeometry;\n\n/**\n * Returns the geometric representation of a unit cylinder, including its vertices, indices, and a bounding sphere.\n * @returns {Geometry} The computed vertices and indices.\n *\n * @private\n */\nCylinderGeometry.getUnitCylinder = function () {\n  if (!defined(unitCylinderGeometry)) {\n    unitCylinderGeometry = CylinderGeometry.createGeometry(\n      new CylinderGeometry({\n        topRadius: 1.0,\n        bottomRadius: 1.0,\n        length: 1.0,\n        vertexFormat: VertexFormat.POSITION_ONLY,\n      })\n    );\n  }\n  return unitCylinderGeometry;\n};\nexport default CylinderGeometry;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CylinderGeometryLibrary from \"./CylinderGeometryLibrary.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\nconst radiusScratch = new Cartesian2();\n\n/**\n * A description of the outline of a cylinder.\n *\n * @alias CylinderOutlineGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {number} options.length The length of the cylinder.\n * @param {number} options.topRadius The radius of the top of the cylinder.\n * @param {number} options.bottomRadius The radius of the bottom of the cylinder.\n * @param {number} [options.slices=128] The number of edges around the perimeter of the cylinder.\n * @param {number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom surfaces of the cylinder.\n *\n * @exception {DeveloperError} options.length must be greater than 0.\n * @exception {DeveloperError} options.topRadius must be greater than 0.\n * @exception {DeveloperError} options.bottomRadius must be greater than 0.\n * @exception {DeveloperError} bottomRadius and topRadius cannot both equal 0.\n * @exception {DeveloperError} options.slices must be greater than or equal to 3.\n *\n * @see CylinderOutlineGeometry.createGeometry\n *\n * @example\n * // create cylinder geometry\n * const cylinder = new Cesium.CylinderOutlineGeometry({\n *     length: 200000,\n *     topRadius: 80000,\n *     bottomRadius: 200000,\n * });\n * const geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder);\n */\nfunction CylinderOutlineGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const length = options.length;\n  const topRadius = options.topRadius;\n  const bottomRadius = options.bottomRadius;\n  const slices = defaultValue(options.slices, 128);\n  const numberOfVerticalLines = Math.max(\n    defaultValue(options.numberOfVerticalLines, 16),\n    0\n  );\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"options.positions\", length);\n  Check.typeOf.number(\"options.topRadius\", topRadius);\n  Check.typeOf.number(\"options.bottomRadius\", bottomRadius);\n  Check.typeOf.number.greaterThanOrEquals(\"options.slices\", slices, 3);\n  if (\n    defined(options.offsetAttribute) &&\n    options.offsetAttribute === GeometryOffsetAttribute.TOP\n  ) {\n    throw new DeveloperError(\n      \"GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._length = length;\n  this._topRadius = topRadius;\n  this._bottomRadius = bottomRadius;\n  this._slices = slices;\n  this._numberOfVerticalLines = numberOfVerticalLines;\n  this._offsetAttribute = options.offsetAttribute;\n  this._workerName = \"createCylinderOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nCylinderOutlineGeometry.packedLength = 6;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CylinderOutlineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nCylinderOutlineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  array[startingIndex++] = value._length;\n  array[startingIndex++] = value._topRadius;\n  array[startingIndex++] = value._bottomRadius;\n  array[startingIndex++] = value._slices;\n  array[startingIndex++] = value._numberOfVerticalLines;\n  array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n  return array;\n};\n\nconst scratchOptions = {\n  length: undefined,\n  topRadius: undefined,\n  bottomRadius: undefined,\n  slices: undefined,\n  numberOfVerticalLines: undefined,\n  offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CylinderOutlineGeometry} [result] The object into which to store the result.\n * @returns {CylinderOutlineGeometry} The modified result parameter or a new CylinderOutlineGeometry instance if one was not provided.\n */\nCylinderOutlineGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const length = array[startingIndex++];\n  const topRadius = array[startingIndex++];\n  const bottomRadius = array[startingIndex++];\n  const slices = array[startingIndex++];\n  const numberOfVerticalLines = array[startingIndex++];\n  const offsetAttribute = array[startingIndex];\n\n  if (!defined(result)) {\n    scratchOptions.length = length;\n    scratchOptions.topRadius = topRadius;\n    scratchOptions.bottomRadius = bottomRadius;\n    scratchOptions.slices = slices;\n    scratchOptions.numberOfVerticalLines = numberOfVerticalLines;\n    scratchOptions.offsetAttribute =\n      offsetAttribute === -1 ? undefined : offsetAttribute;\n    return new CylinderOutlineGeometry(scratchOptions);\n  }\n\n  result._length = length;\n  result._topRadius = topRadius;\n  result._bottomRadius = bottomRadius;\n  result._slices = slices;\n  result._numberOfVerticalLines = numberOfVerticalLines;\n  result._offsetAttribute =\n    offsetAttribute === -1 ? undefined : offsetAttribute;\n\n  return result;\n};\n\n/**\n * Computes the geometric representation of an outline of a cylinder, including its vertices, indices, and a bounding sphere.\n *\n * @param {CylinderOutlineGeometry} cylinderGeometry A description of the cylinder outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCylinderOutlineGeometry.createGeometry = function (cylinderGeometry) {\n  let length = cylinderGeometry._length;\n  const topRadius = cylinderGeometry._topRadius;\n  const bottomRadius = cylinderGeometry._bottomRadius;\n  const slices = cylinderGeometry._slices;\n  const numberOfVerticalLines = cylinderGeometry._numberOfVerticalLines;\n\n  if (\n    length <= 0 ||\n    topRadius < 0 ||\n    bottomRadius < 0 ||\n    (topRadius === 0 && bottomRadius === 0)\n  ) {\n    return;\n  }\n\n  const numVertices = slices * 2;\n\n  const positions = CylinderGeometryLibrary.computePositions(\n    length,\n    topRadius,\n    bottomRadius,\n    slices,\n    false\n  );\n  let numIndices = slices * 2;\n  let numSide;\n  if (numberOfVerticalLines > 0) {\n    const numSideLines = Math.min(numberOfVerticalLines, slices);\n    numSide = Math.round(slices / numSideLines);\n    numIndices += numSideLines;\n  }\n\n  const indices = IndexDatatype.createTypedArray(numVertices, numIndices * 2);\n  let index = 0;\n  let i;\n  for (i = 0; i < slices - 1; i++) {\n    indices[index++] = i;\n    indices[index++] = i + 1;\n    indices[index++] = i + slices;\n    indices[index++] = i + 1 + slices;\n  }\n\n  indices[index++] = slices - 1;\n  indices[index++] = 0;\n  indices[index++] = slices + slices - 1;\n  indices[index++] = slices;\n\n  if (numberOfVerticalLines > 0) {\n    for (i = 0; i < slices; i += numSide) {\n      indices[index++] = i;\n      indices[index++] = i + slices;\n    }\n  }\n\n  const attributes = new GeometryAttributes();\n  attributes.position = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.DOUBLE,\n    componentsPerAttribute: 3,\n    values: positions,\n  });\n\n  radiusScratch.x = length * 0.5;\n  radiusScratch.y = Math.max(bottomRadius, topRadius);\n\n  const boundingSphere = new BoundingSphere(\n    Cartesian3.ZERO,\n    Cartesian2.magnitude(radiusScratch)\n  );\n\n  if (defined(cylinderGeometry._offsetAttribute)) {\n    length = positions.length;\n    const offsetValue =\n      cylinderGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n        ? 0\n        : 1;\n    const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n    attributes.applyOffset = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 1,\n      values: applyOffset,\n    });\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: PrimitiveType.LINES,\n    boundingSphere: boundingSphere,\n    offsetAttribute: cylinderGeometry._offsetAttribute,\n  });\n};\nexport default CylinderOutlineGeometry;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport CylinderGeometry from \"../Core/CylinderGeometry.js\";\nimport CylinderOutlineGeometry from \"../Core/CylinderOutlineGeometry.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GeometryOffsetAttribute from \"../Core/GeometryOffsetAttribute.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport heightReferenceOnEntityPropertyChanged from \"./heightReferenceOnEntityPropertyChanged.js\";\nimport Property from \"./Property.js\";\n\nconst defaultOffset = Cartesian3.ZERO;\n\nconst offsetScratch = new Cartesian3();\nconst positionScratch = new Cartesian3();\nconst scratchColor = new Color();\n\nfunction CylinderGeometryOptions(entity) {\n  this.id = entity;\n  this.vertexFormat = undefined;\n  this.length = undefined;\n  this.topRadius = undefined;\n  this.bottomRadius = undefined;\n  this.slices = undefined;\n  this.numberOfVerticalLines = undefined;\n  this.offsetAttribute = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for cylinders.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias CylinderGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction CylinderGeometryUpdater(entity, scene) {\n  GeometryUpdater.call(this, {\n    entity: entity,\n    scene: scene,\n    geometryOptions: new CylinderGeometryOptions(entity),\n    geometryPropertyName: \"cylinder\",\n    observedPropertyNames: [\n      \"availability\",\n      \"position\",\n      \"orientation\",\n      \"cylinder\",\n    ],\n  });\n\n  this._onEntityPropertyChanged(entity, \"cylinder\", entity.cylinder, undefined);\n}\n\nif (defined(Object.create)) {\n  CylinderGeometryUpdater.prototype = Object.create(GeometryUpdater.prototype);\n  CylinderGeometryUpdater.prototype.constructor = CylinderGeometryUpdater;\n}\n\nObject.defineProperties(CylinderGeometryUpdater.prototype, {\n  /**\n   * Gets the terrain offset property\n   * @type {TerrainOffsetProperty}\n   * @memberof CylinderGeometryUpdater.prototype\n   * @readonly\n   * @private\n   */\n  terrainOffsetProperty: {\n    get: function () {\n      return this._terrainOffsetProperty;\n    },\n  },\n});\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nCylinderGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._fillEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent a filled geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n\n  const show = new ShowGeometryInstanceAttribute(\n    isAvailable &&\n      entity.isShowing &&\n      this._showProperty.getValue(time) &&\n      this._fillProperty.getValue(time)\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n  const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n    distanceDisplayCondition\n  );\n\n  const attributes = {\n    show: show,\n    distanceDisplayCondition: distanceDisplayConditionAttribute,\n    color: undefined,\n    offset: undefined,\n  };\n  if (this._materialProperty instanceof ColorMaterialProperty) {\n    let currentColor;\n    if (\n      defined(this._materialProperty.color) &&\n      (this._materialProperty.color.isConstant || isAvailable)\n    ) {\n      currentColor = this._materialProperty.color.getValue(time, scratchColor);\n    }\n    if (!defined(currentColor)) {\n      currentColor = Color.WHITE;\n    }\n    attributes.color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n  }\n\n  if (defined(this._options.offsetAttribute)) {\n    attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n      Property.getValueOrDefault(\n        this._terrainOffsetProperty,\n        time,\n        defaultOffset,\n        offsetScratch\n      )\n    );\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new CylinderGeometry(this._options),\n    modelMatrix: entity.computeModelMatrixForHeightReference(\n      time,\n      entity.cylinder.heightReference,\n      this._options.length * 0.5,\n      this._scene.mapProjection.ellipsoid\n    ),\n    attributes: attributes,\n  });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nCylinderGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n  time\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._outlineEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent an outlined geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n  const outlineColor = Property.getValueOrDefault(\n    this._outlineColorProperty,\n    time,\n    Color.BLACK,\n    scratchColor\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n\n  const attributes = {\n    show: new ShowGeometryInstanceAttribute(\n      isAvailable &&\n        entity.isShowing &&\n        this._showProperty.getValue(time) &&\n        this._showOutlineProperty.getValue(time)\n    ),\n    color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n    distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n      distanceDisplayCondition\n    ),\n    offset: undefined,\n  };\n  if (defined(this._options.offsetAttribute)) {\n    attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n      Property.getValueOrDefault(\n        this._terrainOffsetProperty,\n        time,\n        defaultOffset,\n        offsetScratch\n      )\n    );\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new CylinderOutlineGeometry(this._options),\n    modelMatrix: entity.computeModelMatrixForHeightReference(\n      time,\n      entity.cylinder.heightReference,\n      this._options.length * 0.5,\n      this._scene.mapProjection.ellipsoid\n    ),\n    attributes: attributes,\n  });\n};\n\nCylinderGeometryUpdater.prototype._computeCenter = function (time, result) {\n  return Property.getValueOrUndefined(this._entity.position, time, result);\n};\n\nCylinderGeometryUpdater.prototype._isHidden = function (entity, cylinder) {\n  return (\n    !defined(entity.position) ||\n    !defined(cylinder.length) ||\n    !defined(cylinder.topRadius) ||\n    !defined(cylinder.bottomRadius) ||\n    GeometryUpdater.prototype._isHidden.call(this, entity, cylinder)\n  );\n};\n\nCylinderGeometryUpdater.prototype._isDynamic = function (entity, cylinder) {\n  return (\n    !entity.position.isConstant || //\n    !Property.isConstant(entity.orientation) || //\n    !cylinder.length.isConstant || //\n    !cylinder.topRadius.isConstant || //\n    !cylinder.bottomRadius.isConstant || //\n    !Property.isConstant(cylinder.slices) || //\n    !Property.isConstant(cylinder.outlineWidth) || //\n    !Property.isConstant(cylinder.numberOfVerticalLines)\n  );\n};\n\nCylinderGeometryUpdater.prototype._setStaticOptions = function (\n  entity,\n  cylinder\n) {\n  const heightReference = Property.getValueOrDefault(\n    cylinder.heightReference,\n    Iso8601.MINIMUM_VALUE,\n    HeightReference.NONE\n  );\n  const options = this._options;\n  options.vertexFormat =\n    this._materialProperty instanceof ColorMaterialProperty\n      ? PerInstanceColorAppearance.VERTEX_FORMAT\n      : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n  options.length = cylinder.length.getValue(Iso8601.MINIMUM_VALUE);\n  options.topRadius = cylinder.topRadius.getValue(Iso8601.MINIMUM_VALUE);\n  options.bottomRadius = cylinder.bottomRadius.getValue(Iso8601.MINIMUM_VALUE);\n  options.slices = Property.getValueOrUndefined(\n    cylinder.slices,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.numberOfVerticalLines = Property.getValueOrUndefined(\n    cylinder.numberOfVerticalLines,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.offsetAttribute =\n    heightReference !== HeightReference.NONE\n      ? GeometryOffsetAttribute.ALL\n      : undefined;\n};\n\nCylinderGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged;\n\nCylinderGeometryUpdater.DynamicGeometryUpdater = DynamicCylinderGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicCylinderGeometryUpdater(\n  geometryUpdater,\n  primitives,\n  groundPrimitives\n) {\n  DynamicGeometryUpdater.call(\n    this,\n    geometryUpdater,\n    primitives,\n    groundPrimitives\n  );\n}\n\nif (defined(Object.create)) {\n  DynamicCylinderGeometryUpdater.prototype = Object.create(\n    DynamicGeometryUpdater.prototype\n  );\n  DynamicCylinderGeometryUpdater.prototype.constructor = DynamicCylinderGeometryUpdater;\n}\n\nDynamicCylinderGeometryUpdater.prototype._isHidden = function (\n  entity,\n  cylinder,\n  time\n) {\n  const options = this._options;\n  const position = Property.getValueOrUndefined(\n    entity.position,\n    time,\n    positionScratch\n  );\n  return (\n    !defined(position) ||\n    !defined(options.length) ||\n    !defined(options.topRadius) || //\n    !defined(options.bottomRadius) ||\n    DynamicGeometryUpdater.prototype._isHidden.call(\n      this,\n      entity,\n      cylinder,\n      time\n    )\n  );\n};\n\nDynamicCylinderGeometryUpdater.prototype._setOptions = function (\n  entity,\n  cylinder,\n  time\n) {\n  const heightReference = Property.getValueOrDefault(\n    cylinder.heightReference,\n    time,\n    HeightReference.NONE\n  );\n  const options = this._options;\n  options.length = Property.getValueOrUndefined(cylinder.length, time);\n  options.topRadius = Property.getValueOrUndefined(cylinder.topRadius, time);\n  options.bottomRadius = Property.getValueOrUndefined(\n    cylinder.bottomRadius,\n    time\n  );\n  options.slices = Property.getValueOrUndefined(cylinder.slices, time);\n  options.numberOfVerticalLines = Property.getValueOrUndefined(\n    cylinder.numberOfVerticalLines,\n    time\n  );\n  options.offsetAttribute =\n    heightReference !== HeightReference.NONE\n      ? GeometryOffsetAttribute.ALL\n      : undefined;\n};\nexport default CylinderGeometryUpdater;\n", "/**\n * Constants used by {@link Clock#tick} to determine behavior\n * when {@link Clock#startTime} or {@link Clock#stopTime} is reached.\n *\n * @enum {number}\n *\n * @see Clock\n * @see ClockStep\n */\nconst ClockRange = {\n  /**\n   * {@link Clock#tick} will always advances the clock in its current direction.\n   *\n   * @type {number}\n   * @constant\n   */\n  UNBOUNDED: 0,\n\n  /**\n   * When {@link Clock#startTime} or {@link Clock#stopTime} is reached,\n   * {@link Clock#tick} will not advance {@link Clock#currentTime} any further.\n   *\n   * @type {number}\n   * @constant\n   */\n  CLAMPED: 1,\n\n  /**\n   * When {@link Clock#stopTime} is reached, {@link Clock#tick} will advance\n   * {@link Clock#currentTime} to the opposite end of the interval.  When\n   * time is moving backwards, {@link Clock#tick} will not advance past\n   * {@link Clock#startTime}\n   *\n   * @type {number}\n   * @constant\n   */\n  LOOP_STOP: 2,\n};\nexport default Object.freeze(ClockRange);\n", "/**\n * Constants to determine how much time advances with each call\n * to {@link Clock#tick}.\n *\n * @enum {number}\n *\n * @see Clock\n * @see ClockRange\n */\nconst ClockStep = {\n  /**\n   * {@link Clock#tick} advances the current time by a fixed step,\n   * which is the number of seconds specified by {@link Clock#multiplier}.\n   *\n   * @type {number}\n   * @constant\n   */\n  TICK_DEPENDENT: 0,\n\n  /**\n   * {@link Clock#tick} advances the current time by the amount of system\n   * time elapsed since the previous call multiplied by {@link Clock#multiplier}.\n   *\n   * @type {number}\n   * @constant\n   */\n  SYSTEM_CLOCK_MULTIPLIER: 1,\n\n  /**\n   * {@link Clock#tick} sets the clock to the current system time;\n   * ignoring all other settings.\n   *\n   * @type {number}\n   * @constant\n   */\n  SYSTEM_CLOCK: 2,\n};\nexport default Object.freeze(ClockStep);\n", "/**\n * Constants to determine how an interpolated value is extrapolated\n * when querying outside the bounds of available data.\n *\n * @enum {number}\n *\n * @see SampledProperty\n */\nconst ExtrapolationType = {\n  /**\n   * No extrapolation occurs.\n   *\n   * @type {number}\n   * @constant\n   */\n  NONE: 0,\n\n  /**\n   * The first or last value is used when outside the range of sample data.\n   *\n   * @type {number}\n   * @constant\n   */\n  HOLD: 1,\n\n  /**\n   * The value is extrapolated.\n   *\n   * @type {number}\n   * @constant\n   */\n  EXTRAPOLATE: 2,\n};\nexport default Object.freeze(ExtrapolationType);\n", "import Uri from \"urijs\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Given a URI, returns the last segment of the URI, removing any path or query information.\n * @function getFilenameFromUri\n *\n * @param {string} uri The Uri.\n * @returns {string} The last segment of the Uri.\n *\n * @example\n * //fileName will be\"simple.czml\";\n * const fileName = Cesium.getFilenameFromUri('/Gallery/simple.czml?value=true&example=false');\n */\nfunction getFilenameFromUri(uri) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(uri)) {\n    throw new DeveloperError(\"uri is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const uriObject = new Uri(uri);\n  uriObject.normalize();\n  let path = uriObject.path();\n  const index = path.lastIndexOf(\"/\");\n  if (index !== -1) {\n    path = path.substr(index + 1);\n  }\n  return path;\n}\nexport default getFilenameFromUri;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\nconst factorial = CesiumMath.factorial;\n\nfunction calculateCoefficientTerm(\n  x,\n  zIndices,\n  xTable,\n  derivOrder,\n  termOrder,\n  reservedIndices\n) {\n  let result = 0;\n  let reserved;\n  let i;\n  let j;\n\n  if (derivOrder > 0) {\n    for (i = 0; i < termOrder; i++) {\n      reserved = false;\n      for (j = 0; j < reservedIndices.length && !reserved; j++) {\n        if (i === reservedIndices[j]) {\n          reserved = true;\n        }\n      }\n\n      if (!reserved) {\n        reservedIndices.push(i);\n        result += calculateCoefficientTerm(\n          x,\n          zIndices,\n          xTable,\n          derivOrder - 1,\n          termOrder,\n          reservedIndices\n        );\n        reservedIndices.splice(reservedIndices.length - 1, 1);\n      }\n    }\n\n    return result;\n  }\n\n  result = 1;\n  for (i = 0; i < termOrder; i++) {\n    reserved = false;\n    for (j = 0; j < reservedIndices.length && !reserved; j++) {\n      if (i === reservedIndices[j]) {\n        reserved = true;\n      }\n    }\n\n    if (!reserved) {\n      result *= x - xTable[zIndices[i]];\n    }\n  }\n\n  return result;\n}\n\n/**\n * An {@link InterpolationAlgorithm} for performing Hermite interpolation.\n *\n * @namespace HermitePolynomialApproximation\n */\nconst HermitePolynomialApproximation = {\n  type: \"Hermite\",\n};\n\n/**\n * Given the desired degree, returns the number of data points required for interpolation.\n *\n * @param {number} degree The desired degree of interpolation.\n * @param {number} [inputOrder=0]  The order of the inputs (0 means just the data, 1 means the data and its derivative, etc).\n * @returns {number} The number of required data points needed for the desired degree of interpolation.\n * @exception {DeveloperError} degree must be 0 or greater.\n * @exception {DeveloperError} inputOrder must be 0 or greater.\n */\nHermitePolynomialApproximation.getRequiredDataPoints = function (\n  degree,\n  inputOrder\n) {\n  inputOrder = defaultValue(inputOrder, 0);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(degree)) {\n    throw new DeveloperError(\"degree is required.\");\n  }\n  if (degree < 0) {\n    throw new DeveloperError(\"degree must be 0 or greater.\");\n  }\n  if (inputOrder < 0) {\n    throw new DeveloperError(\"inputOrder must be 0 or greater.\");\n  }\n  //>>includeEnd('debug');\n\n  return Math.max(Math.floor((degree + 1) / (inputOrder + 1)), 2);\n};\n\n/**\n * Interpolates values using Hermite Polynomial Approximation.\n *\n * @param {number} x The independent variable for which the dependent variables will be interpolated.\n * @param {number[]} xTable The array of independent variables to use to interpolate.  The values\n * in this array must be in increasing order and the same value must not occur twice in the array.\n * @param {number[]} yTable The array of dependent variables to use to interpolate.  For a set of three\n * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.\n * @param {number} yStride The number of dependent variable values in yTable corresponding to\n * each independent variable value in xTable.\n * @param {number[]} [result] An existing array into which to store the result.\n * @returns {number[]} The array of interpolated values, or the result parameter if one was provided.\n */\nHermitePolynomialApproximation.interpolateOrderZero = function (\n  x,\n  xTable,\n  yTable,\n  yStride,\n  result\n) {\n  if (!defined(result)) {\n    result = new Array(yStride);\n  }\n\n  let i;\n  let j;\n  let d;\n  let s;\n  let len;\n  let index;\n  const length = xTable.length;\n  const coefficients = new Array(yStride);\n\n  for (i = 0; i < yStride; i++) {\n    result[i] = 0;\n\n    const l = new Array(length);\n    coefficients[i] = l;\n    for (j = 0; j < length; j++) {\n      l[j] = [];\n    }\n  }\n\n  const zIndicesLength = length,\n    zIndices = new Array(zIndicesLength);\n\n  for (i = 0; i < zIndicesLength; i++) {\n    zIndices[i] = i;\n  }\n\n  let highestNonZeroCoef = length - 1;\n  for (s = 0; s < yStride; s++) {\n    for (j = 0; j < zIndicesLength; j++) {\n      index = zIndices[j] * yStride + s;\n      coefficients[s][0].push(yTable[index]);\n    }\n\n    for (i = 1; i < zIndicesLength; i++) {\n      let nonZeroCoefficients = false;\n      for (j = 0; j < zIndicesLength - i; j++) {\n        const zj = xTable[zIndices[j]];\n        const zn = xTable[zIndices[j + i]];\n\n        let numerator;\n        if (zn - zj <= 0) {\n          index = zIndices[j] * yStride + yStride * i + s;\n          numerator = yTable[index];\n          coefficients[s][i].push(numerator / factorial(i));\n        } else {\n          numerator = coefficients[s][i - 1][j + 1] - coefficients[s][i - 1][j];\n          coefficients[s][i].push(numerator / (zn - zj));\n        }\n        nonZeroCoefficients = nonZeroCoefficients || numerator !== 0;\n      }\n\n      if (!nonZeroCoefficients) {\n        highestNonZeroCoef = i - 1;\n      }\n    }\n  }\n\n  for (d = 0, len = 0; d <= len; d++) {\n    for (i = d; i <= highestNonZeroCoef; i++) {\n      const tempTerm = calculateCoefficientTerm(x, zIndices, xTable, d, i, []);\n      for (s = 0; s < yStride; s++) {\n        const coeff = coefficients[s][i][0];\n        result[s + d * yStride] += coeff * tempTerm;\n      }\n    }\n  }\n\n  return result;\n};\n\nconst arrayScratch = [];\n\n/**\n * Interpolates values using Hermite Polynomial Approximation.\n *\n * @param {number} x The independent variable for which the dependent variables will be interpolated.\n * @param {number[]} xTable The array of independent variables to use to interpolate.  The values\n * in this array must be in increasing order and the same value must not occur twice in the array.\n * @param {number[]} yTable The array of dependent variables to use to interpolate.  For a set of three\n * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.\n * @param {number} yStride The number of dependent variable values in yTable corresponding to\n * each independent variable value in xTable.\n * @param {number} inputOrder The number of derivatives supplied for input.\n * @param {number} outputOrder The number of derivatives desired for output.\n * @param {number[]} [result] An existing array into which to store the result.\n *\n * @returns {number[]} The array of interpolated values, or the result parameter if one was provided.\n */\nHermitePolynomialApproximation.interpolate = function (\n  x,\n  xTable,\n  yTable,\n  yStride,\n  inputOrder,\n  outputOrder,\n  result\n) {\n  const resultLength = yStride * (outputOrder + 1);\n  if (!defined(result)) {\n    result = new Array(resultLength);\n  }\n  for (let r = 0; r < resultLength; r++) {\n    result[r] = 0;\n  }\n\n  const length = xTable.length;\n  // The zIndices array holds copies of the addresses of the xTable values\n  // in the range we're looking at. Even though this just holds information already\n  // available in xTable this is a much more convenient format.\n  const zIndices = new Array(length * (inputOrder + 1));\n  let i;\n  for (i = 0; i < length; i++) {\n    for (let j = 0; j < inputOrder + 1; j++) {\n      zIndices[i * (inputOrder + 1) + j] = i;\n    }\n  }\n\n  const zIndiceslength = zIndices.length;\n  const coefficients = arrayScratch;\n  const highestNonZeroCoef = fillCoefficientList(\n    coefficients,\n    zIndices,\n    xTable,\n    yTable,\n    yStride,\n    inputOrder\n  );\n  const reservedIndices = [];\n\n  const tmp = (zIndiceslength * (zIndiceslength + 1)) / 2;\n  const loopStop = Math.min(highestNonZeroCoef, outputOrder);\n  for (let d = 0; d <= loopStop; d++) {\n    for (i = d; i <= highestNonZeroCoef; i++) {\n      reservedIndices.length = 0;\n      const tempTerm = calculateCoefficientTerm(\n        x,\n        zIndices,\n        xTable,\n        d,\n        i,\n        reservedIndices\n      );\n      const dimTwo = Math.floor((i * (1 - i)) / 2) + zIndiceslength * i;\n\n      for (let s = 0; s < yStride; s++) {\n        const dimOne = Math.floor(s * tmp);\n        const coef = coefficients[dimOne + dimTwo];\n        result[s + d * yStride] += coef * tempTerm;\n      }\n    }\n  }\n\n  return result;\n};\n\nfunction fillCoefficientList(\n  coefficients,\n  zIndices,\n  xTable,\n  yTable,\n  yStride,\n  inputOrder\n) {\n  let j;\n  let index;\n  let highestNonZero = -1;\n  const zIndiceslength = zIndices.length;\n  const tmp = (zIndiceslength * (zIndiceslength + 1)) / 2;\n\n  for (let s = 0; s < yStride; s++) {\n    const dimOne = Math.floor(s * tmp);\n\n    for (j = 0; j < zIndiceslength; j++) {\n      index = zIndices[j] * yStride * (inputOrder + 1) + s;\n      coefficients[dimOne + j] = yTable[index];\n    }\n\n    for (let i = 1; i < zIndiceslength; i++) {\n      let coefIndex = 0;\n      const dimTwo = Math.floor((i * (1 - i)) / 2) + zIndiceslength * i;\n      let nonZeroCoefficients = false;\n\n      for (j = 0; j < zIndiceslength - i; j++) {\n        const zj = xTable[zIndices[j]];\n        const zn = xTable[zIndices[j + i]];\n\n        let numerator;\n        let coefficient;\n        if (zn - zj <= 0) {\n          index = zIndices[j] * yStride * (inputOrder + 1) + yStride * i + s;\n          numerator = yTable[index];\n          coefficient = numerator / CesiumMath.factorial(i);\n          coefficients[dimOne + dimTwo + coefIndex] = coefficient;\n          coefIndex++;\n        } else {\n          const dimTwoMinusOne =\n            Math.floor(((i - 1) * (2 - i)) / 2) + zIndiceslength * (i - 1);\n          numerator =\n            coefficients[dimOne + dimTwoMinusOne + j + 1] -\n            coefficients[dimOne + dimTwoMinusOne + j];\n          coefficient = numerator / (zn - zj);\n          coefficients[dimOne + dimTwo + coefIndex] = coefficient;\n          coefIndex++;\n        }\n        nonZeroCoefficients = nonZeroCoefficients || numerator !== 0.0;\n      }\n\n      if (nonZeroCoefficients) {\n        highestNonZero = Math.max(highestNonZero, i);\n      }\n    }\n  }\n\n  return highestNonZero;\n}\nexport default HermitePolynomialApproximation;\n", "import defined from \"./defined.js\";\n\n/**\n * An {@link InterpolationAlgorithm} for performing Lagrange interpolation.\n *\n * @namespace LagrangePolynomialApproximation\n */\nconst LagrangePolynomialApproximation = {\n  type: \"Lagrange\",\n};\n\n/**\n * Given the desired degree, returns the number of data points required for interpolation.\n *\n * @param {number} degree The desired degree of interpolation.\n * @returns {number} The number of required data points needed for the desired degree of interpolation.\n */\nLagrangePolynomialApproximation.getRequiredDataPoints = function (degree) {\n  return Math.max(degree + 1.0, 2);\n};\n\n/**\n * Interpolates values using Lagrange Polynomial Approximation.\n *\n * @param {number} x The independent variable for which the dependent variables will be interpolated.\n * @param {number[]} xTable The array of independent variables to use to interpolate.  The values\n * in this array must be in increasing order and the same value must not occur twice in the array.\n * @param {number[]} yTable The array of dependent variables to use to interpolate.  For a set of three\n * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.\n * @param {number} yStride The number of dependent variable values in yTable corresponding to\n * each independent variable value in xTable.\n * @param {number[]} [result] An existing array into which to store the result.\n * @returns {number[]} The array of interpolated values, or the result parameter if one was provided.\n */\nLagrangePolynomialApproximation.interpolateOrderZero = function (\n  x,\n  xTable,\n  yTable,\n  yStride,\n  result\n) {\n  if (!defined(result)) {\n    result = new Array(yStride);\n  }\n\n  let i;\n  let j;\n  const length = xTable.length;\n\n  for (i = 0; i < yStride; i++) {\n    result[i] = 0;\n  }\n\n  for (i = 0; i < length; i++) {\n    let coefficient = 1;\n\n    for (j = 0; j < length; j++) {\n      if (j !== i) {\n        const diffX = xTable[i] - xTable[j];\n        coefficient *= (x - xTable[j]) / diffX;\n      }\n    }\n\n    for (j = 0; j < yStride; j++) {\n      result[j] += coefficient * yTable[i * yStride + j];\n    }\n  }\n\n  return result;\n};\nexport default LagrangePolynomialApproximation;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * An {@link InterpolationAlgorithm} for performing linear interpolation.\n *\n * @namespace LinearApproximation\n */\nconst LinearApproximation = {\n  type: \"Linear\",\n};\n\n/**\n * Given the desired degree, returns the number of data points required for interpolation.\n * Since linear interpolation can only generate a first degree polynomial, this function\n * always returns 2.\n * @param {number} degree The desired degree of interpolation.\n * @returns {number} This function always returns 2.\n *\n */\nLinearApproximation.getRequiredDataPoints = function (degree) {\n  return 2;\n};\n\n/**\n * Interpolates values using linear approximation.\n *\n * @param {number} x The independent variable for which the dependent variables will be interpolated.\n * @param {number[]} xTable The array of independent variables to use to interpolate.  The values\n * in this array must be in increasing order and the same value must not occur twice in the array.\n * @param {number[]} yTable The array of dependent variables to use to interpolate.  For a set of three\n * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.\n * @param {number} yStride The number of dependent variable values in yTable corresponding to\n * each independent variable value in xTable.\n * @param {number[]} [result] An existing array into which to store the result.\n * @returns {number[]} The array of interpolated values, or the result parameter if one was provided.\n */\nLinearApproximation.interpolateOrderZero = function (\n  x,\n  xTable,\n  yTable,\n  yStride,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (xTable.length !== 2) {\n    throw new DeveloperError(\n      \"The xTable provided to the linear interpolator must have exactly two elements.\"\n    );\n  } else if (yStride <= 0) {\n    throw new DeveloperError(\n      \"There must be at least 1 dependent variable for each independent variable.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Array(yStride);\n  }\n\n  let i;\n  let y0;\n  let y1;\n  const x0 = xTable[0];\n  const x1 = xTable[1];\n\n  //>>includeStart('debug', pragmas.debug);\n  if (x0 === x1) {\n    throw new DeveloperError(\n      \"Divide by zero error: xTable[0] and xTable[1] are equal\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  for (i = 0; i < yStride; i++) {\n    y0 = yTable[i];\n    y1 = yTable[i + yStride];\n    result[i] = ((y1 - y0) * x + x1 * y0 - x0 * y1) / (x1 - x0);\n  }\n\n  return result;\n};\nexport default LinearApproximation;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\n\n/**\n * A set of curvilinear 3-dimensional coordinates.\n *\n * @alias Spherical\n * @constructor\n *\n * @param {number} [clock=0.0] The angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\n * @param {number} [cone=0.0] The angular coordinate measured from the positive z-axis and toward the negative z-axis.\n * @param {number} [magnitude=1.0] The linear coordinate measured from the origin.\n */\nfunction Spherical(clock, cone, magnitude) {\n  /**\n   * The clock component.\n   * @type {number}\n   * @default 0.0\n   */\n  this.clock = defaultValue(clock, 0.0);\n  /**\n   * The cone component.\n   * @type {number}\n   * @default 0.0\n   */\n  this.cone = defaultValue(cone, 0.0);\n  /**\n   * The magnitude component.\n   * @type {number}\n   * @default 1.0\n   */\n  this.magnitude = defaultValue(magnitude, 1.0);\n}\n\n/**\n * Converts the provided Cartesian3 into Spherical coordinates.\n *\n * @param {Cartesian3} cartesian3 The Cartesian3 to be converted to Spherical.\n * @param {Spherical} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Spherical} The modified result parameter, or a new instance if one was not provided.\n */\nSpherical.fromCartesian3 = function (cartesian3, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"cartesian3\", cartesian3);\n  //>>includeEnd('debug');\n\n  const x = cartesian3.x;\n  const y = cartesian3.y;\n  const z = cartesian3.z;\n  const radialSquared = x * x + y * y;\n\n  if (!defined(result)) {\n    result = new Spherical();\n  }\n\n  result.clock = Math.atan2(y, x);\n  result.cone = Math.atan2(Math.sqrt(radialSquared), z);\n  result.magnitude = Math.sqrt(radialSquared + z * z);\n  return result;\n};\n\n/**\n * Creates a duplicate of a Spherical.\n *\n * @param {Spherical} spherical The spherical to clone.\n * @param {Spherical} [result] The object to store the result into, if undefined a new instance will be created.\n * @returns {Spherical} The modified result parameter or a new instance if result was undefined. (Returns undefined if spherical is undefined)\n */\nSpherical.clone = function (spherical, result) {\n  if (!defined(spherical)) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    return new Spherical(spherical.clock, spherical.cone, spherical.magnitude);\n  }\n\n  result.clock = spherical.clock;\n  result.cone = spherical.cone;\n  result.magnitude = spherical.magnitude;\n  return result;\n};\n\n/**\n * Computes the normalized version of the provided spherical.\n *\n * @param {Spherical} spherical The spherical to be normalized.\n * @param {Spherical} [result] The object to store the result into, if undefined a new instance will be created.\n * @returns {Spherical} The modified result parameter or a new instance if result was undefined.\n */\nSpherical.normalize = function (spherical, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"spherical\", spherical);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Spherical(spherical.clock, spherical.cone, 1.0);\n  }\n\n  result.clock = spherical.clock;\n  result.cone = spherical.cone;\n  result.magnitude = 1.0;\n  return result;\n};\n\n/**\n * Returns true if the first spherical is equal to the second spherical, false otherwise.\n *\n * @param {Spherical} left The first Spherical to be compared.\n * @param {Spherical} right The second Spherical to be compared.\n * @returns {boolean} true if the first spherical is equal to the second spherical, false otherwise.\n */\nSpherical.equals = function (left, right) {\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      left.clock === right.clock &&\n      left.cone === right.cone &&\n      left.magnitude === right.magnitude)\n  );\n};\n\n/**\n * Returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.\n *\n * @param {Spherical} left The first Spherical to be compared.\n * @param {Spherical} right The second Spherical to be compared.\n * @param {number} [epsilon=0.0] The epsilon to compare against.\n * @returns {boolean} true if the first spherical is within the provided epsilon of the second spherical, false otherwise.\n */\nSpherical.equalsEpsilon = function (left, right, epsilon) {\n  epsilon = defaultValue(epsilon, 0.0);\n  return (\n    left === right ||\n    (defined(left) &&\n      defined(right) &&\n      Math.abs(left.clock - right.clock) <= epsilon &&\n      Math.abs(left.cone - right.cone) <= epsilon &&\n      Math.abs(left.magnitude - right.magnitude) <= epsilon)\n  );\n};\n\n/**\n * Returns true if this spherical is equal to the provided spherical, false otherwise.\n *\n * @param {Spherical} other The Spherical to be compared.\n * @returns {boolean} true if this spherical is equal to the provided spherical, false otherwise.\n */\nSpherical.prototype.equals = function (other) {\n  return Spherical.equals(this, other);\n};\n\n/**\n * Creates a duplicate of this Spherical.\n *\n * @param {Spherical} [result] The object to store the result into, if undefined a new instance will be created.\n * @returns {Spherical} The modified result parameter or a new instance if result was undefined.\n */\nSpherical.prototype.clone = function (result) {\n  return Spherical.clone(this, result);\n};\n\n/**\n * Returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.\n *\n * @param {Spherical} other The Spherical to be compared.\n * @param {number} epsilon The epsilon to compare against.\n * @returns {boolean} true if this spherical is within the provided epsilon of the provided spherical, false otherwise.\n */\nSpherical.prototype.equalsEpsilon = function (other, epsilon) {\n  return Spherical.equalsEpsilon(this, other, epsilon);\n};\n\n/**\n * Returns a string representing this instance in the format (clock, cone, magnitude).\n *\n * @returns {string} A string representing this instance.\n */\nSpherical.prototype.toString = function () {\n  return `(${this.clock}, ${this.cone}, ${this.magnitude})`;\n};\nexport default Spherical;\n", "import ArcType from \"../Core/ArcType.js\";\nimport BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport ClockRange from \"../Core/ClockRange.js\";\nimport ClockStep from \"../Core/ClockStep.js\";\nimport Color from \"../Core/Color.js\";\nimport CornerType from \"../Core/CornerType.js\";\nimport Credit from \"../Core/Credit.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Event from \"../Core/Event.js\";\nimport ExtrapolationType from \"../Core/ExtrapolationType.js\";\nimport getFilenameFromUri from \"../Core/getFilenameFromUri.js\";\nimport HermitePolynomialApproximation from \"../Core/HermitePolynomialApproximation.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport LagrangePolynomialApproximation from \"../Core/LagrangePolynomialApproximation.js\";\nimport LinearApproximation from \"../Core/LinearApproximation.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport PolygonHierarchy from \"../Core/PolygonHierarchy.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Spherical from \"../Core/Spherical.js\";\nimport TimeInterval from \"../Core/TimeInterval.js\";\nimport TimeIntervalCollection from \"../Core/TimeIntervalCollection.js\";\nimport ClassificationType from \"../Scene/ClassificationType.js\";\nimport ColorBlendMode from \"../Scene/ColorBlendMode.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport HorizontalOrigin from \"../Scene/HorizontalOrigin.js\";\nimport LabelStyle from \"../Scene/LabelStyle.js\";\nimport ShadowMode from \"../Scene/ShadowMode.js\";\nimport VerticalOrigin from \"../Scene/VerticalOrigin.js\";\nimport Uri from \"urijs\";\nimport BillboardGraphics from \"./BillboardGraphics.js\";\nimport BoxGraphics from \"./BoxGraphics.js\";\nimport CallbackProperty from \"./CallbackProperty.js\";\nimport CheckerboardMaterialProperty from \"./CheckerboardMaterialProperty.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport CompositeMaterialProperty from \"./CompositeMaterialProperty.js\";\nimport CompositePositionProperty from \"./CompositePositionProperty.js\";\nimport CompositeProperty from \"./CompositeProperty.js\";\nimport ConstantPositionProperty from \"./ConstantPositionProperty.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport CorridorGraphics from \"./CorridorGraphics.js\";\nimport CylinderGraphics from \"./CylinderGraphics.js\";\nimport DataSource from \"./DataSource.js\";\nimport DataSourceClock from \"./DataSourceClock.js\";\nimport EllipseGraphics from \"./EllipseGraphics.js\";\nimport EllipsoidGraphics from \"./EllipsoidGraphics.js\";\nimport EntityCluster from \"./EntityCluster.js\";\nimport EntityCollection from \"./EntityCollection.js\";\nimport GridMaterialProperty from \"./GridMaterialProperty.js\";\nimport ImageMaterialProperty from \"./ImageMaterialProperty.js\";\nimport LabelGraphics from \"./LabelGraphics.js\";\nimport ModelGraphics from \"./ModelGraphics.js\";\nimport NodeTransformationProperty from \"./NodeTransformationProperty.js\";\nimport PathGraphics from \"./PathGraphics.js\";\nimport PointGraphics from \"./PointGraphics.js\";\nimport PolygonGraphics from \"./PolygonGraphics.js\";\nimport PolylineArrowMaterialProperty from \"./PolylineArrowMaterialProperty.js\";\nimport PolylineDashMaterialProperty from \"./PolylineDashMaterialProperty.js\";\nimport PolylineGlowMaterialProperty from \"./PolylineGlowMaterialProperty.js\";\nimport PolylineGraphics from \"./PolylineGraphics.js\";\nimport PolylineOutlineMaterialProperty from \"./PolylineOutlineMaterialProperty.js\";\nimport PolylineVolumeGraphics from \"./PolylineVolumeGraphics.js\";\nimport PositionPropertyArray from \"./PositionPropertyArray.js\";\nimport Property from \"./Property.js\";\nimport PropertyArray from \"./PropertyArray.js\";\nimport PropertyBag from \"./PropertyBag.js\";\nimport RectangleGraphics from \"./RectangleGraphics.js\";\nimport ReferenceProperty from \"./ReferenceProperty.js\";\nimport Rotation from \"./Rotation.js\";\nimport SampledPositionProperty from \"./SampledPositionProperty.js\";\nimport SampledProperty from \"./SampledProperty.js\";\nimport StripeMaterialProperty from \"./StripeMaterialProperty.js\";\nimport StripeOrientation from \"./StripeOrientation.js\";\nimport TimeIntervalCollectionPositionProperty from \"./TimeIntervalCollectionPositionProperty.js\";\nimport TimeIntervalCollectionProperty from \"./TimeIntervalCollectionProperty.js\";\nimport VelocityOrientationProperty from \"./VelocityOrientationProperty.js\";\nimport VelocityVectorProperty from \"./VelocityVectorProperty.js\";\nimport WallGraphics from \"./WallGraphics.js\";\nimport Cesium3DTilesetGraphics from \"./Cesium3DTilesetGraphics.js\";\n\n// A marker type to distinguish CZML properties where we need to end up with a unit vector.\n// The data is still loaded into Cartesian3 objects but they are normalized.\nfunction UnitCartesian3() {}\nUnitCartesian3.packedLength = Cartesian3.packedLength;\nUnitCartesian3.unpack = Cartesian3.unpack;\nUnitCartesian3.pack = Cartesian3.pack;\n\n// As a side note, for the purposes of CZML, Quaternion always indicates a unit quaternion.\n\nlet currentId;\n\nfunction createReferenceProperty(entityCollection, referenceString) {\n  if (referenceString[0] === \"#\") {\n    referenceString = currentId + referenceString;\n  }\n  return ReferenceProperty.fromString(entityCollection, referenceString);\n}\n\nfunction createSpecializedProperty(type, entityCollection, packetData) {\n  if (defined(packetData.reference)) {\n    return createReferenceProperty(entityCollection, packetData.reference);\n  }\n\n  if (defined(packetData.velocityReference)) {\n    const referenceProperty = createReferenceProperty(\n      entityCollection,\n      packetData.velocityReference\n    );\n    switch (type) {\n      case Cartesian3:\n      case UnitCartesian3:\n        return new VelocityVectorProperty(\n          referenceProperty,\n          type === UnitCartesian3\n        );\n      case Quaternion:\n        return new VelocityOrientationProperty(referenceProperty);\n    }\n  }\n\n  throw new RuntimeError(`${JSON.stringify(packetData)} is not valid CZML.`);\n}\n\nfunction createAdapterProperty(property, adapterFunction) {\n  return new CallbackProperty(function (time, result) {\n    return adapterFunction(property.getValue(time, result));\n  }, property.isConstant);\n}\n\nconst scratchCartesian = new Cartesian3();\nconst scratchSpherical = new Spherical();\nconst scratchCartographic = new Cartographic();\nconst scratchTimeInterval = new TimeInterval();\nconst scratchQuaternion = new Quaternion();\n\nfunction unwrapColorInterval(czmlInterval) {\n  let rgbaf = czmlInterval.rgbaf;\n  if (defined(rgbaf)) {\n    return rgbaf;\n  }\n\n  const rgba = czmlInterval.rgba;\n  if (!defined(rgba)) {\n    return undefined;\n  }\n\n  const length = rgba.length;\n  if (length === Color.packedLength) {\n    return [\n      Color.byteToFloat(rgba[0]),\n      Color.byteToFloat(rgba[1]),\n      Color.byteToFloat(rgba[2]),\n      Color.byteToFloat(rgba[3]),\n    ];\n  }\n\n  rgbaf = new Array(length);\n  for (let i = 0; i < length; i += 5) {\n    rgbaf[i] = rgba[i];\n    rgbaf[i + 1] = Color.byteToFloat(rgba[i + 1]);\n    rgbaf[i + 2] = Color.byteToFloat(rgba[i + 2]);\n    rgbaf[i + 3] = Color.byteToFloat(rgba[i + 3]);\n    rgbaf[i + 4] = Color.byteToFloat(rgba[i + 4]);\n  }\n  return rgbaf;\n}\n\nfunction unwrapUriInterval(czmlInterval, sourceUri) {\n  const uri = defaultValue(czmlInterval.uri, czmlInterval);\n  if (defined(sourceUri)) {\n    return sourceUri.getDerivedResource({\n      url: uri,\n    });\n  }\n\n  return Resource.createIfNeeded(uri);\n}\n\nfunction unwrapRectangleInterval(czmlInterval) {\n  let wsen = czmlInterval.wsen;\n  if (defined(wsen)) {\n    return wsen;\n  }\n\n  const wsenDegrees = czmlInterval.wsenDegrees;\n  if (!defined(wsenDegrees)) {\n    return undefined;\n  }\n\n  const length = wsenDegrees.length;\n  if (length === Rectangle.packedLength) {\n    return [\n      CesiumMath.toRadians(wsenDegrees[0]),\n      CesiumMath.toRadians(wsenDegrees[1]),\n      CesiumMath.toRadians(wsenDegrees[2]),\n      CesiumMath.toRadians(wsenDegrees[3]),\n    ];\n  }\n\n  wsen = new Array(length);\n  for (let i = 0; i < length; i += 5) {\n    wsen[i] = wsenDegrees[i];\n    wsen[i + 1] = CesiumMath.toRadians(wsenDegrees[i + 1]);\n    wsen[i + 2] = CesiumMath.toRadians(wsenDegrees[i + 2]);\n    wsen[i + 3] = CesiumMath.toRadians(wsenDegrees[i + 3]);\n    wsen[i + 4] = CesiumMath.toRadians(wsenDegrees[i + 4]);\n  }\n  return wsen;\n}\n\nfunction convertUnitSphericalToCartesian(unitSpherical) {\n  const length = unitSpherical.length;\n  scratchSpherical.magnitude = 1.0;\n  if (length === 2) {\n    scratchSpherical.clock = unitSpherical[0];\n    scratchSpherical.cone = unitSpherical[1];\n    Cartesian3.fromSpherical(scratchSpherical, scratchCartesian);\n    return [scratchCartesian.x, scratchCartesian.y, scratchCartesian.z];\n  }\n\n  const result = new Array((length / 3) * 4);\n  for (let i = 0, j = 0; i < length; i += 3, j += 4) {\n    result[j] = unitSpherical[i];\n\n    scratchSpherical.clock = unitSpherical[i + 1];\n    scratchSpherical.cone = unitSpherical[i + 2];\n    Cartesian3.fromSpherical(scratchSpherical, scratchCartesian);\n\n    result[j + 1] = scratchCartesian.x;\n    result[j + 2] = scratchCartesian.y;\n    result[j + 3] = scratchCartesian.z;\n  }\n  return result;\n}\n\nfunction convertSphericalToCartesian(spherical) {\n  const length = spherical.length;\n  if (length === 3) {\n    scratchSpherical.clock = spherical[0];\n    scratchSpherical.cone = spherical[1];\n    scratchSpherical.magnitude = spherical[2];\n    Cartesian3.fromSpherical(scratchSpherical, scratchCartesian);\n    return [scratchCartesian.x, scratchCartesian.y, scratchCartesian.z];\n  }\n\n  const result = new Array(length);\n  for (let i = 0; i < length; i += 4) {\n    result[i] = spherical[i];\n\n    scratchSpherical.clock = spherical[i + 1];\n    scratchSpherical.cone = spherical[i + 2];\n    scratchSpherical.magnitude = spherical[i + 3];\n    Cartesian3.fromSpherical(scratchSpherical, scratchCartesian);\n\n    result[i + 1] = scratchCartesian.x;\n    result[i + 2] = scratchCartesian.y;\n    result[i + 3] = scratchCartesian.z;\n  }\n  return result;\n}\n\nfunction convertCartographicRadiansToCartesian(cartographicRadians) {\n  const length = cartographicRadians.length;\n  if (length === 3) {\n    scratchCartographic.longitude = cartographicRadians[0];\n    scratchCartographic.latitude = cartographicRadians[1];\n    scratchCartographic.height = cartographicRadians[2];\n    Ellipsoid.WGS84.cartographicToCartesian(\n      scratchCartographic,\n      scratchCartesian\n    );\n    return [scratchCartesian.x, scratchCartesian.y, scratchCartesian.z];\n  }\n\n  const result = new Array(length);\n  for (let i = 0; i < length; i += 4) {\n    result[i] = cartographicRadians[i];\n\n    scratchCartographic.longitude = cartographicRadians[i + 1];\n    scratchCartographic.latitude = cartographicRadians[i + 2];\n    scratchCartographic.height = cartographicRadians[i + 3];\n    Ellipsoid.WGS84.cartographicToCartesian(\n      scratchCartographic,\n      scratchCartesian\n    );\n\n    result[i + 1] = scratchCartesian.x;\n    result[i + 2] = scratchCartesian.y;\n    result[i + 3] = scratchCartesian.z;\n  }\n  return result;\n}\n\nfunction convertCartographicDegreesToCartesian(cartographicDegrees) {\n  const length = cartographicDegrees.length;\n  if (length === 3) {\n    scratchCartographic.longitude = CesiumMath.toRadians(\n      cartographicDegrees[0]\n    );\n    scratchCartographic.latitude = CesiumMath.toRadians(cartographicDegrees[1]);\n    scratchCartographic.height = cartographicDegrees[2];\n    Ellipsoid.WGS84.cartographicToCartesian(\n      scratchCartographic,\n      scratchCartesian\n    );\n    return [scratchCartesian.x, scratchCartesian.y, scratchCartesian.z];\n  }\n\n  const result = new Array(length);\n  for (let i = 0; i < length; i += 4) {\n    result[i] = cartographicDegrees[i];\n\n    scratchCartographic.longitude = CesiumMath.toRadians(\n      cartographicDegrees[i + 1]\n    );\n    scratchCartographic.latitude = CesiumMath.toRadians(\n      cartographicDegrees[i + 2]\n    );\n    scratchCartographic.height = cartographicDegrees[i + 3];\n    Ellipsoid.WGS84.cartographicToCartesian(\n      scratchCartographic,\n      scratchCartesian\n    );\n\n    result[i + 1] = scratchCartesian.x;\n    result[i + 2] = scratchCartesian.y;\n    result[i + 3] = scratchCartesian.z;\n  }\n  return result;\n}\n\nfunction unwrapCartesianInterval(czmlInterval) {\n  const cartesian = czmlInterval.cartesian;\n  if (defined(cartesian)) {\n    return cartesian;\n  }\n\n  const cartesianVelocity = czmlInterval.cartesianVelocity;\n  if (defined(cartesianVelocity)) {\n    return cartesianVelocity;\n  }\n\n  const unitCartesian = czmlInterval.unitCartesian;\n  if (defined(unitCartesian)) {\n    return unitCartesian;\n  }\n\n  const unitSpherical = czmlInterval.unitSpherical;\n  if (defined(unitSpherical)) {\n    return convertUnitSphericalToCartesian(unitSpherical);\n  }\n\n  const spherical = czmlInterval.spherical;\n  if (defined(spherical)) {\n    return convertSphericalToCartesian(spherical);\n  }\n\n  const cartographicRadians = czmlInterval.cartographicRadians;\n  if (defined(cartographicRadians)) {\n    return convertCartographicRadiansToCartesian(cartographicRadians);\n  }\n\n  const cartographicDegrees = czmlInterval.cartographicDegrees;\n  if (defined(cartographicDegrees)) {\n    return convertCartographicDegreesToCartesian(cartographicDegrees);\n  }\n\n  throw new RuntimeError(\n    `${JSON.stringify(czmlInterval)} is not a valid CZML interval.`\n  );\n}\n\nfunction normalizePackedCartesianArray(array, startingIndex) {\n  Cartesian3.unpack(array, startingIndex, scratchCartesian);\n  Cartesian3.normalize(scratchCartesian, scratchCartesian);\n  Cartesian3.pack(scratchCartesian, array, startingIndex);\n}\n\nfunction unwrapUnitCartesianInterval(czmlInterval) {\n  const cartesian = unwrapCartesianInterval(czmlInterval);\n  if (cartesian.length === 3) {\n    normalizePackedCartesianArray(cartesian, 0);\n    return cartesian;\n  }\n\n  for (let i = 1; i < cartesian.length; i += 4) {\n    normalizePackedCartesianArray(cartesian, i);\n  }\n\n  return cartesian;\n}\n\nfunction normalizePackedQuaternionArray(array, startingIndex) {\n  Quaternion.unpack(array, startingIndex, scratchQuaternion);\n  Quaternion.normalize(scratchQuaternion, scratchQuaternion);\n  Quaternion.pack(scratchQuaternion, array, startingIndex);\n}\n\nfunction unwrapQuaternionInterval(czmlInterval) {\n  const unitQuaternion = czmlInterval.unitQuaternion;\n  if (defined(unitQuaternion)) {\n    if (unitQuaternion.length === 4) {\n      normalizePackedQuaternionArray(unitQuaternion, 0);\n      return unitQuaternion;\n    }\n\n    for (let i = 1; i < unitQuaternion.length; i += 5) {\n      normalizePackedQuaternionArray(unitQuaternion, i);\n    }\n  }\n  return unitQuaternion;\n}\n\nfunction getPropertyType(czmlInterval) {\n  // The associations in this function need to be kept in sync with the\n  // associations in unwrapInterval.\n\n  // Intentionally omitted due to conficts in CZML property names:\n  // * Image (conflicts with Uri)\n  // * Rotation (conflicts with Number)\n  //\n  // cartesianVelocity is also omitted due to incomplete support for\n  // derivative information in CZML properties.\n  // (Currently cartesianVelocity is hacked directly into the position processing code)\n  if (typeof czmlInterval === \"boolean\") {\n    return Boolean;\n  } else if (typeof czmlInterval === \"number\") {\n    return Number;\n  } else if (typeof czmlInterval === \"string\") {\n    return String;\n  } else if (czmlInterval.hasOwnProperty(\"array\")) {\n    return Array;\n  } else if (czmlInterval.hasOwnProperty(\"boolean\")) {\n    return Boolean;\n  } else if (czmlInterval.hasOwnProperty(\"boundingRectangle\")) {\n    return BoundingRectangle;\n  } else if (czmlInterval.hasOwnProperty(\"cartesian2\")) {\n    return Cartesian2;\n  } else if (\n    czmlInterval.hasOwnProperty(\"cartesian\") ||\n    czmlInterval.hasOwnProperty(\"spherical\") ||\n    czmlInterval.hasOwnProperty(\"cartographicRadians\") ||\n    czmlInterval.hasOwnProperty(\"cartographicDegrees\")\n  ) {\n    return Cartesian3;\n  } else if (\n    czmlInterval.hasOwnProperty(\"unitCartesian\") ||\n    czmlInterval.hasOwnProperty(\"unitSpherical\")\n  ) {\n    return UnitCartesian3;\n  } else if (\n    czmlInterval.hasOwnProperty(\"rgba\") ||\n    czmlInterval.hasOwnProperty(\"rgbaf\")\n  ) {\n    return Color;\n  } else if (czmlInterval.hasOwnProperty(\"arcType\")) {\n    return ArcType;\n  } else if (czmlInterval.hasOwnProperty(\"classificationType\")) {\n    return ClassificationType;\n  } else if (czmlInterval.hasOwnProperty(\"colorBlendMode\")) {\n    return ColorBlendMode;\n  } else if (czmlInterval.hasOwnProperty(\"cornerType\")) {\n    return CornerType;\n  } else if (czmlInterval.hasOwnProperty(\"heightReference\")) {\n    return HeightReference;\n  } else if (czmlInterval.hasOwnProperty(\"horizontalOrigin\")) {\n    return HorizontalOrigin;\n  } else if (czmlInterval.hasOwnProperty(\"date\")) {\n    return JulianDate;\n  } else if (czmlInterval.hasOwnProperty(\"labelStyle\")) {\n    return LabelStyle;\n  } else if (czmlInterval.hasOwnProperty(\"number\")) {\n    return Number;\n  } else if (czmlInterval.hasOwnProperty(\"nearFarScalar\")) {\n    return NearFarScalar;\n  } else if (czmlInterval.hasOwnProperty(\"distanceDisplayCondition\")) {\n    return DistanceDisplayCondition;\n  } else if (\n    czmlInterval.hasOwnProperty(\"object\") ||\n    czmlInterval.hasOwnProperty(\"value\")\n  ) {\n    return Object;\n  } else if (czmlInterval.hasOwnProperty(\"unitQuaternion\")) {\n    return Quaternion;\n  } else if (czmlInterval.hasOwnProperty(\"shadowMode\")) {\n    return ShadowMode;\n  } else if (czmlInterval.hasOwnProperty(\"string\")) {\n    return String;\n  } else if (czmlInterval.hasOwnProperty(\"stripeOrientation\")) {\n    return StripeOrientation;\n  } else if (\n    czmlInterval.hasOwnProperty(\"wsen\") ||\n    czmlInterval.hasOwnProperty(\"wsenDegrees\")\n  ) {\n    return Rectangle;\n  } else if (czmlInterval.hasOwnProperty(\"uri\")) {\n    return Uri;\n  } else if (czmlInterval.hasOwnProperty(\"verticalOrigin\")) {\n    return VerticalOrigin;\n  }\n  // fallback case\n  return Object;\n}\n\nfunction unwrapInterval(type, czmlInterval, sourceUri) {\n  // The associations in this function need to be kept in sync with the\n  // associations in getPropertyType\n  switch (type) {\n    case ArcType:\n      return ArcType[defaultValue(czmlInterval.arcType, czmlInterval)];\n    case Array:\n      return czmlInterval.array;\n    case Boolean:\n      return defaultValue(czmlInterval[\"boolean\"], czmlInterval);\n    case BoundingRectangle:\n      return czmlInterval.boundingRectangle;\n    case Cartesian2:\n      return czmlInterval.cartesian2;\n    case Cartesian3:\n      return unwrapCartesianInterval(czmlInterval);\n    case UnitCartesian3:\n      return unwrapUnitCartesianInterval(czmlInterval);\n    case Color:\n      return unwrapColorInterval(czmlInterval);\n    case ClassificationType:\n      return ClassificationType[\n        defaultValue(czmlInterval.classificationType, czmlInterval)\n      ];\n    case ColorBlendMode:\n      return ColorBlendMode[\n        defaultValue(czmlInterval.colorBlendMode, czmlInterval)\n      ];\n    case CornerType:\n      return CornerType[defaultValue(czmlInterval.cornerType, czmlInterval)];\n    case HeightReference:\n      return HeightReference[\n        defaultValue(czmlInterval.heightReference, czmlInterval)\n      ];\n    case HorizontalOrigin:\n      return HorizontalOrigin[\n        defaultValue(czmlInterval.horizontalOrigin, czmlInterval)\n      ];\n    case Image:\n      return unwrapUriInterval(czmlInterval, sourceUri);\n    case JulianDate:\n      return JulianDate.fromIso8601(\n        defaultValue(czmlInterval.date, czmlInterval)\n      );\n    case LabelStyle:\n      return LabelStyle[defaultValue(czmlInterval.labelStyle, czmlInterval)];\n    case Number:\n      return defaultValue(czmlInterval.number, czmlInterval);\n    case NearFarScalar:\n      return czmlInterval.nearFarScalar;\n    case DistanceDisplayCondition:\n      return czmlInterval.distanceDisplayCondition;\n    case Object:\n      return defaultValue(\n        defaultValue(czmlInterval.object, czmlInterval.value),\n        czmlInterval\n      );\n    case Quaternion:\n      return unwrapQuaternionInterval(czmlInterval);\n    case Rotation:\n      return defaultValue(czmlInterval.number, czmlInterval);\n    case ShadowMode:\n      return ShadowMode[\n        defaultValue(\n          defaultValue(czmlInterval.shadowMode, czmlInterval.shadows),\n          czmlInterval\n        )\n      ];\n    case String:\n      return defaultValue(czmlInterval.string, czmlInterval);\n    case StripeOrientation:\n      return StripeOrientation[\n        defaultValue(czmlInterval.stripeOrientation, czmlInterval)\n      ];\n    case Rectangle:\n      return unwrapRectangleInterval(czmlInterval);\n    case Uri:\n      return unwrapUriInterval(czmlInterval, sourceUri);\n    case VerticalOrigin:\n      return VerticalOrigin[\n        defaultValue(czmlInterval.verticalOrigin, czmlInterval)\n      ];\n    default:\n      throw new RuntimeError(type);\n  }\n}\n\nconst interpolators = {\n  HERMITE: HermitePolynomialApproximation,\n  LAGRANGE: LagrangePolynomialApproximation,\n  LINEAR: LinearApproximation,\n};\n\nfunction updateInterpolationSettings(packetData, property) {\n  const interpolationAlgorithm = packetData.interpolationAlgorithm;\n  const interpolationDegree = packetData.interpolationDegree;\n  if (defined(interpolationAlgorithm) || defined(interpolationDegree)) {\n    property.setInterpolationOptions({\n      interpolationAlgorithm: interpolators[interpolationAlgorithm],\n      interpolationDegree: interpolationDegree,\n    });\n  }\n\n  const forwardExtrapolationType = packetData.forwardExtrapolationType;\n  if (defined(forwardExtrapolationType)) {\n    property.forwardExtrapolationType =\n      ExtrapolationType[forwardExtrapolationType];\n  }\n\n  const forwardExtrapolationDuration = packetData.forwardExtrapolationDuration;\n  if (defined(forwardExtrapolationDuration)) {\n    property.forwardExtrapolationDuration = forwardExtrapolationDuration;\n  }\n\n  const backwardExtrapolationType = packetData.backwardExtrapolationType;\n  if (defined(backwardExtrapolationType)) {\n    property.backwardExtrapolationType =\n      ExtrapolationType[backwardExtrapolationType];\n  }\n\n  const backwardExtrapolationDuration =\n    packetData.backwardExtrapolationDuration;\n  if (defined(backwardExtrapolationDuration)) {\n    property.backwardExtrapolationDuration = backwardExtrapolationDuration;\n  }\n}\n\nconst iso8601Scratch = {\n  iso8601: undefined,\n};\n\nfunction intervalFromString(intervalString) {\n  if (!defined(intervalString)) {\n    return undefined;\n  }\n  iso8601Scratch.iso8601 = intervalString;\n  return TimeInterval.fromIso8601(iso8601Scratch);\n}\n\nfunction wrapPropertyInInfiniteInterval(property) {\n  const interval = Iso8601.MAXIMUM_INTERVAL.clone();\n  interval.data = property;\n  return interval;\n}\n\nfunction convertPropertyToComposite(property) {\n  // Create the composite and add the old property, wrapped in an infinite interval.\n  const composite = new CompositeProperty();\n  composite.intervals.addInterval(wrapPropertyInInfiniteInterval(property));\n  return composite;\n}\n\nfunction convertPositionPropertyToComposite(property) {\n  // Create the composite and add the old property, wrapped in an infinite interval.\n  const composite = new CompositePositionProperty(property.referenceFrame);\n  composite.intervals.addInterval(wrapPropertyInInfiniteInterval(property));\n  return composite;\n}\n\nfunction processProperty(\n  type,\n  object,\n  propertyName,\n  packetData,\n  constrainedInterval,\n  sourceUri,\n  entityCollection\n) {\n  let combinedInterval = intervalFromString(packetData.interval);\n  if (defined(constrainedInterval)) {\n    if (defined(combinedInterval)) {\n      combinedInterval = TimeInterval.intersect(\n        combinedInterval,\n        constrainedInterval,\n        scratchTimeInterval\n      );\n    } else {\n      combinedInterval = constrainedInterval;\n    }\n  }\n\n  let packedLength;\n  let unwrappedInterval;\n  let unwrappedIntervalLength;\n\n  // CZML properties can be defined in many ways.  Most ways represent a structure for\n  // encoding a single value (number, string, cartesian, etc.)  Regardless of the value type,\n  // if it encodes a single value it will get loaded into a ConstantProperty eventually.\n  // Alternatively, there are ways of defining a property that require specialized\n  // client-side representation. Currently, these are ReferenceProperty,\n  // and client-side velocity computation properties such as VelocityVectorProperty.\n  const isValue =\n    !defined(packetData.reference) && !defined(packetData.velocityReference);\n  const hasInterval =\n    defined(combinedInterval) &&\n    !combinedInterval.equals(Iso8601.MAXIMUM_INTERVAL);\n\n  if (packetData.delete === true) {\n    // If deleting this property for all time, we can simply set to undefined and return.\n    if (!hasInterval) {\n      object[propertyName] = undefined;\n      return;\n    }\n\n    // Deleting depends on the type of property we have.\n    return removePropertyData(object[propertyName], combinedInterval);\n  }\n\n  let isSampled = false;\n\n  if (isValue) {\n    unwrappedInterval = unwrapInterval(type, packetData, sourceUri);\n    if (!defined(unwrappedInterval)) {\n      // not a known value type, bail\n      return;\n    }\n    packedLength = defaultValue(type.packedLength, 1);\n    unwrappedIntervalLength = defaultValue(unwrappedInterval.length, 1);\n    isSampled =\n      !defined(packetData.array) &&\n      typeof unwrappedInterval !== \"string\" &&\n      unwrappedIntervalLength > packedLength &&\n      type !== Object;\n  }\n\n  // Rotation is a special case because it represents a native type (Number)\n  // and therefore does not need to be unpacked when loaded as a constant value.\n  const needsUnpacking = typeof type.unpack === \"function\" && type !== Rotation;\n\n  // Any time a constant value is assigned, it completely blows away anything else.\n  if (!isSampled && !hasInterval) {\n    if (isValue) {\n      object[propertyName] = new ConstantProperty(\n        needsUnpacking ? type.unpack(unwrappedInterval, 0) : unwrappedInterval\n      );\n    } else {\n      object[propertyName] = createSpecializedProperty(\n        type,\n        entityCollection,\n        packetData\n      );\n    }\n    return;\n  }\n\n  let property = object[propertyName];\n\n  let epoch;\n  const packetEpoch = packetData.epoch;\n  if (defined(packetEpoch)) {\n    epoch = JulianDate.fromIso8601(packetEpoch);\n  }\n\n  // Without an interval, any sampled value is infinite, meaning it completely\n  // replaces any non-sampled property that may exist.\n  if (isSampled && !hasInterval) {\n    if (!(property instanceof SampledProperty)) {\n      object[propertyName] = property = new SampledProperty(type);\n    }\n    property.addSamplesPackedArray(unwrappedInterval, epoch);\n    updateInterpolationSettings(packetData, property);\n    return;\n  }\n\n  let interval;\n\n  // A constant value with an interval is normally part of a TimeIntervalCollection,\n  // However, if the current property is not a time-interval collection, we need\n  // to turn it into a Composite, preserving the old data with the new interval.\n  if (!isSampled && hasInterval) {\n    // Create a new interval for the constant value.\n    combinedInterval = combinedInterval.clone();\n    if (isValue) {\n      combinedInterval.data = needsUnpacking\n        ? type.unpack(unwrappedInterval, 0)\n        : unwrappedInterval;\n    } else {\n      combinedInterval.data = createSpecializedProperty(\n        type,\n        entityCollection,\n        packetData\n      );\n    }\n\n    // If no property exists, simply use a new interval collection\n    if (!defined(property)) {\n      object[propertyName] = property = isValue\n        ? new TimeIntervalCollectionProperty()\n        : new CompositeProperty();\n    }\n\n    if (isValue && property instanceof TimeIntervalCollectionProperty) {\n      // If we created a collection, or it already was one, use it.\n      property.intervals.addInterval(combinedInterval);\n    } else if (property instanceof CompositeProperty) {\n      // If the collection was already a CompositeProperty, use it.\n      if (isValue) {\n        combinedInterval.data = new ConstantProperty(combinedInterval.data);\n      }\n      property.intervals.addInterval(combinedInterval);\n    } else {\n      // Otherwise, create a CompositeProperty but preserve the existing data.\n      object[propertyName] = property = convertPropertyToComposite(property);\n\n      // Change the new data to a ConstantProperty and add it.\n      if (isValue) {\n        combinedInterval.data = new ConstantProperty(combinedInterval.data);\n      }\n      property.intervals.addInterval(combinedInterval);\n    }\n\n    return;\n  }\n\n  // isSampled && hasInterval\n  if (!defined(property)) {\n    object[propertyName] = property = new CompositeProperty();\n  }\n\n  // Create a CompositeProperty but preserve the existing data.\n  if (!(property instanceof CompositeProperty)) {\n    object[propertyName] = property = convertPropertyToComposite(property);\n  }\n\n  // Check if the interval already exists in the composite.\n  const intervals = property.intervals;\n  interval = intervals.findInterval(combinedInterval);\n  if (!defined(interval) || !(interval.data instanceof SampledProperty)) {\n    // If not, create a SampledProperty for it.\n    interval = combinedInterval.clone();\n    interval.data = new SampledProperty(type);\n    intervals.addInterval(interval);\n  }\n  interval.data.addSamplesPackedArray(unwrappedInterval, epoch);\n  updateInterpolationSettings(packetData, interval.data);\n}\n\nfunction removePropertyData(property, interval) {\n  if (property instanceof SampledProperty) {\n    property.removeSamples(interval);\n    return;\n  } else if (property instanceof TimeIntervalCollectionProperty) {\n    property.intervals.removeInterval(interval);\n    return;\n  } else if (property instanceof CompositeProperty) {\n    const intervals = property.intervals;\n    for (let i = 0; i < intervals.length; ++i) {\n      const intersection = TimeInterval.intersect(\n        intervals.get(i),\n        interval,\n        scratchTimeInterval\n      );\n      if (!intersection.isEmpty) {\n        // remove data from the contained properties\n        removePropertyData(intersection.data, interval);\n      }\n    }\n    // remove the intervals from the composite\n    intervals.removeInterval(interval);\n    return;\n  }\n}\n\nfunction processPacketData(\n  type,\n  object,\n  propertyName,\n  packetData,\n  interval,\n  sourceUri,\n  entityCollection\n) {\n  if (!defined(packetData)) {\n    return;\n  }\n\n  if (Array.isArray(packetData)) {\n    for (let i = 0, len = packetData.length; i < len; ++i) {\n      processProperty(\n        type,\n        object,\n        propertyName,\n        packetData[i],\n        interval,\n        sourceUri,\n        entityCollection\n      );\n    }\n  } else {\n    processProperty(\n      type,\n      object,\n      propertyName,\n      packetData,\n      interval,\n      sourceUri,\n      entityCollection\n    );\n  }\n}\n\nfunction processPositionProperty(\n  object,\n  propertyName,\n  packetData,\n  constrainedInterval,\n  sourceUri,\n  entityCollection\n) {\n  let combinedInterval = intervalFromString(packetData.interval);\n  if (defined(constrainedInterval)) {\n    if (defined(combinedInterval)) {\n      combinedInterval = TimeInterval.intersect(\n        combinedInterval,\n        constrainedInterval,\n        scratchTimeInterval\n      );\n    } else {\n      combinedInterval = constrainedInterval;\n    }\n  }\n\n  const numberOfDerivatives = defined(packetData.cartesianVelocity) ? 1 : 0;\n  const packedLength = Cartesian3.packedLength * (numberOfDerivatives + 1);\n  let unwrappedInterval;\n  let unwrappedIntervalLength;\n  const isValue = !defined(packetData.reference);\n  const hasInterval =\n    defined(combinedInterval) &&\n    !combinedInterval.equals(Iso8601.MAXIMUM_INTERVAL);\n\n  if (packetData.delete === true) {\n    // If deleting this property for all time, we can simply set to undefined and return.\n    if (!hasInterval) {\n      object[propertyName] = undefined;\n      return;\n    }\n\n    // Deleting depends on the type of property we have.\n    return removePositionPropertyData(object[propertyName], combinedInterval);\n  }\n\n  let referenceFrame;\n  let isSampled = false;\n\n  if (isValue) {\n    if (defined(packetData.referenceFrame)) {\n      referenceFrame = ReferenceFrame[packetData.referenceFrame];\n    }\n    referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED);\n    unwrappedInterval = unwrapCartesianInterval(packetData);\n    unwrappedIntervalLength = defaultValue(unwrappedInterval.length, 1);\n    isSampled = unwrappedIntervalLength > packedLength;\n  }\n\n  // Any time a constant value is assigned, it completely blows away anything else.\n  if (!isSampled && !hasInterval) {\n    if (isValue) {\n      object[propertyName] = new ConstantPositionProperty(\n        Cartesian3.unpack(unwrappedInterval),\n        referenceFrame\n      );\n    } else {\n      object[propertyName] = createReferenceProperty(\n        entityCollection,\n        packetData.reference\n      );\n    }\n    return;\n  }\n\n  let property = object[propertyName];\n\n  let epoch;\n  const packetEpoch = packetData.epoch;\n  if (defined(packetEpoch)) {\n    epoch = JulianDate.fromIso8601(packetEpoch);\n  }\n\n  // Without an interval, any sampled value is infinite, meaning it completely\n  // replaces any non-sampled property that may exist.\n  if (isSampled && !hasInterval) {\n    if (\n      !(property instanceof SampledPositionProperty) ||\n      (defined(referenceFrame) && property.referenceFrame !== referenceFrame)\n    ) {\n      object[propertyName] = property = new SampledPositionProperty(\n        referenceFrame,\n        numberOfDerivatives\n      );\n    }\n    property.addSamplesPackedArray(unwrappedInterval, epoch);\n    updateInterpolationSettings(packetData, property);\n    return;\n  }\n\n  let interval;\n\n  // A constant value with an interval is normally part of a TimeIntervalCollection,\n  // However, if the current property is not a time-interval collection, we need\n  // to turn it into a Composite, preserving the old data with the new interval.\n  if (!isSampled && hasInterval) {\n    // Create a new interval for the constant value.\n    combinedInterval = combinedInterval.clone();\n    if (isValue) {\n      combinedInterval.data = Cartesian3.unpack(unwrappedInterval);\n    } else {\n      combinedInterval.data = createReferenceProperty(\n        entityCollection,\n        packetData.reference\n      );\n    }\n\n    // If no property exists, simply use a new interval collection\n    if (!defined(property)) {\n      if (isValue) {\n        property = new TimeIntervalCollectionPositionProperty(referenceFrame);\n      } else {\n        property = new CompositePositionProperty(referenceFrame);\n      }\n      object[propertyName] = property;\n    }\n\n    if (\n      isValue &&\n      property instanceof TimeIntervalCollectionPositionProperty &&\n      defined(referenceFrame) &&\n      property.referenceFrame === referenceFrame\n    ) {\n      // If we create a collection, or it already existed, use it.\n      property.intervals.addInterval(combinedInterval);\n    } else if (property instanceof CompositePositionProperty) {\n      // If the collection was already a CompositePositionProperty, use it.\n      if (isValue) {\n        combinedInterval.data = new ConstantPositionProperty(\n          combinedInterval.data,\n          referenceFrame\n        );\n      }\n      property.intervals.addInterval(combinedInterval);\n    } else {\n      // Otherwise, create a CompositePositionProperty but preserve the existing data.\n      object[propertyName] = property = convertPositionPropertyToComposite(\n        property\n      );\n\n      // Change the new data to a ConstantPositionProperty and add it.\n      if (isValue) {\n        combinedInterval.data = new ConstantPositionProperty(\n          combinedInterval.data,\n          referenceFrame\n        );\n      }\n      property.intervals.addInterval(combinedInterval);\n    }\n\n    return;\n  }\n\n  // isSampled && hasInterval\n  if (!defined(property)) {\n    object[propertyName] = property = new CompositePositionProperty(\n      referenceFrame\n    );\n  } else if (!(property instanceof CompositePositionProperty)) {\n    // Create a CompositeProperty but preserve the existing data.\n    object[propertyName] = property = convertPositionPropertyToComposite(\n      property\n    );\n  }\n\n  // Check if the interval already exists in the composite.\n  const intervals = property.intervals;\n  interval = intervals.findInterval(combinedInterval);\n  if (\n    !defined(interval) ||\n    !(interval.data instanceof SampledPositionProperty) ||\n    (defined(referenceFrame) && interval.data.referenceFrame !== referenceFrame)\n  ) {\n    // If not, create a SampledPositionProperty for it.\n    interval = combinedInterval.clone();\n    interval.data = new SampledPositionProperty(\n      referenceFrame,\n      numberOfDerivatives\n    );\n    intervals.addInterval(interval);\n  }\n  interval.data.addSamplesPackedArray(unwrappedInterval, epoch);\n  updateInterpolationSettings(packetData, interval.data);\n}\n\nfunction removePositionPropertyData(property, interval) {\n  if (property instanceof SampledPositionProperty) {\n    property.removeSamples(interval);\n    return;\n  } else if (property instanceof TimeIntervalCollectionPositionProperty) {\n    property.intervals.removeInterval(interval);\n    return;\n  } else if (property instanceof CompositePositionProperty) {\n    const intervals = property.intervals;\n    for (let i = 0; i < intervals.length; ++i) {\n      const intersection = TimeInterval.intersect(\n        intervals.get(i),\n        interval,\n        scratchTimeInterval\n      );\n      if (!intersection.isEmpty) {\n        // remove data from the contained properties\n        removePositionPropertyData(intersection.data, interval);\n      }\n    }\n    // remove the intervals from the composite\n    intervals.removeInterval(interval);\n    return;\n  }\n}\n\nfunction processPositionPacketData(\n  object,\n  propertyName,\n  packetData,\n  interval,\n  sourceUri,\n  entityCollection\n) {\n  if (!defined(packetData)) {\n    return;\n  }\n\n  if (Array.isArray(packetData)) {\n    for (let i = 0, len = packetData.length; i < len; ++i) {\n      processPositionProperty(\n        object,\n        propertyName,\n        packetData[i],\n        interval,\n        sourceUri,\n        entityCollection\n      );\n    }\n  } else {\n    processPositionProperty(\n      object,\n      propertyName,\n      packetData,\n      interval,\n      sourceUri,\n      entityCollection\n    );\n  }\n}\n\nfunction processShapePacketData(\n  object,\n  propertyName,\n  packetData,\n  entityCollection\n) {\n  if (defined(packetData.references)) {\n    processReferencesArrayPacketData(\n      object,\n      propertyName,\n      packetData.references,\n      packetData.interval,\n      entityCollection,\n      PropertyArray,\n      CompositeProperty\n    );\n  } else {\n    if (defined(packetData.cartesian2)) {\n      packetData.array = Cartesian2.unpackArray(packetData.cartesian2);\n    } else if (defined(packetData.cartesian)) {\n      // for backwards compatibility, also accept `cartesian`\n      packetData.array = Cartesian2.unpackArray(packetData.cartesian);\n    }\n\n    if (defined(packetData.array)) {\n      processPacketData(\n        Array,\n        object,\n        propertyName,\n        packetData,\n        undefined,\n        undefined,\n        entityCollection\n      );\n    }\n  }\n}\n\nfunction processMaterialProperty(\n  object,\n  propertyName,\n  packetData,\n  constrainedInterval,\n  sourceUri,\n  entityCollection\n) {\n  let combinedInterval = intervalFromString(packetData.interval);\n  if (defined(constrainedInterval)) {\n    if (defined(combinedInterval)) {\n      combinedInterval = TimeInterval.intersect(\n        combinedInterval,\n        constrainedInterval,\n        scratchTimeInterval\n      );\n    } else {\n      combinedInterval = constrainedInterval;\n    }\n  }\n\n  let property = object[propertyName];\n  let existingMaterial;\n  let existingInterval;\n\n  if (defined(combinedInterval)) {\n    if (!(property instanceof CompositeMaterialProperty)) {\n      property = new CompositeMaterialProperty();\n      object[propertyName] = property;\n    }\n    //See if we already have data at that interval.\n    const thisIntervals = property.intervals;\n    existingInterval = thisIntervals.findInterval({\n      start: combinedInterval.start,\n      stop: combinedInterval.stop,\n    });\n    if (defined(existingInterval)) {\n      //We have an interval, but we need to make sure the\n      //new data is the same type of material as the old data.\n      existingMaterial = existingInterval.data;\n    } else {\n      //If not, create it.\n      existingInterval = combinedInterval.clone();\n      thisIntervals.addInterval(existingInterval);\n    }\n  } else {\n    existingMaterial = property;\n  }\n\n  let materialData;\n  if (defined(packetData.solidColor)) {\n    if (!(existingMaterial instanceof ColorMaterialProperty)) {\n      existingMaterial = new ColorMaterialProperty();\n    }\n    materialData = packetData.solidColor;\n    processPacketData(\n      Color,\n      existingMaterial,\n      \"color\",\n      materialData.color,\n      undefined,\n      undefined,\n      entityCollection\n    );\n  } else if (defined(packetData.grid)) {\n    if (!(existingMaterial instanceof GridMaterialProperty)) {\n      existingMaterial = new GridMaterialProperty();\n    }\n    materialData = packetData.grid;\n    processPacketData(\n      Color,\n      existingMaterial,\n      \"color\",\n      materialData.color,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Number,\n      existingMaterial,\n      \"cellAlpha\",\n      materialData.cellAlpha,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Cartesian2,\n      existingMaterial,\n      \"lineCount\",\n      materialData.lineCount,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Cartesian2,\n      existingMaterial,\n      \"lineThickness\",\n      materialData.lineThickness,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Cartesian2,\n      existingMaterial,\n      \"lineOffset\",\n      materialData.lineOffset,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n  } else if (defined(packetData.image)) {\n    if (!(existingMaterial instanceof ImageMaterialProperty)) {\n      existingMaterial = new ImageMaterialProperty();\n    }\n    materialData = packetData.image;\n    processPacketData(\n      Image,\n      existingMaterial,\n      \"image\",\n      materialData.image,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Cartesian2,\n      existingMaterial,\n      \"repeat\",\n      materialData.repeat,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Color,\n      existingMaterial,\n      \"color\",\n      materialData.color,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Boolean,\n      existingMaterial,\n      \"transparent\",\n      materialData.transparent,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n  } else if (defined(packetData.stripe)) {\n    if (!(existingMaterial instanceof StripeMaterialProperty)) {\n      existingMaterial = new StripeMaterialProperty();\n    }\n    materialData = packetData.stripe;\n    processPacketData(\n      StripeOrientation,\n      existingMaterial,\n      \"orientation\",\n      materialData.orientation,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Color,\n      existingMaterial,\n      \"evenColor\",\n      materialData.evenColor,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Color,\n      existingMaterial,\n      \"oddColor\",\n      materialData.oddColor,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Number,\n      existingMaterial,\n      \"offset\",\n      materialData.offset,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Number,\n      existingMaterial,\n      \"repeat\",\n      materialData.repeat,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n  } else if (defined(packetData.polylineOutline)) {\n    if (!(existingMaterial instanceof PolylineOutlineMaterialProperty)) {\n      existingMaterial = new PolylineOutlineMaterialProperty();\n    }\n    materialData = packetData.polylineOutline;\n    processPacketData(\n      Color,\n      existingMaterial,\n      \"color\",\n      materialData.color,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Color,\n      existingMaterial,\n      \"outlineColor\",\n      materialData.outlineColor,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Number,\n      existingMaterial,\n      \"outlineWidth\",\n      materialData.outlineWidth,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n  } else if (defined(packetData.polylineGlow)) {\n    if (!(existingMaterial instanceof PolylineGlowMaterialProperty)) {\n      existingMaterial = new PolylineGlowMaterialProperty();\n    }\n    materialData = packetData.polylineGlow;\n    processPacketData(\n      Color,\n      existingMaterial,\n      \"color\",\n      materialData.color,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Number,\n      existingMaterial,\n      \"glowPower\",\n      materialData.glowPower,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Number,\n      existingMaterial,\n      \"taperPower\",\n      materialData.taperPower,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n  } else if (defined(packetData.polylineArrow)) {\n    if (!(existingMaterial instanceof PolylineArrowMaterialProperty)) {\n      existingMaterial = new PolylineArrowMaterialProperty();\n    }\n    materialData = packetData.polylineArrow;\n    processPacketData(\n      Color,\n      existingMaterial,\n      \"color\",\n      materialData.color,\n      undefined,\n      undefined,\n      entityCollection\n    );\n  } else if (defined(packetData.polylineDash)) {\n    if (!(existingMaterial instanceof PolylineDashMaterialProperty)) {\n      existingMaterial = new PolylineDashMaterialProperty();\n    }\n    materialData = packetData.polylineDash;\n    processPacketData(\n      Color,\n      existingMaterial,\n      \"color\",\n      materialData.color,\n      undefined,\n      undefined,\n      entityCollection\n    );\n    processPacketData(\n      Color,\n      existingMaterial,\n      \"gapColor\",\n      materialData.gapColor,\n      undefined,\n      undefined,\n      entityCollection\n    );\n    processPacketData(\n      Number,\n      existingMaterial,\n      \"dashLength\",\n      materialData.dashLength,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Number,\n      existingMaterial,\n      \"dashPattern\",\n      materialData.dashPattern,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n  } else if (defined(packetData.checkerboard)) {\n    if (!(existingMaterial instanceof CheckerboardMaterialProperty)) {\n      existingMaterial = new CheckerboardMaterialProperty();\n    }\n    materialData = packetData.checkerboard;\n    processPacketData(\n      Color,\n      existingMaterial,\n      \"evenColor\",\n      materialData.evenColor,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Color,\n      existingMaterial,\n      \"oddColor\",\n      materialData.oddColor,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Cartesian2,\n      existingMaterial,\n      \"repeat\",\n      materialData.repeat,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n  }\n\n  if (defined(existingInterval)) {\n    existingInterval.data = existingMaterial;\n  } else {\n    object[propertyName] = existingMaterial;\n  }\n}\n\nfunction processMaterialPacketData(\n  object,\n  propertyName,\n  packetData,\n  interval,\n  sourceUri,\n  entityCollection\n) {\n  if (!defined(packetData)) {\n    return;\n  }\n\n  if (Array.isArray(packetData)) {\n    for (let i = 0, len = packetData.length; i < len; ++i) {\n      processMaterialProperty(\n        object,\n        propertyName,\n        packetData[i],\n        interval,\n        sourceUri,\n        entityCollection\n      );\n    }\n  } else {\n    processMaterialProperty(\n      object,\n      propertyName,\n      packetData,\n      interval,\n      sourceUri,\n      entityCollection\n    );\n  }\n}\n\nfunction processName(entity, packet, entityCollection, sourceUri) {\n  const nameData = packet.name;\n  if (defined(nameData)) {\n    entity.name = packet.name;\n  }\n}\n\nfunction processDescription(entity, packet, entityCollection, sourceUri) {\n  const descriptionData = packet.description;\n  if (defined(descriptionData)) {\n    processPacketData(\n      String,\n      entity,\n      \"description\",\n      descriptionData,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n  }\n}\n\nfunction processPosition(entity, packet, entityCollection, sourceUri) {\n  const positionData = packet.position;\n  if (defined(positionData)) {\n    processPositionPacketData(\n      entity,\n      \"position\",\n      positionData,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n  }\n}\n\nfunction processViewFrom(entity, packet, entityCollection, sourceUri) {\n  const viewFromData = packet.viewFrom;\n  if (defined(viewFromData)) {\n    processPacketData(\n      Cartesian3,\n      entity,\n      \"viewFrom\",\n      viewFromData,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n  }\n}\n\nfunction processOrientation(entity, packet, entityCollection, sourceUri) {\n  const orientationData = packet.orientation;\n  if (defined(orientationData)) {\n    processPacketData(\n      Quaternion,\n      entity,\n      \"orientation\",\n      orientationData,\n      undefined,\n      sourceUri,\n      entityCollection\n    );\n  }\n}\n\nfunction processProperties(entity, packet, entityCollection, sourceUri) {\n  const propertiesData = packet.properties;\n  if (defined(propertiesData)) {\n    if (!defined(entity.properties)) {\n      entity.properties = new PropertyBag();\n    }\n\n    // We cannot simply call processPacketData(entity, 'properties', propertyData, undefined, sourceUri, entityCollection)\n    // because each property of \"properties\" may vary separately.\n    // The properties will be accessible as entity.properties.myprop.getValue(time).\n\n    for (const key in propertiesData) {\n      if (propertiesData.hasOwnProperty(key)) {\n        if (!entity.properties.hasProperty(key)) {\n          entity.properties.addProperty(key);\n        }\n\n        const propertyData = propertiesData[key];\n        if (Array.isArray(propertyData)) {\n          for (let i = 0, len = propertyData.length; i < len; ++i) {\n            processProperty(\n              getPropertyType(propertyData[i]),\n              entity.properties,\n              key,\n              propertyData[i],\n              undefined,\n              sourceUri,\n              entityCollection\n            );\n          }\n        } else {\n          processProperty(\n            getPropertyType(propertyData),\n            entity.properties,\n            key,\n            propertyData,\n            undefined,\n            sourceUri,\n            entityCollection\n          );\n        }\n      }\n    }\n  }\n}\n\nfunction processReferencesArrayPacketData(\n  object,\n  propertyName,\n  references,\n  interval,\n  entityCollection,\n  PropertyArrayType,\n  CompositePropertyArrayType\n) {\n  const properties = references.map(function (reference) {\n    return createReferenceProperty(entityCollection, reference);\n  });\n\n  if (defined(interval)) {\n    interval = intervalFromString(interval);\n    let property = object[propertyName];\n    if (!(property instanceof CompositePropertyArrayType)) {\n      // If the property was not already a CompositeProperty,\n      // create a CompositeProperty but preserve the existing data.\n\n      // Create the composite and add the old property, wrapped in an infinite interval.\n      const composite = new CompositePropertyArrayType();\n      composite.intervals.addInterval(wrapPropertyInInfiniteInterval(property));\n\n      object[propertyName] = property = composite;\n    }\n\n    interval.data = new PropertyArrayType(properties);\n    property.intervals.addInterval(interval);\n  } else {\n    object[propertyName] = new PropertyArrayType(properties);\n  }\n}\n\nfunction processArrayPacketData(\n  object,\n  propertyName,\n  packetData,\n  entityCollection\n) {\n  const references = packetData.references;\n  if (defined(references)) {\n    processReferencesArrayPacketData(\n      object,\n      propertyName,\n      references,\n      packetData.interval,\n      entityCollection,\n      PropertyArray,\n      CompositeProperty\n    );\n  } else {\n    processPacketData(\n      Array,\n      object,\n      propertyName,\n      packetData,\n      undefined,\n      undefined,\n      entityCollection\n    );\n  }\n}\n\nfunction processArray(object, propertyName, packetData, entityCollection) {\n  if (!defined(packetData)) {\n    return;\n  }\n\n  if (Array.isArray(packetData)) {\n    for (let i = 0, length = packetData.length; i < length; ++i) {\n      processArrayPacketData(\n        object,\n        propertyName,\n        packetData[i],\n        entityCollection\n      );\n    }\n  } else {\n    processArrayPacketData(object, propertyName, packetData, entityCollection);\n  }\n}\n\nfunction processPositionArrayPacketData(\n  object,\n  propertyName,\n  packetData,\n  entityCollection\n) {\n  const references = packetData.references;\n  if (defined(references)) {\n    processReferencesArrayPacketData(\n      object,\n      propertyName,\n      references,\n      packetData.interval,\n      entityCollection,\n      PositionPropertyArray,\n      CompositePositionProperty\n    );\n  } else {\n    if (defined(packetData.cartesian)) {\n      packetData.array = Cartesian3.unpackArray(packetData.cartesian);\n    } else if (defined(packetData.cartographicRadians)) {\n      packetData.array = Cartesian3.fromRadiansArrayHeights(\n        packetData.cartographicRadians,\n        Ellipsoid.WGS84\n      );\n    } else if (defined(packetData.cartographicDegrees)) {\n      packetData.array = Cartesian3.fromDegreesArrayHeights(\n        packetData.cartographicDegrees,\n        Ellipsoid.WGS84\n      );\n    }\n\n    if (defined(packetData.array)) {\n      processPacketData(\n        Array,\n        object,\n        propertyName,\n        packetData,\n        undefined,\n        undefined,\n        entityCollection\n      );\n    }\n  }\n}\n\nfunction processPositionArray(\n  object,\n  propertyName,\n  packetData,\n  entityCollection\n) {\n  if (!defined(packetData)) {\n    return;\n  }\n\n  if (Array.isArray(packetData)) {\n    for (let i = 0, length = packetData.length; i < length; ++i) {\n      processPositionArrayPacketData(\n        object,\n        propertyName,\n        packetData[i],\n        entityCollection\n      );\n    }\n  } else {\n    processPositionArrayPacketData(\n      object,\n      propertyName,\n      packetData,\n      entityCollection\n    );\n  }\n}\n\nfunction unpackCartesianArray(array) {\n  return Cartesian3.unpackArray(array);\n}\n\nfunction unpackCartographicRadiansArray(array) {\n  return Cartesian3.fromRadiansArrayHeights(array, Ellipsoid.WGS84);\n}\n\nfunction unpackCartographicDegreesArray(array) {\n  return Cartesian3.fromDegreesArrayHeights(array, Ellipsoid.WGS84);\n}\n\nfunction processPositionArrayOfArraysPacketData(\n  object,\n  propertyName,\n  packetData,\n  entityCollection\n) {\n  const references = packetData.references;\n  if (defined(references)) {\n    const properties = references.map(function (referenceArray) {\n      const tempObj = {};\n      processReferencesArrayPacketData(\n        tempObj,\n        \"positions\",\n        referenceArray,\n        packetData.interval,\n        entityCollection,\n        PositionPropertyArray,\n        CompositePositionProperty\n      );\n      return tempObj.positions;\n    });\n    object[propertyName] = new PositionPropertyArray(properties);\n  } else {\n    if (defined(packetData.cartesian)) {\n      packetData.array = packetData.cartesian.map(unpackCartesianArray);\n    } else if (defined(packetData.cartographicRadians)) {\n      packetData.array = packetData.cartographicRadians.map(\n        unpackCartographicRadiansArray\n      );\n    } else if (defined(packetData.cartographicDegrees)) {\n      packetData.array = packetData.cartographicDegrees.map(\n        unpackCartographicDegreesArray\n      );\n    }\n\n    if (defined(packetData.array)) {\n      processPacketData(\n        Array,\n        object,\n        propertyName,\n        packetData,\n        undefined,\n        undefined,\n        entityCollection\n      );\n    }\n  }\n}\n\nfunction processPositionArrayOfArrays(\n  object,\n  propertyName,\n  packetData,\n  entityCollection\n) {\n  if (!defined(packetData)) {\n    return;\n  }\n\n  if (Array.isArray(packetData)) {\n    for (let i = 0, length = packetData.length; i < length; ++i) {\n      processPositionArrayOfArraysPacketData(\n        object,\n        propertyName,\n        packetData[i],\n        entityCollection\n      );\n    }\n  } else {\n    processPositionArrayOfArraysPacketData(\n      object,\n      propertyName,\n      packetData,\n      entityCollection\n    );\n  }\n}\n\nfunction processShape(object, propertyName, packetData, entityCollection) {\n  if (!defined(packetData)) {\n    return;\n  }\n\n  if (Array.isArray(packetData)) {\n    for (let i = 0, length = packetData.length; i < length; i++) {\n      processShapePacketData(\n        object,\n        propertyName,\n        packetData[i],\n        entityCollection\n      );\n    }\n  } else {\n    processShapePacketData(object, propertyName, packetData, entityCollection);\n  }\n}\n\nfunction processAvailability(entity, packet, entityCollection, sourceUri) {\n  const packetData = packet.availability;\n  if (!defined(packetData)) {\n    return;\n  }\n\n  let intervals;\n  if (Array.isArray(packetData)) {\n    for (let i = 0, len = packetData.length; i < len; ++i) {\n      if (!defined(intervals)) {\n        intervals = new TimeIntervalCollection();\n      }\n      intervals.addInterval(intervalFromString(packetData[i]));\n    }\n  } else {\n    intervals = new TimeIntervalCollection();\n    intervals.addInterval(intervalFromString(packetData));\n  }\n  entity.availability = intervals;\n}\n\nfunction processAlignedAxis(\n  billboard,\n  packetData,\n  interval,\n  sourceUri,\n  entityCollection\n) {\n  if (!defined(packetData)) {\n    return;\n  }\n\n  processPacketData(\n    UnitCartesian3,\n    billboard,\n    \"alignedAxis\",\n    packetData,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n}\n\nfunction processBillboard(entity, packet, entityCollection, sourceUri) {\n  const billboardData = packet.billboard;\n  if (!defined(billboardData)) {\n    return;\n  }\n\n  const interval = intervalFromString(billboardData.interval);\n  let billboard = entity.billboard;\n  if (!defined(billboard)) {\n    entity.billboard = billboard = new BillboardGraphics();\n  }\n\n  processPacketData(\n    Boolean,\n    billboard,\n    \"show\",\n    billboardData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Image,\n    billboard,\n    \"image\",\n    billboardData.image,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    billboard,\n    \"scale\",\n    billboardData.scale,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Cartesian2,\n    billboard,\n    \"pixelOffset\",\n    billboardData.pixelOffset,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Cartesian3,\n    billboard,\n    \"eyeOffset\",\n    billboardData.eyeOffset,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HorizontalOrigin,\n    billboard,\n    \"horizontalOrigin\",\n    billboardData.horizontalOrigin,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    VerticalOrigin,\n    billboard,\n    \"verticalOrigin\",\n    billboardData.verticalOrigin,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HeightReference,\n    billboard,\n    \"heightReference\",\n    billboardData.heightReference,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    billboard,\n    \"color\",\n    billboardData.color,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Rotation,\n    billboard,\n    \"rotation\",\n    billboardData.rotation,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processAlignedAxis(\n    billboard,\n    billboardData.alignedAxis,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    billboard,\n    \"sizeInMeters\",\n    billboardData.sizeInMeters,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    billboard,\n    \"width\",\n    billboardData.width,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    billboard,\n    \"height\",\n    billboardData.height,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    NearFarScalar,\n    billboard,\n    \"scaleByDistance\",\n    billboardData.scaleByDistance,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    NearFarScalar,\n    billboard,\n    \"translucencyByDistance\",\n    billboardData.translucencyByDistance,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    NearFarScalar,\n    billboard,\n    \"pixelOffsetScaleByDistance\",\n    billboardData.pixelOffsetScaleByDistance,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    BoundingRectangle,\n    billboard,\n    \"imageSubRegion\",\n    billboardData.imageSubRegion,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    DistanceDisplayCondition,\n    billboard,\n    \"distanceDisplayCondition\",\n    billboardData.distanceDisplayCondition,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    billboard,\n    \"disableDepthTestDistance\",\n    billboardData.disableDepthTestDistance,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n}\n\nfunction processBox(entity, packet, entityCollection, sourceUri) {\n  const boxData = packet.box;\n  if (!defined(boxData)) {\n    return;\n  }\n\n  const interval = intervalFromString(boxData.interval);\n  let box = entity.box;\n  if (!defined(box)) {\n    entity.box = box = new BoxGraphics();\n  }\n\n  processPacketData(\n    Boolean,\n    box,\n    \"show\",\n    boxData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Cartesian3,\n    box,\n    \"dimensions\",\n    boxData.dimensions,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HeightReference,\n    box,\n    \"heightReference\",\n    boxData.heightReference,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    box,\n    \"fill\",\n    boxData.fill,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processMaterialPacketData(\n    box,\n    \"material\",\n    boxData.material,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    box,\n    \"outline\",\n    boxData.outline,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    box,\n    \"outlineColor\",\n    boxData.outlineColor,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    box,\n    \"outlineWidth\",\n    boxData.outlineWidth,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ShadowMode,\n    box,\n    \"shadows\",\n    boxData.shadows,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    DistanceDisplayCondition,\n    box,\n    \"distanceDisplayCondition\",\n    boxData.distanceDisplayCondition,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n}\n\nfunction processCorridor(entity, packet, entityCollection, sourceUri) {\n  const corridorData = packet.corridor;\n  if (!defined(corridorData)) {\n    return;\n  }\n\n  const interval = intervalFromString(corridorData.interval);\n  let corridor = entity.corridor;\n  if (!defined(corridor)) {\n    entity.corridor = corridor = new CorridorGraphics();\n  }\n\n  processPacketData(\n    Boolean,\n    corridor,\n    \"show\",\n    corridorData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPositionArray(\n    corridor,\n    \"positions\",\n    corridorData.positions,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    corridor,\n    \"width\",\n    corridorData.width,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    corridor,\n    \"height\",\n    corridorData.height,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HeightReference,\n    corridor,\n    \"heightReference\",\n    corridorData.heightReference,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    corridor,\n    \"extrudedHeight\",\n    corridorData.extrudedHeight,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HeightReference,\n    corridor,\n    \"extrudedHeightReference\",\n    corridorData.extrudedHeightReference,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    CornerType,\n    corridor,\n    \"cornerType\",\n    corridorData.cornerType,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    corridor,\n    \"granularity\",\n    corridorData.granularity,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    corridor,\n    \"fill\",\n    corridorData.fill,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processMaterialPacketData(\n    corridor,\n    \"material\",\n    corridorData.material,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    corridor,\n    \"outline\",\n    corridorData.outline,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    corridor,\n    \"outlineColor\",\n    corridorData.outlineColor,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    corridor,\n    \"outlineWidth\",\n    corridorData.outlineWidth,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ShadowMode,\n    corridor,\n    \"shadows\",\n    corridorData.shadows,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    DistanceDisplayCondition,\n    corridor,\n    \"distanceDisplayCondition\",\n    corridorData.distanceDisplayCondition,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ClassificationType,\n    corridor,\n    \"classificationType\",\n    corridorData.classificationType,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    corridor,\n    \"zIndex\",\n    corridorData.zIndex,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n}\n\nfunction processCylinder(entity, packet, entityCollection, sourceUri) {\n  const cylinderData = packet.cylinder;\n  if (!defined(cylinderData)) {\n    return;\n  }\n\n  const interval = intervalFromString(cylinderData.interval);\n  let cylinder = entity.cylinder;\n  if (!defined(cylinder)) {\n    entity.cylinder = cylinder = new CylinderGraphics();\n  }\n\n  processPacketData(\n    Boolean,\n    cylinder,\n    \"show\",\n    cylinderData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    cylinder,\n    \"length\",\n    cylinderData.length,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    cylinder,\n    \"topRadius\",\n    cylinderData.topRadius,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    cylinder,\n    \"bottomRadius\",\n    cylinderData.bottomRadius,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HeightReference,\n    cylinder,\n    \"heightReference\",\n    cylinderData.heightReference,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    cylinder,\n    \"fill\",\n    cylinderData.fill,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processMaterialPacketData(\n    cylinder,\n    \"material\",\n    cylinderData.material,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    cylinder,\n    \"outline\",\n    cylinderData.outline,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    cylinder,\n    \"outlineColor\",\n    cylinderData.outlineColor,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    cylinder,\n    \"outlineWidth\",\n    cylinderData.outlineWidth,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    cylinder,\n    \"numberOfVerticalLines\",\n    cylinderData.numberOfVerticalLines,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    cylinder,\n    \"slices\",\n    cylinderData.slices,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ShadowMode,\n    cylinder,\n    \"shadows\",\n    cylinderData.shadows,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    DistanceDisplayCondition,\n    cylinder,\n    \"distanceDisplayCondition\",\n    cylinderData.distanceDisplayCondition,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n}\n\nfunction processDocument(packet, dataSource) {\n  const version = packet.version;\n  if (defined(version)) {\n    if (typeof version === \"string\") {\n      const tokens = version.split(\".\");\n      if (tokens.length === 2) {\n        if (tokens[0] !== \"1\") {\n          throw new RuntimeError(\"Cesium only supports CZML version 1.\");\n        }\n        dataSource._version = version;\n      }\n    }\n  }\n\n  if (!defined(dataSource._version)) {\n    throw new RuntimeError(\n      \"CZML version information invalid.  It is expected to be a property on the document object in the <Major>.<Minor> version format.\"\n    );\n  }\n\n  const documentPacket = dataSource._documentPacket;\n\n  if (defined(packet.name)) {\n    documentPacket.name = packet.name;\n  }\n\n  const clockPacket = packet.clock;\n  if (defined(clockPacket)) {\n    const clock = documentPacket.clock;\n    if (!defined(clock)) {\n      documentPacket.clock = {\n        interval: clockPacket.interval,\n        currentTime: clockPacket.currentTime,\n        range: clockPacket.range,\n        step: clockPacket.step,\n        multiplier: clockPacket.multiplier,\n      };\n    } else {\n      clock.interval = defaultValue(clockPacket.interval, clock.interval);\n      clock.currentTime = defaultValue(\n        clockPacket.currentTime,\n        clock.currentTime\n      );\n      clock.range = defaultValue(clockPacket.range, clock.range);\n      clock.step = defaultValue(clockPacket.step, clock.step);\n      clock.multiplier = defaultValue(clockPacket.multiplier, clock.multiplier);\n    }\n  }\n}\n\nfunction processEllipse(entity, packet, entityCollection, sourceUri) {\n  const ellipseData = packet.ellipse;\n  if (!defined(ellipseData)) {\n    return;\n  }\n\n  const interval = intervalFromString(ellipseData.interval);\n  let ellipse = entity.ellipse;\n  if (!defined(ellipse)) {\n    entity.ellipse = ellipse = new EllipseGraphics();\n  }\n\n  processPacketData(\n    Boolean,\n    ellipse,\n    \"show\",\n    ellipseData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipse,\n    \"semiMajorAxis\",\n    ellipseData.semiMajorAxis,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipse,\n    \"semiMinorAxis\",\n    ellipseData.semiMinorAxis,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipse,\n    \"height\",\n    ellipseData.height,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HeightReference,\n    ellipse,\n    \"heightReference\",\n    ellipseData.heightReference,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipse,\n    \"extrudedHeight\",\n    ellipseData.extrudedHeight,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HeightReference,\n    ellipse,\n    \"extrudedHeightReference\",\n    ellipseData.extrudedHeightReference,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Rotation,\n    ellipse,\n    \"rotation\",\n    ellipseData.rotation,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Rotation,\n    ellipse,\n    \"stRotation\",\n    ellipseData.stRotation,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipse,\n    \"granularity\",\n    ellipseData.granularity,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    ellipse,\n    \"fill\",\n    ellipseData.fill,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processMaterialPacketData(\n    ellipse,\n    \"material\",\n    ellipseData.material,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    ellipse,\n    \"outline\",\n    ellipseData.outline,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    ellipse,\n    \"outlineColor\",\n    ellipseData.outlineColor,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipse,\n    \"outlineWidth\",\n    ellipseData.outlineWidth,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipse,\n    \"numberOfVerticalLines\",\n    ellipseData.numberOfVerticalLines,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ShadowMode,\n    ellipse,\n    \"shadows\",\n    ellipseData.shadows,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    DistanceDisplayCondition,\n    ellipse,\n    \"distanceDisplayCondition\",\n    ellipseData.distanceDisplayCondition,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ClassificationType,\n    ellipse,\n    \"classificationType\",\n    ellipseData.classificationType,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipse,\n    \"zIndex\",\n    ellipseData.zIndex,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n}\n\nfunction processEllipsoid(entity, packet, entityCollection, sourceUri) {\n  const ellipsoidData = packet.ellipsoid;\n  if (!defined(ellipsoidData)) {\n    return;\n  }\n\n  const interval = intervalFromString(ellipsoidData.interval);\n  let ellipsoid = entity.ellipsoid;\n  if (!defined(ellipsoid)) {\n    entity.ellipsoid = ellipsoid = new EllipsoidGraphics();\n  }\n\n  processPacketData(\n    Boolean,\n    ellipsoid,\n    \"show\",\n    ellipsoidData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Cartesian3,\n    ellipsoid,\n    \"radii\",\n    ellipsoidData.radii,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Cartesian3,\n    ellipsoid,\n    \"innerRadii\",\n    ellipsoidData.innerRadii,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipsoid,\n    \"minimumClock\",\n    ellipsoidData.minimumClock,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipsoid,\n    \"maximumClock\",\n    ellipsoidData.maximumClock,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipsoid,\n    \"minimumCone\",\n    ellipsoidData.minimumCone,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipsoid,\n    \"maximumCone\",\n    ellipsoidData.maximumCone,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HeightReference,\n    ellipsoid,\n    \"heightReference\",\n    ellipsoidData.heightReference,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    ellipsoid,\n    \"fill\",\n    ellipsoidData.fill,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processMaterialPacketData(\n    ellipsoid,\n    \"material\",\n    ellipsoidData.material,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    ellipsoid,\n    \"outline\",\n    ellipsoidData.outline,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    ellipsoid,\n    \"outlineColor\",\n    ellipsoidData.outlineColor,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipsoid,\n    \"outlineWidth\",\n    ellipsoidData.outlineWidth,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipsoid,\n    \"stackPartitions\",\n    ellipsoidData.stackPartitions,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipsoid,\n    \"slicePartitions\",\n    ellipsoidData.slicePartitions,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    ellipsoid,\n    \"subdivisions\",\n    ellipsoidData.subdivisions,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ShadowMode,\n    ellipsoid,\n    \"shadows\",\n    ellipsoidData.shadows,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    DistanceDisplayCondition,\n    ellipsoid,\n    \"distanceDisplayCondition\",\n    ellipsoidData.distanceDisplayCondition,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n}\n\nfunction processLabel(entity, packet, entityCollection, sourceUri) {\n  const labelData = packet.label;\n  if (!defined(labelData)) {\n    return;\n  }\n\n  const interval = intervalFromString(labelData.interval);\n  let label = entity.label;\n  if (!defined(label)) {\n    entity.label = label = new LabelGraphics();\n  }\n\n  processPacketData(\n    Boolean,\n    label,\n    \"show\",\n    labelData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    String,\n    label,\n    \"text\",\n    labelData.text,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    String,\n    label,\n    \"font\",\n    labelData.font,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    LabelStyle,\n    label,\n    \"style\",\n    labelData.style,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    label,\n    \"scale\",\n    labelData.scale,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    label,\n    \"showBackground\",\n    labelData.showBackground,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    label,\n    \"backgroundColor\",\n    labelData.backgroundColor,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Cartesian2,\n    label,\n    \"backgroundPadding\",\n    labelData.backgroundPadding,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Cartesian2,\n    label,\n    \"pixelOffset\",\n    labelData.pixelOffset,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Cartesian3,\n    label,\n    \"eyeOffset\",\n    labelData.eyeOffset,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HorizontalOrigin,\n    label,\n    \"horizontalOrigin\",\n    labelData.horizontalOrigin,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    VerticalOrigin,\n    label,\n    \"verticalOrigin\",\n    labelData.verticalOrigin,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HeightReference,\n    label,\n    \"heightReference\",\n    labelData.heightReference,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    label,\n    \"fillColor\",\n    labelData.fillColor,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    label,\n    \"outlineColor\",\n    labelData.outlineColor,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    label,\n    \"outlineWidth\",\n    labelData.outlineWidth,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    NearFarScalar,\n    label,\n    \"translucencyByDistance\",\n    labelData.translucencyByDistance,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    NearFarScalar,\n    label,\n    \"pixelOffsetScaleByDistance\",\n    labelData.pixelOffsetScaleByDistance,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    NearFarScalar,\n    label,\n    \"scaleByDistance\",\n    labelData.scaleByDistance,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    DistanceDisplayCondition,\n    label,\n    \"distanceDisplayCondition\",\n    labelData.distanceDisplayCondition,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    label,\n    \"disableDepthTestDistance\",\n    labelData.disableDepthTestDistance,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n}\n\nfunction processModel(entity, packet, entityCollection, sourceUri) {\n  const modelData = packet.model;\n  if (!defined(modelData)) {\n    return;\n  }\n\n  const interval = intervalFromString(modelData.interval);\n  let model = entity.model;\n  if (!defined(model)) {\n    entity.model = model = new ModelGraphics();\n  }\n\n  processPacketData(\n    Boolean,\n    model,\n    \"show\",\n    modelData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Uri,\n    model,\n    \"uri\",\n    modelData.gltf,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    model,\n    \"scale\",\n    modelData.scale,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    model,\n    \"minimumPixelSize\",\n    modelData.minimumPixelSize,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    model,\n    \"maximumScale\",\n    modelData.maximumScale,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    model,\n    \"incrementallyLoadTextures\",\n    modelData.incrementallyLoadTextures,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    model,\n    \"runAnimations\",\n    modelData.runAnimations,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    model,\n    \"clampAnimations\",\n    modelData.clampAnimations,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ShadowMode,\n    model,\n    \"shadows\",\n    modelData.shadows,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HeightReference,\n    model,\n    \"heightReference\",\n    modelData.heightReference,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    model,\n    \"silhouetteColor\",\n    modelData.silhouetteColor,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    model,\n    \"silhouetteSize\",\n    modelData.silhouetteSize,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    model,\n    \"color\",\n    modelData.color,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ColorBlendMode,\n    model,\n    \"colorBlendMode\",\n    modelData.colorBlendMode,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    model,\n    \"colorBlendAmount\",\n    modelData.colorBlendAmount,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    DistanceDisplayCondition,\n    model,\n    \"distanceDisplayCondition\",\n    modelData.distanceDisplayCondition,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n\n  let i, len;\n  const nodeTransformationsData = modelData.nodeTransformations;\n  if (defined(nodeTransformationsData)) {\n    if (Array.isArray(nodeTransformationsData)) {\n      for (i = 0, len = nodeTransformationsData.length; i < len; ++i) {\n        processNodeTransformations(\n          model,\n          nodeTransformationsData[i],\n          interval,\n          sourceUri,\n          entityCollection\n        );\n      }\n    } else {\n      processNodeTransformations(\n        model,\n        nodeTransformationsData,\n        interval,\n        sourceUri,\n        entityCollection\n      );\n    }\n  }\n\n  const articulationsData = modelData.articulations;\n  if (defined(articulationsData)) {\n    if (Array.isArray(articulationsData)) {\n      for (i = 0, len = articulationsData.length; i < len; ++i) {\n        processArticulations(\n          model,\n          articulationsData[i],\n          interval,\n          sourceUri,\n          entityCollection\n        );\n      }\n    } else {\n      processArticulations(\n        model,\n        articulationsData,\n        interval,\n        sourceUri,\n        entityCollection\n      );\n    }\n  }\n}\n\nfunction processNodeTransformations(\n  model,\n  nodeTransformationsData,\n  constrainedInterval,\n  sourceUri,\n  entityCollection\n) {\n  let combinedInterval = intervalFromString(nodeTransformationsData.interval);\n  if (defined(constrainedInterval)) {\n    if (defined(combinedInterval)) {\n      combinedInterval = TimeInterval.intersect(\n        combinedInterval,\n        constrainedInterval,\n        scratchTimeInterval\n      );\n    } else {\n      combinedInterval = constrainedInterval;\n    }\n  }\n\n  let nodeTransformations = model.nodeTransformations;\n  const nodeNames = Object.keys(nodeTransformationsData);\n  for (let i = 0, len = nodeNames.length; i < len; ++i) {\n    const nodeName = nodeNames[i];\n    if (nodeName === \"interval\") {\n      continue;\n    }\n\n    const nodeTransformationData = nodeTransformationsData[nodeName];\n    if (!defined(nodeTransformationData)) {\n      continue;\n    }\n\n    if (!defined(nodeTransformations)) {\n      model.nodeTransformations = nodeTransformations = new PropertyBag();\n    }\n\n    if (!nodeTransformations.hasProperty(nodeName)) {\n      nodeTransformations.addProperty(nodeName);\n    }\n\n    let nodeTransformation = nodeTransformations[nodeName];\n    if (!defined(nodeTransformation)) {\n      nodeTransformations[\n        nodeName\n      ] = nodeTransformation = new NodeTransformationProperty();\n    }\n\n    processPacketData(\n      Cartesian3,\n      nodeTransformation,\n      \"translation\",\n      nodeTransformationData.translation,\n      combinedInterval,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Quaternion,\n      nodeTransformation,\n      \"rotation\",\n      nodeTransformationData.rotation,\n      combinedInterval,\n      sourceUri,\n      entityCollection\n    );\n    processPacketData(\n      Cartesian3,\n      nodeTransformation,\n      \"scale\",\n      nodeTransformationData.scale,\n      combinedInterval,\n      sourceUri,\n      entityCollection\n    );\n  }\n}\n\nfunction processArticulations(\n  model,\n  articulationsData,\n  constrainedInterval,\n  sourceUri,\n  entityCollection\n) {\n  let combinedInterval = intervalFromString(articulationsData.interval);\n  if (defined(constrainedInterval)) {\n    if (defined(combinedInterval)) {\n      combinedInterval = TimeInterval.intersect(\n        combinedInterval,\n        constrainedInterval,\n        scratchTimeInterval\n      );\n    } else {\n      combinedInterval = constrainedInterval;\n    }\n  }\n\n  let articulations = model.articulations;\n  const keys = Object.keys(articulationsData);\n  for (let i = 0, len = keys.length; i < len; ++i) {\n    const key = keys[i];\n    if (key === \"interval\") {\n      continue;\n    }\n\n    const articulationStageData = articulationsData[key];\n    if (!defined(articulationStageData)) {\n      continue;\n    }\n\n    if (!defined(articulations)) {\n      model.articulations = articulations = new PropertyBag();\n    }\n\n    if (!articulations.hasProperty(key)) {\n      articulations.addProperty(key);\n    }\n\n    processPacketData(\n      Number,\n      articulations,\n      key,\n      articulationStageData,\n      combinedInterval,\n      sourceUri,\n      entityCollection\n    );\n  }\n}\n\nfunction processPath(entity, packet, entityCollection, sourceUri) {\n  const pathData = packet.path;\n  if (!defined(pathData)) {\n    return;\n  }\n\n  const interval = intervalFromString(pathData.interval);\n  let path = entity.path;\n  if (!defined(path)) {\n    entity.path = path = new PathGraphics();\n  }\n\n  processPacketData(\n    Boolean,\n    path,\n    \"show\",\n    pathData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    path,\n    \"leadTime\",\n    pathData.leadTime,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    path,\n    \"trailTime\",\n    pathData.trailTime,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    path,\n    \"width\",\n    pathData.width,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    path,\n    \"resolution\",\n    pathData.resolution,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processMaterialPacketData(\n    path,\n    \"material\",\n    pathData.material,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    DistanceDisplayCondition,\n    path,\n    \"distanceDisplayCondition\",\n    pathData.distanceDisplayCondition,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n}\n\nfunction processPoint(entity, packet, entityCollection, sourceUri) {\n  const pointData = packet.point;\n  if (!defined(pointData)) {\n    return;\n  }\n\n  const interval = intervalFromString(pointData.interval);\n  let point = entity.point;\n  if (!defined(point)) {\n    entity.point = point = new PointGraphics();\n  }\n\n  processPacketData(\n    Boolean,\n    point,\n    \"show\",\n    pointData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    point,\n    \"pixelSize\",\n    pointData.pixelSize,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HeightReference,\n    point,\n    \"heightReference\",\n    pointData.heightReference,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    point,\n    \"color\",\n    pointData.color,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    point,\n    \"outlineColor\",\n    pointData.outlineColor,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    point,\n    \"outlineWidth\",\n    pointData.outlineWidth,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    NearFarScalar,\n    point,\n    \"scaleByDistance\",\n    pointData.scaleByDistance,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    NearFarScalar,\n    point,\n    \"translucencyByDistance\",\n    pointData.translucencyByDistance,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    DistanceDisplayCondition,\n    point,\n    \"distanceDisplayCondition\",\n    pointData.distanceDisplayCondition,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    point,\n    \"disableDepthTestDistance\",\n    pointData.disableDepthTestDistance,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n}\n\nfunction PolygonHierarchyProperty(polygon) {\n  this.polygon = polygon;\n  this._definitionChanged = new Event();\n}\n\nObject.defineProperties(PolygonHierarchyProperty.prototype, {\n  isConstant: {\n    get: function () {\n      const positions = this.polygon._positions;\n      const holes = this.polygon._holes;\n      return (\n        (!defined(positions) || positions.isConstant) &&\n        (!defined(holes) || holes.isConstant)\n      );\n    },\n  },\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n});\n\nPolygonHierarchyProperty.prototype.getValue = function (time, result) {\n  let positions;\n  if (defined(this.polygon._positions)) {\n    positions = this.polygon._positions.getValue(time);\n  }\n\n  let holes;\n  if (defined(this.polygon._holes)) {\n    holes = this.polygon._holes.getValue(time);\n    if (defined(holes)) {\n      holes = holes.map(function (holePositions) {\n        return new PolygonHierarchy(holePositions);\n      });\n    }\n  }\n\n  if (!defined(result)) {\n    return new PolygonHierarchy(positions, holes);\n  }\n\n  result.positions = positions;\n  result.holes = holes;\n  return result;\n};\n\nPolygonHierarchyProperty.prototype.equals = function (other) {\n  return (\n    this === other ||\n    (other instanceof PolygonHierarchyProperty &&\n      Property.equals(this.polygon._positions, other.polygon._positions) &&\n      Property.equals(this.polygon._holes, other.polygon._holes))\n  );\n};\n\nfunction processPolygon(entity, packet, entityCollection, sourceUri) {\n  const polygonData = packet.polygon;\n  if (!defined(polygonData)) {\n    return;\n  }\n\n  const interval = intervalFromString(polygonData.interval);\n  let polygon = entity.polygon;\n  if (!defined(polygon)) {\n    entity.polygon = polygon = new PolygonGraphics();\n  }\n\n  processPacketData(\n    Boolean,\n    polygon,\n    \"show\",\n    polygonData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n\n  // adapt 'position' property producing Cartesian[]\n  // and 'holes' property producing Cartesian[][]\n  // to a single property producing PolygonHierarchy\n  processPositionArray(\n    polygon,\n    \"_positions\",\n    polygonData.positions,\n    entityCollection\n  );\n  processPositionArrayOfArrays(\n    polygon,\n    \"_holes\",\n    polygonData.holes,\n    entityCollection\n  );\n  if (defined(polygon._positions) || defined(polygon._holes)) {\n    polygon.hierarchy = new PolygonHierarchyProperty(polygon);\n  }\n\n  processPacketData(\n    Number,\n    polygon,\n    \"height\",\n    polygonData.height,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HeightReference,\n    polygon,\n    \"heightReference\",\n    polygonData.heightReference,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    polygon,\n    \"extrudedHeight\",\n    polygonData.extrudedHeight,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HeightReference,\n    polygon,\n    \"extrudedHeightReference\",\n    polygonData.extrudedHeightReference,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Rotation,\n    polygon,\n    \"stRotation\",\n    polygonData.stRotation,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    polygon,\n    \"granularity\",\n    polygonData.granularity,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    polygon,\n    \"fill\",\n    polygonData.fill,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processMaterialPacketData(\n    polygon,\n    \"material\",\n    polygonData.material,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    polygon,\n    \"outline\",\n    polygonData.outline,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    polygon,\n    \"outlineColor\",\n    polygonData.outlineColor,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    polygon,\n    \"outlineWidth\",\n    polygonData.outlineWidth,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    polygon,\n    \"perPositionHeight\",\n    polygonData.perPositionHeight,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    polygon,\n    \"closeTop\",\n    polygonData.closeTop,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    polygon,\n    \"closeBottom\",\n    polygonData.closeBottom,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ArcType,\n    polygon,\n    \"arcType\",\n    polygonData.arcType,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ShadowMode,\n    polygon,\n    \"shadows\",\n    polygonData.shadows,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    DistanceDisplayCondition,\n    polygon,\n    \"distanceDisplayCondition\",\n    polygonData.distanceDisplayCondition,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ClassificationType,\n    polygon,\n    \"classificationType\",\n    polygonData.classificationType,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    polygon,\n    \"zIndex\",\n    polygonData.zIndex,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n}\n\nfunction adaptFollowSurfaceToArcType(followSurface) {\n  return followSurface ? ArcType.GEODESIC : ArcType.NONE;\n}\n\nfunction processPolyline(entity, packet, entityCollection, sourceUri) {\n  const polylineData = packet.polyline;\n  if (!defined(polylineData)) {\n    return;\n  }\n\n  const interval = intervalFromString(polylineData.interval);\n  let polyline = entity.polyline;\n  if (!defined(polyline)) {\n    entity.polyline = polyline = new PolylineGraphics();\n  }\n\n  processPacketData(\n    Boolean,\n    polyline,\n    \"show\",\n    polylineData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPositionArray(\n    polyline,\n    \"positions\",\n    polylineData.positions,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    polyline,\n    \"width\",\n    polylineData.width,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    polyline,\n    \"granularity\",\n    polylineData.granularity,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processMaterialPacketData(\n    polyline,\n    \"material\",\n    polylineData.material,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processMaterialPacketData(\n    polyline,\n    \"depthFailMaterial\",\n    polylineData.depthFailMaterial,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ArcType,\n    polyline,\n    \"arcType\",\n    polylineData.arcType,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    polyline,\n    \"clampToGround\",\n    polylineData.clampToGround,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ShadowMode,\n    polyline,\n    \"shadows\",\n    polylineData.shadows,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    DistanceDisplayCondition,\n    polyline,\n    \"distanceDisplayCondition\",\n    polylineData.distanceDisplayCondition,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ClassificationType,\n    polyline,\n    \"classificationType\",\n    polylineData.classificationType,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    polyline,\n    \"zIndex\",\n    polylineData.zIndex,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n\n  // for backwards compatibility, adapt CZML followSurface to arcType.\n  if (defined(polylineData.followSurface) && !defined(polylineData.arcType)) {\n    const tempObj = {};\n    processPacketData(\n      Boolean,\n      tempObj,\n      \"followSurface\",\n      polylineData.followSurface,\n      interval,\n      sourceUri,\n      entityCollection\n    );\n    polyline.arcType = createAdapterProperty(\n      tempObj.followSurface,\n      adaptFollowSurfaceToArcType\n    );\n  }\n}\n\nfunction processPolylineVolume(entity, packet, entityCollection, sourceUri) {\n  const polylineVolumeData = packet.polylineVolume;\n  if (!defined(polylineVolumeData)) {\n    return;\n  }\n\n  const interval = intervalFromString(polylineVolumeData.interval);\n  let polylineVolume = entity.polylineVolume;\n  if (!defined(polylineVolume)) {\n    entity.polylineVolume = polylineVolume = new PolylineVolumeGraphics();\n  }\n\n  processPositionArray(\n    polylineVolume,\n    \"positions\",\n    polylineVolumeData.positions,\n    entityCollection\n  );\n  processShape(\n    polylineVolume,\n    \"shape\",\n    polylineVolumeData.shape,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    polylineVolume,\n    \"show\",\n    polylineVolumeData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    CornerType,\n    polylineVolume,\n    \"cornerType\",\n    polylineVolumeData.cornerType,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    polylineVolume,\n    \"fill\",\n    polylineVolumeData.fill,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processMaterialPacketData(\n    polylineVolume,\n    \"material\",\n    polylineVolumeData.material,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    polylineVolume,\n    \"outline\",\n    polylineVolumeData.outline,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    polylineVolume,\n    \"outlineColor\",\n    polylineVolumeData.outlineColor,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    polylineVolume,\n    \"outlineWidth\",\n    polylineVolumeData.outlineWidth,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    polylineVolume,\n    \"granularity\",\n    polylineVolumeData.granularity,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ShadowMode,\n    polylineVolume,\n    \"shadows\",\n    polylineVolumeData.shadows,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    DistanceDisplayCondition,\n    polylineVolume,\n    \"distanceDisplayCondition\",\n    polylineVolumeData.distanceDisplayCondition,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n}\n\nfunction processRectangle(entity, packet, entityCollection, sourceUri) {\n  const rectangleData = packet.rectangle;\n  if (!defined(rectangleData)) {\n    return;\n  }\n\n  const interval = intervalFromString(rectangleData.interval);\n  let rectangle = entity.rectangle;\n  if (!defined(rectangle)) {\n    entity.rectangle = rectangle = new RectangleGraphics();\n  }\n\n  processPacketData(\n    Boolean,\n    rectangle,\n    \"show\",\n    rectangleData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Rectangle,\n    rectangle,\n    \"coordinates\",\n    rectangleData.coordinates,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    rectangle,\n    \"height\",\n    rectangleData.height,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HeightReference,\n    rectangle,\n    \"heightReference\",\n    rectangleData.heightReference,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    rectangle,\n    \"extrudedHeight\",\n    rectangleData.extrudedHeight,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    HeightReference,\n    rectangle,\n    \"extrudedHeightReference\",\n    rectangleData.extrudedHeightReference,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Rotation,\n    rectangle,\n    \"rotation\",\n    rectangleData.rotation,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Rotation,\n    rectangle,\n    \"stRotation\",\n    rectangleData.stRotation,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    rectangle,\n    \"granularity\",\n    rectangleData.granularity,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    rectangle,\n    \"fill\",\n    rectangleData.fill,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processMaterialPacketData(\n    rectangle,\n    \"material\",\n    rectangleData.material,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    rectangle,\n    \"outline\",\n    rectangleData.outline,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    rectangle,\n    \"outlineColor\",\n    rectangleData.outlineColor,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    rectangle,\n    \"outlineWidth\",\n    rectangleData.outlineWidth,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ShadowMode,\n    rectangle,\n    \"shadows\",\n    rectangleData.shadows,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    DistanceDisplayCondition,\n    rectangle,\n    \"distanceDisplayCondition\",\n    rectangleData.distanceDisplayCondition,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ClassificationType,\n    rectangle,\n    \"classificationType\",\n    rectangleData.classificationType,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    rectangle,\n    \"zIndex\",\n    rectangleData.zIndex,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n}\n\nfunction processTileset(entity, packet, entityCollection, sourceUri) {\n  const tilesetData = packet.tileset;\n  if (!defined(tilesetData)) {\n    return;\n  }\n\n  const interval = intervalFromString(tilesetData.interval);\n  let tileset = entity.tileset;\n  if (!defined(tileset)) {\n    entity.tileset = tileset = new Cesium3DTilesetGraphics();\n  }\n\n  processPacketData(\n    Boolean,\n    tileset,\n    \"show\",\n    tilesetData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Uri,\n    tileset,\n    \"uri\",\n    tilesetData.uri,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    tileset,\n    \"maximumScreenSpaceError\",\n    tilesetData.maximumScreenSpaceError,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n}\n\nfunction processWall(entity, packet, entityCollection, sourceUri) {\n  const wallData = packet.wall;\n  if (!defined(wallData)) {\n    return;\n  }\n\n  const interval = intervalFromString(wallData.interval);\n  let wall = entity.wall;\n  if (!defined(wall)) {\n    entity.wall = wall = new WallGraphics();\n  }\n\n  processPacketData(\n    Boolean,\n    wall,\n    \"show\",\n    wallData.show,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPositionArray(wall, \"positions\", wallData.positions, entityCollection);\n  processArray(\n    wall,\n    \"minimumHeights\",\n    wallData.minimumHeights,\n    entityCollection\n  );\n  processArray(\n    wall,\n    \"maximumHeights\",\n    wallData.maximumHeights,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    wall,\n    \"granularity\",\n    wallData.granularity,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    wall,\n    \"fill\",\n    wallData.fill,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processMaterialPacketData(\n    wall,\n    \"material\",\n    wallData.material,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Boolean,\n    wall,\n    \"outline\",\n    wallData.outline,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Color,\n    wall,\n    \"outlineColor\",\n    wallData.outlineColor,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    Number,\n    wall,\n    \"outlineWidth\",\n    wallData.outlineWidth,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    ShadowMode,\n    wall,\n    \"shadows\",\n    wallData.shadows,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n  processPacketData(\n    DistanceDisplayCondition,\n    wall,\n    \"distanceDisplayCondition\",\n    wallData.distanceDisplayCondition,\n    interval,\n    sourceUri,\n    entityCollection\n  );\n}\n\nfunction processCzmlPacket(\n  packet,\n  entityCollection,\n  updaterFunctions,\n  sourceUri,\n  dataSource\n) {\n  let objectId = packet.id;\n  if (!defined(objectId)) {\n    objectId = createGuid();\n  }\n\n  currentId = objectId;\n\n  if (!defined(dataSource._version) && objectId !== \"document\") {\n    throw new RuntimeError(\n      \"The first CZML packet is required to be the document object.\"\n    );\n  }\n\n  if (packet[\"delete\"] === true) {\n    entityCollection.removeById(objectId);\n  } else if (objectId === \"document\") {\n    processDocument(packet, dataSource);\n  } else {\n    const entity = entityCollection.getOrCreateEntity(objectId);\n\n    const parentId = packet.parent;\n    if (defined(parentId)) {\n      entity.parent = entityCollection.getOrCreateEntity(parentId);\n    }\n\n    for (let i = updaterFunctions.length - 1; i > -1; i--) {\n      updaterFunctions[i](entity, packet, entityCollection, sourceUri);\n    }\n  }\n\n  currentId = undefined;\n}\n\nfunction updateClock(dataSource) {\n  let clock;\n  const clockPacket = dataSource._documentPacket.clock;\n  if (!defined(clockPacket)) {\n    if (!defined(dataSource._clock)) {\n      const availability = dataSource._entityCollection.computeAvailability();\n      if (!availability.start.equals(Iso8601.MINIMUM_VALUE)) {\n        const startTime = availability.start;\n        const stopTime = availability.stop;\n        const totalSeconds = JulianDate.secondsDifference(stopTime, startTime);\n        const multiplier = Math.round(totalSeconds / 120.0);\n\n        clock = new DataSourceClock();\n        clock.startTime = JulianDate.clone(startTime);\n        clock.stopTime = JulianDate.clone(stopTime);\n        clock.clockRange = ClockRange.LOOP_STOP;\n        clock.multiplier = multiplier;\n        clock.currentTime = JulianDate.clone(startTime);\n        clock.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n        dataSource._clock = clock;\n        return true;\n      }\n    }\n    return false;\n  }\n\n  if (defined(dataSource._clock)) {\n    clock = dataSource._clock.clone();\n  } else {\n    clock = new DataSourceClock();\n    clock.startTime = Iso8601.MINIMUM_VALUE.clone();\n    clock.stopTime = Iso8601.MAXIMUM_VALUE.clone();\n    clock.currentTime = Iso8601.MINIMUM_VALUE.clone();\n    clock.clockRange = ClockRange.LOOP_STOP;\n    clock.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n    clock.multiplier = 1.0;\n  }\n\n  const interval = intervalFromString(clockPacket.interval);\n  if (defined(interval)) {\n    clock.startTime = interval.start;\n    clock.stopTime = interval.stop;\n  }\n\n  if (defined(clockPacket.currentTime)) {\n    clock.currentTime = JulianDate.fromIso8601(clockPacket.currentTime);\n  }\n  if (defined(clockPacket.range)) {\n    clock.clockRange = defaultValue(\n      ClockRange[clockPacket.range],\n      ClockRange.LOOP_STOP\n    );\n  }\n  if (defined(clockPacket.step)) {\n    clock.clockStep = defaultValue(\n      ClockStep[clockPacket.step],\n      ClockStep.SYSTEM_CLOCK_MULTIPLIER\n    );\n  }\n  if (defined(clockPacket.multiplier)) {\n    clock.multiplier = clockPacket.multiplier;\n  }\n\n  if (!clock.equals(dataSource._clock)) {\n    dataSource._clock = clock.clone(dataSource._clock);\n    return true;\n  }\n\n  return false;\n}\n\nfunction load(dataSource, czml, options, clear) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(czml)) {\n    throw new DeveloperError(\"czml is required.\");\n  }\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  let promise = czml;\n  let sourceUri = options.sourceUri;\n\n  // User specified credit\n  let credit = options.credit;\n  if (typeof credit === \"string\") {\n    credit = new Credit(credit);\n  }\n  dataSource._credit = credit;\n\n  // If the czml is a URL\n  if (typeof czml === \"string\" || czml instanceof Resource) {\n    czml = Resource.createIfNeeded(czml);\n    promise = czml.fetchJson();\n    sourceUri = defaultValue(sourceUri, czml.clone());\n\n    // Add resource credits to our list of credits to display\n    const resourceCredits = dataSource._resourceCredits;\n    const credits = czml.credits;\n    if (defined(credits)) {\n      const length = credits.length;\n      for (let i = 0; i < length; i++) {\n        resourceCredits.push(credits[i]);\n      }\n    }\n  }\n\n  sourceUri = Resource.createIfNeeded(sourceUri);\n\n  DataSource.setLoading(dataSource, true);\n\n  return Promise.resolve(promise)\n    .then(function (czml) {\n      return loadCzml(dataSource, czml, sourceUri, clear);\n    })\n    .catch(function (error) {\n      DataSource.setLoading(dataSource, false);\n      dataSource._error.raiseEvent(dataSource, error);\n      console.log(error);\n      return Promise.reject(error);\n    });\n}\n\nfunction loadCzml(dataSource, czml, sourceUri, clear) {\n  DataSource.setLoading(dataSource, true);\n  const entityCollection = dataSource._entityCollection;\n\n  if (clear) {\n    dataSource._version = undefined;\n    dataSource._documentPacket = new DocumentPacket();\n    entityCollection.removeAll();\n  }\n\n  CzmlDataSource._processCzml(\n    czml,\n    entityCollection,\n    sourceUri,\n    undefined,\n    dataSource\n  );\n\n  let raiseChangedEvent = updateClock(dataSource);\n\n  const documentPacket = dataSource._documentPacket;\n  if (\n    defined(documentPacket.name) &&\n    dataSource._name !== documentPacket.name\n  ) {\n    dataSource._name = documentPacket.name;\n    raiseChangedEvent = true;\n  } else if (!defined(dataSource._name) && defined(sourceUri)) {\n    dataSource._name = getFilenameFromUri(sourceUri.getUrlComponent());\n    raiseChangedEvent = true;\n  }\n\n  DataSource.setLoading(dataSource, false);\n  if (raiseChangedEvent) {\n    dataSource._changed.raiseEvent(dataSource);\n  }\n\n  return dataSource;\n}\n\nfunction DocumentPacket() {\n  this.name = undefined;\n  this.clock = undefined;\n}\n\n/**\n * @typedef {object} CzmlDataSource.LoadOptions\n *\n * Initialization options for the <code>load</code> method.\n *\n * @property {Resource|string} [sourceUri] Overrides the url to use for resolving relative links.\n * @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.\n */\n\n/**\n * A {@link DataSource} which processes {@link https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide|CZML}.\n * @alias CzmlDataSource\n * @constructor\n *\n * @param {string} [name] An optional name for the data source.  This value will be overwritten if a loaded document contains a name.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=CZML.html|Cesium Sandcastle CZML Demo}\n */\nfunction CzmlDataSource(name) {\n  this._name = name;\n  this._changed = new Event();\n  this._error = new Event();\n  this._isLoading = false;\n  this._loading = new Event();\n  this._clock = undefined;\n  this._documentPacket = new DocumentPacket();\n  this._version = undefined;\n  this._entityCollection = new EntityCollection(this);\n  this._entityCluster = new EntityCluster();\n  this._credit = undefined;\n  this._resourceCredits = [];\n}\n\n/**\n * Creates a Promise to a new instance loaded with the provided CZML data.\n *\n * @param {Resource|string|object} czml A url or CZML object to be processed.\n * @param {CzmlDataSource.LoadOptions} [options] An object specifying configuration options\n *\n * @returns {Promise<CzmlDataSource>} A promise that resolves to the new instance once the data is processed.\n */\nCzmlDataSource.load = function (czml, options) {\n  return new CzmlDataSource().load(czml, options);\n};\n\nObject.defineProperties(CzmlDataSource.prototype, {\n  /**\n   * Gets a human-readable name for this instance.\n   * @memberof CzmlDataSource.prototype\n   * @type {string}\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n  /**\n   * Gets the clock settings defined by the loaded CZML.  If no clock is explicitly\n   * defined in the CZML, the combined availability of all objects is returned.  If\n   * only static data exists, this value is undefined.\n   * @memberof CzmlDataSource.prototype\n   * @type {DataSourceClock}\n   */\n  clock: {\n    get: function () {\n      return this._clock;\n    },\n  },\n  /**\n   * Gets the collection of {@link Entity} instances.\n   * @memberof CzmlDataSource.prototype\n   * @type {EntityCollection}\n   */\n  entities: {\n    get: function () {\n      return this._entityCollection;\n    },\n  },\n  /**\n   * Gets a value indicating if the data source is currently loading data.\n   * @memberof CzmlDataSource.prototype\n   * @type {boolean}\n   */\n  isLoading: {\n    get: function () {\n      return this._isLoading;\n    },\n  },\n  /**\n   * Gets an event that will be raised when the underlying data changes.\n   * @memberof CzmlDataSource.prototype\n   * @type {Event}\n   */\n  changedEvent: {\n    get: function () {\n      return this._changed;\n    },\n  },\n  /**\n   * Gets an event that will be raised if an error is encountered during processing.\n   * @memberof CzmlDataSource.prototype\n   * @type {Event}\n   */\n  errorEvent: {\n    get: function () {\n      return this._error;\n    },\n  },\n  /**\n   * Gets an event that will be raised when the data source either starts or stops loading.\n   * @memberof CzmlDataSource.prototype\n   * @type {Event}\n   */\n  loadingEvent: {\n    get: function () {\n      return this._loading;\n    },\n  },\n  /**\n   * Gets whether or not this data source should be displayed.\n   * @memberof CzmlDataSource.prototype\n   * @type {boolean}\n   */\n  show: {\n    get: function () {\n      return this._entityCollection.show;\n    },\n    set: function (value) {\n      this._entityCollection.show = value;\n    },\n  },\n\n  /**\n   * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.\n   *\n   * @memberof CzmlDataSource.prototype\n   * @type {EntityCluster}\n   */\n  clustering: {\n    get: function () {\n      return this._entityCluster;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value must be defined.\");\n      }\n      //>>includeEnd('debug');\n      this._entityCluster = value;\n    },\n  },\n  /**\n   * Gets the credit that will be displayed for the data source\n   * @memberof CzmlDataSource.prototype\n   * @type {Credit}\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n});\n\n/**\n * @callback CzmlDataSource.UpdaterFunction\n *\n * A CZML processing function that adds or updates entities in the provided\n * collection based on the provided CZML packet.\n *\n * @param {Entity} entity\n * @param {object} packet\n * @param {EntityCollection} entityCollection\n * @param {string} sourceUri\n */\n\n/**\n * Gets the array of CZML processing functions.\n * @memberof CzmlDataSource\n * @type {CzmlDataSource.UpdaterFunction[]}\n */\nCzmlDataSource.updaters = [\n  processBillboard, //\n  processBox, //\n  processCorridor, //\n  processCylinder, //\n  processEllipse, //\n  processEllipsoid, //\n  processLabel, //\n  processModel, //\n  processName, //\n  processDescription, //\n  processPath, //\n  processPoint, //\n  processPolygon, //\n  processPolyline, //\n  processPolylineVolume, //\n  processProperties, //\n  processRectangle, //\n  processPosition, //\n  processTileset, //\n  processViewFrom, //\n  processWall, //\n  processOrientation, //\n  processAvailability,\n];\n\n/**\n * Processes the provided url or CZML object without clearing any existing data.\n *\n * @param {Resource|string|object} czml A url or CZML object to be processed.\n * @param {CzmlDataSource.LoadOptions} [options] An object specifying configuration options\n *\n * @returns {Promise<CzmlDataSource>} A promise that resolves to this instances once the data is processed.\n */\nCzmlDataSource.prototype.process = function (czml, options) {\n  return load(this, czml, options, false);\n};\n\n/**\n * Loads the provided url or CZML object, replacing any existing data.\n *\n * @param {Resource|string|object} czml A url or CZML object to be processed.\n * @param {CzmlDataSource.LoadOptions} [options] An object specifying configuration options\n *\n * @returns {Promise<CzmlDataSource>} A promise that resolves to this instances once the data is processed.\n */\nCzmlDataSource.prototype.load = function (czml, options) {\n  return load(this, czml, options, true);\n};\n\n/**\n * Updates the data source to the provided time.  This function is optional and\n * is not required to be implemented.  It is provided for data sources which\n * retrieve data based on the current animation time or scene state.\n * If implemented, update will be called by {@link DataSourceDisplay} once a frame.\n *\n * @param {JulianDate} time The simulation time.\n * @returns {boolean} True if this data source is ready to be displayed at the provided time, false otherwise.\n */\nCzmlDataSource.prototype.update = function (time) {\n  return true;\n};\n\n/**\n * A helper function used by custom CZML updater functions\n * which creates or updates a {@link Property} from a CZML packet.\n * @function\n *\n * @param {Function} type The constructor function for the property being processed.\n * @param {object} object The object on which the property will be added or updated.\n * @param {string} propertyName The name of the property on the object.\n * @param {object} packetData The CZML packet being processed.\n * @param {TimeInterval} interval A constraining interval for which the data is valid.\n * @param {string} sourceUri The originating uri of the data being processed.\n * @param {EntityCollection} entityCollection The collection being processsed.\n */\nCzmlDataSource.processPacketData = processPacketData;\n\n/**\n * A helper function used by custom CZML updater functions\n * which creates or updates a {@link PositionProperty} from a CZML packet.\n * @function\n *\n * @param {object} object The object on which the property will be added or updated.\n * @param {string} propertyName The name of the property on the object.\n * @param {object} packetData The CZML packet being processed.\n * @param {TimeInterval} interval A constraining interval for which the data is valid.\n * @param {string} sourceUri The originating uri of the data being processed.\n * @param {EntityCollection} entityCollection The collection being processsed.\n */\nCzmlDataSource.processPositionPacketData = processPositionPacketData;\n\n/**\n * A helper function used by custom CZML updater functions\n * which creates or updates a {@link MaterialProperty} from a CZML packet.\n * @function\n *\n * @param {object} object The object on which the property will be added or updated.\n * @param {string} propertyName The name of the property on the object.\n * @param {object} packetData The CZML packet being processed.\n * @param {TimeInterval} interval A constraining interval for which the data is valid.\n * @param {string} sourceUri The originating uri of the data being processed.\n * @param {EntityCollection} entityCollection The collection being processsed.\n */\nCzmlDataSource.processMaterialPacketData = processMaterialPacketData;\n\nCzmlDataSource._processCzml = function (\n  czml,\n  entityCollection,\n  sourceUri,\n  updaterFunctions,\n  dataSource\n) {\n  updaterFunctions = defaultValue(updaterFunctions, CzmlDataSource.updaters);\n\n  if (Array.isArray(czml)) {\n    for (let i = 0, len = czml.length; i < len; ++i) {\n      processCzmlPacket(\n        czml[i],\n        entityCollection,\n        updaterFunctions,\n        sourceUri,\n        dataSource\n      );\n    }\n  } else {\n    processCzmlPacket(\n      czml,\n      entityCollection,\n      updaterFunctions,\n      sourceUri,\n      dataSource\n    );\n  }\n};\nexport default CzmlDataSource;\n", "/**\n * Gets a timestamp that can be used in measuring the time between events.  Timestamps\n * are expressed in milliseconds, but it is not specified what the milliseconds are\n * measured from.  This function uses performance.now() if it is available, or Date.now()\n * otherwise.\n *\n * @function getTimestamp\n *\n * @returns {number} The timestamp in milliseconds since some unspecified reference time.\n */\nlet getTimestamp;\n\nif (\n  typeof performance !== \"undefined\" &&\n  typeof performance.now === \"function\" &&\n  isFinite(performance.now())\n) {\n  getTimestamp = function () {\n    return performance.now();\n  };\n} else {\n  getTimestamp = function () {\n    return Date.now();\n  };\n}\nexport default getTimestamp;\n", "import ClockRange from \"./ClockRange.js\";\nimport ClockStep from \"./ClockStep.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Event from \"./Event.js\";\nimport getTimestamp from \"./getTimestamp.js\";\nimport JulianDate from \"./JulianDate.js\";\n\n/**\n * A simple clock for keeping track of simulated time.\n *\n * @alias Clock\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {JulianDate} [options.startTime] The start time of the clock.\n * @param {JulianDate} [options.stopTime] The stop time of the clock.\n * @param {JulianDate} [options.currentTime] The current time.\n * @param {number} [options.multiplier=1.0] Determines how much time advances when {@link Clock#tick} is called, negative values allow for advancing backwards.\n * @param {ClockStep} [options.clockStep=ClockStep.SYSTEM_CLOCK_MULTIPLIER] Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.\n * @param {ClockRange} [options.clockRange=ClockRange.UNBOUNDED] Determines how the clock should behave when {@link Clock#startTime} or {@link Clock#stopTime} is reached.\n * @param {boolean} [options.canAnimate=true] Indicates whether {@link Clock#tick} can advance time.  This could be false if data is being buffered, for example.  The clock will only tick when both {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.\n * @param {boolean} [options.shouldAnimate=false] Indicates whether {@link Clock#tick} should attempt to advance time.  The clock will only tick when both {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.\n *\n * @exception {DeveloperError} startTime must come before stopTime.\n *\n *\n * @example\n * // Create a clock that loops on Christmas day 2013 and runs in real-time.\n * const clock = new Cesium.Clock({\n *    startTime : Cesium.JulianDate.fromIso8601(\"2013-12-25\"),\n *    currentTime : Cesium.JulianDate.fromIso8601(\"2013-12-25\"),\n *    stopTime : Cesium.JulianDate.fromIso8601(\"2013-12-26\"),\n *    clockRange : Cesium.ClockRange.LOOP_STOP,\n *    clockStep : Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER\n * });\n *\n * @see ClockStep\n * @see ClockRange\n * @see JulianDate\n */\nfunction Clock(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  let currentTime = options.currentTime;\n  let startTime = options.startTime;\n  let stopTime = options.stopTime;\n\n  if (!defined(currentTime)) {\n    // if not specified, current time is the start time,\n    // or if that is not specified, 1 day before the stop time,\n    // or if that is not specified, then now.\n    if (defined(startTime)) {\n      currentTime = JulianDate.clone(startTime);\n    } else if (defined(stopTime)) {\n      currentTime = JulianDate.addDays(stopTime, -1.0, new JulianDate());\n    } else {\n      currentTime = JulianDate.now();\n    }\n  } else {\n    currentTime = JulianDate.clone(currentTime);\n  }\n\n  if (!defined(startTime)) {\n    // if not specified, start time is the current time\n    // (as determined above)\n    startTime = JulianDate.clone(currentTime);\n  } else {\n    startTime = JulianDate.clone(startTime);\n  }\n\n  if (!defined(stopTime)) {\n    // if not specified, stop time is 1 day after the start time\n    // (as determined above)\n    stopTime = JulianDate.addDays(startTime, 1.0, new JulianDate());\n  } else {\n    stopTime = JulianDate.clone(stopTime);\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (JulianDate.greaterThan(startTime, stopTime)) {\n    throw new DeveloperError(\"startTime must come before stopTime.\");\n  }\n  //>>includeEnd('debug');\n\n  /**\n   * The start time of the clock.\n   * @type {JulianDate}\n   */\n  this.startTime = startTime;\n\n  /**\n   * The stop time of the clock.\n   * @type {JulianDate}\n   */\n  this.stopTime = stopTime;\n\n  /**\n   * Determines how the clock should behave when\n   * {@link Clock#startTime} or {@link Clock#stopTime}\n   * is reached.\n   * @type {ClockRange}\n   * @default {@link ClockRange.UNBOUNDED}\n   */\n  this.clockRange = defaultValue(options.clockRange, ClockRange.UNBOUNDED);\n\n  /**\n   * Indicates whether {@link Clock#tick} can advance time.  This could be false if data is being buffered,\n   * for example.  The clock will only advance time when both\n   * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.\n   * @type {boolean}\n   * @default true\n   */\n  this.canAnimate = defaultValue(options.canAnimate, true);\n\n  /**\n   * An {@link Event} that is fired whenever {@link Clock#tick} is called.\n   * @type {Event}\n   */\n  this.onTick = new Event();\n  /**\n   * An {@link Event} that is fired whenever {@link Clock#stopTime} is reached.\n   * @type {Event}\n   */\n  this.onStop = new Event();\n\n  this._currentTime = undefined;\n  this._multiplier = undefined;\n  this._clockStep = undefined;\n  this._shouldAnimate = undefined;\n  this._lastSystemTime = getTimestamp();\n\n  // set values using the property setters to\n  // make values consistent.\n\n  this.currentTime = currentTime;\n  this.multiplier = defaultValue(options.multiplier, 1.0);\n  this.shouldAnimate = defaultValue(options.shouldAnimate, false);\n  this.clockStep = defaultValue(\n    options.clockStep,\n    ClockStep.SYSTEM_CLOCK_MULTIPLIER\n  );\n}\n\nObject.defineProperties(Clock.prototype, {\n  /**\n   * The current time.\n   * Changing this property will change\n   * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to\n   * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.\n   * @memberof Clock.prototype\n   * @type {JulianDate}\n   */\n  currentTime: {\n    get: function () {\n      return this._currentTime;\n    },\n    set: function (value) {\n      if (JulianDate.equals(this._currentTime, value)) {\n        return;\n      }\n\n      if (this._clockStep === ClockStep.SYSTEM_CLOCK) {\n        this._clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n      }\n\n      this._currentTime = value;\n    },\n  },\n\n  /**\n   * Gets or sets how much time advances when {@link Clock#tick} is called. Negative values allow for advancing backwards.\n   * If {@link Clock#clockStep} is set to {@link ClockStep.TICK_DEPENDENT}, this is the number of seconds to advance.\n   * If {@link Clock#clockStep} is set to {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}, this value is multiplied by the\n   * elapsed system time since the last call to {@link Clock#tick}.\n   * Changing this property will change\n   * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to\n   * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.\n   * @memberof Clock.prototype\n   * @type {number}\n   * @default 1.0\n   */\n  multiplier: {\n    get: function () {\n      return this._multiplier;\n    },\n    set: function (value) {\n      if (this._multiplier === value) {\n        return;\n      }\n\n      if (this._clockStep === ClockStep.SYSTEM_CLOCK) {\n        this._clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n      }\n\n      this._multiplier = value;\n    },\n  },\n\n  /**\n   * Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.\n   * Changing this property to {@link ClockStep.SYSTEM_CLOCK} will set\n   * {@link Clock#multiplier} to 1.0, {@link Clock#shouldAnimate} to true, and\n   * {@link Clock#currentTime} to the current system clock time.\n   * @memberof Clock.prototype\n   * @type ClockStep\n   * @default {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}\n   */\n  clockStep: {\n    get: function () {\n      return this._clockStep;\n    },\n    set: function (value) {\n      if (value === ClockStep.SYSTEM_CLOCK) {\n        this._multiplier = 1.0;\n        this._shouldAnimate = true;\n        this._currentTime = JulianDate.now();\n      }\n\n      this._clockStep = value;\n    },\n  },\n\n  /**\n   * Indicates whether {@link Clock#tick} should attempt to advance time.\n   * The clock will only advance time when both\n   * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.\n   * Changing this property will change\n   * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to\n   * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.\n   * @memberof Clock.prototype\n   * @type {boolean}\n   * @default false\n   */\n  shouldAnimate: {\n    get: function () {\n      return this._shouldAnimate;\n    },\n    set: function (value) {\n      if (this._shouldAnimate === value) {\n        return;\n      }\n\n      if (this._clockStep === ClockStep.SYSTEM_CLOCK) {\n        this._clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n      }\n\n      this._shouldAnimate = value;\n    },\n  },\n});\n\n/**\n * Advances the clock from the current time based on the current configuration options.\n * tick should be called every frame, regardless of whether animation is taking place\n * or not.  To control animation, use the {@link Clock#shouldAnimate} property.\n *\n * @returns {JulianDate} The new value of the {@link Clock#currentTime} property.\n */\nClock.prototype.tick = function () {\n  const currentSystemTime = getTimestamp();\n  let currentTime = JulianDate.clone(this._currentTime);\n\n  if (this.canAnimate && this._shouldAnimate) {\n    const clockStep = this._clockStep;\n    if (clockStep === ClockStep.SYSTEM_CLOCK) {\n      currentTime = JulianDate.now(currentTime);\n    } else {\n      const multiplier = this._multiplier;\n\n      if (clockStep === ClockStep.TICK_DEPENDENT) {\n        currentTime = JulianDate.addSeconds(\n          currentTime,\n          multiplier,\n          currentTime\n        );\n      } else {\n        const milliseconds = currentSystemTime - this._lastSystemTime;\n        currentTime = JulianDate.addSeconds(\n          currentTime,\n          multiplier * (milliseconds / 1000.0),\n          currentTime\n        );\n      }\n\n      const clockRange = this.clockRange;\n      const startTime = this.startTime;\n      const stopTime = this.stopTime;\n\n      if (clockRange === ClockRange.CLAMPED) {\n        if (JulianDate.lessThan(currentTime, startTime)) {\n          currentTime = JulianDate.clone(startTime, currentTime);\n        } else if (JulianDate.greaterThan(currentTime, stopTime)) {\n          currentTime = JulianDate.clone(stopTime, currentTime);\n          this.onStop.raiseEvent(this);\n        }\n      } else if (clockRange === ClockRange.LOOP_STOP) {\n        if (JulianDate.lessThan(currentTime, startTime)) {\n          currentTime = JulianDate.clone(startTime, currentTime);\n        }\n        while (JulianDate.greaterThan(currentTime, stopTime)) {\n          currentTime = JulianDate.addSeconds(\n            startTime,\n            JulianDate.secondsDifference(currentTime, stopTime),\n            currentTime\n          );\n          this.onStop.raiseEvent(this);\n        }\n      }\n    }\n  }\n\n  this._currentTime = currentTime;\n  this._lastSystemTime = currentSystemTime;\n  this.onTick.raiseEvent(this);\n  return currentTime;\n};\nexport default Clock;\n", "import Clock from \"../Core/Clock.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport createRawPropertyDescriptor from \"./createRawPropertyDescriptor.js\";\n\n/**\n * Represents desired clock settings for a particular {@link DataSource}.  These settings may be applied\n * to the {@link Clock} when the DataSource is loaded.\n *\n * @alias DataSourceClock\n * @constructor\n */\nfunction DataSourceClock() {\n  this._definitionChanged = new Event();\n  this._startTime = undefined;\n  this._stopTime = undefined;\n  this._currentTime = undefined;\n  this._clockRange = undefined;\n  this._clockStep = undefined;\n  this._multiplier = undefined;\n}\n\nObject.defineProperties(DataSourceClock.prototype, {\n  /**\n   * Gets the event that is raised whenever a new property is assigned.\n   * @memberof DataSourceClock.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the desired start time of the clock.\n   * See {@link Clock#startTime}.\n   * @memberof DataSourceClock.prototype\n   * @type {JulianDate}\n   */\n  startTime: createRawPropertyDescriptor(\"startTime\"),\n\n  /**\n   * Gets or sets the desired stop time of the clock.\n   * See {@link Clock#stopTime}.\n   * @memberof DataSourceClock.prototype\n   * @type {JulianDate}\n   */\n  stopTime: createRawPropertyDescriptor(\"stopTime\"),\n\n  /**\n   * Gets or sets the desired current time when this data source is loaded.\n   * See {@link Clock#currentTime}.\n   * @memberof DataSourceClock.prototype\n   * @type {JulianDate}\n   */\n  currentTime: createRawPropertyDescriptor(\"currentTime\"),\n\n  /**\n   * Gets or sets the desired clock range setting.\n   * See {@link Clock#clockRange}.\n   * @memberof DataSourceClock.prototype\n   * @type {ClockRange}\n   */\n  clockRange: createRawPropertyDescriptor(\"clockRange\"),\n\n  /**\n   * Gets or sets the desired clock step setting.\n   * See {@link Clock#clockStep}.\n   * @memberof DataSourceClock.prototype\n   * @type {ClockStep}\n   */\n  clockStep: createRawPropertyDescriptor(\"clockStep\"),\n\n  /**\n   * Gets or sets the desired clock multiplier.\n   * See {@link Clock#multiplier}.\n   * @memberof DataSourceClock.prototype\n   * @type {number}\n   */\n  multiplier: createRawPropertyDescriptor(\"multiplier\"),\n});\n\n/**\n * Duplicates a DataSourceClock instance.\n *\n * @param {DataSourceClock} [result] The object onto which to store the result.\n * @returns {DataSourceClock} The modified result parameter or a new instance if one was not provided.\n */\nDataSourceClock.prototype.clone = function (result) {\n  if (!defined(result)) {\n    result = new DataSourceClock();\n  }\n  result.startTime = this.startTime;\n  result.stopTime = this.stopTime;\n  result.currentTime = this.currentTime;\n  result.clockRange = this.clockRange;\n  result.clockStep = this.clockStep;\n  result.multiplier = this.multiplier;\n  return result;\n};\n\n/**\n * Returns true if this DataSourceClock is equivalent to the other\n *\n * @param {DataSourceClock} other The other DataSourceClock to compare to.\n * @returns {boolean} <code>true</code> if the DataSourceClocks are equal; otherwise, <code>false</code>.\n */\nDataSourceClock.prototype.equals = function (other) {\n  return (\n    this === other ||\n    (defined(other) &&\n      JulianDate.equals(this.startTime, other.startTime) &&\n      JulianDate.equals(this.stopTime, other.stopTime) &&\n      JulianDate.equals(this.currentTime, other.currentTime) &&\n      this.clockRange === other.clockRange &&\n      this.clockStep === other.clockStep &&\n      this.multiplier === other.multiplier)\n  );\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {DataSourceClock} source The object to be merged into this object.\n */\nDataSourceClock.prototype.merge = function (source) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(source)) {\n    throw new DeveloperError(\"source is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.startTime = defaultValue(this.startTime, source.startTime);\n  this.stopTime = defaultValue(this.stopTime, source.stopTime);\n  this.currentTime = defaultValue(this.currentTime, source.currentTime);\n  this.clockRange = defaultValue(this.clockRange, source.clockRange);\n  this.clockStep = defaultValue(this.clockStep, source.clockStep);\n  this.multiplier = defaultValue(this.multiplier, source.multiplier);\n};\n\n/**\n * Gets the value of this clock instance as a {@link Clock} object.\n *\n * @returns {Clock} The modified result parameter or a new instance if one was not provided.\n */\nDataSourceClock.prototype.getValue = function (result) {\n  if (!defined(result)) {\n    result = new Clock();\n  }\n  result.startTime = defaultValue(this.startTime, result.startTime);\n  result.stopTime = defaultValue(this.stopTime, result.stopTime);\n  result.currentTime = defaultValue(this.currentTime, result.currentTime);\n  result.clockRange = defaultValue(this.clockRange, result.clockRange);\n  result.multiplier = defaultValue(this.multiplier, result.multiplier);\n  result.clockStep = defaultValue(this.clockStep, result.clockStep);\n  return result;\n};\nexport default DataSourceClock;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\nconst defaultColor = Color.WHITE;\nconst defaultCellAlpha = 0.1;\nconst defaultLineCount = new Cartesian2(8, 8);\nconst defaultLineOffset = new Cartesian2(0, 0);\nconst defaultLineThickness = new Cartesian2(1, 1);\n\n/**\n * A {@link MaterialProperty} that maps to grid {@link Material} uniforms.\n * @alias GridMaterialProperty\n *\n * @param {object} [options] Object with the following properties:\n * @param {Property|Color} [options.color=Color.WHITE] A Property specifying the grid {@link Color}.\n * @param {Property|number} [options.cellAlpha=0.1] A numeric Property specifying cell alpha values.\n * @param {Property|Cartesian2} [options.lineCount=new Cartesian2(8, 8)] A {@link Cartesian2} Property specifying the number of grid lines along each axis.\n * @param {Property|Cartesian2} [options.lineThickness=new Cartesian2(1.0, 1.0)] A {@link Cartesian2} Property specifying the thickness of grid lines along each axis.\n * @param {Property|Cartesian2} [options.lineOffset=new Cartesian2(0.0, 0.0)] A {@link Cartesian2} Property specifying starting offset of grid lines along each axis.\n *\n * @constructor\n */\nfunction GridMaterialProperty(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._definitionChanged = new Event();\n  this._color = undefined;\n  this._colorSubscription = undefined;\n  this._cellAlpha = undefined;\n  this._cellAlphaSubscription = undefined;\n  this._lineCount = undefined;\n  this._lineCountSubscription = undefined;\n  this._lineThickness = undefined;\n  this._lineThicknessSubscription = undefined;\n  this._lineOffset = undefined;\n  this._lineOffsetSubscription = undefined;\n\n  this.color = options.color;\n  this.cellAlpha = options.cellAlpha;\n  this.lineCount = options.lineCount;\n  this.lineThickness = options.lineThickness;\n  this.lineOffset = options.lineOffset;\n}\n\nObject.defineProperties(GridMaterialProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof GridMaterialProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return (\n        Property.isConstant(this._color) &&\n        Property.isConstant(this._cellAlpha) &&\n        Property.isConstant(this._lineCount) &&\n        Property.isConstant(this._lineThickness) &&\n        Property.isConstant(this._lineOffset)\n      );\n    },\n  },\n\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof GridMaterialProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the Property specifying the grid {@link Color}.\n   * @memberof GridMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default Color.WHITE\n   */\n  color: createPropertyDescriptor(\"color\"),\n\n  /**\n   * Gets or sets the numeric Property specifying cell alpha values.\n   * @memberof GridMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default 0.1\n   */\n  cellAlpha: createPropertyDescriptor(\"cellAlpha\"),\n\n  /**\n   * Gets or sets the {@link Cartesian2} Property specifying the number of grid lines along each axis.\n   * @memberof GridMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default new Cartesian2(8.0, 8.0)\n   */\n  lineCount: createPropertyDescriptor(\"lineCount\"),\n\n  /**\n   * Gets or sets the {@link Cartesian2} Property specifying the thickness of grid lines along each axis.\n   * @memberof GridMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default new Cartesian2(1.0, 1.0)\n   */\n  lineThickness: createPropertyDescriptor(\"lineThickness\"),\n\n  /**\n   * Gets or sets the {@link Cartesian2} Property specifying the starting offset of grid lines along each axis.\n   * @memberof GridMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default new Cartesian2(0.0, 0.0)\n   */\n  lineOffset: createPropertyDescriptor(\"lineOffset\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {string} The type of material.\n */\nGridMaterialProperty.prototype.getType = function (time) {\n  return \"Grid\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nGridMaterialProperty.prototype.getValue = function (time, result) {\n  if (!defined(result)) {\n    result = {};\n  }\n  result.color = Property.getValueOrClonedDefault(\n    this._color,\n    time,\n    defaultColor,\n    result.color\n  );\n  result.cellAlpha = Property.getValueOrDefault(\n    this._cellAlpha,\n    time,\n    defaultCellAlpha\n  );\n  result.lineCount = Property.getValueOrClonedDefault(\n    this._lineCount,\n    time,\n    defaultLineCount,\n    result.lineCount\n  );\n  result.lineThickness = Property.getValueOrClonedDefault(\n    this._lineThickness,\n    time,\n    defaultLineThickness,\n    result.lineThickness\n  );\n  result.lineOffset = Property.getValueOrClonedDefault(\n    this._lineOffset,\n    time,\n    defaultLineOffset,\n    result.lineOffset\n  );\n  return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nGridMaterialProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof GridMaterialProperty && //\n      Property.equals(this._color, other._color) && //\n      Property.equals(this._cellAlpha, other._cellAlpha) && //\n      Property.equals(this._lineCount, other._lineCount) && //\n      Property.equals(this._lineThickness, other._lineThickness) && //\n      Property.equals(this._lineOffset, other._lineOffset))\n  );\n};\nexport default GridMaterialProperty;\n", "import Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link MaterialProperty} that maps to PolylineArrow {@link Material} uniforms.\n *\n * @param {Property|Color} [color=Color.WHITE] The {@link Color} Property to be used.\n *\n * @alias PolylineArrowMaterialProperty\n * @constructor\n */\nfunction PolylineArrowMaterialProperty(color) {\n  this._definitionChanged = new Event();\n  this._color = undefined;\n  this._colorSubscription = undefined;\n\n  this.color = color;\n}\n\nObject.defineProperties(PolylineArrowMaterialProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof PolylineArrowMaterialProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return Property.isConstant(this._color);\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof PolylineArrowMaterialProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets or sets the {@link Color} {@link Property}.\n   * @memberof PolylineArrowMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default Color.WHITE\n   */\n  color: createPropertyDescriptor(\"color\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {string} The type of material.\n */\nPolylineArrowMaterialProperty.prototype.getType = function (time) {\n  return \"PolylineArrow\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPolylineArrowMaterialProperty.prototype.getValue = function (time, result) {\n  if (!defined(result)) {\n    result = {};\n  }\n  result.color = Property.getValueOrClonedDefault(\n    this._color,\n    time,\n    Color.WHITE,\n    result.color\n  );\n  return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPolylineArrowMaterialProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof PolylineArrowMaterialProperty && //\n      Property.equals(this._color, other._color))\n  );\n};\nexport default PolylineArrowMaterialProperty;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\nconst defaultColor = Color.WHITE;\nconst defaultGapColor = Color.TRANSPARENT;\nconst defaultDashLength = 16.0;\nconst defaultDashPattern = 255.0;\n\n/**\n * A {@link MaterialProperty} that maps to polyline dash {@link Material} uniforms.\n * @alias PolylineDashMaterialProperty\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Property|Color} [options.color=Color.WHITE] A Property specifying the {@link Color} of the line.\n * @param {Property|Color} [options.gapColor=Color.TRANSPARENT] A Property specifying the {@link Color} of the gaps in the line.\n * @param {Property|number} [options.dashLength=16.0] A numeric Property specifying the length of the dash pattern in pixels.\n * @param {Property|number} [options.dashPattern=255.0] A numeric Property specifying a 16 bit pattern for the dash\n */\nfunction PolylineDashMaterialProperty(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._definitionChanged = new Event();\n  this._color = undefined;\n  this._colorSubscription = undefined;\n  this._gapColor = undefined;\n  this._gapColorSubscription = undefined;\n  this._dashLength = undefined;\n  this._dashLengthSubscription = undefined;\n  this._dashPattern = undefined;\n  this._dashPatternSubscription = undefined;\n\n  this.color = options.color;\n  this.gapColor = options.gapColor;\n  this.dashLength = options.dashLength;\n  this.dashPattern = options.dashPattern;\n}\n\nObject.defineProperties(PolylineDashMaterialProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof PolylineDashMaterialProperty.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return (\n        Property.isConstant(this._color) &&\n        Property.isConstant(this._gapColor) &&\n        Property.isConstant(this._dashLength) &&\n        Property.isConstant(this._dashPattern)\n      );\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof PolylineDashMaterialProperty.prototype\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the line.\n   * @memberof PolylineDashMaterialProperty.prototype\n   * @type {Property|undefined}\n   */\n  color: createPropertyDescriptor(\"color\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the gaps in the line.\n   * @memberof PolylineDashMaterialProperty.prototype\n   * @type {Property|undefined}\n   */\n  gapColor: createPropertyDescriptor(\"gapColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the length of a dash cycle\n   * @memberof PolylineDashMaterialProperty.prototype\n   * @type {Property|undefined}\n   */\n  dashLength: createPropertyDescriptor(\"dashLength\"),\n\n  /**\n   * Gets or sets the numeric Property specifying a dash pattern\n   * @memberof PolylineDashMaterialProperty.prototype\n   * @type {Property|undefined}\n   */\n  dashPattern: createPropertyDescriptor(\"dashPattern\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {string} The type of material.\n */\nPolylineDashMaterialProperty.prototype.getType = function (time) {\n  return \"PolylineDash\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPolylineDashMaterialProperty.prototype.getValue = function (time, result) {\n  if (!defined(result)) {\n    result = {};\n  }\n  result.color = Property.getValueOrClonedDefault(\n    this._color,\n    time,\n    defaultColor,\n    result.color\n  );\n  result.gapColor = Property.getValueOrClonedDefault(\n    this._gapColor,\n    time,\n    defaultGapColor,\n    result.gapColor\n  );\n  result.dashLength = Property.getValueOrDefault(\n    this._dashLength,\n    time,\n    defaultDashLength,\n    result.dashLength\n  );\n  result.dashPattern = Property.getValueOrDefault(\n    this._dashPattern,\n    time,\n    defaultDashPattern,\n    result.dashPattern\n  );\n  return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPolylineDashMaterialProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof PolylineDashMaterialProperty &&\n      Property.equals(this._color, other._color) &&\n      Property.equals(this._gapColor, other._gapColor) &&\n      Property.equals(this._dashLength, other._dashLength) &&\n      Property.equals(this._dashPattern, other._dashPattern))\n  );\n};\nexport default PolylineDashMaterialProperty;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\nconst defaultColor = Color.WHITE;\nconst defaultGlowPower = 0.25;\nconst defaultTaperPower = 1.0;\n\n/**\n * A {@link MaterialProperty} that maps to polyline glow {@link Material} uniforms.\n * @alias PolylineGlowMaterialProperty\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Property|Color} [options.color=Color.WHITE] A Property specifying the {@link Color} of the line.\n * @param {Property|number} [options.glowPower=0.25] A numeric Property specifying the strength of the glow, as a percentage of the total line width.\n * @param {Property|number} [options.taperPower=1.0] A numeric Property specifying the strength of the tapering effect, as a percentage of the total line length.  If 1.0 or higher, no taper effect is used.\n */\nfunction PolylineGlowMaterialProperty(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._definitionChanged = new Event();\n  this._color = undefined;\n  this._colorSubscription = undefined;\n  this._glowPower = undefined;\n  this._glowPowerSubscription = undefined;\n  this._taperPower = undefined;\n  this._taperPowerSubscription = undefined;\n\n  this.color = options.color;\n  this.glowPower = options.glowPower;\n  this.taperPower = options.taperPower;\n}\n\nObject.defineProperties(PolylineGlowMaterialProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof PolylineGlowMaterialProperty.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return (\n        Property.isConstant(this._color) && Property.isConstant(this._glow)\n      );\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof PolylineGlowMaterialProperty.prototype\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the line.\n   * @memberof PolylineGlowMaterialProperty.prototype\n   * @type {Property|undefined}\n   */\n  color: createPropertyDescriptor(\"color\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the strength of the glow, as a percentage of the total line width (less than 1.0).\n   * @memberof PolylineGlowMaterialProperty.prototype\n   * @type {Property|undefined}\n   */\n  glowPower: createPropertyDescriptor(\"glowPower\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the strength of the tapering effect, as a percentage of the total line length.  If 1.0 or higher, no taper effect is used.\n   * @memberof PolylineGlowMaterialProperty.prototype\n   * @type {Property|undefined}\n   */\n  taperPower: createPropertyDescriptor(\"taperPower\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {string} The type of material.\n */\nPolylineGlowMaterialProperty.prototype.getType = function (time) {\n  return \"PolylineGlow\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPolylineGlowMaterialProperty.prototype.getValue = function (time, result) {\n  if (!defined(result)) {\n    result = {};\n  }\n  result.color = Property.getValueOrClonedDefault(\n    this._color,\n    time,\n    defaultColor,\n    result.color\n  );\n  result.glowPower = Property.getValueOrDefault(\n    this._glowPower,\n    time,\n    defaultGlowPower,\n    result.glowPower\n  );\n  result.taperPower = Property.getValueOrDefault(\n    this._taperPower,\n    time,\n    defaultTaperPower,\n    result.taperPower\n  );\n  return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPolylineGlowMaterialProperty.prototype.equals = function (other) {\n  return (\n    this === other ||\n    (other instanceof PolylineGlowMaterialProperty &&\n      Property.equals(this._color, other._color) &&\n      Property.equals(this._glowPower, other._glowPower) &&\n      Property.equals(this._taperPower, other._taperPower))\n  );\n};\nexport default PolylineGlowMaterialProperty;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\nconst defaultColor = Color.WHITE;\nconst defaultOutlineColor = Color.BLACK;\nconst defaultOutlineWidth = 1.0;\n\n/**\n * A {@link MaterialProperty} that maps to polyline outline {@link Material} uniforms.\n * @alias PolylineOutlineMaterialProperty\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Property|Color} [options.color=Color.WHITE] A Property specifying the {@link Color} of the line.\n * @param {Property|Color} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @param {Property|number} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline, in pixels.\n */\nfunction PolylineOutlineMaterialProperty(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._definitionChanged = new Event();\n  this._color = undefined;\n  this._colorSubscription = undefined;\n  this._outlineColor = undefined;\n  this._outlineColorSubscription = undefined;\n  this._outlineWidth = undefined;\n  this._outlineWidthSubscription = undefined;\n\n  this.color = options.color;\n  this.outlineColor = options.outlineColor;\n  this.outlineWidth = options.outlineWidth;\n}\n\nObject.defineProperties(PolylineOutlineMaterialProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof PolylineOutlineMaterialProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return (\n        Property.isConstant(this._color) &&\n        Property.isConstant(this._outlineColor) &&\n        Property.isConstant(this._outlineWidth)\n      );\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof PolylineOutlineMaterialProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the line.\n   * @memberof PolylineOutlineMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default Color.WHITE\n   */\n  color: createPropertyDescriptor(\"color\"),\n\n  /**\n   * Gets or sets the Property specifying the {@link Color} of the outline.\n   * @memberof PolylineOutlineMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default Color.BLACK\n   */\n  outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the width of the outline.\n   * @memberof PolylineOutlineMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {string} The type of material.\n */\nPolylineOutlineMaterialProperty.prototype.getType = function (time) {\n  return \"PolylineOutline\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPolylineOutlineMaterialProperty.prototype.getValue = function (time, result) {\n  if (!defined(result)) {\n    result = {};\n  }\n  result.color = Property.getValueOrClonedDefault(\n    this._color,\n    time,\n    defaultColor,\n    result.color\n  );\n  result.outlineColor = Property.getValueOrClonedDefault(\n    this._outlineColor,\n    time,\n    defaultOutlineColor,\n    result.outlineColor\n  );\n  result.outlineWidth = Property.getValueOrDefault(\n    this._outlineWidth,\n    time,\n    defaultOutlineWidth\n  );\n  return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPolylineOutlineMaterialProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof PolylineOutlineMaterialProperty && //\n      Property.equals(this._color, other._color) && //\n      Property.equals(this._outlineColor, other._outlineColor) && //\n      Property.equals(this._outlineWidth, other._outlineWidth))\n  );\n};\nexport default PolylineOutlineMaterialProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport EventHelper from \"../Core/EventHelper.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link Property} whose value is an array whose items are the computed value\n * of other PositionProperty instances.\n *\n * @alias PositionPropertyArray\n * @constructor\n *\n * @param {Property[]} [value] An array of Property instances.\n * @param {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined.\n */\nfunction PositionPropertyArray(value, referenceFrame) {\n  this._value = undefined;\n  this._definitionChanged = new Event();\n  this._eventHelper = new EventHelper();\n  this._referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED);\n  this.setValue(value);\n}\n\nObject.defineProperties(PositionPropertyArray.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  This property\n   * is considered constant if all property items in the array are constant.\n   * @memberof PositionPropertyArray.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      const value = this._value;\n      if (!defined(value)) {\n        return true;\n      }\n\n      const length = value.length;\n      for (let i = 0; i < length; i++) {\n        if (!Property.isConstant(value[i])) {\n          return false;\n        }\n      }\n      return true;\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is changed whenever setValue is called with data different\n   * than the current value or one of the properties in the array also changes.\n   * @memberof PositionPropertyArray.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets the reference frame in which the position is defined.\n   * @memberof PositionPropertyArray.prototype\n   * @type {ReferenceFrame}\n   * @default ReferenceFrame.FIXED;\n   */\n  referenceFrame: {\n    get: function () {\n      return this._referenceFrame;\n    },\n  },\n});\n\n/**\n * Gets the value of the property.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Cartesian3[]} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3[]} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPositionPropertyArray.prototype.getValue = function (time, result) {\n  return this.getValueInReferenceFrame(time, ReferenceFrame.FIXED, result);\n};\n\n/**\n * Gets the value of the property at the provided time and in the provided reference frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result.\n * @param {Cartesian3[]} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3[]} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPositionPropertyArray.prototype.getValueInReferenceFrame = function (\n  time,\n  referenceFrame,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required.\");\n  }\n  if (!defined(referenceFrame)) {\n    throw new DeveloperError(\"referenceFrame is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const value = this._value;\n  if (!defined(value)) {\n    return undefined;\n  }\n\n  const length = value.length;\n  if (!defined(result)) {\n    result = new Array(length);\n  }\n  let i = 0;\n  let x = 0;\n  while (i < length) {\n    const property = value[i];\n    const itemValue = property.getValueInReferenceFrame(\n      time,\n      referenceFrame,\n      result[i]\n    );\n    if (defined(itemValue)) {\n      result[x] = itemValue;\n      x++;\n    }\n    i++;\n  }\n  result.length = x;\n  return result;\n};\n\n/**\n * Sets the value of the property.\n *\n * @param {Property[]} value An array of Property instances.\n */\nPositionPropertyArray.prototype.setValue = function (value) {\n  const eventHelper = this._eventHelper;\n  eventHelper.removeAll();\n\n  if (defined(value)) {\n    this._value = value.slice();\n    const length = value.length;\n    for (let i = 0; i < length; i++) {\n      const property = value[i];\n      if (defined(property)) {\n        eventHelper.add(\n          property.definitionChanged,\n          PositionPropertyArray.prototype._raiseDefinitionChanged,\n          this\n        );\n      }\n    }\n  } else {\n    this._value = undefined;\n  }\n  this._definitionChanged.raiseEvent(this);\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPositionPropertyArray.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof PositionPropertyArray && //\n      this._referenceFrame === other._referenceFrame && //\n      Property.arrayEquals(this._value, other._value))\n  );\n};\n\nPositionPropertyArray.prototype._raiseDefinitionChanged = function () {\n  this._definitionChanged.raiseEvent(this);\n};\nexport default PositionPropertyArray;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport EventHelper from \"../Core/EventHelper.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link Property} whose value is an array whose items are the computed value\n * of other property instances.\n *\n * @alias PropertyArray\n * @constructor\n *\n * @param {Property[]} [value] An array of Property instances.\n */\nfunction PropertyArray(value) {\n  this._value = undefined;\n  this._definitionChanged = new Event();\n  this._eventHelper = new EventHelper();\n  this.setValue(value);\n}\n\nObject.defineProperties(PropertyArray.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  This property\n   * is considered constant if all property items in the array are constant.\n   * @memberof PropertyArray.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      const value = this._value;\n      if (!defined(value)) {\n        return true;\n      }\n      const length = value.length;\n      for (let i = 0; i < length; i++) {\n        if (!Property.isConstant(value[i])) {\n          return false;\n        }\n      }\n      return true;\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is changed whenever setValue is called with data different\n   * than the current value or one of the properties in the array also changes.\n   * @memberof PropertyArray.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n});\n\n/**\n * Gets the value of the property.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object[]} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object[]} The modified result parameter, which is an array of values produced by evaluating each of the contained properties at the given time or a new instance if the result parameter was not supplied.\n */\nPropertyArray.prototype.getValue = function (time, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const value = this._value;\n  if (!defined(value)) {\n    return undefined;\n  }\n\n  const length = value.length;\n  if (!defined(result)) {\n    result = new Array(length);\n  }\n  let i = 0;\n  let x = 0;\n  while (i < length) {\n    const property = this._value[i];\n    const itemValue = property.getValue(time, result[i]);\n    if (defined(itemValue)) {\n      result[x] = itemValue;\n      x++;\n    }\n    i++;\n  }\n  result.length = x;\n  return result;\n};\n\n/**\n * Sets the value of the property.\n *\n * @param {Property[]} value An array of Property instances.\n */\nPropertyArray.prototype.setValue = function (value) {\n  const eventHelper = this._eventHelper;\n  eventHelper.removeAll();\n\n  if (defined(value)) {\n    this._value = value.slice();\n    const length = value.length;\n    for (let i = 0; i < length; i++) {\n      const property = value[i];\n      if (defined(property)) {\n        eventHelper.add(\n          property.definitionChanged,\n          PropertyArray.prototype._raiseDefinitionChanged,\n          this\n        );\n      }\n    }\n  } else {\n    this._value = undefined;\n  }\n  this._definitionChanged.raiseEvent(this);\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPropertyArray.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof PropertyArray && //\n      Property.arrayEquals(this._value, other._value))\n  );\n};\n\nPropertyArray.prototype._raiseDefinitionChanged = function () {\n  this._definitionChanged.raiseEvent(this);\n};\nexport default PropertyArray;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport Property from \"./Property.js\";\n\nfunction resolve(that) {\n  let targetProperty = that._targetProperty;\n\n  if (!defined(targetProperty)) {\n    let targetEntity = that._targetEntity;\n\n    if (!defined(targetEntity)) {\n      targetEntity = that._targetCollection.getById(that._targetId);\n\n      if (!defined(targetEntity)) {\n        // target entity not found\n        that._targetEntity = that._targetProperty = undefined;\n        return;\n      }\n\n      // target entity was found. listen for changes to entity definition\n      targetEntity.definitionChanged.addEventListener(\n        ReferenceProperty.prototype._onTargetEntityDefinitionChanged,\n        that\n      );\n      that._targetEntity = targetEntity;\n    }\n\n    // walk the list of property names and resolve properties\n    const targetPropertyNames = that._targetPropertyNames;\n    targetProperty = that._targetEntity;\n    for (\n      let i = 0, len = targetPropertyNames.length;\n      i < len && defined(targetProperty);\n      ++i\n    ) {\n      targetProperty = targetProperty[targetPropertyNames[i]];\n    }\n\n    // target property may or may not be defined, depending on if it was found\n    that._targetProperty = targetProperty;\n  }\n\n  return targetProperty;\n}\n\n/**\n * A {@link Property} which transparently links to another property on a provided object.\n *\n * @alias ReferenceProperty\n * @constructor\n *\n * @param {EntityCollection} targetCollection The entity collection which will be used to resolve the reference.\n * @param {string} targetId The id of the entity which is being referenced.\n * @param {string[]} targetPropertyNames The names of the property on the target entity which we will use.\n *\n * @example\n * const collection = new Cesium.EntityCollection();\n *\n * //Create a new entity and assign a billboard scale.\n * const object1 = new Cesium.Entity({id:'object1'});\n * object1.billboard = new Cesium.BillboardGraphics();\n * object1.billboard.scale = new Cesium.ConstantProperty(2.0);\n * collection.add(object1);\n *\n * //Create a second entity and reference the scale from the first one.\n * const object2 = new Cesium.Entity({id:'object2'});\n * object2.model = new Cesium.ModelGraphics();\n * object2.model.scale = new Cesium.ReferenceProperty(collection, 'object1', ['billboard', 'scale']);\n * collection.add(object2);\n *\n * //Create a third object, but use the fromString helper function.\n * const object3 = new Cesium.Entity({id:'object3'});\n * object3.billboard = new Cesium.BillboardGraphics();\n * object3.billboard.scale = Cesium.ReferenceProperty.fromString(collection, 'object1#billboard.scale');\n * collection.add(object3);\n *\n * //You can refer to an entity with a # or . in id and property names by escaping them.\n * const object4 = new Cesium.Entity({id:'#object.4'});\n * object4.billboard = new Cesium.BillboardGraphics();\n * object4.billboard.scale = new Cesium.ConstantProperty(2.0);\n * collection.add(object4);\n *\n * const object5 = new Cesium.Entity({id:'object5'});\n * object5.billboard = new Cesium.BillboardGraphics();\n * object5.billboard.scale = Cesium.ReferenceProperty.fromString(collection, '\\\\#object\\\\.4#billboard.scale');\n * collection.add(object5);\n */\nfunction ReferenceProperty(targetCollection, targetId, targetPropertyNames) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(targetCollection)) {\n    throw new DeveloperError(\"targetCollection is required.\");\n  }\n  if (!defined(targetId) || targetId === \"\") {\n    throw new DeveloperError(\"targetId is required.\");\n  }\n  if (!defined(targetPropertyNames) || targetPropertyNames.length === 0) {\n    throw new DeveloperError(\"targetPropertyNames is required.\");\n  }\n  for (let i = 0; i < targetPropertyNames.length; i++) {\n    const item = targetPropertyNames[i];\n    if (!defined(item) || item === \"\") {\n      throw new DeveloperError(\"reference contains invalid properties.\");\n    }\n  }\n  //>>includeEnd('debug');\n\n  this._targetCollection = targetCollection;\n  this._targetId = targetId;\n  this._targetPropertyNames = targetPropertyNames;\n  this._targetProperty = undefined;\n  this._targetEntity = undefined;\n  this._definitionChanged = new Event();\n\n  targetCollection.collectionChanged.addEventListener(\n    ReferenceProperty.prototype._onCollectionChanged,\n    this\n  );\n}\n\nObject.defineProperties(ReferenceProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.\n   * @memberof ReferenceProperty.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return Property.isConstant(resolve(this));\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is changed whenever the referenced property's definition is changed.\n   * @memberof ReferenceProperty.prototype\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets the reference frame that the position is defined in.\n   * This property is only valid if the referenced property is a {@link PositionProperty}.\n   * @memberof ReferenceProperty.prototype\n   * @type {ReferenceFrame}\n   * @readonly\n   */\n  referenceFrame: {\n    get: function () {\n      const target = resolve(this);\n      return defined(target) ? target.referenceFrame : undefined;\n    },\n  },\n  /**\n   * Gets the id of the entity being referenced.\n   * @memberof ReferenceProperty.prototype\n   * @type {string}\n   * @readonly\n   */\n  targetId: {\n    get: function () {\n      return this._targetId;\n    },\n  },\n  /**\n   * Gets the collection containing the entity being referenced.\n   * @memberof ReferenceProperty.prototype\n   * @type {EntityCollection}\n   * @readonly\n   */\n  targetCollection: {\n    get: function () {\n      return this._targetCollection;\n    },\n  },\n  /**\n   * Gets the array of property names used to retrieve the referenced property.\n   * @memberof ReferenceProperty.prototype\n   * @type {}\n   * @readonly\n   */\n  targetPropertyNames: {\n    get: function () {\n      return this._targetPropertyNames;\n    },\n  },\n  /**\n   * Gets the resolved instance of the underlying referenced property.\n   * @memberof ReferenceProperty.prototype\n   * @type {Property|undefined}\n   * @readonly\n   */\n  resolvedProperty: {\n    get: function () {\n      return resolve(this);\n    },\n  },\n});\n\n/**\n * Creates a new instance given the entity collection that will\n * be used to resolve it and a string indicating the target entity id and property.\n * The format of the string is \"objectId#foo.bar\", where # separates the id from\n * property path and . separates sub-properties.  If the reference identifier or\n * or any sub-properties contains a # . or \\ they must be escaped.\n *\n * @param {EntityCollection} targetCollection\n * @param {string} referenceString\n * @returns {ReferenceProperty} A new instance of ReferenceProperty.\n *\n * @exception {DeveloperError} invalid referenceString.\n */\nReferenceProperty.fromString = function (targetCollection, referenceString) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(targetCollection)) {\n    throw new DeveloperError(\"targetCollection is required.\");\n  }\n  if (!defined(referenceString)) {\n    throw new DeveloperError(\"referenceString is required.\");\n  }\n  //>>includeEnd('debug');\n\n  let identifier;\n  const values = [];\n\n  let inIdentifier = true;\n  let isEscaped = false;\n  let token = \"\";\n  for (let i = 0; i < referenceString.length; ++i) {\n    const c = referenceString.charAt(i);\n\n    if (isEscaped) {\n      token += c;\n      isEscaped = false;\n    } else if (c === \"\\\\\") {\n      isEscaped = true;\n    } else if (inIdentifier && c === \"#\") {\n      identifier = token;\n      inIdentifier = false;\n      token = \"\";\n    } else if (!inIdentifier && c === \".\") {\n      values.push(token);\n      token = \"\";\n    } else {\n      token += c;\n    }\n  }\n  values.push(token);\n\n  return new ReferenceProperty(targetCollection, identifier, values);\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nReferenceProperty.prototype.getValue = function (time, result) {\n  const target = resolve(this);\n  return defined(target) ? target.getValue(time, result) : undefined;\n};\n\n/**\n * Gets the value of the property at the provided time and in the provided reference frame.\n * This method is only valid if the property being referenced is a {@link PositionProperty}.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nReferenceProperty.prototype.getValueInReferenceFrame = function (\n  time,\n  referenceFrame,\n  result\n) {\n  const target = resolve(this);\n  return defined(target)\n    ? target.getValueInReferenceFrame(time, referenceFrame, result)\n    : undefined;\n};\n\n/**\n * Gets the {@link Material} type at the provided time.\n * This method is only valid if the property being referenced is a {@link MaterialProperty}.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {string} The type of material.\n */\nReferenceProperty.prototype.getType = function (time) {\n  const target = resolve(this);\n  return defined(target) ? target.getType(time) : undefined;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nReferenceProperty.prototype.equals = function (other) {\n  if (this === other) {\n    return true;\n  }\n\n  const names = this._targetPropertyNames;\n  const otherNames = other._targetPropertyNames;\n\n  if (\n    this._targetCollection !== other._targetCollection || //\n    this._targetId !== other._targetId || //\n    names.length !== otherNames.length\n  ) {\n    return false;\n  }\n\n  const length = this._targetPropertyNames.length;\n  for (let i = 0; i < length; i++) {\n    if (names[i] !== otherNames[i]) {\n      return false;\n    }\n  }\n\n  return true;\n};\n\nReferenceProperty.prototype._onTargetEntityDefinitionChanged = function (\n  targetEntity,\n  name,\n  value,\n  oldValue\n) {\n  if (defined(this._targetProperty) && this._targetPropertyNames[0] === name) {\n    this._targetProperty = undefined;\n    this._definitionChanged.raiseEvent(this);\n  }\n};\n\nReferenceProperty.prototype._onCollectionChanged = function (\n  collection,\n  added,\n  removed\n) {\n  let targetEntity = this._targetEntity;\n  if (defined(targetEntity) && removed.indexOf(targetEntity) !== -1) {\n    targetEntity.definitionChanged.removeEventListener(\n      ReferenceProperty.prototype._onTargetEntityDefinitionChanged,\n      this\n    );\n    this._targetEntity = this._targetProperty = undefined;\n  } else if (!defined(targetEntity)) {\n    targetEntity = resolve(this);\n    if (defined(targetEntity)) {\n      this._definitionChanged.raiseEvent(this);\n    }\n  }\n};\nexport default ReferenceProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\n\n/**\n * Represents a {@link Packable} number that always interpolates values\n * towards the shortest angle of rotation. This object is never used directly\n * but is instead passed to the constructor of {@link SampledProperty}\n * in order to represent a two-dimensional angle of rotation.\n *\n * @interface Rotation\n *\n *\n * @example\n * const time1 = Cesium.JulianDate.fromIso8601('2010-05-07T00:00:00');\n * const time2 = Cesium.JulianDate.fromIso8601('2010-05-07T00:01:00');\n * const time3 = Cesium.JulianDate.fromIso8601('2010-05-07T00:02:00');\n *\n * const property = new Cesium.SampledProperty(Cesium.Rotation);\n * property.addSample(time1, 0);\n * property.addSample(time3, Cesium.Math.toRadians(350));\n *\n * //Getting the value at time2 will equal 355 degrees instead\n * //of 175 degrees (which is what you get if you construct\n * //a SampledProperty(Number) instead.  Note, the actual\n * //return value is in radians, not degrees.\n * property.getValue(time2);\n *\n * @see PackableForInterpolation\n */\nconst Rotation = {\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  packedLength: 1,\n\n  /**\n   * Stores the provided instance into the provided array.\n   *\n   * @param {Rotation} value The value to pack.\n   * @param {number[]} array The array to pack into.\n   * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n   *\n   * @returns {number[]} The array that was packed into\n   */\n  pack: function (value, array, startingIndex) {\n    //>>includeStart('debug', pragmas.debug);\n    if (!defined(value)) {\n      throw new DeveloperError(\"value is required\");\n    }\n\n    if (!defined(array)) {\n      throw new DeveloperError(\"array is required\");\n    }\n    //>>includeEnd('debug');\n\n    startingIndex = defaultValue(startingIndex, 0);\n    array[startingIndex] = value;\n\n    return array;\n  },\n\n  /**\n   * Retrieves an instance from a packed array.\n   *\n   * @param {number[]} array The packed array.\n   * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n   * @param {Rotation} [result] The object into which to store the result.\n   * @returns {Rotation} The modified result parameter or a new Rotation instance if one was not provided.\n   */\n  unpack: function (array, startingIndex, result) {\n    //>>includeStart('debug', pragmas.debug);\n    if (!defined(array)) {\n      throw new DeveloperError(\"array is required\");\n    }\n    //>>includeEnd('debug');\n\n    startingIndex = defaultValue(startingIndex, 0);\n    return array[startingIndex];\n  },\n\n  /**\n   * Converts a packed array into a form suitable for interpolation.\n   *\n   * @param {number[]} packedArray The packed array.\n   * @param {number} [startingIndex=0] The index of the first element to be converted.\n   * @param {number} [lastIndex=packedArray.length] The index of the last element to be converted.\n   * @param {number[]} [result] The object into which to store the result.\n   */\n  convertPackedArrayForInterpolation: function (\n    packedArray,\n    startingIndex,\n    lastIndex,\n    result\n  ) {\n    //>>includeStart('debug', pragmas.debug);\n    if (!defined(packedArray)) {\n      throw new DeveloperError(\"packedArray is required\");\n    }\n    //>>includeEnd('debug');\n\n    if (!defined(result)) {\n      result = [];\n    }\n\n    startingIndex = defaultValue(startingIndex, 0);\n    lastIndex = defaultValue(lastIndex, packedArray.length);\n\n    let previousValue;\n    for (let i = 0, len = lastIndex - startingIndex + 1; i < len; i++) {\n      const value = packedArray[startingIndex + i];\n      if (i === 0 || Math.abs(previousValue - value) < Math.PI) {\n        result[i] = value;\n      } else {\n        result[i] = value - CesiumMath.TWO_PI;\n      }\n      previousValue = value;\n    }\n  },\n\n  /**\n   * Retrieves an instance from a packed array converted with {@link Rotation.convertPackedArrayForInterpolation}.\n   *\n   * @param {number[]} array The array previously packed for interpolation.\n   * @param {number[]} sourceArray The original packed array.\n   * @param {number} [firstIndex=0] The firstIndex used to convert the array.\n   * @param {number} [lastIndex=packedArray.length] The lastIndex used to convert the array.\n   * @param {Rotation} [result] The object into which to store the result.\n   * @returns {Rotation} The modified result parameter or a new Rotation instance if one was not provided.\n   */\n  unpackInterpolationResult: function (\n    array,\n    sourceArray,\n    firstIndex,\n    lastIndex,\n    result\n  ) {\n    //>>includeStart('debug', pragmas.debug);\n    if (!defined(array)) {\n      throw new DeveloperError(\"array is required\");\n    }\n    if (!defined(sourceArray)) {\n      throw new DeveloperError(\"sourceArray is required\");\n    }\n    //>>includeEnd('debug');\n\n    result = array[0];\n    if (result < 0) {\n      return result + CesiumMath.TWO_PI;\n    }\n    return result;\n  },\n};\nexport default Rotation;\n", "import binarySearch from \"../Core/binarySearch.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport ExtrapolationType from \"../Core/ExtrapolationType.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport LinearApproximation from \"../Core/LinearApproximation.js\";\n\nconst PackableNumber = {\n  packedLength: 1,\n  pack: function (value, array, startingIndex) {\n    startingIndex = defaultValue(startingIndex, 0);\n    array[startingIndex] = value;\n  },\n  unpack: function (array, startingIndex, result) {\n    startingIndex = defaultValue(startingIndex, 0);\n    return array[startingIndex];\n  },\n};\n\n//We can't use splice for inserting new elements because function apply can't handle\n//a huge number of arguments.  See https://code.google.com/p/chromium/issues/detail?id=56588\nfunction arrayInsert(array, startIndex, items) {\n  let i;\n  const arrayLength = array.length;\n  const itemsLength = items.length;\n  const newLength = arrayLength + itemsLength;\n\n  array.length = newLength;\n  if (arrayLength !== startIndex) {\n    let q = arrayLength - 1;\n    for (i = newLength - 1; i >= startIndex; i--) {\n      array[i] = array[q--];\n    }\n  }\n\n  for (i = 0; i < itemsLength; i++) {\n    array[startIndex++] = items[i];\n  }\n}\n\nfunction convertDate(date, epoch) {\n  if (date instanceof JulianDate) {\n    return date;\n  }\n  if (typeof date === \"string\") {\n    return JulianDate.fromIso8601(date);\n  }\n  return JulianDate.addSeconds(epoch, date, new JulianDate());\n}\n\nconst timesSpliceArgs = [];\nconst valuesSpliceArgs = [];\n\nfunction mergeNewSamples(epoch, times, values, newData, packedLength) {\n  let newDataIndex = 0;\n  let i;\n  let prevItem;\n  let timesInsertionPoint;\n  let valuesInsertionPoint;\n  let currentTime;\n  let nextTime;\n\n  while (newDataIndex < newData.length) {\n    currentTime = convertDate(newData[newDataIndex], epoch);\n    timesInsertionPoint = binarySearch(times, currentTime, JulianDate.compare);\n    let timesSpliceArgsCount = 0;\n    let valuesSpliceArgsCount = 0;\n\n    if (timesInsertionPoint < 0) {\n      //Doesn't exist, insert as many additional values as we can.\n      timesInsertionPoint = ~timesInsertionPoint;\n\n      valuesInsertionPoint = timesInsertionPoint * packedLength;\n      prevItem = undefined;\n      nextTime = times[timesInsertionPoint];\n      while (newDataIndex < newData.length) {\n        currentTime = convertDate(newData[newDataIndex], epoch);\n        if (\n          (defined(prevItem) &&\n            JulianDate.compare(prevItem, currentTime) >= 0) ||\n          (defined(nextTime) && JulianDate.compare(currentTime, nextTime) >= 0)\n        ) {\n          break;\n        }\n        timesSpliceArgs[timesSpliceArgsCount++] = currentTime;\n        newDataIndex = newDataIndex + 1;\n        for (i = 0; i < packedLength; i++) {\n          valuesSpliceArgs[valuesSpliceArgsCount++] = newData[newDataIndex];\n          newDataIndex = newDataIndex + 1;\n        }\n        prevItem = currentTime;\n      }\n\n      if (timesSpliceArgsCount > 0) {\n        valuesSpliceArgs.length = valuesSpliceArgsCount;\n        arrayInsert(values, valuesInsertionPoint, valuesSpliceArgs);\n\n        timesSpliceArgs.length = timesSpliceArgsCount;\n        arrayInsert(times, timesInsertionPoint, timesSpliceArgs);\n      }\n    } else {\n      //Found an exact match\n      for (i = 0; i < packedLength; i++) {\n        newDataIndex++;\n        values[timesInsertionPoint * packedLength + i] = newData[newDataIndex];\n      }\n      newDataIndex++;\n    }\n  }\n}\n\n/**\n * A {@link Property} whose value is interpolated for a given time from the\n * provided set of samples and specified interpolation algorithm and degree.\n * @alias SampledProperty\n * @constructor\n *\n * @param {number|Packable} type The type of property.\n * @param {Packable[]} [derivativeTypes] When supplied, indicates that samples will contain derivative information of the specified types.\n *\n *\n * @example\n * //Create a linearly interpolated Cartesian2\n * const property = new Cesium.SampledProperty(Cesium.Cartesian2);\n *\n * //Populate it with data\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), new Cesium.Cartesian2(0, 0));\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-02T00:00:00.00Z'), new Cesium.Cartesian2(4, 7));\n *\n * //Retrieve an interpolated value\n * const result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T12:00:00.00Z'));\n *\n * @example\n * //Create a simple numeric SampledProperty that uses third degree Hermite Polynomial Approximation\n * const property = new Cesium.SampledProperty(Number);\n * property.setInterpolationOptions({\n *     interpolationDegree : 3,\n *     interpolationAlgorithm : Cesium.HermitePolynomialApproximation\n * });\n *\n * //Populate it with data\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), 1.0);\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:01:00.00Z'), 6.0);\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:00.00Z'), 12.0);\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:03:30.00Z'), 5.0);\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:06:30.00Z'), 2.0);\n *\n * //Samples can be added in any order.\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:30.00Z'), 6.2);\n *\n * //Retrieve an interpolated value\n * const result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:34.00Z'));\n *\n * @see SampledPositionProperty\n */\nfunction SampledProperty(type, derivativeTypes) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"type\", type);\n  //>>includeEnd('debug');\n\n  let innerType = type;\n  if (innerType === Number) {\n    innerType = PackableNumber;\n  }\n  let packedLength = innerType.packedLength;\n  let packedInterpolationLength = defaultValue(\n    innerType.packedInterpolationLength,\n    packedLength\n  );\n\n  let inputOrder = 0;\n  let innerDerivativeTypes;\n  if (defined(derivativeTypes)) {\n    const length = derivativeTypes.length;\n    innerDerivativeTypes = new Array(length);\n    for (let i = 0; i < length; i++) {\n      let derivativeType = derivativeTypes[i];\n      if (derivativeType === Number) {\n        derivativeType = PackableNumber;\n      }\n      const derivativePackedLength = derivativeType.packedLength;\n      packedLength += derivativePackedLength;\n      packedInterpolationLength += defaultValue(\n        derivativeType.packedInterpolationLength,\n        derivativePackedLength\n      );\n      innerDerivativeTypes[i] = derivativeType;\n    }\n    inputOrder = length;\n  }\n\n  this._type = type;\n  this._innerType = innerType;\n  this._interpolationDegree = 1;\n  this._interpolationAlgorithm = LinearApproximation;\n  this._numberOfPoints = 0;\n  this._times = [];\n  this._values = [];\n  this._xTable = [];\n  this._yTable = [];\n  this._packedLength = packedLength;\n  this._packedInterpolationLength = packedInterpolationLength;\n  this._updateTableLength = true;\n  this._interpolationResult = new Array(packedInterpolationLength);\n  this._definitionChanged = new Event();\n  this._derivativeTypes = derivativeTypes;\n  this._innerDerivativeTypes = innerDerivativeTypes;\n  this._inputOrder = inputOrder;\n  this._forwardExtrapolationType = ExtrapolationType.NONE;\n  this._forwardExtrapolationDuration = 0;\n  this._backwardExtrapolationType = ExtrapolationType.NONE;\n  this._backwardExtrapolationDuration = 0;\n}\n\nObject.defineProperties(SampledProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof SampledProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return this._values.length === 0;\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof SampledProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets the type of property.\n   * @memberof SampledProperty.prototype\n   * @type {*}\n   */\n  type: {\n    get: function () {\n      return this._type;\n    },\n  },\n  /**\n   * Gets the derivative types used by this property.\n   * @memberof SampledProperty.prototype\n   * @type {Packable[]}\n   */\n  derivativeTypes: {\n    get: function () {\n      return this._derivativeTypes;\n    },\n  },\n  /**\n   * Gets the degree of interpolation to perform when retrieving a value.\n   * @memberof SampledProperty.prototype\n   * @type {number}\n   * @default 1\n   */\n  interpolationDegree: {\n    get: function () {\n      return this._interpolationDegree;\n    },\n  },\n  /**\n   * Gets the interpolation algorithm to use when retrieving a value.\n   * @memberof SampledProperty.prototype\n   * @type {InterpolationAlgorithm}\n   * @default LinearApproximation\n   */\n  interpolationAlgorithm: {\n    get: function () {\n      return this._interpolationAlgorithm;\n    },\n  },\n  /**\n   * Gets or sets the type of extrapolation to perform when a value\n   * is requested at a time after any available samples.\n   * @memberof SampledProperty.prototype\n   * @type {ExtrapolationType}\n   * @default ExtrapolationType.NONE\n   */\n  forwardExtrapolationType: {\n    get: function () {\n      return this._forwardExtrapolationType;\n    },\n    set: function (value) {\n      if (this._forwardExtrapolationType !== value) {\n        this._forwardExtrapolationType = value;\n        this._definitionChanged.raiseEvent(this);\n      }\n    },\n  },\n  /**\n   * Gets or sets the amount of time to extrapolate forward before\n   * the property becomes undefined.  A value of 0 will extrapolate forever.\n   * @memberof SampledProperty.prototype\n   * @type {number}\n   * @default 0\n   */\n  forwardExtrapolationDuration: {\n    get: function () {\n      return this._forwardExtrapolationDuration;\n    },\n    set: function (value) {\n      if (this._forwardExtrapolationDuration !== value) {\n        this._forwardExtrapolationDuration = value;\n        this._definitionChanged.raiseEvent(this);\n      }\n    },\n  },\n  /**\n   * Gets or sets the type of extrapolation to perform when a value\n   * is requested at a time before any available samples.\n   * @memberof SampledProperty.prototype\n   * @type {ExtrapolationType}\n   * @default ExtrapolationType.NONE\n   */\n  backwardExtrapolationType: {\n    get: function () {\n      return this._backwardExtrapolationType;\n    },\n    set: function (value) {\n      if (this._backwardExtrapolationType !== value) {\n        this._backwardExtrapolationType = value;\n        this._definitionChanged.raiseEvent(this);\n      }\n    },\n  },\n  /**\n   * Gets or sets the amount of time to extrapolate backward\n   * before the property becomes undefined.  A value of 0 will extrapolate forever.\n   * @memberof SampledProperty.prototype\n   * @type {number}\n   * @default 0\n   */\n  backwardExtrapolationDuration: {\n    get: function () {\n      return this._backwardExtrapolationDuration;\n    },\n    set: function (value) {\n      if (this._backwardExtrapolationDuration !== value) {\n        this._backwardExtrapolationDuration = value;\n        this._definitionChanged.raiseEvent(this);\n      }\n    },\n  },\n});\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nSampledProperty.prototype.getValue = function (time, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n  //>>includeEnd('debug');\n\n  const times = this._times;\n  const timesLength = times.length;\n  if (timesLength === 0) {\n    return undefined;\n  }\n\n  let timeout;\n  const innerType = this._innerType;\n  const values = this._values;\n  let index = binarySearch(times, time, JulianDate.compare);\n\n  if (index < 0) {\n    index = ~index;\n\n    if (index === 0) {\n      const startTime = times[index];\n      timeout = this._backwardExtrapolationDuration;\n      if (\n        this._backwardExtrapolationType === ExtrapolationType.NONE ||\n        (timeout !== 0 &&\n          JulianDate.secondsDifference(startTime, time) > timeout)\n      ) {\n        return undefined;\n      }\n      if (this._backwardExtrapolationType === ExtrapolationType.HOLD) {\n        return innerType.unpack(values, 0, result);\n      }\n    }\n\n    if (index >= timesLength) {\n      index = timesLength - 1;\n      const endTime = times[index];\n      timeout = this._forwardExtrapolationDuration;\n      if (\n        this._forwardExtrapolationType === ExtrapolationType.NONE ||\n        (timeout !== 0 && JulianDate.secondsDifference(time, endTime) > timeout)\n      ) {\n        return undefined;\n      }\n      if (this._forwardExtrapolationType === ExtrapolationType.HOLD) {\n        index = timesLength - 1;\n        return innerType.unpack(values, index * innerType.packedLength, result);\n      }\n    }\n\n    const xTable = this._xTable;\n    const yTable = this._yTable;\n    const interpolationAlgorithm = this._interpolationAlgorithm;\n    const packedInterpolationLength = this._packedInterpolationLength;\n    const inputOrder = this._inputOrder;\n\n    if (this._updateTableLength) {\n      this._updateTableLength = false;\n      const numberOfPoints = Math.min(\n        interpolationAlgorithm.getRequiredDataPoints(\n          this._interpolationDegree,\n          inputOrder\n        ),\n        timesLength\n      );\n      if (numberOfPoints !== this._numberOfPoints) {\n        this._numberOfPoints = numberOfPoints;\n        xTable.length = numberOfPoints;\n        yTable.length = numberOfPoints * packedInterpolationLength;\n      }\n    }\n\n    const degree = this._numberOfPoints - 1;\n    if (degree < 1) {\n      return undefined;\n    }\n\n    let firstIndex = 0;\n    let lastIndex = timesLength - 1;\n    const pointsInCollection = lastIndex - firstIndex + 1;\n\n    if (pointsInCollection >= degree + 1) {\n      let computedFirstIndex = index - ((degree / 2) | 0) - 1;\n      if (computedFirstIndex < firstIndex) {\n        computedFirstIndex = firstIndex;\n      }\n      let computedLastIndex = computedFirstIndex + degree;\n      if (computedLastIndex > lastIndex) {\n        computedLastIndex = lastIndex;\n        computedFirstIndex = computedLastIndex - degree;\n        if (computedFirstIndex < firstIndex) {\n          computedFirstIndex = firstIndex;\n        }\n      }\n\n      firstIndex = computedFirstIndex;\n      lastIndex = computedLastIndex;\n    }\n    const length = lastIndex - firstIndex + 1;\n\n    // Build the tables\n    for (let i = 0; i < length; ++i) {\n      xTable[i] = JulianDate.secondsDifference(\n        times[firstIndex + i],\n        times[lastIndex]\n      );\n    }\n\n    if (!defined(innerType.convertPackedArrayForInterpolation)) {\n      let destinationIndex = 0;\n      const packedLength = this._packedLength;\n      let sourceIndex = firstIndex * packedLength;\n      const stop = (lastIndex + 1) * packedLength;\n\n      while (sourceIndex < stop) {\n        yTable[destinationIndex] = values[sourceIndex];\n        sourceIndex++;\n        destinationIndex++;\n      }\n    } else {\n      innerType.convertPackedArrayForInterpolation(\n        values,\n        firstIndex,\n        lastIndex,\n        yTable\n      );\n    }\n\n    // Interpolate!\n    const x = JulianDate.secondsDifference(time, times[lastIndex]);\n    let interpolationResult;\n    if (inputOrder === 0 || !defined(interpolationAlgorithm.interpolate)) {\n      interpolationResult = interpolationAlgorithm.interpolateOrderZero(\n        x,\n        xTable,\n        yTable,\n        packedInterpolationLength,\n        this._interpolationResult\n      );\n    } else {\n      const yStride = Math.floor(packedInterpolationLength / (inputOrder + 1));\n      interpolationResult = interpolationAlgorithm.interpolate(\n        x,\n        xTable,\n        yTable,\n        yStride,\n        inputOrder,\n        inputOrder,\n        this._interpolationResult\n      );\n    }\n\n    if (!defined(innerType.unpackInterpolationResult)) {\n      return innerType.unpack(interpolationResult, 0, result);\n    }\n    return innerType.unpackInterpolationResult(\n      interpolationResult,\n      values,\n      firstIndex,\n      lastIndex,\n      result\n    );\n  }\n  return innerType.unpack(values, index * this._packedLength, result);\n};\n\n/**\n * Sets the algorithm and degree to use when interpolating a value.\n *\n * @param {object} [options] Object with the following properties:\n * @param {InterpolationAlgorithm} [options.interpolationAlgorithm] The new interpolation algorithm.  If undefined, the existing property will be unchanged.\n * @param {number} [options.interpolationDegree] The new interpolation degree.  If undefined, the existing property will be unchanged.\n */\nSampledProperty.prototype.setInterpolationOptions = function (options) {\n  if (!defined(options)) {\n    return;\n  }\n\n  let valuesChanged = false;\n\n  const interpolationAlgorithm = options.interpolationAlgorithm;\n  const interpolationDegree = options.interpolationDegree;\n\n  if (\n    defined(interpolationAlgorithm) &&\n    this._interpolationAlgorithm !== interpolationAlgorithm\n  ) {\n    this._interpolationAlgorithm = interpolationAlgorithm;\n    valuesChanged = true;\n  }\n\n  if (\n    defined(interpolationDegree) &&\n    this._interpolationDegree !== interpolationDegree\n  ) {\n    this._interpolationDegree = interpolationDegree;\n    valuesChanged = true;\n  }\n\n  if (valuesChanged) {\n    this._updateTableLength = true;\n    this._definitionChanged.raiseEvent(this);\n  }\n};\n\n/**\n * Adds a new sample.\n *\n * @param {JulianDate} time The sample time.\n * @param {Packable} value The value at the provided time.\n * @param {Packable[]} [derivatives] The array of derivatives at the provided time.\n */\nSampledProperty.prototype.addSample = function (time, value, derivatives) {\n  const innerDerivativeTypes = this._innerDerivativeTypes;\n  const hasDerivatives = defined(innerDerivativeTypes);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n  Check.defined(\"value\", value);\n  if (hasDerivatives) {\n    Check.defined(\"derivatives\", derivatives);\n  }\n  //>>includeEnd('debug');\n\n  const innerType = this._innerType;\n  const data = [];\n  data.push(time);\n  innerType.pack(value, data, data.length);\n\n  if (hasDerivatives) {\n    const derivativesLength = innerDerivativeTypes.length;\n    for (let x = 0; x < derivativesLength; x++) {\n      innerDerivativeTypes[x].pack(derivatives[x], data, data.length);\n    }\n  }\n  mergeNewSamples(\n    undefined,\n    this._times,\n    this._values,\n    data,\n    this._packedLength\n  );\n  this._updateTableLength = true;\n  this._definitionChanged.raiseEvent(this);\n};\n\n/**\n * Adds an array of samples.\n *\n * @param {JulianDate[]} times An array of JulianDate instances where each index is a sample time.\n * @param {Packable[]} values The array of values, where each value corresponds to the provided times index.\n * @param {Array[]} [derivativeValues] An array where each item is the array of derivatives at the equivalent time index.\n *\n * @exception {DeveloperError} times and values must be the same length.\n * @exception {DeveloperError} times and derivativeValues must be the same length.\n */\nSampledProperty.prototype.addSamples = function (\n  times,\n  values,\n  derivativeValues\n) {\n  const innerDerivativeTypes = this._innerDerivativeTypes;\n  const hasDerivatives = defined(innerDerivativeTypes);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"times\", times);\n  Check.defined(\"values\", values);\n  if (times.length !== values.length) {\n    throw new DeveloperError(\"times and values must be the same length.\");\n  }\n  if (\n    hasDerivatives &&\n    (!defined(derivativeValues) || derivativeValues.length !== times.length)\n  ) {\n    throw new DeveloperError(\n      \"times and derivativeValues must be the same length.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const innerType = this._innerType;\n  const length = times.length;\n  const data = [];\n  for (let i = 0; i < length; i++) {\n    data.push(times[i]);\n    innerType.pack(values[i], data, data.length);\n\n    if (hasDerivatives) {\n      const derivatives = derivativeValues[i];\n      const derivativesLength = innerDerivativeTypes.length;\n      for (let x = 0; x < derivativesLength; x++) {\n        innerDerivativeTypes[x].pack(derivatives[x], data, data.length);\n      }\n    }\n  }\n  mergeNewSamples(\n    undefined,\n    this._times,\n    this._values,\n    data,\n    this._packedLength\n  );\n  this._updateTableLength = true;\n  this._definitionChanged.raiseEvent(this);\n};\n\n/**\n * Adds samples as a single packed array where each new sample is represented as a date,\n * followed by the packed representation of the corresponding value and derivatives.\n *\n * @param {number[]} packedSamples The array of packed samples.\n * @param {JulianDate} [epoch] If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds.\n */\nSampledProperty.prototype.addSamplesPackedArray = function (\n  packedSamples,\n  epoch\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"packedSamples\", packedSamples);\n  //>>includeEnd('debug');\n\n  mergeNewSamples(\n    epoch,\n    this._times,\n    this._values,\n    packedSamples,\n    this._packedLength\n  );\n  this._updateTableLength = true;\n  this._definitionChanged.raiseEvent(this);\n};\n\n/**\n * Removes a sample at the given time, if present.\n *\n * @param {JulianDate} time The sample time.\n * @returns {boolean} <code>true</code> if a sample at time was removed, <code>false</code> otherwise.\n */\nSampledProperty.prototype.removeSample = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n  //>>includeEnd('debug');\n\n  const index = binarySearch(this._times, time, JulianDate.compare);\n  if (index < 0) {\n    return false;\n  }\n  removeSamples(this, index, 1);\n  return true;\n};\n\nfunction removeSamples(property, startIndex, numberToRemove) {\n  const packedLength = property._packedLength;\n  property._times.splice(startIndex, numberToRemove);\n  property._values.splice(\n    startIndex * packedLength,\n    numberToRemove * packedLength\n  );\n  property._updateTableLength = true;\n  property._definitionChanged.raiseEvent(property);\n}\n\n/**\n * Removes all samples for the given time interval.\n *\n * @param {TimeInterval} time The time interval for which to remove all samples.\n */\nSampledProperty.prototype.removeSamples = function (timeInterval) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"timeInterval\", timeInterval);\n  //>>includeEnd('debug');\n\n  const times = this._times;\n  let startIndex = binarySearch(times, timeInterval.start, JulianDate.compare);\n  if (startIndex < 0) {\n    startIndex = ~startIndex;\n  } else if (!timeInterval.isStartIncluded) {\n    ++startIndex;\n  }\n  let stopIndex = binarySearch(times, timeInterval.stop, JulianDate.compare);\n  if (stopIndex < 0) {\n    stopIndex = ~stopIndex;\n  } else if (timeInterval.isStopIncluded) {\n    ++stopIndex;\n  }\n\n  removeSamples(this, startIndex, stopIndex - startIndex);\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nSampledProperty.prototype.equals = function (other) {\n  if (this === other) {\n    return true;\n  }\n  if (!defined(other)) {\n    return false;\n  }\n\n  if (\n    this._type !== other._type || //\n    this._interpolationDegree !== other._interpolationDegree || //\n    this._interpolationAlgorithm !== other._interpolationAlgorithm\n  ) {\n    return false;\n  }\n\n  const derivativeTypes = this._derivativeTypes;\n  const hasDerivatives = defined(derivativeTypes);\n  const otherDerivativeTypes = other._derivativeTypes;\n  const otherHasDerivatives = defined(otherDerivativeTypes);\n  if (hasDerivatives !== otherHasDerivatives) {\n    return false;\n  }\n\n  let i;\n  let length;\n  if (hasDerivatives) {\n    length = derivativeTypes.length;\n    if (length !== otherDerivativeTypes.length) {\n      return false;\n    }\n\n    for (i = 0; i < length; i++) {\n      if (derivativeTypes[i] !== otherDerivativeTypes[i]) {\n        return false;\n      }\n    }\n  }\n\n  const times = this._times;\n  const otherTimes = other._times;\n  length = times.length;\n\n  if (length !== otherTimes.length) {\n    return false;\n  }\n\n  for (i = 0; i < length; i++) {\n    if (!JulianDate.equals(times[i], otherTimes[i])) {\n      return false;\n    }\n  }\n\n  const values = this._values;\n  const otherValues = other._values;\n  length = values.length;\n\n  //Since time lengths are equal, values length and other length are guaranteed to be equal.\n  for (i = 0; i < length; i++) {\n    if (values[i] !== otherValues[i]) {\n      return false;\n    }\n  }\n\n  return true;\n};\n\n//Exposed for testing.\nSampledProperty._mergeNewSamples = mergeNewSamples;\nexport default SampledProperty;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport PositionProperty from \"./PositionProperty.js\";\nimport Property from \"./Property.js\";\nimport SampledProperty from \"./SampledProperty.js\";\n\n/**\n * A {@link SampledProperty} which is also a {@link PositionProperty}.\n *\n * @alias SampledPositionProperty\n * @constructor\n *\n * @param {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined.\n * @param {number} [numberOfDerivatives=0] The number of derivatives that accompany each position; i.e. velocity, acceleration, etc...\n */\nfunction SampledPositionProperty(referenceFrame, numberOfDerivatives) {\n  numberOfDerivatives = defaultValue(numberOfDerivatives, 0);\n\n  let derivativeTypes;\n  if (numberOfDerivatives > 0) {\n    derivativeTypes = new Array(numberOfDerivatives);\n    for (let i = 0; i < numberOfDerivatives; i++) {\n      derivativeTypes[i] = Cartesian3;\n    }\n  }\n\n  this._numberOfDerivatives = numberOfDerivatives;\n  this._property = new SampledProperty(Cartesian3, derivativeTypes);\n  this._definitionChanged = new Event();\n  this._referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED);\n\n  this._property._definitionChanged.addEventListener(function () {\n    this._definitionChanged.raiseEvent(this);\n  }, this);\n}\n\nObject.defineProperties(SampledPositionProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof SampledPositionProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return this._property.isConstant;\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof SampledPositionProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets the reference frame in which the position is defined.\n   * @memberof SampledPositionProperty.prototype\n   * @type {ReferenceFrame}\n   * @default ReferenceFrame.FIXED;\n   */\n  referenceFrame: {\n    get: function () {\n      return this._referenceFrame;\n    },\n  },\n  /**\n   * Gets the degree of interpolation to perform when retrieving a value. Call <code>setInterpolationOptions</code> to set this.\n   * @memberof SampledPositionProperty.prototype\n   *\n   * @type {number}\n   * @default 1\n   * @readonly\n   */\n  interpolationDegree: {\n    get: function () {\n      return this._property.interpolationDegree;\n    },\n  },\n  /**\n   * Gets the interpolation algorithm to use when retrieving a value. Call <code>setInterpolationOptions</code> to set this.\n   * @memberof SampledPositionProperty.prototype\n   *\n   * @type {InterpolationAlgorithm}\n   * @default LinearApproximation\n   * @readonly\n   */\n  interpolationAlgorithm: {\n    get: function () {\n      return this._property.interpolationAlgorithm;\n    },\n  },\n  /**\n   * The number of derivatives contained by this property; i.e. 0 for just position, 1 for velocity, etc.\n   * @memberof SampledPositionProperty.prototype\n   *\n   * @type {number}\n   * @default 0\n   */\n  numberOfDerivatives: {\n    get: function () {\n      return this._numberOfDerivatives;\n    },\n  },\n  /**\n   * Gets or sets the type of extrapolation to perform when a value\n   * is requested at a time after any available samples.\n   * @memberof SampledPositionProperty.prototype\n   * @type {ExtrapolationType}\n   * @default ExtrapolationType.NONE\n   */\n  forwardExtrapolationType: {\n    get: function () {\n      return this._property.forwardExtrapolationType;\n    },\n    set: function (value) {\n      this._property.forwardExtrapolationType = value;\n    },\n  },\n  /**\n   * Gets or sets the amount of time to extrapolate forward before\n   * the property becomes undefined.  A value of 0 will extrapolate forever.\n   * @memberof SampledPositionProperty.prototype\n   * @type {number}\n   * @default 0\n   */\n  forwardExtrapolationDuration: {\n    get: function () {\n      return this._property.forwardExtrapolationDuration;\n    },\n    set: function (value) {\n      this._property.forwardExtrapolationDuration = value;\n    },\n  },\n  /**\n   * Gets or sets the type of extrapolation to perform when a value\n   * is requested at a time before any available samples.\n   * @memberof SampledPositionProperty.prototype\n   * @type {ExtrapolationType}\n   * @default ExtrapolationType.NONE\n   */\n  backwardExtrapolationType: {\n    get: function () {\n      return this._property.backwardExtrapolationType;\n    },\n    set: function (value) {\n      this._property.backwardExtrapolationType = value;\n    },\n  },\n  /**\n   * Gets or sets the amount of time to extrapolate backward\n   * before the property becomes undefined.  A value of 0 will extrapolate forever.\n   * @memberof SampledPositionProperty.prototype\n   * @type {number}\n   * @default 0\n   */\n  backwardExtrapolationDuration: {\n    get: function () {\n      return this._property.backwardExtrapolationDuration;\n    },\n    set: function (value) {\n      this._property.backwardExtrapolationDuration = value;\n    },\n  },\n});\n\n/**\n * Gets the position at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nSampledPositionProperty.prototype.getValue = function (time, result) {\n  return this.getValueInReferenceFrame(time, ReferenceFrame.FIXED, result);\n};\n\n/**\n * Gets the position at the provided time and in the provided reference frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nSampledPositionProperty.prototype.getValueInReferenceFrame = function (\n  time,\n  referenceFrame,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n  Check.defined(\"referenceFrame\", referenceFrame);\n  //>>includeEnd('debug');\n\n  result = this._property.getValue(time, result);\n  if (defined(result)) {\n    return PositionProperty.convertToReferenceFrame(\n      time,\n      result,\n      this._referenceFrame,\n      referenceFrame,\n      result\n    );\n  }\n  return undefined;\n};\n\n/**\n * Sets the algorithm and degree to use when interpolating a position.\n *\n * @param {object} [options] Object with the following properties:\n * @param {InterpolationAlgorithm} [options.interpolationAlgorithm] The new interpolation algorithm.  If undefined, the existing property will be unchanged.\n * @param {number} [options.interpolationDegree] The new interpolation degree.  If undefined, the existing property will be unchanged.\n */\nSampledPositionProperty.prototype.setInterpolationOptions = function (options) {\n  this._property.setInterpolationOptions(options);\n};\n\n/**\n * Adds a new sample.\n *\n * @param {JulianDate} time The sample time.\n * @param {Cartesian3} position The position at the provided time.\n * @param {Cartesian3[]} [derivatives] The array of derivative values at the provided time.\n */\nSampledPositionProperty.prototype.addSample = function (\n  time,\n  position,\n  derivatives\n) {\n  const numberOfDerivatives = this._numberOfDerivatives;\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    numberOfDerivatives > 0 &&\n    (!defined(derivatives) || derivatives.length !== numberOfDerivatives)\n  ) {\n    throw new DeveloperError(\n      \"derivatives length must be equal to the number of derivatives.\"\n    );\n  }\n  //>>includeEnd('debug');\n  this._property.addSample(time, position, derivatives);\n};\n\n/**\n * Adds multiple samples via parallel arrays.\n *\n * @param {JulianDate[]} times An array of JulianDate instances where each index is a sample time.\n * @param {Cartesian3[]} positions An array of Cartesian3 position instances, where each value corresponds to the provided time index.\n * @param {Array[]} [derivatives] An array where each value is another array containing derivatives for the corresponding time index.\n *\n * @exception {DeveloperError} All arrays must be the same length.\n */\nSampledPositionProperty.prototype.addSamples = function (\n  times,\n  positions,\n  derivatives\n) {\n  this._property.addSamples(times, positions, derivatives);\n};\n\n/**\n * Adds samples as a single packed array where each new sample is represented as a date,\n * followed by the packed representation of the corresponding value and derivatives.\n *\n * @param {number[]} packedSamples The array of packed samples.\n * @param {JulianDate} [epoch] If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds.\n */\nSampledPositionProperty.prototype.addSamplesPackedArray = function (\n  packedSamples,\n  epoch\n) {\n  this._property.addSamplesPackedArray(packedSamples, epoch);\n};\n\n/**\n * Removes a sample at the given time, if present.\n *\n * @param {JulianDate} time The sample time.\n * @returns {boolean} <code>true</code> if a sample at time was removed, <code>false</code> otherwise.\n */\nSampledPositionProperty.prototype.removeSample = function (time) {\n  return this._property.removeSample(time);\n};\n\n/**\n * Removes all samples for the given time interval.\n *\n * @param {TimeInterval} time The time interval for which to remove all samples.\n */\nSampledPositionProperty.prototype.removeSamples = function (timeInterval) {\n  this._property.removeSamples(timeInterval);\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nSampledPositionProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof SampledPositionProperty &&\n      Property.equals(this._property, other._property) && //\n      this._referenceFrame === other._referenceFrame)\n  );\n};\nexport default SampledPositionProperty;\n", "/**\n * Defined the orientation of stripes in {@link StripeMaterialProperty}.\n *\n * @enum {number}\n */\nconst StripeOrientation = {\n  /**\n   * Horizontal orientation.\n   * @type {number}\n   */\n  HORIZONTAL: 0,\n\n  /**\n   * Vertical orientation.\n   * @type {number}\n   */\n  VERTICAL: 1,\n};\nexport default Object.freeze(StripeOrientation);\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\nimport StripeOrientation from \"./StripeOrientation.js\";\n\nconst defaultOrientation = StripeOrientation.HORIZONTAL;\nconst defaultEvenColor = Color.WHITE;\nconst defaultOddColor = Color.BLACK;\nconst defaultOffset = 0;\nconst defaultRepeat = 1;\n\n/**\n * A {@link MaterialProperty} that maps to stripe {@link Material} uniforms.\n * @alias StripeMaterialProperty\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Property|StripeOrientation} [options.orientation=StripeOrientation.HORIZONTAL] A Property specifying the {@link StripeOrientation}.\n * @param {Property|Color} [options.evenColor=Color.WHITE] A Property specifying the first {@link Color}.\n * @param {Property|Color} [options.oddColor=Color.BLACK] A Property specifying the second {@link Color}.\n * @param {Property|number} [options.offset=0] A numeric Property specifying how far into the pattern to start the material.\n * @param {Property|number} [options.repeat=1] A numeric Property specifying how many times the stripes repeat.\n */\nfunction StripeMaterialProperty(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._definitionChanged = new Event();\n  this._orientation = undefined;\n  this._orientationSubscription = undefined;\n  this._evenColor = undefined;\n  this._evenColorSubscription = undefined;\n  this._oddColor = undefined;\n  this._oddColorSubscription = undefined;\n  this._offset = undefined;\n  this._offsetSubscription = undefined;\n  this._repeat = undefined;\n  this._repeatSubscription = undefined;\n\n  this.orientation = options.orientation;\n  this.evenColor = options.evenColor;\n  this.oddColor = options.oddColor;\n  this.offset = options.offset;\n  this.repeat = options.repeat;\n}\n\nObject.defineProperties(StripeMaterialProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof StripeMaterialProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return (\n        Property.isConstant(this._orientation) && //\n        Property.isConstant(this._evenColor) && //\n        Property.isConstant(this._oddColor) && //\n        Property.isConstant(this._offset) && //\n        Property.isConstant(this._repeat)\n      );\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof StripeMaterialProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n\n  /**\n   * Gets or sets the Property specifying the {@link StripeOrientation}/\n   * @memberof StripeMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default StripeOrientation.HORIZONTAL\n   */\n  orientation: createPropertyDescriptor(\"orientation\"),\n\n  /**\n   * Gets or sets the Property specifying the first {@link Color}.\n   * @memberof StripeMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default Color.WHITE\n   */\n  evenColor: createPropertyDescriptor(\"evenColor\"),\n\n  /**\n   * Gets or sets the Property specifying the second {@link Color}.\n   * @memberof StripeMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default Color.BLACK\n   */\n  oddColor: createPropertyDescriptor(\"oddColor\"),\n\n  /**\n   * Gets or sets the numeric Property specifying the point into the pattern\n   * to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning\n   * of the odd color, 2.0 being the even color again, and any multiple or fractional values\n   * being in between.\n   * @memberof StripeMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default 0.0\n   */\n  offset: createPropertyDescriptor(\"offset\"),\n\n  /**\n   * Gets or sets the numeric Property specifying how many times the stripes repeat.\n   * @memberof StripeMaterialProperty.prototype\n   * @type {Property|undefined}\n   * @default 1.0\n   */\n  repeat: createPropertyDescriptor(\"repeat\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {string} The type of material.\n */\nStripeMaterialProperty.prototype.getType = function (time) {\n  return \"Stripe\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nStripeMaterialProperty.prototype.getValue = function (time, result) {\n  if (!defined(result)) {\n    result = {};\n  }\n  result.horizontal =\n    Property.getValueOrDefault(this._orientation, time, defaultOrientation) ===\n    StripeOrientation.HORIZONTAL;\n  result.evenColor = Property.getValueOrClonedDefault(\n    this._evenColor,\n    time,\n    defaultEvenColor,\n    result.evenColor\n  );\n  result.oddColor = Property.getValueOrClonedDefault(\n    this._oddColor,\n    time,\n    defaultOddColor,\n    result.oddColor\n  );\n  result.offset = Property.getValueOrDefault(this._offset, time, defaultOffset);\n  result.repeat = Property.getValueOrDefault(this._repeat, time, defaultRepeat);\n  return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nStripeMaterialProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof StripeMaterialProperty && //\n      Property.equals(this._orientation, other._orientation) && //\n      Property.equals(this._evenColor, other._evenColor) && //\n      Property.equals(this._oddColor, other._oddColor) && //\n      Property.equals(this._offset, other._offset) && //\n      Property.equals(this._repeat, other._repeat))\n  );\n};\nexport default StripeMaterialProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport TimeIntervalCollection from \"../Core/TimeIntervalCollection.js\";\nimport PositionProperty from \"./PositionProperty.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link TimeIntervalCollectionProperty} which is also a {@link PositionProperty}.\n *\n * @alias TimeIntervalCollectionPositionProperty\n * @constructor\n *\n * @param {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined.\n */\nfunction TimeIntervalCollectionPositionProperty(referenceFrame) {\n  this._definitionChanged = new Event();\n  this._intervals = new TimeIntervalCollection();\n  this._intervals.changedEvent.addEventListener(\n    TimeIntervalCollectionPositionProperty.prototype._intervalsChanged,\n    this\n  );\n  this._referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED);\n}\n\nObject.defineProperties(TimeIntervalCollectionPositionProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof TimeIntervalCollectionPositionProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return this._intervals.isEmpty;\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is considered to have changed if a call to getValue would return\n   * a different result for the same time.\n   * @memberof TimeIntervalCollectionPositionProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets the interval collection.\n   * @memberof TimeIntervalCollectionPositionProperty.prototype\n   * @type {TimeIntervalCollection}\n   * @readonly\n   */\n  intervals: {\n    get: function () {\n      return this._intervals;\n    },\n  },\n  /**\n   * Gets the reference frame in which the position is defined.\n   * @memberof TimeIntervalCollectionPositionProperty.prototype\n   * @type {ReferenceFrame}\n   * @readonly\n   * @default ReferenceFrame.FIXED;\n   */\n  referenceFrame: {\n    get: function () {\n      return this._referenceFrame;\n    },\n  },\n});\n\n/**\n * Gets the value of the property at the provided time in the fixed frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nTimeIntervalCollectionPositionProperty.prototype.getValue = function (\n  time,\n  result\n) {\n  return this.getValueInReferenceFrame(time, ReferenceFrame.FIXED, result);\n};\n\n/**\n * Gets the value of the property at the provided time and in the provided reference frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nTimeIntervalCollectionPositionProperty.prototype.getValueInReferenceFrame = function (\n  time,\n  referenceFrame,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required.\");\n  }\n  if (!defined(referenceFrame)) {\n    throw new DeveloperError(\"referenceFrame is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const position = this._intervals.findDataForIntervalContainingDate(time);\n  if (defined(position)) {\n    return PositionProperty.convertToReferenceFrame(\n      time,\n      position,\n      this._referenceFrame,\n      referenceFrame,\n      result\n    );\n  }\n  return undefined;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nTimeIntervalCollectionPositionProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof TimeIntervalCollectionPositionProperty && //\n      this._intervals.equals(other._intervals, Property.equals) && //\n      this._referenceFrame === other._referenceFrame)\n  );\n};\n\n/**\n * @private\n */\nTimeIntervalCollectionPositionProperty.prototype._intervalsChanged = function () {\n  this._definitionChanged.raiseEvent(this);\n};\nexport default TimeIntervalCollectionPositionProperty;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport TimeIntervalCollection from \"../Core/TimeIntervalCollection.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the\n * data property of each {@link TimeInterval} represents the value at time.\n *\n * @alias TimeIntervalCollectionProperty\n * @constructor\n *\n * @example\n * //Create a Cartesian2 interval property which contains data on August 1st, 2012\n * //and uses a different value every 6 hours.\n * const composite = new Cesium.TimeIntervalCollectionProperty();\n * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({\n *     iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T06:00:00.00Z',\n *     isStartIncluded : true,\n *     isStopIncluded : false,\n *     data : new Cesium.Cartesian2(2.0, 3.4)\n * }));\n * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({\n *     iso8601 : '2012-08-01T06:00:00.00Z/2012-08-01T12:00:00.00Z',\n *     isStartIncluded : true,\n *     isStopIncluded : false,\n *     data : new Cesium.Cartesian2(12.0, 2.7)\n * }));\n * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({\n *     iso8601 : '2012-08-01T12:00:00.00Z/2012-08-01T18:00:00.00Z',\n *     isStartIncluded : true,\n *     isStopIncluded : false,\n *     data : new Cesium.Cartesian2(5.0, 12.4)\n * }));\n * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({\n *     iso8601 : '2012-08-01T18:00:00.00Z/2012-08-02T00:00:00.00Z',\n *     isStartIncluded : true,\n *     isStopIncluded : true,\n *     data : new Cesium.Cartesian2(85.0, 4.1)\n * }));\n */\nfunction TimeIntervalCollectionProperty() {\n  this._definitionChanged = new Event();\n  this._intervals = new TimeIntervalCollection();\n  this._intervals.changedEvent.addEventListener(\n    TimeIntervalCollectionProperty.prototype._intervalsChanged,\n    this\n  );\n}\n\nObject.defineProperties(TimeIntervalCollectionProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.  A property is considered\n   * constant if getValue always returns the same result for the current definition.\n   * @memberof TimeIntervalCollectionProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return this._intervals.isEmpty;\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * The definition is changed whenever setValue is called with data different\n   * than the current value.\n   * @memberof TimeIntervalCollectionProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets the interval collection.\n   * @memberof TimeIntervalCollectionProperty.prototype\n   *\n   * @type {TimeIntervalCollection}\n   * @readonly\n   */\n  intervals: {\n    get: function () {\n      return this._intervals;\n    },\n  },\n});\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nTimeIntervalCollectionProperty.prototype.getValue = function (time, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required\");\n  }\n  //>>includeEnd('debug');\n\n  const value = this._intervals.findDataForIntervalContainingDate(time);\n  if (defined(value) && typeof value.clone === \"function\") {\n    return value.clone(result);\n  }\n  return value;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nTimeIntervalCollectionProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof TimeIntervalCollectionProperty && //\n      this._intervals.equals(other._intervals, Property.equals))\n  );\n};\n\n/**\n * @private\n */\nTimeIntervalCollectionProperty.prototype._intervalsChanged = function () {\n  this._definitionChanged.raiseEvent(this);\n};\nexport default TimeIntervalCollectionProperty;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link Property} which evaluates to a {@link Cartesian3} vector\n * based on the velocity of the provided {@link PositionProperty}.\n *\n * @alias VelocityVectorProperty\n * @constructor\n *\n * @param {PositionProperty} [position] The position property used to compute the velocity.\n * @param {boolean} [normalize=true] Whether to normalize the computed velocity vector.\n *\n * @example\n * //Create an entity with a billboard rotated to match its velocity.\n * const position = new Cesium.SampledProperty();\n * position.addSamples(...);\n * const entity = viewer.entities.add({\n *   position : position,\n *   billboard : {\n *     image : 'image.png',\n *     alignedAxis : new Cesium.VelocityVectorProperty(position, true) // alignedAxis must be a unit vector\n *   }\n * }));\n */\nfunction VelocityVectorProperty(position, normalize) {\n  this._position = undefined;\n  this._subscription = undefined;\n  this._definitionChanged = new Event();\n  this._normalize = defaultValue(normalize, true);\n\n  this.position = position;\n}\n\nObject.defineProperties(VelocityVectorProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.\n   * @memberof VelocityVectorProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return Property.isConstant(this._position);\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * @memberof VelocityVectorProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets or sets the position property used to compute the velocity vector.\n   * @memberof VelocityVectorProperty.prototype\n   *\n   * @type {Property|undefined}\n   */\n  position: {\n    get: function () {\n      return this._position;\n    },\n    set: function (value) {\n      const oldValue = this._position;\n      if (oldValue !== value) {\n        if (defined(oldValue)) {\n          this._subscription();\n        }\n\n        this._position = value;\n\n        if (defined(value)) {\n          this._subscription = value._definitionChanged.addEventListener(\n            function () {\n              this._definitionChanged.raiseEvent(this);\n            },\n            this\n          );\n        }\n\n        this._definitionChanged.raiseEvent(this);\n      }\n    },\n  },\n  /**\n   * Gets or sets whether the vector produced by this property\n   * will be normalized or not.\n   * @memberof VelocityVectorProperty.prototype\n   *\n   * @type {boolean}\n   */\n  normalize: {\n    get: function () {\n      return this._normalize;\n    },\n    set: function (value) {\n      if (this._normalize === value) {\n        return;\n      }\n\n      this._normalize = value;\n      this._definitionChanged.raiseEvent(this);\n    },\n  },\n});\n\nconst position1Scratch = new Cartesian3();\nconst position2Scratch = new Cartesian3();\nconst timeScratch = new JulianDate();\nconst step = 1.0 / 60.0;\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} [time] The time for which to retrieve the value.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nVelocityVectorProperty.prototype.getValue = function (time, result) {\n  return this._getValue(time, result);\n};\n\n/**\n * @private\n */\nVelocityVectorProperty.prototype._getValue = function (\n  time,\n  velocityResult,\n  positionResult\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(velocityResult)) {\n    velocityResult = new Cartesian3();\n  }\n\n  const property = this._position;\n  if (Property.isConstant(property)) {\n    return this._normalize\n      ? undefined\n      : Cartesian3.clone(Cartesian3.ZERO, velocityResult);\n  }\n\n  let position1 = property.getValue(time, position1Scratch);\n  let position2 = property.getValue(\n    JulianDate.addSeconds(time, step, timeScratch),\n    position2Scratch\n  );\n\n  //If we don't have a position for now, return undefined.\n  if (!defined(position1)) {\n    return undefined;\n  }\n\n  //If we don't have a position for now + step, see if we have a position for now - step.\n  if (!defined(position2)) {\n    position2 = position1;\n    position1 = property.getValue(\n      JulianDate.addSeconds(time, -step, timeScratch),\n      position2Scratch\n    );\n\n    if (!defined(position1)) {\n      return undefined;\n    }\n  }\n\n  if (Cartesian3.equals(position1, position2)) {\n    return this._normalize\n      ? undefined\n      : Cartesian3.clone(Cartesian3.ZERO, velocityResult);\n  }\n\n  if (defined(positionResult)) {\n    position1.clone(positionResult);\n  }\n\n  const velocity = Cartesian3.subtract(position2, position1, velocityResult);\n  if (this._normalize) {\n    return Cartesian3.normalize(velocity, velocityResult);\n  }\n\n  return Cartesian3.divideByScalar(velocity, step, velocityResult);\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nVelocityVectorProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof VelocityVectorProperty &&\n      Property.equals(this._position, other._position))\n  );\n};\nexport default VelocityVectorProperty;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Event from \"../Core/Event.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport Property from \"./Property.js\";\nimport VelocityVectorProperty from \"./VelocityVectorProperty.js\";\n\n/**\n * A {@link Property} which evaluates to a {@link Quaternion} rotation\n * based on the velocity of the provided {@link PositionProperty}.\n *\n * @alias VelocityOrientationProperty\n * @constructor\n *\n * @param {PositionProperty} [position] The position property used to compute the orientation.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid used to determine which way is up.\n *\n * @example\n * //Create an entity with position and orientation.\n * const position = new Cesium.SampledProperty();\n * position.addSamples(...);\n * const entity = viewer.entities.add({\n *   position : position,\n *   orientation : new Cesium.VelocityOrientationProperty(position)\n * }));\n */\nfunction VelocityOrientationProperty(position, ellipsoid) {\n  this._velocityVectorProperty = new VelocityVectorProperty(position, true);\n  this._subscription = undefined;\n  this._ellipsoid = undefined;\n  this._definitionChanged = new Event();\n\n  this.ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n  const that = this;\n  this._velocityVectorProperty.definitionChanged.addEventListener(function () {\n    that._definitionChanged.raiseEvent(that);\n  });\n}\n\nObject.defineProperties(VelocityOrientationProperty.prototype, {\n  /**\n   * Gets a value indicating if this property is constant.\n   * @memberof VelocityOrientationProperty.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isConstant: {\n    get: function () {\n      return Property.isConstant(this._velocityVectorProperty);\n    },\n  },\n  /**\n   * Gets the event that is raised whenever the definition of this property changes.\n   * @memberof VelocityOrientationProperty.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  /**\n   * Gets or sets the position property used to compute orientation.\n   * @memberof VelocityOrientationProperty.prototype\n   *\n   * @type {Property|undefined}\n   */\n  position: {\n    get: function () {\n      return this._velocityVectorProperty.position;\n    },\n    set: function (value) {\n      this._velocityVectorProperty.position = value;\n    },\n  },\n  /**\n   * Gets or sets the ellipsoid used to determine which way is up.\n   * @memberof VelocityOrientationProperty.prototype\n   *\n   * @type {Property|undefined}\n   */\n  ellipsoid: {\n    get: function () {\n      return this._ellipsoid;\n    },\n    set: function (value) {\n      const oldValue = this._ellipsoid;\n      if (oldValue !== value) {\n        this._ellipsoid = value;\n        this._definitionChanged.raiseEvent(this);\n      }\n    },\n  },\n});\n\nconst positionScratch = new Cartesian3();\nconst velocityScratch = new Cartesian3();\nconst rotationScratch = new Matrix3();\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} [time] The time for which to retrieve the value.\n * @param {Quaternion} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Quaternion} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nVelocityOrientationProperty.prototype.getValue = function (time, result) {\n  const velocity = this._velocityVectorProperty._getValue(\n    time,\n    velocityScratch,\n    positionScratch\n  );\n\n  if (!defined(velocity)) {\n    return undefined;\n  }\n\n  Transforms.rotationMatrixFromPositionVelocity(\n    positionScratch,\n    velocity,\n    this._ellipsoid,\n    rotationScratch\n  );\n  return Quaternion.fromRotationMatrix(rotationScratch, result);\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nVelocityOrientationProperty.prototype.equals = function (other) {\n  return (\n    this === other || //\n    (other instanceof VelocityOrientationProperty &&\n      Property.equals(\n        this._velocityVectorProperty,\n        other._velocityVectorProperty\n      ) &&\n      (this._ellipsoid === other._ellipsoid ||\n        this._ellipsoid.equals(other._ellipsoid)))\n  );\n};\nexport default VelocityOrientationProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport CesiumMath from \"../Core/Math.js\";\n\n/**\n * A collection of {@link DataSource} instances.\n * @alias DataSourceCollection\n * @constructor\n */\nfunction DataSourceCollection() {\n  this._dataSources = [];\n  this._dataSourceAdded = new Event();\n  this._dataSourceRemoved = new Event();\n  this._dataSourceMoved = new Event();\n}\n\nObject.defineProperties(DataSourceCollection.prototype, {\n  /**\n   * Gets the number of data sources in this collection.\n   * @memberof DataSourceCollection.prototype\n   * @type {number}\n   * @readonly\n   */\n  length: {\n    get: function () {\n      return this._dataSources.length;\n    },\n  },\n\n  /**\n   * An event that is raised when a data source is added to the collection.\n   * Event handlers are passed the data source that was added.\n   * @memberof DataSourceCollection.prototype\n   * @type {Event}\n   * @readonly\n   */\n  dataSourceAdded: {\n    get: function () {\n      return this._dataSourceAdded;\n    },\n  },\n\n  /**\n   * An event that is raised when a data source is removed from the collection.\n   * Event handlers are passed the data source that was removed.\n   * @memberof DataSourceCollection.prototype\n   * @type {Event}\n   * @readonly\n   */\n  dataSourceRemoved: {\n    get: function () {\n      return this._dataSourceRemoved;\n    },\n  },\n\n  /**\n   * An event that is raised when a data source changes position in the collection.  Event handlers are passed the data source\n   * that was moved, its new index after the move, and its old index prior to the move.\n   * @memberof DataSourceCollection.prototype\n   * @type {Event}\n   * @readonly\n   */\n  dataSourceMoved: {\n    get: function () {\n      return this._dataSourceMoved;\n    },\n  },\n});\n\n/**\n * Adds a data source to the collection.\n *\n * @param {DataSource|Promise<DataSource>} dataSource A data source or a promise to a data source to add to the collection.\n *                                        When passing a promise, the data source will not actually be added\n *                                        to the collection until the promise resolves successfully.\n * @returns {Promise<DataSource>} A Promise that resolves once the data source has been added to the collection.\n */\nDataSourceCollection.prototype.add = function (dataSource) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(dataSource)) {\n    throw new DeveloperError(\"dataSource is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const that = this;\n  const dataSources = this._dataSources;\n  return Promise.resolve(dataSource).then(function (value) {\n    //Only add the data source if removeAll has not been called\n    //Since it was added.\n    if (dataSources === that._dataSources) {\n      that._dataSources.push(value);\n      that._dataSourceAdded.raiseEvent(that, value);\n    }\n    return value;\n  });\n};\n\n/**\n * Removes a data source from this collection, if present.\n *\n * @param {DataSource} dataSource The data source to remove.\n * @param {boolean} [destroy=false] Whether to destroy the data source in addition to removing it.\n * @returns {boolean} true if the data source was in the collection and was removed,\n *                    false if the data source was not in the collection.\n */\nDataSourceCollection.prototype.remove = function (dataSource, destroy) {\n  destroy = defaultValue(destroy, false);\n\n  const index = this._dataSources.indexOf(dataSource);\n  if (index !== -1) {\n    this._dataSources.splice(index, 1);\n    this._dataSourceRemoved.raiseEvent(this, dataSource);\n\n    if (destroy && typeof dataSource.destroy === \"function\") {\n      dataSource.destroy();\n    }\n\n    return true;\n  }\n\n  return false;\n};\n\n/**\n * Removes all data sources from this collection.\n *\n * @param {boolean} [destroy=false] whether to destroy the data sources in addition to removing them.\n */\nDataSourceCollection.prototype.removeAll = function (destroy) {\n  destroy = defaultValue(destroy, false);\n\n  const dataSources = this._dataSources;\n  for (let i = 0, len = dataSources.length; i < len; ++i) {\n    const dataSource = dataSources[i];\n    this._dataSourceRemoved.raiseEvent(this, dataSource);\n\n    if (destroy && typeof dataSource.destroy === \"function\") {\n      dataSource.destroy();\n    }\n  }\n  this._dataSources = [];\n};\n\n/**\n * Checks to see if the collection contains a given data source.\n *\n * @param {DataSource} dataSource The data source to check for.\n * @returns {boolean} true if the collection contains the data source, false otherwise.\n */\nDataSourceCollection.prototype.contains = function (dataSource) {\n  return this.indexOf(dataSource) !== -1;\n};\n\n/**\n * Determines the index of a given data source in the collection.\n *\n * @param {DataSource} dataSource The data source to find the index of.\n * @returns {number} The index of the data source in the collection, or -1 if the data source does not exist in the collection.\n */\nDataSourceCollection.prototype.indexOf = function (dataSource) {\n  return this._dataSources.indexOf(dataSource);\n};\n\n/**\n * Gets a data source by index from the collection.\n *\n * @param {number} index the index to retrieve.\n * @returns {DataSource} The data source at the specified index.\n */\nDataSourceCollection.prototype.get = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(index)) {\n    throw new DeveloperError(\"index is required.\");\n  }\n  //>>includeEnd('debug');\n\n  return this._dataSources[index];\n};\n\n/**\n * Gets a data source by name from the collection.\n *\n * @param {string} name The name to retrieve.\n * @returns {DataSource[]} A list of all data sources matching the provided name.\n */\nDataSourceCollection.prototype.getByName = function (name) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(name)) {\n    throw new DeveloperError(\"name is required.\");\n  }\n  //>>includeEnd('debug');\n\n  return this._dataSources.filter(function (dataSource) {\n    return dataSource.name === name;\n  });\n};\n\nfunction getIndex(dataSources, dataSource) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(dataSource)) {\n    throw new DeveloperError(\"dataSource is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const index = dataSources.indexOf(dataSource);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (index === -1) {\n    throw new DeveloperError(\"dataSource is not in this collection.\");\n  }\n  //>>includeEnd('debug');\n\n  return index;\n}\n\nfunction swapDataSources(collection, i, j) {\n  const arr = collection._dataSources;\n  const length = arr.length - 1;\n  i = CesiumMath.clamp(i, 0, length);\n  j = CesiumMath.clamp(j, 0, length);\n\n  if (i === j) {\n    return;\n  }\n\n  const temp = arr[i];\n  arr[i] = arr[j];\n  arr[j] = temp;\n\n  collection.dataSourceMoved.raiseEvent(temp, j, i);\n}\n\n/**\n * Raises a data source up one position in the collection.\n *\n * @param {DataSource} dataSource The data source to move.\n *\n * @exception {DeveloperError} dataSource is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nDataSourceCollection.prototype.raise = function (dataSource) {\n  const index = getIndex(this._dataSources, dataSource);\n  swapDataSources(this, index, index + 1);\n};\n\n/**\n * Lowers a data source down one position in the collection.\n *\n * @param {DataSource} dataSource The data source to move.\n *\n * @exception {DeveloperError} dataSource is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nDataSourceCollection.prototype.lower = function (dataSource) {\n  const index = getIndex(this._dataSources, dataSource);\n  swapDataSources(this, index, index - 1);\n};\n\n/**\n * Raises a data source to the top of the collection.\n *\n * @param {DataSource} dataSource The data source to move.\n *\n * @exception {DeveloperError} dataSource is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nDataSourceCollection.prototype.raiseToTop = function (dataSource) {\n  const index = getIndex(this._dataSources, dataSource);\n  if (index === this._dataSources.length - 1) {\n    return;\n  }\n  this._dataSources.splice(index, 1);\n  this._dataSources.push(dataSource);\n\n  this.dataSourceMoved.raiseEvent(\n    dataSource,\n    this._dataSources.length - 1,\n    index\n  );\n};\n\n/**\n * Lowers a data source to the bottom of the collection.\n *\n * @param {DataSource} dataSource The data source to move.\n *\n * @exception {DeveloperError} dataSource is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nDataSourceCollection.prototype.lowerToBottom = function (dataSource) {\n  const index = getIndex(this._dataSources, dataSource);\n  if (index === 0) {\n    return;\n  }\n  this._dataSources.splice(index, 1);\n  this._dataSources.splice(0, 0, dataSource);\n\n  this.dataSourceMoved.raiseEvent(dataSource, 0, index);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} true if this object was destroyed; otherwise, false.\n *\n * @see DataSourceCollection#destroy\n */\nDataSourceCollection.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the resources held by all data sources in this collection.  Explicitly destroying this\n * object allows for deterministic release of WebGL resources, instead of relying on the garbage\n * collector. Once this object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * dataSourceCollection = dataSourceCollection && dataSourceCollection.destroy();\n *\n * @see DataSourceCollection#isDestroyed\n */\nDataSourceCollection.prototype.destroy = function () {\n  this.removeAll(true);\n  return destroyObject(this);\n};\nexport default DataSourceCollection;\n", "import createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\n\n/**\n * A collection of primitives.  This is most often used with {@link Scene#primitives},\n * but <code>PrimitiveCollection</code> is also a primitive itself so collections can\n * be added to collections forming a hierarchy.\n *\n * @alias PrimitiveCollection\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {boolean} [options.show=true] Determines if the primitives in the collection will be shown.\n * @param {boolean} [options.destroyPrimitives=true] Determines if primitives in the collection are destroyed when they are removed.\n *\n * @example\n * const billboards = new Cesium.BillboardCollection();\n * const labels = new Cesium.LabelCollection();\n *\n * const collection = new Cesium.PrimitiveCollection();\n * collection.add(billboards);\n *\n * scene.primitives.add(collection);  // Add collection\n * scene.primitives.add(labels);      // Add regular primitive\n */\nfunction PrimitiveCollection(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._primitives = [];\n  this._guid = createGuid();\n  this._primitiveAdded = new Event();\n  this._primitiveRemoved = new Event();\n\n  // Used by the OrderedGroundPrimitiveCollection\n  this._zIndex = undefined;\n\n  /**\n   * Determines if primitives in this collection will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  /**\n   * Determines if primitives in the collection are destroyed when they are removed by\n   * {@link PrimitiveCollection#destroy} or  {@link PrimitiveCollection#remove} or implicitly\n   * by {@link PrimitiveCollection#removeAll}.\n   *\n   * @type {boolean}\n   * @default true\n   *\n   * @example\n   * // Example 1. Primitives are destroyed by default.\n   * const primitives = new Cesium.PrimitiveCollection();\n   * const labels = primitives.add(new Cesium.LabelCollection());\n   * primitives = primitives.destroy();\n   * const b = labels.isDestroyed(); // true\n   *\n   * @example\n   * // Example 2. Do not destroy primitives in a collection.\n   * const primitives = new Cesium.PrimitiveCollection();\n   * primitives.destroyPrimitives = false;\n   * const labels = primitives.add(new Cesium.LabelCollection());\n   * primitives = primitives.destroy();\n   * const b = labels.isDestroyed(); // false\n   * labels = labels.destroy();    // explicitly destroy\n   */\n  this.destroyPrimitives = defaultValue(options.destroyPrimitives, true);\n}\n\nObject.defineProperties(PrimitiveCollection.prototype, {\n  /**\n   * Gets the number of primitives in the collection.\n   *\n   * @memberof PrimitiveCollection.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  length: {\n    get: function () {\n      return this._primitives.length;\n    },\n  },\n\n  /**\n   * An event that is raised when a primitive is added to the collection.\n   * Event handlers are passed the primitive that was added.\n   * @memberof PrimitiveCollection.prototype\n   * @type {Event}\n   * @readonly\n   */\n  primitiveAdded: {\n    get: function () {\n      return this._primitiveAdded;\n    },\n  },\n\n  /**\n   * An event that is raised when a primitive is removed from the collection.\n   * Event handlers are passed the primitive that was removed.\n   * <p>\n   * Note: Depending on the destroyPrimitives constructor option, the primitive may already be destroyed.\n   * </p>\n   * @memberof PrimitiveCollection.prototype\n   * @type {Event}\n   * @readonly\n   */\n  primitiveRemoved: {\n    get: function () {\n      return this._primitiveRemoved;\n    },\n  },\n});\n\n/**\n * Adds a primitive to the collection.\n *\n * @param {object} primitive The primitive to add.\n * @param {number} [index] The index to add the layer at.  If omitted, the primitive will be added at the bottom of all existing primitives.\n * @returns {object} The primitive added to the collection.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * const billboards = scene.primitives.add(new Cesium.BillboardCollection());\n */\nPrimitiveCollection.prototype.add = function (primitive, index) {\n  const hasIndex = defined(index);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(primitive)) {\n    throw new DeveloperError(\"primitive is required.\");\n  }\n  if (hasIndex) {\n    if (index < 0) {\n      throw new DeveloperError(\"index must be greater than or equal to zero.\");\n    } else if (index > this._primitives.length) {\n      throw new DeveloperError(\n        \"index must be less than or equal to the number of primitives.\"\n      );\n    }\n  }\n  //>>includeEnd('debug');\n\n  const external = (primitive._external = primitive._external || {});\n  const composites = (external._composites = external._composites || {});\n  composites[this._guid] = {\n    collection: this,\n  };\n\n  if (!hasIndex) {\n    this._primitives.push(primitive);\n  } else {\n    this._primitives.splice(index, 0, primitive);\n  }\n\n  this._primitiveAdded.raiseEvent(primitive);\n\n  return primitive;\n};\n\n/**\n * Removes a primitive from the collection.\n *\n * @param {object} [primitive] The primitive to remove.\n * @returns {boolean} <code>true</code> if the primitive was removed; <code>false</code> if the primitive is <code>undefined</code> or was not found in the collection.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * const billboards = scene.primitives.add(new Cesium.BillboardCollection());\n * scene.primitives.remove(billboards);  // Returns true\n *\n * @see PrimitiveCollection#destroyPrimitives\n */\nPrimitiveCollection.prototype.remove = function (primitive) {\n  // PERFORMANCE_IDEA:  We can obviously make this a lot faster.\n  if (this.contains(primitive)) {\n    const index = this._primitives.indexOf(primitive);\n    if (index !== -1) {\n      this._primitives.splice(index, 1);\n\n      delete primitive._external._composites[this._guid];\n\n      if (this.destroyPrimitives) {\n        primitive.destroy();\n      }\n\n      this._primitiveRemoved.raiseEvent(primitive);\n\n      return true;\n    }\n    // else ... this is not possible, I swear.\n  }\n\n  return false;\n};\n\n/**\n * Removes and destroys a primitive, regardless of destroyPrimitives setting.\n * @private\n */\nPrimitiveCollection.prototype.removeAndDestroy = function (primitive) {\n  const removed = this.remove(primitive);\n  if (removed && !this.destroyPrimitives) {\n    primitive.destroy();\n  }\n  return removed;\n};\n\n/**\n * Removes all primitives in the collection.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PrimitiveCollection#destroyPrimitives\n */\nPrimitiveCollection.prototype.removeAll = function () {\n  const primitives = this._primitives;\n  const length = primitives.length;\n  for (let i = 0; i < length; ++i) {\n    delete primitives[i]._external._composites[this._guid];\n\n    if (this.destroyPrimitives) {\n      primitives[i].destroy();\n    }\n\n    this._primitiveRemoved.raiseEvent(primitives[i]);\n  }\n  this._primitives = [];\n};\n\n/**\n * Determines if this collection contains a primitive.\n *\n * @param {object} [primitive] The primitive to check for.\n * @returns {boolean} <code>true</code> if the primitive is in the collection; <code>false</code> if the primitive is <code>undefined</code> or was not found in the collection.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PrimitiveCollection#get\n */\nPrimitiveCollection.prototype.contains = function (primitive) {\n  return !!(\n    defined(primitive) &&\n    primitive._external &&\n    primitive._external._composites &&\n    primitive._external._composites[this._guid]\n  );\n};\n\nfunction getPrimitiveIndex(compositePrimitive, primitive) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!compositePrimitive.contains(primitive)) {\n    throw new DeveloperError(\"primitive is not in this collection.\");\n  }\n  //>>includeEnd('debug');\n\n  return compositePrimitive._primitives.indexOf(primitive);\n}\n\n/**\n * Raises a primitive \"up one\" in the collection.  If all primitives in the collection are drawn\n * on the globe surface, this visually moves the primitive up one.\n *\n * @param {object} [primitive] The primitive to raise.\n *\n * @exception {DeveloperError} primitive is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PrimitiveCollection#raiseToTop\n * @see PrimitiveCollection#lower\n * @see PrimitiveCollection#lowerToBottom\n */\nPrimitiveCollection.prototype.raise = function (primitive) {\n  if (defined(primitive)) {\n    const index = getPrimitiveIndex(this, primitive);\n    const primitives = this._primitives;\n\n    if (index !== primitives.length - 1) {\n      const p = primitives[index];\n      primitives[index] = primitives[index + 1];\n      primitives[index + 1] = p;\n    }\n  }\n};\n\n/**\n * Raises a primitive to the \"top\" of the collection.  If all primitives in the collection are drawn\n * on the globe surface, this visually moves the primitive to the top.\n *\n * @param {object} [primitive] The primitive to raise the top.\n *\n * @exception {DeveloperError} primitive is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PrimitiveCollection#raise\n * @see PrimitiveCollection#lower\n * @see PrimitiveCollection#lowerToBottom\n */\nPrimitiveCollection.prototype.raiseToTop = function (primitive) {\n  if (defined(primitive)) {\n    const index = getPrimitiveIndex(this, primitive);\n    const primitives = this._primitives;\n\n    if (index !== primitives.length - 1) {\n      // PERFORMANCE_IDEA:  Could be faster\n      primitives.splice(index, 1);\n      primitives.push(primitive);\n    }\n  }\n};\n\n/**\n * Lowers a primitive \"down one\" in the collection.  If all primitives in the collection are drawn\n * on the globe surface, this visually moves the primitive down one.\n *\n * @param {object} [primitive] The primitive to lower.\n *\n * @exception {DeveloperError} primitive is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PrimitiveCollection#lowerToBottom\n * @see PrimitiveCollection#raise\n * @see PrimitiveCollection#raiseToTop\n */\nPrimitiveCollection.prototype.lower = function (primitive) {\n  if (defined(primitive)) {\n    const index = getPrimitiveIndex(this, primitive);\n    const primitives = this._primitives;\n\n    if (index !== 0) {\n      const p = primitives[index];\n      primitives[index] = primitives[index - 1];\n      primitives[index - 1] = p;\n    }\n  }\n};\n\n/**\n * Lowers a primitive to the \"bottom\" of the collection.  If all primitives in the collection are drawn\n * on the globe surface, this visually moves the primitive to the bottom.\n *\n * @param {object} [primitive] The primitive to lower to the bottom.\n *\n * @exception {DeveloperError} primitive is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PrimitiveCollection#lower\n * @see PrimitiveCollection#raise\n * @see PrimitiveCollection#raiseToTop\n */\nPrimitiveCollection.prototype.lowerToBottom = function (primitive) {\n  if (defined(primitive)) {\n    const index = getPrimitiveIndex(this, primitive);\n    const primitives = this._primitives;\n\n    if (index !== 0) {\n      // PERFORMANCE_IDEA:  Could be faster\n      primitives.splice(index, 1);\n      primitives.unshift(primitive);\n    }\n  }\n};\n\n/**\n * Returns the primitive in the collection at the specified index.\n *\n * @param {number} index The zero-based index of the primitive to return.\n * @returns {object} The primitive at the <code>index</code>.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Toggle the show property of every primitive in the collection.\n * const primitives = scene.primitives;\n * const length = primitives.length;\n * for (let i = 0; i < length; ++i) {\n *   const p = primitives.get(i);\n *   p.show = !p.show;\n * }\n *\n * @see PrimitiveCollection#length\n */\nPrimitiveCollection.prototype.get = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(index)) {\n    throw new DeveloperError(\"index is required.\");\n  }\n  //>>includeEnd('debug');\n\n  return this._primitives[index];\n};\n\n/**\n * @private\n */\nPrimitiveCollection.prototype.update = function (frameState) {\n  if (!this.show) {\n    return;\n  }\n\n  const primitives = this._primitives;\n  // Using primitives.length in the loop is a temporary workaround\n  // to allow quadtree updates to add and remove primitives in\n  // update().  This will be changed to manage added and removed lists.\n  for (let i = 0; i < primitives.length; ++i) {\n    primitives[i].update(frameState);\n  }\n};\n\n/**\n * @private\n */\nPrimitiveCollection.prototype.prePassesUpdate = function (frameState) {\n  const primitives = this._primitives;\n  // Using primitives.length in the loop is a temporary workaround\n  // to allow quadtree updates to add and remove primitives in\n  // update().  This will be changed to manage added and removed lists.\n  for (let i = 0; i < primitives.length; ++i) {\n    const primitive = primitives[i];\n    if (defined(primitive.prePassesUpdate)) {\n      primitive.prePassesUpdate(frameState);\n    }\n  }\n};\n\n/**\n * @private\n */\nPrimitiveCollection.prototype.updateForPass = function (frameState, passState) {\n  const primitives = this._primitives;\n  // Using primitives.length in the loop is a temporary workaround\n  // to allow quadtree updates to add and remove primitives in\n  // update().  This will be changed to manage added and removed lists.\n  for (let i = 0; i < primitives.length; ++i) {\n    const primitive = primitives[i];\n    if (defined(primitive.updateForPass)) {\n      primitive.updateForPass(frameState, passState);\n    }\n  }\n};\n\n/**\n * @private\n */\nPrimitiveCollection.prototype.postPassesUpdate = function (frameState) {\n  const primitives = this._primitives;\n  // Using primitives.length in the loop is a temporary workaround\n  // to allow quadtree updates to add and remove primitives in\n  // update().  This will be changed to manage added and removed lists.\n  for (let i = 0; i < primitives.length; ++i) {\n    const primitive = primitives[i];\n    if (defined(primitive.postPassesUpdate)) {\n      primitive.postPassesUpdate(frameState);\n    }\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see PrimitiveCollection#destroy\n */\nPrimitiveCollection.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by each primitive in this collection.  Explicitly destroying this\n * collection allows for deterministic release of WebGL resources, instead of relying on the garbage\n * collector to destroy this collection.\n * <br /><br />\n * Since destroying a collection destroys all the contained primitives, only destroy a collection\n * when you are sure no other code is still using any of the contained primitives.\n * <br /><br />\n * Once this collection is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * primitives = primitives && primitives.destroy();\n *\n * @see PrimitiveCollection#isDestroyed\n */\nPrimitiveCollection.prototype.destroy = function () {\n  this.removeAll();\n  return destroyObject(this);\n};\nexport default PrimitiveCollection;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport PrimitiveCollection from \"./PrimitiveCollection.js\";\n\n/**\n * A primitive collection for helping maintain the order or ground primitives based on a z-index\n *\n * @private\n */\nfunction OrderedGroundPrimitiveCollection() {\n  this._length = 0;\n  this._collections = {};\n  this._collectionsArray = [];\n\n  this.show = true;\n}\n\nObject.defineProperties(OrderedGroundPrimitiveCollection.prototype, {\n  /**\n   * Gets the number of primitives in the collection.\n   *\n   * @memberof OrderedGroundPrimitiveCollection.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  length: {\n    get: function () {\n      return this._length;\n    },\n  },\n});\n\n/**\n * Adds a primitive to the collection.\n *\n * @param {GroundPrimitive} primitive The primitive to add.\n * @param {number} [zIndex = 0] The index of the primitive\n * @returns {GroundPrimitive} The primitive added to the collection.\n */\nOrderedGroundPrimitiveCollection.prototype.add = function (primitive, zIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"primitive\", primitive);\n  if (defined(zIndex)) {\n    Check.typeOf.number(\"zIndex\", zIndex);\n  }\n  //>>includeEnd('debug');\n\n  zIndex = defaultValue(zIndex, 0);\n  let collection = this._collections[zIndex];\n  if (!defined(collection)) {\n    collection = new PrimitiveCollection({ destroyPrimitives: false });\n    collection._zIndex = zIndex;\n    this._collections[zIndex] = collection;\n    const array = this._collectionsArray;\n    let i = 0;\n    while (i < array.length && array[i]._zIndex < zIndex) {\n      i++;\n    }\n    array.splice(i, 0, collection);\n  }\n\n  collection.add(primitive);\n  this._length++;\n  primitive._zIndex = zIndex;\n\n  return primitive;\n};\n\n/**\n * Adjusts the z-index\n * @param {GroundPrimitive} primitive\n * @param {number} zIndex\n */\nOrderedGroundPrimitiveCollection.prototype.set = function (primitive, zIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"primitive\", primitive);\n  Check.typeOf.number(\"zIndex\", zIndex);\n  //>>includeEnd('debug');\n\n  if (zIndex === primitive._zIndex) {\n    return primitive;\n  }\n\n  this.remove(primitive, true);\n  this.add(primitive, zIndex);\n\n  return primitive;\n};\n\n/**\n * Removes a primitive from the collection.\n *\n * @param {object} primitive The primitive to remove.\n * @param {boolean} [doNotDestroy = false]\n * @returns {boolean} <code>true</code> if the primitive was removed; <code>false</code> if the primitive is <code>undefined</code> or was not found in the collection.\n */\nOrderedGroundPrimitiveCollection.prototype.remove = function (\n  primitive,\n  doNotDestroy\n) {\n  if (this.contains(primitive)) {\n    const index = primitive._zIndex;\n    const collection = this._collections[index];\n    let result;\n    if (doNotDestroy) {\n      result = collection.remove(primitive);\n    } else {\n      result = collection.removeAndDestroy(primitive);\n    }\n\n    if (result) {\n      this._length--;\n    }\n\n    if (collection.length === 0) {\n      this._collectionsArray.splice(\n        this._collectionsArray.indexOf(collection),\n        1\n      );\n      this._collections[index] = undefined;\n      collection.destroy();\n    }\n\n    return result;\n  }\n\n  return false;\n};\n\n/**\n * Removes all primitives in the collection.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see OrderedGroundPrimitiveCollection#destroyPrimitives\n */\nOrderedGroundPrimitiveCollection.prototype.removeAll = function () {\n  const collections = this._collectionsArray;\n  for (let i = 0; i < collections.length; i++) {\n    const collection = collections[i];\n    collection.destroyPrimitives = true;\n    collection.destroy();\n  }\n\n  this._collections = {};\n  this._collectionsArray = [];\n  this._length = 0;\n};\n\n/**\n * Determines if this collection contains a primitive.\n *\n * @param {object} primitive The primitive to check for.\n * @returns {boolean} <code>true</code> if the primitive is in the collection; <code>false</code> if the primitive is <code>undefined</code> or was not found in the collection.\n */\nOrderedGroundPrimitiveCollection.prototype.contains = function (primitive) {\n  if (!defined(primitive)) {\n    return false;\n  }\n  const collection = this._collections[primitive._zIndex];\n  return defined(collection) && collection.contains(primitive);\n};\n\n/**\n * @private\n */\nOrderedGroundPrimitiveCollection.prototype.update = function (frameState) {\n  if (!this.show) {\n    return;\n  }\n\n  const collections = this._collectionsArray;\n  for (let i = 0; i < collections.length; i++) {\n    collections[i].update(frameState);\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see OrderedGroundPrimitiveCollection#destroy\n */\nOrderedGroundPrimitiveCollection.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by each primitive in this collection.  Explicitly destroying this\n * collection allows for deterministic release of WebGL resources, instead of relying on the garbage\n * collector to destroy this collection.\n * <br /><br />\n * Since destroying a collection destroys all the contained primitives, only destroy a collection\n * when you are sure no other code is still using any of the contained primitives.\n * <br /><br />\n * Once this collection is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * primitives = primitives && primitives.destroy();\n *\n * @see OrderedGroundPrimitiveCollection#isDestroyed\n */\nOrderedGroundPrimitiveCollection.prototype.destroy = function () {\n  this.removeAll();\n  return destroyObject(this);\n};\nexport default OrderedGroundPrimitiveCollection;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport defined from \"../Core/defined.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\n\n/**\n * @private\n */\nfunction DynamicGeometryBatch(primitives, orderedGroundPrimitives) {\n  this._primitives = primitives;\n  this._orderedGroundPrimitives = orderedGroundPrimitives;\n  this._dynamicUpdaters = new AssociativeArray();\n}\n\nDynamicGeometryBatch.prototype.add = function (time, updater) {\n  this._dynamicUpdaters.set(\n    updater.id,\n    updater.createDynamicUpdater(\n      this._primitives,\n      this._orderedGroundPrimitives\n    )\n  );\n};\n\nDynamicGeometryBatch.prototype.remove = function (updater) {\n  const id = updater.id;\n  const dynamicUpdater = this._dynamicUpdaters.get(id);\n  if (defined(dynamicUpdater)) {\n    this._dynamicUpdaters.remove(id);\n    dynamicUpdater.destroy();\n  }\n};\n\nDynamicGeometryBatch.prototype.update = function (time) {\n  const geometries = this._dynamicUpdaters.values;\n  for (let i = 0, len = geometries.length; i < len; i++) {\n    geometries[i].update(time);\n  }\n  return true;\n};\n\nDynamicGeometryBatch.prototype.removeAllPrimitives = function () {\n  const geometries = this._dynamicUpdaters.values;\n  for (let i = 0, len = geometries.length; i < len; i++) {\n    geometries[i].destroy();\n  }\n  this._dynamicUpdaters.removeAll();\n};\n\nDynamicGeometryBatch.prototype.getBoundingSphere = function (updater, result) {\n  updater = this._dynamicUpdaters.get(updater.id);\n  if (defined(updater) && defined(updater.getBoundingSphere)) {\n    return updater.getBoundingSphere(result);\n  }\n  return BoundingSphereState.FAILED;\n};\nexport default DynamicGeometryBatch;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Quaternion from \"./Quaternion.js\";\n\nconst EllipseGeometryLibrary = {};\n\nconst rotAxis = new Cartesian3();\nconst tempVec = new Cartesian3();\nconst unitQuat = new Quaternion();\nconst rotMtx = new Matrix3();\n\nfunction pointOnEllipsoid(\n  theta,\n  rotation,\n  northVec,\n  eastVec,\n  aSqr,\n  ab,\n  bSqr,\n  mag,\n  unitPos,\n  result\n) {\n  const azimuth = theta + rotation;\n\n  Cartesian3.multiplyByScalar(eastVec, Math.cos(azimuth), rotAxis);\n  Cartesian3.multiplyByScalar(northVec, Math.sin(azimuth), tempVec);\n  Cartesian3.add(rotAxis, tempVec, rotAxis);\n\n  let cosThetaSquared = Math.cos(theta);\n  cosThetaSquared = cosThetaSquared * cosThetaSquared;\n\n  let sinThetaSquared = Math.sin(theta);\n  sinThetaSquared = sinThetaSquared * sinThetaSquared;\n\n  const radius =\n    ab / Math.sqrt(bSqr * cosThetaSquared + aSqr * sinThetaSquared);\n  const angle = radius / mag;\n\n  // Create the quaternion to rotate the position vector to the boundary of the ellipse.\n  Quaternion.fromAxisAngle(rotAxis, angle, unitQuat);\n  Matrix3.fromQuaternion(unitQuat, rotMtx);\n\n  Matrix3.multiplyByVector(rotMtx, unitPos, result);\n  Cartesian3.normalize(result, result);\n  Cartesian3.multiplyByScalar(result, mag, result);\n  return result;\n}\n\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchCartesian3 = new Cartesian3();\nconst scratchNormal = new Cartesian3();\n/**\n * Returns the positions raised to the given heights\n * @private\n */\nEllipseGeometryLibrary.raisePositionsToHeight = function (\n  positions,\n  options,\n  extrude\n) {\n  const ellipsoid = options.ellipsoid;\n  const height = options.height;\n  const extrudedHeight = options.extrudedHeight;\n  const size = extrude ? (positions.length / 3) * 2 : positions.length / 3;\n\n  const finalPositions = new Float64Array(size * 3);\n\n  const length = positions.length;\n  const bottomOffset = extrude ? length : 0;\n  for (let i = 0; i < length; i += 3) {\n    const i1 = i + 1;\n    const i2 = i + 2;\n\n    const position = Cartesian3.fromArray(positions, i, scratchCartesian1);\n    ellipsoid.scaleToGeodeticSurface(position, position);\n\n    const extrudedPosition = Cartesian3.clone(position, scratchCartesian2);\n    const normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal);\n    const scaledNormal = Cartesian3.multiplyByScalar(\n      normal,\n      height,\n      scratchCartesian3\n    );\n    Cartesian3.add(position, scaledNormal, position);\n\n    if (extrude) {\n      Cartesian3.multiplyByScalar(normal, extrudedHeight, scaledNormal);\n      Cartesian3.add(extrudedPosition, scaledNormal, extrudedPosition);\n\n      finalPositions[i + bottomOffset] = extrudedPosition.x;\n      finalPositions[i1 + bottomOffset] = extrudedPosition.y;\n      finalPositions[i2 + bottomOffset] = extrudedPosition.z;\n    }\n\n    finalPositions[i] = position.x;\n    finalPositions[i1] = position.y;\n    finalPositions[i2] = position.z;\n  }\n\n  return finalPositions;\n};\n\nconst unitPosScratch = new Cartesian3();\nconst eastVecScratch = new Cartesian3();\nconst northVecScratch = new Cartesian3();\n/**\n * Returns an array of positions that make up the ellipse.\n * @private\n */\nEllipseGeometryLibrary.computeEllipsePositions = function (\n  options,\n  addFillPositions,\n  addEdgePositions\n) {\n  const semiMinorAxis = options.semiMinorAxis;\n  const semiMajorAxis = options.semiMajorAxis;\n  const rotation = options.rotation;\n  const center = options.center;\n\n  // Computing the arc-length of the ellipse is too expensive to be practical. Estimating it using the\n  // arc length of the sphere is too inaccurate and creates sharp edges when either the semi-major or\n  // semi-minor axis is much bigger than the other. Instead, scale the angle delta to make\n  // the distance along the ellipse boundary more closely match the granularity.\n  const granularity = options.granularity * 8.0;\n\n  const aSqr = semiMinorAxis * semiMinorAxis;\n  const bSqr = semiMajorAxis * semiMajorAxis;\n  const ab = semiMajorAxis * semiMinorAxis;\n\n  const mag = Cartesian3.magnitude(center);\n\n  const unitPos = Cartesian3.normalize(center, unitPosScratch);\n  let eastVec = Cartesian3.cross(Cartesian3.UNIT_Z, center, eastVecScratch);\n  eastVec = Cartesian3.normalize(eastVec, eastVec);\n  const northVec = Cartesian3.cross(unitPos, eastVec, northVecScratch);\n\n  // The number of points in the first quadrant\n  let numPts = 1 + Math.ceil(CesiumMath.PI_OVER_TWO / granularity);\n\n  const deltaTheta = CesiumMath.PI_OVER_TWO / (numPts - 1);\n  let theta = CesiumMath.PI_OVER_TWO - numPts * deltaTheta;\n  if (theta < 0.0) {\n    numPts -= Math.ceil(Math.abs(theta) / deltaTheta);\n  }\n\n  // If the number of points were three, the ellipse\n  // would be tessellated like below:\n  //\n  //         *---*\n  //       / | \\ | \\\n  //     *---*---*---*\n  //   / | \\ | \\ | \\ | \\\n  //  / .*---*---*---*. \\\n  // * ` | \\ | \\ | \\ | `*\n  //  \\`.*---*---*---*.`/\n  //   \\ | \\ | \\ | \\ | /\n  //     *---*---*---*\n  //       \\ | \\ | /\n  //         *---*\n  // The first and last column have one position and fan to connect to the adjacent column.\n  // Each other vertical column contains an even number of positions.\n  const size = 2 * (numPts * (numPts + 2));\n  const positions = addFillPositions ? new Array(size * 3) : undefined;\n  let positionIndex = 0;\n  let position = scratchCartesian1;\n  let reflectedPosition = scratchCartesian2;\n\n  const outerPositionsLength = numPts * 4 * 3;\n  let outerRightIndex = outerPositionsLength - 1;\n  let outerLeftIndex = 0;\n  const outerPositions = addEdgePositions\n    ? new Array(outerPositionsLength)\n    : undefined;\n\n  let i;\n  let j;\n  let numInterior;\n  let t;\n  let interiorPosition;\n\n  // Compute points in the 'eastern' half of the ellipse\n  theta = CesiumMath.PI_OVER_TWO;\n  position = pointOnEllipsoid(\n    theta,\n    rotation,\n    northVec,\n    eastVec,\n    aSqr,\n    ab,\n    bSqr,\n    mag,\n    unitPos,\n    position\n  );\n  if (addFillPositions) {\n    positions[positionIndex++] = position.x;\n    positions[positionIndex++] = position.y;\n    positions[positionIndex++] = position.z;\n  }\n  if (addEdgePositions) {\n    outerPositions[outerRightIndex--] = position.z;\n    outerPositions[outerRightIndex--] = position.y;\n    outerPositions[outerRightIndex--] = position.x;\n  }\n  theta = CesiumMath.PI_OVER_TWO - deltaTheta;\n  for (i = 1; i < numPts + 1; ++i) {\n    position = pointOnEllipsoid(\n      theta,\n      rotation,\n      northVec,\n      eastVec,\n      aSqr,\n      ab,\n      bSqr,\n      mag,\n      unitPos,\n      position\n    );\n    reflectedPosition = pointOnEllipsoid(\n      Math.PI - theta,\n      rotation,\n      northVec,\n      eastVec,\n      aSqr,\n      ab,\n      bSqr,\n      mag,\n      unitPos,\n      reflectedPosition\n    );\n\n    if (addFillPositions) {\n      positions[positionIndex++] = position.x;\n      positions[positionIndex++] = position.y;\n      positions[positionIndex++] = position.z;\n\n      numInterior = 2 * i + 2;\n      for (j = 1; j < numInterior - 1; ++j) {\n        t = j / (numInterior - 1);\n        interiorPosition = Cartesian3.lerp(\n          position,\n          reflectedPosition,\n          t,\n          scratchCartesian3\n        );\n        positions[positionIndex++] = interiorPosition.x;\n        positions[positionIndex++] = interiorPosition.y;\n        positions[positionIndex++] = interiorPosition.z;\n      }\n\n      positions[positionIndex++] = reflectedPosition.x;\n      positions[positionIndex++] = reflectedPosition.y;\n      positions[positionIndex++] = reflectedPosition.z;\n    }\n\n    if (addEdgePositions) {\n      outerPositions[outerRightIndex--] = position.z;\n      outerPositions[outerRightIndex--] = position.y;\n      outerPositions[outerRightIndex--] = position.x;\n      outerPositions[outerLeftIndex++] = reflectedPosition.x;\n      outerPositions[outerLeftIndex++] = reflectedPosition.y;\n      outerPositions[outerLeftIndex++] = reflectedPosition.z;\n    }\n\n    theta = CesiumMath.PI_OVER_TWO - (i + 1) * deltaTheta;\n  }\n\n  // Compute points in the 'western' half of the ellipse\n  for (i = numPts; i > 1; --i) {\n    theta = CesiumMath.PI_OVER_TWO - (i - 1) * deltaTheta;\n\n    position = pointOnEllipsoid(\n      -theta,\n      rotation,\n      northVec,\n      eastVec,\n      aSqr,\n      ab,\n      bSqr,\n      mag,\n      unitPos,\n      position\n    );\n    reflectedPosition = pointOnEllipsoid(\n      theta + Math.PI,\n      rotation,\n      northVec,\n      eastVec,\n      aSqr,\n      ab,\n      bSqr,\n      mag,\n      unitPos,\n      reflectedPosition\n    );\n\n    if (addFillPositions) {\n      positions[positionIndex++] = position.x;\n      positions[positionIndex++] = position.y;\n      positions[positionIndex++] = position.z;\n\n      numInterior = 2 * (i - 1) + 2;\n      for (j = 1; j < numInterior - 1; ++j) {\n        t = j / (numInterior - 1);\n        interiorPosition = Cartesian3.lerp(\n          position,\n          reflectedPosition,\n          t,\n          scratchCartesian3\n        );\n        positions[positionIndex++] = interiorPosition.x;\n        positions[positionIndex++] = interiorPosition.y;\n        positions[positionIndex++] = interiorPosition.z;\n      }\n\n      positions[positionIndex++] = reflectedPosition.x;\n      positions[positionIndex++] = reflectedPosition.y;\n      positions[positionIndex++] = reflectedPosition.z;\n    }\n\n    if (addEdgePositions) {\n      outerPositions[outerRightIndex--] = position.z;\n      outerPositions[outerRightIndex--] = position.y;\n      outerPositions[outerRightIndex--] = position.x;\n      outerPositions[outerLeftIndex++] = reflectedPosition.x;\n      outerPositions[outerLeftIndex++] = reflectedPosition.y;\n      outerPositions[outerLeftIndex++] = reflectedPosition.z;\n    }\n  }\n\n  theta = CesiumMath.PI_OVER_TWO;\n  position = pointOnEllipsoid(\n    -theta,\n    rotation,\n    northVec,\n    eastVec,\n    aSqr,\n    ab,\n    bSqr,\n    mag,\n    unitPos,\n    position\n  );\n\n  const r = {};\n  if (addFillPositions) {\n    positions[positionIndex++] = position.x;\n    positions[positionIndex++] = position.y;\n    positions[positionIndex++] = position.z;\n    r.positions = positions;\n    r.numPts = numPts;\n  }\n  if (addEdgePositions) {\n    outerPositions[outerRightIndex--] = position.z;\n    outerPositions[outerRightIndex--] = position.y;\n    outerPositions[outerRightIndex--] = position.x;\n    r.outerPositions = outerPositions;\n  }\n\n  return r;\n};\nexport default EllipseGeometryLibrary;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport EllipseGeometryLibrary from \"./EllipseGeometryLibrary.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryInstance from \"./GeometryInstance.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchCartesian3 = new Cartesian3();\nconst scratchCartesian4 = new Cartesian3();\nconst texCoordScratch = new Cartesian2();\nconst textureMatrixScratch = new Matrix3();\nconst tangentMatrixScratch = new Matrix3();\nconst quaternionScratch = new Quaternion();\n\nconst scratchNormal = new Cartesian3();\nconst scratchTangent = new Cartesian3();\nconst scratchBitangent = new Cartesian3();\n\nconst scratchCartographic = new Cartographic();\nconst projectedCenterScratch = new Cartesian3();\n\nconst scratchMinTexCoord = new Cartesian2();\nconst scratchMaxTexCoord = new Cartesian2();\n\nfunction computeTopBottomAttributes(positions, options, extrude) {\n  const vertexFormat = options.vertexFormat;\n  const center = options.center;\n  const semiMajorAxis = options.semiMajorAxis;\n  const semiMinorAxis = options.semiMinorAxis;\n  const ellipsoid = options.ellipsoid;\n  const stRotation = options.stRotation;\n  const size = extrude ? (positions.length / 3) * 2 : positions.length / 3;\n  const shadowVolume = options.shadowVolume;\n\n  const textureCoordinates = vertexFormat.st\n    ? new Float32Array(size * 2)\n    : undefined;\n  const normals = vertexFormat.normal ? new Float32Array(size * 3) : undefined;\n  const tangents = vertexFormat.tangent\n    ? new Float32Array(size * 3)\n    : undefined;\n  const bitangents = vertexFormat.bitangent\n    ? new Float32Array(size * 3)\n    : undefined;\n\n  const extrudeNormals = shadowVolume ? new Float32Array(size * 3) : undefined;\n\n  let textureCoordIndex = 0;\n\n  // Raise positions to a height above the ellipsoid and compute the\n  // texture coordinates, normals, tangents, and bitangents.\n  let normal = scratchNormal;\n  let tangent = scratchTangent;\n  let bitangent = scratchBitangent;\n\n  const projection = new GeographicProjection(ellipsoid);\n  const projectedCenter = projection.project(\n    ellipsoid.cartesianToCartographic(center, scratchCartographic),\n    projectedCenterScratch\n  );\n\n  const geodeticNormal = ellipsoid.scaleToGeodeticSurface(\n    center,\n    scratchCartesian1\n  );\n  ellipsoid.geodeticSurfaceNormal(geodeticNormal, geodeticNormal);\n\n  let textureMatrix = textureMatrixScratch;\n  let tangentMatrix = tangentMatrixScratch;\n  if (stRotation !== 0) {\n    let rotation = Quaternion.fromAxisAngle(\n      geodeticNormal,\n      stRotation,\n      quaternionScratch\n    );\n    textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrix);\n\n    rotation = Quaternion.fromAxisAngle(\n      geodeticNormal,\n      -stRotation,\n      quaternionScratch\n    );\n    tangentMatrix = Matrix3.fromQuaternion(rotation, tangentMatrix);\n  } else {\n    textureMatrix = Matrix3.clone(Matrix3.IDENTITY, textureMatrix);\n    tangentMatrix = Matrix3.clone(Matrix3.IDENTITY, tangentMatrix);\n  }\n\n  const minTexCoord = Cartesian2.fromElements(\n    Number.POSITIVE_INFINITY,\n    Number.POSITIVE_INFINITY,\n    scratchMinTexCoord\n  );\n  const maxTexCoord = Cartesian2.fromElements(\n    Number.NEGATIVE_INFINITY,\n    Number.NEGATIVE_INFINITY,\n    scratchMaxTexCoord\n  );\n\n  let length = positions.length;\n  const bottomOffset = extrude ? length : 0;\n  const stOffset = (bottomOffset / 3) * 2;\n  for (let i = 0; i < length; i += 3) {\n    const i1 = i + 1;\n    const i2 = i + 2;\n    const position = Cartesian3.fromArray(positions, i, scratchCartesian1);\n\n    if (vertexFormat.st) {\n      const rotatedPoint = Matrix3.multiplyByVector(\n        textureMatrix,\n        position,\n        scratchCartesian2\n      );\n      const projectedPoint = projection.project(\n        ellipsoid.cartesianToCartographic(rotatedPoint, scratchCartographic),\n        scratchCartesian3\n      );\n      Cartesian3.subtract(projectedPoint, projectedCenter, projectedPoint);\n\n      texCoordScratch.x =\n        (projectedPoint.x + semiMajorAxis) / (2.0 * semiMajorAxis);\n      texCoordScratch.y =\n        (projectedPoint.y + semiMinorAxis) / (2.0 * semiMinorAxis);\n\n      minTexCoord.x = Math.min(texCoordScratch.x, minTexCoord.x);\n      minTexCoord.y = Math.min(texCoordScratch.y, minTexCoord.y);\n      maxTexCoord.x = Math.max(texCoordScratch.x, maxTexCoord.x);\n      maxTexCoord.y = Math.max(texCoordScratch.y, maxTexCoord.y);\n\n      if (extrude) {\n        textureCoordinates[textureCoordIndex + stOffset] = texCoordScratch.x;\n        textureCoordinates[textureCoordIndex + 1 + stOffset] =\n          texCoordScratch.y;\n      }\n\n      textureCoordinates[textureCoordIndex++] = texCoordScratch.x;\n      textureCoordinates[textureCoordIndex++] = texCoordScratch.y;\n    }\n\n    if (\n      vertexFormat.normal ||\n      vertexFormat.tangent ||\n      vertexFormat.bitangent ||\n      shadowVolume\n    ) {\n      normal = ellipsoid.geodeticSurfaceNormal(position, normal);\n\n      if (shadowVolume) {\n        extrudeNormals[i + bottomOffset] = -normal.x;\n        extrudeNormals[i1 + bottomOffset] = -normal.y;\n        extrudeNormals[i2 + bottomOffset] = -normal.z;\n      }\n\n      if (\n        vertexFormat.normal ||\n        vertexFormat.tangent ||\n        vertexFormat.bitangent\n      ) {\n        if (vertexFormat.tangent || vertexFormat.bitangent) {\n          tangent = Cartesian3.normalize(\n            Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent),\n            tangent\n          );\n          Matrix3.multiplyByVector(tangentMatrix, tangent, tangent);\n        }\n        if (vertexFormat.normal) {\n          normals[i] = normal.x;\n          normals[i1] = normal.y;\n          normals[i2] = normal.z;\n          if (extrude) {\n            normals[i + bottomOffset] = -normal.x;\n            normals[i1 + bottomOffset] = -normal.y;\n            normals[i2 + bottomOffset] = -normal.z;\n          }\n        }\n\n        if (vertexFormat.tangent) {\n          tangents[i] = tangent.x;\n          tangents[i1] = tangent.y;\n          tangents[i2] = tangent.z;\n          if (extrude) {\n            tangents[i + bottomOffset] = -tangent.x;\n            tangents[i1 + bottomOffset] = -tangent.y;\n            tangents[i2 + bottomOffset] = -tangent.z;\n          }\n        }\n\n        if (vertexFormat.bitangent) {\n          bitangent = Cartesian3.normalize(\n            Cartesian3.cross(normal, tangent, bitangent),\n            bitangent\n          );\n          bitangents[i] = bitangent.x;\n          bitangents[i1] = bitangent.y;\n          bitangents[i2] = bitangent.z;\n          if (extrude) {\n            bitangents[i + bottomOffset] = bitangent.x;\n            bitangents[i1 + bottomOffset] = bitangent.y;\n            bitangents[i2 + bottomOffset] = bitangent.z;\n          }\n        }\n      }\n    }\n  }\n\n  if (vertexFormat.st) {\n    length = textureCoordinates.length;\n    for (let k = 0; k < length; k += 2) {\n      textureCoordinates[k] =\n        (textureCoordinates[k] - minTexCoord.x) /\n        (maxTexCoord.x - minTexCoord.x);\n      textureCoordinates[k + 1] =\n        (textureCoordinates[k + 1] - minTexCoord.y) /\n        (maxTexCoord.y - minTexCoord.y);\n    }\n  }\n\n  const attributes = new GeometryAttributes();\n\n  if (vertexFormat.position) {\n    const finalPositions = EllipseGeometryLibrary.raisePositionsToHeight(\n      positions,\n      options,\n      extrude\n    );\n    attributes.position = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: finalPositions,\n    });\n  }\n\n  if (vertexFormat.st) {\n    attributes.st = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n      values: textureCoordinates,\n    });\n  }\n\n  if (vertexFormat.normal) {\n    attributes.normal = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: normals,\n    });\n  }\n\n  if (vertexFormat.tangent) {\n    attributes.tangent = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: tangents,\n    });\n  }\n\n  if (vertexFormat.bitangent) {\n    attributes.bitangent = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: bitangents,\n    });\n  }\n\n  if (shadowVolume) {\n    attributes.extrudeDirection = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: extrudeNormals,\n    });\n  }\n\n  if (extrude && defined(options.offsetAttribute)) {\n    let offsetAttribute = new Uint8Array(size);\n    if (options.offsetAttribute === GeometryOffsetAttribute.TOP) {\n      offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\n    } else {\n      const offsetValue =\n        options.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n      offsetAttribute = offsetAttribute.fill(offsetValue);\n    }\n\n    attributes.applyOffset = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 1,\n      values: offsetAttribute,\n    });\n  }\n\n  return attributes;\n}\n\nfunction topIndices(numPts) {\n  // numTriangles in half = 3 + 8 + 12 + ... = -1 + 4 + (4 + 4) + (4 + 4 + 4) + ... = -1 + 4 * (1 + 2 + 3 + ...)\n  //              = -1 + 4 * ((n * ( n + 1)) / 2)\n  // total triangles = 2 * numTrangles in half\n  // indices = total triangles * 3;\n  // Substitute numPts for n above\n\n  const indices = new Array(12 * (numPts * (numPts + 1)) - 6);\n  let indicesIndex = 0;\n  let prevIndex;\n  let numInterior;\n  let positionIndex;\n  let i;\n  let j;\n  // Indices triangles to the 'right' of the north vector\n\n  prevIndex = 0;\n  positionIndex = 1;\n  for (i = 0; i < 3; i++) {\n    indices[indicesIndex++] = positionIndex++;\n    indices[indicesIndex++] = prevIndex;\n    indices[indicesIndex++] = positionIndex;\n  }\n\n  for (i = 2; i < numPts + 1; ++i) {\n    positionIndex = i * (i + 1) - 1;\n    prevIndex = (i - 1) * i - 1;\n\n    indices[indicesIndex++] = positionIndex++;\n    indices[indicesIndex++] = prevIndex;\n    indices[indicesIndex++] = positionIndex;\n\n    numInterior = 2 * i;\n    for (j = 0; j < numInterior - 1; ++j) {\n      indices[indicesIndex++] = positionIndex;\n      indices[indicesIndex++] = prevIndex++;\n      indices[indicesIndex++] = prevIndex;\n\n      indices[indicesIndex++] = positionIndex++;\n      indices[indicesIndex++] = prevIndex;\n      indices[indicesIndex++] = positionIndex;\n    }\n\n    indices[indicesIndex++] = positionIndex++;\n    indices[indicesIndex++] = prevIndex;\n    indices[indicesIndex++] = positionIndex;\n  }\n\n  // Indices for center column of triangles\n  numInterior = numPts * 2;\n  ++positionIndex;\n  ++prevIndex;\n  for (i = 0; i < numInterior - 1; ++i) {\n    indices[indicesIndex++] = positionIndex;\n    indices[indicesIndex++] = prevIndex++;\n    indices[indicesIndex++] = prevIndex;\n\n    indices[indicesIndex++] = positionIndex++;\n    indices[indicesIndex++] = prevIndex;\n    indices[indicesIndex++] = positionIndex;\n  }\n\n  indices[indicesIndex++] = positionIndex;\n  indices[indicesIndex++] = prevIndex++;\n  indices[indicesIndex++] = prevIndex;\n\n  indices[indicesIndex++] = positionIndex++;\n  indices[indicesIndex++] = prevIndex++;\n  indices[indicesIndex++] = prevIndex;\n\n  // Reverse the process creating indices to the 'left' of the north vector\n  ++prevIndex;\n  for (i = numPts - 1; i > 1; --i) {\n    indices[indicesIndex++] = prevIndex++;\n    indices[indicesIndex++] = prevIndex;\n    indices[indicesIndex++] = positionIndex;\n\n    numInterior = 2 * i;\n    for (j = 0; j < numInterior - 1; ++j) {\n      indices[indicesIndex++] = positionIndex;\n      indices[indicesIndex++] = prevIndex++;\n      indices[indicesIndex++] = prevIndex;\n\n      indices[indicesIndex++] = positionIndex++;\n      indices[indicesIndex++] = prevIndex;\n      indices[indicesIndex++] = positionIndex;\n    }\n\n    indices[indicesIndex++] = prevIndex++;\n    indices[indicesIndex++] = prevIndex++;\n    indices[indicesIndex++] = positionIndex++;\n  }\n\n  for (i = 0; i < 3; i++) {\n    indices[indicesIndex++] = prevIndex++;\n    indices[indicesIndex++] = prevIndex;\n    indices[indicesIndex++] = positionIndex;\n  }\n  return indices;\n}\n\nlet boundingSphereCenter = new Cartesian3();\n\nfunction computeEllipse(options) {\n  const center = options.center;\n  boundingSphereCenter = Cartesian3.multiplyByScalar(\n    options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter),\n    options.height,\n    boundingSphereCenter\n  );\n  boundingSphereCenter = Cartesian3.add(\n    center,\n    boundingSphereCenter,\n    boundingSphereCenter\n  );\n  const boundingSphere = new BoundingSphere(\n    boundingSphereCenter,\n    options.semiMajorAxis\n  );\n  const cep = EllipseGeometryLibrary.computeEllipsePositions(\n    options,\n    true,\n    false\n  );\n  const positions = cep.positions;\n  const numPts = cep.numPts;\n  const attributes = computeTopBottomAttributes(positions, options, false);\n  let indices = topIndices(numPts);\n  indices = IndexDatatype.createTypedArray(positions.length / 3, indices);\n  return {\n    boundingSphere: boundingSphere,\n    attributes: attributes,\n    indices: indices,\n  };\n}\n\nfunction computeWallAttributes(positions, options) {\n  const vertexFormat = options.vertexFormat;\n  const center = options.center;\n  const semiMajorAxis = options.semiMajorAxis;\n  const semiMinorAxis = options.semiMinorAxis;\n  const ellipsoid = options.ellipsoid;\n  const height = options.height;\n  const extrudedHeight = options.extrudedHeight;\n  const stRotation = options.stRotation;\n  const size = (positions.length / 3) * 2;\n\n  const finalPositions = new Float64Array(size * 3);\n  const textureCoordinates = vertexFormat.st\n    ? new Float32Array(size * 2)\n    : undefined;\n  const normals = vertexFormat.normal ? new Float32Array(size * 3) : undefined;\n  const tangents = vertexFormat.tangent\n    ? new Float32Array(size * 3)\n    : undefined;\n  const bitangents = vertexFormat.bitangent\n    ? new Float32Array(size * 3)\n    : undefined;\n\n  const shadowVolume = options.shadowVolume;\n  const extrudeNormals = shadowVolume ? new Float32Array(size * 3) : undefined;\n\n  let textureCoordIndex = 0;\n\n  // Raise positions to a height above the ellipsoid and compute the\n  // texture coordinates, normals, tangents, and bitangents.\n  let normal = scratchNormal;\n  let tangent = scratchTangent;\n  let bitangent = scratchBitangent;\n\n  const projection = new GeographicProjection(ellipsoid);\n  const projectedCenter = projection.project(\n    ellipsoid.cartesianToCartographic(center, scratchCartographic),\n    projectedCenterScratch\n  );\n\n  const geodeticNormal = ellipsoid.scaleToGeodeticSurface(\n    center,\n    scratchCartesian1\n  );\n  ellipsoid.geodeticSurfaceNormal(geodeticNormal, geodeticNormal);\n  const rotation = Quaternion.fromAxisAngle(\n    geodeticNormal,\n    stRotation,\n    quaternionScratch\n  );\n  const textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrixScratch);\n\n  const minTexCoord = Cartesian2.fromElements(\n    Number.POSITIVE_INFINITY,\n    Number.POSITIVE_INFINITY,\n    scratchMinTexCoord\n  );\n  const maxTexCoord = Cartesian2.fromElements(\n    Number.NEGATIVE_INFINITY,\n    Number.NEGATIVE_INFINITY,\n    scratchMaxTexCoord\n  );\n\n  let length = positions.length;\n  const stOffset = (length / 3) * 2;\n  for (let i = 0; i < length; i += 3) {\n    const i1 = i + 1;\n    const i2 = i + 2;\n    let position = Cartesian3.fromArray(positions, i, scratchCartesian1);\n    let extrudedPosition;\n\n    if (vertexFormat.st) {\n      const rotatedPoint = Matrix3.multiplyByVector(\n        textureMatrix,\n        position,\n        scratchCartesian2\n      );\n      const projectedPoint = projection.project(\n        ellipsoid.cartesianToCartographic(rotatedPoint, scratchCartographic),\n        scratchCartesian3\n      );\n      Cartesian3.subtract(projectedPoint, projectedCenter, projectedPoint);\n\n      texCoordScratch.x =\n        (projectedPoint.x + semiMajorAxis) / (2.0 * semiMajorAxis);\n      texCoordScratch.y =\n        (projectedPoint.y + semiMinorAxis) / (2.0 * semiMinorAxis);\n\n      minTexCoord.x = Math.min(texCoordScratch.x, minTexCoord.x);\n      minTexCoord.y = Math.min(texCoordScratch.y, minTexCoord.y);\n      maxTexCoord.x = Math.max(texCoordScratch.x, maxTexCoord.x);\n      maxTexCoord.y = Math.max(texCoordScratch.y, maxTexCoord.y);\n\n      textureCoordinates[textureCoordIndex + stOffset] = texCoordScratch.x;\n      textureCoordinates[textureCoordIndex + 1 + stOffset] = texCoordScratch.y;\n\n      textureCoordinates[textureCoordIndex++] = texCoordScratch.x;\n      textureCoordinates[textureCoordIndex++] = texCoordScratch.y;\n    }\n\n    position = ellipsoid.scaleToGeodeticSurface(position, position);\n    extrudedPosition = Cartesian3.clone(position, scratchCartesian2);\n    normal = ellipsoid.geodeticSurfaceNormal(position, normal);\n\n    if (shadowVolume) {\n      extrudeNormals[i + length] = -normal.x;\n      extrudeNormals[i1 + length] = -normal.y;\n      extrudeNormals[i2 + length] = -normal.z;\n    }\n\n    let scaledNormal = Cartesian3.multiplyByScalar(\n      normal,\n      height,\n      scratchCartesian4\n    );\n    position = Cartesian3.add(position, scaledNormal, position);\n    scaledNormal = Cartesian3.multiplyByScalar(\n      normal,\n      extrudedHeight,\n      scaledNormal\n    );\n    extrudedPosition = Cartesian3.add(\n      extrudedPosition,\n      scaledNormal,\n      extrudedPosition\n    );\n\n    if (vertexFormat.position) {\n      finalPositions[i + length] = extrudedPosition.x;\n      finalPositions[i1 + length] = extrudedPosition.y;\n      finalPositions[i2 + length] = extrudedPosition.z;\n\n      finalPositions[i] = position.x;\n      finalPositions[i1] = position.y;\n      finalPositions[i2] = position.z;\n    }\n\n    if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {\n      bitangent = Cartesian3.clone(normal, bitangent);\n      const next = Cartesian3.fromArray(\n        positions,\n        (i + 3) % length,\n        scratchCartesian4\n      );\n      Cartesian3.subtract(next, position, next);\n      const bottom = Cartesian3.subtract(\n        extrudedPosition,\n        position,\n        scratchCartesian3\n      );\n\n      normal = Cartesian3.normalize(\n        Cartesian3.cross(bottom, next, normal),\n        normal\n      );\n\n      if (vertexFormat.normal) {\n        normals[i] = normal.x;\n        normals[i1] = normal.y;\n        normals[i2] = normal.z;\n\n        normals[i + length] = normal.x;\n        normals[i1 + length] = normal.y;\n        normals[i2 + length] = normal.z;\n      }\n\n      if (vertexFormat.tangent) {\n        tangent = Cartesian3.normalize(\n          Cartesian3.cross(bitangent, normal, tangent),\n          tangent\n        );\n        tangents[i] = tangent.x;\n        tangents[i1] = tangent.y;\n        tangents[i2] = tangent.z;\n\n        tangents[i + length] = tangent.x;\n        tangents[i + 1 + length] = tangent.y;\n        tangents[i + 2 + length] = tangent.z;\n      }\n\n      if (vertexFormat.bitangent) {\n        bitangents[i] = bitangent.x;\n        bitangents[i1] = bitangent.y;\n        bitangents[i2] = bitangent.z;\n\n        bitangents[i + length] = bitangent.x;\n        bitangents[i1 + length] = bitangent.y;\n        bitangents[i2 + length] = bitangent.z;\n      }\n    }\n  }\n\n  if (vertexFormat.st) {\n    length = textureCoordinates.length;\n    for (let k = 0; k < length; k += 2) {\n      textureCoordinates[k] =\n        (textureCoordinates[k] - minTexCoord.x) /\n        (maxTexCoord.x - minTexCoord.x);\n      textureCoordinates[k + 1] =\n        (textureCoordinates[k + 1] - minTexCoord.y) /\n        (maxTexCoord.y - minTexCoord.y);\n    }\n  }\n\n  const attributes = new GeometryAttributes();\n\n  if (vertexFormat.position) {\n    attributes.position = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: finalPositions,\n    });\n  }\n\n  if (vertexFormat.st) {\n    attributes.st = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n      values: textureCoordinates,\n    });\n  }\n\n  if (vertexFormat.normal) {\n    attributes.normal = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: normals,\n    });\n  }\n\n  if (vertexFormat.tangent) {\n    attributes.tangent = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: tangents,\n    });\n  }\n\n  if (vertexFormat.bitangent) {\n    attributes.bitangent = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: bitangents,\n    });\n  }\n\n  if (shadowVolume) {\n    attributes.extrudeDirection = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: extrudeNormals,\n    });\n  }\n\n  if (defined(options.offsetAttribute)) {\n    let offsetAttribute = new Uint8Array(size);\n    if (options.offsetAttribute === GeometryOffsetAttribute.TOP) {\n      offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\n    } else {\n      const offsetValue =\n        options.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n      offsetAttribute = offsetAttribute.fill(offsetValue);\n    }\n    attributes.applyOffset = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 1,\n      values: offsetAttribute,\n    });\n  }\n\n  return attributes;\n}\n\nfunction computeWallIndices(positions) {\n  const length = positions.length / 3;\n  const indices = IndexDatatype.createTypedArray(length, length * 6);\n  let index = 0;\n  for (let i = 0; i < length; i++) {\n    const UL = i;\n    const LL = i + length;\n    const UR = (UL + 1) % length;\n    const LR = UR + length;\n    indices[index++] = UL;\n    indices[index++] = LL;\n    indices[index++] = UR;\n    indices[index++] = UR;\n    indices[index++] = LL;\n    indices[index++] = LR;\n  }\n\n  return indices;\n}\n\nconst topBoundingSphere = new BoundingSphere();\nconst bottomBoundingSphere = new BoundingSphere();\n\nfunction computeExtrudedEllipse(options) {\n  const center = options.center;\n  const ellipsoid = options.ellipsoid;\n  const semiMajorAxis = options.semiMajorAxis;\n  let scaledNormal = Cartesian3.multiplyByScalar(\n    ellipsoid.geodeticSurfaceNormal(center, scratchCartesian1),\n    options.height,\n    scratchCartesian1\n  );\n  topBoundingSphere.center = Cartesian3.add(\n    center,\n    scaledNormal,\n    topBoundingSphere.center\n  );\n  topBoundingSphere.radius = semiMajorAxis;\n\n  scaledNormal = Cartesian3.multiplyByScalar(\n    ellipsoid.geodeticSurfaceNormal(center, scaledNormal),\n    options.extrudedHeight,\n    scaledNormal\n  );\n  bottomBoundingSphere.center = Cartesian3.add(\n    center,\n    scaledNormal,\n    bottomBoundingSphere.center\n  );\n  bottomBoundingSphere.radius = semiMajorAxis;\n\n  const cep = EllipseGeometryLibrary.computeEllipsePositions(\n    options,\n    true,\n    true\n  );\n  const positions = cep.positions;\n  const numPts = cep.numPts;\n  const outerPositions = cep.outerPositions;\n  const boundingSphere = BoundingSphere.union(\n    topBoundingSphere,\n    bottomBoundingSphere\n  );\n  const topBottomAttributes = computeTopBottomAttributes(\n    positions,\n    options,\n    true\n  );\n  let indices = topIndices(numPts);\n  const length = indices.length;\n  indices.length = length * 2;\n  const posLength = positions.length / 3;\n  for (let i = 0; i < length; i += 3) {\n    indices[i + length] = indices[i + 2] + posLength;\n    indices[i + 1 + length] = indices[i + 1] + posLength;\n    indices[i + 2 + length] = indices[i] + posLength;\n  }\n\n  const topBottomIndices = IndexDatatype.createTypedArray(\n    (posLength * 2) / 3,\n    indices\n  );\n\n  const topBottomGeo = new Geometry({\n    attributes: topBottomAttributes,\n    indices: topBottomIndices,\n    primitiveType: PrimitiveType.TRIANGLES,\n  });\n\n  const wallAttributes = computeWallAttributes(outerPositions, options);\n  indices = computeWallIndices(outerPositions);\n  const wallIndices = IndexDatatype.createTypedArray(\n    (outerPositions.length * 2) / 3,\n    indices\n  );\n\n  const wallGeo = new Geometry({\n    attributes: wallAttributes,\n    indices: wallIndices,\n    primitiveType: PrimitiveType.TRIANGLES,\n  });\n\n  const geo = GeometryPipeline.combineInstances([\n    new GeometryInstance({\n      geometry: topBottomGeo,\n    }),\n    new GeometryInstance({\n      geometry: wallGeo,\n    }),\n  ]);\n\n  return {\n    boundingSphere: boundingSphere,\n    attributes: geo[0].attributes,\n    indices: geo[0].indices,\n  };\n}\n\nfunction computeRectangle(\n  center,\n  semiMajorAxis,\n  semiMinorAxis,\n  rotation,\n  granularity,\n  ellipsoid,\n  result\n) {\n  const cep = EllipseGeometryLibrary.computeEllipsePositions(\n    {\n      center: center,\n      semiMajorAxis: semiMajorAxis,\n      semiMinorAxis: semiMinorAxis,\n      rotation: rotation,\n      granularity: granularity,\n    },\n    false,\n    true\n  );\n  const positionsFlat = cep.outerPositions;\n  const positionsCount = positionsFlat.length / 3;\n  const positions = new Array(positionsCount);\n  for (let i = 0; i < positionsCount; ++i) {\n    positions[i] = Cartesian3.fromArray(positionsFlat, i * 3);\n  }\n  const rectangle = Rectangle.fromCartesianArray(positions, ellipsoid, result);\n  // Rectangle width goes beyond 180 degrees when the ellipse crosses a pole.\n  // When this happens, make the rectangle into a \"circle\" around the pole\n  if (rectangle.width > CesiumMath.PI) {\n    rectangle.north =\n      rectangle.north > 0.0\n        ? CesiumMath.PI_OVER_TWO - CesiumMath.EPSILON7\n        : rectangle.north;\n    rectangle.south =\n      rectangle.south < 0.0\n        ? CesiumMath.EPSILON7 - CesiumMath.PI_OVER_TWO\n        : rectangle.south;\n    rectangle.east = CesiumMath.PI;\n    rectangle.west = -CesiumMath.PI;\n  }\n  return rectangle;\n}\n\n/**\n * A description of an ellipse on an ellipsoid. Ellipse geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\n *\n * @alias EllipseGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3} options.center The ellipse's center point in the fixed frame.\n * @param {number} options.semiMajorAxis The length of the ellipse's semi-major axis in meters.\n * @param {number} options.semiMinorAxis The length of the ellipse's semi-minor axis in meters.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on.\n * @param {number} [options.height=0.0] The distance in meters between the ellipse and the ellipsoid surface.\n * @param {number} [options.extrudedHeight] The distance in meters between the ellipse's extruded face and the ellipsoid surface.\n * @param {number} [options.rotation=0.0] The angle of rotation counter-clockwise from north.\n * @param {number} [options.stRotation=0.0] The rotation of the texture coordinates counter-clockwise from north.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The angular distance between points on the ellipse in radians.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @exception {DeveloperError} semiMajorAxis and semiMinorAxis must be greater than zero.\n * @exception {DeveloperError} semiMajorAxis must be greater than or equal to the semiMinorAxis.\n * @exception {DeveloperError} granularity must be greater than zero.\n *\n *\n * @example\n * // Create an ellipse.\n * const ellipse = new Cesium.EllipseGeometry({\n *   center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),\n *   semiMajorAxis : 500000.0,\n *   semiMinorAxis : 300000.0,\n *   rotation : Cesium.Math.toRadians(60.0)\n * });\n * const geometry = Cesium.EllipseGeometry.createGeometry(ellipse);\n *\n * @see EllipseGeometry.createGeometry\n */\nfunction EllipseGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const center = options.center;\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  const semiMajorAxis = options.semiMajorAxis;\n  const semiMinorAxis = options.semiMinorAxis;\n  const granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.center\", center);\n  Check.typeOf.number(\"options.semiMajorAxis\", semiMajorAxis);\n  Check.typeOf.number(\"options.semiMinorAxis\", semiMinorAxis);\n  if (semiMajorAxis < semiMinorAxis) {\n    throw new DeveloperError(\n      \"semiMajorAxis must be greater than or equal to the semiMinorAxis.\"\n    );\n  }\n  if (granularity <= 0.0) {\n    throw new DeveloperError(\"granularity must be greater than zero.\");\n  }\n  //>>includeEnd('debug');\n\n  const height = defaultValue(options.height, 0.0);\n  const extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n  this._center = Cartesian3.clone(center);\n  this._semiMajorAxis = semiMajorAxis;\n  this._semiMinorAxis = semiMinorAxis;\n  this._ellipsoid = Ellipsoid.clone(ellipsoid);\n  this._rotation = defaultValue(options.rotation, 0.0);\n  this._stRotation = defaultValue(options.stRotation, 0.0);\n  this._height = Math.max(extrudedHeight, height);\n  this._granularity = granularity;\n  this._vertexFormat = VertexFormat.clone(vertexFormat);\n  this._extrudedHeight = Math.min(extrudedHeight, height);\n  this._shadowVolume = defaultValue(options.shadowVolume, false);\n  this._workerName = \"createEllipseGeometry\";\n  this._offsetAttribute = options.offsetAttribute;\n\n  this._rectangle = undefined;\n  this._textureCoordinateRotationPoints = undefined;\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nEllipseGeometry.packedLength =\n  Cartesian3.packedLength +\n  Ellipsoid.packedLength +\n  VertexFormat.packedLength +\n  9;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {EllipseGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nEllipseGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  Cartesian3.pack(value._center, array, startingIndex);\n  startingIndex += Cartesian3.packedLength;\n\n  Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  VertexFormat.pack(value._vertexFormat, array, startingIndex);\n  startingIndex += VertexFormat.packedLength;\n\n  array[startingIndex++] = value._semiMajorAxis;\n  array[startingIndex++] = value._semiMinorAxis;\n  array[startingIndex++] = value._rotation;\n  array[startingIndex++] = value._stRotation;\n  array[startingIndex++] = value._height;\n  array[startingIndex++] = value._granularity;\n  array[startingIndex++] = value._extrudedHeight;\n  array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;\n  array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n  return array;\n};\n\nconst scratchCenter = new Cartesian3();\nconst scratchEllipsoid = new Ellipsoid();\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n  center: scratchCenter,\n  ellipsoid: scratchEllipsoid,\n  vertexFormat: scratchVertexFormat,\n  semiMajorAxis: undefined,\n  semiMinorAxis: undefined,\n  rotation: undefined,\n  stRotation: undefined,\n  height: undefined,\n  granularity: undefined,\n  extrudedHeight: undefined,\n  shadowVolume: undefined,\n  offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {EllipseGeometry} [result] The object into which to store the result.\n * @returns {EllipseGeometry} The modified result parameter or a new EllipseGeometry instance if one was not provided.\n */\nEllipseGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const center = Cartesian3.unpack(array, startingIndex, scratchCenter);\n  startingIndex += Cartesian3.packedLength;\n\n  const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n  startingIndex += Ellipsoid.packedLength;\n\n  const vertexFormat = VertexFormat.unpack(\n    array,\n    startingIndex,\n    scratchVertexFormat\n  );\n  startingIndex += VertexFormat.packedLength;\n\n  const semiMajorAxis = array[startingIndex++];\n  const semiMinorAxis = array[startingIndex++];\n  const rotation = array[startingIndex++];\n  const stRotation = array[startingIndex++];\n  const height = array[startingIndex++];\n  const granularity = array[startingIndex++];\n  const extrudedHeight = array[startingIndex++];\n  const shadowVolume = array[startingIndex++] === 1.0;\n  const offsetAttribute = array[startingIndex];\n\n  if (!defined(result)) {\n    scratchOptions.height = height;\n    scratchOptions.extrudedHeight = extrudedHeight;\n    scratchOptions.granularity = granularity;\n    scratchOptions.stRotation = stRotation;\n    scratchOptions.rotation = rotation;\n    scratchOptions.semiMajorAxis = semiMajorAxis;\n    scratchOptions.semiMinorAxis = semiMinorAxis;\n    scratchOptions.shadowVolume = shadowVolume;\n    scratchOptions.offsetAttribute =\n      offsetAttribute === -1 ? undefined : offsetAttribute;\n\n    return new EllipseGeometry(scratchOptions);\n  }\n\n  result._center = Cartesian3.clone(center, result._center);\n  result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n  result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n  result._semiMajorAxis = semiMajorAxis;\n  result._semiMinorAxis = semiMinorAxis;\n  result._rotation = rotation;\n  result._stRotation = stRotation;\n  result._height = height;\n  result._granularity = granularity;\n  result._extrudedHeight = extrudedHeight;\n  result._shadowVolume = shadowVolume;\n  result._offsetAttribute =\n    offsetAttribute === -1 ? undefined : offsetAttribute;\n\n  return result;\n};\n\n/**\n * Computes the bounding rectangle based on the provided options\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3} options.center The ellipse's center point in the fixed frame.\n * @param {number} options.semiMajorAxis The length of the ellipse's semi-major axis in meters.\n * @param {number} options.semiMinorAxis The length of the ellipse's semi-minor axis in meters.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on.\n * @param {number} [options.rotation=0.0] The angle of rotation counter-clockwise from north.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The angular distance between points on the ellipse in radians.\n * @param {Rectangle} [result] An object in which to store the result\n *\n * @returns {Rectangle} The result rectangle\n */\nEllipseGeometry.computeRectangle = function (options, result) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const center = options.center;\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  const semiMajorAxis = options.semiMajorAxis;\n  const semiMinorAxis = options.semiMinorAxis;\n  const granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  const rotation = defaultValue(options.rotation, 0.0);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.center\", center);\n  Check.typeOf.number(\"options.semiMajorAxis\", semiMajorAxis);\n  Check.typeOf.number(\"options.semiMinorAxis\", semiMinorAxis);\n  if (semiMajorAxis < semiMinorAxis) {\n    throw new DeveloperError(\n      \"semiMajorAxis must be greater than or equal to the semiMinorAxis.\"\n    );\n  }\n  if (granularity <= 0.0) {\n    throw new DeveloperError(\"granularity must be greater than zero.\");\n  }\n  //>>includeEnd('debug');\n\n  return computeRectangle(\n    center,\n    semiMajorAxis,\n    semiMinorAxis,\n    rotation,\n    granularity,\n    ellipsoid,\n    result\n  );\n};\n\n/**\n * Computes the geometric representation of a ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.\n *\n * @param {EllipseGeometry} ellipseGeometry A description of the ellipse.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nEllipseGeometry.createGeometry = function (ellipseGeometry) {\n  if (\n    ellipseGeometry._semiMajorAxis <= 0.0 ||\n    ellipseGeometry._semiMinorAxis <= 0.0\n  ) {\n    return;\n  }\n\n  const height = ellipseGeometry._height;\n  const extrudedHeight = ellipseGeometry._extrudedHeight;\n  const extrude = !CesiumMath.equalsEpsilon(\n    height,\n    extrudedHeight,\n    0,\n    CesiumMath.EPSILON2\n  );\n\n  ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface(\n    ellipseGeometry._center,\n    ellipseGeometry._center\n  );\n  const options = {\n    center: ellipseGeometry._center,\n    semiMajorAxis: ellipseGeometry._semiMajorAxis,\n    semiMinorAxis: ellipseGeometry._semiMinorAxis,\n    ellipsoid: ellipseGeometry._ellipsoid,\n    rotation: ellipseGeometry._rotation,\n    height: height,\n    granularity: ellipseGeometry._granularity,\n    vertexFormat: ellipseGeometry._vertexFormat,\n    stRotation: ellipseGeometry._stRotation,\n  };\n  let geometry;\n  if (extrude) {\n    options.extrudedHeight = extrudedHeight;\n    options.shadowVolume = ellipseGeometry._shadowVolume;\n    options.offsetAttribute = ellipseGeometry._offsetAttribute;\n    geometry = computeExtrudedEllipse(options);\n  } else {\n    geometry = computeEllipse(options);\n\n    if (defined(ellipseGeometry._offsetAttribute)) {\n      const length = geometry.attributes.position.values.length;\n      const offsetValue =\n        ellipseGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n          ? 0\n          : 1;\n      const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n      geometry.attributes.applyOffset = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n        componentsPerAttribute: 1,\n        values: applyOffset,\n      });\n    }\n  }\n\n  return new Geometry({\n    attributes: geometry.attributes,\n    indices: geometry.indices,\n    primitiveType: PrimitiveType.TRIANGLES,\n    boundingSphere: geometry.boundingSphere,\n    offsetAttribute: ellipseGeometry._offsetAttribute,\n  });\n};\n\n/**\n * @private\n */\nEllipseGeometry.createShadowVolume = function (\n  ellipseGeometry,\n  minHeightFunc,\n  maxHeightFunc\n) {\n  const granularity = ellipseGeometry._granularity;\n  const ellipsoid = ellipseGeometry._ellipsoid;\n\n  const minHeight = minHeightFunc(granularity, ellipsoid);\n  const maxHeight = maxHeightFunc(granularity, ellipsoid);\n\n  return new EllipseGeometry({\n    center: ellipseGeometry._center,\n    semiMajorAxis: ellipseGeometry._semiMajorAxis,\n    semiMinorAxis: ellipseGeometry._semiMinorAxis,\n    ellipsoid: ellipsoid,\n    rotation: ellipseGeometry._rotation,\n    stRotation: ellipseGeometry._stRotation,\n    granularity: granularity,\n    extrudedHeight: minHeight,\n    height: maxHeight,\n    vertexFormat: VertexFormat.POSITION_ONLY,\n    shadowVolume: true,\n  });\n};\n\nfunction textureCoordinateRotationPoints(ellipseGeometry) {\n  const stRotation = -ellipseGeometry._stRotation;\n  if (stRotation === 0.0) {\n    return [0, 0, 0, 1, 1, 0];\n  }\n\n  const cep = EllipseGeometryLibrary.computeEllipsePositions(\n    {\n      center: ellipseGeometry._center,\n      semiMajorAxis: ellipseGeometry._semiMajorAxis,\n      semiMinorAxis: ellipseGeometry._semiMinorAxis,\n      rotation: ellipseGeometry._rotation,\n      granularity: ellipseGeometry._granularity,\n    },\n    false,\n    true\n  );\n  const positionsFlat = cep.outerPositions;\n  const positionsCount = positionsFlat.length / 3;\n  const positions = new Array(positionsCount);\n  for (let i = 0; i < positionsCount; ++i) {\n    positions[i] = Cartesian3.fromArray(positionsFlat, i * 3);\n  }\n\n  const ellipsoid = ellipseGeometry._ellipsoid;\n  const boundingRectangle = ellipseGeometry.rectangle;\n  return Geometry._textureCoordinateRotationPoints(\n    positions,\n    stRotation,\n    ellipsoid,\n    boundingRectangle\n  );\n}\n\nObject.defineProperties(EllipseGeometry.prototype, {\n  /**\n   * @private\n   */\n  rectangle: {\n    get: function () {\n      if (!defined(this._rectangle)) {\n        this._rectangle = computeRectangle(\n          this._center,\n          this._semiMajorAxis,\n          this._semiMinorAxis,\n          this._rotation,\n          this._granularity,\n          this._ellipsoid\n        );\n      }\n      return this._rectangle;\n    },\n  },\n  /**\n   * For remapping texture coordinates when rendering EllipseGeometries as GroundPrimitives.\n   * @private\n   */\n  textureCoordinateRotationPoints: {\n    get: function () {\n      if (!defined(this._textureCoordinateRotationPoints)) {\n        this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(\n          this\n        );\n      }\n      return this._textureCoordinateRotationPoints;\n    },\n  },\n});\nexport default EllipseGeometry;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport EllipseGeometryLibrary from \"./EllipseGeometryLibrary.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\nconst scratchCartesian1 = new Cartesian3();\nlet boundingSphereCenter = new Cartesian3();\n\nfunction computeEllipse(options) {\n  const center = options.center;\n  boundingSphereCenter = Cartesian3.multiplyByScalar(\n    options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter),\n    options.height,\n    boundingSphereCenter\n  );\n  boundingSphereCenter = Cartesian3.add(\n    center,\n    boundingSphereCenter,\n    boundingSphereCenter\n  );\n  const boundingSphere = new BoundingSphere(\n    boundingSphereCenter,\n    options.semiMajorAxis\n  );\n  const positions = EllipseGeometryLibrary.computeEllipsePositions(\n    options,\n    false,\n    true\n  ).outerPositions;\n\n  const attributes = new GeometryAttributes({\n    position: new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: EllipseGeometryLibrary.raisePositionsToHeight(\n        positions,\n        options,\n        false\n      ),\n    }),\n  });\n\n  const length = positions.length / 3;\n  const indices = IndexDatatype.createTypedArray(length, length * 2);\n  let index = 0;\n  for (let i = 0; i < length; ++i) {\n    indices[index++] = i;\n    indices[index++] = (i + 1) % length;\n  }\n\n  return {\n    boundingSphere: boundingSphere,\n    attributes: attributes,\n    indices: indices,\n  };\n}\n\nconst topBoundingSphere = new BoundingSphere();\nconst bottomBoundingSphere = new BoundingSphere();\nfunction computeExtrudedEllipse(options) {\n  const center = options.center;\n  const ellipsoid = options.ellipsoid;\n  const semiMajorAxis = options.semiMajorAxis;\n  let scaledNormal = Cartesian3.multiplyByScalar(\n    ellipsoid.geodeticSurfaceNormal(center, scratchCartesian1),\n    options.height,\n    scratchCartesian1\n  );\n  topBoundingSphere.center = Cartesian3.add(\n    center,\n    scaledNormal,\n    topBoundingSphere.center\n  );\n  topBoundingSphere.radius = semiMajorAxis;\n\n  scaledNormal = Cartesian3.multiplyByScalar(\n    ellipsoid.geodeticSurfaceNormal(center, scaledNormal),\n    options.extrudedHeight,\n    scaledNormal\n  );\n  bottomBoundingSphere.center = Cartesian3.add(\n    center,\n    scaledNormal,\n    bottomBoundingSphere.center\n  );\n  bottomBoundingSphere.radius = semiMajorAxis;\n\n  let positions = EllipseGeometryLibrary.computeEllipsePositions(\n    options,\n    false,\n    true\n  ).outerPositions;\n  const attributes = new GeometryAttributes({\n    position: new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: EllipseGeometryLibrary.raisePositionsToHeight(\n        positions,\n        options,\n        true\n      ),\n    }),\n  });\n\n  positions = attributes.position.values;\n  const boundingSphere = BoundingSphere.union(\n    topBoundingSphere,\n    bottomBoundingSphere\n  );\n  let length = positions.length / 3;\n\n  if (defined(options.offsetAttribute)) {\n    let applyOffset = new Uint8Array(length);\n    if (options.offsetAttribute === GeometryOffsetAttribute.TOP) {\n      applyOffset = applyOffset.fill(1, 0, length / 2);\n    } else {\n      const offsetValue =\n        options.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n      applyOffset = applyOffset.fill(offsetValue);\n    }\n\n    attributes.applyOffset = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 1,\n      values: applyOffset,\n    });\n  }\n\n  let numberOfVerticalLines = defaultValue(options.numberOfVerticalLines, 16);\n  numberOfVerticalLines = CesiumMath.clamp(\n    numberOfVerticalLines,\n    0,\n    length / 2\n  );\n\n  const indices = IndexDatatype.createTypedArray(\n    length,\n    length * 2 + numberOfVerticalLines * 2\n  );\n\n  length /= 2;\n  let index = 0;\n  let i;\n  for (i = 0; i < length; ++i) {\n    indices[index++] = i;\n    indices[index++] = (i + 1) % length;\n    indices[index++] = i + length;\n    indices[index++] = ((i + 1) % length) + length;\n  }\n\n  let numSide;\n  if (numberOfVerticalLines > 0) {\n    const numSideLines = Math.min(numberOfVerticalLines, length);\n    numSide = Math.round(length / numSideLines);\n\n    const maxI = Math.min(numSide * numberOfVerticalLines, length);\n    for (i = 0; i < maxI; i += numSide) {\n      indices[index++] = i;\n      indices[index++] = i + length;\n    }\n  }\n\n  return {\n    boundingSphere: boundingSphere,\n    attributes: attributes,\n    indices: indices,\n  };\n}\n\n/**\n * A description of the outline of an ellipse on an ellipsoid.\n *\n * @alias EllipseOutlineGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3} options.center The ellipse's center point in the fixed frame.\n * @param {number} options.semiMajorAxis The length of the ellipse's semi-major axis in meters.\n * @param {number} options.semiMinorAxis The length of the ellipse's semi-minor axis in meters.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on.\n * @param {number} [options.height=0.0] The distance in meters between the ellipse and the ellipsoid surface.\n * @param {number} [options.extrudedHeight] The distance in meters between the ellipse's extruded face and the ellipsoid surface.\n * @param {number} [options.rotation=0.0] The angle from north (counter-clockwise) in radians.\n * @param {number} [options.granularity=0.02] The angular distance between points on the ellipse in radians.\n * @param {number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom surface of an extruded ellipse.\n *\n * @exception {DeveloperError} semiMajorAxis and semiMinorAxis must be greater than zero.\n * @exception {DeveloperError} semiMajorAxis must be greater than or equal to the semiMinorAxis.\n * @exception {DeveloperError} granularity must be greater than zero.\n *\n * @see EllipseOutlineGeometry.createGeometry\n *\n * @example\n * const ellipse = new Cesium.EllipseOutlineGeometry({\n *   center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),\n *   semiMajorAxis : 500000.0,\n *   semiMinorAxis : 300000.0,\n *   rotation : Cesium.Math.toRadians(60.0)\n * });\n * const geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse);\n */\nfunction EllipseOutlineGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const center = options.center;\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  const semiMajorAxis = options.semiMajorAxis;\n  const semiMinorAxis = options.semiMinorAxis;\n  const granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(center)) {\n    throw new DeveloperError(\"center is required.\");\n  }\n  if (!defined(semiMajorAxis)) {\n    throw new DeveloperError(\"semiMajorAxis is required.\");\n  }\n  if (!defined(semiMinorAxis)) {\n    throw new DeveloperError(\"semiMinorAxis is required.\");\n  }\n  if (semiMajorAxis < semiMinorAxis) {\n    throw new DeveloperError(\n      \"semiMajorAxis must be greater than or equal to the semiMinorAxis.\"\n    );\n  }\n  if (granularity <= 0.0) {\n    throw new DeveloperError(\"granularity must be greater than zero.\");\n  }\n  //>>includeEnd('debug');\n\n  const height = defaultValue(options.height, 0.0);\n  const extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n  this._center = Cartesian3.clone(center);\n  this._semiMajorAxis = semiMajorAxis;\n  this._semiMinorAxis = semiMinorAxis;\n  this._ellipsoid = Ellipsoid.clone(ellipsoid);\n  this._rotation = defaultValue(options.rotation, 0.0);\n  this._height = Math.max(extrudedHeight, height);\n  this._granularity = granularity;\n  this._extrudedHeight = Math.min(extrudedHeight, height);\n  this._numberOfVerticalLines = Math.max(\n    defaultValue(options.numberOfVerticalLines, 16),\n    0\n  );\n  this._offsetAttribute = options.offsetAttribute;\n  this._workerName = \"createEllipseOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nEllipseOutlineGeometry.packedLength =\n  Cartesian3.packedLength + Ellipsoid.packedLength + 8;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {EllipseOutlineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nEllipseOutlineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required\");\n  }\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  Cartesian3.pack(value._center, array, startingIndex);\n  startingIndex += Cartesian3.packedLength;\n\n  Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  array[startingIndex++] = value._semiMajorAxis;\n  array[startingIndex++] = value._semiMinorAxis;\n  array[startingIndex++] = value._rotation;\n  array[startingIndex++] = value._height;\n  array[startingIndex++] = value._granularity;\n  array[startingIndex++] = value._extrudedHeight;\n  array[startingIndex++] = value._numberOfVerticalLines;\n  array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n  return array;\n};\n\nconst scratchCenter = new Cartesian3();\nconst scratchEllipsoid = new Ellipsoid();\nconst scratchOptions = {\n  center: scratchCenter,\n  ellipsoid: scratchEllipsoid,\n  semiMajorAxis: undefined,\n  semiMinorAxis: undefined,\n  rotation: undefined,\n  height: undefined,\n  granularity: undefined,\n  extrudedHeight: undefined,\n  numberOfVerticalLines: undefined,\n  offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {EllipseOutlineGeometry} [result] The object into which to store the result.\n * @returns {EllipseOutlineGeometry} The modified result parameter or a new EllipseOutlineGeometry instance if one was not provided.\n */\nEllipseOutlineGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const center = Cartesian3.unpack(array, startingIndex, scratchCenter);\n  startingIndex += Cartesian3.packedLength;\n\n  const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n  startingIndex += Ellipsoid.packedLength;\n\n  const semiMajorAxis = array[startingIndex++];\n  const semiMinorAxis = array[startingIndex++];\n  const rotation = array[startingIndex++];\n  const height = array[startingIndex++];\n  const granularity = array[startingIndex++];\n  const extrudedHeight = array[startingIndex++];\n  const numberOfVerticalLines = array[startingIndex++];\n  const offsetAttribute = array[startingIndex];\n\n  if (!defined(result)) {\n    scratchOptions.height = height;\n    scratchOptions.extrudedHeight = extrudedHeight;\n    scratchOptions.granularity = granularity;\n    scratchOptions.rotation = rotation;\n    scratchOptions.semiMajorAxis = semiMajorAxis;\n    scratchOptions.semiMinorAxis = semiMinorAxis;\n    scratchOptions.numberOfVerticalLines = numberOfVerticalLines;\n    scratchOptions.offsetAttribute =\n      offsetAttribute === -1 ? undefined : offsetAttribute;\n\n    return new EllipseOutlineGeometry(scratchOptions);\n  }\n\n  result._center = Cartesian3.clone(center, result._center);\n  result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n  result._semiMajorAxis = semiMajorAxis;\n  result._semiMinorAxis = semiMinorAxis;\n  result._rotation = rotation;\n  result._height = height;\n  result._granularity = granularity;\n  result._extrudedHeight = extrudedHeight;\n  result._numberOfVerticalLines = numberOfVerticalLines;\n  result._offsetAttribute =\n    offsetAttribute === -1 ? undefined : offsetAttribute;\n\n  return result;\n};\n\n/**\n * Computes the geometric representation of an outline of an ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.\n *\n * @param {EllipseOutlineGeometry} ellipseGeometry A description of the ellipse.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nEllipseOutlineGeometry.createGeometry = function (ellipseGeometry) {\n  if (\n    ellipseGeometry._semiMajorAxis <= 0.0 ||\n    ellipseGeometry._semiMinorAxis <= 0.0\n  ) {\n    return;\n  }\n\n  const height = ellipseGeometry._height;\n  const extrudedHeight = ellipseGeometry._extrudedHeight;\n  const extrude = !CesiumMath.equalsEpsilon(\n    height,\n    extrudedHeight,\n    0,\n    CesiumMath.EPSILON2\n  );\n\n  ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface(\n    ellipseGeometry._center,\n    ellipseGeometry._center\n  );\n  const options = {\n    center: ellipseGeometry._center,\n    semiMajorAxis: ellipseGeometry._semiMajorAxis,\n    semiMinorAxis: ellipseGeometry._semiMinorAxis,\n    ellipsoid: ellipseGeometry._ellipsoid,\n    rotation: ellipseGeometry._rotation,\n    height: height,\n    granularity: ellipseGeometry._granularity,\n    numberOfVerticalLines: ellipseGeometry._numberOfVerticalLines,\n  };\n  let geometry;\n  if (extrude) {\n    options.extrudedHeight = extrudedHeight;\n    options.offsetAttribute = ellipseGeometry._offsetAttribute;\n    geometry = computeExtrudedEllipse(options);\n  } else {\n    geometry = computeEllipse(options);\n\n    if (defined(ellipseGeometry._offsetAttribute)) {\n      const length = geometry.attributes.position.values.length;\n      const offsetValue =\n        ellipseGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n          ? 0\n          : 1;\n      const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n      geometry.attributes.applyOffset = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n        componentsPerAttribute: 1,\n        values: applyOffset,\n      });\n    }\n  }\n\n  return new Geometry({\n    attributes: geometry.attributes,\n    indices: geometry.indices,\n    primitiveType: PrimitiveType.LINES,\n    boundingSphere: geometry.boundingSphere,\n    offsetAttribute: ellipseGeometry._offsetAttribute,\n  });\n};\nexport default EllipseOutlineGeometry;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport EllipseGeometry from \"../Core/EllipseGeometry.js\";\nimport EllipseOutlineGeometry from \"../Core/EllipseOutlineGeometry.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport GroundGeometryUpdater from \"./GroundGeometryUpdater.js\";\nimport Property from \"./Property.js\";\n\nconst scratchColor = new Color();\nconst defaultOffset = Cartesian3.ZERO;\nconst offsetScratch = new Cartesian3();\nconst scratchRectangle = new Rectangle();\n\nfunction EllipseGeometryOptions(entity) {\n  this.id = entity;\n  this.vertexFormat = undefined;\n  this.center = undefined;\n  this.semiMajorAxis = undefined;\n  this.semiMinorAxis = undefined;\n  this.rotation = undefined;\n  this.height = undefined;\n  this.extrudedHeight = undefined;\n  this.granularity = undefined;\n  this.stRotation = undefined;\n  this.numberOfVerticalLines = undefined;\n  this.offsetAttribute = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for ellipses.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias EllipseGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction EllipseGeometryUpdater(entity, scene) {\n  GroundGeometryUpdater.call(this, {\n    entity: entity,\n    scene: scene,\n    geometryOptions: new EllipseGeometryOptions(entity),\n    geometryPropertyName: \"ellipse\",\n    observedPropertyNames: [\"availability\", \"position\", \"ellipse\"],\n  });\n\n  this._onEntityPropertyChanged(entity, \"ellipse\", entity.ellipse, undefined);\n}\n\nif (defined(Object.create)) {\n  EllipseGeometryUpdater.prototype = Object.create(\n    GroundGeometryUpdater.prototype\n  );\n  EllipseGeometryUpdater.prototype.constructor = EllipseGeometryUpdater;\n}\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nEllipseGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._fillEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent a filled geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n\n  const attributes = {\n    show: new ShowGeometryInstanceAttribute(\n      isAvailable &&\n        entity.isShowing &&\n        this._showProperty.getValue(time) &&\n        this._fillProperty.getValue(time)\n    ),\n    distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n      this._distanceDisplayConditionProperty.getValue(time)\n    ),\n    offset: undefined,\n    color: undefined,\n  };\n\n  if (this._materialProperty instanceof ColorMaterialProperty) {\n    let currentColor;\n    if (\n      defined(this._materialProperty.color) &&\n      (this._materialProperty.color.isConstant || isAvailable)\n    ) {\n      currentColor = this._materialProperty.color.getValue(time, scratchColor);\n    }\n    if (!defined(currentColor)) {\n      currentColor = Color.WHITE;\n    }\n    attributes.color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n  }\n\n  if (defined(this._options.offsetAttribute)) {\n    attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n      Property.getValueOrDefault(\n        this._terrainOffsetProperty,\n        time,\n        defaultOffset,\n        offsetScratch\n      )\n    );\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new EllipseGeometry(this._options),\n    attributes: attributes,\n  });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nEllipseGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n  time\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._outlineEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent an outlined geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n  const outlineColor = Property.getValueOrDefault(\n    this._outlineColorProperty,\n    time,\n    Color.BLACK,\n    scratchColor\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n\n  const attributes = {\n    show: new ShowGeometryInstanceAttribute(\n      isAvailable &&\n        entity.isShowing &&\n        this._showProperty.getValue(time) &&\n        this._showOutlineProperty.getValue(time)\n    ),\n    color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n    distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n      distanceDisplayCondition\n    ),\n    offset: undefined,\n  };\n\n  if (defined(this._options.offsetAttribute)) {\n    attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n      Property.getValueOrDefault(\n        this._terrainOffsetProperty,\n        time,\n        defaultOffset,\n        offsetScratch\n      )\n    );\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new EllipseOutlineGeometry(this._options),\n    attributes: attributes,\n  });\n};\n\nEllipseGeometryUpdater.prototype._computeCenter = function (time, result) {\n  return Property.getValueOrUndefined(this._entity.position, time, result);\n};\n\nEllipseGeometryUpdater.prototype._isHidden = function (entity, ellipse) {\n  const position = entity.position;\n\n  return (\n    !defined(position) ||\n    !defined(ellipse.semiMajorAxis) ||\n    !defined(ellipse.semiMinorAxis) ||\n    GeometryUpdater.prototype._isHidden.call(this, entity, ellipse)\n  );\n};\n\nEllipseGeometryUpdater.prototype._isDynamic = function (entity, ellipse) {\n  return (\n    !entity.position.isConstant || //\n    !ellipse.semiMajorAxis.isConstant || //\n    !ellipse.semiMinorAxis.isConstant || //\n    !Property.isConstant(ellipse.rotation) || //\n    !Property.isConstant(ellipse.height) || //\n    !Property.isConstant(ellipse.extrudedHeight) || //\n    !Property.isConstant(ellipse.granularity) || //\n    !Property.isConstant(ellipse.stRotation) || //\n    !Property.isConstant(ellipse.outlineWidth) || //\n    !Property.isConstant(ellipse.numberOfVerticalLines) || //\n    !Property.isConstant(ellipse.zIndex) || //\n    (this._onTerrain &&\n      !Property.isConstant(this._materialProperty) &&\n      !(this._materialProperty instanceof ColorMaterialProperty))\n  );\n};\n\nEllipseGeometryUpdater.prototype._setStaticOptions = function (\n  entity,\n  ellipse\n) {\n  let heightValue = Property.getValueOrUndefined(\n    ellipse.height,\n    Iso8601.MINIMUM_VALUE\n  );\n  const heightReferenceValue = Property.getValueOrDefault(\n    ellipse.heightReference,\n    Iso8601.MINIMUM_VALUE,\n    HeightReference.NONE\n  );\n  let extrudedHeightValue = Property.getValueOrUndefined(\n    ellipse.extrudedHeight,\n    Iso8601.MINIMUM_VALUE\n  );\n  const extrudedHeightReferenceValue = Property.getValueOrDefault(\n    ellipse.extrudedHeightReference,\n    Iso8601.MINIMUM_VALUE,\n    HeightReference.NONE\n  );\n  if (defined(extrudedHeightValue) && !defined(heightValue)) {\n    heightValue = 0;\n  }\n\n  const options = this._options;\n  options.vertexFormat =\n    this._materialProperty instanceof ColorMaterialProperty\n      ? PerInstanceColorAppearance.VERTEX_FORMAT\n      : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n  options.center = entity.position.getValue(\n    Iso8601.MINIMUM_VALUE,\n    options.center\n  );\n  options.semiMajorAxis = ellipse.semiMajorAxis.getValue(\n    Iso8601.MINIMUM_VALUE,\n    options.semiMajorAxis\n  );\n  options.semiMinorAxis = ellipse.semiMinorAxis.getValue(\n    Iso8601.MINIMUM_VALUE,\n    options.semiMinorAxis\n  );\n  options.rotation = Property.getValueOrUndefined(\n    ellipse.rotation,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.granularity = Property.getValueOrUndefined(\n    ellipse.granularity,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.stRotation = Property.getValueOrUndefined(\n    ellipse.stRotation,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.numberOfVerticalLines = Property.getValueOrUndefined(\n    ellipse.numberOfVerticalLines,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n    heightValue,\n    heightReferenceValue,\n    extrudedHeightValue,\n    extrudedHeightReferenceValue\n  );\n  options.height = GroundGeometryUpdater.getGeometryHeight(\n    heightValue,\n    heightReferenceValue\n  );\n\n  extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n    extrudedHeightValue,\n    extrudedHeightReferenceValue\n  );\n  if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n    extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n      EllipseGeometry.computeRectangle(options, scratchRectangle)\n    ).minimumTerrainHeight;\n  }\n\n  options.extrudedHeight = extrudedHeightValue;\n};\n\nEllipseGeometryUpdater.DynamicGeometryUpdater = DynamicEllipseGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicEllipseGeometryUpdater(\n  geometryUpdater,\n  primitives,\n  groundPrimitives\n) {\n  DynamicGeometryUpdater.call(\n    this,\n    geometryUpdater,\n    primitives,\n    groundPrimitives\n  );\n}\n\nif (defined(Object.create)) {\n  DynamicEllipseGeometryUpdater.prototype = Object.create(\n    DynamicGeometryUpdater.prototype\n  );\n  DynamicEllipseGeometryUpdater.prototype.constructor = DynamicEllipseGeometryUpdater;\n}\n\nDynamicEllipseGeometryUpdater.prototype._isHidden = function (\n  entity,\n  ellipse,\n  time\n) {\n  const options = this._options;\n  return (\n    !defined(options.center) ||\n    !defined(options.semiMajorAxis) ||\n    !defined(options.semiMinorAxis) ||\n    DynamicGeometryUpdater.prototype._isHidden.call(this, entity, ellipse, time)\n  );\n};\n\nDynamicEllipseGeometryUpdater.prototype._setOptions = function (\n  entity,\n  ellipse,\n  time\n) {\n  const options = this._options;\n  let heightValue = Property.getValueOrUndefined(ellipse.height, time);\n  const heightReferenceValue = Property.getValueOrDefault(\n    ellipse.heightReference,\n    time,\n    HeightReference.NONE\n  );\n  let extrudedHeightValue = Property.getValueOrUndefined(\n    ellipse.extrudedHeight,\n    time\n  );\n  const extrudedHeightReferenceValue = Property.getValueOrDefault(\n    ellipse.extrudedHeightReference,\n    time,\n    HeightReference.NONE\n  );\n  if (defined(extrudedHeightValue) && !defined(heightValue)) {\n    heightValue = 0;\n  }\n\n  options.center = Property.getValueOrUndefined(\n    entity.position,\n    time,\n    options.center\n  );\n  options.semiMajorAxis = Property.getValueOrUndefined(\n    ellipse.semiMajorAxis,\n    time\n  );\n  options.semiMinorAxis = Property.getValueOrUndefined(\n    ellipse.semiMinorAxis,\n    time\n  );\n  options.rotation = Property.getValueOrUndefined(ellipse.rotation, time);\n  options.granularity = Property.getValueOrUndefined(ellipse.granularity, time);\n  options.stRotation = Property.getValueOrUndefined(ellipse.stRotation, time);\n  options.numberOfVerticalLines = Property.getValueOrUndefined(\n    ellipse.numberOfVerticalLines,\n    time\n  );\n  options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n    heightValue,\n    heightReferenceValue,\n    extrudedHeightValue,\n    extrudedHeightReferenceValue\n  );\n  options.height = GroundGeometryUpdater.getGeometryHeight(\n    heightValue,\n    heightReferenceValue\n  );\n\n  extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n    extrudedHeightValue,\n    extrudedHeightReferenceValue\n  );\n  if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n    extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n      EllipseGeometry.computeRectangle(options, scratchRectangle)\n    ).minimumTerrainHeight;\n  }\n\n  options.extrudedHeight = extrudedHeightValue;\n};\nexport default EllipseGeometryUpdater;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst scratchPosition = new Cartesian3();\nconst scratchNormal = new Cartesian3();\nconst scratchTangent = new Cartesian3();\nconst scratchBitangent = new Cartesian3();\nconst scratchNormalST = new Cartesian3();\nconst defaultRadii = new Cartesian3(1.0, 1.0, 1.0);\n\nconst cos = Math.cos;\nconst sin = Math.sin;\n\n/**\n * A description of an ellipsoid centered at the origin.\n *\n * @alias EllipsoidGeometry\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Cartesian3} [options.radii=Cartesian3(1.0, 1.0, 1.0)] The radii of the ellipsoid in the x, y, and z directions.\n * @param {Cartesian3} [options.innerRadii=options.radii] The inner radii of the ellipsoid in the x, y, and z directions.\n * @param {number} [options.minimumClock=0.0] The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\n * @param {number} [options.maximumClock=2*PI] The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\n * @param {number} [options.minimumCone=0.0] The minimum angle measured from the positive z-axis and toward the negative z-axis.\n * @param {number} [options.maximumCone=PI] The maximum angle measured from the positive z-axis and toward the negative z-axis.\n * @param {number} [options.stackPartitions=64] The number of times to partition the ellipsoid into stacks.\n * @param {number} [options.slicePartitions=64] The number of times to partition the ellipsoid into radial slices.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @exception {DeveloperError} options.slicePartitions cannot be less than three.\n * @exception {DeveloperError} options.stackPartitions cannot be less than three.\n *\n * @see EllipsoidGeometry#createGeometry\n *\n * @example\n * const ellipsoid = new Cesium.EllipsoidGeometry({\n *   vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\n *   radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0)\n * });\n * const geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid);\n */\nfunction EllipsoidGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const radii = defaultValue(options.radii, defaultRadii);\n  const innerRadii = defaultValue(options.innerRadii, radii);\n  const minimumClock = defaultValue(options.minimumClock, 0.0);\n  const maximumClock = defaultValue(options.maximumClock, CesiumMath.TWO_PI);\n  const minimumCone = defaultValue(options.minimumCone, 0.0);\n  const maximumCone = defaultValue(options.maximumCone, CesiumMath.PI);\n  const stackPartitions = Math.round(defaultValue(options.stackPartitions, 64));\n  const slicePartitions = Math.round(defaultValue(options.slicePartitions, 64));\n  const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (slicePartitions < 3) {\n    throw new DeveloperError(\n      \"options.slicePartitions cannot be less than three.\"\n    );\n  }\n  if (stackPartitions < 3) {\n    throw new DeveloperError(\n      \"options.stackPartitions cannot be less than three.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._radii = Cartesian3.clone(radii);\n  this._innerRadii = Cartesian3.clone(innerRadii);\n  this._minimumClock = minimumClock;\n  this._maximumClock = maximumClock;\n  this._minimumCone = minimumCone;\n  this._maximumCone = maximumCone;\n  this._stackPartitions = stackPartitions;\n  this._slicePartitions = slicePartitions;\n  this._vertexFormat = VertexFormat.clone(vertexFormat);\n  this._offsetAttribute = options.offsetAttribute;\n  this._workerName = \"createEllipsoidGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nEllipsoidGeometry.packedLength =\n  2 * Cartesian3.packedLength + VertexFormat.packedLength + 7;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {EllipsoidGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nEllipsoidGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required\");\n  }\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  Cartesian3.pack(value._radii, array, startingIndex);\n  startingIndex += Cartesian3.packedLength;\n\n  Cartesian3.pack(value._innerRadii, array, startingIndex);\n  startingIndex += Cartesian3.packedLength;\n\n  VertexFormat.pack(value._vertexFormat, array, startingIndex);\n  startingIndex += VertexFormat.packedLength;\n\n  array[startingIndex++] = value._minimumClock;\n  array[startingIndex++] = value._maximumClock;\n  array[startingIndex++] = value._minimumCone;\n  array[startingIndex++] = value._maximumCone;\n  array[startingIndex++] = value._stackPartitions;\n  array[startingIndex++] = value._slicePartitions;\n  array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n  return array;\n};\n\nconst scratchRadii = new Cartesian3();\nconst scratchInnerRadii = new Cartesian3();\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n  radii: scratchRadii,\n  innerRadii: scratchInnerRadii,\n  vertexFormat: scratchVertexFormat,\n  minimumClock: undefined,\n  maximumClock: undefined,\n  minimumCone: undefined,\n  maximumCone: undefined,\n  stackPartitions: undefined,\n  slicePartitions: undefined,\n  offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {EllipsoidGeometry} [result] The object into which to store the result.\n * @returns {EllipsoidGeometry} The modified result parameter or a new EllipsoidGeometry instance if one was not provided.\n */\nEllipsoidGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const radii = Cartesian3.unpack(array, startingIndex, scratchRadii);\n  startingIndex += Cartesian3.packedLength;\n\n  const innerRadii = Cartesian3.unpack(array, startingIndex, scratchInnerRadii);\n  startingIndex += Cartesian3.packedLength;\n\n  const vertexFormat = VertexFormat.unpack(\n    array,\n    startingIndex,\n    scratchVertexFormat\n  );\n  startingIndex += VertexFormat.packedLength;\n\n  const minimumClock = array[startingIndex++];\n  const maximumClock = array[startingIndex++];\n  const minimumCone = array[startingIndex++];\n  const maximumCone = array[startingIndex++];\n  const stackPartitions = array[startingIndex++];\n  const slicePartitions = array[startingIndex++];\n  const offsetAttribute = array[startingIndex];\n\n  if (!defined(result)) {\n    scratchOptions.minimumClock = minimumClock;\n    scratchOptions.maximumClock = maximumClock;\n    scratchOptions.minimumCone = minimumCone;\n    scratchOptions.maximumCone = maximumCone;\n    scratchOptions.stackPartitions = stackPartitions;\n    scratchOptions.slicePartitions = slicePartitions;\n    scratchOptions.offsetAttribute =\n      offsetAttribute === -1 ? undefined : offsetAttribute;\n    return new EllipsoidGeometry(scratchOptions);\n  }\n\n  result._radii = Cartesian3.clone(radii, result._radii);\n  result._innerRadii = Cartesian3.clone(innerRadii, result._innerRadii);\n  result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n  result._minimumClock = minimumClock;\n  result._maximumClock = maximumClock;\n  result._minimumCone = minimumCone;\n  result._maximumCone = maximumCone;\n  result._stackPartitions = stackPartitions;\n  result._slicePartitions = slicePartitions;\n  result._offsetAttribute =\n    offsetAttribute === -1 ? undefined : offsetAttribute;\n\n  return result;\n};\n\n/**\n * Computes the geometric representation of an ellipsoid, including its vertices, indices, and a bounding sphere.\n *\n * @param {EllipsoidGeometry} ellipsoidGeometry A description of the ellipsoid.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nEllipsoidGeometry.createGeometry = function (ellipsoidGeometry) {\n  const radii = ellipsoidGeometry._radii;\n  if (radii.x <= 0 || radii.y <= 0 || radii.z <= 0) {\n    return;\n  }\n\n  const innerRadii = ellipsoidGeometry._innerRadii;\n  if (innerRadii.x <= 0 || innerRadii.y <= 0 || innerRadii.z <= 0) {\n    return;\n  }\n\n  const minimumClock = ellipsoidGeometry._minimumClock;\n  const maximumClock = ellipsoidGeometry._maximumClock;\n  const minimumCone = ellipsoidGeometry._minimumCone;\n  const maximumCone = ellipsoidGeometry._maximumCone;\n  const vertexFormat = ellipsoidGeometry._vertexFormat;\n\n  // Add an extra slice and stack so that the number of partitions is the\n  // number of surfaces rather than the number of joints\n  let slicePartitions = ellipsoidGeometry._slicePartitions + 1;\n  let stackPartitions = ellipsoidGeometry._stackPartitions + 1;\n\n  slicePartitions = Math.round(\n    (slicePartitions * Math.abs(maximumClock - minimumClock)) /\n      CesiumMath.TWO_PI\n  );\n  stackPartitions = Math.round(\n    (stackPartitions * Math.abs(maximumCone - minimumCone)) / CesiumMath.PI\n  );\n\n  if (slicePartitions < 2) {\n    slicePartitions = 2;\n  }\n  if (stackPartitions < 2) {\n    stackPartitions = 2;\n  }\n\n  let i;\n  let j;\n  let index = 0;\n\n  // Create arrays for theta and phi. Duplicate first and last angle to\n  // allow different normals at the intersections.\n  const phis = [minimumCone];\n  const thetas = [minimumClock];\n  for (i = 0; i < stackPartitions; i++) {\n    phis.push(\n      minimumCone + (i * (maximumCone - minimumCone)) / (stackPartitions - 1)\n    );\n  }\n  phis.push(maximumCone);\n  for (j = 0; j < slicePartitions; j++) {\n    thetas.push(\n      minimumClock + (j * (maximumClock - minimumClock)) / (slicePartitions - 1)\n    );\n  }\n  thetas.push(maximumClock);\n  const numPhis = phis.length;\n  const numThetas = thetas.length;\n\n  // Allow for extra indices if there is an inner surface and if we need\n  // to close the sides if the clock range is not a full circle\n  let extraIndices = 0;\n  let vertexMultiplier = 1.0;\n  const hasInnerSurface =\n    innerRadii.x !== radii.x ||\n    innerRadii.y !== radii.y ||\n    innerRadii.z !== radii.z;\n  let isTopOpen = false;\n  let isBotOpen = false;\n  let isClockOpen = false;\n  if (hasInnerSurface) {\n    vertexMultiplier = 2.0;\n    if (minimumCone > 0.0) {\n      isTopOpen = true;\n      extraIndices += slicePartitions - 1;\n    }\n    if (maximumCone < Math.PI) {\n      isBotOpen = true;\n      extraIndices += slicePartitions - 1;\n    }\n    if ((maximumClock - minimumClock) % CesiumMath.TWO_PI) {\n      isClockOpen = true;\n      extraIndices += (stackPartitions - 1) * 2 + 1;\n    } else {\n      extraIndices += 1;\n    }\n  }\n\n  const vertexCount = numThetas * numPhis * vertexMultiplier;\n  const positions = new Float64Array(vertexCount * 3);\n  const isInner = new Array(vertexCount).fill(false);\n  const negateNormal = new Array(vertexCount).fill(false);\n\n  // Multiply by 6 because there are two triangles per sector\n  const indexCount = slicePartitions * stackPartitions * vertexMultiplier;\n  const numIndices =\n    6 *\n    (indexCount +\n      extraIndices +\n      1 -\n      (slicePartitions + stackPartitions) * vertexMultiplier);\n  const indices = IndexDatatype.createTypedArray(indexCount, numIndices);\n\n  const normals = vertexFormat.normal\n    ? new Float32Array(vertexCount * 3)\n    : undefined;\n  const tangents = vertexFormat.tangent\n    ? new Float32Array(vertexCount * 3)\n    : undefined;\n  const bitangents = vertexFormat.bitangent\n    ? new Float32Array(vertexCount * 3)\n    : undefined;\n  const st = vertexFormat.st ? new Float32Array(vertexCount * 2) : undefined;\n\n  // Calculate sin/cos phi\n  const sinPhi = new Array(numPhis);\n  const cosPhi = new Array(numPhis);\n  for (i = 0; i < numPhis; i++) {\n    sinPhi[i] = sin(phis[i]);\n    cosPhi[i] = cos(phis[i]);\n  }\n\n  // Calculate sin/cos theta\n  const sinTheta = new Array(numThetas);\n  const cosTheta = new Array(numThetas);\n  for (j = 0; j < numThetas; j++) {\n    cosTheta[j] = cos(thetas[j]);\n    sinTheta[j] = sin(thetas[j]);\n  }\n\n  // Create outer surface\n  for (i = 0; i < numPhis; i++) {\n    for (j = 0; j < numThetas; j++) {\n      positions[index++] = radii.x * sinPhi[i] * cosTheta[j];\n      positions[index++] = radii.y * sinPhi[i] * sinTheta[j];\n      positions[index++] = radii.z * cosPhi[i];\n    }\n  }\n\n  // Create inner surface\n  let vertexIndex = vertexCount / 2.0;\n  if (hasInnerSurface) {\n    for (i = 0; i < numPhis; i++) {\n      for (j = 0; j < numThetas; j++) {\n        positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];\n        positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];\n        positions[index++] = innerRadii.z * cosPhi[i];\n\n        // Keep track of which vertices are the inner and which ones\n        // need the normal to be negated\n        isInner[vertexIndex] = true;\n        if (i > 0 && i !== numPhis - 1 && j !== 0 && j !== numThetas - 1) {\n          negateNormal[vertexIndex] = true;\n        }\n        vertexIndex++;\n      }\n    }\n  }\n\n  // Create indices for outer surface\n  index = 0;\n  let topOffset;\n  let bottomOffset;\n  for (i = 1; i < numPhis - 2; i++) {\n    topOffset = i * numThetas;\n    bottomOffset = (i + 1) * numThetas;\n\n    for (j = 1; j < numThetas - 2; j++) {\n      indices[index++] = bottomOffset + j;\n      indices[index++] = bottomOffset + j + 1;\n      indices[index++] = topOffset + j + 1;\n\n      indices[index++] = bottomOffset + j;\n      indices[index++] = topOffset + j + 1;\n      indices[index++] = topOffset + j;\n    }\n  }\n\n  // Create indices for inner surface\n  if (hasInnerSurface) {\n    const offset = numPhis * numThetas;\n    for (i = 1; i < numPhis - 2; i++) {\n      topOffset = offset + i * numThetas;\n      bottomOffset = offset + (i + 1) * numThetas;\n\n      for (j = 1; j < numThetas - 2; j++) {\n        indices[index++] = bottomOffset + j;\n        indices[index++] = topOffset + j;\n        indices[index++] = topOffset + j + 1;\n\n        indices[index++] = bottomOffset + j;\n        indices[index++] = topOffset + j + 1;\n        indices[index++] = bottomOffset + j + 1;\n      }\n    }\n  }\n\n  let outerOffset;\n  let innerOffset;\n  if (hasInnerSurface) {\n    if (isTopOpen) {\n      // Connect the top of the inner surface to the top of the outer surface\n      innerOffset = numPhis * numThetas;\n      for (i = 1; i < numThetas - 2; i++) {\n        indices[index++] = i;\n        indices[index++] = i + 1;\n        indices[index++] = innerOffset + i + 1;\n\n        indices[index++] = i;\n        indices[index++] = innerOffset + i + 1;\n        indices[index++] = innerOffset + i;\n      }\n    }\n\n    if (isBotOpen) {\n      // Connect the bottom of the inner surface to the bottom of the outer surface\n      outerOffset = numPhis * numThetas - numThetas;\n      innerOffset = numPhis * numThetas * vertexMultiplier - numThetas;\n      for (i = 1; i < numThetas - 2; i++) {\n        indices[index++] = outerOffset + i + 1;\n        indices[index++] = outerOffset + i;\n        indices[index++] = innerOffset + i;\n\n        indices[index++] = outerOffset + i + 1;\n        indices[index++] = innerOffset + i;\n        indices[index++] = innerOffset + i + 1;\n      }\n    }\n  }\n\n  // Connect the edges if clock is not closed\n  if (isClockOpen) {\n    for (i = 1; i < numPhis - 2; i++) {\n      innerOffset = numThetas * numPhis + numThetas * i;\n      outerOffset = numThetas * i;\n      indices[index++] = innerOffset;\n      indices[index++] = outerOffset + numThetas;\n      indices[index++] = outerOffset;\n\n      indices[index++] = innerOffset;\n      indices[index++] = innerOffset + numThetas;\n      indices[index++] = outerOffset + numThetas;\n    }\n\n    for (i = 1; i < numPhis - 2; i++) {\n      innerOffset = numThetas * numPhis + numThetas * (i + 1) - 1;\n      outerOffset = numThetas * (i + 1) - 1;\n      indices[index++] = outerOffset + numThetas;\n      indices[index++] = innerOffset;\n      indices[index++] = outerOffset;\n\n      indices[index++] = outerOffset + numThetas;\n      indices[index++] = innerOffset + numThetas;\n      indices[index++] = innerOffset;\n    }\n  }\n\n  const attributes = new GeometryAttributes();\n\n  if (vertexFormat.position) {\n    attributes.position = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: positions,\n    });\n  }\n\n  let stIndex = 0;\n  let normalIndex = 0;\n  let tangentIndex = 0;\n  let bitangentIndex = 0;\n  const vertexCountHalf = vertexCount / 2.0;\n\n  let ellipsoid;\n  const ellipsoidOuter = Ellipsoid.fromCartesian3(radii);\n  const ellipsoidInner = Ellipsoid.fromCartesian3(innerRadii);\n\n  if (\n    vertexFormat.st ||\n    vertexFormat.normal ||\n    vertexFormat.tangent ||\n    vertexFormat.bitangent\n  ) {\n    for (i = 0; i < vertexCount; i++) {\n      ellipsoid = isInner[i] ? ellipsoidInner : ellipsoidOuter;\n      const position = Cartesian3.fromArray(positions, i * 3, scratchPosition);\n      const normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal);\n      if (negateNormal[i]) {\n        Cartesian3.negate(normal, normal);\n      }\n\n      if (vertexFormat.st) {\n        const normalST = Cartesian2.negate(normal, scratchNormalST);\n        st[stIndex++] =\n          Math.atan2(normalST.y, normalST.x) / CesiumMath.TWO_PI + 0.5;\n        st[stIndex++] = Math.asin(normal.z) / Math.PI + 0.5;\n      }\n\n      if (vertexFormat.normal) {\n        normals[normalIndex++] = normal.x;\n        normals[normalIndex++] = normal.y;\n        normals[normalIndex++] = normal.z;\n      }\n\n      if (vertexFormat.tangent || vertexFormat.bitangent) {\n        const tangent = scratchTangent;\n\n        // Use UNIT_X for the poles\n        let tangetOffset = 0;\n        let unit;\n        if (isInner[i]) {\n          tangetOffset = vertexCountHalf;\n        }\n        if (\n          !isTopOpen &&\n          i >= tangetOffset &&\n          i < tangetOffset + numThetas * 2\n        ) {\n          unit = Cartesian3.UNIT_X;\n        } else {\n          unit = Cartesian3.UNIT_Z;\n        }\n        Cartesian3.cross(unit, normal, tangent);\n        Cartesian3.normalize(tangent, tangent);\n\n        if (vertexFormat.tangent) {\n          tangents[tangentIndex++] = tangent.x;\n          tangents[tangentIndex++] = tangent.y;\n          tangents[tangentIndex++] = tangent.z;\n        }\n\n        if (vertexFormat.bitangent) {\n          const bitangent = Cartesian3.cross(normal, tangent, scratchBitangent);\n          Cartesian3.normalize(bitangent, bitangent);\n\n          bitangents[bitangentIndex++] = bitangent.x;\n          bitangents[bitangentIndex++] = bitangent.y;\n          bitangents[bitangentIndex++] = bitangent.z;\n        }\n      }\n    }\n\n    if (vertexFormat.st) {\n      attributes.st = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 2,\n        values: st,\n      });\n    }\n\n    if (vertexFormat.normal) {\n      attributes.normal = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: normals,\n      });\n    }\n\n    if (vertexFormat.tangent) {\n      attributes.tangent = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: tangents,\n      });\n    }\n\n    if (vertexFormat.bitangent) {\n      attributes.bitangent = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: bitangents,\n      });\n    }\n  }\n\n  if (defined(ellipsoidGeometry._offsetAttribute)) {\n    const length = positions.length;\n    const offsetValue =\n      ellipsoidGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n        ? 0\n        : 1;\n    const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n    attributes.applyOffset = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 1,\n      values: applyOffset,\n    });\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: PrimitiveType.TRIANGLES,\n    boundingSphere: BoundingSphere.fromEllipsoid(ellipsoidOuter),\n    offsetAttribute: ellipsoidGeometry._offsetAttribute,\n  });\n};\n\nlet unitEllipsoidGeometry;\n\n/**\n * Returns the geometric representation of a unit ellipsoid, including its vertices, indices, and a bounding sphere.\n * @returns {Geometry} The computed vertices and indices.\n *\n * @private\n */\nEllipsoidGeometry.getUnitEllipsoid = function () {\n  if (!defined(unitEllipsoidGeometry)) {\n    unitEllipsoidGeometry = EllipsoidGeometry.createGeometry(\n      new EllipsoidGeometry({\n        radii: new Cartesian3(1.0, 1.0, 1.0),\n        vertexFormat: VertexFormat.POSITION_ONLY,\n      })\n    );\n  }\n  return unitEllipsoidGeometry;\n};\nexport default EllipsoidGeometry;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport EllipsoidGeometry from \"../Core/EllipsoidGeometry.js\";\nimport EllipsoidOutlineGeometry from \"../Core/EllipsoidOutlineGeometry.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GeometryOffsetAttribute from \"../Core/GeometryOffsetAttribute.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport Primitive from \"../Scene/Primitive.js\";\nimport SceneMode from \"../Scene/SceneMode.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport heightReferenceOnEntityPropertyChanged from \"./heightReferenceOnEntityPropertyChanged.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\n\nconst defaultMaterial = new ColorMaterialProperty(Color.WHITE);\nconst defaultOffset = Cartesian3.ZERO;\n\nconst offsetScratch = new Cartesian3();\nconst radiiScratch = new Cartesian3();\nconst innerRadiiScratch = new Cartesian3();\nconst scratchColor = new Color();\nconst unitSphere = new Cartesian3(1, 1, 1);\n\nfunction EllipsoidGeometryOptions(entity) {\n  this.id = entity;\n  this.vertexFormat = undefined;\n  this.radii = undefined;\n  this.innerRadii = undefined;\n  this.minimumClock = undefined;\n  this.maximumClock = undefined;\n  this.minimumCone = undefined;\n  this.maximumCone = undefined;\n  this.stackPartitions = undefined;\n  this.slicePartitions = undefined;\n  this.subdivisions = undefined;\n  this.offsetAttribute = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for ellipsoids.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias EllipsoidGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction EllipsoidGeometryUpdater(entity, scene) {\n  GeometryUpdater.call(this, {\n    entity: entity,\n    scene: scene,\n    geometryOptions: new EllipsoidGeometryOptions(entity),\n    geometryPropertyName: \"ellipsoid\",\n    observedPropertyNames: [\n      \"availability\",\n      \"position\",\n      \"orientation\",\n      \"ellipsoid\",\n    ],\n  });\n\n  this._onEntityPropertyChanged(\n    entity,\n    \"ellipsoid\",\n    entity.ellipsoid,\n    undefined\n  );\n}\n\nif (defined(Object.create)) {\n  EllipsoidGeometryUpdater.prototype = Object.create(GeometryUpdater.prototype);\n  EllipsoidGeometryUpdater.prototype.constructor = EllipsoidGeometryUpdater;\n}\n\nObject.defineProperties(EllipsoidGeometryUpdater.prototype, {\n  /**\n   * Gets the terrain offset property\n   * @type {TerrainOffsetProperty}\n   * @memberof EllipsoidGeometryUpdater.prototype\n   * @readonly\n   * @private\n   */\n  terrainOffsetProperty: {\n    get: function () {\n      return this._terrainOffsetProperty;\n    },\n  },\n});\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @param {boolean} [skipModelMatrix=false] Whether to compute a model matrix for the geometry instance\n * @param {Matrix4} [modelMatrixResult] Used to store the result of the model matrix calculation\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nEllipsoidGeometryUpdater.prototype.createFillGeometryInstance = function (\n  time,\n  skipModelMatrix,\n  modelMatrixResult\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n\n  let color;\n  const show = new ShowGeometryInstanceAttribute(\n    isAvailable &&\n      entity.isShowing &&\n      this._showProperty.getValue(time) &&\n      this._fillProperty.getValue(time)\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n  const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n    distanceDisplayCondition\n  );\n\n  const attributes = {\n    show: show,\n    distanceDisplayCondition: distanceDisplayConditionAttribute,\n    color: undefined,\n    offset: undefined,\n  };\n\n  if (this._materialProperty instanceof ColorMaterialProperty) {\n    let currentColor;\n    if (\n      defined(this._materialProperty.color) &&\n      (this._materialProperty.color.isConstant || isAvailable)\n    ) {\n      currentColor = this._materialProperty.color.getValue(time, scratchColor);\n    }\n    if (!defined(currentColor)) {\n      currentColor = Color.WHITE;\n    }\n    color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n    attributes.color = color;\n  }\n  if (defined(this._options.offsetAttribute)) {\n    attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n      Property.getValueOrDefault(\n        this._terrainOffsetProperty,\n        time,\n        defaultOffset,\n        offsetScratch\n      )\n    );\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new EllipsoidGeometry(this._options),\n    modelMatrix: skipModelMatrix\n      ? undefined\n      : entity.computeModelMatrixForHeightReference(\n          time,\n          entity.ellipsoid.heightReference,\n          this._options.radii.z * 0.5,\n          this._scene.mapProjection.ellipsoid,\n          modelMatrixResult\n        ),\n    attributes: attributes,\n  });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @param {boolean} [skipModelMatrix=false] Whether to compute a model matrix for the geometry instance\n * @param {Matrix4} [modelMatrixResult] Used to store the result of the model matrix calculation\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nEllipsoidGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n  time,\n  skipModelMatrix,\n  modelMatrixResult\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n\n  const outlineColor = Property.getValueOrDefault(\n    this._outlineColorProperty,\n    time,\n    Color.BLACK,\n    scratchColor\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n\n  const attributes = {\n    show: new ShowGeometryInstanceAttribute(\n      isAvailable &&\n        entity.isShowing &&\n        this._showProperty.getValue(time) &&\n        this._showOutlineProperty.getValue(time)\n    ),\n    color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n    distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n      distanceDisplayCondition\n    ),\n    offset: undefined,\n  };\n  if (defined(this._options.offsetAttribute)) {\n    attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n      Property.getValueOrDefault(\n        this._terrainOffsetProperty,\n        time,\n        defaultOffset,\n        offsetScratch\n      )\n    );\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new EllipsoidOutlineGeometry(this._options),\n    modelMatrix: skipModelMatrix\n      ? undefined\n      : entity.computeModelMatrixForHeightReference(\n          time,\n          entity.ellipsoid.heightReference,\n          this._options.radii.z * 0.5,\n          this._scene.mapProjection.ellipsoid,\n          modelMatrixResult\n        ),\n    attributes: attributes,\n  });\n};\n\nEllipsoidGeometryUpdater.prototype._computeCenter = function (time, result) {\n  return Property.getValueOrUndefined(this._entity.position, time, result);\n};\n\nEllipsoidGeometryUpdater.prototype._isHidden = function (entity, ellipsoid) {\n  return (\n    !defined(entity.position) ||\n    !defined(ellipsoid.radii) ||\n    GeometryUpdater.prototype._isHidden.call(this, entity, ellipsoid)\n  );\n};\n\nEllipsoidGeometryUpdater.prototype._isDynamic = function (entity, ellipsoid) {\n  return (\n    !entity.position.isConstant || //\n    !Property.isConstant(entity.orientation) || //\n    !ellipsoid.radii.isConstant || //\n    !Property.isConstant(ellipsoid.innerRadii) || //\n    !Property.isConstant(ellipsoid.stackPartitions) || //\n    !Property.isConstant(ellipsoid.slicePartitions) || //\n    !Property.isConstant(ellipsoid.outlineWidth) || //\n    !Property.isConstant(ellipsoid.minimumClock) || //\n    !Property.isConstant(ellipsoid.maximumClock) || //\n    !Property.isConstant(ellipsoid.minimumCone) || //\n    !Property.isConstant(ellipsoid.maximumCone) || //\n    !Property.isConstant(ellipsoid.subdivisions)\n  );\n};\n\nEllipsoidGeometryUpdater.prototype._setStaticOptions = function (\n  entity,\n  ellipsoid\n) {\n  const heightReference = Property.getValueOrDefault(\n    ellipsoid.heightReference,\n    Iso8601.MINIMUM_VALUE,\n    HeightReference.NONE\n  );\n  const options = this._options;\n  options.vertexFormat =\n    this._materialProperty instanceof ColorMaterialProperty\n      ? PerInstanceColorAppearance.VERTEX_FORMAT\n      : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n  options.radii = ellipsoid.radii.getValue(\n    Iso8601.MINIMUM_VALUE,\n    options.radii\n  );\n  options.innerRadii = Property.getValueOrUndefined(\n    ellipsoid.innerRadii,\n    options.radii\n  );\n  options.minimumClock = Property.getValueOrUndefined(\n    ellipsoid.minimumClock,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.maximumClock = Property.getValueOrUndefined(\n    ellipsoid.maximumClock,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.minimumCone = Property.getValueOrUndefined(\n    ellipsoid.minimumCone,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.maximumCone = Property.getValueOrUndefined(\n    ellipsoid.maximumCone,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.stackPartitions = Property.getValueOrUndefined(\n    ellipsoid.stackPartitions,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.slicePartitions = Property.getValueOrUndefined(\n    ellipsoid.slicePartitions,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.subdivisions = Property.getValueOrUndefined(\n    ellipsoid.subdivisions,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.offsetAttribute =\n    heightReference !== HeightReference.NONE\n      ? GeometryOffsetAttribute.ALL\n      : undefined;\n};\n\nEllipsoidGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged;\n\nEllipsoidGeometryUpdater.DynamicGeometryUpdater = DynamicEllipsoidGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicEllipsoidGeometryUpdater(\n  geometryUpdater,\n  primitives,\n  groundPrimitives\n) {\n  DynamicGeometryUpdater.call(\n    this,\n    geometryUpdater,\n    primitives,\n    groundPrimitives\n  );\n\n  this._scene = geometryUpdater._scene;\n  this._modelMatrix = new Matrix4();\n  this._attributes = undefined;\n  this._outlineAttributes = undefined;\n  this._lastSceneMode = undefined;\n  this._lastShow = undefined;\n  this._lastOutlineShow = undefined;\n  this._lastOutlineWidth = undefined;\n  this._lastOutlineColor = undefined;\n  this._lastOffset = new Cartesian3();\n  this._material = {};\n}\n\nif (defined(Object.create)) {\n  DynamicEllipsoidGeometryUpdater.prototype = Object.create(\n    DynamicGeometryUpdater.prototype\n  );\n  DynamicEllipsoidGeometryUpdater.prototype.constructor = DynamicEllipsoidGeometryUpdater;\n}\n\nDynamicEllipsoidGeometryUpdater.prototype.update = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const ellipsoid = entity.ellipsoid;\n  if (\n    !entity.isShowing ||\n    !entity.isAvailable(time) ||\n    !Property.getValueOrDefault(ellipsoid.show, time, true)\n  ) {\n    if (defined(this._primitive)) {\n      this._primitive.show = false;\n    }\n\n    if (defined(this._outlinePrimitive)) {\n      this._outlinePrimitive.show = false;\n    }\n    return;\n  }\n\n  const radii = Property.getValueOrUndefined(\n    ellipsoid.radii,\n    time,\n    radiiScratch\n  );\n  let modelMatrix = defined(radii)\n    ? entity.computeModelMatrixForHeightReference(\n        time,\n        ellipsoid.heightReference,\n        radii.z * 0.5,\n        this._scene.mapProjection.ellipsoid,\n        this._modelMatrix\n      )\n    : undefined;\n  if (!defined(modelMatrix) || !defined(radii)) {\n    if (defined(this._primitive)) {\n      this._primitive.show = false;\n    }\n\n    if (defined(this._outlinePrimitive)) {\n      this._outlinePrimitive.show = false;\n    }\n    return;\n  }\n\n  //Compute attributes and material.\n  const showFill = Property.getValueOrDefault(ellipsoid.fill, time, true);\n  const showOutline = Property.getValueOrDefault(\n    ellipsoid.outline,\n    time,\n    false\n  );\n  const outlineColor = Property.getValueOrClonedDefault(\n    ellipsoid.outlineColor,\n    time,\n    Color.BLACK,\n    scratchColor\n  );\n  const material = MaterialProperty.getValue(\n    time,\n    defaultValue(ellipsoid.material, defaultMaterial),\n    this._material\n  );\n\n  // Check properties that could trigger a primitive rebuild.\n  const innerRadii = Property.getValueOrUndefined(\n    ellipsoid.innerRadii,\n    time,\n    innerRadiiScratch\n  );\n  const minimumClock = Property.getValueOrUndefined(\n    ellipsoid.minimumClock,\n    time\n  );\n  const maximumClock = Property.getValueOrUndefined(\n    ellipsoid.maximumClock,\n    time\n  );\n  const minimumCone = Property.getValueOrUndefined(ellipsoid.minimumCone, time);\n  const maximumCone = Property.getValueOrUndefined(ellipsoid.maximumCone, time);\n  const stackPartitions = Property.getValueOrUndefined(\n    ellipsoid.stackPartitions,\n    time\n  );\n  const slicePartitions = Property.getValueOrUndefined(\n    ellipsoid.slicePartitions,\n    time\n  );\n  const subdivisions = Property.getValueOrUndefined(\n    ellipsoid.subdivisions,\n    time\n  );\n  const outlineWidth = Property.getValueOrDefault(\n    ellipsoid.outlineWidth,\n    time,\n    1.0\n  );\n  const heightReference = Property.getValueOrDefault(\n    ellipsoid.heightReference,\n    time,\n    HeightReference.NONE\n  );\n  const offsetAttribute =\n    heightReference !== HeightReference.NONE\n      ? GeometryOffsetAttribute.ALL\n      : undefined;\n\n  //In 3D we use a fast path by modifying Primitive.modelMatrix instead of regenerating the primitive every frame.\n  //Also check for height reference because this method doesn't work when the height is relative to terrain.\n  const sceneMode = this._scene.mode;\n  const in3D =\n    sceneMode === SceneMode.SCENE3D && heightReference === HeightReference.NONE;\n\n  const options = this._options;\n\n  const shadows = this._geometryUpdater.shadowsProperty.getValue(time);\n\n  const distanceDisplayConditionProperty = this._geometryUpdater\n    .distanceDisplayConditionProperty;\n  const distanceDisplayCondition = distanceDisplayConditionProperty.getValue(\n    time\n  );\n\n  const offset = Property.getValueOrDefault(\n    this._geometryUpdater.terrainOffsetProperty,\n    time,\n    defaultOffset,\n    offsetScratch\n  );\n\n  //We only rebuild the primitive if something other than the radii has changed\n  //For the radii, we use unit sphere and then deform it with a scale matrix.\n  const rebuildPrimitives =\n    !in3D ||\n    this._lastSceneMode !== sceneMode ||\n    !defined(this._primitive) || //\n    options.stackPartitions !== stackPartitions ||\n    options.slicePartitions !== slicePartitions || //\n    (defined(innerRadii) &&\n      !Cartesian3.equals(options.innerRadii !== innerRadii)) ||\n    options.minimumClock !== minimumClock || //\n    options.maximumClock !== maximumClock ||\n    options.minimumCone !== minimumCone || //\n    options.maximumCone !== maximumCone ||\n    options.subdivisions !== subdivisions || //\n    this._lastOutlineWidth !== outlineWidth ||\n    options.offsetAttribute !== offsetAttribute;\n\n  if (rebuildPrimitives) {\n    const primitives = this._primitives;\n    primitives.removeAndDestroy(this._primitive);\n    primitives.removeAndDestroy(this._outlinePrimitive);\n    this._primitive = undefined;\n    this._outlinePrimitive = undefined;\n    this._lastSceneMode = sceneMode;\n    this._lastOutlineWidth = outlineWidth;\n\n    options.stackPartitions = stackPartitions;\n    options.slicePartitions = slicePartitions;\n    options.subdivisions = subdivisions;\n    options.offsetAttribute = offsetAttribute;\n    options.radii = Cartesian3.clone(in3D ? unitSphere : radii, options.radii);\n    if (defined(innerRadii)) {\n      if (in3D) {\n        const mag = Cartesian3.magnitude(radii);\n        options.innerRadii = Cartesian3.fromElements(\n          innerRadii.x / mag,\n          innerRadii.y / mag,\n          innerRadii.z / mag,\n          options.innerRadii\n        );\n      } else {\n        options.innerRadii = Cartesian3.clone(innerRadii, options.innerRadii);\n      }\n    } else {\n      options.innerRadii = undefined;\n    }\n    options.minimumClock = minimumClock;\n    options.maximumClock = maximumClock;\n    options.minimumCone = minimumCone;\n    options.maximumCone = maximumCone;\n\n    const appearance = new MaterialAppearance({\n      material: material,\n      translucent: material.isTranslucent(),\n      closed: true,\n    });\n    options.vertexFormat = appearance.vertexFormat;\n\n    const fillInstance = this._geometryUpdater.createFillGeometryInstance(\n      time,\n      in3D,\n      this._modelMatrix\n    );\n\n    this._primitive = primitives.add(\n      new Primitive({\n        geometryInstances: fillInstance,\n        appearance: appearance,\n        asynchronous: false,\n        shadows: shadows,\n      })\n    );\n\n    const outlineInstance = this._geometryUpdater.createOutlineGeometryInstance(\n      time,\n      in3D,\n      this._modelMatrix\n    );\n    this._outlinePrimitive = primitives.add(\n      new Primitive({\n        geometryInstances: outlineInstance,\n        appearance: new PerInstanceColorAppearance({\n          flat: true,\n          translucent: outlineInstance.attributes.color.value[3] !== 255,\n          renderState: {\n            lineWidth: this._geometryUpdater._scene.clampLineWidth(\n              outlineWidth\n            ),\n          },\n        }),\n        asynchronous: false,\n        shadows: shadows,\n      })\n    );\n\n    this._lastShow = showFill;\n    this._lastOutlineShow = showOutline;\n    this._lastOutlineColor = Color.clone(outlineColor, this._lastOutlineColor);\n    this._lastDistanceDisplayCondition = distanceDisplayCondition;\n    this._lastOffset = Cartesian3.clone(offset, this._lastOffset);\n  } else if (this._primitive.ready) {\n    //Update attributes only.\n    const primitive = this._primitive;\n    const outlinePrimitive = this._outlinePrimitive;\n\n    primitive.show = true;\n    outlinePrimitive.show = true;\n    primitive.appearance.material = material;\n\n    let attributes = this._attributes;\n    if (!defined(attributes)) {\n      attributes = primitive.getGeometryInstanceAttributes(entity);\n      this._attributes = attributes;\n    }\n    if (showFill !== this._lastShow) {\n      attributes.show = ShowGeometryInstanceAttribute.toValue(\n        showFill,\n        attributes.show\n      );\n      this._lastShow = showFill;\n    }\n\n    let outlineAttributes = this._outlineAttributes;\n\n    if (!defined(outlineAttributes)) {\n      outlineAttributes = outlinePrimitive.getGeometryInstanceAttributes(\n        entity\n      );\n      this._outlineAttributes = outlineAttributes;\n    }\n\n    if (showOutline !== this._lastOutlineShow) {\n      outlineAttributes.show = ShowGeometryInstanceAttribute.toValue(\n        showOutline,\n        outlineAttributes.show\n      );\n      this._lastOutlineShow = showOutline;\n    }\n\n    if (!Color.equals(outlineColor, this._lastOutlineColor)) {\n      outlineAttributes.color = ColorGeometryInstanceAttribute.toValue(\n        outlineColor,\n        outlineAttributes.color\n      );\n      Color.clone(outlineColor, this._lastOutlineColor);\n    }\n\n    if (\n      !DistanceDisplayCondition.equals(\n        distanceDisplayCondition,\n        this._lastDistanceDisplayCondition\n      )\n    ) {\n      attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n        distanceDisplayCondition,\n        attributes.distanceDisplayCondition\n      );\n      outlineAttributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n        distanceDisplayCondition,\n        outlineAttributes.distanceDisplayCondition\n      );\n      DistanceDisplayCondition.clone(\n        distanceDisplayCondition,\n        this._lastDistanceDisplayCondition\n      );\n    }\n\n    if (!Cartesian3.equals(offset, this._lastOffset)) {\n      attributes.offset = OffsetGeometryInstanceAttribute.toValue(\n        offset,\n        attributes.offset\n      );\n      outlineAttributes.offset = OffsetGeometryInstanceAttribute.toValue(\n        offset,\n        attributes.offset\n      );\n      Cartesian3.clone(offset, this._lastOffset);\n    }\n  }\n\n  if (in3D) {\n    //Since we are scaling a unit sphere, we can't let any of the values go to zero.\n    //Instead we clamp them to a small value.  To the naked eye, this produces the same results\n    //that you get passing EllipsoidGeometry a radii with a zero component.\n    radii.x = Math.max(radii.x, 0.001);\n    radii.y = Math.max(radii.y, 0.001);\n    radii.z = Math.max(radii.z, 0.001);\n\n    modelMatrix = Matrix4.multiplyByScale(modelMatrix, radii, modelMatrix);\n    this._primitive.modelMatrix = modelMatrix;\n    this._outlinePrimitive.modelMatrix = modelMatrix;\n  }\n};\nexport default EllipsoidGeometryUpdater;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\n/**\n * Describes geometry representing a plane centered at the origin, with a unit width and length.\n *\n * @alias PlaneGeometry\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @example\n * const planeGeometry = new Cesium.PlaneGeometry({\n *   vertexFormat : Cesium.VertexFormat.POSITION_ONLY\n * });\n */\nfunction PlaneGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n\n  this._vertexFormat = vertexFormat;\n  this._workerName = \"createPlaneGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nPlaneGeometry.packedLength = VertexFormat.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PlaneGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nPlaneGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  VertexFormat.pack(value._vertexFormat, array, startingIndex);\n\n  return array;\n};\n\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n  vertexFormat: scratchVertexFormat,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PlaneGeometry} [result] The object into which to store the result.\n * @returns {PlaneGeometry} The modified result parameter or a new PlaneGeometry instance if one was not provided.\n */\nPlaneGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const vertexFormat = VertexFormat.unpack(\n    array,\n    startingIndex,\n    scratchVertexFormat\n  );\n\n  if (!defined(result)) {\n    return new PlaneGeometry(scratchOptions);\n  }\n\n  result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n\n  return result;\n};\n\nconst min = new Cartesian3(-0.5, -0.5, 0.0);\nconst max = new Cartesian3(0.5, 0.5, 0.0);\n\n/**\n * Computes the geometric representation of a plane, including its vertices, indices, and a bounding sphere.\n *\n * @param {PlaneGeometry} planeGeometry A description of the plane.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nPlaneGeometry.createGeometry = function (planeGeometry) {\n  const vertexFormat = planeGeometry._vertexFormat;\n\n  const attributes = new GeometryAttributes();\n  let indices;\n  let positions;\n\n  if (vertexFormat.position) {\n    // 4 corner points.  Duplicated 3 times each for each incident edge/face.\n    positions = new Float64Array(4 * 3);\n\n    // +z face\n    positions[0] = min.x;\n    positions[1] = min.y;\n    positions[2] = 0.0;\n    positions[3] = max.x;\n    positions[4] = min.y;\n    positions[5] = 0.0;\n    positions[6] = max.x;\n    positions[7] = max.y;\n    positions[8] = 0.0;\n    positions[9] = min.x;\n    positions[10] = max.y;\n    positions[11] = 0.0;\n\n    attributes.position = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: positions,\n    });\n\n    if (vertexFormat.normal) {\n      const normals = new Float32Array(4 * 3);\n\n      // +z face\n      normals[0] = 0.0;\n      normals[1] = 0.0;\n      normals[2] = 1.0;\n      normals[3] = 0.0;\n      normals[4] = 0.0;\n      normals[5] = 1.0;\n      normals[6] = 0.0;\n      normals[7] = 0.0;\n      normals[8] = 1.0;\n      normals[9] = 0.0;\n      normals[10] = 0.0;\n      normals[11] = 1.0;\n\n      attributes.normal = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: normals,\n      });\n    }\n\n    if (vertexFormat.st) {\n      const texCoords = new Float32Array(4 * 2);\n\n      // +z face\n      texCoords[0] = 0.0;\n      texCoords[1] = 0.0;\n      texCoords[2] = 1.0;\n      texCoords[3] = 0.0;\n      texCoords[4] = 1.0;\n      texCoords[5] = 1.0;\n      texCoords[6] = 0.0;\n      texCoords[7] = 1.0;\n\n      attributes.st = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 2,\n        values: texCoords,\n      });\n    }\n\n    if (vertexFormat.tangent) {\n      const tangents = new Float32Array(4 * 3);\n\n      // +z face\n      tangents[0] = 1.0;\n      tangents[1] = 0.0;\n      tangents[2] = 0.0;\n      tangents[3] = 1.0;\n      tangents[4] = 0.0;\n      tangents[5] = 0.0;\n      tangents[6] = 1.0;\n      tangents[7] = 0.0;\n      tangents[8] = 0.0;\n      tangents[9] = 1.0;\n      tangents[10] = 0.0;\n      tangents[11] = 0.0;\n\n      attributes.tangent = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: tangents,\n      });\n    }\n\n    if (vertexFormat.bitangent) {\n      const bitangents = new Float32Array(4 * 3);\n\n      // +z face\n      bitangents[0] = 0.0;\n      bitangents[1] = 1.0;\n      bitangents[2] = 0.0;\n      bitangents[3] = 0.0;\n      bitangents[4] = 1.0;\n      bitangents[5] = 0.0;\n      bitangents[6] = 0.0;\n      bitangents[7] = 1.0;\n      bitangents[8] = 0.0;\n      bitangents[9] = 0.0;\n      bitangents[10] = 1.0;\n      bitangents[11] = 0.0;\n\n      attributes.bitangent = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: bitangents,\n      });\n    }\n\n    // 2 triangles\n    indices = new Uint16Array(2 * 3);\n\n    // +z face\n    indices[0] = 0;\n    indices[1] = 1;\n    indices[2] = 2;\n    indices[3] = 0;\n    indices[4] = 2;\n    indices[5] = 3;\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: PrimitiveType.TRIANGLES,\n    boundingSphere: new BoundingSphere(Cartesian3.ZERO, Math.sqrt(2.0)),\n  });\n};\nexport default PlaneGeometry;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defined from \"./defined.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\n/**\n * Describes geometry representing the outline of a plane centered at the origin, with a unit width and length.\n *\n * @alias PlaneOutlineGeometry\n * @constructor\n *\n */\nfunction PlaneOutlineGeometry() {\n  this._workerName = \"createPlaneOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nPlaneOutlineGeometry.packedLength = 0;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PlaneOutlineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n *\n * @returns {number[]} The array that was packed into\n */\nPlaneOutlineGeometry.pack = function (value, array) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PlaneOutlineGeometry} [result] The object into which to store the result.\n * @returns {PlaneOutlineGeometry} The modified result parameter or a new PlaneOutlineGeometry instance if one was not provided.\n */\nPlaneOutlineGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new PlaneOutlineGeometry();\n  }\n\n  return result;\n};\n\nconst min = new Cartesian3(-0.5, -0.5, 0.0);\nconst max = new Cartesian3(0.5, 0.5, 0.0);\n\n/**\n * Computes the geometric representation of an outline of a plane, including its vertices, indices, and a bounding sphere.\n *\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nPlaneOutlineGeometry.createGeometry = function () {\n  const attributes = new GeometryAttributes();\n  const indices = new Uint16Array(4 * 2);\n  const positions = new Float64Array(4 * 3);\n\n  positions[0] = min.x;\n  positions[1] = min.y;\n  positions[2] = min.z;\n  positions[3] = max.x;\n  positions[4] = min.y;\n  positions[5] = min.z;\n  positions[6] = max.x;\n  positions[7] = max.y;\n  positions[8] = min.z;\n  positions[9] = min.x;\n  positions[10] = max.y;\n  positions[11] = min.z;\n\n  attributes.position = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.DOUBLE,\n    componentsPerAttribute: 3,\n    values: positions,\n  });\n\n  indices[0] = 0;\n  indices[1] = 1;\n  indices[2] = 1;\n  indices[3] = 2;\n  indices[4] = 2;\n  indices[5] = 3;\n  indices[6] = 3;\n  indices[7] = 0;\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: PrimitiveType.LINES,\n    boundingSphere: new BoundingSphere(Cartesian3.ZERO, Math.sqrt(2.0)),\n  });\n};\nexport default PlaneOutlineGeometry;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PlaneGeometry from \"../Core/PlaneGeometry.js\";\nimport PlaneOutlineGeometry from \"../Core/PlaneOutlineGeometry.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport Property from \"./Property.js\";\n\nconst positionScratch = new Cartesian3();\nconst scratchColor = new Color();\n\nfunction PlaneGeometryOptions(entity) {\n  this.id = entity;\n  this.vertexFormat = undefined;\n  this.plane = undefined;\n  this.dimensions = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for planes.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias PlaneGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction PlaneGeometryUpdater(entity, scene) {\n  GeometryUpdater.call(this, {\n    entity: entity,\n    scene: scene,\n    geometryOptions: new PlaneGeometryOptions(entity),\n    geometryPropertyName: \"plane\",\n    observedPropertyNames: [\"availability\", \"position\", \"orientation\", \"plane\"],\n  });\n\n  this._onEntityPropertyChanged(entity, \"plane\", entity.plane, undefined);\n}\n\nif (defined(Object.create)) {\n  PlaneGeometryUpdater.prototype = Object.create(GeometryUpdater.prototype);\n  PlaneGeometryUpdater.prototype.constructor = PlaneGeometryUpdater;\n}\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nPlaneGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._fillEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent a filled geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n\n  let attributes;\n\n  let color;\n  const show = new ShowGeometryInstanceAttribute(\n    isAvailable &&\n      entity.isShowing &&\n      this._showProperty.getValue(time) &&\n      this._fillProperty.getValue(time)\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n  const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n    distanceDisplayCondition\n  );\n  if (this._materialProperty instanceof ColorMaterialProperty) {\n    let currentColor;\n    if (\n      defined(this._materialProperty.color) &&\n      (this._materialProperty.color.isConstant || isAvailable)\n    ) {\n      currentColor = this._materialProperty.color.getValue(time, scratchColor);\n    }\n    if (!defined(currentColor)) {\n      currentColor = Color.WHITE;\n    }\n    color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n    attributes = {\n      show: show,\n      distanceDisplayCondition: distanceDisplayConditionAttribute,\n      color: color,\n    };\n  } else {\n    attributes = {\n      show: show,\n      distanceDisplayCondition: distanceDisplayConditionAttribute,\n    };\n  }\n\n  const planeGraphics = entity.plane;\n  const options = this._options;\n  let modelMatrix = entity.computeModelMatrix(time);\n  const plane = Property.getValueOrDefault(\n    planeGraphics.plane,\n    time,\n    options.plane\n  );\n  const dimensions = Property.getValueOrUndefined(\n    planeGraphics.dimensions,\n    time,\n    options.dimensions\n  );\n\n  options.plane = plane;\n  options.dimensions = dimensions;\n\n  modelMatrix = createPrimitiveMatrix(\n    plane,\n    dimensions,\n    modelMatrix,\n    modelMatrix\n  );\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new PlaneGeometry(this._options),\n    modelMatrix: modelMatrix,\n    attributes: attributes,\n  });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nPlaneGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._outlineEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent an outlined geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n  const outlineColor = Property.getValueOrDefault(\n    this._outlineColorProperty,\n    time,\n    Color.BLACK,\n    scratchColor\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n\n  const planeGraphics = entity.plane;\n  const options = this._options;\n  let modelMatrix = entity.computeModelMatrix(time);\n  const plane = Property.getValueOrDefault(\n    planeGraphics.plane,\n    time,\n    options.plane\n  );\n  const dimensions = Property.getValueOrUndefined(\n    planeGraphics.dimensions,\n    time,\n    options.dimensions\n  );\n\n  options.plane = plane;\n  options.dimensions = dimensions;\n\n  modelMatrix = createPrimitiveMatrix(\n    plane,\n    dimensions,\n    modelMatrix,\n    modelMatrix\n  );\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new PlaneOutlineGeometry(),\n    modelMatrix: modelMatrix,\n    attributes: {\n      show: new ShowGeometryInstanceAttribute(\n        isAvailable &&\n          entity.isShowing &&\n          this._showProperty.getValue(time) &&\n          this._showOutlineProperty.getValue(time)\n      ),\n      color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n      distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n        distanceDisplayCondition\n      ),\n    },\n  });\n};\n\nPlaneGeometryUpdater.prototype._isHidden = function (entity, plane) {\n  return (\n    !defined(plane.plane) ||\n    !defined(plane.dimensions) ||\n    !defined(entity.position) ||\n    GeometryUpdater.prototype._isHidden.call(this, entity, plane)\n  );\n};\n\nPlaneGeometryUpdater.prototype._getIsClosed = function (options) {\n  return false;\n};\n\nPlaneGeometryUpdater.prototype._isDynamic = function (entity, plane) {\n  return (\n    !entity.position.isConstant || //\n    !Property.isConstant(entity.orientation) || //\n    !plane.plane.isConstant || //\n    !plane.dimensions.isConstant || //\n    !Property.isConstant(plane.outlineWidth)\n  );\n};\n\nPlaneGeometryUpdater.prototype._setStaticOptions = function (entity, plane) {\n  const isColorMaterial =\n    this._materialProperty instanceof ColorMaterialProperty;\n\n  const options = this._options;\n  options.vertexFormat = isColorMaterial\n    ? PerInstanceColorAppearance.VERTEX_FORMAT\n    : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n  options.plane = plane.plane.getValue(Iso8601.MINIMUM_VALUE, options.plane);\n  options.dimensions = plane.dimensions.getValue(\n    Iso8601.MINIMUM_VALUE,\n    options.dimensions\n  );\n};\n\nPlaneGeometryUpdater.DynamicGeometryUpdater = DynamicPlaneGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicPlaneGeometryUpdater(\n  geometryUpdater,\n  primitives,\n  groundPrimitives\n) {\n  DynamicGeometryUpdater.call(\n    this,\n    geometryUpdater,\n    primitives,\n    groundPrimitives\n  );\n}\n\nif (defined(Object.create)) {\n  DynamicPlaneGeometryUpdater.prototype = Object.create(\n    DynamicGeometryUpdater.prototype\n  );\n  DynamicPlaneGeometryUpdater.prototype.constructor = DynamicPlaneGeometryUpdater;\n}\n\nDynamicPlaneGeometryUpdater.prototype._isHidden = function (\n  entity,\n  plane,\n  time\n) {\n  const options = this._options;\n  const position = Property.getValueOrUndefined(\n    entity.position,\n    time,\n    positionScratch\n  );\n  return (\n    !defined(position) ||\n    !defined(options.plane) ||\n    !defined(options.dimensions) ||\n    DynamicGeometryUpdater.prototype._isHidden.call(this, entity, plane, time)\n  );\n};\n\nDynamicPlaneGeometryUpdater.prototype._setOptions = function (\n  entity,\n  plane,\n  time\n) {\n  const options = this._options;\n  options.plane = Property.getValueOrDefault(plane.plane, time, options.plane);\n  options.dimensions = Property.getValueOrUndefined(\n    plane.dimensions,\n    time,\n    options.dimensions\n  );\n};\n\nconst scratchAxis = new Cartesian3();\nconst scratchUp = new Cartesian3();\nconst scratchTranslation = new Cartesian3();\nconst scratchScale = new Cartesian3();\nconst scratchRotation = new Matrix3();\nconst scratchRotationScale = new Matrix3();\nconst scratchLocalTransform = new Matrix4();\nfunction createPrimitiveMatrix(plane, dimensions, transform, result) {\n  const normal = plane.normal;\n  const distance = plane.distance;\n\n  const translation = Cartesian3.multiplyByScalar(\n    normal,\n    -distance,\n    scratchTranslation\n  );\n\n  let up = Cartesian3.clone(Cartesian3.UNIT_Z, scratchUp);\n  if (\n    CesiumMath.equalsEpsilon(\n      Math.abs(Cartesian3.dot(up, normal)),\n      1.0,\n      CesiumMath.EPSILON8\n    )\n  ) {\n    up = Cartesian3.clone(Cartesian3.UNIT_Y, up);\n  }\n\n  const left = Cartesian3.cross(up, normal, scratchAxis);\n  up = Cartesian3.cross(normal, left, up);\n  Cartesian3.normalize(left, left);\n  Cartesian3.normalize(up, up);\n\n  const rotationMatrix = scratchRotation;\n  Matrix3.setColumn(rotationMatrix, 0, left, rotationMatrix);\n  Matrix3.setColumn(rotationMatrix, 1, up, rotationMatrix);\n  Matrix3.setColumn(rotationMatrix, 2, normal, rotationMatrix);\n\n  const scale = Cartesian3.fromElements(\n    dimensions.x,\n    dimensions.y,\n    1.0,\n    scratchScale\n  );\n  const rotationScaleMatrix = Matrix3.multiplyByScale(\n    rotationMatrix,\n    scale,\n    scratchRotationScale\n  );\n\n  const localTransform = Matrix4.fromRotationTranslation(\n    rotationScaleMatrix,\n    translation,\n    scratchLocalTransform\n  );\n  return Matrix4.multiplyTransformation(transform, localTransform, result);\n}\n\n/**\n * @private\n */\nPlaneGeometryUpdater.createPrimitiveMatrix = createPrimitiveMatrix;\nexport default PlaneGeometryUpdater;\n", "import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingRectangle from \"./BoundingRectangle.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CoplanarPolygonGeometryLibrary from \"./CoplanarPolygonGeometryLibrary.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryInstance from \"./GeometryInstance.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport PolygonGeometryLibrary from \"./PolygonGeometryLibrary.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst scratchPosition = new Cartesian3();\nconst scratchBR = new BoundingRectangle();\nconst stScratch = new Cartesian2();\nconst textureCoordinatesOrigin = new Cartesian2();\nconst scratchNormal = new Cartesian3();\nconst scratchTangent = new Cartesian3();\nconst scratchBitangent = new Cartesian3();\nconst centerScratch = new Cartesian3();\nconst axis1Scratch = new Cartesian3();\nconst axis2Scratch = new Cartesian3();\nconst quaternionScratch = new Quaternion();\nconst textureMatrixScratch = new Matrix3();\nconst tangentRotationScratch = new Matrix3();\nconst surfaceNormalScratch = new Cartesian3();\n\nfunction createGeometryFromPolygon(\n  polygon,\n  vertexFormat,\n  boundingRectangle,\n  stRotation,\n  hardcodedTextureCoordinates,\n  projectPointTo2D,\n  normal,\n  tangent,\n  bitangent\n) {\n  const positions = polygon.positions;\n  let indices = PolygonPipeline.triangulate(polygon.positions2D, polygon.holes);\n\n  /* If polygon is completely unrenderable, just use the first three vertices */\n  if (indices.length < 3) {\n    indices = [0, 1, 2];\n  }\n\n  const newIndices = IndexDatatype.createTypedArray(\n    positions.length,\n    indices.length\n  );\n  newIndices.set(indices);\n\n  let textureMatrix = textureMatrixScratch;\n  if (stRotation !== 0.0) {\n    let rotation = Quaternion.fromAxisAngle(\n      normal,\n      stRotation,\n      quaternionScratch\n    );\n    textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrix);\n\n    if (vertexFormat.tangent || vertexFormat.bitangent) {\n      rotation = Quaternion.fromAxisAngle(\n        normal,\n        -stRotation,\n        quaternionScratch\n      );\n      const tangentRotation = Matrix3.fromQuaternion(\n        rotation,\n        tangentRotationScratch\n      );\n\n      tangent = Cartesian3.normalize(\n        Matrix3.multiplyByVector(tangentRotation, tangent, tangent),\n        tangent\n      );\n      if (vertexFormat.bitangent) {\n        bitangent = Cartesian3.normalize(\n          Cartesian3.cross(normal, tangent, bitangent),\n          bitangent\n        );\n      }\n    }\n  } else {\n    textureMatrix = Matrix3.clone(Matrix3.IDENTITY, textureMatrix);\n  }\n\n  const stOrigin = textureCoordinatesOrigin;\n  if (vertexFormat.st) {\n    stOrigin.x = boundingRectangle.x;\n    stOrigin.y = boundingRectangle.y;\n  }\n\n  const length = positions.length;\n  const size = length * 3;\n  const flatPositions = new Float64Array(size);\n  const normals = vertexFormat.normal ? new Float32Array(size) : undefined;\n  const tangents = vertexFormat.tangent ? new Float32Array(size) : undefined;\n  const bitangents = vertexFormat.bitangent\n    ? new Float32Array(size)\n    : undefined;\n  const textureCoordinates = vertexFormat.st\n    ? new Float32Array(length * 2)\n    : undefined;\n\n  let positionIndex = 0;\n  let normalIndex = 0;\n  let bitangentIndex = 0;\n  let tangentIndex = 0;\n  let stIndex = 0;\n\n  for (let i = 0; i < length; i++) {\n    const position = positions[i];\n    flatPositions[positionIndex++] = position.x;\n    flatPositions[positionIndex++] = position.y;\n    flatPositions[positionIndex++] = position.z;\n\n    if (vertexFormat.st) {\n      if (\n        defined(hardcodedTextureCoordinates) &&\n        hardcodedTextureCoordinates.positions.length === length\n      ) {\n        textureCoordinates[stIndex++] =\n          hardcodedTextureCoordinates.positions[i].x;\n        textureCoordinates[stIndex++] =\n          hardcodedTextureCoordinates.positions[i].y;\n      } else {\n        const p = Matrix3.multiplyByVector(\n          textureMatrix,\n          position,\n          scratchPosition\n        );\n        const st = projectPointTo2D(p, stScratch);\n        Cartesian2.subtract(st, stOrigin, st);\n\n        const stx = CesiumMath.clamp(st.x / boundingRectangle.width, 0, 1);\n        const sty = CesiumMath.clamp(st.y / boundingRectangle.height, 0, 1);\n        textureCoordinates[stIndex++] = stx;\n        textureCoordinates[stIndex++] = sty;\n      }\n    }\n\n    if (vertexFormat.normal) {\n      normals[normalIndex++] = normal.x;\n      normals[normalIndex++] = normal.y;\n      normals[normalIndex++] = normal.z;\n    }\n\n    if (vertexFormat.tangent) {\n      tangents[tangentIndex++] = tangent.x;\n      tangents[tangentIndex++] = tangent.y;\n      tangents[tangentIndex++] = tangent.z;\n    }\n\n    if (vertexFormat.bitangent) {\n      bitangents[bitangentIndex++] = bitangent.x;\n      bitangents[bitangentIndex++] = bitangent.y;\n      bitangents[bitangentIndex++] = bitangent.z;\n    }\n  }\n\n  const attributes = new GeometryAttributes();\n\n  if (vertexFormat.position) {\n    attributes.position = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: flatPositions,\n    });\n  }\n\n  if (vertexFormat.normal) {\n    attributes.normal = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: normals,\n    });\n  }\n\n  if (vertexFormat.tangent) {\n    attributes.tangent = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: tangents,\n    });\n  }\n\n  if (vertexFormat.bitangent) {\n    attributes.bitangent = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: bitangents,\n    });\n  }\n\n  if (vertexFormat.st) {\n    attributes.st = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n      values: textureCoordinates,\n    });\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: newIndices,\n    primitiveType: PrimitiveType.TRIANGLES,\n  });\n}\n\n/**\n * A description of a polygon composed of arbitrary coplanar positions.\n *\n * @alias CoplanarPolygonGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.\n * @param {number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points.\n *\n * @example\n * const polygonGeometry = new Cesium.CoplanarPolygonGeometry({\n *  polygonHierarchy: new Cesium.PolygonHierarchy(\n *     Cesium.Cartesian3.fromDegreesArrayHeights([\n *      -90.0, 30.0, 0.0,\n *      -90.0, 30.0, 300000.0,\n *      -80.0, 30.0, 300000.0,\n *      -80.0, 30.0, 0.0\n *   ]))\n * });\n *\n */\nfunction CoplanarPolygonGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const polygonHierarchy = options.polygonHierarchy;\n  const textureCoordinates = options.textureCoordinates;\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.polygonHierarchy\", polygonHierarchy);\n  //>>includeEnd('debug');\n\n  const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n  this._vertexFormat = VertexFormat.clone(vertexFormat);\n  this._polygonHierarchy = polygonHierarchy;\n  this._stRotation = defaultValue(options.stRotation, 0.0);\n  this._ellipsoid = Ellipsoid.clone(\n    defaultValue(options.ellipsoid, Ellipsoid.WGS84)\n  );\n  this._workerName = \"createCoplanarPolygonGeometry\";\n  this._textureCoordinates = textureCoordinates;\n\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  this.packedLength =\n    PolygonGeometryLibrary.computeHierarchyPackedLength(\n      polygonHierarchy,\n      Cartesian3\n    ) +\n    VertexFormat.packedLength +\n    Ellipsoid.packedLength +\n    (defined(textureCoordinates)\n      ? PolygonGeometryLibrary.computeHierarchyPackedLength(\n          textureCoordinates,\n          Cartesian2\n        )\n      : 1) +\n    2;\n}\n\n/**\n * A description of a coplanar polygon from an array of positions.\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points.\n * @returns {CoplanarPolygonGeometry}\n *\n * @example\n * // create a polygon from points\n * const polygon = Cesium.CoplanarPolygonGeometry.fromPositions({\n *   positions : Cesium.Cartesian3.fromDegreesArray([\n *     -72.0, 40.0,\n *     -70.0, 35.0,\n *     -75.0, 30.0,\n *     -70.0, 30.0,\n *     -68.0, 40.0\n *   ])\n * });\n * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);\n *\n * @see PolygonGeometry#createGeometry\n */\nCoplanarPolygonGeometry.fromPositions = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.positions\", options.positions);\n  //>>includeEnd('debug');\n\n  const newOptions = {\n    polygonHierarchy: {\n      positions: options.positions,\n    },\n    vertexFormat: options.vertexFormat,\n    stRotation: options.stRotation,\n    ellipsoid: options.ellipsoid,\n    textureCoordinates: options.textureCoordinates,\n  };\n  return new CoplanarPolygonGeometry(newOptions);\n};\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CoplanarPolygonGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nCoplanarPolygonGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\n    value._polygonHierarchy,\n    array,\n    startingIndex,\n    Cartesian3\n  );\n\n  Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  VertexFormat.pack(value._vertexFormat, array, startingIndex);\n  startingIndex += VertexFormat.packedLength;\n\n  array[startingIndex++] = value._stRotation;\n  if (defined(value._textureCoordinates)) {\n    startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\n      value._textureCoordinates,\n      array,\n      startingIndex,\n      Cartesian2\n    );\n  } else {\n    array[startingIndex++] = -1.0;\n  }\n  array[startingIndex++] = value.packedLength;\n\n  return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n  polygonHierarchy: {},\n};\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CoplanarPolygonGeometry} [result] The object into which to store the result.\n * @returns {CoplanarPolygonGeometry} The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.\n */\nCoplanarPolygonGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy(\n    array,\n    startingIndex,\n    Cartesian3\n  );\n  startingIndex = polygonHierarchy.startingIndex;\n  delete polygonHierarchy.startingIndex;\n\n  const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n  startingIndex += Ellipsoid.packedLength;\n\n  const vertexFormat = VertexFormat.unpack(\n    array,\n    startingIndex,\n    scratchVertexFormat\n  );\n  startingIndex += VertexFormat.packedLength;\n\n  const stRotation = array[startingIndex++];\n  const textureCoordinates =\n    array[startingIndex] === -1.0\n      ? undefined\n      : PolygonGeometryLibrary.unpackPolygonHierarchy(\n          array,\n          startingIndex,\n          Cartesian2\n        );\n  if (defined(textureCoordinates)) {\n    startingIndex = textureCoordinates.startingIndex;\n    delete textureCoordinates.startingIndex;\n  } else {\n    startingIndex++;\n  }\n  const packedLength = array[startingIndex++];\n\n  if (!defined(result)) {\n    result = new CoplanarPolygonGeometry(scratchOptions);\n  }\n\n  result._polygonHierarchy = polygonHierarchy;\n  result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n  result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n  result._stRotation = stRotation;\n  result._textureCoordinates = textureCoordinates;\n  result.packedLength = packedLength;\n\n  return result;\n};\n\n/**\n * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.\n *\n * @param {CoplanarPolygonGeometry} polygonGeometry A description of the polygon.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCoplanarPolygonGeometry.createGeometry = function (polygonGeometry) {\n  const vertexFormat = polygonGeometry._vertexFormat;\n  const polygonHierarchy = polygonGeometry._polygonHierarchy;\n  const stRotation = polygonGeometry._stRotation;\n  const textureCoordinates = polygonGeometry._textureCoordinates;\n  const hasTextureCoordinates = defined(textureCoordinates);\n\n  let outerPositions = polygonHierarchy.positions;\n  outerPositions = arrayRemoveDuplicates(\n    outerPositions,\n    Cartesian3.equalsEpsilon,\n    true\n  );\n  if (outerPositions.length < 3) {\n    return;\n  }\n\n  let normal = scratchNormal;\n  let tangent = scratchTangent;\n  let bitangent = scratchBitangent;\n  let axis1 = axis1Scratch;\n  const axis2 = axis2Scratch;\n\n  const validGeometry = CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments(\n    outerPositions,\n    centerScratch,\n    axis1,\n    axis2\n  );\n  if (!validGeometry) {\n    return undefined;\n  }\n\n  normal = Cartesian3.cross(axis1, axis2, normal);\n  normal = Cartesian3.normalize(normal, normal);\n\n  if (\n    !Cartesian3.equalsEpsilon(\n      centerScratch,\n      Cartesian3.ZERO,\n      CesiumMath.EPSILON6\n    )\n  ) {\n    const surfaceNormal = polygonGeometry._ellipsoid.geodeticSurfaceNormal(\n      centerScratch,\n      surfaceNormalScratch\n    );\n    if (Cartesian3.dot(normal, surfaceNormal) < 0) {\n      normal = Cartesian3.negate(normal, normal);\n      axis1 = Cartesian3.negate(axis1, axis1);\n    }\n  }\n\n  const projectPoints = CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction(\n    centerScratch,\n    axis1,\n    axis2\n  );\n  const projectPoint = CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction(\n    centerScratch,\n    axis1,\n    axis2\n  );\n\n  if (vertexFormat.tangent) {\n    tangent = Cartesian3.clone(axis1, tangent);\n  }\n  if (vertexFormat.bitangent) {\n    bitangent = Cartesian3.clone(axis2, bitangent);\n  }\n\n  const results = PolygonGeometryLibrary.polygonsFromHierarchy(\n    polygonHierarchy,\n    hasTextureCoordinates,\n    projectPoints,\n    false\n  );\n  const hierarchy = results.hierarchy;\n  const polygons = results.polygons;\n\n  const dummyFunction = function (identity) {\n    return identity;\n  };\n\n  const textureCoordinatePolygons = hasTextureCoordinates\n    ? PolygonGeometryLibrary.polygonsFromHierarchy(\n        textureCoordinates,\n        true,\n        dummyFunction,\n        false\n      ).polygons\n    : undefined;\n\n  if (hierarchy.length === 0) {\n    return;\n  }\n  outerPositions = hierarchy[0].outerRing;\n\n  const boundingSphere = BoundingSphere.fromPoints(outerPositions);\n  const boundingRectangle = PolygonGeometryLibrary.computeBoundingRectangle(\n    normal,\n    projectPoint,\n    outerPositions,\n    stRotation,\n    scratchBR\n  );\n\n  const geometries = [];\n  for (let i = 0; i < polygons.length; i++) {\n    const geometryInstance = new GeometryInstance({\n      geometry: createGeometryFromPolygon(\n        polygons[i],\n        vertexFormat,\n        boundingRectangle,\n        stRotation,\n        hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,\n        projectPoint,\n        normal,\n        tangent,\n        bitangent\n      ),\n    });\n\n    geometries.push(geometryInstance);\n  }\n\n  const geometry = GeometryPipeline.combineInstances(geometries)[0];\n  geometry.attributes.position.values = new Float64Array(\n    geometry.attributes.position.values\n  );\n  geometry.indices = IndexDatatype.createTypedArray(\n    geometry.attributes.position.values.length / 3,\n    geometry.indices\n  );\n\n  const attributes = geometry.attributes;\n  if (!vertexFormat.position) {\n    delete attributes.position;\n  }\n  return new Geometry({\n    attributes: attributes,\n    indices: geometry.indices,\n    primitiveType: geometry.primitiveType,\n    boundingSphere: boundingSphere,\n  });\n};\nexport default CoplanarPolygonGeometry;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidTangentPlane from \"./EllipsoidTangentPlane.js\";\nimport IntersectionTests from \"./IntersectionTests.js\";\nimport CesiumMath from \"./Math.js\";\nimport Ray from \"./Ray.js\";\n\n/**\n * Represents a point in stereographic coordinates, which can be obtained by projecting a cartesian coordinate from one pole onto a tangent plane at the other pole.\n * The stereographic projection faithfully represents the relative directions of all great circles passing through its center point.\n * To faithfully represents angles everywhere, this is a conformal projection, which means points are projected onto an arbrary sphere.\n * @param {Cartesian2} [position] The steroegraphic coordinates.\n * @param {EllipseGeometry} [tangentPlane] The tangent plane onto which the point was projected.\n */\nfunction Stereographic(position, tangentPlane) {\n  this.position = position;\n  if (!defined(this.position)) {\n    this.position = new Cartesian2();\n  }\n\n  this.tangentPlane = tangentPlane;\n  if (!defined(this.tangentPlane)) {\n    this.tangentPlane = Stereographic.NORTH_POLE_TANGENT_PLANE;\n  }\n}\n\nObject.defineProperties(Stereographic.prototype, {\n  /**\n   * Gets the ellipsoid.\n   * @memberof Stereographic.prototype\n   * @type {Ellipsoid}\n   */\n  ellipsoid: {\n    get: function () {\n      return this.tangentPlane.ellipsoid;\n    },\n  },\n\n  /**\n   * Gets the x coordinate\n   * @memberof Stereographic.prototype\n   * @type {number}\n   */\n  x: {\n    get: function () {\n      return this.position.x;\n    },\n  },\n\n  /**\n   * Gets the y coordinate\n   * @memberof Stereographic.prototype\n   * @type {number}\n   */\n  y: {\n    get: function () {\n      return this.position.y;\n    },\n  },\n\n  /**\n   * Computes the conformal latitude, or the ellipsoidal latitude projected onto an arbitrary sphere.\n   * @memberof Stereographic.prototype\n   * @type {number}\n   */\n  conformalLatitude: {\n    get: function () {\n      const r = Cartesian2.magnitude(this.position);\n      const d = 2 * this.ellipsoid.maximumRadius;\n      const sign = this.tangentPlane.plane.normal.z;\n      return sign * (CesiumMath.PI_OVER_TWO - 2 * Math.atan2(r, d));\n    },\n  },\n\n  /**\n   * Computes the longitude\n   * @memberof Stereographic.prototype\n   * @type {number}\n   */\n  longitude: {\n    get: function () {\n      let longitude = CesiumMath.PI_OVER_TWO + Math.atan2(this.y, this.x);\n      if (longitude > Math.PI) {\n        longitude -= CesiumMath.TWO_PI;\n      }\n\n      return longitude;\n    },\n  },\n});\n\nconst scratchCartographic = new Cartographic();\nconst scratchCartesian = new Cartesian3();\n\n/**\n * Computes the latitude based on an ellipsoid.\n *\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which to compute the longitude.\n * @returns {number} The latitude\n */\nStereographic.prototype.getLatitude = function (ellipsoid) {\n  if (!defined(ellipsoid)) {\n    ellipsoid = Ellipsoid.WGS84;\n  }\n\n  scratchCartographic.latitude = this.conformalLatitude;\n  scratchCartographic.longitude = this.longitude;\n  scratchCartographic.height = 0.0;\n  const cartesian = this.ellipsoid.cartographicToCartesian(\n    scratchCartographic,\n    scratchCartesian\n  );\n  ellipsoid.cartesianToCartographic(cartesian, scratchCartographic);\n  return scratchCartographic.latitude;\n};\n\nconst scratchProjectPointOntoPlaneRay = new Ray();\nconst scratchProjectPointOntoPlaneRayDirection = new Cartesian3();\nconst scratchProjectPointOntoPlaneCartesian3 = new Cartesian3();\n\n/**\n * Computes the projection of the provided 3D position onto the 2D polar plane, radially outward from the provided origin.\n *\n * @param {Cartesian3} cartesian The point to project.\n * @param {Stereographic} [result] The object onto which to store the result.\n * @returns {Sterographic} The modified result parameter or a new Sterographic instance if none was provided.\n */\nStereographic.fromCartesian = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartesian\", cartesian);\n  //>>includeEnd('debug');\n\n  const sign = CesiumMath.signNotZero(cartesian.z);\n  let tangentPlane = Stereographic.NORTH_POLE_TANGENT_PLANE;\n  let origin = Stereographic.SOUTH_POLE;\n  if (sign < 0) {\n    tangentPlane = Stereographic.SOUTH_POLE_TANGENT_PLANE;\n    origin = Stereographic.NORTH_POLE;\n  }\n\n  const ray = scratchProjectPointOntoPlaneRay;\n  ray.origin = tangentPlane.ellipsoid.scaleToGeocentricSurface(\n    cartesian,\n    ray.origin\n  );\n  ray.direction = Cartesian3.subtract(\n    ray.origin,\n    origin,\n    scratchProjectPointOntoPlaneRayDirection\n  );\n  Cartesian3.normalize(ray.direction, ray.direction);\n\n  const intersectionPoint = IntersectionTests.rayPlane(\n    ray,\n    tangentPlane.plane,\n    scratchProjectPointOntoPlaneCartesian3\n  );\n  const v = Cartesian3.subtract(intersectionPoint, origin, intersectionPoint);\n  const x = Cartesian3.dot(tangentPlane.xAxis, v);\n  const y = sign * Cartesian3.dot(tangentPlane.yAxis, v);\n\n  if (!defined(result)) {\n    return new Stereographic(new Cartesian2(x, y), tangentPlane);\n  }\n\n  result.position = new Cartesian2(x, y);\n  result.tangentPlane = tangentPlane;\n  return result;\n};\n\n/**\n * Computes the projection of the provided 3D positions onto the 2D polar plane, radially outward from the provided origin.\n *\n * @param {Cartesian3[]} cartesians The points to project.\n * @param {Stereographic[]} [result] The object onto which to store the result.\n * @returns {Sterographic[]} The modified result parameter or a new Sterographic instance if none was provided.\n */\nStereographic.fromCartesianArray = function (cartesians, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartesians\", cartesians);\n  //>>includeEnd('debug');\n\n  const length = cartesians.length;\n  if (!defined(result)) {\n    result = new Array(length);\n  } else {\n    result.length = length;\n  }\n  for (let i = 0; i < length; i++) {\n    result[i] = Stereographic.fromCartesian(cartesians[i], result[i]);\n  }\n  return result;\n};\n\n/**\n * Duplicates a Stereographic instance.\n *\n * @param {Stereographic} stereographic The Stereographic to duplicate.\n * @param {Stereographic} [result] The object onto which to store the result.\n * @returns {Stereographic} The modified result parameter or a new Stereographic instance if one was not provided. (Returns undefined if stereographic is undefined)\n */\nStereographic.clone = function (stereographic, result) {\n  if (!defined(stereographic)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    return new Stereographic(\n      stereographic.position,\n      stereographic.tangentPlane\n    );\n  }\n\n  result.position = stereographic.position;\n  result.tangentPlane = stereographic.tangentPlane;\n\n  return result;\n};\n\n/**\n * An Ellipsoid instance initialized to radii of (0.5, 0.5, 0.5).\n *\n * @type {Stereographic}\n * @constant\n */\nStereographic.HALF_UNIT_SPHERE = Object.freeze(new Ellipsoid(0.5, 0.5, 0.5));\n\nStereographic.NORTH_POLE = Object.freeze(new Cartesian3(0.0, 0.0, 0.5));\nStereographic.SOUTH_POLE = Object.freeze(new Cartesian3(0.0, 0.0, -0.5));\n\nStereographic.NORTH_POLE_TANGENT_PLANE = Object.freeze(\n  new EllipsoidTangentPlane(\n    Stereographic.NORTH_POLE,\n    Stereographic.HALF_UNIT_SPHERE\n  )\n);\nStereographic.SOUTH_POLE_TANGENT_PLANE = Object.freeze(\n  new EllipsoidTangentPlane(\n    Stereographic.SOUTH_POLE,\n    Stereographic.HALF_UNIT_SPHERE\n  )\n);\n\nexport default Stereographic;\n", "import ArcType from \"./ArcType.js\";\nimport BoundingRectangle from \"./BoundingRectangle.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport deprecationWarning from \"./deprecationWarning.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidGeodesic from \"./EllipsoidGeodesic.js\";\nimport EllipsoidTangentPlane from \"./EllipsoidTangentPlane.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryInstance from \"./GeometryInstance.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport PolygonGeometryLibrary from \"./PolygonGeometryLibrary.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Stereographic from \"./Stereographic.js\";\nimport VertexFormat from \"./VertexFormat.js\";\nimport WindingOrder from \"./WindingOrder.js\";\n\nconst scratchCarto1 = new Cartographic();\nconst scratchCarto2 = new Cartographic();\nfunction adjustPosHeightsForNormal(position, p1, p2, ellipsoid) {\n  const carto1 = ellipsoid.cartesianToCartographic(position, scratchCarto1);\n  const height = carto1.height;\n  const p1Carto = ellipsoid.cartesianToCartographic(p1, scratchCarto2);\n  p1Carto.height = height;\n  ellipsoid.cartographicToCartesian(p1Carto, p1);\n\n  const p2Carto = ellipsoid.cartesianToCartographic(p2, scratchCarto2);\n  p2Carto.height = height - 100;\n  ellipsoid.cartographicToCartesian(p2Carto, p2);\n}\n\nconst scratchBoundingRectangle = new BoundingRectangle();\nconst scratchPosition = new Cartesian3();\nconst scratchNormal = new Cartesian3();\nconst scratchTangent = new Cartesian3();\nconst scratchBitangent = new Cartesian3();\nconst p1Scratch = new Cartesian3();\nconst p2Scratch = new Cartesian3();\nlet scratchPerPosNormal = new Cartesian3();\nlet scratchPerPosTangent = new Cartesian3();\nlet scratchPerPosBitangent = new Cartesian3();\n\nconst appendTextureCoordinatesOrigin = new Cartesian2();\nconst appendTextureCoordinatesCartesian2 = new Cartesian2();\nconst appendTextureCoordinatesCartesian3 = new Cartesian3();\nconst appendTextureCoordinatesQuaternion = new Quaternion();\nconst appendTextureCoordinatesMatrix3 = new Matrix3();\nconst tangentMatrixScratch = new Matrix3();\n\nfunction computeAttributes(options) {\n  const vertexFormat = options.vertexFormat;\n  const geometry = options.geometry;\n  const shadowVolume = options.shadowVolume;\n  const flatPositions = geometry.attributes.position.values;\n  const flatTexcoords = defined(geometry.attributes.st)\n    ? geometry.attributes.st.values\n    : undefined;\n\n  let length = flatPositions.length;\n  const wall = options.wall;\n  const top = options.top || wall;\n  const bottom = options.bottom || wall;\n  if (\n    vertexFormat.st ||\n    vertexFormat.normal ||\n    vertexFormat.tangent ||\n    vertexFormat.bitangent ||\n    shadowVolume\n  ) {\n    // PERFORMANCE_IDEA: Compute before subdivision, then just interpolate during subdivision.\n    // PERFORMANCE_IDEA: Compute with createGeometryFromPositions() for fast path when there's no holes.\n    const boundingRectangle = options.boundingRectangle;\n    const rotationAxis = options.rotationAxis;\n    const projectTo2d = options.projectTo2d;\n    const ellipsoid = options.ellipsoid;\n    const stRotation = options.stRotation;\n    const perPositionHeight = options.perPositionHeight;\n\n    const origin = appendTextureCoordinatesOrigin;\n    origin.x = boundingRectangle.x;\n    origin.y = boundingRectangle.y;\n\n    const textureCoordinates = vertexFormat.st\n      ? new Float32Array(2 * (length / 3))\n      : undefined;\n    let normals;\n    if (vertexFormat.normal) {\n      if (perPositionHeight && top && !wall) {\n        normals = geometry.attributes.normal.values;\n      } else {\n        normals = new Float32Array(length);\n      }\n    }\n    const tangents = vertexFormat.tangent\n      ? new Float32Array(length)\n      : undefined;\n    const bitangents = vertexFormat.bitangent\n      ? new Float32Array(length)\n      : undefined;\n    const extrudeNormals = shadowVolume ? new Float32Array(length) : undefined;\n\n    let textureCoordIndex = 0;\n    let attrIndex = 0;\n\n    let normal = scratchNormal;\n    let tangent = scratchTangent;\n    let bitangent = scratchBitangent;\n    let recomputeNormal = true;\n\n    let textureMatrix = appendTextureCoordinatesMatrix3;\n    let tangentRotationMatrix = tangentMatrixScratch;\n    if (stRotation !== 0.0) {\n      let rotation = Quaternion.fromAxisAngle(\n        rotationAxis,\n        stRotation,\n        appendTextureCoordinatesQuaternion\n      );\n      textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrix);\n\n      rotation = Quaternion.fromAxisAngle(\n        rotationAxis,\n        -stRotation,\n        appendTextureCoordinatesQuaternion\n      );\n      tangentRotationMatrix = Matrix3.fromQuaternion(\n        rotation,\n        tangentRotationMatrix\n      );\n    } else {\n      textureMatrix = Matrix3.clone(Matrix3.IDENTITY, textureMatrix);\n      tangentRotationMatrix = Matrix3.clone(\n        Matrix3.IDENTITY,\n        tangentRotationMatrix\n      );\n    }\n\n    let bottomOffset = 0;\n    let bottomOffset2 = 0;\n\n    if (top && bottom) {\n      bottomOffset = length / 2;\n      bottomOffset2 = length / 3;\n\n      length /= 2;\n    }\n\n    for (let i = 0; i < length; i += 3) {\n      const position = Cartesian3.fromArray(\n        flatPositions,\n        i,\n        appendTextureCoordinatesCartesian3\n      );\n\n      if (vertexFormat.st) {\n        if (!defined(flatTexcoords)) {\n          let p = Matrix3.multiplyByVector(\n            textureMatrix,\n            position,\n            scratchPosition\n          );\n          p = ellipsoid.scaleToGeodeticSurface(p, p);\n          const st = projectTo2d(p, appendTextureCoordinatesCartesian2);\n          Cartesian2.subtract(st, origin, st);\n\n          const stx = CesiumMath.clamp(st.x / boundingRectangle.width, 0, 1);\n          const sty = CesiumMath.clamp(st.y / boundingRectangle.height, 0, 1);\n          if (bottom) {\n            textureCoordinates[textureCoordIndex + bottomOffset2] = stx;\n            textureCoordinates[textureCoordIndex + 1 + bottomOffset2] = sty;\n          }\n          if (top) {\n            textureCoordinates[textureCoordIndex] = stx;\n            textureCoordinates[textureCoordIndex + 1] = sty;\n          }\n\n          textureCoordIndex += 2;\n        }\n      }\n\n      if (\n        vertexFormat.normal ||\n        vertexFormat.tangent ||\n        vertexFormat.bitangent ||\n        shadowVolume\n      ) {\n        const attrIndex1 = attrIndex + 1;\n        const attrIndex2 = attrIndex + 2;\n\n        if (wall) {\n          if (i + 3 < length) {\n            const p1 = Cartesian3.fromArray(flatPositions, i + 3, p1Scratch);\n\n            if (recomputeNormal) {\n              const p2 = Cartesian3.fromArray(\n                flatPositions,\n                i + length,\n                p2Scratch\n              );\n              if (perPositionHeight) {\n                adjustPosHeightsForNormal(position, p1, p2, ellipsoid);\n              }\n              Cartesian3.subtract(p1, position, p1);\n              Cartesian3.subtract(p2, position, p2);\n              normal = Cartesian3.normalize(\n                Cartesian3.cross(p2, p1, normal),\n                normal\n              );\n              recomputeNormal = false;\n            }\n\n            if (Cartesian3.equalsEpsilon(p1, position, CesiumMath.EPSILON10)) {\n              // if we've reached a corner\n              recomputeNormal = true;\n            }\n          }\n\n          if (vertexFormat.tangent || vertexFormat.bitangent) {\n            bitangent = ellipsoid.geodeticSurfaceNormal(position, bitangent);\n            if (vertexFormat.tangent) {\n              tangent = Cartesian3.normalize(\n                Cartesian3.cross(bitangent, normal, tangent),\n                tangent\n              );\n            }\n          }\n        } else {\n          normal = ellipsoid.geodeticSurfaceNormal(position, normal);\n          if (vertexFormat.tangent || vertexFormat.bitangent) {\n            if (perPositionHeight) {\n              scratchPerPosNormal = Cartesian3.fromArray(\n                normals,\n                attrIndex,\n                scratchPerPosNormal\n              );\n              scratchPerPosTangent = Cartesian3.cross(\n                Cartesian3.UNIT_Z,\n                scratchPerPosNormal,\n                scratchPerPosTangent\n              );\n              scratchPerPosTangent = Cartesian3.normalize(\n                Matrix3.multiplyByVector(\n                  tangentRotationMatrix,\n                  scratchPerPosTangent,\n                  scratchPerPosTangent\n                ),\n                scratchPerPosTangent\n              );\n              if (vertexFormat.bitangent) {\n                scratchPerPosBitangent = Cartesian3.normalize(\n                  Cartesian3.cross(\n                    scratchPerPosNormal,\n                    scratchPerPosTangent,\n                    scratchPerPosBitangent\n                  ),\n                  scratchPerPosBitangent\n                );\n              }\n            }\n\n            tangent = Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent);\n            tangent = Cartesian3.normalize(\n              Matrix3.multiplyByVector(tangentRotationMatrix, tangent, tangent),\n              tangent\n            );\n            if (vertexFormat.bitangent) {\n              bitangent = Cartesian3.normalize(\n                Cartesian3.cross(normal, tangent, bitangent),\n                bitangent\n              );\n            }\n          }\n        }\n\n        if (vertexFormat.normal) {\n          if (options.wall) {\n            normals[attrIndex + bottomOffset] = normal.x;\n            normals[attrIndex1 + bottomOffset] = normal.y;\n            normals[attrIndex2 + bottomOffset] = normal.z;\n          } else if (bottom) {\n            normals[attrIndex + bottomOffset] = -normal.x;\n            normals[attrIndex1 + bottomOffset] = -normal.y;\n            normals[attrIndex2 + bottomOffset] = -normal.z;\n          }\n\n          if ((top && !perPositionHeight) || wall) {\n            normals[attrIndex] = normal.x;\n            normals[attrIndex1] = normal.y;\n            normals[attrIndex2] = normal.z;\n          }\n        }\n\n        if (shadowVolume) {\n          if (wall) {\n            normal = ellipsoid.geodeticSurfaceNormal(position, normal);\n          }\n          extrudeNormals[attrIndex + bottomOffset] = -normal.x;\n          extrudeNormals[attrIndex1 + bottomOffset] = -normal.y;\n          extrudeNormals[attrIndex2 + bottomOffset] = -normal.z;\n        }\n\n        if (vertexFormat.tangent) {\n          if (options.wall) {\n            tangents[attrIndex + bottomOffset] = tangent.x;\n            tangents[attrIndex1 + bottomOffset] = tangent.y;\n            tangents[attrIndex2 + bottomOffset] = tangent.z;\n          } else if (bottom) {\n            tangents[attrIndex + bottomOffset] = -tangent.x;\n            tangents[attrIndex1 + bottomOffset] = -tangent.y;\n            tangents[attrIndex2 + bottomOffset] = -tangent.z;\n          }\n\n          if (top) {\n            if (perPositionHeight) {\n              tangents[attrIndex] = scratchPerPosTangent.x;\n              tangents[attrIndex1] = scratchPerPosTangent.y;\n              tangents[attrIndex2] = scratchPerPosTangent.z;\n            } else {\n              tangents[attrIndex] = tangent.x;\n              tangents[attrIndex1] = tangent.y;\n              tangents[attrIndex2] = tangent.z;\n            }\n          }\n        }\n\n        if (vertexFormat.bitangent) {\n          if (bottom) {\n            bitangents[attrIndex + bottomOffset] = bitangent.x;\n            bitangents[attrIndex1 + bottomOffset] = bitangent.y;\n            bitangents[attrIndex2 + bottomOffset] = bitangent.z;\n          }\n          if (top) {\n            if (perPositionHeight) {\n              bitangents[attrIndex] = scratchPerPosBitangent.x;\n              bitangents[attrIndex1] = scratchPerPosBitangent.y;\n              bitangents[attrIndex2] = scratchPerPosBitangent.z;\n            } else {\n              bitangents[attrIndex] = bitangent.x;\n              bitangents[attrIndex1] = bitangent.y;\n              bitangents[attrIndex2] = bitangent.z;\n            }\n          }\n        }\n        attrIndex += 3;\n      }\n    }\n\n    if (vertexFormat.st && !defined(flatTexcoords)) {\n      geometry.attributes.st = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 2,\n        values: textureCoordinates,\n      });\n    }\n\n    if (vertexFormat.normal) {\n      geometry.attributes.normal = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: normals,\n      });\n    }\n\n    if (vertexFormat.tangent) {\n      geometry.attributes.tangent = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: tangents,\n      });\n    }\n\n    if (vertexFormat.bitangent) {\n      geometry.attributes.bitangent = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: bitangents,\n      });\n    }\n\n    if (shadowVolume) {\n      geometry.attributes.extrudeDirection = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: extrudeNormals,\n      });\n    }\n  }\n\n  if (options.extrude && defined(options.offsetAttribute)) {\n    const size = flatPositions.length / 3;\n    let offsetAttribute = new Uint8Array(size);\n\n    if (options.offsetAttribute === GeometryOffsetAttribute.TOP) {\n      if ((top && bottom) || wall) {\n        offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\n      } else if (top) {\n        offsetAttribute = offsetAttribute.fill(1);\n      }\n    } else {\n      const offsetValue =\n        options.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n      offsetAttribute = offsetAttribute.fill(offsetValue);\n    }\n\n    geometry.attributes.applyOffset = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 1,\n      values: offsetAttribute,\n    });\n  }\n\n  return geometry;\n}\n\nconst startCartographicScratch = new Cartographic();\nconst endCartographicScratch = new Cartographic();\nconst idlCross = {\n  westOverIDL: 0.0,\n  eastOverIDL: 0.0,\n};\nlet ellipsoidGeodesic = new EllipsoidGeodesic();\nfunction computeRectangle(positions, ellipsoid, arcType, granularity, result) {\n  result = defaultValue(result, new Rectangle());\n  if (!defined(positions) || positions.length < 3) {\n    result.west = 0.0;\n    result.north = 0.0;\n    result.south = 0.0;\n    result.east = 0.0;\n    return result;\n  }\n\n  if (arcType === ArcType.RHUMB) {\n    return Rectangle.fromCartesianArray(positions, ellipsoid, result);\n  }\n\n  if (!ellipsoidGeodesic.ellipsoid.equals(ellipsoid)) {\n    ellipsoidGeodesic = new EllipsoidGeodesic(undefined, undefined, ellipsoid);\n  }\n\n  result.west = Number.POSITIVE_INFINITY;\n  result.east = Number.NEGATIVE_INFINITY;\n  result.south = Number.POSITIVE_INFINITY;\n  result.north = Number.NEGATIVE_INFINITY;\n\n  idlCross.westOverIDL = Number.POSITIVE_INFINITY;\n  idlCross.eastOverIDL = Number.NEGATIVE_INFINITY;\n\n  const inverseChordLength =\n    1.0 / CesiumMath.chordLength(granularity, ellipsoid.maximumRadius);\n  const positionsLength = positions.length;\n  let endCartographic = ellipsoid.cartesianToCartographic(\n    positions[0],\n    endCartographicScratch\n  );\n  let startCartographic = startCartographicScratch;\n  let swap;\n\n  for (let i = 1; i < positionsLength; i++) {\n    swap = startCartographic;\n    startCartographic = endCartographic;\n    endCartographic = ellipsoid.cartesianToCartographic(positions[i], swap);\n    ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);\n    interpolateAndGrowRectangle(\n      ellipsoidGeodesic,\n      inverseChordLength,\n      result,\n      idlCross\n    );\n  }\n\n  swap = startCartographic;\n  startCartographic = endCartographic;\n  endCartographic = ellipsoid.cartesianToCartographic(positions[0], swap);\n  ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);\n  interpolateAndGrowRectangle(\n    ellipsoidGeodesic,\n    inverseChordLength,\n    result,\n    idlCross\n  );\n\n  if (result.east - result.west > idlCross.eastOverIDL - idlCross.westOverIDL) {\n    result.west = idlCross.westOverIDL;\n    result.east = idlCross.eastOverIDL;\n\n    if (result.east > CesiumMath.PI) {\n      result.east = result.east - CesiumMath.TWO_PI;\n    }\n    if (result.west > CesiumMath.PI) {\n      result.west = result.west - CesiumMath.TWO_PI;\n    }\n  }\n\n  return result;\n}\n\nconst interpolatedCartographicScratch = new Cartographic();\nfunction interpolateAndGrowRectangle(\n  ellipsoidGeodesic,\n  inverseChordLength,\n  result,\n  idlCross\n) {\n  const segmentLength = ellipsoidGeodesic.surfaceDistance;\n\n  const numPoints = Math.ceil(segmentLength * inverseChordLength);\n  const subsegmentDistance =\n    numPoints > 0 ? segmentLength / (numPoints - 1) : Number.POSITIVE_INFINITY;\n  let interpolationDistance = 0.0;\n\n  for (let i = 0; i < numPoints; i++) {\n    const interpolatedCartographic = ellipsoidGeodesic.interpolateUsingSurfaceDistance(\n      interpolationDistance,\n      interpolatedCartographicScratch\n    );\n    interpolationDistance += subsegmentDistance;\n    const longitude = interpolatedCartographic.longitude;\n    const latitude = interpolatedCartographic.latitude;\n\n    result.west = Math.min(result.west, longitude);\n    result.east = Math.max(result.east, longitude);\n    result.south = Math.min(result.south, latitude);\n    result.north = Math.max(result.north, latitude);\n\n    const lonAdjusted =\n      longitude >= 0 ? longitude : longitude + CesiumMath.TWO_PI;\n    idlCross.westOverIDL = Math.min(idlCross.westOverIDL, lonAdjusted);\n    idlCross.eastOverIDL = Math.max(idlCross.eastOverIDL, lonAdjusted);\n  }\n}\n\nconst createGeometryFromPositionsExtrudedPositions = [];\n\nfunction createGeometryFromPositionsExtruded(\n  ellipsoid,\n  polygon,\n  textureCoordinates,\n  granularity,\n  hierarchy,\n  perPositionHeight,\n  closeTop,\n  closeBottom,\n  vertexFormat,\n  arcType\n) {\n  const geos = {\n    walls: [],\n  };\n  let i;\n\n  if (closeTop || closeBottom) {\n    const topGeo = PolygonGeometryLibrary.createGeometryFromPositions(\n      ellipsoid,\n      polygon,\n      textureCoordinates,\n      granularity,\n      perPositionHeight,\n      vertexFormat,\n      arcType\n    );\n\n    const edgePoints = topGeo.attributes.position.values;\n    const indices = topGeo.indices;\n    let numPositions;\n    let newIndices;\n\n    if (closeTop && closeBottom) {\n      const topBottomPositions = edgePoints.concat(edgePoints);\n\n      numPositions = topBottomPositions.length / 3;\n\n      newIndices = IndexDatatype.createTypedArray(\n        numPositions,\n        indices.length * 2\n      );\n      newIndices.set(indices);\n      const ilength = indices.length;\n\n      const length = numPositions / 2;\n\n      for (i = 0; i < ilength; i += 3) {\n        const i0 = newIndices[i] + length;\n        const i1 = newIndices[i + 1] + length;\n        const i2 = newIndices[i + 2] + length;\n\n        newIndices[i + ilength] = i2;\n        newIndices[i + 1 + ilength] = i1;\n        newIndices[i + 2 + ilength] = i0;\n      }\n\n      topGeo.attributes.position.values = topBottomPositions;\n      if (perPositionHeight && vertexFormat.normal) {\n        const normals = topGeo.attributes.normal.values;\n        topGeo.attributes.normal.values = new Float32Array(\n          topBottomPositions.length\n        );\n        topGeo.attributes.normal.values.set(normals);\n      }\n\n      if (vertexFormat.st && defined(textureCoordinates)) {\n        const texcoords = topGeo.attributes.st.values;\n        topGeo.attributes.st.values = new Float32Array(numPositions * 2);\n        topGeo.attributes.st.values = texcoords.concat(texcoords);\n      }\n\n      topGeo.indices = newIndices;\n    } else if (closeBottom) {\n      numPositions = edgePoints.length / 3;\n      newIndices = IndexDatatype.createTypedArray(numPositions, indices.length);\n\n      for (i = 0; i < indices.length; i += 3) {\n        newIndices[i] = indices[i + 2];\n        newIndices[i + 1] = indices[i + 1];\n        newIndices[i + 2] = indices[i];\n      }\n\n      topGeo.indices = newIndices;\n    }\n\n    geos.topAndBottom = new GeometryInstance({\n      geometry: topGeo,\n    });\n  }\n\n  let outerRing = hierarchy.outerRing;\n  const tangentPlane = EllipsoidTangentPlane.fromPoints(outerRing, ellipsoid);\n  let positions2D = tangentPlane.projectPointsOntoPlane(\n    outerRing,\n    createGeometryFromPositionsExtrudedPositions\n  );\n\n  let windingOrder = PolygonPipeline.computeWindingOrder2D(positions2D);\n  if (windingOrder === WindingOrder.CLOCKWISE) {\n    outerRing = outerRing.slice().reverse();\n  }\n\n  let wallGeo = PolygonGeometryLibrary.computeWallGeometry(\n    outerRing,\n    textureCoordinates,\n    ellipsoid,\n    granularity,\n    perPositionHeight,\n    arcType\n  );\n  geos.walls.push(\n    new GeometryInstance({\n      geometry: wallGeo,\n    })\n  );\n\n  const holes = hierarchy.holes;\n  for (i = 0; i < holes.length; i++) {\n    let hole = holes[i];\n    positions2D = tangentPlane.projectPointsOntoPlane(\n      hole,\n      createGeometryFromPositionsExtrudedPositions\n    );\n\n    windingOrder = PolygonPipeline.computeWindingOrder2D(positions2D);\n    if (windingOrder === WindingOrder.COUNTER_CLOCKWISE) {\n      hole = hole.slice().reverse();\n    }\n\n    wallGeo = PolygonGeometryLibrary.computeWallGeometry(\n      hole,\n      textureCoordinates,\n      ellipsoid,\n      granularity,\n      perPositionHeight,\n      arcType\n    );\n    geos.walls.push(\n      new GeometryInstance({\n        geometry: wallGeo,\n      })\n    );\n  }\n\n  return geos;\n}\n\n/**\n * A description of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\n *\n * @alias PolygonGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.\n * @param {number} [options.height=0.0] The distance in meters between the polygon and the ellipsoid surface.\n * @param {number} [options.extrudedHeight] The distance in meters between the polygon's extruded face and the ellipsoid surface.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.\n * @param {boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open.\n * @param {boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\n * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.\n *\n * @see PolygonGeometry#createGeometry\n * @see PolygonGeometry#fromPositions\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Polygon.html|Cesium Sandcastle Polygon Demo}\n *\n * @example\n * // 1. create a polygon from points\n * const polygon = new Cesium.PolygonGeometry({\n *   polygonHierarchy : new Cesium.PolygonHierarchy(\n *     Cesium.Cartesian3.fromDegreesArray([\n *       -72.0, 40.0,\n *       -70.0, 35.0,\n *       -75.0, 30.0,\n *       -70.0, 30.0,\n *       -68.0, 40.0\n *     ])\n *   )\n * });\n * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);\n *\n * // 2. create a nested polygon with holes\n * const polygonWithHole = new Cesium.PolygonGeometry({\n *   polygonHierarchy : new Cesium.PolygonHierarchy(\n *     Cesium.Cartesian3.fromDegreesArray([\n *       -109.0, 30.0,\n *       -95.0, 30.0,\n *       -95.0, 40.0,\n *       -109.0, 40.0\n *     ]),\n *     [new Cesium.PolygonHierarchy(\n *       Cesium.Cartesian3.fromDegreesArray([\n *         -107.0, 31.0,\n *         -107.0, 39.0,\n *         -97.0, 39.0,\n *         -97.0, 31.0\n *       ]),\n *       [new Cesium.PolygonHierarchy(\n *         Cesium.Cartesian3.fromDegreesArray([\n *           -105.0, 33.0,\n *           -99.0, 33.0,\n *           -99.0, 37.0,\n *           -105.0, 37.0\n *         ]),\n *         [new Cesium.PolygonHierarchy(\n *           Cesium.Cartesian3.fromDegreesArray([\n *             -103.0, 34.0,\n *             -101.0, 34.0,\n *             -101.0, 36.0,\n *             -103.0, 36.0\n *           ])\n *         )]\n *       )]\n *     )]\n *   )\n * });\n * const geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole);\n *\n * // 3. create extruded polygon\n * const extrudedPolygon = new Cesium.PolygonGeometry({\n *   polygonHierarchy : new Cesium.PolygonHierarchy(\n *     Cesium.Cartesian3.fromDegreesArray([\n *       -72.0, 40.0,\n *       -70.0, 35.0,\n *       -75.0, 30.0,\n *       -70.0, 30.0,\n *       -68.0, 40.0\n *     ])\n *   ),\n *   extrudedHeight: 300000\n * });\n * const geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon);\n */\nfunction PolygonGeometry(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options\", options);\n  Check.typeOf.object(\"options.polygonHierarchy\", options.polygonHierarchy);\n  if (\n    defined(options.perPositionHeight) &&\n    options.perPositionHeight &&\n    defined(options.height)\n  ) {\n    throw new DeveloperError(\n      \"Cannot use both options.perPositionHeight and options.height\"\n    );\n  }\n  if (\n    defined(options.arcType) &&\n    options.arcType !== ArcType.GEODESIC &&\n    options.arcType !== ArcType.RHUMB\n  ) {\n    throw new DeveloperError(\n      \"Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const polygonHierarchy = options.polygonHierarchy;\n  const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  const granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  const stRotation = defaultValue(options.stRotation, 0.0);\n  const textureCoordinates = options.textureCoordinates;\n  const perPositionHeight = defaultValue(options.perPositionHeight, false);\n  const perPositionHeightExtrude =\n    perPositionHeight && defined(options.extrudedHeight);\n  let height = defaultValue(options.height, 0.0);\n  let extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n  if (!perPositionHeightExtrude) {\n    const h = Math.max(height, extrudedHeight);\n    extrudedHeight = Math.min(height, extrudedHeight);\n    height = h;\n  }\n\n  this._vertexFormat = VertexFormat.clone(vertexFormat);\n  this._ellipsoid = Ellipsoid.clone(ellipsoid);\n  this._granularity = granularity;\n  this._stRotation = stRotation;\n  this._height = height;\n  this._extrudedHeight = extrudedHeight;\n  this._closeTop = defaultValue(options.closeTop, true);\n  this._closeBottom = defaultValue(options.closeBottom, true);\n  this._polygonHierarchy = polygonHierarchy;\n  this._perPositionHeight = perPositionHeight;\n  this._perPositionHeightExtrude = perPositionHeightExtrude;\n  this._shadowVolume = defaultValue(options.shadowVolume, false);\n  this._workerName = \"createPolygonGeometry\";\n  this._offsetAttribute = options.offsetAttribute;\n  this._arcType = defaultValue(options.arcType, ArcType.GEODESIC);\n\n  this._rectangle = undefined;\n  this._textureCoordinateRotationPoints = undefined;\n  this._textureCoordinates = textureCoordinates;\n\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  this.packedLength =\n    PolygonGeometryLibrary.computeHierarchyPackedLength(\n      polygonHierarchy,\n      Cartesian3\n    ) +\n    Ellipsoid.packedLength +\n    VertexFormat.packedLength +\n    (textureCoordinates\n      ? PolygonGeometryLibrary.computeHierarchyPackedLength(\n          textureCoordinates,\n          Cartesian2\n        )\n      : 1) +\n    12;\n}\n\n/**\n * A description of a polygon from an array of positions. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.\n * @param {number} [options.height=0.0] The height of the polygon.\n * @param {number} [options.extrudedHeight] The height of the polygon extrusion.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.\n * @param {boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open.\n * @param {boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\n * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.\n * @returns {PolygonGeometry}\n *\n * @example\n * // create a polygon from points\n * const polygon = Cesium.PolygonGeometry.fromPositions({\n *   positions : Cesium.Cartesian3.fromDegreesArray([\n *     -72.0, 40.0,\n *     -70.0, 35.0,\n *     -75.0, 30.0,\n *     -70.0, 30.0,\n *     -68.0, 40.0\n *   ])\n * });\n * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);\n *\n * @see PolygonGeometry#createGeometry\n */\nPolygonGeometry.fromPositions = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.positions\", options.positions);\n  //>>includeEnd('debug');\n\n  const newOptions = {\n    polygonHierarchy: {\n      positions: options.positions,\n    },\n    height: options.height,\n    extrudedHeight: options.extrudedHeight,\n    vertexFormat: options.vertexFormat,\n    stRotation: options.stRotation,\n    ellipsoid: options.ellipsoid,\n    granularity: options.granularity,\n    perPositionHeight: options.perPositionHeight,\n    closeTop: options.closeTop,\n    closeBottom: options.closeBottom,\n    offsetAttribute: options.offsetAttribute,\n    arcType: options.arcType,\n    textureCoordinates: options.textureCoordinates,\n  };\n  return new PolygonGeometry(newOptions);\n};\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PolygonGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nPolygonGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\n    value._polygonHierarchy,\n    array,\n    startingIndex,\n    Cartesian3\n  );\n\n  Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  VertexFormat.pack(value._vertexFormat, array, startingIndex);\n  startingIndex += VertexFormat.packedLength;\n\n  array[startingIndex++] = value._height;\n  array[startingIndex++] = value._extrudedHeight;\n  array[startingIndex++] = value._granularity;\n  array[startingIndex++] = value._stRotation;\n  array[startingIndex++] = value._perPositionHeightExtrude ? 1.0 : 0.0;\n  array[startingIndex++] = value._perPositionHeight ? 1.0 : 0.0;\n  array[startingIndex++] = value._closeTop ? 1.0 : 0.0;\n  array[startingIndex++] = value._closeBottom ? 1.0 : 0.0;\n  array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;\n  array[startingIndex++] = defaultValue(value._offsetAttribute, -1);\n  array[startingIndex++] = value._arcType;\n  if (defined(value._textureCoordinates)) {\n    startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\n      value._textureCoordinates,\n      array,\n      startingIndex,\n      Cartesian2\n    );\n  } else {\n    array[startingIndex++] = -1.0;\n  }\n  array[startingIndex++] = value.packedLength;\n  return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchVertexFormat = new VertexFormat();\n\n//Only used to avoid inability to default construct.\nconst dummyOptions = {\n  polygonHierarchy: {},\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PolygonGeometry} [result] The object into which to store the result.\n */\nPolygonGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy(\n    array,\n    startingIndex,\n    Cartesian3\n  );\n  startingIndex = polygonHierarchy.startingIndex;\n  delete polygonHierarchy.startingIndex;\n\n  const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n  startingIndex += Ellipsoid.packedLength;\n\n  const vertexFormat = VertexFormat.unpack(\n    array,\n    startingIndex,\n    scratchVertexFormat\n  );\n  startingIndex += VertexFormat.packedLength;\n\n  const height = array[startingIndex++];\n  const extrudedHeight = array[startingIndex++];\n  const granularity = array[startingIndex++];\n  const stRotation = array[startingIndex++];\n  const perPositionHeightExtrude = array[startingIndex++] === 1.0;\n  const perPositionHeight = array[startingIndex++] === 1.0;\n  const closeTop = array[startingIndex++] === 1.0;\n  const closeBottom = array[startingIndex++] === 1.0;\n  const shadowVolume = array[startingIndex++] === 1.0;\n  const offsetAttribute = array[startingIndex++];\n  const arcType = array[startingIndex++];\n  const textureCoordinates =\n    array[startingIndex] === -1.0\n      ? undefined\n      : PolygonGeometryLibrary.unpackPolygonHierarchy(\n          array,\n          startingIndex,\n          Cartesian2\n        );\n  if (defined(textureCoordinates)) {\n    startingIndex = textureCoordinates.startingIndex;\n    delete textureCoordinates.startingIndex;\n  } else {\n    startingIndex++;\n  }\n  const packedLength = array[startingIndex++];\n\n  if (!defined(result)) {\n    result = new PolygonGeometry(dummyOptions);\n  }\n\n  result._polygonHierarchy = polygonHierarchy;\n  result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n  result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n  result._height = height;\n  result._extrudedHeight = extrudedHeight;\n  result._granularity = granularity;\n  result._stRotation = stRotation;\n  result._perPositionHeightExtrude = perPositionHeightExtrude;\n  result._perPositionHeight = perPositionHeight;\n  result._closeTop = closeTop;\n  result._closeBottom = closeBottom;\n  result._shadowVolume = shadowVolume;\n  result._offsetAttribute =\n    offsetAttribute === -1 ? undefined : offsetAttribute;\n  result._arcType = arcType;\n  result._textureCoordinates = textureCoordinates;\n  result.packedLength = packedLength;\n\n  return result;\n};\n\nconst scratchCartesian0 = new Cartesian2();\nconst scratchCartesian1 = new Cartesian2();\nconst scratchPolarClosest = new Stereographic();\nfunction expandRectangle(\n  polar,\n  lastPolar,\n  ellipsoid,\n  arcType,\n  polygon,\n  result\n) {\n  const longitude = polar.longitude;\n  const lonAdjusted =\n    longitude >= 0.0 ? longitude : longitude + CesiumMath.TWO_PI;\n  polygon.westOverIdl = Math.min(polygon.westOverIdl, lonAdjusted);\n  polygon.eastOverIdl = Math.max(polygon.eastOverIdl, lonAdjusted);\n\n  result.west = Math.min(result.west, longitude);\n  result.east = Math.max(result.east, longitude);\n\n  const latitude = polar.getLatitude(ellipsoid);\n  let segmentLatitude = latitude;\n\n  result.south = Math.min(result.south, latitude);\n  result.north = Math.max(result.north, latitude);\n\n  if (arcType !== ArcType.RHUMB) {\n    // Geodesics will need to find the closest point on line. Rhumb lines will not have a latitude greater in magnitude than either of their endpoints.\n    const segment = Cartesian2.subtract(\n      lastPolar.position,\n      polar.position,\n      scratchCartesian0\n    );\n    const t =\n      Cartesian2.dot(lastPolar.position, segment) /\n      Cartesian2.dot(segment, segment);\n    if (t > 0.0 && t < 1.0) {\n      const projected = Cartesian2.add(\n        lastPolar.position,\n        Cartesian2.multiplyByScalar(segment, -t, segment),\n        scratchCartesian1\n      );\n      const closestPolar = Stereographic.clone(lastPolar, scratchPolarClosest);\n      closestPolar.position = projected;\n      const adjustedLatitude = closestPolar.getLatitude(ellipsoid);\n      result.south = Math.min(result.south, adjustedLatitude);\n      result.north = Math.max(result.north, adjustedLatitude);\n\n      if (Math.abs(latitude) > Math.abs(adjustedLatitude)) {\n        segmentLatitude = adjustedLatitude;\n      }\n    }\n  }\n  const direction = lastPolar.x * polar.y - polar.x * lastPolar.y;\n\n  // The total internal angle in either hemisphere determines if the pole is inside or outside the polygon\n  let angle = Math.sign(direction);\n  if (angle !== 0.0) {\n    angle *= Cartesian2.angleBetween(lastPolar.position, polar.position);\n  }\n\n  if (segmentLatitude >= 0.0) {\n    polygon.northAngle += angle;\n  }\n\n  if (segmentLatitude <= 0.0) {\n    polygon.southAngle += angle;\n  }\n}\n\nconst scratchPolar = new Stereographic();\nconst scratchPolarPrevious = new Stereographic();\nconst polygon = {\n  northAngle: 0.0,\n  southAngle: 0.0,\n  westOverIdl: 0.0,\n  eastOverIdl: 0.0,\n};\n\n/**\n * Computes a rectangle which encloses the polygon defined by the list of positions, including cases over the international date line and the poles.\n *\n * @param {Cartesian3[]} positions A linear ring defining the outer boundary of the polygon.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {ArcType} [arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\n * @param {Rectangle} [result] An object in which to store the result.\n *\n * @returns {Rectangle} The result rectangle\n */\nPolygonGeometry.computeRectangleFromPositions = function (\n  positions,\n  ellipsoid,\n  arcType,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"positions\", positions);\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Rectangle();\n  }\n\n  if (positions.length < 3) {\n    return result;\n  }\n\n  result.west = Number.POSITIVE_INFINITY;\n  result.east = Number.NEGATIVE_INFINITY;\n  result.south = Number.POSITIVE_INFINITY;\n  result.north = Number.NEGATIVE_INFINITY;\n\n  polygon.northAngle = 0.0;\n  polygon.southAngle = 0.0;\n  polygon.westOverIdl = Number.POSITIVE_INFINITY;\n  polygon.eastOverIdl = Number.NEGATIVE_INFINITY;\n\n  const positionsLength = positions.length;\n  let lastPolarPosition = Stereographic.fromCartesian(\n    positions[0],\n    scratchPolarPrevious\n  );\n  for (let i = 1; i < positionsLength; i++) {\n    const polarPosition = Stereographic.fromCartesian(\n      positions[i],\n      scratchPolar\n    );\n    expandRectangle(\n      polarPosition,\n      lastPolarPosition,\n      ellipsoid,\n      arcType,\n      polygon,\n      result\n    );\n\n    lastPolarPosition = Stereographic.clone(polarPosition, lastPolarPosition);\n  }\n\n  expandRectangle(\n    Stereographic.fromCartesian(positions[0], scratchPolar),\n    lastPolarPosition,\n    ellipsoid,\n    arcType,\n    polygon,\n    result\n  );\n\n  if (result.east - result.west > polygon.eastOverIdl - polygon.westOverIdl) {\n    result.west = polygon.westOverIdl;\n    result.east = polygon.eastOverIdl;\n\n    if (result.east > CesiumMath.PI) {\n      result.east = result.east - CesiumMath.TWO_PI;\n    }\n    if (result.west > CesiumMath.PI) {\n      result.west = result.west - CesiumMath.TWO_PI;\n    }\n  }\n\n  // If either pole is inside the polygon, adjust the rectangle so the pole is included\n  if (\n    CesiumMath.equalsEpsilon(\n      Math.abs(polygon.northAngle),\n      CesiumMath.TWO_PI,\n      CesiumMath.EPSILON10\n    )\n  ) {\n    result.north = CesiumMath.PI_OVER_TWO;\n    result.east = CesiumMath.PI;\n    result.west = -CesiumMath.PI;\n  }\n\n  if (\n    CesiumMath.equalsEpsilon(\n      Math.abs(polygon.southAngle),\n      CesiumMath.TWO_PI,\n      CesiumMath.EPSILON10\n    )\n  ) {\n    result.south = -CesiumMath.PI_OVER_TWO;\n    result.east = CesiumMath.PI;\n    result.west = -CesiumMath.PI;\n  }\n\n  return result;\n};\n\n/**\n * Returns the bounding rectangle given the provided options\n *\n * @param {object} options Object with the following properties:\n * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {Rectangle} [result] An object in which to store the result.\n *\n * @returns {Rectangle} The result rectangle\n *\n * @deprecated\n */\nPolygonGeometry.computeRectangle = function (options, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options\", options);\n  Check.typeOf.object(\"options.polygonHierarchy\", options.polygonHierarchy);\n  //>>includeEnd('debug');\n\n  deprecationWarning(\n    \"PolygonGeometry.computeRectangle\",\n    \"PolygonGeometry.computeRectangle was deprecated in CesiumJS 1.110.  It will be removed in CesiumJS 1.112. Use PolygonGeometry.computeRectangleFromPositions instead.\"\n  );\n\n  const granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  const arcType = defaultValue(options.arcType, ArcType.GEODESIC);\n  //>>includeStart('debug', pragmas.debug);\n  if (arcType !== ArcType.GEODESIC && arcType !== ArcType.RHUMB) {\n    throw new DeveloperError(\n      \"Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const polygonHierarchy = options.polygonHierarchy;\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n  return computeRectangle(\n    polygonHierarchy.positions,\n    ellipsoid,\n    arcType,\n    granularity,\n    result\n  );\n};\n\nconst scratchPolarForPlane = new Stereographic();\nfunction getTangentPlane(rectangle, positions, ellipsoid) {\n  if (rectangle.height >= CesiumMath.PI || rectangle.width >= CesiumMath.PI) {\n    const polar = Stereographic.fromCartesian(\n      positions[0],\n      scratchPolarForPlane\n    );\n    return polar.tangentPlane;\n  }\n\n  // Use a local tangent plane for smaller extents\n  return EllipsoidTangentPlane.fromPoints(positions, ellipsoid);\n}\n\nconst scratchCartographicCyllindrical = new Cartographic();\nfunction createProjectTo2d(rectangle, outerPositions, ellipsoid) {\n  return (positions, results) => {\n    // If the polygon positions span a large enough extent, use a specialized projection\n    if (rectangle.height >= CesiumMath.PI || rectangle.width >= CesiumMath.PI) {\n      // polygons that cross the equator must use cyllindrical coordinates to correctly compute winding order.\n      if (rectangle.south < 0 && rectangle.north > 0) {\n        if (!defined(results)) {\n          results = [];\n        }\n\n        for (let i = 0; i < positions.length; ++i) {\n          const cartographic = ellipsoid.cartesianToCartographic(\n            positions[i],\n            scratchCartographicCyllindrical\n          );\n          results[i] = new Cartesian2(\n            cartographic.longitude / CesiumMath.PI,\n            cartographic.latitude / CesiumMath.PI_OVER_TWO\n          );\n        }\n\n        results.length = positions.length;\n        return results;\n      }\n\n      return Stereographic.fromCartesianArray(positions, results);\n    }\n\n    // Use a local tangent plane for smaller extents\n    const tangentPlane = EllipsoidTangentPlane.fromPoints(\n      outerPositions,\n      ellipsoid\n    );\n    return tangentPlane.projectPointsOntoPlane(positions, results);\n  };\n}\n\nfunction createProjectPositionTo2d(rectangle, outerRing, ellipsoid) {\n  // If the polygon positions span a large enough extent, use a specialized projection\n  if (rectangle.height >= CesiumMath.PI || rectangle.width >= CesiumMath.PI) {\n    return (position, result) => {\n      // polygons that cross the equator must use cyllindrical coordinates to correctly compute winding order.\n      if (rectangle.south < 0 && rectangle.north > 0) {\n        const cartographic = ellipsoid.cartesianToCartographic(\n          position,\n          scratchCartographicCyllindrical\n        );\n        if (!defined(result)) {\n          result = new Cartesian2();\n        }\n        result.x = cartographic.longitude / CesiumMath.PI;\n        result.y = cartographic.latitude / CesiumMath.PI_OVER_TWO;\n\n        return result;\n      }\n\n      return Stereographic.fromCartesian(position, result);\n    };\n  }\n\n  const tangentPlane = EllipsoidTangentPlane.fromPoints(outerRing, ellipsoid);\n  return (position, result) => {\n    // Use a local tangent plane for smaller extents\n    return tangentPlane.projectPointsOntoPlane(position, result);\n  };\n}\n\nfunction createSplitPolygons(rectangle, ellipsoid, arcType, perPositionHeight) {\n  return (polygons, results) => {\n    if (\n      !perPositionHeight &&\n      (rectangle.height >= CesiumMath.PI_OVER_TWO ||\n        rectangle.width >= 2 * CesiumMath.PI_OVER_THREE)\n    ) {\n      return PolygonGeometryLibrary.splitPolygonsOnEquator(\n        polygons,\n        ellipsoid,\n        arcType,\n        results\n      );\n    }\n\n    return polygons;\n  };\n}\n\nfunction computeBoundingRectangle(outerRing, rectangle, ellipsoid, stRotation) {\n  if (rectangle.height >= CesiumMath.PI || rectangle.width >= CesiumMath.PI) {\n    return BoundingRectangle.fromRectangle(\n      rectangle,\n      undefined,\n      scratchBoundingRectangle\n    );\n  }\n\n  const outerPositions = outerRing;\n  const tangentPlane = EllipsoidTangentPlane.fromPoints(\n    outerPositions,\n    ellipsoid\n  );\n  return PolygonGeometryLibrary.computeBoundingRectangle(\n    tangentPlane.plane.normal,\n    tangentPlane.projectPointOntoPlane.bind(tangentPlane),\n    outerPositions,\n    stRotation,\n    scratchBoundingRectangle\n  );\n}\n\n/**\n * Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.\n *\n * @param {PolygonGeometry} polygonGeometry A description of the polygon.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nPolygonGeometry.createGeometry = function (polygonGeometry) {\n  const vertexFormat = polygonGeometry._vertexFormat;\n  const ellipsoid = polygonGeometry._ellipsoid;\n  const granularity = polygonGeometry._granularity;\n  const stRotation = polygonGeometry._stRotation;\n  const polygonHierarchy = polygonGeometry._polygonHierarchy;\n  const perPositionHeight = polygonGeometry._perPositionHeight;\n  const closeTop = polygonGeometry._closeTop;\n  const closeBottom = polygonGeometry._closeBottom;\n  const arcType = polygonGeometry._arcType;\n  const textureCoordinates = polygonGeometry._textureCoordinates;\n\n  const hasTextureCoordinates = defined(textureCoordinates);\n\n  const outerPositions = polygonHierarchy.positions;\n  if (outerPositions.length < 3) {\n    return;\n  }\n\n  const rectangle = polygonGeometry.rectangle;\n  const results = PolygonGeometryLibrary.polygonsFromHierarchy(\n    polygonHierarchy,\n    hasTextureCoordinates,\n    createProjectTo2d(rectangle, outerPositions, ellipsoid),\n    !perPositionHeight,\n    ellipsoid,\n    createSplitPolygons(rectangle, ellipsoid, arcType, perPositionHeight)\n  );\n\n  const hierarchy = results.hierarchy;\n  const polygons = results.polygons;\n\n  const dummyFunction = function (identity) {\n    return identity;\n  };\n\n  const textureCoordinatePolygons = hasTextureCoordinates\n    ? PolygonGeometryLibrary.polygonsFromHierarchy(\n        textureCoordinates,\n        true,\n        dummyFunction,\n        false,\n        ellipsoid\n      ).polygons\n    : undefined;\n\n  if (hierarchy.length === 0) {\n    return;\n  }\n\n  const outerRing = hierarchy[0].outerRing;\n  const boundingRectangle = computeBoundingRectangle(\n    outerRing,\n    rectangle,\n    ellipsoid,\n    stRotation\n  );\n\n  const geometries = [];\n\n  const height = polygonGeometry._height;\n  const extrudedHeight = polygonGeometry._extrudedHeight;\n  const extrude =\n    polygonGeometry._perPositionHeightExtrude ||\n    !CesiumMath.equalsEpsilon(height, extrudedHeight, 0, CesiumMath.EPSILON2);\n\n  const options = {\n    perPositionHeight: perPositionHeight,\n    vertexFormat: vertexFormat,\n    geometry: undefined,\n    rotationAxis: getTangentPlane(rectangle, outerRing, ellipsoid).plane.normal,\n    projectTo2d: createProjectPositionTo2d(rectangle, outerRing, ellipsoid),\n    boundingRectangle: boundingRectangle,\n    ellipsoid: ellipsoid,\n    stRotation: stRotation,\n    textureCoordinates: undefined,\n    bottom: false,\n    top: true,\n    wall: false,\n    extrude: false,\n    arcType: arcType,\n  };\n\n  let i;\n\n  if (extrude) {\n    options.extrude = true;\n    options.top = closeTop;\n    options.bottom = closeBottom;\n    options.shadowVolume = polygonGeometry._shadowVolume;\n    options.offsetAttribute = polygonGeometry._offsetAttribute;\n    for (i = 0; i < polygons.length; i++) {\n      const splitGeometry = createGeometryFromPositionsExtruded(\n        ellipsoid,\n        polygons[i],\n        hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,\n        granularity,\n        hierarchy[i],\n        perPositionHeight,\n        closeTop,\n        closeBottom,\n        vertexFormat,\n        arcType\n      );\n\n      let topAndBottom;\n      if (closeTop && closeBottom) {\n        topAndBottom = splitGeometry.topAndBottom;\n        options.geometry = PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(\n          topAndBottom.geometry,\n          height,\n          extrudedHeight,\n          ellipsoid,\n          perPositionHeight\n        );\n      } else if (closeTop) {\n        topAndBottom = splitGeometry.topAndBottom;\n        topAndBottom.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n          topAndBottom.geometry.attributes.position.values,\n          height,\n          ellipsoid,\n          !perPositionHeight\n        );\n        options.geometry = topAndBottom.geometry;\n      } else if (closeBottom) {\n        topAndBottom = splitGeometry.topAndBottom;\n        topAndBottom.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n          topAndBottom.geometry.attributes.position.values,\n          extrudedHeight,\n          ellipsoid,\n          true\n        );\n        options.geometry = topAndBottom.geometry;\n      }\n      if (closeTop || closeBottom) {\n        options.wall = false;\n        topAndBottom.geometry = computeAttributes(options);\n        geometries.push(topAndBottom);\n      }\n\n      const walls = splitGeometry.walls;\n      options.wall = true;\n      for (let k = 0; k < walls.length; k++) {\n        const wall = walls[k];\n        options.geometry = PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(\n          wall.geometry,\n          height,\n          extrudedHeight,\n          ellipsoid,\n          perPositionHeight\n        );\n        wall.geometry = computeAttributes(options);\n        geometries.push(wall);\n      }\n    }\n  } else {\n    for (i = 0; i < polygons.length; i++) {\n      const geometryInstance = new GeometryInstance({\n        geometry: PolygonGeometryLibrary.createGeometryFromPositions(\n          ellipsoid,\n          polygons[i],\n          hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,\n          granularity,\n          perPositionHeight,\n          vertexFormat,\n          arcType\n        ),\n      });\n      geometryInstance.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n        geometryInstance.geometry.attributes.position.values,\n        height,\n        ellipsoid,\n        !perPositionHeight\n      );\n      options.geometry = geometryInstance.geometry;\n\n      geometryInstance.geometry = computeAttributes(options);\n\n      if (defined(polygonGeometry._offsetAttribute)) {\n        const length =\n          geometryInstance.geometry.attributes.position.values.length;\n        const offsetValue =\n          polygonGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n            ? 0\n            : 1;\n        const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n        geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute(\n          {\n            componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n            componentsPerAttribute: 1,\n            values: applyOffset,\n          }\n        );\n      }\n\n      geometries.push(geometryInstance);\n    }\n  }\n\n  const geometry = GeometryPipeline.combineInstances(geometries)[0];\n  geometry.attributes.position.values = new Float64Array(\n    geometry.attributes.position.values\n  );\n  geometry.indices = IndexDatatype.createTypedArray(\n    geometry.attributes.position.values.length / 3,\n    geometry.indices\n  );\n\n  const attributes = geometry.attributes;\n  const boundingSphere = BoundingSphere.fromVertices(\n    attributes.position.values\n  );\n\n  if (!vertexFormat.position) {\n    delete attributes.position;\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: geometry.indices,\n    primitiveType: geometry.primitiveType,\n    boundingSphere: boundingSphere,\n    offsetAttribute: polygonGeometry._offsetAttribute,\n  });\n};\n\n/**\n * @private\n */\nPolygonGeometry.createShadowVolume = function (\n  polygonGeometry,\n  minHeightFunc,\n  maxHeightFunc\n) {\n  const granularity = polygonGeometry._granularity;\n  const ellipsoid = polygonGeometry._ellipsoid;\n\n  const minHeight = minHeightFunc(granularity, ellipsoid);\n  const maxHeight = maxHeightFunc(granularity, ellipsoid);\n\n  return new PolygonGeometry({\n    polygonHierarchy: polygonGeometry._polygonHierarchy,\n    ellipsoid: ellipsoid,\n    stRotation: polygonGeometry._stRotation,\n    granularity: granularity,\n    perPositionHeight: false,\n    extrudedHeight: minHeight,\n    height: maxHeight,\n    vertexFormat: VertexFormat.POSITION_ONLY,\n    shadowVolume: true,\n    arcType: polygonGeometry._arcType,\n  });\n};\n\nfunction textureCoordinateRotationPoints(polygonGeometry) {\n  const stRotation = -polygonGeometry._stRotation;\n  if (stRotation === 0.0) {\n    return [0, 0, 0, 1, 1, 0];\n  }\n  const ellipsoid = polygonGeometry._ellipsoid;\n  const positions = polygonGeometry._polygonHierarchy.positions;\n  const boundingRectangle = polygonGeometry.rectangle;\n  return Geometry._textureCoordinateRotationPoints(\n    positions,\n    stRotation,\n    ellipsoid,\n    boundingRectangle\n  );\n}\n\nObject.defineProperties(PolygonGeometry.prototype, {\n  /**\n   * @private\n   */\n  rectangle: {\n    get: function () {\n      if (!defined(this._rectangle)) {\n        const positions = this._polygonHierarchy.positions;\n        this._rectangle = PolygonGeometry.computeRectangleFromPositions(\n          positions,\n          this._ellipsoid,\n          this._arcType\n        );\n      }\n\n      return this._rectangle;\n    },\n  },\n  /**\n   * For remapping texture coordinates when rendering PolygonGeometries as GroundPrimitives.\n   * @private\n   */\n  textureCoordinateRotationPoints: {\n    get: function () {\n      if (!defined(this._textureCoordinateRotationPoints)) {\n        this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(\n          this\n        );\n      }\n      return this._textureCoordinateRotationPoints;\n    },\n  },\n});\nexport default PolygonGeometry;\n", "import ArcType from \"./ArcType.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidTangentPlane from \"./EllipsoidTangentPlane.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryInstance from \"./GeometryInstance.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolygonGeometryLibrary from \"./PolygonGeometryLibrary.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport WindingOrder from \"./WindingOrder.js\";\nconst createGeometryFromPositionsPositions = [];\nconst createGeometryFromPositionsSubdivided = [];\n\nfunction createGeometryFromPositions(\n  ellipsoid,\n  positions,\n  minDistance,\n  perPositionHeight,\n  arcType\n) {\n  const tangentPlane = EllipsoidTangentPlane.fromPoints(positions, ellipsoid);\n  const positions2D = tangentPlane.projectPointsOntoPlane(\n    positions,\n    createGeometryFromPositionsPositions\n  );\n\n  const originalWindingOrder = PolygonPipeline.computeWindingOrder2D(\n    positions2D\n  );\n  if (originalWindingOrder === WindingOrder.CLOCKWISE) {\n    positions2D.reverse();\n    positions = positions.slice().reverse();\n  }\n\n  let subdividedPositions;\n  let i;\n\n  let length = positions.length;\n  let index = 0;\n\n  if (!perPositionHeight) {\n    let numVertices = 0;\n    if (arcType === ArcType.GEODESIC) {\n      for (i = 0; i < length; i++) {\n        numVertices += PolygonGeometryLibrary.subdivideLineCount(\n          positions[i],\n          positions[(i + 1) % length],\n          minDistance\n        );\n      }\n    } else if (arcType === ArcType.RHUMB) {\n      for (i = 0; i < length; i++) {\n        numVertices += PolygonGeometryLibrary.subdivideRhumbLineCount(\n          ellipsoid,\n          positions[i],\n          positions[(i + 1) % length],\n          minDistance\n        );\n      }\n    }\n    subdividedPositions = new Float64Array(numVertices * 3);\n    for (i = 0; i < length; i++) {\n      let tempPositions;\n      if (arcType === ArcType.GEODESIC) {\n        tempPositions = PolygonGeometryLibrary.subdivideLine(\n          positions[i],\n          positions[(i + 1) % length],\n          minDistance,\n          createGeometryFromPositionsSubdivided\n        );\n      } else if (arcType === ArcType.RHUMB) {\n        tempPositions = PolygonGeometryLibrary.subdivideRhumbLine(\n          ellipsoid,\n          positions[i],\n          positions[(i + 1) % length],\n          minDistance,\n          createGeometryFromPositionsSubdivided\n        );\n      }\n      const tempPositionsLength = tempPositions.length;\n      for (let j = 0; j < tempPositionsLength; ++j) {\n        subdividedPositions[index++] = tempPositions[j];\n      }\n    }\n  } else {\n    subdividedPositions = new Float64Array(length * 2 * 3);\n    for (i = 0; i < length; i++) {\n      const p0 = positions[i];\n      const p1 = positions[(i + 1) % length];\n      subdividedPositions[index++] = p0.x;\n      subdividedPositions[index++] = p0.y;\n      subdividedPositions[index++] = p0.z;\n      subdividedPositions[index++] = p1.x;\n      subdividedPositions[index++] = p1.y;\n      subdividedPositions[index++] = p1.z;\n    }\n  }\n\n  length = subdividedPositions.length / 3;\n  const indicesSize = length * 2;\n  const indices = IndexDatatype.createTypedArray(length, indicesSize);\n  index = 0;\n  for (i = 0; i < length - 1; i++) {\n    indices[index++] = i;\n    indices[index++] = i + 1;\n  }\n  indices[index++] = length - 1;\n  indices[index++] = 0;\n\n  return new GeometryInstance({\n    geometry: new Geometry({\n      attributes: new GeometryAttributes({\n        position: new GeometryAttribute({\n          componentDatatype: ComponentDatatype.DOUBLE,\n          componentsPerAttribute: 3,\n          values: subdividedPositions,\n        }),\n      }),\n      indices: indices,\n      primitiveType: PrimitiveType.LINES,\n    }),\n  });\n}\n\nfunction createGeometryFromPositionsExtruded(\n  ellipsoid,\n  positions,\n  minDistance,\n  perPositionHeight,\n  arcType\n) {\n  const tangentPlane = EllipsoidTangentPlane.fromPoints(positions, ellipsoid);\n  const positions2D = tangentPlane.projectPointsOntoPlane(\n    positions,\n    createGeometryFromPositionsPositions\n  );\n\n  const originalWindingOrder = PolygonPipeline.computeWindingOrder2D(\n    positions2D\n  );\n  if (originalWindingOrder === WindingOrder.CLOCKWISE) {\n    positions2D.reverse();\n    positions = positions.slice().reverse();\n  }\n\n  let subdividedPositions;\n  let i;\n\n  let length = positions.length;\n  const corners = new Array(length);\n  let index = 0;\n\n  if (!perPositionHeight) {\n    let numVertices = 0;\n    if (arcType === ArcType.GEODESIC) {\n      for (i = 0; i < length; i++) {\n        numVertices += PolygonGeometryLibrary.subdivideLineCount(\n          positions[i],\n          positions[(i + 1) % length],\n          minDistance\n        );\n      }\n    } else if (arcType === ArcType.RHUMB) {\n      for (i = 0; i < length; i++) {\n        numVertices += PolygonGeometryLibrary.subdivideRhumbLineCount(\n          ellipsoid,\n          positions[i],\n          positions[(i + 1) % length],\n          minDistance\n        );\n      }\n    }\n\n    subdividedPositions = new Float64Array(numVertices * 3 * 2);\n    for (i = 0; i < length; ++i) {\n      corners[i] = index / 3;\n      let tempPositions;\n      if (arcType === ArcType.GEODESIC) {\n        tempPositions = PolygonGeometryLibrary.subdivideLine(\n          positions[i],\n          positions[(i + 1) % length],\n          minDistance,\n          createGeometryFromPositionsSubdivided\n        );\n      } else if (arcType === ArcType.RHUMB) {\n        tempPositions = PolygonGeometryLibrary.subdivideRhumbLine(\n          ellipsoid,\n          positions[i],\n          positions[(i + 1) % length],\n          minDistance,\n          createGeometryFromPositionsSubdivided\n        );\n      }\n      const tempPositionsLength = tempPositions.length;\n      for (let j = 0; j < tempPositionsLength; ++j) {\n        subdividedPositions[index++] = tempPositions[j];\n      }\n    }\n  } else {\n    subdividedPositions = new Float64Array(length * 2 * 3 * 2);\n    for (i = 0; i < length; ++i) {\n      corners[i] = index / 3;\n      const p0 = positions[i];\n      const p1 = positions[(i + 1) % length];\n\n      subdividedPositions[index++] = p0.x;\n      subdividedPositions[index++] = p0.y;\n      subdividedPositions[index++] = p0.z;\n      subdividedPositions[index++] = p1.x;\n      subdividedPositions[index++] = p1.y;\n      subdividedPositions[index++] = p1.z;\n    }\n  }\n\n  length = subdividedPositions.length / (3 * 2);\n  const cornersLength = corners.length;\n\n  const indicesSize = (length * 2 + cornersLength) * 2;\n  const indices = IndexDatatype.createTypedArray(\n    length + cornersLength,\n    indicesSize\n  );\n\n  index = 0;\n  for (i = 0; i < length; ++i) {\n    indices[index++] = i;\n    indices[index++] = (i + 1) % length;\n    indices[index++] = i + length;\n    indices[index++] = ((i + 1) % length) + length;\n  }\n\n  for (i = 0; i < cornersLength; i++) {\n    const corner = corners[i];\n    indices[index++] = corner;\n    indices[index++] = corner + length;\n  }\n\n  return new GeometryInstance({\n    geometry: new Geometry({\n      attributes: new GeometryAttributes({\n        position: new GeometryAttribute({\n          componentDatatype: ComponentDatatype.DOUBLE,\n          componentsPerAttribute: 3,\n          values: subdividedPositions,\n        }),\n      }),\n      indices: indices,\n      primitiveType: PrimitiveType.LINES,\n    }),\n  });\n}\n\n/**\n * A description of the outline of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy.\n *\n * @alias PolygonOutlineGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.\n * @param {number} [options.height=0.0] The distance in meters between the polygon and the ellipsoid surface.\n * @param {number} [options.extrudedHeight] The distance in meters between the polygon's extruded face and the ellipsoid surface.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of path the outline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\n *\n * @see PolygonOutlineGeometry#createGeometry\n * @see PolygonOutlineGeometry#fromPositions\n *\n * @example\n * // 1. create a polygon outline from points\n * const polygon = new Cesium.PolygonOutlineGeometry({\n *   polygonHierarchy : new Cesium.PolygonHierarchy(\n *     Cesium.Cartesian3.fromDegreesArray([\n *       -72.0, 40.0,\n *       -70.0, 35.0,\n *       -75.0, 30.0,\n *       -70.0, 30.0,\n *       -68.0, 40.0\n *     ])\n *   )\n * });\n * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);\n *\n * // 2. create a nested polygon with holes outline\n * const polygonWithHole = new Cesium.PolygonOutlineGeometry({\n *   polygonHierarchy : new Cesium.PolygonHierarchy(\n *     Cesium.Cartesian3.fromDegreesArray([\n *       -109.0, 30.0,\n *       -95.0, 30.0,\n *       -95.0, 40.0,\n *       -109.0, 40.0\n *     ]),\n *     [new Cesium.PolygonHierarchy(\n *       Cesium.Cartesian3.fromDegreesArray([\n *         -107.0, 31.0,\n *         -107.0, 39.0,\n *         -97.0, 39.0,\n *         -97.0, 31.0\n *       ]),\n *       [new Cesium.PolygonHierarchy(\n *         Cesium.Cartesian3.fromDegreesArray([\n *           -105.0, 33.0,\n *           -99.0, 33.0,\n *           -99.0, 37.0,\n *           -105.0, 37.0\n *         ]),\n *         [new Cesium.PolygonHierarchy(\n *           Cesium.Cartesian3.fromDegreesArray([\n *             -103.0, 34.0,\n *             -101.0, 34.0,\n *             -101.0, 36.0,\n *             -103.0, 36.0\n *           ])\n *         )]\n *       )]\n *     )]\n *   )\n * });\n * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygonWithHole);\n *\n * // 3. create extruded polygon outline\n * const extrudedPolygon = new Cesium.PolygonOutlineGeometry({\n *   polygonHierarchy : new Cesium.PolygonHierarchy(\n *     Cesium.Cartesian3.fromDegreesArray([\n *       -72.0, 40.0,\n *       -70.0, 35.0,\n *       -75.0, 30.0,\n *       -70.0, 30.0,\n *       -68.0, 40.0\n *     ])\n *   ),\n *   extrudedHeight: 300000\n * });\n * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon);\n */\nfunction PolygonOutlineGeometry(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options\", options);\n  Check.typeOf.object(\"options.polygonHierarchy\", options.polygonHierarchy);\n\n  if (options.perPositionHeight && defined(options.height)) {\n    throw new DeveloperError(\n      \"Cannot use both options.perPositionHeight and options.height\"\n    );\n  }\n  if (\n    defined(options.arcType) &&\n    options.arcType !== ArcType.GEODESIC &&\n    options.arcType !== ArcType.RHUMB\n  ) {\n    throw new DeveloperError(\n      \"Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const polygonHierarchy = options.polygonHierarchy;\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  const granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  const perPositionHeight = defaultValue(options.perPositionHeight, false);\n  const perPositionHeightExtrude =\n    perPositionHeight && defined(options.extrudedHeight);\n  const arcType = defaultValue(options.arcType, ArcType.GEODESIC);\n\n  let height = defaultValue(options.height, 0.0);\n  let extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n  if (!perPositionHeightExtrude) {\n    const h = Math.max(height, extrudedHeight);\n    extrudedHeight = Math.min(height, extrudedHeight);\n    height = h;\n  }\n\n  this._ellipsoid = Ellipsoid.clone(ellipsoid);\n  this._granularity = granularity;\n  this._height = height;\n  this._extrudedHeight = extrudedHeight;\n  this._arcType = arcType;\n  this._polygonHierarchy = polygonHierarchy;\n  this._perPositionHeight = perPositionHeight;\n  this._perPositionHeightExtrude = perPositionHeightExtrude;\n  this._offsetAttribute = options.offsetAttribute;\n  this._workerName = \"createPolygonOutlineGeometry\";\n\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  this.packedLength =\n    PolygonGeometryLibrary.computeHierarchyPackedLength(\n      polygonHierarchy,\n      Cartesian3\n    ) +\n    Ellipsoid.packedLength +\n    8;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PolygonOutlineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nPolygonOutlineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\n    value._polygonHierarchy,\n    array,\n    startingIndex,\n    Cartesian3\n  );\n\n  Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  array[startingIndex++] = value._height;\n  array[startingIndex++] = value._extrudedHeight;\n  array[startingIndex++] = value._granularity;\n  array[startingIndex++] = value._perPositionHeightExtrude ? 1.0 : 0.0;\n  array[startingIndex++] = value._perPositionHeight ? 1.0 : 0.0;\n  array[startingIndex++] = value._arcType;\n  array[startingIndex++] = defaultValue(value._offsetAttribute, -1);\n  array[startingIndex] = value.packedLength;\n\n  return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst dummyOptions = {\n  polygonHierarchy: {},\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PolygonOutlineGeometry} [result] The object into which to store the result.\n * @returns {PolygonOutlineGeometry} The modified result parameter or a new PolygonOutlineGeometry instance if one was not provided.\n */\nPolygonOutlineGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy(\n    array,\n    startingIndex,\n    Cartesian3\n  );\n  startingIndex = polygonHierarchy.startingIndex;\n  delete polygonHierarchy.startingIndex;\n\n  const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n  startingIndex += Ellipsoid.packedLength;\n\n  const height = array[startingIndex++];\n  const extrudedHeight = array[startingIndex++];\n  const granularity = array[startingIndex++];\n  const perPositionHeightExtrude = array[startingIndex++] === 1.0;\n  const perPositionHeight = array[startingIndex++] === 1.0;\n  const arcType = array[startingIndex++];\n  const offsetAttribute = array[startingIndex++];\n  const packedLength = array[startingIndex];\n\n  if (!defined(result)) {\n    result = new PolygonOutlineGeometry(dummyOptions);\n  }\n\n  result._polygonHierarchy = polygonHierarchy;\n  result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n  result._height = height;\n  result._extrudedHeight = extrudedHeight;\n  result._granularity = granularity;\n  result._perPositionHeight = perPositionHeight;\n  result._perPositionHeightExtrude = perPositionHeightExtrude;\n  result._arcType = arcType;\n  result._offsetAttribute =\n    offsetAttribute === -1 ? undefined : offsetAttribute;\n  result.packedLength = packedLength;\n\n  return result;\n};\n\n/**\n * A description of a polygon outline from an array of positions.\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.\n * @param {number} [options.height=0.0] The height of the polygon.\n * @param {number} [options.extrudedHeight] The height of the polygon extrusion.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of path the outline must follow. Valid options are {@link LinkType.GEODESIC} and {@link ArcType.RHUMB}.\n * @returns {PolygonOutlineGeometry}\n *\n *\n * @example\n * // create a polygon from points\n * const polygon = Cesium.PolygonOutlineGeometry.fromPositions({\n *   positions : Cesium.Cartesian3.fromDegreesArray([\n *     -72.0, 40.0,\n *     -70.0, 35.0,\n *     -75.0, 30.0,\n *     -70.0, 30.0,\n *     -68.0, 40.0\n *   ])\n * });\n * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);\n *\n * @see PolygonOutlineGeometry#createGeometry\n */\nPolygonOutlineGeometry.fromPositions = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.positions\", options.positions);\n  //>>includeEnd('debug');\n\n  const newOptions = {\n    polygonHierarchy: {\n      positions: options.positions,\n    },\n    height: options.height,\n    extrudedHeight: options.extrudedHeight,\n    ellipsoid: options.ellipsoid,\n    granularity: options.granularity,\n    perPositionHeight: options.perPositionHeight,\n    arcType: options.arcType,\n    offsetAttribute: options.offsetAttribute,\n  };\n  return new PolygonOutlineGeometry(newOptions);\n};\n\n/**\n * Computes the geometric representation of a polygon outline, including its vertices, indices, and a bounding sphere.\n *\n * @param {PolygonOutlineGeometry} polygonGeometry A description of the polygon outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nPolygonOutlineGeometry.createGeometry = function (polygonGeometry) {\n  const ellipsoid = polygonGeometry._ellipsoid;\n  const granularity = polygonGeometry._granularity;\n  const polygonHierarchy = polygonGeometry._polygonHierarchy;\n  const perPositionHeight = polygonGeometry._perPositionHeight;\n  const arcType = polygonGeometry._arcType;\n\n  const polygons = PolygonGeometryLibrary.polygonOutlinesFromHierarchy(\n    polygonHierarchy,\n    !perPositionHeight,\n    ellipsoid\n  );\n\n  if (polygons.length === 0) {\n    return undefined;\n  }\n\n  let geometryInstance;\n  const geometries = [];\n  const minDistance = CesiumMath.chordLength(\n    granularity,\n    ellipsoid.maximumRadius\n  );\n\n  const height = polygonGeometry._height;\n  const extrudedHeight = polygonGeometry._extrudedHeight;\n  const extrude =\n    polygonGeometry._perPositionHeightExtrude ||\n    !CesiumMath.equalsEpsilon(height, extrudedHeight, 0, CesiumMath.EPSILON2);\n  let offsetValue;\n  let i;\n  if (extrude) {\n    for (i = 0; i < polygons.length; i++) {\n      geometryInstance = createGeometryFromPositionsExtruded(\n        ellipsoid,\n        polygons[i],\n        minDistance,\n        perPositionHeight,\n        arcType\n      );\n      geometryInstance.geometry = PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(\n        geometryInstance.geometry,\n        height,\n        extrudedHeight,\n        ellipsoid,\n        perPositionHeight\n      );\n      if (defined(polygonGeometry._offsetAttribute)) {\n        const size =\n          geometryInstance.geometry.attributes.position.values.length / 3;\n        let offsetAttribute = new Uint8Array(size);\n        if (polygonGeometry._offsetAttribute === GeometryOffsetAttribute.TOP) {\n          offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\n        } else {\n          offsetValue =\n            polygonGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n              ? 0\n              : 1;\n          offsetAttribute = offsetAttribute.fill(offsetValue);\n        }\n\n        geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute(\n          {\n            componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n            componentsPerAttribute: 1,\n            values: offsetAttribute,\n          }\n        );\n      }\n      geometries.push(geometryInstance);\n    }\n  } else {\n    for (i = 0; i < polygons.length; i++) {\n      geometryInstance = createGeometryFromPositions(\n        ellipsoid,\n        polygons[i],\n        minDistance,\n        perPositionHeight,\n        arcType\n      );\n      geometryInstance.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n        geometryInstance.geometry.attributes.position.values,\n        height,\n        ellipsoid,\n        !perPositionHeight\n      );\n\n      if (defined(polygonGeometry._offsetAttribute)) {\n        const length =\n          geometryInstance.geometry.attributes.position.values.length;\n        offsetValue =\n          polygonGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n            ? 0\n            : 1;\n        const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n        geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute(\n          {\n            componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n            componentsPerAttribute: 1,\n            values: applyOffset,\n          }\n        );\n      }\n\n      geometries.push(geometryInstance);\n    }\n  }\n\n  const geometry = GeometryPipeline.combineInstances(geometries)[0];\n  const boundingSphere = BoundingSphere.fromVertices(\n    geometry.attributes.position.values\n  );\n\n  return new Geometry({\n    attributes: geometry.attributes,\n    indices: geometry.indices,\n    primitiveType: geometry.primitiveType,\n    boundingSphere: boundingSphere,\n    offsetAttribute: polygonGeometry._offsetAttribute,\n  });\n};\nexport default PolygonOutlineGeometry;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport ArcType from \"../Core/ArcType.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport CoplanarPolygonGeometry from \"../Core/CoplanarPolygonGeometry.js\";\nimport CoplanarPolygonOutlineGeometry from \"../Core/CoplanarPolygonOutlineGeometry.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport EllipsoidTangentPlane from \"../Core/EllipsoidTangentPlane.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport PolygonGeometry from \"../Core/PolygonGeometry.js\";\nimport PolygonOutlineGeometry from \"../Core/PolygonOutlineGeometry.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport GroundGeometryUpdater from \"./GroundGeometryUpdater.js\";\nimport Property from \"./Property.js\";\n\nconst heightAndPerPositionHeightWarning =\n  \"Entity polygons cannot have both height and perPositionHeight.  height will be ignored\";\nconst heightReferenceAndPerPositionHeightWarning =\n  \"heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored\";\n\nconst scratchColor = new Color();\nconst defaultOffset = Cartesian3.ZERO;\nconst offsetScratch = new Cartesian3();\nconst scratchRectangle = new Rectangle();\nconst scratch2DPositions = [];\nconst cart2Scratch = new Cartesian2();\n\nfunction PolygonGeometryOptions(entity) {\n  this.id = entity;\n  this.vertexFormat = undefined;\n  this.polygonHierarchy = undefined;\n  this.perPositionHeight = undefined;\n  this.closeTop = undefined;\n  this.closeBottom = undefined;\n  this.height = undefined;\n  this.extrudedHeight = undefined;\n  this.granularity = undefined;\n  this.stRotation = undefined;\n  this.offsetAttribute = undefined;\n  this.arcType = undefined;\n  this.textureCoordinates = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for polygons.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias PolygonGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction PolygonGeometryUpdater(entity, scene) {\n  GroundGeometryUpdater.call(this, {\n    entity: entity,\n    scene: scene,\n    geometryOptions: new PolygonGeometryOptions(entity),\n    geometryPropertyName: \"polygon\",\n    observedPropertyNames: [\"availability\", \"polygon\"],\n  });\n\n  this._onEntityPropertyChanged(entity, \"polygon\", entity.polygon, undefined);\n}\n\nif (defined(Object.create)) {\n  PolygonGeometryUpdater.prototype = Object.create(\n    GroundGeometryUpdater.prototype\n  );\n  PolygonGeometryUpdater.prototype.constructor = PolygonGeometryUpdater;\n}\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nPolygonGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._fillEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent a filled geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n  const options = this._options;\n\n  const attributes = {\n    show: new ShowGeometryInstanceAttribute(\n      isAvailable &&\n        entity.isShowing &&\n        this._showProperty.getValue(time) &&\n        this._fillProperty.getValue(time)\n    ),\n    distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n      this._distanceDisplayConditionProperty.getValue(time)\n    ),\n    offset: undefined,\n    color: undefined,\n  };\n\n  if (this._materialProperty instanceof ColorMaterialProperty) {\n    let currentColor;\n    if (\n      defined(this._materialProperty.color) &&\n      (this._materialProperty.color.isConstant || isAvailable)\n    ) {\n      currentColor = this._materialProperty.color.getValue(time, scratchColor);\n    }\n    if (!defined(currentColor)) {\n      currentColor = Color.WHITE;\n    }\n    attributes.color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n  }\n  if (defined(options.offsetAttribute)) {\n    attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n      Property.getValueOrDefault(\n        this._terrainOffsetProperty,\n        time,\n        defaultOffset,\n        offsetScratch\n      )\n    );\n  }\n\n  let geometry;\n  if (options.perPositionHeight && !defined(options.extrudedHeight)) {\n    geometry = new CoplanarPolygonGeometry(options);\n  } else {\n    geometry = new PolygonGeometry(options);\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: geometry,\n    attributes: attributes,\n  });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nPolygonGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n  time\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._outlineEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent an outlined geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n  const options = this._options;\n  const outlineColor = Property.getValueOrDefault(\n    this._outlineColorProperty,\n    time,\n    Color.BLACK,\n    scratchColor\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n\n  const attributes = {\n    show: new ShowGeometryInstanceAttribute(\n      isAvailable &&\n        entity.isShowing &&\n        this._showProperty.getValue(time) &&\n        this._showOutlineProperty.getValue(time)\n    ),\n    color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n    distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n      distanceDisplayCondition\n    ),\n    offset: undefined,\n  };\n\n  if (defined(options.offsetAttribute)) {\n    attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n      Property.getValueOrDefault(\n        this._terrainOffsetProperty,\n        time,\n        defaultOffset,\n        offsetScratch\n      )\n    );\n  }\n\n  let geometry;\n  if (options.perPositionHeight && !defined(options.extrudedHeight)) {\n    geometry = new CoplanarPolygonOutlineGeometry(options);\n  } else {\n    geometry = new PolygonOutlineGeometry(options);\n  }\n  return new GeometryInstance({\n    id: entity,\n    geometry: geometry,\n    attributes: attributes,\n  });\n};\n\nPolygonGeometryUpdater.prototype._computeCenter = function (time, result) {\n  const hierarchy = Property.getValueOrUndefined(\n    this._entity.polygon.hierarchy,\n    time\n  );\n  if (!defined(hierarchy)) {\n    return;\n  }\n  const positions = hierarchy.positions;\n  if (positions.length === 0) {\n    return;\n  }\n  const ellipsoid = this._scene.mapProjection.ellipsoid;\n\n  const tangentPlane = EllipsoidTangentPlane.fromPoints(positions, ellipsoid);\n  const positions2D = tangentPlane.projectPointsOntoPlane(\n    positions,\n    scratch2DPositions\n  );\n\n  const length = positions2D.length;\n  let area = 0;\n  let j = length - 1;\n  let centroid2D = new Cartesian2();\n  for (let i = 0; i < length; j = i++) {\n    const p1 = positions2D[i];\n    const p2 = positions2D[j];\n    const f = p1.x * p2.y - p2.x * p1.y;\n\n    let sum = Cartesian2.add(p1, p2, cart2Scratch);\n    sum = Cartesian2.multiplyByScalar(sum, f, sum);\n    centroid2D = Cartesian2.add(centroid2D, sum, centroid2D);\n\n    area += f;\n  }\n\n  const a = 1.0 / (area * 3.0);\n  centroid2D = Cartesian2.multiplyByScalar(centroid2D, a, centroid2D);\n  return tangentPlane.projectPointOntoEllipsoid(centroid2D, result);\n};\n\nPolygonGeometryUpdater.prototype._isHidden = function (entity, polygon) {\n  return (\n    !defined(polygon.hierarchy) ||\n    GeometryUpdater.prototype._isHidden.call(this, entity, polygon)\n  );\n};\n\nPolygonGeometryUpdater.prototype._isOnTerrain = function (entity, polygon) {\n  const onTerrain = GroundGeometryUpdater.prototype._isOnTerrain.call(\n    this,\n    entity,\n    polygon\n  );\n  const perPositionHeightProperty = polygon.perPositionHeight;\n  const perPositionHeightEnabled =\n    defined(perPositionHeightProperty) &&\n    (perPositionHeightProperty.isConstant\n      ? perPositionHeightProperty.getValue(Iso8601.MINIMUM_VALUE)\n      : true);\n  return onTerrain && !perPositionHeightEnabled;\n};\n\nPolygonGeometryUpdater.prototype._isDynamic = function (entity, polygon) {\n  return (\n    !polygon.hierarchy.isConstant || //\n    !Property.isConstant(polygon.height) || //\n    !Property.isConstant(polygon.extrudedHeight) || //\n    !Property.isConstant(polygon.granularity) || //\n    !Property.isConstant(polygon.stRotation) || //\n    !Property.isConstant(polygon.textureCoordinates) || //\n    !Property.isConstant(polygon.outlineWidth) || //\n    !Property.isConstant(polygon.perPositionHeight) || //\n    !Property.isConstant(polygon.closeTop) || //\n    !Property.isConstant(polygon.closeBottom) || //\n    !Property.isConstant(polygon.zIndex) || //\n    !Property.isConstant(polygon.arcType) || //\n    (this._onTerrain &&\n      !Property.isConstant(this._materialProperty) &&\n      !(this._materialProperty instanceof ColorMaterialProperty))\n  );\n};\n\nPolygonGeometryUpdater.prototype._setStaticOptions = function (\n  entity,\n  polygon\n) {\n  const isColorMaterial =\n    this._materialProperty instanceof ColorMaterialProperty;\n\n  const options = this._options;\n  options.vertexFormat = isColorMaterial\n    ? PerInstanceColorAppearance.VERTEX_FORMAT\n    : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n\n  const hierarchyValue = polygon.hierarchy.getValue(Iso8601.MINIMUM_VALUE);\n  let heightValue = Property.getValueOrUndefined(\n    polygon.height,\n    Iso8601.MINIMUM_VALUE\n  );\n  const heightReferenceValue = Property.getValueOrDefault(\n    polygon.heightReference,\n    Iso8601.MINIMUM_VALUE,\n    HeightReference.NONE\n  );\n  let extrudedHeightValue = Property.getValueOrUndefined(\n    polygon.extrudedHeight,\n    Iso8601.MINIMUM_VALUE\n  );\n  const extrudedHeightReferenceValue = Property.getValueOrDefault(\n    polygon.extrudedHeightReference,\n    Iso8601.MINIMUM_VALUE,\n    HeightReference.NONE\n  );\n  const perPositionHeightValue = Property.getValueOrDefault(\n    polygon.perPositionHeight,\n    Iso8601.MINIMUM_VALUE,\n    false\n  );\n\n  heightValue = GroundGeometryUpdater.getGeometryHeight(\n    heightValue,\n    heightReferenceValue\n  );\n\n  let offsetAttribute;\n  if (perPositionHeightValue) {\n    if (defined(heightValue)) {\n      heightValue = undefined;\n      oneTimeWarning(heightAndPerPositionHeightWarning);\n    }\n    if (\n      heightReferenceValue !== HeightReference.NONE &&\n      perPositionHeightValue\n    ) {\n      heightValue = undefined;\n      oneTimeWarning(heightReferenceAndPerPositionHeightWarning);\n    }\n  } else {\n    if (defined(extrudedHeightValue) && !defined(heightValue)) {\n      heightValue = 0;\n    }\n    offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n      heightValue,\n      heightReferenceValue,\n      extrudedHeightValue,\n      extrudedHeightReferenceValue\n    );\n  }\n\n  options.polygonHierarchy = hierarchyValue;\n  options.granularity = Property.getValueOrUndefined(\n    polygon.granularity,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.stRotation = Property.getValueOrUndefined(\n    polygon.stRotation,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.perPositionHeight = perPositionHeightValue;\n  options.closeTop = Property.getValueOrDefault(\n    polygon.closeTop,\n    Iso8601.MINIMUM_VALUE,\n    true\n  );\n  options.closeBottom = Property.getValueOrDefault(\n    polygon.closeBottom,\n    Iso8601.MINIMUM_VALUE,\n    true\n  );\n  options.offsetAttribute = offsetAttribute;\n  options.height = heightValue;\n  options.arcType = Property.getValueOrDefault(\n    polygon.arcType,\n    Iso8601.MINIMUM_VALUE,\n    ArcType.GEODESIC\n  );\n  options.textureCoordinates = Property.getValueOrUndefined(\n    polygon.textureCoordinates,\n    Iso8601.MINIMUM_VALUE\n  );\n\n  extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n    extrudedHeightValue,\n    extrudedHeightReferenceValue\n  );\n  if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n    extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n      PolygonGeometry.computeRectangle(options, scratchRectangle)\n    ).minimumTerrainHeight;\n  }\n\n  options.extrudedHeight = extrudedHeightValue;\n};\n\nPolygonGeometryUpdater.prototype._getIsClosed = function (options) {\n  const height = options.height;\n  const extrudedHeight = options.extrudedHeight;\n  const isExtruded = defined(extrudedHeight) && extrudedHeight !== height;\n  return (\n    !options.perPositionHeight &&\n    ((!isExtruded && height === 0) ||\n      (isExtruded && options.closeTop && options.closeBottom))\n  );\n};\n\nPolygonGeometryUpdater.DynamicGeometryUpdater = DyanmicPolygonGeometryUpdater;\n\n/**\n * @private\n */\nfunction DyanmicPolygonGeometryUpdater(\n  geometryUpdater,\n  primitives,\n  groundPrimitives\n) {\n  DynamicGeometryUpdater.call(\n    this,\n    geometryUpdater,\n    primitives,\n    groundPrimitives\n  );\n}\n\nif (defined(Object.create)) {\n  DyanmicPolygonGeometryUpdater.prototype = Object.create(\n    DynamicGeometryUpdater.prototype\n  );\n  DyanmicPolygonGeometryUpdater.prototype.constructor = DyanmicPolygonGeometryUpdater;\n}\n\nDyanmicPolygonGeometryUpdater.prototype._isHidden = function (\n  entity,\n  polygon,\n  time\n) {\n  return (\n    !defined(this._options.polygonHierarchy) ||\n    DynamicGeometryUpdater.prototype._isHidden.call(this, entity, polygon, time)\n  );\n};\n\nDyanmicPolygonGeometryUpdater.prototype._setOptions = function (\n  entity,\n  polygon,\n  time\n) {\n  const options = this._options;\n\n  options.polygonHierarchy = Property.getValueOrUndefined(\n    polygon.hierarchy,\n    time\n  );\n\n  let heightValue = Property.getValueOrUndefined(polygon.height, time);\n  const heightReferenceValue = Property.getValueOrDefault(\n    polygon.heightReference,\n    time,\n    HeightReference.NONE\n  );\n  const extrudedHeightReferenceValue = Property.getValueOrDefault(\n    polygon.extrudedHeightReference,\n    time,\n    HeightReference.NONE\n  );\n  let extrudedHeightValue = Property.getValueOrUndefined(\n    polygon.extrudedHeight,\n    time\n  );\n  const perPositionHeightValue = Property.getValueOrUndefined(\n    polygon.perPositionHeight,\n    time\n  );\n\n  heightValue = GroundGeometryUpdater.getGeometryHeight(\n    heightValue,\n    extrudedHeightReferenceValue\n  );\n\n  let offsetAttribute;\n  if (perPositionHeightValue) {\n    if (defined(heightValue)) {\n      heightValue = undefined;\n      oneTimeWarning(heightAndPerPositionHeightWarning);\n    }\n    if (\n      heightReferenceValue !== HeightReference.NONE &&\n      perPositionHeightValue\n    ) {\n      heightValue = undefined;\n      oneTimeWarning(heightReferenceAndPerPositionHeightWarning);\n    }\n  } else {\n    if (defined(extrudedHeightValue) && !defined(heightValue)) {\n      heightValue = 0;\n    }\n\n    offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n      heightValue,\n      heightReferenceValue,\n      extrudedHeightValue,\n      extrudedHeightReferenceValue\n    );\n  }\n\n  options.granularity = Property.getValueOrUndefined(polygon.granularity, time);\n  options.stRotation = Property.getValueOrUndefined(polygon.stRotation, time);\n  options.textureCoordinates = Property.getValueOrUndefined(\n    polygon.textureCoordinates,\n    time\n  );\n  options.perPositionHeight = Property.getValueOrUndefined(\n    polygon.perPositionHeight,\n    time\n  );\n  options.closeTop = Property.getValueOrDefault(polygon.closeTop, time, true);\n  options.closeBottom = Property.getValueOrDefault(\n    polygon.closeBottom,\n    time,\n    true\n  );\n  options.offsetAttribute = offsetAttribute;\n  options.height = heightValue;\n  options.arcType = Property.getValueOrDefault(\n    polygon.arcType,\n    time,\n    ArcType.GEODESIC\n  );\n\n  extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n    extrudedHeightValue,\n    extrudedHeightReferenceValue\n  );\n  if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n    extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n      PolygonGeometry.computeRectangle(options, scratchRectangle)\n    ).minimumTerrainHeight;\n  }\n\n  options.extrudedHeight = extrudedHeightValue;\n};\nexport default PolygonGeometryUpdater;\n", "import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingRectangle from \"./BoundingRectangle.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CornerType from \"./CornerType.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport oneTimeWarning from \"./oneTimeWarning.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PolylineVolumeGeometryLibrary from \"./PolylineVolumeGeometryLibrary.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport VertexFormat from \"./VertexFormat.js\";\nimport WindingOrder from \"./WindingOrder.js\";\n\nfunction computeAttributes(\n  combinedPositions,\n  shape,\n  boundingRectangle,\n  vertexFormat\n) {\n  const attributes = new GeometryAttributes();\n  if (vertexFormat.position) {\n    attributes.position = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: combinedPositions,\n    });\n  }\n  const shapeLength = shape.length;\n  const vertexCount = combinedPositions.length / 3;\n  const length = (vertexCount - shapeLength * 2) / (shapeLength * 2);\n  const firstEndIndices = PolygonPipeline.triangulate(shape);\n\n  const indicesCount =\n    (length - 1) * shapeLength * 6 + firstEndIndices.length * 2;\n  const indices = IndexDatatype.createTypedArray(vertexCount, indicesCount);\n  let i, j;\n  let ll, ul, ur, lr;\n  const offset = shapeLength * 2;\n  let index = 0;\n  for (i = 0; i < length - 1; i++) {\n    for (j = 0; j < shapeLength - 1; j++) {\n      ll = j * 2 + i * shapeLength * 2;\n      lr = ll + offset;\n      ul = ll + 1;\n      ur = ul + offset;\n\n      indices[index++] = ul;\n      indices[index++] = ll;\n      indices[index++] = ur;\n      indices[index++] = ur;\n      indices[index++] = ll;\n      indices[index++] = lr;\n    }\n    ll = shapeLength * 2 - 2 + i * shapeLength * 2;\n    ul = ll + 1;\n    ur = ul + offset;\n    lr = ll + offset;\n\n    indices[index++] = ul;\n    indices[index++] = ll;\n    indices[index++] = ur;\n    indices[index++] = ur;\n    indices[index++] = ll;\n    indices[index++] = lr;\n  }\n\n  if (vertexFormat.st || vertexFormat.tangent || vertexFormat.bitangent) {\n    // st required for tangent/bitangent calculation\n    const st = new Float32Array(vertexCount * 2);\n    const lengthSt = 1 / (length - 1);\n    const heightSt = 1 / boundingRectangle.height;\n    const heightOffset = boundingRectangle.height / 2;\n    let s, t;\n    let stindex = 0;\n    for (i = 0; i < length; i++) {\n      s = i * lengthSt;\n      t = heightSt * (shape[0].y + heightOffset);\n      st[stindex++] = s;\n      st[stindex++] = t;\n      for (j = 1; j < shapeLength; j++) {\n        t = heightSt * (shape[j].y + heightOffset);\n        st[stindex++] = s;\n        st[stindex++] = t;\n        st[stindex++] = s;\n        st[stindex++] = t;\n      }\n      t = heightSt * (shape[0].y + heightOffset);\n      st[stindex++] = s;\n      st[stindex++] = t;\n    }\n    for (j = 0; j < shapeLength; j++) {\n      s = 0;\n      t = heightSt * (shape[j].y + heightOffset);\n      st[stindex++] = s;\n      st[stindex++] = t;\n    }\n    for (j = 0; j < shapeLength; j++) {\n      s = (length - 1) * lengthSt;\n      t = heightSt * (shape[j].y + heightOffset);\n      st[stindex++] = s;\n      st[stindex++] = t;\n    }\n\n    attributes.st = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n      values: new Float32Array(st),\n    });\n  }\n\n  const endOffset = vertexCount - shapeLength * 2;\n  for (i = 0; i < firstEndIndices.length; i += 3) {\n    const v0 = firstEndIndices[i] + endOffset;\n    const v1 = firstEndIndices[i + 1] + endOffset;\n    const v2 = firstEndIndices[i + 2] + endOffset;\n\n    indices[index++] = v0;\n    indices[index++] = v1;\n    indices[index++] = v2;\n    indices[index++] = v2 + shapeLength;\n    indices[index++] = v1 + shapeLength;\n    indices[index++] = v0 + shapeLength;\n  }\n\n  let geometry = new Geometry({\n    attributes: attributes,\n    indices: indices,\n    boundingSphere: BoundingSphere.fromVertices(combinedPositions),\n    primitiveType: PrimitiveType.TRIANGLES,\n  });\n\n  if (vertexFormat.normal) {\n    geometry = GeometryPipeline.computeNormal(geometry);\n  }\n\n  if (vertexFormat.tangent || vertexFormat.bitangent) {\n    try {\n      geometry = GeometryPipeline.computeTangentAndBitangent(geometry);\n    } catch (e) {\n      oneTimeWarning(\n        \"polyline-volume-tangent-bitangent\",\n        \"Unable to compute tangents and bitangents for polyline volume geometry\"\n      );\n      //TODO https://github.com/CesiumGS/cesium/issues/3609\n    }\n\n    if (!vertexFormat.tangent) {\n      geometry.attributes.tangent = undefined;\n    }\n    if (!vertexFormat.bitangent) {\n      geometry.attributes.bitangent = undefined;\n    }\n    if (!vertexFormat.st) {\n      geometry.attributes.st = undefined;\n    }\n  }\n\n  return geometry;\n}\n\n/**\n * A description of a polyline with a volume (a 2D shape extruded along a polyline).\n *\n * @alias PolylineVolumeGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.polylinePositions An array of {@link Cartesian3} positions that define the center of the polyline volume.\n * @param {Cartesian2[]} options.shapePositions An array of {@link Cartesian2} positions that define the shape to be extruded along the polyline\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.\n *\n * @see PolylineVolumeGeometry#createGeometry\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Polyline%20Volume.html|Cesium Sandcastle Polyline Volume Demo}\n *\n * @example\n * function computeCircle(radius) {\n *   const positions = [];\n *   for (let i = 0; i < 360; i++) {\n *     const radians = Cesium.Math.toRadians(i);\n *     positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));\n *   }\n *   return positions;\n * }\n *\n * const volume = new Cesium.PolylineVolumeGeometry({\n *   vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\n *   polylinePositions : Cesium.Cartesian3.fromDegreesArray([\n *     -72.0, 40.0,\n *     -70.0, 35.0\n *   ]),\n *   shapePositions : computeCircle(100000.0)\n * });\n */\nfunction PolylineVolumeGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const positions = options.polylinePositions;\n  const shape = options.shapePositions;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(positions)) {\n    throw new DeveloperError(\"options.polylinePositions is required.\");\n  }\n  if (!defined(shape)) {\n    throw new DeveloperError(\"options.shapePositions is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._positions = positions;\n  this._shape = shape;\n  this._ellipsoid = Ellipsoid.clone(\n    defaultValue(options.ellipsoid, Ellipsoid.WGS84)\n  );\n  this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);\n  this._vertexFormat = VertexFormat.clone(\n    defaultValue(options.vertexFormat, VertexFormat.DEFAULT)\n  );\n  this._granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  this._workerName = \"createPolylineVolumeGeometry\";\n\n  let numComponents = 1 + positions.length * Cartesian3.packedLength;\n  numComponents += 1 + shape.length * Cartesian2.packedLength;\n\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  this.packedLength =\n    numComponents + Ellipsoid.packedLength + VertexFormat.packedLength + 2;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PolylineVolumeGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nPolylineVolumeGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required\");\n  }\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  let i;\n\n  const positions = value._positions;\n  let length = positions.length;\n  array[startingIndex++] = length;\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    Cartesian3.pack(positions[i], array, startingIndex);\n  }\n\n  const shape = value._shape;\n  length = shape.length;\n  array[startingIndex++] = length;\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian2.packedLength) {\n    Cartesian2.pack(shape[i], array, startingIndex);\n  }\n\n  Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  VertexFormat.pack(value._vertexFormat, array, startingIndex);\n  startingIndex += VertexFormat.packedLength;\n\n  array[startingIndex++] = value._cornerType;\n  array[startingIndex] = value._granularity;\n\n  return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n  polylinePositions: undefined,\n  shapePositions: undefined,\n  ellipsoid: scratchEllipsoid,\n  vertexFormat: scratchVertexFormat,\n  cornerType: undefined,\n  granularity: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PolylineVolumeGeometry} [result] The object into which to store the result.\n * @returns {PolylineVolumeGeometry} The modified result parameter or a new PolylineVolumeGeometry instance if one was not provided.\n */\nPolylineVolumeGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  let i;\n\n  let length = array[startingIndex++];\n  const positions = new Array(length);\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    positions[i] = Cartesian3.unpack(array, startingIndex);\n  }\n\n  length = array[startingIndex++];\n  const shape = new Array(length);\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian2.packedLength) {\n    shape[i] = Cartesian2.unpack(array, startingIndex);\n  }\n\n  const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n  startingIndex += Ellipsoid.packedLength;\n\n  const vertexFormat = VertexFormat.unpack(\n    array,\n    startingIndex,\n    scratchVertexFormat\n  );\n  startingIndex += VertexFormat.packedLength;\n\n  const cornerType = array[startingIndex++];\n  const granularity = array[startingIndex];\n\n  if (!defined(result)) {\n    scratchOptions.polylinePositions = positions;\n    scratchOptions.shapePositions = shape;\n    scratchOptions.cornerType = cornerType;\n    scratchOptions.granularity = granularity;\n    return new PolylineVolumeGeometry(scratchOptions);\n  }\n\n  result._positions = positions;\n  result._shape = shape;\n  result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n  result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n  result._cornerType = cornerType;\n  result._granularity = granularity;\n\n  return result;\n};\n\nconst brScratch = new BoundingRectangle();\n\n/**\n * Computes the geometric representation of a polyline with a volume, including its vertices, indices, and a bounding sphere.\n *\n * @param {PolylineVolumeGeometry} polylineVolumeGeometry A description of the polyline volume.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nPolylineVolumeGeometry.createGeometry = function (polylineVolumeGeometry) {\n  const positions = polylineVolumeGeometry._positions;\n  const cleanPositions = arrayRemoveDuplicates(\n    positions,\n    Cartesian3.equalsEpsilon\n  );\n  let shape2D = polylineVolumeGeometry._shape;\n  shape2D = PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(shape2D);\n\n  if (cleanPositions.length < 2 || shape2D.length < 3) {\n    return undefined;\n  }\n\n  if (\n    PolygonPipeline.computeWindingOrder2D(shape2D) === WindingOrder.CLOCKWISE\n  ) {\n    shape2D.reverse();\n  }\n  const boundingRectangle = BoundingRectangle.fromPoints(shape2D, brScratch);\n\n  const computedPositions = PolylineVolumeGeometryLibrary.computePositions(\n    cleanPositions,\n    shape2D,\n    boundingRectangle,\n    polylineVolumeGeometry,\n    true\n  );\n  return computeAttributes(\n    computedPositions,\n    shape2D,\n    boundingRectangle,\n    polylineVolumeGeometry._vertexFormat\n  );\n};\nexport default PolylineVolumeGeometry;\n", "import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingRectangle from \"./BoundingRectangle.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CornerType from \"./CornerType.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PolylineVolumeGeometryLibrary from \"./PolylineVolumeGeometryLibrary.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport WindingOrder from \"./WindingOrder.js\";\n\nfunction computeAttributes(positions, shape) {\n  const attributes = new GeometryAttributes();\n  attributes.position = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.DOUBLE,\n    componentsPerAttribute: 3,\n    values: positions,\n  });\n\n  const shapeLength = shape.length;\n  const vertexCount = attributes.position.values.length / 3;\n  const positionLength = positions.length / 3;\n  const shapeCount = positionLength / shapeLength;\n  const indices = IndexDatatype.createTypedArray(\n    vertexCount,\n    2 * shapeLength * (shapeCount + 1)\n  );\n  let i, j;\n  let index = 0;\n  i = 0;\n  let offset = i * shapeLength;\n  for (j = 0; j < shapeLength - 1; j++) {\n    indices[index++] = j + offset;\n    indices[index++] = j + offset + 1;\n  }\n  indices[index++] = shapeLength - 1 + offset;\n  indices[index++] = offset;\n\n  i = shapeCount - 1;\n  offset = i * shapeLength;\n  for (j = 0; j < shapeLength - 1; j++) {\n    indices[index++] = j + offset;\n    indices[index++] = j + offset + 1;\n  }\n  indices[index++] = shapeLength - 1 + offset;\n  indices[index++] = offset;\n\n  for (i = 0; i < shapeCount - 1; i++) {\n    const firstOffset = shapeLength * i;\n    const secondOffset = firstOffset + shapeLength;\n    for (j = 0; j < shapeLength; j++) {\n      indices[index++] = j + firstOffset;\n      indices[index++] = j + secondOffset;\n    }\n  }\n\n  const geometry = new Geometry({\n    attributes: attributes,\n    indices: IndexDatatype.createTypedArray(vertexCount, indices),\n    boundingSphere: BoundingSphere.fromVertices(positions),\n    primitiveType: PrimitiveType.LINES,\n  });\n\n  return geometry;\n}\n\n/**\n * A description of a polyline with a volume (a 2D shape extruded along a polyline).\n *\n * @alias PolylineVolumeOutlineGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.polylinePositions An array of positions that define the center of the polyline volume.\n * @param {Cartesian2[]} options.shapePositions An array of positions that define the shape to be extruded along the polyline\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.\n *\n * @see PolylineVolumeOutlineGeometry#createGeometry\n *\n * @example\n * function computeCircle(radius) {\n *   const positions = [];\n *   for (let i = 0; i < 360; i++) {\n *     const radians = Cesium.Math.toRadians(i);\n *     positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));\n *   }\n *   return positions;\n * }\n *\n * const volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({\n *   polylinePositions : Cesium.Cartesian3.fromDegreesArray([\n *     -72.0, 40.0,\n *     -70.0, 35.0\n *   ]),\n *   shapePositions : computeCircle(100000.0)\n * });\n */\nfunction PolylineVolumeOutlineGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const positions = options.polylinePositions;\n  const shape = options.shapePositions;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(positions)) {\n    throw new DeveloperError(\"options.polylinePositions is required.\");\n  }\n  if (!defined(shape)) {\n    throw new DeveloperError(\"options.shapePositions is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._positions = positions;\n  this._shape = shape;\n  this._ellipsoid = Ellipsoid.clone(\n    defaultValue(options.ellipsoid, Ellipsoid.WGS84)\n  );\n  this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);\n  this._granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  this._workerName = \"createPolylineVolumeOutlineGeometry\";\n\n  let numComponents = 1 + positions.length * Cartesian3.packedLength;\n  numComponents += 1 + shape.length * Cartesian2.packedLength;\n\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  this.packedLength = numComponents + Ellipsoid.packedLength + 2;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PolylineVolumeOutlineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nPolylineVolumeOutlineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required\");\n  }\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  let i;\n\n  const positions = value._positions;\n  let length = positions.length;\n  array[startingIndex++] = length;\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    Cartesian3.pack(positions[i], array, startingIndex);\n  }\n\n  const shape = value._shape;\n  length = shape.length;\n  array[startingIndex++] = length;\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian2.packedLength) {\n    Cartesian2.pack(shape[i], array, startingIndex);\n  }\n\n  Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  array[startingIndex++] = value._cornerType;\n  array[startingIndex] = value._granularity;\n\n  return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchOptions = {\n  polylinePositions: undefined,\n  shapePositions: undefined,\n  ellipsoid: scratchEllipsoid,\n  height: undefined,\n  cornerType: undefined,\n  granularity: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PolylineVolumeOutlineGeometry} [result] The object into which to store the result.\n * @returns {PolylineVolumeOutlineGeometry} The modified result parameter or a new PolylineVolumeOutlineGeometry instance if one was not provided.\n */\nPolylineVolumeOutlineGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  let i;\n\n  let length = array[startingIndex++];\n  const positions = new Array(length);\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    positions[i] = Cartesian3.unpack(array, startingIndex);\n  }\n\n  length = array[startingIndex++];\n  const shape = new Array(length);\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian2.packedLength) {\n    shape[i] = Cartesian2.unpack(array, startingIndex);\n  }\n\n  const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n  startingIndex += Ellipsoid.packedLength;\n\n  const cornerType = array[startingIndex++];\n  const granularity = array[startingIndex];\n\n  if (!defined(result)) {\n    scratchOptions.polylinePositions = positions;\n    scratchOptions.shapePositions = shape;\n    scratchOptions.cornerType = cornerType;\n    scratchOptions.granularity = granularity;\n    return new PolylineVolumeOutlineGeometry(scratchOptions);\n  }\n\n  result._positions = positions;\n  result._shape = shape;\n  result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n  result._cornerType = cornerType;\n  result._granularity = granularity;\n\n  return result;\n};\n\nconst brScratch = new BoundingRectangle();\n\n/**\n * Computes the geometric representation of the outline of a polyline with a volume, including its vertices, indices, and a bounding sphere.\n *\n * @param {PolylineVolumeOutlineGeometry} polylineVolumeOutlineGeometry A description of the polyline volume outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nPolylineVolumeOutlineGeometry.createGeometry = function (\n  polylineVolumeOutlineGeometry\n) {\n  const positions = polylineVolumeOutlineGeometry._positions;\n  const cleanPositions = arrayRemoveDuplicates(\n    positions,\n    Cartesian3.equalsEpsilon\n  );\n  let shape2D = polylineVolumeOutlineGeometry._shape;\n  shape2D = PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(shape2D);\n\n  if (cleanPositions.length < 2 || shape2D.length < 3) {\n    return undefined;\n  }\n\n  if (\n    PolygonPipeline.computeWindingOrder2D(shape2D) === WindingOrder.CLOCKWISE\n  ) {\n    shape2D.reverse();\n  }\n  const boundingRectangle = BoundingRectangle.fromPoints(shape2D, brScratch);\n\n  const computedPositions = PolylineVolumeGeometryLibrary.computePositions(\n    cleanPositions,\n    shape2D,\n    boundingRectangle,\n    polylineVolumeOutlineGeometry,\n    false\n  );\n  return computeAttributes(computedPositions, shape2D);\n};\nexport default PolylineVolumeOutlineGeometry;\n", "import Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport PolylineVolumeGeometry from \"../Core/PolylineVolumeGeometry.js\";\nimport PolylineVolumeOutlineGeometry from \"../Core/PolylineVolumeOutlineGeometry.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport Property from \"./Property.js\";\n\nconst scratchColor = new Color();\n\nfunction PolylineVolumeGeometryOptions(entity) {\n  this.id = entity;\n  this.vertexFormat = undefined;\n  this.polylinePositions = undefined;\n  this.shapePositions = undefined;\n  this.cornerType = undefined;\n  this.granularity = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for polyline volumes.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias PolylineVolumeGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction PolylineVolumeGeometryUpdater(entity, scene) {\n  GeometryUpdater.call(this, {\n    entity: entity,\n    scene: scene,\n    geometryOptions: new PolylineVolumeGeometryOptions(entity),\n    geometryPropertyName: \"polylineVolume\",\n    observedPropertyNames: [\"availability\", \"polylineVolume\"],\n  });\n\n  this._onEntityPropertyChanged(\n    entity,\n    \"polylineVolume\",\n    entity.polylineVolume,\n    undefined\n  );\n}\n\nif (defined(Object.create)) {\n  PolylineVolumeGeometryUpdater.prototype = Object.create(\n    GeometryUpdater.prototype\n  );\n  PolylineVolumeGeometryUpdater.prototype.constructor = PolylineVolumeGeometryUpdater;\n}\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nPolylineVolumeGeometryUpdater.prototype.createFillGeometryInstance = function (\n  time\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._fillEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent a filled geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n\n  let attributes;\n\n  let color;\n  const show = new ShowGeometryInstanceAttribute(\n    isAvailable &&\n      entity.isShowing &&\n      this._showProperty.getValue(time) &&\n      this._fillProperty.getValue(time)\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n  const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n    distanceDisplayCondition\n  );\n  if (this._materialProperty instanceof ColorMaterialProperty) {\n    let currentColor;\n    if (\n      defined(this._materialProperty.color) &&\n      (this._materialProperty.color.isConstant || isAvailable)\n    ) {\n      currentColor = this._materialProperty.color.getValue(time, scratchColor);\n    }\n    if (!defined(currentColor)) {\n      currentColor = Color.WHITE;\n    }\n    color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n    attributes = {\n      show: show,\n      distanceDisplayCondition: distanceDisplayConditionAttribute,\n      color: color,\n    };\n  } else {\n    attributes = {\n      show: show,\n      distanceDisplayCondition: distanceDisplayConditionAttribute,\n    };\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new PolylineVolumeGeometry(this._options),\n    attributes: attributes,\n  });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nPolylineVolumeGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n  time\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._outlineEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent an outlined geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n  const outlineColor = Property.getValueOrDefault(\n    this._outlineColorProperty,\n    time,\n    Color.BLACK,\n    scratchColor\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new PolylineVolumeOutlineGeometry(this._options),\n    attributes: {\n      show: new ShowGeometryInstanceAttribute(\n        isAvailable &&\n          entity.isShowing &&\n          this._showProperty.getValue(time) &&\n          this._showOutlineProperty.getValue(time)\n      ),\n      color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n      distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n        distanceDisplayCondition\n      ),\n    },\n  });\n};\n\nPolylineVolumeGeometryUpdater.prototype._isHidden = function (\n  entity,\n  polylineVolume\n) {\n  return (\n    !defined(polylineVolume.positions) ||\n    !defined(polylineVolume.shape) ||\n    GeometryUpdater.prototype._isHidden.call(this, entity, polylineVolume)\n  );\n};\n\nPolylineVolumeGeometryUpdater.prototype._isDynamic = function (\n  entity,\n  polylineVolume\n) {\n  return (\n    !polylineVolume.positions.isConstant || //\n    !polylineVolume.shape.isConstant || //\n    !Property.isConstant(polylineVolume.granularity) || //\n    !Property.isConstant(polylineVolume.outlineWidth) || //\n    !Property.isConstant(polylineVolume.cornerType)\n  );\n};\n\nPolylineVolumeGeometryUpdater.prototype._setStaticOptions = function (\n  entity,\n  polylineVolume\n) {\n  const granularity = polylineVolume.granularity;\n  const cornerType = polylineVolume.cornerType;\n\n  const options = this._options;\n  const isColorMaterial =\n    this._materialProperty instanceof ColorMaterialProperty;\n  options.vertexFormat = isColorMaterial\n    ? PerInstanceColorAppearance.VERTEX_FORMAT\n    : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n  options.polylinePositions = polylineVolume.positions.getValue(\n    Iso8601.MINIMUM_VALUE,\n    options.polylinePositions\n  );\n  options.shapePositions = polylineVolume.shape.getValue(\n    Iso8601.MINIMUM_VALUE,\n    options.shape\n  );\n  options.granularity = defined(granularity)\n    ? granularity.getValue(Iso8601.MINIMUM_VALUE)\n    : undefined;\n  options.cornerType = defined(cornerType)\n    ? cornerType.getValue(Iso8601.MINIMUM_VALUE)\n    : undefined;\n};\n\nPolylineVolumeGeometryUpdater.DynamicGeometryUpdater = DynamicPolylineVolumeGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicPolylineVolumeGeometryUpdater(\n  geometryUpdater,\n  primitives,\n  groundPrimitives\n) {\n  DynamicGeometryUpdater.call(\n    this,\n    geometryUpdater,\n    primitives,\n    groundPrimitives\n  );\n}\n\nif (defined(Object.create)) {\n  DynamicPolylineVolumeGeometryUpdater.prototype = Object.create(\n    DynamicGeometryUpdater.prototype\n  );\n  DynamicPolylineVolumeGeometryUpdater.prototype.constructor = DynamicPolylineVolumeGeometryUpdater;\n}\n\nDynamicPolylineVolumeGeometryUpdater.prototype._isHidden = function (\n  entity,\n  polylineVolume,\n  time\n) {\n  const options = this._options;\n  return (\n    !defined(options.polylinePositions) ||\n    !defined(options.shapePositions) ||\n    DynamicGeometryUpdater.prototype._isHidden.call(\n      this,\n      entity,\n      polylineVolume,\n      time\n    )\n  );\n};\n\nDynamicPolylineVolumeGeometryUpdater.prototype._setOptions = function (\n  entity,\n  polylineVolume,\n  time\n) {\n  const options = this._options;\n  options.polylinePositions = Property.getValueOrUndefined(\n    polylineVolume.positions,\n    time,\n    options.polylinePositions\n  );\n  options.shapePositions = Property.getValueOrUndefined(\n    polylineVolume.shape,\n    time\n  );\n  options.granularity = Property.getValueOrUndefined(\n    polylineVolume.granularity,\n    time\n  );\n  options.cornerType = Property.getValueOrUndefined(\n    polylineVolume.cornerType,\n    time\n  );\n};\nexport default PolylineVolumeGeometryUpdater;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryInstance from \"./GeometryInstance.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix2 from \"./Matrix2.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport RectangleGeometryLibrary from \"./RectangleGeometryLibrary.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst positionScratch = new Cartesian3();\nconst normalScratch = new Cartesian3();\nconst tangentScratch = new Cartesian3();\nconst bitangentScratch = new Cartesian3();\nconst rectangleScratch = new Rectangle();\nconst stScratch = new Cartesian2();\nconst bottomBoundingSphere = new BoundingSphere();\nconst topBoundingSphere = new BoundingSphere();\n\nfunction createAttributes(vertexFormat, attributes) {\n  const geo = new Geometry({\n    attributes: new GeometryAttributes(),\n    primitiveType: PrimitiveType.TRIANGLES,\n  });\n\n  geo.attributes.position = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.DOUBLE,\n    componentsPerAttribute: 3,\n    values: attributes.positions,\n  });\n  if (vertexFormat.normal) {\n    geo.attributes.normal = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: attributes.normals,\n    });\n  }\n  if (vertexFormat.tangent) {\n    geo.attributes.tangent = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: attributes.tangents,\n    });\n  }\n  if (vertexFormat.bitangent) {\n    geo.attributes.bitangent = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: attributes.bitangents,\n    });\n  }\n  return geo;\n}\n\nfunction calculateAttributes(\n  positions,\n  vertexFormat,\n  ellipsoid,\n  tangentRotationMatrix\n) {\n  const length = positions.length;\n\n  const normals = vertexFormat.normal ? new Float32Array(length) : undefined;\n  const tangents = vertexFormat.tangent ? new Float32Array(length) : undefined;\n  const bitangents = vertexFormat.bitangent\n    ? new Float32Array(length)\n    : undefined;\n\n  let attrIndex = 0;\n  const bitangent = bitangentScratch;\n  const tangent = tangentScratch;\n  let normal = normalScratch;\n  if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {\n    for (let i = 0; i < length; i += 3) {\n      const p = Cartesian3.fromArray(positions, i, positionScratch);\n      const attrIndex1 = attrIndex + 1;\n      const attrIndex2 = attrIndex + 2;\n\n      normal = ellipsoid.geodeticSurfaceNormal(p, normal);\n      if (vertexFormat.tangent || vertexFormat.bitangent) {\n        Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent);\n        Matrix3.multiplyByVector(tangentRotationMatrix, tangent, tangent);\n        Cartesian3.normalize(tangent, tangent);\n\n        if (vertexFormat.bitangent) {\n          Cartesian3.normalize(\n            Cartesian3.cross(normal, tangent, bitangent),\n            bitangent\n          );\n        }\n      }\n\n      if (vertexFormat.normal) {\n        normals[attrIndex] = normal.x;\n        normals[attrIndex1] = normal.y;\n        normals[attrIndex2] = normal.z;\n      }\n      if (vertexFormat.tangent) {\n        tangents[attrIndex] = tangent.x;\n        tangents[attrIndex1] = tangent.y;\n        tangents[attrIndex2] = tangent.z;\n      }\n      if (vertexFormat.bitangent) {\n        bitangents[attrIndex] = bitangent.x;\n        bitangents[attrIndex1] = bitangent.y;\n        bitangents[attrIndex2] = bitangent.z;\n      }\n      attrIndex += 3;\n    }\n  }\n  return createAttributes(vertexFormat, {\n    positions: positions,\n    normals: normals,\n    tangents: tangents,\n    bitangents: bitangents,\n  });\n}\n\nconst v1Scratch = new Cartesian3();\nconst v2Scratch = new Cartesian3();\n\nfunction calculateAttributesWall(positions, vertexFormat, ellipsoid) {\n  const length = positions.length;\n\n  const normals = vertexFormat.normal ? new Float32Array(length) : undefined;\n  const tangents = vertexFormat.tangent ? new Float32Array(length) : undefined;\n  const bitangents = vertexFormat.bitangent\n    ? new Float32Array(length)\n    : undefined;\n\n  let normalIndex = 0;\n  let tangentIndex = 0;\n  let bitangentIndex = 0;\n  let recomputeNormal = true;\n\n  let bitangent = bitangentScratch;\n  let tangent = tangentScratch;\n  let normal = normalScratch;\n  if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {\n    for (let i = 0; i < length; i += 6) {\n      const p = Cartesian3.fromArray(positions, i, positionScratch);\n      const p1 = Cartesian3.fromArray(positions, (i + 6) % length, v1Scratch);\n      if (recomputeNormal) {\n        const p2 = Cartesian3.fromArray(positions, (i + 3) % length, v2Scratch);\n        Cartesian3.subtract(p1, p, p1);\n        Cartesian3.subtract(p2, p, p2);\n        normal = Cartesian3.normalize(Cartesian3.cross(p2, p1, normal), normal);\n        recomputeNormal = false;\n      }\n\n      if (Cartesian3.equalsEpsilon(p1, p, CesiumMath.EPSILON10)) {\n        // if we've reached a corner\n        recomputeNormal = true;\n      }\n\n      if (vertexFormat.tangent || vertexFormat.bitangent) {\n        bitangent = ellipsoid.geodeticSurfaceNormal(p, bitangent);\n        if (vertexFormat.tangent) {\n          tangent = Cartesian3.normalize(\n            Cartesian3.cross(bitangent, normal, tangent),\n            tangent\n          );\n        }\n      }\n\n      if (vertexFormat.normal) {\n        normals[normalIndex++] = normal.x;\n        normals[normalIndex++] = normal.y;\n        normals[normalIndex++] = normal.z;\n        normals[normalIndex++] = normal.x;\n        normals[normalIndex++] = normal.y;\n        normals[normalIndex++] = normal.z;\n      }\n\n      if (vertexFormat.tangent) {\n        tangents[tangentIndex++] = tangent.x;\n        tangents[tangentIndex++] = tangent.y;\n        tangents[tangentIndex++] = tangent.z;\n        tangents[tangentIndex++] = tangent.x;\n        tangents[tangentIndex++] = tangent.y;\n        tangents[tangentIndex++] = tangent.z;\n      }\n\n      if (vertexFormat.bitangent) {\n        bitangents[bitangentIndex++] = bitangent.x;\n        bitangents[bitangentIndex++] = bitangent.y;\n        bitangents[bitangentIndex++] = bitangent.z;\n        bitangents[bitangentIndex++] = bitangent.x;\n        bitangents[bitangentIndex++] = bitangent.y;\n        bitangents[bitangentIndex++] = bitangent.z;\n      }\n    }\n  }\n\n  return createAttributes(vertexFormat, {\n    positions: positions,\n    normals: normals,\n    tangents: tangents,\n    bitangents: bitangents,\n  });\n}\n\nfunction constructRectangle(rectangleGeometry, computedOptions) {\n  const vertexFormat = rectangleGeometry._vertexFormat;\n  const ellipsoid = rectangleGeometry._ellipsoid;\n  const height = computedOptions.height;\n  const width = computedOptions.width;\n  const northCap = computedOptions.northCap;\n  const southCap = computedOptions.southCap;\n\n  let rowStart = 0;\n  let rowEnd = height;\n  let rowHeight = height;\n  let size = 0;\n  if (northCap) {\n    rowStart = 1;\n    rowHeight -= 1;\n    size += 1;\n  }\n  if (southCap) {\n    rowEnd -= 1;\n    rowHeight -= 1;\n    size += 1;\n  }\n  size += width * rowHeight;\n\n  const positions = vertexFormat.position\n    ? new Float64Array(size * 3)\n    : undefined;\n  const textureCoordinates = vertexFormat.st\n    ? new Float32Array(size * 2)\n    : undefined;\n\n  let posIndex = 0;\n  let stIndex = 0;\n\n  const position = positionScratch;\n  const st = stScratch;\n\n  let minX = Number.MAX_VALUE;\n  let minY = Number.MAX_VALUE;\n  let maxX = -Number.MAX_VALUE;\n  let maxY = -Number.MAX_VALUE;\n\n  for (let row = rowStart; row < rowEnd; ++row) {\n    for (let col = 0; col < width; ++col) {\n      RectangleGeometryLibrary.computePosition(\n        computedOptions,\n        ellipsoid,\n        vertexFormat.st,\n        row,\n        col,\n        position,\n        st\n      );\n\n      positions[posIndex++] = position.x;\n      positions[posIndex++] = position.y;\n      positions[posIndex++] = position.z;\n\n      if (vertexFormat.st) {\n        textureCoordinates[stIndex++] = st.x;\n        textureCoordinates[stIndex++] = st.y;\n\n        minX = Math.min(minX, st.x);\n        minY = Math.min(minY, st.y);\n        maxX = Math.max(maxX, st.x);\n        maxY = Math.max(maxY, st.y);\n      }\n    }\n  }\n  if (northCap) {\n    RectangleGeometryLibrary.computePosition(\n      computedOptions,\n      ellipsoid,\n      vertexFormat.st,\n      0,\n      0,\n      position,\n      st\n    );\n\n    positions[posIndex++] = position.x;\n    positions[posIndex++] = position.y;\n    positions[posIndex++] = position.z;\n\n    if (vertexFormat.st) {\n      textureCoordinates[stIndex++] = st.x;\n      textureCoordinates[stIndex++] = st.y;\n\n      minX = st.x;\n      minY = st.y;\n      maxX = st.x;\n      maxY = st.y;\n    }\n  }\n  if (southCap) {\n    RectangleGeometryLibrary.computePosition(\n      computedOptions,\n      ellipsoid,\n      vertexFormat.st,\n      height - 1,\n      0,\n      position,\n      st\n    );\n\n    positions[posIndex++] = position.x;\n    positions[posIndex++] = position.y;\n    positions[posIndex] = position.z;\n\n    if (vertexFormat.st) {\n      textureCoordinates[stIndex++] = st.x;\n      textureCoordinates[stIndex] = st.y;\n\n      minX = Math.min(minX, st.x);\n      minY = Math.min(minY, st.y);\n      maxX = Math.max(maxX, st.x);\n      maxY = Math.max(maxY, st.y);\n    }\n  }\n\n  if (\n    vertexFormat.st &&\n    (minX < 0.0 || minY < 0.0 || maxX > 1.0 || maxY > 1.0)\n  ) {\n    for (let k = 0; k < textureCoordinates.length; k += 2) {\n      textureCoordinates[k] = (textureCoordinates[k] - minX) / (maxX - minX);\n      textureCoordinates[k + 1] =\n        (textureCoordinates[k + 1] - minY) / (maxY - minY);\n    }\n  }\n\n  const geo = calculateAttributes(\n    positions,\n    vertexFormat,\n    ellipsoid,\n    computedOptions.tangentRotationMatrix\n  );\n\n  let indicesSize = 6 * (width - 1) * (rowHeight - 1);\n  if (northCap) {\n    indicesSize += 3 * (width - 1);\n  }\n  if (southCap) {\n    indicesSize += 3 * (width - 1);\n  }\n  const indices = IndexDatatype.createTypedArray(size, indicesSize);\n  let index = 0;\n  let indicesIndex = 0;\n  let i;\n  for (i = 0; i < rowHeight - 1; ++i) {\n    for (let j = 0; j < width - 1; ++j) {\n      const upperLeft = index;\n      const lowerLeft = upperLeft + width;\n      const lowerRight = lowerLeft + 1;\n      const upperRight = upperLeft + 1;\n      indices[indicesIndex++] = upperLeft;\n      indices[indicesIndex++] = lowerLeft;\n      indices[indicesIndex++] = upperRight;\n      indices[indicesIndex++] = upperRight;\n      indices[indicesIndex++] = lowerLeft;\n      indices[indicesIndex++] = lowerRight;\n      ++index;\n    }\n    ++index;\n  }\n  if (northCap || southCap) {\n    let northIndex = size - 1;\n    const southIndex = size - 1;\n    if (northCap && southCap) {\n      northIndex = size - 2;\n    }\n\n    let p1;\n    let p2;\n    index = 0;\n\n    if (northCap) {\n      for (i = 0; i < width - 1; i++) {\n        p1 = index;\n        p2 = p1 + 1;\n        indices[indicesIndex++] = northIndex;\n        indices[indicesIndex++] = p1;\n        indices[indicesIndex++] = p2;\n        ++index;\n      }\n    }\n    if (southCap) {\n      index = (rowHeight - 1) * width;\n      for (i = 0; i < width - 1; i++) {\n        p1 = index;\n        p2 = p1 + 1;\n        indices[indicesIndex++] = p1;\n        indices[indicesIndex++] = southIndex;\n        indices[indicesIndex++] = p2;\n        ++index;\n      }\n    }\n  }\n\n  geo.indices = indices;\n  if (vertexFormat.st) {\n    geo.attributes.st = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n      values: textureCoordinates,\n    });\n  }\n\n  return geo;\n}\n\nfunction addWallPositions(\n  wallPositions,\n  posIndex,\n  i,\n  topPositions,\n  bottomPositions\n) {\n  wallPositions[posIndex++] = topPositions[i];\n  wallPositions[posIndex++] = topPositions[i + 1];\n  wallPositions[posIndex++] = topPositions[i + 2];\n  wallPositions[posIndex++] = bottomPositions[i];\n  wallPositions[posIndex++] = bottomPositions[i + 1];\n  wallPositions[posIndex] = bottomPositions[i + 2];\n  return wallPositions;\n}\n\nfunction addWallTextureCoordinates(wallTextures, stIndex, i, st) {\n  wallTextures[stIndex++] = st[i];\n  wallTextures[stIndex++] = st[i + 1];\n  wallTextures[stIndex++] = st[i];\n  wallTextures[stIndex] = st[i + 1];\n  return wallTextures;\n}\n\nconst scratchVertexFormat = new VertexFormat();\n\nfunction constructExtrudedRectangle(rectangleGeometry, computedOptions) {\n  const shadowVolume = rectangleGeometry._shadowVolume;\n  const offsetAttributeValue = rectangleGeometry._offsetAttribute;\n  const vertexFormat = rectangleGeometry._vertexFormat;\n  const minHeight = rectangleGeometry._extrudedHeight;\n  const maxHeight = rectangleGeometry._surfaceHeight;\n  const ellipsoid = rectangleGeometry._ellipsoid;\n\n  const height = computedOptions.height;\n  const width = computedOptions.width;\n\n  let i;\n\n  if (shadowVolume) {\n    const newVertexFormat = VertexFormat.clone(\n      vertexFormat,\n      scratchVertexFormat\n    );\n    newVertexFormat.normal = true;\n    rectangleGeometry._vertexFormat = newVertexFormat;\n  }\n\n  const topBottomGeo = constructRectangle(rectangleGeometry, computedOptions);\n\n  if (shadowVolume) {\n    rectangleGeometry._vertexFormat = vertexFormat;\n  }\n\n  let topPositions = PolygonPipeline.scaleToGeodeticHeight(\n    topBottomGeo.attributes.position.values,\n    maxHeight,\n    ellipsoid,\n    false\n  );\n  topPositions = new Float64Array(topPositions);\n  let length = topPositions.length;\n  const newLength = length * 2;\n  const positions = new Float64Array(newLength);\n  positions.set(topPositions);\n  const bottomPositions = PolygonPipeline.scaleToGeodeticHeight(\n    topBottomGeo.attributes.position.values,\n    minHeight,\n    ellipsoid\n  );\n  positions.set(bottomPositions, length);\n  topBottomGeo.attributes.position.values = positions;\n\n  const normals = vertexFormat.normal ? new Float32Array(newLength) : undefined;\n  const tangents = vertexFormat.tangent\n    ? new Float32Array(newLength)\n    : undefined;\n  const bitangents = vertexFormat.bitangent\n    ? new Float32Array(newLength)\n    : undefined;\n  const textures = vertexFormat.st\n    ? new Float32Array((newLength / 3) * 2)\n    : undefined;\n  let topSt;\n  let topNormals;\n  if (vertexFormat.normal) {\n    topNormals = topBottomGeo.attributes.normal.values;\n    normals.set(topNormals);\n    for (i = 0; i < length; i++) {\n      topNormals[i] = -topNormals[i];\n    }\n    normals.set(topNormals, length);\n    topBottomGeo.attributes.normal.values = normals;\n  }\n  if (shadowVolume) {\n    topNormals = topBottomGeo.attributes.normal.values;\n    if (!vertexFormat.normal) {\n      topBottomGeo.attributes.normal = undefined;\n    }\n    const extrudeNormals = new Float32Array(newLength);\n    for (i = 0; i < length; i++) {\n      topNormals[i] = -topNormals[i];\n    }\n    extrudeNormals.set(topNormals, length); //only get normals for bottom layer that's going to be pushed down\n    topBottomGeo.attributes.extrudeDirection = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: extrudeNormals,\n    });\n  }\n\n  let offsetValue;\n  const hasOffsets = defined(offsetAttributeValue);\n  if (hasOffsets) {\n    const size = (length / 3) * 2;\n    let offsetAttribute = new Uint8Array(size);\n    if (offsetAttributeValue === GeometryOffsetAttribute.TOP) {\n      offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\n    } else {\n      offsetValue =\n        offsetAttributeValue === GeometryOffsetAttribute.NONE ? 0 : 1;\n      offsetAttribute = offsetAttribute.fill(offsetValue);\n    }\n\n    topBottomGeo.attributes.applyOffset = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 1,\n      values: offsetAttribute,\n    });\n  }\n\n  if (vertexFormat.tangent) {\n    const topTangents = topBottomGeo.attributes.tangent.values;\n    tangents.set(topTangents);\n    for (i = 0; i < length; i++) {\n      topTangents[i] = -topTangents[i];\n    }\n    tangents.set(topTangents, length);\n    topBottomGeo.attributes.tangent.values = tangents;\n  }\n  if (vertexFormat.bitangent) {\n    const topBitangents = topBottomGeo.attributes.bitangent.values;\n    bitangents.set(topBitangents);\n    bitangents.set(topBitangents, length);\n    topBottomGeo.attributes.bitangent.values = bitangents;\n  }\n  if (vertexFormat.st) {\n    topSt = topBottomGeo.attributes.st.values;\n    textures.set(topSt);\n    textures.set(topSt, (length / 3) * 2);\n    topBottomGeo.attributes.st.values = textures;\n  }\n\n  const indices = topBottomGeo.indices;\n  const indicesLength = indices.length;\n  const posLength = length / 3;\n  const newIndices = IndexDatatype.createTypedArray(\n    newLength / 3,\n    indicesLength * 2\n  );\n  newIndices.set(indices);\n  for (i = 0; i < indicesLength; i += 3) {\n    newIndices[i + indicesLength] = indices[i + 2] + posLength;\n    newIndices[i + 1 + indicesLength] = indices[i + 1] + posLength;\n    newIndices[i + 2 + indicesLength] = indices[i] + posLength;\n  }\n  topBottomGeo.indices = newIndices;\n\n  const northCap = computedOptions.northCap;\n  const southCap = computedOptions.southCap;\n\n  let rowHeight = height;\n  let widthMultiplier = 2;\n  let perimeterPositions = 0;\n  let corners = 4;\n  let dupliateCorners = 4;\n  if (northCap) {\n    widthMultiplier -= 1;\n    rowHeight -= 1;\n    perimeterPositions += 1;\n    corners -= 2;\n    dupliateCorners -= 1;\n  }\n  if (southCap) {\n    widthMultiplier -= 1;\n    rowHeight -= 1;\n    perimeterPositions += 1;\n    corners -= 2;\n    dupliateCorners -= 1;\n  }\n  perimeterPositions += widthMultiplier * width + 2 * rowHeight - corners;\n\n  const wallCount = (perimeterPositions + dupliateCorners) * 2;\n\n  let wallPositions = new Float64Array(wallCount * 3);\n  const wallExtrudeNormals = shadowVolume\n    ? new Float32Array(wallCount * 3)\n    : undefined;\n  let wallOffsetAttribute = hasOffsets ? new Uint8Array(wallCount) : undefined;\n  let wallTextures = vertexFormat.st\n    ? new Float32Array(wallCount * 2)\n    : undefined;\n\n  const computeTopOffsets =\n    offsetAttributeValue === GeometryOffsetAttribute.TOP;\n  if (hasOffsets && !computeTopOffsets) {\n    offsetValue = offsetAttributeValue === GeometryOffsetAttribute.ALL ? 1 : 0;\n    wallOffsetAttribute = wallOffsetAttribute.fill(offsetValue);\n  }\n\n  let posIndex = 0;\n  let stIndex = 0;\n  let extrudeNormalIndex = 0;\n  let wallOffsetIndex = 0;\n  const area = width * rowHeight;\n  let threeI;\n  for (i = 0; i < area; i += width) {\n    threeI = i * 3;\n    wallPositions = addWallPositions(\n      wallPositions,\n      posIndex,\n      threeI,\n      topPositions,\n      bottomPositions\n    );\n    posIndex += 6;\n    if (vertexFormat.st) {\n      wallTextures = addWallTextureCoordinates(\n        wallTextures,\n        stIndex,\n        i * 2,\n        topSt\n      );\n      stIndex += 4;\n    }\n    if (shadowVolume) {\n      extrudeNormalIndex += 3;\n      wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\n      wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\n      wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\n    }\n    if (computeTopOffsets) {\n      wallOffsetAttribute[wallOffsetIndex++] = 1;\n      wallOffsetIndex += 1;\n    }\n  }\n\n  if (!southCap) {\n    for (i = area - width; i < area; i++) {\n      threeI = i * 3;\n      wallPositions = addWallPositions(\n        wallPositions,\n        posIndex,\n        threeI,\n        topPositions,\n        bottomPositions\n      );\n      posIndex += 6;\n      if (vertexFormat.st) {\n        wallTextures = addWallTextureCoordinates(\n          wallTextures,\n          stIndex,\n          i * 2,\n          topSt\n        );\n        stIndex += 4;\n      }\n      if (shadowVolume) {\n        extrudeNormalIndex += 3;\n        wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\n        wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\n        wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\n      }\n      if (computeTopOffsets) {\n        wallOffsetAttribute[wallOffsetIndex++] = 1;\n        wallOffsetIndex += 1;\n      }\n    }\n  } else {\n    const southIndex = northCap ? area + 1 : area;\n    threeI = southIndex * 3;\n\n    for (i = 0; i < 2; i++) {\n      // duplicate corner points\n      wallPositions = addWallPositions(\n        wallPositions,\n        posIndex,\n        threeI,\n        topPositions,\n        bottomPositions\n      );\n      posIndex += 6;\n      if (vertexFormat.st) {\n        wallTextures = addWallTextureCoordinates(\n          wallTextures,\n          stIndex,\n          southIndex * 2,\n          topSt\n        );\n        stIndex += 4;\n      }\n      if (shadowVolume) {\n        extrudeNormalIndex += 3;\n        wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\n        wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\n        wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\n      }\n      if (computeTopOffsets) {\n        wallOffsetAttribute[wallOffsetIndex++] = 1;\n        wallOffsetIndex += 1;\n      }\n    }\n  }\n\n  for (i = area - 1; i > 0; i -= width) {\n    threeI = i * 3;\n    wallPositions = addWallPositions(\n      wallPositions,\n      posIndex,\n      threeI,\n      topPositions,\n      bottomPositions\n    );\n    posIndex += 6;\n    if (vertexFormat.st) {\n      wallTextures = addWallTextureCoordinates(\n        wallTextures,\n        stIndex,\n        i * 2,\n        topSt\n      );\n      stIndex += 4;\n    }\n    if (shadowVolume) {\n      extrudeNormalIndex += 3;\n      wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\n      wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\n      wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\n    }\n    if (computeTopOffsets) {\n      wallOffsetAttribute[wallOffsetIndex++] = 1;\n      wallOffsetIndex += 1;\n    }\n  }\n\n  if (!northCap) {\n    for (i = width - 1; i >= 0; i--) {\n      threeI = i * 3;\n      wallPositions = addWallPositions(\n        wallPositions,\n        posIndex,\n        threeI,\n        topPositions,\n        bottomPositions\n      );\n      posIndex += 6;\n      if (vertexFormat.st) {\n        wallTextures = addWallTextureCoordinates(\n          wallTextures,\n          stIndex,\n          i * 2,\n          topSt\n        );\n        stIndex += 4;\n      }\n      if (shadowVolume) {\n        extrudeNormalIndex += 3;\n        wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\n        wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\n        wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\n      }\n      if (computeTopOffsets) {\n        wallOffsetAttribute[wallOffsetIndex++] = 1;\n        wallOffsetIndex += 1;\n      }\n    }\n  } else {\n    const northIndex = area;\n    threeI = northIndex * 3;\n\n    for (i = 0; i < 2; i++) {\n      // duplicate corner points\n      wallPositions = addWallPositions(\n        wallPositions,\n        posIndex,\n        threeI,\n        topPositions,\n        bottomPositions\n      );\n      posIndex += 6;\n      if (vertexFormat.st) {\n        wallTextures = addWallTextureCoordinates(\n          wallTextures,\n          stIndex,\n          northIndex * 2,\n          topSt\n        );\n        stIndex += 4;\n      }\n      if (shadowVolume) {\n        extrudeNormalIndex += 3;\n        wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\n        wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\n        wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\n      }\n      if (computeTopOffsets) {\n        wallOffsetAttribute[wallOffsetIndex++] = 1;\n        wallOffsetIndex += 1;\n      }\n    }\n  }\n\n  let geo = calculateAttributesWall(wallPositions, vertexFormat, ellipsoid);\n\n  if (vertexFormat.st) {\n    geo.attributes.st = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n      values: wallTextures,\n    });\n  }\n  if (shadowVolume) {\n    geo.attributes.extrudeDirection = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: wallExtrudeNormals,\n    });\n  }\n  if (hasOffsets) {\n    geo.attributes.applyOffset = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 1,\n      values: wallOffsetAttribute,\n    });\n  }\n\n  const wallIndices = IndexDatatype.createTypedArray(\n    wallCount,\n    perimeterPositions * 6\n  );\n\n  let upperLeft;\n  let lowerLeft;\n  let lowerRight;\n  let upperRight;\n  length = wallPositions.length / 3;\n  let index = 0;\n  for (i = 0; i < length - 1; i += 2) {\n    upperLeft = i;\n    upperRight = (upperLeft + 2) % length;\n    const p1 = Cartesian3.fromArray(wallPositions, upperLeft * 3, v1Scratch);\n    const p2 = Cartesian3.fromArray(wallPositions, upperRight * 3, v2Scratch);\n    if (Cartesian3.equalsEpsilon(p1, p2, CesiumMath.EPSILON10)) {\n      continue;\n    }\n    lowerLeft = (upperLeft + 1) % length;\n    lowerRight = (lowerLeft + 2) % length;\n    wallIndices[index++] = upperLeft;\n    wallIndices[index++] = lowerLeft;\n    wallIndices[index++] = upperRight;\n    wallIndices[index++] = upperRight;\n    wallIndices[index++] = lowerLeft;\n    wallIndices[index++] = lowerRight;\n  }\n\n  geo.indices = wallIndices;\n\n  geo = GeometryPipeline.combineInstances([\n    new GeometryInstance({\n      geometry: topBottomGeo,\n    }),\n    new GeometryInstance({\n      geometry: geo,\n    }),\n  ]);\n\n  return geo[0];\n}\n\nconst scratchRectanglePoints = [\n  new Cartesian3(),\n  new Cartesian3(),\n  new Cartesian3(),\n  new Cartesian3(),\n];\nconst nwScratch = new Cartographic();\nconst stNwScratch = new Cartographic();\nfunction computeRectangle(rectangle, granularity, rotation, ellipsoid, result) {\n  if (rotation === 0.0) {\n    return Rectangle.clone(rectangle, result);\n  }\n\n  const computedOptions = RectangleGeometryLibrary.computeOptions(\n    rectangle,\n    granularity,\n    rotation,\n    0,\n    rectangleScratch,\n    nwScratch\n  );\n\n  const height = computedOptions.height;\n  const width = computedOptions.width;\n\n  const positions = scratchRectanglePoints;\n  RectangleGeometryLibrary.computePosition(\n    computedOptions,\n    ellipsoid,\n    false,\n    0,\n    0,\n    positions[0]\n  );\n  RectangleGeometryLibrary.computePosition(\n    computedOptions,\n    ellipsoid,\n    false,\n    0,\n    width - 1,\n    positions[1]\n  );\n  RectangleGeometryLibrary.computePosition(\n    computedOptions,\n    ellipsoid,\n    false,\n    height - 1,\n    0,\n    positions[2]\n  );\n  RectangleGeometryLibrary.computePosition(\n    computedOptions,\n    ellipsoid,\n    false,\n    height - 1,\n    width - 1,\n    positions[3]\n  );\n\n  return Rectangle.fromCartesianArray(positions, ellipsoid, result);\n}\n\n/**\n * A description of a cartographic rectangle on an ellipsoid centered at the origin. Rectangle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\n *\n * @alias RectangleGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {number} [options.height=0.0] The distance in meters between the rectangle and the ellipsoid surface.\n * @param {number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.\n * @param {number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\n * @param {number} [options.extrudedHeight] The distance in meters between the rectangle's extruded face and the ellipsoid surface.\n *\n * @exception {DeveloperError} <code>options.rectangle.north</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].\n * @exception {DeveloperError} <code>options.rectangle.south</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].\n * @exception {DeveloperError} <code>options.rectangle.east</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].\n * @exception {DeveloperError} <code>options.rectangle.west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].\n * @exception {DeveloperError} <code>options.rectangle.north</code> must be greater than <code>options.rectangle.south</code>.\n *\n * @see RectangleGeometry#createGeometry\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Rectangle.html|Cesium Sandcastle Rectangle Demo}\n *\n * @example\n * // 1. create a rectangle\n * const rectangle = new Cesium.RectangleGeometry({\n *   ellipsoid : Cesium.Ellipsoid.WGS84,\n *   rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),\n *   height : 10000.0\n * });\n * const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);\n *\n * // 2. create an extruded rectangle without a top\n * const rectangle = new Cesium.RectangleGeometry({\n *   ellipsoid : Cesium.Ellipsoid.WGS84,\n *   rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),\n *   height : 10000.0,\n *   extrudedHeight: 300000\n * });\n * const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);\n */\nfunction RectangleGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const rectangle = options.rectangle;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  Rectangle.validate(rectangle);\n  if (rectangle.north < rectangle.south) {\n    throw new DeveloperError(\n      \"options.rectangle.north must be greater than or equal to options.rectangle.south\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const height = defaultValue(options.height, 0.0);\n  const extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n  this._rectangle = Rectangle.clone(rectangle);\n  this._granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  this._ellipsoid = Ellipsoid.clone(\n    defaultValue(options.ellipsoid, Ellipsoid.WGS84)\n  );\n  this._surfaceHeight = Math.max(height, extrudedHeight);\n  this._rotation = defaultValue(options.rotation, 0.0);\n  this._stRotation = defaultValue(options.stRotation, 0.0);\n  this._vertexFormat = VertexFormat.clone(\n    defaultValue(options.vertexFormat, VertexFormat.DEFAULT)\n  );\n  this._extrudedHeight = Math.min(height, extrudedHeight);\n  this._shadowVolume = defaultValue(options.shadowVolume, false);\n  this._workerName = \"createRectangleGeometry\";\n  this._offsetAttribute = options.offsetAttribute;\n  this._rotatedRectangle = undefined;\n\n  this._textureCoordinateRotationPoints = undefined;\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nRectangleGeometry.packedLength =\n  Rectangle.packedLength +\n  Ellipsoid.packedLength +\n  VertexFormat.packedLength +\n  7;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {RectangleGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nRectangleGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  Rectangle.pack(value._rectangle, array, startingIndex);\n  startingIndex += Rectangle.packedLength;\n\n  Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  VertexFormat.pack(value._vertexFormat, array, startingIndex);\n  startingIndex += VertexFormat.packedLength;\n\n  array[startingIndex++] = value._granularity;\n  array[startingIndex++] = value._surfaceHeight;\n  array[startingIndex++] = value._rotation;\n  array[startingIndex++] = value._stRotation;\n  array[startingIndex++] = value._extrudedHeight;\n  array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;\n  array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n  return array;\n};\n\nconst scratchRectangle = new Rectangle();\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchOptions = {\n  rectangle: scratchRectangle,\n  ellipsoid: scratchEllipsoid,\n  vertexFormat: scratchVertexFormat,\n  granularity: undefined,\n  height: undefined,\n  rotation: undefined,\n  stRotation: undefined,\n  extrudedHeight: undefined,\n  shadowVolume: undefined,\n  offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {RectangleGeometry} [result] The object into which to store the result.\n * @returns {RectangleGeometry} The modified result parameter or a new RectangleGeometry instance if one was not provided.\n */\nRectangleGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const rectangle = Rectangle.unpack(array, startingIndex, scratchRectangle);\n  startingIndex += Rectangle.packedLength;\n\n  const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n  startingIndex += Ellipsoid.packedLength;\n\n  const vertexFormat = VertexFormat.unpack(\n    array,\n    startingIndex,\n    scratchVertexFormat\n  );\n  startingIndex += VertexFormat.packedLength;\n\n  const granularity = array[startingIndex++];\n  const surfaceHeight = array[startingIndex++];\n  const rotation = array[startingIndex++];\n  const stRotation = array[startingIndex++];\n  const extrudedHeight = array[startingIndex++];\n  const shadowVolume = array[startingIndex++] === 1.0;\n  const offsetAttribute = array[startingIndex];\n\n  if (!defined(result)) {\n    scratchOptions.granularity = granularity;\n    scratchOptions.height = surfaceHeight;\n    scratchOptions.rotation = rotation;\n    scratchOptions.stRotation = stRotation;\n    scratchOptions.extrudedHeight = extrudedHeight;\n    scratchOptions.shadowVolume = shadowVolume;\n    scratchOptions.offsetAttribute =\n      offsetAttribute === -1 ? undefined : offsetAttribute;\n\n    return new RectangleGeometry(scratchOptions);\n  }\n\n  result._rectangle = Rectangle.clone(rectangle, result._rectangle);\n  result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n  result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n  result._granularity = granularity;\n  result._surfaceHeight = surfaceHeight;\n  result._rotation = rotation;\n  result._stRotation = stRotation;\n  result._extrudedHeight = extrudedHeight;\n  result._shadowVolume = shadowVolume;\n  result._offsetAttribute =\n    offsetAttribute === -1 ? undefined : offsetAttribute;\n\n  return result;\n};\n\n/**\n * Computes the bounding rectangle based on the provided options\n *\n * @param {object} options Object with the following properties:\n * @param {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.\n * @param {Rectangle} [result] An object in which to store the result.\n *\n * @returns {Rectangle} The result rectangle\n */\nRectangleGeometry.computeRectangle = function (options, result) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const rectangle = options.rectangle;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  Rectangle.validate(rectangle);\n  if (rectangle.north < rectangle.south) {\n    throw new DeveloperError(\n      \"options.rectangle.north must be greater than or equal to options.rectangle.south\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  const rotation = defaultValue(options.rotation, 0.0);\n\n  return computeRectangle(rectangle, granularity, rotation, ellipsoid, result);\n};\n\nconst tangentRotationMatrixScratch = new Matrix3();\nconst quaternionScratch = new Quaternion();\nconst centerScratch = new Cartographic();\n/**\n * Computes the geometric representation of a rectangle, including its vertices, indices, and a bounding sphere.\n *\n * @param {RectangleGeometry} rectangleGeometry A description of the rectangle.\n * @returns {Geometry|undefined} The computed vertices and indices.\n *\n * @exception {DeveloperError} Rotated rectangle is invalid.\n */\nRectangleGeometry.createGeometry = function (rectangleGeometry) {\n  if (\n    CesiumMath.equalsEpsilon(\n      rectangleGeometry._rectangle.north,\n      rectangleGeometry._rectangle.south,\n      CesiumMath.EPSILON10\n    ) ||\n    CesiumMath.equalsEpsilon(\n      rectangleGeometry._rectangle.east,\n      rectangleGeometry._rectangle.west,\n      CesiumMath.EPSILON10\n    )\n  ) {\n    return undefined;\n  }\n\n  let rectangle = rectangleGeometry._rectangle;\n  const ellipsoid = rectangleGeometry._ellipsoid;\n  const rotation = rectangleGeometry._rotation;\n  const stRotation = rectangleGeometry._stRotation;\n  const vertexFormat = rectangleGeometry._vertexFormat;\n\n  const computedOptions = RectangleGeometryLibrary.computeOptions(\n    rectangle,\n    rectangleGeometry._granularity,\n    rotation,\n    stRotation,\n    rectangleScratch,\n    nwScratch,\n    stNwScratch\n  );\n\n  const tangentRotationMatrix = tangentRotationMatrixScratch;\n  if (stRotation !== 0 || rotation !== 0) {\n    const center = Rectangle.center(rectangle, centerScratch);\n    const axis = ellipsoid.geodeticSurfaceNormalCartographic(center, v1Scratch);\n    Quaternion.fromAxisAngle(axis, -stRotation, quaternionScratch);\n    Matrix3.fromQuaternion(quaternionScratch, tangentRotationMatrix);\n  } else {\n    Matrix3.clone(Matrix3.IDENTITY, tangentRotationMatrix);\n  }\n\n  const surfaceHeight = rectangleGeometry._surfaceHeight;\n  const extrudedHeight = rectangleGeometry._extrudedHeight;\n  const extrude = !CesiumMath.equalsEpsilon(\n    surfaceHeight,\n    extrudedHeight,\n    0,\n    CesiumMath.EPSILON2\n  );\n\n  computedOptions.lonScalar = 1.0 / rectangleGeometry._rectangle.width;\n  computedOptions.latScalar = 1.0 / rectangleGeometry._rectangle.height;\n  computedOptions.tangentRotationMatrix = tangentRotationMatrix;\n\n  let geometry;\n  let boundingSphere;\n  rectangle = rectangleGeometry._rectangle;\n  if (extrude) {\n    geometry = constructExtrudedRectangle(rectangleGeometry, computedOptions);\n    const topBS = BoundingSphere.fromRectangle3D(\n      rectangle,\n      ellipsoid,\n      surfaceHeight,\n      topBoundingSphere\n    );\n    const bottomBS = BoundingSphere.fromRectangle3D(\n      rectangle,\n      ellipsoid,\n      extrudedHeight,\n      bottomBoundingSphere\n    );\n    boundingSphere = BoundingSphere.union(topBS, bottomBS);\n  } else {\n    geometry = constructRectangle(rectangleGeometry, computedOptions);\n    geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n      geometry.attributes.position.values,\n      surfaceHeight,\n      ellipsoid,\n      false\n    );\n\n    if (defined(rectangleGeometry._offsetAttribute)) {\n      const length = geometry.attributes.position.values.length;\n      const offsetValue =\n        rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n          ? 0\n          : 1;\n      const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n      geometry.attributes.applyOffset = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n        componentsPerAttribute: 1,\n        values: applyOffset,\n      });\n    }\n\n    boundingSphere = BoundingSphere.fromRectangle3D(\n      rectangle,\n      ellipsoid,\n      surfaceHeight\n    );\n  }\n\n  if (!vertexFormat.position) {\n    delete geometry.attributes.position;\n  }\n\n  return new Geometry({\n    attributes: geometry.attributes,\n    indices: geometry.indices,\n    primitiveType: geometry.primitiveType,\n    boundingSphere: boundingSphere,\n    offsetAttribute: rectangleGeometry._offsetAttribute,\n  });\n};\n\n/**\n * @private\n */\nRectangleGeometry.createShadowVolume = function (\n  rectangleGeometry,\n  minHeightFunc,\n  maxHeightFunc\n) {\n  const granularity = rectangleGeometry._granularity;\n  const ellipsoid = rectangleGeometry._ellipsoid;\n\n  const minHeight = minHeightFunc(granularity, ellipsoid);\n  const maxHeight = maxHeightFunc(granularity, ellipsoid);\n\n  return new RectangleGeometry({\n    rectangle: rectangleGeometry._rectangle,\n    rotation: rectangleGeometry._rotation,\n    ellipsoid: ellipsoid,\n    stRotation: rectangleGeometry._stRotation,\n    granularity: granularity,\n    extrudedHeight: maxHeight,\n    height: minHeight,\n    vertexFormat: VertexFormat.POSITION_ONLY,\n    shadowVolume: true,\n  });\n};\n\nconst unrotatedTextureRectangleScratch = new Rectangle();\nconst points2DScratch = [new Cartesian2(), new Cartesian2(), new Cartesian2()];\nconst rotation2DScratch = new Matrix2();\nconst rectangleCenterScratch = new Cartographic();\n\nfunction textureCoordinateRotationPoints(rectangleGeometry) {\n  if (rectangleGeometry._stRotation === 0.0) {\n    return [0, 0, 0, 1, 1, 0];\n  }\n\n  const rectangle = Rectangle.clone(\n    rectangleGeometry._rectangle,\n    unrotatedTextureRectangleScratch\n  );\n  const granularity = rectangleGeometry._granularity;\n  const ellipsoid = rectangleGeometry._ellipsoid;\n\n  // Rotate to align the texture coordinates with ENU\n  const rotation = rectangleGeometry._rotation - rectangleGeometry._stRotation;\n\n  const unrotatedTextureRectangle = computeRectangle(\n    rectangle,\n    granularity,\n    rotation,\n    ellipsoid,\n    unrotatedTextureRectangleScratch\n  );\n\n  // Assume a computed \"east-north\" texture coordinate system based on spherical or planar tricks, bounded by `boundingRectangle`.\n  // The \"desired\" texture coordinate system forms an oriented rectangle (un-oriented computed) around the geometry that completely and tightly bounds it.\n  // We want to map from the \"east-north\" texture coordinate system into the \"desired\" system using a pair of lines (analagous planes in 2D)\n  // Compute 3 corners of the \"desired\" texture coordinate system in \"east-north\" texture space by the following in cartographic space:\n  // - rotate 3 of the corners in unrotatedTextureRectangle by stRotation around the center of the bounding rectangle\n  // - apply the \"east-north\" system's normalization formula to the rotated cartographics, even though this is likely to produce values outside [0-1].\n  // This gives us a set of points in the \"east-north\" texture coordinate system that can be used to map \"east-north\" texture coordinates to \"desired.\"\n\n  const points2D = points2DScratch;\n  points2D[0].x = unrotatedTextureRectangle.west;\n  points2D[0].y = unrotatedTextureRectangle.south;\n\n  points2D[1].x = unrotatedTextureRectangle.west;\n  points2D[1].y = unrotatedTextureRectangle.north;\n\n  points2D[2].x = unrotatedTextureRectangle.east;\n  points2D[2].y = unrotatedTextureRectangle.south;\n\n  const boundingRectangle = rectangleGeometry.rectangle;\n  const toDesiredInComputed = Matrix2.fromRotation(\n    rectangleGeometry._stRotation,\n    rotation2DScratch\n  );\n  const boundingRectangleCenter = Rectangle.center(\n    boundingRectangle,\n    rectangleCenterScratch\n  );\n\n  for (let i = 0; i < 3; ++i) {\n    const point2D = points2D[i];\n    point2D.x -= boundingRectangleCenter.longitude;\n    point2D.y -= boundingRectangleCenter.latitude;\n    Matrix2.multiplyByVector(toDesiredInComputed, point2D, point2D);\n    point2D.x += boundingRectangleCenter.longitude;\n    point2D.y += boundingRectangleCenter.latitude;\n\n    // Convert point into east-north texture coordinate space\n    point2D.x = (point2D.x - boundingRectangle.west) / boundingRectangle.width;\n    point2D.y =\n      (point2D.y - boundingRectangle.south) / boundingRectangle.height;\n  }\n\n  const minXYCorner = points2D[0];\n  const maxYCorner = points2D[1];\n  const maxXCorner = points2D[2];\n  const result = new Array(6);\n  Cartesian2.pack(minXYCorner, result);\n  Cartesian2.pack(maxYCorner, result, 2);\n  Cartesian2.pack(maxXCorner, result, 4);\n  return result;\n}\n\nObject.defineProperties(RectangleGeometry.prototype, {\n  /**\n   * @private\n   */\n  rectangle: {\n    get: function () {\n      if (!defined(this._rotatedRectangle)) {\n        this._rotatedRectangle = computeRectangle(\n          this._rectangle,\n          this._granularity,\n          this._rotation,\n          this._ellipsoid\n        );\n      }\n      return this._rotatedRectangle;\n    },\n  },\n  /**\n   * For remapping texture coordinates when rendering RectangleGeometries as GroundPrimitives.\n   * This version permits skew in textures by computing offsets directly in cartographic space and\n   * more accurately approximates rendering RectangleGeometries with height as standard Primitives.\n   * @see Geometry#_textureCoordinateRotationPoints\n   * @private\n   */\n  textureCoordinateRotationPoints: {\n    get: function () {\n      if (!defined(this._textureCoordinateRotationPoints)) {\n        this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(\n          this\n        );\n      }\n      return this._textureCoordinateRotationPoints;\n    },\n  },\n});\nexport default RectangleGeometry;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport RectangleGeometry from \"../Core/RectangleGeometry.js\";\nimport RectangleOutlineGeometry from \"../Core/RectangleOutlineGeometry.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport GroundGeometryUpdater from \"./GroundGeometryUpdater.js\";\nimport Property from \"./Property.js\";\n\nconst scratchColor = new Color();\nconst defaultOffset = Cartesian3.ZERO;\nconst offsetScratch = new Cartesian3();\nconst scratchRectangle = new Rectangle();\nconst scratchCenterRect = new Rectangle();\nconst scratchCarto = new Cartographic();\n\nfunction RectangleGeometryOptions(entity) {\n  this.id = entity;\n  this.vertexFormat = undefined;\n  this.rectangle = undefined;\n  this.height = undefined;\n  this.extrudedHeight = undefined;\n  this.granularity = undefined;\n  this.stRotation = undefined;\n  this.rotation = undefined;\n  this.offsetAttribute = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for rectangles.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias RectangleGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction RectangleGeometryUpdater(entity, scene) {\n  GroundGeometryUpdater.call(this, {\n    entity: entity,\n    scene: scene,\n    geometryOptions: new RectangleGeometryOptions(entity),\n    geometryPropertyName: \"rectangle\",\n    observedPropertyNames: [\"availability\", \"rectangle\"],\n  });\n\n  this._onEntityPropertyChanged(\n    entity,\n    \"rectangle\",\n    entity.rectangle,\n    undefined\n  );\n}\n\nif (defined(Object.create)) {\n  RectangleGeometryUpdater.prototype = Object.create(\n    GroundGeometryUpdater.prototype\n  );\n  RectangleGeometryUpdater.prototype.constructor = RectangleGeometryUpdater;\n}\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nRectangleGeometryUpdater.prototype.createFillGeometryInstance = function (\n  time\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._fillEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent a filled geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n\n  const attributes = {\n    show: new ShowGeometryInstanceAttribute(\n      isAvailable &&\n        entity.isShowing &&\n        this._showProperty.getValue(time) &&\n        this._fillProperty.getValue(time)\n    ),\n    distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n      this._distanceDisplayConditionProperty.getValue(time)\n    ),\n    offset: undefined,\n    color: undefined,\n  };\n\n  if (this._materialProperty instanceof ColorMaterialProperty) {\n    let currentColor;\n    if (\n      defined(this._materialProperty.color) &&\n      (this._materialProperty.color.isConstant || isAvailable)\n    ) {\n      currentColor = this._materialProperty.color.getValue(time, scratchColor);\n    }\n    if (!defined(currentColor)) {\n      currentColor = Color.WHITE;\n    }\n    attributes.color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n  }\n  if (defined(this._options.offsetAttribute)) {\n    attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n      Property.getValueOrDefault(\n        this._terrainOffsetProperty,\n        time,\n        defaultOffset,\n        offsetScratch\n      )\n    );\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new RectangleGeometry(this._options),\n    attributes: attributes,\n  });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nRectangleGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n  time\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._outlineEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent an outlined geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n  const outlineColor = Property.getValueOrDefault(\n    this._outlineColorProperty,\n    time,\n    Color.BLACK,\n    scratchColor\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n\n  const attributes = {\n    show: new ShowGeometryInstanceAttribute(\n      isAvailable &&\n        entity.isShowing &&\n        this._showProperty.getValue(time) &&\n        this._showOutlineProperty.getValue(time)\n    ),\n    color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n    distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n      distanceDisplayCondition\n    ),\n    offset: undefined,\n  };\n\n  if (defined(this._options.offsetAttribute)) {\n    attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n      Property.getValueOrDefault(\n        this._terrainOffsetProperty,\n        time,\n        defaultOffset,\n        offsetScratch\n      )\n    );\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new RectangleOutlineGeometry(this._options),\n    attributes: attributes,\n  });\n};\n\nRectangleGeometryUpdater.prototype._computeCenter = function (time, result) {\n  const rect = Property.getValueOrUndefined(\n    this._entity.rectangle.coordinates,\n    time,\n    scratchCenterRect\n  );\n  if (!defined(rect)) {\n    return;\n  }\n  const center = Rectangle.center(rect, scratchCarto);\n  return Cartographic.toCartesian(center, Ellipsoid.WGS84, result);\n};\n\nRectangleGeometryUpdater.prototype._isHidden = function (entity, rectangle) {\n  return (\n    !defined(rectangle.coordinates) ||\n    GeometryUpdater.prototype._isHidden.call(this, entity, rectangle)\n  );\n};\n\nRectangleGeometryUpdater.prototype._isDynamic = function (entity, rectangle) {\n  return (\n    !rectangle.coordinates.isConstant || //\n    !Property.isConstant(rectangle.height) || //\n    !Property.isConstant(rectangle.extrudedHeight) || //\n    !Property.isConstant(rectangle.granularity) || //\n    !Property.isConstant(rectangle.stRotation) || //\n    !Property.isConstant(rectangle.rotation) || //\n    !Property.isConstant(rectangle.outlineWidth) || //\n    !Property.isConstant(rectangle.zIndex) || //\n    (this._onTerrain &&\n      !Property.isConstant(this._materialProperty) &&\n      !(this._materialProperty instanceof ColorMaterialProperty))\n  );\n};\n\nRectangleGeometryUpdater.prototype._setStaticOptions = function (\n  entity,\n  rectangle\n) {\n  const isColorMaterial =\n    this._materialProperty instanceof ColorMaterialProperty;\n\n  let heightValue = Property.getValueOrUndefined(\n    rectangle.height,\n    Iso8601.MINIMUM_VALUE\n  );\n  const heightReferenceValue = Property.getValueOrDefault(\n    rectangle.heightReference,\n    Iso8601.MINIMUM_VALUE,\n    HeightReference.NONE\n  );\n  let extrudedHeightValue = Property.getValueOrUndefined(\n    rectangle.extrudedHeight,\n    Iso8601.MINIMUM_VALUE\n  );\n  const extrudedHeightReferenceValue = Property.getValueOrDefault(\n    rectangle.extrudedHeightReference,\n    Iso8601.MINIMUM_VALUE,\n    HeightReference.NONE\n  );\n  if (defined(extrudedHeightValue) && !defined(heightValue)) {\n    heightValue = 0;\n  }\n\n  const options = this._options;\n  options.vertexFormat = isColorMaterial\n    ? PerInstanceColorAppearance.VERTEX_FORMAT\n    : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n  options.rectangle = rectangle.coordinates.getValue(\n    Iso8601.MINIMUM_VALUE,\n    options.rectangle\n  );\n  options.granularity = Property.getValueOrUndefined(\n    rectangle.granularity,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.stRotation = Property.getValueOrUndefined(\n    rectangle.stRotation,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.rotation = Property.getValueOrUndefined(\n    rectangle.rotation,\n    Iso8601.MINIMUM_VALUE\n  );\n  options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n    heightValue,\n    heightReferenceValue,\n    extrudedHeightValue,\n    extrudedHeightReferenceValue\n  );\n  options.height = GroundGeometryUpdater.getGeometryHeight(\n    heightValue,\n    heightReferenceValue\n  );\n\n  extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n    extrudedHeightValue,\n    extrudedHeightReferenceValue\n  );\n  if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n    extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n      RectangleGeometry.computeRectangle(options, scratchRectangle)\n    ).minimumTerrainHeight;\n  }\n\n  options.extrudedHeight = extrudedHeightValue;\n};\n\nRectangleGeometryUpdater.DynamicGeometryUpdater = DynamicRectangleGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicRectangleGeometryUpdater(\n  geometryUpdater,\n  primitives,\n  groundPrimitives\n) {\n  DynamicGeometryUpdater.call(\n    this,\n    geometryUpdater,\n    primitives,\n    groundPrimitives\n  );\n}\n\nif (defined(Object.create)) {\n  DynamicRectangleGeometryUpdater.prototype = Object.create(\n    DynamicGeometryUpdater.prototype\n  );\n  DynamicRectangleGeometryUpdater.prototype.constructor = DynamicRectangleGeometryUpdater;\n}\n\nDynamicRectangleGeometryUpdater.prototype._isHidden = function (\n  entity,\n  rectangle,\n  time\n) {\n  return (\n    !defined(this._options.rectangle) ||\n    DynamicGeometryUpdater.prototype._isHidden.call(\n      this,\n      entity,\n      rectangle,\n      time\n    )\n  );\n};\n\nDynamicRectangleGeometryUpdater.prototype._setOptions = function (\n  entity,\n  rectangle,\n  time\n) {\n  const options = this._options;\n  let heightValue = Property.getValueOrUndefined(rectangle.height, time);\n  const heightReferenceValue = Property.getValueOrDefault(\n    rectangle.heightReference,\n    time,\n    HeightReference.NONE\n  );\n  let extrudedHeightValue = Property.getValueOrUndefined(\n    rectangle.extrudedHeight,\n    time\n  );\n  const extrudedHeightReferenceValue = Property.getValueOrDefault(\n    rectangle.extrudedHeightReference,\n    time,\n    HeightReference.NONE\n  );\n  if (defined(extrudedHeightValue) && !defined(heightValue)) {\n    heightValue = 0;\n  }\n\n  options.rectangle = Property.getValueOrUndefined(\n    rectangle.coordinates,\n    time,\n    options.rectangle\n  );\n  options.granularity = Property.getValueOrUndefined(\n    rectangle.granularity,\n    time\n  );\n  options.stRotation = Property.getValueOrUndefined(rectangle.stRotation, time);\n  options.rotation = Property.getValueOrUndefined(rectangle.rotation, time);\n  options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n    heightValue,\n    heightReferenceValue,\n    extrudedHeightValue,\n    extrudedHeightReferenceValue\n  );\n  options.height = GroundGeometryUpdater.getGeometryHeight(\n    heightValue,\n    heightReferenceValue\n  );\n\n  extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n    extrudedHeightValue,\n    extrudedHeightReferenceValue\n  );\n  if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n    extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n      RectangleGeometry.computeRectangle(options, scratchRectangle)\n    ).minimumTerrainHeight;\n  }\n\n  options.extrudedHeight = extrudedHeightValue;\n};\nexport default RectangleGeometryUpdater;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport Primitive from \"../Scene/Primitive.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\n\nconst colorScratch = new Color();\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\nconst defaultDistanceDisplayCondition = new DistanceDisplayCondition();\nconst defaultOffset = Cartesian3.ZERO;\nconst offsetScratch = new Cartesian3();\n\nfunction Batch(\n  primitives,\n  translucent,\n  appearanceType,\n  depthFailAppearanceType,\n  depthFailMaterialProperty,\n  closed,\n  shadows\n) {\n  this.translucent = translucent;\n  this.appearanceType = appearanceType;\n  this.depthFailAppearanceType = depthFailAppearanceType;\n  this.depthFailMaterialProperty = depthFailMaterialProperty;\n  this.depthFailMaterial = undefined;\n  this.closed = closed;\n  this.shadows = shadows;\n  this.primitives = primitives;\n  this.createPrimitive = false;\n  this.waitingOnCreate = false;\n  this.primitive = undefined;\n  this.oldPrimitive = undefined;\n  this.geometry = new AssociativeArray();\n  this.updaters = new AssociativeArray();\n  this.updatersWithAttributes = new AssociativeArray();\n  this.attributes = new AssociativeArray();\n  this.subscriptions = new AssociativeArray();\n  this.showsUpdated = new AssociativeArray();\n  this.itemsToRemove = [];\n  this.invalidated = false;\n\n  let removeMaterialSubscription;\n  if (defined(depthFailMaterialProperty)) {\n    removeMaterialSubscription = depthFailMaterialProperty.definitionChanged.addEventListener(\n      Batch.prototype.onMaterialChanged,\n      this\n    );\n  }\n  this.removeMaterialSubscription = removeMaterialSubscription;\n}\n\nBatch.prototype.onMaterialChanged = function () {\n  this.invalidated = true;\n};\n\nBatch.prototype.isMaterial = function (updater) {\n  const material = this.depthFailMaterialProperty;\n  const updaterMaterial = updater.depthFailMaterialProperty;\n  if (updaterMaterial === material) {\n    return true;\n  }\n  if (defined(material)) {\n    return material.equals(updaterMaterial);\n  }\n  return false;\n};\n\nBatch.prototype.add = function (updater, instance) {\n  const id = updater.id;\n  this.createPrimitive = true;\n  this.geometry.set(id, instance);\n  this.updaters.set(id, updater);\n  if (\n    !updater.hasConstantFill ||\n    !updater.fillMaterialProperty.isConstant ||\n    !Property.isConstant(updater.distanceDisplayConditionProperty) ||\n    !Property.isConstant(updater.terrainOffsetProperty)\n  ) {\n    this.updatersWithAttributes.set(id, updater);\n  } else {\n    const that = this;\n    this.subscriptions.set(\n      id,\n      updater.entity.definitionChanged.addEventListener(function (\n        entity,\n        propertyName,\n        newValue,\n        oldValue\n      ) {\n        if (propertyName === \"isShowing\") {\n          that.showsUpdated.set(updater.id, updater);\n        }\n      })\n    );\n  }\n};\n\nBatch.prototype.remove = function (updater) {\n  const id = updater.id;\n  this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;\n  if (this.updaters.remove(id)) {\n    this.updatersWithAttributes.remove(id);\n    const unsubscribe = this.subscriptions.get(id);\n    if (defined(unsubscribe)) {\n      unsubscribe();\n      this.subscriptions.remove(id);\n      this.showsUpdated.remove(id);\n    }\n    return true;\n  }\n  return false;\n};\n\nBatch.prototype.update = function (time) {\n  let isUpdated = true;\n  let removedCount = 0;\n  let primitive = this.primitive;\n  const primitives = this.primitives;\n  let i;\n\n  if (this.createPrimitive) {\n    const geometries = this.geometry.values;\n    const geometriesLength = geometries.length;\n    if (geometriesLength > 0) {\n      if (defined(primitive)) {\n        if (!defined(this.oldPrimitive)) {\n          this.oldPrimitive = primitive;\n        } else {\n          primitives.remove(primitive);\n        }\n      }\n\n      let depthFailAppearance;\n      if (defined(this.depthFailAppearanceType)) {\n        if (defined(this.depthFailMaterialProperty)) {\n          this.depthFailMaterial = MaterialProperty.getValue(\n            time,\n            this.depthFailMaterialProperty,\n            this.depthFailMaterial\n          );\n        }\n        depthFailAppearance = new this.depthFailAppearanceType({\n          material: this.depthFailMaterial,\n          translucent: this.translucent,\n          closed: this.closed,\n        });\n      }\n\n      primitive = new Primitive({\n        show: false,\n        asynchronous: true,\n        geometryInstances: geometries.slice(),\n        appearance: new this.appearanceType({\n          translucent: this.translucent,\n          closed: this.closed,\n        }),\n        depthFailAppearance: depthFailAppearance,\n        shadows: this.shadows,\n      });\n      primitives.add(primitive);\n      isUpdated = false;\n    } else {\n      if (defined(primitive)) {\n        primitives.remove(primitive);\n        primitive = undefined;\n      }\n      const oldPrimitive = this.oldPrimitive;\n      if (defined(oldPrimitive)) {\n        primitives.remove(oldPrimitive);\n        this.oldPrimitive = undefined;\n      }\n    }\n\n    this.attributes.removeAll();\n    this.primitive = primitive;\n    this.createPrimitive = false;\n    this.waitingOnCreate = true;\n  } else if (defined(primitive) && primitive.ready) {\n    primitive.show = true;\n    if (defined(this.oldPrimitive)) {\n      primitives.remove(this.oldPrimitive);\n      this.oldPrimitive = undefined;\n    }\n\n    if (\n      defined(this.depthFailAppearanceType) &&\n      !(this.depthFailMaterialProperty instanceof ColorMaterialProperty)\n    ) {\n      this.depthFailMaterial = MaterialProperty.getValue(\n        time,\n        this.depthFailMaterialProperty,\n        this.depthFailMaterial\n      );\n      this.primitive.depthFailAppearance.material = this.depthFailMaterial;\n    }\n\n    const updatersWithAttributes = this.updatersWithAttributes.values;\n    const length = updatersWithAttributes.length;\n    const waitingOnCreate = this.waitingOnCreate;\n    for (i = 0; i < length; i++) {\n      const updater = updatersWithAttributes[i];\n      const instance = this.geometry.get(updater.id);\n\n      let attributes = this.attributes.get(instance.id.id);\n      if (!defined(attributes)) {\n        attributes = primitive.getGeometryInstanceAttributes(instance.id);\n        this.attributes.set(instance.id.id, attributes);\n      }\n\n      if (!updater.fillMaterialProperty.isConstant || waitingOnCreate) {\n        const colorProperty = updater.fillMaterialProperty.color;\n        const resultColor = Property.getValueOrDefault(\n          colorProperty,\n          time,\n          Color.WHITE,\n          colorScratch\n        );\n        if (!Color.equals(attributes._lastColor, resultColor)) {\n          attributes._lastColor = Color.clone(\n            resultColor,\n            attributes._lastColor\n          );\n          attributes.color = ColorGeometryInstanceAttribute.toValue(\n            resultColor,\n            attributes.color\n          );\n          if (\n            (this.translucent && attributes.color[3] === 255) ||\n            (!this.translucent && attributes.color[3] !== 255)\n          ) {\n            this.itemsToRemove[removedCount++] = updater;\n          }\n        }\n      }\n\n      if (\n        defined(this.depthFailAppearanceType) &&\n        updater.depthFailMaterialProperty instanceof ColorMaterialProperty &&\n        (!updater.depthFailMaterialProperty.isConstant || waitingOnCreate)\n      ) {\n        const depthFailColorProperty = updater.depthFailMaterialProperty.color;\n        const depthColor = Property.getValueOrDefault(\n          depthFailColorProperty,\n          time,\n          Color.WHITE,\n          colorScratch\n        );\n        if (!Color.equals(attributes._lastDepthFailColor, depthColor)) {\n          attributes._lastDepthFailColor = Color.clone(\n            depthColor,\n            attributes._lastDepthFailColor\n          );\n          attributes.depthFailColor = ColorGeometryInstanceAttribute.toValue(\n            depthColor,\n            attributes.depthFailColor\n          );\n        }\n      }\n\n      const show =\n        updater.entity.isShowing &&\n        (updater.hasConstantFill || updater.isFilled(time));\n      const currentShow = attributes.show[0] === 1;\n      if (show !== currentShow) {\n        attributes.show = ShowGeometryInstanceAttribute.toValue(\n          show,\n          attributes.show\n        );\n      }\n\n      const distanceDisplayConditionProperty =\n        updater.distanceDisplayConditionProperty;\n      if (!Property.isConstant(distanceDisplayConditionProperty)) {\n        const distanceDisplayCondition = Property.getValueOrDefault(\n          distanceDisplayConditionProperty,\n          time,\n          defaultDistanceDisplayCondition,\n          distanceDisplayConditionScratch\n        );\n        if (\n          !DistanceDisplayCondition.equals(\n            distanceDisplayCondition,\n            attributes._lastDistanceDisplayCondition\n          )\n        ) {\n          attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone(\n            distanceDisplayCondition,\n            attributes._lastDistanceDisplayCondition\n          );\n          attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n            distanceDisplayCondition,\n            attributes.distanceDisplayCondition\n          );\n        }\n      }\n\n      const offsetProperty = updater.terrainOffsetProperty;\n      if (!Property.isConstant(offsetProperty)) {\n        const offset = Property.getValueOrDefault(\n          offsetProperty,\n          time,\n          defaultOffset,\n          offsetScratch\n        );\n        if (!Cartesian3.equals(offset, attributes._lastOffset)) {\n          attributes._lastOffset = Cartesian3.clone(\n            offset,\n            attributes._lastOffset\n          );\n          attributes.offset = OffsetGeometryInstanceAttribute.toValue(\n            offset,\n            attributes.offset\n          );\n        }\n      }\n    }\n\n    this.updateShows(primitive);\n    this.waitingOnCreate = false;\n  } else if (defined(primitive) && !primitive.ready) {\n    isUpdated = false;\n  }\n  this.itemsToRemove.length = removedCount;\n  return isUpdated;\n};\n\nBatch.prototype.updateShows = function (primitive) {\n  const showsUpdated = this.showsUpdated.values;\n  const length = showsUpdated.length;\n  for (let i = 0; i < length; i++) {\n    const updater = showsUpdated[i];\n    const instance = this.geometry.get(updater.id);\n\n    let attributes = this.attributes.get(instance.id.id);\n    if (!defined(attributes)) {\n      attributes = primitive.getGeometryInstanceAttributes(instance.id);\n      this.attributes.set(instance.id.id, attributes);\n    }\n\n    const show = updater.entity.isShowing;\n    const currentShow = attributes.show[0] === 1;\n    if (show !== currentShow) {\n      attributes.show = ShowGeometryInstanceAttribute.toValue(\n        show,\n        attributes.show\n      );\n      instance.attributes.show.value[0] = attributes.show[0];\n    }\n  }\n  this.showsUpdated.removeAll();\n};\n\nBatch.prototype.contains = function (updater) {\n  return this.updaters.contains(updater.id);\n};\n\nBatch.prototype.getBoundingSphere = function (updater, result) {\n  const primitive = this.primitive;\n  if (!primitive.ready) {\n    return BoundingSphereState.PENDING;\n  }\n  const attributes = primitive.getGeometryInstanceAttributes(updater.entity);\n  if (\n    !defined(attributes) ||\n    !defined(attributes.boundingSphere) || //\n    (defined(attributes.show) && attributes.show[0] === 0)\n  ) {\n    return BoundingSphereState.FAILED;\n  }\n  attributes.boundingSphere.clone(result);\n  return BoundingSphereState.DONE;\n};\n\nBatch.prototype.destroy = function () {\n  const primitive = this.primitive;\n  const primitives = this.primitives;\n  if (defined(primitive)) {\n    primitives.remove(primitive);\n  }\n  const oldPrimitive = this.oldPrimitive;\n  if (defined(oldPrimitive)) {\n    primitives.remove(oldPrimitive);\n  }\n  if (defined(this.removeMaterialSubscription)) {\n    this.removeMaterialSubscription();\n  }\n};\n\n/**\n * @private\n */\nfunction StaticGeometryColorBatch(\n  primitives,\n  appearanceType,\n  depthFailAppearanceType,\n  closed,\n  shadows\n) {\n  this._solidItems = [];\n  this._translucentItems = [];\n  this._primitives = primitives;\n  this._appearanceType = appearanceType;\n  this._depthFailAppearanceType = depthFailAppearanceType;\n  this._closed = closed;\n  this._shadows = shadows;\n}\n\nStaticGeometryColorBatch.prototype.add = function (time, updater) {\n  let items;\n  let translucent;\n  const instance = updater.createFillGeometryInstance(time);\n  if (instance.attributes.color.value[3] === 255) {\n    items = this._solidItems;\n    translucent = false;\n  } else {\n    items = this._translucentItems;\n    translucent = true;\n  }\n\n  const length = items.length;\n  for (let i = 0; i < length; i++) {\n    const item = items[i];\n    if (item.isMaterial(updater)) {\n      item.add(updater, instance);\n      return;\n    }\n  }\n  const batch = new Batch(\n    this._primitives,\n    translucent,\n    this._appearanceType,\n    this._depthFailAppearanceType,\n    updater.depthFailMaterialProperty,\n    this._closed,\n    this._shadows\n  );\n  batch.add(updater, instance);\n  items.push(batch);\n};\n\nfunction removeItem(items, updater) {\n  const length = items.length;\n  for (let i = length - 1; i >= 0; i--) {\n    const item = items[i];\n    if (item.remove(updater)) {\n      if (item.updaters.length === 0) {\n        items.splice(i, 1);\n        item.destroy();\n      }\n      return true;\n    }\n  }\n  return false;\n}\n\nStaticGeometryColorBatch.prototype.remove = function (updater) {\n  if (!removeItem(this._solidItems, updater)) {\n    removeItem(this._translucentItems, updater);\n  }\n};\n\nfunction moveItems(batch, items, time) {\n  let itemsMoved = false;\n  const length = items.length;\n  for (let i = 0; i < length; ++i) {\n    const item = items[i];\n    const itemsToRemove = item.itemsToRemove;\n    const itemsToMoveLength = itemsToRemove.length;\n    if (itemsToMoveLength > 0) {\n      for (i = 0; i < itemsToMoveLength; i++) {\n        const updater = itemsToRemove[i];\n        item.remove(updater);\n        batch.add(time, updater);\n        itemsMoved = true;\n      }\n    }\n  }\n  return itemsMoved;\n}\n\nfunction updateItems(batch, items, time, isUpdated) {\n  let length = items.length;\n  let i;\n  for (i = length - 1; i >= 0; i--) {\n    const item = items[i];\n    if (item.invalidated) {\n      items.splice(i, 1);\n      const updaters = item.updaters.values;\n      const updatersLength = updaters.length;\n      for (let h = 0; h < updatersLength; h++) {\n        batch.add(time, updaters[h]);\n      }\n      item.destroy();\n    }\n  }\n\n  length = items.length;\n  for (i = 0; i < length; ++i) {\n    isUpdated = items[i].update(time) && isUpdated;\n  }\n  return isUpdated;\n}\n\nStaticGeometryColorBatch.prototype.update = function (time) {\n  //Perform initial update\n  let isUpdated = updateItems(this, this._solidItems, time, true);\n  isUpdated =\n    updateItems(this, this._translucentItems, time, isUpdated) && isUpdated;\n\n  //If any items swapped between solid/translucent, we need to\n  //move them between batches\n  const solidsMoved = moveItems(this, this._solidItems, time);\n  const translucentsMoved = moveItems(this, this._translucentItems, time);\n\n  //If we moved anything around, we need to re-build the primitive\n  if (solidsMoved || translucentsMoved) {\n    isUpdated =\n      updateItems(this, this._solidItems, time, isUpdated) && isUpdated;\n    isUpdated =\n      updateItems(this, this._translucentItems, time, isUpdated) && isUpdated;\n  }\n\n  return isUpdated;\n};\n\nfunction getBoundingSphere(items, updater, result) {\n  const length = items.length;\n  for (let i = 0; i < length; i++) {\n    const item = items[i];\n    if (item.contains(updater)) {\n      return item.getBoundingSphere(updater, result);\n    }\n  }\n  return BoundingSphereState.FAILED;\n}\n\nStaticGeometryColorBatch.prototype.getBoundingSphere = function (\n  updater,\n  result\n) {\n  const boundingSphere = getBoundingSphere(this._solidItems, updater, result);\n  if (boundingSphere === BoundingSphereState.FAILED) {\n    return getBoundingSphere(this._translucentItems, updater, result);\n  }\n  return boundingSphere;\n};\n\nfunction removeAllPrimitives(items) {\n  const length = items.length;\n  for (let i = 0; i < length; i++) {\n    items[i].destroy();\n  }\n  items.length = 0;\n}\n\nStaticGeometryColorBatch.prototype.removeAllPrimitives = function () {\n  removeAllPrimitives(this._solidItems);\n  removeAllPrimitives(this._translucentItems);\n};\nexport default StaticGeometryColorBatch;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport Primitive from \"../Scene/Primitive.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\n\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\nconst defaultDistanceDisplayCondition = new DistanceDisplayCondition();\nconst defaultOffset = Cartesian3.ZERO;\nconst offsetScratch = new Cartesian3();\n\nfunction Batch(\n  primitives,\n  appearanceType,\n  materialProperty,\n  depthFailAppearanceType,\n  depthFailMaterialProperty,\n  closed,\n  shadows\n) {\n  this.primitives = primitives;\n  this.appearanceType = appearanceType;\n  this.materialProperty = materialProperty;\n  this.depthFailAppearanceType = depthFailAppearanceType;\n  this.depthFailMaterialProperty = depthFailMaterialProperty;\n  this.closed = closed;\n  this.shadows = shadows;\n  this.updaters = new AssociativeArray();\n  this.createPrimitive = true;\n  this.primitive = undefined;\n  this.oldPrimitive = undefined;\n  this.geometry = new AssociativeArray();\n  this.material = undefined;\n  this.depthFailMaterial = undefined;\n  this.updatersWithAttributes = new AssociativeArray();\n  this.attributes = new AssociativeArray();\n  this.invalidated = false;\n  this.removeMaterialSubscription = materialProperty.definitionChanged.addEventListener(\n    Batch.prototype.onMaterialChanged,\n    this\n  );\n  this.subscriptions = new AssociativeArray();\n  this.showsUpdated = new AssociativeArray();\n}\n\nBatch.prototype.onMaterialChanged = function () {\n  this.invalidated = true;\n};\n\nBatch.prototype.isMaterial = function (updater) {\n  const material = this.materialProperty;\n  const updaterMaterial = updater.fillMaterialProperty;\n  const depthFailMaterial = this.depthFailMaterialProperty;\n  const updaterDepthFailMaterial = updater.depthFailMaterialProperty;\n\n  if (\n    updaterMaterial === material &&\n    updaterDepthFailMaterial === depthFailMaterial\n  ) {\n    return true;\n  }\n  let equals = defined(material) && material.equals(updaterMaterial);\n  equals =\n    ((!defined(depthFailMaterial) && !defined(updaterDepthFailMaterial)) ||\n      (defined(depthFailMaterial) &&\n        depthFailMaterial.equals(updaterDepthFailMaterial))) &&\n    equals;\n  return equals;\n};\n\nBatch.prototype.add = function (time, updater) {\n  const id = updater.id;\n  this.updaters.set(id, updater);\n  this.geometry.set(id, updater.createFillGeometryInstance(time));\n  if (\n    !updater.hasConstantFill ||\n    !updater.fillMaterialProperty.isConstant ||\n    !Property.isConstant(updater.distanceDisplayConditionProperty) ||\n    !Property.isConstant(updater.terrainOffsetProperty)\n  ) {\n    this.updatersWithAttributes.set(id, updater);\n  } else {\n    const that = this;\n    this.subscriptions.set(\n      id,\n      updater.entity.definitionChanged.addEventListener(function (\n        entity,\n        propertyName,\n        newValue,\n        oldValue\n      ) {\n        if (propertyName === \"isShowing\") {\n          that.showsUpdated.set(updater.id, updater);\n        }\n      })\n    );\n  }\n  this.createPrimitive = true;\n};\n\nBatch.prototype.remove = function (updater) {\n  const id = updater.id;\n  this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;\n  if (this.updaters.remove(id)) {\n    this.updatersWithAttributes.remove(id);\n    const unsubscribe = this.subscriptions.get(id);\n    if (defined(unsubscribe)) {\n      unsubscribe();\n      this.subscriptions.remove(id);\n      this.showsUpdated.remove(id);\n    }\n    return true;\n  }\n  return false;\n};\n\nconst colorScratch = new Color();\n\nBatch.prototype.update = function (time) {\n  let isUpdated = true;\n  let primitive = this.primitive;\n  const primitives = this.primitives;\n  const geometries = this.geometry.values;\n  let i;\n\n  if (this.createPrimitive) {\n    const geometriesLength = geometries.length;\n    if (geometriesLength > 0) {\n      if (defined(primitive)) {\n        if (!defined(this.oldPrimitive)) {\n          this.oldPrimitive = primitive;\n        } else {\n          primitives.remove(primitive);\n        }\n      }\n\n      this.material = MaterialProperty.getValue(\n        time,\n        this.materialProperty,\n        this.material\n      );\n\n      let depthFailAppearance;\n      if (defined(this.depthFailMaterialProperty)) {\n        this.depthFailMaterial = MaterialProperty.getValue(\n          time,\n          this.depthFailMaterialProperty,\n          this.depthFailMaterial\n        );\n        depthFailAppearance = new this.depthFailAppearanceType({\n          material: this.depthFailMaterial,\n          translucent: this.depthFailMaterial.isTranslucent(),\n          closed: this.closed,\n        });\n      }\n\n      primitive = new Primitive({\n        show: false,\n        asynchronous: true,\n        geometryInstances: geometries.slice(),\n        appearance: new this.appearanceType({\n          material: this.material,\n          translucent: this.material.isTranslucent(),\n          closed: this.closed,\n        }),\n        depthFailAppearance: depthFailAppearance,\n        shadows: this.shadows,\n      });\n\n      primitives.add(primitive);\n      isUpdated = false;\n    } else {\n      if (defined(primitive)) {\n        primitives.remove(primitive);\n        primitive = undefined;\n      }\n      const oldPrimitive = this.oldPrimitive;\n      if (defined(oldPrimitive)) {\n        primitives.remove(oldPrimitive);\n        this.oldPrimitive = undefined;\n      }\n    }\n\n    this.attributes.removeAll();\n    this.primitive = primitive;\n    this.createPrimitive = false;\n  } else if (defined(primitive) && primitive.ready) {\n    primitive.show = true;\n    if (defined(this.oldPrimitive)) {\n      primitives.remove(this.oldPrimitive);\n      this.oldPrimitive = undefined;\n    }\n\n    this.material = MaterialProperty.getValue(\n      time,\n      this.materialProperty,\n      this.material\n    );\n    this.primitive.appearance.material = this.material;\n\n    if (\n      defined(this.depthFailAppearanceType) &&\n      !(this.depthFailMaterialProperty instanceof ColorMaterialProperty)\n    ) {\n      this.depthFailMaterial = MaterialProperty.getValue(\n        time,\n        this.depthFailMaterialProperty,\n        this.depthFailMaterial\n      );\n      this.primitive.depthFailAppearance.material = this.depthFailMaterial;\n    }\n\n    const updatersWithAttributes = this.updatersWithAttributes.values;\n    const length = updatersWithAttributes.length;\n    for (i = 0; i < length; i++) {\n      const updater = updatersWithAttributes[i];\n      const entity = updater.entity;\n      const instance = this.geometry.get(updater.id);\n\n      let attributes = this.attributes.get(instance.id.id);\n      if (!defined(attributes)) {\n        attributes = primitive.getGeometryInstanceAttributes(instance.id);\n        this.attributes.set(instance.id.id, attributes);\n      }\n\n      if (\n        defined(this.depthFailAppearanceType) &&\n        this.depthFailMaterialProperty instanceof ColorMaterialProperty &&\n        !updater.depthFailMaterialProperty.isConstant\n      ) {\n        const depthFailColorProperty = updater.depthFailMaterialProperty.color;\n        const depthFailColor = Property.getValueOrDefault(\n          depthFailColorProperty,\n          time,\n          Color.WHITE,\n          colorScratch\n        );\n        if (!Color.equals(attributes._lastDepthFailColor, depthFailColor)) {\n          attributes._lastDepthFailColor = Color.clone(\n            depthFailColor,\n            attributes._lastDepthFailColor\n          );\n          attributes.depthFailColor = ColorGeometryInstanceAttribute.toValue(\n            depthFailColor,\n            attributes.depthFailColor\n          );\n        }\n      }\n\n      const show =\n        entity.isShowing && (updater.hasConstantFill || updater.isFilled(time));\n      const currentShow = attributes.show[0] === 1;\n      if (show !== currentShow) {\n        attributes.show = ShowGeometryInstanceAttribute.toValue(\n          show,\n          attributes.show\n        );\n      }\n\n      const distanceDisplayConditionProperty =\n        updater.distanceDisplayConditionProperty;\n      if (!Property.isConstant(distanceDisplayConditionProperty)) {\n        const distanceDisplayCondition = Property.getValueOrDefault(\n          distanceDisplayConditionProperty,\n          time,\n          defaultDistanceDisplayCondition,\n          distanceDisplayConditionScratch\n        );\n        if (\n          !DistanceDisplayCondition.equals(\n            distanceDisplayCondition,\n            attributes._lastDistanceDisplayCondition\n          )\n        ) {\n          attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone(\n            distanceDisplayCondition,\n            attributes._lastDistanceDisplayCondition\n          );\n          attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n            distanceDisplayCondition,\n            attributes.distanceDisplayCondition\n          );\n        }\n      }\n\n      const offsetProperty = updater.terrainOffsetProperty;\n      if (!Property.isConstant(offsetProperty)) {\n        const offset = Property.getValueOrDefault(\n          offsetProperty,\n          time,\n          defaultOffset,\n          offsetScratch\n        );\n        if (!Cartesian3.equals(offset, attributes._lastOffset)) {\n          attributes._lastOffset = Cartesian3.clone(\n            offset,\n            attributes._lastOffset\n          );\n          attributes.offset = OffsetGeometryInstanceAttribute.toValue(\n            offset,\n            attributes.offset\n          );\n        }\n      }\n    }\n\n    this.updateShows(primitive);\n  } else if (defined(primitive) && !primitive.ready) {\n    isUpdated = false;\n  }\n  return isUpdated;\n};\n\nBatch.prototype.updateShows = function (primitive) {\n  const showsUpdated = this.showsUpdated.values;\n  const length = showsUpdated.length;\n  for (let i = 0; i < length; i++) {\n    const updater = showsUpdated[i];\n    const entity = updater.entity;\n    const instance = this.geometry.get(updater.id);\n\n    let attributes = this.attributes.get(instance.id.id);\n    if (!defined(attributes)) {\n      attributes = primitive.getGeometryInstanceAttributes(instance.id);\n      this.attributes.set(instance.id.id, attributes);\n    }\n\n    const show = entity.isShowing;\n    const currentShow = attributes.show[0] === 1;\n    if (show !== currentShow) {\n      attributes.show = ShowGeometryInstanceAttribute.toValue(\n        show,\n        attributes.show\n      );\n      instance.attributes.show.value[0] = attributes.show[0];\n    }\n  }\n  this.showsUpdated.removeAll();\n};\n\nBatch.prototype.contains = function (updater) {\n  return this.updaters.contains(updater.id);\n};\n\nBatch.prototype.getBoundingSphere = function (updater, result) {\n  const primitive = this.primitive;\n  if (!primitive.ready) {\n    return BoundingSphereState.PENDING;\n  }\n  const attributes = primitive.getGeometryInstanceAttributes(updater.entity);\n  if (\n    !defined(attributes) ||\n    !defined(attributes.boundingSphere) ||\n    (defined(attributes.show) && attributes.show[0] === 0)\n  ) {\n    return BoundingSphereState.FAILED;\n  }\n  attributes.boundingSphere.clone(result);\n  return BoundingSphereState.DONE;\n};\n\nBatch.prototype.destroy = function () {\n  const primitive = this.primitive;\n  const primitives = this.primitives;\n  if (defined(primitive)) {\n    primitives.remove(primitive);\n  }\n  const oldPrimitive = this.oldPrimitive;\n  if (defined(oldPrimitive)) {\n    primitives.remove(oldPrimitive);\n  }\n  this.removeMaterialSubscription();\n};\n\n/**\n * @private\n */\nfunction StaticGeometryPerMaterialBatch(\n  primitives,\n  appearanceType,\n  depthFailAppearanceType,\n  closed,\n  shadows\n) {\n  this._items = [];\n  this._primitives = primitives;\n  this._appearanceType = appearanceType;\n  this._depthFailAppearanceType = depthFailAppearanceType;\n  this._closed = closed;\n  this._shadows = shadows;\n}\n\nStaticGeometryPerMaterialBatch.prototype.add = function (time, updater) {\n  const items = this._items;\n  const length = items.length;\n  for (let i = 0; i < length; i++) {\n    const item = items[i];\n    if (item.isMaterial(updater)) {\n      item.add(time, updater);\n      return;\n    }\n  }\n  const batch = new Batch(\n    this._primitives,\n    this._appearanceType,\n    updater.fillMaterialProperty,\n    this._depthFailAppearanceType,\n    updater.depthFailMaterialProperty,\n    this._closed,\n    this._shadows\n  );\n  batch.add(time, updater);\n  items.push(batch);\n};\n\nStaticGeometryPerMaterialBatch.prototype.remove = function (updater) {\n  const items = this._items;\n  const length = items.length;\n  for (let i = length - 1; i >= 0; i--) {\n    const item = items[i];\n    if (item.remove(updater)) {\n      if (item.updaters.length === 0) {\n        items.splice(i, 1);\n        item.destroy();\n      }\n      break;\n    }\n  }\n};\n\nStaticGeometryPerMaterialBatch.prototype.update = function (time) {\n  let i;\n  const items = this._items;\n  const length = items.length;\n\n  for (i = length - 1; i >= 0; i--) {\n    const item = items[i];\n    if (item.invalidated) {\n      items.splice(i, 1);\n      const updaters = item.updaters.values;\n      const updatersLength = updaters.length;\n      for (let h = 0; h < updatersLength; h++) {\n        this.add(time, updaters[h]);\n      }\n      item.destroy();\n    }\n  }\n\n  let isUpdated = true;\n  for (i = 0; i < items.length; i++) {\n    isUpdated = items[i].update(time) && isUpdated;\n  }\n  return isUpdated;\n};\n\nStaticGeometryPerMaterialBatch.prototype.getBoundingSphere = function (\n  updater,\n  result\n) {\n  const items = this._items;\n  const length = items.length;\n  for (let i = 0; i < length; i++) {\n    const item = items[i];\n    if (item.contains(updater)) {\n      return item.getBoundingSphere(updater, result);\n    }\n  }\n  return BoundingSphereState.FAILED;\n};\n\nStaticGeometryPerMaterialBatch.prototype.removeAllPrimitives = function () {\n  const items = this._items;\n  const length = items.length;\n  for (let i = 0; i < length; i++) {\n    items[i].destroy();\n  }\n  this._items.length = 0;\n};\nexport default StaticGeometryPerMaterialBatch;\n", "import RBush from \"rbush\";\nimport Check from \"./Check.js\";\n\n/**\n * Wrapper around rbush for use with Rectangle types.\n * @private\n */\nfunction RectangleCollisionChecker() {\n  this._tree = new RBush();\n}\n\nfunction RectangleWithId() {\n  this.minX = 0.0;\n  this.minY = 0.0;\n  this.maxX = 0.0;\n  this.maxY = 0.0;\n  this.id = \"\";\n}\n\nRectangleWithId.fromRectangleAndId = function (id, rectangle, result) {\n  result.minX = rectangle.west;\n  result.minY = rectangle.south;\n  result.maxX = rectangle.east;\n  result.maxY = rectangle.north;\n  result.id = id;\n  return result;\n};\n\n/**\n * Insert a rectangle into the collision checker.\n *\n * @param {string} id Unique string ID for the rectangle being inserted.\n * @param {Rectangle} rectangle A Rectangle\n * @private\n */\nRectangleCollisionChecker.prototype.insert = function (id, rectangle) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"id\", id);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  //>>includeEnd('debug');\n\n  const withId = RectangleWithId.fromRectangleAndId(\n    id,\n    rectangle,\n    new RectangleWithId()\n  );\n  this._tree.insert(withId);\n};\n\nfunction idCompare(a, b) {\n  return a.id === b.id;\n}\n\nconst removalScratch = new RectangleWithId();\n/**\n * Remove a rectangle from the collision checker.\n *\n * @param {string} id Unique string ID for the rectangle being removed.\n * @param {Rectangle} rectangle A Rectangle\n * @private\n */\nRectangleCollisionChecker.prototype.remove = function (id, rectangle) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"id\", id);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  //>>includeEnd('debug');\n\n  const withId = RectangleWithId.fromRectangleAndId(\n    id,\n    rectangle,\n    removalScratch\n  );\n  this._tree.remove(withId, idCompare);\n};\n\nconst collisionScratch = new RectangleWithId();\n/**\n * Checks if a given rectangle collides with any of the rectangles in the collection.\n *\n * @param {Rectangle} rectangle A Rectangle that should be checked against the rectangles in the collision checker.\n * @returns {boolean} Whether the rectangle collides with any of the rectangles in the collision checker.\n */\nRectangleCollisionChecker.prototype.collides = function (rectangle) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"rectangle\", rectangle);\n  //>>includeEnd('debug');\n\n  const withId = RectangleWithId.fromRectangleAndId(\n    \"\",\n    rectangle,\n    collisionScratch\n  );\n  return this._tree.collides(withId);\n};\nexport default RectangleCollisionChecker;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport GroundPrimitive from \"../Scene/GroundPrimitive.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport Property from \"./Property.js\";\nimport RectangleCollisionChecker from \"../Core/RectangleCollisionChecker.js\";\n\nconst colorScratch = new Color();\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\nconst defaultDistanceDisplayCondition = new DistanceDisplayCondition();\n\nfunction Batch(primitives, classificationType, color, zIndex) {\n  this.primitives = primitives;\n  this.zIndex = zIndex;\n  this.classificationType = classificationType;\n  this.color = color;\n  this.createPrimitive = false;\n  this.waitingOnCreate = false;\n  this.primitive = undefined;\n  this.oldPrimitive = undefined;\n  this.geometry = new AssociativeArray();\n  this.updaters = new AssociativeArray();\n  this.updatersWithAttributes = new AssociativeArray();\n  this.attributes = new AssociativeArray();\n  this.subscriptions = new AssociativeArray();\n  this.showsUpdated = new AssociativeArray();\n  this.itemsToRemove = [];\n  this.isDirty = false;\n  this.rectangleCollisionCheck = new RectangleCollisionChecker();\n}\n\nBatch.prototype.overlapping = function (rectangle) {\n  return this.rectangleCollisionCheck.collides(rectangle);\n};\n\nBatch.prototype.add = function (updater, instance) {\n  const id = updater.id;\n  this.createPrimitive = true;\n  this.geometry.set(id, instance);\n  this.updaters.set(id, updater);\n  this.rectangleCollisionCheck.insert(id, instance.geometry.rectangle);\n  if (\n    !updater.hasConstantFill ||\n    !updater.fillMaterialProperty.isConstant ||\n    !Property.isConstant(updater.distanceDisplayConditionProperty)\n  ) {\n    this.updatersWithAttributes.set(id, updater);\n  } else {\n    const that = this;\n    this.subscriptions.set(\n      id,\n      updater.entity.definitionChanged.addEventListener(function (\n        entity,\n        propertyName,\n        newValue,\n        oldValue\n      ) {\n        if (propertyName === \"isShowing\") {\n          that.showsUpdated.set(updater.id, updater);\n        }\n      })\n    );\n  }\n};\n\nBatch.prototype.remove = function (updater) {\n  const id = updater.id;\n  const geometryInstance = this.geometry.get(id);\n  this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;\n  if (this.updaters.remove(id)) {\n    this.rectangleCollisionCheck.remove(\n      id,\n      geometryInstance.geometry.rectangle\n    );\n    this.updatersWithAttributes.remove(id);\n    const unsubscribe = this.subscriptions.get(id);\n    if (defined(unsubscribe)) {\n      unsubscribe();\n      this.subscriptions.remove(id);\n      this.showsUpdated.remove(id);\n    }\n    return true;\n  }\n  return false;\n};\n\nBatch.prototype.update = function (time) {\n  let isUpdated = true;\n  const removedCount = 0;\n  let primitive = this.primitive;\n  const primitives = this.primitives;\n  let i;\n\n  if (this.createPrimitive) {\n    const geometries = this.geometry.values;\n    const geometriesLength = geometries.length;\n    if (geometriesLength > 0) {\n      if (defined(primitive)) {\n        if (!defined(this.oldPrimitive)) {\n          this.oldPrimitive = primitive;\n        } else {\n          primitives.remove(primitive);\n        }\n      }\n\n      primitive = new GroundPrimitive({\n        show: false,\n        asynchronous: true,\n        geometryInstances: geometries.slice(),\n        classificationType: this.classificationType,\n      });\n      primitives.add(primitive, this.zIndex);\n      isUpdated = false;\n    } else {\n      if (defined(primitive)) {\n        primitives.remove(primitive);\n        primitive = undefined;\n      }\n      const oldPrimitive = this.oldPrimitive;\n      if (defined(oldPrimitive)) {\n        primitives.remove(oldPrimitive);\n        this.oldPrimitive = undefined;\n      }\n    }\n\n    this.attributes.removeAll();\n    this.primitive = primitive;\n    this.createPrimitive = false;\n    this.waitingOnCreate = true;\n  } else if (defined(primitive) && primitive.ready) {\n    primitive.show = true;\n    if (defined(this.oldPrimitive)) {\n      primitives.remove(this.oldPrimitive);\n      this.oldPrimitive = undefined;\n    }\n    const updatersWithAttributes = this.updatersWithAttributes.values;\n    const length = updatersWithAttributes.length;\n    const waitingOnCreate = this.waitingOnCreate;\n    for (i = 0; i < length; i++) {\n      const updater = updatersWithAttributes[i];\n      const instance = this.geometry.get(updater.id);\n\n      let attributes = this.attributes.get(instance.id.id);\n      if (!defined(attributes)) {\n        attributes = primitive.getGeometryInstanceAttributes(instance.id);\n        this.attributes.set(instance.id.id, attributes);\n      }\n\n      if (!updater.fillMaterialProperty.isConstant || waitingOnCreate) {\n        const colorProperty = updater.fillMaterialProperty.color;\n        const fillColor = Property.getValueOrDefault(\n          colorProperty,\n          time,\n          Color.WHITE,\n          colorScratch\n        );\n\n        if (!Color.equals(attributes._lastColor, fillColor)) {\n          attributes._lastColor = Color.clone(fillColor, attributes._lastColor);\n          attributes.color = ColorGeometryInstanceAttribute.toValue(\n            fillColor,\n            attributes.color\n          );\n        }\n      }\n\n      const show =\n        updater.entity.isShowing &&\n        (updater.hasConstantFill || updater.isFilled(time));\n      const currentShow = attributes.show[0] === 1;\n      if (show !== currentShow) {\n        attributes.show = ShowGeometryInstanceAttribute.toValue(\n          show,\n          attributes.show\n        );\n      }\n\n      const distanceDisplayConditionProperty =\n        updater.distanceDisplayConditionProperty;\n      if (!Property.isConstant(distanceDisplayConditionProperty)) {\n        const distanceDisplayCondition = Property.getValueOrDefault(\n          distanceDisplayConditionProperty,\n          time,\n          defaultDistanceDisplayCondition,\n          distanceDisplayConditionScratch\n        );\n        if (\n          !DistanceDisplayCondition.equals(\n            distanceDisplayCondition,\n            attributes._lastDistanceDisplayCondition\n          )\n        ) {\n          attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone(\n            distanceDisplayCondition,\n            attributes._lastDistanceDisplayCondition\n          );\n          attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n            distanceDisplayCondition,\n            attributes.distanceDisplayCondition\n          );\n        }\n      }\n    }\n\n    this.updateShows(primitive);\n    this.waitingOnCreate = false;\n  } else if (defined(primitive) && !primitive.ready) {\n    isUpdated = false;\n  }\n  this.itemsToRemove.length = removedCount;\n  return isUpdated;\n};\n\nBatch.prototype.updateShows = function (primitive) {\n  const showsUpdated = this.showsUpdated.values;\n  const length = showsUpdated.length;\n  for (let i = 0; i < length; i++) {\n    const updater = showsUpdated[i];\n    const instance = this.geometry.get(updater.id);\n\n    let attributes = this.attributes.get(instance.id.id);\n    if (!defined(attributes)) {\n      attributes = primitive.getGeometryInstanceAttributes(instance.id);\n      this.attributes.set(instance.id.id, attributes);\n    }\n\n    const show = updater.entity.isShowing;\n    const currentShow = attributes.show[0] === 1;\n    if (show !== currentShow) {\n      attributes.show = ShowGeometryInstanceAttribute.toValue(\n        show,\n        attributes.show\n      );\n      instance.attributes.show.value[0] = attributes.show[0];\n    }\n  }\n  this.showsUpdated.removeAll();\n};\n\nBatch.prototype.contains = function (updater) {\n  return this.updaters.contains(updater.id);\n};\n\nBatch.prototype.getBoundingSphere = function (updater, result) {\n  const primitive = this.primitive;\n  if (!primitive.ready) {\n    return BoundingSphereState.PENDING;\n  }\n\n  const bs = primitive.getBoundingSphere(updater.entity);\n  if (!defined(bs)) {\n    return BoundingSphereState.FAILED;\n  }\n\n  bs.clone(result);\n  return BoundingSphereState.DONE;\n};\n\nBatch.prototype.removeAllPrimitives = function () {\n  const primitives = this.primitives;\n\n  const primitive = this.primitive;\n  if (defined(primitive)) {\n    primitives.remove(primitive);\n    this.primitive = undefined;\n    this.geometry.removeAll();\n    this.updaters.removeAll();\n  }\n\n  const oldPrimitive = this.oldPrimitive;\n  if (defined(oldPrimitive)) {\n    primitives.remove(oldPrimitive);\n    this.oldPrimitive = undefined;\n  }\n};\n\n/**\n * @private\n */\nfunction StaticGroundGeometryColorBatch(primitives, classificationType) {\n  this._batches = [];\n  this._primitives = primitives;\n  this._classificationType = classificationType;\n}\n\nStaticGroundGeometryColorBatch.prototype.add = function (time, updater) {\n  const instance = updater.createFillGeometryInstance(time);\n  const batches = this._batches;\n  const zIndex = Property.getValueOrDefault(updater.zIndex, 0);\n  let batch;\n  const length = batches.length;\n  for (let i = 0; i < length; ++i) {\n    const item = batches[i];\n    if (\n      item.zIndex === zIndex &&\n      !item.overlapping(instance.geometry.rectangle)\n    ) {\n      batch = item;\n      break;\n    }\n  }\n\n  if (!defined(batch)) {\n    batch = new Batch(\n      this._primitives,\n      this._classificationType,\n      instance.attributes.color.value,\n      zIndex\n    );\n    batches.push(batch);\n  }\n  batch.add(updater, instance);\n  return batch;\n};\n\nStaticGroundGeometryColorBatch.prototype.remove = function (updater) {\n  const batches = this._batches;\n  const count = batches.length;\n  for (let i = 0; i < count; ++i) {\n    if (batches[i].remove(updater)) {\n      return;\n    }\n  }\n};\n\nStaticGroundGeometryColorBatch.prototype.update = function (time) {\n  let i;\n  let updater;\n\n  //Perform initial update\n  let isUpdated = true;\n  const batches = this._batches;\n  const batchCount = batches.length;\n  for (i = 0; i < batchCount; ++i) {\n    isUpdated = batches[i].update(time) && isUpdated;\n  }\n\n  //If any items swapped between batches we need to move them\n  for (i = 0; i < batchCount; ++i) {\n    const oldBatch = batches[i];\n    const itemsToRemove = oldBatch.itemsToRemove;\n    const itemsToMoveLength = itemsToRemove.length;\n    for (let j = 0; j < itemsToMoveLength; j++) {\n      updater = itemsToRemove[j];\n      oldBatch.remove(updater);\n      const newBatch = this.add(time, updater);\n      oldBatch.isDirty = true;\n      newBatch.isDirty = true;\n    }\n  }\n\n  //If we moved anything around, we need to re-build the primitive and remove empty batches\n  for (i = batchCount - 1; i >= 0; --i) {\n    const batch = batches[i];\n    if (batch.isDirty) {\n      isUpdated = batches[i].update(time) && isUpdated;\n      batch.isDirty = false;\n    }\n    if (batch.geometry.length === 0) {\n      batches.splice(i, 1);\n    }\n  }\n\n  return isUpdated;\n};\n\nStaticGroundGeometryColorBatch.prototype.getBoundingSphere = function (\n  updater,\n  result\n) {\n  const batches = this._batches;\n  const batchCount = batches.length;\n  for (let i = 0; i < batchCount; ++i) {\n    const batch = batches[i];\n    if (batch.contains(updater)) {\n      return batch.getBoundingSphere(updater, result);\n    }\n  }\n\n  return BoundingSphereState.FAILED;\n};\n\nStaticGroundGeometryColorBatch.prototype.removeAllPrimitives = function () {\n  const batches = this._batches;\n  const batchCount = batches.length;\n  for (let i = 0; i < batchCount; ++i) {\n    batches[i].removeAllPrimitives();\n  }\n};\nexport default StaticGroundGeometryColorBatch;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport defined from \"../Core/defined.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport RectangleCollisionChecker from \"../Core/RectangleCollisionChecker.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport GroundPrimitive from \"../Scene/GroundPrimitive.js\";\nimport ShadowVolumeAppearance from \"../Scene/ShadowVolumeAppearance.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\n\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\nconst defaultDistanceDisplayCondition = new DistanceDisplayCondition();\n\n// Encapsulates a Primitive and all the entities that it represents.\nfunction Batch(\n  primitives,\n  classificationType,\n  appearanceType,\n  materialProperty,\n  usingSphericalTextureCoordinates,\n  zIndex\n) {\n  this.primitives = primitives; // scene level primitive collection\n  this.classificationType = classificationType;\n  this.appearanceType = appearanceType;\n  this.materialProperty = materialProperty;\n  this.updaters = new AssociativeArray();\n  this.createPrimitive = true;\n  this.primitive = undefined; // a GroundPrimitive encapsulating all the entities\n  this.oldPrimitive = undefined;\n  this.geometry = new AssociativeArray();\n  this.material = undefined;\n  this.updatersWithAttributes = new AssociativeArray();\n  this.attributes = new AssociativeArray();\n  this.invalidated = false;\n  this.removeMaterialSubscription = materialProperty.definitionChanged.addEventListener(\n    Batch.prototype.onMaterialChanged,\n    this\n  );\n  this.subscriptions = new AssociativeArray();\n  this.showsUpdated = new AssociativeArray();\n  this.usingSphericalTextureCoordinates = usingSphericalTextureCoordinates;\n  this.zIndex = zIndex;\n  this.rectangleCollisionCheck = new RectangleCollisionChecker();\n}\n\nBatch.prototype.onMaterialChanged = function () {\n  this.invalidated = true;\n};\n\nBatch.prototype.overlapping = function (rectangle) {\n  return this.rectangleCollisionCheck.collides(rectangle);\n};\n\n// Check if the given updater's material is compatible with this batch\nBatch.prototype.isMaterial = function (updater) {\n  const material = this.materialProperty;\n  const updaterMaterial = updater.fillMaterialProperty;\n\n  if (\n    updaterMaterial === material ||\n    (updaterMaterial instanceof ColorMaterialProperty &&\n      material instanceof ColorMaterialProperty)\n  ) {\n    return true;\n  }\n  return defined(material) && material.equals(updaterMaterial);\n};\n\nBatch.prototype.add = function (time, updater, geometryInstance) {\n  const id = updater.id;\n  this.updaters.set(id, updater);\n  this.geometry.set(id, geometryInstance);\n  this.rectangleCollisionCheck.insert(id, geometryInstance.geometry.rectangle);\n  // Updaters with dynamic attributes must be tracked separately, may exit the batch\n  if (\n    !updater.hasConstantFill ||\n    !updater.fillMaterialProperty.isConstant ||\n    !Property.isConstant(updater.distanceDisplayConditionProperty)\n  ) {\n    this.updatersWithAttributes.set(id, updater);\n  } else {\n    const that = this;\n    // Listen for show changes. These will be synchronized in updateShows.\n    this.subscriptions.set(\n      id,\n      updater.entity.definitionChanged.addEventListener(function (\n        entity,\n        propertyName,\n        newValue,\n        oldValue\n      ) {\n        if (propertyName === \"isShowing\") {\n          that.showsUpdated.set(updater.id, updater);\n        }\n      })\n    );\n  }\n  this.createPrimitive = true;\n};\n\nBatch.prototype.remove = function (updater) {\n  const id = updater.id;\n  const geometryInstance = this.geometry.get(id);\n  this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;\n  if (this.updaters.remove(id)) {\n    this.rectangleCollisionCheck.remove(\n      id,\n      geometryInstance.geometry.rectangle\n    );\n    this.updatersWithAttributes.remove(id);\n    const unsubscribe = this.subscriptions.get(id);\n    if (defined(unsubscribe)) {\n      unsubscribe();\n      this.subscriptions.remove(id);\n    }\n    return true;\n  }\n  return false;\n};\n\nBatch.prototype.update = function (time) {\n  let isUpdated = true;\n  let primitive = this.primitive;\n  const primitives = this.primitives;\n  const geometries = this.geometry.values;\n  let i;\n\n  if (this.createPrimitive) {\n    const geometriesLength = geometries.length;\n    if (geometriesLength > 0) {\n      if (defined(primitive)) {\n        // Keep a handle to the old primitive so it can be removed when the updated version is ready.\n        if (!defined(this.oldPrimitive)) {\n          this.oldPrimitive = primitive;\n        } else {\n          // For if the new primitive changes again before it is ready.\n          primitives.remove(primitive);\n        }\n      }\n\n      this.material = MaterialProperty.getValue(\n        time,\n        this.materialProperty,\n        this.material\n      );\n\n      primitive = new GroundPrimitive({\n        show: false,\n        asynchronous: true,\n        geometryInstances: geometries.slice(),\n        appearance: new this.appearanceType({\n          material: this.material,\n          // translucent and closed properties overridden\n        }),\n        classificationType: this.classificationType,\n      });\n\n      primitives.add(primitive, this.zIndex);\n      isUpdated = false;\n    } else {\n      if (defined(primitive)) {\n        primitives.remove(primitive);\n        primitive = undefined;\n      }\n      const oldPrimitive = this.oldPrimitive;\n      if (defined(oldPrimitive)) {\n        primitives.remove(oldPrimitive);\n        this.oldPrimitive = undefined;\n      }\n    }\n\n    this.attributes.removeAll();\n    this.primitive = primitive;\n    this.createPrimitive = false;\n  } else if (defined(primitive) && primitive.ready) {\n    primitive.show = true;\n    if (defined(this.oldPrimitive)) {\n      primitives.remove(this.oldPrimitive);\n      this.oldPrimitive = undefined;\n    }\n\n    this.material = MaterialProperty.getValue(\n      time,\n      this.materialProperty,\n      this.material\n    );\n    this.primitive.appearance.material = this.material;\n\n    const updatersWithAttributes = this.updatersWithAttributes.values;\n    const length = updatersWithAttributes.length;\n    for (i = 0; i < length; i++) {\n      const updater = updatersWithAttributes[i];\n      const entity = updater.entity;\n      const instance = this.geometry.get(updater.id);\n\n      let attributes = this.attributes.get(instance.id.id);\n      if (!defined(attributes)) {\n        attributes = primitive.getGeometryInstanceAttributes(instance.id);\n        this.attributes.set(instance.id.id, attributes);\n      }\n\n      const show =\n        entity.isShowing && (updater.hasConstantFill || updater.isFilled(time));\n      const currentShow = attributes.show[0] === 1;\n      if (show !== currentShow) {\n        attributes.show = ShowGeometryInstanceAttribute.toValue(\n          show,\n          attributes.show\n        );\n      }\n\n      const distanceDisplayConditionProperty =\n        updater.distanceDisplayConditionProperty;\n      if (!Property.isConstant(distanceDisplayConditionProperty)) {\n        const distanceDisplayCondition = Property.getValueOrDefault(\n          distanceDisplayConditionProperty,\n          time,\n          defaultDistanceDisplayCondition,\n          distanceDisplayConditionScratch\n        );\n        if (\n          !DistanceDisplayCondition.equals(\n            distanceDisplayCondition,\n            attributes._lastDistanceDisplayCondition\n          )\n        ) {\n          attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone(\n            distanceDisplayCondition,\n            attributes._lastDistanceDisplayCondition\n          );\n          attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n            distanceDisplayCondition,\n            attributes.distanceDisplayCondition\n          );\n        }\n      }\n    }\n\n    this.updateShows(primitive);\n  } else if (defined(primitive) && !primitive.ready) {\n    isUpdated = false;\n  }\n  return isUpdated;\n};\n\nBatch.prototype.updateShows = function (primitive) {\n  const showsUpdated = this.showsUpdated.values;\n  const length = showsUpdated.length;\n  for (let i = 0; i < length; i++) {\n    const updater = showsUpdated[i];\n    const entity = updater.entity;\n    const instance = this.geometry.get(updater.id);\n\n    let attributes = this.attributes.get(instance.id.id);\n    if (!defined(attributes)) {\n      attributes = primitive.getGeometryInstanceAttributes(instance.id);\n      this.attributes.set(instance.id.id, attributes);\n    }\n\n    const show = entity.isShowing;\n    const currentShow = attributes.show[0] === 1;\n    if (show !== currentShow) {\n      attributes.show = ShowGeometryInstanceAttribute.toValue(\n        show,\n        attributes.show\n      );\n      instance.attributes.show.value[0] = attributes.show[0];\n    }\n  }\n  this.showsUpdated.removeAll();\n};\n\nBatch.prototype.contains = function (updater) {\n  return this.updaters.contains(updater.id);\n};\n\nBatch.prototype.getBoundingSphere = function (updater, result) {\n  const primitive = this.primitive;\n  if (!primitive.ready) {\n    return BoundingSphereState.PENDING;\n  }\n  const attributes = primitive.getGeometryInstanceAttributes(updater.entity);\n  if (\n    !defined(attributes) ||\n    !defined(attributes.boundingSphere) ||\n    (defined(attributes.show) && attributes.show[0] === 0)\n  ) {\n    return BoundingSphereState.FAILED;\n  }\n  attributes.boundingSphere.clone(result);\n  return BoundingSphereState.DONE;\n};\n\nBatch.prototype.destroy = function () {\n  const primitive = this.primitive;\n  const primitives = this.primitives;\n  if (defined(primitive)) {\n    primitives.remove(primitive);\n  }\n  const oldPrimitive = this.oldPrimitive;\n  if (defined(oldPrimitive)) {\n    primitives.remove(oldPrimitive);\n  }\n  this.removeMaterialSubscription();\n};\n\n/**\n * @private\n */\nfunction StaticGroundGeometryPerMaterialBatch(\n  primitives,\n  classificationType,\n  appearanceType\n) {\n  this._items = [];\n  this._primitives = primitives;\n  this._classificationType = classificationType;\n  this._appearanceType = appearanceType;\n}\n\nStaticGroundGeometryPerMaterialBatch.prototype.add = function (time, updater) {\n  const items = this._items;\n  const length = items.length;\n  const geometryInstance = updater.createFillGeometryInstance(time);\n  const usingSphericalTextureCoordinates = ShadowVolumeAppearance.shouldUseSphericalCoordinates(\n    geometryInstance.geometry.rectangle\n  );\n  const zIndex = Property.getValueOrDefault(updater.zIndex, 0);\n  // Check if the Entity represented by the updater can be placed in an existing batch. Requirements:\n  // * compatible material (same material or same color)\n  // * same type of texture coordinates (spherical vs. planar)\n  // * conservatively non-overlapping with any entities in the existing batch\n  for (let i = 0; i < length; ++i) {\n    const item = items[i];\n    if (\n      item.isMaterial(updater) &&\n      item.usingSphericalTextureCoordinates ===\n        usingSphericalTextureCoordinates &&\n      item.zIndex === zIndex &&\n      !item.overlapping(geometryInstance.geometry.rectangle)\n    ) {\n      item.add(time, updater, geometryInstance);\n      return;\n    }\n  }\n  // If a compatible batch wasn't found, create a new batch.\n  const batch = new Batch(\n    this._primitives,\n    this._classificationType,\n    this._appearanceType,\n    updater.fillMaterialProperty,\n    usingSphericalTextureCoordinates,\n    zIndex\n  );\n  batch.add(time, updater, geometryInstance);\n  items.push(batch);\n};\n\nStaticGroundGeometryPerMaterialBatch.prototype.remove = function (updater) {\n  const items = this._items;\n  const length = items.length;\n  for (let i = length - 1; i >= 0; i--) {\n    const item = items[i];\n    if (item.remove(updater)) {\n      if (item.updaters.length === 0) {\n        items.splice(i, 1);\n        item.destroy();\n      }\n      break;\n    }\n  }\n};\n\nStaticGroundGeometryPerMaterialBatch.prototype.update = function (time) {\n  let i;\n  const items = this._items;\n  const length = items.length;\n\n  for (i = length - 1; i >= 0; i--) {\n    const item = items[i];\n    if (item.invalidated) {\n      items.splice(i, 1);\n      const updaters = item.updaters.values;\n      const updatersLength = updaters.length;\n      for (let h = 0; h < updatersLength; h++) {\n        this.add(time, updaters[h]);\n      }\n      item.destroy();\n    }\n  }\n\n  let isUpdated = true;\n  for (i = 0; i < items.length; i++) {\n    isUpdated = items[i].update(time) && isUpdated;\n  }\n  return isUpdated;\n};\n\nStaticGroundGeometryPerMaterialBatch.prototype.getBoundingSphere = function (\n  updater,\n  result\n) {\n  const items = this._items;\n  const length = items.length;\n  for (let i = 0; i < length; i++) {\n    const item = items[i];\n    if (item.contains(updater)) {\n      return item.getBoundingSphere(updater, result);\n    }\n  }\n  return BoundingSphereState.FAILED;\n};\n\nStaticGroundGeometryPerMaterialBatch.prototype.removeAllPrimitives = function () {\n  const items = this._items;\n  const length = items.length;\n  for (let i = 0; i < length; i++) {\n    items[i].destroy();\n  }\n  this._items.length = 0;\n};\nexport default StaticGroundGeometryPerMaterialBatch;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport Primitive from \"../Scene/Primitive.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport Property from \"./Property.js\";\n\nconst colorScratch = new Color();\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\nconst defaultDistanceDisplayCondition = new DistanceDisplayCondition();\nconst defaultOffset = Cartesian3.ZERO;\nconst offsetScratch = new Cartesian3();\n\nfunction Batch(primitives, translucent, width, shadows) {\n  this.translucent = translucent;\n  this.width = width;\n  this.shadows = shadows;\n  this.primitives = primitives;\n  this.createPrimitive = false;\n  this.waitingOnCreate = false;\n  this.primitive = undefined;\n  this.oldPrimitive = undefined;\n  this.geometry = new AssociativeArray();\n  this.updaters = new AssociativeArray();\n  this.updatersWithAttributes = new AssociativeArray();\n  this.attributes = new AssociativeArray();\n  this.itemsToRemove = [];\n  this.subscriptions = new AssociativeArray();\n  this.showsUpdated = new AssociativeArray();\n}\nBatch.prototype.add = function (updater, instance) {\n  const id = updater.id;\n  this.createPrimitive = true;\n  this.geometry.set(id, instance);\n  this.updaters.set(id, updater);\n  if (\n    !updater.hasConstantOutline ||\n    !updater.outlineColorProperty.isConstant ||\n    !Property.isConstant(updater.distanceDisplayConditionProperty) ||\n    !Property.isConstant(updater.terrainOffsetProperty)\n  ) {\n    this.updatersWithAttributes.set(id, updater);\n  } else {\n    const that = this;\n    this.subscriptions.set(\n      id,\n      updater.entity.definitionChanged.addEventListener(function (\n        entity,\n        propertyName,\n        newValue,\n        oldValue\n      ) {\n        if (propertyName === \"isShowing\") {\n          that.showsUpdated.set(updater.id, updater);\n        }\n      })\n    );\n  }\n};\n\nBatch.prototype.remove = function (updater) {\n  const id = updater.id;\n  this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;\n  if (this.updaters.remove(id)) {\n    this.updatersWithAttributes.remove(id);\n    const unsubscribe = this.subscriptions.get(id);\n    if (defined(unsubscribe)) {\n      unsubscribe();\n      this.subscriptions.remove(id);\n      this.showsUpdated.remove(id);\n    }\n    return true;\n  }\n  return false;\n};\n\nBatch.prototype.update = function (time) {\n  let isUpdated = true;\n  let removedCount = 0;\n  let primitive = this.primitive;\n  const primitives = this.primitives;\n  let i;\n\n  if (this.createPrimitive) {\n    const geometries = this.geometry.values;\n    const geometriesLength = geometries.length;\n    if (geometriesLength > 0) {\n      if (defined(primitive)) {\n        if (!defined(this.oldPrimitive)) {\n          this.oldPrimitive = primitive;\n        } else {\n          primitives.remove(primitive);\n        }\n      }\n\n      primitive = new Primitive({\n        show: false,\n        asynchronous: true,\n        geometryInstances: geometries.slice(),\n        appearance: new PerInstanceColorAppearance({\n          flat: true,\n          translucent: this.translucent,\n          renderState: {\n            lineWidth: this.width,\n          },\n        }),\n        shadows: this.shadows,\n      });\n\n      primitives.add(primitive);\n      isUpdated = false;\n    } else {\n      if (defined(primitive)) {\n        primitives.remove(primitive);\n        primitive = undefined;\n      }\n      const oldPrimitive = this.oldPrimitive;\n      if (defined(oldPrimitive)) {\n        primitives.remove(oldPrimitive);\n        this.oldPrimitive = undefined;\n      }\n    }\n\n    this.attributes.removeAll();\n    this.primitive = primitive;\n    this.createPrimitive = false;\n    this.waitingOnCreate = true;\n  } else if (defined(primitive) && primitive.ready) {\n    primitive.show = true;\n    if (defined(this.oldPrimitive)) {\n      primitives.remove(this.oldPrimitive);\n      this.oldPrimitive = undefined;\n    }\n\n    const updatersWithAttributes = this.updatersWithAttributes.values;\n    const length = updatersWithAttributes.length;\n    const waitingOnCreate = this.waitingOnCreate;\n    for (i = 0; i < length; i++) {\n      const updater = updatersWithAttributes[i];\n      const instance = this.geometry.get(updater.id);\n\n      let attributes = this.attributes.get(instance.id.id);\n      if (!defined(attributes)) {\n        attributes = primitive.getGeometryInstanceAttributes(instance.id);\n        this.attributes.set(instance.id.id, attributes);\n      }\n\n      if (!updater.outlineColorProperty.isConstant || waitingOnCreate) {\n        const outlineColorProperty = updater.outlineColorProperty;\n        const outlineColor = Property.getValueOrDefault(\n          outlineColorProperty,\n          time,\n          Color.WHITE,\n          colorScratch\n        );\n        if (!Color.equals(attributes._lastColor, outlineColor)) {\n          attributes._lastColor = Color.clone(\n            outlineColor,\n            attributes._lastColor\n          );\n          attributes.color = ColorGeometryInstanceAttribute.toValue(\n            outlineColor,\n            attributes.color\n          );\n          if (\n            (this.translucent && attributes.color[3] === 255) ||\n            (!this.translucent && attributes.color[3] !== 255)\n          ) {\n            this.itemsToRemove[removedCount++] = updater;\n          }\n        }\n      }\n\n      const show =\n        updater.entity.isShowing &&\n        (updater.hasConstantOutline || updater.isOutlineVisible(time));\n      const currentShow = attributes.show[0] === 1;\n      if (show !== currentShow) {\n        attributes.show = ShowGeometryInstanceAttribute.toValue(\n          show,\n          attributes.show\n        );\n      }\n\n      const distanceDisplayConditionProperty =\n        updater.distanceDisplayConditionProperty;\n      if (!Property.isConstant(distanceDisplayConditionProperty)) {\n        const distanceDisplayCondition = Property.getValueOrDefault(\n          distanceDisplayConditionProperty,\n          time,\n          defaultDistanceDisplayCondition,\n          distanceDisplayConditionScratch\n        );\n        if (\n          !DistanceDisplayCondition.equals(\n            distanceDisplayCondition,\n            attributes._lastDistanceDisplayCondition\n          )\n        ) {\n          attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone(\n            distanceDisplayCondition,\n            attributes._lastDistanceDisplayCondition\n          );\n          attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n            distanceDisplayCondition,\n            attributes.distanceDisplayCondition\n          );\n        }\n      }\n\n      const offsetProperty = updater.terrainOffsetProperty;\n      if (!Property.isConstant(offsetProperty)) {\n        const offset = Property.getValueOrDefault(\n          offsetProperty,\n          time,\n          defaultOffset,\n          offsetScratch\n        );\n        if (!Cartesian3.equals(offset, attributes._lastOffset)) {\n          attributes._lastOffset = Cartesian3.clone(\n            offset,\n            attributes._lastOffset\n          );\n          attributes.offset = OffsetGeometryInstanceAttribute.toValue(\n            offset,\n            attributes.offset\n          );\n        }\n      }\n    }\n\n    this.updateShows(primitive);\n    this.waitingOnCreate = false;\n  } else if (defined(primitive) && !primitive.ready) {\n    isUpdated = false;\n  }\n\n  this.itemsToRemove.length = removedCount;\n  return isUpdated;\n};\n\nBatch.prototype.updateShows = function (primitive) {\n  const showsUpdated = this.showsUpdated.values;\n  const length = showsUpdated.length;\n  for (let i = 0; i < length; i++) {\n    const updater = showsUpdated[i];\n    const instance = this.geometry.get(updater.id);\n\n    let attributes = this.attributes.get(instance.id.id);\n    if (!defined(attributes)) {\n      attributes = primitive.getGeometryInstanceAttributes(instance.id);\n      this.attributes.set(instance.id.id, attributes);\n    }\n\n    const show = updater.entity.isShowing;\n    const currentShow = attributes.show[0] === 1;\n    if (show !== currentShow) {\n      attributes.show = ShowGeometryInstanceAttribute.toValue(\n        show,\n        attributes.show\n      );\n      instance.attributes.show.value[0] = attributes.show[0];\n    }\n  }\n  this.showsUpdated.removeAll();\n};\n\nBatch.prototype.contains = function (updater) {\n  return this.updaters.contains(updater.id);\n};\n\nBatch.prototype.getBoundingSphere = function (updater, result) {\n  const primitive = this.primitive;\n  if (!primitive.ready) {\n    return BoundingSphereState.PENDING;\n  }\n  const attributes = primitive.getGeometryInstanceAttributes(updater.entity);\n  if (\n    !defined(attributes) ||\n    !defined(attributes.boundingSphere) || //\n    (defined(attributes.show) && attributes.show[0] === 0)\n  ) {\n    return BoundingSphereState.FAILED;\n  }\n  attributes.boundingSphere.clone(result);\n  return BoundingSphereState.DONE;\n};\n\nBatch.prototype.removeAllPrimitives = function () {\n  const primitives = this.primitives;\n\n  const primitive = this.primitive;\n  if (defined(primitive)) {\n    primitives.remove(primitive);\n    this.primitive = undefined;\n    this.geometry.removeAll();\n    this.updaters.removeAll();\n  }\n\n  const oldPrimitive = this.oldPrimitive;\n  if (defined(oldPrimitive)) {\n    primitives.remove(oldPrimitive);\n    this.oldPrimitive = undefined;\n  }\n};\n\n/**\n * @private\n */\nfunction StaticOutlineGeometryBatch(primitives, scene, shadows) {\n  this._primitives = primitives;\n  this._scene = scene;\n  this._shadows = shadows;\n  this._solidBatches = new AssociativeArray();\n  this._translucentBatches = new AssociativeArray();\n}\nStaticOutlineGeometryBatch.prototype.add = function (time, updater) {\n  const instance = updater.createOutlineGeometryInstance(time);\n  const width = this._scene.clampLineWidth(updater.outlineWidth);\n  let batches;\n  let batch;\n  if (instance.attributes.color.value[3] === 255) {\n    batches = this._solidBatches;\n    batch = batches.get(width);\n    if (!defined(batch)) {\n      batch = new Batch(this._primitives, false, width, this._shadows);\n      batches.set(width, batch);\n    }\n    batch.add(updater, instance);\n  } else {\n    batches = this._translucentBatches;\n    batch = batches.get(width);\n    if (!defined(batch)) {\n      batch = new Batch(this._primitives, true, width, this._shadows);\n      batches.set(width, batch);\n    }\n    batch.add(updater, instance);\n  }\n};\n\nStaticOutlineGeometryBatch.prototype.remove = function (updater) {\n  let i;\n\n  const solidBatches = this._solidBatches.values;\n  const solidBatchesLength = solidBatches.length;\n  for (i = 0; i < solidBatchesLength; i++) {\n    if (solidBatches[i].remove(updater)) {\n      return;\n    }\n  }\n\n  const translucentBatches = this._translucentBatches.values;\n  const translucentBatchesLength = translucentBatches.length;\n  for (i = 0; i < translucentBatchesLength; i++) {\n    if (translucentBatches[i].remove(updater)) {\n      return;\n    }\n  }\n};\n\nStaticOutlineGeometryBatch.prototype.update = function (time) {\n  let i;\n  let x;\n  let updater;\n  let batch;\n  const solidBatches = this._solidBatches.values;\n  const solidBatchesLength = solidBatches.length;\n  const translucentBatches = this._translucentBatches.values;\n  const translucentBatchesLength = translucentBatches.length;\n  let itemsToRemove;\n  let isUpdated = true;\n  let needUpdate = false;\n\n  do {\n    needUpdate = false;\n    for (x = 0; x < solidBatchesLength; x++) {\n      batch = solidBatches[x];\n      //Perform initial update\n      isUpdated = batch.update(time);\n\n      //If any items swapped between solid/translucent, we need to\n      //move them between batches\n      itemsToRemove = batch.itemsToRemove;\n      const solidsToMoveLength = itemsToRemove.length;\n      if (solidsToMoveLength > 0) {\n        needUpdate = true;\n        for (i = 0; i < solidsToMoveLength; i++) {\n          updater = itemsToRemove[i];\n          batch.remove(updater);\n          this.add(time, updater);\n        }\n      }\n    }\n    for (x = 0; x < translucentBatchesLength; x++) {\n      batch = translucentBatches[x];\n      //Perform initial update\n      isUpdated = batch.update(time);\n\n      //If any items swapped between solid/translucent, we need to\n      //move them between batches\n      itemsToRemove = batch.itemsToRemove;\n      const translucentToMoveLength = itemsToRemove.length;\n      if (translucentToMoveLength > 0) {\n        needUpdate = true;\n        for (i = 0; i < translucentToMoveLength; i++) {\n          updater = itemsToRemove[i];\n          batch.remove(updater);\n          this.add(time, updater);\n        }\n      }\n    }\n  } while (needUpdate);\n\n  return isUpdated;\n};\n\nStaticOutlineGeometryBatch.prototype.getBoundingSphere = function (\n  updater,\n  result\n) {\n  let i;\n\n  const solidBatches = this._solidBatches.values;\n  const solidBatchesLength = solidBatches.length;\n  for (i = 0; i < solidBatchesLength; i++) {\n    const solidBatch = solidBatches[i];\n    if (solidBatch.contains(updater)) {\n      return solidBatch.getBoundingSphere(updater, result);\n    }\n  }\n\n  const translucentBatches = this._translucentBatches.values;\n  const translucentBatchesLength = translucentBatches.length;\n  for (i = 0; i < translucentBatchesLength; i++) {\n    const translucentBatch = translucentBatches[i];\n    if (translucentBatch.contains(updater)) {\n      return translucentBatch.getBoundingSphere(updater, result);\n    }\n  }\n\n  return BoundingSphereState.FAILED;\n};\n\nStaticOutlineGeometryBatch.prototype.removeAllPrimitives = function () {\n  let i;\n\n  const solidBatches = this._solidBatches.values;\n  const solidBatchesLength = solidBatches.length;\n  for (i = 0; i < solidBatchesLength; i++) {\n    solidBatches[i].removeAllPrimitives();\n  }\n\n  const translucentBatches = this._translucentBatches.values;\n  const translucentBatchesLength = translucentBatches.length;\n  for (i = 0; i < translucentBatchesLength; i++) {\n    translucentBatches[i].removeAllPrimitives();\n  }\n};\nexport default StaticOutlineGeometryBatch;\n", "import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport defined from \"./defined.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolylinePipeline from \"./PolylinePipeline.js\";\n\n/**\n * @private\n */\nconst WallGeometryLibrary = {};\n\nfunction latLonEquals(c0, c1) {\n  return (\n    CesiumMath.equalsEpsilon(c0.latitude, c1.latitude, CesiumMath.EPSILON10) &&\n    CesiumMath.equalsEpsilon(c0.longitude, c1.longitude, CesiumMath.EPSILON10)\n  );\n}\n\nconst scratchCartographic1 = new Cartographic();\nconst scratchCartographic2 = new Cartographic();\nfunction removeDuplicates(ellipsoid, positions, topHeights, bottomHeights) {\n  positions = arrayRemoveDuplicates(positions, Cartesian3.equalsEpsilon);\n\n  const length = positions.length;\n  if (length < 2) {\n    return;\n  }\n\n  const hasBottomHeights = defined(bottomHeights);\n  const hasTopHeights = defined(topHeights);\n\n  const cleanedPositions = new Array(length);\n  const cleanedTopHeights = new Array(length);\n  const cleanedBottomHeights = new Array(length);\n\n  const v0 = positions[0];\n  cleanedPositions[0] = v0;\n\n  const c0 = ellipsoid.cartesianToCartographic(v0, scratchCartographic1);\n  if (hasTopHeights) {\n    c0.height = topHeights[0];\n  }\n\n  cleanedTopHeights[0] = c0.height;\n\n  if (hasBottomHeights) {\n    cleanedBottomHeights[0] = bottomHeights[0];\n  } else {\n    cleanedBottomHeights[0] = 0.0;\n  }\n\n  const startTopHeight = cleanedTopHeights[0];\n  const startBottomHeight = cleanedBottomHeights[0];\n  let hasAllSameHeights = startTopHeight === startBottomHeight;\n\n  let index = 1;\n  for (let i = 1; i < length; ++i) {\n    const v1 = positions[i];\n    const c1 = ellipsoid.cartesianToCartographic(v1, scratchCartographic2);\n    if (hasTopHeights) {\n      c1.height = topHeights[i];\n    }\n    hasAllSameHeights = hasAllSameHeights && c1.height === 0;\n\n    if (!latLonEquals(c0, c1)) {\n      cleanedPositions[index] = v1; // Shallow copy!\n      cleanedTopHeights[index] = c1.height;\n\n      if (hasBottomHeights) {\n        cleanedBottomHeights[index] = bottomHeights[i];\n      } else {\n        cleanedBottomHeights[index] = 0.0;\n      }\n      hasAllSameHeights =\n        hasAllSameHeights &&\n        cleanedTopHeights[index] === cleanedBottomHeights[index];\n\n      Cartographic.clone(c1, c0);\n      ++index;\n    } else if (c0.height < c1.height) {\n      // two adjacent positions are the same, so use whichever has the greater height\n      cleanedTopHeights[index - 1] = c1.height;\n    }\n  }\n\n  if (hasAllSameHeights || index < 2) {\n    return;\n  }\n\n  cleanedPositions.length = index;\n  cleanedTopHeights.length = index;\n  cleanedBottomHeights.length = index;\n\n  return {\n    positions: cleanedPositions,\n    topHeights: cleanedTopHeights,\n    bottomHeights: cleanedBottomHeights,\n  };\n}\n\nconst positionsArrayScratch = new Array(2);\nconst heightsArrayScratch = new Array(2);\nconst generateArcOptionsScratch = {\n  positions: undefined,\n  height: undefined,\n  granularity: undefined,\n  ellipsoid: undefined,\n};\n\n/**\n * @private\n */\nWallGeometryLibrary.computePositions = function (\n  ellipsoid,\n  wallPositions,\n  maximumHeights,\n  minimumHeights,\n  granularity,\n  duplicateCorners\n) {\n  const o = removeDuplicates(\n    ellipsoid,\n    wallPositions,\n    maximumHeights,\n    minimumHeights\n  );\n\n  if (!defined(o)) {\n    return;\n  }\n\n  wallPositions = o.positions;\n  maximumHeights = o.topHeights;\n  minimumHeights = o.bottomHeights;\n\n  const length = wallPositions.length;\n  const numCorners = length - 2;\n  let topPositions;\n  let bottomPositions;\n\n  const minDistance = CesiumMath.chordLength(\n    granularity,\n    ellipsoid.maximumRadius\n  );\n\n  const generateArcOptions = generateArcOptionsScratch;\n  generateArcOptions.minDistance = minDistance;\n  generateArcOptions.ellipsoid = ellipsoid;\n\n  if (duplicateCorners) {\n    let count = 0;\n    let i;\n\n    for (i = 0; i < length - 1; i++) {\n      count +=\n        PolylinePipeline.numberOfPoints(\n          wallPositions[i],\n          wallPositions[i + 1],\n          minDistance\n        ) + 1;\n    }\n\n    topPositions = new Float64Array(count * 3);\n    bottomPositions = new Float64Array(count * 3);\n\n    const generateArcPositions = positionsArrayScratch;\n    const generateArcHeights = heightsArrayScratch;\n    generateArcOptions.positions = generateArcPositions;\n    generateArcOptions.height = generateArcHeights;\n\n    let offset = 0;\n    for (i = 0; i < length - 1; i++) {\n      generateArcPositions[0] = wallPositions[i];\n      generateArcPositions[1] = wallPositions[i + 1];\n\n      generateArcHeights[0] = maximumHeights[i];\n      generateArcHeights[1] = maximumHeights[i + 1];\n\n      const pos = PolylinePipeline.generateArc(generateArcOptions);\n      topPositions.set(pos, offset);\n\n      generateArcHeights[0] = minimumHeights[i];\n      generateArcHeights[1] = minimumHeights[i + 1];\n\n      bottomPositions.set(\n        PolylinePipeline.generateArc(generateArcOptions),\n        offset\n      );\n\n      offset += pos.length;\n    }\n  } else {\n    generateArcOptions.positions = wallPositions;\n    generateArcOptions.height = maximumHeights;\n    topPositions = new Float64Array(\n      PolylinePipeline.generateArc(generateArcOptions)\n    );\n\n    generateArcOptions.height = minimumHeights;\n    bottomPositions = new Float64Array(\n      PolylinePipeline.generateArc(generateArcOptions)\n    );\n  }\n\n  return {\n    bottomPositions: bottomPositions,\n    topPositions: topPositions,\n    numCorners: numCorners,\n  };\n};\nexport default WallGeometryLibrary;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport VertexFormat from \"./VertexFormat.js\";\nimport WallGeometryLibrary from \"./WallGeometryLibrary.js\";\n\nconst scratchCartesian3Position1 = new Cartesian3();\nconst scratchCartesian3Position2 = new Cartesian3();\nconst scratchCartesian3Position4 = new Cartesian3();\nconst scratchCartesian3Position5 = new Cartesian3();\nconst scratchBitangent = new Cartesian3();\nconst scratchTangent = new Cartesian3();\nconst scratchNormal = new Cartesian3();\n\n/**\n * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,\n * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.\n *\n * @alias WallGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {number[]} [options.maximumHeights] An array parallel to <code>positions</code> that give the maximum height of the\n *        wall at <code>positions</code>. If undefined, the height of each position in used.\n * @param {number[]} [options.minimumHeights] An array parallel to <code>positions</code> that give the minimum height of the\n *        wall at <code>positions</code>. If undefined, the height at each position is 0.0.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @exception {DeveloperError} positions length must be greater than or equal to 2.\n * @exception {DeveloperError} positions and maximumHeights must have the same length.\n * @exception {DeveloperError} positions and minimumHeights must have the same length.\n *\n * @see WallGeometry#createGeometry\n * @see WallGeometry#fromConstantHeight\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Wall.html|Cesium Sandcastle Wall Demo}\n *\n * @example\n * // create a wall that spans from ground level to 10000 meters\n * const wall = new Cesium.WallGeometry({\n *   positions : Cesium.Cartesian3.fromDegreesArrayHeights([\n *     19.0, 47.0, 10000.0,\n *     19.0, 48.0, 10000.0,\n *     20.0, 48.0, 10000.0,\n *     20.0, 47.0, 10000.0,\n *     19.0, 47.0, 10000.0\n *   ])\n * });\n * const geometry = Cesium.WallGeometry.createGeometry(wall);\n */\nfunction WallGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const wallPositions = options.positions;\n  const maximumHeights = options.maximumHeights;\n  const minimumHeights = options.minimumHeights;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(wallPositions)) {\n    throw new DeveloperError(\"options.positions is required.\");\n  }\n  if (\n    defined(maximumHeights) &&\n    maximumHeights.length !== wallPositions.length\n  ) {\n    throw new DeveloperError(\n      \"options.positions and options.maximumHeights must have the same length.\"\n    );\n  }\n  if (\n    defined(minimumHeights) &&\n    minimumHeights.length !== wallPositions.length\n  ) {\n    throw new DeveloperError(\n      \"options.positions and options.minimumHeights must have the same length.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n  const granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n  this._positions = wallPositions;\n  this._minimumHeights = minimumHeights;\n  this._maximumHeights = maximumHeights;\n  this._vertexFormat = VertexFormat.clone(vertexFormat);\n  this._granularity = granularity;\n  this._ellipsoid = Ellipsoid.clone(ellipsoid);\n  this._workerName = \"createWallGeometry\";\n\n  let numComponents = 1 + wallPositions.length * Cartesian3.packedLength + 2;\n  if (defined(minimumHeights)) {\n    numComponents += minimumHeights.length;\n  }\n  if (defined(maximumHeights)) {\n    numComponents += maximumHeights.length;\n  }\n\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  this.packedLength =\n    numComponents + Ellipsoid.packedLength + VertexFormat.packedLength + 1;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {WallGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nWallGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required\");\n  }\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  let i;\n\n  const positions = value._positions;\n  let length = positions.length;\n  array[startingIndex++] = length;\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    Cartesian3.pack(positions[i], array, startingIndex);\n  }\n\n  const minimumHeights = value._minimumHeights;\n  length = defined(minimumHeights) ? minimumHeights.length : 0;\n  array[startingIndex++] = length;\n\n  if (defined(minimumHeights)) {\n    for (i = 0; i < length; ++i) {\n      array[startingIndex++] = minimumHeights[i];\n    }\n  }\n\n  const maximumHeights = value._maximumHeights;\n  length = defined(maximumHeights) ? maximumHeights.length : 0;\n  array[startingIndex++] = length;\n\n  if (defined(maximumHeights)) {\n    for (i = 0; i < length; ++i) {\n      array[startingIndex++] = maximumHeights[i];\n    }\n  }\n\n  Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  VertexFormat.pack(value._vertexFormat, array, startingIndex);\n  startingIndex += VertexFormat.packedLength;\n\n  array[startingIndex] = value._granularity;\n\n  return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n  positions: undefined,\n  minimumHeights: undefined,\n  maximumHeights: undefined,\n  ellipsoid: scratchEllipsoid,\n  vertexFormat: scratchVertexFormat,\n  granularity: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {WallGeometry} [result] The object into which to store the result.\n * @returns {WallGeometry} The modified result parameter or a new WallGeometry instance if one was not provided.\n */\nWallGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  let i;\n\n  let length = array[startingIndex++];\n  const positions = new Array(length);\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    positions[i] = Cartesian3.unpack(array, startingIndex);\n  }\n\n  length = array[startingIndex++];\n  let minimumHeights;\n\n  if (length > 0) {\n    minimumHeights = new Array(length);\n    for (i = 0; i < length; ++i) {\n      minimumHeights[i] = array[startingIndex++];\n    }\n  }\n\n  length = array[startingIndex++];\n  let maximumHeights;\n\n  if (length > 0) {\n    maximumHeights = new Array(length);\n    for (i = 0; i < length; ++i) {\n      maximumHeights[i] = array[startingIndex++];\n    }\n  }\n\n  const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n  startingIndex += Ellipsoid.packedLength;\n\n  const vertexFormat = VertexFormat.unpack(\n    array,\n    startingIndex,\n    scratchVertexFormat\n  );\n  startingIndex += VertexFormat.packedLength;\n\n  const granularity = array[startingIndex];\n\n  if (!defined(result)) {\n    scratchOptions.positions = positions;\n    scratchOptions.minimumHeights = minimumHeights;\n    scratchOptions.maximumHeights = maximumHeights;\n    scratchOptions.granularity = granularity;\n    return new WallGeometry(scratchOptions);\n  }\n\n  result._positions = positions;\n  result._minimumHeights = minimumHeights;\n  result._maximumHeights = maximumHeights;\n  result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n  result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n  result._granularity = granularity;\n\n  return result;\n};\n\n/**\n * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,\n * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.\n * @param {number} [options.maximumHeight] A constant that defines the maximum height of the\n *        wall at <code>positions</code>. If undefined, the height of each position in used.\n * @param {number} [options.minimumHeight] A constant that defines the minimum height of the\n *        wall at <code>positions</code>. If undefined, the height at each position is 0.0.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @returns {WallGeometry}\n *\n *\n * @example\n * // create a wall that spans from 10000 meters to 20000 meters\n * const wall = Cesium.WallGeometry.fromConstantHeights({\n *   positions : Cesium.Cartesian3.fromDegreesArray([\n *     19.0, 47.0,\n *     19.0, 48.0,\n *     20.0, 48.0,\n *     20.0, 47.0,\n *     19.0, 47.0,\n *   ]),\n *   minimumHeight : 20000.0,\n *   maximumHeight : 10000.0\n * });\n * const geometry = Cesium.WallGeometry.createGeometry(wall);\n *\n * @see WallGeometry#createGeometry\n */\nWallGeometry.fromConstantHeights = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const positions = options.positions;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(positions)) {\n    throw new DeveloperError(\"options.positions is required.\");\n  }\n  //>>includeEnd('debug');\n\n  let minHeights;\n  let maxHeights;\n\n  const min = options.minimumHeight;\n  const max = options.maximumHeight;\n\n  const doMin = defined(min);\n  const doMax = defined(max);\n  if (doMin || doMax) {\n    const length = positions.length;\n    minHeights = doMin ? new Array(length) : undefined;\n    maxHeights = doMax ? new Array(length) : undefined;\n\n    for (let i = 0; i < length; ++i) {\n      if (doMin) {\n        minHeights[i] = min;\n      }\n\n      if (doMax) {\n        maxHeights[i] = max;\n      }\n    }\n  }\n\n  const newOptions = {\n    positions: positions,\n    maximumHeights: maxHeights,\n    minimumHeights: minHeights,\n    ellipsoid: options.ellipsoid,\n    vertexFormat: options.vertexFormat,\n  };\n  return new WallGeometry(newOptions);\n};\n\n/**\n * Computes the geometric representation of a wall, including its vertices, indices, and a bounding sphere.\n *\n * @param {WallGeometry} wallGeometry A description of the wall.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nWallGeometry.createGeometry = function (wallGeometry) {\n  const wallPositions = wallGeometry._positions;\n  const minimumHeights = wallGeometry._minimumHeights;\n  const maximumHeights = wallGeometry._maximumHeights;\n  const vertexFormat = wallGeometry._vertexFormat;\n  const granularity = wallGeometry._granularity;\n  const ellipsoid = wallGeometry._ellipsoid;\n\n  const pos = WallGeometryLibrary.computePositions(\n    ellipsoid,\n    wallPositions,\n    maximumHeights,\n    minimumHeights,\n    granularity,\n    true\n  );\n  if (!defined(pos)) {\n    return;\n  }\n\n  const bottomPositions = pos.bottomPositions;\n  const topPositions = pos.topPositions;\n  const numCorners = pos.numCorners;\n\n  let length = topPositions.length;\n  let size = length * 2;\n\n  const positions = vertexFormat.position ? new Float64Array(size) : undefined;\n  const normals = vertexFormat.normal ? new Float32Array(size) : undefined;\n  const tangents = vertexFormat.tangent ? new Float32Array(size) : undefined;\n  const bitangents = vertexFormat.bitangent\n    ? new Float32Array(size)\n    : undefined;\n  const textureCoordinates = vertexFormat.st\n    ? new Float32Array((size / 3) * 2)\n    : undefined;\n\n  let positionIndex = 0;\n  let normalIndex = 0;\n  let bitangentIndex = 0;\n  let tangentIndex = 0;\n  let stIndex = 0;\n\n  // add lower and upper points one after the other, lower\n  // points being even and upper points being odd\n  let normal = scratchNormal;\n  let tangent = scratchTangent;\n  let bitangent = scratchBitangent;\n  let recomputeNormal = true;\n  length /= 3;\n  let i;\n  let s = 0;\n  const ds = 1 / (length - numCorners - 1);\n  for (i = 0; i < length; ++i) {\n    const i3 = i * 3;\n    const topPosition = Cartesian3.fromArray(\n      topPositions,\n      i3,\n      scratchCartesian3Position1\n    );\n    const bottomPosition = Cartesian3.fromArray(\n      bottomPositions,\n      i3,\n      scratchCartesian3Position2\n    );\n    if (vertexFormat.position) {\n      // insert the lower point\n      positions[positionIndex++] = bottomPosition.x;\n      positions[positionIndex++] = bottomPosition.y;\n      positions[positionIndex++] = bottomPosition.z;\n\n      // insert the upper point\n      positions[positionIndex++] = topPosition.x;\n      positions[positionIndex++] = topPosition.y;\n      positions[positionIndex++] = topPosition.z;\n    }\n\n    if (vertexFormat.st) {\n      textureCoordinates[stIndex++] = s;\n      textureCoordinates[stIndex++] = 0.0;\n\n      textureCoordinates[stIndex++] = s;\n      textureCoordinates[stIndex++] = 1.0;\n    }\n\n    if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {\n      let nextTop = Cartesian3.clone(\n        Cartesian3.ZERO,\n        scratchCartesian3Position5\n      );\n      const groundPosition = Cartesian3.subtract(\n        topPosition,\n        ellipsoid.geodeticSurfaceNormal(\n          topPosition,\n          scratchCartesian3Position2\n        ),\n        scratchCartesian3Position2\n      );\n      if (i + 1 < length) {\n        nextTop = Cartesian3.fromArray(\n          topPositions,\n          i3 + 3,\n          scratchCartesian3Position5\n        );\n      }\n\n      if (recomputeNormal) {\n        const scalednextPosition = Cartesian3.subtract(\n          nextTop,\n          topPosition,\n          scratchCartesian3Position4\n        );\n        const scaledGroundPosition = Cartesian3.subtract(\n          groundPosition,\n          topPosition,\n          scratchCartesian3Position1\n        );\n        normal = Cartesian3.normalize(\n          Cartesian3.cross(scaledGroundPosition, scalednextPosition, normal),\n          normal\n        );\n        recomputeNormal = false;\n      }\n\n      if (\n        Cartesian3.equalsEpsilon(topPosition, nextTop, CesiumMath.EPSILON10)\n      ) {\n        recomputeNormal = true;\n      } else {\n        s += ds;\n        if (vertexFormat.tangent) {\n          tangent = Cartesian3.normalize(\n            Cartesian3.subtract(nextTop, topPosition, tangent),\n            tangent\n          );\n        }\n        if (vertexFormat.bitangent) {\n          bitangent = Cartesian3.normalize(\n            Cartesian3.cross(normal, tangent, bitangent),\n            bitangent\n          );\n        }\n      }\n\n      if (vertexFormat.normal) {\n        normals[normalIndex++] = normal.x;\n        normals[normalIndex++] = normal.y;\n        normals[normalIndex++] = normal.z;\n\n        normals[normalIndex++] = normal.x;\n        normals[normalIndex++] = normal.y;\n        normals[normalIndex++] = normal.z;\n      }\n\n      if (vertexFormat.tangent) {\n        tangents[tangentIndex++] = tangent.x;\n        tangents[tangentIndex++] = tangent.y;\n        tangents[tangentIndex++] = tangent.z;\n\n        tangents[tangentIndex++] = tangent.x;\n        tangents[tangentIndex++] = tangent.y;\n        tangents[tangentIndex++] = tangent.z;\n      }\n\n      if (vertexFormat.bitangent) {\n        bitangents[bitangentIndex++] = bitangent.x;\n        bitangents[bitangentIndex++] = bitangent.y;\n        bitangents[bitangentIndex++] = bitangent.z;\n\n        bitangents[bitangentIndex++] = bitangent.x;\n        bitangents[bitangentIndex++] = bitangent.y;\n        bitangents[bitangentIndex++] = bitangent.z;\n      }\n    }\n  }\n\n  const attributes = new GeometryAttributes();\n\n  if (vertexFormat.position) {\n    attributes.position = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: positions,\n    });\n  }\n\n  if (vertexFormat.normal) {\n    attributes.normal = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: normals,\n    });\n  }\n\n  if (vertexFormat.tangent) {\n    attributes.tangent = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: tangents,\n    });\n  }\n\n  if (vertexFormat.bitangent) {\n    attributes.bitangent = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 3,\n      values: bitangents,\n    });\n  }\n\n  if (vertexFormat.st) {\n    attributes.st = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n      values: textureCoordinates,\n    });\n  }\n\n  // prepare the side walls, two triangles for each wall\n  //\n  //    A (i+1)  B (i+3) E\n  //    +--------+-------+\n  //    |      / |      /|    triangles:  A C B\n  //    |     /  |     / |                B C D\n  //    |    /   |    /  |\n  //    |   /    |   /   |\n  //    |  /     |  /    |\n  //    | /      | /     |\n  //    +--------+-------+\n  //    C (i)    D (i+2) F\n  //\n\n  const numVertices = size / 3;\n  size -= 6 * (numCorners + 1);\n  const indices = IndexDatatype.createTypedArray(numVertices, size);\n\n  let edgeIndex = 0;\n  for (i = 0; i < numVertices - 2; i += 2) {\n    const LL = i;\n    const LR = i + 2;\n    const pl = Cartesian3.fromArray(\n      positions,\n      LL * 3,\n      scratchCartesian3Position1\n    );\n    const pr = Cartesian3.fromArray(\n      positions,\n      LR * 3,\n      scratchCartesian3Position2\n    );\n    if (Cartesian3.equalsEpsilon(pl, pr, CesiumMath.EPSILON10)) {\n      continue;\n    }\n    const UL = i + 1;\n    const UR = i + 3;\n\n    indices[edgeIndex++] = UL;\n    indices[edgeIndex++] = LL;\n    indices[edgeIndex++] = UR;\n    indices[edgeIndex++] = UR;\n    indices[edgeIndex++] = LL;\n    indices[edgeIndex++] = LR;\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: PrimitiveType.TRIANGLES,\n    boundingSphere: new BoundingSphere.fromVertices(positions),\n  });\n};\nexport default WallGeometry;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport WallGeometryLibrary from \"./WallGeometryLibrary.js\";\n\nconst scratchCartesian3Position1 = new Cartesian3();\nconst scratchCartesian3Position2 = new Cartesian3();\n\n/**\n * A description of a wall outline. A wall is defined by a series of points,\n * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.\n *\n * @alias WallOutlineGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {number[]} [options.maximumHeights] An array parallel to <code>positions</code> that give the maximum height of the\n *        wall at <code>positions</code>. If undefined, the height of each position in used.\n * @param {number[]} [options.minimumHeights] An array parallel to <code>positions</code> that give the minimum height of the\n *        wall at <code>positions</code>. If undefined, the height at each position is 0.0.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation\n *\n * @exception {DeveloperError} positions length must be greater than or equal to 2.\n * @exception {DeveloperError} positions and maximumHeights must have the same length.\n * @exception {DeveloperError} positions and minimumHeights must have the same length.\n *\n * @see WallGeometry#createGeometry\n * @see WallGeometry#fromConstantHeight\n *\n * @example\n * // create a wall outline that spans from ground level to 10000 meters\n * const wall = new Cesium.WallOutlineGeometry({\n *   positions : Cesium.Cartesian3.fromDegreesArrayHeights([\n *     19.0, 47.0, 10000.0,\n *     19.0, 48.0, 10000.0,\n *     20.0, 48.0, 10000.0,\n *     20.0, 47.0, 10000.0,\n *     19.0, 47.0, 10000.0\n *   ])\n * });\n * const geometry = Cesium.WallOutlineGeometry.createGeometry(wall);\n */\nfunction WallOutlineGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const wallPositions = options.positions;\n  const maximumHeights = options.maximumHeights;\n  const minimumHeights = options.minimumHeights;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(wallPositions)) {\n    throw new DeveloperError(\"options.positions is required.\");\n  }\n  if (\n    defined(maximumHeights) &&\n    maximumHeights.length !== wallPositions.length\n  ) {\n    throw new DeveloperError(\n      \"options.positions and options.maximumHeights must have the same length.\"\n    );\n  }\n  if (\n    defined(minimumHeights) &&\n    minimumHeights.length !== wallPositions.length\n  ) {\n    throw new DeveloperError(\n      \"options.positions and options.minimumHeights must have the same length.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n  this._positions = wallPositions;\n  this._minimumHeights = minimumHeights;\n  this._maximumHeights = maximumHeights;\n  this._granularity = granularity;\n  this._ellipsoid = Ellipsoid.clone(ellipsoid);\n  this._workerName = \"createWallOutlineGeometry\";\n\n  let numComponents = 1 + wallPositions.length * Cartesian3.packedLength + 2;\n  if (defined(minimumHeights)) {\n    numComponents += minimumHeights.length;\n  }\n  if (defined(maximumHeights)) {\n    numComponents += maximumHeights.length;\n  }\n\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  this.packedLength = numComponents + Ellipsoid.packedLength + 1;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {WallOutlineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nWallOutlineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required\");\n  }\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  let i;\n\n  const positions = value._positions;\n  let length = positions.length;\n  array[startingIndex++] = length;\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    Cartesian3.pack(positions[i], array, startingIndex);\n  }\n\n  const minimumHeights = value._minimumHeights;\n  length = defined(minimumHeights) ? minimumHeights.length : 0;\n  array[startingIndex++] = length;\n\n  if (defined(minimumHeights)) {\n    for (i = 0; i < length; ++i) {\n      array[startingIndex++] = minimumHeights[i];\n    }\n  }\n\n  const maximumHeights = value._maximumHeights;\n  length = defined(maximumHeights) ? maximumHeights.length : 0;\n  array[startingIndex++] = length;\n\n  if (defined(maximumHeights)) {\n    for (i = 0; i < length; ++i) {\n      array[startingIndex++] = maximumHeights[i];\n    }\n  }\n\n  Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  array[startingIndex] = value._granularity;\n\n  return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchOptions = {\n  positions: undefined,\n  minimumHeights: undefined,\n  maximumHeights: undefined,\n  ellipsoid: scratchEllipsoid,\n  granularity: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {WallOutlineGeometry} [result] The object into which to store the result.\n * @returns {WallOutlineGeometry} The modified result parameter or a new WallOutlineGeometry instance if one was not provided.\n */\nWallOutlineGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  let i;\n\n  let length = array[startingIndex++];\n  const positions = new Array(length);\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    positions[i] = Cartesian3.unpack(array, startingIndex);\n  }\n\n  length = array[startingIndex++];\n  let minimumHeights;\n\n  if (length > 0) {\n    minimumHeights = new Array(length);\n    for (i = 0; i < length; ++i) {\n      minimumHeights[i] = array[startingIndex++];\n    }\n  }\n\n  length = array[startingIndex++];\n  let maximumHeights;\n\n  if (length > 0) {\n    maximumHeights = new Array(length);\n    for (i = 0; i < length; ++i) {\n      maximumHeights[i] = array[startingIndex++];\n    }\n  }\n\n  const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n  startingIndex += Ellipsoid.packedLength;\n\n  const granularity = array[startingIndex];\n\n  if (!defined(result)) {\n    scratchOptions.positions = positions;\n    scratchOptions.minimumHeights = minimumHeights;\n    scratchOptions.maximumHeights = maximumHeights;\n    scratchOptions.granularity = granularity;\n    return new WallOutlineGeometry(scratchOptions);\n  }\n\n  result._positions = positions;\n  result._minimumHeights = minimumHeights;\n  result._maximumHeights = maximumHeights;\n  result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n  result._granularity = granularity;\n\n  return result;\n};\n\n/**\n * A description of a walloutline. A wall is defined by a series of points,\n * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.\n * @param {number} [options.maximumHeight] A constant that defines the maximum height of the\n *        wall at <code>positions</code>. If undefined, the height of each position in used.\n * @param {number} [options.minimumHeight] A constant that defines the minimum height of the\n *        wall at <code>positions</code>. If undefined, the height at each position is 0.0.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation\n * @returns {WallOutlineGeometry}\n *\n *\n * @example\n * // create a wall that spans from 10000 meters to 20000 meters\n * const wall = Cesium.WallOutlineGeometry.fromConstantHeights({\n *   positions : Cesium.Cartesian3.fromDegreesArray([\n *     19.0, 47.0,\n *     19.0, 48.0,\n *     20.0, 48.0,\n *     20.0, 47.0,\n *     19.0, 47.0,\n *   ]),\n *   minimumHeight : 20000.0,\n *   maximumHeight : 10000.0\n * });\n * const geometry = Cesium.WallOutlineGeometry.createGeometry(wall);\n *\n * @see WallOutlineGeometry#createGeometry\n */\nWallOutlineGeometry.fromConstantHeights = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const positions = options.positions;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(positions)) {\n    throw new DeveloperError(\"options.positions is required.\");\n  }\n  //>>includeEnd('debug');\n\n  let minHeights;\n  let maxHeights;\n\n  const min = options.minimumHeight;\n  const max = options.maximumHeight;\n\n  const doMin = defined(min);\n  const doMax = defined(max);\n  if (doMin || doMax) {\n    const length = positions.length;\n    minHeights = doMin ? new Array(length) : undefined;\n    maxHeights = doMax ? new Array(length) : undefined;\n\n    for (let i = 0; i < length; ++i) {\n      if (doMin) {\n        minHeights[i] = min;\n      }\n\n      if (doMax) {\n        maxHeights[i] = max;\n      }\n    }\n  }\n\n  const newOptions = {\n    positions: positions,\n    maximumHeights: maxHeights,\n    minimumHeights: minHeights,\n    ellipsoid: options.ellipsoid,\n  };\n  return new WallOutlineGeometry(newOptions);\n};\n\n/**\n * Computes the geometric representation of a wall outline, including its vertices, indices, and a bounding sphere.\n *\n * @param {WallOutlineGeometry} wallGeometry A description of the wall outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nWallOutlineGeometry.createGeometry = function (wallGeometry) {\n  const wallPositions = wallGeometry._positions;\n  const minimumHeights = wallGeometry._minimumHeights;\n  const maximumHeights = wallGeometry._maximumHeights;\n  const granularity = wallGeometry._granularity;\n  const ellipsoid = wallGeometry._ellipsoid;\n\n  const pos = WallGeometryLibrary.computePositions(\n    ellipsoid,\n    wallPositions,\n    maximumHeights,\n    minimumHeights,\n    granularity,\n    false\n  );\n  if (!defined(pos)) {\n    return;\n  }\n\n  const bottomPositions = pos.bottomPositions;\n  const topPositions = pos.topPositions;\n\n  let length = topPositions.length;\n  let size = length * 2;\n\n  const positions = new Float64Array(size);\n  let positionIndex = 0;\n\n  // add lower and upper points one after the other, lower\n  // points being even and upper points being odd\n  length /= 3;\n  let i;\n  for (i = 0; i < length; ++i) {\n    const i3 = i * 3;\n    const topPosition = Cartesian3.fromArray(\n      topPositions,\n      i3,\n      scratchCartesian3Position1\n    );\n    const bottomPosition = Cartesian3.fromArray(\n      bottomPositions,\n      i3,\n      scratchCartesian3Position2\n    );\n\n    // insert the lower point\n    positions[positionIndex++] = bottomPosition.x;\n    positions[positionIndex++] = bottomPosition.y;\n    positions[positionIndex++] = bottomPosition.z;\n\n    // insert the upper point\n    positions[positionIndex++] = topPosition.x;\n    positions[positionIndex++] = topPosition.y;\n    positions[positionIndex++] = topPosition.z;\n  }\n\n  const attributes = new GeometryAttributes({\n    position: new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: positions,\n    }),\n  });\n\n  const numVertices = size / 3;\n  size = 2 * numVertices - 4 + numVertices;\n  const indices = IndexDatatype.createTypedArray(numVertices, size);\n\n  let edgeIndex = 0;\n  for (i = 0; i < numVertices - 2; i += 2) {\n    const LL = i;\n    const LR = i + 2;\n    const pl = Cartesian3.fromArray(\n      positions,\n      LL * 3,\n      scratchCartesian3Position1\n    );\n    const pr = Cartesian3.fromArray(\n      positions,\n      LR * 3,\n      scratchCartesian3Position2\n    );\n    if (Cartesian3.equalsEpsilon(pl, pr, CesiumMath.EPSILON10)) {\n      continue;\n    }\n    const UL = i + 1;\n    const UR = i + 3;\n\n    indices[edgeIndex++] = UL;\n    indices[edgeIndex++] = LL;\n    indices[edgeIndex++] = UL;\n    indices[edgeIndex++] = UR;\n    indices[edgeIndex++] = LL;\n    indices[edgeIndex++] = LR;\n  }\n\n  indices[edgeIndex++] = numVertices - 2;\n  indices[edgeIndex++] = numVertices - 1;\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: PrimitiveType.LINES,\n    boundingSphere: new BoundingSphere.fromVertices(positions),\n  });\n};\nexport default WallOutlineGeometry;\n", "import Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport WallGeometry from \"../Core/WallGeometry.js\";\nimport WallOutlineGeometry from \"../Core/WallOutlineGeometry.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport Property from \"./Property.js\";\n\nconst scratchColor = new Color();\n\nfunction WallGeometryOptions(entity) {\n  this.id = entity;\n  this.vertexFormat = undefined;\n  this.positions = undefined;\n  this.minimumHeights = undefined;\n  this.maximumHeights = undefined;\n  this.granularity = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for walls.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias WallGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction WallGeometryUpdater(entity, scene) {\n  GeometryUpdater.call(this, {\n    entity: entity,\n    scene: scene,\n    geometryOptions: new WallGeometryOptions(entity),\n    geometryPropertyName: \"wall\",\n    observedPropertyNames: [\"availability\", \"wall\"],\n  });\n\n  this._onEntityPropertyChanged(entity, \"wall\", entity.wall, undefined);\n}\n\nif (defined(Object.create)) {\n  WallGeometryUpdater.prototype = Object.create(GeometryUpdater.prototype);\n  WallGeometryUpdater.prototype.constructor = WallGeometryUpdater;\n}\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nWallGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._fillEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent a filled geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n\n  let attributes;\n\n  let color;\n  const show = new ShowGeometryInstanceAttribute(\n    isAvailable &&\n      entity.isShowing &&\n      this._showProperty.getValue(time) &&\n      this._fillProperty.getValue(time)\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n  const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n    distanceDisplayCondition\n  );\n  if (this._materialProperty instanceof ColorMaterialProperty) {\n    let currentColor;\n    if (\n      defined(this._materialProperty.color) &&\n      (this._materialProperty.color.isConstant || isAvailable)\n    ) {\n      currentColor = this._materialProperty.color.getValue(time, scratchColor);\n    }\n    if (!defined(currentColor)) {\n      currentColor = Color.WHITE;\n    }\n    color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n    attributes = {\n      show: show,\n      distanceDisplayCondition: distanceDisplayConditionAttribute,\n      color: color,\n    };\n  } else {\n    attributes = {\n      show: show,\n      distanceDisplayCondition: distanceDisplayConditionAttribute,\n    };\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new WallGeometry(this._options),\n    attributes: attributes,\n  });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nWallGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n\n  if (!this._outlineEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent an outlined geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n  const outlineColor = Property.getValueOrDefault(\n    this._outlineColorProperty,\n    time,\n    Color.BLACK,\n    scratchColor\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new WallOutlineGeometry(this._options),\n    attributes: {\n      show: new ShowGeometryInstanceAttribute(\n        isAvailable &&\n          entity.isShowing &&\n          this._showProperty.getValue(time) &&\n          this._showOutlineProperty.getValue(time)\n      ),\n      color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n      distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n        distanceDisplayCondition\n      ),\n    },\n  });\n};\n\nWallGeometryUpdater.prototype._isHidden = function (entity, wall) {\n  return (\n    !defined(wall.positions) ||\n    GeometryUpdater.prototype._isHidden.call(this, entity, wall)\n  );\n};\n\nWallGeometryUpdater.prototype._getIsClosed = function (options) {\n  return false;\n};\n\nWallGeometryUpdater.prototype._isDynamic = function (entity, wall) {\n  return (\n    !wall.positions.isConstant || //\n    !Property.isConstant(wall.minimumHeights) || //\n    !Property.isConstant(wall.maximumHeights) || //\n    !Property.isConstant(wall.outlineWidth) || //\n    !Property.isConstant(wall.granularity)\n  );\n};\n\nWallGeometryUpdater.prototype._setStaticOptions = function (entity, wall) {\n  const minimumHeights = wall.minimumHeights;\n  const maximumHeights = wall.maximumHeights;\n  const granularity = wall.granularity;\n  const isColorMaterial =\n    this._materialProperty instanceof ColorMaterialProperty;\n\n  const options = this._options;\n  options.vertexFormat = isColorMaterial\n    ? PerInstanceColorAppearance.VERTEX_FORMAT\n    : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n  options.positions = wall.positions.getValue(\n    Iso8601.MINIMUM_VALUE,\n    options.positions\n  );\n  options.minimumHeights = defined(minimumHeights)\n    ? minimumHeights.getValue(Iso8601.MINIMUM_VALUE, options.minimumHeights)\n    : undefined;\n  options.maximumHeights = defined(maximumHeights)\n    ? maximumHeights.getValue(Iso8601.MINIMUM_VALUE, options.maximumHeights)\n    : undefined;\n  options.granularity = defined(granularity)\n    ? granularity.getValue(Iso8601.MINIMUM_VALUE)\n    : undefined;\n};\n\nWallGeometryUpdater.DynamicGeometryUpdater = DynamicWallGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicWallGeometryUpdater(\n  geometryUpdater,\n  primitives,\n  groundPrimitives\n) {\n  DynamicGeometryUpdater.call(\n    this,\n    geometryUpdater,\n    primitives,\n    groundPrimitives\n  );\n}\n\nif (defined(Object.create)) {\n  DynamicWallGeometryUpdater.prototype = Object.create(\n    DynamicGeometryUpdater.prototype\n  );\n  DynamicWallGeometryUpdater.prototype.constructor = DynamicWallGeometryUpdater;\n}\n\nDynamicWallGeometryUpdater.prototype._isHidden = function (entity, wall, time) {\n  return (\n    !defined(this._options.positions) ||\n    DynamicGeometryUpdater.prototype._isHidden.call(this, entity, wall, time)\n  );\n};\n\nDynamicWallGeometryUpdater.prototype._setOptions = function (\n  entity,\n  wall,\n  time\n) {\n  const options = this._options;\n  options.positions = Property.getValueOrUndefined(\n    wall.positions,\n    time,\n    options.positions\n  );\n  options.minimumHeights = Property.getValueOrUndefined(\n    wall.minimumHeights,\n    time,\n    options.minimumHeights\n  );\n  options.maximumHeights = Property.getValueOrUndefined(\n    wall.maximumHeights,\n    time,\n    options.maximumHeights\n  );\n  options.granularity = Property.getValueOrUndefined(wall.granularity, time);\n};\nexport default WallGeometryUpdater;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Event from \"../Core/Event.js\";\nimport EventHelper from \"../Core/EventHelper.js\";\nimport ClassificationType from \"../Scene/ClassificationType.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ShadowMode from \"../Scene/ShadowMode.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport BoxGeometryUpdater from \"./BoxGeometryUpdater.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport CorridorGeometryUpdater from \"./CorridorGeometryUpdater.js\";\nimport CylinderGeometryUpdater from \"./CylinderGeometryUpdater.js\";\nimport DynamicGeometryBatch from \"./DynamicGeometryBatch.js\";\nimport EllipseGeometryUpdater from \"./EllipseGeometryUpdater.js\";\nimport EllipsoidGeometryUpdater from \"./EllipsoidGeometryUpdater.js\";\nimport Entity from \"./Entity.js\";\nimport PlaneGeometryUpdater from \"./PlaneGeometryUpdater.js\";\nimport PolygonGeometryUpdater from \"./PolygonGeometryUpdater.js\";\nimport PolylineVolumeGeometryUpdater from \"./PolylineVolumeGeometryUpdater.js\";\nimport RectangleGeometryUpdater from \"./RectangleGeometryUpdater.js\";\nimport StaticGeometryColorBatch from \"./StaticGeometryColorBatch.js\";\nimport StaticGeometryPerMaterialBatch from \"./StaticGeometryPerMaterialBatch.js\";\nimport StaticGroundGeometryColorBatch from \"./StaticGroundGeometryColorBatch.js\";\nimport StaticGroundGeometryPerMaterialBatch from \"./StaticGroundGeometryPerMaterialBatch.js\";\nimport StaticOutlineGeometryBatch from \"./StaticOutlineGeometryBatch.js\";\nimport WallGeometryUpdater from \"./WallGeometryUpdater.js\";\n\nconst emptyArray = [];\n\nconst geometryUpdaters = [\n  BoxGeometryUpdater,\n  CylinderGeometryUpdater,\n  CorridorGeometryUpdater,\n  EllipseGeometryUpdater,\n  EllipsoidGeometryUpdater,\n  PlaneGeometryUpdater,\n  PolygonGeometryUpdater,\n  PolylineVolumeGeometryUpdater,\n  RectangleGeometryUpdater,\n  WallGeometryUpdater,\n];\n\nfunction GeometryUpdaterSet(entity, scene) {\n  this.entity = entity;\n  this.scene = scene;\n  const updaters = new Array(geometryUpdaters.length);\n  const geometryChanged = new Event();\n  function raiseEvent(geometry) {\n    geometryChanged.raiseEvent(geometry);\n  }\n  const eventHelper = new EventHelper();\n  for (let i = 0; i < updaters.length; i++) {\n    const updater = new geometryUpdaters[i](entity, scene);\n    eventHelper.add(updater.geometryChanged, raiseEvent);\n    updaters[i] = updater;\n  }\n  this.updaters = updaters;\n  this.geometryChanged = geometryChanged;\n  this.eventHelper = eventHelper;\n\n  this._removeEntitySubscription = entity.definitionChanged.addEventListener(\n    GeometryUpdaterSet.prototype._onEntityPropertyChanged,\n    this\n  );\n}\n\nGeometryUpdaterSet.prototype._onEntityPropertyChanged = function (\n  entity,\n  propertyName,\n  newValue,\n  oldValue\n) {\n  const updaters = this.updaters;\n  for (let i = 0; i < updaters.length; i++) {\n    updaters[i]._onEntityPropertyChanged(\n      entity,\n      propertyName,\n      newValue,\n      oldValue\n    );\n  }\n};\n\nGeometryUpdaterSet.prototype.forEach = function (callback) {\n  const updaters = this.updaters;\n  for (let i = 0; i < updaters.length; i++) {\n    callback(updaters[i]);\n  }\n};\n\nGeometryUpdaterSet.prototype.destroy = function () {\n  this.eventHelper.removeAll();\n  const updaters = this.updaters;\n  for (let i = 0; i < updaters.length; i++) {\n    updaters[i].destroy();\n  }\n  this._removeEntitySubscription();\n  destroyObject(this);\n};\n\n/**\n * A general purpose visualizer for geometry represented by {@link Primitive} instances.\n * @alias GeometryVisualizer\n * @constructor\n *\n * @param {Scene} scene The scene the primitives will be rendered in.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n * @param {PrimitiveCollection} [primitives=scene.primitives] A collection to add primitives related to the entities\n * @param {PrimitiveCollection} [groundPrimitives=scene.groundPrimitives] A collection to add ground primitives related to the entities\n */\nfunction GeometryVisualizer(\n  scene,\n  entityCollection,\n  primitives,\n  groundPrimitives\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"scene\", scene);\n  Check.defined(\"entityCollection\", entityCollection);\n  //>>includeEnd('debug');\n\n  primitives = defaultValue(primitives, scene.primitives);\n  groundPrimitives = defaultValue(groundPrimitives, scene.groundPrimitives);\n\n  this._scene = scene;\n  this._primitives = primitives;\n  this._groundPrimitives = groundPrimitives;\n  this._entityCollection = undefined;\n  this._addedObjects = new AssociativeArray();\n  this._removedObjects = new AssociativeArray();\n  this._changedObjects = new AssociativeArray();\n\n  const numberOfShadowModes = ShadowMode.NUMBER_OF_SHADOW_MODES;\n  this._outlineBatches = new Array(numberOfShadowModes * 2);\n  this._closedColorBatches = new Array(numberOfShadowModes * 2);\n  this._closedMaterialBatches = new Array(numberOfShadowModes * 2);\n  this._openColorBatches = new Array(numberOfShadowModes * 2);\n  this._openMaterialBatches = new Array(numberOfShadowModes * 2);\n\n  const supportsMaterialsforEntitiesOnTerrain = Entity.supportsMaterialsforEntitiesOnTerrain(\n    scene\n  );\n  this._supportsMaterialsforEntitiesOnTerrain = supportsMaterialsforEntitiesOnTerrain;\n\n  let i;\n  for (i = 0; i < numberOfShadowModes; ++i) {\n    this._outlineBatches[i] = new StaticOutlineGeometryBatch(\n      primitives,\n      scene,\n      i,\n      false\n    );\n    this._outlineBatches[\n      numberOfShadowModes + i\n    ] = new StaticOutlineGeometryBatch(primitives, scene, i, true);\n\n    this._closedColorBatches[i] = new StaticGeometryColorBatch(\n      primitives,\n      PerInstanceColorAppearance,\n      undefined,\n      true,\n      i,\n      true\n    );\n    this._closedColorBatches[\n      numberOfShadowModes + i\n    ] = new StaticGeometryColorBatch(\n      primitives,\n      PerInstanceColorAppearance,\n      undefined,\n      true,\n      i,\n      false\n    );\n\n    this._closedMaterialBatches[i] = new StaticGeometryPerMaterialBatch(\n      primitives,\n      MaterialAppearance,\n      undefined,\n      true,\n      i,\n      true\n    );\n    this._closedMaterialBatches[\n      numberOfShadowModes + i\n    ] = new StaticGeometryPerMaterialBatch(\n      primitives,\n      MaterialAppearance,\n      undefined,\n      true,\n      i,\n      false\n    );\n\n    this._openColorBatches[i] = new StaticGeometryColorBatch(\n      primitives,\n      PerInstanceColorAppearance,\n      undefined,\n      false,\n      i,\n      true\n    );\n    this._openColorBatches[\n      numberOfShadowModes + i\n    ] = new StaticGeometryColorBatch(\n      primitives,\n      PerInstanceColorAppearance,\n      undefined,\n      false,\n      i,\n      false\n    );\n\n    this._openMaterialBatches[i] = new StaticGeometryPerMaterialBatch(\n      primitives,\n      MaterialAppearance,\n      undefined,\n      false,\n      i,\n      true\n    );\n    this._openMaterialBatches[\n      numberOfShadowModes + i\n    ] = new StaticGeometryPerMaterialBatch(\n      primitives,\n      MaterialAppearance,\n      undefined,\n      false,\n      i,\n      false\n    );\n  }\n\n  const numberOfClassificationTypes =\n    ClassificationType.NUMBER_OF_CLASSIFICATION_TYPES;\n  const groundColorBatches = new Array(numberOfClassificationTypes);\n  const groundMaterialBatches = [];\n  if (supportsMaterialsforEntitiesOnTerrain) {\n    for (i = 0; i < numberOfClassificationTypes; ++i) {\n      groundMaterialBatches.push(\n        new StaticGroundGeometryPerMaterialBatch(\n          groundPrimitives,\n          i,\n          MaterialAppearance\n        )\n      );\n      groundColorBatches[i] = new StaticGroundGeometryColorBatch(\n        groundPrimitives,\n        i\n      );\n    }\n  } else {\n    for (i = 0; i < numberOfClassificationTypes; ++i) {\n      groundColorBatches[i] = new StaticGroundGeometryColorBatch(\n        groundPrimitives,\n        i\n      );\n    }\n  }\n\n  this._groundColorBatches = groundColorBatches;\n  this._groundMaterialBatches = groundMaterialBatches;\n\n  this._dynamicBatch = new DynamicGeometryBatch(primitives, groundPrimitives);\n\n  this._batches = this._outlineBatches.concat(\n    this._closedColorBatches,\n    this._closedMaterialBatches,\n    this._openColorBatches,\n    this._openMaterialBatches,\n    this._groundColorBatches,\n    this._groundMaterialBatches,\n    this._dynamicBatch\n  );\n\n  this._subscriptions = new AssociativeArray();\n  this._updaterSets = new AssociativeArray();\n\n  this._entityCollection = entityCollection;\n  entityCollection.collectionChanged.addEventListener(\n    GeometryVisualizer.prototype._onCollectionChanged,\n    this\n  );\n  this._onCollectionChanged(\n    entityCollection,\n    entityCollection.values,\n    emptyArray\n  );\n}\n\n/**\n * Updates all of the primitives created by this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {boolean} True if the visualizer successfully updated to the provided time,\n * false if the visualizer is waiting for asynchronous primitives to be created.\n */\nGeometryVisualizer.prototype.update = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n  //>>includeEnd('debug');\n\n  const addedObjects = this._addedObjects;\n  const added = addedObjects.values;\n  const removedObjects = this._removedObjects;\n  const removed = removedObjects.values;\n  const changedObjects = this._changedObjects;\n  const changed = changedObjects.values;\n\n  let i;\n  let entity;\n  let id;\n  let updaterSet;\n  const that = this;\n\n  for (i = changed.length - 1; i > -1; i--) {\n    entity = changed[i];\n    id = entity.id;\n    updaterSet = this._updaterSets.get(id);\n\n    //If in a single update, an entity gets removed and a new instance\n    //re-added with the same id, the updater no longer tracks the\n    //correct entity, we need to both remove the old one and\n    //add the new one, which is done by pushing the entity\n    //onto the removed/added lists.\n    if (updaterSet.entity === entity) {\n      updaterSet.forEach(function (updater) {\n        that._removeUpdater(updater);\n        that._insertUpdaterIntoBatch(time, updater);\n      });\n    } else {\n      removed.push(entity);\n      added.push(entity);\n    }\n  }\n\n  for (i = removed.length - 1; i > -1; i--) {\n    entity = removed[i];\n    id = entity.id;\n    updaterSet = this._updaterSets.get(id);\n    updaterSet.forEach(this._removeUpdater.bind(this));\n    updaterSet.destroy();\n    this._updaterSets.remove(id);\n    this._subscriptions.get(id)();\n    this._subscriptions.remove(id);\n  }\n\n  for (i = added.length - 1; i > -1; i--) {\n    entity = added[i];\n    id = entity.id;\n    updaterSet = new GeometryUpdaterSet(entity, this._scene);\n    this._updaterSets.set(id, updaterSet);\n    updaterSet.forEach(function (updater) {\n      that._insertUpdaterIntoBatch(time, updater);\n    });\n    this._subscriptions.set(\n      id,\n      updaterSet.geometryChanged.addEventListener(\n        GeometryVisualizer._onGeometryChanged,\n        this\n      )\n    );\n  }\n\n  addedObjects.removeAll();\n  removedObjects.removeAll();\n  changedObjects.removeAll();\n\n  let isUpdated = true;\n  const batches = this._batches;\n  const length = batches.length;\n  for (i = 0; i < length; i++) {\n    isUpdated = batches[i].update(time) && isUpdated;\n  }\n\n  return isUpdated;\n};\n\nconst getBoundingSphereArrayScratch = [];\nconst getBoundingSphereBoundingSphereScratch = new BoundingSphere();\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n *                       BoundingSphereState.PENDING if the result is still being computed, or\n *                       BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nGeometryVisualizer.prototype.getBoundingSphere = function (entity, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"entity\", entity);\n  Check.defined(\"result\", result);\n  //>>includeEnd('debug');\n\n  const boundingSpheres = getBoundingSphereArrayScratch;\n  const tmp = getBoundingSphereBoundingSphereScratch;\n\n  let count = 0;\n  let state = BoundingSphereState.DONE;\n  const batches = this._batches;\n  const batchesLength = batches.length;\n\n  const id = entity.id;\n  const updaters = this._updaterSets.get(id).updaters;\n\n  for (let j = 0; j < updaters.length; j++) {\n    const updater = updaters[j];\n    for (let i = 0; i < batchesLength; i++) {\n      state = batches[i].getBoundingSphere(updater, tmp);\n      if (state === BoundingSphereState.PENDING) {\n        return BoundingSphereState.PENDING;\n      } else if (state === BoundingSphereState.DONE) {\n        boundingSpheres[count] = BoundingSphere.clone(\n          tmp,\n          boundingSpheres[count]\n        );\n        count++;\n      }\n    }\n  }\n\n  if (count === 0) {\n    return BoundingSphereState.FAILED;\n  }\n\n  boundingSpheres.length = count;\n  BoundingSphere.fromBoundingSpheres(boundingSpheres, result);\n  return BoundingSphereState.DONE;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n */\nGeometryVisualizer.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nGeometryVisualizer.prototype.destroy = function () {\n  this._entityCollection.collectionChanged.removeEventListener(\n    GeometryVisualizer.prototype._onCollectionChanged,\n    this\n  );\n  this._addedObjects.removeAll();\n  this._removedObjects.removeAll();\n\n  let i;\n  const batches = this._batches;\n  let length = batches.length;\n  for (i = 0; i < length; i++) {\n    batches[i].removeAllPrimitives();\n  }\n\n  const subscriptions = this._subscriptions.values;\n  length = subscriptions.length;\n  for (i = 0; i < length; i++) {\n    subscriptions[i]();\n  }\n  this._subscriptions.removeAll();\n\n  const updaterSets = this._updaterSets.values;\n  length = updaterSets.length;\n  for (i = 0; i < length; i++) {\n    updaterSets[i].destroy();\n  }\n  this._updaterSets.removeAll();\n  return destroyObject(this);\n};\n\n/**\n * @private\n */\nGeometryVisualizer.prototype._removeUpdater = function (updater) {\n  //We don't keep track of which batch an updater is in, so just remove it from all of them.\n  const batches = this._batches;\n  const length = batches.length;\n  for (let i = 0; i < length; i++) {\n    batches[i].remove(updater);\n  }\n};\n\n/**\n * @private\n */\nGeometryVisualizer.prototype._insertUpdaterIntoBatch = function (\n  time,\n  updater\n) {\n  if (updater.isDynamic) {\n    this._dynamicBatch.add(time, updater);\n    return;\n  }\n\n  let shadows;\n  if (updater.outlineEnabled || updater.fillEnabled) {\n    shadows = updater.shadowsProperty.getValue(time);\n  }\n\n  const numberOfShadowModes = ShadowMode.NUMBER_OF_SHADOW_MODES;\n  if (updater.outlineEnabled) {\n    if (defined(updater.terrainOffsetProperty)) {\n      this._outlineBatches[numberOfShadowModes + shadows].add(time, updater);\n    } else {\n      this._outlineBatches[shadows].add(time, updater);\n    }\n  }\n\n  if (updater.fillEnabled) {\n    if (updater.onTerrain) {\n      const classificationType = updater.classificationTypeProperty.getValue(\n        time\n      );\n      if (updater.fillMaterialProperty instanceof ColorMaterialProperty) {\n        this._groundColorBatches[classificationType].add(time, updater);\n      } else {\n        // If unsupported, updater will not be on terrain.\n        this._groundMaterialBatches[classificationType].add(time, updater);\n      }\n    } else if (updater.isClosed) {\n      if (updater.fillMaterialProperty instanceof ColorMaterialProperty) {\n        if (defined(updater.terrainOffsetProperty)) {\n          this._closedColorBatches[numberOfShadowModes + shadows].add(\n            time,\n            updater\n          );\n        } else {\n          this._closedColorBatches[shadows].add(time, updater);\n        }\n      } else if (defined(updater.terrainOffsetProperty)) {\n        this._closedMaterialBatches[numberOfShadowModes + shadows].add(\n          time,\n          updater\n        );\n      } else {\n        this._closedMaterialBatches[shadows].add(time, updater);\n      }\n    } else if (updater.fillMaterialProperty instanceof ColorMaterialProperty) {\n      if (defined(updater.terrainOffsetProperty)) {\n        this._openColorBatches[numberOfShadowModes + shadows].add(\n          time,\n          updater\n        );\n      } else {\n        this._openColorBatches[shadows].add(time, updater);\n      }\n    } else if (defined(updater.terrainOffsetProperty)) {\n      this._openMaterialBatches[numberOfShadowModes + shadows].add(\n        time,\n        updater\n      );\n    } else {\n      this._openMaterialBatches[shadows].add(time, updater);\n    }\n  }\n};\n\n/**\n * @private\n */\nGeometryVisualizer._onGeometryChanged = function (updater) {\n  const removedObjects = this._removedObjects;\n  const changedObjects = this._changedObjects;\n\n  const entity = updater.entity;\n  const id = entity.id;\n\n  if (!defined(removedObjects.get(id)) && !defined(changedObjects.get(id))) {\n    changedObjects.set(id, entity);\n  }\n};\n\n/**\n * @private\n */\nGeometryVisualizer.prototype._onCollectionChanged = function (\n  entityCollection,\n  added,\n  removed\n) {\n  const addedObjects = this._addedObjects;\n  const removedObjects = this._removedObjects;\n  const changedObjects = this._changedObjects;\n\n  let i;\n  let id;\n  let entity;\n  for (i = removed.length - 1; i > -1; i--) {\n    entity = removed[i];\n    id = entity.id;\n    if (!addedObjects.remove(id)) {\n      removedObjects.set(id, entity);\n      changedObjects.remove(id);\n    }\n  }\n\n  for (i = added.length - 1; i > -1; i--) {\n    entity = added[i];\n    id = entity.id;\n    if (removedObjects.remove(id)) {\n      changedObjects.set(id, entity);\n    } else {\n      addedObjects.set(id, entity);\n    }\n  }\n};\nexport default GeometryVisualizer;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport HorizontalOrigin from \"../Scene/HorizontalOrigin.js\";\nimport LabelStyle from \"../Scene/LabelStyle.js\";\nimport VerticalOrigin from \"../Scene/VerticalOrigin.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport Property from \"./Property.js\";\n\nconst defaultScale = 1.0;\nconst defaultFont = \"30px sans-serif\";\nconst defaultStyle = LabelStyle.FILL;\nconst defaultFillColor = Color.WHITE;\nconst defaultOutlineColor = Color.BLACK;\nconst defaultOutlineWidth = 1.0;\nconst defaultShowBackground = false;\nconst defaultBackgroundColor = new Color(0.165, 0.165, 0.165, 0.8);\nconst defaultBackgroundPadding = new Cartesian2(7, 5);\nconst defaultPixelOffset = Cartesian2.ZERO;\nconst defaultEyeOffset = Cartesian3.ZERO;\nconst defaultHeightReference = HeightReference.NONE;\nconst defaultHorizontalOrigin = HorizontalOrigin.CENTER;\nconst defaultVerticalOrigin = VerticalOrigin.CENTER;\n\nconst positionScratch = new Cartesian3();\nconst fillColorScratch = new Color();\nconst outlineColorScratch = new Color();\nconst backgroundColorScratch = new Color();\nconst backgroundPaddingScratch = new Cartesian2();\nconst eyeOffsetScratch = new Cartesian3();\nconst pixelOffsetScratch = new Cartesian2();\nconst translucencyByDistanceScratch = new NearFarScalar();\nconst pixelOffsetScaleByDistanceScratch = new NearFarScalar();\nconst scaleByDistanceScratch = new NearFarScalar();\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\n\nfunction EntityData(entity) {\n  this.entity = entity;\n  this.label = undefined;\n  this.index = undefined;\n}\n\n/**\n * A {@link Visualizer} which maps the {@link LabelGraphics} instance\n * in {@link Entity#label} to a {@link Label}.\n * @alias LabelVisualizer\n * @constructor\n *\n * @param {EntityCluster} entityCluster The entity cluster to manage the collection of billboards and optionally cluster with other entities.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n */\nfunction LabelVisualizer(entityCluster, entityCollection) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(entityCluster)) {\n    throw new DeveloperError(\"entityCluster is required.\");\n  }\n  if (!defined(entityCollection)) {\n    throw new DeveloperError(\"entityCollection is required.\");\n  }\n  //>>includeEnd('debug');\n\n  entityCollection.collectionChanged.addEventListener(\n    LabelVisualizer.prototype._onCollectionChanged,\n    this\n  );\n\n  this._cluster = entityCluster;\n  this._entityCollection = entityCollection;\n  this._items = new AssociativeArray();\n\n  this._onCollectionChanged(entityCollection, entityCollection.values, [], []);\n}\n\n/**\n * Updates the primitives created by this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {boolean} This function always returns true.\n */\nLabelVisualizer.prototype.update = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const items = this._items.values;\n  const cluster = this._cluster;\n\n  for (let i = 0, len = items.length; i < len; i++) {\n    const item = items[i];\n    const entity = item.entity;\n    const labelGraphics = entity._label;\n    let text;\n    let label = item.label;\n    let show =\n      entity.isShowing &&\n      entity.isAvailable(time) &&\n      Property.getValueOrDefault(labelGraphics._show, time, true);\n    let position;\n    if (show) {\n      position = Property.getValueOrUndefined(\n        entity._position,\n        time,\n        positionScratch\n      );\n      text = Property.getValueOrUndefined(labelGraphics._text, time);\n      show = defined(position) && defined(text);\n    }\n\n    if (!show) {\n      //don't bother creating or updating anything else\n      returnPrimitive(item, entity, cluster);\n      continue;\n    }\n\n    if (!Property.isConstant(entity._position)) {\n      cluster._clusterDirty = true;\n    }\n\n    let updateClamping = false;\n    const heightReference = Property.getValueOrDefault(\n      labelGraphics._heightReference,\n      time,\n      defaultHeightReference\n    );\n\n    if (!defined(label)) {\n      label = cluster.getLabel(entity);\n      label.id = entity;\n      item.label = label;\n\n      // If this new label happens to have a position and height reference that match our new values,\n      // label._updateClamping will not be called automatically. That's a problem because the clamped\n      // height may be based on different terrain than is now loaded. So we'll manually call\n      // _updateClamping below.\n      updateClamping =\n        Cartesian3.equals(label.position, position) &&\n        label.heightReference === heightReference;\n    }\n\n    label.show = true;\n    label.position = position;\n    label.text = text;\n    label.scale = Property.getValueOrDefault(\n      labelGraphics._scale,\n      time,\n      defaultScale\n    );\n    label.font = Property.getValueOrDefault(\n      labelGraphics._font,\n      time,\n      defaultFont\n    );\n    label.style = Property.getValueOrDefault(\n      labelGraphics._style,\n      time,\n      defaultStyle\n    );\n    label.fillColor = Property.getValueOrDefault(\n      labelGraphics._fillColor,\n      time,\n      defaultFillColor,\n      fillColorScratch\n    );\n    label.outlineColor = Property.getValueOrDefault(\n      labelGraphics._outlineColor,\n      time,\n      defaultOutlineColor,\n      outlineColorScratch\n    );\n    label.outlineWidth = Property.getValueOrDefault(\n      labelGraphics._outlineWidth,\n      time,\n      defaultOutlineWidth\n    );\n    label.showBackground = Property.getValueOrDefault(\n      labelGraphics._showBackground,\n      time,\n      defaultShowBackground\n    );\n    label.backgroundColor = Property.getValueOrDefault(\n      labelGraphics._backgroundColor,\n      time,\n      defaultBackgroundColor,\n      backgroundColorScratch\n    );\n    label.backgroundPadding = Property.getValueOrDefault(\n      labelGraphics._backgroundPadding,\n      time,\n      defaultBackgroundPadding,\n      backgroundPaddingScratch\n    );\n    label.pixelOffset = Property.getValueOrDefault(\n      labelGraphics._pixelOffset,\n      time,\n      defaultPixelOffset,\n      pixelOffsetScratch\n    );\n    label.eyeOffset = Property.getValueOrDefault(\n      labelGraphics._eyeOffset,\n      time,\n      defaultEyeOffset,\n      eyeOffsetScratch\n    );\n    label.heightReference = heightReference;\n    label.horizontalOrigin = Property.getValueOrDefault(\n      labelGraphics._horizontalOrigin,\n      time,\n      defaultHorizontalOrigin\n    );\n    label.verticalOrigin = Property.getValueOrDefault(\n      labelGraphics._verticalOrigin,\n      time,\n      defaultVerticalOrigin\n    );\n    label.translucencyByDistance = Property.getValueOrUndefined(\n      labelGraphics._translucencyByDistance,\n      time,\n      translucencyByDistanceScratch\n    );\n    label.pixelOffsetScaleByDistance = Property.getValueOrUndefined(\n      labelGraphics._pixelOffsetScaleByDistance,\n      time,\n      pixelOffsetScaleByDistanceScratch\n    );\n    label.scaleByDistance = Property.getValueOrUndefined(\n      labelGraphics._scaleByDistance,\n      time,\n      scaleByDistanceScratch\n    );\n    label.distanceDisplayCondition = Property.getValueOrUndefined(\n      labelGraphics._distanceDisplayCondition,\n      time,\n      distanceDisplayConditionScratch\n    );\n    label.disableDepthTestDistance = Property.getValueOrUndefined(\n      labelGraphics._disableDepthTestDistance,\n      time\n    );\n\n    if (updateClamping) {\n      label._updateClamping();\n    }\n  }\n  return true;\n};\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n *                       BoundingSphereState.PENDING if the result is still being computed, or\n *                       BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nLabelVisualizer.prototype.getBoundingSphere = function (entity, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(entity)) {\n    throw new DeveloperError(\"entity is required.\");\n  }\n  if (!defined(result)) {\n    throw new DeveloperError(\"result is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const item = this._items.get(entity.id);\n  if (!defined(item) || !defined(item.label)) {\n    return BoundingSphereState.FAILED;\n  }\n\n  const label = item.label;\n  result.center = Cartesian3.clone(\n    defaultValue(label._clampedPosition, label.position),\n    result.center\n  );\n  result.radius = 0;\n  return BoundingSphereState.DONE;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n */\nLabelVisualizer.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nLabelVisualizer.prototype.destroy = function () {\n  this._entityCollection.collectionChanged.removeEventListener(\n    LabelVisualizer.prototype._onCollectionChanged,\n    this\n  );\n  const entities = this._entityCollection.values;\n  for (let i = 0; i < entities.length; i++) {\n    this._cluster.removeLabel(entities[i]);\n  }\n  return destroyObject(this);\n};\n\nLabelVisualizer.prototype._onCollectionChanged = function (\n  entityCollection,\n  added,\n  removed,\n  changed\n) {\n  let i;\n  let entity;\n  const items = this._items;\n  const cluster = this._cluster;\n\n  for (i = added.length - 1; i > -1; i--) {\n    entity = added[i];\n    if (defined(entity._label) && defined(entity._position)) {\n      items.set(entity.id, new EntityData(entity));\n    }\n  }\n\n  for (i = changed.length - 1; i > -1; i--) {\n    entity = changed[i];\n    if (defined(entity._label) && defined(entity._position)) {\n      if (!items.contains(entity.id)) {\n        items.set(entity.id, new EntityData(entity));\n      }\n    } else {\n      returnPrimitive(items.get(entity.id), entity, cluster);\n      items.remove(entity.id);\n    }\n  }\n\n  for (i = removed.length - 1; i > -1; i--) {\n    entity = removed[i];\n    returnPrimitive(items.get(entity.id), entity, cluster);\n    items.remove(entity.id);\n  }\n};\n\nfunction returnPrimitive(item, entity, cluster) {\n  if (defined(item)) {\n    item.label = undefined;\n    cluster.removeLabel(entity);\n  }\n}\nexport default LabelVisualizer;\n", "import Check from \"./Check.js\";\nimport defined from \"./defined.js\";\n\n/**\n * Initiates a terrain height query for an array of {@link Cartographic} positions by\n * requesting tiles from a terrain provider, sampling, and interpolating.  The interpolation\n * matches the triangles used to render the terrain at the specified level.  The query\n * happens asynchronously, so this function returns a promise that is resolved when\n * the query completes.  Each point height is modified in place.  If a height can not be\n * determined because no terrain data is available for the specified level at that location,\n * or another error occurs, the height is set to undefined.  As is typical of the\n * {@link Cartographic} type, the supplied height is a height above the reference ellipsoid\n * (such as {@link Ellipsoid.WGS84}) rather than an altitude above mean sea level.  In other\n * words, it will not necessarily be 0.0 if sampled in the ocean. This function needs the\n * terrain level of detail as input, if you need to get the altitude of the terrain as precisely\n * as possible (i.e. with maximum level of detail) use {@link sampleTerrainMostDetailed}.\n *\n * @function sampleTerrain\n *\n * @param {TerrainProvider} terrainProvider The terrain provider from which to query heights.\n * @param {number} level The terrain level-of-detail from which to query terrain heights.\n * @param {Cartographic[]} positions The positions to update with terrain heights.\n * @param {boolean} [rejectOnTileFail=false] If true, for a failed terrain tile request the promise will be rejected. If false, returned heights will be undefined.\n * @returns {Promise<Cartographic[]>} A promise that resolves to the provided list of positions when terrain the query has completed.\n *\n * @see sampleTerrainMostDetailed\n *\n * @example\n * // Query the terrain height of two Cartographic positions\n * const terrainProvider = await Cesium.createWorldTerrainAsync();\n * const positions = [\n *     Cesium.Cartographic.fromDegrees(86.925145, 27.988257),\n *     Cesium.Cartographic.fromDegrees(87.0, 28.0)\n * ];\n * const updatedPositions = await Cesium.sampleTerrain(terrainProvider, 11, positions);\n * // positions[0].height and positions[1].height have been updated.\n * // updatedPositions is just a reference to positions.\n *\n * // To handle tile errors, pass true for the rejectOnTileFail parameter.\n * try {\n *    const updatedPositions = await Cesium.sampleTerrain(terrainProvider, 11, positions, true);\n * } catch (error) {\n *   // A tile request error occurred.\n * }\n */\nasync function sampleTerrain(\n  terrainProvider,\n  level,\n  positions,\n  rejectOnTileFail\n) {\n  if (!defined(rejectOnTileFail)) {\n    rejectOnTileFail = false;\n  }\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"terrainProvider\", terrainProvider);\n  Check.typeOf.number(\"level\", level);\n  Check.typeOf.bool(\"rejectOnTileFail\", rejectOnTileFail);\n  Check.defined(\"positions\", positions);\n  //>>includeEnd('debug');\n\n  return doSampling(terrainProvider, level, positions, rejectOnTileFail);\n}\n\n/**\n * @param {object[]} tileRequests The mutated list of requests, the first one will be attempted\n * @param {Array<Promise<void>>} results The list to put the result promises into\n * @param {boolean} rejectOnTileFail If true, the promise will be rejected.  If false, returned heights will be undefined.\n * @returns {boolean} true if the request was made, and we are okay to attempt the next item immediately,\n *  or false if we were throttled and should wait awhile before retrying.\n *\n * @private\n */\nfunction attemptConsumeNextQueueItem(tileRequests, results, rejectOnTileFail) {\n  const tileRequest = tileRequests[0];\n  const requestPromise = tileRequest.terrainProvider.requestTileGeometry(\n    tileRequest.x,\n    tileRequest.y,\n    tileRequest.level\n  );\n\n  if (!requestPromise) {\n    // getting back undefined instead of a promise indicates we should retry a bit later\n    return false;\n  }\n\n  let promise;\n\n  if (rejectOnTileFail) {\n    promise = requestPromise.then(createInterpolateFunction(tileRequest));\n  } else {\n    promise = requestPromise\n      .then(createInterpolateFunction(tileRequest))\n      .catch(createMarkFailedFunction(tileRequest));\n  }\n\n  // remove the request we've just done from the queue\n  //  and add its promise result to the result list\n  tileRequests.shift();\n  results.push(promise);\n\n  // indicate we should synchronously attempt the next request as well\n  return true;\n}\n\n/**\n * Wrap window.setTimeout in a Promise\n * @param {number} ms\n * @private\n */\nfunction delay(ms) {\n  return new Promise(function (res) {\n    setTimeout(res, ms);\n  });\n}\n\n/**\n * Recursively consumes all the tileRequests until the list has been emptied\n *  and a Promise of each result has been put into the results list\n * @param {object[]} tileRequests The list of requests desired to be made\n * @param {Array<Promise<void>>} results The list to put all the result promises into\n * @param {boolean} rejectOnTileFail If true, the promise will be rejected.  If false, returned heights will be undefined.\n * @returns {Promise<void>} A promise which resolves once all requests have been started\n *\n * @private\n */\nfunction drainTileRequestQueue(tileRequests, results, rejectOnTileFail) {\n  // nothing left to do\n  if (!tileRequests.length) {\n    return Promise.resolve();\n  }\n\n  // consume an item from the queue, which will\n  //  mutate the request and result lists, and return true if we should\n  //  immediately attempt to consume the next item as well\n  const success = attemptConsumeNextQueueItem(\n    tileRequests,\n    results,\n    rejectOnTileFail\n  );\n  if (success) {\n    return drainTileRequestQueue(tileRequests, results);\n  }\n\n  // wait a small fixed amount of time first, before retrying the same request again\n  return delay(100).then(() => {\n    return drainTileRequestQueue(tileRequests, results);\n  });\n}\n\nfunction doSampling(terrainProvider, level, positions, rejectOnTileFail) {\n  const tilingScheme = terrainProvider.tilingScheme;\n\n  let i;\n\n  // Sort points into a set of tiles\n  const tileRequests = []; // Result will be an Array as it's easier to work with\n  const tileRequestSet = {}; // A unique set\n  for (i = 0; i < positions.length; ++i) {\n    const xy = tilingScheme.positionToTileXY(positions[i], level);\n    if (!defined(xy)) {\n      continue;\n    }\n\n    const key = xy.toString();\n\n    if (!tileRequestSet.hasOwnProperty(key)) {\n      // When tile is requested for the first time\n      const value = {\n        x: xy.x,\n        y: xy.y,\n        level: level,\n        tilingScheme: tilingScheme,\n        terrainProvider: terrainProvider,\n        positions: [],\n      };\n      tileRequestSet[key] = value;\n      tileRequests.push(value);\n    }\n\n    // Now append to array of points for the tile\n    tileRequestSet[key].positions.push(positions[i]);\n  }\n\n  // create our list of result promises to be filled\n  const tilePromises = [];\n  return drainTileRequestQueue(\n    tileRequests,\n    tilePromises,\n    rejectOnTileFail\n  ).then(function () {\n    // now all the required requests have been started\n    //  we just wait for them all to finish\n    return Promise.all(tilePromises).then(function () {\n      return positions;\n    });\n  });\n}\n\n/**\n * Calls {@link TerrainData#interpolateHeight} on a given {@link TerrainData} for a given {@link Cartographic} and\n *  will assign the height property if the return value is not undefined.\n *\n * If the return value is false; it's suggesting that you should call {@link TerrainData#createMesh} first.\n * @param {Cartographic} position The position to interpolate for and assign the height value to\n * @param {TerrainData} terrainData\n * @param {Rectangle} rectangle\n * @returns {boolean} If the height was actually interpolated and assigned\n * @private\n */\nfunction interpolateAndAssignHeight(position, terrainData, rectangle) {\n  const height = terrainData.interpolateHeight(\n    rectangle,\n    position.longitude,\n    position.latitude\n  );\n  if (height === undefined) {\n    // if height comes back as undefined, it may implicitly mean the terrain data\n    //  requires us to call TerrainData.createMesh() first (ArcGIS requires this in particular)\n    //  so we'll return false and do that next!\n    return false;\n  }\n  position.height = height;\n  return true;\n}\n\nfunction createInterpolateFunction(tileRequest) {\n  const tilePositions = tileRequest.positions;\n  const rectangle = tileRequest.tilingScheme.tileXYToRectangle(\n    tileRequest.x,\n    tileRequest.y,\n    tileRequest.level\n  );\n  return function (terrainData) {\n    let isMeshRequired = false;\n    for (let i = 0; i < tilePositions.length; ++i) {\n      const position = tilePositions[i];\n      const isHeightAssigned = interpolateAndAssignHeight(\n        position,\n        terrainData,\n        rectangle\n      );\n      // we've found a position which returned undefined - hinting to us\n      //  that we probably need to create a mesh for this terrain data.\n      // so break out of this loop and create the mesh - then we'll interpolate all the heights again\n      if (!isHeightAssigned) {\n        isMeshRequired = true;\n        break;\n      }\n    }\n\n    if (!isMeshRequired) {\n      // all position heights were interpolated - we don't need the mesh\n      return Promise.resolve();\n    }\n\n    // create the mesh - and interpolate all the positions again\n    // note: terrain exaggeration is not passed in - we are only interested in the raw data\n    return terrainData\n      .createMesh({\n        tilingScheme: tileRequest.tilingScheme,\n        x: tileRequest.x,\n        y: tileRequest.y,\n        level: tileRequest.level,\n        // don't throttle this mesh creation because we've asked to sample these points;\n        //  so sample them! We don't care how many tiles that is!\n        throttle: false,\n      })\n      .then(function () {\n        // mesh has been created - so go through every position (maybe again)\n        //  and re-interpolate the heights - presumably using the mesh this time\n        for (let i = 0; i < tilePositions.length; ++i) {\n          const position = tilePositions[i];\n          // if it doesn't work this time - that's fine, we tried.\n          interpolateAndAssignHeight(position, terrainData, rectangle);\n        }\n      });\n  };\n}\n\nfunction createMarkFailedFunction(tileRequest) {\n  const tilePositions = tileRequest.positions;\n  return function () {\n    for (let i = 0; i < tilePositions.length; ++i) {\n      const position = tilePositions[i];\n      position.height = undefined;\n    }\n  };\n}\n\nexport default sampleTerrain;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport sampleTerrain from \"./sampleTerrain.js\";\n\nconst scratchCartesian2 = new Cartesian2();\n\n/**\n * Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset.\n *\n * @function sampleTerrainMostDetailed\n *\n * @param {TerrainProvider} terrainProvider The terrain provider from which to query heights.\n * @param {Cartographic[]} positions The positions to update with terrain heights.\n * @param {boolean} [rejectOnTileFail=false] If true, for a failed terrain tile request the promise will be rejected. If false, returned heights will be undefined.\n * @returns {Promise<Cartographic[]>} A promise that resolves to the provided list of positions when terrain the query has completed.  This\n *                                     promise will reject if the terrain provider's `availability` property is undefined.\n *\n * @example\n * // Query the terrain height of two Cartographic positions\n * const terrainProvider = await Cesium.createWorldTerrainAsync();\n * const positions = [\n *     Cesium.Cartographic.fromDegrees(86.925145, 27.988257),\n *     Cesium.Cartographic.fromDegrees(87.0, 28.0)\n * ];\n * const updatedPositions = await Cesium.sampleTerrainMostDetailed(terrainProvider, positions);\n * // positions[0].height and positions[1].height have been updated.\n * // updatedPositions is just a reference to positions.\n *\n * // To handle tile errors, pass true for the rejectOnTileFail parameter.\n * try {\n *    const updatedPositions = await Cesium.sampleTerrainMostDetailed(terrainProvider, positions, true);\n * } catch (error) {\n *   // A tile request error occurred.\n * }\n */\nasync function sampleTerrainMostDetailed(\n  terrainProvider,\n  positions,\n  rejectOnTileFail\n) {\n  if (!defined(rejectOnTileFail)) {\n    rejectOnTileFail = false;\n  }\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(terrainProvider)) {\n    throw new DeveloperError(\"terrainProvider is required.\");\n  }\n  if (!defined(positions)) {\n    throw new DeveloperError(\"positions is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const byLevel = [];\n  const maxLevels = [];\n\n  const availability = terrainProvider.availability;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(availability)) {\n    throw new DeveloperError(\n      \"sampleTerrainMostDetailed requires a terrain provider that has tile availability.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const promises = [];\n  for (let i = 0; i < positions.length; ++i) {\n    const position = positions[i];\n    const maxLevel = availability.computeMaximumLevelAtPosition(position);\n    maxLevels[i] = maxLevel;\n    if (maxLevel === 0) {\n      // This is a special case where we have a parent terrain and we are requesting\n      // heights from an area that isn't covered by the top level terrain at all.\n      // This will essentially trigger the loading of the parent terrains root tile\n      terrainProvider.tilingScheme.positionToTileXY(\n        position,\n        1,\n        scratchCartesian2\n      );\n      const promise = terrainProvider.loadTileDataAvailability(\n        scratchCartesian2.x,\n        scratchCartesian2.y,\n        1\n      );\n      if (defined(promise)) {\n        promises.push(promise);\n      }\n    }\n\n    let atLevel = byLevel[maxLevel];\n    if (!defined(atLevel)) {\n      byLevel[maxLevel] = atLevel = [];\n    }\n    atLevel.push(position);\n  }\n\n  await Promise.all(promises);\n  await Promise.all(\n    byLevel.map(function (positionsAtLevel, index) {\n      if (defined(positionsAtLevel)) {\n        return sampleTerrain(\n          terrainProvider,\n          index,\n          positionsAtLevel,\n          rejectOnTileFail\n        );\n      }\n    })\n  );\n  const changedPositions = [];\n  for (let i = 0; i < positions.length; ++i) {\n    const position = positions[i];\n    const maxLevel = availability.computeMaximumLevelAtPosition(position);\n\n    if (maxLevel !== maxLevels[i]) {\n      // Now that we loaded the max availability, a higher level has become available\n      changedPositions.push(position);\n    }\n  }\n\n  if (changedPositions.length > 0) {\n    await sampleTerrainMostDetailed(\n      terrainProvider,\n      changedPositions,\n      rejectOnTileFail\n    );\n  }\n\n  return positions;\n}\nexport default sampleTerrainMostDetailed;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Resource from \"../Core/Resource.js\";\nimport ColorBlendMode from \"../Scene/ColorBlendMode.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport Model from \"../Scene/Model/Model.js\";\nimport ModelAnimationLoop from \"../Scene/ModelAnimationLoop.js\";\nimport ShadowMode from \"../Scene/ShadowMode.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport Property from \"./Property.js\";\nimport sampleTerrainMostDetailed from \"../Core/sampleTerrainMostDetailed.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\n\nconst defaultScale = 1.0;\nconst defaultMinimumPixelSize = 0.0;\nconst defaultIncrementallyLoadTextures = true;\nconst defaultClampAnimations = true;\nconst defaultShadows = ShadowMode.ENABLED;\nconst defaultHeightReference = HeightReference.NONE;\nconst defaultSilhouetteColor = Color.RED;\nconst defaultSilhouetteSize = 0.0;\nconst defaultColor = Color.WHITE;\nconst defaultColorBlendMode = ColorBlendMode.HIGHLIGHT;\nconst defaultColorBlendAmount = 0.5;\nconst defaultImageBasedLightingFactor = new Cartesian2(1.0, 1.0);\n\nconst modelMatrixScratch = new Matrix4();\nconst nodeMatrixScratch = new Matrix4();\n\nconst scratchColor = new Color();\nconst scratchArray = new Array(4);\nconst scratchCartesian = new Cartesian3();\n\n/**\n * A {@link Visualizer} which maps {@link Entity#model} to a {@link Model}.\n * @alias ModelVisualizer\n * @constructor\n *\n * @param {Scene} scene The scene the primitives will be rendered in.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n */\nfunction ModelVisualizer(scene, entityCollection) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"scene\", scene);\n  Check.typeOf.object(\"entityCollection\", entityCollection);\n  //>>includeEnd('debug');\n\n  entityCollection.collectionChanged.addEventListener(\n    ModelVisualizer.prototype._onCollectionChanged,\n    this\n  );\n\n  this._scene = scene;\n  this._primitives = scene.primitives;\n  this._entityCollection = entityCollection;\n  this._modelHash = {};\n  this._entitiesToVisualize = new AssociativeArray();\n\n  this._onCollectionChanged(entityCollection, entityCollection.values, [], []);\n}\n\nasync function createModelPrimitive(\n  visualizer,\n  entity,\n  resource,\n  incrementallyLoadTextures\n) {\n  const primitives = visualizer._primitives;\n  const modelHash = visualizer._modelHash;\n\n  try {\n    const model = await Model.fromGltfAsync({\n      url: resource,\n      incrementallyLoadTextures: incrementallyLoadTextures,\n      scene: visualizer._scene,\n    });\n\n    if (visualizer.isDestroyed() || !defined(modelHash[entity.id])) {\n      return;\n    }\n\n    model.id = entity;\n    primitives.add(model);\n    modelHash[entity.id].modelPrimitive = model;\n    model.errorEvent.addEventListener((error) => {\n      if (!defined(modelHash[entity.id])) {\n        return;\n      }\n\n      console.log(error);\n\n      // Texture failures when incrementallyLoadTextures\n      // will not affect the ability to compute the bounding sphere\n      if (error.name !== \"TextureError\" && model.incrementallyLoadTextures) {\n        modelHash[entity.id].loadFailed = true;\n      }\n    });\n  } catch (error) {\n    if (visualizer.isDestroyed() || !defined(modelHash[entity.id])) {\n      return;\n    }\n\n    console.log(error);\n    modelHash[entity.id].loadFailed = true;\n  }\n}\n\n/**\n * Updates models created this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {boolean} This function always returns true.\n */\nModelVisualizer.prototype.update = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const entities = this._entitiesToVisualize.values;\n  const modelHash = this._modelHash;\n  const primitives = this._primitives;\n\n  for (let i = 0, len = entities.length; i < len; i++) {\n    const entity = entities[i];\n    const modelGraphics = entity._model;\n\n    let resource;\n    let modelData = modelHash[entity.id];\n    let show =\n      entity.isShowing &&\n      entity.isAvailable(time) &&\n      Property.getValueOrDefault(modelGraphics._show, time, true);\n\n    let modelMatrix;\n    if (show) {\n      modelMatrix = entity.computeModelMatrix(time, modelMatrixScratch);\n      resource = Resource.createIfNeeded(\n        Property.getValueOrUndefined(modelGraphics._uri, time)\n      );\n      show = defined(modelMatrix) && defined(resource);\n    }\n\n    if (!show) {\n      if (defined(modelData) && modelData.modelPrimitive) {\n        modelData.modelPrimitive.show = false;\n      }\n      continue;\n    }\n\n    if (!defined(modelData) || resource.url !== modelData.url) {\n      if (defined(modelData?.modelPrimitive)) {\n        primitives.removeAndDestroy(modelData.modelPrimitive);\n        delete modelHash[entity.id];\n      }\n\n      modelData = {\n        modelPrimitive: undefined,\n        url: resource.url,\n        animationsRunning: false,\n        nodeTransformationsScratch: {},\n        articulationsScratch: {},\n        loadFailed: false,\n        modelUpdated: false,\n        awaitingSampleTerrain: false,\n        clampedBoundingSphere: undefined,\n        sampleTerrainFailed: false,\n      };\n      modelHash[entity.id] = modelData;\n\n      const incrementallyLoadTextures = Property.getValueOrDefault(\n        modelGraphics._incrementallyLoadTextures,\n        time,\n        defaultIncrementallyLoadTextures\n      );\n\n      createModelPrimitive(this, entity, resource, incrementallyLoadTextures);\n    }\n\n    const model = modelData.modelPrimitive;\n    if (!defined(model)) {\n      continue;\n    }\n\n    model.show = true;\n    model.scale = Property.getValueOrDefault(\n      modelGraphics._scale,\n      time,\n      defaultScale\n    );\n    model.minimumPixelSize = Property.getValueOrDefault(\n      modelGraphics._minimumPixelSize,\n      time,\n      defaultMinimumPixelSize\n    );\n    model.maximumScale = Property.getValueOrUndefined(\n      modelGraphics._maximumScale,\n      time\n    );\n    model.modelMatrix = Matrix4.clone(modelMatrix, model.modelMatrix);\n    model.shadows = Property.getValueOrDefault(\n      modelGraphics._shadows,\n      time,\n      defaultShadows\n    );\n    model.heightReference = Property.getValueOrDefault(\n      modelGraphics._heightReference,\n      time,\n      defaultHeightReference\n    );\n    model.distanceDisplayCondition = Property.getValueOrUndefined(\n      modelGraphics._distanceDisplayCondition,\n      time\n    );\n    model.silhouetteColor = Property.getValueOrDefault(\n      modelGraphics._silhouetteColor,\n      time,\n      defaultSilhouetteColor,\n      scratchColor\n    );\n    model.silhouetteSize = Property.getValueOrDefault(\n      modelGraphics._silhouetteSize,\n      time,\n      defaultSilhouetteSize\n    );\n    model.color = Property.getValueOrDefault(\n      modelGraphics._color,\n      time,\n      defaultColor,\n      scratchColor\n    );\n    model.colorBlendMode = Property.getValueOrDefault(\n      modelGraphics._colorBlendMode,\n      time,\n      defaultColorBlendMode\n    );\n    model.colorBlendAmount = Property.getValueOrDefault(\n      modelGraphics._colorBlendAmount,\n      time,\n      defaultColorBlendAmount\n    );\n    model.clippingPlanes = Property.getValueOrUndefined(\n      modelGraphics._clippingPlanes,\n      time\n    );\n    model.clampAnimations = Property.getValueOrDefault(\n      modelGraphics._clampAnimations,\n      time,\n      defaultClampAnimations\n    );\n    model.imageBasedLighting.imageBasedLightingFactor = Property.getValueOrDefault(\n      modelGraphics._imageBasedLightingFactor,\n      time,\n      defaultImageBasedLightingFactor\n    );\n    let lightColor = Property.getValueOrUndefined(\n      modelGraphics._lightColor,\n      time\n    );\n\n    // Convert from Color to Cartesian3\n    if (defined(lightColor)) {\n      Color.pack(lightColor, scratchArray, 0);\n      lightColor = Cartesian3.unpack(scratchArray, 0, scratchCartesian);\n    }\n\n    model.lightColor = lightColor;\n    model.customShader = Property.getValueOrUndefined(\n      modelGraphics._customShader,\n      time\n    );\n\n    // It's possible for getBoundingSphere to run before\n    // model becomes ready and these properties are updated\n    modelHash[entity.id].modelUpdated = true;\n\n    if (model.ready) {\n      const runAnimations = Property.getValueOrDefault(\n        modelGraphics._runAnimations,\n        time,\n        true\n      );\n      if (modelData.animationsRunning !== runAnimations) {\n        if (runAnimations) {\n          model.activeAnimations.addAll({\n            loop: ModelAnimationLoop.REPEAT,\n          });\n        } else {\n          model.activeAnimations.removeAll();\n        }\n        modelData.animationsRunning = runAnimations;\n      }\n\n      // Apply node transformations\n      const nodeTransformations = Property.getValueOrUndefined(\n        modelGraphics._nodeTransformations,\n        time,\n        modelData.nodeTransformationsScratch\n      );\n      if (defined(nodeTransformations)) {\n        const nodeNames = Object.keys(nodeTransformations);\n        for (\n          let nodeIndex = 0, nodeLength = nodeNames.length;\n          nodeIndex < nodeLength;\n          ++nodeIndex\n        ) {\n          const nodeName = nodeNames[nodeIndex];\n\n          const nodeTransformation = nodeTransformations[nodeName];\n          if (!defined(nodeTransformation)) {\n            continue;\n          }\n\n          const modelNode = model.getNode(nodeName);\n          if (!defined(modelNode)) {\n            continue;\n          }\n\n          const transformationMatrix = Matrix4.fromTranslationRotationScale(\n            nodeTransformation,\n            nodeMatrixScratch\n          );\n          modelNode.matrix = Matrix4.multiply(\n            modelNode.originalMatrix,\n            transformationMatrix,\n            transformationMatrix\n          );\n        }\n      }\n\n      // Apply articulations\n      let anyArticulationUpdated = false;\n      const articulations = Property.getValueOrUndefined(\n        modelGraphics._articulations,\n        time,\n        modelData.articulationsScratch\n      );\n      if (defined(articulations)) {\n        const articulationStageKeys = Object.keys(articulations);\n        for (\n          let s = 0, numKeys = articulationStageKeys.length;\n          s < numKeys;\n          ++s\n        ) {\n          const key = articulationStageKeys[s];\n\n          const articulationStageValue = articulations[key];\n          if (!defined(articulationStageValue)) {\n            continue;\n          }\n\n          anyArticulationUpdated = true;\n          model.setArticulationStage(key, articulationStageValue);\n        }\n      }\n\n      if (anyArticulationUpdated) {\n        model.applyArticulations();\n      }\n    }\n  }\n\n  return true;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n */\nModelVisualizer.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nModelVisualizer.prototype.destroy = function () {\n  this._entityCollection.collectionChanged.removeEventListener(\n    ModelVisualizer.prototype._onCollectionChanged,\n    this\n  );\n  const entities = this._entitiesToVisualize.values;\n  const modelHash = this._modelHash;\n  const primitives = this._primitives;\n  for (let i = entities.length - 1; i > -1; i--) {\n    removeModel(this, entities[i], modelHash, primitives);\n  }\n  return destroyObject(this);\n};\n\n// Used for testing.\nModelVisualizer._sampleTerrainMostDetailed = sampleTerrainMostDetailed;\n\nconst scratchPosition = new Cartesian3();\nconst scratchCartographic = new Cartographic();\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n *                       BoundingSphereState.PENDING if the result is still being computed, or\n *                       BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nModelVisualizer.prototype.getBoundingSphere = function (entity, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(entity)) {\n    throw new DeveloperError(\"entity is required.\");\n  }\n  if (!defined(result)) {\n    throw new DeveloperError(\"result is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const modelData = this._modelHash[entity.id];\n  if (!defined(modelData)) {\n    return BoundingSphereState.FAILED;\n  }\n\n  if (modelData.loadFailed) {\n    return BoundingSphereState.FAILED;\n  }\n\n  const model = modelData.modelPrimitive;\n  if (!defined(model) || !model.show) {\n    return BoundingSphereState.PENDING;\n  }\n\n  if (!model.ready || !modelData.modelUpdated) {\n    return BoundingSphereState.PENDING;\n  }\n\n  const scene = this._scene;\n  const globe = scene.globe;\n\n  // cannot access a terrain provider if there is no globe; formally set to undefined\n  const terrainProvider = defined(globe) ? globe.terrainProvider : undefined;\n  const hasHeightReference = model.heightReference !== HeightReference.NONE;\n  if (defined(globe) && hasHeightReference) {\n    const ellipsoid = globe.ellipsoid;\n    const modelMatrix = model.modelMatrix;\n    scratchPosition.x = modelMatrix[12];\n    scratchPosition.y = modelMatrix[13];\n    scratchPosition.z = modelMatrix[14];\n    const cartoPosition = ellipsoid.cartesianToCartographic(scratchPosition);\n\n    // For a terrain provider that does not have availability, like the EllipsoidTerrainProvider,\n    // we can directly assign the bounding sphere's center from model matrix's translation.\n    if (!defined(terrainProvider.availability)) {\n      // Regardless of what the original model's position is set to, for CLAMP_TO_GROUND, we reset it to 0\n      // when computing the position to zoom/fly to.\n      if (model.heightReference === HeightReference.CLAMP_TO_GROUND) {\n        cartoPosition.height = 0;\n      }\n\n      const scratchPosition = ellipsoid.cartographicToCartesian(cartoPosition);\n      BoundingSphere.clone(model.boundingSphere, result);\n      result.center = scratchPosition;\n\n      return BoundingSphereState.DONE;\n    }\n\n    // Otherwise, in the case of terrain providers with availability,\n    // since the model's bounding sphere may be clamped to a lower LOD tile if\n    // the camera is initially far away, we use sampleTerrainMostDetailed to estimate\n    // where the bounding sphere should be and set that as the target bounding sphere\n    // for the camera.\n    let clampedBoundingSphere = this._modelHash[entity.id]\n      .clampedBoundingSphere;\n\n    // Check if the sample terrain function has failed.\n    const sampleTerrainFailed = this._modelHash[entity.id].sampleTerrainFailed;\n    if (sampleTerrainFailed) {\n      this._modelHash[entity.id].sampleTerrainFailed = false;\n      return BoundingSphereState.FAILED;\n    }\n\n    if (!defined(clampedBoundingSphere)) {\n      clampedBoundingSphere = new BoundingSphere();\n\n      // Since this function is called per-frame, we set a flag when sampleTerrainMostDetailed\n      // is called and check for it to avoid calling it again.\n      const awaitingSampleTerrain = this._modelHash[entity.id]\n        .awaitingSampleTerrain;\n      if (!awaitingSampleTerrain) {\n        Cartographic.clone(cartoPosition, scratchCartographic);\n        this._modelHash[entity.id].awaitingSampleTerrain = true;\n        ModelVisualizer._sampleTerrainMostDetailed(terrainProvider, [\n          scratchCartographic,\n        ])\n          .then((result) => {\n            if (this.isDestroyed()) {\n              return;\n            }\n\n            this._modelHash[entity.id].awaitingSampleTerrain = false;\n\n            const updatedCartographic = result[0];\n            if (model.heightReference === HeightReference.RELATIVE_TO_GROUND) {\n              updatedCartographic.height += cartoPosition.height;\n            }\n            ellipsoid.cartographicToCartesian(\n              updatedCartographic,\n              scratchPosition\n            );\n\n            // Update the bounding sphere with the updated position.\n            BoundingSphere.clone(model.boundingSphere, clampedBoundingSphere);\n            clampedBoundingSphere.center = scratchPosition;\n\n            this._modelHash[\n              entity.id\n            ].clampedBoundingSphere = BoundingSphere.clone(\n              clampedBoundingSphere\n            );\n          })\n          .catch((e) => {\n            if (this.isDestroyed()) {\n              return;\n            }\n\n            this._modelHash[entity.id].sampleTerrainFailed = true;\n            this._modelHash[entity.id].awaitingSampleTerrain = false;\n          });\n      }\n\n      // We will return the state as pending until the clamped bounding sphere is defined,\n      // which happens when the sampleTerrainMostDetailed promise returns.\n      return BoundingSphereState.PENDING;\n    }\n\n    BoundingSphere.clone(clampedBoundingSphere, result);\n    // Reset the clamped bounding sphere.\n    this._modelHash[entity.id].clampedBoundingSphere = undefined;\n    return BoundingSphereState.DONE;\n  }\n\n  BoundingSphere.clone(model.boundingSphere, result);\n  return BoundingSphereState.DONE;\n};\n\n/**\n * @private\n */\nModelVisualizer.prototype._onCollectionChanged = function (\n  entityCollection,\n  added,\n  removed,\n  changed\n) {\n  let i;\n  let entity;\n  const entities = this._entitiesToVisualize;\n  const modelHash = this._modelHash;\n  const primitives = this._primitives;\n\n  for (i = added.length - 1; i > -1; i--) {\n    entity = added[i];\n    if (defined(entity._model) && defined(entity._position)) {\n      entities.set(entity.id, entity);\n    }\n  }\n\n  for (i = changed.length - 1; i > -1; i--) {\n    entity = changed[i];\n    if (defined(entity._model) && defined(entity._position)) {\n      clearNodeTransformationsArticulationsScratch(entity, modelHash);\n      entities.set(entity.id, entity);\n    } else {\n      removeModel(this, entity, modelHash, primitives);\n      entities.remove(entity.id);\n    }\n  }\n\n  for (i = removed.length - 1; i > -1; i--) {\n    entity = removed[i];\n    removeModel(this, entity, modelHash, primitives);\n    entities.remove(entity.id);\n  }\n};\n\nfunction removeModel(visualizer, entity, modelHash, primitives) {\n  const modelData = modelHash[entity.id];\n  if (defined(modelData)) {\n    primitives.removeAndDestroy(modelData.modelPrimitive);\n    delete modelHash[entity.id];\n  }\n}\n\nfunction clearNodeTransformationsArticulationsScratch(entity, modelHash) {\n  const modelData = modelHash[entity.id];\n  if (defined(modelData)) {\n    modelData.nodeTransformationsScratch = {};\n    modelData.articulationsScratch = {};\n  }\n}\n\nexport default ModelVisualizer;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Event from \"../Core/Event.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport Property from \"./Property.js\";\n\n/**\n * This is a temporary class for scaling position properties to the WGS84 surface.\n * It will go away or be refactored to support data with arbitrary height references.\n * @private\n */\nfunction ScaledPositionProperty(value) {\n  this._definitionChanged = new Event();\n  this._value = undefined;\n  this._removeSubscription = undefined;\n  this.setValue(value);\n}\n\nObject.defineProperties(ScaledPositionProperty.prototype, {\n  isConstant: {\n    get: function () {\n      return Property.isConstant(this._value);\n    },\n  },\n  definitionChanged: {\n    get: function () {\n      return this._definitionChanged;\n    },\n  },\n  referenceFrame: {\n    get: function () {\n      return defined(this._value)\n        ? this._value.referenceFrame\n        : ReferenceFrame.FIXED;\n    },\n  },\n});\n\nScaledPositionProperty.prototype.getValue = function (time, result) {\n  return this.getValueInReferenceFrame(time, ReferenceFrame.FIXED, result);\n};\n\nScaledPositionProperty.prototype.setValue = function (value) {\n  if (this._value !== value) {\n    this._value = value;\n\n    if (defined(this._removeSubscription)) {\n      this._removeSubscription();\n      this._removeSubscription = undefined;\n    }\n\n    if (defined(value)) {\n      this._removeSubscription = value.definitionChanged.addEventListener(\n        this._raiseDefinitionChanged,\n        this\n      );\n    }\n    this._definitionChanged.raiseEvent(this);\n  }\n};\n\nScaledPositionProperty.prototype.getValueInReferenceFrame = function (\n  time,\n  referenceFrame,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required.\");\n  }\n  if (!defined(referenceFrame)) {\n    throw new DeveloperError(\"referenceFrame is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(this._value)) {\n    return undefined;\n  }\n\n  result = this._value.getValueInReferenceFrame(time, referenceFrame, result);\n  return defined(result)\n    ? Ellipsoid.WGS84.scaleToGeodeticSurface(result, result)\n    : undefined;\n};\n\nScaledPositionProperty.prototype.equals = function (other) {\n  return (\n    this === other ||\n    (other instanceof ScaledPositionProperty && this._value === other._value)\n  );\n};\n\nScaledPositionProperty.prototype._raiseDefinitionChanged = function () {\n  this._definitionChanged.raiseEvent(this);\n};\nexport default ScaledPositionProperty;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport TimeInterval from \"../Core/TimeInterval.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport PolylineCollection from \"../Scene/PolylineCollection.js\";\nimport SceneMode from \"../Scene/SceneMode.js\";\nimport CompositePositionProperty from \"./CompositePositionProperty.js\";\nimport ConstantPositionProperty from \"./ConstantPositionProperty.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\nimport ReferenceProperty from \"./ReferenceProperty.js\";\nimport SampledPositionProperty from \"./SampledPositionProperty.js\";\nimport ScaledPositionProperty from \"./ScaledPositionProperty.js\";\nimport TimeIntervalCollectionPositionProperty from \"./TimeIntervalCollectionPositionProperty.js\";\n\nconst defaultResolution = 60.0;\nconst defaultWidth = 1.0;\n\nconst scratchTimeInterval = new TimeInterval();\nconst subSampleCompositePropertyScratch = new TimeInterval();\nconst subSampleIntervalPropertyScratch = new TimeInterval();\n\nfunction EntityData(entity) {\n  this.entity = entity;\n  this.polyline = undefined;\n  this.index = undefined;\n  this.updater = undefined;\n}\n\nfunction subSampleSampledProperty(\n  property,\n  start,\n  stop,\n  times,\n  updateTime,\n  referenceFrame,\n  maximumStep,\n  startingIndex,\n  result\n) {\n  let r = startingIndex;\n  //Always step exactly on start (but only use it if it exists.)\n  let tmp;\n  tmp = property.getValueInReferenceFrame(start, referenceFrame, result[r]);\n  if (defined(tmp)) {\n    result[r++] = tmp;\n  }\n\n  let steppedOnNow =\n    !defined(updateTime) ||\n    JulianDate.lessThanOrEquals(updateTime, start) ||\n    JulianDate.greaterThanOrEquals(updateTime, stop);\n\n  //Iterate over all interval times and add the ones that fall in our\n  //time range.  Note that times can contain data outside of\n  //the intervals range.  This is by design for use with interpolation.\n  let t = 0;\n  const len = times.length;\n  let current = times[t];\n  const loopStop = stop;\n  let sampling = false;\n  let sampleStepsToTake;\n  let sampleStepsTaken;\n  let sampleStepSize;\n\n  while (t < len) {\n    if (!steppedOnNow && JulianDate.greaterThanOrEquals(current, updateTime)) {\n      tmp = property.getValueInReferenceFrame(\n        updateTime,\n        referenceFrame,\n        result[r]\n      );\n      if (defined(tmp)) {\n        result[r++] = tmp;\n      }\n      steppedOnNow = true;\n    }\n    if (\n      JulianDate.greaterThan(current, start) &&\n      JulianDate.lessThan(current, loopStop) &&\n      !current.equals(updateTime)\n    ) {\n      tmp = property.getValueInReferenceFrame(\n        current,\n        referenceFrame,\n        result[r]\n      );\n      if (defined(tmp)) {\n        result[r++] = tmp;\n      }\n    }\n\n    if (t < len - 1) {\n      if (maximumStep > 0 && !sampling) {\n        const next = times[t + 1];\n        const secondsUntilNext = JulianDate.secondsDifference(next, current);\n        sampling = secondsUntilNext > maximumStep;\n\n        if (sampling) {\n          sampleStepsToTake = Math.ceil(secondsUntilNext / maximumStep);\n          sampleStepsTaken = 0;\n          sampleStepSize = secondsUntilNext / Math.max(sampleStepsToTake, 2);\n          sampleStepsToTake = Math.max(sampleStepsToTake - 1, 1);\n        }\n      }\n\n      if (sampling && sampleStepsTaken < sampleStepsToTake) {\n        current = JulianDate.addSeconds(\n          current,\n          sampleStepSize,\n          new JulianDate()\n        );\n        sampleStepsTaken++;\n        continue;\n      }\n    }\n    sampling = false;\n    t++;\n    current = times[t];\n  }\n\n  //Always step exactly on stop (but only use it if it exists.)\n  tmp = property.getValueInReferenceFrame(stop, referenceFrame, result[r]);\n  if (defined(tmp)) {\n    result[r++] = tmp;\n  }\n\n  return r;\n}\n\nfunction subSampleGenericProperty(\n  property,\n  start,\n  stop,\n  updateTime,\n  referenceFrame,\n  maximumStep,\n  startingIndex,\n  result\n) {\n  let tmp;\n  let i = 0;\n  let index = startingIndex;\n  let time = start;\n  const stepSize = Math.max(maximumStep, 60);\n  let steppedOnNow =\n    !defined(updateTime) ||\n    JulianDate.lessThanOrEquals(updateTime, start) ||\n    JulianDate.greaterThanOrEquals(updateTime, stop);\n  while (JulianDate.lessThan(time, stop)) {\n    if (!steppedOnNow && JulianDate.greaterThanOrEquals(time, updateTime)) {\n      steppedOnNow = true;\n      tmp = property.getValueInReferenceFrame(\n        updateTime,\n        referenceFrame,\n        result[index]\n      );\n      if (defined(tmp)) {\n        result[index] = tmp;\n        index++;\n      }\n    }\n    tmp = property.getValueInReferenceFrame(\n      time,\n      referenceFrame,\n      result[index]\n    );\n    if (defined(tmp)) {\n      result[index] = tmp;\n      index++;\n    }\n    i++;\n    time = JulianDate.addSeconds(start, stepSize * i, new JulianDate());\n  }\n  //Always sample stop.\n  tmp = property.getValueInReferenceFrame(stop, referenceFrame, result[index]);\n  if (defined(tmp)) {\n    result[index] = tmp;\n    index++;\n  }\n  return index;\n}\n\nfunction subSampleIntervalProperty(\n  property,\n  start,\n  stop,\n  updateTime,\n  referenceFrame,\n  maximumStep,\n  startingIndex,\n  result\n) {\n  subSampleIntervalPropertyScratch.start = start;\n  subSampleIntervalPropertyScratch.stop = stop;\n\n  let index = startingIndex;\n  const intervals = property.intervals;\n  for (let i = 0; i < intervals.length; i++) {\n    const interval = intervals.get(i);\n    if (\n      !TimeInterval.intersect(\n        interval,\n        subSampleIntervalPropertyScratch,\n        scratchTimeInterval\n      ).isEmpty\n    ) {\n      let time = interval.start;\n      if (!interval.isStartIncluded) {\n        if (interval.isStopIncluded) {\n          time = interval.stop;\n        } else {\n          time = JulianDate.addSeconds(\n            interval.start,\n            JulianDate.secondsDifference(interval.stop, interval.start) / 2,\n            new JulianDate()\n          );\n        }\n      }\n      const tmp = property.getValueInReferenceFrame(\n        time,\n        referenceFrame,\n        result[index]\n      );\n      if (defined(tmp)) {\n        result[index] = tmp;\n        index++;\n      }\n    }\n  }\n  return index;\n}\n\nfunction subSampleConstantProperty(\n  property,\n  start,\n  stop,\n  updateTime,\n  referenceFrame,\n  maximumStep,\n  startingIndex,\n  result\n) {\n  const tmp = property.getValueInReferenceFrame(\n    start,\n    referenceFrame,\n    result[startingIndex]\n  );\n  if (defined(tmp)) {\n    result[startingIndex++] = tmp;\n  }\n  return startingIndex;\n}\n\nfunction subSampleCompositeProperty(\n  property,\n  start,\n  stop,\n  updateTime,\n  referenceFrame,\n  maximumStep,\n  startingIndex,\n  result\n) {\n  subSampleCompositePropertyScratch.start = start;\n  subSampleCompositePropertyScratch.stop = stop;\n\n  let index = startingIndex;\n  const intervals = property.intervals;\n  for (let i = 0; i < intervals.length; i++) {\n    const interval = intervals.get(i);\n    if (\n      !TimeInterval.intersect(\n        interval,\n        subSampleCompositePropertyScratch,\n        scratchTimeInterval\n      ).isEmpty\n    ) {\n      const intervalStart = interval.start;\n      const intervalStop = interval.stop;\n\n      let sampleStart = start;\n      if (JulianDate.greaterThan(intervalStart, sampleStart)) {\n        sampleStart = intervalStart;\n      }\n\n      let sampleStop = stop;\n      if (JulianDate.lessThan(intervalStop, sampleStop)) {\n        sampleStop = intervalStop;\n      }\n\n      index = reallySubSample(\n        interval.data,\n        sampleStart,\n        sampleStop,\n        updateTime,\n        referenceFrame,\n        maximumStep,\n        index,\n        result\n      );\n    }\n  }\n  return index;\n}\n\nfunction reallySubSample(\n  property,\n  start,\n  stop,\n  updateTime,\n  referenceFrame,\n  maximumStep,\n  index,\n  result\n) {\n  //Unwrap any references until we have the actual property.\n  while (property instanceof ReferenceProperty) {\n    property = property.resolvedProperty;\n  }\n\n  if (property instanceof SampledPositionProperty) {\n    const times = property._property._times;\n    index = subSampleSampledProperty(\n      property,\n      start,\n      stop,\n      times,\n      updateTime,\n      referenceFrame,\n      maximumStep,\n      index,\n      result\n    );\n  } else if (property instanceof CompositePositionProperty) {\n    index = subSampleCompositeProperty(\n      property,\n      start,\n      stop,\n      updateTime,\n      referenceFrame,\n      maximumStep,\n      index,\n      result\n    );\n  } else if (property instanceof TimeIntervalCollectionPositionProperty) {\n    index = subSampleIntervalProperty(\n      property,\n      start,\n      stop,\n      updateTime,\n      referenceFrame,\n      maximumStep,\n      index,\n      result\n    );\n  } else if (\n    property instanceof ConstantPositionProperty ||\n    (property instanceof ScaledPositionProperty &&\n      Property.isConstant(property))\n  ) {\n    index = subSampleConstantProperty(\n      property,\n      start,\n      stop,\n      updateTime,\n      referenceFrame,\n      maximumStep,\n      index,\n      result\n    );\n  } else {\n    //Fallback to generic sampling.\n    index = subSampleGenericProperty(\n      property,\n      start,\n      stop,\n      updateTime,\n      referenceFrame,\n      maximumStep,\n      index,\n      result\n    );\n  }\n  return index;\n}\n\nfunction subSample(\n  property,\n  start,\n  stop,\n  updateTime,\n  referenceFrame,\n  maximumStep,\n  result\n) {\n  if (!defined(result)) {\n    result = [];\n  }\n\n  const length = reallySubSample(\n    property,\n    start,\n    stop,\n    updateTime,\n    referenceFrame,\n    maximumStep,\n    0,\n    result\n  );\n  result.length = length;\n  return result;\n}\n\nconst toFixedScratch = new Matrix3();\nfunction PolylineUpdater(scene, referenceFrame) {\n  this._unusedIndexes = [];\n  this._polylineCollection = new PolylineCollection();\n  this._scene = scene;\n  this._referenceFrame = referenceFrame;\n  scene.primitives.add(this._polylineCollection);\n}\n\nPolylineUpdater.prototype.update = function (time) {\n  if (this._referenceFrame === ReferenceFrame.INERTIAL) {\n    let toFixed = Transforms.computeIcrfToFixedMatrix(time, toFixedScratch);\n    if (!defined(toFixed)) {\n      toFixed = Transforms.computeTemeToPseudoFixedMatrix(time, toFixedScratch);\n    }\n    Matrix4.fromRotationTranslation(\n      toFixed,\n      Cartesian3.ZERO,\n      this._polylineCollection.modelMatrix\n    );\n  }\n};\n\nPolylineUpdater.prototype.updateObject = function (time, item) {\n  const entity = item.entity;\n  const pathGraphics = entity._path;\n  const positionProperty = entity._position;\n\n  let sampleStart;\n  let sampleStop;\n  const showProperty = pathGraphics._show;\n  let polyline = item.polyline;\n  let show =\n    entity.isShowing &&\n    entity.isAvailable(time) &&\n    (!defined(showProperty) || showProperty.getValue(time));\n\n  //While we want to show the path, there may not actually be anything to show\n  //depending on lead/trail settings.  Compute the interval of the path to\n  //show and check against actual availability.\n  if (show) {\n    const leadTime = Property.getValueOrUndefined(pathGraphics._leadTime, time);\n    const trailTime = Property.getValueOrUndefined(\n      pathGraphics._trailTime,\n      time\n    );\n    const availability = entity._availability;\n    const hasAvailability = defined(availability);\n    const hasLeadTime = defined(leadTime);\n    const hasTrailTime = defined(trailTime);\n\n    //Objects need to have either defined availability or both a lead and trail time in order to\n    //draw a path (since we can't draw \"infinite\" paths.\n    show = hasAvailability || (hasLeadTime && hasTrailTime);\n\n    //The final step is to compute the actual start/stop times of the path to show.\n    //If current time is outside of the availability interval, there's a chance that\n    //we won't have to draw anything anyway.\n    if (show) {\n      if (hasTrailTime) {\n        sampleStart = JulianDate.addSeconds(time, -trailTime, new JulianDate());\n      }\n      if (hasLeadTime) {\n        sampleStop = JulianDate.addSeconds(time, leadTime, new JulianDate());\n      }\n\n      if (hasAvailability) {\n        const start = availability.start;\n        const stop = availability.stop;\n\n        if (!hasTrailTime || JulianDate.greaterThan(start, sampleStart)) {\n          sampleStart = start;\n        }\n\n        if (!hasLeadTime || JulianDate.lessThan(stop, sampleStop)) {\n          sampleStop = stop;\n        }\n      }\n      show = JulianDate.lessThan(sampleStart, sampleStop);\n    }\n  }\n\n  if (!show) {\n    //don't bother creating or updating anything else\n    if (defined(polyline)) {\n      this._unusedIndexes.push(item.index);\n      item.polyline = undefined;\n      polyline.show = false;\n      item.index = undefined;\n    }\n    return;\n  }\n\n  if (!defined(polyline)) {\n    const unusedIndexes = this._unusedIndexes;\n    const length = unusedIndexes.length;\n    if (length > 0) {\n      const index = unusedIndexes.pop();\n      polyline = this._polylineCollection.get(index);\n      item.index = index;\n    } else {\n      item.index = this._polylineCollection.length;\n      polyline = this._polylineCollection.add();\n    }\n    polyline.id = entity;\n    item.polyline = polyline;\n  }\n\n  const resolution = Property.getValueOrDefault(\n    pathGraphics._resolution,\n    time,\n    defaultResolution\n  );\n\n  polyline.show = true;\n  polyline.positions = subSample(\n    positionProperty,\n    sampleStart,\n    sampleStop,\n    time,\n    this._referenceFrame,\n    resolution,\n    polyline.positions.slice()\n  );\n  polyline.material = MaterialProperty.getValue(\n    time,\n    pathGraphics._material,\n    polyline.material\n  );\n  polyline.width = Property.getValueOrDefault(\n    pathGraphics._width,\n    time,\n    defaultWidth\n  );\n  polyline.distanceDisplayCondition = Property.getValueOrUndefined(\n    pathGraphics._distanceDisplayCondition,\n    time,\n    polyline.distanceDisplayCondition\n  );\n};\n\nPolylineUpdater.prototype.removeObject = function (item) {\n  const polyline = item.polyline;\n  if (defined(polyline)) {\n    this._unusedIndexes.push(item.index);\n    item.polyline = undefined;\n    polyline.show = false;\n    polyline.id = undefined;\n    item.index = undefined;\n  }\n};\n\nPolylineUpdater.prototype.destroy = function () {\n  this._scene.primitives.remove(this._polylineCollection);\n  return destroyObject(this);\n};\n\n/**\n * A {@link Visualizer} which maps {@link Entity#path} to a {@link Polyline}.\n * @alias PathVisualizer\n * @constructor\n *\n * @param {Scene} scene The scene the primitives will be rendered in.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n */\nfunction PathVisualizer(scene, entityCollection) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  if (!defined(entityCollection)) {\n    throw new DeveloperError(\"entityCollection is required.\");\n  }\n  //>>includeEnd('debug');\n\n  entityCollection.collectionChanged.addEventListener(\n    PathVisualizer.prototype._onCollectionChanged,\n    this\n  );\n\n  this._scene = scene;\n  this._updaters = {};\n  this._entityCollection = entityCollection;\n  this._items = new AssociativeArray();\n\n  this._onCollectionChanged(entityCollection, entityCollection.values, [], []);\n}\n\n/**\n * Updates all of the primitives created by this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {boolean} This function always returns true.\n */\nPathVisualizer.prototype.update = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const updaters = this._updaters;\n  for (const key in updaters) {\n    if (updaters.hasOwnProperty(key)) {\n      updaters[key].update(time);\n    }\n  }\n\n  const items = this._items.values;\n  if (\n    items.length === 0 &&\n    defined(this._updaters) &&\n    Object.keys(this._updaters).length > 0\n  ) {\n    for (const u in updaters) {\n      if (updaters.hasOwnProperty(u)) {\n        updaters[u].destroy();\n      }\n    }\n    this._updaters = {};\n  }\n\n  for (let i = 0, len = items.length; i < len; i++) {\n    const item = items[i];\n    const entity = item.entity;\n    const positionProperty = entity._position;\n\n    const lastUpdater = item.updater;\n\n    let frameToVisualize = ReferenceFrame.FIXED;\n    if (this._scene.mode === SceneMode.SCENE3D) {\n      frameToVisualize = positionProperty.referenceFrame;\n    }\n\n    let currentUpdater = this._updaters[frameToVisualize];\n\n    if (lastUpdater === currentUpdater && defined(currentUpdater)) {\n      currentUpdater.updateObject(time, item);\n      continue;\n    }\n\n    if (defined(lastUpdater)) {\n      lastUpdater.removeObject(item);\n    }\n\n    if (!defined(currentUpdater)) {\n      currentUpdater = new PolylineUpdater(this._scene, frameToVisualize);\n      currentUpdater.update(time);\n      this._updaters[frameToVisualize] = currentUpdater;\n    }\n\n    item.updater = currentUpdater;\n    if (defined(currentUpdater)) {\n      currentUpdater.updateObject(time, item);\n    }\n  }\n  return true;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n */\nPathVisualizer.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nPathVisualizer.prototype.destroy = function () {\n  this._entityCollection.collectionChanged.removeEventListener(\n    PathVisualizer.prototype._onCollectionChanged,\n    this\n  );\n\n  const updaters = this._updaters;\n  for (const key in updaters) {\n    if (updaters.hasOwnProperty(key)) {\n      updaters[key].destroy();\n    }\n  }\n\n  return destroyObject(this);\n};\n\nPathVisualizer.prototype._onCollectionChanged = function (\n  entityCollection,\n  added,\n  removed,\n  changed\n) {\n  let i;\n  let entity;\n  let item;\n  const items = this._items;\n\n  for (i = added.length - 1; i > -1; i--) {\n    entity = added[i];\n    if (defined(entity._path) && defined(entity._position)) {\n      items.set(entity.id, new EntityData(entity));\n    }\n  }\n\n  for (i = changed.length - 1; i > -1; i--) {\n    entity = changed[i];\n    if (defined(entity._path) && defined(entity._position)) {\n      if (!items.contains(entity.id)) {\n        items.set(entity.id, new EntityData(entity));\n      }\n    } else {\n      item = items.get(entity.id);\n      if (defined(item)) {\n        if (defined(item.updater)) {\n          item.updater.removeObject(item);\n        }\n        items.remove(entity.id);\n      }\n    }\n  }\n\n  for (i = removed.length - 1; i > -1; i--) {\n    entity = removed[i];\n    item = items.get(entity.id);\n    if (defined(item)) {\n      if (defined(item.updater)) {\n        item.updater.removeObject(item);\n      }\n      items.remove(entity.id);\n    }\n  }\n};\n\n//for testing\nPathVisualizer._subSample = subSample;\nexport default PathVisualizer;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport createBillboardPointCallback from \"../Scene/createBillboardPointCallback.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport Property from \"./Property.js\";\n\nconst defaultColor = Color.WHITE;\nconst defaultOutlineColor = Color.BLACK;\nconst defaultOutlineWidth = 0.0;\nconst defaultPixelSize = 1.0;\nconst defaultDisableDepthTestDistance = 0.0;\n\nconst colorScratch = new Color();\nconst positionScratch = new Cartesian3();\nconst outlineColorScratch = new Color();\nconst scaleByDistanceScratch = new NearFarScalar();\nconst translucencyByDistanceScratch = new NearFarScalar();\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\n\nfunction EntityData(entity) {\n  this.entity = entity;\n  this.pointPrimitive = undefined;\n  this.billboard = undefined;\n  this.color = undefined;\n  this.outlineColor = undefined;\n  this.pixelSize = undefined;\n  this.outlineWidth = undefined;\n}\n\n/**\n * A {@link Visualizer} which maps {@link Entity#point} to a {@link PointPrimitive}.\n * @alias PointVisualizer\n * @constructor\n *\n * @param {EntityCluster} entityCluster The entity cluster to manage the collection of billboards and optionally cluster with other entities.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n */\nfunction PointVisualizer(entityCluster, entityCollection) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(entityCluster)) {\n    throw new DeveloperError(\"entityCluster is required.\");\n  }\n  if (!defined(entityCollection)) {\n    throw new DeveloperError(\"entityCollection is required.\");\n  }\n  //>>includeEnd('debug');\n\n  entityCollection.collectionChanged.addEventListener(\n    PointVisualizer.prototype._onCollectionChanged,\n    this\n  );\n\n  this._cluster = entityCluster;\n  this._entityCollection = entityCollection;\n  this._items = new AssociativeArray();\n  this._onCollectionChanged(entityCollection, entityCollection.values, [], []);\n}\n\n/**\n * Updates the primitives created by this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {boolean} This function always returns true.\n */\nPointVisualizer.prototype.update = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const items = this._items.values;\n  const cluster = this._cluster;\n  for (let i = 0, len = items.length; i < len; i++) {\n    const item = items[i];\n    const entity = item.entity;\n    const pointGraphics = entity._point;\n    let pointPrimitive = item.pointPrimitive;\n    let billboard = item.billboard;\n    const heightReference = Property.getValueOrDefault(\n      pointGraphics._heightReference,\n      time,\n      HeightReference.NONE\n    );\n    let show =\n      entity.isShowing &&\n      entity.isAvailable(time) &&\n      Property.getValueOrDefault(pointGraphics._show, time, true);\n    let position;\n    if (show) {\n      position = Property.getValueOrUndefined(\n        entity._position,\n        time,\n        positionScratch\n      );\n      show = defined(position);\n    }\n    if (!show) {\n      returnPrimitive(item, entity, cluster);\n      continue;\n    }\n\n    if (!Property.isConstant(entity._position)) {\n      cluster._clusterDirty = true;\n    }\n\n    let needsRedraw = false;\n    let updateClamping = false;\n    if (heightReference !== HeightReference.NONE && !defined(billboard)) {\n      if (defined(pointPrimitive)) {\n        returnPrimitive(item, entity, cluster);\n        pointPrimitive = undefined;\n      }\n\n      billboard = cluster.getBillboard(entity);\n      billboard.id = entity;\n      billboard.image = undefined;\n      item.billboard = billboard;\n      needsRedraw = true;\n\n      // If this new billboard happens to have a position and height reference that match our new values,\n      // billboard._updateClamping will not be called automatically. That's a problem because the clamped\n      // height may be based on different terrain than is now loaded. So we'll manually call\n      // _updateClamping below.\n      updateClamping =\n        Cartesian3.equals(billboard.position, position) &&\n        billboard.heightReference === heightReference;\n    } else if (\n      heightReference === HeightReference.NONE &&\n      !defined(pointPrimitive)\n    ) {\n      if (defined(billboard)) {\n        returnPrimitive(item, entity, cluster);\n        billboard = undefined;\n      }\n\n      pointPrimitive = cluster.getPoint(entity);\n      pointPrimitive.id = entity;\n      item.pointPrimitive = pointPrimitive;\n    }\n\n    if (defined(pointPrimitive)) {\n      pointPrimitive.show = true;\n      pointPrimitive.position = position;\n      pointPrimitive.scaleByDistance = Property.getValueOrUndefined(\n        pointGraphics._scaleByDistance,\n        time,\n        scaleByDistanceScratch\n      );\n      pointPrimitive.translucencyByDistance = Property.getValueOrUndefined(\n        pointGraphics._translucencyByDistance,\n        time,\n        translucencyByDistanceScratch\n      );\n      pointPrimitive.color = Property.getValueOrDefault(\n        pointGraphics._color,\n        time,\n        defaultColor,\n        colorScratch\n      );\n      pointPrimitive.outlineColor = Property.getValueOrDefault(\n        pointGraphics._outlineColor,\n        time,\n        defaultOutlineColor,\n        outlineColorScratch\n      );\n      pointPrimitive.outlineWidth = Property.getValueOrDefault(\n        pointGraphics._outlineWidth,\n        time,\n        defaultOutlineWidth\n      );\n      pointPrimitive.pixelSize = Property.getValueOrDefault(\n        pointGraphics._pixelSize,\n        time,\n        defaultPixelSize\n      );\n      pointPrimitive.distanceDisplayCondition = Property.getValueOrUndefined(\n        pointGraphics._distanceDisplayCondition,\n        time,\n        distanceDisplayConditionScratch\n      );\n      pointPrimitive.disableDepthTestDistance = Property.getValueOrDefault(\n        pointGraphics._disableDepthTestDistance,\n        time,\n        defaultDisableDepthTestDistance\n      );\n    } else if (defined(billboard)) {\n      billboard.show = true;\n      billboard.position = position;\n      billboard.scaleByDistance = Property.getValueOrUndefined(\n        pointGraphics._scaleByDistance,\n        time,\n        scaleByDistanceScratch\n      );\n      billboard.translucencyByDistance = Property.getValueOrUndefined(\n        pointGraphics._translucencyByDistance,\n        time,\n        translucencyByDistanceScratch\n      );\n      billboard.distanceDisplayCondition = Property.getValueOrUndefined(\n        pointGraphics._distanceDisplayCondition,\n        time,\n        distanceDisplayConditionScratch\n      );\n      billboard.disableDepthTestDistance = Property.getValueOrDefault(\n        pointGraphics._disableDepthTestDistance,\n        time,\n        defaultDisableDepthTestDistance\n      );\n      billboard.heightReference = heightReference;\n\n      const newColor = Property.getValueOrDefault(\n        pointGraphics._color,\n        time,\n        defaultColor,\n        colorScratch\n      );\n      const newOutlineColor = Property.getValueOrDefault(\n        pointGraphics._outlineColor,\n        time,\n        defaultOutlineColor,\n        outlineColorScratch\n      );\n      const newOutlineWidth = Math.round(\n        Property.getValueOrDefault(\n          pointGraphics._outlineWidth,\n          time,\n          defaultOutlineWidth\n        )\n      );\n      let newPixelSize = Math.max(\n        1,\n        Math.round(\n          Property.getValueOrDefault(\n            pointGraphics._pixelSize,\n            time,\n            defaultPixelSize\n          )\n        )\n      );\n\n      if (newOutlineWidth > 0) {\n        billboard.scale = 1.0;\n        needsRedraw =\n          needsRedraw || //\n          newOutlineWidth !== item.outlineWidth || //\n          newPixelSize !== item.pixelSize || //\n          !Color.equals(newColor, item.color) || //\n          !Color.equals(newOutlineColor, item.outlineColor);\n      } else {\n        billboard.scale = newPixelSize / 50.0;\n        newPixelSize = 50.0;\n        needsRedraw =\n          needsRedraw || //\n          newOutlineWidth !== item.outlineWidth || //\n          !Color.equals(newColor, item.color) || //\n          !Color.equals(newOutlineColor, item.outlineColor);\n      }\n\n      if (needsRedraw) {\n        item.color = Color.clone(newColor, item.color);\n        item.outlineColor = Color.clone(newOutlineColor, item.outlineColor);\n        item.pixelSize = newPixelSize;\n        item.outlineWidth = newOutlineWidth;\n\n        const centerAlpha = newColor.alpha;\n        const cssColor = newColor.toCssColorString();\n        const cssOutlineColor = newOutlineColor.toCssColorString();\n        const textureId = JSON.stringify([\n          cssColor,\n          newPixelSize,\n          cssOutlineColor,\n          newOutlineWidth,\n        ]);\n\n        billboard.setImage(\n          textureId,\n          createBillboardPointCallback(\n            centerAlpha,\n            cssColor,\n            cssOutlineColor,\n            newOutlineWidth,\n            newPixelSize\n          )\n        );\n      }\n\n      if (updateClamping) {\n        billboard._updateClamping();\n      }\n    }\n  }\n  return true;\n};\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n *                       BoundingSphereState.PENDING if the result is still being computed, or\n *                       BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nPointVisualizer.prototype.getBoundingSphere = function (entity, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(entity)) {\n    throw new DeveloperError(\"entity is required.\");\n  }\n  if (!defined(result)) {\n    throw new DeveloperError(\"result is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const item = this._items.get(entity.id);\n  if (\n    !defined(item) ||\n    !(defined(item.pointPrimitive) || defined(item.billboard))\n  ) {\n    return BoundingSphereState.FAILED;\n  }\n\n  if (defined(item.pointPrimitive)) {\n    result.center = Cartesian3.clone(\n      item.pointPrimitive.position,\n      result.center\n    );\n  } else {\n    const billboard = item.billboard;\n    if (!defined(billboard._clampedPosition)) {\n      return BoundingSphereState.PENDING;\n    }\n    result.center = Cartesian3.clone(billboard._clampedPosition, result.center);\n  }\n\n  result.radius = 0;\n  return BoundingSphereState.DONE;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n */\nPointVisualizer.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nPointVisualizer.prototype.destroy = function () {\n  this._entityCollection.collectionChanged.removeEventListener(\n    PointVisualizer.prototype._onCollectionChanged,\n    this\n  );\n  const entities = this._entityCollection.values;\n  for (let i = 0; i < entities.length; i++) {\n    this._cluster.removePoint(entities[i]);\n  }\n  return destroyObject(this);\n};\n\nPointVisualizer.prototype._onCollectionChanged = function (\n  entityCollection,\n  added,\n  removed,\n  changed\n) {\n  let i;\n  let entity;\n  const items = this._items;\n  const cluster = this._cluster;\n\n  for (i = added.length - 1; i > -1; i--) {\n    entity = added[i];\n    if (defined(entity._point) && defined(entity._position)) {\n      items.set(entity.id, new EntityData(entity));\n    }\n  }\n\n  for (i = changed.length - 1; i > -1; i--) {\n    entity = changed[i];\n    if (defined(entity._point) && defined(entity._position)) {\n      if (!items.contains(entity.id)) {\n        items.set(entity.id, new EntityData(entity));\n      }\n    } else {\n      returnPrimitive(items.get(entity.id), entity, cluster);\n      items.remove(entity.id);\n    }\n  }\n\n  for (i = removed.length - 1; i > -1; i--) {\n    entity = removed[i];\n    returnPrimitive(items.get(entity.id), entity, cluster);\n    items.remove(entity.id);\n  }\n};\n\nfunction returnPrimitive(item, entity, cluster) {\n  if (defined(item)) {\n    const pointPrimitive = item.pointPrimitive;\n    if (defined(pointPrimitive)) {\n      item.pointPrimitive = undefined;\n      cluster.removePoint(entity);\n      return;\n    }\n    const billboard = item.billboard;\n    if (defined(billboard)) {\n      item.billboard = undefined;\n      cluster.removeBillboard(entity);\n    }\n  }\n}\nexport default PointVisualizer;\n", "import ArcType from \"./ArcType.js\";\nimport arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Color from \"./Color.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryType from \"./GeometryType.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolylinePipeline from \"./PolylinePipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst scratchInterpolateColorsArray = [];\n\nfunction interpolateColors(p0, p1, color0, color1, numPoints) {\n  const colors = scratchInterpolateColorsArray;\n  colors.length = numPoints;\n  let i;\n\n  const r0 = color0.red;\n  const g0 = color0.green;\n  const b0 = color0.blue;\n  const a0 = color0.alpha;\n\n  const r1 = color1.red;\n  const g1 = color1.green;\n  const b1 = color1.blue;\n  const a1 = color1.alpha;\n\n  if (Color.equals(color0, color1)) {\n    for (i = 0; i < numPoints; i++) {\n      colors[i] = Color.clone(color0);\n    }\n    return colors;\n  }\n\n  const redPerVertex = (r1 - r0) / numPoints;\n  const greenPerVertex = (g1 - g0) / numPoints;\n  const bluePerVertex = (b1 - b0) / numPoints;\n  const alphaPerVertex = (a1 - a0) / numPoints;\n\n  for (i = 0; i < numPoints; i++) {\n    colors[i] = new Color(\n      r0 + i * redPerVertex,\n      g0 + i * greenPerVertex,\n      b0 + i * bluePerVertex,\n      a0 + i * alphaPerVertex\n    );\n  }\n\n  return colors;\n}\n\n/**\n * A description of a polyline modeled as a line strip; the first two positions define a line segment,\n * and each additional position defines a line segment from the previous position. The polyline is capable of\n * displaying with a material.\n *\n * @alias PolylineGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of {@link Cartesian3} defining the positions in the polyline as a line strip.\n * @param {number} [options.width=1.0] The width in pixels.\n * @param {Color[]} [options.colors] An Array of {@link Color} defining the per vertex or per segment colors.\n * @param {boolean} [options.colorsPerVertex=false] A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n *\n * @exception {DeveloperError} At least two positions are required.\n * @exception {DeveloperError} width must be greater than or equal to one.\n * @exception {DeveloperError} colors has an invalid length.\n *\n * @see PolylineGeometry#createGeometry\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Polyline.html|Cesium Sandcastle Polyline Demo}\n *\n * @example\n * // A polyline with two connected line segments\n * const polyline = new Cesium.PolylineGeometry({\n *   positions : Cesium.Cartesian3.fromDegreesArray([\n *     0.0, 0.0,\n *     5.0, 0.0,\n *     5.0, 5.0\n *   ]),\n *   width : 10.0\n * });\n * const geometry = Cesium.PolylineGeometry.createGeometry(polyline);\n */\nfunction PolylineGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const positions = options.positions;\n  const colors = options.colors;\n  const width = defaultValue(options.width, 1.0);\n  const colorsPerVertex = defaultValue(options.colorsPerVertex, false);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(positions) || positions.length < 2) {\n    throw new DeveloperError(\"At least two positions are required.\");\n  }\n  if (typeof width !== \"number\") {\n    throw new DeveloperError(\"width must be a number\");\n  }\n  if (\n    defined(colors) &&\n    ((colorsPerVertex && colors.length < positions.length) ||\n      (!colorsPerVertex && colors.length < positions.length - 1))\n  ) {\n    throw new DeveloperError(\"colors has an invalid length.\");\n  }\n  //>>includeEnd('debug');\n\n  this._positions = positions;\n  this._colors = colors;\n  this._width = width;\n  this._colorsPerVertex = colorsPerVertex;\n  this._vertexFormat = VertexFormat.clone(\n    defaultValue(options.vertexFormat, VertexFormat.DEFAULT)\n  );\n\n  this._arcType = defaultValue(options.arcType, ArcType.GEODESIC);\n  this._granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  this._ellipsoid = Ellipsoid.clone(\n    defaultValue(options.ellipsoid, Ellipsoid.WGS84)\n  );\n  this._workerName = \"createPolylineGeometry\";\n\n  let numComponents = 1 + positions.length * Cartesian3.packedLength;\n  numComponents += defined(colors) ? 1 + colors.length * Color.packedLength : 1;\n\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  this.packedLength =\n    numComponents + Ellipsoid.packedLength + VertexFormat.packedLength + 4;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PolylineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nPolylineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required\");\n  }\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  let i;\n\n  const positions = value._positions;\n  let length = positions.length;\n  array[startingIndex++] = length;\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    Cartesian3.pack(positions[i], array, startingIndex);\n  }\n\n  const colors = value._colors;\n  length = defined(colors) ? colors.length : 0.0;\n  array[startingIndex++] = length;\n\n  for (i = 0; i < length; ++i, startingIndex += Color.packedLength) {\n    Color.pack(colors[i], array, startingIndex);\n  }\n\n  Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  VertexFormat.pack(value._vertexFormat, array, startingIndex);\n  startingIndex += VertexFormat.packedLength;\n\n  array[startingIndex++] = value._width;\n  array[startingIndex++] = value._colorsPerVertex ? 1.0 : 0.0;\n  array[startingIndex++] = value._arcType;\n  array[startingIndex] = value._granularity;\n\n  return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n  positions: undefined,\n  colors: undefined,\n  ellipsoid: scratchEllipsoid,\n  vertexFormat: scratchVertexFormat,\n  width: undefined,\n  colorsPerVertex: undefined,\n  arcType: undefined,\n  granularity: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PolylineGeometry} [result] The object into which to store the result.\n * @returns {PolylineGeometry} The modified result parameter or a new PolylineGeometry instance if one was not provided.\n */\nPolylineGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  let i;\n\n  let length = array[startingIndex++];\n  const positions = new Array(length);\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    positions[i] = Cartesian3.unpack(array, startingIndex);\n  }\n\n  length = array[startingIndex++];\n  const colors = length > 0 ? new Array(length) : undefined;\n\n  for (i = 0; i < length; ++i, startingIndex += Color.packedLength) {\n    colors[i] = Color.unpack(array, startingIndex);\n  }\n\n  const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n  startingIndex += Ellipsoid.packedLength;\n\n  const vertexFormat = VertexFormat.unpack(\n    array,\n    startingIndex,\n    scratchVertexFormat\n  );\n  startingIndex += VertexFormat.packedLength;\n\n  const width = array[startingIndex++];\n  const colorsPerVertex = array[startingIndex++] === 1.0;\n  const arcType = array[startingIndex++];\n  const granularity = array[startingIndex];\n\n  if (!defined(result)) {\n    scratchOptions.positions = positions;\n    scratchOptions.colors = colors;\n    scratchOptions.width = width;\n    scratchOptions.colorsPerVertex = colorsPerVertex;\n    scratchOptions.arcType = arcType;\n    scratchOptions.granularity = granularity;\n    return new PolylineGeometry(scratchOptions);\n  }\n\n  result._positions = positions;\n  result._colors = colors;\n  result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n  result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n  result._width = width;\n  result._colorsPerVertex = colorsPerVertex;\n  result._arcType = arcType;\n  result._granularity = granularity;\n\n  return result;\n};\n\nconst scratchCartesian3 = new Cartesian3();\nconst scratchPosition = new Cartesian3();\nconst scratchPrevPosition = new Cartesian3();\nconst scratchNextPosition = new Cartesian3();\n\n/**\n * Computes the geometric representation of a polyline, including its vertices, indices, and a bounding sphere.\n *\n * @param {PolylineGeometry} polylineGeometry A description of the polyline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nPolylineGeometry.createGeometry = function (polylineGeometry) {\n  const width = polylineGeometry._width;\n  const vertexFormat = polylineGeometry._vertexFormat;\n  let colors = polylineGeometry._colors;\n  const colorsPerVertex = polylineGeometry._colorsPerVertex;\n  const arcType = polylineGeometry._arcType;\n  const granularity = polylineGeometry._granularity;\n  const ellipsoid = polylineGeometry._ellipsoid;\n\n  let i;\n  let j;\n  let k;\n\n  const removedIndices = [];\n  let positions = arrayRemoveDuplicates(\n    polylineGeometry._positions,\n    Cartesian3.equalsEpsilon,\n    false,\n    removedIndices\n  );\n\n  if (defined(colors) && removedIndices.length > 0) {\n    let removedArrayIndex = 0;\n    let nextRemovedIndex = removedIndices[0];\n    colors = colors.filter(function (color, index) {\n      let remove = false;\n      if (colorsPerVertex) {\n        remove =\n          index === nextRemovedIndex || (index === 0 && nextRemovedIndex === 1);\n      } else {\n        remove = index + 1 === nextRemovedIndex;\n      }\n\n      if (remove) {\n        removedArrayIndex++;\n        nextRemovedIndex = removedIndices[removedArrayIndex];\n        return false;\n      }\n      return true;\n    });\n  }\n\n  let positionsLength = positions.length;\n\n  // A width of a pixel or less is not a valid geometry, but in order to support external data\n  // that may have errors we treat this as an empty geometry.\n  if (positionsLength < 2 || width <= 0.0) {\n    return undefined;\n  }\n\n  if (arcType === ArcType.GEODESIC || arcType === ArcType.RHUMB) {\n    let subdivisionSize;\n    let numberOfPointsFunction;\n    if (arcType === ArcType.GEODESIC) {\n      subdivisionSize = CesiumMath.chordLength(\n        granularity,\n        ellipsoid.maximumRadius\n      );\n      numberOfPointsFunction = PolylinePipeline.numberOfPoints;\n    } else {\n      subdivisionSize = granularity;\n      numberOfPointsFunction = PolylinePipeline.numberOfPointsRhumbLine;\n    }\n\n    const heights = PolylinePipeline.extractHeights(positions, ellipsoid);\n\n    if (defined(colors)) {\n      let colorLength = 1;\n      for (i = 0; i < positionsLength - 1; ++i) {\n        colorLength += numberOfPointsFunction(\n          positions[i],\n          positions[i + 1],\n          subdivisionSize\n        );\n      }\n\n      const newColors = new Array(colorLength);\n      let newColorIndex = 0;\n\n      for (i = 0; i < positionsLength - 1; ++i) {\n        const p0 = positions[i];\n        const p1 = positions[i + 1];\n        const c0 = colors[i];\n\n        const numColors = numberOfPointsFunction(p0, p1, subdivisionSize);\n        if (colorsPerVertex && i < colorLength) {\n          const c1 = colors[i + 1];\n          const interpolatedColors = interpolateColors(\n            p0,\n            p1,\n            c0,\n            c1,\n            numColors\n          );\n          const interpolatedColorsLength = interpolatedColors.length;\n          for (j = 0; j < interpolatedColorsLength; ++j) {\n            newColors[newColorIndex++] = interpolatedColors[j];\n          }\n        } else {\n          for (j = 0; j < numColors; ++j) {\n            newColors[newColorIndex++] = Color.clone(c0);\n          }\n        }\n      }\n\n      newColors[newColorIndex] = Color.clone(colors[colors.length - 1]);\n      colors = newColors;\n\n      scratchInterpolateColorsArray.length = 0;\n    }\n\n    if (arcType === ArcType.GEODESIC) {\n      positions = PolylinePipeline.generateCartesianArc({\n        positions: positions,\n        minDistance: subdivisionSize,\n        ellipsoid: ellipsoid,\n        height: heights,\n      });\n    } else {\n      positions = PolylinePipeline.generateCartesianRhumbArc({\n        positions: positions,\n        granularity: subdivisionSize,\n        ellipsoid: ellipsoid,\n        height: heights,\n      });\n    }\n  }\n\n  positionsLength = positions.length;\n  const size = positionsLength * 4.0 - 4.0;\n\n  const finalPositions = new Float64Array(size * 3);\n  const prevPositions = new Float64Array(size * 3);\n  const nextPositions = new Float64Array(size * 3);\n  const expandAndWidth = new Float32Array(size * 2);\n  const st = vertexFormat.st ? new Float32Array(size * 2) : undefined;\n  const finalColors = defined(colors) ? new Uint8Array(size * 4) : undefined;\n\n  let positionIndex = 0;\n  let expandAndWidthIndex = 0;\n  let stIndex = 0;\n  let colorIndex = 0;\n  let position;\n\n  for (j = 0; j < positionsLength; ++j) {\n    if (j === 0) {\n      position = scratchCartesian3;\n      Cartesian3.subtract(positions[0], positions[1], position);\n      Cartesian3.add(positions[0], position, position);\n    } else {\n      position = positions[j - 1];\n    }\n\n    Cartesian3.clone(position, scratchPrevPosition);\n    Cartesian3.clone(positions[j], scratchPosition);\n\n    if (j === positionsLength - 1) {\n      position = scratchCartesian3;\n      Cartesian3.subtract(\n        positions[positionsLength - 1],\n        positions[positionsLength - 2],\n        position\n      );\n      Cartesian3.add(positions[positionsLength - 1], position, position);\n    } else {\n      position = positions[j + 1];\n    }\n\n    Cartesian3.clone(position, scratchNextPosition);\n\n    let color0, color1;\n    if (defined(finalColors)) {\n      if (j !== 0 && !colorsPerVertex) {\n        color0 = colors[j - 1];\n      } else {\n        color0 = colors[j];\n      }\n\n      if (j !== positionsLength - 1) {\n        color1 = colors[j];\n      }\n    }\n\n    const startK = j === 0 ? 2 : 0;\n    const endK = j === positionsLength - 1 ? 2 : 4;\n\n    for (k = startK; k < endK; ++k) {\n      Cartesian3.pack(scratchPosition, finalPositions, positionIndex);\n      Cartesian3.pack(scratchPrevPosition, prevPositions, positionIndex);\n      Cartesian3.pack(scratchNextPosition, nextPositions, positionIndex);\n      positionIndex += 3;\n\n      const direction = k - 2 < 0 ? -1.0 : 1.0;\n      expandAndWidth[expandAndWidthIndex++] = 2 * (k % 2) - 1; // expand direction\n      expandAndWidth[expandAndWidthIndex++] = direction * width;\n\n      if (vertexFormat.st) {\n        st[stIndex++] = j / (positionsLength - 1);\n        st[stIndex++] = Math.max(expandAndWidth[expandAndWidthIndex - 2], 0.0);\n      }\n\n      if (defined(finalColors)) {\n        const color = k < 2 ? color0 : color1;\n\n        finalColors[colorIndex++] = Color.floatToByte(color.red);\n        finalColors[colorIndex++] = Color.floatToByte(color.green);\n        finalColors[colorIndex++] = Color.floatToByte(color.blue);\n        finalColors[colorIndex++] = Color.floatToByte(color.alpha);\n      }\n    }\n  }\n\n  const attributes = new GeometryAttributes();\n\n  attributes.position = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.DOUBLE,\n    componentsPerAttribute: 3,\n    values: finalPositions,\n  });\n\n  attributes.prevPosition = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.DOUBLE,\n    componentsPerAttribute: 3,\n    values: prevPositions,\n  });\n\n  attributes.nextPosition = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.DOUBLE,\n    componentsPerAttribute: 3,\n    values: nextPositions,\n  });\n\n  attributes.expandAndWidth = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.FLOAT,\n    componentsPerAttribute: 2,\n    values: expandAndWidth,\n  });\n\n  if (vertexFormat.st) {\n    attributes.st = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.FLOAT,\n      componentsPerAttribute: 2,\n      values: st,\n    });\n  }\n\n  if (defined(finalColors)) {\n    attributes.color = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 4,\n      values: finalColors,\n      normalize: true,\n    });\n  }\n\n  const indices = IndexDatatype.createTypedArray(size, positionsLength * 6 - 6);\n  let index = 0;\n  let indicesIndex = 0;\n  const length = positionsLength - 1.0;\n  for (j = 0; j < length; ++j) {\n    indices[indicesIndex++] = index;\n    indices[indicesIndex++] = index + 2;\n    indices[indicesIndex++] = index + 1;\n\n    indices[indicesIndex++] = index + 1;\n    indices[indicesIndex++] = index + 2;\n    indices[indicesIndex++] = index + 3;\n\n    index += 4;\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: PrimitiveType.TRIANGLES,\n    boundingSphere: BoundingSphere.fromPoints(positions),\n    geometryType: GeometryType.POLYLINES,\n  });\n};\nexport default PolylineGeometry;\n", "import ArcType from \"../Core/ArcType.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport Event from \"../Core/Event.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GroundPolylineGeometry from \"../Core/GroundPolylineGeometry.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport PolylineGeometry from \"../Core/PolylineGeometry.js\";\nimport PolylinePipeline from \"../Core/PolylinePipeline.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport Entity from \"../DataSources/Entity.js\";\nimport ClassificationType from \"../Scene/ClassificationType.js\";\nimport GroundPolylinePrimitive from \"../Scene/GroundPolylinePrimitive.js\";\nimport PolylineCollection from \"../Scene/PolylineCollection.js\";\nimport PolylineColorAppearance from \"../Scene/PolylineColorAppearance.js\";\nimport PolylineMaterialAppearance from \"../Scene/PolylineMaterialAppearance.js\";\nimport ShadowMode from \"../Scene/ShadowMode.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\n\nconst defaultZIndex = new ConstantProperty(0);\n\n//We use this object to create one polyline collection per-scene.\nconst polylineCollections = {};\n\nconst scratchColor = new Color();\nconst defaultMaterial = new ColorMaterialProperty(Color.WHITE);\nconst defaultShow = new ConstantProperty(true);\nconst defaultShadows = new ConstantProperty(ShadowMode.DISABLED);\nconst defaultDistanceDisplayCondition = new ConstantProperty(\n  new DistanceDisplayCondition()\n);\nconst defaultClassificationType = new ConstantProperty(ClassificationType.BOTH);\n\nfunction GeometryOptions() {\n  this.vertexFormat = undefined;\n  this.positions = undefined;\n  this.width = undefined;\n  this.arcType = undefined;\n  this.granularity = undefined;\n}\n\nfunction GroundGeometryOptions() {\n  this.positions = undefined;\n  this.width = undefined;\n  this.arcType = undefined;\n  this.granularity = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for polylines.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias PolylineGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction PolylineGeometryUpdater(entity, scene) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(entity)) {\n    throw new DeveloperError(\"entity is required\");\n  }\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required\");\n  }\n  //>>includeEnd('debug');\n\n  this._entity = entity;\n  this._scene = scene;\n  this._entitySubscription = entity.definitionChanged.addEventListener(\n    PolylineGeometryUpdater.prototype._onEntityPropertyChanged,\n    this\n  );\n  this._fillEnabled = false;\n  this._dynamic = false;\n  this._geometryChanged = new Event();\n  this._showProperty = undefined;\n  this._materialProperty = undefined;\n  this._shadowsProperty = undefined;\n  this._distanceDisplayConditionProperty = undefined;\n  this._classificationTypeProperty = undefined;\n  this._depthFailMaterialProperty = undefined;\n  this._geometryOptions = new GeometryOptions();\n  this._groundGeometryOptions = new GroundGeometryOptions();\n  this._id = `polyline-${entity.id}`;\n  this._clampToGround = false;\n  this._supportsPolylinesOnTerrain = Entity.supportsPolylinesOnTerrain(scene);\n\n  this._zIndex = 0;\n\n  this._onEntityPropertyChanged(entity, \"polyline\", entity.polyline, undefined);\n}\n\nObject.defineProperties(PolylineGeometryUpdater.prototype, {\n  /**\n   * Gets the unique ID associated with this updater\n   * @memberof PolylineGeometryUpdater.prototype\n   * @type {string}\n   * @readonly\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n  /**\n   * Gets the entity associated with this geometry.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {Entity}\n   * @readonly\n   */\n  entity: {\n    get: function () {\n      return this._entity;\n    },\n  },\n  /**\n   * Gets a value indicating if the geometry has a fill component.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  fillEnabled: {\n    get: function () {\n      return this._fillEnabled;\n    },\n  },\n  /**\n   * Gets a value indicating if fill visibility varies with simulation time.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  hasConstantFill: {\n    get: function () {\n      return (\n        !this._fillEnabled ||\n        (!defined(this._entity.availability) &&\n          Property.isConstant(this._showProperty))\n      );\n    },\n  },\n  /**\n   * Gets the material property used to fill the geometry.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {MaterialProperty}\n   * @readonly\n   */\n  fillMaterialProperty: {\n    get: function () {\n      return this._materialProperty;\n    },\n  },\n  /**\n   * Gets the material property used to fill the geometry when it fails the depth test.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {MaterialProperty}\n   * @readonly\n   */\n  depthFailMaterialProperty: {\n    get: function () {\n      return this._depthFailMaterialProperty;\n    },\n  },\n  /**\n   * Gets a value indicating if the geometry has an outline component.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  outlineEnabled: {\n    value: false,\n  },\n  /**\n   * Gets a value indicating if outline visibility varies with simulation time.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  hasConstantOutline: {\n    value: true,\n  },\n  /**\n   * Gets the {@link Color} property for the geometry outline.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {Property}\n   * @readonly\n   */\n  outlineColorProperty: {\n    value: undefined,\n  },\n  /**\n   * Gets the property specifying whether the geometry\n   * casts or receives shadows from light sources.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {Property}\n   * @readonly\n   */\n  shadowsProperty: {\n    get: function () {\n      return this._shadowsProperty;\n    },\n  },\n  /**\n   * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {Property}\n   * @readonly\n   */\n  distanceDisplayConditionProperty: {\n    get: function () {\n      return this._distanceDisplayConditionProperty;\n    },\n  },\n  /**\n   * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {Property}\n   * @readonly\n   */\n  classificationTypeProperty: {\n    get: function () {\n      return this._classificationTypeProperty;\n    },\n  },\n  /**\n   * Gets a value indicating if the geometry is time-varying.\n   * If true, all visualization is delegated to the {@link DynamicGeometryUpdater}\n   * returned by GeometryUpdater#createDynamicUpdater.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isDynamic: {\n    get: function () {\n      return this._dynamic;\n    },\n  },\n  /**\n   * Gets a value indicating if the geometry is closed.\n   * This property is only valid for static geometry.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  isClosed: {\n    value: false,\n  },\n  /**\n   * Gets an event that is raised whenever the public properties\n   * of this updater change.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  geometryChanged: {\n    get: function () {\n      return this._geometryChanged;\n    },\n  },\n\n  /**\n   * Gets a value indicating if the path of the line.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {ArcType}\n   * @readonly\n   */\n  arcType: {\n    get: function () {\n      return this._arcType;\n    },\n  },\n\n  /**\n   * Gets a value indicating if the geometry is clamped to the ground.\n   * Returns false if polylines on terrain is not supported.\n   * @memberof PolylineGeometryUpdater.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  clampToGround: {\n    get: function () {\n      return this._clampToGround && this._supportsPolylinesOnTerrain;\n    },\n  },\n\n  /**\n   * Gets the zindex\n   * @type {number}\n   * @memberof PolylineGeometryUpdater.prototype\n   * @readonly\n   */\n  zIndex: {\n    get: function () {\n      return this._zIndex;\n    },\n  },\n});\n\n/**\n * Checks if the geometry is outlined at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve visibility.\n * @returns {boolean} true if geometry is outlined at the provided time, false otherwise.\n */\nPolylineGeometryUpdater.prototype.isOutlineVisible = function (time) {\n  return false;\n};\n\n/**\n * Checks if the geometry is filled at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve visibility.\n * @returns {boolean} true if geometry is filled at the provided time, false otherwise.\n */\nPolylineGeometryUpdater.prototype.isFilled = function (time) {\n  const entity = this._entity;\n  const visible =\n    this._fillEnabled &&\n    entity.isAvailable(time) &&\n    this._showProperty.getValue(time);\n  return defaultValue(visible, false);\n};\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nPolylineGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(time)) {\n    throw new DeveloperError(\"time is required.\");\n  }\n\n  if (!this._fillEnabled) {\n    throw new DeveloperError(\n      \"This instance does not represent a filled geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const entity = this._entity;\n  const isAvailable = entity.isAvailable(time);\n  const show = new ShowGeometryInstanceAttribute(\n    isAvailable && entity.isShowing && this._showProperty.getValue(time)\n  );\n  const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n    time\n  );\n  const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n    distanceDisplayCondition\n  );\n\n  const attributes = {\n    show: show,\n    distanceDisplayCondition: distanceDisplayConditionAttribute,\n  };\n\n  let currentColor;\n  if (this._materialProperty instanceof ColorMaterialProperty) {\n    if (\n      defined(this._materialProperty.color) &&\n      (this._materialProperty.color.isConstant || isAvailable)\n    ) {\n      currentColor = this._materialProperty.color.getValue(time, scratchColor);\n    }\n    if (!defined(currentColor)) {\n      currentColor = Color.WHITE;\n    }\n    attributes.color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n  }\n\n  if (this.clampToGround) {\n    return new GeometryInstance({\n      id: entity,\n      geometry: new GroundPolylineGeometry(this._groundGeometryOptions),\n      attributes: attributes,\n    });\n  }\n\n  if (\n    defined(this._depthFailMaterialProperty) &&\n    this._depthFailMaterialProperty instanceof ColorMaterialProperty\n  ) {\n    if (\n      defined(this._depthFailMaterialProperty.color) &&\n      (this._depthFailMaterialProperty.color.isConstant || isAvailable)\n    ) {\n      currentColor = this._depthFailMaterialProperty.color.getValue(\n        time,\n        scratchColor\n      );\n    }\n    if (!defined(currentColor)) {\n      currentColor = Color.WHITE;\n    }\n    attributes.depthFailColor = ColorGeometryInstanceAttribute.fromColor(\n      currentColor\n    );\n  }\n\n  return new GeometryInstance({\n    id: entity,\n    geometry: new PolylineGeometry(this._geometryOptions),\n    attributes: attributes,\n  });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nPolylineGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n  time\n) {\n  //>>includeStart('debug', pragmas.debug);\n  throw new DeveloperError(\n    \"This instance does not represent an outlined geometry.\"\n  );\n  //>>includeEnd('debug');\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n */\nPolylineGeometryUpdater.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys and resources used by the object.  Once an object is destroyed, it should not be used.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nPolylineGeometryUpdater.prototype.destroy = function () {\n  this._entitySubscription();\n  destroyObject(this);\n};\n\nPolylineGeometryUpdater.prototype._onEntityPropertyChanged = function (\n  entity,\n  propertyName,\n  newValue,\n  oldValue\n) {\n  if (!(propertyName === \"availability\" || propertyName === \"polyline\")) {\n    return;\n  }\n\n  const polyline = this._entity.polyline;\n\n  if (!defined(polyline)) {\n    if (this._fillEnabled) {\n      this._fillEnabled = false;\n      this._geometryChanged.raiseEvent(this);\n    }\n    return;\n  }\n\n  const positionsProperty = polyline.positions;\n\n  const show = polyline.show;\n  if (\n    (defined(show) &&\n      show.isConstant &&\n      !show.getValue(Iso8601.MINIMUM_VALUE)) || //\n    !defined(positionsProperty)\n  ) {\n    if (this._fillEnabled) {\n      this._fillEnabled = false;\n      this._geometryChanged.raiseEvent(this);\n    }\n    return;\n  }\n\n  const zIndex = polyline.zIndex;\n  const material = defaultValue(polyline.material, defaultMaterial);\n  const isColorMaterial = material instanceof ColorMaterialProperty;\n  this._materialProperty = material;\n  this._depthFailMaterialProperty = polyline.depthFailMaterial;\n  this._showProperty = defaultValue(show, defaultShow);\n  this._shadowsProperty = defaultValue(polyline.shadows, defaultShadows);\n  this._distanceDisplayConditionProperty = defaultValue(\n    polyline.distanceDisplayCondition,\n    defaultDistanceDisplayCondition\n  );\n  this._classificationTypeProperty = defaultValue(\n    polyline.classificationType,\n    defaultClassificationType\n  );\n  this._fillEnabled = true;\n  this._zIndex = defaultValue(zIndex, defaultZIndex);\n\n  const width = polyline.width;\n  const arcType = polyline.arcType;\n  const clampToGround = polyline.clampToGround;\n  const granularity = polyline.granularity;\n\n  if (\n    !positionsProperty.isConstant ||\n    !Property.isConstant(width) ||\n    !Property.isConstant(arcType) ||\n    !Property.isConstant(granularity) ||\n    !Property.isConstant(clampToGround) ||\n    !Property.isConstant(zIndex)\n  ) {\n    if (!this._dynamic) {\n      this._dynamic = true;\n      this._geometryChanged.raiseEvent(this);\n    }\n  } else {\n    const geometryOptions = this._geometryOptions;\n    const positions = positionsProperty.getValue(\n      Iso8601.MINIMUM_VALUE,\n      geometryOptions.positions\n    );\n\n    //Because of the way we currently handle reference properties,\n    //we can't automatically assume the positions are always valid.\n    if (!defined(positions) || positions.length < 2) {\n      if (this._fillEnabled) {\n        this._fillEnabled = false;\n        this._geometryChanged.raiseEvent(this);\n      }\n      return;\n    }\n\n    let vertexFormat;\n    if (\n      isColorMaterial &&\n      (!defined(this._depthFailMaterialProperty) ||\n        this._depthFailMaterialProperty instanceof ColorMaterialProperty)\n    ) {\n      vertexFormat = PolylineColorAppearance.VERTEX_FORMAT;\n    } else {\n      vertexFormat = PolylineMaterialAppearance.VERTEX_FORMAT;\n    }\n\n    geometryOptions.vertexFormat = vertexFormat;\n    geometryOptions.positions = positions;\n    geometryOptions.width = defined(width)\n      ? width.getValue(Iso8601.MINIMUM_VALUE)\n      : undefined;\n    geometryOptions.arcType = defined(arcType)\n      ? arcType.getValue(Iso8601.MINIMUM_VALUE)\n      : undefined;\n    geometryOptions.granularity = defined(granularity)\n      ? granularity.getValue(Iso8601.MINIMUM_VALUE)\n      : undefined;\n\n    const groundGeometryOptions = this._groundGeometryOptions;\n    groundGeometryOptions.positions = positions;\n    groundGeometryOptions.width = geometryOptions.width;\n    groundGeometryOptions.arcType = geometryOptions.arcType;\n    groundGeometryOptions.granularity = geometryOptions.granularity;\n\n    this._clampToGround = defined(clampToGround)\n      ? clampToGround.getValue(Iso8601.MINIMUM_VALUE)\n      : false;\n\n    if (!this._clampToGround && defined(zIndex)) {\n      oneTimeWarning(\n        \"Entity polylines must have clampToGround: true when using zIndex.  zIndex will be ignored.\"\n      );\n    }\n\n    this._dynamic = false;\n    this._geometryChanged.raiseEvent(this);\n  }\n};\n\n/**\n * Creates the dynamic updater to be used when GeometryUpdater#isDynamic is true.\n *\n * @param {PrimitiveCollection} primitives The primitive collection to use.\n * @param {PrimitiveCollection|OrderedGroundPrimitiveCollection} groundPrimitives The primitive collection to use for ordered ground primitives.\n * @returns {DynamicGeometryUpdater} The dynamic updater used to update the geometry each frame.\n *\n * @exception {DeveloperError} This instance does not represent dynamic geometry.\n * @private\n */\nPolylineGeometryUpdater.prototype.createDynamicUpdater = function (\n  primitives,\n  groundPrimitives\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"primitives\", primitives);\n  Check.defined(\"groundPrimitives\", groundPrimitives);\n\n  if (!this._dynamic) {\n    throw new DeveloperError(\n      \"This instance does not represent dynamic geometry.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  return new DynamicGeometryUpdater(primitives, groundPrimitives, this);\n};\n\n/**\n * @private\n */\nconst generateCartesianArcOptions = {\n  positions: undefined,\n  granularity: undefined,\n  height: undefined,\n  ellipsoid: undefined,\n};\n\nfunction DynamicGeometryUpdater(primitives, groundPrimitives, geometryUpdater) {\n  this._line = undefined;\n  this._primitives = primitives;\n  this._groundPrimitives = groundPrimitives;\n  this._groundPolylinePrimitive = undefined;\n  this._material = undefined;\n  this._geometryUpdater = geometryUpdater;\n  this._positions = [];\n}\n\nfunction getLine(dynamicGeometryUpdater) {\n  if (defined(dynamicGeometryUpdater._line)) {\n    return dynamicGeometryUpdater._line;\n  }\n\n  const sceneId = dynamicGeometryUpdater._geometryUpdater._scene.id;\n  let polylineCollection = polylineCollections[sceneId];\n  const primitives = dynamicGeometryUpdater._primitives;\n  if (!defined(polylineCollection) || polylineCollection.isDestroyed()) {\n    polylineCollection = new PolylineCollection();\n    polylineCollections[sceneId] = polylineCollection;\n    primitives.add(polylineCollection);\n  } else if (!primitives.contains(polylineCollection)) {\n    primitives.add(polylineCollection);\n  }\n\n  const line = polylineCollection.add();\n  line.id = dynamicGeometryUpdater._geometryUpdater._entity;\n  dynamicGeometryUpdater._line = line;\n  return line;\n}\n\nDynamicGeometryUpdater.prototype.update = function (time) {\n  const geometryUpdater = this._geometryUpdater;\n  const entity = geometryUpdater._entity;\n  const polyline = entity.polyline;\n\n  const positionsProperty = polyline.positions;\n  let positions = Property.getValueOrUndefined(\n    positionsProperty,\n    time,\n    this._positions\n  );\n\n  // Synchronize with geometryUpdater for GroundPolylinePrimitive\n  geometryUpdater._clampToGround = Property.getValueOrDefault(\n    polyline._clampToGround,\n    time,\n    false\n  );\n  geometryUpdater._groundGeometryOptions.positions = positions;\n  geometryUpdater._groundGeometryOptions.width = Property.getValueOrDefault(\n    polyline._width,\n    time,\n    1\n  );\n  geometryUpdater._groundGeometryOptions.arcType = Property.getValueOrDefault(\n    polyline._arcType,\n    time,\n    ArcType.GEODESIC\n  );\n  geometryUpdater._groundGeometryOptions.granularity = Property.getValueOrDefault(\n    polyline._granularity,\n    time,\n    9999\n  );\n\n  const groundPrimitives = this._groundPrimitives;\n\n  if (defined(this._groundPolylinePrimitive)) {\n    groundPrimitives.remove(this._groundPolylinePrimitive); // destroys by default\n    this._groundPolylinePrimitive = undefined;\n  }\n\n  if (geometryUpdater.clampToGround) {\n    if (\n      !entity.isShowing ||\n      !entity.isAvailable(time) ||\n      !Property.getValueOrDefault(polyline._show, time, true)\n    ) {\n      return;\n    }\n\n    if (!defined(positions) || positions.length < 2) {\n      return;\n    }\n\n    const fillMaterialProperty = geometryUpdater.fillMaterialProperty;\n    let appearance;\n    if (fillMaterialProperty instanceof ColorMaterialProperty) {\n      appearance = new PolylineColorAppearance();\n    } else {\n      const material = MaterialProperty.getValue(\n        time,\n        fillMaterialProperty,\n        this._material\n      );\n      appearance = new PolylineMaterialAppearance({\n        material: material,\n        translucent: material.isTranslucent(),\n      });\n      this._material = material;\n    }\n\n    this._groundPolylinePrimitive = groundPrimitives.add(\n      new GroundPolylinePrimitive({\n        geometryInstances: geometryUpdater.createFillGeometryInstance(time),\n        appearance: appearance,\n        classificationType: geometryUpdater.classificationTypeProperty.getValue(\n          time\n        ),\n        asynchronous: false,\n      }),\n      Property.getValueOrUndefined(geometryUpdater.zIndex, time)\n    );\n\n    // Hide the polyline in the collection, if any\n    if (defined(this._line)) {\n      this._line.show = false;\n    }\n    return;\n  }\n\n  const line = getLine(this);\n\n  if (\n    !entity.isShowing ||\n    !entity.isAvailable(time) ||\n    !Property.getValueOrDefault(polyline._show, time, true)\n  ) {\n    line.show = false;\n    return;\n  }\n\n  if (!defined(positions) || positions.length < 2) {\n    line.show = false;\n    return;\n  }\n\n  let arcType = ArcType.GEODESIC;\n  arcType = Property.getValueOrDefault(polyline._arcType, time, arcType);\n\n  const globe = geometryUpdater._scene.globe;\n  if (arcType !== ArcType.NONE && defined(globe)) {\n    generateCartesianArcOptions.ellipsoid = globe.ellipsoid;\n    generateCartesianArcOptions.positions = positions;\n    generateCartesianArcOptions.granularity = Property.getValueOrUndefined(\n      polyline._granularity,\n      time\n    );\n    generateCartesianArcOptions.height = PolylinePipeline.extractHeights(\n      positions,\n      globe.ellipsoid\n    );\n    if (arcType === ArcType.GEODESIC) {\n      positions = PolylinePipeline.generateCartesianArc(\n        generateCartesianArcOptions\n      );\n    } else {\n      positions = PolylinePipeline.generateCartesianRhumbArc(\n        generateCartesianArcOptions\n      );\n    }\n  }\n\n  line.show = true;\n  line.positions = positions.slice();\n  line.material = MaterialProperty.getValue(\n    time,\n    geometryUpdater.fillMaterialProperty,\n    line.material\n  );\n  line.width = Property.getValueOrDefault(polyline._width, time, 1);\n  line.distanceDisplayCondition = Property.getValueOrUndefined(\n    polyline._distanceDisplayCondition,\n    time,\n    line.distanceDisplayCondition\n  );\n};\n\nDynamicGeometryUpdater.prototype.getBoundingSphere = function (result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"result\", result);\n  //>>includeEnd('debug');\n\n  if (!this._geometryUpdater.clampToGround) {\n    const line = getLine(this);\n    if (line.show && line.positions.length > 0) {\n      BoundingSphere.fromPoints(line.positions, result);\n      return BoundingSphereState.DONE;\n    }\n  } else {\n    const groundPolylinePrimitive = this._groundPolylinePrimitive;\n    if (\n      defined(groundPolylinePrimitive) &&\n      groundPolylinePrimitive.show &&\n      groundPolylinePrimitive.ready\n    ) {\n      const attributes = groundPolylinePrimitive.getGeometryInstanceAttributes(\n        this._geometryUpdater._entity\n      );\n      if (defined(attributes) && defined(attributes.boundingSphere)) {\n        BoundingSphere.clone(attributes.boundingSphere, result);\n        return BoundingSphereState.DONE;\n      }\n    }\n\n    if (defined(groundPolylinePrimitive) && !groundPolylinePrimitive.ready) {\n      return BoundingSphereState.PENDING;\n    }\n\n    return BoundingSphereState.DONE;\n  }\n\n  return BoundingSphereState.FAILED;\n};\n\nDynamicGeometryUpdater.prototype.isDestroyed = function () {\n  return false;\n};\n\nDynamicGeometryUpdater.prototype.destroy = function () {\n  const geometryUpdater = this._geometryUpdater;\n  const sceneId = geometryUpdater._scene.id;\n  const polylineCollection = polylineCollections[sceneId];\n  if (defined(polylineCollection)) {\n    polylineCollection.remove(this._line);\n    if (polylineCollection.length === 0) {\n      this._primitives.removeAndDestroy(polylineCollection);\n      delete polylineCollections[sceneId];\n    }\n  }\n  if (defined(this._groundPolylinePrimitive)) {\n    this._groundPrimitives.remove(this._groundPolylinePrimitive);\n  }\n  destroyObject(this);\n};\nexport default PolylineGeometryUpdater;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport GroundPolylinePrimitive from \"../Scene/GroundPolylinePrimitive.js\";\nimport PolylineColorAppearance from \"../Scene/PolylineColorAppearance.js\";\nimport PolylineMaterialAppearance from \"../Scene/PolylineMaterialAppearance.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\n\nconst scratchColor = new Color();\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\nconst defaultDistanceDisplayCondition = new DistanceDisplayCondition();\n\n// Encapsulates a Primitive and all the entities that it represents.\nfunction Batch(\n  orderedGroundPrimitives,\n  classificationType,\n  materialProperty,\n  zIndex,\n  asynchronous\n) {\n  let appearanceType;\n  if (materialProperty instanceof ColorMaterialProperty) {\n    appearanceType = PolylineColorAppearance;\n  } else {\n    appearanceType = PolylineMaterialAppearance;\n  }\n\n  this.orderedGroundPrimitives = orderedGroundPrimitives; // scene level primitive collection\n  this.classificationType = classificationType;\n  this.appearanceType = appearanceType;\n  this.materialProperty = materialProperty;\n  this.updaters = new AssociativeArray();\n  this.createPrimitive = true;\n  this.primitive = undefined; // a GroundPolylinePrimitive encapsulating all the entities\n  this.oldPrimitive = undefined;\n  this.geometry = new AssociativeArray();\n  this.material = undefined;\n  this.updatersWithAttributes = new AssociativeArray();\n  this.attributes = new AssociativeArray();\n  this.invalidated = false;\n  this.removeMaterialSubscription = materialProperty.definitionChanged.addEventListener(\n    Batch.prototype.onMaterialChanged,\n    this\n  );\n  this.subscriptions = new AssociativeArray();\n  this.showsUpdated = new AssociativeArray();\n  this.zIndex = zIndex;\n\n  this._asynchronous = asynchronous;\n}\n\nBatch.prototype.onMaterialChanged = function () {\n  this.invalidated = true;\n};\n\n// Check if the given updater's material is compatible with this batch\nBatch.prototype.isMaterial = function (updater) {\n  const material = this.materialProperty;\n  const updaterMaterial = updater.fillMaterialProperty;\n\n  if (\n    updaterMaterial === material ||\n    (updaterMaterial instanceof ColorMaterialProperty &&\n      material instanceof ColorMaterialProperty)\n  ) {\n    return true;\n  }\n  return defined(material) && material.equals(updaterMaterial);\n};\n\nBatch.prototype.add = function (time, updater, geometryInstance) {\n  const id = updater.id;\n  this.updaters.set(id, updater);\n  this.geometry.set(id, geometryInstance);\n  // Updaters with dynamic attributes must be tracked separately, may exit the batch\n  if (\n    !updater.hasConstantFill ||\n    !updater.fillMaterialProperty.isConstant ||\n    !Property.isConstant(updater.distanceDisplayConditionProperty)\n  ) {\n    this.updatersWithAttributes.set(id, updater);\n  } else {\n    const that = this;\n    // Listen for show changes. These will be synchronized in updateShows.\n    this.subscriptions.set(\n      id,\n      updater.entity.definitionChanged.addEventListener(function (\n        entity,\n        propertyName,\n        newValue,\n        oldValue\n      ) {\n        if (propertyName === \"isShowing\") {\n          that.showsUpdated.set(updater.id, updater);\n        }\n      })\n    );\n  }\n  this.createPrimitive = true;\n};\n\nBatch.prototype.remove = function (updater) {\n  const id = updater.id;\n  this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;\n  if (this.updaters.remove(id)) {\n    this.updatersWithAttributes.remove(id);\n    const unsubscribe = this.subscriptions.get(id);\n    if (defined(unsubscribe)) {\n      unsubscribe();\n      this.subscriptions.remove(id);\n    }\n    return true;\n  }\n  return false;\n};\n\nBatch.prototype.update = function (time) {\n  let isUpdated = true;\n  let primitive = this.primitive;\n  const orderedGroundPrimitives = this.orderedGroundPrimitives;\n  const geometries = this.geometry.values;\n  let i;\n\n  if (this.createPrimitive) {\n    const geometriesLength = geometries.length;\n    if (geometriesLength > 0) {\n      if (defined(primitive)) {\n        // Keep a handle to the old primitive so it can be removed when the updated version is ready.\n        if (!defined(this.oldPrimitive)) {\n          this.oldPrimitive = primitive;\n        } else {\n          // For if the new primitive changes again before it is ready.\n          orderedGroundPrimitives.remove(primitive);\n        }\n      }\n\n      primitive = new GroundPolylinePrimitive({\n        show: false,\n        asynchronous: this._asynchronous,\n        geometryInstances: geometries.slice(),\n        appearance: new this.appearanceType(),\n        classificationType: this.classificationType,\n      });\n\n      if (this.appearanceType === PolylineMaterialAppearance) {\n        this.material = MaterialProperty.getValue(\n          time,\n          this.materialProperty,\n          this.material\n        );\n        primitive.appearance.material = this.material;\n      }\n\n      orderedGroundPrimitives.add(primitive, this.zIndex);\n      isUpdated = false;\n    } else {\n      if (defined(primitive)) {\n        orderedGroundPrimitives.remove(primitive);\n        primitive = undefined;\n      }\n      const oldPrimitive = this.oldPrimitive;\n      if (defined(oldPrimitive)) {\n        orderedGroundPrimitives.remove(oldPrimitive);\n        this.oldPrimitive = undefined;\n      }\n    }\n\n    this.attributes.removeAll();\n    this.primitive = primitive;\n    this.createPrimitive = false;\n  } else if (defined(primitive) && primitive.ready) {\n    primitive.show = true;\n    if (defined(this.oldPrimitive)) {\n      orderedGroundPrimitives.remove(this.oldPrimitive);\n      this.oldPrimitive = undefined;\n    }\n\n    if (this.appearanceType === PolylineMaterialAppearance) {\n      this.material = MaterialProperty.getValue(\n        time,\n        this.materialProperty,\n        this.material\n      );\n      this.primitive.appearance.material = this.material;\n    }\n    const updatersWithAttributes = this.updatersWithAttributes.values;\n    const length = updatersWithAttributes.length;\n    for (i = 0; i < length; i++) {\n      const updater = updatersWithAttributes[i];\n      const entity = updater.entity;\n      const instance = this.geometry.get(updater.id);\n\n      let attributes = this.attributes.get(instance.id.id);\n      if (!defined(attributes)) {\n        attributes = primitive.getGeometryInstanceAttributes(instance.id);\n        this.attributes.set(instance.id.id, attributes);\n      }\n\n      if (!updater.fillMaterialProperty.isConstant) {\n        const colorProperty = updater.fillMaterialProperty.color;\n        const resultColor = Property.getValueOrDefault(\n          colorProperty,\n          time,\n          Color.WHITE,\n          scratchColor\n        );\n        if (!Color.equals(attributes._lastColor, resultColor)) {\n          attributes._lastColor = Color.clone(\n            resultColor,\n            attributes._lastColor\n          );\n          attributes.color = ColorGeometryInstanceAttribute.toValue(\n            resultColor,\n            attributes.color\n          );\n        }\n      }\n\n      const show =\n        entity.isShowing && (updater.hasConstantFill || updater.isFilled(time));\n      const currentShow = attributes.show[0] === 1;\n      if (show !== currentShow) {\n        attributes.show = ShowGeometryInstanceAttribute.toValue(\n          show,\n          attributes.show\n        );\n      }\n\n      const distanceDisplayConditionProperty =\n        updater.distanceDisplayConditionProperty;\n      if (!Property.isConstant(distanceDisplayConditionProperty)) {\n        const distanceDisplayCondition = Property.getValueOrDefault(\n          distanceDisplayConditionProperty,\n          time,\n          defaultDistanceDisplayCondition,\n          distanceDisplayConditionScratch\n        );\n        if (\n          !DistanceDisplayCondition.equals(\n            distanceDisplayCondition,\n            attributes._lastDistanceDisplayCondition\n          )\n        ) {\n          attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone(\n            distanceDisplayCondition,\n            attributes._lastDistanceDisplayCondition\n          );\n          attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n            distanceDisplayCondition,\n            attributes.distanceDisplayCondition\n          );\n        }\n      }\n    }\n\n    this.updateShows(primitive);\n  } else if (defined(primitive) && !primitive.ready) {\n    isUpdated = false;\n  }\n  return isUpdated;\n};\n\nBatch.prototype.updateShows = function (primitive) {\n  const showsUpdated = this.showsUpdated.values;\n  const length = showsUpdated.length;\n  for (let i = 0; i < length; i++) {\n    const updater = showsUpdated[i];\n    const entity = updater.entity;\n    const instance = this.geometry.get(updater.id);\n\n    let attributes = this.attributes.get(instance.id.id);\n    if (!defined(attributes)) {\n      attributes = primitive.getGeometryInstanceAttributes(instance.id);\n      this.attributes.set(instance.id.id, attributes);\n    }\n\n    const show = entity.isShowing;\n    const currentShow = attributes.show[0] === 1;\n    if (show !== currentShow) {\n      attributes.show = ShowGeometryInstanceAttribute.toValue(\n        show,\n        attributes.show\n      );\n      instance.attributes.show.value[0] = attributes.show[0];\n    }\n  }\n  this.showsUpdated.removeAll();\n};\n\nBatch.prototype.contains = function (updater) {\n  return this.updaters.contains(updater.id);\n};\n\nBatch.prototype.getBoundingSphere = function (updater, result) {\n  const primitive = this.primitive;\n  if (!primitive.ready) {\n    return BoundingSphereState.PENDING;\n  }\n  const attributes = primitive.getGeometryInstanceAttributes(updater.entity);\n  if (\n    !defined(attributes) ||\n    !defined(attributes.boundingSphere) ||\n    (defined(attributes.show) && attributes.show[0] === 0)\n  ) {\n    return BoundingSphereState.FAILED;\n  }\n  attributes.boundingSphere.clone(result);\n  return BoundingSphereState.DONE;\n};\n\nBatch.prototype.destroy = function () {\n  const primitive = this.primitive;\n  const orderedGroundPrimitives = this.orderedGroundPrimitives;\n  if (defined(primitive)) {\n    orderedGroundPrimitives.remove(primitive);\n  }\n  const oldPrimitive = this.oldPrimitive;\n  if (defined(oldPrimitive)) {\n    orderedGroundPrimitives.remove(oldPrimitive);\n  }\n  this.removeMaterialSubscription();\n};\n\n/**\n * @private\n */\nfunction StaticGroundPolylinePerMaterialBatch(\n  orderedGroundPrimitives,\n  classificationType,\n  asynchronous\n) {\n  this._items = [];\n  this._orderedGroundPrimitives = orderedGroundPrimitives;\n  this._classificationType = classificationType;\n  this._asynchronous = defaultValue(asynchronous, true);\n}\n\nStaticGroundPolylinePerMaterialBatch.prototype.add = function (time, updater) {\n  const items = this._items;\n  const length = items.length;\n  const geometryInstance = updater.createFillGeometryInstance(time);\n  const zIndex = Property.getValueOrDefault(updater.zIndex, 0);\n  // Check if the Entity represented by the updater has the same material or a material representable with per-instance color.\n  for (let i = 0; i < length; ++i) {\n    const item = items[i];\n    if (item.isMaterial(updater) && item.zIndex === zIndex) {\n      item.add(time, updater, geometryInstance);\n      return;\n    }\n  }\n  // If a compatible batch wasn't found, create a new batch.\n  const batch = new Batch(\n    this._orderedGroundPrimitives,\n    this._classificationType,\n    updater.fillMaterialProperty,\n    zIndex,\n    this._asynchronous\n  );\n  batch.add(time, updater, geometryInstance);\n  items.push(batch);\n};\n\nStaticGroundPolylinePerMaterialBatch.prototype.remove = function (updater) {\n  const items = this._items;\n  const length = items.length;\n  for (let i = length - 1; i >= 0; i--) {\n    const item = items[i];\n    if (item.remove(updater)) {\n      if (item.updaters.length === 0) {\n        items.splice(i, 1);\n        item.destroy();\n      }\n      break;\n    }\n  }\n};\n\nStaticGroundPolylinePerMaterialBatch.prototype.update = function (time) {\n  let i;\n  const items = this._items;\n  const length = items.length;\n\n  for (i = length - 1; i >= 0; i--) {\n    const item = items[i];\n    if (item.invalidated) {\n      items.splice(i, 1);\n      const updaters = item.updaters.values;\n      const updatersLength = updaters.length;\n      for (let h = 0; h < updatersLength; h++) {\n        this.add(time, updaters[h]);\n      }\n      item.destroy();\n    }\n  }\n\n  let isUpdated = true;\n  for (i = 0; i < items.length; i++) {\n    isUpdated = items[i].update(time) && isUpdated;\n  }\n  return isUpdated;\n};\n\nStaticGroundPolylinePerMaterialBatch.prototype.getBoundingSphere = function (\n  updater,\n  result\n) {\n  const items = this._items;\n  const length = items.length;\n  for (let i = 0; i < length; i++) {\n    const item = items[i];\n    if (item.contains(updater)) {\n      return item.getBoundingSphere(updater, result);\n    }\n  }\n  return BoundingSphereState.FAILED;\n};\n\nStaticGroundPolylinePerMaterialBatch.prototype.removeAllPrimitives = function () {\n  const items = this._items;\n  const length = items.length;\n  for (let i = 0; i < length; i++) {\n    items[i].destroy();\n  }\n  this._items.length = 0;\n};\nexport default StaticGroundPolylinePerMaterialBatch;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport ClassificationType from \"../Scene/ClassificationType.js\";\nimport PolylineColorAppearance from \"../Scene/PolylineColorAppearance.js\";\nimport PolylineMaterialAppearance from \"../Scene/PolylineMaterialAppearance.js\";\nimport ShadowMode from \"../Scene/ShadowMode.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryBatch from \"./DynamicGeometryBatch.js\";\nimport PolylineGeometryUpdater from \"./PolylineGeometryUpdater.js\";\nimport StaticGeometryColorBatch from \"./StaticGeometryColorBatch.js\";\nimport StaticGeometryPerMaterialBatch from \"./StaticGeometryPerMaterialBatch.js\";\nimport StaticGroundPolylinePerMaterialBatch from \"./StaticGroundPolylinePerMaterialBatch.js\";\n\nconst emptyArray = [];\n\nfunction removeUpdater(that, updater) {\n  //We don't keep track of which batch an updater is in, so just remove it from all of them.\n  const batches = that._batches;\n  const length = batches.length;\n  for (let i = 0; i < length; i++) {\n    batches[i].remove(updater);\n  }\n}\n\nfunction insertUpdaterIntoBatch(that, time, updater) {\n  if (updater.isDynamic) {\n    that._dynamicBatch.add(time, updater);\n    return;\n  }\n\n  if (updater.clampToGround && updater.fillEnabled) {\n    // Also checks for support\n    const classificationType = updater.classificationTypeProperty.getValue(\n      time\n    );\n    that._groundBatches[classificationType].add(time, updater);\n    return;\n  }\n\n  let shadows;\n  if (updater.fillEnabled) {\n    shadows = updater.shadowsProperty.getValue(time);\n  }\n\n  let multiplier = 0;\n  if (defined(updater.depthFailMaterialProperty)) {\n    multiplier =\n      updater.depthFailMaterialProperty instanceof ColorMaterialProperty\n        ? 1\n        : 2;\n  }\n\n  let index;\n  if (defined(shadows)) {\n    index = shadows + multiplier * ShadowMode.NUMBER_OF_SHADOW_MODES;\n  }\n\n  if (updater.fillEnabled) {\n    if (updater.fillMaterialProperty instanceof ColorMaterialProperty) {\n      that._colorBatches[index].add(time, updater);\n    } else {\n      that._materialBatches[index].add(time, updater);\n    }\n  }\n}\n\n/**\n * A visualizer for polylines represented by {@link Primitive} instances.\n * @alias PolylineVisualizer\n * @constructor\n *\n * @param {Scene} scene The scene the primitives will be rendered in.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n * @param {PrimitiveCollection} [primitives=scene.primitives] A collection to add primitives related to the entities\n * @param {PrimitiveCollection} [groundPrimitives=scene.groundPrimitives] A collection to add ground primitives related to the entities\n */\nfunction PolylineVisualizer(\n  scene,\n  entityCollection,\n  primitives,\n  groundPrimitives\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"scene\", scene);\n  Check.defined(\"entityCollection\", entityCollection);\n  //>>includeEnd('debug');\n\n  groundPrimitives = defaultValue(groundPrimitives, scene.groundPrimitives);\n  primitives = defaultValue(primitives, scene.primitives);\n\n  this._scene = scene;\n  this._primitives = primitives;\n  this._entityCollection = undefined;\n  this._addedObjects = new AssociativeArray();\n  this._removedObjects = new AssociativeArray();\n  this._changedObjects = new AssociativeArray();\n\n  let i;\n  const numberOfShadowModes = ShadowMode.NUMBER_OF_SHADOW_MODES;\n  this._colorBatches = new Array(numberOfShadowModes * 3);\n  this._materialBatches = new Array(numberOfShadowModes * 3);\n\n  for (i = 0; i < numberOfShadowModes; ++i) {\n    this._colorBatches[i] = new StaticGeometryColorBatch(\n      primitives,\n      PolylineColorAppearance,\n      undefined,\n      false,\n      i\n    ); // no depth fail appearance\n    this._materialBatches[i] = new StaticGeometryPerMaterialBatch(\n      primitives,\n      PolylineMaterialAppearance,\n      undefined,\n      false,\n      i\n    );\n\n    this._colorBatches[i + numberOfShadowModes] = new StaticGeometryColorBatch(\n      primitives,\n      PolylineColorAppearance,\n      PolylineColorAppearance,\n      false,\n      i\n    ); //depth fail appearance variations\n    this._materialBatches[\n      i + numberOfShadowModes\n    ] = new StaticGeometryPerMaterialBatch(\n      primitives,\n      PolylineMaterialAppearance,\n      PolylineColorAppearance,\n      false,\n      i\n    );\n\n    this._colorBatches[\n      i + numberOfShadowModes * 2\n    ] = new StaticGeometryColorBatch(\n      primitives,\n      PolylineColorAppearance,\n      PolylineMaterialAppearance,\n      false,\n      i\n    );\n    this._materialBatches[\n      i + numberOfShadowModes * 2\n    ] = new StaticGeometryPerMaterialBatch(\n      primitives,\n      PolylineMaterialAppearance,\n      PolylineMaterialAppearance,\n      false,\n      i\n    );\n  }\n\n  this._dynamicBatch = new DynamicGeometryBatch(primitives, groundPrimitives);\n\n  const numberOfClassificationTypes =\n    ClassificationType.NUMBER_OF_CLASSIFICATION_TYPES;\n  this._groundBatches = new Array(numberOfClassificationTypes);\n\n  for (i = 0; i < numberOfClassificationTypes; ++i) {\n    this._groundBatches[i] = new StaticGroundPolylinePerMaterialBatch(\n      groundPrimitives,\n      i\n    );\n  }\n\n  this._batches = this._colorBatches.concat(\n    this._materialBatches,\n    this._dynamicBatch,\n    this._groundBatches\n  );\n\n  this._subscriptions = new AssociativeArray();\n  this._updaters = new AssociativeArray();\n\n  this._entityCollection = entityCollection;\n  entityCollection.collectionChanged.addEventListener(\n    PolylineVisualizer.prototype._onCollectionChanged,\n    this\n  );\n  this._onCollectionChanged(\n    entityCollection,\n    entityCollection.values,\n    emptyArray\n  );\n}\n\n/**\n * Updates all of the primitives created by this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {boolean} True if the visualizer successfully updated to the provided time,\n * false if the visualizer is waiting for asynchronous primitives to be created.\n */\nPolylineVisualizer.prototype.update = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n  //>>includeEnd('debug');\n\n  const addedObjects = this._addedObjects;\n  const added = addedObjects.values;\n  const removedObjects = this._removedObjects;\n  const removed = removedObjects.values;\n  const changedObjects = this._changedObjects;\n  const changed = changedObjects.values;\n\n  let i;\n  let entity;\n  let id;\n  let updater;\n\n  for (i = changed.length - 1; i > -1; i--) {\n    entity = changed[i];\n    id = entity.id;\n    updater = this._updaters.get(id);\n\n    //If in a single update, an entity gets removed and a new instance\n    //re-added with the same id, the updater no longer tracks the\n    //correct entity, we need to both remove the old one and\n    //add the new one, which is done by pushing the entity\n    //onto the removed/added lists.\n    if (updater.entity === entity) {\n      removeUpdater(this, updater);\n      insertUpdaterIntoBatch(this, time, updater);\n    } else {\n      removed.push(entity);\n      added.push(entity);\n    }\n  }\n\n  for (i = removed.length - 1; i > -1; i--) {\n    entity = removed[i];\n    id = entity.id;\n    updater = this._updaters.get(id);\n    removeUpdater(this, updater);\n    updater.destroy();\n    this._updaters.remove(id);\n    this._subscriptions.get(id)();\n    this._subscriptions.remove(id);\n  }\n\n  for (i = added.length - 1; i > -1; i--) {\n    entity = added[i];\n    id = entity.id;\n    updater = new PolylineGeometryUpdater(entity, this._scene);\n    this._updaters.set(id, updater);\n    insertUpdaterIntoBatch(this, time, updater);\n    this._subscriptions.set(\n      id,\n      updater.geometryChanged.addEventListener(\n        PolylineVisualizer._onGeometryChanged,\n        this\n      )\n    );\n  }\n\n  addedObjects.removeAll();\n  removedObjects.removeAll();\n  changedObjects.removeAll();\n\n  let isUpdated = true;\n  const batches = this._batches;\n  const length = batches.length;\n  for (i = 0; i < length; i++) {\n    isUpdated = batches[i].update(time) && isUpdated;\n  }\n\n  return isUpdated;\n};\n\nconst getBoundingSphereArrayScratch = [];\nconst getBoundingSphereBoundingSphereScratch = new BoundingSphere();\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n *                       BoundingSphereState.PENDING if the result is still being computed, or\n *                       BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nPolylineVisualizer.prototype.getBoundingSphere = function (entity, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"entity\", entity);\n  Check.defined(\"result\", result);\n  //>>includeEnd('debug');\n\n  const boundingSpheres = getBoundingSphereArrayScratch;\n  const tmp = getBoundingSphereBoundingSphereScratch;\n\n  let count = 0;\n  let state = BoundingSphereState.DONE;\n  const batches = this._batches;\n  const batchesLength = batches.length;\n  const updater = this._updaters.get(entity.id);\n  for (let i = 0; i < batchesLength; i++) {\n    state = batches[i].getBoundingSphere(updater, tmp);\n    if (state === BoundingSphereState.PENDING) {\n      return BoundingSphereState.PENDING;\n    } else if (state === BoundingSphereState.DONE) {\n      boundingSpheres[count] = BoundingSphere.clone(\n        tmp,\n        boundingSpheres[count]\n      );\n      count++;\n    }\n  }\n\n  if (count === 0) {\n    return BoundingSphereState.FAILED;\n  }\n\n  boundingSpheres.length = count;\n  BoundingSphere.fromBoundingSpheres(boundingSpheres, result);\n  return BoundingSphereState.DONE;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n */\nPolylineVisualizer.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nPolylineVisualizer.prototype.destroy = function () {\n  this._entityCollection.collectionChanged.removeEventListener(\n    PolylineVisualizer.prototype._onCollectionChanged,\n    this\n  );\n  this._addedObjects.removeAll();\n  this._removedObjects.removeAll();\n\n  let i;\n  const batches = this._batches;\n  let length = batches.length;\n  for (i = 0; i < length; i++) {\n    batches[i].removeAllPrimitives();\n  }\n\n  const subscriptions = this._subscriptions.values;\n  length = subscriptions.length;\n  for (i = 0; i < length; i++) {\n    subscriptions[i]();\n  }\n  this._subscriptions.removeAll();\n  return destroyObject(this);\n};\n\n/**\n * @private\n */\nPolylineVisualizer._onGeometryChanged = function (updater) {\n  const removedObjects = this._removedObjects;\n  const changedObjects = this._changedObjects;\n\n  const entity = updater.entity;\n  const id = entity.id;\n\n  if (!defined(removedObjects.get(id)) && !defined(changedObjects.get(id))) {\n    changedObjects.set(id, entity);\n  }\n};\n\n/**\n * @private\n */\nPolylineVisualizer.prototype._onCollectionChanged = function (\n  entityCollection,\n  added,\n  removed\n) {\n  const addedObjects = this._addedObjects;\n  const removedObjects = this._removedObjects;\n  const changedObjects = this._changedObjects;\n\n  let i;\n  let id;\n  let entity;\n  for (i = removed.length - 1; i > -1; i--) {\n    entity = removed[i];\n    id = entity.id;\n    if (!addedObjects.remove(id)) {\n      removedObjects.set(id, entity);\n      changedObjects.remove(id);\n    }\n  }\n\n  for (i = added.length - 1; i > -1; i--) {\n    entity = added[i];\n    id = entity.id;\n    if (removedObjects.remove(id)) {\n      changedObjects.set(id, entity);\n    } else {\n      addedObjects.set(id, entity);\n    }\n  }\n};\nexport default PolylineVisualizer;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport EventHelper from \"../Core/EventHelper.js\";\nimport GroundPolylinePrimitive from \"../Scene/GroundPolylinePrimitive.js\";\nimport GroundPrimitive from \"../Scene/GroundPrimitive.js\";\nimport OrderedGroundPrimitiveCollection from \"../Scene/OrderedGroundPrimitiveCollection.js\";\nimport PrimitiveCollection from \"../Scene/PrimitiveCollection.js\";\nimport BillboardVisualizer from \"./BillboardVisualizer.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport CustomDataSource from \"./CustomDataSource.js\";\nimport GeometryVisualizer from \"./GeometryVisualizer.js\";\nimport LabelVisualizer from \"./LabelVisualizer.js\";\nimport ModelVisualizer from \"./ModelVisualizer.js\";\nimport Cesium3DTilesetVisualizer from \"./Cesium3DTilesetVisualizer.js\";\nimport PathVisualizer from \"./PathVisualizer.js\";\nimport PointVisualizer from \"./PointVisualizer.js\";\nimport PolylineVisualizer from \"./PolylineVisualizer.js\";\n\n/**\n * Visualizes a collection of {@link DataSource} instances.\n * @alias DataSourceDisplay\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Scene} options.scene The scene in which to display the data.\n * @param {DataSourceCollection} options.dataSourceCollection The data sources to display.\n * @param {DataSourceDisplay.VisualizersCallback} [options.visualizersCallback=DataSourceDisplay.defaultVisualizersCallback]\n *        A function which creates an array of visualizers used for visualization.\n *        If undefined, all standard visualizers are used.\n */\nfunction DataSourceDisplay(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options\", options);\n  Check.typeOf.object(\"options.scene\", options.scene);\n  Check.typeOf.object(\n    \"options.dataSourceCollection\",\n    options.dataSourceCollection\n  );\n  //>>includeEnd('debug');\n\n  GroundPrimitive.initializeTerrainHeights();\n  GroundPolylinePrimitive.initializeTerrainHeights();\n\n  const scene = options.scene;\n  const dataSourceCollection = options.dataSourceCollection;\n\n  this._eventHelper = new EventHelper();\n  this._eventHelper.add(\n    dataSourceCollection.dataSourceAdded,\n    this._onDataSourceAdded,\n    this\n  );\n  this._eventHelper.add(\n    dataSourceCollection.dataSourceRemoved,\n    this._onDataSourceRemoved,\n    this\n  );\n  this._eventHelper.add(\n    dataSourceCollection.dataSourceMoved,\n    this._onDataSourceMoved,\n    this\n  );\n  this._eventHelper.add(scene.postRender, this._postRender, this);\n\n  this._dataSourceCollection = dataSourceCollection;\n  this._scene = scene;\n  this._visualizersCallback = defaultValue(\n    options.visualizersCallback,\n    DataSourceDisplay.defaultVisualizersCallback\n  );\n\n  let primitivesAdded = false;\n  const primitives = new PrimitiveCollection();\n  const groundPrimitives = new PrimitiveCollection();\n\n  if (dataSourceCollection.length > 0) {\n    scene.primitives.add(primitives);\n    scene.groundPrimitives.add(groundPrimitives);\n    primitivesAdded = true;\n  }\n\n  this._primitives = primitives;\n  this._groundPrimitives = groundPrimitives;\n\n  for (let i = 0, len = dataSourceCollection.length; i < len; i++) {\n    this._onDataSourceAdded(dataSourceCollection, dataSourceCollection.get(i));\n  }\n\n  const defaultDataSource = new CustomDataSource();\n  this._onDataSourceAdded(undefined, defaultDataSource);\n  this._defaultDataSource = defaultDataSource;\n\n  let removeDefaultDataSourceListener;\n  let removeDataSourceCollectionListener;\n  if (!primitivesAdded) {\n    const that = this;\n    const addPrimitives = function () {\n      scene.primitives.add(primitives);\n      scene.groundPrimitives.add(groundPrimitives);\n      removeDefaultDataSourceListener();\n      removeDataSourceCollectionListener();\n      that._removeDefaultDataSourceListener = undefined;\n      that._removeDataSourceCollectionListener = undefined;\n    };\n    removeDefaultDataSourceListener = defaultDataSource.entities.collectionChanged.addEventListener(\n      addPrimitives\n    );\n    removeDataSourceCollectionListener = dataSourceCollection.dataSourceAdded.addEventListener(\n      addPrimitives\n    );\n  }\n\n  this._removeDefaultDataSourceListener = removeDefaultDataSourceListener;\n  this._removeDataSourceCollectionListener = removeDataSourceCollectionListener;\n\n  this._ready = false;\n}\n\n/**\n * Gets or sets the default function which creates an array of visualizers used for visualization.\n * By default, this function uses all standard visualizers.\n *\n * @type {DataSourceDisplay.VisualizersCallback}\n */\nDataSourceDisplay.defaultVisualizersCallback = function (\n  scene,\n  entityCluster,\n  dataSource\n) {\n  const entities = dataSource.entities;\n  return [\n    new BillboardVisualizer(entityCluster, entities),\n    new GeometryVisualizer(\n      scene,\n      entities,\n      dataSource._primitives,\n      dataSource._groundPrimitives\n    ),\n    new LabelVisualizer(entityCluster, entities),\n    new ModelVisualizer(scene, entities),\n    new Cesium3DTilesetVisualizer(scene, entities),\n    new PointVisualizer(entityCluster, entities),\n    new PathVisualizer(scene, entities),\n    new PolylineVisualizer(\n      scene,\n      entities,\n      dataSource._primitives,\n      dataSource._groundPrimitives\n    ),\n  ];\n};\n\nObject.defineProperties(DataSourceDisplay.prototype, {\n  /**\n   * Gets the scene associated with this display.\n   * @memberof DataSourceDisplay.prototype\n   * @type {Scene}\n   */\n  scene: {\n    get: function () {\n      return this._scene;\n    },\n  },\n  /**\n   * Gets the collection of data sources to display.\n   * @memberof DataSourceDisplay.prototype\n   * @type {DataSourceCollection}\n   */\n  dataSources: {\n    get: function () {\n      return this._dataSourceCollection;\n    },\n  },\n  /**\n   * Gets the default data source instance which can be used to\n   * manually create and visualize entities not tied to\n   * a specific data source. This instance is always available\n   * and does not appear in the list dataSources collection.\n   * @memberof DataSourceDisplay.prototype\n   * @type {CustomDataSource}\n   */\n  defaultDataSource: {\n    get: function () {\n      return this._defaultDataSource;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not all entities in the data source are ready\n   * @memberof DataSourceDisplay.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n});\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see DataSourceDisplay#destroy\n */\nDataSourceDisplay.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * dataSourceDisplay = dataSourceDisplay.destroy();\n *\n * @see DataSourceDisplay#isDestroyed\n */\nDataSourceDisplay.prototype.destroy = function () {\n  this._eventHelper.removeAll();\n\n  const dataSourceCollection = this._dataSourceCollection;\n  for (let i = 0, length = dataSourceCollection.length; i < length; ++i) {\n    this._onDataSourceRemoved(\n      this._dataSourceCollection,\n      dataSourceCollection.get(i)\n    );\n  }\n  this._onDataSourceRemoved(undefined, this._defaultDataSource);\n\n  if (defined(this._removeDefaultDataSourceListener)) {\n    this._removeDefaultDataSourceListener();\n    this._removeDataSourceCollectionListener();\n  } else {\n    this._scene.primitives.remove(this._primitives);\n    this._scene.groundPrimitives.remove(this._groundPrimitives);\n  }\n\n  return destroyObject(this);\n};\n\n/**\n * Updates the display to the provided time.\n *\n * @param {JulianDate} time The simulation time.\n * @returns {boolean} True if all data sources are ready to be displayed, false otherwise.\n */\nDataSourceDisplay.prototype.update = function (time) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n  //>>includeEnd('debug');\n\n  if (!ApproximateTerrainHeights.initialized) {\n    this._ready = false;\n    return false;\n  }\n\n  let result = true;\n\n  let i;\n  let x;\n  let visualizers;\n  let vLength;\n  const dataSources = this._dataSourceCollection;\n  const length = dataSources.length;\n  for (i = 0; i < length; i++) {\n    const dataSource = dataSources.get(i);\n    if (defined(dataSource.update)) {\n      result = dataSource.update(time) && result;\n    }\n\n    visualizers = dataSource._visualizers;\n    vLength = visualizers.length;\n    for (x = 0; x < vLength; x++) {\n      result = visualizers[x].update(time) && result;\n    }\n  }\n\n  visualizers = this._defaultDataSource._visualizers;\n  vLength = visualizers.length;\n  for (x = 0; x < vLength; x++) {\n    result = visualizers[x].update(time) && result;\n  }\n\n  this._ready = result;\n\n  return result;\n};\n\nDataSourceDisplay.prototype._postRender = function () {\n  // Adds credits for all datasources\n  const frameState = this._scene.frameState;\n  const dataSources = this._dataSourceCollection;\n  const length = dataSources.length;\n  for (let i = 0; i < length; i++) {\n    const dataSource = dataSources.get(i);\n\n    const credit = dataSource.credit;\n    if (defined(credit)) {\n      frameState.creditDisplay.addCreditToNextFrame(credit);\n    }\n\n    // Credits from the resource that the user can't remove\n    const credits = dataSource._resourceCredits;\n    if (defined(credits)) {\n      const creditCount = credits.length;\n      for (let c = 0; c < creditCount; c++) {\n        frameState.creditDisplay.addCreditToNextFrame(credits[c]);\n      }\n    }\n  }\n};\n\nconst getBoundingSphereArrayScratch = [];\nconst getBoundingSphereBoundingSphereScratch = new BoundingSphere();\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {boolean} allowPartial If true, pending bounding spheres are ignored and an answer will be returned from the currently available data.\n *                               If false, the the function will halt and return pending if any of the bounding spheres are pending.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n *                       BoundingSphereState.PENDING if the result is still being computed, or\n *                       BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nDataSourceDisplay.prototype.getBoundingSphere = function (\n  entity,\n  allowPartial,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"entity\", entity);\n  Check.typeOf.bool(\"allowPartial\", allowPartial);\n  Check.defined(\"result\", result);\n  //>>includeEnd('debug');\n\n  if (!this._ready) {\n    return BoundingSphereState.PENDING;\n  }\n\n  let i;\n  let length;\n  let dataSource = this._defaultDataSource;\n  if (!dataSource.entities.contains(entity)) {\n    dataSource = undefined;\n\n    const dataSources = this._dataSourceCollection;\n    length = dataSources.length;\n    for (i = 0; i < length; i++) {\n      const d = dataSources.get(i);\n      if (d.entities.contains(entity)) {\n        dataSource = d;\n        break;\n      }\n    }\n  }\n\n  if (!defined(dataSource)) {\n    return BoundingSphereState.FAILED;\n  }\n\n  const boundingSpheres = getBoundingSphereArrayScratch;\n  const tmp = getBoundingSphereBoundingSphereScratch;\n\n  let count = 0;\n  let state = BoundingSphereState.DONE;\n  const visualizers = dataSource._visualizers;\n  const visualizersLength = visualizers.length;\n\n  for (i = 0; i < visualizersLength; i++) {\n    const visualizer = visualizers[i];\n    if (defined(visualizer.getBoundingSphere)) {\n      state = visualizers[i].getBoundingSphere(entity, tmp);\n      if (!allowPartial && state === BoundingSphereState.PENDING) {\n        return BoundingSphereState.PENDING;\n      } else if (state === BoundingSphereState.DONE) {\n        boundingSpheres[count] = BoundingSphere.clone(\n          tmp,\n          boundingSpheres[count]\n        );\n        count++;\n      }\n    }\n  }\n\n  if (count === 0) {\n    return BoundingSphereState.FAILED;\n  }\n\n  boundingSpheres.length = count;\n  BoundingSphere.fromBoundingSpheres(boundingSpheres, result);\n  return BoundingSphereState.DONE;\n};\n\nDataSourceDisplay.prototype._onDataSourceAdded = function (\n  dataSourceCollection,\n  dataSource\n) {\n  const scene = this._scene;\n\n  const displayPrimitives = this._primitives;\n  const displayGroundPrimitives = this._groundPrimitives;\n\n  const primitives = displayPrimitives.add(new PrimitiveCollection());\n  const groundPrimitives = displayGroundPrimitives.add(\n    new OrderedGroundPrimitiveCollection()\n  );\n\n  dataSource._primitives = primitives;\n  dataSource._groundPrimitives = groundPrimitives;\n\n  const entityCluster = dataSource.clustering;\n  entityCluster._initialize(scene);\n\n  primitives.add(entityCluster);\n\n  dataSource._visualizers = this._visualizersCallback(\n    scene,\n    entityCluster,\n    dataSource\n  );\n};\n\nDataSourceDisplay.prototype._onDataSourceRemoved = function (\n  dataSourceCollection,\n  dataSource\n) {\n  const displayPrimitives = this._primitives;\n  const displayGroundPrimitives = this._groundPrimitives;\n\n  const primitives = dataSource._primitives;\n  const groundPrimitives = dataSource._groundPrimitives;\n\n  const entityCluster = dataSource.clustering;\n  primitives.remove(entityCluster);\n\n  const visualizers = dataSource._visualizers;\n  const length = visualizers.length;\n  for (let i = 0; i < length; i++) {\n    visualizers[i].destroy();\n  }\n\n  displayPrimitives.remove(primitives);\n  displayGroundPrimitives.remove(groundPrimitives);\n\n  dataSource._visualizers = undefined;\n};\n\nDataSourceDisplay.prototype._onDataSourceMoved = function (\n  dataSource,\n  newIndex,\n  oldIndex\n) {\n  const displayPrimitives = this._primitives;\n  const displayGroundPrimitives = this._groundPrimitives;\n\n  const primitives = dataSource._primitives;\n  const groundPrimitives = dataSource._groundPrimitives;\n\n  if (newIndex === oldIndex + 1) {\n    displayPrimitives.raise(primitives);\n    displayGroundPrimitives.raise(groundPrimitives);\n  } else if (newIndex === oldIndex - 1) {\n    displayPrimitives.lower(primitives);\n    displayGroundPrimitives.lower(groundPrimitives);\n  } else if (newIndex === 0) {\n    displayPrimitives.lowerToBottom(primitives);\n    displayGroundPrimitives.lowerToBottom(groundPrimitives);\n    displayPrimitives.raise(primitives); // keep defaultDataSource primitives at index 0 since it's not in the collection\n    displayGroundPrimitives.raise(groundPrimitives);\n  } else {\n    displayPrimitives.raiseToTop(primitives);\n    displayGroundPrimitives.raiseToTop(groundPrimitives);\n  }\n};\n\n/**\n * A function which creates an array of visualizers used for visualization.\n * @callback DataSourceDisplay.VisualizersCallback\n *\n * @param {Scene} scene The scene to create visualizers for.\n * @param {EntityCluster} entityCluster The entity cluster to create visualizers for.\n * @param {DataSource} dataSource The data source to create visualizers for.\n * @returns {Visualizer[]} An array of visualizers used for visualization.\n *\n * @example\n * function createVisualizers(scene, entityCluster, dataSource) {\n *     return [new Cesium.BillboardVisualizer(entityCluster, dataSource.entities)];\n * }\n */\nexport default DataSourceDisplay;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\n\n/**\n * Defines a heading angle, pitch angle, and range in a local frame.\n * Heading is the rotation from the local north direction where a positive angle is increasing eastward.\n * Pitch is the rotation from the local xy-plane. Positive pitch angles are above the plane. Negative pitch\n * angles are below the plane. Range is the distance from the center of the frame.\n * @alias HeadingPitchRange\n * @constructor\n *\n * @param {number} [heading=0.0] The heading angle in radians.\n * @param {number} [pitch=0.0] The pitch angle in radians.\n * @param {number} [range=0.0] The distance from the center in meters.\n */\nfunction HeadingPitchRange(heading, pitch, range) {\n  /**\n   * Heading is the rotation from the local north direction where a positive angle is increasing eastward.\n   * @type {number}\n   * @default 0.0\n   */\n  this.heading = defaultValue(heading, 0.0);\n\n  /**\n   * Pitch is the rotation from the local xy-plane. Positive pitch angles\n   * are above the plane. Negative pitch angles are below the plane.\n   * @type {number}\n   * @default 0.0\n   */\n  this.pitch = defaultValue(pitch, 0.0);\n\n  /**\n   * Range is the distance from the center of the local frame.\n   * @type {number}\n   * @default 0.0\n   */\n  this.range = defaultValue(range, 0.0);\n}\n\n/**\n * Duplicates a HeadingPitchRange instance.\n *\n * @param {HeadingPitchRange} hpr The HeadingPitchRange to duplicate.\n * @param {HeadingPitchRange} [result] The object onto which to store the result.\n * @returns {HeadingPitchRange} The modified result parameter or a new HeadingPitchRange instance if one was not provided. (Returns undefined if hpr is undefined)\n */\nHeadingPitchRange.clone = function (hpr, result) {\n  if (!defined(hpr)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    result = new HeadingPitchRange();\n  }\n\n  result.heading = hpr.heading;\n  result.pitch = hpr.pitch;\n  result.range = hpr.range;\n  return result;\n};\nexport default HeadingPitchRange;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport HeadingPitchRange from \"../Core/HeadingPitchRange.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport SceneMode from \"../Scene/SceneMode.js\";\n\nconst updateTransformMatrix3Scratch1 = new Matrix3();\nconst updateTransformMatrix3Scratch2 = new Matrix3();\nconst updateTransformMatrix3Scratch3 = new Matrix3();\nconst updateTransformMatrix4Scratch = new Matrix4();\nconst updateTransformCartesian3Scratch1 = new Cartesian3();\nconst updateTransformCartesian3Scratch2 = new Cartesian3();\nconst updateTransformCartesian3Scratch3 = new Cartesian3();\nconst updateTransformCartesian3Scratch4 = new Cartesian3();\nconst updateTransformCartesian3Scratch5 = new Cartesian3();\nconst updateTransformCartesian3Scratch6 = new Cartesian3();\nconst deltaTime = new JulianDate();\nconst northUpAxisFactor = 1.25; // times ellipsoid's maximum radius\n\nfunction updateTransform(\n  that,\n  camera,\n  updateLookAt,\n  saveCamera,\n  positionProperty,\n  time,\n  ellipsoid\n) {\n  const mode = that.scene.mode;\n  let cartesian = positionProperty.getValue(time, that._lastCartesian);\n  if (defined(cartesian)) {\n    let hasBasis = false;\n    let invertVelocity = false;\n    let xBasis;\n    let yBasis;\n    let zBasis;\n\n    if (mode === SceneMode.SCENE3D) {\n      // The time delta was determined based on how fast satellites move compared to vehicles near the surface.\n      // Slower moving vehicles will most likely default to east-north-up, while faster ones will be VVLH.\n      JulianDate.addSeconds(time, 0.001, deltaTime);\n      let deltaCartesian = positionProperty.getValue(\n        deltaTime,\n        updateTransformCartesian3Scratch1\n      );\n\n      // If no valid position at (time + 0.001), sample at (time - 0.001) and invert the vector\n      if (!defined(deltaCartesian)) {\n        JulianDate.addSeconds(time, -0.001, deltaTime);\n        deltaCartesian = positionProperty.getValue(\n          deltaTime,\n          updateTransformCartesian3Scratch1\n        );\n        invertVelocity = true;\n      }\n\n      if (defined(deltaCartesian)) {\n        let toInertial = Transforms.computeFixedToIcrfMatrix(\n          time,\n          updateTransformMatrix3Scratch1\n        );\n        let toInertialDelta = Transforms.computeFixedToIcrfMatrix(\n          deltaTime,\n          updateTransformMatrix3Scratch2\n        );\n        let toFixed;\n\n        if (!defined(toInertial) || !defined(toInertialDelta)) {\n          toFixed = Transforms.computeTemeToPseudoFixedMatrix(\n            time,\n            updateTransformMatrix3Scratch3\n          );\n          toInertial = Matrix3.transpose(\n            toFixed,\n            updateTransformMatrix3Scratch1\n          );\n          toInertialDelta = Transforms.computeTemeToPseudoFixedMatrix(\n            deltaTime,\n            updateTransformMatrix3Scratch2\n          );\n          Matrix3.transpose(toInertialDelta, toInertialDelta);\n        } else {\n          toFixed = Matrix3.transpose(\n            toInertial,\n            updateTransformMatrix3Scratch3\n          );\n        }\n\n        const inertialCartesian = Matrix3.multiplyByVector(\n          toInertial,\n          cartesian,\n          updateTransformCartesian3Scratch5\n        );\n        const inertialDeltaCartesian = Matrix3.multiplyByVector(\n          toInertialDelta,\n          deltaCartesian,\n          updateTransformCartesian3Scratch6\n        );\n\n        Cartesian3.subtract(\n          inertialCartesian,\n          inertialDeltaCartesian,\n          updateTransformCartesian3Scratch4\n        );\n        const inertialVelocity =\n          Cartesian3.magnitude(updateTransformCartesian3Scratch4) * 1000.0; // meters/sec\n\n        const mu = CesiumMath.GRAVITATIONALPARAMETER; // m^3 / sec^2\n        const semiMajorAxis =\n          -mu /\n          (inertialVelocity * inertialVelocity -\n            (2 * mu) / Cartesian3.magnitude(inertialCartesian));\n\n        if (\n          semiMajorAxis < 0 ||\n          semiMajorAxis > northUpAxisFactor * ellipsoid.maximumRadius\n        ) {\n          // North-up viewing from deep space.\n\n          // X along the nadir\n          xBasis = updateTransformCartesian3Scratch2;\n          Cartesian3.normalize(cartesian, xBasis);\n          Cartesian3.negate(xBasis, xBasis);\n\n          // Z is North\n          zBasis = Cartesian3.clone(\n            Cartesian3.UNIT_Z,\n            updateTransformCartesian3Scratch3\n          );\n\n          // Y is along the cross of z and x (right handed basis / in the direction of motion)\n          yBasis = Cartesian3.cross(\n            zBasis,\n            xBasis,\n            updateTransformCartesian3Scratch1\n          );\n          if (Cartesian3.magnitude(yBasis) > CesiumMath.EPSILON7) {\n            Cartesian3.normalize(xBasis, xBasis);\n            Cartesian3.normalize(yBasis, yBasis);\n\n            zBasis = Cartesian3.cross(\n              xBasis,\n              yBasis,\n              updateTransformCartesian3Scratch3\n            );\n            Cartesian3.normalize(zBasis, zBasis);\n\n            hasBasis = true;\n          }\n        } else if (\n          !Cartesian3.equalsEpsilon(\n            cartesian,\n            deltaCartesian,\n            CesiumMath.EPSILON7\n          )\n        ) {\n          // Approximation of VVLH (Vehicle Velocity Local Horizontal) with the Z-axis flipped.\n\n          // Z along the position\n          zBasis = updateTransformCartesian3Scratch2;\n          Cartesian3.normalize(inertialCartesian, zBasis);\n          Cartesian3.normalize(inertialDeltaCartesian, inertialDeltaCartesian);\n\n          // Y is along the angular momentum vector (e.g. \"orbit normal\")\n          yBasis = Cartesian3.cross(\n            zBasis,\n            inertialDeltaCartesian,\n            updateTransformCartesian3Scratch3\n          );\n\n          if (invertVelocity) {\n            yBasis = Cartesian3.multiplyByScalar(yBasis, -1, yBasis);\n          }\n\n          if (\n            !Cartesian3.equalsEpsilon(\n              yBasis,\n              Cartesian3.ZERO,\n              CesiumMath.EPSILON7\n            )\n          ) {\n            // X is along the cross of y and z (right handed basis / in the direction of motion)\n            xBasis = Cartesian3.cross(\n              yBasis,\n              zBasis,\n              updateTransformCartesian3Scratch1\n            );\n\n            Matrix3.multiplyByVector(toFixed, xBasis, xBasis);\n            Matrix3.multiplyByVector(toFixed, yBasis, yBasis);\n            Matrix3.multiplyByVector(toFixed, zBasis, zBasis);\n\n            Cartesian3.normalize(xBasis, xBasis);\n            Cartesian3.normalize(yBasis, yBasis);\n            Cartesian3.normalize(zBasis, zBasis);\n\n            hasBasis = true;\n          }\n        }\n      }\n    }\n\n    if (defined(that.boundingSphere)) {\n      cartesian = that.boundingSphere.center;\n    }\n\n    let position;\n    let direction;\n    let up;\n\n    if (saveCamera) {\n      position = Cartesian3.clone(\n        camera.position,\n        updateTransformCartesian3Scratch4\n      );\n      direction = Cartesian3.clone(\n        camera.direction,\n        updateTransformCartesian3Scratch5\n      );\n      up = Cartesian3.clone(camera.up, updateTransformCartesian3Scratch6);\n    }\n\n    const transform = updateTransformMatrix4Scratch;\n    if (hasBasis) {\n      transform[0] = xBasis.x;\n      transform[1] = xBasis.y;\n      transform[2] = xBasis.z;\n      transform[3] = 0.0;\n      transform[4] = yBasis.x;\n      transform[5] = yBasis.y;\n      transform[6] = yBasis.z;\n      transform[7] = 0.0;\n      transform[8] = zBasis.x;\n      transform[9] = zBasis.y;\n      transform[10] = zBasis.z;\n      transform[11] = 0.0;\n      transform[12] = cartesian.x;\n      transform[13] = cartesian.y;\n      transform[14] = cartesian.z;\n      transform[15] = 0.0;\n    } else {\n      // Stationary or slow-moving, low-altitude objects use East-North-Up.\n      Transforms.eastNorthUpToFixedFrame(cartesian, ellipsoid, transform);\n    }\n\n    camera._setTransform(transform);\n\n    if (saveCamera) {\n      Cartesian3.clone(position, camera.position);\n      Cartesian3.clone(direction, camera.direction);\n      Cartesian3.clone(up, camera.up);\n      Cartesian3.cross(direction, up, camera.right);\n    }\n  }\n\n  if (updateLookAt) {\n    const offset =\n      mode === SceneMode.SCENE2D ||\n      Cartesian3.equals(that._offset3D, Cartesian3.ZERO)\n        ? undefined\n        : that._offset3D;\n    camera.lookAtTransform(camera.transform, offset);\n  }\n}\n\n/**\n * A utility object for tracking an entity with the camera.\n * @alias EntityView\n * @constructor\n *\n * @param {Entity} entity The entity to track with the camera.\n * @param {Scene} scene The scene to use.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use for orienting the camera.\n */\nfunction EntityView(entity, scene, ellipsoid) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"entity\", entity);\n  Check.defined(\"scene\", scene);\n  //>>includeEnd('debug');\n\n  /**\n   * The entity to track with the camera.\n   * @type {Entity}\n   */\n  this.entity = entity;\n\n  /**\n   * The scene in which to track the object.\n   * @type {Scene}\n   */\n  this.scene = scene;\n\n  /**\n   * The ellipsoid to use for orienting the camera.\n   * @type {Ellipsoid}\n   */\n  this.ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n  /**\n   * The bounding sphere of the object.\n   * @type {BoundingSphere}\n   */\n  this.boundingSphere = undefined;\n\n  // Shadow copies of the objects so we can detect changes.\n  this._lastEntity = undefined;\n  this._mode = undefined;\n\n  this._lastCartesian = new Cartesian3();\n  this._defaultOffset3D = undefined;\n\n  this._offset3D = new Cartesian3();\n}\n\n// STATIC properties defined here, not per-instance.\nObject.defineProperties(EntityView, {\n  /**\n   * Gets or sets a camera offset that will be used to\n   * initialize subsequent EntityViews.\n   * @memberof EntityView\n   * @type {Cartesian3}\n   */\n  defaultOffset3D: {\n    get: function () {\n      return this._defaultOffset3D;\n    },\n    set: function (vector) {\n      this._defaultOffset3D = Cartesian3.clone(vector, new Cartesian3());\n    },\n  },\n});\n\n// Initialize the static property.\nEntityView.defaultOffset3D = new Cartesian3(-14000, 3500, 3500);\n\nconst scratchHeadingPitchRange = new HeadingPitchRange();\nconst scratchCartesian = new Cartesian3();\n\n/**\n * Should be called each animation frame to update the camera\n * to the latest settings.\n * @param {JulianDate} time The current animation time.\n * @param {BoundingSphere} [boundingSphere] bounding sphere of the object.\n */\nEntityView.prototype.update = function (time, boundingSphere) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"time\", time);\n  //>>includeEnd('debug');\n\n  const scene = this.scene;\n  const ellipsoid = this.ellipsoid;\n  const sceneMode = scene.mode;\n  if (sceneMode === SceneMode.MORPHING) {\n    return;\n  }\n\n  const entity = this.entity;\n  const positionProperty = entity.position;\n  if (!defined(positionProperty)) {\n    return;\n  }\n  const objectChanged = entity !== this._lastEntity;\n  const sceneModeChanged = sceneMode !== this._mode;\n\n  const camera = scene.camera;\n\n  let updateLookAt = objectChanged || sceneModeChanged;\n  let saveCamera = true;\n\n  if (objectChanged) {\n    const viewFromProperty = entity.viewFrom;\n    const hasViewFrom = defined(viewFromProperty);\n\n    if (!hasViewFrom && defined(boundingSphere)) {\n      // The default HPR is not ideal for high altitude objects so\n      // we scale the pitch as we get further from the earth for a more\n      // downward view.\n      scratchHeadingPitchRange.pitch = -CesiumMath.PI_OVER_FOUR;\n      scratchHeadingPitchRange.range = 0;\n      const position = positionProperty.getValue(time, scratchCartesian);\n      if (defined(position)) {\n        const factor =\n          2 -\n          1 /\n            Math.max(\n              1,\n              Cartesian3.magnitude(position) / ellipsoid.maximumRadius\n            );\n        scratchHeadingPitchRange.pitch *= factor;\n      }\n\n      camera.viewBoundingSphere(boundingSphere, scratchHeadingPitchRange);\n      this.boundingSphere = boundingSphere;\n      updateLookAt = false;\n      saveCamera = false;\n    } else if (\n      !hasViewFrom ||\n      !defined(viewFromProperty.getValue(time, this._offset3D))\n    ) {\n      Cartesian3.clone(EntityView._defaultOffset3D, this._offset3D);\n    }\n  } else if (!sceneModeChanged && this._mode !== SceneMode.SCENE2D) {\n    Cartesian3.clone(camera.position, this._offset3D);\n  }\n\n  this._lastEntity = entity;\n  this._mode = sceneMode;\n\n  updateTransform(\n    this,\n    camera,\n    updateLookAt,\n    saveCamera,\n    positionProperty,\n    time,\n    ellipsoid\n  );\n};\nexport default EntityView;\n", "import buildModuleUrl from \"./buildModuleUrl.js\";\nimport Color from \"./Color.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Resource from \"./Resource.js\";\nimport writeTextToCanvas from \"./writeTextToCanvas.js\";\n\n/**\n * A utility class for generating custom map pins as canvas elements.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/PinBuilder.png' width='500'/><br />\n * Example pins generated using both the maki icon set, which ships with Cesium, and single character text.\n * </div>\n *\n * @alias PinBuilder\n * @constructor\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Map%20Pins.html|Cesium Sandcastle PinBuilder Demo}\n */\nfunction PinBuilder() {\n  this._cache = {};\n}\n\n/**\n * Creates an empty pin of the specified color and size.\n *\n * @param {Color} color The color of the pin.\n * @param {number} size The size of the pin, in pixels.\n * @returns {HTMLCanvasElement} The canvas element that represents the generated pin.\n */\nPinBuilder.prototype.fromColor = function (color, size) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(color)) {\n    throw new DeveloperError(\"color is required\");\n  }\n  if (!defined(size)) {\n    throw new DeveloperError(\"size is required\");\n  }\n  //>>includeEnd('debug');\n  return createPin(undefined, undefined, color, size, this._cache);\n};\n\n/**\n * Creates a pin with the specified icon, color, and size.\n *\n * @param {Resource|string} url The url of the image to be stamped onto the pin.\n * @param {Color} color The color of the pin.\n * @param {number} size The size of the pin, in pixels.\n * @returns {HTMLCanvasElement|Promise<HTMLCanvasElement>} The canvas element or a Promise to the canvas element that represents the generated pin.\n */\nPinBuilder.prototype.fromUrl = function (url, color, size) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(url)) {\n    throw new DeveloperError(\"url is required\");\n  }\n  if (!defined(color)) {\n    throw new DeveloperError(\"color is required\");\n  }\n  if (!defined(size)) {\n    throw new DeveloperError(\"size is required\");\n  }\n  //>>includeEnd('debug');\n  return createPin(url, undefined, color, size, this._cache);\n};\n\n/**\n * Creates a pin with the specified {@link https://www.mapbox.com/maki/|maki} icon identifier, color, and size.\n *\n * @param {string} id The id of the maki icon to be stamped onto the pin.\n * @param {Color} color The color of the pin.\n * @param {number} size The size of the pin, in pixels.\n * @returns {HTMLCanvasElement|Promise<HTMLCanvasElement>} The canvas element or a Promise to the canvas element that represents the generated pin.\n */\nPinBuilder.prototype.fromMakiIconId = function (id, color, size) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(id)) {\n    throw new DeveloperError(\"id is required\");\n  }\n  if (!defined(color)) {\n    throw new DeveloperError(\"color is required\");\n  }\n  if (!defined(size)) {\n    throw new DeveloperError(\"size is required\");\n  }\n  //>>includeEnd('debug');\n  return createPin(\n    buildModuleUrl(`Assets/Textures/maki/${encodeURIComponent(id)}.png`),\n    undefined,\n    color,\n    size,\n    this._cache\n  );\n};\n\n/**\n * Creates a pin with the specified text, color, and size.  The text will be sized to be as large as possible\n * while still being contained completely within the pin.\n *\n * @param {string} text The text to be stamped onto the pin.\n * @param {Color} color The color of the pin.\n * @param {number} size The size of the pin, in pixels.\n * @returns {HTMLCanvasElement} The canvas element that represents the generated pin.\n */\nPinBuilder.prototype.fromText = function (text, color, size) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(text)) {\n    throw new DeveloperError(\"text is required\");\n  }\n  if (!defined(color)) {\n    throw new DeveloperError(\"color is required\");\n  }\n  if (!defined(size)) {\n    throw new DeveloperError(\"size is required\");\n  }\n  //>>includeEnd('debug');\n\n  return createPin(undefined, text, color, size, this._cache);\n};\n\nconst colorScratch = new Color();\n\n//This function (except for the 3 commented lines) was auto-generated from an online tool,\n//http://www.professorcloud.com/svg-to-canvas/, using Assets/Textures/pin.svg as input.\n//The reason we simply can't load and draw the SVG directly to the canvas is because\n//it taints the canvas in Internet Explorer (and possibly some other browsers); making\n//it impossible to create a WebGL texture from the result.\nfunction drawPin(context2D, color, size) {\n  context2D.save();\n  context2D.scale(size / 24, size / 24); //Added to auto-generated code to scale up to desired size.\n  context2D.fillStyle = color.toCssColorString(); //Modified from auto-generated code.\n  context2D.strokeStyle = color.brighten(0.6, colorScratch).toCssColorString(); //Modified from auto-generated code.\n  context2D.lineWidth = 0.846;\n  context2D.beginPath();\n  context2D.moveTo(6.72, 0.422);\n  context2D.lineTo(17.28, 0.422);\n  context2D.bezierCurveTo(18.553, 0.422, 19.577, 1.758, 19.577, 3.415);\n  context2D.lineTo(19.577, 10.973);\n  context2D.bezierCurveTo(19.577, 12.63, 18.553, 13.966, 17.282, 13.966);\n  context2D.lineTo(14.386, 14.008);\n  context2D.lineTo(11.826, 23.578);\n  context2D.lineTo(9.614, 14.008);\n  context2D.lineTo(6.719, 13.965);\n  context2D.bezierCurveTo(5.446, 13.983, 4.422, 12.629, 4.422, 10.972);\n  context2D.lineTo(4.422, 3.416);\n  context2D.bezierCurveTo(4.423, 1.76, 5.447, 0.423, 6.718, 0.423);\n  context2D.closePath();\n  context2D.fill();\n  context2D.stroke();\n  context2D.restore();\n}\n\n//This function takes an image or canvas and uses it as a template\n//to \"stamp\" the pin with a white image outlined in black.  The color\n//values of the input image are ignored completely and only the alpha\n//values are used.\nfunction drawIcon(context2D, image, size) {\n  //Size is the largest image that looks good inside of pin box.\n  const imageSize = size / 2.5;\n  let sizeX = imageSize;\n  let sizeY = imageSize;\n\n  if (image.width > image.height) {\n    sizeY = imageSize * (image.height / image.width);\n  } else if (image.width < image.height) {\n    sizeX = imageSize * (image.width / image.height);\n  }\n\n  //x and y are the center of the pin box\n  const x = Math.round((size - sizeX) / 2);\n  const y = Math.round((7 / 24) * size - sizeY / 2);\n\n  context2D.globalCompositeOperation = \"destination-out\";\n  context2D.drawImage(image, x - 1, y, sizeX, sizeY);\n  context2D.drawImage(image, x, y - 1, sizeX, sizeY);\n  context2D.drawImage(image, x + 1, y, sizeX, sizeY);\n  context2D.drawImage(image, x, y + 1, sizeX, sizeY);\n\n  context2D.globalCompositeOperation = \"destination-over\";\n  context2D.fillStyle = Color.BLACK.toCssColorString();\n  context2D.fillRect(x - 1, y - 1, sizeX + 2, sizeY + 2);\n\n  context2D.globalCompositeOperation = \"destination-out\";\n  context2D.drawImage(image, x, y, sizeX, sizeY);\n\n  context2D.globalCompositeOperation = \"destination-over\";\n  context2D.fillStyle = Color.WHITE.toCssColorString();\n  context2D.fillRect(x - 1, y - 2, sizeX + 2, sizeY + 2);\n}\n\nconst stringifyScratch = new Array(4);\nfunction createPin(url, label, color, size, cache) {\n  //Use the parameters as a unique ID for caching.\n  stringifyScratch[0] = url;\n  stringifyScratch[1] = label;\n  stringifyScratch[2] = color;\n  stringifyScratch[3] = size;\n  const id = JSON.stringify(stringifyScratch);\n\n  const item = cache[id];\n  if (defined(item)) {\n    return item;\n  }\n\n  const canvas = document.createElement(\"canvas\");\n  canvas.width = size;\n  canvas.height = size;\n\n  const context2D = canvas.getContext(\"2d\");\n  drawPin(context2D, color, size);\n\n  if (defined(url)) {\n    const resource = Resource.createIfNeeded(url);\n\n    //If we have an image url, load it and then stamp the pin.\n    const promise = resource.fetchImage().then(function (image) {\n      drawIcon(context2D, image, size);\n      cache[id] = canvas;\n      return canvas;\n    });\n    cache[id] = promise;\n    return promise;\n  } else if (defined(label)) {\n    //If we have a label, write it to a canvas and then stamp the pin.\n    const image = writeTextToCanvas(label, {\n      font: `bold ${size}px sans-serif`,\n    });\n    drawIcon(context2D, image, size);\n  }\n\n  cache[id] = canvas;\n  return canvas;\n}\nexport default PinBuilder;\n", "import ArcType from \"../Core/ArcType.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport getFilenameFromUri from \"../Core/getFilenameFromUri.js\";\nimport PinBuilder from \"../Core/PinBuilder.js\";\nimport PolygonHierarchy from \"../Core/PolygonHierarchy.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport VerticalOrigin from \"../Scene/VerticalOrigin.js\";\nimport * as topojson from \"topojson-client\";\nimport BillboardGraphics from \"./BillboardGraphics.js\";\nimport CallbackProperty from \"./CallbackProperty.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport ConstantPositionProperty from \"./ConstantPositionProperty.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport DataSource from \"./DataSource.js\";\nimport EntityCluster from \"./EntityCluster.js\";\nimport EntityCollection from \"./EntityCollection.js\";\nimport PolygonGraphics from \"./PolygonGraphics.js\";\nimport PolylineGraphics from \"./PolylineGraphics.js\";\n\nfunction defaultCrsFunction(coordinates) {\n  return Cartesian3.fromDegrees(coordinates[0], coordinates[1], coordinates[2]);\n}\n\nconst crsNames = {\n  \"urn:ogc:def:crs:OGC:1.3:CRS84\": defaultCrsFunction,\n  \"EPSG:4326\": defaultCrsFunction,\n  \"urn:ogc:def:crs:EPSG::4326\": defaultCrsFunction,\n};\n\nconst crsLinkHrefs = {};\nconst crsLinkTypes = {};\nlet defaultMarkerSize = 48;\nlet defaultMarkerSymbol;\nlet defaultMarkerColor = Color.ROYALBLUE;\nlet defaultStroke = Color.YELLOW;\nlet defaultStrokeWidth = 2;\nlet defaultFill = Color.fromBytes(255, 255, 0, 100);\nlet defaultClampToGround = false;\n\nconst sizes = {\n  small: 24,\n  medium: 48,\n  large: 64,\n};\n\nconst simpleStyleIdentifiers = [\n  \"title\",\n  \"description\", //\n  \"marker-size\",\n  \"marker-symbol\",\n  \"marker-color\",\n  \"stroke\", //\n  \"stroke-opacity\",\n  \"stroke-width\",\n  \"fill\",\n  \"fill-opacity\",\n];\n\nfunction defaultDescribe(properties, nameProperty) {\n  let html = \"\";\n  for (const key in properties) {\n    if (properties.hasOwnProperty(key)) {\n      if (key === nameProperty || simpleStyleIdentifiers.indexOf(key) !== -1) {\n        continue;\n      }\n      const value = properties[key];\n      if (defined(value)) {\n        if (typeof value === \"object\") {\n          html += `<tr><th>${key}</th><td>${defaultDescribe(value)}</td></tr>`;\n        } else {\n          html += `<tr><th>${key}</th><td>${value}</td></tr>`;\n        }\n      }\n    }\n  }\n\n  if (html.length > 0) {\n    html = `<table class=\"cesium-infoBox-defaultTable\"><tbody>${html}</tbody></table>`;\n  }\n\n  return html;\n}\n\nfunction createDescriptionCallback(describe, properties, nameProperty) {\n  let description;\n  return function (time, result) {\n    if (!defined(description)) {\n      description = describe(properties, nameProperty);\n    }\n    return description;\n  };\n}\n\nfunction defaultDescribeProperty(properties, nameProperty) {\n  return new CallbackProperty(\n    createDescriptionCallback(defaultDescribe, properties, nameProperty),\n    true\n  );\n}\n\n//GeoJSON specifies only the Feature object has a usable id property\n//But since \"multi\" geometries create multiple entity,\n//we can't use it for them either.\nfunction createObject(geoJson, entityCollection, describe) {\n  let id = geoJson.id;\n  if (!defined(id) || geoJson.type !== \"Feature\") {\n    id = createGuid();\n  } else {\n    let i = 2;\n    let finalId = id;\n    while (defined(entityCollection.getById(finalId))) {\n      finalId = `${id}_${i}`;\n      i++;\n    }\n    id = finalId;\n  }\n\n  const entity = entityCollection.getOrCreateEntity(id);\n  const properties = geoJson.properties;\n  if (defined(properties)) {\n    entity.properties = properties;\n\n    let nameProperty;\n\n    //Check for the simplestyle specified name first.\n    const name = properties.title;\n    if (defined(name)) {\n      entity.name = name;\n      nameProperty = \"title\";\n    } else {\n      //Else, find the name by selecting an appropriate property.\n      //The name will be obtained based on this order:\n      //1) The first case-insensitive property with the name 'title',\n      //2) The first case-insensitive property with the name 'name',\n      //3) The first property containing the word 'title'.\n      //4) The first property containing the word 'name',\n      let namePropertyPrecedence = Number.MAX_VALUE;\n      for (const key in properties) {\n        if (properties.hasOwnProperty(key) && properties[key]) {\n          const lowerKey = key.toLowerCase();\n\n          if (namePropertyPrecedence > 1 && lowerKey === \"title\") {\n            namePropertyPrecedence = 1;\n            nameProperty = key;\n            break;\n          } else if (namePropertyPrecedence > 2 && lowerKey === \"name\") {\n            namePropertyPrecedence = 2;\n            nameProperty = key;\n          } else if (namePropertyPrecedence > 3 && /title/i.test(key)) {\n            namePropertyPrecedence = 3;\n            nameProperty = key;\n          } else if (namePropertyPrecedence > 4 && /name/i.test(key)) {\n            namePropertyPrecedence = 4;\n            nameProperty = key;\n          }\n        }\n      }\n      if (defined(nameProperty)) {\n        entity.name = properties[nameProperty];\n      }\n    }\n\n    const description = properties.description;\n    if (description !== null) {\n      entity.description = !defined(description)\n        ? describe(properties, nameProperty)\n        : new ConstantProperty(description);\n    }\n  }\n  return entity;\n}\n\nfunction coordinatesArrayToCartesianArray(coordinates, crsFunction) {\n  const positions = new Array(coordinates.length);\n  for (let i = 0; i < coordinates.length; i++) {\n    positions[i] = crsFunction(coordinates[i]);\n  }\n  return positions;\n}\n\nconst geoJsonObjectTypes = {\n  Feature: processFeature,\n  FeatureCollection: processFeatureCollection,\n  GeometryCollection: processGeometryCollection,\n  LineString: processLineString,\n  MultiLineString: processMultiLineString,\n  MultiPoint: processMultiPoint,\n  MultiPolygon: processMultiPolygon,\n  Point: processPoint,\n  Polygon: processPolygon,\n  Topology: processTopology,\n};\n\nconst geometryTypes = {\n  GeometryCollection: processGeometryCollection,\n  LineString: processLineString,\n  MultiLineString: processMultiLineString,\n  MultiPoint: processMultiPoint,\n  MultiPolygon: processMultiPolygon,\n  Point: processPoint,\n  Polygon: processPolygon,\n  Topology: processTopology,\n};\n\n// GeoJSON processing functions\nfunction processFeature(dataSource, feature, notUsed, crsFunction, options) {\n  if (feature.geometry === null) {\n    //Null geometry is allowed, so just create an empty entity instance for it.\n    createObject(feature, dataSource._entityCollection, options.describe);\n    return;\n  }\n\n  if (!defined(feature.geometry)) {\n    throw new RuntimeError(\"feature.geometry is required.\");\n  }\n\n  const geometryType = feature.geometry.type;\n  const geometryHandler = geometryTypes[geometryType];\n  if (!defined(geometryHandler)) {\n    throw new RuntimeError(`Unknown geometry type: ${geometryType}`);\n  }\n  geometryHandler(dataSource, feature, feature.geometry, crsFunction, options);\n}\n\nfunction processFeatureCollection(\n  dataSource,\n  featureCollection,\n  notUsed,\n  crsFunction,\n  options\n) {\n  const features = featureCollection.features;\n  for (let i = 0, len = features.length; i < len; i++) {\n    processFeature(dataSource, features[i], undefined, crsFunction, options);\n  }\n}\n\nfunction processGeometryCollection(\n  dataSource,\n  geoJson,\n  geometryCollection,\n  crsFunction,\n  options\n) {\n  const geometries = geometryCollection.geometries;\n  for (let i = 0, len = geometries.length; i < len; i++) {\n    const geometry = geometries[i];\n    const geometryType = geometry.type;\n    const geometryHandler = geometryTypes[geometryType];\n    if (!defined(geometryHandler)) {\n      throw new RuntimeError(`Unknown geometry type: ${geometryType}`);\n    }\n    geometryHandler(dataSource, geoJson, geometry, crsFunction, options);\n  }\n}\n\nfunction createPoint(dataSource, geoJson, crsFunction, coordinates, options) {\n  let symbol = options.markerSymbol;\n  let color = options.markerColor;\n  let size = options.markerSize;\n\n  const properties = geoJson.properties;\n  if (defined(properties)) {\n    const cssColor = properties[\"marker-color\"];\n    if (defined(cssColor)) {\n      color = Color.fromCssColorString(cssColor);\n    }\n\n    size = defaultValue(sizes[properties[\"marker-size\"]], size);\n    const markerSymbol = properties[\"marker-symbol\"];\n    if (defined(markerSymbol)) {\n      symbol = markerSymbol;\n    }\n  }\n\n  let canvasOrPromise;\n  if (defined(symbol)) {\n    if (symbol.length === 1) {\n      canvasOrPromise = dataSource._pinBuilder.fromText(\n        symbol.toUpperCase(),\n        color,\n        size\n      );\n    } else {\n      canvasOrPromise = dataSource._pinBuilder.fromMakiIconId(\n        symbol,\n        color,\n        size\n      );\n    }\n  } else {\n    canvasOrPromise = dataSource._pinBuilder.fromColor(color, size);\n  }\n\n  const billboard = new BillboardGraphics();\n  billboard.verticalOrigin = new ConstantProperty(VerticalOrigin.BOTTOM);\n\n  // Clamp to ground if there isn't a height specified\n  if (coordinates.length === 2 && options.clampToGround) {\n    billboard.heightReference = HeightReference.CLAMP_TO_GROUND;\n  }\n\n  const entity = createObject(\n    geoJson,\n    dataSource._entityCollection,\n    options.describe\n  );\n  entity.billboard = billboard;\n  entity.position = new ConstantPositionProperty(crsFunction(coordinates));\n\n  const promise = Promise.resolve(canvasOrPromise)\n    .then(function (image) {\n      billboard.image = new ConstantProperty(image);\n    })\n    .catch(function () {\n      billboard.image = new ConstantProperty(\n        dataSource._pinBuilder.fromColor(color, size)\n      );\n    });\n\n  dataSource._promises.push(promise);\n}\n\nfunction processPoint(dataSource, geoJson, geometry, crsFunction, options) {\n  createPoint(dataSource, geoJson, crsFunction, geometry.coordinates, options);\n}\n\nfunction processMultiPoint(\n  dataSource,\n  geoJson,\n  geometry,\n  crsFunction,\n  options\n) {\n  const coordinates = geometry.coordinates;\n  for (let i = 0; i < coordinates.length; i++) {\n    createPoint(dataSource, geoJson, crsFunction, coordinates[i], options);\n  }\n}\n\nfunction createLineString(\n  dataSource,\n  geoJson,\n  crsFunction,\n  coordinates,\n  options\n) {\n  let material = options.strokeMaterialProperty;\n  let widthProperty = options.strokeWidthProperty;\n\n  const properties = geoJson.properties;\n  if (defined(properties)) {\n    const width = properties[\"stroke-width\"];\n    if (defined(width)) {\n      widthProperty = new ConstantProperty(width);\n    }\n\n    let color;\n    const stroke = properties.stroke;\n    if (defined(stroke)) {\n      color = Color.fromCssColorString(stroke);\n    }\n    const opacity = properties[\"stroke-opacity\"];\n    if (defined(opacity) && opacity !== 1.0) {\n      if (!defined(color)) {\n        color = material.color.getValue().clone();\n      }\n      color.alpha = opacity;\n    }\n    if (defined(color)) {\n      material = new ColorMaterialProperty(color);\n    }\n  }\n\n  const entity = createObject(\n    geoJson,\n    dataSource._entityCollection,\n    options.describe\n  );\n  const polylineGraphics = new PolylineGraphics();\n  entity.polyline = polylineGraphics;\n\n  polylineGraphics.clampToGround = options.clampToGround;\n  polylineGraphics.material = material;\n  polylineGraphics.width = widthProperty;\n  polylineGraphics.positions = new ConstantProperty(\n    coordinatesArrayToCartesianArray(coordinates, crsFunction)\n  );\n  polylineGraphics.arcType = ArcType.RHUMB;\n}\n\nfunction processLineString(\n  dataSource,\n  geoJson,\n  geometry,\n  crsFunction,\n  options\n) {\n  createLineString(\n    dataSource,\n    geoJson,\n    crsFunction,\n    geometry.coordinates,\n    options\n  );\n}\n\nfunction processMultiLineString(\n  dataSource,\n  geoJson,\n  geometry,\n  crsFunction,\n  options\n) {\n  const lineStrings = geometry.coordinates;\n  for (let i = 0; i < lineStrings.length; i++) {\n    createLineString(dataSource, geoJson, crsFunction, lineStrings[i], options);\n  }\n}\n\nfunction createPolygon(dataSource, geoJson, crsFunction, coordinates, options) {\n  if (coordinates.length === 0 || coordinates[0].length === 0) {\n    return;\n  }\n\n  let outlineColorProperty = options.strokeMaterialProperty.color;\n  let material = options.fillMaterialProperty;\n  let widthProperty = options.strokeWidthProperty;\n\n  const properties = geoJson.properties;\n  if (defined(properties)) {\n    const width = properties[\"stroke-width\"];\n    if (defined(width)) {\n      widthProperty = new ConstantProperty(width);\n    }\n\n    let color;\n    const stroke = properties.stroke;\n    if (defined(stroke)) {\n      color = Color.fromCssColorString(stroke);\n    }\n    let opacity = properties[\"stroke-opacity\"];\n    if (defined(opacity) && opacity !== 1.0) {\n      if (!defined(color)) {\n        color = outlineColorProperty.getValue().clone();\n      }\n      color.alpha = opacity;\n    }\n\n    if (defined(color)) {\n      outlineColorProperty = new ConstantProperty(color);\n    }\n\n    let fillColor;\n    const fill = properties.fill;\n    const materialColor = material.color.getValue();\n    if (defined(fill)) {\n      fillColor = Color.fromCssColorString(fill);\n      fillColor.alpha = materialColor.alpha;\n    }\n    opacity = properties[\"fill-opacity\"];\n    if (defined(opacity) && opacity !== materialColor.alpha) {\n      if (!defined(fillColor)) {\n        fillColor = materialColor.clone();\n      }\n      fillColor.alpha = opacity;\n    }\n    if (defined(fillColor)) {\n      material = new ColorMaterialProperty(fillColor);\n    }\n  }\n\n  const polygon = new PolygonGraphics();\n  polygon.outline = new ConstantProperty(true);\n  polygon.outlineColor = outlineColorProperty;\n  polygon.outlineWidth = widthProperty;\n  polygon.material = material;\n  polygon.arcType = ArcType.RHUMB;\n\n  const holes = [];\n  for (let i = 1, len = coordinates.length; i < len; i++) {\n    holes.push(\n      new PolygonHierarchy(\n        coordinatesArrayToCartesianArray(coordinates[i], crsFunction)\n      )\n    );\n  }\n\n  const positions = coordinates[0];\n  polygon.hierarchy = new ConstantProperty(\n    new PolygonHierarchy(\n      coordinatesArrayToCartesianArray(positions, crsFunction),\n      holes\n    )\n  );\n  if (positions[0].length > 2) {\n    polygon.perPositionHeight = new ConstantProperty(true);\n  } else if (!options.clampToGround) {\n    polygon.height = 0;\n  }\n\n  const entity = createObject(\n    geoJson,\n    dataSource._entityCollection,\n    options.describe\n  );\n  entity.polygon = polygon;\n}\n\nfunction processPolygon(dataSource, geoJson, geometry, crsFunction, options) {\n  createPolygon(\n    dataSource,\n    geoJson,\n    crsFunction,\n    geometry.coordinates,\n    options\n  );\n}\n\nfunction processMultiPolygon(\n  dataSource,\n  geoJson,\n  geometry,\n  crsFunction,\n  options\n) {\n  const polygons = geometry.coordinates;\n  for (let i = 0; i < polygons.length; i++) {\n    createPolygon(dataSource, geoJson, crsFunction, polygons[i], options);\n  }\n}\n\nfunction processTopology(dataSource, geoJson, geometry, crsFunction, options) {\n  for (const property in geometry.objects) {\n    if (geometry.objects.hasOwnProperty(property)) {\n      const feature = topojson.feature(geometry, geometry.objects[property]);\n      const typeHandler = geoJsonObjectTypes[feature.type];\n      typeHandler(dataSource, feature, feature, crsFunction, options);\n    }\n  }\n}\n\n/**\n * @typedef {object} GeoJsonDataSource.LoadOptions\n *\n * Initialization options for the <code>load</code> method.\n *\n * @property {string} [sourceUri] Overrides the url to use for resolving relative links.\n * @property {GeoJsonDataSource.describe} [describe=GeoJsonDataSource.defaultDescribeProperty] A function which returns a Property object (or just a string).\n * @property {number} [markerSize=GeoJsonDataSource.markerSize] The default size of the map pin created for each point, in pixels.\n * @property {string} [markerSymbol=GeoJsonDataSource.markerSymbol] The default symbol of the map pin created for each point.\n * @property {Color} [markerColor=GeoJsonDataSource.markerColor] The default color of the map pin created for each point.\n * @property {Color} [stroke=GeoJsonDataSource.stroke] The default color of polylines and polygon outlines.\n * @property {number} [strokeWidth=GeoJsonDataSource.strokeWidth] The default width of polylines and polygon outlines.\n * @property {Color} [fill=GeoJsonDataSource.fill] The default color for polygon interiors.\n * @property {boolean} [clampToGround=GeoJsonDataSource.clampToGround] true if we want the geometry features (polygons or linestrings) clamped to the ground.\n * @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.\n */\n\n/**\n * A {@link DataSource} which processes both\n * {@link http://www.geojson.org/|GeoJSON} and {@link https://github.com/mbostock/topojson|TopoJSON} data.\n * {@link https://github.com/mapbox/simplestyle-spec|simplestyle-spec} properties will also be used if they\n * are present.\n *\n * @alias GeoJsonDataSource\n * @constructor\n *\n * @param {string} [name] The name of this data source.  If undefined, a name will be taken from\n *                        the name of the GeoJSON file.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=GeoJSON%20and%20TopoJSON.html|Cesium Sandcastle GeoJSON and TopoJSON Demo}\n * @demo {@link https://sandcastle.cesium.com/index.html?src=GeoJSON%20simplestyle.html|Cesium Sandcastle GeoJSON simplestyle Demo}\n *\n * @example\n * const viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.dataSources.add(Cesium.GeoJsonDataSource.load('../../SampleData/ne_10m_us_states.topojson', {\n *   stroke: Cesium.Color.HOTPINK,\n *   fill: Cesium.Color.PINK,\n *   strokeWidth: 3,\n *   markerSymbol: '?'\n * }));\n */\nfunction GeoJsonDataSource(name) {\n  this._name = name;\n  this._changed = new Event();\n  this._error = new Event();\n  this._isLoading = false;\n  this._loading = new Event();\n  this._entityCollection = new EntityCollection(this);\n  this._promises = [];\n  this._pinBuilder = new PinBuilder();\n  this._entityCluster = new EntityCluster();\n  this._credit = undefined;\n  this._resourceCredits = [];\n}\n\n/**\n * Creates a Promise to a new instance loaded with the provided GeoJSON or TopoJSON data.\n *\n * @param {Resource|string|object} data A url, GeoJSON object, or TopoJSON object to be loaded.\n * @param {GeoJsonDataSource.LoadOptions} [options] An object specifying configuration options\n *\n * @returns {Promise<GeoJsonDataSource>} A promise that will resolve when the data is loaded.\n */\nGeoJsonDataSource.load = function (data, options) {\n  return new GeoJsonDataSource().load(data, options);\n};\n\nObject.defineProperties(GeoJsonDataSource, {\n  /**\n   * Gets or sets the default size of the map pin created for each point, in pixels.\n   * @memberof GeoJsonDataSource\n   * @type {number}\n   * @default 48\n   */\n  markerSize: {\n    get: function () {\n      return defaultMarkerSize;\n    },\n    set: function (value) {\n      defaultMarkerSize = value;\n    },\n  },\n  /**\n   * Gets or sets the default symbol of the map pin created for each point.\n   * This can be any valid {@link http://mapbox.com/maki/|Maki} identifier, any single character,\n   * or blank if no symbol is to be used.\n   * @memberof GeoJsonDataSource\n   * @type {string}\n   */\n  markerSymbol: {\n    get: function () {\n      return defaultMarkerSymbol;\n    },\n    set: function (value) {\n      defaultMarkerSymbol = value;\n    },\n  },\n  /**\n   * Gets or sets the default color of the map pin created for each point.\n   * @memberof GeoJsonDataSource\n   * @type {Color}\n   * @default Color.ROYALBLUE\n   */\n  markerColor: {\n    get: function () {\n      return defaultMarkerColor;\n    },\n    set: function (value) {\n      defaultMarkerColor = value;\n    },\n  },\n  /**\n   * Gets or sets the default color of polylines and polygon outlines.\n   * @memberof GeoJsonDataSource\n   * @type {Color}\n   * @default Color.BLACK\n   */\n  stroke: {\n    get: function () {\n      return defaultStroke;\n    },\n    set: function (value) {\n      defaultStroke = value;\n    },\n  },\n  /**\n   * Gets or sets the default width of polylines and polygon outlines.\n   * @memberof GeoJsonDataSource\n   * @type {number}\n   * @default 2.0\n   */\n  strokeWidth: {\n    get: function () {\n      return defaultStrokeWidth;\n    },\n    set: function (value) {\n      defaultStrokeWidth = value;\n    },\n  },\n  /**\n   * Gets or sets default color for polygon interiors.\n   * @memberof GeoJsonDataSource\n   * @type {Color}\n   * @default Color.YELLOW\n   */\n  fill: {\n    get: function () {\n      return defaultFill;\n    },\n    set: function (value) {\n      defaultFill = value;\n    },\n  },\n  /**\n   * Gets or sets default of whether to clamp to the ground.\n   * @memberof GeoJsonDataSource\n   * @type {boolean}\n   * @default false\n   */\n  clampToGround: {\n    get: function () {\n      return defaultClampToGround;\n    },\n    set: function (value) {\n      defaultClampToGround = value;\n    },\n  },\n\n  /**\n   * Gets an object that maps the name of a crs to a callback function which takes a GeoJSON coordinate\n   * and transforms it into a WGS84 Earth-fixed Cartesian.  Older versions of GeoJSON which\n   * supported the EPSG type can be added to this list as well, by specifying the complete EPSG name,\n   * for example 'EPSG:4326'.\n   * @memberof GeoJsonDataSource\n   * @type {object}\n   */\n  crsNames: {\n    get: function () {\n      return crsNames;\n    },\n  },\n\n  /**\n   * Gets an object that maps the href property of a crs link to a callback function\n   * which takes the crs properties object and returns a Promise that resolves\n   * to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian.\n   * Items in this object take precedence over those defined in <code>crsLinkHrefs</code>, assuming\n   * the link has a type specified.\n   * @memberof GeoJsonDataSource\n   * @type {object}\n   */\n  crsLinkHrefs: {\n    get: function () {\n      return crsLinkHrefs;\n    },\n  },\n\n  /**\n   * Gets an object that maps the type property of a crs link to a callback function\n   * which takes the crs properties object and returns a Promise that resolves\n   * to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian.\n   * Items in <code>crsLinkHrefs</code> take precedence over this object.\n   * @memberof GeoJsonDataSource\n   * @type {object}\n   */\n  crsLinkTypes: {\n    get: function () {\n      return crsLinkTypes;\n    },\n  },\n});\n\nObject.defineProperties(GeoJsonDataSource.prototype, {\n  /**\n   * Gets or sets a human-readable name for this instance.\n   * @memberof GeoJsonDataSource.prototype\n   * @type {string}\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n    set: function (value) {\n      if (this._name !== value) {\n        this._name = value;\n        this._changed.raiseEvent(this);\n      }\n    },\n  },\n  /**\n   * This DataSource only defines static data, therefore this property is always undefined.\n   * @memberof GeoJsonDataSource.prototype\n   * @type {DataSourceClock}\n   */\n  clock: {\n    value: undefined,\n    writable: false,\n  },\n  /**\n   * Gets the collection of {@link Entity} instances.\n   * @memberof GeoJsonDataSource.prototype\n   * @type {EntityCollection}\n   */\n  entities: {\n    get: function () {\n      return this._entityCollection;\n    },\n  },\n  /**\n   * Gets a value indicating if the data source is currently loading data.\n   * @memberof GeoJsonDataSource.prototype\n   * @type {boolean}\n   */\n  isLoading: {\n    get: function () {\n      return this._isLoading;\n    },\n  },\n  /**\n   * Gets an event that will be raised when the underlying data changes.\n   * @memberof GeoJsonDataSource.prototype\n   * @type {Event}\n   */\n  changedEvent: {\n    get: function () {\n      return this._changed;\n    },\n  },\n  /**\n   * Gets an event that will be raised if an error is encountered during processing.\n   * @memberof GeoJsonDataSource.prototype\n   * @type {Event}\n   */\n  errorEvent: {\n    get: function () {\n      return this._error;\n    },\n  },\n  /**\n   * Gets an event that will be raised when the data source either starts or stops loading.\n   * @memberof GeoJsonDataSource.prototype\n   * @type {Event}\n   */\n  loadingEvent: {\n    get: function () {\n      return this._loading;\n    },\n  },\n  /**\n   * Gets whether or not this data source should be displayed.\n   * @memberof GeoJsonDataSource.prototype\n   * @type {boolean}\n   */\n  show: {\n    get: function () {\n      return this._entityCollection.show;\n    },\n    set: function (value) {\n      this._entityCollection.show = value;\n    },\n  },\n\n  /**\n   * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.\n   *\n   * @memberof GeoJsonDataSource.prototype\n   * @type {EntityCluster}\n   */\n  clustering: {\n    get: function () {\n      return this._entityCluster;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value must be defined.\");\n      }\n      //>>includeEnd('debug');\n      this._entityCluster = value;\n    },\n  },\n  /**\n   * Gets the credit that will be displayed for the data source\n   * @memberof GeoJsonDataSource.prototype\n   * @type {Credit}\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n});\n\n/**\n * Asynchronously loads the provided GeoJSON or TopoJSON data, replacing any existing data.\n *\n * @param {Resource|string|object} data A url, GeoJSON object, or TopoJSON object to be loaded.\n * @param {GeoJsonDataSource.LoadOptions} [options] An object specifying configuration options\n *\n * @returns {Promise<GeoJsonDataSource>} a promise that will resolve when the GeoJSON is loaded.\n */\nGeoJsonDataSource.prototype.load = function (data, options) {\n  return preload(this, data, options, true);\n};\n\n/**\n * Asynchronously loads the provided GeoJSON or TopoJSON data, without replacing any existing data.\n *\n * @param {Resource|string|object} data A url, GeoJSON object, or TopoJSON object to be loaded.\n * @param {GeoJsonDataSource.LoadOptions} [options] An object specifying configuration options\n *\n * @returns {Promise<GeoJsonDataSource>} a promise that will resolve when the GeoJSON is loaded.\n */\nGeoJsonDataSource.prototype.process = function (data, options) {\n  return preload(this, data, options, false);\n};\n\nfunction preload(that, data, options, clear) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(data)) {\n    throw new DeveloperError(\"data is required.\");\n  }\n  //>>includeEnd('debug');\n\n  DataSource.setLoading(that, true);\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  // User specified credit\n  let credit = options.credit;\n  if (typeof credit === \"string\") {\n    credit = new Credit(credit);\n  }\n  that._credit = credit;\n\n  let promise = data;\n  let sourceUri = options.sourceUri;\n  if (typeof data === \"string\" || data instanceof Resource) {\n    data = Resource.createIfNeeded(data);\n    promise = data.fetchJson();\n    sourceUri = defaultValue(sourceUri, data.getUrlComponent());\n\n    // Add resource credits to our list of credits to display\n    const resourceCredits = that._resourceCredits;\n    const credits = data.credits;\n    if (defined(credits)) {\n      const length = credits.length;\n      for (let i = 0; i < length; i++) {\n        resourceCredits.push(credits[i]);\n      }\n    }\n  }\n\n  options = {\n    describe: defaultValue(options.describe, defaultDescribeProperty),\n    markerSize: defaultValue(options.markerSize, defaultMarkerSize),\n    markerSymbol: defaultValue(options.markerSymbol, defaultMarkerSymbol),\n    markerColor: defaultValue(options.markerColor, defaultMarkerColor),\n    strokeWidthProperty: new ConstantProperty(\n      defaultValue(options.strokeWidth, defaultStrokeWidth)\n    ),\n    strokeMaterialProperty: new ColorMaterialProperty(\n      defaultValue(options.stroke, defaultStroke)\n    ),\n    fillMaterialProperty: new ColorMaterialProperty(\n      defaultValue(options.fill, defaultFill)\n    ),\n    clampToGround: defaultValue(options.clampToGround, defaultClampToGround),\n  };\n\n  return Promise.resolve(promise)\n    .then(function (geoJson) {\n      return load(that, geoJson, options, sourceUri, clear);\n    })\n    .catch(function (error) {\n      DataSource.setLoading(that, false);\n      that._error.raiseEvent(that, error);\n      throw error;\n    });\n}\n\n/**\n * Updates the data source to the provided time.  This function is optional and\n * is not required to be implemented.  It is provided for data sources which\n * retrieve data based on the current animation time or scene state.\n * If implemented, update will be called by {@link DataSourceDisplay} once a frame.\n *\n * @param {JulianDate} time The simulation time.\n * @returns {boolean} True if this data source is ready to be displayed at the provided time, false otherwise.\n */\nGeoJsonDataSource.prototype.update = function (time) {\n  return true;\n};\n\nfunction load(that, geoJson, options, sourceUri, clear) {\n  let name;\n  if (defined(sourceUri)) {\n    name = getFilenameFromUri(sourceUri);\n  }\n\n  if (defined(name) && that._name !== name) {\n    that._name = name;\n    that._changed.raiseEvent(that);\n  }\n\n  const typeHandler = geoJsonObjectTypes[geoJson.type];\n  if (!defined(typeHandler)) {\n    throw new RuntimeError(`Unsupported GeoJSON object type: ${geoJson.type}`);\n  }\n\n  //Check for a Coordinate Reference System.\n  const crs = geoJson.crs;\n  let crsFunction = crs !== null ? defaultCrsFunction : null;\n\n  if (defined(crs)) {\n    if (!defined(crs.properties)) {\n      throw new RuntimeError(\"crs.properties is undefined.\");\n    }\n\n    const properties = crs.properties;\n    if (crs.type === \"name\") {\n      crsFunction = crsNames[properties.name];\n      if (!defined(crsFunction)) {\n        throw new RuntimeError(`Unknown crs name: ${properties.name}`);\n      }\n    } else if (crs.type === \"link\") {\n      let handler = crsLinkHrefs[properties.href];\n      if (!defined(handler)) {\n        handler = crsLinkTypes[properties.type];\n      }\n\n      if (!defined(handler)) {\n        throw new RuntimeError(\n          `Unable to resolve crs link: ${JSON.stringify(properties)}`\n        );\n      }\n\n      crsFunction = handler(properties);\n    } else if (crs.type === \"EPSG\") {\n      crsFunction = crsNames[`EPSG:${properties.code}`];\n      if (!defined(crsFunction)) {\n        throw new RuntimeError(`Unknown crs EPSG code: ${properties.code}`);\n      }\n    } else {\n      throw new RuntimeError(`Unknown crs type: ${crs.type}`);\n    }\n  }\n\n  return Promise.resolve(crsFunction).then(function (crsFunction) {\n    if (clear) {\n      that._entityCollection.removeAll();\n    }\n\n    // null is a valid value for the crs, but means the entire load process becomes a no-op\n    // because we can't assume anything about the coordinates.\n    if (crsFunction !== null) {\n      typeHandler(that, geoJson, geoJson, crsFunction, options);\n    }\n\n    return Promise.all(that._promises).then(function () {\n      that._promises.length = 0;\n      DataSource.setLoading(that, false);\n      return that;\n    });\n  });\n}\n\n/**\n * This callback is displayed as part of the GeoJsonDataSource class.\n * @callback GeoJsonDataSource.describe\n * @param {object} properties The properties of the feature.\n * @param {string} nameProperty The property key that Cesium estimates to have the name of the feature.\n */\nexport default GeoJsonDataSource;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport ClockRange from \"../Core/ClockRange.js\";\nimport ClockStep from \"../Core/ClockStep.js\";\nimport Color from \"../Core/Color.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport PinBuilder from \"../Core/PinBuilder.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TimeInterval from \"../Core/TimeInterval.js\";\nimport TimeIntervalCollection from \"../Core/TimeIntervalCollection.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport HorizontalOrigin from \"../Scene/HorizontalOrigin.js\";\nimport LabelStyle from \"../Scene/LabelStyle.js\";\nimport VerticalOrigin from \"../Scene/VerticalOrigin.js\";\nimport Autolinker from \"autolinker\";\nimport BillboardGraphics from \"./BillboardGraphics.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport DataSource from \"./DataSource.js\";\nimport DataSourceClock from \"./DataSourceClock.js\";\nimport EntityCluster from \"./EntityCluster.js\";\nimport EntityCollection from \"./EntityCollection.js\";\nimport LabelGraphics from \"./LabelGraphics.js\";\nimport PolylineGraphics from \"./PolylineGraphics.js\";\nimport PolylineOutlineMaterialProperty from \"./PolylineOutlineMaterialProperty.js\";\nimport SampledPositionProperty from \"./SampledPositionProperty.js\";\n\nlet parser;\nif (typeof DOMParser !== \"undefined\") {\n  parser = new DOMParser();\n}\n\nconst autolinker = new Autolinker({\n  stripPrefix: false,\n  email: false,\n  replaceFn: function (linker, match) {\n    //Prevent matching of non-explicit urls.\n    //i.e. foo.id won't match but http://foo.id will\n    return match.urlMatchType === \"scheme\" || match.urlMatchType === \"www\";\n  },\n});\n\nconst BILLBOARD_SIZE = 32;\nconst BILLBOARD_NEAR_DISTANCE = 2414016;\nconst BILLBOARD_NEAR_RATIO = 1.0;\nconst BILLBOARD_FAR_DISTANCE = 1.6093e7;\nconst BILLBOARD_FAR_RATIO = 0.1;\n\nconst gpxNamespaces = [null, undefined, \"http://www.topografix.com/GPX/1/1\"];\nconst namespaces = {\n  gpx: gpxNamespaces,\n};\n\nfunction readBlobAsText(blob) {\n  return new Promise((resolve, reject) => {\n    const reader = new FileReader();\n    reader.addEventListener(\"load\", function () {\n      resolve(reader.result);\n    });\n    reader.addEventListener(\"error\", function () {\n      reject(reader.error);\n    });\n    reader.readAsText(blob);\n  });\n}\n\nfunction getOrCreateEntity(node, entityCollection) {\n  let id = queryStringAttribute(node, \"id\");\n  id = defined(id) ? id : createGuid();\n  const entity = entityCollection.getOrCreateEntity(id);\n  return entity;\n}\n\nfunction readCoordinateFromNode(node) {\n  const longitude = queryNumericAttribute(node, \"lon\");\n  const latitude = queryNumericAttribute(node, \"lat\");\n  const elevation = queryNumericValue(node, \"ele\", namespaces.gpx);\n  return Cartesian3.fromDegrees(longitude, latitude, elevation);\n}\n\nfunction queryNumericAttribute(node, attributeName) {\n  if (!defined(node)) {\n    return undefined;\n  }\n\n  const value = node.getAttribute(attributeName);\n  if (value !== null) {\n    const result = parseFloat(value);\n    return !isNaN(result) ? result : undefined;\n  }\n  return undefined;\n}\n\nfunction queryStringAttribute(node, attributeName) {\n  if (!defined(node)) {\n    return undefined;\n  }\n  const value = node.getAttribute(attributeName);\n  return value !== null ? value : undefined;\n}\n\nfunction queryFirstNode(node, tagName, namespace) {\n  if (!defined(node)) {\n    return undefined;\n  }\n  const childNodes = node.childNodes;\n  const length = childNodes.length;\n  for (let q = 0; q < length; q++) {\n    const child = childNodes[q];\n    if (\n      child.localName === tagName &&\n      namespace.indexOf(child.namespaceURI) !== -1\n    ) {\n      return child;\n    }\n  }\n  return undefined;\n}\n\nfunction queryNodes(node, tagName, namespace) {\n  if (!defined(node)) {\n    return undefined;\n  }\n  const result = [];\n  const childNodes = node.getElementsByTagName(tagName);\n  const length = childNodes.length;\n  for (let q = 0; q < length; q++) {\n    const child = childNodes[q];\n    if (\n      child.localName === tagName &&\n      namespace.indexOf(child.namespaceURI) !== -1\n    ) {\n      result.push(child);\n    }\n  }\n  return result;\n}\n\nfunction queryNumericValue(node, tagName, namespace) {\n  const resultNode = queryFirstNode(node, tagName, namespace);\n  if (defined(resultNode)) {\n    const result = parseFloat(resultNode.textContent);\n    return !isNaN(result) ? result : undefined;\n  }\n  return undefined;\n}\n\nfunction queryStringValue(node, tagName, namespace) {\n  const result = queryFirstNode(node, tagName, namespace);\n  if (defined(result)) {\n    return result.textContent.trim();\n  }\n  return undefined;\n}\n\nfunction createDefaultBillboard(image) {\n  const billboard = new BillboardGraphics();\n  billboard.width = BILLBOARD_SIZE;\n  billboard.height = BILLBOARD_SIZE;\n  billboard.scaleByDistance = new NearFarScalar(\n    BILLBOARD_NEAR_DISTANCE,\n    BILLBOARD_NEAR_RATIO,\n    BILLBOARD_FAR_DISTANCE,\n    BILLBOARD_FAR_RATIO\n  );\n  billboard.pixelOffsetScaleByDistance = new NearFarScalar(\n    BILLBOARD_NEAR_DISTANCE,\n    BILLBOARD_NEAR_RATIO,\n    BILLBOARD_FAR_DISTANCE,\n    BILLBOARD_FAR_RATIO\n  );\n  billboard.verticalOrigin = new ConstantProperty(VerticalOrigin.BOTTOM);\n  billboard.image = image;\n  return billboard;\n}\n\nfunction createDefaultLabel() {\n  const label = new LabelGraphics();\n  label.translucencyByDistance = new NearFarScalar(3000000, 1.0, 5000000, 0.0);\n  label.pixelOffset = new Cartesian2(17, 0);\n  label.horizontalOrigin = HorizontalOrigin.LEFT;\n  label.font = \"16px sans-serif\";\n  label.style = LabelStyle.FILL_AND_OUTLINE;\n  return label;\n}\n\nfunction createDefaultPolyline(color) {\n  const polyline = new PolylineGraphics();\n  polyline.width = 4;\n  polyline.material = new PolylineOutlineMaterialProperty();\n  polyline.material.color = defined(color) ? color : Color.RED;\n  polyline.material.outlineWidth = 2;\n  polyline.material.outlineColor = Color.BLACK;\n  return polyline;\n}\n\n// This is a list of the Optional Description Information:\n//  <cmt> GPS comment of the waypoint\n//  <desc> Descriptive description of the waypoint\n//  <src> Source of the waypoint data\n//  <type> Type (category) of waypoint\nconst descriptiveInfoTypes = {\n  time: {\n    text: \"Time\",\n    tag: \"time\",\n  },\n  comment: {\n    text: \"Comment\",\n    tag: \"cmt\",\n  },\n  description: {\n    text: \"Description\",\n    tag: \"desc\",\n  },\n  source: {\n    text: \"Source\",\n    tag: \"src\",\n  },\n  number: {\n    text: \"GPS track/route number\",\n    tag: \"number\",\n  },\n  type: {\n    text: \"Type\",\n    tag: \"type\",\n  },\n};\n\nlet scratchDiv;\nif (typeof document !== \"undefined\") {\n  scratchDiv = document.createElement(\"div\");\n}\nfunction processDescription(node, entity) {\n  let i;\n\n  let text = \"\";\n  const infoTypeNames = Object.keys(descriptiveInfoTypes);\n  const length = infoTypeNames.length;\n  for (i = 0; i < length; i++) {\n    const infoTypeName = infoTypeNames[i];\n    const infoType = descriptiveInfoTypes[infoTypeName];\n    infoType.value = defaultValue(\n      queryStringValue(node, infoType.tag, namespaces.gpx),\n      \"\"\n    );\n    if (defined(infoType.value) && infoType.value !== \"\") {\n      text = `${text}<p>${infoType.text}: ${infoType.value}</p>`;\n    }\n  }\n\n  if (!defined(text) || text === \"\") {\n    // No description\n    return;\n  }\n\n  // Turns non-explicit links into clickable links.\n  text = autolinker.link(text);\n\n  // Use a temporary div to manipulate the links\n  // so that they open in a new window.\n  scratchDiv.innerHTML = text;\n  const links = scratchDiv.querySelectorAll(\"a\");\n\n  for (i = 0; i < links.length; i++) {\n    links[i].setAttribute(\"target\", \"_blank\");\n  }\n\n  const background = Color.WHITE;\n  const foreground = Color.BLACK;\n  let tmp = '<div class=\"cesium-infoBox-description-lighter\" style=\"';\n  tmp += \"overflow:auto;\";\n  tmp += \"word-wrap:break-word;\";\n  tmp += `background-color:${background.toCssColorString()};`;\n  tmp += `color:${foreground.toCssColorString()};`;\n  tmp += '\">';\n  tmp += `${scratchDiv.innerHTML}</div>`;\n  scratchDiv.innerHTML = \"\";\n\n  // return the final HTML as the description.\n  return tmp;\n}\n\nfunction processWpt(dataSource, geometryNode, entityCollection, options) {\n  const position = readCoordinateFromNode(geometryNode);\n\n  const entity = getOrCreateEntity(geometryNode, entityCollection);\n  entity.position = position;\n\n  // Get billboard image\n  const image = defined(options.waypointImage)\n    ? options.waypointImage\n    : dataSource._pinBuilder.fromMakiIconId(\n        \"marker\",\n        Color.RED,\n        BILLBOARD_SIZE\n      );\n  entity.billboard = createDefaultBillboard(image);\n\n  const name = queryStringValue(geometryNode, \"name\", namespaces.gpx);\n  entity.name = name;\n  entity.label = createDefaultLabel();\n  entity.label.text = name;\n  entity.description = processDescription(geometryNode, entity);\n\n  if (options.clampToGround) {\n    entity.billboard.heightReference = HeightReference.CLAMP_TO_GROUND;\n    entity.label.heightReference = HeightReference.CLAMP_TO_GROUND;\n  }\n}\n\n// rte represents route - an ordered list of waypoints representing a series of turn points leading to a destination\nfunction processRte(dataSource, geometryNode, entityCollection, options) {\n  const entity = getOrCreateEntity(geometryNode, entityCollection);\n  entity.description = processDescription(geometryNode, entity);\n\n  // a list of waypoint\n  const routePoints = queryNodes(geometryNode, \"rtept\", namespaces.gpx);\n  const coordinateTuples = new Array(routePoints.length);\n  for (let i = 0; i < routePoints.length; i++) {\n    processWpt(dataSource, routePoints[i], entityCollection, options);\n    coordinateTuples[i] = readCoordinateFromNode(routePoints[i]);\n  }\n  entity.polyline = createDefaultPolyline(options.routeColor);\n  if (options.clampToGround) {\n    entity.polyline.clampToGround = true;\n  }\n  entity.polyline.positions = coordinateTuples;\n}\n\n// trk represents a track - an ordered list of points describing a path.\nfunction processTrk(dataSource, geometryNode, entityCollection, options) {\n  const entity = getOrCreateEntity(geometryNode, entityCollection);\n  entity.description = processDescription(geometryNode, entity);\n\n  const trackSegs = queryNodes(geometryNode, \"trkseg\", namespaces.gpx);\n  let positions = [];\n  let times = [];\n  let trackSegInfo;\n  let isTimeDynamic = true;\n  const property = new SampledPositionProperty();\n  for (let i = 0; i < trackSegs.length; i++) {\n    trackSegInfo = processTrkSeg(trackSegs[i]);\n    positions = positions.concat(trackSegInfo.positions);\n    if (trackSegInfo.times.length > 0) {\n      times = times.concat(trackSegInfo.times);\n      property.addSamples(times, positions);\n      // if one track segment is non dynamic the whole track must also be\n      isTimeDynamic = isTimeDynamic && true;\n    } else {\n      isTimeDynamic = false;\n    }\n  }\n  if (isTimeDynamic) {\n    // Assign billboard image\n    const image = defined(options.waypointImage)\n      ? options.waypointImage\n      : dataSource._pinBuilder.fromMakiIconId(\n          \"marker\",\n          Color.RED,\n          BILLBOARD_SIZE\n        );\n    entity.billboard = createDefaultBillboard(image);\n    entity.position = property;\n    if (options.clampToGround) {\n      entity.billboard.heightReference = HeightReference.CLAMP_TO_GROUND;\n    }\n    entity.availability = new TimeIntervalCollection();\n    entity.availability.addInterval(\n      new TimeInterval({\n        start: times[0],\n        stop: times[times.length - 1],\n      })\n    );\n  }\n  entity.polyline = createDefaultPolyline(options.trackColor);\n  entity.polyline.positions = positions;\n  if (options.clampToGround) {\n    entity.polyline.clampToGround = true;\n  }\n}\n\nfunction processTrkSeg(node) {\n  const result = {\n    positions: [],\n    times: [],\n  };\n  const trackPoints = queryNodes(node, \"trkpt\", namespaces.gpx);\n  let time;\n  for (let i = 0; i < trackPoints.length; i++) {\n    const position = readCoordinateFromNode(trackPoints[i]);\n    result.positions.push(position);\n\n    time = queryStringValue(trackPoints[i], \"time\", namespaces.gpx);\n    if (defined(time)) {\n      result.times.push(JulianDate.fromIso8601(time));\n    }\n  }\n  return result;\n}\n\n// Processes a metadataType node and returns a metadata object\n// {@link http://www.topografix.com/gpx/1/1/#type_metadataType|GPX Schema}\nfunction processMetadata(node) {\n  const metadataNode = queryFirstNode(node, \"metadata\", namespaces.gpx);\n  if (defined(metadataNode)) {\n    const metadata = {\n      name: queryStringValue(metadataNode, \"name\", namespaces.gpx),\n      desc: queryStringValue(metadataNode, \"desc\", namespaces.gpx),\n      author: getPerson(metadataNode),\n      copyright: getCopyright(metadataNode),\n      link: getLink(metadataNode),\n      time: queryStringValue(metadataNode, \"time\", namespaces.gpx),\n      keywords: queryStringValue(metadataNode, \"keywords\", namespaces.gpx),\n      bounds: getBounds(metadataNode),\n    };\n    if (\n      defined(metadata.name) ||\n      defined(metadata.desc) ||\n      defined(metadata.author) ||\n      defined(metadata.copyright) ||\n      defined(metadata.link) ||\n      defined(metadata.time) ||\n      defined(metadata.keywords) ||\n      defined(metadata.bounds)\n    ) {\n      return metadata;\n    }\n  }\n  return undefined;\n}\n\n// Receives a XML node and returns a personType object, refer to\n// {@link http://www.topografix.com/gpx/1/1/#type_personType|GPX Schema}\nfunction getPerson(node) {\n  const personNode = queryFirstNode(node, \"author\", namespaces.gpx);\n  if (defined(personNode)) {\n    const person = {\n      name: queryStringValue(personNode, \"name\", namespaces.gpx),\n      email: getEmail(personNode),\n      link: getLink(personNode),\n    };\n    if (defined(person.name) || defined(person.email) || defined(person.link)) {\n      return person;\n    }\n  }\n  return undefined;\n}\n\n// Receives a XML node and returns an email address (from emailType), refer to\n// {@link http://www.topografix.com/gpx/1/1/#type_emailType|GPX Schema}\nfunction getEmail(node) {\n  const emailNode = queryFirstNode(node, \"email\", namespaces.gpx);\n  if (defined(emailNode)) {\n    const id = queryStringValue(emailNode, \"id\", namespaces.gpx);\n    const domain = queryStringValue(emailNode, \"domain\", namespaces.gpx);\n    return `${id}@${domain}`;\n  }\n  return undefined;\n}\n\n// Receives a XML node and returns a linkType object, refer to\n// {@link http://www.topografix.com/gpx/1/1/#type_linkType|GPX Schema}\nfunction getLink(node) {\n  const linkNode = queryFirstNode(node, \"link\", namespaces.gpx);\n  if (defined(linkNode)) {\n    const link = {\n      href: queryStringAttribute(linkNode, \"href\"),\n      text: queryStringValue(linkNode, \"text\", namespaces.gpx),\n      mimeType: queryStringValue(linkNode, \"type\", namespaces.gpx),\n    };\n    if (defined(link.href) || defined(link.text) || defined(link.mimeType)) {\n      return link;\n    }\n  }\n  return undefined;\n}\n\n// Receives a XML node and returns a copyrightType object, refer to\n// {@link http://www.topografix.com/gpx/1/1/#type_copyrightType|GPX Schema}\nfunction getCopyright(node) {\n  const copyrightNode = queryFirstNode(node, \"copyright\", namespaces.gpx);\n  if (defined(copyrightNode)) {\n    const copyright = {\n      author: queryStringAttribute(copyrightNode, \"author\"),\n      year: queryStringValue(copyrightNode, \"year\", namespaces.gpx),\n      license: queryStringValue(copyrightNode, \"license\", namespaces.gpx),\n    };\n    if (\n      defined(copyright.author) ||\n      defined(copyright.year) ||\n      defined(copyright.license)\n    ) {\n      return copyright;\n    }\n  }\n  return undefined;\n}\n\n// Receives a XML node and returns a boundsType object, refer to\n// {@link http://www.topografix.com/gpx/1/1/#type_boundsType|GPX Schema}\nfunction getBounds(node) {\n  const boundsNode = queryFirstNode(node, \"bounds\", namespaces.gpx);\n  if (defined(boundsNode)) {\n    const bounds = {\n      minLat: queryNumericValue(boundsNode, \"minlat\", namespaces.gpx),\n      maxLat: queryNumericValue(boundsNode, \"maxlat\", namespaces.gpx),\n      minLon: queryNumericValue(boundsNode, \"minlon\", namespaces.gpx),\n      maxLon: queryNumericValue(boundsNode, \"maxlon\", namespaces.gpx),\n    };\n    if (\n      defined(bounds.minLat) ||\n      defined(bounds.maxLat) ||\n      defined(bounds.minLon) ||\n      defined(bounds.maxLon)\n    ) {\n      return bounds;\n    }\n  }\n  return undefined;\n}\n\nconst complexTypes = {\n  wpt: processWpt,\n  rte: processRte,\n  trk: processTrk,\n};\n\nfunction processGpx(dataSource, node, entityCollection, options) {\n  const complexTypeNames = Object.keys(complexTypes);\n  const complexTypeNamesLength = complexTypeNames.length;\n\n  for (let i = 0; i < complexTypeNamesLength; i++) {\n    const typeName = complexTypeNames[i];\n    const processComplexTypeNode = complexTypes[typeName];\n\n    const childNodes = node.childNodes;\n    const length = childNodes.length;\n    for (let q = 0; q < length; q++) {\n      const child = childNodes[q];\n      if (\n        child.localName === typeName &&\n        namespaces.gpx.indexOf(child.namespaceURI) !== -1\n      ) {\n        processComplexTypeNode(dataSource, child, entityCollection, options);\n      }\n    }\n  }\n}\n\nfunction loadGpx(dataSource, gpx, options) {\n  const entityCollection = dataSource._entityCollection;\n\n  entityCollection.removeAll();\n\n  const element = gpx.documentElement;\n  const version = queryStringAttribute(element, \"version\");\n  const creator = queryStringAttribute(element, \"creator\");\n\n  let name;\n  const metadata = processMetadata(element);\n  if (defined(metadata)) {\n    name = metadata.name;\n  }\n\n  if (element.localName === \"gpx\") {\n    processGpx(dataSource, element, entityCollection, options);\n  } else {\n    console.log(`GPX - Unsupported node: ${element.localName}`);\n  }\n\n  let clock;\n  const availability = entityCollection.computeAvailability();\n\n  let start = availability.start;\n  let stop = availability.stop;\n  const isMinStart = JulianDate.equals(start, Iso8601.MINIMUM_VALUE);\n  const isMaxStop = JulianDate.equals(stop, Iso8601.MAXIMUM_VALUE);\n  if (!isMinStart || !isMaxStop) {\n    let date;\n\n    // If start is min time just start at midnight this morning, local time\n    if (isMinStart) {\n      date = new Date();\n      date.setHours(0, 0, 0, 0);\n      start = JulianDate.fromDate(date);\n    }\n\n    // If stop is max value just stop at midnight tonight, local time\n    if (isMaxStop) {\n      date = new Date();\n      date.setHours(24, 0, 0, 0);\n      stop = JulianDate.fromDate(date);\n    }\n\n    clock = new DataSourceClock();\n    clock.startTime = start;\n    clock.stopTime = stop;\n    clock.currentTime = JulianDate.clone(start);\n    clock.clockRange = ClockRange.LOOP_STOP;\n    clock.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n    clock.multiplier = Math.round(\n      Math.min(\n        Math.max(JulianDate.secondsDifference(stop, start) / 60, 1),\n        3.15569e7\n      )\n    );\n  }\n  let changed = false;\n  if (dataSource._name !== name) {\n    dataSource._name = name;\n    changed = true;\n  }\n\n  if (dataSource._creator !== creator) {\n    dataSource._creator = creator;\n    changed = true;\n  }\n\n  if (metadataChanged(dataSource._metadata, metadata)) {\n    dataSource._metadata = metadata;\n    changed = true;\n  }\n\n  if (dataSource._version !== version) {\n    dataSource._version = version;\n    changed = true;\n  }\n\n  if (clock !== dataSource._clock) {\n    changed = true;\n    dataSource._clock = clock;\n  }\n\n  if (changed) {\n    dataSource._changed.raiseEvent(dataSource);\n  }\n\n  DataSource.setLoading(dataSource, false);\n  return dataSource;\n}\n\nfunction metadataChanged(old, current) {\n  if (!defined(old) && !defined(current)) {\n    return false;\n  } else if (defined(old) && defined(current)) {\n    if (\n      old.name !== current.name ||\n      old.dec !== current.desc ||\n      old.src !== current.src ||\n      old.author !== current.author ||\n      old.copyright !== current.copyright ||\n      old.link !== current.link ||\n      old.time !== current.time ||\n      old.bounds !== current.bounds\n    ) {\n      return true;\n    }\n    return false;\n  }\n  return true;\n}\n\nfunction load(dataSource, entityCollection, data, options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  let promise = data;\n  if (typeof data === \"string\" || data instanceof Resource) {\n    data = Resource.createIfNeeded(data);\n    promise = data.fetchBlob();\n\n    // Add resource credits to our list of credits to display\n    const resourceCredits = dataSource._resourceCredits;\n    const credits = data.credits;\n    if (defined(credits)) {\n      const length = credits.length;\n      for (let i = 0; i < length; i++) {\n        resourceCredits.push(credits[i]);\n      }\n    }\n  }\n\n  return Promise.resolve(promise)\n    .then(function (dataToLoad) {\n      if (dataToLoad instanceof Blob) {\n        return readBlobAsText(dataToLoad).then(function (text) {\n          // There's no official way to validate if a parse was successful.\n          // The following check detects the error on various browsers.\n          // IE raises an exception\n          let gpx;\n          let error;\n          try {\n            gpx = parser.parseFromString(text, \"application/xml\");\n          } catch (e) {\n            error = e.toString();\n          }\n\n          // The parse succeeds on Chrome and Firefox, but the error\n          // handling is different in each.\n          if (\n            defined(error) ||\n            gpx.body ||\n            gpx.documentElement.tagName === \"parsererror\"\n          ) {\n            // Firefox has error information as the firstChild nodeValue.\n            let msg = defined(error)\n              ? error\n              : gpx.documentElement.firstChild.nodeValue;\n\n            // Chrome has it in the body text.\n            if (!msg) {\n              msg = gpx.body.innerText;\n            }\n\n            // Return the error\n            throw new RuntimeError(msg);\n          }\n          return loadGpx(dataSource, gpx, options);\n        });\n      }\n      return loadGpx(dataSource, dataToLoad, options);\n    })\n    .catch(function (error) {\n      dataSource._error.raiseEvent(dataSource, error);\n      console.log(error);\n      return Promise.reject(error);\n    });\n}\n\n/**\n * A {@link DataSource} which processes the GPS Exchange Format (GPX).\n *\n * @alias GpxDataSource\n * @constructor\n *\n * @see {@link http://www.topografix.com/gpx.asp|Topografix GPX Standard}\n * @see {@link http://www.topografix.com/gpx/1/1/|Topografix GPX Documentation}\n *\n * @demo {@link http://sandcastle.cesium.com/index.html?src=GPX.html}\n *\n * @example\n * const viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.dataSources.add(Cesium.GpxDataSource.load('../../SampleData/track.gpx'));\n */\nfunction GpxDataSource() {\n  this._changed = new Event();\n  this._error = new Event();\n  this._loading = new Event();\n  this._clock = undefined;\n  this._entityCollection = new EntityCollection(this);\n  this._entityCluster = new EntityCluster();\n  this._name = undefined;\n  this._version = undefined;\n  this._creator = undefined;\n  this._metadata = undefined;\n  this._isLoading = false;\n  this._pinBuilder = new PinBuilder();\n}\n\n/**\n * Creates a Promise to a new instance loaded with the provided GPX data.\n *\n * @param {string|Document|Blob} data A url, parsed GPX document, or Blob containing binary GPX data.\n * @param {object} [options] An object with the following properties:\n * @param {boolean} [options.clampToGround] True if the symbols should be rendered at the same height as the terrain\n * @param {string} [options.waypointImage] Image to use for waypoint billboards.\n * @param {string} [options.trackImage] Image to use for track billboards.\n * @param {string} [options.trackColor] Color to use for track lines.\n * @param {string} [options.routeColor] Color to use for route lines.\n * @returns {Promise<GpxDataSource>} A promise that will resolve to a new GpxDataSource instance once the gpx is loaded.\n */\nGpxDataSource.load = function (data, options) {\n  return new GpxDataSource().load(data, options);\n};\n\nObject.defineProperties(GpxDataSource.prototype, {\n  /**\n   * Gets a human-readable name for this instance.\n   * This will be automatically be set to the GPX document name on load.\n   * @memberof GpxDataSource.prototype\n   * @type {string}\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n  /**\n   * Gets the version of the GPX Schema in use.\n   * @memberof GpxDataSource.prototype\n   * @type {string}\n   */\n  version: {\n    get: function () {\n      return this._version;\n    },\n  },\n  /**\n   * Gets the creator of the GPX document.\n   * @memberof GpxDataSource.prototype\n   * @type {string}\n   */\n  creator: {\n    get: function () {\n      return this._creator;\n    },\n  },\n  /**\n   * Gets an object containing metadata about the GPX file.\n   * @memberof GpxDataSource.prototype\n   * @type {object}\n   */\n  metadata: {\n    get: function () {\n      return this._metadata;\n    },\n  },\n  /**\n   * Gets the clock settings defined by the loaded GPX. This represents the total\n   * availability interval for all time-dynamic data. If the GPX does not contain\n   * time-dynamic data, this value is undefined.\n   * @memberof GpxDataSource.prototype\n   * @type {DataSourceClock}\n   */\n  clock: {\n    get: function () {\n      return this._clock;\n    },\n  },\n  /**\n   * Gets the collection of {@link Entity} instances.\n   * @memberof GpxDataSource.prototype\n   * @type {EntityCollection}\n   */\n  entities: {\n    get: function () {\n      return this._entityCollection;\n    },\n  },\n  /**\n   * Gets a value indicating if the data source is currently loading data.\n   * @memberof GpxDataSource.prototype\n   * @type {boolean}\n   */\n  isLoading: {\n    get: function () {\n      return this._isLoading;\n    },\n  },\n  /**\n   * Gets an event that will be raised when the underlying data changes.\n   * @memberof GpxDataSource.prototype\n   * @type {Event}\n   */\n  changedEvent: {\n    get: function () {\n      return this._changed;\n    },\n  },\n  /**\n   * Gets an event that will be raised if an error is encountered during processing.\n   * @memberof GpxDataSource.prototype\n   * @type {Event}\n   */\n  errorEvent: {\n    get: function () {\n      return this._error;\n    },\n  },\n  /**\n   * Gets an event that will be raised when the data source either starts or stops loading.\n   * @memberof GpxDataSource.prototype\n   * @type {Event}\n   */\n  loadingEvent: {\n    get: function () {\n      return this._loading;\n    },\n  },\n  /**\n   * Gets whether or not this data source should be displayed.\n   * @memberof GpxDataSource.prototype\n   * @type {boolean}\n   */\n  show: {\n    get: function () {\n      return this._entityCollection.show;\n    },\n    set: function (value) {\n      this._entityCollection.show = value;\n    },\n  },\n\n  /**\n   * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.\n   *\n   * @memberof GpxDataSource.prototype\n   * @type {EntityCluster}\n   */\n  clustering: {\n    get: function () {\n      return this._entityCluster;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value must be defined.\");\n      }\n      //>>includeEnd('debug');\n      this._entityCluster = value;\n    },\n  },\n});\n\n/**\n * Updates the data source to the provided time.  This function is optional and\n * is not required to be implemented.  It is provided for data sources which\n * retrieve data based on the current animation time or scene state.\n * If implemented, update will be called by {@link DataSourceDisplay} once a frame.\n *\n * @param {JulianDate} time The simulation time.\n * @returns {boolean} True if this data source is ready to be displayed at the provided time, false otherwise.\n */\nGpxDataSource.prototype.update = function (time) {\n  return true;\n};\n\n/**\n * Asynchronously loads the provided GPX data, replacing any existing data.\n *\n * @param {string|Document|Blob} data A url, parsed GPX document, or Blob containing binary GPX data or a parsed GPX document.\n * @param {object} [options] An object with the following properties:\n * @param {boolean} [options.clampToGround] True if the symbols should be rendered at the same height as the terrain\n * @param {string} [options.waypointImage] Image to use for waypoint billboards.\n * @param {string} [options.trackImage] Image to use for track billboards.\n * @param {string} [options.trackColor] Color to use for track lines.\n * @param {string} [options.routeColor] Color to use for route lines.\n * @returns {Promise<GpxDataSource>} A promise that will resolve to this instances once the GPX is loaded.\n */\nGpxDataSource.prototype.load = function (data, options) {\n  if (!defined(data)) {\n    throw new DeveloperError(\"data is required.\");\n  }\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  DataSource.setLoading(this, true);\n  const oldName = this._name;\n  const that = this;\n  return load(this, this._entityCollection, data, options)\n    .then(function () {\n      let clock;\n\n      const availability = that._entityCollection.computeAvailability();\n\n      let start = availability.start;\n      let stop = availability.stop;\n      const isMinStart = JulianDate.equals(start, Iso8601.MINIMUM_VALUE);\n      const isMaxStop = JulianDate.equals(stop, Iso8601.MAXIMUM_VALUE);\n      if (!isMinStart || !isMaxStop) {\n        let date;\n\n        // If start is min time just start at midnight this morning, local time\n        if (isMinStart) {\n          date = new Date();\n          date.setHours(0, 0, 0, 0);\n          start = JulianDate.fromDate(date);\n        }\n\n        // If stop is max value just stop at midnight tonight, local time\n        if (isMaxStop) {\n          date = new Date();\n          date.setHours(24, 0, 0, 0);\n          stop = JulianDate.fromDate(date);\n        }\n\n        clock = new DataSourceClock();\n        clock.startTime = start;\n        clock.stopTime = stop;\n        clock.currentTime = JulianDate.clone(start);\n        clock.clockRange = ClockRange.LOOP_STOP;\n        clock.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n        clock.multiplier = Math.round(\n          Math.min(\n            Math.max(JulianDate.secondsDifference(stop, start) / 60, 1),\n            3.15569e7\n          )\n        );\n      }\n\n      let changed = false;\n      if (clock !== that._clock) {\n        that._clock = clock;\n        changed = true;\n      }\n\n      if (oldName !== that._name) {\n        changed = true;\n      }\n\n      if (changed) {\n        that._changed.raiseEvent(that);\n      }\n\n      DataSource.setLoading(that, false);\n\n      return that;\n    })\n    .catch(function (error) {\n      DataSource.setLoading(that, false);\n      that._error.raiseEvent(that, error);\n      console.log(error);\n      return Promise.reject(error);\n    });\n};\n\nexport default GpxDataSource;\n", "/**\n * Representation of <Camera> from KML\n * @alias KmlCamera\n * @constructor\n *\n * @param {Cartesian3} position camera position\n * @param {HeadingPitchRoll} headingPitchRoll camera orientation\n */\nfunction KmlCamera(position, headingPitchRoll) {\n  this.position = position;\n  this.headingPitchRoll = headingPitchRoll;\n}\nexport default KmlCamera;\n", "import ArcType from \"../Core/ArcType.js\";\nimport AssociativeArray from \"../Core/AssociativeArray.js\";\nimport BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport ClockRange from \"../Core/ClockRange.js\";\nimport ClockStep from \"../Core/ClockStep.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defer from \"../Core/defer.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Event from \"../Core/Event.js\";\nimport getExtensionFromUri from \"../Core/getExtensionFromUri.js\";\nimport getFilenameFromUri from \"../Core/getFilenameFromUri.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport HeadingPitchRange from \"../Core/HeadingPitchRange.js\";\nimport HeadingPitchRoll from \"../Core/HeadingPitchRoll.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport objectToQuery from \"../Core/objectToQuery.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport PinBuilder from \"../Core/PinBuilder.js\";\nimport PolygonHierarchy from \"../Core/PolygonHierarchy.js\";\nimport queryToObject from \"../Core/queryToObject.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TimeInterval from \"../Core/TimeInterval.js\";\nimport TimeIntervalCollection from \"../Core/TimeIntervalCollection.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport HorizontalOrigin from \"../Scene/HorizontalOrigin.js\";\nimport LabelStyle from \"../Scene/LabelStyle.js\";\nimport SceneMode from \"../Scene/SceneMode.js\";\nimport Autolinker from \"autolinker\";\nimport Uri from \"urijs\";\nimport * as zip from \"@zip.js/zip.js/lib/zip-no-worker.js\";\nimport getElement from \"./getElement.js\";\nimport BillboardGraphics from \"./BillboardGraphics.js\";\nimport CompositePositionProperty from \"./CompositePositionProperty.js\";\nimport DataSource from \"./DataSource.js\";\nimport DataSourceClock from \"./DataSourceClock.js\";\nimport Entity from \"./Entity.js\";\nimport EntityCluster from \"./EntityCluster.js\";\nimport EntityCollection from \"./EntityCollection.js\";\nimport KmlCamera from \"./KmlCamera.js\";\nimport KmlLookAt from \"./KmlLookAt.js\";\nimport KmlTour from \"./KmlTour.js\";\nimport KmlTourFlyTo from \"./KmlTourFlyTo.js\";\nimport KmlTourWait from \"./KmlTourWait.js\";\nimport LabelGraphics from \"./LabelGraphics.js\";\nimport PathGraphics from \"./PathGraphics.js\";\nimport PolygonGraphics from \"./PolygonGraphics.js\";\nimport PolylineGraphics from \"./PolylineGraphics.js\";\nimport PositionPropertyArray from \"./PositionPropertyArray.js\";\nimport RectangleGraphics from \"./RectangleGraphics.js\";\nimport ReferenceProperty from \"./ReferenceProperty.js\";\nimport SampledPositionProperty from \"./SampledPositionProperty.js\";\nimport ScaledPositionProperty from \"./ScaledPositionProperty.js\";\nimport TimeIntervalCollectionProperty from \"./TimeIntervalCollectionProperty.js\";\nimport WallGraphics from \"./WallGraphics.js\";\n\n//This is by no means an exhaustive list of MIME types.\n//The purpose of this list is to be able to accurately identify content embedded\n//in KMZ files. Eventually, we can make this configurable by the end user so they can add\n//there own content types if they have KMZ files that require it.\nconst MimeTypes = {\n  avi: \"video/x-msvideo\",\n  bmp: \"image/bmp\",\n  bz2: \"application/x-bzip2\",\n  chm: \"application/vnd.ms-htmlhelp\",\n  css: \"text/css\",\n  csv: \"text/csv\",\n  doc: \"application/msword\",\n  dvi: \"application/x-dvi\",\n  eps: \"application/postscript\",\n  flv: \"video/x-flv\",\n  gif: \"image/gif\",\n  gz: \"application/x-gzip\",\n  htm: \"text/html\",\n  html: \"text/html\",\n  ico: \"image/vnd.microsoft.icon\",\n  jnlp: \"application/x-java-jnlp-file\",\n  jpeg: \"image/jpeg\",\n  jpg: \"image/jpeg\",\n  m3u: \"audio/x-mpegurl\",\n  m4v: \"video/mp4\",\n  mathml: \"application/mathml+xml\",\n  mid: \"audio/midi\",\n  midi: \"audio/midi\",\n  mov: \"video/quicktime\",\n  mp3: \"audio/mpeg\",\n  mp4: \"video/mp4\",\n  mp4v: \"video/mp4\",\n  mpeg: \"video/mpeg\",\n  mpg: \"video/mpeg\",\n  odp: \"application/vnd.oasis.opendocument.presentation\",\n  ods: \"application/vnd.oasis.opendocument.spreadsheet\",\n  odt: \"application/vnd.oasis.opendocument.text\",\n  ogg: \"application/ogg\",\n  pdf: \"application/pdf\",\n  png: \"image/png\",\n  pps: \"application/vnd.ms-powerpoint\",\n  ppt: \"application/vnd.ms-powerpoint\",\n  ps: \"application/postscript\",\n  qt: \"video/quicktime\",\n  rdf: \"application/rdf+xml\",\n  rss: \"application/rss+xml\",\n  rtf: \"application/rtf\",\n  svg: \"image/svg+xml\",\n  swf: \"application/x-shockwave-flash\",\n  text: \"text/plain\",\n  tif: \"image/tiff\",\n  tiff: \"image/tiff\",\n  txt: \"text/plain\",\n  wav: \"audio/x-wav\",\n  wma: \"audio/x-ms-wma\",\n  wmv: \"video/x-ms-wmv\",\n  xml: \"application/xml\",\n  zip: \"application/zip\",\n\n  detectFromFilename: function (filename) {\n    let ext = filename.toLowerCase();\n    ext = getExtensionFromUri(ext);\n    return MimeTypes[ext];\n  },\n};\n\nlet parser;\nif (typeof DOMParser !== \"undefined\") {\n  parser = new DOMParser();\n}\n\nconst autolinker = new Autolinker({\n  stripPrefix: false,\n  email: false,\n  replaceFn: function (match) {\n    //Prevent matching of non-explicit urls.\n    //i.e. foo.id won't match but http://foo.id will\n    return match.urlMatchType === \"scheme\" || match.urlMatchType === \"www\";\n  },\n});\n\nconst BILLBOARD_SIZE = 32;\n\nconst BILLBOARD_NEAR_DISTANCE = 2414016;\nconst BILLBOARD_NEAR_RATIO = 1.0;\nconst BILLBOARD_FAR_DISTANCE = 1.6093e7;\nconst BILLBOARD_FAR_RATIO = 0.1;\n\nconst kmlNamespaces = [\n  null,\n  undefined,\n  \"http://www.opengis.net/kml/2.2\",\n  \"http://earth.google.com/kml/2.2\",\n  \"http://earth.google.com/kml/2.1\",\n  \"http://earth.google.com/kml/2.0\",\n];\nconst gxNamespaces = [\"http://www.google.com/kml/ext/2.2\"];\nconst atomNamespaces = [\"http://www.w3.org/2005/Atom\"];\nconst namespaces = {\n  kml: kmlNamespaces,\n  gx: gxNamespaces,\n  atom: atomNamespaces,\n  kmlgx: kmlNamespaces.concat(gxNamespaces),\n};\n\n// Ensure Specs/Data/KML/unsupported.kml is kept up to date with these supported types\nconst featureTypes = {\n  Document: processDocument,\n  Folder: processFolder,\n  Placemark: processPlacemark,\n  NetworkLink: processNetworkLink,\n  GroundOverlay: processGroundOverlay,\n  PhotoOverlay: processUnsupportedFeature,\n  ScreenOverlay: processScreenOverlay,\n  Tour: processTour,\n};\n\nfunction DeferredLoading(dataSource) {\n  this._dataSource = dataSource;\n  this._deferred = defer();\n  this._stack = [];\n  this._promises = [];\n  this._timeoutSet = false;\n  this._used = false;\n\n  this._started = 0;\n  this._timeThreshold = 1000; // Initial load is 1 second\n}\n\nObject.defineProperties(DeferredLoading.prototype, {\n  dataSource: {\n    get: function () {\n      return this._dataSource;\n    },\n  },\n});\n\nDeferredLoading.prototype.addNodes = function (nodes, processingData) {\n  this._stack.push({\n    nodes: nodes,\n    index: 0,\n    processingData: processingData,\n  });\n  this._used = true;\n};\n\nDeferredLoading.prototype.addPromise = function (promise) {\n  this._promises.push(promise);\n};\n\nDeferredLoading.prototype.wait = function () {\n  // Case where we had a non-document/folder as the root\n  const deferred = this._deferred;\n  if (!this._used) {\n    deferred.resolve();\n  }\n\n  return Promise.all([deferred.promise, Promise.all(this._promises)]);\n};\n\nDeferredLoading.prototype.process = function () {\n  const isFirstCall = this._stack.length === 1;\n  if (isFirstCall) {\n    this._started = KmlDataSource._getTimestamp();\n  }\n\n  return this._process(isFirstCall);\n};\n\nDeferredLoading.prototype._giveUpTime = function () {\n  if (this._timeoutSet) {\n    // Timeout was already set so just return\n    return;\n  }\n\n  this._timeoutSet = true;\n  this._timeThreshold = 50; // After the first load lower threshold to 0.5 seconds\n  const that = this;\n  setTimeout(function () {\n    that._timeoutSet = false;\n    that._started = KmlDataSource._getTimestamp();\n    that._process(true);\n  }, 0);\n};\n\nDeferredLoading.prototype._nextNode = function () {\n  const stack = this._stack;\n  const top = stack[stack.length - 1];\n  const index = top.index;\n  const nodes = top.nodes;\n  if (index === nodes.length) {\n    return;\n  }\n  ++top.index;\n\n  return nodes[index];\n};\n\nDeferredLoading.prototype._pop = function () {\n  const stack = this._stack;\n  stack.pop();\n\n  // Return false if we are done\n  if (stack.length === 0) {\n    this._deferred.resolve();\n    return false;\n  }\n\n  return true;\n};\n\nDeferredLoading.prototype._process = function (isFirstCall) {\n  const dataSource = this.dataSource;\n  const processingData = this._stack[this._stack.length - 1].processingData;\n\n  let child = this._nextNode();\n  while (defined(child)) {\n    const featureProcessor = featureTypes[child.localName];\n    if (\n      defined(featureProcessor) &&\n      (namespaces.kml.indexOf(child.namespaceURI) !== -1 ||\n        namespaces.gx.indexOf(child.namespaceURI) !== -1)\n    ) {\n      featureProcessor(dataSource, child, processingData, this);\n\n      // Give up time and continue loading later\n      if (\n        this._timeoutSet ||\n        KmlDataSource._getTimestamp() > this._started + this._timeThreshold\n      ) {\n        this._giveUpTime();\n        return;\n      }\n    }\n\n    child = this._nextNode();\n  }\n\n  // If we are a recursive call from a subfolder, just return so the parent folder can continue processing\n  // If we aren't then make another call to processNodes because there is stuff still left in the queue\n  if (this._pop() && isFirstCall) {\n    this._process(true);\n  }\n};\n\nfunction isZipFile(blob) {\n  const magicBlob = blob.slice(0, Math.min(4, blob.size));\n  const deferred = defer();\n  const reader = new FileReader();\n  reader.addEventListener(\"load\", function () {\n    deferred.resolve(\n      new DataView(reader.result).getUint32(0, false) === 0x504b0304\n    );\n  });\n  reader.addEventListener(\"error\", function () {\n    deferred.reject(reader.error);\n  });\n  reader.readAsArrayBuffer(magicBlob);\n  return deferred.promise;\n}\n\nfunction readBlobAsText(blob) {\n  const deferred = defer();\n  const reader = new FileReader();\n  reader.addEventListener(\"load\", function () {\n    deferred.resolve(reader.result);\n  });\n  reader.addEventListener(\"error\", function () {\n    deferred.reject(reader.error);\n  });\n  reader.readAsText(blob);\n  return deferred.promise;\n}\n\nfunction insertNamespaces(text) {\n  const namespaceMap = {\n    xsi: \"http://www.w3.org/2001/XMLSchema-instance\",\n  };\n  let firstPart, lastPart, reg, declaration;\n\n  for (const key in namespaceMap) {\n    if (namespaceMap.hasOwnProperty(key)) {\n      reg = RegExp(`[< ]${key}:`);\n      declaration = `xmlns:${key}=`;\n      if (reg.test(text) && text.indexOf(declaration) === -1) {\n        if (!defined(firstPart)) {\n          firstPart = text.substr(0, text.indexOf(\"<kml\") + 4);\n          lastPart = text.substr(firstPart.length);\n        }\n        firstPart += ` ${declaration}\"${namespaceMap[key]}\"`;\n      }\n    }\n  }\n\n  if (defined(firstPart)) {\n    text = firstPart + lastPart;\n  }\n\n  return text;\n}\n\nfunction removeDuplicateNamespaces(text) {\n  let index = text.indexOf(\"xmlns:\");\n  const endDeclaration = text.indexOf(\">\", index);\n  let namespace, startIndex, endIndex;\n\n  while (index !== -1 && index < endDeclaration) {\n    namespace = text.slice(index, text.indexOf('\"', index));\n    startIndex = index;\n    index = text.indexOf(namespace, index + 1);\n    if (index !== -1) {\n      endIndex = text.indexOf('\"', text.indexOf('\"', index) + 1);\n      text = text.slice(0, index - 1) + text.slice(endIndex + 1, text.length);\n      index = text.indexOf(\"xmlns:\", startIndex - 1);\n    } else {\n      index = text.indexOf(\"xmlns:\", startIndex + 1);\n    }\n  }\n\n  return text;\n}\n\nfunction loadXmlFromZip(entry, uriResolver) {\n  return Promise.resolve(entry.getData(new zip.TextWriter())).then(function (\n    text\n  ) {\n    text = insertNamespaces(text);\n    text = removeDuplicateNamespaces(text);\n    uriResolver.kml = parser.parseFromString(text, \"application/xml\");\n  });\n}\n\nfunction loadDataUriFromZip(entry, uriResolver) {\n  const mimeType = defaultValue(\n    MimeTypes.detectFromFilename(entry.filename),\n    \"application/octet-stream\"\n  );\n  return Promise.resolve(entry.getData(new zip.Data64URIWriter(mimeType))).then(\n    function (dataUri) {\n      uriResolver[entry.filename] = dataUri;\n    }\n  );\n}\n\nfunction embedDataUris(div, elementType, attributeName, uriResolver) {\n  const keys = uriResolver.keys;\n  const baseUri = new Uri(\".\");\n  const elements = div.querySelectorAll(elementType);\n  for (let i = 0; i < elements.length; i++) {\n    const element = elements[i];\n    const value = element.getAttribute(attributeName);\n    if (defined(value)) {\n      const relativeUri = new Uri(value);\n      const uri = relativeUri.absoluteTo(baseUri).toString();\n      const index = keys.indexOf(uri);\n      if (index !== -1) {\n        const key = keys[index];\n        element.setAttribute(attributeName, uriResolver[key]);\n        if (elementType === \"a\" && element.getAttribute(\"download\") === null) {\n          element.setAttribute(\"download\", key);\n        }\n      }\n    }\n  }\n}\n\nfunction applyBasePath(div, elementType, attributeName, sourceResource) {\n  const elements = div.querySelectorAll(elementType);\n  for (let i = 0; i < elements.length; i++) {\n    const element = elements[i];\n    const value = element.getAttribute(attributeName);\n    const resource = resolveHref(value, sourceResource);\n    if (defined(resource)) {\n      element.setAttribute(attributeName, resource.url);\n    }\n  }\n}\n\n// an optional context is passed to allow for some malformed kmls (those with multiple geometries with same ids) to still parse\n// correctly, as they do in Google Earth.\nfunction createEntity(node, entityCollection, context) {\n  let id = queryStringAttribute(node, \"id\");\n  id = defined(id) && id.length !== 0 ? id : createGuid();\n  if (defined(context)) {\n    id = context + id;\n  }\n\n  // If we have a duplicate ID just generate one.\n  // This isn't valid KML but Google Earth handles this case.\n  let entity = entityCollection.getById(id);\n  if (defined(entity)) {\n    id = createGuid();\n    if (defined(context)) {\n      id = context + id;\n    }\n  }\n\n  entity = entityCollection.add(new Entity({ id: id }));\n  if (!defined(entity.kml)) {\n    entity.addProperty(\"kml\");\n    entity.kml = new KmlFeatureData();\n  }\n  return entity;\n}\n\nfunction isExtrudable(altitudeMode, gxAltitudeMode) {\n  return (\n    altitudeMode === \"absolute\" ||\n    altitudeMode === \"relativeToGround\" ||\n    gxAltitudeMode === \"relativeToSeaFloor\"\n  );\n}\n\nfunction readCoordinate(value, ellipsoid) {\n  //Google Earth treats empty or missing coordinates as 0.\n  if (!defined(value)) {\n    return Cartesian3.fromDegrees(0, 0, 0, ellipsoid);\n  }\n\n  const digits = value.match(/[^\\s,\\n]+/g);\n  if (!defined(digits)) {\n    return Cartesian3.fromDegrees(0, 0, 0, ellipsoid);\n  }\n\n  let longitude = parseFloat(digits[0]);\n  let latitude = parseFloat(digits[1]);\n  let height = parseFloat(digits[2]);\n\n  longitude = isNaN(longitude) ? 0.0 : longitude;\n  latitude = isNaN(latitude) ? 0.0 : latitude;\n  height = isNaN(height) ? 0.0 : height;\n\n  return Cartesian3.fromDegrees(longitude, latitude, height, ellipsoid);\n}\n\nfunction readCoordinates(element, ellipsoid) {\n  if (!defined(element)) {\n    return undefined;\n  }\n\n  const tuples = element.textContent.match(/[^\\s\\n]+/g);\n  if (!defined(tuples)) {\n    return undefined;\n  }\n\n  const length = tuples.length;\n  const result = new Array(length);\n  let resultIndex = 0;\n  for (let i = 0; i < length; i++) {\n    result[resultIndex++] = readCoordinate(tuples[i], ellipsoid);\n  }\n  return result;\n}\n\nfunction queryNumericAttribute(node, attributeName) {\n  if (!defined(node)) {\n    return undefined;\n  }\n\n  const value = node.getAttribute(attributeName);\n  if (value !== null) {\n    const result = parseFloat(value);\n    return !isNaN(result) ? result : undefined;\n  }\n  return undefined;\n}\n\nfunction queryStringAttribute(node, attributeName) {\n  if (!defined(node)) {\n    return undefined;\n  }\n  const value = node.getAttribute(attributeName);\n  return value !== null ? value : undefined;\n}\n\nfunction queryFirstNode(node, tagName, namespace) {\n  if (!defined(node)) {\n    return undefined;\n  }\n  const childNodes = node.childNodes;\n  const length = childNodes.length;\n  for (let q = 0; q < length; q++) {\n    const child = childNodes[q];\n    if (\n      child.localName === tagName &&\n      namespace.indexOf(child.namespaceURI) !== -1\n    ) {\n      return child;\n    }\n  }\n  return undefined;\n}\n\nfunction queryNodes(node, tagName, namespace) {\n  if (!defined(node)) {\n    return undefined;\n  }\n  const result = [];\n  const childNodes = node.getElementsByTagNameNS(\"*\", tagName);\n  const length = childNodes.length;\n  for (let q = 0; q < length; q++) {\n    const child = childNodes[q];\n    if (\n      child.localName === tagName &&\n      namespace.indexOf(child.namespaceURI) !== -1\n    ) {\n      result.push(child);\n    }\n  }\n  return result;\n}\n\nfunction queryChildNodes(node, tagName, namespace) {\n  if (!defined(node)) {\n    return [];\n  }\n  const result = [];\n  const childNodes = node.childNodes;\n  const length = childNodes.length;\n  for (let q = 0; q < length; q++) {\n    const child = childNodes[q];\n    if (\n      child.localName === tagName &&\n      namespace.indexOf(child.namespaceURI) !== -1\n    ) {\n      result.push(child);\n    }\n  }\n  return result;\n}\n\nfunction queryNumericValue(node, tagName, namespace) {\n  const resultNode = queryFirstNode(node, tagName, namespace);\n  if (defined(resultNode)) {\n    const result = parseFloat(resultNode.textContent);\n    return !isNaN(result) ? result : undefined;\n  }\n  return undefined;\n}\n\nfunction queryStringValue(node, tagName, namespace) {\n  const result = queryFirstNode(node, tagName, namespace);\n  if (defined(result)) {\n    return result.textContent.trim();\n  }\n  return undefined;\n}\n\nfunction queryBooleanValue(node, tagName, namespace) {\n  const result = queryFirstNode(node, tagName, namespace);\n  if (defined(result)) {\n    const value = result.textContent.trim();\n    return value === \"1\" || /^true$/i.test(value);\n  }\n  return undefined;\n}\n\nfunction resolveHref(href, sourceResource, uriResolver) {\n  if (!defined(href)) {\n    return undefined;\n  }\n\n  let resource;\n  if (defined(uriResolver)) {\n    // To resolve issues with KML sources defined in Windows style paths.\n    href = href.replace(/\\\\/g, \"/\");\n    let blob = uriResolver[href];\n    if (defined(blob)) {\n      resource = new Resource({\n        url: blob,\n      });\n    } else {\n      // Needed for multiple levels of KML files in a KMZ\n      const baseUri = new Uri(sourceResource.getUrlComponent());\n      const uri = new Uri(href);\n      blob = uriResolver[uri.absoluteTo(baseUri)];\n      if (defined(blob)) {\n        resource = new Resource({\n          url: blob,\n        });\n      }\n    }\n  }\n\n  if (!defined(resource)) {\n    resource = sourceResource.getDerivedResource({\n      url: href,\n    });\n  }\n\n  return resource;\n}\n\nconst colorOptions = {\n  maximumRed: undefined,\n  red: undefined,\n  maximumGreen: undefined,\n  green: undefined,\n  maximumBlue: undefined,\n  blue: undefined,\n};\n\nfunction parseColorString(value, isRandom) {\n  if (!defined(value) || /^\\s*$/gm.test(value)) {\n    return undefined;\n  }\n\n  if (value[0] === \"#\") {\n    value = value.substring(1);\n  }\n\n  const alpha = parseInt(value.substring(0, 2), 16) / 255.0;\n  const blue = parseInt(value.substring(2, 4), 16) / 255.0;\n  const green = parseInt(value.substring(4, 6), 16) / 255.0;\n  const red = parseInt(value.substring(6, 8), 16) / 255.0;\n\n  if (!isRandom) {\n    return new Color(red, green, blue, alpha);\n  }\n\n  if (red > 0) {\n    colorOptions.maximumRed = red;\n    colorOptions.red = undefined;\n  } else {\n    colorOptions.maximumRed = undefined;\n    colorOptions.red = 0;\n  }\n  if (green > 0) {\n    colorOptions.maximumGreen = green;\n    colorOptions.green = undefined;\n  } else {\n    colorOptions.maximumGreen = undefined;\n    colorOptions.green = 0;\n  }\n  if (blue > 0) {\n    colorOptions.maximumBlue = blue;\n    colorOptions.blue = undefined;\n  } else {\n    colorOptions.maximumBlue = undefined;\n    colorOptions.blue = 0;\n  }\n  colorOptions.alpha = alpha;\n  return Color.fromRandom(colorOptions);\n}\n\nfunction queryColorValue(node, tagName, namespace) {\n  const value = queryStringValue(node, tagName, namespace);\n  if (!defined(value)) {\n    return undefined;\n  }\n  return parseColorString(\n    value,\n    queryStringValue(node, \"colorMode\", namespace) === \"random\"\n  );\n}\n\nfunction processTimeStamp(featureNode) {\n  const node = queryFirstNode(featureNode, \"TimeStamp\", namespaces.kmlgx);\n  const whenString = queryStringValue(node, \"when\", namespaces.kmlgx);\n\n  if (!defined(node) || !defined(whenString) || whenString.length === 0) {\n    return undefined;\n  }\n\n  //According to the KML spec, a TimeStamp represents a \"single moment in time\"\n  //However, since Cesium animates much differently than Google Earth, that doesn't\n  //Make much sense here.  Instead, we use the TimeStamp as the moment the feature\n  //comes into existence.  This works much better and gives a similar feel to\n  //GE's experience.\n  const when = JulianDate.fromIso8601(whenString);\n  const result = new TimeIntervalCollection();\n  result.addInterval(\n    new TimeInterval({\n      start: when,\n      stop: Iso8601.MAXIMUM_VALUE,\n    })\n  );\n  return result;\n}\n\nfunction processTimeSpan(featureNode) {\n  const node = queryFirstNode(featureNode, \"TimeSpan\", namespaces.kmlgx);\n  if (!defined(node)) {\n    return undefined;\n  }\n  let result;\n\n  const beginNode = queryFirstNode(node, \"begin\", namespaces.kmlgx);\n  let beginDate = defined(beginNode)\n    ? JulianDate.fromIso8601(beginNode.textContent)\n    : undefined;\n\n  const endNode = queryFirstNode(node, \"end\", namespaces.kmlgx);\n  let endDate = defined(endNode)\n    ? JulianDate.fromIso8601(endNode.textContent)\n    : undefined;\n\n  if (defined(beginDate) && defined(endDate)) {\n    if (JulianDate.lessThan(endDate, beginDate)) {\n      const tmp = beginDate;\n      beginDate = endDate;\n      endDate = tmp;\n    }\n    result = new TimeIntervalCollection();\n    result.addInterval(\n      new TimeInterval({\n        start: beginDate,\n        stop: endDate,\n      })\n    );\n  } else if (defined(beginDate)) {\n    result = new TimeIntervalCollection();\n    result.addInterval(\n      new TimeInterval({\n        start: beginDate,\n        stop: Iso8601.MAXIMUM_VALUE,\n      })\n    );\n  } else if (defined(endDate)) {\n    result = new TimeIntervalCollection();\n    result.addInterval(\n      new TimeInterval({\n        start: Iso8601.MINIMUM_VALUE,\n        stop: endDate,\n      })\n    );\n  }\n\n  return result;\n}\n\nfunction createDefaultBillboard() {\n  const billboard = new BillboardGraphics();\n  billboard.width = BILLBOARD_SIZE;\n  billboard.height = BILLBOARD_SIZE;\n  billboard.scaleByDistance = new NearFarScalar(\n    BILLBOARD_NEAR_DISTANCE,\n    BILLBOARD_NEAR_RATIO,\n    BILLBOARD_FAR_DISTANCE,\n    BILLBOARD_FAR_RATIO\n  );\n  billboard.pixelOffsetScaleByDistance = new NearFarScalar(\n    BILLBOARD_NEAR_DISTANCE,\n    BILLBOARD_NEAR_RATIO,\n    BILLBOARD_FAR_DISTANCE,\n    BILLBOARD_FAR_RATIO\n  );\n  return billboard;\n}\n\nfunction createDefaultPolygon() {\n  const polygon = new PolygonGraphics();\n  polygon.outline = true;\n  polygon.outlineColor = Color.WHITE;\n  return polygon;\n}\n\nfunction createDefaultLabel() {\n  const label = new LabelGraphics();\n  label.translucencyByDistance = new NearFarScalar(3000000, 1.0, 5000000, 0.0);\n  label.pixelOffset = new Cartesian2(17, 0);\n  label.horizontalOrigin = HorizontalOrigin.LEFT;\n  label.font = \"16px sans-serif\";\n  label.style = LabelStyle.FILL_AND_OUTLINE;\n  return label;\n}\n\nfunction getIconHref(\n  iconNode,\n  dataSource,\n  sourceResource,\n  uriResolver,\n  canRefresh\n) {\n  let href = queryStringValue(iconNode, \"href\", namespaces.kml);\n  if (!defined(href) || href.length === 0) {\n    return undefined;\n  }\n\n  if (href.indexOf(\"root://icons/palette-\") === 0) {\n    const palette = href.charAt(21);\n\n    // Get the icon number\n    let x = defaultValue(queryNumericValue(iconNode, \"x\", namespaces.gx), 0);\n    let y = defaultValue(queryNumericValue(iconNode, \"y\", namespaces.gx), 0);\n    x = Math.min(x / 32, 7);\n    y = 7 - Math.min(y / 32, 7);\n    const iconNum = 8 * y + x;\n\n    href = `https://maps.google.com/mapfiles/kml/pal${palette}/icon${iconNum}.png`;\n  }\n\n  const hrefResource = resolveHref(href, sourceResource, uriResolver);\n\n  if (canRefresh) {\n    const refreshMode = queryStringValue(\n      iconNode,\n      \"refreshMode\",\n      namespaces.kml\n    );\n    const viewRefreshMode = queryStringValue(\n      iconNode,\n      \"viewRefreshMode\",\n      namespaces.kml\n    );\n    if (refreshMode === \"onInterval\" || refreshMode === \"onExpire\") {\n      oneTimeWarning(\n        `kml-refreshMode-${refreshMode}`,\n        `KML - Unsupported Icon refreshMode: ${refreshMode}`\n      );\n    } else if (viewRefreshMode === \"onStop\" || viewRefreshMode === \"onRegion\") {\n      oneTimeWarning(\n        `kml-refreshMode-${viewRefreshMode}`,\n        `KML - Unsupported Icon viewRefreshMode: ${viewRefreshMode}`\n      );\n    }\n\n    const viewBoundScale = defaultValue(\n      queryStringValue(iconNode, \"viewBoundScale\", namespaces.kml),\n      1.0\n    );\n    const defaultViewFormat =\n      viewRefreshMode === \"onStop\"\n        ? \"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]\"\n        : \"\";\n    const viewFormat = defaultValue(\n      queryStringValue(iconNode, \"viewFormat\", namespaces.kml),\n      defaultViewFormat\n    );\n    const httpQuery = queryStringValue(iconNode, \"httpQuery\", namespaces.kml);\n    if (defined(viewFormat)) {\n      hrefResource.setQueryParameters(queryToObject(cleanupString(viewFormat)));\n    }\n    if (defined(httpQuery)) {\n      hrefResource.setQueryParameters(queryToObject(cleanupString(httpQuery)));\n    }\n\n    const ellipsoid = dataSource._ellipsoid;\n    processNetworkLinkQueryString(\n      hrefResource,\n      dataSource.camera,\n      dataSource.canvas,\n      viewBoundScale,\n      dataSource._lastCameraView.bbox,\n      ellipsoid\n    );\n\n    return hrefResource;\n  }\n\n  return hrefResource;\n}\n\nfunction processBillboardIcon(\n  dataSource,\n  node,\n  targetEntity,\n  sourceResource,\n  uriResolver\n) {\n  let scale = queryNumericValue(node, \"scale\", namespaces.kml);\n  const heading = queryNumericValue(node, \"heading\", namespaces.kml);\n  const color = queryColorValue(node, \"color\", namespaces.kml);\n\n  const iconNode = queryFirstNode(node, \"Icon\", namespaces.kml);\n  let icon = getIconHref(\n    iconNode,\n    dataSource,\n    sourceResource,\n    uriResolver,\n    false\n  );\n\n  // If icon tags are present but blank, we do not want to show an icon\n  if (defined(iconNode) && !defined(icon)) {\n    icon = false;\n  }\n\n  const x = queryNumericValue(iconNode, \"x\", namespaces.gx);\n  const y = queryNumericValue(iconNode, \"y\", namespaces.gx);\n  const w = queryNumericValue(iconNode, \"w\", namespaces.gx);\n  const h = queryNumericValue(iconNode, \"h\", namespaces.gx);\n\n  const hotSpotNode = queryFirstNode(node, \"hotSpot\", namespaces.kml);\n  const hotSpotX = queryNumericAttribute(hotSpotNode, \"x\");\n  const hotSpotY = queryNumericAttribute(hotSpotNode, \"y\");\n  const hotSpotXUnit = queryStringAttribute(hotSpotNode, \"xunits\");\n  const hotSpotYUnit = queryStringAttribute(hotSpotNode, \"yunits\");\n\n  let billboard = targetEntity.billboard;\n  if (!defined(billboard)) {\n    billboard = createDefaultBillboard();\n    targetEntity.billboard = billboard;\n  }\n\n  billboard.image = icon;\n  billboard.scale = scale;\n  billboard.color = color;\n\n  if (defined(x) || defined(y) || defined(w) || defined(h)) {\n    billboard.imageSubRegion = new BoundingRectangle(x, y, w, h);\n  }\n\n  //GE treats a heading of zero as no heading\n  //You can still point north using a 360 degree angle (or any multiple of 360)\n  if (defined(heading) && heading !== 0) {\n    billboard.rotation = CesiumMath.toRadians(-heading);\n    billboard.alignedAxis = Cartesian3.UNIT_Z;\n  }\n\n  //Hotpot is the KML equivalent of pixel offset\n  //The hotspot origin is the lower left, but we leave\n  //our billboard origin at the center and simply\n  //modify the pixel offset to take this into account\n  scale = defaultValue(scale, 1.0);\n\n  let xOffset;\n  let yOffset;\n  if (defined(hotSpotX)) {\n    if (hotSpotXUnit === \"pixels\") {\n      xOffset = -hotSpotX * scale;\n    } else if (hotSpotXUnit === \"insetPixels\") {\n      xOffset = (hotSpotX - BILLBOARD_SIZE) * scale;\n    } else if (hotSpotXUnit === \"fraction\") {\n      xOffset = -hotSpotX * BILLBOARD_SIZE * scale;\n    }\n    xOffset += BILLBOARD_SIZE * 0.5 * scale;\n  }\n\n  if (defined(hotSpotY)) {\n    if (hotSpotYUnit === \"pixels\") {\n      yOffset = hotSpotY * scale;\n    } else if (hotSpotYUnit === \"insetPixels\") {\n      yOffset = (-hotSpotY + BILLBOARD_SIZE) * scale;\n    } else if (hotSpotYUnit === \"fraction\") {\n      yOffset = hotSpotY * BILLBOARD_SIZE * scale;\n    }\n\n    yOffset -= BILLBOARD_SIZE * 0.5 * scale;\n  }\n\n  if (defined(xOffset) || defined(yOffset)) {\n    billboard.pixelOffset = new Cartesian2(xOffset, yOffset);\n  }\n}\n\nfunction applyStyle(\n  dataSource,\n  styleNode,\n  targetEntity,\n  sourceResource,\n  uriResolver\n) {\n  for (let i = 0, len = styleNode.childNodes.length; i < len; i++) {\n    const node = styleNode.childNodes.item(i);\n    if (node.localName === \"IconStyle\") {\n      processBillboardIcon(\n        dataSource,\n        node,\n        targetEntity,\n        sourceResource,\n        uriResolver\n      );\n    } else if (node.localName === \"LabelStyle\") {\n      let label = targetEntity.label;\n      if (!defined(label)) {\n        label = createDefaultLabel();\n        targetEntity.label = label;\n      }\n      label.scale = defaultValue(\n        queryNumericValue(node, \"scale\", namespaces.kml),\n        label.scale\n      );\n      label.fillColor = defaultValue(\n        queryColorValue(node, \"color\", namespaces.kml),\n        label.fillColor\n      );\n      label.text = targetEntity.name;\n    } else if (node.localName === \"LineStyle\") {\n      let polyline = targetEntity.polyline;\n      if (!defined(polyline)) {\n        polyline = new PolylineGraphics();\n        targetEntity.polyline = polyline;\n      }\n      polyline.width = queryNumericValue(node, \"width\", namespaces.kml);\n      polyline.material = queryColorValue(node, \"color\", namespaces.kml);\n      if (defined(queryColorValue(node, \"outerColor\", namespaces.gx))) {\n        oneTimeWarning(\n          \"kml-gx:outerColor\",\n          \"KML - gx:outerColor is not supported in a LineStyle\"\n        );\n      }\n      if (defined(queryNumericValue(node, \"outerWidth\", namespaces.gx))) {\n        oneTimeWarning(\n          \"kml-gx:outerWidth\",\n          \"KML - gx:outerWidth is not supported in a LineStyle\"\n        );\n      }\n      if (defined(queryNumericValue(node, \"physicalWidth\", namespaces.gx))) {\n        oneTimeWarning(\n          \"kml-gx:physicalWidth\",\n          \"KML - gx:physicalWidth is not supported in a LineStyle\"\n        );\n      }\n      if (defined(queryBooleanValue(node, \"labelVisibility\", namespaces.gx))) {\n        oneTimeWarning(\n          \"kml-gx:labelVisibility\",\n          \"KML - gx:labelVisibility is not supported in a LineStyle\"\n        );\n      }\n    } else if (node.localName === \"PolyStyle\") {\n      let polygon = targetEntity.polygon;\n      if (!defined(polygon)) {\n        polygon = createDefaultPolygon();\n        targetEntity.polygon = polygon;\n      }\n      polygon.material = defaultValue(\n        queryColorValue(node, \"color\", namespaces.kml),\n        polygon.material\n      );\n      polygon.fill = defaultValue(\n        queryBooleanValue(node, \"fill\", namespaces.kml),\n        polygon.fill\n      );\n      polygon.outline = defaultValue(\n        queryBooleanValue(node, \"outline\", namespaces.kml),\n        polygon.outline\n      );\n    } else if (node.localName === \"BalloonStyle\") {\n      const bgColor = defaultValue(\n        parseColorString(queryStringValue(node, \"bgColor\", namespaces.kml)),\n        Color.WHITE\n      );\n      const textColor = defaultValue(\n        parseColorString(queryStringValue(node, \"textColor\", namespaces.kml)),\n        Color.BLACK\n      );\n      const text = queryStringValue(node, \"text\", namespaces.kml);\n\n      //This is purely an internal property used in style processing,\n      //it never ends up on the final entity.\n      targetEntity.addProperty(\"balloonStyle\");\n      targetEntity.balloonStyle = {\n        bgColor: bgColor,\n        textColor: textColor,\n        text: text,\n      };\n    } else if (node.localName === \"ListStyle\") {\n      const listItemType = queryStringValue(\n        node,\n        \"listItemType\",\n        namespaces.kml\n      );\n      if (listItemType === \"radioFolder\" || listItemType === \"checkOffOnly\") {\n        oneTimeWarning(\n          `kml-listStyle-${listItemType}`,\n          `KML - Unsupported ListStyle with listItemType: ${listItemType}`\n        );\n      }\n    }\n  }\n}\n\n//Processes and merges any inline styles for the provided node into the provided entity.\nfunction computeFinalStyle(\n  dataSource,\n  placeMark,\n  styleCollection,\n  sourceResource,\n  uriResolver\n) {\n  const result = new Entity();\n  let styleEntity;\n\n  //Google earth seems to always use the last inline Style/StyleMap only\n  let styleIndex = -1;\n  const childNodes = placeMark.childNodes;\n  const length = childNodes.length;\n  for (let q = 0; q < length; q++) {\n    const child = childNodes[q];\n    if (child.localName === \"Style\" || child.localName === \"StyleMap\") {\n      styleIndex = q;\n    }\n  }\n\n  if (styleIndex !== -1) {\n    const inlineStyleNode = childNodes[styleIndex];\n    if (inlineStyleNode.localName === \"Style\") {\n      applyStyle(\n        dataSource,\n        inlineStyleNode,\n        result,\n        sourceResource,\n        uriResolver\n      );\n    } else {\n      // StyleMap\n      const pairs = queryChildNodes(inlineStyleNode, \"Pair\", namespaces.kml);\n      for (let p = 0; p < pairs.length; p++) {\n        const pair = pairs[p];\n        const key = queryStringValue(pair, \"key\", namespaces.kml);\n        if (key === \"normal\") {\n          const styleUrl = queryStringValue(pair, \"styleUrl\", namespaces.kml);\n          if (defined(styleUrl)) {\n            styleEntity = styleCollection.getById(styleUrl);\n            if (!defined(styleEntity)) {\n              styleEntity = styleCollection.getById(`#${styleUrl}`);\n            }\n            if (defined(styleEntity)) {\n              result.merge(styleEntity);\n            }\n          } else {\n            const node = queryFirstNode(pair, \"Style\", namespaces.kml);\n            applyStyle(dataSource, node, result, sourceResource, uriResolver);\n          }\n        } else {\n          oneTimeWarning(\n            `kml-styleMap-${key}`,\n            `KML - Unsupported StyleMap key: ${key}`\n          );\n        }\n      }\n    }\n  }\n\n  //Google earth seems to always use the first external style only.\n  const externalStyle = queryStringValue(placeMark, \"styleUrl\", namespaces.kml);\n  if (defined(externalStyle)) {\n    let id = externalStyle;\n    if (externalStyle[0] !== \"#\" && externalStyle.indexOf(\"#\") !== -1) {\n      const tokens = externalStyle.split(\"#\");\n      const uri = tokens[0];\n      const resource = sourceResource.getDerivedResource({\n        url: uri,\n      });\n\n      id = `${resource.getUrlComponent()}#${tokens[1]}`;\n    }\n\n    styleEntity = styleCollection.getById(id);\n    if (!defined(styleEntity)) {\n      styleEntity = styleCollection.getById(`#${id}`);\n    }\n    if (defined(styleEntity)) {\n      result.merge(styleEntity);\n    }\n  }\n\n  return result;\n}\n\n//Asynchronously processes an external style file.\nfunction processExternalStyles(dataSource, resource, styleCollection) {\n  return resource.fetchXML().then(function (styleKml) {\n    return processStyles(dataSource, styleKml, styleCollection, resource, true);\n  });\n}\n\n//Processes all shared and external styles and stores\n//their id into the provided styleCollection.\n//Returns an array of promises that will resolve when\n//each style is loaded.\nfunction processStyles(\n  dataSource,\n  kml,\n  styleCollection,\n  sourceResource,\n  isExternal,\n  uriResolver\n) {\n  let i;\n  let id;\n  let styleEntity;\n\n  let node;\n  const styleNodes = queryNodes(kml, \"Style\", namespaces.kml);\n  if (defined(styleNodes)) {\n    const styleNodesLength = styleNodes.length;\n    for (i = 0; i < styleNodesLength; i++) {\n      node = styleNodes[i];\n      id = queryStringAttribute(node, \"id\");\n      if (defined(id)) {\n        id = `#${id}`;\n        if (isExternal && defined(sourceResource)) {\n          id = sourceResource.getUrlComponent() + id;\n        }\n        if (!defined(styleCollection.getById(id))) {\n          styleEntity = new Entity({\n            id: id,\n          });\n          styleCollection.add(styleEntity);\n          applyStyle(\n            dataSource,\n            node,\n            styleEntity,\n            sourceResource,\n            uriResolver\n          );\n        }\n      }\n    }\n  }\n\n  const styleMaps = queryNodes(kml, \"StyleMap\", namespaces.kml);\n  if (defined(styleMaps)) {\n    const styleMapsLength = styleMaps.length;\n    for (i = 0; i < styleMapsLength; i++) {\n      const styleMap = styleMaps[i];\n      id = queryStringAttribute(styleMap, \"id\");\n      if (defined(id)) {\n        const pairs = queryChildNodes(styleMap, \"Pair\", namespaces.kml);\n        for (let p = 0; p < pairs.length; p++) {\n          const pair = pairs[p];\n          const key = queryStringValue(pair, \"key\", namespaces.kml);\n          if (key === \"normal\") {\n            id = `#${id}`;\n            if (isExternal && defined(sourceResource)) {\n              id = sourceResource.getUrlComponent() + id;\n            }\n            if (!defined(styleCollection.getById(id))) {\n              styleEntity = styleCollection.getOrCreateEntity(id);\n\n              let styleUrl = queryStringValue(pair, \"styleUrl\", namespaces.kml);\n              if (defined(styleUrl)) {\n                if (styleUrl[0] !== \"#\") {\n                  styleUrl = `#${styleUrl}`;\n                }\n\n                if (isExternal && defined(sourceResource)) {\n                  styleUrl = sourceResource.getUrlComponent() + styleUrl;\n                }\n                const base = styleCollection.getById(styleUrl);\n\n                if (defined(base)) {\n                  styleEntity.merge(base);\n                }\n              } else {\n                node = queryFirstNode(pair, \"Style\", namespaces.kml);\n                applyStyle(\n                  dataSource,\n                  node,\n                  styleEntity,\n                  sourceResource,\n                  uriResolver\n                );\n              }\n            }\n          } else {\n            oneTimeWarning(\n              `kml-styleMap-${key}`,\n              `KML - Unsupported StyleMap key: ${key}`\n            );\n          }\n        }\n      }\n    }\n  }\n\n  const promises = [];\n  const styleUrlNodes = kml.getElementsByTagName(\"styleUrl\");\n  const styleUrlNodesLength = styleUrlNodes.length;\n  for (i = 0; i < styleUrlNodesLength; i++) {\n    const styleReference = styleUrlNodes[i].textContent;\n    if (styleReference[0] !== \"#\") {\n      //According to the spec, all local styles should start with a #\n      //and everything else is an external style that has a # seperating\n      //the URL of the document and the style.  However, Google Earth\n      //also accepts styleUrls without a # as meaning a local style.\n      const tokens = styleReference.split(\"#\");\n      if (tokens.length === 2) {\n        const uri = tokens[0];\n        const resource = sourceResource.getDerivedResource({\n          url: uri,\n        });\n\n        promises.push(\n          processExternalStyles(dataSource, resource, styleCollection)\n        );\n      }\n    }\n  }\n\n  return promises;\n}\n\nfunction createDropLine(entityCollection, entity, styleEntity) {\n  const entityPosition = new ReferenceProperty(entityCollection, entity.id, [\n    \"position\",\n  ]);\n  const surfacePosition = new ScaledPositionProperty(entity.position);\n  entity.polyline = defined(styleEntity.polyline)\n    ? styleEntity.polyline.clone()\n    : new PolylineGraphics();\n  entity.polyline.positions = new PositionPropertyArray([\n    entityPosition,\n    surfacePosition,\n  ]);\n}\n\nfunction heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode) {\n  if (\n    (!defined(altitudeMode) && !defined(gxAltitudeMode)) ||\n    altitudeMode === \"clampToGround\"\n  ) {\n    return HeightReference.CLAMP_TO_GROUND;\n  }\n\n  if (altitudeMode === \"relativeToGround\") {\n    return HeightReference.RELATIVE_TO_GROUND;\n  }\n\n  if (altitudeMode === \"absolute\") {\n    return HeightReference.NONE;\n  }\n\n  if (gxAltitudeMode === \"clampToSeaFloor\") {\n    oneTimeWarning(\n      \"kml-gx:altitudeMode-clampToSeaFloor\",\n      \"KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround.\"\n    );\n    return HeightReference.CLAMP_TO_GROUND;\n  }\n\n  if (gxAltitudeMode === \"relativeToSeaFloor\") {\n    oneTimeWarning(\n      \"kml-gx:altitudeMode-relativeToSeaFloor\",\n      \"KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround.\"\n    );\n    return HeightReference.RELATIVE_TO_GROUND;\n  }\n\n  if (defined(altitudeMode)) {\n    oneTimeWarning(\n      \"kml-altitudeMode-unknown\",\n      `KML - Unknown <kml:altitudeMode>:${altitudeMode}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`\n    );\n  } else {\n    oneTimeWarning(\n      \"kml-gx:altitudeMode-unknown\",\n      `KML - Unknown <gx:altitudeMode>:${gxAltitudeMode}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`\n    );\n  }\n\n  // Clamp to ground is the default\n  return HeightReference.CLAMP_TO_GROUND;\n}\n\nfunction createPositionPropertyFromAltitudeMode(\n  property,\n  altitudeMode,\n  gxAltitudeMode\n) {\n  if (\n    gxAltitudeMode === \"relativeToSeaFloor\" ||\n    altitudeMode === \"absolute\" ||\n    altitudeMode === \"relativeToGround\"\n  ) {\n    //Just return the ellipsoid referenced property until we support MSL\n    return property;\n  }\n\n  if (\n    (defined(altitudeMode) && altitudeMode !== \"clampToGround\") || //\n    (defined(gxAltitudeMode) && gxAltitudeMode !== \"clampToSeaFloor\")\n  ) {\n    oneTimeWarning(\n      \"kml-altitudeMode-unknown\",\n      `KML - Unknown altitudeMode: ${defaultValue(\n        altitudeMode,\n        gxAltitudeMode\n      )}`\n    );\n  }\n\n  // Clamp to ground is the default\n  return new ScaledPositionProperty(property);\n}\n\nfunction createPositionPropertyArrayFromAltitudeMode(\n  properties,\n  altitudeMode,\n  gxAltitudeMode,\n  ellipsoid\n) {\n  if (!defined(properties)) {\n    return undefined;\n  }\n\n  if (\n    gxAltitudeMode === \"relativeToSeaFloor\" ||\n    altitudeMode === \"absolute\" ||\n    altitudeMode === \"relativeToGround\"\n  ) {\n    //Just return the ellipsoid referenced property until we support MSL\n    return properties;\n  }\n\n  if (\n    (defined(altitudeMode) && altitudeMode !== \"clampToGround\") || //\n    (defined(gxAltitudeMode) && gxAltitudeMode !== \"clampToSeaFloor\")\n  ) {\n    oneTimeWarning(\n      \"kml-altitudeMode-unknown\",\n      `KML - Unknown altitudeMode: ${defaultValue(\n        altitudeMode,\n        gxAltitudeMode\n      )}`\n    );\n  }\n\n  // Clamp to ground is the default\n  const propertiesLength = properties.length;\n  for (let i = 0; i < propertiesLength; i++) {\n    const property = properties[i];\n    ellipsoid.scaleToGeodeticSurface(property, property);\n  }\n  return properties;\n}\n\nfunction processPositionGraphics(\n  dataSource,\n  entity,\n  styleEntity,\n  heightReference\n) {\n  let label = entity.label;\n  if (!defined(label)) {\n    label = defined(styleEntity.label)\n      ? styleEntity.label.clone()\n      : createDefaultLabel();\n    entity.label = label;\n  }\n  label.text = entity.name;\n\n  let billboard = entity.billboard;\n  if (!defined(billboard)) {\n    billboard = defined(styleEntity.billboard)\n      ? styleEntity.billboard.clone()\n      : createDefaultBillboard();\n    entity.billboard = billboard;\n  }\n\n  if (!defined(billboard.image)) {\n    billboard.image = dataSource._pinBuilder.fromColor(Color.YELLOW, 64);\n\n    // If there were empty <Icon> tags in the KML, then billboard.image was set to false above\n    // However, in this case, the false value would have been converted to a property afterwards\n    // Thus, we check if billboard.image is defined with value of false\n  } else if (!billboard.image.getValue()) {\n    billboard.image = undefined;\n  }\n\n  let scale = 1.0;\n  if (defined(billboard.scale)) {\n    scale = billboard.scale.getValue();\n    if (scale !== 0) {\n      label.pixelOffset = new Cartesian2(scale * 16 + 1, 0);\n    } else {\n      //Minor tweaks to better match Google Earth.\n      label.pixelOffset = undefined;\n      label.horizontalOrigin = undefined;\n    }\n  }\n\n  if (defined(heightReference) && dataSource._clampToGround) {\n    billboard.heightReference = heightReference;\n    label.heightReference = heightReference;\n  }\n}\n\nfunction processPathGraphics(entity, styleEntity) {\n  let path = entity.path;\n  if (!defined(path)) {\n    path = new PathGraphics();\n    path.leadTime = 0;\n    entity.path = path;\n  }\n\n  const polyline = styleEntity.polyline;\n  if (defined(polyline)) {\n    path.material = polyline.material;\n    path.width = polyline.width;\n  }\n}\n\nfunction processPoint(\n  dataSource,\n  entityCollection,\n  geometryNode,\n  entity,\n  styleEntity\n) {\n  const coordinatesString = queryStringValue(\n    geometryNode,\n    \"coordinates\",\n    namespaces.kml\n  );\n  const altitudeMode = queryStringValue(\n    geometryNode,\n    \"altitudeMode\",\n    namespaces.kml\n  );\n  const gxAltitudeMode = queryStringValue(\n    geometryNode,\n    \"altitudeMode\",\n    namespaces.gx\n  );\n  const extrude = queryBooleanValue(geometryNode, \"extrude\", namespaces.kml);\n  const ellipsoid = dataSource._ellipsoid;\n  const position = readCoordinate(coordinatesString, ellipsoid);\n\n  entity.position = position;\n  processPositionGraphics(\n    dataSource,\n    entity,\n    styleEntity,\n    heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode)\n  );\n\n  if (extrude && isExtrudable(altitudeMode, gxAltitudeMode)) {\n    createDropLine(entityCollection, entity, styleEntity);\n  }\n\n  return true;\n}\n\nfunction processLineStringOrLinearRing(\n  dataSource,\n  entityCollection,\n  geometryNode,\n  entity,\n  styleEntity\n) {\n  const coordinatesNode = queryFirstNode(\n    geometryNode,\n    \"coordinates\",\n    namespaces.kml\n  );\n  const altitudeMode = queryStringValue(\n    geometryNode,\n    \"altitudeMode\",\n    namespaces.kml\n  );\n  const gxAltitudeMode = queryStringValue(\n    geometryNode,\n    \"altitudeMode\",\n    namespaces.gx\n  );\n  const extrude = queryBooleanValue(geometryNode, \"extrude\", namespaces.kml);\n  const tessellate = queryBooleanValue(\n    geometryNode,\n    \"tessellate\",\n    namespaces.kml\n  );\n  const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);\n  const zIndex = queryNumericValue(geometryNode, \"drawOrder\", namespaces.gx);\n\n  const ellipsoid = dataSource._ellipsoid;\n  const coordinates = readCoordinates(coordinatesNode, ellipsoid);\n  let polyline = styleEntity.polyline;\n  if (canExtrude && extrude) {\n    const wall = new WallGraphics();\n    entity.wall = wall;\n    wall.positions = coordinates;\n    const polygon = styleEntity.polygon;\n\n    if (defined(polygon)) {\n      wall.fill = polygon.fill;\n      wall.material = polygon.material;\n    }\n\n    //Always outline walls so they show up in 2D.\n    wall.outline = true;\n    if (defined(polyline)) {\n      wall.outlineColor = defined(polyline.material)\n        ? polyline.material.color\n        : Color.WHITE;\n      wall.outlineWidth = polyline.width;\n    } else if (defined(polygon)) {\n      wall.outlineColor = defined(polygon.material)\n        ? polygon.material.color\n        : Color.WHITE;\n    }\n  } else if (dataSource._clampToGround && !canExtrude && tessellate) {\n    const polylineGraphics = new PolylineGraphics();\n    polylineGraphics.clampToGround = true;\n    entity.polyline = polylineGraphics;\n    polylineGraphics.positions = coordinates;\n    if (defined(polyline)) {\n      polylineGraphics.material = defined(polyline.material)\n        ? polyline.material.color.getValue(Iso8601.MINIMUM_VALUE)\n        : Color.WHITE;\n      polylineGraphics.width = defaultValue(polyline.width, 1.0);\n    } else {\n      polylineGraphics.material = Color.WHITE;\n      polylineGraphics.width = 1.0;\n    }\n    polylineGraphics.zIndex = zIndex;\n  } else {\n    if (defined(zIndex)) {\n      oneTimeWarning(\n        \"kml-gx:drawOrder\",\n        \"KML - gx:drawOrder is not supported in LineStrings when clampToGround is false\"\n      );\n    }\n    if (dataSource._clampToGround && !tessellate) {\n      oneTimeWarning(\n        \"kml-line-tesselate\",\n        \"Ignoring clampToGround for KML lines without the tessellate flag.\"\n      );\n    }\n\n    polyline = defined(polyline) ? polyline.clone() : new PolylineGraphics();\n    entity.polyline = polyline;\n    polyline.positions = createPositionPropertyArrayFromAltitudeMode(\n      coordinates,\n      altitudeMode,\n      gxAltitudeMode,\n      ellipsoid\n    );\n    if (!tessellate || canExtrude) {\n      polyline.arcType = ArcType.NONE;\n    }\n  }\n\n  return true;\n}\n\nfunction processPolygon(\n  dataSource,\n  entityCollection,\n  geometryNode,\n  entity,\n  styleEntity\n) {\n  const outerBoundaryIsNode = queryFirstNode(\n    geometryNode,\n    \"outerBoundaryIs\",\n    namespaces.kml\n  );\n  let linearRingNode = queryFirstNode(\n    outerBoundaryIsNode,\n    \"LinearRing\",\n    namespaces.kml\n  );\n  let coordinatesNode = queryFirstNode(\n    linearRingNode,\n    \"coordinates\",\n    namespaces.kml\n  );\n  const ellipsoid = dataSource._ellipsoid;\n  let coordinates = readCoordinates(coordinatesNode, ellipsoid);\n  const extrude = queryBooleanValue(geometryNode, \"extrude\", namespaces.kml);\n  const altitudeMode = queryStringValue(\n    geometryNode,\n    \"altitudeMode\",\n    namespaces.kml\n  );\n  const gxAltitudeMode = queryStringValue(\n    geometryNode,\n    \"altitudeMode\",\n    namespaces.gx\n  );\n  const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);\n\n  const polygon = defined(styleEntity.polygon)\n    ? styleEntity.polygon.clone()\n    : createDefaultPolygon();\n\n  const polyline = styleEntity.polyline;\n  if (defined(polyline)) {\n    polygon.outlineColor = defined(polyline.material)\n      ? polyline.material.color\n      : Color.WHITE;\n    polygon.outlineWidth = polyline.width;\n  }\n  entity.polygon = polygon;\n\n  if (canExtrude) {\n    polygon.perPositionHeight = true;\n    polygon.extrudedHeight = extrude ? 0 : undefined;\n  } else if (!dataSource._clampToGround) {\n    polygon.height = 0;\n  }\n\n  if (defined(coordinates)) {\n    const hierarchy = new PolygonHierarchy(coordinates);\n    const innerBoundaryIsNodes = queryChildNodes(\n      geometryNode,\n      \"innerBoundaryIs\",\n      namespaces.kml\n    );\n    for (let j = 0; j < innerBoundaryIsNodes.length; j++) {\n      linearRingNode = queryChildNodes(\n        innerBoundaryIsNodes[j],\n        \"LinearRing\",\n        namespaces.kml\n      );\n      for (let k = 0; k < linearRingNode.length; k++) {\n        coordinatesNode = queryFirstNode(\n          linearRingNode[k],\n          \"coordinates\",\n          namespaces.kml\n        );\n        coordinates = readCoordinates(coordinatesNode, ellipsoid);\n        if (defined(coordinates)) {\n          hierarchy.holes.push(new PolygonHierarchy(coordinates));\n        }\n      }\n    }\n    polygon.hierarchy = hierarchy;\n  }\n\n  return true;\n}\n\nfunction processTrack(\n  dataSource,\n  entityCollection,\n  geometryNode,\n  entity,\n  styleEntity\n) {\n  const altitudeMode = queryStringValue(\n    geometryNode,\n    \"altitudeMode\",\n    namespaces.kml\n  );\n  const gxAltitudeMode = queryStringValue(\n    geometryNode,\n    \"altitudeMode\",\n    namespaces.gx\n  );\n  const coordNodes = queryChildNodes(geometryNode, \"coord\", namespaces.gx);\n  const angleNodes = queryChildNodes(geometryNode, \"angles\", namespaces.gx);\n  const timeNodes = queryChildNodes(geometryNode, \"when\", namespaces.kml);\n  const extrude = queryBooleanValue(geometryNode, \"extrude\", namespaces.kml);\n  const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);\n  const ellipsoid = dataSource._ellipsoid;\n\n  if (angleNodes.length > 0) {\n    oneTimeWarning(\n      \"kml-gx:angles\",\n      \"KML - gx:angles are not supported in gx:Tracks\"\n    );\n  }\n\n  const length = Math.min(coordNodes.length, timeNodes.length);\n  const coordinates = [];\n  const times = [];\n  for (let i = 0; i < length; i++) {\n    const position = readCoordinate(coordNodes[i].textContent, ellipsoid);\n    coordinates.push(position);\n    times.push(JulianDate.fromIso8601(timeNodes[i].textContent));\n  }\n  const property = new SampledPositionProperty();\n  property.addSamples(times, coordinates);\n  entity.position = property;\n  processPositionGraphics(\n    dataSource,\n    entity,\n    styleEntity,\n    heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode)\n  );\n  processPathGraphics(entity, styleEntity);\n\n  entity.availability = new TimeIntervalCollection();\n\n  if (timeNodes.length > 0) {\n    entity.availability.addInterval(\n      new TimeInterval({\n        start: times[0],\n        stop: times[times.length - 1],\n      })\n    );\n  }\n\n  if (canExtrude && extrude) {\n    createDropLine(entityCollection, entity, styleEntity);\n  }\n\n  return true;\n}\n\nfunction addToMultiTrack(\n  times,\n  positions,\n  composite,\n  availability,\n  dropShowProperty,\n  extrude,\n  altitudeMode,\n  gxAltitudeMode,\n  includeEndPoints\n) {\n  const start = times[0];\n  const stop = times[times.length - 1];\n\n  const data = new SampledPositionProperty();\n  data.addSamples(times, positions);\n\n  composite.intervals.addInterval(\n    new TimeInterval({\n      start: start,\n      stop: stop,\n      isStartIncluded: includeEndPoints,\n      isStopIncluded: includeEndPoints,\n      data: createPositionPropertyFromAltitudeMode(\n        data,\n        altitudeMode,\n        gxAltitudeMode\n      ),\n    })\n  );\n  availability.addInterval(\n    new TimeInterval({\n      start: start,\n      stop: stop,\n      isStartIncluded: includeEndPoints,\n      isStopIncluded: includeEndPoints,\n    })\n  );\n  dropShowProperty.intervals.addInterval(\n    new TimeInterval({\n      start: start,\n      stop: stop,\n      isStartIncluded: includeEndPoints,\n      isStopIncluded: includeEndPoints,\n      data: extrude,\n    })\n  );\n}\n\nfunction processMultiTrack(\n  dataSource,\n  entityCollection,\n  geometryNode,\n  entity,\n  styleEntity\n) {\n  // Multitrack options do not work in GE as detailed in the spec,\n  // rather than altitudeMode being at the MultiTrack level,\n  // GE just defers all settings to the underlying track.\n\n  const interpolate = queryBooleanValue(\n    geometryNode,\n    \"interpolate\",\n    namespaces.gx\n  );\n  const trackNodes = queryChildNodes(geometryNode, \"Track\", namespaces.gx);\n\n  let times;\n  let lastStop;\n  let lastStopPosition;\n  let needDropLine = false;\n  const dropShowProperty = new TimeIntervalCollectionProperty();\n  const availability = new TimeIntervalCollection();\n  const composite = new CompositePositionProperty();\n  const ellipsoid = dataSource._ellipsoid;\n  for (let i = 0, len = trackNodes.length; i < len; i++) {\n    const trackNode = trackNodes[i];\n    const timeNodes = queryChildNodes(trackNode, \"when\", namespaces.kml);\n    const coordNodes = queryChildNodes(trackNode, \"coord\", namespaces.gx);\n    const altitudeMode = queryStringValue(\n      trackNode,\n      \"altitudeMode\",\n      namespaces.kml\n    );\n    const gxAltitudeMode = queryStringValue(\n      trackNode,\n      \"altitudeMode\",\n      namespaces.gx\n    );\n    const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);\n    const extrude = queryBooleanValue(trackNode, \"extrude\", namespaces.kml);\n\n    const length = Math.min(coordNodes.length, timeNodes.length);\n\n    const positions = [];\n    times = [];\n    for (let x = 0; x < length; x++) {\n      const position = readCoordinate(coordNodes[x].textContent, ellipsoid);\n      positions.push(position);\n      times.push(JulianDate.fromIso8601(timeNodes[x].textContent));\n    }\n\n    if (interpolate) {\n      //If we are interpolating, then we need to fill in the end of\n      //the last track and the beginning of this one with a sampled\n      //property.  From testing in Google Earth, this property\n      //is never extruded and always absolute.\n      if (defined(lastStop)) {\n        addToMultiTrack(\n          [lastStop, times[0]],\n          [lastStopPosition, positions[0]],\n          composite,\n          availability,\n          dropShowProperty,\n          false,\n          \"absolute\",\n          undefined,\n          false\n        );\n      }\n      lastStop = times[length - 1];\n      lastStopPosition = positions[positions.length - 1];\n    }\n\n    addToMultiTrack(\n      times,\n      positions,\n      composite,\n      availability,\n      dropShowProperty,\n      canExtrude && extrude,\n      altitudeMode,\n      gxAltitudeMode,\n      true\n    );\n    needDropLine = needDropLine || (canExtrude && extrude);\n  }\n\n  entity.availability = availability;\n  entity.position = composite;\n  processPositionGraphics(dataSource, entity, styleEntity);\n  processPathGraphics(entity, styleEntity);\n  if (needDropLine) {\n    createDropLine(entityCollection, entity, styleEntity);\n    entity.polyline.show = dropShowProperty;\n  }\n\n  return true;\n}\n\nconst geometryTypes = {\n  Point: processPoint,\n  LineString: processLineStringOrLinearRing,\n  LinearRing: processLineStringOrLinearRing,\n  Polygon: processPolygon,\n  Track: processTrack,\n  MultiTrack: processMultiTrack,\n  MultiGeometry: processMultiGeometry,\n  Model: processUnsupportedGeometry,\n};\n\nfunction processMultiGeometry(\n  dataSource,\n  entityCollection,\n  geometryNode,\n  entity,\n  styleEntity,\n  context\n) {\n  const childNodes = geometryNode.childNodes;\n  let hasGeometry = false;\n  for (let i = 0, len = childNodes.length; i < len; i++) {\n    const childNode = childNodes.item(i);\n    const geometryProcessor = geometryTypes[childNode.localName];\n    if (defined(geometryProcessor)) {\n      const childEntity = createEntity(childNode, entityCollection, context);\n      childEntity.parent = entity;\n      childEntity.name = entity.name;\n      childEntity.availability = entity.availability;\n      childEntity.description = entity.description;\n      childEntity.kml = entity.kml;\n      if (\n        geometryProcessor(\n          dataSource,\n          entityCollection,\n          childNode,\n          childEntity,\n          styleEntity\n        )\n      ) {\n        hasGeometry = true;\n      }\n    }\n  }\n\n  return hasGeometry;\n}\n\nfunction processUnsupportedGeometry(\n  dataSource,\n  entityCollection,\n  geometryNode,\n  entity,\n  styleEntity\n) {\n  oneTimeWarning(\n    \"kml-unsupportedGeometry\",\n    `KML - Unsupported geometry: ${geometryNode.localName}`\n  );\n  return false;\n}\n\nfunction processExtendedData(node, entity) {\n  const extendedDataNode = queryFirstNode(node, \"ExtendedData\", namespaces.kml);\n\n  if (!defined(extendedDataNode)) {\n    return undefined;\n  }\n\n  if (defined(queryFirstNode(extendedDataNode, \"SchemaData\", namespaces.kml))) {\n    oneTimeWarning(\"kml-schemaData\", \"KML - SchemaData is unsupported\");\n  }\n  if (defined(queryStringAttribute(extendedDataNode, \"xmlns:prefix\"))) {\n    oneTimeWarning(\n      \"kml-extendedData\",\n      \"KML - ExtendedData with xmlns:prefix is unsupported\"\n    );\n  }\n\n  const result = {};\n  const dataNodes = queryChildNodes(extendedDataNode, \"Data\", namespaces.kml);\n  if (defined(dataNodes)) {\n    const length = dataNodes.length;\n    for (let i = 0; i < length; i++) {\n      const dataNode = dataNodes[i];\n      const name = queryStringAttribute(dataNode, \"name\");\n      if (defined(name)) {\n        result[name] = {\n          displayName: queryStringValue(\n            dataNode,\n            \"displayName\",\n            namespaces.kml\n          ),\n          value: queryStringValue(dataNode, \"value\", namespaces.kml),\n        };\n      }\n    }\n  }\n  entity.kml.extendedData = result;\n}\n\nlet scratchDiv;\nif (typeof document !== \"undefined\") {\n  scratchDiv = document.createElement(\"div\");\n}\n\nfunction processDescription(\n  node,\n  entity,\n  styleEntity,\n  uriResolver,\n  sourceResource\n) {\n  let i;\n  let key;\n  let keys;\n\n  const kmlData = entity.kml;\n  const extendedData = kmlData.extendedData;\n  const description = queryStringValue(node, \"description\", namespaces.kml);\n\n  const balloonStyle = defaultValue(\n    entity.balloonStyle,\n    styleEntity.balloonStyle\n  );\n\n  let background = Color.WHITE;\n  let foreground = Color.BLACK;\n  let text = description;\n\n  if (defined(balloonStyle)) {\n    background = defaultValue(balloonStyle.bgColor, Color.WHITE);\n    foreground = defaultValue(balloonStyle.textColor, Color.BLACK);\n    text = defaultValue(balloonStyle.text, description);\n  }\n\n  let value;\n  if (defined(text)) {\n    text = text.replace(\"$[name]\", defaultValue(entity.name, \"\"));\n    text = text.replace(\"$[description]\", defaultValue(description, \"\"));\n    text = text.replace(\"$[address]\", defaultValue(kmlData.address, \"\"));\n    text = text.replace(\"$[Snippet]\", defaultValue(kmlData.snippet, \"\"));\n    text = text.replace(\"$[id]\", entity.id);\n\n    //While not explicitly defined by the OGC spec, in Google Earth\n    //The appearance of geDirections adds the directions to/from links\n    //We simply replace this string with nothing.\n    text = text.replace(\"$[geDirections]\", \"\");\n\n    if (defined(extendedData)) {\n      const matches = text.match(/\\$\\[.+?\\]/g);\n      if (matches !== null) {\n        for (i = 0; i < matches.length; i++) {\n          const token = matches[i];\n          let propertyName = token.substr(2, token.length - 3);\n          const isDisplayName = /\\/displayName$/.test(propertyName);\n          propertyName = propertyName.replace(/\\/displayName$/, \"\");\n\n          value = extendedData[propertyName];\n          if (defined(value)) {\n            value = isDisplayName ? value.displayName : value.value;\n          }\n          if (defined(value)) {\n            text = text.replace(token, defaultValue(value, \"\"));\n          }\n        }\n      }\n    }\n  } else if (defined(extendedData)) {\n    //If no description exists, build a table out of the extended data\n    keys = Object.keys(extendedData);\n    if (keys.length > 0) {\n      text =\n        '<table class=\"cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter\"><tbody>';\n      for (i = 0; i < keys.length; i++) {\n        key = keys[i];\n        value = extendedData[key];\n        text += `<tr><th>${defaultValue(\n          value.displayName,\n          key\n        )}</th><td>${defaultValue(value.value, \"\")}</td></tr>`;\n      }\n      text += \"</tbody></table>\";\n    }\n  }\n\n  if (!defined(text)) {\n    //No description\n    return;\n  }\n\n  //Turns non-explicit links into clickable links.\n  text = autolinker.link(text);\n\n  //Use a temporary div to manipulate the links\n  //so that they open in a new window.\n  scratchDiv.innerHTML = text;\n  const links = scratchDiv.querySelectorAll(\"a\");\n  for (i = 0; i < links.length; i++) {\n    links[i].setAttribute(\"target\", \"_blank\");\n  }\n\n  //Rewrite any KMZ embedded urls\n  if (defined(uriResolver) && uriResolver.keys.length > 1) {\n    embedDataUris(scratchDiv, \"a\", \"href\", uriResolver);\n    embedDataUris(scratchDiv, \"link\", \"href\", uriResolver);\n    embedDataUris(scratchDiv, \"area\", \"href\", uriResolver);\n    embedDataUris(scratchDiv, \"img\", \"src\", uriResolver);\n    embedDataUris(scratchDiv, \"iframe\", \"src\", uriResolver);\n    embedDataUris(scratchDiv, \"video\", \"src\", uriResolver);\n    embedDataUris(scratchDiv, \"audio\", \"src\", uriResolver);\n    embedDataUris(scratchDiv, \"source\", \"src\", uriResolver);\n    embedDataUris(scratchDiv, \"track\", \"src\", uriResolver);\n    embedDataUris(scratchDiv, \"input\", \"src\", uriResolver);\n    embedDataUris(scratchDiv, \"embed\", \"src\", uriResolver);\n    embedDataUris(scratchDiv, \"script\", \"src\", uriResolver);\n    embedDataUris(scratchDiv, \"video\", \"poster\", uriResolver);\n  }\n\n  //Make relative urls absolute using the sourceResource\n  applyBasePath(scratchDiv, \"a\", \"href\", sourceResource);\n  applyBasePath(scratchDiv, \"link\", \"href\", sourceResource);\n  applyBasePath(scratchDiv, \"area\", \"href\", sourceResource);\n  applyBasePath(scratchDiv, \"img\", \"src\", sourceResource);\n  applyBasePath(scratchDiv, \"iframe\", \"src\", sourceResource);\n  applyBasePath(scratchDiv, \"video\", \"src\", sourceResource);\n  applyBasePath(scratchDiv, \"audio\", \"src\", sourceResource);\n  applyBasePath(scratchDiv, \"source\", \"src\", sourceResource);\n  applyBasePath(scratchDiv, \"track\", \"src\", sourceResource);\n  applyBasePath(scratchDiv, \"input\", \"src\", sourceResource);\n  applyBasePath(scratchDiv, \"embed\", \"src\", sourceResource);\n  applyBasePath(scratchDiv, \"script\", \"src\", sourceResource);\n  applyBasePath(scratchDiv, \"video\", \"poster\", sourceResource);\n\n  let tmp = '<div class=\"cesium-infoBox-description-lighter\" style=\"';\n  tmp += \"overflow:auto;\";\n  tmp += \"word-wrap:break-word;\";\n  tmp += `background-color:${background.toCssColorString()};`;\n  tmp += `color:${foreground.toCssColorString()};`;\n  tmp += '\">';\n  tmp += `${scratchDiv.innerHTML}</div>`;\n  scratchDiv.innerHTML = \"\";\n\n  //Set the final HTML as the description.\n  entity.description = tmp;\n}\n\nfunction processFeature(dataSource, featureNode, processingData) {\n  const entityCollection = processingData.entityCollection;\n  const parent = processingData.parentEntity;\n  const sourceResource = processingData.sourceResource;\n  const uriResolver = processingData.uriResolver;\n\n  const entity = createEntity(\n    featureNode,\n    entityCollection,\n    processingData.context\n  );\n  const kmlData = entity.kml;\n  const styleEntity = computeFinalStyle(\n    dataSource,\n    featureNode,\n    processingData.styleCollection,\n    sourceResource,\n    uriResolver\n  );\n\n  const name = queryStringValue(featureNode, \"name\", namespaces.kml);\n  entity.name = name;\n  entity.parent = parent;\n\n  let availability = processTimeSpan(featureNode);\n  if (!defined(availability)) {\n    availability = processTimeStamp(featureNode);\n  }\n  entity.availability = availability;\n\n  mergeAvailabilityWithParent(entity);\n\n  // Per KML spec \"A Feature is visible only if it and all its ancestors are visible.\"\n  function ancestryIsVisible(parentEntity) {\n    if (!parentEntity) {\n      return true;\n    }\n    return parentEntity.show && ancestryIsVisible(parentEntity.parent);\n  }\n\n  const visibility = queryBooleanValue(\n    featureNode,\n    \"visibility\",\n    namespaces.kml\n  );\n  entity.show = ancestryIsVisible(parent) && defaultValue(visibility, true);\n  //const open = queryBooleanValue(featureNode, 'open', namespaces.kml);\n\n  const authorNode = queryFirstNode(featureNode, \"author\", namespaces.atom);\n  const author = kmlData.author;\n  author.name = queryStringValue(authorNode, \"name\", namespaces.atom);\n  author.uri = queryStringValue(authorNode, \"uri\", namespaces.atom);\n  author.email = queryStringValue(authorNode, \"email\", namespaces.atom);\n\n  const linkNode = queryFirstNode(featureNode, \"link\", namespaces.atom);\n  const link = kmlData.link;\n  link.href = queryStringAttribute(linkNode, \"href\");\n  link.hreflang = queryStringAttribute(linkNode, \"hreflang\");\n  link.rel = queryStringAttribute(linkNode, \"rel\");\n  link.type = queryStringAttribute(linkNode, \"type\");\n  link.title = queryStringAttribute(linkNode, \"title\");\n  link.length = queryStringAttribute(linkNode, \"length\");\n\n  kmlData.address = queryStringValue(featureNode, \"address\", namespaces.kml);\n  kmlData.phoneNumber = queryStringValue(\n    featureNode,\n    \"phoneNumber\",\n    namespaces.kml\n  );\n  kmlData.snippet = queryStringValue(featureNode, \"Snippet\", namespaces.kml);\n\n  processExtendedData(featureNode, entity);\n  processDescription(\n    featureNode,\n    entity,\n    styleEntity,\n    uriResolver,\n    sourceResource\n  );\n\n  const ellipsoid = dataSource._ellipsoid;\n  processLookAt(featureNode, entity, ellipsoid);\n  processCamera(featureNode, entity, ellipsoid);\n\n  if (defined(queryFirstNode(featureNode, \"Region\", namespaces.kml))) {\n    oneTimeWarning(\"kml-region\", \"KML - Placemark Regions are unsupported\");\n  }\n\n  return {\n    entity: entity,\n    styleEntity: styleEntity,\n  };\n}\n\nfunction processDocument(dataSource, node, processingData, deferredLoading) {\n  deferredLoading.addNodes(node.childNodes, processingData);\n  deferredLoading.process();\n}\n\nfunction processFolder(dataSource, node, processingData, deferredLoading) {\n  const r = processFeature(dataSource, node, processingData);\n  const newProcessingData = clone(processingData);\n  newProcessingData.parentEntity = r.entity;\n  processDocument(dataSource, node, newProcessingData, deferredLoading);\n}\n\nfunction processPlacemark(\n  dataSource,\n  placemark,\n  processingData,\n  deferredLoading\n) {\n  const r = processFeature(dataSource, placemark, processingData);\n  const entity = r.entity;\n  const styleEntity = r.styleEntity;\n\n  let hasGeometry = false;\n  const childNodes = placemark.childNodes;\n  for (let i = 0, len = childNodes.length; i < len && !hasGeometry; i++) {\n    const childNode = childNodes.item(i);\n    const geometryProcessor = geometryTypes[childNode.localName];\n    if (defined(geometryProcessor)) {\n      // pass the placemark entity id as a context for case of defining multiple child entities together to handle case\n      // where some malformed kmls reuse the same id across placemarks, which works in GE, but is not technically to spec.\n      geometryProcessor(\n        dataSource,\n        processingData.entityCollection,\n        childNode,\n        entity,\n        styleEntity,\n        entity.id\n      );\n      hasGeometry = true;\n    }\n  }\n\n  if (!hasGeometry) {\n    entity.merge(styleEntity);\n    processPositionGraphics(dataSource, entity, styleEntity);\n  }\n}\n\nconst playlistNodeProcessors = {\n  FlyTo: processTourFlyTo,\n  Wait: processTourWait,\n  SoundCue: processTourUnsupportedNode,\n  AnimatedUpdate: processTourUnsupportedNode,\n  TourControl: processTourUnsupportedNode,\n};\n\nfunction processTour(dataSource, node, processingData, deferredLoading) {\n  const name = queryStringValue(node, \"name\", namespaces.kml);\n  const id = queryStringAttribute(node, \"id\");\n  const tour = new KmlTour(name, id);\n\n  const playlistNode = queryFirstNode(node, \"Playlist\", namespaces.gx);\n  if (playlistNode) {\n    const ellipsoid = dataSource._ellipsoid;\n    const childNodes = playlistNode.childNodes;\n    for (let i = 0; i < childNodes.length; i++) {\n      const entryNode = childNodes[i];\n      if (entryNode.localName) {\n        const playlistNodeProcessor =\n          playlistNodeProcessors[entryNode.localName];\n        if (playlistNodeProcessor) {\n          playlistNodeProcessor(tour, entryNode, ellipsoid);\n        } else {\n          console.log(\n            `Unknown KML Tour playlist entry type ${entryNode.localName}`\n          );\n        }\n      }\n    }\n  }\n\n  dataSource._kmlTours.push(tour);\n}\n\nfunction processTourUnsupportedNode(tour, entryNode) {\n  oneTimeWarning(`KML Tour unsupported node ${entryNode.localName}`);\n}\n\nfunction processTourWait(tour, entryNode) {\n  const duration = queryNumericValue(entryNode, \"duration\", namespaces.gx);\n  tour.addPlaylistEntry(new KmlTourWait(duration));\n}\n\nfunction processTourFlyTo(tour, entryNode, ellipsoid) {\n  const duration = queryNumericValue(entryNode, \"duration\", namespaces.gx);\n  const flyToMode = queryStringValue(entryNode, \"flyToMode\", namespaces.gx);\n\n  const t = { kml: {} };\n\n  processLookAt(entryNode, t, ellipsoid);\n  processCamera(entryNode, t, ellipsoid);\n\n  const view = t.kml.lookAt || t.kml.camera;\n\n  const flyto = new KmlTourFlyTo(duration, flyToMode, view);\n  tour.addPlaylistEntry(flyto);\n}\n\nfunction processCamera(featureNode, entity, ellipsoid) {\n  const camera = queryFirstNode(featureNode, \"Camera\", namespaces.kml);\n  if (defined(camera)) {\n    const lon = defaultValue(\n      queryNumericValue(camera, \"longitude\", namespaces.kml),\n      0.0\n    );\n    const lat = defaultValue(\n      queryNumericValue(camera, \"latitude\", namespaces.kml),\n      0.0\n    );\n    const altitude = defaultValue(\n      queryNumericValue(camera, \"altitude\", namespaces.kml),\n      0.0\n    );\n\n    const heading = defaultValue(\n      queryNumericValue(camera, \"heading\", namespaces.kml),\n      0.0\n    );\n    const tilt = defaultValue(\n      queryNumericValue(camera, \"tilt\", namespaces.kml),\n      0.0\n    );\n    const roll = defaultValue(\n      queryNumericValue(camera, \"roll\", namespaces.kml),\n      0.0\n    );\n\n    const position = Cartesian3.fromDegrees(lon, lat, altitude, ellipsoid);\n    const hpr = HeadingPitchRoll.fromDegrees(heading, tilt - 90.0, roll);\n\n    entity.kml.camera = new KmlCamera(position, hpr);\n  }\n}\n\nfunction processLookAt(featureNode, entity, ellipsoid) {\n  const lookAt = queryFirstNode(featureNode, \"LookAt\", namespaces.kml);\n  if (defined(lookAt)) {\n    const lon = defaultValue(\n      queryNumericValue(lookAt, \"longitude\", namespaces.kml),\n      0.0\n    );\n    const lat = defaultValue(\n      queryNumericValue(lookAt, \"latitude\", namespaces.kml),\n      0.0\n    );\n    const altitude = defaultValue(\n      queryNumericValue(lookAt, \"altitude\", namespaces.kml),\n      0.0\n    );\n    let heading = queryNumericValue(lookAt, \"heading\", namespaces.kml);\n    let tilt = queryNumericValue(lookAt, \"tilt\", namespaces.kml);\n    const range = defaultValue(\n      queryNumericValue(lookAt, \"range\", namespaces.kml),\n      0.0\n    );\n\n    tilt = CesiumMath.toRadians(defaultValue(tilt, 0.0));\n    heading = CesiumMath.toRadians(defaultValue(heading, 0.0));\n\n    const hpr = new HeadingPitchRange(\n      heading,\n      tilt - CesiumMath.PI_OVER_TWO,\n      range\n    );\n    const viewPoint = Cartesian3.fromDegrees(lon, lat, altitude, ellipsoid);\n\n    entity.kml.lookAt = new KmlLookAt(viewPoint, hpr);\n  }\n}\n\nfunction processScreenOverlay(\n  dataSource,\n  screenOverlayNode,\n  processingData,\n  deferredLoading\n) {\n  const screenOverlay = processingData.screenOverlayContainer;\n  if (!defined(screenOverlay)) {\n    return undefined;\n  }\n\n  const sourceResource = processingData.sourceResource;\n  const uriResolver = processingData.uriResolver;\n\n  const iconNode = queryFirstNode(screenOverlayNode, \"Icon\", namespaces.kml);\n  const icon = getIconHref(\n    iconNode,\n    dataSource,\n    sourceResource,\n    uriResolver,\n    false\n  );\n\n  if (!defined(icon)) {\n    return undefined;\n  }\n\n  const img = document.createElement(\"img\");\n  dataSource._screenOverlays.push(img);\n\n  img.src = icon.url;\n  img.onload = function () {\n    const styles = [\"position: absolute\"];\n\n    const screenXY = queryFirstNode(\n      screenOverlayNode,\n      \"screenXY\",\n      namespaces.kml\n    );\n    const overlayXY = queryFirstNode(\n      screenOverlayNode,\n      \"overlayXY\",\n      namespaces.kml\n    );\n    const size = queryFirstNode(screenOverlayNode, \"size\", namespaces.kml);\n\n    let x, y;\n    let xUnit, yUnit;\n    let xStyle, yStyle;\n\n    if (defined(size)) {\n      x = queryNumericAttribute(size, \"x\");\n      y = queryNumericAttribute(size, \"y\");\n      xUnit = queryStringAttribute(size, \"xunits\");\n      yUnit = queryStringAttribute(size, \"yunits\");\n\n      if (defined(x) && x !== -1 && x !== 0) {\n        if (xUnit === \"fraction\") {\n          xStyle = `width: ${Math.floor(x * 100)}%`;\n        } else if (xUnit === \"pixels\") {\n          xStyle = `width: ${x}px`;\n        }\n\n        styles.push(xStyle);\n      }\n\n      if (defined(y) && y !== -1 && y !== 0) {\n        if (yUnit === \"fraction\") {\n          yStyle = `height: ${Math.floor(y * 100)}%`;\n        } else if (yUnit === \"pixels\") {\n          yStyle = `height: ${y}px`;\n        }\n\n        styles.push(yStyle);\n      }\n    }\n\n    // set the interim style so the width/height properties get calculated\n    img.style = styles.join(\";\");\n\n    let xOrigin = 0;\n    let yOrigin = img.height;\n\n    if (defined(overlayXY)) {\n      x = queryNumericAttribute(overlayXY, \"x\");\n      y = queryNumericAttribute(overlayXY, \"y\");\n      xUnit = queryStringAttribute(overlayXY, \"xunits\");\n      yUnit = queryStringAttribute(overlayXY, \"yunits\");\n\n      if (defined(x)) {\n        if (xUnit === \"fraction\") {\n          xOrigin = x * img.width;\n        } else if (xUnit === \"pixels\") {\n          xOrigin = x;\n        } else if (xUnit === \"insetPixels\") {\n          xOrigin = x;\n        }\n      }\n\n      if (defined(y)) {\n        if (yUnit === \"fraction\") {\n          yOrigin = y * img.height;\n        } else if (yUnit === \"pixels\") {\n          yOrigin = y;\n        } else if (yUnit === \"insetPixels\") {\n          yOrigin = y;\n        }\n      }\n    }\n\n    if (defined(screenXY)) {\n      x = queryNumericAttribute(screenXY, \"x\");\n      y = queryNumericAttribute(screenXY, \"y\");\n      xUnit = queryStringAttribute(screenXY, \"xunits\");\n      yUnit = queryStringAttribute(screenXY, \"yunits\");\n\n      if (defined(x)) {\n        if (xUnit === \"fraction\") {\n          xStyle = `${\"left: \" + \"calc(\"}${Math.floor(\n            x * 100\n          )}% - ${xOrigin}px)`;\n        } else if (xUnit === \"pixels\") {\n          xStyle = `left: ${x - xOrigin}px`;\n        } else if (xUnit === \"insetPixels\") {\n          xStyle = `right: ${x - xOrigin}px`;\n        }\n\n        styles.push(xStyle);\n      }\n\n      if (defined(y)) {\n        if (yUnit === \"fraction\") {\n          yStyle = `${\"bottom: \" + \"calc(\"}${Math.floor(\n            y * 100\n          )}% - ${yOrigin}px)`;\n        } else if (yUnit === \"pixels\") {\n          yStyle = `bottom: ${y - yOrigin}px`;\n        } else if (yUnit === \"insetPixels\") {\n          yStyle = `top: ${y - yOrigin}px`;\n        }\n\n        styles.push(yStyle);\n      }\n    }\n\n    img.style = styles.join(\";\");\n  };\n\n  screenOverlay.appendChild(img);\n}\n\nfunction processGroundOverlay(\n  dataSource,\n  groundOverlay,\n  processingData,\n  deferredLoading\n) {\n  const r = processFeature(dataSource, groundOverlay, processingData);\n  const entity = r.entity;\n\n  let geometry;\n  let isLatLonQuad = false;\n\n  const ellipsoid = dataSource._ellipsoid;\n  const positions = readCoordinates(\n    queryFirstNode(groundOverlay, \"LatLonQuad\", namespaces.gx),\n    ellipsoid\n  );\n  const zIndex = queryNumericValue(groundOverlay, \"drawOrder\", namespaces.kml);\n  if (defined(positions)) {\n    geometry = createDefaultPolygon();\n    geometry.hierarchy = new PolygonHierarchy(positions);\n    geometry.zIndex = zIndex;\n    entity.polygon = geometry;\n    isLatLonQuad = true;\n  } else {\n    geometry = new RectangleGraphics();\n    geometry.zIndex = zIndex;\n    entity.rectangle = geometry;\n\n    const latLonBox = queryFirstNode(\n      groundOverlay,\n      \"LatLonBox\",\n      namespaces.kml\n    );\n    if (defined(latLonBox)) {\n      let west = queryNumericValue(latLonBox, \"west\", namespaces.kml);\n      let south = queryNumericValue(latLonBox, \"south\", namespaces.kml);\n      let east = queryNumericValue(latLonBox, \"east\", namespaces.kml);\n      let north = queryNumericValue(latLonBox, \"north\", namespaces.kml);\n\n      if (defined(west)) {\n        west = CesiumMath.negativePiToPi(CesiumMath.toRadians(west));\n      }\n      if (defined(south)) {\n        south = CesiumMath.clampToLatitudeRange(CesiumMath.toRadians(south));\n      }\n      if (defined(east)) {\n        east = CesiumMath.negativePiToPi(CesiumMath.toRadians(east));\n      }\n      if (defined(north)) {\n        north = CesiumMath.clampToLatitudeRange(CesiumMath.toRadians(north));\n      }\n      geometry.coordinates = new Rectangle(west, south, east, north);\n\n      const rotation = queryNumericValue(latLonBox, \"rotation\", namespaces.kml);\n      if (defined(rotation)) {\n        const rotationRadians = CesiumMath.toRadians(rotation);\n        geometry.rotation = rotationRadians;\n        geometry.stRotation = rotationRadians;\n      }\n    }\n  }\n\n  const iconNode = queryFirstNode(groundOverlay, \"Icon\", namespaces.kml);\n  const href = getIconHref(\n    iconNode,\n    dataSource,\n    processingData.sourceResource,\n    processingData.uriResolver,\n    true\n  );\n  if (defined(href)) {\n    if (isLatLonQuad) {\n      oneTimeWarning(\n        \"kml-gx:LatLonQuad\",\n        \"KML - gx:LatLonQuad Icon does not support texture projection.\"\n      );\n    }\n    const x = queryNumericValue(iconNode, \"x\", namespaces.gx);\n    const y = queryNumericValue(iconNode, \"y\", namespaces.gx);\n    const w = queryNumericValue(iconNode, \"w\", namespaces.gx);\n    const h = queryNumericValue(iconNode, \"h\", namespaces.gx);\n\n    if (defined(x) || defined(y) || defined(w) || defined(h)) {\n      oneTimeWarning(\n        \"kml-groundOverlay-xywh\",\n        \"KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays\"\n      );\n    }\n\n    geometry.material = href;\n    geometry.material.color = queryColorValue(\n      groundOverlay,\n      \"color\",\n      namespaces.kml\n    );\n    geometry.material.transparent = true;\n  } else {\n    geometry.material = queryColorValue(groundOverlay, \"color\", namespaces.kml);\n  }\n\n  let altitudeMode = queryStringValue(\n    groundOverlay,\n    \"altitudeMode\",\n    namespaces.kml\n  );\n\n  if (defined(altitudeMode)) {\n    if (altitudeMode === \"absolute\") {\n      //Use height above ellipsoid until we support MSL.\n      geometry.height = queryNumericValue(\n        groundOverlay,\n        \"altitude\",\n        namespaces.kml\n      );\n      geometry.zIndex = undefined;\n    } else if (altitudeMode !== \"clampToGround\") {\n      oneTimeWarning(\n        \"kml-altitudeMode-unknown\",\n        `KML - Unknown altitudeMode: ${altitudeMode}`\n      );\n    }\n    // else just use the default of 0 until we support 'clampToGround'\n  } else {\n    altitudeMode = queryStringValue(\n      groundOverlay,\n      \"altitudeMode\",\n      namespaces.gx\n    );\n    if (altitudeMode === \"relativeToSeaFloor\") {\n      oneTimeWarning(\n        \"kml-altitudeMode-relativeToSeaFloor\",\n        \"KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute.\"\n      );\n      geometry.height = queryNumericValue(\n        groundOverlay,\n        \"altitude\",\n        namespaces.kml\n      );\n      geometry.zIndex = undefined;\n    } else if (altitudeMode === \"clampToSeaFloor\") {\n      oneTimeWarning(\n        \"kml-altitudeMode-clampToSeaFloor\",\n        \"KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround.\"\n      );\n    } else if (defined(altitudeMode)) {\n      oneTimeWarning(\n        \"kml-altitudeMode-unknown\",\n        `KML - Unknown altitudeMode: ${altitudeMode}`\n      );\n    }\n  }\n}\n\nfunction processUnsupportedFeature(\n  dataSource,\n  node,\n  processingData,\n  deferredLoading\n) {\n  dataSource._unsupportedNode.raiseEvent(\n    dataSource,\n    processingData.parentEntity,\n    node,\n    processingData.entityCollection,\n    processingData.styleCollection,\n    processingData.sourceResource,\n    processingData.uriResolver\n  );\n  oneTimeWarning(\n    `kml-unsupportedFeature-${node.nodeName}`,\n    `KML - Unsupported feature: ${node.nodeName}`\n  );\n}\n\nconst RefreshMode = {\n  INTERVAL: 0,\n  EXPIRE: 1,\n  STOP: 2,\n};\n\nfunction cleanupString(s) {\n  if (!defined(s) || s.length === 0) {\n    return \"\";\n  }\n\n  const sFirst = s[0];\n  if (sFirst === \"&\" || sFirst === \"?\") {\n    s = s.substring(1);\n  }\n\n  return s;\n}\n\nconst zeroRectangle = new Rectangle();\nconst scratchCartographic = new Cartographic();\nconst scratchCartesian2 = new Cartesian2();\nconst scratchCartesian3 = new Cartesian3();\n\nfunction processNetworkLinkQueryString(\n  resource,\n  camera,\n  canvas,\n  viewBoundScale,\n  bbox,\n  ellipsoid\n) {\n  function fixLatitude(value) {\n    if (value < -CesiumMath.PI_OVER_TWO) {\n      return -CesiumMath.PI_OVER_TWO;\n    } else if (value > CesiumMath.PI_OVER_TWO) {\n      return CesiumMath.PI_OVER_TWO;\n    }\n    return value;\n  }\n\n  function fixLongitude(value) {\n    if (value > CesiumMath.PI) {\n      return value - CesiumMath.TWO_PI;\n    } else if (value < -CesiumMath.PI) {\n      return value + CesiumMath.TWO_PI;\n    }\n\n    return value;\n  }\n\n  let queryString = objectToQuery(resource.queryParameters);\n\n  // objectToQuery escapes [ and ], so fix that\n  queryString = queryString.replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n\n  if (defined(camera) && camera._mode !== SceneMode.MORPHING) {\n    let centerCartesian;\n    let centerCartographic;\n\n    bbox = defaultValue(bbox, zeroRectangle);\n    if (defined(canvas)) {\n      scratchCartesian2.x = canvas.clientWidth * 0.5;\n      scratchCartesian2.y = canvas.clientHeight * 0.5;\n      centerCartesian = camera.pickEllipsoid(\n        scratchCartesian2,\n        ellipsoid,\n        scratchCartesian3\n      );\n    }\n\n    if (defined(centerCartesian)) {\n      centerCartographic = ellipsoid.cartesianToCartographic(\n        centerCartesian,\n        scratchCartographic\n      );\n    } else {\n      centerCartographic = Rectangle.center(bbox, scratchCartographic);\n      centerCartesian = ellipsoid.cartographicToCartesian(centerCartographic);\n    }\n\n    if (\n      defined(viewBoundScale) &&\n      !CesiumMath.equalsEpsilon(viewBoundScale, 1.0, CesiumMath.EPSILON9)\n    ) {\n      const newHalfWidth = bbox.width * viewBoundScale * 0.5;\n      const newHalfHeight = bbox.height * viewBoundScale * 0.5;\n      bbox = new Rectangle(\n        fixLongitude(centerCartographic.longitude - newHalfWidth),\n        fixLatitude(centerCartographic.latitude - newHalfHeight),\n        fixLongitude(centerCartographic.longitude + newHalfWidth),\n        fixLatitude(centerCartographic.latitude + newHalfHeight)\n      );\n    }\n\n    queryString = queryString.replace(\n      \"[bboxWest]\",\n      CesiumMath.toDegrees(bbox.west).toString()\n    );\n    queryString = queryString.replace(\n      \"[bboxSouth]\",\n      CesiumMath.toDegrees(bbox.south).toString()\n    );\n    queryString = queryString.replace(\n      \"[bboxEast]\",\n      CesiumMath.toDegrees(bbox.east).toString()\n    );\n    queryString = queryString.replace(\n      \"[bboxNorth]\",\n      CesiumMath.toDegrees(bbox.north).toString()\n    );\n\n    const lon = CesiumMath.toDegrees(centerCartographic.longitude).toString();\n    const lat = CesiumMath.toDegrees(centerCartographic.latitude).toString();\n    queryString = queryString.replace(\"[lookatLon]\", lon);\n    queryString = queryString.replace(\"[lookatLat]\", lat);\n    queryString = queryString.replace(\n      \"[lookatTilt]\",\n      CesiumMath.toDegrees(camera.pitch).toString()\n    );\n    queryString = queryString.replace(\n      \"[lookatHeading]\",\n      CesiumMath.toDegrees(camera.heading).toString()\n    );\n    queryString = queryString.replace(\n      \"[lookatRange]\",\n      Cartesian3.distance(camera.positionWC, centerCartesian)\n    );\n    queryString = queryString.replace(\"[lookatTerrainLon]\", lon);\n    queryString = queryString.replace(\"[lookatTerrainLat]\", lat);\n    queryString = queryString.replace(\n      \"[lookatTerrainAlt]\",\n      centerCartographic.height.toString()\n    );\n\n    ellipsoid.cartesianToCartographic(camera.positionWC, scratchCartographic);\n    queryString = queryString.replace(\n      \"[cameraLon]\",\n      CesiumMath.toDegrees(scratchCartographic.longitude).toString()\n    );\n    queryString = queryString.replace(\n      \"[cameraLat]\",\n      CesiumMath.toDegrees(scratchCartographic.latitude).toString()\n    );\n    queryString = queryString.replace(\n      \"[cameraAlt]\",\n      CesiumMath.toDegrees(scratchCartographic.height).toString()\n    );\n\n    const frustum = camera.frustum;\n    const aspectRatio = frustum.aspectRatio;\n    let horizFov = \"\";\n    let vertFov = \"\";\n    if (defined(aspectRatio)) {\n      const fov = CesiumMath.toDegrees(frustum.fov);\n      if (aspectRatio > 1.0) {\n        horizFov = fov;\n        vertFov = fov / aspectRatio;\n      } else {\n        vertFov = fov;\n        horizFov = fov * aspectRatio;\n      }\n    }\n    queryString = queryString.replace(\"[horizFov]\", horizFov.toString());\n    queryString = queryString.replace(\"[vertFov]\", vertFov.toString());\n  } else {\n    queryString = queryString.replace(\"[bboxWest]\", \"-180\");\n    queryString = queryString.replace(\"[bboxSouth]\", \"-90\");\n    queryString = queryString.replace(\"[bboxEast]\", \"180\");\n    queryString = queryString.replace(\"[bboxNorth]\", \"90\");\n\n    queryString = queryString.replace(\"[lookatLon]\", \"\");\n    queryString = queryString.replace(\"[lookatLat]\", \"\");\n    queryString = queryString.replace(\"[lookatRange]\", \"\");\n    queryString = queryString.replace(\"[lookatTilt]\", \"\");\n    queryString = queryString.replace(\"[lookatHeading]\", \"\");\n    queryString = queryString.replace(\"[lookatTerrainLon]\", \"\");\n    queryString = queryString.replace(\"[lookatTerrainLat]\", \"\");\n    queryString = queryString.replace(\"[lookatTerrainAlt]\", \"\");\n\n    queryString = queryString.replace(\"[cameraLon]\", \"\");\n    queryString = queryString.replace(\"[cameraLat]\", \"\");\n    queryString = queryString.replace(\"[cameraAlt]\", \"\");\n    queryString = queryString.replace(\"[horizFov]\", \"\");\n    queryString = queryString.replace(\"[vertFov]\", \"\");\n  }\n\n  if (defined(canvas)) {\n    queryString = queryString.replace(\"[horizPixels]\", canvas.clientWidth);\n    queryString = queryString.replace(\"[vertPixels]\", canvas.clientHeight);\n  } else {\n    queryString = queryString.replace(\"[horizPixels]\", \"\");\n    queryString = queryString.replace(\"[vertPixels]\", \"\");\n  }\n\n  queryString = queryString.replace(\"[terrainEnabled]\", \"1\");\n  queryString = queryString.replace(\"[clientVersion]\", \"1\");\n  queryString = queryString.replace(\"[kmlVersion]\", \"2.2\");\n  queryString = queryString.replace(\"[clientName]\", \"Cesium\");\n  queryString = queryString.replace(\"[language]\", \"English\");\n\n  resource.setQueryParameters(queryToObject(queryString));\n}\n\nfunction processNetworkLink(dataSource, node, processingData, deferredLoading) {\n  const r = processFeature(dataSource, node, processingData);\n  const networkEntity = r.entity;\n\n  const sourceResource = processingData.sourceResource;\n  const uriResolver = processingData.uriResolver;\n\n  let link = queryFirstNode(node, \"Link\", namespaces.kml);\n\n  if (!defined(link)) {\n    link = queryFirstNode(node, \"Url\", namespaces.kml);\n  }\n  if (defined(link)) {\n    let href = queryStringValue(link, \"href\", namespaces.kml);\n    let viewRefreshMode;\n    let viewBoundScale;\n    if (defined(href)) {\n      let newSourceUri = href;\n      href = resolveHref(href, sourceResource, processingData.uriResolver);\n\n      // We need to pass in the original path if resolveHref returns a data uri because the network link\n      //  references a document in a KMZ archive\n      if (/^data:/.test(href.getUrlComponent())) {\n        // So if sourceUri isn't the kmz file, then its another kml in the archive, so resolve it\n        if (!/\\.kmz/i.test(sourceResource.getUrlComponent())) {\n          newSourceUri = sourceResource.getDerivedResource({\n            url: newSourceUri,\n          });\n        }\n      } else {\n        newSourceUri = href.clone(); // Not a data uri so use the fully qualified uri\n        viewRefreshMode = queryStringValue(\n          link,\n          \"viewRefreshMode\",\n          namespaces.kml\n        );\n        if (viewRefreshMode === \"onRegion\") {\n          oneTimeWarning(\n            \"kml-refrehMode-onRegion\",\n            \"KML - Unsupported viewRefreshMode: onRegion\"\n          );\n          return;\n        }\n        viewBoundScale = defaultValue(\n          queryStringValue(link, \"viewBoundScale\", namespaces.kml),\n          1.0\n        );\n        const defaultViewFormat =\n          viewRefreshMode === \"onStop\"\n            ? \"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]\"\n            : \"\";\n        const viewFormat = defaultValue(\n          queryStringValue(link, \"viewFormat\", namespaces.kml),\n          defaultViewFormat\n        );\n        const httpQuery = queryStringValue(link, \"httpQuery\", namespaces.kml);\n        if (defined(viewFormat)) {\n          href.setQueryParameters(queryToObject(cleanupString(viewFormat)));\n        }\n        if (defined(httpQuery)) {\n          href.setQueryParameters(queryToObject(cleanupString(httpQuery)));\n        }\n\n        const ellipsoid = dataSource._ellipsoid;\n        processNetworkLinkQueryString(\n          href,\n          dataSource.camera,\n          dataSource.canvas,\n          viewBoundScale,\n          dataSource._lastCameraView.bbox,\n          ellipsoid\n        );\n      }\n\n      const options = {\n        sourceUri: newSourceUri,\n        uriResolver: uriResolver,\n        context: networkEntity.id,\n        screenOverlayContainer: processingData.screenOverlayContainer,\n      };\n      const networkLinkCollection = new EntityCollection();\n      const promise = load(dataSource, networkLinkCollection, href, options)\n        .then(function (rootElement) {\n          const entities = dataSource._entityCollection;\n          const newEntities = networkLinkCollection.values;\n          entities.suspendEvents();\n          for (let i = 0; i < newEntities.length; i++) {\n            const newEntity = newEntities[i];\n            if (!defined(newEntity.parent)) {\n              newEntity.parent = networkEntity;\n              mergeAvailabilityWithParent(newEntity);\n            }\n\n            entities.add(newEntity);\n          }\n          entities.resumeEvents();\n\n          // Add network links to a list if we need they will need to be updated\n          const refreshMode = queryStringValue(\n            link,\n            \"refreshMode\",\n            namespaces.kml\n          );\n          let refreshInterval = defaultValue(\n            queryNumericValue(link, \"refreshInterval\", namespaces.kml),\n            0\n          );\n          if (\n            (refreshMode === \"onInterval\" && refreshInterval > 0) ||\n            refreshMode === \"onExpire\" ||\n            viewRefreshMode === \"onStop\"\n          ) {\n            const networkLinkControl = queryFirstNode(\n              rootElement,\n              \"NetworkLinkControl\",\n              namespaces.kml\n            );\n            const hasNetworkLinkControl = defined(networkLinkControl);\n\n            const now = JulianDate.now();\n            const networkLinkInfo = {\n              id: createGuid(),\n              href: href,\n              cookie: {},\n              lastUpdated: now,\n              updating: false,\n              entity: networkEntity,\n              viewBoundScale: viewBoundScale,\n              needsUpdate: false,\n              cameraUpdateTime: now,\n            };\n\n            let minRefreshPeriod = 0;\n            if (hasNetworkLinkControl) {\n              networkLinkInfo.cookie = queryToObject(\n                defaultValue(\n                  queryStringValue(\n                    networkLinkControl,\n                    \"cookie\",\n                    namespaces.kml\n                  ),\n                  \"\"\n                )\n              );\n              minRefreshPeriod = defaultValue(\n                queryNumericValue(\n                  networkLinkControl,\n                  \"minRefreshPeriod\",\n                  namespaces.kml\n                ),\n                0\n              );\n            }\n\n            if (refreshMode === \"onInterval\") {\n              if (hasNetworkLinkControl) {\n                refreshInterval = Math.max(minRefreshPeriod, refreshInterval);\n              }\n              networkLinkInfo.refreshMode = RefreshMode.INTERVAL;\n              networkLinkInfo.time = refreshInterval;\n            } else if (refreshMode === \"onExpire\") {\n              let expires;\n              if (hasNetworkLinkControl) {\n                expires = queryStringValue(\n                  networkLinkControl,\n                  \"expires\",\n                  namespaces.kml\n                );\n              }\n              if (defined(expires)) {\n                try {\n                  const date = JulianDate.fromIso8601(expires);\n                  const diff = JulianDate.secondsDifference(date, now);\n                  if (diff > 0 && diff < minRefreshPeriod) {\n                    JulianDate.addSeconds(now, minRefreshPeriod, date);\n                  }\n                  networkLinkInfo.refreshMode = RefreshMode.EXPIRE;\n                  networkLinkInfo.time = date;\n                } catch (e) {\n                  oneTimeWarning(\n                    \"kml-refreshMode-onInterval-onExpire\",\n                    \"KML - NetworkLinkControl expires is not a valid date\"\n                  );\n                }\n              } else {\n                oneTimeWarning(\n                  \"kml-refreshMode-onExpire\",\n                  \"KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element\"\n                );\n              }\n            } else if (defined(dataSource.camera)) {\n              // Only allow onStop refreshes if we have a camera\n              networkLinkInfo.refreshMode = RefreshMode.STOP;\n              networkLinkInfo.time = defaultValue(\n                queryNumericValue(link, \"viewRefreshTime\", namespaces.kml),\n                0\n              );\n            } else {\n              oneTimeWarning(\n                \"kml-refrehMode-onStop-noCamera\",\n                \"A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.\"\n              );\n            }\n\n            if (defined(networkLinkInfo.refreshMode)) {\n              dataSource._networkLinks.set(networkLinkInfo.id, networkLinkInfo);\n            }\n          }\n        })\n        .catch(function (error) {\n          oneTimeWarning(`An error occured during loading ${href.url}`);\n          dataSource._error.raiseEvent(dataSource, error);\n        });\n\n      deferredLoading.addPromise(promise);\n    }\n  }\n}\n\nfunction processFeatureNode(dataSource, node, processingData, deferredLoading) {\n  const featureProcessor = featureTypes[node.localName];\n  if (defined(featureProcessor)) {\n    return featureProcessor(dataSource, node, processingData, deferredLoading);\n  }\n\n  return processUnsupportedFeature(\n    dataSource,\n    node,\n    processingData,\n    deferredLoading\n  );\n}\n\nfunction loadKml(\n  dataSource,\n  entityCollection,\n  kml,\n  sourceResource,\n  uriResolver,\n  screenOverlayContainer,\n  context\n) {\n  entityCollection.removeAll();\n\n  const documentElement = kml.documentElement;\n  const document =\n    documentElement.localName === \"Document\"\n      ? documentElement\n      : queryFirstNode(documentElement, \"Document\", namespaces.kml);\n  let name = queryStringValue(document, \"name\", namespaces.kml);\n  if (!defined(name)) {\n    name = getFilenameFromUri(sourceResource.getUrlComponent());\n  }\n\n  // Only set the name from the root document\n  if (!defined(dataSource._name)) {\n    dataSource._name = name;\n  }\n\n  const deferredLoading = new KmlDataSource._DeferredLoading(dataSource);\n  const styleCollection = new EntityCollection(dataSource);\n  return Promise.all(\n    processStyles(\n      dataSource,\n      kml,\n      styleCollection,\n      sourceResource,\n      false,\n      uriResolver\n    )\n  ).then(function () {\n    let element = kml.documentElement;\n    if (element.localName === \"kml\") {\n      const childNodes = element.childNodes;\n      for (let i = 0; i < childNodes.length; i++) {\n        const tmp = childNodes[i];\n        if (defined(featureTypes[tmp.localName])) {\n          element = tmp;\n          break;\n        }\n      }\n    }\n\n    const processingData = {\n      parentEntity: undefined,\n      entityCollection: entityCollection,\n      styleCollection: styleCollection,\n      sourceResource: sourceResource,\n      uriResolver: uriResolver,\n      context: context,\n      screenOverlayContainer: screenOverlayContainer,\n    };\n\n    entityCollection.suspendEvents();\n    processFeatureNode(dataSource, element, processingData, deferredLoading);\n    entityCollection.resumeEvents();\n\n    return deferredLoading.wait().then(function () {\n      return kml.documentElement;\n    });\n  });\n}\n\nfunction loadKmz(\n  dataSource,\n  entityCollection,\n  blob,\n  sourceResource,\n  screenOverlayContainer\n) {\n  const zWorkerUrl = buildModuleUrl(\"ThirdParty/Workers/z-worker-pako.js\");\n  zip.configure({\n    workerScripts: {\n      deflate: [zWorkerUrl, \"./pako_deflate.min.js\"],\n      inflate: [zWorkerUrl, \"./pako_inflate.min.js\"],\n    },\n  });\n\n  const reader = new zip.ZipReader(new zip.BlobReader(blob));\n  return Promise.resolve(reader.getEntries()).then(function (entries) {\n    const promises = [];\n    const uriResolver = {};\n    let docEntry;\n    for (let i = 0; i < entries.length; i++) {\n      const entry = entries[i];\n      if (!entry.directory) {\n        if (/\\.kml$/i.test(entry.filename)) {\n          // We use the first KML document we come across\n          //  https://developers.google.com/kml/documentation/kmzarchives\n          // Unless we come across a .kml file at the root of the archive because GE does this\n          if (!defined(docEntry) || !/\\//i.test(entry.filename)) {\n            if (defined(docEntry)) {\n              // We found one at the root so load the initial kml as a data uri\n              promises.push(loadDataUriFromZip(docEntry, uriResolver));\n            }\n            docEntry = entry;\n          } else {\n            // Wasn't the first kml and wasn't at the root\n            promises.push(loadDataUriFromZip(entry, uriResolver));\n          }\n        } else {\n          promises.push(loadDataUriFromZip(entry, uriResolver));\n        }\n      }\n    }\n\n    // Now load the root KML document\n    if (defined(docEntry)) {\n      promises.push(loadXmlFromZip(docEntry, uriResolver));\n    }\n    return Promise.all(promises).then(function () {\n      reader.close();\n      if (!defined(uriResolver.kml)) {\n        throw new RuntimeError(\"KMZ file does not contain a KML document.\");\n      }\n      uriResolver.keys = Object.keys(uriResolver);\n      return loadKml(\n        dataSource,\n        entityCollection,\n        uriResolver.kml,\n        sourceResource,\n        uriResolver,\n        screenOverlayContainer\n      );\n    });\n  });\n}\n\nfunction load(dataSource, entityCollection, data, options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  let sourceUri = options.sourceUri;\n  const uriResolver = options.uriResolver;\n  const context = options.context;\n  let screenOverlayContainer = options.screenOverlayContainer;\n\n  let promise = data;\n  if (typeof data === \"string\" || data instanceof Resource) {\n    data = Resource.createIfNeeded(data);\n    promise = data.fetchBlob();\n    sourceUri = defaultValue(sourceUri, data.clone());\n\n    // Add resource credits to our list of credits to display\n    const resourceCredits = dataSource._resourceCredits;\n    const credits = data.credits;\n    if (defined(credits)) {\n      const length = credits.length;\n      for (let i = 0; i < length; i++) {\n        resourceCredits.push(credits[i]);\n      }\n    }\n  } else {\n    sourceUri = defaultValue(sourceUri, Resource.DEFAULT.clone());\n  }\n\n  sourceUri = Resource.createIfNeeded(sourceUri);\n\n  if (defined(screenOverlayContainer)) {\n    screenOverlayContainer = getElement(screenOverlayContainer);\n  }\n\n  return Promise.resolve(promise)\n    .then(function (dataToLoad) {\n      if (dataToLoad instanceof Blob) {\n        return isZipFile(dataToLoad).then(function (isZip) {\n          if (isZip) {\n            return loadKmz(\n              dataSource,\n              entityCollection,\n              dataToLoad,\n              sourceUri,\n              screenOverlayContainer\n            );\n          }\n          return readBlobAsText(dataToLoad).then(function (text) {\n            //There's no official way to validate if a parse was successful.\n            //The following check detects the error on various browsers.\n\n            //Insert missing namespaces\n            text = insertNamespaces(text);\n\n            //Remove Duplicate Namespaces\n            text = removeDuplicateNamespaces(text);\n\n            //IE raises an exception\n            let kml;\n            let error;\n            try {\n              kml = parser.parseFromString(text, \"application/xml\");\n            } catch (e) {\n              error = e.toString();\n            }\n\n            //The parse succeeds on Chrome and Firefox, but the error\n            //handling is different in each.\n            if (\n              defined(error) ||\n              kml.body ||\n              kml.documentElement.tagName === \"parsererror\"\n            ) {\n              //Firefox has error information as the firstChild nodeValue.\n              let msg = defined(error)\n                ? error\n                : kml.documentElement.firstChild.nodeValue;\n\n              //Chrome has it in the body text.\n              if (!msg) {\n                msg = kml.body.innerText;\n              }\n\n              //Return the error\n              throw new RuntimeError(msg);\n            }\n            return loadKml(\n              dataSource,\n              entityCollection,\n              kml,\n              sourceUri,\n              uriResolver,\n              screenOverlayContainer,\n              context\n            );\n          });\n        });\n      }\n      return loadKml(\n        dataSource,\n        entityCollection,\n        dataToLoad,\n        sourceUri,\n        uriResolver,\n        screenOverlayContainer,\n        context\n      );\n    })\n    .catch(function (error) {\n      dataSource._error.raiseEvent(dataSource, error);\n      console.log(error);\n      return Promise.reject(error);\n    });\n}\n\n// NOTE: LoadOptions properties are repeated in ConstructorOptions because some\n// tooling does not support \"base types\" for @typedef.  Remove if/when\n// https://github.com/microsoft/TypeScript/issues/20077 and/or\n// https://github.com/jsdoc/jsdoc/issues/1199 actually get resolved\n/**\n * @typedef {object} KmlDataSource.LoadOptions\n *\n * Initialization options for the `load` method.\n *\n * @property {string} [sourceUri] Overrides the url to use for resolving relative links and other KML network features.\n * @property {boolean} [clampToGround=false] true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground.\n * @property {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The global ellipsoid used for geographical calculations.\n * @property {Element|string} [screenOverlayContainer] A container for ScreenOverlay images.\n */\n\n/**\n * @typedef {object} KmlDataSource.ConstructorOptions\n *\n * Options for constructing a new KmlDataSource, or calling the static `load` method.\n *\n * @property {Camera} [camera] The camera that is used for viewRefreshModes and sending camera properties to network links.\n * @property {HTMLCanvasElement} [canvas] The canvas that is used for sending viewer properties to network links.\n * @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.\n *\n * @property {string} [sourceUri] Overrides the url to use for resolving relative links and other KML network features.\n * @property {boolean} [clampToGround=false] true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground.\n * @property {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The global ellipsoid used for geographical calculations.\n * @property {Element|string} [screenOverlayContainer] A container for ScreenOverlay images.\n\n*/\n\n/**\n * A {@link DataSource} which processes Keyhole Markup Language 2.2 (KML).\n * <p>\n * KML support in Cesium is incomplete, but a large amount of the standard,\n * as well as Google's <code>gx</code> extension namespace, is supported. See Github issue\n * {@link https://github.com/CesiumGS/cesium/issues/873|#873} for a\n * detailed list of what is and isn't supported. Cesium will also write information to the\n * console when it encounters most unsupported features.\n * </p>\n * <p>\n * Non visual feature data, such as <code>atom:author</code> and <code>ExtendedData</code>\n * is exposed via an instance of {@link KmlFeatureData}, which is added to each {@link Entity}\n * under the <code>kml</code> property.\n * </p>\n *\n * @alias KmlDataSource\n * @constructor\n *\n * @param {KmlDataSource.ConstructorOptions} [options] Object describing initialization options\n *\n * @see {@link http://www.opengeospatial.org/standards/kml/|Open Geospatial Consortium KML Standard}\n * @see {@link https://developers.google.com/kml/|Google KML Documentation}\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=KML.html|Cesium Sandcastle KML Demo}\n *\n * @example\n * const viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/facilities.kmz',\n *      {\n *           camera: viewer.scene.camera,\n *           canvas: viewer.scene.canvas\n *      })\n * );\n */\nfunction KmlDataSource(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const camera = options.camera;\n  const canvas = options.canvas;\n\n  this._changed = new Event();\n  this._error = new Event();\n  this._loading = new Event();\n  this._refresh = new Event();\n  this._unsupportedNode = new Event();\n\n  this._clock = undefined;\n  this._entityCollection = new EntityCollection(this);\n  this._name = undefined;\n  this._isLoading = false;\n  this._pinBuilder = new PinBuilder();\n  this._networkLinks = new AssociativeArray();\n  this._entityCluster = new EntityCluster();\n\n  /**\n   * The current size of this Canvas will be used to populate the Link parameters\n   * for client height and width.\n   *\n   * @type {HTMLCanvasElement | undefined}\n   */\n  this.canvas = canvas;\n\n  /**\n   * The position and orientation of this {@link Camera} will be used to\n   * populate various camera parameters when making network requests.\n   * Camera movement will determine when to trigger NetworkLink refresh if\n   * <code>viewRefreshMode</code> is <code>onStop</code>.\n   *\n   * @type {Camera | undefined}\n   */\n  this.camera = camera;\n\n  this._lastCameraView = {\n    position: defined(camera) ? Cartesian3.clone(camera.positionWC) : undefined,\n    direction: defined(camera)\n      ? Cartesian3.clone(camera.directionWC)\n      : undefined,\n    up: defined(camera) ? Cartesian3.clone(camera.upWC) : undefined,\n    bbox: defined(camera)\n      ? camera.computeViewRectangle()\n      : Rectangle.clone(Rectangle.MAX_VALUE),\n  };\n\n  this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n  // User specified credit\n  let credit = options.credit;\n  if (typeof credit === \"string\") {\n    credit = new Credit(credit);\n  }\n  this._credit = credit;\n\n  // Create a list of Credit's from the resource that the user can't remove\n  this._resourceCredits = [];\n\n  this._kmlTours = [];\n\n  this._screenOverlays = [];\n}\n\n/**\n * Creates a Promise to a new instance loaded with the provided KML data.\n *\n * @param {Resource|string|Document|Blob} data A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.\n * @param {KmlDataSource.ConstructorOptions} [options] An object specifying configuration options\n *\n * @returns {Promise<KmlDataSource>} A promise that will resolve to a new KmlDataSource instance once the KML is loaded.\n */\nKmlDataSource.load = function (data, options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const dataSource = new KmlDataSource(options);\n  return dataSource.load(data, options);\n};\n\nObject.defineProperties(KmlDataSource.prototype, {\n  /**\n   * Gets or sets a human-readable name for this instance.\n   * This will be automatically be set to the KML document name on load.\n   * @memberof KmlDataSource.prototype\n   * @type {string}\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n    set: function (value) {\n      if (this._name !== value) {\n        this._name = value;\n        this._changed.raiseEvent(this);\n      }\n    },\n  },\n  /**\n   * Gets the clock settings defined by the loaded KML. This represents the total\n   * availability interval for all time-dynamic data. If the KML does not contain\n   * time-dynamic data, this value is undefined.\n   * @memberof KmlDataSource.prototype\n   * @type {DataSourceClock}\n   */\n  clock: {\n    get: function () {\n      return this._clock;\n    },\n  },\n  /**\n   * Gets the collection of {@link Entity} instances.\n   * @memberof KmlDataSource.prototype\n   * @type {EntityCollection}\n   */\n  entities: {\n    get: function () {\n      return this._entityCollection;\n    },\n  },\n  /**\n   * Gets a value indicating if the data source is currently loading data.\n   * @memberof KmlDataSource.prototype\n   * @type {boolean}\n   */\n  isLoading: {\n    get: function () {\n      return this._isLoading;\n    },\n  },\n  /**\n   * Gets an event that will be raised when the underlying data changes.\n   * @memberof KmlDataSource.prototype\n   * @type {Event}\n   */\n  changedEvent: {\n    get: function () {\n      return this._changed;\n    },\n  },\n  /**\n   * Gets an event that will be raised if an error is encountered during processing.\n   * @memberof KmlDataSource.prototype\n   * @type {Event}\n   */\n  errorEvent: {\n    get: function () {\n      return this._error;\n    },\n  },\n  /**\n   * Gets an event that will be raised when the data source either starts or stops loading.\n   * @memberof KmlDataSource.prototype\n   * @type {Event}\n   */\n  loadingEvent: {\n    get: function () {\n      return this._loading;\n    },\n  },\n  /**\n   * Gets an event that will be raised when the data source refreshes a network link.\n   * @memberof KmlDataSource.prototype\n   * @type {Event}\n   */\n  refreshEvent: {\n    get: function () {\n      return this._refresh;\n    },\n  },\n  /**\n   * Gets an event that will be raised when the data source finds an unsupported node type.\n   * @memberof KmlDataSource.prototype\n   * @type {Event}\n   */\n  unsupportedNodeEvent: {\n    get: function () {\n      return this._unsupportedNode;\n    },\n  },\n  /**\n   * Gets whether or not this data source should be displayed.\n   * @memberof KmlDataSource.prototype\n   * @type {boolean}\n   */\n  show: {\n    get: function () {\n      return this._entityCollection.show;\n    },\n    set: function (value) {\n      this._entityCollection.show = value;\n    },\n  },\n\n  /**\n   * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.\n   *\n   * @memberof KmlDataSource.prototype\n   * @type {EntityCluster}\n   */\n  clustering: {\n    get: function () {\n      return this._entityCluster;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value must be defined.\");\n      }\n      //>>includeEnd('debug');\n      this._entityCluster = value;\n    },\n  },\n  /**\n   * Gets the credit that will be displayed for the data source\n   * @memberof KmlDataSource.prototype\n   * @type {Credit}\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n  /**\n   * Gets the KML Tours that are used to guide the camera to specified destinations on given time intervals.\n   * @memberof KmlDataSource.prototype\n   * @type {KmlTour[]}\n   */\n  kmlTours: {\n    get: function () {\n      return this._kmlTours;\n    },\n  },\n});\n\n/**\n * Asynchronously loads the provided KML data, replacing any existing data.\n *\n * @param {Resource|string|Document|Blob} data A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.\n * @param {KmlDataSource.LoadOptions} [options] An object specifying configuration options\n *\n * @returns {Promise<KmlDataSource>} A promise that will resolve to this instances once the KML is loaded.\n */\nKmlDataSource.prototype.load = function (data, options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(data)) {\n    throw new DeveloperError(\"data is required.\");\n  }\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  DataSource.setLoading(this, true);\n\n  const oldName = this._name;\n  this._name = undefined;\n  this._clampToGround = defaultValue(options.clampToGround, false);\n\n  const that = this;\n  return load(this, this._entityCollection, data, options)\n    .then(function () {\n      let clock;\n\n      const availability = that._entityCollection.computeAvailability();\n\n      let start = availability.start;\n      let stop = availability.stop;\n      const isMinStart = JulianDate.equals(start, Iso8601.MINIMUM_VALUE);\n      const isMaxStop = JulianDate.equals(stop, Iso8601.MAXIMUM_VALUE);\n      if (!isMinStart || !isMaxStop) {\n        let date;\n\n        //If start is min time just start at midnight this morning, local time\n        if (isMinStart) {\n          date = new Date();\n          date.setHours(0, 0, 0, 0);\n          start = JulianDate.fromDate(date);\n        }\n\n        //If stop is max value just stop at midnight tonight, local time\n        if (isMaxStop) {\n          date = new Date();\n          date.setHours(24, 0, 0, 0);\n          stop = JulianDate.fromDate(date);\n        }\n\n        clock = new DataSourceClock();\n        clock.startTime = start;\n        clock.stopTime = stop;\n        clock.currentTime = JulianDate.clone(start);\n        clock.clockRange = ClockRange.LOOP_STOP;\n        clock.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n        clock.multiplier = Math.round(\n          Math.min(\n            Math.max(JulianDate.secondsDifference(stop, start) / 60, 1),\n            3.15569e7\n          )\n        );\n      }\n\n      let changed = false;\n      if (clock !== that._clock) {\n        that._clock = clock;\n        changed = true;\n      }\n\n      if (oldName !== that._name) {\n        changed = true;\n      }\n\n      if (changed) {\n        that._changed.raiseEvent(that);\n      }\n\n      DataSource.setLoading(that, false);\n\n      return that;\n    })\n    .catch(function (error) {\n      DataSource.setLoading(that, false);\n      that._error.raiseEvent(that, error);\n      console.log(error);\n      return Promise.reject(error);\n    });\n};\n\n/**\n * Cleans up any non-entity elements created by the data source. Currently this only affects ScreenOverlay elements.\n */\nKmlDataSource.prototype.destroy = function () {\n  while (this._screenOverlays.length > 0) {\n    const elem = this._screenOverlays.pop();\n    elem.remove();\n  }\n};\n\nfunction mergeAvailabilityWithParent(child) {\n  const parent = child.parent;\n  if (defined(parent)) {\n    const parentAvailability = parent.availability;\n    if (defined(parentAvailability)) {\n      const childAvailability = child.availability;\n      if (defined(childAvailability)) {\n        childAvailability.intersect(parentAvailability);\n      } else {\n        child.availability = parentAvailability;\n      }\n    }\n  }\n}\n\nfunction getNetworkLinkUpdateCallback(\n  dataSource,\n  networkLink,\n  newEntityCollection,\n  networkLinks,\n  processedHref\n) {\n  return function (rootElement) {\n    if (!networkLinks.contains(networkLink.id)) {\n      // Got into the odd case where a parent network link was updated while a child\n      //  network link update was in flight, so just throw it away.\n      return;\n    }\n    let remove = false;\n    const networkLinkControl = queryFirstNode(\n      rootElement,\n      \"NetworkLinkControl\",\n      namespaces.kml\n    );\n    const hasNetworkLinkControl = defined(networkLinkControl);\n\n    let minRefreshPeriod = 0;\n    if (hasNetworkLinkControl) {\n      if (\n        defined(queryFirstNode(networkLinkControl, \"Update\", namespaces.kml))\n      ) {\n        oneTimeWarning(\n          \"kml-networkLinkControl-update\",\n          \"KML - NetworkLinkControl updates aren't supported.\"\n        );\n        networkLink.updating = false;\n        networkLinks.remove(networkLink.id);\n        return;\n      }\n      networkLink.cookie = queryToObject(\n        defaultValue(\n          queryStringValue(networkLinkControl, \"cookie\", namespaces.kml),\n          \"\"\n        )\n      );\n      minRefreshPeriod = defaultValue(\n        queryNumericValue(\n          networkLinkControl,\n          \"minRefreshPeriod\",\n          namespaces.kml\n        ),\n        0\n      );\n    }\n\n    const now = JulianDate.now();\n    const refreshMode = networkLink.refreshMode;\n    if (refreshMode === RefreshMode.INTERVAL) {\n      if (defined(networkLinkControl)) {\n        networkLink.time = Math.max(minRefreshPeriod, networkLink.time);\n      }\n    } else if (refreshMode === RefreshMode.EXPIRE) {\n      let expires;\n      if (defined(networkLinkControl)) {\n        expires = queryStringValue(\n          networkLinkControl,\n          \"expires\",\n          namespaces.kml\n        );\n      }\n      if (defined(expires)) {\n        try {\n          const date = JulianDate.fromIso8601(expires);\n          const diff = JulianDate.secondsDifference(date, now);\n          if (diff > 0 && diff < minRefreshPeriod) {\n            JulianDate.addSeconds(now, minRefreshPeriod, date);\n          }\n          networkLink.time = date;\n        } catch (e) {\n          oneTimeWarning(\n            \"kml-networkLinkControl-expires\",\n            \"KML - NetworkLinkControl expires is not a valid date\"\n          );\n          remove = true;\n        }\n      } else {\n        oneTimeWarning(\n          \"kml-refreshMode-onExpire\",\n          \"KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element\"\n        );\n        remove = true;\n      }\n    }\n\n    const networkLinkEntity = networkLink.entity;\n    const entityCollection = dataSource._entityCollection;\n    const newEntities = newEntityCollection.values;\n\n    function removeChildren(entity) {\n      entityCollection.remove(entity);\n      const children = entity._children;\n      const count = children.length;\n      for (let i = 0; i < count; ++i) {\n        removeChildren(children[i]);\n      }\n    }\n\n    // Remove old entities\n    entityCollection.suspendEvents();\n    const entitiesCopy = entityCollection.values.slice();\n    let i;\n    for (i = 0; i < entitiesCopy.length; ++i) {\n      const entityToRemove = entitiesCopy[i];\n      if (entityToRemove.parent === networkLinkEntity) {\n        entityToRemove.parent = undefined;\n        removeChildren(entityToRemove);\n      }\n    }\n    entityCollection.resumeEvents();\n\n    // Add new entities\n    entityCollection.suspendEvents();\n    for (i = 0; i < newEntities.length; i++) {\n      const newEntity = newEntities[i];\n      if (!defined(newEntity.parent)) {\n        newEntity.parent = networkLinkEntity;\n        mergeAvailabilityWithParent(newEntity);\n      }\n      entityCollection.add(newEntity);\n    }\n    entityCollection.resumeEvents();\n\n    // No refresh information remove it, otherwise update lastUpdate time\n    if (remove) {\n      networkLinks.remove(networkLink.id);\n    } else {\n      networkLink.lastUpdated = now;\n    }\n\n    const availability = entityCollection.computeAvailability();\n\n    const start = availability.start;\n    const stop = availability.stop;\n    const isMinStart = JulianDate.equals(start, Iso8601.MINIMUM_VALUE);\n    const isMaxStop = JulianDate.equals(stop, Iso8601.MAXIMUM_VALUE);\n    if (!isMinStart || !isMaxStop) {\n      const clock = dataSource._clock;\n\n      if (clock.startTime !== start || clock.stopTime !== stop) {\n        clock.startTime = start;\n        clock.stopTime = stop;\n        dataSource._changed.raiseEvent(dataSource);\n      }\n    }\n\n    networkLink.updating = false;\n    networkLink.needsUpdate = false;\n    dataSource._refresh.raiseEvent(\n      dataSource,\n      processedHref.getUrlComponent(true)\n    );\n  };\n}\n\nconst entitiesToIgnore = new AssociativeArray();\n\n/**\n * Updates any NetworkLink that require updating.\n *\n * @param {JulianDate} time The simulation time.\n * @returns {boolean} True if this data source is ready to be displayed at the provided time, false otherwise.\n */\nKmlDataSource.prototype.update = function (time) {\n  const networkLinks = this._networkLinks;\n  if (networkLinks.length === 0) {\n    return true;\n  }\n\n  const now = JulianDate.now();\n  const that = this;\n\n  entitiesToIgnore.removeAll();\n\n  function recurseIgnoreEntities(entity) {\n    const children = entity._children;\n    const count = children.length;\n    for (let i = 0; i < count; ++i) {\n      const child = children[i];\n      entitiesToIgnore.set(child.id, child);\n      recurseIgnoreEntities(child);\n    }\n  }\n\n  let cameraViewUpdate = false;\n  const lastCameraView = this._lastCameraView;\n  const camera = this.camera;\n  if (\n    defined(camera) &&\n    !(\n      camera.positionWC.equalsEpsilon(\n        lastCameraView.position,\n        CesiumMath.EPSILON7\n      ) &&\n      camera.directionWC.equalsEpsilon(\n        lastCameraView.direction,\n        CesiumMath.EPSILON7\n      ) &&\n      camera.upWC.equalsEpsilon(lastCameraView.up, CesiumMath.EPSILON7)\n    )\n  ) {\n    // Camera has changed so update the last view\n    lastCameraView.position = Cartesian3.clone(camera.positionWC);\n    lastCameraView.direction = Cartesian3.clone(camera.directionWC);\n    lastCameraView.up = Cartesian3.clone(camera.upWC);\n    lastCameraView.bbox = camera.computeViewRectangle();\n    cameraViewUpdate = true;\n  }\n\n  const newNetworkLinks = new AssociativeArray();\n  let changed = false;\n  networkLinks.values.forEach(function (networkLink) {\n    const entity = networkLink.entity;\n    if (entitiesToIgnore.contains(entity.id)) {\n      return;\n    }\n\n    if (!networkLink.updating) {\n      let doUpdate = false;\n      if (networkLink.refreshMode === RefreshMode.INTERVAL) {\n        if (\n          JulianDate.secondsDifference(now, networkLink.lastUpdated) >\n          networkLink.time\n        ) {\n          doUpdate = true;\n        }\n      } else if (networkLink.refreshMode === RefreshMode.EXPIRE) {\n        if (JulianDate.greaterThan(now, networkLink.time)) {\n          doUpdate = true;\n        }\n      } else if (networkLink.refreshMode === RefreshMode.STOP) {\n        if (cameraViewUpdate) {\n          networkLink.needsUpdate = true;\n          networkLink.cameraUpdateTime = now;\n        }\n\n        if (\n          networkLink.needsUpdate &&\n          JulianDate.secondsDifference(now, networkLink.cameraUpdateTime) >=\n            networkLink.time\n        ) {\n          doUpdate = true;\n        }\n      }\n\n      if (doUpdate) {\n        recurseIgnoreEntities(entity);\n        networkLink.updating = true;\n        const newEntityCollection = new EntityCollection();\n        const href = networkLink.href.clone();\n\n        href.setQueryParameters(networkLink.cookie);\n        const ellipsoid = defaultValue(that._ellipsoid, Ellipsoid.WGS84);\n        processNetworkLinkQueryString(\n          href,\n          that.camera,\n          that.canvas,\n          networkLink.viewBoundScale,\n          lastCameraView.bbox,\n          ellipsoid\n        );\n\n        load(that, newEntityCollection, href, {\n          context: entity.id,\n        })\n          .then(\n            getNetworkLinkUpdateCallback(\n              that,\n              networkLink,\n              newEntityCollection,\n              newNetworkLinks,\n              href\n            )\n          )\n          .catch(function (error) {\n            const msg = `NetworkLink ${networkLink.href} refresh failed: ${error}`;\n            console.log(msg);\n            that._error.raiseEvent(that, msg);\n          });\n        changed = true;\n      }\n    }\n    newNetworkLinks.set(networkLink.id, networkLink);\n  });\n\n  if (changed) {\n    this._networkLinks = newNetworkLinks;\n    this._changed.raiseEvent(this);\n  }\n\n  return true;\n};\n\n/**\n * Contains KML Feature data loaded into the <code>Entity.kml</code> property by {@link KmlDataSource}.\n * @alias KmlFeatureData\n * @constructor\n */\nfunction KmlFeatureData() {\n  /**\n   * @typedef KmlFeatureData.Author\n   * @type {object}\n   * @property {string} name Gets the name.\n   * @property {string} uri Gets the URI.\n   * @property {number} age Gets the email.\n   */\n\n  /**\n   * Gets the atom syndication format author field.\n   * @type {KmlFeatureData.Author}\n   */\n  this.author = {\n    name: undefined,\n    uri: undefined,\n    email: undefined,\n  };\n\n  /**\n   * @typedef KmlFeatureData.Link\n   * @type {object}\n   * @property {string} href Gets the href.\n   * @property {string} hreflang Gets the language of the linked resource.\n   * @property {string} rel Gets the link relation.\n   * @property {string} type Gets the link type.\n   * @property {string} title Gets the link title.\n   * @property {string} length Gets the link length.\n   */\n\n  /**\n   * Gets the link.\n   * @type {KmlFeatureData.Link}\n   */\n  this.link = {\n    href: undefined,\n    hreflang: undefined,\n    rel: undefined,\n    type: undefined,\n    title: undefined,\n    length: undefined,\n  };\n\n  /**\n   * Gets the unstructured address field.\n   * @type {string}\n   */\n  this.address = undefined;\n  /**\n   * Gets the phone number.\n   * @type {string}\n   */\n  this.phoneNumber = undefined;\n  /**\n   * Gets the snippet.\n   * @type {string}\n   */\n  this.snippet = undefined;\n  /**\n   * Gets the extended data, parsed into a JSON object.\n   * Currently only the <code>Data</code> property is supported.\n   * <code>SchemaData</code> and custom data are ignored.\n   * @type {string}\n   */\n  this.extendedData = undefined;\n}\n\n// For testing\nKmlDataSource._DeferredLoading = DeferredLoading;\nKmlDataSource._getTimestamp = getTimestamp;\n\nexport default KmlDataSource;\n", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * This program is based on JZlib 1.0.2 ymnk, JCraft,Inc.\n * JZlib is based on zlib-1.1.3, so all credit should go authors\n * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)\n * and contributors of zlib.\n */\n\n// deno-lint-ignore-file no-this-alias prefer-const\n\n// Global\n\nconst MAX_BITS = 15;\nconst D_CODES = 30;\nconst BL_CODES = 19;\n\nconst LENGTH_CODES = 29;\nconst LITERALS = 256;\nconst L_CODES = (LITERALS + 1 + LENGTH_CODES);\nconst HEAP_SIZE = (2 * L_CODES + 1);\n\nconst END_BLOCK = 256;\n\n// Bit length codes must not exceed MAX_BL_BITS bits\nconst MAX_BL_BITS = 7;\n\n// repeat previous bit length 3-6 times (2 bits of repeat count)\nconst REP_3_6 = 16;\n\n// repeat a zero length 3-10 times (3 bits of repeat count)\nconst REPZ_3_10 = 17;\n\n// repeat a zero length 11-138 times (7 bits of repeat count)\nconst REPZ_11_138 = 18;\n\n// The lengths of the bit length codes are sent in order of decreasing\n// probability, to avoid transmitting the lengths for unused bit\n// length codes.\n\nconst Buf_size = 8 * 2;\n\n// JZlib version : \"1.0.2\"\nconst Z_DEFAULT_COMPRESSION = -1;\n\n// compression strategy\nconst Z_FILTERED = 1;\nconst Z_HUFFMAN_ONLY = 2;\nconst Z_DEFAULT_STRATEGY = 0;\n\nconst Z_NO_FLUSH = 0;\nconst Z_PARTIAL_FLUSH = 1;\nconst Z_FULL_FLUSH = 3;\nconst Z_FINISH = 4;\n\nconst Z_OK = 0;\nconst Z_STREAM_END = 1;\nconst Z_NEED_DICT = 2;\nconst Z_STREAM_ERROR = -2;\nconst Z_DATA_ERROR = -3;\nconst Z_BUF_ERROR = -5;\n\n// Tree\n\nfunction extractArray(array) {\n\treturn flatArray(array.map(([length, value]) => (new Array(length)).fill(value, 0, length)));\n}\n\nfunction flatArray(array) {\n\treturn array.reduce((a, b) => a.concat(Array.isArray(b) ? flatArray(b) : b), []);\n}\n\n// see definition of array dist_code below\nconst _dist_code = [0, 1, 2, 3].concat(...extractArray([\n\t[2, 4], [2, 5], [4, 6], [4, 7], [8, 8], [8, 9], [16, 10], [16, 11], [32, 12], [32, 13], [64, 14], [64, 15], [2, 0], [1, 16],\n\t[1, 17], [2, 18], [2, 19], [4, 20], [4, 21], [8, 22], [8, 23], [16, 24], [16, 25], [32, 26], [32, 27], [64, 28], [64, 29]\n]));\n\nfunction Tree() {\n\tconst that = this;\n\n\t// dyn_tree; // the dynamic tree\n\t// max_code; // largest code with non zero frequency\n\t// stat_desc; // the corresponding static tree\n\n\t// Compute the optimal bit lengths for a tree and update the total bit\n\t// length\n\t// for the current block.\n\t// IN assertion: the fields freq and dad are set, heap[heap_max] and\n\t// above are the tree nodes sorted by increasing frequency.\n\t// OUT assertions: the field len is set to the optimal bit length, the\n\t// array bl_count contains the frequencies for each bit length.\n\t// The length opt_len is updated; static_len is also updated if stree is\n\t// not null.\n\tfunction gen_bitlen(s) {\n\t\tconst tree = that.dyn_tree;\n\t\tconst stree = that.stat_desc.static_tree;\n\t\tconst extra = that.stat_desc.extra_bits;\n\t\tconst base = that.stat_desc.extra_base;\n\t\tconst max_length = that.stat_desc.max_length;\n\t\tlet h; // heap index\n\t\tlet n, m; // iterate over the tree elements\n\t\tlet bits; // bit length\n\t\tlet xbits; // extra bits\n\t\tlet f; // frequency\n\t\tlet overflow = 0; // number of elements with bit length too large\n\n\t\tfor (bits = 0; bits <= MAX_BITS; bits++)\n\t\t\ts.bl_count[bits] = 0;\n\n\t\t// In a first pass, compute the optimal bit lengths (which may\n\t\t// overflow in the case of the bit length tree).\n\t\ttree[s.heap[s.heap_max] * 2 + 1] = 0; // root of the heap\n\n\t\tfor (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n\t\t\tn = s.heap[h];\n\t\t\tbits = tree[tree[n * 2 + 1] * 2 + 1] + 1;\n\t\t\tif (bits > max_length) {\n\t\t\t\tbits = max_length;\n\t\t\t\toverflow++;\n\t\t\t}\n\t\t\ttree[n * 2 + 1] = bits;\n\t\t\t// We overwrite tree[n*2+1] which is no longer needed\n\n\t\t\tif (n > that.max_code)\n\t\t\t\tcontinue; // not a leaf node\n\n\t\t\ts.bl_count[bits]++;\n\t\t\txbits = 0;\n\t\t\tif (n >= base)\n\t\t\t\txbits = extra[n - base];\n\t\t\tf = tree[n * 2];\n\t\t\ts.opt_len += f * (bits + xbits);\n\t\t\tif (stree)\n\t\t\t\ts.static_len += f * (stree[n * 2 + 1] + xbits);\n\t\t}\n\t\tif (overflow === 0)\n\t\t\treturn;\n\n\t\t// This happens for example on obj2 and pic of the Calgary corpus\n\t\t// Find the first bit length which could increase:\n\t\tdo {\n\t\t\tbits = max_length - 1;\n\t\t\twhile (s.bl_count[bits] === 0)\n\t\t\t\tbits--;\n\t\t\ts.bl_count[bits]--; // move one leaf down the tree\n\t\t\ts.bl_count[bits + 1] += 2; // move one overflow item as its brother\n\t\t\ts.bl_count[max_length]--;\n\t\t\t// The brother of the overflow item also moves one step up,\n\t\t\t// but this does not affect bl_count[max_length]\n\t\t\toverflow -= 2;\n\t\t} while (overflow > 0);\n\n\t\tfor (bits = max_length; bits !== 0; bits--) {\n\t\t\tn = s.bl_count[bits];\n\t\t\twhile (n !== 0) {\n\t\t\t\tm = s.heap[--h];\n\t\t\t\tif (m > that.max_code)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (tree[m * 2 + 1] != bits) {\n\t\t\t\t\ts.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2];\n\t\t\t\t\ttree[m * 2 + 1] = bits;\n\t\t\t\t}\n\t\t\t\tn--;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Reverse the first len bits of a code, using straightforward code (a\n\t// faster\n\t// method would use a table)\n\t// IN assertion: 1 <= len <= 15\n\tfunction bi_reverse(code, // the value to invert\n\t\tlen // its bit length\n\t) {\n\t\tlet res = 0;\n\t\tdo {\n\t\t\tres |= code & 1;\n\t\t\tcode >>>= 1;\n\t\t\tres <<= 1;\n\t\t} while (--len > 0);\n\t\treturn res >>> 1;\n\t}\n\n\t// Generate the codes for a given tree and bit counts (which need not be\n\t// optimal).\n\t// IN assertion: the array bl_count contains the bit length statistics for\n\t// the given tree and the field len is set for all tree elements.\n\t// OUT assertion: the field code is set for all tree elements of non\n\t// zero code length.\n\tfunction gen_codes(tree, // the tree to decorate\n\t\tmax_code, // largest code with non zero frequency\n\t\tbl_count // number of codes at each bit length\n\t) {\n\t\tconst next_code = []; // next code value for each\n\t\t// bit length\n\t\tlet code = 0; // running code value\n\t\tlet bits; // bit index\n\t\tlet n; // code index\n\t\tlet len;\n\n\t\t// The distribution counts are first used to generate the code values\n\t\t// without bit reversal.\n\t\tfor (bits = 1; bits <= MAX_BITS; bits++) {\n\t\t\tnext_code[bits] = code = ((code + bl_count[bits - 1]) << 1);\n\t\t}\n\n\t\t// Check that the bit counts in bl_count are consistent. The last code\n\t\t// must be all ones.\n\t\t// Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n\t\t// \"inconsistent bit counts\");\n\t\t// Tracev((stderr,\"gen_codes: max_code %d \", max_code));\n\n\t\tfor (n = 0; n <= max_code; n++) {\n\t\t\tlen = tree[n * 2 + 1];\n\t\t\tif (len === 0)\n\t\t\t\tcontinue;\n\t\t\t// Now reverse the bits\n\t\t\ttree[n * 2] = bi_reverse(next_code[len]++, len);\n\t\t}\n\t}\n\n\t// Construct one Huffman tree and assigns the code bit strings and lengths.\n\t// Update the total bit length for the current block.\n\t// IN assertion: the field freq is set for all tree elements.\n\t// OUT assertions: the fields len and code are set to the optimal bit length\n\t// and corresponding code. The length opt_len is updated; static_len is\n\t// also updated if stree is not null. The field max_code is set.\n\tthat.build_tree = function (s) {\n\t\tconst tree = that.dyn_tree;\n\t\tconst stree = that.stat_desc.static_tree;\n\t\tconst elems = that.stat_desc.elems;\n\t\tlet n, m; // iterate over heap elements\n\t\tlet max_code = -1; // largest code with non zero frequency\n\t\tlet node; // new node being created\n\n\t\t// Construct the initial heap, with least frequent element in\n\t\t// heap[1]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n\t\t// heap[0] is not used.\n\t\ts.heap_len = 0;\n\t\ts.heap_max = HEAP_SIZE;\n\n\t\tfor (n = 0; n < elems; n++) {\n\t\t\tif (tree[n * 2] !== 0) {\n\t\t\t\ts.heap[++s.heap_len] = max_code = n;\n\t\t\t\ts.depth[n] = 0;\n\t\t\t} else {\n\t\t\t\ttree[n * 2 + 1] = 0;\n\t\t\t}\n\t\t}\n\n\t\t// The pkzip format requires that at least one distance code exists,\n\t\t// and that at least one bit should be sent even if there is only one\n\t\t// possible code. So to avoid special checks later on we force at least\n\t\t// two codes of non zero frequency.\n\t\twhile (s.heap_len < 2) {\n\t\t\tnode = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;\n\t\t\ttree[node * 2] = 1;\n\t\t\ts.depth[node] = 0;\n\t\t\ts.opt_len--;\n\t\t\tif (stree)\n\t\t\t\ts.static_len -= stree[node * 2 + 1];\n\t\t\t// node is 0 or 1 so it does not have extra bits\n\t\t}\n\t\tthat.max_code = max_code;\n\n\t\t// The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n\t\t// establish sub-heaps of increasing lengths:\n\n\t\tfor (n = Math.floor(s.heap_len / 2); n >= 1; n--)\n\t\t\ts.pqdownheap(tree, n);\n\n\t\t// Construct the Huffman tree by repeatedly combining the least two\n\t\t// frequent nodes.\n\n\t\tnode = elems; // next internal node of the tree\n\t\tdo {\n\t\t\t// n = node of least frequency\n\t\t\tn = s.heap[1];\n\t\t\ts.heap[1] = s.heap[s.heap_len--];\n\t\t\ts.pqdownheap(tree, 1);\n\t\t\tm = s.heap[1]; // m = node of next least frequency\n\n\t\t\ts.heap[--s.heap_max] = n; // keep the nodes sorted by frequency\n\t\t\ts.heap[--s.heap_max] = m;\n\n\t\t\t// Create a new node father of n and m\n\t\t\ttree[node * 2] = (tree[n * 2] + tree[m * 2]);\n\t\t\ts.depth[node] = Math.max(s.depth[n], s.depth[m]) + 1;\n\t\t\ttree[n * 2 + 1] = tree[m * 2 + 1] = node;\n\n\t\t\t// and insert the new node in the heap\n\t\t\ts.heap[1] = node++;\n\t\t\ts.pqdownheap(tree, 1);\n\t\t} while (s.heap_len >= 2);\n\n\t\ts.heap[--s.heap_max] = s.heap[1];\n\n\t\t// At this point, the fields freq and dad are set. We can now\n\t\t// generate the bit lengths.\n\n\t\tgen_bitlen(s);\n\n\t\t// The field len is now set, we can generate the bit codes\n\t\tgen_codes(tree, that.max_code, s.bl_count);\n\t};\n\n}\n\nTree._length_code = [0, 1, 2, 3, 4, 5, 6, 7].concat(...extractArray([\n\t[2, 8], [2, 9], [2, 10], [2, 11], [4, 12], [4, 13], [4, 14], [4, 15], [8, 16], [8, 17], [8, 18], [8, 19],\n\t[16, 20], [16, 21], [16, 22], [16, 23], [32, 24], [32, 25], [32, 26], [31, 27], [1, 28]]));\n\nTree.base_length = [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 0];\n\nTree.base_dist = [0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384,\n\t24576];\n\n// Mapping from a distance to a distance code. dist is the distance - 1 and\n// must not have side effects. _dist_code[256] and _dist_code[257] are never\n// used.\nTree.d_code = function (dist) {\n\treturn ((dist) < 256 ? _dist_code[dist] : _dist_code[256 + ((dist) >>> 7)]);\n};\n\n// extra bits for each length code\nTree.extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0];\n\n// extra bits for each distance code\nTree.extra_dbits = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];\n\n// extra bits for each bit length code\nTree.extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7];\n\nTree.bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n\n// StaticTree\n\nfunction StaticTree(static_tree, extra_bits, extra_base, elems, max_length) {\n\tconst that = this;\n\tthat.static_tree = static_tree;\n\tthat.extra_bits = extra_bits;\n\tthat.extra_base = extra_base;\n\tthat.elems = elems;\n\tthat.max_length = max_length;\n}\n\nconst static_ltree2_first_part = [12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252, 2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82,\n\t210, 50, 178, 114, 242, 10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250, 6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86,\n\t214, 54, 182, 118, 246, 14, 142, 78, 206, 46, 174, 110, 238, 30, 158, 94, 222, 62, 190, 126, 254, 1, 129, 65, 193, 33, 161, 97, 225, 17, 145, 81,\n\t209, 49, 177, 113, 241, 9, 137, 73, 201, 41, 169, 105, 233, 25, 153, 89, 217, 57, 185, 121, 249, 5, 133, 69, 197, 37, 165, 101, 229, 21, 149, 85,\n\t213, 53, 181, 117, 245, 13, 141, 77, 205, 45, 173, 109, 237, 29, 157, 93, 221, 61, 189, 125, 253, 19, 275, 147, 403, 83, 339, 211, 467, 51, 307,\n\t179, 435, 115, 371, 243, 499, 11, 267, 139, 395, 75, 331, 203, 459, 43, 299, 171, 427, 107, 363, 235, 491, 27, 283, 155, 411, 91, 347, 219, 475,\n\t59, 315, 187, 443, 123, 379, 251, 507, 7, 263, 135, 391, 71, 327, 199, 455, 39, 295, 167, 423, 103, 359, 231, 487, 23, 279, 151, 407, 87, 343, 215,\n\t471, 55, 311, 183, 439, 119, 375, 247, 503, 15, 271, 143, 399, 79, 335, 207, 463, 47, 303, 175, 431, 111, 367, 239, 495, 31, 287, 159, 415, 95,\n\t351, 223, 479, 63, 319, 191, 447, 127, 383, 255, 511, 0, 64, 32, 96, 16, 80, 48, 112, 8, 72, 40, 104, 24, 88, 56, 120, 4, 68, 36, 100, 20, 84, 52,\n\t116, 3, 131, 67, 195, 35, 163, 99, 227];\nconst static_ltree2_second_part = extractArray([[144, 8], [112, 9], [24, 7], [8, 8]]);\nStaticTree.static_ltree = flatArray(static_ltree2_first_part.map((value, index) => [value, static_ltree2_second_part[index]]));\n\nconst static_dtree_first_part = [0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22, 14, 30, 1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23];\nconst static_dtree_second_part = extractArray([[30, 5]]);\nStaticTree.static_dtree = flatArray(static_dtree_first_part.map((value, index) => [value, static_dtree_second_part[index]]));\n\nStaticTree.static_l_desc = new StaticTree(StaticTree.static_ltree, Tree.extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n\nStaticTree.static_d_desc = new StaticTree(StaticTree.static_dtree, Tree.extra_dbits, 0, D_CODES, MAX_BITS);\n\nStaticTree.static_bl_desc = new StaticTree(null, Tree.extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n// Deflate\n\nconst MAX_MEM_LEVEL = 9;\nconst DEF_MEM_LEVEL = 8;\n\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n\tconst that = this;\n\tthat.good_length = good_length;\n\tthat.max_lazy = max_lazy;\n\tthat.nice_length = nice_length;\n\tthat.max_chain = max_chain;\n\tthat.func = func;\n}\n\nconst STORED = 0;\nconst FAST = 1;\nconst SLOW = 2;\nconst config_table = [\n\tnew Config(0, 0, 0, 0, STORED),\n\tnew Config(4, 4, 8, 4, FAST),\n\tnew Config(4, 5, 16, 8, FAST),\n\tnew Config(4, 6, 32, 32, FAST),\n\tnew Config(4, 4, 16, 16, SLOW),\n\tnew Config(8, 16, 32, 32, SLOW),\n\tnew Config(8, 16, 128, 128, SLOW),\n\tnew Config(8, 32, 128, 256, SLOW),\n\tnew Config(32, 128, 258, 1024, SLOW),\n\tnew Config(32, 258, 258, 4096, SLOW)\n];\n\nconst z_errmsg = [\"need dictionary\", // Z_NEED_DICT\n\t// 2\n\t\"stream end\", // Z_STREAM_END 1\n\t\"\", // Z_OK 0\n\t\"\", // Z_ERRNO (-1)\n\t\"stream error\", // Z_STREAM_ERROR (-2)\n\t\"data error\", // Z_DATA_ERROR (-3)\n\t\"\", // Z_MEM_ERROR (-4)\n\t\"buffer error\", // Z_BUF_ERROR (-5)\n\t\"\",// Z_VERSION_ERROR (-6)\n\t\"\"];\n\n// block not completed, need more input or more output\nconst NeedMore = 0;\n\n// block flush performed\nconst BlockDone = 1;\n\n// finish started, need only more output at next deflate\nconst FinishStarted = 2;\n\n// finish done, accept no more input or output\nconst FinishDone = 3;\n\n// preset dictionary flag in zlib header\nconst PRESET_DICT = 0x20;\n\nconst INIT_STATE = 42;\nconst BUSY_STATE = 113;\nconst FINISH_STATE = 666;\n\n// The deflate compression method\nconst Z_DEFLATED = 8;\n\nconst STORED_BLOCK = 0;\nconst STATIC_TREES = 1;\nconst DYN_TREES = 2;\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\nconst MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nfunction smaller(tree, n, m, depth) {\n\tconst tn2 = tree[n * 2];\n\tconst tm2 = tree[m * 2];\n\treturn (tn2 < tm2 || (tn2 == tm2 && depth[n] <= depth[m]));\n}\n\nfunction Deflate() {\n\n\tconst that = this;\n\tlet strm; // pointer back to this zlib stream\n\tlet status; // as the name implies\n\t// pending_buf; // output still pending\n\tlet pending_buf_size; // size of pending_buf\n\t// pending_out; // next pending byte to output to the stream\n\t// pending; // nb of bytes in the pending buffer\n\n\t// dist_buf; // buffer for distances\n\t// lc_buf; // buffer for literals or lengths\n\t// To simplify the code, dist_buf and lc_buf have the same number of elements.\n\t// To use different lengths, an extra flag array would be necessary.\n\n\tlet last_flush; // value of flush param for previous deflate call\n\n\tlet w_size; // LZ77 win size (32K by default)\n\tlet w_bits; // log2(w_size) (8..16)\n\tlet w_mask; // w_size - 1\n\n\tlet win;\n\t// Sliding win. Input bytes are read into the second half of the win,\n\t// and move to the first half later to keep a dictionary of at least wSize\n\t// bytes. With this organization, matches are limited to a distance of\n\t// wSize-MAX_MATCH bytes, but this ensures that IO is always\n\t// performed with a length multiple of the block size. Also, it limits\n\t// the win size to 64K, which is quite useful on MSDOS.\n\t// To do: use the user input buffer as sliding win.\n\n\tlet window_size;\n\t// Actual size of win: 2*wSize, except when the user input buffer\n\t// is directly used as sliding win.\n\n\tlet prev;\n\t// Link to older string with same hash index. To limit the size of this\n\t// array to 64K, this link is maintained only for the last 32K strings.\n\t// An index in this array is thus a win index modulo 32K.\n\n\tlet head; // Heads of the hash chains or NIL.\n\n\tlet ins_h; // hash index of string to be inserted\n\tlet hash_size; // number of elements in hash table\n\tlet hash_bits; // log2(hash_size)\n\tlet hash_mask; // hash_size-1\n\n\t// Number of bits by which ins_h must be shifted at each input\n\t// step. It must be such that after MIN_MATCH steps, the oldest\n\t// byte no longer takes part in the hash key, that is:\n\t// hash_shift * MIN_MATCH >= hash_bits\n\tlet hash_shift;\n\n\t// Window position at the beginning of the current output block. Gets\n\t// negative when the win is moved backwards.\n\n\tlet block_start;\n\n\tlet match_length; // length of best match\n\tlet prev_match; // previous match\n\tlet match_available; // set if previous match exists\n\tlet strstart; // start of string to insert\n\tlet match_start; // start of matching string\n\tlet lookahead; // number of valid bytes ahead in win\n\n\t// Length of the best match at previous step. Matches not greater than this\n\t// are discarded. This is used in the lazy match evaluation.\n\tlet prev_length;\n\n\t// To speed up deflation, hash chains are never searched beyond this\n\t// length. A higher limit improves compression ratio but degrades the speed.\n\tlet max_chain_length;\n\n\t// Attempt to find a better match only when the current match is strictly\n\t// smaller than this value. This mechanism is used only for compression\n\t// levels >= 4.\n\tlet max_lazy_match;\n\n\t// Insert new strings in the hash table only if the match length is not\n\t// greater than this length. This saves time but degrades compression.\n\t// max_insert_length is used only for compression levels <= 3.\n\n\tlet level; // compression level (1..9)\n\tlet strategy; // favor or force Huffman coding\n\n\t// Use a faster search when the previous match is longer than this\n\tlet good_match;\n\n\t// Stop searching when current match exceeds this\n\tlet nice_match;\n\n\tlet dyn_ltree; // literal and length tree\n\tlet dyn_dtree; // distance tree\n\tlet bl_tree; // Huffman tree for bit lengths\n\n\tconst l_desc = new Tree(); // desc for literal tree\n\tconst d_desc = new Tree(); // desc for distance tree\n\tconst bl_desc = new Tree(); // desc for bit length tree\n\n\t// that.heap_len; // number of elements in the heap\n\t// that.heap_max; // element of largest frequency\n\t// The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n\t// The same heap array is used to build all trees.\n\n\t// Depth of each subtree used as tie breaker for trees of equal frequency\n\tthat.depth = [];\n\n\t// Size of match buffer for literals/lengths. There are 4 reasons for\n\t// limiting lit_bufsize to 64K:\n\t// - frequencies can be kept in 16 bit counters\n\t// - if compression is not successful for the first block, all input\n\t// data is still in the win so we can still emit a stored block even\n\t// when input comes from standard input. (This can also be done for\n\t// all blocks if lit_bufsize is not greater than 32K.)\n\t// - if compression is not successful for a file smaller than 64K, we can\n\t// even emit a stored file instead of a stored block (saving 5 bytes).\n\t// This is applicable only for zip (not gzip or zlib).\n\t// - creating new Huffman trees less frequently may not provide fast\n\t// adaptation to changes in the input data statistics. (Take for\n\t// example a binary file with poorly compressible code followed by\n\t// a highly compressible string table.) Smaller buffer sizes give\n\t// fast adaptation but have of course the overhead of transmitting\n\t// trees more frequently.\n\t// - I can't count above 4\n\tlet lit_bufsize;\n\n\tlet last_lit; // running index in dist_buf and lc_buf\n\n\t// that.opt_len; // bit length of current block with optimal trees\n\t// that.static_len; // bit length of current block with static trees\n\tlet matches; // number of string matches in current block\n\tlet last_eob_len; // bit length of EOB code for last block\n\n\t// Output buffer. bits are inserted starting at the bottom (least\n\t// significant bits).\n\tlet bi_buf;\n\n\t// Number of valid bits in bi_buf. All bits above the last valid bit\n\t// are always zero.\n\tlet bi_valid;\n\n\t// number of codes at each bit length for an optimal tree\n\tthat.bl_count = [];\n\n\t// heap used to build the Huffman trees\n\tthat.heap = [];\n\n\tdyn_ltree = [];\n\tdyn_dtree = [];\n\tbl_tree = [];\n\n\tfunction lm_init() {\n\t\twindow_size = 2 * w_size;\n\n\t\thead[hash_size - 1] = 0;\n\t\tfor (let i = 0; i < hash_size - 1; i++) {\n\t\t\thead[i] = 0;\n\t\t}\n\n\t\t// Set the default configuration parameters:\n\t\tmax_lazy_match = config_table[level].max_lazy;\n\t\tgood_match = config_table[level].good_length;\n\t\tnice_match = config_table[level].nice_length;\n\t\tmax_chain_length = config_table[level].max_chain;\n\n\t\tstrstart = 0;\n\t\tblock_start = 0;\n\t\tlookahead = 0;\n\t\tmatch_length = prev_length = MIN_MATCH - 1;\n\t\tmatch_available = 0;\n\t\tins_h = 0;\n\t}\n\n\tfunction init_block() {\n\t\tlet i;\n\t\t// Initialize the trees.\n\t\tfor (i = 0; i < L_CODES; i++)\n\t\t\tdyn_ltree[i * 2] = 0;\n\t\tfor (i = 0; i < D_CODES; i++)\n\t\t\tdyn_dtree[i * 2] = 0;\n\t\tfor (i = 0; i < BL_CODES; i++)\n\t\t\tbl_tree[i * 2] = 0;\n\n\t\tdyn_ltree[END_BLOCK * 2] = 1;\n\t\tthat.opt_len = that.static_len = 0;\n\t\tlast_lit = matches = 0;\n\t}\n\n\t// Initialize the tree data structures for a new zlib stream.\n\tfunction tr_init() {\n\n\t\tl_desc.dyn_tree = dyn_ltree;\n\t\tl_desc.stat_desc = StaticTree.static_l_desc;\n\n\t\td_desc.dyn_tree = dyn_dtree;\n\t\td_desc.stat_desc = StaticTree.static_d_desc;\n\n\t\tbl_desc.dyn_tree = bl_tree;\n\t\tbl_desc.stat_desc = StaticTree.static_bl_desc;\n\n\t\tbi_buf = 0;\n\t\tbi_valid = 0;\n\t\tlast_eob_len = 8; // enough lookahead for inflate\n\n\t\t// Initialize the first block of the first file:\n\t\tinit_block();\n\t}\n\n\t// Restore the heap property by moving down the tree starting at node k,\n\t// exchanging a node with the smallest of its two sons if necessary,\n\t// stopping\n\t// when the heap property is re-established (each father smaller than its\n\t// two sons).\n\tthat.pqdownheap = function (tree, // the tree to restore\n\t\tk // node to move down\n\t) {\n\t\tconst heap = that.heap;\n\t\tconst v = heap[k];\n\t\tlet j = k << 1; // left son of k\n\t\twhile (j <= that.heap_len) {\n\t\t\t// Set j to the smallest of the two sons:\n\t\t\tif (j < that.heap_len && smaller(tree, heap[j + 1], heap[j], that.depth)) {\n\t\t\t\tj++;\n\t\t\t}\n\t\t\t// Exit if v is smaller than both sons\n\t\t\tif (smaller(tree, v, heap[j], that.depth))\n\t\t\t\tbreak;\n\n\t\t\t// Exchange v with the smallest son\n\t\t\theap[k] = heap[j];\n\t\t\tk = j;\n\t\t\t// And continue down the tree, setting j to the left son of k\n\t\t\tj <<= 1;\n\t\t}\n\t\theap[k] = v;\n\t};\n\n\t// Scan a literal or distance tree to determine the frequencies of the codes\n\t// in the bit length tree.\n\tfunction scan_tree(tree,// the tree to be scanned\n\t\tmax_code // and its largest code of non zero frequency\n\t) {\n\t\tlet prevlen = -1; // last emitted length\n\t\tlet curlen; // length of current code\n\t\tlet nextlen = tree[0 * 2 + 1]; // length of next code\n\t\tlet count = 0; // repeat count of the current code\n\t\tlet max_count = 7; // max repeat count\n\t\tlet min_count = 4; // min repeat count\n\n\t\tif (nextlen === 0) {\n\t\t\tmax_count = 138;\n\t\t\tmin_count = 3;\n\t\t}\n\t\ttree[(max_code + 1) * 2 + 1] = 0xffff; // guard\n\n\t\tfor (let n = 0; n <= max_code; n++) {\n\t\t\tcurlen = nextlen;\n\t\t\tnextlen = tree[(n + 1) * 2 + 1];\n\t\t\tif (++count < max_count && curlen == nextlen) {\n\t\t\t\tcontinue;\n\t\t\t} else if (count < min_count) {\n\t\t\t\tbl_tree[curlen * 2] += count;\n\t\t\t} else if (curlen !== 0) {\n\t\t\t\tif (curlen != prevlen)\n\t\t\t\t\tbl_tree[curlen * 2]++;\n\t\t\t\tbl_tree[REP_3_6 * 2]++;\n\t\t\t} else if (count <= 10) {\n\t\t\t\tbl_tree[REPZ_3_10 * 2]++;\n\t\t\t} else {\n\t\t\t\tbl_tree[REPZ_11_138 * 2]++;\n\t\t\t}\n\t\t\tcount = 0;\n\t\t\tprevlen = curlen;\n\t\t\tif (nextlen === 0) {\n\t\t\t\tmax_count = 138;\n\t\t\t\tmin_count = 3;\n\t\t\t} else if (curlen == nextlen) {\n\t\t\t\tmax_count = 6;\n\t\t\t\tmin_count = 3;\n\t\t\t} else {\n\t\t\t\tmax_count = 7;\n\t\t\t\tmin_count = 4;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Construct the Huffman tree for the bit lengths and return the index in\n\t// bl_order of the last bit length code to send.\n\tfunction build_bl_tree() {\n\t\tlet max_blindex; // index of last bit length code of non zero freq\n\n\t\t// Determine the bit length frequencies for literal and distance trees\n\t\tscan_tree(dyn_ltree, l_desc.max_code);\n\t\tscan_tree(dyn_dtree, d_desc.max_code);\n\n\t\t// Build the bit length tree:\n\t\tbl_desc.build_tree(that);\n\t\t// opt_len now includes the length of the tree representations, except\n\t\t// the lengths of the bit lengths codes and the 5+5+4 bits for the\n\t\t// counts.\n\n\t\t// Determine the number of bit length codes to send. The pkzip format\n\t\t// requires that at least 4 bit length codes be sent. (appnote.txt says\n\t\t// 3 but the actual value used is 4.)\n\t\tfor (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t\t\tif (bl_tree[Tree.bl_order[max_blindex] * 2 + 1] !== 0)\n\t\t\t\tbreak;\n\t\t}\n\t\t// Update opt_len to include the bit length tree and counts\n\t\tthat.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\n\t\treturn max_blindex;\n\t}\n\n\t// Output a byte on the stream.\n\t// IN assertion: there is enough room in pending_buf.\n\tfunction put_byte(p) {\n\t\tthat.pending_buf[that.pending++] = p;\n\t}\n\n\tfunction put_short(w) {\n\t\tput_byte(w & 0xff);\n\t\tput_byte((w >>> 8) & 0xff);\n\t}\n\n\tfunction putShortMSB(b) {\n\t\tput_byte((b >> 8) & 0xff);\n\t\tput_byte((b & 0xff) & 0xff);\n\t}\n\n\tfunction send_bits(value, length) {\n\t\tlet val;\n\t\tconst len = length;\n\t\tif (bi_valid > Buf_size - len) {\n\t\t\tval = value;\n\t\t\t// bi_buf |= (val << bi_valid);\n\t\t\tbi_buf |= ((val << bi_valid) & 0xffff);\n\t\t\tput_short(bi_buf);\n\t\t\tbi_buf = val >>> (Buf_size - bi_valid);\n\t\t\tbi_valid += len - Buf_size;\n\t\t} else {\n\t\t\t// bi_buf |= (value) << bi_valid;\n\t\t\tbi_buf |= (((value) << bi_valid) & 0xffff);\n\t\t\tbi_valid += len;\n\t\t}\n\t}\n\n\tfunction send_code(c, tree) {\n\t\tconst c2 = c * 2;\n\t\tsend_bits(tree[c2] & 0xffff, tree[c2 + 1] & 0xffff);\n\t}\n\n\t// Send a literal or distance tree in compressed form, using the codes in\n\t// bl_tree.\n\tfunction send_tree(tree,// the tree to be sent\n\t\tmax_code // and its largest code of non zero frequency\n\t) {\n\t\tlet n; // iterates over all tree elements\n\t\tlet prevlen = -1; // last emitted length\n\t\tlet curlen; // length of current code\n\t\tlet nextlen = tree[0 * 2 + 1]; // length of next code\n\t\tlet count = 0; // repeat count of the current code\n\t\tlet max_count = 7; // max repeat count\n\t\tlet min_count = 4; // min repeat count\n\n\t\tif (nextlen === 0) {\n\t\t\tmax_count = 138;\n\t\t\tmin_count = 3;\n\t\t}\n\n\t\tfor (n = 0; n <= max_code; n++) {\n\t\t\tcurlen = nextlen;\n\t\t\tnextlen = tree[(n + 1) * 2 + 1];\n\t\t\tif (++count < max_count && curlen == nextlen) {\n\t\t\t\tcontinue;\n\t\t\t} else if (count < min_count) {\n\t\t\t\tdo {\n\t\t\t\t\tsend_code(curlen, bl_tree);\n\t\t\t\t} while (--count !== 0);\n\t\t\t} else if (curlen !== 0) {\n\t\t\t\tif (curlen != prevlen) {\n\t\t\t\t\tsend_code(curlen, bl_tree);\n\t\t\t\t\tcount--;\n\t\t\t\t}\n\t\t\t\tsend_code(REP_3_6, bl_tree);\n\t\t\t\tsend_bits(count - 3, 2);\n\t\t\t} else if (count <= 10) {\n\t\t\t\tsend_code(REPZ_3_10, bl_tree);\n\t\t\t\tsend_bits(count - 3, 3);\n\t\t\t} else {\n\t\t\t\tsend_code(REPZ_11_138, bl_tree);\n\t\t\t\tsend_bits(count - 11, 7);\n\t\t\t}\n\t\t\tcount = 0;\n\t\t\tprevlen = curlen;\n\t\t\tif (nextlen === 0) {\n\t\t\t\tmax_count = 138;\n\t\t\t\tmin_count = 3;\n\t\t\t} else if (curlen == nextlen) {\n\t\t\t\tmax_count = 6;\n\t\t\t\tmin_count = 3;\n\t\t\t} else {\n\t\t\t\tmax_count = 7;\n\t\t\t\tmin_count = 4;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Send the header for a block using dynamic Huffman trees: the counts, the\n\t// lengths of the bit length codes, the literal tree and the distance tree.\n\t// IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n\tfunction send_all_trees(lcodes, dcodes, blcodes) {\n\t\tlet rank; // index in bl_order\n\n\t\tsend_bits(lcodes - 257, 5); // not +255 as stated in appnote.txt\n\t\tsend_bits(dcodes - 1, 5);\n\t\tsend_bits(blcodes - 4, 4); // not -3 as stated in appnote.txt\n\t\tfor (rank = 0; rank < blcodes; rank++) {\n\t\t\tsend_bits(bl_tree[Tree.bl_order[rank] * 2 + 1], 3);\n\t\t}\n\t\tsend_tree(dyn_ltree, lcodes - 1); // literal tree\n\t\tsend_tree(dyn_dtree, dcodes - 1); // distance tree\n\t}\n\n\t// Flush the bit buffer, keeping at most 7 bits in it.\n\tfunction bi_flush() {\n\t\tif (bi_valid == 16) {\n\t\t\tput_short(bi_buf);\n\t\t\tbi_buf = 0;\n\t\t\tbi_valid = 0;\n\t\t} else if (bi_valid >= 8) {\n\t\t\tput_byte(bi_buf & 0xff);\n\t\t\tbi_buf >>>= 8;\n\t\t\tbi_valid -= 8;\n\t\t}\n\t}\n\n\t// Send one empty static block to give enough lookahead for inflate.\n\t// This takes 10 bits, of which 7 may remain in the bit buffer.\n\t// The current inflate code requires 9 bits of lookahead. If the\n\t// last two codes for the previous block (real code plus EOB) were coded\n\t// on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode\n\t// the last real code. In this case we send two empty static blocks instead\n\t// of one. (There are no problems if the previous block is stored or fixed.)\n\t// To simplify the code, we assume the worst case of last real code encoded\n\t// on one bit only.\n\tfunction _tr_align() {\n\t\tsend_bits(STATIC_TREES << 1, 3);\n\t\tsend_code(END_BLOCK, StaticTree.static_ltree);\n\n\t\tbi_flush();\n\n\t\t// Of the 10 bits for the empty block, we have already sent\n\t\t// (10 - bi_valid) bits. The lookahead for the last real code (before\n\t\t// the EOB of the previous block) was thus at least one plus the length\n\t\t// of the EOB plus what we have just sent of the empty static block.\n\t\tif (1 + last_eob_len + 10 - bi_valid < 9) {\n\t\t\tsend_bits(STATIC_TREES << 1, 3);\n\t\t\tsend_code(END_BLOCK, StaticTree.static_ltree);\n\t\t\tbi_flush();\n\t\t}\n\t\tlast_eob_len = 7;\n\t}\n\n\t// Save the match info and tally the frequency counts. Return true if\n\t// the current block must be flushed.\n\tfunction _tr_tally(dist, // distance of matched string\n\t\tlc // match length-MIN_MATCH or unmatched char (if dist==0)\n\t) {\n\t\tlet out_length, in_length, dcode;\n\t\tthat.dist_buf[last_lit] = dist;\n\t\tthat.lc_buf[last_lit] = lc & 0xff;\n\t\tlast_lit++;\n\n\t\tif (dist === 0) {\n\t\t\t// lc is the unmatched char\n\t\t\tdyn_ltree[lc * 2]++;\n\t\t} else {\n\t\t\tmatches++;\n\t\t\t// Here, lc is the match length - MIN_MATCH\n\t\t\tdist--; // dist = match distance - 1\n\t\t\tdyn_ltree[(Tree._length_code[lc] + LITERALS + 1) * 2]++;\n\t\t\tdyn_dtree[Tree.d_code(dist) * 2]++;\n\t\t}\n\n\t\tif ((last_lit & 0x1fff) === 0 && level > 2) {\n\t\t\t// Compute an upper bound for the compressed length\n\t\t\tout_length = last_lit * 8;\n\t\t\tin_length = strstart - block_start;\n\t\t\tfor (dcode = 0; dcode < D_CODES; dcode++) {\n\t\t\t\tout_length += dyn_dtree[dcode * 2] * (5 + Tree.extra_dbits[dcode]);\n\t\t\t}\n\t\t\tout_length >>>= 3;\n\t\t\tif ((matches < Math.floor(last_lit / 2)) && out_length < Math.floor(in_length / 2))\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn (last_lit == lit_bufsize - 1);\n\t\t// We avoid equality with lit_bufsize because of wraparound at 64K\n\t\t// on 16 bit machines and because stored blocks are restricted to\n\t\t// 64K-1 bytes.\n\t}\n\n\t// Send the block data compressed using the given Huffman trees\n\tfunction compress_block(ltree, dtree) {\n\t\tlet dist; // distance of matched string\n\t\tlet lc; // match length or unmatched char (if dist === 0)\n\t\tlet lx = 0; // running index in dist_buf and lc_buf\n\t\tlet code; // the code to send\n\t\tlet extra; // number of extra bits to send\n\n\t\tif (last_lit !== 0) {\n\t\t\tdo {\n\t\t\t\tdist = that.dist_buf[lx];\n\t\t\t\tlc = that.lc_buf[lx];\n\t\t\t\tlx++;\n\n\t\t\t\tif (dist === 0) {\n\t\t\t\t\tsend_code(lc, ltree); // send a literal byte\n\t\t\t\t} else {\n\t\t\t\t\t// Here, lc is the match length - MIN_MATCH\n\t\t\t\t\tcode = Tree._length_code[lc];\n\n\t\t\t\t\tsend_code(code + LITERALS + 1, ltree); // send the length\n\t\t\t\t\t// code\n\t\t\t\t\textra = Tree.extra_lbits[code];\n\t\t\t\t\tif (extra !== 0) {\n\t\t\t\t\t\tlc -= Tree.base_length[code];\n\t\t\t\t\t\tsend_bits(lc, extra); // send the extra length bits\n\t\t\t\t\t}\n\t\t\t\t\tdist--; // dist is now the match distance - 1\n\t\t\t\t\tcode = Tree.d_code(dist);\n\n\t\t\t\t\tsend_code(code, dtree); // send the distance code\n\t\t\t\t\textra = Tree.extra_dbits[code];\n\t\t\t\t\tif (extra !== 0) {\n\t\t\t\t\t\tdist -= Tree.base_dist[code];\n\t\t\t\t\t\tsend_bits(dist, extra); // send the extra distance bits\n\t\t\t\t\t}\n\t\t\t\t} // literal or match pair ?\n\t\t\t} while (lx < last_lit);\n\t\t}\n\n\t\tsend_code(END_BLOCK, ltree);\n\t\tlast_eob_len = ltree[END_BLOCK * 2 + 1];\n\t}\n\n\t// Flush the bit buffer and align the output on a byte boundary\n\tfunction bi_windup() {\n\t\tif (bi_valid > 8) {\n\t\t\tput_short(bi_buf);\n\t\t} else if (bi_valid > 0) {\n\t\t\tput_byte(bi_buf & 0xff);\n\t\t}\n\t\tbi_buf = 0;\n\t\tbi_valid = 0;\n\t}\n\n\t// Copy a stored block, storing first the length and its\n\t// one's complement if requested.\n\tfunction copy_block(buf, // the input data\n\t\tlen, // its length\n\t\theader // true if block header must be written\n\t) {\n\t\tbi_windup(); // align on byte boundary\n\t\tlast_eob_len = 8; // enough lookahead for inflate\n\n\t\tif (header) {\n\t\t\tput_short(len);\n\t\t\tput_short(~len);\n\t\t}\n\n\t\tthat.pending_buf.set(win.subarray(buf, buf + len), that.pending);\n\t\tthat.pending += len;\n\t}\n\n\t// Send a stored block\n\tfunction _tr_stored_block(buf, // input block\n\t\tstored_len, // length of input block\n\t\teof // true if this is the last block for a file\n\t) {\n\t\tsend_bits((STORED_BLOCK << 1) + (eof ? 1 : 0), 3); // send block type\n\t\tcopy_block(buf, stored_len, true); // with header\n\t}\n\n\t// Determine the best encoding for the current block: dynamic trees, static\n\t// trees or store, and output the encoded block to the zip file.\n\tfunction _tr_flush_block(buf, // input block, or NULL if too old\n\t\tstored_len, // length of input block\n\t\teof // true if this is the last block for a file\n\t) {\n\t\tlet opt_lenb, static_lenb;// opt_len and static_len in bytes\n\t\tlet max_blindex = 0; // index of last bit length code of non zero freq\n\n\t\t// Build the Huffman trees unless a stored block is forced\n\t\tif (level > 0) {\n\t\t\t// Construct the literal and distance trees\n\t\t\tl_desc.build_tree(that);\n\n\t\t\td_desc.build_tree(that);\n\n\t\t\t// At this point, opt_len and static_len are the total bit lengths\n\t\t\t// of\n\t\t\t// the compressed block data, excluding the tree representations.\n\n\t\t\t// Build the bit length tree for the above two trees, and get the\n\t\t\t// index\n\t\t\t// in bl_order of the last bit length code to send.\n\t\t\tmax_blindex = build_bl_tree();\n\n\t\t\t// Determine the best encoding. Compute first the block length in\n\t\t\t// bytes\n\t\t\topt_lenb = (that.opt_len + 3 + 7) >>> 3;\n\t\t\tstatic_lenb = (that.static_len + 3 + 7) >>> 3;\n\n\t\t\tif (static_lenb <= opt_lenb)\n\t\t\t\topt_lenb = static_lenb;\n\t\t} else {\n\t\t\topt_lenb = static_lenb = stored_len + 5; // force a stored block\n\t\t}\n\n\t\tif ((stored_len + 4 <= opt_lenb) && buf != -1) {\n\t\t\t// 4: two words for the lengths\n\t\t\t// The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n\t\t\t// Otherwise we can't have processed more than WSIZE input bytes\n\t\t\t// since\n\t\t\t// the last block flush, because compression would have been\n\t\t\t// successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n\t\t\t// transform a block into a stored block.\n\t\t\t_tr_stored_block(buf, stored_len, eof);\n\t\t} else if (static_lenb == opt_lenb) {\n\t\t\tsend_bits((STATIC_TREES << 1) + (eof ? 1 : 0), 3);\n\t\t\tcompress_block(StaticTree.static_ltree, StaticTree.static_dtree);\n\t\t} else {\n\t\t\tsend_bits((DYN_TREES << 1) + (eof ? 1 : 0), 3);\n\t\t\tsend_all_trees(l_desc.max_code + 1, d_desc.max_code + 1, max_blindex + 1);\n\t\t\tcompress_block(dyn_ltree, dyn_dtree);\n\t\t}\n\n\t\t// The above check is made mod 2^32, for files larger than 512 MB\n\t\t// and uLong implemented on 32 bits.\n\n\t\tinit_block();\n\n\t\tif (eof) {\n\t\t\tbi_windup();\n\t\t}\n\t}\n\n\tfunction flush_block_only(eof) {\n\t\t_tr_flush_block(block_start >= 0 ? block_start : -1, strstart - block_start, eof);\n\t\tblock_start = strstart;\n\t\tstrm.flush_pending();\n\t}\n\n\t// Fill the win when the lookahead becomes insufficient.\n\t// Updates strstart and lookahead.\n\t//\n\t// IN assertion: lookahead < MIN_LOOKAHEAD\n\t// OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n\t// At least one byte has been read, or avail_in === 0; reads are\n\t// performed for at least two bytes (required for the zip translate_eol\n\t// option -- not supported here).\n\tfunction fill_window() {\n\t\tlet n, m;\n\t\tlet p;\n\t\tlet more; // Amount of free space at the end of the win.\n\n\t\tdo {\n\t\t\tmore = (window_size - lookahead - strstart);\n\n\t\t\t// Deal with !@#$% 64K limit:\n\t\t\tif (more === 0 && strstart === 0 && lookahead === 0) {\n\t\t\t\tmore = w_size;\n\t\t\t} else if (more == -1) {\n\t\t\t\t// Very unlikely, but possible on 16 bit machine if strstart ==\n\t\t\t\t// 0\n\t\t\t\t// and lookahead == 1 (input done one byte at time)\n\t\t\t\tmore--;\n\n\t\t\t\t// If the win is almost full and there is insufficient\n\t\t\t\t// lookahead,\n\t\t\t\t// move the upper half to the lower one to make room in the\n\t\t\t\t// upper half.\n\t\t\t} else if (strstart >= w_size + w_size - MIN_LOOKAHEAD) {\n\t\t\t\twin.set(win.subarray(w_size, w_size + w_size), 0);\n\n\t\t\t\tmatch_start -= w_size;\n\t\t\t\tstrstart -= w_size; // we now have strstart >= MAX_DIST\n\t\t\t\tblock_start -= w_size;\n\n\t\t\t\t// Slide the hash table (could be avoided with 32 bit values\n\t\t\t\t// at the expense of memory usage). We slide even when level ==\n\t\t\t\t// 0\n\t\t\t\t// to keep the hash table consistent if we switch back to level\n\t\t\t\t// > 0\n\t\t\t\t// later. (Using level 0 permanently is not an optimal usage of\n\t\t\t\t// zlib, so we don't care about this pathological case.)\n\n\t\t\t\tn = hash_size;\n\t\t\t\tp = n;\n\t\t\t\tdo {\n\t\t\t\t\tm = (head[--p] & 0xffff);\n\t\t\t\t\thead[p] = (m >= w_size ? m - w_size : 0);\n\t\t\t\t} while (--n !== 0);\n\n\t\t\t\tn = w_size;\n\t\t\t\tp = n;\n\t\t\t\tdo {\n\t\t\t\t\tm = (prev[--p] & 0xffff);\n\t\t\t\t\tprev[p] = (m >= w_size ? m - w_size : 0);\n\t\t\t\t\t// If n is not on any hash chain, prev[n] is garbage but\n\t\t\t\t\t// its value will never be used.\n\t\t\t\t} while (--n !== 0);\n\t\t\t\tmore += w_size;\n\t\t\t}\n\n\t\t\tif (strm.avail_in === 0)\n\t\t\t\treturn;\n\n\t\t\t// If there was no sliding:\n\t\t\t// strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n\t\t\t// more == window_size - lookahead - strstart\n\t\t\t// => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n\t\t\t// => more >= window_size - 2*WSIZE + 2\n\t\t\t// In the BIG_MEM or MMAP case (not yet supported),\n\t\t\t// window_size == input_size + MIN_LOOKAHEAD &&\n\t\t\t// strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n\t\t\t// Otherwise, window_size == 2*WSIZE so more >= 2.\n\t\t\t// If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n\n\t\t\tn = strm.read_buf(win, strstart + lookahead, more);\n\t\t\tlookahead += n;\n\n\t\t\t// Initialize the hash value now that we have some input:\n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\tins_h = win[strstart] & 0xff;\n\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[strstart + 1] & 0xff)) & hash_mask;\n\t\t\t}\n\t\t\t// If the whole input has less than MIN_MATCH bytes, ins_h is\n\t\t\t// garbage,\n\t\t\t// but this is not important since only literal bytes will be\n\t\t\t// emitted.\n\t\t} while (lookahead < MIN_LOOKAHEAD && strm.avail_in !== 0);\n\t}\n\n\t// Copy without compression as much as possible from the input stream,\n\t// return\n\t// the current block state.\n\t// This function does not insert new strings in the dictionary since\n\t// uncompressible data is probably not useful. This function is used\n\t// only for the level=0 compression option.\n\t// NOTE: this function should be optimized to avoid extra copying from\n\t// win to pending_buf.\n\tfunction deflate_stored(flush) {\n\t\t// Stored blocks are limited to 0xffff bytes, pending_buf is limited\n\t\t// to pending_buf_size, and each stored block has a 5 byte header:\n\n\t\tlet max_block_size = 0xffff;\n\t\tlet max_start;\n\n\t\tif (max_block_size > pending_buf_size - 5) {\n\t\t\tmax_block_size = pending_buf_size - 5;\n\t\t}\n\n\t\t// Copy as much as possible from input to output:\n\t\t// eslint-disable-next-line no-constant-condition\n\t\twhile (true) {\n\t\t\t// Fill the win as much as possible:\n\t\t\tif (lookahead <= 1) {\n\t\t\t\tfill_window();\n\t\t\t\tif (lookahead === 0 && flush == Z_NO_FLUSH)\n\t\t\t\t\treturn NeedMore;\n\t\t\t\tif (lookahead === 0)\n\t\t\t\t\tbreak; // flush the current block\n\t\t\t}\n\n\t\t\tstrstart += lookahead;\n\t\t\tlookahead = 0;\n\n\t\t\t// Emit a stored block if pending_buf will be full:\n\t\t\tmax_start = block_start + max_block_size;\n\t\t\tif (strstart === 0 || strstart >= max_start) {\n\t\t\t\t// strstart === 0 is possible when wraparound on 16-bit machine\n\t\t\t\tlookahead = (strstart - max_start);\n\t\t\t\tstrstart = max_start;\n\n\t\t\t\tflush_block_only(false);\n\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\treturn NeedMore;\n\n\t\t\t}\n\n\t\t\t// Flush if we may have to slide, otherwise block_start may become\n\t\t\t// negative and the data will be gone:\n\t\t\tif (strstart - block_start >= w_size - MIN_LOOKAHEAD) {\n\t\t\t\tflush_block_only(false);\n\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\treturn NeedMore;\n\t\t\t}\n\t\t}\n\n\t\tflush_block_only(flush == Z_FINISH);\n\t\tif (strm.avail_out === 0)\n\t\t\treturn (flush == Z_FINISH) ? FinishStarted : NeedMore;\n\n\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t}\n\n\tfunction longest_match(cur_match) {\n\t\tlet chain_length = max_chain_length; // max hash chain length\n\t\tlet scan = strstart; // current string\n\t\tlet match; // matched string\n\t\tlet len; // length of current match\n\t\tlet best_len = prev_length; // best match length so far\n\t\tconst limit = strstart > (w_size - MIN_LOOKAHEAD) ? strstart - (w_size - MIN_LOOKAHEAD) : 0;\n\t\tlet _nice_match = nice_match;\n\n\t\t// Stop when cur_match becomes <= limit. To simplify the code,\n\t\t// we prevent matches with the string of win index 0.\n\n\t\tconst wmask = w_mask;\n\n\t\tconst strend = strstart + MAX_MATCH;\n\t\tlet scan_end1 = win[scan + best_len - 1];\n\t\tlet scan_end = win[scan + best_len];\n\n\t\t// The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of\n\t\t// 16.\n\t\t// It is easy to get rid of this optimization if necessary.\n\n\t\t// Do not waste too much time if we already have a good match:\n\t\tif (prev_length >= good_match) {\n\t\t\tchain_length >>= 2;\n\t\t}\n\n\t\t// Do not look for matches beyond the end of the input. This is\n\t\t// necessary\n\t\t// to make deflate deterministic.\n\t\tif (_nice_match > lookahead)\n\t\t\t_nice_match = lookahead;\n\n\t\tdo {\n\t\t\tmatch = cur_match;\n\n\t\t\t// Skip to next match if the match length cannot increase\n\t\t\t// or if the match length is less than 2:\n\t\t\tif (win[match + best_len] != scan_end || win[match + best_len - 1] != scan_end1 || win[match] != win[scan]\n\t\t\t\t|| win[++match] != win[scan + 1])\n\t\t\t\tcontinue;\n\n\t\t\t// The check at best_len-1 can be removed because it will be made\n\t\t\t// again later. (This heuristic is not always a win.)\n\t\t\t// It is not necessary to compare scan[2] and match[2] since they\n\t\t\t// are always equal when the other bytes match, given that\n\t\t\t// the hash keys are equal and that HASH_BITS >= 8.\n\t\t\tscan += 2;\n\t\t\tmatch++;\n\n\t\t\t// We check for insufficient lookahead only every 8th comparison;\n\t\t\t// the 256th check will be made at strstart+258.\n\t\t\t// eslint-disable-next-line no-empty\n\t\t\tdo {\n\t\t\t\t// empty block\n\t\t\t} while (win[++scan] == win[++match] && win[++scan] == win[++match] && win[++scan] == win[++match]\n\t\t\t&& win[++scan] == win[++match] && win[++scan] == win[++match] && win[++scan] == win[++match]\n\t\t\t&& win[++scan] == win[++match] && win[++scan] == win[++match] && scan < strend);\n\n\t\t\tlen = MAX_MATCH - (strend - scan);\n\t\t\tscan = strend - MAX_MATCH;\n\n\t\t\tif (len > best_len) {\n\t\t\t\tmatch_start = cur_match;\n\t\t\t\tbest_len = len;\n\t\t\t\tif (len >= _nice_match)\n\t\t\t\t\tbreak;\n\t\t\t\tscan_end1 = win[scan + best_len - 1];\n\t\t\t\tscan_end = win[scan + best_len];\n\t\t\t}\n\n\t\t} while ((cur_match = (prev[cur_match & wmask] & 0xffff)) > limit && --chain_length !== 0);\n\n\t\tif (best_len <= lookahead)\n\t\t\treturn best_len;\n\t\treturn lookahead;\n\t}\n\n\t// Compress as much as possible from the input stream, return the current\n\t// block state.\n\t// This function does not perform lazy evaluation of matches and inserts\n\t// new strings in the dictionary only for unmatched strings or for short\n\t// matches. It is used only for the fast compression options.\n\tfunction deflate_fast(flush) {\n\t\t// short hash_head = 0; // head of the hash chain\n\t\tlet hash_head = 0; // head of the hash chain\n\t\tlet bflush; // set if current block must be flushed\n\n\t\t// eslint-disable-next-line no-constant-condition\n\t\twhile (true) {\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t\tfill_window();\n\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\t\treturn NeedMore;\n\t\t\t\t}\n\t\t\t\tif (lookahead === 0)\n\t\t\t\t\tbreak; // flush the current block\n\t\t\t}\n\n\t\t\t// Insert the string win[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\n\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\thead[ins_h] = strstart;\n\t\t\t}\n\n\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\t// At this point we have always match_length < MIN_MATCH\n\n\t\t\tif (hash_head !== 0 && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t// of win index 0 (in particular we have to avoid a match\n\t\t\t\t// of the string with itself at the start of the input file).\n\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t}\n\t\t\t\t// longest_match() sets match_start\n\t\t\t}\n\t\t\tif (match_length >= MIN_MATCH) {\n\t\t\t\t// check_match(strstart, match_start, match_length);\n\n\t\t\t\tbflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH);\n\n\t\t\t\tlookahead -= match_length;\n\n\t\t\t\t// Insert new strings in the hash table only if the match length\n\t\t\t\t// is not too large. This saves time but degrades compression.\n\t\t\t\tif (match_length <= max_lazy_match && lookahead >= MIN_MATCH) {\n\t\t\t\t\tmatch_length--; // string at strstart already in hash table\n\t\t\t\t\tdo {\n\t\t\t\t\t\tstrstart++;\n\n\t\t\t\t\t\tins_h = ((ins_h << hash_shift) ^ (win[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\t\thead[ins_h] = strstart;\n\n\t\t\t\t\t\t// strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t\t\t\t\t// always MIN_MATCH bytes ahead.\n\t\t\t\t\t} while (--match_length !== 0);\n\t\t\t\t\tstrstart++;\n\t\t\t\t} else {\n\t\t\t\t\tstrstart += match_length;\n\t\t\t\t\tmatch_length = 0;\n\t\t\t\t\tins_h = win[strstart] & 0xff;\n\n\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[strstart + 1] & 0xff)) & hash_mask;\n\t\t\t\t\t// If lookahead < MIN_MATCH, ins_h is garbage, but it does\n\t\t\t\t\t// not\n\t\t\t\t\t// matter since it will be recomputed at next deflate call.\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// No match, output a literal byte\n\n\t\t\t\tbflush = _tr_tally(0, win[strstart] & 0xff);\n\t\t\t\tlookahead--;\n\t\t\t\tstrstart++;\n\t\t\t}\n\t\t\tif (bflush) {\n\n\t\t\t\tflush_block_only(false);\n\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\treturn NeedMore;\n\t\t\t}\n\t\t}\n\n\t\tflush_block_only(flush == Z_FINISH);\n\t\tif (strm.avail_out === 0) {\n\t\t\tif (flush == Z_FINISH)\n\t\t\t\treturn FinishStarted;\n\t\t\telse\n\t\t\t\treturn NeedMore;\n\t\t}\n\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t}\n\n\t// Same as above, but achieves better compression. We use a lazy\n\t// evaluation for matches: a match is finally adopted only if there is\n\t// no better match at the next win position.\n\tfunction deflate_slow(flush) {\n\t\t// short hash_head = 0; // head of hash chain\n\t\tlet hash_head = 0; // head of hash chain\n\t\tlet bflush; // set if current block must be flushed\n\t\tlet max_insert;\n\n\t\t// Process the input block.\n\t\t// eslint-disable-next-line no-constant-condition\n\t\twhile (true) {\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\n\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t\tfill_window();\n\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\t\treturn NeedMore;\n\t\t\t\t}\n\t\t\t\tif (lookahead === 0)\n\t\t\t\t\tbreak; // flush the current block\n\t\t\t}\n\n\t\t\t// Insert the string win[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\thead[ins_h] = strstart;\n\t\t\t}\n\n\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\tprev_length = match_length;\n\t\t\tprev_match = match_start;\n\t\t\tmatch_length = MIN_MATCH - 1;\n\n\t\t\tif (hash_head !== 0 && prev_length < max_lazy_match && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t// of win index 0 (in particular we have to avoid a match\n\t\t\t\t// of the string with itself at the start of the input file).\n\n\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t}\n\t\t\t\t// longest_match() sets match_start\n\n\t\t\t\tif (match_length <= 5 && (strategy == Z_FILTERED || (match_length == MIN_MATCH && strstart - match_start > 4096))) {\n\n\t\t\t\t\t// If prev_match is also MIN_MATCH, match_start is garbage\n\t\t\t\t\t// but we will ignore the current match anyway.\n\t\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If there was a match at the previous step and the current\n\t\t\t// match is not better, output the previous match:\n\t\t\tif (prev_length >= MIN_MATCH && match_length <= prev_length) {\n\t\t\t\tmax_insert = strstart + lookahead - MIN_MATCH;\n\t\t\t\t// Do not insert strings in hash table beyond this.\n\n\t\t\t\t// check_match(strstart-1, prev_match, prev_length);\n\n\t\t\t\tbflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH);\n\n\t\t\t\t// Insert in hash table all strings up to the end of the match.\n\t\t\t\t// strstart-1 and strstart are already inserted. If there is not\n\t\t\t\t// enough lookahead, the last two strings are not inserted in\n\t\t\t\t// the hash table.\n\t\t\t\tlookahead -= prev_length - 1;\n\t\t\t\tprev_length -= 2;\n\t\t\t\tdo {\n\t\t\t\t\tif (++strstart <= max_insert) {\n\t\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\t\thead[ins_h] = strstart;\n\t\t\t\t\t}\n\t\t\t\t} while (--prev_length !== 0);\n\t\t\t\tmatch_available = 0;\n\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t\tstrstart++;\n\n\t\t\t\tif (bflush) {\n\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t}\n\t\t\t} else if (match_available !== 0) {\n\n\t\t\t\t// If there was no match at the previous position, output a\n\t\t\t\t// single literal. If there was a match but the current match\n\t\t\t\t// is longer, truncate the previous match to a single literal.\n\n\t\t\t\tbflush = _tr_tally(0, win[strstart - 1] & 0xff);\n\n\t\t\t\tif (bflush) {\n\t\t\t\t\tflush_block_only(false);\n\t\t\t\t}\n\t\t\t\tstrstart++;\n\t\t\t\tlookahead--;\n\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\treturn NeedMore;\n\t\t\t} else {\n\t\t\t\t// There is no previous match to compare with, wait for\n\t\t\t\t// the next step to decide.\n\n\t\t\t\tmatch_available = 1;\n\t\t\t\tstrstart++;\n\t\t\t\tlookahead--;\n\t\t\t}\n\t\t}\n\n\t\tif (match_available !== 0) {\n\t\t\tbflush = _tr_tally(0, win[strstart - 1] & 0xff);\n\t\t\tmatch_available = 0;\n\t\t}\n\t\tflush_block_only(flush == Z_FINISH);\n\n\t\tif (strm.avail_out === 0) {\n\t\t\tif (flush == Z_FINISH)\n\t\t\t\treturn FinishStarted;\n\t\t\telse\n\t\t\t\treturn NeedMore;\n\t\t}\n\n\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t}\n\n\tfunction deflateReset(strm) {\n\t\tstrm.total_in = strm.total_out = 0;\n\t\tstrm.msg = null; //\n\n\t\tthat.pending = 0;\n\t\tthat.pending_out = 0;\n\n\t\tstatus = BUSY_STATE;\n\n\t\tlast_flush = Z_NO_FLUSH;\n\n\t\ttr_init();\n\t\tlm_init();\n\t\treturn Z_OK;\n\t}\n\n\tthat.deflateInit = function (strm, _level, bits, _method, memLevel, _strategy) {\n\t\tif (!_method)\n\t\t\t_method = Z_DEFLATED;\n\t\tif (!memLevel)\n\t\t\tmemLevel = DEF_MEM_LEVEL;\n\t\tif (!_strategy)\n\t\t\t_strategy = Z_DEFAULT_STRATEGY;\n\n\t\t// byte[] my_version=ZLIB_VERSION;\n\n\t\t//\n\t\t// if (!version || version[0] != my_version[0]\n\t\t// || stream_size != sizeof(z_stream)) {\n\t\t// return Z_VERSION_ERROR;\n\t\t// }\n\n\t\tstrm.msg = null;\n\n\t\tif (_level == Z_DEFAULT_COMPRESSION)\n\t\t\t_level = 6;\n\n\t\tif (memLevel < 1 || memLevel > MAX_MEM_LEVEL || _method != Z_DEFLATED || bits < 9 || bits > 15 || _level < 0 || _level > 9 || _strategy < 0\n\t\t\t|| _strategy > Z_HUFFMAN_ONLY) {\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\n\t\tstrm.dstate = that;\n\n\t\tw_bits = bits;\n\t\tw_size = 1 << w_bits;\n\t\tw_mask = w_size - 1;\n\n\t\thash_bits = memLevel + 7;\n\t\thash_size = 1 << hash_bits;\n\t\thash_mask = hash_size - 1;\n\t\thash_shift = Math.floor((hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n\t\twin = new Uint8Array(w_size * 2);\n\t\tprev = [];\n\t\thead = [];\n\n\t\tlit_bufsize = 1 << (memLevel + 6); // 16K elements by default\n\n\t\tthat.pending_buf = new Uint8Array(lit_bufsize * 4);\n\t\tpending_buf_size = lit_bufsize * 4;\n\n\t\tthat.dist_buf = new Uint16Array(lit_bufsize);\n\t\tthat.lc_buf = new Uint8Array(lit_bufsize);\n\n\t\tlevel = _level;\n\n\t\tstrategy = _strategy;\n\n\t\treturn deflateReset(strm);\n\t};\n\n\tthat.deflateEnd = function () {\n\t\tif (status != INIT_STATE && status != BUSY_STATE && status != FINISH_STATE) {\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\t\t// Deallocate in reverse order of allocations:\n\t\tthat.lc_buf = null;\n\t\tthat.dist_buf = null;\n\t\tthat.pending_buf = null;\n\t\thead = null;\n\t\tprev = null;\n\t\twin = null;\n\t\t// free\n\t\tthat.dstate = null;\n\t\treturn status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;\n\t};\n\n\tthat.deflateParams = function (strm, _level, _strategy) {\n\t\tlet err = Z_OK;\n\n\t\tif (_level == Z_DEFAULT_COMPRESSION) {\n\t\t\t_level = 6;\n\t\t}\n\t\tif (_level < 0 || _level > 9 || _strategy < 0 || _strategy > Z_HUFFMAN_ONLY) {\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\n\t\tif (config_table[level].func != config_table[_level].func && strm.total_in !== 0) {\n\t\t\t// Flush the last buffer:\n\t\t\terr = strm.deflate(Z_PARTIAL_FLUSH);\n\t\t}\n\n\t\tif (level != _level) {\n\t\t\tlevel = _level;\n\t\t\tmax_lazy_match = config_table[level].max_lazy;\n\t\t\tgood_match = config_table[level].good_length;\n\t\t\tnice_match = config_table[level].nice_length;\n\t\t\tmax_chain_length = config_table[level].max_chain;\n\t\t}\n\t\tstrategy = _strategy;\n\t\treturn err;\n\t};\n\n\tthat.deflateSetDictionary = function (_strm, dictionary, dictLength) {\n\t\tlet length = dictLength;\n\t\tlet n, index = 0;\n\n\t\tif (!dictionary || status != INIT_STATE)\n\t\t\treturn Z_STREAM_ERROR;\n\n\t\tif (length < MIN_MATCH)\n\t\t\treturn Z_OK;\n\t\tif (length > w_size - MIN_LOOKAHEAD) {\n\t\t\tlength = w_size - MIN_LOOKAHEAD;\n\t\t\tindex = dictLength - length; // use the tail of the dictionary\n\t\t}\n\t\twin.set(dictionary.subarray(index, index + length), 0);\n\n\t\tstrstart = length;\n\t\tblock_start = length;\n\n\t\t// Insert all strings in the hash table (except for the last two bytes).\n\t\t// s->lookahead stays null, so s->ins_h will be recomputed at the next\n\t\t// call of fill_window.\n\n\t\tins_h = win[0] & 0xff;\n\t\tins_h = (((ins_h) << hash_shift) ^ (win[1] & 0xff)) & hash_mask;\n\n\t\tfor (n = 0; n <= length - MIN_MATCH; n++) {\n\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[(n) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\tprev[n & w_mask] = head[ins_h];\n\t\t\thead[ins_h] = n;\n\t\t}\n\t\treturn Z_OK;\n\t};\n\n\tthat.deflate = function (_strm, flush) {\n\t\tlet i, header, level_flags, old_flush, bstate;\n\n\t\tif (flush > Z_FINISH || flush < 0) {\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\n\t\tif (!_strm.next_out || (!_strm.next_in && _strm.avail_in !== 0) || (status == FINISH_STATE && flush != Z_FINISH)) {\n\t\t\t_strm.msg = z_errmsg[Z_NEED_DICT - (Z_STREAM_ERROR)];\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\t\tif (_strm.avail_out === 0) {\n\t\t\t_strm.msg = z_errmsg[Z_NEED_DICT - (Z_BUF_ERROR)];\n\t\t\treturn Z_BUF_ERROR;\n\t\t}\n\n\t\tstrm = _strm; // just in case\n\t\told_flush = last_flush;\n\t\tlast_flush = flush;\n\n\t\t// Write the zlib header\n\t\tif (status == INIT_STATE) {\n\t\t\theader = (Z_DEFLATED + ((w_bits - 8) << 4)) << 8;\n\t\t\tlevel_flags = ((level - 1) & 0xff) >> 1;\n\n\t\t\tif (level_flags > 3)\n\t\t\t\tlevel_flags = 3;\n\t\t\theader |= (level_flags << 6);\n\t\t\tif (strstart !== 0)\n\t\t\t\theader |= PRESET_DICT;\n\t\t\theader += 31 - (header % 31);\n\n\t\t\tstatus = BUSY_STATE;\n\t\t\tputShortMSB(header);\n\t\t}\n\n\t\t// Flush as much pending output as possible\n\t\tif (that.pending !== 0) {\n\t\t\tstrm.flush_pending();\n\t\t\tif (strm.avail_out === 0) {\n\t\t\t\t// console.log(\" avail_out==0\");\n\t\t\t\t// Since avail_out is 0, deflate will be called again with\n\t\t\t\t// more output space, but possibly with both pending and\n\t\t\t\t// avail_in equal to zero. There won't be anything to do,\n\t\t\t\t// but this is not an error situation so make sure we\n\t\t\t\t// return OK instead of BUF_ERROR at next call of deflate:\n\t\t\t\tlast_flush = -1;\n\t\t\t\treturn Z_OK;\n\t\t\t}\n\n\t\t\t// Make sure there is something to do and avoid duplicate\n\t\t\t// consecutive\n\t\t\t// flushes. For repeated and useless calls with Z_FINISH, we keep\n\t\t\t// returning Z_STREAM_END instead of Z_BUFF_ERROR.\n\t\t} else if (strm.avail_in === 0 && flush <= old_flush && flush != Z_FINISH) {\n\t\t\tstrm.msg = z_errmsg[Z_NEED_DICT - (Z_BUF_ERROR)];\n\t\t\treturn Z_BUF_ERROR;\n\t\t}\n\n\t\t// User must not provide more input after the first FINISH:\n\t\tif (status == FINISH_STATE && strm.avail_in !== 0) {\n\t\t\t_strm.msg = z_errmsg[Z_NEED_DICT - (Z_BUF_ERROR)];\n\t\t\treturn Z_BUF_ERROR;\n\t\t}\n\n\t\t// Start a new block or continue the current one.\n\t\tif (strm.avail_in !== 0 || lookahead !== 0 || (flush != Z_NO_FLUSH && status != FINISH_STATE)) {\n\t\t\tbstate = -1;\n\t\t\tswitch (config_table[level].func) {\n\t\t\t\tcase STORED:\n\t\t\t\t\tbstate = deflate_stored(flush);\n\t\t\t\t\tbreak;\n\t\t\t\tcase FAST:\n\t\t\t\t\tbstate = deflate_fast(flush);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SLOW:\n\t\t\t\t\tbstate = deflate_slow(flush);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t}\n\n\t\t\tif (bstate == FinishStarted || bstate == FinishDone) {\n\t\t\t\tstatus = FINISH_STATE;\n\t\t\t}\n\t\t\tif (bstate == NeedMore || bstate == FinishStarted) {\n\t\t\t\tif (strm.avail_out === 0) {\n\t\t\t\t\tlast_flush = -1; // avoid BUF_ERROR next call, see above\n\t\t\t\t}\n\t\t\t\treturn Z_OK;\n\t\t\t\t// If flush != Z_NO_FLUSH && avail_out === 0, the next call\n\t\t\t\t// of deflate should use the same flush parameter to make sure\n\t\t\t\t// that the flush is complete. So we don't have to output an\n\t\t\t\t// empty block here, this will be done at next call. This also\n\t\t\t\t// ensures that for a very small output buffer, we emit at most\n\t\t\t\t// one empty block.\n\t\t\t}\n\n\t\t\tif (bstate == BlockDone) {\n\t\t\t\tif (flush == Z_PARTIAL_FLUSH) {\n\t\t\t\t\t_tr_align();\n\t\t\t\t} else { // FULL_FLUSH or SYNC_FLUSH\n\t\t\t\t\t_tr_stored_block(0, 0, false);\n\t\t\t\t\t// For a full flush, this empty block will be recognized\n\t\t\t\t\t// as a special marker by inflate_sync().\n\t\t\t\t\tif (flush == Z_FULL_FLUSH) {\n\t\t\t\t\t\t// state.head[s.hash_size-1]=0;\n\t\t\t\t\t\tfor (i = 0; i < hash_size/*-1*/; i++)\n\t\t\t\t\t\t\t// forget history\n\t\t\t\t\t\t\thead[i] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstrm.flush_pending();\n\t\t\t\tif (strm.avail_out === 0) {\n\t\t\t\t\tlast_flush = -1; // avoid BUF_ERROR at next call, see above\n\t\t\t\t\treturn Z_OK;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (flush != Z_FINISH)\n\t\t\treturn Z_OK;\n\t\treturn Z_STREAM_END;\n\t};\n}\n\n// ZStream\n\nfunction ZStream() {\n\tconst that = this;\n\tthat.next_in_index = 0;\n\tthat.next_out_index = 0;\n\t// that.next_in; // next input byte\n\tthat.avail_in = 0; // number of bytes available at next_in\n\tthat.total_in = 0; // total nb of input bytes read so far\n\t// that.next_out; // next output byte should be put there\n\tthat.avail_out = 0; // remaining free space at next_out\n\tthat.total_out = 0; // total nb of bytes output so far\n\t// that.msg;\n\t// that.dstate;\n}\n\nZStream.prototype = {\n\tdeflateInit: function (level, bits) {\n\t\tconst that = this;\n\t\tthat.dstate = new Deflate();\n\t\tif (!bits)\n\t\t\tbits = MAX_BITS;\n\t\treturn that.dstate.deflateInit(that, level, bits);\n\t},\n\n\tdeflate: function (flush) {\n\t\tconst that = this;\n\t\tif (!that.dstate) {\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\t\treturn that.dstate.deflate(that, flush);\n\t},\n\n\tdeflateEnd: function () {\n\t\tconst that = this;\n\t\tif (!that.dstate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\tconst ret = that.dstate.deflateEnd();\n\t\tthat.dstate = null;\n\t\treturn ret;\n\t},\n\n\tdeflateParams: function (level, strategy) {\n\t\tconst that = this;\n\t\tif (!that.dstate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn that.dstate.deflateParams(that, level, strategy);\n\t},\n\n\tdeflateSetDictionary: function (dictionary, dictLength) {\n\t\tconst that = this;\n\t\tif (!that.dstate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn that.dstate.deflateSetDictionary(that, dictionary, dictLength);\n\t},\n\n\t// Read a new buffer from the current input stream, update the\n\t// total number of bytes read. All deflate() input goes through\n\t// this function so some applications may wish to modify it to avoid\n\t// allocating a large strm->next_in buffer and copying from it.\n\t// (See also flush_pending()).\n\tread_buf: function (buf, start, size) {\n\t\tconst that = this;\n\t\tlet len = that.avail_in;\n\t\tif (len > size)\n\t\t\tlen = size;\n\t\tif (len === 0)\n\t\t\treturn 0;\n\t\tthat.avail_in -= len;\n\t\tbuf.set(that.next_in.subarray(that.next_in_index, that.next_in_index + len), start);\n\t\tthat.next_in_index += len;\n\t\tthat.total_in += len;\n\t\treturn len;\n\t},\n\n\t// Flush as much pending output as possible. All deflate() output goes\n\t// through this function so some applications may wish to modify it\n\t// to avoid allocating a large strm->next_out buffer and copying into it.\n\t// (See also read_buf()).\n\tflush_pending: function () {\n\t\tconst that = this;\n\t\tlet len = that.dstate.pending;\n\n\t\tif (len > that.avail_out)\n\t\t\tlen = that.avail_out;\n\t\tif (len === 0)\n\t\t\treturn;\n\n\t\t// if (that.dstate.pending_buf.length <= that.dstate.pending_out || that.next_out.length <= that.next_out_index\n\t\t// || that.dstate.pending_buf.length < (that.dstate.pending_out + len) || that.next_out.length < (that.next_out_index +\n\t\t// len)) {\n\t\t// console.log(that.dstate.pending_buf.length + \", \" + that.dstate.pending_out + \", \" + that.next_out.length + \", \" +\n\t\t// that.next_out_index + \", \" + len);\n\t\t// console.log(\"avail_out=\" + that.avail_out);\n\t\t// }\n\n\t\tthat.next_out.set(that.dstate.pending_buf.subarray(that.dstate.pending_out, that.dstate.pending_out + len), that.next_out_index);\n\n\t\tthat.next_out_index += len;\n\t\tthat.dstate.pending_out += len;\n\t\tthat.total_out += len;\n\t\tthat.avail_out -= len;\n\t\tthat.dstate.pending -= len;\n\t\tif (that.dstate.pending === 0) {\n\t\t\tthat.dstate.pending_out = 0;\n\t\t}\n\t}\n};\n\n// Deflate\n\nfunction ZipDeflate(options) {\n\tconst that = this;\n\tconst z = new ZStream();\n\tconst bufsize = getMaximumCompressedSize(options && options.chunkSize ? options.chunkSize : 64 * 1024);\n\tconst flush = Z_NO_FLUSH;\n\tconst buf = new Uint8Array(bufsize);\n\tlet level = options ? options.level : Z_DEFAULT_COMPRESSION;\n\tif (typeof level == \"undefined\")\n\t\tlevel = Z_DEFAULT_COMPRESSION;\n\tz.deflateInit(level);\n\tz.next_out = buf;\n\n\tthat.append = function (data, onprogress) {\n\t\tlet err, array, lastIndex = 0, bufferIndex = 0, bufferSize = 0;\n\t\tconst buffers = [];\n\t\tif (!data.length)\n\t\t\treturn;\n\t\tz.next_in_index = 0;\n\t\tz.next_in = data;\n\t\tz.avail_in = data.length;\n\t\tdo {\n\t\t\tz.next_out_index = 0;\n\t\t\tz.avail_out = bufsize;\n\t\t\terr = z.deflate(flush);\n\t\t\tif (err != Z_OK)\n\t\t\t\tthrow new Error(\"deflating: \" + z.msg);\n\t\t\tif (z.next_out_index)\n\t\t\t\tif (z.next_out_index == bufsize)\n\t\t\t\t\tbuffers.push(new Uint8Array(buf));\n\t\t\t\telse\n\t\t\t\t\tbuffers.push(buf.slice(0, z.next_out_index));\n\t\t\tbufferSize += z.next_out_index;\n\t\t\tif (onprogress && z.next_in_index > 0 && z.next_in_index != lastIndex) {\n\t\t\t\tonprogress(z.next_in_index);\n\t\t\t\tlastIndex = z.next_in_index;\n\t\t\t}\n\t\t} while (z.avail_in > 0 || z.avail_out === 0);\n\t\tif (buffers.length > 1) {\n\t\t\tarray = new Uint8Array(bufferSize);\n\t\t\tbuffers.forEach(function (chunk) {\n\t\t\t\tarray.set(chunk, bufferIndex);\n\t\t\t\tbufferIndex += chunk.length;\n\t\t\t});\n\t\t} else {\n\t\t\tarray = buffers[0] || new Uint8Array(0);\n\t\t}\n\t\treturn array;\n\t};\n\tthat.flush = function () {\n\t\tlet err, array, bufferIndex = 0, bufferSize = 0;\n\t\tconst buffers = [];\n\t\tdo {\n\t\t\tz.next_out_index = 0;\n\t\t\tz.avail_out = bufsize;\n\t\t\terr = z.deflate(Z_FINISH);\n\t\t\tif (err != Z_STREAM_END && err != Z_OK)\n\t\t\t\tthrow new Error(\"deflating: \" + z.msg);\n\t\t\tif (bufsize - z.avail_out > 0)\n\t\t\t\tbuffers.push(buf.slice(0, z.next_out_index));\n\t\t\tbufferSize += z.next_out_index;\n\t\t} while (z.avail_in > 0 || z.avail_out === 0);\n\t\tz.deflateEnd();\n\t\tarray = new Uint8Array(bufferSize);\n\t\tbuffers.forEach(function (chunk) {\n\t\t\tarray.set(chunk, bufferIndex);\n\t\t\tbufferIndex += chunk.length;\n\t\t});\n\t\treturn array;\n\t};\n}\n\nfunction getMaximumCompressedSize(uncompressedSize) {\n\treturn uncompressedSize + (5 * (Math.floor(uncompressedSize / 16383) + 1));\n}\n\nexport default ZipDeflate;", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * This program is based on JZlib 1.0.2 ymnk, JCraft,Inc.\n * JZlib is based on zlib-1.1.3, so all credit should go authors\n * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)\n * and contributors of zlib.\n */\n\n// deno-lint-ignore-file no-this-alias prefer-const\n\n// Global\nconst MAX_BITS = 15;\n\nconst Z_OK = 0;\nconst Z_STREAM_END = 1;\nconst Z_NEED_DICT = 2;\nconst Z_STREAM_ERROR = -2;\nconst Z_DATA_ERROR = -3;\nconst Z_MEM_ERROR = -4;\nconst Z_BUF_ERROR = -5;\n\nconst inflate_mask = [0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, 0x000003ff,\n\t0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff];\n\nconst MANY = 1440;\n\n// JZlib version : \"1.0.2\"\nconst Z_NO_FLUSH = 0;\nconst Z_FINISH = 4;\n\n// InfTree\nconst fixed_bl = 9;\nconst fixed_bd = 5;\n\nconst fixed_tl = [96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9, 192, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 160, 0, 8, 0,\n\t0, 8, 128, 0, 8, 64, 0, 9, 224, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 144, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9, 208, 81, 7, 17, 0, 8, 104, 0, 8, 40,\n\t0, 9, 176, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 240, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8, 227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 200, 81, 7, 13,\n\t0, 8, 100, 0, 8, 36, 0, 9, 168, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 232, 80, 7, 8, 0, 8, 92, 0, 8, 28, 0, 9, 152, 84, 7, 83, 0, 8, 124, 0, 8, 60,\n\t0, 9, 216, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 184, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9, 248, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7,\n\t35, 0, 8, 114, 0, 8, 50, 0, 9, 196, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 164, 0, 8, 2, 0, 8, 130, 0, 8, 66, 0, 9, 228, 80, 7, 7, 0, 8, 90, 0, 8,\n\t26, 0, 9, 148, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 212, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9, 180, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 244, 80,\n\t7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 204, 81, 7, 15, 0, 8, 102, 0, 8, 38, 0, 9, 172, 0, 8, 6, 0, 8, 134, 0,\n\t8, 70, 0, 9, 236, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 156, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9, 220, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 188, 0,\n\t8, 14, 0, 8, 142, 0, 8, 78, 0, 9, 252, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0, 8, 113, 0, 8, 49, 0, 9, 194, 80, 7, 10, 0, 8, 97,\n\t0, 8, 33, 0, 9, 162, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 226, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9, 146, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 210,\n\t81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 178, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 242, 80, 7, 4, 0, 8, 85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117,\n\t0, 8, 53, 0, 9, 202, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 170, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 234, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 154,\n\t84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 218, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 186, 0, 8, 13, 0, 8, 141, 0, 8, 77, 0, 9, 250, 80, 7, 3, 0, 8, 83,\n\t0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 198, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 166, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 230,\n\t80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 150, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 214, 82, 7, 19, 0, 8, 107, 0, 8, 43, 0, 9, 182, 0, 8, 11, 0, 8, 139,\n\t0, 8, 75, 0, 9, 246, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 206, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 174,\n\t0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 238, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 158, 84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 222, 82, 7, 27, 0, 8, 111,\n\t0, 8, 47, 0, 9, 190, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 254, 96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9,\n\t193, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 161, 0, 8, 0, 0, 8, 128, 0, 8, 64, 0, 9, 225, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 145, 83, 7, 59, 0, 8,\n\t120, 0, 8, 56, 0, 9, 209, 81, 7, 17, 0, 8, 104, 0, 8, 40, 0, 9, 177, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 241, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8,\n\t227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 201, 81, 7, 13, 0, 8, 100, 0, 8, 36, 0, 9, 169, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 233, 80, 7, 8, 0, 8,\n\t92, 0, 8, 28, 0, 9, 153, 84, 7, 83, 0, 8, 124, 0, 8, 60, 0, 9, 217, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 185, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9,\n\t249, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35, 0, 8, 114, 0, 8, 50, 0, 9, 197, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 165, 0, 8, 2, 0, 8,\n\t130, 0, 8, 66, 0, 9, 229, 80, 7, 7, 0, 8, 90, 0, 8, 26, 0, 9, 149, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 213, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9,\n\t181, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 245, 80, 7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 205, 81, 7, 15, 0, 8,\n\t102, 0, 8, 38, 0, 9, 173, 0, 8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 237, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 157, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9,\n\t221, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 189, 0, 8, 14, 0, 8, 142, 0, 8, 78, 0, 9, 253, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0,\n\t8, 113, 0, 8, 49, 0, 9, 195, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 163, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 227, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9,\n\t147, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 211, 81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 179, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 243, 80, 7, 4, 0, 8,\n\t85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 203, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 171, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9,\n\t235, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 155, 84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 219, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 187, 0, 8, 13, 0, 8,\n\t141, 0, 8, 77, 0, 9, 251, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 199, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9,\n\t167, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 231, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 151, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 215, 82, 7, 19, 0, 8,\n\t107, 0, 8, 43, 0, 9, 183, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 247, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9,\n\t207, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 175, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 239, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 159, 84, 7, 99, 0, 8,\n\t127, 0, 8, 63, 0, 9, 223, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 191, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 255];\nconst fixed_td = [80, 5, 1, 87, 5, 257, 83, 5, 17, 91, 5, 4097, 81, 5, 5, 89, 5, 1025, 85, 5, 65, 93, 5, 16385, 80, 5, 3, 88, 5, 513, 84, 5, 33, 92, 5,\n\t8193, 82, 5, 9, 90, 5, 2049, 86, 5, 129, 192, 5, 24577, 80, 5, 2, 87, 5, 385, 83, 5, 25, 91, 5, 6145, 81, 5, 7, 89, 5, 1537, 85, 5, 97, 93, 5,\n\t24577, 80, 5, 4, 88, 5, 769, 84, 5, 49, 92, 5, 12289, 82, 5, 13, 90, 5, 3073, 86, 5, 193, 192, 5, 24577];\n\n// Tables for deflate from PKZIP's appnote.txt.\nconst cplens = [ // Copy lengths for literal codes 257..285\n\t3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0];\n\n// see note #13 above about 258\nconst cplext = [ // Extra bits for literal codes 257..285\n\t0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112 // 112==invalid\n];\n\nconst cpdist = [ // Copy offsets for distance codes 0..29\n\t1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577];\n\nconst cpdext = [ // Extra bits for distance codes\n\t0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];\n\n// If BMAX needs to be larger than 16, then h and x[] should be uLong.\nconst BMAX = 15; // maximum bit length of any code\n\nfunction InfTree() {\n\tconst that = this;\n\n\tlet hn; // hufts used in space\n\tlet v; // work area for huft_build\n\tlet c; // bit length count table\n\tlet r; // table entry for structure assignment\n\tlet u; // table stack\n\tlet x; // bit offsets, then code stack\n\n\tfunction huft_build(b, // code lengths in bits (all assumed <=\n\t\t// BMAX)\n\t\tbindex, n, // number of codes (assumed <= 288)\n\t\ts, // number of simple-valued codes (0..s-1)\n\t\td, // list of base values for non-simple codes\n\t\te, // list of extra bits for non-simple codes\n\t\tt, // result: starting table\n\t\tm, // maximum lookup bits, returns actual\n\t\thp,// space for trees\n\t\thn,// hufts used in space\n\t\tv // working area: values in order of bit length\n\t) {\n\t\t// Given a list of code lengths and a maximum table size, make a set of\n\t\t// tables to decode that set of codes. Return Z_OK on success,\n\t\t// Z_BUF_ERROR\n\t\t// if the given code set is incomplete (the tables are still built in\n\t\t// this\n\t\t// case), Z_DATA_ERROR if the input is invalid (an over-subscribed set\n\t\t// of\n\t\t// lengths), or Z_MEM_ERROR if not enough memory.\n\n\t\tlet a; // counter for codes of length k\n\t\tlet f; // i repeats in table every f entries\n\t\tlet g; // maximum code length\n\t\tlet h; // table level\n\t\tlet i; // counter, current code\n\t\tlet j; // counter\n\t\tlet k; // number of bits in current code\n\t\tlet l; // bits per table (returned in m)\n\t\tlet mask; // (1 << w) - 1, to avoid cc -O bug on HP\n\t\tlet p; // pointer into c[], b[], or v[]\n\t\tlet q; // points to current table\n\t\tlet w; // bits before this table == (l * h)\n\t\tlet xp; // pointer into x\n\t\tlet y; // number of dummy codes added\n\t\tlet z; // number of entries in current table\n\n\t\t// Generate counts for each bit length\n\n\t\tp = 0;\n\t\ti = n;\n\t\tdo {\n\t\t\tc[b[bindex + p]]++;\n\t\t\tp++;\n\t\t\ti--; // assume all entries <= BMAX\n\t\t} while (i !== 0);\n\n\t\tif (c[0] == n) { // null input--all zero length codes\n\t\t\tt[0] = -1;\n\t\t\tm[0] = 0;\n\t\t\treturn Z_OK;\n\t\t}\n\n\t\t// Find minimum and maximum length, bound *m by those\n\t\tl = m[0];\n\t\tfor (j = 1; j <= BMAX; j++)\n\t\t\tif (c[j] !== 0)\n\t\t\t\tbreak;\n\t\tk = j; // minimum code length\n\t\tif (l < j) {\n\t\t\tl = j;\n\t\t}\n\t\tfor (i = BMAX; i !== 0; i--) {\n\t\t\tif (c[i] !== 0)\n\t\t\t\tbreak;\n\t\t}\n\t\tg = i; // maximum code length\n\t\tif (l > i) {\n\t\t\tl = i;\n\t\t}\n\t\tm[0] = l;\n\n\t\t// Adjust last length count to fill out codes, if needed\n\t\tfor (y = 1 << j; j < i; j++, y <<= 1) {\n\t\t\tif ((y -= c[j]) < 0) {\n\t\t\t\treturn Z_DATA_ERROR;\n\t\t\t}\n\t\t}\n\t\tif ((y -= c[i]) < 0) {\n\t\t\treturn Z_DATA_ERROR;\n\t\t}\n\t\tc[i] += y;\n\n\t\t// Generate starting offsets into the value table for each length\n\t\tx[1] = j = 0;\n\t\tp = 1;\n\t\txp = 2;\n\t\twhile (--i !== 0) { // note that i == g from above\n\t\t\tx[xp] = (j += c[p]);\n\t\t\txp++;\n\t\t\tp++;\n\t\t}\n\n\t\t// Make a table of values in order of bit lengths\n\t\ti = 0;\n\t\tp = 0;\n\t\tdo {\n\t\t\tif ((j = b[bindex + p]) !== 0) {\n\t\t\t\tv[x[j]++] = i;\n\t\t\t}\n\t\t\tp++;\n\t\t} while (++i < n);\n\t\tn = x[g]; // set n to length of v\n\n\t\t// Generate the Huffman codes and for each, make the table entries\n\t\tx[0] = i = 0; // first Huffman code is zero\n\t\tp = 0; // grab values in bit order\n\t\th = -1; // no tables yet--level -1\n\t\tw = -l; // bits decoded == (l * h)\n\t\tu[0] = 0; // just to keep compilers happy\n\t\tq = 0; // ditto\n\t\tz = 0; // ditto\n\n\t\t// go through the bit lengths (k already is bits in shortest code)\n\t\tfor (; k <= g; k++) {\n\t\t\ta = c[k];\n\t\t\twhile (a-- !== 0) {\n\t\t\t\t// here i is the Huffman code of length k bits for value *p\n\t\t\t\t// make tables up to required level\n\t\t\t\twhile (k > w + l) {\n\t\t\t\t\th++;\n\t\t\t\t\tw += l; // previous table always l bits\n\t\t\t\t\t// compute minimum size table less than or equal to l bits\n\t\t\t\t\tz = g - w;\n\t\t\t\t\tz = (z > l) ? l : z; // table size upper limit\n\t\t\t\t\tif ((f = 1 << (j = k - w)) > a + 1) { // try a k-w bit table\n\t\t\t\t\t\t// too few codes for\n\t\t\t\t\t\t// k-w bit table\n\t\t\t\t\t\tf -= a + 1; // deduct codes from patterns left\n\t\t\t\t\t\txp = k;\n\t\t\t\t\t\tif (j < z) {\n\t\t\t\t\t\t\twhile (++j < z) { // try smaller tables up to z bits\n\t\t\t\t\t\t\t\tif ((f <<= 1) <= c[++xp])\n\t\t\t\t\t\t\t\t\tbreak; // enough codes to use up j bits\n\t\t\t\t\t\t\t\tf -= c[xp]; // else deduct codes from patterns\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tz = 1 << j; // table entries for j-bit table\n\n\t\t\t\t\t// allocate new table\n\t\t\t\t\tif (hn[0] + z > MANY) { // (note: doesn't matter for fixed)\n\t\t\t\t\t\treturn Z_DATA_ERROR; // overflow of MANY\n\t\t\t\t\t}\n\t\t\t\t\tu[h] = q = /* hp+ */hn[0]; // DEBUG\n\t\t\t\t\thn[0] += z;\n\n\t\t\t\t\t// connect to last table, if there is one\n\t\t\t\t\tif (h !== 0) {\n\t\t\t\t\t\tx[h] = i; // save pattern for backing up\n\t\t\t\t\t\tr[0] = /* (byte) */j; // bits in this table\n\t\t\t\t\t\tr[1] = /* (byte) */l; // bits to dump before this table\n\t\t\t\t\t\tj = i >>> (w - l);\n\t\t\t\t\t\tr[2] = /* (int) */(q - u[h - 1] - j); // offset to this table\n\t\t\t\t\t\thp.set(r, (u[h - 1] + j) * 3);\n\t\t\t\t\t\t// to\n\t\t\t\t\t\t// last\n\t\t\t\t\t\t// table\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt[0] = q; // first table is returned result\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set up table entry in r\n\t\t\t\tr[1] = /* (byte) */(k - w);\n\t\t\t\tif (p >= n) {\n\t\t\t\t\tr[0] = 128 + 64; // out of values--invalid code\n\t\t\t\t} else if (v[p] < s) {\n\t\t\t\t\tr[0] = /* (byte) */(v[p] < 256 ? 0 : 32 + 64); // 256 is\n\t\t\t\t\t// end-of-block\n\t\t\t\t\tr[2] = v[p++]; // simple code is just the value\n\t\t\t\t} else {\n\t\t\t\t\tr[0] = /* (byte) */(e[v[p] - s] + 16 + 64); // non-simple--look\n\t\t\t\t\t// up in lists\n\t\t\t\t\tr[2] = d[v[p++] - s];\n\t\t\t\t}\n\n\t\t\t\t// fill code-like entries with r\n\t\t\t\tf = 1 << (k - w);\n\t\t\t\tfor (j = i >>> w; j < z; j += f) {\n\t\t\t\t\thp.set(r, (q + j) * 3);\n\t\t\t\t}\n\n\t\t\t\t// backwards increment the k-bit code i\n\t\t\t\tfor (j = 1 << (k - 1); (i & j) !== 0; j >>>= 1) {\n\t\t\t\t\ti ^= j;\n\t\t\t\t}\n\t\t\t\ti ^= j;\n\n\t\t\t\t// backup over finished tables\n\t\t\t\tmask = (1 << w) - 1; // needed on HP, cc -O bug\n\t\t\t\twhile ((i & mask) != x[h]) {\n\t\t\t\t\th--; // don't need to update q\n\t\t\t\t\tw -= l;\n\t\t\t\t\tmask = (1 << w) - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Return Z_BUF_ERROR if we were given an incomplete table\n\t\treturn y !== 0 && g != 1 ? Z_BUF_ERROR : Z_OK;\n\t}\n\n\tfunction initWorkArea(vsize) {\n\t\tlet i;\n\t\tif (!hn) {\n\t\t\thn = []; // []; //new Array(1);\n\t\t\tv = []; // new Array(vsize);\n\t\t\tc = new Int32Array(BMAX + 1); // new Array(BMAX + 1);\n\t\t\tr = []; // new Array(3);\n\t\t\tu = new Int32Array(BMAX); // new Array(BMAX);\n\t\t\tx = new Int32Array(BMAX + 1); // new Array(BMAX + 1);\n\t\t}\n\t\tif (v.length < vsize) {\n\t\t\tv = []; // new Array(vsize);\n\t\t}\n\t\tfor (i = 0; i < vsize; i++) {\n\t\t\tv[i] = 0;\n\t\t}\n\t\tfor (i = 0; i < BMAX + 1; i++) {\n\t\t\tc[i] = 0;\n\t\t}\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\tr[i] = 0;\n\t\t}\n\t\t// for(int i=0; i<BMAX; i++){u[i]=0;}\n\t\tu.set(c.subarray(0, BMAX), 0);\n\t\t// for(int i=0; i<BMAX+1; i++){x[i]=0;}\n\t\tx.set(c.subarray(0, BMAX + 1), 0);\n\t}\n\n\tthat.inflate_trees_bits = function (c, // 19 code lengths\n\t\tbb, // bits tree desired/actual depth\n\t\ttb, // bits tree result\n\t\thp, // space for trees\n\t\tz // for messages\n\t) {\n\t\tlet result;\n\t\tinitWorkArea(19);\n\t\thn[0] = 0;\n\t\tresult = huft_build(c, 0, 19, 19, null, null, tb, bb, hp, hn, v);\n\n\t\tif (result == Z_DATA_ERROR) {\n\t\t\tz.msg = \"oversubscribed dynamic bit lengths tree\";\n\t\t} else if (result == Z_BUF_ERROR || bb[0] === 0) {\n\t\t\tz.msg = \"incomplete dynamic bit lengths tree\";\n\t\t\tresult = Z_DATA_ERROR;\n\t\t}\n\t\treturn result;\n\t};\n\n\tthat.inflate_trees_dynamic = function (nl, // number of literal/length codes\n\t\tnd, // number of distance codes\n\t\tc, // that many (total) code lengths\n\t\tbl, // literal desired/actual bit depth\n\t\tbd, // distance desired/actual bit depth\n\t\ttl, // literal/length tree result\n\t\ttd, // distance tree result\n\t\thp, // space for trees\n\t\tz // for messages\n\t) {\n\t\tlet result;\n\n\t\t// build literal/length tree\n\t\tinitWorkArea(288);\n\t\thn[0] = 0;\n\t\tresult = huft_build(c, 0, nl, 257, cplens, cplext, tl, bl, hp, hn, v);\n\t\tif (result != Z_OK || bl[0] === 0) {\n\t\t\tif (result == Z_DATA_ERROR) {\n\t\t\t\tz.msg = \"oversubscribed literal/length tree\";\n\t\t\t} else if (result != Z_MEM_ERROR) {\n\t\t\t\tz.msg = \"incomplete literal/length tree\";\n\t\t\t\tresult = Z_DATA_ERROR;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t// build distance tree\n\t\tinitWorkArea(288);\n\t\tresult = huft_build(c, nl, nd, 0, cpdist, cpdext, td, bd, hp, hn, v);\n\n\t\tif (result != Z_OK || (bd[0] === 0 && nl > 257)) {\n\t\t\tif (result == Z_DATA_ERROR) {\n\t\t\t\tz.msg = \"oversubscribed distance tree\";\n\t\t\t} else if (result == Z_BUF_ERROR) {\n\t\t\t\tz.msg = \"incomplete distance tree\";\n\t\t\t\tresult = Z_DATA_ERROR;\n\t\t\t} else if (result != Z_MEM_ERROR) {\n\t\t\t\tz.msg = \"empty distance tree with lengths\";\n\t\t\t\tresult = Z_DATA_ERROR;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\treturn Z_OK;\n\t};\n\n}\n\nInfTree.inflate_trees_fixed = function (bl, // literal desired/actual bit depth\n\tbd, // distance desired/actual bit depth\n\ttl,// literal/length tree result\n\ttd// distance tree result\n) {\n\tbl[0] = fixed_bl;\n\tbd[0] = fixed_bd;\n\ttl[0] = fixed_tl;\n\ttd[0] = fixed_td;\n\treturn Z_OK;\n};\n\n// InfCodes\n\n// waiting for \"i:\"=input,\n// \"o:\"=output,\n// \"x:\"=nothing\nconst START = 0; // x: set up for LEN\nconst LEN = 1; // i: get length/literal/eob next\nconst LENEXT = 2; // i: getting length extra (have base)\nconst DIST = 3; // i: get distance next\nconst DISTEXT = 4;// i: getting distance extra\nconst COPY = 5; // o: copying bytes in win, waiting\n// for space\nconst LIT = 6; // o: got literal, waiting for output\n// space\nconst WASH = 7; // o: got eob, possibly still output\n// waiting\nconst END = 8; // x: got eob and all data flushed\nconst BADCODE = 9;// x: got error\n\nfunction InfCodes() {\n\tconst that = this;\n\n\tlet mode; // current inflate_codes mode\n\n\t// mode dependent information\n\tlet len = 0;\n\n\tlet tree; // pointer into tree\n\tlet tree_index = 0;\n\tlet need = 0; // bits needed\n\n\tlet lit = 0;\n\n\t// if EXT or COPY, where and how much\n\tlet get = 0; // bits to get for extra\n\tlet dist = 0; // distance back to copy from\n\n\tlet lbits = 0; // ltree bits decoded per branch\n\tlet dbits = 0; // dtree bits decoder per branch\n\tlet ltree; // literal/length/eob tree\n\tlet ltree_index = 0; // literal/length/eob tree\n\tlet dtree; // distance tree\n\tlet dtree_index = 0; // distance tree\n\n\t// Called with number of bytes left to write in win at least 258\n\t// (the maximum string length) and number of input bytes available\n\t// at least ten. The ten bytes are six bytes for the longest length/\n\t// distance pair plus four bytes for overloading the bit buffer.\n\n\tfunction inflate_fast(bl, bd, tl, tl_index, td, td_index, s, z) {\n\t\tlet t; // temporary pointer\n\t\tlet tp; // temporary pointer\n\t\tlet tp_index; // temporary pointer\n\t\tlet e; // extra bits or operation\n\t\tlet b; // bit buffer\n\t\tlet k; // bits in bit buffer\n\t\tlet p; // input data pointer\n\t\tlet n; // bytes available there\n\t\tlet q; // output win write pointer\n\t\tlet m; // bytes to end of win or read pointer\n\t\tlet ml; // mask for literal/length tree\n\t\tlet md; // mask for distance tree\n\t\tlet c; // bytes to copy\n\t\tlet d; // distance back to copy from\n\t\tlet r; // copy source pointer\n\n\t\tlet tp_index_t_3; // (tp_index+t)*3\n\n\t\t// load input, output, bit values\n\t\tp = z.next_in_index;\n\t\tn = z.avail_in;\n\t\tb = s.bitb;\n\t\tk = s.bitk;\n\t\tq = s.write;\n\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t// initialize masks\n\t\tml = inflate_mask[bl];\n\t\tmd = inflate_mask[bd];\n\n\t\t// do until not enough input or output space for fast loop\n\t\tdo { // assume called with m >= 258 && n >= 10\n\t\t\t// get literal/length code\n\t\t\twhile (k < (20)) { // max bits for literal/length code\n\t\t\t\tn--;\n\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\tk += 8;\n\t\t\t}\n\n\t\t\tt = b & ml;\n\t\t\ttp = tl;\n\t\t\ttp_index = tl_index;\n\t\t\ttp_index_t_3 = (tp_index + t) * 3;\n\t\t\tif ((e = tp[tp_index_t_3]) === 0) {\n\t\t\t\tb >>= (tp[tp_index_t_3 + 1]);\n\t\t\t\tk -= (tp[tp_index_t_3 + 1]);\n\n\t\t\t\ts.win[q++] = /* (byte) */tp[tp_index_t_3 + 2];\n\t\t\t\tm--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdo {\n\n\t\t\t\tb >>= (tp[tp_index_t_3 + 1]);\n\t\t\t\tk -= (tp[tp_index_t_3 + 1]);\n\n\t\t\t\tif ((e & 16) !== 0) {\n\t\t\t\t\te &= 15;\n\t\t\t\t\tc = tp[tp_index_t_3 + 2] + (/* (int) */b & inflate_mask[e]);\n\n\t\t\t\t\tb >>= e;\n\t\t\t\t\tk -= e;\n\n\t\t\t\t\t// decode distance base of block to copy\n\t\t\t\t\twhile (k < (15)) { // max bits for distance code\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\tt = b & md;\n\t\t\t\t\ttp = td;\n\t\t\t\t\ttp_index = td_index;\n\t\t\t\t\ttp_index_t_3 = (tp_index + t) * 3;\n\t\t\t\t\te = tp[tp_index_t_3];\n\n\t\t\t\t\tdo {\n\n\t\t\t\t\t\tb >>= (tp[tp_index_t_3 + 1]);\n\t\t\t\t\t\tk -= (tp[tp_index_t_3 + 1]);\n\n\t\t\t\t\t\tif ((e & 16) !== 0) {\n\t\t\t\t\t\t\t// get extra bits to add to distance base\n\t\t\t\t\t\t\te &= 15;\n\t\t\t\t\t\t\twhile (k < (e)) { // get extra bits (up to 13)\n\t\t\t\t\t\t\t\tn--;\n\t\t\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\t\t\tk += 8;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\td = tp[tp_index_t_3 + 2] + (b & inflate_mask[e]);\n\n\t\t\t\t\t\t\tb >>= (e);\n\t\t\t\t\t\t\tk -= (e);\n\n\t\t\t\t\t\t\t// do the copy\n\t\t\t\t\t\t\tm -= c;\n\t\t\t\t\t\t\tif (q >= d) { // offset before dest\n\t\t\t\t\t\t\t\t// just copy\n\t\t\t\t\t\t\t\tr = q - d;\n\t\t\t\t\t\t\t\tif (q - r > 0 && 2 > (q - r)) {\n\t\t\t\t\t\t\t\t\ts.win[q++] = s.win[r++]; // minimum\n\t\t\t\t\t\t\t\t\t// count is\n\t\t\t\t\t\t\t\t\t// three,\n\t\t\t\t\t\t\t\t\ts.win[q++] = s.win[r++]; // so unroll\n\t\t\t\t\t\t\t\t\t// loop a\n\t\t\t\t\t\t\t\t\t// little\n\t\t\t\t\t\t\t\t\tc -= 2;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts.win.set(s.win.subarray(r, r + 2), q);\n\t\t\t\t\t\t\t\t\tq += 2;\n\t\t\t\t\t\t\t\t\tr += 2;\n\t\t\t\t\t\t\t\t\tc -= 2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else { // else offset after destination\n\t\t\t\t\t\t\t\tr = q - d;\n\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\tr += s.end; // force pointer in win\n\t\t\t\t\t\t\t\t} while (r < 0); // covers invalid distances\n\t\t\t\t\t\t\t\te = s.end - r;\n\t\t\t\t\t\t\t\tif (c > e) { // if source crosses,\n\t\t\t\t\t\t\t\t\tc -= e; // wrapped copy\n\t\t\t\t\t\t\t\t\tif (q - r > 0 && e > (q - r)) {\n\t\t\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\t\t\ts.win[q++] = s.win[r++];\n\t\t\t\t\t\t\t\t\t\t} while (--e !== 0);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts.win.set(s.win.subarray(r, r + e), q);\n\t\t\t\t\t\t\t\t\t\tq += e;\n\t\t\t\t\t\t\t\t\t\tr += e;\n\t\t\t\t\t\t\t\t\t\te = 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tr = 0; // copy rest from start of win\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// copy all or what's left\n\t\t\t\t\t\t\tif (q - r > 0 && c > (q - r)) {\n\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\ts.win[q++] = s.win[r++];\n\t\t\t\t\t\t\t\t} while (--c !== 0);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts.win.set(s.win.subarray(r, r + c), q);\n\t\t\t\t\t\t\t\tq += c;\n\t\t\t\t\t\t\t\tr += c;\n\t\t\t\t\t\t\t\tc = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if ((e & 64) === 0) {\n\t\t\t\t\t\t\tt += tp[tp_index_t_3 + 2];\n\t\t\t\t\t\t\tt += (b & inflate_mask[e]);\n\t\t\t\t\t\t\ttp_index_t_3 = (tp_index + t) * 3;\n\t\t\t\t\t\t\te = tp[tp_index_t_3];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tz.msg = \"invalid distance code\";\n\n\t\t\t\t\t\t\tc = z.avail_in - n;\n\t\t\t\t\t\t\tc = (k >> 3) < c ? k >> 3 : c;\n\t\t\t\t\t\t\tn += c;\n\t\t\t\t\t\t\tp -= c;\n\t\t\t\t\t\t\tk -= c << 3;\n\n\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\ts.write = q;\n\n\t\t\t\t\t\t\treturn Z_DATA_ERROR;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// eslint-disable-next-line no-constant-condition\n\t\t\t\t\t} while (true);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ((e & 64) === 0) {\n\t\t\t\t\tt += tp[tp_index_t_3 + 2];\n\t\t\t\t\tt += (b & inflate_mask[e]);\n\t\t\t\t\ttp_index_t_3 = (tp_index + t) * 3;\n\t\t\t\t\tif ((e = tp[tp_index_t_3]) === 0) {\n\n\t\t\t\t\t\tb >>= (tp[tp_index_t_3 + 1]);\n\t\t\t\t\t\tk -= (tp[tp_index_t_3 + 1]);\n\n\t\t\t\t\t\ts.win[q++] = /* (byte) */tp[tp_index_t_3 + 2];\n\t\t\t\t\t\tm--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else if ((e & 32) !== 0) {\n\n\t\t\t\t\tc = z.avail_in - n;\n\t\t\t\t\tc = (k >> 3) < c ? k >> 3 : c;\n\t\t\t\t\tn += c;\n\t\t\t\t\tp -= c;\n\t\t\t\t\tk -= c << 3;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\n\t\t\t\t\treturn Z_STREAM_END;\n\t\t\t\t} else {\n\t\t\t\t\tz.msg = \"invalid literal/length code\";\n\n\t\t\t\t\tc = z.avail_in - n;\n\t\t\t\t\tc = (k >> 3) < c ? k >> 3 : c;\n\t\t\t\t\tn += c;\n\t\t\t\t\tp -= c;\n\t\t\t\t\tk -= c << 3;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\n\t\t\t\t\treturn Z_DATA_ERROR;\n\t\t\t\t}\n\t\t\t\t// eslint-disable-next-line no-constant-condition\n\t\t\t} while (true);\n\t\t} while (m >= 258 && n >= 10);\n\n\t\t// not enough input or output--restore pointers and return\n\t\tc = z.avail_in - n;\n\t\tc = (k >> 3) < c ? k >> 3 : c;\n\t\tn += c;\n\t\tp -= c;\n\t\tk -= c << 3;\n\n\t\ts.bitb = b;\n\t\ts.bitk = k;\n\t\tz.avail_in = n;\n\t\tz.total_in += p - z.next_in_index;\n\t\tz.next_in_index = p;\n\t\ts.write = q;\n\n\t\treturn Z_OK;\n\t}\n\n\tthat.init = function (bl, bd, tl, tl_index, td, td_index) {\n\t\tmode = START;\n\t\tlbits = /* (byte) */bl;\n\t\tdbits = /* (byte) */bd;\n\t\tltree = tl;\n\t\tltree_index = tl_index;\n\t\tdtree = td;\n\t\tdtree_index = td_index;\n\t\ttree = null;\n\t};\n\n\tthat.proc = function (s, z, r) {\n\t\tlet j; // temporary storage\n\t\tlet tindex; // temporary pointer\n\t\tlet e; // extra bits or operation\n\t\tlet b = 0; // bit buffer\n\t\tlet k = 0; // bits in bit buffer\n\t\tlet p = 0; // input data pointer\n\t\tlet n; // bytes available there\n\t\tlet q; // output win write pointer\n\t\tlet m; // bytes to end of win or read pointer\n\t\tlet f; // pointer to copy strings from\n\n\t\t// copy input/output information to locals (UPDATE macro restores)\n\t\tp = z.next_in_index;\n\t\tn = z.avail_in;\n\t\tb = s.bitb;\n\t\tk = s.bitk;\n\t\tq = s.write;\n\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t// process input and output based on current state\n\t\t// eslint-disable-next-line no-constant-condition\n\t\twhile (true) {\n\t\t\tswitch (mode) {\n\t\t\t\t// waiting for \"i:\"=input, \"o:\"=output, \"x:\"=nothing\n\t\t\t\tcase START: // x: set up for LEN\n\t\t\t\t\tif (m >= 258 && n >= 10) {\n\n\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\tr = inflate_fast(lbits, dbits, ltree, ltree_index, dtree, dtree_index, s, z);\n\n\t\t\t\t\t\tp = z.next_in_index;\n\t\t\t\t\t\tn = z.avail_in;\n\t\t\t\t\t\tb = s.bitb;\n\t\t\t\t\t\tk = s.bitk;\n\t\t\t\t\t\tq = s.write;\n\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t\t\t\t\tif (r != Z_OK) {\n\t\t\t\t\t\t\tmode = r == Z_STREAM_END ? WASH : BADCODE;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tneed = lbits;\n\t\t\t\t\ttree = ltree;\n\t\t\t\t\ttree_index = ltree_index;\n\n\t\t\t\t\tmode = LEN;\n\t\t\t\t/* falls through */\n\t\t\t\tcase LEN: // i: get length/literal/eob next\n\t\t\t\t\tj = need;\n\n\t\t\t\t\twhile (k < (j)) {\n\t\t\t\t\t\tif (n !== 0)\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\ttindex = (tree_index + (b & inflate_mask[j])) * 3;\n\n\t\t\t\t\tb >>>= (tree[tindex + 1]);\n\t\t\t\t\tk -= (tree[tindex + 1]);\n\n\t\t\t\t\te = tree[tindex];\n\n\t\t\t\t\tif (e === 0) { // literal\n\t\t\t\t\t\tlit = tree[tindex + 2];\n\t\t\t\t\t\tmode = LIT;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ((e & 16) !== 0) { // length\n\t\t\t\t\t\tget = e & 15;\n\t\t\t\t\t\tlen = tree[tindex + 2];\n\t\t\t\t\t\tmode = LENEXT;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ((e & 64) === 0) { // next table\n\t\t\t\t\t\tneed = e;\n\t\t\t\t\t\ttree_index = tindex / 3 + tree[tindex + 2];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ((e & 32) !== 0) { // end of block\n\t\t\t\t\t\tmode = WASH;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tmode = BADCODE; // invalid code\n\t\t\t\t\tz.msg = \"invalid literal/length code\";\n\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\t\t\t\t\treturn s.inflate_flush(z, r);\n\n\t\t\t\tcase LENEXT: // i: getting length extra (have base)\n\t\t\t\t\tj = get;\n\n\t\t\t\t\twhile (k < (j)) {\n\t\t\t\t\t\tif (n !== 0)\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\tlen += (b & inflate_mask[j]);\n\n\t\t\t\t\tb >>= j;\n\t\t\t\t\tk -= j;\n\n\t\t\t\t\tneed = dbits;\n\t\t\t\t\ttree = dtree;\n\t\t\t\t\ttree_index = dtree_index;\n\t\t\t\t\tmode = DIST;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DIST: // i: get distance next\n\t\t\t\t\tj = need;\n\n\t\t\t\t\twhile (k < (j)) {\n\t\t\t\t\t\tif (n !== 0)\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\ttindex = (tree_index + (b & inflate_mask[j])) * 3;\n\n\t\t\t\t\tb >>= tree[tindex + 1];\n\t\t\t\t\tk -= tree[tindex + 1];\n\n\t\t\t\t\te = (tree[tindex]);\n\t\t\t\t\tif ((e & 16) !== 0) { // distance\n\t\t\t\t\t\tget = e & 15;\n\t\t\t\t\t\tdist = tree[tindex + 2];\n\t\t\t\t\t\tmode = DISTEXT;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ((e & 64) === 0) { // next table\n\t\t\t\t\t\tneed = e;\n\t\t\t\t\t\ttree_index = tindex / 3 + tree[tindex + 2];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tmode = BADCODE; // invalid code\n\t\t\t\t\tz.msg = \"invalid distance code\";\n\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\t\t\t\t\treturn s.inflate_flush(z, r);\n\n\t\t\t\tcase DISTEXT: // i: getting distance extra\n\t\t\t\t\tj = get;\n\n\t\t\t\t\twhile (k < (j)) {\n\t\t\t\t\t\tif (n !== 0)\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\tdist += (b & inflate_mask[j]);\n\n\t\t\t\t\tb >>= j;\n\t\t\t\t\tk -= j;\n\n\t\t\t\t\tmode = COPY;\n\t\t\t\t/* falls through */\n\t\t\t\tcase COPY: // o: copying bytes in win, waiting for space\n\t\t\t\t\tf = q - dist;\n\t\t\t\t\twhile (f < 0) { // modulo win size-\"while\" instead\n\t\t\t\t\t\tf += s.end; // of \"if\" handles invalid distances\n\t\t\t\t\t}\n\t\t\t\t\twhile (len !== 0) {\n\n\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\tif (q == s.end && s.read !== 0) {\n\t\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\t\tr = s.inflate_flush(z, r);\n\t\t\t\t\t\t\t\tq = s.write;\n\t\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t\t\t\t\t\t\tif (q == s.end && s.read !== 0) {\n\t\t\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ts.win[q++] = s.win[f++];\n\t\t\t\t\t\tm--;\n\n\t\t\t\t\t\tif (f == s.end)\n\t\t\t\t\t\t\tf = 0;\n\t\t\t\t\t\tlen--;\n\t\t\t\t\t}\n\t\t\t\t\tmode = START;\n\t\t\t\t\tbreak;\n\t\t\t\tcase LIT: // o: got literal, waiting for output space\n\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\tif (q == s.end && s.read !== 0) {\n\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\tr = s.inflate_flush(z, r);\n\t\t\t\t\t\t\tq = s.write;\n\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t\t\t\t\t\tif (q == s.end && s.read !== 0) {\n\t\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tr = Z_OK;\n\n\t\t\t\t\ts.win[q++] = /* (byte) */lit;\n\t\t\t\t\tm--;\n\n\t\t\t\t\tmode = START;\n\t\t\t\t\tbreak;\n\t\t\t\tcase WASH: // o: got eob, possibly more output\n\t\t\t\t\tif (k > 7) { // return unused byte, if any\n\t\t\t\t\t\tk -= 8;\n\t\t\t\t\t\tn++;\n\t\t\t\t\t\tp--; // can always return one\n\t\t\t\t\t}\n\n\t\t\t\t\ts.write = q;\n\t\t\t\t\tr = s.inflate_flush(z, r);\n\t\t\t\t\tq = s.write;\n\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t\t\t\tif (s.read != s.write) {\n\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tmode = END;\n\t\t\t\t/* falls through */\n\t\t\t\tcase END:\n\t\t\t\t\tr = Z_STREAM_END;\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\t\t\t\t\treturn s.inflate_flush(z, r);\n\n\t\t\t\tcase BADCODE: // x: got error\n\n\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\t\t\t\t\treturn s.inflate_flush(z, r);\n\n\t\t\t\tdefault:\n\t\t\t\t\tr = Z_STREAM_ERROR;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t}\n\t\t}\n\t};\n\n\tthat.free = function () {\n\t\t// ZFREE(z, c);\n\t};\n\n}\n\n// InfBlocks\n\n// Table for deflate from PKZIP's appnote.txt.\nconst border = [ // Order of the bit length code lengths\n\t16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n\nconst TYPE = 0; // get type bits (3, including end bit)\nconst LENS = 1; // get lengths for stored\nconst STORED = 2;// processing stored block\nconst TABLE = 3; // get table lengths\nconst BTREE = 4; // get bit lengths tree for a dynamic\n// block\nconst DTREE = 5; // get length, distance trees for a\n// dynamic block\nconst CODES = 6; // processing fixed or dynamic block\nconst DRY = 7; // output remaining win bytes\nconst DONELOCKS = 8; // finished last block, done\nconst BADBLOCKS = 9; // ot a data error--stuck here\n\nfunction InfBlocks(z, w) {\n\tconst that = this;\n\n\tlet mode = TYPE; // current inflate_block mode\n\n\tlet left = 0; // if STORED, bytes left to copy\n\n\tlet table = 0; // table lengths (14 bits)\n\tlet index = 0; // index into blens (or border)\n\tlet blens; // bit lengths of codes\n\tconst bb = [0]; // bit length tree depth\n\tconst tb = [0]; // bit length decoding tree\n\n\tconst codes = new InfCodes(); // if CODES, current state\n\n\tlet last = 0; // true if this block is the last block\n\n\tlet hufts = new Int32Array(MANY * 3); // single malloc for tree space\n\tconst check = 0; // check on output\n\tconst inftree = new InfTree();\n\n\tthat.bitk = 0; // bits in bit buffer\n\tthat.bitb = 0; // bit buffer\n\tthat.win = new Uint8Array(w); // sliding win\n\tthat.end = w; // one byte after sliding win\n\tthat.read = 0; // win read pointer\n\tthat.write = 0; // win write pointer\n\n\tthat.reset = function (z, c) {\n\t\tif (c)\n\t\t\tc[0] = check;\n\t\t// if (mode == BTREE || mode == DTREE) {\n\t\t// }\n\t\tif (mode == CODES) {\n\t\t\tcodes.free(z);\n\t\t}\n\t\tmode = TYPE;\n\t\tthat.bitk = 0;\n\t\tthat.bitb = 0;\n\t\tthat.read = that.write = 0;\n\t};\n\n\tthat.reset(z, null);\n\n\t// copy as much as possible from the sliding win to the output area\n\tthat.inflate_flush = function (z, r) {\n\t\tlet n;\n\t\tlet p;\n\t\tlet q;\n\n\t\t// local copies of source and destination pointers\n\t\tp = z.next_out_index;\n\t\tq = that.read;\n\n\t\t// compute number of bytes to copy as far as end of win\n\t\tn = /* (int) */((q <= that.write ? that.write : that.end) - q);\n\t\tif (n > z.avail_out)\n\t\t\tn = z.avail_out;\n\t\tif (n !== 0 && r == Z_BUF_ERROR)\n\t\t\tr = Z_OK;\n\n\t\t// update counters\n\t\tz.avail_out -= n;\n\t\tz.total_out += n;\n\n\t\t// copy as far as end of win\n\t\tz.next_out.set(that.win.subarray(q, q + n), p);\n\t\tp += n;\n\t\tq += n;\n\n\t\t// see if more to copy at beginning of win\n\t\tif (q == that.end) {\n\t\t\t// wrap pointers\n\t\t\tq = 0;\n\t\t\tif (that.write == that.end)\n\t\t\t\tthat.write = 0;\n\n\t\t\t// compute bytes to copy\n\t\t\tn = that.write - q;\n\t\t\tif (n > z.avail_out)\n\t\t\t\tn = z.avail_out;\n\t\t\tif (n !== 0 && r == Z_BUF_ERROR)\n\t\t\t\tr = Z_OK;\n\n\t\t\t// update counters\n\t\t\tz.avail_out -= n;\n\t\t\tz.total_out += n;\n\n\t\t\t// copy\n\t\t\tz.next_out.set(that.win.subarray(q, q + n), p);\n\t\t\tp += n;\n\t\t\tq += n;\n\t\t}\n\n\t\t// update pointers\n\t\tz.next_out_index = p;\n\t\tthat.read = q;\n\n\t\t// done\n\t\treturn r;\n\t};\n\n\tthat.proc = function (z, r) {\n\t\tlet t; // temporary storage\n\t\tlet b; // bit buffer\n\t\tlet k; // bits in bit buffer\n\t\tlet p; // input data pointer\n\t\tlet n; // bytes available there\n\t\tlet q; // output win write pointer\n\t\tlet m; // bytes to end of win or read pointer\n\n\t\tlet i;\n\n\t\t// copy input/output information to locals (UPDATE macro restores)\n\t\t// {\n\t\tp = z.next_in_index;\n\t\tn = z.avail_in;\n\t\tb = that.bitb;\n\t\tk = that.bitk;\n\t\t// }\n\t\t// {\n\t\tq = that.write;\n\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\t\t// }\n\n\t\t// process input based on current state\n\t\t// DEBUG dtree\n\t\t// eslint-disable-next-line no-constant-condition\n\t\twhile (true) {\n\t\t\tlet bl, bd, tl, td, bl_, bd_, tl_, td_;\n\t\t\tswitch (mode) {\n\t\t\t\tcase TYPE:\n\n\t\t\t\t\twhile (k < (3)) {\n\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\t\t\t\t\tt = /* (int) */(b & 7);\n\t\t\t\t\tlast = t & 1;\n\n\t\t\t\t\tswitch (t >>> 1) {\n\t\t\t\t\t\tcase 0: // stored\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tb >>>= (3);\n\t\t\t\t\t\t\tk -= (3);\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\tt = k & 7; // go to byte boundary\n\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tb >>>= (t);\n\t\t\t\t\t\t\tk -= (t);\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\tmode = LENS; // get length of stored block\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1: // fixed\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tbl = []; // new Array(1);\n\t\t\t\t\t\t\tbd = []; // new Array(1);\n\t\t\t\t\t\t\ttl = [[]]; // new Array(1);\n\t\t\t\t\t\t\ttd = [[]]; // new Array(1);\n\n\t\t\t\t\t\t\tInfTree.inflate_trees_fixed(bl, bd, tl, td);\n\t\t\t\t\t\t\tcodes.init(bl[0], bd[0], tl[0], 0, td[0], 0);\n\t\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tb >>>= (3);\n\t\t\t\t\t\t\tk -= (3);\n\t\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t\tmode = CODES;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2: // dynamic\n\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tb >>>= (3);\n\t\t\t\t\t\t\tk -= (3);\n\t\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t\tmode = TABLE;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3: // illegal\n\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tb >>>= (3);\n\t\t\t\t\t\t\tk -= (3);\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\t\tz.msg = \"invalid block type\";\n\t\t\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase LENS:\n\n\t\t\t\t\twhile (k < (32)) {\n\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((((~b) >>> 16) & 0xffff) != (b & 0xffff)) {\n\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\tz.msg = \"invalid stored block lengths\";\n\t\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tleft = (b & 0xffff);\n\t\t\t\t\tb = k = 0; // dump bits\n\t\t\t\t\tmode = left !== 0 ? STORED : (last !== 0 ? DRY : TYPE);\n\t\t\t\t\tbreak;\n\t\t\t\tcase STORED:\n\t\t\t\t\tif (n === 0) {\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\tif (q == that.end && that.read !== 0) {\n\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\tr = that.inflate_flush(z, r);\n\t\t\t\t\t\t\tq = that.write;\n\t\t\t\t\t\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\t\t\t\t\t\t\tif (q == that.end && that.read !== 0) {\n\t\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tr = Z_OK;\n\n\t\t\t\t\tt = left;\n\t\t\t\t\tif (t > n)\n\t\t\t\t\t\tt = n;\n\t\t\t\t\tif (t > m)\n\t\t\t\t\t\tt = m;\n\t\t\t\t\tthat.win.set(z.read_buf(p, t), q);\n\t\t\t\t\tp += t;\n\t\t\t\t\tn -= t;\n\t\t\t\t\tq += t;\n\t\t\t\t\tm -= t;\n\t\t\t\t\tif ((left -= t) !== 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tmode = last !== 0 ? DRY : TYPE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TABLE:\n\n\t\t\t\t\twhile (k < (14)) {\n\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\ttable = t = (b & 0x3fff);\n\t\t\t\t\tif ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) {\n\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\tz.msg = \"too many length or distance symbols\";\n\t\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tt = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);\n\t\t\t\t\tif (!blens || blens.length < t) {\n\t\t\t\t\t\tblens = []; // new Array(t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (i = 0; i < t; i++) {\n\t\t\t\t\t\t\tblens[i] = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// {\n\t\t\t\t\tb >>>= (14);\n\t\t\t\t\tk -= (14);\n\t\t\t\t\t// }\n\n\t\t\t\t\tindex = 0;\n\t\t\t\t\tmode = BTREE;\n\t\t\t\t/* falls through */\n\t\t\t\tcase BTREE:\n\t\t\t\t\twhile (index < 4 + (table >>> 10)) {\n\t\t\t\t\t\twhile (k < (3)) {\n\t\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tn--;\n\t\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\t\tk += 8;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tblens[border[index++]] = b & 7;\n\n\t\t\t\t\t\t// {\n\t\t\t\t\t\tb >>>= (3);\n\t\t\t\t\t\tk -= (3);\n\t\t\t\t\t\t// }\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (index < 19) {\n\t\t\t\t\t\tblens[border[index++]] = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tbb[0] = 7;\n\t\t\t\t\tt = inftree.inflate_trees_bits(blens, bb, tb, hufts, z);\n\t\t\t\t\tif (t != Z_OK) {\n\t\t\t\t\t\tr = t;\n\t\t\t\t\t\tif (r == Z_DATA_ERROR) {\n\t\t\t\t\t\t\tblens = null;\n\t\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\n\t\t\t\t\tindex = 0;\n\t\t\t\t\tmode = DTREE;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DTREE:\n\t\t\t\t\t// eslint-disable-next-line no-constant-condition\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tt = table;\n\t\t\t\t\t\tif (index >= 258 + (t & 0x1f) + ((t >> 5) & 0x1f)) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet j, c;\n\n\t\t\t\t\t\tt = bb[0];\n\n\t\t\t\t\t\twhile (k < (t)) {\n\t\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tn--;\n\t\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\t\tk += 8;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if (tb[0] == -1) {\n\t\t\t\t\t\t// System.err.println(\"null...\");\n\t\t\t\t\t\t// }\n\n\t\t\t\t\t\tt = hufts[(tb[0] + (b & inflate_mask[t])) * 3 + 1];\n\t\t\t\t\t\tc = hufts[(tb[0] + (b & inflate_mask[t])) * 3 + 2];\n\n\t\t\t\t\t\tif (c < 16) {\n\t\t\t\t\t\t\tb >>>= (t);\n\t\t\t\t\t\t\tk -= (t);\n\t\t\t\t\t\t\tblens[index++] = c;\n\t\t\t\t\t\t} else { // c == 16..18\n\t\t\t\t\t\t\ti = c == 18 ? 7 : c - 14;\n\t\t\t\t\t\t\tj = c == 18 ? 11 : 3;\n\n\t\t\t\t\t\t\twhile (k < (t + i)) {\n\t\t\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tn--;\n\t\t\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\t\t\tk += 8;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tb >>>= (t);\n\t\t\t\t\t\t\tk -= (t);\n\n\t\t\t\t\t\t\tj += (b & inflate_mask[i]);\n\n\t\t\t\t\t\t\tb >>>= (i);\n\t\t\t\t\t\t\tk -= (i);\n\n\t\t\t\t\t\t\ti = index;\n\t\t\t\t\t\t\tt = table;\n\t\t\t\t\t\t\tif (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || (c == 16 && i < 1)) {\n\t\t\t\t\t\t\t\tblens = null;\n\t\t\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\t\t\tz.msg = \"invalid bit length repeat\";\n\t\t\t\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tc = c == 16 ? blens[i - 1] : 0;\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tblens[i++] = c;\n\t\t\t\t\t\t\t} while (--j !== 0);\n\t\t\t\t\t\t\tindex = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttb[0] = -1;\n\t\t\t\t\t// {\n\t\t\t\t\tbl_ = []; // new Array(1);\n\t\t\t\t\tbd_ = []; // new Array(1);\n\t\t\t\t\ttl_ = []; // new Array(1);\n\t\t\t\t\ttd_ = []; // new Array(1);\n\t\t\t\t\tbl_[0] = 9; // must be <= 9 for lookahead assumptions\n\t\t\t\t\tbd_[0] = 6; // must be <= 9 for lookahead assumptions\n\n\t\t\t\t\tt = table;\n\t\t\t\t\tt = inftree.inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), blens, bl_, bd_, tl_, td_, hufts, z);\n\n\t\t\t\t\tif (t != Z_OK) {\n\t\t\t\t\t\tif (t == Z_DATA_ERROR) {\n\t\t\t\t\t\t\tblens = null;\n\t\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tr = t;\n\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tcodes.init(bl_[0], bd_[0], hufts, tl_[0], hufts, td_[0]);\n\t\t\t\t\t// }\n\t\t\t\t\tmode = CODES;\n\t\t\t\t/* falls through */\n\t\t\t\tcase CODES:\n\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\tthat.write = q;\n\n\t\t\t\t\tif ((r = codes.proc(that, z, r)) != Z_STREAM_END) {\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tr = Z_OK;\n\t\t\t\t\tcodes.free(z);\n\n\t\t\t\t\tp = z.next_in_index;\n\t\t\t\t\tn = z.avail_in;\n\t\t\t\t\tb = that.bitb;\n\t\t\t\t\tk = that.bitk;\n\t\t\t\t\tq = that.write;\n\t\t\t\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\n\t\t\t\t\tif (last === 0) {\n\t\t\t\t\t\tmode = TYPE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tmode = DRY;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DRY:\n\t\t\t\t\tthat.write = q;\n\t\t\t\t\tr = that.inflate_flush(z, r);\n\t\t\t\t\tq = that.write;\n\t\t\t\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\t\t\t\t\tif (that.read != that.write) {\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tmode = DONELOCKS;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DONELOCKS:\n\t\t\t\t\tr = Z_STREAM_END;\n\n\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\tthat.write = q;\n\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\tcase BADBLOCKS:\n\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\tthat.write = q;\n\t\t\t\t\treturn that.inflate_flush(z, r);\n\n\t\t\t\tdefault:\n\t\t\t\t\tr = Z_STREAM_ERROR;\n\n\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\tthat.write = q;\n\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t}\n\t\t}\n\t};\n\n\tthat.free = function (z) {\n\t\tthat.reset(z, null);\n\t\tthat.win = null;\n\t\thufts = null;\n\t\t// ZFREE(z, s);\n\t};\n\n\tthat.set_dictionary = function (d, start, n) {\n\t\tthat.win.set(d.subarray(start, start + n), 0);\n\t\tthat.read = that.write = n;\n\t};\n\n\t// Returns true if inflate is currently at the end of a block generated\n\t// by Z_SYNC_FLUSH or Z_FULL_FLUSH.\n\tthat.sync_point = function () {\n\t\treturn mode == LENS ? 1 : 0;\n\t};\n\n}\n\n// Inflate\n\n// preset dictionary flag in zlib header\nconst PRESET_DICT = 0x20;\n\nconst Z_DEFLATED = 8;\n\nconst METHOD = 0; // waiting for method byte\nconst FLAG = 1; // waiting for flag byte\nconst DICT4 = 2; // four dictionary check bytes to go\nconst DICT3 = 3; // three dictionary check bytes to go\nconst DICT2 = 4; // two dictionary check bytes to go\nconst DICT1 = 5; // one dictionary check byte to go\nconst DICT0 = 6; // waiting for inflateSetDictionary\nconst BLOCKS = 7; // decompressing blocks\nconst DONE = 12; // finished check, done\nconst BAD = 13; // got an error--stay here\n\nconst mark = [0, 0, 0xff, 0xff];\n\nfunction Inflate() {\n\tconst that = this;\n\n\tthat.mode = 0; // current inflate mode\n\n\t// mode dependent information\n\tthat.method = 0; // if FLAGS, method byte\n\n\t// if CHECK, check values to compare\n\tthat.was = [0]; // new Array(1); // computed check value\n\tthat.need = 0; // stream check value\n\n\t// if BAD, inflateSync's marker bytes count\n\tthat.marker = 0;\n\n\t// mode independent information\n\tthat.wbits = 0; // log2(win size) (8..15, defaults to 15)\n\n\t// this.blocks; // current inflate_blocks state\n\n\tfunction inflateReset(z) {\n\t\tif (!z || !z.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\n\t\tz.total_in = z.total_out = 0;\n\t\tz.msg = null;\n\t\tz.istate.mode = BLOCKS;\n\t\tz.istate.blocks.reset(z, null);\n\t\treturn Z_OK;\n\t}\n\n\tthat.inflateEnd = function (z) {\n\t\tif (that.blocks)\n\t\t\tthat.blocks.free(z);\n\t\tthat.blocks = null;\n\t\t// ZFREE(z, z->state);\n\t\treturn Z_OK;\n\t};\n\n\tthat.inflateInit = function (z, w) {\n\t\tz.msg = null;\n\t\tthat.blocks = null;\n\n\t\t// set win size\n\t\tif (w < 8 || w > 15) {\n\t\t\tthat.inflateEnd(z);\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\t\tthat.wbits = w;\n\n\t\tz.istate.blocks = new InfBlocks(z, 1 << w);\n\n\t\t// reset state\n\t\tinflateReset(z);\n\t\treturn Z_OK;\n\t};\n\n\tthat.inflate = function (z, f) {\n\t\tlet r;\n\t\tlet b;\n\n\t\tif (!z || !z.istate || !z.next_in)\n\t\t\treturn Z_STREAM_ERROR;\n\t\tconst istate = z.istate;\n\t\tf = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;\n\t\tr = Z_BUF_ERROR;\n\t\t// eslint-disable-next-line no-constant-condition\n\t\twhile (true) {\n\t\t\tswitch (istate.mode) {\n\t\t\t\tcase METHOD:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tif (((istate.method = z.read_byte(z.next_in_index++)) & 0xf) != Z_DEFLATED) {\n\t\t\t\t\t\tistate.mode = BAD;\n\t\t\t\t\t\tz.msg = \"unknown compression method\";\n\t\t\t\t\t\tistate.marker = 5; // can't try inflateSync\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ((istate.method >> 4) + 8 > istate.wbits) {\n\t\t\t\t\t\tistate.mode = BAD;\n\t\t\t\t\t\tz.msg = \"invalid win size\";\n\t\t\t\t\t\tistate.marker = 5; // can't try inflateSync\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tistate.mode = FLAG;\n\t\t\t\t/* falls through */\n\t\t\t\tcase FLAG:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tb = (z.read_byte(z.next_in_index++)) & 0xff;\n\n\t\t\t\t\tif ((((istate.method << 8) + b) % 31) !== 0) {\n\t\t\t\t\t\tistate.mode = BAD;\n\t\t\t\t\t\tz.msg = \"incorrect header check\";\n\t\t\t\t\t\tistate.marker = 5; // can't try inflateSync\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((b & PRESET_DICT) === 0) {\n\t\t\t\t\t\tistate.mode = BLOCKS;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tistate.mode = DICT4;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DICT4:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tistate.need = ((z.read_byte(z.next_in_index++) & 0xff) << 24) & 0xff000000;\n\t\t\t\t\tistate.mode = DICT3;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DICT3:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tistate.need += ((z.read_byte(z.next_in_index++) & 0xff) << 16) & 0xff0000;\n\t\t\t\t\tistate.mode = DICT2;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DICT2:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tistate.need += ((z.read_byte(z.next_in_index++) & 0xff) << 8) & 0xff00;\n\t\t\t\t\tistate.mode = DICT1;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DICT1:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tistate.need += (z.read_byte(z.next_in_index++) & 0xff);\n\t\t\t\t\tistate.mode = DICT0;\n\t\t\t\t\treturn Z_NEED_DICT;\n\t\t\t\tcase DICT0:\n\t\t\t\t\tistate.mode = BAD;\n\t\t\t\t\tz.msg = \"need dictionary\";\n\t\t\t\t\tistate.marker = 0; // can try inflateSync\n\t\t\t\t\treturn Z_STREAM_ERROR;\n\t\t\t\tcase BLOCKS:\n\n\t\t\t\t\tr = istate.blocks.proc(z, r);\n\t\t\t\t\tif (r == Z_DATA_ERROR) {\n\t\t\t\t\t\tistate.mode = BAD;\n\t\t\t\t\t\tistate.marker = 0; // can try inflateSync\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (r == Z_OK) {\n\t\t\t\t\t\tr = f;\n\t\t\t\t\t}\n\t\t\t\t\tif (r != Z_STREAM_END) {\n\t\t\t\t\t\treturn r;\n\t\t\t\t\t}\n\t\t\t\t\tr = f;\n\t\t\t\t\tistate.blocks.reset(z, istate.was);\n\t\t\t\t\tistate.mode = DONE;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DONE:\n\t\t\t\t\tz.avail_in = 0;\n\t\t\t\t\treturn Z_STREAM_END;\n\t\t\t\tcase BAD:\n\t\t\t\t\treturn Z_DATA_ERROR;\n\t\t\t\tdefault:\n\t\t\t\t\treturn Z_STREAM_ERROR;\n\t\t\t}\n\t\t}\n\t};\n\n\tthat.inflateSetDictionary = function (z, dictionary, dictLength) {\n\t\tlet index = 0, length = dictLength;\n\t\tif (!z || !z.istate || z.istate.mode != DICT0)\n\t\t\treturn Z_STREAM_ERROR;\n\t\tconst istate = z.istate;\n\t\tif (length >= (1 << istate.wbits)) {\n\t\t\tlength = (1 << istate.wbits) - 1;\n\t\t\tindex = dictLength - length;\n\t\t}\n\t\tistate.blocks.set_dictionary(dictionary, index, length);\n\t\tistate.mode = BLOCKS;\n\t\treturn Z_OK;\n\t};\n\n\tthat.inflateSync = function (z) {\n\t\tlet n; // number of bytes to look at\n\t\tlet p; // pointer to bytes\n\t\tlet m; // number of marker bytes found in a row\n\t\tlet r, w; // temporaries to save total_in and total_out\n\n\t\t// set up\n\t\tif (!z || !z.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\tconst istate = z.istate;\n\t\tif (istate.mode != BAD) {\n\t\t\tistate.mode = BAD;\n\t\t\tistate.marker = 0;\n\t\t}\n\t\tif ((n = z.avail_in) === 0)\n\t\t\treturn Z_BUF_ERROR;\n\t\tp = z.next_in_index;\n\t\tm = istate.marker;\n\n\t\t// search\n\t\twhile (n !== 0 && m < 4) {\n\t\t\tif (z.read_byte(p) == mark[m]) {\n\t\t\t\tm++;\n\t\t\t} else if (z.read_byte(p) !== 0) {\n\t\t\t\tm = 0;\n\t\t\t} else {\n\t\t\t\tm = 4 - m;\n\t\t\t}\n\t\t\tp++;\n\t\t\tn--;\n\t\t}\n\n\t\t// restore\n\t\tz.total_in += p - z.next_in_index;\n\t\tz.next_in_index = p;\n\t\tz.avail_in = n;\n\t\tistate.marker = m;\n\n\t\t// return no joy or set up to restart on a new block\n\t\tif (m != 4) {\n\t\t\treturn Z_DATA_ERROR;\n\t\t}\n\t\tr = z.total_in;\n\t\tw = z.total_out;\n\t\tinflateReset(z);\n\t\tz.total_in = r;\n\t\tz.total_out = w;\n\t\tistate.mode = BLOCKS;\n\t\treturn Z_OK;\n\t};\n\n\t// Returns true if inflate is currently at the end of a block generated\n\t// by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP\n\t// implementation to provide an additional safety check. PPP uses\n\t// Z_SYNC_FLUSH\n\t// but removes the length bytes of the resulting empty stored block. When\n\t// decompressing, PPP checks that at the end of input packet, inflate is\n\t// waiting for these length bytes.\n\tthat.inflateSyncPoint = function (z) {\n\t\tif (!z || !z.istate || !z.istate.blocks)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn z.istate.blocks.sync_point();\n\t};\n}\n\n// ZStream\n\nfunction ZStream() {\n}\n\nZStream.prototype = {\n\tinflateInit: function (bits) {\n\t\tconst that = this;\n\t\tthat.istate = new Inflate();\n\t\tif (!bits)\n\t\t\tbits = MAX_BITS;\n\t\treturn that.istate.inflateInit(that, bits);\n\t},\n\n\tinflate: function (f) {\n\t\tconst that = this;\n\t\tif (!that.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn that.istate.inflate(that, f);\n\t},\n\n\tinflateEnd: function () {\n\t\tconst that = this;\n\t\tif (!that.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\tconst ret = that.istate.inflateEnd(that);\n\t\tthat.istate = null;\n\t\treturn ret;\n\t},\n\n\tinflateSync: function () {\n\t\tconst that = this;\n\t\tif (!that.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn that.istate.inflateSync(that);\n\t},\n\tinflateSetDictionary: function (dictionary, dictLength) {\n\t\tconst that = this;\n\t\tif (!that.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn that.istate.inflateSetDictionary(that, dictionary, dictLength);\n\t},\n\tread_byte: function (start) {\n\t\tconst that = this;\n\t\treturn that.next_in[start];\n\t},\n\tread_buf: function (start, size) {\n\t\tconst that = this;\n\t\treturn that.next_in.subarray(start, start + size);\n\t}\n};\n\n// Inflater\n\nfunction ZipInflate(options) {\n\tconst that = this;\n\tconst z = new ZStream();\n\tconst bufsize = options && options.chunkSize ? Math.floor(options.chunkSize * 2) : 128 * 1024;\n\tconst flush = Z_NO_FLUSH;\n\tconst buf = new Uint8Array(bufsize);\n\tlet nomoreinput = false;\n\n\tz.inflateInit();\n\tz.next_out = buf;\n\n\tthat.append = function (data, onprogress) {\n\t\tconst buffers = [];\n\t\tlet err, array, lastIndex = 0, bufferIndex = 0, bufferSize = 0;\n\t\tif (data.length === 0)\n\t\t\treturn;\n\t\tz.next_in_index = 0;\n\t\tz.next_in = data;\n\t\tz.avail_in = data.length;\n\t\tdo {\n\t\t\tz.next_out_index = 0;\n\t\t\tz.avail_out = bufsize;\n\t\t\tif ((z.avail_in === 0) && (!nomoreinput)) { // if buffer is empty and more input is available, refill it\n\t\t\t\tz.next_in_index = 0;\n\t\t\t\tnomoreinput = true;\n\t\t\t}\n\t\t\terr = z.inflate(flush);\n\t\t\tif (nomoreinput && (err === Z_BUF_ERROR)) {\n\t\t\t\tif (z.avail_in !== 0)\n\t\t\t\t\tthrow new Error(\"inflating: bad input\");\n\t\t\t} else if (err !== Z_OK && err !== Z_STREAM_END)\n\t\t\t\tthrow new Error(\"inflating: \" + z.msg);\n\t\t\tif ((nomoreinput || err === Z_STREAM_END) && (z.avail_in === data.length))\n\t\t\t\tthrow new Error(\"inflating: bad input\");\n\t\t\tif (z.next_out_index)\n\t\t\t\tif (z.next_out_index === bufsize)\n\t\t\t\t\tbuffers.push(new Uint8Array(buf));\n\t\t\t\telse\n\t\t\t\t\tbuffers.push(buf.slice(0, z.next_out_index));\n\t\t\tbufferSize += z.next_out_index;\n\t\t\tif (onprogress && z.next_in_index > 0 && z.next_in_index != lastIndex) {\n\t\t\t\tonprogress(z.next_in_index);\n\t\t\t\tlastIndex = z.next_in_index;\n\t\t\t}\n\t\t} while (z.avail_in > 0 || z.avail_out === 0);\n\t\tif (buffers.length > 1) {\n\t\t\tarray = new Uint8Array(bufferSize);\n\t\t\tbuffers.forEach(function (chunk) {\n\t\t\t\tarray.set(chunk, bufferIndex);\n\t\t\t\tbufferIndex += chunk.length;\n\t\t\t});\n\t\t} else {\n\t\t\tarray = buffers[0] || new Uint8Array(0);\n\t\t}\n\t\treturn array;\n\t};\n\tthat.flush = function () {\n\t\tz.inflateEnd();\n\t};\n}\n\nexport default ZipInflate;", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global navigator */\n\nconst DEFAULT_CONFIGURATION = {\n\tchunkSize: 512 * 1024,\n\tmaxWorkers: (typeof navigator != \"undefined\" && navigator.hardwareConcurrency) || 2,\n\tterminateWorkerTimeout: 5000,\n\tuseWebWorkers: true,\n\tworkerScripts: undefined\n};\n\nconst config = Object.assign({}, DEFAULT_CONFIGURATION);\n\nexport {\n\tconfigure,\n\tgetConfiguration\n};\n\nfunction getConfiguration() {\n\treturn config;\n}\n\nfunction configure(configuration) {\n\tif (configuration.baseURL !== undefined) {\n\t\tconfig.baseURL = configuration.baseURL;\n\t}\n\tif (configuration.chunkSize !== undefined) {\n\t\tconfig.chunkSize = configuration.chunkSize;\n\t}\n\tif (configuration.maxWorkers !== undefined) {\n\t\tconfig.maxWorkers = configuration.maxWorkers;\n\t}\n\tif (configuration.terminateWorkerTimeout !== undefined) {\n\t\tconfig.terminateWorkerTimeout = configuration.terminateWorkerTimeout;\n\t}\n\tif (configuration.useWebWorkers !== undefined) {\n\t\tconfig.useWebWorkers = configuration.useWebWorkers;\n\t}\n\tif (configuration.Deflate !== undefined) {\n\t\tconfig.Deflate = configuration.Deflate;\n\t}\n\tif (configuration.Inflate !== undefined) {\n\t\tconfig.Inflate = configuration.Inflate;\n\t}\n\tif (configuration.workerScripts !== undefined) {\n\t\tif (configuration.workerScripts.deflate) {\n\t\t\tif (!Array.isArray(configuration.workerScripts.deflate)) {\n\t\t\t\tthrow new Error(\"workerScripts.deflate must be an array\");\n\t\t\t}\n\t\t\tif (!config.workerScripts) {\n\t\t\t\tconfig.workerScripts = {};\n\t\t\t}\n\t\t\tconfig.workerScripts.deflate = configuration.workerScripts.deflate;\n\t\t}\n\t\tif (configuration.workerScripts.inflate) {\n\t\t\tif (!Array.isArray(configuration.workerScripts.inflate)) {\n\t\t\t\tthrow new Error(\"workerScripts.inflate must be an array\");\n\t\t\t}\n\t\t\tif (!config.workerScripts) {\n\t\t\t\tconfig.workerScripts = {};\n\t\t\t}\n\t\t\tconfig.workerScripts.inflate = configuration.workerScripts.inflate;\n\t\t}\n\t}\n}\n", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst table = [];\nfor (let i = 0; i < 256; i++) {\n\tlet t = i;\n\tfor (let j = 0; j < 8; j++) {\n\t\tif (t & 1) {\n\t\t\tt = (t >>> 1) ^ 0xEDB88320;\n\t\t} else {\n\t\t\tt = t >>> 1;\n\t\t}\n\t}\n\ttable[i] = t;\n}\n\nclass Crc32 {\n\n\tconstructor(crc) {\n\t\tthis.crc = crc || -1;\n\t}\n\n\tappend(data) {\n\t\tlet crc = this.crc | 0;\n\t\tfor (let offset = 0, length = data.length | 0; offset < length; offset++) {\n\t\t\tcrc = (crc >>> 8) ^ table[(crc ^ data[offset]) & 0xFF];\n\t\t}\n\t\tthis.crc = crc;\n\t}\n\n\tget() {\n\t\treturn ~this.crc;\n\t}\n}\n\nexport default Crc32;", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global TextEncoder */\n\nexport default encodeText;\n\nfunction encodeText(value) {\n\tif (typeof TextEncoder == \"undefined\") {\n\t\tvalue = unescape(encodeURIComponent(value));\n\t\tconst result = new Uint8Array(value.length);\n\t\tfor (let i = 0; i < result.length; i++) {\n\t\t\tresult[i] = value.charCodeAt(i);\n\t\t}\n\t\treturn result;\n\t} else {\n\t\treturn new TextEncoder().encode(value);\n\t}\n}", "// Derived from https://github.com/xqdoo00o/jszip/blob/master/lib/sjcl.js and https://github.com/bitwiseshiftleft/sjcl\n\n/*// deno-lint-ignore-file no-this-alias *\n\n/*\n * SJCL is open. You can use, modify and redistribute it under a BSD\n * license or under the GNU GPL, version 2.0.\n */\n\n/** @fileOverview Javascript cryptography implementation.\n *\n * Crush to remove comments, shorten variable names and\n * generally reduce transmission size.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\n/*jslint indent: 2, bitwise: false, nomen: false, plusplus: false, white: false, regexp: false */\n\n/** @fileOverview Arrays of bits, encoded as arrays of Numbers.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\n/**\n * Arrays of bits, encoded as arrays of Numbers.\n * @namespace\n * @description\n * <p>\n * These objects are the currency accepted by SJCL's crypto functions.\n * </p>\n *\n * <p>\n * Most of our crypto primitives operate on arrays of 4-byte words internally,\n * but many of them can take arguments that are not a multiple of 4 bytes.\n * This library encodes arrays of bits (whose size need not be a multiple of 8\n * bits) as arrays of 32-bit words.  The bits are packed, big-endian, into an\n * array of words, 32 bits at a time.  Since the words are double-precision\n * floating point numbers, they fit some extra data.  We use this (in a private,\n * possibly-changing manner) to encode the number of bits actually  present\n * in the last word of the array.\n * </p>\n *\n * <p>\n * Because bitwise ops clear this out-of-band data, these arrays can be passed\n * to ciphers like AES which want arrays of words.\n * </p>\n */\nconst bitArray = {\n\t/**\n\t * Concatenate two bit arrays.\n\t * @param {bitArray} a1 The first array.\n\t * @param {bitArray} a2 The second array.\n\t * @return {bitArray} The concatenation of a1 and a2.\n\t */\n\tconcat(a1, a2) {\n\t\tif (a1.length === 0 || a2.length === 0) {\n\t\t\treturn a1.concat(a2);\n\t\t}\n\n\t\tconst last = a1[a1.length - 1], shift = bitArray.getPartial(last);\n\t\tif (shift === 32) {\n\t\t\treturn a1.concat(a2);\n\t\t} else {\n\t\t\treturn bitArray._shiftRight(a2, shift, last | 0, a1.slice(0, a1.length - 1));\n\t\t}\n\t},\n\n\t/**\n\t * Find the length of an array of bits.\n\t * @param {bitArray} a The array.\n\t * @return {Number} The length of a, in bits.\n\t */\n\tbitLength(a) {\n\t\tconst l = a.length;\n\t\tif (l === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tconst x = a[l - 1];\n\t\treturn (l - 1) * 32 + bitArray.getPartial(x);\n\t},\n\n\t/**\n\t * Truncate an array.\n\t * @param {bitArray} a The array.\n\t * @param {Number} len The length to truncate to, in bits.\n\t * @return {bitArray} A new array, truncated to len bits.\n\t */\n\tclamp(a, len) {\n\t\tif (a.length * 32 < len) {\n\t\t\treturn a;\n\t\t}\n\t\ta = a.slice(0, Math.ceil(len / 32));\n\t\tconst l = a.length;\n\t\tlen = len & 31;\n\t\tif (l > 0 && len) {\n\t\t\ta[l - 1] = bitArray.partial(len, a[l - 1] & 0x80000000 >> (len - 1), 1);\n\t\t}\n\t\treturn a;\n\t},\n\n\t/**\n\t * Make a partial word for a bit array.\n\t * @param {Number} len The number of bits in the word.\n\t * @param {Number} x The bits.\n\t * @param {Number} [_end=0] Pass 1 if x has already been shifted to the high side.\n\t * @return {Number} The partial word.\n\t */\n\tpartial(len, x, _end) {\n\t\tif (len === 32) {\n\t\t\treturn x;\n\t\t}\n\t\treturn (_end ? x | 0 : x << (32 - len)) + len * 0x10000000000;\n\t},\n\n\t/**\n\t * Get the number of bits used by a partial word.\n\t * @param {Number} x The partial word.\n\t * @return {Number} The number of bits used by the partial word.\n\t */\n\tgetPartial(x) {\n\t\treturn Math.round(x / 0x10000000000) || 32;\n\t},\n\n\t/** Shift an array right.\n\t * @param {bitArray} a The array to shift.\n\t * @param {Number} shift The number of bits to shift.\n\t * @param {Number} [carry=0] A byte to carry in\n\t * @param {bitArray} [out=[]] An array to prepend to the output.\n\t * @private\n\t */\n\t_shiftRight(a, shift, carry, out) {\n\t\tif (out === undefined) {\n\t\t\tout = [];\n\t\t}\n\n\t\tfor (; shift >= 32; shift -= 32) {\n\t\t\tout.push(carry);\n\t\t\tcarry = 0;\n\t\t}\n\t\tif (shift === 0) {\n\t\t\treturn out.concat(a);\n\t\t}\n\n\t\tfor (let i = 0; i < a.length; i++) {\n\t\t\tout.push(carry | a[i] >>> shift);\n\t\t\tcarry = a[i] << (32 - shift);\n\t\t}\n\t\tconst last2 = a.length ? a[a.length - 1] : 0;\n\t\tconst shift2 = bitArray.getPartial(last2);\n\t\tout.push(bitArray.partial(shift + shift2 & 31, (shift + shift2 > 32) ? carry : out.pop(), 1));\n\t\treturn out;\n\t}\n};\n\n/** @fileOverview Bit array codec implementations.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\n/**\n * Arrays of bytes\n * @namespace\n */\nconst codec = {\n\tbytes: {\n\t\t/** Convert from a bitArray to an array of bytes. */\n\t\tfromBits(arr) {\n\t\t\tconst bl = bitArray.bitLength(arr);\n\t\t\tconst byteLength = bl / 8;\n\t\t\tconst out = new Uint8Array(byteLength);\n\t\t\tlet tmp;\n\t\t\tfor (let i = 0; i < byteLength; i++) {\n\t\t\t\tif ((i & 3) === 0) {\n\t\t\t\t\ttmp = arr[i / 4];\n\t\t\t\t}\n\t\t\t\tout[i] = tmp >>> 24;\n\t\t\t\ttmp <<= 8;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\t\t/** Convert from an array of bytes to a bitArray. */\n\t\ttoBits(bytes) {\n\t\t\tconst out = [];\n\t\t\tlet i;\n\t\t\tlet tmp = 0;\n\t\t\tfor (i = 0; i < bytes.length; i++) {\n\t\t\t\ttmp = tmp << 8 | bytes[i];\n\t\t\t\tif ((i & 3) === 3) {\n\t\t\t\t\tout.push(tmp);\n\t\t\t\t\ttmp = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i & 3) {\n\t\t\t\tout.push(bitArray.partial(8 * (i & 3), tmp));\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t}\n};\n\nconst hash = {};\n\n/**\n * Context for a SHA-1 operation in progress.\n * @constructor\n */\nhash.sha1 = function (hash) {\n\tif (hash) {\n\t\tthis._h = hash._h.slice(0);\n\t\tthis._buffer = hash._buffer.slice(0);\n\t\tthis._length = hash._length;\n\t} else {\n\t\tthis.reset();\n\t}\n};\n\nhash.sha1.prototype = {\n\t/**\n\t * The hash's block size, in bits.\n\t * @constant\n\t */\n\tblockSize: 512,\n\n\t/**\n\t * Reset the hash state.\n\t * @return this\n\t */\n\treset: function () {\n\t\tconst sha1 = this;\n\t\tsha1._h = this._init.slice(0);\n\t\tsha1._buffer = [];\n\t\tsha1._length = 0;\n\t\treturn sha1;\n\t},\n\n\t/**\n\t * Input several words to the hash.\n\t * @param {bitArray|String} data the data to hash.\n\t * @return this\n\t */\n\tupdate: function (data) {\n\t\tconst sha1 = this;\n\t\tif (typeof data === \"string\") {\n\t\t\tdata = codec.utf8String.toBits(data);\n\t\t}\n\t\tconst b = sha1._buffer = bitArray.concat(sha1._buffer, data);\n\t\tconst ol = sha1._length;\n\t\tconst nl = sha1._length = ol + bitArray.bitLength(data);\n\t\tif (nl > 9007199254740991) {\n\t\t\tthrow new Error(\"Cannot hash more than 2^53 - 1 bits\");\n\t\t}\n\t\tconst c = new Uint32Array(b);\n\t\tlet j = 0;\n\t\tfor (let i = sha1.blockSize + ol - ((sha1.blockSize + ol) & (sha1.blockSize - 1)); i <= nl;\n\t\t\ti += sha1.blockSize) {\n\t\t\tsha1._block(c.subarray(16 * j, 16 * (j + 1)));\n\t\t\tj += 1;\n\t\t}\n\t\tb.splice(0, 16 * j);\n\t\treturn sha1;\n\t},\n\n\t/**\n\t * Complete hashing and output the hash value.\n\t * @return {bitArray} The hash value, an array of 5 big-endian words. TODO\n\t */\n\tfinalize: function () {\n\t\tconst sha1 = this;\n\t\tlet b = sha1._buffer;\n\t\tconst h = sha1._h;\n\n\t\t// Round out and push the buffer\n\t\tb = bitArray.concat(b, [bitArray.partial(1, 1)]);\n\t\t// Round out the buffer to a multiple of 16 words, less the 2 length words.\n\t\tfor (let i = b.length + 2; i & 15; i++) {\n\t\t\tb.push(0);\n\t\t}\n\n\t\t// append the length\n\t\tb.push(Math.floor(sha1._length / 0x100000000));\n\t\tb.push(sha1._length | 0);\n\n\t\twhile (b.length) {\n\t\t\tsha1._block(b.splice(0, 16));\n\t\t}\n\n\t\tsha1.reset();\n\t\treturn h;\n\t},\n\n\t/**\n\t * The SHA-1 initialization vector.\n\t * @private\n\t */\n\t_init: [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0],\n\n\t/**\n\t * The SHA-1 hash key.\n\t * @private\n\t */\n\t_key: [0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6],\n\n\t/**\n\t * The SHA-1 logical functions f(0), f(1), ..., f(79).\n\t * @private\n\t */\n\t_f: function (t, b, c, d) {\n\t\tif (t <= 19) {\n\t\t\treturn (b & c) | (~b & d);\n\t\t} else if (t <= 39) {\n\t\t\treturn b ^ c ^ d;\n\t\t} else if (t <= 59) {\n\t\t\treturn (b & c) | (b & d) | (c & d);\n\t\t} else if (t <= 79) {\n\t\t\treturn b ^ c ^ d;\n\t\t}\n\t},\n\n\t/**\n\t * Circular left-shift operator.\n\t * @private\n\t */\n\t_S: function (n, x) {\n\t\treturn (x << n) | (x >>> 32 - n);\n\t},\n\n\t/**\n\t * Perform one cycle of SHA-1.\n\t * @param {Uint32Array|bitArray} words one block of words.\n\t * @private\n\t */\n\t_block: function (words) {\n\t\tconst sha1 = this;\n\t\tconst h = sha1._h;\n\t\t// When words is passed to _block, it has 16 elements. SHA1 _block\n\t\t// function extends words with new elements (at the end there are 80 elements). \n\t\t// The problem is that if we use Uint32Array instead of Array, \n\t\t// the length of Uint32Array cannot be changed. Thus, we replace words with a \n\t\t// normal Array here.\n\t\tconst w = Array(80); // do not use Uint32Array here as the instantiation is slower\n\t\tfor (let j = 0; j < 16; j++) {\n\t\t\tw[j] = words[j];\n\t\t}\n\n\t\tlet a = h[0];\n\t\tlet b = h[1];\n\t\tlet c = h[2];\n\t\tlet d = h[3];\n\t\tlet e = h[4];\n\n\t\tfor (let t = 0; t <= 79; t++) {\n\t\t\tif (t >= 16) {\n\t\t\t\tw[t] = sha1._S(1, w[t - 3] ^ w[t - 8] ^ w[t - 14] ^ w[t - 16]);\n\t\t\t}\n\t\t\tconst tmp = (sha1._S(5, a) + sha1._f(t, b, c, d) + e + w[t] +\n\t\t\t\tsha1._key[Math.floor(t / 20)]) | 0;\n\t\t\te = d;\n\t\t\td = c;\n\t\t\tc = sha1._S(30, b);\n\t\t\tb = a;\n\t\t\ta = tmp;\n\t\t}\n\n\t\th[0] = (h[0] + a) | 0;\n\t\th[1] = (h[1] + b) | 0;\n\t\th[2] = (h[2] + c) | 0;\n\t\th[3] = (h[3] + d) | 0;\n\t\th[4] = (h[4] + e) | 0;\n\t}\n};\n\n/** @fileOverview Low-level AES implementation.\n *\n * This file contains a low-level implementation of AES, optimized for\n * size and for efficiency on several browsers.  It is based on\n * OpenSSL's aes_core.c, a public-domain implementation by Vincent\n * Rijmen, Antoon Bosselaers and Paulo Barreto.\n *\n * An older version of this implementation is available in the public\n * domain, but this one is (c) Emily Stark, Mike Hamburg, Dan Boneh,\n * Stanford University 2008-2010 and BSD-licensed for liability\n * reasons.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\nconst cipher = {};\n\n/**\n * Schedule out an AES key for both encryption and decryption.  This\n * is a low-level class.  Use a cipher mode to do bulk encryption.\n *\n * @constructor\n * @param {Array} key The key as an array of 4, 6 or 8 words.\n */\ncipher.aes = class {\n\tconstructor(key) {\n\t\t/**\n\t\t * The expanded S-box and inverse S-box tables.  These will be computed\n\t\t * on the client so that we don't have to send them down the wire.\n\t\t *\n\t\t * There are two tables, _tables[0] is for encryption and\n\t\t * _tables[1] is for decryption.\n\t\t *\n\t\t * The first 4 sub-tables are the expanded S-box with MixColumns.  The\n\t\t * last (_tables[01][4]) is the S-box itself.\n\t\t *\n\t\t * @private\n\t\t */\n\t\tconst aes = this;\n\t\taes._tables = [[[], [], [], [], []], [[], [], [], [], []]];\n\n\t\tif (!aes._tables[0][0][0]) {\n\t\t\taes._precompute();\n\t\t}\n\n\t\tconst sbox = aes._tables[0][4];\n\t\tconst decTable = aes._tables[1];\n\t\tconst keyLen = key.length;\n\n\t\tlet i, encKey, decKey, rcon = 1;\n\n\t\tif (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {\n\t\t\tthrow new Error(\"invalid aes key size\");\n\t\t}\n\n\t\taes._key = [encKey = key.slice(0), decKey = []];\n\n\t\t// schedule encryption keys\n\t\tfor (i = keyLen; i < 4 * keyLen + 28; i++) {\n\t\t\tlet tmp = encKey[i - 1];\n\n\t\t\t// apply sbox\n\t\t\tif (i % keyLen === 0 || (keyLen === 8 && i % keyLen === 4)) {\n\t\t\t\ttmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255];\n\n\t\t\t\t// shift rows and add rcon\n\t\t\t\tif (i % keyLen === 0) {\n\t\t\t\t\ttmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;\n\t\t\t\t\trcon = rcon << 1 ^ (rcon >> 7) * 283;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tencKey[i] = encKey[i - keyLen] ^ tmp;\n\t\t}\n\n\t\t// schedule decryption keys\n\t\tfor (let j = 0; i; j++, i--) {\n\t\t\tconst tmp = encKey[j & 3 ? i : i - 4];\n\t\t\tif (i <= 4 || j < 4) {\n\t\t\t\tdecKey[j] = tmp;\n\t\t\t} else {\n\t\t\t\tdecKey[j] = decTable[0][sbox[tmp >>> 24]] ^\n\t\t\t\t\tdecTable[1][sbox[tmp >> 16 & 255]] ^\n\t\t\t\t\tdecTable[2][sbox[tmp >> 8 & 255]] ^\n\t\t\t\t\tdecTable[3][sbox[tmp & 255]];\n\t\t\t}\n\t\t}\n\t}\n\t// public\n\t/* Something like this might appear here eventually\n\tname: \"AES\",\n\tblockSize: 4,\n\tkeySizes: [4,6,8],\n\t*/\n\n\t/**\n\t * Encrypt an array of 4 big-endian words.\n\t * @param {Array} data The plaintext.\n\t * @return {Array} The ciphertext.\n\t */\n\tencrypt(data) {\n\t\treturn this._crypt(data, 0);\n\t}\n\n\t/**\n\t * Decrypt an array of 4 big-endian words.\n\t * @param {Array} data The ciphertext.\n\t * @return {Array} The plaintext.\n\t */\n\tdecrypt(data) {\n\t\treturn this._crypt(data, 1);\n\t}\n\n\t/**\n\t * Expand the S-box tables.\n\t *\n\t * @private\n\t */\n\t_precompute() {\n\t\tconst encTable = this._tables[0];\n\t\tconst decTable = this._tables[1];\n\t\tconst sbox = encTable[4];\n\t\tconst sboxInv = decTable[4];\n\t\tconst d = [];\n\t\tconst th = [];\n\t\tlet xInv, x2, x4, x8;\n\n\t\t// Compute double and third tables\n\t\tfor (let i = 0; i < 256; i++) {\n\t\t\tth[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;\n\t\t}\n\n\t\tfor (let x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {\n\t\t\t// Compute sbox\n\t\t\tlet s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n\t\t\ts = s >> 8 ^ s & 255 ^ 99;\n\t\t\tsbox[x] = s;\n\t\t\tsboxInv[s] = x;\n\n\t\t\t// Compute MixColumns\n\t\t\tx8 = d[x4 = d[x2 = d[x]]];\n\t\t\tlet tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n\t\t\tlet tEnc = d[s] * 0x101 ^ s * 0x1010100;\n\n\t\t\tfor (let i = 0; i < 4; i++) {\n\t\t\t\tencTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n\t\t\t\tdecTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;\n\t\t\t}\n\t\t}\n\n\t\t// Compactify.  Considerable speedup on Firefox.\n\t\tfor (let i = 0; i < 5; i++) {\n\t\t\tencTable[i] = encTable[i].slice(0);\n\t\t\tdecTable[i] = decTable[i].slice(0);\n\t\t}\n\t}\n\n\t/**\n\t * Encryption and decryption core.\n\t * @param {Array} input Four words to be encrypted or decrypted.\n\t * @param dir The direction, 0 for encrypt and 1 for decrypt.\n\t * @return {Array} The four encrypted or decrypted words.\n\t * @private\n\t */\n\t_crypt(input, dir) {\n\t\tif (input.length !== 4) {\n\t\t\tthrow new Error(\"invalid aes block size\");\n\t\t}\n\n\t\tconst key = this._key[dir];\n\n\t\tconst nInnerRounds = key.length / 4 - 2;\n\t\tconst out = [0, 0, 0, 0];\n\t\tconst table = this._tables[dir];\n\n\t\t// load up the tables\n\t\tconst t0 = table[0];\n\t\tconst t1 = table[1];\n\t\tconst t2 = table[2];\n\t\tconst t3 = table[3];\n\t\tconst sbox = table[4];\n\n\t\t// state variables a,b,c,d are loaded with pre-whitened data\n\t\tlet a = input[0] ^ key[0];\n\t\tlet b = input[dir ? 3 : 1] ^ key[1];\n\t\tlet c = input[2] ^ key[2];\n\t\tlet d = input[dir ? 1 : 3] ^ key[3];\n\t\tlet kIndex = 4;\n\t\tlet a2, b2, c2;\n\n\t\t// Inner rounds.  Cribbed from OpenSSL.\n\t\tfor (let i = 0; i < nInnerRounds; i++) {\n\t\t\ta2 = t0[a >>> 24] ^ t1[b >> 16 & 255] ^ t2[c >> 8 & 255] ^ t3[d & 255] ^ key[kIndex];\n\t\t\tb2 = t0[b >>> 24] ^ t1[c >> 16 & 255] ^ t2[d >> 8 & 255] ^ t3[a & 255] ^ key[kIndex + 1];\n\t\t\tc2 = t0[c >>> 24] ^ t1[d >> 16 & 255] ^ t2[a >> 8 & 255] ^ t3[b & 255] ^ key[kIndex + 2];\n\t\t\td = t0[d >>> 24] ^ t1[a >> 16 & 255] ^ t2[b >> 8 & 255] ^ t3[c & 255] ^ key[kIndex + 3];\n\t\t\tkIndex += 4;\n\t\t\ta = a2; b = b2; c = c2;\n\t\t}\n\n\t\t// Last round.\n\t\tfor (let i = 0; i < 4; i++) {\n\t\t\tout[dir ? 3 & -i : i] =\n\t\t\t\tsbox[a >>> 24] << 24 ^\n\t\t\t\tsbox[b >> 16 & 255] << 16 ^\n\t\t\t\tsbox[c >> 8 & 255] << 8 ^\n\t\t\t\tsbox[d & 255] ^\n\t\t\t\tkey[kIndex++];\n\t\t\ta2 = a; a = b; b = c; c = d; d = a2;\n\t\t}\n\n\t\treturn out;\n\t}\n};\n\n/**\n * Random values\n * @namespace\n */\nconst random = {\n\t/** \n\t * Generate random words with pure js, cryptographically not as strong & safe as native implementation.\n\t * @param {TypedArray} typedArray The array to fill.\n\t * @return {TypedArray} The random values.\n\t */\n\tgetRandomValues(typedArray) {\n\t\tconst words = new Uint32Array(typedArray.buffer);\n\t\tconst r = (m_w) => {\n\t\t\tlet m_z = 0x3ade68b1;\n\t\t\tconst mask = 0xffffffff;\n\t\t\treturn function () {\n\t\t\t\tm_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;\n\t\t\t\tm_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;\n\t\t\t\tconst result = ((((m_z << 0x10) + m_w) & mask) / 0x100000000) + .5;\n\t\t\t\treturn result * (Math.random() > .5 ? 1 : -1);\n\t\t\t};\n\t\t};\n\t\tfor (let i = 0, rcache; i < typedArray.length; i += 4) {\n\t\t\tconst _r = r((rcache || Math.random()) * 0x100000000);\n\t\t\trcache = _r() * 0x3ade67b7;\n\t\t\twords[i / 4] = (_r() * 0x100000000) | 0;\n\t\t}\n\t\treturn typedArray;\n\t}\n};\n\n/** @fileOverview CTR mode implementation.\n *\n * Special thanks to Roy Nicholson for pointing out a bug in our\n * implementation.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\n/** Brian Gladman's CTR Mode.\n* @constructor\n* @param {Object} _prf The aes instance to generate key.\n* @param {bitArray} _iv The iv for ctr mode, it must be 128 bits.\n*/\n\nconst mode = {};\n\n/**\n * Brian Gladman's CTR Mode.\n * @namespace\n */\nmode.ctrGladman = class {\n\tconstructor(prf, iv) {\n\t\tthis._prf = prf;\n\t\tthis._initIv = iv;\n\t\tthis._iv = iv;\n\t}\n\n\treset() {\n\t\tthis._iv = this._initIv;\n\t}\n\n\t/** Input some data to calculate.\n\t * @param {bitArray} data the data to process, it must be intergral multiple of 128 bits unless it's the last.\n\t */\n\tupdate(data) {\n\t\treturn this.calculate(this._prf, data, this._iv);\n\t}\n\n\tincWord(word) {\n\t\tif (((word >> 24) & 0xff) === 0xff) { //overflow\n\t\t\tlet b1 = (word >> 16) & 0xff;\n\t\t\tlet b2 = (word >> 8) & 0xff;\n\t\t\tlet b3 = word & 0xff;\n\n\t\t\tif (b1 === 0xff) { // overflow b1   \n\t\t\t\tb1 = 0;\n\t\t\t\tif (b2 === 0xff) {\n\t\t\t\t\tb2 = 0;\n\t\t\t\t\tif (b3 === 0xff) {\n\t\t\t\t\t\tb3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t++b3;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t++b2;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t++b1;\n\t\t\t}\n\n\t\t\tword = 0;\n\t\t\tword += (b1 << 16);\n\t\t\tword += (b2 << 8);\n\t\t\tword += b3;\n\t\t} else {\n\t\t\tword += (0x01 << 24);\n\t\t}\n\t\treturn word;\n\t}\n\n\tincCounter(counter) {\n\t\tif ((counter[0] = this.incWord(counter[0])) === 0) {\n\t\t\t// encr_data in fileenc.c from  Dr Brian Gladman's counts only with DWORD j < 8\n\t\t\tcounter[1] = this.incWord(counter[1]);\n\t\t}\n\t}\n\n\tcalculate(prf, data, iv) {\n\t\tlet l;\n\t\tif (!(l = data.length)) {\n\t\t\treturn [];\n\t\t}\n\t\tconst bl = bitArray.bitLength(data);\n\t\tfor (let i = 0; i < l; i += 4) {\n\t\t\tthis.incCounter(iv);\n\t\t\tconst e = prf.encrypt(iv);\n\t\t\tdata[i] ^= e[0];\n\t\t\tdata[i + 1] ^= e[1];\n\t\t\tdata[i + 2] ^= e[2];\n\t\t\tdata[i + 3] ^= e[3];\n\t\t}\n\t\treturn bitArray.clamp(data, bl);\n\t}\n};\n\nconst misc = {\n\timportKey(password) {\n\t\treturn new misc.hmacSha1(codec.bytes.toBits(password));\n\t},\n\tpbkdf2(prf, salt, count, length) {\n\t\tcount = count || 10000;\n\t\tif (length < 0 || count < 0) {\n\t\t\tthrow new Error(\"invalid params to pbkdf2\");\n\t\t}\n\t\tconst byteLength = ((length >> 5) + 1) << 2;\n\t\tlet u, ui, i, j, k;\n\t\tconst arrayBuffer = new ArrayBuffer(byteLength);\n\t\tconst out = new DataView(arrayBuffer);\n\t\tlet outLength = 0;\n\t\tconst b = bitArray;\n\t\tsalt = codec.bytes.toBits(salt);\n\t\tfor (k = 1; outLength < (byteLength || 1); k++) {\n\t\t\tu = ui = prf.encrypt(b.concat(salt, [k]));\n\t\t\tfor (i = 1; i < count; i++) {\n\t\t\t\tui = prf.encrypt(ui);\n\t\t\t\tfor (j = 0; j < ui.length; j++) {\n\t\t\t\t\tu[j] ^= ui[j];\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (i = 0; outLength < (byteLength || 1) && i < u.length; i++) {\n\t\t\t\tout.setInt32(outLength, u[i]);\n\t\t\t\toutLength += 4;\n\t\t\t}\n\t\t}\n\t\treturn arrayBuffer.slice(0, length / 8);\n\t}\n};\n\n/** @fileOverview HMAC implementation.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\n/** HMAC with the specified hash function.\n * @constructor\n * @param {bitArray} key the key for HMAC.\n * @param {Object} [Hash=hash.sha1] The hash function to use.\n */\nmisc.hmacSha1 = class {\n\n\tconstructor(key) {\n\t\tconst hmac = this;\n\t\tconst Hash = hmac._hash = hash.sha1;\n\t\tconst exKey = [[], []];\n\t\tconst bs = Hash.prototype.blockSize / 32;\n\t\thmac._baseHash = [new Hash(), new Hash()];\n\n\t\tif (key.length > bs) {\n\t\t\tkey = Hash.hash(key);\n\t\t}\n\n\t\tfor (let i = 0; i < bs; i++) {\n\t\t\texKey[0][i] = key[i] ^ 0x36363636;\n\t\t\texKey[1][i] = key[i] ^ 0x5C5C5C5C;\n\t\t}\n\n\t\thmac._baseHash[0].update(exKey[0]);\n\t\thmac._baseHash[1].update(exKey[1]);\n\t\thmac._resultHash = new Hash(hmac._baseHash[0]);\n\t}\n\treset() {\n\t\tconst hmac = this;\n\t\thmac._resultHash = new hmac._hash(hmac._baseHash[0]);\n\t\thmac._updated = false;\n\t}\n\n\tupdate(data) {\n\t\tconst hmac = this;\n\t\thmac._updated = true;\n\t\thmac._resultHash.update(data);\n\t}\n\n\tdigest() {\n\t\tconst hmac = this;\n\t\tconst w = hmac._resultHash.finalize();\n\t\tconst result = new (hmac._hash)(hmac._baseHash[1]).update(w).finalize();\n\n\t\thmac.reset();\n\n\t\treturn result;\n\t}\n\n\tencrypt(data) {\n\t\tif (!this._updated) {\n\t\t\tthis.update(data);\n\t\t\treturn this.digest(data);\n\t\t} else {\n\t\t\tthrow new Error(\"encrypt on already updated hmac called!\");\n\t\t}\n\t}\n};\n\nexport {\n\tcipher,\n\tcodec,\n\tmisc,\n\tmode,\n\trandom\n};", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global crypto */\n// deno-lint-ignore-file no-this-alias\n\nimport encodeText from \"./../util/encode-text.js\";\nimport { cipher, codec, misc, mode, random } from \"./sjcl.js\";\n\nconst ERR_INVALID_PASSWORD = \"Invalid pasword\";\nconst BLOCK_LENGTH = 16;\nconst RAW_FORMAT = \"raw\";\nconst PBKDF2_ALGORITHM = { name: \"PBKDF2\" };\nconst HASH_ALGORITHM = { name: \"HMAC\" };\nconst HASH_FUNCTION = \"SHA-1\";\nconst BASE_KEY_ALGORITHM = Object.assign({ hash: HASH_ALGORITHM }, PBKDF2_ALGORITHM);\nconst DERIVED_BITS_ALGORITHM = Object.assign({ iterations: 1000, hash: { name: HASH_FUNCTION } }, PBKDF2_ALGORITHM);\nconst DERIVED_BITS_USAGE = [\"deriveBits\"];\nconst SALT_LENGTH = [8, 12, 16];\nconst KEY_LENGTH = [16, 24, 32];\nconst SIGNATURE_LENGTH = 10;\nconst COUNTER_DEFAULT_VALUE = [0, 0, 0, 0];\nconst CRYPTO_API_SUPPORTED = typeof crypto != \"undefined\";\nconst SUBTLE_API_SUPPORTED = CRYPTO_API_SUPPORTED && typeof crypto.subtle != \"undefined\";\nconst codecBytes = codec.bytes;\nconst Aes = cipher.aes;\nconst CtrGladman = mode.ctrGladman;\nconst HmacSha1 = misc.hmacSha1;\nclass AESDecrypt {\n\n\tconstructor(password, signed, strength) {\n\t\tObject.assign(this, {\n\t\t\tpassword,\n\t\t\tsigned,\n\t\t\tstrength: strength - 1,\n\t\t\tpendingInput: new Uint8Array(0)\n\t\t});\n\t}\n\n\tasync append(input) {\n\t\tconst aesCrypto = this;\n\t\tif (aesCrypto.password) {\n\t\t\tconst preamble = subarray(input, 0, SALT_LENGTH[aesCrypto.strength] + 2);\n\t\t\tawait createDecryptionKeys(aesCrypto, preamble, aesCrypto.password);\n\t\t\taesCrypto.password = null;\n\t\t\taesCrypto.aesCtrGladman = new CtrGladman(new Aes(aesCrypto.keys.key), Array.from(COUNTER_DEFAULT_VALUE));\n\t\t\taesCrypto.hmac = new HmacSha1(aesCrypto.keys.authentication);\n\t\t\tinput = subarray(input, SALT_LENGTH[aesCrypto.strength] + 2);\n\t\t}\n\t\tconst output = new Uint8Array(input.length - SIGNATURE_LENGTH - ((input.length - SIGNATURE_LENGTH) % BLOCK_LENGTH));\n\t\treturn append(aesCrypto, input, output, 0, SIGNATURE_LENGTH, true);\n\t}\n\n\tflush() {\n\t\tconst aesCrypto = this;\n\t\tconst pendingInput = aesCrypto.pendingInput;\n\t\tconst chunkToDecrypt = subarray(pendingInput, 0, pendingInput.length - SIGNATURE_LENGTH);\n\t\tconst originalSignature = subarray(pendingInput, pendingInput.length - SIGNATURE_LENGTH);\n\t\tlet decryptedChunkArray = new Uint8Array(0);\n\t\tif (chunkToDecrypt.length) {\n\t\t\tconst encryptedChunk = codecBytes.toBits(chunkToDecrypt);\n\t\t\taesCrypto.hmac.update(encryptedChunk);\n\t\t\tconst decryptedChunk = aesCrypto.aesCtrGladman.update(encryptedChunk);\n\t\t\tdecryptedChunkArray = codecBytes.fromBits(decryptedChunk);\n\t\t}\n\t\tlet valid = true;\n\t\tif (aesCrypto.signed) {\n\t\t\tconst signature = subarray(codecBytes.fromBits(aesCrypto.hmac.digest()), 0, SIGNATURE_LENGTH);\n\t\t\tfor (let indexSignature = 0; indexSignature < SIGNATURE_LENGTH; indexSignature++) {\n\t\t\t\tif (signature[indexSignature] != originalSignature[indexSignature]) {\n\t\t\t\t\tvalid = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tvalid,\n\t\t\tdata: decryptedChunkArray\n\t\t};\n\t}\n}\n\nclass AESEncrypt {\n\n\tconstructor(password, strength) {\n\t\tObject.assign(this, {\n\t\t\tpassword,\n\t\t\tstrength: strength - 1,\n\t\t\tpendingInput: new Uint8Array(0)\n\t\t});\n\t}\n\n\tasync append(input) {\n\t\tconst aesCrypto = this;\n\t\tlet preamble = new Uint8Array(0);\n\t\tif (aesCrypto.password) {\n\t\t\tpreamble = await createEncryptionKeys(aesCrypto, aesCrypto.password);\n\t\t\taesCrypto.password = null;\n\t\t\taesCrypto.aesCtrGladman = new CtrGladman(new Aes(aesCrypto.keys.key), Array.from(COUNTER_DEFAULT_VALUE));\n\t\t\taesCrypto.hmac = new HmacSha1(aesCrypto.keys.authentication);\n\t\t}\n\t\tconst output = new Uint8Array(preamble.length + input.length - (input.length % BLOCK_LENGTH));\n\t\toutput.set(preamble, 0);\n\t\treturn append(aesCrypto, input, output, preamble.length, 0);\n\t}\n\n\tflush() {\n\t\tconst aesCrypto = this;\n\t\tlet encryptedChunkArray = new Uint8Array(0);\n\t\tif (aesCrypto.pendingInput.length) {\n\t\t\tconst encryptedChunk = aesCrypto.aesCtrGladman.update(codecBytes.toBits(aesCrypto.pendingInput));\n\t\t\taesCrypto.hmac.update(encryptedChunk);\n\t\t\tencryptedChunkArray = codecBytes.fromBits(encryptedChunk);\n\t\t}\n\t\tconst signature = subarray(codecBytes.fromBits(aesCrypto.hmac.digest()), 0, SIGNATURE_LENGTH);\n\t\treturn {\n\t\t\tdata: concat(encryptedChunkArray, signature),\n\t\t\tsignature\n\t\t};\n\t}\n}\n\nexport {\n\tAESDecrypt,\n\tAESEncrypt,\n\tERR_INVALID_PASSWORD\n};\n\nfunction append(aesCrypto, input, output, paddingStart, paddingEnd, verifySignature) {\n\tconst inputLength = input.length - paddingEnd;\n\tif (aesCrypto.pendingInput.length) {\n\t\tinput = concat(aesCrypto.pendingInput, input);\n\t\toutput = expand(output, inputLength - (inputLength % BLOCK_LENGTH));\n\t}\n\tlet offset;\n\tfor (offset = 0; offset <= inputLength - BLOCK_LENGTH; offset += BLOCK_LENGTH) {\n\t\tconst inputChunk = codecBytes.toBits(subarray(input, offset, offset + BLOCK_LENGTH));\n\t\tif (verifySignature) {\n\t\t\taesCrypto.hmac.update(inputChunk);\n\t\t}\n\t\tconst outputChunk = aesCrypto.aesCtrGladman.update(inputChunk);\n\t\tif (!verifySignature) {\n\t\t\taesCrypto.hmac.update(outputChunk);\n\t\t}\n\t\toutput.set(codecBytes.fromBits(outputChunk), offset + paddingStart);\n\t}\n\taesCrypto.pendingInput = subarray(input, offset);\n\treturn output;\n}\n\nasync function createDecryptionKeys(decrypt, preambleArray, password) {\n\tawait createKeys(decrypt, password, subarray(preambleArray, 0, SALT_LENGTH[decrypt.strength]));\n\tconst passwordVerification = subarray(preambleArray, SALT_LENGTH[decrypt.strength]);\n\tconst passwordVerificationKey = decrypt.keys.passwordVerification;\n\tif (passwordVerificationKey[0] != passwordVerification[0] || passwordVerificationKey[1] != passwordVerification[1]) {\n\t\tthrow new Error(ERR_INVALID_PASSWORD);\n\t}\n}\n\nasync function createEncryptionKeys(encrypt, password) {\n\tconst salt = getRandomValues(new Uint8Array(SALT_LENGTH[encrypt.strength]));\n\tawait createKeys(encrypt, password, salt);\n\treturn concat(salt, encrypt.keys.passwordVerification);\n}\n\nasync function createKeys(target, password, salt) {\n\tconst encodedPassword = encodeText(password);\n\tconst basekey = await importKey(RAW_FORMAT, encodedPassword, BASE_KEY_ALGORITHM, false, DERIVED_BITS_USAGE);\n\tconst derivedBits = await deriveBits(Object.assign({ salt }, DERIVED_BITS_ALGORITHM), basekey, 8 * ((KEY_LENGTH[target.strength] * 2) + 2));\n\tconst compositeKey = new Uint8Array(derivedBits);\n\ttarget.keys = {\n\t\tkey: codecBytes.toBits(subarray(compositeKey, 0, KEY_LENGTH[target.strength])),\n\t\tauthentication: codecBytes.toBits(subarray(compositeKey, KEY_LENGTH[target.strength], KEY_LENGTH[target.strength] * 2)),\n\t\tpasswordVerification: subarray(compositeKey, KEY_LENGTH[target.strength] * 2)\n\t};\n}\n\nfunction getRandomValues(array) {\n\tif (CRYPTO_API_SUPPORTED && typeof crypto.getRandomValues == \"function\") {\n\t\treturn crypto.getRandomValues(array);\n\t} else {\n\t\treturn random.getRandomValues(array);\n\t}\n}\n\nfunction importKey(format, password, algorithm, extractable, keyUsages) {\n\tif (CRYPTO_API_SUPPORTED && SUBTLE_API_SUPPORTED && typeof crypto.subtle.importKey == \"function\") {\n\t\treturn crypto.subtle.importKey(format, password, algorithm, extractable, keyUsages);\n\t} else {\n\t\treturn misc.importKey(password);\n\t}\n}\n\nasync function deriveBits(algorithm, baseKey, length) {\n\tif (CRYPTO_API_SUPPORTED && SUBTLE_API_SUPPORTED && typeof crypto.subtle.deriveBits == \"function\") {\n\t\treturn await crypto.subtle.deriveBits(algorithm, baseKey, length);\n\t} else {\n\t\treturn misc.pbkdf2(baseKey, algorithm.salt, DERIVED_BITS_ALGORITHM.iterations, length);\n\t}\n}\n\nfunction concat(leftArray, rightArray) {\n\tlet array = leftArray;\n\tif (leftArray.length + rightArray.length) {\n\t\tarray = new Uint8Array(leftArray.length + rightArray.length);\n\t\tarray.set(leftArray, 0);\n\t\tarray.set(rightArray, leftArray.length);\n\t}\n\treturn array;\n}\n\nfunction expand(inputArray, length) {\n\tif (length && length > inputArray.length) {\n\t\tconst array = inputArray;\n\t\tinputArray = new Uint8Array(length);\n\t\tinputArray.set(array, 0);\n\t}\n\treturn inputArray;\n}\n\nfunction subarray(array, begin, end) {\n\treturn array.subarray(begin, end);\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global crypto */\n// deno-lint-ignore-file no-this-alias\n\nimport Crc32 from \"./crc32.js\";\nimport { ERR_INVALID_PASSWORD } from \"./aes-crypto.js\";\n\nconst HEADER_LENGTH = 12;\n\nclass ZipCryptoDecrypt {\n\n\tconstructor(password, passwordVerification) {\n\t\tconst zipCrypto = this;\n\t\tObject.assign(zipCrypto, {\n\t\t\tpassword,\n\t\t\tpasswordVerification\n\t\t});\n\t\tcreateKeys(zipCrypto, password);\n\t}\n\n\tappend(input) {\n\t\tconst zipCrypto = this;\n\t\tif (zipCrypto.password) {\n\t\t\tconst decryptedHeader = decrypt(zipCrypto, input.subarray(0, HEADER_LENGTH));\n\t\t\tzipCrypto.password = null;\n\t\t\tif (decryptedHeader[HEADER_LENGTH - 1] != zipCrypto.passwordVerification) {\n\t\t\t\tthrow new Error(ERR_INVALID_PASSWORD);\n\t\t\t}\n\t\t\tinput = input.subarray(HEADER_LENGTH);\n\t\t}\n\t\treturn decrypt(zipCrypto, input);\n\t}\n\n\tflush() {\n\t\treturn {\n\t\t\tvalid: true,\n\t\t\tdata: new Uint8Array(0)\n\t\t};\n\t}\n}\n\nclass ZipCryptoEncrypt {\n\n\tconstructor(password, passwordVerification) {\n\t\tconst zipCrypto = this;\n\t\tObject.assign(zipCrypto, {\n\t\t\tpassword,\n\t\t\tpasswordVerification\n\t\t});\n\t\tcreateKeys(zipCrypto, password);\n\t}\n\n\tappend(input) {\n\t\tconst zipCrypto = this;\n\t\tlet output;\n\t\tlet offset;\n\t\tif (zipCrypto.password) {\n\t\t\tzipCrypto.password = null;\n\t\t\tconst header = crypto.getRandomValues(new Uint8Array(HEADER_LENGTH));\n\t\t\theader[HEADER_LENGTH - 1] = zipCrypto.passwordVerification;\n\t\t\toutput = new Uint8Array(input.length + header.length);\n\t\t\toutput.set(encrypt(zipCrypto, header), 0);\n\t\t\toffset = HEADER_LENGTH;\n\t\t} else {\n\t\t\toutput = new Uint8Array(input.length);\n\t\t\toffset = 0;\n\t\t}\n\t\toutput.set(encrypt(zipCrypto, input), offset);\n\t\treturn output;\n\t}\n\n\tflush() {\n\t\treturn {\n\t\t\tdata: new Uint8Array(0)\n\t\t};\n\t}\n}\n\nexport {\n\tZipCryptoDecrypt,\n\tZipCryptoEncrypt,\n\tERR_INVALID_PASSWORD\n};\n\nfunction decrypt(target, input) {\n\tconst output = new Uint8Array(input.length);\n\tfor (let index = 0; index < input.length; index++) {\n\t\toutput[index] = getByte(target) ^ input[index];\n\t\tupdateKeys(target, output[index]);\n\t}\n\treturn output;\n}\n\nfunction encrypt(target, input) {\n\tconst output = new Uint8Array(input.length);\n\tfor (let index = 0; index < input.length; index++) {\n\t\toutput[index] = getByte(target) ^ input[index];\n\t\tupdateKeys(target, input[index]);\n\t}\n\treturn output;\n}\n\nfunction createKeys(target, password) {\n\ttarget.keys = [0x12345678, 0x23456789, 0x34567890];\n\ttarget.crcKey0 = new Crc32(target.keys[0]);\n\ttarget.crcKey2 = new Crc32(target.keys[2]);\n\tfor (let index = 0; index < password.length; index++) {\n\t\tupdateKeys(target, password.charCodeAt(index));\n\t}\n}\n\nfunction updateKeys(target, byte) {\n\ttarget.crcKey0.append([byte]);\n\ttarget.keys[0] = ~target.crcKey0.get();\n\ttarget.keys[1] = getInt32(target.keys[1] + getInt8(target.keys[0]));\n\ttarget.keys[1] = getInt32(Math.imul(target.keys[1], 134775813) + 1);\n\ttarget.crcKey2.append([target.keys[1] >>> 24]);\n\ttarget.keys[2] = ~target.crcKey2.get();\n}\n\nfunction getByte(target) {\n\tconst temp = target.keys[2] | 2;\n\treturn getInt8(Math.imul(temp, (temp ^ 1)) >>> 8);\n}\n\nfunction getInt8(number) {\n\treturn number & 0xFF;\n}\n\nfunction getInt32(number) {\n\treturn number & 0xFFFFFFFF;\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// deno-lint-ignore-file no-this-alias\n\nimport Crc32 from \"./crc32.js\";\nimport { AESEncrypt, AESDecrypt, ERR_INVALID_PASSWORD } from \"./aes-crypto.js\";\nimport { ZipCryptoDecrypt, ZipCryptoEncrypt } from \"./zip-crypto.js\";\n\nconst CODEC_DEFLATE = \"deflate\";\nconst CODEC_INFLATE = \"inflate\";\nconst ERR_INVALID_SIGNATURE = \"Invalid signature\";\n\nclass Inflate {\n\n\tconstructor(codecConstructor, {\n\t\tsignature,\n\t\tpassword,\n\t\tsigned,\n\t\tcompressed,\n\t\tzipCrypto,\n\t\tpasswordVerification,\n\t\tencryptionStrength\n\t}, { chunkSize }) {\n\t\tconst encrypted = Boolean(password);\n\t\tObject.assign(this, {\n\t\t\tsignature,\n\t\t\tencrypted,\n\t\t\tsigned,\n\t\t\tcompressed,\n\t\t\tinflate: compressed && new codecConstructor({ chunkSize }),\n\t\t\tcrc32: signed && new Crc32(),\n\t\t\tzipCrypto,\n\t\t\tdecrypt: encrypted && zipCrypto ?\n\t\t\t\tnew ZipCryptoDecrypt(password, passwordVerification) :\n\t\t\t\tnew AESDecrypt(password, signed, encryptionStrength)\n\t\t});\n\t}\n\n\tasync append(data) {\n\t\tconst codec = this;\n\t\tif (codec.encrypted && data.length) {\n\t\t\tdata = await codec.decrypt.append(data);\n\t\t}\n\t\tif (codec.compressed && data.length) {\n\t\t\tdata = await codec.inflate.append(data);\n\t\t}\n\t\tif ((!codec.encrypted || codec.zipCrypto) && codec.signed && data.length) {\n\t\t\tcodec.crc32.append(data);\n\t\t}\n\t\treturn data;\n\t}\n\n\tasync flush() {\n\t\tconst codec = this;\n\t\tlet signature;\n\t\tlet data = new Uint8Array(0);\n\t\tif (codec.encrypted) {\n\t\t\tconst result = codec.decrypt.flush();\n\t\t\tif (!result.valid) {\n\t\t\t\tthrow new Error(ERR_INVALID_SIGNATURE);\n\t\t\t}\n\t\t\tdata = result.data;\n\t\t}\n\t\tif ((!codec.encrypted || codec.zipCrypto) && codec.signed) {\n\t\t\tconst dataViewSignature = new DataView(new Uint8Array(4).buffer);\n\t\t\tsignature = codec.crc32.get();\n\t\t\tdataViewSignature.setUint32(0, signature);\n\t\t\tif (codec.signature != dataViewSignature.getUint32(0, false)) {\n\t\t\t\tthrow new Error(ERR_INVALID_SIGNATURE);\n\t\t\t}\n\t\t}\n\t\tif (codec.compressed) {\n\t\t\tdata = (await codec.inflate.append(data)) || new Uint8Array(0);\n\t\t\tawait codec.inflate.flush();\n\t\t}\n\t\treturn { data, signature };\n\t}\n}\n\nclass Deflate {\n\n\tconstructor(codecConstructor, {\n\t\tencrypted,\n\t\tsigned,\n\t\tcompressed,\n\t\tlevel,\n\t\tzipCrypto,\n\t\tpassword,\n\t\tpasswordVerification,\n\t\tencryptionStrength\n\t}, { chunkSize }) {\n\t\tObject.assign(this, {\n\t\t\tencrypted,\n\t\t\tsigned,\n\t\t\tcompressed,\n\t\t\tdeflate: compressed && new codecConstructor({ level: level || 5, chunkSize }),\n\t\t\tcrc32: signed && new Crc32(),\n\t\t\tzipCrypto,\n\t\t\tencrypt: encrypted && zipCrypto ?\n\t\t\t\tnew ZipCryptoEncrypt(password, passwordVerification) :\n\t\t\t\tnew AESEncrypt(password, encryptionStrength)\n\t\t});\n\t}\n\n\tasync append(inputData) {\n\t\tconst codec = this;\n\t\tlet data = inputData;\n\t\tif (codec.compressed && inputData.length) {\n\t\t\tdata = await codec.deflate.append(inputData);\n\t\t}\n\t\tif (codec.encrypted && data.length) {\n\t\t\tdata = await codec.encrypt.append(data);\n\t\t}\n\t\tif ((!codec.encrypted || codec.zipCrypto) && codec.signed && inputData.length) {\n\t\t\tcodec.crc32.append(inputData);\n\t\t}\n\t\treturn data;\n\t}\n\n\tasync flush() {\n\t\tconst codec = this;\n\t\tlet signature;\n\t\tlet data = new Uint8Array(0);\n\t\tif (codec.compressed) {\n\t\t\tdata = (await codec.deflate.flush()) || new Uint8Array(0);\n\t\t}\n\t\tif (codec.encrypted) {\n\t\t\tdata = await codec.encrypt.append(data);\n\t\t\tconst result = codec.encrypt.flush();\n\t\t\tsignature = result.signature;\n\t\t\tconst newData = new Uint8Array(data.length + result.data.length);\n\t\t\tnewData.set(data, 0);\n\t\t\tnewData.set(result.data, data.length);\n\t\t\tdata = newData;\n\t\t}\n\t\tif ((!codec.encrypted || codec.zipCrypto) && codec.signed) {\n\t\t\tsignature = codec.crc32.get();\n\t\t}\n\t\treturn { data, signature };\n\t}\n}\n\nexport {\n\tInflate,\n\tDeflate,\n\tcreateCodec,\n\tCODEC_DEFLATE,\n\tCODEC_INFLATE,\n\tERR_INVALID_SIGNATURE,\n\tERR_INVALID_PASSWORD\n};\n\nfunction createCodec(codecConstructor, options, config) {\n\tif (options.codecType.startsWith(CODEC_DEFLATE)) {\n\t\treturn new Deflate(codecConstructor, options, config);\n\t} else if (options.codecType.startsWith(CODEC_INFLATE)) {\n\t\treturn new Inflate(codecConstructor, options, config);\n\t}\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global Worker, URL */\n\nimport { createCodec } from \"./codec.js\";\n\nconst MESSAGE_INIT = \"init\";\nconst MESSAGE_APPEND = \"append\";\nconst MESSAGE_FLUSH = \"flush\";\nconst MESSAGE_EVENT_TYPE = \"message\";\n\nlet classicWorkersSupported = true;\n\nexport default (workerData, codecConstructor, options, config, onTaskFinished, webWorker, scripts) => {\n\tObject.assign(workerData, {\n\t\tbusy: true,\n\t\tcodecConstructor,\n\t\toptions: Object.assign({}, options),\n\t\tscripts,\n\t\tterminate() {\n\t\t\tif (workerData.worker && !workerData.busy) {\n\t\t\t\tworkerData.worker.terminate();\n\t\t\t\tworkerData.interface = null;\n\t\t\t}\n\t\t},\n\t\tonTaskFinished() {\n\t\t\tworkerData.busy = false;\n\t\t\tonTaskFinished(workerData);\n\t\t}\n\t});\n\treturn webWorker ? createWebWorkerInterface(workerData, config) : createWorkerInterface(workerData, config);\n};\n\nfunction createWorkerInterface(workerData, config) {\n\tconst interfaceCodec = createCodec(workerData.codecConstructor, workerData.options, config);\n\treturn {\n\t\tasync append(data) {\n\t\t\ttry {\n\t\t\t\treturn await interfaceCodec.append(data);\n\t\t\t} catch (error) {\n\t\t\t\tworkerData.onTaskFinished();\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t},\n\t\tasync flush() {\n\t\t\ttry {\n\t\t\t\treturn await interfaceCodec.flush();\n\t\t\t} finally {\n\t\t\t\tworkerData.onTaskFinished();\n\t\t\t}\n\t\t},\n\t\tabort() {\n\t\t\tworkerData.onTaskFinished();\n\t\t}\n\t};\n}\n\nfunction createWebWorkerInterface(workerData, config) {\n\tlet messageTask;\n\tconst workerOptions = { type: \"module\" };\n\tif (!workerData.interface) {\n\t\tif (!classicWorkersSupported) {\n\t\t\tworkerData.worker = getWorker(workerOptions, config.baseURL);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tworkerData.worker = getWorker({}, config.baseURL);\n\t\t\t} catch (_error) {\n\t\t\t\tclassicWorkersSupported = false;\n\t\t\t\tworkerData.worker = getWorker(workerOptions, config.baseURL);\n\t\t\t}\n\t\t}\n\t\tworkerData.worker.addEventListener(MESSAGE_EVENT_TYPE, onMessage, false);\n\t\tworkerData.interface = {\n\t\t\tappend(data) {\n\t\t\t\treturn initAndSendMessage({ type: MESSAGE_APPEND, data });\n\t\t\t},\n\t\t\tflush() {\n\t\t\t\treturn initAndSendMessage({ type: MESSAGE_FLUSH });\n\t\t\t},\n\t\t\tabort() {\n\t\t\t\tworkerData.onTaskFinished();\n\t\t\t}\n\t\t};\n\t}\n\treturn workerData.interface;\n\n\tfunction getWorker(options, baseURL) {\n\t\tlet url, scriptUrl;\n\t\turl = workerData.scripts[0];\n\t\tif (typeof url == \"function\") {\n\t\t\turl = url();\n\t\t}\n\t\ttry {\n\t\t\tscriptUrl = new URL(url, baseURL);\n\t\t} catch (_error) {\n\t\t\tscriptUrl = url;\n\t\t}\n\t\treturn new Worker(scriptUrl, options);\n\t}\n\n\tasync function initAndSendMessage(message) {\n\t\tif (!messageTask) {\n\t\t\tconst options = workerData.options;\n\t\t\tconst scripts = workerData.scripts.slice(1);\n\t\t\tawait sendMessage({ scripts, type: MESSAGE_INIT, options, config: { chunkSize: config.chunkSize } });\n\t\t}\n\t\treturn sendMessage(message);\n\t}\n\n\tfunction sendMessage(message) {\n\t\tconst worker = workerData.worker;\n\t\tconst result = new Promise((resolve, reject) => messageTask = { resolve, reject });\n\t\ttry {\n\t\t\tif (message.data) {\n\t\t\t\ttry {\n\t\t\t\t\tmessage.data = message.data.buffer;\n\t\t\t\t\tworker.postMessage(message, [message.data]);\n\t\t\t\t} catch (_error) {\n\t\t\t\t\tworker.postMessage(message);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tworker.postMessage(message);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tmessageTask.reject(error);\n\t\t\tmessageTask = null;\n\t\t\tworkerData.onTaskFinished();\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction onMessage(event) {\n\t\tconst message = event.data;\n\t\tif (messageTask) {\n\t\t\tconst reponseError = message.error;\n\t\t\tconst type = message.type;\n\t\t\tif (reponseError) {\n\t\t\t\tconst error = new Error(reponseError.message);\n\t\t\t\terror.stack = reponseError.stack;\n\t\t\t\tmessageTask.reject(error);\n\t\t\t\tmessageTask = null;\n\t\t\t\tworkerData.onTaskFinished();\n\t\t\t} else if (type == MESSAGE_INIT || type == MESSAGE_FLUSH || type == MESSAGE_APPEND) {\n\t\t\t\tconst data = message.data;\n\t\t\t\tif (type == MESSAGE_FLUSH) {\n\t\t\t\t\tmessageTask.resolve({ data: new Uint8Array(data), signature: message.signature });\n\t\t\t\t\tmessageTask = null;\n\t\t\t\t\tworkerData.onTaskFinished();\n\t\t\t\t} else {\n\t\t\t\t\tmessageTask.resolve(data && new Uint8Array(data));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global setTimeout, clearTimeout */\n\nimport { CODEC_INFLATE, CODEC_DEFLATE, ERR_INVALID_SIGNATURE, ERR_INVALID_PASSWORD } from \"./codec.js\";\nimport getWorker from \"./codec-pool-worker.js\";\n\nlet pool = [];\nconst pendingRequests = [];\n\nexport {\n\tcreateCodec,\n\tterminateWorkers,\n\tCODEC_DEFLATE,\n\tCODEC_INFLATE,\n\tERR_INVALID_SIGNATURE,\n\tERR_INVALID_PASSWORD\n};\n\nfunction createCodec(codecConstructor, options, config) {\n\tconst streamCopy = !options.compressed && !options.signed && !options.encrypted;\n\tconst webWorker = !streamCopy && (options.useWebWorkers || (options.useWebWorkers === undefined && config.useWebWorkers));\n\tconst scripts = webWorker && config.workerScripts ? config.workerScripts[options.codecType] : [];\n\tif (pool.length < config.maxWorkers) {\n\t\tconst workerData = {};\n\t\tpool.push(workerData);\n\t\treturn getWorker(workerData, codecConstructor, options, config, onTaskFinished, webWorker, scripts);\n\t} else {\n\t\tconst workerData = pool.find(workerData => !workerData.busy);\n\t\tif (workerData) {\n\t\t\tclearTerminateTimeout(workerData);\n\t\t\treturn getWorker(workerData, codecConstructor, options, config, onTaskFinished, webWorker, scripts);\n\t\t} else {\n\t\t\treturn new Promise(resolve => pendingRequests.push({ resolve, codecConstructor, options, webWorker, scripts }));\n\t\t}\n\t}\n\n\tfunction onTaskFinished(workerData) {\n\t\tif (pendingRequests.length) {\n\t\t\tconst [{ resolve, codecConstructor, options, webWorker, scripts }] = pendingRequests.splice(0, 1);\n\t\t\tresolve(getWorker(workerData, codecConstructor, options, config, onTaskFinished, webWorker, scripts));\n\t\t} else if (workerData.worker) {\n\t\t\tclearTerminateTimeout(workerData);\n\t\t\tif (Number.isFinite(config.terminateWorkerTimeout) && config.terminateWorkerTimeout >= 0) {\n\t\t\t\tworkerData.terminateTimeout = setTimeout(() => {\n\t\t\t\t\tpool = pool.filter(data => data != workerData);\n\t\t\t\t\tworkerData.terminate();\n\t\t\t\t}, config.terminateWorkerTimeout);\n\t\t\t}\n\t\t} else {\n\t\t\tpool = pool.filter(data => data != workerData);\n\t\t}\n\t}\n}\n\nfunction clearTerminateTimeout(workerData) {\n\tif (workerData.terminateTimeout) {\n\t\tclearTimeout(workerData.terminateTimeout);\n\t\tworkerData.terminateTimeout = null;\n\t}\n}\n\nfunction terminateWorkers() {\n\tpool.forEach(workerData => {\n\t\tclearTerminateTimeout(workerData);\n\t\tworkerData.terminate();\n\t});\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst MINIMUM_CHUNK_SIZE = 64;\nconst ERR_ABORT = \"Abort error\";\n\nexport {\n\tERR_ABORT,\n\tprocessData\n};\n\nasync function processData(codec, reader, writer, offset, inputLengthGetter, config, options) {\n\tconst chunkSize = Math.max(config.chunkSize, MINIMUM_CHUNK_SIZE);\n\treturn processChunk();\n\n\tasync function processChunk(chunkOffset = 0, outputLength = 0) {\n\t\tconst signal = options.signal;\n\t\tconst inputLength = inputLengthGetter();\n\t\tif (chunkOffset < inputLength) {\n\t\t\ttestAborted(signal, codec);\n\t\t\tconst inputData = await reader.readUint8Array(chunkOffset + offset, Math.min(chunkSize, inputLength - chunkOffset));\n\t\t\tconst chunkLength = inputData.length;\n\t\t\ttestAborted(signal, codec);\n\t\t\tconst data = await codec.append(inputData);\n\t\t\ttestAborted(signal, codec);\n\t\t\toutputLength += await writeData(writer, data);\n\t\t\tif (options.onprogress) {\n\t\t\t\ttry {\n\t\t\t\t\toptions.onprogress(chunkOffset + chunkLength, inputLength);\n\t\t\t\t} catch (error) {\n\t\t\t\t\t// ignored\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn processChunk(chunkOffset + chunkSize, outputLength);\n\t\t} else {\n\t\t\tconst result = await codec.flush();\n\t\t\toutputLength += await writeData(writer, result.data);\n\t\t\treturn { signature: result.signature, length: outputLength };\n\t\t}\n\t}\n}\n\nfunction testAborted(signal, codec) {\n\tif (signal && signal.aborted) {\n\t\tcodec.abort();\n\t\tthrow new Error(ERR_ABORT);\n\t}\n}\n\nasync function writeData(writer, data) {\n\tif (data.length) {\n\t\tawait writer.writeUint8Array(data);\n\t}\n\treturn data.length;\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global Blob, FileReader, atob, btoa, XMLHttpRequest, document, fetch */\n\nconst ERR_HTTP_STATUS = \"HTTP error \";\nconst ERR_HTTP_RANGE = \"HTTP Range not supported\";\nconst ERR_NOT_SEEKABLE_READER = \"Reader is not seekable\";\n\nconst CONTENT_TYPE_TEXT_PLAIN = \"text/plain\";\nconst HTTP_HEADER_CONTENT_LENGTH = \"Content-Length\";\nconst HTTP_HEADER_CONTENT_RANGE = \"Content-Range\";\nconst HTTP_HEADER_ACCEPT_RANGES = \"Accept-Ranges\";\nconst HTTP_HEADER_RANGE = \"Range\";\nconst HTTP_METHOD_HEAD = \"HEAD\";\nconst HTTP_METHOD_GET = \"GET\";\nconst HTTP_RANGE_UNIT = \"bytes\";\n\nclass Stream {\n\n\tconstructor() {\n\t\tthis.size = 0;\n\t}\n\n\tinit() {\n\t\tthis.initialized = true;\n\t}\n}\n\nclass Reader extends Stream {\n}\n\nclass Writer extends Stream {\n\n\twriteUint8Array(array) {\n\t\tthis.size += array.length;\n\t}\n}\n\nclass TextReader extends Reader {\n\n\tconstructor(text) {\n\t\tsuper();\n\t\tthis.blobReader = new BlobReader(new Blob([text], { type: CONTENT_TYPE_TEXT_PLAIN }));\n\t}\n\n\tinit() {\n\t\tsuper.init();\n\t\tthis.blobReader.init();\n\t\tthis.size = this.blobReader.size;\n\t}\n\n\treadUint8Array(offset, length) {\n\t\treturn this.blobReader.readUint8Array(offset, length);\n\t}\n}\n\nclass TextWriter extends Writer {\n\n\tconstructor(encoding) {\n\t\tsuper();\n\t\tthis.encoding = encoding;\n\t\tthis.blob = new Blob([], { type: CONTENT_TYPE_TEXT_PLAIN });\n\t}\n\n\twriteUint8Array(array) {\n\t\tsuper.writeUint8Array(array);\n\t\tthis.blob = new Blob([this.blob, array.buffer], { type: CONTENT_TYPE_TEXT_PLAIN });\n\t}\n\n\tgetData() {\n\t\tif (this.blob.text) {\n\t\t\treturn this.blob.text();\n\t\t} else {\n\t\t\tconst reader = new FileReader();\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\treader.onload = event => resolve(event.target.result);\n\t\t\t\treader.onerror = () => reject(reader.error);\n\t\t\t\treader.readAsText(this.blob, this.encoding);\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass Data64URIReader extends Reader {\n\n\tconstructor(dataURI) {\n\t\tsuper();\n\t\tthis.dataURI = dataURI;\n\t\tlet dataEnd = dataURI.length;\n\t\twhile (dataURI.charAt(dataEnd - 1) == \"=\") {\n\t\t\tdataEnd--;\n\t\t}\n\t\tthis.dataStart = dataURI.indexOf(\",\") + 1;\n\t\tthis.size = Math.floor((dataEnd - this.dataStart) * 0.75);\n\t}\n\n\treadUint8Array(offset, length) {\n\t\tconst dataArray = new Uint8Array(length);\n\t\tconst start = Math.floor(offset / 3) * 4;\n\t\tconst bytes = atob(this.dataURI.substring(start + this.dataStart, Math.ceil((offset + length) / 3) * 4 + this.dataStart));\n\t\tconst delta = offset - Math.floor(start / 4) * 3;\n\t\tfor (let indexByte = delta; indexByte < delta + length; indexByte++) {\n\t\t\tdataArray[indexByte - delta] = bytes.charCodeAt(indexByte);\n\t\t}\n\t\treturn dataArray;\n\t}\n}\n\nclass Data64URIWriter extends Writer {\n\n\tconstructor(contentType) {\n\t\tsuper();\n\t\tthis.data = \"data:\" + (contentType || \"\") + \";base64,\";\n\t\tthis.pending = [];\n\t}\n\n\twriteUint8Array(array) {\n\t\tsuper.writeUint8Array(array);\n\t\tlet indexArray = 0;\n\t\tlet dataString = this.pending;\n\t\tconst delta = this.pending.length;\n\t\tthis.pending = \"\";\n\t\tfor (indexArray = 0; indexArray < (Math.floor((delta + array.length) / 3) * 3) - delta; indexArray++) {\n\t\t\tdataString += String.fromCharCode(array[indexArray]);\n\t\t}\n\t\tfor (; indexArray < array.length; indexArray++) {\n\t\t\tthis.pending += String.fromCharCode(array[indexArray]);\n\t\t}\n\t\tif (dataString.length > 2) {\n\t\t\tthis.data += btoa(dataString);\n\t\t} else {\n\t\t\tthis.pending = dataString;\n\t\t}\n\t}\n\n\tgetData() {\n\t\treturn this.data + btoa(this.pending);\n\t}\n}\n\nclass BlobReader extends Reader {\n\n\tconstructor(blob) {\n\t\tsuper();\n\t\tthis.blob = blob;\n\t\tthis.size = blob.size;\n\t}\n\n\tasync readUint8Array(offset, length) {\n\t\tif (this.blob.arrayBuffer) {\n\t\t\treturn new Uint8Array(await this.blob.slice(offset, offset + length).arrayBuffer());\n\t\t} else {\n\t\t\tconst reader = new FileReader();\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\treader.onload = event => resolve(new Uint8Array(event.target.result));\n\t\t\t\treader.onerror = () => reject(reader.error);\n\t\t\t\treader.readAsArrayBuffer(this.blob.slice(offset, offset + length));\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass BlobWriter extends Writer {\n\n\tconstructor(contentType) {\n\t\tsuper();\n\t\tthis.contentType = contentType;\n\t\tthis.arrayBuffersMaxlength = 8;\n\t\tinitArrayBuffers(this);\n\t}\n\n\twriteUint8Array(array) {\n\t\tsuper.writeUint8Array(array);\n\t\tif (this.arrayBuffers.length == this.arrayBuffersMaxlength) {\n\t\t\tflushArrayBuffers(this);\n\t\t}\n\t\tthis.arrayBuffers.push(array.buffer);\n\t}\n\n\tgetData() {\n\t\tif (!this.blob) {\n\t\t\tif (this.arrayBuffers.length) {\n\t\t\t\tflushArrayBuffers(this);\n\t\t\t}\n\t\t\tthis.blob = this.pendingBlob;\n\t\t\tinitArrayBuffers(this);\n\t\t}\n\t\treturn this.blob;\n\t}\n}\n\nfunction initArrayBuffers(blobWriter) {\n\tblobWriter.pendingBlob = new Blob([], { type: blobWriter.contentType });\n\tblobWriter.arrayBuffers = [];\n}\n\nfunction flushArrayBuffers(blobWriter) {\n\tblobWriter.pendingBlob = new Blob([blobWriter.pendingBlob, ...blobWriter.arrayBuffers], { type: blobWriter.contentType });\n\tblobWriter.arrayBuffers = [];\n}\n\nclass ReadableStreamReader {\n\n\tconstructor(readableStream) {\n\t\tthis.readableStream = readableStream;\n\t\tthis.reader = readableStream.getReader();\n\t\tthis.size = Infinity;\n\t\tthis.index = 0;\n\t\tthis.currentSize = 0;\n\t\tthis.pendingValue = new Uint8Array();\n\t}\n\n\tinit() {\n\t\tthis.initialized = true;\n\t}\n\n\tasync readUint8Array(index, length) {\n\t\tif (this.index != index) {\n\t\t\tthrow new Error(ERR_NOT_SEEKABLE_READER);\n\t\t}\n\t\tlet data = new Uint8Array(length);\n\t\tlet size = 0, done;\n\t\tdo {\n\t\t\tconst result = await this.reader.read();\n\t\t\tlet { value } = result;\n\t\t\tdone = result.done;\n\t\t\tif (value) {\n\t\t\t\tthis.currentSize += value.length;\n\t\t\t} else {\n\t\t\t\tvalue = this.pendingValue;\n\t\t\t\tthis.pendingValue = new Uint8Array();\n\t\t\t}\n\t\t\tif (this.pendingValue.length) {\n\t\t\t\tconst newValue = new Uint8Array(this.pendingValue.length + value.length);\n\t\t\t\tnewValue.set(this.pendingValue);\n\t\t\t\tnewValue.set(value, this.pendingValue.length);\n\t\t\t\tthis.pendingValue = new Uint8Array();\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif (size + value.length > length) {\n\t\t\t\tdata.set(value.subarray(0, length), size);\n\t\t\t\tthis.pendingValue = value.subarray(length);\n\t\t\t\tsize += length;\n\t\t\t} else {\n\t\t\t\tdata.set(value, size);\n\t\t\t\tsize += value.length;\n\t\t\t}\n\t\t} while (size < length && !done);\n\t\tif (done && this.size == Infinity) {\n\t\t\tthis.size = this.currentSize;\n\t\t}\n\t\tif (this.size < length) {\n\t\t\tdata = data.slice(0, this.size);\n\t\t\tlength = this.size;\n\t\t}\n\t\tthis.index += length;\n\t\treturn data;\n\t}\n}\n\nclass WritableStreamWriter extends Writer {\n\n\tconstructor(writableStream) {\n\t\tsuper();\n\t\tthis.writableStream = writableStream;\n\t\tthis.writer = writableStream.getWriter();\n\t}\n\n\tasync writeUint8Array(array) {\n\t\tawait this.writer.ready;\n\t\treturn this.writer.write(array);\n\t}\n\n\tasync getData() {\n\t\tawait this.writer.ready;\n\t\tawait this.writer.close();\n\t\treturn this.writableStream;\n\t}\n}\n\nclass FetchReader extends Reader {\n\n\tconstructor(url, options) {\n\t\tsuper();\n\t\tthis.url = url;\n\t\tthis.preventHeadRequest = options.preventHeadRequest;\n\t\tthis.useRangeHeader = options.useRangeHeader;\n\t\tthis.forceRangeRequests = options.forceRangeRequests;\n\t\tthis.options = Object.assign({}, options);\n\t\tdelete this.options.preventHeadRequest;\n\t\tdelete this.options.useRangeHeader;\n\t\tdelete this.options.forceRangeRequests;\n\t\tdelete this.options.useXHR;\n\t}\n\n\tasync init() {\n\t\tsuper.init();\n\t\tawait initHttpReader(this, sendFetchRequest, getFetchRequestData);\n\t}\n\n\treadUint8Array(index, length) {\n\t\treturn readUint8ArrayHttpReader(this, index, length, sendFetchRequest, getFetchRequestData);\n\t}\n}\n\nclass XHRReader extends Reader {\n\n\tconstructor(url, options) {\n\t\tsuper();\n\t\tthis.url = url;\n\t\tthis.preventHeadRequest = options.preventHeadRequest;\n\t\tthis.useRangeHeader = options.useRangeHeader;\n\t\tthis.forceRangeRequests = options.forceRangeRequests;\n\t\tthis.options = options;\n\t}\n\n\tasync init() {\n\t\tsuper.init();\n\t\tawait initHttpReader(this, sendXMLHttpRequest, getXMLHttpRequestData);\n\t}\n\n\treadUint8Array(index, length) {\n\t\treturn readUint8ArrayHttpReader(this, index, length, sendXMLHttpRequest, getXMLHttpRequestData);\n\t}\n}\n\nasync function initHttpReader(httpReader, sendRequest, getRequestData) {\n\tif (isHttpFamily(httpReader.url) && (httpReader.useRangeHeader || httpReader.forceRangeRequests)) {\n\t\tconst response = await sendRequest(HTTP_METHOD_GET, httpReader, getRangeHeaders(httpReader));\n\t\tif (!httpReader.forceRangeRequests && response.headers.get(HTTP_HEADER_ACCEPT_RANGES) != HTTP_RANGE_UNIT) {\n\t\t\tthrow new Error(ERR_HTTP_RANGE);\n\t\t} else {\n\t\t\tlet contentSize;\n\t\t\tconst contentRangeHeader = response.headers.get(HTTP_HEADER_CONTENT_RANGE);\n\t\t\tif (contentRangeHeader) {\n\t\t\t\tconst splitHeader = contentRangeHeader.trim().split(/\\s*\\/\\s*/);\n\t\t\t\tif (splitHeader.length) {\n\t\t\t\t\tconst headerValue = splitHeader[1];\n\t\t\t\t\tif (headerValue && headerValue != \"*\") {\n\t\t\t\t\t\tcontentSize = Number(headerValue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (contentSize === undefined) {\n\t\t\t\tawait getContentLength(httpReader, sendRequest, getRequestData);\n\t\t\t} else {\n\t\t\t\thttpReader.size = contentSize;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tawait getContentLength(httpReader, sendRequest, getRequestData);\n\t}\n}\n\nasync function readUint8ArrayHttpReader(httpReader, index, length, sendRequest, getRequestData) {\n\tif (httpReader.useRangeHeader || httpReader.forceRangeRequests) {\n\t\tconst response = await sendRequest(HTTP_METHOD_GET, httpReader, getRangeHeaders(httpReader, index, length));\n\t\tif (response.status != 206) {\n\t\t\tthrow new Error(ERR_HTTP_RANGE);\n\t\t}\n\t\treturn new Uint8Array(await response.arrayBuffer());\n\t} else {\n\t\tif (!httpReader.data) {\n\t\t\tawait getRequestData(httpReader, httpReader.options);\n\t\t}\n\t\treturn new Uint8Array(httpReader.data.subarray(index, index + length));\n\t}\n}\n\nfunction getRangeHeaders(httpReader, index = 0, length = 1) {\n\treturn Object.assign({}, getHeaders(httpReader), { [HTTP_HEADER_RANGE]: HTTP_RANGE_UNIT + \"=\" + index + \"-\" + (index + length - 1) });\n}\n\nfunction getHeaders(httpReader) {\n\tconst headers = httpReader.options.headers;\n\tif (headers) {\n\t\tif (Symbol.iterator in headers) {\n\t\t\treturn Object.fromEntries(headers);\n\t\t} else {\n\t\t\treturn headers;\n\t\t}\n\t}\n}\n\nasync function getFetchRequestData(httpReader) {\n\tawait getRequestData(httpReader, sendFetchRequest);\n}\n\nasync function getXMLHttpRequestData(httpReader) {\n\tawait getRequestData(httpReader, sendXMLHttpRequest);\n}\n\nasync function getRequestData(httpReader, sendRequest) {\n\tconst response = await sendRequest(HTTP_METHOD_GET, httpReader, getHeaders(httpReader));\n\thttpReader.data = new Uint8Array(await response.arrayBuffer());\n\tif (!httpReader.size) {\n\t\thttpReader.size = httpReader.data.length;\n\t}\n}\n\nasync function getContentLength(httpReader, sendRequest, getRequestData) {\n\tif (httpReader.preventHeadRequest) {\n\t\tawait getRequestData(httpReader, httpReader.options);\n\t} else {\n\t\tconst response = await sendRequest(HTTP_METHOD_HEAD, httpReader, getHeaders(httpReader));\n\t\tconst contentLength = response.headers.get(HTTP_HEADER_CONTENT_LENGTH);\n\t\tif (contentLength) {\n\t\t\thttpReader.size = Number(contentLength);\n\t\t} else {\n\t\t\tawait getRequestData(httpReader, httpReader.options);\n\t\t}\n\t}\n}\n\nasync function sendFetchRequest(method, { options, url }, headers) {\n\tconst response = await fetch(url, Object.assign({}, options, { method, headers }));\n\tif (response.status < 400) {\n\t\treturn response;\n\t} else {\n\t\tthrow new Error(ERR_HTTP_STATUS + (response.statusText || response.status));\n\t}\n}\n\nfunction sendXMLHttpRequest(method, { url }, headers) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst request = new XMLHttpRequest();\n\t\trequest.addEventListener(\"load\", () => {\n\t\t\tif (request.status < 400) {\n\t\t\t\tconst headers = [];\n\t\t\t\trequest.getAllResponseHeaders().trim().split(/[\\r\\n]+/).forEach(header => {\n\t\t\t\t\tconst splitHeader = header.trim().split(/\\s*:\\s*/);\n\t\t\t\t\tsplitHeader[0] = splitHeader[0].trim().replace(/^[a-z]|-[a-z]/g, value => value.toUpperCase());\n\t\t\t\t\theaders.push(splitHeader);\n\t\t\t\t});\n\t\t\t\tresolve({\n\t\t\t\t\tstatus: request.status,\n\t\t\t\t\tarrayBuffer: () => request.response,\n\t\t\t\t\theaders: new Map(headers)\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treject(new Error(ERR_HTTP_STATUS + (request.statusText || request.status)));\n\t\t\t}\n\t\t}, false);\n\t\trequest.addEventListener(\"error\", event => reject(event.detail.error), false);\n\t\trequest.open(method, url);\n\t\tif (headers) {\n\t\t\tfor (const entry of Object.entries(headers)) {\n\t\t\t\trequest.setRequestHeader(entry[0], entry[1]);\n\t\t\t}\n\t\t}\n\t\trequest.responseType = \"arraybuffer\";\n\t\trequest.send();\n\t});\n}\n\nclass HttpReader extends Reader {\n\n\tconstructor(url, options = {}) {\n\t\tsuper();\n\t\tthis.url = url;\n\t\tif (options.useXHR) {\n\t\t\tthis.reader = new XHRReader(url, options);\n\t\t} else {\n\t\t\tthis.reader = new FetchReader(url, options);\n\t\t}\n\t}\n\n\tset size(value) {\n\t\t// ignored\n\t}\n\n\tget size() {\n\t\treturn this.reader.size;\n\t}\n\n\tasync init() {\n\t\tsuper.init();\n\t\tawait this.reader.init();\n\t}\n\n\treadUint8Array(index, length) {\n\t\treturn this.reader.readUint8Array(index, length);\n\t}\n}\n\nclass HttpRangeReader extends HttpReader {\n\n\tconstructor(url, options = {}) {\n\t\toptions.useRangeHeader = true;\n\t\tsuper(url, options);\n\t}\n}\n\n\nclass Uint8ArrayReader extends Reader {\n\n\tconstructor(array) {\n\t\tsuper();\n\t\tthis.array = array;\n\t\tthis.size = array.length;\n\t}\n\n\treadUint8Array(index, length) {\n\t\treturn this.array.slice(index, index + length);\n\t}\n}\n\nclass Uint8ArrayWriter extends Writer {\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.array = new Uint8Array(0);\n\t}\n\n\twriteUint8Array(array) {\n\t\tsuper.writeUint8Array(array);\n\t\tconst previousArray = this.array;\n\t\tthis.array = new Uint8Array(previousArray.length + array.length);\n\t\tthis.array.set(previousArray);\n\t\tthis.array.set(array, previousArray.length);\n\t}\n\n\tgetData() {\n\t\treturn this.array;\n\t}\n}\n\nfunction isHttpFamily(url) {\n\tif (typeof document != \"undefined\") {\n\t\tconst anchor = document.createElement(\"a\");\n\t\tanchor.href = url;\n\t\treturn anchor.protocol == \"http:\" || anchor.protocol == \"https:\";\n\t} else {\n\t\treturn /^https?:\\/\\//i.test(url);\n\t}\n}\n\nexport {\n\tReader,\n\tWriter,\n\tTextReader,\n\tTextWriter,\n\tData64URIReader,\n\tData64URIWriter,\n\tBlobReader,\n\tBlobWriter,\n\tUint8ArrayReader,\n\tUint8ArrayWriter,\n\tHttpReader,\n\tHttpRangeReader,\n\tReadableStreamReader,\n\tWritableStreamWriter,\n\tERR_HTTP_RANGE,\n\tERR_NOT_SEEKABLE_READER\n};\n", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst MAX_32_BITS = 0xffffffff;\nconst MAX_16_BITS = 0xffff;\nconst COMPRESSION_METHOD_DEFLATE = 0x08;\nconst COMPRESSION_METHOD_STORE = 0x00;\nconst COMPRESSION_METHOD_AES = 0x63;\n\nconst LOCAL_FILE_HEADER_SIGNATURE = 0x04034b50;\nconst DATA_DESCRIPTOR_RECORD_SIGNATURE = 0x08074b50;\nconst CENTRAL_FILE_HEADER_SIGNATURE = 0x02014b50;\nconst END_OF_CENTRAL_DIR_SIGNATURE = 0x06054b50;\nconst ZIP64_END_OF_CENTRAL_DIR_SIGNATURE = 0x06064b50;\nconst ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE = 0x07064b50;\nconst END_OF_CENTRAL_DIR_LENGTH = 22;\nconst ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH = 20;\nconst ZIP64_END_OF_CENTRAL_DIR_LENGTH = 56;\nconst ZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH = END_OF_CENTRAL_DIR_LENGTH + ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH + ZIP64_END_OF_CENTRAL_DIR_LENGTH;\n\nconst ZIP64_TOTAL_NUMBER_OF_DISKS = 1;\n\nconst EXTRAFIELD_TYPE_ZIP64 = 0x0001;\nconst EXTRAFIELD_TYPE_AES = 0x9901;\nconst EXTRAFIELD_TYPE_NTFS = 0x000a;\nconst EXTRAFIELD_TYPE_NTFS_TAG1 = 0x0001;\nconst EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP = 0x5455;\nconst EXTRAFIELD_TYPE_UNICODE_PATH = 0x7075;\nconst EXTRAFIELD_TYPE_UNICODE_COMMENT = 0x6375;\n\nconst BITFLAG_ENCRYPTED = 0x01;\nconst BITFLAG_LEVEL = 0x06;\nconst BITFLAG_DATA_DESCRIPTOR = 0x0008;\nconst BITFLAG_LANG_ENCODING_FLAG = 0x0800;\nconst FILE_ATTR_MSDOS_DIR_MASK = 0x10;\n\nconst VERSION_DEFLATE = 0x14;\nconst VERSION_ZIP64 = 0x2D;\nconst VERSION_AES = 0x33;\n\nconst DIRECTORY_SIGNATURE = \"/\";\n\nconst MAX_DATE = new Date(2107, 11, 31);\nconst MIN_DATE = new Date(1980, 0, 1);\n\nexport {\n\tMAX_32_BITS,\n\tMAX_16_BITS,\n\tCOMPRESSION_METHOD_DEFLATE,\n\tCOMPRESSION_METHOD_STORE,\n\tCOMPRESSION_METHOD_AES,\n\tLOCAL_FILE_HEADER_SIGNATURE,\n\tDATA_DESCRIPTOR_RECORD_SIGNATURE,\n\tCENTRAL_FILE_HEADER_SIGNATURE,\n\tEND_OF_CENTRAL_DIR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_SIGNATURE,\n\tEXTRAFIELD_TYPE_ZIP64,\n\tEXTRAFIELD_TYPE_AES,\n\tEXTRAFIELD_TYPE_NTFS,\n\tEXTRAFIELD_TYPE_NTFS_TAG1,\n\tEXTRAFIELD_TYPE_EXTENDED_TIMESTAMP,\n\tEXTRAFIELD_TYPE_UNICODE_PATH,\n\tEXTRAFIELD_TYPE_UNICODE_COMMENT,\n\tEND_OF_CENTRAL_DIR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH,\n\tZIP64_TOTAL_NUMBER_OF_DISKS,\n\tBITFLAG_ENCRYPTED,\n\tBITFLAG_LEVEL,\n\tBITFLAG_DATA_DESCRIPTOR,\n\tBITFLAG_LANG_ENCODING_FLAG,\n\tFILE_ATTR_MSDOS_DIR_MASK,\n\tVERSION_DEFLATE,\n\tVERSION_ZIP64,\n\tVERSION_AES,\n\tDIRECTORY_SIGNATURE,\n\tMIN_DATE,\n\tMAX_DATE\n};", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst CP437 = \"\\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\u00B6\u00A7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\u00C7\u00FC\u00E9\u00E2\u00E4\u00E0\u00E5\u00E7\u00EA\u00EB\u00E8\u00EF\u00EE\u00EC\u00C4\u00C5\u00C9\u00E6\u00C6\u00F4\u00F6\u00F2\u00FB\u00F9\u00FF\u00D6\u00DC\u00A2\u00A3\u00A5\u20A7\u0192\u00E1\u00ED\u00F3\u00FA\u00F1\u00D1\u00AA\u00BA\u00BF\u2310\u00AC\u00BD\u00BC\u00A1\u00AB\u00BB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\u00DF\u0393\u03C0\u03A3\u03C3\u00B5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\u00B1\u2265\u2264\u2320\u2321\u00F7\u2248\u00B0\u2219\u00B7\u221A\u207F\u00B2\u25A0 \".split(\"\");\n\nexport default stringValue => {\n\tlet result = \"\";\n\tfor (let indexCharacter = 0; indexCharacter < stringValue.length; indexCharacter++) {\n\t\tresult += CP437[stringValue[indexCharacter]];\n\t}\n\treturn result;\n};", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global TextDecoder, FileReader, Blob */\n\nimport decodeCP437 from \"./cp437-decode.js\";\n\nexport default decodeText;\n\nfunction decodeText(value, encoding) {\n\tif (encoding && encoding.trim().toLowerCase() == \"cp437\") {\n\t\treturn decodeCP437(value);\n\t} else if (typeof TextDecoder == \"undefined\") {\n\t\tconst fileReader = new FileReader();\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tfileReader.onload = event => resolve(event.target.result);\n\t\t\tfileReader.onerror = () => reject(fileReader.error);\n\t\t\tfileReader.readAsText(new Blob([value]));\n\t\t});\n\t} else {\n\t\treturn new TextDecoder(encoding).decode(value);\n\t}\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst PROPERTY_NAMES = [\n\t\"filename\", \"rawFilename\", \"directory\", \"encrypted\", \"compressedSize\", \"uncompressedSize\",\n\t\"lastModDate\", \"rawLastModDate\", \"comment\", \"rawComment\", \"signature\", \"extraField\",\n\t\"rawExtraField\", \"bitFlag\", \"extraFieldZip64\", \"extraFieldUnicodePath\", \"extraFieldUnicodeComment\",\n\t\"extraFieldAES\", \"filenameUTF8\", \"commentUTF8\", \"offset\", \"zip64\", \"compressionMethod\",\n\t\"extraFieldNTFS\", \"lastAccessDate\", \"creationDate\", \"extraFieldExtendedTimestamp\",\n\t\"version\", \"versionMadeBy\", \"msDosCompatible\", \"internalFileAttribute\", \"externalFileAttribute\"];\n\nexport default class Entry {\n\n\tconstructor(data) {\n\t\tPROPERTY_NAMES.forEach(name => this[name] = data[name]);\n\t}\n\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global BigInt */\n\nimport {\n\tMAX_32_BITS,\n\tMAX_16_BITS,\n\tCOMPRESSION_METHOD_DEFLATE,\n\tCOMPRESSION_METHOD_STORE,\n\tCOMPRESSION_METHOD_AES,\n\tLOCAL_FILE_HEADER_SIGNATURE,\n\tCENTRAL_FILE_HEADER_SIGNATURE,\n\tEND_OF_CENTRAL_DIR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_SIGNATURE,\n\tEXTRAFIELD_TYPE_ZIP64,\n\tEXTRAFIELD_TYPE_UNICODE_PATH,\n\tEXTRAFIELD_TYPE_UNICODE_COMMENT,\n\tEXTRAFIELD_TYPE_AES,\n\tEXTRAFIELD_TYPE_NTFS,\n\tEXTRAFIELD_TYPE_NTFS_TAG1,\n\tEXTRAFIELD_TYPE_EXTENDED_TIMESTAMP,\n\tEND_OF_CENTRAL_DIR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_LENGTH,\n\tBITFLAG_ENCRYPTED,\n\tBITFLAG_LEVEL,\n\tBITFLAG_DATA_DESCRIPTOR,\n\tBITFLAG_LANG_ENCODING_FLAG,\n\tFILE_ATTR_MSDOS_DIR_MASK,\n\tDIRECTORY_SIGNATURE\n} from \"./constants.js\";\nimport { getConfiguration } from \"./configuration.js\";\nimport { createCodec, CODEC_INFLATE, ERR_INVALID_SIGNATURE, ERR_INVALID_PASSWORD } from \"./codecs/codec-pool.js\";\nimport decodeText from \"./util/decode-text.js\";\nimport Crc32 from \"./codecs/crc32.js\";\nimport { processData } from \"./engine.js\";\nimport Entry from \"./zip-entry.js\";\n\nconst ERR_BAD_FORMAT = \"File format is not recognized\";\nconst ERR_EOCDR_NOT_FOUND = \"End of central directory not found\";\nconst ERR_EOCDR_ZIP64_NOT_FOUND = \"End of Zip64 central directory not found\";\nconst ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND = \"End of Zip64 central directory locator not found\";\nconst ERR_CENTRAL_DIRECTORY_NOT_FOUND = \"Central directory header not found\";\nconst ERR_LOCAL_FILE_HEADER_NOT_FOUND = \"Local file header not found\";\nconst ERR_EXTRAFIELD_ZIP64_NOT_FOUND = \"Zip64 extra field not found\";\nconst ERR_ENCRYPTED = \"File contains encrypted entry\";\nconst ERR_UNSUPPORTED_ENCRYPTION = \"Encryption method not supported\";\nconst ERR_UNSUPPORTED_COMPRESSION = \"Compression method not supported\";\nconst CHARSET_UTF8 = \"utf-8\";\nconst CHARSET_CP437 = \"cp437\";\nconst ZIP64_PROPERTIES = [\"uncompressedSize\", \"compressedSize\", \"offset\"];\n\nclass ZipReader {\n\n\tconstructor(reader, options = {}) {\n\t\tObject.assign(this, {\n\t\t\treader,\n\t\t\toptions,\n\t\t\tconfig: getConfiguration()\n\t\t});\n\t}\n\n\tasync* getEntriesGenerator(options = {}) {\n\t\tconst zipReader = this;\n\t\tconst reader = zipReader.reader;\n\t\tif (!reader.initialized) {\n\t\t\tawait reader.init();\n\t\t}\n\t\tif (reader.size < END_OF_CENTRAL_DIR_LENGTH) {\n\t\t\tthrow new Error(ERR_BAD_FORMAT);\n\t\t}\n\t\tconst endOfDirectoryInfo = await seekSignature(reader, END_OF_CENTRAL_DIR_SIGNATURE, reader.size, END_OF_CENTRAL_DIR_LENGTH, MAX_16_BITS * 16);\n\t\tif (!endOfDirectoryInfo) {\n\t\t\tthrow new Error(ERR_EOCDR_NOT_FOUND);\n\t\t}\n\t\tconst endOfDirectoryView = getDataView(endOfDirectoryInfo);\n\t\tlet directoryDataLength = getUint32(endOfDirectoryView, 12);\n\t\tlet directoryDataOffset = getUint32(endOfDirectoryView, 16);\n\t\tlet filesLength = getUint16(endOfDirectoryView, 8);\n\t\tlet prependedDataLength = 0;\n\t\tif (directoryDataOffset == MAX_32_BITS || directoryDataLength == MAX_32_BITS || filesLength == MAX_16_BITS) {\n\t\t\tconst endOfDirectoryLocatorArray = await readUint8Array(reader, endOfDirectoryInfo.offset - ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH);\n\t\t\tconst endOfDirectoryLocatorView = getDataView(endOfDirectoryLocatorArray);\n\t\t\tif (getUint32(endOfDirectoryLocatorView, 0) != ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE) {\n\t\t\t\tthrow new Error(ERR_EOCDR_ZIP64_NOT_FOUND);\n\t\t\t}\n\t\t\tdirectoryDataOffset = getBigUint64(endOfDirectoryLocatorView, 8);\n\t\t\tlet endOfDirectoryArray = await readUint8Array(reader, directoryDataOffset, ZIP64_END_OF_CENTRAL_DIR_LENGTH);\n\t\t\tlet endOfDirectoryView = getDataView(endOfDirectoryArray);\n\t\t\tconst expectedDirectoryDataOffset = endOfDirectoryInfo.offset - ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH - ZIP64_END_OF_CENTRAL_DIR_LENGTH;\n\t\t\tif (getUint32(endOfDirectoryView, 0) != ZIP64_END_OF_CENTRAL_DIR_SIGNATURE && directoryDataOffset != expectedDirectoryDataOffset) {\n\t\t\t\tconst originalDirectoryDataOffset = directoryDataOffset;\n\t\t\t\tdirectoryDataOffset = expectedDirectoryDataOffset;\n\t\t\t\tprependedDataLength = directoryDataOffset - originalDirectoryDataOffset;\n\t\t\t\tendOfDirectoryArray = await readUint8Array(reader, directoryDataOffset, ZIP64_END_OF_CENTRAL_DIR_LENGTH);\n\t\t\t\tendOfDirectoryView = getDataView(endOfDirectoryArray);\n\t\t\t}\n\t\t\tif (getUint32(endOfDirectoryView, 0) != ZIP64_END_OF_CENTRAL_DIR_SIGNATURE) {\n\t\t\t\tthrow new Error(ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND);\n\t\t\t}\n\t\t\tfilesLength = getBigUint64(endOfDirectoryView, 32);\n\t\t\tdirectoryDataLength = getBigUint64(endOfDirectoryView, 40);\n\t\t\tdirectoryDataOffset -= directoryDataLength;\n\t\t}\n\t\tif (directoryDataOffset < 0 || directoryDataOffset >= reader.size) {\n\t\t\tthrow new Error(ERR_BAD_FORMAT);\n\t\t}\n\t\tlet offset = 0;\n\t\tlet directoryArray = await readUint8Array(reader, directoryDataOffset, directoryDataLength);\n\t\tlet directoryView = getDataView(directoryArray);\n\t\tif (directoryDataLength) {\n\t\t\tconst expectedDirectoryDataOffset = endOfDirectoryInfo.offset - directoryDataLength;\n\t\t\tif (getUint32(directoryView, offset) != CENTRAL_FILE_HEADER_SIGNATURE && directoryDataOffset != expectedDirectoryDataOffset) {\n\t\t\t\tconst originalDirectoryDataOffset = directoryDataOffset;\n\t\t\t\tdirectoryDataOffset = expectedDirectoryDataOffset;\n\t\t\t\tprependedDataLength = directoryDataOffset - originalDirectoryDataOffset;\n\t\t\t\tdirectoryArray = await readUint8Array(reader, directoryDataOffset, directoryDataLength);\n\t\t\t\tdirectoryView = getDataView(directoryArray);\n\t\t\t}\n\t\t}\n\t\tif (directoryDataOffset < 0 || directoryDataOffset >= reader.size) {\n\t\t\tthrow new Error(ERR_BAD_FORMAT);\n\t\t}\n\t\tfor (let indexFile = 0; indexFile < filesLength; indexFile++) {\n\t\t\tconst fileEntry = new ZipEntry(reader, zipReader.config, zipReader.options);\n\t\t\tif (getUint32(directoryView, offset) != CENTRAL_FILE_HEADER_SIGNATURE) {\n\t\t\t\tthrow new Error(ERR_CENTRAL_DIRECTORY_NOT_FOUND);\n\t\t\t}\n\t\t\treadCommonHeader(fileEntry, directoryView, offset + 6);\n\t\t\tconst languageEncodingFlag = Boolean(fileEntry.bitFlag.languageEncodingFlag);\n\t\t\tconst filenameOffset = offset + 46;\n\t\t\tconst extraFieldOffset = filenameOffset + fileEntry.filenameLength;\n\t\t\tconst commentOffset = extraFieldOffset + fileEntry.extraFieldLength;\n\t\t\tconst versionMadeBy = getUint16(directoryView, offset + 4);\n\t\t\tconst msDosCompatible = (versionMadeBy & 0) == 0;\n\t\t\tObject.assign(fileEntry, {\n\t\t\t\tversionMadeBy,\n\t\t\t\tmsDosCompatible,\n\t\t\t\tcompressedSize: 0,\n\t\t\t\tuncompressedSize: 0,\n\t\t\t\tcommentLength: getUint16(directoryView, offset + 32),\n\t\t\t\tdirectory: msDosCompatible && ((getUint8(directoryView, offset + 38) & FILE_ATTR_MSDOS_DIR_MASK) == FILE_ATTR_MSDOS_DIR_MASK),\n\t\t\t\toffset: getUint32(directoryView, offset + 42) + prependedDataLength,\n\t\t\t\tinternalFileAttribute: getUint32(directoryView, offset + 34),\n\t\t\t\texternalFileAttribute: getUint32(directoryView, offset + 38),\n\t\t\t\trawFilename: directoryArray.subarray(filenameOffset, extraFieldOffset),\n\t\t\t\tfilenameUTF8: languageEncodingFlag,\n\t\t\t\tcommentUTF8: languageEncodingFlag,\n\t\t\t\trawExtraField: directoryArray.subarray(extraFieldOffset, commentOffset)\n\t\t\t});\n\t\t\tconst endOffset = commentOffset + fileEntry.commentLength;\n\t\t\tfileEntry.rawComment = directoryArray.subarray(commentOffset, endOffset);\n\t\t\tconst filenameEncoding = getOptionValue(zipReader, options, \"filenameEncoding\");\n\t\t\tconst commentEncoding = getOptionValue(zipReader, options, \"commentEncoding\");\n\t\t\tconst [filename, comment] = await Promise.all([\n\t\t\t\tdecodeText(fileEntry.rawFilename, fileEntry.filenameUTF8 ? CHARSET_UTF8 : filenameEncoding || CHARSET_CP437),\n\t\t\t\tdecodeText(fileEntry.rawComment, fileEntry.commentUTF8 ? CHARSET_UTF8 : commentEncoding || CHARSET_CP437)\n\t\t\t]);\n\t\t\tfileEntry.filename = filename;\n\t\t\tfileEntry.comment = comment;\n\t\t\tif (!fileEntry.directory && fileEntry.filename.endsWith(DIRECTORY_SIGNATURE)) {\n\t\t\t\tfileEntry.directory = true;\n\t\t\t}\n\t\t\tawait readCommonFooter(fileEntry, fileEntry, directoryView, offset + 6);\n\t\t\tconst entry = new Entry(fileEntry);\n\t\t\tentry.getData = (writer, options) => fileEntry.getData(writer, entry, options);\n\t\t\toffset = endOffset;\n\t\t\tif (options.onprogress) {\n\t\t\t\ttry {\n\t\t\t\t\toptions.onprogress(indexFile + 1, filesLength, new Entry(fileEntry));\n\t\t\t\t} catch (_error) {\n\t\t\t\t\t// ignored\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield entry;\n\t\t}\n\t\treturn true;\n\t}\n\n\tasync getEntries(options = {}) {\n\t\tconst entries = [];\n\t\tconst iter = this.getEntriesGenerator(options);\n\t\tlet curr = iter.next();\n\t\twhile(!(await curr).done) {\n\t\t\tentries.push((await curr).value);\n\t\t\tcurr = iter.next();\n\t\t}\n\t\treturn entries;\n\t}\n\n\tasync close() {\n\t}\n}\n\nexport {\n\tZipReader,\n\tERR_BAD_FORMAT,\n\tERR_EOCDR_NOT_FOUND,\n\tERR_EOCDR_ZIP64_NOT_FOUND,\n\tERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,\n\tERR_CENTRAL_DIRECTORY_NOT_FOUND,\n\tERR_LOCAL_FILE_HEADER_NOT_FOUND,\n\tERR_EXTRAFIELD_ZIP64_NOT_FOUND,\n\tERR_ENCRYPTED,\n\tERR_UNSUPPORTED_ENCRYPTION,\n\tERR_UNSUPPORTED_COMPRESSION,\n\tERR_INVALID_SIGNATURE,\n\tERR_INVALID_PASSWORD\n};\n\nclass ZipEntry {\n\n\tconstructor(reader, config, options) {\n\t\tObject.assign(this, {\n\t\t\treader,\n\t\t\tconfig,\n\t\t\toptions\n\t\t});\n\t}\n\n\tasync getData(writer, fileEntry, options = {}) {\n\t\tconst zipEntry = this;\n\t\tconst {\n\t\t\treader,\n\t\t\toffset,\n\t\t\textraFieldAES,\n\t\t\tcompressionMethod,\n\t\t\tconfig,\n\t\t\tbitFlag,\n\t\t\tsignature,\n\t\t\trawLastModDate,\n\t\t\tcompressedSize\n\t\t} = zipEntry;\n\t\tconst localDirectory = zipEntry.localDirectory = {};\n\t\tif (!reader.initialized) {\n\t\t\tawait reader.init();\n\t\t}\n\t\tlet dataArray = await readUint8Array(reader, offset, 30);\n\t\tconst dataView = getDataView(dataArray);\n\t\tlet password = getOptionValue(zipEntry, options, \"password\");\n\t\tpassword = password && password.length && password;\n\t\tif (extraFieldAES) {\n\t\t\tif (extraFieldAES.originalCompressionMethod != COMPRESSION_METHOD_AES) {\n\t\t\t\tthrow new Error(ERR_UNSUPPORTED_COMPRESSION);\n\t\t\t}\n\t\t}\n\t\tif (compressionMethod != COMPRESSION_METHOD_STORE && compressionMethod != COMPRESSION_METHOD_DEFLATE) {\n\t\t\tthrow new Error(ERR_UNSUPPORTED_COMPRESSION);\n\t\t}\n\t\tif (getUint32(dataView, 0) != LOCAL_FILE_HEADER_SIGNATURE) {\n\t\t\tthrow new Error(ERR_LOCAL_FILE_HEADER_NOT_FOUND);\n\t\t}\n\t\treadCommonHeader(localDirectory, dataView, 4);\n\t\tdataArray = await readUint8Array(reader, offset, 30 + localDirectory.filenameLength + localDirectory.extraFieldLength);\n\t\tlocalDirectory.rawExtraField = dataArray.subarray(30 + localDirectory.filenameLength);\n\t\tawait readCommonFooter(zipEntry, localDirectory, dataView, 4);\n\t\tfileEntry.lastAccessDate = localDirectory.lastAccessDate;\n\t\tfileEntry.creationDate = localDirectory.creationDate;\n\t\tconst encrypted = zipEntry.encrypted && localDirectory.encrypted;\n\t\tconst zipCrypto = encrypted && !extraFieldAES;\n\t\tif (encrypted) {\n\t\t\tif (!zipCrypto && extraFieldAES.strength === undefined) {\n\t\t\t\tthrow new Error(ERR_UNSUPPORTED_ENCRYPTION);\n\t\t\t} else if (!password) {\n\t\t\t\tthrow new Error(ERR_ENCRYPTED);\n\t\t\t}\n\t\t}\n\t\tconst codec = await createCodec(config.Inflate, {\n\t\t\tcodecType: CODEC_INFLATE,\n\t\t\tpassword,\n\t\t\tzipCrypto,\n\t\t\tencryptionStrength: extraFieldAES && extraFieldAES.strength,\n\t\t\tsigned: getOptionValue(zipEntry, options, \"checkSignature\"),\n\t\t\tpasswordVerification: zipCrypto && (bitFlag.dataDescriptor ? ((rawLastModDate >>> 8) & 0xFF) : ((signature >>> 24) & 0xFF)),\n\t\t\tsignature,\n\t\t\tcompressed: compressionMethod != 0,\n\t\t\tencrypted,\n\t\t\tuseWebWorkers: getOptionValue(zipEntry, options, \"useWebWorkers\")\n\t\t}, config);\n\t\tif (!writer.initialized) {\n\t\t\tawait writer.init();\n\t\t}\n\t\tconst signal = getOptionValue(zipEntry, options, \"signal\");\n\t\tconst dataOffset = offset + 30 + localDirectory.filenameLength + localDirectory.extraFieldLength;\n\t\tawait processData(codec, reader, writer, dataOffset, () => compressedSize, config, { onprogress: options.onprogress, signal });\n\t\treturn writer.getData();\n\t}\n}\n\nfunction readCommonHeader(directory, dataView, offset) {\n\tconst rawBitFlag = directory.rawBitFlag = getUint16(dataView, offset + 2);\n\tconst encrypted = (rawBitFlag & BITFLAG_ENCRYPTED) == BITFLAG_ENCRYPTED;\n\tconst rawLastModDate = getUint32(dataView, offset + 6);\n\tObject.assign(directory, {\n\t\tencrypted,\n\t\tversion: getUint16(dataView, offset),\n\t\tbitFlag: {\n\t\t\tlevel: (rawBitFlag & BITFLAG_LEVEL) >> 1,\n\t\t\tdataDescriptor: (rawBitFlag & BITFLAG_DATA_DESCRIPTOR) == BITFLAG_DATA_DESCRIPTOR,\n\t\t\tlanguageEncodingFlag: (rawBitFlag & BITFLAG_LANG_ENCODING_FLAG) == BITFLAG_LANG_ENCODING_FLAG\n\t\t},\n\t\trawLastModDate,\n\t\tlastModDate: getDate(rawLastModDate),\n\t\tfilenameLength: getUint16(dataView, offset + 22),\n\t\textraFieldLength: getUint16(dataView, offset + 24)\n\t});\n}\n\nasync function readCommonFooter(fileEntry, directory, dataView, offset) {\n\tconst rawExtraField = directory.rawExtraField;\n\tconst extraField = directory.extraField = new Map();\n\tconst rawExtraFieldView = getDataView(new Uint8Array(rawExtraField));\n\tlet offsetExtraField = 0;\n\ttry {\n\t\twhile (offsetExtraField < rawExtraField.length) {\n\t\t\tconst type = getUint16(rawExtraFieldView, offsetExtraField);\n\t\t\tconst size = getUint16(rawExtraFieldView, offsetExtraField + 2);\n\t\t\textraField.set(type, {\n\t\t\t\ttype,\n\t\t\t\tdata: rawExtraField.slice(offsetExtraField + 4, offsetExtraField + 4 + size)\n\t\t\t});\n\t\t\toffsetExtraField += 4 + size;\n\t\t}\n\t} catch (_error) {\n\t\t// ignored\n\t}\n\tconst compressionMethod = getUint16(dataView, offset + 4);\n\tdirectory.signature = getUint32(dataView, offset + 10);\n\tdirectory.uncompressedSize = getUint32(dataView, offset + 18);\n\tdirectory.compressedSize = getUint32(dataView, offset + 14);\n\tconst extraFieldZip64 = extraField.get(EXTRAFIELD_TYPE_ZIP64);\n\tif (extraFieldZip64) {\n\t\treadExtraFieldZip64(extraFieldZip64, directory);\n\t\tdirectory.extraFieldZip64 = extraFieldZip64;\n\t}\n\tconst extraFieldUnicodePath = extraField.get(EXTRAFIELD_TYPE_UNICODE_PATH);\n\tif (extraFieldUnicodePath) {\n\t\tawait readExtraFieldUnicode(extraFieldUnicodePath, \"filename\", \"rawFilename\", directory, fileEntry);\n\t\tdirectory.extraFieldUnicodePath = extraFieldUnicodePath;\n\t}\n\tconst extraFieldUnicodeComment = extraField.get(EXTRAFIELD_TYPE_UNICODE_COMMENT);\n\tif (extraFieldUnicodeComment) {\n\t\tawait readExtraFieldUnicode(extraFieldUnicodeComment, \"comment\", \"rawComment\", directory, fileEntry);\n\t\tdirectory.extraFieldUnicodeComment = extraFieldUnicodeComment;\n\t}\n\tconst extraFieldAES = extraField.get(EXTRAFIELD_TYPE_AES);\n\tif (extraFieldAES) {\n\t\treadExtraFieldAES(extraFieldAES, directory, compressionMethod);\n\t\tdirectory.extraFieldAES = extraFieldAES;\n\t} else {\n\t\tdirectory.compressionMethod = compressionMethod;\n\t}\n\tconst extraFieldNTFS = extraField.get(EXTRAFIELD_TYPE_NTFS);\n\tif (extraFieldNTFS) {\n\t\treadExtraFieldNTFS(extraFieldNTFS, directory);\n\t\tdirectory.extraFieldNTFS = extraFieldNTFS;\n\t}\n\tconst extraFieldExtendedTimestamp = extraField.get(EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP);\n\tif (extraFieldExtendedTimestamp) {\n\t\treadExtraFieldExtendedTimestamp(extraFieldExtendedTimestamp, directory);\n\t\tdirectory.extraFieldExtendedTimestamp = extraFieldExtendedTimestamp;\n\t}\n}\n\nfunction readExtraFieldZip64(extraFieldZip64, directory) {\n\tdirectory.zip64 = true;\n\tconst extraFieldView = getDataView(extraFieldZip64.data);\n\textraFieldZip64.values = [];\n\tfor (let indexValue = 0; indexValue < Math.floor(extraFieldZip64.data.length / 8); indexValue++) {\n\t\textraFieldZip64.values.push(getBigUint64(extraFieldView, 0 + indexValue * 8));\n\t}\n\tconst missingProperties = ZIP64_PROPERTIES.filter(propertyName => directory[propertyName] == MAX_32_BITS);\n\tfor (let indexMissingProperty = 0; indexMissingProperty < missingProperties.length; indexMissingProperty++) {\n\t\textraFieldZip64[missingProperties[indexMissingProperty]] = extraFieldZip64.values[indexMissingProperty];\n\t}\n\tZIP64_PROPERTIES.forEach(propertyName => {\n\t\tif (directory[propertyName] == MAX_32_BITS) {\n\t\t\tif (extraFieldZip64[propertyName] !== undefined) {\n\t\t\t\tdirectory[propertyName] = extraFieldZip64[propertyName];\n\t\t\t} else {\n\t\t\t\tthrow new Error(ERR_EXTRAFIELD_ZIP64_NOT_FOUND);\n\t\t\t}\n\t\t}\n\t});\n}\n\nasync function readExtraFieldUnicode(extraFieldUnicode, propertyName, rawPropertyName, directory, fileEntry) {\n\tconst extraFieldView = getDataView(extraFieldUnicode.data);\n\textraFieldUnicode.version = getUint8(extraFieldView, 0);\n\textraFieldUnicode.signature = getUint32(extraFieldView, 1);\n\tconst crc32 = new Crc32();\n\tcrc32.append(fileEntry[rawPropertyName]);\n\tconst dataViewSignature = getDataView(new Uint8Array(4));\n\tdataViewSignature.setUint32(0, crc32.get(), true);\n\textraFieldUnicode[propertyName] = await decodeText(extraFieldUnicode.data.subarray(5));\n\textraFieldUnicode.valid = !fileEntry.bitFlag.languageEncodingFlag && extraFieldUnicode.signature == getUint32(dataViewSignature, 0);\n\tif (extraFieldUnicode.valid) {\n\t\tdirectory[propertyName] = extraFieldUnicode[propertyName];\n\t\tdirectory[propertyName + \"UTF8\"] = true;\n\t}\n}\n\nfunction readExtraFieldAES(extraFieldAES, directory, compressionMethod) {\n\tconst extraFieldView = getDataView(extraFieldAES.data);\n\textraFieldAES.vendorVersion = getUint8(extraFieldView, 0);\n\textraFieldAES.vendorId = getUint8(extraFieldView, 2);\n\tconst strength = getUint8(extraFieldView, 4);\n\textraFieldAES.strength = strength;\n\textraFieldAES.originalCompressionMethod = compressionMethod;\n\tdirectory.compressionMethod = extraFieldAES.compressionMethod = getUint16(extraFieldView, 5);\n}\n\nfunction readExtraFieldNTFS(extraFieldNTFS, directory) {\n\tconst extraFieldView = getDataView(extraFieldNTFS.data);\n\tlet offsetExtraField = 4;\n\tlet tag1Data;\n\ttry {\n\t\twhile (offsetExtraField < extraFieldNTFS.data.length && !tag1Data) {\n\t\t\tconst tagValue = getUint16(extraFieldView, offsetExtraField);\n\t\t\tconst attributeSize = getUint16(extraFieldView, offsetExtraField + 2);\n\t\t\tif (tagValue == EXTRAFIELD_TYPE_NTFS_TAG1) {\n\t\t\t\ttag1Data = extraFieldNTFS.data.slice(offsetExtraField + 4, offsetExtraField + 4 + attributeSize);\n\t\t\t}\n\t\t\toffsetExtraField += 4 + attributeSize;\n\t\t}\n\t} catch (_error) {\n\t\t// ignored\n\t}\n\ttry {\n\t\tif (tag1Data && tag1Data.length == 24) {\n\t\t\tconst tag1View = getDataView(tag1Data);\n\t\t\tconst rawLastModDate = tag1View.getBigUint64(0, true);\n\t\t\tconst rawLastAccessDate = tag1View.getBigUint64(8, true);\n\t\t\tconst rawCreationDate = tag1View.getBigUint64(16, true);\n\t\t\tObject.assign(extraFieldNTFS, {\n\t\t\t\trawLastModDate,\n\t\t\t\trawLastAccessDate,\n\t\t\t\trawCreationDate\n\t\t\t});\n\t\t\tconst lastModDate = getDateNTFS(rawLastModDate);\n\t\t\tconst lastAccessDate = getDateNTFS(rawLastAccessDate);\n\t\t\tconst creationDate = getDateNTFS(rawCreationDate);\n\t\t\tconst extraFieldData = { lastModDate, lastAccessDate, creationDate };\n\t\t\tObject.assign(extraFieldNTFS, extraFieldData);\n\t\t\tObject.assign(directory, extraFieldData);\n\t\t}\n\t} catch (_error) {\n\t\t// ignored\n\t}\n}\n\nfunction readExtraFieldExtendedTimestamp(extraFieldExtendedTimestamp, directory) {\n\tconst extraFieldView = getDataView(extraFieldExtendedTimestamp.data);\n\tconst flags = getUint8(extraFieldView, 0);\n\tconst timeProperties = [];\n\tconst timeRawProperties = [];\n\tif ((flags & 0x1) == 0x1) {\n\t\ttimeProperties.push(\"lastModDate\");\n\t\ttimeRawProperties.push(\"rawLastModDate\");\n\t}\n\tif ((flags & 0x2) == 0x2) {\n\t\ttimeProperties.push(\"lastAccessDate\");\n\t\ttimeRawProperties.push(\"rawLastAccessDate\");\n\t}\n\tif ((flags & 0x4) == 0x4) {\n\t\ttimeProperties.push(\"creationDate\");\n\t\ttimeRawProperties.push(\"rawCreationDate\");\n\t}\n\tlet offset = 1;\n\ttimeProperties.forEach((propertyName, indexProperty) => {\n\t\tif (extraFieldExtendedTimestamp.data.length >= offset + 4) {\n\t\t\tconst time = getUint32(extraFieldView, offset);\n\t\t\tdirectory[propertyName] = extraFieldExtendedTimestamp[propertyName] = new Date(time * 1000);\n\t\t\tconst rawPropertyName = timeRawProperties[indexProperty];\n\t\t\textraFieldExtendedTimestamp[rawPropertyName] = time;\n\t\t}\n\t\toffset += 4;\n\t});\n}\n\nasync function seekSignature(reader, signature, startOffset, minimumBytes, maximumLength) {\n\tconst signatureArray = new Uint8Array(4);\n\tconst signatureView = getDataView(signatureArray);\n\tsetUint32(signatureView, 0, signature);\n\tconst maximumBytes = minimumBytes + maximumLength;\n\treturn (await seek(minimumBytes)) || await seek(Math.min(maximumBytes, startOffset));\n\n\tasync function seek(length) {\n\t\tconst offset = startOffset - length;\n\t\tconst bytes = await readUint8Array(reader, offset, length);\n\t\tfor (let indexByte = bytes.length - minimumBytes; indexByte >= 0; indexByte--) {\n\t\t\tif (bytes[indexByte] == signatureArray[0] && bytes[indexByte + 1] == signatureArray[1] &&\n\t\t\t\tbytes[indexByte + 2] == signatureArray[2] && bytes[indexByte + 3] == signatureArray[3]) {\n\t\t\t\treturn {\n\t\t\t\t\toffset: offset + indexByte,\n\t\t\t\t\tbuffer: bytes.slice(indexByte, indexByte + minimumBytes).buffer\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction getOptionValue(zipReader, options, name) {\n\treturn options[name] === undefined ? zipReader.options[name] : options[name];\n}\n\nfunction getDate(timeRaw) {\n\tconst date = (timeRaw & 0xffff0000) >> 16, time = timeRaw & 0x0000ffff;\n\ttry {\n\t\treturn new Date(1980 + ((date & 0xFE00) >> 9), ((date & 0x01E0) >> 5) - 1, date & 0x001F, (time & 0xF800) >> 11, (time & 0x07E0) >> 5, (time & 0x001F) * 2, 0);\n\t} catch (_error) {\n\t\t// ignored\n\t}\n}\n\nfunction getDateNTFS(timeRaw) {\n\treturn new Date((Number((timeRaw / BigInt(10000)) - BigInt(11644473600000))));\n}\n\nfunction getUint8(view, offset) {\n\treturn view.getUint8(offset);\n}\n\nfunction getUint16(view, offset) {\n\treturn view.getUint16(offset, true);\n}\n\nfunction getUint32(view, offset) {\n\treturn view.getUint32(offset, true);\n}\n\nfunction getBigUint64(view, offset) {\n\treturn Number(view.getBigUint64(offset, true));\n}\n\nfunction setUint32(view, offset, value) {\n\tview.setUint32(offset, value, true);\n}\n\nfunction getDataView(array) {\n\treturn new DataView(array.buffer);\n}\n\nfunction readUint8Array(reader, offset, size) {\n\treturn reader.readUint8Array(offset, size);\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global BigInt, FileReader */\n\nimport {\n\tMAX_32_BITS,\n\tMAX_16_BITS,\n\tCOMPRESSION_METHOD_DEFLATE,\n\tCOMPRESSION_METHOD_STORE,\n\tCOMPRESSION_METHOD_AES,\n\tLOCAL_FILE_HEADER_SIGNATURE,\n\tDATA_DESCRIPTOR_RECORD_SIGNATURE,\n\tCENTRAL_FILE_HEADER_SIGNATURE,\n\tEND_OF_CENTRAL_DIR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_SIGNATURE,\n\tZIP64_TOTAL_NUMBER_OF_DISKS,\n\tEXTRAFIELD_TYPE_AES,\n\tEXTRAFIELD_TYPE_ZIP64,\n\tEXTRAFIELD_TYPE_EXTENDED_TIMESTAMP,\n\tEXTRAFIELD_TYPE_NTFS,\n\tEXTRAFIELD_TYPE_NTFS_TAG1,\n\tEND_OF_CENTRAL_DIR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH,\n\tBITFLAG_ENCRYPTED,\n\tBITFLAG_DATA_DESCRIPTOR,\n\tBITFLAG_LANG_ENCODING_FLAG,\n\tFILE_ATTR_MSDOS_DIR_MASK,\n\tVERSION_DEFLATE,\n\tVERSION_ZIP64,\n\tVERSION_AES,\n\tDIRECTORY_SIGNATURE,\n\tMIN_DATE,\n\tMAX_DATE\n} from \"./constants.js\";\nimport { getConfiguration } from \"./configuration.js\";\nimport { CODEC_DEFLATE, createCodec } from \"./codecs/codec-pool.js\";\nimport encodeText from \"./util/encode-text.js\";\nimport { BlobWriter } from \"./io.js\";\nimport { processData } from \"./engine.js\";\nimport Entry from \"./zip-entry.js\";\n\nconst ERR_DUPLICATED_NAME = \"File already exists\";\nconst ERR_INVALID_COMMENT = \"Zip file comment exceeds 64KB\";\nconst ERR_INVALID_ENTRY_COMMENT = \"File entry comment exceeds 64KB\";\nconst ERR_INVALID_ENTRY_NAME = \"File entry name exceeds 64KB\";\nconst ERR_INVALID_VERSION = \"Version exceeds 65535\";\nconst ERR_INVALID_ENCRYPTION_STRENGTH = \"The strength must equal 1, 2, or 3\";\nconst ERR_INVALID_EXTRAFIELD_TYPE = \"Extra field type exceeds 65535\";\nconst ERR_INVALID_EXTRAFIELD_DATA = \"Extra field data exceeds 64KB\";\nconst ERR_UNSUPPORTED_FORMAT = \"Zip64 is not supported\";\n\nconst EXTRAFIELD_DATA_AES = new Uint8Array([0x07, 0x00, 0x02, 0x00, 0x41, 0x45, 0x03, 0x00, 0x00]);\nconst EXTRAFIELD_LENGTH_ZIP64 = 24;\n\nlet workers = 0;\n\nclass ZipWriter {\n\n\tconstructor(writer, options = {}) {\n\t\tObject.assign(this, {\n\t\t\twriter,\n\t\t\toptions,\n\t\t\tconfig: getConfiguration(),\n\t\t\tfiles: new Map(),\n\t\t\toffset: writer.size,\n\t\t\tpendingCompressedSize: 0,\n\t\t\tpendingEntries: [],\n\t\t\tpendingAddFileCalls: new Set()\n\t\t});\n\t}\n\n\tasync add(name = \"\", reader, options = {}) {\n\t\tconst zipWriter = this;\n\t\tif (workers < zipWriter.config.maxWorkers) {\n\t\t\tworkers++;\n\t\t\tlet promiseAddFile;\n\t\t\ttry {\n\t\t\t\tpromiseAddFile = addFile(zipWriter, name, reader, options);\n\t\t\t\tthis.pendingAddFileCalls.add(promiseAddFile);\n\t\t\t\treturn await promiseAddFile;\n\t\t\t} finally {\n\t\t\t\tthis.pendingAddFileCalls.delete(promiseAddFile);\n\t\t\t\tworkers--;\n\t\t\t\tconst pendingEntry = zipWriter.pendingEntries.shift();\n\t\t\t\tif (pendingEntry) {\n\t\t\t\t\tzipWriter.add(pendingEntry.name, pendingEntry.reader, pendingEntry.options)\n\t\t\t\t\t\t.then(pendingEntry.resolve)\n\t\t\t\t\t\t.catch(pendingEntry.reject);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn new Promise((resolve, reject) => zipWriter.pendingEntries.push({ name, reader, options, resolve, reject }));\n\t\t}\n\t}\n\n\tasync close(comment = new Uint8Array(0), options = {}) {\n\t\twhile (this.pendingAddFileCalls.size) {\n\t\t\tawait Promise.all(Array.from(this.pendingAddFileCalls));\n\t\t}\n\t\tawait closeFile(this, comment, options);\n\t\treturn this.writer.getData();\n\t}\n}\n\nexport {\n\tZipWriter,\n\tERR_DUPLICATED_NAME,\n\tERR_INVALID_COMMENT,\n\tERR_INVALID_ENTRY_NAME,\n\tERR_INVALID_ENTRY_COMMENT,\n\tERR_INVALID_VERSION,\n\tERR_INVALID_EXTRAFIELD_TYPE,\n\tERR_INVALID_EXTRAFIELD_DATA,\n\tERR_INVALID_ENCRYPTION_STRENGTH,\n\tERR_UNSUPPORTED_FORMAT\n};\n\nasync function addFile(zipWriter, name, reader, options) {\n\tname = name.trim();\n\tif (options.directory && (!name.endsWith(DIRECTORY_SIGNATURE))) {\n\t\tname += DIRECTORY_SIGNATURE;\n\t} else {\n\t\toptions.directory = name.endsWith(DIRECTORY_SIGNATURE);\n\t}\n\tif (zipWriter.files.has(name)) {\n\t\tthrow new Error(ERR_DUPLICATED_NAME);\n\t}\n\tconst rawFilename = encodeText(name);\n\tif (rawFilename.length > MAX_16_BITS) {\n\t\tthrow new Error(ERR_INVALID_ENTRY_NAME);\n\t}\n\tconst comment = options.comment || \"\";\n\tconst rawComment = encodeText(comment);\n\tif (rawComment.length > MAX_16_BITS) {\n\t\tthrow new Error(ERR_INVALID_ENTRY_COMMENT);\n\t}\n\tconst version = zipWriter.options.version || options.version || 0;\n\tif (version > MAX_16_BITS) {\n\t\tthrow new Error(ERR_INVALID_VERSION);\n\t}\n\tconst versionMadeBy = zipWriter.options.versionMadeBy || options.versionMadeBy || 20;\n\tif (versionMadeBy > MAX_16_BITS) {\n\t\tthrow new Error(ERR_INVALID_VERSION);\n\t}\n\tconst lastModDate = getOptionValue(zipWriter, options, \"lastModDate\") || new Date();\n\tconst lastAccessDate = getOptionValue(zipWriter, options, \"lastAccessDate\");\n\tconst creationDate = getOptionValue(zipWriter, options, \"creationDate\");\n\tconst password = getOptionValue(zipWriter, options, \"password\");\n\tconst encryptionStrength = getOptionValue(zipWriter, options, \"encryptionStrength\") || 3;\n\tconst zipCrypto = getOptionValue(zipWriter, options, \"zipCrypto\");\n\tif (password !== undefined && encryptionStrength !== undefined && (encryptionStrength < 1 || encryptionStrength > 3)) {\n\t\tthrow new Error(ERR_INVALID_ENCRYPTION_STRENGTH);\n\t}\n\tlet rawExtraField = new Uint8Array(0);\n\tconst extraField = options.extraField;\n\tif (extraField) {\n\t\tlet extraFieldSize = 0;\n\t\tlet offset = 0;\n\t\textraField.forEach(data => extraFieldSize += 4 + data.length);\n\t\trawExtraField = new Uint8Array(extraFieldSize);\n\t\textraField.forEach((data, type) => {\n\t\t\tif (type > MAX_16_BITS) {\n\t\t\t\tthrow new Error(ERR_INVALID_EXTRAFIELD_TYPE);\n\t\t\t}\n\t\t\tif (data.length > MAX_16_BITS) {\n\t\t\t\tthrow new Error(ERR_INVALID_EXTRAFIELD_DATA);\n\t\t\t}\n\t\t\tarraySet(rawExtraField, new Uint16Array([type]), offset);\n\t\t\tarraySet(rawExtraField, new Uint16Array([data.length]), offset + 2);\n\t\t\tarraySet(rawExtraField, data, offset + 4);\n\t\t\toffset += 4 + data.length;\n\t\t});\n\t}\n\tlet extendedTimestamp = getOptionValue(zipWriter, options, \"extendedTimestamp\");\n\tif (extendedTimestamp === undefined) {\n\t\textendedTimestamp = true;\n\t}\n\tlet maximumCompressedSize = 0;\n\tlet keepOrder = getOptionValue(zipWriter, options, \"keepOrder\");\n\tif (keepOrder === undefined) {\n\t\tkeepOrder = true;\n\t}\n\tlet uncompressedSize = 0;\n\tlet msDosCompatible = getOptionValue(zipWriter, options, \"msDosCompatible\");\n\tif (msDosCompatible === undefined) {\n\t\tmsDosCompatible = true;\n\t}\n\tconst internalFileAttribute = getOptionValue(zipWriter, options, \"internalFileAttribute\") || 0;\n\tconst externalFileAttribute = getOptionValue(zipWriter, options, \"externalFileAttribute\") || 0;\n\tif (reader) {\n\t\tif (!reader.initialized) {\n\t\t\tawait reader.init();\n\t\t}\n\t\tuncompressedSize = reader.size;\n\t\tmaximumCompressedSize = getMaximumCompressedSize(uncompressedSize);\n\t}\n\tlet zip64 = options.zip64 || zipWriter.options.zip64 || false;\n\tif (zipWriter.offset + zipWriter.pendingCompressedSize >= MAX_32_BITS ||\n\t\tuncompressedSize >= MAX_32_BITS ||\n\t\tmaximumCompressedSize >= MAX_32_BITS) {\n\t\tif (options.zip64 === false || zipWriter.options.zip64 === false || !keepOrder) {\n\t\t\tthrow new Error(ERR_UNSUPPORTED_FORMAT);\n\t\t} else {\n\t\t\tzip64 = true;\n\t\t}\n\t}\n\tzipWriter.pendingCompressedSize += maximumCompressedSize;\n\tawait Promise.resolve();\n\tconst level = getOptionValue(zipWriter, options, \"level\");\n\tconst useWebWorkers = getOptionValue(zipWriter, options, \"useWebWorkers\");\n\tconst bufferedWrite = getOptionValue(zipWriter, options, \"bufferedWrite\");\n\tlet dataDescriptor = getOptionValue(zipWriter, options, \"dataDescriptor\");\n\tlet dataDescriptorSignature = getOptionValue(zipWriter, options, \"dataDescriptorSignature\");\n\tconst signal = getOptionValue(zipWriter, options, \"signal\");\n\tif (dataDescriptor === undefined) {\n\t\tdataDescriptor = true;\n\t}\n\tif (dataDescriptor && dataDescriptorSignature === undefined) {\n\t\tdataDescriptorSignature = false;\n\t}\n\tconst fileEntry = await getFileEntry(zipWriter, name, reader, Object.assign({}, options, {\n\t\trawFilename,\n\t\trawComment,\n\t\tversion,\n\t\tversionMadeBy,\n\t\tlastModDate,\n\t\tlastAccessDate,\n\t\tcreationDate,\n\t\trawExtraField,\n\t\tzip64,\n\t\tpassword,\n\t\tlevel,\n\t\tuseWebWorkers,\n\t\tencryptionStrength,\n\t\textendedTimestamp,\n\t\tzipCrypto,\n\t\tbufferedWrite,\n\t\tkeepOrder,\n\t\tdataDescriptor,\n\t\tdataDescriptorSignature,\n\t\tsignal,\n\t\tmsDosCompatible,\n\t\tinternalFileAttribute,\n\t\texternalFileAttribute\n\t}));\n\tif (maximumCompressedSize) {\n\t\tzipWriter.pendingCompressedSize -= maximumCompressedSize;\n\t}\n\tObject.assign(fileEntry, { name, comment, extraField });\n\treturn new Entry(fileEntry);\n}\n\nasync function getFileEntry(zipWriter, name, reader, options) {\n\tconst files = zipWriter.files;\n\tconst writer = zipWriter.writer;\n\tconst previousFileEntry = Array.from(files.values()).pop();\n\tlet fileEntry = {};\n\tlet bufferedWrite;\n\tlet resolveLockUnbufferedWrite;\n\tlet resolveLockCurrentFileEntry;\n\tfiles.set(name, fileEntry);\n\ttry {\n\t\tlet lockPreviousFileEntry;\n\t\tlet fileWriter;\n\t\tlet lockCurrentFileEntry;\n\t\tif (options.keepOrder) {\n\t\t\tlockPreviousFileEntry = previousFileEntry && previousFileEntry.lock;\n\t\t}\n\t\tfileEntry.lock = lockCurrentFileEntry = new Promise(resolve => resolveLockCurrentFileEntry = resolve);\n\t\tif (options.bufferedWrite || zipWriter.lockWrite || !options.dataDescriptor) {\n\t\t\tfileWriter = new BlobWriter();\n\t\t\tfileWriter.init();\n\t\t\tbufferedWrite = true;\n\t\t} else {\n\t\t\tzipWriter.lockWrite = new Promise(resolve => resolveLockUnbufferedWrite = resolve);\n\t\t\tif (!writer.initialized) {\n\t\t\t\tawait writer.init();\n\t\t\t}\n\t\t\tfileWriter = writer;\n\t\t}\n\t\tfileEntry = await createFileEntry(reader, fileWriter, zipWriter.config, options);\n\t\tfileEntry.lock = lockCurrentFileEntry;\n\t\tfiles.set(name, fileEntry);\n\t\tfileEntry.filename = name;\n\t\tif (bufferedWrite) {\n\t\t\tlet indexWrittenData = 0;\n\t\t\tconst blob = fileWriter.getData();\n\t\t\tawait Promise.all([zipWriter.lockWrite, lockPreviousFileEntry]);\n\t\t\tlet pendingFileEntry;\n\t\t\tdo {\n\t\t\t\tpendingFileEntry = Array.from(files.values()).find(fileEntry => fileEntry.writingBufferedData);\n\t\t\t\tif (pendingFileEntry) {\n\t\t\t\t\tawait pendingFileEntry.lock;\n\t\t\t\t}\n\t\t\t} while (pendingFileEntry && pendingFileEntry.lock);\n\t\t\tfileEntry.writingBufferedData = true;\n\t\t\tif (!options.dataDescriptor) {\n\t\t\t\tconst headerLength = 26;\n\t\t\t\tconst arrayBuffer = await sliceAsArrayBuffer(blob, 0, headerLength);\n\t\t\t\tconst arrayBufferView = new DataView(arrayBuffer);\n\t\t\t\tif (!fileEntry.encrypted || options.zipCrypto) {\n\t\t\t\t\tsetUint32(arrayBufferView, 14, fileEntry.signature);\n\t\t\t\t}\n\t\t\t\tif (fileEntry.zip64) {\n\t\t\t\t\tsetUint32(arrayBufferView, 18, MAX_32_BITS);\n\t\t\t\t\tsetUint32(arrayBufferView, 22, MAX_32_BITS);\n\t\t\t\t} else {\n\t\t\t\t\tsetUint32(arrayBufferView, 18, fileEntry.compressedSize);\n\t\t\t\t\tsetUint32(arrayBufferView, 22, fileEntry.uncompressedSize);\n\t\t\t\t}\n\t\t\t\tawait writer.writeUint8Array(new Uint8Array(arrayBuffer));\n\t\t\t\tindexWrittenData = headerLength;\n\t\t\t}\n\t\t\tawait writeBlob(writer, blob, indexWrittenData);\n\t\t\tdelete fileEntry.writingBufferedData;\n\t\t}\n\t\tfileEntry.offset = zipWriter.offset;\n\t\tif (fileEntry.zip64) {\n\t\t\tconst rawExtraFieldZip64View = getDataView(fileEntry.rawExtraFieldZip64);\n\t\t\tsetBigUint64(rawExtraFieldZip64View, 20, BigInt(fileEntry.offset));\n\t\t} else if (fileEntry.offset >= MAX_32_BITS) {\n\t\t\tthrow new Error(ERR_UNSUPPORTED_FORMAT);\n\t\t}\n\t\tzipWriter.offset += fileEntry.length;\n\t\treturn fileEntry;\n\t} catch (error) {\n\t\tif ((bufferedWrite && fileEntry.writingBufferedData) || (!bufferedWrite && fileEntry.dataWritten)) {\n\t\t\terror.corruptedEntry = zipWriter.hasCorruptedEntries = true;\n\t\t\tif (fileEntry.uncompressedSize) {\n\t\t\t\tzipWriter.offset += fileEntry.uncompressedSize;\n\t\t\t}\n\t\t}\n\t\tfiles.delete(name);\n\t\tthrow error;\n\t} finally {\n\t\tresolveLockCurrentFileEntry();\n\t\tif (resolveLockUnbufferedWrite) {\n\t\t\tresolveLockUnbufferedWrite();\n\t\t}\n\t}\n}\n\nasync function createFileEntry(reader, writer, config, options) {\n\tconst {\n\t\trawFilename,\n\t\tlastAccessDate,\n\t\tcreationDate,\n\t\tpassword,\n\t\tlevel,\n\t\tzip64,\n\t\tzipCrypto,\n\t\tdataDescriptor,\n\t\tdataDescriptorSignature,\n\t\tdirectory,\n\t\tversion,\n\t\tversionMadeBy,\n\t\trawComment,\n\t\trawExtraField,\n\t\tuseWebWorkers,\n\t\tonprogress,\n\t\tsignal,\n\t\tencryptionStrength,\n\t\textendedTimestamp,\n\t\tmsDosCompatible,\n\t\tinternalFileAttribute,\n\t\texternalFileAttribute\n\t} = options;\n\tconst encrypted = Boolean(password && password.length);\n\tconst compressed = level !== 0 && !directory;\n\tlet rawExtraFieldAES;\n\tif (encrypted && !zipCrypto) {\n\t\trawExtraFieldAES = new Uint8Array(EXTRAFIELD_DATA_AES.length + 2);\n\t\tconst extraFieldAESView = getDataView(rawExtraFieldAES);\n\t\tsetUint16(extraFieldAESView, 0, EXTRAFIELD_TYPE_AES);\n\t\tarraySet(rawExtraFieldAES, EXTRAFIELD_DATA_AES, 2);\n\t\tsetUint8(extraFieldAESView, 8, encryptionStrength);\n\t} else {\n\t\trawExtraFieldAES = new Uint8Array(0);\n\t}\n\tlet rawExtraFieldNTFS;\n\tlet rawExtraFieldExtendedTimestamp;\n\tif (extendedTimestamp) {\n\t\trawExtraFieldExtendedTimestamp = new Uint8Array(9 + (lastAccessDate ? 4 : 0) + (creationDate ? 4 : 0));\n\t\tconst extraFieldExtendedTimestampView = getDataView(rawExtraFieldExtendedTimestamp);\n\t\tsetUint16(extraFieldExtendedTimestampView, 0, EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP);\n\t\tsetUint16(extraFieldExtendedTimestampView, 2, rawExtraFieldExtendedTimestamp.length - 4);\n\t\tconst extraFieldExtendedTimestampFlag = 0x1 + (lastAccessDate ? 0x2 : 0) + (creationDate ? 0x4 : 0);\n\t\tsetUint8(extraFieldExtendedTimestampView, 4, extraFieldExtendedTimestampFlag);\n\t\tsetUint32(extraFieldExtendedTimestampView, 5, Math.floor(options.lastModDate.getTime() / 1000));\n\t\tif (lastAccessDate) {\n\t\t\tsetUint32(extraFieldExtendedTimestampView, 9, Math.floor(lastAccessDate.getTime() / 1000));\n\t\t}\n\t\tif (creationDate) {\n\t\t\tsetUint32(extraFieldExtendedTimestampView, 13, Math.floor(creationDate.getTime() / 1000));\n\t\t}\n\t\ttry {\n\t\t\trawExtraFieldNTFS = new Uint8Array(36);\n\t\t\tconst extraFieldNTFSView = getDataView(rawExtraFieldNTFS);\n\t\t\tconst lastModTimeNTFS = getTimeNTFS(options.lastModDate);\n\t\t\tsetUint16(extraFieldNTFSView, 0, EXTRAFIELD_TYPE_NTFS);\n\t\t\tsetUint16(extraFieldNTFSView, 2, 32);\n\t\t\tsetUint16(extraFieldNTFSView, 8, EXTRAFIELD_TYPE_NTFS_TAG1);\n\t\t\tsetUint16(extraFieldNTFSView, 10, 24);\n\t\t\tsetBigUint64(extraFieldNTFSView, 12, lastModTimeNTFS);\n\t\t\tsetBigUint64(extraFieldNTFSView, 20, getTimeNTFS(lastAccessDate) || lastModTimeNTFS);\n\t\t\tsetBigUint64(extraFieldNTFSView, 28, getTimeNTFS(creationDate) || lastModTimeNTFS);\n\t\t} catch (_error) {\n\t\t\trawExtraFieldNTFS = new Uint8Array(0);\n\t\t}\n\t} else {\n\t\trawExtraFieldNTFS = rawExtraFieldExtendedTimestamp = new Uint8Array(0);\n\t}\n\tconst fileEntry = {\n\t\tversion: version || VERSION_DEFLATE,\n\t\tversionMadeBy,\n\t\tzip64,\n\t\tdirectory: Boolean(directory),\n\t\tfilenameUTF8: true,\n\t\trawFilename,\n\t\tcommentUTF8: true,\n\t\trawComment,\n\t\trawExtraFieldZip64: zip64 ? new Uint8Array(EXTRAFIELD_LENGTH_ZIP64 + 4) : new Uint8Array(0),\n\t\trawExtraFieldExtendedTimestamp,\n\t\trawExtraFieldNTFS,\n\t\trawExtraFieldAES,\n\t\trawExtraField,\n\t\textendedTimestamp,\n\t\tmsDosCompatible,\n\t\tinternalFileAttribute,\n\t\texternalFileAttribute\n\t};\n\tlet uncompressedSize = fileEntry.uncompressedSize = 0;\n\tlet bitFlag = BITFLAG_LANG_ENCODING_FLAG;\n\tif (dataDescriptor) {\n\t\tbitFlag = bitFlag | BITFLAG_DATA_DESCRIPTOR;\n\t}\n\tlet compressionMethod = COMPRESSION_METHOD_STORE;\n\tif (compressed) {\n\t\tcompressionMethod = COMPRESSION_METHOD_DEFLATE;\n\t}\n\tif (zip64) {\n\t\tfileEntry.version = fileEntry.version > VERSION_ZIP64 ? fileEntry.version : VERSION_ZIP64;\n\t}\n\tif (encrypted) {\n\t\tbitFlag = bitFlag | BITFLAG_ENCRYPTED;\n\t\tif (!zipCrypto) {\n\t\t\tfileEntry.version = fileEntry.version > VERSION_AES ? fileEntry.version : VERSION_AES;\n\t\t\tcompressionMethod = COMPRESSION_METHOD_AES;\n\t\t\tif (compressed) {\n\t\t\t\tfileEntry.rawExtraFieldAES[9] = COMPRESSION_METHOD_DEFLATE;\n\t\t\t}\n\t\t}\n\t}\n\tfileEntry.compressionMethod = compressionMethod;\n\tconst headerArray = fileEntry.headerArray = new Uint8Array(26);\n\tconst headerView = getDataView(headerArray);\n\tsetUint16(headerView, 0, fileEntry.version);\n\tsetUint16(headerView, 2, bitFlag);\n\tsetUint16(headerView, 4, compressionMethod);\n\tconst dateArray = new Uint32Array(1);\n\tconst dateView = getDataView(dateArray);\n\tlet lastModDate;\n\tif (options.lastModDate < MIN_DATE) {\n\t\tlastModDate = MIN_DATE;\n\t} else if (options.lastModDate > MAX_DATE) {\n\t\tlastModDate = MAX_DATE;\n\t} else {\n\t\tlastModDate = options.lastModDate;\n\t}\n\tsetUint16(dateView, 0, (((lastModDate.getHours() << 6) | lastModDate.getMinutes()) << 5) | lastModDate.getSeconds() / 2);\n\tsetUint16(dateView, 2, ((((lastModDate.getFullYear() - 1980) << 4) | (lastModDate.getMonth() + 1)) << 5) | lastModDate.getDate());\n\tconst rawLastModDate = dateArray[0];\n\tsetUint32(headerView, 6, rawLastModDate);\n\tsetUint16(headerView, 22, rawFilename.length);\n\tconst extraFieldLength = rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length + rawExtraFieldNTFS.length + fileEntry.rawExtraField.length;\n\tsetUint16(headerView, 24, extraFieldLength);\n\tconst localHeaderArray = new Uint8Array(30 + rawFilename.length + extraFieldLength);\n\tconst localHeaderView = getDataView(localHeaderArray);\n\tsetUint32(localHeaderView, 0, LOCAL_FILE_HEADER_SIGNATURE);\n\tarraySet(localHeaderArray, headerArray, 4);\n\tarraySet(localHeaderArray, rawFilename, 30);\n\tarraySet(localHeaderArray, rawExtraFieldAES, 30 + rawFilename.length);\n\tarraySet(localHeaderArray, rawExtraFieldExtendedTimestamp, 30 + rawFilename.length + rawExtraFieldAES.length);\n\tarraySet(localHeaderArray, rawExtraFieldNTFS, 30 + rawFilename.length + rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length);\n\tarraySet(localHeaderArray, fileEntry.rawExtraField, 30 + rawFilename.length + rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length + rawExtraFieldNTFS.length);\n\tlet result;\n\tlet compressedSize = 0;\n\tif (reader) {\n\t\tconst codec = await createCodec(config.Deflate, {\n\t\t\tcodecType: CODEC_DEFLATE,\n\t\t\tlevel,\n\t\t\tpassword,\n\t\t\tencryptionStrength,\n\t\t\tzipCrypto: encrypted && zipCrypto,\n\t\t\tpasswordVerification: encrypted && zipCrypto && (rawLastModDate >> 8) & 0xFF,\n\t\t\tsigned: true,\n\t\t\tcompressed,\n\t\t\tencrypted,\n\t\t\tuseWebWorkers\n\t\t}, config);\n\t\tawait writer.writeUint8Array(localHeaderArray);\n\t\tfileEntry.dataWritten = true;\n\t\tresult = await processData(codec, reader, writer, 0, () => reader.size, config, { onprogress, signal });\n\t\tuncompressedSize = fileEntry.uncompressedSize = reader.size;\n\t\tcompressedSize = result.length;\n\t} else {\n\t\tawait writer.writeUint8Array(localHeaderArray);\n\t\tfileEntry.dataWritten = true;\n\t}\n\tlet dataDescriptorArray = new Uint8Array(0);\n\tlet dataDescriptorView, dataDescriptorOffset = 0;\n\tif (dataDescriptor) {\n\t\tdataDescriptorArray = new Uint8Array(zip64 ? (dataDescriptorSignature ? 24 : 20) : (dataDescriptorSignature ? 16 : 12));\n\t\tdataDescriptorView = getDataView(dataDescriptorArray);\n\t\tif (dataDescriptorSignature) {\n\t\t\tdataDescriptorOffset = 4;\n\t\t\tsetUint32(dataDescriptorView, 0, DATA_DESCRIPTOR_RECORD_SIGNATURE);\n\t\t}\n\t}\n\tif (reader) {\n\t\tconst signature = result.signature;\n\t\tif ((!encrypted || zipCrypto) && signature !== undefined) {\n\t\t\tsetUint32(headerView, 10, signature);\n\t\t\tfileEntry.signature = signature;\n\t\t\tif (dataDescriptor) {\n\t\t\t\tsetUint32(dataDescriptorView, dataDescriptorOffset, signature);\n\t\t\t}\n\t\t}\n\t\tif (zip64) {\n\t\t\tconst rawExtraFieldZip64View = getDataView(fileEntry.rawExtraFieldZip64);\n\t\t\tsetUint16(rawExtraFieldZip64View, 0, EXTRAFIELD_TYPE_ZIP64);\n\t\t\tsetUint16(rawExtraFieldZip64View, 2, EXTRAFIELD_LENGTH_ZIP64);\n\t\t\tsetUint32(headerView, 14, MAX_32_BITS);\n\t\t\tsetBigUint64(rawExtraFieldZip64View, 12, BigInt(compressedSize));\n\t\t\tsetUint32(headerView, 18, MAX_32_BITS);\n\t\t\tsetBigUint64(rawExtraFieldZip64View, 4, BigInt(uncompressedSize));\n\t\t\tif (dataDescriptor) {\n\t\t\t\tsetBigUint64(dataDescriptorView, dataDescriptorOffset + 4, BigInt(compressedSize));\n\t\t\t\tsetBigUint64(dataDescriptorView, dataDescriptorOffset + 12, BigInt(uncompressedSize));\n\t\t\t}\n\t\t} else {\n\t\t\tsetUint32(headerView, 14, compressedSize);\n\t\t\tsetUint32(headerView, 18, uncompressedSize);\n\t\t\tif (dataDescriptor) {\n\t\t\t\tsetUint32(dataDescriptorView, dataDescriptorOffset + 4, compressedSize);\n\t\t\t\tsetUint32(dataDescriptorView, dataDescriptorOffset + 8, uncompressedSize);\n\t\t\t}\n\t\t}\n\t}\n\tif (dataDescriptor) {\n\t\tawait writer.writeUint8Array(dataDescriptorArray);\n\t}\n\tconst length = localHeaderArray.length + compressedSize + dataDescriptorArray.length;\n\tObject.assign(fileEntry, { compressedSize, lastModDate, rawLastModDate, creationDate, lastAccessDate, encrypted, length });\n\treturn fileEntry;\n}\n\nasync function closeFile(zipWriter, comment, options) {\n\tconst writer = zipWriter.writer;\n\tconst files = zipWriter.files;\n\tlet offset = 0;\n\tlet directoryDataLength = 0;\n\tlet directoryOffset = zipWriter.offset;\n\tlet filesLength = files.size;\n\tfor (const [, fileEntry] of files) {\n\t\tdirectoryDataLength += 46 +\n\t\t\tfileEntry.rawFilename.length +\n\t\t\tfileEntry.rawComment.length +\n\t\t\tfileEntry.rawExtraFieldZip64.length +\n\t\t\tfileEntry.rawExtraFieldAES.length +\n\t\t\tfileEntry.rawExtraFieldExtendedTimestamp.length +\n\t\t\tfileEntry.rawExtraFieldNTFS.length +\n\t\t\tfileEntry.rawExtraField.length;\n\t}\n\tlet zip64 = options.zip64 || zipWriter.options.zip64 || false;\n\tif (directoryOffset >= MAX_32_BITS || directoryDataLength >= MAX_32_BITS || filesLength >= MAX_16_BITS) {\n\t\tif (options.zip64 === false || zipWriter.options.zip64 === false) {\n\t\t\tthrow new Error(ERR_UNSUPPORTED_FORMAT);\n\t\t} else {\n\t\t\tzip64 = true;\n\t\t}\n\t}\n\tconst directoryArray = new Uint8Array(directoryDataLength + (zip64 ? ZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH : END_OF_CENTRAL_DIR_LENGTH));\n\tconst directoryView = getDataView(directoryArray);\n\tif (comment && comment.length) {\n\t\tif (comment.length <= MAX_16_BITS) {\n\t\t\tsetUint16(directoryView, offset + 20, comment.length);\n\t\t} else {\n\t\t\tthrow new Error(ERR_INVALID_COMMENT);\n\t\t}\n\t}\n\tfor (const [indexFileEntry, fileEntry] of Array.from(files.values()).entries()) {\n\t\tconst {\n\t\t\trawFilename,\n\t\t\trawExtraFieldZip64,\n\t\t\trawExtraFieldAES,\n\t\t\trawExtraField,\n\t\t\trawComment,\n\t\t\tversionMadeBy,\n\t\t\theaderArray,\n\t\t\tdirectory,\n\t\t\tzip64,\n\t\t\tmsDosCompatible,\n\t\t\tinternalFileAttribute,\n\t\t\texternalFileAttribute\n\t\t} = fileEntry;\n\t\tlet rawExtraFieldExtendedTimestamp;\n\t\tlet rawExtraFieldNTFS;\n\t\tif (fileEntry.extendedTimestamp) {\n\t\t\trawExtraFieldNTFS = fileEntry.rawExtraFieldNTFS;\n\t\t\trawExtraFieldExtendedTimestamp = new Uint8Array(9);\n\t\t\tconst extraFieldExtendedTimestampView = getDataView(rawExtraFieldExtendedTimestamp);\n\t\t\tsetUint16(extraFieldExtendedTimestampView, 0, EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP);\n\t\t\tsetUint16(extraFieldExtendedTimestampView, 2, rawExtraFieldExtendedTimestamp.length - 4);\n\t\t\tsetUint8(extraFieldExtendedTimestampView, 4, 0x1);\n\t\t\tsetUint32(extraFieldExtendedTimestampView, 5, Math.floor(fileEntry.lastModDate.getTime() / 1000));\n\t\t} else {\n\t\t\trawExtraFieldNTFS = rawExtraFieldExtendedTimestamp = new Uint8Array(0);\n\t\t}\n\t\tconst extraFieldLength = rawExtraFieldZip64.length + rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length + rawExtraFieldNTFS.length + rawExtraField.length;\n\t\tsetUint32(directoryView, offset, CENTRAL_FILE_HEADER_SIGNATURE);\n\t\tsetUint16(directoryView, offset + 4, versionMadeBy);\n\t\tarraySet(directoryArray, headerArray, offset + 6);\n\t\tsetUint16(directoryView, offset + 30, extraFieldLength);\n\t\tsetUint16(directoryView, offset + 32, rawComment.length);\n\t\tsetUint32(directoryView, offset + 34, internalFileAttribute);\n\t\tif (externalFileAttribute) {\n\t\t\tsetUint32(directoryView, offset + 38, externalFileAttribute);\n\t\t} else if (directory && msDosCompatible) {\n\t\t\tsetUint8(directoryView, offset + 38, FILE_ATTR_MSDOS_DIR_MASK);\n\t\t}\n\t\tif (zip64) {\n\t\t\tsetUint32(directoryView, offset + 42, MAX_32_BITS);\n\t\t} else {\n\t\t\tsetUint32(directoryView, offset + 42, fileEntry.offset);\n\t\t}\n\t\tarraySet(directoryArray, rawFilename, offset + 46);\n\t\tarraySet(directoryArray, rawExtraFieldZip64, offset + 46 + rawFilename.length);\n\t\tarraySet(directoryArray, rawExtraFieldAES, offset + 46 + rawFilename.length + rawExtraFieldZip64.length);\n\t\tarraySet(directoryArray, rawExtraFieldExtendedTimestamp, offset + 46 + rawFilename.length + rawExtraFieldZip64.length + rawExtraFieldAES.length);\n\t\tarraySet(directoryArray, rawExtraFieldNTFS, offset + 46 + rawFilename.length + rawExtraFieldZip64.length + rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length);\n\t\tarraySet(directoryArray, rawExtraField, offset + 46 + rawFilename.length + rawExtraFieldZip64.length + rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length + rawExtraFieldNTFS.length);\n\t\tarraySet(directoryArray, rawComment, offset + 46 + rawFilename.length + extraFieldLength);\n\t\toffset += 46 + rawFilename.length + extraFieldLength + rawComment.length;\n\t\tif (options.onprogress) {\n\t\t\ttry {\n\t\t\t\toptions.onprogress(indexFileEntry + 1, files.size, new Entry(fileEntry));\n\t\t\t} catch (_error) {\n\t\t\t\t// ignored\n\t\t\t}\n\t\t}\n\t}\n\tif (zip64) {\n\t\tsetUint32(directoryView, offset, ZIP64_END_OF_CENTRAL_DIR_SIGNATURE);\n\t\tsetBigUint64(directoryView, offset + 4, BigInt(44));\n\t\tsetUint16(directoryView, offset + 12, 45);\n\t\tsetUint16(directoryView, offset + 14, 45);\n\t\tsetBigUint64(directoryView, offset + 24, BigInt(filesLength));\n\t\tsetBigUint64(directoryView, offset + 32, BigInt(filesLength));\n\t\tsetBigUint64(directoryView, offset + 40, BigInt(directoryDataLength));\n\t\tsetBigUint64(directoryView, offset + 48, BigInt(directoryOffset));\n\t\tsetUint32(directoryView, offset + 56, ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE);\n\t\tsetBigUint64(directoryView, offset + 64, BigInt(directoryOffset) + BigInt(directoryDataLength));\n\t\tsetUint32(directoryView, offset + 72, ZIP64_TOTAL_NUMBER_OF_DISKS);\n\t\tfilesLength = MAX_16_BITS;\n\t\tdirectoryOffset = MAX_32_BITS;\n\t\tdirectoryDataLength = MAX_32_BITS;\n\t\toffset += 76;\n\t}\n\tsetUint32(directoryView, offset, END_OF_CENTRAL_DIR_SIGNATURE);\n\tsetUint16(directoryView, offset + 8, filesLength);\n\tsetUint16(directoryView, offset + 10, filesLength);\n\tsetUint32(directoryView, offset + 12, directoryDataLength);\n\tsetUint32(directoryView, offset + 16, directoryOffset);\n\tawait writer.writeUint8Array(directoryArray);\n\tif (comment && comment.length) {\n\t\tawait writer.writeUint8Array(comment);\n\t}\n}\n\nfunction sliceAsArrayBuffer(blob, start, end) {\n\tif (blob.arrayBuffer) {\n\t\tif (start || end) {\n\t\t\treturn blob.slice(start, end).arrayBuffer();\n\t\t} else {\n\t\t\treturn blob.arrayBuffer();\n\t\t}\n\t} else {\n\t\tconst fileReader = new FileReader();\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tfileReader.onload = event => resolve(event.target.result);\n\t\t\tfileReader.onerror = () => reject(fileReader.error);\n\t\t\tfileReader.readAsArrayBuffer(start || end ? blob.slice(start, end) : blob);\n\t\t});\n\t}\n}\n\nasync function writeBlob(writer, blob, start = 0) {\n\tconst blockSize = 512 * 1024 * 1024;\n\tawait writeSlice();\n\n\tasync function writeSlice() {\n\t\tif (start < blob.size) {\n\t\t\tconst arrayBuffer = await sliceAsArrayBuffer(blob, start, start + blockSize);\n\t\t\tawait writer.writeUint8Array(new Uint8Array(arrayBuffer));\n\t\t\tstart += blockSize;\n\t\t\tawait writeSlice();\n\t\t}\n\t}\n}\n\nfunction getTimeNTFS(date) {\n\tif (date) {\n\t\treturn ((BigInt(date.getTime()) + BigInt(11644473600000)) * BigInt(10000));\n\t}\n}\n\nfunction getOptionValue(zipWriter, options, name) {\n\treturn options[name] === undefined ? zipWriter.options[name] : options[name];\n}\n\nfunction getMaximumCompressedSize(uncompressedSize) {\n\treturn uncompressedSize + (5 * (Math.floor(uncompressedSize / 16383) + 1));\n}\n\nfunction setUint8(view, offset, value) {\n\tview.setUint8(offset, value);\n}\n\nfunction setUint16(view, offset, value) {\n\tview.setUint16(offset, value, true);\n}\n\nfunction setUint32(view, offset, value) {\n\tview.setUint32(offset, value, true);\n}\n\nfunction setBigUint64(view, offset, value) {\n\tview.setBigUint64(offset, value, true);\n}\n\nfunction arraySet(array, typedArray, offset) {\n\tarray.set(typedArray, offset);\n}\n\nfunction getDataView(array) {\n\treturn new DataView(array.buffer);\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport Deflate from \"./core/codecs/deflate.js\";\nimport Inflate from \"./core/codecs/inflate.js\";\nimport { configure } from \"./core/configuration.js\";\nimport { getMimeType } from \"./core/util/default-mime-type.js\";\nimport { terminateWorkers } from \"./core/codecs/codec-pool.js\";\n\nconfigure({ Deflate, Inflate });\n\nexport { ERR_ABORT } from \"./core/engine.js\";\nexport * from \"./core/io.js\";\nexport * from \"./core/zip-reader.js\";\nexport * from \"./core/zip-writer.js\";\nexport {\n\tconfigure,\n\tgetMimeType,\n\tterminateWorkers\n};", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * If element is a string, look up the element in the DOM by ID.  Otherwise return element.\n *\n * @private\n *\n * @exception {DeveloperError} Element with id \"id\" does not exist in the document.\n */\nfunction getElement(element) {\n  if (typeof element === \"string\") {\n    const foundElement = document.getElementById(element);\n\n    //>>includeStart('debug', pragmas.debug);\n    if (foundElement === null) {\n      throw new DeveloperError(\n        `Element with id \"${element}\" does not exist in the document.`\n      );\n    }\n    //>>includeEnd('debug');\n\n    element = foundElement;\n  }\n  return element;\n}\nexport default getElement;\n", "/**\n * @alias KmlLookAt\n * @constructor\n *\n * @param {Cartesian3} position camera position\n * @param {HeadingPitchRange} headingPitchRange camera orientation\n */\nfunction KmlLookAt(position, headingPitchRange) {\n  this.position = position;\n  this.headingPitchRange = headingPitchRange;\n}\nexport default KmlLookAt;\n", "import defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\n/**\n * Describes a KmlTour, which uses KmlTourFlyTo, and KmlTourWait to\n * guide the camera to a specified destinations on given time intervals.\n *\n * @alias KmlTour\n * @constructor\n *\n * @param {string} name name parsed from KML\n * @param {string} id id parsed from KML\n * @param {Array} playlist array with KmlTourFlyTos and KmlTourWaits\n *\n * @see KmlTourFlyTo\n * @see KmlTourWait\n *\n * @demo {@link https://sandcastle.cesium.com/?src=KML%20Tours.html|KML Tours}\n */\nfunction KmlTour(name, id) {\n  /**\n   * Id of kml gx:Tour entry\n   * @type {string}\n   */\n  this.id = id;\n  /**\n   * Tour name\n   * @type {string}\n   */\n  this.name = name;\n  /**\n   * Index of current entry from playlist\n   * @type {number}\n   */\n  this.playlistIndex = 0;\n  /**\n   * Array of playlist entries\n   * @type {Array}\n   */\n  this.playlist = [];\n  /**\n   * Event will be called when tour starts to play,\n   * before any playlist entry starts to play.\n   * @type Event\n   */\n  this.tourStart = new Event();\n  /**\n   * Event will be called when all playlist entries are\n   * played, or tour playback being canceled.\n   *\n   * If tour playback was terminated, event callback will\n   * be called with terminated=true parameter.\n   * @type Event\n   */\n  this.tourEnd = new Event();\n  /**\n   * Event will be called when entry from playlist starts to play.\n   *\n   * Event callback will be called with curent entry as first parameter.\n   * @type Event\n   */\n  this.entryStart = new Event();\n  /**\n   * Event will be called when entry from playlist ends to play.\n   *\n   * Event callback will be called with following parameters:\n   * 1. entry - entry\n   * 2. terminated - true if playback was terminated by calling {@link KmlTour#stop}\n   * @type Event\n   */\n  this.entryEnd = new Event();\n\n  this._activeEntries = [];\n}\n\n/**\n * Add entry to this tour playlist.\n *\n * @param {KmlTourFlyTo|KmlTourWait} entry an entry to add to the playlist.\n */\nKmlTour.prototype.addPlaylistEntry = function (entry) {\n  this.playlist.push(entry);\n};\n\n/**\n * Play this tour.\n *\n * @param {CesiumWidget} widget The widget.\n * @param {object} [cameraOptions] these options will be merged with {@link Camera#flyTo}\n * options for FlyTo playlist entries.\n */\nKmlTour.prototype.play = function (widget, cameraOptions) {\n  this.tourStart.raiseEvent();\n\n  const tour = this;\n  playEntry.call(this, widget, cameraOptions, function (terminated) {\n    tour.playlistIndex = 0;\n    // Stop nonblocking entries\n    if (!terminated) {\n      cancelAllEntries(tour._activeEntries);\n    }\n    tour.tourEnd.raiseEvent(terminated);\n  });\n};\n\n/**\n * Stop curently playing tour.\n */\nKmlTour.prototype.stop = function () {\n  cancelAllEntries(this._activeEntries);\n};\n\n// Stop all activeEntries.\nfunction cancelAllEntries(activeEntries) {\n  for (\n    let entry = activeEntries.pop();\n    entry !== undefined;\n    entry = activeEntries.pop()\n  ) {\n    entry.stop();\n  }\n}\n\n// Play playlist entry.\n// This function is called recursevly with playNext and iterates over all entries from playlist.\nfunction playEntry(widget, cameraOptions, allDone) {\n  const entry = this.playlist[this.playlistIndex];\n  if (entry) {\n    const _playNext = playNext.bind(this, widget, cameraOptions, allDone);\n    this._activeEntries.push(entry);\n    this.entryStart.raiseEvent(entry);\n    if (entry.blocking) {\n      entry.play(_playNext, widget.scene.camera, cameraOptions);\n    } else {\n      const tour = this;\n      entry.play(function () {\n        tour.entryEnd.raiseEvent(entry);\n        const indx = tour._activeEntries.indexOf(entry);\n        if (indx >= 0) {\n          tour._activeEntries.splice(indx, 1);\n        }\n      });\n      _playNext(widget, cameraOptions, allDone);\n    }\n  } else if (defined(allDone)) {\n    allDone(false);\n  }\n}\n\n// Increment playlistIndex and call playEntry if terminated isn't true.\nfunction playNext(widget, cameraOptions, allDone, terminated) {\n  const entry = this.playlist[this.playlistIndex];\n  this.entryEnd.raiseEvent(entry, terminated);\n\n  if (terminated) {\n    allDone(terminated);\n  } else {\n    const indx = this._activeEntries.indexOf(entry);\n    if (indx >= 0) {\n      this._activeEntries.splice(indx, 1);\n    }\n    this.playlistIndex++;\n    playEntry.call(this, widget, cameraOptions, allDone);\n  }\n}\nexport default KmlTour;\n", "/**\n * The Ease class provides a collection of easing functions for use with tween.js.\n */\nvar Easing = Object.freeze({\n    Linear: Object.freeze({\n        None: function (amount) {\n            return amount;\n        },\n        In: function (amount) {\n            return this.None(amount);\n        },\n        Out: function (amount) {\n            return this.None(amount);\n        },\n        InOut: function (amount) {\n            return this.None(amount);\n        },\n    }),\n    Quadratic: Object.freeze({\n        In: function (amount) {\n            return amount * amount;\n        },\n        Out: function (amount) {\n            return amount * (2 - amount);\n        },\n        InOut: function (amount) {\n            if ((amount *= 2) < 1) {\n                return 0.5 * amount * amount;\n            }\n            return -0.5 * (--amount * (amount - 2) - 1);\n        },\n    }),\n    Cubic: Object.freeze({\n        In: function (amount) {\n            return amount * amount * amount;\n        },\n        Out: function (amount) {\n            return --amount * amount * amount + 1;\n        },\n        InOut: function (amount) {\n            if ((amount *= 2) < 1) {\n                return 0.5 * amount * amount * amount;\n            }\n            return 0.5 * ((amount -= 2) * amount * amount + 2);\n        },\n    }),\n    Quartic: Object.freeze({\n        In: function (amount) {\n            return amount * amount * amount * amount;\n        },\n        Out: function (amount) {\n            return 1 - --amount * amount * amount * amount;\n        },\n        InOut: function (amount) {\n            if ((amount *= 2) < 1) {\n                return 0.5 * amount * amount * amount * amount;\n            }\n            return -0.5 * ((amount -= 2) * amount * amount * amount - 2);\n        },\n    }),\n    Quintic: Object.freeze({\n        In: function (amount) {\n            return amount * amount * amount * amount * amount;\n        },\n        Out: function (amount) {\n            return --amount * amount * amount * amount * amount + 1;\n        },\n        InOut: function (amount) {\n            if ((amount *= 2) < 1) {\n                return 0.5 * amount * amount * amount * amount * amount;\n            }\n            return 0.5 * ((amount -= 2) * amount * amount * amount * amount + 2);\n        },\n    }),\n    Sinusoidal: Object.freeze({\n        In: function (amount) {\n            return 1 - Math.sin(((1.0 - amount) * Math.PI) / 2);\n        },\n        Out: function (amount) {\n            return Math.sin((amount * Math.PI) / 2);\n        },\n        InOut: function (amount) {\n            return 0.5 * (1 - Math.sin(Math.PI * (0.5 - amount)));\n        },\n    }),\n    Exponential: Object.freeze({\n        In: function (amount) {\n            return amount === 0 ? 0 : Math.pow(1024, amount - 1);\n        },\n        Out: function (amount) {\n            return amount === 1 ? 1 : 1 - Math.pow(2, -10 * amount);\n        },\n        InOut: function (amount) {\n            if (amount === 0) {\n                return 0;\n            }\n            if (amount === 1) {\n                return 1;\n            }\n            if ((amount *= 2) < 1) {\n                return 0.5 * Math.pow(1024, amount - 1);\n            }\n            return 0.5 * (-Math.pow(2, -10 * (amount - 1)) + 2);\n        },\n    }),\n    Circular: Object.freeze({\n        In: function (amount) {\n            return 1 - Math.sqrt(1 - amount * amount);\n        },\n        Out: function (amount) {\n            return Math.sqrt(1 - --amount * amount);\n        },\n        InOut: function (amount) {\n            if ((amount *= 2) < 1) {\n                return -0.5 * (Math.sqrt(1 - amount * amount) - 1);\n            }\n            return 0.5 * (Math.sqrt(1 - (amount -= 2) * amount) + 1);\n        },\n    }),\n    Elastic: Object.freeze({\n        In: function (amount) {\n            if (amount === 0) {\n                return 0;\n            }\n            if (amount === 1) {\n                return 1;\n            }\n            return -Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI);\n        },\n        Out: function (amount) {\n            if (amount === 0) {\n                return 0;\n            }\n            if (amount === 1) {\n                return 1;\n            }\n            return Math.pow(2, -10 * amount) * Math.sin((amount - 0.1) * 5 * Math.PI) + 1;\n        },\n        InOut: function (amount) {\n            if (amount === 0) {\n                return 0;\n            }\n            if (amount === 1) {\n                return 1;\n            }\n            amount *= 2;\n            if (amount < 1) {\n                return -0.5 * Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI);\n            }\n            return 0.5 * Math.pow(2, -10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI) + 1;\n        },\n    }),\n    Back: Object.freeze({\n        In: function (amount) {\n            var s = 1.70158;\n            return amount === 1 ? 1 : amount * amount * ((s + 1) * amount - s);\n        },\n        Out: function (amount) {\n            var s = 1.70158;\n            return amount === 0 ? 0 : --amount * amount * ((s + 1) * amount + s) + 1;\n        },\n        InOut: function (amount) {\n            var s = 1.70158 * 1.525;\n            if ((amount *= 2) < 1) {\n                return 0.5 * (amount * amount * ((s + 1) * amount - s));\n            }\n            return 0.5 * ((amount -= 2) * amount * ((s + 1) * amount + s) + 2);\n        },\n    }),\n    Bounce: Object.freeze({\n        In: function (amount) {\n            return 1 - Easing.Bounce.Out(1 - amount);\n        },\n        Out: function (amount) {\n            if (amount < 1 / 2.75) {\n                return 7.5625 * amount * amount;\n            }\n            else if (amount < 2 / 2.75) {\n                return 7.5625 * (amount -= 1.5 / 2.75) * amount + 0.75;\n            }\n            else if (amount < 2.5 / 2.75) {\n                return 7.5625 * (amount -= 2.25 / 2.75) * amount + 0.9375;\n            }\n            else {\n                return 7.5625 * (amount -= 2.625 / 2.75) * amount + 0.984375;\n            }\n        },\n        InOut: function (amount) {\n            if (amount < 0.5) {\n                return Easing.Bounce.In(amount * 2) * 0.5;\n            }\n            return Easing.Bounce.Out(amount * 2 - 1) * 0.5 + 0.5;\n        },\n    }),\n    generatePow: function (power) {\n        if (power === void 0) { power = 4; }\n        power = power < Number.EPSILON ? Number.EPSILON : power;\n        power = power > 10000 ? 10000 : power;\n        return {\n            In: function (amount) {\n                return Math.pow(amount, power);\n            },\n            Out: function (amount) {\n                return 1 - Math.pow((1 - amount), power);\n            },\n            InOut: function (amount) {\n                if (amount < 0.5) {\n                    return Math.pow((amount * 2), power) / 2;\n                }\n                return (1 - Math.pow((2 - amount * 2), power)) / 2 + 0.5;\n            },\n        };\n    },\n});\n\nvar now = function () { return performance.now(); };\n\n/**\n * Controlling groups of tweens\n *\n * Using the TWEEN singleton to manage your tweens can cause issues in large apps with many components.\n * In these cases, you may want to create your own smaller groups of tween\n */\nvar Group = /** @class */ (function () {\n    function Group() {\n        this._tweens = {};\n        this._tweensAddedDuringUpdate = {};\n    }\n    Group.prototype.getAll = function () {\n        var _this = this;\n        return Object.keys(this._tweens).map(function (tweenId) {\n            return _this._tweens[tweenId];\n        });\n    };\n    Group.prototype.removeAll = function () {\n        this._tweens = {};\n    };\n    Group.prototype.add = function (tween) {\n        this._tweens[tween.getId()] = tween;\n        this._tweensAddedDuringUpdate[tween.getId()] = tween;\n    };\n    Group.prototype.remove = function (tween) {\n        delete this._tweens[tween.getId()];\n        delete this._tweensAddedDuringUpdate[tween.getId()];\n    };\n    Group.prototype.update = function (time, preserve) {\n        if (time === void 0) { time = now(); }\n        if (preserve === void 0) { preserve = false; }\n        var tweenIds = Object.keys(this._tweens);\n        if (tweenIds.length === 0) {\n            return false;\n        }\n        // Tweens are updated in \"batches\". If you add a new tween during an\n        // update, then the new tween will be updated in the next batch.\n        // If you remove a tween during an update, it may or may not be updated.\n        // However, if the removed tween was added during the current batch,\n        // then it will not be updated.\n        while (tweenIds.length > 0) {\n            this._tweensAddedDuringUpdate = {};\n            for (var i = 0; i < tweenIds.length; i++) {\n                var tween = this._tweens[tweenIds[i]];\n                var autoStart = !preserve;\n                if (tween && tween.update(time, autoStart) === false && !preserve) {\n                    delete this._tweens[tweenIds[i]];\n                }\n            }\n            tweenIds = Object.keys(this._tweensAddedDuringUpdate);\n        }\n        return true;\n    };\n    return Group;\n}());\n\n/**\n *\n */\nvar Interpolation = {\n    Linear: function (v, k) {\n        var m = v.length - 1;\n        var f = m * k;\n        var i = Math.floor(f);\n        var fn = Interpolation.Utils.Linear;\n        if (k < 0) {\n            return fn(v[0], v[1], f);\n        }\n        if (k > 1) {\n            return fn(v[m], v[m - 1], m - f);\n        }\n        return fn(v[i], v[i + 1 > m ? m : i + 1], f - i);\n    },\n    Bezier: function (v, k) {\n        var b = 0;\n        var n = v.length - 1;\n        var pw = Math.pow;\n        var bn = Interpolation.Utils.Bernstein;\n        for (var i = 0; i <= n; i++) {\n            b += pw(1 - k, n - i) * pw(k, i) * v[i] * bn(n, i);\n        }\n        return b;\n    },\n    CatmullRom: function (v, k) {\n        var m = v.length - 1;\n        var f = m * k;\n        var i = Math.floor(f);\n        var fn = Interpolation.Utils.CatmullRom;\n        if (v[0] === v[m]) {\n            if (k < 0) {\n                i = Math.floor((f = m * (1 + k)));\n            }\n            return fn(v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m], f - i);\n        }\n        else {\n            if (k < 0) {\n                return v[0] - (fn(v[0], v[0], v[1], v[1], -f) - v[0]);\n            }\n            if (k > 1) {\n                return v[m] - (fn(v[m], v[m], v[m - 1], v[m - 1], f - m) - v[m]);\n            }\n            return fn(v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2], f - i);\n        }\n    },\n    Utils: {\n        Linear: function (p0, p1, t) {\n            return (p1 - p0) * t + p0;\n        },\n        Bernstein: function (n, i) {\n            var fc = Interpolation.Utils.Factorial;\n            return fc(n) / fc(i) / fc(n - i);\n        },\n        Factorial: (function () {\n            var a = [1];\n            return function (n) {\n                var s = 1;\n                if (a[n]) {\n                    return a[n];\n                }\n                for (var i = n; i > 1; i--) {\n                    s *= i;\n                }\n                a[n] = s;\n                return s;\n            };\n        })(),\n        CatmullRom: function (p0, p1, p2, p3, t) {\n            var v0 = (p2 - p0) * 0.5;\n            var v1 = (p3 - p1) * 0.5;\n            var t2 = t * t;\n            var t3 = t * t2;\n            return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;\n        },\n    },\n};\n\n/**\n * Utils\n */\nvar Sequence = /** @class */ (function () {\n    function Sequence() {\n    }\n    Sequence.nextId = function () {\n        return Sequence._nextId++;\n    };\n    Sequence._nextId = 0;\n    return Sequence;\n}());\n\nvar mainGroup = new Group();\n\n/**\n * Tween.js - Licensed under the MIT license\n * https://github.com/tweenjs/tween.js\n * ----------------------------------------------\n *\n * See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.\n * Thank you all, you're awesome!\n */\nvar Tween = /** @class */ (function () {\n    function Tween(_object, _group) {\n        if (_group === void 0) { _group = mainGroup; }\n        this._object = _object;\n        this._group = _group;\n        this._isPaused = false;\n        this._pauseStart = 0;\n        this._valuesStart = {};\n        this._valuesEnd = {};\n        this._valuesStartRepeat = {};\n        this._duration = 1000;\n        this._isDynamic = false;\n        this._initialRepeat = 0;\n        this._repeat = 0;\n        this._yoyo = false;\n        this._isPlaying = false;\n        this._reversed = false;\n        this._delayTime = 0;\n        this._startTime = 0;\n        this._easingFunction = Easing.Linear.None;\n        this._interpolationFunction = Interpolation.Linear;\n        // eslint-disable-next-line\n        this._chainedTweens = [];\n        this._onStartCallbackFired = false;\n        this._onEveryStartCallbackFired = false;\n        this._id = Sequence.nextId();\n        this._isChainStopped = false;\n        this._propertiesAreSetUp = false;\n        this._goToEnd = false;\n    }\n    Tween.prototype.getId = function () {\n        return this._id;\n    };\n    Tween.prototype.isPlaying = function () {\n        return this._isPlaying;\n    };\n    Tween.prototype.isPaused = function () {\n        return this._isPaused;\n    };\n    Tween.prototype.to = function (target, duration) {\n        if (duration === void 0) { duration = 1000; }\n        if (this._isPlaying)\n            throw new Error('Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.');\n        this._valuesEnd = target;\n        this._propertiesAreSetUp = false;\n        this._duration = duration;\n        return this;\n    };\n    Tween.prototype.duration = function (duration) {\n        if (duration === void 0) { duration = 1000; }\n        this._duration = duration;\n        return this;\n    };\n    Tween.prototype.dynamic = function (dynamic) {\n        if (dynamic === void 0) { dynamic = false; }\n        this._isDynamic = dynamic;\n        return this;\n    };\n    Tween.prototype.start = function (time, overrideStartingValues) {\n        if (time === void 0) { time = now(); }\n        if (overrideStartingValues === void 0) { overrideStartingValues = false; }\n        if (this._isPlaying) {\n            return this;\n        }\n        // eslint-disable-next-line\n        this._group && this._group.add(this);\n        this._repeat = this._initialRepeat;\n        if (this._reversed) {\n            // If we were reversed (f.e. using the yoyo feature) then we need to\n            // flip the tween direction back to forward.\n            this._reversed = false;\n            for (var property in this._valuesStartRepeat) {\n                this._swapEndStartRepeatValues(property);\n                this._valuesStart[property] = this._valuesStartRepeat[property];\n            }\n        }\n        this._isPlaying = true;\n        this._isPaused = false;\n        this._onStartCallbackFired = false;\n        this._onEveryStartCallbackFired = false;\n        this._isChainStopped = false;\n        this._startTime = time;\n        this._startTime += this._delayTime;\n        if (!this._propertiesAreSetUp || overrideStartingValues) {\n            this._propertiesAreSetUp = true;\n            // If dynamic is not enabled, clone the end values instead of using the passed-in end values.\n            if (!this._isDynamic) {\n                var tmp = {};\n                for (var prop in this._valuesEnd)\n                    tmp[prop] = this._valuesEnd[prop];\n                this._valuesEnd = tmp;\n            }\n            this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat, overrideStartingValues);\n        }\n        return this;\n    };\n    Tween.prototype.startFromCurrentValues = function (time) {\n        return this.start(time, true);\n    };\n    Tween.prototype._setupProperties = function (_object, _valuesStart, _valuesEnd, _valuesStartRepeat, overrideStartingValues) {\n        for (var property in _valuesEnd) {\n            var startValue = _object[property];\n            var startValueIsArray = Array.isArray(startValue);\n            var propType = startValueIsArray ? 'array' : typeof startValue;\n            var isInterpolationList = !startValueIsArray && Array.isArray(_valuesEnd[property]);\n            // If `to()` specifies a property that doesn't exist in the source object,\n            // we should not set that property in the object\n            if (propType === 'undefined' || propType === 'function') {\n                continue;\n            }\n            // Check if an Array was provided as property value\n            if (isInterpolationList) {\n                var endValues = _valuesEnd[property];\n                if (endValues.length === 0) {\n                    continue;\n                }\n                // Handle an array of relative values.\n                // Creates a local copy of the Array with the start value at the front\n                var temp = [startValue];\n                for (var i = 0, l = endValues.length; i < l; i += 1) {\n                    var value = this._handleRelativeValue(startValue, endValues[i]);\n                    if (isNaN(value)) {\n                        isInterpolationList = false;\n                        console.warn('Found invalid interpolation list. Skipping.');\n                        break;\n                    }\n                    temp.push(value);\n                }\n                if (isInterpolationList) {\n                    // if (_valuesStart[property] === undefined) { // handle end values only the first time. NOT NEEDED? setupProperties is now guarded by _propertiesAreSetUp.\n                    _valuesEnd[property] = temp;\n                    // }\n                }\n            }\n            // handle the deepness of the values\n            if ((propType === 'object' || startValueIsArray) && startValue && !isInterpolationList) {\n                _valuesStart[property] = startValueIsArray ? [] : {};\n                var nestedObject = startValue;\n                for (var prop in nestedObject) {\n                    _valuesStart[property][prop] = nestedObject[prop];\n                }\n                // TODO? repeat nested values? And yoyo? And array values?\n                _valuesStartRepeat[property] = startValueIsArray ? [] : {};\n                var endValues = _valuesEnd[property];\n                // If dynamic is not enabled, clone the end values instead of using the passed-in end values.\n                if (!this._isDynamic) {\n                    var tmp = {};\n                    for (var prop in endValues)\n                        tmp[prop] = endValues[prop];\n                    _valuesEnd[property] = endValues = tmp;\n                }\n                this._setupProperties(nestedObject, _valuesStart[property], endValues, _valuesStartRepeat[property], overrideStartingValues);\n            }\n            else {\n                // Save the starting value, but only once unless override is requested.\n                if (typeof _valuesStart[property] === 'undefined' || overrideStartingValues) {\n                    _valuesStart[property] = startValue;\n                }\n                if (!startValueIsArray) {\n                    // eslint-disable-next-line\n                    // @ts-ignore FIXME?\n                    _valuesStart[property] *= 1.0; // Ensures we're using numbers, not strings\n                }\n                if (isInterpolationList) {\n                    // eslint-disable-next-line\n                    // @ts-ignore FIXME?\n                    _valuesStartRepeat[property] = _valuesEnd[property].slice().reverse();\n                }\n                else {\n                    _valuesStartRepeat[property] = _valuesStart[property] || 0;\n                }\n            }\n        }\n    };\n    Tween.prototype.stop = function () {\n        if (!this._isChainStopped) {\n            this._isChainStopped = true;\n            this.stopChainedTweens();\n        }\n        if (!this._isPlaying) {\n            return this;\n        }\n        // eslint-disable-next-line\n        this._group && this._group.remove(this);\n        this._isPlaying = false;\n        this._isPaused = false;\n        if (this._onStopCallback) {\n            this._onStopCallback(this._object);\n        }\n        return this;\n    };\n    Tween.prototype.end = function () {\n        this._goToEnd = true;\n        this.update(Infinity);\n        return this;\n    };\n    Tween.prototype.pause = function (time) {\n        if (time === void 0) { time = now(); }\n        if (this._isPaused || !this._isPlaying) {\n            return this;\n        }\n        this._isPaused = true;\n        this._pauseStart = time;\n        // eslint-disable-next-line\n        this._group && this._group.remove(this);\n        return this;\n    };\n    Tween.prototype.resume = function (time) {\n        if (time === void 0) { time = now(); }\n        if (!this._isPaused || !this._isPlaying) {\n            return this;\n        }\n        this._isPaused = false;\n        this._startTime += time - this._pauseStart;\n        this._pauseStart = 0;\n        // eslint-disable-next-line\n        this._group && this._group.add(this);\n        return this;\n    };\n    Tween.prototype.stopChainedTweens = function () {\n        for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {\n            this._chainedTweens[i].stop();\n        }\n        return this;\n    };\n    Tween.prototype.group = function (group) {\n        if (group === void 0) { group = mainGroup; }\n        this._group = group;\n        return this;\n    };\n    Tween.prototype.delay = function (amount) {\n        if (amount === void 0) { amount = 0; }\n        this._delayTime = amount;\n        return this;\n    };\n    Tween.prototype.repeat = function (times) {\n        if (times === void 0) { times = 0; }\n        this._initialRepeat = times;\n        this._repeat = times;\n        return this;\n    };\n    Tween.prototype.repeatDelay = function (amount) {\n        this._repeatDelayTime = amount;\n        return this;\n    };\n    Tween.prototype.yoyo = function (yoyo) {\n        if (yoyo === void 0) { yoyo = false; }\n        this._yoyo = yoyo;\n        return this;\n    };\n    Tween.prototype.easing = function (easingFunction) {\n        if (easingFunction === void 0) { easingFunction = Easing.Linear.None; }\n        this._easingFunction = easingFunction;\n        return this;\n    };\n    Tween.prototype.interpolation = function (interpolationFunction) {\n        if (interpolationFunction === void 0) { interpolationFunction = Interpolation.Linear; }\n        this._interpolationFunction = interpolationFunction;\n        return this;\n    };\n    // eslint-disable-next-line\n    Tween.prototype.chain = function () {\n        var tweens = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            tweens[_i] = arguments[_i];\n        }\n        this._chainedTweens = tweens;\n        return this;\n    };\n    Tween.prototype.onStart = function (callback) {\n        this._onStartCallback = callback;\n        return this;\n    };\n    Tween.prototype.onEveryStart = function (callback) {\n        this._onEveryStartCallback = callback;\n        return this;\n    };\n    Tween.prototype.onUpdate = function (callback) {\n        this._onUpdateCallback = callback;\n        return this;\n    };\n    Tween.prototype.onRepeat = function (callback) {\n        this._onRepeatCallback = callback;\n        return this;\n    };\n    Tween.prototype.onComplete = function (callback) {\n        this._onCompleteCallback = callback;\n        return this;\n    };\n    Tween.prototype.onStop = function (callback) {\n        this._onStopCallback = callback;\n        return this;\n    };\n    /**\n     * @returns true if the tween is still playing after the update, false\n     * otherwise (calling update on a paused tween still returns true because\n     * it is still playing, just paused).\n     */\n    Tween.prototype.update = function (time, autoStart) {\n        if (time === void 0) { time = now(); }\n        if (autoStart === void 0) { autoStart = true; }\n        if (this._isPaused)\n            return true;\n        var property;\n        var elapsed;\n        var endTime = this._startTime + this._duration;\n        if (!this._goToEnd && !this._isPlaying) {\n            if (time > endTime)\n                return false;\n            if (autoStart)\n                this.start(time, true);\n        }\n        this._goToEnd = false;\n        if (time < this._startTime) {\n            return true;\n        }\n        if (this._onStartCallbackFired === false) {\n            if (this._onStartCallback) {\n                this._onStartCallback(this._object);\n            }\n            this._onStartCallbackFired = true;\n        }\n        if (this._onEveryStartCallbackFired === false) {\n            if (this._onEveryStartCallback) {\n                this._onEveryStartCallback(this._object);\n            }\n            this._onEveryStartCallbackFired = true;\n        }\n        elapsed = (time - this._startTime) / this._duration;\n        elapsed = this._duration === 0 || elapsed > 1 ? 1 : elapsed;\n        var value = this._easingFunction(elapsed);\n        // properties transformations\n        this._updateProperties(this._object, this._valuesStart, this._valuesEnd, value);\n        if (this._onUpdateCallback) {\n            this._onUpdateCallback(this._object, elapsed);\n        }\n        if (elapsed === 1) {\n            if (this._repeat > 0) {\n                if (isFinite(this._repeat)) {\n                    this._repeat--;\n                }\n                // Reassign starting values, restart by making startTime = now\n                for (property in this._valuesStartRepeat) {\n                    if (!this._yoyo && typeof this._valuesEnd[property] === 'string') {\n                        this._valuesStartRepeat[property] =\n                            // eslint-disable-next-line\n                            // @ts-ignore FIXME?\n                            this._valuesStartRepeat[property] + parseFloat(this._valuesEnd[property]);\n                    }\n                    if (this._yoyo) {\n                        this._swapEndStartRepeatValues(property);\n                    }\n                    this._valuesStart[property] = this._valuesStartRepeat[property];\n                }\n                if (this._yoyo) {\n                    this._reversed = !this._reversed;\n                }\n                if (this._repeatDelayTime !== undefined) {\n                    this._startTime = time + this._repeatDelayTime;\n                }\n                else {\n                    this._startTime = time + this._delayTime;\n                }\n                if (this._onRepeatCallback) {\n                    this._onRepeatCallback(this._object);\n                }\n                this._onEveryStartCallbackFired = false;\n                return true;\n            }\n            else {\n                if (this._onCompleteCallback) {\n                    this._onCompleteCallback(this._object);\n                }\n                for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {\n                    // Make the chained tweens start exactly at the time they should,\n                    // even if the `update()` method was called way past the duration of the tween\n                    this._chainedTweens[i].start(this._startTime + this._duration, false);\n                }\n                this._isPlaying = false;\n                return false;\n            }\n        }\n        return true;\n    };\n    Tween.prototype._updateProperties = function (_object, _valuesStart, _valuesEnd, value) {\n        for (var property in _valuesEnd) {\n            // Don't update properties that do not exist in the source object\n            if (_valuesStart[property] === undefined) {\n                continue;\n            }\n            var start = _valuesStart[property] || 0;\n            var end = _valuesEnd[property];\n            var startIsArray = Array.isArray(_object[property]);\n            var endIsArray = Array.isArray(end);\n            var isInterpolationList = !startIsArray && endIsArray;\n            if (isInterpolationList) {\n                _object[property] = this._interpolationFunction(end, value);\n            }\n            else if (typeof end === 'object' && end) {\n                // eslint-disable-next-line\n                // @ts-ignore FIXME?\n                this._updateProperties(_object[property], start, end, value);\n            }\n            else {\n                // Parses relative end values with start as base (e.g.: +10, -3)\n                end = this._handleRelativeValue(start, end);\n                // Protect against non numeric properties.\n                if (typeof end === 'number') {\n                    // eslint-disable-next-line\n                    // @ts-ignore FIXME?\n                    _object[property] = start + (end - start) * value;\n                }\n            }\n        }\n    };\n    Tween.prototype._handleRelativeValue = function (start, end) {\n        if (typeof end !== 'string') {\n            return end;\n        }\n        if (end.charAt(0) === '+' || end.charAt(0) === '-') {\n            return start + parseFloat(end);\n        }\n        return parseFloat(end);\n    };\n    Tween.prototype._swapEndStartRepeatValues = function (property) {\n        var tmp = this._valuesStartRepeat[property];\n        var endValue = this._valuesEnd[property];\n        if (typeof endValue === 'string') {\n            this._valuesStartRepeat[property] = this._valuesStartRepeat[property] + parseFloat(endValue);\n        }\n        else {\n            this._valuesStartRepeat[property] = this._valuesEnd[property];\n        }\n        this._valuesEnd[property] = tmp;\n    };\n    return Tween;\n}());\n\nvar VERSION = '21.0.0';\n\n/**\n * Tween.js - Licensed under the MIT license\n * https://github.com/tweenjs/tween.js\n * ----------------------------------------------\n *\n * See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.\n * Thank you all, you're awesome!\n */\nvar nextId = Sequence.nextId;\n/**\n * Controlling groups of tweens\n *\n * Using the TWEEN singleton to manage your tweens can cause issues in large apps with many components.\n * In these cases, you may want to create your own smaller groups of tweens.\n */\nvar TWEEN = mainGroup;\n// This is the best way to export things in a way that's compatible with both ES\n// Modules and CommonJS, without build hacks, and so as not to break the\n// existing API.\n// https://github.com/rollup/rollup/issues/1961#issuecomment-423037881\nvar getAll = TWEEN.getAll.bind(TWEEN);\nvar removeAll = TWEEN.removeAll.bind(TWEEN);\nvar add = TWEEN.add.bind(TWEEN);\nvar remove = TWEEN.remove.bind(TWEEN);\nvar update = TWEEN.update.bind(TWEEN);\nvar exports = {\n    Easing: Easing,\n    Group: Group,\n    Interpolation: Interpolation,\n    now: now,\n    Sequence: Sequence,\n    nextId: nextId,\n    Tween: Tween,\n    VERSION: VERSION,\n    getAll: getAll,\n    removeAll: removeAll,\n    add: add,\n    remove: remove,\n    update: update,\n};\n\nexport { Easing, Group, Interpolation, Sequence, Tween, VERSION, add, exports as default, getAll, nextId, now, remove, removeAll, update };\n", "import { Easing } from \"@tweenjs/tween.js\";\n\n/**\n * Easing functions for use with TweenCollection.  These function are from\n * {@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner.  See the\n * {@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}.\n *\n * @namespace\n */\nconst EasingFunction = {\n  /**\n   * Linear easing.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  LINEAR_NONE: Easing.Linear.None,\n\n  /**\n   * Quadratic in.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  QUADRATIC_IN: Easing.Quadratic.In,\n  /**\n   * Quadratic out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  QUADRATIC_OUT: Easing.Quadratic.Out,\n  /**\n   * Quadratic in then out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  QUADRATIC_IN_OUT: Easing.Quadratic.InOut,\n\n  /**\n   * Cubic in.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  CUBIC_IN: Easing.Cubic.In,\n  /**\n   * Cubic out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  CUBIC_OUT: Easing.Cubic.Out,\n  /**\n   * Cubic in then out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  CUBIC_IN_OUT: Easing.Cubic.InOut,\n\n  /**\n   * Quartic in.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  QUARTIC_IN: Easing.Quartic.In,\n  /**\n   * Quartic out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  QUARTIC_OUT: Easing.Quartic.Out,\n  /**\n   * Quartic in then out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  QUARTIC_IN_OUT: Easing.Quartic.InOut,\n\n  /**\n   * Quintic in.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  QUINTIC_IN: Easing.Quintic.In,\n  /**\n   * Quintic out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  QUINTIC_OUT: Easing.Quintic.Out,\n  /**\n   * Quintic in then out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  QUINTIC_IN_OUT: Easing.Quintic.InOut,\n\n  /**\n   * Sinusoidal in.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  SINUSOIDAL_IN: Easing.Sinusoidal.In,\n  /**\n   * Sinusoidal out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  SINUSOIDAL_OUT: Easing.Sinusoidal.Out,\n  /**\n   * Sinusoidal in then out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  SINUSOIDAL_IN_OUT: Easing.Sinusoidal.InOut,\n\n  /**\n   * Exponential in.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  EXPONENTIAL_IN: Easing.Exponential.In,\n  /**\n   * Exponential out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  EXPONENTIAL_OUT: Easing.Exponential.Out,\n  /**\n   * Exponential in then out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  EXPONENTIAL_IN_OUT: Easing.Exponential.InOut,\n\n  /**\n   * Circular in.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  CIRCULAR_IN: Easing.Circular.In,\n  /**\n   * Circular out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  CIRCULAR_OUT: Easing.Circular.Out,\n  /**\n   * Circular in then out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  CIRCULAR_IN_OUT: Easing.Circular.InOut,\n\n  /**\n   * Elastic in.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  ELASTIC_IN: Easing.Elastic.In,\n  /**\n   * Elastic out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  ELASTIC_OUT: Easing.Elastic.Out,\n  /**\n   * Elastic in then out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  ELASTIC_IN_OUT: Easing.Elastic.InOut,\n\n  /**\n   * Back in.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  BACK_IN: Easing.Back.In,\n  /**\n   * Back out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  BACK_OUT: Easing.Back.Out,\n  /**\n   * Back in then out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  BACK_IN_OUT: Easing.Back.InOut,\n\n  /**\n   * Bounce in.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  BOUNCE_IN: Easing.Bounce.In,\n  /**\n   * Bounce out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  BOUNCE_OUT: Easing.Bounce.Out,\n  /**\n   * Bounce in then out.\n   *\n   * @type {EasingFunction.Callback}\n   * @constant\n   */\n  BOUNCE_IN_OUT: Easing.Bounce.InOut,\n};\n\n/**\n * Function interface for implementing a custom easing function.\n * @callback EasingFunction.Callback\n * @param {number} time The time in the range <code>[0, 1]</code>.\n * @returns {number} The value of the function at the given time.\n *\n * @example\n * function quadraticIn(time) {\n *     return time * time;\n * }\n *\n * @example\n * function quadraticOut(time) {\n *     return time * (2.0 - time);\n * }\n */\n\nexport default Object.freeze(EasingFunction);\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport combine from \"../Core/combine.js\";\nimport defined from \"../Core/defined.js\";\nimport EasingFunction from \"../Core/EasingFunction.js\";\n/**\n * Transitions the KmlTour to the next destination. This transition is facilitated\n * using a specified flyToMode over a given number of seconds.\n *\n * @alias KmlTourFlyTo\n * @constructor\n *\n * @param {number} duration entry duration\n * @param {string} flyToMode KML fly to mode: bounce, smooth, etc\n * @param {KmlCamera|KmlLookAt} view KmlCamera or KmlLookAt\n *\n * @see KmlTour\n * @see KmlTourWait\n */\nfunction KmlTourFlyTo(duration, flyToMode, view) {\n  this.type = \"KmlTourFlyTo\";\n  this.blocking = true;\n  this.activeCamera = null;\n  this.activeCallback = null;\n\n  this.duration = duration;\n  this.view = view;\n  this.flyToMode = flyToMode;\n}\n\n/**\n * Play this playlist entry\n *\n * @param {KmlTourFlyTo.DoneCallback} done function which will be called when playback ends\n * @param {Camera} camera Cesium camera\n * @param {object} [cameraOptions] which will be merged with camera flyTo options. See {@link Camera#flyTo}\n */\nKmlTourFlyTo.prototype.play = function (done, camera, cameraOptions) {\n  this.activeCamera = camera;\n  if (defined(done) && done !== null) {\n    const self = this;\n    this.activeCallback = function (terminated) {\n      delete self.activeCallback;\n      delete self.activeCamera;\n      done(defined(terminated) ? false : terminated);\n    };\n  }\n\n  const options = this.getCameraOptions(cameraOptions);\n  if (this.view.headingPitchRoll) {\n    camera.flyTo(options);\n  } else if (this.view.headingPitchRange) {\n    const target = new BoundingSphere(this.view.position);\n    camera.flyToBoundingSphere(target, options);\n  }\n};\n\n/**\n * Stop execution of curent entry. Cancel camera flyTo\n */\nKmlTourFlyTo.prototype.stop = function () {\n  if (defined(this.activeCamera)) {\n    this.activeCamera.cancelFlight();\n  }\n  if (defined(this.activeCallback)) {\n    this.activeCallback(true);\n  }\n};\n\n/**\n * Returns options for {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere}\n * depends on this.view type.\n *\n * @param {object} cameraOptions options to merge with generated. See {@link Camera#flyTo}\n * @returns {object} {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere} options\n */\nKmlTourFlyTo.prototype.getCameraOptions = function (cameraOptions) {\n  let options = {\n    duration: this.duration,\n  };\n\n  if (defined(this.activeCallback)) {\n    options.complete = this.activeCallback;\n  }\n\n  if (this.flyToMode === \"smooth\") {\n    options.easingFunction = EasingFunction.LINEAR_NONE;\n  }\n\n  if (this.view.headingPitchRoll) {\n    options.destination = this.view.position;\n    options.orientation = this.view.headingPitchRoll;\n  } else if (this.view.headingPitchRange) {\n    options.offset = this.view.headingPitchRange;\n  }\n\n  if (defined(cameraOptions)) {\n    options = combine(options, cameraOptions);\n  }\n  return options;\n};\n\n/**\n * A function that will be executed when the flight completes.\n * @callback KmlTourFlyTo.DoneCallback\n *\n * @param {boolean} terminated true if {@link KmlTourFlyTo#stop} was\n * called before entry done playback.\n */\nexport default KmlTourFlyTo;\n", "import defined from \"../Core/defined.js\";\n/**\n * Pauses the KmlTour for a given number of seconds.\n *\n * @alias KmlTourWait\n * @constructor\n *\n * @param {number} duration entry duration\n *\n * @see KmlTour\n * @see KmlTourFlyTo\n */\nfunction KmlTourWait(duration) {\n  this.type = \"KmlTourWait\";\n  this.blocking = true;\n  this.duration = duration;\n\n  this.timeout = null;\n}\n\n/**\n * Play this playlist entry\n *\n * @param {KmlTourWait.DoneCallback} done function which will be called when playback ends\n */\nKmlTourWait.prototype.play = function (done) {\n  const self = this;\n  this.activeCallback = done;\n  this.timeout = setTimeout(function () {\n    delete self.activeCallback;\n    done(false);\n  }, this.duration * 1000);\n};\n\n/**\n * Stop execution of curent entry, cancel curent timeout\n */\nKmlTourWait.prototype.stop = function () {\n  clearTimeout(this.timeout);\n  if (defined(this.activeCallback)) {\n    this.activeCallback(true);\n  }\n};\n\n/**\n * A function which will be called when playback ends.\n *\n * @callback KmlTourWait.DoneCallback\n * @param {boolean} terminated true if {@link KmlTourWait#stop} was\n * called before entry done playback.\n */\nexport default KmlTourWait;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * Defines the interface for visualizers. Visualizers are plug-ins to\n * {@link DataSourceDisplay} that render data associated with\n * {@link DataSource} instances.\n * This object is an interface for documentation purposes and is not intended\n * to be instantiated directly.\n * @alias Visualizer\n * @constructor\n *\n * @see BillboardVisualizer\n * @see LabelVisualizer\n * @see ModelVisualizer\n * @see PathVisualizer\n * @see PointVisualizer\n * @see GeometryVisualizer\n */\nfunction Visualizer() {\n  DeveloperError.throwInstantiationError();\n}\n\n/**\n * Updates the visualization to the provided time.\n * @function\n *\n * @param {JulianDate} time The time.\n *\n * @returns {boolean} True if the display was updated to the provided time,\n * false if the visualizer is waiting for an asynchronous operation to\n * complete before data can be updated.\n */\nVisualizer.prototype.update = DeveloperError.throwInstantiationError;\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n *                       BoundingSphereState.PENDING if the result is still being computed, or\n *                       BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nVisualizer.prototype.getBoundingSphere = DeveloperError.throwInstantiationError;\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * @function\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n */\nVisualizer.prototype.isDestroyed = DeveloperError.throwInstantiationError;\n\n/**\n * Removes all visualization and cleans up any resources associated with this instance.\n * @function\n */\nVisualizer.prototype.destroy = DeveloperError.throwInstantiationError;\nexport default Visualizer;\n", "import buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Color from \"../Core/Color.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TimeInterval from \"../Core/TimeInterval.js\";\nimport TimeIntervalCollection from \"../Core/TimeIntervalCollection.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport HorizontalOrigin from \"../Scene/HorizontalOrigin.js\";\nimport VerticalOrigin from \"../Scene/VerticalOrigin.js\";\nimport * as zip from \"@zip.js/zip.js/lib/zip-no-worker.js\";\nimport BillboardGraphics from \"./BillboardGraphics.js\";\nimport CompositePositionProperty from \"./CompositePositionProperty.js\";\nimport ModelGraphics from \"./ModelGraphics.js\";\nimport RectangleGraphics from \"./RectangleGraphics.js\";\nimport SampledPositionProperty from \"./SampledPositionProperty.js\";\nimport SampledProperty from \"./SampledProperty.js\";\nimport ScaledPositionProperty from \"./ScaledPositionProperty.js\";\n\nconst BILLBOARD_SIZE = 32;\nconst kmlNamespace = \"http://www.opengis.net/kml/2.2\";\nconst gxNamespace = \"http://www.google.com/kml/ext/2.2\";\nconst xmlnsNamespace = \"http://www.w3.org/2000/xmlns/\";\n\n//\n// Handles files external to the KML (eg. textures and models)\n//\nfunction ExternalFileHandler(modelCallback) {\n  this._files = {};\n  this._promises = [];\n  this._count = 0;\n  this._modelCallback = modelCallback;\n}\n\nconst imageTypeRegex = /^data:image\\/([^,;]+)/;\nExternalFileHandler.prototype.texture = function (texture) {\n  const that = this;\n  let filename;\n\n  if (typeof texture === \"string\" || texture instanceof Resource) {\n    texture = Resource.createIfNeeded(texture);\n    if (!texture.isDataUri) {\n      return texture.url;\n    }\n\n    // If its a data URI try and get the correct extension and then fetch the blob\n    const regexResult = texture.url.match(imageTypeRegex);\n    filename = `texture_${++this._count}`;\n    if (defined(regexResult)) {\n      filename += `.${regexResult[1]}`;\n    }\n\n    const promise = texture.fetchBlob().then(function (blob) {\n      that._files[filename] = blob;\n    });\n\n    this._promises.push(promise);\n\n    return filename;\n  }\n\n  if (texture instanceof HTMLCanvasElement) {\n    filename = `texture_${++this._count}.png`;\n    const promise = new Promise((resolve) => {\n      texture.toBlob(function (blob) {\n        that._files[filename] = blob;\n        resolve();\n      });\n    });\n    this._promises.push(promise);\n\n    return filename;\n  }\n\n  return \"\";\n};\n\nfunction getModelBlobHander(that, filename) {\n  return function (blob) {\n    that._files[filename] = blob;\n  };\n}\n\nExternalFileHandler.prototype.model = function (model, time) {\n  const modelCallback = this._modelCallback;\n  if (!defined(modelCallback)) {\n    throw new RuntimeError(\n      \"Encountered a model entity while exporting to KML, but no model callback was supplied.\"\n    );\n  }\n\n  const externalFiles = {};\n  const url = modelCallback(model, time, externalFiles);\n\n  // Iterate through external files and add them to our list once the promise resolves\n  for (const filename in externalFiles) {\n    if (externalFiles.hasOwnProperty(filename)) {\n      const promise = Promise.resolve(externalFiles[filename]);\n      this._promises.push(promise);\n\n      promise.then(getModelBlobHander(this, filename));\n    }\n  }\n\n  return url;\n};\n\nObject.defineProperties(ExternalFileHandler.prototype, {\n  promise: {\n    get: function () {\n      return Promise.all(this._promises);\n    },\n  },\n  files: {\n    get: function () {\n      return this._files;\n    },\n  },\n});\n\n//\n// Handles getting values from properties taking the desired time and default values into account\n//\nfunction ValueGetter(time) {\n  this._time = time;\n}\n\nValueGetter.prototype.get = function (property, defaultVal, result) {\n  let value;\n  if (defined(property)) {\n    value = defined(property.getValue)\n      ? property.getValue(this._time, result)\n      : property;\n  }\n\n  return defaultValue(value, defaultVal);\n};\n\nValueGetter.prototype.getColor = function (property, defaultVal) {\n  const result = this.get(property, defaultVal);\n  if (defined(result)) {\n    return colorToString(result);\n  }\n};\n\nValueGetter.prototype.getMaterialType = function (property) {\n  if (!defined(property)) {\n    return;\n  }\n\n  return property.getType(this._time);\n};\n\n//\n// Caches styles so we don't generate a ton of duplicate styles\n//\nfunction StyleCache() {\n  this._ids = {};\n  this._styles = {};\n  this._count = 0;\n}\n\nStyleCache.prototype.get = function (element) {\n  const ids = this._ids;\n  const key = element.innerHTML;\n  if (defined(ids[key])) {\n    return ids[key];\n  }\n\n  let styleId = `style-${++this._count}`;\n  element.setAttribute(\"id\", styleId);\n\n  // Store with #\n  styleId = `#${styleId}`;\n  ids[key] = styleId;\n  this._styles[key] = element;\n\n  return styleId;\n};\n\nStyleCache.prototype.save = function (parentElement) {\n  const styles = this._styles;\n\n  const firstElement = parentElement.childNodes[0];\n  for (const key in styles) {\n    if (styles.hasOwnProperty(key)) {\n      parentElement.insertBefore(styles[key], firstElement);\n    }\n  }\n};\n\n//\n// Manages the generation of IDs because an entity may have geometry and a Folder for children\n//\nfunction IdManager() {\n  this._ids = {};\n}\n\nIdManager.prototype.get = function (id) {\n  if (!defined(id)) {\n    return this.get(createGuid());\n  }\n\n  const ids = this._ids;\n  if (!defined(ids[id])) {\n    ids[id] = 0;\n    return id;\n  }\n\n  return `${id.toString()}-${++ids[id]}`;\n};\n\n/**\n * @typedef exportKmlResultKml\n * @type {object}\n * @property {string} kml The generated KML.\n * @property {Object<string, Blob>} externalFiles An object dictionary of external files\n */\n\n/**\n * @typedef exportKmlResultKmz\n * @type {object}\n * @property {Blob} kmz The generated kmz file.\n */\n\n/**\n * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, Path, Polygon, Polyline geometries\n * will be exported. Note that there is not a 1 to 1 mapping of Entity properties to KML Feature properties. For\n * example, entity properties that are time dynamic but cannot be dynamic in KML are exported with their values at\n * options.time or the beginning of the EntityCollection's time interval if not specified. For time-dynamic properties\n * that are supported in KML, we use the samples if it is a {@link SampledProperty} otherwise we sample the value using\n * the options.sampleDuration. Point, Billboard, Model and Path geometries with time-dynamic positions will be exported\n * as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary\n * color is used. Canvas objects are exported as PNG images.\n *\n * @function exportKml\n *\n * @param {object} options An object with the following properties:\n * @param {EntityCollection} options.entities The EntityCollection to export as KML.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for the output file.\n * @param {exportKmlModelCallback} [options.modelCallback] A callback that will be called with a {@link ModelGraphics} instance and should return the URI to use in the KML. Required if a model exists in the entity collection.\n * @param {JulianDate} [options.time=entities.computeAvailability().start] The time value to use to get properties that are not time varying in KML.\n * @param {TimeInterval} [options.defaultAvailability=entities.computeAvailability()] The interval that will be sampled if an entity doesn't have an availability.\n * @param {number} [options.sampleDuration=60] The number of seconds to sample properties that are varying in KML.\n * @param {boolean} [options.kmz=false] If true KML and external files will be compressed into a kmz file.\n *\n * @returns {Promise<exportKmlResultKml|exportKmlResultKmz>} A promise that resolved to an object containing the KML string and a dictionary of external file blobs, or a kmz file as a blob if options.kmz is true.\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Export%20KML.html|Cesium Sandcastle KML Export Demo}\n * @example\n * Cesium.exportKml({\n *      entities: entityCollection\n *  })\n *   .then(function(result) {\n *     // The XML string is in result.kml\n *\n *     const externalFiles = result.externalFiles\n *     for(const file in externalFiles) {\n *       // file is the name of the file used in the KML document as the href\n *       // externalFiles[file] is a blob with the contents of the file\n *     }\n *   });\n *\n */\nfunction exportKml(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const entities = options.entities;\n  const kmz = defaultValue(options.kmz, false);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(entities)) {\n    throw new DeveloperError(\"entities is required.\");\n  }\n  //>>includeEnd('debug');\n\n  // Get the state that is passed around during the recursion\n  // This is separated out for testing.\n  const state = exportKml._createState(options);\n\n  // Filter EntityCollection so we only have top level entities\n  const rootEntities = entities.values.filter(function (entity) {\n    return !defined(entity.parent);\n  });\n\n  // Add the <Document>\n  const kmlDoc = state.kmlDoc;\n  const kmlElement = kmlDoc.documentElement;\n  kmlElement.setAttributeNS(xmlnsNamespace, \"xmlns:gx\", gxNamespace);\n  const kmlDocumentElement = kmlDoc.createElement(\"Document\");\n  kmlElement.appendChild(kmlDocumentElement);\n\n  // Create the KML Hierarchy\n  recurseEntities(state, kmlDocumentElement, rootEntities);\n\n  // Write out the <Style> elements\n  state.styleCache.save(kmlDocumentElement);\n\n  // Once all the blobs have resolved return the KML string along with the blob collection\n  const externalFileHandler = state.externalFileHandler;\n  return externalFileHandler.promise.then(function () {\n    const serializer = new XMLSerializer();\n    const kmlString = serializer.serializeToString(state.kmlDoc);\n    if (kmz) {\n      return createKmz(kmlString, externalFileHandler.files);\n    }\n\n    return {\n      kml: kmlString,\n      externalFiles: externalFileHandler.files,\n    };\n  });\n}\n\nfunction createKmz(kmlString, externalFiles) {\n  const zWorkerUrl = buildModuleUrl(\"ThirdParty/Workers/z-worker-pako.js\");\n  zip.configure({\n    workerScripts: {\n      deflate: [zWorkerUrl, \"./pako_deflate.min.js\"],\n      inflate: [zWorkerUrl, \"./pako_inflate.min.js\"],\n    },\n  });\n  const blobWriter = new zip.BlobWriter();\n  const writer = new zip.ZipWriter(blobWriter);\n  // We need to only write one file at a time so the zip doesn't get corrupted\n  return writer\n    .add(\"doc.kml\", new zip.TextReader(kmlString))\n    .then(function () {\n      const keys = Object.keys(externalFiles);\n      return addExternalFilesToZip(writer, keys, externalFiles, 0);\n    })\n    .then(function () {\n      return writer.close();\n    })\n    .then(function (blob) {\n      return {\n        kmz: blob,\n      };\n    });\n}\n\nfunction addExternalFilesToZip(writer, keys, externalFiles, index) {\n  if (keys.length === index) {\n    return;\n  }\n  const filename = keys[index];\n  return writer\n    .add(filename, new zip.BlobReader(externalFiles[filename]))\n    .then(function () {\n      return addExternalFilesToZip(writer, keys, externalFiles, index + 1);\n    });\n}\n\nexportKml._createState = function (options) {\n  const entities = options.entities;\n\n  const styleCache = new StyleCache();\n\n  // Use the start time as the default because just in case they define\n  //  properties with an interval even if they don't change.\n  const entityAvailability = entities.computeAvailability();\n  const time = defined(options.time) ? options.time : entityAvailability.start;\n\n  // Figure out how we will sample dynamic position properties\n  let defaultAvailability = defaultValue(\n    options.defaultAvailability,\n    entityAvailability\n  );\n  const sampleDuration = defaultValue(options.sampleDuration, 60);\n\n  // Make sure we don't have infinite availability if we need to sample\n  if (defaultAvailability.start === Iso8601.MINIMUM_VALUE) {\n    if (defaultAvailability.stop === Iso8601.MAXIMUM_VALUE) {\n      // Infinite, so just use the default\n      defaultAvailability = new TimeInterval();\n    } else {\n      // No start time, so just sample 10 times before the stop\n      JulianDate.addSeconds(\n        defaultAvailability.stop,\n        -10 * sampleDuration,\n        defaultAvailability.start\n      );\n    }\n  } else if (defaultAvailability.stop === Iso8601.MAXIMUM_VALUE) {\n    // No stop time, so just sample 10 times after the start\n    JulianDate.addSeconds(\n      defaultAvailability.start,\n      10 * sampleDuration,\n      defaultAvailability.stop\n    );\n  }\n\n  const externalFileHandler = new ExternalFileHandler(options.modelCallback);\n\n  const kmlDoc = document.implementation.createDocument(kmlNamespace, \"kml\");\n  return {\n    kmlDoc: kmlDoc,\n    ellipsoid: defaultValue(options.ellipsoid, Ellipsoid.WGS84),\n    idManager: new IdManager(),\n    styleCache: styleCache,\n    externalFileHandler: externalFileHandler,\n    time: time,\n    valueGetter: new ValueGetter(time),\n    sampleDuration: sampleDuration,\n    // Wrap it in a TimeIntervalCollection because that is what entity.availability is\n    defaultAvailability: new TimeIntervalCollection([defaultAvailability]),\n  };\n};\n\nfunction recurseEntities(state, parentNode, entities) {\n  const kmlDoc = state.kmlDoc;\n  const styleCache = state.styleCache;\n  const valueGetter = state.valueGetter;\n  const idManager = state.idManager;\n\n  const count = entities.length;\n  let overlays;\n  let geometries;\n  let styles;\n  for (let i = 0; i < count; ++i) {\n    const entity = entities[i];\n    overlays = [];\n    geometries = [];\n    styles = [];\n\n    createPoint(state, entity, geometries, styles);\n    createLineString(state, entity.polyline, geometries, styles);\n    createPolygon(state, entity.rectangle, geometries, styles, overlays);\n    createPolygon(state, entity.polygon, geometries, styles, overlays);\n    createModel(state, entity, entity.model, geometries, styles);\n\n    let timeSpan;\n    const availability = entity.availability;\n    if (defined(availability)) {\n      timeSpan = kmlDoc.createElement(\"TimeSpan\");\n\n      if (!JulianDate.equals(availability.start, Iso8601.MINIMUM_VALUE)) {\n        timeSpan.appendChild(\n          createBasicElementWithText(\n            kmlDoc,\n            \"begin\",\n            JulianDate.toIso8601(availability.start)\n          )\n        );\n      }\n\n      if (!JulianDate.equals(availability.stop, Iso8601.MAXIMUM_VALUE)) {\n        timeSpan.appendChild(\n          createBasicElementWithText(\n            kmlDoc,\n            \"end\",\n            JulianDate.toIso8601(availability.stop)\n          )\n        );\n      }\n    }\n\n    for (let overlayIndex = 0; overlayIndex < overlays.length; ++overlayIndex) {\n      const overlay = overlays[overlayIndex];\n\n      overlay.setAttribute(\"id\", idManager.get(entity.id));\n      overlay.appendChild(\n        createBasicElementWithText(kmlDoc, \"name\", entity.name)\n      );\n      overlay.appendChild(\n        createBasicElementWithText(kmlDoc, \"visibility\", entity.show)\n      );\n      overlay.appendChild(\n        createBasicElementWithText(kmlDoc, \"description\", entity.description)\n      );\n\n      if (defined(timeSpan)) {\n        overlay.appendChild(timeSpan);\n      }\n\n      parentNode.appendChild(overlay);\n    }\n\n    const geometryCount = geometries.length;\n    if (geometryCount > 0) {\n      const placemark = kmlDoc.createElement(\"Placemark\");\n      placemark.setAttribute(\"id\", idManager.get(entity.id));\n\n      let name = entity.name;\n      const labelGraphics = entity.label;\n      if (defined(labelGraphics)) {\n        const labelStyle = kmlDoc.createElement(\"LabelStyle\");\n\n        // KML only shows the name as a label, so just change the name if we need to show a label\n        const text = valueGetter.get(labelGraphics.text);\n        name = defined(text) && text.length > 0 ? text : name;\n\n        const color = valueGetter.getColor(labelGraphics.fillColor);\n        if (defined(color)) {\n          labelStyle.appendChild(\n            createBasicElementWithText(kmlDoc, \"color\", color)\n          );\n          labelStyle.appendChild(\n            createBasicElementWithText(kmlDoc, \"colorMode\", \"normal\")\n          );\n        }\n\n        const scale = valueGetter.get(labelGraphics.scale);\n        if (defined(scale)) {\n          labelStyle.appendChild(\n            createBasicElementWithText(kmlDoc, \"scale\", scale)\n          );\n        }\n\n        styles.push(labelStyle);\n      }\n\n      placemark.appendChild(createBasicElementWithText(kmlDoc, \"name\", name));\n      placemark.appendChild(\n        createBasicElementWithText(kmlDoc, \"visibility\", entity.show)\n      );\n      placemark.appendChild(\n        createBasicElementWithText(kmlDoc, \"description\", entity.description)\n      );\n\n      if (defined(timeSpan)) {\n        placemark.appendChild(timeSpan);\n      }\n\n      parentNode.appendChild(placemark);\n\n      const styleCount = styles.length;\n      if (styleCount > 0) {\n        const style = kmlDoc.createElement(\"Style\");\n        for (let styleIndex = 0; styleIndex < styleCount; ++styleIndex) {\n          style.appendChild(styles[styleIndex]);\n        }\n\n        placemark.appendChild(\n          createBasicElementWithText(kmlDoc, \"styleUrl\", styleCache.get(style))\n        );\n      }\n\n      if (geometries.length === 1) {\n        placemark.appendChild(geometries[0]);\n      } else if (geometries.length > 1) {\n        const multigeometry = kmlDoc.createElement(\"MultiGeometry\");\n        for (\n          let geometryIndex = 0;\n          geometryIndex < geometryCount;\n          ++geometryIndex\n        ) {\n          multigeometry.appendChild(geometries[geometryIndex]);\n        }\n        placemark.appendChild(multigeometry);\n      }\n    }\n\n    const children = entity._children;\n    if (children.length > 0) {\n      const folderNode = kmlDoc.createElement(\"Folder\");\n      folderNode.setAttribute(\"id\", idManager.get(entity.id));\n      folderNode.appendChild(\n        createBasicElementWithText(kmlDoc, \"name\", entity.name)\n      );\n      folderNode.appendChild(\n        createBasicElementWithText(kmlDoc, \"visibility\", entity.show)\n      );\n      folderNode.appendChild(\n        createBasicElementWithText(kmlDoc, \"description\", entity.description)\n      );\n\n      parentNode.appendChild(folderNode);\n\n      recurseEntities(state, folderNode, children);\n    }\n  }\n}\n\nconst scratchCartesian3 = new Cartesian3();\nconst scratchCartographic = new Cartographic();\nconst scratchJulianDate = new JulianDate();\n\nfunction createPoint(state, entity, geometries, styles) {\n  const kmlDoc = state.kmlDoc;\n  const ellipsoid = state.ellipsoid;\n  const valueGetter = state.valueGetter;\n\n  const pointGraphics = defaultValue(entity.billboard, entity.point);\n  if (!defined(pointGraphics) && !defined(entity.path)) {\n    return;\n  }\n\n  // If the point isn't constant then create gx:Track or gx:MultiTrack\n  const entityPositionProperty = entity.position;\n  if (!entityPositionProperty.isConstant) {\n    createTracks(state, entity, pointGraphics, geometries, styles);\n    return;\n  }\n\n  valueGetter.get(entityPositionProperty, undefined, scratchCartesian3);\n  const coordinates = createBasicElementWithText(\n    kmlDoc,\n    \"coordinates\",\n    getCoordinates(scratchCartesian3, ellipsoid)\n  );\n\n  const pointGeometry = kmlDoc.createElement(\"Point\");\n\n  // Set altitude mode\n  const altitudeMode = kmlDoc.createElement(\"altitudeMode\");\n  altitudeMode.appendChild(\n    getAltitudeMode(state, pointGraphics.heightReference)\n  );\n  pointGeometry.appendChild(altitudeMode);\n\n  pointGeometry.appendChild(coordinates);\n  geometries.push(pointGeometry);\n\n  // Create style\n  const iconStyle =\n    pointGraphics instanceof BillboardGraphics\n      ? createIconStyleFromBillboard(state, pointGraphics)\n      : createIconStyleFromPoint(state, pointGraphics);\n  styles.push(iconStyle);\n}\n\nfunction createTracks(state, entity, pointGraphics, geometries, styles) {\n  const kmlDoc = state.kmlDoc;\n  const ellipsoid = state.ellipsoid;\n  const valueGetter = state.valueGetter;\n\n  let intervals;\n  const entityPositionProperty = entity.position;\n  let useEntityPositionProperty = true;\n  if (entityPositionProperty instanceof CompositePositionProperty) {\n    intervals = entityPositionProperty.intervals;\n    useEntityPositionProperty = false;\n  } else {\n    intervals = defaultValue(entity.availability, state.defaultAvailability);\n  }\n\n  const isModel = pointGraphics instanceof ModelGraphics;\n\n  let i, j, times;\n  const tracks = [];\n  for (i = 0; i < intervals.length; ++i) {\n    const interval = intervals.get(i);\n    let positionProperty = useEntityPositionProperty\n      ? entityPositionProperty\n      : interval.data;\n\n    const trackAltitudeMode = kmlDoc.createElement(\"altitudeMode\");\n    // This is something that KML importing uses to handle clampToGround,\n    //  so just extract the internal property and set the altitudeMode.\n    if (positionProperty instanceof ScaledPositionProperty) {\n      positionProperty = positionProperty._value;\n      trackAltitudeMode.appendChild(\n        getAltitudeMode(state, HeightReference.CLAMP_TO_GROUND)\n      );\n    } else if (defined(pointGraphics)) {\n      trackAltitudeMode.appendChild(\n        getAltitudeMode(state, pointGraphics.heightReference)\n      );\n    } else {\n      // Path graphics only, which has no height reference\n      trackAltitudeMode.appendChild(\n        getAltitudeMode(state, HeightReference.NONE)\n      );\n    }\n\n    const positionTimes = [];\n    const positionValues = [];\n\n    if (positionProperty.isConstant) {\n      valueGetter.get(positionProperty, undefined, scratchCartesian3);\n      const constCoordinates = createBasicElementWithText(\n        kmlDoc,\n        \"coordinates\",\n        getCoordinates(scratchCartesian3, ellipsoid)\n      );\n\n      // This interval is constant so add a track with the same position\n      positionTimes.push(JulianDate.toIso8601(interval.start));\n      positionValues.push(constCoordinates);\n      positionTimes.push(JulianDate.toIso8601(interval.stop));\n      positionValues.push(constCoordinates);\n    } else if (positionProperty instanceof SampledPositionProperty) {\n      times = positionProperty._property._times;\n\n      for (j = 0; j < times.length; ++j) {\n        positionTimes.push(JulianDate.toIso8601(times[j]));\n        positionProperty.getValueInReferenceFrame(\n          times[j],\n          ReferenceFrame.FIXED,\n          scratchCartesian3\n        );\n        positionValues.push(getCoordinates(scratchCartesian3, ellipsoid));\n      }\n    } else if (positionProperty instanceof SampledProperty) {\n      times = positionProperty._times;\n      const values = positionProperty._values;\n\n      for (j = 0; j < times.length; ++j) {\n        positionTimes.push(JulianDate.toIso8601(times[j]));\n        Cartesian3.fromArray(values, j * 3, scratchCartesian3);\n        positionValues.push(getCoordinates(scratchCartesian3, ellipsoid));\n      }\n    } else {\n      const duration = state.sampleDuration;\n      interval.start.clone(scratchJulianDate);\n      if (!interval.isStartIncluded) {\n        JulianDate.addSeconds(scratchJulianDate, duration, scratchJulianDate);\n      }\n\n      const stopDate = interval.stop;\n      while (JulianDate.lessThan(scratchJulianDate, stopDate)) {\n        positionProperty.getValue(scratchJulianDate, scratchCartesian3);\n\n        positionTimes.push(JulianDate.toIso8601(scratchJulianDate));\n        positionValues.push(getCoordinates(scratchCartesian3, ellipsoid));\n\n        JulianDate.addSeconds(scratchJulianDate, duration, scratchJulianDate);\n      }\n\n      if (\n        interval.isStopIncluded &&\n        JulianDate.equals(scratchJulianDate, stopDate)\n      ) {\n        positionProperty.getValue(scratchJulianDate, scratchCartesian3);\n\n        positionTimes.push(JulianDate.toIso8601(scratchJulianDate));\n        positionValues.push(getCoordinates(scratchCartesian3, ellipsoid));\n      }\n    }\n\n    const trackGeometry = kmlDoc.createElementNS(gxNamespace, \"Track\");\n    trackGeometry.appendChild(trackAltitudeMode);\n\n    for (let k = 0; k < positionTimes.length; ++k) {\n      const when = createBasicElementWithText(kmlDoc, \"when\", positionTimes[k]);\n      const coord = createBasicElementWithText(\n        kmlDoc,\n        \"coord\",\n        positionValues[k],\n        gxNamespace\n      );\n\n      trackGeometry.appendChild(when);\n      trackGeometry.appendChild(coord);\n    }\n\n    if (isModel) {\n      trackGeometry.appendChild(createModelGeometry(state, pointGraphics));\n    }\n\n    tracks.push(trackGeometry);\n  }\n\n  // If one track, then use it otherwise combine into a multitrack\n  if (tracks.length === 1) {\n    geometries.push(tracks[0]);\n  } else if (tracks.length > 1) {\n    const multiTrackGeometry = kmlDoc.createElementNS(\n      gxNamespace,\n      \"MultiTrack\"\n    );\n\n    for (i = 0; i < tracks.length; ++i) {\n      multiTrackGeometry.appendChild(tracks[i]);\n    }\n\n    geometries.push(multiTrackGeometry);\n  }\n\n  // Create style\n  if (defined(pointGraphics) && !isModel) {\n    const iconStyle =\n      pointGraphics instanceof BillboardGraphics\n        ? createIconStyleFromBillboard(state, pointGraphics)\n        : createIconStyleFromPoint(state, pointGraphics);\n    styles.push(iconStyle);\n  }\n\n  // See if we have a line that needs to be drawn\n  const path = entity.path;\n  if (defined(path)) {\n    const width = valueGetter.get(path.width);\n    const material = path.material;\n    if (defined(material) || defined(width)) {\n      const lineStyle = kmlDoc.createElement(\"LineStyle\");\n      if (defined(width)) {\n        lineStyle.appendChild(\n          createBasicElementWithText(kmlDoc, \"width\", width)\n        );\n      }\n\n      processMaterial(state, material, lineStyle);\n      styles.push(lineStyle);\n    }\n  }\n}\n\nfunction createIconStyleFromPoint(state, pointGraphics) {\n  const kmlDoc = state.kmlDoc;\n  const valueGetter = state.valueGetter;\n\n  const iconStyle = kmlDoc.createElement(\"IconStyle\");\n\n  const color = valueGetter.getColor(pointGraphics.color);\n  if (defined(color)) {\n    iconStyle.appendChild(createBasicElementWithText(kmlDoc, \"color\", color));\n    iconStyle.appendChild(\n      createBasicElementWithText(kmlDoc, \"colorMode\", \"normal\")\n    );\n  }\n\n  const pixelSize = valueGetter.get(pointGraphics.pixelSize);\n  if (defined(pixelSize)) {\n    iconStyle.appendChild(\n      createBasicElementWithText(kmlDoc, \"scale\", pixelSize / BILLBOARD_SIZE)\n    );\n  }\n\n  return iconStyle;\n}\n\nfunction createIconStyleFromBillboard(state, billboardGraphics) {\n  const kmlDoc = state.kmlDoc;\n  const valueGetter = state.valueGetter;\n  const externalFileHandler = state.externalFileHandler;\n\n  const iconStyle = kmlDoc.createElement(\"IconStyle\");\n\n  let image = valueGetter.get(billboardGraphics.image);\n  if (defined(image)) {\n    image = externalFileHandler.texture(image);\n\n    const icon = kmlDoc.createElement(\"Icon\");\n    icon.appendChild(createBasicElementWithText(kmlDoc, \"href\", image));\n\n    const imageSubRegion = valueGetter.get(billboardGraphics.imageSubRegion);\n    if (defined(imageSubRegion)) {\n      icon.appendChild(\n        createBasicElementWithText(kmlDoc, \"x\", imageSubRegion.x, gxNamespace)\n      );\n      icon.appendChild(\n        createBasicElementWithText(kmlDoc, \"y\", imageSubRegion.y, gxNamespace)\n      );\n      icon.appendChild(\n        createBasicElementWithText(\n          kmlDoc,\n          \"w\",\n          imageSubRegion.width,\n          gxNamespace\n        )\n      );\n      icon.appendChild(\n        createBasicElementWithText(\n          kmlDoc,\n          \"h\",\n          imageSubRegion.height,\n          gxNamespace\n        )\n      );\n    }\n\n    iconStyle.appendChild(icon);\n  }\n\n  const color = valueGetter.getColor(billboardGraphics.color);\n  if (defined(color)) {\n    iconStyle.appendChild(createBasicElementWithText(kmlDoc, \"color\", color));\n    iconStyle.appendChild(\n      createBasicElementWithText(kmlDoc, \"colorMode\", \"normal\")\n    );\n  }\n\n  let scale = valueGetter.get(billboardGraphics.scale);\n  if (defined(scale)) {\n    iconStyle.appendChild(createBasicElementWithText(kmlDoc, \"scale\", scale));\n  }\n\n  const pixelOffset = valueGetter.get(billboardGraphics.pixelOffset);\n  if (defined(pixelOffset)) {\n    scale = defaultValue(scale, 1.0);\n\n    Cartesian2.divideByScalar(pixelOffset, scale, pixelOffset);\n\n    const width = valueGetter.get(billboardGraphics.width, BILLBOARD_SIZE);\n    const height = valueGetter.get(billboardGraphics.height, BILLBOARD_SIZE);\n\n    // KML Hotspots are from the bottom left, but we work from the top left\n\n    // Move to left\n    const horizontalOrigin = valueGetter.get(\n      billboardGraphics.horizontalOrigin,\n      HorizontalOrigin.CENTER\n    );\n    if (horizontalOrigin === HorizontalOrigin.CENTER) {\n      pixelOffset.x -= width * 0.5;\n    } else if (horizontalOrigin === HorizontalOrigin.RIGHT) {\n      pixelOffset.x -= width;\n    }\n\n    // Move to bottom\n    const verticalOrigin = valueGetter.get(\n      billboardGraphics.verticalOrigin,\n      VerticalOrigin.CENTER\n    );\n    if (verticalOrigin === VerticalOrigin.TOP) {\n      pixelOffset.y += height;\n    } else if (verticalOrigin === VerticalOrigin.CENTER) {\n      pixelOffset.y += height * 0.5;\n    }\n\n    const hotSpot = kmlDoc.createElement(\"hotSpot\");\n    hotSpot.setAttribute(\"x\", -pixelOffset.x);\n    hotSpot.setAttribute(\"y\", pixelOffset.y);\n    hotSpot.setAttribute(\"xunits\", \"pixels\");\n    hotSpot.setAttribute(\"yunits\", \"pixels\");\n\n    iconStyle.appendChild(hotSpot);\n  }\n\n  // We can only specify heading so if axis isn't Z, then we skip the rotation\n  // GE treats a heading of zero as no heading but can still point north using a 360 degree angle\n  let rotation = valueGetter.get(billboardGraphics.rotation);\n  const alignedAxis = valueGetter.get(billboardGraphics.alignedAxis);\n  if (defined(rotation) && Cartesian3.equals(Cartesian3.UNIT_Z, alignedAxis)) {\n    rotation = CesiumMath.toDegrees(-rotation);\n    if (rotation === 0) {\n      rotation = 360;\n    }\n\n    iconStyle.appendChild(\n      createBasicElementWithText(kmlDoc, \"heading\", rotation)\n    );\n  }\n\n  return iconStyle;\n}\n\nfunction createLineString(state, polylineGraphics, geometries, styles) {\n  const kmlDoc = state.kmlDoc;\n  const ellipsoid = state.ellipsoid;\n  const valueGetter = state.valueGetter;\n\n  if (!defined(polylineGraphics)) {\n    return;\n  }\n\n  const lineStringGeometry = kmlDoc.createElement(\"LineString\");\n\n  // Set altitude mode\n  const altitudeMode = kmlDoc.createElement(\"altitudeMode\");\n  const clampToGround = valueGetter.get(polylineGraphics.clampToGround, false);\n  let altitudeModeText;\n  if (clampToGround) {\n    lineStringGeometry.appendChild(\n      createBasicElementWithText(kmlDoc, \"tessellate\", true)\n    );\n    altitudeModeText = kmlDoc.createTextNode(\"clampToGround\");\n  } else {\n    altitudeModeText = kmlDoc.createTextNode(\"absolute\");\n  }\n  altitudeMode.appendChild(altitudeModeText);\n  lineStringGeometry.appendChild(altitudeMode);\n\n  // Set coordinates\n  const positionsProperty = polylineGraphics.positions;\n  const cartesians = valueGetter.get(positionsProperty);\n  const coordinates = createBasicElementWithText(\n    kmlDoc,\n    \"coordinates\",\n    getCoordinates(cartesians, ellipsoid)\n  );\n  lineStringGeometry.appendChild(coordinates);\n\n  // Set draw order\n  const zIndex = valueGetter.get(polylineGraphics.zIndex);\n  if (clampToGround && defined(zIndex)) {\n    lineStringGeometry.appendChild(\n      createBasicElementWithText(kmlDoc, \"drawOrder\", zIndex, gxNamespace)\n    );\n  }\n\n  geometries.push(lineStringGeometry);\n\n  // Create style\n  const lineStyle = kmlDoc.createElement(\"LineStyle\");\n\n  const width = valueGetter.get(polylineGraphics.width);\n  if (defined(width)) {\n    lineStyle.appendChild(createBasicElementWithText(kmlDoc, \"width\", width));\n  }\n\n  processMaterial(state, polylineGraphics.material, lineStyle);\n\n  styles.push(lineStyle);\n}\n\nfunction getRectangleBoundaries(state, rectangleGraphics, extrudedHeight) {\n  const kmlDoc = state.kmlDoc;\n  const valueGetter = state.valueGetter;\n\n  let height = valueGetter.get(rectangleGraphics.height, 0.0);\n\n  if (extrudedHeight > 0) {\n    // We extrude up and KML extrudes down, so if we extrude, set the polygon height to\n    // the extruded height so KML will look similar to Cesium\n    height = extrudedHeight;\n  }\n\n  const coordinatesProperty = rectangleGraphics.coordinates;\n  const rectangle = valueGetter.get(coordinatesProperty);\n\n  const coordinateStrings = [];\n  const cornerFunction = [\n    Rectangle.northeast,\n    Rectangle.southeast,\n    Rectangle.southwest,\n    Rectangle.northwest,\n  ];\n\n  for (let i = 0; i < 4; ++i) {\n    cornerFunction[i](rectangle, scratchCartographic);\n    coordinateStrings.push(\n      `${CesiumMath.toDegrees(\n        scratchCartographic.longitude\n      )},${CesiumMath.toDegrees(scratchCartographic.latitude)},${height}`\n    );\n  }\n\n  const coordinates = createBasicElementWithText(\n    kmlDoc,\n    \"coordinates\",\n    coordinateStrings.join(\" \")\n  );\n\n  const outerBoundaryIs = kmlDoc.createElement(\"outerBoundaryIs\");\n  const linearRing = kmlDoc.createElement(\"LinearRing\");\n  linearRing.appendChild(coordinates);\n  outerBoundaryIs.appendChild(linearRing);\n\n  return [outerBoundaryIs];\n}\n\nfunction getLinearRing(state, positions, height, perPositionHeight) {\n  const kmlDoc = state.kmlDoc;\n  const ellipsoid = state.ellipsoid;\n\n  const coordinateStrings = [];\n  const positionCount = positions.length;\n  for (let i = 0; i < positionCount; ++i) {\n    Cartographic.fromCartesian(positions[i], ellipsoid, scratchCartographic);\n    coordinateStrings.push(\n      `${CesiumMath.toDegrees(\n        scratchCartographic.longitude\n      )},${CesiumMath.toDegrees(scratchCartographic.latitude)},${\n        perPositionHeight ? scratchCartographic.height : height\n      }`\n    );\n  }\n\n  const coordinates = createBasicElementWithText(\n    kmlDoc,\n    \"coordinates\",\n    coordinateStrings.join(\" \")\n  );\n  const linearRing = kmlDoc.createElement(\"LinearRing\");\n  linearRing.appendChild(coordinates);\n\n  return linearRing;\n}\n\nfunction getPolygonBoundaries(state, polygonGraphics, extrudedHeight) {\n  const kmlDoc = state.kmlDoc;\n  const valueGetter = state.valueGetter;\n\n  let height = valueGetter.get(polygonGraphics.height, 0.0);\n  const perPositionHeight = valueGetter.get(\n    polygonGraphics.perPositionHeight,\n    false\n  );\n\n  if (!perPositionHeight && extrudedHeight > 0) {\n    // We extrude up and KML extrudes down, so if we extrude, set the polygon height to\n    // the extruded height so KML will look similar to Cesium\n    height = extrudedHeight;\n  }\n\n  const boundaries = [];\n  const hierarchyProperty = polygonGraphics.hierarchy;\n  const hierarchy = valueGetter.get(hierarchyProperty);\n\n  // Polygon hierarchy can sometimes just be an array of positions\n  const positions = Array.isArray(hierarchy) ? hierarchy : hierarchy.positions;\n\n  // Polygon boundaries\n  const outerBoundaryIs = kmlDoc.createElement(\"outerBoundaryIs\");\n  outerBoundaryIs.appendChild(\n    getLinearRing(state, positions, height, perPositionHeight)\n  );\n  boundaries.push(outerBoundaryIs);\n\n  // Hole boundaries\n  const holes = hierarchy.holes;\n  if (defined(holes)) {\n    const holeCount = holes.length;\n    for (let i = 0; i < holeCount; ++i) {\n      const innerBoundaryIs = kmlDoc.createElement(\"innerBoundaryIs\");\n      innerBoundaryIs.appendChild(\n        getLinearRing(state, holes[i].positions, height, perPositionHeight)\n      );\n      boundaries.push(innerBoundaryIs);\n    }\n  }\n\n  return boundaries;\n}\n\nfunction createPolygon(state, geometry, geometries, styles, overlays) {\n  const kmlDoc = state.kmlDoc;\n  const valueGetter = state.valueGetter;\n\n  if (!defined(geometry)) {\n    return;\n  }\n\n  // Detect textured quads and use ground overlays instead\n  const isRectangle = geometry instanceof RectangleGraphics;\n  if (\n    isRectangle &&\n    valueGetter.getMaterialType(geometry.material) === \"Image\"\n  ) {\n    createGroundOverlay(state, geometry, overlays);\n    return;\n  }\n\n  const polygonGeometry = kmlDoc.createElement(\"Polygon\");\n\n  const extrudedHeight = valueGetter.get(geometry.extrudedHeight, 0.0);\n  if (extrudedHeight > 0) {\n    polygonGeometry.appendChild(\n      createBasicElementWithText(kmlDoc, \"extrude\", true)\n    );\n  }\n\n  // Set boundaries\n  const boundaries = isRectangle\n    ? getRectangleBoundaries(state, geometry, extrudedHeight)\n    : getPolygonBoundaries(state, geometry, extrudedHeight);\n\n  const boundaryCount = boundaries.length;\n  for (let i = 0; i < boundaryCount; ++i) {\n    polygonGeometry.appendChild(boundaries[i]);\n  }\n\n  // Set altitude mode\n  const altitudeMode = kmlDoc.createElement(\"altitudeMode\");\n  altitudeMode.appendChild(getAltitudeMode(state, geometry.heightReference));\n  polygonGeometry.appendChild(altitudeMode);\n\n  geometries.push(polygonGeometry);\n\n  // Create style\n  const polyStyle = kmlDoc.createElement(\"PolyStyle\");\n\n  const fill = valueGetter.get(geometry.fill, false);\n  if (fill) {\n    polyStyle.appendChild(createBasicElementWithText(kmlDoc, \"fill\", fill));\n  }\n\n  processMaterial(state, geometry.material, polyStyle);\n\n  const outline = valueGetter.get(geometry.outline, false);\n  if (outline) {\n    polyStyle.appendChild(\n      createBasicElementWithText(kmlDoc, \"outline\", outline)\n    );\n\n    // Outline uses LineStyle\n    const lineStyle = kmlDoc.createElement(\"LineStyle\");\n\n    const outlineWidth = valueGetter.get(geometry.outlineWidth, 1.0);\n    lineStyle.appendChild(\n      createBasicElementWithText(kmlDoc, \"width\", outlineWidth)\n    );\n\n    const outlineColor = valueGetter.getColor(\n      geometry.outlineColor,\n      Color.BLACK\n    );\n    lineStyle.appendChild(\n      createBasicElementWithText(kmlDoc, \"color\", outlineColor)\n    );\n    lineStyle.appendChild(\n      createBasicElementWithText(kmlDoc, \"colorMode\", \"normal\")\n    );\n\n    styles.push(lineStyle);\n  }\n\n  styles.push(polyStyle);\n}\n\nfunction createGroundOverlay(state, rectangleGraphics, overlays) {\n  const kmlDoc = state.kmlDoc;\n  const valueGetter = state.valueGetter;\n  const externalFileHandler = state.externalFileHandler;\n\n  const groundOverlay = kmlDoc.createElement(\"GroundOverlay\");\n\n  // Set altitude mode\n  const altitudeMode = kmlDoc.createElement(\"altitudeMode\");\n  altitudeMode.appendChild(\n    getAltitudeMode(state, rectangleGraphics.heightReference)\n  );\n  groundOverlay.appendChild(altitudeMode);\n\n  const height = valueGetter.get(rectangleGraphics.height);\n  if (defined(height)) {\n    groundOverlay.appendChild(\n      createBasicElementWithText(kmlDoc, \"altitude\", height)\n    );\n  }\n\n  const rectangle = valueGetter.get(rectangleGraphics.coordinates);\n  const latLonBox = kmlDoc.createElement(\"LatLonBox\");\n  latLonBox.appendChild(\n    createBasicElementWithText(\n      kmlDoc,\n      \"north\",\n      CesiumMath.toDegrees(rectangle.north)\n    )\n  );\n  latLonBox.appendChild(\n    createBasicElementWithText(\n      kmlDoc,\n      \"south\",\n      CesiumMath.toDegrees(rectangle.south)\n    )\n  );\n  latLonBox.appendChild(\n    createBasicElementWithText(\n      kmlDoc,\n      \"east\",\n      CesiumMath.toDegrees(rectangle.east)\n    )\n  );\n  latLonBox.appendChild(\n    createBasicElementWithText(\n      kmlDoc,\n      \"west\",\n      CesiumMath.toDegrees(rectangle.west)\n    )\n  );\n  groundOverlay.appendChild(latLonBox);\n\n  // We should only end up here if we have an ImageMaterialProperty\n  const material = valueGetter.get(rectangleGraphics.material);\n  const href = externalFileHandler.texture(material.image);\n  const icon = kmlDoc.createElement(\"Icon\");\n  icon.appendChild(createBasicElementWithText(kmlDoc, \"href\", href));\n  groundOverlay.appendChild(icon);\n\n  const color = material.color;\n  if (defined(color)) {\n    groundOverlay.appendChild(\n      createBasicElementWithText(kmlDoc, \"color\", colorToString(material.color))\n    );\n  }\n\n  overlays.push(groundOverlay);\n}\n\nfunction createModelGeometry(state, modelGraphics) {\n  const kmlDoc = state.kmlDoc;\n  const valueGetter = state.valueGetter;\n  const externalFileHandler = state.externalFileHandler;\n\n  const modelGeometry = kmlDoc.createElement(\"Model\");\n\n  const scale = valueGetter.get(modelGraphics.scale);\n  if (defined(scale)) {\n    const scaleElement = kmlDoc.createElement(\"scale\");\n    scaleElement.appendChild(createBasicElementWithText(kmlDoc, \"x\", scale));\n    scaleElement.appendChild(createBasicElementWithText(kmlDoc, \"y\", scale));\n    scaleElement.appendChild(createBasicElementWithText(kmlDoc, \"z\", scale));\n    modelGeometry.appendChild(scaleElement);\n  }\n\n  const link = kmlDoc.createElement(\"Link\");\n  const uri = externalFileHandler.model(modelGraphics, state.time);\n\n  link.appendChild(createBasicElementWithText(kmlDoc, \"href\", uri));\n  modelGeometry.appendChild(link);\n\n  return modelGeometry;\n}\n\nfunction createModel(state, entity, modelGraphics, geometries, styles) {\n  const kmlDoc = state.kmlDoc;\n  const ellipsoid = state.ellipsoid;\n  const valueGetter = state.valueGetter;\n\n  if (!defined(modelGraphics)) {\n    return;\n  }\n\n  // If the point isn't constant then create gx:Track or gx:MultiTrack\n  const entityPositionProperty = entity.position;\n  if (!entityPositionProperty.isConstant) {\n    createTracks(state, entity, modelGraphics, geometries, styles);\n    return;\n  }\n\n  const modelGeometry = createModelGeometry(state, modelGraphics);\n\n  // Set altitude mode\n  const altitudeMode = kmlDoc.createElement(\"altitudeMode\");\n  altitudeMode.appendChild(\n    getAltitudeMode(state, modelGraphics.heightReference)\n  );\n  modelGeometry.appendChild(altitudeMode);\n\n  valueGetter.get(entityPositionProperty, undefined, scratchCartesian3);\n  Cartographic.fromCartesian(scratchCartesian3, ellipsoid, scratchCartographic);\n  const location = kmlDoc.createElement(\"Location\");\n  location.appendChild(\n    createBasicElementWithText(\n      kmlDoc,\n      \"longitude\",\n      CesiumMath.toDegrees(scratchCartographic.longitude)\n    )\n  );\n  location.appendChild(\n    createBasicElementWithText(\n      kmlDoc,\n      \"latitude\",\n      CesiumMath.toDegrees(scratchCartographic.latitude)\n    )\n  );\n  location.appendChild(\n    createBasicElementWithText(kmlDoc, \"altitude\", scratchCartographic.height)\n  );\n  modelGeometry.appendChild(location);\n\n  geometries.push(modelGeometry);\n}\n\nfunction processMaterial(state, materialProperty, style) {\n  const kmlDoc = state.kmlDoc;\n  const valueGetter = state.valueGetter;\n\n  if (!defined(materialProperty)) {\n    return;\n  }\n\n  const material = valueGetter.get(materialProperty);\n  if (!defined(material)) {\n    return;\n  }\n\n  let color;\n  const type = valueGetter.getMaterialType(materialProperty);\n  let outlineColor;\n  let outlineWidth;\n  switch (type) {\n    case \"Image\":\n      // Image materials are only able to be represented on rectangles, so if we make it\n      //  here we can't texture a generic polygon or polyline in KML, so just use white.\n      color = colorToString(Color.WHITE);\n      break;\n    case \"Color\":\n    case \"Grid\":\n    case \"PolylineGlow\":\n    case \"PolylineArrow\":\n    case \"PolylineDash\":\n      color = colorToString(material.color);\n      break;\n    case \"PolylineOutline\":\n      color = colorToString(material.color);\n\n      outlineColor = colorToString(material.outlineColor);\n      outlineWidth = material.outlineWidth;\n      style.appendChild(\n        createBasicElementWithText(\n          kmlDoc,\n          \"outerColor\",\n          outlineColor,\n          gxNamespace\n        )\n      );\n      style.appendChild(\n        createBasicElementWithText(\n          kmlDoc,\n          \"outerWidth\",\n          outlineWidth,\n          gxNamespace\n        )\n      );\n      break;\n    case \"Stripe\":\n      color = colorToString(material.oddColor);\n      break;\n  }\n\n  if (defined(color)) {\n    style.appendChild(createBasicElementWithText(kmlDoc, \"color\", color));\n    style.appendChild(\n      createBasicElementWithText(kmlDoc, \"colorMode\", \"normal\")\n    );\n  }\n}\n\nfunction getAltitudeMode(state, heightReferenceProperty) {\n  const kmlDoc = state.kmlDoc;\n  const valueGetter = state.valueGetter;\n\n  const heightReference = valueGetter.get(\n    heightReferenceProperty,\n    HeightReference.NONE\n  );\n  let altitudeModeText;\n  switch (heightReference) {\n    case HeightReference.NONE:\n      altitudeModeText = kmlDoc.createTextNode(\"absolute\");\n      break;\n    case HeightReference.CLAMP_TO_GROUND:\n      altitudeModeText = kmlDoc.createTextNode(\"clampToGround\");\n      break;\n    case HeightReference.RELATIVE_TO_GROUND:\n      altitudeModeText = kmlDoc.createTextNode(\"relativeToGround\");\n      break;\n  }\n\n  return altitudeModeText;\n}\n\nfunction getCoordinates(coordinates, ellipsoid) {\n  if (!Array.isArray(coordinates)) {\n    coordinates = [coordinates];\n  }\n\n  const count = coordinates.length;\n  const coordinateStrings = [];\n  for (let i = 0; i < count; ++i) {\n    Cartographic.fromCartesian(coordinates[i], ellipsoid, scratchCartographic);\n    coordinateStrings.push(\n      `${CesiumMath.toDegrees(\n        scratchCartographic.longitude\n      )},${CesiumMath.toDegrees(scratchCartographic.latitude)},${\n        scratchCartographic.height\n      }`\n    );\n  }\n\n  return coordinateStrings.join(\" \");\n}\n\nfunction createBasicElementWithText(\n  kmlDoc,\n  elementName,\n  elementValue,\n  namespace\n) {\n  elementValue = defaultValue(elementValue, \"\");\n\n  if (typeof elementValue === \"boolean\") {\n    elementValue = elementValue ? \"1\" : \"0\";\n  }\n\n  // Create element with optional namespace\n  const element = defined(namespace)\n    ? kmlDoc.createElementNS(namespace, elementName)\n    : kmlDoc.createElement(elementName);\n\n  // Wrap value in CDATA section if it contains HTML\n  const text =\n    elementValue === \"string\" && elementValue.indexOf(\"<\") !== -1\n      ? kmlDoc.createCDATASection(elementValue)\n      : kmlDoc.createTextNode(elementValue);\n\n  element.appendChild(text);\n\n  return element;\n}\n\nfunction colorToString(color) {\n  let result = \"\";\n  const bytes = color.toBytes();\n  for (let i = 3; i >= 0; --i) {\n    result +=\n      bytes[i] < 16 ? `0${bytes[i].toString(16)}` : bytes[i].toString(16);\n  }\n\n  return result;\n}\n\n/**\n * Since KML does not support glTF models, this callback is required to specify what URL to use for the model in the KML document.\n * It can also be used to add additional files to the <code>externalFiles</code> object, which is the list of files embedded in the exported KMZ,\n * or otherwise returned with the KML string when exporting.\n *\n * @callback exportKmlModelCallback\n *\n * @param {ModelGraphics} model The ModelGraphics instance for an Entity.\n * @param {JulianDate} time The time that any properties should use to get the value.\n * @param {object} externalFiles An object that maps a filename to a Blob or a Promise that resolves to a Blob.\n * @returns {string} The URL to use for the href in the KML document.\n */\nexport default exportKml;\n", "import defined from \"./defined.js\";\n\n/**\n * Formats an error object into a String.  If available, uses name, message, and stack\n * properties, otherwise, falls back on toString().\n *\n * @function\n *\n * @param {*} object The item to find in the array.\n * @returns {string} A string containing the formatted error.\n */\nfunction formatError(object) {\n  let result;\n\n  const name = object.name;\n  const message = object.message;\n  if (defined(name) && defined(message)) {\n    result = `${name}: ${message}`;\n  } else {\n    result = object.toString();\n  }\n\n  const stack = object.stack;\n  if (defined(stack)) {\n    result += `\\n${stack}`;\n  }\n\n  return result;\n}\nexport default formatError;\n", "/**\n * The encoding that is used for a heightmap\n *\n * @enum {number}\n */\nconst HeightmapEncoding = {\n  /**\n   * No encoding\n   *\n   * @type {number}\n   * @constant\n   */\n  NONE: 0,\n\n  /**\n   * LERC encoding\n   *\n   * @type {number}\n   * @constant\n   *\n   * @see {@link https://github.com/Esri/lerc|The LERC specification}\n   */\n  LERC: 1,\n};\nexport default Object.freeze(HeightmapEncoding);\n", "/**\n * This enumerated type is used to determine how the vertices of the terrain mesh are compressed.\n *\n * @enum {number}\n *\n * @private\n */\nconst TerrainQuantization = {\n  /**\n   * The vertices are not compressed.\n   *\n   * @type {number}\n   * @constant\n   */\n  NONE: 0,\n\n  /**\n   * The vertices are compressed to 12 bits.\n   *\n   * @type {number}\n   * @constant\n   */\n  BITS12: 1,\n};\nexport default Object.freeze(TerrainQuantization);\n", "import AttributeCompression from \"./AttributeCompression.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport VerticalExaggeration from \"./VerticalExaggeration.js\";\nimport TerrainQuantization from \"./TerrainQuantization.js\";\n\nconst cartesian3Scratch = new Cartesian3();\nconst cartesian3DimScratch = new Cartesian3();\nconst cartesian2Scratch = new Cartesian2();\nconst matrix4Scratch = new Matrix4();\nconst matrix4Scratch2 = new Matrix4();\n\nconst SHIFT_LEFT_12 = Math.pow(2.0, 12.0);\n\n/**\n * Data used to quantize and pack the terrain mesh. The position can be unpacked for picking and all attributes\n * are unpacked in the vertex shader.\n *\n * @alias TerrainEncoding\n * @constructor\n *\n * @param {Cartesian3} center The center point of the vertices.\n * @param {AxisAlignedBoundingBox} axisAlignedBoundingBox The bounds of the tile in the east-north-up coordinates at the tiles center.\n * @param {number} minimumHeight The minimum height.\n * @param {number} maximumHeight The maximum height.\n * @param {Matrix4} fromENU The east-north-up to fixed frame matrix at the center of the terrain mesh.\n * @param {boolean} hasVertexNormals If the mesh has vertex normals.\n * @param {boolean} [hasWebMercatorT=false] true if the terrain data includes a Web Mercator texture coordinate; otherwise, false.\n * @param {boolean} [hasGeodeticSurfaceNormals=false] true if the terrain data includes geodetic surface normals; otherwise, false.\n * @param {number} [exaggeration=1.0] A scalar used to exaggerate terrain.\n * @param {number} [exaggerationRelativeHeight=0.0] The relative height from which terrain is exaggerated.\n *\n * @private\n */\nfunction TerrainEncoding(\n  center,\n  axisAlignedBoundingBox,\n  minimumHeight,\n  maximumHeight,\n  fromENU,\n  hasVertexNormals,\n  hasWebMercatorT,\n  hasGeodeticSurfaceNormals,\n  exaggeration,\n  exaggerationRelativeHeight\n) {\n  let quantization = TerrainQuantization.NONE;\n  let toENU;\n  let matrix;\n\n  if (\n    defined(axisAlignedBoundingBox) &&\n    defined(minimumHeight) &&\n    defined(maximumHeight) &&\n    defined(fromENU)\n  ) {\n    const minimum = axisAlignedBoundingBox.minimum;\n    const maximum = axisAlignedBoundingBox.maximum;\n\n    const dimensions = Cartesian3.subtract(\n      maximum,\n      minimum,\n      cartesian3DimScratch\n    );\n    const hDim = maximumHeight - minimumHeight;\n    const maxDim = Math.max(Cartesian3.maximumComponent(dimensions), hDim);\n\n    if (maxDim < SHIFT_LEFT_12 - 1.0) {\n      quantization = TerrainQuantization.BITS12;\n    } else {\n      quantization = TerrainQuantization.NONE;\n    }\n\n    toENU = Matrix4.inverseTransformation(fromENU, new Matrix4());\n\n    const translation = Cartesian3.negate(minimum, cartesian3Scratch);\n    Matrix4.multiply(\n      Matrix4.fromTranslation(translation, matrix4Scratch),\n      toENU,\n      toENU\n    );\n\n    const scale = cartesian3Scratch;\n    scale.x = 1.0 / dimensions.x;\n    scale.y = 1.0 / dimensions.y;\n    scale.z = 1.0 / dimensions.z;\n    Matrix4.multiply(Matrix4.fromScale(scale, matrix4Scratch), toENU, toENU);\n\n    matrix = Matrix4.clone(fromENU);\n    Matrix4.setTranslation(matrix, Cartesian3.ZERO, matrix);\n\n    fromENU = Matrix4.clone(fromENU, new Matrix4());\n\n    const translationMatrix = Matrix4.fromTranslation(minimum, matrix4Scratch);\n    const scaleMatrix = Matrix4.fromScale(dimensions, matrix4Scratch2);\n    const st = Matrix4.multiply(translationMatrix, scaleMatrix, matrix4Scratch);\n\n    Matrix4.multiply(fromENU, st, fromENU);\n    Matrix4.multiply(matrix, st, matrix);\n  }\n\n  /**\n   * How the vertices of the mesh were compressed.\n   * @type {TerrainQuantization}\n   */\n  this.quantization = quantization;\n\n  /**\n   * The minimum height of the tile including the skirts.\n   * @type {number}\n   */\n  this.minimumHeight = minimumHeight;\n\n  /**\n   * The maximum height of the tile.\n   * @type {number}\n   */\n  this.maximumHeight = maximumHeight;\n\n  /**\n   * The center of the tile.\n   * @type {Cartesian3}\n   */\n  this.center = Cartesian3.clone(center);\n\n  /**\n   * A matrix that takes a vertex from the tile, transforms it to east-north-up at the center and scales\n   * it so each component is in the [0, 1] range.\n   * @type {Matrix4}\n   */\n  this.toScaledENU = toENU;\n\n  /**\n   * A matrix that restores a vertex transformed with toScaledENU back to the earth fixed reference frame\n   * @type {Matrix4}\n   */\n  this.fromScaledENU = fromENU;\n\n  /**\n   * The matrix used to decompress the terrain vertices in the shader for RTE rendering.\n   * @type {Matrix4}\n   */\n  this.matrix = matrix;\n\n  /**\n   * The terrain mesh contains normals.\n   * @type {boolean}\n   */\n  this.hasVertexNormals = hasVertexNormals;\n\n  /**\n   * The terrain mesh contains a vertical texture coordinate following the Web Mercator projection.\n   * @type {boolean}\n   */\n  this.hasWebMercatorT = defaultValue(hasWebMercatorT, false);\n\n  /**\n   * The terrain mesh contains geodetic surface normals, used for terrain exaggeration.\n   * @type {boolean}\n   */\n  this.hasGeodeticSurfaceNormals = defaultValue(\n    hasGeodeticSurfaceNormals,\n    false\n  );\n\n  /**\n   * A scalar used to exaggerate terrain.\n   * @type {number}\n   */\n  this.exaggeration = defaultValue(exaggeration, 1.0);\n\n  /**\n   * The relative height from which terrain is exaggerated.\n   */\n  this.exaggerationRelativeHeight = defaultValue(\n    exaggerationRelativeHeight,\n    0.0\n  );\n\n  /**\n   * The number of components in each vertex. This value can differ with different quantizations.\n   * @type {number}\n   */\n  this.stride = 0;\n\n  this._offsetGeodeticSurfaceNormal = 0;\n  this._offsetVertexNormal = 0;\n\n  // Calculate the stride and offsets declared above\n  this._calculateStrideAndOffsets();\n}\n\nTerrainEncoding.prototype.encode = function (\n  vertexBuffer,\n  bufferIndex,\n  position,\n  uv,\n  height,\n  normalToPack,\n  webMercatorT,\n  geodeticSurfaceNormal\n) {\n  const u = uv.x;\n  const v = uv.y;\n\n  if (this.quantization === TerrainQuantization.BITS12) {\n    position = Matrix4.multiplyByPoint(\n      this.toScaledENU,\n      position,\n      cartesian3Scratch\n    );\n\n    position.x = CesiumMath.clamp(position.x, 0.0, 1.0);\n    position.y = CesiumMath.clamp(position.y, 0.0, 1.0);\n    position.z = CesiumMath.clamp(position.z, 0.0, 1.0);\n\n    const hDim = this.maximumHeight - this.minimumHeight;\n    const h = CesiumMath.clamp((height - this.minimumHeight) / hDim, 0.0, 1.0);\n\n    Cartesian2.fromElements(position.x, position.y, cartesian2Scratch);\n    const compressed0 = AttributeCompression.compressTextureCoordinates(\n      cartesian2Scratch\n    );\n\n    Cartesian2.fromElements(position.z, h, cartesian2Scratch);\n    const compressed1 = AttributeCompression.compressTextureCoordinates(\n      cartesian2Scratch\n    );\n\n    Cartesian2.fromElements(u, v, cartesian2Scratch);\n    const compressed2 = AttributeCompression.compressTextureCoordinates(\n      cartesian2Scratch\n    );\n\n    vertexBuffer[bufferIndex++] = compressed0;\n    vertexBuffer[bufferIndex++] = compressed1;\n    vertexBuffer[bufferIndex++] = compressed2;\n\n    if (this.hasWebMercatorT) {\n      Cartesian2.fromElements(webMercatorT, 0.0, cartesian2Scratch);\n      const compressed3 = AttributeCompression.compressTextureCoordinates(\n        cartesian2Scratch\n      );\n      vertexBuffer[bufferIndex++] = compressed3;\n    }\n  } else {\n    Cartesian3.subtract(position, this.center, cartesian3Scratch);\n\n    vertexBuffer[bufferIndex++] = cartesian3Scratch.x;\n    vertexBuffer[bufferIndex++] = cartesian3Scratch.y;\n    vertexBuffer[bufferIndex++] = cartesian3Scratch.z;\n    vertexBuffer[bufferIndex++] = height;\n    vertexBuffer[bufferIndex++] = u;\n    vertexBuffer[bufferIndex++] = v;\n\n    if (this.hasWebMercatorT) {\n      vertexBuffer[bufferIndex++] = webMercatorT;\n    }\n  }\n\n  if (this.hasVertexNormals) {\n    vertexBuffer[bufferIndex++] = AttributeCompression.octPackFloat(\n      normalToPack\n    );\n  }\n\n  if (this.hasGeodeticSurfaceNormals) {\n    vertexBuffer[bufferIndex++] = geodeticSurfaceNormal.x;\n    vertexBuffer[bufferIndex++] = geodeticSurfaceNormal.y;\n    vertexBuffer[bufferIndex++] = geodeticSurfaceNormal.z;\n  }\n\n  return bufferIndex;\n};\n\nconst scratchPosition = new Cartesian3();\nconst scratchGeodeticSurfaceNormal = new Cartesian3();\n\nTerrainEncoding.prototype.addGeodeticSurfaceNormals = function (\n  oldBuffer,\n  newBuffer,\n  ellipsoid\n) {\n  if (this.hasGeodeticSurfaceNormals) {\n    return;\n  }\n\n  const oldStride = this.stride;\n  const vertexCount = oldBuffer.length / oldStride;\n  this.hasGeodeticSurfaceNormals = true;\n  this._calculateStrideAndOffsets();\n  const newStride = this.stride;\n\n  for (let index = 0; index < vertexCount; index++) {\n    for (let offset = 0; offset < oldStride; offset++) {\n      const oldIndex = index * oldStride + offset;\n      const newIndex = index * newStride + offset;\n      newBuffer[newIndex] = oldBuffer[oldIndex];\n    }\n    const position = this.decodePosition(newBuffer, index, scratchPosition);\n    const geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormal(\n      position,\n      scratchGeodeticSurfaceNormal\n    );\n\n    const bufferIndex = index * newStride + this._offsetGeodeticSurfaceNormal;\n    newBuffer[bufferIndex] = geodeticSurfaceNormal.x;\n    newBuffer[bufferIndex + 1] = geodeticSurfaceNormal.y;\n    newBuffer[bufferIndex + 2] = geodeticSurfaceNormal.z;\n  }\n};\n\nTerrainEncoding.prototype.removeGeodeticSurfaceNormals = function (\n  oldBuffer,\n  newBuffer\n) {\n  if (!this.hasGeodeticSurfaceNormals) {\n    return;\n  }\n\n  const oldStride = this.stride;\n  const vertexCount = oldBuffer.length / oldStride;\n  this.hasGeodeticSurfaceNormals = false;\n  this._calculateStrideAndOffsets();\n  const newStride = this.stride;\n\n  for (let index = 0; index < vertexCount; index++) {\n    for (let offset = 0; offset < newStride; offset++) {\n      const oldIndex = index * oldStride + offset;\n      const newIndex = index * newStride + offset;\n      newBuffer[newIndex] = oldBuffer[oldIndex];\n    }\n  }\n};\n\nTerrainEncoding.prototype.decodePosition = function (buffer, index, result) {\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  index *= this.stride;\n\n  if (this.quantization === TerrainQuantization.BITS12) {\n    const xy = AttributeCompression.decompressTextureCoordinates(\n      buffer[index],\n      cartesian2Scratch\n    );\n    result.x = xy.x;\n    result.y = xy.y;\n\n    const zh = AttributeCompression.decompressTextureCoordinates(\n      buffer[index + 1],\n      cartesian2Scratch\n    );\n    result.z = zh.x;\n\n    return Matrix4.multiplyByPoint(this.fromScaledENU, result, result);\n  }\n\n  result.x = buffer[index];\n  result.y = buffer[index + 1];\n  result.z = buffer[index + 2];\n  return Cartesian3.add(result, this.center, result);\n};\n\nTerrainEncoding.prototype.getExaggeratedPosition = function (\n  buffer,\n  index,\n  result\n) {\n  result = this.decodePosition(buffer, index, result);\n\n  const exaggeration = this.exaggeration;\n  const exaggerationRelativeHeight = this.exaggerationRelativeHeight;\n  const hasExaggeration = exaggeration !== 1.0;\n  if (hasExaggeration && this.hasGeodeticSurfaceNormals) {\n    const geodeticSurfaceNormal = this.decodeGeodeticSurfaceNormal(\n      buffer,\n      index,\n      scratchGeodeticSurfaceNormal\n    );\n    const rawHeight = this.decodeHeight(buffer, index);\n    const heightDifference =\n      VerticalExaggeration.getHeight(\n        rawHeight,\n        exaggeration,\n        exaggerationRelativeHeight\n      ) - rawHeight;\n\n    // some math is unrolled for better performance\n    result.x += geodeticSurfaceNormal.x * heightDifference;\n    result.y += geodeticSurfaceNormal.y * heightDifference;\n    result.z += geodeticSurfaceNormal.z * heightDifference;\n  }\n\n  return result;\n};\n\nTerrainEncoding.prototype.decodeTextureCoordinates = function (\n  buffer,\n  index,\n  result\n) {\n  if (!defined(result)) {\n    result = new Cartesian2();\n  }\n\n  index *= this.stride;\n\n  if (this.quantization === TerrainQuantization.BITS12) {\n    return AttributeCompression.decompressTextureCoordinates(\n      buffer[index + 2],\n      result\n    );\n  }\n\n  return Cartesian2.fromElements(buffer[index + 4], buffer[index + 5], result);\n};\n\nTerrainEncoding.prototype.decodeHeight = function (buffer, index) {\n  index *= this.stride;\n\n  if (this.quantization === TerrainQuantization.BITS12) {\n    const zh = AttributeCompression.decompressTextureCoordinates(\n      buffer[index + 1],\n      cartesian2Scratch\n    );\n    return (\n      zh.y * (this.maximumHeight - this.minimumHeight) + this.minimumHeight\n    );\n  }\n\n  return buffer[index + 3];\n};\n\nTerrainEncoding.prototype.decodeWebMercatorT = function (buffer, index) {\n  index *= this.stride;\n\n  if (this.quantization === TerrainQuantization.BITS12) {\n    return AttributeCompression.decompressTextureCoordinates(\n      buffer[index + 3],\n      cartesian2Scratch\n    ).x;\n  }\n\n  return buffer[index + 6];\n};\n\nTerrainEncoding.prototype.getOctEncodedNormal = function (\n  buffer,\n  index,\n  result\n) {\n  index = index * this.stride + this._offsetVertexNormal;\n\n  const temp = buffer[index] / 256.0;\n  const x = Math.floor(temp);\n  const y = (temp - x) * 256.0;\n\n  return Cartesian2.fromElements(x, y, result);\n};\n\nTerrainEncoding.prototype.decodeGeodeticSurfaceNormal = function (\n  buffer,\n  index,\n  result\n) {\n  index = index * this.stride + this._offsetGeodeticSurfaceNormal;\n\n  result.x = buffer[index];\n  result.y = buffer[index + 1];\n  result.z = buffer[index + 2];\n  return result;\n};\n\nTerrainEncoding.prototype._calculateStrideAndOffsets = function () {\n  let vertexStride = 0;\n\n  switch (this.quantization) {\n    case TerrainQuantization.BITS12:\n      vertexStride += 3;\n      break;\n    default:\n      vertexStride += 6;\n  }\n  if (this.hasWebMercatorT) {\n    vertexStride += 1;\n  }\n  if (this.hasVertexNormals) {\n    this._offsetVertexNormal = vertexStride;\n    vertexStride += 1;\n  }\n  if (this.hasGeodeticSurfaceNormals) {\n    this._offsetGeodeticSurfaceNormal = vertexStride;\n    vertexStride += 3;\n  }\n\n  this.stride = vertexStride;\n};\n\nconst attributesIndicesNone = {\n  position3DAndHeight: 0,\n  textureCoordAndEncodedNormals: 1,\n  geodeticSurfaceNormal: 2,\n};\nconst attributesIndicesBits12 = {\n  compressed0: 0,\n  compressed1: 1,\n  geodeticSurfaceNormal: 2,\n};\n\nTerrainEncoding.prototype.getAttributes = function (buffer) {\n  const datatype = ComponentDatatype.FLOAT;\n  const sizeInBytes = ComponentDatatype.getSizeInBytes(datatype);\n  const strideInBytes = this.stride * sizeInBytes;\n  let offsetInBytes = 0;\n\n  const attributes = [];\n  function addAttribute(index, componentsPerAttribute) {\n    attributes.push({\n      index: index,\n      vertexBuffer: buffer,\n      componentDatatype: datatype,\n      componentsPerAttribute: componentsPerAttribute,\n      offsetInBytes: offsetInBytes,\n      strideInBytes: strideInBytes,\n    });\n    offsetInBytes += componentsPerAttribute * sizeInBytes;\n  }\n\n  if (this.quantization === TerrainQuantization.NONE) {\n    addAttribute(attributesIndicesNone.position3DAndHeight, 4);\n\n    let componentsTexCoordAndNormals = 2;\n    componentsTexCoordAndNormals += this.hasWebMercatorT ? 1 : 0;\n    componentsTexCoordAndNormals += this.hasVertexNormals ? 1 : 0;\n    addAttribute(\n      attributesIndicesNone.textureCoordAndEncodedNormals,\n      componentsTexCoordAndNormals\n    );\n\n    if (this.hasGeodeticSurfaceNormals) {\n      addAttribute(attributesIndicesNone.geodeticSurfaceNormal, 3);\n    }\n  } else {\n    // When there is no webMercatorT or vertex normals, the attribute only needs 3 components: x/y, z/h, u/v.\n    // WebMercatorT and vertex normals each take up one component, so if only one of them is present the first\n    // attribute gets a 4th component. If both are present, we need an additional attribute that has 1 component.\n    const usingAttribute0Component4 =\n      this.hasWebMercatorT || this.hasVertexNormals;\n    const usingAttribute1Component1 =\n      this.hasWebMercatorT && this.hasVertexNormals;\n    addAttribute(\n      attributesIndicesBits12.compressed0,\n      usingAttribute0Component4 ? 4 : 3\n    );\n\n    if (usingAttribute1Component1) {\n      addAttribute(attributesIndicesBits12.compressed1, 1);\n    }\n\n    if (this.hasGeodeticSurfaceNormals) {\n      addAttribute(attributesIndicesBits12.geodeticSurfaceNormal, 3);\n    }\n  }\n\n  return attributes;\n};\n\nTerrainEncoding.prototype.getAttributeLocations = function () {\n  if (this.quantization === TerrainQuantization.NONE) {\n    return attributesIndicesNone;\n  }\n  return attributesIndicesBits12;\n};\n\nTerrainEncoding.clone = function (encoding, result) {\n  if (!defined(encoding)) {\n    return undefined;\n  }\n  if (!defined(result)) {\n    result = new TerrainEncoding();\n  }\n\n  result.quantization = encoding.quantization;\n  result.minimumHeight = encoding.minimumHeight;\n  result.maximumHeight = encoding.maximumHeight;\n  result.center = Cartesian3.clone(encoding.center);\n  result.toScaledENU = Matrix4.clone(encoding.toScaledENU);\n  result.fromScaledENU = Matrix4.clone(encoding.fromScaledENU);\n  result.matrix = Matrix4.clone(encoding.matrix);\n  result.hasVertexNormals = encoding.hasVertexNormals;\n  result.hasWebMercatorT = encoding.hasWebMercatorT;\n  result.hasGeodeticSurfaceNormals = encoding.hasGeodeticSurfaceNormals;\n  result.exaggeration = encoding.exaggeration;\n  result.exaggerationRelativeHeight = encoding.exaggerationRelativeHeight;\n\n  result._calculateStrideAndOffsets();\n\n  return result;\n};\nexport default TerrainEncoding;\n", "import AxisAlignedBoundingBox from \"./AxisAlignedBoundingBox.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidalOccluder from \"./EllipsoidalOccluder.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport OrientedBoundingBox from \"./OrientedBoundingBox.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport TerrainEncoding from \"./TerrainEncoding.js\";\nimport Transforms from \"./Transforms.js\";\nimport WebMercatorProjection from \"./WebMercatorProjection.js\";\n\n/**\n * Contains functions to create a mesh from a heightmap image.\n *\n * @namespace HeightmapTessellator\n *\n * @private\n */\nconst HeightmapTessellator = {};\n\n/**\n * The default structure of a heightmap, as given to {@link HeightmapTessellator.computeVertices}.\n *\n * @constant\n */\nHeightmapTessellator.DEFAULT_STRUCTURE = Object.freeze({\n  heightScale: 1.0,\n  heightOffset: 0.0,\n  elementsPerHeight: 1,\n  stride: 1,\n  elementMultiplier: 256.0,\n  isBigEndian: false,\n});\n\nconst cartesian3Scratch = new Cartesian3();\nconst matrix4Scratch = new Matrix4();\nconst minimumScratch = new Cartesian3();\nconst maximumScratch = new Cartesian3();\n\n/**\n * Fills an array of vertices from a heightmap image.\n *\n * @param {object} options Object with the following properties:\n * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} options.heightmap The heightmap to tessellate.\n * @param {number} options.width The width of the heightmap, in height samples.\n * @param {number} options.height The height of the heightmap, in height samples.\n * @param {number} options.skirtHeight The height of skirts to drape at the edges of the heightmap.\n * @param {Rectangle} options.nativeRectangle A rectangle in the native coordinates of the heightmap's projection.  For\n *                 a heightmap with a geographic projection, this is degrees.  For the web mercator\n *                 projection, this is meters.\n * @param {number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.\n * @param {number} [options.exaggerationRelativeHeight=0.0] The height from which terrain is exaggerated.\n * @param {Rectangle} [options.rectangle] The rectangle covered by the heightmap, in geodetic coordinates with north, south, east and\n *                 west properties in radians.  Either rectangle or nativeRectangle must be provided.  If both\n *                 are provided, they're assumed to be consistent.\n * @param {boolean} [options.isGeographic=true] True if the heightmap uses a {@link GeographicProjection}, or false if it uses\n *                  a {@link WebMercatorProjection}.\n * @param {Cartesian3} [options.relativeToCenter=Cartesian3.ZERO] The positions will be computed as <code>Cartesian3.subtract(worldPosition, relativeToCenter)</code>.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to which the heightmap applies.\n * @param {object} [options.structure] An object describing the structure of the height data.\n * @param {number} [options.structure.heightScale=1.0] The factor by which to multiply height samples in order to obtain\n *                 the height above the heightOffset, in meters.  The heightOffset is added to the resulting\n *                 height after multiplying by the scale.\n * @param {number} [options.structure.heightOffset=0.0] The offset to add to the scaled height to obtain the final\n *                 height in meters.  The offset is added after the height sample is multiplied by the\n *                 heightScale.\n * @param {number} [options.structure.elementsPerHeight=1] The number of elements in the buffer that make up a single height\n *                 sample.  This is usually 1, indicating that each element is a separate height sample.  If\n *                 it is greater than 1, that number of elements together form the height sample, which is\n *                 computed according to the structure.elementMultiplier and structure.isBigEndian properties.\n * @param {number} [options.structure.stride=1] The number of elements to skip to get from the first element of\n *                 one height to the first element of the next height.\n * @param {number} [options.structure.elementMultiplier=256.0] The multiplier used to compute the height value when the\n *                 stride property is greater than 1.  For example, if the stride is 4 and the strideMultiplier\n *                 is 256, the height is computed as follows:\n *                 `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256`\n *                 This is assuming that the isBigEndian property is false.  If it is true, the order of the\n *                 elements is reversed.\n * @param {number} [options.structure.lowestEncodedHeight] The lowest value that can be stored in the height buffer.  Any heights that are lower\n *                 than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value.  For example, if the height\n *                 buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers.  If this parameter is\n *                 not specified, no minimum value is enforced.\n * @param {number} [options.structure.highestEncodedHeight] The highest value that can be stored in the height buffer.  Any heights that are higher\n *                 than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value.  For example, if the height\n *                 buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger\n *                 than 65535.  If this parameter is not specified, no maximum value is enforced.\n * @param {boolean} [options.structure.isBigEndian=false] Indicates endianness of the elements in the buffer when the\n *                  stride property is greater than 1.  If this property is false, the first element is the\n *                  low-order element.  If it is true, the first element is the high-order element.\n *\n * @example\n * const width = 5;\n * const height = 5;\n * const statistics = Cesium.HeightmapTessellator.computeVertices({\n *     heightmap : [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0],\n *     width : width,\n *     height : height,\n *     skirtHeight : 0.0,\n *     nativeRectangle : {\n *         west : 10.0,\n *         east : 20.0,\n *         south : 30.0,\n *         north : 40.0\n *     }\n * });\n *\n * const encoding = statistics.encoding;\n * const position = encoding.decodePosition(statistics.vertices, index);\n */\nHeightmapTessellator.computeVertices = function (options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options) || !defined(options.heightmap)) {\n    throw new DeveloperError(\"options.heightmap is required.\");\n  }\n  if (!defined(options.width) || !defined(options.height)) {\n    throw new DeveloperError(\"options.width and options.height are required.\");\n  }\n  if (!defined(options.nativeRectangle)) {\n    throw new DeveloperError(\"options.nativeRectangle is required.\");\n  }\n  if (!defined(options.skirtHeight)) {\n    throw new DeveloperError(\"options.skirtHeight is required.\");\n  }\n  //>>includeEnd('debug');\n\n  // This function tends to be a performance hotspot for terrain rendering,\n  // so it employs a lot of inlining and unrolling as an optimization.\n  // In particular, the functionality of Ellipsoid.cartographicToCartesian\n  // is inlined.\n\n  const cos = Math.cos;\n  const sin = Math.sin;\n  const sqrt = Math.sqrt;\n  const atan = Math.atan;\n  const exp = Math.exp;\n  const piOverTwo = CesiumMath.PI_OVER_TWO;\n  const toRadians = CesiumMath.toRadians;\n\n  const heightmap = options.heightmap;\n  const width = options.width;\n  const height = options.height;\n  const skirtHeight = options.skirtHeight;\n  const hasSkirts = skirtHeight > 0.0;\n\n  const isGeographic = defaultValue(options.isGeographic, true);\n  const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n  const oneOverGlobeSemimajorAxis = 1.0 / ellipsoid.maximumRadius;\n\n  const nativeRectangle = Rectangle.clone(options.nativeRectangle);\n  const rectangle = Rectangle.clone(options.rectangle);\n\n  let geographicWest;\n  let geographicSouth;\n  let geographicEast;\n  let geographicNorth;\n\n  if (!defined(rectangle)) {\n    if (isGeographic) {\n      geographicWest = toRadians(nativeRectangle.west);\n      geographicSouth = toRadians(nativeRectangle.south);\n      geographicEast = toRadians(nativeRectangle.east);\n      geographicNorth = toRadians(nativeRectangle.north);\n    } else {\n      geographicWest = nativeRectangle.west * oneOverGlobeSemimajorAxis;\n      geographicSouth =\n        piOverTwo -\n        2.0 * atan(exp(-nativeRectangle.south * oneOverGlobeSemimajorAxis));\n      geographicEast = nativeRectangle.east * oneOverGlobeSemimajorAxis;\n      geographicNorth =\n        piOverTwo -\n        2.0 * atan(exp(-nativeRectangle.north * oneOverGlobeSemimajorAxis));\n    }\n  } else {\n    geographicWest = rectangle.west;\n    geographicSouth = rectangle.south;\n    geographicEast = rectangle.east;\n    geographicNorth = rectangle.north;\n  }\n\n  let relativeToCenter = options.relativeToCenter;\n  const hasRelativeToCenter = defined(relativeToCenter);\n  relativeToCenter = hasRelativeToCenter ? relativeToCenter : Cartesian3.ZERO;\n  const includeWebMercatorT = defaultValue(options.includeWebMercatorT, false);\n\n  const exaggeration = defaultValue(options.exaggeration, 1.0);\n  const exaggerationRelativeHeight = defaultValue(\n    options.exaggerationRelativeHeight,\n    0.0\n  );\n  const hasExaggeration = exaggeration !== 1.0;\n  const includeGeodeticSurfaceNormals = hasExaggeration;\n\n  const structure = defaultValue(\n    options.structure,\n    HeightmapTessellator.DEFAULT_STRUCTURE\n  );\n  const heightScale = defaultValue(\n    structure.heightScale,\n    HeightmapTessellator.DEFAULT_STRUCTURE.heightScale\n  );\n  const heightOffset = defaultValue(\n    structure.heightOffset,\n    HeightmapTessellator.DEFAULT_STRUCTURE.heightOffset\n  );\n  const elementsPerHeight = defaultValue(\n    structure.elementsPerHeight,\n    HeightmapTessellator.DEFAULT_STRUCTURE.elementsPerHeight\n  );\n  const stride = defaultValue(\n    structure.stride,\n    HeightmapTessellator.DEFAULT_STRUCTURE.stride\n  );\n  const elementMultiplier = defaultValue(\n    structure.elementMultiplier,\n    HeightmapTessellator.DEFAULT_STRUCTURE.elementMultiplier\n  );\n  const isBigEndian = defaultValue(\n    structure.isBigEndian,\n    HeightmapTessellator.DEFAULT_STRUCTURE.isBigEndian\n  );\n\n  let rectangleWidth = Rectangle.computeWidth(nativeRectangle);\n  let rectangleHeight = Rectangle.computeHeight(nativeRectangle);\n\n  const granularityX = rectangleWidth / (width - 1);\n  const granularityY = rectangleHeight / (height - 1);\n\n  if (!isGeographic) {\n    rectangleWidth *= oneOverGlobeSemimajorAxis;\n    rectangleHeight *= oneOverGlobeSemimajorAxis;\n  }\n\n  const radiiSquared = ellipsoid.radiiSquared;\n  const radiiSquaredX = radiiSquared.x;\n  const radiiSquaredY = radiiSquared.y;\n  const radiiSquaredZ = radiiSquared.z;\n\n  let minimumHeight = 65536.0;\n  let maximumHeight = -65536.0;\n\n  const fromENU = Transforms.eastNorthUpToFixedFrame(\n    relativeToCenter,\n    ellipsoid\n  );\n  const toENU = Matrix4.inverseTransformation(fromENU, matrix4Scratch);\n\n  let southMercatorY;\n  let oneOverMercatorHeight;\n  if (includeWebMercatorT) {\n    southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle(\n      geographicSouth\n    );\n    oneOverMercatorHeight =\n      1.0 /\n      (WebMercatorProjection.geodeticLatitudeToMercatorAngle(geographicNorth) -\n        southMercatorY);\n  }\n\n  const minimum = minimumScratch;\n  minimum.x = Number.POSITIVE_INFINITY;\n  minimum.y = Number.POSITIVE_INFINITY;\n  minimum.z = Number.POSITIVE_INFINITY;\n\n  const maximum = maximumScratch;\n  maximum.x = Number.NEGATIVE_INFINITY;\n  maximum.y = Number.NEGATIVE_INFINITY;\n  maximum.z = Number.NEGATIVE_INFINITY;\n\n  let hMin = Number.POSITIVE_INFINITY;\n\n  const gridVertexCount = width * height;\n  const edgeVertexCount = skirtHeight > 0.0 ? width * 2 + height * 2 : 0;\n  const vertexCount = gridVertexCount + edgeVertexCount;\n\n  const positions = new Array(vertexCount);\n  const heights = new Array(vertexCount);\n  const uvs = new Array(vertexCount);\n  const webMercatorTs = includeWebMercatorT ? new Array(vertexCount) : [];\n  const geodeticSurfaceNormals = includeGeodeticSurfaceNormals\n    ? new Array(vertexCount)\n    : [];\n\n  let startRow = 0;\n  let endRow = height;\n  let startCol = 0;\n  let endCol = width;\n\n  if (hasSkirts) {\n    --startRow;\n    ++endRow;\n    --startCol;\n    ++endCol;\n  }\n\n  const skirtOffsetPercentage = 0.00001;\n\n  for (let rowIndex = startRow; rowIndex < endRow; ++rowIndex) {\n    let row = rowIndex;\n    if (row < 0) {\n      row = 0;\n    }\n    if (row >= height) {\n      row = height - 1;\n    }\n\n    let latitude = nativeRectangle.north - granularityY * row;\n\n    if (!isGeographic) {\n      latitude =\n        piOverTwo - 2.0 * atan(exp(-latitude * oneOverGlobeSemimajorAxis));\n    } else {\n      latitude = toRadians(latitude);\n    }\n\n    let v = (latitude - geographicSouth) / (geographicNorth - geographicSouth);\n    v = CesiumMath.clamp(v, 0.0, 1.0);\n\n    const isNorthEdge = rowIndex === startRow;\n    const isSouthEdge = rowIndex === endRow - 1;\n    if (skirtHeight > 0.0) {\n      if (isNorthEdge) {\n        latitude += skirtOffsetPercentage * rectangleHeight;\n      } else if (isSouthEdge) {\n        latitude -= skirtOffsetPercentage * rectangleHeight;\n      }\n    }\n\n    const cosLatitude = cos(latitude);\n    const nZ = sin(latitude);\n    const kZ = radiiSquaredZ * nZ;\n\n    let webMercatorT;\n    if (includeWebMercatorT) {\n      webMercatorT =\n        (WebMercatorProjection.geodeticLatitudeToMercatorAngle(latitude) -\n          southMercatorY) *\n        oneOverMercatorHeight;\n    }\n\n    for (let colIndex = startCol; colIndex < endCol; ++colIndex) {\n      let col = colIndex;\n      if (col < 0) {\n        col = 0;\n      }\n      if (col >= width) {\n        col = width - 1;\n      }\n\n      const terrainOffset = row * (width * stride) + col * stride;\n\n      let heightSample;\n      if (elementsPerHeight === 1) {\n        heightSample = heightmap[terrainOffset];\n      } else {\n        heightSample = 0;\n\n        let elementOffset;\n        if (isBigEndian) {\n          for (\n            elementOffset = 0;\n            elementOffset < elementsPerHeight;\n            ++elementOffset\n          ) {\n            heightSample =\n              heightSample * elementMultiplier +\n              heightmap[terrainOffset + elementOffset];\n          }\n        } else {\n          for (\n            elementOffset = elementsPerHeight - 1;\n            elementOffset >= 0;\n            --elementOffset\n          ) {\n            heightSample =\n              heightSample * elementMultiplier +\n              heightmap[terrainOffset + elementOffset];\n          }\n        }\n      }\n\n      heightSample = heightSample * heightScale + heightOffset;\n\n      maximumHeight = Math.max(maximumHeight, heightSample);\n      minimumHeight = Math.min(minimumHeight, heightSample);\n\n      let longitude = nativeRectangle.west + granularityX * col;\n\n      if (!isGeographic) {\n        longitude = longitude * oneOverGlobeSemimajorAxis;\n      } else {\n        longitude = toRadians(longitude);\n      }\n\n      let u = (longitude - geographicWest) / (geographicEast - geographicWest);\n      u = CesiumMath.clamp(u, 0.0, 1.0);\n\n      let index = row * width + col;\n\n      if (skirtHeight > 0.0) {\n        const isWestEdge = colIndex === startCol;\n        const isEastEdge = colIndex === endCol - 1;\n        const isEdge = isNorthEdge || isSouthEdge || isWestEdge || isEastEdge;\n        const isCorner =\n          (isNorthEdge || isSouthEdge) && (isWestEdge || isEastEdge);\n        if (isCorner) {\n          // Don't generate skirts on the corners.\n          continue;\n        } else if (isEdge) {\n          heightSample -= skirtHeight;\n\n          if (isWestEdge) {\n            // The outer loop iterates north to south but the indices are ordered south to north, hence the index flip below\n            index = gridVertexCount + (height - row - 1);\n            longitude -= skirtOffsetPercentage * rectangleWidth;\n          } else if (isSouthEdge) {\n            // Add after west indices. South indices are ordered east to west.\n            index = gridVertexCount + height + (width - col - 1);\n          } else if (isEastEdge) {\n            // Add after west and south indices. East indices are ordered north to south. The index is flipped like above.\n            index = gridVertexCount + height + width + row;\n            longitude += skirtOffsetPercentage * rectangleWidth;\n          } else if (isNorthEdge) {\n            // Add after west, south, and east indices. North indices are ordered west to east.\n            index = gridVertexCount + height + width + height + col;\n          }\n        }\n      }\n\n      const nX = cosLatitude * cos(longitude);\n      const nY = cosLatitude * sin(longitude);\n\n      const kX = radiiSquaredX * nX;\n      const kY = radiiSquaredY * nY;\n\n      const gamma = sqrt(kX * nX + kY * nY + kZ * nZ);\n      const oneOverGamma = 1.0 / gamma;\n\n      const rSurfaceX = kX * oneOverGamma;\n      const rSurfaceY = kY * oneOverGamma;\n      const rSurfaceZ = kZ * oneOverGamma;\n\n      const position = new Cartesian3();\n      position.x = rSurfaceX + nX * heightSample;\n      position.y = rSurfaceY + nY * heightSample;\n      position.z = rSurfaceZ + nZ * heightSample;\n\n      Matrix4.multiplyByPoint(toENU, position, cartesian3Scratch);\n      Cartesian3.minimumByComponent(cartesian3Scratch, minimum, minimum);\n      Cartesian3.maximumByComponent(cartesian3Scratch, maximum, maximum);\n      hMin = Math.min(hMin, heightSample);\n\n      positions[index] = position;\n      uvs[index] = new Cartesian2(u, v);\n      heights[index] = heightSample;\n\n      if (includeWebMercatorT) {\n        webMercatorTs[index] = webMercatorT;\n      }\n\n      if (includeGeodeticSurfaceNormals) {\n        geodeticSurfaceNormals[index] = ellipsoid.geodeticSurfaceNormal(\n          position\n        );\n      }\n    }\n  }\n\n  const boundingSphere3D = BoundingSphere.fromPoints(positions);\n  let orientedBoundingBox;\n  if (defined(rectangle)) {\n    orientedBoundingBox = OrientedBoundingBox.fromRectangle(\n      rectangle,\n      minimumHeight,\n      maximumHeight,\n      ellipsoid\n    );\n  }\n\n  let occludeePointInScaledSpace;\n  if (hasRelativeToCenter) {\n    const occluder = new EllipsoidalOccluder(ellipsoid);\n    occludeePointInScaledSpace = occluder.computeHorizonCullingPointPossiblyUnderEllipsoid(\n      relativeToCenter,\n      positions,\n      minimumHeight\n    );\n  }\n\n  const aaBox = new AxisAlignedBoundingBox(minimum, maximum, relativeToCenter);\n  const encoding = new TerrainEncoding(\n    relativeToCenter,\n    aaBox,\n    hMin,\n    maximumHeight,\n    fromENU,\n    false,\n    includeWebMercatorT,\n    includeGeodeticSurfaceNormals,\n    exaggeration,\n    exaggerationRelativeHeight\n  );\n  const vertices = new Float32Array(vertexCount * encoding.stride);\n\n  let bufferIndex = 0;\n  for (let j = 0; j < vertexCount; ++j) {\n    bufferIndex = encoding.encode(\n      vertices,\n      bufferIndex,\n      positions[j],\n      uvs[j],\n      heights[j],\n      undefined,\n      webMercatorTs[j],\n      geodeticSurfaceNormals[j]\n    );\n  }\n\n  return {\n    vertices: vertices,\n    maximumHeight: maximumHeight,\n    minimumHeight: minimumHeight,\n    encoding: encoding,\n    boundingSphere3D: boundingSphere3D,\n    orientedBoundingBox: orientedBoundingBox,\n    occludeePointInScaledSpace: occludeePointInScaledSpace,\n  };\n};\nexport default HeightmapTessellator;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Terrain data for a single tile.  This type describes an\n * interface and is not intended to be instantiated directly.\n *\n * @alias TerrainData\n * @constructor\n *\n * @see HeightmapTerrainData\n * @see QuantizedMeshTerrainData\n * @see GoogleEarthEnterpriseTerrainData\n */\nfunction TerrainData() {\n  DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(TerrainData.prototype, {\n  /**\n   * An array of credits for this tile.\n   * @memberof TerrainData.prototype\n   * @type {Credit[]}\n   */\n  credits: {\n    get: DeveloperError.throwInstantiationError,\n  },\n  /**\n   * The water mask included in this terrain data, if any.  A water mask is a rectangular\n   * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.\n   * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.\n   * @memberof TerrainData.prototype\n   * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement}\n   */\n  waterMask: {\n    get: DeveloperError.throwInstantiationError,\n  },\n});\n\n/**\n * Computes the terrain height at a specified longitude and latitude.\n * @function\n *\n * @param {Rectangle} rectangle The rectangle covered by this terrain data.\n * @param {number} longitude The longitude in radians.\n * @param {number} latitude The latitude in radians.\n * @returns {number} The terrain height at the specified position.  If the position\n *          is outside the rectangle, this method will extrapolate the height, which is likely to be wildly\n *          incorrect for positions far outside the rectangle.\n */\nTerrainData.prototype.interpolateHeight =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Determines if a given child tile is available, based on the\n * {@link TerrainData#childTileMask}.  The given child tile coordinates are assumed\n * to be one of the four children of this tile.  If non-child tile coordinates are\n * given, the availability of the southeast child tile is returned.\n * @function\n *\n * @param {number} thisX The tile X coordinate of this (the parent) tile.\n * @param {number} thisY The tile Y coordinate of this (the parent) tile.\n * @param {number} childX The tile X coordinate of the child tile to check for availability.\n * @param {number} childY The tile Y coordinate of the child tile to check for availability.\n * @returns {boolean} True if the child tile is available; otherwise, false.\n */\nTerrainData.prototype.isChildAvailable = DeveloperError.throwInstantiationError;\n\n/**\n * Creates a {@link TerrainMesh} from this terrain data.\n * @function\n *\n * @private\n *\n * @param {object} options Object with the following properties:\n * @param {TilingScheme} options.tilingScheme The tiling scheme to which this tile belongs.\n * @param {number} options.x The X coordinate of the tile for which to create the terrain data.\n * @param {number} options.y The Y coordinate of the tile for which to create the terrain data.\n * @param {number} options.level The level of the tile for which to create the terrain data.\n * @param {number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.\n * @param {number} [options.exaggerationRelativeHeight=0.0] The height relative to which terrain is exaggerated.\n * @param {boolean} [options.throttle=true] If true, indicates that this operation will need to be retried if too many asynchronous mesh creations are already in progress.\n * @returns {Promise<TerrainMesh>|undefined} A promise for the terrain mesh, or undefined if too many\n *          asynchronous mesh creations are already in progress and the operation should\n *          be retried later.\n */\nTerrainData.prototype.createMesh = DeveloperError.throwInstantiationError;\n\n/**\n * Upsamples this terrain data for use by a descendant tile.\n * @function\n *\n * @param {TilingScheme} tilingScheme The tiling scheme of this terrain data.\n * @param {number} thisX The X coordinate of this tile in the tiling scheme.\n * @param {number} thisY The Y coordinate of this tile in the tiling scheme.\n * @param {number} thisLevel The level of this tile in the tiling scheme.\n * @param {number} descendantX The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {number} descendantY The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {number} descendantLevel The level within the tiling scheme of the descendant tile for which we are upsampling.\n * @returns {Promise<TerrainData>|undefined} A promise for upsampled terrain data for the descendant tile,\n *          or undefined if too many asynchronous upsample operations are in progress and the request has been\n *          deferred.\n */\nTerrainData.prototype.upsample = DeveloperError.throwInstantiationError;\n\n/**\n * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution\n * terrain data.  If this value is false, the data was obtained from some other source, such\n * as by downloading it from a remote server.  This method should return true for instances\n * returned from a call to {@link TerrainData#upsample}.\n * @function\n *\n * @returns {boolean} True if this instance was created by upsampling; otherwise, false.\n */\nTerrainData.prototype.wasCreatedByUpsampling =\n  DeveloperError.throwInstantiationError;\n\n/**\n * The maximum number of asynchronous tasks used for terrain processing.\n *\n * @type {number}\n * @private\n */\nTerrainData.maximumAsynchronousTasks = 5;\n\nexport default TerrainData;\n", "import defaultValue from \"./defaultValue.js\";\n\n/**\n * A mesh plus related metadata for a single tile of terrain.  Instances of this type are\n * usually created from raw {@link TerrainData}.\n *\n * @alias TerrainMesh\n * @constructor\n *\n * @param {Cartesian3} center The center of the tile.  Vertex positions are specified relative to this center.\n * @param {Float32Array} vertices The vertex data, including positions, texture coordinates, and heights.\n *                       The vertex data is in the order [X, Y, Z, H, U, V], where X, Y, and Z represent\n *                       the Cartesian position of the vertex, H is the height above the ellipsoid, and\n *                       U and V are the texture coordinates.\n * @param {Uint8Array|Uint16Array|Uint32Array} indices The indices describing how the vertices are connected to form triangles.\n * @param {number} indexCountWithoutSkirts The index count of the mesh not including skirts.\n * @param {number} vertexCountWithoutSkirts The vertex count of the mesh not including skirts.\n * @param {number} minimumHeight The lowest height in the tile, in meters above the ellipsoid.\n * @param {number} maximumHeight The highest height in the tile, in meters above the ellipsoid.\n * @param {BoundingSphere} boundingSphere3D A bounding sphere that completely contains the tile.\n * @param {Cartesian3} occludeePointInScaledSpace The occludee point of the tile, represented in ellipsoid-\n *                     scaled space, and used for horizon culling.  If this point is below the horizon,\n *                     the tile is considered to be entirely below the horizon.\n * @param {number} [vertexStride=6] The number of components in each vertex.\n * @param {OrientedBoundingBox} [orientedBoundingBox] A bounding box that completely contains the tile.\n * @param {TerrainEncoding} encoding Information used to decode the mesh.\n * @param {number[]} westIndicesSouthToNorth The indices of the vertices on the Western edge of the tile, ordered from South to North (clockwise).\n * @param {number[]} southIndicesEastToWest The indices of the vertices on the Southern edge of the tile, ordered from East to West (clockwise).\n * @param {number[]} eastIndicesNorthToSouth The indices of the vertices on the Eastern edge of the tile, ordered from North to South (clockwise).\n * @param {number[]} northIndicesWestToEast The indices of the vertices on the Northern edge of the tile, ordered from West to East (clockwise).\n *\n * @private\n */\nfunction TerrainMesh(\n  center,\n  vertices,\n  indices,\n  indexCountWithoutSkirts,\n  vertexCountWithoutSkirts,\n  minimumHeight,\n  maximumHeight,\n  boundingSphere3D,\n  occludeePointInScaledSpace,\n  vertexStride,\n  orientedBoundingBox,\n  encoding,\n  westIndicesSouthToNorth,\n  southIndicesEastToWest,\n  eastIndicesNorthToSouth,\n  northIndicesWestToEast\n) {\n  /**\n   * The center of the tile.  Vertex positions are specified relative to this center.\n   * @type {Cartesian3}\n   */\n  this.center = center;\n\n  /**\n   * The vertex data, including positions, texture coordinates, and heights.\n   * The vertex data is in the order [X, Y, Z, H, U, V], where X, Y, and Z represent\n   * the Cartesian position of the vertex, H is the height above the ellipsoid, and\n   * U and V are the texture coordinates.  The vertex data may have additional attributes after those\n   * mentioned above when the {@link TerrainMesh#stride} is greater than 6.\n   * @type {Float32Array}\n   */\n  this.vertices = vertices;\n\n  /**\n   * The number of components in each vertex.  Typically this is 6 for the 6 components\n   * [X, Y, Z, H, U, V], but if each vertex has additional data (such as a vertex normal), this value\n   * may be higher.\n   * @type {number}\n   */\n  this.stride = defaultValue(vertexStride, 6);\n\n  /**\n   * The indices describing how the vertices are connected to form triangles.\n   * @type {Uint8Array|Uint16Array|Uint32Array}\n   */\n  this.indices = indices;\n\n  /**\n   * The index count of the mesh not including skirts.\n   * @type {number}\n   */\n  this.indexCountWithoutSkirts = indexCountWithoutSkirts;\n\n  /**\n   * The vertex count of the mesh not including skirts.\n   * @type {number}\n   */\n  this.vertexCountWithoutSkirts = vertexCountWithoutSkirts;\n\n  /**\n   * The lowest height in the tile, in meters above the ellipsoid.\n   * @type {number}\n   */\n  this.minimumHeight = minimumHeight;\n\n  /**\n   * The highest height in the tile, in meters above the ellipsoid.\n   * @type {number}\n   */\n  this.maximumHeight = maximumHeight;\n\n  /**\n   * A bounding sphere that completely contains the tile.\n   * @type {BoundingSphere}\n   */\n  this.boundingSphere3D = boundingSphere3D;\n\n  /**\n   * The occludee point of the tile, represented in ellipsoid-\n   * scaled space, and used for horizon culling.  If this point is below the horizon,\n   * the tile is considered to be entirely below the horizon.\n   * @type {Cartesian3}\n   */\n  this.occludeePointInScaledSpace = occludeePointInScaledSpace;\n\n  /**\n   * A bounding box that completely contains the tile.\n   * @type {OrientedBoundingBox}\n   */\n  this.orientedBoundingBox = orientedBoundingBox;\n\n  /**\n   * Information for decoding the mesh vertices.\n   * @type {TerrainEncoding}\n   */\n  this.encoding = encoding;\n\n  /**\n   * The indices of the vertices on the Western edge of the tile, ordered from South to North (clockwise).\n   * @type {number[]}\n   */\n  this.westIndicesSouthToNorth = westIndicesSouthToNorth;\n\n  /**\n   * The indices of the vertices on the Southern edge of the tile, ordered from East to West (clockwise).\n   * @type {number[]}\n   */\n  this.southIndicesEastToWest = southIndicesEastToWest;\n\n  /**\n   * The indices of the vertices on the Eastern edge of the tile, ordered from North to South (clockwise).\n   * @type {number[]}\n   */\n  this.eastIndicesNorthToSouth = eastIndicesNorthToSouth;\n\n  /**\n   * The indices of the vertices on the Northern edge of the tile, ordered from West to East (clockwise).\n   * @type {number[]}\n   */\n  this.northIndicesWestToEast = northIndicesWestToEast;\n}\nexport default TerrainMesh;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * Provides terrain or other geometry for the surface of an ellipsoid.  The surface geometry is\n * organized into a pyramid of tiles according to a {@link TilingScheme}.  This type describes an\n * interface and is not intended to be instantiated directly.\n *\n * @alias TerrainProvider\n * @constructor\n *\n * @see EllipsoidTerrainProvider\n * @see CesiumTerrainProvider\n * @see VRTheWorldTerrainProvider\n * @see GoogleEarthEnterpriseTerrainProvider\n */\nfunction TerrainProvider() {\n  DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(TerrainProvider.prototype, {\n  /**\n   * Gets an event that is raised when the terrain provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof TerrainProvider.prototype\n   * @type {Event<TerrainProvider.ErrorEvent>}\n   * @readonly\n   */\n  errorEvent: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the credit to display when this terrain provider is active.  Typically this is used to credit\n   * the source of the terrain.\n   * @memberof TerrainProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the tiling scheme used by the provider.\n   * @memberof TerrainProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets a value indicating whether or not the provider includes a water mask.  The water mask\n   * indicates which areas of the globe are water rather than land, so they can be rendered\n   * as a reflective surface with animated waves.\n   * @memberof TerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasWaterMask: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets a value indicating whether or not the requested tiles include vertex normals.\n   * @memberof TerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasVertexNormals: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets an object that can be used to determine availability of terrain from this provider, such as\n   * at points and in rectangles. This property may be undefined if availability\n   * information is not available.\n   * @memberof TerrainProvider.prototype\n   * @type {TileAvailability}\n   * @readonly\n   */\n  availability: {\n    get: DeveloperError.throwInstantiationError,\n  },\n});\n\nconst regularGridIndicesCache = [];\n\n/**\n * Gets a list of indices for a triangle mesh representing a regular grid.  Calling\n * this function multiple times with the same grid width and height returns the\n * same list of indices.  The total number of vertices must be less than or equal\n * to 65536.\n *\n * @param {number} width The number of vertices in the regular grid in the horizontal direction.\n * @param {number} height The number of vertices in the regular grid in the vertical direction.\n * @returns {Uint16Array|Uint32Array} The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less.\n */\nTerrainProvider.getRegularGridIndices = function (width, height) {\n  //>>includeStart('debug', pragmas.debug);\n  if (width * height >= CesiumMath.FOUR_GIGABYTES) {\n    throw new DeveloperError(\n      \"The total number of vertices (width * height) must be less than 4,294,967,296.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  let byWidth = regularGridIndicesCache[width];\n  if (!defined(byWidth)) {\n    regularGridIndicesCache[width] = byWidth = [];\n  }\n\n  let indices = byWidth[height];\n  if (!defined(indices)) {\n    if (width * height < CesiumMath.SIXTY_FOUR_KILOBYTES) {\n      indices = byWidth[height] = new Uint16Array(\n        (width - 1) * (height - 1) * 6\n      );\n    } else {\n      indices = byWidth[height] = new Uint32Array(\n        (width - 1) * (height - 1) * 6\n      );\n    }\n    addRegularGridIndices(width, height, indices, 0);\n  }\n\n  return indices;\n};\n\nconst regularGridAndEdgeIndicesCache = [];\n\n/**\n * @private\n */\nTerrainProvider.getRegularGridIndicesAndEdgeIndices = function (width, height) {\n  //>>includeStart('debug', pragmas.debug);\n  if (width * height >= CesiumMath.FOUR_GIGABYTES) {\n    throw new DeveloperError(\n      \"The total number of vertices (width * height) must be less than 4,294,967,296.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  let byWidth = regularGridAndEdgeIndicesCache[width];\n  if (!defined(byWidth)) {\n    regularGridAndEdgeIndicesCache[width] = byWidth = [];\n  }\n\n  let indicesAndEdges = byWidth[height];\n  if (!defined(indicesAndEdges)) {\n    const indices = TerrainProvider.getRegularGridIndices(width, height);\n\n    const edgeIndices = getEdgeIndices(width, height);\n    const westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth;\n    const southIndicesEastToWest = edgeIndices.southIndicesEastToWest;\n    const eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth;\n    const northIndicesWestToEast = edgeIndices.northIndicesWestToEast;\n\n    indicesAndEdges = byWidth[height] = {\n      indices: indices,\n      westIndicesSouthToNorth: westIndicesSouthToNorth,\n      southIndicesEastToWest: southIndicesEastToWest,\n      eastIndicesNorthToSouth: eastIndicesNorthToSouth,\n      northIndicesWestToEast: northIndicesWestToEast,\n    };\n  }\n\n  return indicesAndEdges;\n};\n\nconst regularGridAndSkirtAndEdgeIndicesCache = [];\n\n/**\n * @private\n */\nTerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices = function (\n  width,\n  height\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (width * height >= CesiumMath.FOUR_GIGABYTES) {\n    throw new DeveloperError(\n      \"The total number of vertices (width * height) must be less than 4,294,967,296.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  let byWidth = regularGridAndSkirtAndEdgeIndicesCache[width];\n  if (!defined(byWidth)) {\n    regularGridAndSkirtAndEdgeIndicesCache[width] = byWidth = [];\n  }\n\n  let indicesAndEdges = byWidth[height];\n  if (!defined(indicesAndEdges)) {\n    const gridVertexCount = width * height;\n    const gridIndexCount = (width - 1) * (height - 1) * 6;\n    const edgeVertexCount = width * 2 + height * 2;\n    const edgeIndexCount = Math.max(0, edgeVertexCount - 4) * 6;\n    const vertexCount = gridVertexCount + edgeVertexCount;\n    const indexCount = gridIndexCount + edgeIndexCount;\n\n    const edgeIndices = getEdgeIndices(width, height);\n    const westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth;\n    const southIndicesEastToWest = edgeIndices.southIndicesEastToWest;\n    const eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth;\n    const northIndicesWestToEast = edgeIndices.northIndicesWestToEast;\n\n    const indices = IndexDatatype.createTypedArray(vertexCount, indexCount);\n    addRegularGridIndices(width, height, indices, 0);\n    TerrainProvider.addSkirtIndices(\n      westIndicesSouthToNorth,\n      southIndicesEastToWest,\n      eastIndicesNorthToSouth,\n      northIndicesWestToEast,\n      gridVertexCount,\n      indices,\n      gridIndexCount\n    );\n\n    indicesAndEdges = byWidth[height] = {\n      indices: indices,\n      westIndicesSouthToNorth: westIndicesSouthToNorth,\n      southIndicesEastToWest: southIndicesEastToWest,\n      eastIndicesNorthToSouth: eastIndicesNorthToSouth,\n      northIndicesWestToEast: northIndicesWestToEast,\n      indexCountWithoutSkirts: gridIndexCount,\n    };\n  }\n\n  return indicesAndEdges;\n};\n\n/**\n * @private\n */\nTerrainProvider.addSkirtIndices = function (\n  westIndicesSouthToNorth,\n  southIndicesEastToWest,\n  eastIndicesNorthToSouth,\n  northIndicesWestToEast,\n  vertexCount,\n  indices,\n  offset\n) {\n  let vertexIndex = vertexCount;\n  offset = addSkirtIndices(\n    westIndicesSouthToNorth,\n    vertexIndex,\n    indices,\n    offset\n  );\n  vertexIndex += westIndicesSouthToNorth.length;\n  offset = addSkirtIndices(\n    southIndicesEastToWest,\n    vertexIndex,\n    indices,\n    offset\n  );\n  vertexIndex += southIndicesEastToWest.length;\n  offset = addSkirtIndices(\n    eastIndicesNorthToSouth,\n    vertexIndex,\n    indices,\n    offset\n  );\n  vertexIndex += eastIndicesNorthToSouth.length;\n  addSkirtIndices(northIndicesWestToEast, vertexIndex, indices, offset);\n};\n\nfunction getEdgeIndices(width, height) {\n  const westIndicesSouthToNorth = new Array(height);\n  const southIndicesEastToWest = new Array(width);\n  const eastIndicesNorthToSouth = new Array(height);\n  const northIndicesWestToEast = new Array(width);\n\n  let i;\n  for (i = 0; i < width; ++i) {\n    northIndicesWestToEast[i] = i;\n    southIndicesEastToWest[i] = width * height - 1 - i;\n  }\n\n  for (i = 0; i < height; ++i) {\n    eastIndicesNorthToSouth[i] = (i + 1) * width - 1;\n    westIndicesSouthToNorth[i] = (height - i - 1) * width;\n  }\n\n  return {\n    westIndicesSouthToNorth: westIndicesSouthToNorth,\n    southIndicesEastToWest: southIndicesEastToWest,\n    eastIndicesNorthToSouth: eastIndicesNorthToSouth,\n    northIndicesWestToEast: northIndicesWestToEast,\n  };\n}\n\nfunction addRegularGridIndices(width, height, indices, offset) {\n  let index = 0;\n  for (let j = 0; j < height - 1; ++j) {\n    for (let i = 0; i < width - 1; ++i) {\n      const upperLeft = index;\n      const lowerLeft = upperLeft + width;\n      const lowerRight = lowerLeft + 1;\n      const upperRight = upperLeft + 1;\n\n      indices[offset++] = upperLeft;\n      indices[offset++] = lowerLeft;\n      indices[offset++] = upperRight;\n      indices[offset++] = upperRight;\n      indices[offset++] = lowerLeft;\n      indices[offset++] = lowerRight;\n\n      ++index;\n    }\n    ++index;\n  }\n}\n\nfunction addSkirtIndices(edgeIndices, vertexIndex, indices, offset) {\n  let previousIndex = edgeIndices[0];\n\n  const length = edgeIndices.length;\n  for (let i = 1; i < length; ++i) {\n    const index = edgeIndices[i];\n\n    indices[offset++] = previousIndex;\n    indices[offset++] = index;\n    indices[offset++] = vertexIndex;\n\n    indices[offset++] = vertexIndex;\n    indices[offset++] = index;\n    indices[offset++] = vertexIndex + 1;\n\n    previousIndex = index;\n    ++vertexIndex;\n  }\n\n  return offset;\n}\n\n/**\n * Specifies the quality of terrain created from heightmaps.  A value of 1.0 will\n * ensure that adjacent heightmap vertices are separated by no more than\n * {@link Globe.maximumScreenSpaceError} screen pixels and will probably go very slowly.\n * A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the\n * screen pixels between adjacent heightmap vertices and thus rendering more quickly.\n * @type {number}\n */\nTerrainProvider.heightmapTerrainQuality = 0.25;\n\n/**\n * Determines an appropriate geometric error estimate when the geometry comes from a heightmap.\n *\n * @param {Ellipsoid} ellipsoid The ellipsoid to which the terrain is attached.\n * @param {number} tileImageWidth The width, in pixels, of the heightmap associated with a single tile.\n * @param {number} numberOfTilesAtLevelZero The number of tiles in the horizontal direction at tile level zero.\n * @returns {number} An estimated geometric error.\n */\nTerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap = function (\n  ellipsoid,\n  tileImageWidth,\n  numberOfTilesAtLevelZero\n) {\n  return (\n    (ellipsoid.maximumRadius *\n      2 *\n      Math.PI *\n      TerrainProvider.heightmapTerrainQuality) /\n    (tileImageWidth * numberOfTilesAtLevelZero)\n  );\n};\n\n/**\n * Requests the geometry for a given tile. The result must include terrain data and\n * may optionally include a water mask and an indication of which child tiles are available.\n * @function\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @param {Request} [request] The request object. Intended for internal use only.\n *\n * @returns {Promise<TerrainData>|undefined} A promise for the requested geometry.  If this method\n *          returns undefined instead of a promise, it is an indication that too many requests are already\n *          pending and the request will be retried later.\n */\nTerrainProvider.prototype.requestTileGeometry =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level.\n * @function\n *\n * @param {number} level The tile level for which to get the maximum geometric error.\n * @returns {number} The maximum geometric error.\n */\nTerrainProvider.prototype.getLevelMaximumGeometricError =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Determines whether data for a tile is available to be loaded.\n * @function\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @returns {boolean|undefined} Undefined if not supported by the terrain provider, otherwise true or false.\n */\nTerrainProvider.prototype.getTileDataAvailable =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Makes sure we load availability data for a tile\n * @function\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @returns {undefined|Promise<void>} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded\n */\nTerrainProvider.prototype.loadTileDataAvailability =\n  DeveloperError.throwInstantiationError;\nexport default TerrainProvider;\n\n/**\n * A function that is called when an error occurs.\n * @callback TerrainProvider.ErrorEvent\n *\n * @this TerrainProvider\n * @param {TileProviderError} err An object holding details about the error that occurred.\n */\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport HeightmapEncoding from \"./HeightmapEncoding.js\";\nimport HeightmapTessellator from \"./HeightmapTessellator.js\";\nimport CesiumMath from \"./Math.js\";\nimport OrientedBoundingBox from \"./OrientedBoundingBox.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport TaskProcessor from \"./TaskProcessor.js\";\nimport TerrainData from \"./TerrainData.js\";\nimport TerrainEncoding from \"./TerrainEncoding.js\";\nimport TerrainMesh from \"./TerrainMesh.js\";\nimport TerrainProvider from \"./TerrainProvider.js\";\n\n/**\n * Terrain data for a single tile where the terrain data is represented as a heightmap.  A heightmap\n * is a rectangular array of heights in row-major order from north to south and west to east.\n *\n * @alias HeightmapTerrainData\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} options.buffer The buffer containing height data.\n * @param {number} options.width The width (longitude direction) of the heightmap, in samples.\n * @param {number} options.height The height (latitude direction) of the heightmap, in samples.\n * @param {number} [options.childTileMask=15] A bit mask indicating which of this tile's four children exist.\n *                 If a child's bit is set, geometry will be requested for that tile as well when it\n *                 is needed.  If the bit is cleared, the child tile is not requested and geometry is\n *                 instead upsampled from the parent.  The bit values are as follows:\n *                 <table>\n *                  <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>\n *                  <tr><td>0</td><td>1</td><td>Southwest</td></tr>\n *                  <tr><td>1</td><td>2</td><td>Southeast</td></tr>\n *                  <tr><td>2</td><td>4</td><td>Northwest</td></tr>\n *                  <tr><td>3</td><td>8</td><td>Northeast</td></tr>\n *                 </table>\n * @param {Uint8Array} [options.waterMask] The water mask included in this terrain data, if any.  A water mask is a square\n *                     Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.\n *                     Values in between 0 and 255 are allowed as well to smoothly blend between land and water.\n * @param {object} [options.structure] An object describing the structure of the height data.\n * @param {number} [options.structure.heightScale=1.0] The factor by which to multiply height samples in order to obtain\n *                 the height above the heightOffset, in meters.  The heightOffset is added to the resulting\n *                 height after multiplying by the scale.\n * @param {number} [options.structure.heightOffset=0.0] The offset to add to the scaled height to obtain the final\n *                 height in meters.  The offset is added after the height sample is multiplied by the\n *                 heightScale.\n * @param {number} [options.structure.elementsPerHeight=1] The number of elements in the buffer that make up a single height\n *                 sample.  This is usually 1, indicating that each element is a separate height sample.  If\n *                 it is greater than 1, that number of elements together form the height sample, which is\n *                 computed according to the structure.elementMultiplier and structure.isBigEndian properties.\n * @param {number} [options.structure.stride=1] The number of elements to skip to get from the first element of\n *                 one height to the first element of the next height.\n * @param {number} [options.structure.elementMultiplier=256.0] The multiplier used to compute the height value when the\n *                 stride property is greater than 1.  For example, if the stride is 4 and the strideMultiplier\n *                 is 256, the height is computed as follows:\n *                 `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256`\n *                 This is assuming that the isBigEndian property is false.  If it is true, the order of the\n *                 elements is reversed.\n * @param {boolean} [options.structure.isBigEndian=false] Indicates endianness of the elements in the buffer when the\n *                  stride property is greater than 1.  If this property is false, the first element is the\n *                  low-order element.  If it is true, the first element is the high-order element.\n * @param {number} [options.structure.lowestEncodedHeight] The lowest value that can be stored in the height buffer.  Any heights that are lower\n *                 than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value.  For example, if the height\n *                 buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers.  If this parameter is\n *                 not specified, no minimum value is enforced.\n * @param {number} [options.structure.highestEncodedHeight] The highest value that can be stored in the height buffer.  Any heights that are higher\n *                 than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value.  For example, if the height\n *                 buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger\n *                 than 65535.  If this parameter is not specified, no maximum value is enforced.\n * @param {HeightmapEncoding} [options.encoding=HeightmapEncoding.NONE] The encoding that is used on the buffer.\n * @param {boolean} [options.createdByUpsampling=false] True if this instance was created by upsampling another instance;\n *                  otherwise, false.\n *\n *\n * @example\n * const buffer = ...\n * const heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth * that._heightmapWidth);\n * const childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0];\n * const waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength - 1);\n * const terrainData = new Cesium.HeightmapTerrainData({\n *   buffer : heightBuffer,\n *   width : 65,\n *   height : 65,\n *   childTileMask : childTileMask,\n *   waterMask : waterMask\n * });\n *\n * @see TerrainData\n * @see QuantizedMeshTerrainData\n * @see GoogleEarthEnterpriseTerrainData\n */\nfunction HeightmapTerrainData(options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options) || !defined(options.buffer)) {\n    throw new DeveloperError(\"options.buffer is required.\");\n  }\n  if (!defined(options.width)) {\n    throw new DeveloperError(\"options.width is required.\");\n  }\n  if (!defined(options.height)) {\n    throw new DeveloperError(\"options.height is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._buffer = options.buffer;\n  this._width = options.width;\n  this._height = options.height;\n  this._childTileMask = defaultValue(options.childTileMask, 15);\n  this._encoding = defaultValue(options.encoding, HeightmapEncoding.NONE);\n\n  const defaultStructure = HeightmapTessellator.DEFAULT_STRUCTURE;\n  let structure = options.structure;\n  if (!defined(structure)) {\n    structure = defaultStructure;\n  } else if (structure !== defaultStructure) {\n    structure.heightScale = defaultValue(\n      structure.heightScale,\n      defaultStructure.heightScale\n    );\n    structure.heightOffset = defaultValue(\n      structure.heightOffset,\n      defaultStructure.heightOffset\n    );\n    structure.elementsPerHeight = defaultValue(\n      structure.elementsPerHeight,\n      defaultStructure.elementsPerHeight\n    );\n    structure.stride = defaultValue(structure.stride, defaultStructure.stride);\n    structure.elementMultiplier = defaultValue(\n      structure.elementMultiplier,\n      defaultStructure.elementMultiplier\n    );\n    structure.isBigEndian = defaultValue(\n      structure.isBigEndian,\n      defaultStructure.isBigEndian\n    );\n  }\n\n  this._structure = structure;\n  this._createdByUpsampling = defaultValue(options.createdByUpsampling, false);\n  this._waterMask = options.waterMask;\n\n  this._skirtHeight = undefined;\n  this._bufferType =\n    this._encoding === HeightmapEncoding.LERC\n      ? Float32Array\n      : this._buffer.constructor;\n  this._mesh = undefined;\n}\n\nObject.defineProperties(HeightmapTerrainData.prototype, {\n  /**\n   * An array of credits for this tile.\n   * @memberof HeightmapTerrainData.prototype\n   * @type {Credit[]}\n   */\n  credits: {\n    get: function () {\n      return undefined;\n    },\n  },\n  /**\n   * The water mask included in this terrain data, if any.  A water mask is a square\n   * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.\n   * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.\n   * @memberof HeightmapTerrainData.prototype\n   * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement}\n   */\n  waterMask: {\n    get: function () {\n      return this._waterMask;\n    },\n  },\n\n  childTileMask: {\n    get: function () {\n      return this._childTileMask;\n    },\n  },\n});\n\nconst createMeshTaskName = \"createVerticesFromHeightmap\";\nconst createMeshTaskProcessorNoThrottle = new TaskProcessor(createMeshTaskName);\nconst createMeshTaskProcessorThrottle = new TaskProcessor(\n  createMeshTaskName,\n  TerrainData.maximumAsynchronousTasks\n);\n\n/**\n * Creates a {@link TerrainMesh} from this terrain data.\n *\n * @private\n *\n * @param {object} options Object with the following properties:\n * @param {TilingScheme} options.tilingScheme The tiling scheme to which this tile belongs.\n * @param {number} options.x The X coordinate of the tile for which to create the terrain data.\n * @param {number} options.y The Y coordinate of the tile for which to create the terrain data.\n * @param {number} options.level The level of the tile for which to create the terrain data.\n * @param {number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.\n * @param {number} [options.exaggerationRelativeHeight=0.0] The height relative to which terrain is exaggerated.\n * @param {boolean} [options.throttle=true] If true, indicates that this operation will need to be retried if too many asynchronous mesh creations are already in progress.\n * @returns {Promise<TerrainMesh>|undefined} A promise for the terrain mesh, or undefined if too many\n *          asynchronous mesh creations are already in progress and the operation should\n *          be retried later.\n */\nHeightmapTerrainData.prototype.createMesh = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.tilingScheme\", options.tilingScheme);\n  Check.typeOf.number(\"options.x\", options.x);\n  Check.typeOf.number(\"options.y\", options.y);\n  Check.typeOf.number(\"options.level\", options.level);\n  //>>includeEnd('debug');\n\n  const tilingScheme = options.tilingScheme;\n  const x = options.x;\n  const y = options.y;\n  const level = options.level;\n  const exaggeration = defaultValue(options.exaggeration, 1.0);\n  const exaggerationRelativeHeight = defaultValue(\n    options.exaggerationRelativeHeight,\n    0.0\n  );\n  const throttle = defaultValue(options.throttle, true);\n\n  const ellipsoid = tilingScheme.ellipsoid;\n  const nativeRectangle = tilingScheme.tileXYToNativeRectangle(x, y, level);\n  const rectangle = tilingScheme.tileXYToRectangle(x, y, level);\n\n  // Compute the center of the tile for RTC rendering.\n  const center = ellipsoid.cartographicToCartesian(Rectangle.center(rectangle));\n\n  const structure = this._structure;\n\n  const levelZeroMaxError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(\n    ellipsoid,\n    this._width,\n    tilingScheme.getNumberOfXTilesAtLevel(0)\n  );\n  const thisLevelMaxError = levelZeroMaxError / (1 << level);\n  this._skirtHeight = Math.min(thisLevelMaxError * 4.0, 1000.0);\n\n  const createMeshTaskProcessor = throttle\n    ? createMeshTaskProcessorThrottle\n    : createMeshTaskProcessorNoThrottle;\n\n  const verticesPromise = createMeshTaskProcessor.scheduleTask({\n    heightmap: this._buffer,\n    structure: structure,\n    includeWebMercatorT: true,\n    width: this._width,\n    height: this._height,\n    nativeRectangle: nativeRectangle,\n    rectangle: rectangle,\n    relativeToCenter: center,\n    ellipsoid: ellipsoid,\n    skirtHeight: this._skirtHeight,\n    isGeographic: tilingScheme.projection instanceof GeographicProjection,\n    exaggeration: exaggeration,\n    exaggerationRelativeHeight: exaggerationRelativeHeight,\n    encoding: this._encoding,\n  });\n\n  if (!defined(verticesPromise)) {\n    // Postponed\n    return undefined;\n  }\n\n  const that = this;\n  return Promise.resolve(verticesPromise).then(function (result) {\n    let indicesAndEdges;\n    if (that._skirtHeight > 0.0) {\n      indicesAndEdges = TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices(\n        result.gridWidth,\n        result.gridHeight\n      );\n    } else {\n      indicesAndEdges = TerrainProvider.getRegularGridIndicesAndEdgeIndices(\n        result.gridWidth,\n        result.gridHeight\n      );\n    }\n\n    const vertexCountWithoutSkirts = result.gridWidth * result.gridHeight;\n\n    // Clone complex result objects because the transfer from the web worker\n    // has stripped them down to JSON-style objects.\n    that._mesh = new TerrainMesh(\n      center,\n      new Float32Array(result.vertices),\n      indicesAndEdges.indices,\n      indicesAndEdges.indexCountWithoutSkirts,\n      vertexCountWithoutSkirts,\n      result.minimumHeight,\n      result.maximumHeight,\n      BoundingSphere.clone(result.boundingSphere3D),\n      Cartesian3.clone(result.occludeePointInScaledSpace),\n      result.numberOfAttributes,\n      OrientedBoundingBox.clone(result.orientedBoundingBox),\n      TerrainEncoding.clone(result.encoding),\n      indicesAndEdges.westIndicesSouthToNorth,\n      indicesAndEdges.southIndicesEastToWest,\n      indicesAndEdges.eastIndicesNorthToSouth,\n      indicesAndEdges.northIndicesWestToEast\n    );\n\n    // Free memory received from server after mesh is created.\n    that._buffer = undefined;\n    return that._mesh;\n  });\n};\n\n/**\n * @param {object} options Object with the following properties:\n * @param {TilingScheme} options.tilingScheme The tiling scheme to which this tile belongs.\n * @param {number} options.x The X coordinate of the tile for which to create the terrain data.\n * @param {number} options.y The Y coordinate of the tile for which to create the terrain data.\n * @param {number} options.level The level of the tile for which to create the terrain data.\n * @param {number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.\n * @param {number} [options.exaggerationRelativeHeight=0.0] The height relative to which terrain is exaggerated.\n *\n * @private\n */\nHeightmapTerrainData.prototype._createMeshSync = function (options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.tilingScheme\", options.tilingScheme);\n  Check.typeOf.number(\"options.x\", options.x);\n  Check.typeOf.number(\"options.y\", options.y);\n  Check.typeOf.number(\"options.level\", options.level);\n  //>>includeEnd('debug');\n\n  const tilingScheme = options.tilingScheme;\n  const x = options.x;\n  const y = options.y;\n  const level = options.level;\n  const exaggeration = defaultValue(options.exaggeration, 1.0);\n  const exaggerationRelativeHeight = defaultValue(\n    options.exaggerationRelativeHeight,\n    0.0\n  );\n\n  const ellipsoid = tilingScheme.ellipsoid;\n  const nativeRectangle = tilingScheme.tileXYToNativeRectangle(x, y, level);\n  const rectangle = tilingScheme.tileXYToRectangle(x, y, level);\n\n  // Compute the center of the tile for RTC rendering.\n  const center = ellipsoid.cartographicToCartesian(Rectangle.center(rectangle));\n\n  const structure = this._structure;\n\n  const levelZeroMaxError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(\n    ellipsoid,\n    this._width,\n    tilingScheme.getNumberOfXTilesAtLevel(0)\n  );\n  const thisLevelMaxError = levelZeroMaxError / (1 << level);\n  this._skirtHeight = Math.min(thisLevelMaxError * 4.0, 1000.0);\n\n  const result = HeightmapTessellator.computeVertices({\n    heightmap: this._buffer,\n    structure: structure,\n    includeWebMercatorT: true,\n    width: this._width,\n    height: this._height,\n    nativeRectangle: nativeRectangle,\n    rectangle: rectangle,\n    relativeToCenter: center,\n    ellipsoid: ellipsoid,\n    skirtHeight: this._skirtHeight,\n    isGeographic: tilingScheme.projection instanceof GeographicProjection,\n    exaggeration: exaggeration,\n    exaggerationRelativeHeight: exaggerationRelativeHeight,\n  });\n\n  // Free memory received from server after mesh is created.\n  this._buffer = undefined;\n\n  let indicesAndEdges;\n  if (this._skirtHeight > 0.0) {\n    indicesAndEdges = TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices(\n      this._width,\n      this._height\n    );\n  } else {\n    indicesAndEdges = TerrainProvider.getRegularGridIndicesAndEdgeIndices(\n      this._width,\n      this._height\n    );\n  }\n\n  const vertexCountWithoutSkirts = result.gridWidth * result.gridHeight;\n\n  // No need to clone here (as we do in the async version) because the result\n  // is not coming from a web worker.\n  this._mesh = new TerrainMesh(\n    center,\n    result.vertices,\n    indicesAndEdges.indices,\n    indicesAndEdges.indexCountWithoutSkirts,\n    vertexCountWithoutSkirts,\n    result.minimumHeight,\n    result.maximumHeight,\n    result.boundingSphere3D,\n    result.occludeePointInScaledSpace,\n    result.encoding.stride,\n    result.orientedBoundingBox,\n    result.encoding,\n    indicesAndEdges.westIndicesSouthToNorth,\n    indicesAndEdges.southIndicesEastToWest,\n    indicesAndEdges.eastIndicesNorthToSouth,\n    indicesAndEdges.northIndicesWestToEast\n  );\n\n  return this._mesh;\n};\n\n/**\n * Computes the terrain height at a specified longitude and latitude.\n *\n * @param {Rectangle} rectangle The rectangle covered by this terrain data.\n * @param {number} longitude The longitude in radians.\n * @param {number} latitude The latitude in radians.\n * @returns {number} The terrain height at the specified position.  If the position\n *          is outside the rectangle, this method will extrapolate the height, which is likely to be wildly\n *          incorrect for positions far outside the rectangle.\n */\nHeightmapTerrainData.prototype.interpolateHeight = function (\n  rectangle,\n  longitude,\n  latitude\n) {\n  const width = this._width;\n  const height = this._height;\n\n  const structure = this._structure;\n  const stride = structure.stride;\n  const elementsPerHeight = structure.elementsPerHeight;\n  const elementMultiplier = structure.elementMultiplier;\n  const isBigEndian = structure.isBigEndian;\n  const heightOffset = structure.heightOffset;\n  const heightScale = structure.heightScale;\n\n  const isMeshCreated = defined(this._mesh);\n  const isLERCEncoding = this._encoding === HeightmapEncoding.LERC;\n  const isInterpolationImpossible = !isMeshCreated && isLERCEncoding;\n  if (isInterpolationImpossible) {\n    // We can't interpolate using the buffer because it's LERC encoded\n    //  so please call createMesh() first and interpolate using the mesh;\n    //  as mesh creation will decode the LERC buffer\n    return undefined;\n  }\n\n  let heightSample;\n  if (isMeshCreated) {\n    const buffer = this._mesh.vertices;\n    const encoding = this._mesh.encoding;\n    heightSample = interpolateMeshHeight(\n      buffer,\n      encoding,\n      heightOffset,\n      heightScale,\n      rectangle,\n      width,\n      height,\n      longitude,\n      latitude\n    );\n  } else {\n    heightSample = interpolateHeight(\n      this._buffer,\n      elementsPerHeight,\n      elementMultiplier,\n      stride,\n      isBigEndian,\n      rectangle,\n      width,\n      height,\n      longitude,\n      latitude\n    );\n    heightSample = heightSample * heightScale + heightOffset;\n  }\n\n  return heightSample;\n};\n\n/**\n * Upsamples this terrain data for use by a descendant tile.  The resulting instance will contain a subset of the\n * height samples in this instance, interpolated if necessary.\n *\n * @param {TilingScheme} tilingScheme The tiling scheme of this terrain data.\n * @param {number} thisX The X coordinate of this tile in the tiling scheme.\n * @param {number} thisY The Y coordinate of this tile in the tiling scheme.\n * @param {number} thisLevel The level of this tile in the tiling scheme.\n * @param {number} descendantX The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {number} descendantY The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {number} descendantLevel The level within the tiling scheme of the descendant tile for which we are upsampling.\n * @returns {Promise<HeightmapTerrainData>|undefined} A promise for upsampled heightmap terrain data for the descendant tile,\n *          or undefined if the mesh is unavailable.\n */\nHeightmapTerrainData.prototype.upsample = function (\n  tilingScheme,\n  thisX,\n  thisY,\n  thisLevel,\n  descendantX,\n  descendantY,\n  descendantLevel\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(tilingScheme)) {\n    throw new DeveloperError(\"tilingScheme is required.\");\n  }\n  if (!defined(thisX)) {\n    throw new DeveloperError(\"thisX is required.\");\n  }\n  if (!defined(thisY)) {\n    throw new DeveloperError(\"thisY is required.\");\n  }\n  if (!defined(thisLevel)) {\n    throw new DeveloperError(\"thisLevel is required.\");\n  }\n  if (!defined(descendantX)) {\n    throw new DeveloperError(\"descendantX is required.\");\n  }\n  if (!defined(descendantY)) {\n    throw new DeveloperError(\"descendantY is required.\");\n  }\n  if (!defined(descendantLevel)) {\n    throw new DeveloperError(\"descendantLevel is required.\");\n  }\n  const levelDifference = descendantLevel - thisLevel;\n  if (levelDifference > 1) {\n    throw new DeveloperError(\n      \"Upsampling through more than one level at a time is not currently supported.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const meshData = this._mesh;\n  if (!defined(meshData)) {\n    return undefined;\n  }\n\n  const width = this._width;\n  const height = this._height;\n  const structure = this._structure;\n  const stride = structure.stride;\n\n  const heights = new this._bufferType(width * height * stride);\n\n  const buffer = meshData.vertices;\n  const encoding = meshData.encoding;\n\n  // PERFORMANCE_IDEA: don't recompute these rectangles - the caller already knows them.\n  const sourceRectangle = tilingScheme.tileXYToRectangle(\n    thisX,\n    thisY,\n    thisLevel\n  );\n  const destinationRectangle = tilingScheme.tileXYToRectangle(\n    descendantX,\n    descendantY,\n    descendantLevel\n  );\n\n  const heightOffset = structure.heightOffset;\n  const heightScale = structure.heightScale;\n\n  const elementsPerHeight = structure.elementsPerHeight;\n  const elementMultiplier = structure.elementMultiplier;\n  const isBigEndian = structure.isBigEndian;\n\n  const divisor = Math.pow(elementMultiplier, elementsPerHeight - 1);\n\n  for (let j = 0; j < height; ++j) {\n    const latitude = CesiumMath.lerp(\n      destinationRectangle.north,\n      destinationRectangle.south,\n      j / (height - 1)\n    );\n    for (let i = 0; i < width; ++i) {\n      const longitude = CesiumMath.lerp(\n        destinationRectangle.west,\n        destinationRectangle.east,\n        i / (width - 1)\n      );\n      let heightSample = interpolateMeshHeight(\n        buffer,\n        encoding,\n        heightOffset,\n        heightScale,\n        sourceRectangle,\n        width,\n        height,\n        longitude,\n        latitude\n      );\n\n      // Use conditionals here instead of Math.min and Math.max so that an undefined\n      // lowestEncodedHeight or highestEncodedHeight has no effect.\n      heightSample =\n        heightSample < structure.lowestEncodedHeight\n          ? structure.lowestEncodedHeight\n          : heightSample;\n      heightSample =\n        heightSample > structure.highestEncodedHeight\n          ? structure.highestEncodedHeight\n          : heightSample;\n\n      setHeight(\n        heights,\n        elementsPerHeight,\n        elementMultiplier,\n        divisor,\n        stride,\n        isBigEndian,\n        j * width + i,\n        heightSample\n      );\n    }\n  }\n\n  return Promise.resolve(\n    new HeightmapTerrainData({\n      buffer: heights,\n      width: width,\n      height: height,\n      childTileMask: 0,\n      structure: this._structure,\n      createdByUpsampling: true,\n    })\n  );\n};\n\n/**\n * Determines if a given child tile is available, based on the\n * {@link HeightmapTerrainData.childTileMask}.  The given child tile coordinates are assumed\n * to be one of the four children of this tile.  If non-child tile coordinates are\n * given, the availability of the southeast child tile is returned.\n *\n * @param {number} thisX The tile X coordinate of this (the parent) tile.\n * @param {number} thisY The tile Y coordinate of this (the parent) tile.\n * @param {number} childX The tile X coordinate of the child tile to check for availability.\n * @param {number} childY The tile Y coordinate of the child tile to check for availability.\n * @returns {boolean} True if the child tile is available; otherwise, false.\n */\nHeightmapTerrainData.prototype.isChildAvailable = function (\n  thisX,\n  thisY,\n  childX,\n  childY\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(thisX)) {\n    throw new DeveloperError(\"thisX is required.\");\n  }\n  if (!defined(thisY)) {\n    throw new DeveloperError(\"thisY is required.\");\n  }\n  if (!defined(childX)) {\n    throw new DeveloperError(\"childX is required.\");\n  }\n  if (!defined(childY)) {\n    throw new DeveloperError(\"childY is required.\");\n  }\n  //>>includeEnd('debug');\n\n  let bitNumber = 2; // northwest child\n  if (childX !== thisX * 2) {\n    ++bitNumber; // east child\n  }\n  if (childY !== thisY * 2) {\n    bitNumber -= 2; // south child\n  }\n\n  return (this._childTileMask & (1 << bitNumber)) !== 0;\n};\n\n/**\n * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution\n * terrain data.  If this value is false, the data was obtained from some other source, such\n * as by downloading it from a remote server.  This method should return true for instances\n * returned from a call to {@link HeightmapTerrainData#upsample}.\n *\n * @returns {boolean} True if this instance was created by upsampling; otherwise, false.\n */\nHeightmapTerrainData.prototype.wasCreatedByUpsampling = function () {\n  return this._createdByUpsampling;\n};\n\nfunction interpolateHeight(\n  sourceHeights,\n  elementsPerHeight,\n  elementMultiplier,\n  stride,\n  isBigEndian,\n  sourceRectangle,\n  width,\n  height,\n  longitude,\n  latitude\n) {\n  const fromWest =\n    ((longitude - sourceRectangle.west) * (width - 1)) /\n    (sourceRectangle.east - sourceRectangle.west);\n  const fromSouth =\n    ((latitude - sourceRectangle.south) * (height - 1)) /\n    (sourceRectangle.north - sourceRectangle.south);\n\n  let westInteger = fromWest | 0;\n  let eastInteger = westInteger + 1;\n  if (eastInteger >= width) {\n    eastInteger = width - 1;\n    westInteger = width - 2;\n  }\n\n  let southInteger = fromSouth | 0;\n  let northInteger = southInteger + 1;\n  if (northInteger >= height) {\n    northInteger = height - 1;\n    southInteger = height - 2;\n  }\n\n  const dx = fromWest - westInteger;\n  const dy = fromSouth - southInteger;\n\n  southInteger = height - 1 - southInteger;\n  northInteger = height - 1 - northInteger;\n\n  const southwestHeight = getHeight(\n    sourceHeights,\n    elementsPerHeight,\n    elementMultiplier,\n    stride,\n    isBigEndian,\n    southInteger * width + westInteger\n  );\n  const southeastHeight = getHeight(\n    sourceHeights,\n    elementsPerHeight,\n    elementMultiplier,\n    stride,\n    isBigEndian,\n    southInteger * width + eastInteger\n  );\n  const northwestHeight = getHeight(\n    sourceHeights,\n    elementsPerHeight,\n    elementMultiplier,\n    stride,\n    isBigEndian,\n    northInteger * width + westInteger\n  );\n  const northeastHeight = getHeight(\n    sourceHeights,\n    elementsPerHeight,\n    elementMultiplier,\n    stride,\n    isBigEndian,\n    northInteger * width + eastInteger\n  );\n\n  return triangleInterpolateHeight(\n    dx,\n    dy,\n    southwestHeight,\n    southeastHeight,\n    northwestHeight,\n    northeastHeight\n  );\n}\n\nfunction interpolateMeshHeight(\n  buffer,\n  encoding,\n  heightOffset,\n  heightScale,\n  sourceRectangle,\n  width,\n  height,\n  longitude,\n  latitude\n) {\n  // returns a height encoded according to the structure's heightScale and heightOffset.\n  const fromWest =\n    ((longitude - sourceRectangle.west) * (width - 1)) /\n    (sourceRectangle.east - sourceRectangle.west);\n  const fromSouth =\n    ((latitude - sourceRectangle.south) * (height - 1)) /\n    (sourceRectangle.north - sourceRectangle.south);\n\n  let westInteger = fromWest | 0;\n  let eastInteger = westInteger + 1;\n  if (eastInteger >= width) {\n    eastInteger = width - 1;\n    westInteger = width - 2;\n  }\n\n  let southInteger = fromSouth | 0;\n  let northInteger = southInteger + 1;\n  if (northInteger >= height) {\n    northInteger = height - 1;\n    southInteger = height - 2;\n  }\n\n  const dx = fromWest - westInteger;\n  const dy = fromSouth - southInteger;\n\n  southInteger = height - 1 - southInteger;\n  northInteger = height - 1 - northInteger;\n\n  const southwestHeight =\n    (encoding.decodeHeight(buffer, southInteger * width + westInteger) -\n      heightOffset) /\n    heightScale;\n  const southeastHeight =\n    (encoding.decodeHeight(buffer, southInteger * width + eastInteger) -\n      heightOffset) /\n    heightScale;\n  const northwestHeight =\n    (encoding.decodeHeight(buffer, northInteger * width + westInteger) -\n      heightOffset) /\n    heightScale;\n  const northeastHeight =\n    (encoding.decodeHeight(buffer, northInteger * width + eastInteger) -\n      heightOffset) /\n    heightScale;\n\n  return triangleInterpolateHeight(\n    dx,\n    dy,\n    southwestHeight,\n    southeastHeight,\n    northwestHeight,\n    northeastHeight\n  );\n}\n\nfunction triangleInterpolateHeight(\n  dX,\n  dY,\n  southwestHeight,\n  southeastHeight,\n  northwestHeight,\n  northeastHeight\n) {\n  // The HeightmapTessellator bisects the quad from southwest to northeast.\n  if (dY < dX) {\n    // Lower right triangle\n    return (\n      southwestHeight +\n      dX * (southeastHeight - southwestHeight) +\n      dY * (northeastHeight - southeastHeight)\n    );\n  }\n\n  // Upper left triangle\n  return (\n    southwestHeight +\n    dX * (northeastHeight - northwestHeight) +\n    dY * (northwestHeight - southwestHeight)\n  );\n}\n\nfunction getHeight(\n  heights,\n  elementsPerHeight,\n  elementMultiplier,\n  stride,\n  isBigEndian,\n  index\n) {\n  index *= stride;\n\n  let height = 0;\n  let i;\n\n  if (isBigEndian) {\n    for (i = 0; i < elementsPerHeight; ++i) {\n      height = height * elementMultiplier + heights[index + i];\n    }\n  } else {\n    for (i = elementsPerHeight - 1; i >= 0; --i) {\n      height = height * elementMultiplier + heights[index + i];\n    }\n  }\n\n  return height;\n}\n\nfunction setHeight(\n  heights,\n  elementsPerHeight,\n  elementMultiplier,\n  divisor,\n  stride,\n  isBigEndian,\n  index,\n  height\n) {\n  index *= stride;\n\n  let i;\n  if (isBigEndian) {\n    for (i = 0; i < elementsPerHeight - 1; ++i) {\n      heights[index + i] = (height / divisor) | 0;\n      height -= heights[index + i] * divisor;\n      divisor /= elementMultiplier;\n    }\n  } else {\n    for (i = elementsPerHeight - 1; i > 0; --i) {\n      heights[index + i] = (height / divisor) | 0;\n      height -= heights[index + i] * divisor;\n      divisor /= elementMultiplier;\n    }\n  }\n  heights[index + i] = height;\n}\nexport default HeightmapTerrainData;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Event from \"./Event.js\";\nimport GeographicTilingScheme from \"./GeographicTilingScheme.js\";\nimport HeightmapTerrainData from \"./HeightmapTerrainData.js\";\nimport TerrainProvider from \"./TerrainProvider.js\";\n\n/**\n * A very simple {@link TerrainProvider} that produces geometry by tessellating an ellipsoidal\n * surface.\n *\n * @alias EllipsoidTerrainProvider\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {TilingScheme} [options.tilingScheme] The tiling scheme specifying how the ellipsoidal\n * surface is broken into tiles.  If this parameter is not provided, a {@link GeographicTilingScheme}\n * is used.\n * @param {Ellipsoid} [options.ellipsoid] The ellipsoid.  If the tilingScheme is specified,\n * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n * parameter is specified, the WGS84 ellipsoid is used.\n *\n * @see TerrainProvider\n */\nfunction EllipsoidTerrainProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._tilingScheme = options.tilingScheme;\n  if (!defined(this._tilingScheme)) {\n    this._tilingScheme = new GeographicTilingScheme({\n      ellipsoid: defaultValue(options.ellipsoid, Ellipsoid.WGS84),\n    });\n  }\n\n  // Note: the 64 below does NOT need to match the actual vertex dimensions, because\n  // the ellipsoid is significantly smoother than actual terrain.\n  this._levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(\n    this._tilingScheme.ellipsoid,\n    64,\n    this._tilingScheme.getNumberOfXTilesAtLevel(0)\n  );\n\n  this._errorEvent = new Event();\n}\n\nObject.defineProperties(EllipsoidTerrainProvider.prototype, {\n  /**\n   * Gets an event that is raised when the terrain provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof EllipsoidTerrainProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this terrain provider is active.  Typically this is used to credit\n   * the source of the terrain.\n   * @memberof EllipsoidTerrainProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof EllipsoidTerrainProvider.prototype\n   * @type {GeographicTilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the provider includes a water mask.  The water mask\n   * indicates which areas of the globe are water rather than land, so they can be rendered\n   * as a reflective surface with animated waves.\n   * @memberof EllipsoidTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasWaterMask: {\n    get: function () {\n      return false;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the requested tiles include vertex normals.\n   * @memberof EllipsoidTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasVertexNormals: {\n    get: function () {\n      return false;\n    },\n  },\n  /**\n   * Gets an object that can be used to determine availability of terrain from this provider, such as\n   * at points and in rectangles. This property may be undefined if availability\n   * information is not available.\n   * @memberof EllipsoidTerrainProvider.prototype\n   * @type {TileAvailability}\n   * @readonly\n   */\n  availability: {\n    get: function () {\n      return undefined;\n    },\n  },\n});\n\n/**\n * Requests the geometry for a given tile. The result includes terrain\n * data and indicates that all child tiles are available.\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @param {Request} [request] The request object. Intended for internal use only.\n *\n * @returns {Promise<TerrainData>|undefined} A promise for the requested geometry.  If this method\n *          returns undefined instead of a promise, it is an indication that too many requests are already\n *          pending and the request will be retried later.\n */\nEllipsoidTerrainProvider.prototype.requestTileGeometry = function (\n  x,\n  y,\n  level,\n  request\n) {\n  const width = 16;\n  const height = 16;\n  return Promise.resolve(\n    new HeightmapTerrainData({\n      buffer: new Uint8Array(width * height),\n      width: width,\n      height: height,\n    })\n  );\n};\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level.\n *\n * @param {number} level The tile level for which to get the maximum geometric error.\n * @returns {number} The maximum geometric error.\n */\nEllipsoidTerrainProvider.prototype.getLevelMaximumGeometricError = function (\n  level\n) {\n  return this._levelZeroMaximumGeometricError / (1 << level);\n};\n\n/**\n * Determines whether data for a tile is available to be loaded.\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @returns {boolean|undefined} Undefined if not supported, otherwise true or false.\n */\nEllipsoidTerrainProvider.prototype.getTileDataAvailable = function (\n  x,\n  y,\n  level\n) {\n  return undefined;\n};\n\n/**\n * Makes sure we load availability data for a tile\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @returns {undefined} This provider does not support loading availability.\n */\nEllipsoidTerrainProvider.prototype.loadTileDataAvailability = function (\n  x,\n  y,\n  level\n) {\n  return undefined;\n};\nexport default EllipsoidTerrainProvider;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 u_initialColor;\\n\\\n\\n\\\n#if TEXTURE_UNITS > 0\\n\\\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\\n\\\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\\n\\\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\\n\\\n\\n\\\n#ifdef APPLY_ALPHA\\n\\\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_DAY_NIGHT_ALPHA\\n\\\nuniform float u_dayTextureNightAlpha[TEXTURE_UNITS];\\n\\\nuniform float u_dayTextureDayAlpha[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_SPLIT\\n\\\nuniform float u_dayTextureSplit[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_BRIGHTNESS\\n\\\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_CONTRAST\\n\\\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_HUE\\n\\\nuniform float u_dayTextureHue[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_SATURATION\\n\\\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_GAMMA\\n\\\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_IMAGERY_CUTOUT\\n\\\nuniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_COLOR_TO_ALPHA\\n\\\nuniform vec4 u_colorsToAlpha[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n\\n\\\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n\\n\\\n#ifdef SHOW_REFLECTIVE_OCEAN\\n\\\nuniform sampler2D u_waterMask;\\n\\\nuniform vec4 u_waterMaskTranslationAndScale;\\n\\\nuniform float u_zoomedOutOceanSpecularIntensity;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef SHOW_OCEAN_WAVES\\n\\\nuniform sampler2D u_oceanNormalMap;\\n\\\n#endif\\n\\\n\\n\\\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\\n\\\nuniform vec2 u_lightingFadeDistance;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef TILE_LIMIT_RECTANGLE\\n\\\nuniform vec4 u_cartographicLimitRectangle;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef GROUND_ATMOSPHERE\\n\\\nuniform vec2 u_nightFadeDistance;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef ENABLE_CLIPPING_PLANES\\n\\\nuniform highp sampler2D u_clippingPlanes;\\n\\\nuniform mat4 u_clippingPlanesMatrix;\\n\\\nuniform vec4 u_clippingPlanesEdgeStyle;\\n\\\n#endif\\n\\\n\\n\\\n#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\\n\\\nuniform float u_minimumBrightness;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef COLOR_CORRECT\\n\\\nuniform vec3 u_hsbShift; // Hue, saturation, brightness\\n\\\n#endif\\n\\\n\\n\\\n#ifdef HIGHLIGHT_FILL_TILE\\n\\\nuniform vec4 u_fillHighlightColor;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef TRANSLUCENT\\n\\\nuniform vec4 u_frontFaceAlphaByDistance;\\n\\\nuniform vec4 u_backFaceAlphaByDistance;\\n\\\nuniform vec4 u_translucencyRectangle;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef UNDERGROUND_COLOR\\n\\\nuniform vec4 u_undergroundColor;\\n\\\nuniform vec4 u_undergroundColorAlphaByDistance;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef ENABLE_VERTEX_LIGHTING\\n\\\nuniform float u_lambertDiffuseMultiplier;\\n\\\nuniform float u_vertexShadowDarkness;\\n\\\n#endif\\n\\\n\\n\\\nin vec3 v_positionMC;\\n\\\nin vec3 v_positionEC;\\n\\\nin vec3 v_textureCoordinates;\\n\\\nin vec3 v_normalMC;\\n\\\nin vec3 v_normalEC;\\n\\\n\\n\\\n#ifdef APPLY_MATERIAL\\n\\\nin float v_height;\\n\\\nin float v_slope;\\n\\\nin float v_aspect;\\n\\\n#endif\\n\\\n\\n\\\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\\n\\\nin float v_distance;\\n\\\n#endif\\n\\\n\\n\\\n#if defined(GROUND_ATMOSPHERE) || defined(FOG)\\n\\\nin vec3 v_atmosphereRayleighColor;\\n\\\nin vec3 v_atmosphereMieColor;\\n\\\nin float v_atmosphereOpacity;\\n\\\n#endif\\n\\\n\\n\\\n#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\\n\\\nfloat interpolateByDistance(vec4 nearFarScalar, float distance)\\n\\\n{\\n\\\n    float startDistance = nearFarScalar.x;\\n\\\n    float startValue = nearFarScalar.y;\\n\\\n    float endDistance = nearFarScalar.z;\\n\\\n    float endValue = nearFarScalar.w;\\n\\\n    float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);\\n\\\n    return mix(startValue, endValue, t);\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\n#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)\\n\\\nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)\\n\\\n{\\n\\\n    return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\n#ifdef TRANSLUCENT\\n\\\nbool inTranslucencyRectangle()\\n\\\n{\\n\\\n    return\\n\\\n        v_textureCoordinates.x > u_translucencyRectangle.x &&\\n\\\n        v_textureCoordinates.x < u_translucencyRectangle.z &&\\n\\\n        v_textureCoordinates.y > u_translucencyRectangle.y &&\\n\\\n        v_textureCoordinates.y < u_translucencyRectangle.w;\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\nvec4 sampleAndBlend(\\n\\\n    vec4 previousColor,\\n\\\n    sampler2D textureToSample,\\n\\\n    vec2 tileTextureCoordinates,\\n\\\n    vec4 textureCoordinateRectangle,\\n\\\n    vec4 textureCoordinateTranslationAndScale,\\n\\\n    float textureAlpha,\\n\\\n    float textureNightAlpha,\\n\\\n    float textureDayAlpha,\\n\\\n    float textureBrightness,\\n\\\n    float textureContrast,\\n\\\n    float textureHue,\\n\\\n    float textureSaturation,\\n\\\n    float textureOneOverGamma,\\n\\\n    float split,\\n\\\n    vec4 colorToAlpha,\\n\\\n    float nightBlend)\\n\\\n{\\n\\\n    // This crazy step stuff sets the alpha to 0.0 if this following condition is true:\\n\\\n    //    tileTextureCoordinates.s < textureCoordinateRectangle.s ||\\n\\\n    //    tileTextureCoordinates.s > textureCoordinateRectangle.p ||\\n\\\n    //    tileTextureCoordinates.t < textureCoordinateRectangle.t ||\\n\\\n    //    tileTextureCoordinates.t > textureCoordinateRectangle.q\\n\\\n    // In other words, the alpha is zero if the fragment is outside the rectangle\\n\\\n    // covered by this texture.  Would an actual 'if' yield better performance?\\n\\\n    vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\\n\\\n    textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\\n\\\n\\n\\\n    alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\\n\\\n    textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\\n\\\n\\n\\\n#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)\\n\\\n    textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);\\n\\\n#endif\\n\\\n\\n\\\n    vec2 translation = textureCoordinateTranslationAndScale.xy;\\n\\\n    vec2 scale = textureCoordinateTranslationAndScale.zw;\\n\\\n    vec2 textureCoordinates = tileTextureCoordinates * scale + translation;\\n\\\n    vec4 value = texture(textureToSample, textureCoordinates);\\n\\\n    vec3 color = value.rgb;\\n\\\n    float alpha = value.a;\\n\\\n\\n\\\n#ifdef APPLY_COLOR_TO_ALPHA\\n\\\n    vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);\\n\\\n    colorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b);\\n\\\n    alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);\\n\\\n#endif\\n\\\n\\n\\\n#if !defined(APPLY_GAMMA)\\n\\\n    vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));\\n\\\n    color = tempColor.rgb;\\n\\\n    alpha = tempColor.a;\\n\\\n#else\\n\\\n    color = pow(color, vec3(textureOneOverGamma));\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_SPLIT\\n\\\n    float splitPosition = czm_splitPosition;\\n\\\n    // Split to the left\\n\\\n    if (split < 0.0 && gl_FragCoord.x > splitPosition) {\\n\\\n       alpha = 0.0;\\n\\\n    }\\n\\\n    // Split to the right\\n\\\n    else if (split > 0.0 && gl_FragCoord.x < splitPosition) {\\n\\\n       alpha = 0.0;\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_BRIGHTNESS\\n\\\n    color = mix(vec3(0.0), color, textureBrightness);\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_CONTRAST\\n\\\n    color = mix(vec3(0.5), color, textureContrast);\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_HUE\\n\\\n    color = czm_hue(color, textureHue);\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_SATURATION\\n\\\n    color = czm_saturation(color, textureSaturation);\\n\\\n#endif\\n\\\n\\n\\\n    float sourceAlpha = alpha * textureAlpha;\\n\\\n    float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\\n\\\n    outAlpha += sign(outAlpha) - 1.0;\\n\\\n\\n\\\n    vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\\n\\\n\\n\\\n    // When rendering imagery for a tile in multiple passes,\\n\\\n    // some GPU/WebGL implementation combinations will not blend fragments in\\n\\\n    // additional passes correctly if their computation includes an unmasked\\n\\\n    // divide-by-zero operation,\\n\\\n    // even if it's not in the output or if the output has alpha zero.\\n\\\n    //\\n\\\n    // For example, without sanitization for outAlpha,\\n\\\n    // this renders without artifacts:\\n\\\n    //   if (outAlpha == 0.0) { outColor = vec3(0.0); }\\n\\\n    //\\n\\\n    // but using czm_branchFreeTernary will cause portions of the tile that are\\n\\\n    // alpha-zero in the additional pass to render as black instead of blending\\n\\\n    // with the previous pass:\\n\\\n    //   outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor);\\n\\\n    //\\n\\\n    // So instead, sanitize against divide-by-zero,\\n\\\n    // store this state on the sign of outAlpha, and correct on return.\\n\\\n\\n\\\n    return vec4(outColor, max(outAlpha, 0.0));\\n\\\n}\\n\\\n\\n\\\nvec3 colorCorrect(vec3 rgb) {\\n\\\n#ifdef COLOR_CORRECT\\n\\\n    // Convert rgb color to hsb\\n\\\n    vec3 hsb = czm_RGBToHSB(rgb);\\n\\\n    // Perform hsb shift\\n\\\n    hsb.x += u_hsbShift.x; // hue\\n\\\n    hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation\\n\\\n    hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness\\n\\\n    // Convert shifted hsb back to rgb\\n\\\n    rgb = czm_HSBToRGB(hsb);\\n\\\n#endif\\n\\\n    return rgb;\\n\\\n}\\n\\\n\\n\\\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);\\n\\\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);\\n\\\n\\n\\\nconst float fExposure = 2.0;\\n\\\n\\n\\\nvec3 computeEllipsoidPosition()\\n\\\n{\\n\\\n    float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);\\n\\\n    vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);\\n\\\n    xy *= czm_viewport.zw * mpp * 0.5;\\n\\\n\\n\\\n    vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x));\\n\\\n    czm_ray ray = czm_ray(vec3(0.0), direction);\\n\\\n\\n\\\n    vec3 ellipsoid_center = czm_view[3].xyz;\\n\\\n\\n\\\n    czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\\n\\\n\\n\\\n    vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);\\n\\\n    return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;\\n\\\n}\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n#ifdef TILE_LIMIT_RECTANGLE\\n\\\n    if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||\\n\\\n        v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)\\n\\\n        {\\n\\\n            discard;\\n\\\n        }\\n\\\n#endif\\n\\\n\\n\\\n#ifdef ENABLE_CLIPPING_PLANES\\n\\\n    float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);\\n\\\n#endif\\n\\\n\\n\\\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)\\n\\\n    vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));   // normalized surface normal in model coordinates\\n\\\n    vec3 normalEC = czm_normal3D * normalMC;                                         // normalized surface normal in eye coordinates\\n\\\n#endif\\n\\\n\\n\\\n#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)\\n\\\n    float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);\\n\\\n#else\\n\\\n    float nightBlend = 0.0;\\n\\\n#endif\\n\\\n\\n\\\n    // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0\\n\\\n    // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the\\n\\\n    // fragments on the edges of tiles even though the vertex shader is outputting\\n\\\n    // coordinates strictly in the 0-1 range.\\n\\\n    vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);\\n\\\n\\n\\\n#ifdef SHOW_TILE_BOUNDARIES\\n\\\n    if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\\n\\\n        v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\\n\\\n    {\\n\\\n        color = vec4(1.0, 0.0, 0.0, 1.0);\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\\n\\\n    float cameraDist;\\n\\\n    if (czm_sceneMode == czm_sceneMode2D)\\n\\\n    {\\n\\\n        cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;\\n\\\n    }\\n\\\n    else if (czm_sceneMode == czm_sceneModeColumbusView)\\n\\\n    {\\n\\\n        cameraDist = -czm_view[3].z;\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        cameraDist = length(czm_view[3]);\\n\\\n    }\\n\\\n    float fadeOutDist = u_lightingFadeDistance.x;\\n\\\n    float fadeInDist = u_lightingFadeDistance.y;\\n\\\n    if (czm_sceneMode != czm_sceneMode3D) {\\n\\\n        vec3 radii = czm_ellipsoidRadii;\\n\\\n        float maxRadii = max(radii.x, max(radii.y, radii.z));\\n\\\n        fadeOutDist -= maxRadii;\\n\\\n        fadeInDist -= maxRadii;\\n\\\n    }\\n\\\n    float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\\n\\\n#else\\n\\\n    float fade = 0.0;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef SHOW_REFLECTIVE_OCEAN\\n\\\n    vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\\n\\\n    vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\\n\\\n    vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\\n\\\n    waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;\\n\\\n\\n\\\n    float mask = texture(u_waterMask, waterMaskTextureCoordinates).r;\\n\\\n\\n\\\n    if (mask > 0.0)\\n\\\n    {\\n\\\n        mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\\n\\\n\\n\\\n        vec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\\n\\\n        vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\\n\\\n\\n\\\n        vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\\n\\\n\\n\\\n        color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_MATERIAL\\n\\\n    czm_materialInput materialInput;\\n\\\n    materialInput.st = v_textureCoordinates.st;\\n\\\n    materialInput.normalEC = normalize(v_normalEC);\\n\\\n    materialInput.positionToEyeEC = -v_positionEC;\\n\\\n    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));     \\n\\\n    materialInput.slope = v_slope;\\n\\\n    materialInput.height = v_height;\\n\\\n    materialInput.aspect = v_aspect;\\n\\\n    czm_material material = czm_getMaterial(materialInput);\\n\\\n    vec4 materialColor = vec4(material.diffuse, material.alpha);\\n\\\n    color = alphaBlend(materialColor, color);\\n\\\n#endif\\n\\\n\\n\\\n#ifdef ENABLE_VERTEX_LIGHTING\\n\\\n    float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0);\\n\\\n    vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\\n\\\n#elif defined(ENABLE_DAYNIGHT_SHADING)\\n\\\n    float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\\n\\\n    diffuseIntensity = mix(1.0, diffuseIntensity, fade);\\n\\\n    vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\\n\\\n#else\\n\\\n    vec4 finalColor = color;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef ENABLE_CLIPPING_PLANES\\n\\\n    vec4 clippingPlanesEdgeColor = vec4(1.0);\\n\\\n    clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;\\n\\\n    float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;\\n\\\n\\n\\\n    if (clipDistance < clippingPlanesEdgeWidth)\\n\\\n    {\\n\\\n        finalColor = clippingPlanesEdgeColor;\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n#ifdef HIGHLIGHT_FILL_TILE\\n\\\n    finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);\\n\\\n#endif\\n\\\n\\n\\\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)\\n\\\n    vec3 atmosphereLightDirection = czm_sunDirectionWC;\\n\\\n#else\\n\\\n    vec3 atmosphereLightDirection = czm_lightDirectionWC;\\n\\\n#endif\\n\\\n\\n\\\n#if defined(GROUND_ATMOSPHERE) || defined(FOG)\\n\\\n    if (!czm_backFacing())\\n\\\n    {\\n\\\n        bool dynamicLighting = false;\\n\\\n        #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))\\n\\\n            dynamicLighting = true;     \\n\\\n        #endif\\n\\\n\\n\\\n        vec3 rayleighColor;\\n\\\n        vec3 mieColor;\\n\\\n        float opacity;\\n\\\n\\n\\\n        vec3 positionWC;\\n\\\n        vec3 lightDirection;\\n\\\n\\n\\\n        // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader.\\n\\\n        // Otherwise, the scattering is computed in the vertex shader.\\n\\\n        #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE\\n\\\n            positionWC = computeEllipsoidPosition();\\n\\\n            lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));\\n\\\n            computeAtmosphereScattering(\\n\\\n                positionWC,\\n\\\n                lightDirection,\\n\\\n                rayleighColor,\\n\\\n                mieColor,\\n\\\n                opacity\\n\\\n            );\\n\\\n        #else\\n\\\n            positionWC = v_positionMC;\\n\\\n            lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));\\n\\\n            rayleighColor = v_atmosphereRayleighColor;\\n\\\n            mieColor = v_atmosphereMieColor;\\n\\\n            opacity = v_atmosphereOpacity;\\n\\\n        #endif\\n\\\n\\n\\\n        rayleighColor = colorCorrect(rayleighColor);\\n\\\n        mieColor = colorCorrect(mieColor);\\n\\\n\\n\\\n        vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);\\n\\\n\\n\\\n        // Fog is applied to tiles selected for fog, close to the Earth.\\n\\\n        #ifdef FOG\\n\\\n            vec3 fogColor = groundAtmosphereColor.rgb;\\n\\\n            \\n\\\n            // If there is lighting, apply that to the fog.\\n\\\n            #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\\n\\\n                float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);\\n\\\n                fogColor *= darken;                \\n\\\n            #endif\\n\\\n\\n\\\n            #ifndef HDR\\n\\\n                fogColor.rgb = czm_acesTonemapping(fogColor.rgb);\\n\\\n                fogColor.rgb = czm_inverseGamma(fogColor.rgb);\\n\\\n            #endif\\n\\\n            \\n\\\n            const float modifier = 0.15;\\n\\\n            finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, modifier), finalColor.a);\\n\\\n\\n\\\n        #else\\n\\\n            // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere.\\n\\\n            // This value is larger near the \\\"circumference\\\", as it is further away from the camera. We use it to\\n\\\n            // brighten up that area of the ground atmosphere.\\n\\\n            const float transmittanceModifier = 0.5;\\n\\\n            float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0);\\n\\\n\\n\\\n            vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance;\\n\\\n\\n\\\n            #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\\n\\\n                float fadeInDist = u_nightFadeDistance.x;\\n\\\n                float fadeOutDist = u_nightFadeDistance.y;\\n\\\n            \\n\\\n                float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0);\\n\\\n                float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0);\\n\\\n                vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken);\\n\\\n\\n\\\n                finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity);\\n\\\n            #endif\\n\\\n            \\n\\\n            #ifndef HDR\\n\\\n                finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb);\\n\\\n            #else\\n\\\n                finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6);\\n\\\n            #endif\\n\\\n            \\n\\\n            finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade);\\n\\\n        #endif\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n#ifdef UNDERGROUND_COLOR\\n\\\n    if (czm_backFacing())\\n\\\n    {\\n\\\n        float distanceFromEllipsoid = max(czm_eyeHeight, 0.0);\\n\\\n        float distance = max(v_distance - distanceFromEllipsoid, 0.0);\\n\\\n        float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);\\n\\\n        vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);\\n\\\n        finalColor = alphaBlend(undergroundColor, finalColor);\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n#ifdef TRANSLUCENT\\n\\\n    if (inTranslucencyRectangle())\\n\\\n    {\\n\\\n      vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;\\n\\\n      finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);\\n\\\n    }\\n\\\n#endif\\n\\\n    \\n\\\n    out_FragColor =  finalColor;\\n\\\n}\\n\\\n\\n\\\n\\n\\\n#ifdef SHOW_REFLECTIVE_OCEAN\\n\\\n\\n\\\nfloat waveFade(float edge0, float edge1, float x)\\n\\\n{\\n\\\n    float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\\n\\\n    return pow(1.0 - y, 5.0);\\n\\\n}\\n\\\n\\n\\\nfloat linearFade(float edge0, float edge1, float x)\\n\\\n{\\n\\\n    return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\\n\\\n}\\n\\\n\\n\\\n// Based on water rendering by Jonas Wagner:\\n\\\n// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog\\n\\\n\\n\\\n// low altitude wave settings\\n\\\nconst float oceanFrequencyLowAltitude = 825000.0;\\n\\\nconst float oceanAnimationSpeedLowAltitude = 0.004;\\n\\\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\\n\\\nconst float oceanSpecularIntensity = 0.5;\\n\\\n\\n\\\n// high altitude wave settings\\n\\\nconst float oceanFrequencyHighAltitude = 125000.0;\\n\\\nconst float oceanAnimationSpeedHighAltitude = 0.008;\\n\\\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\\n\\\n\\n\\\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)\\n\\\n{\\n\\\n    vec3 positionToEyeEC = -positionEyeCoordinates;\\n\\\n    float positionToEyeECLength = length(positionToEyeEC);\\n\\\n\\n\\\n    // The double normalize below works around a bug in Firefox on Android devices.\\n\\\n    vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));\\n\\\n\\n\\\n    // Fade out the waves as the camera moves far from the surface.\\n\\\n    float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\\n\\\n\\n\\\n#ifdef SHOW_OCEAN_WAVES\\n\\\n    // high altitude waves\\n\\\n    float time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\\n\\\n    vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\\n\\\n    vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\\n\\\n\\n\\\n    // low altitude waves\\n\\\n    time = czm_frameNumber * oceanAnimationSpeedLowAltitude;\\n\\\n    noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\\n\\\n    vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\\n\\\n\\n\\\n    // blend the 2 wave layers based on distance to surface\\n\\\n    float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\\n\\\n    float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\\n\\\n    vec3 normalTangentSpace =\\n\\\n        (highAltitudeFade * normalTangentSpaceHighAltitude) +\\n\\\n        (lowAltitudeFade * normalTangentSpaceLowAltitude);\\n\\\n    normalTangentSpace = normalize(normalTangentSpace);\\n\\\n\\n\\\n    // fade out the normal perturbation as we move farther from the water surface\\n\\\n    normalTangentSpace.xy *= waveIntensity;\\n\\\n    normalTangentSpace = normalize(normalTangentSpace);\\n\\\n#else\\n\\\n    vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\\n\\\n#endif\\n\\\n\\n\\\n    vec3 normalEC = enuToEye * normalTangentSpace;\\n\\\n\\n\\\n    const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\\n\\\n\\n\\\n    // Use diffuse light to highlight the waves\\n\\\n    float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;\\n\\\n    vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);\\n\\\n\\n\\\n#ifdef SHOW_OCEAN_WAVES\\n\\\n    // Where diffuse light is low or non-existent, use wave highlights based solely on\\n\\\n    // the wave bumpiness and no particular light direction.\\n\\\n    float tsPerturbationRatio = normalTangentSpace.z;\\n\\\n    vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\\n\\\n#else\\n\\\n    vec3 nonDiffuseHighlight = vec3(0.0);\\n\\\n#endif\\n\\\n\\n\\\n    // Add specular highlights in 3D, and in all modes when zoomed in.\\n\\\n    float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);\\n\\\n    float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\\n\\\n    float specular = specularIntensity * surfaceReflectance;\\n\\\n\\n\\\n#ifdef HDR\\n\\\n    specular *= 1.4;\\n\\\n\\n\\\n    float e = 0.2;\\n\\\n    float d = 3.3;\\n\\\n    float c = 1.7;\\n\\\n\\n\\\n    vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));\\n\\\n#else\\n\\\n    vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;\\n\\\n#endif\\n\\\n\\n\\\n    return vec4(color, imageryColor.a);\\n\\\n}\\n\\\n\\n\\\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef QUANTIZATION_BITS12\\n\\\nin vec4 compressed0;\\n\\\nin float compressed1;\\n\\\n#else\\n\\\nin vec4 position3DAndHeight;\\n\\\nin vec4 textureCoordAndEncodedNormals;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef GEODETIC_SURFACE_NORMALS\\n\\\nin vec3 geodeticSurfaceNormal;\\n\\\n#endif\\n\\\n\\n\\\n#ifdef EXAGGERATION\\n\\\nuniform vec2 u_verticalExaggerationAndRelativeHeight;\\n\\\n#endif\\n\\\n\\n\\\nuniform vec3 u_center3D;\\n\\\nuniform mat4 u_modifiedModelView;\\n\\\nuniform mat4 u_modifiedModelViewProjection;\\n\\\nuniform vec4 u_tileRectangle;\\n\\\n\\n\\\n// Uniforms for 2D Mercator projection\\n\\\nuniform vec2 u_southAndNorthLatitude;\\n\\\nuniform vec2 u_southMercatorYAndOneOverHeight;\\n\\\n\\n\\\nout vec3 v_positionMC;\\n\\\nout vec3 v_positionEC;\\n\\\n\\n\\\nout vec3 v_textureCoordinates;\\n\\\nout vec3 v_normalMC;\\n\\\nout vec3 v_normalEC;\\n\\\n\\n\\\n#ifdef APPLY_MATERIAL\\n\\\nout float v_slope;\\n\\\nout float v_aspect;\\n\\\nout float v_height;\\n\\\n#endif\\n\\\n\\n\\\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\\n\\\nout float v_distance;\\n\\\n#endif\\n\\\n\\n\\\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\\n\\\nout vec3 v_atmosphereRayleighColor;\\n\\\nout vec3 v_atmosphereMieColor;\\n\\\nout float v_atmosphereOpacity;\\n\\\n#endif\\n\\\n\\n\\\n// These functions are generated at runtime.\\n\\\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\\n\\\nfloat get2DYPositionFraction(vec2 textureCoordinates);\\n\\\n\\n\\\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\\n\\\n{\\n\\\n    return u_modifiedModelViewProjection * vec4(position, 1.0);\\n\\\n}\\n\\\n\\n\\\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\\n\\\n{\\n\\\n    // The width of a tile at level 11, in radians and assuming a single root tile, is\\n\\\n    //   2.0 * czm_pi / pow(2.0, 11.0)\\n\\\n    // We want to just linearly interpolate the 2D position from the texture coordinates\\n\\\n    // when we're at this level or higher.  The constant below is the expression\\n\\\n    // above evaluated and then rounded up at the 4th significant digit.\\n\\\n    const float maxTileWidth = 0.003068;\\n\\\n    float positionFraction = textureCoordinates.y;\\n\\\n    float southLatitude = u_southAndNorthLatitude.x;\\n\\\n    float northLatitude = u_southAndNorthLatitude.y;\\n\\\n    if (northLatitude - southLatitude > maxTileWidth)\\n\\\n    {\\n\\\n        float southMercatorY = u_southMercatorYAndOneOverHeight.x;\\n\\\n        float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\\n\\\n\\n\\\n        float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\\n\\\n        currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\\n\\\n        positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\\n\\\n    }\\n\\\n    return positionFraction;\\n\\\n}\\n\\\n\\n\\\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\\n\\\n{\\n\\\n    return textureCoordinates.y;\\n\\\n}\\n\\\n\\n\\\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\\n\\\n{\\n\\\n    float yPositionFraction = get2DYPositionFraction(textureCoordinates);\\n\\\n    vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\\n\\\n    return u_modifiedModelViewProjection * rtcPosition2D;\\n\\\n}\\n\\\n\\n\\\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\\n\\\n{\\n\\\n    return getPositionPlanarEarth(position, 0.0, textureCoordinates);\\n\\\n}\\n\\\n\\n\\\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\\n\\\n{\\n\\\n    return getPositionPlanarEarth(position, height, textureCoordinates);\\n\\\n}\\n\\\n\\n\\\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\\n\\\n{\\n\\\n    // We do not do RTC while morphing, so there is potential for jitter.\\n\\\n    // This is unlikely to be noticeable, though.\\n\\\n    vec3 position3DWC = position + u_center3D;\\n\\\n    float yPositionFraction = get2DYPositionFraction(textureCoordinates);\\n\\\n    vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\\n\\\n    vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\\n\\\n    return czm_modelViewProjection * morphPosition;\\n\\\n}\\n\\\n\\n\\\n#ifdef QUANTIZATION_BITS12\\n\\\nuniform vec2 u_minMaxHeight;\\n\\\nuniform mat4 u_scaleAndBias;\\n\\\n#endif\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n#ifdef QUANTIZATION_BITS12\\n\\\n    vec2 xy = czm_decompressTextureCoordinates(compressed0.x);\\n\\\n    vec2 zh = czm_decompressTextureCoordinates(compressed0.y);\\n\\\n    vec3 position = vec3(xy, zh.x);\\n\\\n    float height = zh.y;\\n\\\n    vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);\\n\\\n\\n\\\n    height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\\n\\\n    position = (u_scaleAndBias * vec4(position, 1.0)).xyz;\\n\\\n\\n\\\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\\n\\\n    float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\\n\\\n    float encodedNormal = compressed1;\\n\\\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\\n\\\n    float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\\n\\\n    float encodedNormal = 0.0;\\n\\\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\\n\\\n    float webMercatorT = textureCoordinates.y;\\n\\\n    float encodedNormal = compressed0.w;\\n\\\n#else\\n\\\n    float webMercatorT = textureCoordinates.y;\\n\\\n    float encodedNormal = 0.0;\\n\\\n#endif\\n\\\n\\n\\\n#else\\n\\\n    // A single float per element\\n\\\n    vec3 position = position3DAndHeight.xyz;\\n\\\n    float height = position3DAndHeight.w;\\n\\\n    vec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\\n\\\n\\n\\\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\\n\\\n    float webMercatorT = textureCoordAndEncodedNormals.z;\\n\\\n    float encodedNormal = textureCoordAndEncodedNormals.w;\\n\\\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\\n\\\n    float webMercatorT = textureCoordinates.y;\\n\\\n    float encodedNormal = textureCoordAndEncodedNormals.z;\\n\\\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\\n\\\n    float webMercatorT = textureCoordAndEncodedNormals.z;\\n\\\n    float encodedNormal = 0.0;\\n\\\n#else\\n\\\n    float webMercatorT = textureCoordinates.y;\\n\\\n    float encodedNormal = 0.0;\\n\\\n#endif\\n\\\n\\n\\\n#endif\\n\\\n\\n\\\n    vec3 position3DWC = position + u_center3D;\\n\\\n\\n\\\n#ifdef GEODETIC_SURFACE_NORMALS\\n\\\n    vec3 ellipsoidNormal = geodeticSurfaceNormal;\\n\\\n#else\\n\\\n    vec3 ellipsoidNormal = normalize(position3DWC);\\n\\\n#endif\\n\\\n\\n\\\n#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)\\n\\\n    float exaggeration = u_verticalExaggerationAndRelativeHeight.x;\\n\\\n    float relativeHeight = u_verticalExaggerationAndRelativeHeight.y;\\n\\\n    float newHeight = (height - relativeHeight) * exaggeration + relativeHeight;\\n\\\n\\n\\\n    // stop from going through center of earth\\n\\\n    float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z);\\n\\\n    newHeight = max(newHeight, -minRadius);\\n\\\n\\n\\\n    vec3 offset = ellipsoidNormal * (newHeight - height);\\n\\\n    position += offset;\\n\\\n    position3DWC += offset;\\n\\\n    height = newHeight;\\n\\\n#endif\\n\\\n\\n\\\n    gl_Position = getPosition(position, height, textureCoordinates);\\n\\\n\\n\\\n    v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\\n\\\n    v_positionMC = position3DWC;  // position in model coordinates\\n\\\n\\n\\\n    v_textureCoordinates = vec3(textureCoordinates, webMercatorT);\\n\\\n\\n\\\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\\n\\\n    vec3 normalMC = czm_octDecode(encodedNormal);\\n\\\n\\n\\\n#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)\\n\\\n    vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal;\\n\\\n    vec3 rejection = normalMC - projection;\\n\\\n    normalMC = normalize(projection + rejection * exaggeration);\\n\\\n#endif\\n\\\n\\n\\\n    v_normalMC = normalMC;\\n\\\n    v_normalEC = czm_normal3D * v_normalMC;\\n\\\n#endif\\n\\\n\\n\\\n#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE))\\n\\\n\\n\\\n    bool dynamicLighting = false;\\n\\\n\\n\\\n    #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))\\n\\\n        dynamicLighting = true;\\n\\\n    #endif\\n\\\n\\n\\\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)\\n\\\n    vec3 atmosphereLightDirection = czm_sunDirectionWC;\\n\\\n#else\\n\\\n    vec3 atmosphereLightDirection = czm_lightDirectionWC;\\n\\\n#endif\\n\\\n\\n\\\n    vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC));\\n\\\n\\n\\\n    computeAtmosphereScattering(\\n\\\n        position3DWC,\\n\\\n        lightDirection,\\n\\\n        v_atmosphereRayleighColor,\\n\\\n        v_atmosphereMieColor,\\n\\\n        v_atmosphereOpacity\\n\\\n    );\\n\\\n#endif\\n\\\n\\n\\\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\\n\\\n    v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\\n\\\n#endif\\n\\\n\\n\\\n#ifdef APPLY_MATERIAL\\n\\\n    float northPoleZ = czm_ellipsoidRadii.z;\\n\\\n    vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);\\n\\\n    vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));\\n\\\n    float dotProd = abs(dot(ellipsoidNormal, v_normalMC));\\n\\\n    v_slope = acos(dotProd);\\n\\\n    vec3 normalRejected = ellipsoidNormal * dotProd;\\n\\\n    vec3 normalProjected = v_normalMC - normalRejected;\\n\\\n    vec3 aspectVector = normalize(normalProjected);\\n\\\n    v_aspect = acos(dot(aspectVector, vectorEastMC));\\n\\\n    float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);\\n\\\n    v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);\\n\\\n    v_height = height;\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec3 u_radiiAndDynamicAtmosphereColor;\\n\\\n\\n\\\nuniform float u_atmosphereLightIntensity;\\n\\\nuniform float u_atmosphereRayleighScaleHeight;\\n\\\nuniform float u_atmosphereMieScaleHeight;\\n\\\nuniform float u_atmosphereMieAnisotropy;\\n\\\nuniform vec3 u_atmosphereRayleighCoefficient;\\n\\\nuniform vec3 u_atmosphereMieCoefficient;\\n\\\n\\n\\\nconst float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.\\n\\\nconst int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.\\n\\\nconst int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.\\n\\\n\\n\\\n/**\\n\\\n * Rational approximation to tanh(x)\\n\\\n*/\\n\\\nfloat approximateTanh(float x) {\\n\\\n    float x2 = x * x;\\n\\\n    return max(-1.0, min(+1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2)));\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as\\n\\\n * the transmittance value for the ray.\\n\\\n *\\n\\\n * @param {czm_ray} primaryRay The ray from the camera to the position.\\n\\\n * @param {float} primaryRayLength The length of the primary ray.\\n\\\n * @param {vec3} lightDirection The direction of the light to calculate the scattering from.\\n\\\n * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.\\n\\\n * @param {vec3} mieColor The variable the Mie scattering will be written to.\\n\\\n * @param {float} opacity The variable the transmittance will be written to.\\n\\\n * @glslFunction\\n\\\n */\\n\\\nvoid computeScattering(\\n\\\n    czm_ray primaryRay,\\n\\\n    float primaryRayLength,\\n\\\n    vec3 lightDirection,\\n\\\n    float atmosphereInnerRadius,\\n\\\n    out vec3 rayleighColor,\\n\\\n    out vec3 mieColor,\\n\\\n    out float opacity\\n\\\n) {\\n\\\n\\n\\\n    // Initialize the default scattering amounts to 0.\\n\\\n    rayleighColor = vec3(0.0);\\n\\\n    mieColor = vec3(0.0);\\n\\\n    opacity = 0.0;\\n\\\n\\n\\\n    float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;\\n\\\n\\n\\\n    vec3 origin = vec3(0.0);\\n\\\n\\n\\\n    // Calculate intersection from the camera to the outer ring of the atmosphere.\\n\\\n    czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);\\n\\\n\\n\\\n    // Return empty colors if no intersection with the atmosphere geometry.\\n\\\n    if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {\\n\\\n        return;\\n\\\n    }\\n\\\n\\n\\\n    // To deal with smaller values of PRIMARY_STEPS (e.g. 4)\\n\\\n    // we implement a split strategy: sky or horizon.\\n\\\n    // For performance reasons, instead of a if/else branch\\n\\\n    // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0\\n\\\n    float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);\\n\\\n    // Value close to 0.0: close to the horizon\\n\\\n    // Value close to 1.0: above in the sky\\n\\\n    float w_stop_gt_lprl = 0.5 * (1.0 + approximateTanh(x));\\n\\\n    \\n\\\n    // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.\\n\\\n    float start_0 = primaryRayAtmosphereIntersect.start;\\n\\\n    primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);\\n\\\n    // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.\\n\\\n    primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));\\n\\\n\\n\\\n    // For the number of ray steps, distinguish inside or outside atmosphere (outer space)\\n\\\n    // (1) from outer space we have to use more ray steps to get a realistic rendering\\n\\\n    // (2) within atmosphere we need fewer steps for faster rendering\\n\\\n    float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters\\n\\\n    float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + approximateTanh(x_o_a));\\n\\\n    int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled.\\n\\\n    int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.\\n\\\n\\n\\\n    // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.\\n\\\n    float rayPositionLength = primaryRayAtmosphereIntersect.start;\\n\\\n    // (1) Outside the atmosphere: constant rayStepLength\\n\\\n    // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps\\n\\\n    float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;\\n\\\n    float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));\\n\\\n    float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));\\n\\\n\\n\\\n    vec3 rayleighAccumulation = vec3(0.0);\\n\\\n    vec3 mieAccumulation = vec3(0.0);\\n\\\n    vec2 opticalDepth = vec2(0.0);\\n\\\n    vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight);\\n\\\n\\n\\\n    // Sample positions on the primary ray.\\n\\\n    for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {\\n\\\n\\n\\\n        // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot\\n\\\n        // loop with non-constant condition, so it has to break early instead\\n\\\n        if (i >= PRIMARY_STEPS) {\\n\\\n            break;\\n\\\n        }\\n\\\n\\n\\\n        // Calculate sample position along viewpoint ray.\\n\\\n        vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);\\n\\\n\\n\\\n        // Calculate height of sample position above ellipsoid.\\n\\\n        float sampleHeight = length(samplePosition) - atmosphereInnerRadius;\\n\\\n\\n\\\n        // Calculate and accumulate density of particles at the sample position.\\n\\\n        vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;\\n\\\n        opticalDepth += sampleDensity;\\n\\\n\\n\\\n        // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.\\n\\\n        czm_ray lightRay = czm_ray(samplePosition, lightDirection);\\n\\\n        czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);\\n\\\n\\n\\\n        float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);\\n\\\n        float lightPositionLength = 0.0;\\n\\\n\\n\\\n        vec2 lightOpticalDepth = vec2(0.0);\\n\\\n\\n\\\n        // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.\\n\\\n        for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {\\n\\\n\\n\\\n            // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot\\n\\\n            // loop with non-constant condition, so it has to break early instead\\n\\\n            if (j >= LIGHT_STEPS) {\\n\\\n                break;\\n\\\n            }\\n\\\n\\n\\\n            // Calculate sample position along light ray.\\n\\\n            vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);\\n\\\n\\n\\\n            // Calculate height of the light sample position above ellipsoid.\\n\\\n            float lightHeight = length(lightPosition) - atmosphereInnerRadius;\\n\\\n\\n\\\n            // Calculate density of photons at the light sample position.\\n\\\n            lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;\\n\\\n\\n\\\n            // Increment distance on light ray.\\n\\\n            lightPositionLength += lightStepLength;\\n\\\n        }\\n\\\n\\n\\\n        // Compute attenuation via the primary ray and the light ray.\\n\\\n        vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));\\n\\\n\\n\\\n        // Accumulate the scattering.\\n\\\n        rayleighAccumulation += sampleDensity.x * attenuation;\\n\\\n        mieAccumulation += sampleDensity.y * attenuation;\\n\\\n\\n\\\n        // Increment distance on primary ray.\\n\\\n        rayPositionLength += (rayStepLength += rayStepLengthIncrease);\\n\\\n    }\\n\\\n\\n\\\n    // Compute the scattering amount.\\n\\\n    rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation;\\n\\\n    mieColor = u_atmosphereMieCoefficient * mieAccumulation;\\n\\\n\\n\\\n    // Compute the transmittance i.e. how much light is passing through the atmosphere.\\n\\\n    opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x))));\\n\\\n}\\n\\\n\\n\\\nvec4 computeAtmosphereColor(\\n\\\n    vec3 positionWC,\\n\\\n    vec3 lightDirection,\\n\\\n    vec3 rayleighColor,\\n\\\n    vec3 mieColor,\\n\\\n    float opacity\\n\\\n) {\\n\\\n    // Setup the primary ray: from the camera position to the vertex position.\\n\\\n    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;\\n\\\n    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);\\n\\\n\\n\\\n    float cosAngle = dot(cameraToPositionWCDirection, lightDirection);\\n\\\n    float cosAngleSq = cosAngle * cosAngle;\\n\\\n\\n\\\n    float G = u_atmosphereMieAnisotropy;\\n\\\n    float GSq = G * G;\\n\\\n\\n\\\n    // The Rayleigh phase function.\\n\\\n    float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);\\n\\\n    // The Mie phase function.\\n\\\n    float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));\\n\\\n\\n\\\n    // The final color is generated by combining the effects of the Rayleigh and Mie scattering.\\n\\\n    vec3 rayleigh = rayleighPhase * rayleighColor;\\n\\\n    vec3 mie = miePhase * mieColor;\\n\\\n\\n\\\n    vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity;\\n\\\n\\n\\\n    return vec4(color, opacity);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {\\n\\\n\\n\\\n    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;\\n\\\n    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);\\n\\\n    czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);\\n\\\n    \\n\\\n    float atmosphereInnerRadius = length(positionWC);\\n\\\n\\n\\\n    computeScattering(\\n\\\n        primaryRay,\\n\\\n        length(cameraToPositionWC),\\n\\\n        lightDirection,\\n\\\n        atmosphereInnerRadius,\\n\\\n        rayleighColor,\\n\\\n        mieColor,\\n\\\n        opacity\\n\\\n    );\\n\\\n}\\n\\\n\";\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Check from \"../Core/Check.js\";\nimport ClippingPlaneCollection from \"./ClippingPlaneCollection.js\";\n\nconst textureResolutionScratch = new Cartesian2();\n/**\n * Gets the GLSL functions needed to retrieve clipping planes from a ClippingPlaneCollection's texture.\n *\n * @param {ClippingPlaneCollection} clippingPlaneCollection ClippingPlaneCollection with a defined texture.\n * @param {Context} context The current rendering context.\n * @returns {string} A string containing GLSL functions for retrieving clipping planes.\n * @private\n */\nfunction getClippingFunction(clippingPlaneCollection, context) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"clippingPlaneCollection\", clippingPlaneCollection);\n  Check.typeOf.object(\"context\", context);\n  //>>includeEnd('debug');\n  const unionClippingRegions = clippingPlaneCollection.unionClippingRegions;\n  const clippingPlanesLength = clippingPlaneCollection.length;\n  const usingFloatTexture = ClippingPlaneCollection.useFloatTexture(context);\n  const textureResolution = ClippingPlaneCollection.getTextureResolution(\n    clippingPlaneCollection,\n    context,\n    textureResolutionScratch\n  );\n  const width = textureResolution.x;\n  const height = textureResolution.y;\n\n  let functions = usingFloatTexture\n    ? getClippingPlaneFloat(width, height)\n    : getClippingPlaneUint8(width, height);\n  functions += \"\\n\";\n  functions += unionClippingRegions\n    ? clippingFunctionUnion(clippingPlanesLength)\n    : clippingFunctionIntersect(clippingPlanesLength);\n  return functions;\n}\n\nfunction clippingFunctionUnion(clippingPlanesLength) {\n  const functionString =\n    `${\n      \"float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\\n\" +\n      \"{\\n\" +\n      \"    vec4 position = czm_windowToEyeCoordinates(fragCoord);\\n\" +\n      \"    vec3 clipNormal = vec3(0.0);\\n\" +\n      \"    vec3 clipPosition = vec3(0.0);\\n\" +\n      \"    float clipAmount;\\n\" + // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below.\n      \"    float pixelWidth = czm_metersPerPixel(position);\\n\" +\n      \"    bool breakAndDiscard = false;\\n\" +\n      \"    for (int i = 0; i < \"\n    }${clippingPlanesLength}; ++i)\\n` +\n    `    {\\n` +\n    `        vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\\n` +\n    `        clipNormal = clippingPlane.xyz;\\n` +\n    `        clipPosition = -clippingPlane.w * clipNormal;\\n` +\n    `        float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\\n` +\n    `        clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));\\n` +\n    `        if (amount <= 0.0)\\n` +\n    `        {\\n` +\n    `           breakAndDiscard = true;\\n` +\n    `           break;\\n` + // HLSL compiler bug if we discard here: https://bugs.chromium.org/p/angleproject/issues/detail?id=1945#c6\n    `        }\\n` +\n    `    }\\n` +\n    `    if (breakAndDiscard) {\\n` +\n    `        discard;\\n` +\n    `    }\\n` +\n    `    return clipAmount;\\n` +\n    `}\\n`;\n  return functionString;\n}\n\nfunction clippingFunctionIntersect(clippingPlanesLength) {\n  const functionString =\n    `${\n      \"float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\\n\" +\n      \"{\\n\" +\n      \"    bool clipped = true;\\n\" +\n      \"    vec4 position = czm_windowToEyeCoordinates(fragCoord);\\n\" +\n      \"    vec3 clipNormal = vec3(0.0);\\n\" +\n      \"    vec3 clipPosition = vec3(0.0);\\n\" +\n      \"    float clipAmount = 0.0;\\n\" +\n      \"    float pixelWidth = czm_metersPerPixel(position);\\n\" +\n      \"    for (int i = 0; i < \"\n    }${clippingPlanesLength}; ++i)\\n` +\n    `    {\\n` +\n    `        vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\\n` +\n    `        clipNormal = clippingPlane.xyz;\\n` +\n    `        clipPosition = -clippingPlane.w * clipNormal;\\n` +\n    `        float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\\n` +\n    `        clipAmount = max(amount, clipAmount);\\n` +\n    `        clipped = clipped && (amount <= 0.0);\\n` +\n    `    }\\n` +\n    `    if (clipped)\\n` +\n    `    {\\n` +\n    `        discard;\\n` +\n    `    }\\n` +\n    `    return clipAmount;\\n` +\n    `}\\n`;\n  return functionString;\n}\n\nfunction getClippingPlaneFloat(width, height) {\n  const pixelWidth = 1.0 / width;\n  const pixelHeight = 1.0 / height;\n\n  let pixelWidthString = `${pixelWidth}`;\n  if (pixelWidthString.indexOf(\".\") === -1) {\n    pixelWidthString += \".0\";\n  }\n  let pixelHeightString = `${pixelHeight}`;\n  if (pixelHeightString.indexOf(\".\") === -1) {\n    pixelHeightString += \".0\";\n  }\n\n  const functionString =\n    `${\n      \"vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\\n\" +\n      \"{\\n\" +\n      \"    int pixY = clippingPlaneNumber / \"\n    }${width};\\n` +\n    `    int pixX = clippingPlaneNumber - (pixY * ${width});\\n` +\n    `    float u = (float(pixX) + 0.5) * ${pixelWidthString};\\n` + // sample from center of pixel\n    `    float v = (float(pixY) + 0.5) * ${pixelHeightString};\\n` +\n    `    vec4 plane = texture(packedClippingPlanes, vec2(u, v));\\n` +\n    `    return czm_transformPlane(plane, transform);\\n` +\n    `}\\n`;\n  return functionString;\n}\n\nfunction getClippingPlaneUint8(width, height) {\n  const pixelWidth = 1.0 / width;\n  const pixelHeight = 1.0 / height;\n\n  let pixelWidthString = `${pixelWidth}`;\n  if (pixelWidthString.indexOf(\".\") === -1) {\n    pixelWidthString += \".0\";\n  }\n  let pixelHeightString = `${pixelHeight}`;\n  if (pixelHeightString.indexOf(\".\") === -1) {\n    pixelHeightString += \".0\";\n  }\n\n  const functionString =\n    `${\n      \"vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\\n\" +\n      \"{\\n\" +\n      \"    int clippingPlaneStartIndex = clippingPlaneNumber * 2;\\n\" + // clipping planes are two pixels each\n      \"    int pixY = clippingPlaneStartIndex / \"\n    }${width};\\n` +\n    `    int pixX = clippingPlaneStartIndex - (pixY * ${width});\\n` +\n    `    float u = (float(pixX) + 0.5) * ${pixelWidthString};\\n` + // sample from center of pixel\n    `    float v = (float(pixY) + 0.5) * ${pixelHeightString};\\n` +\n    `    vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;\\n` +\n    `    vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);\\n` +\n    `    vec4 plane;\\n` +\n    `    plane.xyz = czm_octDecode(oct, 65535.0);\\n` +\n    `    plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${pixelWidthString}, v)));\\n` +\n    `    return czm_transformPlane(plane, transform);\\n` +\n    `}\\n`;\n  return functionString;\n}\nexport default getClippingFunction;\n", "import defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport TerrainQuantization from \"../Core/TerrainQuantization.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport getClippingFunction from \"./getClippingFunction.js\";\nimport SceneMode from \"./SceneMode.js\";\n\nfunction GlobeSurfaceShader(\n  numberOfDayTextures,\n  flags,\n  material,\n  shaderProgram,\n  clippingShaderState\n) {\n  this.numberOfDayTextures = numberOfDayTextures;\n  this.flags = flags;\n  this.material = material;\n  this.shaderProgram = shaderProgram;\n  this.clippingShaderState = clippingShaderState;\n}\n\n/**\n * Manages the shaders used to shade the surface of a {@link Globe}.\n *\n * @alias GlobeSurfaceShaderSet\n * @private\n */\nfunction GlobeSurfaceShaderSet() {\n  this.baseVertexShaderSource = undefined;\n  this.baseFragmentShaderSource = undefined;\n\n  this._shadersByTexturesFlags = [];\n\n  this.material = undefined;\n}\n\nfunction getPositionMode(sceneMode) {\n  const getPosition3DMode =\n    \"vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }\";\n  const getPositionColumbusViewAnd2DMode =\n    \"vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }\";\n  const getPositionMorphingMode =\n    \"vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }\";\n\n  let positionMode;\n\n  switch (sceneMode) {\n    case SceneMode.SCENE3D:\n      positionMode = getPosition3DMode;\n      break;\n    case SceneMode.SCENE2D:\n    case SceneMode.COLUMBUS_VIEW:\n      positionMode = getPositionColumbusViewAnd2DMode;\n      break;\n    case SceneMode.MORPHING:\n      positionMode = getPositionMorphingMode;\n      break;\n  }\n\n  return positionMode;\n}\n\nfunction get2DYPositionFraction(useWebMercatorProjection) {\n  const get2DYPositionFractionGeographicProjection =\n    \"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }\";\n  const get2DYPositionFractionMercatorProjection =\n    \"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }\";\n  return useWebMercatorProjection\n    ? get2DYPositionFractionMercatorProjection\n    : get2DYPositionFractionGeographicProjection;\n}\n\nGlobeSurfaceShaderSet.prototype.getShaderProgram = function (options) {\n  const frameState = options.frameState;\n  const surfaceTile = options.surfaceTile;\n  const numberOfDayTextures = options.numberOfDayTextures;\n  const applyBrightness = options.applyBrightness;\n  const applyContrast = options.applyContrast;\n  const applyHue = options.applyHue;\n  const applySaturation = options.applySaturation;\n  const applyGamma = options.applyGamma;\n  const applyAlpha = options.applyAlpha;\n  const applyDayNightAlpha = options.applyDayNightAlpha;\n  const applySplit = options.applySplit;\n  const showReflectiveOcean = options.showReflectiveOcean;\n  const showOceanWaves = options.showOceanWaves;\n  const enableLighting = options.enableLighting;\n  const dynamicAtmosphereLighting = options.dynamicAtmosphereLighting;\n  const dynamicAtmosphereLightingFromSun =\n    options.dynamicAtmosphereLightingFromSun;\n  const showGroundAtmosphere = options.showGroundAtmosphere;\n  const perFragmentGroundAtmosphere = options.perFragmentGroundAtmosphere;\n  const hasVertexNormals = options.hasVertexNormals;\n  const useWebMercatorProjection = options.useWebMercatorProjection;\n  const enableFog = options.enableFog;\n  const enableClippingPlanes = options.enableClippingPlanes;\n  const clippingPlanes = options.clippingPlanes;\n  const clippedByBoundaries = options.clippedByBoundaries;\n  const hasImageryLayerCutout = options.hasImageryLayerCutout;\n  const colorCorrect = options.colorCorrect;\n  const highlightFillTile = options.highlightFillTile;\n  const colorToAlpha = options.colorToAlpha;\n  const hasGeodeticSurfaceNormals = options.hasGeodeticSurfaceNormals;\n  const hasExaggeration = options.hasExaggeration;\n  const showUndergroundColor = options.showUndergroundColor;\n  const translucent = options.translucent;\n\n  let quantization = 0;\n  let quantizationDefine = \"\";\n\n  const mesh = surfaceTile.renderedMesh;\n  const terrainEncoding = mesh.encoding;\n  const quantizationMode = terrainEncoding.quantization;\n  if (quantizationMode === TerrainQuantization.BITS12) {\n    quantization = 1;\n    quantizationDefine = \"QUANTIZATION_BITS12\";\n  }\n\n  let cartographicLimitRectangleFlag = 0;\n  let cartographicLimitRectangleDefine = \"\";\n  if (clippedByBoundaries) {\n    cartographicLimitRectangleFlag = 1;\n    cartographicLimitRectangleDefine = \"TILE_LIMIT_RECTANGLE\";\n  }\n\n  let imageryCutoutFlag = 0;\n  let imageryCutoutDefine = \"\";\n  if (hasImageryLayerCutout) {\n    imageryCutoutFlag = 1;\n    imageryCutoutDefine = \"APPLY_IMAGERY_CUTOUT\";\n  }\n\n  const sceneMode = frameState.mode;\n  const flags =\n    sceneMode |\n    (applyBrightness << 2) |\n    (applyContrast << 3) |\n    (applyHue << 4) |\n    (applySaturation << 5) |\n    (applyGamma << 6) |\n    (applyAlpha << 7) |\n    (showReflectiveOcean << 8) |\n    (showOceanWaves << 9) |\n    (enableLighting << 10) |\n    (dynamicAtmosphereLighting << 11) |\n    (dynamicAtmosphereLightingFromSun << 12) |\n    (showGroundAtmosphere << 13) |\n    (perFragmentGroundAtmosphere << 14) |\n    (hasVertexNormals << 15) |\n    (useWebMercatorProjection << 16) |\n    (enableFog << 17) |\n    (quantization << 18) |\n    (applySplit << 19) |\n    (enableClippingPlanes << 20) |\n    (cartographicLimitRectangleFlag << 21) |\n    (imageryCutoutFlag << 22) |\n    (colorCorrect << 23) |\n    (highlightFillTile << 24) |\n    (colorToAlpha << 25) |\n    (hasGeodeticSurfaceNormals << 26) |\n    (hasExaggeration << 27) |\n    (showUndergroundColor << 28) |\n    (translucent << 29) |\n    (applyDayNightAlpha << 30);\n\n  let currentClippingShaderState = 0;\n  if (defined(clippingPlanes) && clippingPlanes.length > 0) {\n    currentClippingShaderState = enableClippingPlanes\n      ? clippingPlanes.clippingPlanesState\n      : 0;\n  }\n  let surfaceShader = surfaceTile.surfaceShader;\n  if (\n    defined(surfaceShader) &&\n    surfaceShader.numberOfDayTextures === numberOfDayTextures &&\n    surfaceShader.flags === flags &&\n    surfaceShader.material === this.material &&\n    surfaceShader.clippingShaderState === currentClippingShaderState\n  ) {\n    return surfaceShader.shaderProgram;\n  }\n\n  // New tile, or tile changed number of textures, flags, or clipping planes\n  let shadersByFlags = this._shadersByTexturesFlags[numberOfDayTextures];\n  if (!defined(shadersByFlags)) {\n    shadersByFlags = this._shadersByTexturesFlags[numberOfDayTextures] = [];\n  }\n\n  surfaceShader = shadersByFlags[flags];\n  if (\n    !defined(surfaceShader) ||\n    surfaceShader.material !== this.material ||\n    surfaceShader.clippingShaderState !== currentClippingShaderState\n  ) {\n    // Cache miss - we've never seen this combination of numberOfDayTextures and flags before.\n    const vs = this.baseVertexShaderSource.clone();\n    const fs = this.baseFragmentShaderSource.clone();\n\n    if (currentClippingShaderState !== 0) {\n      fs.sources.unshift(\n        getClippingFunction(clippingPlanes, frameState.context)\n      ); // Need to go before GlobeFS\n    }\n\n    vs.defines.push(quantizationDefine);\n    fs.defines.push(\n      `TEXTURE_UNITS ${numberOfDayTextures}`,\n      cartographicLimitRectangleDefine,\n      imageryCutoutDefine\n    );\n\n    if (applyBrightness) {\n      fs.defines.push(\"APPLY_BRIGHTNESS\");\n    }\n    if (applyContrast) {\n      fs.defines.push(\"APPLY_CONTRAST\");\n    }\n    if (applyHue) {\n      fs.defines.push(\"APPLY_HUE\");\n    }\n    if (applySaturation) {\n      fs.defines.push(\"APPLY_SATURATION\");\n    }\n    if (applyGamma) {\n      fs.defines.push(\"APPLY_GAMMA\");\n    }\n    if (applyAlpha) {\n      fs.defines.push(\"APPLY_ALPHA\");\n    }\n    if (applyDayNightAlpha) {\n      fs.defines.push(\"APPLY_DAY_NIGHT_ALPHA\");\n    }\n    if (showReflectiveOcean) {\n      fs.defines.push(\"SHOW_REFLECTIVE_OCEAN\");\n      vs.defines.push(\"SHOW_REFLECTIVE_OCEAN\");\n    }\n    if (showOceanWaves) {\n      fs.defines.push(\"SHOW_OCEAN_WAVES\");\n    }\n    if (colorToAlpha) {\n      fs.defines.push(\"APPLY_COLOR_TO_ALPHA\");\n    }\n    if (showUndergroundColor) {\n      vs.defines.push(\"UNDERGROUND_COLOR\");\n      fs.defines.push(\"UNDERGROUND_COLOR\");\n    }\n    if (translucent) {\n      vs.defines.push(\"TRANSLUCENT\");\n      fs.defines.push(\"TRANSLUCENT\");\n    }\n    if (enableLighting) {\n      if (hasVertexNormals) {\n        vs.defines.push(\"ENABLE_VERTEX_LIGHTING\");\n        fs.defines.push(\"ENABLE_VERTEX_LIGHTING\");\n      } else {\n        vs.defines.push(\"ENABLE_DAYNIGHT_SHADING\");\n        fs.defines.push(\"ENABLE_DAYNIGHT_SHADING\");\n      }\n    }\n\n    if (dynamicAtmosphereLighting) {\n      vs.defines.push(\"DYNAMIC_ATMOSPHERE_LIGHTING\");\n      fs.defines.push(\"DYNAMIC_ATMOSPHERE_LIGHTING\");\n      if (dynamicAtmosphereLightingFromSun) {\n        vs.defines.push(\"DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN\");\n        fs.defines.push(\"DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN\");\n      }\n    }\n\n    if (showGroundAtmosphere) {\n      vs.defines.push(\"GROUND_ATMOSPHERE\");\n      fs.defines.push(\"GROUND_ATMOSPHERE\");\n      if (perFragmentGroundAtmosphere) {\n        vs.defines.push(\"PER_FRAGMENT_GROUND_ATMOSPHERE\");\n        fs.defines.push(\"PER_FRAGMENT_GROUND_ATMOSPHERE\");\n      }\n    }\n\n    vs.defines.push(\"INCLUDE_WEB_MERCATOR_Y\");\n    fs.defines.push(\"INCLUDE_WEB_MERCATOR_Y\");\n\n    if (enableFog) {\n      vs.defines.push(\"FOG\");\n      fs.defines.push(\"FOG\");\n    }\n\n    if (applySplit) {\n      fs.defines.push(\"APPLY_SPLIT\");\n    }\n\n    if (enableClippingPlanes) {\n      fs.defines.push(\"ENABLE_CLIPPING_PLANES\");\n    }\n\n    if (colorCorrect) {\n      fs.defines.push(\"COLOR_CORRECT\");\n    }\n\n    if (highlightFillTile) {\n      fs.defines.push(\"HIGHLIGHT_FILL_TILE\");\n    }\n\n    if (hasGeodeticSurfaceNormals) {\n      vs.defines.push(\"GEODETIC_SURFACE_NORMALS\");\n    }\n\n    if (hasExaggeration) {\n      vs.defines.push(\"EXAGGERATION\");\n    }\n\n    let computeDayColor =\n      \"\\\n    vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)\\n\\\n    {\\n\\\n        vec4 color = initialColor;\\n\";\n\n    if (hasImageryLayerCutout) {\n      computeDayColor +=\n        \"\\\n        vec4 cutoutAndColorResult;\\n\\\n        bool texelUnclipped;\\n\";\n    }\n\n    for (let i = 0; i < numberOfDayTextures; ++i) {\n      if (hasImageryLayerCutout) {\n        computeDayColor += `\\\n        cutoutAndColorResult = u_dayTextureCutoutRectangles[${i}];\\n\\\n        texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;\\n\\\n        cutoutAndColorResult = sampleAndBlend(\\n`;\n      } else {\n        computeDayColor += \"\\\n        color = sampleAndBlend(\\n\";\n      }\n      computeDayColor += `\\\n            color,\\n\\\n            u_dayTextures[${i}],\\n\\\n            u_dayTextureUseWebMercatorT[${i}] ? textureCoordinates.xz : textureCoordinates.xy,\\n\\\n            u_dayTextureTexCoordsRectangle[${i}],\\n\\\n            u_dayTextureTranslationAndScale[${i}],\\n\\\n            ${applyAlpha ? `u_dayTextureAlpha[${i}]` : \"1.0\"},\\n\\\n            ${applyDayNightAlpha ? `u_dayTextureNightAlpha[${i}]` : \"1.0\"},\\n${\n        applyDayNightAlpha ? `u_dayTextureDayAlpha[${i}]` : \"1.0\"\n      },\\n${applyBrightness ? `u_dayTextureBrightness[${i}]` : \"0.0\"},\\n\\\n            ${applyContrast ? `u_dayTextureContrast[${i}]` : \"0.0\"},\\n\\\n            ${applyHue ? `u_dayTextureHue[${i}]` : \"0.0\"},\\n\\\n            ${applySaturation ? `u_dayTextureSaturation[${i}]` : \"0.0\"},\\n\\\n            ${applyGamma ? `u_dayTextureOneOverGamma[${i}]` : \"0.0\"},\\n\\\n            ${applySplit ? `u_dayTextureSplit[${i}]` : \"0.0\"},\\n\\\n            ${colorToAlpha ? `u_colorsToAlpha[${i}]` : \"vec4(0.0)\"},\\n\\\n        nightBlend\\\n        );\\n`;\n      if (hasImageryLayerCutout) {\n        computeDayColor +=\n          \"\\\n        color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);\\n\";\n      }\n    }\n\n    computeDayColor += \"\\\n        return color;\\n\\\n    }\";\n\n    fs.sources.push(computeDayColor);\n\n    vs.sources.push(getPositionMode(sceneMode));\n    vs.sources.push(get2DYPositionFraction(useWebMercatorProjection));\n\n    const shader = ShaderProgram.fromCache({\n      context: frameState.context,\n      vertexShaderSource: vs,\n      fragmentShaderSource: fs,\n      attributeLocations: terrainEncoding.getAttributeLocations(),\n    });\n\n    surfaceShader = shadersByFlags[flags] = new GlobeSurfaceShader(\n      numberOfDayTextures,\n      flags,\n      this.material,\n      shader,\n      currentClippingShaderState\n    );\n  }\n\n  surfaceTile.surfaceShader = surfaceShader;\n  return surfaceShader.shaderProgram;\n};\n\nGlobeSurfaceShaderSet.prototype.destroy = function () {\n  let flags;\n  let shader;\n\n  const shadersByTexturesFlags = this._shadersByTexturesFlags;\n  for (const textureCount in shadersByTexturesFlags) {\n    if (shadersByTexturesFlags.hasOwnProperty(textureCount)) {\n      const shadersByFlags = shadersByTexturesFlags[textureCount];\n      if (!defined(shadersByFlags)) {\n        continue;\n      }\n\n      for (flags in shadersByFlags) {\n        if (shadersByFlags.hasOwnProperty(flags)) {\n          shader = shadersByFlags[flags];\n          if (defined(shader)) {\n            shader.shaderProgram.destroy();\n          }\n        }\n      }\n    }\n  }\n\n  return destroyObject(this);\n};\nexport default GlobeSurfaceShaderSet;\n", "/**\n * This enumerated type is used in determining to what extent an object, the occludee,\n * is visible during horizon culling. An occluder may fully block an occludee, in which case\n * it has no visibility, may partially block an occludee from view, or may not block it at all,\n * leading to full visibility.\n *\n * @enum {number}\n */\nconst Visibility = {\n  /**\n   * Represents that no part of an object is visible.\n   *\n   * @type {number}\n   * @constant\n   */\n  NONE: -1,\n\n  /**\n   * Represents that part, but not all, of an object is visible\n   *\n   * @type {number}\n   * @constant\n   */\n  PARTIAL: 0,\n\n  /**\n   * Represents that an object is visible in its entirety.\n   *\n   * @type {number}\n   * @constant\n   */\n  FULL: 1,\n};\nexport default Object.freeze(Visibility);\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport formatError from \"./formatError.js\";\n\n/**\n * Provides details about an error that occurred in an {@link ImageryProvider} or a {@link TerrainProvider}.\n *\n * @alias TileProviderError\n * @constructor\n *\n * @param {ImageryProvider|TerrainProvider} provider The imagery or terrain provider that experienced the error.\n * @param {string} message A message describing the error.\n * @param {number} [x] The X coordinate of the tile that experienced the error, or undefined if the error\n *        is not specific to a particular tile.\n * @param {number} [y] The Y coordinate of the tile that experienced the error, or undefined if the error\n *        is not specific to a particular tile.\n * @param {number} [level] The level of the tile that experienced the error, or undefined if the error\n *        is not specific to a particular tile.\n * @param {number} [timesRetried=0] The number of times this operation has been retried.\n * @param {Error} [error] The error or exception that occurred, if any.\n */\nfunction TileProviderError(\n  provider,\n  message,\n  x,\n  y,\n  level,\n  timesRetried,\n  error\n) {\n  /**\n   * The {@link ImageryProvider} or {@link TerrainProvider} that experienced the error.\n   * @type {ImageryProvider|TerrainProvider}\n   */\n  this.provider = provider;\n\n  /**\n   * The message describing the error.\n   * @type {string}\n   */\n  this.message = message;\n\n  /**\n   * The X coordinate of the tile that experienced the error.  If the error is not specific\n   * to a particular tile, this property will be undefined.\n   * @type {number}\n   */\n  this.x = x;\n\n  /**\n   * The Y coordinate of the tile that experienced the error.  If the error is not specific\n   * to a particular tile, this property will be undefined.\n   * @type {number}\n   */\n  this.y = y;\n\n  /**\n   * The level-of-detail of the tile that experienced the error.  If the error is not specific\n   * to a particular tile, this property will be undefined.\n   * @type {number}\n   */\n  this.level = level;\n\n  /**\n   * The number of times this operation has been retried.\n   * @type {number}\n   * @default 0\n   */\n  this.timesRetried = defaultValue(timesRetried, 0);\n\n  /**\n   * True if the failed operation should be retried; otherwise, false.  The imagery or terrain provider\n   * will set the initial value of this property before raising the event, but any listeners\n   * can change it.  The value after the last listener is invoked will be acted upon.\n   * @type {boolean}\n   * @default false\n   */\n  this.retry = false;\n\n  /**\n   * The error or exception that occurred, if any.\n   * @type {Error}\n   */\n  this.error = error;\n}\n\n/**\n * Reports an error in an {@link ImageryProvider} or {@link TerrainProvider} by raising an event if it has any listeners, or by\n * logging the error to the console if the event has no listeners.  This method also tracks the number\n * of times the operation has been retried.\n *\n * @param {TileProviderError} previousError The error instance returned by this function the last\n *        time it was called for this error, or undefined if this is the first time this error has\n *        occurred.\n * @param {ImageryProvider|TerrainProvider} [provider] The imagery or terrain provider that encountered the error.\n * @param {Event} [event] The event to raise to inform listeners of the error.\n * @param {string} [message] The message describing the error.\n * @param {number} [x] The X coordinate of the tile that experienced the error, or undefined if the\n *        error is not specific to a particular tile.\n * @param {number} [y] The Y coordinate of the tile that experienced the error, or undefined if the\n *        error is not specific to a particular tile.\n * @param {number} [level] The level-of-detail of the tile that experienced the error, or undefined if the\n *        error is not specific to a particular tile.\n * @param {Error} [errorDetails] The error or exception that occurred, if any.\n * @returns {TileProviderError} The error instance that was passed to the event listeners and that\n *          should be passed to this function the next time it is called for the same error in order\n *          to track retry counts.\n */\nTileProviderError.reportError = function (\n  previousError,\n  provider,\n  event,\n  message,\n  x,\n  y,\n  level,\n  errorDetails\n) {\n  let error = previousError;\n  if (!defined(previousError)) {\n    error = new TileProviderError(\n      provider,\n      message,\n      x,\n      y,\n      level,\n      0,\n      errorDetails\n    );\n  } else {\n    error.provider = provider;\n    error.message = message;\n    error.x = x;\n    error.y = y;\n    error.level = level;\n    error.retry = false;\n    error.error = errorDetails;\n    ++error.timesRetried;\n  }\n\n  if (defined(event) && event.numberOfListeners > 0) {\n    event.raiseEvent(error);\n  } else if (defined(provider)) {\n    console.log(\n      `An error occurred in \"${provider.constructor.name}\": ${formatError(\n        message\n      )}`\n    );\n  }\n\n  return error;\n};\n\n/**\n * Reports success of an operation by resetting the retry count of a previous error, if any.  This way,\n * if the error occurs again in the future, the listeners will be informed that it has not yet been retried.\n *\n * @param {TileProviderError} previousError The previous error, or undefined if this operation has\n *        not previously resulted in an error.\n */\nTileProviderError.reportSuccess = function (previousError) {\n  if (defined(previousError)) {\n    previousError.timesRetried = -1;\n  }\n};\n\n/**\n * A function that will be called to retry the operation.\n * @callback TileProviderError.RetryFunction\n */\nexport default TileProviderError;\n", "/**\n * @private\n */\nconst ImageryState = {\n  UNLOADED: 0,\n  TRANSITIONING: 1,\n  RECEIVED: 2,\n  TEXTURE_LOADED: 3,\n  READY: 4,\n  FAILED: 5,\n  INVALID: 6,\n  PLACEHOLDER: 7,\n};\nexport default Object.freeze(ImageryState);\n", "/**\n * The state of a {@link QuadtreeTile} in the tile load pipeline.\n * @enum {number}\n * @private\n */\nconst QuadtreeTileLoadState = {\n  /**\n   * The tile is new and loading has not yet begun.\n   * @type QuadtreeTileLoadState\n   * @constant\n   * @default 0\n   */\n  START: 0,\n\n  /**\n   * Loading is in progress.\n   * @type QuadtreeTileLoadState\n   * @constant\n   * @default 1\n   */\n  LOADING: 1,\n\n  /**\n   * Loading is complete.\n   * @type QuadtreeTileLoadState\n   * @constant\n   * @default 2\n   */\n  DONE: 2,\n\n  /**\n   * The tile has failed to load.\n   * @type QuadtreeTileLoadState\n   * @constant\n   * @default 3\n   */\n  FAILED: 3,\n};\nexport default Object.freeze(QuadtreeTileLoadState);\n", "/**\n * @private\n */\nconst TerrainState = {\n  FAILED: 0,\n  UNLOADED: 1,\n  RECEIVING: 2,\n  RECEIVED: 3,\n  TRANSFORMING: 4,\n  TRANSFORMED: 5,\n  READY: 6,\n};\nexport default Object.freeze(TerrainState);\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport defined from \"../Core/defined.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport IntersectionTests from \"../Core/IntersectionTests.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Ray from \"../Core/Ray.js\";\nimport Request from \"../Core/Request.js\";\nimport RequestState from \"../Core/RequestState.js\";\nimport RequestType from \"../Core/RequestType.js\";\nimport TerrainEncoding from \"../Core/TerrainEncoding.js\";\nimport TileProviderError from \"../Core/TileProviderError.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport ImageryState from \"./ImageryState.js\";\nimport QuadtreeTileLoadState from \"./QuadtreeTileLoadState.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport TerrainState from \"./TerrainState.js\";\n\n/**\n * Contains additional information about a {@link QuadtreeTile} of the globe's surface, and\n * encapsulates state transition logic for loading tiles.\n *\n * @constructor\n * @alias GlobeSurfaceTile\n * @private\n */\nfunction GlobeSurfaceTile() {\n  /**\n   * The {@link TileImagery} attached to this tile.\n   * @type {TileImagery[]}\n   * @default []\n   */\n  this.imagery = [];\n\n  this.waterMaskTexture = undefined;\n  this.waterMaskTranslationAndScale = new Cartesian4(0.0, 0.0, 1.0, 1.0);\n\n  this.terrainData = undefined;\n  this.vertexArray = undefined;\n\n  /**\n   * A bounding region used to estimate distance to the tile. The horizontal bounds are always tight-fitting,\n   * but the `minimumHeight` and `maximumHeight` properties may be derived from the min/max of an ancestor tile\n   * and be quite loose-fitting and thus very poor for estimating distance.\n   * @type {TileBoundingRegion}\n   */\n  this.tileBoundingRegion = undefined;\n  this.occludeePointInScaledSpace = new Cartesian3();\n  this.boundingVolumeSourceTile = undefined;\n  this.boundingVolumeIsFromMesh = false;\n\n  this.terrainState = TerrainState.UNLOADED;\n  this.mesh = undefined;\n  this.fill = undefined;\n\n  this.pickBoundingSphere = new BoundingSphere();\n\n  this.surfaceShader = undefined;\n  this.isClipped = true;\n\n  this.clippedByBoundaries = false;\n}\n\nObject.defineProperties(GlobeSurfaceTile.prototype, {\n  /**\n   * Gets a value indicating whether or not this tile is eligible to be unloaded.\n   * Typically, a tile is ineligible to be unloaded while an asynchronous operation,\n   * such as a request for data, is in progress on it.  A tile will never be\n   * unloaded while it is needed for rendering, regardless of the value of this\n   * property.\n   * @memberof GlobeSurfaceTile.prototype\n   * @type {boolean}\n   */\n  eligibleForUnloading: {\n    get: function () {\n      // Do not remove tiles that are transitioning or that have\n      // imagery that is transitioning.\n      const terrainState = this.terrainState;\n      const loadingIsTransitioning =\n        terrainState === TerrainState.RECEIVING ||\n        terrainState === TerrainState.TRANSFORMING;\n\n      let shouldRemoveTile = !loadingIsTransitioning;\n\n      const imagery = this.imagery;\n      for (let i = 0, len = imagery.length; shouldRemoveTile && i < len; ++i) {\n        const tileImagery = imagery[i];\n        shouldRemoveTile =\n          !defined(tileImagery.loadingImagery) ||\n          tileImagery.loadingImagery.state !== ImageryState.TRANSITIONING;\n      }\n\n      return shouldRemoveTile;\n    },\n  },\n\n  /**\n   * Gets the {@link TerrainMesh} that is used for rendering this tile, if any.\n   * Returns the value of the {@link GlobeSurfaceTile#mesh} property if\n   * {@link GlobeSurfaceTile#vertexArray} is defined. Otherwise, It returns the\n   * {@link TerrainFillMesh#mesh} property of the {@link GlobeSurfaceTile#fill}.\n   * If there is no fill, it returns undefined.\n   *\n   * @memberof GlobeSurfaceTile.prototype\n   * @type {TerrainMesh}\n   */\n  renderedMesh: {\n    get: function () {\n      if (defined(this.vertexArray)) {\n        return this.mesh;\n      } else if (defined(this.fill)) {\n        return this.fill.mesh;\n      }\n      return undefined;\n    },\n  },\n});\n\nconst scratchCartographic = new Cartographic();\n\nfunction getPosition(encoding, mode, projection, vertices, index, result) {\n  let position = encoding.getExaggeratedPosition(vertices, index, result);\n\n  if (defined(mode) && mode !== SceneMode.SCENE3D) {\n    const ellipsoid = projection.ellipsoid;\n    const positionCartographic = ellipsoid.cartesianToCartographic(\n      position,\n      scratchCartographic\n    );\n    position = projection.project(positionCartographic, result);\n    position = Cartesian3.fromElements(\n      position.z,\n      position.x,\n      position.y,\n      result\n    );\n  }\n\n  return position;\n}\n\nconst scratchV0 = new Cartesian3();\nconst scratchV1 = new Cartesian3();\nconst scratchV2 = new Cartesian3();\n\nGlobeSurfaceTile.prototype.pick = function (\n  ray,\n  mode,\n  projection,\n  cullBackFaces,\n  result\n) {\n  const mesh = this.renderedMesh;\n  if (!defined(mesh)) {\n    return undefined;\n  }\n\n  const vertices = mesh.vertices;\n  const indices = mesh.indices;\n  const encoding = mesh.encoding;\n  const indicesLength = indices.length;\n\n  let minT = Number.MAX_VALUE;\n\n  for (let i = 0; i < indicesLength; i += 3) {\n    const i0 = indices[i];\n    const i1 = indices[i + 1];\n    const i2 = indices[i + 2];\n\n    const v0 = getPosition(encoding, mode, projection, vertices, i0, scratchV0);\n    const v1 = getPosition(encoding, mode, projection, vertices, i1, scratchV1);\n    const v2 = getPosition(encoding, mode, projection, vertices, i2, scratchV2);\n\n    const t = IntersectionTests.rayTriangleParametric(\n      ray,\n      v0,\n      v1,\n      v2,\n      cullBackFaces\n    );\n    if (defined(t) && t < minT && t >= 0.0) {\n      minT = t;\n    }\n  }\n\n  return minT !== Number.MAX_VALUE\n    ? Ray.getPoint(ray, minT, result)\n    : undefined;\n};\n\nGlobeSurfaceTile.prototype.freeResources = function () {\n  if (defined(this.waterMaskTexture)) {\n    --this.waterMaskTexture.referenceCount;\n    if (this.waterMaskTexture.referenceCount === 0) {\n      this.waterMaskTexture.destroy();\n    }\n    this.waterMaskTexture = undefined;\n  }\n\n  this.terrainData = undefined;\n\n  this.terrainState = TerrainState.UNLOADED;\n  this.mesh = undefined;\n  this.fill = this.fill && this.fill.destroy();\n\n  const imageryList = this.imagery;\n  for (let i = 0, len = imageryList.length; i < len; ++i) {\n    imageryList[i].freeResources();\n  }\n  this.imagery.length = 0;\n\n  this.freeVertexArray();\n};\n\nGlobeSurfaceTile.prototype.freeVertexArray = function () {\n  GlobeSurfaceTile._freeVertexArray(this.vertexArray);\n  this.vertexArray = undefined;\n  GlobeSurfaceTile._freeVertexArray(this.wireframeVertexArray);\n  this.wireframeVertexArray = undefined;\n};\n\nGlobeSurfaceTile.initialize = function (\n  tile,\n  terrainProvider,\n  imageryLayerCollection\n) {\n  let surfaceTile = tile.data;\n  if (!defined(surfaceTile)) {\n    surfaceTile = tile.data = new GlobeSurfaceTile();\n  }\n\n  if (tile.state === QuadtreeTileLoadState.START) {\n    prepareNewTile(tile, terrainProvider, imageryLayerCollection);\n    tile.state = QuadtreeTileLoadState.LOADING;\n  }\n};\n\nGlobeSurfaceTile.processStateMachine = function (\n  tile,\n  frameState,\n  terrainProvider,\n  imageryLayerCollection,\n  quadtree,\n  vertexArraysToDestroy,\n  terrainOnly\n) {\n  GlobeSurfaceTile.initialize(tile, terrainProvider, imageryLayerCollection);\n\n  const surfaceTile = tile.data;\n\n  if (tile.state === QuadtreeTileLoadState.LOADING) {\n    processTerrainStateMachine(\n      tile,\n      frameState,\n      terrainProvider,\n      imageryLayerCollection,\n      quadtree,\n      vertexArraysToDestroy\n    );\n  }\n\n  // From here down we're loading imagery, not terrain. We don't want to load imagery until\n  // we're certain that the terrain tiles are actually visible, though. We'll load terrainOnly\n  // in these scenarios:\n  //   * our bounding volume isn't accurate so we're not certain this tile is really visible (see GlobeSurfaceTileProvider#loadTile).\n  //   * we want to upsample from this tile but don't plan to render it (see processTerrainStateMachine).\n  if (terrainOnly) {\n    return;\n  }\n\n  const wasAlreadyRenderable = tile.renderable;\n\n  // The terrain is renderable as soon as we have a valid vertex array.\n  tile.renderable = defined(surfaceTile.vertexArray);\n\n  // But it's not done loading until it's in the READY state.\n  const isTerrainDoneLoading = surfaceTile.terrainState === TerrainState.READY;\n\n  // If this tile's terrain and imagery are just upsampled from its parent, mark the tile as\n  // upsampled only.  We won't refine a tile if its four children are upsampled only.\n  tile.upsampledFromParent =\n    defined(surfaceTile.terrainData) &&\n    surfaceTile.terrainData.wasCreatedByUpsampling();\n\n  const isImageryDoneLoading = surfaceTile.processImagery(\n    tile,\n    terrainProvider,\n    frameState\n  );\n\n  if (isTerrainDoneLoading && isImageryDoneLoading) {\n    const callbacks = tile._loadedCallbacks;\n    const newCallbacks = {};\n    for (const layerId in callbacks) {\n      if (callbacks.hasOwnProperty(layerId)) {\n        if (!callbacks[layerId](tile)) {\n          newCallbacks[layerId] = callbacks[layerId];\n        }\n      }\n    }\n    tile._loadedCallbacks = newCallbacks;\n\n    tile.state = QuadtreeTileLoadState.DONE;\n  }\n\n  // Once a tile is renderable, it stays renderable, because doing otherwise would\n  // cause detail (or maybe even the entire globe) to vanish when adding a new\n  // imagery layer. `GlobeSurfaceTileProvider._onLayerAdded` sets renderable to\n  // false for all affected tiles that are not currently being rendered.\n  if (wasAlreadyRenderable) {\n    tile.renderable = true;\n  }\n};\n\nGlobeSurfaceTile.prototype.processImagery = function (\n  tile,\n  terrainProvider,\n  frameState,\n  skipLoading\n) {\n  const surfaceTile = tile.data;\n  let isUpsampledOnly = tile.upsampledFromParent;\n  let isAnyTileLoaded = false;\n  let isDoneLoading = true;\n\n  // Transition imagery states\n  const tileImageryCollection = surfaceTile.imagery;\n  let i, len;\n  for (i = 0, len = tileImageryCollection.length; i < len; ++i) {\n    const tileImagery = tileImageryCollection[i];\n    if (!defined(tileImagery.loadingImagery)) {\n      isUpsampledOnly = false;\n      continue;\n    }\n\n    if (tileImagery.loadingImagery.state === ImageryState.PLACEHOLDER) {\n      const imageryLayer = tileImagery.loadingImagery.imageryLayer;\n      if (imageryLayer.ready) {\n        // Remove the placeholder and add the actual skeletons (if any)\n        // at the same position.  Then continue the loop at the same index.\n        tileImagery.freeResources();\n        tileImageryCollection.splice(i, 1);\n        imageryLayer._createTileImagerySkeletons(tile, terrainProvider, i);\n        --i;\n        len = tileImageryCollection.length;\n        continue;\n      } else {\n        isUpsampledOnly = false;\n      }\n    }\n\n    const thisTileDoneLoading = tileImagery.processStateMachine(\n      tile,\n      frameState,\n      skipLoading\n    );\n    isDoneLoading = isDoneLoading && thisTileDoneLoading;\n\n    // The imagery is renderable as soon as we have any renderable imagery for this region.\n    isAnyTileLoaded =\n      isAnyTileLoaded ||\n      thisTileDoneLoading ||\n      defined(tileImagery.readyImagery);\n\n    isUpsampledOnly =\n      isUpsampledOnly &&\n      defined(tileImagery.loadingImagery) &&\n      (tileImagery.loadingImagery.state === ImageryState.FAILED ||\n        tileImagery.loadingImagery.state === ImageryState.INVALID);\n  }\n\n  tile.upsampledFromParent = isUpsampledOnly;\n\n  // Allow rendering if any available layers are loaded\n  tile.renderable = tile.renderable && (isAnyTileLoaded || isDoneLoading);\n\n  return isDoneLoading;\n};\n\nfunction toggleGeodeticSurfaceNormals(\n  surfaceTile,\n  enabled,\n  ellipsoid,\n  frameState\n) {\n  const renderedMesh = surfaceTile.renderedMesh;\n  const vertexBuffer = renderedMesh.vertices;\n  const encoding = renderedMesh.encoding;\n  const vertexCount = vertexBuffer.length / encoding.stride;\n\n  // Calculate the new stride and generate a new buffer\n  // Clone the other encoding, toggle geodetic surface normals, then clone again to get updated stride\n  let newEncoding = TerrainEncoding.clone(encoding);\n  newEncoding.hasGeodeticSurfaceNormals = enabled;\n  newEncoding = TerrainEncoding.clone(newEncoding);\n  const newStride = newEncoding.stride;\n  const newVertexBuffer = new Float32Array(vertexCount * newStride);\n\n  if (enabled) {\n    encoding.addGeodeticSurfaceNormals(\n      vertexBuffer,\n      newVertexBuffer,\n      ellipsoid\n    );\n  } else {\n    encoding.removeGeodeticSurfaceNormals(vertexBuffer, newVertexBuffer);\n  }\n\n  renderedMesh.vertices = newVertexBuffer;\n  renderedMesh.stride = newStride;\n\n  // delete the old vertex array (which deletes the vertex buffer attached to it), and create a new vertex array with the new vertex buffer\n  const isFill = renderedMesh !== surfaceTile.mesh;\n  if (isFill) {\n    GlobeSurfaceTile._freeVertexArray(surfaceTile.fill.vertexArray);\n    surfaceTile.fill.vertexArray = GlobeSurfaceTile._createVertexArrayForMesh(\n      frameState.context,\n      renderedMesh\n    );\n  } else {\n    GlobeSurfaceTile._freeVertexArray(surfaceTile.vertexArray);\n    surfaceTile.vertexArray = GlobeSurfaceTile._createVertexArrayForMesh(\n      frameState.context,\n      renderedMesh\n    );\n  }\n  GlobeSurfaceTile._freeVertexArray(surfaceTile.wireframeVertexArray);\n  surfaceTile.wireframeVertexArray = undefined;\n}\n\nGlobeSurfaceTile.prototype.addGeodeticSurfaceNormals = function (\n  ellipsoid,\n  frameState\n) {\n  toggleGeodeticSurfaceNormals(this, true, ellipsoid, frameState);\n};\n\nGlobeSurfaceTile.prototype.removeGeodeticSurfaceNormals = function (\n  frameState\n) {\n  toggleGeodeticSurfaceNormals(this, false, undefined, frameState);\n};\n\nGlobeSurfaceTile.prototype.updateExaggeration = function (\n  tile,\n  frameState,\n  quadtree\n) {\n  const surfaceTile = this;\n  const mesh = surfaceTile.renderedMesh;\n  if (mesh === undefined) {\n    return;\n  }\n\n  // Check the tile's terrain encoding to see if it has been exaggerated yet\n  const exaggeration = frameState.verticalExaggeration;\n  const exaggerationRelativeHeight =\n    frameState.verticalExaggerationRelativeHeight;\n  const hasExaggerationScale = exaggeration !== 1.0;\n\n  const encoding = mesh.encoding;\n  const encodingExaggerationScaleChanged =\n    encoding.exaggeration !== exaggeration;\n  const encodingRelativeHeightChanged =\n    encoding.exaggerationRelativeHeight !== exaggerationRelativeHeight;\n\n  if (encodingExaggerationScaleChanged || encodingRelativeHeightChanged) {\n    // Turning exaggeration scale on/off requires adding or removing geodetic surface normals\n    // Relative height only translates, so it has no effect on normals\n    if (encodingExaggerationScaleChanged) {\n      if (hasExaggerationScale && !encoding.hasGeodeticSurfaceNormals) {\n        const ellipsoid = tile.tilingScheme.ellipsoid;\n        surfaceTile.addGeodeticSurfaceNormals(ellipsoid, frameState);\n      } else if (!hasExaggerationScale && encoding.hasGeodeticSurfaceNormals) {\n        surfaceTile.removeGeodeticSurfaceNormals(frameState);\n      }\n    }\n\n    encoding.exaggeration = exaggeration;\n    encoding.exaggerationRelativeHeight = exaggerationRelativeHeight;\n\n    // Notify the quadtree that this tile's height has changed\n    if (quadtree !== undefined) {\n      quadtree._tileToUpdateHeights.push(tile);\n      const customData = tile.customData;\n      const customDataLength = customData.length;\n      for (let i = 0; i < customDataLength; i++) {\n        // Restart the level so that a height update is triggered\n        const data = customData[i];\n        data.level = -1;\n      }\n    }\n  }\n};\n\nfunction prepareNewTile(tile, terrainProvider, imageryLayerCollection) {\n  let available = terrainProvider.getTileDataAvailable(\n    tile.x,\n    tile.y,\n    tile.level\n  );\n\n  if (!defined(available) && defined(tile.parent)) {\n    // Provider doesn't know if this tile is available. Does the parent tile know?\n    const parent = tile.parent;\n    const parentSurfaceTile = parent.data;\n    if (defined(parentSurfaceTile) && defined(parentSurfaceTile.terrainData)) {\n      available = parentSurfaceTile.terrainData.isChildAvailable(\n        parent.x,\n        parent.y,\n        tile.x,\n        tile.y\n      );\n    }\n  }\n\n  if (available === false) {\n    // This tile is not available, so mark it failed so we start upsampling right away.\n    tile.data.terrainState = TerrainState.FAILED;\n  }\n\n  // Map imagery tiles to this terrain tile\n  for (let i = 0, len = imageryLayerCollection.length; i < len; ++i) {\n    const layer = imageryLayerCollection.get(i);\n    if (layer.show) {\n      layer._createTileImagerySkeletons(tile, terrainProvider);\n    }\n  }\n}\n\nfunction processTerrainStateMachine(\n  tile,\n  frameState,\n  terrainProvider,\n  imageryLayerCollection,\n  quadtree,\n  vertexArraysToDestroy\n) {\n  const surfaceTile = tile.data;\n\n  // If this tile is FAILED, we'll need to upsample from the parent. If the parent isn't\n  // ready for that, let's push it along.\n  const parent = tile.parent;\n  if (\n    surfaceTile.terrainState === TerrainState.FAILED &&\n    parent !== undefined\n  ) {\n    const parentReady =\n      parent.data !== undefined &&\n      parent.data.terrainData !== undefined &&\n      parent.data.terrainData.canUpsample !== false;\n    if (!parentReady) {\n      GlobeSurfaceTile.processStateMachine(\n        parent,\n        frameState,\n        terrainProvider,\n        imageryLayerCollection,\n        quadtree,\n        vertexArraysToDestroy,\n        true\n      );\n    }\n  }\n\n  if (surfaceTile.terrainState === TerrainState.FAILED) {\n    upsample(\n      surfaceTile,\n      tile,\n      frameState,\n      terrainProvider,\n      tile.x,\n      tile.y,\n      tile.level\n    );\n  }\n\n  if (surfaceTile.terrainState === TerrainState.UNLOADED) {\n    requestTileGeometry(\n      surfaceTile,\n      terrainProvider,\n      tile.x,\n      tile.y,\n      tile.level\n    );\n  }\n\n  if (surfaceTile.terrainState === TerrainState.RECEIVED) {\n    transform(\n      surfaceTile,\n      frameState,\n      terrainProvider,\n      tile.x,\n      tile.y,\n      tile.level\n    );\n  }\n\n  if (surfaceTile.terrainState === TerrainState.TRANSFORMED) {\n    createResources(\n      surfaceTile,\n      frameState.context,\n      terrainProvider,\n      tile.x,\n      tile.y,\n      tile.level,\n      vertexArraysToDestroy\n    );\n\n    // Update the tile's exaggeration in case the globe's exaggeration changed while the tile was being processed\n    surfaceTile.updateExaggeration(tile, frameState, quadtree);\n  }\n\n  if (\n    surfaceTile.terrainState >= TerrainState.RECEIVED &&\n    surfaceTile.waterMaskTexture === undefined &&\n    terrainProvider.hasWaterMask\n  ) {\n    const terrainData = surfaceTile.terrainData;\n    if (terrainData.waterMask !== undefined) {\n      createWaterMaskTextureIfNeeded(frameState.context, surfaceTile);\n    } else {\n      const sourceTile = surfaceTile._findAncestorTileWithTerrainData(tile);\n      if (defined(sourceTile) && defined(sourceTile.data.waterMaskTexture)) {\n        surfaceTile.waterMaskTexture = sourceTile.data.waterMaskTexture;\n        ++surfaceTile.waterMaskTexture.referenceCount;\n        surfaceTile._computeWaterMaskTranslationAndScale(\n          tile,\n          sourceTile,\n          surfaceTile.waterMaskTranslationAndScale\n        );\n      }\n    }\n  }\n}\n\nfunction upsample(surfaceTile, tile, frameState, terrainProvider, x, y, level) {\n  const parent = tile.parent;\n  if (!parent) {\n    // Trying to upsample from a root tile. No can do. This tile is a failure.\n    tile.state = QuadtreeTileLoadState.FAILED;\n    return;\n  }\n\n  const sourceData = parent.data.terrainData;\n  const sourceX = parent.x;\n  const sourceY = parent.y;\n  const sourceLevel = parent.level;\n\n  if (!defined(sourceData)) {\n    // Parent is not available, so we can't upsample this tile yet.\n    return;\n  }\n\n  const terrainDataPromise = sourceData.upsample(\n    terrainProvider.tilingScheme,\n    sourceX,\n    sourceY,\n    sourceLevel,\n    x,\n    y,\n    level\n  );\n  if (!defined(terrainDataPromise)) {\n    // The upsample request has been deferred - try again later.\n    return;\n  }\n\n  surfaceTile.terrainState = TerrainState.RECEIVING;\n\n  Promise.resolve(terrainDataPromise)\n    .then(function (terrainData) {\n      if (!defined(terrainData)) {\n        // The upsample request has been deferred - try again later.\n        return;\n      }\n\n      surfaceTile.terrainData = terrainData;\n      surfaceTile.terrainState = TerrainState.RECEIVED;\n    })\n    .catch(function () {\n      surfaceTile.terrainState = TerrainState.FAILED;\n    });\n}\n\nfunction requestTileGeometry(surfaceTile, terrainProvider, x, y, level) {\n  function success(terrainData) {\n    if (!defined(terrainData)) {\n      // Throttled due to low priority - try again later.\n      surfaceTile.terrainState = TerrainState.UNLOADED;\n      surfaceTile.request = undefined;\n      return;\n    }\n\n    surfaceTile.terrainData = terrainData;\n    surfaceTile.terrainState = TerrainState.RECEIVED;\n    surfaceTile.request = undefined;\n  }\n\n  function failure(error) {\n    if (surfaceTile.request.state === RequestState.CANCELLED) {\n      // Cancelled due to low priority - try again later.\n      surfaceTile.terrainData = undefined;\n      surfaceTile.terrainState = TerrainState.UNLOADED;\n      surfaceTile.request = undefined;\n      return;\n    }\n\n    // Initially assume failure.  reportError may retry, in which case the state will\n    // change to RECEIVING or UNLOADED.\n    surfaceTile.terrainState = TerrainState.FAILED;\n    surfaceTile.request = undefined;\n\n    const message = `Failed to obtain terrain tile X: ${x} Y: ${y} Level: ${level}. Error message: \"${error}\"`;\n    terrainProvider._requestError = TileProviderError.reportError(\n      terrainProvider._requestError,\n      terrainProvider,\n      terrainProvider.errorEvent,\n      message,\n      x,\n      y,\n      level\n    );\n    if (terrainProvider._requestError.retry) {\n      doRequest();\n    }\n  }\n\n  function doRequest() {\n    // Request the terrain from the terrain provider.\n    const request = new Request({\n      throttle: false,\n      throttleByServer: true,\n      type: RequestType.TERRAIN,\n    });\n    surfaceTile.request = request;\n\n    const requestPromise = terrainProvider.requestTileGeometry(\n      x,\n      y,\n      level,\n      request\n    );\n\n    // If the request method returns undefined (instead of a promise), the request\n    // has been deferred.\n    if (defined(requestPromise)) {\n      surfaceTile.terrainState = TerrainState.RECEIVING;\n      Promise.resolve(requestPromise)\n        .then(function (terrainData) {\n          success(terrainData);\n        })\n        .catch(function (e) {\n          failure(e);\n        });\n    } else {\n      // Deferred - try again later.\n      surfaceTile.terrainState = TerrainState.UNLOADED;\n      surfaceTile.request = undefined;\n    }\n  }\n\n  doRequest();\n}\n\nconst scratchCreateMeshOptions = {\n  tilingScheme: undefined,\n  x: 0,\n  y: 0,\n  level: 0,\n  exaggeration: 1.0,\n  exaggerationRelativeHeight: 0.0,\n  throttle: true,\n};\n\nfunction transform(surfaceTile, frameState, terrainProvider, x, y, level) {\n  const tilingScheme = terrainProvider.tilingScheme;\n\n  const createMeshOptions = scratchCreateMeshOptions;\n  createMeshOptions.tilingScheme = tilingScheme;\n  createMeshOptions.x = x;\n  createMeshOptions.y = y;\n  createMeshOptions.level = level;\n  createMeshOptions.exaggeration = frameState.verticalExaggeration;\n  createMeshOptions.exaggerationRelativeHeight =\n    frameState.verticalExaggerationRelativeHeight;\n  createMeshOptions.throttle = true;\n\n  const terrainData = surfaceTile.terrainData;\n  const meshPromise = terrainData.createMesh(createMeshOptions);\n\n  if (!defined(meshPromise)) {\n    // Postponed.\n    return;\n  }\n\n  surfaceTile.terrainState = TerrainState.TRANSFORMING;\n\n  Promise.resolve(meshPromise)\n    .then(function (mesh) {\n      surfaceTile.mesh = mesh;\n      surfaceTile.terrainState = TerrainState.TRANSFORMED;\n    })\n    .catch(function () {\n      surfaceTile.terrainState = TerrainState.FAILED;\n    });\n}\n\nGlobeSurfaceTile._createVertexArrayForMesh = function (context, mesh) {\n  const typedArray = mesh.vertices;\n  const buffer = Buffer.createVertexBuffer({\n    context: context,\n    typedArray: typedArray,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n  const attributes = mesh.encoding.getAttributes(buffer);\n\n  const indexBuffers = mesh.indices.indexBuffers || {};\n  let indexBuffer = indexBuffers[context.id];\n  if (!defined(indexBuffer) || indexBuffer.isDestroyed()) {\n    const indices = mesh.indices;\n    indexBuffer = Buffer.createIndexBuffer({\n      context: context,\n      typedArray: indices,\n      usage: BufferUsage.STATIC_DRAW,\n      indexDatatype: IndexDatatype.fromSizeInBytes(indices.BYTES_PER_ELEMENT),\n    });\n    indexBuffer.vertexArrayDestroyable = false;\n    indexBuffer.referenceCount = 1;\n    indexBuffers[context.id] = indexBuffer;\n    mesh.indices.indexBuffers = indexBuffers;\n  } else {\n    ++indexBuffer.referenceCount;\n  }\n\n  return new VertexArray({\n    context: context,\n    attributes: attributes,\n    indexBuffer: indexBuffer,\n  });\n};\n\nGlobeSurfaceTile._freeVertexArray = function (vertexArray) {\n  if (defined(vertexArray)) {\n    const indexBuffer = vertexArray.indexBuffer;\n\n    if (!vertexArray.isDestroyed()) {\n      vertexArray.destroy();\n    }\n\n    if (\n      defined(indexBuffer) &&\n      !indexBuffer.isDestroyed() &&\n      defined(indexBuffer.referenceCount)\n    ) {\n      --indexBuffer.referenceCount;\n      if (indexBuffer.referenceCount === 0) {\n        indexBuffer.destroy();\n      }\n    }\n  }\n};\n\nfunction createResources(\n  surfaceTile,\n  context,\n  terrainProvider,\n  x,\n  y,\n  level,\n  vertexArraysToDestroy\n) {\n  surfaceTile.vertexArray = GlobeSurfaceTile._createVertexArrayForMesh(\n    context,\n    surfaceTile.mesh\n  );\n  surfaceTile.terrainState = TerrainState.READY;\n  surfaceTile.fill =\n    surfaceTile.fill && surfaceTile.fill.destroy(vertexArraysToDestroy);\n}\n\nfunction getContextWaterMaskData(context) {\n  let data = context.cache.tile_waterMaskData;\n\n  if (!defined(data)) {\n    const allWaterTexture = Texture.create({\n      context: context,\n      pixelFormat: PixelFormat.LUMINANCE,\n      pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n      source: {\n        arrayBufferView: new Uint8Array([255]),\n        width: 1,\n        height: 1,\n      },\n    });\n    allWaterTexture.referenceCount = 1;\n\n    const sampler = new Sampler({\n      wrapS: TextureWrap.CLAMP_TO_EDGE,\n      wrapT: TextureWrap.CLAMP_TO_EDGE,\n      minificationFilter: TextureMinificationFilter.LINEAR,\n      magnificationFilter: TextureMagnificationFilter.LINEAR,\n    });\n\n    data = {\n      allWaterTexture: allWaterTexture,\n      sampler: sampler,\n      destroy: function () {\n        this.allWaterTexture.destroy();\n      },\n    };\n\n    context.cache.tile_waterMaskData = data;\n  }\n\n  return data;\n}\n\nfunction createWaterMaskTextureIfNeeded(context, surfaceTile) {\n  const waterMask = surfaceTile.terrainData.waterMask;\n  const waterMaskData = getContextWaterMaskData(context);\n  let texture;\n\n  const waterMaskLength = waterMask.length;\n  if (waterMaskLength === 1) {\n    // Length 1 means the tile is entirely land or entirely water.\n    // A value of 0 indicates entirely land, a value of 1 indicates entirely water.\n    if (waterMask[0] !== 0) {\n      texture = waterMaskData.allWaterTexture;\n    } else {\n      // Leave the texture undefined if the tile is entirely land.\n      return;\n    }\n  } else {\n    const textureSize = Math.sqrt(waterMaskLength);\n    texture = Texture.create({\n      context: context,\n      pixelFormat: PixelFormat.LUMINANCE,\n      pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n      source: {\n        width: textureSize,\n        height: textureSize,\n        arrayBufferView: waterMask,\n      },\n      sampler: waterMaskData.sampler,\n      flipY: false,\n    });\n\n    texture.referenceCount = 0;\n  }\n\n  ++texture.referenceCount;\n  surfaceTile.waterMaskTexture = texture;\n\n  Cartesian4.fromElements(\n    0.0,\n    0.0,\n    1.0,\n    1.0,\n    surfaceTile.waterMaskTranslationAndScale\n  );\n}\n\nGlobeSurfaceTile.prototype._findAncestorTileWithTerrainData = function (tile) {\n  let sourceTile = tile.parent;\n\n  while (\n    defined(sourceTile) &&\n    (!defined(sourceTile.data) ||\n      !defined(sourceTile.data.terrainData) ||\n      sourceTile.data.terrainData.wasCreatedByUpsampling())\n  ) {\n    sourceTile = sourceTile.parent;\n  }\n\n  return sourceTile;\n};\n\nGlobeSurfaceTile.prototype._computeWaterMaskTranslationAndScale = function (\n  tile,\n  sourceTile,\n  result\n) {\n  const sourceTileRectangle = sourceTile.rectangle;\n  const tileRectangle = tile.rectangle;\n  const tileWidth = tileRectangle.width;\n  const tileHeight = tileRectangle.height;\n\n  const scaleX = tileWidth / sourceTileRectangle.width;\n  const scaleY = tileHeight / sourceTileRectangle.height;\n  result.x =\n    (scaleX * (tileRectangle.west - sourceTileRectangle.west)) / tileWidth;\n  result.y =\n    (scaleY * (tileRectangle.south - sourceTileRectangle.south)) / tileHeight;\n  result.z = scaleX;\n  result.w = scaleY;\n\n  return result;\n};\nexport default GlobeSurfaceTile;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport WebMercatorProjection from \"./WebMercatorProjection.js\";\n\n/**\n * A tiling scheme for geometry referenced to a {@link WebMercatorProjection}, EPSG:3857.  This is\n * the tiling scheme used by Google Maps, Microsoft Bing Maps, and most of ESRI ArcGIS Online.\n *\n * @alias WebMercatorTilingScheme\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid whose surface is being tiled. Defaults to\n * the WGS84 ellipsoid.\n * @param {number} [options.numberOfLevelZeroTilesX=1] The number of tiles in the X direction at level zero of\n *        the tile tree.\n * @param {number} [options.numberOfLevelZeroTilesY=1] The number of tiles in the Y direction at level zero of\n *        the tile tree.\n * @param {Cartesian2} [options.rectangleSouthwestInMeters] The southwest corner of the rectangle covered by the\n *        tiling scheme, in meters.  If this parameter or rectangleNortheastInMeters is not specified, the entire\n *        globe is covered in the longitude direction and an equal distance is covered in the latitude\n *        direction, resulting in a square projection.\n * @param {Cartesian2} [options.rectangleNortheastInMeters] The northeast corner of the rectangle covered by the\n *        tiling scheme, in meters.  If this parameter or rectangleSouthwestInMeters is not specified, the entire\n *        globe is covered in the longitude direction and an equal distance is covered in the latitude\n *        direction, resulting in a square projection.\n */\nfunction WebMercatorTilingScheme(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  this._numberOfLevelZeroTilesX = defaultValue(\n    options.numberOfLevelZeroTilesX,\n    1\n  );\n  this._numberOfLevelZeroTilesY = defaultValue(\n    options.numberOfLevelZeroTilesY,\n    1\n  );\n\n  this._projection = new WebMercatorProjection(this._ellipsoid);\n\n  if (\n    defined(options.rectangleSouthwestInMeters) &&\n    defined(options.rectangleNortheastInMeters)\n  ) {\n    this._rectangleSouthwestInMeters = options.rectangleSouthwestInMeters;\n    this._rectangleNortheastInMeters = options.rectangleNortheastInMeters;\n  } else {\n    const semimajorAxisTimesPi = this._ellipsoid.maximumRadius * Math.PI;\n    this._rectangleSouthwestInMeters = new Cartesian2(\n      -semimajorAxisTimesPi,\n      -semimajorAxisTimesPi\n    );\n    this._rectangleNortheastInMeters = new Cartesian2(\n      semimajorAxisTimesPi,\n      semimajorAxisTimesPi\n    );\n  }\n\n  const southwest = this._projection.unproject(\n    this._rectangleSouthwestInMeters\n  );\n  const northeast = this._projection.unproject(\n    this._rectangleNortheastInMeters\n  );\n  this._rectangle = new Rectangle(\n    southwest.longitude,\n    southwest.latitude,\n    northeast.longitude,\n    northeast.latitude\n  );\n}\n\nObject.defineProperties(WebMercatorTilingScheme.prototype, {\n  /**\n   * Gets the ellipsoid that is tiled by this tiling scheme.\n   * @memberof WebMercatorTilingScheme.prototype\n   * @type {Ellipsoid}\n   */\n  ellipsoid: {\n    get: function () {\n      return this._ellipsoid;\n    },\n  },\n\n  /**\n   * Gets the rectangle, in radians, covered by this tiling scheme.\n   * @memberof WebMercatorTilingScheme.prototype\n   * @type {Rectangle}\n   */\n  rectangle: {\n    get: function () {\n      return this._rectangle;\n    },\n  },\n\n  /**\n   * Gets the map projection used by this tiling scheme.\n   * @memberof WebMercatorTilingScheme.prototype\n   * @type {MapProjection}\n   */\n  projection: {\n    get: function () {\n      return this._projection;\n    },\n  },\n});\n\n/**\n * Gets the total number of tiles in the X direction at a specified level-of-detail.\n *\n * @param {number} level The level-of-detail.\n * @returns {number} The number of tiles in the X direction at the given level.\n */\nWebMercatorTilingScheme.prototype.getNumberOfXTilesAtLevel = function (level) {\n  return this._numberOfLevelZeroTilesX << level;\n};\n\n/**\n * Gets the total number of tiles in the Y direction at a specified level-of-detail.\n *\n * @param {number} level The level-of-detail.\n * @returns {number} The number of tiles in the Y direction at the given level.\n */\nWebMercatorTilingScheme.prototype.getNumberOfYTilesAtLevel = function (level) {\n  return this._numberOfLevelZeroTilesY << level;\n};\n\n/**\n * Transforms a rectangle specified in geodetic radians to the native coordinate system\n * of this tiling scheme.\n *\n * @param {Rectangle} rectangle The rectangle to transform.\n * @param {Rectangle} [result] The instance to which to copy the result, or undefined if a new instance\n *        should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the native rectangle if 'result'\n *          is undefined.\n */\nWebMercatorTilingScheme.prototype.rectangleToNativeRectangle = function (\n  rectangle,\n  result\n) {\n  const projection = this._projection;\n  const southwest = projection.project(Rectangle.southwest(rectangle));\n  const northeast = projection.project(Rectangle.northeast(rectangle));\n\n  if (!defined(result)) {\n    return new Rectangle(southwest.x, southwest.y, northeast.x, northeast.y);\n  }\n\n  result.west = southwest.x;\n  result.south = southwest.y;\n  result.east = northeast.x;\n  result.north = northeast.y;\n  return result;\n};\n\n/**\n * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates\n * of the tiling scheme.\n *\n * @param {number} x The integer x coordinate of the tile.\n * @param {number} y The integer y coordinate of the tile.\n * @param {number} level The tile level-of-detail.  Zero is the least detailed.\n * @param {object} [result] The instance to which to copy the result, or undefined if a new instance\n *        should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the rectangle\n *          if 'result' is undefined.\n */\nWebMercatorTilingScheme.prototype.tileXYToNativeRectangle = function (\n  x,\n  y,\n  level,\n  result\n) {\n  const xTiles = this.getNumberOfXTilesAtLevel(level);\n  const yTiles = this.getNumberOfYTilesAtLevel(level);\n\n  const xTileWidth =\n    (this._rectangleNortheastInMeters.x - this._rectangleSouthwestInMeters.x) /\n    xTiles;\n  const west = this._rectangleSouthwestInMeters.x + x * xTileWidth;\n  const east = this._rectangleSouthwestInMeters.x + (x + 1) * xTileWidth;\n\n  const yTileHeight =\n    (this._rectangleNortheastInMeters.y - this._rectangleSouthwestInMeters.y) /\n    yTiles;\n  const north = this._rectangleNortheastInMeters.y - y * yTileHeight;\n  const south = this._rectangleNortheastInMeters.y - (y + 1) * yTileHeight;\n\n  if (!defined(result)) {\n    return new Rectangle(west, south, east, north);\n  }\n\n  result.west = west;\n  result.south = south;\n  result.east = east;\n  result.north = north;\n  return result;\n};\n\n/**\n * Converts tile x, y coordinates and level to a cartographic rectangle in radians.\n *\n * @param {number} x The integer x coordinate of the tile.\n * @param {number} y The integer y coordinate of the tile.\n * @param {number} level The tile level-of-detail.  Zero is the least detailed.\n * @param {object} [result] The instance to which to copy the result, or undefined if a new instance\n *        should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the rectangle\n *          if 'result' is undefined.\n */\nWebMercatorTilingScheme.prototype.tileXYToRectangle = function (\n  x,\n  y,\n  level,\n  result\n) {\n  const nativeRectangle = this.tileXYToNativeRectangle(x, y, level, result);\n\n  const projection = this._projection;\n  const southwest = projection.unproject(\n    new Cartesian2(nativeRectangle.west, nativeRectangle.south)\n  );\n  const northeast = projection.unproject(\n    new Cartesian2(nativeRectangle.east, nativeRectangle.north)\n  );\n\n  nativeRectangle.west = southwest.longitude;\n  nativeRectangle.south = southwest.latitude;\n  nativeRectangle.east = northeast.longitude;\n  nativeRectangle.north = northeast.latitude;\n  return nativeRectangle;\n};\n\n/**\n * Calculates the tile x, y coordinates of the tile containing\n * a given cartographic position.\n *\n * @param {Cartographic} position The position.\n * @param {number} level The tile level-of-detail.  Zero is the least detailed.\n * @param {Cartesian2} [result] The instance to which to copy the result, or undefined if a new instance\n *        should be created.\n * @returns {Cartesian2} The specified 'result', or a new object containing the tile x, y coordinates\n *          if 'result' is undefined.\n */\nWebMercatorTilingScheme.prototype.positionToTileXY = function (\n  position,\n  level,\n  result\n) {\n  const rectangle = this._rectangle;\n  if (!Rectangle.contains(rectangle, position)) {\n    // outside the bounds of the tiling scheme\n    return undefined;\n  }\n\n  const xTiles = this.getNumberOfXTilesAtLevel(level);\n  const yTiles = this.getNumberOfYTilesAtLevel(level);\n\n  const overallWidth =\n    this._rectangleNortheastInMeters.x - this._rectangleSouthwestInMeters.x;\n  const xTileWidth = overallWidth / xTiles;\n  const overallHeight =\n    this._rectangleNortheastInMeters.y - this._rectangleSouthwestInMeters.y;\n  const yTileHeight = overallHeight / yTiles;\n\n  const projection = this._projection;\n\n  const webMercatorPosition = projection.project(position);\n  const distanceFromWest =\n    webMercatorPosition.x - this._rectangleSouthwestInMeters.x;\n  const distanceFromNorth =\n    this._rectangleNortheastInMeters.y - webMercatorPosition.y;\n\n  let xTileCoordinate = (distanceFromWest / xTileWidth) | 0;\n  if (xTileCoordinate >= xTiles) {\n    xTileCoordinate = xTiles - 1;\n  }\n  let yTileCoordinate = (distanceFromNorth / yTileHeight) | 0;\n  if (yTileCoordinate >= yTiles) {\n    yTileCoordinate = yTiles - 1;\n  }\n\n  if (!defined(result)) {\n    return new Cartesian2(xTileCoordinate, yTileCoordinate);\n  }\n\n  result.x = xTileCoordinate;\n  result.y = yTileCoordinate;\n  return result;\n};\nexport default WebMercatorTilingScheme;\n", "import Credit from \"../Core/Credit.js\";\nimport defined from \"../Core/defined.js\";\nimport Resource from \"../Core/Resource.js\";\n\nlet defaultTokenCredit;\nconst defaultAccessToken =\n  \"AAPK2b93071721df4cc78be0d8b3d79b1fd54YMocOcx2NxlbYTDkyO5gPk8XsDnguQgeMdFKepFwLwTgb8vHfPvSTdjy_KlMHlS\";\n/**\n * Default options for accessing the ArcGIS image tile service.\n *\n * An ArcGIS access token is required to access ArcGIS image tile layers.\n * A default token is provided for evaluation purposes only.\n * To obtain an access token, go to {@link https://developers.arcgis.com} and create a free account.\n * More info can be found in the {@link https://developers.arcgis.com/documentation/mapping-apis-and-services/security/ | ArcGIS developer guide}.\n *\n * @see ArcGisMapServerImageryProvider\n * @namespace ArcGisMapService\n */\n\nconst ArcGisMapService = {};\n/**\n * Gets or sets the default ArcGIS access token.\n *\n * @type {string}\n */\nArcGisMapService.defaultAccessToken = defaultAccessToken;\n\n/**\n * Gets or sets the URL of the ArcGIS World Imagery tile service.\n *\n * @type {string|Resource}\n * @default https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer\n */\nArcGisMapService.defaultWorldImageryServer = new Resource({\n  url:\n    \"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer\",\n});\n\n/**\n * Gets or sets the URL of the ArcGIS World Hillshade tile service.\n *\n * @type {string|Resource}\n * @default https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer\n */\nArcGisMapService.defaultWorldHillshadeServer = new Resource({\n  url:\n    \"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer\",\n});\n\n/**\n * Gets or sets the URL of the ArcGIS World Oceans tile service.\n *\n * @type {string|Resource}\n * @default https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer\n */\nArcGisMapService.defaultWorldOceanServer = new Resource({\n  url:\n    \"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer\",\n});\n\n/**\n *\n * @param {string} providedKey\n * @return {string|undefined}\n */\nArcGisMapService.getDefaultTokenCredit = function (providedKey) {\n  if (providedKey !== defaultAccessToken) {\n    return undefined;\n  }\n\n  if (!defined(defaultTokenCredit)) {\n    const defaultTokenMessage =\n      '<b> \\\n            This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> \\\n            with an API key from your ArcGIS Developer account before using the ArcGIS tile services. \\\n            You can sign up for a free ArcGIS Developer account at <a href=\"https://developers.arcgis.com/\">https://developers.arcgis.com/</a>.</b>';\n\n    defaultTokenCredit = new Credit(defaultTokenMessage, true);\n  }\n\n  return defaultTokenCredit;\n};\nexport default ArcGisMapService;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport getImagePixels from \"../Core/getImagePixels.js\";\nimport Resource from \"../Core/Resource.js\";\n\n/**\n * A policy for discarding tile images that match a known image containing a\n * \"missing\" image.\n *\n * @alias DiscardMissingTileImagePolicy\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Resource|string} options.missingImageUrl The URL of the known missing image.\n * @param {Cartesian2[]} options.pixelsToCheck An array of {@link Cartesian2} pixel positions to\n *        compare against the missing image.\n * @param {boolean} [options.disableCheckIfAllPixelsAreTransparent=false] If true, the discard check will be disabled\n *                  if all of the pixelsToCheck in the missingImageUrl have an alpha value of 0.  If false, the\n *                  discard check will proceed no matter the values of the pixelsToCheck.\n */\nfunction DiscardMissingTileImagePolicy(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options.missingImageUrl)) {\n    throw new DeveloperError(\"options.missingImageUrl is required.\");\n  }\n\n  if (!defined(options.pixelsToCheck)) {\n    throw new DeveloperError(\"options.pixelsToCheck is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._pixelsToCheck = options.pixelsToCheck;\n  this._missingImagePixels = undefined;\n  this._missingImageByteLength = undefined;\n  this._isReady = false;\n\n  const resource = Resource.createIfNeeded(options.missingImageUrl);\n\n  const that = this;\n\n  function success(image) {\n    if (defined(image.blob)) {\n      that._missingImageByteLength = image.blob.size;\n    }\n\n    let pixels = getImagePixels(image);\n\n    if (options.disableCheckIfAllPixelsAreTransparent) {\n      let allAreTransparent = true;\n      const width = image.width;\n\n      const pixelsToCheck = options.pixelsToCheck;\n      for (\n        let i = 0, len = pixelsToCheck.length;\n        allAreTransparent && i < len;\n        ++i\n      ) {\n        const pos = pixelsToCheck[i];\n        const index = pos.x * 4 + pos.y * width;\n        const alpha = pixels[index + 3];\n\n        if (alpha > 0) {\n          allAreTransparent = false;\n        }\n      }\n\n      if (allAreTransparent) {\n        pixels = undefined;\n      }\n    }\n\n    that._missingImagePixels = pixels;\n    that._isReady = true;\n  }\n\n  function failure() {\n    // Failed to download \"missing\" image, so assume that any truly missing tiles\n    // will also fail to download and disable the discard check.\n    that._missingImagePixels = undefined;\n    that._isReady = true;\n  }\n\n  resource\n    .fetchImage({\n      preferBlob: true,\n      preferImageBitmap: true,\n      flipY: true,\n    })\n    .then(success)\n    .catch(failure);\n}\n\n/**\n * Determines if the discard policy is ready to process images.\n * @returns {boolean} True if the discard policy is ready to process images; otherwise, false.\n */\nDiscardMissingTileImagePolicy.prototype.isReady = function () {\n  return this._isReady;\n};\n\n/**\n * Given a tile image, decide whether to discard that image.\n *\n * @param {HTMLImageElement} image An image to test.\n * @returns {boolean} True if the image should be discarded; otherwise, false.\n *\n * @exception {DeveloperError} <code>shouldDiscardImage</code> must not be called before the discard policy is ready.\n */\nDiscardMissingTileImagePolicy.prototype.shouldDiscardImage = function (image) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!this._isReady) {\n    throw new DeveloperError(\n      \"shouldDiscardImage must not be called before the discard policy is ready.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const pixelsToCheck = this._pixelsToCheck;\n  const missingImagePixels = this._missingImagePixels;\n\n  // If missingImagePixels is undefined, it indicates that the discard check has been disabled.\n  if (!defined(missingImagePixels)) {\n    return false;\n  }\n\n  if (defined(image.blob) && image.blob.size !== this._missingImageByteLength) {\n    return false;\n  }\n\n  const pixels = getImagePixels(image);\n  const width = image.width;\n\n  for (let i = 0, len = pixelsToCheck.length; i < len; ++i) {\n    const pos = pixelsToCheck[i];\n    const index = pos.x * 4 + pos.y * width;\n    for (let offset = 0; offset < 4; ++offset) {\n      const pixel = index + offset;\n      if (pixels[pixel] !== missingImagePixels[pixel]) {\n        return false;\n      }\n    }\n  }\n  return true;\n};\nexport default DiscardMissingTileImagePolicy;\n", "import defined from \"../Core/defined.js\";\n\n/**\n * Describes a rasterized feature, such as a point, polygon, polyline, etc., in an imagery layer.\n *\n * @alias ImageryLayerFeatureInfo\n * @constructor\n */\nfunction ImageryLayerFeatureInfo() {\n  /**\n   * Gets or sets the name of the feature.\n   * @type {string|undefined}\n   */\n  this.name = undefined;\n\n  /**\n   * Gets or sets an HTML description of the feature.  The HTML is not trusted and should\n   * be sanitized before display to the user.\n   * @type {string|undefined}\n   */\n  this.description = undefined;\n\n  /**\n   * Gets or sets the position of the feature, or undefined if the position is not known.\n   *\n   * @type {Cartographic|undefined}\n   */\n  this.position = undefined;\n\n  /**\n   * Gets or sets the raw data describing the feature.  The raw data may be in any\n   * number of formats, such as GeoJSON, KML, etc.\n   * @type {object|undefined}\n   */\n  this.data = undefined;\n\n  /**\n   * Gets or sets the image layer of the feature.\n   * @type {object|undefined}\n   */\n  this.imageryLayer = undefined;\n}\n\n/**\n * Configures the name of this feature by selecting an appropriate property.  The name will be obtained from\n * one of the following sources, in this order: 1) the property with the name 'name', 2) the property with the name 'title',\n * 3) the first property containing the word 'name', 4) the first property containing the word 'title'.  If\n * the name cannot be obtained from any of these sources, the existing name will be left unchanged.\n *\n * @param {object} properties An object literal containing the properties of the feature.\n */\nImageryLayerFeatureInfo.prototype.configureNameFromProperties = function (\n  properties\n) {\n  let namePropertyPrecedence = 10;\n  let nameProperty;\n\n  for (const key in properties) {\n    if (properties.hasOwnProperty(key) && properties[key]) {\n      const lowerKey = key.toLowerCase();\n\n      if (namePropertyPrecedence > 1 && lowerKey === \"name\") {\n        namePropertyPrecedence = 1;\n        nameProperty = key;\n      } else if (namePropertyPrecedence > 2 && lowerKey === \"title\") {\n        namePropertyPrecedence = 2;\n        nameProperty = key;\n      } else if (namePropertyPrecedence > 3 && /name/i.test(key)) {\n        namePropertyPrecedence = 3;\n        nameProperty = key;\n      } else if (namePropertyPrecedence > 4 && /title/i.test(key)) {\n        namePropertyPrecedence = 4;\n        nameProperty = key;\n      }\n    }\n  }\n\n  if (defined(nameProperty)) {\n    this.name = properties[nameProperty];\n  }\n};\n\n/**\n * Configures the description of this feature by creating an HTML table of properties and their values.\n *\n * @param {object} properties An object literal containing the properties of the feature.\n */\nImageryLayerFeatureInfo.prototype.configureDescriptionFromProperties = function (\n  properties\n) {\n  function describe(properties) {\n    let html = '<table class=\"cesium-infoBox-defaultTable\">';\n    for (const key in properties) {\n      if (properties.hasOwnProperty(key)) {\n        const value = properties[key];\n        if (defined(value)) {\n          if (typeof value === \"object\") {\n            html += `<tr><td>${key}</td><td>${describe(value)}</td></tr>`;\n          } else {\n            html += `<tr><td>${key}</td><td>${value}</td></tr>`;\n          }\n        }\n      }\n    }\n    html += \"</table>\";\n\n    return html;\n  }\n\n  this.description = describe(properties);\n};\nexport default ImageryLayerFeatureInfo;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport loadKTX2 from \"../Core/loadKTX2.js\";\nimport Resource from \"../Core/Resource.js\";\n\n/**\n * @typedef {HTMLImageElement|HTMLCanvasElement|ImageBitmap} ImageryTypes\n *\n * The format in which {@link ImageryProvider} methods return an image may\n * vary by provider, configuration, or server settings.  Most common are\n * <code>HTMLImageElement</code>, <code>HTMLCanvasElement</code>, or on supported\n * browsers, <code>ImageBitmap</code>.\n *\n * See the documentation for each ImageryProvider class for more information about how they return images.\n */\n\n/**\n * Provides imagery to be displayed on the surface of an ellipsoid.  This type describes an\n * interface and is not intended to be instantiated directly.\n *\n * @alias ImageryProvider\n * @constructor\n * @abstract\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see OpenStreetMapImageryProvider\n * @see TileMapServiceImageryProvider\n * @see GoogleEarthEnterpriseImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see GridImageryProvider\n * @see IonImageryProvider\n * @see MapboxImageryProvider\n * @see MapboxStyleImageryProvider\n * @see SingleTileImageryProvider\n * @see TileCoordinatesImageryProvider\n * @see UrlTemplateImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Imagery%20Layers.html|Cesium Sandcastle Imagery Layers Demo}\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Imagery%20Layers%20Manipulation.html|Cesium Sandcastle Imagery Manipulation Demo}\n */\nfunction ImageryProvider() {\n  DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(ImageryProvider.prototype, {\n  /**\n   * Gets the rectangle, in radians, of the imagery provided by the instance.\n   * @memberof ImageryProvider.prototype\n   * @type {Rectangle}\n   * @readonly\n   */\n  rectangle: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the width of each tile, in pixels.\n   * @memberof ImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileWidth: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the height of each tile, in pixels.\n   * @memberof ImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileHeight: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the maximum level-of-detail that can be requested.\n   * @memberof ImageryProvider.prototype\n   * @type {number|undefined}\n   * @readonly\n   */\n  maximumLevel: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the minimum level-of-detail that can be requested.  Generally,\n   * a minimum level should only be used when the rectangle of the imagery is small\n   * enough that the number of tiles at the minimum level is small.  An imagery\n   * provider with more than a few tiles at the minimum level will lead to\n   * rendering problems.\n   * @memberof ImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  minimumLevel: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the tiling scheme used by the provider.\n   * @memberof ImageryProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the tile discard policy.  If not undefined, the discard policy is responsible\n   * for filtering out \"missing\" tiles via its shouldDiscardImage function.  If this function\n   * returns undefined, no tiles are filtered.\n   * @memberof ImageryProvider.prototype\n   * @type {TileDiscardPolicy}\n   * @readonly\n   */\n  tileDiscardPolicy: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof ImageryProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the credit to display when this imagery provider is active.  Typically this is used to credit\n   * the source of the imagery.\n   * @memberof ImageryProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the proxy used by this provider.\n   * @memberof ImageryProvider.prototype\n   * @type {Proxy}\n   * @readonly\n   */\n  proxy: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets a value indicating whether or not the images provided by this imagery provider\n   * include an alpha channel.  If this property is false, an alpha channel, if present, will\n   * be ignored.  If this property is true, any images without an alpha channel will be treated\n   * as if their alpha is 1.0 everywhere.  When this property is false, memory usage\n   * and texture upload time are reduced.\n   * @memberof ImageryProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasAlphaChannel: {\n    get: DeveloperError.throwInstantiationError,\n  },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n */\nImageryProvider.prototype.getTileCredits = function (x, y, level) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Requests the image for a given tile.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<ImageryTypes>|undefined} Returns a promise for the image that will resolve when the image is available, or\n *          undefined if there are too many active requests to the server, and the request should be retried later.\n */\nImageryProvider.prototype.requestImage = function (x, y, level, request) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n * a tile.\n * This function is optional, so it may not exist on all ImageryProviders.\n *\n * @function\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {number} longitude The longitude at which to pick features.\n * @param {number} latitude  The latitude at which to pick features.\n * @return {Promise<ImageryLayerFeatureInfo[]>|undefined} A promise for the picked features that will resolve when the asynchronous\n *                   picking completes.  The resolved value is an array of {@link ImageryLayerFeatureInfo}\n *                   instances.  The array may be empty if no features are found at the given location.\n *                   It may also be undefined if picking is not supported.\n *\n */\nImageryProvider.prototype.pickFeatures = function (\n  x,\n  y,\n  level,\n  longitude,\n  latitude\n) {\n  DeveloperError.throwInstantiationError();\n};\n\nconst ktx2Regex = /\\.ktx2$/i;\n\n/**\n * Loads an image from a given URL.  If the server referenced by the URL already has\n * too many requests pending, this function will instead return undefined, indicating\n * that the request should be retried later.\n *\n * @param {ImageryProvider} imageryProvider The imagery provider for the URL.\n * @param {Resource|string} url The URL of the image.\n * @returns {Promise<ImageryTypes|CompressedTextureBuffer>|undefined} A promise for the image that will resolve when the image is available, or\n *          undefined if there are too many active requests to the server, and the request should be retried later.\n */\nImageryProvider.loadImage = function (imageryProvider, url) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"url\", url);\n  //>>includeEnd('debug');\n\n  const resource = Resource.createIfNeeded(url);\n\n  if (ktx2Regex.test(resource.url)) {\n    // Resolves with `CompressedTextureBuffer`\n    return loadKTX2(resource);\n  } else if (\n    defined(imageryProvider) &&\n    defined(imageryProvider.tileDiscardPolicy)\n  ) {\n    // Resolves with `HTMLImageElement` or `ImageBitmap`\n    return resource.fetchImage({\n      preferBlob: true,\n      preferImageBitmap: true,\n      flipY: true,\n    });\n  }\n\n  return resource.fetchImage({\n    preferImageBitmap: true,\n    flipY: true,\n  });\n};\nexport default ImageryProvider;\n", "/**\n * ArcGisBaseMapType enumerates the ArcGIS image tile layers that are supported by default.\n *\n * @enum {number}\n * @see ArcGisMapServerImageryProvider\n */\nconst ArcGisBaseMapType = {\n  SATELLITE: 1,\n  OCEANS: 2,\n  HILLSHADE: 3,\n};\nexport default Object.freeze(ArcGisBaseMapType);\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicProjection from \"../Core/GeographicProjection.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\nimport WebMercatorTilingScheme from \"../Core/WebMercatorTilingScheme.js\";\nimport ArcGisMapService from \"./ArcGisMapService.js\";\nimport DiscardMissingTileImagePolicy from \"./DiscardMissingTileImagePolicy.js\";\nimport ImageryLayerFeatureInfo from \"./ImageryLayerFeatureInfo.js\";\nimport ImageryProvider from \"./ImageryProvider.js\";\nimport ArcGisBaseMapType from \"./ArcGisBaseMapType.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * @typedef {object} ArcGisMapServerImageryProvider.ConstructorOptions\n *\n * Initialization options for the ArcGisMapServerImageryProvider constructor\n *\n * @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile\n *        is invalid and should be discarded.  If this value is not specified, a default\n *        {@link DiscardMissingTileImagePolicy} is used for tiled map servers, and a\n *        {@link NeverTileDiscardPolicy} is used for non-tiled map servers.  In the former case,\n *        we request tile 0,0 at the maximum tile level and check pixels (0,0), (200,20), (20,200),\n *        (80,110), and (160, 130).  If all of these pixels are transparent, the discard check is\n *        disabled and no tiles are discarded.  If any of them have a non-transparent color, any\n *        tile that has the same values in these pixel locations is discarded.  The end result of\n *        these defaults should be correct tile discarding for a standard ArcGIS Server.  To ensure\n *        that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this\n *        parameter.\n * @property {boolean} [usePreCachedTilesIfAvailable=true] If true, the server's pre-cached\n *        tiles are used if they are available. Exporting Tiles is only supported with deprecated APIs.\n * @property {string} [layers] A comma-separated list of the layers to show, or undefined if all layers should be shown.\n * @property {boolean} [enablePickFeatures=true] If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will invoke\n *        the Identify service on the MapServer and return the features included in the response.  If false,\n *        {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)\n *        without communicating with the server.  Set this property to false if you don't want this provider's features to\n *        be pickable. Can be overridden by setting the {@link ArcGisMapServerImageryProvider#enablePickFeatures} property on the object.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle of the layer.  This parameter is ignored when accessing\n *                    a tiled layer.\n * @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme to use to divide the world into tiles.\n *                       This parameter is ignored when accessing a tiled server.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If the tilingScheme is specified and used,\n *                    this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n *                    parameter is specified, the WGS84 ellipsoid is used.\n * @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.  This parameter is ignored when accessing a tiled server.\n * @property {number} [tileWidth=256] The width of each tile in pixels.  This parameter is ignored when accessing a tiled server.\n * @property {number} [tileHeight=256] The height of each tile in pixels.  This parameter is ignored when accessing a tiled server.\n * @property {number} [maximumLevel] The maximum tile level to request, or undefined if there is no maximum.  This parameter is ignored when accessing\n *                                        a tiled server.\n *\n *\n */\n\n/**\n * Used to track creation details while fetching initial metadata\n *\n * @constructor\n * @private\n *\n * @param {ArcGisMapServerImageryProvider.ConstructorOptions} options An object describing initialization options\n */\nfunction ImageryProviderBuilder(options) {\n  this.useTiles = defaultValue(options.usePreCachedTilesIfAvailable, true);\n\n  const ellipsoid = options.ellipsoid;\n  this.tilingScheme = defaultValue(\n    options.tilingScheme,\n    new GeographicTilingScheme({ ellipsoid: ellipsoid })\n  );\n  this.rectangle = defaultValue(options.rectangle, this.tilingScheme.rectangle);\n  this.ellipsoid = ellipsoid;\n\n  let credit = options.credit;\n  if (typeof credit === \"string\") {\n    credit = new Credit(credit);\n  }\n  this.credit = credit;\n  this.tileCredits = undefined;\n  this.tileDiscardPolicy = options.tileDiscardPolicy;\n\n  this.tileWidth = defaultValue(options.tileWidth, 256);\n  this.tileHeight = defaultValue(options.tileHeight, 256);\n  this.maximumLevel = options.maximumLevel;\n}\n\n/**\n * Complete ArcGisMapServerImageryProvider creation based on builder values.\n *\n * @private\n *\n * @param {ArcGisMapServerImageryProvider} provider\n */\nImageryProviderBuilder.prototype.build = function (provider) {\n  provider._useTiles = this.useTiles;\n  provider._tilingScheme = this.tilingScheme;\n  provider._rectangle = this.rectangle;\n  provider._credit = this.credit;\n  provider._tileCredits = this.tileCredits;\n  provider._tileDiscardPolicy = this.tileDiscardPolicy;\n  provider._tileWidth = this.tileWidth;\n  provider._tileHeight = this.tileHeight;\n  provider._maximumLevel = this.maximumLevel;\n\n  // Install the default tile discard policy if none has been supplied.\n  if (this.useTiles && !defined(this.tileDiscardPolicy)) {\n    provider._tileDiscardPolicy = new DiscardMissingTileImagePolicy({\n      missingImageUrl: buildImageResource(provider, 0, 0, this.maximumLevel)\n        .url,\n      pixelsToCheck: [\n        new Cartesian2(0, 0),\n        new Cartesian2(200, 20),\n        new Cartesian2(20, 200),\n        new Cartesian2(80, 110),\n        new Cartesian2(160, 130),\n      ],\n      disableCheckIfAllPixelsAreTransparent: true,\n    });\n  }\n};\n\nfunction metadataSuccess(data, imageryProviderBuilder) {\n  const tileInfo = data.tileInfo;\n  if (!defined(tileInfo)) {\n    imageryProviderBuilder.useTiles = false;\n  } else {\n    imageryProviderBuilder.tileWidth = tileInfo.rows;\n    imageryProviderBuilder.tileHeight = tileInfo.cols;\n\n    if (\n      tileInfo.spatialReference.wkid === 102100 ||\n      tileInfo.spatialReference.wkid === 102113\n    ) {\n      imageryProviderBuilder.tilingScheme = new WebMercatorTilingScheme({\n        ellipsoid: imageryProviderBuilder.ellipsoid,\n      });\n    } else if (data.tileInfo.spatialReference.wkid === 4326) {\n      imageryProviderBuilder.tilingScheme = new GeographicTilingScheme({\n        ellipsoid: imageryProviderBuilder.ellipsoid,\n      });\n    } else {\n      const message = `Tile spatial reference WKID ${data.tileInfo.spatialReference.wkid} is not supported.`;\n      throw new RuntimeError(message);\n    }\n    imageryProviderBuilder.maximumLevel = data.tileInfo.lods.length - 1;\n\n    if (defined(data.fullExtent)) {\n      if (\n        defined(data.fullExtent.spatialReference) &&\n        defined(data.fullExtent.spatialReference.wkid)\n      ) {\n        if (\n          data.fullExtent.spatialReference.wkid === 102100 ||\n          data.fullExtent.spatialReference.wkid === 102113\n        ) {\n          const projection = new WebMercatorProjection();\n          const extent = data.fullExtent;\n          const sw = projection.unproject(\n            new Cartesian3(\n              Math.max(\n                extent.xmin,\n                -imageryProviderBuilder.tilingScheme.ellipsoid.maximumRadius *\n                  Math.PI\n              ),\n              Math.max(\n                extent.ymin,\n                -imageryProviderBuilder.tilingScheme.ellipsoid.maximumRadius *\n                  Math.PI\n              ),\n              0.0\n            )\n          );\n          const ne = projection.unproject(\n            new Cartesian3(\n              Math.min(\n                extent.xmax,\n                imageryProviderBuilder.tilingScheme.ellipsoid.maximumRadius *\n                  Math.PI\n              ),\n              Math.min(\n                extent.ymax,\n                imageryProviderBuilder.tilingScheme.ellipsoid.maximumRadius *\n                  Math.PI\n              ),\n              0.0\n            )\n          );\n          imageryProviderBuilder.rectangle = new Rectangle(\n            sw.longitude,\n            sw.latitude,\n            ne.longitude,\n            ne.latitude\n          );\n        } else if (data.fullExtent.spatialReference.wkid === 4326) {\n          imageryProviderBuilder.rectangle = Rectangle.fromDegrees(\n            data.fullExtent.xmin,\n            data.fullExtent.ymin,\n            data.fullExtent.xmax,\n            data.fullExtent.ymax\n          );\n        } else {\n          const extentMessage = `fullExtent.spatialReference WKID ${data.fullExtent.spatialReference.wkid} is not supported.`;\n          throw new RuntimeError(extentMessage);\n        }\n      }\n    } else {\n      imageryProviderBuilder.rectangle =\n        imageryProviderBuilder.tilingScheme.rectangle;\n    }\n\n    imageryProviderBuilder.useTiles = true;\n  }\n\n  if (defined(data.copyrightText) && data.copyrightText.length > 0) {\n    if (defined(imageryProviderBuilder.credit)) {\n      imageryProviderBuilder.tileCredits = [new Credit(data.copyrightText)];\n    } else {\n      imageryProviderBuilder.credit = new Credit(data.copyrightText);\n    }\n  }\n}\n\nfunction metadataFailure(resource, error) {\n  let message = `An error occurred while accessing ${resource.url}`;\n  if (defined(error) && defined(error.message)) {\n    message += `: ${error.message}`;\n  }\n\n  throw new RuntimeError(message);\n}\n\nasync function requestMetadata(resource, imageryProviderBuilder) {\n  const jsonResource = resource.getDerivedResource({\n    queryParameters: {\n      f: \"json\",\n    },\n  });\n\n  try {\n    const data = await jsonResource.fetchJson();\n    metadataSuccess(data, imageryProviderBuilder);\n  } catch (error) {\n    metadataFailure(resource, error);\n  }\n}\n\n/**\n * <div class=\"notice\">\n * This object is normally not instantiated directly, use {@link ArcGisMapServerImageryProvider.fromBasemapType} or {@link ArcGisMapServerImageryProvider.fromUrl}.\n * </div>\n *\n * Provides tiled imagery hosted by an ArcGIS MapServer.  By default, the server's pre-cached tiles are\n * used, if available.\n * \n * <br/>\n * \n * An {@link https://developers.arcgis.com/documentation/mapping-apis-and-services/security| ArcGIS Access Token } is required to authenticate requests to an ArcGIS Image Tile service.\n * To access secure ArcGIS resources, it's required to create an ArcGIS developer\n * account or an ArcGIS online account, then implement an authentication method to obtain an access token.\n *\n * @alias ArcGisMapServerImageryProvider\n * @constructor\n *\n * @param {ArcGisMapServerImageryProvider.ConstructorOptions} [options] Object describing initialization options\n *\n * @see ArcGisMapServerImageryProvider.fromBasemapType\n * @see ArcGisMapServerImageryProvider.fromUrl\n *\n * @example\n * // Set the default access token for accessing ArcGIS Image Tile service\n * Cesium.ArcGisMapService.defaultAccessToken = \"<ArcGIS Access Token>\";\n * \n * // Add a base layer from a default ArcGIS basemap\n * const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n *   baseLayer: Cesium.ImageryLayer.fromProviderAsync(\n *     Cesium.ArcGisMapServerImageryProvider.fromBasemapType(\n *       Cesium.ArcGisBaseMapType.SATELLITE\n *     )\n *   ),\n * });\n *\n * @example\n * // Create an imagery provider from the url directly\n * const esri = await Cesium.ArcGisMapServerImageryProvider.fromUrl(\n *   \"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer\", {\n *     token: \"<ArcGIS Access Token>\"\n * });\n *\n * @see {@link https://developers.arcgis.com/rest/|ArcGIS Server REST API}\n * @see {@link https://developers.arcgis.com/documentation/mapping-apis-and-services/security| ArcGIS Access Token }\n\n */\nfunction ArcGisMapServerImageryProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._defaultAlpha = undefined;\n  this._defaultNightAlpha = undefined;\n  this._defaultDayAlpha = undefined;\n  this._defaultBrightness = undefined;\n  this._defaultContrast = undefined;\n  this._defaultHue = undefined;\n  this._defaultSaturation = undefined;\n  this._defaultGamma = undefined;\n  this._defaultMinificationFilter = undefined;\n  this._defaultMagnificationFilter = undefined;\n\n  this._tileDiscardPolicy = options.tileDiscardPolicy;\n  this._tileWidth = defaultValue(options.tileWidth, 256);\n  this._tileHeight = defaultValue(options.tileHeight, 256);\n  this._maximumLevel = options.maximumLevel;\n  this._tilingScheme = defaultValue(\n    options.tilingScheme,\n    new GeographicTilingScheme({ ellipsoid: options.ellipsoid })\n  );\n  this._useTiles = defaultValue(options.usePreCachedTilesIfAvailable, true);\n  this._rectangle = defaultValue(\n    options.rectangle,\n    this._tilingScheme.rectangle\n  );\n  this._layers = options.layers;\n  this._credit = options.credit;\n  this._tileCredits = undefined;\n\n  let credit = options.credit;\n  if (typeof credit === \"string\") {\n    credit = new Credit(credit);\n  }\n\n  /**\n   * Gets or sets a value indicating whether feature picking is enabled.  If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will\n   * invoke the \"identify\" operation on the ArcGIS server and return the features included in the response.  If false,\n   * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)\n   * without communicating with the server.\n   * @type {boolean}\n   * @default true\n   */\n  this.enablePickFeatures = defaultValue(options.enablePickFeatures, true);\n\n  this._errorEvent = new Event();\n}\n\n/**\n * Creates an {@link ImageryProvider} which provides tiled imagery from an ArcGIS base map.\n * @param {ArcGisBaseMapType} style The style of the ArcGIS base map imagery. Valid options are {@link ArcGisBaseMapType.SATELLITE}, {@link ArcGisBaseMapType.OCEANS}, and {@link ArcGisBaseMapType.HILLSHADE}.\n * @param {ArcGisMapServerImageryProvider.ConstructorOptions} [options] Object describing initialization options.\n * @returns {Promise<ArcGisMapServerImageryProvider>} A promise that resolves to the created ArcGisMapServerImageryProvider.\n *\n * @example\n * // Set the default access token for accessing ArcGIS Image Tile service\n * Cesium.ArcGisMapService.defaultAccessToken = \"<ArcGIS Access Token>\";\n *\n * // Add a base layer from a default ArcGIS basemap\n * const provider = await Cesium.ArcGisMapServerImageryProvider.fromBasemapType(\n *   Cesium.ArcGisBaseMapType.SATELLITE);\n *\n * @example\n * // Add a base layer from a default ArcGIS Basemap\n * const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n *   baseLayer: Cesium.ImageryLayer.fromProviderAsync(\n *     Cesium.ArcGisMapServerImageryProvider.fromBasemapType(\n *       Cesium.ArcGisBaseMapType.HILLSHADE, {\n *         token: \"<ArcGIS Access Token>\"\n *       }\n *     )\n *   ),\n * });\n */\n\nArcGisMapServerImageryProvider.fromBasemapType = async function (\n  style,\n  options\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"style\", style);\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  let accessToken;\n  let server;\n  let warningCredit;\n  switch (style) {\n    case ArcGisBaseMapType.SATELLITE:\n      {\n        accessToken = defaultValue(\n          options.token,\n          ArcGisMapService.defaultAccessToken\n        );\n        server = Resource.createIfNeeded(\n          ArcGisMapService.defaultWorldImageryServer\n        );\n        server.appendForwardSlash();\n        const defaultTokenCredit = ArcGisMapService.getDefaultTokenCredit(\n          accessToken\n        );\n        if (defined(defaultTokenCredit)) {\n          warningCredit = Credit.clone(defaultTokenCredit);\n        }\n      }\n      break;\n    case ArcGisBaseMapType.OCEANS:\n      {\n        accessToken = defaultValue(\n          options.token,\n          ArcGisMapService.defaultAccessToken\n        );\n        server = Resource.createIfNeeded(\n          ArcGisMapService.defaultWorldOceanServer\n        );\n        server.appendForwardSlash();\n        const defaultTokenCredit = ArcGisMapService.getDefaultTokenCredit(\n          accessToken\n        );\n        if (defined(defaultTokenCredit)) {\n          warningCredit = Credit.clone(defaultTokenCredit);\n        }\n      }\n      break;\n    case ArcGisBaseMapType.HILLSHADE:\n      {\n        accessToken = defaultValue(\n          options.token,\n          ArcGisMapService.defaultAccessToken\n        );\n        server = Resource.createIfNeeded(\n          ArcGisMapService.defaultWorldHillshadeServer\n        );\n        server.appendForwardSlash();\n        const defaultTokenCredit = ArcGisMapService.getDefaultTokenCredit(\n          accessToken\n        );\n        if (defined(defaultTokenCredit)) {\n          warningCredit = Credit.clone(defaultTokenCredit);\n        }\n      }\n      break;\n    default:\n      //>>includeStart('debug', pragmas.debug);\n      throw new DeveloperError(`Unsupported basemap type: ${style}`);\n    //>>includeEnd('debug');\n  }\n\n  return ArcGisMapServerImageryProvider.fromUrl(server, {\n    ...options,\n    token: accessToken,\n    credit: warningCredit,\n    usePreCachedTilesIfAvailable: true, // ArcGIS Base Map Service Layers only support Tiled views\n  });\n};\n\nfunction buildImageResource(imageryProvider, x, y, level, request) {\n  let resource;\n  if (imageryProvider._useTiles) {\n    resource = imageryProvider._resource.getDerivedResource({\n      url: `tile/${level}/${y}/${x}`,\n      request: request,\n    });\n  } else {\n    const nativeRectangle = imageryProvider._tilingScheme.tileXYToNativeRectangle(\n      x,\n      y,\n      level\n    );\n    const bbox = `${nativeRectangle.west},${nativeRectangle.south},${nativeRectangle.east},${nativeRectangle.north}`;\n\n    const query = {\n      bbox: bbox,\n      size: `${imageryProvider._tileWidth},${imageryProvider._tileHeight}`,\n      format: \"png32\",\n      transparent: true,\n      f: \"image\",\n    };\n\n    if (\n      imageryProvider._tilingScheme.projection instanceof GeographicProjection\n    ) {\n      query.bboxSR = 4326;\n      query.imageSR = 4326;\n    } else {\n      query.bboxSR = 3857;\n      query.imageSR = 3857;\n    }\n    if (imageryProvider.layers) {\n      query.layers = `show:${imageryProvider.layers}`;\n    }\n\n    resource = imageryProvider._resource.getDerivedResource({\n      url: \"export\",\n      request: request,\n      queryParameters: query,\n    });\n  }\n  return resource;\n}\n\nObject.defineProperties(ArcGisMapServerImageryProvider.prototype, {\n  /**\n   * Gets the URL of the ArcGIS MapServer.\n   * @memberof ArcGisMapServerImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return this._resource._url;\n    },\n  },\n\n  /**\n   * Gets the ArcGIS token used to authenticate with the ArcGis MapServer service.\n   * @memberof ArcGisMapServerImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  token: {\n    get: function () {\n      return this._resource.queryParameters.token;\n    },\n  },\n\n  /**\n   * Gets the proxy used by this provider.\n   * @memberof ArcGisMapServerImageryProvider.prototype\n   * @type {Proxy}\n   * @readonly\n   */\n  proxy: {\n    get: function () {\n      return this._resource.proxy;\n    },\n  },\n\n  /**\n   * Gets the width of each tile, in pixels.\n   * @memberof ArcGisMapServerImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileWidth: {\n    get: function () {\n      return this._tileWidth;\n    },\n  },\n\n  /**\n   * Gets the height of each tile, in pixels.\n   * @memberof ArcGisMapServerImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileHeight: {\n    get: function () {\n      return this._tileHeight;\n    },\n  },\n\n  /**\n   * Gets the maximum level-of-detail that can be requested.\n   * @memberof ArcGisMapServerImageryProvider.prototype\n   * @type {number|undefined}\n   * @readonly\n   */\n  maximumLevel: {\n    get: function () {\n      return this._maximumLevel;\n    },\n  },\n\n  /**\n   * Gets the minimum level-of-detail that can be requested.\n   * @memberof ArcGisMapServerImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  minimumLevel: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof ArcGisMapServerImageryProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets the rectangle, in radians, of the imagery provided by this instance.\n   * @memberof ArcGisMapServerImageryProvider.prototype\n   * @type {Rectangle}\n   * @readonly\n   */\n  rectangle: {\n    get: function () {\n      return this._rectangle;\n    },\n  },\n\n  /**\n   * Gets the tile discard policy.  If not undefined, the discard policy is responsible\n   * for filtering out \"missing\" tiles via its shouldDiscardImage function.  If this function\n   * returns undefined, no tiles are filtered.\n   * @memberof ArcGisMapServerImageryProvider.prototype\n   * @type {TileDiscardPolicy}\n   * @readonly\n   */\n  tileDiscardPolicy: {\n    get: function () {\n      return this._tileDiscardPolicy;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof ArcGisMapServerImageryProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this imagery provider is active.  Typically this is used to credit\n   * the source of the imagery.\n   * @memberof ArcGisMapServerImageryProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether this imagery provider is using pre-cached tiles from the\n   * ArcGIS MapServer.\n   * @memberof ArcGisMapServerImageryProvider.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @default true\n   */\n  usingPrecachedTiles: {\n    get: function () {\n      return this._useTiles;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the images provided by this imagery provider\n   * include an alpha channel.  If this property is false, an alpha channel, if present, will\n   * be ignored.  If this property is true, any images without an alpha channel will be treated\n   * as if their alpha is 1.0 everywhere.  When this property is false, memory usage\n   * and texture upload time are reduced.\n   * @memberof ArcGisMapServerImageryProvider.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   * @default true\n   */\n  hasAlphaChannel: {\n    get: function () {\n      return true;\n    },\n  },\n\n  /**\n   * Gets the comma-separated list of layer IDs to show.\n   * @memberof ArcGisMapServerImageryProvider.prototype\n   *\n   * @type {string}\n   */\n  layers: {\n    get: function () {\n      return this._layers;\n    },\n  },\n});\n\n/**\n * Creates an {@link ImageryProvider} which provides tiled imagery hosted by an ArcGIS MapServer.  By default, the server's pre-cached tiles are\n * used, if available.\n *\n * @param {Resource|String} url The URL of the ArcGIS MapServer service.\n * @param {ArcGisMapServerImageryProvider.ConstructorOptions} [options] Object describing initialization options.\n * @returns {Promise<ArcGisMapServerImageryProvider>} A promise that resolves to the created ArcGisMapServerImageryProvider.\n *\n * @example\n * const esri = await Cesium.ArcGisMapServerImageryProvider.fromUrl(\n *     \"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer\"\n * );\n *\n * @exception {RuntimeError} metadata spatial reference specifies an unknown WKID\n * @exception {RuntimeError} metadata fullExtent.spatialReference specifies an unknown WKID\n */\nArcGisMapServerImageryProvider.fromUrl = async function (url, options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"url\", url);\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const resource = Resource.createIfNeeded(url);\n  resource.appendForwardSlash();\n\n  if (defined(options.token)) {\n    resource.setQueryParameters({\n      token: options.token,\n    });\n  }\n\n  const provider = new ArcGisMapServerImageryProvider(options);\n  provider._resource = resource;\n  const imageryProviderBuilder = new ImageryProviderBuilder(options);\n  const useTiles = defaultValue(options.usePreCachedTilesIfAvailable, true);\n  if (useTiles) {\n    await requestMetadata(resource, imageryProviderBuilder);\n  }\n\n  imageryProviderBuilder.build(provider);\n  return provider;\n};\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n */\nArcGisMapServerImageryProvider.prototype.getTileCredits = function (\n  x,\n  y,\n  level\n) {\n  return this._tileCredits;\n};\n\n/**\n * Requests the image for a given tile.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n *          undefined if there are too many active requests to the server, and the request should be retried later.\n */\nArcGisMapServerImageryProvider.prototype.requestImage = function (\n  x,\n  y,\n  level,\n  request\n) {\n  return ImageryProvider.loadImage(\n    this,\n    buildImageResource(this, x, y, level, request)\n  );\n};\n\n/**\n    /**\n     * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n     * a tile.\n     *\n     * @param {number} x The tile X coordinate.\n     * @param {number} y The tile Y coordinate.\n     * @param {number} level The tile level.\n     * @param {number} longitude The longitude at which to pick features.\n     * @param {number} latitude  The latitude at which to pick features.\n     * @return {Promise<ImageryLayerFeatureInfo[]>|undefined} A promise for the picked features that will resolve when the asynchronous\n     *                   picking completes.  The resolved value is an array of {@link ImageryLayerFeatureInfo}\n     *                   instances.  The array may be empty if no features are found at the given location.\n     */\nArcGisMapServerImageryProvider.prototype.pickFeatures = function (\n  x,\n  y,\n  level,\n  longitude,\n  latitude\n) {\n  if (!this.enablePickFeatures) {\n    return undefined;\n  }\n\n  const rectangle = this._tilingScheme.tileXYToNativeRectangle(x, y, level);\n\n  let horizontal;\n  let vertical;\n  let sr;\n  if (this._tilingScheme.projection instanceof GeographicProjection) {\n    horizontal = CesiumMath.toDegrees(longitude);\n    vertical = CesiumMath.toDegrees(latitude);\n    sr = \"4326\";\n  } else {\n    const projected = this._tilingScheme.projection.project(\n      new Cartographic(longitude, latitude, 0.0)\n    );\n    horizontal = projected.x;\n    vertical = projected.y;\n    sr = \"3857\";\n  }\n\n  let layers = \"visible\";\n  if (defined(this._layers)) {\n    layers += `:${this._layers}`;\n  }\n\n  const query = {\n    f: \"json\",\n    tolerance: 2,\n    geometryType: \"esriGeometryPoint\",\n    geometry: `${horizontal},${vertical}`,\n    mapExtent: `${rectangle.west},${rectangle.south},${rectangle.east},${rectangle.north}`,\n    imageDisplay: `${this._tileWidth},${this._tileHeight},96`,\n    sr: sr,\n    layers: layers,\n  };\n\n  const resource = this._resource.getDerivedResource({\n    url: \"identify\",\n    queryParameters: query,\n  });\n\n  return resource.fetchJson().then(function (json) {\n    const result = [];\n\n    const features = json.results;\n    if (!defined(features)) {\n      return result;\n    }\n\n    for (let i = 0; i < features.length; ++i) {\n      const feature = features[i];\n\n      const featureInfo = new ImageryLayerFeatureInfo();\n      featureInfo.data = feature;\n      featureInfo.name = feature.value;\n      featureInfo.properties = feature.attributes;\n      featureInfo.configureDescriptionFromProperties(feature.attributes);\n\n      // If this is a point feature, use the coordinates of the point.\n      if (feature.geometryType === \"esriGeometryPoint\" && feature.geometry) {\n        const wkid =\n          feature.geometry.spatialReference &&\n          feature.geometry.spatialReference.wkid\n            ? feature.geometry.spatialReference.wkid\n            : 4326;\n        if (wkid === 4326 || wkid === 4283) {\n          featureInfo.position = Cartographic.fromDegrees(\n            feature.geometry.x,\n            feature.geometry.y,\n            feature.geometry.z\n          );\n        } else if (wkid === 102100 || wkid === 900913 || wkid === 3857) {\n          const projection = new WebMercatorProjection();\n          featureInfo.position = projection.unproject(\n            new Cartesian3(\n              feature.geometry.x,\n              feature.geometry.y,\n              feature.geometry.z\n            )\n          );\n        }\n      }\n\n      result.push(featureInfo);\n    }\n\n    return result;\n  });\n};\nArcGisMapServerImageryProvider._metadataCache = {};\nexport default ArcGisMapServerImageryProvider;\n", "/**\n * The types of imagery provided by Bing Maps.\n *\n * @enum {number}\n *\n * @see BingMapsImageryProvider\n */\nconst BingMapsStyle = {\n  /**\n   * Aerial imagery.\n   *\n   * @type {string}\n   * @constant\n   */\n  AERIAL: \"Aerial\",\n\n  /**\n   * Aerial imagery with a road overlay.\n   *\n   * @type {string}\n   * @constant\n   * @deprecated See https://github.com/CesiumGS/cesium/issues/7128.\n   * Use `BingMapsStyle.AERIAL_WITH_LABELS_ON_DEMAND` instead\n   */\n  AERIAL_WITH_LABELS: \"AerialWithLabels\",\n\n  /**\n   * Aerial imagery with a road overlay.\n   *\n   * @type {string}\n   * @constant\n   */\n  AERIAL_WITH_LABELS_ON_DEMAND: \"AerialWithLabelsOnDemand\",\n\n  /**\n   * Roads without additional imagery.\n   *\n   * @type {string}\n   * @constant\n   * @deprecated See https://github.com/CesiumGS/cesium/issues/7128.\n   * Use `BingMapsStyle.ROAD_ON_DEMAND` instead\n   */\n  ROAD: \"Road\",\n\n  /**\n   * Roads without additional imagery.\n   *\n   * @type {string}\n   * @constant\n   */\n  ROAD_ON_DEMAND: \"RoadOnDemand\",\n\n  /**\n   * A dark version of the road maps.\n   *\n   * @type {string}\n   * @constant\n   */\n  CANVAS_DARK: \"CanvasDark\",\n\n  /**\n   * A lighter version of the road maps.\n   *\n   * @type {string}\n   * @constant\n   */\n  CANVAS_LIGHT: \"CanvasLight\",\n\n  /**\n   * A grayscale version of the road maps.\n   *\n   * @type {string}\n   * @constant\n   */\n  CANVAS_GRAY: \"CanvasGray\",\n\n  /**\n   * Ordnance Survey imagery. This imagery is visible only for the London, UK area.\n   *\n   * @type {string}\n   * @constant\n   */\n  ORDNANCE_SURVEY: \"OrdnanceSurvey\",\n\n  /**\n   * Collins Bart imagery.\n   *\n   * @type {string}\n   * @constant\n   */\n  COLLINS_BART: \"CollinsBart\",\n};\nexport default Object.freeze(BingMapsStyle);\n", "import defined from \"../Core/defined.js\";\n\n/**\n * A policy for discarding tile images that contain no data (and so aren't actually images).\n * This policy discards {@link DiscardEmptyTileImagePolicy.EMPTY_IMAGE}, which is\n * expected to be used in place of any empty tile images by the image loading code.\n *\n * @alias DiscardEmptyTileImagePolicy\n * @constructor\n *\n * @see DiscardMissingTileImagePolicy\n */\nfunction DiscardEmptyTileImagePolicy(options) {}\n\n/**\n * Determines if the discard policy is ready to process images.\n * @returns {boolean} True if the discard policy is ready to process images; otherwise, false.\n */\nDiscardEmptyTileImagePolicy.prototype.isReady = function () {\n  return true;\n};\n\n/**\n * Given a tile image, decide whether to discard that image.\n *\n * @param {HTMLImageElement} image An image to test.\n * @returns {boolean} True if the image should be discarded; otherwise, false.\n */\nDiscardEmptyTileImagePolicy.prototype.shouldDiscardImage = function (image) {\n  return DiscardEmptyTileImagePolicy.EMPTY_IMAGE === image;\n};\n\nlet emptyImage;\n\nObject.defineProperties(DiscardEmptyTileImagePolicy, {\n  /**\n   * Default value for representing an empty image.\n   * @type {HTMLImageElement}\n   * @readonly\n   * @memberof DiscardEmptyTileImagePolicy\n   */\n  EMPTY_IMAGE: {\n    get: function () {\n      if (!defined(emptyImage)) {\n        emptyImage = new Image();\n        // load a blank data URI with a 1x1 transparent pixel.\n        emptyImage.src =\n          \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=\";\n      }\n      return emptyImage;\n    },\n  },\n});\nexport default DiscardEmptyTileImagePolicy;\n", "import buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Check from \"../Core/Check.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TileProviderError from \"../Core/TileProviderError.js\";\nimport WebMercatorTilingScheme from \"../Core/WebMercatorTilingScheme.js\";\nimport BingMapsStyle from \"./BingMapsStyle.js\";\nimport DiscardEmptyTilePolicy from \"./DiscardEmptyTileImagePolicy.js\";\nimport ImageryProvider from \"./ImageryProvider.js\";\n\n/**\n * @typedef {object} BingMapsImageryProvider.ConstructorOptions\n *\n * Initialization options for the BingMapsImageryProvider constructor\n *\n * @property {string} [key] The Bing Maps key for your application, which can be\n *        created at {@link https://www.bingmapsportal.com/}.\n * @property {string} [tileProtocol] The protocol to use when loading tiles, e.g. 'http' or 'https'.\n *        By default, tiles are loaded using the same protocol as the page.\n * @property {BingMapsStyle} [mapStyle=BingMapsStyle.AERIAL] The type of Bing Maps imagery to load.\n * @property {string} [mapLayer] Additional display layer options as defined on {@link https://learn.microsoft.com/en-us/bingmaps/rest-services/imagery/get-imagery-metadata#template-parameters}\n * @property {string} [culture=''] The culture to use when requesting Bing Maps imagery. Not\n *        all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}\n *        for information on the supported cultures.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If not specified, the WGS84 ellipsoid is used.\n * @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile\n *        is invalid and should be discarded.  By default, a {@link DiscardEmptyTileImagePolicy}\n *        will be used, with the expectation that the Bing Maps server will send a zero-length response for missing tiles.\n *        To ensure that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this parameter.\n */\n\n/**\n * Used to track creation details while fetching initial metadata\n *\n * @constructor\n * @private\n *\n * @param {BingMapsImageryProvider.ConstructorOptions} options An object describing initialization options\n */\nfunction ImageryProviderBuilder(options) {\n  this.tileWidth = undefined;\n  this.tileHeight = undefined;\n  this.maximumLevel = undefined;\n  this.imageUrlSubdomains = undefined;\n  this.imageUrlTemplate = undefined;\n\n  this.attributionList = undefined;\n}\n\n/**\n * Complete BingMapsImageryProvider creation based on builder values.\n *\n * @private\n *\n * @param {BingMapsImageryProvider} provider\n */\nImageryProviderBuilder.prototype.build = function (provider) {\n  provider._tileWidth = this.tileWidth;\n  provider._tileHeight = this.tileHeight;\n  provider._maximumLevel = this.maximumLevel;\n  provider._imageUrlSubdomains = this.imageUrlSubdomains;\n  provider._imageUrlTemplate = this.imageUrlTemplate;\n\n  let attributionList = (provider._attributionList = this.attributionList);\n  if (!attributionList) {\n    attributionList = [];\n  }\n  provider._attributionList = attributionList;\n\n  for (\n    let attributionIndex = 0, attributionLength = attributionList.length;\n    attributionIndex < attributionLength;\n    ++attributionIndex\n  ) {\n    const attribution = attributionList[attributionIndex];\n\n    if (attribution.credit instanceof Credit) {\n      // If attribution.credit has already been created\n      // then we are using a cached value, which means\n      // none of the remaining processing needs to be done.\n      break;\n    }\n\n    attribution.credit = new Credit(attribution.attribution);\n    const coverageAreas = attribution.coverageAreas;\n\n    for (\n      let areaIndex = 0, areaLength = attribution.coverageAreas.length;\n      areaIndex < areaLength;\n      ++areaIndex\n    ) {\n      const area = coverageAreas[areaIndex];\n      const bbox = area.bbox;\n      area.bbox = new Rectangle(\n        CesiumMath.toRadians(bbox[1]),\n        CesiumMath.toRadians(bbox[0]),\n        CesiumMath.toRadians(bbox[3]),\n        CesiumMath.toRadians(bbox[2])\n      );\n    }\n  }\n};\n\nfunction metadataSuccess(data, imageryProviderBuilder) {\n  if (data.resourceSets.length !== 1) {\n    throw new RuntimeError(\n      \"metadata does not specify one resource in resourceSets\"\n    );\n  }\n\n  const resource = data.resourceSets[0].resources[0];\n  imageryProviderBuilder.tileWidth = resource.imageWidth;\n  imageryProviderBuilder.tileHeight = resource.imageHeight;\n  imageryProviderBuilder.maximumLevel = resource.zoomMax - 1;\n  imageryProviderBuilder.imageUrlSubdomains = resource.imageUrlSubdomains;\n  imageryProviderBuilder.imageUrlTemplate = resource.imageUrl;\n  imageryProviderBuilder.attributionList = resource.imageryProviders;\n}\n\nfunction metadataFailure(metadataResource, error, provider) {\n  let message = `An error occurred while accessing ${metadataResource.url}`;\n  if (defined(error) && defined(error.message)) {\n    message += `: ${error.message}`;\n  }\n\n  TileProviderError.reportError(\n    undefined,\n    provider,\n    defined(provider) ? provider._errorEvent : undefined,\n    message,\n    undefined,\n    undefined,\n    undefined,\n    error\n  );\n\n  throw new RuntimeError(message);\n}\n\nasync function requestMetadata(\n  metadataResource,\n  imageryProviderBuilder,\n  provider\n) {\n  const cacheKey = metadataResource.url;\n  let promise = BingMapsImageryProvider._metadataCache[cacheKey];\n  if (!defined(promise)) {\n    promise = metadataResource.fetchJsonp(\"jsonp\");\n    BingMapsImageryProvider._metadataCache[cacheKey] = promise;\n  }\n\n  try {\n    const data = await promise;\n    return metadataSuccess(data, imageryProviderBuilder);\n  } catch (e) {\n    metadataFailure(metadataResource, e, provider);\n  }\n}\n\n/**\n * <div class=\"notice\">\n * To construct a BingMapsImageryProvider, call {@link BingMapsImageryProvider.fromUrl}. Do not call the constructor directly.\n * </div>\n *\n * Provides tiled imagery using the Bing Maps Imagery REST API.\n *\n * @alias BingMapsImageryProvider\n * @constructor\n *\n * @param {BingMapsImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @see BingMapsImageryProvider.fromUrl\n * @see ArcGisMapServerImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see OpenStreetMapImageryProvider\n * @see SingleTileImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n * @see UrlTemplateImageryProvider\n *\n * @example\n * const bing = await Cesium.BingMapsImageryProvider.fromUrl(\n *   \"https://dev.virtualearth.net\", {\n *     key: \"get-yours-at-https://www.bingmapsportal.com/\",\n *     mapStyle: Cesium.BingMapsStyle.AERIAL\n * });\n *\n * @see {@link http://msdn.microsoft.com/en-us/library/ff701713.aspx|Bing Maps REST Services}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n */\nfunction BingMapsImageryProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._defaultAlpha = undefined;\n  this._defaultNightAlpha = undefined;\n  this._defaultDayAlpha = undefined;\n  this._defaultBrightness = undefined;\n  this._defaultContrast = undefined;\n  this._defaultHue = undefined;\n  this._defaultSaturation = undefined;\n  this._defaultGamma = 1.0;\n  this._defaultMinificationFilter = undefined;\n  this._defaultMagnificationFilter = undefined;\n\n  this._mapStyle = defaultValue(options.mapStyle, BingMapsStyle.AERIAL);\n  this._mapLayer = options.mapLayer;\n  this._culture = defaultValue(options.culture, \"\");\n  this._key = options.key;\n\n  this._tileDiscardPolicy = options.tileDiscardPolicy;\n  if (!defined(this._tileDiscardPolicy)) {\n    this._tileDiscardPolicy = new DiscardEmptyTilePolicy();\n  }\n\n  this._proxy = options.proxy;\n  this._credit = new Credit(\n    `<a href=\"https://www.microsoft.com/en-us/maps/product/enduserterms\"><img src=\"${BingMapsImageryProvider.logoUrl}\" title=\"Bing Imagery\"/></a>`\n  );\n\n  this._tilingScheme = new WebMercatorTilingScheme({\n    numberOfLevelZeroTilesX: 2,\n    numberOfLevelZeroTilesY: 2,\n    ellipsoid: options.ellipsoid,\n  });\n\n  this._tileWidth = undefined;\n  this._tileHeight = undefined;\n  this._maximumLevel = undefined;\n  this._imageUrlTemplate = undefined;\n  this._imageUrlSubdomains = undefined;\n  this._attributionList = undefined;\n\n  this._errorEvent = new Event();\n}\n\nObject.defineProperties(BingMapsImageryProvider.prototype, {\n  /**\n   * Gets the name of the BingMaps server url hosting the imagery.\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return this._resource.url;\n    },\n  },\n\n  /**\n   * Gets the proxy used by this provider.\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {Proxy}\n   * @readonly\n   */\n  proxy: {\n    get: function () {\n      return this._resource.proxy;\n    },\n  },\n\n  /**\n   * Gets the Bing Maps key.\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  key: {\n    get: function () {\n      return this._key;\n    },\n  },\n\n  /**\n   * Gets the type of Bing Maps imagery to load.\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {BingMapsStyle}\n   * @readonly\n   */\n  mapStyle: {\n    get: function () {\n      return this._mapStyle;\n    },\n  },\n\n  /**\n   * Gets the additional map layer options as defined in {@link https://learn.microsoft.com/en-us/bingmaps/rest-services/imagery/get-imagery-metadata#template-parameters}/\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  mapLayer: {\n    get: function () {\n      return this._mapLayer;\n    },\n  },\n\n  /**\n   * The culture to use when requesting Bing Maps imagery. Not\n   * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}\n   * for information on the supported cultures.\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  culture: {\n    get: function () {\n      return this._culture;\n    },\n  },\n\n  /**\n   * Gets the width of each tile, in pixels.\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileWidth: {\n    get: function () {\n      return this._tileWidth;\n    },\n  },\n\n  /**\n   * Gets the height of each tile, in pixels.\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileHeight: {\n    get: function () {\n      return this._tileHeight;\n    },\n  },\n\n  /**\n   * Gets the maximum level-of-detail that can be requested.\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {number|undefined}\n   * @readonly\n   */\n  maximumLevel: {\n    get: function () {\n      return this._maximumLevel;\n    },\n  },\n\n  /**\n   * Gets the minimum level-of-detail that can be requested.\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  minimumLevel: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets the rectangle, in radians, of the imagery provided by this instance.\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {Rectangle}\n   * @readonly\n   */\n  rectangle: {\n    get: function () {\n      return this._tilingScheme.rectangle;\n    },\n  },\n\n  /**\n   * Gets the tile discard policy.  If not undefined, the discard policy is responsible\n   * for filtering out \"missing\" tiles via its shouldDiscardImage function.  If this function\n   * returns undefined, no tiles are filtered.\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {TileDiscardPolicy}\n   * @readonly\n   */\n  tileDiscardPolicy: {\n    get: function () {\n      return this._tileDiscardPolicy;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this imagery provider is active.  Typically this is used to credit\n   * the source of the imagery.\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the images provided by this imagery provider\n   * include an alpha channel.  If this property is false, an alpha channel, if present, will\n   * be ignored.  If this property is true, any images without an alpha channel will be treated\n   * as if their alpha is 1.0 everywhere.  Setting this property to false reduces memory usage\n   * and texture upload time.\n   * @memberof BingMapsImageryProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasAlphaChannel: {\n    get: function () {\n      return defined(this.mapLayer);\n    },\n  },\n});\n\n/**\n * Creates an {@link ImageryProvider} which provides tiled imagery using the Bing Maps Imagery REST API.\n *\n * @param {Resource|String} url The url of the Bing Maps server hosting the imagery.\n * @param {BingMapsImageryProvider.ConstructorOptions} options Object describing initialization options\n * @returns {Promise<BingMapsImageryProvider>} A promise that resolves to the created BingMapsImageryProvider\n *\n * @example\n * const bing = await Cesium.BingMapsImageryProvider.fromUrl(\n *   \"https://dev.virtualearth.net\", {\n *     key: \"get-yours-at-https://www.bingmapsportal.com/\",\n *     mapStyle: Cesium.BingMapsStyle.AERIAL\n * });\n *\n * @exception {RuntimeError} metadata does not specify one resource in resourceSets\n */\nBingMapsImageryProvider.fromUrl = async function (url, options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"url\", url);\n  Check.defined(\"options.key\", options.key);\n  //>>includeEnd('debug');\n\n  let tileProtocol = options.tileProtocol;\n\n  // For backward compatibility reasons, the tileProtocol may end with\n  // a `:`. Remove it.\n  if (defined(tileProtocol)) {\n    if (\n      tileProtocol.length > 0 &&\n      tileProtocol[tileProtocol.length - 1] === \":\"\n    ) {\n      tileProtocol = tileProtocol.substr(0, tileProtocol.length - 1);\n    }\n  } else {\n    // use http if the document's protocol is http, otherwise use https\n    const documentProtocol = document.location.protocol;\n    tileProtocol = documentProtocol === \"http:\" ? \"http\" : \"https\";\n  }\n\n  const mapStyle = defaultValue(options.mapStyle, BingMapsStyle.AERIAL);\n  const resource = Resource.createIfNeeded(url);\n  resource.appendForwardSlash();\n\n  const queryParameters = {\n    incl: \"ImageryProviders\",\n    key: options.key,\n    uriScheme: tileProtocol,\n  };\n\n  if (defined(options.mapLayer)) {\n    queryParameters.mapLayer = options.mapLayer;\n  }\n\n  const metadataResource = resource.getDerivedResource({\n    url: `REST/v1/Imagery/Metadata/${mapStyle}`,\n    queryParameters: queryParameters,\n  });\n\n  const provider = new BingMapsImageryProvider(options);\n  provider._resource = resource;\n  const imageryProviderBuilder = new ImageryProviderBuilder(options);\n  await requestMetadata(metadataResource, imageryProviderBuilder);\n  imageryProviderBuilder.build(provider);\n  return provider;\n};\n\nconst rectangleScratch = new Rectangle();\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n */\nBingMapsImageryProvider.prototype.getTileCredits = function (x, y, level) {\n  const rectangle = this._tilingScheme.tileXYToRectangle(\n    x,\n    y,\n    level,\n    rectangleScratch\n  );\n  const result = getRectangleAttribution(\n    this._attributionList,\n    level,\n    rectangle\n  );\n\n  return result;\n};\n\n/**\n * Requests the image for a given tile.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n *          undefined if there are too many active requests to the server, and the request should be retried later.\n */\nBingMapsImageryProvider.prototype.requestImage = function (\n  x,\n  y,\n  level,\n  request\n) {\n  const promise = ImageryProvider.loadImage(\n    this,\n    buildImageResource(this, x, y, level, request)\n  );\n\n  if (defined(promise)) {\n    return promise.catch(function (error) {\n      // One cause of an error here is that the image we tried to load was zero-length.\n      // This isn't actually a problem, since it indicates that there is no tile.\n      // So, in that case we return the EMPTY_IMAGE sentinel value for later discarding.\n      if (defined(error.blob) && error.blob.size === 0) {\n        return DiscardEmptyTilePolicy.EMPTY_IMAGE;\n      }\n      return Promise.reject(error);\n    });\n  }\n\n  return undefined;\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {number} longitude The longitude at which to pick features.\n * @param {number} latitude  The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nBingMapsImageryProvider.prototype.pickFeatures = function (\n  x,\n  y,\n  level,\n  longitude,\n  latitude\n) {\n  return undefined;\n};\n\n/**\n * Converts a tiles (x, y, level) position into a quadkey used to request an image\n * from a Bing Maps server.\n *\n * @param {number} x The tile's x coordinate.\n * @param {number} y The tile's y coordinate.\n * @param {number} level The tile's zoom level.\n *\n * @see {@link http://msdn.microsoft.com/en-us/library/bb259689.aspx|Bing Maps Tile System}\n * @see BingMapsImageryProvider#quadKeyToTileXY\n */\nBingMapsImageryProvider.tileXYToQuadKey = function (x, y, level) {\n  let quadkey = \"\";\n  for (let i = level; i >= 0; --i) {\n    const bitmask = 1 << i;\n    let digit = 0;\n\n    if ((x & bitmask) !== 0) {\n      digit |= 1;\n    }\n\n    if ((y & bitmask) !== 0) {\n      digit |= 2;\n    }\n\n    quadkey += digit;\n  }\n  return quadkey;\n};\n\n/**\n * Converts a tile's quadkey used to request an image from a Bing Maps server into the\n * (x, y, level) position.\n *\n * @param {string} quadkey The tile's quad key\n *\n * @see {@link http://msdn.microsoft.com/en-us/library/bb259689.aspx|Bing Maps Tile System}\n * @see BingMapsImageryProvider#tileXYToQuadKey\n */\nBingMapsImageryProvider.quadKeyToTileXY = function (quadkey) {\n  let x = 0;\n  let y = 0;\n  const level = quadkey.length - 1;\n  for (let i = level; i >= 0; --i) {\n    const bitmask = 1 << i;\n    const digit = +quadkey[level - i];\n\n    if ((digit & 1) !== 0) {\n      x |= bitmask;\n    }\n\n    if ((digit & 2) !== 0) {\n      y |= bitmask;\n    }\n  }\n  return {\n    x: x,\n    y: y,\n    level: level,\n  };\n};\n\nBingMapsImageryProvider._logoUrl = undefined;\n\nObject.defineProperties(BingMapsImageryProvider, {\n  /**\n   * Gets or sets the URL to the Bing logo for display in the credit.\n   * @memberof BingMapsImageryProvider\n   * @type {string}\n   */\n  logoUrl: {\n    get: function () {\n      if (!defined(BingMapsImageryProvider._logoUrl)) {\n        BingMapsImageryProvider._logoUrl = buildModuleUrl(\n          \"Assets/Images/bing_maps_credit.png\"\n        );\n      }\n      return BingMapsImageryProvider._logoUrl;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"value\", value);\n      //>>includeEnd('debug');\n\n      BingMapsImageryProvider._logoUrl = value;\n    },\n  },\n});\n\nfunction buildImageResource(imageryProvider, x, y, level, request) {\n  const imageUrl = imageryProvider._imageUrlTemplate;\n\n  const subdomains = imageryProvider._imageUrlSubdomains;\n  const subdomainIndex = (x + y + level) % subdomains.length;\n\n  return imageryProvider._resource.getDerivedResource({\n    url: imageUrl,\n    request: request,\n    templateValues: {\n      quadkey: BingMapsImageryProvider.tileXYToQuadKey(x, y, level),\n      subdomain: subdomains[subdomainIndex],\n      culture: imageryProvider._culture,\n    },\n    queryParameters: {\n      // this parameter tells the Bing servers to send a zero-length response\n      // instead of a placeholder image for missing tiles.\n      n: \"z\",\n    },\n  });\n}\n\nconst intersectionScratch = new Rectangle();\n\nfunction getRectangleAttribution(attributionList, level, rectangle) {\n  // Bing levels start at 1, while ours start at 0.\n  ++level;\n\n  const result = [];\n\n  for (\n    let attributionIndex = 0, attributionLength = attributionList.length;\n    attributionIndex < attributionLength;\n    ++attributionIndex\n  ) {\n    const attribution = attributionList[attributionIndex];\n    const coverageAreas = attribution.coverageAreas;\n\n    let included = false;\n\n    for (\n      let areaIndex = 0, areaLength = attribution.coverageAreas.length;\n      !included && areaIndex < areaLength;\n      ++areaIndex\n    ) {\n      const area = coverageAreas[areaIndex];\n      if (level >= area.zoomMin && level <= area.zoomMax) {\n        const intersection = Rectangle.intersection(\n          rectangle,\n          area.bbox,\n          intersectionScratch\n        );\n        if (defined(intersection)) {\n          included = true;\n        }\n      }\n    }\n\n    if (included) {\n      result.push(attribution.credit);\n    }\n  }\n\n  return result;\n}\n\n// Exposed for testing\nBingMapsImageryProvider._metadataCache = {};\nexport default BingMapsImageryProvider;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport combine from \"../Core/combine.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicProjection from \"../Core/GeographicProjection.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport WebMercatorTilingScheme from \"../Core/WebMercatorTilingScheme.js\";\nimport ImageryProvider from \"./ImageryProvider.js\";\n\nconst templateRegex = /{[^}]+}/g;\n\nconst tags = {\n  x: xTag,\n  y: yTag,\n  z: zTag,\n  s: sTag,\n  reverseX: reverseXTag,\n  reverseY: reverseYTag,\n  reverseZ: reverseZTag,\n  westDegrees: westDegreesTag,\n  southDegrees: southDegreesTag,\n  eastDegrees: eastDegreesTag,\n  northDegrees: northDegreesTag,\n  westProjected: westProjectedTag,\n  southProjected: southProjectedTag,\n  eastProjected: eastProjectedTag,\n  northProjected: northProjectedTag,\n  width: widthTag,\n  height: heightTag,\n};\n\nconst pickFeaturesTags = combine(tags, {\n  i: iTag,\n  j: jTag,\n  reverseI: reverseITag,\n  reverseJ: reverseJTag,\n  longitudeDegrees: longitudeDegreesTag,\n  latitudeDegrees: latitudeDegreesTag,\n  longitudeProjected: longitudeProjectedTag,\n  latitudeProjected: latitudeProjectedTag,\n  format: formatTag,\n});\n\n/**\n * @typedef {object} UrlTemplateImageryProvider.ConstructorOptions\n *\n * Initialization options for the UrlTemplateImageryProvider constructor\n *\n * @property {Resource|string} url  The URL template to use to request tiles.  It has the following keywords:\n * <ul>\n *     <li><code>{z}</code>: The level of the tile in the tiling scheme.  Level zero is the root of the quadtree pyramid.</li>\n *     <li><code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li>\n *     <li><code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li>\n *     <li><code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li>\n *     <li><code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li>\n *     <li><code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li>\n *     <li><code>{reverseZ}</code>: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid.  In order to use reverseZ, maximumLevel must be defined.</li>\n *     <li><code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li>\n *     <li><code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li>\n *     <li><code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li>\n *     <li><code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li>\n *     <li><code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li>\n *     <li><code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li>\n *     <li><code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li>\n *     <li><code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li>\n *     <li><code>{width}</code>: The width of each tile in pixels.</li>\n *     <li><code>{height}</code>: The height of each tile in pixels.</li>\n * </ul>\n * @property {Resource|string} [pickFeaturesUrl] The URL template to use to pick features.  If this property is not specified,\n *                 {@link UrlTemplateImageryProvider#pickFeatures} will immediately returned undefined, indicating no\n *                 features picked.  The URL template supports all of the keywords supported by the <code>url</code>\n *                 parameter, plus the following:\n * <ul>\n *     <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li>\n *     <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li>\n *     <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li>\n *     <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li>\n *     <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li>\n *     <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li>\n *     <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li>\n *     <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li>\n *     <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li>\n * </ul>\n * @property {object} [urlSchemeZeroPadding] Gets the URL scheme zero padding for each tile coordinate. The format is '000' where\n * each coordinate will be padded on the left with zeros to match the width of the passed string of zeros. e.g. Setting:\n * urlSchemeZeroPadding : { '{x}' : '0000'}\n * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.\n * It the passed object has the following keywords:\n * <ul>\n *  <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li>\n *  <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li>\n *  <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li>\n *  <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li>\n *  <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li>\n *  <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li>\n * </ul>\n * @property {string|string[]} [subdomains='abc'] The subdomains to use for the <code>{s}</code> placeholder in the URL template.\n *                          If this parameter is a single string, each character in the string is a subdomain.  If it is\n *                          an array, each element in the array is a subdomain.\n * @property {Credit|string} [credit=''] A credit for the data source, which is displayed on the canvas.\n * @property {number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider.  Take care when specifying\n *                 this that the number of tiles at the minimum level is small, such as four or less.  A larger number is likely\n *                 to result in rendering problems.\n * @property {number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.\n * @property {TilingScheme} [tilingScheme=WebMercatorTilingScheme] The tiling scheme specifying how the ellipsoidal\n * surface is broken into tiles.  If this parameter is not provided, a {@link WebMercatorTilingScheme}\n * is used.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If the tilingScheme is specified,\n *                    this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n *                    parameter is specified, the WGS84 ellipsoid is used.\n * @property {number} [tileWidth=256] Pixel width of image tiles.\n * @property {number} [tileHeight=256] Pixel height of image tiles.\n * @property {boolean} [hasAlphaChannel=true] true if the images provided by this imagery provider\n *                  include an alpha channel; otherwise, false.  If this property is false, an alpha channel, if\n *                  present, will be ignored.  If this property is true, any images without an alpha channel will\n *                  be treated as if their alpha is 1.0 everywhere.  When this property is false, memory usage\n *                  and texture upload time are potentially reduced.\n * @property {GetFeatureInfoFormat[]} [getFeatureInfoFormats] The formats in which to get feature information at a\n *                                 specific location when {@link UrlTemplateImageryProvider#pickFeatures} is invoked.  If this\n *                                 parameter is not specified, feature picking is disabled.\n * @property {boolean} [enablePickFeatures=true] If true, {@link UrlTemplateImageryProvider#pickFeatures} will\n *        request the <code>pickFeaturesUrl</code> and attempt to interpret the features included in the response.  If false,\n *        {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable\n *        features) without communicating with the server.  Set this property to false if you know your data\n *        source does not support picking features or if you don't want this provider's features to be pickable. Note\n *        that this can be dynamically overridden by modifying the {@link UriTemplateImageryProvider#enablePickFeatures}\n *        property.\n * @property {TileDiscardPolicy} [tileDiscardPolicy] A policy for discarding tile images according to some criteria\n * @property {Object} [customTags] Allow to replace custom keywords in the URL template. The object must have strings as keys and functions as values.\n */\n\n/**\n * Provides imagery by requesting tiles using a specified URL template.\n *\n * @alias UrlTemplateImageryProvider\n * @constructor\n *\n * @param {UrlTemplateImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @example\n * // Access Natural Earth II imagery, which uses a TMS tiling scheme and Geographic (EPSG:4326) project\n * const tms = new Cesium.UrlTemplateImageryProvider({\n *     url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') + '/{z}/{x}/{reverseY}.jpg',\n *     tilingScheme : new Cesium.GeographicTilingScheme(),\n *     maximumLevel : 5\n * });\n * // Access the CartoDB Positron basemap, which uses an OpenStreetMap-like tiling scheme.\n * const positron = new Cesium.UrlTemplateImageryProvider({\n *     url : 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',\n *     credit : 'Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'\n * });\n * // Access a Web Map Service (WMS) server.\n * const wms = new Cesium.UrlTemplateImageryProvider({\n *    url : 'https://programs.communications.gov.au/geoserver/ows?tiled=true&' +\n *          'transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&' +\n *          'styles=&service=WMS&version=1.1.1&request=GetMap&' +\n *          'layers=public%3AMyBroadband_Availability&srs=EPSG%3A3857&' +\n *          'bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&' +\n *          'width=256&height=256',\n *    rectangle : Cesium.Rectangle.fromDegrees(96.799393, -43.598214999057824, 153.63925700000001, -9.2159219997013)\n * });\n * // Using custom tags in your template url.\n * const custom = new Cesium.UrlTemplateImageryProvider({\n *    url : 'https://yoururl/{Time}/{z}/{y}/{x}.png',\n *    customTags : {\n *        Time: function(imageryProvider, x, y, level) {\n *            return '20171231'\n *        }\n *    }\n * });\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see OpenStreetMapImageryProvider\n * @see SingleTileImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n */\nfunction UrlTemplateImageryProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._errorEvent = new Event();\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.url\", options.url);\n  //>>includeEnd('debug');\n\n  const resource = Resource.createIfNeeded(options.url);\n  const pickFeaturesResource = Resource.createIfNeeded(options.pickFeaturesUrl);\n\n  this._resource = resource;\n  this._urlSchemeZeroPadding = options.urlSchemeZeroPadding;\n  this._getFeatureInfoFormats = options.getFeatureInfoFormats;\n  this._pickFeaturesResource = pickFeaturesResource;\n\n  let subdomains = options.subdomains;\n  if (Array.isArray(subdomains)) {\n    subdomains = subdomains.slice();\n  } else if (defined(subdomains) && subdomains.length > 0) {\n    subdomains = subdomains.split(\"\");\n  } else {\n    subdomains = [\"a\", \"b\", \"c\"];\n  }\n  this._subdomains = subdomains;\n\n  this._tileWidth = defaultValue(options.tileWidth, 256);\n  this._tileHeight = defaultValue(options.tileHeight, 256);\n  this._minimumLevel = defaultValue(options.minimumLevel, 0);\n  this._maximumLevel = options.maximumLevel;\n  this._tilingScheme = defaultValue(\n    options.tilingScheme,\n    new WebMercatorTilingScheme({ ellipsoid: options.ellipsoid })\n  );\n\n  this._rectangle = defaultValue(\n    options.rectangle,\n    this._tilingScheme.rectangle\n  );\n  this._rectangle = Rectangle.intersection(\n    this._rectangle,\n    this._tilingScheme.rectangle\n  );\n\n  this._tileDiscardPolicy = options.tileDiscardPolicy;\n\n  let credit = options.credit;\n  if (typeof credit === \"string\") {\n    credit = new Credit(credit);\n  }\n  this._credit = credit;\n  this._hasAlphaChannel = defaultValue(options.hasAlphaChannel, true);\n\n  const customTags = options.customTags;\n  const allTags = combine(tags, customTags);\n  const allPickFeaturesTags = combine(pickFeaturesTags, customTags);\n  this._tags = allTags;\n  this._pickFeaturesTags = allPickFeaturesTags;\n\n  this._defaultAlpha = undefined;\n  this._defaultNightAlpha = undefined;\n  this._defaultDayAlpha = undefined;\n  this._defaultBrightness = undefined;\n  this._defaultContrast = undefined;\n  this._defaultHue = undefined;\n  this._defaultSaturation = undefined;\n  this._defaultGamma = undefined;\n  this._defaultMinificationFilter = undefined;\n  this._defaultMagnificationFilter = undefined;\n\n  /**\n   * Gets or sets a value indicating whether feature picking is enabled.  If true, {@link UrlTemplateImageryProvider#pickFeatures} will\n   * request the <code>options.pickFeaturesUrl</code> and attempt to interpret the features included in the response.  If false,\n   * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable\n   * features) without communicating with the server.  Set this property to false if you know your data\n   * source does not support picking features or if you don't want this provider's features to be pickable.\n   * @type {boolean}\n   * @default true\n   */\n  this.enablePickFeatures = defaultValue(options.enablePickFeatures, true);\n}\n\nObject.defineProperties(UrlTemplateImageryProvider.prototype, {\n  /**\n   * Gets the URL template to use to request tiles.  It has the following keywords:\n   * <ul>\n   *  <li> <code>{z}</code>: The level of the tile in the tiling scheme.  Level zero is the root of the quadtree pyramid.</li>\n   *  <li> <code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li>\n   *  <li> <code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li>\n   *  <li> <code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li>\n   *  <li> <code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li>\n   *  <li> <code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li>\n   *  <li> <code>{reverseZ}</code>: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid.  In order to use reverseZ, maximumLevel must be defined.</li>\n   *  <li> <code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li>\n   *  <li> <code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li>\n   *  <li> <code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li>\n   *  <li> <code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li>\n   *  <li> <code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li>\n   *  <li> <code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li>\n   *  <li> <code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li>\n   *  <li> <code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li>\n   *  <li> <code>{width}</code>: The width of each tile in pixels.</li>\n   *  <li> <code>{height}</code>: The height of each tile in pixels.</li>\n   * </ul>\n   * @memberof UrlTemplateImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return this._resource.url;\n    },\n  },\n\n  /**\n   * Gets the URL scheme zero padding for each tile coordinate. The format is '000' where each coordinate will be padded on\n   * the left with zeros to match the width of the passed string of zeros. e.g. Setting:\n   * urlSchemeZeroPadding : { '{x}' : '0000'}\n   * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.\n   * It has the following keywords:\n   * <ul>\n   *  <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li>\n   *  <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li>\n   *  <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li>\n   *  <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li>\n   *  <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li>\n   *  <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li>\n   * </ul>\n   * @memberof UrlTemplateImageryProvider.prototype\n   * @type {object}\n   * @readonly\n   */\n  urlSchemeZeroPadding: {\n    get: function () {\n      return this._urlSchemeZeroPadding;\n    },\n  },\n\n  /**\n   * Gets the URL template to use to use to pick features.  If this property is not specified,\n   * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined, indicating no\n   * features picked.  The URL template supports all of the keywords supported by the\n   * {@link UrlTemplateImageryProvider#url} property, plus the following:\n   * <ul>\n   *     <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li>\n   *     <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li>\n   *     <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li>\n   *     <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li>\n   *     <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li>\n   *     <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li>\n   *     <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li>\n   *     <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li>\n   *     <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li>\n   * </ul>\n   * @memberof UrlTemplateImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  pickFeaturesUrl: {\n    get: function () {\n      return this._pickFeaturesResource.url;\n    },\n  },\n\n  /**\n   * Gets the proxy used by this provider.\n   * @memberof UrlTemplateImageryProvider.prototype\n   * @type {Proxy}\n   * @readonly\n   * @default undefined\n   */\n  proxy: {\n    get: function () {\n      return this._resource.proxy;\n    },\n  },\n\n  /**\n   * Gets the width of each tile, in pixels.\n   * @memberof UrlTemplateImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   * @default 256\n   */\n  tileWidth: {\n    get: function () {\n      return this._tileWidth;\n    },\n  },\n\n  /**\n   * Gets the height of each tile, in pixels.\n   * @memberof UrlTemplateImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   * @default 256\n   */\n  tileHeight: {\n    get: function () {\n      return this._tileHeight;\n    },\n  },\n\n  /**\n   * Gets the maximum level-of-detail that can be requested, or undefined if there is no limit.\n   * @memberof UrlTemplateImageryProvider.prototype\n   * @type {number|undefined}\n   * @readonly\n   * @default undefined\n   */\n  maximumLevel: {\n    get: function () {\n      return this._maximumLevel;\n    },\n  },\n\n  /**\n   * Gets the minimum level-of-detail that can be requested.\n   * @memberof UrlTemplateImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   * @default 0\n   */\n  minimumLevel: {\n    get: function () {\n      return this._minimumLevel;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof UrlTemplateImageryProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   * @default new WebMercatorTilingScheme()\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets the rectangle, in radians, of the imagery provided by this instance.\n   * @memberof UrlTemplateImageryProvider.prototype\n   * @type {Rectangle}\n   * @readonly\n   * @default tilingScheme.rectangle\n   */\n  rectangle: {\n    get: function () {\n      return this._rectangle;\n    },\n  },\n\n  /**\n   * Gets the tile discard policy.  If not undefined, the discard policy is responsible\n   * for filtering out \"missing\" tiles via its shouldDiscardImage function.  If this function\n   * returns undefined, no tiles are filtered.\n   * @memberof UrlTemplateImageryProvider.prototype\n   * @type {TileDiscardPolicy}\n   * @readonly\n   * @default undefined\n   */\n  tileDiscardPolicy: {\n    get: function () {\n      return this._tileDiscardPolicy;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof UrlTemplateImageryProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this imagery provider is active.  Typically this is used to credit\n   * the source of the imagery.\n   * @memberof UrlTemplateImageryProvider.prototype\n   * @type {Credit}\n   * @readonly\n   * @default undefined\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the images provided by this imagery provider\n   * include an alpha channel.  If this property is false, an alpha channel, if present, will\n   * be ignored.  If this property is true, any images without an alpha channel will be treated\n   * as if their alpha is 1.0 everywhere.  When this property is false, memory usage\n   * and texture upload time are reduced.\n   * @memberof UrlTemplateImageryProvider.prototype\n   * @type {boolean}\n   * @readonly\n   * @default true\n   */\n  hasAlphaChannel: {\n    get: function () {\n      return this._hasAlphaChannel;\n    },\n  },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n */\nUrlTemplateImageryProvider.prototype.getTileCredits = function (x, y, level) {\n  return undefined;\n};\n\n/**\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n *          undefined if there are too many active requests to the server, and the request should be retried later.\n */\nUrlTemplateImageryProvider.prototype.requestImage = function (\n  x,\n  y,\n  level,\n  request\n) {\n  return ImageryProvider.loadImage(\n    this,\n    buildImageResource(this, x, y, level, request)\n  );\n};\n\n/**\n * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n * a tile.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {number} longitude The longitude at which to pick features.\n * @param {number} latitude  The latitude at which to pick features.\n * @return {Promise<ImageryLayerFeatureInfo[]>|undefined} A promise for the picked features that will resolve when the asynchronous\n *                   picking completes.  The resolved value is an array of {@link ImageryLayerFeatureInfo}\n *                   instances.  The array may be empty if no features are found at the given location.\n *                   It may also be undefined if picking is not supported.\n */\nUrlTemplateImageryProvider.prototype.pickFeatures = function (\n  x,\n  y,\n  level,\n  longitude,\n  latitude\n) {\n  if (\n    !this.enablePickFeatures ||\n    !defined(this._pickFeaturesResource) ||\n    this._getFeatureInfoFormats.length === 0\n  ) {\n    return undefined;\n  }\n\n  let formatIndex = 0;\n\n  const that = this;\n\n  function handleResponse(format, data) {\n    return format.callback(data);\n  }\n\n  function doRequest() {\n    if (formatIndex >= that._getFeatureInfoFormats.length) {\n      // No valid formats, so no features picked.\n      return Promise.resolve([]);\n    }\n\n    const format = that._getFeatureInfoFormats[formatIndex];\n    const resource = buildPickFeaturesResource(\n      that,\n      x,\n      y,\n      level,\n      longitude,\n      latitude,\n      format.format\n    );\n\n    ++formatIndex;\n\n    if (format.type === \"json\") {\n      return resource.fetchJson().then(format.callback).catch(doRequest);\n    } else if (format.type === \"xml\") {\n      return resource.fetchXML().then(format.callback).catch(doRequest);\n    } else if (format.type === \"text\" || format.type === \"html\") {\n      return resource.fetchText().then(format.callback).catch(doRequest);\n    }\n    return resource\n      .fetch({\n        responseType: format.format,\n      })\n      .then(handleResponse.bind(undefined, format))\n      .catch(doRequest);\n  }\n\n  return doRequest();\n};\n\nlet degreesScratchComputed = false;\nconst degreesScratch = new Rectangle();\nlet projectedScratchComputed = false;\nconst projectedScratch = new Rectangle();\n\nfunction buildImageResource(imageryProvider, x, y, level, request) {\n  degreesScratchComputed = false;\n  projectedScratchComputed = false;\n\n  const resource = imageryProvider._resource;\n  const url = resource.getUrlComponent(true);\n  const allTags = imageryProvider._tags;\n  const templateValues = {};\n\n  const match = url.match(templateRegex);\n  if (defined(match)) {\n    match.forEach(function (tag) {\n      const key = tag.substring(1, tag.length - 1); //strip {}\n      if (defined(allTags[key])) {\n        templateValues[key] = allTags[key](imageryProvider, x, y, level);\n      }\n    });\n  }\n\n  return resource.getDerivedResource({\n    request: request,\n    templateValues: templateValues,\n  });\n}\n\nlet ijScratchComputed = false;\nconst ijScratch = new Cartesian2();\nlet longitudeLatitudeProjectedScratchComputed = false;\n\nfunction buildPickFeaturesResource(\n  imageryProvider,\n  x,\n  y,\n  level,\n  longitude,\n  latitude,\n  format\n) {\n  degreesScratchComputed = false;\n  projectedScratchComputed = false;\n  ijScratchComputed = false;\n  longitudeLatitudeProjectedScratchComputed = false;\n\n  const resource = imageryProvider._pickFeaturesResource;\n  const url = resource.getUrlComponent(true);\n  const allTags = imageryProvider._pickFeaturesTags;\n  const templateValues = {};\n  const match = url.match(templateRegex);\n  if (defined(match)) {\n    match.forEach(function (tag) {\n      const key = tag.substring(1, tag.length - 1); //strip {}\n      if (defined(allTags[key])) {\n        templateValues[key] = allTags[key](\n          imageryProvider,\n          x,\n          y,\n          level,\n          longitude,\n          latitude,\n          format\n        );\n      }\n    });\n  }\n\n  return resource.getDerivedResource({\n    templateValues: templateValues,\n  });\n}\n\nfunction padWithZerosIfNecessary(imageryProvider, key, value) {\n  if (\n    imageryProvider &&\n    imageryProvider.urlSchemeZeroPadding &&\n    imageryProvider.urlSchemeZeroPadding.hasOwnProperty(key)\n  ) {\n    const paddingTemplate = imageryProvider.urlSchemeZeroPadding[key];\n    if (typeof paddingTemplate === \"string\") {\n      const paddingTemplateWidth = paddingTemplate.length;\n      if (paddingTemplateWidth > 1) {\n        value =\n          value.length >= paddingTemplateWidth\n            ? value\n            : new Array(\n                paddingTemplateWidth - value.toString().length + 1\n              ).join(\"0\") + value;\n      }\n    }\n  }\n  return value;\n}\n\nfunction xTag(imageryProvider, x, y, level) {\n  return padWithZerosIfNecessary(imageryProvider, \"{x}\", x);\n}\n\nfunction reverseXTag(imageryProvider, x, y, level) {\n  const reverseX =\n    imageryProvider.tilingScheme.getNumberOfXTilesAtLevel(level) - x - 1;\n  return padWithZerosIfNecessary(imageryProvider, \"{reverseX}\", reverseX);\n}\n\nfunction yTag(imageryProvider, x, y, level) {\n  return padWithZerosIfNecessary(imageryProvider, \"{y}\", y);\n}\n\nfunction reverseYTag(imageryProvider, x, y, level) {\n  const reverseY =\n    imageryProvider.tilingScheme.getNumberOfYTilesAtLevel(level) - y - 1;\n  return padWithZerosIfNecessary(imageryProvider, \"{reverseY}\", reverseY);\n}\n\nfunction reverseZTag(imageryProvider, x, y, level) {\n  const maximumLevel = imageryProvider.maximumLevel;\n  const reverseZ =\n    defined(maximumLevel) && level < maximumLevel\n      ? maximumLevel - level - 1\n      : level;\n  return padWithZerosIfNecessary(imageryProvider, \"{reverseZ}\", reverseZ);\n}\n\nfunction zTag(imageryProvider, x, y, level) {\n  return padWithZerosIfNecessary(imageryProvider, \"{z}\", level);\n}\n\nfunction sTag(imageryProvider, x, y, level) {\n  const index = (x + y + level) % imageryProvider._subdomains.length;\n  return imageryProvider._subdomains[index];\n}\n\nfunction computeDegrees(imageryProvider, x, y, level) {\n  if (degreesScratchComputed) {\n    return;\n  }\n\n  imageryProvider.tilingScheme.tileXYToRectangle(x, y, level, degreesScratch);\n  degreesScratch.west = CesiumMath.toDegrees(degreesScratch.west);\n  degreesScratch.south = CesiumMath.toDegrees(degreesScratch.south);\n  degreesScratch.east = CesiumMath.toDegrees(degreesScratch.east);\n  degreesScratch.north = CesiumMath.toDegrees(degreesScratch.north);\n\n  degreesScratchComputed = true;\n}\n\nfunction westDegreesTag(imageryProvider, x, y, level) {\n  computeDegrees(imageryProvider, x, y, level);\n  return degreesScratch.west;\n}\n\nfunction southDegreesTag(imageryProvider, x, y, level) {\n  computeDegrees(imageryProvider, x, y, level);\n  return degreesScratch.south;\n}\n\nfunction eastDegreesTag(imageryProvider, x, y, level) {\n  computeDegrees(imageryProvider, x, y, level);\n  return degreesScratch.east;\n}\n\nfunction northDegreesTag(imageryProvider, x, y, level) {\n  computeDegrees(imageryProvider, x, y, level);\n  return degreesScratch.north;\n}\n\nfunction computeProjected(imageryProvider, x, y, level) {\n  if (projectedScratchComputed) {\n    return;\n  }\n\n  imageryProvider.tilingScheme.tileXYToNativeRectangle(\n    x,\n    y,\n    level,\n    projectedScratch\n  );\n\n  projectedScratchComputed = true;\n}\n\nfunction westProjectedTag(imageryProvider, x, y, level) {\n  computeProjected(imageryProvider, x, y, level);\n  return projectedScratch.west;\n}\n\nfunction southProjectedTag(imageryProvider, x, y, level) {\n  computeProjected(imageryProvider, x, y, level);\n  return projectedScratch.south;\n}\n\nfunction eastProjectedTag(imageryProvider, x, y, level) {\n  computeProjected(imageryProvider, x, y, level);\n  return projectedScratch.east;\n}\n\nfunction northProjectedTag(imageryProvider, x, y, level) {\n  computeProjected(imageryProvider, x, y, level);\n  return projectedScratch.north;\n}\n\nfunction widthTag(imageryProvider, x, y, level) {\n  return imageryProvider.tileWidth;\n}\n\nfunction heightTag(imageryProvider, x, y, level) {\n  return imageryProvider.tileHeight;\n}\n\nfunction iTag(imageryProvider, x, y, level, longitude, latitude, format) {\n  computeIJ(imageryProvider, x, y, level, longitude, latitude);\n  return ijScratch.x;\n}\n\nfunction jTag(imageryProvider, x, y, level, longitude, latitude, format) {\n  computeIJ(imageryProvider, x, y, level, longitude, latitude);\n  return ijScratch.y;\n}\n\nfunction reverseITag(\n  imageryProvider,\n  x,\n  y,\n  level,\n  longitude,\n  latitude,\n  format\n) {\n  computeIJ(imageryProvider, x, y, level, longitude, latitude);\n  return imageryProvider.tileWidth - ijScratch.x - 1;\n}\n\nfunction reverseJTag(\n  imageryProvider,\n  x,\n  y,\n  level,\n  longitude,\n  latitude,\n  format\n) {\n  computeIJ(imageryProvider, x, y, level, longitude, latitude);\n  return imageryProvider.tileHeight - ijScratch.y - 1;\n}\n\nconst rectangleScratch = new Rectangle();\nconst longitudeLatitudeProjectedScratch = new Cartesian3();\n\nfunction computeIJ(imageryProvider, x, y, level, longitude, latitude, format) {\n  if (ijScratchComputed) {\n    return;\n  }\n\n  computeLongitudeLatitudeProjected(\n    imageryProvider,\n    x,\n    y,\n    level,\n    longitude,\n    latitude\n  );\n  const projected = longitudeLatitudeProjectedScratch;\n\n  const rectangle = imageryProvider.tilingScheme.tileXYToNativeRectangle(\n    x,\n    y,\n    level,\n    rectangleScratch\n  );\n  ijScratch.x =\n    ((imageryProvider.tileWidth * (projected.x - rectangle.west)) /\n      rectangle.width) |\n    0;\n  ijScratch.y =\n    ((imageryProvider.tileHeight * (rectangle.north - projected.y)) /\n      rectangle.height) |\n    0;\n  ijScratchComputed = true;\n}\n\nfunction longitudeDegreesTag(\n  imageryProvider,\n  x,\n  y,\n  level,\n  longitude,\n  latitude,\n  format\n) {\n  return CesiumMath.toDegrees(longitude);\n}\n\nfunction latitudeDegreesTag(\n  imageryProvider,\n  x,\n  y,\n  level,\n  longitude,\n  latitude,\n  format\n) {\n  return CesiumMath.toDegrees(latitude);\n}\n\nfunction longitudeProjectedTag(\n  imageryProvider,\n  x,\n  y,\n  level,\n  longitude,\n  latitude,\n  format\n) {\n  computeLongitudeLatitudeProjected(\n    imageryProvider,\n    x,\n    y,\n    level,\n    longitude,\n    latitude\n  );\n  return longitudeLatitudeProjectedScratch.x;\n}\n\nfunction latitudeProjectedTag(\n  imageryProvider,\n  x,\n  y,\n  level,\n  longitude,\n  latitude,\n  format\n) {\n  computeLongitudeLatitudeProjected(\n    imageryProvider,\n    x,\n    y,\n    level,\n    longitude,\n    latitude\n  );\n  return longitudeLatitudeProjectedScratch.y;\n}\n\nconst cartographicScratch = new Cartographic();\n\nfunction computeLongitudeLatitudeProjected(\n  imageryProvider,\n  x,\n  y,\n  level,\n  longitude,\n  latitude,\n  format\n) {\n  if (longitudeLatitudeProjectedScratchComputed) {\n    return;\n  }\n\n  if (imageryProvider.tilingScheme.projection instanceof GeographicProjection) {\n    longitudeLatitudeProjectedScratch.x = CesiumMath.toDegrees(longitude);\n    longitudeLatitudeProjectedScratch.y = CesiumMath.toDegrees(latitude);\n  } else {\n    const cartographic = cartographicScratch;\n    cartographic.longitude = longitude;\n    cartographic.latitude = latitude;\n    imageryProvider.tilingScheme.projection.project(\n      cartographic,\n      longitudeLatitudeProjectedScratch\n    );\n  }\n\n  longitudeLatitudeProjectedScratchComputed = true;\n}\n\nfunction formatTag(imageryProvider, x, y, level, longitude, latitude, format) {\n  return format;\n}\nexport default UrlTemplateImageryProvider;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport GeographicProjection from \"../Core/GeographicProjection.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport RequestErrorEvent from \"../Core/RequestErrorEvent.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TileProviderError from \"../Core/TileProviderError.js\";\nimport WebMercatorTilingScheme from \"../Core/WebMercatorTilingScheme.js\";\nimport UrlTemplateImageryProvider from \"./UrlTemplateImageryProvider.js\";\n\n/**\n * @typedef {object} TileMapServiceImageryProvider.ConstructorOptions\n *\n * Initialization options for the TileMapServiceImageryProvider constructor\n *\n * @property {string} [fileExtension='png'] The file extension for images on the server.\n * @property {Credit|string} [credit=''] A credit for the data source, which is displayed on the canvas.\n * @property {number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider.  Take care when specifying\n *                 this that the number of tiles at the minimum level is small, such as four or less.  A larger number is likely\n *                 to result in rendering problems.\n * @property {number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.\n * @property {TilingScheme} [tilingScheme] The tiling scheme specifying how the ellipsoidal\n * surface is broken into tiles.  If this parameter is not provided, a {@link WebMercatorTilingScheme}\n * is used.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If the tilingScheme is specified,\n *                    this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n *                    parameter is specified, the WGS84 ellipsoid is used.\n * @property {number} [tileWidth=256] Pixel width of image tiles.\n * @property {number} [tileHeight=256] Pixel height of image tiles.\n * @property {boolean} [flipXY] Older versions of gdal2tiles.py flipped X and Y values in tilemapresource.xml.\n * @property {TileDiscardPolicy} [tileDiscardPolicy] A policy for discarding tile images according to some criteria\n * Specifying this option will do the same, allowing for loading of these incorrect tilesets.\n */\n\n/**\n * <div class=\"notice\">\n * To construct a TileMapServiceImageryProvider, call {@link TileMapServiceImageryProvider.fromUrl}. Do not call the constructor directly.\n * </div>\n *\n * An imagery provider that provides tiled imagery as generated by\n * {@link http://www.maptiler.org/|MapTiler}, {@link http://www.klokan.cz/projects/gdal2tiles/|GDAL2Tiles}, etc.\n *\n * @alias TileMapServiceImageryProvider\n * @constructor\n * @extends UrlTemplateImageryProvider\n *\n * @param {TileMapServiceImageryProvider.ConstructorOptions} [options] Object describing initialization options\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see OpenStreetMapImageryProvider\n * @see SingleTileImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n * @see UrlTemplateImageryProvider\n *\n * @example\n * const tms = await Cesium.TileMapServiceImageryProvider.fromUrl(\n *    \"../images/cesium_maptiler/Cesium_Logo_Color\", {\n *      fileExtension: 'png',\n *      maximumLevel: 4,\n *      rectangle: new Cesium.Rectangle(\n *        Cesium.Math.toRadians(-120.0),\n *        Cesium.Math.toRadians(20.0),\n *        Cesium.Math.toRadians(-60.0),\n *        Cesium.Math.toRadians(40.0))\n * });\n */\nfunction TileMapServiceImageryProvider(options) {\n  UrlTemplateImageryProvider.call(this, options);\n}\n\nTileMapServiceImageryProvider._requestMetadata = async function (\n  options,\n  tmsResource,\n  xmlResource,\n  provider\n) {\n  // Try to load remaining parameters from XML\n  try {\n    const xml = await xmlResource.fetchXML();\n    return TileMapServiceImageryProvider._metadataSuccess(\n      xml,\n      options,\n      tmsResource,\n      xmlResource,\n      provider\n    );\n  } catch (e) {\n    if (e instanceof RequestErrorEvent) {\n      return TileMapServiceImageryProvider._metadataFailure(\n        options,\n        tmsResource\n      );\n    }\n\n    throw e;\n  }\n};\n/**\n * Creates a TileMapServiceImageryProvider from the specified url.\n *\n * @param {Resource|String} url Path to image tiles on server.\n * @param {TileMapServiceImageryProvider.ConstructorOptions} [options] Object describing initialization options.\n * @returns {Promise<TileMapServiceImageryProvider>} A promise that resolves to the created TileMapServiceImageryProvider.\n *\n * @example\n * const tms = await Cesium.TileMapServiceImageryProvider.fromUrl(\n *    '../images/cesium_maptiler/Cesium_Logo_Color', {\n *      fileExtension: 'png',\n *      maximumLevel: 4,\n *      rectangle: new Cesium.Rectangle(\n *        Cesium.Math.toRadians(-120.0),\n *        Cesium.Math.toRadians(20.0),\n *        Cesium.Math.toRadians(-60.0),\n *        Cesium.Math.toRadians(40.0))\n * });\n *\n * @exception {RuntimeError} Unable to find expected tilesets or bbox attributes in tilemapresource.xml\n * @exception {RuntimeError} tilemapresource.xml specifies an unsupported profile attribute\n */\nTileMapServiceImageryProvider.fromUrl = async function (url, options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"url\", url);\n  //>>includeEnd('debug');\n\n  const resource = Resource.createIfNeeded(url);\n  resource.appendForwardSlash();\n\n  const tmsResource = resource;\n  const xmlResource = resource.getDerivedResource({\n    url: \"tilemapresource.xml\",\n  });\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const metadata = await TileMapServiceImageryProvider._requestMetadata(\n    options,\n    tmsResource,\n    xmlResource\n  );\n\n  return new TileMapServiceImageryProvider(metadata);\n};\n\nif (defined(Object.create)) {\n  TileMapServiceImageryProvider.prototype = Object.create(\n    UrlTemplateImageryProvider.prototype\n  );\n  TileMapServiceImageryProvider.prototype.constructor = TileMapServiceImageryProvider;\n}\n\n/**\n * Mutates the properties of a given rectangle so it does not extend outside of the given tiling scheme's rectangle\n * @private\n */\nfunction confineRectangleToTilingScheme(rectangle, tilingScheme) {\n  if (rectangle.west < tilingScheme.rectangle.west) {\n    rectangle.west = tilingScheme.rectangle.west;\n  }\n  if (rectangle.east > tilingScheme.rectangle.east) {\n    rectangle.east = tilingScheme.rectangle.east;\n  }\n  if (rectangle.south < tilingScheme.rectangle.south) {\n    rectangle.south = tilingScheme.rectangle.south;\n  }\n  if (rectangle.north > tilingScheme.rectangle.north) {\n    rectangle.north = tilingScheme.rectangle.north;\n  }\n  return rectangle;\n}\n\nfunction calculateSafeMinimumDetailLevel(\n  tilingScheme,\n  rectangle,\n  minimumLevel\n) {\n  // Check the number of tiles at the minimum level.  If it's more than four,\n  // try requesting the lower levels anyway, because starting at the higher minimum\n  // level will cause too many tiles to be downloaded and rendered.\n  const swTile = tilingScheme.positionToTileXY(\n    Rectangle.southwest(rectangle),\n    minimumLevel\n  );\n  const neTile = tilingScheme.positionToTileXY(\n    Rectangle.northeast(rectangle),\n    minimumLevel\n  );\n  const tileCount =\n    (Math.abs(neTile.x - swTile.x) + 1) * (Math.abs(neTile.y - swTile.y) + 1);\n  if (tileCount > 4) {\n    return 0;\n  }\n  return minimumLevel;\n}\n\n/**\n * Parses the results of a successful xml request\n * @private\n *\n * @param {Object} xml\n * @param {TileMapServiceImageryProvider.ConstructorOptions} options\n * @param {Resource} tmsResource\n * @param {Resource} xmlResource\n * @returns {UrlTemplateImageryProvider.ConstructorOptions}\n */\nTileMapServiceImageryProvider._metadataSuccess = function (\n  xml,\n  options,\n  tmsResource,\n  xmlResource,\n  provider\n) {\n  const tileFormatRegex = /tileformat/i;\n  const tileSetRegex = /tileset/i;\n  const tileSetsRegex = /tilesets/i;\n  const bboxRegex = /boundingbox/i;\n  let format, bbox, tilesets;\n  const tilesetsList = []; //list of TileSets\n\n  // Allowing options properties (already copied to that) to override XML values\n\n  // Iterate XML Document nodes for properties\n  const nodeList = xml.childNodes[0].childNodes;\n  for (let i = 0; i < nodeList.length; i++) {\n    if (tileFormatRegex.test(nodeList.item(i).nodeName)) {\n      format = nodeList.item(i);\n    } else if (tileSetsRegex.test(nodeList.item(i).nodeName)) {\n      tilesets = nodeList.item(i); // Node list of TileSets\n      const tileSetNodes = nodeList.item(i).childNodes;\n      // Iterate the nodes to find all TileSets\n      for (let j = 0; j < tileSetNodes.length; j++) {\n        if (tileSetRegex.test(tileSetNodes.item(j).nodeName)) {\n          // Add them to tilesets list\n          tilesetsList.push(tileSetNodes.item(j));\n        }\n      }\n    } else if (bboxRegex.test(nodeList.item(i).nodeName)) {\n      bbox = nodeList.item(i);\n    }\n  }\n\n  let message;\n  if (!defined(tilesets) || !defined(bbox)) {\n    message = `Unable to find expected tilesets or bbox attributes in ${xmlResource.url}.`;\n    if (defined(provider)) {\n      TileProviderError.reportError(\n        undefined,\n        provider,\n        provider.errorEvent,\n        message\n      );\n    }\n\n    throw new RuntimeError(message);\n  }\n\n  const fileExtension = defaultValue(\n    options.fileExtension,\n    format.getAttribute(\"extension\")\n  );\n  const tileWidth = defaultValue(\n    options.tileWidth,\n    parseInt(format.getAttribute(\"width\"), 10)\n  );\n  const tileHeight = defaultValue(\n    options.tileHeight,\n    parseInt(format.getAttribute(\"height\"), 10)\n  );\n  let minimumLevel = defaultValue(\n    options.minimumLevel,\n    parseInt(tilesetsList[0].getAttribute(\"order\"), 10)\n  );\n  const maximumLevel = defaultValue(\n    options.maximumLevel,\n    parseInt(tilesetsList[tilesetsList.length - 1].getAttribute(\"order\"), 10)\n  );\n  const tilingSchemeName = tilesets.getAttribute(\"profile\");\n  let tilingScheme = options.tilingScheme;\n\n  if (!defined(tilingScheme)) {\n    if (\n      tilingSchemeName === \"geodetic\" ||\n      tilingSchemeName === \"global-geodetic\"\n    ) {\n      tilingScheme = new GeographicTilingScheme({\n        ellipsoid: options.ellipsoid,\n      });\n    } else if (\n      tilingSchemeName === \"mercator\" ||\n      tilingSchemeName === \"global-mercator\"\n    ) {\n      tilingScheme = new WebMercatorTilingScheme({\n        ellipsoid: options.ellipsoid,\n      });\n    } else {\n      message = `${xmlResource.url} specifies an unsupported profile attribute, ${tilingSchemeName}.`;\n      if (defined(provider)) {\n        TileProviderError.reportError(\n          undefined,\n          provider,\n          provider.errorEvent,\n          message\n        );\n      }\n\n      throw new RuntimeError(message);\n    }\n  }\n\n  // rectangle handling\n  let rectangle = Rectangle.clone(options.rectangle);\n\n  if (!defined(rectangle)) {\n    let sw;\n    let ne;\n    let swXY;\n    let neXY;\n\n    // In older versions of gdal x and y values were flipped, which is why we check for an option to flip\n    // the values here as well. Unfortunately there is no way to autodetect whether flipping is needed.\n    const flipXY = defaultValue(options.flipXY, false);\n    if (flipXY) {\n      swXY = new Cartesian2(\n        parseFloat(bbox.getAttribute(\"miny\")),\n        parseFloat(bbox.getAttribute(\"minx\"))\n      );\n      neXY = new Cartesian2(\n        parseFloat(bbox.getAttribute(\"maxy\")),\n        parseFloat(bbox.getAttribute(\"maxx\"))\n      );\n    } else {\n      swXY = new Cartesian2(\n        parseFloat(bbox.getAttribute(\"minx\")),\n        parseFloat(bbox.getAttribute(\"miny\"))\n      );\n      neXY = new Cartesian2(\n        parseFloat(bbox.getAttribute(\"maxx\")),\n        parseFloat(bbox.getAttribute(\"maxy\"))\n      );\n    }\n\n    // Determine based on the profile attribute if this tileset was generated by gdal2tiles.py, which\n    // uses 'mercator' and 'geodetic' profiles, or by a tool compliant with the TMS standard, which is\n    // 'global-mercator' and 'global-geodetic' profiles. In the gdal2Tiles case, X and Y are always in\n    // geodetic degrees.\n    const isGdal2tiles =\n      tilingSchemeName === \"geodetic\" || tilingSchemeName === \"mercator\";\n    if (\n      tilingScheme.projection instanceof GeographicProjection ||\n      isGdal2tiles\n    ) {\n      sw = Cartographic.fromDegrees(swXY.x, swXY.y);\n      ne = Cartographic.fromDegrees(neXY.x, neXY.y);\n    } else {\n      const projection = tilingScheme.projection;\n      sw = projection.unproject(swXY);\n      ne = projection.unproject(neXY);\n    }\n\n    rectangle = new Rectangle(\n      sw.longitude,\n      sw.latitude,\n      ne.longitude,\n      ne.latitude\n    );\n  }\n\n  // The rectangle must not be outside the bounds allowed by the tiling scheme.\n  rectangle = confineRectangleToTilingScheme(rectangle, tilingScheme);\n  // clamp our minimum detail level to something that isn't going to request a ridiculous number of tiles\n  minimumLevel = calculateSafeMinimumDetailLevel(\n    tilingScheme,\n    rectangle,\n    minimumLevel\n  );\n\n  const templateResource = tmsResource.getDerivedResource({\n    url: `{z}/{x}/{reverseY}.${fileExtension}`,\n  });\n\n  return {\n    url: templateResource,\n    tilingScheme: tilingScheme,\n    rectangle: rectangle,\n    tileWidth: tileWidth,\n    tileHeight: tileHeight,\n    minimumLevel: minimumLevel,\n    maximumLevel: maximumLevel,\n    tileDiscardPolicy: options.tileDiscardPolicy,\n    credit: options.credit,\n  };\n};\n\n/**\n * Handle xml request failure by providing the default values\n * @private\n *\n * @param {TileMapServiceImageryProvider.ConstructorOptions} options\n * @param {Resource} tmsResource\n * @returns {UrlTemplateImageryProvider.ConstructorOptions}\n */\nTileMapServiceImageryProvider._metadataFailure = function (\n  options,\n  tmsResource\n) {\n  // Can't load XML, still allow options and defaults\n  const fileExtension = defaultValue(options.fileExtension, \"png\");\n  const tileWidth = defaultValue(options.tileWidth, 256);\n  const tileHeight = defaultValue(options.tileHeight, 256);\n  const maximumLevel = options.maximumLevel;\n  const tilingScheme = defined(options.tilingScheme)\n    ? options.tilingScheme\n    : new WebMercatorTilingScheme({ ellipsoid: options.ellipsoid });\n\n  let rectangle = defaultValue(options.rectangle, tilingScheme.rectangle);\n  // The rectangle must not be outside the bounds allowed by the tiling scheme.\n  rectangle = confineRectangleToTilingScheme(rectangle, tilingScheme);\n\n  // make sure we use a safe minimum detail level, so we don't request a ridiculous number of tiles\n  const minimumLevel = calculateSafeMinimumDetailLevel(\n    tilingScheme,\n    rectangle,\n    options.minimumLevel\n  );\n\n  const templateResource = tmsResource.getDerivedResource({\n    url: `{z}/{x}/{reverseY}.${fileExtension}`,\n  });\n\n  return {\n    url: templateResource,\n    tilingScheme: tilingScheme,\n    rectangle: rectangle,\n    tileWidth: tileWidth,\n    tileHeight: tileHeight,\n    minimumLevel: minimumLevel,\n    maximumLevel: maximumLevel,\n    tileDiscardPolicy: options.tileDiscardPolicy,\n    credit: options.credit,\n  };\n};\n\nexport default TileMapServiceImageryProvider;\n", "import buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Check from \"../Core/Check.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TileProviderError from \"../Core/TileProviderError.js\";\nimport WebMercatorTilingScheme from \"../Core/WebMercatorTilingScheme.js\";\nimport ImageryProvider from \"./ImageryProvider.js\";\n\n/**\n * @typedef {object} GoogleEarthEnterpriseMapsProvider.ConstructorOptions\n *\n * Initialization options for the GoogleEarthEnterpriseMapsProvider constructor\n *\n * @property {number} channel The channel (id) to be used when requesting data from the server.\n *        The channel number can be found by looking at the json file located at:\n *        earth.localdomain/default_map/query?request=Json&vars=geeServerDefs The /default_map path may\n *        differ depending on your Google Earth Enterprise server configuration. Look for the \"id\" that\n *        is associated with a \"ImageryMaps\" requestType. There may be more than one id available.\n *        Example:\n *        {\n *          layers: [\n *            {\n *              id: 1002,\n *              requestType: \"ImageryMaps\"\n *            },\n *            {\n *              id: 1007,\n *              requestType: \"VectorMapsRaster\"\n *            }\n *          ]\n *        }\n * @property {string} [path=\"/default_map\"] The path of the Google Earth server hosting the imagery.\n * @property {number} [maximumLevel] The maximum level-of-detail supported by the Google Earth\n *        Enterprise server, or undefined if there is no limit.\n * @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile\n *        is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass\n *        a {@link NeverTileDiscardPolicy} for this parameter.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If not specified, the WGS84 ellipsoid is used.\n */\n\n/**\n * Used to track creation details while fetching initial metadata\n *\n * @constructor\n * @private\n *\n * @param {GoogleEarthEnterpriseMapsProvider.ConstructorOptions} options An object describing initialization options\n */\nfunction ImageryProviderBuilder(options) {\n  this.channel = options.channel;\n  this.ellipsoid = options.ellipsoid;\n  this.tilingScheme = undefined;\n  this.version = undefined;\n}\n\n/**\n * Complete GoogleEarthEnterpriseMapsProvider creation based on builder values.\n *\n * @private\n *\n * @param {GoogleEarthEnterpriseMapsProvider} provider\n */\nImageryProviderBuilder.prototype.build = function (provider) {\n  provider._channel = this.channel;\n  provider._version = this.version;\n  provider._tilingScheme = this.tilingScheme;\n};\n\nfunction metadataSuccess(text, imageryProviderBuilder) {\n  let data;\n\n  // The Google Earth server sends malformed JSON data currently...\n  try {\n    // First, try parsing it like normal in case a future version sends correctly formatted JSON\n    data = JSON.parse(text);\n  } catch (e) {\n    // Quote object strings manually, then try parsing again\n    data = JSON.parse(\n      text.replace(/([\\[\\{,])[\\n\\r ]*([A-Za-z0-9]+)[\\n\\r ]*:/g, '$1\"$2\":')\n    );\n  }\n\n  let layer;\n  for (let i = 0; i < data.layers.length; i++) {\n    if (data.layers[i].id === imageryProviderBuilder.channel) {\n      layer = data.layers[i];\n      break;\n    }\n  }\n\n  if (!defined(layer)) {\n    const message = `Could not find layer with channel (id) of ${imageryProviderBuilder.channel}.`;\n    throw new RuntimeError(message);\n  }\n\n  if (!defined(layer.version)) {\n    const message = `Could not find a version in channel (id) ${imageryProviderBuilder.channel}.`;\n    throw new RuntimeError(message);\n  }\n\n  imageryProviderBuilder.version = layer.version;\n\n  if (defined(data.projection) && data.projection === \"flat\") {\n    imageryProviderBuilder.tilingScheme = new GeographicTilingScheme({\n      numberOfLevelZeroTilesX: 2,\n      numberOfLevelZeroTilesY: 2,\n      rectangle: new Rectangle(-Math.PI, -Math.PI, Math.PI, Math.PI),\n      ellipsoid: imageryProviderBuilder.ellipsoid,\n    });\n    // Default to mercator projection when projection is undefined\n  } else if (!defined(data.projection) || data.projection === \"mercator\") {\n    imageryProviderBuilder.tilingScheme = new WebMercatorTilingScheme({\n      numberOfLevelZeroTilesX: 2,\n      numberOfLevelZeroTilesY: 2,\n      ellipsoid: imageryProviderBuilder.ellipsoid,\n    });\n  } else {\n    const message = `Unsupported projection ${data.projection}.`;\n    throw new RuntimeError(message);\n  }\n\n  return true;\n}\n\nfunction metadataFailure(error, metadataResource, provider) {\n  let message = `An error occurred while accessing ${metadataResource.url}.`;\n  if (defined(error) && defined(error.message)) {\n    message += `: ${error.message}`;\n  }\n\n  TileProviderError.reportError(\n    undefined,\n    provider,\n    defined(provider) ? provider._errorEvent : undefined,\n    message\n  );\n\n  throw new RuntimeError(message);\n}\n\nasync function requestMetadata(\n  metadataResource,\n  imageryProviderBuilder,\n  provider\n) {\n  try {\n    const text = await metadataResource.fetchText();\n    metadataSuccess(text, imageryProviderBuilder);\n  } catch (error) {\n    metadataFailure(error, metadataResource, provider);\n  }\n}\n\n/**\n * <div class=\"notice\">\n * To construct a GoogleEarthEnterpriseMapsProvider, call {@link GoogleEarthEnterpriseImageryProvider.fromUrl}. Do not call the constructor directly.\n * </div>\n *\n * Provides tiled imagery using the Google Earth Imagery API.\n *\n * Notes: This imagery provider does not work with the public Google Earth servers. It works with the\n *        Google Earth Enterprise Server.\n *\n *        By default the Google Earth Enterprise server does not set the\n *        {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing} headers. You can either\n *        use a proxy server which adds these headers, or in the /opt/google/gehttpd/conf/gehttpd.conf\n *        and add the 'Header set Access-Control-Allow-Origin \"*\"' option to the '&lt;Directory /&gt;' and\n *        '&lt;Directory \"/opt/google/gehttpd/htdocs\"&gt;' directives.\n *\n *        This provider is for use with 2D Maps API as part of Google Earth Enterprise. For 3D Earth API uses, it\n *        is necessary to use {@link GoogleEarthEnterpriseImageryProvider}\n *\n * @alias GoogleEarthEnterpriseMapsProvider\n * @constructor\n *\n * @param {GoogleEarthEnterpriseMapsProvider.ConstructorOptions} options Object describing initialization options\n *\n * @exception {RuntimeError} Could not find layer with channel (id) of <code>options.channel</code>.\n * @exception {RuntimeError} Could not find a version in channel (id) <code>options.channel</code>.\n * @exception {RuntimeError} Unsupported projection <code>data.projection</code>.\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see OpenStreetMapImageryProvider\n * @see SingleTileImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n * @see UrlTemplateImageryProvider\n *\n *\n * @example\n * const google = await Cesium.GoogleEarthEnterpriseMapsProvider.fromUrl(\"https://earth.localdomain\", 1008);\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n */\nfunction GoogleEarthEnterpriseMapsProvider(options) {\n  options = defaultValue(options, {});\n\n  this._defaultAlpha = undefined;\n  this._defaultNightAlpha = undefined;\n  this._defaultDayAlpha = undefined;\n  this._defaultBrightness = undefined;\n  this._defaultContrast = undefined;\n  this._defaultHue = undefined;\n  this._defaultSaturation = undefined;\n  this._defaultGamma = 1.9;\n  this._defaultMinificationFilter = undefined;\n  this._defaultMagnificationFilter = undefined;\n\n  this._tileDiscardPolicy = options.tileDiscardPolicy;\n  this._channel = options.channel;\n  this._requestType = \"ImageryMaps\";\n  this._credit = new Credit(\n    `<a href=\"http://www.google.com/enterprise/mapsearth/products/earthenterprise.html\"><img src=\"${GoogleEarthEnterpriseMapsProvider.logoUrl}\" title=\"Google Imagery\"/></a>`\n  );\n\n  this._tilingScheme = undefined;\n\n  this._version = undefined;\n\n  this._tileWidth = 256;\n  this._tileHeight = 256;\n  this._maximumLevel = options.maximumLevel;\n\n  this._errorEvent = new Event();\n}\n\nObject.defineProperties(GoogleEarthEnterpriseMapsProvider.prototype, {\n  /**\n   * Gets the URL of the Google Earth MapServer.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return this._url;\n    },\n  },\n\n  /**\n   * Gets the url path of the data on the Google Earth server.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  path: {\n    get: function () {\n      return this._path;\n    },\n  },\n\n  /**\n   * Gets the proxy used by this provider.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {Proxy}\n   * @readonly\n   */\n  proxy: {\n    get: function () {\n      return this._resource.proxy;\n    },\n  },\n\n  /**\n   * Gets the imagery channel (id) currently being used.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  channel: {\n    get: function () {\n      return this._channel;\n    },\n  },\n\n  /**\n   * Gets the width of each tile, in pixels.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileWidth: {\n    get: function () {\n      return this._tileWidth;\n    },\n  },\n\n  /**\n   * Gets the height of each tile, in pixels.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileHeight: {\n    get: function () {\n      return this._tileHeight;\n    },\n  },\n\n  /**\n   * Gets the maximum level-of-detail that can be requested.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {number|undefined}\n   * @readonly\n   */\n  maximumLevel: {\n    get: function () {\n      return this._maximumLevel;\n    },\n  },\n\n  /**\n   * Gets the minimum level-of-detail that can be requested.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  minimumLevel: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets the version of the data used by this provider.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  version: {\n    get: function () {\n      return this._version;\n    },\n  },\n\n  /**\n   * Gets the type of data that is being requested from the provider.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  requestType: {\n    get: function () {\n      return this._requestType;\n    },\n  },\n  /**\n   * Gets the rectangle, in radians, of the imagery provided by this instance.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {Rectangle}\n   * @readonly\n   */\n  rectangle: {\n    get: function () {\n      return this._tilingScheme.rectangle;\n    },\n  },\n\n  /**\n   * Gets the tile discard policy.  If not undefined, the discard policy is responsible\n   * for filtering out \"missing\" tiles via its shouldDiscardImage function.  If this function\n   * returns undefined, no tiles are filtered.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {TileDiscardPolicy}\n   * @readonly\n   */\n  tileDiscardPolicy: {\n    get: function () {\n      return this._tileDiscardPolicy;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this imagery provider is active.  Typically this is used to credit\n   * the source of the imagery.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the images provided by this imagery provider\n   * include an alpha channel.  If this property is false, an alpha channel, if present, will\n   * be ignored.  If this property is true, any images without an alpha channel will be treated\n   * as if their alpha is 1.0 everywhere.  When this property is false, memory usage\n   * and texture upload time are reduced.\n   * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasAlphaChannel: {\n    get: function () {\n      return true;\n    },\n  },\n});\n\n/**\n * Creates a tiled imagery provider using the Google Earth Imagery API.\n *\n * @param {Resource|String} url The url of the Google Earth server hosting the imagery.\n * @param {GoogleEarthEnterpriseMapsProvider.ConstructorOptions} [options] Object describing initialization options\n * @returns {Promise<GoogleEarthEnterpriseMapsProvider>} The created GoogleEarthEnterpriseMapsProvider.\n *\n * @exception {RuntimeError} Could not find layer with channel (id) of <code>options.channel</code>.\n * @exception {RuntimeError} Could not find a version in channel (id) <code>options.channel</code>.\n * @exception {RuntimeError} Unsupported projection <code>data.projection</code>.\n *\n * @example\n * const google = await Cesium.GoogleEarthEnterpriseMapsProvider.fromUrl(\"https://earth.localdomain\", 1008);\n */\nGoogleEarthEnterpriseMapsProvider.fromUrl = async function (\n  url,\n  channel,\n  options\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"url\", url);\n  Check.defined(\"channel\", channel);\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, {});\n\n  const path = defaultValue(options.path, \"/default_map\");\n\n  const resource = Resource.createIfNeeded(url).getDerivedResource({\n    // We used to just append path to url, so now that we do proper URI resolution, removed the /\n    url: path[0] === \"/\" ? path.substring(1) : path,\n  });\n\n  resource.appendForwardSlash();\n\n  const metadataResource = resource.getDerivedResource({\n    url: \"query\",\n    queryParameters: {\n      request: \"Json\",\n      vars: \"geeServerDefs\",\n      is2d: \"t\",\n    },\n  });\n\n  const imageryProviderBuilder = new ImageryProviderBuilder(options);\n  imageryProviderBuilder.channel = channel;\n  await requestMetadata(metadataResource, imageryProviderBuilder);\n\n  const provider = new GoogleEarthEnterpriseMapsProvider(options);\n  imageryProviderBuilder.build(provider);\n\n  provider._resource = resource;\n  provider._url = url;\n  provider._path = path;\n\n  return provider;\n};\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n */\nGoogleEarthEnterpriseMapsProvider.prototype.getTileCredits = function (\n  x,\n  y,\n  level\n) {\n  return undefined;\n};\n\n/**\n * Requests the image for a given tile.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n *          undefined if there are too many active requests to the server, and the request should be retried later.\n */\nGoogleEarthEnterpriseMapsProvider.prototype.requestImage = function (\n  x,\n  y,\n  level,\n  request\n) {\n  const resource = this._resource.getDerivedResource({\n    url: \"query\",\n    request: request,\n    queryParameters: {\n      request: this._requestType,\n      channel: this._channel,\n      version: this._version,\n      x: x,\n      y: y,\n      z: level + 1, // Google Earth starts with a zoom level of 1, not 0\n    },\n  });\n\n  return ImageryProvider.loadImage(this, resource);\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {number} longitude The longitude at which to pick features.\n * @param {number} latitude  The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nGoogleEarthEnterpriseMapsProvider.prototype.pickFeatures = function (\n  x,\n  y,\n  level,\n  longitude,\n  latitude\n) {\n  return undefined;\n};\n\nGoogleEarthEnterpriseMapsProvider._logoUrl = undefined;\n\nObject.defineProperties(GoogleEarthEnterpriseMapsProvider, {\n  /**\n   * Gets or sets the URL to the Google Earth logo for display in the credit.\n   * @memberof GoogleEarthEnterpriseMapsProvider\n   * @type {string}\n   */\n  logoUrl: {\n    get: function () {\n      if (!defined(GoogleEarthEnterpriseMapsProvider._logoUrl)) {\n        GoogleEarthEnterpriseMapsProvider._logoUrl = buildModuleUrl(\n          \"Assets/Images/google_earth_credit.png\"\n        );\n      }\n      return GoogleEarthEnterpriseMapsProvider._logoUrl;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"value\", value);\n      //>>includeEnd('debug');\n\n      GoogleEarthEnterpriseMapsProvider._logoUrl = value;\n    },\n  },\n});\nexport default GoogleEarthEnterpriseMapsProvider;\n", "import Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Resource from \"../Core/Resource.js\";\nimport UrlTemplateImageryProvider from \"./UrlTemplateImageryProvider.js\";\n\nconst trailingSlashRegex = /\\/$/;\nconst defaultCredit = new Credit(\n  '&copy; <a href=\"https://www.mapbox.com/about/maps/\">Mapbox</a> &copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a> <strong><a href=\"https://www.mapbox.com/map-feedback/\">Improve this map</a></strong>'\n);\n\n/**\n * @typedef {object} MapboxImageryProvider.ConstructorOptions\n *\n * Initialization options for the MapboxImageryProvider constructor\n *\n * @property {string} [url='https://api.mapbox.com/v4/'] The Mapbox server url.\n * @property {string} mapId The Mapbox Map ID.\n * @property {string} accessToken The public access token for the imagery.\n * @property {string} [format='png'] The format of the image request.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If not specified, the WGS84 ellipsoid is used.\n * @property {number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider.  Take care when specifying\n *                 this that the number of tiles at the minimum level is small, such as four or less.  A larger number is likely\n *                 to result in rendering problems.\n * @property {number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.\n * @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.\n */\n\n/**\n * Provides tiled imagery hosted by Mapbox.\n *\n * @alias MapboxImageryProvider\n * @constructor\n *\n * @param {MapboxImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @example\n * // Mapbox tile provider\n * const mapbox = new Cesium.MapboxImageryProvider({\n *     mapId: 'mapbox.mapbox-terrain-v2',\n *     accessToken: 'thisIsMyAccessToken'\n * });\n *\n * @see {@link https://docs.mapbox.com/api/maps/raster-tiles/}\n * @see {@link https://docs.mapbox.com/api/accounts/tokens/}\n */\nfunction MapboxImageryProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const mapId = options.mapId;\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(mapId)) {\n    throw new DeveloperError(\"options.mapId is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const accessToken = options.accessToken;\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(accessToken)) {\n    throw new DeveloperError(\"options.accessToken is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._defaultAlpha = undefined;\n  this._defaultNightAlpha = undefined;\n  this._defaultDayAlpha = undefined;\n  this._defaultBrightness = undefined;\n  this._defaultContrast = undefined;\n  this._defaultHue = undefined;\n  this._defaultSaturation = undefined;\n  this._defaultGamma = undefined;\n  this._defaultMinificationFilter = undefined;\n  this._defaultMagnificationFilter = undefined;\n\n  const resource = Resource.createIfNeeded(\n    defaultValue(options.url, \"https://{s}.tiles.mapbox.com/v4/\")\n  );\n\n  this._mapId = mapId;\n  this._accessToken = accessToken;\n\n  let format = defaultValue(options.format, \"png\");\n  if (!/\\./.test(format)) {\n    format = `.${format}`;\n  }\n  this._format = format;\n\n  let templateUrl = resource.getUrlComponent();\n  if (!trailingSlashRegex.test(templateUrl)) {\n    templateUrl += \"/\";\n  }\n  templateUrl += `${mapId}/{z}/{x}/{y}${this._format}`;\n  resource.url = templateUrl;\n\n  resource.setQueryParameters({\n    access_token: accessToken,\n  });\n\n  let credit;\n  if (defined(options.credit)) {\n    credit = options.credit;\n    if (typeof credit === \"string\") {\n      credit = new Credit(credit);\n    }\n  } else {\n    credit = defaultCredit;\n  }\n\n  this._resource = resource;\n  this._imageryProvider = new UrlTemplateImageryProvider({\n    url: resource,\n    credit: credit,\n    ellipsoid: options.ellipsoid,\n    minimumLevel: options.minimumLevel,\n    maximumLevel: options.maximumLevel,\n    rectangle: options.rectangle,\n  });\n}\n\nObject.defineProperties(MapboxImageryProvider.prototype, {\n  /**\n   * Gets the URL of the Mapbox server.\n   * @memberof MapboxImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return this._imageryProvider.url;\n    },\n  },\n\n  /**\n   * Gets the rectangle, in radians, of the imagery provided by the instance.\n   * @memberof MapboxImageryProvider.prototype\n   * @type {Rectangle}\n   * @readonly\n   */\n  rectangle: {\n    get: function () {\n      return this._imageryProvider.rectangle;\n    },\n  },\n\n  /**\n   * Gets the width of each tile, in pixels.\n   * @memberof MapboxImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileWidth: {\n    get: function () {\n      return this._imageryProvider.tileWidth;\n    },\n  },\n\n  /**\n   * Gets the height of each tile, in pixels.\n   * @memberof MapboxImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileHeight: {\n    get: function () {\n      return this._imageryProvider.tileHeight;\n    },\n  },\n\n  /**\n   * Gets the maximum level-of-detail that can be requested.\n   * @memberof MapboxImageryProvider.prototype\n   * @type {number|undefined}\n   * @readonly\n   */\n  maximumLevel: {\n    get: function () {\n      return this._imageryProvider.maximumLevel;\n    },\n  },\n\n  /**\n   * Gets the minimum level-of-detail that can be requested. Generally,\n   * a minimum level should only be used when the rectangle of the imagery is small\n   * enough that the number of tiles at the minimum level is small.  An imagery\n   * provider with more than a few tiles at the minimum level will lead to\n   * rendering problems.\n   * @memberof MapboxImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  minimumLevel: {\n    get: function () {\n      return this._imageryProvider.minimumLevel;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by the provider.\n   * @memberof MapboxImageryProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._imageryProvider.tilingScheme;\n    },\n  },\n\n  /**\n   * Gets the tile discard policy.  If not undefined, the discard policy is responsible\n   * for filtering out \"missing\" tiles via its shouldDiscardImage function.  If this function\n   * returns undefined, no tiles are filtered.\n   * @memberof MapboxImageryProvider.prototype\n   * @type {TileDiscardPolicy}\n   * @readonly\n   */\n  tileDiscardPolicy: {\n    get: function () {\n      return this._imageryProvider.tileDiscardPolicy;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error..  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof MapboxImageryProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._imageryProvider.errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this imagery provider is active.  Typically this is used to credit\n   * the source of the imagery.\n   * @memberof MapboxImageryProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._imageryProvider.credit;\n    },\n  },\n\n  /**\n   * Gets the proxy used by this provider.\n   * @memberof MapboxImageryProvider.prototype\n   * @type {Proxy}\n   * @readonly\n   */\n  proxy: {\n    get: function () {\n      return this._imageryProvider.proxy;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the images provided by this imagery provider\n   * include an alpha channel.  If this property is false, an alpha channel, if present, will\n   * be ignored.  If this property is true, any images without an alpha channel will be treated\n   * as if their alpha is 1.0 everywhere.  When this property is false, memory usage\n   * and texture upload time are reduced.\n   * @memberof MapboxImageryProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasAlphaChannel: {\n    get: function () {\n      return this._imageryProvider.hasAlphaChannel;\n    },\n  },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n */\nMapboxImageryProvider.prototype.getTileCredits = function (x, y, level) {\n  return undefined;\n};\n\n/**\n * Requests the image for a given tile.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n *          undefined if there are too many active requests to the server, and the request should be retried later.\n */\nMapboxImageryProvider.prototype.requestImage = function (x, y, level, request) {\n  return this._imageryProvider.requestImage(x, y, level, request);\n};\n\n/**\n * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n * a tile. This function is optional, so it may not exist on all ImageryProviders.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {number} longitude The longitude at which to pick features.\n * @param {number} latitude  The latitude at which to pick features.\n * @return {Promise<ImageryLayerFeatureInfo[]>|undefined} A promise for the picked features that will resolve when the asynchronous\n *                   picking completes.  The resolved value is an array of {@link ImageryLayerFeatureInfo}\n *                   instances.  The array may be empty if no features are found at the given location.\n *                   It may also be undefined if picking is not supported.\n */\nMapboxImageryProvider.prototype.pickFeatures = function (\n  x,\n  y,\n  level,\n  longitude,\n  latitude\n) {\n  return this._imageryProvider.pickFeatures(x, y, level, longitude, latitude);\n};\n\n// Exposed for tests\nMapboxImageryProvider._defaultCredit = defaultCredit;\nexport default MapboxImageryProvider;\n", "import Check from \"../Core/Check.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TileProviderError from \"../Core/TileProviderError.js\";\nimport ImageryProvider from \"./ImageryProvider.js\";\n\n/**\n * @typedef {object} SingleTileImageryProvider.ConstructorOptions\n *\n * Initialization options for the SingleTileImageryProvider constructor\n *\n * @property {Resource|string} url The url for the tile.\n * @property {number} [tileWidth] The width of the tile, in pixels.\n * @property {number} [tileHeight] The height of the tile, in pixels.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.\n * @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If not specified, the WGS84 ellipsoid is used.\n */\n\n/**\n * Provides a single, top-level imagery tile.  The single image is assumed to be in\n * the Geographic projection (i.e. WGS84 / EPSG:4326),\n * and will be rendered using a {@link GeographicTilingScheme}.\n *\n * @alias SingleTileImageryProvider\n * @constructor\n *\n * @param {SingleTileImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see OpenStreetMapImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n * @see UrlTemplateImageryProvider\n */\nfunction SingleTileImageryProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._defaultAlpha = undefined;\n  this._defaultNightAlpha = undefined;\n  this._defaultDayAlpha = undefined;\n  this._defaultBrightness = undefined;\n  this._defaultContrast = undefined;\n  this._defaultHue = undefined;\n  this._defaultSaturation = undefined;\n  this._defaultGamma = undefined;\n  this._defaultMinificationFilter = undefined;\n  this._defaultMagnificationFilter = undefined;\n\n  const rectangle = defaultValue(options.rectangle, Rectangle.MAX_VALUE);\n  const tilingScheme = new GeographicTilingScheme({\n    rectangle: rectangle,\n    numberOfLevelZeroTilesX: 1,\n    numberOfLevelZeroTilesY: 1,\n    ellipsoid: options.ellipsoid,\n  });\n  this._tilingScheme = tilingScheme;\n  this._image = undefined;\n  this._texture = undefined;\n\n  this._hasError = false;\n  this._errorEvent = new Event();\n\n  let credit = options.credit;\n  if (typeof credit === \"string\") {\n    credit = new Credit(credit);\n  }\n  this._credit = credit;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.url\", options.url);\n  //>>includeEnd('debug');\n\n  const resource = Resource.createIfNeeded(options.url);\n  this._resource = resource;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"options.tileWidth\", options.tileWidth);\n  Check.typeOf.number(\"options.tileHeight\", options.tileHeight);\n  //>>includeEnd('debug');\n\n  this._tileWidth = options.tileWidth;\n  this._tileHeight = options.tileHeight;\n}\n\nObject.defineProperties(SingleTileImageryProvider.prototype, {\n  /**\n   * Gets the URL of the single, top-level imagery tile.\n   * @memberof SingleTileImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return this._resource.url;\n    },\n  },\n\n  /**\n   * Gets the proxy used by this provider.\n   * @memberof SingleTileImageryProvider.prototype\n   * @type {Proxy}\n   * @readonly\n   */\n  proxy: {\n    get: function () {\n      return this._resource.proxy;\n    },\n  },\n\n  /**\n   * Gets the width of each tile, in pixels.\n   * @memberof SingleTileImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileWidth: {\n    get: function () {\n      return this._tileWidth;\n    },\n  },\n\n  /**\n   * Gets the height of each tile, in pixels.\n   * @memberof SingleTileImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileHeight: {\n    get: function () {\n      return this._tileHeight;\n    },\n  },\n\n  /**\n   * Gets the maximum level-of-detail that can be requested.\n   * @memberof SingleTileImageryProvider.prototype\n   * @type {number|undefined}\n   * @readonly\n   */\n  maximumLevel: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Gets the minimum level-of-detail that can be requested.\n   * @memberof SingleTileImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  minimumLevel: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof SingleTileImageryProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets the rectangle, in radians, of the imagery provided by this instance.\n   * @memberof SingleTileImageryProvider.prototype\n   * @type {Rectangle}\n   * @readonly\n   */\n  rectangle: {\n    get: function () {\n      return this._tilingScheme.rectangle;\n    },\n  },\n\n  /**\n   * Gets the tile discard policy.  If not undefined, the discard policy is responsible\n   * for filtering out \"missing\" tiles via its shouldDiscardImage function.  If this function\n   * returns undefined, no tiles are filtered.\n   * @memberof SingleTileImageryProvider.prototype\n   * @type {TileDiscardPolicy}\n   * @readonly\n   */\n  tileDiscardPolicy: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof SingleTileImageryProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this imagery provider is active.  Typically this is used to credit\n   * the source of the imagery.\n   * @memberof SingleTileImageryProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the images provided by this imagery provider\n   * include an alpha channel.  If this property is false, an alpha channel, if present, will\n   * be ignored.  If this property is true, any images without an alpha channel will be treated\n   * as if their alpha is 1.0 everywhere.  When this property is false, memory usage\n   * and texture upload time are reduced.\n   * @memberof SingleTileImageryProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasAlphaChannel: {\n    get: function () {\n      return true;\n    },\n  },\n});\n\nfunction failure(resource, error, provider, previousError) {\n  let message = `Failed to load image ${resource.url}`;\n  if (defined(error) && defined(error.message)) {\n    message += `: ${error.message}`;\n  }\n\n  const reportedError = TileProviderError.reportError(\n    previousError,\n    provider,\n    defined(provider) ? provider._errorEvent : undefined,\n    message,\n    0,\n    0,\n    0,\n    error\n  );\n  if (reportedError.retry) {\n    return doRequest(resource, provider, reportedError);\n  }\n\n  if (defined(provider)) {\n    provider._hasError = true;\n  }\n  throw new RuntimeError(message);\n}\n\nasync function doRequest(resource, provider, previousError) {\n  try {\n    const image = await ImageryProvider.loadImage(null, resource);\n    return image;\n  } catch (error) {\n    return failure(resource, error, provider, previousError);\n  }\n}\n\n/**\n * @typedef {Object} SingleTileImageryProvider.fromUrlOptions\n *\n * Initialization options for the SingleTileImageryProvider constructor when using SingleTileImageryProvider.fromUrl\n *\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.\n * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If not specified, the WGS84 ellipsoid is used.\n */\n\n/**\n * Creates a provider for a single, top-level imagery tile.  The single image is assumed to use a\n * @param {Resource|String} url The url for the tile\n * @param {SingleTileImageryProvider.fromUrlOptions} [options] Object describing initialization options.\n * @returns {Promise.<SingleTileImageryProvider>} The resolved SingleTileImageryProvider.\n *\n * @example\n * const provider = await SingleTileImageryProvider.fromUrl(\"https://yoururl.com/image.png\");\n */\nSingleTileImageryProvider.fromUrl = async function (url, options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"url\", url);\n  //>>includeEnd('debug');\n\n  const resource = Resource.createIfNeeded(url);\n  const image = await doRequest(resource);\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const provider = new SingleTileImageryProvider({\n    ...options,\n    url: url,\n    tileWidth: image.width,\n    tileHeight: image.height,\n  });\n  provider._image = image;\n  return provider;\n};\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n */\nSingleTileImageryProvider.prototype.getTileCredits = function (x, y, level) {\n  return undefined;\n};\n\n/**\n * Requests the image for a given tile.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<ImageryTypes>|undefined} The resolved image\n */\nSingleTileImageryProvider.prototype.requestImage = async function (\n  x,\n  y,\n  level,\n  request\n) {\n  if (!this._hasError && !defined(this._image)) {\n    const image = await doRequest(this._resource, this);\n    this._image = image;\n    TileProviderError.reportSuccess(this._errorEvent);\n    return image;\n  }\n\n  return this._image;\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {number} longitude The longitude at which to pick features.\n * @param {number} latitude  The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nSingleTileImageryProvider.prototype.pickFeatures = function (\n  x,\n  y,\n  level,\n  longitude,\n  latitude\n) {\n  return undefined;\n};\nexport default SingleTileImageryProvider;\n", "import Cartographic from \"../Core/Cartographic.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport ImageryLayerFeatureInfo from \"./ImageryLayerFeatureInfo.js\";\n\n/**\n * Describes the format in which to request GetFeatureInfo from a Web Map Service (WMS) server.\n *\n * @alias GetFeatureInfoFormat\n * @constructor\n *\n * @param {string} type The type of response to expect from a GetFeatureInfo request.  Valid\n *        values are 'json', 'xml', 'html', or 'text'.\n * @param {string} [format] The info format to request from the WMS server.  This is usually a\n *        MIME type such as 'application/json' or text/xml'.  If this parameter is not specified, the provider will request 'json'\n *        using 'application/json', 'xml' using 'text/xml', 'html' using 'text/html', and 'text' using 'text/plain'.\n * @param {Function} [callback] A function to invoke with the GetFeatureInfo response from the WMS server\n *        in order to produce an array of picked {@link ImageryLayerFeatureInfo} instances.  If this parameter is not specified,\n *        a default function for the type of response is used.\n */\nfunction GetFeatureInfoFormat(type, format, callback) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(type)) {\n    throw new DeveloperError(\"type is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.type = type;\n\n  if (!defined(format)) {\n    if (type === \"json\") {\n      format = \"application/json\";\n    } else if (type === \"xml\") {\n      format = \"text/xml\";\n    } else if (type === \"html\") {\n      format = \"text/html\";\n    } else if (type === \"text\") {\n      format = \"text/plain\";\n    }\n    //>>includeStart('debug', pragmas.debug);\n    else {\n      throw new DeveloperError(\n        'format is required when type is not \"json\", \"xml\", \"html\", or \"text\".'\n      );\n    }\n    //>>includeEnd('debug');\n  }\n\n  this.format = format;\n\n  if (!defined(callback)) {\n    if (type === \"json\") {\n      callback = geoJsonToFeatureInfo;\n    } else if (type === \"xml\") {\n      callback = xmlToFeatureInfo;\n    } else if (type === \"html\") {\n      callback = textToFeatureInfo;\n    } else if (type === \"text\") {\n      callback = textToFeatureInfo;\n    }\n    //>>includeStart('debug', pragmas.debug);\n    else {\n      throw new DeveloperError(\n        'callback is required when type is not \"json\", \"xml\", \"html\", or \"text\".'\n      );\n    }\n    //>>includeEnd('debug');\n  }\n\n  this.callback = callback;\n}\n\nfunction geoJsonToFeatureInfo(json) {\n  const result = [];\n\n  const features = json.features;\n  for (let i = 0; i < features.length; ++i) {\n    const feature = features[i];\n\n    const featureInfo = new ImageryLayerFeatureInfo();\n    featureInfo.data = feature;\n    featureInfo.properties = feature.properties;\n    featureInfo.configureNameFromProperties(feature.properties);\n    featureInfo.configureDescriptionFromProperties(feature.properties);\n\n    // If this is a point feature, use the coordinates of the point.\n    if (defined(feature.geometry) && feature.geometry.type === \"Point\") {\n      const longitude = feature.geometry.coordinates[0];\n      const latitude = feature.geometry.coordinates[1];\n      featureInfo.position = Cartographic.fromDegrees(longitude, latitude);\n    }\n\n    result.push(featureInfo);\n  }\n\n  return result;\n}\n\nconst mapInfoMxpNamespace = \"http://www.mapinfo.com/mxp\";\nconst esriWmsNamespace = \"http://www.esri.com/wms\";\nconst wfsNamespace = \"http://www.opengis.net/wfs\";\nconst gmlNamespace = \"http://www.opengis.net/gml\";\n\nfunction xmlToFeatureInfo(xml) {\n  const documentElement = xml.documentElement;\n  if (\n    documentElement.localName === \"MultiFeatureCollection\" &&\n    documentElement.namespaceURI === mapInfoMxpNamespace\n  ) {\n    // This looks like a MapInfo MXP response\n    return mapInfoXmlToFeatureInfo(xml);\n  } else if (\n    documentElement.localName === \"FeatureInfoResponse\" &&\n    documentElement.namespaceURI === esriWmsNamespace\n  ) {\n    // This looks like an Esri WMS response\n    return esriXmlToFeatureInfo(xml);\n  } else if (\n    documentElement.localName === \"FeatureCollection\" &&\n    documentElement.namespaceURI === wfsNamespace\n  ) {\n    // This looks like a WFS/GML response.\n    return gmlToFeatureInfo(xml);\n  } else if (documentElement.localName === \"ServiceExceptionReport\") {\n    // This looks like a WMS server error, so no features picked.\n    throw new RuntimeError(\n      new XMLSerializer().serializeToString(documentElement)\n    );\n  } else if (documentElement.localName === \"msGMLOutput\") {\n    return msGmlToFeatureInfo(xml);\n  } else {\n    // Unknown response type, so just dump the XML itself into the description.\n    return unknownXmlToFeatureInfo(xml);\n  }\n}\n\nfunction mapInfoXmlToFeatureInfo(xml) {\n  const result = [];\n\n  const multiFeatureCollection = xml.documentElement;\n\n  const features = multiFeatureCollection.getElementsByTagNameNS(\n    mapInfoMxpNamespace,\n    \"Feature\"\n  );\n  for (let featureIndex = 0; featureIndex < features.length; ++featureIndex) {\n    const feature = features[featureIndex];\n\n    const properties = {};\n\n    const propertyElements = feature.getElementsByTagNameNS(\n      mapInfoMxpNamespace,\n      \"Val\"\n    );\n    for (\n      let propertyIndex = 0;\n      propertyIndex < propertyElements.length;\n      ++propertyIndex\n    ) {\n      const propertyElement = propertyElements[propertyIndex];\n      if (propertyElement.hasAttribute(\"ref\")) {\n        const name = propertyElement.getAttribute(\"ref\");\n        const value = propertyElement.textContent.trim();\n        properties[name] = value;\n      }\n    }\n\n    const featureInfo = new ImageryLayerFeatureInfo();\n    featureInfo.data = feature;\n    featureInfo.properties = properties;\n    featureInfo.configureNameFromProperties(properties);\n    featureInfo.configureDescriptionFromProperties(properties);\n    result.push(featureInfo);\n  }\n\n  return result;\n}\n\nfunction esriXmlToFeatureInfo(xml) {\n  const featureInfoResponse = xml.documentElement;\n  const result = [];\n  let properties;\n\n  const features = featureInfoResponse.getElementsByTagNameNS(\"*\", \"FIELDS\");\n  if (features.length > 0) {\n    // Standard esri format\n    for (let featureIndex = 0; featureIndex < features.length; ++featureIndex) {\n      const feature = features[featureIndex];\n\n      properties = {};\n\n      const propertyAttributes = feature.attributes;\n      for (\n        let attributeIndex = 0;\n        attributeIndex < propertyAttributes.length;\n        ++attributeIndex\n      ) {\n        const attribute = propertyAttributes[attributeIndex];\n        properties[attribute.name] = attribute.value;\n      }\n\n      result.push(\n        imageryLayerFeatureInfoFromDataAndProperties(feature, properties)\n      );\n    }\n  } else {\n    // Thredds format -- looks like esri, but instead of containing FIELDS, contains FeatureInfo element\n    const featureInfoElements = featureInfoResponse.getElementsByTagNameNS(\n      \"*\",\n      \"FeatureInfo\"\n    );\n    for (\n      let featureInfoElementIndex = 0;\n      featureInfoElementIndex < featureInfoElements.length;\n      ++featureInfoElementIndex\n    ) {\n      const featureInfoElement = featureInfoElements[featureInfoElementIndex];\n\n      properties = {};\n\n      // node.children is not supported in IE9-11, so use childNodes and check that child.nodeType is an element\n      const featureInfoChildren = featureInfoElement.childNodes;\n      for (\n        let childIndex = 0;\n        childIndex < featureInfoChildren.length;\n        ++childIndex\n      ) {\n        const child = featureInfoChildren[childIndex];\n        if (child.nodeType === Node.ELEMENT_NODE) {\n          properties[child.localName] = child.textContent;\n        }\n      }\n\n      result.push(\n        imageryLayerFeatureInfoFromDataAndProperties(\n          featureInfoElement,\n          properties\n        )\n      );\n    }\n  }\n\n  return result;\n}\n\nfunction gmlToFeatureInfo(xml) {\n  const result = [];\n\n  const featureCollection = xml.documentElement;\n\n  const featureMembers = featureCollection.getElementsByTagNameNS(\n    gmlNamespace,\n    \"featureMember\"\n  );\n  for (\n    let featureIndex = 0;\n    featureIndex < featureMembers.length;\n    ++featureIndex\n  ) {\n    const featureMember = featureMembers[featureIndex];\n\n    const properties = {};\n    getGmlPropertiesRecursively(featureMember, properties);\n    result.push(\n      imageryLayerFeatureInfoFromDataAndProperties(featureMember, properties)\n    );\n  }\n\n  return result;\n}\n\n// msGmlToFeatureInfo is similar to gmlToFeatureInfo, but assumes different XML structure\n// eg. <msGMLOutput> <ABC_layer> <ABC_feature> <foo>bar</foo> ... </ABC_feature> </ABC_layer> </msGMLOutput>\n\nfunction msGmlToFeatureInfo(xml) {\n  const result = [];\n\n  // Find the first child. Except for IE, this would work:\n  // const layer = xml.documentElement.children[0];\n  let layer;\n  const children = xml.documentElement.childNodes;\n  for (let i = 0; i < children.length; i++) {\n    if (children[i].nodeType === Node.ELEMENT_NODE) {\n      layer = children[i];\n      break;\n    }\n  }\n  if (!defined(layer)) {\n    throw new RuntimeError(\n      \"Unable to find first child of the feature info xml document\"\n    );\n  }\n  const featureMembers = layer.childNodes;\n  for (\n    let featureIndex = 0;\n    featureIndex < featureMembers.length;\n    ++featureIndex\n  ) {\n    const featureMember = featureMembers[featureIndex];\n    if (featureMember.nodeType === Node.ELEMENT_NODE) {\n      const properties = {};\n      getGmlPropertiesRecursively(featureMember, properties);\n      result.push(\n        imageryLayerFeatureInfoFromDataAndProperties(featureMember, properties)\n      );\n    }\n  }\n\n  return result;\n}\n\nfunction getGmlPropertiesRecursively(gmlNode, properties) {\n  let isSingleValue = true;\n\n  for (let i = 0; i < gmlNode.childNodes.length; ++i) {\n    const child = gmlNode.childNodes[i];\n\n    if (child.nodeType === Node.ELEMENT_NODE) {\n      isSingleValue = false;\n    }\n\n    if (\n      child.localName === \"Point\" ||\n      child.localName === \"LineString\" ||\n      child.localName === \"Polygon\" ||\n      child.localName === \"boundedBy\"\n    ) {\n      continue;\n    }\n\n    if (\n      child.hasChildNodes() &&\n      getGmlPropertiesRecursively(child, properties)\n    ) {\n      properties[child.localName] = child.textContent;\n    }\n  }\n\n  return isSingleValue;\n}\n\nfunction imageryLayerFeatureInfoFromDataAndProperties(data, properties) {\n  const featureInfo = new ImageryLayerFeatureInfo();\n  featureInfo.data = data;\n  featureInfo.properties = properties;\n  featureInfo.configureNameFromProperties(properties);\n  featureInfo.configureDescriptionFromProperties(properties);\n  return featureInfo;\n}\n\nfunction unknownXmlToFeatureInfo(xml) {\n  const xmlText = new XMLSerializer().serializeToString(xml);\n\n  const element = document.createElement(\"div\");\n  const pre = document.createElement(\"pre\");\n  pre.textContent = xmlText;\n  element.appendChild(pre);\n\n  const featureInfo = new ImageryLayerFeatureInfo();\n  featureInfo.data = xml;\n  featureInfo.description = element.innerHTML;\n  return [featureInfo];\n}\n\nconst emptyBodyRegex = /<body>\\s*<\\/body>/im;\nconst wmsServiceExceptionReportRegex = /<ServiceExceptionReport([\\s\\S]*)<\\/ServiceExceptionReport>/im;\nconst titleRegex = /<title>([\\s\\S]*)<\\/title>/im;\n\nfunction textToFeatureInfo(text) {\n  // If the text is HTML and it has an empty body tag, assume it means no features were found.\n  if (emptyBodyRegex.test(text)) {\n    return undefined;\n  }\n\n  // If this is a WMS exception report, treat it as \"no features found\" rather than showing\n  // bogus feature info.\n  if (wmsServiceExceptionReportRegex.test(text)) {\n    return undefined;\n  }\n\n  // If the text has a <title> element, use it as the name.\n  let name;\n  const title = titleRegex.exec(text);\n  if (title && title.length > 1) {\n    name = title[1];\n  }\n\n  const featureInfo = new ImageryLayerFeatureInfo();\n  featureInfo.name = name;\n  featureInfo.description = text;\n  featureInfo.data = text;\n  return [featureInfo];\n}\nexport default GetFeatureInfoFormat;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport Request from \"../Core/Request.js\";\nimport RequestType from \"../Core/RequestType.js\";\n\n/**\n * Provides functionality for ImageryProviders that have time dynamic imagery\n *\n * @alias TimeDynamicImagery\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Clock} options.clock A Clock instance that is used when determining the value for the time dimension. Required when <code>options.times</code> is specified.\n * @param {TimeIntervalCollection} options.times TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.\n * @param {Function} options.requestImageFunction A function that will request imagery tiles.\n * @param {Function} options.reloadFunction A function that will be called when all imagery tiles need to be reloaded.\n */\nfunction TimeDynamicImagery(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.clock\", options.clock);\n  Check.typeOf.object(\"options.times\", options.times);\n  Check.typeOf.func(\n    \"options.requestImageFunction\",\n    options.requestImageFunction\n  );\n  Check.typeOf.func(\"options.reloadFunction\", options.reloadFunction);\n  //>>includeEnd('debug');\n\n  this._tileCache = {};\n  this._tilesRequestedForInterval = [];\n\n  const clock = (this._clock = options.clock);\n  this._times = options.times;\n  this._requestImageFunction = options.requestImageFunction;\n  this._reloadFunction = options.reloadFunction;\n  this._currentIntervalIndex = -1;\n\n  clock.onTick.addEventListener(this._clockOnTick, this);\n  this._clockOnTick(clock);\n}\n\nObject.defineProperties(TimeDynamicImagery.prototype, {\n  /**\n   * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.\n   * @memberof TimeDynamicImagery.prototype\n   * @type {Clock}\n   */\n  clock: {\n    get: function () {\n      return this._clock;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (this._clock !== value) {\n        this._clock = value;\n        this._clockOnTick(value);\n        this._reloadFunction();\n      }\n    },\n  },\n  /**\n   * Gets or sets a time interval collection.\n   * @memberof TimeDynamicImagery.prototype\n   * @type {TimeIntervalCollection}\n   */\n  times: {\n    get: function () {\n      return this._times;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      if (this._times !== value) {\n        this._times = value;\n        this._clockOnTick(this._clock);\n        this._reloadFunction();\n      }\n    },\n  },\n  /**\n   * Gets the current interval.\n   * @memberof TimeDynamicImagery.prototype\n   * @type {TimeInterval}\n   */\n  currentInterval: {\n    get: function () {\n      return this._times.get(this._currentIntervalIndex);\n    },\n  },\n});\n\n/**\n * Gets the tile from the cache if its available.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n *\n * @returns {Promise<HTMLImageElement>|undefined} A promise for the image that will resolve when the image is available, or\n *          undefined if the tile is not in the cache.\n */\nTimeDynamicImagery.prototype.getFromCache = function (x, y, level, request) {\n  const key = getKey(x, y, level);\n  let result;\n  const cache = this._tileCache[this._currentIntervalIndex];\n  if (defined(cache) && defined(cache[key])) {\n    const item = cache[key];\n    result = item.promise.catch(function (e) {\n      // Set the correct state in case it was cancelled\n      request.state = item.request.state;\n      throw e;\n    });\n    delete cache[key];\n  }\n\n  return result;\n};\n\n/**\n * Checks if the next interval is approaching and will start preload the tile if necessary. Otherwise it will\n * just add the tile to a list to preload when we approach the next interval.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n */\nTimeDynamicImagery.prototype.checkApproachingInterval = function (\n  x,\n  y,\n  level,\n  request\n) {\n  const key = getKey(x, y, level);\n  const tilesRequestedForInterval = this._tilesRequestedForInterval;\n\n  // If we are approaching an interval, preload this tile in the next interval\n  const approachingInterval = getApproachingInterval(this);\n  const tile = {\n    key: key,\n    // Determines priority based on camera distance to the tile.\n    // Since the imagery regardless of time will be attached to the same tile we can just steal it.\n    priorityFunction: request.priorityFunction,\n  };\n  if (\n    !defined(approachingInterval) ||\n    !addToCache(this, tile, approachingInterval)\n  ) {\n    // Add to recent request list if we aren't approaching and interval or the request was throttled\n    tilesRequestedForInterval.push(tile);\n  }\n\n  // Don't let the tile list get out of hand\n  if (tilesRequestedForInterval.length >= 512) {\n    tilesRequestedForInterval.splice(0, 256);\n  }\n};\n\nTimeDynamicImagery.prototype._clockOnTick = function (clock) {\n  const time = clock.currentTime;\n  const times = this._times;\n  const index = times.indexOf(time);\n  const currentIntervalIndex = this._currentIntervalIndex;\n\n  if (index !== currentIntervalIndex) {\n    // Cancel all outstanding requests and clear out caches not from current time interval\n    const currentCache = this._tileCache[currentIntervalIndex];\n    for (const t in currentCache) {\n      if (currentCache.hasOwnProperty(t)) {\n        currentCache[t].request.cancel();\n      }\n    }\n    delete this._tileCache[currentIntervalIndex];\n    this._tilesRequestedForInterval = [];\n\n    this._currentIntervalIndex = index;\n    this._reloadFunction();\n\n    return;\n  }\n\n  const approachingInterval = getApproachingInterval(this);\n  if (defined(approachingInterval)) {\n    // Start loading recent tiles from end of this._tilesRequestedForInterval\n    //  We keep preloading until we hit a throttling limit.\n    const tilesRequested = this._tilesRequestedForInterval;\n    let success = true;\n    while (success) {\n      if (tilesRequested.length === 0) {\n        break;\n      }\n\n      const tile = tilesRequested.pop();\n      success = addToCache(this, tile, approachingInterval);\n      if (!success) {\n        tilesRequested.push(tile);\n      }\n    }\n  }\n};\n\nfunction getKey(x, y, level) {\n  return `${x}-${y}-${level}`;\n}\n\nfunction getKeyElements(key) {\n  const s = key.split(\"-\");\n  if (s.length !== 3) {\n    return undefined;\n  }\n\n  return {\n    x: Number(s[0]),\n    y: Number(s[1]),\n    level: Number(s[2]),\n  };\n}\n\nfunction getApproachingInterval(that) {\n  const times = that._times;\n  if (!defined(times)) {\n    return undefined;\n  }\n  const clock = that._clock;\n  const time = clock.currentTime;\n  const isAnimating = clock.canAnimate && clock.shouldAnimate;\n  const multiplier = clock.multiplier;\n\n  if (!isAnimating && multiplier !== 0) {\n    return undefined;\n  }\n\n  let seconds;\n  let index = times.indexOf(time);\n  if (index < 0) {\n    return undefined;\n  }\n\n  const interval = times.get(index);\n  if (multiplier > 0) {\n    // animating forward\n    seconds = JulianDate.secondsDifference(interval.stop, time);\n    ++index;\n  } else {\n    //backwards\n    seconds = JulianDate.secondsDifference(interval.start, time); // Will be negative\n    --index;\n  }\n  seconds /= multiplier; // Will always be positive\n\n  // Less than 5 wall time seconds\n  return index >= 0 && seconds <= 5.0 ? times.get(index) : undefined;\n}\n\nfunction addToCache(that, tile, interval) {\n  const index = that._times.indexOf(interval.start);\n  const tileCache = that._tileCache;\n  let intervalTileCache = tileCache[index];\n  if (!defined(intervalTileCache)) {\n    intervalTileCache = tileCache[index] = {};\n  }\n\n  const key = tile.key;\n  if (defined(intervalTileCache[key])) {\n    return true; // Already in the cache\n  }\n\n  const keyElements = getKeyElements(key);\n  const request = new Request({\n    throttle: false,\n    throttleByServer: true,\n    type: RequestType.IMAGERY,\n    priorityFunction: tile.priorityFunction,\n  });\n  const promise = that._requestImageFunction(\n    keyElements.x,\n    keyElements.y,\n    keyElements.level,\n    request,\n    interval\n  );\n  if (!defined(promise)) {\n    return false;\n  }\n\n  intervalTileCache[key] = {\n    promise: promise,\n    request: request,\n  };\n\n  return true;\n}\nexport default TimeDynamicImagery;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\nimport Resource from \"../Core/Resource.js\";\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\nimport GetFeatureInfoFormat from \"./GetFeatureInfoFormat.js\";\nimport TimeDynamicImagery from \"./TimeDynamicImagery.js\";\nimport UrlTemplateImageryProvider from \"./UrlTemplateImageryProvider.js\";\n\n/**\n * EPSG codes known to include reverse axis orders, but are not within 4000-5000.\n *\n * @type {number[]}\n */\nconst includesReverseAxis = [\n  3034, // ETRS89-extended / LCC Europe\n  3035, // ETRS89-extended / LAEA Europe\n  3042, // ETRS89 / UTM zone 30N (N-E)\n  3043, // ETRS89 / UTM zone 31N (N-E)\n  3044, // ETRS89 / UTM zone 32N (N-E)\n];\n\n/**\n * EPSG codes known to not include reverse axis orders, and are within 4000-5000.\n *\n * @type {number[]}\n */\nconst excludesReverseAxis = [\n  4471, // Mayotte\n  4559, // French Antilles\n];\n\n/**\n * @typedef {object} WebMapServiceImageryProvider.ConstructorOptions\n *\n * Initialization options for the WebMapServiceImageryProvider constructor\n *\n * @property {Resource|string} url The URL of the WMS service. The URL supports the same keywords as the {@link UrlTemplateImageryProvider}.\n * @property {string} layers The layers to include, separated by commas.\n * @property {object} [parameters=WebMapServiceImageryProvider.DefaultParameters] Additional parameters to pass to the WMS server in the GetMap URL.\n * @property {object} [getFeatureInfoParameters=WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters] Additional parameters to pass to the WMS server in the GetFeatureInfo URL.\n * @property {boolean} [enablePickFeatures=true] If true, {@link WebMapServiceImageryProvider#pickFeatures} will invoke\n *        the GetFeatureInfo operation on the WMS server and return the features included in the response.  If false,\n *        {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)\n *        without communicating with the server.  Set this property to false if you know your WMS server does not support\n *        GetFeatureInfo or if you don't want this provider's features to be pickable. Note that this can be dynamically\n *        overridden by modifying the WebMapServiceImageryProvider#enablePickFeatures property.\n * @property {GetFeatureInfoFormat[]} [getFeatureInfoFormats=WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats] The formats\n *        in which to try WMS GetFeatureInfo requests.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle of the layer.\n * @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme to use to divide the world into tiles.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If the tilingScheme is specified,\n *        this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n *        parameter is specified, the WGS84 ellipsoid is used.\n * @property {number} [tileWidth=256] The width of each tile in pixels.\n * @property {number} [tileHeight=256] The height of each tile in pixels.\n * @property {number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider.  Take care when\n *        specifying this that the number of tiles at the minimum level is small, such as four or less.  A larger number is\n *        likely to result in rendering problems.\n * @property {number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.\n *        If not specified, there is no limit.\n * @property {string} [crs] CRS specification, for use with WMS specification >= 1.3.0.\n * @property {string} [srs] SRS specification, for use with WMS specification 1.1.0 or 1.1.1\n * @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.\n * @property {string|string[]} [subdomains='abc'] The subdomains to use for the <code>{s}</code> placeholder in the URL template.\n *                          If this parameter is a single string, each character in the string is a subdomain.  If it is\n *                          an array, each element in the array is a subdomain.\n * @property {Clock} [clock] A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified.\n * @property {TimeIntervalCollection} [times] TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values.\n * @property {Resource|string} [getFeatureInfoUrl] The getFeatureInfo URL of the WMS service. If the property is not defined then we use the property value of url.\n */\n\n/**\n * Provides tiled imagery hosted by a Web Map Service (WMS) server.\n *\n * @alias WebMapServiceImageryProvider\n * @constructor\n *\n * @param {WebMapServiceImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see OpenStreetMapImageryProvider\n * @see SingleTileImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n * @see UrlTemplateImageryProvider\n *\n * @see {@link http://resources.esri.com/help/9.3/arcgisserver/apis/rest/|ArcGIS Server REST API}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n *\n * @example\n * const provider = new Cesium.WebMapServiceImageryProvider({\n *     url : 'https://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer',\n *     layers : '0',\n *     proxy: new Cesium.DefaultProxy('/proxy/')\n * });\n * const imageryLayer = new Cesium.ImageryLayer(provider);\n * viewer.imageryLayers.add(imageryLayer);\n */\nfunction WebMapServiceImageryProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options.url)) {\n    throw new DeveloperError(\"options.url is required.\");\n  }\n  if (!defined(options.layers)) {\n    throw new DeveloperError(\"options.layers is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (defined(options.times) && !defined(options.clock)) {\n    throw new DeveloperError(\n      \"options.times was specified, so options.clock is required.\"\n    );\n  }\n\n  this._defaultAlpha = undefined;\n  this._defaultNightAlpha = undefined;\n  this._defaultDayAlpha = undefined;\n  this._defaultBrightness = undefined;\n  this._defaultContrast = undefined;\n  this._defaultHue = undefined;\n  this._defaultSaturation = undefined;\n  this._defaultGamma = undefined;\n  this._defaultMinificationFilter = undefined;\n  this._defaultMagnificationFilter = undefined;\n\n  this._getFeatureInfoUrl = defaultValue(\n    options.getFeatureInfoUrl,\n    options.url\n  );\n\n  const resource = Resource.createIfNeeded(options.url);\n  const pickFeatureResource = Resource.createIfNeeded(this._getFeatureInfoUrl);\n\n  resource.setQueryParameters(\n    WebMapServiceImageryProvider.DefaultParameters,\n    true\n  );\n  pickFeatureResource.setQueryParameters(\n    WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters,\n    true\n  );\n\n  if (defined(options.parameters)) {\n    resource.setQueryParameters(objectToLowercase(options.parameters));\n  }\n\n  if (defined(options.getFeatureInfoParameters)) {\n    pickFeatureResource.setQueryParameters(\n      objectToLowercase(options.getFeatureInfoParameters)\n    );\n  }\n\n  const that = this;\n  this._reload = undefined;\n  if (defined(options.times)) {\n    this._timeDynamicImagery = new TimeDynamicImagery({\n      clock: options.clock,\n      times: options.times,\n      requestImageFunction: function (x, y, level, request, interval) {\n        return requestImage(that, x, y, level, request, interval);\n      },\n      reloadFunction: function () {\n        if (defined(that._reload)) {\n          that._reload();\n        }\n      },\n    });\n  }\n\n  const parameters = {};\n  parameters.layers = options.layers;\n  parameters.bbox =\n    \"{westProjected},{southProjected},{eastProjected},{northProjected}\";\n  parameters.width = \"{width}\";\n  parameters.height = \"{height}\";\n\n  // Use SRS or CRS based on the WMS version.\n  if (parseFloat(resource.queryParameters.version) >= 1.3) {\n    // Use CRS with 1.3.0 and going forward.\n    // For GeographicTilingScheme, use CRS:84 vice EPSG:4326 to specify lon, lat (x, y) ordering for\n    // bbox requests.\n    parameters.crs = defaultValue(\n      options.crs,\n      options.tilingScheme &&\n        options.tilingScheme.projection instanceof WebMercatorProjection\n        ? \"EPSG:3857\"\n        : \"CRS:84\"\n    );\n\n    // The axis order in previous versions of the WMS specifications was to always use easting (x or lon ) and northing (y or\n    // lat). WMS 1.3.0 specifies that, depending on the particular CRS, the x axis may or may not be oriented West-to-East,\n    // and the y axis may or may not be oriented South-to-North. The WMS portrayal operation shall account for axis order.\n    // This affects some of the EPSG codes that were commonly used such as ESPG:4326. The current implementation\n    // makes sure that coordinates passed to the server (as part of the GetMap BBOX parameter) as well as those advertised\n    // in the capabilities document reflect the inverse axe orders for EPSG codes between 4000 and 5000.\n    //  - Taken from Section 9.1.3 of https://download.osgeo.org/mapserver/docs/MapServer-56.pdf\n    const parts = parameters.crs.split(\":\");\n    if (parts[0] === \"EPSG\" && parts.length === 2) {\n      const code = Number(parts[1]);\n      if (\n        (code >= 4000 && code < 5000 && !excludesReverseAxis.includes(code)) ||\n        includesReverseAxis.includes(code)\n      ) {\n        parameters.bbox =\n          \"{southProjected},{westProjected},{northProjected},{eastProjected}\";\n      }\n    }\n  } else {\n    // SRS for WMS 1.1.0 or 1.1.1.\n    parameters.srs = defaultValue(\n      options.srs,\n      options.tilingScheme &&\n        options.tilingScheme.projection instanceof WebMercatorProjection\n        ? \"EPSG:3857\"\n        : \"EPSG:4326\"\n    );\n  }\n\n  resource.setQueryParameters(parameters, true);\n  pickFeatureResource.setQueryParameters(parameters, true);\n\n  const pickFeatureParams = {\n    query_layers: options.layers,\n    info_format: \"{format}\",\n  };\n  // use correct pixel coordinate identifier based on version\n  if (parseFloat(pickFeatureResource.queryParameters.version) >= 1.3) {\n    pickFeatureParams.i = \"{i}\";\n    pickFeatureParams.j = \"{j}\";\n  } else {\n    pickFeatureParams.x = \"{i}\";\n    pickFeatureParams.y = \"{j}\";\n  }\n  pickFeatureResource.setQueryParameters(pickFeatureParams, true);\n\n  this._resource = resource;\n  this._pickFeaturesResource = pickFeatureResource;\n  this._layers = options.layers;\n\n  // Let UrlTemplateImageryProvider do the actual URL building.\n  this._tileProvider = new UrlTemplateImageryProvider({\n    url: resource,\n    pickFeaturesUrl: pickFeatureResource,\n    tilingScheme: defaultValue(\n      options.tilingScheme,\n      new GeographicTilingScheme({ ellipsoid: options.ellipsoid })\n    ),\n    rectangle: options.rectangle,\n    tileWidth: options.tileWidth,\n    tileHeight: options.tileHeight,\n    minimumLevel: options.minimumLevel,\n    maximumLevel: options.maximumLevel,\n    subdomains: options.subdomains,\n    tileDiscardPolicy: options.tileDiscardPolicy,\n    credit: options.credit,\n    getFeatureInfoFormats: defaultValue(\n      options.getFeatureInfoFormats,\n      WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats\n    ),\n    enablePickFeatures: options.enablePickFeatures,\n  });\n}\n\nfunction requestImage(imageryProvider, col, row, level, request, interval) {\n  const dynamicIntervalData = defined(interval) ? interval.data : undefined;\n  const tileProvider = imageryProvider._tileProvider;\n\n  if (defined(dynamicIntervalData)) {\n    // We set the query parameters within the tile provider, because it is managing the query.\n    tileProvider._resource.setQueryParameters(dynamicIntervalData);\n  }\n  return tileProvider.requestImage(col, row, level, request);\n}\n\nfunction pickFeatures(\n  imageryProvider,\n  x,\n  y,\n  level,\n  longitude,\n  latitude,\n  interval\n) {\n  const dynamicIntervalData = defined(interval) ? interval.data : undefined;\n  const tileProvider = imageryProvider._tileProvider;\n\n  if (defined(dynamicIntervalData)) {\n    // We set the query parameters within the tile provider, because it is managing the query.\n    tileProvider._pickFeaturesResource.setQueryParameters(dynamicIntervalData);\n  }\n  return tileProvider.pickFeatures(x, y, level, longitude, latitude);\n}\n\nObject.defineProperties(WebMapServiceImageryProvider.prototype, {\n  /**\n   * Gets the URL of the WMS server.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return this._resource._url;\n    },\n  },\n\n  /**\n   * Gets the proxy used by this provider.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {Proxy}\n   * @readonly\n   */\n  proxy: {\n    get: function () {\n      return this._resource.proxy;\n    },\n  },\n\n  /**\n   * Gets the names of the WMS layers, separated by commas.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  layers: {\n    get: function () {\n      return this._layers;\n    },\n  },\n\n  /**\n   * Gets the width of each tile, in pixels.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileWidth: {\n    get: function () {\n      return this._tileProvider.tileWidth;\n    },\n  },\n\n  /**\n   * Gets the height of each tile, in pixels.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileHeight: {\n    get: function () {\n      return this._tileProvider.tileHeight;\n    },\n  },\n\n  /**\n   * Gets the maximum level-of-detail that can be requested.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {number|undefined}\n   * @readonly\n   */\n  maximumLevel: {\n    get: function () {\n      return this._tileProvider.maximumLevel;\n    },\n  },\n\n  /**\n   * Gets the minimum level-of-detail that can be requested.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  minimumLevel: {\n    get: function () {\n      return this._tileProvider.minimumLevel;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tileProvider.tilingScheme;\n    },\n  },\n\n  /**\n   * Gets the rectangle, in radians, of the imagery provided by this instance.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {Rectangle}\n   * @readonly\n   */\n  rectangle: {\n    get: function () {\n      return this._tileProvider.rectangle;\n    },\n  },\n\n  /**\n   * Gets the tile discard policy.  If not undefined, the discard policy is responsible\n   * for filtering out \"missing\" tiles via its shouldDiscardImage function.  If this function\n   * returns undefined, no tiles are filtered.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {TileDiscardPolicy}\n   * @readonly\n   */\n  tileDiscardPolicy: {\n    get: function () {\n      return this._tileProvider.tileDiscardPolicy;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._tileProvider.errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this imagery provider is active.  Typically this is used to credit\n   * the source of the imagery.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._tileProvider.credit;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the images provided by this imagery provider\n   * include an alpha channel.  If this property is false, an alpha channel, if present, will\n   * be ignored.  If this property is true, any images without an alpha channel will be treated\n   * as if their alpha is 1.0 everywhere.  When this property is false, memory usage\n   * and texture upload time are reduced.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasAlphaChannel: {\n    get: function () {\n      return this._tileProvider.hasAlphaChannel;\n    },\n  },\n\n  /**\n   * Gets or sets a value indicating whether feature picking is enabled.  If true, {@link WebMapServiceImageryProvider#pickFeatures} will\n   * invoke the <code>GetFeatureInfo</code> service on the WMS server and attempt to interpret the features included in the response.  If false,\n   * {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable\n   * features) without communicating with the server.  Set this property to false if you know your data\n   * source does not support picking features or if you don't want this provider's features to be pickable.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {boolean}\n   * @default true\n   */\n  enablePickFeatures: {\n    get: function () {\n      return this._tileProvider.enablePickFeatures;\n    },\n    set: function (enablePickFeatures) {\n      this._tileProvider.enablePickFeatures = enablePickFeatures;\n    },\n  },\n\n  /**\n   * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {Clock}\n   */\n  clock: {\n    get: function () {\n      return this._timeDynamicImagery.clock;\n    },\n    set: function (value) {\n      this._timeDynamicImagery.clock = value;\n    },\n  },\n  /**\n   * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each\n   * TimeInterval is an object containing the keys and values of the properties that are used during\n   * tile requests.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {TimeIntervalCollection}\n   */\n  times: {\n    get: function () {\n      return this._timeDynamicImagery.times;\n    },\n    set: function (value) {\n      this._timeDynamicImagery.times = value;\n    },\n  },\n\n  /**\n   * Gets the getFeatureInfo URL of the WMS server.\n   * @memberof WebMapServiceImageryProvider.prototype\n   * @type {Resource|string}\n   * @readonly\n   */\n  getFeatureInfoUrl: {\n    get: function () {\n      return this._getFeatureInfoUrl;\n    },\n  },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n */\nWebMapServiceImageryProvider.prototype.getTileCredits = function (x, y, level) {\n  return this._tileProvider.getTileCredits(x, y, level);\n};\n\n/**\n * Requests the image for a given tile.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n *          undefined if there are too many active requests to the server, and the request should be retried later.\n */\nWebMapServiceImageryProvider.prototype.requestImage = function (\n  x,\n  y,\n  level,\n  request\n) {\n  let result;\n  const timeDynamicImagery = this._timeDynamicImagery;\n  let currentInterval;\n\n  // Try and load from cache\n  if (defined(timeDynamicImagery)) {\n    currentInterval = timeDynamicImagery.currentInterval;\n    result = timeDynamicImagery.getFromCache(x, y, level, request);\n  }\n\n  // Couldn't load from cache\n  if (!defined(result)) {\n    result = requestImage(this, x, y, level, request, currentInterval);\n  }\n\n  // If we are approaching an interval, preload this tile in the next interval\n  if (defined(result) && defined(timeDynamicImagery)) {\n    timeDynamicImagery.checkApproachingInterval(x, y, level, request);\n  }\n\n  return result;\n};\n\n/**\n * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n * a tile.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {number} longitude The longitude at which to pick features.\n * @param {number} latitude  The latitude at which to pick features.\n * @return {Promise<ImageryLayerFeatureInfo[]>|undefined} A promise for the picked features that will resolve when the asynchronous\n *                   picking completes.  The resolved value is an array of {@link ImageryLayerFeatureInfo}\n *                   instances.  The array may be empty if no features are found at the given location.\n */\nWebMapServiceImageryProvider.prototype.pickFeatures = function (\n  x,\n  y,\n  level,\n  longitude,\n  latitude\n) {\n  const timeDynamicImagery = this._timeDynamicImagery;\n  const currentInterval = defined(timeDynamicImagery)\n    ? timeDynamicImagery.currentInterval\n    : undefined;\n\n  return pickFeatures(this, x, y, level, longitude, latitude, currentInterval);\n};\n\n/**\n * The default parameters to include in the WMS URL to obtain images.  The values are as follows:\n *    service=WMS\n *    version=1.1.1\n *    request=GetMap\n *    styles=\n *    format=image/jpeg\n *\n * @constant\n * @type {object}\n */\nWebMapServiceImageryProvider.DefaultParameters = Object.freeze({\n  service: \"WMS\",\n  version: \"1.1.1\",\n  request: \"GetMap\",\n  styles: \"\",\n  format: \"image/jpeg\",\n});\n\n/**\n * The default parameters to include in the WMS URL to get feature information.  The values are as follows:\n *     service=WMS\n *     version=1.1.1\n *     request=GetFeatureInfo\n *\n * @constant\n * @type {object}\n */\nWebMapServiceImageryProvider.GetFeatureInfoDefaultParameters = Object.freeze({\n  service: \"WMS\",\n  version: \"1.1.1\",\n  request: \"GetFeatureInfo\",\n});\n\nWebMapServiceImageryProvider.DefaultGetFeatureInfoFormats = Object.freeze([\n  Object.freeze(new GetFeatureInfoFormat(\"json\", \"application/json\")),\n  Object.freeze(new GetFeatureInfoFormat(\"xml\", \"text/xml\")),\n  Object.freeze(new GetFeatureInfoFormat(\"text\", \"text/html\")),\n]);\n\nfunction objectToLowercase(obj) {\n  const result = {};\n  for (const key in obj) {\n    if (obj.hasOwnProperty(key)) {\n      result[key.toLowerCase()] = obj[key];\n    }\n  }\n  return result;\n}\nexport default WebMapServiceImageryProvider;\n", "import combine from \"../Core/combine.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport WebMercatorTilingScheme from \"../Core/WebMercatorTilingScheme.js\";\nimport ImageryProvider from \"./ImageryProvider.js\";\nimport TimeDynamicImagery from \"./TimeDynamicImagery.js\";\n\nconst defaultParameters = Object.freeze({\n  service: \"WMTS\",\n  version: \"1.0.0\",\n  request: \"GetTile\",\n});\n\n/**\n * @typedef {object} WebMapTileServiceImageryProvider.ConstructorOptions\n *\n * Initialization options for the WebMapTileServiceImageryProvider constructor\n *\n * @property {Resource|string} url The base URL for the WMTS GetTile operation (for KVP-encoded requests) or the tile-URL template (for RESTful requests). The tile-URL template should contain the following variables: &#123;style&#125;, &#123;TileMatrixSet&#125;, &#123;TileMatrix&#125;, &#123;TileRow&#125;, &#123;TileCol&#125;. The first two are optional if actual values are hardcoded or not required by the server. The &#123;s&#125; keyword may be used to specify subdomains.\n * @property {string} [format='image/jpeg'] The MIME type for images to retrieve from the server.\n * @property {string} layer The layer name for WMTS requests.\n * @property {string} style The style name for WMTS requests.\n * @property {string} tileMatrixSetID The identifier of the TileMatrixSet to use for WMTS requests.\n * @property {Array} [tileMatrixLabels] A list of identifiers in the TileMatrix to use for WMTS requests, one per TileMatrix level.\n * @property {Clock} [clock] A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified.\n * @property {TimeIntervalCollection} [times] TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.\n * @property {object} [dimensions] A object containing static dimensions and their values.\n * @property {number} [tileWidth=256] The tile width in pixels.\n * @property {number} [tileHeight=256] The tile height in pixels.\n * @property {TilingScheme} [tilingScheme] The tiling scheme corresponding to the organization of the tiles in the TileMatrixSet.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle covered by the layer.\n * @property {number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider.\n * @property {number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If not specified, the WGS84 ellipsoid is used.\n * @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.\n * @property {string|string[]} [subdomains='abc'] The subdomains to use for the <code>{s}</code> placeholder in the URL template.\n *                          If this parameter is a single string, each character in the string is a subdomain.  If it is\n *                          an array, each element in the array is a subdomain.\n */\n\n/**\n * Provides tiled imagery served by {@link http://www.opengeospatial.org/standards/wmts|WMTS 1.0.0} compliant servers.\n * This provider supports HTTP KVP-encoded and RESTful GetTile requests, but does not yet support the SOAP encoding.\n *\n * @alias WebMapTileServiceImageryProvider\n * @constructor\n *\n * @param {WebMapTileServiceImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Web%20Map%20Tile%20Service%20with%20Time.html|Cesium Sandcastle Web Map Tile Service with Time Demo}\n *\n * @example\n * // Example 1. USGS shaded relief tiles (KVP)\n * const shadedRelief1 = new Cesium.WebMapTileServiceImageryProvider({\n *     url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS',\n *     layer : 'USGSShadedReliefOnly',\n *     style : 'default',\n *     format : 'image/jpeg',\n *     tileMatrixSetID : 'default028mm',\n *     // tileMatrixLabels : ['default028mm:0', 'default028mm:1', 'default028mm:2' ...],\n *     maximumLevel: 19,\n *     credit : new Cesium.Credit('U. S. Geological Survey')\n * });\n * viewer.imageryLayers.addImageryProvider(shadedRelief1);\n *\n * @example\n * // Example 2. USGS shaded relief tiles (RESTful)\n * const shadedRelief2 = new Cesium.WebMapTileServiceImageryProvider({\n *     url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg',\n *     layer : 'USGSShadedReliefOnly',\n *     style : 'default',\n *     format : 'image/jpeg',\n *     tileMatrixSetID : 'default028mm',\n *     maximumLevel: 19,\n *     credit : new Cesium.Credit('U. S. Geological Survey')\n * });\n * viewer.imageryLayers.addImageryProvider(shadedRelief2);\n *\n * @example\n * // Example 3. NASA time dynamic weather data (RESTful)\n * const times = Cesium.TimeIntervalCollection.fromIso8601({\n *     iso8601: '2015-07-30/2017-06-16/P1D',\n *     dataCallback: function dataCallback(interval, index) {\n *         return {\n *             Time: Cesium.JulianDate.toIso8601(interval.start)\n *         };\n *     }\n * });\n * const weather = new Cesium.WebMapTileServiceImageryProvider({\n *     url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png',\n *     layer : 'AMSR2_Snow_Water_Equivalent',\n *     style : 'default',\n *     tileMatrixSetID : '2km',\n *     maximumLevel : 5,\n *     format : 'image/png',\n *     clock: clock,\n *     times: times,\n *     credit : new Cesium.Credit('NASA Global Imagery Browse Services for EOSDIS')\n * });\n * viewer.imageryLayers.addImageryProvider(weather);\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see OpenStreetMapImageryProvider\n * @see SingleTileImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapServiceImageryProvider\n * @see UrlTemplateImageryProvider\n */\nfunction WebMapTileServiceImageryProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options.url)) {\n    throw new DeveloperError(\"options.url is required.\");\n  }\n  if (!defined(options.layer)) {\n    throw new DeveloperError(\"options.layer is required.\");\n  }\n  if (!defined(options.style)) {\n    throw new DeveloperError(\"options.style is required.\");\n  }\n  if (!defined(options.tileMatrixSetID)) {\n    throw new DeveloperError(\"options.tileMatrixSetID is required.\");\n  }\n  if (defined(options.times) && !defined(options.clock)) {\n    throw new DeveloperError(\n      \"options.times was specified, so options.clock is required.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._defaultAlpha = undefined;\n  this._defaultNightAlpha = undefined;\n  this._defaultDayAlpha = undefined;\n  this._defaultBrightness = undefined;\n  this._defaultContrast = undefined;\n  this._defaultHue = undefined;\n  this._defaultSaturation = undefined;\n  this._defaultGamma = undefined;\n  this._defaultMinificationFilter = undefined;\n  this._defaultMagnificationFilter = undefined;\n\n  const resource = Resource.createIfNeeded(options.url);\n\n  const style = options.style;\n  const tileMatrixSetID = options.tileMatrixSetID;\n  const url = resource.url;\n\n  const bracketMatch = url.match(/{/g);\n  if (\n    !defined(bracketMatch) ||\n    (bracketMatch.length === 1 && /{s}/.test(url))\n  ) {\n    resource.setQueryParameters(defaultParameters);\n    this._useKvp = true;\n  } else {\n    const templateValues = {\n      style: style,\n      Style: style,\n      TileMatrixSet: tileMatrixSetID,\n    };\n\n    resource.setTemplateValues(templateValues);\n    this._useKvp = false;\n  }\n\n  this._resource = resource;\n  this._layer = options.layer;\n  this._style = style;\n  this._tileMatrixSetID = tileMatrixSetID;\n  this._tileMatrixLabels = options.tileMatrixLabels;\n  this._format = defaultValue(options.format, \"image/jpeg\");\n  this._tileDiscardPolicy = options.tileDiscardPolicy;\n\n  this._tilingScheme = defined(options.tilingScheme)\n    ? options.tilingScheme\n    : new WebMercatorTilingScheme({ ellipsoid: options.ellipsoid });\n  this._tileWidth = defaultValue(options.tileWidth, 256);\n  this._tileHeight = defaultValue(options.tileHeight, 256);\n\n  this._minimumLevel = defaultValue(options.minimumLevel, 0);\n  this._maximumLevel = options.maximumLevel;\n\n  this._rectangle = defaultValue(\n    options.rectangle,\n    this._tilingScheme.rectangle\n  );\n  this._dimensions = options.dimensions;\n\n  const that = this;\n  this._reload = undefined;\n  if (defined(options.times)) {\n    this._timeDynamicImagery = new TimeDynamicImagery({\n      clock: options.clock,\n      times: options.times,\n      requestImageFunction: function (x, y, level, request, interval) {\n        return requestImage(that, x, y, level, request, interval);\n      },\n      reloadFunction: function () {\n        if (defined(that._reload)) {\n          that._reload();\n        }\n      },\n    });\n  }\n\n  // Check the number of tiles at the minimum level.  If it's more than four,\n  // throw an exception, because starting at the higher minimum\n  // level will cause too many tiles to be downloaded and rendered.\n  const swTile = this._tilingScheme.positionToTileXY(\n    Rectangle.southwest(this._rectangle),\n    this._minimumLevel\n  );\n  const neTile = this._tilingScheme.positionToTileXY(\n    Rectangle.northeast(this._rectangle),\n    this._minimumLevel\n  );\n  const tileCount =\n    (Math.abs(neTile.x - swTile.x) + 1) * (Math.abs(neTile.y - swTile.y) + 1);\n  //>>includeStart('debug', pragmas.debug);\n  if (tileCount > 4) {\n    throw new DeveloperError(\n      `The imagery provider's rectangle and minimumLevel indicate that there are ${tileCount} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._errorEvent = new Event();\n\n  const credit = options.credit;\n  this._credit = typeof credit === \"string\" ? new Credit(credit) : credit;\n\n  this._subdomains = options.subdomains;\n  if (Array.isArray(this._subdomains)) {\n    this._subdomains = this._subdomains.slice();\n  } else if (defined(this._subdomains) && this._subdomains.length > 0) {\n    this._subdomains = this._subdomains.split(\"\");\n  } else {\n    this._subdomains = [\"a\", \"b\", \"c\"];\n  }\n}\n\nfunction requestImage(imageryProvider, col, row, level, request, interval) {\n  const labels = imageryProvider._tileMatrixLabels;\n  const tileMatrix = defined(labels) ? labels[level] : level.toString();\n  const subdomains = imageryProvider._subdomains;\n  const staticDimensions = imageryProvider._dimensions;\n  const dynamicIntervalData = defined(interval) ? interval.data : undefined;\n\n  let resource;\n  let templateValues;\n  if (!imageryProvider._useKvp) {\n    templateValues = {\n      TileMatrix: tileMatrix,\n      TileRow: row.toString(),\n      TileCol: col.toString(),\n      s: subdomains[(col + row + level) % subdomains.length],\n    };\n\n    resource = imageryProvider._resource.getDerivedResource({\n      request: request,\n    });\n    resource.setTemplateValues(templateValues);\n\n    if (defined(staticDimensions)) {\n      resource.setTemplateValues(staticDimensions);\n    }\n\n    if (defined(dynamicIntervalData)) {\n      resource.setTemplateValues(dynamicIntervalData);\n    }\n  } else {\n    // build KVP request\n    let query = {};\n    query.tilematrix = tileMatrix;\n    query.layer = imageryProvider._layer;\n    query.style = imageryProvider._style;\n    query.tilerow = row;\n    query.tilecol = col;\n    query.tilematrixset = imageryProvider._tileMatrixSetID;\n    query.format = imageryProvider._format;\n\n    if (defined(staticDimensions)) {\n      query = combine(query, staticDimensions);\n    }\n\n    if (defined(dynamicIntervalData)) {\n      query = combine(query, dynamicIntervalData);\n    }\n\n    templateValues = {\n      s: subdomains[(col + row + level) % subdomains.length],\n    };\n\n    resource = imageryProvider._resource.getDerivedResource({\n      queryParameters: query,\n      request: request,\n    });\n    resource.setTemplateValues(templateValues);\n  }\n\n  return ImageryProvider.loadImage(imageryProvider, resource);\n}\n\nObject.defineProperties(WebMapTileServiceImageryProvider.prototype, {\n  /**\n   * Gets the URL of the service hosting the imagery.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return this._resource.url;\n    },\n  },\n\n  /**\n   * Gets the proxy used by this provider.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {Proxy}\n   * @readonly\n   */\n  proxy: {\n    get: function () {\n      return this._resource.proxy;\n    },\n  },\n\n  /**\n   * Gets the width of each tile, in pixels.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileWidth: {\n    get: function () {\n      return this._tileWidth;\n    },\n  },\n\n  /**\n   * Gets the height of each tile, in pixels.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileHeight: {\n    get: function () {\n      return this._tileHeight;\n    },\n  },\n\n  /**\n   * Gets the maximum level-of-detail that can be requested.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {number|undefined}\n   * @readonly\n   */\n  maximumLevel: {\n    get: function () {\n      return this._maximumLevel;\n    },\n  },\n\n  /**\n   * Gets the minimum level-of-detail that can be requested.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  minimumLevel: {\n    get: function () {\n      return this._minimumLevel;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets the rectangle, in radians, of the imagery provided by this instance.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {Rectangle}\n   * @readonly\n   */\n  rectangle: {\n    get: function () {\n      return this._rectangle;\n    },\n  },\n\n  /**\n   * Gets the tile discard policy.  If not undefined, the discard policy is responsible\n   * for filtering out \"missing\" tiles via its shouldDiscardImage function.  If this function\n   * returns undefined, no tiles are filtered.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {TileDiscardPolicy}\n   * @readonly\n   */\n  tileDiscardPolicy: {\n    get: function () {\n      return this._tileDiscardPolicy;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the mime type of images returned by this imagery provider.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  format: {\n    get: function () {\n      return this._format;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this imagery provider is active.  Typically this is used to credit\n   * the source of the imagery.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the images provided by this imagery provider\n   * include an alpha channel.  If this property is false, an alpha channel, if present, will\n   * be ignored.  If this property is true, any images without an alpha channel will be treated\n   * as if their alpha is 1.0 everywhere.  When this property is false, memory usage\n   * and texture upload time are reduced.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasAlphaChannel: {\n    get: function () {\n      return true;\n    },\n  },\n  /**\n   * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {Clock}\n   */\n  clock: {\n    get: function () {\n      return this._timeDynamicImagery.clock;\n    },\n    set: function (value) {\n      this._timeDynamicImagery.clock = value;\n    },\n  },\n  /**\n   * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each\n   * TimeInterval is an object containing the keys and values of the properties that are used during\n   * tile requests.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {TimeIntervalCollection}\n   */\n  times: {\n    get: function () {\n      return this._timeDynamicImagery.times;\n    },\n    set: function (value) {\n      this._timeDynamicImagery.times = value;\n    },\n  },\n  /**\n   * Gets or sets an object that contains static dimensions and their values.\n   * @memberof WebMapTileServiceImageryProvider.prototype\n   * @type {object}\n   */\n  dimensions: {\n    get: function () {\n      return this._dimensions;\n    },\n    set: function (value) {\n      if (this._dimensions !== value) {\n        this._dimensions = value;\n        if (defined(this._reload)) {\n          this._reload();\n        }\n      }\n    },\n  },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n */\nWebMapTileServiceImageryProvider.prototype.getTileCredits = function (\n  x,\n  y,\n  level\n) {\n  return undefined;\n};\n\n/**\n * Requests the image for a given tile.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n *          undefined if there are too many active requests to the server, and the request should be retried later.\n */\nWebMapTileServiceImageryProvider.prototype.requestImage = function (\n  x,\n  y,\n  level,\n  request\n) {\n  let result;\n  const timeDynamicImagery = this._timeDynamicImagery;\n  let currentInterval;\n\n  // Try and load from cache\n  if (defined(timeDynamicImagery)) {\n    currentInterval = timeDynamicImagery.currentInterval;\n    result = timeDynamicImagery.getFromCache(x, y, level, request);\n  }\n\n  // Couldn't load from cache\n  if (!defined(result)) {\n    result = requestImage(this, x, y, level, request, currentInterval);\n  }\n\n  // If we are approaching an interval, preload this tile in the next interval\n  if (defined(result) && defined(timeDynamicImagery)) {\n    timeDynamicImagery.checkApproachingInterval(x, y, level, request);\n  }\n\n  return result;\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {number} longitude The longitude at which to pick features.\n * @param {number} latitude  The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nWebMapTileServiceImageryProvider.prototype.pickFeatures = function (\n  x,\n  y,\n  level,\n  longitude,\n  latitude\n) {\n  return undefined;\n};\nexport default WebMapTileServiceImageryProvider;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport IonResource from \"../Core/IonResource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport ArcGisMapServerImageryProvider from \"./ArcGisMapServerImageryProvider.js\";\nimport BingMapsImageryProvider from \"./BingMapsImageryProvider.js\";\nimport TileMapServiceImageryProvider from \"./TileMapServiceImageryProvider.js\";\nimport GoogleEarthEnterpriseMapsProvider from \"./GoogleEarthEnterpriseMapsProvider.js\";\nimport MapboxImageryProvider from \"./MapboxImageryProvider.js\";\nimport SingleTileImageryProvider from \"./SingleTileImageryProvider.js\";\nimport UrlTemplateImageryProvider from \"./UrlTemplateImageryProvider.js\";\nimport WebMapServiceImageryProvider from \"./WebMapServiceImageryProvider.js\";\nimport WebMapTileServiceImageryProvider from \"./WebMapTileServiceImageryProvider.js\";\n\n// These values are the list of supported external imagery\n// assets in the Cesium ion beta. They are subject to change.\nconst ImageryProviderAsyncMapping = {\n  ARCGIS_MAPSERVER: ArcGisMapServerImageryProvider.fromUrl,\n  BING: async (url, options) => {\n    return BingMapsImageryProvider.fromUrl(url, options);\n  },\n  GOOGLE_EARTH: async (url, options) => {\n    const channel = options.channel;\n    delete options.channel;\n    return GoogleEarthEnterpriseMapsProvider.fromUrl(url, channel, options);\n  },\n  MAPBOX: (url, options) => {\n    return new MapboxImageryProvider({\n      url: url,\n      ...options,\n    });\n  },\n  SINGLE_TILE: SingleTileImageryProvider.fromUrl,\n  TMS: TileMapServiceImageryProvider.fromUrl,\n  URL_TEMPLATE: (url, options) => {\n    return new UrlTemplateImageryProvider({\n      url: url,\n      ...options,\n    });\n  },\n  WMS: (url, options) => {\n    return new WebMapServiceImageryProvider({\n      url: url,\n      ...options,\n    });\n  },\n  WMTS: (url, options) => {\n    return new WebMapTileServiceImageryProvider({\n      url: url,\n      ...options,\n    });\n  },\n};\n\n/**\n * @typedef {object} IonImageryProvider.ConstructorOptions\n *\n * Initialization options for the TileMapServiceImageryProvider constructor\n *\n * @property {string} [accessToken=Ion.defaultAccessToken] The access token to use.\n * @property {string|Resource} [server=Ion.defaultServer] The resource to the Cesium ion API server.\n */\n\n/**\n * <div class=\"notice\">\n * To construct a IonImageryProvider, call {@link IonImageryProvider.fromAssetId}. Do not call the constructor directly.\n * </div>\n *\n * Provides tiled imagery using the Cesium ion REST API.\n *\n * @alias IonImageryProvider\n * @constructor\n *\n * @param {IonImageryProvider.ConstructorOptions} [options] Object describing initialization options\n *\n * @example\n * const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812));\n * viewer.imageryLayers.add(imageryLayer);\n *\n * @see IonImageryProvider.fromAssetId\n */\nfunction IonImageryProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._defaultAlpha = undefined;\n  this._defaultNightAlpha = undefined;\n  this._defaultDayAlpha = undefined;\n  this._defaultBrightness = undefined;\n  this._defaultContrast = undefined;\n  this._defaultHue = undefined;\n  this._defaultSaturation = undefined;\n  this._defaultGamma = undefined;\n  this._defaultMinificationFilter = undefined;\n  this._defaultMagnificationFilter = undefined;\n\n  this._tileCredits = undefined;\n  this._errorEvent = new Event();\n}\n\nObject.defineProperties(IonImageryProvider.prototype, {\n  /**\n   * Gets the rectangle, in radians, of the imagery provided by the instance.\n   * @memberof IonImageryProvider.prototype\n   * @type {Rectangle}\n   * @readonly\n   */\n  rectangle: {\n    get: function () {\n      return this._imageryProvider.rectangle;\n    },\n  },\n\n  /**\n   * Gets the width of each tile, in pixels.\n   * @memberof IonImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileWidth: {\n    get: function () {\n      return this._imageryProvider.tileWidth;\n    },\n  },\n\n  /**\n   * Gets the height of each tile, in pixels.\n   * @memberof IonImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileHeight: {\n    get: function () {\n      return this._imageryProvider.tileHeight;\n    },\n  },\n\n  /**\n   * Gets the maximum level-of-detail that can be requested.\n   * @memberof IonImageryProvider.prototype\n   * @type {number|undefined}\n   * @readonly\n   */\n  maximumLevel: {\n    get: function () {\n      return this._imageryProvider.maximumLevel;\n    },\n  },\n\n  /**\n   * Gets the minimum level-of-detail that can be requested. Generally,\n   * a minimum level should only be used when the rectangle of the imagery is small\n   * enough that the number of tiles at the minimum level is small.  An imagery\n   * provider with more than a few tiles at the minimum level will lead to\n   * rendering problems.\n   * @memberof IonImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  minimumLevel: {\n    get: function () {\n      return this._imageryProvider.minimumLevel;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by the provider.\n   * @memberof IonImageryProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._imageryProvider.tilingScheme;\n    },\n  },\n\n  /**\n   * Gets the tile discard policy.  If not undefined, the discard policy is responsible\n   * for filtering out \"missing\" tiles via its shouldDiscardImage function.  If this function\n   * returns undefined, no tiles are filtered.\n   * @memberof IonImageryProvider.prototype\n   * @type {TileDiscardPolicy}\n   * @readonly\n   */\n  tileDiscardPolicy: {\n    get: function () {\n      return this._imageryProvider.tileDiscardPolicy;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof IonImageryProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this imagery provider is active.  Typically this is used to credit\n   * the source of the imagery.\n   * @memberof IonImageryProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._imageryProvider.credit;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the images provided by this imagery provider\n   * include an alpha channel.  If this property is false, an alpha channel, if present, will\n   * be ignored.  If this property is true, any images without an alpha channel will be treated\n   * as if their alpha is 1.0 everywhere.  When this property is false, memory usage\n   * and texture upload time are reduced.\n   * @memberof IonImageryProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasAlphaChannel: {\n    get: function () {\n      return this._imageryProvider.hasAlphaChannel;\n    },\n  },\n\n  /**\n   * Gets the proxy used by this provider.\n   * @memberof IonImageryProvider.prototype\n   * @type {Proxy}\n   * @readonly\n   * @default undefined\n   */\n  proxy: {\n    get: function () {\n      return undefined;\n    },\n  },\n});\n\n/**\n * Creates a provider for tiled imagery using the Cesium ion REST API.\n *\n * @param {Number} assetId  An ion imagery asset ID.\n * @param {IonImageryProvider.ConstructorOptions} [options] Object describing initialization options.\n * @returns {Promise<IonImageryProvider>} A promise which resolves to the created IonImageryProvider.\n *\n * @example\n * const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812));\n * viewer.imageryLayers.add(imageryLayer);\n *\n * @exception {RuntimeError} Cesium ion assetId is not an imagery asset\n * @exception {RuntimeError} Unrecognized Cesium ion imagery type\n */\nIonImageryProvider.fromAssetId = async function (assetId, options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"assetId\", assetId);\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const endpointResource = IonResource._createEndpointResource(\n    assetId,\n    options\n  );\n\n  // A simple cache to avoid making repeated requests to ion for endpoints we've\n  // already retrieved. This exists mainly to support Bing caching to reduce\n  // world imagery sessions, but provides a small boost of performance in general\n  // if constantly reloading assets\n  const cacheKey = assetId.toString() + options.accessToken + options.server;\n  let promise = IonImageryProvider._endpointCache[cacheKey];\n  if (!defined(promise)) {\n    promise = endpointResource.fetchJson();\n    IonImageryProvider._endpointCache[cacheKey] = promise;\n  }\n\n  const endpoint = await promise;\n  if (endpoint.type !== \"IMAGERY\") {\n    throw new RuntimeError(\n      `Cesium ion asset ${assetId} is not an imagery asset.`\n    );\n  }\n\n  let imageryProvider;\n  const externalType = endpoint.externalType;\n  if (!defined(externalType)) {\n    imageryProvider = await TileMapServiceImageryProvider.fromUrl(\n      new IonResource(endpoint, endpointResource)\n    );\n  } else {\n    const factory = ImageryProviderAsyncMapping[externalType];\n\n    if (!defined(factory)) {\n      throw new RuntimeError(\n        `Unrecognized Cesium ion imagery type: ${externalType}`\n      );\n    }\n    // Make a copy before editing since this object reference is cached;\n    const options = { ...endpoint.options };\n    const url = options.url;\n    delete options.url;\n    imageryProvider = await factory(url, options);\n  }\n\n  const provider = new IonImageryProvider(options);\n\n  imageryProvider.errorEvent.addEventListener(function (tileProviderError) {\n    //Propagate the errorEvent but set the provider to this instance instead\n    //of the inner instance.\n    tileProviderError.provider = provider;\n    provider._errorEvent.raiseEvent(tileProviderError);\n  });\n\n  provider._tileCredits = IonResource.getCreditsFromEndpoint(\n    endpoint,\n    endpointResource\n  );\n\n  provider._imageryProvider = imageryProvider;\n\n  return provider;\n};\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n * @function\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n */\nIonImageryProvider.prototype.getTileCredits = function (x, y, level) {\n  const innerCredits = this._imageryProvider.getTileCredits(x, y, level);\n  if (!defined(innerCredits)) {\n    return this._tileCredits;\n  }\n\n  return this._tileCredits.concat(innerCredits);\n};\n\n/**\n * Requests the image for a given tile.\n * @function\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n *          undefined if there are too many active requests to the server, and the request should be retried later.\n */\nIonImageryProvider.prototype.requestImage = function (x, y, level, request) {\n  return this._imageryProvider.requestImage(x, y, level, request);\n};\n\n/**\n * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n * a tile. This function is optional, so it may not exist on all ImageryProviders.\n *\n * @function\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {number} longitude The longitude at which to pick features.\n * @param {number} latitude  The latitude at which to pick features.\n * @return {Promise<ImageryLayerFeatureInfo[]>|undefined} A promise for the picked features that will resolve when the asynchronous\n *                   picking completes.  The resolved value is an array of {@link ImageryLayerFeatureInfo}\n *                   instances.  The array may be empty if no features are found at the given location.\n *                   It may also be undefined if picking is not supported.\n */\nIonImageryProvider.prototype.pickFeatures = function (\n  x,\n  y,\n  level,\n  longitude,\n  latitude\n) {\n  return this._imageryProvider.pickFeatures(x, y, level, longitude, latitude);\n};\n\n//exposed for testing\nIonImageryProvider._endpointCache = {};\nexport default IonImageryProvider;\n", "// Note, these values map directly to ion asset ids.\n\n/**\n * The types of imagery provided by {@link createWorldImagery}.\n *\n * @enum {number}\n */\nconst IonWorldImageryStyle = {\n  /**\n   * Aerial imagery.\n   *\n   * @type {number}\n   * @constant\n   */\n  AERIAL: 2,\n\n  /**\n   * Aerial imagery with a road overlay.\n   *\n   * @type {number}\n   * @constant\n   */\n  AERIAL_WITH_LABELS: 3,\n\n  /**\n   * Roads without additional imagery.\n   *\n   * @type {number}\n   * @constant\n   */\n  ROAD: 4,\n};\nexport default Object.freeze(IonWorldImageryStyle);\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport IonImageryProvider from \"./IonImageryProvider.js\";\nimport IonWorldImageryStyle from \"./IonWorldImageryStyle.js\";\n\n/**\n * Creates an {@link IonImageryProvider} instance for ion's default global base imagery layer, currently Bing Maps.\n *\n * @function\n *\n * @param {Object} [options] Object with the following properties:\n * @param {IonWorldImageryStyle} [options.style=IonWorldImageryStyle] The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported.\n * @returns {Promise<IonImageryProvider>}\n *\n * @see Ion\n *\n * @example\n * // Create a Cesium World Imagery base layer with default settings\n * try {\n *   const imageryProvider = await Cesium.createWorldImageryAsync();\n * } catch (error) {\n *   console.log(`There was an error creating world imagery: ${error}`);\n * }\n *\n * @example\n * // Create Cesium World Imagery with different style\n * try {\n *   const imageryProvider = await Cesium.createWorldImageryAsync({\n *         style: Cesium.IonWorldImageryStyle.AERIAL_WITH_LABELS\n *   });\n * } catch (error) {\n *   console.log(`There was an error creating world imagery: ${error}`);\n * }\n */\nfunction createWorldImageryAsync(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const style = defaultValue(options.style, IonWorldImageryStyle.AERIAL);\n  return IonImageryProvider.fromAssetId(style);\n}\nexport default createWorldImageryAsync;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D u_texture;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    out_FragColor = texture(u_texture, v_textureCoordinates);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec4 position;\\n\\\nin float webMercatorT;\\n\\\n\\n\\\nuniform vec2 u_textureDimensions;\\n\\\n\\n\\\nout vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    v_textureCoordinates = vec2(position.x, webMercatorT);\\n\\\n    gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\\n\\\n}\\n\\\n\";\n", "import defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport ImageryState from \"./ImageryState.js\";\n\n/**\n * Stores details about a tile of imagery.\n *\n * @alias Imagery\n * @private\n */\nfunction Imagery(imageryLayer, x, y, level, rectangle) {\n  this.imageryLayer = imageryLayer;\n  this.x = x;\n  this.y = y;\n  this.level = level;\n  this.request = undefined;\n\n  if (level !== 0) {\n    const parentX = (x / 2) | 0;\n    const parentY = (y / 2) | 0;\n    const parentLevel = level - 1;\n    this.parent = imageryLayer.getImageryFromCache(\n      parentX,\n      parentY,\n      parentLevel\n    );\n  }\n\n  this.state = ImageryState.UNLOADED;\n  this.imageUrl = undefined;\n  this.image = undefined;\n  this.texture = undefined;\n  this.textureWebMercator = undefined;\n  this.credits = undefined;\n  this.referenceCount = 0;\n\n  if (!defined(rectangle) && imageryLayer.ready) {\n    const tilingScheme = imageryLayer.imageryProvider.tilingScheme;\n    rectangle = tilingScheme.tileXYToRectangle(x, y, level);\n  }\n\n  this.rectangle = rectangle;\n}\nImagery.createPlaceholder = function (imageryLayer) {\n  const result = new Imagery(imageryLayer, 0, 0, 0);\n  result.addReference();\n  result.state = ImageryState.PLACEHOLDER;\n  return result;\n};\n\nImagery.prototype.addReference = function () {\n  ++this.referenceCount;\n};\n\nImagery.prototype.releaseReference = function () {\n  --this.referenceCount;\n\n  if (this.referenceCount === 0) {\n    this.imageryLayer.removeImageryFromCache(this);\n\n    if (defined(this.parent)) {\n      this.parent.releaseReference();\n    }\n\n    if (defined(this.image) && defined(this.image.destroy)) {\n      this.image.destroy();\n    }\n\n    if (defined(this.texture)) {\n      this.texture.destroy();\n    }\n\n    if (\n      defined(this.textureWebMercator) &&\n      this.texture !== this.textureWebMercator\n    ) {\n      this.textureWebMercator.destroy();\n    }\n\n    destroyObject(this);\n\n    return 0;\n  }\n\n  return this.referenceCount;\n};\n\nImagery.prototype.processStateMachine = function (\n  frameState,\n  needGeographicProjection,\n  skipLoading\n) {\n  if (this.state === ImageryState.UNLOADED && !skipLoading) {\n    this.state = ImageryState.TRANSITIONING;\n    this.imageryLayer._requestImagery(this);\n  }\n\n  if (this.state === ImageryState.RECEIVED) {\n    this.state = ImageryState.TRANSITIONING;\n    this.imageryLayer._createTexture(frameState.context, this);\n  }\n\n  // If the imagery is already ready, but we need a geographic version and don't have it yet,\n  // we still need to do the reprojection step. This can happen if the Web Mercator version\n  // is fine initially, but the geographic one is needed later.\n  const needsReprojection =\n    this.state === ImageryState.READY &&\n    needGeographicProjection &&\n    !this.texture;\n\n  if (this.state === ImageryState.TEXTURE_LOADED || needsReprojection) {\n    this.state = ImageryState.TRANSITIONING;\n    this.imageryLayer._reprojectTexture(\n      frameState,\n      this,\n      needGeographicProjection\n    );\n  }\n};\nexport default Imagery;\n", "import defined from \"../Core/defined.js\";\nimport ImageryState from \"./ImageryState.js\";\n\n/**\n * The assocation between a terrain tile and an imagery tile.\n *\n * @alias TileImagery\n * @private\n *\n * @param {Imagery} imagery The imagery tile.\n * @param {Cartesian4} textureCoordinateRectangle The texture rectangle of the tile that is covered\n *        by the imagery, where X=west, Y=south, Z=east, W=north.\n * @param {boolean} useWebMercatorT true to use the Web Mercator texture coordinates for this imagery tile.\n */\nfunction TileImagery(imagery, textureCoordinateRectangle, useWebMercatorT) {\n  this.readyImagery = undefined;\n  this.loadingImagery = imagery;\n  this.textureCoordinateRectangle = textureCoordinateRectangle;\n  this.textureTranslationAndScale = undefined;\n  this.useWebMercatorT = useWebMercatorT;\n}\n\n/**\n * Frees the resources held by this instance.\n */\nTileImagery.prototype.freeResources = function () {\n  if (defined(this.readyImagery)) {\n    this.readyImagery.releaseReference();\n  }\n\n  if (defined(this.loadingImagery)) {\n    this.loadingImagery.releaseReference();\n  }\n};\n\n/**\n * Processes the load state machine for this instance.\n *\n * @param {Tile} tile The tile to which this instance belongs.\n * @param {FrameState} frameState The frameState.\n * @param {boolean} skipLoading True to skip loading, e.g. new requests, creating textures. This function will\n *                  still synchronously process imagery that's already mostly ready to go, e.g. use textures\n *                  already loaded on ancestor tiles.\n * @returns {boolean} True if this instance is done loading; otherwise, false.\n */\nTileImagery.prototype.processStateMachine = function (\n  tile,\n  frameState,\n  skipLoading\n) {\n  const loadingImagery = this.loadingImagery;\n  const imageryLayer = loadingImagery.imageryLayer;\n\n  loadingImagery.processStateMachine(\n    frameState,\n    !this.useWebMercatorT,\n    skipLoading\n  );\n\n  if (loadingImagery.state === ImageryState.READY) {\n    if (defined(this.readyImagery)) {\n      this.readyImagery.releaseReference();\n    }\n    this.readyImagery = this.loadingImagery;\n    this.loadingImagery = undefined;\n    this.textureTranslationAndScale = imageryLayer._calculateTextureTranslationAndScale(\n      tile,\n      this\n    );\n    return true; // done loading\n  }\n\n  // Find some ancestor imagery we can use while this imagery is still loading.\n  let ancestor = loadingImagery.parent;\n  let closestAncestorThatNeedsLoading;\n  while (\n    defined(ancestor) &&\n    (ancestor.state !== ImageryState.READY ||\n      (!this.useWebMercatorT && !defined(ancestor.texture)))\n  ) {\n    if (\n      ancestor.state !== ImageryState.FAILED &&\n      ancestor.state !== ImageryState.INVALID\n    ) {\n      // ancestor is still loading\n      closestAncestorThatNeedsLoading =\n        closestAncestorThatNeedsLoading || ancestor;\n    }\n    ancestor = ancestor.parent;\n  }\n\n  if (this.readyImagery !== ancestor) {\n    if (defined(this.readyImagery)) {\n      this.readyImagery.releaseReference();\n    }\n\n    this.readyImagery = ancestor;\n\n    if (defined(ancestor)) {\n      ancestor.addReference();\n      this.textureTranslationAndScale = imageryLayer._calculateTextureTranslationAndScale(\n        tile,\n        this\n      );\n    }\n  }\n\n  if (\n    loadingImagery.state === ImageryState.FAILED ||\n    loadingImagery.state === ImageryState.INVALID\n  ) {\n    // The imagery tile is failed or invalid, so we'd like to use an ancestor instead.\n    if (defined(closestAncestorThatNeedsLoading)) {\n      // Push the ancestor's load process along a bit.  This is necessary because some ancestor imagery\n      // tiles may not be attached directly to a terrain tile.  Such tiles will never load if\n      // we don't do it here.\n      closestAncestorThatNeedsLoading.processStateMachine(\n        frameState,\n        !this.useWebMercatorT,\n        skipLoading\n      );\n      return false; // not done loading\n    }\n    // This imagery tile is failed or invalid, and we have the \"best available\" substitute.\n    return true; // done loading\n  }\n\n  return false; // not done loading\n};\nexport default TileImagery;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Check from \"../Core/Check.js\";\nimport createWorldImageryAsync from \"../Scene/createWorldImageryAsync.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport GeographicProjection from \"../Core/GeographicProjection.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Request from \"../Core/Request.js\";\nimport RequestState from \"../Core/RequestState.js\";\nimport RequestType from \"../Core/RequestType.js\";\nimport TerrainProvider from \"../Core/TerrainProvider.js\";\nimport TileProviderError from \"../Core/TileProviderError.js\";\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ComputeCommand from \"../Renderer/ComputeCommand.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport MipmapHint from \"../Renderer/MipmapHint.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport ReprojectWebMercatorFS from \"../Shaders/ReprojectWebMercatorFS.js\";\nimport ReprojectWebMercatorVS from \"../Shaders/ReprojectWebMercatorVS.js\";\nimport Imagery from \"./Imagery.js\";\nimport ImageryState from \"./ImageryState.js\";\nimport SplitDirection from \"./SplitDirection.js\";\nimport TileImagery from \"./TileImagery.js\";\n\n/**\n * @typedef {Object} ImageryLayer.ConstructorOptions\n *\n * Initialization options for the ImageryLayer constructor.\n *\n * @property {Rectangle} [rectangle=imageryProvider.rectangle] The rectangle of the layer.  This rectangle\n *        can limit the visible portion of the imagery provider.\n * @property {number|Function} [alpha=1.0] The alpha blending value of this layer, from 0.0 to 1.0.\n *                          This can either be a simple number or a function with the signature\n *                          <code>function(frameState, layer, x, y, level)</code>.  The function is passed the\n *                          current frame state, this layer, and the x, y, and level coordinates of the\n *                          imagery tile for which the alpha is required, and it is expected to return\n *                          the alpha value to use for the tile.\n * @property {number|Function} [nightAlpha=1.0] The alpha blending value of this layer on the night side of the globe, from 0.0 to 1.0.\n *                          This can either be a simple number or a function with the signature\n *                          <code>function(frameState, layer, x, y, level)</code>.  The function is passed the\n *                          current frame state, this layer, and the x, y, and level coordinates of the\n *                          imagery tile for which the alpha is required, and it is expected to return\n *                          the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.\n * @property {number|Function} [dayAlpha=1.0] The alpha blending value of this layer on the day side of the globe, from 0.0 to 1.0.\n *                          This can either be a simple number or a function with the signature\n *                          <code>function(frameState, layer, x, y, level)</code>.  The function is passed the\n *                          current frame state, this layer, and the x, y, and level coordinates of the\n *                          imagery tile for which the alpha is required, and it is expected to return\n *                          the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.\n * @property {number|Function} [brightness=1.0] The brightness of this layer.  1.0 uses the unmodified imagery\n *                          color.  Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter.\n *                          This can either be a simple number or a function with the signature\n *                          <code>function(frameState, layer, x, y, level)</code>.  The function is passed the\n *                          current frame state, this layer, and the x, y, and level coordinates of the\n *                          imagery tile for which the brightness is required, and it is expected to return\n *                          the brightness value to use for the tile.  The function is executed for every\n *                          frame and for every tile, so it must be fast.\n * @property {number|Function} [contrast=1.0] The contrast of this layer.  1.0 uses the unmodified imagery color.\n *                          Less than 1.0 reduces the contrast while greater than 1.0 increases it.\n *                          This can either be a simple number or a function with the signature\n *                          <code>function(frameState, layer, x, y, level)</code>.  The function is passed the\n *                          current frame state, this layer, and the x, y, and level coordinates of the\n *                          imagery tile for which the contrast is required, and it is expected to return\n *                          the contrast value to use for the tile.  The function is executed for every\n *                          frame and for every tile, so it must be fast.\n * @property {number|Function} [hue=0.0] The hue of this layer.  0.0 uses the unmodified imagery color.\n *                          This can either be a simple number or a function with the signature\n *                          <code>function(frameState, layer, x, y, level)</code>.  The function is passed the\n *                          current frame state, this layer, and the x, y, and level coordinates\n *                          of the imagery tile for which the hue is required, and it is expected to return\n *                          the contrast value to use for the tile.  The function is executed for every\n *                          frame and for every tile, so it must be fast.\n * @property {number|Function} [saturation=1.0] The saturation of this layer.  1.0 uses the unmodified imagery color.\n *                          Less than 1.0 reduces the saturation while greater than 1.0 increases it.\n *                          This can either be a simple number or a function with the signature\n *                          <code>function(frameState, layer, x, y, level)</code>.  The function is passed the\n *                          current frame state, this layer, and the x, y, and level coordinates\n *                          of the imagery tile for which the saturation is required, and it is expected to return\n *                          the contrast value to use for the tile.  The function is executed for every\n *                          frame and for every tile, so it must be fast.\n * @property {number|Function} [gamma=1.0] The gamma correction to apply to this layer.  1.0 uses the unmodified imagery color.\n *                          This can either be a simple number or a function with the signature\n *                          <code>function(frameState, layer, x, y, level)</code>.  The function is passed the\n *                          current frame state, this layer, and the x, y, and level coordinates of the\n *                          imagery tile for which the gamma is required, and it is expected to return\n *                          the gamma value to use for the tile.  The function is executed for every\n *                          frame and for every tile, so it must be fast.\n * @property {SplitDirection|Function} [splitDirection=SplitDirection.NONE] The {@link SplitDirection} split to apply to this layer.\n * @property {TextureMinificationFilter} [minificationFilter=TextureMinificationFilter.LINEAR] The\n *                                    texture minification filter to apply to this layer. Possible values\n *                                    are <code>TextureMinificationFilter.LINEAR</code> and\n *                                    <code>TextureMinificationFilter.NEAREST</code>.\n * @property {TextureMagnificationFilter} [magnificationFilter=TextureMagnificationFilter.LINEAR] The\n *                                     texture minification filter to apply to this layer. Possible values\n *                                     are <code>TextureMagnificationFilter.LINEAR</code> and\n *                                     <code>TextureMagnificationFilter.NEAREST</code>.\n * @property {boolean} [show=true] True if the layer is shown; otherwise, false.\n * @property {number} [maximumAnisotropy=maximum supported] The maximum anisotropy level to use\n *        for texture filtering.  If this parameter is not specified, the maximum anisotropy supported\n *        by the WebGL stack will be used.  Larger values make the imagery look better in horizon\n *        views.\n * @property {number} [minimumTerrainLevel] The minimum terrain level-of-detail at which to show this imagery layer,\n *                 or undefined to show it at all levels.  Level zero is the least-detailed level.\n * @property {number} [maximumTerrainLevel] The maximum terrain level-of-detail at which to show this imagery layer,\n *                 or undefined to show it at all levels.  Level zero is the least-detailed level.\n * @property {Rectangle} [cutoutRectangle] Cartographic rectangle for cutting out a portion of this ImageryLayer.\n * @property {Color} [colorToAlpha] Color to be used as alpha.\n * @property {number} [colorToAlphaThreshold=0.004] Threshold for color-to-alpha.\n */\n\n/**\n * An imagery layer that displays tiled image data from a single imagery provider\n * on a {@link Globe}.\n *\n * @alias ImageryLayer\n * @constructor\n *\n * @param {ImageryProvider} [imageryProvider] The imagery provider to use.\n * @param {ImageryLayer.ConstructorOptions} [options] An object describing initialization options\n *\n * @see ImageryLayer.fromProviderAsync\n * @see ImageryLayer.fromWorldImagery\n *\n * @example\n * // Add an OpenStreetMaps layer\n * const imageryLayer = new Cesium.ImageryLayer(new Cesium.OpenStreetMapImageryProvider({\n *   url: \"https://tile.openstreetmap.org/\"\n * }));\n * scene.imageryLayers.add(imageryLayer);\n *\n * @example\n * // Add Cesium ion's default world imagery layer\n * const imageryLayer = Cesium.ImageryLayer.fromWorldImagery();\n * scene.imageryLayers.add(imageryLayer);\n *\n * @example\n * // Add a new transparent layer from Cesium ion\n * const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812));\n * imageryLayer.alpha = 0.5;\n * scene.imageryLayers.add(imageryLayer);\n */\nfunction ImageryLayer(imageryProvider, options) {\n  this._imageryProvider = imageryProvider;\n\n  this._readyEvent = new Event();\n  this._errorEvent = new Event();\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  imageryProvider = defaultValue(imageryProvider, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * The alpha blending value of this layer, with 0.0 representing fully transparent and\n   * 1.0 representing fully opaque.\n   *\n   * @type {number}\n   * @default 1.0\n   */\n  this.alpha = defaultValue(\n    options.alpha,\n    defaultValue(imageryProvider._defaultAlpha, 1.0)\n  );\n\n  /**\n   * The alpha blending value of this layer on the night side of the globe, with 0.0 representing fully transparent and\n   * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.\n   *\n   * @type {number}\n   * @default 1.0\n   */\n  this.nightAlpha = defaultValue(\n    options.nightAlpha,\n    defaultValue(imageryProvider._defaultNightAlpha, 1.0)\n  );\n\n  /**\n   * The alpha blending value of this layer on the day side of the globe, with 0.0 representing fully transparent and\n   * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.\n   *\n   * @type {number}\n   * @default 1.0\n   */\n  this.dayAlpha = defaultValue(\n    options.dayAlpha,\n    defaultValue(imageryProvider._defaultDayAlpha, 1.0)\n  );\n\n  /**\n   * The brightness of this layer.  1.0 uses the unmodified imagery color.  Less than 1.0\n   * makes the imagery darker while greater than 1.0 makes it brighter.\n   *\n   * @type {number}\n   * @default {@link ImageryLayer.DEFAULT_BRIGHTNESS}\n   */\n  this.brightness = defaultValue(\n    options.brightness,\n    defaultValue(\n      imageryProvider._defaultBrightness,\n      ImageryLayer.DEFAULT_BRIGHTNESS\n    )\n  );\n\n  /**\n   * The contrast of this layer.  1.0 uses the unmodified imagery color.  Less than 1.0 reduces\n   * the contrast while greater than 1.0 increases it.\n   *\n   * @type {number}\n   * @default {@link ImageryLayer.DEFAULT_CONTRAST}\n   */\n  this.contrast = defaultValue(\n    options.contrast,\n    defaultValue(\n      imageryProvider._defaultContrast,\n      ImageryLayer.DEFAULT_CONTRAST\n    )\n  );\n\n  /**\n   * The hue of this layer in radians. 0.0 uses the unmodified imagery color.\n   *\n   * @type {number}\n   * @default {@link ImageryLayer.DEFAULT_HUE}\n   */\n  this.hue = defaultValue(\n    options.hue,\n    defaultValue(imageryProvider._defaultHue, ImageryLayer.DEFAULT_HUE)\n  );\n\n  /**\n   * The saturation of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n   * saturation while greater than 1.0 increases it.\n   *\n   * @type {number}\n   * @default {@link ImageryLayer.DEFAULT_SATURATION}\n   */\n  this.saturation = defaultValue(\n    options.saturation,\n    defaultValue(\n      imageryProvider._defaultSaturation,\n      ImageryLayer.DEFAULT_SATURATION\n    )\n  );\n\n  /**\n   * The gamma correction to apply to this layer.  1.0 uses the unmodified imagery color.\n   *\n   * @type {number}\n   * @default {@link ImageryLayer.DEFAULT_GAMMA}\n   */\n  this.gamma = defaultValue(\n    options.gamma,\n    defaultValue(imageryProvider._defaultGamma, ImageryLayer.DEFAULT_GAMMA)\n  );\n\n  /**\n   * The {@link SplitDirection} to apply to this layer.\n   *\n   * @type {SplitDirection}\n   * @default {@link ImageryLayer.DEFAULT_SPLIT}\n   */\n  this.splitDirection = defaultValue(\n    options.splitDirection,\n    ImageryLayer.DEFAULT_SPLIT\n  );\n\n  /**\n   * The {@link TextureMinificationFilter} to apply to this layer.\n   * Possible values are {@link TextureMinificationFilter.LINEAR} (the default)\n   * and {@link TextureMinificationFilter.NEAREST}.\n   *\n   * To take effect, this property must be set immediately after adding the imagery layer.\n   * Once a texture is loaded it won't be possible to change the texture filter used.\n   *\n   * @type {TextureMinificationFilter}\n   * @default {@link ImageryLayer.DEFAULT_MINIFICATION_FILTER}\n   */\n  this.minificationFilter = defaultValue(\n    options.minificationFilter,\n    defaultValue(\n      imageryProvider._defaultMinificationFilter,\n      ImageryLayer.DEFAULT_MINIFICATION_FILTER\n    )\n  );\n\n  /**\n   * The {@link TextureMagnificationFilter} to apply to this layer.\n   * Possible values are {@link TextureMagnificationFilter.LINEAR} (the default)\n   * and {@link TextureMagnificationFilter.NEAREST}.\n   *\n   * To take effect, this property must be set immediately after adding the imagery layer.\n   * Once a texture is loaded it won't be possible to change the texture filter used.\n   *\n   * @type {TextureMagnificationFilter}\n   * @default {@link ImageryLayer.DEFAULT_MAGNIFICATION_FILTER}\n   */\n  this.magnificationFilter = defaultValue(\n    options.magnificationFilter,\n    defaultValue(\n      imageryProvider._defaultMagnificationFilter,\n      ImageryLayer.DEFAULT_MAGNIFICATION_FILTER\n    )\n  );\n\n  /**\n   * Determines if this layer is shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  this._minimumTerrainLevel = options.minimumTerrainLevel;\n  this._maximumTerrainLevel = options.maximumTerrainLevel;\n\n  this._rectangle = defaultValue(options.rectangle, Rectangle.MAX_VALUE);\n  this._maximumAnisotropy = options.maximumAnisotropy;\n\n  this._imageryCache = {};\n\n  this._skeletonPlaceholder = new TileImagery(Imagery.createPlaceholder(this));\n\n  // The value of the show property on the last update.\n  this._show = true;\n\n  // The index of this layer in the ImageryLayerCollection.\n  this._layerIndex = -1;\n\n  // true if this is the base (lowest shown) layer.\n  this._isBaseLayer = false;\n\n  this._requestImageError = undefined;\n\n  this._reprojectComputeCommands = [];\n\n  /**\n   * Rectangle cutout in this layer of imagery.\n   *\n   * @type {Rectangle}\n   */\n  this.cutoutRectangle = options.cutoutRectangle;\n\n  /**\n   * Color value that should be set to transparent.\n   *\n   * @type {Color}\n   */\n  this.colorToAlpha = options.colorToAlpha;\n\n  /**\n   * Normalized (0-1) threshold for color-to-alpha.\n   *\n   * @type {number}\n   */\n  this.colorToAlphaThreshold = defaultValue(\n    options.colorToAlphaThreshold,\n    ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD\n  );\n}\n\nObject.defineProperties(ImageryLayer.prototype, {\n  /**\n   * Gets the imagery provider for this layer. This should not be called before {@link ImageryLayer#ready} returns true.\n   * @memberof ImageryLayer.prototype\n   * @type {ImageryProvider}\n   * @readonly\n   */\n  imageryProvider: {\n    get: function () {\n      return this._imageryProvider;\n    },\n  },\n\n  /**\n   * Returns true when the terrain provider has been successfully created. Otherwise, returns false.\n   * @memberof ImageryLayer.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  ready: {\n    get: function () {\n      return defined(this._imageryProvider);\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of the thrown error.\n   * @memberof Imagery.prototype\n   * @type {Event<Imagery.ErrorEventCallback>}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider has been successfully created. Event listeners\n   * are passed the created instance of {@link ImageryProvider}.\n   * @memberof ImageryLayer.prototype\n   * @type {Event<ImageryLayer.ReadyEventCallback>}\n   * @readonly\n   */\n  readyEvent: {\n    get: function () {\n      return this._readyEvent;\n    },\n  },\n\n  /**\n   * Gets the rectangle of this layer.  If this rectangle is smaller than the rectangle of the\n   * {@link ImageryProvider}, only a portion of the imagery provider is shown.\n   * @memberof ImageryLayer.prototype\n   * @type {Rectangle}\n   * @readonly\n   */\n  rectangle: {\n    get: function () {\n      return this._rectangle;\n    },\n  },\n});\n\n/**\n * This value is used as the default brightness for the imagery layer if one is not provided during construction\n * or by the imagery provider. This value does not modify the brightness of the imagery.\n * @type {number}\n * @default 1.0\n */\nImageryLayer.DEFAULT_BRIGHTNESS = 1.0;\n/**\n * This value is used as the default contrast for the imagery layer if one is not provided during construction\n * or by the imagery provider. This value does not modify the contrast of the imagery.\n * @type {number}\n * @default 1.0\n */\nImageryLayer.DEFAULT_CONTRAST = 1.0;\n/**\n * This value is used as the default hue for the imagery layer if one is not provided during construction\n * or by the imagery provider. This value does not modify the hue of the imagery.\n * @type {number}\n * @default 0.0\n */\nImageryLayer.DEFAULT_HUE = 0.0;\n/**\n * This value is used as the default saturation for the imagery layer if one is not provided during construction\n * or by the imagery provider. This value does not modify the saturation of the imagery.\n * @type {number}\n * @default 1.0\n */\nImageryLayer.DEFAULT_SATURATION = 1.0;\n/**\n * This value is used as the default gamma for the imagery layer if one is not provided during construction\n * or by the imagery provider. This value does not modify the gamma of the imagery.\n * @type {number}\n * @default 1.0\n */\nImageryLayer.DEFAULT_GAMMA = 1.0;\n\n/**\n * This value is used as the default split for the imagery layer if one is not provided during construction\n * or by the imagery provider.\n * @type {SplitDirection}\n * @default SplitDirection.NONE\n */\nImageryLayer.DEFAULT_SPLIT = SplitDirection.NONE;\n\n/**\n * This value is used as the default texture minification filter for the imagery layer if one is not provided\n * during construction or by the imagery provider.\n * @type {TextureMinificationFilter}\n * @default TextureMinificationFilter.LINEAR\n */\nImageryLayer.DEFAULT_MINIFICATION_FILTER = TextureMinificationFilter.LINEAR;\n\n/**\n * This value is used as the default texture magnification filter for the imagery layer if one is not provided\n * during construction or by the imagery provider.\n * @type {TextureMagnificationFilter}\n * @default TextureMagnificationFilter.LINEAR\n */\nImageryLayer.DEFAULT_MAGNIFICATION_FILTER = TextureMagnificationFilter.LINEAR;\n\n/**\n * This value is used as the default threshold for color-to-alpha if one is not provided\n * during construction or by the imagery provider.\n * @type {number}\n * @default 0.004\n */\nImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD = 0.004;\n\n/**\n * Create a new imagery layer from an asynchronous imagery provider. The layer will handle any asynchronous loads or errors, and begin rendering the imagery layer once ready.\n *\n * @param {Promise<ImageryProvider>} imageryProviderPromise A promise which resolves to a imagery provider\n * @param {ImageryLayer.ConstructorOptions} options An object describing initialization options\n * @returns {ImageryLayer} The created imagery layer.\n *\n * @example\n * // Create a new base layer\n * const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n *   baseLayer: Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812));\n * });\n *\n * @example\n * // Add a new transparent layer\n * const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812));\n * imageryLayer.alpha = 0.5;\n * viewer.imageryLayers.add(imageryLayer);\n *\n * @example\n * // Handle loading events\n * const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812));\n * viewer.imageryLayers.add(imageryLayer);\n *\n * imageryLayer.readyEvent.addEventListener(provider => {\n *   imageryLayer.provider.errorEvent.addEventListener(error => {\n *     alert(`Encountered an error while loading imagery tiles! ${error}`);\n *   });\n * });\n *\n * imageryLayer.errorEvent.addEventListener(error => {\n *   alert(`Encountered an error while creating an imagery layer! ${error}`);\n * });\n *\n * @see ImageryLayer.errorEvent\n * @see ImageryLayer.readyEvent\n * @see ImageryLayer.provider\n * @see ImageryLayer.fromWorldImagery\n */\nImageryLayer.fromProviderAsync = function (imageryProviderPromise, options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"imageryProviderPromise\", imageryProviderPromise);\n  //>>includeEnd('debug');\n\n  const layer = new ImageryLayer(undefined, options);\n\n  handlePromise(layer, Promise.resolve(imageryProviderPromise));\n\n  return layer;\n};\n\n/**\n * @typedef {ImageryLayer.ConstructorOptions} ImageryLayer.WorldImageryConstructorOptions\n *\n * Initialization options for ImageryLayer.fromWorldImagery\n *\n * @property {IonWorldImageryStyle} [options.style=IonWorldImageryStyle] The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported.\n */\n\n/**\n * Create a new imagery layer for ion's default global base imagery layer, currently Bing Maps. The layer will handle any asynchronous loads or errors, and begin rendering the imagery layer once ready.\n *\n * @param {ImageryLayer.WorldImageryConstructorOptions} options An object describing initialization options\n * @returns {ImageryLayer} The created imagery layer.\n *\n * * @example\n * // Create a new base layer\n * const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n *   baseLayer: Cesium.ImageryLayer.fromWorldImagery();\n * });\n *\n * @example\n * // Add a new transparent layer\n * const imageryLayer = Cesium.ImageryLayer.fromWorldImagery();\n * imageryLayer.alpha = 0.5;\n * viewer.imageryLayers.add(imageryLayer);\n *\n * @example\n * // Handle loading events\n * const imageryLayer = Cesium.ImageryLayer.fromWorldImagery();\n * viewer.imageryLayers.add(imageryLayer);\n *\n * imageryLayer.readyEvent.addEventListener(provider => {\n *   imageryLayer.provider.errorEvent.addEventListener(error => {\n *     alert(`Encountered an error while loading imagery tiles! ${error}`);\n *   });\n * });\n *\n * imageryLayer.errorEvent.addEventListener(error => {\n *   alert(`Encountered an error while creating an imagery layer! ${error}`);\n * });\n *\n * @see ImageryLayer.errorEvent\n * @see ImageryLayer.readyEvent\n * @see ImageryLayer.provider\n */\nImageryLayer.fromWorldImagery = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  return ImageryLayer.fromProviderAsync(\n    createWorldImageryAsync({\n      style: options.style,\n    }),\n    options\n  );\n};\n\n/**\n * Gets a value indicating whether this layer is the base layer in the\n * {@link ImageryLayerCollection}.  The base layer is the one that underlies all\n * others.  It is special in that it is treated as if it has global rectangle, even if\n * it actually does not, by stretching the texels at the edges over the entire\n * globe.\n *\n * @returns {boolean} true if this is the base layer; otherwise, false.\n */\nImageryLayer.prototype.isBaseLayer = function () {\n  return this._isBaseLayer;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see ImageryLayer#destroy\n */\nImageryLayer.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * imageryLayer = imageryLayer && imageryLayer.destroy();\n *\n * @see ImageryLayer#isDestroyed\n */\nImageryLayer.prototype.destroy = function () {\n  return destroyObject(this);\n};\n\nconst imageryBoundsScratch = new Rectangle();\nconst tileImageryBoundsScratch = new Rectangle();\nconst clippedRectangleScratch = new Rectangle();\nconst terrainRectangleScratch = new Rectangle();\n\n/**\n * Computes the intersection of this layer's rectangle with the imagery provider's availability rectangle,\n * producing the overall bounds of imagery that can be produced by this layer.\n *\n * @returns {Rectangle} A rectangle which defines the overall bounds of imagery that can be produced by this layer.\n *\n * @example\n * // Zoom to an imagery layer.\n * const imageryRectangle = imageryLayer.getImageryRectangle();\n * scene.camera.flyTo({\n *     destination: rectangle\n * });\n *\n */\nImageryLayer.prototype.getImageryRectangle = function () {\n  const imageryProvider = this._imageryProvider;\n  const rectangle = this._rectangle;\n  return Rectangle.intersection(imageryProvider.rectangle, rectangle);\n};\n\n/**\n * Create skeletons for the imagery tiles that partially or completely overlap a given terrain\n * tile.\n *\n * @private\n *\n * @param {Tile} tile The terrain tile.\n * @param {TerrainProvider|undefined} terrainProvider The terrain provider associated with the terrain tile.\n * @param {number} insertionPoint The position to insert new skeletons before in the tile's imagery list.\n * @returns {boolean} true if this layer overlaps any portion of the terrain tile; otherwise, false.\n */\nImageryLayer.prototype._createTileImagerySkeletons = function (\n  tile,\n  terrainProvider,\n  insertionPoint\n) {\n  const surfaceTile = tile.data;\n\n  if (\n    !defined(terrainProvider) ||\n    (defined(this._minimumTerrainLevel) &&\n      tile.level < this._minimumTerrainLevel)\n  ) {\n    return false;\n  }\n  if (\n    defined(this._maximumTerrainLevel) &&\n    tile.level > this._maximumTerrainLevel\n  ) {\n    return false;\n  }\n\n  if (!defined(insertionPoint)) {\n    insertionPoint = surfaceTile.imagery.length;\n  }\n\n  const imageryProvider = this._imageryProvider;\n  if (!this.ready) {\n    // The imagery provider is not ready, so we can't create skeletons, yet.\n    // Instead, add a placeholder so that we'll know to create\n    // the skeletons once the provider is ready.\n    this._skeletonPlaceholder.loadingImagery.addReference();\n    surfaceTile.imagery.splice(insertionPoint, 0, this._skeletonPlaceholder);\n    return true;\n  }\n\n  // Use Web Mercator for our texture coordinate computations if this imagery layer uses\n  // that projection and the terrain tile falls entirely inside the valid bounds of the\n  // projection.\n  const useWebMercatorT =\n    imageryProvider.tilingScheme.projection instanceof WebMercatorProjection &&\n    tile.rectangle.north < WebMercatorProjection.MaximumLatitude &&\n    tile.rectangle.south > -WebMercatorProjection.MaximumLatitude;\n\n  // Compute the rectangle of the imagery from this imageryProvider that overlaps\n  // the geometry tile.  The ImageryProvider and ImageryLayer both have the\n  // opportunity to constrain the rectangle.  The imagery TilingScheme's rectangle\n  // always fully contains the ImageryProvider's rectangle.\n  const imageryBounds = Rectangle.intersection(\n    imageryProvider.rectangle,\n    this._rectangle,\n    imageryBoundsScratch\n  );\n  let rectangle = Rectangle.intersection(\n    tile.rectangle,\n    imageryBounds,\n    tileImageryBoundsScratch\n  );\n\n  if (!defined(rectangle)) {\n    // There is no overlap between this terrain tile and this imagery\n    // provider.  Unless this is the base layer, no skeletons need to be created.\n    // We stretch texels at the edge of the base layer over the entire globe.\n    if (!this.isBaseLayer()) {\n      return false;\n    }\n\n    const baseImageryRectangle = imageryBounds;\n    const baseTerrainRectangle = tile.rectangle;\n    rectangle = tileImageryBoundsScratch;\n\n    if (baseTerrainRectangle.south >= baseImageryRectangle.north) {\n      rectangle.north = rectangle.south = baseImageryRectangle.north;\n    } else if (baseTerrainRectangle.north <= baseImageryRectangle.south) {\n      rectangle.north = rectangle.south = baseImageryRectangle.south;\n    } else {\n      rectangle.south = Math.max(\n        baseTerrainRectangle.south,\n        baseImageryRectangle.south\n      );\n      rectangle.north = Math.min(\n        baseTerrainRectangle.north,\n        baseImageryRectangle.north\n      );\n    }\n\n    if (baseTerrainRectangle.west >= baseImageryRectangle.east) {\n      rectangle.west = rectangle.east = baseImageryRectangle.east;\n    } else if (baseTerrainRectangle.east <= baseImageryRectangle.west) {\n      rectangle.west = rectangle.east = baseImageryRectangle.west;\n    } else {\n      rectangle.west = Math.max(\n        baseTerrainRectangle.west,\n        baseImageryRectangle.west\n      );\n      rectangle.east = Math.min(\n        baseTerrainRectangle.east,\n        baseImageryRectangle.east\n      );\n    }\n  }\n\n  let latitudeClosestToEquator = 0.0;\n  if (rectangle.south > 0.0) {\n    latitudeClosestToEquator = rectangle.south;\n  } else if (rectangle.north < 0.0) {\n    latitudeClosestToEquator = rectangle.north;\n  }\n\n  // Compute the required level in the imagery tiling scheme.\n  // The errorRatio should really be imagerySSE / terrainSSE rather than this hard-coded value.\n  // But first we need configurable imagery SSE and we need the rendering to be able to handle more\n  // images attached to a terrain tile than there are available texture units.  So that's for the future.\n  const errorRatio = 1.0;\n  const targetGeometricError =\n    errorRatio * terrainProvider.getLevelMaximumGeometricError(tile.level);\n  let imageryLevel = getLevelWithMaximumTexelSpacing(\n    this,\n    targetGeometricError,\n    latitudeClosestToEquator\n  );\n  imageryLevel = Math.max(0, imageryLevel);\n  const maximumLevel = imageryProvider.maximumLevel;\n  if (imageryLevel > maximumLevel) {\n    imageryLevel = maximumLevel;\n  }\n\n  if (defined(imageryProvider.minimumLevel)) {\n    const minimumLevel = imageryProvider.minimumLevel;\n    if (imageryLevel < minimumLevel) {\n      imageryLevel = minimumLevel;\n    }\n  }\n\n  const imageryTilingScheme = imageryProvider.tilingScheme;\n  const northwestTileCoordinates = imageryTilingScheme.positionToTileXY(\n    Rectangle.northwest(rectangle),\n    imageryLevel\n  );\n  const southeastTileCoordinates = imageryTilingScheme.positionToTileXY(\n    Rectangle.southeast(rectangle),\n    imageryLevel\n  );\n\n  // If the southeast corner of the rectangle lies very close to the north or west side\n  // of the southeast tile, we don't actually need the southernmost or easternmost\n  // tiles.\n  // Similarly, if the northwest corner of the rectangle lies very close to the south or east side\n  // of the northwest tile, we don't actually need the northernmost or westernmost tiles.\n\n  // We define \"very close\" as being within 1/512 of the width of the tile.\n  let veryCloseX = tile.rectangle.width / 512.0;\n  let veryCloseY = tile.rectangle.height / 512.0;\n\n  const northwestTileRectangle = imageryTilingScheme.tileXYToRectangle(\n    northwestTileCoordinates.x,\n    northwestTileCoordinates.y,\n    imageryLevel\n  );\n  if (\n    Math.abs(northwestTileRectangle.south - tile.rectangle.north) <\n      veryCloseY &&\n    northwestTileCoordinates.y < southeastTileCoordinates.y\n  ) {\n    ++northwestTileCoordinates.y;\n  }\n  if (\n    Math.abs(northwestTileRectangle.east - tile.rectangle.west) < veryCloseX &&\n    northwestTileCoordinates.x < southeastTileCoordinates.x\n  ) {\n    ++northwestTileCoordinates.x;\n  }\n\n  const southeastTileRectangle = imageryTilingScheme.tileXYToRectangle(\n    southeastTileCoordinates.x,\n    southeastTileCoordinates.y,\n    imageryLevel\n  );\n  if (\n    Math.abs(southeastTileRectangle.north - tile.rectangle.south) <\n      veryCloseY &&\n    southeastTileCoordinates.y > northwestTileCoordinates.y\n  ) {\n    --southeastTileCoordinates.y;\n  }\n  if (\n    Math.abs(southeastTileRectangle.west - tile.rectangle.east) < veryCloseX &&\n    southeastTileCoordinates.x > northwestTileCoordinates.x\n  ) {\n    --southeastTileCoordinates.x;\n  }\n\n  // Create TileImagery instances for each imagery tile overlapping this terrain tile.\n  // We need to do all texture coordinate computations in the imagery tile's tiling scheme.\n\n  const terrainRectangle = Rectangle.clone(\n    tile.rectangle,\n    terrainRectangleScratch\n  );\n  let imageryRectangle = imageryTilingScheme.tileXYToRectangle(\n    northwestTileCoordinates.x,\n    northwestTileCoordinates.y,\n    imageryLevel\n  );\n  let clippedImageryRectangle = Rectangle.intersection(\n    imageryRectangle,\n    imageryBounds,\n    clippedRectangleScratch\n  );\n\n  let imageryTileXYToRectangle;\n  if (useWebMercatorT) {\n    imageryTilingScheme.rectangleToNativeRectangle(\n      terrainRectangle,\n      terrainRectangle\n    );\n    imageryTilingScheme.rectangleToNativeRectangle(\n      imageryRectangle,\n      imageryRectangle\n    );\n    imageryTilingScheme.rectangleToNativeRectangle(\n      clippedImageryRectangle,\n      clippedImageryRectangle\n    );\n    imageryTilingScheme.rectangleToNativeRectangle(\n      imageryBounds,\n      imageryBounds\n    );\n    imageryTileXYToRectangle = imageryTilingScheme.tileXYToNativeRectangle.bind(\n      imageryTilingScheme\n    );\n    veryCloseX = terrainRectangle.width / 512.0;\n    veryCloseY = terrainRectangle.height / 512.0;\n  } else {\n    imageryTileXYToRectangle = imageryTilingScheme.tileXYToRectangle.bind(\n      imageryTilingScheme\n    );\n  }\n\n  let minU;\n  let maxU = 0.0;\n\n  let minV = 1.0;\n  let maxV;\n\n  // If this is the northern-most or western-most tile in the imagery tiling scheme,\n  // it may not start at the northern or western edge of the terrain tile.\n  // Calculate where it does start.\n  if (\n    !this.isBaseLayer() &&\n    Math.abs(clippedImageryRectangle.west - terrainRectangle.west) >= veryCloseX\n  ) {\n    maxU = Math.min(\n      1.0,\n      (clippedImageryRectangle.west - terrainRectangle.west) /\n        terrainRectangle.width\n    );\n  }\n\n  if (\n    !this.isBaseLayer() &&\n    Math.abs(clippedImageryRectangle.north - terrainRectangle.north) >=\n      veryCloseY\n  ) {\n    minV = Math.max(\n      0.0,\n      (clippedImageryRectangle.north - terrainRectangle.south) /\n        terrainRectangle.height\n    );\n  }\n\n  const initialMinV = minV;\n\n  for (\n    let i = northwestTileCoordinates.x;\n    i <= southeastTileCoordinates.x;\n    i++\n  ) {\n    minU = maxU;\n\n    imageryRectangle = imageryTileXYToRectangle(\n      i,\n      northwestTileCoordinates.y,\n      imageryLevel\n    );\n    clippedImageryRectangle = Rectangle.simpleIntersection(\n      imageryRectangle,\n      imageryBounds,\n      clippedRectangleScratch\n    );\n\n    if (!defined(clippedImageryRectangle)) {\n      continue;\n    }\n\n    maxU = Math.min(\n      1.0,\n      (clippedImageryRectangle.east - terrainRectangle.west) /\n        terrainRectangle.width\n    );\n\n    // If this is the eastern-most imagery tile mapped to this terrain tile,\n    // and there are more imagery tiles to the east of this one, the maxU\n    // should be 1.0 to make sure rounding errors don't make the last\n    // image fall shy of the edge of the terrain tile.\n    if (\n      i === southeastTileCoordinates.x &&\n      (this.isBaseLayer() ||\n        Math.abs(clippedImageryRectangle.east - terrainRectangle.east) <\n          veryCloseX)\n    ) {\n      maxU = 1.0;\n    }\n\n    minV = initialMinV;\n\n    for (\n      let j = northwestTileCoordinates.y;\n      j <= southeastTileCoordinates.y;\n      j++\n    ) {\n      maxV = minV;\n\n      imageryRectangle = imageryTileXYToRectangle(i, j, imageryLevel);\n      clippedImageryRectangle = Rectangle.simpleIntersection(\n        imageryRectangle,\n        imageryBounds,\n        clippedRectangleScratch\n      );\n\n      if (!defined(clippedImageryRectangle)) {\n        continue;\n      }\n\n      minV = Math.max(\n        0.0,\n        (clippedImageryRectangle.south - terrainRectangle.south) /\n          terrainRectangle.height\n      );\n\n      // If this is the southern-most imagery tile mapped to this terrain tile,\n      // and there are more imagery tiles to the south of this one, the minV\n      // should be 0.0 to make sure rounding errors don't make the last\n      // image fall shy of the edge of the terrain tile.\n      if (\n        j === southeastTileCoordinates.y &&\n        (this.isBaseLayer() ||\n          Math.abs(clippedImageryRectangle.south - terrainRectangle.south) <\n            veryCloseY)\n      ) {\n        minV = 0.0;\n      }\n\n      const texCoordsRectangle = new Cartesian4(minU, minV, maxU, maxV);\n      const imagery = this.getImageryFromCache(i, j, imageryLevel);\n      surfaceTile.imagery.splice(\n        insertionPoint,\n        0,\n        new TileImagery(imagery, texCoordsRectangle, useWebMercatorT)\n      );\n      ++insertionPoint;\n    }\n  }\n\n  return true;\n};\n\n/**\n * Calculate the translation and scale for a particular {@link TileImagery} attached to a\n * particular terrain tile.\n *\n * @private\n *\n * @param {Tile} tile The terrain tile.\n * @param {TileImagery} tileImagery The imagery tile mapping.\n * @returns {Cartesian4} The translation and scale where X and Y are the translation and Z and W\n *          are the scale.\n */\nImageryLayer.prototype._calculateTextureTranslationAndScale = function (\n  tile,\n  tileImagery\n) {\n  let imageryRectangle = tileImagery.readyImagery.rectangle;\n  let terrainRectangle = tile.rectangle;\n\n  if (tileImagery.useWebMercatorT) {\n    const tilingScheme =\n      tileImagery.readyImagery.imageryLayer.imageryProvider.tilingScheme;\n    imageryRectangle = tilingScheme.rectangleToNativeRectangle(\n      imageryRectangle,\n      imageryBoundsScratch\n    );\n    terrainRectangle = tilingScheme.rectangleToNativeRectangle(\n      terrainRectangle,\n      terrainRectangleScratch\n    );\n  }\n\n  const terrainWidth = terrainRectangle.width;\n  const terrainHeight = terrainRectangle.height;\n\n  const scaleX = terrainWidth / imageryRectangle.width;\n  const scaleY = terrainHeight / imageryRectangle.height;\n  return new Cartesian4(\n    (scaleX * (terrainRectangle.west - imageryRectangle.west)) / terrainWidth,\n    (scaleY * (terrainRectangle.south - imageryRectangle.south)) /\n      terrainHeight,\n    scaleX,\n    scaleY\n  );\n};\n\n/**\n * Request a particular piece of imagery from the imagery provider.  This method handles raising an\n * error event if the request fails, and retrying the request if necessary.\n *\n * @private\n *\n * @param {Imagery} imagery The imagery to request.\n */\nImageryLayer.prototype._requestImagery = function (imagery) {\n  const imageryProvider = this._imageryProvider;\n\n  const that = this;\n\n  function success(image) {\n    if (!defined(image)) {\n      return failure();\n    }\n\n    imagery.image = image;\n    imagery.state = ImageryState.RECEIVED;\n    imagery.request = undefined;\n\n    TileProviderError.reportSuccess(that._requestImageError);\n  }\n\n  function failure(e) {\n    if (imagery.request.state === RequestState.CANCELLED) {\n      // Cancelled due to low priority - try again later.\n      imagery.state = ImageryState.UNLOADED;\n      imagery.request = undefined;\n      return;\n    }\n\n    // Initially assume failure. An error handler may retry, in which case the state will\n    // change to TRANSITIONING.\n    imagery.state = ImageryState.FAILED;\n    imagery.request = undefined;\n\n    const message = `Failed to obtain image tile X: ${imagery.x} Y: ${imagery.y} Level: ${imagery.level}.`;\n    that._requestImageError = TileProviderError.reportError(\n      that._requestImageError,\n      imageryProvider,\n      imageryProvider.errorEvent,\n      message,\n      imagery.x,\n      imagery.y,\n      imagery.level,\n      e\n    );\n    if (that._requestImageError.retry) {\n      doRequest();\n    }\n  }\n\n  function doRequest() {\n    const request = new Request({\n      throttle: false,\n      throttleByServer: true,\n      type: RequestType.IMAGERY,\n    });\n    imagery.request = request;\n    imagery.state = ImageryState.TRANSITIONING;\n    const imagePromise = imageryProvider.requestImage(\n      imagery.x,\n      imagery.y,\n      imagery.level,\n      request\n    );\n\n    if (!defined(imagePromise)) {\n      // Too many parallel requests, so postpone loading tile.\n      imagery.state = ImageryState.UNLOADED;\n      imagery.request = undefined;\n      return;\n    }\n\n    if (defined(imageryProvider.getTileCredits)) {\n      imagery.credits = imageryProvider.getTileCredits(\n        imagery.x,\n        imagery.y,\n        imagery.level\n      );\n    }\n\n    imagePromise\n      .then(function (image) {\n        success(image);\n      })\n      .catch(function (e) {\n        failure(e);\n      });\n  }\n\n  doRequest();\n};\n\nImageryLayer.prototype._createTextureWebGL = function (context, imagery) {\n  const sampler = new Sampler({\n    minificationFilter: this.minificationFilter,\n    magnificationFilter: this.magnificationFilter,\n  });\n\n  const image = imagery.image;\n\n  if (defined(image.internalFormat)) {\n    return new Texture({\n      context: context,\n      pixelFormat: image.internalFormat,\n      width: image.width,\n      height: image.height,\n      source: {\n        arrayBufferView: image.bufferView,\n      },\n      sampler: sampler,\n    });\n  }\n  return new Texture({\n    context: context,\n    source: image,\n    pixelFormat: this._imageryProvider.hasAlphaChannel\n      ? PixelFormat.RGBA\n      : PixelFormat.RGB,\n    sampler: sampler,\n  });\n};\n\n/**\n * Create a WebGL texture for a given {@link Imagery} instance.\n *\n * @private\n *\n * @param {Context} context The rendered context to use to create textures.\n * @param {Imagery} imagery The imagery for which to create a texture.\n */\nImageryLayer.prototype._createTexture = function (context, imagery) {\n  const imageryProvider = this._imageryProvider;\n  const image = imagery.image;\n\n  // If this imagery provider has a discard policy, use it to check if this\n  // image should be discarded.\n  if (defined(imageryProvider.tileDiscardPolicy)) {\n    const discardPolicy = imageryProvider.tileDiscardPolicy;\n    if (defined(discardPolicy)) {\n      // If the discard policy is not ready yet, transition back to the\n      // RECEIVED state and we'll try again next time.\n      if (!discardPolicy.isReady()) {\n        imagery.state = ImageryState.RECEIVED;\n        return;\n      }\n\n      // Mark discarded imagery tiles invalid.  Parent imagery will be used instead.\n      if (discardPolicy.shouldDiscardImage(image)) {\n        imagery.state = ImageryState.INVALID;\n        return;\n      }\n    }\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    this.minificationFilter !== TextureMinificationFilter.NEAREST &&\n    this.minificationFilter !== TextureMinificationFilter.LINEAR\n  ) {\n    throw new DeveloperError(\n      \"ImageryLayer minification filter must be NEAREST or LINEAR\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  // Imagery does not need to be discarded, so upload it to WebGL.\n  const texture = this._createTextureWebGL(context, imagery);\n\n  if (\n    imageryProvider.tilingScheme.projection instanceof WebMercatorProjection\n  ) {\n    imagery.textureWebMercator = texture;\n  } else {\n    imagery.texture = texture;\n  }\n  imagery.image = undefined;\n  imagery.state = ImageryState.TEXTURE_LOADED;\n};\n\nfunction getSamplerKey(\n  minificationFilter,\n  magnificationFilter,\n  maximumAnisotropy\n) {\n  return `${minificationFilter}:${magnificationFilter}:${maximumAnisotropy}`;\n}\n\nImageryLayer.prototype._finalizeReprojectTexture = function (context, texture) {\n  let minificationFilter = this.minificationFilter;\n  const magnificationFilter = this.magnificationFilter;\n  const usesLinearTextureFilter =\n    minificationFilter === TextureMinificationFilter.LINEAR &&\n    magnificationFilter === TextureMagnificationFilter.LINEAR;\n  // Use mipmaps if this texture has power-of-two dimensions.\n  // In addition, mipmaps are only generated if the texture filters are both LINEAR.\n  if (\n    usesLinearTextureFilter &&\n    !PixelFormat.isCompressedFormat(texture.pixelFormat) &&\n    CesiumMath.isPowerOfTwo(texture.width) &&\n    CesiumMath.isPowerOfTwo(texture.height)\n  ) {\n    minificationFilter = TextureMinificationFilter.LINEAR_MIPMAP_LINEAR;\n    const maximumSupportedAnisotropy =\n      ContextLimits.maximumTextureFilterAnisotropy;\n    const maximumAnisotropy = Math.min(\n      maximumSupportedAnisotropy,\n      defaultValue(this._maximumAnisotropy, maximumSupportedAnisotropy)\n    );\n    const mipmapSamplerKey = getSamplerKey(\n      minificationFilter,\n      magnificationFilter,\n      maximumAnisotropy\n    );\n    let mipmapSamplers = context.cache.imageryLayerMipmapSamplers;\n    if (!defined(mipmapSamplers)) {\n      mipmapSamplers = {};\n      context.cache.imageryLayerMipmapSamplers = mipmapSamplers;\n    }\n    let mipmapSampler = mipmapSamplers[mipmapSamplerKey];\n    if (!defined(mipmapSampler)) {\n      mipmapSampler = mipmapSamplers[mipmapSamplerKey] = new Sampler({\n        wrapS: TextureWrap.CLAMP_TO_EDGE,\n        wrapT: TextureWrap.CLAMP_TO_EDGE,\n        minificationFilter: minificationFilter,\n        magnificationFilter: magnificationFilter,\n        maximumAnisotropy: maximumAnisotropy,\n      });\n    }\n    texture.generateMipmap(MipmapHint.NICEST);\n    texture.sampler = mipmapSampler;\n  } else {\n    const nonMipmapSamplerKey = getSamplerKey(\n      minificationFilter,\n      magnificationFilter,\n      0\n    );\n    let nonMipmapSamplers = context.cache.imageryLayerNonMipmapSamplers;\n    if (!defined(nonMipmapSamplers)) {\n      nonMipmapSamplers = {};\n      context.cache.imageryLayerNonMipmapSamplers = nonMipmapSamplers;\n    }\n    let nonMipmapSampler = nonMipmapSamplers[nonMipmapSamplerKey];\n    if (!defined(nonMipmapSampler)) {\n      nonMipmapSampler = nonMipmapSamplers[nonMipmapSamplerKey] = new Sampler({\n        wrapS: TextureWrap.CLAMP_TO_EDGE,\n        wrapT: TextureWrap.CLAMP_TO_EDGE,\n        minificationFilter: minificationFilter,\n        magnificationFilter: magnificationFilter,\n      });\n    }\n    texture.sampler = nonMipmapSampler;\n  }\n};\n\n/**\n * Enqueues a command re-projecting a texture to a {@link GeographicProjection} on the next update, if necessary, and generate\n * mipmaps for the geographic texture.\n *\n * @private\n *\n * @param {FrameState} frameState The frameState.\n * @param {Imagery} imagery The imagery instance to reproject.\n * @param {boolean} [needGeographicProjection=true] True to reproject to geographic, or false if Web Mercator is fine.\n */\nImageryLayer.prototype._reprojectTexture = function (\n  frameState,\n  imagery,\n  needGeographicProjection\n) {\n  const texture = imagery.textureWebMercator || imagery.texture;\n  const rectangle = imagery.rectangle;\n  const context = frameState.context;\n\n  needGeographicProjection = defaultValue(needGeographicProjection, true);\n\n  // Reproject this texture if it is not already in a geographic projection and\n  // the pixels are more than 1e-5 radians apart.  The pixel spacing cutoff\n  // avoids precision problems in the reprojection transformation while making\n  // no noticeable difference in the georeferencing of the image.\n  if (\n    needGeographicProjection &&\n    !(\n      this._imageryProvider.tilingScheme.projection instanceof\n      GeographicProjection\n    ) &&\n    rectangle.width / texture.width > 1e-5\n  ) {\n    const that = this;\n    imagery.addReference();\n    const computeCommand = new ComputeCommand({\n      persists: true,\n      owner: this,\n      // Update render resources right before execution instead of now.\n      // This allows different ImageryLayers to share the same vao and buffers.\n      preExecute: function (command) {\n        reprojectToGeographic(command, context, texture, imagery.rectangle);\n      },\n      postExecute: function (outputTexture) {\n        imagery.texture = outputTexture;\n        that._finalizeReprojectTexture(context, outputTexture);\n        imagery.state = ImageryState.READY;\n        imagery.releaseReference();\n      },\n      canceled: function () {\n        imagery.state = ImageryState.TEXTURE_LOADED;\n        imagery.releaseReference();\n      },\n    });\n    this._reprojectComputeCommands.push(computeCommand);\n  } else {\n    if (needGeographicProjection) {\n      imagery.texture = texture;\n    }\n    this._finalizeReprojectTexture(context, texture);\n    imagery.state = ImageryState.READY;\n  }\n};\n\n/**\n * Updates frame state to execute any queued texture re-projections.\n *\n * @private\n *\n * @param {FrameState} frameState The frameState.\n */\nImageryLayer.prototype.queueReprojectionCommands = function (frameState) {\n  const computeCommands = this._reprojectComputeCommands;\n  const length = computeCommands.length;\n  for (let i = 0; i < length; ++i) {\n    frameState.commandList.push(computeCommands[i]);\n  }\n  computeCommands.length = 0;\n};\n\n/**\n * Cancels re-projection commands queued for the next frame.\n *\n * @private\n */\nImageryLayer.prototype.cancelReprojections = function () {\n  this._reprojectComputeCommands.forEach(function (command) {\n    if (defined(command.canceled)) {\n      command.canceled();\n    }\n  });\n  this._reprojectComputeCommands.length = 0;\n};\n\nImageryLayer.prototype.getImageryFromCache = function (\n  x,\n  y,\n  level,\n  imageryRectangle\n) {\n  const cacheKey = getImageryCacheKey(x, y, level);\n  let imagery = this._imageryCache[cacheKey];\n\n  if (!defined(imagery)) {\n    imagery = new Imagery(this, x, y, level, imageryRectangle);\n    this._imageryCache[cacheKey] = imagery;\n  }\n\n  imagery.addReference();\n  return imagery;\n};\n\nImageryLayer.prototype.removeImageryFromCache = function (imagery) {\n  const cacheKey = getImageryCacheKey(imagery.x, imagery.y, imagery.level);\n  delete this._imageryCache[cacheKey];\n};\n\nfunction getImageryCacheKey(x, y, level) {\n  return JSON.stringify([x, y, level]);\n}\n\nconst uniformMap = {\n  u_textureDimensions: function () {\n    return this.textureDimensions;\n  },\n  u_texture: function () {\n    return this.texture;\n  },\n\n  textureDimensions: new Cartesian2(),\n  texture: undefined,\n};\n\nconst float32ArrayScratch = FeatureDetection.supportsTypedArrays()\n  ? new Float32Array(2 * 64)\n  : undefined;\n\nfunction reprojectToGeographic(command, context, texture, rectangle) {\n  // This function has gone through a number of iterations, because GPUs are awesome.\n  //\n  // Originally, we had a very simple vertex shader and computed the Web Mercator texture coordinates\n  // per-fragment in the fragment shader.  That worked well, except on mobile devices, because\n  // fragment shaders have limited precision on many mobile devices.  The result was smearing artifacts\n  // at medium zoom levels because different geographic texture coordinates would be reprojected to Web\n  // Mercator as the same value.\n  //\n  // Our solution was to reproject to Web Mercator in the vertex shader instead of the fragment shader.\n  // This required far more vertex data.  With fragment shader reprojection, we only needed a single quad.\n  // But to achieve the same precision with vertex shader reprojection, we needed a vertex for each\n  // output pixel.  So we used a grid of 256x256 vertices, because most of our imagery\n  // tiles are 256x256.  Fortunately the grid could be created and uploaded to the GPU just once and\n  // re-used for all reprojections, so the performance was virtually unchanged from our original fragment\n  // shader approach.  See https://github.com/CesiumGS/cesium/pull/714.\n  //\n  // Over a year later, we noticed (https://github.com/CesiumGS/cesium/issues/2110)\n  // that our reprojection code was creating a rare but severe artifact on some GPUs (Intel HD 4600\n  // for one).  The problem was that the GLSL sin function on these GPUs had a discontinuity at fine scales in\n  // a few places.\n  //\n  // We solved this by implementing a more reliable sin function based on the CORDIC algorithm\n  // (https://github.com/CesiumGS/cesium/pull/2111).  Even though this was a fair\n  // amount of code to be executing per vertex, the performance seemed to be pretty good on most GPUs.\n  // Unfortunately, on some GPUs, the performance was absolutely terrible\n  // (https://github.com/CesiumGS/cesium/issues/2258).\n  //\n  // So that brings us to our current solution, the one you see here.  Effectively, we compute the Web\n  // Mercator texture coordinates on the CPU and store the T coordinate with each vertex (the S coordinate\n  // is the same in Geographic and Web Mercator).  To make this faster, we reduced our reprojection mesh\n  // to be only 2 vertices wide and 64 vertices high.  We should have reduced the width to 2 sooner,\n  // because the extra vertices weren't buying us anything.  The height of 64 means we are technically\n  // doing a slightly less accurate reprojection than we were before, but we can't see the difference\n  // so it's worth the 4x speedup.\n\n  let reproject = context.cache.imageryLayer_reproject;\n\n  if (!defined(reproject)) {\n    reproject = context.cache.imageryLayer_reproject = {\n      vertexArray: undefined,\n      shaderProgram: undefined,\n      sampler: undefined,\n      destroy: function () {\n        if (defined(this.framebuffer)) {\n          this.framebuffer.destroy();\n        }\n        if (defined(this.vertexArray)) {\n          this.vertexArray.destroy();\n        }\n        if (defined(this.shaderProgram)) {\n          this.shaderProgram.destroy();\n        }\n      },\n    };\n\n    const positions = new Float32Array(2 * 64 * 2);\n    let index = 0;\n    for (let j = 0; j < 64; ++j) {\n      const y = j / 63.0;\n      positions[index++] = 0.0;\n      positions[index++] = y;\n      positions[index++] = 1.0;\n      positions[index++] = y;\n    }\n\n    const reprojectAttributeIndices = {\n      position: 0,\n      webMercatorT: 1,\n    };\n\n    const indices = TerrainProvider.getRegularGridIndices(2, 64);\n    const indexBuffer = Buffer.createIndexBuffer({\n      context: context,\n      typedArray: indices,\n      usage: BufferUsage.STATIC_DRAW,\n      indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n    });\n\n    reproject.vertexArray = new VertexArray({\n      context: context,\n      attributes: [\n        {\n          index: reprojectAttributeIndices.position,\n          vertexBuffer: Buffer.createVertexBuffer({\n            context: context,\n            typedArray: positions,\n            usage: BufferUsage.STATIC_DRAW,\n          }),\n          componentsPerAttribute: 2,\n        },\n        {\n          index: reprojectAttributeIndices.webMercatorT,\n          vertexBuffer: Buffer.createVertexBuffer({\n            context: context,\n            sizeInBytes: 64 * 2 * 4,\n            usage: BufferUsage.STREAM_DRAW,\n          }),\n          componentsPerAttribute: 1,\n        },\n      ],\n      indexBuffer: indexBuffer,\n    });\n\n    const vs = new ShaderSource({\n      sources: [ReprojectWebMercatorVS],\n    });\n\n    reproject.shaderProgram = ShaderProgram.fromCache({\n      context: context,\n      vertexShaderSource: vs,\n      fragmentShaderSource: ReprojectWebMercatorFS,\n      attributeLocations: reprojectAttributeIndices,\n    });\n\n    reproject.sampler = new Sampler({\n      wrapS: TextureWrap.CLAMP_TO_EDGE,\n      wrapT: TextureWrap.CLAMP_TO_EDGE,\n      minificationFilter: TextureMinificationFilter.LINEAR,\n      magnificationFilter: TextureMagnificationFilter.LINEAR,\n    });\n  }\n\n  texture.sampler = reproject.sampler;\n\n  const width = texture.width;\n  const height = texture.height;\n\n  uniformMap.textureDimensions.x = width;\n  uniformMap.textureDimensions.y = height;\n  uniformMap.texture = texture;\n\n  let sinLatitude = Math.sin(rectangle.south);\n  const southMercatorY = 0.5 * Math.log((1 + sinLatitude) / (1 - sinLatitude));\n\n  sinLatitude = Math.sin(rectangle.north);\n  const northMercatorY = 0.5 * Math.log((1 + sinLatitude) / (1 - sinLatitude));\n  const oneOverMercatorHeight = 1.0 / (northMercatorY - southMercatorY);\n\n  const outputTexture = new Texture({\n    context: context,\n    width: width,\n    height: height,\n    pixelFormat: texture.pixelFormat,\n    pixelDatatype: texture.pixelDatatype,\n    preMultiplyAlpha: texture.preMultiplyAlpha,\n  });\n\n  // Allocate memory for the mipmaps.  Failure to do this before rendering\n  // to the texture via the FBO, and calling generateMipmap later,\n  // will result in the texture appearing blank.  I can't pretend to\n  // understand exactly why this is.\n  if (CesiumMath.isPowerOfTwo(width) && CesiumMath.isPowerOfTwo(height)) {\n    outputTexture.generateMipmap(MipmapHint.NICEST);\n  }\n\n  const south = rectangle.south;\n  const north = rectangle.north;\n\n  const webMercatorT = float32ArrayScratch;\n\n  let outputIndex = 0;\n  for (let webMercatorTIndex = 0; webMercatorTIndex < 64; ++webMercatorTIndex) {\n    const fraction = webMercatorTIndex / 63.0;\n    const latitude = CesiumMath.lerp(south, north, fraction);\n    sinLatitude = Math.sin(latitude);\n    const mercatorY = 0.5 * Math.log((1.0 + sinLatitude) / (1.0 - sinLatitude));\n    const mercatorFraction =\n      (mercatorY - southMercatorY) * oneOverMercatorHeight;\n    webMercatorT[outputIndex++] = mercatorFraction;\n    webMercatorT[outputIndex++] = mercatorFraction;\n  }\n\n  reproject.vertexArray\n    .getAttribute(1)\n    .vertexBuffer.copyFromArrayView(webMercatorT);\n\n  command.shaderProgram = reproject.shaderProgram;\n  command.outputTexture = outputTexture;\n  command.uniformMap = uniformMap;\n  command.vertexArray = reproject.vertexArray;\n}\n\n/**\n * Gets the level with the specified world coordinate spacing between texels, or less.\n *\n * @param {ImageryLayer} layer The imagery layer to use.\n * @param {number} texelSpacing The texel spacing for which to find a corresponding level.\n * @param {number} latitudeClosestToEquator The latitude closest to the equator that we're concerned with.\n * @returns {number} The level with the specified texel spacing or less.\n * @private\n */\nfunction getLevelWithMaximumTexelSpacing(\n  layer,\n  texelSpacing,\n  latitudeClosestToEquator\n) {\n  // PERFORMANCE_IDEA: factor out the stuff that doesn't change.\n  const imageryProvider = layer._imageryProvider;\n  const tilingScheme = imageryProvider.tilingScheme;\n  const ellipsoid = tilingScheme.ellipsoid;\n  const latitudeFactor = !(\n    layer._imageryProvider.tilingScheme.projection instanceof\n    GeographicProjection\n  )\n    ? Math.cos(latitudeClosestToEquator)\n    : 1.0;\n  const tilingSchemeRectangle = tilingScheme.rectangle;\n  const levelZeroMaximumTexelSpacing =\n    (ellipsoid.maximumRadius * tilingSchemeRectangle.width * latitudeFactor) /\n    (imageryProvider.tileWidth * tilingScheme.getNumberOfXTilesAtLevel(0));\n\n  const twoToTheLevelPower = levelZeroMaximumTexelSpacing / texelSpacing;\n  const level = Math.log(twoToTheLevelPower) / Math.log(2);\n  const rounded = Math.round(level);\n  return rounded | 0;\n}\n\nfunction handleError(errorEvent, error) {\n  if (errorEvent.numberOfListeners > 0) {\n    errorEvent.raiseEvent(error);\n  } else {\n    // Default handler is to log to the console\n    console.error(error);\n  }\n}\n\nasync function handlePromise(instance, promise) {\n  let provider;\n  try {\n    provider = await Promise.resolve(promise);\n    if (instance.isDestroyed()) {\n      return;\n    }\n    instance._imageryProvider = provider;\n    instance._readyEvent.raiseEvent(provider);\n  } catch (error) {\n    handleError(instance._errorEvent, error);\n  }\n}\n\nexport default ImageryLayer;\n\n/**\n * A function that is called when an error occurs.\n * @callback ImageryLayer.ErrorEventCallback\n *\n * @this ImageryLayer\n * @param {Error} err An object holding details about the error that occurred.\n */\n\n/**\n * A function that is called when the provider has been created\n * @callback ImageryLayer.ReadyEventCallback\n *\n * @this ImageryLayer\n * @param {ImageryProvider} provider The created imagery provider.\n */\n", "/**\n * @private\n */\nconst TileEdge = {\n  WEST: 0,\n  NORTH: 1,\n  EAST: 2,\n  SOUTH: 3,\n  NORTHWEST: 4,\n  NORTHEAST: 5,\n  SOUTHWEST: 6,\n  SOUTHEAST: 7,\n};\nexport default TileEdge;\n", "/**\n * Indicates what happened the last time this tile was visited for selection.\n * @private\n */\nconst TileSelectionResult = {\n  /**\n   * There was no selection result, perhaps because the tile wasn't visited\n   * last frame.\n   */\n  NONE: 0,\n\n  /**\n   * This tile was deemed not visible and culled.\n   */\n  CULLED: 1,\n\n  /**\n   * The tile was selected for rendering.\n   */\n  RENDERED: 2,\n\n  /**\n   * This tile did not meet the required screen-space error and was refined.\n   */\n  REFINED: 3,\n\n  /**\n   * This tile was originally rendered, but it got kicked out of the render list\n   * in favor of an ancestor because it is not yet renderable.\n   */\n  RENDERED_AND_KICKED: 2 | 4,\n\n  /**\n   * This tile was originally refined, but its rendered descendants got kicked out of the\n   * render list in favor of an ancestor because it is not yet renderable.\n   */\n  REFINED_AND_KICKED: 3 | 4,\n\n  /**\n   * This tile was culled because it was not visible, but it still needs to be loaded\n   * and any heights on it need to be updated because the camera's position or the\n   * camera's reference frame's origin falls inside this tile. Loading this tile\n   * could affect the position of the camera if the camera is currently below\n   * terrain or if it is tracking an object whose height is referenced to terrain.\n   * And a change in the camera position may, in turn, affect what is culled.\n   */\n  CULLED_BUT_NEEDED: 1 | 8,\n\n  /**\n   * Determines if a selection result indicates that this tile or its descendants were\n   * kicked from the render list. In other words, if it is <code>RENDERED_AND_KICKED</code>\n   * or <code>REFINED_AND_KICKED</code>.\n   *\n   * @param {TileSelectionResult} value The selection result to test.\n   * @returns {boolean} true if the tile was kicked, no matter if it was originally rendered or refined.\n   */\n  wasKicked: function (value) {\n    return value >= TileSelectionResult.RENDERED_AND_KICKED;\n  },\n\n  /**\n   * Determines the original selection result prior to being kicked or CULLED_BUT_NEEDED.\n   * If the tile wasn't kicked or CULLED_BUT_NEEDED, the original value is returned.\n   * @param {TileSelectionResult} value The selection result.\n   * @returns {TileSelectionResult} The original selection result prior to kicking.\n   */\n  originalResult: function (value) {\n    return value & 3;\n  },\n\n  /**\n   * Converts this selection result to a kick.\n   * @param {TileSelectionResult} value The original selection result.\n   * @returns {TileSelectionResult} The kicked form of the selection result.\n   */\n  kick: function (value) {\n    return value | 4;\n  },\n};\nexport default TileSelectionResult;\n", "import AttributeCompression from \"../Core/AttributeCompression.js\";\nimport binarySearch from \"../Core/binarySearch.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport HeightmapTerrainData from \"../Core/HeightmapTerrainData.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport Queue from \"../Core/Queue.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport TerrainEncoding from \"../Core/TerrainEncoding.js\";\nimport TerrainMesh from \"../Core/TerrainMesh.js\";\nimport TileEdge from \"../Core/TileEdge.js\";\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\nimport GlobeSurfaceTile from \"./GlobeSurfaceTile.js\";\nimport TileSelectionResult from \"./TileSelectionResult.js\";\n\nfunction TerrainFillMesh(tile) {\n  this.tile = tile;\n  this.frameLastUpdated = undefined;\n  this.westMeshes = []; // north to south (CCW)\n  this.westTiles = [];\n  this.southMeshes = []; // west to east (CCW)\n  this.southTiles = [];\n  this.eastMeshes = []; // south to north (CCW)\n  this.eastTiles = [];\n  this.northMeshes = []; // east to west (CCW)\n  this.northTiles = [];\n  this.southwestMesh = undefined;\n  this.southwestTile = undefined;\n  this.southeastMesh = undefined;\n  this.southeastTile = undefined;\n  this.northwestMesh = undefined;\n  this.northwestTile = undefined;\n  this.northeastMesh = undefined;\n  this.northeastTile = undefined;\n  this.changedThisFrame = true;\n  this.visitedFrame = undefined;\n  this.enqueuedFrame = undefined;\n  this.mesh = undefined;\n  this.vertexArray = undefined;\n  this.waterMaskTexture = undefined;\n  this.waterMaskTranslationAndScale = new Cartesian4();\n}\n\nTerrainFillMesh.prototype.update = function (\n  tileProvider,\n  frameState,\n  vertexArraysToDestroy\n) {\n  if (this.changedThisFrame) {\n    createFillMesh(tileProvider, frameState, this.tile, vertexArraysToDestroy);\n    this.changedThisFrame = false;\n  }\n};\n\nTerrainFillMesh.prototype.destroy = function (vertexArraysToDestroy) {\n  this._destroyVertexArray(vertexArraysToDestroy);\n\n  if (defined(this.waterMaskTexture)) {\n    --this.waterMaskTexture.referenceCount;\n    if (this.waterMaskTexture.referenceCount === 0) {\n      this.waterMaskTexture.destroy();\n    }\n    this.waterMaskTexture = undefined;\n  }\n\n  return undefined;\n};\n\nTerrainFillMesh.prototype._destroyVertexArray = function (\n  vertexArraysToDestroy\n) {\n  if (defined(this.vertexArray)) {\n    if (defined(vertexArraysToDestroy)) {\n      vertexArraysToDestroy.push(this.vertexArray);\n    } else {\n      GlobeSurfaceTile._freeVertexArray(this.vertexArray);\n    }\n    this.vertexArray = undefined;\n  }\n};\n\nconst traversalQueueScratch = new Queue();\n\nTerrainFillMesh.updateFillTiles = function (\n  tileProvider,\n  renderedTiles,\n  frameState,\n  vertexArraysToDestroy\n) {\n  // We want our fill tiles to look natural, which means they should align perfectly with\n  // adjacent loaded tiles, and their edges that are not adjacent to loaded tiles should have\n  // sensible heights (e.g. the average of the heights of loaded edges). Some fill tiles may\n  // be adjacent only to other fill tiles, and in that case heights should be assigned fanning\n  // outward from the loaded tiles so that there are no sudden changes in height.\n\n  // We do this with a breadth-first traversal of the rendered tiles, starting with the loaded\n  // ones. Graph nodes are tiles and graph edges connect to other rendered tiles that are spatially adjacent\n  // to those tiles. As we visit each node, we propagate tile edges to adjacent tiles. If there's no data\n  // for a tile edge,  we create an edge with an average height and then propagate it. If an edge is partially defined\n  // (e.g. an edge is adjacent to multiple more-detailed tiles and only some of them are loaded), we\n  // fill in the rest of the edge with the same height.\n  const quadtree = tileProvider._quadtree;\n  const levelZeroTiles = quadtree._levelZeroTiles;\n  const lastSelectionFrameNumber = quadtree._lastSelectionFrameNumber;\n\n  const traversalQueue = traversalQueueScratch;\n  traversalQueue.clear();\n\n  // Add the tiles with real geometry to the traversal queue.\n  for (let i = 0; i < renderedTiles.length; ++i) {\n    const renderedTile = renderedTiles[i];\n    if (defined(renderedTile.data.vertexArray)) {\n      traversalQueue.enqueue(renderedTiles[i]);\n    }\n  }\n\n  let tile = traversalQueue.dequeue();\n\n  while (tile !== undefined) {\n    const tileToWest = tile.findTileToWest(levelZeroTiles);\n    const tileToSouth = tile.findTileToSouth(levelZeroTiles);\n    const tileToEast = tile.findTileToEast(levelZeroTiles);\n    const tileToNorth = tile.findTileToNorth(levelZeroTiles);\n    visitRenderedTiles(\n      tileProvider,\n      frameState,\n      tile,\n      tileToWest,\n      lastSelectionFrameNumber,\n      TileEdge.EAST,\n      false,\n      traversalQueue,\n      vertexArraysToDestroy\n    );\n    visitRenderedTiles(\n      tileProvider,\n      frameState,\n      tile,\n      tileToSouth,\n      lastSelectionFrameNumber,\n      TileEdge.NORTH,\n      false,\n      traversalQueue,\n      vertexArraysToDestroy\n    );\n    visitRenderedTiles(\n      tileProvider,\n      frameState,\n      tile,\n      tileToEast,\n      lastSelectionFrameNumber,\n      TileEdge.WEST,\n      false,\n      traversalQueue,\n      vertexArraysToDestroy\n    );\n    visitRenderedTiles(\n      tileProvider,\n      frameState,\n      tile,\n      tileToNorth,\n      lastSelectionFrameNumber,\n      TileEdge.SOUTH,\n      false,\n      traversalQueue,\n      vertexArraysToDestroy\n    );\n\n    const tileToNorthwest = tileToWest.findTileToNorth(levelZeroTiles);\n    const tileToSouthwest = tileToWest.findTileToSouth(levelZeroTiles);\n    const tileToNortheast = tileToEast.findTileToNorth(levelZeroTiles);\n    const tileToSoutheast = tileToEast.findTileToSouth(levelZeroTiles);\n    visitRenderedTiles(\n      tileProvider,\n      frameState,\n      tile,\n      tileToNorthwest,\n      lastSelectionFrameNumber,\n      TileEdge.SOUTHEAST,\n      false,\n      traversalQueue,\n      vertexArraysToDestroy\n    );\n    visitRenderedTiles(\n      tileProvider,\n      frameState,\n      tile,\n      tileToNortheast,\n      lastSelectionFrameNumber,\n      TileEdge.SOUTHWEST,\n      false,\n      traversalQueue,\n      vertexArraysToDestroy\n    );\n    visitRenderedTiles(\n      tileProvider,\n      frameState,\n      tile,\n      tileToSouthwest,\n      lastSelectionFrameNumber,\n      TileEdge.NORTHEAST,\n      false,\n      traversalQueue,\n      vertexArraysToDestroy\n    );\n    visitRenderedTiles(\n      tileProvider,\n      frameState,\n      tile,\n      tileToSoutheast,\n      lastSelectionFrameNumber,\n      TileEdge.NORTHWEST,\n      false,\n      traversalQueue,\n      vertexArraysToDestroy\n    );\n\n    tile = traversalQueue.dequeue();\n  }\n};\n\nfunction visitRenderedTiles(\n  tileProvider,\n  frameState,\n  sourceTile,\n  startTile,\n  currentFrameNumber,\n  tileEdge,\n  downOnly,\n  traversalQueue,\n  vertexArraysToDestroy\n) {\n  if (startTile === undefined) {\n    // There are no tiles North or South of the poles.\n    return;\n  }\n\n  let tile = startTile;\n  while (\n    tile &&\n    (tile._lastSelectionResultFrame !== currentFrameNumber ||\n      TileSelectionResult.wasKicked(tile._lastSelectionResult) ||\n      TileSelectionResult.originalResult(tile._lastSelectionResult) ===\n        TileSelectionResult.CULLED)\n  ) {\n    // This tile wasn't visited or it was visited and then kicked, so walk up to find the closest ancestor that was rendered.\n    // We also walk up if the tile was culled, because if siblings were kicked an ancestor may have been rendered.\n    if (downOnly) {\n      return;\n    }\n\n    const parent = tile.parent;\n    if (tileEdge >= TileEdge.NORTHWEST && parent !== undefined) {\n      // When we're looking for a corner, verify that the parent tile is still relevant.\n      // That is, the parent and child must share the corner in question.\n      switch (tileEdge) {\n        case TileEdge.NORTHWEST:\n          tile = tile === parent.northwestChild ? parent : undefined;\n          break;\n        case TileEdge.NORTHEAST:\n          tile = tile === parent.northeastChild ? parent : undefined;\n          break;\n        case TileEdge.SOUTHWEST:\n          tile = tile === parent.southwestChild ? parent : undefined;\n          break;\n        case TileEdge.SOUTHEAST:\n          tile = tile === parent.southeastChild ? parent : undefined;\n          break;\n      }\n    } else {\n      tile = parent;\n    }\n  }\n\n  if (tile === undefined) {\n    return;\n  }\n\n  if (tile._lastSelectionResult === TileSelectionResult.RENDERED) {\n    if (defined(tile.data.vertexArray)) {\n      // No further processing necessary for renderable tiles.\n      return;\n    }\n    visitTile(\n      tileProvider,\n      frameState,\n      sourceTile,\n      tile,\n      tileEdge,\n      currentFrameNumber,\n      traversalQueue,\n      vertexArraysToDestroy\n    );\n    return;\n  }\n\n  if (\n    TileSelectionResult.originalResult(startTile._lastSelectionResult) ===\n    TileSelectionResult.CULLED\n  ) {\n    return;\n  }\n\n  // This tile was refined, so find rendered children, if any.\n  // Visit the tiles in counter-clockwise order.\n  switch (tileEdge) {\n    case TileEdge.WEST:\n      visitRenderedTiles(\n        tileProvider,\n        frameState,\n        sourceTile,\n        startTile.northwestChild,\n        currentFrameNumber,\n        tileEdge,\n        true,\n        traversalQueue,\n        vertexArraysToDestroy\n      );\n      visitRenderedTiles(\n        tileProvider,\n        frameState,\n        sourceTile,\n        startTile.southwestChild,\n        currentFrameNumber,\n        tileEdge,\n        true,\n        traversalQueue,\n        vertexArraysToDestroy\n      );\n      break;\n    case TileEdge.EAST:\n      visitRenderedTiles(\n        tileProvider,\n        frameState,\n        sourceTile,\n        startTile.southeastChild,\n        currentFrameNumber,\n        tileEdge,\n        true,\n        traversalQueue,\n        vertexArraysToDestroy\n      );\n      visitRenderedTiles(\n        tileProvider,\n        frameState,\n        sourceTile,\n        startTile.northeastChild,\n        currentFrameNumber,\n        tileEdge,\n        true,\n        traversalQueue,\n        vertexArraysToDestroy\n      );\n      break;\n    case TileEdge.SOUTH:\n      visitRenderedTiles(\n        tileProvider,\n        frameState,\n        sourceTile,\n        startTile.southwestChild,\n        currentFrameNumber,\n        tileEdge,\n        true,\n        traversalQueue,\n        vertexArraysToDestroy\n      );\n      visitRenderedTiles(\n        tileProvider,\n        frameState,\n        sourceTile,\n        startTile.southeastChild,\n        currentFrameNumber,\n        tileEdge,\n        true,\n        traversalQueue,\n        vertexArraysToDestroy\n      );\n      break;\n    case TileEdge.NORTH:\n      visitRenderedTiles(\n        tileProvider,\n        frameState,\n        sourceTile,\n        startTile.northeastChild,\n        currentFrameNumber,\n        tileEdge,\n        true,\n        traversalQueue,\n        vertexArraysToDestroy\n      );\n      visitRenderedTiles(\n        tileProvider,\n        frameState,\n        sourceTile,\n        startTile.northwestChild,\n        currentFrameNumber,\n        tileEdge,\n        true,\n        traversalQueue,\n        vertexArraysToDestroy\n      );\n      break;\n    case TileEdge.NORTHWEST:\n      visitRenderedTiles(\n        tileProvider,\n        frameState,\n        sourceTile,\n        startTile.northwestChild,\n        currentFrameNumber,\n        tileEdge,\n        true,\n        traversalQueue,\n        vertexArraysToDestroy\n      );\n      break;\n    case TileEdge.NORTHEAST:\n      visitRenderedTiles(\n        tileProvider,\n        frameState,\n        sourceTile,\n        startTile.northeastChild,\n        currentFrameNumber,\n        tileEdge,\n        true,\n        traversalQueue,\n        vertexArraysToDestroy\n      );\n      break;\n    case TileEdge.SOUTHWEST:\n      visitRenderedTiles(\n        tileProvider,\n        frameState,\n        sourceTile,\n        startTile.southwestChild,\n        currentFrameNumber,\n        tileEdge,\n        true,\n        traversalQueue,\n        vertexArraysToDestroy\n      );\n      break;\n    case TileEdge.SOUTHEAST:\n      visitRenderedTiles(\n        tileProvider,\n        frameState,\n        sourceTile,\n        startTile.southeastChild,\n        currentFrameNumber,\n        tileEdge,\n        true,\n        traversalQueue,\n        vertexArraysToDestroy\n      );\n      break;\n    default:\n      throw new DeveloperError(\"Invalid edge\");\n  }\n}\n\nfunction visitTile(\n  tileProvider,\n  frameState,\n  sourceTile,\n  destinationTile,\n  tileEdge,\n  frameNumber,\n  traversalQueue,\n  vertexArraysToDestroy\n) {\n  const destinationSurfaceTile = destinationTile.data;\n\n  if (destinationSurfaceTile.fill === undefined) {\n    destinationSurfaceTile.fill = new TerrainFillMesh(destinationTile);\n  } else if (destinationSurfaceTile.fill.visitedFrame === frameNumber) {\n    // Don't propagate edges to tiles that have already been visited this frame.\n    return;\n  }\n\n  if (destinationSurfaceTile.fill.enqueuedFrame !== frameNumber) {\n    // First time visiting this tile this frame, add it to the traversal queue.\n    destinationSurfaceTile.fill.enqueuedFrame = frameNumber;\n    destinationSurfaceTile.fill.changedThisFrame = false;\n    traversalQueue.enqueue(destinationTile);\n  }\n\n  propagateEdge(\n    tileProvider,\n    frameState,\n    sourceTile,\n    destinationTile,\n    tileEdge,\n    vertexArraysToDestroy\n  );\n}\n\nfunction propagateEdge(\n  tileProvider,\n  frameState,\n  sourceTile,\n  destinationTile,\n  tileEdge,\n  vertexArraysToDestroy\n) {\n  const destinationFill = destinationTile.data.fill;\n\n  let sourceMesh;\n  const sourceFill = sourceTile.data.fill;\n  if (defined(sourceFill)) {\n    sourceFill.visitedFrame = frameState.frameNumber;\n\n    // Source is a fill, create/update it if necessary.\n    if (sourceFill.changedThisFrame) {\n      createFillMesh(\n        tileProvider,\n        frameState,\n        sourceTile,\n        vertexArraysToDestroy\n      );\n      sourceFill.changedThisFrame = false;\n    }\n    sourceMesh = sourceTile.data.fill.mesh;\n  } else {\n    sourceMesh = sourceTile.data.mesh;\n  }\n\n  let edgeMeshes;\n  let edgeTiles;\n\n  switch (tileEdge) {\n    case TileEdge.WEST:\n      edgeMeshes = destinationFill.westMeshes;\n      edgeTiles = destinationFill.westTiles;\n      break;\n    case TileEdge.SOUTH:\n      edgeMeshes = destinationFill.southMeshes;\n      edgeTiles = destinationFill.southTiles;\n      break;\n    case TileEdge.EAST:\n      edgeMeshes = destinationFill.eastMeshes;\n      edgeTiles = destinationFill.eastTiles;\n      break;\n    case TileEdge.NORTH:\n      edgeMeshes = destinationFill.northMeshes;\n      edgeTiles = destinationFill.northTiles;\n      break;\n    // Corners are simpler.\n    case TileEdge.NORTHWEST:\n      destinationFill.changedThisFrame =\n        destinationFill.changedThisFrame ||\n        destinationFill.northwestMesh !== sourceMesh;\n      destinationFill.northwestMesh = sourceMesh;\n      destinationFill.northwestTile = sourceTile;\n      return;\n    case TileEdge.NORTHEAST:\n      destinationFill.changedThisFrame =\n        destinationFill.changedThisFrame ||\n        destinationFill.northeastMesh !== sourceMesh;\n      destinationFill.northeastMesh = sourceMesh;\n      destinationFill.northeastTile = sourceTile;\n      return;\n    case TileEdge.SOUTHWEST:\n      destinationFill.changedThisFrame =\n        destinationFill.changedThisFrame ||\n        destinationFill.southwestMesh !== sourceMesh;\n      destinationFill.southwestMesh = sourceMesh;\n      destinationFill.southwestTile = sourceTile;\n      return;\n    case TileEdge.SOUTHEAST:\n      destinationFill.changedThisFrame =\n        destinationFill.changedThisFrame ||\n        destinationFill.southeastMesh !== sourceMesh;\n      destinationFill.southeastMesh = sourceMesh;\n      destinationFill.southeastTile = sourceTile;\n      return;\n  }\n\n  if (sourceTile.level <= destinationTile.level) {\n    // Source edge completely spans the destination edge.\n    destinationFill.changedThisFrame =\n      destinationFill.changedThisFrame ||\n      edgeMeshes[0] !== sourceMesh ||\n      edgeMeshes.length !== 1;\n    edgeMeshes[0] = sourceMesh;\n    edgeTiles[0] = sourceTile;\n    edgeMeshes.length = 1;\n    edgeTiles.length = 1;\n    return;\n  }\n\n  // Source edge is a subset of the destination edge.\n  // Figure out the range of meshes we're replacing.\n  let startIndex, endIndex, existingTile, existingRectangle;\n  const sourceRectangle = sourceTile.rectangle;\n\n  let epsilon;\n  const destinationRectangle = destinationTile.rectangle;\n\n  switch (tileEdge) {\n    case TileEdge.WEST:\n      epsilon =\n        (destinationRectangle.north - destinationRectangle.south) *\n        CesiumMath.EPSILON5;\n\n      for (startIndex = 0; startIndex < edgeTiles.length; ++startIndex) {\n        existingTile = edgeTiles[startIndex];\n        existingRectangle = existingTile.rectangle;\n        if (\n          CesiumMath.greaterThan(\n            sourceRectangle.north,\n            existingRectangle.south,\n            epsilon\n          )\n        ) {\n          break;\n        }\n      }\n      for (endIndex = startIndex; endIndex < edgeTiles.length; ++endIndex) {\n        existingTile = edgeTiles[endIndex];\n        existingRectangle = existingTile.rectangle;\n        if (\n          CesiumMath.greaterThanOrEquals(\n            sourceRectangle.south,\n            existingRectangle.north,\n            epsilon\n          )\n        ) {\n          break;\n        }\n      }\n      break;\n    case TileEdge.SOUTH:\n      epsilon =\n        (destinationRectangle.east - destinationRectangle.west) *\n        CesiumMath.EPSILON5;\n\n      for (startIndex = 0; startIndex < edgeTiles.length; ++startIndex) {\n        existingTile = edgeTiles[startIndex];\n        existingRectangle = existingTile.rectangle;\n        if (\n          CesiumMath.lessThan(\n            sourceRectangle.west,\n            existingRectangle.east,\n            epsilon\n          )\n        ) {\n          break;\n        }\n      }\n      for (endIndex = startIndex; endIndex < edgeTiles.length; ++endIndex) {\n        existingTile = edgeTiles[endIndex];\n        existingRectangle = existingTile.rectangle;\n        if (\n          CesiumMath.lessThanOrEquals(\n            sourceRectangle.east,\n            existingRectangle.west,\n            epsilon\n          )\n        ) {\n          break;\n        }\n      }\n      break;\n    case TileEdge.EAST:\n      epsilon =\n        (destinationRectangle.north - destinationRectangle.south) *\n        CesiumMath.EPSILON5;\n\n      for (startIndex = 0; startIndex < edgeTiles.length; ++startIndex) {\n        existingTile = edgeTiles[startIndex];\n        existingRectangle = existingTile.rectangle;\n        if (\n          CesiumMath.lessThan(\n            sourceRectangle.south,\n            existingRectangle.north,\n            epsilon\n          )\n        ) {\n          break;\n        }\n      }\n      for (endIndex = startIndex; endIndex < edgeTiles.length; ++endIndex) {\n        existingTile = edgeTiles[endIndex];\n        existingRectangle = existingTile.rectangle;\n        if (\n          CesiumMath.lessThanOrEquals(\n            sourceRectangle.north,\n            existingRectangle.south,\n            epsilon\n          )\n        ) {\n          break;\n        }\n      }\n      break;\n    case TileEdge.NORTH:\n      epsilon =\n        (destinationRectangle.east - destinationRectangle.west) *\n        CesiumMath.EPSILON5;\n\n      for (startIndex = 0; startIndex < edgeTiles.length; ++startIndex) {\n        existingTile = edgeTiles[startIndex];\n        existingRectangle = existingTile.rectangle;\n        if (\n          CesiumMath.greaterThan(\n            sourceRectangle.east,\n            existingRectangle.west,\n            epsilon\n          )\n        ) {\n          break;\n        }\n      }\n      for (endIndex = startIndex; endIndex < edgeTiles.length; ++endIndex) {\n        existingTile = edgeTiles[endIndex];\n        existingRectangle = existingTile.rectangle;\n        if (\n          CesiumMath.greaterThanOrEquals(\n            sourceRectangle.west,\n            existingRectangle.east,\n            epsilon\n          )\n        ) {\n          break;\n        }\n      }\n      break;\n  }\n\n  if (endIndex - startIndex === 1) {\n    destinationFill.changedThisFrame =\n      destinationFill.changedThisFrame || edgeMeshes[startIndex] !== sourceMesh;\n    edgeMeshes[startIndex] = sourceMesh;\n    edgeTiles[startIndex] = sourceTile;\n  } else {\n    destinationFill.changedThisFrame = true;\n    edgeMeshes.splice(startIndex, endIndex - startIndex, sourceMesh);\n    edgeTiles.splice(startIndex, endIndex - startIndex, sourceTile);\n  }\n}\n\nconst cartographicScratch = new Cartographic();\nconst centerCartographicScratch = new Cartographic();\nconst cartesianScratch = new Cartesian3();\nconst normalScratch = new Cartesian3();\nconst octEncodedNormalScratch = new Cartesian2();\nconst uvScratch2 = new Cartesian2();\nconst uvScratch = new Cartesian2();\n\nfunction HeightAndNormal() {\n  this.height = 0.0;\n  this.encodedNormal = new Cartesian2();\n}\n\nfunction fillMissingCorner(\n  fill,\n  ellipsoid,\n  u,\n  v,\n  corner,\n  adjacentCorner1,\n  adjacentCorner2,\n  oppositeCorner,\n  vertex\n) {\n  if (defined(corner)) {\n    return corner;\n  }\n\n  let height;\n\n  if (defined(adjacentCorner1) && defined(adjacentCorner2)) {\n    height = (adjacentCorner1.height + adjacentCorner2.height) * 0.5;\n  } else if (defined(adjacentCorner1)) {\n    height = adjacentCorner1.height;\n  } else if (defined(adjacentCorner2)) {\n    height = adjacentCorner2.height;\n  } else if (defined(oppositeCorner)) {\n    height = oppositeCorner.height;\n  } else {\n    const surfaceTile = fill.tile.data;\n    const tileBoundingRegion = surfaceTile.tileBoundingRegion;\n    let minimumHeight = 0.0;\n    let maximumHeight = 0.0;\n    if (defined(tileBoundingRegion)) {\n      minimumHeight = tileBoundingRegion.minimumHeight;\n      maximumHeight = tileBoundingRegion.maximumHeight;\n    }\n    height = (minimumHeight + maximumHeight) * 0.5;\n  }\n\n  getVertexWithHeightAtCorner(fill, ellipsoid, u, v, height, vertex);\n  return vertex;\n}\n\nconst heightRangeScratch = {\n  minimumHeight: 0.0,\n  maximumHeight: 0.0,\n};\n\nconst scratchCenter = new Cartesian3();\nconst swVertexScratch = new HeightAndNormal();\nconst seVertexScratch = new HeightAndNormal();\nconst nwVertexScratch = new HeightAndNormal();\nconst neVertexScratch = new HeightAndNormal();\nconst heightmapBuffer =\n  typeof Uint8Array !== \"undefined\" ? new Uint8Array(9 * 9) : undefined;\n\nconst scratchCreateMeshSyncOptions = {\n  tilingScheme: undefined,\n  x: 0,\n  y: 0,\n  level: 0,\n  exaggeration: 1.0,\n  exaggerationRelativeHeight: 0.0,\n};\nfunction createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) {\n  GlobeSurfaceTile.initialize(\n    tile,\n    tileProvider.terrainProvider,\n    tileProvider._imageryLayers\n  );\n\n  const surfaceTile = tile.data;\n  const fill = surfaceTile.fill;\n  const rectangle = tile.rectangle;\n\n  const exaggeration = frameState.verticalExaggeration;\n  const exaggerationRelativeHeight =\n    frameState.verticalExaggerationRelativeHeight;\n  const hasExaggeration = exaggeration !== 1.0;\n\n  const ellipsoid = tile.tilingScheme.ellipsoid;\n\n  let nwCorner = getCorner(\n    fill,\n    ellipsoid,\n    0.0,\n    1.0,\n    fill.northwestTile,\n    fill.northwestMesh,\n    fill.northTiles,\n    fill.northMeshes,\n    fill.westTiles,\n    fill.westMeshes,\n    nwVertexScratch\n  );\n  let swCorner = getCorner(\n    fill,\n    ellipsoid,\n    0.0,\n    0.0,\n    fill.southwestTile,\n    fill.southwestMesh,\n    fill.westTiles,\n    fill.westMeshes,\n    fill.southTiles,\n    fill.southMeshes,\n    swVertexScratch\n  );\n  let seCorner = getCorner(\n    fill,\n    ellipsoid,\n    1.0,\n    0.0,\n    fill.southeastTile,\n    fill.southeastMesh,\n    fill.southTiles,\n    fill.southMeshes,\n    fill.eastTiles,\n    fill.eastMeshes,\n    seVertexScratch\n  );\n  let neCorner = getCorner(\n    fill,\n    ellipsoid,\n    1.0,\n    1.0,\n    fill.northeastTile,\n    fill.northeastMesh,\n    fill.eastTiles,\n    fill.eastMeshes,\n    fill.northTiles,\n    fill.northMeshes,\n    neVertexScratch\n  );\n\n  nwCorner = fillMissingCorner(\n    fill,\n    ellipsoid,\n    0.0,\n    1.0,\n    nwCorner,\n    swCorner,\n    neCorner,\n    seCorner,\n    nwVertexScratch\n  );\n  swCorner = fillMissingCorner(\n    fill,\n    ellipsoid,\n    0.0,\n    0.0,\n    swCorner,\n    nwCorner,\n    seCorner,\n    neCorner,\n    swVertexScratch\n  );\n  seCorner = fillMissingCorner(\n    fill,\n    ellipsoid,\n    1.0,\n    1.0,\n    seCorner,\n    swCorner,\n    neCorner,\n    nwCorner,\n    seVertexScratch\n  );\n  neCorner = fillMissingCorner(\n    fill,\n    ellipsoid,\n    1.0,\n    1.0,\n    neCorner,\n    seCorner,\n    nwCorner,\n    swCorner,\n    neVertexScratch\n  );\n\n  const southwestHeight = swCorner.height;\n  const southeastHeight = seCorner.height;\n  const northwestHeight = nwCorner.height;\n  const northeastHeight = neCorner.height;\n\n  let minimumHeight = Math.min(\n    southwestHeight,\n    southeastHeight,\n    northwestHeight,\n    northeastHeight\n  );\n  let maximumHeight = Math.max(\n    southwestHeight,\n    southeastHeight,\n    northwestHeight,\n    northeastHeight\n  );\n\n  const middleHeight = (minimumHeight + maximumHeight) * 0.5;\n\n  let i;\n  let len;\n\n  // For low-detail tiles, our usual fill tile approach will create tiles that\n  // look really blocky because they don't have enough vertices to account for the\n  // Earth's curvature. But the height range will also typically be well within\n  // the allowed geometric error for those levels. So fill such tiles with a\n  // constant-height heightmap.\n  const geometricError = tileProvider.getLevelMaximumGeometricError(tile.level);\n  const minCutThroughRadius = ellipsoid.maximumRadius - geometricError;\n  let maxTileWidth =\n    Math.acos(minCutThroughRadius / ellipsoid.maximumRadius) * 4.0;\n\n  // When the tile width is greater than maxTileWidth as computed above, the error\n  // of a normal fill tile from globe curvature alone will exceed the allowed geometric\n  // error. Terrain won't change that much. However, we can allow more error than that.\n  // A little blockiness during load is acceptable. For the WGS84 ellipsoid and\n  // standard geometric error setup, the value here will have us use a heightmap\n  // at levels 1, 2, and 3.\n  maxTileWidth *= 1.5;\n\n  if (\n    rectangle.width > maxTileWidth &&\n    maximumHeight - minimumHeight <= geometricError\n  ) {\n    const terrainData = new HeightmapTerrainData({\n      width: 9,\n      height: 9,\n      buffer: heightmapBuffer,\n      structure: {\n        // Use the maximum as the constant height so that this tile's skirt\n        // covers any cracks with adjacent tiles.\n        heightOffset: maximumHeight,\n      },\n    });\n\n    const createMeshSyncOptions = scratchCreateMeshSyncOptions;\n    createMeshSyncOptions.tilingScheme = tile.tilingScheme;\n    createMeshSyncOptions.x = tile.x;\n    createMeshSyncOptions.y = tile.y;\n    createMeshSyncOptions.level = tile.level;\n    createMeshSyncOptions.exaggeration = exaggeration;\n    createMeshSyncOptions.exaggerationRelativeHeight = exaggerationRelativeHeight;\n\n    fill.mesh = terrainData._createMeshSync(createMeshSyncOptions);\n  } else {\n    const hasGeodeticSurfaceNormals = hasExaggeration;\n    const centerCartographic = Rectangle.center(\n      rectangle,\n      centerCartographicScratch\n    );\n    centerCartographic.height = middleHeight;\n    const center = ellipsoid.cartographicToCartesian(\n      centerCartographic,\n      scratchCenter\n    );\n    const encoding = new TerrainEncoding(\n      center,\n      undefined,\n      undefined,\n      undefined,\n      undefined,\n      true,\n      true,\n      hasGeodeticSurfaceNormals,\n      exaggeration,\n      exaggerationRelativeHeight\n    );\n\n    // At _most_, we have vertices for the 4 corners, plus 1 center, plus every adjacent edge vertex.\n    // In reality there will be less most of the time, but close enough; better\n    // to overestimate than to re-allocate/copy/traverse the vertices twice.\n    // Also, we'll often be able to squeeze the index data into the extra space in the buffer.\n    let maxVertexCount = 5;\n    let meshes;\n\n    meshes = fill.westMeshes;\n    for (i = 0, len = meshes.length; i < len; ++i) {\n      maxVertexCount += meshes[i].eastIndicesNorthToSouth.length;\n    }\n\n    meshes = fill.southMeshes;\n    for (i = 0, len = meshes.length; i < len; ++i) {\n      maxVertexCount += meshes[i].northIndicesWestToEast.length;\n    }\n\n    meshes = fill.eastMeshes;\n    for (i = 0, len = meshes.length; i < len; ++i) {\n      maxVertexCount += meshes[i].westIndicesSouthToNorth.length;\n    }\n\n    meshes = fill.northMeshes;\n    for (i = 0, len = meshes.length; i < len; ++i) {\n      maxVertexCount += meshes[i].southIndicesEastToWest.length;\n    }\n\n    const heightRange = heightRangeScratch;\n    heightRange.minimumHeight = minimumHeight;\n    heightRange.maximumHeight = maximumHeight;\n\n    const stride = encoding.stride;\n    let typedArray = new Float32Array(maxVertexCount * stride);\n\n    let nextIndex = 0;\n    const northwestIndex = nextIndex;\n    nextIndex = addVertexWithComputedPosition(\n      ellipsoid,\n      rectangle,\n      encoding,\n      typedArray,\n      nextIndex,\n      0.0,\n      1.0,\n      nwCorner.height,\n      nwCorner.encodedNormal,\n      1.0,\n      heightRange\n    );\n    nextIndex = addEdge(\n      fill,\n      ellipsoid,\n      encoding,\n      typedArray,\n      nextIndex,\n      fill.westTiles,\n      fill.westMeshes,\n      TileEdge.EAST,\n      heightRange\n    );\n    const southwestIndex = nextIndex;\n    nextIndex = addVertexWithComputedPosition(\n      ellipsoid,\n      rectangle,\n      encoding,\n      typedArray,\n      nextIndex,\n      0.0,\n      0.0,\n      swCorner.height,\n      swCorner.encodedNormal,\n      0.0,\n      heightRange\n    );\n    nextIndex = addEdge(\n      fill,\n      ellipsoid,\n      encoding,\n      typedArray,\n      nextIndex,\n      fill.southTiles,\n      fill.southMeshes,\n      TileEdge.NORTH,\n      heightRange\n    );\n    const southeastIndex = nextIndex;\n    nextIndex = addVertexWithComputedPosition(\n      ellipsoid,\n      rectangle,\n      encoding,\n      typedArray,\n      nextIndex,\n      1.0,\n      0.0,\n      seCorner.height,\n      seCorner.encodedNormal,\n      0.0,\n      heightRange\n    );\n    nextIndex = addEdge(\n      fill,\n      ellipsoid,\n      encoding,\n      typedArray,\n      nextIndex,\n      fill.eastTiles,\n      fill.eastMeshes,\n      TileEdge.WEST,\n      heightRange\n    );\n    const northeastIndex = nextIndex;\n    nextIndex = addVertexWithComputedPosition(\n      ellipsoid,\n      rectangle,\n      encoding,\n      typedArray,\n      nextIndex,\n      1.0,\n      1.0,\n      neCorner.height,\n      neCorner.encodedNormal,\n      1.0,\n      heightRange\n    );\n    nextIndex = addEdge(\n      fill,\n      ellipsoid,\n      encoding,\n      typedArray,\n      nextIndex,\n      fill.northTiles,\n      fill.northMeshes,\n      TileEdge.SOUTH,\n      heightRange\n    );\n\n    minimumHeight = heightRange.minimumHeight;\n    maximumHeight = heightRange.maximumHeight;\n\n    const obb = OrientedBoundingBox.fromRectangle(\n      rectangle,\n      minimumHeight,\n      maximumHeight,\n      tile.tilingScheme.ellipsoid\n    );\n\n    // Add a single vertex at the center of the tile.\n    const southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle(\n      rectangle.south\n    );\n    const oneOverMercatorHeight =\n      1.0 /\n      (WebMercatorProjection.geodeticLatitudeToMercatorAngle(rectangle.north) -\n        southMercatorY);\n    const centerWebMercatorT =\n      (WebMercatorProjection.geodeticLatitudeToMercatorAngle(\n        centerCartographic.latitude\n      ) -\n        southMercatorY) *\n      oneOverMercatorHeight;\n\n    const geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic(\n      cartographicScratch,\n      normalScratch\n    );\n    const centerEncodedNormal = AttributeCompression.octEncode(\n      geodeticSurfaceNormal,\n      octEncodedNormalScratch\n    );\n\n    const centerIndex = nextIndex;\n    encoding.encode(\n      typedArray,\n      nextIndex * stride,\n      obb.center,\n      Cartesian2.fromElements(0.5, 0.5, uvScratch),\n      middleHeight,\n      centerEncodedNormal,\n      centerWebMercatorT,\n      geodeticSurfaceNormal\n    );\n    ++nextIndex;\n\n    const vertexCount = nextIndex;\n\n    const bytesPerIndex = vertexCount < 256 ? 1 : 2;\n    const indexCount = (vertexCount - 1) * 3; // one triangle per edge vertex\n    const indexDataBytes = indexCount * bytesPerIndex;\n    const availableBytesInBuffer =\n      (typedArray.length - vertexCount * stride) *\n      Float32Array.BYTES_PER_ELEMENT;\n\n    let indices;\n    if (availableBytesInBuffer >= indexDataBytes) {\n      // Store the index data in the same buffer as the vertex data.\n      const startIndex = vertexCount * stride * Float32Array.BYTES_PER_ELEMENT;\n      indices =\n        vertexCount < 256\n          ? new Uint8Array(typedArray.buffer, startIndex, indexCount)\n          : new Uint16Array(typedArray.buffer, startIndex, indexCount);\n    } else {\n      // Allocate a new buffer for the index data.\n      indices =\n        vertexCount < 256\n          ? new Uint8Array(indexCount)\n          : new Uint16Array(indexCount);\n    }\n\n    typedArray = new Float32Array(typedArray.buffer, 0, vertexCount * stride);\n\n    let indexOut = 0;\n    for (i = 0; i < vertexCount - 2; ++i) {\n      indices[indexOut++] = centerIndex;\n      indices[indexOut++] = i;\n      indices[indexOut++] = i + 1;\n    }\n\n    indices[indexOut++] = centerIndex;\n    indices[indexOut++] = i;\n    indices[indexOut++] = 0;\n\n    const westIndicesSouthToNorth = [];\n    for (i = southwestIndex; i >= northwestIndex; --i) {\n      westIndicesSouthToNorth.push(i);\n    }\n\n    const southIndicesEastToWest = [];\n    for (i = southeastIndex; i >= southwestIndex; --i) {\n      southIndicesEastToWest.push(i);\n    }\n\n    const eastIndicesNorthToSouth = [];\n    for (i = northeastIndex; i >= southeastIndex; --i) {\n      eastIndicesNorthToSouth.push(i);\n    }\n\n    const northIndicesWestToEast = [];\n    northIndicesWestToEast.push(0);\n    for (i = centerIndex - 1; i >= northeastIndex; --i) {\n      northIndicesWestToEast.push(i);\n    }\n\n    fill.mesh = new TerrainMesh(\n      encoding.center,\n      typedArray,\n      indices,\n      indexCount,\n      vertexCount,\n      minimumHeight,\n      maximumHeight,\n      BoundingSphere.fromOrientedBoundingBox(obb),\n      computeOccludeePoint(\n        tileProvider,\n        obb.center,\n        rectangle,\n        minimumHeight,\n        maximumHeight\n      ),\n      encoding.stride,\n      obb,\n      encoding,\n      westIndicesSouthToNorth,\n      southIndicesEastToWest,\n      eastIndicesNorthToSouth,\n      northIndicesWestToEast\n    );\n  }\n\n  const context = frameState.context;\n\n  fill._destroyVertexArray(vertexArraysToDestroy);\n\n  fill.vertexArray = GlobeSurfaceTile._createVertexArrayForMesh(\n    context,\n    fill.mesh\n  );\n  surfaceTile.processImagery(\n    tile,\n    tileProvider.terrainProvider,\n    frameState,\n    true\n  );\n\n  const oldTexture = fill.waterMaskTexture;\n  fill.waterMaskTexture = undefined;\n\n  if (tileProvider.terrainProvider.hasWaterMask) {\n    const waterSourceTile = surfaceTile._findAncestorTileWithTerrainData(tile);\n    if (\n      defined(waterSourceTile) &&\n      defined(waterSourceTile.data.waterMaskTexture)\n    ) {\n      fill.waterMaskTexture = waterSourceTile.data.waterMaskTexture;\n      ++fill.waterMaskTexture.referenceCount;\n      surfaceTile._computeWaterMaskTranslationAndScale(\n        tile,\n        waterSourceTile,\n        fill.waterMaskTranslationAndScale\n      );\n    }\n  }\n\n  if (defined(oldTexture)) {\n    --oldTexture.referenceCount;\n    if (oldTexture.referenceCount === 0) {\n      oldTexture.destroy();\n    }\n  }\n}\n\nfunction addVertexWithComputedPosition(\n  ellipsoid,\n  rectangle,\n  encoding,\n  buffer,\n  index,\n  u,\n  v,\n  height,\n  encodedNormal,\n  webMercatorT,\n  heightRange\n) {\n  const cartographic = cartographicScratch;\n  cartographic.longitude = CesiumMath.lerp(rectangle.west, rectangle.east, u);\n  cartographic.latitude = CesiumMath.lerp(rectangle.south, rectangle.north, v);\n  cartographic.height = height;\n  const position = ellipsoid.cartographicToCartesian(\n    cartographic,\n    cartesianScratch\n  );\n\n  let geodeticSurfaceNormal;\n  if (encoding.hasGeodeticSurfaceNormals) {\n    geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormal(\n      position,\n      normalScratch\n    );\n  }\n\n  const uv = uvScratch2;\n  uv.x = u;\n  uv.y = v;\n\n  encoding.encode(\n    buffer,\n    index * encoding.stride,\n    position,\n    uv,\n    height,\n    encodedNormal,\n    webMercatorT,\n    geodeticSurfaceNormal\n  );\n\n  heightRange.minimumHeight = Math.min(heightRange.minimumHeight, height);\n  heightRange.maximumHeight = Math.max(heightRange.maximumHeight, height);\n\n  return index + 1;\n}\n\nconst sourceRectangleScratch = new Rectangle();\n\nfunction transformTextureCoordinates(\n  sourceTile,\n  targetTile,\n  coordinates,\n  result\n) {\n  let sourceRectangle = sourceTile.rectangle;\n  const targetRectangle = targetTile.rectangle;\n\n  // Handle transforming across the anti-meridian.\n  if (\n    targetTile.x === 0 &&\n    coordinates.x === 1.0 &&\n    sourceTile.x ===\n      sourceTile.tilingScheme.getNumberOfXTilesAtLevel(sourceTile.level) - 1\n  ) {\n    sourceRectangle = Rectangle.clone(\n      sourceTile.rectangle,\n      sourceRectangleScratch\n    );\n    sourceRectangle.west -= CesiumMath.TWO_PI;\n    sourceRectangle.east -= CesiumMath.TWO_PI;\n  } else if (\n    sourceTile.x === 0 &&\n    coordinates.x === 0.0 &&\n    targetTile.x ===\n      targetTile.tilingScheme.getNumberOfXTilesAtLevel(targetTile.level) - 1\n  ) {\n    sourceRectangle = Rectangle.clone(\n      sourceTile.rectangle,\n      sourceRectangleScratch\n    );\n    sourceRectangle.west += CesiumMath.TWO_PI;\n    sourceRectangle.east += CesiumMath.TWO_PI;\n  }\n\n  const sourceWidth = sourceRectangle.east - sourceRectangle.west;\n  const umin = (targetRectangle.west - sourceRectangle.west) / sourceWidth;\n  const umax = (targetRectangle.east - sourceRectangle.west) / sourceWidth;\n\n  const sourceHeight = sourceRectangle.north - sourceRectangle.south;\n  const vmin = (targetRectangle.south - sourceRectangle.south) / sourceHeight;\n  const vmax = (targetRectangle.north - sourceRectangle.south) / sourceHeight;\n\n  let u = (coordinates.x - umin) / (umax - umin);\n  let v = (coordinates.y - vmin) / (vmax - vmin);\n\n  // Ensure that coordinates very near the corners are at the corners.\n  if (Math.abs(u) < Math.EPSILON5) {\n    u = 0.0;\n  } else if (Math.abs(u - 1.0) < Math.EPSILON5) {\n    u = 1.0;\n  }\n\n  if (Math.abs(v) < Math.EPSILON5) {\n    v = 0.0;\n  } else if (Math.abs(v - 1.0) < Math.EPSILON5) {\n    v = 1.0;\n  }\n\n  result.x = u;\n  result.y = v;\n  return result;\n}\n\nconst encodedNormalScratch = new Cartesian2();\n\nfunction getVertexFromTileAtCorner(sourceMesh, sourceIndex, u, v, vertex) {\n  const sourceEncoding = sourceMesh.encoding;\n  const sourceVertices = sourceMesh.vertices;\n\n  vertex.height = sourceEncoding.decodeHeight(sourceVertices, sourceIndex);\n\n  if (sourceEncoding.hasVertexNormals) {\n    sourceEncoding.getOctEncodedNormal(\n      sourceVertices,\n      sourceIndex,\n      vertex.encodedNormal\n    );\n  } else {\n    const normal = vertex.encodedNormal;\n    normal.x = 0.0;\n    normal.y = 0.0;\n  }\n}\n\nconst encodedNormalScratch2 = new Cartesian2();\nconst cartesianScratch2 = new Cartesian3();\n\nfunction getInterpolatedVertexAtCorner(\n  ellipsoid,\n  sourceTile,\n  targetTile,\n  sourceMesh,\n  previousIndex,\n  nextIndex,\n  u,\n  v,\n  interpolateU,\n  vertex\n) {\n  const sourceEncoding = sourceMesh.encoding;\n  const sourceVertices = sourceMesh.vertices;\n\n  const previousUv = transformTextureCoordinates(\n    sourceTile,\n    targetTile,\n    sourceEncoding.decodeTextureCoordinates(\n      sourceVertices,\n      previousIndex,\n      uvScratch\n    ),\n    uvScratch\n  );\n  const nextUv = transformTextureCoordinates(\n    sourceTile,\n    targetTile,\n    sourceEncoding.decodeTextureCoordinates(\n      sourceVertices,\n      nextIndex,\n      uvScratch2\n    ),\n    uvScratch2\n  );\n\n  let ratio;\n  if (interpolateU) {\n    ratio = (u - previousUv.x) / (nextUv.x - previousUv.x);\n  } else {\n    ratio = (v - previousUv.y) / (nextUv.y - previousUv.y);\n  }\n\n  const height1 = sourceEncoding.decodeHeight(sourceVertices, previousIndex);\n  const height2 = sourceEncoding.decodeHeight(sourceVertices, nextIndex);\n\n  const targetRectangle = targetTile.rectangle;\n  cartographicScratch.longitude = CesiumMath.lerp(\n    targetRectangle.west,\n    targetRectangle.east,\n    u\n  );\n  cartographicScratch.latitude = CesiumMath.lerp(\n    targetRectangle.south,\n    targetRectangle.north,\n    v\n  );\n  vertex.height = cartographicScratch.height = CesiumMath.lerp(\n    height1,\n    height2,\n    ratio\n  );\n\n  let normal;\n  if (sourceEncoding.hasVertexNormals) {\n    const encodedNormal1 = sourceEncoding.getOctEncodedNormal(\n      sourceVertices,\n      previousIndex,\n      encodedNormalScratch\n    );\n    const encodedNormal2 = sourceEncoding.getOctEncodedNormal(\n      sourceVertices,\n      nextIndex,\n      encodedNormalScratch2\n    );\n    const normal1 = AttributeCompression.octDecode(\n      encodedNormal1.x,\n      encodedNormal1.y,\n      cartesianScratch\n    );\n    const normal2 = AttributeCompression.octDecode(\n      encodedNormal2.x,\n      encodedNormal2.y,\n      cartesianScratch2\n    );\n    normal = Cartesian3.lerp(normal1, normal2, ratio, cartesianScratch);\n    Cartesian3.normalize(normal, normal);\n    AttributeCompression.octEncode(normal, vertex.encodedNormal);\n  } else {\n    normal = ellipsoid.geodeticSurfaceNormalCartographic(\n      cartographicScratch,\n      cartesianScratch\n    );\n    AttributeCompression.octEncode(normal, vertex.encodedNormal);\n  }\n}\n\nfunction getVertexWithHeightAtCorner(\n  terrainFillMesh,\n  ellipsoid,\n  u,\n  v,\n  height,\n  vertex\n) {\n  vertex.height = height;\n  const normal = ellipsoid.geodeticSurfaceNormalCartographic(\n    cartographicScratch,\n    cartesianScratch\n  );\n  AttributeCompression.octEncode(normal, vertex.encodedNormal);\n}\n\nfunction getCorner(\n  terrainFillMesh,\n  ellipsoid,\n  u,\n  v,\n  cornerTile,\n  cornerMesh,\n  previousEdgeTiles,\n  previousEdgeMeshes,\n  nextEdgeTiles,\n  nextEdgeMeshes,\n  vertex\n) {\n  const gotCorner =\n    getCornerFromEdge(\n      terrainFillMesh,\n      ellipsoid,\n      previousEdgeMeshes,\n      previousEdgeTiles,\n      false,\n      u,\n      v,\n      vertex\n    ) ||\n    getCornerFromEdge(\n      terrainFillMesh,\n      ellipsoid,\n      nextEdgeMeshes,\n      nextEdgeTiles,\n      true,\n      u,\n      v,\n      vertex\n    );\n  if (gotCorner) {\n    return vertex;\n  }\n\n  let vertexIndex;\n\n  if (meshIsUsable(cornerTile, cornerMesh)) {\n    // Corner mesh is valid, copy its corner vertex to this mesh.\n    if (u === 0.0) {\n      if (v === 0.0) {\n        // southwest destination, northeast source\n        vertexIndex = cornerMesh.eastIndicesNorthToSouth[0];\n      } else {\n        // northwest destination, southeast source\n        vertexIndex = cornerMesh.southIndicesEastToWest[0];\n      }\n    } else if (v === 0.0) {\n      // southeast destination, northwest source\n      vertexIndex = cornerMesh.northIndicesWestToEast[0];\n    } else {\n      // northeast destination, southwest source\n      vertexIndex = cornerMesh.westIndicesSouthToNorth[0];\n    }\n    getVertexFromTileAtCorner(cornerMesh, vertexIndex, u, v, vertex);\n    return vertex;\n  }\n\n  // There is no precise vertex available from the corner or from either adjacent edge.\n  // This is either because there are no tiles at all at the edges and corner, or\n  // because the tiles at the edge are higher-level-number and don't extend all the way\n  // to the corner.\n  // Try to grab a height from the adjacent edges.\n  let height;\n  if (u === 0.0) {\n    if (v === 0.0) {\n      // southwest\n      height = getClosestHeightToCorner(\n        terrainFillMesh.westMeshes,\n        terrainFillMesh.westTiles,\n        TileEdge.EAST,\n        terrainFillMesh.southMeshes,\n        terrainFillMesh.southTiles,\n        TileEdge.NORTH,\n        u,\n        v\n      );\n    } else {\n      // northwest\n      height = getClosestHeightToCorner(\n        terrainFillMesh.northMeshes,\n        terrainFillMesh.northTiles,\n        TileEdge.SOUTH,\n        terrainFillMesh.westMeshes,\n        terrainFillMesh.westTiles,\n        TileEdge.EAST,\n        u,\n        v\n      );\n    }\n  } else if (v === 0.0) {\n    // southeast\n    height = getClosestHeightToCorner(\n      terrainFillMesh.southMeshes,\n      terrainFillMesh.southTiles,\n      TileEdge.NORTH,\n      terrainFillMesh.eastMeshes,\n      terrainFillMesh.eastTiles,\n      TileEdge.WEST,\n      u,\n      v\n    );\n  } else {\n    // northeast\n    height = getClosestHeightToCorner(\n      terrainFillMesh.eastMeshes,\n      terrainFillMesh.eastTiles,\n      TileEdge.WEST,\n      terrainFillMesh.northMeshes,\n      terrainFillMesh.northTiles,\n      TileEdge.SOUTH,\n      u,\n      v\n    );\n  }\n\n  if (defined(height)) {\n    getVertexWithHeightAtCorner(\n      terrainFillMesh,\n      ellipsoid,\n      u,\n      v,\n      height,\n      vertex\n    );\n    return vertex;\n  }\n\n  // No heights available that are closer than the adjacent corners.\n  return undefined;\n}\n\nfunction getClosestHeightToCorner(\n  previousMeshes,\n  previousTiles,\n  previousEdge,\n  nextMeshes,\n  nextTiles,\n  nextEdge,\n  u,\n  v\n) {\n  const height1 = getNearestHeightOnEdge(\n    previousMeshes,\n    previousTiles,\n    false,\n    previousEdge,\n    u,\n    v\n  );\n  const height2 = getNearestHeightOnEdge(\n    nextMeshes,\n    nextTiles,\n    true,\n    nextEdge,\n    u,\n    v\n  );\n  if (defined(height1) && defined(height2)) {\n    // It would be slightly better to do a weighted average of the two heights\n    // based on their distance from the corner, but it shouldn't matter much in practice.\n    return (height1 + height2) * 0.5;\n  } else if (defined(height1)) {\n    return height1;\n  }\n  return height2;\n}\n\nfunction addEdge(\n  terrainFillMesh,\n  ellipsoid,\n  encoding,\n  typedArray,\n  nextIndex,\n  edgeTiles,\n  edgeMeshes,\n  tileEdge,\n  heightRange\n) {\n  for (let i = 0; i < edgeTiles.length; ++i) {\n    nextIndex = addEdgeMesh(\n      terrainFillMesh,\n      ellipsoid,\n      encoding,\n      typedArray,\n      nextIndex,\n      edgeTiles[i],\n      edgeMeshes[i],\n      tileEdge,\n      heightRange\n    );\n  }\n  return nextIndex;\n}\n\nfunction addEdgeMesh(\n  terrainFillMesh,\n  ellipsoid,\n  encoding,\n  typedArray,\n  nextIndex,\n  edgeTile,\n  edgeMesh,\n  tileEdge,\n  heightRange\n) {\n  // Handle copying edges across the anti-meridian.\n  let sourceRectangle = edgeTile.rectangle;\n  if (tileEdge === TileEdge.EAST && terrainFillMesh.tile.x === 0) {\n    sourceRectangle = Rectangle.clone(\n      edgeTile.rectangle,\n      sourceRectangleScratch\n    );\n    sourceRectangle.west -= CesiumMath.TWO_PI;\n    sourceRectangle.east -= CesiumMath.TWO_PI;\n  } else if (tileEdge === TileEdge.WEST && edgeTile.x === 0) {\n    sourceRectangle = Rectangle.clone(\n      edgeTile.rectangle,\n      sourceRectangleScratch\n    );\n    sourceRectangle.west += CesiumMath.TWO_PI;\n    sourceRectangle.east += CesiumMath.TWO_PI;\n  }\n\n  const targetRectangle = terrainFillMesh.tile.rectangle;\n\n  let lastU;\n  let lastV;\n\n  if (nextIndex > 0) {\n    encoding.decodeTextureCoordinates(typedArray, nextIndex - 1, uvScratch);\n    lastU = uvScratch.x;\n    lastV = uvScratch.y;\n  }\n\n  let indices;\n  let compareU;\n\n  switch (tileEdge) {\n    case TileEdge.WEST:\n      indices = edgeMesh.westIndicesSouthToNorth;\n      compareU = false;\n      break;\n    case TileEdge.NORTH:\n      indices = edgeMesh.northIndicesWestToEast;\n      compareU = true;\n      break;\n    case TileEdge.EAST:\n      indices = edgeMesh.eastIndicesNorthToSouth;\n      compareU = false;\n      break;\n    case TileEdge.SOUTH:\n      indices = edgeMesh.southIndicesEastToWest;\n      compareU = true;\n      break;\n  }\n\n  const sourceTile = edgeTile;\n  const targetTile = terrainFillMesh.tile;\n  const sourceEncoding = edgeMesh.encoding;\n  const sourceVertices = edgeMesh.vertices;\n  const targetStride = encoding.stride;\n\n  let southMercatorY;\n  let oneOverMercatorHeight;\n  if (sourceEncoding.hasWebMercatorT) {\n    southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle(\n      targetRectangle.south\n    );\n    oneOverMercatorHeight =\n      1.0 /\n      (WebMercatorProjection.geodeticLatitudeToMercatorAngle(\n        targetRectangle.north\n      ) -\n        southMercatorY);\n  }\n\n  for (let i = 0; i < indices.length; ++i) {\n    const index = indices[i];\n\n    const uv = sourceEncoding.decodeTextureCoordinates(\n      sourceVertices,\n      index,\n      uvScratch\n    );\n    transformTextureCoordinates(sourceTile, targetTile, uv, uv);\n    const u = uv.x;\n    const v = uv.y;\n    const uOrV = compareU ? u : v;\n\n    if (uOrV < 0.0 || uOrV > 1.0) {\n      // Vertex is outside the target tile - skip it.\n      continue;\n    }\n\n    if (\n      Math.abs(u - lastU) < CesiumMath.EPSILON5 &&\n      Math.abs(v - lastV) < CesiumMath.EPSILON5\n    ) {\n      // Vertex is very close to the previous one - skip it.\n      continue;\n    }\n\n    const nearlyEdgeU =\n      Math.abs(u) < CesiumMath.EPSILON5 ||\n      Math.abs(u - 1.0) < CesiumMath.EPSILON5;\n    const nearlyEdgeV =\n      Math.abs(v) < CesiumMath.EPSILON5 ||\n      Math.abs(v - 1.0) < CesiumMath.EPSILON5;\n\n    if (nearlyEdgeU && nearlyEdgeV) {\n      // Corner vertex - skip it.\n      continue;\n    }\n\n    const position = sourceEncoding.decodePosition(\n      sourceVertices,\n      index,\n      cartesianScratch\n    );\n    const height = sourceEncoding.decodeHeight(sourceVertices, index);\n\n    let normal;\n    if (sourceEncoding.hasVertexNormals) {\n      normal = sourceEncoding.getOctEncodedNormal(\n        sourceVertices,\n        index,\n        octEncodedNormalScratch\n      );\n    } else {\n      normal = octEncodedNormalScratch;\n      normal.x = 0.0;\n      normal.y = 0.0;\n    }\n\n    let webMercatorT = v;\n    if (sourceEncoding.hasWebMercatorT) {\n      const latitude = CesiumMath.lerp(\n        targetRectangle.south,\n        targetRectangle.north,\n        v\n      );\n      webMercatorT =\n        (WebMercatorProjection.geodeticLatitudeToMercatorAngle(latitude) -\n          southMercatorY) *\n        oneOverMercatorHeight;\n    }\n\n    let geodeticSurfaceNormal;\n    if (encoding.hasGeodeticSurfaceNormals) {\n      geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormal(\n        position,\n        normalScratch\n      );\n    }\n\n    encoding.encode(\n      typedArray,\n      nextIndex * targetStride,\n      position,\n      uv,\n      height,\n      normal,\n      webMercatorT,\n      geodeticSurfaceNormal\n    );\n\n    heightRange.minimumHeight = Math.min(heightRange.minimumHeight, height);\n    heightRange.maximumHeight = Math.max(heightRange.maximumHeight, height);\n\n    ++nextIndex;\n  }\n\n  return nextIndex;\n}\n\nfunction getNearestHeightOnEdge(meshes, tiles, isNext, edge, u, v) {\n  let meshStart;\n  let meshEnd;\n  let meshStep;\n\n  if (isNext) {\n    meshStart = 0;\n    meshEnd = meshes.length;\n    meshStep = 1;\n  } else {\n    meshStart = meshes.length - 1;\n    meshEnd = -1;\n    meshStep = -1;\n  }\n\n  for (\n    let meshIndex = meshStart;\n    meshIndex !== meshEnd;\n    meshIndex += meshStep\n  ) {\n    const mesh = meshes[meshIndex];\n    const tile = tiles[meshIndex];\n    if (!meshIsUsable(tile, mesh)) {\n      continue;\n    }\n\n    let indices;\n    switch (edge) {\n      case TileEdge.WEST:\n        indices = mesh.westIndicesSouthToNorth;\n        break;\n      case TileEdge.SOUTH:\n        indices = mesh.southIndicesEastToWest;\n        break;\n      case TileEdge.EAST:\n        indices = mesh.eastIndicesNorthToSouth;\n        break;\n      case TileEdge.NORTH:\n        indices = mesh.northIndicesWestToEast;\n        break;\n    }\n\n    const index = indices[isNext ? 0 : indices.length - 1];\n    if (defined(index)) {\n      return mesh.encoding.decodeHeight(mesh.vertices, index);\n    }\n  }\n\n  return undefined;\n}\n\nfunction meshIsUsable(tile, mesh) {\n  return (\n    defined(mesh) &&\n    (!defined(tile.data.fill) || !tile.data.fill.changedThisFrame)\n  );\n}\n\nfunction getCornerFromEdge(\n  terrainFillMesh,\n  ellipsoid,\n  edgeMeshes,\n  edgeTiles,\n  isNext,\n  u,\n  v,\n  vertex\n) {\n  let edgeVertices;\n  let compareU;\n  let increasing;\n  let vertexIndexIndex;\n  let vertexIndex;\n  const sourceTile = edgeTiles[isNext ? 0 : edgeMeshes.length - 1];\n  const sourceMesh = edgeMeshes[isNext ? 0 : edgeMeshes.length - 1];\n\n  if (meshIsUsable(sourceTile, sourceMesh)) {\n    // Previous mesh is valid, but we don't know yet if it covers this corner.\n    if (u === 0.0) {\n      if (v === 0.0) {\n        // southwest\n        edgeVertices = isNext\n          ? sourceMesh.northIndicesWestToEast\n          : sourceMesh.eastIndicesNorthToSouth;\n        compareU = isNext;\n        increasing = isNext;\n      } else {\n        // northwest\n        edgeVertices = isNext\n          ? sourceMesh.eastIndicesNorthToSouth\n          : sourceMesh.southIndicesEastToWest;\n        compareU = !isNext;\n        increasing = false;\n      }\n    } else if (v === 0.0) {\n      // southeast\n      edgeVertices = isNext\n        ? sourceMesh.westIndicesSouthToNorth\n        : sourceMesh.northIndicesWestToEast;\n      compareU = !isNext;\n      increasing = true;\n    } else {\n      // northeast\n      edgeVertices = isNext\n        ? sourceMesh.southIndicesEastToWest\n        : sourceMesh.westIndicesSouthToNorth;\n      compareU = isNext;\n      increasing = !isNext;\n    }\n\n    if (edgeVertices.length > 0) {\n      // The vertex we want will very often be the first/last vertex so check that first.\n      vertexIndexIndex = isNext ? 0 : edgeVertices.length - 1;\n      vertexIndex = edgeVertices[vertexIndexIndex];\n      sourceMesh.encoding.decodeTextureCoordinates(\n        sourceMesh.vertices,\n        vertexIndex,\n        uvScratch\n      );\n      const targetUv = transformTextureCoordinates(\n        sourceTile,\n        terrainFillMesh.tile,\n        uvScratch,\n        uvScratch\n      );\n      if (targetUv.x === u && targetUv.y === v) {\n        // Vertex is good!\n        getVertexFromTileAtCorner(sourceMesh, vertexIndex, u, v, vertex);\n        return true;\n      }\n\n      // The last vertex is not the one we need, try binary searching for the right one.\n      vertexIndexIndex = binarySearch(edgeVertices, compareU ? u : v, function (\n        vertexIndex,\n        textureCoordinate\n      ) {\n        sourceMesh.encoding.decodeTextureCoordinates(\n          sourceMesh.vertices,\n          vertexIndex,\n          uvScratch\n        );\n        const targetUv = transformTextureCoordinates(\n          sourceTile,\n          terrainFillMesh.tile,\n          uvScratch,\n          uvScratch\n        );\n        if (increasing) {\n          if (compareU) {\n            return targetUv.x - u;\n          }\n          return targetUv.y - v;\n        } else if (compareU) {\n          return u - targetUv.x;\n        }\n        return v - targetUv.y;\n      });\n\n      if (vertexIndexIndex < 0) {\n        vertexIndexIndex = ~vertexIndexIndex;\n\n        if (vertexIndexIndex > 0 && vertexIndexIndex < edgeVertices.length) {\n          // The corner falls between two vertices, so interpolate between them.\n          getInterpolatedVertexAtCorner(\n            ellipsoid,\n            sourceTile,\n            terrainFillMesh.tile,\n            sourceMesh,\n            edgeVertices[vertexIndexIndex - 1],\n            edgeVertices[vertexIndexIndex],\n            u,\n            v,\n            compareU,\n            vertex\n          );\n          return true;\n        }\n      } else {\n        // Found a vertex that fits in the corner exactly.\n        getVertexFromTileAtCorner(\n          sourceMesh,\n          edgeVertices[vertexIndexIndex],\n          u,\n          v,\n          vertex\n        );\n        return true;\n      }\n    }\n  }\n\n  return false;\n}\n\nconst cornerPositionsScratch = [\n  new Cartesian3(),\n  new Cartesian3(),\n  new Cartesian3(),\n  new Cartesian3(),\n];\n\nfunction computeOccludeePoint(\n  tileProvider,\n  center,\n  rectangle,\n  minimumHeight,\n  maximumHeight,\n  result\n) {\n  const ellipsoidalOccluder = tileProvider.quadtree._occluders.ellipsoid;\n  const ellipsoid = ellipsoidalOccluder.ellipsoid;\n\n  const cornerPositions = cornerPositionsScratch;\n  Cartesian3.fromRadians(\n    rectangle.west,\n    rectangle.south,\n    maximumHeight,\n    ellipsoid,\n    cornerPositions[0]\n  );\n  Cartesian3.fromRadians(\n    rectangle.east,\n    rectangle.south,\n    maximumHeight,\n    ellipsoid,\n    cornerPositions[1]\n  );\n  Cartesian3.fromRadians(\n    rectangle.west,\n    rectangle.north,\n    maximumHeight,\n    ellipsoid,\n    cornerPositions[2]\n  );\n  Cartesian3.fromRadians(\n    rectangle.east,\n    rectangle.north,\n    maximumHeight,\n    ellipsoid,\n    cornerPositions[3]\n  );\n\n  return ellipsoidalOccluder.computeHorizonCullingPointPossiblyUnderEllipsoid(\n    center,\n    cornerPositions,\n    minimumHeight,\n    result\n  );\n}\nexport default TerrainFillMesh;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport BoxOutlineGeometry from \"../Core/BoxOutlineGeometry.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GeometryPipeline from \"../Core/GeometryPipeline.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport SphereOutlineGeometry from \"../Core/SphereOutlineGeometry.js\";\nimport VerticalExaggeration from \"../Core/VerticalExaggeration.js\";\nimport TerrainQuantization from \"../Core/TerrainQuantization.js\";\nimport Visibility from \"../Core/Visibility.js\";\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport ClippingPlaneCollection from \"./ClippingPlaneCollection.js\";\nimport DepthFunction from \"./DepthFunction.js\";\nimport GlobeSurfaceTile from \"./GlobeSurfaceTile.js\";\nimport ImageryLayer from \"./ImageryLayer.js\";\nimport ImageryState from \"./ImageryState.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\nimport QuadtreeTileLoadState from \"./QuadtreeTileLoadState.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowMode from \"./ShadowMode.js\";\nimport TerrainFillMesh from \"./TerrainFillMesh.js\";\nimport TerrainState from \"./TerrainState.js\";\nimport TileBoundingRegion from \"./TileBoundingRegion.js\";\nimport TileSelectionResult from \"./TileSelectionResult.js\";\n\n/**\n * Provides quadtree tiles representing the surface of the globe.  This type is intended to be used\n * with {@link QuadtreePrimitive}.\n *\n * @alias GlobeSurfaceTileProvider\n * @constructor\n *\n * @param {TerrainProvider} options.terrainProvider The terrain provider that describes the surface geometry.\n * @param {ImageryLayerCollection} option.imageryLayers The collection of imagery layers describing the shading of the surface.\n * @param {GlobeSurfaceShaderSet} options.surfaceShaderSet The set of shaders used to render the surface.\n *\n * @private\n */\nfunction GlobeSurfaceTileProvider(options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options)) {\n    throw new DeveloperError(\"options is required.\");\n  }\n  if (!defined(options.terrainProvider)) {\n    throw new DeveloperError(\"options.terrainProvider is required.\");\n  } else if (!defined(options.imageryLayers)) {\n    throw new DeveloperError(\"options.imageryLayers is required.\");\n  } else if (!defined(options.surfaceShaderSet)) {\n    throw new DeveloperError(\"options.surfaceShaderSet is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this.lightingFadeOutDistance = 6500000.0;\n  this.lightingFadeInDistance = 9000000.0;\n  this.hasWaterMask = false;\n  this.oceanNormalMap = undefined;\n  this.zoomedOutOceanSpecularIntensity = 0.5;\n  this.enableLighting = false;\n  this.dynamicAtmosphereLighting = false;\n  this.dynamicAtmosphereLightingFromSun = false;\n  this.showGroundAtmosphere = false;\n  this.shadows = ShadowMode.RECEIVE_ONLY;\n  this.vertexShadowDarkness = 0.3;\n\n  /**\n   * The color to use to highlight terrain fill tiles. If undefined, fill tiles are not\n   * highlighted at all. The alpha value is used to alpha blend with the tile's\n   * actual color. Because terrain fill tiles do not represent the actual terrain surface,\n   * it may be useful in some applications to indicate visually that they are not to be trusted.\n   * @type {Color}\n   * @default undefined\n   */\n  this.fillHighlightColor = undefined;\n\n  this.hueShift = 0.0;\n  this.saturationShift = 0.0;\n  this.brightnessShift = 0.0;\n\n  this.showSkirts = true;\n  this.backFaceCulling = true;\n  this.undergroundColor = undefined;\n  this.undergroundColorAlphaByDistance = undefined;\n\n  this.lambertDiffuseMultiplier = 0.0;\n\n  this.materialUniformMap = undefined;\n  this._materialUniformMap = undefined;\n\n  this._quadtree = undefined;\n  this._terrainProvider = options.terrainProvider;\n  this._imageryLayers = options.imageryLayers;\n  this._surfaceShaderSet = options.surfaceShaderSet;\n\n  this._renderState = undefined;\n  this._blendRenderState = undefined;\n  this._disableCullingRenderState = undefined;\n  this._disableCullingBlendRenderState = undefined;\n\n  this._errorEvent = new Event();\n\n  this._removeLayerAddedListener = this._imageryLayers.layerAdded.addEventListener(\n    GlobeSurfaceTileProvider.prototype._onLayerAdded,\n    this\n  );\n  this._removeLayerRemovedListener = this._imageryLayers.layerRemoved.addEventListener(\n    GlobeSurfaceTileProvider.prototype._onLayerRemoved,\n    this\n  );\n  this._removeLayerMovedListener = this._imageryLayers.layerMoved.addEventListener(\n    GlobeSurfaceTileProvider.prototype._onLayerMoved,\n    this\n  );\n  this._removeLayerShownListener = this._imageryLayers.layerShownOrHidden.addEventListener(\n    GlobeSurfaceTileProvider.prototype._onLayerShownOrHidden,\n    this\n  );\n  this._imageryLayersUpdatedEvent = new Event();\n\n  this._layerOrderChanged = false;\n\n  this._tilesToRenderByTextureCount = [];\n  this._drawCommands = [];\n  this._uniformMaps = [];\n  this._usedDrawCommands = 0;\n\n  this._vertexArraysToDestroy = [];\n\n  this._debug = {\n    wireframe: false,\n    boundingSphereTile: undefined,\n  };\n\n  this._baseColor = undefined;\n  this._firstPassInitialColor = undefined;\n  this.baseColor = new Color(0.0, 0.0, 0.5, 1.0);\n\n  /**\n   * A property specifying a {@link ClippingPlaneCollection} used to selectively disable rendering on the outside of each plane.\n   * @type {ClippingPlaneCollection}\n   * @private\n   */\n  this._clippingPlanes = undefined;\n\n  /**\n   * A property specifying a {@link Rectangle} used to selectively limit terrain and imagery rendering.\n   * @type {Rectangle}\n   */\n  this.cartographicLimitRectangle = Rectangle.clone(Rectangle.MAX_VALUE);\n\n  this._hasLoadedTilesThisFrame = false;\n  this._hasFillTilesThisFrame = false;\n\n  this._oldVerticalExaggeration = undefined;\n  this._oldVerticalExaggerationRelativeHeight = undefined;\n}\n\nObject.defineProperties(GlobeSurfaceTileProvider.prototype, {\n  /**\n   * Gets or sets the color of the globe when no imagery is available.\n   * @memberof GlobeSurfaceTileProvider.prototype\n   * @type {Color}\n   */\n  baseColor: {\n    get: function () {\n      return this._baseColor;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      this._baseColor = value;\n      this._firstPassInitialColor = Cartesian4.fromColor(\n        value,\n        this._firstPassInitialColor\n      );\n    },\n  },\n  /**\n   * Gets or sets the {@link QuadtreePrimitive} for which this provider is\n   * providing tiles.  This property may be undefined if the provider is not yet associated\n   * with a {@link QuadtreePrimitive}.\n   * @memberof GlobeSurfaceTileProvider.prototype\n   * @type {QuadtreePrimitive}\n   */\n  quadtree: {\n    get: function () {\n      return this._quadtree;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value)) {\n        throw new DeveloperError(\"value is required.\");\n      }\n      //>>includeEnd('debug');\n\n      this._quadtree = value;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by the provider.\n   * @memberof GlobeSurfaceTileProvider.prototype\n   * @type {TilingScheme}\n   */\n  tilingScheme: {\n    get: function () {\n      if (!defined(this._terrainProvider)) {\n        return undefined;\n      }\n\n      return this._terrainProvider.tilingScheme;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the geometry provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof GlobeSurfaceTileProvider.prototype\n   * @type {Event}\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when an imagery layer is added, shown, hidden, moved, or removed.\n   * @memberof GlobeSurfaceTileProvider.prototype\n   * @type {Event}\n   */\n  imageryLayersUpdatedEvent: {\n    get: function () {\n      return this._imageryLayersUpdatedEvent;\n    },\n  },\n\n  /**\n   * Gets or sets the terrain provider that describes the surface geometry.\n   * @memberof GlobeSurfaceTileProvider.prototype\n   * @type {TerrainProvider}\n   */\n  terrainProvider: {\n    get: function () {\n      return this._terrainProvider;\n    },\n    set: function (terrainProvider) {\n      if (this._terrainProvider === terrainProvider) {\n        return;\n      }\n\n      this._terrainProvider = terrainProvider;\n\n      if (defined(this._quadtree)) {\n        this._quadtree.invalidateAllTiles();\n      }\n    },\n  },\n  /**\n   * The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.\n   *\n   * @type {ClippingPlaneCollection}\n   *\n   * @private\n   */\n  clippingPlanes: {\n    get: function () {\n      return this._clippingPlanes;\n    },\n    set: function (value) {\n      ClippingPlaneCollection.setOwner(value, this, \"_clippingPlanes\");\n    },\n  },\n});\n\nfunction sortTileImageryByLayerIndex(a, b) {\n  let aImagery = a.loadingImagery;\n  if (!defined(aImagery)) {\n    aImagery = a.readyImagery;\n  }\n\n  let bImagery = b.loadingImagery;\n  if (!defined(bImagery)) {\n    bImagery = b.readyImagery;\n  }\n\n  return aImagery.imageryLayer._layerIndex - bImagery.imageryLayer._layerIndex;\n}\n\n/**\n * Make updates to the tile provider that are not involved in rendering. Called before the render update cycle.\n */\nGlobeSurfaceTileProvider.prototype.update = function (frameState) {\n  // update collection: imagery indices, base layers, raise layer show/hide event\n  this._imageryLayers._update();\n};\n\nfunction updateCredits(surface, frameState) {\n  const creditDisplay = frameState.creditDisplay;\n  const terrainProvider = surface._terrainProvider;\n  if (defined(terrainProvider) && defined(terrainProvider.credit)) {\n    creditDisplay.addCreditToNextFrame(terrainProvider.credit);\n  }\n\n  const imageryLayers = surface._imageryLayers;\n  for (let i = 0, len = imageryLayers.length; i < len; ++i) {\n    const layer = imageryLayers.get(i);\n    if (layer.ready && layer.show && defined(layer.imageryProvider.credit)) {\n      creditDisplay.addCreditToNextFrame(layer.imageryProvider.credit);\n    }\n  }\n}\n\n/**\n * Called at the beginning of each render frame, before {@link QuadtreeTileProvider#showTileThisFrame}\n * @param {FrameState} frameState The frame state.\n */\nGlobeSurfaceTileProvider.prototype.initialize = function (frameState) {\n  // update each layer for texture reprojection.\n  this._imageryLayers.queueReprojectionCommands(frameState);\n\n  if (this._layerOrderChanged) {\n    this._layerOrderChanged = false;\n\n    // Sort the TileImagery instances in each tile by the layer index.\n    this._quadtree.forEachLoadedTile(function (tile) {\n      tile.data.imagery.sort(sortTileImageryByLayerIndex);\n    });\n  }\n\n  // Add credits for terrain and imagery providers.\n  updateCredits(this, frameState);\n\n  const vertexArraysToDestroy = this._vertexArraysToDestroy;\n  const length = vertexArraysToDestroy.length;\n  for (let j = 0; j < length; ++j) {\n    GlobeSurfaceTile._freeVertexArray(vertexArraysToDestroy[j]);\n  }\n  vertexArraysToDestroy.length = 0;\n};\n\n/**\n * Called at the beginning of the update cycle for each render frame, before {@link QuadtreeTileProvider#showTileThisFrame}\n * or any other functions.\n *\n * @param {FrameState} frameState The frame state.\n */\nGlobeSurfaceTileProvider.prototype.beginUpdate = function (frameState) {\n  const tilesToRenderByTextureCount = this._tilesToRenderByTextureCount;\n  for (let i = 0, len = tilesToRenderByTextureCount.length; i < len; ++i) {\n    const tiles = tilesToRenderByTextureCount[i];\n    if (defined(tiles)) {\n      tiles.length = 0;\n    }\n  }\n  // update clipping planes\n  const clippingPlanes = this._clippingPlanes;\n  if (defined(clippingPlanes) && clippingPlanes.enabled) {\n    clippingPlanes.update(frameState);\n  }\n  this._usedDrawCommands = 0;\n\n  this._hasLoadedTilesThisFrame = false;\n  this._hasFillTilesThisFrame = false;\n};\n\n/**\n * Called at the end of the update cycle for each render frame, after {@link QuadtreeTileProvider#showTileThisFrame}\n * and any other functions.\n *\n * @param {FrameState} frameState The frame state.\n */\nGlobeSurfaceTileProvider.prototype.endUpdate = function (frameState) {\n  if (!defined(this._renderState)) {\n    this._renderState = RenderState.fromCache({\n      // Write color and depth\n      cull: {\n        enabled: true,\n      },\n      depthTest: {\n        enabled: true,\n        func: DepthFunction.LESS,\n      },\n    });\n\n    this._blendRenderState = RenderState.fromCache({\n      // Write color and depth\n      cull: {\n        enabled: true,\n      },\n      depthTest: {\n        enabled: true,\n        func: DepthFunction.LESS_OR_EQUAL,\n      },\n      blending: BlendingState.ALPHA_BLEND,\n    });\n\n    let rs = clone(this._renderState, true);\n    rs.cull.enabled = false;\n    this._disableCullingRenderState = RenderState.fromCache(rs);\n\n    rs = clone(this._blendRenderState, true);\n    rs.cull.enabled = false;\n    this._disableCullingBlendRenderState = RenderState.fromCache(rs);\n  }\n\n  // If this frame has a mix of loaded and fill tiles, we need to propagate\n  // loaded heights to the fill tiles.\n  if (this._hasFillTilesThisFrame && this._hasLoadedTilesThisFrame) {\n    TerrainFillMesh.updateFillTiles(\n      this,\n      this._quadtree._tilesToRender,\n      frameState,\n      this._vertexArraysToDestroy\n    );\n  }\n\n  // When vertical exaggeration changes, all of the loaded tiles need to generate\n  // geodetic surface normals so they can scale properly when rendered.\n  // When exaggeration is reset, geodetic surface normals are removed to decrease\n  // memory usage. Some tiles might have been constructed with the correct\n  // exaggeration already, so skip over them.\n\n  // If the geodetic surface normals can't be created because the tile doesn't\n  // have a mesh, keep checking until the tile does have a mesh. This can happen\n  // if the tile's mesh starts construction in a worker thread right before the\n  // exaggeration changes.\n\n  const quadtree = this.quadtree;\n  const exaggeration = frameState.verticalExaggeration;\n  const exaggerationRelativeHeight =\n    frameState.verticalExaggerationRelativeHeight;\n  const exaggerationChanged =\n    this._oldVerticalExaggeration !== exaggeration ||\n    this._oldVerticalExaggerationRelativeHeight !== exaggerationRelativeHeight;\n\n  // Keep track of the next time there is a change in exaggeration\n  this._oldVerticalExaggeration = exaggeration;\n  this._oldVerticalExaggerationRelativeHeight = exaggerationRelativeHeight;\n\n  if (exaggerationChanged) {\n    quadtree.forEachLoadedTile(function (tile) {\n      const surfaceTile = tile.data;\n      surfaceTile.updateExaggeration(tile, frameState, quadtree);\n    });\n  }\n\n  // Add the tile render commands to the command list, sorted by texture count.\n  const tilesToRenderByTextureCount = this._tilesToRenderByTextureCount;\n  for (\n    let textureCountIndex = 0,\n      textureCountLength = tilesToRenderByTextureCount.length;\n    textureCountIndex < textureCountLength;\n    ++textureCountIndex\n  ) {\n    const tilesToRender = tilesToRenderByTextureCount[textureCountIndex];\n    if (!defined(tilesToRender)) {\n      continue;\n    }\n\n    for (\n      let tileIndex = 0, tileLength = tilesToRender.length;\n      tileIndex < tileLength;\n      ++tileIndex\n    ) {\n      const tile = tilesToRender[tileIndex];\n      const tileBoundingRegion = tile.data.tileBoundingRegion;\n      addDrawCommandsForTile(this, tile, frameState);\n      frameState.minimumTerrainHeight = Math.min(\n        frameState.minimumTerrainHeight,\n        tileBoundingRegion.minimumHeight\n      );\n    }\n  }\n};\n\nfunction pushCommand(command, frameState) {\n  const globeTranslucencyState = frameState.globeTranslucencyState;\n  if (globeTranslucencyState.translucent) {\n    const isBlendCommand = command.renderState.blending.enabled;\n    globeTranslucencyState.pushDerivedCommands(\n      command,\n      isBlendCommand,\n      frameState\n    );\n  } else {\n    frameState.commandList.push(command);\n  }\n}\n\n/**\n * Adds draw commands for tiles rendered in the previous frame for a pick pass.\n *\n * @param {FrameState} frameState The frame state.\n */\nGlobeSurfaceTileProvider.prototype.updateForPick = function (frameState) {\n  // Add the tile pick commands from the tiles drawn last frame.\n  const drawCommands = this._drawCommands;\n  for (let i = 0, length = this._usedDrawCommands; i < length; ++i) {\n    pushCommand(drawCommands[i], frameState);\n  }\n};\n\n/**\n * Cancels any imagery re-projections in the queue.\n */\nGlobeSurfaceTileProvider.prototype.cancelReprojections = function () {\n  this._imageryLayers.cancelReprojections();\n};\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level, in meters.\n *\n * @param {number} level The tile level for which to get the maximum geometric error.\n * @returns {number} The maximum geometric error in meters.\n */\nGlobeSurfaceTileProvider.prototype.getLevelMaximumGeometricError = function (\n  level\n) {\n  if (!defined(this._terrainProvider)) {\n    return 0;\n  }\n\n  return this._terrainProvider.getLevelMaximumGeometricError(level);\n};\n\n/**\n * Loads, or continues loading, a given tile.  This function will continue to be called\n * until {@link QuadtreeTile#state} is no longer {@link QuadtreeTileLoadState#LOADING}.\n *\n * @param {FrameState} frameState The frame state.\n * @param {QuadtreeTile} tile The tile to load.\n */\nGlobeSurfaceTileProvider.prototype.loadTile = function (frameState, tile) {\n  // We don't want to load imagery until we're certain that the terrain tiles are actually visible.\n  // So if our bounding volume isn't accurate because it came from another tile, load terrain only\n  // initially. If we load some terrain and suddenly have a more accurate bounding volume and the\n  // tile is _still_ visible, give the tile a chance to load imagery immediately rather than\n  // waiting for next frame.\n\n  let surfaceTile = tile.data;\n  let terrainOnly = true;\n  let terrainStateBefore;\n  if (defined(surfaceTile)) {\n    terrainOnly =\n      surfaceTile.boundingVolumeSourceTile !== tile ||\n      tile._lastSelectionResult === TileSelectionResult.CULLED_BUT_NEEDED;\n    terrainStateBefore = surfaceTile.terrainState;\n  }\n\n  GlobeSurfaceTile.processStateMachine(\n    tile,\n    frameState,\n    this.terrainProvider,\n    this._imageryLayers,\n    this.quadtree,\n    this._vertexArraysToDestroy,\n    terrainOnly\n  );\n\n  surfaceTile = tile.data;\n  if (terrainOnly && terrainStateBefore !== tile.data.terrainState) {\n    // Terrain state changed. If:\n    // a) The tile is visible, and\n    // b) The bounding volume is accurate (updated as a side effect of computing visibility)\n    // Then we'll load imagery, too.\n    if (\n      this.computeTileVisibility(tile, frameState, this.quadtree.occluders) !==\n        Visibility.NONE &&\n      surfaceTile.boundingVolumeSourceTile === tile\n    ) {\n      terrainOnly = false;\n      GlobeSurfaceTile.processStateMachine(\n        tile,\n        frameState,\n        this.terrainProvider,\n        this._imageryLayers,\n        this.quadtree,\n        this._vertexArraysToDestroy,\n        terrainOnly\n      );\n    }\n  }\n};\n\nconst boundingSphereScratch = new BoundingSphere();\nconst rectangleIntersectionScratch = new Rectangle();\nconst splitCartographicLimitRectangleScratch = new Rectangle();\nconst rectangleCenterScratch = new Cartographic();\n\n// cartographicLimitRectangle may span the IDL, but tiles never will.\nfunction clipRectangleAntimeridian(tileRectangle, cartographicLimitRectangle) {\n  if (cartographicLimitRectangle.west < cartographicLimitRectangle.east) {\n    return cartographicLimitRectangle;\n  }\n  const splitRectangle = Rectangle.clone(\n    cartographicLimitRectangle,\n    splitCartographicLimitRectangleScratch\n  );\n  const tileCenter = Rectangle.center(tileRectangle, rectangleCenterScratch);\n  if (tileCenter.longitude > 0.0) {\n    splitRectangle.east = CesiumMath.PI;\n  } else {\n    splitRectangle.west = -CesiumMath.PI;\n  }\n  return splitRectangle;\n}\n\nfunction isUndergroundVisible(tileProvider, frameState) {\n  if (frameState.cameraUnderground) {\n    return true;\n  }\n\n  if (frameState.globeTranslucencyState.translucent) {\n    return true;\n  }\n\n  if (tileProvider.backFaceCulling) {\n    return false;\n  }\n\n  const clippingPlanes = tileProvider._clippingPlanes;\n  if (defined(clippingPlanes) && clippingPlanes.enabled) {\n    return true;\n  }\n\n  if (\n    !Rectangle.equals(\n      tileProvider.cartographicLimitRectangle,\n      Rectangle.MAX_VALUE\n    )\n  ) {\n    return true;\n  }\n\n  return false;\n}\n\n/**\n * Determines the visibility of a given tile.  The tile may be fully visible, partially visible, or not\n * visible at all.  Tiles that are renderable and are at least partially visible will be shown by a call\n * to {@link GlobeSurfaceTileProvider#showTileThisFrame}.\n *\n * @param {QuadtreeTile} tile The tile instance.\n * @param {FrameState} frameState The state information about the current frame.\n * @param {QuadtreeOccluders} occluders The objects that may occlude this tile.\n *\n * @returns {Visibility} Visibility.NONE if the tile is not visible,\n *                       Visibility.PARTIAL if the tile is partially visible, or\n *                       Visibility.FULL if the tile is fully visible.\n */\nGlobeSurfaceTileProvider.prototype.computeTileVisibility = function (\n  tile,\n  frameState,\n  occluders\n) {\n  const distance = this.computeDistanceToTile(tile, frameState);\n  tile._distance = distance;\n\n  const undergroundVisible = isUndergroundVisible(this, frameState);\n\n  if (frameState.fog.enabled && !undergroundVisible) {\n    if (CesiumMath.fog(distance, frameState.fog.density) >= 1.0) {\n      // Tile is completely in fog so return that it is not visible.\n      return Visibility.NONE;\n    }\n  }\n\n  const surfaceTile = tile.data;\n  const tileBoundingRegion = surfaceTile.tileBoundingRegion;\n\n  if (surfaceTile.boundingVolumeSourceTile === undefined) {\n    // We have no idea where this tile is, so let's just call it partially visible.\n    return Visibility.PARTIAL;\n  }\n\n  const cullingVolume = frameState.cullingVolume;\n  let boundingVolume = tileBoundingRegion.boundingVolume;\n\n  if (!defined(boundingVolume)) {\n    boundingVolume = tileBoundingRegion.boundingSphere;\n  }\n\n  // Check if the tile is outside the limit area in cartographic space\n  surfaceTile.clippedByBoundaries = false;\n  const clippedCartographicLimitRectangle = clipRectangleAntimeridian(\n    tile.rectangle,\n    this.cartographicLimitRectangle\n  );\n  const areaLimitIntersection = Rectangle.simpleIntersection(\n    clippedCartographicLimitRectangle,\n    tile.rectangle,\n    rectangleIntersectionScratch\n  );\n  if (!defined(areaLimitIntersection)) {\n    return Visibility.NONE;\n  }\n  if (!Rectangle.equals(areaLimitIntersection, tile.rectangle)) {\n    surfaceTile.clippedByBoundaries = true;\n  }\n\n  if (frameState.mode !== SceneMode.SCENE3D) {\n    boundingVolume = boundingSphereScratch;\n    BoundingSphere.fromRectangleWithHeights2D(\n      tile.rectangle,\n      frameState.mapProjection,\n      tileBoundingRegion.minimumHeight,\n      tileBoundingRegion.maximumHeight,\n      boundingVolume\n    );\n    Cartesian3.fromElements(\n      boundingVolume.center.z,\n      boundingVolume.center.x,\n      boundingVolume.center.y,\n      boundingVolume.center\n    );\n\n    if (\n      frameState.mode === SceneMode.MORPHING &&\n      defined(surfaceTile.renderedMesh)\n    ) {\n      boundingVolume = BoundingSphere.union(\n        tileBoundingRegion.boundingSphere,\n        boundingVolume,\n        boundingVolume\n      );\n    }\n  }\n\n  if (!defined(boundingVolume)) {\n    return Visibility.PARTIAL;\n  }\n\n  const clippingPlanes = this._clippingPlanes;\n  if (defined(clippingPlanes) && clippingPlanes.enabled) {\n    const planeIntersection = clippingPlanes.computeIntersectionWithBoundingVolume(\n      boundingVolume\n    );\n    tile.isClipped = planeIntersection !== Intersect.INSIDE;\n    if (planeIntersection === Intersect.OUTSIDE) {\n      return Visibility.NONE;\n    }\n  }\n\n  let visibility;\n  const intersection = cullingVolume.computeVisibility(boundingVolume);\n\n  if (intersection === Intersect.OUTSIDE) {\n    visibility = Visibility.NONE;\n  } else if (intersection === Intersect.INTERSECTING) {\n    visibility = Visibility.PARTIAL;\n  } else if (intersection === Intersect.INSIDE) {\n    visibility = Visibility.FULL;\n  }\n\n  if (visibility === Visibility.NONE) {\n    return visibility;\n  }\n\n  const ortho3D =\n    frameState.mode === SceneMode.SCENE3D &&\n    frameState.camera.frustum instanceof OrthographicFrustum;\n  if (\n    frameState.mode === SceneMode.SCENE3D &&\n    !ortho3D &&\n    defined(occluders) &&\n    !undergroundVisible\n  ) {\n    const occludeePointInScaledSpace = surfaceTile.occludeePointInScaledSpace;\n    if (!defined(occludeePointInScaledSpace)) {\n      return visibility;\n    }\n\n    if (\n      occluders.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(\n        occludeePointInScaledSpace,\n        tileBoundingRegion.minimumHeight\n      )\n    ) {\n      return visibility;\n    }\n\n    return Visibility.NONE;\n  }\n\n  return visibility;\n};\n\n/**\n * Determines if the given tile can be refined\n * @param {QuadtreeTile} tile The tile to check.\n * @returns {boolean} True if the tile can be refined, false if it cannot.\n */\nGlobeSurfaceTileProvider.prototype.canRefine = function (tile) {\n  // Only allow refinement it we know whether or not the children of this tile exist.\n  // For a tileset with `availability`, we'll always be able to refine.\n  // We can ask for availability of _any_ child tile because we only need to confirm\n  // that we get a yes or no answer, it doesn't matter what the answer is.\n  if (defined(tile.data.terrainData)) {\n    return true;\n  }\n  const childAvailable = this.terrainProvider.getTileDataAvailable(\n    tile.x * 2,\n    tile.y * 2,\n    tile.level + 1\n  );\n  return childAvailable !== undefined;\n};\n\nconst readyImageryScratch = [];\nconst canRenderTraversalStack = [];\n\n/**\n * Determines if the given not-fully-loaded tile can be rendered without losing detail that\n * was present last frame as a result of rendering descendant tiles. This method will only be\n * called if this tile's descendants were rendered last frame. If the tile is fully loaded,\n * it is assumed that this method will return true and it will not be called.\n * @param {QuadtreeTile} tile The tile to check.\n * @returns {boolean} True if the tile can be rendered without losing detail.\n */\nGlobeSurfaceTileProvider.prototype.canRenderWithoutLosingDetail = function (\n  tile,\n  frameState\n) {\n  const surfaceTile = tile.data;\n\n  const readyImagery = readyImageryScratch;\n  readyImagery.length = this._imageryLayers.length;\n\n  let terrainReady = false;\n  let initialImageryState = false;\n  let imagery;\n\n  if (defined(surfaceTile)) {\n    // We can render even with non-ready terrain as long as all our rendered descendants\n    // are missing terrain geometry too. i.e. if we rendered fills for more detailed tiles\n    // last frame, it's ok to render a fill for this tile this frame.\n    terrainReady = surfaceTile.terrainState === TerrainState.READY;\n\n    // Initially assume all imagery layers are ready, unless imagery hasn't been initialized at all.\n    initialImageryState = true;\n\n    imagery = surfaceTile.imagery;\n  }\n\n  let i;\n  let len;\n\n  for (i = 0, len = readyImagery.length; i < len; ++i) {\n    readyImagery[i] = initialImageryState;\n  }\n\n  if (defined(imagery)) {\n    for (i = 0, len = imagery.length; i < len; ++i) {\n      const tileImagery = imagery[i];\n      const loadingImagery = tileImagery.loadingImagery;\n      const isReady =\n        !defined(loadingImagery) ||\n        loadingImagery.state === ImageryState.FAILED ||\n        loadingImagery.state === ImageryState.INVALID;\n      const layerIndex = (\n        tileImagery.loadingImagery || tileImagery.readyImagery\n      ).imageryLayer._layerIndex;\n\n      // For a layer to be ready, all tiles belonging to that layer must be ready.\n      readyImagery[layerIndex] = isReady && readyImagery[layerIndex];\n    }\n  }\n\n  const lastFrame = this.quadtree._lastSelectionFrameNumber;\n\n  // Traverse the descendants looking for one with terrain or imagery that is not loaded on this tile.\n  const stack = canRenderTraversalStack;\n  stack.length = 0;\n  stack.push(\n    tile.southwestChild,\n    tile.southeastChild,\n    tile.northwestChild,\n    tile.northeastChild\n  );\n\n  while (stack.length > 0) {\n    const descendant = stack.pop();\n    const lastFrameSelectionResult =\n      descendant._lastSelectionResultFrame === lastFrame\n        ? descendant._lastSelectionResult\n        : TileSelectionResult.NONE;\n\n    if (lastFrameSelectionResult === TileSelectionResult.RENDERED) {\n      const descendantSurface = descendant.data;\n\n      if (!defined(descendantSurface)) {\n        // Descendant has no data, so it can't block rendering.\n        continue;\n      }\n\n      if (\n        !terrainReady &&\n        descendant.data.terrainState === TerrainState.READY\n      ) {\n        // Rendered descendant has real terrain, but we don't. Rendering is blocked.\n        return false;\n      }\n\n      const descendantImagery = descendant.data.imagery;\n      for (i = 0, len = descendantImagery.length; i < len; ++i) {\n        const descendantTileImagery = descendantImagery[i];\n        const descendantLoadingImagery = descendantTileImagery.loadingImagery;\n        const descendantIsReady =\n          !defined(descendantLoadingImagery) ||\n          descendantLoadingImagery.state === ImageryState.FAILED ||\n          descendantLoadingImagery.state === ImageryState.INVALID;\n        const descendantLayerIndex = (\n          descendantTileImagery.loadingImagery ||\n          descendantTileImagery.readyImagery\n        ).imageryLayer._layerIndex;\n\n        // If this imagery tile of a descendant is ready but the layer isn't ready in this tile,\n        // then rendering is blocked.\n        if (descendantIsReady && !readyImagery[descendantLayerIndex]) {\n          return false;\n        }\n      }\n    } else if (lastFrameSelectionResult === TileSelectionResult.REFINED) {\n      stack.push(\n        descendant.southwestChild,\n        descendant.southeastChild,\n        descendant.northwestChild,\n        descendant.northeastChild\n      );\n    }\n  }\n\n  return true;\n};\n\nconst tileDirectionScratch = new Cartesian3();\n\n/**\n * Determines the priority for loading this tile. Lower priority values load sooner.\n * @param {QuadtreeTile} tile The tile.\n * @param {FrameState} frameState The frame state.\n * @returns {number} The load priority value.\n */\nGlobeSurfaceTileProvider.prototype.computeTileLoadPriority = function (\n  tile,\n  frameState\n) {\n  const surfaceTile = tile.data;\n  if (surfaceTile === undefined) {\n    return 0.0;\n  }\n\n  const obb = surfaceTile.tileBoundingRegion.boundingVolume;\n  if (obb === undefined) {\n    return 0.0;\n  }\n\n  const cameraPosition = frameState.camera.positionWC;\n  const cameraDirection = frameState.camera.directionWC;\n  const tileDirection = Cartesian3.subtract(\n    obb.center,\n    cameraPosition,\n    tileDirectionScratch\n  );\n  const magnitude = Cartesian3.magnitude(tileDirection);\n  if (magnitude < CesiumMath.EPSILON5) {\n    return 0.0;\n  }\n  Cartesian3.divideByScalar(tileDirection, magnitude, tileDirection);\n  return (\n    (1.0 - Cartesian3.dot(tileDirection, cameraDirection)) * tile._distance\n  );\n};\n\nconst modifiedModelViewScratch = new Matrix4();\nconst modifiedModelViewProjectionScratch = new Matrix4();\nconst tileRectangleScratch = new Cartesian4();\nconst localizedCartographicLimitRectangleScratch = new Cartesian4();\nconst localizedTranslucencyRectangleScratch = new Cartesian4();\nconst rtcScratch = new Cartesian3();\nconst centerEyeScratch = new Cartesian3();\nconst southwestScratch = new Cartesian3();\nconst northeastScratch = new Cartesian3();\n\n/**\n * Shows a specified tile in this frame.  The provider can cause the tile to be shown by adding\n * render commands to the commandList, or use any other method as appropriate.  The tile is not\n * expected to be visible next frame as well, unless this method is called next frame, too.\n *\n * @param {QuadtreeTile} tile The tile instance.\n * @param {FrameState} frameState The state information of the current rendering frame.\n */\nGlobeSurfaceTileProvider.prototype.showTileThisFrame = function (\n  tile,\n  frameState\n) {\n  let readyTextureCount = 0;\n  const tileImageryCollection = tile.data.imagery;\n  for (let i = 0, len = tileImageryCollection.length; i < len; ++i) {\n    const tileImagery = tileImageryCollection[i];\n    if (\n      defined(tileImagery.readyImagery) &&\n      tileImagery.readyImagery.imageryLayer.alpha !== 0.0\n    ) {\n      ++readyTextureCount;\n    }\n  }\n\n  let tileSet = this._tilesToRenderByTextureCount[readyTextureCount];\n  if (!defined(tileSet)) {\n    tileSet = [];\n    this._tilesToRenderByTextureCount[readyTextureCount] = tileSet;\n  }\n\n  tileSet.push(tile);\n\n  const surfaceTile = tile.data;\n  if (!defined(surfaceTile.vertexArray)) {\n    this._hasFillTilesThisFrame = true;\n  } else {\n    this._hasLoadedTilesThisFrame = true;\n  }\n\n  const debug = this._debug;\n  ++debug.tilesRendered;\n  debug.texturesRendered += readyTextureCount;\n};\n\nconst cornerPositionsScratch = [\n  new Cartesian3(),\n  new Cartesian3(),\n  new Cartesian3(),\n  new Cartesian3(),\n];\n\nfunction computeOccludeePoint(\n  tileProvider,\n  center,\n  rectangle,\n  minimumHeight,\n  maximumHeight,\n  result\n) {\n  const ellipsoidalOccluder = tileProvider.quadtree._occluders.ellipsoid;\n  const ellipsoid = ellipsoidalOccluder.ellipsoid;\n\n  const cornerPositions = cornerPositionsScratch;\n  Cartesian3.fromRadians(\n    rectangle.west,\n    rectangle.south,\n    maximumHeight,\n    ellipsoid,\n    cornerPositions[0]\n  );\n  Cartesian3.fromRadians(\n    rectangle.east,\n    rectangle.south,\n    maximumHeight,\n    ellipsoid,\n    cornerPositions[1]\n  );\n  Cartesian3.fromRadians(\n    rectangle.west,\n    rectangle.north,\n    maximumHeight,\n    ellipsoid,\n    cornerPositions[2]\n  );\n  Cartesian3.fromRadians(\n    rectangle.east,\n    rectangle.north,\n    maximumHeight,\n    ellipsoid,\n    cornerPositions[3]\n  );\n\n  return ellipsoidalOccluder.computeHorizonCullingPointPossiblyUnderEllipsoid(\n    center,\n    cornerPositions,\n    minimumHeight,\n    result\n  );\n}\n\n/**\n * Gets the distance from the camera to the closest point on the tile.  This is used for level-of-detail selection.\n *\n * @param {QuadtreeTile} tile The tile instance.\n * @param {FrameState} frameState The state information of the current rendering frame.\n *\n * @returns {number} The distance from the camera to the closest point on the tile, in meters.\n */\nGlobeSurfaceTileProvider.prototype.computeDistanceToTile = function (\n  tile,\n  frameState\n) {\n  // The distance should be:\n  // 1. the actual distance to the tight-fitting bounding volume, or\n  // 2. a distance that is equal to or greater than the actual distance to the tight-fitting bounding volume.\n  //\n  // When we don't know the min/max heights for a tile, but we do know the min/max of an ancestor tile, we can\n  // build a tight-fitting bounding volume horizontally, but not vertically. The min/max heights from the\n  // ancestor will likely form a volume that is much bigger than it needs to be. This means that the volume may\n  // be deemed to be much closer to the camera than it really is, causing us to select tiles that are too detailed.\n  // Loading too-detailed tiles is super expensive, so we don't want to do that. We don't know where the child\n  // tile really lies within the parent range of heights, but we _do_ know the child tile can't be any closer than\n  // the ancestor height surface (min or max) that is _farthest away_ from the camera. So if we compute distance\n  // based on that conservative metric, we may end up loading tiles that are not detailed enough, but that's much\n  // better (faster) than loading tiles that are too detailed.\n\n  updateTileBoundingRegion(tile, this, frameState);\n\n  const surfaceTile = tile.data;\n  const boundingVolumeSourceTile = surfaceTile.boundingVolumeSourceTile;\n  if (boundingVolumeSourceTile === undefined) {\n    // Can't find any min/max heights anywhere? Ok, let's just say the\n    // tile is really far away so we'll load and render it rather than\n    // refining.\n    return 9999999999.0;\n  }\n\n  const tileBoundingRegion = surfaceTile.tileBoundingRegion;\n  const min = tileBoundingRegion.minimumHeight;\n  const max = tileBoundingRegion.maximumHeight;\n\n  if (surfaceTile.boundingVolumeSourceTile !== tile) {\n    const cameraHeight = frameState.camera.positionCartographic.height;\n    const distanceToMin = Math.abs(cameraHeight - min);\n    const distanceToMax = Math.abs(cameraHeight - max);\n    if (distanceToMin > distanceToMax) {\n      tileBoundingRegion.minimumHeight = min;\n      tileBoundingRegion.maximumHeight = min;\n    } else {\n      tileBoundingRegion.minimumHeight = max;\n      tileBoundingRegion.maximumHeight = max;\n    }\n  }\n\n  const result = tileBoundingRegion.distanceToCamera(frameState);\n\n  tileBoundingRegion.minimumHeight = min;\n  tileBoundingRegion.maximumHeight = max;\n\n  return result;\n};\n\nfunction updateTileBoundingRegion(tile, tileProvider, frameState) {\n  let surfaceTile = tile.data;\n  if (surfaceTile === undefined) {\n    surfaceTile = tile.data = new GlobeSurfaceTile();\n  }\n\n  const ellipsoid = tile.tilingScheme.ellipsoid;\n  if (surfaceTile.tileBoundingRegion === undefined) {\n    surfaceTile.tileBoundingRegion = new TileBoundingRegion({\n      computeBoundingVolumes: false,\n      rectangle: tile.rectangle,\n      ellipsoid: ellipsoid,\n      minimumHeight: 0.0,\n      maximumHeight: 0.0,\n    });\n  }\n\n  const tileBoundingRegion = surfaceTile.tileBoundingRegion;\n  const oldMinimumHeight = tileBoundingRegion.minimumHeight;\n  const oldMaximumHeight = tileBoundingRegion.maximumHeight;\n  let hasBoundingVolumesFromMesh = false;\n  let sourceTile = tile;\n\n  // Get min and max heights from the mesh.\n  // If the mesh is not available, get them from the terrain data.\n  // If the terrain data is not available either, get them from an ancestor.\n  // If none of the ancestors are available, then there are no min and max heights for this tile at this time.\n  const mesh = surfaceTile.mesh;\n  const terrainData = surfaceTile.terrainData;\n  if (\n    mesh !== undefined &&\n    mesh.minimumHeight !== undefined &&\n    mesh.maximumHeight !== undefined\n  ) {\n    tileBoundingRegion.minimumHeight = mesh.minimumHeight;\n    tileBoundingRegion.maximumHeight = mesh.maximumHeight;\n    hasBoundingVolumesFromMesh = true;\n  } else if (\n    terrainData !== undefined &&\n    terrainData._minimumHeight !== undefined &&\n    terrainData._maximumHeight !== undefined\n  ) {\n    tileBoundingRegion.minimumHeight = terrainData._minimumHeight;\n    tileBoundingRegion.maximumHeight = terrainData._maximumHeight;\n  } else {\n    // No accurate min/max heights available, so we're stuck with min/max heights from an ancestor tile.\n    tileBoundingRegion.minimumHeight = Number.NaN;\n    tileBoundingRegion.maximumHeight = Number.NaN;\n\n    let ancestorTile = tile.parent;\n    while (ancestorTile !== undefined) {\n      const ancestorSurfaceTile = ancestorTile.data;\n      if (ancestorSurfaceTile !== undefined) {\n        const ancestorMesh = ancestorSurfaceTile.mesh;\n        const ancestorTerrainData = ancestorSurfaceTile.terrainData;\n        if (\n          ancestorMesh !== undefined &&\n          ancestorMesh.minimumHeight !== undefined &&\n          ancestorMesh.maximumHeight !== undefined\n        ) {\n          tileBoundingRegion.minimumHeight = ancestorMesh.minimumHeight;\n          tileBoundingRegion.maximumHeight = ancestorMesh.maximumHeight;\n          break;\n        } else if (\n          ancestorTerrainData !== undefined &&\n          ancestorTerrainData._minimumHeight !== undefined &&\n          ancestorTerrainData._maximumHeight !== undefined\n        ) {\n          tileBoundingRegion.minimumHeight = ancestorTerrainData._minimumHeight;\n          tileBoundingRegion.maximumHeight = ancestorTerrainData._maximumHeight;\n          break;\n        }\n      }\n      ancestorTile = ancestorTile.parent;\n    }\n    sourceTile = ancestorTile;\n  }\n\n  // Update bounding regions from the min and max heights\n  if (sourceTile !== undefined) {\n    const exaggeration = frameState.verticalExaggeration;\n    const exaggerationRelativeHeight =\n      frameState.verticalExaggerationRelativeHeight;\n    const hasExaggeration = exaggeration !== 1.0;\n    if (hasExaggeration) {\n      hasBoundingVolumesFromMesh = false;\n      tileBoundingRegion.minimumHeight = VerticalExaggeration.getHeight(\n        tileBoundingRegion.minimumHeight,\n        exaggeration,\n        exaggerationRelativeHeight\n      );\n      tileBoundingRegion.maximumHeight = VerticalExaggeration.getHeight(\n        tileBoundingRegion.maximumHeight,\n        exaggeration,\n        exaggerationRelativeHeight\n      );\n    }\n\n    if (hasBoundingVolumesFromMesh) {\n      if (!surfaceTile.boundingVolumeIsFromMesh) {\n        tileBoundingRegion._orientedBoundingBox = OrientedBoundingBox.clone(\n          mesh.orientedBoundingBox,\n          tileBoundingRegion._orientedBoundingBox\n        );\n        tileBoundingRegion._boundingSphere = BoundingSphere.clone(\n          mesh.boundingSphere3D,\n          tileBoundingRegion._boundingSphere\n        );\n        surfaceTile.occludeePointInScaledSpace = Cartesian3.clone(\n          mesh.occludeePointInScaledSpace,\n          surfaceTile.occludeePointInScaledSpace\n        );\n\n        // If the occludee point is not defined, fallback to calculating it from the OBB\n        if (!defined(surfaceTile.occludeePointInScaledSpace)) {\n          surfaceTile.occludeePointInScaledSpace = computeOccludeePoint(\n            tileProvider,\n            tileBoundingRegion._orientedBoundingBox.center,\n            tile.rectangle,\n            tileBoundingRegion.minimumHeight,\n            tileBoundingRegion.maximumHeight,\n            surfaceTile.occludeePointInScaledSpace\n          );\n        }\n      }\n    } else {\n      const needsBounds =\n        tileBoundingRegion._orientedBoundingBox === undefined ||\n        tileBoundingRegion._boundingSphere === undefined;\n      const heightChanged =\n        tileBoundingRegion.minimumHeight !== oldMinimumHeight ||\n        tileBoundingRegion.maximumHeight !== oldMaximumHeight;\n      if (heightChanged || needsBounds) {\n        // Bounding volumes need to be recomputed in some circumstances\n        tileBoundingRegion.computeBoundingVolumes(ellipsoid);\n        surfaceTile.occludeePointInScaledSpace = computeOccludeePoint(\n          tileProvider,\n          tileBoundingRegion._orientedBoundingBox.center,\n          tile.rectangle,\n          tileBoundingRegion.minimumHeight,\n          tileBoundingRegion.maximumHeight,\n          surfaceTile.occludeePointInScaledSpace\n        );\n      }\n    }\n    surfaceTile.boundingVolumeSourceTile = sourceTile;\n    surfaceTile.boundingVolumeIsFromMesh = hasBoundingVolumesFromMesh;\n  } else {\n    surfaceTile.boundingVolumeSourceTile = undefined;\n    surfaceTile.boundingVolumeIsFromMesh = false;\n  }\n}\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see GlobeSurfaceTileProvider#destroy\n */\nGlobeSurfaceTileProvider.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * provider = provider && provider();\n *\n * @see GlobeSurfaceTileProvider#isDestroyed\n */\nGlobeSurfaceTileProvider.prototype.destroy = function () {\n  this._tileProvider = this._tileProvider && this._tileProvider.destroy();\n  this._clippingPlanes = this._clippingPlanes && this._clippingPlanes.destroy();\n  this._removeLayerAddedListener =\n    this._removeLayerAddedListener && this._removeLayerAddedListener();\n  this._removeLayerRemovedListener =\n    this._removeLayerRemovedListener && this._removeLayerRemovedListener();\n  this._removeLayerMovedListener =\n    this._removeLayerMovedListener && this._removeLayerMovedListener();\n  this._removeLayerShownListener =\n    this._removeLayerShownListener && this._removeLayerShownListener();\n\n  return destroyObject(this);\n};\n\nfunction getTileReadyCallback(tileImageriesToFree, layer, terrainProvider) {\n  return function (tile) {\n    let tileImagery;\n    let imagery;\n    let startIndex = -1;\n    const tileImageryCollection = tile.data.imagery;\n    const length = tileImageryCollection.length;\n    let i;\n    for (i = 0; i < length; ++i) {\n      tileImagery = tileImageryCollection[i];\n      imagery = defaultValue(\n        tileImagery.readyImagery,\n        tileImagery.loadingImagery\n      );\n      if (imagery.imageryLayer === layer) {\n        startIndex = i;\n        break;\n      }\n    }\n\n    if (startIndex !== -1) {\n      const endIndex = startIndex + tileImageriesToFree;\n      tileImagery = tileImageryCollection[endIndex];\n      imagery = defined(tileImagery)\n        ? defaultValue(tileImagery.readyImagery, tileImagery.loadingImagery)\n        : undefined;\n      if (!defined(imagery) || imagery.imageryLayer !== layer) {\n        // Return false to keep the callback if we have to wait on the skeletons\n        // Return true to remove the callback if something went wrong\n        return !layer._createTileImagerySkeletons(\n          tile,\n          terrainProvider,\n          endIndex\n        );\n      }\n\n      for (i = startIndex; i < endIndex; ++i) {\n        tileImageryCollection[i].freeResources();\n      }\n\n      tileImageryCollection.splice(startIndex, tileImageriesToFree);\n    }\n\n    return true; // Everything is done, so remove the callback\n  };\n}\n\nGlobeSurfaceTileProvider.prototype._onLayerAdded = function (layer, index) {\n  if (this.isDestroyed()) {\n    return;\n  }\n\n  if (layer.show) {\n    const terrainProvider = this._terrainProvider;\n\n    const that = this;\n    const tileImageryUpdatedEvent = this._imageryLayersUpdatedEvent;\n    const reloadFunction = function () {\n      // Clear the layer's cache\n      layer._imageryCache = {};\n\n      that._quadtree.forEachLoadedTile(function (tile) {\n        // If this layer is still waiting to for the loaded callback, just return\n        if (defined(tile._loadedCallbacks[layer._layerIndex])) {\n          return;\n        }\n\n        let i;\n\n        // Figure out how many TileImageries we will need to remove and where to insert new ones\n        const tileImageryCollection = tile.data.imagery;\n        const length = tileImageryCollection.length;\n        let startIndex = -1;\n        let tileImageriesToFree = 0;\n        for (i = 0; i < length; ++i) {\n          const tileImagery = tileImageryCollection[i];\n          const imagery = defaultValue(\n            tileImagery.readyImagery,\n            tileImagery.loadingImagery\n          );\n          if (imagery.imageryLayer === layer) {\n            if (startIndex === -1) {\n              startIndex = i;\n            }\n\n            ++tileImageriesToFree;\n          } else if (startIndex !== -1) {\n            // iterated past the section of TileImageries belonging to this layer, no need to continue.\n            break;\n          }\n        }\n\n        if (startIndex === -1) {\n          return;\n        }\n\n        // Insert immediately after existing TileImageries\n        const insertionPoint = startIndex + tileImageriesToFree;\n\n        // Create new TileImageries for all loaded tiles\n        if (\n          layer._createTileImagerySkeletons(\n            tile,\n            terrainProvider,\n            insertionPoint\n          )\n        ) {\n          // Add callback to remove old TileImageries when the new TileImageries are ready\n          tile._loadedCallbacks[layer._layerIndex] = getTileReadyCallback(\n            tileImageriesToFree,\n            layer,\n            terrainProvider\n          );\n\n          tile.state = QuadtreeTileLoadState.LOADING;\n        }\n      });\n    };\n\n    if (layer.ready) {\n      const imageryProvider = layer.imageryProvider;\n      imageryProvider._reload = reloadFunction;\n    }\n\n    // create TileImageries for this layer for all previously loaded tiles\n    this._quadtree.forEachLoadedTile(function (tile) {\n      if (layer._createTileImagerySkeletons(tile, terrainProvider)) {\n        tile.state = QuadtreeTileLoadState.LOADING;\n\n        // Tiles that are not currently being rendered need to load the new layer before they're renderable.\n        // We don't mark the rendered tiles non-renderable, though, because that would make the globe disappear.\n        if (\n          tile.level !== 0 &&\n          (tile._lastSelectionResultFrame !==\n            that.quadtree._lastSelectionFrameNumber ||\n            tile._lastSelectionResult !== TileSelectionResult.RENDERED)\n        ) {\n          tile.renderable = false;\n        }\n      }\n    });\n\n    this._layerOrderChanged = true;\n    tileImageryUpdatedEvent.raiseEvent();\n  }\n};\n\nGlobeSurfaceTileProvider.prototype._onLayerRemoved = function (layer, index) {\n  // destroy TileImagerys for this layer for all previously loaded tiles\n  this._quadtree.forEachLoadedTile(function (tile) {\n    const tileImageryCollection = tile.data.imagery;\n\n    let startIndex = -1;\n    let numDestroyed = 0;\n    for (let i = 0, len = tileImageryCollection.length; i < len; ++i) {\n      const tileImagery = tileImageryCollection[i];\n      let imagery = tileImagery.loadingImagery;\n      if (!defined(imagery)) {\n        imagery = tileImagery.readyImagery;\n      }\n      if (imagery.imageryLayer === layer) {\n        if (startIndex === -1) {\n          startIndex = i;\n        }\n\n        tileImagery.freeResources();\n        ++numDestroyed;\n      } else if (startIndex !== -1) {\n        // iterated past the section of TileImagerys belonging to this layer, no need to continue.\n        break;\n      }\n    }\n\n    if (startIndex !== -1) {\n      tileImageryCollection.splice(startIndex, numDestroyed);\n    }\n  });\n\n  if (defined(layer.imageryProvider)) {\n    layer.imageryProvider._reload = undefined;\n  }\n\n  this._imageryLayersUpdatedEvent.raiseEvent();\n};\n\nGlobeSurfaceTileProvider.prototype._onLayerMoved = function (\n  layer,\n  newIndex,\n  oldIndex\n) {\n  this._layerOrderChanged = true;\n  this._imageryLayersUpdatedEvent.raiseEvent();\n};\n\nGlobeSurfaceTileProvider.prototype._onLayerShownOrHidden = function (\n  layer,\n  index,\n  show\n) {\n  if (show) {\n    this._onLayerAdded(layer, index);\n  } else {\n    this._onLayerRemoved(layer, index);\n  }\n};\n\nconst scratchClippingPlanesMatrix = new Matrix4();\nconst scratchInverseTransposeClippingPlanesMatrix = new Matrix4();\nfunction createTileUniformMap(frameState, globeSurfaceTileProvider) {\n  const uniformMap = {\n    u_initialColor: function () {\n      return this.properties.initialColor;\n    },\n    u_fillHighlightColor: function () {\n      return this.properties.fillHighlightColor;\n    },\n    u_zoomedOutOceanSpecularIntensity: function () {\n      return this.properties.zoomedOutOceanSpecularIntensity;\n    },\n    u_oceanNormalMap: function () {\n      return this.properties.oceanNormalMap;\n    },\n    u_atmosphereLightIntensity: function () {\n      return this.properties.atmosphereLightIntensity;\n    },\n    u_atmosphereRayleighCoefficient: function () {\n      return this.properties.atmosphereRayleighCoefficient;\n    },\n    u_atmosphereMieCoefficient: function () {\n      return this.properties.atmosphereMieCoefficient;\n    },\n    u_atmosphereRayleighScaleHeight: function () {\n      return this.properties.atmosphereRayleighScaleHeight;\n    },\n    u_atmosphereMieScaleHeight: function () {\n      return this.properties.atmosphereMieScaleHeight;\n    },\n    u_atmosphereMieAnisotropy: function () {\n      return this.properties.atmosphereMieAnisotropy;\n    },\n    u_lightingFadeDistance: function () {\n      return this.properties.lightingFadeDistance;\n    },\n    u_nightFadeDistance: function () {\n      return this.properties.nightFadeDistance;\n    },\n    u_center3D: function () {\n      return this.properties.center3D;\n    },\n    u_verticalExaggerationAndRelativeHeight: function () {\n      return this.properties.verticalExaggerationAndRelativeHeight;\n    },\n    u_tileRectangle: function () {\n      return this.properties.tileRectangle;\n    },\n    u_modifiedModelView: function () {\n      const viewMatrix = frameState.context.uniformState.view;\n      const centerEye = Matrix4.multiplyByPoint(\n        viewMatrix,\n        this.properties.rtc,\n        centerEyeScratch\n      );\n      Matrix4.setTranslation(viewMatrix, centerEye, modifiedModelViewScratch);\n      return modifiedModelViewScratch;\n    },\n    u_modifiedModelViewProjection: function () {\n      const viewMatrix = frameState.context.uniformState.view;\n      const projectionMatrix = frameState.context.uniformState.projection;\n      const centerEye = Matrix4.multiplyByPoint(\n        viewMatrix,\n        this.properties.rtc,\n        centerEyeScratch\n      );\n      Matrix4.setTranslation(\n        viewMatrix,\n        centerEye,\n        modifiedModelViewProjectionScratch\n      );\n      Matrix4.multiply(\n        projectionMatrix,\n        modifiedModelViewProjectionScratch,\n        modifiedModelViewProjectionScratch\n      );\n      return modifiedModelViewProjectionScratch;\n    },\n    u_dayTextures: function () {\n      return this.properties.dayTextures;\n    },\n    u_dayTextureTranslationAndScale: function () {\n      return this.properties.dayTextureTranslationAndScale;\n    },\n    u_dayTextureTexCoordsRectangle: function () {\n      return this.properties.dayTextureTexCoordsRectangle;\n    },\n    u_dayTextureUseWebMercatorT: function () {\n      return this.properties.dayTextureUseWebMercatorT;\n    },\n    u_dayTextureAlpha: function () {\n      return this.properties.dayTextureAlpha;\n    },\n    u_dayTextureNightAlpha: function () {\n      return this.properties.dayTextureNightAlpha;\n    },\n    u_dayTextureDayAlpha: function () {\n      return this.properties.dayTextureDayAlpha;\n    },\n    u_dayTextureBrightness: function () {\n      return this.properties.dayTextureBrightness;\n    },\n    u_dayTextureContrast: function () {\n      return this.properties.dayTextureContrast;\n    },\n    u_dayTextureHue: function () {\n      return this.properties.dayTextureHue;\n    },\n    u_dayTextureSaturation: function () {\n      return this.properties.dayTextureSaturation;\n    },\n    u_dayTextureOneOverGamma: function () {\n      return this.properties.dayTextureOneOverGamma;\n    },\n    u_dayIntensity: function () {\n      return this.properties.dayIntensity;\n    },\n    u_southAndNorthLatitude: function () {\n      return this.properties.southAndNorthLatitude;\n    },\n    u_southMercatorYAndOneOverHeight: function () {\n      return this.properties.southMercatorYAndOneOverHeight;\n    },\n    u_waterMask: function () {\n      return this.properties.waterMask;\n    },\n    u_waterMaskTranslationAndScale: function () {\n      return this.properties.waterMaskTranslationAndScale;\n    },\n    u_minMaxHeight: function () {\n      return this.properties.minMaxHeight;\n    },\n    u_scaleAndBias: function () {\n      return this.properties.scaleAndBias;\n    },\n    u_dayTextureSplit: function () {\n      return this.properties.dayTextureSplit;\n    },\n    u_dayTextureCutoutRectangles: function () {\n      return this.properties.dayTextureCutoutRectangles;\n    },\n    u_clippingPlanes: function () {\n      const clippingPlanes = globeSurfaceTileProvider._clippingPlanes;\n      if (defined(clippingPlanes) && defined(clippingPlanes.texture)) {\n        // Check in case clippingPlanes hasn't been updated yet.\n        return clippingPlanes.texture;\n      }\n      return frameState.context.defaultTexture;\n    },\n    u_cartographicLimitRectangle: function () {\n      return this.properties.localizedCartographicLimitRectangle;\n    },\n    u_clippingPlanesMatrix: function () {\n      const clippingPlanes = globeSurfaceTileProvider._clippingPlanes;\n      const transform = defined(clippingPlanes)\n        ? Matrix4.multiply(\n            frameState.context.uniformState.view,\n            clippingPlanes.modelMatrix,\n            scratchClippingPlanesMatrix\n          )\n        : Matrix4.IDENTITY;\n\n      return Matrix4.inverseTranspose(\n        transform,\n        scratchInverseTransposeClippingPlanesMatrix\n      );\n    },\n    u_clippingPlanesEdgeStyle: function () {\n      const style = this.properties.clippingPlanesEdgeColor;\n      style.alpha = this.properties.clippingPlanesEdgeWidth;\n      return style;\n    },\n    u_minimumBrightness: function () {\n      return frameState.fog.minimumBrightness;\n    },\n    u_hsbShift: function () {\n      return this.properties.hsbShift;\n    },\n    u_colorsToAlpha: function () {\n      return this.properties.colorsToAlpha;\n    },\n    u_frontFaceAlphaByDistance: function () {\n      return this.properties.frontFaceAlphaByDistance;\n    },\n    u_backFaceAlphaByDistance: function () {\n      return this.properties.backFaceAlphaByDistance;\n    },\n    u_translucencyRectangle: function () {\n      return this.properties.localizedTranslucencyRectangle;\n    },\n    u_undergroundColor: function () {\n      return this.properties.undergroundColor;\n    },\n    u_undergroundColorAlphaByDistance: function () {\n      return this.properties.undergroundColorAlphaByDistance;\n    },\n    u_lambertDiffuseMultiplier: function () {\n      return this.properties.lambertDiffuseMultiplier;\n    },\n    u_vertexShadowDarkness: function () {\n      return this.properties.vertexShadowDarkness;\n    },\n\n    // make a separate object so that changes to the properties are seen on\n    // derived commands that combine another uniform map with this one.\n    properties: {\n      initialColor: new Cartesian4(0.0, 0.0, 0.5, 1.0),\n      fillHighlightColor: new Color(0.0, 0.0, 0.0, 0.0),\n      zoomedOutOceanSpecularIntensity: 0.5,\n      oceanNormalMap: undefined,\n      lightingFadeDistance: new Cartesian2(6500000.0, 9000000.0),\n      nightFadeDistance: new Cartesian2(10000000.0, 40000000.0),\n      atmosphereLightIntensity: 10.0,\n      atmosphereRayleighCoefficient: new Cartesian3(5.5e-6, 13.0e-6, 28.4e-6),\n      atmosphereMieCoefficient: new Cartesian3(21e-6, 21e-6, 21e-6),\n      atmosphereRayleighScaleHeight: 10000.0,\n      atmosphereMieScaleHeight: 3200.0,\n      atmosphereMieAnisotropy: 0.9,\n      hsbShift: new Cartesian3(),\n\n      center3D: undefined,\n      rtc: new Cartesian3(),\n      modifiedModelView: new Matrix4(),\n      tileRectangle: new Cartesian4(),\n\n      verticalExaggerationAndRelativeHeight: new Cartesian2(1.0, 0.0),\n\n      dayTextures: [],\n      dayTextureTranslationAndScale: [],\n      dayTextureTexCoordsRectangle: [],\n      dayTextureUseWebMercatorT: [],\n      dayTextureAlpha: [],\n      dayTextureNightAlpha: [],\n      dayTextureDayAlpha: [],\n      dayTextureBrightness: [],\n      dayTextureContrast: [],\n      dayTextureHue: [],\n      dayTextureSaturation: [],\n      dayTextureOneOverGamma: [],\n      dayTextureSplit: [],\n      dayTextureCutoutRectangles: [],\n      dayIntensity: 0.0,\n      colorsToAlpha: [],\n\n      southAndNorthLatitude: new Cartesian2(),\n      southMercatorYAndOneOverHeight: new Cartesian2(),\n\n      waterMask: undefined,\n      waterMaskTranslationAndScale: new Cartesian4(),\n\n      minMaxHeight: new Cartesian2(),\n      scaleAndBias: new Matrix4(),\n      clippingPlanesEdgeColor: Color.clone(Color.WHITE),\n      clippingPlanesEdgeWidth: 0.0,\n\n      localizedCartographicLimitRectangle: new Cartesian4(),\n\n      frontFaceAlphaByDistance: new Cartesian4(),\n      backFaceAlphaByDistance: new Cartesian4(),\n      localizedTranslucencyRectangle: new Cartesian4(),\n      undergroundColor: Color.clone(Color.TRANSPARENT),\n      undergroundColorAlphaByDistance: new Cartesian4(),\n      lambertDiffuseMultiplier: 0.0,\n      vertexShadowDarkness: 0.0,\n    },\n  };\n\n  if (defined(globeSurfaceTileProvider.materialUniformMap)) {\n    return combine(uniformMap, globeSurfaceTileProvider.materialUniformMap);\n  }\n\n  return uniformMap;\n}\n\nfunction createWireframeVertexArrayIfNecessary(context, provider, tile) {\n  const surfaceTile = tile.data;\n\n  let mesh;\n  let vertexArray;\n\n  if (defined(surfaceTile.vertexArray)) {\n    mesh = surfaceTile.mesh;\n    vertexArray = surfaceTile.vertexArray;\n  } else if (\n    defined(surfaceTile.fill) &&\n    defined(surfaceTile.fill.vertexArray)\n  ) {\n    mesh = surfaceTile.fill.mesh;\n    vertexArray = surfaceTile.fill.vertexArray;\n  }\n\n  if (!defined(mesh) || !defined(vertexArray)) {\n    return;\n  }\n\n  if (defined(surfaceTile.wireframeVertexArray)) {\n    if (surfaceTile.wireframeVertexArray.mesh === mesh) {\n      return;\n    }\n\n    surfaceTile.wireframeVertexArray.destroy();\n    surfaceTile.wireframeVertexArray = undefined;\n  }\n\n  surfaceTile.wireframeVertexArray = createWireframeVertexArray(\n    context,\n    vertexArray,\n    mesh\n  );\n  surfaceTile.wireframeVertexArray.mesh = mesh;\n}\n\n/**\n * Creates a vertex array for wireframe rendering of a terrain tile.\n *\n * @private\n *\n * @param {Context} context The context in which to create the vertex array.\n * @param {VertexArray} vertexArray The existing, non-wireframe vertex array.  The new vertex array\n *                      will share vertex buffers with this existing one.\n * @param {TerrainMesh} terrainMesh The terrain mesh containing non-wireframe indices.\n * @returns {VertexArray} The vertex array for wireframe rendering.\n */\nfunction createWireframeVertexArray(context, vertexArray, terrainMesh) {\n  const indices = terrainMesh.indices;\n\n  const geometry = {\n    indices: indices,\n    primitiveType: PrimitiveType.TRIANGLES,\n  };\n\n  GeometryPipeline.toWireframe(geometry);\n\n  const wireframeIndices = geometry.indices;\n  const wireframeIndexBuffer = Buffer.createIndexBuffer({\n    context: context,\n    typedArray: wireframeIndices,\n    usage: BufferUsage.STATIC_DRAW,\n    indexDatatype: IndexDatatype.fromSizeInBytes(\n      wireframeIndices.BYTES_PER_ELEMENT\n    ),\n  });\n  return new VertexArray({\n    context: context,\n    attributes: vertexArray._attributes,\n    indexBuffer: wireframeIndexBuffer,\n  });\n}\n\nlet getDebugOrientedBoundingBox;\nlet getDebugBoundingSphere;\nlet debugDestroyPrimitive;\n\n(function () {\n  const instanceOBB = new GeometryInstance({\n    geometry: BoxOutlineGeometry.fromDimensions({\n      dimensions: new Cartesian3(2.0, 2.0, 2.0),\n    }),\n  });\n  const instanceSphere = new GeometryInstance({\n    geometry: new SphereOutlineGeometry({ radius: 1.0 }),\n  });\n  let modelMatrix = new Matrix4();\n  let previousVolume;\n  let primitive;\n\n  function createDebugPrimitive(instance) {\n    return new Primitive({\n      geometryInstances: instance,\n      appearance: new PerInstanceColorAppearance({\n        translucent: false,\n        flat: true,\n      }),\n      asynchronous: false,\n    });\n  }\n\n  getDebugOrientedBoundingBox = function (obb, color) {\n    if (obb === previousVolume) {\n      return primitive;\n    }\n    debugDestroyPrimitive();\n\n    previousVolume = obb;\n    modelMatrix = Matrix4.fromRotationTranslation(\n      obb.halfAxes,\n      obb.center,\n      modelMatrix\n    );\n\n    instanceOBB.modelMatrix = modelMatrix;\n    instanceOBB.attributes.color = ColorGeometryInstanceAttribute.fromColor(\n      color\n    );\n\n    primitive = createDebugPrimitive(instanceOBB);\n    return primitive;\n  };\n\n  getDebugBoundingSphere = function (sphere, color) {\n    if (sphere === previousVolume) {\n      return primitive;\n    }\n    debugDestroyPrimitive();\n\n    previousVolume = sphere;\n    modelMatrix = Matrix4.fromTranslation(sphere.center, modelMatrix);\n    modelMatrix = Matrix4.multiplyByUniformScale(\n      modelMatrix,\n      sphere.radius,\n      modelMatrix\n    );\n\n    instanceSphere.modelMatrix = modelMatrix;\n    instanceSphere.attributes.color = ColorGeometryInstanceAttribute.fromColor(\n      color\n    );\n\n    primitive = createDebugPrimitive(instanceSphere);\n    return primitive;\n  };\n\n  debugDestroyPrimitive = function () {\n    if (defined(primitive)) {\n      primitive.destroy();\n      primitive = undefined;\n      previousVolume = undefined;\n    }\n  };\n})();\n\nconst otherPassesInitialColor = new Cartesian4(0.0, 0.0, 0.0, 0.0);\nconst surfaceShaderSetOptionsScratch = {\n  frameState: undefined,\n  surfaceTile: undefined,\n  numberOfDayTextures: undefined,\n  applyBrightness: undefined,\n  applyContrast: undefined,\n  applyHue: undefined,\n  applySaturation: undefined,\n  applyGamma: undefined,\n  applyAlpha: undefined,\n  applyDayNightAlpha: undefined,\n  applySplit: undefined,\n  showReflectiveOcean: undefined,\n  showOceanWaves: undefined,\n  enableLighting: undefined,\n  dynamicAtmosphereLighting: undefined,\n  dynamicAtmosphereLightingFromSun: undefined,\n  showGroundAtmosphere: undefined,\n  perFragmentGroundAtmosphere: undefined,\n  hasVertexNormals: undefined,\n  useWebMercatorProjection: undefined,\n  enableFog: undefined,\n  enableClippingPlanes: undefined,\n  clippingPlanes: undefined,\n  clippedByBoundaries: undefined,\n  hasImageryLayerCutout: undefined,\n  colorCorrect: undefined,\n  colorToAlpha: undefined,\n  hasGeodeticSurfaceNormals: undefined,\n  hasExaggeration: undefined,\n};\n\nconst defaultUndergroundColor = Color.TRANSPARENT;\nconst defaultUndergroundColorAlphaByDistance = new NearFarScalar();\n\nfunction addDrawCommandsForTile(tileProvider, tile, frameState) {\n  const surfaceTile = tile.data;\n\n  if (!defined(surfaceTile.vertexArray)) {\n    if (surfaceTile.fill === undefined) {\n      // No fill was created for this tile, probably because this tile is not connected to\n      // any renderable tiles. So create a simple tile in the middle of the tile's possible\n      // height range.\n      surfaceTile.fill = new TerrainFillMesh(tile);\n    }\n    surfaceTile.fill.update(tileProvider, frameState);\n  }\n\n  const creditDisplay = frameState.creditDisplay;\n\n  const terrainData = surfaceTile.terrainData;\n  if (defined(terrainData) && defined(terrainData.credits)) {\n    const tileCredits = terrainData.credits;\n    for (\n      let tileCreditIndex = 0, tileCreditLength = tileCredits.length;\n      tileCreditIndex < tileCreditLength;\n      ++tileCreditIndex\n    ) {\n      creditDisplay.addCreditToNextFrame(tileCredits[tileCreditIndex]);\n    }\n  }\n\n  let maxTextures = ContextLimits.maximumTextureImageUnits;\n\n  let waterMaskTexture = surfaceTile.waterMaskTexture;\n  let waterMaskTranslationAndScale = surfaceTile.waterMaskTranslationAndScale;\n  if (!defined(waterMaskTexture) && defined(surfaceTile.fill)) {\n    waterMaskTexture = surfaceTile.fill.waterMaskTexture;\n    waterMaskTranslationAndScale =\n      surfaceTile.fill.waterMaskTranslationAndScale;\n  }\n\n  const cameraUnderground = frameState.cameraUnderground;\n\n  const globeTranslucencyState = frameState.globeTranslucencyState;\n  const translucent = globeTranslucencyState.translucent;\n  const frontFaceAlphaByDistance =\n    globeTranslucencyState.frontFaceAlphaByDistance;\n  const backFaceAlphaByDistance =\n    globeTranslucencyState.backFaceAlphaByDistance;\n  const translucencyRectangle = globeTranslucencyState.rectangle;\n\n  const undergroundColor = defaultValue(\n    tileProvider.undergroundColor,\n    defaultUndergroundColor\n  );\n  const undergroundColorAlphaByDistance = defaultValue(\n    tileProvider.undergroundColorAlphaByDistance,\n    defaultUndergroundColorAlphaByDistance\n  );\n  const showUndergroundColor =\n    isUndergroundVisible(tileProvider, frameState) &&\n    frameState.mode === SceneMode.SCENE3D &&\n    undergroundColor.alpha > 0.0 &&\n    (undergroundColorAlphaByDistance.nearValue > 0.0 ||\n      undergroundColorAlphaByDistance.farValue > 0.0);\n\n  const lambertDiffuseMultiplier = tileProvider.lambertDiffuseMultiplier;\n  const vertexShadowDarkness = tileProvider.vertexShadowDarkness;\n\n  const showReflectiveOcean =\n    tileProvider.hasWaterMask && defined(waterMaskTexture);\n  const oceanNormalMap = tileProvider.oceanNormalMap;\n  const showOceanWaves = showReflectiveOcean && defined(oceanNormalMap);\n  const terrainProvider = tileProvider.terrainProvider;\n  const hasVertexNormals =\n    defined(terrainProvider) && tileProvider.terrainProvider.hasVertexNormals;\n  const enableFog =\n    frameState.fog.enabled && frameState.fog.renderable && !cameraUnderground;\n  const showGroundAtmosphere =\n    tileProvider.showGroundAtmosphere && frameState.mode === SceneMode.SCENE3D;\n  const castShadows =\n    ShadowMode.castShadows(tileProvider.shadows) && !translucent;\n  const receiveShadows =\n    ShadowMode.receiveShadows(tileProvider.shadows) && !translucent;\n\n  const hueShift = tileProvider.hueShift;\n  const saturationShift = tileProvider.saturationShift;\n  const brightnessShift = tileProvider.brightnessShift;\n\n  let colorCorrect = !(\n    CesiumMath.equalsEpsilon(hueShift, 0.0, CesiumMath.EPSILON7) &&\n    CesiumMath.equalsEpsilon(saturationShift, 0.0, CesiumMath.EPSILON7) &&\n    CesiumMath.equalsEpsilon(brightnessShift, 0.0, CesiumMath.EPSILON7)\n  );\n\n  let perFragmentGroundAtmosphere = false;\n  if (showGroundAtmosphere) {\n    const cameraDistance = Cartesian3.magnitude(frameState.camera.positionWC);\n    const fadeOutDistance = tileProvider.nightFadeOutDistance;\n    perFragmentGroundAtmosphere = cameraDistance > fadeOutDistance;\n  }\n\n  if (showReflectiveOcean) {\n    --maxTextures;\n  }\n  if (showOceanWaves) {\n    --maxTextures;\n  }\n  if (\n    defined(frameState.shadowState) &&\n    frameState.shadowState.shadowsEnabled\n  ) {\n    --maxTextures;\n  }\n  if (\n    defined(tileProvider.clippingPlanes) &&\n    tileProvider.clippingPlanes.enabled\n  ) {\n    --maxTextures;\n  }\n\n  maxTextures -= globeTranslucencyState.numberOfTextureUniforms;\n\n  const mesh = surfaceTile.renderedMesh;\n  let rtc = mesh.center;\n  const encoding = mesh.encoding;\n  const tileBoundingRegion = surfaceTile.tileBoundingRegion;\n\n  const exaggeration = frameState.verticalExaggeration;\n  const exaggerationRelativeHeight =\n    frameState.verticalExaggerationRelativeHeight;\n  const hasExaggeration = exaggeration !== 1.0;\n  const hasGeodeticSurfaceNormals = encoding.hasGeodeticSurfaceNormals;\n\n  // Not used in 3D.\n  const tileRectangle = tileRectangleScratch;\n\n  // Only used for Mercator projections.\n  let southLatitude = 0.0;\n  let northLatitude = 0.0;\n  let southMercatorY = 0.0;\n  let oneOverMercatorHeight = 0.0;\n\n  let useWebMercatorProjection = false;\n\n  if (frameState.mode !== SceneMode.SCENE3D) {\n    const projection = frameState.mapProjection;\n    const southwest = projection.project(\n      Rectangle.southwest(tile.rectangle),\n      southwestScratch\n    );\n    const northeast = projection.project(\n      Rectangle.northeast(tile.rectangle),\n      northeastScratch\n    );\n\n    tileRectangle.x = southwest.x;\n    tileRectangle.y = southwest.y;\n    tileRectangle.z = northeast.x;\n    tileRectangle.w = northeast.y;\n\n    // In 2D and Columbus View, use the center of the tile for RTC rendering.\n    if (frameState.mode !== SceneMode.MORPHING) {\n      rtc = rtcScratch;\n      rtc.x = 0.0;\n      rtc.y = (tileRectangle.z + tileRectangle.x) * 0.5;\n      rtc.z = (tileRectangle.w + tileRectangle.y) * 0.5;\n      tileRectangle.x -= rtc.y;\n      tileRectangle.y -= rtc.z;\n      tileRectangle.z -= rtc.y;\n      tileRectangle.w -= rtc.z;\n    }\n\n    if (\n      frameState.mode === SceneMode.SCENE2D &&\n      encoding.quantization === TerrainQuantization.BITS12\n    ) {\n      // In 2D, the texture coordinates of the tile are interpolated over the rectangle to get the position in the vertex shader.\n      // When the texture coordinates are quantized, error is introduced. This can be seen through the 1px wide cracking\n      // between the quantized tiles in 2D. To compensate for the error, move the expand the rectangle in each direction by\n      // half the error amount.\n      const epsilon = (1.0 / (Math.pow(2.0, 12.0) - 1.0)) * 0.5;\n      const widthEpsilon = (tileRectangle.z - tileRectangle.x) * epsilon;\n      const heightEpsilon = (tileRectangle.w - tileRectangle.y) * epsilon;\n      tileRectangle.x -= widthEpsilon;\n      tileRectangle.y -= heightEpsilon;\n      tileRectangle.z += widthEpsilon;\n      tileRectangle.w += heightEpsilon;\n    }\n\n    if (projection instanceof WebMercatorProjection) {\n      southLatitude = tile.rectangle.south;\n      northLatitude = tile.rectangle.north;\n\n      southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle(\n        southLatitude\n      );\n\n      oneOverMercatorHeight =\n        1.0 /\n        (WebMercatorProjection.geodeticLatitudeToMercatorAngle(northLatitude) -\n          southMercatorY);\n\n      useWebMercatorProjection = true;\n    }\n  }\n\n  const surfaceShaderSetOptions = surfaceShaderSetOptionsScratch;\n  surfaceShaderSetOptions.frameState = frameState;\n  surfaceShaderSetOptions.surfaceTile = surfaceTile;\n  surfaceShaderSetOptions.showReflectiveOcean = showReflectiveOcean;\n  surfaceShaderSetOptions.showOceanWaves = showOceanWaves;\n  surfaceShaderSetOptions.enableLighting = tileProvider.enableLighting;\n  surfaceShaderSetOptions.dynamicAtmosphereLighting =\n    tileProvider.dynamicAtmosphereLighting;\n  surfaceShaderSetOptions.dynamicAtmosphereLightingFromSun =\n    tileProvider.dynamicAtmosphereLightingFromSun;\n  surfaceShaderSetOptions.showGroundAtmosphere = showGroundAtmosphere;\n  surfaceShaderSetOptions.atmosphereLightIntensity =\n    tileProvider.atmosphereLightIntensity;\n  surfaceShaderSetOptions.atmosphereRayleighCoefficient =\n    tileProvider.atmosphereRayleighCoefficient;\n  surfaceShaderSetOptions.atmosphereMieCoefficient =\n    tileProvider.atmosphereMieCoefficient;\n  surfaceShaderSetOptions.atmosphereRayleighScaleHeight =\n    tileProvider.atmosphereRayleighScaleHeight;\n  surfaceShaderSetOptions.atmosphereMieScaleHeight =\n    tileProvider.atmosphereMieScaleHeight;\n  surfaceShaderSetOptions.atmosphereMieAnisotropy =\n    tileProvider.atmosphereMieAnisotropy;\n  surfaceShaderSetOptions.perFragmentGroundAtmosphere = perFragmentGroundAtmosphere;\n  surfaceShaderSetOptions.hasVertexNormals = hasVertexNormals;\n  surfaceShaderSetOptions.useWebMercatorProjection = useWebMercatorProjection;\n  surfaceShaderSetOptions.clippedByBoundaries = surfaceTile.clippedByBoundaries;\n  surfaceShaderSetOptions.hasGeodeticSurfaceNormals = hasGeodeticSurfaceNormals;\n  surfaceShaderSetOptions.hasExaggeration = hasExaggeration;\n\n  const tileImageryCollection = surfaceTile.imagery;\n  let imageryIndex = 0;\n  const imageryLen = tileImageryCollection.length;\n\n  const showSkirts =\n    tileProvider.showSkirts && !cameraUnderground && !translucent;\n  const backFaceCulling =\n    tileProvider.backFaceCulling && !cameraUnderground && !translucent;\n  const firstPassRenderState = backFaceCulling\n    ? tileProvider._renderState\n    : tileProvider._disableCullingRenderState;\n  const otherPassesRenderState = backFaceCulling\n    ? tileProvider._blendRenderState\n    : tileProvider._disableCullingBlendRenderState;\n  let renderState = firstPassRenderState;\n\n  let initialColor = tileProvider._firstPassInitialColor;\n\n  const context = frameState.context;\n\n  if (!defined(tileProvider._debug.boundingSphereTile)) {\n    debugDestroyPrimitive();\n  }\n\n  const materialUniformMapChanged =\n    tileProvider._materialUniformMap !== tileProvider.materialUniformMap;\n  if (materialUniformMapChanged) {\n    tileProvider._materialUniformMap = tileProvider.materialUniformMap;\n    const drawCommandsLength = tileProvider._drawCommands.length;\n    for (let i = 0; i < drawCommandsLength; ++i) {\n      tileProvider._uniformMaps[i] = createTileUniformMap(\n        frameState,\n        tileProvider\n      );\n    }\n  }\n\n  do {\n    let numberOfDayTextures = 0;\n\n    let command;\n    let uniformMap;\n\n    if (tileProvider._drawCommands.length <= tileProvider._usedDrawCommands) {\n      command = new DrawCommand();\n      command.owner = tile;\n      command.cull = false;\n      command.boundingVolume = new BoundingSphere();\n      command.orientedBoundingBox = undefined;\n\n      uniformMap = createTileUniformMap(frameState, tileProvider);\n\n      tileProvider._drawCommands.push(command);\n      tileProvider._uniformMaps.push(uniformMap);\n    } else {\n      command = tileProvider._drawCommands[tileProvider._usedDrawCommands];\n      uniformMap = tileProvider._uniformMaps[tileProvider._usedDrawCommands];\n    }\n\n    command.owner = tile;\n\n    ++tileProvider._usedDrawCommands;\n\n    if (tile === tileProvider._debug.boundingSphereTile) {\n      const obb = tileBoundingRegion.boundingVolume;\n      const boundingSphere = tileBoundingRegion.boundingSphere;\n      // If a debug primitive already exists for this tile, it will not be\n      // re-created, to avoid allocation every frame. If it were possible\n      // to have more than one selected tile, this would have to change.\n      if (defined(obb)) {\n        getDebugOrientedBoundingBox(obb, Color.RED).update(frameState);\n      } else if (defined(boundingSphere)) {\n        getDebugBoundingSphere(boundingSphere, Color.RED).update(frameState);\n      }\n    }\n\n    const uniformMapProperties = uniformMap.properties;\n    Cartesian4.clone(initialColor, uniformMapProperties.initialColor);\n    uniformMapProperties.oceanNormalMap = oceanNormalMap;\n    uniformMapProperties.lightingFadeDistance.x =\n      tileProvider.lightingFadeOutDistance;\n    uniformMapProperties.lightingFadeDistance.y =\n      tileProvider.lightingFadeInDistance;\n    uniformMapProperties.nightFadeDistance.x =\n      tileProvider.nightFadeOutDistance;\n    uniformMapProperties.nightFadeDistance.y = tileProvider.nightFadeInDistance;\n    uniformMapProperties.atmosphereLightIntensity =\n      tileProvider.atmosphereLightIntensity;\n    uniformMapProperties.atmosphereRayleighCoefficient =\n      tileProvider.atmosphereRayleighCoefficient;\n    uniformMapProperties.atmosphereMieCoefficient =\n      tileProvider.atmosphereMieCoefficient;\n    uniformMapProperties.atmosphereRayleighScaleHeight =\n      tileProvider.atmosphereRayleighScaleHeight;\n    uniformMapProperties.atmosphereMieScaleHeight =\n      tileProvider.atmosphereMieScaleHeight;\n    uniformMapProperties.atmosphereMieAnisotropy =\n      tileProvider.atmosphereMieAnisotropy;\n    uniformMapProperties.zoomedOutOceanSpecularIntensity =\n      tileProvider.zoomedOutOceanSpecularIntensity;\n\n    const frontFaceAlphaByDistanceFinal = cameraUnderground\n      ? backFaceAlphaByDistance\n      : frontFaceAlphaByDistance;\n    const backFaceAlphaByDistanceFinal = cameraUnderground\n      ? frontFaceAlphaByDistance\n      : backFaceAlphaByDistance;\n\n    if (defined(frontFaceAlphaByDistanceFinal)) {\n      Cartesian4.fromElements(\n        frontFaceAlphaByDistanceFinal.near,\n        frontFaceAlphaByDistanceFinal.nearValue,\n        frontFaceAlphaByDistanceFinal.far,\n        frontFaceAlphaByDistanceFinal.farValue,\n        uniformMapProperties.frontFaceAlphaByDistance\n      );\n      Cartesian4.fromElements(\n        backFaceAlphaByDistanceFinal.near,\n        backFaceAlphaByDistanceFinal.nearValue,\n        backFaceAlphaByDistanceFinal.far,\n        backFaceAlphaByDistanceFinal.farValue,\n        uniformMapProperties.backFaceAlphaByDistance\n      );\n    }\n\n    Cartesian4.fromElements(\n      undergroundColorAlphaByDistance.near,\n      undergroundColorAlphaByDistance.nearValue,\n      undergroundColorAlphaByDistance.far,\n      undergroundColorAlphaByDistance.farValue,\n      uniformMapProperties.undergroundColorAlphaByDistance\n    );\n    Color.clone(undergroundColor, uniformMapProperties.undergroundColor);\n\n    uniformMapProperties.lambertDiffuseMultiplier = lambertDiffuseMultiplier;\n    uniformMapProperties.vertexShadowDarkness = vertexShadowDarkness;\n\n    const highlightFillTile =\n      !defined(surfaceTile.vertexArray) &&\n      defined(tileProvider.fillHighlightColor) &&\n      tileProvider.fillHighlightColor.alpha > 0.0;\n    if (highlightFillTile) {\n      Color.clone(\n        tileProvider.fillHighlightColor,\n        uniformMapProperties.fillHighlightColor\n      );\n    }\n\n    uniformMapProperties.verticalExaggerationAndRelativeHeight.x = exaggeration;\n    uniformMapProperties.verticalExaggerationAndRelativeHeight.y = exaggerationRelativeHeight;\n\n    uniformMapProperties.center3D = mesh.center;\n    Cartesian3.clone(rtc, uniformMapProperties.rtc);\n\n    Cartesian4.clone(tileRectangle, uniformMapProperties.tileRectangle);\n    uniformMapProperties.southAndNorthLatitude.x = southLatitude;\n    uniformMapProperties.southAndNorthLatitude.y = northLatitude;\n    uniformMapProperties.southMercatorYAndOneOverHeight.x = southMercatorY;\n    uniformMapProperties.southMercatorYAndOneOverHeight.y = oneOverMercatorHeight;\n\n    // Convert tile limiter rectangle from cartographic to texture space using the tileRectangle.\n    const localizedCartographicLimitRectangle = localizedCartographicLimitRectangleScratch;\n    const cartographicLimitRectangle = clipRectangleAntimeridian(\n      tile.rectangle,\n      tileProvider.cartographicLimitRectangle\n    );\n\n    const localizedTranslucencyRectangle = localizedTranslucencyRectangleScratch;\n    const clippedTranslucencyRectangle = clipRectangleAntimeridian(\n      tile.rectangle,\n      translucencyRectangle\n    );\n\n    Cartesian3.fromElements(\n      hueShift,\n      saturationShift,\n      brightnessShift,\n      uniformMapProperties.hsbShift\n    );\n\n    const cartographicTileRectangle = tile.rectangle;\n    const inverseTileWidth = 1.0 / cartographicTileRectangle.width;\n    const inverseTileHeight = 1.0 / cartographicTileRectangle.height;\n    localizedCartographicLimitRectangle.x =\n      (cartographicLimitRectangle.west - cartographicTileRectangle.west) *\n      inverseTileWidth;\n    localizedCartographicLimitRectangle.y =\n      (cartographicLimitRectangle.south - cartographicTileRectangle.south) *\n      inverseTileHeight;\n    localizedCartographicLimitRectangle.z =\n      (cartographicLimitRectangle.east - cartographicTileRectangle.west) *\n      inverseTileWidth;\n    localizedCartographicLimitRectangle.w =\n      (cartographicLimitRectangle.north - cartographicTileRectangle.south) *\n      inverseTileHeight;\n\n    Cartesian4.clone(\n      localizedCartographicLimitRectangle,\n      uniformMapProperties.localizedCartographicLimitRectangle\n    );\n\n    localizedTranslucencyRectangle.x =\n      (clippedTranslucencyRectangle.west - cartographicTileRectangle.west) *\n      inverseTileWidth;\n    localizedTranslucencyRectangle.y =\n      (clippedTranslucencyRectangle.south - cartographicTileRectangle.south) *\n      inverseTileHeight;\n    localizedTranslucencyRectangle.z =\n      (clippedTranslucencyRectangle.east - cartographicTileRectangle.west) *\n      inverseTileWidth;\n    localizedTranslucencyRectangle.w =\n      (clippedTranslucencyRectangle.north - cartographicTileRectangle.south) *\n      inverseTileHeight;\n\n    Cartesian4.clone(\n      localizedTranslucencyRectangle,\n      uniformMapProperties.localizedTranslucencyRectangle\n    );\n\n    // For performance, use fog in the shader only when the tile is in fog.\n    const applyFog =\n      enableFog &&\n      CesiumMath.fog(tile._distance, frameState.fog.density) >\n        CesiumMath.EPSILON3;\n    colorCorrect = colorCorrect && (applyFog || showGroundAtmosphere);\n\n    let applyBrightness = false;\n    let applyContrast = false;\n    let applyHue = false;\n    let applySaturation = false;\n    let applyGamma = false;\n    let applyAlpha = false;\n    let applyDayNightAlpha = false;\n    let applySplit = false;\n    let applyCutout = false;\n    let applyColorToAlpha = false;\n\n    while (numberOfDayTextures < maxTextures && imageryIndex < imageryLen) {\n      const tileImagery = tileImageryCollection[imageryIndex];\n      const imagery = tileImagery.readyImagery;\n      ++imageryIndex;\n\n      if (!defined(imagery) || imagery.imageryLayer.alpha === 0.0) {\n        continue;\n      }\n\n      const texture = tileImagery.useWebMercatorT\n        ? imagery.textureWebMercator\n        : imagery.texture;\n\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(texture)) {\n        // Our \"ready\" texture isn't actually ready.  This should never happen.\n        //\n        // Side note: It IS possible for it to not be in the READY ImageryState, though.\n        // This can happen when a single imagery tile is shared by two terrain tiles (common)\n        // and one of them (A) needs a geographic version of the tile because it is near the poles,\n        // and the other (B) does not.  B can and will transition the imagery tile to the READY state\n        // without reprojecting to geographic.  Then, later, A will deem that same tile not-ready-yet\n        // because it only has the Web Mercator texture, and flip it back to the TRANSITIONING state.\n        // The imagery tile won't be in the READY state anymore, but it's still READY enough for B's\n        // purposes.\n        throw new DeveloperError(\"readyImagery is not actually ready!\");\n      }\n      //>>includeEnd('debug');\n\n      const imageryLayer = imagery.imageryLayer;\n\n      if (!defined(tileImagery.textureTranslationAndScale)) {\n        tileImagery.textureTranslationAndScale = imageryLayer._calculateTextureTranslationAndScale(\n          tile,\n          tileImagery\n        );\n      }\n\n      uniformMapProperties.dayTextures[numberOfDayTextures] = texture;\n      uniformMapProperties.dayTextureTranslationAndScale[numberOfDayTextures] =\n        tileImagery.textureTranslationAndScale;\n      uniformMapProperties.dayTextureTexCoordsRectangle[numberOfDayTextures] =\n        tileImagery.textureCoordinateRectangle;\n      uniformMapProperties.dayTextureUseWebMercatorT[numberOfDayTextures] =\n        tileImagery.useWebMercatorT;\n\n      uniformMapProperties.dayTextureAlpha[numberOfDayTextures] =\n        imageryLayer.alpha;\n      applyAlpha =\n        applyAlpha ||\n        uniformMapProperties.dayTextureAlpha[numberOfDayTextures] !== 1.0;\n\n      uniformMapProperties.dayTextureNightAlpha[numberOfDayTextures] =\n        imageryLayer.nightAlpha;\n      applyDayNightAlpha =\n        applyDayNightAlpha ||\n        uniformMapProperties.dayTextureNightAlpha[numberOfDayTextures] !== 1.0;\n\n      uniformMapProperties.dayTextureDayAlpha[numberOfDayTextures] =\n        imageryLayer.dayAlpha;\n      applyDayNightAlpha =\n        applyDayNightAlpha ||\n        uniformMapProperties.dayTextureDayAlpha[numberOfDayTextures] !== 1.0;\n\n      uniformMapProperties.dayTextureBrightness[numberOfDayTextures] =\n        imageryLayer.brightness;\n      applyBrightness =\n        applyBrightness ||\n        uniformMapProperties.dayTextureBrightness[numberOfDayTextures] !==\n          ImageryLayer.DEFAULT_BRIGHTNESS;\n\n      uniformMapProperties.dayTextureContrast[numberOfDayTextures] =\n        imageryLayer.contrast;\n      applyContrast =\n        applyContrast ||\n        uniformMapProperties.dayTextureContrast[numberOfDayTextures] !==\n          ImageryLayer.DEFAULT_CONTRAST;\n\n      uniformMapProperties.dayTextureHue[numberOfDayTextures] =\n        imageryLayer.hue;\n      applyHue =\n        applyHue ||\n        uniformMapProperties.dayTextureHue[numberOfDayTextures] !==\n          ImageryLayer.DEFAULT_HUE;\n\n      uniformMapProperties.dayTextureSaturation[numberOfDayTextures] =\n        imageryLayer.saturation;\n      applySaturation =\n        applySaturation ||\n        uniformMapProperties.dayTextureSaturation[numberOfDayTextures] !==\n          ImageryLayer.DEFAULT_SATURATION;\n\n      uniformMapProperties.dayTextureOneOverGamma[numberOfDayTextures] =\n        1.0 / imageryLayer.gamma;\n      applyGamma =\n        applyGamma ||\n        uniformMapProperties.dayTextureOneOverGamma[numberOfDayTextures] !==\n          1.0 / ImageryLayer.DEFAULT_GAMMA;\n\n      uniformMapProperties.dayTextureSplit[numberOfDayTextures] =\n        imageryLayer.splitDirection;\n      applySplit =\n        applySplit ||\n        uniformMapProperties.dayTextureSplit[numberOfDayTextures] !== 0.0;\n\n      // Update cutout rectangle\n      let dayTextureCutoutRectangle =\n        uniformMapProperties.dayTextureCutoutRectangles[numberOfDayTextures];\n      if (!defined(dayTextureCutoutRectangle)) {\n        dayTextureCutoutRectangle = uniformMapProperties.dayTextureCutoutRectangles[\n          numberOfDayTextures\n        ] = new Cartesian4();\n      }\n\n      Cartesian4.clone(Cartesian4.ZERO, dayTextureCutoutRectangle);\n      if (defined(imageryLayer.cutoutRectangle)) {\n        const cutoutRectangle = clipRectangleAntimeridian(\n          cartographicTileRectangle,\n          imageryLayer.cutoutRectangle\n        );\n        const intersection = Rectangle.simpleIntersection(\n          cutoutRectangle,\n          cartographicTileRectangle,\n          rectangleIntersectionScratch\n        );\n        applyCutout = defined(intersection) || applyCutout;\n\n        dayTextureCutoutRectangle.x =\n          (cutoutRectangle.west - cartographicTileRectangle.west) *\n          inverseTileWidth;\n        dayTextureCutoutRectangle.y =\n          (cutoutRectangle.south - cartographicTileRectangle.south) *\n          inverseTileHeight;\n        dayTextureCutoutRectangle.z =\n          (cutoutRectangle.east - cartographicTileRectangle.west) *\n          inverseTileWidth;\n        dayTextureCutoutRectangle.w =\n          (cutoutRectangle.north - cartographicTileRectangle.south) *\n          inverseTileHeight;\n      }\n\n      // Update color to alpha\n      let colorToAlpha =\n        uniformMapProperties.colorsToAlpha[numberOfDayTextures];\n      if (!defined(colorToAlpha)) {\n        colorToAlpha = uniformMapProperties.colorsToAlpha[\n          numberOfDayTextures\n        ] = new Cartesian4();\n      }\n\n      const hasColorToAlpha =\n        defined(imageryLayer.colorToAlpha) &&\n        imageryLayer.colorToAlphaThreshold > 0.0;\n      applyColorToAlpha = applyColorToAlpha || hasColorToAlpha;\n\n      if (hasColorToAlpha) {\n        const color = imageryLayer.colorToAlpha;\n        colorToAlpha.x = color.red;\n        colorToAlpha.y = color.green;\n        colorToAlpha.z = color.blue;\n        colorToAlpha.w = imageryLayer.colorToAlphaThreshold;\n      } else {\n        colorToAlpha.w = -1.0;\n      }\n\n      if (defined(imagery.credits)) {\n        const credits = imagery.credits;\n        for (\n          let creditIndex = 0, creditLength = credits.length;\n          creditIndex < creditLength;\n          ++creditIndex\n        ) {\n          creditDisplay.addCreditToNextFrame(credits[creditIndex]);\n        }\n      }\n\n      ++numberOfDayTextures;\n    }\n\n    // trim texture array to the used length so we don't end up using old textures\n    // which might get destroyed eventually\n    uniformMapProperties.dayTextures.length = numberOfDayTextures;\n    uniformMapProperties.waterMask = waterMaskTexture;\n    Cartesian4.clone(\n      waterMaskTranslationAndScale,\n      uniformMapProperties.waterMaskTranslationAndScale\n    );\n\n    uniformMapProperties.minMaxHeight.x = encoding.minimumHeight;\n    uniformMapProperties.minMaxHeight.y = encoding.maximumHeight;\n    Matrix4.clone(encoding.matrix, uniformMapProperties.scaleAndBias);\n\n    // update clipping planes\n    const clippingPlanes = tileProvider._clippingPlanes;\n    const clippingPlanesEnabled =\n      defined(clippingPlanes) && clippingPlanes.enabled && tile.isClipped;\n    if (clippingPlanesEnabled) {\n      uniformMapProperties.clippingPlanesEdgeColor = Color.clone(\n        clippingPlanes.edgeColor,\n        uniformMapProperties.clippingPlanesEdgeColor\n      );\n      uniformMapProperties.clippingPlanesEdgeWidth = clippingPlanes.edgeWidth;\n    }\n\n    surfaceShaderSetOptions.numberOfDayTextures = numberOfDayTextures;\n    surfaceShaderSetOptions.applyBrightness = applyBrightness;\n    surfaceShaderSetOptions.applyContrast = applyContrast;\n    surfaceShaderSetOptions.applyHue = applyHue;\n    surfaceShaderSetOptions.applySaturation = applySaturation;\n    surfaceShaderSetOptions.applyGamma = applyGamma;\n    surfaceShaderSetOptions.applyAlpha = applyAlpha;\n    surfaceShaderSetOptions.applyDayNightAlpha = applyDayNightAlpha;\n    surfaceShaderSetOptions.applySplit = applySplit;\n    surfaceShaderSetOptions.enableFog = applyFog;\n    surfaceShaderSetOptions.enableClippingPlanes = clippingPlanesEnabled;\n    surfaceShaderSetOptions.clippingPlanes = clippingPlanes;\n    surfaceShaderSetOptions.hasImageryLayerCutout = applyCutout;\n    surfaceShaderSetOptions.colorCorrect = colorCorrect;\n    surfaceShaderSetOptions.highlightFillTile = highlightFillTile;\n    surfaceShaderSetOptions.colorToAlpha = applyColorToAlpha;\n    surfaceShaderSetOptions.showUndergroundColor = showUndergroundColor;\n    surfaceShaderSetOptions.translucent = translucent;\n\n    let count = surfaceTile.renderedMesh.indices.length;\n    if (!showSkirts) {\n      count = surfaceTile.renderedMesh.indexCountWithoutSkirts;\n    }\n\n    command.shaderProgram = tileProvider._surfaceShaderSet.getShaderProgram(\n      surfaceShaderSetOptions\n    );\n    command.castShadows = castShadows;\n    command.receiveShadows = receiveShadows;\n    command.renderState = renderState;\n    command.primitiveType = PrimitiveType.TRIANGLES;\n    command.vertexArray =\n      surfaceTile.vertexArray || surfaceTile.fill.vertexArray;\n    command.count = count;\n    command.uniformMap = uniformMap;\n    command.pass = Pass.GLOBE;\n\n    if (tileProvider._debug.wireframe) {\n      createWireframeVertexArrayIfNecessary(context, tileProvider, tile);\n      if (defined(surfaceTile.wireframeVertexArray)) {\n        command.vertexArray = surfaceTile.wireframeVertexArray;\n        command.primitiveType = PrimitiveType.LINES;\n        command.count = count * 2;\n      }\n    }\n\n    let boundingVolume = command.boundingVolume;\n    const orientedBoundingBox = command.orientedBoundingBox;\n\n    if (frameState.mode !== SceneMode.SCENE3D) {\n      BoundingSphere.fromRectangleWithHeights2D(\n        tile.rectangle,\n        frameState.mapProjection,\n        tileBoundingRegion.minimumHeight,\n        tileBoundingRegion.maximumHeight,\n        boundingVolume\n      );\n      Cartesian3.fromElements(\n        boundingVolume.center.z,\n        boundingVolume.center.x,\n        boundingVolume.center.y,\n        boundingVolume.center\n      );\n\n      if (frameState.mode === SceneMode.MORPHING) {\n        boundingVolume = BoundingSphere.union(\n          tileBoundingRegion.boundingSphere,\n          boundingVolume,\n          boundingVolume\n        );\n      }\n    } else {\n      command.boundingVolume = BoundingSphere.clone(\n        tileBoundingRegion.boundingSphere,\n        boundingVolume\n      );\n      command.orientedBoundingBox = OrientedBoundingBox.clone(\n        tileBoundingRegion.boundingVolume,\n        orientedBoundingBox\n      );\n    }\n\n    command.dirty = true;\n\n    if (translucent) {\n      globeTranslucencyState.updateDerivedCommands(command, frameState);\n    }\n\n    pushCommand(command, frameState);\n\n    renderState = otherPassesRenderState;\n    initialColor = otherPassesInitialColor;\n  } while (imageryIndex < imageryLen);\n}\nexport default GlobeSurfaceTileProvider;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\n\n/**\n * Properties for controlling globe translucency.\n *\n * @alias GlobeTranslucency\n * @constructor\n */\nfunction GlobeTranslucency() {\n  this._enabled = false;\n  this._frontFaceAlpha = 1.0;\n  this._frontFaceAlphaByDistance = undefined;\n  this._backFaceAlpha = 1.0;\n  this._backFaceAlphaByDistance = undefined;\n  this._rectangle = Rectangle.clone(Rectangle.MAX_VALUE);\n}\n\nObject.defineProperties(GlobeTranslucency.prototype, {\n  /**\n   * When true, the globe is rendered as a translucent surface.\n   * <br /><br />\n   * The alpha is computed by blending {@link Globe#material}, {@link Globe#imageryLayers},\n   * and {@link Globe#baseColor}, all of which may contain translucency, and then multiplying by\n   * {@link GlobeTranslucency#frontFaceAlpha} and {@link GlobeTranslucency#frontFaceAlphaByDistance} for front faces and\n   * {@link GlobeTranslucency#backFaceAlpha} and {@link GlobeTranslucency#backFaceAlphaByDistance} for back faces.\n   * When the camera is underground back faces and front faces are swapped, i.e. back-facing geometry\n   * is considered front facing.\n   * <br /><br />\n   * Translucency is disabled by default.\n   *\n   * @memberof GlobeTranslucency.prototype\n   *\n   * @type {boolean}\n   * @default false\n   *\n   * @see GlobeTranslucency#frontFaceAlpha\n   * @see GlobeTranslucency#frontFaceAlphaByDistance\n   * @see GlobeTranslucency#backFaceAlpha\n   * @see GlobeTranslucency#backFaceAlphaByDistance\n   */\n  enabled: {\n    get: function () {\n      return this._enabled;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.bool(\"enabled\", value);\n      //>>includeEnd('debug');\n      this._enabled = value;\n    },\n  },\n\n  /**\n   * A constant translucency to apply to front faces of the globe.\n   * <br /><br />\n   * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.\n   *\n   * @memberof GlobeTranslucency.prototype\n   *\n   * @type {number}\n   * @default 1.0\n   *\n   * @see GlobeTranslucency#enabled\n   * @see GlobeTranslucency#frontFaceAlphaByDistance\n   *\n   * @example\n   * // Set front face translucency to 0.5.\n   * globe.translucency.frontFaceAlpha = 0.5;\n   * globe.translucency.enabled = true;\n   */\n  frontFaceAlpha: {\n    get: function () {\n      return this._frontFaceAlpha;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"frontFaceAlpha\", value, 0.0);\n      Check.typeOf.number.lessThanOrEquals(\"frontFaceAlpha\", value, 1.0);\n      //>>includeEnd('debug');\n      this._frontFaceAlpha = value;\n    },\n  },\n  /**\n   * Gets or sets near and far translucency properties of front faces of the globe based on the distance to the camera.\n   * The translucency will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the translucency remains clamped to the nearest bound.  If undefined,\n   * frontFaceAlphaByDistance will be disabled.\n   * <br /><br />\n   * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.\n   *\n   * @memberof GlobeTranslucency.prototype\n   *\n   * @type {NearFarScalar}\n   * @default undefined\n   *\n   * @see GlobeTranslucency#enabled\n   * @see GlobeTranslucency#frontFaceAlpha\n   *\n   * @example\n   * // Example 1.\n   * // Set front face translucency to 0.5 when the\n   * // camera is 1500 meters from the surface and 1.0\n   * // as the camera distance approaches 8.0e6 meters.\n   * globe.translucency.frontFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);\n   * globe.translucency.enabled = true;\n   *\n   * @example\n   * // Example 2.\n   * // Disable front face translucency by distance\n   * globe.translucency.frontFaceAlphaByDistance = undefined;\n   */\n  frontFaceAlphaByDistance: {\n    get: function () {\n      return this._frontFaceAlphaByDistance;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value) && value.far < value.near) {\n        throw new DeveloperError(\n          \"far distance must be greater than near distance.\"\n        );\n      }\n      //>>includeEnd('debug');\n      this._frontFaceAlphaByDistance = NearFarScalar.clone(\n        value,\n        this._frontFaceAlphaByDistance\n      );\n    },\n  },\n\n  /**\n   * A constant translucency to apply to back faces of the globe.\n   * <br /><br />\n   * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.\n   *\n   * @memberof GlobeTranslucency.prototype\n   *\n   * @type {number}\n   * @default 1.0\n   *\n   * @see GlobeTranslucency#enabled\n   * @see GlobeTranslucency#backFaceAlphaByDistance\n   *\n   * @example\n   * // Set back face translucency to 0.5.\n   * globe.translucency.backFaceAlpha = 0.5;\n   * globe.translucency.enabled = true;\n   */\n  backFaceAlpha: {\n    get: function () {\n      return this._backFaceAlpha;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"backFaceAlpha\", value, 0.0);\n      Check.typeOf.number.lessThanOrEquals(\"backFaceAlpha\", value, 1.0);\n      //>>includeEnd('debug');\n      this._backFaceAlpha = value;\n    },\n  },\n  /**\n   * Gets or sets near and far translucency properties of back faces of the globe based on the distance to the camera.\n   * The translucency will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the translucency remains clamped to the nearest bound.  If undefined,\n   * backFaceAlphaByDistance will be disabled.\n   * <br /><br />\n   * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.\n   *\n   * @memberof GlobeTranslucency.prototype\n   *\n   * @type {NearFarScalar}\n   * @default undefined\n   *\n   * @see GlobeTranslucency#enabled\n   * @see GlobeTranslucency#backFaceAlpha\n   *\n   * @example\n   * // Example 1.\n   * // Set back face translucency to 0.5 when the\n   * // camera is 1500 meters from the surface and 1.0\n   * // as the camera distance approaches 8.0e6 meters.\n   * globe.translucency.backFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);\n   * globe.translucency.enabled = true;\n   *\n   * @example\n   * // Example 2.\n   * // Disable back face translucency by distance\n   * globe.translucency.backFaceAlphaByDistance = undefined;\n   */\n  backFaceAlphaByDistance: {\n    get: function () {\n      return this._backFaceAlphaByDistance;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value) && value.far < value.near) {\n        throw new DeveloperError(\n          \"far distance must be greater than near distance.\"\n        );\n      }\n      //>>includeEnd('debug');\n      this._backFaceAlphaByDistance = NearFarScalar.clone(\n        value,\n        this._backFaceAlphaByDistance\n      );\n    },\n  },\n\n  /**\n   * A property specifying a {@link Rectangle} used to limit translucency to a cartographic area.\n   * Defaults to the maximum extent of cartographic coordinates.\n   *\n   * @memberof GlobeTranslucency.prototype\n   *\n   * @type {Rectangle}\n   * @default {@link Rectangle.MAX_VALUE}\n   */\n  rectangle: {\n    get: function () {\n      return this._rectangle;\n    },\n    set: function (value) {\n      if (!defined(value)) {\n        value = Rectangle.clone(Rectangle.MAX_VALUE);\n      }\n      Rectangle.clone(value, this._rectangle);\n    },\n  },\n});\n\nexport default GlobeTranslucency;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport ImageryLayer from \"./ImageryLayer.js\";\n\n/**\n * An ordered collection of imagery layers.\n *\n * @alias ImageryLayerCollection\n * @constructor\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Imagery%20Adjustment.html|Cesium Sandcastle Imagery Adjustment Demo}\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Imagery%20Layers%20Manipulation.html|Cesium Sandcastle Imagery Manipulation Demo}\n */\nfunction ImageryLayerCollection() {\n  this._layers = [];\n\n  /**\n   * An event that is raised when a layer is added to the collection.  Event handlers are passed the layer that\n   * was added and the index at which it was added.\n   * @type {Event}\n   * @default Event()\n   */\n  this.layerAdded = new Event();\n\n  /**\n   * An event that is raised when a layer is removed from the collection.  Event handlers are passed the layer that\n   * was removed and the index from which it was removed.\n   * @type {Event}\n   * @default Event()\n   */\n  this.layerRemoved = new Event();\n\n  /**\n   * An event that is raised when a layer changes position in the collection.  Event handlers are passed the layer that\n   * was moved, its new index after the move, and its old index prior to the move.\n   * @type {Event}\n   * @default Event()\n   */\n  this.layerMoved = new Event();\n\n  /**\n   * An event that is raised when a layer is shown or hidden by setting the\n   * {@link ImageryLayer#show} property.  Event handlers are passed a reference to this layer,\n   * the index of the layer in the collection, and a flag that is true if the layer is now\n   * shown or false if it is now hidden.\n   *\n   * @type {Event}\n   * @default Event()\n   */\n  this.layerShownOrHidden = new Event();\n}\n\nObject.defineProperties(ImageryLayerCollection.prototype, {\n  /**\n   * Gets the number of layers in this collection.\n   * @memberof ImageryLayerCollection.prototype\n   * @type {number}\n   */\n  length: {\n    get: function () {\n      return this._layers.length;\n    },\n  },\n});\n\n/**\n * Adds a layer to the collection.\n *\n * @param {ImageryLayer} layer the layer to add.\n * @param {number} [index] the index to add the layer at.  If omitted, the layer will\n *                         be added on top of all existing layers.\n *\n * @exception {DeveloperError} index, if supplied, must be greater than or equal to zero and less than or equal to the number of the layers.\n *\n * @example\n * const imageryLayer = Cesium.ImageryLayer.fromWorldImagery();\n * scene.imageryLayers.add(imageryLayer);\n *\n * @example\n * const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812));\n * scene.imageryLayers.add(imageryLayer);\n */\nImageryLayerCollection.prototype.add = function (layer, index) {\n  const hasIndex = defined(index);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(layer)) {\n    throw new DeveloperError(\"layer is required.\");\n  }\n  if (hasIndex) {\n    if (index < 0) {\n      throw new DeveloperError(\"index must be greater than or equal to zero.\");\n    } else if (index > this._layers.length) {\n      throw new DeveloperError(\n        \"index must be less than or equal to the number of layers.\"\n      );\n    }\n  }\n  //>>includeEnd('debug');\n\n  if (!hasIndex) {\n    index = this._layers.length;\n    this._layers.push(layer);\n  } else {\n    this._layers.splice(index, 0, layer);\n  }\n\n  this._update();\n  this.layerAdded.raiseEvent(layer, index);\n  const removeReadyEventListener = layer.readyEvent.addEventListener(() => {\n    this.layerShownOrHidden.raiseEvent(layer, layer._layerIndex, layer.show);\n    removeReadyEventListener();\n  });\n};\n\n/**\n * Creates a new layer using the given ImageryProvider and adds it to the collection.\n *\n * @param {ImageryProvider} imageryProvider the imagery provider to create a new layer for.\n * @param {number} [index] the index to add the layer at.  If omitted, the layer will\n *                         added on top of all existing layers.\n * @returns {ImageryLayer} The newly created layer.\n *\n * @example\n * try {\n *    const provider = await Cesium.IonImageryProvider.fromAssetId(3812);\n *    scene.imageryLayers.addImageryProvider(provider);\n * } catch (error) {\n *   console.log(`There was an error creating the imagery layer. ${error}`)\n * }\n */\nImageryLayerCollection.prototype.addImageryProvider = function (\n  imageryProvider,\n  index\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(imageryProvider)) {\n    throw new DeveloperError(\"imageryProvider is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const layer = new ImageryLayer(imageryProvider);\n  this.add(layer, index);\n  return layer;\n};\n\n/**\n * Removes a layer from this collection, if present.\n *\n * @param {ImageryLayer} layer The layer to remove.\n * @param {boolean} [destroy=true] whether to destroy the layers in addition to removing them.\n * @returns {boolean} true if the layer was in the collection and was removed,\n *                    false if the layer was not in the collection.\n */\nImageryLayerCollection.prototype.remove = function (layer, destroy) {\n  destroy = defaultValue(destroy, true);\n\n  const index = this._layers.indexOf(layer);\n  if (index !== -1) {\n    this._layers.splice(index, 1);\n\n    this._update();\n\n    this.layerRemoved.raiseEvent(layer, index);\n\n    if (destroy) {\n      layer.destroy();\n    }\n\n    return true;\n  }\n\n  return false;\n};\n\n/**\n * Removes all layers from this collection.\n *\n * @param {boolean} [destroy=true] whether to destroy the layers in addition to removing them.\n */\nImageryLayerCollection.prototype.removeAll = function (destroy) {\n  destroy = defaultValue(destroy, true);\n\n  const layers = this._layers;\n  for (let i = 0, len = layers.length; i < len; i++) {\n    const layer = layers[i];\n    this.layerRemoved.raiseEvent(layer, i);\n\n    if (destroy) {\n      layer.destroy();\n    }\n  }\n\n  this._layers = [];\n};\n\n/**\n * Checks to see if the collection contains a given layer.\n *\n * @param {ImageryLayer} layer the layer to check for.\n *\n * @returns {boolean} true if the collection contains the layer, false otherwise.\n */\nImageryLayerCollection.prototype.contains = function (layer) {\n  return this.indexOf(layer) !== -1;\n};\n\n/**\n * Determines the index of a given layer in the collection.\n *\n * @param {ImageryLayer} layer The layer to find the index of.\n *\n * @returns {number} The index of the layer in the collection, or -1 if the layer does not exist in the collection.\n */\nImageryLayerCollection.prototype.indexOf = function (layer) {\n  return this._layers.indexOf(layer);\n};\n\n/**\n * Gets a layer by index from the collection.\n *\n * @param {number} index the index to retrieve.\n *\n * @returns {ImageryLayer} The imagery layer at the given index.\n */\nImageryLayerCollection.prototype.get = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(index)) {\n    throw new DeveloperError(\"index is required.\", \"index\");\n  }\n  //>>includeEnd('debug');\n\n  return this._layers[index];\n};\n\nfunction getLayerIndex(layers, layer) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(layer)) {\n    throw new DeveloperError(\"layer is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const index = layers.indexOf(layer);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (index === -1) {\n    throw new DeveloperError(\"layer is not in this collection.\");\n  }\n  //>>includeEnd('debug');\n\n  return index;\n}\n\nfunction swapLayers(collection, i, j) {\n  const arr = collection._layers;\n  i = CesiumMath.clamp(i, 0, arr.length - 1);\n  j = CesiumMath.clamp(j, 0, arr.length - 1);\n\n  if (i === j) {\n    return;\n  }\n\n  const temp = arr[i];\n  arr[i] = arr[j];\n  arr[j] = temp;\n\n  collection._update();\n\n  collection.layerMoved.raiseEvent(temp, j, i);\n}\n\n/**\n * Raises a layer up one position in the collection.\n *\n * @param {ImageryLayer} layer the layer to move.\n *\n * @exception {DeveloperError} layer is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nImageryLayerCollection.prototype.raise = function (layer) {\n  const index = getLayerIndex(this._layers, layer);\n  swapLayers(this, index, index + 1);\n};\n\n/**\n * Lowers a layer down one position in the collection.\n *\n * @param {ImageryLayer} layer the layer to move.\n *\n * @exception {DeveloperError} layer is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nImageryLayerCollection.prototype.lower = function (layer) {\n  const index = getLayerIndex(this._layers, layer);\n  swapLayers(this, index, index - 1);\n};\n\n/**\n * Raises a layer to the top of the collection.\n *\n * @param {ImageryLayer} layer the layer to move.\n *\n * @exception {DeveloperError} layer is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nImageryLayerCollection.prototype.raiseToTop = function (layer) {\n  const index = getLayerIndex(this._layers, layer);\n  if (index === this._layers.length - 1) {\n    return;\n  }\n  this._layers.splice(index, 1);\n  this._layers.push(layer);\n\n  this._update();\n\n  this.layerMoved.raiseEvent(layer, this._layers.length - 1, index);\n};\n\n/**\n * Lowers a layer to the bottom of the collection.\n *\n * @param {ImageryLayer} layer the layer to move.\n *\n * @exception {DeveloperError} layer is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nImageryLayerCollection.prototype.lowerToBottom = function (layer) {\n  const index = getLayerIndex(this._layers, layer);\n  if (index === 0) {\n    return;\n  }\n  this._layers.splice(index, 1);\n  this._layers.splice(0, 0, layer);\n\n  this._update();\n\n  this.layerMoved.raiseEvent(layer, 0, index);\n};\n\nconst applicableRectangleScratch = new Rectangle();\n\nfunction pickImageryHelper(scene, pickedLocation, pickFeatures, callback) {\n  // Find the terrain tile containing the picked location.\n  const tilesToRender = scene.globe._surface._tilesToRender;\n  let pickedTile;\n\n  for (\n    let textureIndex = 0;\n    !defined(pickedTile) && textureIndex < tilesToRender.length;\n    ++textureIndex\n  ) {\n    const tile = tilesToRender[textureIndex];\n    if (Rectangle.contains(tile.rectangle, pickedLocation)) {\n      pickedTile = tile;\n    }\n  }\n\n  if (!defined(pickedTile)) {\n    return;\n  }\n\n  // Pick against all attached imagery tiles containing the pickedLocation.\n  const imageryTiles = pickedTile.data.imagery;\n\n  for (let i = imageryTiles.length - 1; i >= 0; --i) {\n    const terrainImagery = imageryTiles[i];\n    const imagery = terrainImagery.readyImagery;\n    if (!defined(imagery)) {\n      continue;\n    }\n    if (!imagery.imageryLayer.ready) {\n      continue;\n    }\n    const provider = imagery.imageryLayer.imageryProvider;\n    if (pickFeatures && !defined(provider.pickFeatures)) {\n      continue;\n    }\n\n    if (!Rectangle.contains(imagery.rectangle, pickedLocation)) {\n      continue;\n    }\n\n    // If this imagery came from a parent, it may not be applicable to its entire rectangle.\n    // Check the textureCoordinateRectangle.\n    const applicableRectangle = applicableRectangleScratch;\n\n    const epsilon = 1 / 1024; // 1/4 of a pixel in a typical 256x256 tile.\n    applicableRectangle.west = CesiumMath.lerp(\n      pickedTile.rectangle.west,\n      pickedTile.rectangle.east,\n      terrainImagery.textureCoordinateRectangle.x - epsilon\n    );\n    applicableRectangle.east = CesiumMath.lerp(\n      pickedTile.rectangle.west,\n      pickedTile.rectangle.east,\n      terrainImagery.textureCoordinateRectangle.z + epsilon\n    );\n    applicableRectangle.south = CesiumMath.lerp(\n      pickedTile.rectangle.south,\n      pickedTile.rectangle.north,\n      terrainImagery.textureCoordinateRectangle.y - epsilon\n    );\n    applicableRectangle.north = CesiumMath.lerp(\n      pickedTile.rectangle.south,\n      pickedTile.rectangle.north,\n      terrainImagery.textureCoordinateRectangle.w + epsilon\n    );\n    if (!Rectangle.contains(applicableRectangle, pickedLocation)) {\n      continue;\n    }\n\n    callback(imagery);\n  }\n}\n\n/**\n * Determines the imagery layers that are intersected by a pick ray. To compute a pick ray from a\n * location on the screen, use {@link Camera.getPickRay}.\n *\n * @param {Ray} ray The ray to test for intersection.\n * @param {Scene} scene The scene.\n * @return {ImageryLayer[]|undefined} An array that includes all of\n *                                 the layers that are intersected by a given pick ray. Undefined if\n *                                 no layers are selected.\n *\n */\nImageryLayerCollection.prototype.pickImageryLayers = function (ray, scene) {\n  // Find the picked location on the globe.\n  const pickedPosition = scene.globe.pick(ray, scene);\n  if (!defined(pickedPosition)) {\n    return;\n  }\n\n  const pickedLocation = scene.globe.ellipsoid.cartesianToCartographic(\n    pickedPosition\n  );\n\n  const imageryLayers = [];\n\n  pickImageryHelper(scene, pickedLocation, false, function (imagery) {\n    imageryLayers.push(imagery.imageryLayer);\n  });\n\n  if (imageryLayers.length === 0) {\n    return undefined;\n  }\n\n  return imageryLayers;\n};\n\n/**\n * Asynchronously determines the imagery layer features that are intersected by a pick ray.  The intersected imagery\n * layer features are found by invoking {@link ImageryProvider#pickFeatures} for each imagery layer tile intersected\n * by the pick ray.  To compute a pick ray from a location on the screen, use {@link Camera.getPickRay}.\n *\n * @param {Ray} ray The ray to test for intersection.\n * @param {Scene} scene The scene.\n * @return {Promise<ImageryLayerFeatureInfo[]>|undefined} A promise that resolves to an array of features intersected by the pick ray.\n *                                             If it can be quickly determined that no features are intersected (for example,\n *                                             because no active imagery providers support {@link ImageryProvider#pickFeatures}\n *                                             or because the pick ray does not intersect the surface), this function will\n *                                             return undefined.\n *\n * @example\n * const pickRay = viewer.camera.getPickRay(windowPosition);\n * const featuresPromise = viewer.imageryLayers.pickImageryLayerFeatures(pickRay, viewer.scene);\n * if (!Cesium.defined(featuresPromise)) {\n *     console.log('No features picked.');\n * } else {\n *     Promise.resolve(featuresPromise).then(function(features) {\n *         // This function is called asynchronously when the list if picked features is available.\n *         console.log(`Number of features: ${features.length}`);\n *         if (features.length > 0) {\n *             console.log(`First feature name: ${features[0].name}`);\n *         }\n *     });\n * }\n */\nImageryLayerCollection.prototype.pickImageryLayerFeatures = function (\n  ray,\n  scene\n) {\n  // Find the picked location on the globe.\n  const pickedPosition = scene.globe.pick(ray, scene);\n  if (!defined(pickedPosition)) {\n    return;\n  }\n\n  const pickedLocation = scene.globe.ellipsoid.cartesianToCartographic(\n    pickedPosition\n  );\n\n  const promises = [];\n  const imageryLayers = [];\n\n  pickImageryHelper(scene, pickedLocation, true, function (imagery) {\n    if (!imagery.imageryLayer.ready) {\n      return undefined;\n    }\n    const provider = imagery.imageryLayer.imageryProvider;\n    const promise = provider.pickFeatures(\n      imagery.x,\n      imagery.y,\n      imagery.level,\n      pickedLocation.longitude,\n      pickedLocation.latitude\n    );\n    if (defined(promise)) {\n      promises.push(promise);\n      imageryLayers.push(imagery.imageryLayer);\n    }\n  });\n\n  if (promises.length === 0) {\n    return undefined;\n  }\n  return Promise.all(promises).then(function (results) {\n    const features = [];\n    for (let resultIndex = 0; resultIndex < results.length; ++resultIndex) {\n      const result = results[resultIndex];\n      const image = imageryLayers[resultIndex];\n      if (defined(result) && result.length > 0) {\n        for (\n          let featureIndex = 0;\n          featureIndex < result.length;\n          ++featureIndex\n        ) {\n          const feature = result[featureIndex];\n          feature.imageryLayer = image;\n          // For features without a position, use the picked location.\n          if (!defined(feature.position)) {\n            feature.position = pickedLocation;\n          }\n          features.push(feature);\n        }\n      }\n    }\n    return features;\n  });\n};\n\n/**\n * Updates frame state to execute any queued texture re-projections.\n *\n * @private\n *\n * @param {FrameState} frameState The frameState.\n */\nImageryLayerCollection.prototype.queueReprojectionCommands = function (\n  frameState\n) {\n  const layers = this._layers;\n  for (let i = 0, len = layers.length; i < len; ++i) {\n    layers[i].queueReprojectionCommands(frameState);\n  }\n};\n\n/**\n * Cancels re-projection commands queued for the next frame.\n *\n * @private\n */\nImageryLayerCollection.prototype.cancelReprojections = function () {\n  const layers = this._layers;\n  for (let i = 0, len = layers.length; i < len; ++i) {\n    layers[i].cancelReprojections();\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} true if this object was destroyed; otherwise, false.\n *\n * @see ImageryLayerCollection#destroy\n */\nImageryLayerCollection.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by all layers in this collection.  Explicitly destroying this\n * object allows for deterministic release of WebGL resources, instead of relying on the garbage\n * collector.\n * <br /><br />\n * Once this object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * layerCollection = layerCollection && layerCollection.destroy();\n *\n * @see ImageryLayerCollection#isDestroyed\n */\nImageryLayerCollection.prototype.destroy = function () {\n  this.removeAll(true);\n  return destroyObject(this);\n};\n\nImageryLayerCollection.prototype._update = function () {\n  let isBaseLayer = true;\n  const layers = this._layers;\n  let layersShownOrHidden;\n  let layer;\n  let i, len;\n  for (i = 0, len = layers.length; i < len; ++i) {\n    layer = layers[i];\n\n    layer._layerIndex = i;\n\n    if (layer.show) {\n      layer._isBaseLayer = isBaseLayer;\n      isBaseLayer = false;\n    } else {\n      layer._isBaseLayer = false;\n    }\n\n    if (layer.show !== layer._show) {\n      if (defined(layer._show)) {\n        if (!defined(layersShownOrHidden)) {\n          layersShownOrHidden = [];\n        }\n        layersShownOrHidden.push(layer);\n      }\n      layer._show = layer.show;\n    }\n  }\n\n  if (defined(layersShownOrHidden)) {\n    for (i = 0, len = layersShownOrHidden.length; i < len; ++i) {\n      layer = layersShownOrHidden[i];\n      this.layerShownOrHidden.raiseEvent(layer, layer._layerIndex, layer.show);\n    }\n  }\n};\nexport default ImageryLayerCollection;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport EllipsoidalOccluder from \"../Core/EllipsoidalOccluder.js\";\n\n/**\n * A set of occluders that can be used to test quadtree tiles for occlusion.\n *\n * @alias QuadtreeOccluders\n * @constructor\n * @private\n *\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid that potentially occludes tiles.\n */\nfunction QuadtreeOccluders(options) {\n  this._ellipsoid = new EllipsoidalOccluder(options.ellipsoid, Cartesian3.ZERO);\n}\n\nObject.defineProperties(QuadtreeOccluders.prototype, {\n  /**\n   * Gets the {@link EllipsoidalOccluder} that can be used to determine if a point is\n   * occluded by an {@link Ellipsoid}.\n   * @type {EllipsoidalOccluder}\n   * @memberof QuadtreeOccluders.prototype\n   */\n  ellipsoid: {\n    get: function () {\n      return this._ellipsoid;\n    },\n  },\n});\nexport default QuadtreeOccluders;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport QuadtreeTileLoadState from \"./QuadtreeTileLoadState.js\";\nimport TileSelectionResult from \"./TileSelectionResult.js\";\n\n/**\n * A single tile in a {@link QuadtreePrimitive}.\n *\n * @alias QuadtreeTile\n * @constructor\n * @private\n *\n * @param {number} options.level The level of the tile in the quadtree.\n * @param {number} options.x The X coordinate of the tile in the quadtree.  0 is the westernmost tile.\n * @param {number} options.y The Y coordinate of the tile in the quadtree.  0 is the northernmost tile.\n * @param {TilingScheme} options.tilingScheme The tiling scheme in which this tile exists.\n * @param {QuadtreeTile} [options.parent] This tile's parent, or undefined if this is a root tile.\n */\nfunction QuadtreeTile(options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options)) {\n    throw new DeveloperError(\"options is required.\");\n  }\n  if (!defined(options.x)) {\n    throw new DeveloperError(\"options.x is required.\");\n  } else if (!defined(options.y)) {\n    throw new DeveloperError(\"options.y is required.\");\n  } else if (options.x < 0 || options.y < 0) {\n    throw new DeveloperError(\n      \"options.x and options.y must be greater than or equal to zero.\"\n    );\n  }\n  if (!defined(options.level)) {\n    throw new DeveloperError(\n      \"options.level is required and must be greater than or equal to zero.\"\n    );\n  }\n  if (!defined(options.tilingScheme)) {\n    throw new DeveloperError(\"options.tilingScheme is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._tilingScheme = options.tilingScheme;\n  this._x = options.x;\n  this._y = options.y;\n  this._level = options.level;\n  this._parent = options.parent;\n  this._rectangle = this._tilingScheme.tileXYToRectangle(\n    this._x,\n    this._y,\n    this._level\n  );\n\n  this._southwestChild = undefined;\n  this._southeastChild = undefined;\n  this._northwestChild = undefined;\n  this._northeastChild = undefined;\n\n  // TileReplacementQueue gets/sets these private properties.\n  this.replacementPrevious = undefined;\n  this.replacementNext = undefined;\n\n  // The distance from the camera to this tile, updated when the tile is selected\n  // for rendering.  We can get rid of this if we have a better way to sort by\n  // distance - for example, by using the natural ordering of a quadtree.\n  // QuadtreePrimitive gets/sets this private property.\n  this._distance = 0.0;\n  this._loadPriority = 0.0;\n\n  this._customData = [];\n  this._frameUpdated = undefined;\n  this._lastSelectionResult = TileSelectionResult.NONE;\n  this._lastSelectionResultFrame = undefined;\n  this._loadedCallbacks = {};\n\n  /**\n   * Gets or sets the current state of the tile in the tile load pipeline.\n   * @type {QuadtreeTileLoadState}\n   * @default {@link QuadtreeTileLoadState.START}\n   */\n  this.state = QuadtreeTileLoadState.START;\n\n  /**\n   * Gets or sets a value indicating whether or not the tile is currently renderable.\n   * @type {boolean}\n   * @default false\n   */\n  this.renderable = false;\n\n  /**\n   * Gets or set a value indicating whether or not the tile was entirely upsampled from its\n   * parent tile.  If all four children of a parent tile were upsampled from the parent,\n   * we will render the parent instead of the children even if the LOD indicates that\n   * the children would be preferable.\n   * @type {boolean}\n   * @default false\n   */\n  this.upsampledFromParent = false;\n\n  /**\n   * Gets or sets the additional data associated with this tile.  The exact content is specific to the\n   * {@link QuadtreeTileProvider}.\n   * @type {object}\n   * @default undefined\n   */\n  this.data = undefined;\n}\n\n/**\n * Creates a rectangular set of tiles for level of detail zero, the coarsest, least detailed level.\n *\n * @memberof QuadtreeTile\n *\n * @param {TilingScheme} tilingScheme The tiling scheme for which the tiles are to be created.\n * @returns {QuadtreeTile[]} An array containing the tiles at level of detail zero, starting with the\n * tile in the northwest corner and followed by the tile (if any) to its east.\n */\nQuadtreeTile.createLevelZeroTiles = function (tilingScheme) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(tilingScheme)) {\n    throw new DeveloperError(\"tilingScheme is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const numberOfLevelZeroTilesX = tilingScheme.getNumberOfXTilesAtLevel(0);\n  const numberOfLevelZeroTilesY = tilingScheme.getNumberOfYTilesAtLevel(0);\n\n  const result = new Array(numberOfLevelZeroTilesX * numberOfLevelZeroTilesY);\n\n  let index = 0;\n  for (let y = 0; y < numberOfLevelZeroTilesY; ++y) {\n    for (let x = 0; x < numberOfLevelZeroTilesX; ++x) {\n      result[index++] = new QuadtreeTile({\n        tilingScheme: tilingScheme,\n        x: x,\n        y: y,\n        level: 0,\n      });\n    }\n  }\n\n  return result;\n};\n\nQuadtreeTile.prototype._updateCustomData = function (\n  frameNumber,\n  added,\n  removed\n) {\n  let customData = this.customData;\n\n  let i;\n  let data;\n  let rectangle;\n\n  if (defined(added) && defined(removed)) {\n    customData = customData.filter(function (value) {\n      return removed.indexOf(value) === -1;\n    });\n    this._customData = customData;\n\n    rectangle = this._rectangle;\n    for (i = 0; i < added.length; ++i) {\n      data = added[i];\n      if (Rectangle.contains(rectangle, data.positionCartographic)) {\n        customData.push(data);\n      }\n    }\n\n    this._frameUpdated = frameNumber;\n  } else {\n    // interior or leaf tile, update from parent\n    const parent = this._parent;\n    if (defined(parent) && this._frameUpdated !== parent._frameUpdated) {\n      customData.length = 0;\n\n      rectangle = this._rectangle;\n      const parentCustomData = parent.customData;\n      for (i = 0; i < parentCustomData.length; ++i) {\n        data = parentCustomData[i];\n        if (Rectangle.contains(rectangle, data.positionCartographic)) {\n          customData.push(data);\n        }\n      }\n\n      this._frameUpdated = parent._frameUpdated;\n    }\n  }\n};\n\nObject.defineProperties(QuadtreeTile.prototype, {\n  /**\n   * Gets the tiling scheme used to tile the surface.\n   * @memberof QuadtreeTile.prototype\n   * @type {TilingScheme}\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets the tile X coordinate.\n   * @memberof QuadtreeTile.prototype\n   * @type {number}\n   */\n  x: {\n    get: function () {\n      return this._x;\n    },\n  },\n\n  /**\n   * Gets the tile Y coordinate.\n   * @memberof QuadtreeTile.prototype\n   * @type {number}\n   */\n  y: {\n    get: function () {\n      return this._y;\n    },\n  },\n\n  /**\n   * Gets the level-of-detail, where zero is the coarsest, least-detailed.\n   * @memberof QuadtreeTile.prototype\n   * @type {number}\n   */\n  level: {\n    get: function () {\n      return this._level;\n    },\n  },\n\n  /**\n   * Gets the parent tile of this tile.\n   * @memberof QuadtreeTile.prototype\n   * @type {QuadtreeTile}\n   */\n  parent: {\n    get: function () {\n      return this._parent;\n    },\n  },\n\n  /**\n   * Gets the cartographic rectangle of the tile, with north, south, east and\n   * west properties in radians.\n   * @memberof QuadtreeTile.prototype\n   * @type {Rectangle}\n   */\n  rectangle: {\n    get: function () {\n      return this._rectangle;\n    },\n  },\n\n  /**\n   * An array of tiles that is at the next level of the tile tree.\n   * @memberof QuadtreeTile.prototype\n   * @type {QuadtreeTile[]}\n   */\n  children: {\n    get: function () {\n      return [\n        this.northwestChild,\n        this.northeastChild,\n        this.southwestChild,\n        this.southeastChild,\n      ];\n    },\n  },\n\n  /**\n   * Gets the southwest child tile.\n   * @memberof QuadtreeTile.prototype\n   * @type {QuadtreeTile}\n   */\n  southwestChild: {\n    get: function () {\n      if (!defined(this._southwestChild)) {\n        this._southwestChild = new QuadtreeTile({\n          tilingScheme: this.tilingScheme,\n          x: this.x * 2,\n          y: this.y * 2 + 1,\n          level: this.level + 1,\n          parent: this,\n        });\n      }\n      return this._southwestChild;\n    },\n  },\n\n  /**\n   * Gets the southeast child tile.\n   * @memberof QuadtreeTile.prototype\n   * @type {QuadtreeTile}\n   */\n  southeastChild: {\n    get: function () {\n      if (!defined(this._southeastChild)) {\n        this._southeastChild = new QuadtreeTile({\n          tilingScheme: this.tilingScheme,\n          x: this.x * 2 + 1,\n          y: this.y * 2 + 1,\n          level: this.level + 1,\n          parent: this,\n        });\n      }\n      return this._southeastChild;\n    },\n  },\n\n  /**\n   * Gets the northwest child tile.\n   * @memberof QuadtreeTile.prototype\n   * @type {QuadtreeTile}\n   */\n  northwestChild: {\n    get: function () {\n      if (!defined(this._northwestChild)) {\n        this._northwestChild = new QuadtreeTile({\n          tilingScheme: this.tilingScheme,\n          x: this.x * 2,\n          y: this.y * 2,\n          level: this.level + 1,\n          parent: this,\n        });\n      }\n      return this._northwestChild;\n    },\n  },\n\n  /**\n   * Gets the northeast child tile.\n   * @memberof QuadtreeTile.prototype\n   * @type {QuadtreeTile}\n   */\n  northeastChild: {\n    get: function () {\n      if (!defined(this._northeastChild)) {\n        this._northeastChild = new QuadtreeTile({\n          tilingScheme: this.tilingScheme,\n          x: this.x * 2 + 1,\n          y: this.y * 2,\n          level: this.level + 1,\n          parent: this,\n        });\n      }\n      return this._northeastChild;\n    },\n  },\n\n  /**\n   * An array of objects associated with this tile.\n   * @memberof QuadtreeTile.prototype\n   * @type {Array}\n   */\n  customData: {\n    get: function () {\n      return this._customData;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not this tile needs further loading.\n   * This property will return true if the {@link QuadtreeTile#state} is\n   * <code>START</code> or <code>LOADING</code>.\n   * @memberof QuadtreeTile.prototype\n   * @type {boolean}\n   */\n  needsLoading: {\n    get: function () {\n      return this.state < QuadtreeTileLoadState.DONE;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not this tile is eligible to be unloaded.\n   * Typically, a tile is ineligible to be unloaded while an asynchronous operation,\n   * such as a request for data, is in progress on it.  A tile will never be\n   * unloaded while it is needed for rendering, regardless of the value of this\n   * property.  If {@link QuadtreeTile#data} is defined and has an\n   * <code>eligibleForUnloading</code> property, the value of that property is returned.\n   * Otherwise, this property returns true.\n   * @memberof QuadtreeTile.prototype\n   * @type {boolean}\n   */\n  eligibleForUnloading: {\n    get: function () {\n      let result = true;\n\n      if (defined(this.data)) {\n        result = this.data.eligibleForUnloading;\n        if (!defined(result)) {\n          result = true;\n        }\n      }\n\n      return result;\n    },\n  },\n});\n\nQuadtreeTile.prototype.findLevelZeroTile = function (levelZeroTiles, x, y) {\n  const xTiles = this.tilingScheme.getNumberOfXTilesAtLevel(0);\n  if (x < 0) {\n    x += xTiles;\n  } else if (x >= xTiles) {\n    x -= xTiles;\n  }\n\n  if (y < 0 || y >= this.tilingScheme.getNumberOfYTilesAtLevel(0)) {\n    return undefined;\n  }\n\n  return levelZeroTiles.filter(function (tile) {\n    return tile.x === x && tile.y === y;\n  })[0];\n};\n\nQuadtreeTile.prototype.findTileToWest = function (levelZeroTiles) {\n  const parent = this.parent;\n  if (parent === undefined) {\n    return this.findLevelZeroTile(levelZeroTiles, this.x - 1, this.y);\n  }\n\n  if (parent.southeastChild === this) {\n    return parent.southwestChild;\n  } else if (parent.northeastChild === this) {\n    return parent.northwestChild;\n  }\n\n  const westOfParent = parent.findTileToWest(levelZeroTiles);\n  if (westOfParent === undefined) {\n    return undefined;\n  } else if (parent.southwestChild === this) {\n    return westOfParent.southeastChild;\n  }\n  return westOfParent.northeastChild;\n};\n\nQuadtreeTile.prototype.findTileToEast = function (levelZeroTiles) {\n  const parent = this.parent;\n  if (parent === undefined) {\n    return this.findLevelZeroTile(levelZeroTiles, this.x + 1, this.y);\n  }\n\n  if (parent.southwestChild === this) {\n    return parent.southeastChild;\n  } else if (parent.northwestChild === this) {\n    return parent.northeastChild;\n  }\n\n  const eastOfParent = parent.findTileToEast(levelZeroTiles);\n  if (eastOfParent === undefined) {\n    return undefined;\n  } else if (parent.southeastChild === this) {\n    return eastOfParent.southwestChild;\n  }\n  return eastOfParent.northwestChild;\n};\n\nQuadtreeTile.prototype.findTileToSouth = function (levelZeroTiles) {\n  const parent = this.parent;\n  if (parent === undefined) {\n    return this.findLevelZeroTile(levelZeroTiles, this.x, this.y + 1);\n  }\n\n  if (parent.northwestChild === this) {\n    return parent.southwestChild;\n  } else if (parent.northeastChild === this) {\n    return parent.southeastChild;\n  }\n\n  const southOfParent = parent.findTileToSouth(levelZeroTiles);\n  if (southOfParent === undefined) {\n    return undefined;\n  } else if (parent.southwestChild === this) {\n    return southOfParent.northwestChild;\n  }\n  return southOfParent.northeastChild;\n};\n\nQuadtreeTile.prototype.findTileToNorth = function (levelZeroTiles) {\n  const parent = this.parent;\n  if (parent === undefined) {\n    return this.findLevelZeroTile(levelZeroTiles, this.x, this.y - 1);\n  }\n\n  if (parent.southwestChild === this) {\n    return parent.northwestChild;\n  } else if (parent.southeastChild === this) {\n    return parent.northeastChild;\n  }\n\n  const northOfParent = parent.findTileToNorth(levelZeroTiles);\n  if (northOfParent === undefined) {\n    return undefined;\n  } else if (parent.northwestChild === this) {\n    return northOfParent.southwestChild;\n  }\n  return northOfParent.southeastChild;\n};\n\n/**\n * Frees the resources associated with this tile and returns it to the <code>START</code>\n * {@link QuadtreeTileLoadState}.  If the {@link QuadtreeTile#data} property is defined and it\n * has a <code>freeResources</code> method, the method will be invoked.\n *\n * @memberof QuadtreeTile\n */\nQuadtreeTile.prototype.freeResources = function () {\n  this.state = QuadtreeTileLoadState.START;\n  this.renderable = false;\n  this.upsampledFromParent = false;\n\n  if (defined(this.data) && defined(this.data.freeResources)) {\n    this.data.freeResources();\n  }\n\n  freeTile(this._southwestChild);\n  this._southwestChild = undefined;\n  freeTile(this._southeastChild);\n  this._southeastChild = undefined;\n  freeTile(this._northwestChild);\n  this._northwestChild = undefined;\n  freeTile(this._northeastChild);\n  this._northeastChild = undefined;\n};\n\nfunction freeTile(tile) {\n  if (defined(tile)) {\n    tile.freeResources();\n  }\n}\nexport default QuadtreeTile;\n", "import defined from \"../Core/defined.js\";\n\n/**\n * A priority queue of tiles to be replaced, if necessary, to make room for new tiles.  The queue\n * is implemented as a linked list.\n *\n * @alias TileReplacementQueue\n * @private\n */\nfunction TileReplacementQueue() {\n  this.head = undefined;\n  this.tail = undefined;\n  this.count = 0;\n  this._lastBeforeStartOfFrame = undefined;\n}\n\n/**\n * Marks the start of the render frame.  Tiles before (closer to the head) this tile in the\n * list were used last frame and must not be unloaded.\n */\nTileReplacementQueue.prototype.markStartOfRenderFrame = function () {\n  this._lastBeforeStartOfFrame = this.head;\n};\n\n/**\n * Reduces the size of the queue to a specified size by unloading the least-recently used\n * tiles.  Tiles that were used last frame will not be unloaded, even if that puts the number\n * of tiles above the specified maximum.\n *\n * @param {number} maximumTiles The maximum number of tiles in the queue.\n */\nTileReplacementQueue.prototype.trimTiles = function (maximumTiles) {\n  let tileToTrim = this.tail;\n  let keepTrimming = true;\n  while (\n    keepTrimming &&\n    defined(this._lastBeforeStartOfFrame) &&\n    this.count > maximumTiles &&\n    defined(tileToTrim)\n  ) {\n    // Stop trimming after we process the last tile not used in the\n    // current frame.\n    keepTrimming = tileToTrim !== this._lastBeforeStartOfFrame;\n\n    const previous = tileToTrim.replacementPrevious;\n\n    if (tileToTrim.eligibleForUnloading) {\n      tileToTrim.freeResources();\n      remove(this, tileToTrim);\n    }\n\n    tileToTrim = previous;\n  }\n};\n\nfunction remove(tileReplacementQueue, item) {\n  const previous = item.replacementPrevious;\n  const next = item.replacementNext;\n\n  if (item === tileReplacementQueue._lastBeforeStartOfFrame) {\n    tileReplacementQueue._lastBeforeStartOfFrame = next;\n  }\n\n  if (item === tileReplacementQueue.head) {\n    tileReplacementQueue.head = next;\n  } else {\n    previous.replacementNext = next;\n  }\n\n  if (item === tileReplacementQueue.tail) {\n    tileReplacementQueue.tail = previous;\n  } else {\n    next.replacementPrevious = previous;\n  }\n\n  item.replacementPrevious = undefined;\n  item.replacementNext = undefined;\n\n  --tileReplacementQueue.count;\n}\n\n/**\n * Marks a tile as rendered this frame and moves it before the first tile that was not rendered\n * this frame.\n *\n * @param {TileReplacementQueue} item The tile that was rendered.\n */\nTileReplacementQueue.prototype.markTileRendered = function (item) {\n  const head = this.head;\n  if (head === item) {\n    if (item === this._lastBeforeStartOfFrame) {\n      this._lastBeforeStartOfFrame = item.replacementNext;\n    }\n    return;\n  }\n\n  ++this.count;\n\n  if (!defined(head)) {\n    // no other tiles in the list\n    item.replacementPrevious = undefined;\n    item.replacementNext = undefined;\n    this.head = item;\n    this.tail = item;\n    return;\n  }\n\n  if (defined(item.replacementPrevious) || defined(item.replacementNext)) {\n    // tile already in the list, remove from its current location\n    remove(this, item);\n  }\n\n  item.replacementPrevious = undefined;\n  item.replacementNext = head;\n  head.replacementPrevious = item;\n\n  this.head = item;\n};\nexport default TileReplacementQueue;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport Ray from \"../Core/Ray.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Visibility from \"../Core/Visibility.js\";\nimport QuadtreeOccluders from \"./QuadtreeOccluders.js\";\nimport QuadtreeTile from \"./QuadtreeTile.js\";\nimport QuadtreeTileLoadState from \"./QuadtreeTileLoadState.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport TileReplacementQueue from \"./TileReplacementQueue.js\";\nimport TileSelectionResult from \"./TileSelectionResult.js\";\n\n/**\n * Renders massive sets of data by utilizing level-of-detail and culling.  The globe surface is divided into\n * a quadtree of tiles with large, low-detail tiles at the root and small, high-detail tiles at the leaves.\n * The set of tiles to render is selected by projecting an estimate of the geometric error in a tile onto\n * the screen to estimate screen-space error, in pixels, which must be below a user-specified threshold.\n * The actual content of the tiles is arbitrary and is specified using a {@link QuadtreeTileProvider}.\n *\n * @alias QuadtreePrimitive\n * @constructor\n * @private\n *\n * @param {QuadtreeTileProvider} options.tileProvider The tile provider that loads, renders, and estimates\n *        the distance to individual tiles.\n * @param {number} [options.maximumScreenSpaceError=2] The maximum screen-space error, in pixels, that is allowed.\n *        A higher maximum error will render fewer tiles and improve performance, while a lower\n *        value will improve visual quality.\n * @param {number} [options.tileCacheSize=100] The maximum number of tiles that will be retained in the tile cache.\n *        Note that tiles will never be unloaded if they were used for rendering the last\n *        frame, so the actual number of resident tiles may be higher.  The value of\n *        this property will not affect visual quality.\n */\nfunction QuadtreePrimitive(options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options) || !defined(options.tileProvider)) {\n    throw new DeveloperError(\"options.tileProvider is required.\");\n  }\n  if (defined(options.tileProvider.quadtree)) {\n    throw new DeveloperError(\n      \"A QuadtreeTileProvider can only be used with a single QuadtreePrimitive\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._tileProvider = options.tileProvider;\n  this._tileProvider.quadtree = this;\n\n  this._debug = {\n    enableDebugOutput: false,\n\n    maxDepth: 0,\n    maxDepthVisited: 0,\n    tilesVisited: 0,\n    tilesCulled: 0,\n    tilesRendered: 0,\n    tilesWaitingForChildren: 0,\n\n    lastMaxDepth: -1,\n    lastMaxDepthVisited: -1,\n    lastTilesVisited: -1,\n    lastTilesCulled: -1,\n    lastTilesRendered: -1,\n    lastTilesWaitingForChildren: -1,\n\n    suspendLodUpdate: false,\n  };\n\n  const tilingScheme = this._tileProvider.tilingScheme;\n  const ellipsoid = tilingScheme.ellipsoid;\n\n  this._tilesToRender = [];\n  this._tileLoadQueueHigh = []; // high priority tiles are preventing refinement\n  this._tileLoadQueueMedium = []; // medium priority tiles are being rendered\n  this._tileLoadQueueLow = []; // low priority tiles were refined past or are non-visible parts of quads.\n  this._tileReplacementQueue = new TileReplacementQueue();\n  this._levelZeroTiles = undefined;\n  this._loadQueueTimeSlice = 5.0;\n  this._tilesInvalidated = false;\n\n  this._addHeightCallbacks = [];\n  this._removeHeightCallbacks = [];\n\n  this._tileToUpdateHeights = [];\n  this._lastTileIndex = 0;\n  this._updateHeightsTimeSlice = 2.0;\n\n  // If a culled tile contains _cameraPositionCartographic or _cameraReferenceFrameOriginCartographic, it will be marked\n  // TileSelectionResult.CULLED_BUT_NEEDED and added to the list of tiles to update heights,\n  // even though it is not rendered.\n  // These are updated each frame in `selectTilesForRendering`.\n  this._cameraPositionCartographic = undefined;\n  this._cameraReferenceFrameOriginCartographic = undefined;\n\n  /**\n   * Gets or sets the maximum screen-space error, in pixels, that is allowed.\n   * A higher maximum error will render fewer tiles and improve performance, while a lower\n   * value will improve visual quality.\n   * @type {number}\n   * @default 2\n   */\n  this.maximumScreenSpaceError = defaultValue(\n    options.maximumScreenSpaceError,\n    2\n  );\n\n  /**\n   * Gets or sets the maximum number of tiles that will be retained in the tile cache.\n   * Note that tiles will never be unloaded if they were used for rendering the last\n   * frame, so the actual number of resident tiles may be higher.  The value of\n   * this property will not affect visual quality.\n   * @type {number}\n   * @default 100\n   */\n  this.tileCacheSize = defaultValue(options.tileCacheSize, 100);\n\n  /**\n   * Gets or sets the number of loading descendant tiles that is considered \"too many\".\n   * If a tile has too many loading descendants, that tile will be loaded and rendered before any of\n   * its descendants are loaded and rendered. This means more feedback for the user that something\n   * is happening at the cost of a longer overall load time. Setting this to 0 will cause each\n   * tile level to be loaded successively, significantly increasing load time. Setting it to a large\n   * number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make\n   * detail appear all at once after a long wait.\n   * @type {number}\n   * @default 20\n   */\n  this.loadingDescendantLimit = 20;\n\n  /**\n   * Gets or sets a value indicating whether the ancestors of rendered tiles should be preloaded.\n   * Setting this to true optimizes the zoom-out experience and provides more detail in\n   * newly-exposed areas when panning. The down side is that it requires loading more tiles.\n   * @type {boolean}\n   * @default true\n   */\n  this.preloadAncestors = true;\n\n  /**\n   * Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded.\n   * Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even\n   * if they are culled. Setting this to true may provide a better panning experience at the\n   * cost of loading more tiles.\n   * @type {boolean}\n   * @default false\n   */\n  this.preloadSiblings = false;\n\n  this._occluders = new QuadtreeOccluders({\n    ellipsoid: ellipsoid,\n  });\n\n  this._tileLoadProgressEvent = new Event();\n  this._lastTileLoadQueueLength = 0;\n\n  this._lastSelectionFrameNumber = undefined;\n}\n\nObject.defineProperties(QuadtreePrimitive.prototype, {\n  /**\n   * Gets the provider of {@link QuadtreeTile} instances for this quadtree.\n   * @type {QuadtreeTile}\n   * @memberof QuadtreePrimitive.prototype\n   */\n  tileProvider: {\n    get: function () {\n      return this._tileProvider;\n    },\n  },\n  /**\n   * Gets an event that's raised when the length of the tile load queue has changed since the last render frame.  When the load queue is empty,\n   * all terrain and imagery for the current view have been loaded.  The event passes the new length of the tile load queue.\n   *\n   * @memberof QuadtreePrimitive.prototype\n   * @type {Event}\n   */\n  tileLoadProgressEvent: {\n    get: function () {\n      return this._tileLoadProgressEvent;\n    },\n  },\n\n  occluders: {\n    get: function () {\n      return this._occluders;\n    },\n  },\n});\n\n/**\n * Invalidates and frees all the tiles in the quadtree.  The tiles must be reloaded\n * before they can be displayed.\n *\n * @memberof QuadtreePrimitive\n */\nQuadtreePrimitive.prototype.invalidateAllTiles = function () {\n  this._tilesInvalidated = true;\n};\n\nfunction invalidateAllTiles(primitive) {\n  // Clear the replacement queue\n  const replacementQueue = primitive._tileReplacementQueue;\n  replacementQueue.head = undefined;\n  replacementQueue.tail = undefined;\n  replacementQueue.count = 0;\n\n  clearTileLoadQueue(primitive);\n\n  // Free and recreate the level zero tiles.\n  const levelZeroTiles = primitive._levelZeroTiles;\n  if (defined(levelZeroTiles)) {\n    for (let i = 0; i < levelZeroTiles.length; ++i) {\n      const tile = levelZeroTiles[i];\n      const customData = tile.customData;\n      const customDataLength = customData.length;\n\n      for (let j = 0; j < customDataLength; ++j) {\n        const data = customData[j];\n        data.level = 0;\n        primitive._addHeightCallbacks.push(data);\n      }\n\n      levelZeroTiles[i].freeResources();\n    }\n  }\n\n  primitive._levelZeroTiles = undefined;\n\n  primitive._tileProvider.cancelReprojections();\n}\n\n/**\n * Invokes a specified function for each {@link QuadtreeTile} that is partially\n * or completely loaded.\n *\n * @param {Function} tileFunction The function to invoke for each loaded tile.  The\n *        function is passed a reference to the tile as its only parameter.\n */\nQuadtreePrimitive.prototype.forEachLoadedTile = function (tileFunction) {\n  let tile = this._tileReplacementQueue.head;\n  while (defined(tile)) {\n    if (tile.state !== QuadtreeTileLoadState.START) {\n      tileFunction(tile);\n    }\n    tile = tile.replacementNext;\n  }\n};\n\n/**\n * Invokes a specified function for each {@link QuadtreeTile} that was rendered\n * in the most recent frame.\n *\n * @param {Function} tileFunction The function to invoke for each rendered tile.  The\n *        function is passed a reference to the tile as its only parameter.\n */\nQuadtreePrimitive.prototype.forEachRenderedTile = function (tileFunction) {\n  const tilesRendered = this._tilesToRender;\n  for (let i = 0, len = tilesRendered.length; i < len; ++i) {\n    tileFunction(tilesRendered[i]);\n  }\n};\n\n/**\n * Calls the callback when a new tile is rendered that contains the given cartographic. The only parameter\n * is the cartesian position on the tile.\n *\n * @param {Cartographic} cartographic The cartographic position.\n * @param {Function} callback The function to be called when a new tile is loaded containing cartographic.\n * @returns {Function} The function to remove this callback from the quadtree.\n */\nQuadtreePrimitive.prototype.updateHeight = function (cartographic, callback) {\n  const primitive = this;\n  const object = {\n    positionOnEllipsoidSurface: undefined,\n    positionCartographic: cartographic,\n    level: -1,\n    callback: callback,\n  };\n\n  object.removeFunc = function () {\n    const addedCallbacks = primitive._addHeightCallbacks;\n    const length = addedCallbacks.length;\n    for (let i = 0; i < length; ++i) {\n      if (addedCallbacks[i] === object) {\n        addedCallbacks.splice(i, 1);\n        break;\n      }\n    }\n    primitive._removeHeightCallbacks.push(object);\n    if (object.callback) {\n      object.callback = undefined;\n    }\n  };\n\n  primitive._addHeightCallbacks.push(object);\n  return object.removeFunc;\n};\n\n/**\n * Updates the tile provider imagery and continues to process the tile load queue.\n * @private\n */\nQuadtreePrimitive.prototype.update = function (frameState) {\n  if (defined(this._tileProvider.update)) {\n    this._tileProvider.update(frameState);\n  }\n};\n\nfunction clearTileLoadQueue(primitive) {\n  const debug = primitive._debug;\n  debug.maxDepth = 0;\n  debug.maxDepthVisited = 0;\n  debug.tilesVisited = 0;\n  debug.tilesCulled = 0;\n  debug.tilesRendered = 0;\n  debug.tilesWaitingForChildren = 0;\n\n  primitive._tileLoadQueueHigh.length = 0;\n  primitive._tileLoadQueueMedium.length = 0;\n  primitive._tileLoadQueueLow.length = 0;\n}\n\n/**\n * Initializes values for a new render frame and prepare the tile load queue.\n * @private\n */\nQuadtreePrimitive.prototype.beginFrame = function (frameState) {\n  const passes = frameState.passes;\n  if (!passes.render) {\n    return;\n  }\n\n  if (this._tilesInvalidated) {\n    invalidateAllTiles(this);\n    this._tilesInvalidated = false;\n  }\n\n  // Gets commands for any texture re-projections\n  this._tileProvider.initialize(frameState);\n\n  clearTileLoadQueue(this);\n\n  if (this._debug.suspendLodUpdate) {\n    return;\n  }\n\n  this._tileReplacementQueue.markStartOfRenderFrame();\n};\n\n/**\n * Selects new tiles to load based on the frame state and creates render commands.\n * @private\n */\nQuadtreePrimitive.prototype.render = function (frameState) {\n  const passes = frameState.passes;\n  const tileProvider = this._tileProvider;\n\n  if (passes.render) {\n    tileProvider.beginUpdate(frameState);\n\n    selectTilesForRendering(this, frameState);\n    createRenderCommandsForSelectedTiles(this, frameState);\n\n    tileProvider.endUpdate(frameState);\n  }\n\n  if (passes.pick && this._tilesToRender.length > 0) {\n    tileProvider.updateForPick(frameState);\n  }\n};\n\n/**\n * Checks if the load queue length has changed since the last time we raised a queue change event - if so, raises\n * a new change event at the end of the render cycle.\n * @private\n */\nfunction updateTileLoadProgress(primitive, frameState) {\n  const currentLoadQueueLength =\n    primitive._tileLoadQueueHigh.length +\n    primitive._tileLoadQueueMedium.length +\n    primitive._tileLoadQueueLow.length;\n\n  if (\n    currentLoadQueueLength !== primitive._lastTileLoadQueueLength ||\n    primitive._tilesInvalidated\n  ) {\n    const raiseEvent = Event.prototype.raiseEvent.bind(\n      primitive._tileLoadProgressEvent,\n      currentLoadQueueLength\n    );\n    frameState.afterRender.push(() => {\n      raiseEvent();\n      return true;\n    });\n    primitive._lastTileLoadQueueLength = currentLoadQueueLength;\n  }\n\n  const debug = primitive._debug;\n  if (debug.enableDebugOutput && !debug.suspendLodUpdate) {\n    debug.maxDepth = primitive._tilesToRender.reduce(function (max, tile) {\n      return Math.max(max, tile.level);\n    }, -1);\n    debug.tilesRendered = primitive._tilesToRender.length;\n\n    if (\n      debug.tilesVisited !== debug.lastTilesVisited ||\n      debug.tilesRendered !== debug.lastTilesRendered ||\n      debug.tilesCulled !== debug.lastTilesCulled ||\n      debug.maxDepth !== debug.lastMaxDepth ||\n      debug.tilesWaitingForChildren !== debug.lastTilesWaitingForChildren ||\n      debug.maxDepthVisited !== debug.lastMaxDepthVisited\n    ) {\n      console.log(\n        `Visited ${debug.tilesVisited}, Rendered: ${debug.tilesRendered}, Culled: ${debug.tilesCulled}, Max Depth Rendered: ${debug.maxDepth}, Max Depth Visited: ${debug.maxDepthVisited}, Waiting for children: ${debug.tilesWaitingForChildren}`\n      );\n\n      debug.lastTilesVisited = debug.tilesVisited;\n      debug.lastTilesRendered = debug.tilesRendered;\n      debug.lastTilesCulled = debug.tilesCulled;\n      debug.lastMaxDepth = debug.maxDepth;\n      debug.lastTilesWaitingForChildren = debug.tilesWaitingForChildren;\n      debug.lastMaxDepthVisited = debug.maxDepthVisited;\n    }\n  }\n}\n\n/**\n * Updates terrain heights.\n * @private\n */\nQuadtreePrimitive.prototype.endFrame = function (frameState) {\n  const passes = frameState.passes;\n  if (!passes.render || frameState.mode === SceneMode.MORPHING) {\n    // Only process the load queue for a single pass.\n    // Don't process the load queue or update heights during the morph flights.\n    return;\n  }\n\n  // Load/create resources for terrain and imagery. Prepare texture re-projections for the next frame.\n  processTileLoadQueue(this, frameState);\n  updateHeights(this, frameState);\n  updateTileLoadProgress(this, frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @memberof QuadtreePrimitive\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see QuadtreePrimitive#destroy\n */\nQuadtreePrimitive.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @memberof QuadtreePrimitive\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * primitive = primitive && primitive.destroy();\n *\n * @see QuadtreePrimitive#isDestroyed\n */\nQuadtreePrimitive.prototype.destroy = function () {\n  this._tileProvider = this._tileProvider && this._tileProvider.destroy();\n};\n\nlet comparisonPoint;\nconst centerScratch = new Cartographic();\nfunction compareDistanceToPoint(a, b) {\n  let center = Rectangle.center(a.rectangle, centerScratch);\n  const alon = center.longitude - comparisonPoint.longitude;\n  const alat = center.latitude - comparisonPoint.latitude;\n\n  center = Rectangle.center(b.rectangle, centerScratch);\n  const blon = center.longitude - comparisonPoint.longitude;\n  const blat = center.latitude - comparisonPoint.latitude;\n\n  return alon * alon + alat * alat - (blon * blon + blat * blat);\n}\n\nconst cameraOriginScratch = new Cartesian3();\nlet rootTraversalDetails = [];\n\nfunction selectTilesForRendering(primitive, frameState) {\n  const debug = primitive._debug;\n  if (debug.suspendLodUpdate) {\n    return;\n  }\n\n  // Clear the render list.\n  const tilesToRender = primitive._tilesToRender;\n  tilesToRender.length = 0;\n\n  // We can't render anything before the level zero tiles exist.\n  let i;\n  const tileProvider = primitive._tileProvider;\n  if (!defined(primitive._levelZeroTiles)) {\n    const tilingScheme = tileProvider.tilingScheme;\n    if (defined(tilingScheme)) {\n      const tilingScheme = tileProvider.tilingScheme;\n      primitive._levelZeroTiles = QuadtreeTile.createLevelZeroTiles(\n        tilingScheme\n      );\n      const numberOfRootTiles = primitive._levelZeroTiles.length;\n      if (rootTraversalDetails.length < numberOfRootTiles) {\n        rootTraversalDetails = new Array(numberOfRootTiles);\n        for (i = 0; i < numberOfRootTiles; ++i) {\n          if (rootTraversalDetails[i] === undefined) {\n            rootTraversalDetails[i] = new TraversalDetails();\n          }\n        }\n      }\n    } else {\n      return;\n    }\n  }\n\n  primitive._occluders.ellipsoid.cameraPosition = frameState.camera.positionWC;\n\n  let tile;\n  const levelZeroTiles = primitive._levelZeroTiles;\n  const occluders =\n    levelZeroTiles.length > 1 ? primitive._occluders : undefined;\n\n  // Sort the level zero tiles by the distance from the center to the camera.\n  // The level zero tiles aren't necessarily a nice neat quad, so we can't use the\n  // quadtree ordering we use elsewhere in the tree\n  comparisonPoint = frameState.camera.positionCartographic;\n  levelZeroTiles.sort(compareDistanceToPoint);\n\n  const customDataAdded = primitive._addHeightCallbacks;\n  const customDataRemoved = primitive._removeHeightCallbacks;\n  const frameNumber = frameState.frameNumber;\n\n  let len;\n  if (customDataAdded.length > 0 || customDataRemoved.length > 0) {\n    for (i = 0, len = levelZeroTiles.length; i < len; ++i) {\n      tile = levelZeroTiles[i];\n      tile._updateCustomData(frameNumber, customDataAdded, customDataRemoved);\n    }\n\n    customDataAdded.length = 0;\n    customDataRemoved.length = 0;\n  }\n\n  const camera = frameState.camera;\n\n  primitive._cameraPositionCartographic = camera.positionCartographic;\n  const cameraFrameOrigin = Matrix4.getTranslation(\n    camera.transform,\n    cameraOriginScratch\n  );\n  primitive._cameraReferenceFrameOriginCartographic = primitive.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(\n    cameraFrameOrigin,\n    primitive._cameraReferenceFrameOriginCartographic\n  );\n\n  // Traverse in depth-first, near-to-far order.\n  for (i = 0, len = levelZeroTiles.length; i < len; ++i) {\n    tile = levelZeroTiles[i];\n    primitive._tileReplacementQueue.markTileRendered(tile);\n    if (!tile.renderable) {\n      queueTileLoad(primitive, primitive._tileLoadQueueHigh, tile, frameState);\n      ++debug.tilesWaitingForChildren;\n    } else {\n      visitIfVisible(\n        primitive,\n        tile,\n        tileProvider,\n        frameState,\n        occluders,\n        false,\n        rootTraversalDetails[i]\n      );\n    }\n  }\n\n  primitive._lastSelectionFrameNumber = frameNumber;\n}\n\nfunction queueTileLoad(primitive, queue, tile, frameState) {\n  if (!tile.needsLoading) {\n    return;\n  }\n\n  if (primitive.tileProvider.computeTileLoadPriority !== undefined) {\n    tile._loadPriority = primitive.tileProvider.computeTileLoadPriority(\n      tile,\n      frameState\n    );\n  }\n  queue.push(tile);\n}\n\n/**\n * Tracks details of traversing a tile while selecting tiles for rendering.\n * @alias TraversalDetails\n * @constructor\n * @private\n */\nfunction TraversalDetails() {\n  /**\n   * True if all selected (i.e. not culled or refined) tiles in this tile's subtree\n   * are renderable. If the subtree is renderable, we'll render it; no drama.\n   */\n  this.allAreRenderable = true;\n\n  /**\n   * True if any tiles in this tile's subtree were rendered last frame. If any\n   * were, we must render the subtree rather than this tile, because rendering\n   * this tile would cause detail to vanish that was visible last frame, and\n   * that's no good.\n   */\n  this.anyWereRenderedLastFrame = false;\n\n  /**\n   * Counts the number of selected tiles in this tile's subtree that are\n   * not yet ready to be rendered because they need more loading. Note that\n   * this value will _not_ necessarily be zero when\n   * {@link TraversalDetails#allAreRenderable} is true, for subtle reasons.\n   * When {@link TraversalDetails#allAreRenderable} and\n   * {@link TraversalDetails#anyWereRenderedLastFrame} are both false, we\n   * will render this tile instead of any tiles in its subtree and\n   * the `allAreRenderable` value for this tile will reflect only whether _this_\n   * tile is renderable. The `notYetRenderableCount` value, however, will still\n   * reflect the total number of tiles that we are waiting on, including the\n   * ones that we're not rendering. `notYetRenderableCount` is only reset\n   * when a subtree is removed from the render queue because the\n   * `notYetRenderableCount` exceeds the\n   * {@link QuadtreePrimitive#loadingDescendantLimit}.\n   */\n  this.notYetRenderableCount = 0;\n}\n\nfunction TraversalQuadDetails() {\n  this.southwest = new TraversalDetails();\n  this.southeast = new TraversalDetails();\n  this.northwest = new TraversalDetails();\n  this.northeast = new TraversalDetails();\n}\n\nTraversalQuadDetails.prototype.combine = function (result) {\n  const southwest = this.southwest;\n  const southeast = this.southeast;\n  const northwest = this.northwest;\n  const northeast = this.northeast;\n\n  result.allAreRenderable =\n    southwest.allAreRenderable &&\n    southeast.allAreRenderable &&\n    northwest.allAreRenderable &&\n    northeast.allAreRenderable;\n  result.anyWereRenderedLastFrame =\n    southwest.anyWereRenderedLastFrame ||\n    southeast.anyWereRenderedLastFrame ||\n    northwest.anyWereRenderedLastFrame ||\n    northeast.anyWereRenderedLastFrame;\n  result.notYetRenderableCount =\n    southwest.notYetRenderableCount +\n    southeast.notYetRenderableCount +\n    northwest.notYetRenderableCount +\n    northeast.notYetRenderableCount;\n};\n\nconst traversalQuadsByLevel = new Array(31); // level 30 tiles are ~2cm wide at the equator, should be good enough.\nfor (let i = 0; i < traversalQuadsByLevel.length; ++i) {\n  traversalQuadsByLevel[i] = new TraversalQuadDetails();\n}\n\n/**\n * Visits a tile for possible rendering. When we call this function with a tile:\n *\n *    * the tile has been determined to be visible (possibly based on a bounding volume that is not very tight-fitting)\n *    * its parent tile does _not_ meet the SSE (unless ancestorMeetsSse=true, see comments below)\n *    * the tile may or may not be renderable\n *\n * @private\n *\n * @param {Primitive} primitive The QuadtreePrimitive.\n * @param {FrameState} frameState The frame state.\n * @param {QuadtreeTile} tile The tile to visit\n * @param {boolean} ancestorMeetsSse True if a tile higher in the tile tree already met the SSE and we're refining further only\n *                  to maintain detail while that higher tile loads.\n * @param {TraversalDetails} traveralDetails On return, populated with details of how the traversal of this tile went.\n */\nfunction visitTile(\n  primitive,\n  frameState,\n  tile,\n  ancestorMeetsSse,\n  traversalDetails\n) {\n  const debug = primitive._debug;\n\n  ++debug.tilesVisited;\n\n  primitive._tileReplacementQueue.markTileRendered(tile);\n  tile._updateCustomData(frameState.frameNumber);\n\n  if (tile.level > debug.maxDepthVisited) {\n    debug.maxDepthVisited = tile.level;\n  }\n\n  const meetsSse =\n    screenSpaceError(primitive, frameState, tile) <\n    primitive.maximumScreenSpaceError;\n\n  const southwestChild = tile.southwestChild;\n  const southeastChild = tile.southeastChild;\n  const northwestChild = tile.northwestChild;\n  const northeastChild = tile.northeastChild;\n\n  const lastFrame = primitive._lastSelectionFrameNumber;\n  const lastFrameSelectionResult =\n    tile._lastSelectionResultFrame === lastFrame\n      ? tile._lastSelectionResult\n      : TileSelectionResult.NONE;\n\n  const tileProvider = primitive.tileProvider;\n\n  if (meetsSse || ancestorMeetsSse) {\n    // This tile (or an ancestor) is the one we want to render this frame, but we'll do different things depending\n    // on the state of this tile and on what we did _last_ frame.\n\n    // We can render it if _any_ of the following are true:\n    // 1. We rendered it (or kicked it) last frame.\n    // 2. This tile was culled last frame, or it wasn't even visited because an ancestor was culled.\n    // 3. The tile is completely done loading.\n    // 4. a) Terrain is ready, and\n    //    b) All necessary imagery is ready. Necessary imagery is imagery that was rendered with this tile\n    //       or any descendants last frame. Such imagery is required because rendering this tile without\n    //       it would cause detail to disappear.\n    //\n    // Determining condition 4 is more expensive, so we check the others first.\n    //\n    // Note that even if we decide to render a tile here, it may later get \"kicked\" in favor of an ancestor.\n\n    const oneRenderedLastFrame =\n      TileSelectionResult.originalResult(lastFrameSelectionResult) ===\n      TileSelectionResult.RENDERED;\n    const twoCulledOrNotVisited =\n      TileSelectionResult.originalResult(lastFrameSelectionResult) ===\n        TileSelectionResult.CULLED ||\n      lastFrameSelectionResult === TileSelectionResult.NONE;\n    const threeCompletelyLoaded = tile.state === QuadtreeTileLoadState.DONE;\n\n    let renderable =\n      oneRenderedLastFrame || twoCulledOrNotVisited || threeCompletelyLoaded;\n\n    if (!renderable) {\n      // Check the more expensive condition 4 above. This requires details of the thing\n      // we're rendering (e.g. the globe surface), so delegate it to the tile provider.\n      if (defined(tileProvider.canRenderWithoutLosingDetail)) {\n        renderable = tileProvider.canRenderWithoutLosingDetail(tile);\n      }\n    }\n\n    if (renderable) {\n      // Only load this tile if it (not just an ancestor) meets the SSE.\n      if (meetsSse) {\n        queueTileLoad(\n          primitive,\n          primitive._tileLoadQueueMedium,\n          tile,\n          frameState\n        );\n      }\n      addTileToRenderList(primitive, tile);\n\n      traversalDetails.allAreRenderable = tile.renderable;\n      traversalDetails.anyWereRenderedLastFrame =\n        lastFrameSelectionResult === TileSelectionResult.RENDERED;\n      traversalDetails.notYetRenderableCount = tile.renderable ? 0 : 1;\n\n      tile._lastSelectionResultFrame = frameState.frameNumber;\n      tile._lastSelectionResult = TileSelectionResult.RENDERED;\n\n      if (!traversalDetails.anyWereRenderedLastFrame) {\n        // Tile is newly-rendered this frame, so update its heights.\n        primitive._tileToUpdateHeights.push(tile);\n      }\n\n      return;\n    }\n\n    // Otherwise, we can't render this tile (or its fill) because doing so would cause detail to disappear\n    // that was visible last frame. Instead, keep rendering any still-visible descendants that were rendered\n    // last frame and render fills for newly-visible descendants. E.g. if we were rendering level 15 last\n    // frame but this frame we want level 14 and the closest renderable level <= 14 is 0, rendering level\n    // zero would be pretty jarring so instead we keep rendering level 15 even though its SSE is better\n    // than required. So fall through to continue traversal...\n    ancestorMeetsSse = true;\n\n    // Load this blocker tile with high priority, but only if this tile (not just an ancestor) meets the SSE.\n    if (meetsSse) {\n      queueTileLoad(primitive, primitive._tileLoadQueueHigh, tile, frameState);\n    }\n  }\n\n  if (tileProvider.canRefine(tile)) {\n    const allAreUpsampled =\n      southwestChild.upsampledFromParent &&\n      southeastChild.upsampledFromParent &&\n      northwestChild.upsampledFromParent &&\n      northeastChild.upsampledFromParent;\n\n    if (allAreUpsampled) {\n      // No point in rendering the children because they're all upsampled.  Render this tile instead.\n      addTileToRenderList(primitive, tile);\n\n      // Rendered tile that's not waiting on children loads with medium priority.\n      queueTileLoad(\n        primitive,\n        primitive._tileLoadQueueMedium,\n        tile,\n        frameState\n      );\n\n      // Make sure we don't unload the children and forget they're upsampled.\n      primitive._tileReplacementQueue.markTileRendered(southwestChild);\n      primitive._tileReplacementQueue.markTileRendered(southeastChild);\n      primitive._tileReplacementQueue.markTileRendered(northwestChild);\n      primitive._tileReplacementQueue.markTileRendered(northeastChild);\n\n      traversalDetails.allAreRenderable = tile.renderable;\n      traversalDetails.anyWereRenderedLastFrame =\n        lastFrameSelectionResult === TileSelectionResult.RENDERED;\n      traversalDetails.notYetRenderableCount = tile.renderable ? 0 : 1;\n\n      tile._lastSelectionResultFrame = frameState.frameNumber;\n      tile._lastSelectionResult = TileSelectionResult.RENDERED;\n\n      if (!traversalDetails.anyWereRenderedLastFrame) {\n        // Tile is newly-rendered this frame, so update its heights.\n        primitive._tileToUpdateHeights.push(tile);\n      }\n\n      return;\n    }\n\n    // SSE is not good enough, so refine.\n    tile._lastSelectionResultFrame = frameState.frameNumber;\n    tile._lastSelectionResult = TileSelectionResult.REFINED;\n\n    const firstRenderedDescendantIndex = primitive._tilesToRender.length;\n    const loadIndexLow = primitive._tileLoadQueueLow.length;\n    const loadIndexMedium = primitive._tileLoadQueueMedium.length;\n    const loadIndexHigh = primitive._tileLoadQueueHigh.length;\n    const tilesToUpdateHeightsIndex = primitive._tileToUpdateHeights.length;\n\n    // No need to add the children to the load queue because they'll be added (if necessary) when they're visited.\n    visitVisibleChildrenNearToFar(\n      primitive,\n      southwestChild,\n      southeastChild,\n      northwestChild,\n      northeastChild,\n      frameState,\n      ancestorMeetsSse,\n      traversalDetails\n    );\n\n    // If no descendant tiles were added to the render list by the function above, it means they were all\n    // culled even though this tile was deemed visible. That's pretty common.\n\n    if (firstRenderedDescendantIndex !== primitive._tilesToRender.length) {\n      // At least one descendant tile was added to the render list.\n      // The traversalDetails tell us what happened while visiting the children.\n\n      const allAreRenderable = traversalDetails.allAreRenderable;\n      const anyWereRenderedLastFrame =\n        traversalDetails.anyWereRenderedLastFrame;\n      const notYetRenderableCount = traversalDetails.notYetRenderableCount;\n      let queuedForLoad = false;\n\n      if (!allAreRenderable && !anyWereRenderedLastFrame) {\n        // Some of our descendants aren't ready to render yet, and none were rendered last frame,\n        // so kick them all out of the render list and render this tile instead. Continue to load them though!\n\n        // Mark the rendered descendants and their ancestors - up to this tile - as kicked.\n        const renderList = primitive._tilesToRender;\n        for (let i = firstRenderedDescendantIndex; i < renderList.length; ++i) {\n          let workTile = renderList[i];\n          while (\n            workTile !== undefined &&\n            workTile._lastSelectionResult !== TileSelectionResult.KICKED &&\n            workTile !== tile\n          ) {\n            workTile._lastSelectionResult = TileSelectionResult.kick(\n              workTile._lastSelectionResult\n            );\n            workTile = workTile.parent;\n          }\n        }\n\n        // Remove all descendants from the render list and add this tile.\n        primitive._tilesToRender.length = firstRenderedDescendantIndex;\n        primitive._tileToUpdateHeights.length = tilesToUpdateHeightsIndex;\n        addTileToRenderList(primitive, tile);\n\n        tile._lastSelectionResult = TileSelectionResult.RENDERED;\n\n        // If we're waiting on heaps of descendants, the above will take too long. So in that case,\n        // load this tile INSTEAD of loading any of the descendants, and tell the up-level we're only waiting\n        // on this tile. Keep doing this until we actually manage to render this tile.\n        const wasRenderedLastFrame =\n          lastFrameSelectionResult === TileSelectionResult.RENDERED;\n        if (\n          !wasRenderedLastFrame &&\n          notYetRenderableCount > primitive.loadingDescendantLimit\n        ) {\n          // Remove all descendants from the load queues.\n          primitive._tileLoadQueueLow.length = loadIndexLow;\n          primitive._tileLoadQueueMedium.length = loadIndexMedium;\n          primitive._tileLoadQueueHigh.length = loadIndexHigh;\n          queueTileLoad(\n            primitive,\n            primitive._tileLoadQueueMedium,\n            tile,\n            frameState\n          );\n          traversalDetails.notYetRenderableCount = tile.renderable ? 0 : 1;\n          queuedForLoad = true;\n        }\n\n        traversalDetails.allAreRenderable = tile.renderable;\n        traversalDetails.anyWereRenderedLastFrame = wasRenderedLastFrame;\n\n        if (!wasRenderedLastFrame) {\n          // Tile is newly-rendered this frame, so update its heights.\n          primitive._tileToUpdateHeights.push(tile);\n        }\n\n        ++debug.tilesWaitingForChildren;\n      }\n\n      if (primitive.preloadAncestors && !queuedForLoad) {\n        queueTileLoad(primitive, primitive._tileLoadQueueLow, tile, frameState);\n      }\n    }\n\n    return;\n  }\n\n  tile._lastSelectionResultFrame = frameState.frameNumber;\n  tile._lastSelectionResult = TileSelectionResult.RENDERED;\n\n  // We'd like to refine but can't because we have no availability data for this tile's children,\n  // so we have no idea if refinining would involve a load or an upsample. We'll have to finish\n  // loading this tile first in order to find that out, so load this refinement blocker with\n  // high priority.\n  addTileToRenderList(primitive, tile);\n  queueTileLoad(primitive, primitive._tileLoadQueueHigh, tile, frameState);\n\n  traversalDetails.allAreRenderable = tile.renderable;\n  traversalDetails.anyWereRenderedLastFrame =\n    lastFrameSelectionResult === TileSelectionResult.RENDERED;\n  traversalDetails.notYetRenderableCount = tile.renderable ? 0 : 1;\n}\n\nfunction visitVisibleChildrenNearToFar(\n  primitive,\n  southwest,\n  southeast,\n  northwest,\n  northeast,\n  frameState,\n  ancestorMeetsSse,\n  traversalDetails\n) {\n  const cameraPosition = frameState.camera.positionCartographic;\n  const tileProvider = primitive._tileProvider;\n  const occluders = primitive._occluders;\n\n  const quadDetails = traversalQuadsByLevel[southwest.level];\n  const southwestDetails = quadDetails.southwest;\n  const southeastDetails = quadDetails.southeast;\n  const northwestDetails = quadDetails.northwest;\n  const northeastDetails = quadDetails.northeast;\n\n  if (cameraPosition.longitude < southwest.rectangle.east) {\n    if (cameraPosition.latitude < southwest.rectangle.north) {\n      // Camera in southwest quadrant\n      visitIfVisible(\n        primitive,\n        southwest,\n        tileProvider,\n        frameState,\n        occluders,\n        ancestorMeetsSse,\n        southwestDetails\n      );\n      visitIfVisible(\n        primitive,\n        southeast,\n        tileProvider,\n        frameState,\n        occluders,\n        ancestorMeetsSse,\n        southeastDetails\n      );\n      visitIfVisible(\n        primitive,\n        northwest,\n        tileProvider,\n        frameState,\n        occluders,\n        ancestorMeetsSse,\n        northwestDetails\n      );\n      visitIfVisible(\n        primitive,\n        northeast,\n        tileProvider,\n        frameState,\n        occluders,\n        ancestorMeetsSse,\n        northeastDetails\n      );\n    } else {\n      // Camera in northwest quadrant\n      visitIfVisible(\n        primitive,\n        northwest,\n        tileProvider,\n        frameState,\n        occluders,\n        ancestorMeetsSse,\n        northwestDetails\n      );\n      visitIfVisible(\n        primitive,\n        southwest,\n        tileProvider,\n        frameState,\n        occluders,\n        ancestorMeetsSse,\n        southwestDetails\n      );\n      visitIfVisible(\n        primitive,\n        northeast,\n        tileProvider,\n        frameState,\n        occluders,\n        ancestorMeetsSse,\n        northeastDetails\n      );\n      visitIfVisible(\n        primitive,\n        southeast,\n        tileProvider,\n        frameState,\n        occluders,\n        ancestorMeetsSse,\n        southeastDetails\n      );\n    }\n  } else if (cameraPosition.latitude < southwest.rectangle.north) {\n    // Camera southeast quadrant\n    visitIfVisible(\n      primitive,\n      southeast,\n      tileProvider,\n      frameState,\n      occluders,\n      ancestorMeetsSse,\n      southeastDetails\n    );\n    visitIfVisible(\n      primitive,\n      southwest,\n      tileProvider,\n      frameState,\n      occluders,\n      ancestorMeetsSse,\n      southwestDetails\n    );\n    visitIfVisible(\n      primitive,\n      northeast,\n      tileProvider,\n      frameState,\n      occluders,\n      ancestorMeetsSse,\n      northeastDetails\n    );\n    visitIfVisible(\n      primitive,\n      northwest,\n      tileProvider,\n      frameState,\n      occluders,\n      ancestorMeetsSse,\n      northwestDetails\n    );\n  } else {\n    // Camera in northeast quadrant\n    visitIfVisible(\n      primitive,\n      northeast,\n      tileProvider,\n      frameState,\n      occluders,\n      ancestorMeetsSse,\n      northeastDetails\n    );\n    visitIfVisible(\n      primitive,\n      northwest,\n      tileProvider,\n      frameState,\n      occluders,\n      ancestorMeetsSse,\n      northwestDetails\n    );\n    visitIfVisible(\n      primitive,\n      southeast,\n      tileProvider,\n      frameState,\n      occluders,\n      ancestorMeetsSse,\n      southeastDetails\n    );\n    visitIfVisible(\n      primitive,\n      southwest,\n      tileProvider,\n      frameState,\n      occluders,\n      ancestorMeetsSse,\n      southwestDetails\n    );\n  }\n\n  quadDetails.combine(traversalDetails);\n}\n\nfunction containsNeededPosition(primitive, tile) {\n  const rectangle = tile.rectangle;\n  return (\n    (defined(primitive._cameraPositionCartographic) &&\n      Rectangle.contains(rectangle, primitive._cameraPositionCartographic)) ||\n    (defined(primitive._cameraReferenceFrameOriginCartographic) &&\n      Rectangle.contains(\n        rectangle,\n        primitive._cameraReferenceFrameOriginCartographic\n      ))\n  );\n}\n\nfunction visitIfVisible(\n  primitive,\n  tile,\n  tileProvider,\n  frameState,\n  occluders,\n  ancestorMeetsSse,\n  traversalDetails\n) {\n  if (\n    tileProvider.computeTileVisibility(tile, frameState, occluders) !==\n    Visibility.NONE\n  ) {\n    return visitTile(\n      primitive,\n      frameState,\n      tile,\n      ancestorMeetsSse,\n      traversalDetails\n    );\n  }\n\n  ++primitive._debug.tilesCulled;\n  primitive._tileReplacementQueue.markTileRendered(tile);\n\n  traversalDetails.allAreRenderable = true;\n  traversalDetails.anyWereRenderedLastFrame = false;\n  traversalDetails.notYetRenderableCount = 0;\n\n  if (containsNeededPosition(primitive, tile)) {\n    // Load the tile(s) that contains the camera's position and\n    // the origin of its reference frame with medium priority.\n    // But we only need to load until the terrain is available, no need to load imagery.\n    if (!defined(tile.data) || !defined(tile.data.vertexArray)) {\n      queueTileLoad(\n        primitive,\n        primitive._tileLoadQueueMedium,\n        tile,\n        frameState\n      );\n    }\n\n    const lastFrame = primitive._lastSelectionFrameNumber;\n    const lastFrameSelectionResult =\n      tile._lastSelectionResultFrame === lastFrame\n        ? tile._lastSelectionResult\n        : TileSelectionResult.NONE;\n    if (\n      lastFrameSelectionResult !== TileSelectionResult.CULLED_BUT_NEEDED &&\n      lastFrameSelectionResult !== TileSelectionResult.RENDERED\n    ) {\n      primitive._tileToUpdateHeights.push(tile);\n    }\n\n    tile._lastSelectionResult = TileSelectionResult.CULLED_BUT_NEEDED;\n  } else if (primitive.preloadSiblings || tile.level === 0) {\n    // Load culled level zero tiles with low priority.\n    // For all other levels, only load culled tiles if preloadSiblings is enabled.\n    queueTileLoad(primitive, primitive._tileLoadQueueLow, tile, frameState);\n    tile._lastSelectionResult = TileSelectionResult.CULLED;\n  } else {\n    tile._lastSelectionResult = TileSelectionResult.CULLED;\n  }\n\n  tile._lastSelectionResultFrame = frameState.frameNumber;\n}\n\nfunction screenSpaceError(primitive, frameState, tile) {\n  if (\n    frameState.mode === SceneMode.SCENE2D ||\n    frameState.camera.frustum instanceof OrthographicFrustum ||\n    frameState.camera.frustum instanceof OrthographicOffCenterFrustum\n  ) {\n    return screenSpaceError2D(primitive, frameState, tile);\n  }\n\n  const maxGeometricError = primitive._tileProvider.getLevelMaximumGeometricError(\n    tile.level\n  );\n\n  const distance = tile._distance;\n  const height = frameState.context.drawingBufferHeight;\n  const sseDenominator = frameState.camera.frustum.sseDenominator;\n\n  let error = (maxGeometricError * height) / (distance * sseDenominator);\n\n  if (frameState.fog.enabled) {\n    error -=\n      CesiumMath.fog(distance, frameState.fog.density) * frameState.fog.sse;\n  }\n\n  error /= frameState.pixelRatio;\n\n  return error;\n}\n\nfunction screenSpaceError2D(primitive, frameState, tile) {\n  const camera = frameState.camera;\n  let frustum = camera.frustum;\n  const offCenterFrustum = frustum.offCenterFrustum;\n  if (defined(offCenterFrustum)) {\n    frustum = offCenterFrustum;\n  }\n\n  const context = frameState.context;\n  const width = context.drawingBufferWidth;\n  const height = context.drawingBufferHeight;\n\n  const maxGeometricError = primitive._tileProvider.getLevelMaximumGeometricError(\n    tile.level\n  );\n  const pixelSize =\n    Math.max(frustum.top - frustum.bottom, frustum.right - frustum.left) /\n    Math.max(width, height);\n  let error = maxGeometricError / pixelSize;\n\n  if (frameState.fog.enabled && frameState.mode !== SceneMode.SCENE2D) {\n    error -=\n      CesiumMath.fog(tile._distance, frameState.fog.density) *\n      frameState.fog.sse;\n  }\n\n  error /= frameState.pixelRatio;\n\n  return error;\n}\n\nfunction addTileToRenderList(primitive, tile) {\n  primitive._tilesToRender.push(tile);\n}\n\nfunction processTileLoadQueue(primitive, frameState) {\n  const tileLoadQueueHigh = primitive._tileLoadQueueHigh;\n  const tileLoadQueueMedium = primitive._tileLoadQueueMedium;\n  const tileLoadQueueLow = primitive._tileLoadQueueLow;\n\n  if (\n    tileLoadQueueHigh.length === 0 &&\n    tileLoadQueueMedium.length === 0 &&\n    tileLoadQueueLow.length === 0\n  ) {\n    return;\n  }\n\n  // Remove any tiles that were not used this frame beyond the number\n  // we're allowed to keep.\n  primitive._tileReplacementQueue.trimTiles(primitive.tileCacheSize);\n\n  const endTime = getTimestamp() + primitive._loadQueueTimeSlice;\n  const tileProvider = primitive._tileProvider;\n\n  let didSomeLoading = processSinglePriorityLoadQueue(\n    primitive,\n    frameState,\n    tileProvider,\n    endTime,\n    tileLoadQueueHigh,\n    false\n  );\n  didSomeLoading = processSinglePriorityLoadQueue(\n    primitive,\n    frameState,\n    tileProvider,\n    endTime,\n    tileLoadQueueMedium,\n    didSomeLoading\n  );\n  processSinglePriorityLoadQueue(\n    primitive,\n    frameState,\n    tileProvider,\n    endTime,\n    tileLoadQueueLow,\n    didSomeLoading\n  );\n}\n\nfunction sortByLoadPriority(a, b) {\n  return a._loadPriority - b._loadPriority;\n}\n\nfunction processSinglePriorityLoadQueue(\n  primitive,\n  frameState,\n  tileProvider,\n  endTime,\n  loadQueue,\n  didSomeLoading\n) {\n  if (tileProvider.computeTileLoadPriority !== undefined) {\n    loadQueue.sort(sortByLoadPriority);\n  }\n\n  for (\n    let i = 0, len = loadQueue.length;\n    i < len && (getTimestamp() < endTime || !didSomeLoading);\n    ++i\n  ) {\n    const tile = loadQueue[i];\n    primitive._tileReplacementQueue.markTileRendered(tile);\n    tileProvider.loadTile(frameState, tile);\n    didSomeLoading = true;\n  }\n\n  return didSomeLoading;\n}\n\nconst scratchRay = new Ray();\nconst scratchCartographic = new Cartographic();\nconst scratchPosition = new Cartesian3();\nconst scratchArray = [];\n\nfunction updateHeights(primitive, frameState) {\n  if (!defined(primitive.tileProvider.tilingScheme)) {\n    return;\n  }\n\n  const tryNextFrame = scratchArray;\n  tryNextFrame.length = 0;\n  const tilesToUpdateHeights = primitive._tileToUpdateHeights;\n\n  const startTime = getTimestamp();\n  const timeSlice = primitive._updateHeightsTimeSlice;\n  const endTime = startTime + timeSlice;\n\n  const mode = frameState.mode;\n  const projection = frameState.mapProjection;\n  const ellipsoid = primitive.tileProvider.tilingScheme.ellipsoid;\n  let i;\n\n  while (tilesToUpdateHeights.length > 0) {\n    const tile = tilesToUpdateHeights[0];\n    if (!defined(tile.data) || !defined(tile.data.mesh)) {\n      // Tile isn't loaded enough yet, so try again next frame if this tile is still\n      // being rendered.\n      const selectionResult =\n        tile._lastSelectionResultFrame === primitive._lastSelectionFrameNumber\n          ? tile._lastSelectionResult\n          : TileSelectionResult.NONE;\n      if (\n        selectionResult === TileSelectionResult.RENDERED ||\n        selectionResult === TileSelectionResult.CULLED_BUT_NEEDED\n      ) {\n        tryNextFrame.push(tile);\n      }\n      tilesToUpdateHeights.shift();\n      primitive._lastTileIndex = 0;\n      continue;\n    }\n    const customData = tile.customData;\n    const customDataLength = customData.length;\n\n    let timeSliceMax = false;\n    for (i = primitive._lastTileIndex; i < customDataLength; ++i) {\n      const data = customData[i];\n\n      // No need to run this code when the tile is upsampled, because the height will be the same as its parent.\n      const terrainData = tile.data.terrainData;\n      const upsampledGeometryFromParent =\n        defined(terrainData) && terrainData.wasCreatedByUpsampling();\n\n      if (tile.level > data.level && !upsampledGeometryFromParent) {\n        if (!defined(data.positionOnEllipsoidSurface)) {\n          // cartesian has to be on the ellipsoid surface for `ellipsoid.geodeticSurfaceNormal`\n          data.positionOnEllipsoidSurface = Cartesian3.fromRadians(\n            data.positionCartographic.longitude,\n            data.positionCartographic.latitude,\n            0.0,\n            ellipsoid\n          );\n        }\n\n        if (mode === SceneMode.SCENE3D) {\n          const surfaceNormal = ellipsoid.geodeticSurfaceNormal(\n            data.positionOnEllipsoidSurface,\n            scratchRay.direction\n          );\n\n          // compute origin point\n\n          // Try to find the intersection point between the surface normal and z-axis.\n          // minimum height (-11500.0) for the terrain set, need to get this information from the terrain provider\n          const rayOrigin = ellipsoid.getSurfaceNormalIntersectionWithZAxis(\n            data.positionOnEllipsoidSurface,\n            11500.0,\n            scratchRay.origin\n          );\n\n          // Theoretically, not with Earth datums, the intersection point can be outside the ellipsoid\n          if (!defined(rayOrigin)) {\n            // intersection point is outside the ellipsoid, try other value\n            // minimum height (-11500.0) for the terrain set, need to get this information from the terrain provider\n            let minimumHeight = 0.0;\n            if (defined(tile.data.tileBoundingRegion)) {\n              minimumHeight = tile.data.tileBoundingRegion.minimumHeight;\n            }\n            const magnitude = Math.min(minimumHeight, -11500.0);\n\n            // multiply by the *positive* value of the magnitude\n            const vectorToMinimumPoint = Cartesian3.multiplyByScalar(\n              surfaceNormal,\n              Math.abs(magnitude) + 1,\n              scratchPosition\n            );\n            Cartesian3.subtract(\n              data.positionOnEllipsoidSurface,\n              vectorToMinimumPoint,\n              scratchRay.origin\n            );\n          }\n        } else {\n          Cartographic.clone(data.positionCartographic, scratchCartographic);\n\n          // minimum height for the terrain set, need to get this information from the terrain provider\n          scratchCartographic.height = -11500.0;\n          projection.project(scratchCartographic, scratchPosition);\n          Cartesian3.fromElements(\n            scratchPosition.z,\n            scratchPosition.x,\n            scratchPosition.y,\n            scratchPosition\n          );\n          Cartesian3.clone(scratchPosition, scratchRay.origin);\n          Cartesian3.clone(Cartesian3.UNIT_X, scratchRay.direction);\n        }\n\n        const position = tile.data.pick(\n          scratchRay,\n          mode,\n          projection,\n          false,\n          scratchPosition\n        );\n        if (defined(position)) {\n          if (defined(data.callback)) {\n            data.callback(position);\n          }\n          data.level = tile.level;\n        }\n      }\n\n      if (getTimestamp() >= endTime) {\n        timeSliceMax = true;\n        break;\n      }\n    }\n\n    if (timeSliceMax) {\n      primitive._lastTileIndex = i;\n      break;\n    } else {\n      primitive._lastTileIndex = 0;\n      tilesToUpdateHeights.shift();\n    }\n  }\n  for (i = 0; i < tryNextFrame.length; i++) {\n    tilesToUpdateHeights.push(tryNextFrame[i]);\n  }\n}\n\nfunction createRenderCommandsForSelectedTiles(primitive, frameState) {\n  const tileProvider = primitive._tileProvider;\n  const tilesToRender = primitive._tilesToRender;\n\n  for (let i = 0, len = tilesToRender.length; i < len; ++i) {\n    const tile = tilesToRender[i];\n    tileProvider.showTileThisFrame(tile, frameState);\n  }\n}\nexport default QuadtreePrimitive;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport EllipsoidTerrainProvider from \"../Core/EllipsoidTerrainProvider.js\";\nimport Event from \"../Core/Event.js\";\nimport IntersectionTests from \"../Core/IntersectionTests.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport Ray from \"../Core/Ray.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport GlobeFS from \"../Shaders/GlobeFS.js\";\nimport GlobeVS from \"../Shaders/GlobeVS.js\";\nimport AtmosphereCommon from \"../Shaders/AtmosphereCommon.js\";\nimport GroundAtmosphere from \"../Shaders/GroundAtmosphere.js\";\nimport GlobeSurfaceShaderSet from \"./GlobeSurfaceShaderSet.js\";\nimport GlobeSurfaceTileProvider from \"./GlobeSurfaceTileProvider.js\";\nimport GlobeTranslucency from \"./GlobeTranslucency.js\";\nimport ImageryLayerCollection from \"./ImageryLayerCollection.js\";\nimport QuadtreePrimitive from \"./QuadtreePrimitive.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowMode from \"./ShadowMode.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\n\n/**\n * The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider})\n * and imagery layers ({@link Globe#imageryLayers}).  Access the globe using {@link Scene#globe}.\n *\n * @alias Globe\n * @constructor\n *\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] Determines the size and shape of the\n * globe.\n */\nfunction Globe(ellipsoid) {\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n  const terrainProvider = new EllipsoidTerrainProvider({\n    ellipsoid: ellipsoid,\n  });\n  const imageryLayerCollection = new ImageryLayerCollection();\n\n  this._ellipsoid = ellipsoid;\n  this._imageryLayerCollection = imageryLayerCollection;\n\n  this._surfaceShaderSet = new GlobeSurfaceShaderSet();\n  this._material = undefined;\n\n  this._surface = new QuadtreePrimitive({\n    tileProvider: new GlobeSurfaceTileProvider({\n      terrainProvider: terrainProvider,\n      imageryLayers: imageryLayerCollection,\n      surfaceShaderSet: this._surfaceShaderSet,\n    }),\n  });\n\n  this._terrainProvider = terrainProvider;\n  this._terrainProviderChanged = new Event();\n\n  this._undergroundColor = Color.clone(Color.BLACK);\n  this._undergroundColorAlphaByDistance = new NearFarScalar(\n    ellipsoid.maximumRadius / 1000.0,\n    0.0,\n    ellipsoid.maximumRadius / 5.0,\n    1.0\n  );\n\n  this._translucency = new GlobeTranslucency();\n\n  makeShadersDirty(this);\n\n  /**\n   * Determines if the globe will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = true;\n\n  this._oceanNormalMapResourceDirty = true;\n  this._oceanNormalMapResource = new Resource({\n    url: buildModuleUrl(\"Assets/Textures/waterNormalsSmall.jpg\"),\n  });\n\n  /**\n   * The maximum screen-space error used to drive level-of-detail refinement.  Higher\n   * values will provide better performance but lower visual quality.\n   *\n   * @type {number}\n   * @default 2\n   */\n  this.maximumScreenSpaceError = 2;\n\n  /**\n   * The size of the terrain tile cache, expressed as a number of tiles.  Any additional\n   * tiles beyond this number will be freed, as long as they aren't needed for rendering\n   * this frame.  A larger number will consume more memory but will show detail faster\n   * when, for example, zooming out and then back in.\n   *\n   * @type {number}\n   * @default 100\n   */\n  this.tileCacheSize = 100;\n\n  /**\n   * Gets or sets the number of loading descendant tiles that is considered \"too many\".\n   * If a tile has too many loading descendants, that tile will be loaded and rendered before any of\n   * its descendants are loaded and rendered. This means more feedback for the user that something\n   * is happening at the cost of a longer overall load time. Setting this to 0 will cause each\n   * tile level to be loaded successively, significantly increasing load time. Setting it to a large\n   * number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make\n   * detail appear all at once after a long wait.\n   * @type {number}\n   * @default 20\n   */\n  this.loadingDescendantLimit = 20;\n\n  /**\n   * Gets or sets a value indicating whether the ancestors of rendered tiles should be preloaded.\n   * Setting this to true optimizes the zoom-out experience and provides more detail in\n   * newly-exposed areas when panning. The down side is that it requires loading more tiles.\n   * @type {boolean}\n   * @default true\n   */\n  this.preloadAncestors = true;\n\n  /**\n   * Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded.\n   * Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even\n   * if they are culled. Setting this to true may provide a better panning experience at the\n   * cost of loading more tiles.\n   * @type {boolean}\n   * @default false\n   */\n  this.preloadSiblings = false;\n\n  /**\n   * The color to use to highlight terrain fill tiles. If undefined, fill tiles are not\n   * highlighted at all. The alpha value is used to alpha blend with the tile's\n   * actual color. Because terrain fill tiles do not represent the actual terrain surface,\n   * it may be useful in some applications to indicate visually that they are not to be trusted.\n   * @type {Color}\n   * @default undefined\n   */\n  this.fillHighlightColor = undefined;\n\n  /**\n   * Enable lighting the globe with the scene's light source.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.enableLighting = false;\n\n  /**\n   * A multiplier to adjust terrain lambert lighting.\n   * This number is multiplied by the result of <code>czm_getLambertDiffuse</code> in GlobeFS.glsl.\n   * This only takes effect when <code>enableLighting</code> is <code>true</code>.\n   *\n   * @type {number}\n   * @default 0.9\n   */\n  this.lambertDiffuseMultiplier = 0.9;\n\n  /**\n   * Enable dynamic lighting effects on atmosphere and fog. This only takes effect\n   * when <code>enableLighting</code> is <code>true</code>.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.dynamicAtmosphereLighting = true;\n\n  /**\n   * Whether dynamic atmosphere lighting uses the sun direction instead of the scene's\n   * light direction. This only takes effect when <code>enableLighting</code> and\n   * <code>dynamicAtmosphereLighting</code> are <code>true</code>.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.dynamicAtmosphereLightingFromSun = false;\n\n  /**\n   * Enable the ground atmosphere, which is drawn over the globe when viewed from a distance between <code>lightingFadeInDistance</code> and <code>lightingFadeOutDistance</code>.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.showGroundAtmosphere = true;\n\n  /**\n   * The intensity of the light that is used for computing the ground atmosphere color.\n   *\n   * @type {number}\n   * @default 10.0\n   */\n  this.atmosphereLightIntensity = 10.0;\n\n  /**\n   * The Rayleigh scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.\n   *\n   * @type {Cartesian3}\n   * @default Cartesian3(5.5e-6, 13.0e-6, 28.4e-6)\n   */\n  this.atmosphereRayleighCoefficient = new Cartesian3(5.5e-6, 13.0e-6, 28.4e-6);\n\n  /**\n   * The Mie scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.\n   *\n   * @type {Cartesian3}\n   * @default Cartesian3(21e-6, 21e-6, 21e-6)\n   */\n  this.atmosphereMieCoefficient = new Cartesian3(21e-6, 21e-6, 21e-6);\n\n  /**\n   * The Rayleigh scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.\n   *\n   * @type {number}\n   * @default 10000.0\n   */\n  this.atmosphereRayleighScaleHeight = 10000.0;\n\n  /**\n   * The Mie scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.\n   *\n   * @type {number}\n   * @default 3200.0\n   */\n  this.atmosphereMieScaleHeight = 3200.0;\n\n  /**\n   * The anisotropy of the medium to consider for Mie scattering.\n   * <p>\n   * Valid values are between -1.0 and 1.0.\n   * </p>\n   * @type {number}\n   * @default 0.9\n   */\n  this.atmosphereMieAnisotropy = 0.9;\n\n  /**\n   * The distance where everything becomes lit. This only takes effect\n   * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.\n   *\n   * @type {number}\n   * @default 10000000.0\n   */\n  this.lightingFadeOutDistance = 1.0e7;\n\n  /**\n   * The distance where lighting resumes. This only takes effect\n   * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.\n   *\n   * @type {number}\n   * @default 20000000.0\n   */\n  this.lightingFadeInDistance = 2.0e7;\n\n  /**\n   * The distance where the darkness of night from the ground atmosphere fades out to a lit ground atmosphere.\n   * This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and\n   * <code>dynamicAtmosphereLighting</code> are <code>true</code>.\n   *\n   * @type {number}\n   * @default 10000000.0\n   */\n  this.nightFadeOutDistance = 1.0e7;\n\n  /**\n   * The distance where the darkness of night from the ground atmosphere fades in to an unlit ground atmosphere.\n   * This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and\n   * <code>dynamicAtmosphereLighting</code> are <code>true</code>.\n   *\n   * @type {number}\n   * @default 50000000.0\n   */\n  this.nightFadeInDistance = 5.0e7;\n\n  /**\n   * True if an animated wave effect should be shown in areas of the globe\n   * covered by water; otherwise, false.  This property is ignored if the\n   * <code>terrainProvider</code> does not provide a water mask.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.showWaterEffect = true;\n\n  /**\n   * True if primitives such as billboards, polylines, labels, etc. should be depth-tested\n   * against the terrain surface, or false if such primitives should always be drawn on top\n   * of terrain unless they're on the opposite side of the globe.  The disadvantage of depth\n   * testing primitives against terrain is that slight numerical noise or terrain level-of-detail\n   * switched can sometimes make a primitive that should be on the surface disappear underneath it.\n   *\n   * @type {boolean}\n   * @default false\n   *\n   */\n  this.depthTestAgainstTerrain = false;\n\n  /**\n   * Determines whether the globe casts or receives shadows from light sources. Setting the globe\n   * to cast shadows may impact performance since the terrain is rendered again from the light's perspective.\n   * Currently only terrain that is in view casts shadows. By default the globe does not cast shadows.\n   *\n   * @type {ShadowMode}\n   * @default ShadowMode.RECEIVE_ONLY\n   */\n  this.shadows = ShadowMode.RECEIVE_ONLY;\n\n  /**\n   * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).\n   * A hue shift of 1.0 indicates a complete rotation of the hues available.\n   * @type {number}\n   * @default 0.0\n   */\n  this.atmosphereHueShift = 0.0;\n\n  /**\n   * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).\n   * A saturation shift of -1.0 is monochrome.\n   * @type {number}\n   * @default 0.0\n   */\n  this.atmosphereSaturationShift = 0.0;\n\n  /**\n   * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).\n   * A brightness shift of -1.0 is complete darkness, which will let space show through.\n   * @type {number}\n   * @default 0.0\n   */\n  this.atmosphereBrightnessShift = 0.0;\n\n  this._terrainExaggerationChanged = false;\n  this._terrainExaggeration = 1.0;\n  this._terrainExaggerationRelativeHeight = 0.0;\n\n  /**\n   * Whether to show terrain skirts. Terrain skirts are geometry extending downwards from a tile's edges used to hide seams between neighboring tiles.\n   * Skirts are always hidden when the camera is underground or translucency is enabled.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.showSkirts = true;\n\n  /**\n   * Whether to cull back-facing terrain. Back faces are not culled when the camera is underground or translucency is enabled.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.backFaceCulling = true;\n\n  this._oceanNormalMap = undefined;\n  this._zoomedOutOceanSpecularIntensity = undefined;\n\n  /**\n   * Determines the darkness of the vertex shadow.\n   * This only takes effect when <code>enableLighting</code> is <code>true</code>.\n   *\n   * @type {number}\n   * @default 0.3\n   */\n  this.vertexShadowDarkness = 0.3;\n}\n\nObject.defineProperties(Globe.prototype, {\n  /**\n   * Gets an ellipsoid describing the shape of this globe.\n   * @memberof Globe.prototype\n   * @type {Ellipsoid}\n   */\n  ellipsoid: {\n    get: function () {\n      return this._ellipsoid;\n    },\n  },\n  /**\n   * Gets the collection of image layers that will be rendered on this globe.\n   * @memberof Globe.prototype\n   * @type {ImageryLayerCollection}\n   */\n  imageryLayers: {\n    get: function () {\n      return this._imageryLayerCollection;\n    },\n  },\n  /**\n   * Gets an event that's raised when an imagery layer is added, shown, hidden, moved, or removed.\n   *\n   * @memberof Globe.prototype\n   * @type {Event}\n   * @readonly\n   */\n  imageryLayersUpdatedEvent: {\n    get: function () {\n      return this._surface.tileProvider.imageryLayersUpdatedEvent;\n    },\n  },\n  /**\n   * Returns <code>true</code> when the tile load queue is empty, <code>false</code> otherwise.  When the load queue is empty,\n   * all terrain and imagery for the current view have been loaded.\n   * @memberof Globe.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  tilesLoaded: {\n    get: function () {\n      if (!defined(this._surface)) {\n        return true;\n      }\n      return (\n        this._surface._tileLoadQueueHigh.length === 0 &&\n        this._surface._tileLoadQueueMedium.length === 0 &&\n        this._surface._tileLoadQueueLow.length === 0\n      );\n    },\n  },\n  /**\n   * Gets or sets the color of the globe when no imagery is available.\n   * @memberof Globe.prototype\n   * @type {Color}\n   */\n  baseColor: {\n    get: function () {\n      return this._surface.tileProvider.baseColor;\n    },\n    set: function (value) {\n      this._surface.tileProvider.baseColor = value;\n    },\n  },\n  /**\n   * A property specifying a {@link ClippingPlaneCollection} used to selectively disable rendering on the outside of each plane.\n   *\n   * @memberof Globe.prototype\n   * @type {ClippingPlaneCollection}\n   */\n  clippingPlanes: {\n    get: function () {\n      return this._surface.tileProvider.clippingPlanes;\n    },\n    set: function (value) {\n      this._surface.tileProvider.clippingPlanes = value;\n    },\n  },\n  /**\n   * A property specifying a {@link Rectangle} used to limit globe rendering to a cartographic area.\n   * Defaults to the maximum extent of cartographic coordinates.\n   *\n   * @memberof Globe.prototype\n   * @type {Rectangle}\n   * @default {@link Rectangle.MAX_VALUE}\n   */\n  cartographicLimitRectangle: {\n    get: function () {\n      return this._surface.tileProvider.cartographicLimitRectangle;\n    },\n    set: function (value) {\n      if (!defined(value)) {\n        value = Rectangle.clone(Rectangle.MAX_VALUE);\n      }\n      this._surface.tileProvider.cartographicLimitRectangle = value;\n    },\n  },\n  /**\n   * The normal map to use for rendering waves in the ocean.  Setting this property will\n   * only have an effect if the configured terrain provider includes a water mask.\n   * @memberof Globe.prototype\n   * @type {string}\n   * @default buildModuleUrl('Assets/Textures/waterNormalsSmall.jpg')\n   */\n  oceanNormalMapUrl: {\n    get: function () {\n      return this._oceanNormalMapResource.url;\n    },\n    set: function (value) {\n      this._oceanNormalMapResource.url = value;\n      this._oceanNormalMapResourceDirty = true;\n    },\n  },\n  /**\n   * The terrain provider providing surface geometry for this globe.\n   * @type {TerrainProvider}\n   *\n   * @memberof Globe.prototype\n   * @type {TerrainProvider}\n   *\n   */\n  terrainProvider: {\n    get: function () {\n      return this._terrainProvider;\n    },\n    set: function (value) {\n      if (value !== this._terrainProvider) {\n        this._terrainProvider = value;\n        this._terrainProviderChanged.raiseEvent(value);\n        if (defined(this._material)) {\n          makeShadersDirty(this);\n        }\n      }\n    },\n  },\n  /**\n   * Gets an event that's raised when the terrain provider is changed\n   *\n   * @memberof Globe.prototype\n   * @type {Event}\n   * @readonly\n   */\n  terrainProviderChanged: {\n    get: function () {\n      return this._terrainProviderChanged;\n    },\n  },\n  /**\n   * A scalar used to exaggerate the terrain. Defaults to <code>1.0</code> (no exaggeration).\n   * A value of <code>2.0</code> scales the terrain by 2x.\n   * A value of <code>0.0</code> makes the terrain completely flat.\n   * Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.\n   *\n   * @memberof Globe.prototype\n   * @type {number}\n   * @default 1.0\n   *\n   * @deprecated\n   */\n  terrainExaggeration: {\n    get: function () {\n      deprecationWarning(\n        \"Globe.terrainExaggeration\",\n        \"Globe.terrainExaggeration was deprecated in CesiumJS 1.113.  It will be removed in CesiumJS 1.116. Use Scene.verticalExaggeration instead.\"\n      );\n      return this._terrainExaggeration;\n    },\n    set: function (value) {\n      deprecationWarning(\n        \"Globe.terrainExaggeration\",\n        \"Globe.terrainExaggeration was deprecated in CesiumJS 1.113.  It will be removed in CesiumJS 1.116. Use Scene.verticalExaggeration instead.\"\n      );\n      if (value !== this._terrainExaggeration) {\n        this._terrainExaggeration = value;\n        this._terrainExaggerationChanged = true;\n      }\n    },\n  },\n  /**\n   * The height from which terrain is exaggerated. Defaults to <code>0.0</code> (scaled relative to ellipsoid surface).\n   * Terrain that is above this height will scale upwards and terrain that is below this height will scale downwards.\n   * Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.\n   * If {@link Globe#terrainExaggeration} is <code>1.0</code> this value will have no effect.\n   *\n   * @memberof Globe.prototype\n   * @type {number}\n   * @default 0.0\n   *\n   * @deprecated\n   */\n  terrainExaggerationRelativeHeight: {\n    get: function () {\n      deprecationWarning(\n        \"Globe.terrainExaggerationRelativeHeight\",\n        \"Globe.terrainExaggerationRelativeHeight was deprecated in CesiumJS 1.113.  It will be removed in CesiumJS 1.116. Use Scene.verticalExaggerationRelativeHeight instead.\"\n      );\n      return this._terrainExaggerationRelativeHeight;\n    },\n    set: function (value) {\n      deprecationWarning(\n        \"Globe.terrainExaggerationRelativeHeight\",\n        \"Globe.terrainExaggerationRelativeHeight was deprecated in CesiumJS 1.113.  It will be removed in CesiumJS 1.116. Use Scene.verticalExaggerationRelativeHeight instead.\"\n      );\n      if (value !== this._terrainExaggerationRelativeHeight) {\n        this._terrainExaggerationRelativeHeight = value;\n        this._terrainExaggerationChanged = true;\n      }\n    },\n  },\n  /**\n   * Gets an event that's raised when the length of the tile load queue has changed since the last render frame.  When the load queue is empty,\n   * all terrain and imagery for the current view have been loaded.  The event passes the new length of the tile load queue.\n   *\n   * @memberof Globe.prototype\n   * @type {Event}\n   */\n  tileLoadProgressEvent: {\n    get: function () {\n      return this._surface.tileLoadProgressEvent;\n    },\n  },\n\n  /**\n   * Gets or sets the material appearance of the Globe.  This can be one of several built-in {@link Material} objects or a custom material, scripted with\n   * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.\n   * @memberof Globe.prototype\n   * @type {Material | undefined}\n   */\n  material: {\n    get: function () {\n      return this._material;\n    },\n    set: function (material) {\n      if (this._material !== material) {\n        this._material = material;\n        makeShadersDirty(this);\n      }\n    },\n  },\n\n  /**\n   * The color to render the back side of the globe when the camera is underground or the globe is translucent,\n   * blended with the globe color based on the camera's distance.\n   * <br /><br />\n   * To disable underground coloring, set <code>undergroundColor</code> to <code>undefined</code>.\n   *\n   * @memberof Globe.prototype\n   * @type {Color}\n   * @default {@link Color.BLACK}\n   *\n   * @see Globe#undergroundColorAlphaByDistance\n   */\n  undergroundColor: {\n    get: function () {\n      return this._undergroundColor;\n    },\n    set: function (value) {\n      this._undergroundColor = Color.clone(value, this._undergroundColor);\n    },\n  },\n\n  /**\n   * Gets or sets the near and far distance for blending {@link Globe#undergroundColor} with the globe color.\n   * The alpha will interpolate between the {@link NearFarScalar#nearValue} and\n   * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n   * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n   * Outside of these ranges the alpha remains clamped to the nearest bound. If undefined,\n   * the underground color will not be blended with the globe color.\n   * <br /> <br />\n   * When the camera is above the ellipsoid the distance is computed from the nearest\n   * point on the ellipsoid instead of the camera's position.\n   *\n   * @memberof Globe.prototype\n   * @type {NearFarScalar}\n   *\n   * @see Globe#undergroundColor\n   *\n   */\n  undergroundColorAlphaByDistance: {\n    get: function () {\n      return this._undergroundColorAlphaByDistance;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value) && value.far < value.near) {\n        throw new DeveloperError(\n          \"far distance must be greater than near distance.\"\n        );\n      }\n      //>>includeEnd('debug');\n      this._undergroundColorAlphaByDistance = NearFarScalar.clone(\n        value,\n        this._undergroundColorAlphaByDistance\n      );\n    },\n  },\n\n  /**\n   * Properties for controlling globe translucency.\n   *\n   * @memberof Globe.prototype\n   * @type {GlobeTranslucency}\n   */\n  translucency: {\n    get: function () {\n      return this._translucency;\n    },\n  },\n});\n\nfunction makeShadersDirty(globe) {\n  const defines = [];\n\n  const requireNormals =\n    defined(globe._material) &&\n    (globe._material.shaderSource.match(/slope/) ||\n      globe._material.shaderSource.match(\"normalEC\"));\n\n  const fragmentSources = [AtmosphereCommon, GroundAtmosphere];\n  if (\n    defined(globe._material) &&\n    (!requireNormals || globe._terrainProvider.requestVertexNormals)\n  ) {\n    fragmentSources.push(globe._material.shaderSource);\n    defines.push(\"APPLY_MATERIAL\");\n    globe._surface._tileProvider.materialUniformMap = globe._material._uniforms;\n  } else {\n    globe._surface._tileProvider.materialUniformMap = undefined;\n  }\n  fragmentSources.push(GlobeFS);\n\n  globe._surfaceShaderSet.baseVertexShaderSource = new ShaderSource({\n    sources: [AtmosphereCommon, GroundAtmosphere, GlobeVS],\n    defines: defines,\n  });\n\n  globe._surfaceShaderSet.baseFragmentShaderSource = new ShaderSource({\n    sources: fragmentSources,\n    defines: defines,\n  });\n  globe._surfaceShaderSet.material = globe._material;\n}\n\nfunction createComparePickTileFunction(rayOrigin) {\n  return function (a, b) {\n    const aDist = BoundingSphere.distanceSquaredTo(\n      a.pickBoundingSphere,\n      rayOrigin\n    );\n    const bDist = BoundingSphere.distanceSquaredTo(\n      b.pickBoundingSphere,\n      rayOrigin\n    );\n\n    return aDist - bDist;\n  };\n}\n\nconst scratchArray = [];\nconst scratchSphereIntersectionResult = {\n  start: 0.0,\n  stop: 0.0,\n};\n\n/**\n * Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates.\n *\n * @param {Ray} ray The ray to test for intersection.\n * @param {Scene} scene The scene.\n * @param {boolean} [cullBackFaces=true] Set to true to not pick back faces.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3|undefined} The intersection or <code>undefined</code> if none was found.  The returned position is in projected coordinates for 2D and Columbus View.\n *\n * @private\n */\nGlobe.prototype.pickWorldCoordinates = function (\n  ray,\n  scene,\n  cullBackFaces,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(ray)) {\n    throw new DeveloperError(\"ray is required\");\n  }\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required\");\n  }\n  //>>includeEnd('debug');\n\n  cullBackFaces = defaultValue(cullBackFaces, true);\n\n  const mode = scene.mode;\n  const projection = scene.mapProjection;\n\n  const sphereIntersections = scratchArray;\n  sphereIntersections.length = 0;\n\n  const tilesToRender = this._surface._tilesToRender;\n  let length = tilesToRender.length;\n\n  let tile;\n  let i;\n\n  for (i = 0; i < length; ++i) {\n    tile = tilesToRender[i];\n    const surfaceTile = tile.data;\n\n    if (!defined(surfaceTile)) {\n      continue;\n    }\n\n    let boundingVolume = surfaceTile.pickBoundingSphere;\n    if (mode !== SceneMode.SCENE3D) {\n      surfaceTile.pickBoundingSphere = boundingVolume = BoundingSphere.fromRectangleWithHeights2D(\n        tile.rectangle,\n        projection,\n        surfaceTile.tileBoundingRegion.minimumHeight,\n        surfaceTile.tileBoundingRegion.maximumHeight,\n        boundingVolume\n      );\n      Cartesian3.fromElements(\n        boundingVolume.center.z,\n        boundingVolume.center.x,\n        boundingVolume.center.y,\n        boundingVolume.center\n      );\n    } else if (defined(surfaceTile.renderedMesh)) {\n      BoundingSphere.clone(\n        surfaceTile.tileBoundingRegion.boundingSphere,\n        boundingVolume\n      );\n    } else {\n      // So wait how did we render this thing then? It shouldn't be possible to get here.\n      continue;\n    }\n\n    const boundingSphereIntersection = IntersectionTests.raySphere(\n      ray,\n      boundingVolume,\n      scratchSphereIntersectionResult\n    );\n    if (defined(boundingSphereIntersection)) {\n      sphereIntersections.push(surfaceTile);\n    }\n  }\n\n  sphereIntersections.sort(createComparePickTileFunction(ray.origin));\n\n  let intersection;\n  length = sphereIntersections.length;\n  for (i = 0; i < length; ++i) {\n    intersection = sphereIntersections[i].pick(\n      ray,\n      scene.mode,\n      scene.mapProjection,\n      cullBackFaces,\n      result\n    );\n    if (defined(intersection)) {\n      break;\n    }\n  }\n\n  return intersection;\n};\n\nconst cartoScratch = new Cartographic();\n/**\n * Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates.\n *\n * @param {Ray} ray The ray to test for intersection.\n * @param {Scene} scene The scene.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3|undefined} The intersection or <code>undefined</code> if none was found.\n *\n * @example\n * // find intersection of ray through a pixel and the globe\n * const ray = viewer.camera.getPickRay(windowCoordinates);\n * const intersection = globe.pick(ray, scene);\n */\nGlobe.prototype.pick = function (ray, scene, result) {\n  result = this.pickWorldCoordinates(ray, scene, true, result);\n  if (defined(result) && scene.mode !== SceneMode.SCENE3D) {\n    result = Cartesian3.fromElements(result.y, result.z, result.x, result);\n    const carto = scene.mapProjection.unproject(result, cartoScratch);\n    result = scene.globe.ellipsoid.cartographicToCartesian(carto, result);\n  }\n\n  return result;\n};\n\nconst scratchGetHeightCartesian = new Cartesian3();\nconst scratchGetHeightIntersection = new Cartesian3();\nconst scratchGetHeightCartographic = new Cartographic();\nconst scratchGetHeightRay = new Ray();\n\nfunction tileIfContainsCartographic(tile, cartographic) {\n  return defined(tile) && Rectangle.contains(tile.rectangle, cartographic)\n    ? tile\n    : undefined;\n}\n\n/**\n * Get the height of the surface at a given cartographic.\n *\n * @param {Cartographic} cartographic The cartographic for which to find the height.\n * @returns {number|undefined} The height of the cartographic or undefined if it could not be found.\n */\nGlobe.prototype.getHeight = function (cartographic) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(cartographic)) {\n    throw new DeveloperError(\"cartographic is required\");\n  }\n  //>>includeEnd('debug');\n\n  const levelZeroTiles = this._surface._levelZeroTiles;\n  if (!defined(levelZeroTiles)) {\n    return;\n  }\n\n  let tile;\n  let i;\n\n  const length = levelZeroTiles.length;\n  for (i = 0; i < length; ++i) {\n    tile = levelZeroTiles[i];\n    if (Rectangle.contains(tile.rectangle, cartographic)) {\n      break;\n    }\n  }\n\n  if (i >= length) {\n    return undefined;\n  }\n\n  let tileWithMesh = tile;\n\n  while (defined(tile)) {\n    tile =\n      tileIfContainsCartographic(tile._southwestChild, cartographic) ||\n      tileIfContainsCartographic(tile._southeastChild, cartographic) ||\n      tileIfContainsCartographic(tile._northwestChild, cartographic) ||\n      tile._northeastChild;\n\n    if (\n      defined(tile) &&\n      defined(tile.data) &&\n      defined(tile.data.renderedMesh)\n    ) {\n      tileWithMesh = tile;\n    }\n  }\n\n  tile = tileWithMesh;\n\n  // This tile was either rendered or culled.\n  // It is sometimes useful to get a height from a culled tile,\n  // e.g. when we're getting a height in order to place a billboard\n  // on terrain, and the camera is looking at that same billboard.\n  // The culled tile must have a valid mesh, though.\n  if (\n    !defined(tile) ||\n    !defined(tile.data) ||\n    !defined(tile.data.renderedMesh)\n  ) {\n    // Tile was not rendered (culled).\n    return undefined;\n  }\n\n  const projection = this._surface._tileProvider.tilingScheme.projection;\n  const ellipsoid = this._surface._tileProvider.tilingScheme.ellipsoid;\n\n  //cartesian has to be on the ellipsoid surface for `ellipsoid.geodeticSurfaceNormal`\n  const cartesian = Cartesian3.fromRadians(\n    cartographic.longitude,\n    cartographic.latitude,\n    0.0,\n    ellipsoid,\n    scratchGetHeightCartesian\n  );\n\n  const ray = scratchGetHeightRay;\n  const surfaceNormal = ellipsoid.geodeticSurfaceNormal(\n    cartesian,\n    ray.direction\n  );\n\n  // Try to find the intersection point between the surface normal and z-axis.\n  // minimum height (-11500.0) for the terrain set, need to get this information from the terrain provider\n  const rayOrigin = ellipsoid.getSurfaceNormalIntersectionWithZAxis(\n    cartesian,\n    11500.0,\n    ray.origin\n  );\n\n  // Theoretically, not with Earth datums, the intersection point can be outside the ellipsoid\n  if (!defined(rayOrigin)) {\n    // intersection point is outside the ellipsoid, try other value\n    // minimum height (-11500.0) for the terrain set, need to get this information from the terrain provider\n    let minimumHeight;\n    if (defined(tile.data.tileBoundingRegion)) {\n      minimumHeight = tile.data.tileBoundingRegion.minimumHeight;\n    }\n    const magnitude = Math.min(defaultValue(minimumHeight, 0.0), -11500.0);\n\n    // multiply by the *positive* value of the magnitude\n    const vectorToMinimumPoint = Cartesian3.multiplyByScalar(\n      surfaceNormal,\n      Math.abs(magnitude) + 1,\n      scratchGetHeightIntersection\n    );\n    Cartesian3.subtract(cartesian, vectorToMinimumPoint, ray.origin);\n  }\n\n  const intersection = tile.data.pick(\n    ray,\n    undefined,\n    projection,\n    false,\n    scratchGetHeightIntersection\n  );\n  if (!defined(intersection)) {\n    return undefined;\n  }\n\n  return ellipsoid.cartesianToCartographic(\n    intersection,\n    scratchGetHeightCartographic\n  ).height;\n};\n\n/**\n * @private\n */\nGlobe.prototype.update = function (frameState) {\n  if (!this.show) {\n    return;\n  }\n\n  if (frameState.passes.render) {\n    this._surface.update(frameState);\n  }\n};\n\n/**\n * @private\n */\nGlobe.prototype.beginFrame = function (frameState) {\n  const surface = this._surface;\n  const tileProvider = surface.tileProvider;\n  const terrainProvider = this.terrainProvider;\n  const hasWaterMask =\n    this.showWaterEffect &&\n    defined(terrainProvider) &&\n    terrainProvider.hasWaterMask &&\n    terrainProvider.hasWaterMask;\n\n  if (hasWaterMask && this._oceanNormalMapResourceDirty) {\n    // url changed, load new normal map asynchronously\n    this._oceanNormalMapResourceDirty = false;\n    const oceanNormalMapResource = this._oceanNormalMapResource;\n    const oceanNormalMapUrl = oceanNormalMapResource.url;\n    if (defined(oceanNormalMapUrl)) {\n      const that = this;\n      oceanNormalMapResource.fetchImage().then(function (image) {\n        if (oceanNormalMapUrl !== that._oceanNormalMapResource.url) {\n          // url changed while we were loading\n          return;\n        }\n\n        that._oceanNormalMap =\n          that._oceanNormalMap && that._oceanNormalMap.destroy();\n        that._oceanNormalMap = new Texture({\n          context: frameState.context,\n          source: image,\n        });\n      });\n    } else {\n      this._oceanNormalMap =\n        this._oceanNormalMap && this._oceanNormalMap.destroy();\n    }\n  }\n\n  const pass = frameState.passes;\n  const mode = frameState.mode;\n\n  if (pass.render) {\n    if (this.showGroundAtmosphere) {\n      this._zoomedOutOceanSpecularIntensity = 0.4;\n    } else {\n      this._zoomedOutOceanSpecularIntensity = 0.5;\n    }\n\n    surface.maximumScreenSpaceError = this.maximumScreenSpaceError;\n    surface.tileCacheSize = this.tileCacheSize;\n    surface.loadingDescendantLimit = this.loadingDescendantLimit;\n    surface.preloadAncestors = this.preloadAncestors;\n    surface.preloadSiblings = this.preloadSiblings;\n\n    tileProvider.terrainProvider = this.terrainProvider;\n    tileProvider.lightingFadeOutDistance = this.lightingFadeOutDistance;\n    tileProvider.lightingFadeInDistance = this.lightingFadeInDistance;\n    tileProvider.nightFadeOutDistance = this.nightFadeOutDistance;\n    tileProvider.nightFadeInDistance = this.nightFadeInDistance;\n    tileProvider.zoomedOutOceanSpecularIntensity =\n      mode === SceneMode.SCENE3D ? this._zoomedOutOceanSpecularIntensity : 0.0;\n    tileProvider.hasWaterMask = hasWaterMask;\n    tileProvider.oceanNormalMap = this._oceanNormalMap;\n    tileProvider.enableLighting = this.enableLighting;\n    tileProvider.dynamicAtmosphereLighting = this.dynamicAtmosphereLighting;\n    tileProvider.dynamicAtmosphereLightingFromSun = this.dynamicAtmosphereLightingFromSun;\n    tileProvider.showGroundAtmosphere = this.showGroundAtmosphere;\n    tileProvider.atmosphereLightIntensity = this.atmosphereLightIntensity;\n    tileProvider.atmosphereRayleighCoefficient = this.atmosphereRayleighCoefficient;\n    tileProvider.atmosphereMieCoefficient = this.atmosphereMieCoefficient;\n    tileProvider.atmosphereRayleighScaleHeight = this.atmosphereRayleighScaleHeight;\n    tileProvider.atmosphereMieScaleHeight = this.atmosphereMieScaleHeight;\n    tileProvider.atmosphereMieAnisotropy = this.atmosphereMieAnisotropy;\n    tileProvider.shadows = this.shadows;\n    tileProvider.hueShift = this.atmosphereHueShift;\n    tileProvider.saturationShift = this.atmosphereSaturationShift;\n    tileProvider.brightnessShift = this.atmosphereBrightnessShift;\n    tileProvider.fillHighlightColor = this.fillHighlightColor;\n    tileProvider.showSkirts = this.showSkirts;\n    tileProvider.backFaceCulling = this.backFaceCulling;\n    tileProvider.vertexShadowDarkness = this.vertexShadowDarkness;\n    tileProvider.undergroundColor = this._undergroundColor;\n    tileProvider.undergroundColorAlphaByDistance = this._undergroundColorAlphaByDistance;\n    tileProvider.lambertDiffuseMultiplier = this.lambertDiffuseMultiplier;\n    surface.beginFrame(frameState);\n  }\n};\n\n/**\n * @private\n */\nGlobe.prototype.render = function (frameState) {\n  if (!this.show) {\n    return;\n  }\n\n  if (defined(this._material)) {\n    this._material.update(frameState.context);\n  }\n\n  this._surface.render(frameState);\n};\n\n/**\n * @private\n */\nGlobe.prototype.endFrame = function (frameState) {\n  if (!this.show) {\n    return;\n  }\n\n  if (frameState.passes.render) {\n    this._surface.endFrame(frameState);\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see Globe#destroy\n */\nGlobe.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * globe = globe && globe.destroy();\n *\n * @see Globe#isDestroyed\n */\nGlobe.prototype.destroy = function () {\n  this._surfaceShaderSet =\n    this._surfaceShaderSet && this._surfaceShaderSet.destroy();\n  this._surface = this._surface && this._surface.destroy();\n  this._oceanNormalMap = this._oceanNormalMap && this._oceanNormalMap.destroy();\n  return destroyObject(this);\n};\nexport default Globe;\n", "/**\n * A structure containing the orientation data computed at a particular time. The data\n * represents the direction of the pole of rotation and the rotation about that pole.\n * <p>\n * These parameters correspond to the parameters in the Report from the IAU/IAG Working Group\n * except that they are expressed in radians.\n * </p>\n *\n * @namespace IauOrientationParameters\n *\n * @private\n */\nfunction IauOrientationParameters(\n  rightAscension,\n  declination,\n  rotation,\n  rotationRate\n) {\n  /**\n   * The right ascension of the north pole of the body with respect to\n   * the International Celestial Reference Frame, in radians.\n   * @type {number}\n   *\n   * @private\n   */\n  this.rightAscension = rightAscension;\n\n  /**\n   * The declination of the north pole of the body with respect to\n   * the International Celestial Reference Frame, in radians.\n   * @type {number}\n   *\n   * @private\n   */\n  this.declination = declination;\n\n  /**\n   * The rotation about the north pole used to align a set of axes with\n   * the meridian defined by the IAU report, in radians.\n   * @type {number}\n   *\n   * @private\n   */\n  this.rotation = rotation;\n\n  /**\n   * The instantaneous rotation rate about the north pole, in radians per second.\n   * @type {number}\n   *\n   * @private\n   */\n  this.rotationRate = rotationRate;\n}\nexport default IauOrientationParameters;\n", "import defined from \"./defined.js\";\nimport IauOrientationParameters from \"./IauOrientationParameters.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport CesiumMath from \"./Math.js\";\nimport TimeConstants from \"./TimeConstants.js\";\n\n/**\n * This is a collection of the orientation information available for central bodies.\n * The data comes from the Report of the IAU/IAG Working Group on Cartographic\n * Coordinates and Rotational Elements: 2000.\n *\n * @namespace Iau2000Orientation\n *\n * @private\n */\nconst Iau2000Orientation = {};\n\nconst TdtMinusTai = 32.184;\nconst J2000d = 2451545.0;\n\nconst c1 = -0.0529921;\nconst c2 = -0.1059842;\nconst c3 = 13.0120009;\nconst c4 = 13.3407154;\nconst c5 = 0.9856003;\nconst c6 = 26.4057084;\nconst c7 = 13.064993;\nconst c8 = 0.3287146;\nconst c9 = 1.7484877;\nconst c10 = -0.1589763;\nconst c11 = 0.0036096;\nconst c12 = 0.1643573;\nconst c13 = 12.9590088;\nlet dateTT = new JulianDate();\n\n/**\n * Compute the orientation parameters for the Moon.\n *\n * @param {JulianDate} [date=JulianDate.now()] The date to evaluate the parameters.\n * @param {IauOrientationParameters} [result] The object onto which to store the result.\n * @returns {IauOrientationParameters} The modified result parameter or a new instance representing the orientation of the Earth's Moon.\n * @private\n */\nIau2000Orientation.ComputeMoon = function (date, result) {\n  if (!defined(date)) {\n    date = JulianDate.now();\n  }\n\n  dateTT = JulianDate.addSeconds(date, TdtMinusTai, dateTT);\n  const d = JulianDate.totalDays(dateTT) - J2000d;\n  const T = d / TimeConstants.DAYS_PER_JULIAN_CENTURY;\n\n  const E1 = (125.045 + c1 * d) * CesiumMath.RADIANS_PER_DEGREE;\n  const E2 = (250.089 + c2 * d) * CesiumMath.RADIANS_PER_DEGREE;\n  const E3 = (260.008 + c3 * d) * CesiumMath.RADIANS_PER_DEGREE;\n  const E4 = (176.625 + c4 * d) * CesiumMath.RADIANS_PER_DEGREE;\n  const E5 = (357.529 + c5 * d) * CesiumMath.RADIANS_PER_DEGREE;\n  const E6 = (311.589 + c6 * d) * CesiumMath.RADIANS_PER_DEGREE;\n  const E7 = (134.963 + c7 * d) * CesiumMath.RADIANS_PER_DEGREE;\n  const E8 = (276.617 + c8 * d) * CesiumMath.RADIANS_PER_DEGREE;\n  const E9 = (34.226 + c9 * d) * CesiumMath.RADIANS_PER_DEGREE;\n  const E10 = (15.134 + c10 * d) * CesiumMath.RADIANS_PER_DEGREE;\n  const E11 = (119.743 + c11 * d) * CesiumMath.RADIANS_PER_DEGREE;\n  const E12 = (239.961 + c12 * d) * CesiumMath.RADIANS_PER_DEGREE;\n  const E13 = (25.053 + c13 * d) * CesiumMath.RADIANS_PER_DEGREE;\n\n  const sinE1 = Math.sin(E1);\n  const sinE2 = Math.sin(E2);\n  const sinE3 = Math.sin(E3);\n  const sinE4 = Math.sin(E4);\n  const sinE5 = Math.sin(E5);\n  const sinE6 = Math.sin(E6);\n  const sinE7 = Math.sin(E7);\n  const sinE8 = Math.sin(E8);\n  const sinE9 = Math.sin(E9);\n  const sinE10 = Math.sin(E10);\n  const sinE11 = Math.sin(E11);\n  const sinE12 = Math.sin(E12);\n  const sinE13 = Math.sin(E13);\n\n  const cosE1 = Math.cos(E1);\n  const cosE2 = Math.cos(E2);\n  const cosE3 = Math.cos(E3);\n  const cosE4 = Math.cos(E4);\n  const cosE5 = Math.cos(E5);\n  const cosE6 = Math.cos(E6);\n  const cosE7 = Math.cos(E7);\n  const cosE8 = Math.cos(E8);\n  const cosE9 = Math.cos(E9);\n  const cosE10 = Math.cos(E10);\n  const cosE11 = Math.cos(E11);\n  const cosE12 = Math.cos(E12);\n  const cosE13 = Math.cos(E13);\n\n  const rightAscension =\n    (269.9949 +\n      0.0031 * T -\n      3.8787 * sinE1 -\n      0.1204 * sinE2 +\n      0.07 * sinE3 -\n      0.0172 * sinE4 +\n      0.0072 * sinE6 -\n      0.0052 * sinE10 +\n      0.0043 * sinE13) *\n    CesiumMath.RADIANS_PER_DEGREE;\n  const declination =\n    (66.5392 +\n      0.013 * T +\n      1.5419 * cosE1 +\n      0.0239 * cosE2 -\n      0.0278 * cosE3 +\n      0.0068 * cosE4 -\n      0.0029 * cosE6 +\n      0.0009 * cosE7 +\n      0.0008 * cosE10 -\n      0.0009 * cosE13) *\n    CesiumMath.RADIANS_PER_DEGREE;\n  const rotation =\n    (38.3213 +\n      13.17635815 * d -\n      1.4e-12 * d * d +\n      3.561 * sinE1 +\n      0.1208 * sinE2 -\n      0.0642 * sinE3 +\n      0.0158 * sinE4 +\n      0.0252 * sinE5 -\n      0.0066 * sinE6 -\n      0.0047 * sinE7 -\n      0.0046 * sinE8 +\n      0.0028 * sinE9 +\n      0.0052 * sinE10 +\n      0.004 * sinE11 +\n      0.0019 * sinE12 -\n      0.0044 * sinE13) *\n    CesiumMath.RADIANS_PER_DEGREE;\n\n  const rotationRate =\n    ((13.17635815 -\n      1.4e-12 * (2.0 * d) +\n      3.561 * cosE1 * c1 +\n      0.1208 * cosE2 * c2 -\n      0.0642 * cosE3 * c3 +\n      0.0158 * cosE4 * c4 +\n      0.0252 * cosE5 * c5 -\n      0.0066 * cosE6 * c6 -\n      0.0047 * cosE7 * c7 -\n      0.0046 * cosE8 * c8 +\n      0.0028 * cosE9 * c9 +\n      0.0052 * cosE10 * c10 +\n      0.004 * cosE11 * c11 +\n      0.0019 * cosE12 * c12 -\n      0.0044 * cosE13 * c13) /\n      86400.0) *\n    CesiumMath.RADIANS_PER_DEGREE;\n\n  if (!defined(result)) {\n    result = new IauOrientationParameters();\n  }\n\n  result.rightAscension = rightAscension;\n  result.declination = declination;\n  result.rotation = rotation;\n  result.rotationRate = rotationRate;\n\n  return result;\n};\nexport default Iau2000Orientation;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport defined from \"./defined.js\";\nimport Iau2000Orientation from \"./Iau2000Orientation.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Quaternion from \"./Quaternion.js\";\n\n/**\n * The Axes representing the orientation of a Globe as represented by the data\n * from the IAU/IAG Working Group reports on rotational elements.\n * @alias IauOrientationAxes\n * @constructor\n *\n * @param {IauOrientationAxes.ComputeFunction} [computeFunction] The function that computes the {@link IauOrientationParameters} given a {@link JulianDate}.\n *\n * @see Iau2000Orientation\n *\n * @private\n */\nfunction IauOrientationAxes(computeFunction) {\n  if (!defined(computeFunction) || typeof computeFunction !== \"function\") {\n    computeFunction = Iau2000Orientation.ComputeMoon;\n  }\n\n  this._computeFunction = computeFunction;\n}\n\nconst xAxisScratch = new Cartesian3();\nconst yAxisScratch = new Cartesian3();\nconst zAxisScratch = new Cartesian3();\n\nfunction computeRotationMatrix(alpha, delta, result) {\n  const xAxis = xAxisScratch;\n  xAxis.x = Math.cos(alpha + CesiumMath.PI_OVER_TWO);\n  xAxis.y = Math.sin(alpha + CesiumMath.PI_OVER_TWO);\n  xAxis.z = 0.0;\n\n  const cosDec = Math.cos(delta);\n\n  const zAxis = zAxisScratch;\n  zAxis.x = cosDec * Math.cos(alpha);\n  zAxis.y = cosDec * Math.sin(alpha);\n  zAxis.z = Math.sin(delta);\n\n  const yAxis = Cartesian3.cross(zAxis, xAxis, yAxisScratch);\n\n  if (!defined(result)) {\n    result = new Matrix3();\n  }\n\n  result[0] = xAxis.x;\n  result[1] = yAxis.x;\n  result[2] = zAxis.x;\n  result[3] = xAxis.y;\n  result[4] = yAxis.y;\n  result[5] = zAxis.y;\n  result[6] = xAxis.z;\n  result[7] = yAxis.z;\n  result[8] = zAxis.z;\n\n  return result;\n}\n\nconst rotMtxScratch = new Matrix3();\nconst quatScratch = new Quaternion();\n\n/**\n * Computes a rotation from ICRF to a Globe's Fixed axes.\n *\n * @param {JulianDate} date The date to evaluate the matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter or a new instance of the rotation from ICRF to Fixed.\n */\nIauOrientationAxes.prototype.evaluate = function (date, result) {\n  if (!defined(date)) {\n    date = JulianDate.now();\n  }\n\n  const alphaDeltaW = this._computeFunction(date);\n  const precMtx = computeRotationMatrix(\n    alphaDeltaW.rightAscension,\n    alphaDeltaW.declination,\n    result\n  );\n\n  const rot = CesiumMath.zeroToTwoPi(alphaDeltaW.rotation);\n  const quat = Quaternion.fromAxisAngle(Cartesian3.UNIT_Z, rot, quatScratch);\n  const rotMtx = Matrix3.fromQuaternion(\n    Quaternion.conjugate(quat, quat),\n    rotMtxScratch\n  );\n\n  const cbi2cbf = Matrix3.multiply(rotMtx, precMtx, precMtx);\n  return cbi2cbf;\n};\n\n/**\n * A function that computes the {@link IauOrientationParameters} for a {@link JulianDate}.\n * @callback IauOrientationAxes.ComputeFunction\n * @param {JulianDate} date The date to evaluate the parameters.\n * @returns {IauOrientationParameters} The orientation parameters.\n * @private\n */\nexport default IauOrientationAxes;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec3 u_radii;\\n\\\nuniform vec3 u_oneOverEllipsoidRadiiSquared;\\n\\\n\\n\\\nin vec3 v_positionEC;\\n\\\n\\n\\\nvec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)\\n\\\n{\\n\\\n    vec3 positionEC = czm_pointAlongRay(ray, intersection);\\n\\\n    vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\\n\\\n    vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));\\n\\\n    vec3 sphericalNormal = normalize(positionMC / u_radii);\\n\\\n    vec3 normalMC = geodeticNormal * side;              // normalized surface normal (always facing the viewer) in model coordinates\\n\\\n    vec3 normalEC = normalize(czm_normal * normalMC);   // normalized surface normal in eye coordinates\\n\\\n\\n\\\n    vec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);\\n\\\n    vec3 positionToEyeEC = -positionEC;\\n\\\n\\n\\\n    czm_materialInput materialInput;\\n\\\n    materialInput.s = st.s;\\n\\\n    materialInput.st = st;\\n\\\n    materialInput.str = (positionMC + u_radii) / u_radii;\\n\\\n    materialInput.normalEC = normalEC;\\n\\\n    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\\n\\\n    materialInput.positionToEyeEC = positionToEyeEC;\\n\\\n    czm_material material = czm_getMaterial(materialInput);\\n\\\n\\n\\\n#ifdef ONLY_SUN_LIGHTING\\n\\\n    return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC);\\n\\\n#else\\n\\\n    return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\\n\\\n#endif\\n\\\n}\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii\\n\\\n    // in the vertex shader. Only when it is larger than some constant, march along the ray.\\n\\\n    // Otherwise perform one intersection test which will be the common case.\\n\\\n\\n\\\n    // Test if the ray intersects a sphere with the ellipsoid's maximum radius.\\n\\\n    // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test\\n\\\n    // may cause false negatives. This will discard fragments before marching the ray forward.\\n\\\n    float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;\\n\\\n    vec3 direction = normalize(v_positionEC);\\n\\\n    vec3 ellipsoidCenter = czm_modelView[3].xyz;\\n\\\n\\n\\\n    float t1 = -1.0;\\n\\\n    float t2 = -1.0;\\n\\\n\\n\\\n    float b = -2.0 * dot(direction, ellipsoidCenter);\\n\\\n    float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;\\n\\\n\\n\\\n    float discriminant = b * b - 4.0 * c;\\n\\\n    if (discriminant >= 0.0) {\\n\\\n        t1 = (-b - sqrt(discriminant)) * 0.5;\\n\\\n        t2 = (-b + sqrt(discriminant)) * 0.5;\\n\\\n    }\\n\\\n\\n\\\n    if (t1 < 0.0 && t2 < 0.0) {\\n\\\n        discard;\\n\\\n    }\\n\\\n\\n\\\n    float t = min(t1, t2);\\n\\\n    if (t < 0.0) {\\n\\\n        t = 0.0;\\n\\\n    }\\n\\\n\\n\\\n    // March ray forward to intersection with larger sphere and find\\n\\\n    czm_ray ray = czm_ray(t * direction, direction);\\n\\\n\\n\\\n    vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);\\n\\\n\\n\\\n    czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);\\n\\\n\\n\\\n    if (czm_isEmpty(intersection))\\n\\\n    {\\n\\\n        discard;\\n\\\n    }\\n\\\n\\n\\\n    // If the viewer is outside, compute outsideFaceColor, with normals facing outward.\\n\\\n    vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\\n\\\n\\n\\\n    // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward.\\n\\\n    vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\\n\\\n\\n\\\n    out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\\n\\\n    out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\\n\\\n\\n\\\n#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))\\n\\\n    t = (intersection.start != 0.0) ? intersection.start : intersection.stop;\\n\\\n    vec3 positionEC = czm_pointAlongRay(ray, t);\\n\\\n    vec4 positionCC = czm_projection * vec4(positionEC, 1.0);\\n\\\n#ifdef LOG_DEPTH\\n\\\n    czm_writeLogDepth(1.0 + positionCC.w);\\n\\\n#else\\n\\\n    float z = positionCC.z / positionCC.w;\\n\\\n\\n\\\n    float n = czm_depthRange.near;\\n\\\n    float f = czm_depthRange.far;\\n\\\n\\n\\\n    gl_FragDepth = (z * (f - n) + f + n) * 0.5;\\n\\\n#endif\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 position;\\n\\\n\\n\\\nuniform vec3 u_radii;\\n\\\n\\n\\\nout vec3 v_positionEC;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates.\\n\\\n    // Scale to consider the radii.  We could also do this once on the CPU when using the BoxGeometry,\\n\\\n    // but doing it here allows us to change the radii without rewriting the vertex data, and\\n\\\n    // allows all ellipsoids to reuse the same vertex data.\\n\\\n    vec4 p = vec4(u_radii * position, 1.0);\\n\\\n\\n\\\n    v_positionEC = (czm_modelView * p).xyz;     // position in eye coordinates\\n\\\n    gl_Position = czm_modelViewProjection * p;  // position in clip coordinates\\n\\\n\\n\\\n    // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums\\n\\\n    // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the\\n\\\n    // ellipsoid (does not write depth) that was rendered in the farther frustum.\\n\\\n    //\\n\\\n    // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates\\n\\\n    // artifacts since some fragments can be alpha blended twice.  This is solved by only rendering\\n\\\n    // the ellipsoid in the closest frustum to the viewer.\\n\\\n    gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);\\n\\\n\\n\\\n    czm_vertexLogDepth();\\n\\\n}\\n\\\n\";\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport BoxGeometry from \"../Core/BoxGeometry.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport EllipsoidFS from \"../Shaders/EllipsoidFS.js\";\nimport EllipsoidVS from \"../Shaders/EllipsoidVS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport CullFace from \"./CullFace.js\";\nimport Material from \"./Material.js\";\nimport SceneMode from \"./SceneMode.js\";\n\nconst attributeLocations = {\n  position: 0,\n};\n\n/**\n * A renderable ellipsoid.  It can also draw spheres when the three {@link EllipsoidPrimitive#radii} components are equal.\n * <p>\n * This is only supported in 3D.  The ellipsoid is not shown in 2D or Columbus view.\n * </p>\n *\n * @alias EllipsoidPrimitive\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Cartesian3} [options.center=Cartesian3.ZERO] The center of the ellipsoid in the ellipsoid's model coordinates.\n * @param {Cartesian3} [options.radii] The radius of the ellipsoid along the <code>x</code>, <code>y</code>, and <code>z</code> axes in the ellipsoid's model coordinates.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the ellipsoid from model to world coordinates.\n * @param {boolean} [options.show=true] Determines if this primitive will be shown.\n * @param {Material} [options.material=Material.ColorType] The surface appearance of the primitive.\n * @param {object} [options.id] A user-defined object to return when the instance is picked with {@link Scene#pick}\n * @param {boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n *\n * @private\n */\nfunction EllipsoidPrimitive(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * The center of the ellipsoid in the ellipsoid's model coordinates.\n   * <p>\n   * The default is {@link Cartesian3.ZERO}.\n   * </p>\n   *\n   * @type {Cartesian3}\n   * @default {@link Cartesian3.ZERO}\n   *\n   * @see EllipsoidPrimitive#modelMatrix\n   */\n  this.center = Cartesian3.clone(defaultValue(options.center, Cartesian3.ZERO));\n  this._center = new Cartesian3();\n\n  /**\n   * The radius of the ellipsoid along the <code>x</code>, <code>y</code>, and <code>z</code> axes in the ellipsoid's model coordinates.\n   * When these are the same, the ellipsoid is a sphere.\n   * <p>\n   * The default is <code>undefined</code>.  The ellipsoid is not drawn until a radii is provided.\n   * </p>\n   *\n   * @type {Cartesian3}\n   * @default undefined\n   *\n   *\n   * @example\n   * // A sphere with a radius of 2.0\n   * e.radii = new Cesium.Cartesian3(2.0, 2.0, 2.0);\n   *\n   * @see EllipsoidPrimitive#modelMatrix\n   */\n  this.radii = Cartesian3.clone(options.radii);\n  this._radii = new Cartesian3();\n\n  this._oneOverEllipsoidRadiiSquared = new Cartesian3();\n  this._boundingSphere = new BoundingSphere();\n\n  /**\n   * The 4x4 transformation matrix that transforms the ellipsoid from model to world coordinates.\n   * When this is the identity matrix, the ellipsoid is drawn in world coordinates, i.e., Earth's WGS84 coordinates.\n   * Local reference frames can be used by providing a different transformation matrix, like that returned\n   * by {@link Transforms.eastNorthUpToFixedFrame}.\n   *\n   * @type {Matrix4}\n   * @default {@link Matrix4.IDENTITY}\n   *\n   * @example\n   * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);\n   * e.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);\n   */\n  this.modelMatrix = Matrix4.clone(\n    defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n  );\n  this._modelMatrix = new Matrix4();\n  this._computedModelMatrix = new Matrix4();\n\n  /**\n   * Determines if the ellipsoid primitive will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  /**\n   * The surface appearance of the ellipsoid.  This can be one of several built-in {@link Material} objects or a custom material, scripted with\n   * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.\n   * <p>\n   * The default material is <code>Material.ColorType</code>.\n   * </p>\n   *\n   * @type {Material}\n   * @default Material.fromType(Material.ColorType)\n   *\n   *\n   * @example\n   * // 1. Change the color of the default material to yellow\n   * e.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);\n   *\n   * // 2. Change material to horizontal stripes\n   * e.material = Cesium.Material.fromType(Cesium.Material.StripeType);\n   *\n   * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n   */\n  this.material = defaultValue(\n    options.material,\n    Material.fromType(Material.ColorType)\n  );\n  this._material = undefined;\n  this._translucent = undefined;\n\n  /**\n   * User-defined object returned when the ellipsoid is picked.\n   *\n   * @type {object}\n   *\n   * @default undefined\n   *\n   * @see Scene#pick\n   */\n  this.id = options.id;\n  this._id = undefined;\n\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the bounding sphere for each draw command in the primitive.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowBoundingVolume = defaultValue(\n    options.debugShowBoundingVolume,\n    false\n  );\n\n  /**\n   * @private\n   */\n  this.onlySunLighting = defaultValue(options.onlySunLighting, false);\n  this._onlySunLighting = false;\n\n  /**\n   * @private\n   */\n  this._depthTestEnabled = defaultValue(options.depthTestEnabled, true);\n\n  this._useLogDepth = false;\n\n  this._sp = undefined;\n  this._rs = undefined;\n  this._va = undefined;\n\n  this._pickSP = undefined;\n  this._pickId = undefined;\n\n  this._colorCommand = new DrawCommand({\n    owner: defaultValue(options._owner, this),\n  });\n  this._pickCommand = new DrawCommand({\n    owner: defaultValue(options._owner, this),\n    pickOnly: true,\n  });\n\n  const that = this;\n  this._uniforms = {\n    u_radii: function () {\n      return that.radii;\n    },\n    u_oneOverEllipsoidRadiiSquared: function () {\n      return that._oneOverEllipsoidRadiiSquared;\n    },\n  };\n\n  this._pickUniforms = {\n    czm_pickColor: function () {\n      return that._pickId.color;\n    },\n  };\n}\n\nfunction getVertexArray(context) {\n  let vertexArray = context.cache.ellipsoidPrimitive_vertexArray;\n\n  if (defined(vertexArray)) {\n    return vertexArray;\n  }\n\n  const geometry = BoxGeometry.createGeometry(\n    BoxGeometry.fromDimensions({\n      dimensions: new Cartesian3(2.0, 2.0, 2.0),\n      vertexFormat: VertexFormat.POSITION_ONLY,\n    })\n  );\n\n  vertexArray = VertexArray.fromGeometry({\n    context: context,\n    geometry: geometry,\n    attributeLocations: attributeLocations,\n    bufferUsage: BufferUsage.STATIC_DRAW,\n    interleave: true,\n  });\n\n  context.cache.ellipsoidPrimitive_vertexArray = vertexArray;\n  return vertexArray;\n}\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly.  This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {DeveloperError} this.material must be defined.\n */\nEllipsoidPrimitive.prototype.update = function (frameState) {\n  if (\n    !this.show ||\n    frameState.mode !== SceneMode.SCENE3D ||\n    !defined(this.center) ||\n    !defined(this.radii)\n  ) {\n    return;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(this.material)) {\n    throw new DeveloperError(\"this.material must be defined.\");\n  }\n  //>>includeEnd('debug');\n\n  const context = frameState.context;\n  const translucent = this.material.isTranslucent();\n  const translucencyChanged = this._translucent !== translucent;\n\n  if (!defined(this._rs) || translucencyChanged) {\n    this._translucent = translucent;\n\n    // If this render state is ever updated to use a non-default\n    // depth range, the hard-coded values in EllipsoidVS.glsl need\n    // to be updated as well.\n\n    this._rs = RenderState.fromCache({\n      // Cull front faces - not back faces - so the ellipsoid doesn't\n      // disappear if the viewer enters the bounding box.\n      cull: {\n        enabled: true,\n        face: CullFace.FRONT,\n      },\n      depthTest: {\n        enabled: this._depthTestEnabled,\n      },\n      // Only write depth when EXT_frag_depth is supported since the depth for\n      // the bounding box is wrong; it is not the true depth of the ray casted ellipsoid.\n      depthMask: !translucent && context.fragmentDepth,\n      blending: translucent ? BlendingState.ALPHA_BLEND : undefined,\n    });\n  }\n\n  if (!defined(this._va)) {\n    this._va = getVertexArray(context);\n  }\n\n  let boundingSphereDirty = false;\n\n  const radii = this.radii;\n  if (!Cartesian3.equals(this._radii, radii)) {\n    Cartesian3.clone(radii, this._radii);\n\n    const r = this._oneOverEllipsoidRadiiSquared;\n    r.x = 1.0 / (radii.x * radii.x);\n    r.y = 1.0 / (radii.y * radii.y);\n    r.z = 1.0 / (radii.z * radii.z);\n\n    boundingSphereDirty = true;\n  }\n\n  if (\n    !Matrix4.equals(this.modelMatrix, this._modelMatrix) ||\n    !Cartesian3.equals(this.center, this._center)\n  ) {\n    Matrix4.clone(this.modelMatrix, this._modelMatrix);\n    Cartesian3.clone(this.center, this._center);\n\n    // Translate model coordinates used for rendering such that the origin is the center of the ellipsoid.\n    Matrix4.multiplyByTranslation(\n      this.modelMatrix,\n      this.center,\n      this._computedModelMatrix\n    );\n    boundingSphereDirty = true;\n  }\n\n  if (boundingSphereDirty) {\n    Cartesian3.clone(Cartesian3.ZERO, this._boundingSphere.center);\n    this._boundingSphere.radius = Cartesian3.maximumComponent(radii);\n    BoundingSphere.transform(\n      this._boundingSphere,\n      this._computedModelMatrix,\n      this._boundingSphere\n    );\n  }\n\n  const materialChanged = this._material !== this.material;\n  this._material = this.material;\n  this._material.update(context);\n\n  const lightingChanged = this.onlySunLighting !== this._onlySunLighting;\n  this._onlySunLighting = this.onlySunLighting;\n\n  const useLogDepth = frameState.useLogDepth;\n  const useLogDepthChanged = this._useLogDepth !== useLogDepth;\n  this._useLogDepth = useLogDepth;\n\n  const colorCommand = this._colorCommand;\n  let vs;\n  let fs;\n\n  // Recompile shader when material, lighting, or translucency changes\n  if (\n    materialChanged ||\n    lightingChanged ||\n    translucencyChanged ||\n    useLogDepthChanged\n  ) {\n    vs = new ShaderSource({\n      sources: [EllipsoidVS],\n    });\n    fs = new ShaderSource({\n      sources: [this.material.shaderSource, EllipsoidFS],\n    });\n    if (this.onlySunLighting) {\n      fs.defines.push(\"ONLY_SUN_LIGHTING\");\n    }\n    if (!translucent && context.fragmentDepth) {\n      fs.defines.push(\"WRITE_DEPTH\");\n    }\n    if (this._useLogDepth) {\n      vs.defines.push(\"LOG_DEPTH\");\n      fs.defines.push(\"LOG_DEPTH\");\n    }\n\n    this._sp = ShaderProgram.replaceCache({\n      context: context,\n      shaderProgram: this._sp,\n      vertexShaderSource: vs,\n      fragmentShaderSource: fs,\n      attributeLocations: attributeLocations,\n    });\n\n    colorCommand.vertexArray = this._va;\n    colorCommand.renderState = this._rs;\n    colorCommand.shaderProgram = this._sp;\n    colorCommand.uniformMap = combine(this._uniforms, this.material._uniforms);\n    colorCommand.executeInClosestFrustum = translucent;\n  }\n\n  const commandList = frameState.commandList;\n  const passes = frameState.passes;\n\n  if (passes.render) {\n    colorCommand.boundingVolume = this._boundingSphere;\n    colorCommand.debugShowBoundingVolume = this.debugShowBoundingVolume;\n    colorCommand.modelMatrix = this._computedModelMatrix;\n    colorCommand.pass = translucent ? Pass.TRANSLUCENT : Pass.OPAQUE;\n\n    commandList.push(colorCommand);\n  }\n\n  if (passes.pick) {\n    const pickCommand = this._pickCommand;\n\n    if (!defined(this._pickId) || this._id !== this.id) {\n      this._id = this.id;\n      this._pickId = this._pickId && this._pickId.destroy();\n      this._pickId = context.createPickId({\n        primitive: this,\n        id: this.id,\n      });\n    }\n\n    // Recompile shader when material changes\n    if (\n      materialChanged ||\n      lightingChanged ||\n      !defined(this._pickSP) ||\n      useLogDepthChanged\n    ) {\n      vs = new ShaderSource({\n        sources: [EllipsoidVS],\n      });\n      fs = new ShaderSource({\n        sources: [this.material.shaderSource, EllipsoidFS],\n        pickColorQualifier: \"uniform\",\n      });\n      if (this.onlySunLighting) {\n        fs.defines.push(\"ONLY_SUN_LIGHTING\");\n      }\n      if (!translucent && context.fragmentDepth) {\n        fs.defines.push(\"WRITE_DEPTH\");\n      }\n      if (this._useLogDepth) {\n        vs.defines.push(\"LOG_DEPTH\");\n        fs.defines.push(\"LOG_DEPTH\");\n      }\n\n      this._pickSP = ShaderProgram.replaceCache({\n        context: context,\n        shaderProgram: this._pickSP,\n        vertexShaderSource: vs,\n        fragmentShaderSource: fs,\n        attributeLocations: attributeLocations,\n      });\n\n      pickCommand.vertexArray = this._va;\n      pickCommand.renderState = this._rs;\n      pickCommand.shaderProgram = this._pickSP;\n      pickCommand.uniformMap = combine(\n        combine(this._uniforms, this._pickUniforms),\n        this.material._uniforms\n      );\n      pickCommand.executeInClosestFrustum = translucent;\n    }\n\n    pickCommand.boundingVolume = this._boundingSphere;\n    pickCommand.modelMatrix = this._computedModelMatrix;\n    pickCommand.pass = translucent ? Pass.TRANSLUCENT : Pass.OPAQUE;\n\n    commandList.push(pickCommand);\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see EllipsoidPrimitive#destroy\n */\nEllipsoidPrimitive.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * e = e && e.destroy();\n *\n * @see EllipsoidPrimitive#isDestroyed\n */\nEllipsoidPrimitive.prototype.destroy = function () {\n  this._sp = this._sp && this._sp.destroy();\n  this._pickSP = this._pickSP && this._pickSP.destroy();\n  this._pickId = this._pickId && this._pickId.destroy();\n  return destroyObject(this);\n};\nexport default EllipsoidPrimitive;\n", "import buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport IauOrientationAxes from \"../Core/IauOrientationAxes.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Simon1994PlanetaryPositions from \"../Core/Simon1994PlanetaryPositions.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport EllipsoidPrimitive from \"./EllipsoidPrimitive.js\";\nimport Material from \"./Material.js\";\n\n/**\n * Draws the Moon in 3D.\n * @alias Moon\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {boolean} [options.show=true] Determines whether the moon will be rendered.\n * @param {string} [options.textureUrl=buildModuleUrl('Assets/Textures/moonSmall.jpg')] The moon texture.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.MOON] The moon ellipsoid.\n * @param {boolean} [options.onlySunLighting=true] Use the sun as the only light source.\n *\n *\n * @example\n * scene.moon = new Cesium.Moon();\n *\n * @see Scene#moon\n */\nfunction Moon(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  let url = options.textureUrl;\n  if (!defined(url)) {\n    url = buildModuleUrl(\"Assets/Textures/moonSmall.jpg\");\n  }\n\n  /**\n   * Determines if the moon will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  /**\n   * The moon texture.\n   * @type {string}\n   * @default buildModuleUrl('Assets/Textures/moonSmall.jpg')\n   */\n  this.textureUrl = url;\n\n  this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.MOON);\n\n  /**\n   * Use the sun as the only light source.\n   * @type {boolean}\n   * @default true\n   */\n  this.onlySunLighting = defaultValue(options.onlySunLighting, true);\n\n  this._ellipsoidPrimitive = new EllipsoidPrimitive({\n    radii: this.ellipsoid.radii,\n    material: Material.fromType(Material.ImageType),\n    depthTestEnabled: false,\n    _owner: this,\n  });\n  this._ellipsoidPrimitive.material.translucent = false;\n\n  this._axes = new IauOrientationAxes();\n}\n\nObject.defineProperties(Moon.prototype, {\n  /**\n   * Get the ellipsoid that defines the shape of the moon.\n   *\n   * @memberof Moon.prototype\n   *\n   * @type {Ellipsoid}\n   * @readonly\n   *\n   * @default {@link Ellipsoid.MOON}\n   */\n  ellipsoid: {\n    get: function () {\n      return this._ellipsoid;\n    },\n  },\n});\n\nconst icrfToFixed = new Matrix3();\nconst rotationScratch = new Matrix3();\nconst translationScratch = new Cartesian3();\nconst scratchCommandList = [];\n\n/**\n * @private\n */\nMoon.prototype.update = function (frameState) {\n  if (!this.show) {\n    return;\n  }\n\n  const ellipsoidPrimitive = this._ellipsoidPrimitive;\n  ellipsoidPrimitive.material.uniforms.image = this.textureUrl;\n  ellipsoidPrimitive.onlySunLighting = this.onlySunLighting;\n\n  const date = frameState.time;\n  if (!defined(Transforms.computeIcrfToFixedMatrix(date, icrfToFixed))) {\n    Transforms.computeTemeToPseudoFixedMatrix(date, icrfToFixed);\n  }\n\n  const rotation = this._axes.evaluate(date, rotationScratch);\n  Matrix3.transpose(rotation, rotation);\n  Matrix3.multiply(icrfToFixed, rotation, rotation);\n\n  const translation = Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame(\n    date,\n    translationScratch\n  );\n  Matrix3.multiplyByVector(icrfToFixed, translation, translation);\n\n  Matrix4.fromRotationTranslation(\n    rotation,\n    translation,\n    ellipsoidPrimitive.modelMatrix\n  );\n\n  const savedCommandList = frameState.commandList;\n  frameState.commandList = scratchCommandList;\n  scratchCommandList.length = 0;\n  ellipsoidPrimitive.update(frameState);\n  frameState.commandList = savedCommandList;\n  return scratchCommandList.length === 1 ? scratchCommandList[0] : undefined;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see Moon#destroy\n */\nMoon.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * moon = moon && moon.destroy();\n *\n * @see Moon#isDestroyed\n */\nMoon.prototype.destroy = function () {\n  this._ellipsoidPrimitive =\n    this._ellipsoidPrimitive && this._ellipsoidPrimitive.destroy();\n  return destroyObject(this);\n};\nexport default Moon;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\nconst leftScratchArray = [];\nconst rightScratchArray = [];\n\nfunction merge(array, compare, userDefinedObject, start, middle, end) {\n  const leftLength = middle - start + 1;\n  const rightLength = end - middle;\n\n  const left = leftScratchArray;\n  const right = rightScratchArray;\n\n  let i;\n  let j;\n\n  for (i = 0; i < leftLength; ++i) {\n    left[i] = array[start + i];\n  }\n\n  for (j = 0; j < rightLength; ++j) {\n    right[j] = array[middle + j + 1];\n  }\n\n  i = 0;\n  j = 0;\n  for (let k = start; k <= end; ++k) {\n    const leftElement = left[i];\n    const rightElement = right[j];\n    if (\n      i < leftLength &&\n      (j >= rightLength ||\n        compare(leftElement, rightElement, userDefinedObject) <= 0)\n    ) {\n      array[k] = leftElement;\n      ++i;\n    } else if (j < rightLength) {\n      array[k] = rightElement;\n      ++j;\n    }\n  }\n}\n\nfunction sort(array, compare, userDefinedObject, start, end) {\n  if (start >= end) {\n    return;\n  }\n\n  const middle = Math.floor((start + end) * 0.5);\n  sort(array, compare, userDefinedObject, start, middle);\n  sort(array, compare, userDefinedObject, middle + 1, end);\n  merge(array, compare, userDefinedObject, start, middle, end);\n}\n\n/**\n * A stable merge sort.\n *\n * @function mergeSort\n * @param {Array} array The array to sort.\n * @param {mergeSortComparator} comparator The function to use to compare elements in the array.\n * @param {*} [userDefinedObject] Any item to pass as the third parameter to <code>comparator</code>.\n *\n * @example\n * // Assume array contains BoundingSpheres in world coordinates.\n * // Sort them in ascending order of distance from the camera.\n * const position = camera.positionWC;\n * Cesium.mergeSort(array, function(a, b, position) {\n *     return Cesium.BoundingSphere.distanceSquaredTo(b, position) - Cesium.BoundingSphere.distanceSquaredTo(a, position);\n * }, position);\n */\nfunction mergeSort(array, comparator, userDefinedObject) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required.\");\n  }\n  if (!defined(comparator)) {\n    throw new DeveloperError(\"comparator is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const length = array.length;\n  const scratchLength = Math.ceil(length * 0.5);\n\n  // preallocate space in scratch arrays\n  leftScratchArray.length = scratchLength;\n  rightScratchArray.length = scratchLength;\n\n  sort(array, comparator, userDefinedObject, 0, length - 1);\n\n  // trim scratch arrays\n  leftScratchArray.length = 0;\n  rightScratchArray.length = 0;\n}\n\n/**\n * A function used to compare two items while performing a merge sort.\n * @callback mergeSortComparator\n *\n * @param {*} a An item in the array.\n * @param {*} b An item in the array.\n * @param {*} [userDefinedObject] An object that was passed to {@link mergeSort}.\n * @returns {number} Returns a negative value if <code>a</code> is less than <code>b</code>,\n *          a positive value if <code>a</code> is greater than <code>b</code>, or\n *          0 if <code>a</code> is equal to <code>b</code>.\n *\n * @example\n * function compareNumbers(a, b, userDefinedObject) {\n *     return a - b;\n * }\n */\nexport default mergeSort;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport CesiumMath from \"./Math.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Visibility from \"./Visibility.js\";\n\n/**\n * Creates an Occluder derived from an object's position and radius, as well as the camera position.\n * The occluder can be used to determine whether or not other objects are visible or hidden behind the\n * visible horizon defined by the occluder and camera position.\n *\n * @alias Occluder\n *\n * @param {BoundingSphere} occluderBoundingSphere The bounding sphere surrounding the occluder.\n * @param {Cartesian3} cameraPosition The coordinate of the viewer/camera.\n *\n * @constructor\n *\n * @example\n * // Construct an occluder one unit away from the origin with a radius of one.\n * const cameraPosition = Cesium.Cartesian3.ZERO;\n * const occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 1);\n * const occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);\n */\nfunction Occluder(occluderBoundingSphere, cameraPosition) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(occluderBoundingSphere)) {\n    throw new DeveloperError(\"occluderBoundingSphere is required.\");\n  }\n  if (!defined(cameraPosition)) {\n    throw new DeveloperError(\"camera position is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._occluderPosition = Cartesian3.clone(occluderBoundingSphere.center);\n  this._occluderRadius = occluderBoundingSphere.radius;\n\n  this._horizonDistance = 0.0;\n  this._horizonPlaneNormal = undefined;\n  this._horizonPlanePosition = undefined;\n  this._cameraPosition = undefined;\n\n  // cameraPosition fills in the above values\n  this.cameraPosition = cameraPosition;\n}\n\nconst scratchCartesian3 = new Cartesian3();\n\nObject.defineProperties(Occluder.prototype, {\n  /**\n   * The position of the occluder.\n   * @memberof Occluder.prototype\n   * @type {Cartesian3}\n   */\n  position: {\n    get: function () {\n      return this._occluderPosition;\n    },\n  },\n\n  /**\n   * The radius of the occluder.\n   * @memberof Occluder.prototype\n   * @type {number}\n   */\n  radius: {\n    get: function () {\n      return this._occluderRadius;\n    },\n  },\n\n  /**\n   * The position of the camera.\n   * @memberof Occluder.prototype\n   * @type {Cartesian3}\n   */\n  cameraPosition: {\n    set: function (cameraPosition) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(cameraPosition)) {\n        throw new DeveloperError(\"cameraPosition is required.\");\n      }\n      //>>includeEnd('debug');\n\n      cameraPosition = Cartesian3.clone(cameraPosition, this._cameraPosition);\n\n      const cameraToOccluderVec = Cartesian3.subtract(\n        this._occluderPosition,\n        cameraPosition,\n        scratchCartesian3\n      );\n      let invCameraToOccluderDistance = Cartesian3.magnitudeSquared(\n        cameraToOccluderVec\n      );\n      const occluderRadiusSqrd = this._occluderRadius * this._occluderRadius;\n\n      let horizonDistance;\n      let horizonPlaneNormal;\n      let horizonPlanePosition;\n      if (invCameraToOccluderDistance > occluderRadiusSqrd) {\n        horizonDistance = Math.sqrt(\n          invCameraToOccluderDistance - occluderRadiusSqrd\n        );\n        invCameraToOccluderDistance =\n          1.0 / Math.sqrt(invCameraToOccluderDistance);\n        horizonPlaneNormal = Cartesian3.multiplyByScalar(\n          cameraToOccluderVec,\n          invCameraToOccluderDistance,\n          scratchCartesian3\n        );\n        const nearPlaneDistance =\n          horizonDistance * horizonDistance * invCameraToOccluderDistance;\n        horizonPlanePosition = Cartesian3.add(\n          cameraPosition,\n          Cartesian3.multiplyByScalar(\n            horizonPlaneNormal,\n            nearPlaneDistance,\n            scratchCartesian3\n          ),\n          scratchCartesian3\n        );\n      } else {\n        horizonDistance = Number.MAX_VALUE;\n      }\n\n      this._horizonDistance = horizonDistance;\n      this._horizonPlaneNormal = horizonPlaneNormal;\n      this._horizonPlanePosition = horizonPlanePosition;\n      this._cameraPosition = cameraPosition;\n    },\n  },\n});\n\n/**\n * Creates an occluder from a bounding sphere and the camera position.\n *\n * @param {BoundingSphere} occluderBoundingSphere The bounding sphere surrounding the occluder.\n * @param {Cartesian3} cameraPosition The coordinate of the viewer/camera.\n * @param {Occluder} [result] The object onto which to store the result.\n * @returns {Occluder} The occluder derived from an object's position and radius, as well as the camera position.\n */\nOccluder.fromBoundingSphere = function (\n  occluderBoundingSphere,\n  cameraPosition,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(occluderBoundingSphere)) {\n    throw new DeveloperError(\"occluderBoundingSphere is required.\");\n  }\n\n  if (!defined(cameraPosition)) {\n    throw new DeveloperError(\"camera position is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    return new Occluder(occluderBoundingSphere, cameraPosition);\n  }\n\n  Cartesian3.clone(occluderBoundingSphere.center, result._occluderPosition);\n  result._occluderRadius = occluderBoundingSphere.radius;\n  result.cameraPosition = cameraPosition;\n\n  return result;\n};\n\nconst tempVecScratch = new Cartesian3();\n\n/**\n * Determines whether or not a point, the <code>occludee</code>, is hidden from view by the occluder.\n *\n * @param {Cartesian3} occludee The point surrounding the occludee object.\n * @returns {boolean} <code>true</code> if the occludee is visible; otherwise <code>false</code>.\n *\n *\n * @example\n * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);\n * const littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);\n * const occluder = new Cesium.Occluder(littleSphere, cameraPosition);\n * const point = new Cesium.Cartesian3(0, 0, -3);\n * occluder.isPointVisible(point); //returns true\n *\n * @see Occluder#computeVisibility\n */\nOccluder.prototype.isPointVisible = function (occludee) {\n  if (this._horizonDistance !== Number.MAX_VALUE) {\n    let tempVec = Cartesian3.subtract(\n      occludee,\n      this._occluderPosition,\n      tempVecScratch\n    );\n    let temp = this._occluderRadius;\n    temp = Cartesian3.magnitudeSquared(tempVec) - temp * temp;\n    if (temp > 0.0) {\n      temp = Math.sqrt(temp) + this._horizonDistance;\n      tempVec = Cartesian3.subtract(occludee, this._cameraPosition, tempVec);\n      return temp * temp > Cartesian3.magnitudeSquared(tempVec);\n    }\n  }\n  return false;\n};\n\nconst occludeePositionScratch = new Cartesian3();\n\n/**\n * Determines whether or not a sphere, the <code>occludee</code>, is hidden from view by the occluder.\n *\n * @param {BoundingSphere} occludee The bounding sphere surrounding the occludee object.\n * @returns {boolean} <code>true</code> if the occludee is visible; otherwise <code>false</code>.\n *\n *\n * @example\n * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);\n * const littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);\n * const occluder = new Cesium.Occluder(littleSphere, cameraPosition);\n * const bigSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -3), 1);\n * occluder.isBoundingSphereVisible(bigSphere); //returns true\n *\n * @see Occluder#computeVisibility\n */\nOccluder.prototype.isBoundingSphereVisible = function (occludee) {\n  const occludeePosition = Cartesian3.clone(\n    occludee.center,\n    occludeePositionScratch\n  );\n  const occludeeRadius = occludee.radius;\n\n  if (this._horizonDistance !== Number.MAX_VALUE) {\n    let tempVec = Cartesian3.subtract(\n      occludeePosition,\n      this._occluderPosition,\n      tempVecScratch\n    );\n    let temp = this._occluderRadius - occludeeRadius;\n    temp = Cartesian3.magnitudeSquared(tempVec) - temp * temp;\n    if (occludeeRadius < this._occluderRadius) {\n      if (temp > 0.0) {\n        temp = Math.sqrt(temp) + this._horizonDistance;\n        tempVec = Cartesian3.subtract(\n          occludeePosition,\n          this._cameraPosition,\n          tempVec\n        );\n        return (\n          temp * temp + occludeeRadius * occludeeRadius >\n          Cartesian3.magnitudeSquared(tempVec)\n        );\n      }\n      return false;\n    }\n\n    // Prevent against the case where the occludee radius is larger than the occluder's; since this is\n    // an uncommon case, the following code should rarely execute.\n    if (temp > 0.0) {\n      tempVec = Cartesian3.subtract(\n        occludeePosition,\n        this._cameraPosition,\n        tempVec\n      );\n      const tempVecMagnitudeSquared = Cartesian3.magnitudeSquared(tempVec);\n      const occluderRadiusSquared = this._occluderRadius * this._occluderRadius;\n      const occludeeRadiusSquared = occludeeRadius * occludeeRadius;\n      if (\n        (this._horizonDistance * this._horizonDistance +\n          occluderRadiusSquared) *\n          occludeeRadiusSquared >\n        tempVecMagnitudeSquared * occluderRadiusSquared\n      ) {\n        // The occludee is close enough that the occluder cannot possible occlude the occludee\n        return true;\n      }\n      temp = Math.sqrt(temp) + this._horizonDistance;\n      return temp * temp + occludeeRadiusSquared > tempVecMagnitudeSquared;\n    }\n\n    // The occludee completely encompasses the occluder\n    return true;\n  }\n\n  return false;\n};\n\nconst tempScratch = new Cartesian3();\n/**\n * Determine to what extent an occludee is visible (not visible, partially visible,  or fully visible).\n *\n * @param {BoundingSphere} occludeeBS The bounding sphere of the occludee.\n * @returns {Visibility} Visibility.NONE if the occludee is not visible,\n *                       Visibility.PARTIAL if the occludee is partially visible, or\n *                       Visibility.FULL if the occludee is fully visible.\n *\n *\n * @example\n * const sphere1 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1.5), 0.5);\n * const sphere2 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -2.5), 0.5);\n * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);\n * const occluder = new Cesium.Occluder(sphere1, cameraPosition);\n * occluder.computeVisibility(sphere2); //returns Visibility.NONE\n *\n * @see Occluder#isVisible\n */\nOccluder.prototype.computeVisibility = function (occludeeBS) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(occludeeBS)) {\n    throw new DeveloperError(\"occludeeBS is required.\");\n  }\n  //>>includeEnd('debug');\n\n  // If the occludee radius is larger than the occluders, this will return that\n  // the entire ocludee is visible, even though that may not be the case, though this should\n  // not occur too often.\n  const occludeePosition = Cartesian3.clone(occludeeBS.center);\n  const occludeeRadius = occludeeBS.radius;\n\n  if (occludeeRadius > this._occluderRadius) {\n    return Visibility.FULL;\n  }\n\n  if (this._horizonDistance !== Number.MAX_VALUE) {\n    // The camera is outside the occluder\n    let tempVec = Cartesian3.subtract(\n      occludeePosition,\n      this._occluderPosition,\n      tempScratch\n    );\n    let temp = this._occluderRadius - occludeeRadius;\n    const occluderToOccludeeDistSqrd = Cartesian3.magnitudeSquared(tempVec);\n    temp = occluderToOccludeeDistSqrd - temp * temp;\n    if (temp > 0.0) {\n      // The occludee is not completely inside the occluder\n      // Check to see if the occluder completely hides the occludee\n      temp = Math.sqrt(temp) + this._horizonDistance;\n      tempVec = Cartesian3.subtract(\n        occludeePosition,\n        this._cameraPosition,\n        tempVec\n      );\n      const cameraToOccludeeDistSqrd = Cartesian3.magnitudeSquared(tempVec);\n      if (\n        temp * temp + occludeeRadius * occludeeRadius <\n        cameraToOccludeeDistSqrd\n      ) {\n        return Visibility.NONE;\n      }\n\n      // Check to see whether the occluder is fully or partially visible\n      // when the occludee does not intersect the occluder\n      temp = this._occluderRadius + occludeeRadius;\n      temp = occluderToOccludeeDistSqrd - temp * temp;\n      if (temp > 0.0) {\n        // The occludee does not intersect the occluder.\n        temp = Math.sqrt(temp) + this._horizonDistance;\n        return cameraToOccludeeDistSqrd <\n          temp * temp + occludeeRadius * occludeeRadius\n          ? Visibility.FULL\n          : Visibility.PARTIAL;\n      }\n\n      //Check to see if the occluder is fully or partially visible when the occludee DOES\n      //intersect the occluder\n      tempVec = Cartesian3.subtract(\n        occludeePosition,\n        this._horizonPlanePosition,\n        tempVec\n      );\n      return Cartesian3.dot(tempVec, this._horizonPlaneNormal) > -occludeeRadius\n        ? Visibility.PARTIAL\n        : Visibility.FULL;\n    }\n  }\n  return Visibility.NONE;\n};\n\nconst occludeePointScratch = new Cartesian3();\n/**\n * Computes a point that can be used as the occludee position to the visibility functions.\n * Use a radius of zero for the occludee radius.  Typically, a user computes a bounding sphere around\n * an object that is used for visibility; however it is also possible to compute a point that if\n * seen/not seen would also indicate if an object is visible/not visible.  This function is better\n * called for objects that do not move relative to the occluder and is large, such as a chunk of\n * terrain.  You are better off not calling this and using the object's bounding sphere for objects\n * such as a satellite or ground vehicle.\n *\n * @param {BoundingSphere} occluderBoundingSphere The bounding sphere surrounding the occluder.\n * @param {Cartesian3} occludeePosition The point where the occludee (bounding sphere of radius 0) is located.\n * @param {Cartesian3[]} positions List of altitude points on the horizon near the surface of the occluder.\n * @returns {object} An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>\n * which is a boolean value.\n *\n * @exception {DeveloperError} <code>positions</code> must contain at least one element.\n * @exception {DeveloperError} <code>occludeePosition</code> must have a value other than <code>occluderBoundingSphere.center</code>.\n *\n * @example\n * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);\n * const occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -8), 2);\n * const occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);\n * const positions = [new Cesium.Cartesian3(-0.25, 0, -5.3), new Cesium.Cartesian3(0.25, 0, -5.3)];\n * const tileOccluderSphere = Cesium.BoundingSphere.fromPoints(positions);\n * const occludeePosition = tileOccluderSphere.center;\n * const occludeePt = Cesium.Occluder.computeOccludeePoint(occluderBoundingSphere, occludeePosition, positions);\n */\nOccluder.computeOccludeePoint = function (\n  occluderBoundingSphere,\n  occludeePosition,\n  positions\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(occluderBoundingSphere)) {\n    throw new DeveloperError(\"occluderBoundingSphere is required.\");\n  }\n  if (!defined(positions)) {\n    throw new DeveloperError(\"positions is required.\");\n  }\n  if (positions.length === 0) {\n    throw new DeveloperError(\"positions must contain at least one element\");\n  }\n  //>>includeEnd('debug');\n\n  const occludeePos = Cartesian3.clone(occludeePosition);\n  const occluderPosition = Cartesian3.clone(occluderBoundingSphere.center);\n  const occluderRadius = occluderBoundingSphere.radius;\n  const numPositions = positions.length;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (Cartesian3.equals(occluderPosition, occludeePosition)) {\n    throw new DeveloperError(\n      \"occludeePosition must be different than occluderBoundingSphere.center\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  // Compute a plane with a normal from the occluder to the occludee position.\n  const occluderPlaneNormal = Cartesian3.normalize(\n    Cartesian3.subtract(occludeePos, occluderPosition, occludeePointScratch),\n    occludeePointScratch\n  );\n  const occluderPlaneD = -Cartesian3.dot(occluderPlaneNormal, occluderPosition);\n\n  //For each position, determine the horizon intersection. Choose the position and intersection\n  //that results in the greatest angle with the occcluder plane.\n  const aRotationVector = Occluder._anyRotationVector(\n    occluderPosition,\n    occluderPlaneNormal,\n    occluderPlaneD\n  );\n  let dot = Occluder._horizonToPlaneNormalDotProduct(\n    occluderBoundingSphere,\n    occluderPlaneNormal,\n    occluderPlaneD,\n    aRotationVector,\n    positions[0]\n  );\n  if (!dot) {\n    //The position is inside the mimimum radius, which is invalid\n    return undefined;\n  }\n  let tempDot;\n  for (let i = 1; i < numPositions; ++i) {\n    tempDot = Occluder._horizonToPlaneNormalDotProduct(\n      occluderBoundingSphere,\n      occluderPlaneNormal,\n      occluderPlaneD,\n      aRotationVector,\n      positions[i]\n    );\n    if (!tempDot) {\n      //The position is inside the minimum radius, which is invalid\n      return undefined;\n    }\n    if (tempDot < dot) {\n      dot = tempDot;\n    }\n  }\n  //Verify that the dot is not near 90 degress\n  // eslint-disable-next-line no-loss-of-precision\n  if (dot < 0.00174532836589830883577820272085) {\n    return undefined;\n  }\n\n  const distance = occluderRadius / dot;\n  return Cartesian3.add(\n    occluderPosition,\n    Cartesian3.multiplyByScalar(\n      occluderPlaneNormal,\n      distance,\n      occludeePointScratch\n    ),\n    occludeePointScratch\n  );\n};\n\nconst computeOccludeePointFromRectangleScratch = [];\n/**\n * Computes a point that can be used as the occludee position to the visibility functions from a rectangle.\n *\n * @param {Rectangle} rectangle The rectangle used to create a bounding sphere.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid used to determine positions of the rectangle.\n * @returns {object} An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>\n * which is a boolean value.\n */\nOccluder.computeOccludeePointFromRectangle = function (rectangle, ellipsoid) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(rectangle)) {\n    throw new DeveloperError(\"rectangle is required.\");\n  }\n  //>>includeEnd('debug');\n\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n  const positions = Rectangle.subsample(\n    rectangle,\n    ellipsoid,\n    0.0,\n    computeOccludeePointFromRectangleScratch\n  );\n  const bs = BoundingSphere.fromPoints(positions);\n\n  // TODO: get correct ellipsoid center\n  const ellipsoidCenter = Cartesian3.ZERO;\n  if (!Cartesian3.equals(ellipsoidCenter, bs.center)) {\n    return Occluder.computeOccludeePoint(\n      new BoundingSphere(ellipsoidCenter, ellipsoid.minimumRadius),\n      bs.center,\n      positions\n    );\n  }\n\n  return undefined;\n};\n\nconst tempVec0Scratch = new Cartesian3();\nOccluder._anyRotationVector = function (\n  occluderPosition,\n  occluderPlaneNormal,\n  occluderPlaneD\n) {\n  const tempVec0 = Cartesian3.abs(occluderPlaneNormal, tempVec0Scratch);\n  let majorAxis = tempVec0.x > tempVec0.y ? 0 : 1;\n  if (\n    (majorAxis === 0 && tempVec0.z > tempVec0.x) ||\n    (majorAxis === 1 && tempVec0.z > tempVec0.y)\n  ) {\n    majorAxis = 2;\n  }\n  const tempVec = new Cartesian3();\n  let tempVec1;\n  if (majorAxis === 0) {\n    tempVec0.x = occluderPosition.x;\n    tempVec0.y = occluderPosition.y + 1.0;\n    tempVec0.z = occluderPosition.z + 1.0;\n    tempVec1 = Cartesian3.UNIT_X;\n  } else if (majorAxis === 1) {\n    tempVec0.x = occluderPosition.x + 1.0;\n    tempVec0.y = occluderPosition.y;\n    tempVec0.z = occluderPosition.z + 1.0;\n    tempVec1 = Cartesian3.UNIT_Y;\n  } else {\n    tempVec0.x = occluderPosition.x + 1.0;\n    tempVec0.y = occluderPosition.y + 1.0;\n    tempVec0.z = occluderPosition.z;\n    tempVec1 = Cartesian3.UNIT_Z;\n  }\n  const u =\n    (Cartesian3.dot(occluderPlaneNormal, tempVec0) + occluderPlaneD) /\n    -Cartesian3.dot(occluderPlaneNormal, tempVec1);\n  return Cartesian3.normalize(\n    Cartesian3.subtract(\n      Cartesian3.add(\n        tempVec0,\n        Cartesian3.multiplyByScalar(tempVec1, u, tempVec),\n        tempVec0\n      ),\n      occluderPosition,\n      tempVec0\n    ),\n    tempVec0\n  );\n};\n\nconst posDirectionScratch = new Cartesian3();\nOccluder._rotationVector = function (\n  occluderPosition,\n  occluderPlaneNormal,\n  occluderPlaneD,\n  position,\n  anyRotationVector\n) {\n  //Determine the angle between the occluder plane normal and the position direction\n  let positionDirection = Cartesian3.subtract(\n    position,\n    occluderPosition,\n    posDirectionScratch\n  );\n  positionDirection = Cartesian3.normalize(\n    positionDirection,\n    positionDirection\n  );\n  if (\n    Cartesian3.dot(occluderPlaneNormal, positionDirection) <\n    // eslint-disable-next-line no-loss-of-precision\n    0.99999998476912904932780850903444\n  ) {\n    const crossProduct = Cartesian3.cross(\n      occluderPlaneNormal,\n      positionDirection,\n      positionDirection\n    );\n    const length = Cartesian3.magnitude(crossProduct);\n    if (length > CesiumMath.EPSILON13) {\n      return Cartesian3.normalize(crossProduct, new Cartesian3());\n    }\n  }\n  //The occluder plane normal and the position direction are colinear. Use any\n  //vector in the occluder plane as the rotation vector\n  return anyRotationVector;\n};\n\nconst posScratch1 = new Cartesian3();\nconst occluerPosScratch = new Cartesian3();\nconst posScratch2 = new Cartesian3();\nconst horizonPlanePosScratch = new Cartesian3();\nOccluder._horizonToPlaneNormalDotProduct = function (\n  occluderBS,\n  occluderPlaneNormal,\n  occluderPlaneD,\n  anyRotationVector,\n  position\n) {\n  const pos = Cartesian3.clone(position, posScratch1);\n  const occluderPosition = Cartesian3.clone(\n    occluderBS.center,\n    occluerPosScratch\n  );\n  const occluderRadius = occluderBS.radius;\n\n  //Verify that the position is outside the occluder\n  let positionToOccluder = Cartesian3.subtract(\n    occluderPosition,\n    pos,\n    posScratch2\n  );\n  const occluderToPositionDistanceSquared = Cartesian3.magnitudeSquared(\n    positionToOccluder\n  );\n  const occluderRadiusSquared = occluderRadius * occluderRadius;\n  if (occluderToPositionDistanceSquared < occluderRadiusSquared) {\n    return false;\n  }\n\n  //Horizon parameters\n  const horizonDistanceSquared =\n    occluderToPositionDistanceSquared - occluderRadiusSquared;\n  const horizonDistance = Math.sqrt(horizonDistanceSquared);\n  const occluderToPositionDistance = Math.sqrt(\n    occluderToPositionDistanceSquared\n  );\n  const invOccluderToPositionDistance = 1.0 / occluderToPositionDistance;\n  const cosTheta = horizonDistance * invOccluderToPositionDistance;\n  const horizonPlaneDistance = cosTheta * horizonDistance;\n  positionToOccluder = Cartesian3.normalize(\n    positionToOccluder,\n    positionToOccluder\n  );\n  const horizonPlanePosition = Cartesian3.add(\n    pos,\n    Cartesian3.multiplyByScalar(\n      positionToOccluder,\n      horizonPlaneDistance,\n      horizonPlanePosScratch\n    ),\n    horizonPlanePosScratch\n  );\n  const horizonCrossDistance = Math.sqrt(\n    horizonDistanceSquared - horizonPlaneDistance * horizonPlaneDistance\n  );\n\n  //Rotate the position to occluder vector 90 degrees\n  let tempVec = this._rotationVector(\n    occluderPosition,\n    occluderPlaneNormal,\n    occluderPlaneD,\n    pos,\n    anyRotationVector\n  );\n  let horizonCrossDirection = Cartesian3.fromElements(\n    tempVec.x * tempVec.x * positionToOccluder.x +\n      (tempVec.x * tempVec.y - tempVec.z) * positionToOccluder.y +\n      (tempVec.x * tempVec.z + tempVec.y) * positionToOccluder.z,\n    (tempVec.x * tempVec.y + tempVec.z) * positionToOccluder.x +\n      tempVec.y * tempVec.y * positionToOccluder.y +\n      (tempVec.y * tempVec.z - tempVec.x) * positionToOccluder.z,\n    (tempVec.x * tempVec.z - tempVec.y) * positionToOccluder.x +\n      (tempVec.y * tempVec.z + tempVec.x) * positionToOccluder.y +\n      tempVec.z * tempVec.z * positionToOccluder.z,\n    posScratch1\n  );\n  horizonCrossDirection = Cartesian3.normalize(\n    horizonCrossDirection,\n    horizonCrossDirection\n  );\n\n  //Horizon positions\n  const offset = Cartesian3.multiplyByScalar(\n    horizonCrossDirection,\n    horizonCrossDistance,\n    posScratch1\n  );\n  tempVec = Cartesian3.normalize(\n    Cartesian3.subtract(\n      Cartesian3.add(horizonPlanePosition, offset, posScratch2),\n      occluderPosition,\n      posScratch2\n    ),\n    posScratch2\n  );\n  const dot0 = Cartesian3.dot(occluderPlaneNormal, tempVec);\n  tempVec = Cartesian3.normalize(\n    Cartesian3.subtract(\n      Cartesian3.subtract(horizonPlanePosition, offset, tempVec),\n      occluderPosition,\n      tempVec\n    ),\n    tempVec\n  );\n  const dot1 = Cartesian3.dot(occluderPlaneNormal, tempVec);\n  return dot0 < dot1 ? dot0 : dot1;\n};\nexport default Occluder;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport CullingVolume from \"./CullingVolume.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix4 from \"./Matrix4.js\";\n\n/**\n * The viewing frustum is defined by 6 planes.\n * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components\n * define the unit vector normal to the plane, and the w component is the distance of the\n * plane from the origin/camera position.\n *\n * @alias PerspectiveOffCenterFrustum\n * @constructor\n *\n * @param {object} [options] An object with the following properties:\n * @param {number} [options.left] The left clipping plane distance.\n * @param {number} [options.right] The right clipping plane distance.\n * @param {number} [options.top] The top clipping plane distance.\n * @param {number} [options.bottom] The bottom clipping plane distance.\n * @param {number} [options.near=1.0] The near clipping plane distance.\n * @param {number} [options.far=500000000.0] The far clipping plane distance.\n *\n * @example\n * const frustum = new Cesium.PerspectiveOffCenterFrustum({\n *     left : -1.0,\n *     right : 1.0,\n *     top : 1.0,\n *     bottom : -1.0,\n *     near : 1.0,\n *     far : 100.0\n * });\n *\n * @see PerspectiveFrustum\n */\nfunction PerspectiveOffCenterFrustum(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * Defines the left clipping plane.\n   * @type {number}\n   * @default undefined\n   */\n  this.left = options.left;\n  this._left = undefined;\n\n  /**\n   * Defines the right clipping plane.\n   * @type {number}\n   * @default undefined\n   */\n  this.right = options.right;\n  this._right = undefined;\n\n  /**\n   * Defines the top clipping plane.\n   * @type {number}\n   * @default undefined\n   */\n  this.top = options.top;\n  this._top = undefined;\n\n  /**\n   * Defines the bottom clipping plane.\n   * @type {number}\n   * @default undefined\n   */\n  this.bottom = options.bottom;\n  this._bottom = undefined;\n\n  /**\n   * The distance of the near plane.\n   * @type {number}\n   * @default 1.0\n   */\n  this.near = defaultValue(options.near, 1.0);\n  this._near = this.near;\n\n  /**\n   * The distance of the far plane.\n   * @type {number}\n   * @default 500000000.0\n   */\n  this.far = defaultValue(options.far, 500000000.0);\n  this._far = this.far;\n\n  this._cullingVolume = new CullingVolume();\n  this._perspectiveMatrix = new Matrix4();\n  this._infinitePerspective = new Matrix4();\n}\n\nfunction update(frustum) {\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    !defined(frustum.right) ||\n    !defined(frustum.left) ||\n    !defined(frustum.top) ||\n    !defined(frustum.bottom) ||\n    !defined(frustum.near) ||\n    !defined(frustum.far)\n  ) {\n    throw new DeveloperError(\n      \"right, left, top, bottom, near, or far parameters are not set.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const t = frustum.top;\n  const b = frustum.bottom;\n  const r = frustum.right;\n  const l = frustum.left;\n  const n = frustum.near;\n  const f = frustum.far;\n\n  if (\n    t !== frustum._top ||\n    b !== frustum._bottom ||\n    l !== frustum._left ||\n    r !== frustum._right ||\n    n !== frustum._near ||\n    f !== frustum._far\n  ) {\n    //>>includeStart('debug', pragmas.debug);\n    if (frustum.near <= 0 || frustum.near > frustum.far) {\n      throw new DeveloperError(\n        \"near must be greater than zero and less than far.\"\n      );\n    }\n    //>>includeEnd('debug');\n\n    frustum._left = l;\n    frustum._right = r;\n    frustum._top = t;\n    frustum._bottom = b;\n    frustum._near = n;\n    frustum._far = f;\n    frustum._perspectiveMatrix = Matrix4.computePerspectiveOffCenter(\n      l,\n      r,\n      b,\n      t,\n      n,\n      f,\n      frustum._perspectiveMatrix\n    );\n    frustum._infinitePerspective = Matrix4.computeInfinitePerspectiveOffCenter(\n      l,\n      r,\n      b,\n      t,\n      n,\n      frustum._infinitePerspective\n    );\n  }\n}\n\nObject.defineProperties(PerspectiveOffCenterFrustum.prototype, {\n  /**\n   * Gets the perspective projection matrix computed from the view frustum.\n   * @memberof PerspectiveOffCenterFrustum.prototype\n   * @type {Matrix4}\n   * @readonly\n   *\n   * @see PerspectiveOffCenterFrustum#infiniteProjectionMatrix\n   */\n  projectionMatrix: {\n    get: function () {\n      update(this);\n      return this._perspectiveMatrix;\n    },\n  },\n\n  /**\n   * Gets the perspective projection matrix computed from the view frustum with an infinite far plane.\n   * @memberof PerspectiveOffCenterFrustum.prototype\n   * @type {Matrix4}\n   * @readonly\n   *\n   * @see PerspectiveOffCenterFrustum#projectionMatrix\n   */\n  infiniteProjectionMatrix: {\n    get: function () {\n      update(this);\n      return this._infinitePerspective;\n    },\n  },\n});\n\nconst getPlanesRight = new Cartesian3();\nconst getPlanesNearCenter = new Cartesian3();\nconst getPlanesFarCenter = new Cartesian3();\nconst getPlanesNormal = new Cartesian3();\n/**\n * Creates a culling volume for this frustum.\n *\n * @param {Cartesian3} position The eye position.\n * @param {Cartesian3} direction The view direction.\n * @param {Cartesian3} up The up direction.\n * @returns {CullingVolume} A culling volume at the given position and orientation.\n *\n * @example\n * // Check if a bounding volume intersects the frustum.\n * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);\n * const intersect = cullingVolume.computeVisibility(boundingVolume);\n */\nPerspectiveOffCenterFrustum.prototype.computeCullingVolume = function (\n  position,\n  direction,\n  up\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(position)) {\n    throw new DeveloperError(\"position is required.\");\n  }\n\n  if (!defined(direction)) {\n    throw new DeveloperError(\"direction is required.\");\n  }\n\n  if (!defined(up)) {\n    throw new DeveloperError(\"up is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const planes = this._cullingVolume.planes;\n\n  const t = this.top;\n  const b = this.bottom;\n  const r = this.right;\n  const l = this.left;\n  const n = this.near;\n  const f = this.far;\n\n  const right = Cartesian3.cross(direction, up, getPlanesRight);\n\n  const nearCenter = getPlanesNearCenter;\n  Cartesian3.multiplyByScalar(direction, n, nearCenter);\n  Cartesian3.add(position, nearCenter, nearCenter);\n\n  const farCenter = getPlanesFarCenter;\n  Cartesian3.multiplyByScalar(direction, f, farCenter);\n  Cartesian3.add(position, farCenter, farCenter);\n\n  const normal = getPlanesNormal;\n\n  //Left plane computation\n  Cartesian3.multiplyByScalar(right, l, normal);\n  Cartesian3.add(nearCenter, normal, normal);\n  Cartesian3.subtract(normal, position, normal);\n  Cartesian3.normalize(normal, normal);\n  Cartesian3.cross(normal, up, normal);\n  Cartesian3.normalize(normal, normal);\n\n  let plane = planes[0];\n  if (!defined(plane)) {\n    plane = planes[0] = new Cartesian4();\n  }\n  plane.x = normal.x;\n  plane.y = normal.y;\n  plane.z = normal.z;\n  plane.w = -Cartesian3.dot(normal, position);\n\n  //Right plane computation\n  Cartesian3.multiplyByScalar(right, r, normal);\n  Cartesian3.add(nearCenter, normal, normal);\n  Cartesian3.subtract(normal, position, normal);\n  Cartesian3.cross(up, normal, normal);\n  Cartesian3.normalize(normal, normal);\n\n  plane = planes[1];\n  if (!defined(plane)) {\n    plane = planes[1] = new Cartesian4();\n  }\n  plane.x = normal.x;\n  plane.y = normal.y;\n  plane.z = normal.z;\n  plane.w = -Cartesian3.dot(normal, position);\n\n  //Bottom plane computation\n  Cartesian3.multiplyByScalar(up, b, normal);\n  Cartesian3.add(nearCenter, normal, normal);\n  Cartesian3.subtract(normal, position, normal);\n  Cartesian3.cross(right, normal, normal);\n  Cartesian3.normalize(normal, normal);\n\n  plane = planes[2];\n  if (!defined(plane)) {\n    plane = planes[2] = new Cartesian4();\n  }\n  plane.x = normal.x;\n  plane.y = normal.y;\n  plane.z = normal.z;\n  plane.w = -Cartesian3.dot(normal, position);\n\n  //Top plane computation\n  Cartesian3.multiplyByScalar(up, t, normal);\n  Cartesian3.add(nearCenter, normal, normal);\n  Cartesian3.subtract(normal, position, normal);\n  Cartesian3.cross(normal, right, normal);\n  Cartesian3.normalize(normal, normal);\n\n  plane = planes[3];\n  if (!defined(plane)) {\n    plane = planes[3] = new Cartesian4();\n  }\n  plane.x = normal.x;\n  plane.y = normal.y;\n  plane.z = normal.z;\n  plane.w = -Cartesian3.dot(normal, position);\n\n  //Near plane computation\n  plane = planes[4];\n  if (!defined(plane)) {\n    plane = planes[4] = new Cartesian4();\n  }\n  plane.x = direction.x;\n  plane.y = direction.y;\n  plane.z = direction.z;\n  plane.w = -Cartesian3.dot(direction, nearCenter);\n\n  //Far plane computation\n  Cartesian3.negate(direction, normal);\n\n  plane = planes[5];\n  if (!defined(plane)) {\n    plane = planes[5] = new Cartesian4();\n  }\n  plane.x = normal.x;\n  plane.y = normal.y;\n  plane.z = normal.z;\n  plane.w = -Cartesian3.dot(normal, farCenter);\n\n  return this._cullingVolume;\n};\n\n/**\n * Returns the pixel's width and height in meters.\n *\n * @param {number} drawingBufferWidth The width of the drawing buffer.\n * @param {number} drawingBufferHeight The height of the drawing buffer.\n * @param {number} distance The distance to the near plane in meters.\n * @param {number} pixelRatio The scaling factor from pixel space to coordinate space.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.\n *\n * @exception {DeveloperError} drawingBufferWidth must be greater than zero.\n * @exception {DeveloperError} drawingBufferHeight must be greater than zero.\n * @exception {DeveloperError} pixelRatio must be greater than zero.\n *\n * @example\n * // Example 1\n * // Get the width and height of a pixel.\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());\n *\n * @example\n * // Example 2\n * // Get the width and height of a pixel if the near plane was set to 'distance'.\n * // For example, get the size of a pixel of an image on a billboard.\n * const position = camera.position;\n * const direction = camera.direction;\n * const toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3());      // vector from camera to a primitive\n * const toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector\n * const distance = Cesium.Cartesian3.magnitude(toCenterProj);\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());\n */\nPerspectiveOffCenterFrustum.prototype.getPixelDimensions = function (\n  drawingBufferWidth,\n  drawingBufferHeight,\n  distance,\n  pixelRatio,\n  result\n) {\n  update(this);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(drawingBufferWidth) || !defined(drawingBufferHeight)) {\n    throw new DeveloperError(\n      \"Both drawingBufferWidth and drawingBufferHeight are required.\"\n    );\n  }\n  if (drawingBufferWidth <= 0) {\n    throw new DeveloperError(\"drawingBufferWidth must be greater than zero.\");\n  }\n  if (drawingBufferHeight <= 0) {\n    throw new DeveloperError(\"drawingBufferHeight must be greater than zero.\");\n  }\n  if (!defined(distance)) {\n    throw new DeveloperError(\"distance is required.\");\n  }\n  if (!defined(pixelRatio)) {\n    throw new DeveloperError(\"pixelRatio is required\");\n  }\n  if (pixelRatio <= 0) {\n    throw new DeveloperError(\"pixelRatio must be greater than zero.\");\n  }\n  if (!defined(result)) {\n    throw new DeveloperError(\"A result object is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const inverseNear = 1.0 / this.near;\n  let tanTheta = this.top * inverseNear;\n  const pixelHeight =\n    (2.0 * pixelRatio * distance * tanTheta) / drawingBufferHeight;\n  tanTheta = this.right * inverseNear;\n  const pixelWidth =\n    (2.0 * pixelRatio * distance * tanTheta) / drawingBufferWidth;\n\n  result.x = pixelWidth;\n  result.y = pixelHeight;\n  return result;\n};\n\n/**\n * Returns a duplicate of a PerspectiveOffCenterFrustum instance.\n *\n * @param {PerspectiveOffCenterFrustum} [result] The object onto which to store the result.\n * @returns {PerspectiveOffCenterFrustum} The modified result parameter or a new PerspectiveFrustum instance if one was not provided.\n */\nPerspectiveOffCenterFrustum.prototype.clone = function (result) {\n  if (!defined(result)) {\n    result = new PerspectiveOffCenterFrustum();\n  }\n\n  result.right = this.right;\n  result.left = this.left;\n  result.top = this.top;\n  result.bottom = this.bottom;\n  result.near = this.near;\n  result.far = this.far;\n\n  // force update of clone to compute matrices\n  result._left = undefined;\n  result._right = undefined;\n  result._top = undefined;\n  result._bottom = undefined;\n  result._near = undefined;\n  result._far = undefined;\n\n  return result;\n};\n\n/**\n * Compares the provided PerspectiveOffCenterFrustum componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {PerspectiveOffCenterFrustum} [other] The right hand side PerspectiveOffCenterFrustum.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nPerspectiveOffCenterFrustum.prototype.equals = function (other) {\n  return (\n    defined(other) &&\n    other instanceof PerspectiveOffCenterFrustum &&\n    this.right === other.right &&\n    this.left === other.left &&\n    this.top === other.top &&\n    this.bottom === other.bottom &&\n    this.near === other.near &&\n    this.far === other.far\n  );\n};\n\n/**\n * Compares the provided PerspectiveOffCenterFrustum componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {PerspectiveOffCenterFrustum} other The right hand side PerspectiveOffCenterFrustum.\n * @param {number} relativeEpsilon The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.\n */\nPerspectiveOffCenterFrustum.prototype.equalsEpsilon = function (\n  other,\n  relativeEpsilon,\n  absoluteEpsilon\n) {\n  return (\n    other === this ||\n    (defined(other) &&\n      other instanceof PerspectiveOffCenterFrustum &&\n      CesiumMath.equalsEpsilon(\n        this.right,\n        other.right,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        this.left,\n        other.left,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        this.top,\n        other.top,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        this.bottom,\n        other.bottom,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        this.near,\n        other.near,\n        relativeEpsilon,\n        absoluteEpsilon\n      ) &&\n      CesiumMath.equalsEpsilon(\n        this.far,\n        other.far,\n        relativeEpsilon,\n        absoluteEpsilon\n      ))\n  );\n};\nexport default PerspectiveOffCenterFrustum;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport PerspectiveOffCenterFrustum from \"./PerspectiveOffCenterFrustum.js\";\n\n/**\n * The viewing frustum is defined by 6 planes.\n * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components\n * define the unit vector normal to the plane, and the w component is the distance of the\n * plane from the origin/camera position.\n *\n * @alias PerspectiveFrustum\n * @constructor\n *\n * @param {object} [options] An object with the following properties:\n * @param {number} [options.fov] The angle of the field of view (FOV), in radians.\n * @param {number} [options.aspectRatio] The aspect ratio of the frustum's width to it's height.\n * @param {number} [options.near=1.0] The distance of the near plane.\n * @param {number} [options.far=500000000.0] The distance of the far plane.\n * @param {number} [options.xOffset=0.0] The offset in the x direction.\n * @param {number} [options.yOffset=0.0] The offset in the y direction.\n *\n * @example\n * const frustum = new Cesium.PerspectiveFrustum({\n *     fov : Cesium.Math.PI_OVER_THREE,\n *     aspectRatio : canvas.clientWidth / canvas.clientHeight\n *     near : 1.0,\n *     far : 1000.0\n * });\n *\n * @see PerspectiveOffCenterFrustum\n */\nfunction PerspectiveFrustum(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._offCenterFrustum = new PerspectiveOffCenterFrustum();\n\n  /**\n   * The angle of the field of view (FOV), in radians.  This angle will be used\n   * as the horizontal FOV if the width is greater than the height, otherwise\n   * it will be the vertical FOV.\n   * @type {number}\n   * @default undefined\n   */\n  this.fov = options.fov;\n  this._fov = undefined;\n  this._fovy = undefined;\n\n  this._sseDenominator = undefined;\n\n  /**\n   * The aspect ratio of the frustum's width to it's height.\n   * @type {number}\n   * @default undefined\n   */\n  this.aspectRatio = options.aspectRatio;\n  this._aspectRatio = undefined;\n\n  /**\n   * The distance of the near plane.\n   * @type {number}\n   * @default 1.0\n   */\n  this.near = defaultValue(options.near, 1.0);\n  this._near = this.near;\n\n  /**\n   * The distance of the far plane.\n   * @type {number}\n   * @default 500000000.0\n   */\n  this.far = defaultValue(options.far, 500000000.0);\n  this._far = this.far;\n\n  /**\n   * Offsets the frustum in the x direction.\n   * @type {number}\n   * @default 0.0\n   */\n  this.xOffset = defaultValue(options.xOffset, 0.0);\n  this._xOffset = this.xOffset;\n\n  /**\n   * Offsets the frustum in the y direction.\n   * @type {number}\n   * @default 0.0\n   */\n  this.yOffset = defaultValue(options.yOffset, 0.0);\n  this._yOffset = this.yOffset;\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nPerspectiveFrustum.packedLength = 6;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PerspectiveFrustum} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nPerspectiveFrustum.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  array[startingIndex++] = value.fov;\n  array[startingIndex++] = value.aspectRatio;\n  array[startingIndex++] = value.near;\n  array[startingIndex++] = value.far;\n  array[startingIndex++] = value.xOffset;\n  array[startingIndex] = value.yOffset;\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PerspectiveFrustum} [result] The object into which to store the result.\n * @returns {PerspectiveFrustum} The modified result parameter or a new PerspectiveFrustum instance if one was not provided.\n */\nPerspectiveFrustum.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  if (!defined(result)) {\n    result = new PerspectiveFrustum();\n  }\n\n  result.fov = array[startingIndex++];\n  result.aspectRatio = array[startingIndex++];\n  result.near = array[startingIndex++];\n  result.far = array[startingIndex++];\n  result.xOffset = array[startingIndex++];\n  result.yOffset = array[startingIndex];\n\n  return result;\n};\n\nfunction update(frustum) {\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    !defined(frustum.fov) ||\n    !defined(frustum.aspectRatio) ||\n    !defined(frustum.near) ||\n    !defined(frustum.far)\n  ) {\n    throw new DeveloperError(\n      \"fov, aspectRatio, near, or far parameters are not set.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const f = frustum._offCenterFrustum;\n\n  if (\n    frustum.fov !== frustum._fov ||\n    frustum.aspectRatio !== frustum._aspectRatio ||\n    frustum.near !== frustum._near ||\n    frustum.far !== frustum._far ||\n    frustum.xOffset !== frustum._xOffset ||\n    frustum.yOffset !== frustum._yOffset\n  ) {\n    //>>includeStart('debug', pragmas.debug);\n    if (frustum.fov < 0 || frustum.fov >= Math.PI) {\n      throw new DeveloperError(\"fov must be in the range [0, PI).\");\n    }\n\n    if (frustum.aspectRatio < 0) {\n      throw new DeveloperError(\"aspectRatio must be positive.\");\n    }\n\n    if (frustum.near < 0 || frustum.near > frustum.far) {\n      throw new DeveloperError(\n        \"near must be greater than zero and less than far.\"\n      );\n    }\n    //>>includeEnd('debug');\n\n    frustum._aspectRatio = frustum.aspectRatio;\n    frustum._fov = frustum.fov;\n    frustum._fovy =\n      frustum.aspectRatio <= 1\n        ? frustum.fov\n        : Math.atan(Math.tan(frustum.fov * 0.5) / frustum.aspectRatio) * 2.0;\n    frustum._near = frustum.near;\n    frustum._far = frustum.far;\n    frustum._sseDenominator = 2.0 * Math.tan(0.5 * frustum._fovy);\n    frustum._xOffset = frustum.xOffset;\n    frustum._yOffset = frustum.yOffset;\n\n    f.top = frustum.near * Math.tan(0.5 * frustum._fovy);\n    f.bottom = -f.top;\n    f.right = frustum.aspectRatio * f.top;\n    f.left = -f.right;\n    f.near = frustum.near;\n    f.far = frustum.far;\n\n    f.right += frustum.xOffset;\n    f.left += frustum.xOffset;\n    f.top += frustum.yOffset;\n    f.bottom += frustum.yOffset;\n  }\n}\n\nObject.defineProperties(PerspectiveFrustum.prototype, {\n  /**\n   * Gets the perspective projection matrix computed from the view frustum.\n   * @memberof PerspectiveFrustum.prototype\n   * @type {Matrix4}\n   * @readonly\n   *\n   * @see PerspectiveFrustum#infiniteProjectionMatrix\n   */\n  projectionMatrix: {\n    get: function () {\n      update(this);\n      return this._offCenterFrustum.projectionMatrix;\n    },\n  },\n\n  /**\n   * The perspective projection matrix computed from the view frustum with an infinite far plane.\n   * @memberof PerspectiveFrustum.prototype\n   * @type {Matrix4}\n   * @readonly\n   *\n   * @see PerspectiveFrustum#projectionMatrix\n   */\n  infiniteProjectionMatrix: {\n    get: function () {\n      update(this);\n      return this._offCenterFrustum.infiniteProjectionMatrix;\n    },\n  },\n\n  /**\n   * Gets the angle of the vertical field of view, in radians.\n   * @memberof PerspectiveFrustum.prototype\n   * @type {number}\n   * @readonly\n   * @default undefined\n   */\n  fovy: {\n    get: function () {\n      update(this);\n      return this._fovy;\n    },\n  },\n\n  /**\n   * @readonly\n   * @private\n   */\n  sseDenominator: {\n    get: function () {\n      update(this);\n      return this._sseDenominator;\n    },\n  },\n\n  /**\n   * Gets the orthographic projection matrix computed from the view frustum.\n   * @memberof PerspectiveFrustum.prototype\n   * @type {PerspectiveOffCenterFrustum}\n   * @readonly\n   * @private\n   */\n  offCenterFrustum: {\n    get: function () {\n      update(this);\n      return this._offCenterFrustum;\n    },\n  },\n});\n\n/**\n * Creates a culling volume for this frustum.\n *\n * @param {Cartesian3} position The eye position.\n * @param {Cartesian3} direction The view direction.\n * @param {Cartesian3} up The up direction.\n * @returns {CullingVolume} A culling volume at the given position and orientation.\n *\n * @example\n * // Check if a bounding volume intersects the frustum.\n * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);\n * const intersect = cullingVolume.computeVisibility(boundingVolume);\n */\nPerspectiveFrustum.prototype.computeCullingVolume = function (\n  position,\n  direction,\n  up\n) {\n  update(this);\n  return this._offCenterFrustum.computeCullingVolume(position, direction, up);\n};\n\n/**\n * Returns the pixel's width and height in meters.\n *\n * @param {number} drawingBufferWidth The width of the drawing buffer.\n * @param {number} drawingBufferHeight The height of the drawing buffer.\n * @param {number} distance The distance to the near plane in meters.\n * @param {number} pixelRatio The scaling factor from pixel space to coordinate space.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.\n *\n * @exception {DeveloperError} drawingBufferWidth must be greater than zero.\n * @exception {DeveloperError} drawingBufferHeight must be greater than zero.\n * @exception {DeveloperError} pixelRatio must be greater than zero.\n *\n * @example\n * // Example 1\n * // Get the width and height of a pixel.\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());\n *\n * @example\n * // Example 2\n * // Get the width and height of a pixel if the near plane was set to 'distance'.\n * // For example, get the size of a pixel of an image on a billboard.\n * const position = camera.position;\n * const direction = camera.direction;\n * const toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3());      // vector from camera to a primitive\n * const toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector\n * const distance = Cesium.Cartesian3.magnitude(toCenterProj);\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());\n */\nPerspectiveFrustum.prototype.getPixelDimensions = function (\n  drawingBufferWidth,\n  drawingBufferHeight,\n  distance,\n  pixelRatio,\n  result\n) {\n  update(this);\n  return this._offCenterFrustum.getPixelDimensions(\n    drawingBufferWidth,\n    drawingBufferHeight,\n    distance,\n    pixelRatio,\n    result\n  );\n};\n\n/**\n * Returns a duplicate of a PerspectiveFrustum instance.\n *\n * @param {PerspectiveFrustum} [result] The object onto which to store the result.\n * @returns {PerspectiveFrustum} The modified result parameter or a new PerspectiveFrustum instance if one was not provided.\n */\nPerspectiveFrustum.prototype.clone = function (result) {\n  if (!defined(result)) {\n    result = new PerspectiveFrustum();\n  }\n\n  result.aspectRatio = this.aspectRatio;\n  result.fov = this.fov;\n  result.near = this.near;\n  result.far = this.far;\n\n  // force update of clone to compute matrices\n  result._aspectRatio = undefined;\n  result._fov = undefined;\n  result._near = undefined;\n  result._far = undefined;\n\n  this._offCenterFrustum.clone(result._offCenterFrustum);\n\n  return result;\n};\n\n/**\n * Compares the provided PerspectiveFrustum componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {PerspectiveFrustum} [other] The right hand side PerspectiveFrustum.\n * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nPerspectiveFrustum.prototype.equals = function (other) {\n  if (!defined(other) || !(other instanceof PerspectiveFrustum)) {\n    return false;\n  }\n\n  update(this);\n  update(other);\n\n  return (\n    this.fov === other.fov &&\n    this.aspectRatio === other.aspectRatio &&\n    this._offCenterFrustum.equals(other._offCenterFrustum)\n  );\n};\n\n/**\n * Compares the provided PerspectiveFrustum componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {PerspectiveFrustum} other The right hand side PerspectiveFrustum.\n * @param {number} relativeEpsilon The relative epsilon tolerance to use for equality testing.\n * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {boolean} <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.\n */\nPerspectiveFrustum.prototype.equalsEpsilon = function (\n  other,\n  relativeEpsilon,\n  absoluteEpsilon\n) {\n  if (!defined(other) || !(other instanceof PerspectiveFrustum)) {\n    return false;\n  }\n\n  update(this);\n  update(other);\n\n  return (\n    CesiumMath.equalsEpsilon(\n      this.fov,\n      other.fov,\n      relativeEpsilon,\n      absoluteEpsilon\n    ) &&\n    CesiumMath.equalsEpsilon(\n      this.aspectRatio,\n      other.aspectRatio,\n      relativeEpsilon,\n      absoluteEpsilon\n    ) &&\n    this._offCenterFrustum.equalsEpsilon(\n      other._offCenterFrustum,\n      relativeEpsilon,\n      absoluteEpsilon\n    )\n  );\n};\nexport default PerspectiveFrustum;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec2 v_textureCoordinates;\\n\\\nconst float M_PI = 3.141592653589793;\\n\\\n\\n\\\nfloat vdcRadicalInverse(int i)\\n\\\n{\\n\\\n    float r;\\n\\\n    float base = 2.0;\\n\\\n    float value = 0.0;\\n\\\n    float invBase = 1.0 / base;\\n\\\n    float invBi = invBase;\\n\\\n    for (int x = 0; x < 100; x++)\\n\\\n    {\\n\\\n        if (i <= 0)\\n\\\n        {\\n\\\n            break;\\n\\\n        }\\n\\\n        r = mod(float(i), base);\\n\\\n        value += r * invBi;\\n\\\n        invBi *= invBase;\\n\\\n        i = int(float(i) * invBase);\\n\\\n    }\\n\\\n    return value;\\n\\\n}\\n\\\n\\n\\\nvec2 hammersley2D(int i, int N)\\n\\\n{\\n\\\n    return vec2(float(i) / float(N), vdcRadicalInverse(i));\\n\\\n}\\n\\\n\\n\\\nvec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N)\\n\\\n{\\n\\\n    float a = roughness * roughness;\\n\\\n    float phi = 2.0 * M_PI * xi.x;\\n\\\n    float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y));\\n\\\n    float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\\n\\\n    vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);\\n\\\n    vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\\n\\\n    vec3 tangentX = normalize(cross(upVector, N));\\n\\\n    vec3 tangentY = cross(N, tangentX);\\n\\\n    return tangentX * H.x + tangentY * H.y + N * H.z;\\n\\\n}\\n\\\n\\n\\\nfloat G1_Smith(float NdotV, float k)\\n\\\n{\\n\\\n    return NdotV / (NdotV * (1.0 - k) + k);\\n\\\n}\\n\\\n\\n\\\nfloat G_Smith(float roughness, float NdotV, float NdotL)\\n\\\n{\\n\\\n    float k = roughness * roughness / 2.0;\\n\\\n    return G1_Smith(NdotV, k) * G1_Smith(NdotL, k);\\n\\\n}\\n\\\n\\n\\\nvec2 integrateBrdf(float roughness, float NdotV)\\n\\\n{\\n\\\n    vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);\\n\\\n    float A = 0.0;\\n\\\n    float B = 0.0;\\n\\\n    const int NumSamples = 1024;\\n\\\n    for (int i = 0; i < NumSamples; i++)\\n\\\n    {\\n\\\n        vec2 xi = hammersley2D(i, NumSamples);\\n\\\n        vec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0));\\n\\\n        vec3 L = 2.0 * dot(V, H) * H - V;\\n\\\n        float NdotL = clamp(L.z, 0.0, 1.0);\\n\\\n        float NdotH = clamp(H.z, 0.0, 1.0);\\n\\\n        float VdotH = clamp(dot(V, H), 0.0, 1.0);\\n\\\n        if (NdotL > 0.0)\\n\\\n        {\\n\\\n            float G = G_Smith(roughness, NdotV, NdotL);\\n\\\n            float G_Vis = G * VdotH / (NdotH * NdotV);\\n\\\n            float Fc = pow(1.0 - VdotH, 5.0);\\n\\\n            A += (1.0 - Fc) * G_Vis;\\n\\\n            B += Fc * G_Vis;\\n\\\n        }\\n\\\n    }\\n\\\n    return vec2(A, B) / float(NumSamples);\\n\\\n}\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);\\n\\\n}\\n\\\n\";\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Framebuffer from \"../Renderer/Framebuffer.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport BrdfLutGeneratorFS from \"../Shaders/BrdfLutGeneratorFS.js\";\n\n/**\n * @private\n */\nfunction BrdfLutGenerator() {\n  this._colorTexture = undefined;\n  this._drawCommand = undefined;\n}\n\nObject.defineProperties(BrdfLutGenerator.prototype, {\n  colorTexture: {\n    get: function () {\n      return this._colorTexture;\n    },\n  },\n});\n\nfunction createCommand(generator, context, framebuffer) {\n  const drawCommand = context.createViewportQuadCommand(BrdfLutGeneratorFS, {\n    framebuffer: framebuffer,\n    renderState: RenderState.fromCache({\n      viewport: new BoundingRectangle(0.0, 0.0, 256.0, 256.0),\n    }),\n  });\n\n  generator._drawCommand = drawCommand;\n}\n\nBrdfLutGenerator.prototype.update = function (frameState) {\n  if (!defined(this._colorTexture)) {\n    const context = frameState.context;\n    const colorTexture = new Texture({\n      context: context,\n      width: 256,\n      height: 256,\n      pixelFormat: PixelFormat.RGBA,\n      pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n      sampler: Sampler.NEAREST,\n    });\n\n    this._colorTexture = colorTexture;\n    const framebuffer = new Framebuffer({\n      context: context,\n      colorTextures: [colorTexture],\n      destroyAttachments: false,\n    });\n\n    createCommand(this, context, framebuffer);\n    this._drawCommand.execute(context);\n    framebuffer.destroy();\n    this._drawCommand.shaderProgram =\n      this._drawCommand.shaderProgram &&\n      this._drawCommand.shaderProgram.destroy();\n  }\n};\n\nBrdfLutGenerator.prototype.isDestroyed = function () {\n  return false;\n};\n\nBrdfLutGenerator.prototype.destroy = function () {\n  this._colorTexture = this._colorTexture && this._colorTexture.destroy();\n  return destroyObject(this);\n};\nexport default BrdfLutGenerator;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EasingFunction from \"../Core/EasingFunction.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport PerspectiveFrustum from \"../Core/PerspectiveFrustum.js\";\nimport PerspectiveOffCenterFrustum from \"../Core/PerspectiveOffCenterFrustum.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * Creates tweens for camera flights.\n * <br /><br />\n * Mouse interaction is disabled during flights.\n *\n * @private\n */\nconst CameraFlightPath = {};\n\nfunction getAltitude(frustum, dx, dy) {\n  let near;\n  let top;\n  let right;\n  if (frustum instanceof PerspectiveFrustum) {\n    const tanTheta = Math.tan(0.5 * frustum.fovy);\n    near = frustum.near;\n    top = frustum.near * tanTheta;\n    right = frustum.aspectRatio * top;\n    return Math.max((dx * near) / right, (dy * near) / top);\n  } else if (frustum instanceof PerspectiveOffCenterFrustum) {\n    near = frustum.near;\n    top = frustum.top;\n    right = frustum.right;\n    return Math.max((dx * near) / right, (dy * near) / top);\n  }\n\n  return Math.max(dx, dy);\n}\n\nconst scratchCart = new Cartesian3();\nconst scratchCart2 = new Cartesian3();\n\nfunction createPitchFunction(\n  startPitch,\n  endPitch,\n  heightFunction,\n  pitchAdjustHeight\n) {\n  if (defined(pitchAdjustHeight) && heightFunction(0.5) > pitchAdjustHeight) {\n    const startHeight = heightFunction(0.0);\n    const endHeight = heightFunction(1.0);\n    const middleHeight = heightFunction(0.5);\n\n    const d1 = middleHeight - startHeight;\n    const d2 = middleHeight - endHeight;\n\n    return function (time) {\n      const altitude = heightFunction(time);\n      if (time <= 0.5) {\n        const t1 = (altitude - startHeight) / d1;\n        return CesiumMath.lerp(startPitch, -CesiumMath.PI_OVER_TWO, t1);\n      }\n\n      const t2 = (altitude - endHeight) / d2;\n      return CesiumMath.lerp(-CesiumMath.PI_OVER_TWO, endPitch, 1 - t2);\n    };\n  }\n  return function (time) {\n    return CesiumMath.lerp(startPitch, endPitch, time);\n  };\n}\n\nfunction createHeightFunction(\n  camera,\n  destination,\n  startHeight,\n  endHeight,\n  optionAltitude\n) {\n  let altitude = optionAltitude;\n  const maxHeight = Math.max(startHeight, endHeight);\n\n  if (!defined(altitude)) {\n    const start = camera.position;\n    const end = destination;\n    const up = camera.up;\n    const right = camera.right;\n    const frustum = camera.frustum;\n\n    const diff = Cartesian3.subtract(start, end, scratchCart);\n    const verticalDistance = Cartesian3.magnitude(\n      Cartesian3.multiplyByScalar(up, Cartesian3.dot(diff, up), scratchCart2)\n    );\n    const horizontalDistance = Cartesian3.magnitude(\n      Cartesian3.multiplyByScalar(\n        right,\n        Cartesian3.dot(diff, right),\n        scratchCart2\n      )\n    );\n\n    altitude = Math.min(\n      getAltitude(frustum, verticalDistance, horizontalDistance) * 0.2,\n      1000000000.0\n    );\n  }\n\n  if (maxHeight < altitude) {\n    const power = 8.0;\n    const factor = 1000000.0;\n\n    const s = -Math.pow((altitude - startHeight) * factor, 1.0 / power);\n    const e = Math.pow((altitude - endHeight) * factor, 1.0 / power);\n\n    return function (t) {\n      const x = t * (e - s) + s;\n      return -Math.pow(x, power) / factor + altitude;\n    };\n  }\n\n  return function (t) {\n    return CesiumMath.lerp(startHeight, endHeight, t);\n  };\n}\n\nfunction adjustAngleForLERP(startAngle, endAngle) {\n  if (\n    CesiumMath.equalsEpsilon(\n      startAngle,\n      CesiumMath.TWO_PI,\n      CesiumMath.EPSILON11\n    )\n  ) {\n    startAngle = 0.0;\n  }\n\n  if (endAngle > startAngle + Math.PI) {\n    startAngle += CesiumMath.TWO_PI;\n  } else if (endAngle < startAngle - Math.PI) {\n    startAngle -= CesiumMath.TWO_PI;\n  }\n\n  return startAngle;\n}\n\nconst scratchStart = new Cartesian3();\n\nfunction createUpdateCV(\n  scene,\n  duration,\n  destination,\n  heading,\n  pitch,\n  roll,\n  optionAltitude,\n  optionPitchAdjustHeight\n) {\n  const camera = scene.camera;\n\n  const start = Cartesian3.clone(camera.position, scratchStart);\n  const startPitch = camera.pitch;\n  const startHeading = adjustAngleForLERP(camera.heading, heading);\n  const startRoll = adjustAngleForLERP(camera.roll, roll);\n\n  const heightFunction = createHeightFunction(\n    camera,\n    destination,\n    start.z,\n    destination.z,\n    optionAltitude\n  );\n\n  const pitchFunction = createPitchFunction(\n    startPitch,\n    pitch,\n    heightFunction,\n    optionPitchAdjustHeight\n  );\n\n  function update(value) {\n    const time = value.time / duration;\n\n    camera.setView({\n      orientation: {\n        heading: CesiumMath.lerp(startHeading, heading, time),\n        pitch: pitchFunction(time),\n        roll: CesiumMath.lerp(startRoll, roll, time),\n      },\n    });\n\n    Cartesian2.lerp(start, destination, time, camera.position);\n    camera.position.z = heightFunction(time);\n  }\n  return update;\n}\n\nfunction useLongestFlight(startCart, destCart) {\n  if (startCart.longitude < destCart.longitude) {\n    startCart.longitude += CesiumMath.TWO_PI;\n  } else {\n    destCart.longitude += CesiumMath.TWO_PI;\n  }\n}\n\nfunction useShortestFlight(startCart, destCart) {\n  const diff = startCart.longitude - destCart.longitude;\n  if (diff < -CesiumMath.PI) {\n    startCart.longitude += CesiumMath.TWO_PI;\n  } else if (diff > CesiumMath.PI) {\n    destCart.longitude += CesiumMath.TWO_PI;\n  }\n}\n\nconst scratchStartCart = new Cartographic();\nconst scratchEndCart = new Cartographic();\n\nfunction createUpdate3D(\n  scene,\n  duration,\n  destination,\n  heading,\n  pitch,\n  roll,\n  optionAltitude,\n  optionFlyOverLongitude,\n  optionFlyOverLongitudeWeight,\n  optionPitchAdjustHeight\n) {\n  const camera = scene.camera;\n  const projection = scene.mapProjection;\n  const ellipsoid = projection.ellipsoid;\n\n  const startCart = Cartographic.clone(\n    camera.positionCartographic,\n    scratchStartCart\n  );\n  const startPitch = camera.pitch;\n  const startHeading = adjustAngleForLERP(camera.heading, heading);\n  const startRoll = adjustAngleForLERP(camera.roll, roll);\n\n  const destCart = ellipsoid.cartesianToCartographic(\n    destination,\n    scratchEndCart\n  );\n  startCart.longitude = CesiumMath.zeroToTwoPi(startCart.longitude);\n  destCart.longitude = CesiumMath.zeroToTwoPi(destCart.longitude);\n\n  let useLongFlight = false;\n\n  if (defined(optionFlyOverLongitude)) {\n    const hitLon = CesiumMath.zeroToTwoPi(optionFlyOverLongitude);\n\n    const lonMin = Math.min(startCart.longitude, destCart.longitude);\n    const lonMax = Math.max(startCart.longitude, destCart.longitude);\n\n    const hitInside = hitLon >= lonMin && hitLon <= lonMax;\n\n    if (defined(optionFlyOverLongitudeWeight)) {\n      // Distance inside  (0...2Pi)\n      const din = Math.abs(startCart.longitude - destCart.longitude);\n      // Distance outside (0...2Pi)\n      const dot = CesiumMath.TWO_PI - din;\n\n      const hitDistance = hitInside ? din : dot;\n      const offDistance = hitInside ? dot : din;\n\n      if (\n        hitDistance < offDistance * optionFlyOverLongitudeWeight &&\n        !hitInside\n      ) {\n        useLongFlight = true;\n      }\n    } else if (!hitInside) {\n      useLongFlight = true;\n    }\n  }\n\n  if (useLongFlight) {\n    useLongestFlight(startCart, destCart);\n  } else {\n    useShortestFlight(startCart, destCart);\n  }\n\n  const heightFunction = createHeightFunction(\n    camera,\n    destination,\n    startCart.height,\n    destCart.height,\n    optionAltitude\n  );\n  const pitchFunction = createPitchFunction(\n    startPitch,\n    pitch,\n    heightFunction,\n    optionPitchAdjustHeight\n  );\n\n  // Isolate scope for update function.\n  // to have local copies of vars used in lerp\n  // Othervise, if you call nex\n  // createUpdate3D (createAnimationTween)\n  // before you played animation, variables will be overwriten.\n  function isolateUpdateFunction() {\n    const startLongitude = startCart.longitude;\n    const destLongitude = destCart.longitude;\n    const startLatitude = startCart.latitude;\n    const destLatitude = destCart.latitude;\n\n    return function update(value) {\n      const time = value.time / duration;\n\n      const position = Cartesian3.fromRadians(\n        CesiumMath.lerp(startLongitude, destLongitude, time),\n        CesiumMath.lerp(startLatitude, destLatitude, time),\n        heightFunction(time),\n        ellipsoid\n      );\n\n      camera.setView({\n        destination: position,\n        orientation: {\n          heading: CesiumMath.lerp(startHeading, heading, time),\n          pitch: pitchFunction(time),\n          roll: CesiumMath.lerp(startRoll, roll, time),\n        },\n      });\n    };\n  }\n  return isolateUpdateFunction();\n}\n\nfunction createUpdate2D(\n  scene,\n  duration,\n  destination,\n  heading,\n  pitch,\n  roll,\n  optionAltitude\n) {\n  const camera = scene.camera;\n\n  const start = Cartesian3.clone(camera.position, scratchStart);\n  const startHeading = adjustAngleForLERP(camera.heading, heading);\n\n  const startHeight = camera.frustum.right - camera.frustum.left;\n  const heightFunction = createHeightFunction(\n    camera,\n    destination,\n    startHeight,\n    destination.z,\n    optionAltitude\n  );\n\n  function update(value) {\n    const time = value.time / duration;\n\n    camera.setView({\n      orientation: {\n        heading: CesiumMath.lerp(startHeading, heading, time),\n      },\n    });\n\n    Cartesian2.lerp(start, destination, time, camera.position);\n\n    const zoom = heightFunction(time);\n\n    const frustum = camera.frustum;\n    const ratio = frustum.top / frustum.right;\n\n    const incrementAmount = (zoom - (frustum.right - frustum.left)) * 0.5;\n    frustum.right += incrementAmount;\n    frustum.left -= incrementAmount;\n    frustum.top = ratio * frustum.right;\n    frustum.bottom = -frustum.top;\n  }\n  return update;\n}\n\nconst scratchCartographic = new Cartographic();\nconst scratchDestination = new Cartesian3();\n\nfunction emptyFlight(complete, cancel) {\n  return {\n    startObject: {},\n    stopObject: {},\n    duration: 0.0,\n    complete: complete,\n    cancel: cancel,\n  };\n}\n\nfunction wrapCallback(controller, cb) {\n  function wrapped() {\n    if (typeof cb === \"function\") {\n      cb();\n    }\n\n    controller.enableInputs = true;\n  }\n  return wrapped;\n}\n\nCameraFlightPath.createTween = function (scene, options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  let destination = options.destination;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  if (!defined(destination)) {\n    throw new DeveloperError(\"destination is required.\");\n  }\n  //>>includeEnd('debug');\n  const mode = scene.mode;\n\n  if (mode === SceneMode.MORPHING) {\n    return emptyFlight();\n  }\n\n  const convert = defaultValue(options.convert, true);\n  const projection = scene.mapProjection;\n  const ellipsoid = projection.ellipsoid;\n  const maximumHeight = options.maximumHeight;\n  const flyOverLongitude = options.flyOverLongitude;\n  const flyOverLongitudeWeight = options.flyOverLongitudeWeight;\n  const pitchAdjustHeight = options.pitchAdjustHeight;\n  let easingFunction = options.easingFunction;\n\n  if (convert && mode !== SceneMode.SCENE3D) {\n    ellipsoid.cartesianToCartographic(destination, scratchCartographic);\n    destination = projection.project(scratchCartographic, scratchDestination);\n  }\n\n  const camera = scene.camera;\n  const transform = options.endTransform;\n  if (defined(transform)) {\n    camera._setTransform(transform);\n  }\n\n  let duration = options.duration;\n  if (!defined(duration)) {\n    duration =\n      Math.ceil(Cartesian3.distance(camera.position, destination) / 1000000.0) +\n      2.0;\n    duration = Math.min(duration, 3.0);\n  }\n\n  const heading = defaultValue(options.heading, 0.0);\n  const pitch = defaultValue(options.pitch, -CesiumMath.PI_OVER_TWO);\n  const roll = defaultValue(options.roll, 0.0);\n\n  const controller = scene.screenSpaceCameraController;\n  controller.enableInputs = false;\n\n  const complete = wrapCallback(controller, options.complete);\n  const cancel = wrapCallback(controller, options.cancel);\n\n  const frustum = camera.frustum;\n\n  let empty = scene.mode === SceneMode.SCENE2D;\n  empty =\n    empty &&\n    Cartesian2.equalsEpsilon(camera.position, destination, CesiumMath.EPSILON6);\n  empty =\n    empty &&\n    CesiumMath.equalsEpsilon(\n      Math.max(frustum.right - frustum.left, frustum.top - frustum.bottom),\n      destination.z,\n      CesiumMath.EPSILON6\n    );\n\n  empty =\n    empty ||\n    (scene.mode !== SceneMode.SCENE2D &&\n      Cartesian3.equalsEpsilon(\n        destination,\n        camera.position,\n        CesiumMath.EPSILON10\n      ));\n\n  empty =\n    empty &&\n    CesiumMath.equalsEpsilon(\n      CesiumMath.negativePiToPi(heading),\n      CesiumMath.negativePiToPi(camera.heading),\n      CesiumMath.EPSILON10\n    ) &&\n    CesiumMath.equalsEpsilon(\n      CesiumMath.negativePiToPi(pitch),\n      CesiumMath.negativePiToPi(camera.pitch),\n      CesiumMath.EPSILON10\n    ) &&\n    CesiumMath.equalsEpsilon(\n      CesiumMath.negativePiToPi(roll),\n      CesiumMath.negativePiToPi(camera.roll),\n      CesiumMath.EPSILON10\n    );\n\n  if (empty) {\n    return emptyFlight(complete, cancel);\n  }\n\n  const updateFunctions = new Array(4);\n  updateFunctions[SceneMode.SCENE2D] = createUpdate2D;\n  updateFunctions[SceneMode.SCENE3D] = createUpdate3D;\n  updateFunctions[SceneMode.COLUMBUS_VIEW] = createUpdateCV;\n\n  if (duration <= 0.0) {\n    const newOnComplete = function () {\n      const update = updateFunctions[mode](\n        scene,\n        1.0,\n        destination,\n        heading,\n        pitch,\n        roll,\n        maximumHeight,\n        flyOverLongitude,\n        flyOverLongitudeWeight,\n        pitchAdjustHeight\n      );\n      update({ time: 1.0 });\n\n      if (typeof complete === \"function\") {\n        complete();\n      }\n    };\n    return emptyFlight(newOnComplete, cancel);\n  }\n\n  const update = updateFunctions[mode](\n    scene,\n    duration,\n    destination,\n    heading,\n    pitch,\n    roll,\n    maximumHeight,\n    flyOverLongitude,\n    flyOverLongitudeWeight,\n    pitchAdjustHeight\n  );\n\n  if (!defined(easingFunction)) {\n    const startHeight = camera.positionCartographic.height;\n    const endHeight =\n      mode === SceneMode.SCENE3D\n        ? ellipsoid.cartesianToCartographic(destination).height\n        : destination.z;\n\n    if (startHeight > endHeight && startHeight > 11500.0) {\n      easingFunction = EasingFunction.CUBIC_OUT;\n    } else {\n      easingFunction = EasingFunction.QUINTIC_IN_OUT;\n    }\n  }\n\n  return {\n    duration: duration,\n    easingFunction: easingFunction,\n    startObject: {\n      time: 0.0,\n    },\n    stopObject: {\n      time: duration,\n    },\n    update: update,\n    complete: complete,\n    cancel: cancel,\n  };\n};\nexport default CameraFlightPath;\n", "/**\n * Describes how the map will operate in 2D.\n *\n * @enum {number}\n */\nconst MapMode2D = {\n  /**\n   * The 2D map can be rotated about the z axis.\n   *\n   * @type {number}\n   * @constant\n   */\n  ROTATE: 0,\n\n  /**\n   * The 2D map can be scrolled infinitely in the horizontal direction.\n   *\n   * @type {number}\n   * @constant\n   */\n  INFINITE_SCROLL: 1,\n};\nexport default Object.freeze(MapMode2D);\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EasingFunction from \"../Core/EasingFunction.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport EllipsoidGeodesic from \"../Core/EllipsoidGeodesic.js\";\nimport Event from \"../Core/Event.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport HeadingPitchRange from \"../Core/HeadingPitchRange.js\";\nimport HeadingPitchRoll from \"../Core/HeadingPitchRoll.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport IntersectionTests from \"../Core/IntersectionTests.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport PerspectiveFrustum from \"../Core/PerspectiveFrustum.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport Ray from \"../Core/Ray.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport CameraFlightPath from \"./CameraFlightPath.js\";\nimport MapMode2D from \"./MapMode2D.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * @typedef {object} DirectionUp\n *\n * An orientation given by a pair of unit vectors\n *\n * @property {Cartesian3} direction The unit \"direction\" vector\n * @property {Cartesian3} up The unit \"up\" vector\n **/\n/**\n * @typedef {object} HeadingPitchRollValues\n *\n * An orientation given by numeric heading, pitch, and roll\n *\n * @property {number} [heading=0.0] The heading in radians\n * @property {number} [pitch=-CesiumMath.PI_OVER_TWO] The pitch in radians\n * @property {number} [roll=0.0] The roll in radians\n **/\n\n/**\n * The camera is defined by a position, orientation, and view frustum.\n * <br /><br />\n * The orientation forms an orthonormal basis with a view, up and right = view x up unit vectors.\n * <br /><br />\n * The viewing frustum is defined by 6 planes.\n * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components\n * define the unit vector normal to the plane, and the w component is the distance of the\n * plane from the origin/camera position.\n *\n * @alias Camera\n *\n * @constructor\n *\n * @param {Scene} scene The scene.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Camera.html|Cesium Sandcastle Camera Demo}\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Camera%20Tutorial.html|Cesium Sandcastle Camera Tutorial Example}\n * @demo {@link https://cesium.com/learn/cesiumjs-learn/cesiumjs-camera|Camera Tutorial}\n *\n * @example\n * // Create a camera looking down the negative z-axis, positioned at the origin,\n * // with a field of view of 60 degrees, and 1:1 aspect ratio.\n * const camera = new Cesium.Camera(scene);\n * camera.position = new Cesium.Cartesian3();\n * camera.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, new Cesium.Cartesian3());\n * camera.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y);\n * camera.frustum.fov = Cesium.Math.PI_OVER_THREE;\n * camera.frustum.near = 1.0;\n * camera.frustum.far = 2.0;\n */\nfunction Camera(scene) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  //>>includeEnd('debug');\n  this._scene = scene;\n\n  this._transform = Matrix4.clone(Matrix4.IDENTITY);\n  this._invTransform = Matrix4.clone(Matrix4.IDENTITY);\n  this._actualTransform = Matrix4.clone(Matrix4.IDENTITY);\n  this._actualInvTransform = Matrix4.clone(Matrix4.IDENTITY);\n  this._transformChanged = false;\n\n  /**\n   * The position of the camera.\n   *\n   * @type {Cartesian3}\n   */\n  this.position = new Cartesian3();\n  this._position = new Cartesian3();\n  this._positionWC = new Cartesian3();\n  this._positionCartographic = new Cartographic();\n  this._oldPositionWC = undefined;\n\n  /**\n   * The position delta magnitude.\n   *\n   * @private\n   */\n  this.positionWCDeltaMagnitude = 0.0;\n\n  /**\n   * The position delta magnitude last frame.\n   *\n   * @private\n   */\n  this.positionWCDeltaMagnitudeLastFrame = 0.0;\n\n  /**\n   * How long in seconds since the camera has stopped moving\n   *\n   * @private\n   */\n  this.timeSinceMoved = 0.0;\n  this._lastMovedTimestamp = 0.0;\n\n  /**\n   * The view direction of the camera.\n   *\n   * @type {Cartesian3}\n   */\n  this.direction = new Cartesian3();\n  this._direction = new Cartesian3();\n  this._directionWC = new Cartesian3();\n\n  /**\n   * The up direction of the camera.\n   *\n   * @type {Cartesian3}\n   */\n  this.up = new Cartesian3();\n  this._up = new Cartesian3();\n  this._upWC = new Cartesian3();\n\n  /**\n   * The right direction of the camera.\n   *\n   * @type {Cartesian3}\n   */\n  this.right = new Cartesian3();\n  this._right = new Cartesian3();\n  this._rightWC = new Cartesian3();\n\n  /**\n   * The region of space in view.\n   *\n   * @type {PerspectiveFrustum|PerspectiveOffCenterFrustum|OrthographicFrustum}\n   * @default PerspectiveFrustum()\n   *\n   * @see PerspectiveFrustum\n   * @see PerspectiveOffCenterFrustum\n   * @see OrthographicFrustum\n   */\n  this.frustum = new PerspectiveFrustum();\n  this.frustum.aspectRatio =\n    scene.drawingBufferWidth / scene.drawingBufferHeight;\n  this.frustum.fov = CesiumMath.toRadians(60.0);\n\n  /**\n   * The default amount to move the camera when an argument is not\n   * provided to the move methods.\n   * @type {number}\n   * @default 100000.0;\n   */\n  this.defaultMoveAmount = 100000.0;\n  /**\n   * The default amount to rotate the camera when an argument is not\n   * provided to the look methods.\n   * @type {number}\n   * @default Math.PI / 60.0\n   */\n  this.defaultLookAmount = Math.PI / 60.0;\n  /**\n   * The default amount to rotate the camera when an argument is not\n   * provided to the rotate methods.\n   * @type {number}\n   * @default Math.PI / 3600.0\n   */\n  this.defaultRotateAmount = Math.PI / 3600.0;\n  /**\n   * The default amount to move the camera when an argument is not\n   * provided to the zoom methods.\n   * @type {number}\n   * @default 100000.0;\n   */\n  this.defaultZoomAmount = 100000.0;\n  /**\n   * If set, the camera will not be able to rotate past this axis in either direction.\n   * @type {Cartesian3}\n   * @default undefined\n   */\n  this.constrainedAxis = undefined;\n  /**\n   * The factor multiplied by the the map size used to determine where to clamp the camera position\n   * when zooming out from the surface. The default is 1.5. Only valid for 2D and the map is rotatable.\n   * @type {number}\n   * @default 1.5\n   */\n  this.maximumZoomFactor = 1.5;\n\n  this._moveStart = new Event();\n  this._moveEnd = new Event();\n\n  this._changed = new Event();\n  this._changedPosition = undefined;\n  this._changedDirection = undefined;\n  this._changedFrustum = undefined;\n  this._changedHeading = undefined;\n\n  /**\n   * The amount the camera has to change before the <code>changed</code> event is raised. The value is a percentage in the [0, 1] range.\n   * @type {number}\n   * @default 0.5\n   */\n  this.percentageChanged = 0.5;\n\n  this._viewMatrix = new Matrix4();\n  this._invViewMatrix = new Matrix4();\n  updateViewMatrix(this);\n\n  this._mode = SceneMode.SCENE3D;\n  this._modeChanged = true;\n  const projection = scene.mapProjection;\n  this._projection = projection;\n  this._maxCoord = projection.project(\n    new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO)\n  );\n  this._max2Dfrustum = undefined;\n\n  // set default view\n  rectangleCameraPosition3D(\n    this,\n    Camera.DEFAULT_VIEW_RECTANGLE,\n    this.position,\n    true\n  );\n\n  let mag = Cartesian3.magnitude(this.position);\n  mag += mag * Camera.DEFAULT_VIEW_FACTOR;\n  Cartesian3.normalize(this.position, this.position);\n  Cartesian3.multiplyByScalar(this.position, mag, this.position);\n}\n\n/**\n * @private\n */\nCamera.TRANSFORM_2D = new Matrix4(\n  0.0,\n  0.0,\n  1.0,\n  0.0,\n  1.0,\n  0.0,\n  0.0,\n  0.0,\n  0.0,\n  1.0,\n  0.0,\n  0.0,\n  0.0,\n  0.0,\n  0.0,\n  1.0\n);\n\n/**\n * @private\n */\nCamera.TRANSFORM_2D_INVERSE = Matrix4.inverseTransformation(\n  Camera.TRANSFORM_2D,\n  new Matrix4()\n);\n\n/**\n * The default rectangle the camera will view on creation.\n * @type Rectangle\n */\nCamera.DEFAULT_VIEW_RECTANGLE = Rectangle.fromDegrees(\n  -95.0,\n  -20.0,\n  -70.0,\n  90.0\n);\n\n/**\n * A scalar to multiply to the camera position and add it back after setting the camera to view the rectangle.\n * A value of zero means the camera will view the entire {@link Camera#DEFAULT_VIEW_RECTANGLE}, a value greater than zero\n * will move it further away from the extent, and a value less than zero will move it close to the extent.\n * @type {number}\n */\nCamera.DEFAULT_VIEW_FACTOR = 0.5;\n\n/**\n * The default heading/pitch/range that is used when the camera flies to a location that contains a bounding sphere.\n * @type HeadingPitchRange\n */\nCamera.DEFAULT_OFFSET = new HeadingPitchRange(\n  0.0,\n  -CesiumMath.PI_OVER_FOUR,\n  0.0\n);\n\nfunction updateViewMatrix(camera) {\n  Matrix4.computeView(\n    camera._position,\n    camera._direction,\n    camera._up,\n    camera._right,\n    camera._viewMatrix\n  );\n  Matrix4.multiply(\n    camera._viewMatrix,\n    camera._actualInvTransform,\n    camera._viewMatrix\n  );\n  Matrix4.inverseTransformation(camera._viewMatrix, camera._invViewMatrix);\n}\n\nfunction updateCameraDeltas(camera) {\n  if (!defined(camera._oldPositionWC)) {\n    camera._oldPositionWC = Cartesian3.clone(\n      camera.positionWC,\n      camera._oldPositionWC\n    );\n  } else {\n    camera.positionWCDeltaMagnitudeLastFrame = camera.positionWCDeltaMagnitude;\n    const delta = Cartesian3.subtract(\n      camera.positionWC,\n      camera._oldPositionWC,\n      camera._oldPositionWC\n    );\n    camera.positionWCDeltaMagnitude = Cartesian3.magnitude(delta);\n    camera._oldPositionWC = Cartesian3.clone(\n      camera.positionWC,\n      camera._oldPositionWC\n    );\n\n    // Update move timers\n    if (camera.positionWCDeltaMagnitude > 0.0) {\n      camera.timeSinceMoved = 0.0;\n      camera._lastMovedTimestamp = getTimestamp();\n    } else {\n      camera.timeSinceMoved =\n        Math.max(getTimestamp() - camera._lastMovedTimestamp, 0.0) / 1000.0;\n    }\n  }\n}\n\n/**\n * Checks if there's a camera flight with preload for this camera.\n *\n * @returns {boolean} Whether or not this camera has a current flight with a valid preloadFlightCamera in scene.\n *\n * @private\n *\n */\nCamera.prototype.canPreloadFlight = function () {\n  return defined(this._currentFlight) && this._mode !== SceneMode.SCENE2D;\n};\n\nCamera.prototype._updateCameraChanged = function () {\n  const camera = this;\n\n  updateCameraDeltas(camera);\n\n  if (camera._changed.numberOfListeners === 0) {\n    return;\n  }\n\n  const percentageChanged = camera.percentageChanged;\n\n  const currentHeading = camera.heading;\n\n  if (!defined(camera._changedHeading)) {\n    camera._changedHeading = currentHeading;\n  }\n\n  let delta =\n    Math.abs(camera._changedHeading - currentHeading) % CesiumMath.TWO_PI;\n  delta = delta > CesiumMath.PI ? CesiumMath.TWO_PI - delta : delta;\n\n  // Since delta is computed as the shortest distance between two angles\n  // the percentage is relative to the half circle.\n  const headingChangedPercentage = delta / Math.PI;\n\n  if (headingChangedPercentage > percentageChanged) {\n    camera._changed.raiseEvent(headingChangedPercentage);\n    camera._changedHeading = currentHeading;\n  }\n\n  if (camera._mode === SceneMode.SCENE2D) {\n    if (!defined(camera._changedFrustum)) {\n      camera._changedPosition = Cartesian3.clone(\n        camera.position,\n        camera._changedPosition\n      );\n      camera._changedFrustum = camera.frustum.clone();\n      return;\n    }\n\n    const position = camera.position;\n    const lastPosition = camera._changedPosition;\n\n    const frustum = camera.frustum;\n    const lastFrustum = camera._changedFrustum;\n\n    const x0 = position.x + frustum.left;\n    const x1 = position.x + frustum.right;\n    const x2 = lastPosition.x + lastFrustum.left;\n    const x3 = lastPosition.x + lastFrustum.right;\n\n    const y0 = position.y + frustum.bottom;\n    const y1 = position.y + frustum.top;\n    const y2 = lastPosition.y + lastFrustum.bottom;\n    const y3 = lastPosition.y + lastFrustum.top;\n\n    const leftX = Math.max(x0, x2);\n    const rightX = Math.min(x1, x3);\n    const bottomY = Math.max(y0, y2);\n    const topY = Math.min(y1, y3);\n\n    let areaPercentage;\n    if (leftX >= rightX || bottomY >= y1) {\n      areaPercentage = 1.0;\n    } else {\n      let areaRef = lastFrustum;\n      if (x0 < x2 && x1 > x3 && y0 < y2 && y1 > y3) {\n        areaRef = frustum;\n      }\n      areaPercentage =\n        1.0 -\n        ((rightX - leftX) * (topY - bottomY)) /\n          ((areaRef.right - areaRef.left) * (areaRef.top - areaRef.bottom));\n    }\n\n    if (areaPercentage > percentageChanged) {\n      camera._changed.raiseEvent(areaPercentage);\n      camera._changedPosition = Cartesian3.clone(\n        camera.position,\n        camera._changedPosition\n      );\n      camera._changedFrustum = camera.frustum.clone(camera._changedFrustum);\n    }\n    return;\n  }\n\n  if (!defined(camera._changedDirection)) {\n    camera._changedPosition = Cartesian3.clone(\n      camera.positionWC,\n      camera._changedPosition\n    );\n    camera._changedDirection = Cartesian3.clone(\n      camera.directionWC,\n      camera._changedDirection\n    );\n    return;\n  }\n\n  const dirAngle = CesiumMath.acosClamped(\n    Cartesian3.dot(camera.directionWC, camera._changedDirection)\n  );\n\n  let dirPercentage;\n  if (defined(camera.frustum.fovy)) {\n    dirPercentage = dirAngle / (camera.frustum.fovy * 0.5);\n  } else {\n    dirPercentage = dirAngle;\n  }\n\n  const distance = Cartesian3.distance(\n    camera.positionWC,\n    camera._changedPosition\n  );\n  const heightPercentage = distance / camera.positionCartographic.height;\n\n  if (\n    dirPercentage > percentageChanged ||\n    heightPercentage > percentageChanged\n  ) {\n    camera._changed.raiseEvent(Math.max(dirPercentage, heightPercentage));\n    camera._changedPosition = Cartesian3.clone(\n      camera.positionWC,\n      camera._changedPosition\n    );\n    camera._changedDirection = Cartesian3.clone(\n      camera.directionWC,\n      camera._changedDirection\n    );\n  }\n};\n\nfunction convertTransformForColumbusView(camera) {\n  Transforms.basisTo2D(\n    camera._projection,\n    camera._transform,\n    camera._actualTransform\n  );\n}\n\nconst scratchCartographic = new Cartographic();\nconst scratchCartesian3Projection = new Cartesian3();\nconst scratchCartesian3 = new Cartesian3();\nconst scratchCartesian4Origin = new Cartesian4();\nconst scratchCartesian4NewOrigin = new Cartesian4();\nconst scratchCartesian4NewXAxis = new Cartesian4();\nconst scratchCartesian4NewYAxis = new Cartesian4();\nconst scratchCartesian4NewZAxis = new Cartesian4();\n\nfunction convertTransformFor2D(camera) {\n  const projection = camera._projection;\n  const ellipsoid = projection.ellipsoid;\n\n  const origin = Matrix4.getColumn(\n    camera._transform,\n    3,\n    scratchCartesian4Origin\n  );\n  const cartographic = ellipsoid.cartesianToCartographic(\n    origin,\n    scratchCartographic\n  );\n\n  const projectedPosition = projection.project(\n    cartographic,\n    scratchCartesian3Projection\n  );\n  const newOrigin = scratchCartesian4NewOrigin;\n  newOrigin.x = projectedPosition.z;\n  newOrigin.y = projectedPosition.x;\n  newOrigin.z = projectedPosition.y;\n  newOrigin.w = 1.0;\n\n  const newZAxis = Cartesian4.clone(\n    Cartesian4.UNIT_X,\n    scratchCartesian4NewZAxis\n  );\n\n  const xAxis = Cartesian4.add(\n    Matrix4.getColumn(camera._transform, 0, scratchCartesian3),\n    origin,\n    scratchCartesian3\n  );\n  ellipsoid.cartesianToCartographic(xAxis, cartographic);\n\n  projection.project(cartographic, projectedPosition);\n  const newXAxis = scratchCartesian4NewXAxis;\n  newXAxis.x = projectedPosition.z;\n  newXAxis.y = projectedPosition.x;\n  newXAxis.z = projectedPosition.y;\n  newXAxis.w = 0.0;\n\n  Cartesian3.subtract(newXAxis, newOrigin, newXAxis);\n  newXAxis.x = 0.0;\n\n  const newYAxis = scratchCartesian4NewYAxis;\n  if (Cartesian3.magnitudeSquared(newXAxis) > CesiumMath.EPSILON10) {\n    Cartesian3.cross(newZAxis, newXAxis, newYAxis);\n  } else {\n    const yAxis = Cartesian4.add(\n      Matrix4.getColumn(camera._transform, 1, scratchCartesian3),\n      origin,\n      scratchCartesian3\n    );\n    ellipsoid.cartesianToCartographic(yAxis, cartographic);\n\n    projection.project(cartographic, projectedPosition);\n    newYAxis.x = projectedPosition.z;\n    newYAxis.y = projectedPosition.x;\n    newYAxis.z = projectedPosition.y;\n    newYAxis.w = 0.0;\n\n    Cartesian3.subtract(newYAxis, newOrigin, newYAxis);\n    newYAxis.x = 0.0;\n\n    if (Cartesian3.magnitudeSquared(newYAxis) < CesiumMath.EPSILON10) {\n      Cartesian4.clone(Cartesian4.UNIT_Y, newXAxis);\n      Cartesian4.clone(Cartesian4.UNIT_Z, newYAxis);\n    }\n  }\n\n  Cartesian3.cross(newYAxis, newZAxis, newXAxis);\n  Cartesian3.normalize(newXAxis, newXAxis);\n  Cartesian3.cross(newZAxis, newXAxis, newYAxis);\n  Cartesian3.normalize(newYAxis, newYAxis);\n\n  Matrix4.setColumn(\n    camera._actualTransform,\n    0,\n    newXAxis,\n    camera._actualTransform\n  );\n  Matrix4.setColumn(\n    camera._actualTransform,\n    1,\n    newYAxis,\n    camera._actualTransform\n  );\n  Matrix4.setColumn(\n    camera._actualTransform,\n    2,\n    newZAxis,\n    camera._actualTransform\n  );\n  Matrix4.setColumn(\n    camera._actualTransform,\n    3,\n    newOrigin,\n    camera._actualTransform\n  );\n}\n\nconst scratchCartesian = new Cartesian3();\n\nfunction updateMembers(camera) {\n  const mode = camera._mode;\n\n  let heightChanged = false;\n  let height = 0.0;\n  if (mode === SceneMode.SCENE2D) {\n    height = camera.frustum.right - camera.frustum.left;\n    heightChanged = height !== camera._positionCartographic.height;\n  }\n\n  let position = camera._position;\n  const positionChanged =\n    !Cartesian3.equals(position, camera.position) || heightChanged;\n  if (positionChanged) {\n    position = Cartesian3.clone(camera.position, camera._position);\n  }\n\n  let direction = camera._direction;\n  const directionChanged = !Cartesian3.equals(direction, camera.direction);\n  if (directionChanged) {\n    Cartesian3.normalize(camera.direction, camera.direction);\n    direction = Cartesian3.clone(camera.direction, camera._direction);\n  }\n\n  let up = camera._up;\n  const upChanged = !Cartesian3.equals(up, camera.up);\n  if (upChanged) {\n    Cartesian3.normalize(camera.up, camera.up);\n    up = Cartesian3.clone(camera.up, camera._up);\n  }\n\n  let right = camera._right;\n  const rightChanged = !Cartesian3.equals(right, camera.right);\n  if (rightChanged) {\n    Cartesian3.normalize(camera.right, camera.right);\n    right = Cartesian3.clone(camera.right, camera._right);\n  }\n\n  const transformChanged = camera._transformChanged || camera._modeChanged;\n  camera._transformChanged = false;\n\n  if (transformChanged) {\n    Matrix4.inverseTransformation(camera._transform, camera._invTransform);\n\n    if (\n      camera._mode === SceneMode.COLUMBUS_VIEW ||\n      camera._mode === SceneMode.SCENE2D\n    ) {\n      if (Matrix4.equals(Matrix4.IDENTITY, camera._transform)) {\n        Matrix4.clone(Camera.TRANSFORM_2D, camera._actualTransform);\n      } else if (camera._mode === SceneMode.COLUMBUS_VIEW) {\n        convertTransformForColumbusView(camera);\n      } else {\n        convertTransformFor2D(camera);\n      }\n    } else {\n      Matrix4.clone(camera._transform, camera._actualTransform);\n    }\n\n    Matrix4.inverseTransformation(\n      camera._actualTransform,\n      camera._actualInvTransform\n    );\n\n    camera._modeChanged = false;\n  }\n\n  const transform = camera._actualTransform;\n\n  if (positionChanged || transformChanged) {\n    camera._positionWC = Matrix4.multiplyByPoint(\n      transform,\n      position,\n      camera._positionWC\n    );\n\n    // Compute the Cartographic position of the camera.\n    if (mode === SceneMode.SCENE3D || mode === SceneMode.MORPHING) {\n      camera._positionCartographic = camera._projection.ellipsoid.cartesianToCartographic(\n        camera._positionWC,\n        camera._positionCartographic\n      );\n    } else {\n      // The camera position is expressed in the 2D coordinate system where the Y axis is to the East,\n      // the Z axis is to the North, and the X axis is out of the map.  Express them instead in the ENU axes where\n      // X is to the East, Y is to the North, and Z is out of the local horizontal plane.\n      const positionENU = scratchCartesian;\n      positionENU.x = camera._positionWC.y;\n      positionENU.y = camera._positionWC.z;\n      positionENU.z = camera._positionWC.x;\n\n      // In 2D, the camera height is always 12.7 million meters.\n      // The apparent height is equal to half the frustum width.\n      if (mode === SceneMode.SCENE2D) {\n        positionENU.z = height;\n      }\n\n      camera._projection.unproject(positionENU, camera._positionCartographic);\n    }\n  }\n\n  if (directionChanged || upChanged || rightChanged) {\n    const det = Cartesian3.dot(\n      direction,\n      Cartesian3.cross(up, right, scratchCartesian)\n    );\n    if (Math.abs(1.0 - det) > CesiumMath.EPSILON2) {\n      //orthonormalize axes\n      const invUpMag = 1.0 / Cartesian3.magnitudeSquared(up);\n      const scalar = Cartesian3.dot(up, direction) * invUpMag;\n      const w0 = Cartesian3.multiplyByScalar(\n        direction,\n        scalar,\n        scratchCartesian\n      );\n      up = Cartesian3.normalize(\n        Cartesian3.subtract(up, w0, camera._up),\n        camera._up\n      );\n      Cartesian3.clone(up, camera.up);\n\n      right = Cartesian3.cross(direction, up, camera._right);\n      Cartesian3.clone(right, camera.right);\n    }\n  }\n\n  if (directionChanged || transformChanged) {\n    camera._directionWC = Matrix4.multiplyByPointAsVector(\n      transform,\n      direction,\n      camera._directionWC\n    );\n    Cartesian3.normalize(camera._directionWC, camera._directionWC);\n  }\n\n  if (upChanged || transformChanged) {\n    camera._upWC = Matrix4.multiplyByPointAsVector(transform, up, camera._upWC);\n    Cartesian3.normalize(camera._upWC, camera._upWC);\n  }\n\n  if (rightChanged || transformChanged) {\n    camera._rightWC = Matrix4.multiplyByPointAsVector(\n      transform,\n      right,\n      camera._rightWC\n    );\n    Cartesian3.normalize(camera._rightWC, camera._rightWC);\n  }\n\n  if (\n    positionChanged ||\n    directionChanged ||\n    upChanged ||\n    rightChanged ||\n    transformChanged\n  ) {\n    updateViewMatrix(camera);\n  }\n}\n\nfunction getHeading(direction, up) {\n  let heading;\n  if (\n    !CesiumMath.equalsEpsilon(Math.abs(direction.z), 1.0, CesiumMath.EPSILON3)\n  ) {\n    heading = Math.atan2(direction.y, direction.x) - CesiumMath.PI_OVER_TWO;\n  } else {\n    heading = Math.atan2(up.y, up.x) - CesiumMath.PI_OVER_TWO;\n  }\n\n  return CesiumMath.TWO_PI - CesiumMath.zeroToTwoPi(heading);\n}\n\nfunction getPitch(direction) {\n  return CesiumMath.PI_OVER_TWO - CesiumMath.acosClamped(direction.z);\n}\n\nfunction getRoll(direction, up, right) {\n  let roll = 0.0;\n  if (\n    !CesiumMath.equalsEpsilon(Math.abs(direction.z), 1.0, CesiumMath.EPSILON3)\n  ) {\n    roll = Math.atan2(-right.z, up.z);\n    roll = CesiumMath.zeroToTwoPi(roll + CesiumMath.TWO_PI);\n  }\n\n  return roll;\n}\n\nconst scratchHPRMatrix1 = new Matrix4();\nconst scratchHPRMatrix2 = new Matrix4();\n\nObject.defineProperties(Camera.prototype, {\n  /**\n   * Gets the camera's reference frame. The inverse of this transformation is appended to the view matrix.\n   * @memberof Camera.prototype\n   *\n   * @type {Matrix4}\n   * @readonly\n   *\n   * @default {@link Matrix4.IDENTITY}\n   */\n  transform: {\n    get: function () {\n      return this._transform;\n    },\n  },\n\n  /**\n   * Gets the inverse camera transform.\n   * @memberof Camera.prototype\n   *\n   * @type {Matrix4}\n   * @readonly\n   *\n   * @default {@link Matrix4.IDENTITY}\n   */\n  inverseTransform: {\n    get: function () {\n      updateMembers(this);\n      return this._invTransform;\n    },\n  },\n\n  /**\n   * Gets the view matrix.\n   * @memberof Camera.prototype\n   *\n   * @type {Matrix4}\n   * @readonly\n   *\n   * @see Camera#inverseViewMatrix\n   */\n  viewMatrix: {\n    get: function () {\n      updateMembers(this);\n      return this._viewMatrix;\n    },\n  },\n\n  /**\n   * Gets the inverse view matrix.\n   * @memberof Camera.prototype\n   *\n   * @type {Matrix4}\n   * @readonly\n   *\n   * @see Camera#viewMatrix\n   */\n  inverseViewMatrix: {\n    get: function () {\n      updateMembers(this);\n      return this._invViewMatrix;\n    },\n  },\n\n  /**\n   * Gets the {@link Cartographic} position of the camera, with longitude and latitude\n   * expressed in radians and height in meters.  In 2D and Columbus View, it is possible\n   * for the returned longitude and latitude to be outside the range of valid longitudes\n   * and latitudes when the camera is outside the map.\n   * @memberof Camera.prototype\n   *\n   * @type {Cartographic}\n   * @readonly\n   */\n  positionCartographic: {\n    get: function () {\n      updateMembers(this);\n      return this._positionCartographic;\n    },\n  },\n\n  /**\n   * Gets the position of the camera in world coordinates.\n   * @memberof Camera.prototype\n   *\n   * @type {Cartesian3}\n   * @readonly\n   */\n  positionWC: {\n    get: function () {\n      updateMembers(this);\n      return this._positionWC;\n    },\n  },\n\n  /**\n   * Gets the view direction of the camera in world coordinates.\n   * @memberof Camera.prototype\n   *\n   * @type {Cartesian3}\n   * @readonly\n   */\n  directionWC: {\n    get: function () {\n      updateMembers(this);\n      return this._directionWC;\n    },\n  },\n\n  /**\n   * Gets the up direction of the camera in world coordinates.\n   * @memberof Camera.prototype\n   *\n   * @type {Cartesian3}\n   * @readonly\n   */\n  upWC: {\n    get: function () {\n      updateMembers(this);\n      return this._upWC;\n    },\n  },\n\n  /**\n   * Gets the right direction of the camera in world coordinates.\n   * @memberof Camera.prototype\n   *\n   * @type {Cartesian3}\n   * @readonly\n   */\n  rightWC: {\n    get: function () {\n      updateMembers(this);\n      return this._rightWC;\n    },\n  },\n\n  /**\n   * Gets the camera heading in radians.\n   * @memberof Camera.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  heading: {\n    get: function () {\n      if (this._mode !== SceneMode.MORPHING) {\n        const ellipsoid = this._projection.ellipsoid;\n\n        const oldTransform = Matrix4.clone(this._transform, scratchHPRMatrix1);\n        const transform = Transforms.eastNorthUpToFixedFrame(\n          this.positionWC,\n          ellipsoid,\n          scratchHPRMatrix2\n        );\n        this._setTransform(transform);\n\n        const heading = getHeading(this.direction, this.up);\n\n        this._setTransform(oldTransform);\n\n        return heading;\n      }\n\n      return undefined;\n    },\n  },\n\n  /**\n   * Gets the camera pitch in radians.\n   * @memberof Camera.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  pitch: {\n    get: function () {\n      if (this._mode !== SceneMode.MORPHING) {\n        const ellipsoid = this._projection.ellipsoid;\n\n        const oldTransform = Matrix4.clone(this._transform, scratchHPRMatrix1);\n        const transform = Transforms.eastNorthUpToFixedFrame(\n          this.positionWC,\n          ellipsoid,\n          scratchHPRMatrix2\n        );\n        this._setTransform(transform);\n\n        const pitch = getPitch(this.direction);\n\n        this._setTransform(oldTransform);\n\n        return pitch;\n      }\n\n      return undefined;\n    },\n  },\n\n  /**\n   * Gets the camera roll in radians.\n   * @memberof Camera.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  roll: {\n    get: function () {\n      if (this._mode !== SceneMode.MORPHING) {\n        const ellipsoid = this._projection.ellipsoid;\n\n        const oldTransform = Matrix4.clone(this._transform, scratchHPRMatrix1);\n        const transform = Transforms.eastNorthUpToFixedFrame(\n          this.positionWC,\n          ellipsoid,\n          scratchHPRMatrix2\n        );\n        this._setTransform(transform);\n\n        const roll = getRoll(this.direction, this.up, this.right);\n\n        this._setTransform(oldTransform);\n\n        return roll;\n      }\n\n      return undefined;\n    },\n  },\n\n  /**\n   * Gets the event that will be raised at when the camera starts to move.\n   * @memberof Camera.prototype\n   * @type {Event}\n   * @readonly\n   */\n  moveStart: {\n    get: function () {\n      return this._moveStart;\n    },\n  },\n\n  /**\n   * Gets the event that will be raised when the camera has stopped moving.\n   * @memberof Camera.prototype\n   * @type {Event}\n   * @readonly\n   */\n  moveEnd: {\n    get: function () {\n      return this._moveEnd;\n    },\n  },\n\n  /**\n   * Gets the event that will be raised when the camera has changed by <code>percentageChanged</code>.\n   * @memberof Camera.prototype\n   * @type {Event}\n   * @readonly\n   */\n  changed: {\n    get: function () {\n      return this._changed;\n    },\n  },\n});\n\n/**\n * @private\n */\nCamera.prototype.update = function (mode) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(mode)) {\n    throw new DeveloperError(\"mode is required.\");\n  }\n  if (\n    mode === SceneMode.SCENE2D &&\n    !(this.frustum instanceof OrthographicOffCenterFrustum)\n  ) {\n    throw new DeveloperError(\n      \"An OrthographicOffCenterFrustum is required in 2D.\"\n    );\n  }\n  if (\n    (mode === SceneMode.SCENE3D || mode === SceneMode.COLUMBUS_VIEW) &&\n    !(this.frustum instanceof PerspectiveFrustum) &&\n    !(this.frustum instanceof OrthographicFrustum)\n  ) {\n    throw new DeveloperError(\n      \"A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  let updateFrustum = false;\n  if (mode !== this._mode) {\n    this._mode = mode;\n    this._modeChanged = mode !== SceneMode.MORPHING;\n    updateFrustum = this._mode === SceneMode.SCENE2D;\n  }\n\n  if (updateFrustum) {\n    const frustum = (this._max2Dfrustum = this.frustum.clone());\n\n    //>>includeStart('debug', pragmas.debug);\n    if (!(frustum instanceof OrthographicOffCenterFrustum)) {\n      throw new DeveloperError(\n        \"The camera frustum is expected to be orthographic for 2D camera control.\"\n      );\n    }\n    //>>includeEnd('debug');\n\n    const maxZoomOut = 2.0;\n    const ratio = frustum.top / frustum.right;\n    frustum.right = this._maxCoord.x * maxZoomOut;\n    frustum.left = -frustum.right;\n    frustum.top = ratio * frustum.right;\n    frustum.bottom = -frustum.top;\n  }\n\n  if (this._mode === SceneMode.SCENE2D) {\n    clampMove2D(this, this.position);\n  }\n};\n\nconst setTransformPosition = new Cartesian3();\nconst setTransformUp = new Cartesian3();\nconst setTransformDirection = new Cartesian3();\n\nCamera.prototype._setTransform = function (transform) {\n  const position = Cartesian3.clone(this.positionWC, setTransformPosition);\n  const up = Cartesian3.clone(this.upWC, setTransformUp);\n  const direction = Cartesian3.clone(this.directionWC, setTransformDirection);\n\n  Matrix4.clone(transform, this._transform);\n  this._transformChanged = true;\n  updateMembers(this);\n  const inverse = this._actualInvTransform;\n\n  Matrix4.multiplyByPoint(inverse, position, this.position);\n  Matrix4.multiplyByPointAsVector(inverse, direction, this.direction);\n  Matrix4.multiplyByPointAsVector(inverse, up, this.up);\n  Cartesian3.cross(this.direction, this.up, this.right);\n\n  updateMembers(this);\n};\n\nconst scratchAdjustOrthographicFrustumMousePosition = new Cartesian2();\nconst scratchPickRay = new Ray();\nconst scratchRayIntersection = new Cartesian3();\nconst scratchDepthIntersection = new Cartesian3();\n\nfunction calculateOrthographicFrustumWidth(camera) {\n  // Camera is fixed to an object, so keep frustum width constant.\n  if (!Matrix4.equals(Matrix4.IDENTITY, camera.transform)) {\n    return Cartesian3.magnitude(camera.position);\n  }\n\n  const scene = camera._scene;\n  const globe = scene.globe;\n\n  const mousePosition = scratchAdjustOrthographicFrustumMousePosition;\n  mousePosition.x = scene.drawingBufferWidth / 2.0;\n  mousePosition.y = scene.drawingBufferHeight / 2.0;\n\n  let rayIntersection;\n  if (defined(globe)) {\n    const ray = camera.getPickRay(mousePosition, scratchPickRay);\n    rayIntersection = globe.pickWorldCoordinates(\n      ray,\n      scene,\n      true,\n      scratchRayIntersection\n    );\n  }\n\n  let depthIntersection;\n  if (scene.pickPositionSupported) {\n    depthIntersection = scene.pickPositionWorldCoordinates(\n      mousePosition,\n      scratchDepthIntersection\n    );\n  }\n\n  let distance;\n  if (defined(rayIntersection) || defined(depthIntersection)) {\n    const depthDistance = defined(depthIntersection)\n      ? Cartesian3.distance(depthIntersection, camera.positionWC)\n      : Number.POSITIVE_INFINITY;\n    const rayDistance = defined(rayIntersection)\n      ? Cartesian3.distance(rayIntersection, camera.positionWC)\n      : Number.POSITIVE_INFINITY;\n    distance = Math.min(depthDistance, rayDistance);\n  } else {\n    distance = Math.max(camera.positionCartographic.height, 0.0);\n  }\n  return distance;\n}\n\nCamera.prototype._adjustOrthographicFrustum = function (zooming) {\n  if (!(this.frustum instanceof OrthographicFrustum)) {\n    return;\n  }\n\n  if (!zooming && this._positionCartographic.height < 150000.0) {\n    return;\n  }\n\n  this.frustum.width = calculateOrthographicFrustumWidth(this);\n};\n\nconst scratchSetViewCartesian = new Cartesian3();\nconst scratchSetViewTransform1 = new Matrix4();\nconst scratchSetViewTransform2 = new Matrix4();\nconst scratchSetViewQuaternion = new Quaternion();\nconst scratchSetViewMatrix3 = new Matrix3();\nconst scratchSetViewCartographic = new Cartographic();\n\nfunction setView3D(camera, position, hpr) {\n  const currentTransform = Matrix4.clone(\n    camera.transform,\n    scratchSetViewTransform1\n  );\n  const localTransform = Transforms.eastNorthUpToFixedFrame(\n    position,\n    camera._projection.ellipsoid,\n    scratchSetViewTransform2\n  );\n  camera._setTransform(localTransform);\n\n  Cartesian3.clone(Cartesian3.ZERO, camera.position);\n  hpr.heading = hpr.heading - CesiumMath.PI_OVER_TWO;\n\n  const rotQuat = Quaternion.fromHeadingPitchRoll(\n    hpr,\n    scratchSetViewQuaternion\n  );\n  const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3);\n\n  Matrix3.getColumn(rotMat, 0, camera.direction);\n  Matrix3.getColumn(rotMat, 2, camera.up);\n  Cartesian3.cross(camera.direction, camera.up, camera.right);\n\n  camera._setTransform(currentTransform);\n\n  camera._adjustOrthographicFrustum(true);\n}\n\nfunction setViewCV(camera, position, hpr, convert) {\n  const currentTransform = Matrix4.clone(\n    camera.transform,\n    scratchSetViewTransform1\n  );\n  camera._setTransform(Matrix4.IDENTITY);\n\n  if (!Cartesian3.equals(position, camera.positionWC)) {\n    if (convert) {\n      const projection = camera._projection;\n      const cartographic = projection.ellipsoid.cartesianToCartographic(\n        position,\n        scratchSetViewCartographic\n      );\n      position = projection.project(cartographic, scratchSetViewCartesian);\n    }\n    Cartesian3.clone(position, camera.position);\n  }\n  hpr.heading = hpr.heading - CesiumMath.PI_OVER_TWO;\n\n  const rotQuat = Quaternion.fromHeadingPitchRoll(\n    hpr,\n    scratchSetViewQuaternion\n  );\n  const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3);\n\n  Matrix3.getColumn(rotMat, 0, camera.direction);\n  Matrix3.getColumn(rotMat, 2, camera.up);\n  Cartesian3.cross(camera.direction, camera.up, camera.right);\n\n  camera._setTransform(currentTransform);\n\n  camera._adjustOrthographicFrustum(true);\n}\n\nfunction setView2D(camera, position, hpr, convert) {\n  const currentTransform = Matrix4.clone(\n    camera.transform,\n    scratchSetViewTransform1\n  );\n  camera._setTransform(Matrix4.IDENTITY);\n\n  if (!Cartesian3.equals(position, camera.positionWC)) {\n    if (convert) {\n      const projection = camera._projection;\n      const cartographic = projection.ellipsoid.cartesianToCartographic(\n        position,\n        scratchSetViewCartographic\n      );\n      position = projection.project(cartographic, scratchSetViewCartesian);\n    }\n\n    Cartesian2.clone(position, camera.position);\n\n    const newLeft = -position.z * 0.5;\n    const newRight = -newLeft;\n\n    const frustum = camera.frustum;\n    if (newRight > newLeft) {\n      const ratio = frustum.top / frustum.right;\n      frustum.right = newRight;\n      frustum.left = newLeft;\n      frustum.top = frustum.right * ratio;\n      frustum.bottom = -frustum.top;\n    }\n  }\n\n  if (camera._scene.mapMode2D === MapMode2D.ROTATE) {\n    hpr.heading = hpr.heading - CesiumMath.PI_OVER_TWO;\n    hpr.pitch = -CesiumMath.PI_OVER_TWO;\n    hpr.roll = 0.0;\n    const rotQuat = Quaternion.fromHeadingPitchRoll(\n      hpr,\n      scratchSetViewQuaternion\n    );\n    const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3);\n\n    Matrix3.getColumn(rotMat, 2, camera.up);\n    Cartesian3.cross(camera.direction, camera.up, camera.right);\n  }\n\n  camera._setTransform(currentTransform);\n}\n\nconst scratchToHPRDirection = new Cartesian3();\nconst scratchToHPRUp = new Cartesian3();\nconst scratchToHPRRight = new Cartesian3();\n\nfunction directionUpToHeadingPitchRoll(camera, position, orientation, result) {\n  const direction = Cartesian3.clone(\n    orientation.direction,\n    scratchToHPRDirection\n  );\n  const up = Cartesian3.clone(orientation.up, scratchToHPRUp);\n\n  if (camera._scene.mode === SceneMode.SCENE3D) {\n    const ellipsoid = camera._projection.ellipsoid;\n    const transform = Transforms.eastNorthUpToFixedFrame(\n      position,\n      ellipsoid,\n      scratchHPRMatrix1\n    );\n    const invTransform = Matrix4.inverseTransformation(\n      transform,\n      scratchHPRMatrix2\n    );\n\n    Matrix4.multiplyByPointAsVector(invTransform, direction, direction);\n    Matrix4.multiplyByPointAsVector(invTransform, up, up);\n  }\n\n  const right = Cartesian3.cross(direction, up, scratchToHPRRight);\n\n  result.heading = getHeading(direction, up);\n  result.pitch = getPitch(direction);\n  result.roll = getRoll(direction, up, right);\n\n  return result;\n}\n\nconst scratchSetViewOptions = {\n  destination: undefined,\n  orientation: {\n    direction: undefined,\n    up: undefined,\n    heading: undefined,\n    pitch: undefined,\n    roll: undefined,\n  },\n  convert: undefined,\n  endTransform: undefined,\n};\n\nconst scratchHpr = new HeadingPitchRoll();\n/**\n * Sets the camera position, orientation and transform.\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3|Rectangle} [options.destination] The final position of the camera in WGS84 (world) coordinates or a rectangle that would be visible from a top-down view.\n * @param {HeadingPitchRollValues|DirectionUp} [options.orientation] An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point\n * towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive\n * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.\n * @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame of the camera.\n * @param {boolean} [options.convert] Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to <code>true</code>.\n *\n * @example\n * // 1. Set position with a top-down view\n * viewer.camera.setView({\n *     destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)\n * });\n *\n * // 2 Set view with heading, pitch and roll\n * viewer.camera.setView({\n *     destination : cartesianPosition,\n *     orientation: {\n *         heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)\n *         pitch : Cesium.Math.toRadians(-90),    // default value (looking down)\n *         roll : 0.0                             // default value\n *     }\n * });\n *\n * // 3. Change heading, pitch and roll with the camera position remaining the same.\n * viewer.camera.setView({\n *     orientation: {\n *         heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)\n *         pitch : Cesium.Math.toRadians(-90),    // default value (looking down)\n *         roll : 0.0                             // default value\n *     }\n * });\n *\n *\n * // 4. View rectangle with a top-down view\n * viewer.camera.setView({\n *     destination : Cesium.Rectangle.fromDegrees(west, south, east, north)\n * });\n *\n * // 5. Set position with an orientation using unit vectors.\n * viewer.camera.setView({\n *     destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),\n *     orientation : {\n *         direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),\n *         up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)\n *     }\n * });\n */\nCamera.prototype.setView = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  let orientation = defaultValue(\n    options.orientation,\n    defaultValue.EMPTY_OBJECT\n  );\n\n  const mode = this._mode;\n  if (mode === SceneMode.MORPHING) {\n    return;\n  }\n\n  if (defined(options.endTransform)) {\n    this._setTransform(options.endTransform);\n  }\n\n  let convert = defaultValue(options.convert, true);\n  let destination = defaultValue(\n    options.destination,\n    Cartesian3.clone(this.positionWC, scratchSetViewCartesian)\n  );\n  if (defined(destination) && defined(destination.west)) {\n    destination = this.getRectangleCameraCoordinates(\n      destination,\n      scratchSetViewCartesian\n    );\n    convert = false;\n  }\n\n  if (defined(orientation.direction)) {\n    orientation = directionUpToHeadingPitchRoll(\n      this,\n      destination,\n      orientation,\n      scratchSetViewOptions.orientation\n    );\n  }\n\n  scratchHpr.heading = defaultValue(orientation.heading, 0.0);\n  scratchHpr.pitch = defaultValue(orientation.pitch, -CesiumMath.PI_OVER_TWO);\n  scratchHpr.roll = defaultValue(orientation.roll, 0.0);\n\n  if (mode === SceneMode.SCENE3D) {\n    setView3D(this, destination, scratchHpr);\n  } else if (mode === SceneMode.SCENE2D) {\n    setView2D(this, destination, scratchHpr, convert);\n  } else {\n    setViewCV(this, destination, scratchHpr, convert);\n  }\n};\n\nconst pitchScratch = new Cartesian3();\n/**\n * Fly the camera to the home view.  Use {@link Camera#.DEFAULT_VIEW_RECTANGLE} to set\n * the default view for the 3D scene.  The home view for 2D and columbus view shows the\n * entire map.\n *\n * @param {number} [duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. See {@link Camera#flyTo}\n */\nCamera.prototype.flyHome = function (duration) {\n  const mode = this._mode;\n\n  if (mode === SceneMode.MORPHING) {\n    this._scene.completeMorph();\n  }\n\n  if (mode === SceneMode.SCENE2D) {\n    this.flyTo({\n      destination: Camera.DEFAULT_VIEW_RECTANGLE,\n      duration: duration,\n      endTransform: Matrix4.IDENTITY,\n    });\n  } else if (mode === SceneMode.SCENE3D) {\n    const destination = this.getRectangleCameraCoordinates(\n      Camera.DEFAULT_VIEW_RECTANGLE\n    );\n\n    let mag = Cartesian3.magnitude(destination);\n    mag += mag * Camera.DEFAULT_VIEW_FACTOR;\n    Cartesian3.normalize(destination, destination);\n    Cartesian3.multiplyByScalar(destination, mag, destination);\n\n    this.flyTo({\n      destination: destination,\n      duration: duration,\n      endTransform: Matrix4.IDENTITY,\n    });\n  } else if (mode === SceneMode.COLUMBUS_VIEW) {\n    const maxRadii = this._projection.ellipsoid.maximumRadius;\n    let position = new Cartesian3(0.0, -1.0, 1.0);\n    position = Cartesian3.multiplyByScalar(\n      Cartesian3.normalize(position, position),\n      5.0 * maxRadii,\n      position\n    );\n    this.flyTo({\n      destination: position,\n      duration: duration,\n      orientation: {\n        heading: 0.0,\n        pitch: -Math.acos(Cartesian3.normalize(position, pitchScratch).z),\n        roll: 0.0,\n      },\n      endTransform: Matrix4.IDENTITY,\n      convert: false,\n    });\n  }\n};\n\n/**\n * Transform a vector or point from world coordinates to the camera's reference frame.\n *\n * @param {Cartesian4} cartesian The vector or point to transform.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The transformed vector or point.\n */\nCamera.prototype.worldToCameraCoordinates = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(cartesian)) {\n    throw new DeveloperError(\"cartesian is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian4();\n  }\n  updateMembers(this);\n  return Matrix4.multiplyByVector(this._actualInvTransform, cartesian, result);\n};\n\n/**\n * Transform a point from world coordinates to the camera's reference frame.\n *\n * @param {Cartesian3} cartesian The point to transform.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The transformed point.\n */\nCamera.prototype.worldToCameraCoordinatesPoint = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(cartesian)) {\n    throw new DeveloperError(\"cartesian is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n  updateMembers(this);\n  return Matrix4.multiplyByPoint(this._actualInvTransform, cartesian, result);\n};\n\n/**\n * Transform a vector from world coordinates to the camera's reference frame.\n *\n * @param {Cartesian3} cartesian The vector to transform.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The transformed vector.\n */\nCamera.prototype.worldToCameraCoordinatesVector = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(cartesian)) {\n    throw new DeveloperError(\"cartesian is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n  updateMembers(this);\n  return Matrix4.multiplyByPointAsVector(\n    this._actualInvTransform,\n    cartesian,\n    result\n  );\n};\n\n/**\n * Transform a vector or point from the camera's reference frame to world coordinates.\n *\n * @param {Cartesian4} cartesian The vector or point to transform.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The transformed vector or point.\n */\nCamera.prototype.cameraToWorldCoordinates = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(cartesian)) {\n    throw new DeveloperError(\"cartesian is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian4();\n  }\n  updateMembers(this);\n  return Matrix4.multiplyByVector(this._actualTransform, cartesian, result);\n};\n\n/**\n * Transform a point from the camera's reference frame to world coordinates.\n *\n * @param {Cartesian3} cartesian The point to transform.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The transformed point.\n */\nCamera.prototype.cameraToWorldCoordinatesPoint = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(cartesian)) {\n    throw new DeveloperError(\"cartesian is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n  updateMembers(this);\n  return Matrix4.multiplyByPoint(this._actualTransform, cartesian, result);\n};\n\n/**\n * Transform a vector from the camera's reference frame to world coordinates.\n *\n * @param {Cartesian3} cartesian The vector to transform.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The transformed vector.\n */\nCamera.prototype.cameraToWorldCoordinatesVector = function (cartesian, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(cartesian)) {\n    throw new DeveloperError(\"cartesian is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n  updateMembers(this);\n  return Matrix4.multiplyByPointAsVector(\n    this._actualTransform,\n    cartesian,\n    result\n  );\n};\n\nfunction clampMove2D(camera, position) {\n  const rotatable2D = camera._scene.mapMode2D === MapMode2D.ROTATE;\n  const maxProjectedX = camera._maxCoord.x;\n  const maxProjectedY = camera._maxCoord.y;\n\n  let minX;\n  let maxX;\n  if (rotatable2D) {\n    maxX = maxProjectedX;\n    minX = -maxX;\n  } else {\n    maxX = position.x - maxProjectedX * 2.0;\n    minX = position.x + maxProjectedX * 2.0;\n  }\n\n  if (position.x > maxProjectedX) {\n    position.x = maxX;\n  }\n  if (position.x < -maxProjectedX) {\n    position.x = minX;\n  }\n\n  if (position.y > maxProjectedY) {\n    position.y = maxProjectedY;\n  }\n  if (position.y < -maxProjectedY) {\n    position.y = -maxProjectedY;\n  }\n}\n\nconst moveScratch = new Cartesian3();\n/**\n * Translates the camera's position by <code>amount</code> along <code>direction</code>.\n *\n * @param {Cartesian3} direction The direction to move.\n * @param {number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.\n *\n * @see Camera#moveBackward\n * @see Camera#moveForward\n * @see Camera#moveLeft\n * @see Camera#moveRight\n * @see Camera#moveUp\n * @see Camera#moveDown\n */\nCamera.prototype.move = function (direction, amount) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(direction)) {\n    throw new DeveloperError(\"direction is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const cameraPosition = this.position;\n  Cartesian3.multiplyByScalar(direction, amount, moveScratch);\n  Cartesian3.add(cameraPosition, moveScratch, cameraPosition);\n\n  if (this._mode === SceneMode.SCENE2D) {\n    clampMove2D(this, cameraPosition);\n  }\n  this._adjustOrthographicFrustum(true);\n};\n\n/**\n * Translates the camera's position by <code>amount</code> along the camera's view vector.\n * When in 2D mode, this will zoom in the camera instead of translating the camera's position.\n *\n * @param {number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.\n *\n * @see Camera#moveBackward\n */\nCamera.prototype.moveForward = function (amount) {\n  amount = defaultValue(amount, this.defaultMoveAmount);\n\n  if (this._mode === SceneMode.SCENE2D) {\n    // 2D mode\n    zoom2D(this, amount);\n  } else {\n    // 3D or Columbus view mode\n    this.move(this.direction, amount);\n  }\n};\n\n/**\n * Translates the camera's position by <code>amount</code> along the opposite direction\n * of the camera's view vector.\n * When in 2D mode, this will zoom out the camera instead of translating the camera's position.\n *\n * @param {number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.\n *\n * @see Camera#moveForward\n */\nCamera.prototype.moveBackward = function (amount) {\n  amount = defaultValue(amount, this.defaultMoveAmount);\n\n  if (this._mode === SceneMode.SCENE2D) {\n    // 2D mode\n    zoom2D(this, -amount);\n  } else {\n    // 3D or Columbus view mode\n    this.move(this.direction, -amount);\n  }\n};\n\n/**\n * Translates the camera's position by <code>amount</code> along the camera's up vector.\n *\n * @param {number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.\n *\n * @see Camera#moveDown\n */\nCamera.prototype.moveUp = function (amount) {\n  amount = defaultValue(amount, this.defaultMoveAmount);\n  this.move(this.up, amount);\n};\n\n/**\n * Translates the camera's position by <code>amount</code> along the opposite direction\n * of the camera's up vector.\n *\n * @param {number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.\n *\n * @see Camera#moveUp\n */\nCamera.prototype.moveDown = function (amount) {\n  amount = defaultValue(amount, this.defaultMoveAmount);\n  this.move(this.up, -amount);\n};\n\n/**\n * Translates the camera's position by <code>amount</code> along the camera's right vector.\n *\n * @param {number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.\n *\n * @see Camera#moveLeft\n */\nCamera.prototype.moveRight = function (amount) {\n  amount = defaultValue(amount, this.defaultMoveAmount);\n  this.move(this.right, amount);\n};\n\n/**\n * Translates the camera's position by <code>amount</code> along the opposite direction\n * of the camera's right vector.\n *\n * @param {number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.\n *\n * @see Camera#moveRight\n */\nCamera.prototype.moveLeft = function (amount) {\n  amount = defaultValue(amount, this.defaultMoveAmount);\n  this.move(this.right, -amount);\n};\n\n/**\n * Rotates the camera around its up vector by amount, in radians, in the opposite direction\n * of its right vector if not in 2D mode.\n *\n * @param {number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.\n *\n * @see Camera#lookRight\n */\nCamera.prototype.lookLeft = function (amount) {\n  amount = defaultValue(amount, this.defaultLookAmount);\n\n  // only want view of map to change in 3D mode, 2D visual is incorrect when look changes\n  if (this._mode !== SceneMode.SCENE2D) {\n    this.look(this.up, -amount);\n  }\n};\n\n/**\n * Rotates the camera around its up vector by amount, in radians, in the direction\n * of its right vector if not in 2D mode.\n *\n * @param {number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.\n *\n * @see Camera#lookLeft\n */\nCamera.prototype.lookRight = function (amount) {\n  amount = defaultValue(amount, this.defaultLookAmount);\n\n  // only want view of map to change in 3D mode, 2D visual is incorrect when look changes\n  if (this._mode !== SceneMode.SCENE2D) {\n    this.look(this.up, amount);\n  }\n};\n\n/**\n * Rotates the camera around its right vector by amount, in radians, in the direction\n * of its up vector if not in 2D mode.\n *\n * @param {number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.\n *\n * @see Camera#lookDown\n */\nCamera.prototype.lookUp = function (amount) {\n  amount = defaultValue(amount, this.defaultLookAmount);\n\n  // only want view of map to change in 3D mode, 2D visual is incorrect when look changes\n  if (this._mode !== SceneMode.SCENE2D) {\n    this.look(this.right, -amount);\n  }\n};\n\n/**\n * Rotates the camera around its right vector by amount, in radians, in the opposite direction\n * of its up vector if not in 2D mode.\n *\n * @param {number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.\n *\n * @see Camera#lookUp\n */\nCamera.prototype.lookDown = function (amount) {\n  amount = defaultValue(amount, this.defaultLookAmount);\n\n  // only want view of map to change in 3D mode, 2D visual is incorrect when look changes\n  if (this._mode !== SceneMode.SCENE2D) {\n    this.look(this.right, amount);\n  }\n};\n\nconst lookScratchQuaternion = new Quaternion();\nconst lookScratchMatrix = new Matrix3();\n/**\n * Rotate each of the camera's orientation vectors around <code>axis</code> by <code>angle</code>\n *\n * @param {Cartesian3} axis The axis to rotate around.\n * @param {number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.\n *\n * @see Camera#lookUp\n * @see Camera#lookDown\n * @see Camera#lookLeft\n * @see Camera#lookRight\n */\nCamera.prototype.look = function (axis, angle) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(axis)) {\n    throw new DeveloperError(\"axis is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const turnAngle = defaultValue(angle, this.defaultLookAmount);\n  const quaternion = Quaternion.fromAxisAngle(\n    axis,\n    -turnAngle,\n    lookScratchQuaternion\n  );\n  const rotation = Matrix3.fromQuaternion(quaternion, lookScratchMatrix);\n\n  const direction = this.direction;\n  const up = this.up;\n  const right = this.right;\n\n  Matrix3.multiplyByVector(rotation, direction, direction);\n  Matrix3.multiplyByVector(rotation, up, up);\n  Matrix3.multiplyByVector(rotation, right, right);\n};\n\n/**\n * Rotate the camera counter-clockwise around its direction vector by amount, in radians.\n *\n * @param {number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.\n *\n * @see Camera#twistRight\n */\nCamera.prototype.twistLeft = function (amount) {\n  amount = defaultValue(amount, this.defaultLookAmount);\n  this.look(this.direction, amount);\n};\n\n/**\n * Rotate the camera clockwise around its direction vector by amount, in radians.\n *\n * @param {number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.\n *\n * @see Camera#twistLeft\n */\nCamera.prototype.twistRight = function (amount) {\n  amount = defaultValue(amount, this.defaultLookAmount);\n  this.look(this.direction, -amount);\n};\n\nconst rotateScratchQuaternion = new Quaternion();\nconst rotateScratchMatrix = new Matrix3();\n/**\n * Rotates the camera around <code>axis</code> by <code>angle</code>. The distance\n * of the camera's position to the center of the camera's reference frame remains the same.\n *\n * @param {Cartesian3} axis The axis to rotate around given in world coordinates.\n * @param {number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.\n *\n * @see Camera#rotateUp\n * @see Camera#rotateDown\n * @see Camera#rotateLeft\n * @see Camera#rotateRight\n */\nCamera.prototype.rotate = function (axis, angle) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(axis)) {\n    throw new DeveloperError(\"axis is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const turnAngle = defaultValue(angle, this.defaultRotateAmount);\n  const quaternion = Quaternion.fromAxisAngle(\n    axis,\n    -turnAngle,\n    rotateScratchQuaternion\n  );\n  const rotation = Matrix3.fromQuaternion(quaternion, rotateScratchMatrix);\n  Matrix3.multiplyByVector(rotation, this.position, this.position);\n  Matrix3.multiplyByVector(rotation, this.direction, this.direction);\n  Matrix3.multiplyByVector(rotation, this.up, this.up);\n  Cartesian3.cross(this.direction, this.up, this.right);\n  Cartesian3.cross(this.right, this.direction, this.up);\n\n  this._adjustOrthographicFrustum(false);\n};\n\n/**\n * Rotates the camera around the center of the camera's reference frame by angle downwards.\n *\n * @param {number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.\n *\n * @see Camera#rotateUp\n * @see Camera#rotate\n */\nCamera.prototype.rotateDown = function (angle) {\n  angle = defaultValue(angle, this.defaultRotateAmount);\n  rotateVertical(this, angle);\n};\n\n/**\n * Rotates the camera around the center of the camera's reference frame by angle upwards.\n *\n * @param {number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.\n *\n * @see Camera#rotateDown\n * @see Camera#rotate\n */\nCamera.prototype.rotateUp = function (angle) {\n  angle = defaultValue(angle, this.defaultRotateAmount);\n  rotateVertical(this, -angle);\n};\n\nconst rotateVertScratchP = new Cartesian3();\nconst rotateVertScratchA = new Cartesian3();\nconst rotateVertScratchTan = new Cartesian3();\nconst rotateVertScratchNegate = new Cartesian3();\nfunction rotateVertical(camera, angle) {\n  const position = camera.position;\n  if (\n    defined(camera.constrainedAxis) &&\n    !Cartesian3.equalsEpsilon(\n      camera.position,\n      Cartesian3.ZERO,\n      CesiumMath.EPSILON2\n    )\n  ) {\n    const p = Cartesian3.normalize(position, rotateVertScratchP);\n    const northParallel = Cartesian3.equalsEpsilon(\n      p,\n      camera.constrainedAxis,\n      CesiumMath.EPSILON2\n    );\n    const southParallel = Cartesian3.equalsEpsilon(\n      p,\n      Cartesian3.negate(camera.constrainedAxis, rotateVertScratchNegate),\n      CesiumMath.EPSILON2\n    );\n    if (!northParallel && !southParallel) {\n      const constrainedAxis = Cartesian3.normalize(\n        camera.constrainedAxis,\n        rotateVertScratchA\n      );\n\n      let dot = Cartesian3.dot(p, constrainedAxis);\n      let angleToAxis = CesiumMath.acosClamped(dot);\n      if (angle > 0 && angle > angleToAxis) {\n        angle = angleToAxis - CesiumMath.EPSILON4;\n      }\n\n      dot = Cartesian3.dot(\n        p,\n        Cartesian3.negate(constrainedAxis, rotateVertScratchNegate)\n      );\n      angleToAxis = CesiumMath.acosClamped(dot);\n      if (angle < 0 && -angle > angleToAxis) {\n        angle = -angleToAxis + CesiumMath.EPSILON4;\n      }\n\n      const tangent = Cartesian3.cross(\n        constrainedAxis,\n        p,\n        rotateVertScratchTan\n      );\n      camera.rotate(tangent, angle);\n    } else if ((northParallel && angle < 0) || (southParallel && angle > 0)) {\n      camera.rotate(camera.right, angle);\n    }\n  } else {\n    camera.rotate(camera.right, angle);\n  }\n}\n\n/**\n * Rotates the camera around the center of the camera's reference frame by angle to the right.\n *\n * @param {number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.\n *\n * @see Camera#rotateLeft\n * @see Camera#rotate\n */\nCamera.prototype.rotateRight = function (angle) {\n  angle = defaultValue(angle, this.defaultRotateAmount);\n  rotateHorizontal(this, -angle);\n};\n\n/**\n * Rotates the camera around the center of the camera's reference frame by angle to the left.\n *\n * @param {number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.\n *\n * @see Camera#rotateRight\n * @see Camera#rotate\n */\nCamera.prototype.rotateLeft = function (angle) {\n  angle = defaultValue(angle, this.defaultRotateAmount);\n  rotateHorizontal(this, angle);\n};\n\nfunction rotateHorizontal(camera, angle) {\n  if (defined(camera.constrainedAxis)) {\n    camera.rotate(camera.constrainedAxis, angle);\n  } else {\n    camera.rotate(camera.up, angle);\n  }\n}\n\nfunction zoom2D(camera, amount) {\n  const frustum = camera.frustum;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    !(frustum instanceof OrthographicOffCenterFrustum) ||\n    !defined(frustum.left) ||\n    !defined(frustum.right) ||\n    !defined(frustum.bottom) ||\n    !defined(frustum.top)\n  ) {\n    throw new DeveloperError(\n      \"The camera frustum is expected to be orthographic for 2D camera control.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  let ratio;\n  amount = amount * 0.5;\n\n  if (\n    Math.abs(frustum.top) + Math.abs(frustum.bottom) >\n    Math.abs(frustum.left) + Math.abs(frustum.right)\n  ) {\n    let newTop = frustum.top - amount;\n    let newBottom = frustum.bottom + amount;\n\n    let maxBottom = camera._maxCoord.y;\n    if (camera._scene.mapMode2D === MapMode2D.ROTATE) {\n      maxBottom *= camera.maximumZoomFactor;\n    }\n\n    if (newBottom > maxBottom) {\n      newBottom = maxBottom;\n      newTop = -maxBottom;\n    }\n\n    if (newTop <= newBottom) {\n      newTop = 1.0;\n      newBottom = -1.0;\n    }\n\n    ratio = frustum.right / frustum.top;\n    frustum.top = newTop;\n    frustum.bottom = newBottom;\n    frustum.right = frustum.top * ratio;\n    frustum.left = -frustum.right;\n  } else {\n    let newRight = frustum.right - amount;\n    let newLeft = frustum.left + amount;\n\n    let maxRight = camera._maxCoord.x;\n    if (camera._scene.mapMode2D === MapMode2D.ROTATE) {\n      maxRight *= camera.maximumZoomFactor;\n    }\n\n    if (newRight > maxRight) {\n      newRight = maxRight;\n      newLeft = -maxRight;\n    }\n\n    if (newRight <= newLeft) {\n      newRight = 1.0;\n      newLeft = -1.0;\n    }\n    ratio = frustum.top / frustum.right;\n    frustum.right = newRight;\n    frustum.left = newLeft;\n    frustum.top = frustum.right * ratio;\n    frustum.bottom = -frustum.top;\n  }\n}\n\nfunction zoom3D(camera, amount) {\n  camera.move(camera.direction, amount);\n}\n\n/**\n * Zooms <code>amount</code> along the camera's view vector.\n *\n * @param {number} [amount] The amount to move. Defaults to <code>defaultZoomAmount</code>.\n *\n * @see Camera#zoomOut\n */\nCamera.prototype.zoomIn = function (amount) {\n  amount = defaultValue(amount, this.defaultZoomAmount);\n  if (this._mode === SceneMode.SCENE2D) {\n    zoom2D(this, amount);\n  } else {\n    zoom3D(this, amount);\n  }\n};\n\n/**\n * Zooms <code>amount</code> along the opposite direction of\n * the camera's view vector.\n *\n * @param {number} [amount] The amount to move. Defaults to <code>defaultZoomAmount</code>.\n *\n * @see Camera#zoomIn\n */\nCamera.prototype.zoomOut = function (amount) {\n  amount = defaultValue(amount, this.defaultZoomAmount);\n  if (this._mode === SceneMode.SCENE2D) {\n    zoom2D(this, -amount);\n  } else {\n    zoom3D(this, -amount);\n  }\n};\n\n/**\n * Gets the magnitude of the camera position. In 3D, this is the vector magnitude. In 2D and\n * Columbus view, this is the distance to the map.\n *\n * @returns {number} The magnitude of the position.\n */\nCamera.prototype.getMagnitude = function () {\n  if (this._mode === SceneMode.SCENE3D) {\n    return Cartesian3.magnitude(this.position);\n  } else if (this._mode === SceneMode.COLUMBUS_VIEW) {\n    return Math.abs(this.position.z);\n  } else if (this._mode === SceneMode.SCENE2D) {\n    return Math.max(\n      this.frustum.right - this.frustum.left,\n      this.frustum.top - this.frustum.bottom\n    );\n  }\n};\n\nconst scratchLookAtMatrix4 = new Matrix4();\n\n/**\n * Sets the camera position and orientation using a target and offset. The target must be given in\n * world coordinates. The offset can be either a cartesian or heading/pitch/range in the local east-north-up reference frame centered at the target.\n * If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset\n * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.\n * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch\n * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.\n *\n * In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the\n * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be\n * determined from the offset, the heading will be north.\n *\n * @param {Cartesian3} target The target position in world coordinates.\n * @param {Cartesian3|HeadingPitchRange} offset The offset from the target in the local east-north-up reference frame centered at the target.\n *\n * @exception {DeveloperError} lookAt is not supported while morphing.\n *\n * @example\n * // 1. Using a cartesian offset\n * const center = Cesium.Cartesian3.fromDegrees(-98.0, 40.0);\n * viewer.camera.lookAt(center, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));\n *\n * // 2. Using a HeadingPitchRange offset\n * const center = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);\n * const heading = Cesium.Math.toRadians(50.0);\n * const pitch = Cesium.Math.toRadians(-20.0);\n * const range = 5000.0;\n * viewer.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range));\n */\nCamera.prototype.lookAt = function (target, offset) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(target)) {\n    throw new DeveloperError(\"target is required\");\n  }\n  if (!defined(offset)) {\n    throw new DeveloperError(\"offset is required\");\n  }\n  if (this._mode === SceneMode.MORPHING) {\n    throw new DeveloperError(\"lookAt is not supported while morphing.\");\n  }\n  //>>includeEnd('debug');\n\n  const transform = Transforms.eastNorthUpToFixedFrame(\n    target,\n    Ellipsoid.WGS84,\n    scratchLookAtMatrix4\n  );\n  this.lookAtTransform(transform, offset);\n};\n\nconst scratchLookAtHeadingPitchRangeOffset = new Cartesian3();\nconst scratchLookAtHeadingPitchRangeQuaternion1 = new Quaternion();\nconst scratchLookAtHeadingPitchRangeQuaternion2 = new Quaternion();\nconst scratchHeadingPitchRangeMatrix3 = new Matrix3();\n\nfunction offsetFromHeadingPitchRange(heading, pitch, range) {\n  pitch = CesiumMath.clamp(\n    pitch,\n    -CesiumMath.PI_OVER_TWO,\n    CesiumMath.PI_OVER_TWO\n  );\n  heading = CesiumMath.zeroToTwoPi(heading) - CesiumMath.PI_OVER_TWO;\n\n  const pitchQuat = Quaternion.fromAxisAngle(\n    Cartesian3.UNIT_Y,\n    -pitch,\n    scratchLookAtHeadingPitchRangeQuaternion1\n  );\n  const headingQuat = Quaternion.fromAxisAngle(\n    Cartesian3.UNIT_Z,\n    -heading,\n    scratchLookAtHeadingPitchRangeQuaternion2\n  );\n  const rotQuat = Quaternion.multiply(headingQuat, pitchQuat, headingQuat);\n  const rotMatrix = Matrix3.fromQuaternion(\n    rotQuat,\n    scratchHeadingPitchRangeMatrix3\n  );\n\n  const offset = Cartesian3.clone(\n    Cartesian3.UNIT_X,\n    scratchLookAtHeadingPitchRangeOffset\n  );\n  Matrix3.multiplyByVector(rotMatrix, offset, offset);\n  Cartesian3.negate(offset, offset);\n  Cartesian3.multiplyByScalar(offset, range, offset);\n  return offset;\n}\n\n/**\n * Sets the camera position and orientation using a target and transformation matrix. The offset can be either a cartesian or heading/pitch/range.\n * If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset\n * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.\n * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch\n * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.\n *\n * In 2D, there must be a top down view. The camera will be placed above the center of the reference frame. The height above the\n * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be\n * determined from the offset, the heading will be north.\n *\n * @param {Matrix4} transform The transformation matrix defining the reference frame.\n * @param {Cartesian3|HeadingPitchRange} [offset] The offset from the target in a reference frame centered at the target.\n *\n * @exception {DeveloperError} lookAtTransform is not supported while morphing.\n *\n * @example\n * // 1. Using a cartesian offset\n * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-98.0, 40.0));\n * viewer.camera.lookAtTransform(transform, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));\n *\n * // 2. Using a HeadingPitchRange offset\n * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-72.0, 40.0));\n * const heading = Cesium.Math.toRadians(50.0);\n * const pitch = Cesium.Math.toRadians(-20.0);\n * const range = 5000.0;\n * viewer.camera.lookAtTransform(transform, new Cesium.HeadingPitchRange(heading, pitch, range));\n */\nCamera.prototype.lookAtTransform = function (transform, offset) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(transform)) {\n    throw new DeveloperError(\"transform is required\");\n  }\n  if (this._mode === SceneMode.MORPHING) {\n    throw new DeveloperError(\n      \"lookAtTransform is not supported while morphing.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._setTransform(transform);\n  if (!defined(offset)) {\n    return;\n  }\n\n  let cartesianOffset;\n  if (defined(offset.heading)) {\n    cartesianOffset = offsetFromHeadingPitchRange(\n      offset.heading,\n      offset.pitch,\n      offset.range\n    );\n  } else {\n    cartesianOffset = offset;\n  }\n\n  if (this._mode === SceneMode.SCENE2D) {\n    Cartesian2.clone(Cartesian2.ZERO, this.position);\n\n    Cartesian3.negate(cartesianOffset, this.up);\n    this.up.z = 0.0;\n\n    if (Cartesian3.magnitudeSquared(this.up) < CesiumMath.EPSILON10) {\n      Cartesian3.clone(Cartesian3.UNIT_Y, this.up);\n    }\n\n    Cartesian3.normalize(this.up, this.up);\n\n    this._setTransform(Matrix4.IDENTITY);\n\n    Cartesian3.negate(Cartesian3.UNIT_Z, this.direction);\n    Cartesian3.cross(this.direction, this.up, this.right);\n    Cartesian3.normalize(this.right, this.right);\n\n    const frustum = this.frustum;\n    const ratio = frustum.top / frustum.right;\n    frustum.right = Cartesian3.magnitude(cartesianOffset) * 0.5;\n    frustum.left = -frustum.right;\n    frustum.top = ratio * frustum.right;\n    frustum.bottom = -frustum.top;\n\n    this._setTransform(transform);\n\n    return;\n  }\n\n  Cartesian3.clone(cartesianOffset, this.position);\n  Cartesian3.negate(this.position, this.direction);\n  Cartesian3.normalize(this.direction, this.direction);\n  Cartesian3.cross(this.direction, Cartesian3.UNIT_Z, this.right);\n\n  if (Cartesian3.magnitudeSquared(this.right) < CesiumMath.EPSILON10) {\n    Cartesian3.clone(Cartesian3.UNIT_X, this.right);\n  }\n\n  Cartesian3.normalize(this.right, this.right);\n  Cartesian3.cross(this.right, this.direction, this.up);\n  Cartesian3.normalize(this.up, this.up);\n\n  this._adjustOrthographicFrustum(true);\n};\n\nconst viewRectangle3DCartographic1 = new Cartographic();\nconst viewRectangle3DCartographic2 = new Cartographic();\nconst viewRectangle3DNorthEast = new Cartesian3();\nconst viewRectangle3DSouthWest = new Cartesian3();\nconst viewRectangle3DNorthWest = new Cartesian3();\nconst viewRectangle3DSouthEast = new Cartesian3();\nconst viewRectangle3DNorthCenter = new Cartesian3();\nconst viewRectangle3DSouthCenter = new Cartesian3();\nconst viewRectangle3DCenter = new Cartesian3();\nconst viewRectangle3DEquator = new Cartesian3();\nconst defaultRF = {\n  direction: new Cartesian3(),\n  right: new Cartesian3(),\n  up: new Cartesian3(),\n};\nlet viewRectangle3DEllipsoidGeodesic;\n\nfunction computeD(direction, upOrRight, corner, tanThetaOrPhi) {\n  const opposite = Math.abs(Cartesian3.dot(upOrRight, corner));\n  return opposite / tanThetaOrPhi - Cartesian3.dot(direction, corner);\n}\n\nfunction rectangleCameraPosition3D(camera, rectangle, result, updateCamera) {\n  const ellipsoid = camera._projection.ellipsoid;\n  const cameraRF = updateCamera ? camera : defaultRF;\n\n  const north = rectangle.north;\n  const south = rectangle.south;\n  let east = rectangle.east;\n  const west = rectangle.west;\n\n  // If we go across the International Date Line\n  if (west > east) {\n    east += CesiumMath.TWO_PI;\n  }\n\n  // Find the midpoint latitude.\n  //\n  // EllipsoidGeodesic will fail if the north and south edges are very close to being on opposite sides of the ellipsoid.\n  // Ideally we'd just call EllipsoidGeodesic.setEndPoints and let it throw when it detects this case, but sadly it doesn't\n  // even look for this case in optimized builds, so we have to test for it here instead.\n  //\n  // Fortunately, this case can only happen (here) when north is very close to the north pole and south is very close to the south pole,\n  // so handle it just by using 0 latitude as the center.  It's certainliy possible to use a smaller tolerance\n  // than one degree here, but one degree is safe and putting the center at 0 latitude should be good enough for any\n  // rectangle that spans 178+ of the 180 degrees of latitude.\n  const longitude = (west + east) * 0.5;\n  let latitude;\n  if (\n    south < -CesiumMath.PI_OVER_TWO + CesiumMath.RADIANS_PER_DEGREE &&\n    north > CesiumMath.PI_OVER_TWO - CesiumMath.RADIANS_PER_DEGREE\n  ) {\n    latitude = 0.0;\n  } else {\n    const northCartographic = viewRectangle3DCartographic1;\n    northCartographic.longitude = longitude;\n    northCartographic.latitude = north;\n    northCartographic.height = 0.0;\n\n    const southCartographic = viewRectangle3DCartographic2;\n    southCartographic.longitude = longitude;\n    southCartographic.latitude = south;\n    southCartographic.height = 0.0;\n\n    let ellipsoidGeodesic = viewRectangle3DEllipsoidGeodesic;\n    if (\n      !defined(ellipsoidGeodesic) ||\n      ellipsoidGeodesic.ellipsoid !== ellipsoid\n    ) {\n      viewRectangle3DEllipsoidGeodesic = ellipsoidGeodesic = new EllipsoidGeodesic(\n        undefined,\n        undefined,\n        ellipsoid\n      );\n    }\n\n    ellipsoidGeodesic.setEndPoints(northCartographic, southCartographic);\n    latitude = ellipsoidGeodesic.interpolateUsingFraction(\n      0.5,\n      viewRectangle3DCartographic1\n    ).latitude;\n  }\n\n  const centerCartographic = viewRectangle3DCartographic1;\n  centerCartographic.longitude = longitude;\n  centerCartographic.latitude = latitude;\n  centerCartographic.height = 0.0;\n\n  const center = ellipsoid.cartographicToCartesian(\n    centerCartographic,\n    viewRectangle3DCenter\n  );\n\n  const cart = viewRectangle3DCartographic1;\n  cart.longitude = east;\n  cart.latitude = north;\n  const northEast = ellipsoid.cartographicToCartesian(\n    cart,\n    viewRectangle3DNorthEast\n  );\n  cart.longitude = west;\n  const northWest = ellipsoid.cartographicToCartesian(\n    cart,\n    viewRectangle3DNorthWest\n  );\n  cart.longitude = longitude;\n  const northCenter = ellipsoid.cartographicToCartesian(\n    cart,\n    viewRectangle3DNorthCenter\n  );\n  cart.latitude = south;\n  const southCenter = ellipsoid.cartographicToCartesian(\n    cart,\n    viewRectangle3DSouthCenter\n  );\n  cart.longitude = east;\n  const southEast = ellipsoid.cartographicToCartesian(\n    cart,\n    viewRectangle3DSouthEast\n  );\n  cart.longitude = west;\n  const southWest = ellipsoid.cartographicToCartesian(\n    cart,\n    viewRectangle3DSouthWest\n  );\n\n  Cartesian3.subtract(northWest, center, northWest);\n  Cartesian3.subtract(southEast, center, southEast);\n  Cartesian3.subtract(northEast, center, northEast);\n  Cartesian3.subtract(southWest, center, southWest);\n  Cartesian3.subtract(northCenter, center, northCenter);\n  Cartesian3.subtract(southCenter, center, southCenter);\n\n  const direction = ellipsoid.geodeticSurfaceNormal(center, cameraRF.direction);\n  Cartesian3.negate(direction, direction);\n  const right = Cartesian3.cross(direction, Cartesian3.UNIT_Z, cameraRF.right);\n  Cartesian3.normalize(right, right);\n  const up = Cartesian3.cross(right, direction, cameraRF.up);\n\n  let d;\n  if (camera.frustum instanceof OrthographicFrustum) {\n    const width = Math.max(\n      Cartesian3.distance(northEast, northWest),\n      Cartesian3.distance(southEast, southWest)\n    );\n    const height = Math.max(\n      Cartesian3.distance(northEast, southEast),\n      Cartesian3.distance(northWest, southWest)\n    );\n\n    let rightScalar;\n    let topScalar;\n    const offCenterFrustum = camera.frustum._offCenterFrustum;\n    const ratio = offCenterFrustum.right / offCenterFrustum.top;\n    const heightRatio = height * ratio;\n    if (width > heightRatio) {\n      rightScalar = width;\n      topScalar = rightScalar / ratio;\n    } else {\n      topScalar = height;\n      rightScalar = heightRatio;\n    }\n\n    d = Math.max(rightScalar, topScalar);\n  } else {\n    const tanPhi = Math.tan(camera.frustum.fovy * 0.5);\n    const tanTheta = camera.frustum.aspectRatio * tanPhi;\n\n    d = Math.max(\n      computeD(direction, up, northWest, tanPhi),\n      computeD(direction, up, southEast, tanPhi),\n      computeD(direction, up, northEast, tanPhi),\n      computeD(direction, up, southWest, tanPhi),\n      computeD(direction, up, northCenter, tanPhi),\n      computeD(direction, up, southCenter, tanPhi),\n      computeD(direction, right, northWest, tanTheta),\n      computeD(direction, right, southEast, tanTheta),\n      computeD(direction, right, northEast, tanTheta),\n      computeD(direction, right, southWest, tanTheta),\n      computeD(direction, right, northCenter, tanTheta),\n      computeD(direction, right, southCenter, tanTheta)\n    );\n\n    // If the rectangle crosses the equator, compute D at the equator, too, because that's the\n    // widest part of the rectangle when projected onto the globe.\n    if (south < 0 && north > 0) {\n      const equatorCartographic = viewRectangle3DCartographic1;\n      equatorCartographic.longitude = west;\n      equatorCartographic.latitude = 0.0;\n      equatorCartographic.height = 0.0;\n      let equatorPosition = ellipsoid.cartographicToCartesian(\n        equatorCartographic,\n        viewRectangle3DEquator\n      );\n      Cartesian3.subtract(equatorPosition, center, equatorPosition);\n      d = Math.max(\n        d,\n        computeD(direction, up, equatorPosition, tanPhi),\n        computeD(direction, right, equatorPosition, tanTheta)\n      );\n\n      equatorCartographic.longitude = east;\n      equatorPosition = ellipsoid.cartographicToCartesian(\n        equatorCartographic,\n        viewRectangle3DEquator\n      );\n      Cartesian3.subtract(equatorPosition, center, equatorPosition);\n      d = Math.max(\n        d,\n        computeD(direction, up, equatorPosition, tanPhi),\n        computeD(direction, right, equatorPosition, tanTheta)\n      );\n    }\n  }\n\n  return Cartesian3.add(\n    center,\n    Cartesian3.multiplyByScalar(direction, -d, viewRectangle3DEquator),\n    result\n  );\n}\n\nconst viewRectangleCVCartographic = new Cartographic();\nconst viewRectangleCVNorthEast = new Cartesian3();\nconst viewRectangleCVSouthWest = new Cartesian3();\nfunction rectangleCameraPositionColumbusView(camera, rectangle, result) {\n  const projection = camera._projection;\n  if (rectangle.west > rectangle.east) {\n    rectangle = Rectangle.MAX_VALUE;\n  }\n  const transform = camera._actualTransform;\n  const invTransform = camera._actualInvTransform;\n\n  const cart = viewRectangleCVCartographic;\n  cart.longitude = rectangle.east;\n  cart.latitude = rectangle.north;\n  const northEast = projection.project(cart, viewRectangleCVNorthEast);\n  Matrix4.multiplyByPoint(transform, northEast, northEast);\n  Matrix4.multiplyByPoint(invTransform, northEast, northEast);\n\n  cart.longitude = rectangle.west;\n  cart.latitude = rectangle.south;\n  const southWest = projection.project(cart, viewRectangleCVSouthWest);\n  Matrix4.multiplyByPoint(transform, southWest, southWest);\n  Matrix4.multiplyByPoint(invTransform, southWest, southWest);\n\n  result.x = (northEast.x - southWest.x) * 0.5 + southWest.x;\n  result.y = (northEast.y - southWest.y) * 0.5 + southWest.y;\n\n  if (defined(camera.frustum.fovy)) {\n    const tanPhi = Math.tan(camera.frustum.fovy * 0.5);\n    const tanTheta = camera.frustum.aspectRatio * tanPhi;\n    result.z =\n      Math.max(\n        (northEast.x - southWest.x) / tanTheta,\n        (northEast.y - southWest.y) / tanPhi\n      ) * 0.5;\n  } else {\n    const width = northEast.x - southWest.x;\n    const height = northEast.y - southWest.y;\n    result.z = Math.max(width, height);\n  }\n\n  return result;\n}\n\nconst viewRectangle2DCartographic = new Cartographic();\nconst viewRectangle2DNorthEast = new Cartesian3();\nconst viewRectangle2DSouthWest = new Cartesian3();\nfunction rectangleCameraPosition2D(camera, rectangle, result) {\n  const projection = camera._projection;\n\n  // Account for the rectangle crossing the International Date Line in 2D mode\n  let east = rectangle.east;\n  if (rectangle.west > rectangle.east) {\n    if (camera._scene.mapMode2D === MapMode2D.INFINITE_SCROLL) {\n      east += CesiumMath.TWO_PI;\n    } else {\n      rectangle = Rectangle.MAX_VALUE;\n      east = rectangle.east;\n    }\n  }\n\n  let cart = viewRectangle2DCartographic;\n  cart.longitude = east;\n  cart.latitude = rectangle.north;\n  const northEast = projection.project(cart, viewRectangle2DNorthEast);\n  cart.longitude = rectangle.west;\n  cart.latitude = rectangle.south;\n  const southWest = projection.project(cart, viewRectangle2DSouthWest);\n\n  const width = Math.abs(northEast.x - southWest.x) * 0.5;\n  let height = Math.abs(northEast.y - southWest.y) * 0.5;\n\n  let right, top;\n  const ratio = camera.frustum.right / camera.frustum.top;\n  const heightRatio = height * ratio;\n  if (width > heightRatio) {\n    right = width;\n    top = right / ratio;\n  } else {\n    top = height;\n    right = heightRatio;\n  }\n\n  height = Math.max(2.0 * right, 2.0 * top);\n\n  result.x = (northEast.x - southWest.x) * 0.5 + southWest.x;\n  result.y = (northEast.y - southWest.y) * 0.5 + southWest.y;\n\n  cart = projection.unproject(result, cart);\n  cart.height = height;\n  result = projection.project(cart, result);\n\n  return result;\n}\n\n/**\n * Get the camera position needed to view a rectangle on an ellipsoid or map\n *\n * @param {Rectangle} rectangle The rectangle to view.\n * @param {Cartesian3} [result] The camera position needed to view the rectangle\n * @returns {Cartesian3} The camera position needed to view the rectangle\n */\nCamera.prototype.getRectangleCameraCoordinates = function (rectangle, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(rectangle)) {\n    throw new DeveloperError(\"rectangle is required\");\n  }\n  //>>includeEnd('debug');\n  const mode = this._mode;\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  if (mode === SceneMode.SCENE3D) {\n    return rectangleCameraPosition3D(this, rectangle, result);\n  } else if (mode === SceneMode.COLUMBUS_VIEW) {\n    return rectangleCameraPositionColumbusView(this, rectangle, result);\n  } else if (mode === SceneMode.SCENE2D) {\n    return rectangleCameraPosition2D(this, rectangle, result);\n  }\n\n  return undefined;\n};\n\nconst pickEllipsoid3DRay = new Ray();\nfunction pickEllipsoid3D(camera, windowPosition, ellipsoid, result) {\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n  const ray = camera.getPickRay(windowPosition, pickEllipsoid3DRay);\n  const intersection = IntersectionTests.rayEllipsoid(ray, ellipsoid);\n  if (!intersection) {\n    return undefined;\n  }\n\n  const t = intersection.start > 0.0 ? intersection.start : intersection.stop;\n  return Ray.getPoint(ray, t, result);\n}\n\nconst pickEllipsoid2DRay = new Ray();\nfunction pickMap2D(camera, windowPosition, projection, result) {\n  const ray = camera.getPickRay(windowPosition, pickEllipsoid2DRay);\n  let position = ray.origin;\n  position = Cartesian3.fromElements(position.y, position.z, 0.0, position);\n  const cart = projection.unproject(position);\n\n  if (\n    cart.latitude < -CesiumMath.PI_OVER_TWO ||\n    cart.latitude > CesiumMath.PI_OVER_TWO\n  ) {\n    return undefined;\n  }\n\n  return projection.ellipsoid.cartographicToCartesian(cart, result);\n}\n\nconst pickEllipsoidCVRay = new Ray();\nfunction pickMapColumbusView(camera, windowPosition, projection, result) {\n  const ray = camera.getPickRay(windowPosition, pickEllipsoidCVRay);\n  const scalar = -ray.origin.x / ray.direction.x;\n  Ray.getPoint(ray, scalar, result);\n\n  const cart = projection.unproject(new Cartesian3(result.y, result.z, 0.0));\n\n  if (\n    cart.latitude < -CesiumMath.PI_OVER_TWO ||\n    cart.latitude > CesiumMath.PI_OVER_TWO ||\n    cart.longitude < -Math.PI ||\n    cart.longitude > Math.PI\n  ) {\n    return undefined;\n  }\n\n  return projection.ellipsoid.cartographicToCartesian(cart, result);\n}\n\n/**\n * Pick an ellipsoid or map.\n *\n * @param {Cartesian2} windowPosition The x and y coordinates of a pixel.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to pick.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3 | undefined} If the ellipsoid or map was picked,\n * returns the point on the surface of the ellipsoid or map in world\n * coordinates. If the ellipsoid or map was not picked, returns undefined.\n *\n * @example\n * const canvas = viewer.scene.canvas;\n * const center = new Cesium.Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0);\n * const ellipsoid = viewer.scene.globe.ellipsoid;\n * const result = viewer.camera.pickEllipsoid(center, ellipsoid);\n */\nCamera.prototype.pickEllipsoid = function (windowPosition, ellipsoid, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(windowPosition)) {\n    throw new DeveloperError(\"windowPosition is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const canvas = this._scene.canvas;\n  if (canvas.clientWidth === 0 || canvas.clientHeight === 0) {\n    return undefined;\n  }\n\n  if (!defined(result)) {\n    result = new Cartesian3();\n  }\n\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n  if (this._mode === SceneMode.SCENE3D) {\n    result = pickEllipsoid3D(this, windowPosition, ellipsoid, result);\n  } else if (this._mode === SceneMode.SCENE2D) {\n    result = pickMap2D(this, windowPosition, this._projection, result);\n  } else if (this._mode === SceneMode.COLUMBUS_VIEW) {\n    result = pickMapColumbusView(\n      this,\n      windowPosition,\n      this._projection,\n      result\n    );\n  } else {\n    return undefined;\n  }\n\n  return result;\n};\n\nconst pickPerspCenter = new Cartesian3();\nconst pickPerspXDir = new Cartesian3();\nconst pickPerspYDir = new Cartesian3();\nfunction getPickRayPerspective(camera, windowPosition, result) {\n  const canvas = camera._scene.canvas;\n  const width = canvas.clientWidth;\n  const height = canvas.clientHeight;\n\n  const tanPhi = Math.tan(camera.frustum.fovy * 0.5);\n  const tanTheta = camera.frustum.aspectRatio * tanPhi;\n  const near = camera.frustum.near;\n\n  const x = (2.0 / width) * windowPosition.x - 1.0;\n  const y = (2.0 / height) * (height - windowPosition.y) - 1.0;\n\n  const position = camera.positionWC;\n  Cartesian3.clone(position, result.origin);\n\n  const nearCenter = Cartesian3.multiplyByScalar(\n    camera.directionWC,\n    near,\n    pickPerspCenter\n  );\n  Cartesian3.add(position, nearCenter, nearCenter);\n  const xDir = Cartesian3.multiplyByScalar(\n    camera.rightWC,\n    x * near * tanTheta,\n    pickPerspXDir\n  );\n  const yDir = Cartesian3.multiplyByScalar(\n    camera.upWC,\n    y * near * tanPhi,\n    pickPerspYDir\n  );\n  const direction = Cartesian3.add(nearCenter, xDir, result.direction);\n  Cartesian3.add(direction, yDir, direction);\n  Cartesian3.subtract(direction, position, direction);\n  Cartesian3.normalize(direction, direction);\n\n  return result;\n}\n\nconst scratchDirection = new Cartesian3();\n\nfunction getPickRayOrthographic(camera, windowPosition, result) {\n  const canvas = camera._scene.canvas;\n  const width = canvas.clientWidth;\n  const height = canvas.clientHeight;\n\n  let frustum = camera.frustum;\n  const offCenterFrustum = frustum.offCenterFrustum;\n  if (defined(offCenterFrustum)) {\n    frustum = offCenterFrustum;\n  }\n  let x = (2.0 / width) * windowPosition.x - 1.0;\n  x *= (frustum.right - frustum.left) * 0.5;\n  let y = (2.0 / height) * (height - windowPosition.y) - 1.0;\n  y *= (frustum.top - frustum.bottom) * 0.5;\n\n  const origin = result.origin;\n  Cartesian3.clone(camera.position, origin);\n\n  Cartesian3.multiplyByScalar(camera.right, x, scratchDirection);\n  Cartesian3.add(scratchDirection, origin, origin);\n  Cartesian3.multiplyByScalar(camera.up, y, scratchDirection);\n  Cartesian3.add(scratchDirection, origin, origin);\n\n  Cartesian3.clone(camera.directionWC, result.direction);\n\n  if (\n    camera._mode === SceneMode.COLUMBUS_VIEW ||\n    camera._mode === SceneMode.SCENE2D\n  ) {\n    Cartesian3.fromElements(\n      result.origin.z,\n      result.origin.x,\n      result.origin.y,\n      result.origin\n    );\n  }\n\n  return result;\n}\n\n/**\n * Create a ray from the camera position through the pixel at <code>windowPosition</code>\n * in world coordinates.\n *\n * @param {Cartesian2} windowPosition The x and y coordinates of a pixel.\n * @param {Ray} [result] The object onto which to store the result.\n * @returns {Ray|undefined} Returns the {@link Cartesian3} position and direction of the ray, or undefined if the pick ray cannot be determined.\n */\nCamera.prototype.getPickRay = function (windowPosition, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(windowPosition)) {\n    throw new DeveloperError(\"windowPosition is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = new Ray();\n  }\n\n  const canvas = this._scene.canvas;\n  if (canvas.clientWidth <= 0 || canvas.clientHeight <= 0) {\n    return undefined;\n  }\n\n  const frustum = this.frustum;\n  if (\n    defined(frustum.aspectRatio) &&\n    defined(frustum.fov) &&\n    defined(frustum.near)\n  ) {\n    return getPickRayPerspective(this, windowPosition, result);\n  }\n\n  return getPickRayOrthographic(this, windowPosition, result);\n};\n\nconst scratchToCenter = new Cartesian3();\nconst scratchProj = new Cartesian3();\n\n/**\n * Return the distance from the camera to the front of the bounding sphere.\n *\n * @param {BoundingSphere} boundingSphere The bounding sphere in world coordinates.\n * @returns {number} The distance to the bounding sphere.\n */\nCamera.prototype.distanceToBoundingSphere = function (boundingSphere) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(boundingSphere)) {\n    throw new DeveloperError(\"boundingSphere is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const toCenter = Cartesian3.subtract(\n    this.positionWC,\n    boundingSphere.center,\n    scratchToCenter\n  );\n  const proj = Cartesian3.multiplyByScalar(\n    this.directionWC,\n    Cartesian3.dot(toCenter, this.directionWC),\n    scratchProj\n  );\n  return Math.max(0.0, Cartesian3.magnitude(proj) - boundingSphere.radius);\n};\n\nconst scratchPixelSize = new Cartesian2();\n\n/**\n * Return the pixel size in meters.\n *\n * @param {BoundingSphere} boundingSphere The bounding sphere in world coordinates.\n * @param {number} drawingBufferWidth The drawing buffer width.\n * @param {number} drawingBufferHeight The drawing buffer height.\n * @returns {number} The pixel size in meters.\n */\nCamera.prototype.getPixelSize = function (\n  boundingSphere,\n  drawingBufferWidth,\n  drawingBufferHeight\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(boundingSphere)) {\n    throw new DeveloperError(\"boundingSphere is required.\");\n  }\n  if (!defined(drawingBufferWidth)) {\n    throw new DeveloperError(\"drawingBufferWidth is required.\");\n  }\n  if (!defined(drawingBufferHeight)) {\n    throw new DeveloperError(\"drawingBufferHeight is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const distance = this.distanceToBoundingSphere(boundingSphere);\n  const pixelSize = this.frustum.getPixelDimensions(\n    drawingBufferWidth,\n    drawingBufferHeight,\n    distance,\n    this._scene.pixelRatio,\n    scratchPixelSize\n  );\n  return Math.max(pixelSize.x, pixelSize.y);\n};\n\nfunction createAnimationTemplateCV(\n  camera,\n  position,\n  center,\n  maxX,\n  maxY,\n  duration\n) {\n  const newPosition = Cartesian3.clone(position);\n\n  if (center.y > maxX) {\n    newPosition.y -= center.y - maxX;\n  } else if (center.y < -maxX) {\n    newPosition.y += -maxX - center.y;\n  }\n\n  if (center.z > maxY) {\n    newPosition.z -= center.z - maxY;\n  } else if (center.z < -maxY) {\n    newPosition.z += -maxY - center.z;\n  }\n\n  function updateCV(value) {\n    const interp = Cartesian3.lerp(\n      position,\n      newPosition,\n      value.time,\n      new Cartesian3()\n    );\n    camera.worldToCameraCoordinatesPoint(interp, camera.position);\n  }\n  return {\n    easingFunction: EasingFunction.EXPONENTIAL_OUT,\n    startObject: {\n      time: 0.0,\n    },\n    stopObject: {\n      time: 1.0,\n    },\n    duration: duration,\n    update: updateCV,\n  };\n}\n\nconst normalScratch = new Cartesian3();\nconst centerScratch = new Cartesian3();\nconst posScratch = new Cartesian3();\nconst scratchCartesian3Subtract = new Cartesian3();\n\nfunction createAnimationCV(camera, duration) {\n  let position = camera.position;\n  const direction = camera.direction;\n\n  const normal = camera.worldToCameraCoordinatesVector(\n    Cartesian3.UNIT_X,\n    normalScratch\n  );\n  const scalar =\n    -Cartesian3.dot(normal, position) / Cartesian3.dot(normal, direction);\n  const center = Cartesian3.add(\n    position,\n    Cartesian3.multiplyByScalar(direction, scalar, centerScratch),\n    centerScratch\n  );\n  camera.cameraToWorldCoordinatesPoint(center, center);\n\n  position = camera.cameraToWorldCoordinatesPoint(camera.position, posScratch);\n\n  const tanPhi = Math.tan(camera.frustum.fovy * 0.5);\n  const tanTheta = camera.frustum.aspectRatio * tanPhi;\n  const distToC = Cartesian3.magnitude(\n    Cartesian3.subtract(position, center, scratchCartesian3Subtract)\n  );\n  const dWidth = tanTheta * distToC;\n  const dHeight = tanPhi * distToC;\n\n  const mapWidth = camera._maxCoord.x;\n  const mapHeight = camera._maxCoord.y;\n\n  const maxX = Math.max(dWidth - mapWidth, mapWidth);\n  const maxY = Math.max(dHeight - mapHeight, mapHeight);\n\n  if (\n    position.z < -maxX ||\n    position.z > maxX ||\n    position.y < -maxY ||\n    position.y > maxY\n  ) {\n    const translateX = center.y < -maxX || center.y > maxX;\n    const translateY = center.z < -maxY || center.z > maxY;\n    if (translateX || translateY) {\n      return createAnimationTemplateCV(\n        camera,\n        position,\n        center,\n        maxX,\n        maxY,\n        duration\n      );\n    }\n  }\n\n  return undefined;\n}\n\n/**\n * Create an animation to move the map into view. This method is only valid for 2D and Columbus modes.\n *\n * @param {number} duration The duration, in seconds, of the animation.\n * @returns {object} The animation or undefined if the scene mode is 3D or the map is already ion view.\n *\n * @private\n */\nCamera.prototype.createCorrectPositionTween = function (duration) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(duration)) {\n    throw new DeveloperError(\"duration is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (this._mode === SceneMode.COLUMBUS_VIEW) {\n    return createAnimationCV(this, duration);\n  }\n\n  return undefined;\n};\n\nconst scratchFlyToDestination = new Cartesian3();\nconst newOptions = {\n  destination: undefined,\n  heading: undefined,\n  pitch: undefined,\n  roll: undefined,\n  duration: undefined,\n  complete: undefined,\n  cancel: undefined,\n  endTransform: undefined,\n  maximumHeight: undefined,\n  easingFunction: undefined,\n};\n\n/**\n * Cancels the current camera flight and leaves the camera at its current location.\n * If no flight is in progress, this this function does nothing.\n */\nCamera.prototype.cancelFlight = function () {\n  if (defined(this._currentFlight)) {\n    this._currentFlight.cancelTween();\n    this._currentFlight = undefined;\n  }\n};\n\n/**\n * Completes the current camera flight and moves the camera immediately to its final destination.\n * If no flight is in progress, this this function does nothing.\n */\nCamera.prototype.completeFlight = function () {\n  if (defined(this._currentFlight)) {\n    this._currentFlight.cancelTween();\n\n    const options = {\n      destination: undefined,\n      orientation: {\n        heading: undefined,\n        pitch: undefined,\n        roll: undefined,\n      },\n    };\n\n    options.destination = newOptions.destination;\n    options.orientation.heading = newOptions.heading;\n    options.orientation.pitch = newOptions.pitch;\n    options.orientation.roll = newOptions.roll;\n\n    this.setView(options);\n\n    if (defined(this._currentFlight.complete)) {\n      this._currentFlight.complete();\n    }\n\n    this._currentFlight = undefined;\n  }\n};\n\n/**\n * Flies the camera from its current position to a new position.\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3|Rectangle} options.destination The final position of the camera in WGS84 (world) coordinates or a rectangle that would be visible from a top-down view.\n * @param {object} [options.orientation] An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point\n * towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive\n * y direction in Columbus view.  Orientation is not used in 2D when in infinite scrolling mode.\n * @param {number} [options.duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight.\n * @param {Camera.FlightCompleteCallback} [options.complete] The function to execute when the flight is complete.\n * @param {Camera.FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled.\n * @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame the camera will be in when the flight is completed.\n * @param {number} [options.maximumHeight] The maximum height at the peak of the flight.\n * @param {number} [options.pitchAdjustHeight] If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.\n * @param {number} [options.flyOverLongitude] There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude.\n * @param {number} [options.flyOverLongitudeWeight] Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.\n * @param {boolean} [options.convert] Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to <code>true</code>.\n * @param {EasingFunction.Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight.\n *\n * @exception {DeveloperError} If either direction or up is given, then both are required.\n *\n * @example\n * // 1. Fly to a position with a top-down view\n * viewer.camera.flyTo({\n *     destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)\n * });\n *\n * // 2. Fly to a Rectangle with a top-down view\n * viewer.camera.flyTo({\n *     destination : Cesium.Rectangle.fromDegrees(west, south, east, north)\n * });\n *\n * // 3. Fly to a position with an orientation using unit vectors.\n * viewer.camera.flyTo({\n *     destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),\n *     orientation : {\n *         direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),\n *         up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)\n *     }\n * });\n *\n * // 4. Fly to a position with an orientation using heading, pitch and roll.\n * viewer.camera.flyTo({\n *     destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),\n *     orientation : {\n *         heading : Cesium.Math.toRadians(175.0),\n *         pitch : Cesium.Math.toRadians(-35.0),\n *         roll : 0.0\n *     }\n * });\n */\nCamera.prototype.flyTo = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  let destination = options.destination;\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(destination)) {\n    throw new DeveloperError(\"destination is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const mode = this._mode;\n  if (mode === SceneMode.MORPHING) {\n    return;\n  }\n\n  this.cancelFlight();\n\n  const isRectangle = destination instanceof Rectangle;\n  if (isRectangle) {\n    destination = this.getRectangleCameraCoordinates(\n      destination,\n      scratchFlyToDestination\n    );\n  }\n\n  let orientation = defaultValue(\n    options.orientation,\n    defaultValue.EMPTY_OBJECT\n  );\n  if (defined(orientation.direction)) {\n    orientation = directionUpToHeadingPitchRoll(\n      this,\n      destination,\n      orientation,\n      scratchSetViewOptions.orientation\n    );\n  }\n\n  if (defined(options.duration) && options.duration <= 0.0) {\n    const setViewOptions = scratchSetViewOptions;\n    setViewOptions.destination = options.destination;\n    setViewOptions.orientation.heading = orientation.heading;\n    setViewOptions.orientation.pitch = orientation.pitch;\n    setViewOptions.orientation.roll = orientation.roll;\n    setViewOptions.convert = options.convert;\n    setViewOptions.endTransform = options.endTransform;\n    this.setView(setViewOptions);\n    if (typeof options.complete === \"function\") {\n      options.complete();\n    }\n    return;\n  }\n\n  const that = this;\n  /* eslint-disable-next-line prefer-const */\n  let flightTween;\n\n  newOptions.destination = destination;\n  newOptions.heading = orientation.heading;\n  newOptions.pitch = orientation.pitch;\n  newOptions.roll = orientation.roll;\n  newOptions.duration = options.duration;\n  newOptions.complete = function () {\n    if (flightTween === that._currentFlight) {\n      that._currentFlight = undefined;\n    }\n    if (defined(options.complete)) {\n      options.complete();\n    }\n  };\n  newOptions.cancel = options.cancel;\n  newOptions.endTransform = options.endTransform;\n  newOptions.convert = isRectangle ? false : options.convert;\n  newOptions.maximumHeight = options.maximumHeight;\n  newOptions.pitchAdjustHeight = options.pitchAdjustHeight;\n  newOptions.flyOverLongitude = options.flyOverLongitude;\n  newOptions.flyOverLongitudeWeight = options.flyOverLongitudeWeight;\n  newOptions.easingFunction = options.easingFunction;\n\n  const scene = this._scene;\n  const tweenOptions = CameraFlightPath.createTween(scene, newOptions);\n  // If the camera doesn't actually need to go anywhere, duration\n  // will be 0 and we can just complete the current flight.\n  if (tweenOptions.duration === 0) {\n    if (typeof tweenOptions.complete === \"function\") {\n      tweenOptions.complete();\n    }\n    return;\n  }\n  flightTween = scene.tweens.add(tweenOptions);\n  this._currentFlight = flightTween;\n\n  // Save the final destination view information for the PRELOAD_FLIGHT pass.\n  let preloadFlightCamera = this._scene.preloadFlightCamera;\n  if (this._mode !== SceneMode.SCENE2D) {\n    if (!defined(preloadFlightCamera)) {\n      preloadFlightCamera = Camera.clone(this);\n    }\n    preloadFlightCamera.setView({\n      destination: destination,\n      orientation: orientation,\n    });\n\n    this._scene.preloadFlightCullingVolume = preloadFlightCamera.frustum.computeCullingVolume(\n      preloadFlightCamera.positionWC,\n      preloadFlightCamera.directionWC,\n      preloadFlightCamera.upWC\n    );\n  }\n};\n\nfunction distanceToBoundingSphere3D(camera, radius) {\n  const frustum = camera.frustum;\n  const tanPhi = Math.tan(frustum.fovy * 0.5);\n  const tanTheta = frustum.aspectRatio * tanPhi;\n  return Math.max(radius / tanTheta, radius / tanPhi);\n}\n\nfunction distanceToBoundingSphere2D(camera, radius) {\n  let frustum = camera.frustum;\n  const offCenterFrustum = frustum.offCenterFrustum;\n  if (defined(offCenterFrustum)) {\n    frustum = offCenterFrustum;\n  }\n\n  let right, top;\n  const ratio = frustum.right / frustum.top;\n  const heightRatio = radius * ratio;\n  if (radius > heightRatio) {\n    right = radius;\n    top = right / ratio;\n  } else {\n    top = radius;\n    right = heightRatio;\n  }\n\n  return Math.max(right, top) * 1.5;\n}\n\nconst MINIMUM_ZOOM = 100.0;\n\nfunction adjustBoundingSphereOffset(camera, boundingSphere, offset) {\n  offset = HeadingPitchRange.clone(\n    defined(offset) ? offset : Camera.DEFAULT_OFFSET\n  );\n\n  const minimumZoom =\n    camera._scene.screenSpaceCameraController.minimumZoomDistance;\n  const maximumZoom =\n    camera._scene.screenSpaceCameraController.maximumZoomDistance;\n  const range = offset.range;\n  if (!defined(range) || range === 0.0) {\n    const radius = boundingSphere.radius;\n    if (radius === 0.0) {\n      offset.range = MINIMUM_ZOOM;\n    } else if (\n      camera.frustum instanceof OrthographicFrustum ||\n      camera._mode === SceneMode.SCENE2D\n    ) {\n      offset.range = distanceToBoundingSphere2D(camera, radius);\n    } else {\n      offset.range = distanceToBoundingSphere3D(camera, radius);\n    }\n    offset.range = CesiumMath.clamp(offset.range, minimumZoom, maximumZoom);\n  }\n\n  return offset;\n}\n\n/**\n * Sets the camera so that the current view contains the provided bounding sphere.\n *\n * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.\n * The heading and the pitch angles are defined in the local east-north-up reference frame.\n * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch\n * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is\n * zero, a range will be computed such that the whole bounding sphere is visible.</p>\n *\n * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the\n * target will be the range. The heading will be determined from the offset. If the heading cannot be\n * determined from the offset, the heading will be north.</p>\n *\n * @param {BoundingSphere} boundingSphere The bounding sphere to view, in world coordinates.\n * @param {HeadingPitchRange} [offset] The offset from the target in the local east-north-up reference frame centered at the target.\n *\n * @exception {DeveloperError} viewBoundingSphere is not supported while morphing.\n */\nCamera.prototype.viewBoundingSphere = function (boundingSphere, offset) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(boundingSphere)) {\n    throw new DeveloperError(\"boundingSphere is required.\");\n  }\n\n  if (this._mode === SceneMode.MORPHING) {\n    throw new DeveloperError(\n      \"viewBoundingSphere is not supported while morphing.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  offset = adjustBoundingSphereOffset(this, boundingSphere, offset);\n  this.lookAt(boundingSphere.center, offset);\n};\n\nconst scratchflyToBoundingSphereTransform = new Matrix4();\nconst scratchflyToBoundingSphereDestination = new Cartesian3();\nconst scratchflyToBoundingSphereDirection = new Cartesian3();\nconst scratchflyToBoundingSphereUp = new Cartesian3();\nconst scratchflyToBoundingSphereRight = new Cartesian3();\nconst scratchFlyToBoundingSphereCart4 = new Cartesian4();\nconst scratchFlyToBoundingSphereQuaternion = new Quaternion();\nconst scratchFlyToBoundingSphereMatrix3 = new Matrix3();\n\n/**\n * Flies the camera to a location where the current view contains the provided bounding sphere.\n *\n * <p> The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.\n * The heading and the pitch angles are defined in the local east-north-up reference frame.\n * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch\n * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is\n * zero, a range will be computed such that the whole bounding sphere is visible.</p>\n *\n * <p>In 2D and Columbus View, there must be a top down view. The camera will be placed above the target looking down. The height above the\n * target will be the range. The heading will be aligned to local north.</p>\n *\n * @param {BoundingSphere} boundingSphere The bounding sphere to view, in world coordinates.\n * @param {object} [options] Object with the following properties:\n * @param {number} [options.duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight.\n * @param {HeadingPitchRange} [options.offset] The offset from the target in the local east-north-up reference frame centered at the target.\n * @param {Camera.FlightCompleteCallback} [options.complete] The function to execute when the flight is complete.\n * @param {Camera.FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled.\n * @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame the camera will be in when the flight is completed.\n * @param {number} [options.maximumHeight] The maximum height at the peak of the flight.\n * @param {number} [options.pitchAdjustHeight] If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.\n * @param {number} [options.flyOverLongitude] There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude.\n * @param {number} [options.flyOverLongitudeWeight] Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.\n * @param {EasingFunction.Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight.\n */\nCamera.prototype.flyToBoundingSphere = function (boundingSphere, options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(boundingSphere)) {\n    throw new DeveloperError(\"boundingSphere is required.\");\n  }\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const scene2D =\n    this._mode === SceneMode.SCENE2D || this._mode === SceneMode.COLUMBUS_VIEW;\n  this._setTransform(Matrix4.IDENTITY);\n  const offset = adjustBoundingSphereOffset(\n    this,\n    boundingSphere,\n    options.offset\n  );\n\n  let position;\n  if (scene2D) {\n    position = Cartesian3.multiplyByScalar(\n      Cartesian3.UNIT_Z,\n      offset.range,\n      scratchflyToBoundingSphereDestination\n    );\n  } else {\n    position = offsetFromHeadingPitchRange(\n      offset.heading,\n      offset.pitch,\n      offset.range\n    );\n  }\n\n  const transform = Transforms.eastNorthUpToFixedFrame(\n    boundingSphere.center,\n    Ellipsoid.WGS84,\n    scratchflyToBoundingSphereTransform\n  );\n  Matrix4.multiplyByPoint(transform, position, position);\n\n  let direction;\n  let up;\n\n  if (!scene2D) {\n    direction = Cartesian3.subtract(\n      boundingSphere.center,\n      position,\n      scratchflyToBoundingSphereDirection\n    );\n    Cartesian3.normalize(direction, direction);\n\n    up = Matrix4.multiplyByPointAsVector(\n      transform,\n      Cartesian3.UNIT_Z,\n      scratchflyToBoundingSphereUp\n    );\n    if (1.0 - Math.abs(Cartesian3.dot(direction, up)) < CesiumMath.EPSILON6) {\n      const rotateQuat = Quaternion.fromAxisAngle(\n        direction,\n        offset.heading,\n        scratchFlyToBoundingSphereQuaternion\n      );\n      const rotation = Matrix3.fromQuaternion(\n        rotateQuat,\n        scratchFlyToBoundingSphereMatrix3\n      );\n\n      Cartesian3.fromCartesian4(\n        Matrix4.getColumn(transform, 1, scratchFlyToBoundingSphereCart4),\n        up\n      );\n      Matrix3.multiplyByVector(rotation, up, up);\n    }\n\n    const right = Cartesian3.cross(\n      direction,\n      up,\n      scratchflyToBoundingSphereRight\n    );\n    Cartesian3.cross(right, direction, up);\n    Cartesian3.normalize(up, up);\n  }\n\n  this.flyTo({\n    destination: position,\n    orientation: {\n      direction: direction,\n      up: up,\n    },\n    duration: options.duration,\n    complete: options.complete,\n    cancel: options.cancel,\n    endTransform: options.endTransform,\n    maximumHeight: options.maximumHeight,\n    easingFunction: options.easingFunction,\n    flyOverLongitude: options.flyOverLongitude,\n    flyOverLongitudeWeight: options.flyOverLongitudeWeight,\n    pitchAdjustHeight: options.pitchAdjustHeight,\n  });\n};\n\nconst scratchCartesian3_1 = new Cartesian3();\nconst scratchCartesian3_2 = new Cartesian3();\nconst scratchCartesian3_3 = new Cartesian3();\nconst scratchCartesian3_4 = new Cartesian3();\nconst horizonPoints = [\n  new Cartesian3(),\n  new Cartesian3(),\n  new Cartesian3(),\n  new Cartesian3(),\n];\n\nfunction computeHorizonQuad(camera, ellipsoid) {\n  const radii = ellipsoid.radii;\n  const p = camera.positionWC;\n\n  // Find the corresponding position in the scaled space of the ellipsoid.\n  const q = Cartesian3.multiplyComponents(\n    ellipsoid.oneOverRadii,\n    p,\n    scratchCartesian3_1\n  );\n\n  const qMagnitude = Cartesian3.magnitude(q);\n  const qUnit = Cartesian3.normalize(q, scratchCartesian3_2);\n\n  // Determine the east and north directions at q.\n  let eUnit;\n  let nUnit;\n  if (\n    Cartesian3.equalsEpsilon(qUnit, Cartesian3.UNIT_Z, CesiumMath.EPSILON10)\n  ) {\n    eUnit = new Cartesian3(0, 1, 0);\n    nUnit = new Cartesian3(0, 0, 1);\n  } else {\n    eUnit = Cartesian3.normalize(\n      Cartesian3.cross(Cartesian3.UNIT_Z, qUnit, scratchCartesian3_3),\n      scratchCartesian3_3\n    );\n    nUnit = Cartesian3.normalize(\n      Cartesian3.cross(qUnit, eUnit, scratchCartesian3_4),\n      scratchCartesian3_4\n    );\n  }\n\n  // Determine the radius of the 'limb' of the ellipsoid.\n  const wMagnitude = Math.sqrt(Cartesian3.magnitudeSquared(q) - 1.0);\n\n  // Compute the center and offsets.\n  const center = Cartesian3.multiplyByScalar(\n    qUnit,\n    1.0 / qMagnitude,\n    scratchCartesian3_1\n  );\n  const scalar = wMagnitude / qMagnitude;\n  const eastOffset = Cartesian3.multiplyByScalar(\n    eUnit,\n    scalar,\n    scratchCartesian3_2\n  );\n  const northOffset = Cartesian3.multiplyByScalar(\n    nUnit,\n    scalar,\n    scratchCartesian3_3\n  );\n\n  // A conservative measure for the longitudes would be to use the min/max longitudes of the bounding frustum.\n  const upperLeft = Cartesian3.add(center, northOffset, horizonPoints[0]);\n  Cartesian3.subtract(upperLeft, eastOffset, upperLeft);\n  Cartesian3.multiplyComponents(radii, upperLeft, upperLeft);\n\n  const lowerLeft = Cartesian3.subtract(center, northOffset, horizonPoints[1]);\n  Cartesian3.subtract(lowerLeft, eastOffset, lowerLeft);\n  Cartesian3.multiplyComponents(radii, lowerLeft, lowerLeft);\n\n  const lowerRight = Cartesian3.subtract(center, northOffset, horizonPoints[2]);\n  Cartesian3.add(lowerRight, eastOffset, lowerRight);\n  Cartesian3.multiplyComponents(radii, lowerRight, lowerRight);\n\n  const upperRight = Cartesian3.add(center, northOffset, horizonPoints[3]);\n  Cartesian3.add(upperRight, eastOffset, upperRight);\n  Cartesian3.multiplyComponents(radii, upperRight, upperRight);\n\n  return horizonPoints;\n}\n\nconst scratchPickCartesian2 = new Cartesian2();\nconst scratchRectCartesian = new Cartesian3();\nconst cartoArray = [\n  new Cartographic(),\n  new Cartographic(),\n  new Cartographic(),\n  new Cartographic(),\n];\nfunction addToResult(x, y, index, camera, ellipsoid, computedHorizonQuad) {\n  scratchPickCartesian2.x = x;\n  scratchPickCartesian2.y = y;\n  const r = camera.pickEllipsoid(\n    scratchPickCartesian2,\n    ellipsoid,\n    scratchRectCartesian\n  );\n  if (defined(r)) {\n    cartoArray[index] = ellipsoid.cartesianToCartographic(r, cartoArray[index]);\n    return 1;\n  }\n  cartoArray[index] = ellipsoid.cartesianToCartographic(\n    computedHorizonQuad[index],\n    cartoArray[index]\n  );\n  return 0;\n}\n/**\n * Computes the approximate visible rectangle on the ellipsoid.\n *\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid that you want to know the visible region.\n * @param {Rectangle} [result] The rectangle in which to store the result\n *\n * @returns {Rectangle|undefined} The visible rectangle or undefined if the ellipsoid isn't visible at all.\n */\nCamera.prototype.computeViewRectangle = function (ellipsoid, result) {\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n  const cullingVolume = this.frustum.computeCullingVolume(\n    this.positionWC,\n    this.directionWC,\n    this.upWC\n  );\n  const boundingSphere = new BoundingSphere(\n    Cartesian3.ZERO,\n    ellipsoid.maximumRadius\n  );\n  const visibility = cullingVolume.computeVisibility(boundingSphere);\n  if (visibility === Intersect.OUTSIDE) {\n    return undefined;\n  }\n\n  const canvas = this._scene.canvas;\n  const width = canvas.clientWidth;\n  const height = canvas.clientHeight;\n\n  let successfulPickCount = 0;\n\n  const computedHorizonQuad = computeHorizonQuad(this, ellipsoid);\n\n  successfulPickCount += addToResult(\n    0,\n    0,\n    0,\n    this,\n    ellipsoid,\n    computedHorizonQuad\n  );\n  successfulPickCount += addToResult(\n    0,\n    height,\n    1,\n    this,\n    ellipsoid,\n    computedHorizonQuad\n  );\n  successfulPickCount += addToResult(\n    width,\n    height,\n    2,\n    this,\n    ellipsoid,\n    computedHorizonQuad\n  );\n  successfulPickCount += addToResult(\n    width,\n    0,\n    3,\n    this,\n    ellipsoid,\n    computedHorizonQuad\n  );\n\n  if (successfulPickCount < 2) {\n    // If we have space non-globe in 3 or 4 corners then return the whole globe\n    return Rectangle.MAX_VALUE;\n  }\n\n  result = Rectangle.fromCartographicArray(cartoArray, result);\n\n  // Detect if we go over the poles\n  let distance = 0;\n  let lastLon = cartoArray[3].longitude;\n  for (let i = 0; i < 4; ++i) {\n    const lon = cartoArray[i].longitude;\n    const diff = Math.abs(lon - lastLon);\n    if (diff > CesiumMath.PI) {\n      // Crossed the dateline\n      distance += CesiumMath.TWO_PI - diff;\n    } else {\n      distance += diff;\n    }\n\n    lastLon = lon;\n  }\n\n  // We are over one of the poles so adjust the rectangle accordingly\n  if (\n    CesiumMath.equalsEpsilon(\n      Math.abs(distance),\n      CesiumMath.TWO_PI,\n      CesiumMath.EPSILON9\n    )\n  ) {\n    result.west = -CesiumMath.PI;\n    result.east = CesiumMath.PI;\n    if (cartoArray[0].latitude >= 0.0) {\n      result.north = CesiumMath.PI_OVER_TWO;\n    } else {\n      result.south = -CesiumMath.PI_OVER_TWO;\n    }\n  }\n\n  return result;\n};\n\n/**\n * Switches the frustum/projection to perspective.\n *\n * This function is a no-op in 2D which must always be orthographic.\n */\nCamera.prototype.switchToPerspectiveFrustum = function () {\n  if (\n    this._mode === SceneMode.SCENE2D ||\n    this.frustum instanceof PerspectiveFrustum\n  ) {\n    return;\n  }\n\n  const scene = this._scene;\n  this.frustum = new PerspectiveFrustum();\n  this.frustum.aspectRatio =\n    scene.drawingBufferWidth / scene.drawingBufferHeight;\n  this.frustum.fov = CesiumMath.toRadians(60.0);\n};\n\n/**\n * Switches the frustum/projection to orthographic.\n *\n * This function is a no-op in 2D which will always be orthographic.\n */\nCamera.prototype.switchToOrthographicFrustum = function () {\n  if (\n    this._mode === SceneMode.SCENE2D ||\n    this.frustum instanceof OrthographicFrustum\n  ) {\n    return;\n  }\n\n  // This must be called before changing the frustum because it uses the previous\n  // frustum to reconstruct the world space position from the depth buffer.\n  const frustumWidth = calculateOrthographicFrustumWidth(this);\n\n  const scene = this._scene;\n  this.frustum = new OrthographicFrustum();\n  this.frustum.aspectRatio =\n    scene.drawingBufferWidth / scene.drawingBufferHeight;\n  this.frustum.width = frustumWidth;\n};\n\n/**\n * @private\n */\nCamera.clone = function (camera, result) {\n  if (!defined(result)) {\n    result = new Camera(camera._scene);\n  }\n\n  Cartesian3.clone(camera.position, result.position);\n  Cartesian3.clone(camera.direction, result.direction);\n  Cartesian3.clone(camera.up, result.up);\n  Cartesian3.clone(camera.right, result.right);\n  Matrix4.clone(camera._transform, result.transform);\n  result._transformChanged = true;\n  result.frustum = camera.frustum.clone();\n\n  return result;\n};\n\n/**\n * A function that will execute when a flight completes.\n * @callback Camera.FlightCompleteCallback\n */\n\n/**\n * A function that will execute when a flight is cancelled.\n * @callback Camera.FlightCancelledCallback\n */\nexport default Camera;\n", "import Check from \"../Core/Check.js\";\n\n/**\n * The state for a 3D Tiles update pass.\n *\n * @private\n * @constructor\n */\nfunction Cesium3DTilePassState(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options\", options);\n  Check.typeOf.number(\"options.pass\", options.pass);\n  //>>includeEnd('debug');\n\n  /**\n   * The pass.\n   *\n   * @type {Cesium3DTilePass}\n   */\n  this.pass = options.pass;\n\n  /**\n   * An array of rendering commands to use instead of {@link FrameState.commandList} for the current pass.\n   *\n   * @type {DrawCommand[]}\n   */\n  this.commandList = options.commandList;\n\n  /**\n   * A camera to use instead of {@link FrameState.camera} for the current pass.\n   *\n   * @type {Camera}\n   */\n  this.camera = options.camera;\n\n  /**\n   * A culling volume to use instead of {@link FrameState.cullingVolume} for the current pass.\n   *\n   * @type {CullingVolume}\n   */\n  this.cullingVolume = options.cullingVolume;\n\n  /**\n   * A read-only property that indicates whether the pass is ready, i.e. all tiles needed by the pass are loaded.\n   *\n   * @type {boolean}\n   * @readonly\n   * @default false\n   */\n  this.ready = false;\n}\nexport default Cesium3DTilePassState;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Check from \"../Core/Check.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Uri from \"urijs\";\n\nconst mobileWidth = 576;\nconst lightboxHeight = 100;\nconst textColor = \"#ffffff\";\nconst highlightColor = \"#48b\";\n\n/**\n * Used to sort the credits by frequency of appearance\n * when they are later displayed.\n *\n * @alias CreditDisplay.CreditDisplayElement\n * @constructor\n *\n * @private\n */\nfunction CreditDisplayElement(credit, count) {\n  this.credit = credit;\n  this.count = defaultValue(count, 1);\n}\n\nfunction contains(credits, credit) {\n  const len = credits.length;\n  for (let i = 0; i < len; i++) {\n    const existingCredit = credits[i];\n    if (Credit.equals(existingCredit, credit)) {\n      return true;\n    }\n  }\n  return false;\n}\n\nfunction swapCesiumCredit(creditDisplay) {\n  // We don't want to clutter the screen with the Cesium logo and the Cesium ion\n  // logo at the same time. Since the ion logo is required, we just replace the\n  // Cesium logo or add the logo if the Cesium one was removed.\n  const previousCredit = creditDisplay._previousCesiumCredit;\n  const currentCredit = creditDisplay._currentCesiumCredit;\n  if (Credit.equals(currentCredit, previousCredit)) {\n    return;\n  }\n\n  if (defined(previousCredit)) {\n    creditDisplay._cesiumCreditContainer.removeChild(previousCredit.element);\n  }\n  if (defined(currentCredit)) {\n    creditDisplay._cesiumCreditContainer.appendChild(currentCredit.element);\n  }\n\n  creditDisplay._previousCesiumCredit = currentCredit;\n}\n\nconst delimiterClassName = \"cesium-credit-delimiter\";\n\nfunction createDelimiterElement(delimiter) {\n  const delimiterElement = document.createElement(\"span\");\n  delimiterElement.textContent = delimiter;\n  delimiterElement.className = delimiterClassName;\n  return delimiterElement;\n}\n\nfunction createCreditElement(element, elementWrapperTagName) {\n  // may need to wrap the credit in another element\n  if (defined(elementWrapperTagName)) {\n    const wrapper = document.createElement(elementWrapperTagName);\n    wrapper._creditId = element._creditId;\n    wrapper.appendChild(element);\n    element = wrapper;\n  }\n  return element;\n}\n\nfunction displayCredits(container, credits, delimiter, elementWrapperTagName) {\n  const childNodes = container.childNodes;\n  let domIndex = -1;\n\n  // Sort the credits such that more frequent credits appear first\n  credits.sort(function (credit1, credit2) {\n    return credit2.count - credit1.count;\n  });\n\n  for (let creditIndex = 0; creditIndex < credits.length; ++creditIndex) {\n    const credit = credits[creditIndex].credit;\n    if (defined(credit)) {\n      domIndex = creditIndex;\n      if (defined(delimiter)) {\n        // credits may be separated by delimiters\n        domIndex *= 2;\n        if (creditIndex > 0) {\n          const delimiterDomIndex = domIndex - 1;\n          if (childNodes.length <= delimiterDomIndex) {\n            container.appendChild(createDelimiterElement(delimiter));\n          } else {\n            const existingDelimiter = childNodes[delimiterDomIndex];\n            if (existingDelimiter.className !== delimiterClassName) {\n              container.replaceChild(\n                createDelimiterElement(delimiter),\n                existingDelimiter\n              );\n            }\n          }\n        }\n      }\n\n      const element = credit.element;\n\n      // check to see if the correct credit is in the right place\n      if (childNodes.length <= domIndex) {\n        container.appendChild(\n          createCreditElement(element, elementWrapperTagName)\n        );\n      } else {\n        const existingElement = childNodes[domIndex];\n        if (existingElement._creditId !== credit._id) {\n          // not the right credit, swap it in\n          container.replaceChild(\n            createCreditElement(element, elementWrapperTagName),\n            existingElement\n          );\n        }\n      }\n    }\n  }\n\n  // any remaining nodes in the container are unnecessary\n  ++domIndex;\n  while (domIndex < childNodes.length) {\n    container.removeChild(childNodes[domIndex]);\n  }\n}\n\nfunction styleLightboxContainer(that) {\n  const lightboxCredits = that._lightboxCredits;\n  const width = that.viewport.clientWidth;\n  const height = that.viewport.clientHeight;\n  if (width !== that._lastViewportWidth) {\n    if (width < mobileWidth) {\n      lightboxCredits.className =\n        \"cesium-credit-lightbox cesium-credit-lightbox-mobile\";\n      lightboxCredits.style.marginTop = \"0\";\n    } else {\n      lightboxCredits.className =\n        \"cesium-credit-lightbox cesium-credit-lightbox-expanded\";\n      lightboxCredits.style.marginTop = `${Math.floor(\n        (height - lightboxCredits.clientHeight) * 0.5\n      )}px`;\n    }\n    that._lastViewportWidth = width;\n  }\n\n  if (width >= mobileWidth && height !== that._lastViewportHeight) {\n    lightboxCredits.style.marginTop = `${Math.floor(\n      (height - lightboxCredits.clientHeight) * 0.5\n    )}px`;\n    that._lastViewportHeight = height;\n  }\n}\n\nfunction addStyle(selector, styles) {\n  let style = `${selector} {`;\n  for (const attribute in styles) {\n    if (styles.hasOwnProperty(attribute)) {\n      style += `${attribute}: ${styles[attribute]}; `;\n    }\n  }\n  style += \" }\\n\";\n  return style;\n}\n\nfunction appendCss(container) {\n  let style = \"\";\n  style += addStyle(\".cesium-credit-lightbox-overlay\", {\n    display: \"none\",\n    \"z-index\": \"1\", //must be at least 1 to draw over top other Cesium widgets\n    position: \"absolute\",\n    top: \"0\",\n    left: \"0\",\n    width: \"100%\",\n    height: \"100%\",\n    \"background-color\": \"rgba(80, 80, 80, 0.8)\",\n  });\n\n  style += addStyle(\".cesium-credit-lightbox\", {\n    \"background-color\": \"#303336\",\n    color: textColor,\n    position: \"relative\",\n    \"min-height\": `${lightboxHeight}px`,\n    margin: \"auto\",\n  });\n\n  style += addStyle(\n    \".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited\",\n    {\n      color: textColor,\n    }\n  );\n\n  style += addStyle(\".cesium-credit-lightbox > ul > li a:hover\", {\n    color: highlightColor,\n  });\n\n  style += addStyle(\".cesium-credit-lightbox.cesium-credit-lightbox-expanded\", {\n    border: \"1px solid #444\",\n    \"border-radius\": \"5px\",\n    \"max-width\": \"370px\",\n  });\n\n  style += addStyle(\".cesium-credit-lightbox.cesium-credit-lightbox-mobile\", {\n    height: \"100%\",\n    width: \"100%\",\n  });\n\n  style += addStyle(\".cesium-credit-lightbox-title\", {\n    padding: \"20px 20px 0 20px\",\n  });\n\n  style += addStyle(\".cesium-credit-lightbox-close\", {\n    \"font-size\": \"18pt\",\n    cursor: \"pointer\",\n    position: \"absolute\",\n    top: \"0\",\n    right: \"6px\",\n    color: textColor,\n  });\n\n  style += addStyle(\".cesium-credit-lightbox-close:hover\", {\n    color: highlightColor,\n  });\n\n  style += addStyle(\".cesium-credit-lightbox > ul\", {\n    margin: \"0\",\n    padding: \"12px 20px 12px 40px\",\n    \"font-size\": \"13px\",\n  });\n\n  style += addStyle(\".cesium-credit-lightbox > ul > li\", {\n    \"padding-bottom\": \"6px\",\n  });\n\n  style += addStyle(\".cesium-credit-lightbox > ul > li *\", {\n    padding: \"0\",\n    margin: \"0\",\n  });\n\n  style += addStyle(\".cesium-credit-expand-link\", {\n    \"padding-left\": \"5px\",\n    cursor: \"pointer\",\n    \"text-decoration\": \"underline\",\n    color: textColor,\n  });\n  style += addStyle(\".cesium-credit-expand-link:hover\", {\n    color: highlightColor,\n  });\n\n  style += addStyle(\".cesium-credit-text\", {\n    color: textColor,\n  });\n\n  style += addStyle(\n    \".cesium-credit-textContainer *, .cesium-credit-logoContainer *\",\n    {\n      display: \"inline\",\n    }\n  );\n\n  function getShadowRoot(container) {\n    if (container.shadowRoot) {\n      return container.shadowRoot;\n    }\n    if (container.getRootNode) {\n      const root = container.getRootNode();\n      if (root instanceof ShadowRoot) {\n        return root;\n      }\n    }\n    return undefined;\n  }\n\n  const shadowRootOrDocumentHead = defaultValue(\n    getShadowRoot(container),\n    document.head\n  );\n  const css = document.createElement(\"style\");\n  css.innerHTML = style;\n  shadowRootOrDocumentHead.appendChild(css);\n}\n\n/**\n * The credit display is responsible for displaying credits on screen.\n *\n * @param {HTMLElement} container The HTML element where credits will be displayed\n * @param {string} [delimiter= ' \u2022 '] The string to separate text credits\n * @param {HTMLElement} [viewport=document.body] The HTML element that will contain the credits popup\n *\n * @alias CreditDisplay\n * @constructor\n *\n * @example\n * // Add a credit with a tooltip, image and link to display onscreen\n * const credit = new Cesium.Credit(`<a href=\"https://cesium.com/\" target=\"_blank\"><img src=\"/images/cesium_logo.png\" title=\"Cesium\"/></a>`, true);\n * viewer.creditDisplay.addStaticCredit(credit);\n *\n * @example\n * // Add a credit with a plaintext link to display in the lightbox\n * const credit = new Cesium.Credit('<a href=\"https://cesium.com/\" target=\"_blank\">Cesium</a>');\n * viewer.creditDisplay.addStaticCredit(credit);\n */\nfunction CreditDisplay(container, delimiter, viewport) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"container\", container);\n  //>>includeEnd('debug');\n  const that = this;\n\n  viewport = defaultValue(viewport, document.body);\n\n  const lightbox = document.createElement(\"div\");\n  lightbox.className = \"cesium-credit-lightbox-overlay\";\n  viewport.appendChild(lightbox);\n\n  const lightboxCredits = document.createElement(\"div\");\n  lightboxCredits.className = \"cesium-credit-lightbox\";\n  lightbox.appendChild(lightboxCredits);\n\n  function hideLightbox(event) {\n    if (lightboxCredits.contains(event.target)) {\n      return;\n    }\n    that.hideLightbox();\n  }\n  lightbox.addEventListener(\"click\", hideLightbox, false);\n\n  const title = document.createElement(\"div\");\n  title.className = \"cesium-credit-lightbox-title\";\n  title.textContent = \"Data provided by:\";\n  lightboxCredits.appendChild(title);\n\n  const closeButton = document.createElement(\"a\");\n  closeButton.onclick = this.hideLightbox.bind(this);\n  closeButton.innerHTML = \"&times;\";\n  closeButton.className = \"cesium-credit-lightbox-close\";\n  lightboxCredits.appendChild(closeButton);\n\n  const creditList = document.createElement(\"ul\");\n  lightboxCredits.appendChild(creditList);\n\n  const cesiumCreditContainer = document.createElement(\"div\");\n  cesiumCreditContainer.className = \"cesium-credit-logoContainer\";\n  cesiumCreditContainer.style.display = \"inline\";\n  container.appendChild(cesiumCreditContainer);\n\n  const screenContainer = document.createElement(\"div\");\n  screenContainer.className = \"cesium-credit-textContainer\";\n  screenContainer.style.display = \"inline\";\n  container.appendChild(screenContainer);\n\n  const expandLink = document.createElement(\"a\");\n  expandLink.className = \"cesium-credit-expand-link\";\n  expandLink.onclick = this.showLightbox.bind(this);\n  expandLink.textContent = \"Data attribution\";\n  container.appendChild(expandLink);\n\n  appendCss(container);\n  const cesiumCredit = Credit.clone(CreditDisplay.cesiumCredit);\n\n  this._delimiter = defaultValue(delimiter, \" \u2022 \");\n  this._screenContainer = screenContainer;\n  this._cesiumCreditContainer = cesiumCreditContainer;\n  this._lastViewportHeight = undefined;\n  this._lastViewportWidth = undefined;\n  this._lightboxCredits = lightboxCredits;\n  this._creditList = creditList;\n  this._lightbox = lightbox;\n  this._hideLightbox = hideLightbox;\n  this._expandLink = expandLink;\n  this._expanded = false;\n  this._staticCredits = [];\n  this._cesiumCredit = cesiumCredit;\n  this._previousCesiumCredit = undefined;\n  this._currentCesiumCredit = cesiumCredit;\n  this._creditDisplayElementPool = [];\n  this._creditDisplayElementIndex = 0;\n\n  this._currentFrameCredits = {\n    screenCredits: new AssociativeArray(),\n    lightboxCredits: new AssociativeArray(),\n  };\n\n  this._defaultCredit = undefined;\n\n  this.viewport = viewport;\n\n  /**\n   * The HTML element where credits will be displayed.\n   * @type {HTMLElement}\n   */\n  this.container = container;\n}\n\nfunction setCredit(creditDisplay, credits, credit, count) {\n  count = defaultValue(count, 1);\n  let creditDisplayElement = credits.get(credit.id);\n  if (!defined(creditDisplayElement)) {\n    const pool = creditDisplay._creditDisplayElementPool;\n    const poolIndex = creditDisplay._creditDisplayElementPoolIndex;\n    if (poolIndex < pool.length) {\n      creditDisplayElement = pool[poolIndex];\n      creditDisplayElement.credit = credit;\n      creditDisplayElement.count = count;\n    } else {\n      creditDisplayElement = new CreditDisplayElement(credit, count);\n      pool.push(creditDisplayElement);\n    }\n    ++creditDisplay._creditDisplayElementPoolIndex;\n    credits.set(credit.id, creditDisplayElement);\n  } else if (creditDisplayElement.count < Number.MAX_VALUE) {\n    creditDisplayElement.count += count;\n  }\n}\n\n/**\n * Adds a {@link Credit} that will show on screen or in the lightbox until\n * the next frame. This is mostly for internal use. Use {@link CreditDisplay.addStaticCredit} to add a persistent credit to the screen.\n *\n * @see CreditDisplay.addStaticCredit\n *\n * @param {Credit} credit The credit to display in the next frame.\n */\nCreditDisplay.prototype.addCreditToNextFrame = function (credit) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"credit\", credit);\n  //>>includeEnd('debug');\n\n  if (credit.isIon()) {\n    // If this is the an ion logo credit from the ion server\n    // Just use the default credit (which is identical) to avoid blinking\n    if (!defined(this._defaultCredit)) {\n      this._defaultCredit = Credit.clone(getDefaultCredit());\n    }\n    this._currentCesiumCredit = this._defaultCredit;\n    return;\n  }\n\n  let credits;\n  if (!credit.showOnScreen) {\n    credits = this._currentFrameCredits.lightboxCredits;\n  } else {\n    credits = this._currentFrameCredits.screenCredits;\n  }\n\n  setCredit(this, credits, credit);\n};\n\n/**\n * Adds a {@link Credit} that will show on screen or in the lightbox until removed with {@link CreditDisplay.removeStaticCredit}.\n *\n * @param {Credit} credit The credit to added\n *\n * @example\n * // Add a credit with a tooltip, image and link to display onscreen\n * const credit = new Cesium.Credit(`<a href=\"https://cesium.com/\" target=\"_blank\"><img src=\"/images/cesium_logo.png\" title=\"Cesium\"/></a>`, true);\n * viewer.creditDisplay.addStaticCredit(credit);\n *\n * @example\n * // Add a credit with a plaintext link to display in the lightbox\n * const credit = new Cesium.Credit('<a href=\"https://cesium.com/\" target=\"_blank\">Cesium</a>');\n * viewer.creditDisplay.addStaticCredit(credit);\n */\nCreditDisplay.prototype.addStaticCredit = function (credit) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"credit\", credit);\n  //>>includeEnd('debug');\n\n  const staticCredits = this._staticCredits;\n  if (!contains(staticCredits, credit)) {\n    staticCredits.push(credit);\n  }\n};\n\n/**\n * Removes a static credit shown on screen or in the lightbox.\n *\n * @param {Credit} credit The credit to be removed.\n */\nCreditDisplay.prototype.removeStaticCredit = function (credit) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"credit\", credit);\n  //>>includeEnd('debug');\n\n  const staticCredits = this._staticCredits;\n  const index = staticCredits.indexOf(credit);\n  if (index !== -1) {\n    staticCredits.splice(index, 1);\n  }\n};\n\n/**\n * @private\n */\nCreditDisplay.prototype.showLightbox = function () {\n  this._lightbox.style.display = \"block\";\n  this._expanded = true;\n};\n\n/**\n * @private\n */\nCreditDisplay.prototype.hideLightbox = function () {\n  this._lightbox.style.display = \"none\";\n  this._expanded = false;\n};\n\n/**\n * Updates the credit display before a new frame is rendered.\n */\nCreditDisplay.prototype.update = function () {\n  if (this._expanded) {\n    styleLightboxContainer(this);\n  }\n};\n\n/**\n * Resets the credit display to a beginning of frame state, clearing out current credits.\n */\nCreditDisplay.prototype.beginFrame = function () {\n  const currentFrameCredits = this._currentFrameCredits;\n  this._creditDisplayElementPoolIndex = 0;\n\n  const screenCredits = currentFrameCredits.screenCredits;\n  const lightboxCredits = currentFrameCredits.lightboxCredits;\n\n  screenCredits.removeAll();\n  lightboxCredits.removeAll();\n\n  const staticCredits = this._staticCredits;\n  for (let i = 0; i < staticCredits.length; ++i) {\n    const staticCredit = staticCredits[i];\n    const creditCollection = staticCredit.showOnScreen\n      ? screenCredits\n      : lightboxCredits;\n\n    if (\n      staticCredit.isIon() &&\n      Credit.equals(CreditDisplay.cesiumCredit, this._cesiumCredit)\n    ) {\n      // If this is an ion logo credit from the ion server,\n      // make sure to de-duplicate with the default ion credit\n      continue;\n    }\n\n    setCredit(this, creditCollection, staticCredit, Number.MAX_VALUE);\n  }\n\n  if (!Credit.equals(CreditDisplay.cesiumCredit, this._cesiumCredit)) {\n    this._cesiumCredit = Credit.clone(CreditDisplay.cesiumCredit);\n  }\n  this._currentCesiumCredit = this._cesiumCredit;\n};\n\n/**\n * Sets the credit display to the end of frame state, displaying credits from the last frame in the credit container.\n */\nCreditDisplay.prototype.endFrame = function () {\n  const screenCredits = this._currentFrameCredits.screenCredits.values;\n  displayCredits(\n    this._screenContainer,\n    screenCredits,\n    this._delimiter,\n    undefined\n  );\n\n  const lightboxCredits = this._currentFrameCredits.lightboxCredits.values;\n  this._expandLink.style.display =\n    lightboxCredits.length > 0 ? \"inline\" : \"none\";\n  displayCredits(this._creditList, lightboxCredits, undefined, \"li\");\n\n  swapCesiumCredit(this);\n};\n\n/**\n * Destroys the resources held by this object.  Destroying an object allows for deterministic\n * release of resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nCreditDisplay.prototype.destroy = function () {\n  this._lightbox.removeEventListener(\"click\", this._hideLightbox, false);\n\n  this.container.removeChild(this._cesiumCreditContainer);\n  this.container.removeChild(this._screenContainer);\n  this.container.removeChild(this._expandLink);\n  this.viewport.removeChild(this._lightbox);\n\n  return destroyObject(this);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nCreditDisplay.prototype.isDestroyed = function () {\n  return false;\n};\n\nCreditDisplay._cesiumCredit = undefined;\nCreditDisplay._cesiumCreditInitialized = false;\n\nlet defaultCredit;\nfunction getDefaultCredit() {\n  if (!defined(defaultCredit)) {\n    let logo = buildModuleUrl(\"Assets/Images/ion-credit.png\");\n\n    // When hosting in a WebView, the base URL scheme is file:// or ms-appx-web://\n    // which is stripped out from the Credit's <img> tag; use the full path instead\n    if (\n      logo.indexOf(\"http://\") !== 0 &&\n      logo.indexOf(\"https://\") !== 0 &&\n      logo.indexOf(\"data:\") !== 0\n    ) {\n      const logoUrl = new Uri(logo);\n      logo = logoUrl.path();\n    }\n\n    defaultCredit = new Credit(\n      `<a href=\"https://cesium.com/\" target=\"_blank\"><img src=\"${logo}\" title=\"Cesium ion\"/></a>`,\n      true\n    );\n  }\n\n  if (!CreditDisplay._cesiumCreditInitialized) {\n    CreditDisplay._cesiumCredit = defaultCredit;\n    CreditDisplay._cesiumCreditInitialized = true;\n  }\n  return defaultCredit;\n}\n\nObject.defineProperties(CreditDisplay, {\n  /**\n   * Gets or sets the Cesium logo credit.\n   * @memberof CreditDisplay\n   * @type {Credit}\n   */\n  cesiumCredit: {\n    get: function () {\n      getDefaultCredit();\n      return CreditDisplay._cesiumCredit;\n    },\n    set: function (value) {\n      CreditDisplay._cesiumCredit = value;\n      CreditDisplay._cesiumCreditInitialized = true;\n    },\n  },\n});\n\nCreditDisplay.CreditDisplayElement = CreditDisplayElement;\nexport default CreditDisplay;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport OrthographicFrustum from \"./OrthographicFrustum.js\";\nimport PerspectiveFrustum from \"./PerspectiveFrustum.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst PERSPECTIVE = 0;\nconst ORTHOGRAPHIC = 1;\n\n/**\n * Describes a frustum at the given the origin and orientation.\n *\n * @alias FrustumGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {PerspectiveFrustum|OrthographicFrustum} options.frustum The frustum.\n * @param {Cartesian3} options.origin The origin of the frustum.\n * @param {Quaternion} options.orientation The orientation of the frustum.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n */\nfunction FrustumGeometry(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options\", options);\n  Check.typeOf.object(\"options.frustum\", options.frustum);\n  Check.typeOf.object(\"options.origin\", options.origin);\n  Check.typeOf.object(\"options.orientation\", options.orientation);\n  //>>includeEnd('debug');\n\n  const frustum = options.frustum;\n  const orientation = options.orientation;\n  const origin = options.origin;\n  const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n\n  // This is private because it is used by DebugCameraPrimitive to draw a multi-frustum by\n  // creating multiple FrustumGeometrys. This way the near plane of one frustum doesn't overlap\n  // the far plane of another.\n  const drawNearPlane = defaultValue(options._drawNearPlane, true);\n\n  let frustumType;\n  let frustumPackedLength;\n  if (frustum instanceof PerspectiveFrustum) {\n    frustumType = PERSPECTIVE;\n    frustumPackedLength = PerspectiveFrustum.packedLength;\n  } else if (frustum instanceof OrthographicFrustum) {\n    frustumType = ORTHOGRAPHIC;\n    frustumPackedLength = OrthographicFrustum.packedLength;\n  }\n\n  this._frustumType = frustumType;\n  this._frustum = frustum.clone();\n  this._origin = Cartesian3.clone(origin);\n  this._orientation = Quaternion.clone(orientation);\n  this._drawNearPlane = drawNearPlane;\n  this._vertexFormat = vertexFormat;\n  this._workerName = \"createFrustumGeometry\";\n\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  this.packedLength =\n    2 +\n    frustumPackedLength +\n    Cartesian3.packedLength +\n    Quaternion.packedLength +\n    VertexFormat.packedLength;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {FrustumGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nFrustumGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const frustumType = value._frustumType;\n  const frustum = value._frustum;\n\n  array[startingIndex++] = frustumType;\n\n  if (frustumType === PERSPECTIVE) {\n    PerspectiveFrustum.pack(frustum, array, startingIndex);\n    startingIndex += PerspectiveFrustum.packedLength;\n  } else {\n    OrthographicFrustum.pack(frustum, array, startingIndex);\n    startingIndex += OrthographicFrustum.packedLength;\n  }\n\n  Cartesian3.pack(value._origin, array, startingIndex);\n  startingIndex += Cartesian3.packedLength;\n  Quaternion.pack(value._orientation, array, startingIndex);\n  startingIndex += Quaternion.packedLength;\n  VertexFormat.pack(value._vertexFormat, array, startingIndex);\n  startingIndex += VertexFormat.packedLength;\n  array[startingIndex] = value._drawNearPlane ? 1.0 : 0.0;\n\n  return array;\n};\n\nconst scratchPackPerspective = new PerspectiveFrustum();\nconst scratchPackOrthographic = new OrthographicFrustum();\nconst scratchPackQuaternion = new Quaternion();\nconst scratchPackorigin = new Cartesian3();\nconst scratchVertexFormat = new VertexFormat();\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {FrustumGeometry} [result] The object into which to store the result.\n */\nFrustumGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const frustumType = array[startingIndex++];\n\n  let frustum;\n  if (frustumType === PERSPECTIVE) {\n    frustum = PerspectiveFrustum.unpack(\n      array,\n      startingIndex,\n      scratchPackPerspective\n    );\n    startingIndex += PerspectiveFrustum.packedLength;\n  } else {\n    frustum = OrthographicFrustum.unpack(\n      array,\n      startingIndex,\n      scratchPackOrthographic\n    );\n    startingIndex += OrthographicFrustum.packedLength;\n  }\n\n  const origin = Cartesian3.unpack(array, startingIndex, scratchPackorigin);\n  startingIndex += Cartesian3.packedLength;\n  const orientation = Quaternion.unpack(\n    array,\n    startingIndex,\n    scratchPackQuaternion\n  );\n  startingIndex += Quaternion.packedLength;\n  const vertexFormat = VertexFormat.unpack(\n    array,\n    startingIndex,\n    scratchVertexFormat\n  );\n  startingIndex += VertexFormat.packedLength;\n  const drawNearPlane = array[startingIndex] === 1.0;\n\n  if (!defined(result)) {\n    return new FrustumGeometry({\n      frustum: frustum,\n      origin: origin,\n      orientation: orientation,\n      vertexFormat: vertexFormat,\n      _drawNearPlane: drawNearPlane,\n    });\n  }\n\n  const frustumResult =\n    frustumType === result._frustumType ? result._frustum : undefined;\n  result._frustum = frustum.clone(frustumResult);\n\n  result._frustumType = frustumType;\n  result._origin = Cartesian3.clone(origin, result._origin);\n  result._orientation = Quaternion.clone(orientation, result._orientation);\n  result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n  result._drawNearPlane = drawNearPlane;\n\n  return result;\n};\n\nfunction getAttributes(\n  offset,\n  normals,\n  tangents,\n  bitangents,\n  st,\n  normal,\n  tangent,\n  bitangent\n) {\n  const stOffset = (offset / 3) * 2;\n\n  for (let i = 0; i < 4; ++i) {\n    if (defined(normals)) {\n      normals[offset] = normal.x;\n      normals[offset + 1] = normal.y;\n      normals[offset + 2] = normal.z;\n    }\n    if (defined(tangents)) {\n      tangents[offset] = tangent.x;\n      tangents[offset + 1] = tangent.y;\n      tangents[offset + 2] = tangent.z;\n    }\n    if (defined(bitangents)) {\n      bitangents[offset] = bitangent.x;\n      bitangents[offset + 1] = bitangent.y;\n      bitangents[offset + 2] = bitangent.z;\n    }\n    offset += 3;\n  }\n\n  st[stOffset] = 0.0;\n  st[stOffset + 1] = 0.0;\n  st[stOffset + 2] = 1.0;\n  st[stOffset + 3] = 0.0;\n  st[stOffset + 4] = 1.0;\n  st[stOffset + 5] = 1.0;\n  st[stOffset + 6] = 0.0;\n  st[stOffset + 7] = 1.0;\n}\n\nconst scratchRotationMatrix = new Matrix3();\nconst scratchViewMatrix = new Matrix4();\nconst scratchInverseMatrix = new Matrix4();\n\nconst scratchXDirection = new Cartesian3();\nconst scratchYDirection = new Cartesian3();\nconst scratchZDirection = new Cartesian3();\nconst scratchNegativeX = new Cartesian3();\nconst scratchNegativeY = new Cartesian3();\nconst scratchNegativeZ = new Cartesian3();\n\nconst frustumSplits = new Array(3);\n\nconst frustumCornersNDC = new Array(4);\nfrustumCornersNDC[0] = new Cartesian4(-1.0, -1.0, 1.0, 1.0);\nfrustumCornersNDC[1] = new Cartesian4(1.0, -1.0, 1.0, 1.0);\nfrustumCornersNDC[2] = new Cartesian4(1.0, 1.0, 1.0, 1.0);\nfrustumCornersNDC[3] = new Cartesian4(-1.0, 1.0, 1.0, 1.0);\n\nconst scratchFrustumCorners = new Array(4);\nfor (let i = 0; i < 4; ++i) {\n  scratchFrustumCorners[i] = new Cartesian4();\n}\n\nFrustumGeometry._computeNearFarPlanes = function (\n  origin,\n  orientation,\n  frustumType,\n  frustum,\n  positions,\n  xDirection,\n  yDirection,\n  zDirection\n) {\n  const rotationMatrix = Matrix3.fromQuaternion(\n    orientation,\n    scratchRotationMatrix\n  );\n  let x = defaultValue(xDirection, scratchXDirection);\n  let y = defaultValue(yDirection, scratchYDirection);\n  let z = defaultValue(zDirection, scratchZDirection);\n\n  x = Matrix3.getColumn(rotationMatrix, 0, x);\n  y = Matrix3.getColumn(rotationMatrix, 1, y);\n  z = Matrix3.getColumn(rotationMatrix, 2, z);\n\n  Cartesian3.normalize(x, x);\n  Cartesian3.normalize(y, y);\n  Cartesian3.normalize(z, z);\n\n  Cartesian3.negate(x, x);\n\n  const view = Matrix4.computeView(origin, z, y, x, scratchViewMatrix);\n\n  let inverseView;\n  let inverseViewProjection;\n  const projection = frustum.projectionMatrix;\n  if (frustumType === PERSPECTIVE) {\n    const viewProjection = Matrix4.multiply(\n      projection,\n      view,\n      scratchInverseMatrix\n    );\n    inverseViewProjection = Matrix4.inverse(\n      viewProjection,\n      scratchInverseMatrix\n    );\n  } else {\n    inverseView = Matrix4.inverseTransformation(view, scratchInverseMatrix);\n  }\n\n  if (defined(inverseViewProjection)) {\n    frustumSplits[0] = frustum.near;\n    frustumSplits[1] = frustum.far;\n  } else {\n    frustumSplits[0] = 0.0;\n    frustumSplits[1] = frustum.near;\n    frustumSplits[2] = frustum.far;\n  }\n\n  for (let i = 0; i < 2; ++i) {\n    for (let j = 0; j < 4; ++j) {\n      let corner = Cartesian4.clone(\n        frustumCornersNDC[j],\n        scratchFrustumCorners[j]\n      );\n\n      if (!defined(inverseViewProjection)) {\n        const offCenterFrustum = frustum.offCenterFrustum;\n        if (defined(offCenterFrustum)) {\n          frustum = offCenterFrustum;\n        }\n\n        const near = frustumSplits[i];\n        const far = frustumSplits[i + 1];\n\n        corner.x =\n          (corner.x * (frustum.right - frustum.left) +\n            frustum.left +\n            frustum.right) *\n          0.5;\n        corner.y =\n          (corner.y * (frustum.top - frustum.bottom) +\n            frustum.bottom +\n            frustum.top) *\n          0.5;\n        corner.z = (corner.z * (near - far) - near - far) * 0.5;\n        corner.w = 1.0;\n\n        Matrix4.multiplyByVector(inverseView, corner, corner);\n      } else {\n        corner = Matrix4.multiplyByVector(\n          inverseViewProjection,\n          corner,\n          corner\n        );\n\n        // Reverse perspective divide\n        const w = 1.0 / corner.w;\n        Cartesian3.multiplyByScalar(corner, w, corner);\n\n        Cartesian3.subtract(corner, origin, corner);\n        Cartesian3.normalize(corner, corner);\n\n        const fac = Cartesian3.dot(z, corner);\n        Cartesian3.multiplyByScalar(corner, frustumSplits[i] / fac, corner);\n        Cartesian3.add(corner, origin, corner);\n      }\n\n      positions[12 * i + j * 3] = corner.x;\n      positions[12 * i + j * 3 + 1] = corner.y;\n      positions[12 * i + j * 3 + 2] = corner.z;\n    }\n  }\n};\n\n/**\n * Computes the geometric representation of a frustum, including its vertices, indices, and a bounding sphere.\n *\n * @param {FrustumGeometry} frustumGeometry A description of the frustum.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nFrustumGeometry.createGeometry = function (frustumGeometry) {\n  const frustumType = frustumGeometry._frustumType;\n  const frustum = frustumGeometry._frustum;\n  const origin = frustumGeometry._origin;\n  const orientation = frustumGeometry._orientation;\n  const drawNearPlane = frustumGeometry._drawNearPlane;\n  const vertexFormat = frustumGeometry._vertexFormat;\n\n  const numberOfPlanes = drawNearPlane ? 6 : 5;\n  let positions = new Float64Array(3 * 4 * 6);\n  FrustumGeometry._computeNearFarPlanes(\n    origin,\n    orientation,\n    frustumType,\n    frustum,\n    positions\n  );\n\n  // -x plane\n  let offset = 3 * 4 * 2;\n  positions[offset] = positions[3 * 4];\n  positions[offset + 1] = positions[3 * 4 + 1];\n  positions[offset + 2] = positions[3 * 4 + 2];\n  positions[offset + 3] = positions[0];\n  positions[offset + 4] = positions[1];\n  positions[offset + 5] = positions[2];\n  positions[offset + 6] = positions[3 * 3];\n  positions[offset + 7] = positions[3 * 3 + 1];\n  positions[offset + 8] = positions[3 * 3 + 2];\n  positions[offset + 9] = positions[3 * 7];\n  positions[offset + 10] = positions[3 * 7 + 1];\n  positions[offset + 11] = positions[3 * 7 + 2];\n\n  // -y plane\n  offset += 3 * 4;\n  positions[offset] = positions[3 * 5];\n  positions[offset + 1] = positions[3 * 5 + 1];\n  positions[offset + 2] = positions[3 * 5 + 2];\n  positions[offset + 3] = positions[3];\n  positions[offset + 4] = positions[3 + 1];\n  positions[offset + 5] = positions[3 + 2];\n  positions[offset + 6] = positions[0];\n  positions[offset + 7] = positions[1];\n  positions[offset + 8] = positions[2];\n  positions[offset + 9] = positions[3 * 4];\n  positions[offset + 10] = positions[3 * 4 + 1];\n  positions[offset + 11] = positions[3 * 4 + 2];\n\n  // +x plane\n  offset += 3 * 4;\n  positions[offset] = positions[3];\n  positions[offset + 1] = positions[3 + 1];\n  positions[offset + 2] = positions[3 + 2];\n  positions[offset + 3] = positions[3 * 5];\n  positions[offset + 4] = positions[3 * 5 + 1];\n  positions[offset + 5] = positions[3 * 5 + 2];\n  positions[offset + 6] = positions[3 * 6];\n  positions[offset + 7] = positions[3 * 6 + 1];\n  positions[offset + 8] = positions[3 * 6 + 2];\n  positions[offset + 9] = positions[3 * 2];\n  positions[offset + 10] = positions[3 * 2 + 1];\n  positions[offset + 11] = positions[3 * 2 + 2];\n\n  // +y plane\n  offset += 3 * 4;\n  positions[offset] = positions[3 * 2];\n  positions[offset + 1] = positions[3 * 2 + 1];\n  positions[offset + 2] = positions[3 * 2 + 2];\n  positions[offset + 3] = positions[3 * 6];\n  positions[offset + 4] = positions[3 * 6 + 1];\n  positions[offset + 5] = positions[3 * 6 + 2];\n  positions[offset + 6] = positions[3 * 7];\n  positions[offset + 7] = positions[3 * 7 + 1];\n  positions[offset + 8] = positions[3 * 7 + 2];\n  positions[offset + 9] = positions[3 * 3];\n  positions[offset + 10] = positions[3 * 3 + 1];\n  positions[offset + 11] = positions[3 * 3 + 2];\n\n  if (!drawNearPlane) {\n    positions = positions.subarray(3 * 4);\n  }\n\n  const attributes = new GeometryAttributes({\n    position: new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: positions,\n    }),\n  });\n\n  if (\n    defined(vertexFormat.normal) ||\n    defined(vertexFormat.tangent) ||\n    defined(vertexFormat.bitangent) ||\n    defined(vertexFormat.st)\n  ) {\n    const normals = defined(vertexFormat.normal)\n      ? new Float32Array(3 * 4 * numberOfPlanes)\n      : undefined;\n    const tangents = defined(vertexFormat.tangent)\n      ? new Float32Array(3 * 4 * numberOfPlanes)\n      : undefined;\n    const bitangents = defined(vertexFormat.bitangent)\n      ? new Float32Array(3 * 4 * numberOfPlanes)\n      : undefined;\n    const st = defined(vertexFormat.st)\n      ? new Float32Array(2 * 4 * numberOfPlanes)\n      : undefined;\n\n    const x = scratchXDirection;\n    const y = scratchYDirection;\n    const z = scratchZDirection;\n\n    const negativeX = Cartesian3.negate(x, scratchNegativeX);\n    const negativeY = Cartesian3.negate(y, scratchNegativeY);\n    const negativeZ = Cartesian3.negate(z, scratchNegativeZ);\n\n    offset = 0;\n    if (drawNearPlane) {\n      getAttributes(offset, normals, tangents, bitangents, st, negativeZ, x, y); // near\n      offset += 3 * 4;\n    }\n    getAttributes(offset, normals, tangents, bitangents, st, z, negativeX, y); // far\n    offset += 3 * 4;\n    getAttributes(\n      offset,\n      normals,\n      tangents,\n      bitangents,\n      st,\n      negativeX,\n      negativeZ,\n      y\n    ); // -x\n    offset += 3 * 4;\n    getAttributes(\n      offset,\n      normals,\n      tangents,\n      bitangents,\n      st,\n      negativeY,\n      negativeZ,\n      negativeX\n    ); // -y\n    offset += 3 * 4;\n    getAttributes(offset, normals, tangents, bitangents, st, x, z, y); // +x\n    offset += 3 * 4;\n    getAttributes(offset, normals, tangents, bitangents, st, y, z, negativeX); // +y\n\n    if (defined(normals)) {\n      attributes.normal = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: normals,\n      });\n    }\n    if (defined(tangents)) {\n      attributes.tangent = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: tangents,\n      });\n    }\n    if (defined(bitangents)) {\n      attributes.bitangent = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 3,\n        values: bitangents,\n      });\n    }\n    if (defined(st)) {\n      attributes.st = new GeometryAttribute({\n        componentDatatype: ComponentDatatype.FLOAT,\n        componentsPerAttribute: 2,\n        values: st,\n      });\n    }\n  }\n\n  const indices = new Uint16Array(6 * numberOfPlanes);\n  for (let i = 0; i < numberOfPlanes; ++i) {\n    const indexOffset = i * 6;\n    const index = i * 4;\n\n    indices[indexOffset] = index;\n    indices[indexOffset + 1] = index + 1;\n    indices[indexOffset + 2] = index + 2;\n    indices[indexOffset + 3] = index;\n    indices[indexOffset + 4] = index + 2;\n    indices[indexOffset + 5] = index + 3;\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: PrimitiveType.TRIANGLES,\n    boundingSphere: BoundingSphere.fromVertices(positions),\n  });\n};\nexport default FrustumGeometry;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport FrustumGeometry from \"./FrustumGeometry.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport OrthographicFrustum from \"./OrthographicFrustum.js\";\nimport PerspectiveFrustum from \"./PerspectiveFrustum.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\n\nconst PERSPECTIVE = 0;\nconst ORTHOGRAPHIC = 1;\n\n/**\n * A description of the outline of a frustum with the given the origin and orientation.\n *\n * @alias FrustumOutlineGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {PerspectiveFrustum|OrthographicFrustum} options.frustum The frustum.\n * @param {Cartesian3} options.origin The origin of the frustum.\n * @param {Quaternion} options.orientation The orientation of the frustum.\n */\nfunction FrustumOutlineGeometry(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options\", options);\n  Check.typeOf.object(\"options.frustum\", options.frustum);\n  Check.typeOf.object(\"options.origin\", options.origin);\n  Check.typeOf.object(\"options.orientation\", options.orientation);\n  //>>includeEnd('debug');\n\n  const frustum = options.frustum;\n  const orientation = options.orientation;\n  const origin = options.origin;\n\n  // This is private because it is used by DebugCameraPrimitive to draw a multi-frustum by\n  // creating multiple FrustumOutlineGeometrys. This way the near plane of one frustum doesn't overlap\n  // the far plane of another.\n  const drawNearPlane = defaultValue(options._drawNearPlane, true);\n\n  let frustumType;\n  let frustumPackedLength;\n  if (frustum instanceof PerspectiveFrustum) {\n    frustumType = PERSPECTIVE;\n    frustumPackedLength = PerspectiveFrustum.packedLength;\n  } else if (frustum instanceof OrthographicFrustum) {\n    frustumType = ORTHOGRAPHIC;\n    frustumPackedLength = OrthographicFrustum.packedLength;\n  }\n\n  this._frustumType = frustumType;\n  this._frustum = frustum.clone();\n  this._origin = Cartesian3.clone(origin);\n  this._orientation = Quaternion.clone(orientation);\n  this._drawNearPlane = drawNearPlane;\n  this._workerName = \"createFrustumOutlineGeometry\";\n\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  this.packedLength =\n    2 + frustumPackedLength + Cartesian3.packedLength + Quaternion.packedLength;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {FrustumOutlineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nFrustumOutlineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const frustumType = value._frustumType;\n  const frustum = value._frustum;\n\n  array[startingIndex++] = frustumType;\n\n  if (frustumType === PERSPECTIVE) {\n    PerspectiveFrustum.pack(frustum, array, startingIndex);\n    startingIndex += PerspectiveFrustum.packedLength;\n  } else {\n    OrthographicFrustum.pack(frustum, array, startingIndex);\n    startingIndex += OrthographicFrustum.packedLength;\n  }\n\n  Cartesian3.pack(value._origin, array, startingIndex);\n  startingIndex += Cartesian3.packedLength;\n  Quaternion.pack(value._orientation, array, startingIndex);\n  startingIndex += Quaternion.packedLength;\n  array[startingIndex] = value._drawNearPlane ? 1.0 : 0.0;\n\n  return array;\n};\n\nconst scratchPackPerspective = new PerspectiveFrustum();\nconst scratchPackOrthographic = new OrthographicFrustum();\nconst scratchPackQuaternion = new Quaternion();\nconst scratchPackorigin = new Cartesian3();\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {FrustumOutlineGeometry} [result] The object into which to store the result.\n */\nFrustumOutlineGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"array\", array);\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  const frustumType = array[startingIndex++];\n\n  let frustum;\n  if (frustumType === PERSPECTIVE) {\n    frustum = PerspectiveFrustum.unpack(\n      array,\n      startingIndex,\n      scratchPackPerspective\n    );\n    startingIndex += PerspectiveFrustum.packedLength;\n  } else {\n    frustum = OrthographicFrustum.unpack(\n      array,\n      startingIndex,\n      scratchPackOrthographic\n    );\n    startingIndex += OrthographicFrustum.packedLength;\n  }\n\n  const origin = Cartesian3.unpack(array, startingIndex, scratchPackorigin);\n  startingIndex += Cartesian3.packedLength;\n  const orientation = Quaternion.unpack(\n    array,\n    startingIndex,\n    scratchPackQuaternion\n  );\n  startingIndex += Quaternion.packedLength;\n  const drawNearPlane = array[startingIndex] === 1.0;\n\n  if (!defined(result)) {\n    return new FrustumOutlineGeometry({\n      frustum: frustum,\n      origin: origin,\n      orientation: orientation,\n      _drawNearPlane: drawNearPlane,\n    });\n  }\n\n  const frustumResult =\n    frustumType === result._frustumType ? result._frustum : undefined;\n  result._frustum = frustum.clone(frustumResult);\n\n  result._frustumType = frustumType;\n  result._origin = Cartesian3.clone(origin, result._origin);\n  result._orientation = Quaternion.clone(orientation, result._orientation);\n  result._drawNearPlane = drawNearPlane;\n\n  return result;\n};\n\n/**\n * Computes the geometric representation of a frustum outline, including its vertices, indices, and a bounding sphere.\n *\n * @param {FrustumOutlineGeometry} frustumGeometry A description of the frustum.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nFrustumOutlineGeometry.createGeometry = function (frustumGeometry) {\n  const frustumType = frustumGeometry._frustumType;\n  const frustum = frustumGeometry._frustum;\n  const origin = frustumGeometry._origin;\n  const orientation = frustumGeometry._orientation;\n  const drawNearPlane = frustumGeometry._drawNearPlane;\n\n  const positions = new Float64Array(3 * 4 * 2);\n  FrustumGeometry._computeNearFarPlanes(\n    origin,\n    orientation,\n    frustumType,\n    frustum,\n    positions\n  );\n\n  const attributes = new GeometryAttributes({\n    position: new GeometryAttribute({\n      componentDatatype: ComponentDatatype.DOUBLE,\n      componentsPerAttribute: 3,\n      values: positions,\n    }),\n  });\n\n  let offset;\n  let index;\n\n  const numberOfPlanes = drawNearPlane ? 2 : 1;\n  const indices = new Uint16Array(8 * (numberOfPlanes + 1));\n\n  // Build the near/far planes\n  let i = drawNearPlane ? 0 : 1;\n  for (; i < 2; ++i) {\n    offset = drawNearPlane ? i * 8 : 0;\n    index = i * 4;\n\n    indices[offset] = index;\n    indices[offset + 1] = index + 1;\n    indices[offset + 2] = index + 1;\n    indices[offset + 3] = index + 2;\n    indices[offset + 4] = index + 2;\n    indices[offset + 5] = index + 3;\n    indices[offset + 6] = index + 3;\n    indices[offset + 7] = index;\n  }\n\n  // Build the sides of the frustums\n  for (i = 0; i < 2; ++i) {\n    offset = (numberOfPlanes + i) * 8;\n    index = i * 4;\n\n    indices[offset] = index;\n    indices[offset + 1] = index + 4;\n    indices[offset + 2] = index + 1;\n    indices[offset + 3] = index + 5;\n    indices[offset + 4] = index + 2;\n    indices[offset + 5] = index + 6;\n    indices[offset + 6] = index + 3;\n    indices[offset + 7] = index + 7;\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: PrimitiveType.LINES,\n    boundingSphere: BoundingSphere.fromVertices(positions),\n  });\n};\nexport default FrustumOutlineGeometry;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport FrustumGeometry from \"../Core/FrustumGeometry.js\";\nimport FrustumOutlineGeometry from \"../Core/FrustumOutlineGeometry.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport PerspectiveFrustum from \"../Core/PerspectiveFrustum.js\";\nimport PerspectiveOffCenterFrustum from \"../Core/PerspectiveOffCenterFrustum.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\n\n/**\n * Draws the outline of the camera's view frustum.\n *\n * @alias DebugCameraPrimitive\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Camera} options.camera The camera.\n * @param {number[]} [options.frustumSplits] Distances to the near and far planes of the camera frustums. This overrides the camera's frustum near and far values.\n * @param {Color} [options.color=Color.CYAN] The color of the debug outline.\n * @param {boolean} [options.updateOnChange=true] Whether the primitive updates when the underlying camera changes.\n * @param {boolean} [options.show=true] Determines if this primitive will be shown.\n * @param {object} [options.id] A user-defined object to return when the instance is picked with {@link Scene#pick}.\n *\n * @example\n * primitives.add(new Cesium.DebugCameraPrimitive({\n *   camera : camera,\n *   color : Cesium.Color.YELLOW\n * }));\n */\nfunction DebugCameraPrimitive(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options.camera)) {\n    throw new DeveloperError(\"options.camera is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._camera = options.camera;\n  this._frustumSplits = options.frustumSplits;\n  this._color = defaultValue(options.color, Color.CYAN);\n  this._updateOnChange = defaultValue(options.updateOnChange, true);\n\n  /**\n   * Determines if this primitive will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  /**\n   * User-defined value returned when the primitive is picked.\n   *\n   * @type {*}\n   * @default undefined\n   *\n   * @see Scene#pick\n   */\n  this.id = options.id;\n  this._id = undefined;\n\n  this._outlinePrimitives = [];\n  this._planesPrimitives = [];\n}\n\nconst scratchRight = new Cartesian3();\nconst scratchRotation = new Matrix3();\nconst scratchOrientation = new Quaternion();\nconst scratchPerspective = new PerspectiveFrustum();\nconst scratchPerspectiveOffCenter = new PerspectiveOffCenterFrustum();\nconst scratchOrthographic = new OrthographicFrustum();\nconst scratchOrthographicOffCenter = new OrthographicOffCenterFrustum();\n\nconst scratchColor = new Color();\nconst scratchSplits = [1.0, 100000.0];\n\n/**\n * @private\n */\nDebugCameraPrimitive.prototype.update = function (frameState) {\n  if (!this.show) {\n    return;\n  }\n\n  const planesPrimitives = this._planesPrimitives;\n  const outlinePrimitives = this._outlinePrimitives;\n  let i;\n  let length;\n\n  if (this._updateOnChange) {\n    // Recreate the primitive every frame\n    length = planesPrimitives.length;\n    for (i = 0; i < length; ++i) {\n      outlinePrimitives[i] =\n        outlinePrimitives[i] && outlinePrimitives[i].destroy();\n      planesPrimitives[i] =\n        planesPrimitives[i] && planesPrimitives[i].destroy();\n    }\n    planesPrimitives.length = 0;\n    outlinePrimitives.length = 0;\n  }\n\n  if (planesPrimitives.length === 0) {\n    const camera = this._camera;\n    const cameraFrustum = camera.frustum;\n    let frustum;\n    if (cameraFrustum instanceof PerspectiveFrustum) {\n      frustum = scratchPerspective;\n    } else if (cameraFrustum instanceof PerspectiveOffCenterFrustum) {\n      frustum = scratchPerspectiveOffCenter;\n    } else if (cameraFrustum instanceof OrthographicFrustum) {\n      frustum = scratchOrthographic;\n    } else {\n      frustum = scratchOrthographicOffCenter;\n    }\n    frustum = cameraFrustum.clone(frustum);\n\n    let numFrustums;\n    let frustumSplits = this._frustumSplits;\n    if (!defined(frustumSplits) || frustumSplits.length <= 1) {\n      // Use near and far planes if no splits created\n      frustumSplits = scratchSplits;\n      frustumSplits[0] = this._camera.frustum.near;\n      frustumSplits[1] = this._camera.frustum.far;\n      numFrustums = 1;\n    } else {\n      numFrustums = frustumSplits.length - 1;\n    }\n\n    const position = camera.positionWC;\n    const direction = camera.directionWC;\n    const up = camera.upWC;\n    let right = camera.rightWC;\n    right = Cartesian3.negate(right, scratchRight);\n\n    const rotation = scratchRotation;\n    Matrix3.setColumn(rotation, 0, right, rotation);\n    Matrix3.setColumn(rotation, 1, up, rotation);\n    Matrix3.setColumn(rotation, 2, direction, rotation);\n\n    const orientation = Quaternion.fromRotationMatrix(\n      rotation,\n      scratchOrientation\n    );\n\n    planesPrimitives.length = outlinePrimitives.length = numFrustums;\n\n    for (i = 0; i < numFrustums; ++i) {\n      frustum.near = frustumSplits[i];\n      frustum.far = frustumSplits[i + 1];\n\n      planesPrimitives[i] = new Primitive({\n        geometryInstances: new GeometryInstance({\n          geometry: new FrustumGeometry({\n            origin: position,\n            orientation: orientation,\n            frustum: frustum,\n            _drawNearPlane: i === 0,\n          }),\n          attributes: {\n            color: ColorGeometryInstanceAttribute.fromColor(\n              Color.fromAlpha(this._color, 0.1, scratchColor)\n            ),\n          },\n          id: this.id,\n          pickPrimitive: this,\n        }),\n        appearance: new PerInstanceColorAppearance({\n          translucent: true,\n          flat: true,\n        }),\n        asynchronous: false,\n      });\n\n      outlinePrimitives[i] = new Primitive({\n        geometryInstances: new GeometryInstance({\n          geometry: new FrustumOutlineGeometry({\n            origin: position,\n            orientation: orientation,\n            frustum: frustum,\n            _drawNearPlane: i === 0,\n          }),\n          attributes: {\n            color: ColorGeometryInstanceAttribute.fromColor(this._color),\n          },\n          id: this.id,\n          pickPrimitive: this,\n        }),\n        appearance: new PerInstanceColorAppearance({\n          translucent: false,\n          flat: true,\n        }),\n        asynchronous: false,\n      });\n    }\n  }\n\n  length = planesPrimitives.length;\n  for (i = 0; i < length; ++i) {\n    outlinePrimitives[i].update(frameState);\n    planesPrimitives[i].update(frameState);\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see DebugCameraPrimitive#destroy\n */\nDebugCameraPrimitive.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * p = p && p.destroy();\n *\n * @see DebugCameraPrimitive#isDestroyed\n */\nDebugCameraPrimitive.prototype.destroy = function () {\n  const length = this._planesPrimitives.length;\n  for (let i = 0; i < length; ++i) {\n    this._outlinePrimitives[i] =\n      this._outlinePrimitives[i] && this._outlinePrimitives[i].destroy();\n    this._planesPrimitives[i] =\n      this._planesPrimitives[i] && this._planesPrimitives[i].destroy();\n  }\n  return destroyObject(this);\n};\nexport default DebugCameraPrimitive;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec4 positionEC;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec3 position;\\n\\\n    vec3 direction;\\n\\\n    if (czm_orthographicIn3D == 1.0)\\n\\\n    {\\n\\\n        vec2 uv = (gl_FragCoord.xy -  czm_viewport.xy) / czm_viewport.zw;\\n\\\n        vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom\\n\\\n        vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top\\n\\\n        position = vec3(mix(minPlane, maxPlane, uv), 0.0);\\n\\\n        direction = vec3(0.0, 0.0, -1.0);\\n\\\n    } \\n\\\n    else \\n\\\n    {\\n\\\n        position = vec3(0.0);\\n\\\n        direction = normalize(positionEC.xyz);\\n\\\n    }\\n\\\n\\n\\\n    czm_ray ray = czm_ray(position, direction);\\n\\\n\\n\\\n    vec3 ellipsoid_center = czm_view[3].xyz;\\n\\\n\\n\\\n    czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\\n\\\n    if (!czm_isEmpty(intersection))\\n\\\n    {\\n\\\n        out_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        discard;\\n\\\n    }\\n\\\n\\n\\\n    czm_writeLogDepth();\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec4 position;\\n\\\n\\n\\\nout vec4 positionEC;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    positionEC = czm_modelView * position;\\n\\\n    gl_Position = czm_projection * positionEC;\\n\\\n\\n\\\n    czm_vertexLogDepth();\\n\\\n}\\n\\\n\";\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defined from \"../Core/defined.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport Geometry from \"../Core/Geometry.js\";\nimport GeometryAttribute from \"../Core/GeometryAttribute.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport DepthPlaneFS from \"../Shaders/DepthPlaneFS.js\";\nimport DepthPlaneVS from \"../Shaders/DepthPlaneVS.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\n\n/**\n * @private\n */\nfunction DepthPlane(depthPlaneEllipsoidOffset) {\n  this._rs = undefined;\n  this._sp = undefined;\n  this._va = undefined;\n  this._command = undefined;\n  this._mode = undefined;\n  this._useLogDepth = false;\n  this._ellipsoidOffset = defaultValue(depthPlaneEllipsoidOffset, 0);\n}\n\nconst depthQuadScratch = FeatureDetection.supportsTypedArrays()\n  ? new Float32Array(12)\n  : [];\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchCartesian3 = new Cartesian3();\nconst scratchCartesian4 = new Cartesian3();\nconst scratchCartesian5 = new Cartesian3();\n\nfunction computeDepthQuad(ellipsoid, frameState) {\n  const radii = ellipsoid.radii;\n  const camera = frameState.camera;\n  let center, eastOffset, northOffset;\n\n  if (camera.frustum instanceof OrthographicFrustum) {\n    center = Cartesian3.ZERO;\n    eastOffset = camera.rightWC;\n    northOffset = camera.upWC;\n  } else {\n    const p = camera.positionWC;\n\n    // Find the corresponding position in the scaled space of the ellipsoid.\n    const q = Cartesian3.multiplyComponents(\n      ellipsoid.oneOverRadii,\n      p,\n      scratchCartesian1\n    );\n\n    const qUnit = Cartesian3.normalize(q, scratchCartesian2);\n\n    // Determine the east and north directions at q.\n    const eUnit = Cartesian3.normalize(\n      Cartesian3.cross(Cartesian3.UNIT_Z, q, scratchCartesian3),\n      scratchCartesian3\n    );\n    const nUnit = Cartesian3.normalize(\n      Cartesian3.cross(qUnit, eUnit, scratchCartesian4),\n      scratchCartesian4\n    );\n\n    const qMagnitude = Cartesian3.magnitude(q);\n\n    // Determine the radius of the 'limb' of the ellipsoid.\n    const wMagnitude = Math.sqrt(qMagnitude * qMagnitude - 1.0);\n\n    // Compute the center and offsets.\n    center = Cartesian3.multiplyByScalar(\n      qUnit,\n      1.0 / qMagnitude,\n      scratchCartesian1\n    );\n    const scalar = wMagnitude / qMagnitude;\n    eastOffset = Cartesian3.multiplyByScalar(eUnit, scalar, scratchCartesian2);\n    northOffset = Cartesian3.multiplyByScalar(nUnit, scalar, scratchCartesian3);\n  }\n\n  // A conservative measure for the longitudes would be to use the min/max longitudes of the bounding frustum.\n  const upperLeft = Cartesian3.add(center, northOffset, scratchCartesian5);\n  Cartesian3.subtract(upperLeft, eastOffset, upperLeft);\n  Cartesian3.multiplyComponents(radii, upperLeft, upperLeft);\n  Cartesian3.pack(upperLeft, depthQuadScratch, 0);\n\n  const lowerLeft = Cartesian3.subtract(center, northOffset, scratchCartesian5);\n  Cartesian3.subtract(lowerLeft, eastOffset, lowerLeft);\n  Cartesian3.multiplyComponents(radii, lowerLeft, lowerLeft);\n  Cartesian3.pack(lowerLeft, depthQuadScratch, 3);\n\n  const upperRight = Cartesian3.add(center, northOffset, scratchCartesian5);\n  Cartesian3.add(upperRight, eastOffset, upperRight);\n  Cartesian3.multiplyComponents(radii, upperRight, upperRight);\n  Cartesian3.pack(upperRight, depthQuadScratch, 6);\n\n  const lowerRight = Cartesian3.subtract(\n    center,\n    northOffset,\n    scratchCartesian5\n  );\n  Cartesian3.add(lowerRight, eastOffset, lowerRight);\n  Cartesian3.multiplyComponents(radii, lowerRight, lowerRight);\n  Cartesian3.pack(lowerRight, depthQuadScratch, 9);\n\n  return depthQuadScratch;\n}\n\nDepthPlane.prototype.update = function (frameState) {\n  this._mode = frameState.mode;\n  if (frameState.mode !== SceneMode.SCENE3D) {\n    return;\n  }\n\n  const context = frameState.context;\n\n  // Allow offsetting the ellipsoid radius to address rendering artifacts below ellipsoid zero elevation.\n  const radii = frameState.mapProjection.ellipsoid.radii;\n  const ellipsoid = new Ellipsoid(\n    radii.x + this._ellipsoidOffset,\n    radii.y + this._ellipsoidOffset,\n    radii.z + this._ellipsoidOffset\n  );\n\n  const useLogDepth = frameState.useLogDepth;\n\n  if (!defined(this._command)) {\n    this._rs = RenderState.fromCache({\n      // Write depth, not color\n      cull: {\n        enabled: true,\n      },\n      depthTest: {\n        enabled: true,\n      },\n      colorMask: {\n        red: false,\n        green: false,\n        blue: false,\n        alpha: false,\n      },\n    });\n\n    this._command = new DrawCommand({\n      renderState: this._rs,\n      boundingVolume: new BoundingSphere(\n        Cartesian3.ZERO,\n        ellipsoid.maximumRadius\n      ),\n      pass: Pass.OPAQUE,\n      owner: this,\n    });\n  }\n\n  if (!defined(this._sp) || this._useLogDepth !== useLogDepth) {\n    this._useLogDepth = useLogDepth;\n\n    const vs = new ShaderSource({\n      sources: [DepthPlaneVS],\n    });\n    const fs = new ShaderSource({\n      sources: [DepthPlaneFS],\n    });\n    if (useLogDepth) {\n      fs.defines.push(\"LOG_DEPTH\");\n      vs.defines.push(\"LOG_DEPTH\");\n    }\n\n    this._sp = ShaderProgram.replaceCache({\n      shaderProgram: this._sp,\n      context: context,\n      vertexShaderSource: vs,\n      fragmentShaderSource: fs,\n      attributeLocations: {\n        position: 0,\n      },\n    });\n\n    this._command.shaderProgram = this._sp;\n  }\n\n  // update depth plane\n  const depthQuad = computeDepthQuad(ellipsoid, frameState);\n\n  // depth plane\n  if (!defined(this._va)) {\n    const geometry = new Geometry({\n      attributes: {\n        position: new GeometryAttribute({\n          componentDatatype: ComponentDatatype.FLOAT,\n          componentsPerAttribute: 3,\n          values: depthQuad,\n        }),\n      },\n      indices: [0, 1, 2, 2, 1, 3],\n      primitiveType: PrimitiveType.TRIANGLES,\n    });\n\n    this._va = VertexArray.fromGeometry({\n      context: context,\n      geometry: geometry,\n      attributeLocations: {\n        position: 0,\n      },\n      bufferUsage: BufferUsage.DYNAMIC_DRAW,\n    });\n\n    this._command.vertexArray = this._va;\n  } else {\n    this._va.getAttribute(0).vertexBuffer.copyFromArrayView(depthQuad);\n  }\n};\n\nDepthPlane.prototype.execute = function (context, passState) {\n  if (this._mode === SceneMode.SCENE3D) {\n    this._command.execute(context, passState);\n  }\n};\n\nDepthPlane.prototype.isDestroyed = function () {\n  return false;\n};\n\nDepthPlane.prototype.destroy = function () {\n  this._sp = this._sp && this._sp.destroy();\n  this._va = this._va && this._va.destroy();\n};\nexport default DepthPlane;\n", "import defined from \"../Core/defined.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\n\n/**\n * @private\n */\nfunction DerivedCommand() {}\n\nconst fragDepthRegex = /\\bgl_FragDepth\\b/;\nconst discardRegex = /\\bdiscard\\b/;\n\nfunction getDepthOnlyShaderProgram(context, shaderProgram) {\n  let shader = context.shaderCache.getDerivedShaderProgram(\n    shaderProgram,\n    \"depthOnly\"\n  );\n  if (!defined(shader)) {\n    const attributeLocations = shaderProgram._attributeLocations;\n    let fs = shaderProgram.fragmentShaderSource;\n\n    let i;\n    let writesDepthOrDiscards = false;\n    const sources = fs.sources;\n    let length = sources.length;\n    for (i = 0; i < length; ++i) {\n      if (fragDepthRegex.test(sources[i]) || discardRegex.test(sources[i])) {\n        writesDepthOrDiscards = true;\n        break;\n      }\n    }\n\n    let usesLogDepth = false;\n    const defines = fs.defines;\n    length = defines.length;\n    for (i = 0; i < length; ++i) {\n      if (defines[i] === \"LOG_DEPTH\") {\n        usesLogDepth = true;\n        break;\n      }\n    }\n\n    let source;\n    if (!writesDepthOrDiscards && !usesLogDepth) {\n      source =\n        \"void main() \\n\" +\n        \"{ \\n\" +\n        \"    out_FragColor = vec4(1.0); \\n\" +\n        \"} \\n\";\n      fs = new ShaderSource({\n        sources: [source],\n      });\n    } else if (!writesDepthOrDiscards && usesLogDepth) {\n      source =\n        \"void main() \\n\" +\n        \"{ \\n\" +\n        \"    out_FragColor = vec4(1.0); \\n\" +\n        \"    czm_writeLogDepth(); \\n\" +\n        \"} \\n\";\n      fs = new ShaderSource({\n        defines: [\"LOG_DEPTH\"],\n        sources: [source],\n      });\n    }\n\n    shader = context.shaderCache.createDerivedShaderProgram(\n      shaderProgram,\n      \"depthOnly\",\n      {\n        vertexShaderSource: shaderProgram.vertexShaderSource,\n        fragmentShaderSource: fs,\n        attributeLocations: attributeLocations,\n      }\n    );\n  }\n\n  return shader;\n}\n\nfunction getDepthOnlyRenderState(scene, renderState) {\n  const cache = scene._depthOnlyRenderStateCache;\n  let depthOnlyState = cache[renderState.id];\n  if (!defined(depthOnlyState)) {\n    const rs = RenderState.getState(renderState);\n    rs.depthMask = true;\n    rs.colorMask = {\n      red: false,\n      green: false,\n      blue: false,\n      alpha: false,\n    };\n\n    depthOnlyState = RenderState.fromCache(rs);\n    cache[renderState.id] = depthOnlyState;\n  }\n\n  return depthOnlyState;\n}\n\nDerivedCommand.createDepthOnlyDerivedCommand = function (\n  scene,\n  command,\n  context,\n  result\n) {\n  // For a depth only pass, we bind a framebuffer with only a depth attachment (no color attachments),\n  // do not write color, and write depth. If the fragment shader doesn't modify the fragment depth\n  // or discard, the driver can replace the fragment shader with a pass-through shader. We're unsure if this\n  // actually happens so we modify the shader to use a pass-through fragment shader.\n\n  if (!defined(result)) {\n    result = {};\n  }\n\n  let shader;\n  let renderState;\n  if (defined(result.depthOnlyCommand)) {\n    shader = result.depthOnlyCommand.shaderProgram;\n    renderState = result.depthOnlyCommand.renderState;\n  }\n\n  result.depthOnlyCommand = DrawCommand.shallowClone(\n    command,\n    result.depthOnlyCommand\n  );\n\n  if (!defined(shader) || result.shaderProgramId !== command.shaderProgram.id) {\n    result.depthOnlyCommand.shaderProgram = getDepthOnlyShaderProgram(\n      context,\n      command.shaderProgram\n    );\n    result.depthOnlyCommand.renderState = getDepthOnlyRenderState(\n      scene,\n      command.renderState\n    );\n    result.shaderProgramId = command.shaderProgram.id;\n  } else {\n    result.depthOnlyCommand.shaderProgram = shader;\n    result.depthOnlyCommand.renderState = renderState;\n  }\n\n  return result;\n};\n\nconst writeLogDepthRegex = /\\s+czm_writeLogDepth\\(/;\nconst vertexlogDepthRegex = /\\s+czm_vertexLogDepth\\(/;\n\nfunction getLogDepthShaderProgram(context, shaderProgram) {\n  const disableLogDepthWrite =\n    shaderProgram.fragmentShaderSource.defines.indexOf(\"LOG_DEPTH_READ_ONLY\") >=\n    0;\n  if (disableLogDepthWrite) {\n    return shaderProgram;\n  }\n\n  let shader = context.shaderCache.getDerivedShaderProgram(\n    shaderProgram,\n    \"logDepth\"\n  );\n  if (!defined(shader)) {\n    const attributeLocations = shaderProgram._attributeLocations;\n    const vs = shaderProgram.vertexShaderSource.clone();\n    const fs = shaderProgram.fragmentShaderSource.clone();\n\n    vs.defines = defined(vs.defines) ? vs.defines.slice(0) : [];\n    vs.defines.push(\"LOG_DEPTH\");\n    fs.defines = defined(fs.defines) ? fs.defines.slice(0) : [];\n    fs.defines.push(\"LOG_DEPTH\");\n\n    let i;\n    let logMain;\n    let writesLogDepth = false;\n    let sources = vs.sources;\n    let length = sources.length;\n    for (i = 0; i < length; ++i) {\n      if (vertexlogDepthRegex.test(sources[i])) {\n        writesLogDepth = true;\n        break;\n      }\n    }\n\n    if (!writesLogDepth) {\n      for (i = 0; i < length; ++i) {\n        sources[i] = ShaderSource.replaceMain(sources[i], \"czm_log_depth_main\");\n      }\n\n      logMain =\n        \"\\n\\n\" +\n        \"void main() \\n\" +\n        \"{ \\n\" +\n        \"    czm_log_depth_main(); \\n\" +\n        \"    czm_vertexLogDepth(); \\n\" +\n        \"} \\n\";\n      sources.push(logMain);\n    }\n\n    sources = fs.sources;\n    length = sources.length;\n\n    writesLogDepth = false;\n    for (i = 0; i < length; ++i) {\n      if (writeLogDepthRegex.test(sources[i])) {\n        writesLogDepth = true;\n      }\n    }\n    // This define indicates that a log depth value is written by the shader but doesn't use czm_writeLogDepth.\n    if (fs.defines.indexOf(\"LOG_DEPTH_WRITE\") !== -1) {\n      writesLogDepth = true;\n    }\n\n    let logSource = \"\";\n\n    if (!writesLogDepth) {\n      for (i = 0; i < length; i++) {\n        sources[i] = ShaderSource.replaceMain(sources[i], \"czm_log_depth_main\");\n      }\n\n      logSource +=\n        \"\\n\" +\n        \"void main() \\n\" +\n        \"{ \\n\" +\n        \"    czm_log_depth_main(); \\n\" +\n        \"    czm_writeLogDepth(); \\n\" +\n        \"} \\n\";\n    }\n\n    sources.push(logSource);\n\n    shader = context.shaderCache.createDerivedShaderProgram(\n      shaderProgram,\n      \"logDepth\",\n      {\n        vertexShaderSource: vs,\n        fragmentShaderSource: fs,\n        attributeLocations: attributeLocations,\n      }\n    );\n  }\n\n  return shader;\n}\n\nDerivedCommand.createLogDepthCommand = function (command, context, result) {\n  if (!defined(result)) {\n    result = {};\n  }\n\n  let shader;\n  if (defined(result.command)) {\n    shader = result.command.shaderProgram;\n  }\n\n  result.command = DrawCommand.shallowClone(command, result.command);\n\n  if (!defined(shader) || result.shaderProgramId !== command.shaderProgram.id) {\n    result.command.shaderProgram = getLogDepthShaderProgram(\n      context,\n      command.shaderProgram\n    );\n    result.shaderProgramId = command.shaderProgram.id;\n  } else {\n    result.command.shaderProgram = shader;\n  }\n\n  return result;\n};\n\nfunction getPickShaderProgram(context, shaderProgram, pickId) {\n  let shader = context.shaderCache.getDerivedShaderProgram(\n    shaderProgram,\n    \"pick\"\n  );\n  if (!defined(shader)) {\n    const attributeLocations = shaderProgram._attributeLocations;\n    let fs = shaderProgram.fragmentShaderSource;\n\n    const sources = fs.sources;\n    const length = sources.length;\n\n    const hasFragData = sources.some((source) =>\n      source.includes(\"out_FragData\")\n    );\n    const outputColorVariable = hasFragData\n      ? \"out_FragData_0\"\n      : \"out_FragColor\";\n    const newMain = `void main () \n{ \n    czm_non_pick_main(); \n    if (${outputColorVariable}.a == 0.0) { \n        discard; \n    } \n    ${outputColorVariable} = ${pickId}; \n} `;\n\n    const newSources = new Array(length + 1);\n    for (let i = 0; i < length; ++i) {\n      newSources[i] = ShaderSource.replaceMain(sources[i], \"czm_non_pick_main\");\n    }\n    newSources[length] = newMain;\n    fs = new ShaderSource({\n      sources: newSources,\n      defines: fs.defines,\n    });\n    shader = context.shaderCache.createDerivedShaderProgram(\n      shaderProgram,\n      \"pick\",\n      {\n        vertexShaderSource: shaderProgram.vertexShaderSource,\n        fragmentShaderSource: fs,\n        attributeLocations: attributeLocations,\n      }\n    );\n  }\n\n  return shader;\n}\n\nfunction getPickRenderState(scene, renderState) {\n  const cache = scene.picking.pickRenderStateCache;\n  let pickState = cache[renderState.id];\n  if (!defined(pickState)) {\n    const rs = RenderState.getState(renderState);\n    rs.blending.enabled = false;\n\n    // Turns on depth writing for opaque and translucent passes\n    // Overlapping translucent geometry on the globe surface may exhibit z-fighting\n    // during the pick pass which may not match the rendered scene. Once\n    // terrain is on by default and ground primitives are used instead\n    // this will become less of a problem.\n    rs.depthMask = true;\n\n    pickState = RenderState.fromCache(rs);\n    cache[renderState.id] = pickState;\n  }\n\n  return pickState;\n}\n\nDerivedCommand.createPickDerivedCommand = function (\n  scene,\n  command,\n  context,\n  result\n) {\n  if (!defined(result)) {\n    result = {};\n  }\n\n  let shader;\n  let renderState;\n  if (defined(result.pickCommand)) {\n    shader = result.pickCommand.shaderProgram;\n    renderState = result.pickCommand.renderState;\n  }\n\n  result.pickCommand = DrawCommand.shallowClone(command, result.pickCommand);\n\n  if (!defined(shader) || result.shaderProgramId !== command.shaderProgram.id) {\n    result.pickCommand.shaderProgram = getPickShaderProgram(\n      context,\n      command.shaderProgram,\n      command.pickId\n    );\n    result.pickCommand.renderState = getPickRenderState(\n      scene,\n      command.renderState\n    );\n    result.shaderProgramId = command.shaderProgram.id;\n  } else {\n    result.pickCommand.shaderProgram = shader;\n    result.pickCommand.renderState = renderState;\n  }\n\n  return result;\n};\n\nfunction getHdrShaderProgram(context, shaderProgram) {\n  let shader = context.shaderCache.getDerivedShaderProgram(\n    shaderProgram,\n    \"HDR\"\n  );\n  if (!defined(shader)) {\n    const attributeLocations = shaderProgram._attributeLocations;\n    const vs = shaderProgram.vertexShaderSource.clone();\n    const fs = shaderProgram.fragmentShaderSource.clone();\n\n    vs.defines = defined(vs.defines) ? vs.defines.slice(0) : [];\n    vs.defines.push(\"HDR\");\n    fs.defines = defined(fs.defines) ? fs.defines.slice(0) : [];\n    fs.defines.push(\"HDR\");\n\n    shader = context.shaderCache.createDerivedShaderProgram(\n      shaderProgram,\n      \"HDR\",\n      {\n        vertexShaderSource: vs,\n        fragmentShaderSource: fs,\n        attributeLocations: attributeLocations,\n      }\n    );\n  }\n\n  return shader;\n}\n\nDerivedCommand.createHdrCommand = function (command, context, result) {\n  if (!defined(result)) {\n    result = {};\n  }\n\n  let shader;\n  if (defined(result.command)) {\n    shader = result.command.shaderProgram;\n  }\n\n  result.command = DrawCommand.shallowClone(command, result.command);\n\n  if (!defined(shader) || result.shaderProgramId !== command.shaderProgram.id) {\n    result.command.shaderProgram = getHdrShaderProgram(\n      context,\n      command.shaderProgram\n    );\n    result.shaderProgramId = command.shaderProgram.id;\n  } else {\n    result.command.shaderProgram = shader;\n  }\n\n  return result;\n};\nexport default DerivedCommand;\n", "import defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\n\n/**\n * @private\n */\nfunction DeviceOrientationCameraController(scene) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._scene = scene;\n\n  this._lastAlpha = undefined;\n  this._lastBeta = undefined;\n  this._lastGamma = undefined;\n\n  this._alpha = undefined;\n  this._beta = undefined;\n  this._gamma = undefined;\n\n  const that = this;\n\n  function callback(e) {\n    const alpha = e.alpha;\n    if (!defined(alpha)) {\n      that._alpha = undefined;\n      that._beta = undefined;\n      that._gamma = undefined;\n      return;\n    }\n\n    that._alpha = CesiumMath.toRadians(alpha);\n    that._beta = CesiumMath.toRadians(e.beta);\n    that._gamma = CesiumMath.toRadians(e.gamma);\n  }\n\n  window.addEventListener(\"deviceorientation\", callback, false);\n\n  this._removeListener = function () {\n    window.removeEventListener(\"deviceorientation\", callback, false);\n  };\n}\n\nconst scratchQuaternion1 = new Quaternion();\nconst scratchQuaternion2 = new Quaternion();\nconst scratchMatrix3 = new Matrix3();\n\nfunction rotate(camera, alpha, beta, gamma) {\n  const direction = camera.direction;\n  const right = camera.right;\n  const up = camera.up;\n\n  const bQuat = Quaternion.fromAxisAngle(direction, beta, scratchQuaternion2);\n  const gQuat = Quaternion.fromAxisAngle(right, gamma, scratchQuaternion1);\n\n  const rotQuat = Quaternion.multiply(gQuat, bQuat, gQuat);\n\n  const aQuat = Quaternion.fromAxisAngle(up, alpha, scratchQuaternion2);\n  Quaternion.multiply(aQuat, rotQuat, rotQuat);\n\n  const matrix = Matrix3.fromQuaternion(rotQuat, scratchMatrix3);\n  Matrix3.multiplyByVector(matrix, right, right);\n  Matrix3.multiplyByVector(matrix, up, up);\n  Matrix3.multiplyByVector(matrix, direction, direction);\n}\n\nDeviceOrientationCameraController.prototype.update = function () {\n  if (!defined(this._alpha)) {\n    return;\n  }\n\n  if (!defined(this._lastAlpha)) {\n    this._lastAlpha = this._alpha;\n    this._lastBeta = this._beta;\n    this._lastGamma = this._gamma;\n  }\n\n  const a = this._lastAlpha - this._alpha;\n  const b = this._lastBeta - this._beta;\n  const g = this._lastGamma - this._gamma;\n\n  rotate(this._scene.camera, -a, b, g);\n\n  this._lastAlpha = this._alpha;\n  this._lastBeta = this._beta;\n  this._lastGamma = this._gamma;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nDeviceOrientationCameraController.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the resources held by this object.  Destroying an object allows for deterministic\n * release of resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nDeviceOrientationCameraController.prototype.destroy = function () {\n  this._removeListener();\n  return destroyObject(this);\n};\nexport default DeviceOrientationCameraController;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defined from \"../Core/defined.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional\n * performance improvements by rendering less geometry and dispatching less terrain requests.\n *\n * @alias Fog\n * @constructor\n */\nfunction Fog() {\n  /**\n   * <code>true</code> if fog is enabled, <code>false</code> otherwise.\n   * @type {boolean}\n   * @default true\n   */\n  this.enabled = true;\n  /**\n   * <code>true</code> if fog is renderable in shaders, <code>false</code> otherwise.\n   * This allows to benefits from optimized tile loading strategy based on fog density without the actual visual rendering.\n   * @type {boolean}\n   * @default true\n   */\n  this.renderable = true;\n  /**\n   * A scalar that determines the density of the fog. Terrain that is in full fog are culled.\n   * The density of the fog increases as this number approaches 1.0 and becomes less dense as it approaches zero.\n   * The more dense the fog is, the more aggressively the terrain is culled. For example, if the camera is a height of\n   * 1000.0m above the ellipsoid, increasing the value to 3.0e-3 will cause many tiles close to the viewer be culled.\n   * Decreasing the value will push the fog further from the viewer, but decrease performance as more of the terrain is rendered.\n   * @type {number}\n   * @default 2.0e-4\n   */\n  this.density = 2.0e-4;\n  /**\n   * A factor used to increase the screen space error of terrain tiles when they are partially in fog. The effect is to reduce\n   * the number of terrain tiles requested for rendering. If set to zero, the feature will be disabled. If the value is increased\n   * for mountainous regions, less tiles will need to be requested, but the terrain meshes near the horizon may be a noticeably\n   * lower resolution. If the value is increased in a relatively flat area, there will be little noticeable change on the horizon.\n   * @type {number}\n   * @default 2.0\n   */\n  this.screenSpaceErrorFactor = 2.0;\n  /**\n   * The minimum brightness of the fog color from lighting. A value of 0.0 can cause the fog to be completely black. A value of 1.0 will not affect\n   * the brightness at all.\n   * @type {number}\n   * @default 0.03\n   */\n  this.minimumBrightness = 0.03;\n}\n\n// These values were found by sampling the density at certain views and finding at what point culled tiles impacted the view at the horizon.\nconst heightsTable = [\n  359.393,\n  800.749,\n  1275.6501,\n  2151.1192,\n  3141.7763,\n  4777.5198,\n  6281.2493,\n  12364.307,\n  15900.765,\n  49889.0549,\n  78026.8259,\n  99260.7344,\n  120036.3873,\n  151011.0158,\n  156091.1953,\n  203849.3112,\n  274866.9803,\n  319916.3149,\n  493552.0528,\n  628733.5874,\n];\nconst densityTable = [\n  2.0e-5,\n  2.0e-4,\n  1.0e-4,\n  7.0e-5,\n  5.0e-5,\n  4.0e-5,\n  3.0e-5,\n  1.9e-5,\n  1.0e-5,\n  8.5e-6,\n  6.2e-6,\n  5.8e-6,\n  5.3e-6,\n  5.2e-6,\n  5.1e-6,\n  4.2e-6,\n  4.0e-6,\n  3.4e-6,\n  2.6e-6,\n  2.2e-6,\n];\n\n// Scale densities by 1e6 to bring lowest value to ~1. Prevents divide by zero.\nfor (let i = 0; i < densityTable.length; ++i) {\n  densityTable[i] *= 1.0e6;\n}\n// Change range to [0, 1].\nconst tableStartDensity = densityTable[1];\nconst tableEndDensity = densityTable[densityTable.length - 1];\nfor (let j = 0; j < densityTable.length; ++j) {\n  densityTable[j] =\n    (densityTable[j] - tableEndDensity) / (tableStartDensity - tableEndDensity);\n}\n\nlet tableLastIndex = 0;\n\nfunction findInterval(height) {\n  const heights = heightsTable;\n  const length = heights.length;\n\n  if (height < heights[0]) {\n    tableLastIndex = 0;\n    return tableLastIndex;\n  } else if (height > heights[length - 1]) {\n    tableLastIndex = length - 2;\n    return tableLastIndex;\n  }\n\n  // Take advantage of temporal coherence by checking current, next and previous intervals\n  // for containment of time.\n  if (height >= heights[tableLastIndex]) {\n    if (tableLastIndex + 1 < length && height < heights[tableLastIndex + 1]) {\n      return tableLastIndex;\n    } else if (\n      tableLastIndex + 2 < length &&\n      height < heights[tableLastIndex + 2]\n    ) {\n      ++tableLastIndex;\n      return tableLastIndex;\n    }\n  } else if (tableLastIndex - 1 >= 0 && height >= heights[tableLastIndex - 1]) {\n    --tableLastIndex;\n    return tableLastIndex;\n  }\n\n  // The above failed so do a linear search.\n  let i;\n  for (i = 0; i < length - 2; ++i) {\n    if (height >= heights[i] && height < heights[i + 1]) {\n      break;\n    }\n  }\n\n  tableLastIndex = i;\n  return tableLastIndex;\n}\n\nconst scratchPositionNormal = new Cartesian3();\n\nFog.prototype.update = function (frameState) {\n  const enabled = (frameState.fog.enabled = this.enabled);\n  if (!enabled) {\n    return;\n  }\n\n  frameState.fog.renderable = this.renderable;\n\n  const camera = frameState.camera;\n  const positionCartographic = camera.positionCartographic;\n\n  // Turn off fog in space.\n  if (\n    !defined(positionCartographic) ||\n    positionCartographic.height > 800000.0 ||\n    frameState.mode !== SceneMode.SCENE3D\n  ) {\n    frameState.fog.enabled = false;\n    return;\n  }\n\n  const height = positionCartographic.height;\n  const i = findInterval(height);\n  const t = CesiumMath.clamp(\n    (height - heightsTable[i]) / (heightsTable[i + 1] - heightsTable[i]),\n    0.0,\n    1.0\n  );\n  let density = CesiumMath.lerp(densityTable[i], densityTable[i + 1], t);\n\n  // Again, scale value to be in the range of densityTable (prevents divide by zero) and change to new range.\n  const startDensity = this.density * 1.0e6;\n  const endDensity = (startDensity / tableStartDensity) * tableEndDensity;\n  density = density * (startDensity - endDensity) * 1.0e-6;\n\n  // Fade fog in as the camera tilts toward the horizon.\n  const positionNormal = Cartesian3.normalize(\n    camera.positionWC,\n    scratchPositionNormal\n  );\n  const dot = Math.abs(Cartesian3.dot(camera.directionWC, positionNormal));\n  density *= 1.0 - dot;\n\n  frameState.fog.density = density;\n  frameState.fog.sse = this.screenSpaceErrorFactor;\n  frameState.fog.minimumBrightness = this.minimumBrightness;\n};\nexport default Fog;\n", "import SceneMode from \"./SceneMode.js\";\n\n/**\n * State information about the current frame.  An instance of this class\n * is provided to update functions.\n *\n * @param {Context} context The rendering context\n * @param {CreditDisplay} creditDisplay Handles adding and removing credits from an HTML element\n * @param {JobScheduler} jobScheduler The job scheduler\n *\n * @alias FrameState\n * @constructor\n *\n * @private\n */\nfunction FrameState(context, creditDisplay, jobScheduler) {\n  /**\n   * The rendering context.\n   *\n   * @type {Context}\n   */\n  this.context = context;\n\n  /**\n   * An array of rendering commands.\n   *\n   * @type {DrawCommand[]}\n   */\n  this.commandList = [];\n\n  /**\n   * An array of shadow maps.\n   * @type {ShadowMap[]}\n   */\n  this.shadowMaps = [];\n\n  /**\n   * The BRDF look up texture generator used for image-based lighting for PBR models\n   * @type {BrdfLutGenerator}\n   */\n  this.brdfLutGenerator = undefined;\n\n  /**\n   * The environment map used for image-based lighting for PBR models\n   * @type {CubeMap}\n   */\n  this.environmentMap = undefined;\n\n  /**\n   * The spherical harmonic coefficients used for image-based lighting for PBR models.\n   * @type {Cartesian3[]}\n   */\n  this.sphericalHarmonicCoefficients = undefined;\n\n  /**\n   * The specular environment atlas used for image-based lighting for PBR models.\n   * @type {Texture}\n   */\n  this.specularEnvironmentMaps = undefined;\n\n  /**\n   * The maximum level-of-detail of the specular environment atlas used for image-based lighting for PBR models.\n   * @type {number}\n   */\n  this.specularEnvironmentMapsMaximumLOD = undefined;\n\n  /**\n   * The current mode of the scene.\n   *\n   * @type {SceneMode}\n   * @default {@link SceneMode.SCENE3D}\n   */\n  this.mode = SceneMode.SCENE3D;\n\n  /**\n   * The current morph transition time between 2D/Columbus View and 3D,\n   * with 0.0 being 2D or Columbus View and 1.0 being 3D.\n   *\n   * @type {number}\n   */\n  this.morphTime = SceneMode.getMorphTime(SceneMode.SCENE3D);\n\n  /**\n   * The current frame number.\n   *\n   * @type {number}\n   * @default 0\n   */\n  this.frameNumber = 0;\n\n  /**\n   * <code>true</code> if a new frame has been issued and the frame number has been updated.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.newFrame = false;\n\n  /**\n   * The scene's current time.\n   *\n   * @type {JulianDate}\n   * @default undefined\n   */\n  this.time = undefined;\n\n  /**\n   * The job scheduler.\n   *\n   * @type {JobScheduler}\n   */\n  this.jobScheduler = jobScheduler;\n\n  /**\n   * The map projection to use in 2D and Columbus View modes.\n   *\n   * @type {MapProjection}\n   * @default undefined\n   */\n  this.mapProjection = undefined;\n\n  /**\n   * The current camera.\n   *\n   * @type {Camera}\n   * @default undefined\n   */\n  this.camera = undefined;\n\n  /**\n   * Whether the camera is underground.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.cameraUnderground = false;\n\n  /**\n   * The {@link GlobeTranslucencyState} object used by the scene.\n   *\n   * @type {GlobeTranslucencyState}\n   * @default undefined\n   */\n  this.globeTranslucencyState = undefined;\n\n  /**\n   * The culling volume.\n   *\n   * @type {CullingVolume}\n   * @default undefined\n   */\n  this.cullingVolume = undefined;\n\n  /**\n   * The current occluder.\n   *\n   * @type {Occluder}\n   * @default undefined\n   */\n  this.occluder = undefined;\n\n  /**\n   * The maximum screen-space error used to drive level-of-detail refinement.  Higher\n   * values will provide better performance but lower visual quality.\n   *\n   * @type {number}\n   * @default 2\n   */\n  this.maximumScreenSpaceError = undefined;\n\n  /**\n   * Ratio between a pixel and a density-independent pixel. Provides a standard unit of\n   * measure for real pixel measurements appropriate to a particular device.\n   *\n   * @type {number}\n   * @default 1.0\n   */\n  this.pixelRatio = 1.0;\n\n  /**\n   * @typedef FrameState.Passes\n   * @type {object}\n   * @property {boolean} render <code>true</code> if the primitive should update for a render pass, <code>false</code> otherwise.\n   * @property {boolean} pick <code>true</code> if the primitive should update for a picking pass, <code>false</code> otherwise.\n   * @property {boolean} depth <code>true</code> if the primitive should update for a depth only pass, <code>false</code> otherwise.\n   * @property {boolean} postProcess <code>true</code> if the primitive should update for a per-feature post-process pass, <code>false</code> otherwise.\n   * @property {boolean} offscreen <code>true</code> if the primitive should update for an offscreen pass, <code>false</code> otherwise.\n   */\n\n  /**\n   * @type {FrameState.Passes}\n   */\n  this.passes = {\n    /**\n     * @default false\n     */\n    render: false,\n    /**\n     * @default false\n     */\n    pick: false,\n    /**\n     * @default false\n     */\n    depth: false,\n    /**\n     * @default false\n     */\n    postProcess: false,\n    /**\n     * @default false\n     */\n    offscreen: false,\n  };\n\n  /**\n   * The credit display.\n   *\n   * @type {CreditDisplay}\n   */\n  this.creditDisplay = creditDisplay;\n\n  /**\n   * An array of functions to be called at the end of the frame.  This array\n   * will be cleared after each frame.\n   * <p>\n   * This allows queueing up events in <code>update</code> functions and\n   * firing them at a time when the subscribers are free to change the\n   * scene state, e.g., manipulate the camera, instead of firing events\n   * directly in <code>update</code> functions.\n   * </p>\n   * <p>\n   * If any function in the array returns <code>true</code>, in request render mode\n   * another frame will be rendered.\n   * </p>\n   *\n   * @type {FrameState.AfterRenderCallback[]}\n   *\n   * @example\n   * frameState.afterRender.push(function() {\n   *   // take some action, raise an event, etc.\n   * });\n   */\n  this.afterRender = [];\n\n  /**\n   * Gets whether or not to optimize for 3D only.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.scene3DOnly = false;\n\n  /**\n   * @typedef FrameState.Fog\n   * @type {object}\n   * @property {boolean} enabled <code>true</code> if fog is enabled, <code>false</code> otherwise.\n   * @property {number} density A positive number used to mix the color and fog color based on camera distance.\n   * @property {number} sse A scalar used to modify the screen space error of geometry partially in fog.\n   * @property {number} minimumBrightness The minimum brightness of terrain with fog applied.\n   */\n\n  /**\n   * @type {FrameState.Fog}\n   */\n\n  this.fog = {\n    /**\n     * @default false\n     */\n    enabled: false,\n    density: undefined,\n    sse: undefined,\n    minimumBrightness: undefined,\n  };\n\n  /**\n   * A scalar used to vertically exaggerate the scene\n   * @type {number}\n   * @default 1.0\n   */\n  this.verticalExaggeration = 1.0;\n\n  /**\n   * The height relative to which the scene is vertically exaggerated.\n   * @type {number}\n   * @default 0.0\n   */\n  this.verticalExaggerationRelativeHeight = 0.0;\n\n  /**\n   * @typedef FrameState.ShadowState\n   * @type {object}\n   * @property {boolean} shadowsEnabled Whether there are any active shadow maps this frame.\n   * @property {boolean} lightShadowsEnabled Whether there are any active shadow maps that originate from light sources. Does not include shadow maps that are used for analytical purposes.\n   * @property {ShadowMap[]} shadowMaps All shadow maps that are enabled this frame.\n   * @property {ShadowMap[]} lightShadowMaps Shadow maps that originate from light sources. Does not include shadow maps that are used for analytical purposes. Only these shadow maps will be used to generate receive shadows shaders.\n   * @property {number} nearPlane The near plane of the scene's frustum commands. Used for fitting cascaded shadow maps.\n   * @property {number} farPlane The far plane of the scene's frustum commands. Used for fitting cascaded shadow maps.\n   * @property {number} closestObjectSize The size of the bounding volume that is closest to the camera. This is used to place more shadow detail near the object.\n   * @property {number} lastDirtyTime The time when a shadow map was last dirty\n   * @property {boolean} outOfView Whether the shadows maps are out of view this frame\n   */\n\n  /**\n   * @type {FrameState.ShadowState}\n   */\n\n  this.shadowState = {\n    /**\n     * @default true\n     */\n    shadowsEnabled: true,\n    shadowMaps: [],\n    lightShadowMaps: [],\n    /**\n     * @default 1.0\n     */\n    nearPlane: 1.0,\n    /**\n     * @default 5000.0\n     */\n    farPlane: 5000.0,\n    /**\n     * @default 1000.0\n     */\n    closestObjectSize: 1000.0,\n    /**\n     * @default 0\n     */\n    lastDirtyTime: 0,\n    /**\n     * @default true\n     */\n    outOfView: true,\n  };\n\n  /**\n   * The position of the splitter to use when rendering different things on either side of a splitter.\n   * This value should be between 0.0 and 1.0 with 0 being the far left of the viewport and 1 being the far right of the viewport.\n   * @type {number}\n   * @default 0.0\n   */\n  this.splitPosition = 0.0;\n\n  /**\n   * Distances to the near and far planes of the camera frustums\n   * @type {number[]}\n   * @default []\n   */\n  this.frustumSplits = [];\n\n  /**\n   * The current scene background color\n   *\n   * @type {Color}\n   */\n  this.backgroundColor = undefined;\n\n  /**\n   * The light used to shade the scene.\n   *\n   * @type {Light}\n   */\n  this.light = undefined;\n\n  /**\n   * The distance from the camera at which to disable the depth test of billboards, labels and points\n   * to, for example, prevent clipping against terrain. When set to zero, the depth test should always\n   * be applied. When less than zero, the depth test should never be applied.\n   * @type {number}\n   */\n  this.minimumDisableDepthTestDistance = undefined;\n\n  /**\n   * When <code>false</code>, 3D Tiles will render normally. When <code>true</code>, classified 3D Tile geometry will render normally and\n   * unclassified 3D Tile geometry will render with the color multiplied with {@link FrameState#invertClassificationColor}.\n   * @type {boolean}\n   * @default false\n   */\n  this.invertClassification = false;\n\n  /**\n   * The highlight color of unclassified 3D Tile geometry when {@link FrameState#invertClassification} is <code>true</code>.\n   * @type {Color}\n   */\n  this.invertClassificationColor = undefined;\n\n  /**\n   * Whether or not the scene uses a logarithmic depth buffer.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.useLogDepth = false;\n\n  /**\n   * Additional state used to update 3D Tilesets.\n   *\n   * @type {Cesium3DTilePassState}\n   */\n  this.tilesetPassState = undefined;\n\n  /**\n   * The minimum terrain height out of all rendered terrain tiles. Used to improve culling for objects underneath the ellipsoid but above terrain.\n   *\n   * @type {number}\n   * @default 0.0\n   */\n  this.minimumTerrainHeight = 0.0;\n}\n\n/**\n * A function that will be called at the end of the frame.\n *\n * @callback FrameState.AfterRenderCallback\n * @returns {boolean} true if another render should be requested in request render mode\n */\nexport default FrameState;\n", "import combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport CullFace from \"./CullFace.js\";\nimport SceneMode from \"./SceneMode.js\";\n\nconst DerivedCommandType = {\n  OPAQUE_FRONT_FACE: 0,\n  OPAQUE_BACK_FACE: 1,\n  DEPTH_ONLY_FRONT_FACE: 2,\n  DEPTH_ONLY_BACK_FACE: 3,\n  DEPTH_ONLY_FRONT_AND_BACK_FACE: 4,\n  TRANSLUCENT_FRONT_FACE: 5,\n  TRANSLUCENT_BACK_FACE: 6,\n  TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST: 7,\n  TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST: 8,\n  PICK_FRONT_FACE: 9,\n  PICK_BACK_FACE: 10,\n  DERIVED_COMMANDS_MAXIMUM_LENGTH: 11,\n};\n\nconst derivedCommandsMaximumLength =\n  DerivedCommandType.DERIVED_COMMANDS_MAXIMUM_LENGTH;\n\nconst DerivedCommandNames = [\n  \"opaqueFrontFaceCommand\",\n  \"opaqueBackFaceCommand\",\n  \"depthOnlyFrontFaceCommand\",\n  \"depthOnlyBackFaceCommand\",\n  \"depthOnlyFrontAndBackFaceCommand\",\n  \"translucentFrontFaceCommand\",\n  \"translucentBackFaceCommand\",\n  \"translucentFrontFaceManualDepthTestCommand\",\n  \"translucentBackFaceManualDepthTestCommand\",\n  \"pickFrontFaceCommand\",\n  \"pickBackFaceCommand\",\n];\n\n/**\n * @private\n */\nfunction GlobeTranslucencyState() {\n  this._frontFaceAlphaByDistance = new NearFarScalar(0.0, 1.0, 0.0, 1.0);\n  this._backFaceAlphaByDistance = new NearFarScalar(0.0, 1.0, 0.0, 1.0);\n\n  this._frontFaceTranslucent = false;\n  this._backFaceTranslucent = false;\n  this._requiresManualDepthTest = false;\n  this._sunVisibleThroughGlobe = false;\n  this._environmentVisible = false;\n  this._useDepthPlane = false;\n  this._numberOfTextureUniforms = 0;\n  this._globeTranslucencyFramebuffer = undefined;\n  this._rectangle = Rectangle.clone(Rectangle.MAX_VALUE);\n\n  this._derivedCommandKey = 0;\n  this._derivedCommandsDirty = false;\n  this._derivedCommandPacks = undefined;\n\n  this._derivedCommandTypes = new Array(derivedCommandsMaximumLength);\n  this._derivedBlendCommandTypes = new Array(derivedCommandsMaximumLength);\n  this._derivedPickCommandTypes = new Array(derivedCommandsMaximumLength);\n  this._derivedCommandTypesToUpdate = new Array(derivedCommandsMaximumLength);\n\n  this._derivedCommandsLength = 0;\n  this._derivedBlendCommandsLength = 0;\n  this._derivedPickCommandsLength = 0;\n  this._derivedCommandsToUpdateLength = 0;\n}\n\nObject.defineProperties(GlobeTranslucencyState.prototype, {\n  frontFaceAlphaByDistance: {\n    get: function () {\n      return this._frontFaceAlphaByDistance;\n    },\n  },\n  backFaceAlphaByDistance: {\n    get: function () {\n      return this._backFaceAlphaByDistance;\n    },\n  },\n  translucent: {\n    get: function () {\n      return this._frontFaceTranslucent;\n    },\n  },\n  sunVisibleThroughGlobe: {\n    get: function () {\n      return this._sunVisibleThroughGlobe;\n    },\n  },\n  environmentVisible: {\n    get: function () {\n      return this._environmentVisible;\n    },\n  },\n  useDepthPlane: {\n    get: function () {\n      return this._useDepthPlane;\n    },\n  },\n  numberOfTextureUniforms: {\n    get: function () {\n      return this._numberOfTextureUniforms;\n    },\n  },\n  rectangle: {\n    get: function () {\n      return this._rectangle;\n    },\n  },\n});\n\nGlobeTranslucencyState.prototype.update = function (scene) {\n  const globe = scene.globe;\n  if (!defined(globe) || !globe.show) {\n    this._frontFaceTranslucent = false;\n    this._backFaceTranslucent = false;\n    this._sunVisibleThroughGlobe = true;\n    this._environmentVisible = true;\n    this._useDepthPlane = false;\n    return;\n  }\n\n  this._frontFaceAlphaByDistance = updateAlphaByDistance(\n    globe.translucency.enabled,\n    globe.translucency.frontFaceAlpha,\n    globe.translucency.frontFaceAlphaByDistance,\n    this._frontFaceAlphaByDistance\n  );\n  this._backFaceAlphaByDistance = updateAlphaByDistance(\n    globe.translucency.enabled,\n    globe.translucency.backFaceAlpha,\n    globe.translucency.backFaceAlphaByDistance,\n    this._backFaceAlphaByDistance\n  );\n\n  this._frontFaceTranslucent = isFaceTranslucent(\n    globe.translucency.enabled,\n    this._frontFaceAlphaByDistance,\n    globe\n  );\n  this._backFaceTranslucent = isFaceTranslucent(\n    globe.translucency.enabled,\n    this._backFaceAlphaByDistance,\n    globe\n  );\n\n  this._requiresManualDepthTest = requiresManualDepthTest(this, scene, globe);\n\n  this._sunVisibleThroughGlobe = isSunVisibleThroughGlobe(this, scene);\n  this._environmentVisible = isEnvironmentVisible(this, scene);\n  this._useDepthPlane = useDepthPlane(this, scene);\n  this._numberOfTextureUniforms = getNumberOfTextureUniforms(this);\n\n  this._rectangle = Rectangle.clone(\n    globe.translucency.rectangle,\n    this._rectangle\n  );\n\n  gatherDerivedCommandRequirements(this, scene);\n};\n\nfunction updateAlphaByDistance(enabled, alpha, alphaByDistance, result) {\n  if (!enabled) {\n    result.nearValue = 1.0;\n    result.farValue = 1.0;\n    return result;\n  }\n\n  if (!defined(alphaByDistance)) {\n    result.nearValue = alpha;\n    result.farValue = alpha;\n    return result;\n  }\n\n  NearFarScalar.clone(alphaByDistance, result);\n  result.nearValue *= alpha;\n  result.farValue *= alpha;\n  return result;\n}\n\nfunction isFaceTranslucent(translucencyEnabled, alphaByDistance, globe) {\n  return (\n    translucencyEnabled &&\n    (globe.baseColor.alpha < 1.0 ||\n      alphaByDistance.nearValue < 1.0 ||\n      alphaByDistance.farValue < 1.0)\n  );\n}\n\nfunction isSunVisibleThroughGlobe(state, scene) {\n  // The sun is visible through the globe if the front and back faces are translucent when above ground\n  // or if front faces are translucent when below ground\n  const frontTranslucent = state._frontFaceTranslucent;\n  const backTranslucent = state._backFaceTranslucent;\n  return frontTranslucent && (scene.cameraUnderground || backTranslucent);\n}\n\nfunction isEnvironmentVisible(state, scene) {\n  // The environment is visible if the camera is above ground or underground with translucency\n  return !scene.cameraUnderground || state._frontFaceTranslucent;\n}\n\nfunction useDepthPlane(state, scene) {\n  // Use the depth plane when the camera is above ground and the globe is opaque\n  return !scene.cameraUnderground && !state._frontFaceTranslucent;\n}\n\nfunction requiresManualDepthTest(state, scene, globe) {\n  return (\n    state._frontFaceTranslucent &&\n    !state._backFaceTranslucent &&\n    !globe.depthTestAgainstTerrain &&\n    scene.mode !== SceneMode.SCENE2D &&\n    scene.context.depthTexture\n  );\n}\n\nfunction getNumberOfTextureUniforms(state) {\n  let numberOfTextureUniforms = 0;\n\n  if (state._frontFaceTranslucent) {\n    ++numberOfTextureUniforms; // classification texture\n  }\n\n  if (state._requiresManualDepthTest) {\n    ++numberOfTextureUniforms; // czm_globeDepthTexture for manual depth testing\n  }\n\n  return numberOfTextureUniforms;\n}\n\nfunction gatherDerivedCommandRequirements(state, scene) {\n  state._derivedCommandsLength = getDerivedCommandTypes(\n    state,\n    scene,\n    false,\n    false,\n    state._derivedCommandTypes\n  );\n\n  state._derivedBlendCommandsLength = getDerivedCommandTypes(\n    state,\n    scene,\n    true,\n    false,\n    state._derivedBlendCommandTypes\n  );\n\n  state._derivedPickCommandsLength = getDerivedCommandTypes(\n    state,\n    scene,\n    false,\n    true,\n    state._derivedPickCommandTypes\n  );\n\n  let i;\n\n  let derivedCommandKey = 0;\n  for (i = 0; i < state._derivedCommandsLength; ++i) {\n    derivedCommandKey |= 1 << state._derivedCommandTypes[i];\n  }\n  for (i = 0; i < state._derivedBlendCommandsLength; ++i) {\n    derivedCommandKey |= 1 << state._derivedBlendCommandTypes[i];\n  }\n  for (i = 0; i < state._derivedPickCommandsLength; ++i) {\n    derivedCommandKey |= 1 << state._derivedPickCommandTypes[i];\n  }\n\n  let derivedCommandsToUpdateLength = 0;\n  for (i = 0; i < derivedCommandsMaximumLength; ++i) {\n    if ((derivedCommandKey & (1 << i)) > 0) {\n      state._derivedCommandTypesToUpdate[derivedCommandsToUpdateLength++] = i;\n    }\n  }\n  state._derivedCommandsToUpdateLength = derivedCommandsToUpdateLength;\n\n  const derivedCommandsDirty = derivedCommandKey !== state._derivedCommandKey;\n  state._derivedCommandKey = derivedCommandKey;\n  state._derivedCommandsDirty = derivedCommandsDirty;\n\n  if (!defined(state._derivedCommandPacks) && state._frontFaceTranslucent) {\n    state._derivedCommandPacks = createDerivedCommandPacks();\n  }\n}\n\nfunction getDerivedCommandTypes(\n  state,\n  scene,\n  isBlendCommand,\n  isPickCommand,\n  types\n) {\n  let length = 0;\n\n  const frontTranslucent = state._frontFaceTranslucent;\n  const backTranslucent = state._backFaceTranslucent;\n\n  if (!frontTranslucent) {\n    // Don't use derived commands if the globe is opaque\n    return length;\n  }\n\n  const cameraUnderground = scene.cameraUnderground;\n  const requiresManualDepthTest = state._requiresManualDepthTest;\n\n  const translucentFrontFaceCommandType = isPickCommand\n    ? DerivedCommandType.PICK_FRONT_FACE\n    : requiresManualDepthTest\n    ? DerivedCommandType.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST\n    : DerivedCommandType.TRANSLUCENT_FRONT_FACE;\n\n  const translucentBackFaceCommandType = isPickCommand\n    ? DerivedCommandType.PICK_BACK_FACE\n    : requiresManualDepthTest\n    ? DerivedCommandType.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST\n    : DerivedCommandType.TRANSLUCENT_BACK_FACE;\n\n  if (scene.mode === SceneMode.SCENE2D) {\n    types[length++] = DerivedCommandType.DEPTH_ONLY_FRONT_FACE;\n    types[length++] = translucentFrontFaceCommandType;\n    return length;\n  }\n\n  if (backTranslucent) {\n    // Push depth-only command for classification. Blend commands do not need to write depth.\n    // Push translucent commands for front and back faces.\n    if (!isBlendCommand) {\n      types[length++] = DerivedCommandType.DEPTH_ONLY_FRONT_AND_BACK_FACE;\n    }\n    if (cameraUnderground) {\n      types[length++] = translucentFrontFaceCommandType;\n      types[length++] = translucentBackFaceCommandType;\n    } else {\n      types[length++] = translucentBackFaceCommandType;\n      types[length++] = translucentFrontFaceCommandType;\n    }\n  } else {\n    // Push opaque command for the face that appears in back.\n    // Push depth-only command and translucent command for the face that appears in front.\n    // eslint-disable-next-line no-lonely-if\n    if (cameraUnderground) {\n      if (!isBlendCommand) {\n        types[length++] = DerivedCommandType.DEPTH_ONLY_BACK_FACE;\n      }\n      types[length++] = DerivedCommandType.OPAQUE_FRONT_FACE;\n      types[length++] = translucentBackFaceCommandType;\n    } else {\n      if (!isBlendCommand) {\n        types[length++] = DerivedCommandType.DEPTH_ONLY_FRONT_FACE;\n      }\n      types[length++] = DerivedCommandType.OPAQUE_BACK_FACE;\n      types[length++] = translucentFrontFaceCommandType;\n    }\n  }\n\n  return length;\n}\n\nfunction removeDefine(defines, defineToRemove) {\n  const index = defines.indexOf(defineToRemove);\n  if (index > -1) {\n    defines.splice(index, 1);\n  }\n}\n\nfunction hasDefine(defines, define) {\n  return defines.indexOf(define) > -1;\n}\n\nfunction getOpaqueFrontFaceShaderProgram(vs, fs) {\n  removeDefine(vs.defines, \"TRANSLUCENT\");\n  removeDefine(fs.defines, \"TRANSLUCENT\");\n}\n\nfunction getOpaqueBackFaceShaderProgram(vs, fs) {\n  removeDefine(vs.defines, \"GROUND_ATMOSPHERE\");\n  removeDefine(fs.defines, \"GROUND_ATMOSPHERE\");\n  removeDefine(vs.defines, \"FOG\");\n  removeDefine(fs.defines, \"FOG\");\n  removeDefine(vs.defines, \"TRANSLUCENT\");\n  removeDefine(fs.defines, \"TRANSLUCENT\");\n}\n\nfunction getDepthOnlyShaderProgram(vs, fs) {\n  if (\n    hasDefine(fs.defines, \"TILE_LIMIT_RECTANGLE\") ||\n    hasDefine(fs.defines, \"ENABLE_CLIPPING_PLANES\")\n  ) {\n    // Need to execute the full shader if discard is called\n    return;\n  }\n\n  const depthOnlyShader =\n    \"void main() \\n\" + \"{ \\n\" + \"    out_FragColor = vec4(1.0); \\n\" + \"} \\n\";\n\n  fs.sources = [depthOnlyShader];\n}\n\nfunction getTranslucentShaderProgram(vs, fs) {\n  const sources = fs.sources;\n  const length = sources.length;\n  for (let i = 0; i < length; ++i) {\n    sources[i] = ShaderSource.replaceMain(\n      sources[i],\n      \"czm_globe_translucency_main\"\n    );\n  }\n\n  const globeTranslucencyMain =\n    \"\\n\\n\" +\n    \"uniform sampler2D u_classificationTexture; \\n\" +\n    \"void main() \\n\" +\n    \"{ \\n\" +\n    \"    vec2 st = gl_FragCoord.xy / czm_viewport.zw; \\n\" +\n    \"#ifdef MANUAL_DEPTH_TEST \\n\" +\n    \"    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); \\n\" +\n    \"    if (logDepthOrDepth != 0.0) \\n\" +\n    \"    { \\n\" +\n    \"        vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); \\n\" +\n    \"        float depthEC = eyeCoordinate.z / eyeCoordinate.w; \\n\" +\n    \"        if (v_positionEC.z < depthEC) \\n\" +\n    \"        { \\n\" +\n    \"            discard; \\n\" +\n    \"        } \\n\" +\n    \"    } \\n\" +\n    \"#endif \\n\" +\n    \"    czm_globe_translucency_main(); \\n\" +\n    \"    vec4 classificationColor = texture(u_classificationTexture, st); \\n\" +\n    \"    if (classificationColor.a > 0.0) \\n\" +\n    \"    { \\n\" +\n    \"        // Reverse premultiplication process to get the correct composited result of the classification primitives \\n\" +\n    \"        classificationColor.rgb /= classificationColor.a; \\n\" +\n    \"    } \\n\" +\n    \"    out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); \\n\" +\n    \"} \\n\";\n\n  sources.push(globeTranslucencyMain);\n}\n\nfunction getTranslucentBackFaceShaderProgram(vs, fs) {\n  getTranslucentShaderProgram(vs, fs);\n  removeDefine(vs.defines, \"GROUND_ATMOSPHERE\");\n  removeDefine(fs.defines, \"GROUND_ATMOSPHERE\");\n  removeDefine(vs.defines, \"FOG\");\n  removeDefine(fs.defines, \"FOG\");\n}\n\nfunction getTranslucentFrontFaceManualDepthTestShaderProgram(vs, fs) {\n  getTranslucentShaderProgram(vs, fs);\n  vs.defines.push(\"GENERATE_POSITION\");\n  fs.defines.push(\"MANUAL_DEPTH_TEST\");\n}\n\nfunction getTranslucentBackFaceManualDepthTestShaderProgram(vs, fs) {\n  getTranslucentBackFaceShaderProgram(vs, fs);\n  vs.defines.push(\"GENERATE_POSITION\");\n  fs.defines.push(\"MANUAL_DEPTH_TEST\");\n}\n\nfunction getPickShaderProgram(vs, fs) {\n  const pickShader =\n    \"uniform sampler2D u_classificationTexture; \\n\" +\n    \"void main() \\n\" +\n    \"{ \\n\" +\n    \"    vec2 st = gl_FragCoord.xy / czm_viewport.zw; \\n\" +\n    \"    vec4 pickColor = texture(u_classificationTexture, st); \\n\" +\n    \"    if (pickColor == vec4(0.0)) \\n\" +\n    \"    { \\n\" +\n    \"        discard; \\n\" +\n    \"    } \\n\" +\n    \"    out_FragColor = pickColor; \\n\" +\n    \"} \\n\";\n\n  fs.sources = [pickShader];\n}\n\nfunction getDerivedShaderProgram(\n  context,\n  shaderProgram,\n  derivedShaderProgram,\n  shaderProgramDirty,\n  getShaderProgramFunction,\n  cacheName\n) {\n  if (!defined(getShaderProgramFunction)) {\n    return shaderProgram;\n  }\n\n  if (!shaderProgramDirty && defined(derivedShaderProgram)) {\n    return derivedShaderProgram;\n  }\n\n  let shader = context.shaderCache.getDerivedShaderProgram(\n    shaderProgram,\n    cacheName\n  );\n  if (!defined(shader)) {\n    const attributeLocations = shaderProgram._attributeLocations;\n    const vs = shaderProgram.vertexShaderSource.clone();\n    const fs = shaderProgram.fragmentShaderSource.clone();\n    vs.defines = defined(vs.defines) ? vs.defines.slice(0) : [];\n    fs.defines = defined(fs.defines) ? fs.defines.slice(0) : [];\n\n    getShaderProgramFunction(vs, fs);\n\n    shader = context.shaderCache.createDerivedShaderProgram(\n      shaderProgram,\n      cacheName,\n      {\n        vertexShaderSource: vs,\n        fragmentShaderSource: fs,\n        attributeLocations: attributeLocations,\n      }\n    );\n  }\n\n  return shader;\n}\n\nfunction getOpaqueFrontFaceRenderState(renderState) {\n  renderState.cull.face = CullFace.BACK;\n  renderState.cull.enabled = true;\n}\n\nfunction getOpaqueBackFaceRenderState(renderState) {\n  renderState.cull.face = CullFace.FRONT;\n  renderState.cull.enabled = true;\n}\n\nfunction getDepthOnlyFrontFaceRenderState(renderState) {\n  renderState.cull.face = CullFace.BACK;\n  renderState.cull.enabled = true;\n  renderState.colorMask = {\n    red: false,\n    green: false,\n    blue: false,\n    alpha: false,\n  };\n}\n\nfunction getDepthOnlyBackFaceRenderState(renderState) {\n  renderState.cull.face = CullFace.FRONT;\n  renderState.cull.enabled = true;\n  renderState.colorMask = {\n    red: false,\n    green: false,\n    blue: false,\n    alpha: false,\n  };\n}\n\nfunction getDepthOnlyFrontAndBackFaceRenderState(renderState) {\n  renderState.cull.enabled = false;\n  renderState.colorMask = {\n    red: false,\n    green: false,\n    blue: false,\n    alpha: false,\n  };\n}\n\nfunction getTranslucentFrontFaceRenderState(renderState) {\n  renderState.cull.face = CullFace.BACK;\n  renderState.cull.enabled = true;\n  renderState.depthMask = false;\n  renderState.blending = BlendingState.ALPHA_BLEND;\n}\n\nfunction getTranslucentBackFaceRenderState(renderState) {\n  renderState.cull.face = CullFace.FRONT;\n  renderState.cull.enabled = true;\n  renderState.depthMask = false;\n  renderState.blending = BlendingState.ALPHA_BLEND;\n}\n\nfunction getPickFrontFaceRenderState(renderState) {\n  renderState.cull.face = CullFace.BACK;\n  renderState.cull.enabled = true;\n  renderState.blending.enabled = false;\n}\n\nfunction getPickBackFaceRenderState(renderState) {\n  renderState.cull.face = CullFace.FRONT;\n  renderState.cull.enabled = true;\n  renderState.blending.enabled = false;\n}\n\nfunction getDerivedRenderState(\n  renderState,\n  derivedRenderState,\n  renderStateDirty,\n  getRenderStateFunction,\n  cache\n) {\n  if (!defined(getRenderStateFunction)) {\n    return renderState;\n  }\n\n  if (!renderStateDirty && defined(derivedRenderState)) {\n    return derivedRenderState;\n  }\n\n  let cachedRenderState = cache[renderState.id];\n  if (!defined(cachedRenderState)) {\n    const rs = RenderState.getState(renderState);\n    getRenderStateFunction(rs);\n    cachedRenderState = RenderState.fromCache(rs);\n    cache[renderState.id] = cachedRenderState;\n  }\n\n  return cachedRenderState;\n}\n\nfunction getTranslucencyUniformMap(state) {\n  return {\n    u_classificationTexture: function () {\n      return state._globeTranslucencyFramebuffer.classificationTexture;\n    },\n  };\n}\n\nfunction getDerivedUniformMap(\n  state,\n  uniformMap,\n  derivedUniformMap,\n  uniformMapDirty,\n  getDerivedUniformMapFunction\n) {\n  if (!defined(getDerivedUniformMapFunction)) {\n    return uniformMap;\n  }\n\n  if (!uniformMapDirty && defined(derivedUniformMap)) {\n    return derivedUniformMap;\n  }\n\n  return combine(uniformMap, getDerivedUniformMapFunction(state), false);\n}\n\nfunction DerivedCommandPack(options) {\n  this.pass = options.pass;\n  this.pickOnly = options.pickOnly;\n  this.getShaderProgramFunction = options.getShaderProgramFunction;\n  this.getRenderStateFunction = options.getRenderStateFunction;\n  this.getUniformMapFunction = options.getUniformMapFunction;\n  this.renderStateCache = {};\n}\n\nfunction createDerivedCommandPacks() {\n  return [\n    // opaqueFrontFaceCommand\n    new DerivedCommandPack({\n      pass: Pass.GLOBE,\n      pickOnly: false,\n      getShaderProgramFunction: getOpaqueFrontFaceShaderProgram,\n      getRenderStateFunction: getOpaqueFrontFaceRenderState,\n      getUniformMapFunction: undefined,\n    }),\n    // opaqueBackFaceCommand\n    new DerivedCommandPack({\n      pass: Pass.GLOBE,\n      pickOnly: false,\n      getShaderProgramFunction: getOpaqueBackFaceShaderProgram,\n      getRenderStateFunction: getOpaqueBackFaceRenderState,\n      getUniformMapFunction: undefined,\n    }),\n    // depthOnlyFrontFaceCommand\n    new DerivedCommandPack({\n      pass: Pass.GLOBE,\n      pickOnly: false,\n      getShaderProgramFunction: getDepthOnlyShaderProgram,\n      getRenderStateFunction: getDepthOnlyFrontFaceRenderState,\n      getUniformMapFunction: undefined,\n    }),\n    // depthOnlyBackFaceCommand\n    new DerivedCommandPack({\n      pass: Pass.GLOBE,\n      pickOnly: false,\n      getShaderProgramFunction: getDepthOnlyShaderProgram,\n      getRenderStateFunction: getDepthOnlyBackFaceRenderState,\n      getUniformMapFunction: undefined,\n    }),\n    // depthOnlyFrontAndBackFaceCommand\n    new DerivedCommandPack({\n      pass: Pass.GLOBE,\n      pickOnly: false,\n      getShaderProgramFunction: getDepthOnlyShaderProgram,\n      getRenderStateFunction: getDepthOnlyFrontAndBackFaceRenderState,\n      getUniformMapFunction: undefined,\n    }),\n    // translucentFrontFaceCommand\n    new DerivedCommandPack({\n      pass: Pass.TRANSLUCENT,\n      pickOnly: false,\n      getShaderProgramFunction: getTranslucentShaderProgram,\n      getRenderStateFunction: getTranslucentFrontFaceRenderState,\n      getUniformMapFunction: getTranslucencyUniformMap,\n    }),\n    // translucentBackFaceCommand\n    new DerivedCommandPack({\n      pass: Pass.TRANSLUCENT,\n      pickOnly: false,\n      getShaderProgramFunction: getTranslucentBackFaceShaderProgram,\n      getRenderStateFunction: getTranslucentBackFaceRenderState,\n      getUniformMapFunction: getTranslucencyUniformMap,\n    }),\n    // translucentFrontFaceManualDepthTestCommand\n    new DerivedCommandPack({\n      pass: Pass.TRANSLUCENT,\n      pickOnly: false,\n      getShaderProgramFunction: getTranslucentFrontFaceManualDepthTestShaderProgram,\n      getRenderStateFunction: getTranslucentFrontFaceRenderState,\n      getUniformMapFunction: getTranslucencyUniformMap,\n    }),\n    // translucentBackFaceManualDepthTestCommand\n    new DerivedCommandPack({\n      pass: Pass.TRANSLUCENT,\n      pickOnly: false,\n      getShaderProgramFunction: getTranslucentBackFaceManualDepthTestShaderProgram,\n      getRenderStateFunction: getTranslucentBackFaceRenderState,\n      getUniformMapFunction: getTranslucencyUniformMap,\n    }),\n    // pickFrontFaceCommand\n    new DerivedCommandPack({\n      pass: Pass.TRANSLUCENT,\n      pickOnly: true,\n      getShaderProgramFunction: getPickShaderProgram,\n      getRenderStateFunction: getPickFrontFaceRenderState,\n      getUniformMapFunction: getTranslucencyUniformMap,\n    }),\n    // pickBackFaceCommand\n    new DerivedCommandPack({\n      pass: Pass.TRANSLUCENT,\n      pickOnly: true,\n      getShaderProgramFunction: getPickShaderProgram,\n      getRenderStateFunction: getPickBackFaceRenderState,\n      getUniformMapFunction: getTranslucencyUniformMap,\n    }),\n  ];\n}\n\nconst derivedCommandNames = new Array(derivedCommandsMaximumLength);\nconst derivedCommandPacks = new Array(derivedCommandsMaximumLength);\n\nGlobeTranslucencyState.prototype.updateDerivedCommands = function (\n  command,\n  frameState\n) {\n  const derivedCommandTypes = this._derivedCommandTypesToUpdate;\n  const derivedCommandsLength = this._derivedCommandsToUpdateLength;\n\n  if (derivedCommandsLength === 0) {\n    return;\n  }\n\n  for (let i = 0; i < derivedCommandsLength; ++i) {\n    derivedCommandPacks[i] = this._derivedCommandPacks[derivedCommandTypes[i]];\n    derivedCommandNames[i] = DerivedCommandNames[derivedCommandTypes[i]];\n  }\n\n  updateDerivedCommands(\n    this,\n    command,\n    derivedCommandsLength,\n    derivedCommandTypes,\n    derivedCommandNames,\n    derivedCommandPacks,\n    frameState\n  );\n};\n\nfunction updateDerivedCommands(\n  state,\n  command,\n  derivedCommandsLength,\n  derivedCommandTypes,\n  derivedCommandNames,\n  derivedCommandPacks,\n  frameState\n) {\n  let derivedCommandsObject = command.derivedCommands.globeTranslucency;\n  const derivedCommandsDirty = state._derivedCommandsDirty;\n\n  if (\n    command.dirty ||\n    !defined(derivedCommandsObject) ||\n    derivedCommandsDirty\n  ) {\n    command.dirty = false;\n\n    if (!defined(derivedCommandsObject)) {\n      derivedCommandsObject = {};\n      command.derivedCommands.globeTranslucency = derivedCommandsObject;\n    }\n\n    const frameNumber = frameState.frameNumber;\n\n    const uniformMapDirtyFrame = defaultValue(\n      derivedCommandsObject.uniformMapDirtyFrame,\n      0\n    );\n    const shaderProgramDirtyFrame = defaultValue(\n      derivedCommandsObject.shaderProgramDirtyFrame,\n      0\n    );\n    const renderStateDirtyFrame = defaultValue(\n      derivedCommandsObject.renderStateDirtyFrame,\n      0\n    );\n\n    const uniformMapDirty =\n      derivedCommandsObject.uniformMap !== command.uniformMap;\n\n    const shaderProgramDirty =\n      derivedCommandsObject.shaderProgramId !== command.shaderProgram.id;\n\n    const renderStateDirty =\n      derivedCommandsObject.renderStateId !== command.renderState.id;\n\n    if (uniformMapDirty) {\n      derivedCommandsObject.uniformMapDirtyFrame = frameNumber;\n    }\n    if (shaderProgramDirty) {\n      derivedCommandsObject.shaderProgramDirtyFrame = frameNumber;\n    }\n    if (renderStateDirty) {\n      derivedCommandsObject.renderStateDirtyFrame = frameNumber;\n    }\n\n    derivedCommandsObject.uniformMap = command.uniformMap;\n    derivedCommandsObject.shaderProgramId = command.shaderProgram.id;\n    derivedCommandsObject.renderStateId = command.renderState.id;\n\n    for (let i = 0; i < derivedCommandsLength; ++i) {\n      const derivedCommandPack = derivedCommandPacks[i];\n      const derivedCommandType = derivedCommandTypes[i];\n      const derivedCommandName = derivedCommandNames[i];\n      let derivedCommand = derivedCommandsObject[derivedCommandName];\n\n      let derivedUniformMap;\n      let derivedShaderProgram;\n      let derivedRenderState;\n\n      if (defined(derivedCommand)) {\n        derivedUniformMap = derivedCommand.uniformMap;\n        derivedShaderProgram = derivedCommand.shaderProgram;\n        derivedRenderState = derivedCommand.renderState;\n      } else {\n        derivedUniformMap = undefined;\n        derivedShaderProgram = undefined;\n        derivedRenderState = undefined;\n      }\n\n      derivedCommand = DrawCommand.shallowClone(command, derivedCommand);\n      derivedCommandsObject[derivedCommandName] = derivedCommand;\n\n      const derivedUniformMapDirtyFrame = defaultValue(\n        derivedCommand.derivedCommands.uniformMapDirtyFrame,\n        0\n      );\n      const derivedShaderProgramDirtyFrame = defaultValue(\n        derivedCommand.derivedCommands.shaderProgramDirtyFrame,\n        0\n      );\n      const derivedRenderStateDirtyFrame = defaultValue(\n        derivedCommand.derivedCommands.renderStateDirtyFrame,\n        0\n      );\n\n      const derivedUniformMapDirty =\n        uniformMapDirty || derivedUniformMapDirtyFrame < uniformMapDirtyFrame;\n      const derivedShaderProgramDirty =\n        shaderProgramDirty ||\n        derivedShaderProgramDirtyFrame < shaderProgramDirtyFrame;\n      const derivedRenderStateDirty =\n        renderStateDirty ||\n        derivedRenderStateDirtyFrame < renderStateDirtyFrame;\n\n      if (derivedUniformMapDirty) {\n        derivedCommand.derivedCommands.uniformMapDirtyFrame = frameNumber;\n      }\n      if (derivedShaderProgramDirty) {\n        derivedCommand.derivedCommands.shaderProgramDirtyFrame = frameNumber;\n      }\n      if (derivedRenderStateDirty) {\n        derivedCommand.derivedCommands.renderStateDirtyFrame = frameNumber;\n      }\n\n      derivedCommand.derivedCommands.type = derivedCommandType;\n      derivedCommand.pass = derivedCommandPack.pass;\n      derivedCommand.pickOnly = derivedCommandPack.pickOnly;\n      derivedCommand.uniformMap = getDerivedUniformMap(\n        state,\n        command.uniformMap,\n        derivedUniformMap,\n        derivedUniformMapDirty,\n        derivedCommandPack.getUniformMapFunction\n      );\n      derivedCommand.shaderProgram = getDerivedShaderProgram(\n        frameState.context,\n        command.shaderProgram,\n        derivedShaderProgram,\n        derivedShaderProgramDirty,\n        derivedCommandPack.getShaderProgramFunction,\n        derivedCommandName\n      );\n      derivedCommand.renderState = getDerivedRenderState(\n        command.renderState,\n        derivedRenderState,\n        derivedRenderStateDirty,\n        derivedCommandPack.getRenderStateFunction,\n        derivedCommandPack.renderStateCache\n      );\n    }\n  }\n}\n\nGlobeTranslucencyState.prototype.pushDerivedCommands = function (\n  command,\n  isBlendCommand,\n  frameState\n) {\n  const picking = frameState.passes.pick;\n  if (picking && isBlendCommand) {\n    // No need to push blend commands in the pick pass\n    return;\n  }\n\n  let derivedCommandTypes = this._derivedCommandTypes;\n  let derivedCommandsLength = this._derivedCommandsLength;\n\n  if (picking) {\n    derivedCommandTypes = this._derivedPickCommandTypes;\n    derivedCommandsLength = this._derivedPickCommandsLength;\n  } else if (isBlendCommand) {\n    derivedCommandTypes = this._derivedBlendCommandTypes;\n    derivedCommandsLength = this._derivedBlendCommandsLength;\n  }\n\n  if (derivedCommandsLength === 0) {\n    // No derived commands to push so just push the globe command\n    frameState.commandList.push(command);\n    return;\n  }\n\n  // Push derived commands\n  const derivedCommands = command.derivedCommands.globeTranslucency;\n  for (let i = 0; i < derivedCommandsLength; ++i) {\n    const derivedCommandName = DerivedCommandNames[derivedCommandTypes[i]];\n    frameState.commandList.push(derivedCommands[derivedCommandName]);\n  }\n};\n\nfunction executeCommandsMatchingType(\n  commands,\n  commandsLength,\n  executeCommandFunction,\n  scene,\n  context,\n  passState,\n  types\n) {\n  for (let i = 0; i < commandsLength; ++i) {\n    const command = commands[i];\n    const type = command.derivedCommands.type;\n    if (!defined(types) || types.indexOf(type) > -1) {\n      executeCommandFunction(command, scene, context, passState);\n    }\n  }\n}\n\nfunction executeCommands(\n  commands,\n  commandsLength,\n  executeCommandFunction,\n  scene,\n  context,\n  passState\n) {\n  for (let i = 0; i < commandsLength; ++i) {\n    executeCommandFunction(commands[i], scene, context, passState);\n  }\n}\n\nconst opaqueTypes = [\n  DerivedCommandType.OPAQUE_FRONT_FACE,\n  DerivedCommandType.OPAQUE_BACK_FACE,\n];\nconst depthOnlyTypes = [\n  DerivedCommandType.DEPTH_ONLY_FRONT_FACE,\n  DerivedCommandType.DEPTH_ONLY_BACK_FACE,\n  DerivedCommandType.DEPTH_ONLY_FRONT_AND_BACK_FACE,\n];\n\nGlobeTranslucencyState.prototype.executeGlobeCommands = function (\n  frustumCommands,\n  executeCommandFunction,\n  globeTranslucencyFramebuffer,\n  scene,\n  passState\n) {\n  const context = scene.context;\n  const globeCommands = frustumCommands.commands[Pass.GLOBE];\n  const globeCommandsLength = frustumCommands.indices[Pass.GLOBE];\n\n  if (globeCommandsLength === 0) {\n    return;\n  }\n\n  this._globeTranslucencyFramebuffer = globeTranslucencyFramebuffer;\n  globeTranslucencyFramebuffer.clearClassification(context, passState);\n\n  // Render opaque commands like normal\n  executeCommandsMatchingType(\n    globeCommands,\n    globeCommandsLength,\n    executeCommandFunction,\n    scene,\n    context,\n    passState,\n    opaqueTypes\n  );\n};\n\nGlobeTranslucencyState.prototype.executeGlobeClassificationCommands = function (\n  frustumCommands,\n  executeCommandFunction,\n  globeTranslucencyFramebuffer,\n  scene,\n  passState\n) {\n  const context = scene.context;\n  const globeCommands = frustumCommands.commands[Pass.GLOBE];\n  const globeCommandsLength = frustumCommands.indices[Pass.GLOBE];\n  const classificationCommands =\n    frustumCommands.commands[Pass.TERRAIN_CLASSIFICATION];\n  const classificationCommandsLength =\n    frustumCommands.indices[Pass.TERRAIN_CLASSIFICATION];\n\n  if (globeCommandsLength === 0 || classificationCommandsLength === 0) {\n    return;\n  }\n\n  const frontTranslucent = this._frontFaceTranslucent;\n  const backTranslucent = this._backFaceTranslucent;\n\n  if (!frontTranslucent || !backTranslucent) {\n    // Render classification on opaque faces like normal\n    executeCommands(\n      classificationCommands,\n      classificationCommandsLength,\n      executeCommandFunction,\n      scene,\n      context,\n      passState\n    );\n  }\n\n  if (!frontTranslucent && !backTranslucent) {\n    // No translucent commands to render. Skip translucent classification.\n    return;\n  }\n\n  this._globeTranslucencyFramebuffer = globeTranslucencyFramebuffer;\n\n  const originalGlobeDepthTexture = context.uniformState.globeDepthTexture;\n  const originalFramebuffer = passState.framebuffer;\n\n  // Render to internal framebuffer and get the first depth peel\n  passState.framebuffer =\n    globeTranslucencyFramebuffer.classificationFramebuffer;\n\n  executeCommandsMatchingType(\n    globeCommands,\n    globeCommandsLength,\n    executeCommandFunction,\n    scene,\n    context,\n    passState,\n    depthOnlyTypes\n  );\n\n  if (context.depthTexture) {\n    // Pack depth into separate texture for ground polylines and textured ground primitives\n    const packedDepthTexture = globeTranslucencyFramebuffer.packDepth(\n      context,\n      passState\n    );\n    context.uniformState.globeDepthTexture = packedDepthTexture;\n  }\n\n  // Render classification on translucent faces\n  executeCommands(\n    classificationCommands,\n    classificationCommandsLength,\n    executeCommandFunction,\n    scene,\n    context,\n    passState\n  );\n\n  // Unset temporary state\n  context.uniformState.globeDepthTexture = originalGlobeDepthTexture;\n  passState.framebuffer = originalFramebuffer;\n};\n\nexport default GlobeTranslucencyState;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    out_FragColor = texture(colorTexture, v_textureCoordinates);\\n\\\n}\\n\\\n\";\n", "import Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Renderbuffer from \"../Renderer/Renderbuffer.js\";\nimport RenderbufferFormat from \"../Renderer/RenderbufferFormat.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport PassThrough from \"../Shaders/PostProcessStages/PassThrough.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\n\n/**\n * @private\n */\nfunction InvertClassification() {\n  this._numSamples = 1;\n  this.previousFramebuffer = undefined;\n  this._previousFramebuffer = undefined;\n\n  this._depthStencilTexture = undefined;\n  this._depthStencilRenderbuffer = undefined;\n  this._fbo = new FramebufferManager({\n    depthStencil: true,\n    createDepthAttachments: false,\n  });\n  this._fboClassified = new FramebufferManager({\n    depthStencil: true,\n    createDepthAttachments: false,\n  });\n\n  this._rsUnclassified = undefined;\n  this._rsClassified = undefined;\n\n  this._unclassifiedCommand = undefined;\n  this._classifiedCommand = undefined;\n  this._translucentCommand = undefined;\n\n  this._clearColorCommand = new ClearCommand({\n    color: new Color(0.0, 0.0, 0.0, 0.0),\n    owner: this,\n  });\n  this._clearCommand = new ClearCommand({\n    color: new Color(0.0, 0.0, 0.0, 0.0),\n    depth: 1.0,\n    stencil: 0,\n  });\n\n  const that = this;\n  this._uniformMap = {\n    colorTexture: function () {\n      return that._fbo.getColorTexture();\n    },\n    depthTexture: function () {\n      return that._depthStencilTexture;\n    },\n    classifiedTexture: function () {\n      return that._fboClassified.getColorTexture();\n    },\n  };\n}\n\nObject.defineProperties(InvertClassification.prototype, {\n  unclassifiedCommand: {\n    get: function () {\n      return this._unclassifiedCommand;\n    },\n  },\n});\n\nInvertClassification.isTranslucencySupported = function (context) {\n  return context.depthTexture && context.fragmentDepth;\n};\n\nconst rsUnclassified = {\n  depthMask: false,\n  stencilTest: {\n    enabled: true,\n    frontFunction: StencilFunction.EQUAL,\n    frontOperation: {\n      fail: StencilOperation.KEEP,\n      zFail: StencilOperation.KEEP,\n      zPass: StencilOperation.KEEP,\n    },\n    backFunction: StencilFunction.NEVER,\n    reference: 0,\n    mask: StencilConstants.CLASSIFICATION_MASK,\n  },\n  blending: BlendingState.ALPHA_BLEND,\n};\n\nconst rsClassified = {\n  depthMask: false,\n  stencilTest: {\n    enabled: true,\n    frontFunction: StencilFunction.NOT_EQUAL,\n    frontOperation: {\n      fail: StencilOperation.KEEP,\n      zFail: StencilOperation.KEEP,\n      zPass: StencilOperation.KEEP,\n    },\n    backFunction: StencilFunction.NEVER,\n    reference: 0,\n    mask: StencilConstants.CLASSIFICATION_MASK,\n  },\n  blending: BlendingState.ALPHA_BLEND,\n};\n\n// Set the 3D Tiles bit when rendering back into the scene's framebuffer. This is only needed if\n// invert classification does not use the scene's depth-stencil texture, which is the case if the invert\n// classification color is translucent.\nconst rsDefault = {\n  depthMask: true,\n  depthTest: {\n    enabled: true,\n  },\n  stencilTest: StencilConstants.setCesium3DTileBit(),\n  stencilMask: StencilConstants.CESIUM_3D_TILE_MASK,\n  blending: BlendingState.ALPHA_BLEND,\n};\n\nconst translucentFS =\n  \"uniform sampler2D colorTexture;\\n\" +\n  \"uniform sampler2D depthTexture;\\n\" +\n  \"uniform sampler2D classifiedTexture;\\n\" +\n  \"in vec2 v_textureCoordinates;\\n\" +\n  \"void main()\\n\" +\n  \"{\\n\" +\n  \"    vec4 color = texture(colorTexture, v_textureCoordinates);\\n\" +\n  \"    if (color.a == 0.0)\\n\" +\n  \"    {\\n\" +\n  \"        discard;\\n\" +\n  \"    }\\n\" +\n  \"    bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0)));\\n\" +\n  \"#ifdef UNCLASSIFIED\\n\" +\n  \"    vec4 highlightColor = czm_invertClassificationColor;\\n\" +\n  \"    if (isClassified)\\n\" +\n  \"    {\\n\" +\n  \"        discard;\\n\" +\n  \"    }\\n\" +\n  \"#else\\n\" +\n  \"    vec4 highlightColor = vec4(1.0);\\n\" +\n  \"    if (!isClassified)\\n\" +\n  \"    {\\n\" +\n  \"        discard;\\n\" +\n  \"    }\\n\" +\n  \"#endif\\n\" +\n  \"    out_FragColor = color * highlightColor;\\n\" +\n  \"    gl_FragDepth = texture(depthTexture, v_textureCoordinates).r;\\n\" +\n  \"}\\n\";\n\nconst opaqueFS =\n  \"uniform sampler2D colorTexture;\\n\" +\n  \"in vec2 v_textureCoordinates;\\n\" +\n  \"void main()\\n\" +\n  \"{\\n\" +\n  \"    vec4 color = texture(colorTexture, v_textureCoordinates);\\n\" +\n  \"    if (color.a == 0.0)\\n\" +\n  \"    {\\n\" +\n  \"        discard;\\n\" +\n  \"    }\\n\" +\n  \"#ifdef UNCLASSIFIED\\n\" +\n  \"    out_FragColor = color * czm_invertClassificationColor;\\n\" +\n  \"#else\\n\" +\n  \"    out_FragColor = color;\\n\" +\n  \"#endif\\n\" +\n  \"}\\n\";\n\nInvertClassification.prototype.update = function (\n  context,\n  numSamples,\n  globeFramebuffer\n) {\n  const texture = this._fbo.getColorTexture();\n  const previousFramebufferChanged =\n    this.previousFramebuffer !== this._previousFramebuffer;\n  this._previousFramebuffer = this.previousFramebuffer;\n  const samplesChanged = this._numSamples !== numSamples;\n\n  const width = context.drawingBufferWidth;\n  const height = context.drawingBufferHeight;\n  const textureChanged =\n    !defined(texture) || texture.width !== width || texture.height !== height;\n\n  if (textureChanged || previousFramebufferChanged || samplesChanged) {\n    this._numSamples = numSamples;\n    this._depthStencilTexture =\n      this._depthStencilTexture && this._depthStencilTexture.destroy();\n    this._depthStencilRenderbuffer =\n      this._depthStencilRenderbuffer &&\n      this._depthStencilRenderbuffer.destroy();\n\n    if (!defined(this._previousFramebuffer)) {\n      this._depthStencilTexture = new Texture({\n        context: context,\n        width: width,\n        height: height,\n        pixelFormat: PixelFormat.DEPTH_STENCIL,\n        pixelDatatype: PixelDatatype.UNSIGNED_INT_24_8,\n      });\n      if (numSamples > 1) {\n        this._depthStencilRenderbuffer = new Renderbuffer({\n          context: context,\n          width: width,\n          height: height,\n          format: RenderbufferFormat.DEPTH24_STENCIL8,\n          numSamples: numSamples,\n        });\n      }\n    }\n  }\n\n  if (\n    !defined(this._fbo.framebuffer) ||\n    textureChanged ||\n    previousFramebufferChanged ||\n    samplesChanged\n  ) {\n    this._fbo.destroy();\n    this._fboClassified.destroy();\n\n    let depthStencilTexture;\n    let depthStencilRenderbuffer;\n    if (defined(this._previousFramebuffer)) {\n      depthStencilTexture = globeFramebuffer.getDepthStencilTexture();\n      depthStencilRenderbuffer = globeFramebuffer.getDepthStencilRenderbuffer();\n    } else {\n      depthStencilTexture = this._depthStencilTexture;\n      depthStencilRenderbuffer = this._depthStencilRenderbuffer;\n    }\n\n    this._fbo.setDepthStencilTexture(depthStencilTexture);\n    if (defined(depthStencilRenderbuffer)) {\n      this._fbo.setDepthStencilRenderbuffer(depthStencilRenderbuffer);\n    }\n    this._fbo.update(context, width, height, numSamples);\n\n    if (!defined(this._previousFramebuffer)) {\n      this._fboClassified.setDepthStencilTexture(depthStencilTexture);\n      this._fboClassified.update(context, width, height);\n    }\n  }\n\n  if (!defined(this._rsUnclassified)) {\n    this._rsUnclassified = RenderState.fromCache(rsUnclassified);\n    this._rsClassified = RenderState.fromCache(rsClassified);\n    this._rsDefault = RenderState.fromCache(rsDefault);\n  }\n\n  if (\n    !defined(this._unclassifiedCommand) ||\n    previousFramebufferChanged ||\n    samplesChanged\n  ) {\n    if (defined(this._unclassifiedCommand)) {\n      this._unclassifiedCommand.shaderProgram =\n        this._unclassifiedCommand.shaderProgram &&\n        this._unclassifiedCommand.shaderProgram.destroy();\n      this._classifiedCommand.shaderProgram =\n        this._classifiedCommand.shaderProgram &&\n        this._classifiedCommand.shaderProgram.destroy();\n    }\n\n    const fs = defined(this._previousFramebuffer) ? opaqueFS : translucentFS;\n    const unclassifiedFSSource = new ShaderSource({\n      defines: [\"UNCLASSIFIED\"],\n      sources: [fs],\n    });\n    const classifiedFSSource = new ShaderSource({\n      sources: [fs],\n    });\n    this._unclassifiedCommand = context.createViewportQuadCommand(\n      unclassifiedFSSource,\n      {\n        renderState: defined(this._previousFramebuffer)\n          ? this._rsUnclassified\n          : this._rsDefault,\n        uniformMap: this._uniformMap,\n        owner: this,\n      }\n    );\n    this._classifiedCommand = context.createViewportQuadCommand(\n      classifiedFSSource,\n      {\n        renderState: defined(this._previousFramebuffer)\n          ? this._rsClassified\n          : this._rsDefault,\n        uniformMap: this._uniformMap,\n        owner: this,\n      }\n    );\n\n    if (defined(this._translucentCommand)) {\n      this._translucentCommand.shaderProgram =\n        this._translucentCommand.shaderProgram &&\n        this._translucentCommand.shaderProgram.destroy();\n    }\n    if (!defined(this._previousFramebuffer)) {\n      this._translucentCommand = context.createViewportQuadCommand(\n        PassThrough,\n        {\n          renderState: this._rsUnclassified,\n          uniformMap: this._uniformMap,\n          owner: this,\n        }\n      );\n    }\n  }\n};\n\nInvertClassification.prototype.prepareTextures = function (\n  context,\n  blitStencil\n) {\n  if (this._fbo._numSamples > 1) {\n    this._fbo.prepareTextures(context, blitStencil);\n  }\n};\n\nInvertClassification.prototype.clear = function (context, passState) {\n  if (defined(this._previousFramebuffer)) {\n    this._fbo.clear(context, this._clearColorCommand, passState);\n  } else {\n    this._fbo.clear(context, this._clearCommand, passState);\n    this._fboClassified.clear(context, this._clearCommand, passState);\n  }\n};\n\nInvertClassification.prototype.executeClassified = function (\n  context,\n  passState\n) {\n  if (!defined(this._previousFramebuffer)) {\n    const framebuffer = passState.framebuffer;\n\n    this.prepareTextures(context, true);\n    passState.framebuffer = this._fboClassified.framebuffer;\n    this._translucentCommand.execute(context, passState);\n\n    passState.framebuffer = framebuffer;\n  }\n  this._classifiedCommand.execute(context, passState);\n};\n\nInvertClassification.prototype.executeUnclassified = function (\n  context,\n  passState\n) {\n  this._unclassifiedCommand.execute(context, passState);\n};\n\nInvertClassification.prototype.isDestroyed = function () {\n  return false;\n};\n\nInvertClassification.prototype.destroy = function () {\n  this._fbo.destroy();\n  this._fboClassified.destroy();\n  this._depthStencilTexture =\n    this._depthStencilTexture && this._depthStencilTexture.destroy();\n  this._depthStencilRenderbuffer =\n    this._depthStencilRenderbuffer && this._depthStencilRenderbuffer.destroy();\n\n  if (defined(this._unclassifiedCommand)) {\n    this._unclassifiedCommand.shaderProgram =\n      this._unclassifiedCommand.shaderProgram &&\n      this._unclassifiedCommand.shaderProgram.destroy();\n    this._classifiedCommand.shaderProgram =\n      this._classifiedCommand.shaderProgram &&\n      this._classifiedCommand.shaderProgram.destroy();\n  }\n\n  return destroyObject(this);\n};\nexport default InvertClassification;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport JobType from \"./JobType.js\";\n\n/**\n *\n * @private\n * @constructor\n */\nfunction JobTypeBudget(total) {\n  /**\n   * Total budget, in milliseconds, allowed for one frame\n   */\n  this._total = total;\n\n  /**\n   * Time, in milliseconds, used so far during this frame\n   */\n  this.usedThisFrame = 0.0;\n\n  /**\n   * Time, in milliseconds, that other job types stole this frame\n   */\n  this.stolenFromMeThisFrame = 0.0;\n\n  /**\n   * Indicates if this job type was starved this frame, i.e., a job\n   * tried to run but didn't have budget\n   */\n  this.starvedThisFrame = false;\n\n  /**\n   * Indicates if this job was starved last frame.  This prevents it\n   * from being stolen from this frame.\n   */\n  this.starvedLastFrame = false;\n}\n\nObject.defineProperties(JobTypeBudget.prototype, {\n  total: {\n    get: function () {\n      return this._total;\n    },\n  },\n});\n\n/**\n * Engine for time slicing jobs during a frame to amortize work over multiple frames.  This supports:\n * <ul>\n *   <li>\n *     Separate budgets for different job types, e.g., texture, shader program, and buffer creation.  This\n *     allows all job types to make progress each frame.\n *   </li>\n *   <li>\n *     Stealing from other jobs type budgets if they were not exhausted in the previous frame.  This allows\n *     using the entire budget for all job types each frame even if, for example, all the jobs are the same type.\n *   </li>\n *   <li>\n *     Guaranteed progress on all job types each frame, even if it means exceeding the total budget for the frame.\n *     This prevents, for example, several expensive texture uploads over many frames from prevent a shader compile.\n *   </li>\n * </ul>\n *\n * @private\n */\nfunction JobScheduler(budgets) {\n  //>>includeStart('debug', pragmas.debug);\n  if (defined(budgets) && budgets.length !== JobType.NUMBER_OF_JOB_TYPES) {\n    throw new DeveloperError(\n      \"A budget must be specified for each job type; budgets.length should equal JobType.NUMBER_OF_JOB_TYPES.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  // Total for defaults is half of of one frame at 10 fps\n  const jobBudgets = new Array(JobType.NUMBER_OF_JOB_TYPES);\n  jobBudgets[JobType.TEXTURE] = new JobTypeBudget(\n    defined(budgets) ? budgets[JobType.TEXTURE] : 10.0\n  );\n  // On cache miss, this most likely only allows one shader compile per frame\n  jobBudgets[JobType.PROGRAM] = new JobTypeBudget(\n    defined(budgets) ? budgets[JobType.PROGRAM] : 10.0\n  );\n  jobBudgets[JobType.BUFFER] = new JobTypeBudget(\n    defined(budgets) ? budgets[JobType.BUFFER] : 30.0\n  );\n\n  const length = jobBudgets.length;\n  let i;\n\n  let totalBudget = 0.0;\n  for (i = 0; i < length; ++i) {\n    totalBudget += jobBudgets[i].total;\n  }\n\n  const executedThisFrame = new Array(length);\n  for (i = 0; i < length; ++i) {\n    executedThisFrame[i] = false;\n  }\n\n  this._totalBudget = totalBudget;\n  this._totalUsedThisFrame = 0.0;\n  this._budgets = jobBudgets;\n  this._executedThisFrame = executedThisFrame;\n}\n\n// For unit testing\nJobScheduler.getTimestamp = getTimestamp;\n\nObject.defineProperties(JobScheduler.prototype, {\n  totalBudget: {\n    get: function () {\n      return this._totalBudget;\n    },\n  },\n});\n\nJobScheduler.prototype.disableThisFrame = function () {\n  // Prevent jobs from running this frame\n  this._totalUsedThisFrame = this._totalBudget;\n};\n\nJobScheduler.prototype.resetBudgets = function () {\n  const budgets = this._budgets;\n  const length = budgets.length;\n  for (let i = 0; i < length; ++i) {\n    const budget = budgets[i];\n    budget.starvedLastFrame = budget.starvedThisFrame;\n    budget.starvedThisFrame = false;\n    budget.usedThisFrame = 0.0;\n    budget.stolenFromMeThisFrame = 0.0;\n  }\n  this._totalUsedThisFrame = 0.0;\n};\n\nJobScheduler.prototype.execute = function (job, jobType) {\n  const budgets = this._budgets;\n  const budget = budgets[jobType];\n\n  // This ensures each job type makes progress each frame by executing at least once\n  const progressThisFrame = this._executedThisFrame[jobType];\n\n  if (this._totalUsedThisFrame >= this._totalBudget && progressThisFrame) {\n    // No budget left this frame for jobs of any type\n    budget.starvedThisFrame = true;\n    return false;\n  }\n\n  let stolenBudget;\n\n  if (budget.usedThisFrame + budget.stolenFromMeThisFrame >= budget.total) {\n    // No budget remaining for jobs of this type. Try to steal from other job types.\n    const length = budgets.length;\n    let i;\n    for (i = 0; i < length; ++i) {\n      stolenBudget = budgets[i];\n\n      // Steal from this budget if it has time left and it wasn't starved last fame\n      if (\n        stolenBudget.usedThisFrame + stolenBudget.stolenFromMeThisFrame <\n          stolenBudget.total &&\n        !stolenBudget.starvedLastFrame\n      ) {\n        break;\n      }\n    }\n\n    if (i === length && progressThisFrame) {\n      // No other job types can give up their budget this frame, and\n      // this job type already progressed this frame\n      return false;\n    }\n\n    if (progressThisFrame) {\n      // It is considered \"starved\" even if it executes using stolen time so that\n      // next frame, no other job types can steal time from it.\n      budget.starvedThisFrame = true;\n    }\n  }\n\n  const startTime = JobScheduler.getTimestamp();\n  job.execute();\n  const duration = JobScheduler.getTimestamp() - startTime;\n\n  // Track both time remaining for this job type and all jobs\n  // so budget stealing does send us way over the total budget.\n  this._totalUsedThisFrame += duration;\n\n  if (stolenBudget) {\n    stolenBudget.stolenFromMeThisFrame += duration;\n  } else {\n    budget.usedThisFrame += duration;\n  }\n  this._executedThisFrame[jobType] = true;\n\n  return true;\n};\nexport default JobScheduler;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport getElement from \"../DataSources/getElement.js\";\n\n/**\n * @private\n */\nfunction PerformanceDisplay(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const container = getElement(options.container);\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(container)) {\n    throw new DeveloperError(\"container is required\");\n  }\n  //>>includeEnd('debug');\n\n  this._container = container;\n\n  const display = document.createElement(\"div\");\n  display.className = \"cesium-performanceDisplay\";\n  const fpsElement = document.createElement(\"div\");\n  fpsElement.className = \"cesium-performanceDisplay-fps\";\n  this._fpsText = document.createTextNode(\"\");\n  fpsElement.appendChild(this._fpsText);\n  const msElement = document.createElement(\"div\");\n  msElement.className = \"cesium-performanceDisplay-ms\";\n  this._msText = document.createTextNode(\"\");\n  msElement.appendChild(this._msText);\n  display.appendChild(msElement);\n  display.appendChild(fpsElement);\n  this._container.appendChild(display);\n\n  this._lastFpsSampleTime = getTimestamp();\n  this._lastMsSampleTime = getTimestamp();\n  this._fpsFrameCount = 0;\n  this._msFrameCount = 0;\n\n  this._throttled = false;\n  const throttledElement = document.createElement(\"div\");\n  throttledElement.className = \"cesium-performanceDisplay-throttled\";\n  this._throttledText = document.createTextNode(\"\");\n  throttledElement.appendChild(this._throttledText);\n  display.appendChild(throttledElement);\n}\n\nObject.defineProperties(PerformanceDisplay.prototype, {\n  /**\n   * The display should indicate the FPS is being throttled.\n   * @memberof PerformanceDisplay.prototype\n   *\n   * @type {boolean}\n   */\n  throttled: {\n    get: function () {\n      return this._throttled;\n    },\n    set: function (value) {\n      if (this._throttled === value) {\n        return;\n      }\n\n      if (value) {\n        this._throttledText.nodeValue = \"(throttled)\";\n      } else {\n        this._throttledText.nodeValue = \"\";\n      }\n\n      this._throttled = value;\n    },\n  },\n});\n\n/**\n * Update the display.  This function should only be called once per frame, because\n * each call records a frame in the internal buffer and redraws the display.\n *\n * @param {boolean} [renderedThisFrame=true] If provided, the FPS count will only update and display if true.\n */\nPerformanceDisplay.prototype.update = function (renderedThisFrame) {\n  const time = getTimestamp();\n  const updateDisplay = defaultValue(renderedThisFrame, true);\n\n  this._fpsFrameCount++;\n  const fpsElapsedTime = time - this._lastFpsSampleTime;\n  if (fpsElapsedTime > 1000) {\n    let fps = \"N/A\";\n    if (updateDisplay) {\n      fps = ((this._fpsFrameCount * 1000) / fpsElapsedTime) | 0;\n    }\n\n    this._fpsText.nodeValue = `${fps} FPS`;\n    this._lastFpsSampleTime = time;\n    this._fpsFrameCount = 0;\n  }\n\n  this._msFrameCount++;\n  const msElapsedTime = time - this._lastMsSampleTime;\n  if (msElapsedTime > 200) {\n    let ms = \"N/A\";\n    if (updateDisplay) {\n      ms = (msElapsedTime / this._msFrameCount).toFixed(2);\n    }\n\n    this._msText.nodeValue = `${ms} MS`;\n    this._lastMsSampleTime = time;\n    this._msFrameCount = 0;\n  }\n};\n\n/**\n * Destroys the WebGL resources held by this object.\n */\nPerformanceDisplay.prototype.destroy = function () {\n  return destroyObject(this);\n};\nexport default PerformanceDisplay;\n", "import Cartesian4 from \"../Core/Cartesian4.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\n\n/**\n * @private\n */\nfunction PickDepth() {\n  this._framebuffer = new FramebufferManager();\n\n  this._textureToCopy = undefined;\n  this._copyDepthCommand = undefined;\n}\n\nObject.defineProperties(PickDepth.prototype, {\n  framebuffer: {\n    get: function () {\n      return this._framebuffer.framebuffer;\n    },\n  },\n});\n\nfunction updateFramebuffers(pickDepth, context, depthTexture) {\n  const width = depthTexture.width;\n  const height = depthTexture.height;\n  pickDepth._framebuffer.update(context, width, height);\n}\n\nfunction updateCopyCommands(pickDepth, context, depthTexture) {\n  if (!defined(pickDepth._copyDepthCommand)) {\n    const fs =\n      \"uniform highp sampler2D u_texture;\\n\" +\n      \"in vec2 v_textureCoordinates;\\n\" +\n      \"void main()\\n\" +\n      \"{\\n\" +\n      \"    out_FragColor = czm_packDepth(texture(u_texture, v_textureCoordinates).r);\\n\" +\n      \"}\\n\";\n    pickDepth._copyDepthCommand = context.createViewportQuadCommand(fs, {\n      renderState: RenderState.fromCache(),\n      uniformMap: {\n        u_texture: function () {\n          return pickDepth._textureToCopy;\n        },\n      },\n      owner: pickDepth,\n    });\n  }\n\n  pickDepth._textureToCopy = depthTexture;\n  pickDepth._copyDepthCommand.framebuffer = pickDepth.framebuffer;\n}\n\nPickDepth.prototype.update = function (context, depthTexture) {\n  updateFramebuffers(this, context, depthTexture);\n  updateCopyCommands(this, context, depthTexture);\n};\n\nconst scratchPackedDepth = new Cartesian4();\nconst packedDepthScale = new Cartesian4(\n  1.0,\n  1.0 / 255.0,\n  1.0 / 65025.0,\n  1.0 / 16581375.0\n);\n\nPickDepth.prototype.getDepth = function (context, x, y) {\n  // If this function is called before the framebuffer is created, the depth is undefined.\n  if (!defined(this.framebuffer)) {\n    return undefined;\n  }\n\n  const pixels = context.readPixels({\n    x: x,\n    y: y,\n    width: 1,\n    height: 1,\n    framebuffer: this.framebuffer,\n  });\n\n  const packedDepth = Cartesian4.unpack(pixels, 0, scratchPackedDepth);\n  Cartesian4.divideByScalar(packedDepth, 255.0, packedDepth);\n  return Cartesian4.dot(packedDepth, packedDepthScale);\n};\n\nPickDepth.prototype.executeCopyDepth = function (context, passState) {\n  this._copyDepthCommand.execute(context, passState);\n};\n\nPickDepth.prototype.isDestroyed = function () {\n  return false;\n};\n\nPickDepth.prototype.destroy = function () {\n  this._framebuffer.destroy();\n  if (defined(this._copyDepthCommand)) {\n    this._copyDepthCommand.shaderProgram =\n      defined(this._copyDepthCommand.shaderProgram) &&\n      this._copyDepthCommand.shaderProgram.destroy();\n  }\n\n  return destroyObject(this);\n};\nexport default PickDepth;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport Pass from \"../Renderer/Pass.js\";\n\n/**\n * Defines a list of commands whose geometry are bound by near and far distances from the camera.\n * @alias FrustumCommands\n * @constructor\n *\n * @param {number} [near=0.0] The lower bound or closest distance from the camera.\n * @param {number} [far=0.0] The upper bound or farthest distance from the camera.\n *\n * @private\n */\nfunction FrustumCommands(near, far) {\n  this.near = defaultValue(near, 0.0);\n  this.far = defaultValue(far, 0.0);\n\n  const numPasses = Pass.NUMBER_OF_PASSES;\n  const commands = new Array(numPasses);\n  const indices = new Array(numPasses);\n\n  for (let i = 0; i < numPasses; ++i) {\n    commands[i] = [];\n    indices[i] = 0;\n  }\n\n  this.commands = commands;\n  this.indices = indices;\n}\nexport default FrustumCommands;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform highp sampler2D u_depthTexture;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);\\n\\\n}\\n\\\n\";\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport PassThrough from \"../Shaders/PostProcessStages/PassThrough.js\";\nimport PassThroughDepth from \"../Shaders/PostProcessStages/PassThroughDepth.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\n\n/**\n * @private\n */\nfunction GlobeDepth() {\n  this._picking = false;\n  this._numSamples = 1;\n  this._tempCopyDepthTexture = undefined;\n\n  this._pickColorFramebuffer = new FramebufferManager({\n    depthStencil: true,\n    supportsDepthTexture: true,\n  });\n  this._outputFramebuffer = new FramebufferManager({\n    depthStencil: true,\n    supportsDepthTexture: true,\n  });\n  this._copyDepthFramebuffer = new FramebufferManager();\n  this._tempCopyDepthFramebuffer = new FramebufferManager();\n  this._updateDepthFramebuffer = new FramebufferManager({\n    createColorAttachments: false,\n    createDepthAttachments: false,\n    depthStencil: true,\n  });\n\n  this._clearGlobeColorCommand = undefined;\n  this._copyColorCommand = undefined;\n  this._copyDepthCommand = undefined;\n  this._tempCopyDepthCommand = undefined;\n  this._updateDepthCommand = undefined;\n\n  this._viewport = new BoundingRectangle();\n  this._rs = undefined;\n  this._rsBlend = undefined;\n  this._rsUpdate = undefined;\n\n  this._useScissorTest = false;\n  this._scissorRectangle = undefined;\n\n  this._useHdr = undefined;\n  this._clearGlobeDepth = undefined;\n}\n\nObject.defineProperties(GlobeDepth.prototype, {\n  colorFramebufferManager: {\n    get: function () {\n      return this._picking\n        ? this._pickColorFramebuffer\n        : this._outputFramebuffer;\n    },\n  },\n  framebuffer: {\n    get: function () {\n      return this.colorFramebufferManager.framebuffer;\n    },\n  },\n  depthStencilTexture: {\n    get: function () {\n      return this.colorFramebufferManager.getDepthStencilTexture();\n    },\n  },\n  picking: {\n    get: function () {\n      return this._picking;\n    },\n    set: function (value) {\n      this._picking = value;\n    },\n  },\n});\n\nfunction destroyFramebuffers(globeDepth) {\n  globeDepth._pickColorFramebuffer.destroy();\n  globeDepth._outputFramebuffer.destroy();\n  globeDepth._copyDepthFramebuffer.destroy();\n  globeDepth._tempCopyDepthFramebuffer.destroy();\n  globeDepth._updateDepthFramebuffer.destroy();\n}\n\nfunction updateCopyCommands(globeDepth, context, width, height, passState) {\n  globeDepth._viewport.width = width;\n  globeDepth._viewport.height = height;\n\n  const useScissorTest = !BoundingRectangle.equals(\n    globeDepth._viewport,\n    passState.viewport\n  );\n  let updateScissor = useScissorTest !== globeDepth._useScissorTest;\n  globeDepth._useScissorTest = useScissorTest;\n\n  if (\n    !BoundingRectangle.equals(globeDepth._scissorRectangle, passState.viewport)\n  ) {\n    globeDepth._scissorRectangle = BoundingRectangle.clone(\n      passState.viewport,\n      globeDepth._scissorRectangle\n    );\n    updateScissor = true;\n  }\n\n  if (\n    !defined(globeDepth._rs) ||\n    !BoundingRectangle.equals(globeDepth._viewport, globeDepth._rs.viewport) ||\n    updateScissor\n  ) {\n    globeDepth._rs = RenderState.fromCache({\n      viewport: globeDepth._viewport,\n      scissorTest: {\n        enabled: globeDepth._useScissorTest,\n        rectangle: globeDepth._scissorRectangle,\n      },\n    });\n    globeDepth._rsBlend = RenderState.fromCache({\n      viewport: globeDepth._viewport,\n      scissorTest: {\n        enabled: globeDepth._useScissorTest,\n        rectangle: globeDepth._scissorRectangle,\n      },\n      blending: BlendingState.ALPHA_BLEND,\n    });\n\n    // Copy packed depth only if the 3D Tiles bit is set\n    globeDepth._rsUpdate = RenderState.fromCache({\n      viewport: globeDepth._viewport,\n      scissorTest: {\n        enabled: globeDepth._useScissorTest,\n        rectangle: globeDepth._scissorRectangle,\n      },\n      stencilTest: {\n        enabled: true,\n        frontFunction: StencilFunction.EQUAL,\n        frontOperation: {\n          fail: StencilOperation.KEEP,\n          zFail: StencilOperation.KEEP,\n          zPass: StencilOperation.KEEP,\n        },\n        backFunction: StencilFunction.NEVER,\n        reference: StencilConstants.CESIUM_3D_TILE_MASK,\n        mask: StencilConstants.CESIUM_3D_TILE_MASK,\n      },\n    });\n  }\n\n  if (!defined(globeDepth._copyDepthCommand)) {\n    globeDepth._copyDepthCommand = context.createViewportQuadCommand(\n      PassThroughDepth,\n      {\n        uniformMap: {\n          u_depthTexture: function () {\n            return globeDepth.colorFramebufferManager.getDepthStencilTexture();\n          },\n        },\n        owner: globeDepth,\n      }\n    );\n  }\n\n  globeDepth._copyDepthCommand.framebuffer =\n    globeDepth._copyDepthFramebuffer.framebuffer;\n  globeDepth._copyDepthCommand.renderState = globeDepth._rs;\n\n  if (!defined(globeDepth._copyColorCommand)) {\n    globeDepth._copyColorCommand = context.createViewportQuadCommand(\n      PassThrough,\n      {\n        uniformMap: {\n          colorTexture: function () {\n            return globeDepth.colorFramebufferManager.getColorTexture();\n          },\n        },\n        owner: globeDepth,\n      }\n    );\n  }\n\n  globeDepth._copyColorCommand.renderState = globeDepth._rs;\n\n  if (!defined(globeDepth._tempCopyDepthCommand)) {\n    globeDepth._tempCopyDepthCommand = context.createViewportQuadCommand(\n      PassThroughDepth,\n      {\n        uniformMap: {\n          u_depthTexture: function () {\n            return globeDepth._tempCopyDepthTexture;\n          },\n        },\n        owner: globeDepth,\n      }\n    );\n  }\n\n  globeDepth._tempCopyDepthCommand.framebuffer =\n    globeDepth._tempCopyDepthFramebuffer.framebuffer;\n  globeDepth._tempCopyDepthCommand.renderState = globeDepth._rs;\n\n  if (!defined(globeDepth._updateDepthCommand)) {\n    globeDepth._updateDepthCommand = context.createViewportQuadCommand(\n      PassThrough,\n      {\n        uniformMap: {\n          colorTexture: function () {\n            return globeDepth._tempCopyDepthFramebuffer.getColorTexture();\n          },\n        },\n        owner: globeDepth,\n      }\n    );\n  }\n\n  globeDepth._updateDepthCommand.framebuffer =\n    globeDepth._updateDepthFramebuffer.framebuffer;\n  globeDepth._updateDepthCommand.renderState = globeDepth._rsUpdate;\n\n  if (!defined(globeDepth._clearGlobeColorCommand)) {\n    globeDepth._clearGlobeColorCommand = new ClearCommand({\n      color: new Color(0.0, 0.0, 0.0, 0.0),\n      stencil: 0.0,\n      owner: globeDepth,\n    });\n  }\n\n  globeDepth._clearGlobeColorCommand.framebuffer = globeDepth.framebuffer;\n}\n\nGlobeDepth.prototype.update = function (\n  context,\n  passState,\n  viewport,\n  numSamples,\n  hdr,\n  clearGlobeDepth\n) {\n  const width = viewport.width;\n  const height = viewport.height;\n\n  const pixelDatatype = hdr\n    ? context.halfFloatingPointTexture\n      ? PixelDatatype.HALF_FLOAT\n      : PixelDatatype.FLOAT\n    : PixelDatatype.UNSIGNED_BYTE;\n  this._numSamples = numSamples;\n  if (this.picking) {\n    this._pickColorFramebuffer.update(context, width, height);\n  } else {\n    this._outputFramebuffer.update(\n      context,\n      width,\n      height,\n      numSamples,\n      pixelDatatype\n    );\n  }\n  this._copyDepthFramebuffer.update(context, width, height);\n  updateCopyCommands(this, context, width, height, passState);\n  context.uniformState.globeDepthTexture = undefined;\n\n  this._useHdr = hdr;\n  this._clearGlobeDepth = clearGlobeDepth;\n};\n\nGlobeDepth.prototype.prepareColorTextures = function (context, blitStencil) {\n  if (!this.picking && this._numSamples > 1) {\n    this._outputFramebuffer.prepareTextures(context, blitStencil);\n  }\n};\n\nGlobeDepth.prototype.executeCopyDepth = function (context, passState) {\n  if (defined(this._copyDepthCommand)) {\n    this.prepareColorTextures(context);\n    this._copyDepthCommand.execute(context, passState);\n    context.uniformState.globeDepthTexture = this._copyDepthFramebuffer.getColorTexture();\n  }\n};\n\nGlobeDepth.prototype.executeUpdateDepth = function (\n  context,\n  passState,\n  clearGlobeDepth,\n  depthTexture\n) {\n  const depthTextureToCopy = defined(depthTexture)\n    ? depthTexture\n    : passState.framebuffer.depthStencilTexture;\n  if (\n    clearGlobeDepth ||\n    depthTextureToCopy !== this.colorFramebufferManager.getDepthStencilTexture()\n  ) {\n    // First copy the depth to a temporary globe depth texture, then update the\n    // main globe depth texture where the stencil bit for 3D Tiles is set.\n    // This preserves the original globe depth except where 3D Tiles is rendered.\n    // The additional texture and framebuffer resources are created on demand.\n    if (defined(this._updateDepthCommand)) {\n      if (\n        !defined(this._updateDepthFramebuffer.framebuffer) ||\n        this._updateDepthFramebuffer.getDepthStencilTexture() !==\n          depthTextureToCopy ||\n        this._updateDepthFramebuffer.getColorTexture() !==\n          this._copyDepthFramebuffer.getColorTexture()\n      ) {\n        const width = this._copyDepthFramebuffer.getColorTexture().width;\n        const height = this._copyDepthFramebuffer.getColorTexture().height;\n        this._tempCopyDepthFramebuffer.destroy();\n        this._tempCopyDepthFramebuffer.update(context, width, height);\n\n        const colorTexture = this._copyDepthFramebuffer.getColorTexture();\n        this._updateDepthFramebuffer.setColorTexture(colorTexture, 0);\n        this._updateDepthFramebuffer.setDepthStencilTexture(depthTextureToCopy);\n        this._updateDepthFramebuffer.update(context, width, height);\n\n        updateCopyCommands(this, context, width, height, passState);\n      }\n      this._tempCopyDepthTexture = depthTextureToCopy;\n      this._tempCopyDepthCommand.execute(context, passState);\n      this._updateDepthCommand.execute(context, passState);\n    }\n    return;\n  }\n\n  // Fast path - the depth texture can be copied normally.\n  if (defined(this._copyDepthCommand)) {\n    this._copyDepthCommand.execute(context, passState);\n  }\n};\n\nGlobeDepth.prototype.executeCopyColor = function (context, passState) {\n  if (defined(this._copyColorCommand)) {\n    this._copyColorCommand.execute(context, passState);\n  }\n};\n\nGlobeDepth.prototype.clear = function (context, passState, clearColor) {\n  const clear = this._clearGlobeColorCommand;\n  if (defined(clear)) {\n    Color.clone(clearColor, clear.color);\n    this.colorFramebufferManager.clear(context, clear, passState);\n  }\n};\n\nGlobeDepth.prototype.isDestroyed = function () {\n  return false;\n};\n\nGlobeDepth.prototype.destroy = function () {\n  destroyFramebuffers(this);\n\n  if (defined(this._copyColorCommand)) {\n    this._copyColorCommand.shaderProgram = this._copyColorCommand.shaderProgram.destroy();\n  }\n\n  if (defined(this._copyDepthCommand)) {\n    this._copyDepthCommand.shaderProgram = this._copyDepthCommand.shaderProgram.destroy();\n  }\n\n  if (defined(this._tempCopyDepthCommand)) {\n    this._tempCopyDepthCommand.shaderProgram = this._tempCopyDepthCommand.shaderProgram.destroy();\n  }\n\n  if (defined(this._updateDepthCommand)) {\n    this._updateDepthCommand.shaderProgram = this._updateDepthCommand.shaderProgram.destroy();\n  }\n\n  return destroyObject(this);\n};\nexport default GlobeDepth;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport PassThroughDepth from \"../Shaders/PostProcessStages/PassThroughDepth.js\";\n\n/**\n * @private\n */\nfunction GlobeTranslucencyFramebuffer() {\n  this._framebuffer = new FramebufferManager({\n    depthStencil: true,\n    supportsDepthTexture: true,\n  });\n  this._packedDepthFramebuffer = new FramebufferManager();\n\n  this._renderState = undefined;\n\n  this._packedDepthCommand = undefined;\n  this._clearCommand = undefined;\n\n  this._viewport = new BoundingRectangle();\n  this._useScissorTest = false;\n  this._scissorRectangle = undefined;\n  this._useHdr = undefined;\n}\n\nObject.defineProperties(GlobeTranslucencyFramebuffer.prototype, {\n  // Exposed for testing\n  classificationTexture: {\n    get: function () {\n      return this._framebuffer.getColorTexture();\n    },\n  },\n  classificationFramebuffer: {\n    get: function () {\n      return this._framebuffer.framebuffer;\n    },\n  },\n  // Exposed for testing\n  packedDepthFramebuffer: {\n    get: function () {\n      return this._packedDepthFramebuffer.framebuffer;\n    },\n  },\n  depthStencilTexture: {\n    get: function () {\n      return this._framebuffer.getDepthStencilTexture();\n    },\n  },\n  // Exposed for testing\n  depthStencilRenderbuffer: {\n    get: function () {\n      return this._framebuffer.getDepthStencilRenderbuffer();\n    },\n  },\n  packedDepthTexture: {\n    get: function () {\n      return this._packedDepthFramebuffer.getColorTexture();\n    },\n  },\n});\n\nfunction destroyResources(globeTranslucency) {\n  globeTranslucency._framebuffer.destroy();\n  globeTranslucency._packedDepthFramebuffer.destroy();\n}\n\nfunction updateResources(globeTranslucency, context, width, height, hdr) {\n  const pixelDatatype = hdr\n    ? context.halfFloatingPointTexture\n      ? PixelDatatype.HALF_FLOAT\n      : PixelDatatype.FLOAT\n    : PixelDatatype.UNSIGNED_BYTE;\n  globeTranslucency._framebuffer.update(\n    context,\n    width,\n    height,\n    1,\n    pixelDatatype\n  );\n  globeTranslucency._packedDepthFramebuffer.update(context, width, height);\n}\n\nfunction updateCommands(globeTranslucency, context, width, height, passState) {\n  globeTranslucency._viewport.width = width;\n  globeTranslucency._viewport.height = height;\n\n  const useScissorTest = !BoundingRectangle.equals(\n    globeTranslucency._viewport,\n    passState.viewport\n  );\n  let updateScissor = useScissorTest !== globeTranslucency._useScissorTest;\n  globeTranslucency._useScissorTest = useScissorTest;\n\n  if (\n    !BoundingRectangle.equals(\n      globeTranslucency._scissorRectangle,\n      passState.viewport\n    )\n  ) {\n    globeTranslucency._scissorRectangle = BoundingRectangle.clone(\n      passState.viewport,\n      globeTranslucency._scissorRectangle\n    );\n    updateScissor = true;\n  }\n\n  if (\n    !defined(globeTranslucency._renderState) ||\n    !BoundingRectangle.equals(\n      globeTranslucency._viewport,\n      globeTranslucency._renderState.viewport\n    ) ||\n    updateScissor\n  ) {\n    globeTranslucency._renderState = RenderState.fromCache({\n      viewport: globeTranslucency._viewport,\n      scissorTest: {\n        enabled: globeTranslucency._useScissorTest,\n        rectangle: globeTranslucency._scissorRectangle,\n      },\n    });\n  }\n\n  if (!defined(globeTranslucency._packedDepthCommand)) {\n    globeTranslucency._packedDepthCommand = context.createViewportQuadCommand(\n      PassThroughDepth,\n      {\n        uniformMap: {\n          u_depthTexture: function () {\n            return globeTranslucency.depthStencilTexture;\n          },\n        },\n        owner: globeTranslucency,\n      }\n    );\n  }\n\n  if (!defined(globeTranslucency._clearCommand)) {\n    globeTranslucency._clearCommand = new ClearCommand({\n      color: new Color(0.0, 0.0, 0.0, 0.0),\n      depth: 1.0,\n      stencil: 0.0,\n      owner: globeTranslucency,\n    });\n  }\n\n  globeTranslucency._packedDepthCommand.framebuffer =\n    globeTranslucency._packedDepthFramebuffer.framebuffer;\n  globeTranslucency._packedDepthCommand.renderState =\n    globeTranslucency._renderState;\n  globeTranslucency._clearCommand.framebuffer =\n    globeTranslucency.classificationFramebuffer;\n  globeTranslucency._clearCommand.renderState = globeTranslucency._renderState;\n}\n\nGlobeTranslucencyFramebuffer.prototype.updateAndClear = function (\n  hdr,\n  viewport,\n  context,\n  passState\n) {\n  const width = viewport.width;\n  const height = viewport.height;\n\n  updateResources(this, context, width, height, hdr);\n  updateCommands(this, context, width, height, passState);\n\n  this._useHdr = hdr;\n};\n\nGlobeTranslucencyFramebuffer.prototype.clearClassification = function (\n  context,\n  passState\n) {\n  this._clearCommand.execute(context, passState);\n};\n\nGlobeTranslucencyFramebuffer.prototype.packDepth = function (\n  context,\n  passState\n) {\n  this._packedDepthCommand.execute(context, passState);\n  return this.packedDepthTexture;\n};\n\nGlobeTranslucencyFramebuffer.prototype.isDestroyed = function () {\n  return false;\n};\n\nGlobeTranslucencyFramebuffer.prototype.destroy = function () {\n  destroyResources(this);\n  return destroyObject(this);\n};\n\nexport default GlobeTranslucencyFramebuffer;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef MRT\\n\\\nlayout (location = 0) out vec4 out_FragData_0;\\n\\\nlayout (location = 1) out vec4 out_FragData_1;\\n\\\n#else\\n\\\nlayout (location = 0) out vec4 out_FragColor;\\n\\\n#endif\\n\\\n\\n\\\nuniform vec4 u_bgColor;\\n\\\nuniform sampler2D u_depthTexture;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    if (texture(u_depthTexture, v_textureCoordinates).r < 1.0)\\n\\\n    {\\n\\\n#ifdef MRT\\n\\\n        out_FragData_0 = u_bgColor;\\n\\\n        out_FragData_1 = vec4(u_bgColor.a);\\n\\\n#else\\n\\\n        out_FragColor = u_bgColor;\\n\\\n#endif\\n\\\n        return;\\n\\\n    }\\n\\\n    \\n\\\n    discard;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * Compositing for Weighted Blended Order-Independent Transparency. See:\\n\\\n * - http://jcgt.org/published/0002/02/09/\\n\\\n * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html\\n\\\n */\\n\\\n\\n\\\nuniform sampler2D u_opaque;\\n\\\nuniform sampler2D u_accumulation;\\n\\\nuniform sampler2D u_revealage;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 opaque = texture(u_opaque, v_textureCoordinates);\\n\\\n    vec4 accum = texture(u_accumulation, v_textureCoordinates);\\n\\\n    float r = texture(u_revealage, v_textureCoordinates).r;\\n\\\n\\n\\\n#ifdef MRT\\n\\\n    vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\\n\\\n#else\\n\\\n    vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\\n\\\n#endif\\n\\\n\\n\\\n    out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\\n\\\n\\n\\\n    if (opaque != czm_backgroundColor)\\n\\\n    {\\n\\\n        out_FragColor.a = 1.0;\\n\\\n    }\\n\\\n}\\n\\\n\";\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport AdjustTranslucentFS from \"../Shaders/AdjustTranslucentFS.js\";\nimport CompositeOITFS from \"../Shaders/CompositeOITFS.js\";\nimport BlendEquation from \"./BlendEquation.js\";\nimport BlendFunction from \"./BlendFunction.js\";\n\n/**\n * @private\n * @constructor\n * @param {Context} context\n */\nfunction OIT(context) {\n  this._numSamples = 1;\n  // We support multipass for the Chrome D3D9 backend and ES 2.0 on mobile.\n  this._translucentMultipassSupport = false;\n  this._translucentMRTSupport = false;\n\n  const extensionsSupported =\n    context.colorBufferFloat && context.depthTexture && context.floatBlend;\n  this._translucentMRTSupport = context.drawBuffers && extensionsSupported;\n  this._translucentMultipassSupport =\n    !this._translucentMRTSupport && extensionsSupported;\n\n  this._opaqueFBO = undefined;\n  this._opaqueTexture = undefined;\n  this._depthStencilTexture = undefined;\n\n  this._accumulationTexture = undefined;\n\n  this._translucentFBO = new FramebufferManager({\n    colorAttachmentsLength: this._translucentMRTSupport ? 2 : 1,\n    createColorAttachments: false,\n    createDepthAttachments: false,\n    depth: true,\n  });\n  this._alphaFBO = new FramebufferManager({\n    createColorAttachments: false,\n    createDepthAttachments: false,\n    depth: true,\n  });\n\n  this._adjustTranslucentFBO = new FramebufferManager({\n    colorAttachmentsLength: this._translucentMRTSupport ? 2 : 1,\n    createColorAttachments: false,\n  });\n  this._adjustAlphaFBO = new FramebufferManager({\n    createColorAttachments: false,\n  });\n\n  this._opaqueClearCommand = new ClearCommand({\n    color: new Color(0.0, 0.0, 0.0, 0.0),\n    owner: this,\n  });\n  this._translucentMRTClearCommand = new ClearCommand({\n    color: new Color(0.0, 0.0, 0.0, 1.0),\n    owner: this,\n  });\n  this._translucentMultipassClearCommand = new ClearCommand({\n    color: new Color(0.0, 0.0, 0.0, 0.0),\n    owner: this,\n  });\n  this._alphaClearCommand = new ClearCommand({\n    color: new Color(1.0, 1.0, 1.0, 1.0),\n    owner: this,\n  });\n\n  this._translucentRenderStateCache = {};\n  this._alphaRenderStateCache = {};\n\n  this._compositeCommand = undefined;\n  this._adjustTranslucentCommand = undefined;\n  this._adjustAlphaCommand = undefined;\n\n  this._viewport = new BoundingRectangle();\n  this._rs = undefined;\n\n  this._useScissorTest = false;\n  this._scissorRectangle = undefined;\n\n  this._useHDR = false;\n}\n\n/**\n * @private\n * @param {OIT} oit\n */\nfunction destroyTextures(oit) {\n  oit._accumulationTexture =\n    oit._accumulationTexture &&\n    !oit._accumulationTexture.isDestroyed() &&\n    oit._accumulationTexture.destroy();\n  oit._revealageTexture =\n    oit._revealageTexture &&\n    !oit._revealageTexture.isDestroyed() &&\n    oit._revealageTexture.destroy();\n}\n\n/**\n * @private\n * @param {OIT} oit\n */\nfunction destroyFramebuffers(oit) {\n  oit._translucentFBO.destroy();\n  oit._alphaFBO.destroy();\n  oit._adjustTranslucentFBO.destroy();\n  oit._adjustAlphaFBO.destroy();\n}\n\n/**\n * @private\n * @param {OIT} oit\n */\nfunction destroyResources(oit) {\n  destroyTextures(oit);\n  destroyFramebuffers(oit);\n}\n\n/**\n * @private\n * @param {OIT} oit\n * @param {Context} context\n * @param {number} width\n * @param {number} height\n */\nfunction updateTextures(oit, context, width, height) {\n  destroyTextures(oit);\n\n  oit._accumulationTexture = new Texture({\n    context: context,\n    width: width,\n    height: height,\n    pixelFormat: PixelFormat.RGBA,\n    pixelDatatype: PixelDatatype.FLOAT,\n  });\n\n  // Use zeroed arraybuffer instead of null to initialize texture\n  // to workaround Firefox. Only needed for the second color attachment.\n  const source = new Float32Array(width * height * 4);\n  oit._revealageTexture = new Texture({\n    context: context,\n    pixelFormat: PixelFormat.RGBA,\n    pixelDatatype: PixelDatatype.FLOAT,\n    source: {\n      arrayBufferView: source,\n      width: width,\n      height: height,\n    },\n    flipY: false,\n  });\n}\n\n/**\n * @private\n * @param {OIT} oit\n * @param {Context} context\n * @returns {boolean}\n */\nfunction updateFramebuffers(oit, context) {\n  destroyFramebuffers(oit);\n\n  const completeFBO = WebGLConstants.FRAMEBUFFER_COMPLETE;\n  let supported = true;\n\n  const { width, height } = oit._accumulationTexture;\n\n  // if MRT is supported, attempt to make an FBO with multiple color attachments\n  if (oit._translucentMRTSupport) {\n    oit._translucentFBO.setColorTexture(oit._accumulationTexture, 0);\n    oit._translucentFBO.setColorTexture(oit._revealageTexture, 1);\n    oit._translucentFBO.setDepthStencilTexture(oit._depthStencilTexture);\n    oit._translucentFBO.update(context, width, height);\n\n    oit._adjustTranslucentFBO.setColorTexture(oit._accumulationTexture, 0);\n    oit._adjustTranslucentFBO.setColorTexture(oit._revealageTexture, 1);\n    oit._adjustTranslucentFBO.update(context, width, height);\n\n    if (\n      oit._translucentFBO.status !== completeFBO ||\n      oit._adjustTranslucentFBO.status !== completeFBO\n    ) {\n      destroyFramebuffers(oit);\n      oit._translucentMRTSupport = false;\n    }\n  }\n\n  // either MRT isn't supported or FBO creation failed, attempt multipass\n  if (!oit._translucentMRTSupport) {\n    oit._translucentFBO.setColorTexture(oit._accumulationTexture);\n    oit._translucentFBO.setDepthStencilTexture(oit._depthStencilTexture);\n    oit._translucentFBO.update(context, width, height);\n\n    oit._alphaFBO.setColorTexture(oit._revealageTexture);\n    oit._alphaFBO.setDepthStencilTexture(oit._depthStencilTexture);\n    oit._alphaFBO.update(context, width, height);\n\n    oit._adjustTranslucentFBO.setColorTexture(oit._accumulationTexture);\n    oit._adjustTranslucentFBO.update(context, width, height);\n\n    oit._adjustAlphaFBO.setColorTexture(oit._revealageTexture);\n    oit._adjustAlphaFBO.update(context, width, height);\n\n    const translucentComplete = oit._translucentFBO.status === completeFBO;\n    const alphaComplete = oit._alphaFBO.status === completeFBO;\n    const adjustTranslucentComplete =\n      oit._adjustTranslucentFBO.status === completeFBO;\n    const adjustAlphaComplete = oit._adjustAlphaFBO.status === completeFBO;\n    if (\n      !translucentComplete ||\n      !alphaComplete ||\n      !adjustTranslucentComplete ||\n      !adjustAlphaComplete\n    ) {\n      destroyResources(oit);\n      oit._translucentMultipassSupport = false;\n      supported = false;\n    }\n  }\n\n  return supported;\n}\n\n/**\n * @private\n * @param {Context} context\n * @param {PassState} passState\n * @param {Framebuffer} framebuffer\n * @param {boolean} useHDR\n * @param {number} numSamples\n */\nOIT.prototype.update = function (\n  context,\n  passState,\n  framebuffer,\n  useHDR,\n  numSamples\n) {\n  if (!this.isSupported()) {\n    return;\n  }\n\n  this._opaqueFBO = framebuffer;\n  this._opaqueTexture = framebuffer.getColorTexture(0);\n  this._depthStencilTexture = framebuffer.getDepthStencilTexture();\n\n  const { width, height } = this._opaqueTexture;\n\n  const accumulationTexture = this._accumulationTexture;\n  const textureChanged =\n    !defined(accumulationTexture) ||\n    accumulationTexture.width !== width ||\n    accumulationTexture.height !== height ||\n    useHDR !== this._useHDR;\n  const samplesChanged = this._numSamples !== numSamples;\n\n  if (textureChanged || samplesChanged) {\n    this._numSamples = numSamples;\n    updateTextures(this, context, width, height);\n  }\n\n  if (\n    !defined(this._translucentFBO.framebuffer) ||\n    textureChanged ||\n    samplesChanged\n  ) {\n    if (!updateFramebuffers(this, context)) {\n      // framebuffer creation failed\n      return;\n    }\n  }\n\n  this._useHDR = useHDR;\n\n  const that = this;\n  let fs;\n  let uniformMap;\n\n  if (!defined(this._compositeCommand)) {\n    fs = new ShaderSource({\n      sources: [CompositeOITFS],\n    });\n    if (this._translucentMRTSupport) {\n      fs.defines.push(\"MRT\");\n    }\n\n    uniformMap = {\n      u_opaque: function () {\n        return that._opaqueTexture;\n      },\n      u_accumulation: function () {\n        return that._accumulationTexture;\n      },\n      u_revealage: function () {\n        return that._revealageTexture;\n      },\n    };\n    this._compositeCommand = context.createViewportQuadCommand(fs, {\n      uniformMap: uniformMap,\n      owner: this,\n    });\n  }\n\n  if (!defined(this._adjustTranslucentCommand)) {\n    if (this._translucentMRTSupport) {\n      fs = new ShaderSource({\n        defines: [\"MRT\"],\n        sources: [AdjustTranslucentFS],\n      });\n\n      uniformMap = {\n        u_bgColor: function () {\n          return that._translucentMRTClearCommand.color;\n        },\n        u_depthTexture: function () {\n          return that._depthStencilTexture;\n        },\n      };\n\n      this._adjustTranslucentCommand = context.createViewportQuadCommand(fs, {\n        uniformMap: uniformMap,\n        owner: this,\n      });\n    } else if (this._translucentMultipassSupport) {\n      fs = new ShaderSource({\n        sources: [AdjustTranslucentFS],\n      });\n\n      uniformMap = {\n        u_bgColor: function () {\n          return that._translucentMultipassClearCommand.color;\n        },\n        u_depthTexture: function () {\n          return that._depthStencilTexture;\n        },\n      };\n\n      this._adjustTranslucentCommand = context.createViewportQuadCommand(fs, {\n        uniformMap: uniformMap,\n        owner: this,\n      });\n\n      uniformMap = {\n        u_bgColor: function () {\n          return that._alphaClearCommand.color;\n        },\n        u_depthTexture: function () {\n          return that._depthStencilTexture;\n        },\n      };\n\n      this._adjustAlphaCommand = context.createViewportQuadCommand(fs, {\n        uniformMap: uniformMap,\n        owner: this,\n      });\n    }\n  }\n\n  this._viewport.width = width;\n  this._viewport.height = height;\n\n  const useScissorTest = !BoundingRectangle.equals(\n    this._viewport,\n    passState.viewport\n  );\n  let updateScissor = useScissorTest !== this._useScissorTest;\n  this._useScissorTest = useScissorTest;\n\n  if (!BoundingRectangle.equals(this._scissorRectangle, passState.viewport)) {\n    this._scissorRectangle = BoundingRectangle.clone(\n      passState.viewport,\n      this._scissorRectangle\n    );\n    updateScissor = true;\n  }\n\n  if (\n    !defined(this._rs) ||\n    !BoundingRectangle.equals(this._viewport, this._rs.viewport) ||\n    updateScissor\n  ) {\n    this._rs = RenderState.fromCache({\n      viewport: this._viewport,\n      scissorTest: {\n        enabled: this._useScissorTest,\n        rectangle: this._scissorRectangle,\n      },\n    });\n  }\n\n  if (defined(this._compositeCommand)) {\n    this._compositeCommand.renderState = this._rs;\n  }\n\n  if (this._adjustTranslucentCommand) {\n    this._adjustTranslucentCommand.renderState = this._rs;\n  }\n\n  if (defined(this._adjustAlphaCommand)) {\n    this._adjustAlphaCommand.renderState = this._rs;\n  }\n};\n\nconst translucentMRTBlend = {\n  enabled: true,\n  color: new Color(0.0, 0.0, 0.0, 0.0),\n  equationRgb: BlendEquation.ADD,\n  equationAlpha: BlendEquation.ADD,\n  functionSourceRgb: BlendFunction.ONE,\n  functionDestinationRgb: BlendFunction.ONE,\n  functionSourceAlpha: BlendFunction.ZERO,\n  functionDestinationAlpha: BlendFunction.ONE_MINUS_SOURCE_ALPHA,\n};\n\nconst translucentColorBlend = {\n  enabled: true,\n  color: new Color(0.0, 0.0, 0.0, 0.0),\n  equationRgb: BlendEquation.ADD,\n  equationAlpha: BlendEquation.ADD,\n  functionSourceRgb: BlendFunction.ONE,\n  functionDestinationRgb: BlendFunction.ONE,\n  functionSourceAlpha: BlendFunction.ONE,\n  functionDestinationAlpha: BlendFunction.ONE,\n};\n\nconst translucentAlphaBlend = {\n  enabled: true,\n  color: new Color(0.0, 0.0, 0.0, 0.0),\n  equationRgb: BlendEquation.ADD,\n  equationAlpha: BlendEquation.ADD,\n  functionSourceRgb: BlendFunction.ZERO,\n  functionDestinationRgb: BlendFunction.ONE_MINUS_SOURCE_ALPHA,\n  functionSourceAlpha: BlendFunction.ZERO,\n  functionDestinationAlpha: BlendFunction.ONE_MINUS_SOURCE_ALPHA,\n};\n\nfunction getTranslucentRenderState(\n  context,\n  translucentBlending,\n  cache,\n  renderState\n) {\n  let translucentState = cache[renderState.id];\n  if (!defined(translucentState)) {\n    const rs = RenderState.getState(renderState);\n    rs.depthMask = false;\n    rs.blending = translucentBlending;\n\n    translucentState = RenderState.fromCache(rs);\n    cache[renderState.id] = translucentState;\n  }\n\n  return translucentState;\n}\n\nfunction getTranslucentMRTRenderState(oit, context, renderState) {\n  return getTranslucentRenderState(\n    context,\n    translucentMRTBlend,\n    oit._translucentRenderStateCache,\n    renderState\n  );\n}\n\nfunction getTranslucentColorRenderState(oit, context, renderState) {\n  return getTranslucentRenderState(\n    context,\n    translucentColorBlend,\n    oit._translucentRenderStateCache,\n    renderState\n  );\n}\n\nfunction getTranslucentAlphaRenderState(oit, context, renderState) {\n  return getTranslucentRenderState(\n    context,\n    translucentAlphaBlend,\n    oit._alphaRenderStateCache,\n    renderState\n  );\n}\n\nconst mrtShaderSource =\n  \"    vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;\\n\" +\n  \"    float ai = czm_out_FragColor.a;\\n\" +\n  \"    float wzi = czm_alphaWeight(ai);\\n\" +\n  \"    out_FragData_0 = vec4(Ci * wzi, ai);\\n\" +\n  \"    out_FragData_1 = vec4(ai * wzi);\\n\";\n\nconst colorShaderSource =\n  \"    vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;\\n\" +\n  \"    float ai = czm_out_FragColor.a;\\n\" +\n  \"    float wzi = czm_alphaWeight(ai);\\n\" +\n  \"    out_FragColor = vec4(Ci, ai) * wzi;\\n\";\n\nconst alphaShaderSource =\n  \"    float ai = czm_out_FragColor.a;\\n\" + \"    out_FragColor = vec4(ai);\\n\";\n\n/**\n * @private\n * @param {Context} context\n * @param {ShaderProgram} shaderProgram\n * @param {string} keyword\n * @param {string} source\n * @returns {ShaderProgram}\n */\nfunction getTranslucentShaderProgram(context, shaderProgram, keyword, source) {\n  const { shaderCache } = context;\n  const shader = shaderCache.getDerivedShaderProgram(shaderProgram, keyword);\n  if (defined(shader)) {\n    return shader;\n  }\n\n  const attributeLocations = shaderProgram._attributeLocations;\n  const fs = shaderProgram.fragmentShaderSource.clone();\n\n  fs.sources = fs.sources.map(function (fsSource) {\n    return ShaderSource.replaceMain(fsSource, \"czm_translucent_main\")\n      .replace(/out_FragColor/g, \"czm_out_FragColor\")\n      .replace(\n        /layout\\s*\\(location\\s*=\\s*0\\)\\s*out\\s+vec4\\s+out_FragColor;/g,\n        \"\"\n      )\n      .replace(/\\bdiscard\\b/g, \"czm_discard = true\")\n      .replace(/czm_phong/g, \"czm_translucentPhong\");\n  });\n\n  // Discarding the fragment in main is a workaround for ANGLE D3D9\n  // shader compilation errors.\n  fs.sources.splice(\n    0,\n    0,\n    `vec4 czm_out_FragColor;\\n` + `bool czm_discard = false;\\n`\n  );\n\n  const fragDataMatches = [...source.matchAll(/out_FragData_(\\d+)/g)];\n  let fragDataDeclarations = ``;\n  for (let i = 0; i < fragDataMatches.length; i++) {\n    const fragDataMatch = fragDataMatches[i];\n    fragDataDeclarations = `layout (location = ${fragDataMatch[1]}) out vec4 ${fragDataMatch[0]};\\n${fragDataDeclarations}`;\n  }\n  fs.sources.push(fragDataDeclarations);\n\n  fs.sources.push(\n    `${\n      \"void main()\\n\" +\n      \"{\\n\" +\n      \"    czm_translucent_main();\\n\" +\n      \"    if (czm_discard)\\n\" +\n      \"    {\\n\" +\n      \"        discard;\\n\" +\n      \"    }\\n\"\n    }${source}}\\n`\n  );\n\n  return shaderCache.createDerivedShaderProgram(shaderProgram, keyword, {\n    vertexShaderSource: shaderProgram.vertexShaderSource,\n    fragmentShaderSource: fs,\n    attributeLocations: attributeLocations,\n  });\n}\n\nfunction getTranslucentMRTShaderProgram(context, shaderProgram) {\n  return getTranslucentShaderProgram(\n    context,\n    shaderProgram,\n    \"translucentMRT\",\n    mrtShaderSource\n  );\n}\n\nfunction getTranslucentColorShaderProgram(context, shaderProgram) {\n  return getTranslucentShaderProgram(\n    context,\n    shaderProgram,\n    \"translucentMultipass\",\n    colorShaderSource\n  );\n}\n\nfunction getTranslucentAlphaShaderProgram(context, shaderProgram) {\n  return getTranslucentShaderProgram(\n    context,\n    shaderProgram,\n    \"alphaMultipass\",\n    alphaShaderSource\n  );\n}\n\n/**\n * @private\n * @param {DrawCommand} command\n * @param {Context} context\n * @param {*} result\n * @returns {*}\n */\nOIT.prototype.createDerivedCommands = function (command, context, result) {\n  if (!defined(result)) {\n    result = {};\n  }\n\n  if (this._translucentMRTSupport) {\n    let translucentShader;\n    let translucentRenderState;\n    if (defined(result.translucentCommand)) {\n      translucentShader = result.translucentCommand.shaderProgram;\n      translucentRenderState = result.translucentCommand.renderState;\n    }\n\n    result.translucentCommand = DrawCommand.shallowClone(\n      command,\n      result.translucentCommand\n    );\n\n    if (\n      !defined(translucentShader) ||\n      result.shaderProgramId !== command.shaderProgram.id\n    ) {\n      result.translucentCommand.shaderProgram = getTranslucentMRTShaderProgram(\n        context,\n        command.shaderProgram\n      );\n      result.translucentCommand.renderState = getTranslucentMRTRenderState(\n        this,\n        context,\n        command.renderState\n      );\n      result.shaderProgramId = command.shaderProgram.id;\n    } else {\n      result.translucentCommand.shaderProgram = translucentShader;\n      result.translucentCommand.renderState = translucentRenderState;\n    }\n    return result;\n  }\n\n  let colorShader;\n  let colorRenderState;\n  let alphaShader;\n  let alphaRenderState;\n  if (defined(result.translucentCommand)) {\n    colorShader = result.translucentCommand.shaderProgram;\n    colorRenderState = result.translucentCommand.renderState;\n    alphaShader = result.alphaCommand.shaderProgram;\n    alphaRenderState = result.alphaCommand.renderState;\n  }\n\n  result.translucentCommand = DrawCommand.shallowClone(\n    command,\n    result.translucentCommand\n  );\n  result.alphaCommand = DrawCommand.shallowClone(command, result.alphaCommand);\n\n  if (\n    !defined(colorShader) ||\n    result.shaderProgramId !== command.shaderProgram.id\n  ) {\n    result.translucentCommand.shaderProgram = getTranslucentColorShaderProgram(\n      context,\n      command.shaderProgram\n    );\n    result.translucentCommand.renderState = getTranslucentColorRenderState(\n      this,\n      context,\n      command.renderState\n    );\n    result.alphaCommand.shaderProgram = getTranslucentAlphaShaderProgram(\n      context,\n      command.shaderProgram\n    );\n    result.alphaCommand.renderState = getTranslucentAlphaRenderState(\n      this,\n      context,\n      command.renderState\n    );\n    result.shaderProgramId = command.shaderProgram.id;\n  } else {\n    result.translucentCommand.shaderProgram = colorShader;\n    result.translucentCommand.renderState = colorRenderState;\n    result.alphaCommand.shaderProgram = alphaShader;\n    result.alphaCommand.renderState = alphaRenderState;\n  }\n\n  return result;\n};\n\n/**\n * @private\n * @param {OIT} oit\n * @param {Scene} scene\n * @param {Function} executeFunction\n * @param {PassState} passState\n * @param {DrawCommand[]} commands\n * @param {InvertClassification} invertClassification\n */\nfunction executeTranslucentCommandsSortedMultipass(\n  oit,\n  scene,\n  executeFunction,\n  passState,\n  commands,\n  invertClassification\n) {\n  let command;\n  let derivedCommand;\n  let j;\n\n  const { context, frameState } = scene;\n  const { useLogDepth, shadowState } = frameState;\n  const useHdr = scene._hdr;\n  const framebuffer = passState.framebuffer;\n\n  const lightShadowsEnabled = shadowState.lightShadowsEnabled;\n\n  passState.framebuffer = oit._adjustTranslucentFBO.framebuffer;\n  oit._adjustTranslucentCommand.execute(context, passState);\n  passState.framebuffer = oit._adjustAlphaFBO.framebuffer;\n  oit._adjustAlphaCommand.execute(context, passState);\n\n  const debugFramebuffer = oit._opaqueFBO.framebuffer;\n  passState.framebuffer = oit._translucentFBO.framebuffer;\n\n  for (j = 0; j < commands.length; ++j) {\n    command = commands[j];\n    command = useLogDepth ? command.derivedCommands.logDepth.command : command;\n    command = useHdr ? command.derivedCommands.hdr.command : command;\n    derivedCommand =\n      lightShadowsEnabled && command.receiveShadows\n        ? command.derivedCommands.oit.shadows.translucentCommand\n        : command.derivedCommands.oit.translucentCommand;\n    executeFunction(\n      derivedCommand,\n      scene,\n      context,\n      passState,\n      debugFramebuffer\n    );\n  }\n\n  if (defined(invertClassification)) {\n    command = invertClassification.unclassifiedCommand;\n    derivedCommand =\n      lightShadowsEnabled && command.receiveShadows\n        ? command.derivedCommands.oit.shadows.translucentCommand\n        : command.derivedCommands.oit.translucentCommand;\n    executeFunction(\n      derivedCommand,\n      scene,\n      context,\n      passState,\n      debugFramebuffer\n    );\n  }\n\n  passState.framebuffer = oit._alphaFBO.framebuffer;\n\n  for (j = 0; j < commands.length; ++j) {\n    command = commands[j];\n    command = useLogDepth ? command.derivedCommands.logDepth.command : command;\n    command = useHdr ? command.derivedCommands.hdr.command : command;\n    derivedCommand =\n      lightShadowsEnabled && command.receiveShadows\n        ? command.derivedCommands.oit.shadows.alphaCommand\n        : command.derivedCommands.oit.alphaCommand;\n    executeFunction(\n      derivedCommand,\n      scene,\n      context,\n      passState,\n      debugFramebuffer\n    );\n  }\n\n  if (defined(invertClassification)) {\n    command = invertClassification.unclassifiedCommand;\n    derivedCommand =\n      lightShadowsEnabled && command.receiveShadows\n        ? command.derivedCommands.oit.shadows.alphaCommand\n        : command.derivedCommands.oit.alphaCommand;\n    executeFunction(\n      derivedCommand,\n      scene,\n      context,\n      passState,\n      debugFramebuffer\n    );\n  }\n\n  passState.framebuffer = framebuffer;\n}\n\n/**\n * @private\n * @param {OIT} oit\n * @param {Scene} scene\n * @param {Function} executeFunction\n * @param {PassState} passState\n * @param {DrawCommand[]} commands\n * @param {InvertClassification} invertClassification\n */\nfunction executeTranslucentCommandsSortedMRT(\n  oit,\n  scene,\n  executeFunction,\n  passState,\n  commands,\n  invertClassification\n) {\n  const { context, frameState } = scene;\n  const { useLogDepth, shadowState } = frameState;\n  const useHdr = scene._hdr;\n  const framebuffer = passState.framebuffer;\n\n  const lightShadowsEnabled = shadowState.lightShadowsEnabled;\n\n  passState.framebuffer = oit._adjustTranslucentFBO.framebuffer;\n  oit._adjustTranslucentCommand.execute(context, passState);\n\n  const debugFramebuffer = oit._opaqueFBO.framebuffer;\n  passState.framebuffer = oit._translucentFBO.framebuffer;\n\n  let command;\n  let derivedCommand;\n\n  for (let j = 0; j < commands.length; ++j) {\n    command = commands[j];\n    command = useLogDepth ? command.derivedCommands.logDepth.command : command;\n    command = useHdr ? command.derivedCommands.hdr.command : command;\n    derivedCommand =\n      lightShadowsEnabled && command.receiveShadows\n        ? command.derivedCommands.oit.shadows.translucentCommand\n        : command.derivedCommands.oit.translucentCommand;\n    executeFunction(\n      derivedCommand,\n      scene,\n      context,\n      passState,\n      debugFramebuffer\n    );\n  }\n\n  if (defined(invertClassification)) {\n    command = invertClassification.unclassifiedCommand;\n    derivedCommand =\n      lightShadowsEnabled && command.receiveShadows\n        ? command.derivedCommands.oit.shadows.translucentCommand\n        : command.derivedCommands.oit.translucentCommand;\n    executeFunction(\n      derivedCommand,\n      scene,\n      context,\n      passState,\n      debugFramebuffer\n    );\n  }\n\n  passState.framebuffer = framebuffer;\n}\n\n/**\n * @private\n * @param {Scene} scene\n * @param {Function} executeFunction\n * @param {PassState} passState\n * @param {DrawCommand[]} commands\n * @param {InvertClassification} invertClassification\n */\nOIT.prototype.executeCommands = function (\n  scene,\n  executeFunction,\n  passState,\n  commands,\n  invertClassification\n) {\n  if (this._translucentMRTSupport) {\n    executeTranslucentCommandsSortedMRT(\n      this,\n      scene,\n      executeFunction,\n      passState,\n      commands,\n      invertClassification\n    );\n    return;\n  }\n\n  executeTranslucentCommandsSortedMultipass(\n    this,\n    scene,\n    executeFunction,\n    passState,\n    commands,\n    invertClassification\n  );\n};\n\n/**\n * @private\n * @param {Context} context\n * @param {PassState} passState\n */\nOIT.prototype.execute = function (context, passState) {\n  this._compositeCommand.execute(context, passState);\n};\n\n/**\n * @private\n * @param {Context} context\n * @param {PassState} passState\n * @param {Color} clearColor\n */\nOIT.prototype.clear = function (context, passState, clearColor) {\n  const framebuffer = passState.framebuffer;\n\n  passState.framebuffer = this._opaqueFBO.framebuffer;\n  Color.clone(clearColor, this._opaqueClearCommand.color);\n  this._opaqueClearCommand.execute(context, passState);\n\n  passState.framebuffer = this._translucentFBO.framebuffer;\n  const translucentClearCommand = this._translucentMRTSupport\n    ? this._translucentMRTClearCommand\n    : this._translucentMultipassClearCommand;\n  translucentClearCommand.execute(context, passState);\n\n  if (this._translucentMultipassSupport) {\n    passState.framebuffer = this._alphaFBO.framebuffer;\n    this._alphaClearCommand.execute(context, passState);\n  }\n\n  passState.framebuffer = framebuffer;\n};\n\n/**\n * @private\n * @returns {boolean}\n */\nOIT.prototype.isSupported = function () {\n  return this._translucentMRTSupport || this._translucentMultipassSupport;\n};\n\n/**\n * @private\n * @returns {boolean}\n */\nOIT.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * @private\n */\nOIT.prototype.destroy = function () {\n  destroyResources(this);\n\n  if (defined(this._compositeCommand)) {\n    this._compositeCommand.shaderProgram =\n      this._compositeCommand.shaderProgram &&\n      this._compositeCommand.shaderProgram.destroy();\n  }\n\n  if (defined(this._adjustTranslucentCommand)) {\n    this._adjustTranslucentCommand.shaderProgram =\n      this._adjustTranslucentCommand.shaderProgram &&\n      this._adjustTranslucentCommand.shaderProgram.destroy();\n  }\n\n  if (defined(this._adjustAlphaCommand)) {\n    this._adjustAlphaCommand.shaderProgram =\n      this._adjustAlphaCommand.shaderProgram &&\n      this._adjustAlphaCommand.shaderProgram.destroy();\n  }\n\n  return destroyObject(this);\n};\n\nexport default OIT;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PassState from \"../Renderer/PassState.js\";\n\n/**\n * @private\n */\nfunction PickDepthFramebuffer() {\n  this._framebuffer = new FramebufferManager({\n    color: false,\n    depthStencil: true,\n    supportsDepthTexture: true,\n  });\n  this._passState = undefined;\n}\n\nObject.defineProperties(PickDepthFramebuffer.prototype, {\n  framebuffer: {\n    get: function () {\n      return this._framebuffer.framebuffer;\n    },\n  },\n});\n\nfunction destroyResources(pickDepth) {\n  pickDepth._framebuffer.destroy();\n}\n\nfunction createResources(pickDepth, context) {\n  const width = context.drawingBufferWidth;\n  const height = context.drawingBufferHeight;\n\n  pickDepth._framebuffer.update(context, width, height);\n\n  const passState = new PassState(context);\n  passState.blendingEnabled = false;\n  passState.scissorTest = {\n    enabled: true,\n    rectangle: new BoundingRectangle(),\n  };\n  passState.viewport = new BoundingRectangle();\n  pickDepth._passState = passState;\n}\n\nPickDepthFramebuffer.prototype.update = function (\n  context,\n  drawingBufferPosition,\n  viewport\n) {\n  const width = viewport.width;\n  const height = viewport.height;\n\n  if (this._framebuffer.isDirty(width, height)) {\n    createResources(this, context);\n  }\n\n  const framebuffer = this.framebuffer;\n  const passState = this._passState;\n  passState.framebuffer = framebuffer;\n  passState.viewport.width = width;\n  passState.viewport.height = height;\n  passState.scissorTest.rectangle.x = drawingBufferPosition.x;\n  passState.scissorTest.rectangle.y = height - drawingBufferPosition.y;\n  passState.scissorTest.rectangle.width = 1;\n  passState.scissorTest.rectangle.height = 1;\n\n  return passState;\n};\n\nPickDepthFramebuffer.prototype.isDestroyed = function () {\n  return false;\n};\n\nPickDepthFramebuffer.prototype.destroy = function () {\n  destroyResources(this);\n  return destroyObject(this);\n};\nexport default PickDepthFramebuffer;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PassState from \"../Renderer/PassState.js\";\n\n/**\n * @private\n */\nfunction PickFramebuffer(context) {\n  // Override per-command states\n  const passState = new PassState(context);\n  passState.blendingEnabled = false;\n  passState.scissorTest = {\n    enabled: true,\n    rectangle: new BoundingRectangle(),\n  };\n  passState.viewport = new BoundingRectangle();\n\n  this._context = context;\n  this._fb = new FramebufferManager({\n    depthStencil: true,\n  });\n  this._passState = passState;\n  this._width = 0;\n  this._height = 0;\n}\nPickFramebuffer.prototype.begin = function (screenSpaceRectangle, viewport) {\n  const context = this._context;\n  const width = viewport.width;\n  const height = viewport.height;\n\n  BoundingRectangle.clone(\n    screenSpaceRectangle,\n    this._passState.scissorTest.rectangle\n  );\n\n  // Create or recreate renderbuffers and framebuffer used for picking\n  this._width = width;\n  this._height = height;\n  this._fb.update(context, width, height);\n  this._passState.framebuffer = this._fb.framebuffer;\n\n  this._passState.viewport.width = width;\n  this._passState.viewport.height = height;\n\n  return this._passState;\n};\n\nconst colorScratch = new Color();\n\nPickFramebuffer.prototype.end = function (screenSpaceRectangle) {\n  const width = defaultValue(screenSpaceRectangle.width, 1.0);\n  const height = defaultValue(screenSpaceRectangle.height, 1.0);\n\n  const context = this._context;\n  const pixels = context.readPixels({\n    x: screenSpaceRectangle.x,\n    y: screenSpaceRectangle.y,\n    width: width,\n    height: height,\n    framebuffer: this._fb.framebuffer,\n  });\n\n  const max = Math.max(width, height);\n  const length = max * max;\n  const halfWidth = Math.floor(width * 0.5);\n  const halfHeight = Math.floor(height * 0.5);\n\n  let x = 0;\n  let y = 0;\n  let dx = 0;\n  let dy = -1;\n\n  // Spiral around the center pixel, this is a workaround until\n  // we can access the depth buffer on all browsers.\n\n  // The region does not have to square and the dimensions do not have to be odd, but\n  // loop iterations would be wasted. Prefer square regions where the size is odd.\n  for (let i = 0; i < length; ++i) {\n    if (\n      -halfWidth <= x &&\n      x <= halfWidth &&\n      -halfHeight <= y &&\n      y <= halfHeight\n    ) {\n      const index = 4 * ((halfHeight - y) * width + x + halfWidth);\n\n      colorScratch.red = Color.byteToFloat(pixels[index]);\n      colorScratch.green = Color.byteToFloat(pixels[index + 1]);\n      colorScratch.blue = Color.byteToFloat(pixels[index + 2]);\n      colorScratch.alpha = Color.byteToFloat(pixels[index + 3]);\n\n      const object = context.getObjectByPickColor(colorScratch);\n      if (defined(object)) {\n        return object;\n      }\n    }\n\n    // if (top right || bottom left corners) || (top left corner) || (bottom right corner + (1, 0))\n    // change spiral direction\n    if (x === y || (x < 0 && -x === y) || (x > 0 && x === 1 - y)) {\n      const temp = dx;\n      dx = -dy;\n      dy = temp;\n    }\n\n    x += dx;\n    y += dy;\n  }\n\n  return undefined;\n};\n\nPickFramebuffer.prototype.isDestroyed = function () {\n  return false;\n};\n\nPickFramebuffer.prototype.destroy = function () {\n  this._fb.destroy();\n  return destroyObject(this);\n};\nexport default PickFramebuffer;\n", "import Color from \"../Core/Color.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\n\n/**\n * @private\n */\nfunction SceneFramebuffer() {\n  this._numSamples = 1;\n  this._colorFramebuffer = new FramebufferManager({\n    depthStencil: true,\n    supportsDepthTexture: true,\n  });\n  this._idFramebuffer = new FramebufferManager({\n    depthStencil: true,\n    supportsDepthTexture: true,\n  });\n\n  this._idClearColor = new Color(0.0, 0.0, 0.0, 0.0);\n\n  this._clearCommand = new ClearCommand({\n    color: new Color(0.0, 0.0, 0.0, 0.0),\n    depth: 1.0,\n    owner: this,\n  });\n}\n\nfunction destroyResources(post) {\n  post._colorFramebuffer.destroy();\n  post._idFramebuffer.destroy();\n}\n\nObject.defineProperties(SceneFramebuffer.prototype, {\n  framebuffer: {\n    get: function () {\n      return this._colorFramebuffer.framebuffer;\n    },\n  },\n  idFramebuffer: {\n    get: function () {\n      return this._idFramebuffer.framebuffer;\n    },\n  },\n  depthStencilTexture: {\n    get: function () {\n      return this._colorFramebuffer.getDepthStencilTexture();\n    },\n  },\n});\n\nSceneFramebuffer.prototype.update = function (\n  context,\n  viewport,\n  hdr,\n  numSamples\n) {\n  const width = viewport.width;\n  const height = viewport.height;\n  const pixelDatatype = hdr\n    ? context.halfFloatingPointTexture\n      ? PixelDatatype.HALF_FLOAT\n      : PixelDatatype.FLOAT\n    : PixelDatatype.UNSIGNED_BYTE;\n  this._numSamples = numSamples;\n  this._colorFramebuffer.update(\n    context,\n    width,\n    height,\n    numSamples,\n    pixelDatatype\n  );\n  this._idFramebuffer.update(context, width, height);\n};\n\nSceneFramebuffer.prototype.clear = function (context, passState, clearColor) {\n  Color.clone(clearColor, this._clearCommand.color);\n  Color.clone(this._idClearColor, this._clearCommand.color);\n  this._colorFramebuffer.clear(context, this._clearCommand, passState);\n  this._idFramebuffer.clear(context, this._clearCommand, passState);\n};\n\nSceneFramebuffer.prototype.getFramebuffer = function () {\n  return this._colorFramebuffer.framebuffer;\n};\n\nSceneFramebuffer.prototype.getIdFramebuffer = function () {\n  return this._idFramebuffer.framebuffer;\n};\n\nSceneFramebuffer.prototype.prepareColorTextures = function (context) {\n  if (this._numSamples > 1) {\n    this._colorFramebuffer.prepareTextures(context);\n  }\n};\n\nSceneFramebuffer.prototype.isDestroyed = function () {\n  return false;\n};\n\nSceneFramebuffer.prototype.destroy = function () {\n  destroyResources(this);\n  return destroyObject(this);\n};\nexport default SceneFramebuffer;\n", "import defined from \"../Core/defined.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\n\n/**\n * @private\n */\nfunction ShadowMapShader() {}\n\nShadowMapShader.getShadowCastShaderKeyword = function (\n  isPointLight,\n  isTerrain,\n  usesDepthTexture,\n  isOpaque\n) {\n  return `castShadow ${isPointLight} ${isTerrain} ${usesDepthTexture} ${isOpaque}`;\n};\n\nShadowMapShader.createShadowCastVertexShader = function (\n  vs,\n  isPointLight,\n  isTerrain\n) {\n  const defines = vs.defines.slice(0);\n  const sources = vs.sources.slice(0);\n\n  defines.push(\"SHADOW_MAP\");\n\n  if (isTerrain) {\n    defines.push(\"GENERATE_POSITION\");\n  }\n\n  const positionVaryingName = ShaderSource.findPositionVarying(vs);\n  const hasPositionVarying = defined(positionVaryingName);\n\n  if (isPointLight && !hasPositionVarying) {\n    const length = sources.length;\n    for (let j = 0; j < length; ++j) {\n      sources[j] = ShaderSource.replaceMain(sources[j], \"czm_shadow_cast_main\");\n    }\n\n    const shadowVS =\n      \"out vec3 v_positionEC; \\n\" +\n      \"void main() \\n\" +\n      \"{ \\n\" +\n      \"    czm_shadow_cast_main(); \\n\" +\n      \"    v_positionEC = (czm_inverseProjection * gl_Position).xyz; \\n\" +\n      \"}\";\n    sources.push(shadowVS);\n  }\n\n  return new ShaderSource({\n    defines: defines,\n    sources: sources,\n  });\n};\n\nShadowMapShader.createShadowCastFragmentShader = function (\n  fs,\n  isPointLight,\n  usesDepthTexture,\n  opaque\n) {\n  const defines = fs.defines.slice(0);\n  const sources = fs.sources.slice(0);\n\n  defines.push(\"SHADOW_MAP\");\n\n  let positionVaryingName = ShaderSource.findPositionVarying(fs);\n  const hasPositionVarying = defined(positionVaryingName);\n  if (!hasPositionVarying) {\n    positionVaryingName = \"v_positionEC\";\n  }\n\n  const length = sources.length;\n  for (let i = 0; i < length; ++i) {\n    sources[i] = ShaderSource.replaceMain(sources[i], \"czm_shadow_cast_main\");\n  }\n\n  let fsSource = \"\";\n\n  if (isPointLight) {\n    if (!hasPositionVarying) {\n      fsSource += \"in vec3 v_positionEC; \\n\";\n    }\n    fsSource += \"uniform vec4 shadowMap_lightPositionEC; \\n\";\n  }\n\n  if (opaque) {\n    fsSource += \"void main() \\n\" + \"{ \\n\";\n  } else {\n    fsSource +=\n      \"void main() \\n\" +\n      \"{ \\n\" +\n      \"    czm_shadow_cast_main(); \\n\" +\n      \"    if (out_FragColor.a == 0.0) \\n\" +\n      \"    { \\n\" +\n      \"       discard; \\n\" +\n      \"    } \\n\";\n  }\n\n  if (isPointLight) {\n    fsSource +=\n      `    float distance = length(${positionVaryingName}); \\n` +\n      `    if (distance >= shadowMap_lightPositionEC.w) \\n` +\n      `    { \\n` +\n      `        discard; \\n` +\n      `    } \\n` +\n      `    distance /= shadowMap_lightPositionEC.w; // radius \\n` +\n      `    out_FragColor = czm_packDepth(distance); \\n`;\n  } else if (usesDepthTexture) {\n    fsSource += \"    out_FragColor = vec4(1.0); \\n\";\n  } else {\n    fsSource += \"    out_FragColor = czm_packDepth(gl_FragCoord.z); \\n\";\n  }\n\n  fsSource += \"} \\n\";\n\n  sources.push(fsSource);\n\n  return new ShaderSource({\n    defines: defines,\n    sources: sources,\n  });\n};\n\nShadowMapShader.getShadowReceiveShaderKeyword = function (\n  shadowMap,\n  castShadows,\n  isTerrain,\n  hasTerrainNormal\n) {\n  const usesDepthTexture = shadowMap._usesDepthTexture;\n  const polygonOffsetSupported = shadowMap._polygonOffsetSupported;\n  const isPointLight = shadowMap._isPointLight;\n  const isSpotLight = shadowMap._isSpotLight;\n  const hasCascades = shadowMap._numberOfCascades > 1;\n  const debugCascadeColors = shadowMap.debugCascadeColors;\n  const softShadows = shadowMap.softShadows;\n\n  return `receiveShadow ${usesDepthTexture}${polygonOffsetSupported}${isPointLight}${isSpotLight}${hasCascades}${debugCascadeColors}${softShadows}${castShadows}${isTerrain}${hasTerrainNormal}`;\n};\n\nShadowMapShader.createShadowReceiveVertexShader = function (\n  vs,\n  isTerrain,\n  hasTerrainNormal\n) {\n  const defines = vs.defines.slice(0);\n  const sources = vs.sources.slice(0);\n\n  defines.push(\"SHADOW_MAP\");\n\n  if (isTerrain) {\n    if (hasTerrainNormal) {\n      defines.push(\"GENERATE_POSITION_AND_NORMAL\");\n    } else {\n      defines.push(\"GENERATE_POSITION\");\n    }\n  }\n\n  return new ShaderSource({\n    defines: defines,\n    sources: sources,\n  });\n};\n\nShadowMapShader.createShadowReceiveFragmentShader = function (\n  fs,\n  shadowMap,\n  castShadows,\n  isTerrain,\n  hasTerrainNormal\n) {\n  const normalVaryingName = ShaderSource.findNormalVarying(fs);\n  const hasNormalVarying =\n    (!isTerrain && defined(normalVaryingName)) ||\n    (isTerrain && hasTerrainNormal);\n\n  const positionVaryingName = ShaderSource.findPositionVarying(fs);\n  const hasPositionVarying = defined(positionVaryingName);\n\n  const usesDepthTexture = shadowMap._usesDepthTexture;\n  const polygonOffsetSupported = shadowMap._polygonOffsetSupported;\n  const isPointLight = shadowMap._isPointLight;\n  const isSpotLight = shadowMap._isSpotLight;\n  const hasCascades = shadowMap._numberOfCascades > 1;\n  const debugCascadeColors = shadowMap.debugCascadeColors;\n  const softShadows = shadowMap.softShadows;\n  const bias = isPointLight\n    ? shadowMap._pointBias\n    : isTerrain\n    ? shadowMap._terrainBias\n    : shadowMap._primitiveBias;\n\n  const defines = fs.defines.slice(0);\n  const sources = fs.sources.slice(0);\n\n  const length = sources.length;\n  for (let i = 0; i < length; ++i) {\n    sources[i] = ShaderSource.replaceMain(\n      sources[i],\n      \"czm_shadow_receive_main\"\n    );\n  }\n\n  if (isPointLight) {\n    defines.push(\"USE_CUBE_MAP_SHADOW\");\n  } else if (usesDepthTexture) {\n    defines.push(\"USE_SHADOW_DEPTH_TEXTURE\");\n  }\n\n  if (softShadows && !isPointLight) {\n    defines.push(\"USE_SOFT_SHADOWS\");\n  }\n\n  // Enable day-night shading so that the globe is dark when the light is below the horizon\n  if (hasCascades && castShadows && isTerrain) {\n    if (hasNormalVarying) {\n      defines.push(\"ENABLE_VERTEX_LIGHTING\");\n    } else {\n      defines.push(\"ENABLE_DAYNIGHT_SHADING\");\n    }\n  }\n\n  if (castShadows && bias.normalShading && hasNormalVarying) {\n    defines.push(\"USE_NORMAL_SHADING\");\n    if (bias.normalShadingSmooth > 0.0) {\n      defines.push(\"USE_NORMAL_SHADING_SMOOTH\");\n    }\n  }\n\n  let fsSource = \"\";\n\n  if (isPointLight) {\n    fsSource += \"uniform samplerCube shadowMap_textureCube; \\n\";\n  } else {\n    fsSource += \"uniform sampler2D shadowMap_texture; \\n\";\n  }\n\n  let returnPositionEC;\n  if (hasPositionVarying) {\n    returnPositionEC = `    return vec4(${positionVaryingName}, 1.0); \\n`;\n  } else {\n    returnPositionEC =\n      \"#ifndef LOG_DEPTH \\n\" +\n      \"    return czm_windowToEyeCoordinates(gl_FragCoord); \\n\" +\n      \"#else \\n\" +\n      \"    return vec4(v_logPositionEC, 1.0); \\n\" +\n      \"#endif \\n\";\n  }\n\n  fsSource +=\n    `${\n      \"uniform mat4 shadowMap_matrix; \\n\" +\n      \"uniform vec3 shadowMap_lightDirectionEC; \\n\" +\n      \"uniform vec4 shadowMap_lightPositionEC; \\n\" +\n      \"uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \\n\" +\n      \"uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \\n\" +\n      \"#ifdef LOG_DEPTH \\n\" +\n      \"in vec3 v_logPositionEC; \\n\" +\n      \"#endif \\n\" +\n      \"vec4 getPositionEC() \\n\" +\n      \"{ \\n\"\n    }${returnPositionEC}} \\n` +\n    `vec3 getNormalEC() \\n` +\n    `{ \\n${\n      hasNormalVarying\n        ? `    return normalize(${normalVaryingName}); \\n`\n        : \"    return vec3(1.0); \\n\"\n    }} \\n` +\n    // Offset the shadow position in the direction of the normal for perpendicular and back faces\n    `void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \\n` +\n    `{ \\n${\n      bias.normalOffset && hasNormalVarying\n        ? \"    float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \\n\" +\n          \"    float normalOffsetScale = 1.0 - nDotL; \\n\" +\n          \"    vec3 offset = normalOffset * normalOffsetScale * normalEC; \\n\" +\n          \"    positionEC.xyz += offset; \\n\"\n        : \"\"\n    }} \\n`;\n\n  fsSource +=\n    \"void main() \\n\" +\n    \"{ \\n\" +\n    \"    czm_shadow_receive_main(); \\n\" +\n    \"    vec4 positionEC = getPositionEC(); \\n\" +\n    \"    vec3 normalEC = getNormalEC(); \\n\" +\n    \"    float depth = -positionEC.z; \\n\";\n\n  fsSource +=\n    \"    czm_shadowParameters shadowParameters; \\n\" +\n    \"    shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \\n\" +\n    \"    shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \\n\" +\n    \"    shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \\n\" +\n    \"    shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \\n\";\n\n  if (isTerrain) {\n    // Scale depth bias based on view distance to reduce z-fighting in distant terrain\n    fsSource += \"    shadowParameters.depthBias *= max(depth * 0.01, 1.0); \\n\";\n  } else if (!polygonOffsetSupported) {\n    // If polygon offset isn't supported push the depth back based on view, however this\n    // causes light leaking at further away views\n    fsSource +=\n      \"    shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \\n\";\n  }\n\n  if (isPointLight) {\n    fsSource +=\n      \"    vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \\n\" +\n      \"    float distance = length(directionEC); \\n\" +\n      \"    directionEC = normalize(directionEC); \\n\" +\n      \"    float radius = shadowMap_lightPositionEC.w; \\n\" +\n      \"    // Stop early if the fragment is beyond the point light radius \\n\" +\n      \"    if (distance > radius) \\n\" +\n      \"    { \\n\" +\n      \"        return; \\n\" +\n      \"    } \\n\" +\n      \"    vec3 directionWC  = czm_inverseViewRotation * directionEC; \\n\" +\n      \"    shadowParameters.depth = distance / radius; \\n\" +\n      \"    shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \\n\" +\n      \"    shadowParameters.texCoords = directionWC; \\n\" +\n      \"    float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \\n\";\n  } else if (isSpotLight) {\n    fsSource +=\n      \"    vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \\n\" +\n      \"    float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \\n\" +\n      \"    applyNormalOffset(positionEC, normalEC, nDotL); \\n\" +\n      \"    vec4 shadowPosition = shadowMap_matrix * positionEC; \\n\" +\n      \"    // Spot light uses a perspective projection, so perform the perspective divide \\n\" +\n      \"    shadowPosition /= shadowPosition.w; \\n\" +\n      \"    // Stop early if the fragment is not in the shadow bounds \\n\" +\n      \"    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \\n\" +\n      \"    { \\n\" +\n      \"        return; \\n\" +\n      \"    } \\n\" +\n      \"    shadowParameters.texCoords = shadowPosition.xy; \\n\" +\n      \"    shadowParameters.depth = shadowPosition.z; \\n\" +\n      \"    shadowParameters.nDotL = nDotL; \\n\" +\n      \"    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \\n\";\n  } else if (hasCascades) {\n    fsSource += `${\n      \"    float maxDepth = shadowMap_cascadeSplits[1].w; \\n\" +\n      \"    // Stop early if the eye depth exceeds the last cascade \\n\" +\n      \"    if (depth > maxDepth) \\n\" +\n      \"    { \\n\" +\n      \"        return; \\n\" +\n      \"    } \\n\" +\n      \"    // Get the cascade based on the eye-space depth \\n\" +\n      \"    vec4 weights = czm_cascadeWeights(depth); \\n\" +\n      \"    // Apply normal offset \\n\" +\n      \"    float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \\n\" +\n      \"    applyNormalOffset(positionEC, normalEC, nDotL); \\n\" +\n      \"    // Transform position into the cascade \\n\" +\n      \"    vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; \\n\" +\n      \"    // Get visibility \\n\" +\n      \"    shadowParameters.texCoords = shadowPosition.xy; \\n\" +\n      \"    shadowParameters.depth = shadowPosition.z; \\n\" +\n      \"    shadowParameters.nDotL = nDotL; \\n\" +\n      \"    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \\n\" +\n      \"    // Fade out shadows that are far away \\n\" +\n      \"    float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; \\n\" +\n      \"    float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); \\n\" +\n      \"    visibility = mix(visibility, 1.0, fade); \\n\"\n    }${\n      debugCascadeColors\n        ? \"    // Draw cascade colors for debugging \\n\" +\n          \"    out_FragColor *= czm_cascadeColor(weights); \\n\"\n        : \"\"\n    }`;\n  } else {\n    fsSource +=\n      \"    float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \\n\" +\n      \"    applyNormalOffset(positionEC, normalEC, nDotL); \\n\" +\n      \"    vec4 shadowPosition = shadowMap_matrix * positionEC; \\n\" +\n      \"    // Stop early if the fragment is not in the shadow bounds \\n\" +\n      \"    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \\n\" +\n      \"    { \\n\" +\n      \"        return; \\n\" +\n      \"    } \\n\" +\n      \"    shadowParameters.texCoords = shadowPosition.xy; \\n\" +\n      \"    shadowParameters.depth = shadowPosition.z; \\n\" +\n      \"    shadowParameters.nDotL = nDotL; \\n\" +\n      \"    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \\n\";\n  }\n\n  fsSource += \"    out_FragColor.rgb *= visibility; \\n\" + \"} \\n\";\n\n  sources.push(fsSource);\n\n  return new ShaderSource({\n    defines: defines,\n    sources: sources,\n  });\n};\nexport default ShadowMapShader;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport BoxOutlineGeometry from \"../Core/BoxOutlineGeometry.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport combine from \"../Core/combine.js\";\nimport CullingVolume from \"../Core/CullingVolume.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport PerspectiveFrustum from \"../Core/PerspectiveFrustum.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport SphereOutlineGeometry from \"../Core/SphereOutlineGeometry.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport CubeMap from \"../Renderer/CubeMap.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Framebuffer from \"../Renderer/Framebuffer.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport PassState from \"../Renderer/PassState.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Renderbuffer from \"../Renderer/Renderbuffer.js\";\nimport RenderbufferFormat from \"../Renderer/RenderbufferFormat.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport Camera from \"./Camera.js\";\nimport CullFace from \"./CullFace.js\";\nimport DebugCameraPrimitive from \"./DebugCameraPrimitive.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\nimport ShadowMapShader from \"./ShadowMapShader.js\";\n\n/**\n * <div class=\"notice\">\n * Use {@link Viewer#shadowMap} to get the scene's shadow map. Do not construct this directly.\n * </div>\n *\n * <p>\n * The normalOffset bias pushes the shadows forward slightly, and may be disabled\n * for applications that require ultra precise shadows.\n * </p>\n *\n * @alias ShadowMap\n * @internalConstructor\n * @class\n *\n * @privateParam {object} options An object containing the following properties:\n * @privateParam {Context} options.context The context\n * @privateParam {Camera} options.lightCamera A camera representing the light source.\n * @privateParam {boolean} [options.enabled=true] Whether the shadow map is enabled.\n * @privateParam {boolean} [options.isPointLight=false] Whether the light source is a point light. Point light shadows do not use cascades.\n * @privateParam {number} [options.pointLightRadius=100.0] Radius of the point light.\n * @privateParam {boolean} [options.cascadesEnabled=true] Use multiple shadow maps to cover different partitions of the view frustum.\n * @privateParam {number} [options.numberOfCascades=4] The number of cascades to use for the shadow map. Supported values are one and four.\n * @privateParam {number} [options.maximumDistance=5000.0] The maximum distance used for generating cascaded shadows. Lower values improve shadow quality.\n * @privateParam {number} [options.size=2048] The width and height, in pixels, of each shadow map.\n * @privateParam {boolean} [options.softShadows=false] Whether percentage-closer-filtering is enabled for producing softer shadows.\n * @privateParam {number} [options.darkness=0.3] The shadow darkness.\n * @privateParam {boolean} [options.normalOffset=true] Whether a normal bias is applied to shadows.\n * @privateParam {boolean} [options.fadingEnabled=true] Whether shadows start to fade out once the light gets closer to the horizon.\n *\n * @exception {DeveloperError} Only one or four cascades are supported.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Shadows.html|Cesium Sandcastle Shadows Demo}\n */\nfunction ShadowMap(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const context = options.context;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(context)) {\n    throw new DeveloperError(\"context is required.\");\n  }\n  if (!defined(options.lightCamera)) {\n    throw new DeveloperError(\"lightCamera is required.\");\n  }\n  if (\n    defined(options.numberOfCascades) &&\n    options.numberOfCascades !== 1 &&\n    options.numberOfCascades !== 4\n  ) {\n    throw new DeveloperError(\"Only one or four cascades are supported.\");\n  }\n  //>>includeEnd('debug');\n\n  this._enabled = defaultValue(options.enabled, true);\n  this._softShadows = defaultValue(options.softShadows, false);\n  this._normalOffset = defaultValue(options.normalOffset, true);\n  this.dirty = true;\n\n  /**\n   * Specifies whether the shadow map originates from a light source. Shadow maps that are used for analytical\n   * purposes should set this to false so as not to affect scene rendering.\n   *\n   * @private\n   */\n  this.fromLightSource = defaultValue(options.fromLightSource, true);\n\n  /**\n   * Determines the darkness of the shadows.\n   *\n   * @type {number}\n   * @default 0.3\n   */\n  this.darkness = defaultValue(options.darkness, 0.3);\n  this._darkness = this.darkness;\n\n  /**\n   * Determines whether shadows start to fade out once the light gets closer to the horizon.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.fadingEnabled = defaultValue(options.fadingEnabled, true);\n\n  /**\n   * Determines the maximum distance of the shadow map. Only applicable for cascaded shadows. Larger distances may result in lower quality shadows.\n   *\n   * @type {number}\n   * @default 5000.0\n   */\n  this.maximumDistance = defaultValue(options.maximumDistance, 5000.0);\n\n  this._outOfView = false;\n  this._outOfViewPrevious = false;\n  this._needsUpdate = true;\n\n  // In IE11 and Edge polygon offset is not functional.\n  // TODO : Also disabled for instances of Firefox and Chrome running ANGLE that do not support depth textures.\n  // Re-enable once https://github.com/CesiumGS/cesium/issues/4560 is resolved.\n  let polygonOffsetSupported = true;\n  if (\n    FeatureDetection.isInternetExplorer() ||\n    FeatureDetection.isEdge() ||\n    ((FeatureDetection.isChrome() || FeatureDetection.isFirefox()) &&\n      FeatureDetection.isWindows() &&\n      !context.depthTexture)\n  ) {\n    polygonOffsetSupported = false;\n  }\n  this._polygonOffsetSupported = polygonOffsetSupported;\n\n  this._terrainBias = {\n    polygonOffset: polygonOffsetSupported,\n    polygonOffsetFactor: 1.1,\n    polygonOffsetUnits: 4.0,\n    normalOffset: this._normalOffset,\n    normalOffsetScale: 0.5,\n    normalShading: true,\n    normalShadingSmooth: 0.3,\n    depthBias: 0.0001,\n  };\n\n  this._primitiveBias = {\n    polygonOffset: polygonOffsetSupported,\n    polygonOffsetFactor: 1.1,\n    polygonOffsetUnits: 4.0,\n    normalOffset: this._normalOffset,\n    normalOffsetScale: 0.1,\n    normalShading: true,\n    normalShadingSmooth: 0.05,\n    depthBias: 0.00002,\n  };\n\n  this._pointBias = {\n    polygonOffset: false,\n    polygonOffsetFactor: 1.1,\n    polygonOffsetUnits: 4.0,\n    normalOffset: this._normalOffset,\n    normalOffsetScale: 0.0,\n    normalShading: true,\n    normalShadingSmooth: 0.1,\n    depthBias: 0.0005,\n  };\n\n  // Framebuffer resources\n  this._depthAttachment = undefined;\n  this._colorAttachment = undefined;\n\n  // Uniforms\n  this._shadowMapMatrix = new Matrix4();\n  this._shadowMapTexture = undefined;\n  this._lightDirectionEC = new Cartesian3();\n  this._lightPositionEC = new Cartesian4();\n  this._distance = 0.0;\n\n  this._lightCamera = options.lightCamera;\n  this._shadowMapCamera = new ShadowMapCamera();\n  this._shadowMapCullingVolume = undefined;\n  this._sceneCamera = undefined;\n  this._boundingSphere = new BoundingSphere();\n\n  this._isPointLight = defaultValue(options.isPointLight, false);\n  this._pointLightRadius = defaultValue(options.pointLightRadius, 100.0);\n\n  this._cascadesEnabled = this._isPointLight\n    ? false\n    : defaultValue(options.cascadesEnabled, true);\n  this._numberOfCascades = !this._cascadesEnabled\n    ? 0\n    : defaultValue(options.numberOfCascades, 4);\n  this._fitNearFar = true;\n  this._maximumCascadeDistances = [25.0, 150.0, 700.0, Number.MAX_VALUE];\n\n  this._textureSize = new Cartesian2();\n\n  this._isSpotLight = false;\n  if (this._cascadesEnabled) {\n    // Cascaded shadows are always orthographic. The frustum dimensions are calculated on the fly.\n    this._shadowMapCamera.frustum = new OrthographicOffCenterFrustum();\n  } else if (defined(this._lightCamera.frustum.fov)) {\n    // If the light camera uses a perspective frustum, then the light source is a spot light\n    this._isSpotLight = true;\n  }\n\n  // Uniforms\n  this._cascadeSplits = [new Cartesian4(), new Cartesian4()];\n  this._cascadeMatrices = [\n    new Matrix4(),\n    new Matrix4(),\n    new Matrix4(),\n    new Matrix4(),\n  ];\n  this._cascadeDistances = new Cartesian4();\n\n  let numberOfPasses;\n  if (this._isPointLight) {\n    numberOfPasses = 6; // One shadow map for each direction\n  } else if (!this._cascadesEnabled) {\n    numberOfPasses = 1;\n  } else {\n    numberOfPasses = this._numberOfCascades;\n  }\n\n  this._passes = new Array(numberOfPasses);\n  for (let i = 0; i < numberOfPasses; ++i) {\n    this._passes[i] = new ShadowPass(context);\n  }\n\n  this.debugShow = false;\n  this.debugFreezeFrame = false;\n  this._debugFreezeFrame = false;\n  this._debugCascadeColors = false;\n  this._debugLightFrustum = undefined;\n  this._debugCameraFrustum = undefined;\n  this._debugCascadeFrustums = new Array(this._numberOfCascades);\n  this._debugShadowViewCommand = undefined;\n\n  this._usesDepthTexture = context.depthTexture;\n\n  if (this._isPointLight) {\n    this._usesDepthTexture = false;\n  }\n\n  // Create render states for shadow casters\n  this._primitiveRenderState = undefined;\n  this._terrainRenderState = undefined;\n  this._pointRenderState = undefined;\n  createRenderStates(this);\n\n  // For clearing the shadow map texture every frame\n  this._clearCommand = new ClearCommand({\n    depth: 1.0,\n    color: new Color(),\n  });\n\n  this._clearPassState = new PassState(context);\n\n  this._size = defaultValue(options.size, 2048);\n  this.size = this._size;\n}\n\n/**\n * Global maximum shadow distance used to prevent far off receivers from extending\n * the shadow far plane. This helps set a tighter near/far when viewing objects from space.\n *\n * @private\n */\nShadowMap.MAXIMUM_DISTANCE = 20000.0;\n\nfunction ShadowPass(context) {\n  this.camera = new ShadowMapCamera();\n  this.passState = new PassState(context);\n  this.framebuffer = undefined;\n  this.textureOffsets = undefined;\n  this.commandList = [];\n  this.cullingVolume = undefined;\n}\n\nfunction createRenderState(colorMask, bias) {\n  return RenderState.fromCache({\n    cull: {\n      enabled: true,\n      face: CullFace.BACK,\n    },\n    depthTest: {\n      enabled: true,\n    },\n    colorMask: {\n      red: colorMask,\n      green: colorMask,\n      blue: colorMask,\n      alpha: colorMask,\n    },\n    depthMask: true,\n    polygonOffset: {\n      enabled: bias.polygonOffset,\n      factor: bias.polygonOffsetFactor,\n      units: bias.polygonOffsetUnits,\n    },\n  });\n}\n\nfunction createRenderStates(shadowMap) {\n  // Enable the color mask if the shadow map is backed by a color texture, e.g. when depth textures aren't supported\n  const colorMask = !shadowMap._usesDepthTexture;\n  shadowMap._primitiveRenderState = createRenderState(\n    colorMask,\n    shadowMap._primitiveBias\n  );\n  shadowMap._terrainRenderState = createRenderState(\n    colorMask,\n    shadowMap._terrainBias\n  );\n  shadowMap._pointRenderState = createRenderState(\n    colorMask,\n    shadowMap._pointBias\n  );\n}\n\n/**\n * @private\n */\nShadowMap.prototype.debugCreateRenderStates = function () {\n  createRenderStates(this);\n};\n\nObject.defineProperties(ShadowMap.prototype, {\n  /**\n   * Determines if the shadow map will be shown.\n   *\n   * @memberof ShadowMap.prototype\n   * @type {boolean}\n   * @default true\n   */\n  enabled: {\n    get: function () {\n      return this._enabled;\n    },\n    set: function (value) {\n      this.dirty = this._enabled !== value;\n      this._enabled = value;\n    },\n  },\n\n  /**\n   * Determines if a normal bias will be applied to shadows.\n   *\n   * @memberof ShadowMap.prototype\n   * @type {boolean}\n   * @default true\n   */\n  normalOffset: {\n    get: function () {\n      return this._normalOffset;\n    },\n    set: function (value) {\n      this.dirty = this._normalOffset !== value;\n      this._normalOffset = value;\n      this._terrainBias.normalOffset = value;\n      this._primitiveBias.normalOffset = value;\n      this._pointBias.normalOffset = value;\n    },\n  },\n\n  /**\n   * Determines if soft shadows are enabled. Uses pcf filtering which requires more texture reads and may hurt performance.\n   *\n   * @memberof ShadowMap.prototype\n   * @type {boolean}\n   * @default false\n   */\n  softShadows: {\n    get: function () {\n      return this._softShadows;\n    },\n    set: function (value) {\n      this.dirty = this._softShadows !== value;\n      this._softShadows = value;\n    },\n  },\n\n  /**\n   * The width and height, in pixels, of each shadow map.\n   *\n   * @memberof ShadowMap.prototype\n   * @type {number}\n   * @default 2048\n   */\n  size: {\n    get: function () {\n      return this._size;\n    },\n    set: function (value) {\n      resize(this, value);\n    },\n  },\n\n  /**\n   * Whether the shadow map is out of view of the scene camera.\n   *\n   * @memberof ShadowMap.prototype\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  outOfView: {\n    get: function () {\n      return this._outOfView;\n    },\n  },\n\n  /**\n   * The culling volume of the shadow frustum.\n   *\n   * @memberof ShadowMap.prototype\n   * @type {CullingVolume}\n   * @readonly\n   * @private\n   */\n  shadowMapCullingVolume: {\n    get: function () {\n      return this._shadowMapCullingVolume;\n    },\n  },\n\n  /**\n   * The passes used for rendering shadows. Each face of a point light or each cascade for a cascaded shadow map is a separate pass.\n   *\n   * @memberof ShadowMap.prototype\n   * @type {ShadowPass[]}\n   * @readonly\n   * @private\n   */\n  passes: {\n    get: function () {\n      return this._passes;\n    },\n  },\n\n  /**\n   * Whether the light source is a point light.\n   *\n   * @memberof ShadowMap.prototype\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  isPointLight: {\n    get: function () {\n      return this._isPointLight;\n    },\n  },\n\n  /**\n   * Debug option for visualizing the cascades by color.\n   *\n   * @memberof ShadowMap.prototype\n   * @type {boolean}\n   * @default false\n   * @private\n   */\n  debugCascadeColors: {\n    get: function () {\n      return this._debugCascadeColors;\n    },\n    set: function (value) {\n      this.dirty = this._debugCascadeColors !== value;\n      this._debugCascadeColors = value;\n    },\n  },\n});\n\nfunction destroyFramebuffer(shadowMap) {\n  const length = shadowMap._passes.length;\n  for (let i = 0; i < length; ++i) {\n    const pass = shadowMap._passes[i];\n    const framebuffer = pass.framebuffer;\n    if (defined(framebuffer) && !framebuffer.isDestroyed()) {\n      framebuffer.destroy();\n    }\n    pass.framebuffer = undefined;\n  }\n\n  // Destroy the framebuffer attachments\n  shadowMap._depthAttachment =\n    shadowMap._depthAttachment && shadowMap._depthAttachment.destroy();\n  shadowMap._colorAttachment =\n    shadowMap._colorAttachment && shadowMap._colorAttachment.destroy();\n}\n\nfunction createFramebufferColor(shadowMap, context) {\n  const depthRenderbuffer = new Renderbuffer({\n    context: context,\n    width: shadowMap._textureSize.x,\n    height: shadowMap._textureSize.y,\n    format: RenderbufferFormat.DEPTH_COMPONENT16,\n  });\n\n  const colorTexture = new Texture({\n    context: context,\n    width: shadowMap._textureSize.x,\n    height: shadowMap._textureSize.y,\n    pixelFormat: PixelFormat.RGBA,\n    pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n    sampler: Sampler.NEAREST,\n  });\n\n  const framebuffer = new Framebuffer({\n    context: context,\n    depthRenderbuffer: depthRenderbuffer,\n    colorTextures: [colorTexture],\n    destroyAttachments: false,\n  });\n\n  const length = shadowMap._passes.length;\n  for (let i = 0; i < length; ++i) {\n    const pass = shadowMap._passes[i];\n    pass.framebuffer = framebuffer;\n    pass.passState.framebuffer = framebuffer;\n  }\n\n  shadowMap._shadowMapTexture = colorTexture;\n  shadowMap._depthAttachment = depthRenderbuffer;\n  shadowMap._colorAttachment = colorTexture;\n}\n\nfunction createFramebufferDepth(shadowMap, context) {\n  const depthStencilTexture = new Texture({\n    context: context,\n    width: shadowMap._textureSize.x,\n    height: shadowMap._textureSize.y,\n    pixelFormat: PixelFormat.DEPTH_STENCIL,\n    pixelDatatype: PixelDatatype.UNSIGNED_INT_24_8,\n    sampler: Sampler.NEAREST,\n  });\n\n  const framebuffer = new Framebuffer({\n    context: context,\n    depthStencilTexture: depthStencilTexture,\n    destroyAttachments: false,\n  });\n\n  const length = shadowMap._passes.length;\n  for (let i = 0; i < length; ++i) {\n    const pass = shadowMap._passes[i];\n    pass.framebuffer = framebuffer;\n    pass.passState.framebuffer = framebuffer;\n  }\n\n  shadowMap._shadowMapTexture = depthStencilTexture;\n  shadowMap._depthAttachment = depthStencilTexture;\n}\n\nfunction createFramebufferCube(shadowMap, context) {\n  const depthRenderbuffer = new Renderbuffer({\n    context: context,\n    width: shadowMap._textureSize.x,\n    height: shadowMap._textureSize.y,\n    format: RenderbufferFormat.DEPTH_COMPONENT16,\n  });\n\n  const cubeMap = new CubeMap({\n    context: context,\n    width: shadowMap._textureSize.x,\n    height: shadowMap._textureSize.y,\n    pixelFormat: PixelFormat.RGBA,\n    pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n    sampler: Sampler.NEAREST,\n  });\n\n  const faces = [\n    cubeMap.negativeX,\n    cubeMap.negativeY,\n    cubeMap.negativeZ,\n    cubeMap.positiveX,\n    cubeMap.positiveY,\n    cubeMap.positiveZ,\n  ];\n\n  for (let i = 0; i < 6; ++i) {\n    const framebuffer = new Framebuffer({\n      context: context,\n      depthRenderbuffer: depthRenderbuffer,\n      colorTextures: [faces[i]],\n      destroyAttachments: false,\n    });\n    const pass = shadowMap._passes[i];\n    pass.framebuffer = framebuffer;\n    pass.passState.framebuffer = framebuffer;\n  }\n\n  shadowMap._shadowMapTexture = cubeMap;\n  shadowMap._depthAttachment = depthRenderbuffer;\n  shadowMap._colorAttachment = cubeMap;\n}\n\nfunction createFramebuffer(shadowMap, context) {\n  if (shadowMap._isPointLight) {\n    createFramebufferCube(shadowMap, context);\n  } else if (shadowMap._usesDepthTexture) {\n    createFramebufferDepth(shadowMap, context);\n  } else {\n    createFramebufferColor(shadowMap, context);\n  }\n}\n\nfunction checkFramebuffer(shadowMap, context) {\n  // Attempt to make an FBO with only a depth texture. If it fails, fallback to a color texture.\n  if (\n    shadowMap._usesDepthTexture &&\n    shadowMap._passes[0].framebuffer.status !==\n      WebGLConstants.FRAMEBUFFER_COMPLETE\n  ) {\n    shadowMap._usesDepthTexture = false;\n    createRenderStates(shadowMap);\n    destroyFramebuffer(shadowMap);\n    createFramebuffer(shadowMap, context);\n  }\n}\n\nfunction updateFramebuffer(shadowMap, context) {\n  if (\n    !defined(shadowMap._passes[0].framebuffer) ||\n    shadowMap._shadowMapTexture.width !== shadowMap._textureSize.x\n  ) {\n    destroyFramebuffer(shadowMap);\n    createFramebuffer(shadowMap, context);\n    checkFramebuffer(shadowMap, context);\n    clearFramebuffer(shadowMap, context);\n  }\n}\n\nfunction clearFramebuffer(shadowMap, context, shadowPass) {\n  shadowPass = defaultValue(shadowPass, 0);\n  if (shadowMap._isPointLight || shadowPass === 0) {\n    shadowMap._clearCommand.framebuffer =\n      shadowMap._passes[shadowPass].framebuffer;\n    shadowMap._clearCommand.execute(context, shadowMap._clearPassState);\n  }\n}\n\nfunction resize(shadowMap, size) {\n  shadowMap._size = size;\n  const passes = shadowMap._passes;\n  const numberOfPasses = passes.length;\n  const textureSize = shadowMap._textureSize;\n\n  if (shadowMap._isPointLight) {\n    size =\n      ContextLimits.maximumCubeMapSize >= size\n        ? size\n        : ContextLimits.maximumCubeMapSize;\n    textureSize.x = size;\n    textureSize.y = size;\n    const faceViewport = new BoundingRectangle(0, 0, size, size);\n    passes[0].passState.viewport = faceViewport;\n    passes[1].passState.viewport = faceViewport;\n    passes[2].passState.viewport = faceViewport;\n    passes[3].passState.viewport = faceViewport;\n    passes[4].passState.viewport = faceViewport;\n    passes[5].passState.viewport = faceViewport;\n  } else if (numberOfPasses === 1) {\n    // +----+\n    // |  1 |\n    // +----+\n    size =\n      ContextLimits.maximumTextureSize >= size\n        ? size\n        : ContextLimits.maximumTextureSize;\n    textureSize.x = size;\n    textureSize.y = size;\n    passes[0].passState.viewport = new BoundingRectangle(0, 0, size, size);\n  } else if (numberOfPasses === 4) {\n    // +----+----+\n    // |  3 |  4 |\n    // +----+----+\n    // |  1 |  2 |\n    // +----+----+\n    size =\n      ContextLimits.maximumTextureSize >= size * 2\n        ? size\n        : ContextLimits.maximumTextureSize / 2;\n    textureSize.x = size * 2;\n    textureSize.y = size * 2;\n    passes[0].passState.viewport = new BoundingRectangle(0, 0, size, size);\n    passes[1].passState.viewport = new BoundingRectangle(size, 0, size, size);\n    passes[2].passState.viewport = new BoundingRectangle(0, size, size, size);\n    passes[3].passState.viewport = new BoundingRectangle(\n      size,\n      size,\n      size,\n      size\n    );\n  }\n\n  // Update clear pass state\n  shadowMap._clearPassState.viewport = new BoundingRectangle(\n    0,\n    0,\n    textureSize.x,\n    textureSize.y\n  );\n\n  // Transforms shadow coordinates [0, 1] into the pass's region of the texture\n  for (let i = 0; i < numberOfPasses; ++i) {\n    const pass = passes[i];\n    const viewport = pass.passState.viewport;\n    const biasX = viewport.x / textureSize.x;\n    const biasY = viewport.y / textureSize.y;\n    const scaleX = viewport.width / textureSize.x;\n    const scaleY = viewport.height / textureSize.y;\n    pass.textureOffsets = new Matrix4(\n      scaleX,\n      0.0,\n      0.0,\n      biasX,\n      0.0,\n      scaleY,\n      0.0,\n      biasY,\n      0.0,\n      0.0,\n      1.0,\n      0.0,\n      0.0,\n      0.0,\n      0.0,\n      1.0\n    );\n  }\n}\n\nconst scratchViewport = new BoundingRectangle();\n\nfunction createDebugShadowViewCommand(shadowMap, context) {\n  let fs;\n  if (shadowMap._isPointLight) {\n    fs =\n      \"uniform samplerCube shadowMap_textureCube; \\n\" +\n      \"in vec2 v_textureCoordinates; \\n\" +\n      \"void main() \\n\" +\n      \"{ \\n\" +\n      \"    vec2 uv = v_textureCoordinates; \\n\" +\n      \"    vec3 dir; \\n\" +\n      \" \\n\" +\n      \"    if (uv.y < 0.5) \\n\" +\n      \"    { \\n\" +\n      \"        if (uv.x < 0.333) \\n\" +\n      \"        { \\n\" +\n      \"            dir.x = -1.0; \\n\" +\n      \"            dir.y = uv.x * 6.0 - 1.0; \\n\" +\n      \"            dir.z = uv.y * 4.0 - 1.0; \\n\" +\n      \"        } \\n\" +\n      \"        else if (uv.x < 0.666) \\n\" +\n      \"        { \\n\" +\n      \"            dir.y = -1.0; \\n\" +\n      \"            dir.x = uv.x * 6.0 - 3.0; \\n\" +\n      \"            dir.z = uv.y * 4.0 - 1.0; \\n\" +\n      \"        } \\n\" +\n      \"        else \\n\" +\n      \"        { \\n\" +\n      \"            dir.z = -1.0; \\n\" +\n      \"            dir.x = uv.x * 6.0 - 5.0; \\n\" +\n      \"            dir.y = uv.y * 4.0 - 1.0; \\n\" +\n      \"        } \\n\" +\n      \"    } \\n\" +\n      \"    else \\n\" +\n      \"    { \\n\" +\n      \"        if (uv.x < 0.333) \\n\" +\n      \"        { \\n\" +\n      \"            dir.x = 1.0; \\n\" +\n      \"            dir.y = uv.x * 6.0 - 1.0; \\n\" +\n      \"            dir.z = uv.y * 4.0 - 3.0; \\n\" +\n      \"        } \\n\" +\n      \"        else if (uv.x < 0.666) \\n\" +\n      \"        { \\n\" +\n      \"            dir.y = 1.0; \\n\" +\n      \"            dir.x = uv.x * 6.0 - 3.0; \\n\" +\n      \"            dir.z = uv.y * 4.0 - 3.0; \\n\" +\n      \"        } \\n\" +\n      \"        else \\n\" +\n      \"        { \\n\" +\n      \"            dir.z = 1.0; \\n\" +\n      \"            dir.x = uv.x * 6.0 - 5.0; \\n\" +\n      \"            dir.y = uv.y * 4.0 - 3.0; \\n\" +\n      \"        } \\n\" +\n      \"    } \\n\" +\n      \" \\n\" +\n      \"    float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir)); \\n\" +\n      \"    out_FragColor = vec4(vec3(shadow), 1.0); \\n\" +\n      \"} \\n\";\n  } else {\n    fs =\n      `${\n        \"uniform sampler2D shadowMap_texture; \\n\" +\n        \"in vec2 v_textureCoordinates; \\n\" +\n        \"void main() \\n\" +\n        \"{ \\n\"\n      }${\n        shadowMap._usesDepthTexture\n          ? \"    float shadow = texture(shadowMap_texture, v_textureCoordinates).r; \\n\"\n          : \"    float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); \\n\"\n      }    out_FragColor = vec4(vec3(shadow), 1.0); \\n` + `} \\n`;\n  }\n\n  const drawCommand = context.createViewportQuadCommand(fs, {\n    uniformMap: {\n      shadowMap_texture: function () {\n        return shadowMap._shadowMapTexture;\n      },\n      shadowMap_textureCube: function () {\n        return shadowMap._shadowMapTexture;\n      },\n    },\n  });\n  drawCommand.pass = Pass.OVERLAY;\n  return drawCommand;\n}\n\nfunction updateDebugShadowViewCommand(shadowMap, frameState) {\n  // Draws the shadow map on the bottom-right corner of the screen\n  const context = frameState.context;\n  const screenWidth = frameState.context.drawingBufferWidth;\n  const screenHeight = frameState.context.drawingBufferHeight;\n  const size = Math.min(screenWidth, screenHeight) * 0.3;\n\n  const viewport = scratchViewport;\n  viewport.x = screenWidth - size;\n  viewport.y = 0;\n  viewport.width = size;\n  viewport.height = size;\n\n  let debugCommand = shadowMap._debugShadowViewCommand;\n  if (!defined(debugCommand)) {\n    debugCommand = createDebugShadowViewCommand(shadowMap, context);\n    shadowMap._debugShadowViewCommand = debugCommand;\n  }\n\n  // Get a new RenderState for the updated viewport size\n  if (\n    !defined(debugCommand.renderState) ||\n    !BoundingRectangle.equals(debugCommand.renderState.viewport, viewport)\n  ) {\n    debugCommand.renderState = RenderState.fromCache({\n      viewport: BoundingRectangle.clone(viewport),\n    });\n  }\n\n  frameState.commandList.push(shadowMap._debugShadowViewCommand);\n}\n\nconst frustumCornersNDC = new Array(8);\nfrustumCornersNDC[0] = new Cartesian4(-1.0, -1.0, -1.0, 1.0);\nfrustumCornersNDC[1] = new Cartesian4(1.0, -1.0, -1.0, 1.0);\nfrustumCornersNDC[2] = new Cartesian4(1.0, 1.0, -1.0, 1.0);\nfrustumCornersNDC[3] = new Cartesian4(-1.0, 1.0, -1.0, 1.0);\nfrustumCornersNDC[4] = new Cartesian4(-1.0, -1.0, 1.0, 1.0);\nfrustumCornersNDC[5] = new Cartesian4(1.0, -1.0, 1.0, 1.0);\nfrustumCornersNDC[6] = new Cartesian4(1.0, 1.0, 1.0, 1.0);\nfrustumCornersNDC[7] = new Cartesian4(-1.0, 1.0, 1.0, 1.0);\n\nconst scratchMatrix = new Matrix4();\nconst scratchFrustumCorners = new Array(8);\nfor (let i = 0; i < 8; ++i) {\n  scratchFrustumCorners[i] = new Cartesian4();\n}\n\nfunction createDebugPointLight(modelMatrix, color) {\n  const box = new GeometryInstance({\n    geometry: new BoxOutlineGeometry({\n      minimum: new Cartesian3(-0.5, -0.5, -0.5),\n      maximum: new Cartesian3(0.5, 0.5, 0.5),\n    }),\n    attributes: {\n      color: ColorGeometryInstanceAttribute.fromColor(color),\n    },\n  });\n\n  const sphere = new GeometryInstance({\n    geometry: new SphereOutlineGeometry({\n      radius: 0.5,\n    }),\n    attributes: {\n      color: ColorGeometryInstanceAttribute.fromColor(color),\n    },\n  });\n\n  return new Primitive({\n    geometryInstances: [box, sphere],\n    appearance: new PerInstanceColorAppearance({\n      translucent: false,\n      flat: true,\n    }),\n    asynchronous: false,\n    modelMatrix: modelMatrix,\n  });\n}\n\nconst debugOutlineColors = [Color.RED, Color.GREEN, Color.BLUE, Color.MAGENTA];\nconst scratchScale = new Cartesian3();\n\nfunction applyDebugSettings(shadowMap, frameState) {\n  updateDebugShadowViewCommand(shadowMap, frameState);\n\n  const enterFreezeFrame =\n    shadowMap.debugFreezeFrame && !shadowMap._debugFreezeFrame;\n  shadowMap._debugFreezeFrame = shadowMap.debugFreezeFrame;\n\n  // Draw scene camera in freeze frame mode\n  if (shadowMap.debugFreezeFrame) {\n    if (enterFreezeFrame) {\n      // Recreate debug camera when entering freeze frame mode\n      shadowMap._debugCameraFrustum =\n        shadowMap._debugCameraFrustum &&\n        shadowMap._debugCameraFrustum.destroy();\n      shadowMap._debugCameraFrustum = new DebugCameraPrimitive({\n        camera: shadowMap._sceneCamera,\n        color: Color.CYAN,\n        updateOnChange: false,\n      });\n    }\n    shadowMap._debugCameraFrustum.update(frameState);\n  }\n\n  if (shadowMap._cascadesEnabled) {\n    // Draw cascades only in freeze frame mode\n    if (shadowMap.debugFreezeFrame) {\n      if (enterFreezeFrame) {\n        // Recreate debug frustum when entering freeze frame mode\n        shadowMap._debugLightFrustum =\n          shadowMap._debugLightFrustum &&\n          shadowMap._debugLightFrustum.destroy();\n        shadowMap._debugLightFrustum = new DebugCameraPrimitive({\n          camera: shadowMap._shadowMapCamera,\n          color: Color.YELLOW,\n          updateOnChange: false,\n        });\n      }\n      shadowMap._debugLightFrustum.update(frameState);\n\n      for (let i = 0; i < shadowMap._numberOfCascades; ++i) {\n        if (enterFreezeFrame) {\n          // Recreate debug frustum when entering freeze frame mode\n          shadowMap._debugCascadeFrustums[i] =\n            shadowMap._debugCascadeFrustums[i] &&\n            shadowMap._debugCascadeFrustums[i].destroy();\n          shadowMap._debugCascadeFrustums[i] = new DebugCameraPrimitive({\n            camera: shadowMap._passes[i].camera,\n            color: debugOutlineColors[i],\n            updateOnChange: false,\n          });\n        }\n        shadowMap._debugCascadeFrustums[i].update(frameState);\n      }\n    }\n  } else if (shadowMap._isPointLight) {\n    if (!defined(shadowMap._debugLightFrustum) || shadowMap._needsUpdate) {\n      const translation = shadowMap._shadowMapCamera.positionWC;\n      const rotation = Quaternion.IDENTITY;\n      const uniformScale = shadowMap._pointLightRadius * 2.0;\n      const scale = Cartesian3.fromElements(\n        uniformScale,\n        uniformScale,\n        uniformScale,\n        scratchScale\n      );\n      const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale(\n        translation,\n        rotation,\n        scale,\n        scratchMatrix\n      );\n\n      shadowMap._debugLightFrustum =\n        shadowMap._debugLightFrustum && shadowMap._debugLightFrustum.destroy();\n      shadowMap._debugLightFrustum = createDebugPointLight(\n        modelMatrix,\n        Color.YELLOW\n      );\n    }\n    shadowMap._debugLightFrustum.update(frameState);\n  } else {\n    if (!defined(shadowMap._debugLightFrustum) || shadowMap._needsUpdate) {\n      shadowMap._debugLightFrustum = new DebugCameraPrimitive({\n        camera: shadowMap._shadowMapCamera,\n        color: Color.YELLOW,\n        updateOnChange: false,\n      });\n    }\n    shadowMap._debugLightFrustum.update(frameState);\n  }\n}\n\nfunction ShadowMapCamera() {\n  this.viewMatrix = new Matrix4();\n  this.inverseViewMatrix = new Matrix4();\n  this.frustum = undefined;\n  this.positionCartographic = new Cartographic();\n  this.positionWC = new Cartesian3();\n  this.directionWC = Cartesian3.clone(Cartesian3.UNIT_Z);\n  this.upWC = Cartesian3.clone(Cartesian3.UNIT_Y);\n  this.rightWC = Cartesian3.clone(Cartesian3.UNIT_X);\n  this.viewProjectionMatrix = new Matrix4();\n}\n\nShadowMapCamera.prototype.clone = function (camera) {\n  Matrix4.clone(camera.viewMatrix, this.viewMatrix);\n  Matrix4.clone(camera.inverseViewMatrix, this.inverseViewMatrix);\n  this.frustum = camera.frustum.clone(this.frustum);\n  Cartographic.clone(camera.positionCartographic, this.positionCartographic);\n  Cartesian3.clone(camera.positionWC, this.positionWC);\n  Cartesian3.clone(camera.directionWC, this.directionWC);\n  Cartesian3.clone(camera.upWC, this.upWC);\n  Cartesian3.clone(camera.rightWC, this.rightWC);\n};\n\n// Converts from NDC space to texture space\nconst scaleBiasMatrix = new Matrix4(\n  0.5,\n  0.0,\n  0.0,\n  0.5,\n  0.0,\n  0.5,\n  0.0,\n  0.5,\n  0.0,\n  0.0,\n  0.5,\n  0.5,\n  0.0,\n  0.0,\n  0.0,\n  1.0\n);\n\nShadowMapCamera.prototype.getViewProjection = function () {\n  const view = this.viewMatrix;\n  const projection = this.frustum.projectionMatrix;\n  Matrix4.multiply(projection, view, this.viewProjectionMatrix);\n  Matrix4.multiply(\n    scaleBiasMatrix,\n    this.viewProjectionMatrix,\n    this.viewProjectionMatrix\n  );\n  return this.viewProjectionMatrix;\n};\n\nconst scratchSplits = new Array(5);\nconst scratchFrustum = new PerspectiveFrustum();\nconst scratchCascadeDistances = new Array(4);\nconst scratchMin = new Cartesian3();\nconst scratchMax = new Cartesian3();\n\nfunction computeCascades(shadowMap, frameState) {\n  const shadowMapCamera = shadowMap._shadowMapCamera;\n  const sceneCamera = shadowMap._sceneCamera;\n  const cameraNear = sceneCamera.frustum.near;\n  const cameraFar = sceneCamera.frustum.far;\n  const numberOfCascades = shadowMap._numberOfCascades;\n\n  // Split cascades. Use a mix of linear and log splits.\n  let i;\n  const range = cameraFar - cameraNear;\n  const ratio = cameraFar / cameraNear;\n\n  let lambda = 0.9;\n  let clampCascadeDistances = false;\n\n  // When the camera is close to a relatively small model, provide more detail in the closer cascades.\n  // If the camera is near or inside a large model, such as the root tile of a city, then use the default values.\n  // To get the most accurate cascade splits we would need to find the min and max values from the depth texture.\n  if (frameState.shadowState.closestObjectSize < 200.0) {\n    clampCascadeDistances = true;\n    lambda = 0.9;\n  }\n\n  const cascadeDistances = scratchCascadeDistances;\n  const splits = scratchSplits;\n  splits[0] = cameraNear;\n  splits[numberOfCascades] = cameraFar;\n\n  // Find initial splits\n  for (i = 0; i < numberOfCascades; ++i) {\n    const p = (i + 1) / numberOfCascades;\n    const logScale = cameraNear * Math.pow(ratio, p);\n    const uniformScale = cameraNear + range * p;\n    const split = CesiumMath.lerp(uniformScale, logScale, lambda);\n    splits[i + 1] = split;\n    cascadeDistances[i] = split - splits[i];\n  }\n\n  if (clampCascadeDistances) {\n    // Clamp each cascade to its maximum distance\n    for (i = 0; i < numberOfCascades; ++i) {\n      cascadeDistances[i] = Math.min(\n        cascadeDistances[i],\n        shadowMap._maximumCascadeDistances[i]\n      );\n    }\n\n    // Recompute splits\n    let distance = splits[0];\n    for (i = 0; i < numberOfCascades - 1; ++i) {\n      distance += cascadeDistances[i];\n      splits[i + 1] = distance;\n    }\n  }\n\n  Cartesian4.unpack(splits, 0, shadowMap._cascadeSplits[0]);\n  Cartesian4.unpack(splits, 1, shadowMap._cascadeSplits[1]);\n  Cartesian4.unpack(cascadeDistances, 0, shadowMap._cascadeDistances);\n\n  const shadowFrustum = shadowMapCamera.frustum;\n  const left = shadowFrustum.left;\n  const right = shadowFrustum.right;\n  const bottom = shadowFrustum.bottom;\n  const top = shadowFrustum.top;\n  const near = shadowFrustum.near;\n  const far = shadowFrustum.far;\n\n  const position = shadowMapCamera.positionWC;\n  const direction = shadowMapCamera.directionWC;\n  const up = shadowMapCamera.upWC;\n\n  const cascadeSubFrustum = sceneCamera.frustum.clone(scratchFrustum);\n  const shadowViewProjection = shadowMapCamera.getViewProjection();\n\n  for (i = 0; i < numberOfCascades; ++i) {\n    // Find the bounding box of the camera sub-frustum in shadow map texture space\n    cascadeSubFrustum.near = splits[i];\n    cascadeSubFrustum.far = splits[i + 1];\n    const viewProjection = Matrix4.multiply(\n      cascadeSubFrustum.projectionMatrix,\n      sceneCamera.viewMatrix,\n      scratchMatrix\n    );\n    const inverseViewProjection = Matrix4.inverse(\n      viewProjection,\n      scratchMatrix\n    );\n    const shadowMapMatrix = Matrix4.multiply(\n      shadowViewProjection,\n      inverseViewProjection,\n      scratchMatrix\n    );\n\n    // Project each corner from camera NDC space to shadow map texture space. Min and max will be from 0 to 1.\n    const min = Cartesian3.fromElements(\n      Number.MAX_VALUE,\n      Number.MAX_VALUE,\n      Number.MAX_VALUE,\n      scratchMin\n    );\n    const max = Cartesian3.fromElements(\n      -Number.MAX_VALUE,\n      -Number.MAX_VALUE,\n      -Number.MAX_VALUE,\n      scratchMax\n    );\n\n    for (let k = 0; k < 8; ++k) {\n      const corner = Cartesian4.clone(\n        frustumCornersNDC[k],\n        scratchFrustumCorners[k]\n      );\n      Matrix4.multiplyByVector(shadowMapMatrix, corner, corner);\n      Cartesian3.divideByScalar(corner, corner.w, corner); // Handle the perspective divide\n      Cartesian3.minimumByComponent(corner, min, min);\n      Cartesian3.maximumByComponent(corner, max, max);\n    }\n\n    // Limit light-space coordinates to the [0, 1] range\n    min.x = Math.max(min.x, 0.0);\n    min.y = Math.max(min.y, 0.0);\n    min.z = 0.0; // Always start cascade frustum at the top of the light frustum to capture objects in the light's path\n    max.x = Math.min(max.x, 1.0);\n    max.y = Math.min(max.y, 1.0);\n    max.z = Math.min(max.z, 1.0);\n\n    const pass = shadowMap._passes[i];\n    const cascadeCamera = pass.camera;\n    cascadeCamera.clone(shadowMapCamera); // PERFORMANCE_IDEA : could do a shallow clone for all properties except the frustum\n\n    const frustum = cascadeCamera.frustum;\n    frustum.left = left + min.x * (right - left);\n    frustum.right = left + max.x * (right - left);\n    frustum.bottom = bottom + min.y * (top - bottom);\n    frustum.top = bottom + max.y * (top - bottom);\n    frustum.near = near + min.z * (far - near);\n    frustum.far = near + max.z * (far - near);\n\n    pass.cullingVolume = cascadeCamera.frustum.computeCullingVolume(\n      position,\n      direction,\n      up\n    );\n\n    // Transforms from eye space to the cascade's texture space\n    const cascadeMatrix = shadowMap._cascadeMatrices[i];\n    Matrix4.multiply(\n      cascadeCamera.getViewProjection(),\n      sceneCamera.inverseViewMatrix,\n      cascadeMatrix\n    );\n    Matrix4.multiply(pass.textureOffsets, cascadeMatrix, cascadeMatrix);\n  }\n}\n\nconst scratchLightView = new Matrix4();\nconst scratchRight = new Cartesian3();\nconst scratchUp = new Cartesian3();\nconst scratchTranslation = new Cartesian3();\n\nfunction fitShadowMapToScene(shadowMap, frameState) {\n  const shadowMapCamera = shadowMap._shadowMapCamera;\n  const sceneCamera = shadowMap._sceneCamera;\n\n  // 1. First find a tight bounding box in light space that contains the entire camera frustum.\n  const viewProjection = Matrix4.multiply(\n    sceneCamera.frustum.projectionMatrix,\n    sceneCamera.viewMatrix,\n    scratchMatrix\n  );\n  const inverseViewProjection = Matrix4.inverse(viewProjection, scratchMatrix);\n\n  // Start to construct the light view matrix. Set translation later once the bounding box is found.\n  const lightDir = shadowMapCamera.directionWC;\n  let lightUp = sceneCamera.directionWC; // Align shadows to the camera view.\n  if (Cartesian3.equalsEpsilon(lightDir, lightUp, CesiumMath.EPSILON10)) {\n    lightUp = sceneCamera.upWC;\n  }\n  const lightRight = Cartesian3.cross(lightDir, lightUp, scratchRight);\n  lightUp = Cartesian3.cross(lightRight, lightDir, scratchUp); // Recalculate up now that right is derived\n  Cartesian3.normalize(lightUp, lightUp);\n  Cartesian3.normalize(lightRight, lightRight);\n  const lightPosition = Cartesian3.fromElements(\n    0.0,\n    0.0,\n    0.0,\n    scratchTranslation\n  );\n\n  let lightView = Matrix4.computeView(\n    lightPosition,\n    lightDir,\n    lightUp,\n    lightRight,\n    scratchLightView\n  );\n  const cameraToLight = Matrix4.multiply(\n    lightView,\n    inverseViewProjection,\n    scratchMatrix\n  );\n\n  // Project each corner from NDC space to light view space, and calculate a min and max in light view space\n  const min = Cartesian3.fromElements(\n    Number.MAX_VALUE,\n    Number.MAX_VALUE,\n    Number.MAX_VALUE,\n    scratchMin\n  );\n  const max = Cartesian3.fromElements(\n    -Number.MAX_VALUE,\n    -Number.MAX_VALUE,\n    -Number.MAX_VALUE,\n    scratchMax\n  );\n\n  for (let i = 0; i < 8; ++i) {\n    const corner = Cartesian4.clone(\n      frustumCornersNDC[i],\n      scratchFrustumCorners[i]\n    );\n    Matrix4.multiplyByVector(cameraToLight, corner, corner);\n    Cartesian3.divideByScalar(corner, corner.w, corner); // Handle the perspective divide\n    Cartesian3.minimumByComponent(corner, min, min);\n    Cartesian3.maximumByComponent(corner, max, max);\n  }\n\n  // 2. Set bounding box back to include objects in the light's view\n  max.z += 1000.0; // Note: in light space, a positive number is behind the camera\n  min.z -= 10.0; // Extend the shadow volume forward slightly to avoid problems right at the edge\n\n  // 3. Adjust light view matrix so that it is centered on the bounding volume\n  const translation = scratchTranslation;\n  translation.x = -(0.5 * (min.x + max.x));\n  translation.y = -(0.5 * (min.y + max.y));\n  translation.z = -max.z;\n\n  const translationMatrix = Matrix4.fromTranslation(translation, scratchMatrix);\n  lightView = Matrix4.multiply(translationMatrix, lightView, lightView);\n\n  // 4. Create an orthographic frustum that covers the bounding box extents\n  const halfWidth = 0.5 * (max.x - min.x);\n  const halfHeight = 0.5 * (max.y - min.y);\n  const depth = max.z - min.z;\n\n  const frustum = shadowMapCamera.frustum;\n  frustum.left = -halfWidth;\n  frustum.right = halfWidth;\n  frustum.bottom = -halfHeight;\n  frustum.top = halfHeight;\n  frustum.near = 0.01;\n  frustum.far = depth;\n\n  // 5. Update the shadow map camera\n  Matrix4.clone(lightView, shadowMapCamera.viewMatrix);\n  Matrix4.inverse(lightView, shadowMapCamera.inverseViewMatrix);\n  Matrix4.getTranslation(\n    shadowMapCamera.inverseViewMatrix,\n    shadowMapCamera.positionWC\n  );\n  frameState.mapProjection.ellipsoid.cartesianToCartographic(\n    shadowMapCamera.positionWC,\n    shadowMapCamera.positionCartographic\n  );\n  Cartesian3.clone(lightDir, shadowMapCamera.directionWC);\n  Cartesian3.clone(lightUp, shadowMapCamera.upWC);\n  Cartesian3.clone(lightRight, shadowMapCamera.rightWC);\n}\n\nconst directions = [\n  new Cartesian3(-1.0, 0.0, 0.0),\n  new Cartesian3(0.0, -1.0, 0.0),\n  new Cartesian3(0.0, 0.0, -1.0),\n  new Cartesian3(1.0, 0.0, 0.0),\n  new Cartesian3(0.0, 1.0, 0.0),\n  new Cartesian3(0.0, 0.0, 1.0),\n];\n\nconst ups = [\n  new Cartesian3(0.0, -1.0, 0.0),\n  new Cartesian3(0.0, 0.0, -1.0),\n  new Cartesian3(0.0, -1.0, 0.0),\n  new Cartesian3(0.0, -1.0, 0.0),\n  new Cartesian3(0.0, 0.0, 1.0),\n  new Cartesian3(0.0, -1.0, 0.0),\n];\n\nconst rights = [\n  new Cartesian3(0.0, 0.0, 1.0),\n  new Cartesian3(1.0, 0.0, 0.0),\n  new Cartesian3(-1.0, 0.0, 0.0),\n  new Cartesian3(0.0, 0.0, -1.0),\n  new Cartesian3(1.0, 0.0, 0.0),\n  new Cartesian3(1.0, 0.0, 0.0),\n];\n\nfunction computeOmnidirectional(shadowMap, frameState) {\n  // All sides share the same frustum\n  const frustum = new PerspectiveFrustum();\n  frustum.fov = CesiumMath.PI_OVER_TWO;\n  frustum.near = 1.0;\n  frustum.far = shadowMap._pointLightRadius;\n  frustum.aspectRatio = 1.0;\n\n  for (let i = 0; i < 6; ++i) {\n    const camera = shadowMap._passes[i].camera;\n    camera.positionWC = shadowMap._shadowMapCamera.positionWC;\n    camera.positionCartographic = frameState.mapProjection.ellipsoid.cartesianToCartographic(\n      camera.positionWC,\n      camera.positionCartographic\n    );\n    camera.directionWC = directions[i];\n    camera.upWC = ups[i];\n    camera.rightWC = rights[i];\n\n    Matrix4.computeView(\n      camera.positionWC,\n      camera.directionWC,\n      camera.upWC,\n      camera.rightWC,\n      camera.viewMatrix\n    );\n    Matrix4.inverse(camera.viewMatrix, camera.inverseViewMatrix);\n\n    camera.frustum = frustum;\n  }\n}\n\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchBoundingSphere = new BoundingSphere();\nconst scratchCenter = scratchBoundingSphere.center;\n\nfunction checkVisibility(shadowMap, frameState) {\n  const sceneCamera = shadowMap._sceneCamera;\n  const shadowMapCamera = shadowMap._shadowMapCamera;\n\n  const boundingSphere = scratchBoundingSphere;\n\n  // Check whether the shadow map is in view and needs to be updated\n  if (shadowMap._cascadesEnabled) {\n    // If the nearest shadow receiver is further than the shadow map's maximum distance then the shadow map is out of view.\n    if (sceneCamera.frustum.near >= shadowMap.maximumDistance) {\n      shadowMap._outOfView = true;\n      shadowMap._needsUpdate = false;\n      return;\n    }\n\n    // If the light source is below the horizon then the shadow map is out of view\n    const surfaceNormal = frameState.mapProjection.ellipsoid.geodeticSurfaceNormal(\n      sceneCamera.positionWC,\n      scratchCartesian1\n    );\n    const lightDirection = Cartesian3.negate(\n      shadowMapCamera.directionWC,\n      scratchCartesian2\n    );\n    const dot = Cartesian3.dot(surfaceNormal, lightDirection);\n    if (shadowMap.fadingEnabled) {\n      // Shadows start to fade out once the light gets closer to the horizon.\n      // At this point the globe uses vertex lighting alone to darken the surface.\n      const darknessAmount = CesiumMath.clamp(dot / 0.1, 0.0, 1.0);\n      shadowMap._darkness = CesiumMath.lerp(\n        1.0,\n        shadowMap.darkness,\n        darknessAmount\n      );\n    } else {\n      shadowMap._darkness = shadowMap.darkness;\n    }\n\n    if (dot < 0.0) {\n      shadowMap._outOfView = true;\n      shadowMap._needsUpdate = false;\n      return;\n    }\n\n    // By default cascaded shadows need to update and are always in view\n    shadowMap._needsUpdate = true;\n    shadowMap._outOfView = false;\n  } else if (shadowMap._isPointLight) {\n    // Sphere-frustum intersection test\n    boundingSphere.center = shadowMapCamera.positionWC;\n    boundingSphere.radius = shadowMap._pointLightRadius;\n    shadowMap._outOfView =\n      frameState.cullingVolume.computeVisibility(boundingSphere) ===\n      Intersect.OUTSIDE;\n    shadowMap._needsUpdate =\n      !shadowMap._outOfView &&\n      !shadowMap._boundingSphere.equals(boundingSphere);\n    BoundingSphere.clone(boundingSphere, shadowMap._boundingSphere);\n  } else {\n    // Simplify frustum-frustum intersection test as a sphere-frustum test\n    const frustumRadius = shadowMapCamera.frustum.far / 2.0;\n    const frustumCenter = Cartesian3.add(\n      shadowMapCamera.positionWC,\n      Cartesian3.multiplyByScalar(\n        shadowMapCamera.directionWC,\n        frustumRadius,\n        scratchCenter\n      ),\n      scratchCenter\n    );\n    boundingSphere.center = frustumCenter;\n    boundingSphere.radius = frustumRadius;\n    shadowMap._outOfView =\n      frameState.cullingVolume.computeVisibility(boundingSphere) ===\n      Intersect.OUTSIDE;\n    shadowMap._needsUpdate =\n      !shadowMap._outOfView &&\n      !shadowMap._boundingSphere.equals(boundingSphere);\n    BoundingSphere.clone(boundingSphere, shadowMap._boundingSphere);\n  }\n}\n\nfunction updateCameras(shadowMap, frameState) {\n  const camera = frameState.camera; // The actual camera in the scene\n  const lightCamera = shadowMap._lightCamera; // The external camera representing the light source\n  const sceneCamera = shadowMap._sceneCamera; // Clone of camera, with clamped near and far planes\n  const shadowMapCamera = shadowMap._shadowMapCamera; // Camera representing the shadow volume, initially cloned from lightCamera\n\n  // Clone light camera into the shadow map camera\n  if (shadowMap._cascadesEnabled) {\n    Cartesian3.clone(lightCamera.directionWC, shadowMapCamera.directionWC);\n  } else if (shadowMap._isPointLight) {\n    Cartesian3.clone(lightCamera.positionWC, shadowMapCamera.positionWC);\n  } else {\n    shadowMapCamera.clone(lightCamera);\n  }\n\n  // Get the light direction in eye coordinates\n  const lightDirection = shadowMap._lightDirectionEC;\n  Matrix4.multiplyByPointAsVector(\n    camera.viewMatrix,\n    shadowMapCamera.directionWC,\n    lightDirection\n  );\n  Cartesian3.normalize(lightDirection, lightDirection);\n  Cartesian3.negate(lightDirection, lightDirection);\n\n  // Get the light position in eye coordinates\n  Matrix4.multiplyByPoint(\n    camera.viewMatrix,\n    shadowMapCamera.positionWC,\n    shadowMap._lightPositionEC\n  );\n  shadowMap._lightPositionEC.w = shadowMap._pointLightRadius;\n\n  // Get the near and far of the scene camera\n  let near;\n  let far;\n  if (shadowMap._fitNearFar) {\n    // shadowFar can be very large, so limit to shadowMap.maximumDistance\n    // Push the far plane slightly further than the near plane to avoid degenerate frustum\n    near = Math.min(\n      frameState.shadowState.nearPlane,\n      shadowMap.maximumDistance\n    );\n    far = Math.min(frameState.shadowState.farPlane, shadowMap.maximumDistance);\n    far = Math.max(far, near + 1.0);\n  } else {\n    near = camera.frustum.near;\n    far = shadowMap.maximumDistance;\n  }\n\n  shadowMap._sceneCamera = Camera.clone(camera, sceneCamera);\n  camera.frustum.clone(shadowMap._sceneCamera.frustum);\n  shadowMap._sceneCamera.frustum.near = near;\n  shadowMap._sceneCamera.frustum.far = far;\n  shadowMap._distance = far - near;\n\n  checkVisibility(shadowMap, frameState);\n\n  if (!shadowMap._outOfViewPrevious && shadowMap._outOfView) {\n    shadowMap._needsUpdate = true;\n  }\n  shadowMap._outOfViewPrevious = shadowMap._outOfView;\n}\n\n/**\n * @private\n */\nShadowMap.prototype.update = function (frameState) {\n  updateCameras(this, frameState);\n\n  if (this._needsUpdate) {\n    updateFramebuffer(this, frameState.context);\n\n    if (this._isPointLight) {\n      computeOmnidirectional(this, frameState);\n    }\n\n    if (this._cascadesEnabled) {\n      fitShadowMapToScene(this, frameState);\n\n      if (this._numberOfCascades > 1) {\n        computeCascades(this, frameState);\n      }\n    }\n\n    if (!this._isPointLight) {\n      // Compute the culling volume\n      const shadowMapCamera = this._shadowMapCamera;\n      const position = shadowMapCamera.positionWC;\n      const direction = shadowMapCamera.directionWC;\n      const up = shadowMapCamera.upWC;\n      this._shadowMapCullingVolume = shadowMapCamera.frustum.computeCullingVolume(\n        position,\n        direction,\n        up\n      );\n\n      if (this._passes.length === 1) {\n        // Since there is only one pass, use the shadow map camera as the pass camera.\n        this._passes[0].camera.clone(shadowMapCamera);\n      }\n    } else {\n      this._shadowMapCullingVolume = CullingVolume.fromBoundingSphere(\n        this._boundingSphere\n      );\n    }\n  }\n\n  if (this._passes.length === 1) {\n    // Transforms from eye space to shadow texture space.\n    // Always requires an update since the scene camera constantly changes.\n    const inverseView = this._sceneCamera.inverseViewMatrix;\n    Matrix4.multiply(\n      this._shadowMapCamera.getViewProjection(),\n      inverseView,\n      this._shadowMapMatrix\n    );\n  }\n\n  if (this.debugShow) {\n    applyDebugSettings(this, frameState);\n  }\n};\n\n/**\n * @private\n */\nShadowMap.prototype.updatePass = function (context, shadowPass) {\n  clearFramebuffer(this, context, shadowPass);\n};\n\nconst scratchTexelStepSize = new Cartesian2();\n\nfunction combineUniforms(shadowMap, uniforms, isTerrain) {\n  const bias = shadowMap._isPointLight\n    ? shadowMap._pointBias\n    : isTerrain\n    ? shadowMap._terrainBias\n    : shadowMap._primitiveBias;\n\n  const mapUniforms = {\n    shadowMap_texture: function () {\n      return shadowMap._shadowMapTexture;\n    },\n    shadowMap_textureCube: function () {\n      return shadowMap._shadowMapTexture;\n    },\n    shadowMap_matrix: function () {\n      return shadowMap._shadowMapMatrix;\n    },\n    shadowMap_cascadeSplits: function () {\n      return shadowMap._cascadeSplits;\n    },\n    shadowMap_cascadeMatrices: function () {\n      return shadowMap._cascadeMatrices;\n    },\n    shadowMap_lightDirectionEC: function () {\n      return shadowMap._lightDirectionEC;\n    },\n    shadowMap_lightPositionEC: function () {\n      return shadowMap._lightPositionEC;\n    },\n    shadowMap_cascadeDistances: function () {\n      return shadowMap._cascadeDistances;\n    },\n    shadowMap_texelSizeDepthBiasAndNormalShadingSmooth: function () {\n      const texelStepSize = scratchTexelStepSize;\n      texelStepSize.x = 1.0 / shadowMap._textureSize.x;\n      texelStepSize.y = 1.0 / shadowMap._textureSize.y;\n\n      return Cartesian4.fromElements(\n        texelStepSize.x,\n        texelStepSize.y,\n        bias.depthBias,\n        bias.normalShadingSmooth,\n        this.combinedUniforms1\n      );\n    },\n    shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness: function () {\n      return Cartesian4.fromElements(\n        bias.normalOffsetScale,\n        shadowMap._distance,\n        shadowMap.maximumDistance,\n        shadowMap._darkness,\n        this.combinedUniforms2\n      );\n    },\n\n    combinedUniforms1: new Cartesian4(),\n    combinedUniforms2: new Cartesian4(),\n  };\n\n  return combine(uniforms, mapUniforms, false);\n}\n\nfunction createCastDerivedCommand(\n  shadowMap,\n  shadowsDirty,\n  command,\n  context,\n  oldShaderId,\n  result\n) {\n  let castShader;\n  let castRenderState;\n  let castUniformMap;\n  if (defined(result)) {\n    castShader = result.shaderProgram;\n    castRenderState = result.renderState;\n    castUniformMap = result.uniformMap;\n  }\n\n  result = DrawCommand.shallowClone(command, result);\n  result.castShadows = true;\n  result.receiveShadows = false;\n\n  if (\n    !defined(castShader) ||\n    oldShaderId !== command.shaderProgram.id ||\n    shadowsDirty\n  ) {\n    const shaderProgram = command.shaderProgram;\n\n    const isTerrain = command.pass === Pass.GLOBE;\n    const isOpaque = command.pass !== Pass.TRANSLUCENT;\n    const isPointLight = shadowMap._isPointLight;\n    const usesDepthTexture = shadowMap._usesDepthTexture;\n\n    const keyword = ShadowMapShader.getShadowCastShaderKeyword(\n      isPointLight,\n      isTerrain,\n      usesDepthTexture,\n      isOpaque\n    );\n    castShader = context.shaderCache.getDerivedShaderProgram(\n      shaderProgram,\n      keyword\n    );\n    if (!defined(castShader)) {\n      const vertexShaderSource = shaderProgram.vertexShaderSource;\n      const fragmentShaderSource = shaderProgram.fragmentShaderSource;\n\n      const castVS = ShadowMapShader.createShadowCastVertexShader(\n        vertexShaderSource,\n        isPointLight,\n        isTerrain\n      );\n      const castFS = ShadowMapShader.createShadowCastFragmentShader(\n        fragmentShaderSource,\n        isPointLight,\n        usesDepthTexture,\n        isOpaque\n      );\n\n      castShader = context.shaderCache.createDerivedShaderProgram(\n        shaderProgram,\n        keyword,\n        {\n          vertexShaderSource: castVS,\n          fragmentShaderSource: castFS,\n          attributeLocations: shaderProgram._attributeLocations,\n        }\n      );\n    }\n\n    castRenderState = shadowMap._primitiveRenderState;\n    if (isPointLight) {\n      castRenderState = shadowMap._pointRenderState;\n    } else if (isTerrain) {\n      castRenderState = shadowMap._terrainRenderState;\n    }\n\n    // Modify the render state for commands that do not use back-face culling, e.g. flat textured walls\n    const cullEnabled = command.renderState.cull.enabled;\n    if (!cullEnabled) {\n      castRenderState = clone(castRenderState, false);\n      castRenderState.cull = clone(castRenderState.cull, false);\n      castRenderState.cull.enabled = false;\n      castRenderState = RenderState.fromCache(castRenderState);\n    }\n\n    castUniformMap = combineUniforms(shadowMap, command.uniformMap, isTerrain);\n  }\n\n  result.shaderProgram = castShader;\n  result.renderState = castRenderState;\n  result.uniformMap = castUniformMap;\n\n  return result;\n}\n\nShadowMap.createReceiveDerivedCommand = function (\n  lightShadowMaps,\n  command,\n  shadowsDirty,\n  context,\n  result\n) {\n  if (!defined(result)) {\n    result = {};\n  }\n\n  const lightShadowMapsEnabled = lightShadowMaps.length > 0;\n  const shaderProgram = command.shaderProgram;\n  const vertexShaderSource = shaderProgram.vertexShaderSource;\n  const fragmentShaderSource = shaderProgram.fragmentShaderSource;\n  const isTerrain = command.pass === Pass.GLOBE;\n\n  let hasTerrainNormal = false;\n  if (isTerrain) {\n    hasTerrainNormal =\n      command.owner.data.renderedMesh.encoding.hasVertexNormals;\n  }\n\n  if (command.receiveShadows && lightShadowMapsEnabled) {\n    // Only generate a receiveCommand if there is a shadow map originating from a light source.\n    let receiveShader;\n    let receiveUniformMap;\n    if (defined(result.receiveCommand)) {\n      receiveShader = result.receiveCommand.shaderProgram;\n      receiveUniformMap = result.receiveCommand.uniformMap;\n    }\n\n    result.receiveCommand = DrawCommand.shallowClone(\n      command,\n      result.receiveCommand\n    );\n    result.castShadows = false;\n    result.receiveShadows = true;\n\n    // If castShadows changed, recompile the receive shadows shader. The normal shading technique simulates\n    // self-shadowing so it should be turned off if castShadows is false.\n    const castShadowsDirty =\n      result.receiveShaderCastShadows !== command.castShadows;\n    const shaderDirty =\n      result.receiveShaderProgramId !== command.shaderProgram.id;\n\n    if (\n      !defined(receiveShader) ||\n      shaderDirty ||\n      shadowsDirty ||\n      castShadowsDirty\n    ) {\n      const keyword = ShadowMapShader.getShadowReceiveShaderKeyword(\n        lightShadowMaps[0],\n        command.castShadows,\n        isTerrain,\n        hasTerrainNormal\n      );\n      receiveShader = context.shaderCache.getDerivedShaderProgram(\n        shaderProgram,\n        keyword\n      );\n      if (!defined(receiveShader)) {\n        const receiveVS = ShadowMapShader.createShadowReceiveVertexShader(\n          vertexShaderSource,\n          isTerrain,\n          hasTerrainNormal\n        );\n        const receiveFS = ShadowMapShader.createShadowReceiveFragmentShader(\n          fragmentShaderSource,\n          lightShadowMaps[0],\n          command.castShadows,\n          isTerrain,\n          hasTerrainNormal\n        );\n\n        receiveShader = context.shaderCache.createDerivedShaderProgram(\n          shaderProgram,\n          keyword,\n          {\n            vertexShaderSource: receiveVS,\n            fragmentShaderSource: receiveFS,\n            attributeLocations: shaderProgram._attributeLocations,\n          }\n        );\n      }\n\n      receiveUniformMap = combineUniforms(\n        lightShadowMaps[0],\n        command.uniformMap,\n        isTerrain\n      );\n    }\n\n    result.receiveCommand.shaderProgram = receiveShader;\n    result.receiveCommand.uniformMap = receiveUniformMap;\n    result.receiveShaderProgramId = command.shaderProgram.id;\n    result.receiveShaderCastShadows = command.castShadows;\n  }\n\n  return result;\n};\n\nShadowMap.createCastDerivedCommand = function (\n  shadowMaps,\n  command,\n  shadowsDirty,\n  context,\n  result\n) {\n  if (!defined(result)) {\n    result = {};\n  }\n\n  if (command.castShadows) {\n    let castCommands = result.castCommands;\n    if (!defined(castCommands)) {\n      castCommands = result.castCommands = [];\n    }\n\n    const oldShaderId = result.castShaderProgramId;\n\n    const shadowMapLength = shadowMaps.length;\n    castCommands.length = shadowMapLength;\n\n    for (let i = 0; i < shadowMapLength; ++i) {\n      castCommands[i] = createCastDerivedCommand(\n        shadowMaps[i],\n        shadowsDirty,\n        command,\n        context,\n        oldShaderId,\n        castCommands[i]\n      );\n    }\n\n    result.castShaderProgramId = command.shaderProgram.id;\n  }\n\n  return result;\n};\n\n/**\n * @private\n */\nShadowMap.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * @private\n */\nShadowMap.prototype.destroy = function () {\n  destroyFramebuffer(this);\n\n  this._debugLightFrustum =\n    this._debugLightFrustum && this._debugLightFrustum.destroy();\n  this._debugCameraFrustum =\n    this._debugCameraFrustum && this._debugCameraFrustum.destroy();\n  this._debugShadowViewCommand =\n    this._debugShadowViewCommand &&\n    this._debugShadowViewCommand.shaderProgram &&\n    this._debugShadowViewCommand.shaderProgram.destroy();\n\n  for (let i = 0; i < this._numberOfCascades; ++i) {\n    this._debugCascadeFrustums[i] =\n      this._debugCascadeFrustums[i] && this._debugCascadeFrustums[i].destroy();\n  }\n\n  return destroyObject(this);\n};\nexport default ShadowMap;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D u_opaqueDepthTexture;\\n\\\nuniform sampler2D u_translucentDepthTexture;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r;\\n\\\n    float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r;\\n\\\n    translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth);\\n\\\n    out_FragColor = czm_packDepth(translucentDepth);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\n\\n\\\n#ifdef DEBUG_SHOW_DEPTH\\n\\\nuniform sampler2D u_packedTranslucentDepth;\\n\\\n#endif\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n#ifdef DEBUG_SHOW_DEPTH\\n\\\n    if (v_textureCoordinates.x < 0.5)\\n\\\n    {\\n\\\n        out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates)));\\n\\\n        out_FragColor.a = 1.0;\\n\\\n    }\\n\\\n#else\\n\\\n    vec4 color = texture(colorTexture, v_textureCoordinates);\\n\\\n\\n\\\n#ifdef PICK\\n\\\n    if (color == vec4(0.0))\\n\\\n    {\\n\\\n        discard;\\n\\\n    }\\n\\\n#else\\n\\\n    // Reverse premultiplication process to get the correct composited result of the classification primitives\\n\\\n    color.rgb /= color.a;\\n\\\n#endif\\n\\\n    out_FragColor = color;\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport CompareAndPackTranslucentDepth from \"../Shaders/CompareAndPackTranslucentDepth.js\";\nimport CompositeTranslucentClassification from \"../Shaders/PostProcessStages/CompositeTranslucentClassification.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\n\nconst debugShowPackedDepth = false;\n\n/**\n * Handles buffers, drawing, and deriving commands needed for classifying translucent 3D Tiles.\n * Uses a depth texture, so classification on translucent 3D Tiles is not available in Internet Explorer.\n *\n * @private\n */\nfunction TranslucentTileClassification(context) {\n  this._drawClassificationFBO = new FramebufferManager({\n    createDepthAttachments: false,\n  });\n  this._accumulationFBO = new FramebufferManager({\n    createDepthAttachments: false,\n  });\n  this._packFBO = new FramebufferManager();\n\n  this._opaqueDepthStencilTexture = undefined;\n\n  // Reference to either colorTexture or accumulationTexture\n  this._textureToComposite = undefined;\n\n  this._translucentDepthStencilTexture = undefined;\n\n  this._packDepthCommand = undefined;\n  this._accumulateCommand = undefined;\n  this._compositeCommand = undefined;\n  this._copyCommand = undefined;\n\n  this._clearColorCommand = new ClearCommand({\n    color: new Color(0.0, 0.0, 0.0, 0.0),\n    owner: this,\n  });\n\n  this._clearDepthStencilCommand = new ClearCommand({\n    depth: 1.0,\n    stencil: 0,\n    owner: this,\n  });\n\n  this._supported = context.depthTexture;\n\n  this._viewport = new BoundingRectangle();\n  this._rsDepth = undefined;\n  this._rsAccumulate = undefined;\n  this._rsComp = undefined;\n  this._useScissorTest = undefined;\n  this._scissorRectangle = undefined;\n\n  this._hasTranslucentDepth = false;\n  this._frustumsDrawn = 0;\n}\n\nObject.defineProperties(TranslucentTileClassification.prototype, {\n  /**\n   * Gets whether or not translucent depth was rendered.\n   * @memberof TranslucentTileClassification.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  hasTranslucentDepth: {\n    get: function () {\n      return this._hasTranslucentDepth;\n    },\n  },\n});\n\nfunction destroyTextures(transpClass) {\n  transpClass._textureToComposite = undefined;\n\n  transpClass._translucentDepthStencilTexture =\n    transpClass._translucentDepthStencilTexture &&\n    !transpClass._translucentDepthStencilTexture.isDestroyed() &&\n    transpClass._translucentDepthStencilTexture.destroy();\n}\n\nfunction destroyFramebuffers(transpClass) {\n  transpClass._drawClassificationFBO.destroy();\n  transpClass._accumulationFBO.destroy();\n  transpClass._packFBO.destroy();\n}\n\nfunction updateTextures(transpClass, context, width, height) {\n  destroyTextures(transpClass);\n\n  transpClass._translucentDepthStencilTexture = new Texture({\n    context: context,\n    width: width,\n    height: height,\n    pixelFormat: PixelFormat.DEPTH_STENCIL,\n    pixelDatatype: PixelDatatype.UNSIGNED_INT_24_8,\n    sampler: Sampler.NEAREST,\n  });\n}\n\nfunction updateFramebuffers(transpClass, context, width, height) {\n  destroyFramebuffers(transpClass);\n  transpClass._drawClassificationFBO.setDepthStencilTexture(\n    transpClass._translucentDepthStencilTexture\n  );\n  transpClass._drawClassificationFBO.update(context, width, height);\n\n  transpClass._accumulationFBO.setDepthStencilTexture(\n    transpClass._translucentDepthStencilTexture\n  );\n  transpClass._accumulationFBO.update(context, width, height);\n\n  transpClass._packFBO.update(context, width, height);\n}\n\nfunction updateResources(\n  transpClass,\n  context,\n  passState,\n  globeDepthStencilTexture\n) {\n  if (!transpClass.isSupported()) {\n    return;\n  }\n\n  transpClass._opaqueDepthStencilTexture = globeDepthStencilTexture;\n\n  const width = transpClass._opaqueDepthStencilTexture.width;\n  const height = transpClass._opaqueDepthStencilTexture.height;\n  if (transpClass._drawClassificationFBO.isDirty(width, height)) {\n    updateTextures(transpClass, context, width, height);\n    updateFramebuffers(transpClass, context, width, height);\n  }\n\n  let fs;\n  let uniformMap;\n\n  if (!defined(transpClass._packDepthCommand)) {\n    fs = new ShaderSource({\n      sources: [CompareAndPackTranslucentDepth],\n    });\n\n    uniformMap = {\n      u_opaqueDepthTexture: function () {\n        return transpClass._opaqueDepthStencilTexture;\n      },\n      u_translucentDepthTexture: function () {\n        return transpClass._translucentDepthStencilTexture;\n      },\n    };\n\n    transpClass._packDepthCommand = context.createViewportQuadCommand(fs, {\n      uniformMap: uniformMap,\n      owner: transpClass,\n    });\n  }\n\n  if (!defined(transpClass._compositeCommand)) {\n    fs = new ShaderSource({\n      sources: [CompositeTranslucentClassification],\n    });\n\n    uniformMap = {\n      colorTexture: function () {\n        return transpClass._textureToComposite;\n      },\n    };\n\n    if (debugShowPackedDepth) {\n      fs.defines = [\"DEBUG_SHOW_DEPTH\"];\n      uniformMap.u_packedTranslucentDepth = function () {\n        return transpClass._packFBO.getColorTexture();\n      };\n    }\n\n    transpClass._compositeCommand = context.createViewportQuadCommand(fs, {\n      uniformMap: uniformMap,\n      owner: transpClass,\n    });\n\n    const compositeCommand = transpClass._compositeCommand;\n    const compositeProgram = compositeCommand.shaderProgram;\n    const compositePickProgram = context.shaderCache.createDerivedShaderProgram(\n      compositeProgram,\n      \"pick\",\n      {\n        vertexShaderSource: compositeProgram.vertexShaderSource,\n        fragmentShaderSource: new ShaderSource({\n          sources: fs.sources,\n          defines: [\"PICK\"],\n        }),\n        attributeLocations: compositeProgram._attributeLocations,\n      }\n    );\n    const compositePickCommand = DrawCommand.shallowClone(compositeCommand);\n    compositePickCommand.shaderProgram = compositePickProgram;\n    compositeCommand.derivedCommands.pick = compositePickCommand;\n  }\n\n  if (!defined(transpClass._copyCommand)) {\n    fs = new ShaderSource({\n      sources: [CompositeTranslucentClassification],\n    });\n\n    uniformMap = {\n      colorTexture: function () {\n        return transpClass._drawClassificationFBO.getColorTexture();\n      },\n    };\n\n    transpClass._copyCommand = context.createViewportQuadCommand(fs, {\n      uniformMap: uniformMap,\n      owner: transpClass,\n    });\n  }\n\n  if (!defined(transpClass._accumulateCommand)) {\n    fs = new ShaderSource({\n      sources: [CompositeTranslucentClassification],\n    });\n\n    uniformMap = {\n      colorTexture: function () {\n        return transpClass._drawClassificationFBO.getColorTexture();\n      },\n    };\n\n    transpClass._accumulateCommand = context.createViewportQuadCommand(fs, {\n      uniformMap: uniformMap,\n      owner: transpClass,\n    });\n  }\n\n  transpClass._viewport.width = width;\n  transpClass._viewport.height = height;\n\n  const useScissorTest = !BoundingRectangle.equals(\n    transpClass._viewport,\n    passState.viewport\n  );\n  let updateScissor = useScissorTest !== transpClass._useScissorTest;\n  transpClass._useScissorTest = useScissorTest;\n\n  if (\n    !BoundingRectangle.equals(transpClass._scissorRectangle, passState.viewport)\n  ) {\n    transpClass._scissorRectangle = BoundingRectangle.clone(\n      passState.viewport,\n      transpClass._scissorRectangle\n    );\n    updateScissor = true;\n  }\n\n  if (\n    !defined(transpClass._rsDepth) ||\n    !BoundingRectangle.equals(\n      transpClass._viewport,\n      transpClass._rsDepth.viewport\n    ) ||\n    updateScissor\n  ) {\n    transpClass._rsDepth = RenderState.fromCache({\n      viewport: transpClass._viewport,\n      scissorTest: {\n        enabled: transpClass._useScissorTest,\n        rectangle: transpClass._scissorRectangle,\n      },\n    });\n  }\n\n  if (defined(transpClass._packDepthCommand)) {\n    transpClass._packDepthCommand.renderState = transpClass._rsDepth;\n  }\n\n  if (\n    !defined(transpClass._rsAccumulate) ||\n    !BoundingRectangle.equals(\n      transpClass._viewport,\n      transpClass._rsAccumulate.viewport\n    ) ||\n    updateScissor\n  ) {\n    transpClass._rsAccumulate = RenderState.fromCache({\n      viewport: transpClass._viewport,\n      scissorTest: {\n        enabled: transpClass._useScissorTest,\n        rectangle: transpClass._scissorRectangle,\n      },\n      stencilTest: {\n        enabled: true,\n        frontFunction: StencilFunction.EQUAL,\n        reference: StencilConstants.CESIUM_3D_TILE_MASK,\n      },\n    });\n  }\n\n  if (defined(transpClass._accumulateCommand)) {\n    transpClass._accumulateCommand.renderState = transpClass._rsAccumulate;\n  }\n\n  if (\n    !defined(transpClass._rsComp) ||\n    !BoundingRectangle.equals(\n      transpClass._viewport,\n      transpClass._rsComp.viewport\n    ) ||\n    updateScissor\n  ) {\n    transpClass._rsComp = RenderState.fromCache({\n      viewport: transpClass._viewport,\n      scissorTest: {\n        enabled: transpClass._useScissorTest,\n        rectangle: transpClass._scissorRectangle,\n      },\n      blending: BlendingState.ALPHA_BLEND,\n    });\n  }\n\n  if (defined(transpClass._compositeCommand)) {\n    transpClass._compositeCommand.renderState = transpClass._rsComp;\n    transpClass._compositeCommand.derivedCommands.pick.renderState =\n      transpClass._rsComp;\n  }\n}\n\nTranslucentTileClassification.prototype.executeTranslucentCommands = function (\n  scene,\n  executeCommand,\n  passState,\n  commands,\n  globeDepthStencilTexture\n) {\n  // Check for translucent commands that should be classified\n  const length = commands.length;\n  let command;\n  let i;\n\n  const useLogDepth = scene.frameState.useLogDepth;\n  const context = scene.context;\n  const framebuffer = passState.framebuffer;\n\n  for (i = 0; i < length; ++i) {\n    command = commands[i];\n    command = useLogDepth ? command.derivedCommands.logDepth.command : command;\n\n    if (command.depthForTranslucentClassification) {\n      this._hasTranslucentDepth = true;\n      break;\n    }\n  }\n\n  if (!this._hasTranslucentDepth) {\n    return;\n  }\n\n  updateResources(this, context, passState, globeDepthStencilTexture);\n\n  // Get translucent depth\n  passState.framebuffer = this._drawClassificationFBO.framebuffer;\n\n  // Clear depth for multifrustum\n  this._clearDepthStencilCommand.execute(context, passState);\n\n  for (i = 0; i < length; ++i) {\n    command = commands[i];\n    command = useLogDepth ? command.derivedCommands.logDepth.command : command;\n\n    if (!command.depthForTranslucentClassification) {\n      continue;\n    }\n\n    // Depth-only commands are created for all translucent 3D Tiles commands\n    const depthOnlyCommand = command.derivedCommands.depth.depthOnlyCommand;\n    executeCommand(depthOnlyCommand, scene, context, passState);\n  }\n\n  this._frustumsDrawn += this._hasTranslucentDepth ? 1 : 0;\n\n  // Pack depth if any translucent depth commands were performed\n  if (this._hasTranslucentDepth) {\n    passState.framebuffer = this._packFBO.framebuffer;\n    this._packDepthCommand.execute(context, passState);\n  }\n\n  passState.framebuffer = framebuffer;\n};\n\nTranslucentTileClassification.prototype.executeClassificationCommands = function (\n  scene,\n  executeCommand,\n  passState,\n  frustumCommands\n) {\n  if (!this._hasTranslucentDepth) {\n    return;\n  }\n\n  const context = scene.context;\n  const us = context.uniformState;\n  const framebuffer = passState.framebuffer;\n\n  if (this._frustumsDrawn === 2) {\n    // copy classification from first frustum\n    passState.framebuffer = this._accumulationFBO.framebuffer;\n    this._copyCommand.execute(context, passState);\n  }\n\n  passState.framebuffer = this._drawClassificationFBO.framebuffer;\n  if (this._frustumsDrawn > 1) {\n    this._clearColorCommand.execute(context, passState);\n  }\n\n  us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION);\n  const swapGlobeDepth = us.globeDepthTexture;\n  us.globeDepthTexture = this._packFBO.getColorTexture();\n  const commands = frustumCommands.commands[Pass.CESIUM_3D_TILE_CLASSIFICATION];\n  const length = frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION];\n  for (let i = 0; i < length; ++i) {\n    executeCommand(commands[i], scene, context, passState);\n  }\n\n  us.globeDepthTexture = swapGlobeDepth;\n  passState.framebuffer = framebuffer;\n\n  if (this._frustumsDrawn === 1) {\n    return;\n  }\n\n  passState.framebuffer = this._accumulationFBO.framebuffer;\n  this._accumulateCommand.execute(context, passState);\n\n  passState.framebuffer = framebuffer;\n};\n\nTranslucentTileClassification.prototype.execute = function (scene, passState) {\n  if (!this._hasTranslucentDepth) {\n    return;\n  }\n  if (this._frustumsDrawn === 1) {\n    this._textureToComposite = this._drawClassificationFBO.getColorTexture();\n  } else {\n    this._textureToComposite = this._accumulationFBO.getColorTexture();\n  }\n\n  const command = scene.frameState.passes.pick\n    ? this._compositeCommand.derivedCommands.pick\n    : this._compositeCommand;\n  command.execute(scene.context, passState);\n\n  clear(this, scene, passState);\n};\n\nfunction clear(translucentTileClassification, scene, passState) {\n  if (!translucentTileClassification._hasTranslucentDepth) {\n    return;\n  }\n\n  const framebuffer = passState.framebuffer;\n\n  passState.framebuffer =\n    translucentTileClassification._drawClassificationFBO.framebuffer;\n  translucentTileClassification._clearColorCommand.execute(\n    scene._context,\n    passState\n  );\n\n  passState.framebuffer = framebuffer;\n\n  if (translucentTileClassification._frustumsDrawn > 1) {\n    passState.framebuffer =\n      translucentTileClassification._accumulationFBO.framebuffer;\n    translucentTileClassification._clearColorCommand.execute(\n      scene._context,\n      passState\n    );\n  }\n\n  translucentTileClassification._hasTranslucentDepth = false;\n  translucentTileClassification._frustumsDrawn = 0;\n}\n\nTranslucentTileClassification.prototype.isSupported = function () {\n  return this._supported;\n};\n\nTranslucentTileClassification.prototype.isDestroyed = function () {\n  return false;\n};\n\nTranslucentTileClassification.prototype.destroy = function () {\n  destroyTextures(this);\n  destroyFramebuffers(this);\n\n  if (defined(this._compositeCommand)) {\n    this._compositeCommand.shaderProgram =\n      this._compositeCommand.shaderProgram &&\n      this._compositeCommand.shaderProgram.destroy();\n  }\n\n  if (defined(this._packDepthCommand)) {\n    this._packDepthCommand.shaderProgram =\n      this._packDepthCommand.shaderProgram &&\n      this._packDepthCommand.shaderProgram.destroy();\n  }\n  return destroyObject(this);\n};\n\nexport default TranslucentTileClassification;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport CullingVolume from \"../Core/CullingVolume.js\";\nimport defined from \"../Core/defined.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport Interval from \"../Core/Interval.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport PassState from \"../Renderer/PassState.js\";\nimport Camera from \"./Camera.js\";\nimport FrustumCommands from \"./FrustumCommands.js\";\nimport GlobeDepth from \"./GlobeDepth.js\";\nimport GlobeTranslucencyFramebuffer from \"./GlobeTranslucencyFramebuffer.js\";\nimport OIT from \"./OIT.js\";\nimport PickDepthFramebuffer from \"./PickDepthFramebuffer.js\";\nimport PickFramebuffer from \"./PickFramebuffer.js\";\nimport SceneFramebuffer from \"./SceneFramebuffer.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowMap from \"./ShadowMap.js\";\nimport TranslucentTileClassification from \"./TranslucentTileClassification.js\";\n\nfunction CommandExtent() {\n  this.command = undefined;\n  this.near = undefined;\n  this.far = undefined;\n}\n\n/**\n * @private\n */\nfunction View(scene, camera, viewport) {\n  const context = scene.context;\n\n  let globeDepth;\n  if (context.depthTexture) {\n    globeDepth = new GlobeDepth();\n  }\n\n  let oit;\n  if (scene._useOIT && context.depthTexture) {\n    oit = new OIT(context);\n  }\n\n  const passState = new PassState(context);\n  passState.viewport = BoundingRectangle.clone(viewport);\n\n  this.camera = camera;\n  this._cameraClone = Camera.clone(camera);\n  this._cameraStartFired = false;\n  this._cameraMovedTime = undefined;\n\n  this.viewport = viewport;\n  this.passState = passState;\n  this.pickFramebuffer = new PickFramebuffer(context);\n  this.pickDepthFramebuffer = new PickDepthFramebuffer();\n  this.sceneFramebuffer = new SceneFramebuffer();\n  this.globeDepth = globeDepth;\n  this.globeTranslucencyFramebuffer = new GlobeTranslucencyFramebuffer();\n  this.oit = oit;\n  this.translucentTileClassification = new TranslucentTileClassification(\n    context\n  );\n  this.pickDepths = [];\n  this.frustumCommandsList = [];\n  this.debugFrustumStatistics = undefined;\n\n  // Array of all commands that get rendered into frustums along with their near / far values.\n  // Acts similar to a ManagedArray.\n  this._commandExtents = [];\n}\n\nconst scratchPosition0 = new Cartesian3();\nconst scratchPosition1 = new Cartesian3();\nfunction maxComponent(a, b) {\n  const x = Math.max(Math.abs(a.x), Math.abs(b.x));\n  const y = Math.max(Math.abs(a.y), Math.abs(b.y));\n  const z = Math.max(Math.abs(a.z), Math.abs(b.z));\n  return Math.max(Math.max(x, y), z);\n}\n\nfunction cameraEqual(camera0, camera1, epsilon) {\n  const scalar =\n    1 / Math.max(1, maxComponent(camera0.position, camera1.position));\n  Cartesian3.multiplyByScalar(camera0.position, scalar, scratchPosition0);\n  Cartesian3.multiplyByScalar(camera1.position, scalar, scratchPosition1);\n  return (\n    Cartesian3.equalsEpsilon(scratchPosition0, scratchPosition1, epsilon) &&\n    Cartesian3.equalsEpsilon(camera0.direction, camera1.direction, epsilon) &&\n    Cartesian3.equalsEpsilon(camera0.up, camera1.up, epsilon) &&\n    Cartesian3.equalsEpsilon(camera0.right, camera1.right, epsilon) &&\n    Matrix4.equalsEpsilon(camera0.transform, camera1.transform, epsilon) &&\n    camera0.frustum.equalsEpsilon(camera1.frustum, epsilon)\n  );\n}\n\nView.prototype.checkForCameraUpdates = function (scene) {\n  const camera = this.camera;\n  const cameraClone = this._cameraClone;\n  if (!cameraEqual(camera, cameraClone, CesiumMath.EPSILON15)) {\n    if (!this._cameraStartFired) {\n      camera.moveStart.raiseEvent();\n      this._cameraStartFired = true;\n    }\n    this._cameraMovedTime = getTimestamp();\n    Camera.clone(camera, cameraClone);\n\n    return true;\n  }\n\n  if (\n    this._cameraStartFired &&\n    getTimestamp() - this._cameraMovedTime > scene.cameraEventWaitTime\n  ) {\n    camera.moveEnd.raiseEvent();\n    this._cameraStartFired = false;\n  }\n\n  return false;\n};\n\nfunction updateFrustums(view, scene, near, far) {\n  const frameState = scene.frameState;\n  const camera = frameState.camera;\n  const farToNearRatio = frameState.useLogDepth\n    ? scene.logarithmicDepthFarToNearRatio\n    : scene.farToNearRatio;\n  const is2D = scene.mode === SceneMode.SCENE2D;\n  const nearToFarDistance2D = scene.nearToFarDistance2D;\n\n  // Extend the far plane slightly further to prevent geometry clipping against the far plane.\n  far *= 1.0 + CesiumMath.EPSILON2;\n\n  // The computed near plane must be between the user defined near and far planes.\n  // The computed far plane must between the user defined far and computed near.\n  // This will handle the case where the computed near plane is further than the user defined far plane.\n  near = Math.min(Math.max(near, camera.frustum.near), camera.frustum.far);\n  far = Math.max(Math.min(far, camera.frustum.far), near);\n\n  let numFrustums;\n  if (is2D) {\n    // The multifrustum for 2D is uniformly distributed. To avoid z-fighting in 2D,\n    // the camera is moved to just before the frustum and the frustum depth is scaled\n    // to be in [1.0, nearToFarDistance2D].\n    far = Math.min(far, camera.position.z + scene.nearToFarDistance2D);\n    near = Math.min(near, far);\n    numFrustums = Math.ceil(\n      Math.max(1.0, far - near) / scene.nearToFarDistance2D\n    );\n  } else {\n    // The multifrustum for 3D/CV is non-uniformly distributed.\n    numFrustums = Math.ceil(Math.log(far / near) / Math.log(farToNearRatio));\n  }\n\n  const frustumCommandsList = view.frustumCommandsList;\n  frustumCommandsList.length = numFrustums;\n  for (let m = 0; m < numFrustums; ++m) {\n    let curNear;\n    let curFar;\n\n    if (is2D) {\n      curNear = Math.min(\n        far - nearToFarDistance2D,\n        near + m * nearToFarDistance2D\n      );\n      curFar = Math.min(far, curNear + nearToFarDistance2D);\n    } else {\n      curNear = Math.max(near, Math.pow(farToNearRatio, m) * near);\n      curFar = Math.min(far, farToNearRatio * curNear);\n    }\n    let frustumCommands = frustumCommandsList[m];\n    if (!defined(frustumCommands)) {\n      frustumCommands = frustumCommandsList[m] = new FrustumCommands(\n        curNear,\n        curFar\n      );\n    } else {\n      frustumCommands.near = curNear;\n      frustumCommands.far = curFar;\n    }\n  }\n}\n\nfunction insertIntoBin(view, scene, command, commandNear, commandFar) {\n  if (scene.debugShowFrustums) {\n    command.debugOverlappingFrustums = 0;\n  }\n\n  const frustumCommandsList = view.frustumCommandsList;\n  const length = frustumCommandsList.length;\n\n  for (let i = 0; i < length; ++i) {\n    const frustumCommands = frustumCommandsList[i];\n    const curNear = frustumCommands.near;\n    const curFar = frustumCommands.far;\n\n    if (commandNear > curFar) {\n      continue;\n    }\n\n    if (commandFar < curNear) {\n      break;\n    }\n\n    const pass = command.pass;\n    const index = frustumCommands.indices[pass]++;\n    frustumCommands.commands[pass][index] = command;\n\n    if (scene.debugShowFrustums) {\n      command.debugOverlappingFrustums |= 1 << i;\n    }\n\n    if (command.executeInClosestFrustum) {\n      break;\n    }\n  }\n\n  if (scene.debugShowFrustums) {\n    const cf = view.debugFrustumStatistics.commandsInFrustums;\n    cf[command.debugOverlappingFrustums] = defined(\n      cf[command.debugOverlappingFrustums]\n    )\n      ? cf[command.debugOverlappingFrustums] + 1\n      : 1;\n    ++view.debugFrustumStatistics.totalCommands;\n  }\n\n  scene.updateDerivedCommands(command);\n}\n\nconst scratchCullingVolume = new CullingVolume();\nconst scratchNearFarInterval = new Interval();\n\nView.prototype.createPotentiallyVisibleSet = function (scene) {\n  const frameState = scene.frameState;\n  const camera = frameState.camera;\n  const direction = camera.directionWC;\n  const position = camera.positionWC;\n\n  const computeList = scene._computeCommandList;\n  const overlayList = scene._overlayCommandList;\n  const commandList = frameState.commandList;\n\n  if (scene.debugShowFrustums) {\n    this.debugFrustumStatistics = {\n      totalCommands: 0,\n      commandsInFrustums: {},\n    };\n  }\n\n  const frustumCommandsList = this.frustumCommandsList;\n  const numberOfFrustums = frustumCommandsList.length;\n  const numberOfPasses = Pass.NUMBER_OF_PASSES;\n  for (let n = 0; n < numberOfFrustums; ++n) {\n    for (let p = 0; p < numberOfPasses; ++p) {\n      frustumCommandsList[n].indices[p] = 0;\n    }\n  }\n\n  computeList.length = 0;\n  overlayList.length = 0;\n\n  const commandExtents = this._commandExtents;\n  const commandExtentCapacity = commandExtents.length;\n  let commandExtentCount = 0;\n\n  let near = +Number.MAX_VALUE;\n  let far = -Number.MAX_VALUE;\n\n  const shadowsEnabled = frameState.shadowState.shadowsEnabled;\n  let shadowNear = +Number.MAX_VALUE;\n  let shadowFar = -Number.MAX_VALUE;\n  let shadowClosestObjectSize = Number.MAX_VALUE;\n\n  const occluder =\n    frameState.mode === SceneMode.SCENE3D ? frameState.occluder : undefined;\n  let cullingVolume = frameState.cullingVolume;\n\n  // get user culling volume minus the far plane.\n  const planes = scratchCullingVolume.planes;\n  for (let k = 0; k < 5; ++k) {\n    planes[k] = cullingVolume.planes[k];\n  }\n  cullingVolume = scratchCullingVolume;\n\n  const length = commandList.length;\n  for (let i = 0; i < length; ++i) {\n    const command = commandList[i];\n    const pass = command.pass;\n\n    if (pass === Pass.COMPUTE) {\n      computeList.push(command);\n    } else if (pass === Pass.OVERLAY) {\n      overlayList.push(command);\n    } else {\n      let commandNear;\n      let commandFar;\n\n      const boundingVolume = command.boundingVolume;\n      if (defined(boundingVolume)) {\n        if (!scene.isVisible(command, cullingVolume, occluder)) {\n          continue;\n        }\n\n        const nearFarInterval = boundingVolume.computePlaneDistances(\n          position,\n          direction,\n          scratchNearFarInterval\n        );\n        commandNear = nearFarInterval.start;\n        commandFar = nearFarInterval.stop;\n        near = Math.min(near, commandNear);\n        far = Math.max(far, commandFar);\n\n        // Compute a tight near and far plane for commands that receive shadows. This helps compute\n        // good splits for cascaded shadow maps. Ignore commands that exceed the maximum distance.\n        // When moving the camera low LOD globe tiles begin to load, whose bounding volumes\n        // throw off the near/far fitting for the shadow map. Only update for globe tiles that the\n        // camera isn't inside.\n        if (\n          shadowsEnabled &&\n          command.receiveShadows &&\n          commandNear < ShadowMap.MAXIMUM_DISTANCE &&\n          !(pass === Pass.GLOBE && commandNear < -100.0 && commandFar > 100.0)\n        ) {\n          // Get the smallest bounding volume the camera is near. This is used to place more shadow detail near the object.\n          const size = commandFar - commandNear;\n          if (pass !== Pass.GLOBE && commandNear < 100.0) {\n            shadowClosestObjectSize = Math.min(shadowClosestObjectSize, size);\n          }\n          shadowNear = Math.min(shadowNear, commandNear);\n          shadowFar = Math.max(shadowFar, commandFar);\n        }\n      } else if (command instanceof ClearCommand) {\n        // Clear commands don't need a bounding volume - just add the clear to all frustums.\n        commandNear = camera.frustum.near;\n        commandFar = camera.frustum.far;\n      } else {\n        // If command has no bounding volume we need to use the camera's\n        // worst-case near and far planes to avoid clipping something important.\n        commandNear = camera.frustum.near;\n        commandFar = camera.frustum.far;\n        near = Math.min(near, commandNear);\n        far = Math.max(far, commandFar);\n      }\n\n      let extent = commandExtents[commandExtentCount];\n      if (!defined(extent)) {\n        extent = commandExtents[commandExtentCount] = new CommandExtent();\n      }\n      extent.command = command;\n      extent.near = commandNear;\n      extent.far = commandFar;\n      commandExtentCount++;\n    }\n  }\n\n  if (shadowsEnabled) {\n    shadowNear = Math.min(\n      Math.max(shadowNear, camera.frustum.near),\n      camera.frustum.far\n    );\n    shadowFar = Math.max(Math.min(shadowFar, camera.frustum.far), shadowNear);\n  }\n\n  // Use the computed near and far for shadows\n  if (shadowsEnabled) {\n    frameState.shadowState.nearPlane = shadowNear;\n    frameState.shadowState.farPlane = shadowFar;\n    frameState.shadowState.closestObjectSize = shadowClosestObjectSize;\n  }\n\n  updateFrustums(this, scene, near, far);\n\n  let c;\n  let ce;\n\n  for (c = 0; c < commandExtentCount; c++) {\n    ce = commandExtents[c];\n    insertIntoBin(this, scene, ce.command, ce.near, ce.far);\n  }\n\n  // Dereference old commands\n  if (commandExtentCount < commandExtentCapacity) {\n    for (c = commandExtentCount; c < commandExtentCapacity; c++) {\n      ce = commandExtents[c];\n      if (!defined(ce.command)) {\n        // If the command is undefined, it's assumed that all\n        // subsequent commmands were set to undefined as well,\n        // so no need to loop over them all\n        break;\n      }\n      ce.command = undefined;\n    }\n  }\n\n  const numFrustums = frustumCommandsList.length;\n  const frustumSplits = frameState.frustumSplits;\n  frustumSplits.length = numFrustums + 1;\n  for (let j = 0; j < numFrustums; ++j) {\n    frustumSplits[j] = frustumCommandsList[j].near;\n    if (j === numFrustums - 1) {\n      frustumSplits[j + 1] = frustumCommandsList[j].far;\n    }\n  }\n};\n\nView.prototype.destroy = function () {\n  this.pickFramebuffer = this.pickFramebuffer && this.pickFramebuffer.destroy();\n  this.pickDepthFramebuffer =\n    this.pickDepthFramebuffer && this.pickDepthFramebuffer.destroy();\n  this.sceneFramebuffer =\n    this.sceneFramebuffer && this.sceneFramebuffer.destroy();\n  this.globeDepth = this.globeDepth && this.globeDepth.destroy();\n  this.oit = this.oit && this.oit.destroy();\n  this.translucentTileClassification =\n    this.translucentTileClassification &&\n    this.translucentTileClassification.destroy();\n  this.globeTranslucencyFramebuffer =\n    this.globeTranslucencyFramebuffer &&\n    this.globeTranslucencyFramebuffer.destroy();\n\n  let i;\n  const pickDepths = this.pickDepths;\n  const length = pickDepths.length;\n  for (i = 0; i < length; ++i) {\n    pickDepths[i].destroy();\n  }\n};\nexport default View;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport PerspectiveFrustum from \"../Core/PerspectiveFrustum.js\";\nimport PerspectiveOffCenterFrustum from \"../Core/PerspectiveOffCenterFrustum.js\";\nimport Ray from \"../Core/Ray.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport Camera from \"./Camera.js\";\nimport Cesium3DTileFeature from \"./Cesium3DTileFeature.js\";\nimport Cesium3DTilePass from \"./Cesium3DTilePass.js\";\nimport Cesium3DTilePassState from \"./Cesium3DTilePassState.js\";\nimport PickDepth from \"./PickDepth.js\";\nimport PrimitiveCollection from \"./PrimitiveCollection.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport SceneTransforms from \"./SceneTransforms.js\";\nimport View from \"./View.js\";\n\nconst offscreenDefaultWidth = 0.1;\n\nconst mostDetailedPreloadTilesetPassState = new Cesium3DTilePassState({\n  pass: Cesium3DTilePass.MOST_DETAILED_PRELOAD,\n});\n\nconst mostDetailedPickTilesetPassState = new Cesium3DTilePassState({\n  pass: Cesium3DTilePass.MOST_DETAILED_PICK,\n});\n\nconst pickTilesetPassState = new Cesium3DTilePassState({\n  pass: Cesium3DTilePass.PICK,\n});\n\n/**\n * @private\n */\nfunction Picking(scene) {\n  this._mostDetailedRayPicks = [];\n  this.pickRenderStateCache = {};\n  this._pickPositionCache = {};\n  this._pickPositionCacheDirty = false;\n\n  const pickOffscreenViewport = new BoundingRectangle(0, 0, 1, 1);\n  const pickOffscreenCamera = new Camera(scene);\n  pickOffscreenCamera.frustum = new OrthographicFrustum({\n    width: offscreenDefaultWidth,\n    aspectRatio: 1.0,\n    near: 0.1,\n  });\n\n  this._pickOffscreenView = new View(\n    scene,\n    pickOffscreenCamera,\n    pickOffscreenViewport\n  );\n}\n\nPicking.prototype.update = function () {\n  this._pickPositionCacheDirty = true;\n};\n\nPicking.prototype.getPickDepth = function (scene, index) {\n  const pickDepths = scene.view.pickDepths;\n  let pickDepth = pickDepths[index];\n  if (!defined(pickDepth)) {\n    pickDepth = new PickDepth();\n    pickDepths[index] = pickDepth;\n  }\n  return pickDepth;\n};\n\nconst scratchOrthoPickingFrustum = new OrthographicOffCenterFrustum();\nconst scratchOrthoOrigin = new Cartesian3();\nconst scratchOrthoDirection = new Cartesian3();\nconst scratchOrthoPixelSize = new Cartesian2();\nconst scratchOrthoPickVolumeMatrix4 = new Matrix4();\n\nfunction getPickOrthographicCullingVolume(\n  scene,\n  drawingBufferPosition,\n  width,\n  height,\n  viewport\n) {\n  const camera = scene.camera;\n  let frustum = camera.frustum;\n  const offCenterFrustum = frustum.offCenterFrustum;\n  if (defined(offCenterFrustum)) {\n    frustum = offCenterFrustum;\n  }\n\n  let x = (2.0 * (drawingBufferPosition.x - viewport.x)) / viewport.width - 1.0;\n  x *= (frustum.right - frustum.left) * 0.5;\n  let y =\n    (2.0 * (viewport.height - drawingBufferPosition.y - viewport.y)) /\n      viewport.height -\n    1.0;\n  y *= (frustum.top - frustum.bottom) * 0.5;\n\n  const transform = Matrix4.clone(\n    camera.transform,\n    scratchOrthoPickVolumeMatrix4\n  );\n  camera._setTransform(Matrix4.IDENTITY);\n\n  const origin = Cartesian3.clone(camera.position, scratchOrthoOrigin);\n  Cartesian3.multiplyByScalar(camera.right, x, scratchOrthoDirection);\n  Cartesian3.add(scratchOrthoDirection, origin, origin);\n  Cartesian3.multiplyByScalar(camera.up, y, scratchOrthoDirection);\n  Cartesian3.add(scratchOrthoDirection, origin, origin);\n\n  camera._setTransform(transform);\n\n  if (scene.mode === SceneMode.SCENE2D) {\n    Cartesian3.fromElements(origin.z, origin.x, origin.y, origin);\n  }\n\n  const pixelSize = frustum.getPixelDimensions(\n    viewport.width,\n    viewport.height,\n    1.0,\n    1.0,\n    scratchOrthoPixelSize\n  );\n\n  const ortho = scratchOrthoPickingFrustum;\n  ortho.right = pixelSize.x * 0.5;\n  ortho.left = -ortho.right;\n  ortho.top = pixelSize.y * 0.5;\n  ortho.bottom = -ortho.top;\n  ortho.near = frustum.near;\n  ortho.far = frustum.far;\n\n  return ortho.computeCullingVolume(origin, camera.directionWC, camera.upWC);\n}\n\nconst scratchPerspPickingFrustum = new PerspectiveOffCenterFrustum();\nconst scratchPerspPixelSize = new Cartesian2();\n\nfunction getPickPerspectiveCullingVolume(\n  scene,\n  drawingBufferPosition,\n  width,\n  height,\n  viewport\n) {\n  const camera = scene.camera;\n  const frustum = camera.frustum;\n  const near = frustum.near;\n\n  const tanPhi = Math.tan(frustum.fovy * 0.5);\n  const tanTheta = frustum.aspectRatio * tanPhi;\n\n  const x =\n    (2.0 * (drawingBufferPosition.x - viewport.x)) / viewport.width - 1.0;\n  const y =\n    (2.0 * (viewport.height - drawingBufferPosition.y - viewport.y)) /\n      viewport.height -\n    1.0;\n\n  const xDir = x * near * tanTheta;\n  const yDir = y * near * tanPhi;\n\n  const pixelSize = frustum.getPixelDimensions(\n    viewport.width,\n    viewport.height,\n    1.0,\n    1.0,\n    scratchPerspPixelSize\n  );\n  const pickWidth = pixelSize.x * width * 0.5;\n  const pickHeight = pixelSize.y * height * 0.5;\n\n  const offCenter = scratchPerspPickingFrustum;\n  offCenter.top = yDir + pickHeight;\n  offCenter.bottom = yDir - pickHeight;\n  offCenter.right = xDir + pickWidth;\n  offCenter.left = xDir - pickWidth;\n  offCenter.near = near;\n  offCenter.far = frustum.far;\n\n  return offCenter.computeCullingVolume(\n    camera.positionWC,\n    camera.directionWC,\n    camera.upWC\n  );\n}\n\nfunction getPickCullingVolume(\n  scene,\n  drawingBufferPosition,\n  width,\n  height,\n  viewport\n) {\n  const frustum = scene.camera.frustum;\n  if (\n    frustum instanceof OrthographicFrustum ||\n    frustum instanceof OrthographicOffCenterFrustum\n  ) {\n    return getPickOrthographicCullingVolume(\n      scene,\n      drawingBufferPosition,\n      width,\n      height,\n      viewport\n    );\n  }\n\n  return getPickPerspectiveCullingVolume(\n    scene,\n    drawingBufferPosition,\n    width,\n    height,\n    viewport\n  );\n}\n\n// pick rectangle width and height, assumed odd\nlet scratchRectangleWidth = 3.0;\nlet scratchRectangleHeight = 3.0;\nlet scratchRectangle = new BoundingRectangle(\n  0.0,\n  0.0,\n  scratchRectangleWidth,\n  scratchRectangleHeight\n);\nconst scratchPosition = new Cartesian2();\nconst scratchColorZero = new Color(0.0, 0.0, 0.0, 0.0);\n\nPicking.prototype.pick = function (scene, windowPosition, width, height) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(windowPosition)) {\n    throw new DeveloperError(\"windowPosition is undefined.\");\n  }\n  //>>includeEnd('debug');\n\n  scratchRectangleWidth = defaultValue(width, 3.0);\n  scratchRectangleHeight = defaultValue(height, scratchRectangleWidth);\n\n  const context = scene.context;\n  const us = context.uniformState;\n  const frameState = scene.frameState;\n\n  const view = scene.defaultView;\n  scene.view = view;\n\n  const viewport = view.viewport;\n  viewport.x = 0;\n  viewport.y = 0;\n  viewport.width = context.drawingBufferWidth;\n  viewport.height = context.drawingBufferHeight;\n\n  let passState = view.passState;\n  passState.viewport = BoundingRectangle.clone(viewport, passState.viewport);\n\n  const drawingBufferPosition = SceneTransforms.transformWindowToDrawingBuffer(\n    scene,\n    windowPosition,\n    scratchPosition\n  );\n\n  scene.jobScheduler.disableThisFrame();\n\n  scene.updateFrameState();\n  frameState.cullingVolume = getPickCullingVolume(\n    scene,\n    drawingBufferPosition,\n    scratchRectangleWidth,\n    scratchRectangleHeight,\n    viewport\n  );\n  frameState.invertClassification = false;\n  frameState.passes.pick = true;\n  frameState.tilesetPassState = pickTilesetPassState;\n\n  us.update(frameState);\n\n  scene.updateEnvironment();\n\n  scratchRectangle.x =\n    drawingBufferPosition.x - (scratchRectangleWidth - 1.0) * 0.5;\n  scratchRectangle.y =\n    scene.drawingBufferHeight -\n    drawingBufferPosition.y -\n    (scratchRectangleHeight - 1.0) * 0.5;\n  scratchRectangle.width = scratchRectangleWidth;\n  scratchRectangle.height = scratchRectangleHeight;\n  passState = view.pickFramebuffer.begin(scratchRectangle, view.viewport);\n\n  scene.updateAndExecuteCommands(passState, scratchColorZero);\n  scene.resolveFramebuffers(passState);\n\n  const object = view.pickFramebuffer.end(scratchRectangle);\n  context.endFrame();\n  return object;\n};\n\nfunction renderTranslucentDepthForPick(scene, drawingBufferPosition) {\n  // PERFORMANCE_IDEA: render translucent only and merge with the previous frame\n  const context = scene.context;\n  const frameState = scene.frameState;\n  const environmentState = scene.environmentState;\n\n  const view = scene.defaultView;\n  scene.view = view;\n\n  const viewport = view.viewport;\n  viewport.x = 0;\n  viewport.y = 0;\n  viewport.width = context.drawingBufferWidth;\n  viewport.height = context.drawingBufferHeight;\n\n  let passState = view.passState;\n  passState.viewport = BoundingRectangle.clone(viewport, passState.viewport);\n\n  scene.clearPasses(frameState.passes);\n  frameState.passes.pick = true;\n  frameState.passes.depth = true;\n  frameState.cullingVolume = getPickCullingVolume(\n    scene,\n    drawingBufferPosition,\n    1,\n    1,\n    viewport\n  );\n  frameState.tilesetPassState = pickTilesetPassState;\n\n  scene.updateEnvironment();\n  environmentState.renderTranslucentDepthForPick = true;\n  passState = view.pickDepthFramebuffer.update(\n    context,\n    drawingBufferPosition,\n    viewport\n  );\n\n  scene.updateAndExecuteCommands(passState, scratchColorZero);\n  scene.resolveFramebuffers(passState);\n\n  context.endFrame();\n}\n\nconst scratchPerspectiveFrustum = new PerspectiveFrustum();\nconst scratchPerspectiveOffCenterFrustum = new PerspectiveOffCenterFrustum();\nconst scratchOrthographicFrustum = new OrthographicFrustum();\nconst scratchOrthographicOffCenterFrustum = new OrthographicOffCenterFrustum();\n\nPicking.prototype.pickPositionWorldCoordinates = function (\n  scene,\n  windowPosition,\n  result\n) {\n  if (!scene.useDepthPicking) {\n    return undefined;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(windowPosition)) {\n    throw new DeveloperError(\"windowPosition is undefined.\");\n  }\n  if (!scene.context.depthTexture) {\n    throw new DeveloperError(\n      \"Picking from the depth buffer is not supported. Check pickPositionSupported.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const cacheKey = windowPosition.toString();\n\n  if (this._pickPositionCacheDirty) {\n    this._pickPositionCache = {};\n    this._pickPositionCacheDirty = false;\n  } else if (this._pickPositionCache.hasOwnProperty(cacheKey)) {\n    return Cartesian3.clone(this._pickPositionCache[cacheKey], result);\n  }\n\n  const frameState = scene.frameState;\n  const context = scene.context;\n  const uniformState = context.uniformState;\n\n  const view = scene.defaultView;\n  scene.view = view;\n\n  const drawingBufferPosition = SceneTransforms.transformWindowToDrawingBuffer(\n    scene,\n    windowPosition,\n    scratchPosition\n  );\n  if (scene.pickTranslucentDepth) {\n    renderTranslucentDepthForPick(scene, drawingBufferPosition);\n  } else {\n    scene.updateFrameState();\n    uniformState.update(frameState);\n    scene.updateEnvironment();\n  }\n  drawingBufferPosition.y = scene.drawingBufferHeight - drawingBufferPosition.y;\n\n  const camera = scene.camera;\n\n  // Create a working frustum from the original camera frustum.\n  let frustum;\n  if (defined(camera.frustum.fov)) {\n    frustum = camera.frustum.clone(scratchPerspectiveFrustum);\n  } else if (defined(camera.frustum.infiniteProjectionMatrix)) {\n    frustum = camera.frustum.clone(scratchPerspectiveOffCenterFrustum);\n  } else if (defined(camera.frustum.width)) {\n    frustum = camera.frustum.clone(scratchOrthographicFrustum);\n  } else {\n    frustum = camera.frustum.clone(scratchOrthographicOffCenterFrustum);\n  }\n\n  const frustumCommandsList = view.frustumCommandsList;\n  const numFrustums = frustumCommandsList.length;\n  for (let i = 0; i < numFrustums; ++i) {\n    const pickDepth = this.getPickDepth(scene, i);\n    const depth = pickDepth.getDepth(\n      context,\n      drawingBufferPosition.x,\n      drawingBufferPosition.y\n    );\n    if (!defined(depth)) {\n      continue;\n    }\n    if (depth > 0.0 && depth < 1.0) {\n      const renderedFrustum = frustumCommandsList[i];\n      let height2D;\n      if (scene.mode === SceneMode.SCENE2D) {\n        height2D = camera.position.z;\n        camera.position.z = height2D - renderedFrustum.near + 1.0;\n        frustum.far = Math.max(1.0, renderedFrustum.far - renderedFrustum.near);\n        frustum.near = 1.0;\n        uniformState.update(frameState);\n        uniformState.updateFrustum(frustum);\n      } else {\n        frustum.near =\n          renderedFrustum.near *\n          (i !== 0 ? scene.opaqueFrustumNearOffset : 1.0);\n        frustum.far = renderedFrustum.far;\n        uniformState.updateFrustum(frustum);\n      }\n\n      result = SceneTransforms.drawingBufferToWgs84Coordinates(\n        scene,\n        drawingBufferPosition,\n        depth,\n        result\n      );\n\n      if (scene.mode === SceneMode.SCENE2D) {\n        camera.position.z = height2D;\n        uniformState.update(frameState);\n      }\n\n      this._pickPositionCache[cacheKey] = Cartesian3.clone(result);\n      return result;\n    }\n  }\n\n  this._pickPositionCache[cacheKey] = undefined;\n  return undefined;\n};\n\nconst scratchPickPositionCartographic = new Cartographic();\n\nPicking.prototype.pickPosition = function (scene, windowPosition, result) {\n  result = this.pickPositionWorldCoordinates(scene, windowPosition, result);\n  if (defined(result) && scene.mode !== SceneMode.SCENE3D) {\n    Cartesian3.fromElements(result.y, result.z, result.x, result);\n\n    const projection = scene.mapProjection;\n    const ellipsoid = projection.ellipsoid;\n\n    const cart = projection.unproject(result, scratchPickPositionCartographic);\n    ellipsoid.cartographicToCartesian(cart, result);\n  }\n\n  return result;\n};\n\nfunction drillPick(limit, pickCallback) {\n  // PERFORMANCE_IDEA: This function calls each primitive's update for each pass. Instead\n  // we could update the primitive once, and then just execute their commands for each pass,\n  // and cull commands for picked primitives.  e.g., base on the command's owner.\n  let i;\n  let attributes;\n  const result = [];\n  const pickedPrimitives = [];\n  const pickedAttributes = [];\n  const pickedFeatures = [];\n  if (!defined(limit)) {\n    limit = Number.MAX_VALUE;\n  }\n\n  let pickedResult = pickCallback();\n  while (defined(pickedResult)) {\n    const object = pickedResult.object;\n    const position = pickedResult.position;\n    const exclude = pickedResult.exclude;\n\n    if (defined(position) && !defined(object)) {\n      result.push(pickedResult);\n      break;\n    }\n\n    if (!defined(object) || !defined(object.primitive)) {\n      break;\n    }\n\n    if (!exclude) {\n      result.push(pickedResult);\n      if (0 >= --limit) {\n        break;\n      }\n    }\n\n    const primitive = object.primitive;\n    let hasShowAttribute = false;\n\n    // If the picked object has a show attribute, use it.\n    if (typeof primitive.getGeometryInstanceAttributes === \"function\") {\n      if (defined(object.id)) {\n        attributes = primitive.getGeometryInstanceAttributes(object.id);\n        if (defined(attributes) && defined(attributes.show)) {\n          hasShowAttribute = true;\n          attributes.show = ShowGeometryInstanceAttribute.toValue(\n            false,\n            attributes.show\n          );\n          pickedAttributes.push(attributes);\n        }\n      }\n    }\n\n    if (object instanceof Cesium3DTileFeature) {\n      hasShowAttribute = true;\n      object.show = false;\n      pickedFeatures.push(object);\n    }\n\n    // Otherwise, hide the entire primitive\n    if (!hasShowAttribute) {\n      primitive.show = false;\n      pickedPrimitives.push(primitive);\n    }\n\n    pickedResult = pickCallback();\n  }\n\n  // Unhide everything we hid while drill picking\n  for (i = 0; i < pickedPrimitives.length; ++i) {\n    pickedPrimitives[i].show = true;\n  }\n\n  for (i = 0; i < pickedAttributes.length; ++i) {\n    attributes = pickedAttributes[i];\n    attributes.show = ShowGeometryInstanceAttribute.toValue(\n      true,\n      attributes.show\n    );\n  }\n\n  for (i = 0; i < pickedFeatures.length; ++i) {\n    pickedFeatures[i].show = true;\n  }\n\n  return result;\n}\n\nPicking.prototype.drillPick = function (\n  scene,\n  windowPosition,\n  limit,\n  width,\n  height\n) {\n  const that = this;\n  const pickCallback = function () {\n    const object = that.pick(scene, windowPosition, width, height);\n    if (defined(object)) {\n      return {\n        object: object,\n        position: undefined,\n        exclude: false,\n      };\n    }\n  };\n  const objects = drillPick(limit, pickCallback);\n  return objects.map(function (element) {\n    return element.object;\n  });\n};\n\nconst scratchRight = new Cartesian3();\nconst scratchUp = new Cartesian3();\n\nfunction MostDetailedRayPick(ray, width, tilesets) {\n  this.ray = ray;\n  this.width = width;\n  this.tilesets = tilesets;\n  this.ready = false;\n  const pick = this;\n  this.promise = new Promise((resolve) => {\n    pick._completePick = () => {\n      resolve();\n    };\n  });\n}\n\nfunction updateOffscreenCameraFromRay(picking, ray, width, camera) {\n  const direction = ray.direction;\n  const orthogonalAxis = Cartesian3.mostOrthogonalAxis(direction, scratchRight);\n  const right = Cartesian3.cross(direction, orthogonalAxis, scratchRight);\n  const up = Cartesian3.cross(direction, right, scratchUp);\n\n  camera.position = ray.origin;\n  camera.direction = direction;\n  camera.up = up;\n  camera.right = right;\n\n  camera.frustum.width = defaultValue(width, offscreenDefaultWidth);\n  return camera.frustum.computeCullingVolume(\n    camera.positionWC,\n    camera.directionWC,\n    camera.upWC\n  );\n}\n\nfunction updateMostDetailedRayPick(picking, scene, rayPick) {\n  const frameState = scene.frameState;\n\n  const ray = rayPick.ray;\n  const width = rayPick.width;\n  const tilesets = rayPick.tilesets;\n\n  const camera = picking._pickOffscreenView.camera;\n  const cullingVolume = updateOffscreenCameraFromRay(\n    picking,\n    ray,\n    width,\n    camera\n  );\n\n  const tilesetPassState = mostDetailedPreloadTilesetPassState;\n  tilesetPassState.camera = camera;\n  tilesetPassState.cullingVolume = cullingVolume;\n\n  let ready = true;\n  const tilesetsLength = tilesets.length;\n  for (let i = 0; i < tilesetsLength; ++i) {\n    const tileset = tilesets[i];\n    if (tileset.show && scene.primitives.contains(tileset)) {\n      // Only update tilesets that are still contained in the scene's primitive collection and are still visible\n      // Update tilesets continually until all tilesets are ready. This way tiles are never removed from the cache.\n      tileset.updateForPass(frameState, tilesetPassState);\n      ready = ready && tilesetPassState.ready;\n    }\n  }\n\n  if (ready) {\n    rayPick._completePick();\n  }\n\n  return ready;\n}\n\nPicking.prototype.updateMostDetailedRayPicks = function (scene) {\n  // Modifies array during iteration\n  const rayPicks = this._mostDetailedRayPicks;\n  for (let i = 0; i < rayPicks.length; ++i) {\n    if (updateMostDetailedRayPick(this, scene, rayPicks[i])) {\n      rayPicks.splice(i--, 1);\n    }\n  }\n};\n\nfunction getTilesets(primitives, objectsToExclude, tilesets) {\n  const length = primitives.length;\n  for (let i = 0; i < length; ++i) {\n    const primitive = primitives.get(i);\n    if (primitive.show) {\n      if (defined(primitive.isCesium3DTileset)) {\n        if (\n          !defined(objectsToExclude) ||\n          objectsToExclude.indexOf(primitive) === -1\n        ) {\n          tilesets.push(primitive);\n        }\n      } else if (primitive instanceof PrimitiveCollection) {\n        getTilesets(primitive, objectsToExclude, tilesets);\n      }\n    }\n  }\n}\n\nfunction launchMostDetailedRayPick(\n  picking,\n  scene,\n  ray,\n  objectsToExclude,\n  width,\n  callback\n) {\n  const tilesets = [];\n  getTilesets(scene.primitives, objectsToExclude, tilesets);\n  if (tilesets.length === 0) {\n    return Promise.resolve(callback());\n  }\n\n  const rayPick = new MostDetailedRayPick(ray, width, tilesets);\n  picking._mostDetailedRayPicks.push(rayPick);\n  return rayPick.promise.then(function () {\n    return callback();\n  });\n}\n\nfunction isExcluded(object, objectsToExclude) {\n  if (\n    !defined(object) ||\n    !defined(objectsToExclude) ||\n    objectsToExclude.length === 0\n  ) {\n    return false;\n  }\n  return (\n    objectsToExclude.indexOf(object) > -1 ||\n    objectsToExclude.indexOf(object.primitive) > -1 ||\n    objectsToExclude.indexOf(object.id) > -1\n  );\n}\n\nfunction getRayIntersection(\n  picking,\n  scene,\n  ray,\n  objectsToExclude,\n  width,\n  requirePosition,\n  mostDetailed\n) {\n  const context = scene.context;\n  const uniformState = context.uniformState;\n  const frameState = scene.frameState;\n\n  const view = picking._pickOffscreenView;\n  scene.view = view;\n\n  updateOffscreenCameraFromRay(picking, ray, width, view.camera);\n\n  scratchRectangle = BoundingRectangle.clone(view.viewport, scratchRectangle);\n\n  const passState = view.pickFramebuffer.begin(scratchRectangle, view.viewport);\n\n  scene.jobScheduler.disableThisFrame();\n\n  scene.updateFrameState();\n  frameState.invertClassification = false;\n  frameState.passes.pick = true;\n  frameState.passes.offscreen = true;\n\n  if (mostDetailed) {\n    frameState.tilesetPassState = mostDetailedPickTilesetPassState;\n  } else {\n    frameState.tilesetPassState = pickTilesetPassState;\n  }\n\n  uniformState.update(frameState);\n\n  scene.updateEnvironment();\n  scene.updateAndExecuteCommands(passState, scratchColorZero);\n  scene.resolveFramebuffers(passState);\n\n  let position;\n  const object = view.pickFramebuffer.end(scratchRectangle);\n\n  if (scene.context.depthTexture) {\n    const numFrustums = view.frustumCommandsList.length;\n    for (let i = 0; i < numFrustums; ++i) {\n      const pickDepth = picking.getPickDepth(scene, i);\n      const depth = pickDepth.getDepth(context, 0, 0);\n      if (!defined(depth)) {\n        continue;\n      }\n      if (depth > 0.0 && depth < 1.0) {\n        const renderedFrustum = view.frustumCommandsList[i];\n        const near =\n          renderedFrustum.near *\n          (i !== 0 ? scene.opaqueFrustumNearOffset : 1.0);\n        const far = renderedFrustum.far;\n        const distance = near + depth * (far - near);\n        position = Ray.getPoint(ray, distance);\n        break;\n      }\n    }\n  }\n\n  scene.view = scene.defaultView;\n  context.endFrame();\n\n  if (defined(object) || defined(position)) {\n    return {\n      object: object,\n      position: position,\n      exclude:\n        (!defined(position) && requirePosition) ||\n        isExcluded(object, objectsToExclude),\n    };\n  }\n}\n\nfunction getRayIntersections(\n  picking,\n  scene,\n  ray,\n  limit,\n  objectsToExclude,\n  width,\n  requirePosition,\n  mostDetailed\n) {\n  const pickCallback = function () {\n    return getRayIntersection(\n      picking,\n      scene,\n      ray,\n      objectsToExclude,\n      width,\n      requirePosition,\n      mostDetailed\n    );\n  };\n  return drillPick(limit, pickCallback);\n}\n\nfunction pickFromRay(\n  picking,\n  scene,\n  ray,\n  objectsToExclude,\n  width,\n  requirePosition,\n  mostDetailed\n) {\n  const results = getRayIntersections(\n    picking,\n    scene,\n    ray,\n    1,\n    objectsToExclude,\n    width,\n    requirePosition,\n    mostDetailed\n  );\n  if (results.length > 0) {\n    return results[0];\n  }\n}\n\nfunction drillPickFromRay(\n  picking,\n  scene,\n  ray,\n  limit,\n  objectsToExclude,\n  width,\n  requirePosition,\n  mostDetailed\n) {\n  return getRayIntersections(\n    picking,\n    scene,\n    ray,\n    limit,\n    objectsToExclude,\n    width,\n    requirePosition,\n    mostDetailed\n  );\n}\n\nfunction deferPromiseUntilPostRender(scene, promise) {\n  // Resolve promise after scene's postRender in case entities are created when the promise resolves.\n  // Entities can't be created between viewer._onTick and viewer._postRender.\n  return new Promise((resolve, reject) => {\n    promise\n      .then(function (result) {\n        const removeCallback = scene.postRender.addEventListener(function () {\n          removeCallback();\n          resolve(result);\n        });\n        scene.requestRender();\n      })\n      .catch(function (error) {\n        reject(error);\n      });\n  });\n}\n\nPicking.prototype.pickFromRay = function (scene, ray, objectsToExclude, width) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"ray\", ray);\n  if (scene.mode !== SceneMode.SCENE3D) {\n    throw new DeveloperError(\n      \"Ray intersections are only supported in 3D mode.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  return pickFromRay(this, scene, ray, objectsToExclude, width, false, false);\n};\n\nPicking.prototype.drillPickFromRay = function (\n  scene,\n  ray,\n  limit,\n  objectsToExclude,\n  width\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"ray\", ray);\n  if (scene.mode !== SceneMode.SCENE3D) {\n    throw new DeveloperError(\n      \"Ray intersections are only supported in 3D mode.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  return drillPickFromRay(\n    this,\n    scene,\n    ray,\n    limit,\n    objectsToExclude,\n    width,\n    false,\n    false\n  );\n};\n\nPicking.prototype.pickFromRayMostDetailed = function (\n  scene,\n  ray,\n  objectsToExclude,\n  width\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"ray\", ray);\n  if (scene.mode !== SceneMode.SCENE3D) {\n    throw new DeveloperError(\n      \"Ray intersections are only supported in 3D mode.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const that = this;\n  ray = Ray.clone(ray);\n  objectsToExclude = defined(objectsToExclude)\n    ? objectsToExclude.slice()\n    : objectsToExclude;\n  return deferPromiseUntilPostRender(\n    scene,\n    launchMostDetailedRayPick(\n      that,\n      scene,\n      ray,\n      objectsToExclude,\n      width,\n      function () {\n        return pickFromRay(\n          that,\n          scene,\n          ray,\n          objectsToExclude,\n          width,\n          false,\n          true\n        );\n      }\n    )\n  );\n};\n\nPicking.prototype.drillPickFromRayMostDetailed = function (\n  scene,\n  ray,\n  limit,\n  objectsToExclude,\n  width\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"ray\", ray);\n  if (scene.mode !== SceneMode.SCENE3D) {\n    throw new DeveloperError(\n      \"Ray intersections are only supported in 3D mode.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const that = this;\n  ray = Ray.clone(ray);\n  objectsToExclude = defined(objectsToExclude)\n    ? objectsToExclude.slice()\n    : objectsToExclude;\n  return deferPromiseUntilPostRender(\n    scene,\n    launchMostDetailedRayPick(\n      that,\n      scene,\n      ray,\n      objectsToExclude,\n      width,\n      function () {\n        return drillPickFromRay(\n          that,\n          scene,\n          ray,\n          limit,\n          objectsToExclude,\n          width,\n          false,\n          true\n        );\n      }\n    )\n  );\n};\n\nconst scratchSurfacePosition = new Cartesian3();\nconst scratchSurfaceNormal = new Cartesian3();\nconst scratchSurfaceRay = new Ray();\nconst scratchCartographic = new Cartographic();\n\nfunction getRayForSampleHeight(scene, cartographic) {\n  const globe = scene.globe;\n  const ellipsoid = defined(globe)\n    ? globe.ellipsoid\n    : scene.mapProjection.ellipsoid;\n  const height = ApproximateTerrainHeights._defaultMaxTerrainHeight;\n  const surfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic(\n    cartographic,\n    scratchSurfaceNormal\n  );\n  const surfacePosition = Cartographic.toCartesian(\n    cartographic,\n    ellipsoid,\n    scratchSurfacePosition\n  );\n  const surfaceRay = scratchSurfaceRay;\n  surfaceRay.origin = surfacePosition;\n  surfaceRay.direction = surfaceNormal;\n  const ray = new Ray();\n  Ray.getPoint(surfaceRay, height, ray.origin);\n  Cartesian3.negate(surfaceNormal, ray.direction);\n  return ray;\n}\n\nfunction getRayForClampToHeight(scene, cartesian) {\n  const globe = scene.globe;\n  const ellipsoid = defined(globe)\n    ? globe.ellipsoid\n    : scene.mapProjection.ellipsoid;\n  const cartographic = Cartographic.fromCartesian(\n    cartesian,\n    ellipsoid,\n    scratchCartographic\n  );\n  return getRayForSampleHeight(scene, cartographic);\n}\n\nfunction getHeightFromCartesian(scene, cartesian) {\n  const globe = scene.globe;\n  const ellipsoid = defined(globe)\n    ? globe.ellipsoid\n    : scene.mapProjection.ellipsoid;\n  const cartographic = Cartographic.fromCartesian(\n    cartesian,\n    ellipsoid,\n    scratchCartographic\n  );\n  return cartographic.height;\n}\n\nfunction sampleHeightMostDetailed(\n  picking,\n  scene,\n  cartographic,\n  objectsToExclude,\n  width\n) {\n  const ray = getRayForSampleHeight(scene, cartographic);\n  return launchMostDetailedRayPick(\n    picking,\n    scene,\n    ray,\n    objectsToExclude,\n    width,\n    function () {\n      const pickResult = pickFromRay(\n        picking,\n        scene,\n        ray,\n        objectsToExclude,\n        width,\n        true,\n        true\n      );\n      if (defined(pickResult)) {\n        return getHeightFromCartesian(scene, pickResult.position);\n      }\n    }\n  );\n}\n\nfunction clampToHeightMostDetailed(\n  picking,\n  scene,\n  cartesian,\n  objectsToExclude,\n  width,\n  result\n) {\n  const ray = getRayForClampToHeight(scene, cartesian);\n  return launchMostDetailedRayPick(\n    picking,\n    scene,\n    ray,\n    objectsToExclude,\n    width,\n    function () {\n      const pickResult = pickFromRay(\n        picking,\n        scene,\n        ray,\n        objectsToExclude,\n        width,\n        true,\n        true\n      );\n      if (defined(pickResult)) {\n        return Cartesian3.clone(pickResult.position, result);\n      }\n    }\n  );\n}\n\nPicking.prototype.sampleHeight = function (\n  scene,\n  position,\n  objectsToExclude,\n  width\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"position\", position);\n  if (scene.mode !== SceneMode.SCENE3D) {\n    throw new DeveloperError(\"sampleHeight is only supported in 3D mode.\");\n  }\n  if (!scene.sampleHeightSupported) {\n    throw new DeveloperError(\n      \"sampleHeight requires depth texture support. Check sampleHeightSupported.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const ray = getRayForSampleHeight(scene, position);\n  const pickResult = pickFromRay(\n    this,\n    scene,\n    ray,\n    objectsToExclude,\n    width,\n    true,\n    false\n  );\n  if (defined(pickResult)) {\n    return getHeightFromCartesian(scene, pickResult.position);\n  }\n};\n\nPicking.prototype.clampToHeight = function (\n  scene,\n  cartesian,\n  objectsToExclude,\n  width,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartesian\", cartesian);\n  if (scene.mode !== SceneMode.SCENE3D) {\n    throw new DeveloperError(\"clampToHeight is only supported in 3D mode.\");\n  }\n  if (!scene.clampToHeightSupported) {\n    throw new DeveloperError(\n      \"clampToHeight requires depth texture support. Check clampToHeightSupported.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const ray = getRayForClampToHeight(scene, cartesian);\n  const pickResult = pickFromRay(\n    this,\n    scene,\n    ray,\n    objectsToExclude,\n    width,\n    true,\n    false\n  );\n  if (defined(pickResult)) {\n    return Cartesian3.clone(pickResult.position, result);\n  }\n};\n\nPicking.prototype.sampleHeightMostDetailed = function (\n  scene,\n  positions,\n  objectsToExclude,\n  width\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"positions\", positions);\n  if (scene.mode !== SceneMode.SCENE3D) {\n    throw new DeveloperError(\n      \"sampleHeightMostDetailed is only supported in 3D mode.\"\n    );\n  }\n  if (!scene.sampleHeightSupported) {\n    throw new DeveloperError(\n      \"sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  objectsToExclude = defined(objectsToExclude)\n    ? objectsToExclude.slice()\n    : objectsToExclude;\n  const length = positions.length;\n  const promises = new Array(length);\n  for (let i = 0; i < length; ++i) {\n    promises[i] = sampleHeightMostDetailed(\n      this,\n      scene,\n      positions[i],\n      objectsToExclude,\n      width\n    );\n  }\n  return deferPromiseUntilPostRender(\n    scene,\n    Promise.all(promises).then(function (heights) {\n      const length = heights.length;\n      for (let i = 0; i < length; ++i) {\n        positions[i].height = heights[i];\n      }\n      return positions;\n    })\n  );\n};\n\nPicking.prototype.clampToHeightMostDetailed = function (\n  scene,\n  cartesians,\n  objectsToExclude,\n  width\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"cartesians\", cartesians);\n  if (scene.mode !== SceneMode.SCENE3D) {\n    throw new DeveloperError(\n      \"clampToHeightMostDetailed is only supported in 3D mode.\"\n    );\n  }\n  if (!scene.clampToHeightSupported) {\n    throw new DeveloperError(\n      \"clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  objectsToExclude = defined(objectsToExclude)\n    ? objectsToExclude.slice()\n    : objectsToExclude;\n  const length = cartesians.length;\n  const promises = new Array(length);\n  for (let i = 0; i < length; ++i) {\n    promises[i] = clampToHeightMostDetailed(\n      this,\n      scene,\n      cartesians[i],\n      objectsToExclude,\n      width,\n      cartesians[i]\n    );\n  }\n  return deferPromiseUntilPostRender(\n    scene,\n    Promise.all(promises).then(function (clampedCartesians) {\n      const length = clampedCartesians.length;\n      for (let i = 0; i < length; ++i) {\n        cartesians[i] = clampedCartesians[i];\n      }\n      return cartesians;\n    })\n  );\n};\n\nPicking.prototype.destroy = function () {\n  this._pickOffscreenView =\n    this._pickOffscreenView && this._pickOffscreenView.destroy();\n};\nexport default Picking;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\nuniform sampler2D autoExposure;\\n\\\n#endif\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);\\n\\\n    vec3 color = fragmentColor.rgb;\\n\\\n\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\n    color /= texture(autoExposure, vec2(0.5)).r;\\n\\\n#endif\\n\\\n    color = czm_acesTonemapping(color);\\n\\\n    color = czm_inverseGamma(color);\\n\\\n\\n\\\n    out_FragColor = vec4(color, fragmentColor.a);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D randomTexture;\\n\\\nuniform sampler2D depthTexture;\\n\\\nuniform float intensity;\\n\\\nuniform float bias;\\n\\\nuniform float lengthCap;\\n\\\nuniform float stepSize;\\n\\\nuniform float frustumLength;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvec4 clipToEye(vec2 uv, float depth)\\n\\\n{\\n\\\n    vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\\n\\\n    vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);\\n\\\n    posEC = posEC / posEC.w;\\n\\\n    return posEC;\\n\\\n}\\n\\\n\\n\\\n//Reconstruct Normal Without Edge Removation\\n\\\nvec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize)\\n\\\n{\\n\\\n    vec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU);\\n\\\n    vec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD);\\n\\\n    vec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL);\\n\\\n    vec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR);\\n\\\n\\n\\\n    vec3 up = posInCamera.xyz - posInCameraUp.xyz;\\n\\\n    vec3 down = posInCameraDown.xyz - posInCamera.xyz;\\n\\\n    vec3 left = posInCamera.xyz - posInCameraLeft.xyz;\\n\\\n    vec3 right = posInCameraRight.xyz - posInCamera.xyz;\\n\\\n\\n\\\n    vec3 DX = length(left) < length(right) ? left : right;\\n\\\n    vec3 DY = length(up) < length(down) ? up : down;\\n\\\n\\n\\\n    return normalize(cross(DY, DX));\\n\\\n}\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n    float depth = czm_readDepth(depthTexture, v_textureCoordinates);\\n\\\n    vec4 posInCamera = clipToEye(v_textureCoordinates, depth);\\n\\\n\\n\\\n    if (posInCamera.z > frustumLength)\\n\\\n    {\\n\\\n        out_FragColor = vec4(1.0);\\n\\\n        return;\\n\\\n    }\\n\\\n\\n\\\n    vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\\n\\\n    float depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y));\\n\\\n    float depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y));\\n\\\n    float depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0));\\n\\\n    float depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0));\\n\\\n    vec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize);\\n\\\n\\n\\\n    float ao = 0.0;\\n\\\n    vec2 sampleDirection = vec2(1.0, 0.0);\\n\\\n    float gapAngle = 90.0 * czm_radiansPerDegree;\\n\\\n\\n\\\n    // RandomNoise\\n\\\n    float randomVal = texture(randomTexture, v_textureCoordinates / pixelSize / 255.0).x;\\n\\\n\\n\\\n    //Loop for each direction\\n\\\n    for (int i = 0; i < 4; i++)\\n\\\n    {\\n\\\n        float newGapAngle = gapAngle * (float(i) + randomVal);\\n\\\n        float cosVal = cos(newGapAngle);\\n\\\n        float sinVal = sin(newGapAngle);\\n\\\n\\n\\\n        //Rotate Sampling Direction\\n\\\n        vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y);\\n\\\n        float localAO = 0.0;\\n\\\n        float localStepSize = stepSize;\\n\\\n\\n\\\n        //Loop for each step\\n\\\n        for (int j = 0; j < 6; j++)\\n\\\n        {\\n\\\n            vec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize;\\n\\\n\\n\\\n            //Exception Handling\\n\\\n            if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0)\\n\\\n            {\\n\\\n                break;\\n\\\n            }\\n\\\n\\n\\\n            float stepDepthInfo = czm_readDepth(depthTexture, newCoords);\\n\\\n            vec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo);\\n\\\n            vec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz;\\n\\\n            float len = length(diffVec);\\n\\\n\\n\\\n            if (len > lengthCap)\\n\\\n            {\\n\\\n                break;\\n\\\n            }\\n\\\n\\n\\\n            float dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 );\\n\\\n            float weight = len / lengthCap;\\n\\\n            weight = 1.0 - weight * weight;\\n\\\n\\n\\\n            if (dotVal < bias)\\n\\\n            {\\n\\\n                dotVal = 0.0;\\n\\\n            }\\n\\\n\\n\\\n            localAO = max(localAO, dotVal * weight);\\n\\\n            localStepSize += stepSize;\\n\\\n        }\\n\\\n        ao += localAO;\\n\\\n    }\\n\\\n\\n\\\n    ao /= 4.0;\\n\\\n    ao = 1.0 - clamp(ao, 0.0, 1.0);\\n\\\n    ao = pow(ao, intensity);\\n\\\n    out_FragColor = vec4(vec3(ao), 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform sampler2D ambientOcclusionTexture;\\n\\\nuniform bool ambientOcclusionOnly;\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n    vec4 color = texture(colorTexture, v_textureCoordinates);\\n\\\n    vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates);\\n\\\n    out_FragColor = ambientOcclusionOnly ? ao : ao * color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform float gradations;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n    vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;\\n\\\n#ifdef CZM_SELECTED_FEATURE\\n\\\n    if (czm_selected()) {\\n\\\n        out_FragColor = vec4(rgb, 1.0);\\n\\\n        return;\\n\\\n    }\\n\\\n#endif\\n\\\n    float luminance = czm_luminance(rgb);\\n\\\n    float darkness = luminance * gradations;\\n\\\n    darkness = (darkness - fract(darkness)) / gradations;\\n\\\n    out_FragColor = vec4(vec3(darkness), 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform sampler2D bloomTexture;\\n\\\nuniform bool glowOnly;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n    vec4 color = texture(colorTexture, v_textureCoordinates);\\n\\\n\\n\\\n#ifdef CZM_SELECTED_FEATURE\\n\\\n    if (czm_selected()) {\\n\\\n        out_FragColor = color;\\n\\\n        return;\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n    vec4 bloom = texture(bloomTexture, v_textureCoordinates);\\n\\\n    out_FragColor = glowOnly ? bloom : bloom + color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform float brightness;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n    vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;\\n\\\n    vec3 target = vec3(0.0);\\n\\\n    out_FragColor = vec4(mix(target, rgb, brightness), 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform float contrast;\\n\\\nuniform float brightness;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n    vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz;\\n\\\n    sceneColor = czm_RGBToHSB(sceneColor);\\n\\\n    sceneColor.z += brightness;\\n\\\n    sceneColor = czm_HSBToRGB(sceneColor);\\n\\\n\\n\\\n    float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));\\n\\\n    sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);\\n\\\n    out_FragColor = vec4(sceneColor, 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform sampler2D blurTexture;\\n\\\nuniform sampler2D depthTexture;\\n\\\nuniform float focalDistance;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvec4 toEye(vec2 uv, float depth)\\n\\\n{\\n\\\n   vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\\n\\\n   vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\\n\\\n   posInCamera = posInCamera / posInCamera.w;\\n\\\n   return posInCamera;\\n\\\n}\\n\\\n\\n\\\nfloat computeDepthBlur(float depth)\\n\\\n{\\n\\\n    float f;\\n\\\n    if (depth < focalDistance)\\n\\\n    {\\n\\\n        f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);\\n\\\n        f = pow(f, 0.1);\\n\\\n    }\\n\\\n    f *= f;\\n\\\n    f = clamp(f, 0.0, 1.0);\\n\\\n    return pow(f, 0.5);\\n\\\n}\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n    float depth = czm_readDepth(depthTexture, v_textureCoordinates);\\n\\\n    vec4 posInCamera = toEye(v_textureCoordinates, depth);\\n\\\n    float d = computeDepthBlur(-posInCamera.z);\\n\\\n    out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D depthTexture;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n    float depth = czm_readDepth(depthTexture, v_textureCoordinates);\\n\\\n    out_FragColor = vec4(vec3(depth), 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D depthTexture;\\n\\\nuniform float length;\\n\\\nuniform vec4 color;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n    float directions[3];\\n\\\n    directions[0] = -1.0;\\n\\\n    directions[1] = 0.0;\\n\\\n    directions[2] = 1.0;\\n\\\n\\n\\\n    float scalars[3];\\n\\\n    scalars[0] = 3.0;\\n\\\n    scalars[1] = 10.0;\\n\\\n    scalars[2] = 3.0;\\n\\\n\\n\\\n    float padx = czm_pixelRatio / czm_viewport.z;\\n\\\n    float pady = czm_pixelRatio / czm_viewport.w;\\n\\\n\\n\\\n#ifdef CZM_SELECTED_FEATURE\\n\\\n    bool selected = false;\\n\\\n    for (int i = 0; i < 3; ++i)\\n\\\n    {\\n\\\n        float dir = directions[i];\\n\\\n        selected = selected || czm_selected(vec2(-padx, dir * pady));\\n\\\n        selected = selected || czm_selected(vec2(padx, dir * pady));\\n\\\n        selected = selected || czm_selected(vec2(dir * padx, -pady));\\n\\\n        selected = selected || czm_selected(vec2(dir * padx, pady));\\n\\\n        if (selected)\\n\\\n        {\\n\\\n            break;\\n\\\n        }\\n\\\n    }\\n\\\n    if (!selected)\\n\\\n    {\\n\\\n        out_FragColor = vec4(color.rgb, 0.0);\\n\\\n        return;\\n\\\n    }\\n\\\n#endif\\n\\\n\\n\\\n    float horizEdge = 0.0;\\n\\\n    float vertEdge = 0.0;\\n\\\n\\n\\\n    for (int i = 0; i < 3; ++i)\\n\\\n    {\\n\\\n        float dir = directions[i];\\n\\\n        float scale = scalars[i];\\n\\\n\\n\\\n        horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;\\n\\\n        horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;\\n\\\n\\n\\\n        vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;\\n\\\n        vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;\\n\\\n    }\\n\\\n\\n\\\n    float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);\\n\\\n    out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\nuniform sampler2D autoExposure;\\n\\\n#endif\\n\\\n\\n\\\n// See slides 142 and 143:\\n\\\n//     http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);\\n\\\n    vec3 color = fragmentColor.rgb;\\n\\\n\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\n    float exposure = texture(autoExposure, vec2(0.5)).r;\\n\\\n    color /= exposure;\\n\\\n#endif\\n\\\n\\n\\\n\tconst float A = 0.22; // shoulder strength\\n\\\n\tconst float B = 0.30; // linear strength\\n\\\n\tconst float C = 0.10; // linear angle\\n\\\n\tconst float D = 0.20; // toe strength\\n\\\n\tconst float E = 0.01; // toe numerator\\n\\\n\tconst float F = 0.30; // toe denominator\\n\\\n\\n\\\n\tconst float white = 11.2; // linear white point value\\n\\\n\\n\\\n\tvec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;\\n\\\n\tfloat w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;\\n\\\n\\n\\\n\tc = czm_inverseGamma(c / w);\\n\\\n\tout_FragColor = vec4(c, fragmentColor.a);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec2 v_textureCoordinates;\\n\\\n\\n\\\nuniform sampler2D colorTexture;\\n\\\n\\n\\\nconst float fxaaQualitySubpix = 0.5;\\n\\\nconst float fxaaQualityEdgeThreshold = 0.125;\\n\\\nconst float fxaaQualityEdgeThresholdMin = 0.0833;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;\\n\\\n    vec4 color = FxaaPixelShader(\\n\\\n        v_textureCoordinates,\\n\\\n        colorTexture,\\n\\\n        fxaaQualityRcpFrame,\\n\\\n        fxaaQualitySubpix,\\n\\\n        fxaaQualityEdgeThreshold,\\n\\\n        fxaaQualityEdgeThresholdMin);\\n\\\n    float alpha = texture(colorTexture, v_textureCoordinates).a;\\n\\\n    out_FragColor = vec4(color.rgb, alpha);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#define SAMPLES 8\\n\\\n\\n\\\nuniform float delta;\\n\\\nuniform float sigma;\\n\\\nuniform float direction; // 0.0 for x direction, 1.0 for y direction\\n\\\n\\n\\\nuniform sampler2D colorTexture;\\n\\\n\\n\\\n#ifdef USE_STEP_SIZE\\n\\\nuniform float stepSize;\\n\\\n#else\\n\\\nuniform vec2 step;\\n\\\n#endif\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\n//  Incremental Computation of the Gaussian:\\n\\\n//  https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec2 st = v_textureCoordinates;\\n\\\n    vec2 dir = vec2(1.0 - direction, direction);\\n\\\n\\n\\\n#ifdef USE_STEP_SIZE\\n\\\n    vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));\\n\\\n#else\\n\\\n    vec2 step = step;\\n\\\n#endif\\n\\\n\\n\\\n    vec3 g;\\n\\\n    g.x = 1.0 / (sqrt(czm_twoPi) * sigma);\\n\\\n    g.y = exp((-0.5 * delta * delta) / (sigma * sigma));\\n\\\n    g.z = g.y * g.y;\\n\\\n\\n\\\n    vec4 result = texture(colorTexture, st) * g.x;\\n\\\n    for (int i = 1; i < SAMPLES; ++i)\\n\\\n    {\\n\\\n        g.xy *= g.yz;\\n\\\n\\n\\\n        vec2 offset = float(i) * dir * step;\\n\\\n        result += texture(colorTexture, st - offset) * g.x;\\n\\\n        result += texture(colorTexture, st + offset) * g.x;\\n\\\n    }\\n\\\n\\n\\\n    out_FragColor = result;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform sampler2D dirtTexture;\\n\\\nuniform sampler2D starTexture;\\n\\\nuniform vec2 dirtTextureDimensions;\\n\\\nuniform float distortion;\\n\\\nuniform float ghostDispersal;\\n\\\nuniform float haloWidth;\\n\\\nuniform float dirtAmount;\\n\\\nuniform float earthRadius;\\n\\\nuniform float intensity;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\n// whether it is in space or not\\n\\\n// 6500000.0 is empirical value\\n\\\n#define DISTANCE_TO_SPACE 6500000.0\\n\\\n\\n\\\n// return ndc from world coordinate biased earthRadius\\n\\\nvec4 getNDCFromWC(vec3 WC, float earthRadius)\\n\\\n{\\n\\\n    vec4 positionEC = czm_view * vec4(WC, 1.0);\\n\\\n    positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);\\n\\\n    vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\\n\\\n    return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\\n\\\n}\\n\\\n\\n\\\n// Check if current pixel is included Earth\\n\\\n// if then mask it gradually\\n\\\nfloat isInEarth(vec2 texcoord, vec2 sceneSize)\\n\\\n{\\n\\\n    vec2 NDC = texcoord * 2.0 - 1.0;\\n\\\n    vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);\\n\\\n    vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);\\n\\\n    NDC.xy -= earthPosSC.xy;\\n\\\n\\n\\\n    float X = abs(NDC.x) * sceneSize.x;\\n\\\n    float Y = abs(NDC.y) * sceneSize.y;\\n\\\n\\n\\\n    return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));\\n\\\n}\\n\\\n\\n\\\n// For Chromatic effect\\n\\\nvec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)\\n\\\n{\\n\\\n    vec2 sceneSize = czm_viewport.zw;\\n\\\n    vec3 color;\\n\\\n    if(isSpace)\\n\\\n    {\\n\\\n        color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r;\\n\\\n        color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g;\\n\\\n        color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b;\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        color.r = texture(tex, texcoord + direction * distortion.r).r;\\n\\\n        color.g = texture(tex, texcoord + direction * distortion.g).g;\\n\\\n        color.b = texture(tex, texcoord + direction * distortion.b).b;\\n\\\n    }\\n\\\n    return vec4(clamp(color, 0.0, 1.0), 0.0);\\n\\\n}\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n    vec4 originalColor = texture(colorTexture, v_textureCoordinates);\\n\\\n    vec3 rgb = originalColor.rgb;\\n\\\n    bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;\\n\\\n\\n\\\n    // Sun position\\n\\\n    vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);\\n\\\n    vec4 sunPositionEC = czm_view * sunPos;\\n\\\n    vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);\\n\\\n    sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);\\n\\\n\\n\\\n    // If sun is not in the screen space, use original color.\\n\\\n    if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))\\n\\\n    {\\n\\\n        // Lens flare is disabled when not in space until #5932 is fixed.\\n\\\n        //    https://github.com/CesiumGS/cesium/issues/5932\\n\\\n        out_FragColor = originalColor;\\n\\\n        return;\\n\\\n    }\\n\\\n\\n\\\n    vec2 texcoord = vec2(1.0) - v_textureCoordinates;\\n\\\n    vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\\n\\\n    vec2 invPixelSize = 1.0 / pixelSize;\\n\\\n    vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);\\n\\\n\\n\\\n    // ghost vector to image centre:\\n\\\n    vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;\\n\\\n    vec3 direction = normalize(vec3(ghostVec, 0.0));\\n\\\n\\n\\\n    // sample ghosts:\\n\\\n    vec4 result = vec4(0.0);\\n\\\n    vec4 ghost = vec4(0.0);\\n\\\n    for (int i = 0; i < 4; ++i)\\n\\\n    {\\n\\\n        vec2 offset = fract(texcoord + ghostVec * float(i));\\n\\\n        // Only bright spots from the centre of the source image\\n\\\n        ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);\\n\\\n    }\\n\\\n    result += ghost;\\n\\\n\\n\\\n    // sample halo\\n\\\n    vec2 haloVec = normalize(ghostVec) * haloWidth;\\n\\\n    float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\\n\\\n    weightForHalo = pow(1.0 - weightForHalo, 5.0);\\n\\\n\\n\\\n    result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;\\n\\\n\\n\\\n    // dirt on lens\\n\\\n    vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;\\n\\\n    if (dirtTexCoords.x > 1.0)\\n\\\n    {\\n\\\n        dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) :  fract(dirtTexCoords.x);\\n\\\n    }\\n\\\n    if (dirtTexCoords.y > 1.0)\\n\\\n    {\\n\\\n        dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) :  fract(dirtTexCoords.y);\\n\\\n    }\\n\\\n    result += dirtAmount * texture(dirtTexture, dirtTexCoords);\\n\\\n\\n\\\n    // Rotating starburst texture's coordinate\\n\\\n    // dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0))\\n\\\n    float camrot = czm_view[0].z + czm_view[1].y;\\n\\\n    float cosValue = cos(camrot);\\n\\\n    float sinValue = sin(camrot);\\n\\\n    mat3 rotation = mat3(\\n\\\n        cosValue, -sinValue, 0.0,\\n\\\n        sinValue, cosValue, 0.0,\\n\\\n        0.0, 0.0, 1.0\\n\\\n    );\\n\\\n\\n\\\n    vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);\\n\\\n    vec3 st2 = vec3((rotation * st1).xy, 1.0);\\n\\\n    vec3 st3 = st2 * 0.5 + vec3(0.5);\\n\\\n    vec2 lensStarTexcoord = st3.xy;\\n\\\n    float weightForLensFlare = length(vec3(sunPos.xy, 0.0));\\n\\\n    float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);\\n\\\n\\n\\\n    if (!isSpace)\\n\\\n    {\\n\\\n        result *= oneMinusWeightForLensFlare * intensity * 0.2;\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        result *= oneMinusWeightForLensFlare * intensity;\\n\\\n        result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;\\n\\\n    }\\n\\\n\\n\\\n    result += texture(colorTexture, v_textureCoordinates);\\n\\\n\\n\\\n    out_FragColor = result;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform vec3 white;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\nuniform sampler2D autoExposure;\\n\\\n#endif\\n\\\n\\n\\\n// See equation 4:\\n\\\n//    http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);\\n\\\n    vec3 color = fragmentColor.rgb;\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\n    float exposure = texture(autoExposure, vec2(0.5)).r;\\n\\\n    color /= exposure;\\n\\\n#endif\\n\\\n    color = (color * (1.0 + color / white)) / (1.0 + color);\\n\\\n    color = czm_inverseGamma(color);\\n\\\n    out_FragColor = vec4(color, fragmentColor.a);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nfloat rand(vec2 co)\\n\\\n{\\n\\\n    return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);\\n\\\n}\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n    float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;\\n\\\n    vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;\\n\\\n    vec3 green = vec3(0.0, 1.0, 0.0);\\n\\\n    out_FragColor = vec4((noiseValue + rgb) * green, 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\nuniform sampler2D autoExposure;\\n\\\n#endif\\n\\\n\\n\\\n// See equation 3:\\n\\\n//    http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);\\n\\\n    vec3 color = fragmentColor.rgb;\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\n    float exposure = texture(autoExposure, vec2(0.5)).r;\\n\\\n    color /= exposure;\\n\\\n#endif\\n\\\n    color = color / (1.0 + color);\\n\\\n    color = czm_inverseGamma(color);\\n\\\n    out_FragColor = vec4(color, fragmentColor.a);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform sampler2D silhouetteTexture;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n    vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);\\n\\\n    vec4 color = texture(colorTexture, v_textureCoordinates);\\n\\\n    out_FragColor = mix(color, silhouetteColor, silhouetteColor.a);\\n\\\n}\\n\\\n\";\n", "/**\n * @license\n * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *  * Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *  * Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *  * Neither the name of NVIDIA CORPORATION nor the names of its\n *    contributors may be used to endorse or promote products derived\n *    from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n//This file is automatically rebuilt by the Cesium build process.\nexport default \"/**\\n\\\n * @license\\n\\\n * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.\\n\\\n *\\n\\\n * Redistribution and use in source and binary forms, with or without\\n\\\n * modification, are permitted provided that the following conditions\\n\\\n * are met:\\n\\\n *  * Redistributions of source code must retain the above copyright\\n\\\n *    notice, this list of conditions and the following disclaimer.\\n\\\n *  * Redistributions in binary form must reproduce the above copyright\\n\\\n *    notice, this list of conditions and the following disclaimer in the\\n\\\n *    documentation and/or other materials provided with the distribution.\\n\\\n *  * Neither the name of NVIDIA CORPORATION nor the names of its\\n\\\n *    contributors may be used to endorse or promote products derived\\n\\\n *    from this software without specific prior written permission.\\n\\\n *\\n\\\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY\\n\\\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\\n\\\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\\n\\\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR\\n\\\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\\n\\\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\\n\\\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\\n\\\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\\n\\\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\\n\\\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\\n\\\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\\n\\\n */\\n\\\n\\n\\\n// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples\\n\\\n// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h\\n\\\n\\n\\\n// Steps used to integrate into Cesium:\\n\\\n// * The following defines are set:\\n\\\n//       #define FXAA_PC 1\\n\\\n//       #define FXAA_WEBGL_1 1\\n\\\n//       #define FXAA_GREEN_AS_LUMA 1\\n\\\n//       #define FXAA_EARLY_EXIT 1\\n\\\n//       #define FXAA_GLSL_120 1\\n\\\n// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed.\\n\\\n// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace\\n\\\n//   /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/.\\n\\\n// * There are no implicit conversions from ivec* to vec* so replace:\\n\\\n//       #define FxaaInt2 ivec2\\n\\\n//           with\\n\\\n//       #define FxaaInt2 vec2\\n\\\n// * The texture2DLod function is only available in vertex shaders so replace:\\n\\\n//       #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)\\n\\\n//       #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)\\n\\\n//           with\\n\\\n//       #define FxaaTexTop(t, p) texture(t, p)\\n\\\n//       #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))\\n\\\n// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future.\\n\\\n// * The following parameters to FxaaPixelShader are unused and can be removed:\\n\\\n//       fxaaConsolePosPos\\n\\\n//       fxaaConsoleRcpFrameOpt\\n\\\n//       fxaaConsoleRcpFrameOpt2\\n\\\n//       fxaaConsole360RcpFrameOpt2\\n\\\n//       fxaaConsoleEdgeSharpness\\n\\\n//       fxaaConsoleEdgeThreshold\\n\\\n//       fxaaConsoleEdgeThresholdMi\\n\\\n//       fxaaConsole360ConstDir\\n\\\n\\n\\\n//\\n\\\n// Choose the quality preset.\\n\\\n// This needs to be compiled into the shader as it effects code.\\n\\\n// Best option to include multiple presets is to\\n\\\n// in each shader define the preset, then include this file.\\n\\\n//\\n\\\n// OPTIONS\\n\\\n// -----------------------------------------------------------------------\\n\\\n// 10 to 15 - default medium dither (10=fastest, 15=highest quality)\\n\\\n// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)\\n\\\n// 39       - no dither, very expensive\\n\\\n//\\n\\\n// NOTES\\n\\\n// -----------------------------------------------------------------------\\n\\\n// 12 = slightly faster then FXAA 3.9 and higher edge quality (default)\\n\\\n// 13 = about same speed as FXAA 3.9 and better than 12\\n\\\n// 23 = closest to FXAA 3.9 visually and performance wise\\n\\\n//  _ = the lowest digit is directly related to performance\\n\\\n// _  = the highest digit is directly related to style\\n\\\n//\\n\\\n//#define FXAA_QUALITY_PRESET 12\\n\\\n\\n\\\n\\n\\\n#if (FXAA_QUALITY_PRESET == 10)\\n\\\n    #define FXAA_QUALITY_PS 3\\n\\\n    #define FXAA_QUALITY_P0 1.5\\n\\\n    #define FXAA_QUALITY_P1 3.0\\n\\\n    #define FXAA_QUALITY_P2 12.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 11)\\n\\\n    #define FXAA_QUALITY_PS 4\\n\\\n    #define FXAA_QUALITY_P0 1.0\\n\\\n    #define FXAA_QUALITY_P1 1.5\\n\\\n    #define FXAA_QUALITY_P2 3.0\\n\\\n    #define FXAA_QUALITY_P3 12.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 12)\\n\\\n    #define FXAA_QUALITY_PS 5\\n\\\n    #define FXAA_QUALITY_P0 1.0\\n\\\n    #define FXAA_QUALITY_P1 1.5\\n\\\n    #define FXAA_QUALITY_P2 2.0\\n\\\n    #define FXAA_QUALITY_P3 4.0\\n\\\n    #define FXAA_QUALITY_P4 12.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 13)\\n\\\n    #define FXAA_QUALITY_PS 6\\n\\\n    #define FXAA_QUALITY_P0 1.0\\n\\\n    #define FXAA_QUALITY_P1 1.5\\n\\\n    #define FXAA_QUALITY_P2 2.0\\n\\\n    #define FXAA_QUALITY_P3 2.0\\n\\\n    #define FXAA_QUALITY_P4 4.0\\n\\\n    #define FXAA_QUALITY_P5 12.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 14)\\n\\\n    #define FXAA_QUALITY_PS 7\\n\\\n    #define FXAA_QUALITY_P0 1.0\\n\\\n    #define FXAA_QUALITY_P1 1.5\\n\\\n    #define FXAA_QUALITY_P2 2.0\\n\\\n    #define FXAA_QUALITY_P3 2.0\\n\\\n    #define FXAA_QUALITY_P4 2.0\\n\\\n    #define FXAA_QUALITY_P5 4.0\\n\\\n    #define FXAA_QUALITY_P6 12.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 15)\\n\\\n    #define FXAA_QUALITY_PS 8\\n\\\n    #define FXAA_QUALITY_P0 1.0\\n\\\n    #define FXAA_QUALITY_P1 1.5\\n\\\n    #define FXAA_QUALITY_P2 2.0\\n\\\n    #define FXAA_QUALITY_P3 2.0\\n\\\n    #define FXAA_QUALITY_P4 2.0\\n\\\n    #define FXAA_QUALITY_P5 2.0\\n\\\n    #define FXAA_QUALITY_P6 4.0\\n\\\n    #define FXAA_QUALITY_P7 12.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 20)\\n\\\n    #define FXAA_QUALITY_PS 3\\n\\\n    #define FXAA_QUALITY_P0 1.5\\n\\\n    #define FXAA_QUALITY_P1 2.0\\n\\\n    #define FXAA_QUALITY_P2 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 21)\\n\\\n    #define FXAA_QUALITY_PS 4\\n\\\n    #define FXAA_QUALITY_P0 1.0\\n\\\n    #define FXAA_QUALITY_P1 1.5\\n\\\n    #define FXAA_QUALITY_P2 2.0\\n\\\n    #define FXAA_QUALITY_P3 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 22)\\n\\\n    #define FXAA_QUALITY_PS 5\\n\\\n    #define FXAA_QUALITY_P0 1.0\\n\\\n    #define FXAA_QUALITY_P1 1.5\\n\\\n    #define FXAA_QUALITY_P2 2.0\\n\\\n    #define FXAA_QUALITY_P3 2.0\\n\\\n    #define FXAA_QUALITY_P4 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 23)\\n\\\n    #define FXAA_QUALITY_PS 6\\n\\\n    #define FXAA_QUALITY_P0 1.0\\n\\\n    #define FXAA_QUALITY_P1 1.5\\n\\\n    #define FXAA_QUALITY_P2 2.0\\n\\\n    #define FXAA_QUALITY_P3 2.0\\n\\\n    #define FXAA_QUALITY_P4 2.0\\n\\\n    #define FXAA_QUALITY_P5 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 24)\\n\\\n    #define FXAA_QUALITY_PS 7\\n\\\n    #define FXAA_QUALITY_P0 1.0\\n\\\n    #define FXAA_QUALITY_P1 1.5\\n\\\n    #define FXAA_QUALITY_P2 2.0\\n\\\n    #define FXAA_QUALITY_P3 2.0\\n\\\n    #define FXAA_QUALITY_P4 2.0\\n\\\n    #define FXAA_QUALITY_P5 3.0\\n\\\n    #define FXAA_QUALITY_P6 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 25)\\n\\\n    #define FXAA_QUALITY_PS 8\\n\\\n    #define FXAA_QUALITY_P0 1.0\\n\\\n    #define FXAA_QUALITY_P1 1.5\\n\\\n    #define FXAA_QUALITY_P2 2.0\\n\\\n    #define FXAA_QUALITY_P3 2.0\\n\\\n    #define FXAA_QUALITY_P4 2.0\\n\\\n    #define FXAA_QUALITY_P5 2.0\\n\\\n    #define FXAA_QUALITY_P6 4.0\\n\\\n    #define FXAA_QUALITY_P7 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 26)\\n\\\n    #define FXAA_QUALITY_PS 9\\n\\\n    #define FXAA_QUALITY_P0 1.0\\n\\\n    #define FXAA_QUALITY_P1 1.5\\n\\\n    #define FXAA_QUALITY_P2 2.0\\n\\\n    #define FXAA_QUALITY_P3 2.0\\n\\\n    #define FXAA_QUALITY_P4 2.0\\n\\\n    #define FXAA_QUALITY_P5 2.0\\n\\\n    #define FXAA_QUALITY_P6 2.0\\n\\\n    #define FXAA_QUALITY_P7 4.0\\n\\\n    #define FXAA_QUALITY_P8 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 27)\\n\\\n    #define FXAA_QUALITY_PS 10\\n\\\n    #define FXAA_QUALITY_P0 1.0\\n\\\n    #define FXAA_QUALITY_P1 1.5\\n\\\n    #define FXAA_QUALITY_P2 2.0\\n\\\n    #define FXAA_QUALITY_P3 2.0\\n\\\n    #define FXAA_QUALITY_P4 2.0\\n\\\n    #define FXAA_QUALITY_P5 2.0\\n\\\n    #define FXAA_QUALITY_P6 2.0\\n\\\n    #define FXAA_QUALITY_P7 2.0\\n\\\n    #define FXAA_QUALITY_P8 4.0\\n\\\n    #define FXAA_QUALITY_P9 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 28)\\n\\\n    #define FXAA_QUALITY_PS 11\\n\\\n    #define FXAA_QUALITY_P0 1.0\\n\\\n    #define FXAA_QUALITY_P1 1.5\\n\\\n    #define FXAA_QUALITY_P2 2.0\\n\\\n    #define FXAA_QUALITY_P3 2.0\\n\\\n    #define FXAA_QUALITY_P4 2.0\\n\\\n    #define FXAA_QUALITY_P5 2.0\\n\\\n    #define FXAA_QUALITY_P6 2.0\\n\\\n    #define FXAA_QUALITY_P7 2.0\\n\\\n    #define FXAA_QUALITY_P8 2.0\\n\\\n    #define FXAA_QUALITY_P9 4.0\\n\\\n    #define FXAA_QUALITY_P10 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 29)\\n\\\n    #define FXAA_QUALITY_PS 12\\n\\\n    #define FXAA_QUALITY_P0 1.0\\n\\\n    #define FXAA_QUALITY_P1 1.5\\n\\\n    #define FXAA_QUALITY_P2 2.0\\n\\\n    #define FXAA_QUALITY_P3 2.0\\n\\\n    #define FXAA_QUALITY_P4 2.0\\n\\\n    #define FXAA_QUALITY_P5 2.0\\n\\\n    #define FXAA_QUALITY_P6 2.0\\n\\\n    #define FXAA_QUALITY_P7 2.0\\n\\\n    #define FXAA_QUALITY_P8 2.0\\n\\\n    #define FXAA_QUALITY_P9 2.0\\n\\\n    #define FXAA_QUALITY_P10 4.0\\n\\\n    #define FXAA_QUALITY_P11 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 39)\\n\\\n    #define FXAA_QUALITY_PS 12\\n\\\n    #define FXAA_QUALITY_P0 1.0\\n\\\n    #define FXAA_QUALITY_P1 1.0\\n\\\n    #define FXAA_QUALITY_P2 1.0\\n\\\n    #define FXAA_QUALITY_P3 1.0\\n\\\n    #define FXAA_QUALITY_P4 1.0\\n\\\n    #define FXAA_QUALITY_P5 1.5\\n\\\n    #define FXAA_QUALITY_P6 2.0\\n\\\n    #define FXAA_QUALITY_P7 2.0\\n\\\n    #define FXAA_QUALITY_P8 2.0\\n\\\n    #define FXAA_QUALITY_P9 2.0\\n\\\n    #define FXAA_QUALITY_P10 4.0\\n\\\n    #define FXAA_QUALITY_P11 8.0\\n\\\n#endif\\n\\\n\\n\\\n#define FxaaBool bool\\n\\\n#define FxaaFloat float\\n\\\n#define FxaaFloat2 vec2\\n\\\n#define FxaaFloat3 vec3\\n\\\n#define FxaaFloat4 vec4\\n\\\n#define FxaaHalf float\\n\\\n#define FxaaHalf2 vec2\\n\\\n#define FxaaHalf3 vec3\\n\\\n#define FxaaHalf4 vec4\\n\\\n#define FxaaInt2 vec2\\n\\\n#define FxaaTex sampler2D\\n\\\n\\n\\\n#define FxaaSat(x) clamp(x, 0.0, 1.0)\\n\\\n#define FxaaTexTop(t, p) texture(t, p)\\n\\\n#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))\\n\\\n\\n\\\nFxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\\n\\\n\\n\\\nFxaaFloat4 FxaaPixelShader(\\n\\\n    //\\n\\\n    // Use noperspective interpolation here (turn off perspective interpolation).\\n\\\n    // {xy} = center of pixel\\n\\\n    FxaaFloat2 pos,\\n\\\n    //\\n\\\n    // Input color texture.\\n\\\n    // {rgb_} = color in linear or perceptual color space\\n\\\n    // if (FXAA_GREEN_AS_LUMA == 0)\\n\\\n    //     {___a} = luma in perceptual color space (not linear)\\n\\\n    FxaaTex tex,\\n\\\n    //\\n\\\n    // Only used on FXAA Quality.\\n\\\n    // This must be from a constant/uniform.\\n\\\n    // {x_} = 1.0/screenWidthInPixels\\n\\\n    // {_y} = 1.0/screenHeightInPixels\\n\\\n    FxaaFloat2 fxaaQualityRcpFrame,\\n\\\n    //\\n\\\n    // Only used on FXAA Quality.\\n\\\n    // This used to be the FXAA_QUALITY_SUBPIX define.\\n\\\n    // It is here now to allow easier tuning.\\n\\\n    // Choose the amount of sub-pixel aliasing removal.\\n\\\n    // This can effect sharpness.\\n\\\n    //   1.00 - upper limit (softer)\\n\\\n    //   0.75 - default amount of filtering\\n\\\n    //   0.50 - lower limit (sharper, less sub-pixel aliasing removal)\\n\\\n    //   0.25 - almost off\\n\\\n    //   0.00 - completely off\\n\\\n    FxaaFloat fxaaQualitySubpix,\\n\\\n    //\\n\\\n    // Only used on FXAA Quality.\\n\\\n    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.\\n\\\n    // It is here now to allow easier tuning.\\n\\\n    // The minimum amount of local contrast required to apply algorithm.\\n\\\n    //   0.333 - too little (faster)\\n\\\n    //   0.250 - low quality\\n\\\n    //   0.166 - default\\n\\\n    //   0.125 - high quality\\n\\\n    //   0.063 - overkill (slower)\\n\\\n    FxaaFloat fxaaQualityEdgeThreshold,\\n\\\n    //\\n\\\n    // Only used on FXAA Quality.\\n\\\n    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.\\n\\\n    // It is here now to allow easier tuning.\\n\\\n    // Trims the algorithm from processing darks.\\n\\\n    //   0.0833 - upper limit (default, the start of visible unfiltered edges)\\n\\\n    //   0.0625 - high quality (faster)\\n\\\n    //   0.0312 - visible limit (slower)\\n\\\n    // Special notes when using FXAA_GREEN_AS_LUMA,\\n\\\n    //   Likely want to set this to zero.\\n\\\n    //   As colors that are mostly not-green\\n\\\n    //   will appear very dark in the green channel!\\n\\\n    //   Tune by looking at mostly non-green content,\\n\\\n    //   then start at zero and increase until aliasing is a problem.\\n\\\n    FxaaFloat fxaaQualityEdgeThresholdMin\\n\\\n) {\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    FxaaFloat2 posM;\\n\\\n    posM.x = pos.x;\\n\\\n    posM.y = pos.y;\\n\\\n    FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\\n\\\n    #define lumaM rgbyM.y\\n\\\n    FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));\\n\\\n    FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));\\n\\\n    FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));\\n\\\n    FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    FxaaFloat maxSM = max(lumaS, lumaM);\\n\\\n    FxaaFloat minSM = min(lumaS, lumaM);\\n\\\n    FxaaFloat maxESM = max(lumaE, maxSM);\\n\\\n    FxaaFloat minESM = min(lumaE, minSM);\\n\\\n    FxaaFloat maxWN = max(lumaN, lumaW);\\n\\\n    FxaaFloat minWN = min(lumaN, lumaW);\\n\\\n    FxaaFloat rangeMax = max(maxWN, maxESM);\\n\\\n    FxaaFloat rangeMin = min(minWN, minESM);\\n\\\n    FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\\n\\\n    FxaaFloat range = rangeMax - rangeMin;\\n\\\n    FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\\n\\\n    FxaaBool earlyExit = range < rangeMaxClamped;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    if(earlyExit)\\n\\\n        return rgbyM;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));\\n\\\n    FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));\\n\\\n    FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));\\n\\\n    FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    FxaaFloat lumaNS = lumaN + lumaS;\\n\\\n    FxaaFloat lumaWE = lumaW + lumaE;\\n\\\n    FxaaFloat subpixRcpRange = 1.0/range;\\n\\\n    FxaaFloat subpixNSWE = lumaNS + lumaWE;\\n\\\n    FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\\n\\\n    FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    FxaaFloat lumaNESE = lumaNE + lumaSE;\\n\\\n    FxaaFloat lumaNWNE = lumaNW + lumaNE;\\n\\\n    FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\\n\\\n    FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    FxaaFloat lumaNWSW = lumaNW + lumaSW;\\n\\\n    FxaaFloat lumaSWSE = lumaSW + lumaSE;\\n\\\n    FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\\n\\\n    FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\\n\\\n    FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\\n\\\n    FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\\n\\\n    FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\\n\\\n    FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\\n\\\n    FxaaFloat lengthSign = fxaaQualityRcpFrame.x;\\n\\\n    FxaaBool horzSpan = edgeHorz >= edgeVert;\\n\\\n    FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    if(!horzSpan) lumaN = lumaW;\\n\\\n    if(!horzSpan) lumaS = lumaE;\\n\\\n    if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;\\n\\\n    FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    FxaaFloat gradientN = lumaN - lumaM;\\n\\\n    FxaaFloat gradientS = lumaS - lumaM;\\n\\\n    FxaaFloat lumaNN = lumaN + lumaM;\\n\\\n    FxaaFloat lumaSS = lumaS + lumaM;\\n\\\n    FxaaBool pairN = abs(gradientN) >= abs(gradientS);\\n\\\n    FxaaFloat gradient = max(abs(gradientN), abs(gradientS));\\n\\\n    if(pairN) lengthSign = -lengthSign;\\n\\\n    FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    FxaaFloat2 posB;\\n\\\n    posB.x = posM.x;\\n\\\n    posB.y = posM.y;\\n\\\n    FxaaFloat2 offNP;\\n\\\n    offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\\n\\\n    offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\\n\\\n    if(!horzSpan) posB.x += lengthSign * 0.5;\\n\\\n    if( horzSpan) posB.y += lengthSign * 0.5;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    FxaaFloat2 posN;\\n\\\n    posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\\n\\\n    posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\\n\\\n    FxaaFloat2 posP;\\n\\\n    posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\\n\\\n    posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\\n\\\n    FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\\n\\\n    FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\\n\\\n    FxaaFloat subpixE = subpixC * subpixC;\\n\\\n    FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    if(!pairN) lumaNN = lumaSS;\\n\\\n    FxaaFloat gradientScaled = gradient * 1.0/4.0;\\n\\\n    FxaaFloat lumaMM = lumaM - lumaNN * 0.5;\\n\\\n    FxaaFloat subpixF = subpixD * subpixE;\\n\\\n    FxaaBool lumaMLTZero = lumaMM < 0.0;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    lumaEndN -= lumaNN * 0.5;\\n\\\n    lumaEndP -= lumaNN * 0.5;\\n\\\n    FxaaBool doneN = abs(lumaEndN) >= gradientScaled;\\n\\\n    FxaaBool doneP = abs(lumaEndP) >= gradientScaled;\\n\\\n    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\\n\\\n    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\\n\\\n    FxaaBool doneNP = (!doneN) || (!doneP);\\n\\\n    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\\n\\\n    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    if(doneNP) {\\n\\\n        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\n        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\n        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\n        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\n        doneN = abs(lumaEndN) >= gradientScaled;\\n\\\n        doneP = abs(lumaEndP) >= gradientScaled;\\n\\\n        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\\n\\\n        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\\n\\\n        doneNP = (!doneN) || (!doneP);\\n\\\n        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\\n\\\n        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n        #if (FXAA_QUALITY_PS > 3)\\n\\\n        if(doneNP) {\\n\\\n            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\n            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\n            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\n            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\n            doneN = abs(lumaEndN) >= gradientScaled;\\n\\\n            doneP = abs(lumaEndP) >= gradientScaled;\\n\\\n            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\\n\\\n            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\\n\\\n            doneNP = (!doneN) || (!doneP);\\n\\\n            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\\n\\\n            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n            #if (FXAA_QUALITY_PS > 4)\\n\\\n            if(doneNP) {\\n\\\n                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\n                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\n                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\n                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\n                doneN = abs(lumaEndN) >= gradientScaled;\\n\\\n                doneP = abs(lumaEndP) >= gradientScaled;\\n\\\n                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\\n\\\n                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\\n\\\n                doneNP = (!doneN) || (!doneP);\\n\\\n                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\\n\\\n                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n                #if (FXAA_QUALITY_PS > 5)\\n\\\n                if(doneNP) {\\n\\\n                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\n                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\n                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\n                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\n                    doneN = abs(lumaEndN) >= gradientScaled;\\n\\\n                    doneP = abs(lumaEndP) >= gradientScaled;\\n\\\n                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\\n\\\n                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\\n\\\n                    doneNP = (!doneN) || (!doneP);\\n\\\n                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\\n\\\n                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n                    #if (FXAA_QUALITY_PS > 6)\\n\\\n                    if(doneNP) {\\n\\\n                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\n                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\n                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\n                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\n                        doneN = abs(lumaEndN) >= gradientScaled;\\n\\\n                        doneP = abs(lumaEndP) >= gradientScaled;\\n\\\n                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\\n\\\n                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\\n\\\n                        doneNP = (!doneN) || (!doneP);\\n\\\n                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\\n\\\n                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n                        #if (FXAA_QUALITY_PS > 7)\\n\\\n                        if(doneNP) {\\n\\\n                            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\n                            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\n                            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\n                            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\n                            doneN = abs(lumaEndN) >= gradientScaled;\\n\\\n                            doneP = abs(lumaEndP) >= gradientScaled;\\n\\\n                            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\\n\\\n                            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\\n\\\n                            doneNP = (!doneN) || (!doneP);\\n\\\n                            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\\n\\\n                            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    #if (FXAA_QUALITY_PS > 8)\\n\\\n    if(doneNP) {\\n\\\n        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\n        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\n        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\n        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\n        doneN = abs(lumaEndN) >= gradientScaled;\\n\\\n        doneP = abs(lumaEndP) >= gradientScaled;\\n\\\n        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\\n\\\n        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\\n\\\n        doneNP = (!doneN) || (!doneP);\\n\\\n        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\\n\\\n        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n        #if (FXAA_QUALITY_PS > 9)\\n\\\n        if(doneNP) {\\n\\\n            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\n            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\n            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\n            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\n            doneN = abs(lumaEndN) >= gradientScaled;\\n\\\n            doneP = abs(lumaEndP) >= gradientScaled;\\n\\\n            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\\n\\\n            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\\n\\\n            doneNP = (!doneN) || (!doneP);\\n\\\n            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\\n\\\n            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n            #if (FXAA_QUALITY_PS > 10)\\n\\\n            if(doneNP) {\\n\\\n                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\n                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\n                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\n                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\n                doneN = abs(lumaEndN) >= gradientScaled;\\n\\\n                doneP = abs(lumaEndP) >= gradientScaled;\\n\\\n                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\\n\\\n                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\\n\\\n                doneNP = (!doneN) || (!doneP);\\n\\\n                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\\n\\\n                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n                #if (FXAA_QUALITY_PS > 11)\\n\\\n                if(doneNP) {\\n\\\n                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\n                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\n                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\n                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\n                    doneN = abs(lumaEndN) >= gradientScaled;\\n\\\n                    doneP = abs(lumaEndP) >= gradientScaled;\\n\\\n                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\\n\\\n                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\\n\\\n                    doneNP = (!doneN) || (!doneP);\\n\\\n                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\\n\\\n                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n                    #if (FXAA_QUALITY_PS > 12)\\n\\\n                    if(doneNP) {\\n\\\n                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\n                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\n                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\n                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\n                        doneN = abs(lumaEndN) >= gradientScaled;\\n\\\n                        doneP = abs(lumaEndP) >= gradientScaled;\\n\\\n                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\\n\\\n                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\\n\\\n                        doneNP = (!doneN) || (!doneP);\\n\\\n                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\\n\\\n                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n                    }\\n\\\n                    #endif\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n                }\\n\\\n                #endif\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n            }\\n\\\n            #endif\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n        }\\n\\\n        #endif\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    }\\n\\\n    #endif\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n                        }\\n\\\n                        #endif\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n                    }\\n\\\n                    #endif\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n                }\\n\\\n                #endif\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n            }\\n\\\n            #endif\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n        }\\n\\\n        #endif\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    }\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    FxaaFloat dstN = posM.x - posN.x;\\n\\\n    FxaaFloat dstP = posP.x - posM.x;\\n\\\n    if(!horzSpan) dstN = posM.y - posN.y;\\n\\\n    if(!horzSpan) dstP = posP.y - posM.y;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\\n\\\n    FxaaFloat spanLength = (dstP + dstN);\\n\\\n    FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\\n\\\n    FxaaFloat spanLengthRcp = 1.0/spanLength;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    FxaaBool directionN = dstN < dstP;\\n\\\n    FxaaFloat dst = min(dstN, dstP);\\n\\\n    FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\\n\\\n    FxaaFloat subpixG = subpixF * subpixF;\\n\\\n    FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\\n\\\n    FxaaFloat subpixH = subpixG * fxaaQualitySubpix;\\n\\\n/*--------------------------------------------------------------------------*/\\n\\\n    FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\\n\\\n    FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\\n\\\n    if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\\n\\\n    if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\\n\\\n    return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\\n\\\n}\\n\\\n\";\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\n\n/**\n * A post process stage that will get the luminance value at each pixel and\n * uses parallel reduction to compute the average luminance in a 1x1 texture.\n * This texture can be used as input for tone mapping.\n *\n * @constructor\n * @private\n */\nfunction AutoExposure() {\n  this._uniformMap = undefined;\n  this._command = undefined;\n\n  this._colorTexture = undefined;\n  this._depthTexture = undefined;\n\n  this._ready = false;\n\n  this._name = \"czm_autoexposure\";\n\n  this._logDepthChanged = undefined;\n  this._useLogDepth = undefined;\n\n  this._framebuffers = undefined;\n  this._previousLuminance = new FramebufferManager();\n\n  this._commands = undefined;\n  this._clearCommand = undefined;\n\n  this._minMaxLuminance = new Cartesian2();\n\n  /**\n   * Whether or not to execute this post-process stage when ready.\n   *\n   * @type {boolean}\n   */\n  this.enabled = true;\n  this._enabled = true;\n\n  /**\n   * The minimum value used to clamp the luminance.\n   *\n   * @type {number}\n   * @default 0.1\n   */\n  this.minimumLuminance = 0.1;\n\n  /**\n   * The maximum value used to clamp the luminance.\n   *\n   * @type {number}\n   * @default 10.0\n   */\n  this.maximumLuminance = 10.0;\n}\n\nObject.defineProperties(AutoExposure.prototype, {\n  /**\n   * Determines if this post-process stage is ready to be executed. A stage is only executed when both <code>ready</code>\n   * and {@link AutoExposure#enabled} are <code>true</code>. A stage will not be ready while it is waiting on textures\n   * to load.\n   *\n   * @memberof AutoExposure.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n  /**\n   * The unique name of this post-process stage for reference by other stages.\n   *\n   * @memberof AutoExposure.prototype\n   * @type {string}\n   * @readonly\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n\n  /**\n   * A reference to the texture written to when executing this post process stage.\n   *\n   * @memberof AutoExposure.prototype\n   * @type {Texture}\n   * @readonly\n   * @private\n   */\n  outputTexture: {\n    get: function () {\n      const framebuffers = this._framebuffers;\n      if (!defined(framebuffers)) {\n        return undefined;\n      }\n      return framebuffers[framebuffers.length - 1].getColorTexture(0);\n    },\n  },\n});\n\nfunction destroyFramebuffers(autoexposure) {\n  const framebuffers = autoexposure._framebuffers;\n  if (!defined(framebuffers)) {\n    return;\n  }\n\n  const length = framebuffers.length;\n  for (let i = 0; i < length; ++i) {\n    framebuffers[i].destroy();\n  }\n  autoexposure._framebuffers = undefined;\n\n  autoexposure._previousLuminance.destroy();\n  autoexposure._previousLuminance = undefined;\n}\n\nfunction createFramebuffers(autoexposure, context) {\n  destroyFramebuffers(autoexposure);\n\n  let width = autoexposure._width;\n  let height = autoexposure._height;\n\n  const pixelDatatype = context.halfFloatingPointTexture\n    ? PixelDatatype.HALF_FLOAT\n    : PixelDatatype.FLOAT;\n\n  const length = Math.ceil(Math.log(Math.max(width, height)) / Math.log(3.0));\n  const framebuffers = new Array(length);\n  for (let i = 0; i < length; ++i) {\n    width = Math.max(Math.ceil(width / 3.0), 1.0);\n    height = Math.max(Math.ceil(height / 3.0), 1.0);\n    framebuffers[i] = new FramebufferManager();\n    framebuffers[i].update(context, width, height, 1, pixelDatatype);\n  }\n\n  const lastTexture = framebuffers[length - 1].getColorTexture(0);\n  autoexposure._previousLuminance.update(\n    context,\n    lastTexture.width,\n    lastTexture.height,\n    1,\n    pixelDatatype\n  );\n  autoexposure._framebuffers = framebuffers;\n}\n\nfunction destroyCommands(autoexposure) {\n  const commands = autoexposure._commands;\n  if (!defined(commands)) {\n    return;\n  }\n\n  const length = commands.length;\n  for (let i = 0; i < length; ++i) {\n    commands[i].shaderProgram.destroy();\n  }\n  autoexposure._commands = undefined;\n}\n\nfunction createUniformMap(autoexposure, index) {\n  let uniforms;\n  if (index === 0) {\n    uniforms = {\n      colorTexture: function () {\n        return autoexposure._colorTexture;\n      },\n      colorTextureDimensions: function () {\n        return autoexposure._colorTexture.dimensions;\n      },\n    };\n  } else {\n    const texture = autoexposure._framebuffers[index - 1].getColorTexture(0);\n    uniforms = {\n      colorTexture: function () {\n        return texture;\n      },\n      colorTextureDimensions: function () {\n        return texture.dimensions;\n      },\n    };\n  }\n\n  uniforms.minMaxLuminance = function () {\n    return autoexposure._minMaxLuminance;\n  };\n  uniforms.previousLuminance = function () {\n    return autoexposure._previousLuminance.getColorTexture(0);\n  };\n\n  return uniforms;\n}\n\nfunction getShaderSource(index, length) {\n  let source =\n    \"uniform sampler2D colorTexture; \\n\" +\n    \"in vec2 v_textureCoordinates; \\n\" +\n    \"float sampleTexture(vec2 offset) { \\n\";\n\n  if (index === 0) {\n    source +=\n      \"    vec4 color = texture(colorTexture, v_textureCoordinates + offset); \\n\" +\n      \"    return czm_luminance(color.rgb); \\n\";\n  } else {\n    source +=\n      \"    return texture(colorTexture, v_textureCoordinates + offset).r; \\n\";\n  }\n\n  source += \"}\\n\\n\";\n\n  source +=\n    \"uniform vec2 colorTextureDimensions; \\n\" +\n    \"uniform vec2 minMaxLuminance; \\n\" +\n    \"uniform sampler2D previousLuminance; \\n\" +\n    \"void main() { \\n\" +\n    \"    float color = 0.0; \\n\" +\n    \"    float xStep = 1.0 / colorTextureDimensions.x; \\n\" +\n    \"    float yStep = 1.0 / colorTextureDimensions.y; \\n\" +\n    \"    int count = 0; \\n\" +\n    \"    for (int i = 0; i < 3; ++i) { \\n\" +\n    \"        for (int j = 0; j < 3; ++j) { \\n\" +\n    \"            vec2 offset; \\n\" +\n    \"            offset.x = -xStep + float(i) * xStep; \\n\" +\n    \"            offset.y = -yStep + float(j) * yStep; \\n\" +\n    \"            if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { \\n\" +\n    \"                continue; \\n\" +\n    \"            } \\n\" +\n    \"            color += sampleTexture(offset); \\n\" +\n    \"            ++count; \\n\" +\n    \"        } \\n\" +\n    \"    } \\n\" +\n    \"    if (count > 0) { \\n\" +\n    \"        color /= float(count); \\n\" +\n    \"    } \\n\";\n\n  if (index === length - 1) {\n    source +=\n      \"    float previous = texture(previousLuminance, vec2(0.5)).r; \\n\" +\n      \"    color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \\n\" +\n      \"    color = previous + (color - previous) / (60.0 * 1.5); \\n\" +\n      \"    color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \\n\";\n  }\n\n  source += \"    out_FragColor = vec4(color); \\n\" + \"} \\n\";\n  return source;\n}\n\nfunction createCommands(autoexposure, context) {\n  destroyCommands(autoexposure);\n  const framebuffers = autoexposure._framebuffers;\n  const length = framebuffers.length;\n\n  const commands = new Array(length);\n\n  for (let i = 0; i < length; ++i) {\n    commands[i] = context.createViewportQuadCommand(\n      getShaderSource(i, length),\n      {\n        framebuffer: framebuffers[i].framebuffer,\n        uniformMap: createUniformMap(autoexposure, i),\n      }\n    );\n  }\n  autoexposure._commands = commands;\n}\n\n/**\n * A function that will be called before execute. Used to clear any textures attached to framebuffers.\n * @param {Context} context The context.\n * @private\n */\nAutoExposure.prototype.clear = function (context) {\n  const framebuffers = this._framebuffers;\n  if (!defined(framebuffers)) {\n    return;\n  }\n\n  let clearCommand = this._clearCommand;\n  if (!defined(clearCommand)) {\n    clearCommand = this._clearCommand = new ClearCommand({\n      color: new Color(0.0, 0.0, 0.0, 0.0),\n      framebuffer: undefined,\n    });\n  }\n\n  const length = framebuffers.length;\n  for (let i = 0; i < length; ++i) {\n    framebuffers[i].clear(context, clearCommand);\n  }\n};\n\n/**\n * A function that will be called before execute. Used to create WebGL resources and load any textures.\n * @param {Context} context The context.\n * @private\n */\nAutoExposure.prototype.update = function (context) {\n  const width = context.drawingBufferWidth;\n  const height = context.drawingBufferHeight;\n\n  if (width !== this._width || height !== this._height) {\n    this._width = width;\n    this._height = height;\n\n    createFramebuffers(this, context);\n    createCommands(this, context);\n\n    if (!this._ready) {\n      this._ready = true;\n    }\n  }\n\n  this._minMaxLuminance.x = this.minimumLuminance;\n  this._minMaxLuminance.y = this.maximumLuminance;\n\n  const framebuffers = this._framebuffers;\n  const temp = framebuffers[framebuffers.length - 1];\n  framebuffers[framebuffers.length - 1] = this._previousLuminance;\n  this._commands[\n    this._commands.length - 1\n  ].framebuffer = this._previousLuminance.framebuffer;\n  this._previousLuminance = temp;\n};\n\n/**\n * Executes the post-process stage. The color texture is the texture rendered to by the scene or from the previous stage.\n * @param {Context} context The context.\n * @param {Texture} colorTexture The input color texture.\n * @private\n */\nAutoExposure.prototype.execute = function (context, colorTexture) {\n  this._colorTexture = colorTexture;\n\n  const commands = this._commands;\n  if (!defined(commands)) {\n    return;\n  }\n\n  const length = commands.length;\n  for (let i = 0; i < length; ++i) {\n    commands[i].execute(context);\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see AutoExposure#destroy\n */\nAutoExposure.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see AutoExposure#isDestroyed\n */\nAutoExposure.prototype.destroy = function () {\n  destroyFramebuffers(this);\n  destroyCommands(this);\n  return destroyObject(this);\n};\nexport default AutoExposure;\n", "/**\n * Determines how input texture to a {@link PostProcessStage} is sampled.\n *\n * @enum {number}\n */\nconst PostProcessStageSampleMode = {\n  /**\n   * Samples the texture by returning the closest texel.\n   *\n   * @type {number}\n   * @constant\n   */\n  NEAREST: 0,\n  /**\n   * Samples the texture through bi-linear interpolation of the four nearest texels.\n   *\n   * @type {number}\n   * @constant\n   */\n  LINEAR: 1,\n};\nexport default PostProcessStageSampleMode;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport combine from \"../Core/combine.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Resource from \"../Core/Resource.js\";\nimport PassState from \"../Renderer/PassState.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport PostProcessStageSampleMode from \"./PostProcessStageSampleMode.js\";\n\n/**\n * Runs a post-process stage on either the texture rendered by the scene or the output of a previous post-process stage.\n *\n * @alias PostProcessStage\n * @constructor\n *\n * @param {object} options An object with the following properties:\n * @param {string} options.fragmentShader The fragment shader to use. The default <code>sampler2D</code> uniforms are <code>colorTexture</code> and <code>depthTexture</code>. The color texture is the output of rendering the scene or the previous stage. The depth texture is the output from rendering the scene. The shader should contain one or both uniforms. There is also a <code>vec2</code> varying named <code>v_textureCoordinates</code> that can be used to sample the textures.\n * @param {object} [options.uniforms] An object whose properties will be used to set the shaders uniforms. The properties can be constant values or a function. A constant value can also be a URI, data URI, or HTML element to use as a texture.\n * @param {number} [options.textureScale=1.0] A number in the range (0.0, 1.0] used to scale the texture dimensions. A scale of 1.0 will render this post-process stage  to a texture the size of the viewport.\n * @param {boolean} [options.forcePowerOfTwo=false] Whether or not to force the texture dimensions to be both equal powers of two. The power of two will be the next power of two of the minimum of the dimensions.\n * @param {PostProcessStageSampleMode} [options.sampleMode=PostProcessStageSampleMode.NEAREST] How to sample the input color texture.\n * @param {PixelFormat} [options.pixelFormat=PixelFormat.RGBA] The color pixel format of the output texture.\n * @param {PixelDatatype} [options.pixelDatatype=PixelDatatype.UNSIGNED_BYTE] The pixel data type of the output texture.\n * @param {Color} [options.clearColor=Color.BLACK] The color to clear the output texture to.\n * @param {BoundingRectangle} [options.scissorRectangle] The rectangle to use for the scissor test.\n * @param {string} [options.name=createGuid()] The unique name of this post-process stage for reference by other stages in a composite. If a name is not supplied, a GUID will be generated.\n *\n * @exception {DeveloperError} options.textureScale must be greater than 0.0 and less than or equal to 1.0.\n * @exception {DeveloperError} options.pixelFormat must be a color format.\n * @exception {DeveloperError} When options.pixelDatatype is FLOAT, this WebGL implementation must support floating point textures. Check context.floatingPointTexture.\n *\n * @see PostProcessStageComposite\n *\n * @example\n * // Simple stage to change the color\n * const fs =`\n *     uniform sampler2D colorTexture;\n *     in vec2 v_textureCoordinates;\n *     uniform float scale;\n *     uniform vec3 offset;\n *     void main() {\n *         vec4 color = texture(colorTexture, v_textureCoordinates);\n *         out_FragColor = vec4(color.rgb * scale + offset, 1.0);\n *     }`;\n * scene.postProcessStages.add(new Cesium.PostProcessStage({\n *     fragmentShader : fs,\n *     uniforms : {\n *         scale : 1.1,\n *         offset : function() {\n *             return new Cesium.Cartesian3(0.1, 0.2, 0.3);\n *         }\n *     }\n * }));\n *\n * @example\n * // Simple stage to change the color of what is selected.\n * // If czm_selected returns true, the current fragment belongs to geometry in the selected array.\n * const fs =`\n *     uniform sampler2D colorTexture;\n *     in vec2 v_textureCoordinates;\n *     uniform vec4 highlight;\n *     void main() {\n *         vec4 color = texture(colorTexture, v_textureCoordinates);\n *         if (czm_selected()) {\n *             vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n *             out_FragColor = vec4(highlighted, 1.0);\n *         } else {\n *             out_FragColor = color;\n *         }\n *     }`;\n * const stage = scene.postProcessStages.add(new Cesium.PostProcessStage({\n *     fragmentShader : fs,\n *     uniforms : {\n *         highlight : function() {\n *             return new Cesium.Color(1.0, 0.0, 0.0, 0.5);\n *         }\n *     }\n * }));\n * stage.selected = [cesium3DTileFeature];\n */\nfunction PostProcessStage(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const fragmentShader = options.fragmentShader;\n  const textureScale = defaultValue(options.textureScale, 1.0);\n  const pixelFormat = defaultValue(options.pixelFormat, PixelFormat.RGBA);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"options.fragmentShader\", fragmentShader);\n  Check.typeOf.number.greaterThan(\"options.textureScale\", textureScale, 0.0);\n  Check.typeOf.number.lessThanOrEquals(\n    \"options.textureScale\",\n    textureScale,\n    1.0\n  );\n  if (!PixelFormat.isColorFormat(pixelFormat)) {\n    throw new DeveloperError(\"options.pixelFormat must be a color format.\");\n  }\n  //>>includeEnd('debug');\n\n  this._fragmentShader = fragmentShader;\n  this._uniforms = options.uniforms;\n  this._textureScale = textureScale;\n  this._forcePowerOfTwo = defaultValue(options.forcePowerOfTwo, false);\n  this._sampleMode = defaultValue(\n    options.sampleMode,\n    PostProcessStageSampleMode.NEAREST\n  );\n  this._pixelFormat = pixelFormat;\n  this._pixelDatatype = defaultValue(\n    options.pixelDatatype,\n    PixelDatatype.UNSIGNED_BYTE\n  );\n  this._clearColor = defaultValue(options.clearColor, Color.BLACK);\n\n  this._uniformMap = undefined;\n  this._command = undefined;\n\n  this._colorTexture = undefined;\n  this._depthTexture = undefined;\n  this._idTexture = undefined;\n\n  this._actualUniforms = {};\n  this._dirtyUniforms = [];\n  this._texturesToRelease = [];\n  this._texturesToCreate = [];\n  this._texturePromise = undefined;\n\n  const passState = new PassState();\n  passState.scissorTest = {\n    enabled: true,\n    rectangle: defined(options.scissorRectangle)\n      ? BoundingRectangle.clone(options.scissorRectangle)\n      : new BoundingRectangle(),\n  };\n  this._passState = passState;\n\n  this._ready = false;\n\n  let name = options.name;\n  if (!defined(name)) {\n    name = createGuid();\n  }\n  this._name = name;\n\n  this._logDepthChanged = undefined;\n  this._useLogDepth = undefined;\n\n  this._selectedIdTexture = undefined;\n  this._selected = undefined;\n  this._selectedShadow = undefined;\n  this._parentSelected = undefined;\n  this._parentSelectedShadow = undefined;\n  this._combinedSelected = undefined;\n  this._combinedSelectedShadow = undefined;\n  this._selectedLength = 0;\n  this._parentSelectedLength = 0;\n  this._selectedDirty = true;\n\n  // set by PostProcessStageCollection\n  this._textureCache = undefined;\n  this._index = undefined;\n\n  /**\n   * Whether or not to execute this post-process stage when ready.\n   *\n   * @type {boolean}\n   */\n  this.enabled = true;\n  this._enabled = true;\n}\n\nObject.defineProperties(PostProcessStage.prototype, {\n  /**\n   * Determines if this post-process stage is ready to be executed. A stage is only executed when both <code>ready</code>\n   * and {@link PostProcessStage#enabled} are <code>true</code>. A stage will not be ready while it is waiting on textures\n   * to load.\n   *\n   * @memberof PostProcessStage.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n  /**\n   * The unique name of this post-process stage for reference by other stages in a {@link PostProcessStageComposite}.\n   *\n   * @memberof PostProcessStage.prototype\n   * @type {string}\n   * @readonly\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n  /**\n   * The fragment shader to use when execute this post-process stage.\n   * <p>\n   * The shader must contain a sampler uniform declaration for <code>colorTexture</code>, <code>depthTexture</code>,\n   * or both.\n   * </p>\n   * <p>\n   * The shader must contain a <code>vec2</code> varying declaration for <code>v_textureCoordinates</code> for sampling\n   * the texture uniforms.\n   * </p>\n   *\n   * @memberof PostProcessStage.prototype\n   * @type {string}\n   * @readonly\n   */\n  fragmentShader: {\n    get: function () {\n      return this._fragmentShader;\n    },\n  },\n  /**\n   * An object whose properties are used to set the uniforms of the fragment shader.\n   * <p>\n   * The object property values can be either a constant or a function. The function will be called\n   * each frame before the post-process stage is executed.\n   * </p>\n   * <p>\n   * A constant value can also be a URI to an image, a data URI, or an HTML element that can be used as a texture, such as HTMLImageElement or HTMLCanvasElement.\n   * </p>\n   * <p>\n   * If this post-process stage is part of a {@link PostProcessStageComposite} that does not execute in series, the constant value can also be\n   * the name of another stage in a composite. This will set the uniform to the output texture the stage with that name.\n   * </p>\n   *\n   * @memberof PostProcessStage.prototype\n   * @type {object}\n   * @readonly\n   */\n  uniforms: {\n    get: function () {\n      return this._uniforms;\n    },\n  },\n  /**\n   * A number in the range (0.0, 1.0] used to scale the output texture dimensions. A scale of 1.0 will render this post-process stage to a texture the size of the viewport.\n   *\n   * @memberof PostProcessStage.prototype\n   * @type {number}\n   * @readonly\n   */\n  textureScale: {\n    get: function () {\n      return this._textureScale;\n    },\n  },\n  /**\n   * Whether or not to force the output texture dimensions to be both equal powers of two. The power of two will be the next power of two of the minimum of the dimensions.\n   *\n   * @memberof PostProcessStage.prototype\n   * @type {number}\n   * @readonly\n   */\n  forcePowerOfTwo: {\n    get: function () {\n      return this._forcePowerOfTwo;\n    },\n  },\n  /**\n   * How to sample the input color texture.\n   *\n   * @memberof PostProcessStage.prototype\n   * @type {PostProcessStageSampleMode}\n   * @readonly\n   */\n  sampleMode: {\n    get: function () {\n      return this._sampleMode;\n    },\n  },\n  /**\n   * The color pixel format of the output texture.\n   *\n   * @memberof PostProcessStage.prototype\n   * @type {PixelFormat}\n   * @readonly\n   */\n  pixelFormat: {\n    get: function () {\n      return this._pixelFormat;\n    },\n  },\n  /**\n   * The pixel data type of the output texture.\n   *\n   * @memberof PostProcessStage.prototype\n   * @type {PixelDatatype}\n   * @readonly\n   */\n  pixelDatatype: {\n    get: function () {\n      return this._pixelDatatype;\n    },\n  },\n  /**\n   * The color to clear the output texture to.\n   *\n   * @memberof PostProcessStage.prototype\n   * @type {Color}\n   * @readonly\n   */\n  clearColor: {\n    get: function () {\n      return this._clearColor;\n    },\n  },\n  /**\n   * The {@link BoundingRectangle} to use for the scissor test. A default bounding rectangle will disable the scissor test.\n   *\n   * @memberof PostProcessStage.prototype\n   * @type {BoundingRectangle}\n   * @readonly\n   */\n  scissorRectangle: {\n    get: function () {\n      return this._passState.scissorTest.rectangle;\n    },\n  },\n  /**\n   * A reference to the texture written to when executing this post process stage.\n   *\n   * @memberof PostProcessStage.prototype\n   * @type {Texture}\n   * @readonly\n   * @private\n   */\n  outputTexture: {\n    get: function () {\n      if (defined(this._textureCache)) {\n        const framebuffer = this._textureCache.getFramebuffer(this._name);\n        if (defined(framebuffer)) {\n          return framebuffer.getColorTexture(0);\n        }\n      }\n      return undefined;\n    },\n  },\n  /**\n   * The features selected for applying the post-process.\n   * <p>\n   * In the fragment shader, use <code>czm_selected</code> to determine whether or not to apply the post-process\n   * stage to that fragment. For example:\n   * <code>\n   * if (czm_selected(v_textureCoordinates)) {\n   *     // apply post-process stage\n   * } else {\n   *     out_FragColor = texture(colorTexture, v_textureCoordinates);\n   * }\n   * </code>\n   * </p>\n   *\n   * @memberof PostProcessStage.prototype\n   * @type {Array}\n   */\n  selected: {\n    get: function () {\n      return this._selected;\n    },\n    set: function (value) {\n      this._selected = value;\n    },\n  },\n  /**\n   * @private\n   */\n  parentSelected: {\n    get: function () {\n      return this._parentSelected;\n    },\n    set: function (value) {\n      this._parentSelected = value;\n    },\n  },\n});\n\nconst depthTextureRegex = /uniform\\s+sampler2D\\s+depthTexture/g;\n\n/**\n * @private\n */\nPostProcessStage.prototype._isSupported = function (context) {\n  return !depthTextureRegex.test(this._fragmentShader) || context.depthTexture;\n};\n\nfunction getUniformValueGetterAndSetter(stage, uniforms, name) {\n  const currentValue = uniforms[name];\n  if (\n    typeof currentValue === \"string\" ||\n    currentValue instanceof HTMLCanvasElement ||\n    currentValue instanceof HTMLImageElement ||\n    currentValue instanceof HTMLVideoElement ||\n    currentValue instanceof ImageData\n  ) {\n    stage._dirtyUniforms.push(name);\n  }\n\n  return {\n    get: function () {\n      return uniforms[name];\n    },\n    set: function (value) {\n      const currentValue = uniforms[name];\n      uniforms[name] = value;\n\n      const actualUniforms = stage._actualUniforms;\n      const actualValue = actualUniforms[name];\n      if (\n        defined(actualValue) &&\n        actualValue !== currentValue &&\n        actualValue instanceof Texture &&\n        !defined(stage._textureCache.getStageByName(name))\n      ) {\n        stage._texturesToRelease.push(actualValue);\n        delete actualUniforms[name];\n        delete actualUniforms[`${name}Dimensions`];\n      }\n\n      if (currentValue instanceof Texture) {\n        stage._texturesToRelease.push(currentValue);\n      }\n\n      if (\n        typeof value === \"string\" ||\n        value instanceof HTMLCanvasElement ||\n        value instanceof HTMLImageElement ||\n        value instanceof HTMLVideoElement ||\n        value instanceof ImageData\n      ) {\n        stage._dirtyUniforms.push(name);\n      } else {\n        actualUniforms[name] = value;\n      }\n    },\n  };\n}\n\nfunction getUniformMapFunction(stage, name) {\n  return function () {\n    const value = stage._actualUniforms[name];\n    if (typeof value === \"function\") {\n      return value();\n    }\n    return value;\n  };\n}\n\nfunction getUniformMapDimensionsFunction(uniformMap, name) {\n  return function () {\n    const texture = uniformMap[name]();\n    if (defined(texture)) {\n      return texture.dimensions;\n    }\n    return undefined;\n  };\n}\n\nfunction createUniformMap(stage) {\n  if (defined(stage._uniformMap)) {\n    return;\n  }\n\n  const uniformMap = {};\n  const newUniforms = {};\n  const uniforms = stage._uniforms;\n  const actualUniforms = stage._actualUniforms;\n  for (const name in uniforms) {\n    if (uniforms.hasOwnProperty(name)) {\n      if (typeof uniforms[name] !== \"function\") {\n        uniformMap[name] = getUniformMapFunction(stage, name);\n        newUniforms[name] = getUniformValueGetterAndSetter(\n          stage,\n          uniforms,\n          name\n        );\n      } else {\n        uniformMap[name] = uniforms[name];\n        newUniforms[name] = uniforms[name];\n      }\n\n      actualUniforms[name] = uniforms[name];\n\n      const value = uniformMap[name]();\n      if (\n        typeof value === \"string\" ||\n        value instanceof Texture ||\n        value instanceof HTMLImageElement ||\n        value instanceof HTMLCanvasElement ||\n        value instanceof HTMLVideoElement\n      ) {\n        uniformMap[`${name}Dimensions`] = getUniformMapDimensionsFunction(\n          uniformMap,\n          name\n        );\n      }\n    }\n  }\n\n  stage._uniforms = {};\n  Object.defineProperties(stage._uniforms, newUniforms);\n\n  stage._uniformMap = combine(uniformMap, {\n    colorTexture: function () {\n      return stage._colorTexture;\n    },\n    colorTextureDimensions: function () {\n      return stage._colorTexture.dimensions;\n    },\n    depthTexture: function () {\n      return stage._depthTexture;\n    },\n    depthTextureDimensions: function () {\n      return stage._depthTexture.dimensions;\n    },\n    czm_idTexture: function () {\n      return stage._idTexture;\n    },\n    czm_selectedIdTexture: function () {\n      return stage._selectedIdTexture;\n    },\n    czm_selectedIdTextureStep: function () {\n      return 1.0 / stage._selectedIdTexture.width;\n    },\n  });\n}\n\nfunction createDrawCommand(stage, context) {\n  if (\n    defined(stage._command) &&\n    !stage._logDepthChanged &&\n    !stage._selectedDirty\n  ) {\n    return;\n  }\n\n  let fs = stage._fragmentShader;\n  if (defined(stage._selectedIdTexture)) {\n    const width = stage._selectedIdTexture.width;\n\n    fs = fs.replace(/in\\s+vec2\\s+v_textureCoordinates;/g, \"\");\n    fs =\n      `${\n        \"#define CZM_SELECTED_FEATURE \\n\" +\n        \"uniform sampler2D czm_idTexture; \\n\" +\n        \"uniform sampler2D czm_selectedIdTexture; \\n\" +\n        \"uniform float czm_selectedIdTextureStep; \\n\" +\n        \"in vec2 v_textureCoordinates; \\n\" +\n        \"bool czm_selected(vec2 offset) \\n\" +\n        \"{ \\n\" +\n        \"    bool selected = false;\\n\" +\n        \"    vec4 id = texture(czm_idTexture, v_textureCoordinates + offset); \\n\" +\n        \"    for (int i = 0; i < \"\n      }${width}; ++i) \\n` +\n      `    { \\n` +\n      `        vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); \\n` +\n      `        if (all(equal(id, selectedId))) \\n` +\n      `        { \\n` +\n      `            return true; \\n` +\n      `        } \\n` +\n      `    } \\n` +\n      `    return false; \\n` +\n      `} \\n\\n` +\n      `bool czm_selected() \\n` +\n      `{ \\n` +\n      `    return czm_selected(vec2(0.0)); \\n` +\n      `} \\n\\n${fs}`;\n  }\n\n  const fragmentShader = new ShaderSource({\n    defines: [stage._useLogDepth ? \"LOG_DEPTH\" : \"\"],\n    sources: [fs],\n  });\n  stage._command = context.createViewportQuadCommand(fragmentShader, {\n    uniformMap: stage._uniformMap,\n    owner: stage,\n  });\n}\n\nfunction createSampler(stage) {\n  const mode = stage._sampleMode;\n\n  let minFilter;\n  let magFilter;\n\n  if (mode === PostProcessStageSampleMode.LINEAR) {\n    minFilter = TextureMinificationFilter.LINEAR;\n    magFilter = TextureMagnificationFilter.LINEAR;\n  } else {\n    minFilter = TextureMinificationFilter.NEAREST;\n    magFilter = TextureMagnificationFilter.NEAREST;\n  }\n\n  const sampler = stage._sampler;\n  if (\n    !defined(sampler) ||\n    sampler.minificationFilter !== minFilter ||\n    sampler.magnificationFilter !== magFilter\n  ) {\n    stage._sampler = new Sampler({\n      wrapS: TextureWrap.CLAMP_TO_EDGE,\n      wrapT: TextureWrap.CLAMP_TO_EDGE,\n      minificationFilter: minFilter,\n      magnificationFilter: magFilter,\n    });\n  }\n}\n\nfunction createLoadImageFunction(stage, name) {\n  return function (image) {\n    stage._texturesToCreate.push({\n      name: name,\n      source: image,\n    });\n  };\n}\n\nfunction createStageOutputTextureFunction(stage, name) {\n  return function () {\n    return stage._textureCache.getOutputTexture(name);\n  };\n}\n\nfunction updateUniformTextures(stage, context) {\n  let i;\n  let texture;\n  let name;\n\n  const texturesToRelease = stage._texturesToRelease;\n  let length = texturesToRelease.length;\n  for (i = 0; i < length; ++i) {\n    texture = texturesToRelease[i];\n    texture = texture && texture.destroy();\n  }\n  texturesToRelease.length = 0;\n\n  const texturesToCreate = stage._texturesToCreate;\n  length = texturesToCreate.length;\n  for (i = 0; i < length; ++i) {\n    const textureToCreate = texturesToCreate[i];\n    name = textureToCreate.name;\n    const source = textureToCreate.source;\n    stage._actualUniforms[name] = new Texture({\n      context: context,\n      source: source,\n    });\n  }\n  texturesToCreate.length = 0;\n\n  const dirtyUniforms = stage._dirtyUniforms;\n  if (dirtyUniforms.length === 0 && !defined(stage._texturePromise)) {\n    stage._ready = true;\n    return;\n  }\n\n  if (dirtyUniforms.length === 0 || defined(stage._texturePromise)) {\n    return;\n  }\n\n  length = dirtyUniforms.length;\n  const uniforms = stage._uniforms;\n  const promises = [];\n  for (i = 0; i < length; ++i) {\n    name = dirtyUniforms[i];\n    const stageNameUrlOrImage = uniforms[name];\n    const stageWithName = stage._textureCache.getStageByName(\n      stageNameUrlOrImage\n    );\n    if (defined(stageWithName)) {\n      stage._actualUniforms[name] = createStageOutputTextureFunction(\n        stage,\n        stageNameUrlOrImage\n      );\n    } else if (typeof stageNameUrlOrImage === \"string\") {\n      const resource = new Resource({\n        url: stageNameUrlOrImage,\n      });\n\n      promises.push(\n        resource.fetchImage().then(createLoadImageFunction(stage, name))\n      );\n    } else {\n      stage._texturesToCreate.push({\n        name: name,\n        source: stageNameUrlOrImage,\n      });\n    }\n  }\n\n  dirtyUniforms.length = 0;\n\n  if (promises.length > 0) {\n    stage._ready = false;\n    stage._texturePromise = Promise.all(promises).then(function () {\n      stage._ready = true;\n      stage._texturePromise = undefined;\n    });\n  } else {\n    stage._ready = true;\n  }\n}\n\nfunction releaseResources(stage) {\n  if (defined(stage._command)) {\n    stage._command.shaderProgram =\n      stage._command.shaderProgram && stage._command.shaderProgram.destroy();\n    stage._command = undefined;\n  }\n\n  stage._selectedIdTexture =\n    stage._selectedIdTexture && stage._selectedIdTexture.destroy();\n\n  const textureCache = stage._textureCache;\n  if (!defined(textureCache)) {\n    return;\n  }\n\n  const uniforms = stage._uniforms;\n  const actualUniforms = stage._actualUniforms;\n  for (const name in actualUniforms) {\n    if (actualUniforms.hasOwnProperty(name)) {\n      if (actualUniforms[name] instanceof Texture) {\n        if (!defined(textureCache.getStageByName(uniforms[name]))) {\n          actualUniforms[name].destroy();\n        }\n        stage._dirtyUniforms.push(name);\n      }\n    }\n  }\n}\n\nfunction isSelectedTextureDirty(stage) {\n  let length = defined(stage._selected) ? stage._selected.length : 0;\n  const parentLength = defined(stage._parentSelected)\n    ? stage._parentSelected\n    : 0;\n  let dirty =\n    stage._selected !== stage._selectedShadow ||\n    length !== stage._selectedLength;\n  dirty =\n    dirty ||\n    stage._parentSelected !== stage._parentSelectedShadow ||\n    parentLength !== stage._parentSelectedLength;\n\n  if (defined(stage._selected) && defined(stage._parentSelected)) {\n    stage._combinedSelected = stage._selected.concat(stage._parentSelected);\n  } else if (defined(stage._parentSelected)) {\n    stage._combinedSelected = stage._parentSelected;\n  } else {\n    stage._combinedSelected = stage._selected;\n  }\n\n  if (!dirty && defined(stage._combinedSelected)) {\n    if (!defined(stage._combinedSelectedShadow)) {\n      return true;\n    }\n\n    length = stage._combinedSelected.length;\n    for (let i = 0; i < length; ++i) {\n      if (stage._combinedSelected[i] !== stage._combinedSelectedShadow[i]) {\n        return true;\n      }\n    }\n  }\n  return dirty;\n}\n\nfunction createSelectedTexture(stage, context) {\n  if (!stage._selectedDirty) {\n    return;\n  }\n\n  stage._selectedIdTexture =\n    stage._selectedIdTexture && stage._selectedIdTexture.destroy();\n  stage._selectedIdTexture = undefined;\n\n  const features = stage._combinedSelected;\n  if (!defined(features)) {\n    return;\n  }\n\n  let i;\n  let feature;\n\n  let textureLength = 0;\n  const length = features.length;\n  for (i = 0; i < length; ++i) {\n    feature = features[i];\n    if (defined(feature.pickIds)) {\n      textureLength += feature.pickIds.length;\n    } else if (defined(feature.pickId)) {\n      ++textureLength;\n    }\n  }\n\n  if (length === 0 || textureLength === 0) {\n    // max pick id is reserved\n    const empty = new Uint8Array(4);\n    empty[0] = 255;\n    empty[1] = 255;\n    empty[2] = 255;\n    empty[3] = 255;\n\n    stage._selectedIdTexture = new Texture({\n      context: context,\n      pixelFormat: PixelFormat.RGBA,\n      pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n      source: {\n        arrayBufferView: empty,\n        width: 1,\n        height: 1,\n      },\n      sampler: Sampler.NEAREST,\n    });\n    return;\n  }\n\n  let pickColor;\n  let offset = 0;\n  const ids = new Uint8Array(textureLength * 4);\n  for (i = 0; i < length; ++i) {\n    feature = features[i];\n    if (defined(feature.pickIds)) {\n      const pickIds = feature.pickIds;\n      const pickIdsLength = pickIds.length;\n      for (let j = 0; j < pickIdsLength; ++j) {\n        pickColor = pickIds[j].color;\n        ids[offset] = Color.floatToByte(pickColor.red);\n        ids[offset + 1] = Color.floatToByte(pickColor.green);\n        ids[offset + 2] = Color.floatToByte(pickColor.blue);\n        ids[offset + 3] = Color.floatToByte(pickColor.alpha);\n        offset += 4;\n      }\n    } else if (defined(feature.pickId)) {\n      pickColor = feature.pickId.color;\n      ids[offset] = Color.floatToByte(pickColor.red);\n      ids[offset + 1] = Color.floatToByte(pickColor.green);\n      ids[offset + 2] = Color.floatToByte(pickColor.blue);\n      ids[offset + 3] = Color.floatToByte(pickColor.alpha);\n      offset += 4;\n    }\n  }\n\n  stage._selectedIdTexture = new Texture({\n    context: context,\n    pixelFormat: PixelFormat.RGBA,\n    pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n    source: {\n      arrayBufferView: ids,\n      width: textureLength,\n      height: 1,\n    },\n    sampler: Sampler.NEAREST,\n  });\n}\n\n/**\n * A function that will be called before execute. Used to create WebGL resources and load any textures.\n * @param {Context} context The context.\n * @param {boolean} useLogDepth Whether the scene uses a logarithmic depth buffer.\n * @private\n */\nPostProcessStage.prototype.update = function (context, useLogDepth) {\n  if (this.enabled !== this._enabled && !this.enabled) {\n    releaseResources(this);\n  }\n\n  this._enabled = this.enabled;\n  if (!this._enabled) {\n    return;\n  }\n\n  this._logDepthChanged = useLogDepth !== this._useLogDepth;\n  this._useLogDepth = useLogDepth;\n\n  this._selectedDirty = isSelectedTextureDirty(this);\n\n  this._selectedShadow = this._selected;\n  this._parentSelectedShadow = this._parentSelected;\n  this._combinedSelectedShadow = this._combinedSelected;\n  this._selectedLength = defined(this._selected) ? this._selected.length : 0;\n  this._parentSelectedLength = defined(this._parentSelected)\n    ? this._parentSelected.length\n    : 0;\n\n  createSelectedTexture(this, context);\n  createUniformMap(this);\n  updateUniformTextures(this, context);\n  createDrawCommand(this, context);\n  createSampler(this);\n\n  this._selectedDirty = false;\n\n  if (!this._ready) {\n    return;\n  }\n\n  const framebuffer = this._textureCache.getFramebuffer(this._name);\n  this._command.framebuffer = framebuffer;\n\n  if (!defined(framebuffer)) {\n    return;\n  }\n\n  const colorTexture = framebuffer.getColorTexture(0);\n  let renderState;\n  if (\n    colorTexture.width !== context.drawingBufferWidth ||\n    colorTexture.height !== context.drawingBufferHeight\n  ) {\n    renderState = this._renderState;\n    if (\n      !defined(renderState) ||\n      colorTexture.width !== renderState.viewport.width ||\n      colorTexture.height !== renderState.viewport.height\n    ) {\n      this._renderState = RenderState.fromCache({\n        viewport: new BoundingRectangle(\n          0,\n          0,\n          colorTexture.width,\n          colorTexture.height\n        ),\n      });\n    }\n  }\n\n  this._command.renderState = renderState;\n};\n\n/**\n * Executes the post-process stage. The color texture is the texture rendered to by the scene or from the previous stage.\n * @param {Context} context The context.\n * @param {Texture} colorTexture The input color texture.\n * @param {Texture} depthTexture The input depth texture.\n * @param {Texture} idTexture The id texture.\n * @private\n */\nPostProcessStage.prototype.execute = function (\n  context,\n  colorTexture,\n  depthTexture,\n  idTexture\n) {\n  if (\n    !defined(this._command) ||\n    !defined(this._command.framebuffer) ||\n    !this._ready ||\n    !this._enabled\n  ) {\n    return;\n  }\n\n  this._colorTexture = colorTexture;\n  this._depthTexture = depthTexture;\n  this._idTexture = idTexture;\n\n  if (!Sampler.equals(this._colorTexture.sampler, this._sampler)) {\n    this._colorTexture.sampler = this._sampler;\n  }\n\n  const passState =\n    this.scissorRectangle.width > 0 && this.scissorRectangle.height > 0\n      ? this._passState\n      : undefined;\n  if (defined(passState)) {\n    passState.context = context;\n  }\n\n  this._command.execute(context, passState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see PostProcessStage#destroy\n */\nPostProcessStage.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PostProcessStage#isDestroyed\n */\nPostProcessStage.prototype.destroy = function () {\n  releaseResources(this);\n  return destroyObject(this);\n};\nexport default PostProcessStage;\n", "import Check from \"../Core/Check.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\n\n/**\n * A collection of {@link PostProcessStage}s or other post-process composite stages that execute together logically.\n * <p>\n * All stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.\n * If <code>inputPreviousStageTexture</code> is <code>true</code>, the input to each stage is the output texture rendered to by the scene or of the stage that executed before it.\n * If <code>inputPreviousStageTexture</code> is <code>false</code>, the input texture is the same for each stage in the composite. The input texture is the texture rendered to by the scene\n * or the output texture of the previous stage.\n * </p>\n *\n * @alias PostProcessStageComposite\n * @constructor\n *\n * @param {object} options An object with the following properties:\n * @param {Array} options.stages An array of {@link PostProcessStage}s or composites to be executed in order.\n * @param {boolean} [options.inputPreviousStageTexture=true] Whether to execute each post-process stage where the input to one stage is the output of the previous. Otherwise, the input to each contained stage is the output of the stage that executed before the composite.\n * @param {string} [options.name=createGuid()] The unique name of this post-process stage for reference by other composites. If a name is not supplied, a GUID will be generated.\n * @param {object} [options.uniforms] An alias to the uniforms of post-process stages.\n *\n * @exception {DeveloperError} options.stages.length must be greater than 0.0.\n *\n * @see PostProcessStage\n *\n * @example\n * // Example 1: separable blur filter\n * // The input to blurXDirection is the texture rendered to by the scene or the output of the previous stage.\n * // The input to blurYDirection is the texture rendered to by blurXDirection.\n * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({\n *     stages : [blurXDirection, blurYDirection]\n * }));\n *\n * @example\n * // Example 2: referencing the output of another post-process stage\n * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({\n *     inputPreviousStageTexture : false,\n *     stages : [\n *         // The same as Example 1.\n *         new Cesium.PostProcessStageComposite({\n *             inputPreviousStageTexture : true\n *             stages : [blurXDirection, blurYDirection],\n *             name : 'blur'\n *         }),\n *         // The input texture for this stage is the same input texture to blurXDirection since inputPreviousStageTexture is false\n *         new Cesium.PostProcessStage({\n *             fragmentShader : compositeShader,\n *             uniforms : {\n *                 blurTexture : 'blur' // The output of the composite with name 'blur' (the texture that blurYDirection rendered to).\n *             }\n *         })\n *     ]\n * });\n *\n * @example\n * // Example 3: create a uniform alias\n * const uniforms = {};\n * Cesium.defineProperties(uniforms, {\n *     filterSize : {\n *         get : function() {\n *             return blurXDirection.uniforms.filterSize;\n *         },\n *         set : function(value) {\n *             blurXDirection.uniforms.filterSize = blurYDirection.uniforms.filterSize = value;\n *         }\n *     }\n * });\n * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({\n *     stages : [blurXDirection, blurYDirection],\n *     uniforms : uniforms\n * }));\n */\nfunction PostProcessStageComposite(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.stages\", options.stages);\n  Check.typeOf.number.greaterThan(\n    \"options.stages.length\",\n    options.stages.length,\n    0\n  );\n  //>>includeEnd('debug');\n\n  this._stages = options.stages;\n  this._inputPreviousStageTexture = defaultValue(\n    options.inputPreviousStageTexture,\n    true\n  );\n\n  let name = options.name;\n  if (!defined(name)) {\n    name = createGuid();\n  }\n  this._name = name;\n\n  this._uniforms = options.uniforms;\n\n  // used by PostProcessStageCollection\n  this._textureCache = undefined;\n  this._index = undefined;\n\n  this._selected = undefined;\n  this._selectedShadow = undefined;\n  this._parentSelected = undefined;\n  this._parentSelectedShadow = undefined;\n  this._combinedSelected = undefined;\n  this._combinedSelectedShadow = undefined;\n  this._selectedLength = 0;\n  this._parentSelectedLength = 0;\n  this._selectedDirty = true;\n}\n\nObject.defineProperties(PostProcessStageComposite.prototype, {\n  /**\n   * Determines if this post-process stage is ready to be executed.\n   *\n   * @memberof PostProcessStageComposite.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  ready: {\n    get: function () {\n      const stages = this._stages;\n      const length = stages.length;\n      for (let i = 0; i < length; ++i) {\n        if (!stages[i].ready) {\n          return false;\n        }\n      }\n      return true;\n    },\n  },\n  /**\n   * The unique name of this post-process stage for reference by other stages in a PostProcessStageComposite.\n   *\n   * @memberof PostProcessStageComposite.prototype\n   * @type {string}\n   * @readonly\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n  /**\n   * Whether or not to execute this post-process stage when ready.\n   *\n   * @memberof PostProcessStageComposite.prototype\n   * @type {boolean}\n   */\n  enabled: {\n    get: function () {\n      return this._stages[0].enabled;\n    },\n    set: function (value) {\n      const stages = this._stages;\n      const length = stages.length;\n      for (let i = 0; i < length; ++i) {\n        stages[i].enabled = value;\n      }\n    },\n  },\n  /**\n   * An alias to the uniform values of the post-process stages. May be <code>undefined</code>; in which case, get each stage to set uniform values.\n   * @memberof PostProcessStageComposite.prototype\n   * @type {object}\n   */\n  uniforms: {\n    get: function () {\n      return this._uniforms;\n    },\n  },\n  /**\n   * All post-process stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.\n   * If <code>inputPreviousStageTexture</code> is <code>true</code>, the input to each stage is the output texture rendered to by the scene or of the stage that executed before it.\n   * If <code>inputPreviousStageTexture</code> is <code>false</code>, the input texture is the same for each stage in the composite. The input texture is the texture rendered to by the scene\n   * or the output texture of the previous stage.\n   *\n   * @memberof PostProcessStageComposite.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  inputPreviousStageTexture: {\n    get: function () {\n      return this._inputPreviousStageTexture;\n    },\n  },\n  /**\n   * The number of post-process stages in this composite.\n   *\n   * @memberof PostProcessStageComposite.prototype\n   * @type {number}\n   * @readonly\n   */\n  length: {\n    get: function () {\n      return this._stages.length;\n    },\n  },\n  /**\n   * The features selected for applying the post-process.\n   *\n   * @memberof PostProcessStageComposite.prototype\n   * @type {Array}\n   */\n  selected: {\n    get: function () {\n      return this._selected;\n    },\n    set: function (value) {\n      this._selected = value;\n    },\n  },\n  /**\n   * @private\n   */\n  parentSelected: {\n    get: function () {\n      return this._parentSelected;\n    },\n    set: function (value) {\n      this._parentSelected = value;\n    },\n  },\n});\n\n/**\n * @private\n */\nPostProcessStageComposite.prototype._isSupported = function (context) {\n  const stages = this._stages;\n  const length = stages.length;\n  for (let i = 0; i < length; ++i) {\n    if (!stages[i]._isSupported(context)) {\n      return false;\n    }\n  }\n  return true;\n};\n\n/**\n * Gets the post-process stage at <code>index</code>\n *\n * @param {number} index The index of the post-process stage or composite.\n * @return {PostProcessStage|PostProcessStageComposite} The post-process stage or composite at index.\n *\n * @exception {DeveloperError} index must be greater than or equal to 0.\n * @exception {DeveloperError} index must be less than {@link PostProcessStageComposite#length}.\n */\nPostProcessStageComposite.prototype.get = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\n  Check.typeOf.number.lessThan(\"index\", index, this.length);\n  //>>includeEnd('debug');\n  return this._stages[index];\n};\n\nfunction isSelectedTextureDirty(stage) {\n  let length = defined(stage._selected) ? stage._selected.length : 0;\n  const parentLength = defined(stage._parentSelected)\n    ? stage._parentSelected\n    : 0;\n  let dirty =\n    stage._selected !== stage._selectedShadow ||\n    length !== stage._selectedLength;\n  dirty =\n    dirty ||\n    stage._parentSelected !== stage._parentSelectedShadow ||\n    parentLength !== stage._parentSelectedLength;\n\n  if (defined(stage._selected) && defined(stage._parentSelected)) {\n    stage._combinedSelected = stage._selected.concat(stage._parentSelected);\n  } else if (defined(stage._parentSelected)) {\n    stage._combinedSelected = stage._parentSelected;\n  } else {\n    stage._combinedSelected = stage._selected;\n  }\n\n  if (!dirty && defined(stage._combinedSelected)) {\n    if (!defined(stage._combinedSelectedShadow)) {\n      return true;\n    }\n\n    length = stage._combinedSelected.length;\n    for (let i = 0; i < length; ++i) {\n      if (stage._combinedSelected[i] !== stage._combinedSelectedShadow[i]) {\n        return true;\n      }\n    }\n  }\n  return dirty;\n}\n\n/**\n * A function that will be called before execute. Updates each post-process stage in the composite.\n * @param {Context} context The context.\n * @param {boolean} useLogDepth Whether the scene uses a logarithmic depth buffer.\n * @private\n */\nPostProcessStageComposite.prototype.update = function (context, useLogDepth) {\n  this._selectedDirty = isSelectedTextureDirty(this);\n\n  this._selectedShadow = this._selected;\n  this._parentSelectedShadow = this._parentSelected;\n  this._combinedSelectedShadow = this._combinedSelected;\n  this._selectedLength = defined(this._selected) ? this._selected.length : 0;\n  this._parentSelectedLength = defined(this._parentSelected)\n    ? this._parentSelected.length\n    : 0;\n\n  const stages = this._stages;\n  const length = stages.length;\n  for (let i = 0; i < length; ++i) {\n    const stage = stages[i];\n    if (this._selectedDirty) {\n      stage.parentSelected = this._combinedSelected;\n    }\n    stage.update(context, useLogDepth);\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see PostProcessStageComposite#destroy\n */\nPostProcessStageComposite.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PostProcessStageComposite#isDestroyed\n */\nPostProcessStageComposite.prototype.destroy = function () {\n  const stages = this._stages;\n  const length = stages.length;\n  for (let i = 0; i < length; ++i) {\n    stages[i].destroy();\n  }\n  return destroyObject(this);\n};\nexport default PostProcessStageComposite;\n", "import buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Color from \"../Core/Color.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defined from \"../Core/defined.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport AcesTonemapping from \"../Shaders/PostProcessStages/AcesTonemappingStage.js\";\nimport AmbientOcclusionGenerate from \"../Shaders/PostProcessStages/AmbientOcclusionGenerate.js\";\nimport AmbientOcclusionModulate from \"../Shaders/PostProcessStages/AmbientOcclusionModulate.js\";\nimport BlackAndWhite from \"../Shaders/PostProcessStages/BlackAndWhite.js\";\nimport BloomComposite from \"../Shaders/PostProcessStages/BloomComposite.js\";\nimport Brightness from \"../Shaders/PostProcessStages/Brightness.js\";\nimport ContrastBias from \"../Shaders/PostProcessStages/ContrastBias.js\";\nimport DepthOfField from \"../Shaders/PostProcessStages/DepthOfField.js\";\nimport DepthView from \"../Shaders/PostProcessStages/DepthView.js\";\nimport EdgeDetection from \"../Shaders/PostProcessStages/EdgeDetection.js\";\nimport FilmicTonemapping from \"../Shaders/PostProcessStages/FilmicTonemapping.js\";\nimport FXAA from \"../Shaders/PostProcessStages/FXAA.js\";\nimport GaussianBlur1D from \"../Shaders/PostProcessStages/GaussianBlur1D.js\";\nimport LensFlare from \"../Shaders/PostProcessStages/LensFlare.js\";\nimport ModifiedReinhardTonemapping from \"../Shaders/PostProcessStages/ModifiedReinhardTonemapping.js\";\nimport NightVision from \"../Shaders/PostProcessStages/NightVision.js\";\nimport ReinhardTonemapping from \"../Shaders/PostProcessStages/ReinhardTonemapping.js\";\nimport Silhouette from \"../Shaders/PostProcessStages/Silhouette.js\";\nimport FXAA3_11 from \"../Shaders/FXAA3_11.js\";\nimport AutoExposure from \"./AutoExposure.js\";\nimport PostProcessStage from \"./PostProcessStage.js\";\nimport PostProcessStageComposite from \"./PostProcessStageComposite.js\";\nimport PostProcessStageSampleMode from \"./PostProcessStageSampleMode.js\";\n\n/**\n * Contains functions for creating common post-process stages.\n *\n * @namespace PostProcessStageLibrary\n */\nconst PostProcessStageLibrary = {};\n\nfunction createBlur(name) {\n  const delta = 1.0;\n  const sigma = 2.0;\n  const stepSize = 1.0;\n\n  const blurShader = `#define USE_STEP_SIZE\\n${GaussianBlur1D}`;\n  const blurX = new PostProcessStage({\n    name: `${name}_x_direction`,\n    fragmentShader: blurShader,\n    uniforms: {\n      delta: delta,\n      sigma: sigma,\n      stepSize: stepSize,\n      direction: 0.0,\n    },\n    sampleMode: PostProcessStageSampleMode.LINEAR,\n  });\n  const blurY = new PostProcessStage({\n    name: `${name}_y_direction`,\n    fragmentShader: blurShader,\n    uniforms: {\n      delta: delta,\n      sigma: sigma,\n      stepSize: stepSize,\n      direction: 1.0,\n    },\n    sampleMode: PostProcessStageSampleMode.LINEAR,\n  });\n\n  const uniforms = {};\n  Object.defineProperties(uniforms, {\n    delta: {\n      get: function () {\n        return blurX.uniforms.delta;\n      },\n      set: function (value) {\n        const blurXUniforms = blurX.uniforms;\n        const blurYUniforms = blurY.uniforms;\n        blurXUniforms.delta = blurYUniforms.delta = value;\n      },\n    },\n    sigma: {\n      get: function () {\n        return blurX.uniforms.sigma;\n      },\n      set: function (value) {\n        const blurXUniforms = blurX.uniforms;\n        const blurYUniforms = blurY.uniforms;\n        blurXUniforms.sigma = blurYUniforms.sigma = value;\n      },\n    },\n    stepSize: {\n      get: function () {\n        return blurX.uniforms.stepSize;\n      },\n      set: function (value) {\n        const blurXUniforms = blurX.uniforms;\n        const blurYUniforms = blurY.uniforms;\n        blurXUniforms.stepSize = blurYUniforms.stepSize = value;\n      },\n    },\n  });\n  return new PostProcessStageComposite({\n    name: name,\n    stages: [blurX, blurY],\n    uniforms: uniforms,\n  });\n}\n\n/**\n * Creates a post-process stage that applies a Gaussian blur to the input texture. This stage is usually applied in conjunction with another stage.\n * <p>\n * This stage has the following uniforms: <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.\n * </p>\n * <p>\n * <code>delta</code> and <code>sigma</code> are used to compute the weights of a Gaussian filter. The equation is <code>exp((-0.5 * delta * delta) / (sigma * sigma))</code>.\n * The default value for <code>delta</code> is <code>1.0</code>. The default value for <code>sigma</code> is <code>2.0</code>.\n * <code>stepSize</code> is the distance to the next texel. The default is <code>1.0</code>.\n * </p>\n * @return {PostProcessStageComposite} A post-process stage that applies a Gaussian blur to the input texture.\n */\nPostProcessStageLibrary.createBlurStage = function () {\n  return createBlur(\"czm_blur\");\n};\n\n/**\n * Creates a post-process stage that applies a depth of field effect.\n * <p>\n * Depth of field simulates camera focus. Objects in the scene that are in focus\n * will be clear whereas objects not in focus will be blurred.\n * </p>\n * <p>\n * This stage has the following uniforms: <code>focalDistance</code>, <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.\n * </p>\n * <p>\n * <code>focalDistance</code> is the distance in meters from the camera to set the camera focus.\n * </p>\n * <p>\n * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.\n * The blur is applied to the areas out of focus.\n * </p>\n * @return {PostProcessStageComposite} A post-process stage that applies a depth of field effect.\n */\nPostProcessStageLibrary.createDepthOfFieldStage = function () {\n  const blur = createBlur(\"czm_depth_of_field_blur\");\n  const dof = new PostProcessStage({\n    name: \"czm_depth_of_field_composite\",\n    fragmentShader: DepthOfField,\n    uniforms: {\n      focalDistance: 5.0,\n      blurTexture: blur.name,\n    },\n  });\n\n  const uniforms = {};\n  Object.defineProperties(uniforms, {\n    focalDistance: {\n      get: function () {\n        return dof.uniforms.focalDistance;\n      },\n      set: function (value) {\n        dof.uniforms.focalDistance = value;\n      },\n    },\n    delta: {\n      get: function () {\n        return blur.uniforms.delta;\n      },\n      set: function (value) {\n        blur.uniforms.delta = value;\n      },\n    },\n    sigma: {\n      get: function () {\n        return blur.uniforms.sigma;\n      },\n      set: function (value) {\n        blur.uniforms.sigma = value;\n      },\n    },\n    stepSize: {\n      get: function () {\n        return blur.uniforms.stepSize;\n      },\n      set: function (value) {\n        blur.uniforms.stepSize = value;\n      },\n    },\n  });\n  return new PostProcessStageComposite({\n    name: \"czm_depth_of_field\",\n    stages: [blur, dof],\n    inputPreviousStageTexture: false,\n    uniforms: uniforms,\n  });\n};\n\n/**\n * Whether or not a depth of field stage is supported.\n * <p>\n * This stage requires the WEBGL_depth_texture extension.\n * </p>\n *\n * @param {Scene} scene The scene.\n * @return {boolean} Whether this post process stage is supported.\n *\n * @see {Context#depthTexture}\n * @see {@link http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/|WEBGL_depth_texture}\n */\nPostProcessStageLibrary.isDepthOfFieldSupported = function (scene) {\n  return scene.context.depthTexture;\n};\n\n/**\n * Creates a post-process stage that detects edges.\n * <p>\n * Writes the color to the output texture with alpha set to 1.0 when it is on an edge.\n * </p>\n * <p>\n * This stage has the following uniforms: <code>color</code> and <code>length</code>\n * </p>\n * <ul>\n * <li><code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.</li>\n * <li><code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.</li>\n * </ul>\n * <p>\n * This stage is not supported in 2D.\n * </p>\n * @return {PostProcessStage} A post-process stage that applies an edge detection effect.\n *\n * @example\n * // multiple silhouette effects\n * const yellowEdge = Cesium.PostProcessStageLibrary.createEdgeDetectionStage();\n * yellowEdge.uniforms.color = Cesium.Color.YELLOW;\n * yellowEdge.selected = [feature0];\n *\n * const greenEdge = Cesium.PostProcessStageLibrary.createEdgeDetectionStage();\n * greenEdge.uniforms.color = Cesium.Color.LIME;\n * greenEdge.selected = [feature1];\n *\n * // draw edges around feature0 and feature1\n * postProcessStages.add(Cesium.PostProcessStageLibrary.createSilhouetteStage([yellowEdge, greenEdge]);\n */\nPostProcessStageLibrary.createEdgeDetectionStage = function () {\n  // unique name generated on call so more than one effect can be added\n  const name = createGuid();\n  return new PostProcessStage({\n    name: `czm_edge_detection_${name}`,\n    fragmentShader: EdgeDetection,\n    uniforms: {\n      length: 0.25,\n      color: Color.clone(Color.BLACK),\n    },\n  });\n};\n\n/**\n * Whether or not an edge detection stage is supported.\n * <p>\n * This stage requires the WEBGL_depth_texture extension.\n * </p>\n *\n * @param {Scene} scene The scene.\n * @return {boolean} Whether this post process stage is supported.\n *\n * @see {Context#depthTexture}\n * @see {@link http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/|WEBGL_depth_texture}\n */\nPostProcessStageLibrary.isEdgeDetectionSupported = function (scene) {\n  return scene.context.depthTexture;\n};\n\nfunction getSilhouetteEdgeDetection(edgeDetectionStages) {\n  if (!defined(edgeDetectionStages)) {\n    return PostProcessStageLibrary.createEdgeDetectionStage();\n  }\n\n  const edgeDetection = new PostProcessStageComposite({\n    name: \"czm_edge_detection_multiple\",\n    stages: edgeDetectionStages,\n    inputPreviousStageTexture: false,\n  });\n\n  const compositeUniforms = {};\n  let fsDecl = \"\";\n  let fsLoop = \"\";\n  for (let i = 0; i < edgeDetectionStages.length; ++i) {\n    fsDecl += `uniform sampler2D edgeTexture${i}; \\n`;\n    fsLoop +=\n      `        vec4 edge${i} = texture(edgeTexture${i}, v_textureCoordinates); \\n` +\n      `        if (edge${i}.a > 0.0) \\n` +\n      `        { \\n` +\n      `            color = edge${i}; \\n` +\n      `            break; \\n` +\n      `        } \\n`;\n    compositeUniforms[`edgeTexture${i}`] = edgeDetectionStages[i].name;\n  }\n\n  const fs =\n    `${fsDecl}in vec2 v_textureCoordinates; \\n` +\n    `void main() { \\n` +\n    `    vec4 color = vec4(0.0); \\n` +\n    `    for (int i = 0; i < ${edgeDetectionStages.length}; i++) \\n` +\n    `    { \\n${fsLoop}    } \\n` +\n    `    out_FragColor = color; \\n` +\n    `} \\n`;\n\n  const edgeComposite = new PostProcessStage({\n    name: \"czm_edge_detection_combine\",\n    fragmentShader: fs,\n    uniforms: compositeUniforms,\n  });\n  return new PostProcessStageComposite({\n    name: \"czm_edge_detection_composite\",\n    stages: [edgeDetection, edgeComposite],\n  });\n}\n\n/**\n * Creates a post-process stage that applies a silhouette effect.\n * <p>\n * A silhouette effect composites the color from the edge detection pass with input color texture.\n * </p>\n * <p>\n * This stage has the following uniforms when <code>edgeDetectionStages</code> is <code>undefined</code>: <code>color</code> and <code>length</code>\n * </p>\n * <p>\n * <code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.\n * <code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.\n * </p>\n * @param {PostProcessStage[]} [edgeDetectionStages] An array of edge detection post process stages.\n * @return {PostProcessStageComposite} A post-process stage that applies a silhouette effect.\n */\nPostProcessStageLibrary.createSilhouetteStage = function (edgeDetectionStages) {\n  const edgeDetection = getSilhouetteEdgeDetection(edgeDetectionStages);\n  const silhouetteProcess = new PostProcessStage({\n    name: \"czm_silhouette_color_edges\",\n    fragmentShader: Silhouette,\n    uniforms: {\n      silhouetteTexture: edgeDetection.name,\n    },\n  });\n\n  return new PostProcessStageComposite({\n    name: \"czm_silhouette\",\n    stages: [edgeDetection, silhouetteProcess],\n    inputPreviousStageTexture: false,\n    uniforms: edgeDetection.uniforms,\n  });\n};\n\n/**\n * Whether or not a silhouette stage is supported.\n * <p>\n * This stage requires the WEBGL_depth_texture extension.\n * </p>\n *\n * @param {Scene} scene The scene.\n * @return {boolean} Whether this post process stage is supported.\n *\n * @see {Context#depthTexture}\n * @see {@link http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/|WEBGL_depth_texture}\n */\nPostProcessStageLibrary.isSilhouetteSupported = function (scene) {\n  return scene.context.depthTexture;\n};\n\n/**\n * Creates a post-process stage that applies a bloom effect to the input texture.\n * <p>\n * A bloom effect adds glow effect, makes bright areas brighter, and dark areas darker.\n * </p>\n * <p>\n * This post-process stage has the following uniforms: <code>contrast</code>, <code>brightness</code>, <code>glowOnly</code>,\n * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.\n * </p>\n * <ul>\n * <li><code>contrast</code> is a scalar value in the range [-255.0, 255.0] and affects the contract of the effect. The default value is <code>128.0</code>.</li>\n * <li><code>brightness</code> is a scalar value. The input texture RGB value is converted to hue, saturation, and brightness (HSB) then this value is\n * added to the brightness. The default value is <code>-0.3</code>.</li>\n * <li><code>glowOnly</code> is a boolean value. When <code>true</code>, only the glow effect will be shown. When <code>false</code>, the glow will be added to the input texture.\n * The default value is <code>false</code>. This is a debug option for viewing the effects when changing the other uniform values.</li>\n * </ul>\n * <p>\n * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.\n * </p>\n * @return {PostProcessStageComposite} A post-process stage to applies a bloom effect.\n *\n * @private\n */\nPostProcessStageLibrary.createBloomStage = function () {\n  const contrastBias = new PostProcessStage({\n    name: \"czm_bloom_contrast_bias\",\n    fragmentShader: ContrastBias,\n    uniforms: {\n      contrast: 128.0,\n      brightness: -0.3,\n    },\n  });\n  const blur = createBlur(\"czm_bloom_blur\");\n  const generateComposite = new PostProcessStageComposite({\n    name: \"czm_bloom_contrast_bias_blur\",\n    stages: [contrastBias, blur],\n  });\n\n  const bloomComposite = new PostProcessStage({\n    name: \"czm_bloom_generate_composite\",\n    fragmentShader: BloomComposite,\n    uniforms: {\n      glowOnly: false,\n      bloomTexture: generateComposite.name,\n    },\n  });\n\n  const uniforms = {};\n  Object.defineProperties(uniforms, {\n    glowOnly: {\n      get: function () {\n        return bloomComposite.uniforms.glowOnly;\n      },\n      set: function (value) {\n        bloomComposite.uniforms.glowOnly = value;\n      },\n    },\n    contrast: {\n      get: function () {\n        return contrastBias.uniforms.contrast;\n      },\n      set: function (value) {\n        contrastBias.uniforms.contrast = value;\n      },\n    },\n    brightness: {\n      get: function () {\n        return contrastBias.uniforms.brightness;\n      },\n      set: function (value) {\n        contrastBias.uniforms.brightness = value;\n      },\n    },\n    delta: {\n      get: function () {\n        return blur.uniforms.delta;\n      },\n      set: function (value) {\n        blur.uniforms.delta = value;\n      },\n    },\n    sigma: {\n      get: function () {\n        return blur.uniforms.sigma;\n      },\n      set: function (value) {\n        blur.uniforms.sigma = value;\n      },\n    },\n    stepSize: {\n      get: function () {\n        return blur.uniforms.stepSize;\n      },\n      set: function (value) {\n        blur.uniforms.stepSize = value;\n      },\n    },\n  });\n\n  return new PostProcessStageComposite({\n    name: \"czm_bloom\",\n    stages: [generateComposite, bloomComposite],\n    inputPreviousStageTexture: false,\n    uniforms: uniforms,\n  });\n};\n\n/**\n * Creates a post-process stage that Horizon-based Ambient Occlusion (HBAO) to the input texture.\n * <p>\n * Ambient occlusion simulates shadows from ambient light. These shadows would always be present when the\n * surface receives light and regardless of the light's position.\n * </p>\n * <p>\n * The uniforms have the following properties: <code>intensity</code>, <code>bias</code>, <code>lengthCap</code>,\n * <code>stepSize</code>, <code>frustumLength</code>, <code>randomTexture</code>, <code>ambientOcclusionOnly</code>,\n * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code>.\n * </p>\n * <ul>\n * <li><code>intensity</code> is a scalar value used to lighten or darken the shadows exponentially. Higher values make the shadows darker. The default value is <code>3.0</code>.</li>\n * <li><code>bias</code> is a scalar value representing an angle in radians. If the dot product between the normal of the sample and the vector to the camera is less than this value,\n * sampling stops in the current direction. This is used to remove shadows from near planar edges. The default value is <code>0.1</code>.</li>\n * <li><code>lengthCap</code> is a scalar value representing a length in meters. If the distance from the current sample to first sample is greater than this value,\n * sampling stops in the current direction. The default value is <code>0.26</code>.</li>\n * <li><code>stepSize</code> is a scalar value indicating the distance to the next texel sample in the current direction. The default value is <code>1.95</code>.</li>\n * <li><code>frustumLength</code> is a scalar value in meters. If the current fragment has a distance from the camera greater than this value, ambient occlusion is not computed for the fragment.\n * The default value is <code>1000.0</code>.</li>\n * <li><code>randomTexture</code> is a texture where the red channel is a random value in [0.0, 1.0]. The default value is <code>undefined</code>. This texture needs to be set.</li>\n * <li><code>ambientOcclusionOnly</code> is a boolean value. When <code>true</code>, only the shadows generated are written to the output. When <code>false</code>, the input texture is modulated\n * with the ambient occlusion. This is a useful debug option for seeing the effects of changing the uniform values. The default value is <code>false</code>.</li>\n * </ul>\n * <p>\n * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.\n * The blur is applied to the shadows generated from the image to make them smoother.\n * </p>\n * @return {PostProcessStageComposite} A post-process stage that applies an ambient occlusion effect.\n *\n * @private\n */\nPostProcessStageLibrary.createAmbientOcclusionStage = function () {\n  const generate = new PostProcessStage({\n    name: \"czm_ambient_occlusion_generate\",\n    fragmentShader: AmbientOcclusionGenerate,\n    uniforms: {\n      intensity: 3.0,\n      bias: 0.1,\n      lengthCap: 0.26,\n      stepSize: 1.95,\n      frustumLength: 1000.0,\n      randomTexture: undefined,\n    },\n  });\n  const blur = createBlur(\"czm_ambient_occlusion_blur\");\n  blur.uniforms.stepSize = 0.86;\n  const generateAndBlur = new PostProcessStageComposite({\n    name: \"czm_ambient_occlusion_generate_blur\",\n    stages: [generate, blur],\n  });\n\n  const ambientOcclusionModulate = new PostProcessStage({\n    name: \"czm_ambient_occlusion_composite\",\n    fragmentShader: AmbientOcclusionModulate,\n    uniforms: {\n      ambientOcclusionOnly: false,\n      ambientOcclusionTexture: generateAndBlur.name,\n    },\n  });\n\n  const uniforms = {};\n  Object.defineProperties(uniforms, {\n    intensity: {\n      get: function () {\n        return generate.uniforms.intensity;\n      },\n      set: function (value) {\n        generate.uniforms.intensity = value;\n      },\n    },\n    bias: {\n      get: function () {\n        return generate.uniforms.bias;\n      },\n      set: function (value) {\n        generate.uniforms.bias = value;\n      },\n    },\n    lengthCap: {\n      get: function () {\n        return generate.uniforms.lengthCap;\n      },\n      set: function (value) {\n        generate.uniforms.lengthCap = value;\n      },\n    },\n    stepSize: {\n      get: function () {\n        return generate.uniforms.stepSize;\n      },\n      set: function (value) {\n        generate.uniforms.stepSize = value;\n      },\n    },\n    frustumLength: {\n      get: function () {\n        return generate.uniforms.frustumLength;\n      },\n      set: function (value) {\n        generate.uniforms.frustumLength = value;\n      },\n    },\n    randomTexture: {\n      get: function () {\n        return generate.uniforms.randomTexture;\n      },\n      set: function (value) {\n        generate.uniforms.randomTexture = value;\n      },\n    },\n    delta: {\n      get: function () {\n        return blur.uniforms.delta;\n      },\n      set: function (value) {\n        blur.uniforms.delta = value;\n      },\n    },\n    sigma: {\n      get: function () {\n        return blur.uniforms.sigma;\n      },\n      set: function (value) {\n        blur.uniforms.sigma = value;\n      },\n    },\n    blurStepSize: {\n      get: function () {\n        return blur.uniforms.stepSize;\n      },\n      set: function (value) {\n        blur.uniforms.stepSize = value;\n      },\n    },\n    ambientOcclusionOnly: {\n      get: function () {\n        return ambientOcclusionModulate.uniforms.ambientOcclusionOnly;\n      },\n      set: function (value) {\n        ambientOcclusionModulate.uniforms.ambientOcclusionOnly = value;\n      },\n    },\n  });\n\n  return new PostProcessStageComposite({\n    name: \"czm_ambient_occlusion\",\n    stages: [generateAndBlur, ambientOcclusionModulate],\n    inputPreviousStageTexture: false,\n    uniforms: uniforms,\n  });\n};\n\n/**\n * Whether or not an ambient occlusion stage is supported.\n * <p>\n * This stage requires the WEBGL_depth_texture extension.\n * </p>\n *\n * @param {Scene} scene The scene.\n * @return {boolean} Whether this post process stage is supported.\n *\n * @see {Context#depthTexture}\n * @see {@link http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/|WEBGL_depth_texture}\n */\nPostProcessStageLibrary.isAmbientOcclusionSupported = function (scene) {\n  return scene.context.depthTexture;\n};\n\nconst fxaaFS = `#define FXAA_QUALITY_PRESET 39 \\n${FXAA3_11}\\n${FXAA}`;\n\n/**\n * Creates a post-process stage that applies Fast Approximate Anti-aliasing (FXAA) to the input texture.\n * @return {PostProcessStage} A post-process stage that applies Fast Approximate Anti-aliasing to the input texture.\n *\n * @private\n */\nPostProcessStageLibrary.createFXAAStage = function () {\n  return new PostProcessStage({\n    name: \"czm_FXAA\",\n    fragmentShader: fxaaFS,\n    sampleMode: PostProcessStageSampleMode.LINEAR,\n  });\n};\n\n/**\n * Creates a post-process stage that applies ACES tonemapping operator.\n * @param {boolean} useAutoExposure Whether or not to use auto-exposure.\n * @return {PostProcessStage} A post-process stage that applies ACES tonemapping operator.\n * @private\n */\nPostProcessStageLibrary.createAcesTonemappingStage = function (\n  useAutoExposure\n) {\n  let fs = useAutoExposure ? \"#define AUTO_EXPOSURE\\n\" : \"\";\n  fs += AcesTonemapping;\n  return new PostProcessStage({\n    name: \"czm_aces\",\n    fragmentShader: fs,\n    uniforms: {\n      autoExposure: undefined,\n    },\n  });\n};\n\n/**\n * Creates a post-process stage that applies filmic tonemapping operator.\n * @param {boolean} useAutoExposure Whether or not to use auto-exposure.\n * @return {PostProcessStage} A post-process stage that applies filmic tonemapping operator.\n * @private\n */\nPostProcessStageLibrary.createFilmicTonemappingStage = function (\n  useAutoExposure\n) {\n  let fs = useAutoExposure ? \"#define AUTO_EXPOSURE\\n\" : \"\";\n  fs += FilmicTonemapping;\n  return new PostProcessStage({\n    name: \"czm_filmic\",\n    fragmentShader: fs,\n    uniforms: {\n      autoExposure: undefined,\n    },\n  });\n};\n\n/**\n * Creates a post-process stage that applies Reinhard tonemapping operator.\n * @param {boolean} useAutoExposure Whether or not to use auto-exposure.\n * @return {PostProcessStage} A post-process stage that applies Reinhard tonemapping operator.\n * @private\n */\nPostProcessStageLibrary.createReinhardTonemappingStage = function (\n  useAutoExposure\n) {\n  let fs = useAutoExposure ? \"#define AUTO_EXPOSURE\\n\" : \"\";\n  fs += ReinhardTonemapping;\n  return new PostProcessStage({\n    name: \"czm_reinhard\",\n    fragmentShader: fs,\n    uniforms: {\n      autoExposure: undefined,\n    },\n  });\n};\n\n/**\n * Creates a post-process stage that applies modified Reinhard tonemapping operator.\n * @param {boolean} useAutoExposure Whether or not to use auto-exposure.\n * @return {PostProcessStage} A post-process stage that applies modified Reinhard tonemapping operator.\n * @private\n */\nPostProcessStageLibrary.createModifiedReinhardTonemappingStage = function (\n  useAutoExposure\n) {\n  let fs = useAutoExposure ? \"#define AUTO_EXPOSURE\\n\" : \"\";\n  fs += ModifiedReinhardTonemapping;\n  return new PostProcessStage({\n    name: \"czm_modified_reinhard\",\n    fragmentShader: fs,\n    uniforms: {\n      white: Color.WHITE,\n      autoExposure: undefined,\n    },\n  });\n};\n\n/**\n * Creates a post-process stage that finds the average luminance of the input texture.\n * @return {PostProcessStage} A post-process stage that finds the average luminance of the input texture.\n * @private\n */\nPostProcessStageLibrary.createAutoExposureStage = function () {\n  return new AutoExposure();\n};\n\n/**\n * Creates a post-process stage that renders the input texture with black and white gradations.\n * <p>\n * This stage has one uniform value, <code>gradations</code>, which scales the luminance of each pixel.\n * </p>\n * @return {PostProcessStage} A post-process stage that renders the input texture with black and white gradations.\n */\nPostProcessStageLibrary.createBlackAndWhiteStage = function () {\n  return new PostProcessStage({\n    name: \"czm_black_and_white\",\n    fragmentShader: BlackAndWhite,\n    uniforms: {\n      gradations: 5.0,\n    },\n  });\n};\n\n/**\n * Creates a post-process stage that saturates the input texture.\n * <p>\n * This stage has one uniform value, <code>brightness</code>, which scales the saturation of each pixel.\n * </p>\n * @return {PostProcessStage} A post-process stage that saturates the input texture.\n */\nPostProcessStageLibrary.createBrightnessStage = function () {\n  return new PostProcessStage({\n    name: \"czm_brightness\",\n    fragmentShader: Brightness,\n    uniforms: {\n      brightness: 0.5,\n    },\n  });\n};\n\n/**\n * Creates a post-process stage that adds a night vision effect to the input texture.\n * @return {PostProcessStage} A post-process stage that adds a night vision effect to the input texture.\n */\nPostProcessStageLibrary.createNightVisionStage = function () {\n  return new PostProcessStage({\n    name: \"czm_night_vision\",\n    fragmentShader: NightVision,\n  });\n};\n\n/**\n * Creates a post-process stage that replaces the input color texture with a black and white texture representing the fragment depth at each pixel.\n * @return {PostProcessStage} A post-process stage that replaces the input color texture with a black and white texture representing the fragment depth at each pixel.\n *\n * @private\n */\nPostProcessStageLibrary.createDepthViewStage = function () {\n  return new PostProcessStage({\n    name: \"czm_depth_view\",\n    fragmentShader: DepthView,\n  });\n};\n\n/**\n * Creates a post-process stage that applies an effect simulating light flaring a camera lens.\n * <p>\n * This stage has the following uniforms: <code>dirtTexture</code>, <code>starTexture</code>, <code>intensity</code>, <code>distortion</code>, <code>ghostDispersal</code>,\n * <code>haloWidth</code>, <code>dirtAmount</code>, and <code>earthRadius</code>.\n * <ul>\n * <li><code>dirtTexture</code> is a texture sampled to simulate dirt on the lens.</li>\n * <li><code>starTexture</code> is the texture sampled for the star pattern of the flare.</li>\n * <li><code>intensity</code> is a scalar multiplied by the result of the lens flare. The default value is <code>2.0</code>.</li>\n * <li><code>distortion</code> is a scalar value that affects the chromatic effect distortion. The default value is <code>10.0</code>.</li>\n * <li><code>ghostDispersal</code> is a scalar indicating how far the halo effect is from the center of the texture. The default value is <code>0.4</code>.</li>\n * <li><code>haloWidth</code> is a scalar representing the width of the halo  from the ghost dispersal. The default value is <code>0.4</code>.</li>\n * <li><code>dirtAmount</code> is a scalar representing the amount of dirt on the lens. The default value is <code>0.4</code>.</li>\n * <li><code>earthRadius</code> is the maximum radius of the earth. The default value is <code>Ellipsoid.WGS84.maximumRadius</code>.</li>\n * </ul>\n * </p>\n * @return {PostProcessStage} A post-process stage for applying a lens flare effect.\n */\nPostProcessStageLibrary.createLensFlareStage = function () {\n  return new PostProcessStage({\n    name: \"czm_lens_flare\",\n    fragmentShader: LensFlare,\n    uniforms: {\n      dirtTexture: buildModuleUrl(\"Assets/Textures/LensFlare/DirtMask.jpg\"),\n      starTexture: buildModuleUrl(\"Assets/Textures/LensFlare/StarBurst.jpg\"),\n      intensity: 2.0,\n      distortion: 10.0,\n      ghostDispersal: 0.4,\n      haloWidth: 0.4,\n      dirtAmount: 0.4,\n      earthRadius: Ellipsoid.WGS84.maximumRadius,\n    },\n  });\n};\nexport default PostProcessStageLibrary;\n", "import Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\n\n/**\n * Creates a minimal amount of textures and framebuffers.\n *\n * @alias PostProcessStageTextureCache\n * @constructor\n *\n * @param {PostProcessStageCollection} postProcessStageCollection The post process collection.\n *\n * @private\n */\nfunction PostProcessStageTextureCache(postProcessStageCollection) {\n  this._collection = postProcessStageCollection;\n\n  this._framebuffers = [];\n  this._stageNameToFramebuffer = {};\n\n  this._width = undefined;\n  this._height = undefined;\n  this._updateDependencies = false;\n}\n\nfunction getLastStageName(stage) {\n  while (defined(stage.length)) {\n    stage = stage.get(stage.length - 1);\n  }\n  return stage.name;\n}\n\nfunction getStageDependencies(\n  collection,\n  context,\n  dependencies,\n  stage,\n  previousName\n) {\n  if (!stage.enabled || !stage._isSupported(context)) {\n    return previousName;\n  }\n\n  const stageDependencies = (dependencies[stage.name] = {});\n  if (defined(previousName)) {\n    const previous = collection.getStageByName(previousName);\n    stageDependencies[getLastStageName(previous)] = true;\n  }\n  const uniforms = stage.uniforms;\n  if (defined(uniforms)) {\n    const uniformNames = Object.getOwnPropertyNames(uniforms);\n    const uniformNamesLength = uniformNames.length;\n    for (let i = 0; i < uniformNamesLength; ++i) {\n      const value = uniforms[uniformNames[i]];\n      if (typeof value === \"string\") {\n        const dependent = collection.getStageByName(value);\n        if (defined(dependent)) {\n          stageDependencies[getLastStageName(dependent)] = true;\n        }\n      }\n    }\n  }\n\n  return stage.name;\n}\n\nfunction getCompositeDependencies(\n  collection,\n  context,\n  dependencies,\n  composite,\n  previousName\n) {\n  if (\n    (defined(composite.enabled) && !composite.enabled) ||\n    (defined(composite._isSupported) && !composite._isSupported(context))\n  ) {\n    return previousName;\n  }\n\n  const originalDependency = previousName;\n\n  const inSeries =\n    !defined(composite.inputPreviousStageTexture) ||\n    composite.inputPreviousStageTexture;\n  let currentName = previousName;\n  const length = composite.length;\n  for (let i = 0; i < length; ++i) {\n    const stage = composite.get(i);\n    if (defined(stage.length)) {\n      currentName = getCompositeDependencies(\n        collection,\n        context,\n        dependencies,\n        stage,\n        previousName\n      );\n    } else {\n      currentName = getStageDependencies(\n        collection,\n        context,\n        dependencies,\n        stage,\n        previousName\n      );\n    }\n    // Stages in a series only depend on the previous stage\n    if (inSeries) {\n      previousName = currentName;\n    }\n  }\n\n  // Stages not in a series depend on every stage executed before it since it could reference it as a uniform.\n  // This prevents looking at the dependencies of each stage in the composite, but might create more framebuffers than necessary.\n  // In practice, there are only 2-3 stages in these composites.\n  let j;\n  let name;\n  if (!inSeries) {\n    for (j = 1; j < length; ++j) {\n      name = getLastStageName(composite.get(j));\n      const currentDependencies = dependencies[name];\n      for (let k = 0; k < j; ++k) {\n        currentDependencies[getLastStageName(composite.get(k))] = true;\n      }\n    }\n  } else {\n    for (j = 1; j < length; ++j) {\n      name = getLastStageName(composite.get(j));\n      if (!defined(dependencies[name])) {\n        dependencies[name] = {};\n      }\n      dependencies[name][originalDependency] = true;\n    }\n  }\n\n  return currentName;\n}\n\nfunction getDependencies(collection, context) {\n  const dependencies = {};\n\n  if (defined(collection.ambientOcclusion)) {\n    const ao = collection.ambientOcclusion;\n    const bloom = collection.bloom;\n    const tonemapping = collection._tonemapping;\n    const fxaa = collection.fxaa;\n\n    let previousName = getCompositeDependencies(\n      collection,\n      context,\n      dependencies,\n      ao,\n      undefined\n    );\n    previousName = getCompositeDependencies(\n      collection,\n      context,\n      dependencies,\n      bloom,\n      previousName\n    );\n    previousName = getStageDependencies(\n      collection,\n      context,\n      dependencies,\n      tonemapping,\n      previousName\n    );\n    previousName = getCompositeDependencies(\n      collection,\n      context,\n      dependencies,\n      collection,\n      previousName\n    );\n    getStageDependencies(collection, context, dependencies, fxaa, previousName);\n  } else {\n    getCompositeDependencies(\n      collection,\n      context,\n      dependencies,\n      collection,\n      undefined\n    );\n  }\n\n  return dependencies;\n}\n\nfunction getFramebuffer(cache, stageName, dependencies) {\n  const collection = cache._collection;\n  const stage = collection.getStageByName(stageName);\n\n  const textureScale = stage._textureScale;\n  const forcePowerOfTwo = stage._forcePowerOfTwo;\n  const pixelFormat = stage._pixelFormat;\n  const pixelDatatype = stage._pixelDatatype;\n  const clearColor = stage._clearColor;\n\n  let i;\n  let framebuffer;\n  const framebuffers = cache._framebuffers;\n  const length = framebuffers.length;\n  for (i = 0; i < length; ++i) {\n    framebuffer = framebuffers[i];\n\n    if (\n      textureScale !== framebuffer.textureScale ||\n      forcePowerOfTwo !== framebuffer.forcePowerOfTwo ||\n      pixelFormat !== framebuffer.pixelFormat ||\n      pixelDatatype !== framebuffer.pixelDatatype ||\n      !Color.equals(clearColor, framebuffer.clearColor)\n    ) {\n      continue;\n    }\n\n    const stageNames = framebuffer.stages;\n    const stagesLength = stageNames.length;\n    let foundConflict = false;\n    for (let j = 0; j < stagesLength; ++j) {\n      if (dependencies[stageNames[j]]) {\n        foundConflict = true;\n        break;\n      }\n    }\n\n    if (!foundConflict) {\n      break;\n    }\n  }\n\n  if (defined(framebuffer) && i < length) {\n    framebuffer.stages.push(stageName);\n    return framebuffer;\n  }\n\n  framebuffer = {\n    textureScale: textureScale,\n    forcePowerOfTwo: forcePowerOfTwo,\n    pixelFormat: pixelFormat,\n    pixelDatatype: pixelDatatype,\n    clearColor: clearColor,\n    stages: [stageName],\n    buffer: new FramebufferManager({\n      pixelFormat: pixelFormat,\n      pixelDatatype: pixelDatatype,\n    }),\n    clear: undefined,\n  };\n\n  framebuffers.push(framebuffer);\n  return framebuffer;\n}\n\nfunction createFramebuffers(cache, context) {\n  const dependencies = getDependencies(cache._collection, context);\n  for (const stageName in dependencies) {\n    if (dependencies.hasOwnProperty(stageName)) {\n      cache._stageNameToFramebuffer[stageName] = getFramebuffer(\n        cache,\n        stageName,\n        dependencies[stageName]\n      );\n    }\n  }\n}\n\nfunction releaseResources(cache) {\n  const framebuffers = cache._framebuffers;\n  const length = framebuffers.length;\n  for (let i = 0; i < length; ++i) {\n    const framebuffer = framebuffers[i];\n    framebuffer.buffer.destroy();\n  }\n}\n\nfunction updateFramebuffers(cache, context) {\n  const width = cache._width;\n  const height = cache._height;\n\n  const framebuffers = cache._framebuffers;\n  const length = framebuffers.length;\n  for (let i = 0; i < length; ++i) {\n    const framebuffer = framebuffers[i];\n\n    const scale = framebuffer.textureScale;\n    let textureWidth = Math.ceil(width * scale);\n    let textureHeight = Math.ceil(height * scale);\n\n    let size = Math.min(textureWidth, textureHeight);\n    if (framebuffer.forcePowerOfTwo) {\n      if (!CesiumMath.isPowerOfTwo(size)) {\n        size = CesiumMath.nextPowerOfTwo(size);\n      }\n      textureWidth = size;\n      textureHeight = size;\n    }\n\n    framebuffer.buffer.update(context, textureWidth, textureHeight);\n    framebuffer.clear = new ClearCommand({\n      color: framebuffer.clearColor,\n      framebuffer: framebuffer.buffer.framebuffer,\n    });\n  }\n}\n\nPostProcessStageTextureCache.prototype.updateDependencies = function () {\n  this._updateDependencies = true;\n};\n\n/**\n * Called before the stages in the collection are executed. Creates the minimum amount of framebuffers for a post-process collection.\n *\n * @param {Context} context The context.\n */\nPostProcessStageTextureCache.prototype.update = function (context) {\n  const collection = this._collection;\n  const updateDependencies = this._updateDependencies;\n  const aoEnabled =\n    defined(collection.ambientOcclusion) &&\n    collection.ambientOcclusion.enabled &&\n    collection.ambientOcclusion._isSupported(context);\n  const bloomEnabled =\n    defined(collection.bloom) &&\n    collection.bloom.enabled &&\n    collection.bloom._isSupported(context);\n  const tonemappingEnabled =\n    defined(collection._tonemapping) &&\n    collection._tonemapping.enabled &&\n    collection._tonemapping._isSupported(context);\n  const fxaaEnabled =\n    defined(collection.fxaa) &&\n    collection.fxaa.enabled &&\n    collection.fxaa._isSupported(context);\n  const needsCheckDimensionsUpdate =\n    !defined(collection._activeStages) ||\n    collection._activeStages.length > 0 ||\n    aoEnabled ||\n    bloomEnabled ||\n    tonemappingEnabled ||\n    fxaaEnabled;\n  if (\n    updateDependencies ||\n    (!needsCheckDimensionsUpdate && this._framebuffers.length > 0)\n  ) {\n    releaseResources(this);\n    this._framebuffers.length = 0;\n    this._stageNameToFramebuffer = {};\n    this._width = undefined;\n    this._height = undefined;\n  }\n\n  if (!updateDependencies && !needsCheckDimensionsUpdate) {\n    return;\n  }\n\n  if (this._framebuffers.length === 0) {\n    createFramebuffers(this, context);\n  }\n\n  const width = context.drawingBufferWidth;\n  const height = context.drawingBufferHeight;\n  const dimensionsChanged = this._width !== width || this._height !== height;\n  if (!updateDependencies && !dimensionsChanged) {\n    return;\n  }\n\n  this._width = width;\n  this._height = height;\n  this._updateDependencies = false;\n  releaseResources(this);\n  updateFramebuffers(this, context);\n};\n\n/**\n * Clears all of the framebuffers.\n *\n * @param {Context} context The context.\n */\nPostProcessStageTextureCache.prototype.clear = function (context) {\n  const framebuffers = this._framebuffers;\n  for (let i = 0; i < framebuffers.length; ++i) {\n    framebuffers[i].clear.execute(context);\n  }\n};\n\n/**\n * Gets the stage with the given name.\n * @param {string} name The name of the stage.\n * @return {PostProcessStage|PostProcessStageComposite}\n */\nPostProcessStageTextureCache.prototype.getStageByName = function (name) {\n  return this._collection.getStageByName(name);\n};\n\n/**\n * Gets the output texture for a stage with the given name.\n * @param {string} name The name of the stage.\n * @return {Texture|undefined} The output texture of the stage with the given name.\n */\nPostProcessStageTextureCache.prototype.getOutputTexture = function (name) {\n  return this._collection.getOutputTexture(name);\n};\n\n/**\n * Gets the framebuffer for a stage with the given name.\n *\n * @param {string} name The name of the stage.\n * @return {Framebuffer|undefined} The framebuffer for the stage with the given name.\n */\nPostProcessStageTextureCache.prototype.getFramebuffer = function (name) {\n  const framebuffer = this._stageNameToFramebuffer[name];\n  if (!defined(framebuffer)) {\n    return undefined;\n  }\n  return framebuffer.buffer.framebuffer;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see PostProcessStageTextureCache#destroy\n */\nPostProcessStageTextureCache.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PostProcessStageTextureCache#isDestroyed\n */\nPostProcessStageTextureCache.prototype.destroy = function () {\n  releaseResources(this);\n  return destroyObject(this);\n};\nexport default PostProcessStageTextureCache;\n", "/**\n * A tonemapping algorithm when rendering with high dynamic range.\n *\n * @enum {number}\n * @private\n */\nconst Tonemapper = {\n  /**\n   * Use the Reinhard tonemapping operator.\n   *\n   * @type {number}\n   * @constant\n   */\n  REINHARD: 0,\n\n  /**\n   * Use the modified Reinhard tonemapping operator.\n   *\n   * @type {number}\n   * @constant\n   */\n  MODIFIED_REINHARD: 1,\n\n  /**\n   * Use the Filmic tonemapping operator.\n   *\n   * @type {number}\n   * @constant\n   */\n  FILMIC: 2,\n\n  /**\n   * Use the ACES tonemapping operator.\n   *\n   * @type {number}\n   * @constant\n   */\n  ACES: 3,\n\n  /**\n   * @private\n   */\n  validate: function (tonemapper) {\n    return (\n      tonemapper === Tonemapper.REINHARD ||\n      tonemapper === Tonemapper.MODIFIED_REINHARD ||\n      tonemapper === Tonemapper.FILMIC ||\n      tonemapper === Tonemapper.ACES\n    );\n  },\n};\nexport default Object.freeze(Tonemapper);\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport PassThrough from \"../Shaders/PostProcessStages/PassThrough.js\";\nimport PostProcessStageLibrary from \"./PostProcessStageLibrary.js\";\nimport PostProcessStageTextureCache from \"./PostProcessStageTextureCache.js\";\nimport Tonemapper from \"./Tonemapper.js\";\n\nconst stackScratch = [];\n\n/**\n * A collection of {@link PostProcessStage}s and/or {@link PostProcessStageComposite}s.\n * <p>\n * The input texture for each post-process stage is the texture rendered to by the scene or the texture rendered\n * to by the previous stage in the collection.\n * </p>\n * <p>\n * If the ambient occlusion or bloom stages are enabled, they will execute before all other stages.\n * </p>\n * <p>\n * If the FXAA stage is enabled, it will execute after all other stages.\n * </p>\n *\n * @alias PostProcessStageCollection\n * @constructor\n */\nfunction PostProcessStageCollection() {\n  const fxaa = PostProcessStageLibrary.createFXAAStage();\n  const ao = PostProcessStageLibrary.createAmbientOcclusionStage();\n  const bloom = PostProcessStageLibrary.createBloomStage();\n\n  // Auto-exposure is currently disabled because most shaders output a value in [0.0, 1.0].\n  // Some shaders, such as the atmosphere and ground atmosphere, output values slightly over 1.0.\n  this._autoExposureEnabled = false;\n  this._autoExposure = PostProcessStageLibrary.createAutoExposureStage();\n  this._tonemapping = undefined;\n  this._tonemapper = undefined;\n\n  // set tonemapper and tonemapping\n  this.tonemapper = Tonemapper.ACES;\n\n  const tonemapping = this._tonemapping;\n\n  fxaa.enabled = false;\n  ao.enabled = false;\n  bloom.enabled = false;\n  tonemapping.enabled = false; // will be enabled if necessary in update\n\n  const textureCache = new PostProcessStageTextureCache(this);\n\n  const stageNames = {};\n  const stack = stackScratch;\n  stack.push(fxaa, ao, bloom, tonemapping);\n  while (stack.length > 0) {\n    const stage = stack.pop();\n    stageNames[stage.name] = stage;\n    stage._textureCache = textureCache;\n\n    const length = stage.length;\n    if (defined(length)) {\n      for (let i = 0; i < length; ++i) {\n        stack.push(stage.get(i));\n      }\n    }\n  }\n\n  this._stages = [];\n  this._activeStages = [];\n  this._previousActiveStages = [];\n\n  this._randomTexture = undefined; // For AO\n\n  const that = this;\n  ao.uniforms.randomTexture = function () {\n    return that._randomTexture;\n  };\n\n  this._ao = ao;\n  this._bloom = bloom;\n  this._fxaa = fxaa;\n\n  this._aoEnabled = undefined;\n  this._bloomEnabled = undefined;\n  this._tonemappingEnabled = undefined;\n  this._fxaaEnabled = undefined;\n\n  this._activeStagesChanged = false;\n  this._stagesRemoved = false;\n  this._textureCacheDirty = false;\n\n  this._stageNames = stageNames;\n  this._textureCache = textureCache;\n}\n\nObject.defineProperties(PostProcessStageCollection.prototype, {\n  /**\n   * Determines if all of the post-process stages in the collection are ready to be executed.\n   *\n   * @memberof PostProcessStageCollection.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  ready: {\n    get: function () {\n      let readyAndEnabled = false;\n      const stages = this._stages;\n      const length = stages.length;\n      for (let i = length - 1; i >= 0; --i) {\n        const stage = stages[i];\n        readyAndEnabled = readyAndEnabled || (stage.ready && stage.enabled);\n      }\n\n      const fxaa = this._fxaa;\n      const ao = this._ao;\n      const bloom = this._bloom;\n      const tonemapping = this._tonemapping;\n\n      readyAndEnabled = readyAndEnabled || (fxaa.ready && fxaa.enabled);\n      readyAndEnabled = readyAndEnabled || (ao.ready && ao.enabled);\n      readyAndEnabled = readyAndEnabled || (bloom.ready && bloom.enabled);\n      readyAndEnabled =\n        readyAndEnabled || (tonemapping.ready && tonemapping.enabled);\n\n      return readyAndEnabled;\n    },\n  },\n  /**\n   * A post-process stage for Fast Approximate Anti-aliasing.\n   * <p>\n   * When enabled, this stage will execute after all others.\n   * </p>\n   *\n   * @memberof PostProcessStageCollection.prototype\n   * @type {PostProcessStage}\n   * @readonly\n   */\n  fxaa: {\n    get: function () {\n      return this._fxaa;\n    },\n  },\n  /**\n   * A post-process stage that applies Horizon-based Ambient Occlusion (HBAO) to the input texture.\n   * <p>\n   * Ambient occlusion simulates shadows from ambient light. These shadows would always be present when the\n   * surface receives light and regardless of the light's position.\n   * </p>\n   * <p>\n   * The uniforms have the following properties: <code>intensity</code>, <code>bias</code>, <code>lengthCap</code>,\n   * <code>stepSize</code>, <code>frustumLength</code>, <code>ambientOcclusionOnly</code>,\n   * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code>.\n   * </p>\n   * <ul>\n   * <li><code>intensity</code> is a scalar value used to lighten or darken the shadows exponentially. Higher values make the shadows darker. The default value is <code>3.0</code>.</li>\n   *\n   * <li><code>bias</code> is a scalar value representing an angle in radians. If the dot product between the normal of the sample and the vector to the camera is less than this value,\n   * sampling stops in the current direction. This is used to remove shadows from near planar edges. The default value is <code>0.1</code>.</li>\n   *\n   * <li><code>lengthCap</code> is a scalar value representing a length in meters. If the distance from the current sample to first sample is greater than this value,\n   * sampling stops in the current direction. The default value is <code>0.26</code>.</li>\n   *\n   * <li><code>stepSize</code> is a scalar value indicating the distance to the next texel sample in the current direction. The default value is <code>1.95</code>.</li>\n   *\n   * <li><code>frustumLength</code> is a scalar value in meters. If the current fragment has a distance from the camera greater than this value, ambient occlusion is not computed for the fragment.\n   * The default value is <code>1000.0</code>.</li>\n   *\n   * <li><code>ambientOcclusionOnly</code> is a boolean value. When <code>true</code>, only the shadows generated are written to the output. When <code>false</code>, the input texture is modulated\n   * with the ambient occlusion. This is a useful debug option for seeing the effects of changing the uniform values. The default value is <code>false</code>.</li>\n   * </ul>\n   * <p>\n   * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.\n   * The blur is applied to the shadows generated from the image to make them smoother.\n   * </p>\n   * <p>\n   * When enabled, this stage will execute before all others.\n   * </p>\n   *\n   * @memberof PostProcessStageCollection.prototype\n   * @type {PostProcessStageComposite}\n   * @readonly\n   */\n  ambientOcclusion: {\n    get: function () {\n      return this._ao;\n    },\n  },\n  /**\n   * A post-process stage for a bloom effect.\n   * <p>\n   * A bloom effect adds glow effect, makes bright areas brighter, and dark areas darker.\n   * </p>\n   * <p>\n   * This stage has the following uniforms: <code>contrast</code>, <code>brightness</code>, <code>glowOnly</code>,\n   * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.\n   * </p>\n   * <ul>\n   * <li><code>contrast</code> is a scalar value in the range [-255.0, 255.0] and affects the contract of the effect. The default value is <code>128.0</code>.</li>\n   *\n   * <li><code>brightness</code> is a scalar value. The input texture RGB value is converted to hue, saturation, and brightness (HSB) then this value is\n   * added to the brightness. The default value is <code>-0.3</code>.</li>\n   *\n   * <li><code>glowOnly</code> is a boolean value. When <code>true</code>, only the glow effect will be shown. When <code>false</code>, the glow will be added to the input texture.\n   * The default value is <code>false</code>. This is a debug option for viewing the effects when changing the other uniform values.</li>\n   * </ul>\n   * <p>\n   * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.\n   * The blur is applied to the shadows generated from the image to make them smoother.\n   * </p>\n   * <p>\n   * When enabled, this stage will execute before all others.\n   * </p>\n   *\n   * @memberOf PostProcessStageCollection.prototype\n   * @type {PostProcessStageComposite}\n   * @readonly\n   */\n  bloom: {\n    get: function () {\n      return this._bloom;\n    },\n  },\n  /**\n   * The number of post-process stages in this collection.\n   *\n   * @memberof PostProcessStageCollection.prototype\n   * @type {number}\n   * @readonly\n   */\n  length: {\n    get: function () {\n      removeStages(this);\n      return this._stages.length;\n    },\n  },\n  /**\n   * A reference to the last texture written to when executing the post-process stages in this collection.\n   *\n   * @memberof PostProcessStageCollection.prototype\n   * @type {Texture}\n   * @readonly\n   * @private\n   */\n  outputTexture: {\n    get: function () {\n      const fxaa = this._fxaa;\n      if (fxaa.enabled && fxaa.ready) {\n        return this.getOutputTexture(fxaa.name);\n      }\n\n      const stages = this._stages;\n      const length = stages.length;\n      for (let i = length - 1; i >= 0; --i) {\n        const stage = stages[i];\n        if (defined(stage) && stage.ready && stage.enabled) {\n          return this.getOutputTexture(stage.name);\n        }\n      }\n\n      const tonemapping = this._tonemapping;\n      if (tonemapping.enabled && tonemapping.ready) {\n        return this.getOutputTexture(tonemapping.name);\n      }\n\n      const bloom = this._bloom;\n      if (bloom.enabled && bloom.ready) {\n        return this.getOutputTexture(bloom.name);\n      }\n\n      const ao = this._ao;\n      if (ao.enabled && ao.ready) {\n        return this.getOutputTexture(ao.name);\n      }\n\n      return undefined;\n    },\n  },\n  /**\n   * Whether the collection has a stage that has selected features.\n   *\n   * @memberof PostProcessStageCollection.prototype\n   * @type {boolean}\n   * @readonly\n   * @private\n   */\n  hasSelected: {\n    get: function () {\n      const stages = this._stages.slice();\n      while (stages.length > 0) {\n        const stage = stages.pop();\n        if (!defined(stage)) {\n          continue;\n        }\n        if (defined(stage.selected)) {\n          return true;\n        }\n        const length = stage.length;\n        if (defined(length)) {\n          for (let i = 0; i < length; ++i) {\n            stages.push(stage.get(i));\n          }\n        }\n      }\n      return false;\n    },\n  },\n\n  /**\n   * Gets and sets the tonemapping algorithm used when rendering with high dynamic range.\n   *\n   * @memberof PostProcessStageCollection.prototype\n   * @type {Tonemapper}\n   * @private\n   */\n  tonemapper: {\n    get: function () {\n      return this._tonemapper;\n    },\n    set: function (value) {\n      if (this._tonemapper === value) {\n        return;\n      }\n      //>>includeStart('debug', pragmas.debug);\n      if (!Tonemapper.validate(value)) {\n        throw new DeveloperError(\"tonemapper was set to an invalid value.\");\n      }\n      //>>includeEnd('debug');\n\n      if (defined(this._tonemapping)) {\n        delete this._stageNames[this._tonemapping.name];\n        this._tonemapping.destroy();\n      }\n\n      const useAutoExposure = this._autoExposureEnabled;\n      let tonemapper;\n\n      switch (value) {\n        case Tonemapper.REINHARD:\n          tonemapper = PostProcessStageLibrary.createReinhardTonemappingStage(\n            useAutoExposure\n          );\n          break;\n        case Tonemapper.MODIFIED_REINHARD:\n          tonemapper = PostProcessStageLibrary.createModifiedReinhardTonemappingStage(\n            useAutoExposure\n          );\n          break;\n        case Tonemapper.FILMIC:\n          tonemapper = PostProcessStageLibrary.createFilmicTonemappingStage(\n            useAutoExposure\n          );\n          break;\n        default:\n          tonemapper = PostProcessStageLibrary.createAcesTonemappingStage(\n            useAutoExposure\n          );\n          break;\n      }\n\n      if (useAutoExposure) {\n        const autoexposure = this._autoExposure;\n        tonemapper.uniforms.autoExposure = function () {\n          return autoexposure.outputTexture;\n        };\n      }\n\n      this._tonemapper = value;\n      this._tonemapping = tonemapper;\n\n      if (defined(this._stageNames)) {\n        this._stageNames[tonemapper.name] = tonemapper;\n        tonemapper._textureCache = this._textureCache;\n      }\n\n      this._textureCacheDirty = true;\n    },\n  },\n});\n\nfunction removeStages(collection) {\n  if (!collection._stagesRemoved) {\n    return;\n  }\n\n  collection._stagesRemoved = false;\n\n  const newStages = [];\n  const stages = collection._stages;\n  const length = stages.length;\n  for (let i = 0, j = 0; i < length; ++i) {\n    const stage = stages[i];\n    if (stage) {\n      stage._index = j++;\n      newStages.push(stage);\n    }\n  }\n\n  collection._stages = newStages;\n}\n\n/**\n * Adds the post-process stage to the collection.\n *\n * @param {PostProcessStage|PostProcessStageComposite} stage The post-process stage to add to the collection.\n * @return {PostProcessStage|PostProcessStageComposite} The post-process stage that was added to the collection.\n *\n * @exception {DeveloperError} The post-process stage has already been added to the collection or does not have a unique name.\n */\nPostProcessStageCollection.prototype.add = function (stage) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"stage\", stage);\n  //>>includeEnd('debug');\n\n  const stageNames = this._stageNames;\n\n  const stack = stackScratch;\n  stack.push(stage);\n  while (stack.length > 0) {\n    const currentStage = stack.pop();\n    //>>includeStart('debug', pragmas.debug);\n    if (defined(stageNames[currentStage.name])) {\n      throw new DeveloperError(\n        `${currentStage.name} has already been added to the collection or does not have a unique name.`\n      );\n    }\n    //>>includeEnd('debug');\n    stageNames[currentStage.name] = currentStage;\n    currentStage._textureCache = this._textureCache;\n\n    const length = currentStage.length;\n    if (defined(length)) {\n      for (let i = 0; i < length; ++i) {\n        stack.push(currentStage.get(i));\n      }\n    }\n  }\n\n  const stages = this._stages;\n  stage._index = stages.length;\n  stages.push(stage);\n  this._textureCacheDirty = true;\n  return stage;\n};\n\n/**\n * Removes a post-process stage from the collection and destroys it.\n *\n * @param {PostProcessStage|PostProcessStageComposite} stage The post-process stage to remove from the collection.\n * @return {boolean} Whether the post-process stage was removed.\n */\nPostProcessStageCollection.prototype.remove = function (stage) {\n  if (!this.contains(stage)) {\n    return false;\n  }\n\n  const stageNames = this._stageNames;\n\n  const stack = stackScratch;\n  stack.push(stage);\n  while (stack.length > 0) {\n    const currentStage = stack.pop();\n    delete stageNames[currentStage.name];\n\n    const length = currentStage.length;\n    if (defined(length)) {\n      for (let i = 0; i < length; ++i) {\n        stack.push(currentStage.get(i));\n      }\n    }\n  }\n\n  this._stages[stage._index] = undefined;\n  this._stagesRemoved = true;\n  this._textureCacheDirty = true;\n  stage._index = undefined;\n  stage._textureCache = undefined;\n  stage.destroy();\n  return true;\n};\n\n/**\n * Returns whether the collection contains a post-process stage.\n *\n * @param {PostProcessStage|PostProcessStageComposite} stage The post-process stage.\n * @return {boolean} Whether the collection contains the post-process stage.\n */\nPostProcessStageCollection.prototype.contains = function (stage) {\n  return (\n    defined(stage) &&\n    defined(stage._index) &&\n    stage._textureCache === this._textureCache\n  );\n};\n\n/**\n * Gets the post-process stage at <code>index</code>.\n *\n * @param {number} index The index of the post-process stage.\n * @return {PostProcessStage|PostProcessStageComposite} The post-process stage at index.\n */\nPostProcessStageCollection.prototype.get = function (index) {\n  removeStages(this);\n  const stages = this._stages;\n  //>>includeStart('debug', pragmas.debug);\n  const length = stages.length;\n  Check.typeOf.number.greaterThanOrEquals(\"stages length\", length, 0);\n  Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\n  Check.typeOf.number.lessThan(\"index\", index, length);\n  //>>includeEnd('debug');\n  return stages[index];\n};\n\n/**\n * Removes all post-process stages from the collection and destroys them.\n */\nPostProcessStageCollection.prototype.removeAll = function () {\n  const stages = this._stages;\n  const length = stages.length;\n  for (let i = 0; i < length; ++i) {\n    this.remove(stages[i]);\n  }\n  stages.length = 0;\n};\n\n/**\n * Gets a post-process stage in the collection by its name.\n *\n * @param {string} name The name of the post-process stage.\n * @return {PostProcessStage|PostProcessStageComposite} The post-process stage.\n *\n * @private\n */\nPostProcessStageCollection.prototype.getStageByName = function (name) {\n  return this._stageNames[name];\n};\n\n/**\n * Called before the post-process stages in the collection are executed. Calls update for each stage and creates WebGL resources.\n *\n * @param {Context} context The context.\n * @param {boolean} useLogDepth Whether the scene uses a logarithmic depth buffer.\n *\n * @private\n */\nPostProcessStageCollection.prototype.update = function (\n  context,\n  useLogDepth,\n  useHdr\n) {\n  removeStages(this);\n\n  const previousActiveStages = this._activeStages;\n  const activeStages = (this._activeStages = this._previousActiveStages);\n  this._previousActiveStages = previousActiveStages;\n\n  const stages = this._stages;\n  let length = (activeStages.length = stages.length);\n\n  let i;\n  let stage;\n  let count = 0;\n  for (i = 0; i < length; ++i) {\n    stage = stages[i];\n    if (stage.ready && stage.enabled && stage._isSupported(context)) {\n      activeStages[count++] = stage;\n    }\n  }\n\n  activeStages.length = count;\n\n  let activeStagesChanged = count !== previousActiveStages.length;\n  if (!activeStagesChanged) {\n    for (i = 0; i < count; ++i) {\n      if (activeStages[i] !== previousActiveStages[i]) {\n        activeStagesChanged = true;\n        break;\n      }\n    }\n  }\n\n  const ao = this._ao;\n  const bloom = this._bloom;\n  const autoexposure = this._autoExposure;\n  const tonemapping = this._tonemapping;\n  const fxaa = this._fxaa;\n\n  tonemapping.enabled = useHdr;\n\n  const aoEnabled = ao.enabled && ao._isSupported(context);\n  const bloomEnabled = bloom.enabled && bloom._isSupported(context);\n  const tonemappingEnabled =\n    tonemapping.enabled && tonemapping._isSupported(context);\n  const fxaaEnabled = fxaa.enabled && fxaa._isSupported(context);\n\n  if (\n    activeStagesChanged ||\n    this._textureCacheDirty ||\n    aoEnabled !== this._aoEnabled ||\n    bloomEnabled !== this._bloomEnabled ||\n    tonemappingEnabled !== this._tonemappingEnabled ||\n    fxaaEnabled !== this._fxaaEnabled\n  ) {\n    // The number of stages to execute has changed.\n    // Update dependencies and recreate framebuffers.\n    this._textureCache.updateDependencies();\n\n    this._aoEnabled = aoEnabled;\n    this._bloomEnabled = bloomEnabled;\n    this._tonemappingEnabled = tonemappingEnabled;\n    this._fxaaEnabled = fxaaEnabled;\n    this._textureCacheDirty = false;\n  }\n\n  if (defined(this._randomTexture) && !aoEnabled) {\n    this._randomTexture.destroy();\n    this._randomTexture = undefined;\n  }\n\n  if (!defined(this._randomTexture) && aoEnabled) {\n    length = 256 * 256 * 3;\n    const random = new Uint8Array(length);\n    for (i = 0; i < length; i += 3) {\n      random[i] = Math.floor(Math.random() * 255.0);\n    }\n\n    this._randomTexture = new Texture({\n      context: context,\n      pixelFormat: PixelFormat.RGB,\n      pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n      source: {\n        arrayBufferView: random,\n        width: 256,\n        height: 256,\n      },\n      sampler: new Sampler({\n        wrapS: TextureWrap.REPEAT,\n        wrapT: TextureWrap.REPEAT,\n        minificationFilter: TextureMinificationFilter.NEAREST,\n        magnificationFilter: TextureMagnificationFilter.NEAREST,\n      }),\n    });\n  }\n\n  this._textureCache.update(context);\n\n  fxaa.update(context, useLogDepth);\n  ao.update(context, useLogDepth);\n  bloom.update(context, useLogDepth);\n  tonemapping.update(context, useLogDepth);\n\n  if (this._autoExposureEnabled) {\n    autoexposure.update(context, useLogDepth);\n  }\n\n  length = stages.length;\n  for (i = 0; i < length; ++i) {\n    stages[i].update(context, useLogDepth);\n  }\n\n  count = 0;\n  for (i = 0; i < length; ++i) {\n    stage = stages[i];\n    if (stage.ready && stage.enabled && stage._isSupported(context)) {\n      count++;\n    }\n  }\n\n  activeStagesChanged = count !== activeStages.length;\n  if (activeStagesChanged) {\n    this.update(context, useLogDepth, useHdr);\n  }\n};\n\n/**\n * Clears all of the framebuffers used by the stages.\n *\n * @param {Context} context The context.\n *\n * @private\n */\nPostProcessStageCollection.prototype.clear = function (context) {\n  this._textureCache.clear(context);\n\n  if (this._autoExposureEnabled) {\n    this._autoExposure.clear(context);\n  }\n};\n\nfunction getOutputTexture(stage) {\n  while (defined(stage.length)) {\n    stage = stage.get(stage.length - 1);\n  }\n  return stage.outputTexture;\n}\n\n/**\n * Gets the output texture of a stage with the given name.\n *\n * @param {string} stageName The name of the stage.\n * @return {Texture|undefined} The texture rendered to by the stage with the given name.\n *\n * @private\n */\nPostProcessStageCollection.prototype.getOutputTexture = function (stageName) {\n  const stage = this.getStageByName(stageName);\n  if (!defined(stage)) {\n    return undefined;\n  }\n  return getOutputTexture(stage);\n};\n\nfunction execute(stage, context, colorTexture, depthTexture, idTexture) {\n  if (defined(stage.execute)) {\n    stage.execute(context, colorTexture, depthTexture, idTexture);\n    return;\n  }\n\n  const length = stage.length;\n  let i;\n\n  if (stage.inputPreviousStageTexture) {\n    execute(stage.get(0), context, colorTexture, depthTexture, idTexture);\n    for (i = 1; i < length; ++i) {\n      execute(\n        stage.get(i),\n        context,\n        getOutputTexture(stage.get(i - 1)),\n        depthTexture,\n        idTexture\n      );\n    }\n  } else {\n    for (i = 0; i < length; ++i) {\n      execute(stage.get(i), context, colorTexture, depthTexture, idTexture);\n    }\n  }\n}\n\n/**\n * Executes all ready and enabled stages in the collection.\n *\n * @param {Context} context The context.\n * @param {Texture} colorTexture The color texture rendered to by the scene.\n * @param {Texture} depthTexture The depth texture written to by the scene.\n * @param {Texture} idTexture The id texture written to by the scene.\n *\n * @private\n */\nPostProcessStageCollection.prototype.execute = function (\n  context,\n  colorTexture,\n  depthTexture,\n  idTexture\n) {\n  const activeStages = this._activeStages;\n  const length = activeStages.length;\n  const fxaa = this._fxaa;\n  const ao = this._ao;\n  const bloom = this._bloom;\n  const autoexposure = this._autoExposure;\n  const tonemapping = this._tonemapping;\n\n  const aoEnabled = ao.enabled && ao._isSupported(context);\n  const bloomEnabled = bloom.enabled && bloom._isSupported(context);\n  const autoExposureEnabled = this._autoExposureEnabled;\n  const tonemappingEnabled =\n    tonemapping.enabled && tonemapping._isSupported(context);\n  const fxaaEnabled = fxaa.enabled && fxaa._isSupported(context);\n\n  if (\n    !fxaaEnabled &&\n    !aoEnabled &&\n    !bloomEnabled &&\n    !tonemappingEnabled &&\n    length === 0\n  ) {\n    return;\n  }\n\n  let initialTexture = colorTexture;\n  if (aoEnabled && ao.ready) {\n    execute(ao, context, initialTexture, depthTexture, idTexture);\n    initialTexture = getOutputTexture(ao);\n  }\n  if (bloomEnabled && bloom.ready) {\n    execute(bloom, context, initialTexture, depthTexture, idTexture);\n    initialTexture = getOutputTexture(bloom);\n  }\n  if (autoExposureEnabled && autoexposure.ready) {\n    execute(autoexposure, context, initialTexture, depthTexture, idTexture);\n  }\n  if (tonemappingEnabled && tonemapping.ready) {\n    execute(tonemapping, context, initialTexture, depthTexture, idTexture);\n    initialTexture = getOutputTexture(tonemapping);\n  }\n\n  let lastTexture = initialTexture;\n\n  if (length > 0) {\n    execute(activeStages[0], context, initialTexture, depthTexture, idTexture);\n    for (let i = 1; i < length; ++i) {\n      execute(\n        activeStages[i],\n        context,\n        getOutputTexture(activeStages[i - 1]),\n        depthTexture,\n        idTexture\n      );\n    }\n    lastTexture = getOutputTexture(activeStages[length - 1]);\n  }\n\n  if (fxaaEnabled && fxaa.ready) {\n    execute(fxaa, context, lastTexture, depthTexture, idTexture);\n  }\n};\n\n/**\n * Copies the output of all executed stages to the color texture of a framebuffer.\n *\n * @param {Context} context The context.\n * @param {Framebuffer} framebuffer The framebuffer to copy to.\n *\n * @private\n */\nPostProcessStageCollection.prototype.copy = function (context, framebuffer) {\n  if (!defined(this._copyColorCommand)) {\n    const that = this;\n    this._copyColorCommand = context.createViewportQuadCommand(PassThrough, {\n      uniformMap: {\n        colorTexture: function () {\n          return that.outputTexture;\n        },\n      },\n      owner: this,\n    });\n  }\n\n  this._copyColorCommand.framebuffer = framebuffer;\n  this._copyColorCommand.execute(context);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see PostProcessStageCollection#destroy\n */\nPostProcessStageCollection.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PostProcessStageCollection#isDestroyed\n */\nPostProcessStageCollection.prototype.destroy = function () {\n  this._fxaa.destroy();\n  this._ao.destroy();\n  this._bloom.destroy();\n  this._autoExposure.destroy();\n  this._tonemapping.destroy();\n  this.removeAll();\n  this._textureCache = this._textureCache && this._textureCache.destroy();\n  return destroyObject(this);\n};\nexport default PostProcessStageCollection;\n", "/**\n * This enumerated type is for representing keyboard modifiers. These are keys\n * that are held down in addition to other event types.\n *\n * @enum {number}\n */\nconst KeyboardEventModifier = {\n  /**\n   * Represents the shift key being held down.\n   *\n   * @type {number}\n   * @constant\n   */\n  SHIFT: 0,\n\n  /**\n   * Represents the control key being held down.\n   *\n   * @type {number}\n   * @constant\n   */\n  CTRL: 1,\n\n  /**\n   * Represents the alt key being held down.\n   *\n   * @type {number}\n   * @constant\n   */\n  ALT: 2,\n};\nexport default Object.freeze(KeyboardEventModifier);\n", "/**\n * This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down.\n *\n * @enum {number}\n */\nconst ScreenSpaceEventType = {\n  /**\n   * Represents a mouse left button down event.\n   *\n   * @type {number}\n   * @constant\n   */\n  LEFT_DOWN: 0,\n\n  /**\n   * Represents a mouse left button up event.\n   *\n   * @type {number}\n   * @constant\n   */\n  LEFT_UP: 1,\n\n  /**\n   * Represents a mouse left click event.\n   *\n   * @type {number}\n   * @constant\n   */\n  LEFT_CLICK: 2,\n\n  /**\n   * Represents a mouse left double click event.\n   *\n   * @type {number}\n   * @constant\n   */\n  LEFT_DOUBLE_CLICK: 3,\n\n  /**\n   * Represents a mouse left button down event.\n   *\n   * @type {number}\n   * @constant\n   */\n  RIGHT_DOWN: 5,\n\n  /**\n   * Represents a mouse right button up event.\n   *\n   * @type {number}\n   * @constant\n   */\n  RIGHT_UP: 6,\n\n  /**\n   * Represents a mouse right click event.\n   *\n   * @type {number}\n   * @constant\n   */\n  RIGHT_CLICK: 7,\n\n  /**\n   * Represents a mouse middle button down event.\n   *\n   * @type {number}\n   * @constant\n   */\n  MIDDLE_DOWN: 10,\n\n  /**\n   * Represents a mouse middle button up event.\n   *\n   * @type {number}\n   * @constant\n   */\n  MIDDLE_UP: 11,\n\n  /**\n   * Represents a mouse middle click event.\n   *\n   * @type {number}\n   * @constant\n   */\n  MIDDLE_CLICK: 12,\n\n  /**\n   * Represents a mouse move event.\n   *\n   * @type {number}\n   * @constant\n   */\n  MOUSE_MOVE: 15,\n\n  /**\n   * Represents a mouse wheel event.\n   *\n   * @type {number}\n   * @constant\n   */\n  WHEEL: 16,\n\n  /**\n   * Represents the start of a two-finger event on a touch surface.\n   *\n   * @type {number}\n   * @constant\n   */\n  PINCH_START: 17,\n\n  /**\n   * Represents the end of a two-finger event on a touch surface.\n   *\n   * @type {number}\n   * @constant\n   */\n  PINCH_END: 18,\n\n  /**\n   * Represents a change of a two-finger event on a touch surface.\n   *\n   * @type {number}\n   * @constant\n   */\n  PINCH_MOVE: 19,\n};\nexport default Object.freeze(ScreenSpaceEventType);\n", "import AssociativeArray from \"./AssociativeArray.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport destroyObject from \"./destroyObject.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport FeatureDetection from \"./FeatureDetection.js\";\nimport getTimestamp from \"./getTimestamp.js\";\nimport KeyboardEventModifier from \"./KeyboardEventModifier.js\";\nimport ScreenSpaceEventType from \"./ScreenSpaceEventType.js\";\n\nfunction getPosition(screenSpaceEventHandler, event, result) {\n  const element = screenSpaceEventHandler._element;\n  if (element === document) {\n    result.x = event.clientX;\n    result.y = event.clientY;\n    return result;\n  }\n\n  const rect = element.getBoundingClientRect();\n  result.x = event.clientX - rect.left;\n  result.y = event.clientY - rect.top;\n  return result;\n}\n\nfunction getInputEventKey(type, modifier) {\n  let key = type;\n  if (defined(modifier)) {\n    key += `+${modifier}`;\n  }\n  return key;\n}\n\nfunction getModifier(event) {\n  if (event.shiftKey) {\n    return KeyboardEventModifier.SHIFT;\n  } else if (event.ctrlKey) {\n    return KeyboardEventModifier.CTRL;\n  } else if (event.altKey) {\n    return KeyboardEventModifier.ALT;\n  }\n\n  return undefined;\n}\n\nconst MouseButton = {\n  LEFT: 0,\n  MIDDLE: 1,\n  RIGHT: 2,\n};\n\nfunction registerListener(screenSpaceEventHandler, domType, element, callback) {\n  function listener(e) {\n    callback(screenSpaceEventHandler, e);\n  }\n\n  if (FeatureDetection.isInternetExplorer()) {\n    element.addEventListener(domType, listener, false);\n  } else {\n    element.addEventListener(domType, listener, {\n      capture: false,\n      passive: false,\n    });\n  }\n\n  screenSpaceEventHandler._removalFunctions.push(function () {\n    element.removeEventListener(domType, listener, false);\n  });\n}\n\nfunction registerListeners(screenSpaceEventHandler) {\n  const element = screenSpaceEventHandler._element;\n\n  // some listeners may be registered on the document, so we still get events even after\n  // leaving the bounds of element.\n  // this is affected by the existence of an undocumented disableRootEvents property on element.\n  const alternateElement = !defined(element.disableRootEvents)\n    ? document\n    : element;\n\n  if (FeatureDetection.supportsPointerEvents()) {\n    registerListener(\n      screenSpaceEventHandler,\n      \"pointerdown\",\n      element,\n      handlePointerDown\n    );\n    registerListener(\n      screenSpaceEventHandler,\n      \"pointerup\",\n      element,\n      handlePointerUp\n    );\n    registerListener(\n      screenSpaceEventHandler,\n      \"pointermove\",\n      element,\n      handlePointerMove\n    );\n    registerListener(\n      screenSpaceEventHandler,\n      \"pointercancel\",\n      element,\n      handlePointerUp\n    );\n  } else {\n    registerListener(\n      screenSpaceEventHandler,\n      \"mousedown\",\n      element,\n      handleMouseDown\n    );\n    registerListener(\n      screenSpaceEventHandler,\n      \"mouseup\",\n      alternateElement,\n      handleMouseUp\n    );\n    registerListener(\n      screenSpaceEventHandler,\n      \"mousemove\",\n      alternateElement,\n      handleMouseMove\n    );\n    registerListener(\n      screenSpaceEventHandler,\n      \"touchstart\",\n      element,\n      handleTouchStart\n    );\n    registerListener(\n      screenSpaceEventHandler,\n      \"touchend\",\n      alternateElement,\n      handleTouchEnd\n    );\n    registerListener(\n      screenSpaceEventHandler,\n      \"touchmove\",\n      alternateElement,\n      handleTouchMove\n    );\n    registerListener(\n      screenSpaceEventHandler,\n      \"touchcancel\",\n      alternateElement,\n      handleTouchEnd\n    );\n  }\n\n  registerListener(\n    screenSpaceEventHandler,\n    \"dblclick\",\n    element,\n    handleDblClick\n  );\n\n  // detect available wheel event\n  let wheelEvent;\n  if (\"onwheel\" in element) {\n    // spec event type\n    wheelEvent = \"wheel\";\n  } else if (document.onmousewheel !== undefined) {\n    // legacy event type\n    wheelEvent = \"mousewheel\";\n  } else {\n    // older Firefox\n    wheelEvent = \"DOMMouseScroll\";\n  }\n\n  registerListener(screenSpaceEventHandler, wheelEvent, element, handleWheel);\n}\n\nfunction unregisterListeners(screenSpaceEventHandler) {\n  const removalFunctions = screenSpaceEventHandler._removalFunctions;\n  for (let i = 0; i < removalFunctions.length; ++i) {\n    removalFunctions[i]();\n  }\n}\n\nconst mouseDownEvent = {\n  position: new Cartesian2(),\n};\n\nfunction gotTouchEvent(screenSpaceEventHandler) {\n  screenSpaceEventHandler._lastSeenTouchEvent = getTimestamp();\n}\n\nfunction canProcessMouseEvent(screenSpaceEventHandler) {\n  return (\n    getTimestamp() - screenSpaceEventHandler._lastSeenTouchEvent >\n    ScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds\n  );\n}\n\nfunction checkPixelTolerance(startPosition, endPosition, pixelTolerance) {\n  const xDiff = startPosition.x - endPosition.x;\n  const yDiff = startPosition.y - endPosition.y;\n  const totalPixels = Math.sqrt(xDiff * xDiff + yDiff * yDiff);\n\n  return totalPixels < pixelTolerance;\n}\n\nfunction handleMouseDown(screenSpaceEventHandler, event) {\n  if (!canProcessMouseEvent(screenSpaceEventHandler)) {\n    return;\n  }\n\n  const button = event.button;\n  screenSpaceEventHandler._buttonDown[button] = true;\n\n  let screenSpaceEventType;\n  if (button === MouseButton.LEFT) {\n    screenSpaceEventType = ScreenSpaceEventType.LEFT_DOWN;\n  } else if (button === MouseButton.MIDDLE) {\n    screenSpaceEventType = ScreenSpaceEventType.MIDDLE_DOWN;\n  } else if (button === MouseButton.RIGHT) {\n    screenSpaceEventType = ScreenSpaceEventType.RIGHT_DOWN;\n  } else {\n    return;\n  }\n\n  const position = getPosition(\n    screenSpaceEventHandler,\n    event,\n    screenSpaceEventHandler._primaryPosition\n  );\n  Cartesian2.clone(position, screenSpaceEventHandler._primaryStartPosition);\n  Cartesian2.clone(position, screenSpaceEventHandler._primaryPreviousPosition);\n\n  const modifier = getModifier(event);\n\n  const action = screenSpaceEventHandler.getInputAction(\n    screenSpaceEventType,\n    modifier\n  );\n\n  if (defined(action)) {\n    Cartesian2.clone(position, mouseDownEvent.position);\n\n    action(mouseDownEvent);\n\n    event.preventDefault();\n  }\n}\n\nconst mouseUpEvent = {\n  position: new Cartesian2(),\n};\nconst mouseClickEvent = {\n  position: new Cartesian2(),\n};\n\nfunction cancelMouseEvent(\n  screenSpaceEventHandler,\n  screenSpaceEventType,\n  clickScreenSpaceEventType,\n  event\n) {\n  const modifier = getModifier(event);\n\n  const action = screenSpaceEventHandler.getInputAction(\n    screenSpaceEventType,\n    modifier\n  );\n  const clickAction = screenSpaceEventHandler.getInputAction(\n    clickScreenSpaceEventType,\n    modifier\n  );\n\n  if (defined(action) || defined(clickAction)) {\n    const position = getPosition(\n      screenSpaceEventHandler,\n      event,\n      screenSpaceEventHandler._primaryPosition\n    );\n\n    if (defined(action)) {\n      Cartesian2.clone(position, mouseUpEvent.position);\n\n      action(mouseUpEvent);\n    }\n\n    if (defined(clickAction)) {\n      const startPosition = screenSpaceEventHandler._primaryStartPosition;\n      if (\n        checkPixelTolerance(\n          startPosition,\n          position,\n          screenSpaceEventHandler._clickPixelTolerance\n        )\n      ) {\n        Cartesian2.clone(position, mouseClickEvent.position);\n\n        clickAction(mouseClickEvent);\n      }\n    }\n  }\n}\n\nfunction handleMouseUp(screenSpaceEventHandler, event) {\n  if (!canProcessMouseEvent(screenSpaceEventHandler)) {\n    return;\n  }\n\n  const button = event.button;\n\n  if (\n    button !== MouseButton.LEFT &&\n    button !== MouseButton.MIDDLE &&\n    button !== MouseButton.RIGHT\n  ) {\n    return;\n  }\n\n  if (screenSpaceEventHandler._buttonDown[MouseButton.LEFT]) {\n    cancelMouseEvent(\n      screenSpaceEventHandler,\n      ScreenSpaceEventType.LEFT_UP,\n      ScreenSpaceEventType.LEFT_CLICK,\n      event\n    );\n    screenSpaceEventHandler._buttonDown[MouseButton.LEFT] = false;\n  }\n  if (screenSpaceEventHandler._buttonDown[MouseButton.MIDDLE]) {\n    cancelMouseEvent(\n      screenSpaceEventHandler,\n      ScreenSpaceEventType.MIDDLE_UP,\n      ScreenSpaceEventType.MIDDLE_CLICK,\n      event\n    );\n    screenSpaceEventHandler._buttonDown[MouseButton.MIDDLE] = false;\n  }\n  if (screenSpaceEventHandler._buttonDown[MouseButton.RIGHT]) {\n    cancelMouseEvent(\n      screenSpaceEventHandler,\n      ScreenSpaceEventType.RIGHT_UP,\n      ScreenSpaceEventType.RIGHT_CLICK,\n      event\n    );\n    screenSpaceEventHandler._buttonDown[MouseButton.RIGHT] = false;\n  }\n}\n\nconst mouseMoveEvent = {\n  startPosition: new Cartesian2(),\n  endPosition: new Cartesian2(),\n};\n\nfunction handleMouseMove(screenSpaceEventHandler, event) {\n  if (!canProcessMouseEvent(screenSpaceEventHandler)) {\n    return;\n  }\n\n  const modifier = getModifier(event);\n\n  const position = getPosition(\n    screenSpaceEventHandler,\n    event,\n    screenSpaceEventHandler._primaryPosition\n  );\n  const previousPosition = screenSpaceEventHandler._primaryPreviousPosition;\n\n  const action = screenSpaceEventHandler.getInputAction(\n    ScreenSpaceEventType.MOUSE_MOVE,\n    modifier\n  );\n\n  if (defined(action)) {\n    Cartesian2.clone(previousPosition, mouseMoveEvent.startPosition);\n    Cartesian2.clone(position, mouseMoveEvent.endPosition);\n\n    action(mouseMoveEvent);\n  }\n\n  Cartesian2.clone(position, previousPosition);\n\n  if (\n    screenSpaceEventHandler._buttonDown[MouseButton.LEFT] ||\n    screenSpaceEventHandler._buttonDown[MouseButton.MIDDLE] ||\n    screenSpaceEventHandler._buttonDown[MouseButton.RIGHT]\n  ) {\n    event.preventDefault();\n  }\n}\n\nconst mouseDblClickEvent = {\n  position: new Cartesian2(),\n};\n\nfunction handleDblClick(screenSpaceEventHandler, event) {\n  const button = event.button;\n\n  let screenSpaceEventType;\n  if (button === MouseButton.LEFT) {\n    screenSpaceEventType = ScreenSpaceEventType.LEFT_DOUBLE_CLICK;\n  } else {\n    return;\n  }\n\n  const modifier = getModifier(event);\n\n  const action = screenSpaceEventHandler.getInputAction(\n    screenSpaceEventType,\n    modifier\n  );\n\n  if (defined(action)) {\n    getPosition(screenSpaceEventHandler, event, mouseDblClickEvent.position);\n\n    action(mouseDblClickEvent);\n  }\n}\n\nfunction handleWheel(screenSpaceEventHandler, event) {\n  // currently this event exposes the delta value in terms of\n  // the obsolete mousewheel event type.  so, for now, we adapt the other\n  // values to that scheme.\n  let delta;\n\n  // standard wheel event uses deltaY.  sign is opposite wheelDelta.\n  // deltaMode indicates what unit it is in.\n  if (defined(event.deltaY)) {\n    const deltaMode = event.deltaMode;\n    if (deltaMode === event.DOM_DELTA_PIXEL) {\n      delta = -event.deltaY;\n    } else if (deltaMode === event.DOM_DELTA_LINE) {\n      delta = -event.deltaY * 40;\n    } else {\n      // DOM_DELTA_PAGE\n      delta = -event.deltaY * 120;\n    }\n  } else if (event.detail > 0) {\n    // old Firefox versions use event.detail to count the number of clicks. The sign\n    // of the integer is the direction the wheel is scrolled.\n    delta = event.detail * -120;\n  } else {\n    delta = event.wheelDelta;\n  }\n\n  if (!defined(delta)) {\n    return;\n  }\n\n  const modifier = getModifier(event);\n  const action = screenSpaceEventHandler.getInputAction(\n    ScreenSpaceEventType.WHEEL,\n    modifier\n  );\n\n  if (defined(action)) {\n    action(delta);\n\n    event.preventDefault();\n  }\n}\n\nfunction handleTouchStart(screenSpaceEventHandler, event) {\n  gotTouchEvent(screenSpaceEventHandler);\n\n  const changedTouches = event.changedTouches;\n\n  let i;\n  const length = changedTouches.length;\n  let touch;\n  let identifier;\n  const positions = screenSpaceEventHandler._positions;\n\n  for (i = 0; i < length; ++i) {\n    touch = changedTouches[i];\n    identifier = touch.identifier;\n    positions.set(\n      identifier,\n      getPosition(screenSpaceEventHandler, touch, new Cartesian2())\n    );\n  }\n\n  fireTouchEvents(screenSpaceEventHandler, event);\n\n  const previousPositions = screenSpaceEventHandler._previousPositions;\n\n  for (i = 0; i < length; ++i) {\n    touch = changedTouches[i];\n    identifier = touch.identifier;\n    previousPositions.set(\n      identifier,\n      Cartesian2.clone(positions.get(identifier))\n    );\n  }\n}\n\nfunction handleTouchEnd(screenSpaceEventHandler, event) {\n  gotTouchEvent(screenSpaceEventHandler);\n\n  const changedTouches = event.changedTouches;\n\n  let i;\n  const length = changedTouches.length;\n  let touch;\n  let identifier;\n  const positions = screenSpaceEventHandler._positions;\n\n  for (i = 0; i < length; ++i) {\n    touch = changedTouches[i];\n    identifier = touch.identifier;\n    positions.remove(identifier);\n  }\n\n  fireTouchEvents(screenSpaceEventHandler, event);\n\n  const previousPositions = screenSpaceEventHandler._previousPositions;\n\n  for (i = 0; i < length; ++i) {\n    touch = changedTouches[i];\n    identifier = touch.identifier;\n    previousPositions.remove(identifier);\n  }\n}\n\nconst touchStartEvent = {\n  position: new Cartesian2(),\n};\nconst touch2StartEvent = {\n  position1: new Cartesian2(),\n  position2: new Cartesian2(),\n};\nconst touchEndEvent = {\n  position: new Cartesian2(),\n};\nconst touchClickEvent = {\n  position: new Cartesian2(),\n};\nconst touchHoldEvent = {\n  position: new Cartesian2(),\n};\n\nfunction fireTouchEvents(screenSpaceEventHandler, event) {\n  const modifier = getModifier(event);\n  const positions = screenSpaceEventHandler._positions;\n  const numberOfTouches = positions.length;\n  let action;\n  let clickAction;\n  const pinching = screenSpaceEventHandler._isPinching;\n\n  if (\n    numberOfTouches !== 1 &&\n    screenSpaceEventHandler._buttonDown[MouseButton.LEFT]\n  ) {\n    // transitioning from single touch, trigger UP and might trigger CLICK\n    screenSpaceEventHandler._buttonDown[MouseButton.LEFT] = false;\n\n    if (defined(screenSpaceEventHandler._touchHoldTimer)) {\n      clearTimeout(screenSpaceEventHandler._touchHoldTimer);\n      screenSpaceEventHandler._touchHoldTimer = undefined;\n    }\n\n    action = screenSpaceEventHandler.getInputAction(\n      ScreenSpaceEventType.LEFT_UP,\n      modifier\n    );\n\n    if (defined(action)) {\n      Cartesian2.clone(\n        screenSpaceEventHandler._primaryPosition,\n        touchEndEvent.position\n      );\n\n      action(touchEndEvent);\n    }\n\n    if (numberOfTouches === 0 && !screenSpaceEventHandler._isTouchHolding) {\n      // releasing single touch, check for CLICK\n      clickAction = screenSpaceEventHandler.getInputAction(\n        ScreenSpaceEventType.LEFT_CLICK,\n        modifier\n      );\n\n      if (defined(clickAction)) {\n        const startPosition = screenSpaceEventHandler._primaryStartPosition;\n        const endPosition =\n          screenSpaceEventHandler._previousPositions.values[0];\n        if (\n          checkPixelTolerance(\n            startPosition,\n            endPosition,\n            screenSpaceEventHandler._clickPixelTolerance\n          )\n        ) {\n          Cartesian2.clone(\n            screenSpaceEventHandler._primaryPosition,\n            touchClickEvent.position\n          );\n\n          clickAction(touchClickEvent);\n        }\n      }\n    }\n\n    screenSpaceEventHandler._isTouchHolding = false;\n\n    // Otherwise don't trigger CLICK, because we are adding more touches.\n  }\n\n  if (numberOfTouches === 0 && pinching) {\n    // transitioning from pinch, trigger PINCH_END\n    screenSpaceEventHandler._isPinching = false;\n\n    action = screenSpaceEventHandler.getInputAction(\n      ScreenSpaceEventType.PINCH_END,\n      modifier\n    );\n\n    if (defined(action)) {\n      action();\n    }\n  }\n\n  if (numberOfTouches === 1 && !pinching) {\n    // transitioning to single touch, trigger DOWN\n    const position = positions.values[0];\n    Cartesian2.clone(position, screenSpaceEventHandler._primaryPosition);\n    Cartesian2.clone(position, screenSpaceEventHandler._primaryStartPosition);\n    Cartesian2.clone(\n      position,\n      screenSpaceEventHandler._primaryPreviousPosition\n    );\n\n    screenSpaceEventHandler._buttonDown[MouseButton.LEFT] = true;\n\n    action = screenSpaceEventHandler.getInputAction(\n      ScreenSpaceEventType.LEFT_DOWN,\n      modifier\n    );\n\n    if (defined(action)) {\n      Cartesian2.clone(position, touchStartEvent.position);\n\n      action(touchStartEvent);\n    }\n\n    screenSpaceEventHandler._touchHoldTimer = setTimeout(function () {\n      if (!screenSpaceEventHandler.isDestroyed()) {\n        screenSpaceEventHandler._touchHoldTimer = undefined;\n        screenSpaceEventHandler._isTouchHolding = true;\n\n        clickAction = screenSpaceEventHandler.getInputAction(\n          ScreenSpaceEventType.RIGHT_CLICK,\n          modifier\n        );\n\n        if (defined(clickAction)) {\n          const startPosition = screenSpaceEventHandler._primaryStartPosition;\n          const endPosition =\n            screenSpaceEventHandler._previousPositions.values[0];\n          if (\n            checkPixelTolerance(\n              startPosition,\n              endPosition,\n              screenSpaceEventHandler._holdPixelTolerance\n            )\n          ) {\n            Cartesian2.clone(\n              screenSpaceEventHandler._primaryPosition,\n              touchHoldEvent.position\n            );\n\n            clickAction(touchHoldEvent);\n          }\n        }\n      }\n    }, ScreenSpaceEventHandler.touchHoldDelayMilliseconds);\n\n    event.preventDefault();\n  }\n\n  if (numberOfTouches === 2 && !pinching) {\n    // transitioning to pinch, trigger PINCH_START\n    screenSpaceEventHandler._isPinching = true;\n\n    action = screenSpaceEventHandler.getInputAction(\n      ScreenSpaceEventType.PINCH_START,\n      modifier\n    );\n\n    if (defined(action)) {\n      Cartesian2.clone(positions.values[0], touch2StartEvent.position1);\n      Cartesian2.clone(positions.values[1], touch2StartEvent.position2);\n\n      action(touch2StartEvent);\n\n      // Touch-enabled devices, in particular iOS can have many default behaviours for\n      // \"pinch\" events, which can still be executed unless we prevent them here.\n      event.preventDefault();\n    }\n  }\n}\n\nfunction handleTouchMove(screenSpaceEventHandler, event) {\n  gotTouchEvent(screenSpaceEventHandler);\n\n  const changedTouches = event.changedTouches;\n\n  let i;\n  const length = changedTouches.length;\n  let touch;\n  let identifier;\n  const positions = screenSpaceEventHandler._positions;\n\n  for (i = 0; i < length; ++i) {\n    touch = changedTouches[i];\n    identifier = touch.identifier;\n    const position = positions.get(identifier);\n    if (defined(position)) {\n      getPosition(screenSpaceEventHandler, touch, position);\n    }\n  }\n\n  fireTouchMoveEvents(screenSpaceEventHandler, event);\n\n  const previousPositions = screenSpaceEventHandler._previousPositions;\n\n  for (i = 0; i < length; ++i) {\n    touch = changedTouches[i];\n    identifier = touch.identifier;\n    Cartesian2.clone(\n      positions.get(identifier),\n      previousPositions.get(identifier)\n    );\n  }\n}\n\nconst touchMoveEvent = {\n  startPosition: new Cartesian2(),\n  endPosition: new Cartesian2(),\n};\nconst touchPinchMovementEvent = {\n  distance: {\n    startPosition: new Cartesian2(),\n    endPosition: new Cartesian2(),\n  },\n  angleAndHeight: {\n    startPosition: new Cartesian2(),\n    endPosition: new Cartesian2(),\n  },\n};\n\nfunction fireTouchMoveEvents(screenSpaceEventHandler, event) {\n  const modifier = getModifier(event);\n  const positions = screenSpaceEventHandler._positions;\n  const previousPositions = screenSpaceEventHandler._previousPositions;\n  const numberOfTouches = positions.length;\n  let action;\n\n  if (\n    numberOfTouches === 1 &&\n    screenSpaceEventHandler._buttonDown[MouseButton.LEFT]\n  ) {\n    // moving single touch\n    const position = positions.values[0];\n    Cartesian2.clone(position, screenSpaceEventHandler._primaryPosition);\n\n    const previousPosition = screenSpaceEventHandler._primaryPreviousPosition;\n\n    action = screenSpaceEventHandler.getInputAction(\n      ScreenSpaceEventType.MOUSE_MOVE,\n      modifier\n    );\n\n    if (defined(action)) {\n      Cartesian2.clone(previousPosition, touchMoveEvent.startPosition);\n      Cartesian2.clone(position, touchMoveEvent.endPosition);\n\n      action(touchMoveEvent);\n    }\n\n    Cartesian2.clone(position, previousPosition);\n\n    event.preventDefault();\n  } else if (numberOfTouches === 2 && screenSpaceEventHandler._isPinching) {\n    // moving pinch\n\n    action = screenSpaceEventHandler.getInputAction(\n      ScreenSpaceEventType.PINCH_MOVE,\n      modifier\n    );\n    if (defined(action)) {\n      const position1 = positions.values[0];\n      const position2 = positions.values[1];\n      const previousPosition1 = previousPositions.values[0];\n      const previousPosition2 = previousPositions.values[1];\n\n      const dX = position2.x - position1.x;\n      const dY = position2.y - position1.y;\n      const dist = Math.sqrt(dX * dX + dY * dY) * 0.25;\n\n      const prevDX = previousPosition2.x - previousPosition1.x;\n      const prevDY = previousPosition2.y - previousPosition1.y;\n      const prevDist = Math.sqrt(prevDX * prevDX + prevDY * prevDY) * 0.25;\n\n      const cY = (position2.y + position1.y) * 0.125;\n      const prevCY = (previousPosition2.y + previousPosition1.y) * 0.125;\n      const angle = Math.atan2(dY, dX);\n      const prevAngle = Math.atan2(prevDY, prevDX);\n\n      Cartesian2.fromElements(\n        0.0,\n        prevDist,\n        touchPinchMovementEvent.distance.startPosition\n      );\n      Cartesian2.fromElements(\n        0.0,\n        dist,\n        touchPinchMovementEvent.distance.endPosition\n      );\n\n      Cartesian2.fromElements(\n        prevAngle,\n        prevCY,\n        touchPinchMovementEvent.angleAndHeight.startPosition\n      );\n      Cartesian2.fromElements(\n        angle,\n        cY,\n        touchPinchMovementEvent.angleAndHeight.endPosition\n      );\n\n      action(touchPinchMovementEvent);\n    }\n  }\n}\n\nfunction handlePointerDown(screenSpaceEventHandler, event) {\n  event.target.setPointerCapture(event.pointerId);\n\n  if (event.pointerType === \"touch\") {\n    const positions = screenSpaceEventHandler._positions;\n\n    const identifier = event.pointerId;\n    positions.set(\n      identifier,\n      getPosition(screenSpaceEventHandler, event, new Cartesian2())\n    );\n\n    fireTouchEvents(screenSpaceEventHandler, event);\n\n    const previousPositions = screenSpaceEventHandler._previousPositions;\n    previousPositions.set(\n      identifier,\n      Cartesian2.clone(positions.get(identifier))\n    );\n  } else {\n    handleMouseDown(screenSpaceEventHandler, event);\n  }\n}\n\nfunction handlePointerUp(screenSpaceEventHandler, event) {\n  if (event.pointerType === \"touch\") {\n    const positions = screenSpaceEventHandler._positions;\n\n    const identifier = event.pointerId;\n    positions.remove(identifier);\n\n    fireTouchEvents(screenSpaceEventHandler, event);\n\n    const previousPositions = screenSpaceEventHandler._previousPositions;\n    previousPositions.remove(identifier);\n  } else {\n    handleMouseUp(screenSpaceEventHandler, event);\n  }\n}\n\nfunction handlePointerMove(screenSpaceEventHandler, event) {\n  if (event.pointerType === \"touch\") {\n    const positions = screenSpaceEventHandler._positions;\n\n    const identifier = event.pointerId;\n    const position = positions.get(identifier);\n    if (!defined(position)) {\n      return;\n    }\n\n    getPosition(screenSpaceEventHandler, event, position);\n    fireTouchMoveEvents(screenSpaceEventHandler, event);\n\n    const previousPositions = screenSpaceEventHandler._previousPositions;\n    Cartesian2.clone(\n      positions.get(identifier),\n      previousPositions.get(identifier)\n    );\n  } else {\n    handleMouseMove(screenSpaceEventHandler, event);\n  }\n}\n\n/**\n * @typedef {object} ScreenSpaceEventHandler.PositionedEvent\n *\n * An Event that occurs at a single position on screen.\n *\n * @property {Cartesian2} position\n */\n\n/**\n * @callback ScreenSpaceEventHandler.PositionedEventCallback\n *\n * The callback invoked when a positioned event triggers an event listener.\n *\n * @param {ScreenSpaceEventHandler.PositionedEvent} event The event which triggered the listener\n */\n\n/**\n * @typedef {object} ScreenSpaceEventHandler.MotionEvent\n *\n * An Event that starts at one position and ends at another.\n *\n * @property {Cartesian2} startPosition\n * @property {Cartesian2} endPosition\n */\n\n/**\n * @callback ScreenSpaceEventHandler.MotionEventCallback\n *\n * The callback invoked when a motion event triggers an event listener.\n *\n * @param {ScreenSpaceEventHandler.MotionEvent} event The event which triggered the listener\n */\n\n/**\n * @typedef {object} ScreenSpaceEventHandler.TwoPointEvent\n *\n * An Event that occurs at a two positions on screen.\n *\n * @property {Cartesian2} position1\n * @property {Cartesian2} position2\n */\n\n/**\n * @callback ScreenSpaceEventHandler.TwoPointEventCallback\n *\n * The callback invoked when a two-point event triggers an event listener.\n *\n * @param {ScreenSpaceEventHandler.TwoPointEvent} event The event which triggered the listener\n */\n\n/**\n * @typedef {object} ScreenSpaceEventHandler.TwoPointMotionEvent\n *\n * An Event that starts at a two positions on screen and moves to two other positions.\n *\n * @property {Cartesian2} position1\n * @property {Cartesian2} position2\n * @property {Cartesian2} previousPosition1\n * @property {Cartesian2} previousPosition2\n */\n\n/**\n * @callback ScreenSpaceEventHandler.TwoPointMotionEventCallback\n *\n * The callback invoked when a two-point motion event triggers an event listener.\n *\n * @param {ScreenSpaceEventHandler.TwoPointMotionEvent} event The event which triggered the listener\n */\n\n/**\n * @callback ScreenSpaceEventHandler.WheelEventCallback\n *\n * The callback invoked when a mouse-wheel event triggers an event listener.\n *\n * @param {number} delta The amount that the mouse wheel moved\n */\n\n/**\n * Handles user input events. Custom functions can be added to be executed on\n * when the user enters input.\n *\n * @alias ScreenSpaceEventHandler\n *\n * @param {HTMLCanvasElement} [element=document] The element to add events to.\n *\n * @constructor\n */\nfunction ScreenSpaceEventHandler(element) {\n  this._inputEvents = {};\n  this._buttonDown = {\n    LEFT: false,\n    MIDDLE: false,\n    RIGHT: false,\n  };\n  this._isPinching = false;\n  this._isTouchHolding = false;\n  this._lastSeenTouchEvent = -ScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds;\n\n  this._primaryStartPosition = new Cartesian2();\n  this._primaryPosition = new Cartesian2();\n  this._primaryPreviousPosition = new Cartesian2();\n\n  this._positions = new AssociativeArray();\n  this._previousPositions = new AssociativeArray();\n\n  this._removalFunctions = [];\n\n  this._touchHoldTimer = undefined;\n\n  // TODO: Revisit when doing mobile development. May need to be configurable\n  // or determined based on the platform?\n  this._clickPixelTolerance = 5;\n  this._holdPixelTolerance = 25;\n\n  this._element = defaultValue(element, document);\n\n  registerListeners(this);\n}\n\n/**\n * Set a function to be executed on an input event.\n *\n * @param {ScreenSpaceEventHandler.PositionedEventCallback|ScreenSpaceEventHandler.MotionEventCallback|ScreenSpaceEventHandler.WheelEventCallback|ScreenSpaceEventHandler.TwoPointEventCallback|ScreenSpaceEventHandler.TwoPointMotionEventCallback} action Function to be executed when the input event occurs.\n * @param {ScreenSpaceEventType} type The ScreenSpaceEventType of input event.\n * @param {KeyboardEventModifier} [modifier] A KeyboardEventModifier key that is held when a <code>type</code>\n * event occurs.\n *\n * @see ScreenSpaceEventHandler#getInputAction\n * @see ScreenSpaceEventHandler#removeInputAction\n */\nScreenSpaceEventHandler.prototype.setInputAction = function (\n  action,\n  type,\n  modifier\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(action)) {\n    throw new DeveloperError(\"action is required.\");\n  }\n  if (!defined(type)) {\n    throw new DeveloperError(\"type is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const key = getInputEventKey(type, modifier);\n  this._inputEvents[key] = action;\n};\n\n/**\n * Returns the function to be executed on an input event.\n *\n * @param {ScreenSpaceEventType} type The ScreenSpaceEventType of input event.\n * @param {KeyboardEventModifier} [modifier] A KeyboardEventModifier key that is held when a <code>type</code>\n * event occurs.\n *\n * @returns {ScreenSpaceEventHandler.PositionedEventCallback|ScreenSpaceEventHandler.MotionEventCallback|ScreenSpaceEventHandler.WheelEventCallback|ScreenSpaceEventHandler.TwoPointEventCallback|ScreenSpaceEventHandler.TwoPointMotionEventCallback} The function to be executed on an input event.\n *\n * @see ScreenSpaceEventHandler#setInputAction\n * @see ScreenSpaceEventHandler#removeInputAction\n */\nScreenSpaceEventHandler.prototype.getInputAction = function (type, modifier) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(type)) {\n    throw new DeveloperError(\"type is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const key = getInputEventKey(type, modifier);\n  return this._inputEvents[key];\n};\n\n/**\n * Removes the function to be executed on an input event.\n *\n * @param {ScreenSpaceEventType} type The ScreenSpaceEventType of input event.\n * @param {KeyboardEventModifier} [modifier] A KeyboardEventModifier key that is held when a <code>type</code>\n * event occurs.\n *\n * @see ScreenSpaceEventHandler#getInputAction\n * @see ScreenSpaceEventHandler#setInputAction\n */\nScreenSpaceEventHandler.prototype.removeInputAction = function (\n  type,\n  modifier\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(type)) {\n    throw new DeveloperError(\"type is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const key = getInputEventKey(type, modifier);\n  delete this._inputEvents[key];\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see ScreenSpaceEventHandler#destroy\n */\nScreenSpaceEventHandler.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Removes listeners held by this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * handler = handler && handler.destroy();\n *\n * @see ScreenSpaceEventHandler#isDestroyed\n */\nScreenSpaceEventHandler.prototype.destroy = function () {\n  unregisterListeners(this);\n\n  return destroyObject(this);\n};\n\n/**\n * The amount of time, in milliseconds, that mouse events will be disabled after\n * receiving any touch events, such that any emulated mouse events will be ignored.\n * @type {number}\n * @default 800\n */\nScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds = 800;\n\n/**\n * The amount of time, in milliseconds, before a touch on the screen becomes a\n * touch and hold.\n * @type {number}\n * @default 1500\n */\nScreenSpaceEventHandler.touchHoldDelayMilliseconds = 1500;\nexport default ScreenSpaceEventHandler;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport EasingFunction from \"../Core/EasingFunction.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport PerspectiveFrustum from \"../Core/PerspectiveFrustum.js\";\nimport Ray from \"../Core/Ray.js\";\nimport ScreenSpaceEventHandler from \"../Core/ScreenSpaceEventHandler.js\";\nimport ScreenSpaceEventType from \"../Core/ScreenSpaceEventType.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport Camera from \"./Camera.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * @private\n */\nfunction SceneTransitioner(scene) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"scene\", scene);\n  //>>includeEnd('debug');\n\n  this._scene = scene;\n  this._currentTweens = [];\n  this._morphHandler = undefined;\n  this._morphCancelled = false;\n  this._completeMorph = undefined;\n  this._morphToOrthographic = false;\n}\n\nSceneTransitioner.prototype.completeMorph = function () {\n  if (defined(this._completeMorph)) {\n    this._completeMorph();\n  }\n};\n\nSceneTransitioner.prototype.morphTo2D = function (duration, ellipsoid) {\n  if (defined(this._completeMorph)) {\n    this._completeMorph();\n  }\n\n  const scene = this._scene;\n  this._previousMode = scene.mode;\n  this._morphToOrthographic =\n    scene.camera.frustum instanceof OrthographicFrustum;\n\n  if (\n    this._previousMode === SceneMode.SCENE2D ||\n    this._previousMode === SceneMode.MORPHING\n  ) {\n    return;\n  }\n  this._scene.morphStart.raiseEvent(\n    this,\n    this._previousMode,\n    SceneMode.SCENE2D,\n    true\n  );\n\n  scene._mode = SceneMode.MORPHING;\n  scene.camera._setTransform(Matrix4.IDENTITY);\n\n  if (this._previousMode === SceneMode.COLUMBUS_VIEW) {\n    morphFromColumbusViewTo2D(this, duration);\n  } else {\n    morphFrom3DTo2D(this, duration, ellipsoid);\n  }\n\n  if (duration === 0.0 && defined(this._completeMorph)) {\n    this._completeMorph();\n  }\n};\n\nconst scratchToCVPosition = new Cartesian3();\nconst scratchToCVDirection = new Cartesian3();\nconst scratchToCVUp = new Cartesian3();\nconst scratchToCVPosition2D = new Cartesian3();\nconst scratchToCVDirection2D = new Cartesian3();\nconst scratchToCVUp2D = new Cartesian3();\nconst scratchToCVSurfacePosition = new Cartesian3();\nconst scratchToCVCartographic = new Cartographic();\nconst scratchToCVToENU = new Matrix4();\nconst scratchToCVFrustumPerspective = new PerspectiveFrustum();\nconst scratchToCVFrustumOrthographic = new OrthographicFrustum();\nconst scratchToCVCamera = {\n  position: undefined,\n  direction: undefined,\n  up: undefined,\n  position2D: undefined,\n  direction2D: undefined,\n  up2D: undefined,\n  frustum: undefined,\n};\n\nSceneTransitioner.prototype.morphToColumbusView = function (\n  duration,\n  ellipsoid\n) {\n  if (defined(this._completeMorph)) {\n    this._completeMorph();\n  }\n\n  const scene = this._scene;\n  this._previousMode = scene.mode;\n\n  if (\n    this._previousMode === SceneMode.COLUMBUS_VIEW ||\n    this._previousMode === SceneMode.MORPHING\n  ) {\n    return;\n  }\n  this._scene.morphStart.raiseEvent(\n    this,\n    this._previousMode,\n    SceneMode.COLUMBUS_VIEW,\n    true\n  );\n\n  scene.camera._setTransform(Matrix4.IDENTITY);\n\n  let position = scratchToCVPosition;\n  const direction = scratchToCVDirection;\n  const up = scratchToCVUp;\n\n  if (duration > 0.0) {\n    position.x = 0.0;\n    position.y = -1.0;\n    position.z = 1.0;\n    position = Cartesian3.multiplyByScalar(\n      Cartesian3.normalize(position, position),\n      5.0 * ellipsoid.maximumRadius,\n      position\n    );\n\n    Cartesian3.negate(Cartesian3.normalize(position, direction), direction);\n    Cartesian3.cross(Cartesian3.UNIT_X, direction, up);\n  } else {\n    const camera = scene.camera;\n    if (this._previousMode === SceneMode.SCENE2D) {\n      Cartesian3.clone(camera.position, position);\n      position.z = camera.frustum.right - camera.frustum.left;\n      Cartesian3.negate(Cartesian3.UNIT_Z, direction);\n      Cartesian3.clone(Cartesian3.UNIT_Y, up);\n    } else {\n      Cartesian3.clone(camera.positionWC, position);\n      Cartesian3.clone(camera.directionWC, direction);\n      Cartesian3.clone(camera.upWC, up);\n\n      const surfacePoint = ellipsoid.scaleToGeodeticSurface(\n        position,\n        scratchToCVSurfacePosition\n      );\n      const toENU = Transforms.eastNorthUpToFixedFrame(\n        surfacePoint,\n        ellipsoid,\n        scratchToCVToENU\n      );\n      Matrix4.inverseTransformation(toENU, toENU);\n\n      scene.mapProjection.project(\n        ellipsoid.cartesianToCartographic(position, scratchToCVCartographic),\n        position\n      );\n      Matrix4.multiplyByPointAsVector(toENU, direction, direction);\n      Matrix4.multiplyByPointAsVector(toENU, up, up);\n    }\n  }\n\n  let frustum;\n  if (this._morphToOrthographic) {\n    frustum = scratchToCVFrustumOrthographic;\n    frustum.width = scene.camera.frustum.right - scene.camera.frustum.left;\n    frustum.aspectRatio = scene.drawingBufferWidth / scene.drawingBufferHeight;\n  } else {\n    frustum = scratchToCVFrustumPerspective;\n    frustum.aspectRatio = scene.drawingBufferWidth / scene.drawingBufferHeight;\n    frustum.fov = CesiumMath.toRadians(60.0);\n  }\n\n  const cameraCV = scratchToCVCamera;\n  cameraCV.position = position;\n  cameraCV.direction = direction;\n  cameraCV.up = up;\n  cameraCV.frustum = frustum;\n\n  const complete = completeColumbusViewCallback(cameraCV);\n  createMorphHandler(this, complete);\n\n  if (this._previousMode === SceneMode.SCENE2D) {\n    morphFrom2DToColumbusView(this, duration, cameraCV, complete);\n  } else {\n    cameraCV.position2D = Matrix4.multiplyByPoint(\n      Camera.TRANSFORM_2D,\n      position,\n      scratchToCVPosition2D\n    );\n    cameraCV.direction2D = Matrix4.multiplyByPointAsVector(\n      Camera.TRANSFORM_2D,\n      direction,\n      scratchToCVDirection2D\n    );\n    cameraCV.up2D = Matrix4.multiplyByPointAsVector(\n      Camera.TRANSFORM_2D,\n      up,\n      scratchToCVUp2D\n    );\n\n    scene._mode = SceneMode.MORPHING;\n    morphFrom3DToColumbusView(this, duration, cameraCV, complete);\n  }\n\n  if (duration === 0.0 && defined(this._completeMorph)) {\n    this._completeMorph();\n  }\n};\n\nconst scratchCVTo3DCamera = {\n  position: new Cartesian3(),\n  direction: new Cartesian3(),\n  up: new Cartesian3(),\n  frustum: undefined,\n};\nconst scratch2DTo3DFrustumPersp = new PerspectiveFrustum();\n\nSceneTransitioner.prototype.morphTo3D = function (duration, ellipsoid) {\n  if (defined(this._completeMorph)) {\n    this._completeMorph();\n  }\n\n  const scene = this._scene;\n  this._previousMode = scene.mode;\n\n  if (\n    this._previousMode === SceneMode.SCENE3D ||\n    this._previousMode === SceneMode.MORPHING\n  ) {\n    return;\n  }\n  this._scene.morphStart.raiseEvent(\n    this,\n    this._previousMode,\n    SceneMode.SCENE3D,\n    true\n  );\n\n  scene._mode = SceneMode.MORPHING;\n  scene.camera._setTransform(Matrix4.IDENTITY);\n\n  if (this._previousMode === SceneMode.SCENE2D) {\n    morphFrom2DTo3D(this, duration, ellipsoid);\n  } else {\n    let camera3D;\n    if (duration > 0.0) {\n      camera3D = scratchCVTo3DCamera;\n      Cartesian3.fromDegrees(\n        0.0,\n        0.0,\n        5.0 * ellipsoid.maximumRadius,\n        ellipsoid,\n        camera3D.position\n      );\n      Cartesian3.negate(camera3D.position, camera3D.direction);\n      Cartesian3.normalize(camera3D.direction, camera3D.direction);\n      Cartesian3.clone(Cartesian3.UNIT_Z, camera3D.up);\n    } else {\n      camera3D = getColumbusViewTo3DCamera(this, ellipsoid);\n    }\n\n    let frustum;\n    const camera = scene.camera;\n    if (camera.frustum instanceof OrthographicFrustum) {\n      frustum = camera.frustum.clone();\n    } else {\n      frustum = scratch2DTo3DFrustumPersp;\n      frustum.aspectRatio =\n        scene.drawingBufferWidth / scene.drawingBufferHeight;\n      frustum.fov = CesiumMath.toRadians(60.0);\n    }\n    camera3D.frustum = frustum;\n\n    const complete = complete3DCallback(camera3D);\n    createMorphHandler(this, complete);\n\n    morphFromColumbusViewTo3D(this, duration, camera3D, complete);\n  }\n\n  if (duration === 0.0 && defined(this._completeMorph)) {\n    this._completeMorph();\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nSceneTransitioner.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * transitioner = transitioner && transitioner.destroy();\n */\nSceneTransitioner.prototype.destroy = function () {\n  destroyMorphHandler(this);\n  return destroyObject(this);\n};\n\nfunction createMorphHandler(transitioner, completeMorphFunction) {\n  if (transitioner._scene.completeMorphOnUserInput) {\n    transitioner._morphHandler = new ScreenSpaceEventHandler(\n      transitioner._scene.canvas\n    );\n\n    const completeMorph = function () {\n      transitioner._morphCancelled = true;\n      transitioner._scene.camera.cancelFlight();\n      completeMorphFunction(transitioner);\n    };\n    transitioner._completeMorph = completeMorph;\n    transitioner._morphHandler.setInputAction(\n      completeMorph,\n      ScreenSpaceEventType.LEFT_DOWN\n    );\n    transitioner._morphHandler.setInputAction(\n      completeMorph,\n      ScreenSpaceEventType.MIDDLE_DOWN\n    );\n    transitioner._morphHandler.setInputAction(\n      completeMorph,\n      ScreenSpaceEventType.RIGHT_DOWN\n    );\n    transitioner._morphHandler.setInputAction(\n      completeMorph,\n      ScreenSpaceEventType.WHEEL\n    );\n  }\n}\n\nfunction destroyMorphHandler(transitioner) {\n  const tweens = transitioner._currentTweens;\n  for (let i = 0; i < tweens.length; ++i) {\n    tweens[i].cancelTween();\n  }\n  transitioner._currentTweens.length = 0;\n  transitioner._morphHandler =\n    transitioner._morphHandler && transitioner._morphHandler.destroy();\n}\n\nconst scratchCVTo3DCartographic = new Cartographic();\nconst scratchCVTo3DSurfacePoint = new Cartesian3();\nconst scratchCVTo3DFromENU = new Matrix4();\n\nfunction getColumbusViewTo3DCamera(transitioner, ellipsoid) {\n  const scene = transitioner._scene;\n  const camera = scene.camera;\n\n  const camera3D = scratchCVTo3DCamera;\n  const position = camera3D.position;\n  const direction = camera3D.direction;\n  const up = camera3D.up;\n\n  const positionCarto = scene.mapProjection.unproject(\n    camera.position,\n    scratchCVTo3DCartographic\n  );\n  ellipsoid.cartographicToCartesian(positionCarto, position);\n  const surfacePoint = ellipsoid.scaleToGeodeticSurface(\n    position,\n    scratchCVTo3DSurfacePoint\n  );\n\n  const fromENU = Transforms.eastNorthUpToFixedFrame(\n    surfacePoint,\n    ellipsoid,\n    scratchCVTo3DFromENU\n  );\n\n  Matrix4.multiplyByPointAsVector(fromENU, camera.direction, direction);\n  Matrix4.multiplyByPointAsVector(fromENU, camera.up, up);\n\n  return camera3D;\n}\n\nconst scratchCVTo3DStartPos = new Cartesian3();\nconst scratchCVTo3DStartDir = new Cartesian3();\nconst scratchCVTo3DStartUp = new Cartesian3();\nconst scratchCVTo3DEndPos = new Cartesian3();\nconst scratchCVTo3DEndDir = new Cartesian3();\nconst scratchCVTo3DEndUp = new Cartesian3();\n\nfunction morphFromColumbusViewTo3D(\n  transitioner,\n  duration,\n  endCamera,\n  complete\n) {\n  duration *= 0.5;\n\n  const scene = transitioner._scene;\n  const camera = scene.camera;\n\n  const startPos = Cartesian3.clone(camera.position, scratchCVTo3DStartPos);\n  const startDir = Cartesian3.clone(camera.direction, scratchCVTo3DStartDir);\n  const startUp = Cartesian3.clone(camera.up, scratchCVTo3DStartUp);\n\n  const endPos = Matrix4.multiplyByPoint(\n    Camera.TRANSFORM_2D_INVERSE,\n    endCamera.position,\n    scratchCVTo3DEndPos\n  );\n  const endDir = Matrix4.multiplyByPointAsVector(\n    Camera.TRANSFORM_2D_INVERSE,\n    endCamera.direction,\n    scratchCVTo3DEndDir\n  );\n  const endUp = Matrix4.multiplyByPointAsVector(\n    Camera.TRANSFORM_2D_INVERSE,\n    endCamera.up,\n    scratchCVTo3DEndUp\n  );\n\n  function update(value) {\n    columbusViewMorph(startPos, endPos, value.time, camera.position);\n    columbusViewMorph(startDir, endDir, value.time, camera.direction);\n    columbusViewMorph(startUp, endUp, value.time, camera.up);\n    Cartesian3.cross(camera.direction, camera.up, camera.right);\n    Cartesian3.normalize(camera.right, camera.right);\n  }\n\n  const tween = scene.tweens.add({\n    duration: duration,\n    easingFunction: EasingFunction.QUARTIC_OUT,\n    startObject: {\n      time: 0.0,\n    },\n    stopObject: {\n      time: 1.0,\n    },\n    update: update,\n    complete: function () {\n      addMorphTimeAnimations(transitioner, scene, 0.0, 1.0, duration, complete);\n    },\n  });\n  transitioner._currentTweens.push(tween);\n}\n\nconst scratch2DTo3DFrustumOrtho = new OrthographicFrustum();\nconst scratch3DToCVStartPos = new Cartesian3();\nconst scratch3DToCVStartDir = new Cartesian3();\nconst scratch3DToCVStartUp = new Cartesian3();\nconst scratch3DToCVEndPos = new Cartesian3();\nconst scratch3DToCVEndDir = new Cartesian3();\nconst scratch3DToCVEndUp = new Cartesian3();\n\nfunction morphFrom2DTo3D(transitioner, duration, ellipsoid) {\n  duration /= 3.0;\n\n  const scene = transitioner._scene;\n  const camera = scene.camera;\n\n  let camera3D;\n  if (duration > 0.0) {\n    camera3D = scratchCVTo3DCamera;\n    Cartesian3.fromDegrees(\n      0.0,\n      0.0,\n      5.0 * ellipsoid.maximumRadius,\n      ellipsoid,\n      camera3D.position\n    );\n    Cartesian3.negate(camera3D.position, camera3D.direction);\n    Cartesian3.normalize(camera3D.direction, camera3D.direction);\n    Cartesian3.clone(Cartesian3.UNIT_Z, camera3D.up);\n  } else {\n    camera.position.z = camera.frustum.right - camera.frustum.left;\n\n    camera3D = getColumbusViewTo3DCamera(transitioner, ellipsoid);\n  }\n\n  let frustum;\n  if (transitioner._morphToOrthographic) {\n    frustum = scratch2DTo3DFrustumOrtho;\n    frustum.aspectRatio = scene.drawingBufferWidth / scene.drawingBufferHeight;\n    frustum.width = camera.frustum.right - camera.frustum.left;\n  } else {\n    frustum = scratch2DTo3DFrustumPersp;\n    frustum.aspectRatio = scene.drawingBufferWidth / scene.drawingBufferHeight;\n    frustum.fov = CesiumMath.toRadians(60.0);\n  }\n\n  camera3D.frustum = frustum;\n\n  const complete = complete3DCallback(camera3D);\n  createMorphHandler(transitioner, complete);\n\n  let morph;\n  if (transitioner._morphToOrthographic) {\n    morph = function () {\n      morphFromColumbusViewTo3D(transitioner, duration, camera3D, complete);\n    };\n  } else {\n    morph = function () {\n      morphOrthographicToPerspective(\n        transitioner,\n        duration,\n        camera3D,\n        function () {\n          morphFromColumbusViewTo3D(transitioner, duration, camera3D, complete);\n        }\n      );\n    };\n  }\n\n  if (duration > 0.0) {\n    scene._mode = SceneMode.SCENE2D;\n    camera.flyTo({\n      duration: duration,\n      destination: Cartesian3.fromDegrees(\n        0.0,\n        0.0,\n        5.0 * ellipsoid.maximumRadius,\n        ellipsoid,\n        scratch3DToCVEndPos\n      ),\n      complete: function () {\n        scene._mode = SceneMode.MORPHING;\n        morph();\n      },\n    });\n  } else {\n    morph();\n  }\n}\n\nfunction columbusViewMorph(startPosition, endPosition, time, result) {\n  // Just linear for now.\n  return Cartesian3.lerp(startPosition, endPosition, time, result);\n}\n\nfunction morphPerspectiveToOrthographic(\n  transitioner,\n  duration,\n  endCamera,\n  updateHeight,\n  complete\n) {\n  const scene = transitioner._scene;\n  const camera = scene.camera;\n\n  if (camera.frustum instanceof OrthographicFrustum) {\n    return;\n  }\n\n  const startFOV = camera.frustum.fov;\n  const endFOV = CesiumMath.RADIANS_PER_DEGREE * 0.5;\n  const d = endCamera.position.z * Math.tan(startFOV * 0.5);\n  camera.frustum.far = d / Math.tan(endFOV * 0.5) + 10000000.0;\n\n  function update(value) {\n    camera.frustum.fov = CesiumMath.lerp(startFOV, endFOV, value.time);\n    const height = d / Math.tan(camera.frustum.fov * 0.5);\n    updateHeight(camera, height);\n  }\n  const tween = scene.tweens.add({\n    duration: duration,\n    easingFunction: EasingFunction.QUARTIC_OUT,\n    startObject: {\n      time: 0.0,\n    },\n    stopObject: {\n      time: 1.0,\n    },\n    update: update,\n    complete: function () {\n      camera.frustum = endCamera.frustum.clone();\n      complete(transitioner);\n    },\n  });\n  transitioner._currentTweens.push(tween);\n}\n\nconst scratchCVTo2DStartPos = new Cartesian3();\nconst scratchCVTo2DStartDir = new Cartesian3();\nconst scratchCVTo2DStartUp = new Cartesian3();\nconst scratchCVTo2DEndPos = new Cartesian3();\nconst scratchCVTo2DEndDir = new Cartesian3();\nconst scratchCVTo2DEndUp = new Cartesian3();\nconst scratchCVTo2DFrustum = new OrthographicOffCenterFrustum();\nconst scratchCVTo2DRay = new Ray();\nconst scratchCVTo2DPickPos = new Cartesian3();\nconst scratchCVTo2DCamera = {\n  position: undefined,\n  direction: undefined,\n  up: undefined,\n  frustum: undefined,\n};\n\nfunction morphFromColumbusViewTo2D(transitioner, duration) {\n  duration *= 0.5;\n\n  const scene = transitioner._scene;\n  const camera = scene.camera;\n\n  const startPos = Cartesian3.clone(camera.position, scratchCVTo2DStartPos);\n  const startDir = Cartesian3.clone(camera.direction, scratchCVTo2DStartDir);\n  const startUp = Cartesian3.clone(camera.up, scratchCVTo2DStartUp);\n\n  const endDir = Cartesian3.negate(Cartesian3.UNIT_Z, scratchCVTo2DEndDir);\n  const endUp = Cartesian3.clone(Cartesian3.UNIT_Y, scratchCVTo2DEndUp);\n\n  const endPos = scratchCVTo2DEndPos;\n\n  if (duration > 0.0) {\n    Cartesian3.clone(Cartesian3.ZERO, scratchCVTo2DEndPos);\n    endPos.z = 5.0 * scene.mapProjection.ellipsoid.maximumRadius;\n  } else {\n    Cartesian3.clone(startPos, scratchCVTo2DEndPos);\n\n    const ray = scratchCVTo2DRay;\n    Matrix4.multiplyByPoint(Camera.TRANSFORM_2D, startPos, ray.origin);\n    Matrix4.multiplyByPointAsVector(\n      Camera.TRANSFORM_2D,\n      startDir,\n      ray.direction\n    );\n\n    const globe = scene.globe;\n    if (defined(globe)) {\n      const pickPos = globe.pickWorldCoordinates(\n        ray,\n        scene,\n        true,\n        scratchCVTo2DPickPos\n      );\n      if (defined(pickPos)) {\n        Matrix4.multiplyByPoint(Camera.TRANSFORM_2D_INVERSE, pickPos, endPos);\n        endPos.z += Cartesian3.distance(startPos, endPos);\n      }\n    }\n  }\n\n  const frustum = scratchCVTo2DFrustum;\n  frustum.right = endPos.z * 0.5;\n  frustum.left = -frustum.right;\n  frustum.top =\n    frustum.right * (scene.drawingBufferHeight / scene.drawingBufferWidth);\n  frustum.bottom = -frustum.top;\n\n  const camera2D = scratchCVTo2DCamera;\n  camera2D.position = endPos;\n  camera2D.direction = endDir;\n  camera2D.up = endUp;\n  camera2D.frustum = frustum;\n\n  const complete = complete2DCallback(camera2D);\n  createMorphHandler(transitioner, complete);\n\n  function updateCV(value) {\n    columbusViewMorph(startPos, endPos, value.time, camera.position);\n    columbusViewMorph(startDir, endDir, value.time, camera.direction);\n    columbusViewMorph(startUp, endUp, value.time, camera.up);\n    Cartesian3.cross(camera.direction, camera.up, camera.right);\n    Cartesian3.normalize(camera.right, camera.right);\n    camera._adjustOrthographicFrustum(true);\n  }\n\n  function updateHeight(camera, height) {\n    camera.position.z = height;\n  }\n\n  const tween = scene.tweens.add({\n    duration: duration,\n    easingFunction: EasingFunction.QUARTIC_OUT,\n    startObject: {\n      time: 0.0,\n    },\n    stopObject: {\n      time: 1.0,\n    },\n    update: updateCV,\n    complete: function () {\n      morphPerspectiveToOrthographic(\n        transitioner,\n        duration,\n        camera2D,\n        updateHeight,\n        complete\n      );\n    },\n  });\n  transitioner._currentTweens.push(tween);\n}\n\nconst scratch3DTo2DCartographic = new Cartographic();\nconst scratch3DTo2DCamera = {\n  position: new Cartesian3(),\n  direction: new Cartesian3(),\n  up: new Cartesian3(),\n  position2D: new Cartesian3(),\n  direction2D: new Cartesian3(),\n  up2D: new Cartesian3(),\n  frustum: new OrthographicOffCenterFrustum(),\n};\nconst scratch3DTo2DEndCamera = {\n  position: new Cartesian3(),\n  direction: new Cartesian3(),\n  up: new Cartesian3(),\n  frustum: undefined,\n};\nconst scratch3DTo2DPickPosition = new Cartesian3();\nconst scratch3DTo2DRay = new Ray();\nconst scratch3DTo2DToENU = new Matrix4();\nconst scratch3DTo2DSurfacePoint = new Cartesian3();\n\nfunction morphFrom3DTo2D(transitioner, duration, ellipsoid) {\n  duration *= 0.5;\n\n  const scene = transitioner._scene;\n  const camera = scene.camera;\n  const camera2D = scratch3DTo2DCamera;\n\n  if (duration > 0.0) {\n    Cartesian3.clone(Cartesian3.ZERO, camera2D.position);\n    camera2D.position.z = 5.0 * ellipsoid.maximumRadius;\n    Cartesian3.negate(Cartesian3.UNIT_Z, camera2D.direction);\n    Cartesian3.clone(Cartesian3.UNIT_Y, camera2D.up);\n  } else {\n    ellipsoid.cartesianToCartographic(\n      camera.positionWC,\n      scratch3DTo2DCartographic\n    );\n    scene.mapProjection.project(scratch3DTo2DCartographic, camera2D.position);\n\n    Cartesian3.negate(Cartesian3.UNIT_Z, camera2D.direction);\n    Cartesian3.clone(Cartesian3.UNIT_Y, camera2D.up);\n\n    const ray = scratch3DTo2DRay;\n    Cartesian3.clone(camera2D.position2D, ray.origin);\n    const rayDirection = Cartesian3.clone(camera.directionWC, ray.direction);\n    const surfacePoint = ellipsoid.scaleToGeodeticSurface(\n      camera.positionWC,\n      scratch3DTo2DSurfacePoint\n    );\n    const toENU = Transforms.eastNorthUpToFixedFrame(\n      surfacePoint,\n      ellipsoid,\n      scratch3DTo2DToENU\n    );\n    Matrix4.inverseTransformation(toENU, toENU);\n    Matrix4.multiplyByPointAsVector(toENU, rayDirection, rayDirection);\n    Matrix4.multiplyByPointAsVector(\n      Camera.TRANSFORM_2D,\n      rayDirection,\n      rayDirection\n    );\n\n    const globe = scene.globe;\n    if (defined(globe)) {\n      const pickedPos = globe.pickWorldCoordinates(\n        ray,\n        scene,\n        true,\n        scratch3DTo2DPickPosition\n      );\n      if (defined(pickedPos)) {\n        const height = Cartesian3.distance(camera2D.position2D, pickedPos);\n        pickedPos.x += height;\n        Cartesian3.clone(pickedPos, camera2D.position2D);\n      }\n    }\n  }\n\n  function updateHeight(camera, height) {\n    camera.position.x = height;\n  }\n\n  Matrix4.multiplyByPoint(\n    Camera.TRANSFORM_2D,\n    camera2D.position,\n    camera2D.position2D\n  );\n  Matrix4.multiplyByPointAsVector(\n    Camera.TRANSFORM_2D,\n    camera2D.direction,\n    camera2D.direction2D\n  );\n  Matrix4.multiplyByPointAsVector(\n    Camera.TRANSFORM_2D,\n    camera2D.up,\n    camera2D.up2D\n  );\n\n  const frustum = camera2D.frustum;\n  frustum.right = camera2D.position.z * 0.5;\n  frustum.left = -frustum.right;\n  frustum.top =\n    frustum.right * (scene.drawingBufferHeight / scene.drawingBufferWidth);\n  frustum.bottom = -frustum.top;\n\n  const endCamera = scratch3DTo2DEndCamera;\n  Matrix4.multiplyByPoint(\n    Camera.TRANSFORM_2D_INVERSE,\n    camera2D.position2D,\n    endCamera.position\n  );\n  Cartesian3.clone(camera2D.direction, endCamera.direction);\n  Cartesian3.clone(camera2D.up, endCamera.up);\n  endCamera.frustum = frustum;\n\n  const complete = complete2DCallback(endCamera);\n  createMorphHandler(transitioner, complete);\n\n  function completeCallback() {\n    morphPerspectiveToOrthographic(\n      transitioner,\n      duration,\n      camera2D,\n      updateHeight,\n      complete\n    );\n  }\n  morphFrom3DToColumbusView(transitioner, duration, camera2D, completeCallback);\n}\n\nfunction morphOrthographicToPerspective(\n  transitioner,\n  duration,\n  cameraCV,\n  complete\n) {\n  const scene = transitioner._scene;\n  const camera = scene.camera;\n\n  const height = camera.frustum.right - camera.frustum.left;\n  camera.frustum = cameraCV.frustum.clone();\n\n  const endFOV = camera.frustum.fov;\n  const startFOV = CesiumMath.RADIANS_PER_DEGREE * 0.5;\n  const d = height * Math.tan(endFOV * 0.5);\n  camera.frustum.far = d / Math.tan(startFOV * 0.5) + 10000000.0;\n  camera.frustum.fov = startFOV;\n\n  function update(value) {\n    camera.frustum.fov = CesiumMath.lerp(startFOV, endFOV, value.time);\n    camera.position.z = d / Math.tan(camera.frustum.fov * 0.5);\n  }\n  const tween = scene.tweens.add({\n    duration: duration,\n    easingFunction: EasingFunction.QUARTIC_OUT,\n    startObject: {\n      time: 0.0,\n    },\n    stopObject: {\n      time: 1.0,\n    },\n    update: update,\n    complete: function () {\n      complete(transitioner);\n    },\n  });\n  transitioner._currentTweens.push(tween);\n}\n\nfunction morphFrom2DToColumbusView(transitioner, duration, cameraCV, complete) {\n  duration *= 0.5;\n\n  const scene = transitioner._scene;\n  const camera = scene.camera;\n\n  const endPos = Cartesian3.clone(cameraCV.position, scratch3DToCVEndPos);\n  const endDir = Cartesian3.clone(cameraCV.direction, scratch3DToCVEndDir);\n  const endUp = Cartesian3.clone(cameraCV.up, scratch3DToCVEndUp);\n\n  scene._mode = SceneMode.MORPHING;\n\n  function morph() {\n    camera.frustum = cameraCV.frustum.clone();\n\n    const startPos = Cartesian3.clone(camera.position, scratch3DToCVStartPos);\n    const startDir = Cartesian3.clone(camera.direction, scratch3DToCVStartDir);\n    const startUp = Cartesian3.clone(camera.up, scratch3DToCVStartUp);\n    startPos.z = endPos.z;\n\n    function update(value) {\n      columbusViewMorph(startPos, endPos, value.time, camera.position);\n      columbusViewMorph(startDir, endDir, value.time, camera.direction);\n      columbusViewMorph(startUp, endUp, value.time, camera.up);\n      Cartesian3.cross(camera.direction, camera.up, camera.right);\n      Cartesian3.normalize(camera.right, camera.right);\n    }\n    const tween = scene.tweens.add({\n      duration: duration,\n      easingFunction: EasingFunction.QUARTIC_OUT,\n      startObject: {\n        time: 0.0,\n      },\n      stopObject: {\n        time: 1.0,\n      },\n      update: update,\n      complete: function () {\n        complete(transitioner);\n      },\n    });\n    transitioner._currentTweens.push(tween);\n  }\n\n  if (transitioner._morphToOrthographic) {\n    morph();\n  } else {\n    morphOrthographicToPerspective(transitioner, 0.0, cameraCV, morph);\n  }\n}\n\nfunction morphFrom3DToColumbusView(\n  transitioner,\n  duration,\n  endCamera,\n  complete\n) {\n  const scene = transitioner._scene;\n  const camera = scene.camera;\n\n  const startPos = Cartesian3.clone(camera.position, scratch3DToCVStartPos);\n  const startDir = Cartesian3.clone(camera.direction, scratch3DToCVStartDir);\n  const startUp = Cartesian3.clone(camera.up, scratch3DToCVStartUp);\n\n  const endPos = Cartesian3.clone(endCamera.position2D, scratch3DToCVEndPos);\n  const endDir = Cartesian3.clone(endCamera.direction2D, scratch3DToCVEndDir);\n  const endUp = Cartesian3.clone(endCamera.up2D, scratch3DToCVEndUp);\n\n  function update(value) {\n    columbusViewMorph(startPos, endPos, value.time, camera.position);\n    columbusViewMorph(startDir, endDir, value.time, camera.direction);\n    columbusViewMorph(startUp, endUp, value.time, camera.up);\n    Cartesian3.cross(camera.direction, camera.up, camera.right);\n    Cartesian3.normalize(camera.right, camera.right);\n    camera._adjustOrthographicFrustum(true);\n  }\n  const tween = scene.tweens.add({\n    duration: duration,\n    easingFunction: EasingFunction.QUARTIC_OUT,\n    startObject: {\n      time: 0.0,\n    },\n    stopObject: {\n      time: 1.0,\n    },\n    update: update,\n    complete: function () {\n      addMorphTimeAnimations(transitioner, scene, 1.0, 0.0, duration, complete);\n    },\n  });\n  transitioner._currentTweens.push(tween);\n}\n\nfunction addMorphTimeAnimations(\n  transitioner,\n  scene,\n  start,\n  stop,\n  duration,\n  complete\n) {\n  // Later, this will be linear and each object will adjust, if desired, in its vertex shader.\n  const options = {\n    object: scene,\n    property: \"morphTime\",\n    startValue: start,\n    stopValue: stop,\n    duration: duration,\n    easingFunction: EasingFunction.QUARTIC_OUT,\n  };\n\n  if (defined(complete)) {\n    options.complete = function () {\n      complete(transitioner);\n    };\n  }\n\n  const tween = scene.tweens.addProperty(options);\n  transitioner._currentTweens.push(tween);\n}\n\nfunction complete3DCallback(camera3D) {\n  return function (transitioner) {\n    const scene = transitioner._scene;\n    scene._mode = SceneMode.SCENE3D;\n    scene.morphTime = SceneMode.getMorphTime(SceneMode.SCENE3D);\n\n    destroyMorphHandler(transitioner);\n\n    const camera = scene.camera;\n    if (\n      transitioner._previousMode !== SceneMode.MORPHING ||\n      transitioner._morphCancelled\n    ) {\n      transitioner._morphCancelled = false;\n\n      Cartesian3.clone(camera3D.position, camera.position);\n      Cartesian3.clone(camera3D.direction, camera.direction);\n      Cartesian3.clone(camera3D.up, camera.up);\n      Cartesian3.cross(camera.direction, camera.up, camera.right);\n      Cartesian3.normalize(camera.right, camera.right);\n\n      camera.frustum = camera3D.frustum.clone();\n    }\n\n    const frustum = camera.frustum;\n    if (scene.frameState.useLogDepth) {\n      frustum.near = 0.1;\n      frustum.far = 10000000000.0;\n    }\n\n    const wasMorphing = defined(transitioner._completeMorph);\n    transitioner._completeMorph = undefined;\n    scene.camera.update(scene.mode);\n    transitioner._scene.morphComplete.raiseEvent(\n      transitioner,\n      transitioner._previousMode,\n      SceneMode.SCENE3D,\n      wasMorphing\n    );\n  };\n}\n\nfunction complete2DCallback(camera2D) {\n  return function (transitioner) {\n    const scene = transitioner._scene;\n\n    scene._mode = SceneMode.SCENE2D;\n    scene.morphTime = SceneMode.getMorphTime(SceneMode.SCENE2D);\n\n    destroyMorphHandler(transitioner);\n\n    const camera = scene.camera;\n    Cartesian3.clone(camera2D.position, camera.position);\n    camera.position.z = scene.mapProjection.ellipsoid.maximumRadius * 2.0;\n    Cartesian3.clone(camera2D.direction, camera.direction);\n    Cartesian3.clone(camera2D.up, camera.up);\n    Cartesian3.cross(camera.direction, camera.up, camera.right);\n    Cartesian3.normalize(camera.right, camera.right);\n    camera.frustum = camera2D.frustum.clone();\n\n    const wasMorphing = defined(transitioner._completeMorph);\n    transitioner._completeMorph = undefined;\n    scene.camera.update(scene.mode);\n    transitioner._scene.morphComplete.raiseEvent(\n      transitioner,\n      transitioner._previousMode,\n      SceneMode.SCENE2D,\n      wasMorphing\n    );\n  };\n}\n\nfunction completeColumbusViewCallback(cameraCV) {\n  return function (transitioner) {\n    const scene = transitioner._scene;\n    scene._mode = SceneMode.COLUMBUS_VIEW;\n    scene.morphTime = SceneMode.getMorphTime(SceneMode.COLUMBUS_VIEW);\n\n    destroyMorphHandler(transitioner);\n\n    const camera = scene.camera;\n    if (\n      transitioner._previousModeMode !== SceneMode.MORPHING ||\n      transitioner._morphCancelled\n    ) {\n      transitioner._morphCancelled = false;\n\n      Cartesian3.clone(cameraCV.position, camera.position);\n      Cartesian3.clone(cameraCV.direction, camera.direction);\n      Cartesian3.clone(cameraCV.up, camera.up);\n      Cartesian3.cross(camera.direction, camera.up, camera.right);\n      Cartesian3.normalize(camera.right, camera.right);\n    }\n\n    const frustum = camera.frustum;\n    if (scene.frameState.useLogDepth) {\n      frustum.near = 0.1;\n      frustum.far = 10000000000.0;\n    }\n\n    const wasMorphing = defined(transitioner._completeMorph);\n    transitioner._completeMorph = undefined;\n    scene.camera.update(scene.mode);\n    transitioner._scene.morphComplete.raiseEvent(\n      transitioner,\n      transitioner._previousMode,\n      SceneMode.COLUMBUS_VIEW,\n      wasMorphing\n    );\n  };\n}\nexport default SceneTransitioner;\n", "/**\n * Enumerates the available input for interacting with the camera.\n *\n * @enum {number}\n */\nconst CameraEventType = {\n  /**\n   * A left mouse button press followed by moving the mouse and releasing the button.\n   *\n   * @type {number}\n   * @constant\n   */\n  LEFT_DRAG: 0,\n\n  /**\n   *  A right mouse button press followed by moving the mouse and releasing the button.\n   *\n   * @type {number}\n   * @constant\n   */\n  RIGHT_DRAG: 1,\n\n  /**\n   *  A middle mouse button press followed by moving the mouse and releasing the button.\n   *\n   * @type {number}\n   * @constant\n   */\n  MIDDLE_DRAG: 2,\n\n  /**\n   * Scrolling the middle mouse button.\n   *\n   * @type {number}\n   * @constant\n   */\n  WHEEL: 3,\n\n  /**\n   * A two-finger touch on a touch surface.\n   *\n   * @type {number}\n   * @constant\n   */\n  PINCH: 4,\n};\nexport default Object.freeze(CameraEventType);\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport KeyboardEventModifier from \"../Core/KeyboardEventModifier.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport ScreenSpaceEventHandler from \"../Core/ScreenSpaceEventHandler.js\";\nimport ScreenSpaceEventType from \"../Core/ScreenSpaceEventType.js\";\nimport CameraEventType from \"./CameraEventType.js\";\n\nfunction getKey(type, modifier) {\n  let key = type;\n  if (defined(modifier)) {\n    key += `+${modifier}`;\n  }\n  return key;\n}\n\nfunction clonePinchMovement(pinchMovement, result) {\n  Cartesian2.clone(\n    pinchMovement.distance.startPosition,\n    result.distance.startPosition\n  );\n  Cartesian2.clone(\n    pinchMovement.distance.endPosition,\n    result.distance.endPosition\n  );\n\n  Cartesian2.clone(\n    pinchMovement.angleAndHeight.startPosition,\n    result.angleAndHeight.startPosition\n  );\n  Cartesian2.clone(\n    pinchMovement.angleAndHeight.endPosition,\n    result.angleAndHeight.endPosition\n  );\n}\n\nfunction listenToPinch(aggregator, modifier, canvas) {\n  const key = getKey(CameraEventType.PINCH, modifier);\n\n  const update = aggregator._update;\n  const isDown = aggregator._isDown;\n  const eventStartPosition = aggregator._eventStartPosition;\n  const pressTime = aggregator._pressTime;\n  const releaseTime = aggregator._releaseTime;\n\n  update[key] = true;\n  isDown[key] = false;\n  eventStartPosition[key] = new Cartesian2();\n\n  let movement = aggregator._movement[key];\n  if (!defined(movement)) {\n    movement = aggregator._movement[key] = {};\n  }\n\n  movement.distance = {\n    startPosition: new Cartesian2(),\n    endPosition: new Cartesian2(),\n  };\n  movement.angleAndHeight = {\n    startPosition: new Cartesian2(),\n    endPosition: new Cartesian2(),\n  };\n  movement.prevAngle = 0.0;\n\n  aggregator._eventHandler.setInputAction(\n    function (event) {\n      aggregator._buttonsDown++;\n      isDown[key] = true;\n      pressTime[key] = new Date();\n      // Compute center position and store as start point.\n      Cartesian2.lerp(\n        event.position1,\n        event.position2,\n        0.5,\n        eventStartPosition[key]\n      );\n    },\n    ScreenSpaceEventType.PINCH_START,\n    modifier\n  );\n\n  aggregator._eventHandler.setInputAction(\n    function () {\n      aggregator._buttonsDown = Math.max(aggregator._buttonsDown - 1, 0);\n      isDown[key] = false;\n      releaseTime[key] = new Date();\n    },\n    ScreenSpaceEventType.PINCH_END,\n    modifier\n  );\n\n  aggregator._eventHandler.setInputAction(\n    function (mouseMovement) {\n      if (isDown[key]) {\n        // Aggregate several input events into a single animation frame.\n        if (!update[key]) {\n          Cartesian2.clone(\n            mouseMovement.distance.endPosition,\n            movement.distance.endPosition\n          );\n          Cartesian2.clone(\n            mouseMovement.angleAndHeight.endPosition,\n            movement.angleAndHeight.endPosition\n          );\n        } else {\n          clonePinchMovement(mouseMovement, movement);\n          update[key] = false;\n          movement.prevAngle = movement.angleAndHeight.startPosition.x;\n        }\n        // Make sure our aggregation of angles does not \"flip\" over 360 degrees.\n        let angle = movement.angleAndHeight.endPosition.x;\n        const prevAngle = movement.prevAngle;\n        const TwoPI = Math.PI * 2;\n        while (angle >= prevAngle + Math.PI) {\n          angle -= TwoPI;\n        }\n        while (angle < prevAngle - Math.PI) {\n          angle += TwoPI;\n        }\n        movement.angleAndHeight.endPosition.x =\n          (-angle * canvas.clientWidth) / 12;\n        movement.angleAndHeight.startPosition.x =\n          (-prevAngle * canvas.clientWidth) / 12;\n      }\n    },\n    ScreenSpaceEventType.PINCH_MOVE,\n    modifier\n  );\n}\n\nfunction listenToWheel(aggregator, modifier) {\n  const key = getKey(CameraEventType.WHEEL, modifier);\n\n  const pressTime = aggregator._pressTime;\n  const releaseTime = aggregator._releaseTime;\n\n  const update = aggregator._update;\n  update[key] = true;\n\n  let movement = aggregator._movement[key];\n  if (!defined(movement)) {\n    movement = aggregator._movement[key] = {};\n  }\n\n  let lastMovement = aggregator._lastMovement[key];\n  if (!defined(lastMovement)) {\n    lastMovement = aggregator._lastMovement[key] = {\n      startPosition: new Cartesian2(),\n      endPosition: new Cartesian2(),\n      valid: false,\n    };\n  }\n\n  movement.startPosition = new Cartesian2();\n  Cartesian2.clone(Cartesian2.ZERO, movement.startPosition);\n  movement.endPosition = new Cartesian2();\n\n  aggregator._eventHandler.setInputAction(\n    function (delta) {\n      const arcLength = 7.5 * CesiumMath.toRadians(delta);\n      pressTime[key] = releaseTime[key] = new Date();\n      movement.endPosition.x = 0.0;\n      movement.endPosition.y = arcLength;\n      Cartesian2.clone(movement.endPosition, lastMovement.endPosition);\n      lastMovement.valid = true;\n      update[key] = false;\n    },\n    ScreenSpaceEventType.WHEEL,\n    modifier\n  );\n}\n\nfunction listenMouseButtonDownUp(aggregator, modifier, type) {\n  const key = getKey(type, modifier);\n\n  const isDown = aggregator._isDown;\n  const eventStartPosition = aggregator._eventStartPosition;\n  const pressTime = aggregator._pressTime;\n  const releaseTime = aggregator._releaseTime;\n\n  isDown[key] = false;\n  eventStartPosition[key] = new Cartesian2();\n\n  let lastMovement = aggregator._lastMovement[key];\n  if (!defined(lastMovement)) {\n    lastMovement = aggregator._lastMovement[key] = {\n      startPosition: new Cartesian2(),\n      endPosition: new Cartesian2(),\n      valid: false,\n    };\n  }\n\n  let down;\n  let up;\n  if (type === CameraEventType.LEFT_DRAG) {\n    down = ScreenSpaceEventType.LEFT_DOWN;\n    up = ScreenSpaceEventType.LEFT_UP;\n  } else if (type === CameraEventType.RIGHT_DRAG) {\n    down = ScreenSpaceEventType.RIGHT_DOWN;\n    up = ScreenSpaceEventType.RIGHT_UP;\n  } else if (type === CameraEventType.MIDDLE_DRAG) {\n    down = ScreenSpaceEventType.MIDDLE_DOWN;\n    up = ScreenSpaceEventType.MIDDLE_UP;\n  }\n\n  aggregator._eventHandler.setInputAction(\n    function (event) {\n      aggregator._buttonsDown++;\n      lastMovement.valid = false;\n      isDown[key] = true;\n      pressTime[key] = new Date();\n      Cartesian2.clone(event.position, eventStartPosition[key]);\n    },\n    down,\n    modifier\n  );\n\n  aggregator._eventHandler.setInputAction(\n    function () {\n      aggregator._buttonsDown = Math.max(aggregator._buttonsDown - 1, 0);\n      isDown[key] = false;\n      releaseTime[key] = new Date();\n    },\n    up,\n    modifier\n  );\n}\n\nfunction cloneMouseMovement(mouseMovement, result) {\n  Cartesian2.clone(mouseMovement.startPosition, result.startPosition);\n  Cartesian2.clone(mouseMovement.endPosition, result.endPosition);\n}\n\nfunction listenMouseMove(aggregator, modifier) {\n  const update = aggregator._update;\n  const movement = aggregator._movement;\n  const lastMovement = aggregator._lastMovement;\n  const isDown = aggregator._isDown;\n\n  for (const typeName in CameraEventType) {\n    if (CameraEventType.hasOwnProperty(typeName)) {\n      const type = CameraEventType[typeName];\n      if (defined(type)) {\n        const key = getKey(type, modifier);\n        update[key] = true;\n\n        if (!defined(aggregator._lastMovement[key])) {\n          aggregator._lastMovement[key] = {\n            startPosition: new Cartesian2(),\n            endPosition: new Cartesian2(),\n            valid: false,\n          };\n        }\n\n        if (!defined(aggregator._movement[key])) {\n          aggregator._movement[key] = {\n            startPosition: new Cartesian2(),\n            endPosition: new Cartesian2(),\n          };\n        }\n      }\n    }\n  }\n\n  aggregator._eventHandler.setInputAction(\n    function (mouseMovement) {\n      for (const typeName in CameraEventType) {\n        if (CameraEventType.hasOwnProperty(typeName)) {\n          const type = CameraEventType[typeName];\n          if (defined(type)) {\n            const key = getKey(type, modifier);\n            if (isDown[key]) {\n              if (!update[key]) {\n                Cartesian2.clone(\n                  mouseMovement.endPosition,\n                  movement[key].endPosition\n                );\n              } else {\n                cloneMouseMovement(movement[key], lastMovement[key]);\n                lastMovement[key].valid = true;\n                cloneMouseMovement(mouseMovement, movement[key]);\n                update[key] = false;\n              }\n            }\n          }\n        }\n      }\n\n      Cartesian2.clone(\n        mouseMovement.endPosition,\n        aggregator._currentMousePosition\n      );\n    },\n    ScreenSpaceEventType.MOUSE_MOVE,\n    modifier\n  );\n}\n\n/**\n * Aggregates input events. For example, suppose the following inputs are received between frames:\n * left mouse button down, mouse move, mouse move, left mouse button up. These events will be aggregated into\n * one event with a start and end position of the mouse.\n *\n * @alias CameraEventAggregator\n * @constructor\n *\n * @param {HTMLCanvasElement} [canvas=document] The element to handle events for.\n *\n * @see ScreenSpaceEventHandler\n */\nfunction CameraEventAggregator(canvas) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(canvas)) {\n    throw new DeveloperError(\"canvas is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._eventHandler = new ScreenSpaceEventHandler(canvas);\n\n  this._update = {};\n  this._movement = {};\n  this._lastMovement = {};\n  this._isDown = {};\n  this._eventStartPosition = {};\n  this._pressTime = {};\n  this._releaseTime = {};\n\n  this._buttonsDown = 0;\n\n  this._currentMousePosition = new Cartesian2();\n\n  listenToWheel(this, undefined);\n  listenToPinch(this, undefined, canvas);\n  listenMouseButtonDownUp(this, undefined, CameraEventType.LEFT_DRAG);\n  listenMouseButtonDownUp(this, undefined, CameraEventType.RIGHT_DRAG);\n  listenMouseButtonDownUp(this, undefined, CameraEventType.MIDDLE_DRAG);\n  listenMouseMove(this, undefined);\n\n  for (const modifierName in KeyboardEventModifier) {\n    if (KeyboardEventModifier.hasOwnProperty(modifierName)) {\n      const modifier = KeyboardEventModifier[modifierName];\n      if (defined(modifier)) {\n        listenToWheel(this, modifier);\n        listenToPinch(this, modifier, canvas);\n        listenMouseButtonDownUp(this, modifier, CameraEventType.LEFT_DRAG);\n        listenMouseButtonDownUp(this, modifier, CameraEventType.RIGHT_DRAG);\n        listenMouseButtonDownUp(this, modifier, CameraEventType.MIDDLE_DRAG);\n        listenMouseMove(this, modifier);\n      }\n    }\n  }\n}\n\nObject.defineProperties(CameraEventAggregator.prototype, {\n  /**\n   * Gets the current mouse position.\n   * @memberof CameraEventAggregator.prototype\n   * @type {Cartesian2}\n   */\n  currentMousePosition: {\n    get: function () {\n      return this._currentMousePosition;\n    },\n  },\n\n  /**\n   * Gets whether any mouse button is down, a touch has started, or the wheel has been moved.\n   * @memberof CameraEventAggregator.prototype\n   * @type {boolean}\n   */\n  anyButtonDown: {\n    get: function () {\n      const wheelMoved =\n        !this._update[getKey(CameraEventType.WHEEL)] ||\n        !this._update[\n          getKey(CameraEventType.WHEEL, KeyboardEventModifier.SHIFT)\n        ] ||\n        !this._update[\n          getKey(CameraEventType.WHEEL, KeyboardEventModifier.CTRL)\n        ] ||\n        !this._update[getKey(CameraEventType.WHEEL, KeyboardEventModifier.ALT)];\n      return this._buttonsDown > 0 || wheelMoved;\n    },\n  },\n});\n\n/**\n * Gets if a mouse button down or touch has started and has been moved.\n *\n * @param {CameraEventType} type The camera event type.\n * @param {KeyboardEventModifier} [modifier] The keyboard modifier.\n * @returns {boolean} Returns <code>true</code> if a mouse button down or touch has started and has been moved; otherwise, <code>false</code>\n */\nCameraEventAggregator.prototype.isMoving = function (type, modifier) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(type)) {\n    throw new DeveloperError(\"type is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const key = getKey(type, modifier);\n  return !this._update[key];\n};\n\n/**\n * Gets the aggregated start and end position of the current event.\n *\n * @param {CameraEventType} type The camera event type.\n * @param {KeyboardEventModifier} [modifier] The keyboard modifier.\n * @returns {object} An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code>.\n */\nCameraEventAggregator.prototype.getMovement = function (type, modifier) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(type)) {\n    throw new DeveloperError(\"type is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const key = getKey(type, modifier);\n  const movement = this._movement[key];\n  return movement;\n};\n\n/**\n * Gets the start and end position of the last move event (not the aggregated event).\n *\n * @param {CameraEventType} type The camera event type.\n * @param {KeyboardEventModifier} [modifier] The keyboard modifier.\n * @returns {object|undefined} An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code> or <code>undefined</code>.\n */\nCameraEventAggregator.prototype.getLastMovement = function (type, modifier) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(type)) {\n    throw new DeveloperError(\"type is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const key = getKey(type, modifier);\n  const lastMovement = this._lastMovement[key];\n  if (lastMovement.valid) {\n    return lastMovement;\n  }\n\n  return undefined;\n};\n\n/**\n * Gets whether the mouse button is down or a touch has started.\n *\n * @param {CameraEventType} type The camera event type.\n * @param {KeyboardEventModifier} [modifier] The keyboard modifier.\n * @returns {boolean} Whether the mouse button is down or a touch has started.\n */\nCameraEventAggregator.prototype.isButtonDown = function (type, modifier) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(type)) {\n    throw new DeveloperError(\"type is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const key = getKey(type, modifier);\n  return this._isDown[key];\n};\n\n/**\n * Gets the mouse position that started the aggregation.\n *\n * @param {CameraEventType} type The camera event type.\n * @param {KeyboardEventModifier} [modifier] The keyboard modifier.\n * @returns {Cartesian2} The mouse position.\n */\nCameraEventAggregator.prototype.getStartMousePosition = function (\n  type,\n  modifier\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(type)) {\n    throw new DeveloperError(\"type is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (type === CameraEventType.WHEEL) {\n    return this._currentMousePosition;\n  }\n\n  const key = getKey(type, modifier);\n  return this._eventStartPosition[key];\n};\n\n/**\n * Gets the time the button was pressed or the touch was started.\n *\n * @param {CameraEventType} type The camera event type.\n * @param {KeyboardEventModifier} [modifier] The keyboard modifier.\n * @returns {Date} The time the button was pressed or the touch was started.\n */\nCameraEventAggregator.prototype.getButtonPressTime = function (type, modifier) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(type)) {\n    throw new DeveloperError(\"type is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const key = getKey(type, modifier);\n  return this._pressTime[key];\n};\n\n/**\n * Gets the time the button was released or the touch was ended.\n *\n * @param {CameraEventType} type The camera event type.\n * @param {KeyboardEventModifier} [modifier] The keyboard modifier.\n * @returns {Date} The time the button was released or the touch was ended.\n */\nCameraEventAggregator.prototype.getButtonReleaseTime = function (\n  type,\n  modifier\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(type)) {\n    throw new DeveloperError(\"type is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const key = getKey(type, modifier);\n  return this._releaseTime[key];\n};\n\n/**\n * Signals that all of the events have been handled and the aggregator should be reset to handle new events.\n */\nCameraEventAggregator.prototype.reset = function () {\n  for (const name in this._update) {\n    if (this._update.hasOwnProperty(name)) {\n      this._update[name] = true;\n    }\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see CameraEventAggregator#destroy\n */\nCameraEventAggregator.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Removes mouse listeners held by this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * handler = handler && handler.destroy();\n *\n * @see CameraEventAggregator#isDestroyed\n */\nCameraEventAggregator.prototype.destroy = function () {\n  this._eventHandler = this._eventHandler && this._eventHandler.destroy();\n  return destroyObject(this);\n};\nexport default CameraEventAggregator;\n", "import clone from \"../Core/clone.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EasingFunction from \"../Core/EasingFunction.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport TimeConstants from \"../Core/TimeConstants.js\";\nimport { Tween as TweenJS } from \"@tweenjs/tween.js\";\n\n/**\n * A tween is an animation that interpolates the properties of two objects using an {@link EasingFunction}.  Create\n * one using {@link Scene#tweens} and {@link TweenCollection#add} and related add functions.\n *\n * @alias Tween\n * @constructor\n *\n * @private\n */\nfunction Tween(\n  tweens,\n  tweenjs,\n  startObject,\n  stopObject,\n  duration,\n  delay,\n  easingFunction,\n  update,\n  complete,\n  cancel\n) {\n  this._tweens = tweens;\n  this._tweenjs = tweenjs;\n\n  this._startObject = clone(startObject);\n  this._stopObject = clone(stopObject);\n\n  this._duration = duration;\n  this._delay = delay;\n  this._easingFunction = easingFunction;\n\n  this._update = update;\n  this._complete = complete;\n\n  /**\n   * The callback to call if the tween is canceled either because {@link Tween#cancelTween}\n   * was called or because the tween was removed from the collection.\n   *\n   * @type {TweenCollection.TweenCancelledCallback}\n   */\n  this.cancel = cancel;\n\n  /**\n   * @private\n   */\n  this.needsStart = true;\n}\n\nObject.defineProperties(Tween.prototype, {\n  /**\n   * An object with properties for initial values of the tween.  The properties of this object are changed during the tween's animation.\n   * @memberof Tween.prototype\n   *\n   * @type {object}\n   * @readonly\n   */\n  startObject: {\n    get: function () {\n      return this._startObject;\n    },\n  },\n\n  /**\n   * An object with properties for the final values of the tween.\n   * @memberof Tween.prototype\n   *\n   * @type {object}\n   * @readonly\n   */\n  stopObject: {\n    get: function () {\n      return this._stopObject;\n    },\n  },\n\n  /**\n   * The duration, in seconds, for the tween.  The tween is automatically removed from the collection when it stops.\n   * @memberof Tween.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  duration: {\n    get: function () {\n      return this._duration;\n    },\n  },\n\n  /**\n   * The delay, in seconds, before the tween starts animating.\n   * @memberof Tween.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  delay: {\n    get: function () {\n      return this._delay;\n    },\n  },\n\n  /**\n   * Determines the curve for animtion.\n   * @memberof Tween.prototype\n   *\n   * @type {EasingFunction}\n   * @readonly\n   */\n  easingFunction: {\n    get: function () {\n      return this._easingFunction;\n    },\n  },\n\n  /**\n   * The callback to call at each animation update (usually tied to the a rendered frame).\n   * @memberof Tween.prototype\n   *\n   * @type {TweenCollection.TweenUpdateCallback}\n   * @readonly\n   */\n  update: {\n    get: function () {\n      return this._update;\n    },\n  },\n\n  /**\n   * The callback to call when the tween finishes animating.\n   * @memberof Tween.prototype\n   *\n   * @type {TweenCollection.TweenCompleteCallback}\n   * @readonly\n   */\n  complete: {\n    get: function () {\n      return this._complete;\n    },\n  },\n\n  /**\n   * @memberof Tween.prototype\n   *\n   * @private\n   */\n  tweenjs: {\n    get: function () {\n      return this._tweenjs;\n    },\n  },\n});\n\n/**\n * Cancels the tween calling the {@link Tween#cancel} callback if one exists.  This\n * has no effect if the tween finished or was already canceled.\n */\nTween.prototype.cancelTween = function () {\n  this._tweens.remove(this);\n};\n\n/**\n * A collection of tweens for animating properties.  Commonly accessed using {@link Scene#tweens}.\n *\n * @alias TweenCollection\n * @constructor\n *\n * @private\n */\nfunction TweenCollection() {\n  this._tweens = [];\n}\n\nObject.defineProperties(TweenCollection.prototype, {\n  /**\n   * The number of tweens in the collection.\n   * @memberof TweenCollection.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  length: {\n    get: function () {\n      return this._tweens.length;\n    },\n  },\n});\n\n/**\n * Creates a tween for animating between two sets of properties.  The tween starts animating at the next call to {@link TweenCollection#update}, which\n * is implicit when {@link Viewer} or {@link CesiumWidget} render the scene.\n *\n * @param {object} [options] Object with the following properties:\n * @param {object} options.startObject An object with properties for initial values of the tween.  The properties of this object are changed during the tween's animation.\n * @param {object} options.stopObject An object with properties for the final values of the tween.\n * @param {number} options.duration The duration, in seconds, for the tween.  The tween is automatically removed from the collection when it stops.\n * @param {number} [options.delay=0.0] The delay, in seconds, before the tween starts animating.\n * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion.\n * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame).\n * @param {TweenCollection.TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating.\n * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection.\n * @returns {Tween} The tween.\n *\n * @exception {DeveloperError} options.duration must be positive.\n */\nTweenCollection.prototype.add = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options.startObject) || !defined(options.stopObject)) {\n    throw new DeveloperError(\n      \"options.startObject and options.stopObject are required.\"\n    );\n  }\n\n  if (!defined(options.duration) || options.duration < 0.0) {\n    throw new DeveloperError(\n      \"options.duration is required and must be positive.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  if (options.duration === 0.0) {\n    if (defined(options.complete)) {\n      options.complete();\n    }\n    return new Tween(this);\n  }\n\n  const duration = options.duration / TimeConstants.SECONDS_PER_MILLISECOND;\n  const delayInSeconds = defaultValue(options.delay, 0.0);\n  const delay = delayInSeconds / TimeConstants.SECONDS_PER_MILLISECOND;\n  const easingFunction = defaultValue(\n    options.easingFunction,\n    EasingFunction.LINEAR_NONE\n  );\n\n  const value = options.startObject;\n  const tweenjs = new TweenJS(value);\n  tweenjs.to(clone(options.stopObject), duration);\n  tweenjs.delay(delay);\n  tweenjs.easing(easingFunction);\n  if (defined(options.update)) {\n    tweenjs.onUpdate(function () {\n      options.update(value);\n    });\n  }\n  tweenjs.onComplete(defaultValue(options.complete, null));\n  tweenjs.repeat(defaultValue(options._repeat, 0.0));\n\n  const tween = new Tween(\n    this,\n    tweenjs,\n    options.startObject,\n    options.stopObject,\n    options.duration,\n    delayInSeconds,\n    easingFunction,\n    options.update,\n    options.complete,\n    options.cancel\n  );\n  this._tweens.push(tween);\n  return tween;\n};\n\n/**\n * Creates a tween for animating a scalar property on the given object.  The tween starts animating at the next call to {@link TweenCollection#update}, which\n * is implicit when {@link Viewer} or {@link CesiumWidget} render the scene.\n *\n * @param {object} [options] Object with the following properties:\n * @param {object} options.object The object containing the property to animate.\n * @param {string} options.property The name of the property to animate.\n * @param {number} options.startValue The initial value.\n * @param {number} options.stopValue The final value.\n * @param {number} [options.duration=3.0] The duration, in seconds, for the tween.  The tween is automatically removed from the collection when it stops.\n * @param {number} [options.delay=0.0] The delay, in seconds, before the tween starts animating.\n * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion.\n * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame).\n * @param {TweenCollection.TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating.\n * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection.\n * @returns {Tween} The tween.\n *\n * @exception {DeveloperError} options.object must have the specified property.\n * @exception {DeveloperError} options.duration must be positive.\n */\nTweenCollection.prototype.addProperty = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const object = options.object;\n  const property = options.property;\n  const startValue = options.startValue;\n  const stopValue = options.stopValue;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(object) || !defined(options.property)) {\n    throw new DeveloperError(\n      \"options.object and options.property are required.\"\n    );\n  }\n  if (!defined(object[property])) {\n    throw new DeveloperError(\n      \"options.object must have the specified property.\"\n    );\n  }\n  if (!defined(startValue) || !defined(stopValue)) {\n    throw new DeveloperError(\n      \"options.startValue and options.stopValue are required.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  function update(value) {\n    object[property] = value.value;\n  }\n\n  return this.add({\n    startObject: {\n      value: startValue,\n    },\n    stopObject: {\n      value: stopValue,\n    },\n    duration: defaultValue(options.duration, 3.0),\n    delay: options.delay,\n    easingFunction: options.easingFunction,\n    update: update,\n    complete: options.complete,\n    cancel: options.cancel,\n    _repeat: options._repeat,\n  });\n};\n\n/**\n * Creates a tween for animating the alpha of all color uniforms on a {@link Material}.  The tween starts animating at the next call to {@link TweenCollection#update}, which\n * is implicit when {@link Viewer} or {@link CesiumWidget} render the scene.\n *\n * @param {object} [options] Object with the following properties:\n * @param {Material} options.material The material to animate.\n * @param {number} [options.startValue=0.0] The initial alpha value.\n * @param {number} [options.stopValue=1.0] The final alpha value.\n * @param {number} [options.duration=3.0] The duration, in seconds, for the tween.  The tween is automatically removed from the collection when it stops.\n * @param {number} [options.delay=0.0] The delay, in seconds, before the tween starts animating.\n * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion.\n * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame).\n * @param {TweenCollection.TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating.\n * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection.\n * @returns {Tween} The tween.\n *\n * @exception {DeveloperError} material has no properties with alpha components.\n * @exception {DeveloperError} options.duration must be positive.\n */\nTweenCollection.prototype.addAlpha = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const material = options.material;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(material)) {\n    throw new DeveloperError(\"options.material is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const properties = [];\n\n  for (const property in material.uniforms) {\n    if (\n      material.uniforms.hasOwnProperty(property) &&\n      defined(material.uniforms[property]) &&\n      defined(material.uniforms[property].alpha)\n    ) {\n      properties.push(property);\n    }\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (properties.length === 0) {\n    throw new DeveloperError(\n      \"material has no properties with alpha components.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  function update(value) {\n    const length = properties.length;\n    for (let i = 0; i < length; ++i) {\n      material.uniforms[properties[i]].alpha = value.alpha;\n    }\n  }\n\n  return this.add({\n    startObject: {\n      alpha: defaultValue(options.startValue, 0.0), // Default to fade in\n    },\n    stopObject: {\n      alpha: defaultValue(options.stopValue, 1.0),\n    },\n    duration: defaultValue(options.duration, 3.0),\n    delay: options.delay,\n    easingFunction: options.easingFunction,\n    update: update,\n    complete: options.complete,\n    cancel: options.cancel,\n  });\n};\n\n/**\n * Creates a tween for animating the offset uniform of a {@link Material}.  The tween starts animating at the next call to {@link TweenCollection#update}, which\n * is implicit when {@link Viewer} or {@link CesiumWidget} render the scene.\n *\n * @param {object} [options] Object with the following properties:\n * @param {Material} options.material The material to animate.\n * @param {number} options.startValue The initial alpha value.\n * @param {number} options.stopValue The final alpha value.\n * @param {number} [options.duration=3.0] The duration, in seconds, for the tween.  The tween is automatically removed from the collection when it stops.\n * @param {number} [options.delay=0.0] The delay, in seconds, before the tween starts animating.\n * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion.\n * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame).\n * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection.\n * @returns {Tween} The tween.\n *\n * @exception {DeveloperError} material.uniforms must have an offset property.\n * @exception {DeveloperError} options.duration must be positive.\n */\nTweenCollection.prototype.addOffsetIncrement = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const material = options.material;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(material)) {\n    throw new DeveloperError(\"material is required.\");\n  }\n  if (!defined(material.uniforms.offset)) {\n    throw new DeveloperError(\"material.uniforms must have an offset property.\");\n  }\n  //>>includeEnd('debug');\n\n  const uniforms = material.uniforms;\n  return this.addProperty({\n    object: uniforms,\n    property: \"offset\",\n    startValue: uniforms.offset,\n    stopValue: uniforms.offset + 1,\n    duration: options.duration,\n    delay: options.delay,\n    easingFunction: options.easingFunction,\n    update: options.update,\n    cancel: options.cancel,\n    _repeat: Infinity,\n  });\n};\n\n/**\n * Removes a tween from the collection.\n * <p>\n * This calls the {@link Tween#cancel} callback if the tween has one.\n * </p>\n *\n * @param {Tween} tween The tween to remove.\n * @returns {boolean} <code>true</code> if the tween was removed; <code>false</code> if the tween was not found in the collection.\n */\nTweenCollection.prototype.remove = function (tween) {\n  if (!defined(tween)) {\n    return false;\n  }\n\n  const index = this._tweens.indexOf(tween);\n  if (index !== -1) {\n    tween.tweenjs.stop();\n    if (defined(tween.cancel)) {\n      tween.cancel();\n    }\n    this._tweens.splice(index, 1);\n    return true;\n  }\n\n  return false;\n};\n\n/**\n * Removes all tweens from the collection.\n * <p>\n * This calls the {@link Tween#cancel} callback for each tween that has one.\n * </p>\n */\nTweenCollection.prototype.removeAll = function () {\n  const tweens = this._tweens;\n\n  for (let i = 0; i < tweens.length; ++i) {\n    const tween = tweens[i];\n    tween.tweenjs.stop();\n    if (defined(tween.cancel)) {\n      tween.cancel();\n    }\n  }\n  tweens.length = 0;\n};\n\n/**\n * Determines whether this collection contains a given tween.\n *\n * @param {Tween} tween The tween to check for.\n * @returns {boolean} <code>true</code> if this collection contains the tween, <code>false</code> otherwise.\n */\nTweenCollection.prototype.contains = function (tween) {\n  return defined(tween) && this._tweens.indexOf(tween) !== -1;\n};\n\n/**\n * Returns the tween in the collection at the specified index.  Indices are zero-based\n * and increase as tweens are added.  Removing a tween shifts all tweens after\n * it to the left, changing their indices.  This function is commonly used to iterate over\n * all the tween in the collection.\n *\n * @param {number} index The zero-based index of the tween.\n * @returns {Tween} The tween at the specified index.\n *\n * @example\n * // Output the duration of all the tweens in the collection.\n * const tweens = scene.tweens;\n * const length = tweens.length;\n * for (let i = 0; i < length; ++i) {\n *   console.log(tweens.get(i).duration);\n * }\n */\nTweenCollection.prototype.get = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(index)) {\n    throw new DeveloperError(\"index is required.\");\n  }\n  //>>includeEnd('debug');\n\n  return this._tweens[index];\n};\n\n/**\n * Updates the tweens in the collection to be at the provide time.  When a tween finishes, it is removed\n * from the collection.\n *\n * @param {number} [time=getTimestamp()] The time in seconds.  By default tweens are synced to the system clock.\n */\nTweenCollection.prototype.update = function (time) {\n  const tweens = this._tweens;\n\n  let i = 0;\n  time = defined(time)\n    ? time / TimeConstants.SECONDS_PER_MILLISECOND\n    : getTimestamp();\n  while (i < tweens.length) {\n    const tween = tweens[i];\n    const tweenjs = tween.tweenjs;\n\n    if (tween.needsStart) {\n      tween.needsStart = false;\n      tweenjs.start(time);\n    } else if (tweenjs.update(time)) {\n      i++;\n    } else {\n      tweenjs.stop();\n      tweens.splice(i, 1);\n    }\n  }\n};\n\n/**\n * A function that will execute when a tween completes.\n * @callback TweenCollection.TweenCompleteCallback\n */\n\n/**\n * A function that will execute when a tween updates.\n * @callback TweenCollection.TweenUpdateCallback\n */\n\n/**\n * A function that will execute when a tween is cancelled.\n * @callback TweenCollection.TweenCancelledCallback\n */\nexport default TweenCollection;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport HeadingPitchRoll from \"../Core/HeadingPitchRoll.js\";\nimport IntersectionTests from \"../Core/IntersectionTests.js\";\nimport KeyboardEventModifier from \"../Core/KeyboardEventModifier.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport Plane from \"../Core/Plane.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport Ray from \"../Core/Ray.js\";\nimport VerticalExaggeration from \"../Core/VerticalExaggeration.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport CameraEventAggregator from \"./CameraEventAggregator.js\";\nimport CameraEventType from \"./CameraEventType.js\";\nimport MapMode2D from \"./MapMode2D.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport SceneTransforms from \"./SceneTransforms.js\";\nimport TweenCollection from \"./TweenCollection.js\";\n\n/**\n * Modifies the camera position and orientation based on mouse input to a canvas.\n * @alias ScreenSpaceCameraController\n * @constructor\n *\n * @param {Scene} scene The scene.\n */\nfunction ScreenSpaceCameraController(scene) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  /**\n   * If true, inputs are allowed conditionally with the flags enableTranslate, enableZoom,\n   * enableRotate, enableTilt, and enableLook.  If false, all inputs are disabled.\n   *\n   * NOTE: This setting is for temporary use cases, such as camera flights and\n   * drag-selection of regions (see Picking demo).  It is typically set to false at the\n   * start of such events, and set true on completion.  To keep inputs disabled\n   * past the end of camera flights, you must use the other booleans (enableTranslate,\n   * enableZoom, enableRotate, enableTilt, and enableLook).\n   * @type {boolean}\n   * @default true\n   */\n  this.enableInputs = true;\n  /**\n   * If true, allows the user to pan around the map.  If false, the camera stays locked at the current position.\n   * This flag only applies in 2D and Columbus view modes.\n   * @type {boolean}\n   * @default true\n   */\n  this.enableTranslate = true;\n  /**\n   * If true, allows the user to zoom in and out.  If false, the camera is locked to the current distance from the ellipsoid.\n   * @type {boolean}\n   * @default true\n   */\n  this.enableZoom = true;\n  /**\n   * If true, allows the user to rotate the world which translates the user's position.\n   * This flag only applies in 2D and 3D.\n   * @type {boolean}\n   * @default true\n   */\n  this.enableRotate = true;\n  /**\n   * If true, allows the user to tilt the camera.  If false, the camera is locked to the current heading.\n   * This flag only applies in 3D and Columbus view.\n   * @type {boolean}\n   * @default true\n   */\n  this.enableTilt = true;\n  /**\n   * If true, allows the user to use free-look. If false, the camera view direction can only be changed through translating\n   * or rotating. This flag only applies in 3D and Columbus view modes.\n   * @type {boolean}\n   * @default true\n   */\n  this.enableLook = true;\n  /**\n   * A parameter in the range <code>[0, 1)</code> used to determine how long\n   * the camera will continue to spin because of inertia.\n   * With value of zero, the camera will have no inertia.\n   * @type {number}\n   * @default 0.9\n   */\n  this.inertiaSpin = 0.9;\n  /**\n   * A parameter in the range <code>[0, 1)</code> used to determine how long\n   * the camera will continue to translate because of inertia.\n   * With value of zero, the camera will have no inertia.\n   * @type {number}\n   * @default 0.9\n   */\n  this.inertiaTranslate = 0.9;\n  /**\n   * A parameter in the range <code>[0, 1)</code> used to determine how long\n   * the camera will continue to zoom because of inertia.\n   * With value of zero, the camera will have no inertia.\n   * @type {number}\n   * @default 0.8\n   */\n  this.inertiaZoom = 0.8;\n  /**\n   * A parameter in the range <code>[0, 1)</code> used to limit the range\n   * of various user inputs to a percentage of the window width/height per animation frame.\n   * This helps keep the camera under control in low-frame-rate situations.\n   * @type {number}\n   * @default 0.1\n   */\n  this.maximumMovementRatio = 0.1;\n  /**\n   * Sets the duration, in seconds, of the bounce back animations in 2D and Columbus view.\n   * @type {number}\n   * @default 3.0\n   */\n  this.bounceAnimationTime = 3.0;\n  /**\n   * The minimum magnitude, in meters, of the camera position when zooming. Defaults to 1.0.\n   * @type {number}\n   * @default 1.0\n   */\n  this.minimumZoomDistance = 1.0;\n  /**\n   * The maximum magnitude, in meters, of the camera position when zooming. Defaults to positive infinity.\n   * @type {number}\n   * @default {@link Number.POSITIVE_INFINITY}\n   */\n  this.maximumZoomDistance = Number.POSITIVE_INFINITY;\n  /**\n   * The input that allows the user to pan around the map. This only applies in 2D and Columbus view modes.\n   * <p>\n   * The type can be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>\n   * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},\n   * or an array of any of the preceding.\n   * </p>\n   * @type {CameraEventType|Array|undefined}\n   * @default {@link CameraEventType.LEFT_DRAG}\n   */\n  this.translateEventTypes = CameraEventType.LEFT_DRAG;\n  /**\n   * The input that allows the user to zoom in/out.\n   * <p>\n   * The type can be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>\n   * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},\n   * or an array of any of the preceding.\n   * </p>\n   * @type {CameraEventType|Array|undefined}\n   * @default [{@link CameraEventType.RIGHT_DRAG}, {@link CameraEventType.WHEEL}, {@link CameraEventType.PINCH}]\n   */\n  this.zoomEventTypes = [\n    CameraEventType.RIGHT_DRAG,\n    CameraEventType.WHEEL,\n    CameraEventType.PINCH,\n  ];\n  /**\n   * The input that allows the user to rotate around the globe or another object. This only applies in 3D and Columbus view modes.\n   * <p>\n   * The type can be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>\n   * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},\n   * or an array of any of the preceding.\n   * </p>\n   * @type {CameraEventType|Array|undefined}\n   * @default {@link CameraEventType.LEFT_DRAG}\n   */\n  this.rotateEventTypes = CameraEventType.LEFT_DRAG;\n  /**\n   * The input that allows the user to tilt in 3D and Columbus view or twist in 2D.\n   * <p>\n   * The type can be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>\n   * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},\n   * or an array of any of the preceding.\n   * </p>\n   * @type {CameraEventType|Array|undefined}\n   * @default [{@link CameraEventType.MIDDLE_DRAG}, {@link CameraEventType.PINCH}, {\n   *     eventType : {@link CameraEventType.LEFT_DRAG},\n   *     modifier : {@link KeyboardEventModifier.CTRL}\n   * }, {\n   *     eventType : {@link CameraEventType.RIGHT_DRAG},\n   *     modifier : {@link KeyboardEventModifier.CTRL}\n   * }]\n   */\n  this.tiltEventTypes = [\n    CameraEventType.MIDDLE_DRAG,\n    CameraEventType.PINCH,\n    {\n      eventType: CameraEventType.LEFT_DRAG,\n      modifier: KeyboardEventModifier.CTRL,\n    },\n    {\n      eventType: CameraEventType.RIGHT_DRAG,\n      modifier: KeyboardEventModifier.CTRL,\n    },\n  ];\n  /**\n   * The input that allows the user to change the direction the camera is viewing. This only applies in 3D and Columbus view modes.\n   * <p>\n   * The type can be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>\n   * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},\n   * or an array of any of the preceding.\n   * </p>\n   * @type {CameraEventType|Array|undefined}\n   * @default { eventType : {@link CameraEventType.LEFT_DRAG}, modifier : {@link KeyboardEventModifier.SHIFT} }\n   */\n  this.lookEventTypes = {\n    eventType: CameraEventType.LEFT_DRAG,\n    modifier: KeyboardEventModifier.SHIFT,\n  };\n  /**\n   * The minimum height the camera must be before picking the terrain or scene content instead of the ellipsoid.\n   * @type {number}\n   * @default 150000.0\n   */\n  this.minimumPickingTerrainHeight = 150000.0;\n  this._minimumPickingTerrainHeight = this.minimumPickingTerrainHeight;\n  /**\n   * The minimum distance the camera must be before testing for collision with terrain when zoom with inertia.\n   * @type {number}\n   * @default 4000.0\n   */\n  this.minimumPickingTerrainDistanceWithInertia = 4000.0;\n  /**\n   * The minimum height the camera must be before testing for collision with terrain.\n   * @type {number}\n   * @default 15000.0\n   */\n  this.minimumCollisionTerrainHeight = 15000.0;\n  this._minimumCollisionTerrainHeight = this.minimumCollisionTerrainHeight;\n  /**\n   * The minimum height the camera must be before switching from rotating a track ball to\n   * free look when clicks originate on the sky or in space.\n   * @type {number}\n   * @default 7500000.0\n   */\n  this.minimumTrackBallHeight = 7500000.0;\n  this._minimumTrackBallHeight = this.minimumTrackBallHeight;\n  /**\n   * When disabled, the values of <code>maximumZoomDistance</code> and <code>minimumZoomDistance</code> are ignored.\n   * @type {boolean}\n   * @default true\n   */\n  this.enableCollisionDetection = true;\n\n  this._scene = scene;\n  this._globe = undefined;\n  this._ellipsoid = undefined;\n\n  this._aggregator = new CameraEventAggregator(scene.canvas);\n\n  this._lastInertiaSpinMovement = undefined;\n  this._lastInertiaZoomMovement = undefined;\n  this._lastInertiaTranslateMovement = undefined;\n  this._lastInertiaTiltMovement = undefined;\n\n  // Zoom disables tilt, spin, and translate inertia\n  // Tilt disables spin and translate inertia\n  this._inertiaDisablers = {\n    _lastInertiaZoomMovement: [\n      \"_lastInertiaSpinMovement\",\n      \"_lastInertiaTranslateMovement\",\n      \"_lastInertiaTiltMovement\",\n    ],\n    _lastInertiaTiltMovement: [\n      \"_lastInertiaSpinMovement\",\n      \"_lastInertiaTranslateMovement\",\n    ],\n  };\n\n  this._tweens = new TweenCollection();\n  this._tween = undefined;\n\n  this._horizontalRotationAxis = undefined;\n\n  this._tiltCenterMousePosition = new Cartesian2(-1.0, -1.0);\n  this._tiltCenter = new Cartesian3();\n  this._rotateMousePosition = new Cartesian2(-1.0, -1.0);\n  this._rotateStartPosition = new Cartesian3();\n  this._strafeStartPosition = new Cartesian3();\n  this._strafeMousePosition = new Cartesian2();\n  this._strafeEndMousePosition = new Cartesian2();\n  this._zoomMouseStart = new Cartesian2(-1.0, -1.0);\n  this._zoomWorldPosition = new Cartesian3();\n  this._useZoomWorldPosition = false;\n  this._panLastMousePosition = new Cartesian2();\n  this._panLastWorldPosition = new Cartesian3();\n  this._tiltCVOffMap = false;\n  this._looking = false;\n  this._rotating = false;\n  this._strafing = false;\n  this._zoomingOnVector = false;\n  this._zoomingUnderground = false;\n  this._rotatingZoom = false;\n  this._adjustedHeightForTerrain = false;\n  this._cameraUnderground = false;\n\n  const projection = scene.mapProjection;\n  this._maxCoord = projection.project(\n    new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO)\n  );\n\n  // Constants, Make any of these public?\n  this._zoomFactor = 5.0;\n  this._rotateFactor = undefined;\n  this._rotateRateRangeAdjustment = undefined;\n  this._maximumRotateRate = 1.77;\n  this._minimumRotateRate = 1.0 / 5000.0;\n  this._minimumZoomRate = 20.0;\n  this._maximumZoomRate = 5906376272000.0; // distance from the Sun to Pluto in meters.\n  this._minimumUndergroundPickDistance = 2000.0;\n  this._maximumUndergroundPickDistance = 10000.0;\n}\n\nfunction decay(time, coefficient) {\n  if (time < 0) {\n    return 0.0;\n  }\n\n  const tau = (1.0 - coefficient) * 25.0;\n  return Math.exp(-tau * time);\n}\n\nfunction sameMousePosition(movement) {\n  return Cartesian2.equalsEpsilon(\n    movement.startPosition,\n    movement.endPosition,\n    CesiumMath.EPSILON14\n  );\n}\n\n// If the time between mouse down and mouse up is not between\n// these thresholds, the camera will not move with inertia.\n// This value is probably dependent on the browser and/or the\n// hardware. Should be investigated further.\nconst inertiaMaxClickTimeThreshold = 0.4;\n\nfunction maintainInertia(\n  aggregator,\n  type,\n  modifier,\n  decayCoef,\n  action,\n  object,\n  lastMovementName\n) {\n  let movementState = object[lastMovementName];\n  if (!defined(movementState)) {\n    movementState = object[lastMovementName] = {\n      startPosition: new Cartesian2(),\n      endPosition: new Cartesian2(),\n      motion: new Cartesian2(),\n      inertiaEnabled: true,\n    };\n  }\n\n  const ts = aggregator.getButtonPressTime(type, modifier);\n  const tr = aggregator.getButtonReleaseTime(type, modifier);\n\n  const threshold = ts && tr && (tr.getTime() - ts.getTime()) / 1000.0;\n  const now = new Date();\n  const fromNow = tr && (now.getTime() - tr.getTime()) / 1000.0;\n\n  if (ts && tr && threshold < inertiaMaxClickTimeThreshold) {\n    const d = decay(fromNow, decayCoef);\n\n    const lastMovement = aggregator.getLastMovement(type, modifier);\n    if (\n      !defined(lastMovement) ||\n      sameMousePosition(lastMovement) ||\n      !movementState.inertiaEnabled\n    ) {\n      return;\n    }\n\n    movementState.motion.x =\n      (lastMovement.endPosition.x - lastMovement.startPosition.x) * 0.5;\n    movementState.motion.y =\n      (lastMovement.endPosition.y - lastMovement.startPosition.y) * 0.5;\n\n    movementState.startPosition = Cartesian2.clone(\n      lastMovement.startPosition,\n      movementState.startPosition\n    );\n\n    movementState.endPosition = Cartesian2.multiplyByScalar(\n      movementState.motion,\n      d,\n      movementState.endPosition\n    );\n    movementState.endPosition = Cartesian2.add(\n      movementState.startPosition,\n      movementState.endPosition,\n      movementState.endPosition\n    );\n\n    // If value from the decreasing exponential function is close to zero,\n    // the end coordinates may be NaN.\n    if (\n      isNaN(movementState.endPosition.x) ||\n      isNaN(movementState.endPosition.y) ||\n      Cartesian2.distance(\n        movementState.startPosition,\n        movementState.endPosition\n      ) < 0.5\n    ) {\n      return;\n    }\n\n    if (!aggregator.isButtonDown(type, modifier)) {\n      const startPosition = aggregator.getStartMousePosition(type, modifier);\n      action(object, startPosition, movementState);\n    }\n  }\n}\n\nfunction activateInertia(controller, inertiaStateName) {\n  if (defined(inertiaStateName)) {\n    // Re-enable inertia if it was disabled\n    let movementState = controller[inertiaStateName];\n    if (defined(movementState)) {\n      movementState.inertiaEnabled = true;\n    }\n    // Disable inertia on other movements\n    const inertiasToDisable = controller._inertiaDisablers[inertiaStateName];\n    if (defined(inertiasToDisable)) {\n      const length = inertiasToDisable.length;\n      for (let i = 0; i < length; ++i) {\n        movementState = controller[inertiasToDisable[i]];\n        if (defined(movementState)) {\n          movementState.inertiaEnabled = false;\n        }\n      }\n    }\n  }\n}\n\nconst scratchEventTypeArray = [];\n\nfunction reactToInput(\n  controller,\n  enabled,\n  eventTypes,\n  action,\n  inertiaConstant,\n  inertiaStateName\n) {\n  if (!defined(eventTypes)) {\n    return;\n  }\n\n  const aggregator = controller._aggregator;\n\n  if (!Array.isArray(eventTypes)) {\n    scratchEventTypeArray[0] = eventTypes;\n    eventTypes = scratchEventTypeArray;\n  }\n\n  const length = eventTypes.length;\n  for (let i = 0; i < length; ++i) {\n    const eventType = eventTypes[i];\n    const type = defined(eventType.eventType) ? eventType.eventType : eventType;\n    const modifier = eventType.modifier;\n\n    const movement =\n      aggregator.isMoving(type, modifier) &&\n      aggregator.getMovement(type, modifier);\n    const startPosition = aggregator.getStartMousePosition(type, modifier);\n\n    if (controller.enableInputs && enabled) {\n      if (movement) {\n        action(controller, startPosition, movement);\n        activateInertia(controller, inertiaStateName);\n      } else if (inertiaConstant < 1.0) {\n        maintainInertia(\n          aggregator,\n          type,\n          modifier,\n          inertiaConstant,\n          action,\n          controller,\n          inertiaStateName\n        );\n      }\n    }\n  }\n}\n\nconst scratchZoomPickRay = new Ray();\nconst scratchPickCartesian = new Cartesian3();\nconst scratchZoomOffset = new Cartesian2();\nconst scratchZoomDirection = new Cartesian3();\nconst scratchCenterPixel = new Cartesian2();\nconst scratchCenterPosition = new Cartesian3();\nconst scratchPositionNormal = new Cartesian3();\nconst scratchPickNormal = new Cartesian3();\nconst scratchZoomAxis = new Cartesian3();\nconst scratchCameraPositionNormal = new Cartesian3();\n\n// Scratch variables used in zooming algorithm\nconst scratchTargetNormal = new Cartesian3();\nconst scratchCameraPosition = new Cartesian3();\nconst scratchCameraUpNormal = new Cartesian3();\nconst scratchCameraRightNormal = new Cartesian3();\nconst scratchForwardNormal = new Cartesian3();\nconst scratchPositionToTarget = new Cartesian3();\nconst scratchPositionToTargetNormal = new Cartesian3();\nconst scratchPan = new Cartesian3();\nconst scratchCenterMovement = new Cartesian3();\nconst scratchCenter = new Cartesian3();\nconst scratchCartesian = new Cartesian3();\nconst scratchCartesianTwo = new Cartesian3();\nconst scratchCartesianThree = new Cartesian3();\nconst scratchZoomViewOptions = {\n  orientation: new HeadingPitchRoll(),\n};\n\nfunction handleZoom(\n  object,\n  startPosition,\n  movement,\n  zoomFactor,\n  distanceMeasure,\n  unitPositionDotDirection\n) {\n  let percentage = 1.0;\n  if (defined(unitPositionDotDirection)) {\n    percentage = CesiumMath.clamp(\n      Math.abs(unitPositionDotDirection),\n      0.25,\n      1.0\n    );\n  }\n\n  const diff = movement.endPosition.y - movement.startPosition.y;\n\n  // distanceMeasure should be the height above the ellipsoid.\n  // When approaching the surface, the zoomRate slows and stops minimumZoomDistance above it.\n  const approachingSurface = diff > 0;\n  const minHeight = approachingSurface\n    ? object.minimumZoomDistance * percentage\n    : 0;\n  const maxHeight = object.maximumZoomDistance;\n\n  const minDistance = distanceMeasure - minHeight;\n  let zoomRate = zoomFactor * minDistance;\n  zoomRate = CesiumMath.clamp(\n    zoomRate,\n    object._minimumZoomRate,\n    object._maximumZoomRate\n  );\n\n  let rangeWindowRatio = diff / object._scene.canvas.clientHeight;\n  rangeWindowRatio = Math.min(rangeWindowRatio, object.maximumMovementRatio);\n  let distance = zoomRate * rangeWindowRatio;\n\n  if (\n    object.enableCollisionDetection ||\n    object.minimumZoomDistance === 0.0 ||\n    !defined(object._globe) // look-at mode\n  ) {\n    if (distance > 0.0 && Math.abs(distanceMeasure - minHeight) < 1.0) {\n      return;\n    }\n\n    if (distance < 0.0 && Math.abs(distanceMeasure - maxHeight) < 1.0) {\n      return;\n    }\n\n    if (distanceMeasure - distance < minHeight) {\n      distance = distanceMeasure - minHeight - 1.0;\n    } else if (distanceMeasure - distance > maxHeight) {\n      distance = distanceMeasure - maxHeight;\n    }\n  }\n\n  const scene = object._scene;\n  const camera = scene.camera;\n  const mode = scene.mode;\n\n  const orientation = scratchZoomViewOptions.orientation;\n  orientation.heading = camera.heading;\n  orientation.pitch = camera.pitch;\n  orientation.roll = camera.roll;\n\n  if (camera.frustum instanceof OrthographicFrustum) {\n    if (Math.abs(distance) > 0.0) {\n      camera.zoomIn(distance);\n      camera._adjustOrthographicFrustum(true);\n    }\n    return;\n  }\n\n  const sameStartPosition = defaultValue(\n    movement.inertiaEnabled,\n    Cartesian2.equals(startPosition, object._zoomMouseStart)\n  );\n  let zoomingOnVector = object._zoomingOnVector;\n  let rotatingZoom = object._rotatingZoom;\n  let pickedPosition;\n\n  if (!sameStartPosition) {\n    object._zoomMouseStart = Cartesian2.clone(\n      startPosition,\n      object._zoomMouseStart\n    );\n\n    // When camera transform is set, such as tracking an entity, object._globe will be undefined, and no position should be picked\n    if (defined(object._globe) && mode === SceneMode.SCENE2D) {\n      pickedPosition = camera.getPickRay(startPosition, scratchZoomPickRay)\n        .origin;\n      pickedPosition = Cartesian3.fromElements(\n        pickedPosition.y,\n        pickedPosition.z,\n        pickedPosition.x\n      );\n    } else if (defined(object._globe)) {\n      pickedPosition = pickPosition(\n        object,\n        startPosition,\n        scratchPickCartesian\n      );\n    }\n\n    if (defined(pickedPosition)) {\n      object._useZoomWorldPosition = true;\n      object._zoomWorldPosition = Cartesian3.clone(\n        pickedPosition,\n        object._zoomWorldPosition\n      );\n    } else {\n      object._useZoomWorldPosition = false;\n    }\n\n    zoomingOnVector = object._zoomingOnVector = false;\n    rotatingZoom = object._rotatingZoom = false;\n    object._zoomingUnderground = object._cameraUnderground;\n  }\n\n  if (!object._useZoomWorldPosition) {\n    camera.zoomIn(distance);\n    return;\n  }\n\n  let zoomOnVector = mode === SceneMode.COLUMBUS_VIEW;\n\n  if (camera.positionCartographic.height < 2000000) {\n    rotatingZoom = true;\n  }\n\n  if (!sameStartPosition || rotatingZoom) {\n    if (mode === SceneMode.SCENE2D) {\n      const worldPosition = object._zoomWorldPosition;\n      const endPosition = camera.position;\n\n      if (\n        !Cartesian3.equals(worldPosition, endPosition) &&\n        camera.positionCartographic.height < object._maxCoord.x * 2.0\n      ) {\n        const savedX = camera.position.x;\n\n        const direction = Cartesian3.subtract(\n          worldPosition,\n          endPosition,\n          scratchZoomDirection\n        );\n        Cartesian3.normalize(direction, direction);\n\n        const d =\n          (Cartesian3.distance(worldPosition, endPosition) * distance) /\n          (camera.getMagnitude() * 0.5);\n        camera.move(direction, d * 0.5);\n\n        if (\n          (camera.position.x < 0.0 && savedX > 0.0) ||\n          (camera.position.x > 0.0 && savedX < 0.0)\n        ) {\n          pickedPosition = camera.getPickRay(startPosition, scratchZoomPickRay)\n            .origin;\n          pickedPosition = Cartesian3.fromElements(\n            pickedPosition.y,\n            pickedPosition.z,\n            pickedPosition.x\n          );\n          object._zoomWorldPosition = Cartesian3.clone(\n            pickedPosition,\n            object._zoomWorldPosition\n          );\n        }\n      }\n    } else if (mode === SceneMode.SCENE3D) {\n      const cameraPositionNormal = Cartesian3.normalize(\n        camera.position,\n        scratchCameraPositionNormal\n      );\n      if (\n        object._cameraUnderground ||\n        object._zoomingUnderground ||\n        (camera.positionCartographic.height < 3000.0 &&\n          Math.abs(Cartesian3.dot(camera.direction, cameraPositionNormal)) <\n            0.6)\n      ) {\n        zoomOnVector = true;\n      } else {\n        const canvas = scene.canvas;\n\n        const centerPixel = scratchCenterPixel;\n        centerPixel.x = canvas.clientWidth / 2;\n        centerPixel.y = canvas.clientHeight / 2;\n        const centerPosition = pickPosition(\n          object,\n          centerPixel,\n          scratchCenterPosition\n        );\n        // If centerPosition is not defined, it means the globe does not cover the center position of screen\n\n        if (!defined(centerPosition)) {\n          zoomOnVector = true;\n        } else if (camera.positionCartographic.height < 1000000) {\n          // The math in the else block assumes the camera\n          // points toward the earth surface, so we check it here.\n          // Theoretically, we should check for 90 degree, but it doesn't behave well when parallel\n          // to the earth surface\n          if (Cartesian3.dot(camera.direction, cameraPositionNormal) >= -0.5) {\n            zoomOnVector = true;\n          } else {\n            const cameraPosition = scratchCameraPosition;\n            Cartesian3.clone(camera.position, cameraPosition);\n            const target = object._zoomWorldPosition;\n\n            let targetNormal = scratchTargetNormal;\n\n            targetNormal = Cartesian3.normalize(target, targetNormal);\n\n            if (Cartesian3.dot(targetNormal, cameraPositionNormal) < 0.0) {\n              return;\n            }\n\n            const center = scratchCenter;\n            const forward = scratchForwardNormal;\n            Cartesian3.clone(camera.direction, forward);\n            Cartesian3.add(\n              cameraPosition,\n              Cartesian3.multiplyByScalar(forward, 1000, scratchCartesian),\n              center\n            );\n\n            const positionToTarget = scratchPositionToTarget;\n            const positionToTargetNormal = scratchPositionToTargetNormal;\n            Cartesian3.subtract(target, cameraPosition, positionToTarget);\n\n            Cartesian3.normalize(positionToTarget, positionToTargetNormal);\n\n            const alphaDot = Cartesian3.dot(\n              cameraPositionNormal,\n              positionToTargetNormal\n            );\n            if (alphaDot >= 0.0) {\n              // We zoomed past the target, and this zoom is not valid anymore.\n              // This line causes the next zoom movement to pick a new starting point.\n              object._zoomMouseStart.x = -1;\n              return;\n            }\n            const alpha = Math.acos(-alphaDot);\n            const cameraDistance = Cartesian3.magnitude(cameraPosition);\n            const targetDistance = Cartesian3.magnitude(target);\n            const remainingDistance = cameraDistance - distance;\n            const positionToTargetDistance = Cartesian3.magnitude(\n              positionToTarget\n            );\n\n            const gamma = Math.asin(\n              CesiumMath.clamp(\n                (positionToTargetDistance / targetDistance) * Math.sin(alpha),\n                -1.0,\n                1.0\n              )\n            );\n            const delta = Math.asin(\n              CesiumMath.clamp(\n                (remainingDistance / targetDistance) * Math.sin(alpha),\n                -1.0,\n                1.0\n              )\n            );\n            const beta = gamma - delta + alpha;\n\n            const up = scratchCameraUpNormal;\n            Cartesian3.normalize(cameraPosition, up);\n            let right = scratchCameraRightNormal;\n            right = Cartesian3.cross(positionToTargetNormal, up, right);\n            right = Cartesian3.normalize(right, right);\n\n            Cartesian3.normalize(\n              Cartesian3.cross(up, right, scratchCartesian),\n              forward\n            );\n\n            // Calculate new position to move to\n            Cartesian3.multiplyByScalar(\n              Cartesian3.normalize(center, scratchCartesian),\n              Cartesian3.magnitude(center) - distance,\n              center\n            );\n            Cartesian3.normalize(cameraPosition, cameraPosition);\n            Cartesian3.multiplyByScalar(\n              cameraPosition,\n              remainingDistance,\n              cameraPosition\n            );\n\n            // Pan\n            const pMid = scratchPan;\n            Cartesian3.multiplyByScalar(\n              Cartesian3.add(\n                Cartesian3.multiplyByScalar(\n                  up,\n                  Math.cos(beta) - 1,\n                  scratchCartesianTwo\n                ),\n                Cartesian3.multiplyByScalar(\n                  forward,\n                  Math.sin(beta),\n                  scratchCartesianThree\n                ),\n                scratchCartesian\n              ),\n              remainingDistance,\n              pMid\n            );\n            Cartesian3.add(cameraPosition, pMid, cameraPosition);\n\n            Cartesian3.normalize(center, up);\n            Cartesian3.normalize(\n              Cartesian3.cross(up, right, scratchCartesian),\n              forward\n            );\n\n            const cMid = scratchCenterMovement;\n            Cartesian3.multiplyByScalar(\n              Cartesian3.add(\n                Cartesian3.multiplyByScalar(\n                  up,\n                  Math.cos(beta) - 1,\n                  scratchCartesianTwo\n                ),\n                Cartesian3.multiplyByScalar(\n                  forward,\n                  Math.sin(beta),\n                  scratchCartesianThree\n                ),\n                scratchCartesian\n              ),\n              Cartesian3.magnitude(center),\n              cMid\n            );\n            Cartesian3.add(center, cMid, center);\n\n            // Update camera\n\n            // Set new position\n            Cartesian3.clone(cameraPosition, camera.position);\n\n            // Set new direction\n            Cartesian3.normalize(\n              Cartesian3.subtract(center, cameraPosition, scratchCartesian),\n              camera.direction\n            );\n            Cartesian3.clone(camera.direction, camera.direction);\n\n            // Set new right & up vectors\n            Cartesian3.cross(camera.direction, camera.up, camera.right);\n            Cartesian3.cross(camera.right, camera.direction, camera.up);\n\n            camera.setView(scratchZoomViewOptions);\n            return;\n          }\n        } else {\n          const positionNormal = Cartesian3.normalize(\n            centerPosition,\n            scratchPositionNormal\n          );\n          const pickedNormal = Cartesian3.normalize(\n            object._zoomWorldPosition,\n            scratchPickNormal\n          );\n          const dotProduct = Cartesian3.dot(pickedNormal, positionNormal);\n\n          if (dotProduct > 0.0 && dotProduct < 1.0) {\n            const angle = CesiumMath.acosClamped(dotProduct);\n            const axis = Cartesian3.cross(\n              pickedNormal,\n              positionNormal,\n              scratchZoomAxis\n            );\n\n            const denom =\n              Math.abs(angle) > CesiumMath.toRadians(20.0)\n                ? camera.positionCartographic.height * 0.75\n                : camera.positionCartographic.height - distance;\n            const scalar = distance / denom;\n            camera.rotate(axis, angle * scalar);\n          }\n        }\n      }\n    }\n\n    object._rotatingZoom = !zoomOnVector;\n  }\n\n  if ((!sameStartPosition && zoomOnVector) || zoomingOnVector) {\n    let ray;\n    const zoomMouseStart = SceneTransforms.wgs84ToWindowCoordinates(\n      scene,\n      object._zoomWorldPosition,\n      scratchZoomOffset\n    );\n    if (\n      mode !== SceneMode.COLUMBUS_VIEW &&\n      Cartesian2.equals(startPosition, object._zoomMouseStart) &&\n      defined(zoomMouseStart)\n    ) {\n      ray = camera.getPickRay(zoomMouseStart, scratchZoomPickRay);\n    } else {\n      ray = camera.getPickRay(startPosition, scratchZoomPickRay);\n    }\n\n    const rayDirection = ray.direction;\n    if (mode === SceneMode.COLUMBUS_VIEW || mode === SceneMode.SCENE2D) {\n      Cartesian3.fromElements(\n        rayDirection.y,\n        rayDirection.z,\n        rayDirection.x,\n        rayDirection\n      );\n    }\n\n    camera.move(rayDirection, distance);\n\n    object._zoomingOnVector = true;\n  } else {\n    camera.zoomIn(distance);\n  }\n\n  if (!object._cameraUnderground) {\n    camera.setView(scratchZoomViewOptions);\n  }\n}\n\nconst translate2DStart = new Ray();\nconst translate2DEnd = new Ray();\nconst scratchTranslateP0 = new Cartesian3();\n\nfunction translate2D(controller, startPosition, movement) {\n  const scene = controller._scene;\n  const camera = scene.camera;\n  let start = camera.getPickRay(movement.startPosition, translate2DStart)\n    .origin;\n  let end = camera.getPickRay(movement.endPosition, translate2DEnd).origin;\n\n  start = Cartesian3.fromElements(start.y, start.z, start.x, start);\n  end = Cartesian3.fromElements(end.y, end.z, end.x, end);\n\n  const direction = Cartesian3.subtract(start, end, scratchTranslateP0);\n  const distance = Cartesian3.magnitude(direction);\n\n  if (distance > 0.0) {\n    Cartesian3.normalize(direction, direction);\n    camera.move(direction, distance);\n  }\n}\n\nfunction zoom2D(controller, startPosition, movement) {\n  if (defined(movement.distance)) {\n    movement = movement.distance;\n  }\n\n  const scene = controller._scene;\n  const camera = scene.camera;\n\n  handleZoom(\n    controller,\n    startPosition,\n    movement,\n    controller._zoomFactor,\n    camera.getMagnitude()\n  );\n}\n\nconst twist2DStart = new Cartesian2();\nconst twist2DEnd = new Cartesian2();\n\nfunction twist2D(controller, startPosition, movement) {\n  if (defined(movement.angleAndHeight)) {\n    singleAxisTwist2D(controller, startPosition, movement.angleAndHeight);\n    return;\n  }\n\n  const scene = controller._scene;\n  const camera = scene.camera;\n  const canvas = scene.canvas;\n  const width = canvas.clientWidth;\n  const height = canvas.clientHeight;\n\n  let start = twist2DStart;\n  start.x = (2.0 / width) * movement.startPosition.x - 1.0;\n  start.y = (2.0 / height) * (height - movement.startPosition.y) - 1.0;\n  start = Cartesian2.normalize(start, start);\n\n  let end = twist2DEnd;\n  end.x = (2.0 / width) * movement.endPosition.x - 1.0;\n  end.y = (2.0 / height) * (height - movement.endPosition.y) - 1.0;\n  end = Cartesian2.normalize(end, end);\n\n  let startTheta = CesiumMath.acosClamped(start.x);\n  if (start.y < 0) {\n    startTheta = CesiumMath.TWO_PI - startTheta;\n  }\n  let endTheta = CesiumMath.acosClamped(end.x);\n  if (end.y < 0) {\n    endTheta = CesiumMath.TWO_PI - endTheta;\n  }\n  const theta = endTheta - startTheta;\n\n  camera.twistRight(theta);\n}\n\nfunction singleAxisTwist2D(controller, startPosition, movement) {\n  let rotateRate =\n    controller._rotateFactor * controller._rotateRateRangeAdjustment;\n\n  if (rotateRate > controller._maximumRotateRate) {\n    rotateRate = controller._maximumRotateRate;\n  }\n\n  if (rotateRate < controller._minimumRotateRate) {\n    rotateRate = controller._minimumRotateRate;\n  }\n\n  const scene = controller._scene;\n  const camera = scene.camera;\n  const canvas = scene.canvas;\n\n  let phiWindowRatio =\n    (movement.endPosition.x - movement.startPosition.x) / canvas.clientWidth;\n  phiWindowRatio = Math.min(phiWindowRatio, controller.maximumMovementRatio);\n\n  const deltaPhi = rotateRate * phiWindowRatio * Math.PI * 4.0;\n\n  camera.twistRight(deltaPhi);\n}\n\nfunction update2D(controller) {\n  const rotatable2D = controller._scene.mapMode2D === MapMode2D.ROTATE;\n  if (!Matrix4.equals(Matrix4.IDENTITY, controller._scene.camera.transform)) {\n    reactToInput(\n      controller,\n      controller.enableZoom,\n      controller.zoomEventTypes,\n      zoom2D,\n      controller.inertiaZoom,\n      \"_lastInertiaZoomMovement\"\n    );\n    if (rotatable2D) {\n      reactToInput(\n        controller,\n        controller.enableRotate,\n        controller.translateEventTypes,\n        twist2D,\n        controller.inertiaSpin,\n        \"_lastInertiaSpinMovement\"\n      );\n    }\n  } else {\n    reactToInput(\n      controller,\n      controller.enableTranslate,\n      controller.translateEventTypes,\n      translate2D,\n      controller.inertiaTranslate,\n      \"_lastInertiaTranslateMovement\"\n    );\n    reactToInput(\n      controller,\n      controller.enableZoom,\n      controller.zoomEventTypes,\n      zoom2D,\n      controller.inertiaZoom,\n      \"_lastInertiaZoomMovement\"\n    );\n    if (rotatable2D) {\n      reactToInput(\n        controller,\n        controller.enableRotate,\n        controller.tiltEventTypes,\n        twist2D,\n        controller.inertiaSpin,\n        \"_lastInertiaTiltMovement\"\n      );\n    }\n  }\n}\n\nconst pickGlobeScratchRay = new Ray();\nconst scratchDepthIntersection = new Cartesian3();\nconst scratchRayIntersection = new Cartesian3();\n\nfunction pickPosition(controller, mousePosition, result) {\n  const scene = controller._scene;\n  const globe = controller._globe;\n  const camera = scene.camera;\n\n  let depthIntersection;\n  if (scene.pickPositionSupported) {\n    depthIntersection = scene.pickPositionWorldCoordinates(\n      mousePosition,\n      scratchDepthIntersection\n    );\n  }\n\n  if (!defined(globe)) {\n    return Cartesian3.clone(depthIntersection, result);\n  }\n\n  const cullBackFaces = !controller._cameraUnderground;\n  const ray = camera.getPickRay(mousePosition, pickGlobeScratchRay);\n  const rayIntersection = globe.pickWorldCoordinates(\n    ray,\n    scene,\n    cullBackFaces,\n    scratchRayIntersection\n  );\n\n  const pickDistance = defined(depthIntersection)\n    ? Cartesian3.distance(depthIntersection, camera.positionWC)\n    : Number.POSITIVE_INFINITY;\n  const rayDistance = defined(rayIntersection)\n    ? Cartesian3.distance(rayIntersection, camera.positionWC)\n    : Number.POSITIVE_INFINITY;\n\n  if (pickDistance < rayDistance) {\n    return Cartesian3.clone(depthIntersection, result);\n  }\n\n  return Cartesian3.clone(rayIntersection, result);\n}\n\nconst scratchDistanceCartographic = new Cartographic();\n\nfunction getDistanceFromSurface(controller) {\n  const ellipsoid = controller._ellipsoid;\n  const scene = controller._scene;\n  const camera = scene.camera;\n  const mode = scene.mode;\n\n  let height = 0.0;\n  if (mode === SceneMode.SCENE3D) {\n    const cartographic = ellipsoid.cartesianToCartographic(\n      camera.position,\n      scratchDistanceCartographic\n    );\n    if (defined(cartographic)) {\n      height = cartographic.height;\n    }\n  } else {\n    height = camera.position.z;\n  }\n  const globeHeight = defaultValue(controller._scene.globeHeight, 0.0);\n  const distanceFromSurface = Math.abs(globeHeight - height);\n  return distanceFromSurface;\n}\n\nconst scratchSurfaceNormal = new Cartesian3();\n\nfunction getZoomDistanceUnderground(controller, ray) {\n  const origin = ray.origin;\n  const direction = ray.direction;\n  const distanceFromSurface = getDistanceFromSurface(controller);\n\n  // Weight zoom distance based on how strongly the pick ray is pointing inward.\n  // Geocentric normal is accurate enough for these purposes\n  const surfaceNormal = Cartesian3.normalize(origin, scratchSurfaceNormal);\n  let strength = Math.abs(Cartesian3.dot(surfaceNormal, direction));\n  strength = Math.max(strength, 0.5) * 2.0;\n  return distanceFromSurface * strength;\n}\n\nfunction getTiltCenterUnderground(controller, ray, pickedPosition, result) {\n  let distance = Cartesian3.distance(ray.origin, pickedPosition);\n  const distanceFromSurface = getDistanceFromSurface(controller);\n\n  const maximumDistance = CesiumMath.clamp(\n    distanceFromSurface * 5.0,\n    controller._minimumUndergroundPickDistance,\n    controller._maximumUndergroundPickDistance\n  );\n\n  if (distance > maximumDistance) {\n    // Simulate look-at behavior by tilting around a small invisible sphere\n    distance = Math.min(distance, distanceFromSurface / 5.0);\n    distance = Math.max(distance, 100.0);\n  }\n\n  return Ray.getPoint(ray, distance, result);\n}\n\nfunction getStrafeStartPositionUnderground(\n  controller,\n  ray,\n  pickedPosition,\n  result\n) {\n  let distance;\n  if (!defined(pickedPosition)) {\n    distance = getDistanceFromSurface(controller);\n  } else {\n    distance = Cartesian3.distance(ray.origin, pickedPosition);\n    if (distance > controller._maximumUndergroundPickDistance) {\n      // If the picked position is too far away set the strafe speed based on the\n      // camera's height from the globe surface\n      distance = getDistanceFromSurface(controller);\n    }\n  }\n\n  return Ray.getPoint(ray, distance, result);\n}\n\nconst scratchInertialDelta = new Cartesian2();\n\nfunction continueStrafing(controller, movement) {\n  // Update the end position continually based on the inertial delta\n  const originalEndPosition = movement.endPosition;\n  const inertialDelta = Cartesian2.subtract(\n    movement.endPosition,\n    movement.startPosition,\n    scratchInertialDelta\n  );\n  const endPosition = controller._strafeEndMousePosition;\n  Cartesian2.add(endPosition, inertialDelta, endPosition);\n  movement.endPosition = endPosition;\n  strafe(controller, movement, controller._strafeStartPosition);\n  movement.endPosition = originalEndPosition;\n}\n\nconst translateCVStartRay = new Ray();\nconst translateCVEndRay = new Ray();\nconst translateCVStartPos = new Cartesian3();\nconst translateCVEndPos = new Cartesian3();\nconst translateCVDifference = new Cartesian3();\nconst translateCVOrigin = new Cartesian3();\nconst translateCVPlane = new Plane(Cartesian3.UNIT_X, 0.0);\nconst translateCVStartMouse = new Cartesian2();\nconst translateCVEndMouse = new Cartesian2();\n\nfunction translateCV(controller, startPosition, movement) {\n  if (!Cartesian3.equals(startPosition, controller._translateMousePosition)) {\n    controller._looking = false;\n  }\n\n  if (!Cartesian3.equals(startPosition, controller._strafeMousePosition)) {\n    controller._strafing = false;\n  }\n\n  if (controller._looking) {\n    look3D(controller, startPosition, movement);\n    return;\n  }\n\n  if (controller._strafing) {\n    continueStrafing(controller, movement);\n    return;\n  }\n\n  const scene = controller._scene;\n  const camera = scene.camera;\n  const cameraUnderground = controller._cameraUnderground;\n  const startMouse = Cartesian2.clone(\n    movement.startPosition,\n    translateCVStartMouse\n  );\n  const endMouse = Cartesian2.clone(movement.endPosition, translateCVEndMouse);\n  let startRay = camera.getPickRay(startMouse, translateCVStartRay);\n\n  const origin = Cartesian3.clone(Cartesian3.ZERO, translateCVOrigin);\n  const normal = Cartesian3.UNIT_X;\n\n  let globePos;\n  if (camera.position.z < controller._minimumPickingTerrainHeight) {\n    globePos = pickPosition(controller, startMouse, translateCVStartPos);\n\n    if (defined(globePos)) {\n      origin.x = globePos.x;\n    }\n  }\n\n  if (\n    cameraUnderground ||\n    (origin.x > camera.position.z && defined(globePos))\n  ) {\n    let pickPosition = globePos;\n    if (cameraUnderground) {\n      pickPosition = getStrafeStartPositionUnderground(\n        controller,\n        startRay,\n        globePos,\n        translateCVStartPos\n      );\n    }\n    Cartesian2.clone(startPosition, controller._strafeMousePosition);\n    Cartesian2.clone(startPosition, controller._strafeEndMousePosition);\n    Cartesian3.clone(pickPosition, controller._strafeStartPosition);\n    controller._strafing = true;\n    strafe(controller, movement, controller._strafeStartPosition);\n    return;\n  }\n\n  const plane = Plane.fromPointNormal(origin, normal, translateCVPlane);\n\n  startRay = camera.getPickRay(startMouse, translateCVStartRay);\n  const startPlanePos = IntersectionTests.rayPlane(\n    startRay,\n    plane,\n    translateCVStartPos\n  );\n\n  const endRay = camera.getPickRay(endMouse, translateCVEndRay);\n  const endPlanePos = IntersectionTests.rayPlane(\n    endRay,\n    plane,\n    translateCVEndPos\n  );\n\n  if (!defined(startPlanePos) || !defined(endPlanePos)) {\n    controller._looking = true;\n    look3D(controller, startPosition, movement);\n    Cartesian2.clone(startPosition, controller._translateMousePosition);\n    return;\n  }\n\n  const diff = Cartesian3.subtract(\n    startPlanePos,\n    endPlanePos,\n    translateCVDifference\n  );\n  const temp = diff.x;\n  diff.x = diff.y;\n  diff.y = diff.z;\n  diff.z = temp;\n  const mag = Cartesian3.magnitude(diff);\n  if (mag > CesiumMath.EPSILON6) {\n    Cartesian3.normalize(diff, diff);\n    camera.move(diff, mag);\n  }\n}\n\nconst rotateCVWindowPos = new Cartesian2();\nconst rotateCVWindowRay = new Ray();\nconst rotateCVCenter = new Cartesian3();\nconst rotateCVVerticalCenter = new Cartesian3();\nconst rotateCVTransform = new Matrix4();\nconst rotateCVVerticalTransform = new Matrix4();\nconst rotateCVOrigin = new Cartesian3();\nconst rotateCVPlane = new Plane(Cartesian3.UNIT_X, 0.0);\nconst rotateCVCartesian3 = new Cartesian3();\nconst rotateCVCart = new Cartographic();\nconst rotateCVOldTransform = new Matrix4();\nconst rotateCVQuaternion = new Quaternion();\nconst rotateCVMatrix = new Matrix3();\nconst tilt3DCartesian3 = new Cartesian3();\n\nfunction rotateCV(controller, startPosition, movement) {\n  if (defined(movement.angleAndHeight)) {\n    movement = movement.angleAndHeight;\n  }\n\n  if (!Cartesian2.equals(startPosition, controller._tiltCenterMousePosition)) {\n    controller._tiltCVOffMap = false;\n    controller._looking = false;\n  }\n\n  if (controller._looking) {\n    look3D(controller, startPosition, movement);\n    return;\n  }\n\n  const scene = controller._scene;\n  const camera = scene.camera;\n\n  if (\n    controller._tiltCVOffMap ||\n    !controller.onMap() ||\n    Math.abs(camera.position.z) > controller._minimumPickingTerrainHeight\n  ) {\n    controller._tiltCVOffMap = true;\n    rotateCVOnPlane(controller, startPosition, movement);\n  } else {\n    rotateCVOnTerrain(controller, startPosition, movement);\n  }\n}\n\nfunction rotateCVOnPlane(controller, startPosition, movement) {\n  const scene = controller._scene;\n  const camera = scene.camera;\n  const canvas = scene.canvas;\n\n  const windowPosition = rotateCVWindowPos;\n  windowPosition.x = canvas.clientWidth / 2;\n  windowPosition.y = canvas.clientHeight / 2;\n  const ray = camera.getPickRay(windowPosition, rotateCVWindowRay);\n  const normal = Cartesian3.UNIT_X;\n\n  const position = ray.origin;\n  const direction = ray.direction;\n  let scalar;\n  const normalDotDirection = Cartesian3.dot(normal, direction);\n  if (Math.abs(normalDotDirection) > CesiumMath.EPSILON6) {\n    scalar = -Cartesian3.dot(normal, position) / normalDotDirection;\n  }\n\n  if (!defined(scalar) || scalar <= 0.0) {\n    controller._looking = true;\n    look3D(controller, startPosition, movement);\n    Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);\n    return;\n  }\n\n  const center = Cartesian3.multiplyByScalar(direction, scalar, rotateCVCenter);\n  Cartesian3.add(position, center, center);\n\n  const projection = scene.mapProjection;\n  const ellipsoid = projection.ellipsoid;\n\n  Cartesian3.fromElements(center.y, center.z, center.x, center);\n  const cart = projection.unproject(center, rotateCVCart);\n  ellipsoid.cartographicToCartesian(cart, center);\n\n  const transform = Transforms.eastNorthUpToFixedFrame(\n    center,\n    ellipsoid,\n    rotateCVTransform\n  );\n\n  const oldGlobe = controller._globe;\n  const oldEllipsoid = controller._ellipsoid;\n  controller._globe = undefined;\n  controller._ellipsoid = Ellipsoid.UNIT_SPHERE;\n  controller._rotateFactor = 1.0;\n  controller._rotateRateRangeAdjustment = 1.0;\n\n  const oldTransform = Matrix4.clone(camera.transform, rotateCVOldTransform);\n  camera._setTransform(transform);\n\n  rotate3D(controller, startPosition, movement, Cartesian3.UNIT_Z);\n\n  camera._setTransform(oldTransform);\n  controller._globe = oldGlobe;\n  controller._ellipsoid = oldEllipsoid;\n\n  const radius = oldEllipsoid.maximumRadius;\n  controller._rotateFactor = 1.0 / radius;\n  controller._rotateRateRangeAdjustment = radius;\n}\n\nfunction rotateCVOnTerrain(controller, startPosition, movement) {\n  const scene = controller._scene;\n  const camera = scene.camera;\n  const cameraUnderground = controller._cameraUnderground;\n\n  let center;\n  let ray;\n  const normal = Cartesian3.UNIT_X;\n\n  if (Cartesian2.equals(startPosition, controller._tiltCenterMousePosition)) {\n    center = Cartesian3.clone(controller._tiltCenter, rotateCVCenter);\n  } else {\n    if (camera.position.z < controller._minimumPickingTerrainHeight) {\n      center = pickPosition(controller, startPosition, rotateCVCenter);\n    }\n\n    if (!defined(center)) {\n      ray = camera.getPickRay(startPosition, rotateCVWindowRay);\n      const position = ray.origin;\n      const direction = ray.direction;\n\n      let scalar;\n      const normalDotDirection = Cartesian3.dot(normal, direction);\n      if (Math.abs(normalDotDirection) > CesiumMath.EPSILON6) {\n        scalar = -Cartesian3.dot(normal, position) / normalDotDirection;\n      }\n\n      if (!defined(scalar) || scalar <= 0.0) {\n        controller._looking = true;\n        look3D(controller, startPosition, movement);\n        Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);\n        return;\n      }\n\n      center = Cartesian3.multiplyByScalar(direction, scalar, rotateCVCenter);\n      Cartesian3.add(position, center, center);\n    }\n\n    if (cameraUnderground) {\n      if (!defined(ray)) {\n        ray = camera.getPickRay(startPosition, rotateCVWindowRay);\n      }\n      getTiltCenterUnderground(controller, ray, center, center);\n    }\n\n    Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);\n    Cartesian3.clone(center, controller._tiltCenter);\n  }\n\n  const canvas = scene.canvas;\n\n  const windowPosition = rotateCVWindowPos;\n  windowPosition.x = canvas.clientWidth / 2;\n  windowPosition.y = controller._tiltCenterMousePosition.y;\n  ray = camera.getPickRay(windowPosition, rotateCVWindowRay);\n\n  const origin = Cartesian3.clone(Cartesian3.ZERO, rotateCVOrigin);\n  origin.x = center.x;\n\n  const plane = Plane.fromPointNormal(origin, normal, rotateCVPlane);\n  const verticalCenter = IntersectionTests.rayPlane(\n    ray,\n    plane,\n    rotateCVVerticalCenter\n  );\n\n  const projection = camera._projection;\n  const ellipsoid = projection.ellipsoid;\n\n  Cartesian3.fromElements(center.y, center.z, center.x, center);\n  let cart = projection.unproject(center, rotateCVCart);\n  ellipsoid.cartographicToCartesian(cart, center);\n\n  const transform = Transforms.eastNorthUpToFixedFrame(\n    center,\n    ellipsoid,\n    rotateCVTransform\n  );\n\n  let verticalTransform;\n  if (defined(verticalCenter)) {\n    Cartesian3.fromElements(\n      verticalCenter.y,\n      verticalCenter.z,\n      verticalCenter.x,\n      verticalCenter\n    );\n    cart = projection.unproject(verticalCenter, rotateCVCart);\n    ellipsoid.cartographicToCartesian(cart, verticalCenter);\n\n    verticalTransform = Transforms.eastNorthUpToFixedFrame(\n      verticalCenter,\n      ellipsoid,\n      rotateCVVerticalTransform\n    );\n  } else {\n    verticalTransform = transform;\n  }\n\n  const oldGlobe = controller._globe;\n  const oldEllipsoid = controller._ellipsoid;\n  controller._globe = undefined;\n  controller._ellipsoid = Ellipsoid.UNIT_SPHERE;\n  controller._rotateFactor = 1.0;\n  controller._rotateRateRangeAdjustment = 1.0;\n\n  let constrainedAxis = Cartesian3.UNIT_Z;\n\n  const oldTransform = Matrix4.clone(camera.transform, rotateCVOldTransform);\n  camera._setTransform(transform);\n\n  const tangent = Cartesian3.cross(\n    Cartesian3.UNIT_Z,\n    Cartesian3.normalize(camera.position, rotateCVCartesian3),\n    rotateCVCartesian3\n  );\n  const dot = Cartesian3.dot(camera.right, tangent);\n\n  rotate3D(controller, startPosition, movement, constrainedAxis, false, true);\n\n  camera._setTransform(verticalTransform);\n  if (dot < 0.0) {\n    const movementDelta = movement.startPosition.y - movement.endPosition.y;\n    if (\n      (cameraUnderground && movementDelta < 0.0) ||\n      (!cameraUnderground && movementDelta > 0.0)\n    ) {\n      // Prevent camera from flipping past the up axis\n      constrainedAxis = undefined;\n    }\n\n    const oldConstrainedAxis = camera.constrainedAxis;\n    camera.constrainedAxis = undefined;\n\n    rotate3D(controller, startPosition, movement, constrainedAxis, true, false);\n\n    camera.constrainedAxis = oldConstrainedAxis;\n  } else {\n    rotate3D(controller, startPosition, movement, constrainedAxis, true, false);\n  }\n\n  if (defined(camera.constrainedAxis)) {\n    const right = Cartesian3.cross(\n      camera.direction,\n      camera.constrainedAxis,\n      tilt3DCartesian3\n    );\n    if (\n      !Cartesian3.equalsEpsilon(right, Cartesian3.ZERO, CesiumMath.EPSILON6)\n    ) {\n      if (Cartesian3.dot(right, camera.right) < 0.0) {\n        Cartesian3.negate(right, right);\n      }\n\n      Cartesian3.cross(right, camera.direction, camera.up);\n      Cartesian3.cross(camera.direction, camera.up, camera.right);\n\n      Cartesian3.normalize(camera.up, camera.up);\n      Cartesian3.normalize(camera.right, camera.right);\n    }\n  }\n\n  camera._setTransform(oldTransform);\n  controller._globe = oldGlobe;\n  controller._ellipsoid = oldEllipsoid;\n\n  const radius = oldEllipsoid.maximumRadius;\n  controller._rotateFactor = 1.0 / radius;\n  controller._rotateRateRangeAdjustment = radius;\n\n  const originalPosition = Cartesian3.clone(\n    camera.positionWC,\n    rotateCVCartesian3\n  );\n\n  if (controller.enableCollisionDetection) {\n    adjustHeightForTerrain(controller);\n  }\n\n  if (!Cartesian3.equals(camera.positionWC, originalPosition)) {\n    camera._setTransform(verticalTransform);\n    camera.worldToCameraCoordinatesPoint(originalPosition, originalPosition);\n\n    const magSqrd = Cartesian3.magnitudeSquared(originalPosition);\n    if (Cartesian3.magnitudeSquared(camera.position) > magSqrd) {\n      Cartesian3.normalize(camera.position, camera.position);\n      Cartesian3.multiplyByScalar(\n        camera.position,\n        Math.sqrt(magSqrd),\n        camera.position\n      );\n    }\n\n    const angle = Cartesian3.angleBetween(originalPosition, camera.position);\n    const axis = Cartesian3.cross(\n      originalPosition,\n      camera.position,\n      originalPosition\n    );\n    Cartesian3.normalize(axis, axis);\n\n    const quaternion = Quaternion.fromAxisAngle(\n      axis,\n      angle,\n      rotateCVQuaternion\n    );\n    const rotation = Matrix3.fromQuaternion(quaternion, rotateCVMatrix);\n    Matrix3.multiplyByVector(rotation, camera.direction, camera.direction);\n    Matrix3.multiplyByVector(rotation, camera.up, camera.up);\n    Cartesian3.cross(camera.direction, camera.up, camera.right);\n    Cartesian3.cross(camera.right, camera.direction, camera.up);\n\n    camera._setTransform(oldTransform);\n  }\n}\n\nconst zoomCVWindowPos = new Cartesian2();\nconst zoomCVWindowRay = new Ray();\nconst zoomCVIntersection = new Cartesian3();\n\nfunction zoomCV(controller, startPosition, movement) {\n  if (defined(movement.distance)) {\n    movement = movement.distance;\n  }\n\n  const scene = controller._scene;\n  const camera = scene.camera;\n  const canvas = scene.canvas;\n\n  const cameraUnderground = controller._cameraUnderground;\n\n  let windowPosition;\n\n  if (cameraUnderground) {\n    windowPosition = startPosition;\n  } else {\n    windowPosition = zoomCVWindowPos;\n    windowPosition.x = canvas.clientWidth / 2;\n    windowPosition.y = canvas.clientHeight / 2;\n  }\n\n  const ray = camera.getPickRay(windowPosition, zoomCVWindowRay);\n  const position = ray.origin;\n  const direction = ray.direction;\n  const height = camera.position.z;\n\n  let intersection;\n  if (height < controller._minimumPickingTerrainHeight) {\n    intersection = pickPosition(controller, windowPosition, zoomCVIntersection);\n  }\n\n  let distance;\n  if (defined(intersection)) {\n    distance = Cartesian3.distance(position, intersection);\n  }\n\n  if (cameraUnderground) {\n    const distanceUnderground = getZoomDistanceUnderground(\n      controller,\n      ray,\n      height\n    );\n    if (defined(distance)) {\n      distance = Math.min(distance, distanceUnderground);\n    } else {\n      distance = distanceUnderground;\n    }\n  }\n\n  if (!defined(distance)) {\n    const normal = Cartesian3.UNIT_X;\n    distance =\n      -Cartesian3.dot(normal, position) / Cartesian3.dot(normal, direction);\n  }\n\n  handleZoom(\n    controller,\n    startPosition,\n    movement,\n    controller._zoomFactor,\n    distance\n  );\n}\n\nfunction updateCV(controller) {\n  const scene = controller._scene;\n  const camera = scene.camera;\n\n  if (!Matrix4.equals(Matrix4.IDENTITY, camera.transform)) {\n    reactToInput(\n      controller,\n      controller.enableRotate,\n      controller.rotateEventTypes,\n      rotate3D,\n      controller.inertiaSpin,\n      \"_lastInertiaSpinMovement\"\n    );\n    reactToInput(\n      controller,\n      controller.enableZoom,\n      controller.zoomEventTypes,\n      zoom3D,\n      controller.inertiaZoom,\n      \"_lastInertiaZoomMovement\"\n    );\n  } else {\n    const tweens = controller._tweens;\n\n    if (controller._aggregator.anyButtonDown) {\n      tweens.removeAll();\n    }\n\n    reactToInput(\n      controller,\n      controller.enableTilt,\n      controller.tiltEventTypes,\n      rotateCV,\n      controller.inertiaSpin,\n      \"_lastInertiaTiltMovement\"\n    );\n    reactToInput(\n      controller,\n      controller.enableTranslate,\n      controller.translateEventTypes,\n      translateCV,\n      controller.inertiaTranslate,\n      \"_lastInertiaTranslateMovement\"\n    );\n    reactToInput(\n      controller,\n      controller.enableZoom,\n      controller.zoomEventTypes,\n      zoomCV,\n      controller.inertiaZoom,\n      \"_lastInertiaZoomMovement\"\n    );\n    reactToInput(\n      controller,\n      controller.enableLook,\n      controller.lookEventTypes,\n      look3D\n    );\n\n    if (\n      !controller._aggregator.anyButtonDown &&\n      !tweens.contains(controller._tween)\n    ) {\n      const tween = camera.createCorrectPositionTween(\n        controller.bounceAnimationTime\n      );\n      if (defined(tween)) {\n        controller._tween = tweens.add(tween);\n      }\n    }\n\n    tweens.update();\n  }\n}\n\nconst scratchStrafeRay = new Ray();\nconst scratchStrafePlane = new Plane(Cartesian3.UNIT_X, 0.0);\nconst scratchStrafeIntersection = new Cartesian3();\nconst scratchStrafeDirection = new Cartesian3();\n\nfunction strafe(controller, movement, strafeStartPosition) {\n  const scene = controller._scene;\n  const camera = scene.camera;\n\n  const ray = camera.getPickRay(movement.endPosition, scratchStrafeRay);\n\n  let direction = Cartesian3.clone(camera.direction, scratchStrafeDirection);\n  if (scene.mode === SceneMode.COLUMBUS_VIEW) {\n    Cartesian3.fromElements(direction.z, direction.x, direction.y, direction);\n  }\n\n  const plane = Plane.fromPointNormal(\n    strafeStartPosition,\n    direction,\n    scratchStrafePlane\n  );\n  const intersection = IntersectionTests.rayPlane(\n    ray,\n    plane,\n    scratchStrafeIntersection\n  );\n  if (!defined(intersection)) {\n    return;\n  }\n\n  direction = Cartesian3.subtract(strafeStartPosition, intersection, direction);\n  if (scene.mode === SceneMode.COLUMBUS_VIEW) {\n    Cartesian3.fromElements(direction.y, direction.z, direction.x, direction);\n  }\n\n  Cartesian3.add(camera.position, direction, camera.position);\n}\n\nconst spin3DPick = new Cartesian3();\nconst scratchCartographic = new Cartographic();\nconst scratchRadii = new Cartesian3();\nconst scratchEllipsoid = new Ellipsoid();\nconst scratchLookUp = new Cartesian3();\nconst scratchNormal = new Cartesian3();\nconst scratchMousePosition = new Cartesian3();\n\nfunction spin3D(controller, startPosition, movement) {\n  const scene = controller._scene;\n  const camera = scene.camera;\n  const cameraUnderground = controller._cameraUnderground;\n  let ellipsoid = controller._ellipsoid;\n\n  if (!Matrix4.equals(camera.transform, Matrix4.IDENTITY)) {\n    rotate3D(controller, startPosition, movement);\n    return;\n  }\n\n  let magnitude;\n  let radii;\n\n  const up = ellipsoid.geodeticSurfaceNormal(camera.position, scratchLookUp);\n\n  if (Cartesian2.equals(startPosition, controller._rotateMousePosition)) {\n    if (controller._looking) {\n      look3D(controller, startPosition, movement, up);\n    } else if (controller._rotating) {\n      rotate3D(controller, startPosition, movement);\n    } else if (controller._strafing) {\n      continueStrafing(controller, movement);\n    } else {\n      if (\n        Cartesian3.magnitude(camera.position) <\n        Cartesian3.magnitude(controller._rotateStartPosition)\n      ) {\n        // Pan action is no longer valid if camera moves below the pan ellipsoid\n        return;\n      }\n      magnitude = Cartesian3.magnitude(controller._rotateStartPosition);\n      radii = scratchRadii;\n      radii.x = radii.y = radii.z = magnitude;\n      ellipsoid = Ellipsoid.fromCartesian3(radii, scratchEllipsoid);\n      pan3D(controller, startPosition, movement, ellipsoid);\n    }\n    return;\n  }\n  controller._looking = false;\n  controller._rotating = false;\n  controller._strafing = false;\n\n  const height = ellipsoid.cartesianToCartographic(\n    camera.positionWC,\n    scratchCartographic\n  ).height;\n  const globe = controller._globe;\n\n  if (defined(globe) && height < controller._minimumPickingTerrainHeight) {\n    const mousePos = pickPosition(\n      controller,\n      movement.startPosition,\n      scratchMousePosition\n    );\n    if (defined(mousePos)) {\n      let strafing = false;\n      const ray = camera.getPickRay(\n        movement.startPosition,\n        pickGlobeScratchRay\n      );\n\n      if (cameraUnderground) {\n        strafing = true;\n        getStrafeStartPositionUnderground(controller, ray, mousePos, mousePos);\n      } else {\n        const normal = ellipsoid.geodeticSurfaceNormal(mousePos, scratchNormal);\n        const tangentPick =\n          Math.abs(Cartesian3.dot(ray.direction, normal)) < 0.05;\n\n        if (tangentPick) {\n          strafing = true;\n        } else {\n          strafing =\n            Cartesian3.magnitude(camera.position) <\n            Cartesian3.magnitude(mousePos);\n        }\n      }\n\n      if (strafing) {\n        Cartesian2.clone(startPosition, controller._strafeEndMousePosition);\n        Cartesian3.clone(mousePos, controller._strafeStartPosition);\n        controller._strafing = true;\n        strafe(controller, movement, controller._strafeStartPosition);\n      } else {\n        magnitude = Cartesian3.magnitude(mousePos);\n        radii = scratchRadii;\n        radii.x = radii.y = radii.z = magnitude;\n        ellipsoid = Ellipsoid.fromCartesian3(radii, scratchEllipsoid);\n        pan3D(controller, startPosition, movement, ellipsoid);\n\n        Cartesian3.clone(mousePos, controller._rotateStartPosition);\n      }\n    } else {\n      controller._looking = true;\n      look3D(controller, startPosition, movement, up);\n    }\n  } else if (\n    defined(\n      camera.pickEllipsoid(\n        movement.startPosition,\n        controller._ellipsoid,\n        spin3DPick\n      )\n    )\n  ) {\n    pan3D(controller, startPosition, movement, controller._ellipsoid);\n    Cartesian3.clone(spin3DPick, controller._rotateStartPosition);\n  } else if (height > controller._minimumTrackBallHeight) {\n    controller._rotating = true;\n    rotate3D(controller, startPosition, movement);\n  } else {\n    controller._looking = true;\n    look3D(controller, startPosition, movement, up);\n  }\n\n  Cartesian2.clone(startPosition, controller._rotateMousePosition);\n}\n\nfunction rotate3D(\n  controller,\n  startPosition,\n  movement,\n  constrainedAxis,\n  rotateOnlyVertical,\n  rotateOnlyHorizontal\n) {\n  rotateOnlyVertical = defaultValue(rotateOnlyVertical, false);\n  rotateOnlyHorizontal = defaultValue(rotateOnlyHorizontal, false);\n\n  const scene = controller._scene;\n  const camera = scene.camera;\n  const canvas = scene.canvas;\n\n  const oldAxis = camera.constrainedAxis;\n  if (defined(constrainedAxis)) {\n    camera.constrainedAxis = constrainedAxis;\n  }\n\n  const rho = Cartesian3.magnitude(camera.position);\n  let rotateRate =\n    controller._rotateFactor * (rho - controller._rotateRateRangeAdjustment);\n\n  if (rotateRate > controller._maximumRotateRate) {\n    rotateRate = controller._maximumRotateRate;\n  }\n\n  if (rotateRate < controller._minimumRotateRate) {\n    rotateRate = controller._minimumRotateRate;\n  }\n\n  let phiWindowRatio =\n    (movement.startPosition.x - movement.endPosition.x) / canvas.clientWidth;\n  let thetaWindowRatio =\n    (movement.startPosition.y - movement.endPosition.y) / canvas.clientHeight;\n  phiWindowRatio = Math.min(phiWindowRatio, controller.maximumMovementRatio);\n  thetaWindowRatio = Math.min(\n    thetaWindowRatio,\n    controller.maximumMovementRatio\n  );\n\n  const deltaPhi = rotateRate * phiWindowRatio * Math.PI * 2.0;\n  const deltaTheta = rotateRate * thetaWindowRatio * Math.PI;\n\n  if (!rotateOnlyVertical) {\n    camera.rotateRight(deltaPhi);\n  }\n\n  if (!rotateOnlyHorizontal) {\n    camera.rotateUp(deltaTheta);\n  }\n\n  camera.constrainedAxis = oldAxis;\n}\n\nconst pan3DP0 = Cartesian4.clone(Cartesian4.UNIT_W);\nconst pan3DP1 = Cartesian4.clone(Cartesian4.UNIT_W);\nconst pan3DTemp0 = new Cartesian3();\nconst pan3DTemp1 = new Cartesian3();\nconst pan3DTemp2 = new Cartesian3();\nconst pan3DTemp3 = new Cartesian3();\nconst pan3DStartMousePosition = new Cartesian2();\nconst pan3DEndMousePosition = new Cartesian2();\nconst pan3DDiffMousePosition = new Cartesian2();\nconst pan3DPixelDimensions = new Cartesian2();\nconst panRay = new Ray();\n\nfunction pan3D(controller, startPosition, movement, ellipsoid) {\n  const scene = controller._scene;\n  const camera = scene.camera;\n\n  const startMousePosition = Cartesian2.clone(\n    movement.startPosition,\n    pan3DStartMousePosition\n  );\n  const endMousePosition = Cartesian2.clone(\n    movement.endPosition,\n    pan3DEndMousePosition\n  );\n  const height = ellipsoid.cartesianToCartographic(\n    camera.positionWC,\n    scratchCartographic\n  ).height;\n\n  let p0, p1;\n\n  if (\n    !movement.inertiaEnabled &&\n    height < controller._minimumPickingTerrainHeight\n  ) {\n    p0 = Cartesian3.clone(controller._panLastWorldPosition, pan3DP0);\n\n    // Use the last picked world position unless we're starting a new drag\n    if (\n      !defined(controller._globe) &&\n      !Cartesian2.equalsEpsilon(\n        startMousePosition,\n        controller._panLastMousePosition\n      )\n    ) {\n      p0 = pickPosition(controller, startMousePosition, pan3DP0);\n    }\n\n    if (!defined(controller._globe) && defined(p0)) {\n      const toCenter = Cartesian3.subtract(p0, camera.positionWC, pan3DTemp1);\n      const toCenterProj = Cartesian3.multiplyByScalar(\n        camera.directionWC,\n        Cartesian3.dot(camera.directionWC, toCenter),\n        pan3DTemp1\n      );\n      const distanceToNearPlane = Cartesian3.magnitude(toCenterProj);\n      const pixelDimensions = camera.frustum.getPixelDimensions(\n        scene.drawingBufferWidth,\n        scene.drawingBufferHeight,\n        distanceToNearPlane,\n        scene.pixelRatio,\n        pan3DPixelDimensions\n      );\n\n      const dragDelta = Cartesian2.subtract(\n        endMousePosition,\n        startMousePosition,\n        pan3DDiffMousePosition\n      );\n\n      // Move the camera to the the distance the cursor moved in worldspace\n      const right = Cartesian3.multiplyByScalar(\n        camera.rightWC,\n        dragDelta.x * pixelDimensions.x,\n        pan3DTemp1\n      );\n\n      // Move the camera towards the picked position in worldspace as the camera is pointed towards a horizon view\n      const cameraPositionNormal = Cartesian3.normalize(\n        camera.positionWC,\n        scratchCameraPositionNormal\n      );\n      const endPickDirection = camera.getPickRay(endMousePosition, panRay)\n        .direction;\n      const endPickProj = Cartesian3.subtract(\n        endPickDirection,\n        Cartesian3.projectVector(endPickDirection, camera.rightWC, pan3DTemp2),\n        pan3DTemp2\n      );\n      const angle = Cartesian3.angleBetween(endPickProj, camera.directionWC);\n      let forward = 1.0;\n      if (defined(camera.frustum.fov)) {\n        forward = Math.max(Math.tan(angle), 0.1); // Clamp so we don't make the magnitude infinitely large when the angle is small\n      }\n      let dot = Math.abs(\n        Cartesian3.dot(camera.directionWC, cameraPositionNormal)\n      );\n      const magnitude =\n        ((-dragDelta.y * pixelDimensions.y * 2.0) / Math.sqrt(forward)) *\n        (1.0 - dot);\n      const direction = Cartesian3.multiplyByScalar(\n        endPickDirection,\n        magnitude,\n        pan3DTemp2\n      );\n\n      // Move the camera up the distance the cursor moved in worldspace as the camera is pointed towards the center\n      dot = Math.abs(Cartesian3.dot(camera.upWC, cameraPositionNormal));\n      const up = Cartesian3.multiplyByScalar(\n        camera.upWC,\n        -dragDelta.y * (1.0 - dot) * pixelDimensions.y,\n        pan3DTemp3\n      );\n\n      p1 = Cartesian3.add(p0, right, pan3DP1);\n      p1 = Cartesian3.add(p1, direction, p1);\n      p1 = Cartesian3.add(p1, up, p1);\n\n      Cartesian3.clone(p1, controller._panLastWorldPosition);\n      Cartesian2.clone(endMousePosition, controller._panLastMousePosition);\n    }\n  }\n\n  if (!defined(p0) || !defined(p1)) {\n    p0 = camera.pickEllipsoid(startMousePosition, ellipsoid, pan3DP0);\n    p1 = camera.pickEllipsoid(endMousePosition, ellipsoid, pan3DP1);\n  }\n\n  if (!defined(p0) || !defined(p1)) {\n    controller._rotating = true;\n    rotate3D(controller, startPosition, movement);\n    return;\n  }\n\n  p0 = camera.worldToCameraCoordinates(p0, p0);\n  p1 = camera.worldToCameraCoordinates(p1, p1);\n\n  if (!defined(camera.constrainedAxis)) {\n    Cartesian3.normalize(p0, p0);\n    Cartesian3.normalize(p1, p1);\n    const dot = Cartesian3.dot(p0, p1);\n    const axis = Cartesian3.cross(p0, p1, pan3DTemp0);\n\n    if (\n      dot < 1.0 &&\n      !Cartesian3.equalsEpsilon(axis, Cartesian3.ZERO, CesiumMath.EPSILON14)\n    ) {\n      // dot is in [0, 1]\n      const angle = Math.acos(dot);\n      camera.rotate(axis, angle);\n    }\n  } else {\n    const basis0 = camera.constrainedAxis;\n    const basis1 = Cartesian3.mostOrthogonalAxis(basis0, pan3DTemp0);\n    Cartesian3.cross(basis1, basis0, basis1);\n    Cartesian3.normalize(basis1, basis1);\n    const basis2 = Cartesian3.cross(basis0, basis1, pan3DTemp1);\n\n    const startRho = Cartesian3.magnitude(p0);\n    const startDot = Cartesian3.dot(basis0, p0);\n    const startTheta = Math.acos(startDot / startRho);\n    const startRej = Cartesian3.multiplyByScalar(basis0, startDot, pan3DTemp2);\n    Cartesian3.subtract(p0, startRej, startRej);\n    Cartesian3.normalize(startRej, startRej);\n\n    const endRho = Cartesian3.magnitude(p1);\n    const endDot = Cartesian3.dot(basis0, p1);\n    const endTheta = Math.acos(endDot / endRho);\n    const endRej = Cartesian3.multiplyByScalar(basis0, endDot, pan3DTemp3);\n    Cartesian3.subtract(p1, endRej, endRej);\n    Cartesian3.normalize(endRej, endRej);\n\n    let startPhi = Math.acos(Cartesian3.dot(startRej, basis1));\n    if (Cartesian3.dot(startRej, basis2) < 0) {\n      startPhi = CesiumMath.TWO_PI - startPhi;\n    }\n\n    let endPhi = Math.acos(Cartesian3.dot(endRej, basis1));\n    if (Cartesian3.dot(endRej, basis2) < 0) {\n      endPhi = CesiumMath.TWO_PI - endPhi;\n    }\n\n    const deltaPhi = startPhi - endPhi;\n\n    let east;\n    if (\n      Cartesian3.equalsEpsilon(basis0, camera.position, CesiumMath.EPSILON2)\n    ) {\n      east = camera.right;\n    } else {\n      east = Cartesian3.cross(basis0, camera.position, pan3DTemp0);\n    }\n\n    const planeNormal = Cartesian3.cross(basis0, east, pan3DTemp0);\n    const side0 = Cartesian3.dot(\n      planeNormal,\n      Cartesian3.subtract(p0, basis0, pan3DTemp1)\n    );\n    const side1 = Cartesian3.dot(\n      planeNormal,\n      Cartesian3.subtract(p1, basis0, pan3DTemp1)\n    );\n\n    let deltaTheta;\n    if (side0 > 0 && side1 > 0) {\n      deltaTheta = endTheta - startTheta;\n    } else if (side0 > 0 && side1 <= 0) {\n      if (Cartesian3.dot(camera.position, basis0) > 0) {\n        deltaTheta = -startTheta - endTheta;\n      } else {\n        deltaTheta = startTheta + endTheta;\n      }\n    } else {\n      deltaTheta = startTheta - endTheta;\n    }\n\n    camera.rotateRight(deltaPhi);\n    camera.rotateUp(deltaTheta);\n  }\n}\n\nconst zoom3DUnitPosition = new Cartesian3();\nconst zoom3DCartographic = new Cartographic();\n\nlet preIntersectionDistance = 0;\n\nfunction zoom3D(controller, startPosition, movement) {\n  if (defined(movement.distance)) {\n    movement = movement.distance;\n  }\n  const inertiaMovement = movement.inertiaEnabled;\n\n  const ellipsoid = controller._ellipsoid;\n  const scene = controller._scene;\n  const camera = scene.camera;\n  const canvas = scene.canvas;\n\n  const cameraUnderground = controller._cameraUnderground;\n\n  let windowPosition;\n\n  if (cameraUnderground) {\n    windowPosition = startPosition;\n  } else {\n    windowPosition = zoomCVWindowPos;\n    windowPosition.x = canvas.clientWidth / 2;\n    windowPosition.y = canvas.clientHeight / 2;\n  }\n\n  const ray = camera.getPickRay(windowPosition, zoomCVWindowRay);\n\n  let intersection;\n  const height = ellipsoid.cartesianToCartographic(\n    camera.position,\n    zoom3DCartographic\n  ).height;\n\n  const approachingCollision =\n    Math.abs(preIntersectionDistance) <\n    controller.minimumPickingTerrainDistanceWithInertia;\n\n  const needPickGlobe = inertiaMovement\n    ? approachingCollision\n    : height < controller._minimumPickingTerrainHeight;\n  if (needPickGlobe) {\n    intersection = pickPosition(controller, windowPosition, zoomCVIntersection);\n  }\n\n  let distance;\n  if (defined(intersection)) {\n    distance = Cartesian3.distance(ray.origin, intersection);\n    preIntersectionDistance = distance;\n  }\n\n  if (cameraUnderground) {\n    const distanceUnderground = getZoomDistanceUnderground(\n      controller,\n      ray,\n      height\n    );\n    if (defined(distance)) {\n      distance = Math.min(distance, distanceUnderground);\n    } else {\n      distance = distanceUnderground;\n    }\n  }\n\n  if (!defined(distance)) {\n    distance = height;\n  }\n\n  const unitPosition = Cartesian3.normalize(\n    camera.position,\n    zoom3DUnitPosition\n  );\n  handleZoom(\n    controller,\n    startPosition,\n    movement,\n    controller._zoomFactor,\n    distance,\n    Cartesian3.dot(unitPosition, camera.direction)\n  );\n}\n\nconst tilt3DWindowPos = new Cartesian2();\nconst tilt3DRay = new Ray();\nconst tilt3DCenter = new Cartesian3();\nconst tilt3DVerticalCenter = new Cartesian3();\nconst tilt3DTransform = new Matrix4();\nconst tilt3DVerticalTransform = new Matrix4();\nconst tilt3DOldTransform = new Matrix4();\nconst tilt3DQuaternion = new Quaternion();\nconst tilt3DMatrix = new Matrix3();\nconst tilt3DCart = new Cartographic();\nconst tilt3DLookUp = new Cartesian3();\n\nfunction tilt3D(controller, startPosition, movement) {\n  const scene = controller._scene;\n  const camera = scene.camera;\n\n  if (!Matrix4.equals(camera.transform, Matrix4.IDENTITY)) {\n    return;\n  }\n\n  if (defined(movement.angleAndHeight)) {\n    movement = movement.angleAndHeight;\n  }\n\n  if (!Cartesian2.equals(startPosition, controller._tiltCenterMousePosition)) {\n    controller._tiltOnEllipsoid = false;\n    controller._looking = false;\n  }\n\n  if (controller._looking) {\n    const up = controller._ellipsoid.geodeticSurfaceNormal(\n      camera.position,\n      tilt3DLookUp\n    );\n    look3D(controller, startPosition, movement, up);\n    return;\n  }\n\n  const ellipsoid = controller._ellipsoid;\n  const cartographic = ellipsoid.cartesianToCartographic(\n    camera.position,\n    tilt3DCart\n  );\n\n  if (\n    controller._tiltOnEllipsoid ||\n    cartographic.height > controller._minimumCollisionTerrainHeight\n  ) {\n    controller._tiltOnEllipsoid = true;\n    tilt3DOnEllipsoid(controller, startPosition, movement);\n  } else {\n    tilt3DOnTerrain(controller, startPosition, movement);\n  }\n}\n\nconst tilt3DOnEllipsoidCartographic = new Cartographic();\n\nfunction tilt3DOnEllipsoid(controller, startPosition, movement) {\n  const ellipsoid = controller._ellipsoid;\n  const scene = controller._scene;\n  const camera = scene.camera;\n  const minHeight = controller.minimumZoomDistance * 0.25;\n  const height = ellipsoid.cartesianToCartographic(\n    camera.positionWC,\n    tilt3DOnEllipsoidCartographic\n  ).height;\n  if (\n    height - minHeight - 1.0 < CesiumMath.EPSILON3 &&\n    movement.endPosition.y - movement.startPosition.y < 0\n  ) {\n    return;\n  }\n\n  const canvas = scene.canvas;\n\n  const windowPosition = tilt3DWindowPos;\n  windowPosition.x = canvas.clientWidth / 2;\n  windowPosition.y = canvas.clientHeight / 2;\n  const ray = camera.getPickRay(windowPosition, tilt3DRay);\n\n  let center;\n  const intersection = IntersectionTests.rayEllipsoid(ray, ellipsoid);\n  if (defined(intersection)) {\n    center = Ray.getPoint(ray, intersection.start, tilt3DCenter);\n  } else if (height > controller._minimumTrackBallHeight) {\n    const grazingAltitudeLocation = IntersectionTests.grazingAltitudeLocation(\n      ray,\n      ellipsoid\n    );\n    if (!defined(grazingAltitudeLocation)) {\n      return;\n    }\n    const grazingAltitudeCart = ellipsoid.cartesianToCartographic(\n      grazingAltitudeLocation,\n      tilt3DCart\n    );\n    grazingAltitudeCart.height = 0.0;\n    center = ellipsoid.cartographicToCartesian(\n      grazingAltitudeCart,\n      tilt3DCenter\n    );\n  } else {\n    controller._looking = true;\n    const up = controller._ellipsoid.geodeticSurfaceNormal(\n      camera.position,\n      tilt3DLookUp\n    );\n    look3D(controller, startPosition, movement, up);\n    Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);\n    return;\n  }\n\n  const transform = Transforms.eastNorthUpToFixedFrame(\n    center,\n    ellipsoid,\n    tilt3DTransform\n  );\n\n  const oldGlobe = controller._globe;\n  const oldEllipsoid = controller._ellipsoid;\n  controller._globe = undefined;\n  controller._ellipsoid = Ellipsoid.UNIT_SPHERE;\n  controller._rotateFactor = 1.0;\n  controller._rotateRateRangeAdjustment = 1.0;\n\n  const oldTransform = Matrix4.clone(camera.transform, tilt3DOldTransform);\n  camera._setTransform(transform);\n\n  rotate3D(controller, startPosition, movement, Cartesian3.UNIT_Z);\n\n  camera._setTransform(oldTransform);\n  controller._globe = oldGlobe;\n  controller._ellipsoid = oldEllipsoid;\n\n  const radius = oldEllipsoid.maximumRadius;\n  controller._rotateFactor = 1.0 / radius;\n  controller._rotateRateRangeAdjustment = radius;\n}\n\nfunction tilt3DOnTerrain(controller, startPosition, movement) {\n  const ellipsoid = controller._ellipsoid;\n  const scene = controller._scene;\n  const camera = scene.camera;\n  const cameraUnderground = controller._cameraUnderground;\n\n  let center;\n  let ray;\n  let intersection;\n\n  if (Cartesian2.equals(startPosition, controller._tiltCenterMousePosition)) {\n    center = Cartesian3.clone(controller._tiltCenter, tilt3DCenter);\n  } else {\n    center = pickPosition(controller, startPosition, tilt3DCenter);\n\n    if (!defined(center)) {\n      ray = camera.getPickRay(startPosition, tilt3DRay);\n      intersection = IntersectionTests.rayEllipsoid(ray, ellipsoid);\n      if (!defined(intersection)) {\n        const cartographic = ellipsoid.cartesianToCartographic(\n          camera.position,\n          tilt3DCart\n        );\n        if (cartographic.height <= controller._minimumTrackBallHeight) {\n          controller._looking = true;\n          const up = controller._ellipsoid.geodeticSurfaceNormal(\n            camera.position,\n            tilt3DLookUp\n          );\n          look3D(controller, startPosition, movement, up);\n          Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);\n        }\n        return;\n      }\n      center = Ray.getPoint(ray, intersection.start, tilt3DCenter);\n    }\n\n    if (cameraUnderground) {\n      if (!defined(ray)) {\n        ray = camera.getPickRay(startPosition, tilt3DRay);\n      }\n      getTiltCenterUnderground(controller, ray, center, center);\n    }\n\n    Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);\n    Cartesian3.clone(center, controller._tiltCenter);\n  }\n\n  const canvas = scene.canvas;\n\n  const windowPosition = tilt3DWindowPos;\n  windowPosition.x = canvas.clientWidth / 2;\n  windowPosition.y = controller._tiltCenterMousePosition.y;\n  ray = camera.getPickRay(windowPosition, tilt3DRay);\n\n  const mag = Cartesian3.magnitude(center);\n  const radii = Cartesian3.fromElements(mag, mag, mag, scratchRadii);\n  const newEllipsoid = Ellipsoid.fromCartesian3(radii, scratchEllipsoid);\n\n  intersection = IntersectionTests.rayEllipsoid(ray, newEllipsoid);\n  if (!defined(intersection)) {\n    return;\n  }\n\n  const t =\n    Cartesian3.magnitude(ray.origin) > mag\n      ? intersection.start\n      : intersection.stop;\n  const verticalCenter = Ray.getPoint(ray, t, tilt3DVerticalCenter);\n\n  const transform = Transforms.eastNorthUpToFixedFrame(\n    center,\n    ellipsoid,\n    tilt3DTransform\n  );\n  const verticalTransform = Transforms.eastNorthUpToFixedFrame(\n    verticalCenter,\n    newEllipsoid,\n    tilt3DVerticalTransform\n  );\n\n  const oldGlobe = controller._globe;\n  const oldEllipsoid = controller._ellipsoid;\n  controller._globe = undefined;\n  controller._ellipsoid = Ellipsoid.UNIT_SPHERE;\n  controller._rotateFactor = 1.0;\n  controller._rotateRateRangeAdjustment = 1.0;\n\n  let constrainedAxis = Cartesian3.UNIT_Z;\n\n  const oldTransform = Matrix4.clone(camera.transform, tilt3DOldTransform);\n  camera._setTransform(verticalTransform);\n\n  const tangent = Cartesian3.cross(\n    verticalCenter,\n    camera.positionWC,\n    tilt3DCartesian3\n  );\n  const dot = Cartesian3.dot(camera.rightWC, tangent);\n\n  if (dot < 0.0) {\n    const movementDelta = movement.startPosition.y - movement.endPosition.y;\n    if (\n      (cameraUnderground && movementDelta < 0.0) ||\n      (!cameraUnderground && movementDelta > 0.0)\n    ) {\n      // Prevent camera from flipping past the up axis\n      constrainedAxis = undefined;\n    }\n\n    const oldConstrainedAxis = camera.constrainedAxis;\n    camera.constrainedAxis = undefined;\n\n    rotate3D(controller, startPosition, movement, constrainedAxis, true, false);\n\n    camera.constrainedAxis = oldConstrainedAxis;\n  } else {\n    rotate3D(controller, startPosition, movement, constrainedAxis, true, false);\n  }\n\n  camera._setTransform(transform);\n  rotate3D(controller, startPosition, movement, constrainedAxis, false, true);\n\n  if (defined(camera.constrainedAxis)) {\n    const right = Cartesian3.cross(\n      camera.direction,\n      camera.constrainedAxis,\n      tilt3DCartesian3\n    );\n    if (\n      !Cartesian3.equalsEpsilon(right, Cartesian3.ZERO, CesiumMath.EPSILON6)\n    ) {\n      if (Cartesian3.dot(right, camera.right) < 0.0) {\n        Cartesian3.negate(right, right);\n      }\n\n      Cartesian3.cross(right, camera.direction, camera.up);\n      Cartesian3.cross(camera.direction, camera.up, camera.right);\n\n      Cartesian3.normalize(camera.up, camera.up);\n      Cartesian3.normalize(camera.right, camera.right);\n    }\n  }\n\n  camera._setTransform(oldTransform);\n  controller._globe = oldGlobe;\n  controller._ellipsoid = oldEllipsoid;\n\n  const radius = oldEllipsoid.maximumRadius;\n  controller._rotateFactor = 1.0 / radius;\n  controller._rotateRateRangeAdjustment = radius;\n\n  const originalPosition = Cartesian3.clone(\n    camera.positionWC,\n    tilt3DCartesian3\n  );\n\n  if (controller.enableCollisionDetection) {\n    adjustHeightForTerrain(controller);\n  }\n\n  if (!Cartesian3.equals(camera.positionWC, originalPosition)) {\n    camera._setTransform(verticalTransform);\n    camera.worldToCameraCoordinatesPoint(originalPosition, originalPosition);\n\n    const magSqrd = Cartesian3.magnitudeSquared(originalPosition);\n    if (Cartesian3.magnitudeSquared(camera.position) > magSqrd) {\n      Cartesian3.normalize(camera.position, camera.position);\n      Cartesian3.multiplyByScalar(\n        camera.position,\n        Math.sqrt(magSqrd),\n        camera.position\n      );\n    }\n\n    const angle = Cartesian3.angleBetween(originalPosition, camera.position);\n    const axis = Cartesian3.cross(\n      originalPosition,\n      camera.position,\n      originalPosition\n    );\n    Cartesian3.normalize(axis, axis);\n\n    const quaternion = Quaternion.fromAxisAngle(axis, angle, tilt3DQuaternion);\n    const rotation = Matrix3.fromQuaternion(quaternion, tilt3DMatrix);\n    Matrix3.multiplyByVector(rotation, camera.direction, camera.direction);\n    Matrix3.multiplyByVector(rotation, camera.up, camera.up);\n    Cartesian3.cross(camera.direction, camera.up, camera.right);\n    Cartesian3.cross(camera.right, camera.direction, camera.up);\n\n    camera._setTransform(oldTransform);\n  }\n}\n\nconst look3DStartPos = new Cartesian2();\nconst look3DEndPos = new Cartesian2();\nconst look3DStartRay = new Ray();\nconst look3DEndRay = new Ray();\nconst look3DNegativeRot = new Cartesian3();\nconst look3DTan = new Cartesian3();\n\nfunction look3D(controller, startPosition, movement, rotationAxis) {\n  const scene = controller._scene;\n  const camera = scene.camera;\n\n  const startPos = look3DStartPos;\n  startPos.x = movement.startPosition.x;\n  startPos.y = 0.0;\n  const endPos = look3DEndPos;\n  endPos.x = movement.endPosition.x;\n  endPos.y = 0.0;\n\n  let startRay = camera.getPickRay(startPos, look3DStartRay);\n  let endRay = camera.getPickRay(endPos, look3DEndRay);\n  let angle = 0.0;\n  let start;\n  let end;\n\n  if (camera.frustum instanceof OrthographicFrustum) {\n    start = startRay.origin;\n    end = endRay.origin;\n\n    Cartesian3.add(camera.direction, start, start);\n    Cartesian3.add(camera.direction, end, end);\n\n    Cartesian3.subtract(start, camera.position, start);\n    Cartesian3.subtract(end, camera.position, end);\n\n    Cartesian3.normalize(start, start);\n    Cartesian3.normalize(end, end);\n  } else {\n    start = startRay.direction;\n    end = endRay.direction;\n  }\n\n  let dot = Cartesian3.dot(start, end);\n  if (dot < 1.0) {\n    // dot is in [0, 1]\n    angle = Math.acos(dot);\n  }\n\n  angle = movement.startPosition.x > movement.endPosition.x ? -angle : angle;\n\n  const horizontalRotationAxis = controller._horizontalRotationAxis;\n  if (defined(rotationAxis)) {\n    camera.look(rotationAxis, -angle);\n  } else if (defined(horizontalRotationAxis)) {\n    camera.look(horizontalRotationAxis, -angle);\n  } else {\n    camera.lookLeft(angle);\n  }\n\n  startPos.x = 0.0;\n  startPos.y = movement.startPosition.y;\n  endPos.x = 0.0;\n  endPos.y = movement.endPosition.y;\n\n  startRay = camera.getPickRay(startPos, look3DStartRay);\n  endRay = camera.getPickRay(endPos, look3DEndRay);\n  angle = 0.0;\n\n  if (camera.frustum instanceof OrthographicFrustum) {\n    start = startRay.origin;\n    end = endRay.origin;\n\n    Cartesian3.add(camera.direction, start, start);\n    Cartesian3.add(camera.direction, end, end);\n\n    Cartesian3.subtract(start, camera.position, start);\n    Cartesian3.subtract(end, camera.position, end);\n\n    Cartesian3.normalize(start, start);\n    Cartesian3.normalize(end, end);\n  } else {\n    start = startRay.direction;\n    end = endRay.direction;\n  }\n\n  dot = Cartesian3.dot(start, end);\n  if (dot < 1.0) {\n    // dot is in [0, 1]\n    angle = Math.acos(dot);\n  }\n  angle = movement.startPosition.y > movement.endPosition.y ? -angle : angle;\n\n  rotationAxis = defaultValue(rotationAxis, horizontalRotationAxis);\n  if (defined(rotationAxis)) {\n    const direction = camera.direction;\n    const negativeRotationAxis = Cartesian3.negate(\n      rotationAxis,\n      look3DNegativeRot\n    );\n    const northParallel = Cartesian3.equalsEpsilon(\n      direction,\n      rotationAxis,\n      CesiumMath.EPSILON2\n    );\n    const southParallel = Cartesian3.equalsEpsilon(\n      direction,\n      negativeRotationAxis,\n      CesiumMath.EPSILON2\n    );\n    if (!northParallel && !southParallel) {\n      dot = Cartesian3.dot(direction, rotationAxis);\n      let angleToAxis = CesiumMath.acosClamped(dot);\n      if (angle > 0 && angle > angleToAxis) {\n        angle = angleToAxis - CesiumMath.EPSILON4;\n      }\n\n      dot = Cartesian3.dot(direction, negativeRotationAxis);\n      angleToAxis = CesiumMath.acosClamped(dot);\n      if (angle < 0 && -angle > angleToAxis) {\n        angle = -angleToAxis + CesiumMath.EPSILON4;\n      }\n\n      const tangent = Cartesian3.cross(rotationAxis, direction, look3DTan);\n      camera.look(tangent, angle);\n    } else if ((northParallel && angle < 0) || (southParallel && angle > 0)) {\n      camera.look(camera.right, -angle);\n    }\n  } else {\n    camera.lookUp(angle);\n  }\n}\n\nfunction update3D(controller) {\n  reactToInput(\n    controller,\n    controller.enableRotate,\n    controller.rotateEventTypes,\n    spin3D,\n    controller.inertiaSpin,\n    \"_lastInertiaSpinMovement\"\n  );\n  reactToInput(\n    controller,\n    controller.enableZoom,\n    controller.zoomEventTypes,\n    zoom3D,\n    controller.inertiaZoom,\n    \"_lastInertiaZoomMovement\"\n  );\n  reactToInput(\n    controller,\n    controller.enableTilt,\n    controller.tiltEventTypes,\n    tilt3D,\n    controller.inertiaSpin,\n    \"_lastInertiaTiltMovement\"\n  );\n  reactToInput(\n    controller,\n    controller.enableLook,\n    controller.lookEventTypes,\n    look3D\n  );\n}\n\nconst scratchAdjustHeightTransform = new Matrix4();\nconst scratchAdjustHeightCartographic = new Cartographic();\n\nfunction adjustHeightForTerrain(controller) {\n  controller._adjustedHeightForTerrain = true;\n\n  const scene = controller._scene;\n  const mode = scene.mode;\n  const globe = scene.globe;\n\n  if (\n    !defined(globe) ||\n    mode === SceneMode.SCENE2D ||\n    mode === SceneMode.MORPHING\n  ) {\n    return;\n  }\n\n  const camera = scene.camera;\n  const ellipsoid = globe.ellipsoid;\n  const projection = scene.mapProjection;\n\n  let transform;\n  let mag;\n  if (!Matrix4.equals(camera.transform, Matrix4.IDENTITY)) {\n    transform = Matrix4.clone(camera.transform, scratchAdjustHeightTransform);\n    mag = Cartesian3.magnitude(camera.position);\n    camera._setTransform(Matrix4.IDENTITY);\n  }\n\n  const cartographic = scratchAdjustHeightCartographic;\n  if (mode === SceneMode.SCENE3D) {\n    ellipsoid.cartesianToCartographic(camera.position, cartographic);\n  } else {\n    projection.unproject(camera.position, cartographic);\n  }\n\n  let heightUpdated = false;\n  if (cartographic.height < controller._minimumCollisionTerrainHeight) {\n    const globeHeight = controller._scene.globeHeight;\n    if (defined(globeHeight)) {\n      const height = globeHeight + controller.minimumZoomDistance;\n      if (cartographic.height < height) {\n        cartographic.height = height;\n        if (mode === SceneMode.SCENE3D) {\n          ellipsoid.cartographicToCartesian(cartographic, camera.position);\n        } else {\n          projection.project(cartographic, camera.position);\n        }\n        heightUpdated = true;\n      }\n    }\n  }\n\n  if (defined(transform)) {\n    camera._setTransform(transform);\n    if (heightUpdated) {\n      Cartesian3.normalize(camera.position, camera.position);\n      Cartesian3.negate(camera.position, camera.direction);\n      Cartesian3.multiplyByScalar(\n        camera.position,\n        Math.max(mag, controller.minimumZoomDistance),\n        camera.position\n      );\n      Cartesian3.normalize(camera.direction, camera.direction);\n      Cartesian3.cross(camera.direction, camera.up, camera.right);\n      Cartesian3.cross(camera.right, camera.direction, camera.up);\n    }\n  }\n}\n\n/**\n * @private\n */\nScreenSpaceCameraController.prototype.onMap = function () {\n  const scene = this._scene;\n  const mode = scene.mode;\n  const camera = scene.camera;\n\n  if (mode === SceneMode.COLUMBUS_VIEW) {\n    return (\n      Math.abs(camera.position.x) - this._maxCoord.x < 0 &&\n      Math.abs(camera.position.y) - this._maxCoord.y < 0\n    );\n  }\n\n  return true;\n};\n\nconst scratchPreviousPosition = new Cartesian3();\nconst scratchPreviousDirection = new Cartesian3();\n\n/**\n * @private\n */\nScreenSpaceCameraController.prototype.update = function () {\n  const scene = this._scene;\n  const { camera, globe, mode } = scene;\n\n  if (!Matrix4.equals(camera.transform, Matrix4.IDENTITY)) {\n    this._globe = undefined;\n    this._ellipsoid = Ellipsoid.UNIT_SPHERE;\n  } else {\n    this._globe = globe;\n    this._ellipsoid = defined(this._globe)\n      ? this._globe.ellipsoid\n      : scene.mapProjection.ellipsoid;\n  }\n\n  const { verticalExaggeration, verticalExaggerationRelativeHeight } = scene;\n  this._minimumCollisionTerrainHeight = VerticalExaggeration.getHeight(\n    this.minimumCollisionTerrainHeight,\n    verticalExaggeration,\n    verticalExaggerationRelativeHeight\n  );\n  this._minimumPickingTerrainHeight = VerticalExaggeration.getHeight(\n    this.minimumPickingTerrainHeight,\n    verticalExaggeration,\n    verticalExaggerationRelativeHeight\n  );\n  this._minimumTrackBallHeight = VerticalExaggeration.getHeight(\n    this.minimumTrackBallHeight,\n    verticalExaggeration,\n    verticalExaggerationRelativeHeight\n  );\n\n  this._cameraUnderground = scene.cameraUnderground && defined(this._globe);\n\n  const radius = this._ellipsoid.maximumRadius;\n  this._rotateFactor = 1.0 / radius;\n  this._rotateRateRangeAdjustment = radius;\n\n  this._adjustedHeightForTerrain = false;\n  const previousPosition = Cartesian3.clone(\n    camera.positionWC,\n    scratchPreviousPosition\n  );\n  const previousDirection = Cartesian3.clone(\n    camera.directionWC,\n    scratchPreviousDirection\n  );\n\n  if (mode === SceneMode.SCENE2D) {\n    update2D(this);\n  } else if (mode === SceneMode.COLUMBUS_VIEW) {\n    this._horizontalRotationAxis = Cartesian3.UNIT_Z;\n    updateCV(this);\n  } else if (mode === SceneMode.SCENE3D) {\n    this._horizontalRotationAxis = undefined;\n    update3D(this);\n  }\n\n  if (this.enableCollisionDetection && !this._adjustedHeightForTerrain) {\n    // Adjust the camera height if the camera moved at all (user input or inertia) and an action didn't already adjust the camera height\n    const cameraChanged =\n      !Cartesian3.equals(previousPosition, camera.positionWC) ||\n      !Cartesian3.equals(previousDirection, camera.directionWC);\n    if (cameraChanged) {\n      adjustHeightForTerrain(this);\n    }\n  }\n\n  this._aggregator.reset();\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see ScreenSpaceCameraController#destroy\n */\nScreenSpaceCameraController.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Removes mouse listeners held by this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * controller = controller && controller.destroy();\n *\n * @see ScreenSpaceCameraController#isDestroyed\n */\nScreenSpaceCameraController.prototype.destroy = function () {\n  this._tweens.removeAll();\n  this._aggregator = this._aggregator && this._aggregator.destroy();\n  return destroyObject(this);\n};\nexport default ScreenSpaceCameraController;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform sampler2D colorTexture2;\\n\\\n\\n\\\nuniform vec2 center;\\n\\\nuniform float radius;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 color0 = texture(colorTexture, v_textureCoordinates);\\n\\\n    vec4 color1 = texture(colorTexture2, v_textureCoordinates);\\n\\\n\\n\\\n    float x = length(gl_FragCoord.xy - center) / radius;\\n\\\n    float t = smoothstep(0.5, 0.8, x);\\n\\\n    out_FragColor = mix(color0 + color1, color1, t);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\n\\n\\\nuniform float avgLuminance;\\n\\\nuniform float threshold;\\n\\\nuniform float offset;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nfloat key(float avg)\\n\\\n{\\n\\\n    float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\\n\\\n    return max(0.0, guess) + 0.1;\\n\\\n}\\n\\\n\\n\\\n// See section 9. \\\"The bright-pass filter\\\" of Realtime HDR Rendering\\n\\\n// http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 color = texture(colorTexture, v_textureCoordinates);\\n\\\n    vec3 xyz = czm_RGBToXYZ(color.rgb);\\n\\\n    float luminance = xyz.r;\\n\\\n\\n\\\n    float scaledLum = key(avgLuminance) * luminance / avgLuminance;\\n\\\n    float brightLum = max(scaledLum - threshold, 0.0);\\n\\\n    float brightness = brightLum / (offset + brightLum);\\n\\\n\\n\\\n    xyz.r = brightness;\\n\\\n    out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\\n\\\n}\\n\\\n\";\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport AdditiveBlend from \"../Shaders/PostProcessStages/AdditiveBlend.js\";\nimport BrightPass from \"../Shaders/PostProcessStages/BrightPass.js\";\nimport GaussianBlur1D from \"../Shaders/PostProcessStages/GaussianBlur1D.js\";\nimport PassThrough from \"../Shaders/PostProcessStages/PassThrough.js\";\nimport PostProcessStage from \"./PostProcessStage.js\";\nimport PostProcessStageComposite from \"./PostProcessStageComposite.js\";\nimport PostProcessStageSampleMode from \"./PostProcessStageSampleMode.js\";\nimport PostProcessStageTextureCache from \"./PostProcessStageTextureCache.js\";\nimport SceneFramebuffer from \"./SceneFramebuffer.js\";\n\nfunction SunPostProcess() {\n  this._sceneFramebuffer = new SceneFramebuffer();\n\n  const scale = 0.125;\n  const stages = new Array(6);\n\n  stages[0] = new PostProcessStage({\n    fragmentShader: PassThrough,\n    textureScale: scale,\n    forcePowerOfTwo: true,\n    sampleMode: PostProcessStageSampleMode.LINEAR,\n  });\n\n  const brightPass = (stages[1] = new PostProcessStage({\n    fragmentShader: BrightPass,\n    uniforms: {\n      avgLuminance: 0.5, // A guess at the average luminance across the entire scene\n      threshold: 0.25,\n      offset: 0.1,\n    },\n    textureScale: scale,\n    forcePowerOfTwo: true,\n  }));\n\n  const that = this;\n  this._delta = 1.0;\n  this._sigma = 2.0;\n  this._blurStep = new Cartesian2();\n\n  stages[2] = new PostProcessStage({\n    fragmentShader: GaussianBlur1D,\n    uniforms: {\n      step: function () {\n        that._blurStep.x = that._blurStep.y =\n          1.0 / brightPass.outputTexture.width;\n        return that._blurStep;\n      },\n      delta: function () {\n        return that._delta;\n      },\n      sigma: function () {\n        return that._sigma;\n      },\n      direction: 0.0,\n    },\n    textureScale: scale,\n    forcePowerOfTwo: true,\n  });\n\n  stages[3] = new PostProcessStage({\n    fragmentShader: GaussianBlur1D,\n    uniforms: {\n      step: function () {\n        that._blurStep.x = that._blurStep.y =\n          1.0 / brightPass.outputTexture.width;\n        return that._blurStep;\n      },\n      delta: function () {\n        return that._delta;\n      },\n      sigma: function () {\n        return that._sigma;\n      },\n      direction: 1.0,\n    },\n    textureScale: scale,\n    forcePowerOfTwo: true,\n  });\n\n  stages[4] = new PostProcessStage({\n    fragmentShader: PassThrough,\n    sampleMode: PostProcessStageSampleMode.LINEAR,\n  });\n\n  this._uCenter = new Cartesian2();\n  this._uRadius = undefined;\n\n  stages[5] = new PostProcessStage({\n    fragmentShader: AdditiveBlend,\n    uniforms: {\n      center: function () {\n        return that._uCenter;\n      },\n      radius: function () {\n        return that._uRadius;\n      },\n      colorTexture2: function () {\n        return that._sceneFramebuffer.framebuffer.getColorTexture(0);\n      },\n    },\n  });\n\n  this._stages = new PostProcessStageComposite({\n    stages: stages,\n  });\n\n  const textureCache = new PostProcessStageTextureCache(this);\n  const length = stages.length;\n  for (let i = 0; i < length; ++i) {\n    stages[i]._textureCache = textureCache;\n  }\n\n  this._textureCache = textureCache;\n  this.length = stages.length;\n}\n\nSunPostProcess.prototype.get = function (index) {\n  return this._stages.get(index);\n};\n\nSunPostProcess.prototype.getStageByName = function (name) {\n  const length = this._stages.length;\n  for (let i = 0; i < length; ++i) {\n    const stage = this._stages.get(i);\n    if (stage.name === name) {\n      return stage;\n    }\n  }\n  return undefined;\n};\n\nconst sunPositionECScratch = new Cartesian4();\nconst sunPositionWCScratch = new Cartesian2();\nconst sizeScratch = new Cartesian2();\nconst postProcessMatrix4Scratch = new Matrix4();\n\nfunction updateSunPosition(postProcess, context, viewport) {\n  const us = context.uniformState;\n  const sunPosition = us.sunPositionWC;\n  const viewMatrix = us.view;\n  const viewProjectionMatrix = us.viewProjection;\n  const projectionMatrix = us.projection;\n\n  // create up sampled render state\n  let viewportTransformation = Matrix4.computeViewportTransformation(\n    viewport,\n    0.0,\n    1.0,\n    postProcessMatrix4Scratch\n  );\n  const sunPositionEC = Matrix4.multiplyByPoint(\n    viewMatrix,\n    sunPosition,\n    sunPositionECScratch\n  );\n  let sunPositionWC = Transforms.pointToGLWindowCoordinates(\n    viewProjectionMatrix,\n    viewportTransformation,\n    sunPosition,\n    sunPositionWCScratch\n  );\n\n  sunPositionEC.x += CesiumMath.SOLAR_RADIUS;\n  const limbWC = Transforms.pointToGLWindowCoordinates(\n    projectionMatrix,\n    viewportTransformation,\n    sunPositionEC,\n    sunPositionEC\n  );\n  const sunSize =\n    Cartesian2.magnitude(Cartesian2.subtract(limbWC, sunPositionWC, limbWC)) *\n    30.0 *\n    2.0;\n\n  const size = sizeScratch;\n  size.x = sunSize;\n  size.y = sunSize;\n\n  postProcess._uCenter = Cartesian2.clone(sunPositionWC, postProcess._uCenter);\n  postProcess._uRadius = Math.max(size.x, size.y) * 0.15;\n\n  const width = context.drawingBufferWidth;\n  const height = context.drawingBufferHeight;\n\n  const stages = postProcess._stages;\n  const firstStage = stages.get(0);\n\n  const downSampleWidth = firstStage.outputTexture.width;\n  const downSampleHeight = firstStage.outputTexture.height;\n\n  const downSampleViewport = new BoundingRectangle();\n  downSampleViewport.width = downSampleWidth;\n  downSampleViewport.height = downSampleHeight;\n\n  // create down sampled render state\n  viewportTransformation = Matrix4.computeViewportTransformation(\n    downSampleViewport,\n    0.0,\n    1.0,\n    postProcessMatrix4Scratch\n  );\n  sunPositionWC = Transforms.pointToGLWindowCoordinates(\n    viewProjectionMatrix,\n    viewportTransformation,\n    sunPosition,\n    sunPositionWCScratch\n  );\n\n  size.x *= downSampleWidth / width;\n  size.y *= downSampleHeight / height;\n\n  const scissorRectangle = firstStage.scissorRectangle;\n  scissorRectangle.x = Math.max(sunPositionWC.x - size.x * 0.5, 0.0);\n  scissorRectangle.y = Math.max(sunPositionWC.y - size.y * 0.5, 0.0);\n  scissorRectangle.width = Math.min(size.x, width);\n  scissorRectangle.height = Math.min(size.y, height);\n\n  for (let i = 1; i < 4; ++i) {\n    BoundingRectangle.clone(scissorRectangle, stages.get(i).scissorRectangle);\n  }\n}\n\nSunPostProcess.prototype.clear = function (context, passState, clearColor) {\n  this._sceneFramebuffer.clear(context, passState, clearColor);\n  this._textureCache.clear(context);\n};\n\nSunPostProcess.prototype.update = function (passState) {\n  const context = passState.context;\n  const viewport = passState.viewport;\n\n  const sceneFramebuffer = this._sceneFramebuffer;\n  sceneFramebuffer.update(context, viewport);\n  const framebuffer = sceneFramebuffer.framebuffer;\n\n  this._textureCache.update(context);\n  this._stages.update(context, false);\n\n  updateSunPosition(this, context, viewport);\n\n  return framebuffer;\n};\n\nSunPostProcess.prototype.execute = function (context) {\n  const colorTexture = this._sceneFramebuffer.framebuffer.getColorTexture(0);\n  const stages = this._stages;\n  const length = stages.length;\n  stages.get(0).execute(context, colorTexture);\n  for (let i = 1; i < length; ++i) {\n    stages.get(i).execute(context, stages.get(i - 1).outputTexture);\n  }\n};\n\nSunPostProcess.prototype.copy = function (context, framebuffer) {\n  if (!defined(this._copyColorCommand)) {\n    const that = this;\n    this._copyColorCommand = context.createViewportQuadCommand(PassThrough, {\n      uniformMap: {\n        colorTexture: function () {\n          return that._stages.get(that._stages.length - 1).outputTexture;\n        },\n      },\n      owner: this,\n    });\n  }\n\n  this._copyColorCommand.framebuffer = framebuffer;\n  this._copyColorCommand.execute(context);\n};\n\nSunPostProcess.prototype.isDestroyed = function () {\n  return false;\n};\n\nSunPostProcess.prototype.destroy = function () {\n  this._textureCache.destroy();\n  this._stages.destroy();\n  return destroyObject(this);\n};\nexport default SunPostProcess;\n", "import Color from \"../Core/Color.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * @private\n */\nfunction DebugInspector() {\n  this._cachedShowFrustumsShaders = {};\n}\n\nfunction getAttributeLocations(shaderProgram) {\n  const attributeLocations = {};\n  const attributes = shaderProgram.vertexAttributes;\n  for (const a in attributes) {\n    if (attributes.hasOwnProperty(a)) {\n      attributeLocations[a] = attributes[a].index;\n    }\n  }\n\n  return attributeLocations;\n}\n\nfunction createDebugShowFrustumsShaderProgram(scene, shaderProgram) {\n  const context = scene.context;\n  const sp = shaderProgram;\n  const fs = sp.fragmentShaderSource.clone();\n\n  const targets = [];\n  fs.sources = fs.sources.map(function (source) {\n    source = ShaderSource.replaceMain(source, \"czm_Debug_main\");\n    const re = /out_FragData_(\\d+)/g;\n    let match;\n    while ((match = re.exec(source)) !== null) {\n      if (targets.indexOf(match[1]) === -1) {\n        targets.push(match[1]);\n      }\n    }\n    return source;\n  });\n  const length = targets.length;\n\n  let newMain = \"\";\n  newMain += \"uniform vec3 debugShowCommandsColor;\\n\";\n  newMain += \"uniform vec3 debugShowFrustumsColor;\\n\";\n  newMain += \"void main() \\n\" + \"{ \\n\" + \"    czm_Debug_main(); \\n\";\n\n  // set debugShowCommandsColor to Color(1.0, 1.0, 1.0, 1.0) to stop rendering scene.debugShowCommands\n  // set debugShowFrustumsColor to Color(1.0, 1.0, 1.0, 1.0) to stop rendering scene.debugShowFrustums\n  let i;\n  if (length > 0) {\n    for (i = 0; i < length; ++i) {\n      newMain += `    out_FragData_${targets[i]}.rgb *= debugShowCommandsColor;\\n`;\n      newMain += `    out_FragData_${targets[i]}.rgb *= debugShowFrustumsColor;\\n`;\n    }\n  } else {\n    newMain += \"    out_FragColor.rgb *= debugShowCommandsColor;\\n\";\n    newMain += \"    out_FragColor.rgb *= debugShowFrustumsColor;\\n\";\n  }\n  newMain += \"}\";\n\n  fs.sources.push(newMain);\n\n  const attributeLocations = getAttributeLocations(sp);\n\n  return ShaderProgram.fromCache({\n    context: context,\n    vertexShaderSource: sp.vertexShaderSource,\n    fragmentShaderSource: fs,\n    attributeLocations: attributeLocations,\n  });\n}\n\nconst scratchFrustumColor = new Color();\nfunction createDebugShowFrustumsUniformMap(scene, command) {\n  // setup uniform for the shader\n  let debugUniformMap;\n  if (!defined(command.uniformMap)) {\n    debugUniformMap = {};\n  } else {\n    debugUniformMap = command.uniformMap;\n  }\n\n  if (\n    defined(debugUniformMap.debugShowCommandsColor) ||\n    defined(debugUniformMap.debugShowFrustumsColor)\n  ) {\n    return debugUniformMap;\n  }\n\n  debugUniformMap.debugShowCommandsColor = function () {\n    if (!scene.debugShowCommands) {\n      return Color.WHITE;\n    }\n\n    if (!defined(command._debugColor)) {\n      command._debugColor = Color.fromRandom();\n    }\n\n    return command._debugColor;\n  };\n\n  debugUniformMap.debugShowFrustumsColor = function () {\n    if (!scene.debugShowFrustums) {\n      return Color.WHITE;\n    }\n\n    // Support up to three frustums.  If a command overlaps all\n    // three, it's code is not changed.\n    scratchFrustumColor.red =\n      command.debugOverlappingFrustums & (1 << 0) ? 1.0 : 0.0;\n    scratchFrustumColor.green =\n      command.debugOverlappingFrustums & (1 << 1) ? 1.0 : 0.0;\n    scratchFrustumColor.blue =\n      command.debugOverlappingFrustums & (1 << 2) ? 1.0 : 0.0;\n    scratchFrustumColor.alpha = 1.0;\n    return scratchFrustumColor;\n  };\n\n  return debugUniformMap;\n}\n\nconst scratchShowFrustumCommand = new DrawCommand();\nDebugInspector.prototype.executeDebugShowFrustumsCommand = function (\n  scene,\n  command,\n  passState\n) {\n  // create debug command\n  const shaderProgramId = command.shaderProgram.id;\n  let debugShaderProgram = this._cachedShowFrustumsShaders[shaderProgramId];\n  if (!defined(debugShaderProgram)) {\n    debugShaderProgram = createDebugShowFrustumsShaderProgram(\n      scene,\n      command.shaderProgram\n    );\n\n    this._cachedShowFrustumsShaders[shaderProgramId] = debugShaderProgram;\n  }\n\n  const debugCommand = DrawCommand.shallowClone(\n    command,\n    scratchShowFrustumCommand\n  );\n  debugCommand.shaderProgram = debugShaderProgram;\n  debugCommand.uniformMap = createDebugShowFrustumsUniformMap(scene, command);\n  debugCommand.execute(scene.context, passState);\n};\nexport default DebugInspector;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport BoxGeometry from \"../Core/BoxGeometry.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport CullingVolume from \"../Core/CullingVolume.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EllipsoidGeometry from \"../Core/EllipsoidGeometry.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicProjection from \"../Core/GeographicProjection.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GeometryPipeline from \"../Core/GeometryPipeline.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport mergeSort from \"../Core/mergeSort.js\";\nimport Occluder from \"../Core/Occluder.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport PerspectiveFrustum from \"../Core/PerspectiveFrustum.js\";\nimport PerspectiveOffCenterFrustum from \"../Core/PerspectiveOffCenterFrustum.js\";\nimport RequestScheduler from \"../Core/RequestScheduler.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport ComputeEngine from \"../Renderer/ComputeEngine.js\";\nimport Context from \"../Renderer/Context.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport BrdfLutGenerator from \"./BrdfLutGenerator.js\";\nimport Camera from \"./Camera.js\";\nimport Cesium3DTilePass from \"./Cesium3DTilePass.js\";\nimport Cesium3DTilePassState from \"./Cesium3DTilePassState.js\";\nimport CreditDisplay from \"./CreditDisplay.js\";\nimport DebugCameraPrimitive from \"./DebugCameraPrimitive.js\";\nimport DepthPlane from \"./DepthPlane.js\";\nimport DerivedCommand from \"./DerivedCommand.js\";\nimport DeviceOrientationCameraController from \"./DeviceOrientationCameraController.js\";\nimport Fog from \"./Fog.js\";\nimport FrameState from \"./FrameState.js\";\nimport GlobeTranslucencyState from \"./GlobeTranslucencyState.js\";\nimport InvertClassification from \"./InvertClassification.js\";\nimport JobScheduler from \"./JobScheduler.js\";\nimport MapMode2D from \"./MapMode2D.js\";\nimport OctahedralProjectedCubeMap from \"./OctahedralProjectedCubeMap.js\";\nimport PerformanceDisplay from \"./PerformanceDisplay.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Picking from \"./Picking.js\";\nimport PostProcessStageCollection from \"./PostProcessStageCollection.js\";\nimport Primitive from \"./Primitive.js\";\nimport PrimitiveCollection from \"./PrimitiveCollection.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport SceneTransforms from \"./SceneTransforms.js\";\nimport SceneTransitioner from \"./SceneTransitioner.js\";\nimport ScreenSpaceCameraController from \"./ScreenSpaceCameraController.js\";\nimport ShadowMap from \"./ShadowMap.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport SunLight from \"./SunLight.js\";\nimport SunPostProcess from \"./SunPostProcess.js\";\nimport TweenCollection from \"./TweenCollection.js\";\nimport View from \"./View.js\";\nimport DebugInspector from \"./DebugInspector.js\";\n\nconst requestRenderAfterFrame = function (scene) {\n  return function () {\n    scene.frameState.afterRender.push(function () {\n      scene.requestRender();\n    });\n  };\n};\n\n/**\n * The container for all 3D graphical objects and state in a Cesium virtual scene.  Generally,\n * a scene is not created directly; instead, it is implicitly created by {@link CesiumWidget}.\n *\n * @alias Scene\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {HTMLCanvasElement} options.canvas The HTML canvas element to create the scene for.\n * @param {ContextOptions} [options.contextOptions] Context and WebGL creation properties.\n * @param {Element} [options.creditContainer] The HTML element in which the credits will be displayed.\n * @param {Element} [options.creditViewport] The HTML element in which to display the credit popup.  If not specified, the viewport will be a added as a sibling of the canvas.\n * @param {MapProjection} [options.mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes.\n * @param {boolean} [options.orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency.\n * @param {boolean} [options.scene3DOnly=false] If true, optimizes memory use and performance for 3D mode but disables the ability to use 2D or Columbus View.\n * @param {boolean} [options.shadows=false] Determines if shadows are cast by light sources.\n * @param {MapMode2D} [options.mapMode2D=MapMode2D.INFINITE_SCROLL] Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.\n * @param {boolean} [options.requestRenderMode=false] If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.\n * @param {number} [options.maximumRenderTimeChange=0.0] If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.\n * @param {number} [options.depthPlaneEllipsoidOffset=0.0] Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation.\n * @param {number} [options.msaaSamples=1] If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.\n *\n * @see CesiumWidget\n * @see {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}\n *\n * @exception {DeveloperError} options and options.canvas are required.\n *\n * @example\n * // Create scene without anisotropic texture filtering\n * const scene = new Cesium.Scene({\n *   canvas : canvas,\n *   contextOptions : {\n *     allowTextureFilterAnisotropic : false\n *   }\n * });\n */\nfunction Scene(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const canvas = options.canvas;\n  let creditContainer = options.creditContainer;\n  let creditViewport = options.creditViewport;\n\n  const contextOptions = clone(options.contextOptions);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(canvas)) {\n    throw new DeveloperError(\"options and options.canvas are required.\");\n  }\n  //>>includeEnd('debug');\n  const hasCreditContainer = defined(creditContainer);\n  const context = new Context(canvas, contextOptions);\n  if (!hasCreditContainer) {\n    creditContainer = document.createElement(\"div\");\n    creditContainer.style.position = \"absolute\";\n    creditContainer.style.bottom = \"0\";\n    creditContainer.style[\"text-shadow\"] = \"0 0 2px #000000\";\n    creditContainer.style.color = \"#ffffff\";\n    creditContainer.style[\"font-size\"] = \"10px\";\n    creditContainer.style[\"padding-right\"] = \"5px\";\n    canvas.parentNode.appendChild(creditContainer);\n  }\n  if (!defined(creditViewport)) {\n    creditViewport = canvas.parentNode;\n  }\n\n  this._id = createGuid();\n  this._jobScheduler = new JobScheduler();\n  this._frameState = new FrameState(\n    context,\n    new CreditDisplay(creditContainer, \" \u2022 \", creditViewport),\n    this._jobScheduler\n  );\n  this._frameState.scene3DOnly = defaultValue(options.scene3DOnly, false);\n  this._removeCreditContainer = !hasCreditContainer;\n  this._creditContainer = creditContainer;\n\n  this._canvas = canvas;\n  this._context = context;\n  this._computeEngine = new ComputeEngine(context);\n  this._globe = undefined;\n  this._globeTranslucencyState = new GlobeTranslucencyState();\n  this._primitives = new PrimitiveCollection();\n  this._groundPrimitives = new PrimitiveCollection();\n\n  this._globeHeight = undefined;\n  this._cameraUnderground = false;\n\n  this._logDepthBuffer = context.fragmentDepth;\n  this._logDepthBufferDirty = true;\n\n  this._tweens = new TweenCollection();\n\n  this._shaderFrameCount = 0;\n\n  this._sunPostProcess = undefined;\n\n  this._computeCommandList = [];\n  this._overlayCommandList = [];\n\n  this._useOIT = defaultValue(options.orderIndependentTranslucency, true);\n  this._executeOITFunction = undefined;\n\n  this._depthPlane = new DepthPlane(options.depthPlaneEllipsoidOffset);\n\n  this._clearColorCommand = new ClearCommand({\n    color: new Color(),\n    stencil: 0,\n    owner: this,\n  });\n  this._depthClearCommand = new ClearCommand({\n    depth: 1.0,\n    owner: this,\n  });\n  this._stencilClearCommand = new ClearCommand({\n    stencil: 0,\n  });\n  this._classificationStencilClearCommand = new ClearCommand({\n    stencil: 0,\n    renderState: RenderState.fromCache({\n      stencilMask: StencilConstants.CLASSIFICATION_MASK,\n    }),\n  });\n\n  this._depthOnlyRenderStateCache = {};\n\n  this._transitioner = new SceneTransitioner(this);\n\n  this._preUpdate = new Event();\n  this._postUpdate = new Event();\n\n  this._renderError = new Event();\n  this._preRender = new Event();\n  this._postRender = new Event();\n\n  this._minimumDisableDepthTestDistance = 0.0;\n  this._debugInspector = new DebugInspector();\n\n  this._msaaSamples = defaultValue(options.msaaSamples, 1);\n\n  /**\n   * Exceptions occurring in <code>render</code> are always caught in order to raise the\n   * <code>renderError</code> event.  If this property is true, the error is rethrown\n   * after the event is raised.  If this property is false, the <code>render</code> function\n   * returns normally after raising the event.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.rethrowRenderErrors = false;\n\n  /**\n   * Determines whether or not to instantly complete the\n   * scene transition animation on user input.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.completeMorphOnUserInput = true;\n\n  /**\n   * The event fired at the beginning of a scene transition.\n   * @type {Event}\n   * @default Event()\n   */\n  this.morphStart = new Event();\n\n  /**\n   * The event fired at the completion of a scene transition.\n   * @type {Event}\n   * @default Event()\n   */\n  this.morphComplete = new Event();\n\n  /**\n   * The {@link SkyBox} used to draw the stars.\n   *\n   * @type {SkyBox}\n   * @default undefined\n   *\n   * @see Scene#backgroundColor\n   */\n  this.skyBox = undefined;\n\n  /**\n   * The sky atmosphere drawn around the globe.\n   *\n   * @type {SkyAtmosphere}\n   * @default undefined\n   */\n  this.skyAtmosphere = undefined;\n\n  /**\n   * The {@link Sun}.\n   *\n   * @type {Sun}\n   * @default undefined\n   */\n  this.sun = undefined;\n\n  /**\n   * Uses a bloom filter on the sun when enabled.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.sunBloom = true;\n  this._sunBloom = undefined;\n\n  /**\n   * The {@link Moon}\n   *\n   * @type Moon\n   * @default undefined\n   */\n  this.moon = undefined;\n\n  /**\n   * The background color, which is only visible if there is no sky box, i.e., {@link Scene#skyBox} is undefined.\n   *\n   * @type {Color}\n   * @default {@link Color.BLACK}\n   *\n   * @see Scene#skyBox\n   */\n  this.backgroundColor = Color.clone(Color.BLACK);\n\n  this._mode = SceneMode.SCENE3D;\n\n  this._mapProjection = defined(options.mapProjection)\n    ? options.mapProjection\n    : new GeographicProjection();\n\n  /**\n   * The current morph transition time between 2D/Columbus View and 3D,\n   * with 0.0 being 2D or Columbus View and 1.0 being 3D.\n   *\n   * @type {number}\n   * @default 1.0\n   */\n  this.morphTime = 1.0;\n\n  /**\n   * The far-to-near ratio of the multi-frustum when using a normal depth buffer.\n   * <p>\n   * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used\n   * when {@link Scene#logarithmicDepthBuffer} is <code>false</code>. When <code>logarithmicDepthBuffer</code> is\n   * <code>true</code>, use {@link Scene#logarithmicDepthFarToNearRatio}.\n   * </p>\n   *\n   * @type {number}\n   * @default 1000.0\n   */\n  this.farToNearRatio = 1000.0;\n\n  /**\n   * The far-to-near ratio of the multi-frustum when using a logarithmic depth buffer.\n   * <p>\n   * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used\n   * when {@link Scene#logarithmicDepthBuffer} is <code>true</code>. When <code>logarithmicDepthBuffer</code> is\n   * <code>false</code>, use {@link Scene#farToNearRatio}.\n   * </p>\n   *\n   * @type {number}\n   * @default 1e9\n   */\n  this.logarithmicDepthFarToNearRatio = 1e9;\n\n  /**\n   * Determines the uniform depth size in meters of each frustum of the multifrustum in 2D. If a primitive or model close\n   * to the surface shows z-fighting, decreasing this will eliminate the artifact, but decrease performance. On the\n   * other hand, increasing this will increase performance but may cause z-fighting among primitives close to the surface.\n   *\n   * @type {number}\n   * @default 1.75e6\n   */\n  this.nearToFarDistance2D = 1.75e6;\n\n  /**\n   * The vertical exaggeration of the scene.\n   * When set to 1.0, no exaggeration is applied.\n   *\n   * @type {number}\n   * @default 1.0\n   */\n  this.verticalExaggeration = 1.0;\n\n  /**\n   * The reference height for vertical exaggeration of the scene.\n   * When set to 0.0, the exaggeration is applied relative to the ellipsoid surface.\n   *\n   * @type {number}\n   * @default 0.0\n   */\n  this.verticalExaggerationRelativeHeight = 0.0;\n\n  /**\n   * This property is for debugging only; it is not for production use.\n   * <p>\n   * A function that determines what commands are executed.  As shown in the examples below,\n   * the function receives the command's <code>owner</code> as an argument, and returns a boolean indicating if the\n   * command should be executed.\n   * </p>\n   * <p>\n   * The default is <code>undefined</code>, indicating that all commands are executed.\n   * </p>\n   *\n   * @type Function\n   *\n   * @default undefined\n   *\n   * @example\n   * // Do not execute any commands.\n   * scene.debugCommandFilter = function(command) {\n   *     return false;\n   * };\n   *\n   * // Execute only the billboard's commands.  That is, only draw the billboard.\n   * const billboards = new Cesium.BillboardCollection();\n   * scene.debugCommandFilter = function(command) {\n   *     return command.owner === billboards;\n   * };\n   */\n  this.debugCommandFilter = undefined;\n\n  /**\n   * This property is for debugging only; it is not for production use.\n   * <p>\n   * When <code>true</code>, commands are randomly shaded.  This is useful\n   * for performance analysis to see what parts of a scene or model are\n   * command-dense and could benefit from batching.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowCommands = false;\n\n  /**\n   * This property is for debugging only; it is not for production use.\n   * <p>\n   * When <code>true</code>, commands are shaded based on the frustums they\n   * overlap.  Commands in the closest frustum are tinted red, commands in\n   * the next closest are green, and commands in the farthest frustum are\n   * blue.  If a command overlaps more than one frustum, the color components\n   * are combined, e.g., a command overlapping the first two frustums is tinted\n   * yellow.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowFrustums = false;\n\n  /**\n   * This property is for debugging only; it is not for production use.\n   * <p>\n   * Displays frames per second and time between frames.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowFramesPerSecond = false;\n\n  /**\n   * This property is for debugging only; it is not for production use.\n   * <p>\n   * Indicates which frustum will have depth information displayed.\n   * </p>\n   *\n   * @type {number}\n   *\n   * @default 1\n   */\n  this.debugShowDepthFrustum = 1;\n\n  /**\n   * This property is for debugging only; it is not for production use.\n   * <p>\n   * When <code>true</code>, draws outlines to show the boundaries of the camera frustums\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugShowFrustumPlanes = false;\n  this._debugShowFrustumPlanes = false;\n  this._debugFrustumPlanes = undefined;\n\n  /**\n   * When <code>true</code>, enables picking using the depth buffer.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.useDepthPicking = true;\n\n  /**\n   * When <code>true</code>, enables picking translucent geometry using the depth buffer. Note that {@link Scene#useDepthPicking} must also be true for enabling this to work.\n   *\n   * <p>\n   * There is a decrease in performance when enabled. There are extra draw calls to write depth for\n   * translucent geometry.\n   * </p>\n   *\n   * @example\n   * // picking the position of a translucent primitive\n   * viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {\n   *      const pickedFeature = viewer.scene.pick(movement.position);\n   *      if (!Cesium.defined(pickedFeature)) {\n   *          // nothing picked\n   *          return;\n   *      }\n   *      const worldPosition = viewer.scene.pickPosition(movement.position);\n   * }, Cesium.ScreenSpaceEventType.LEFT_CLICK);\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.pickTranslucentDepth = false;\n\n  /**\n   * The time in milliseconds to wait before checking if the camera has not moved and fire the cameraMoveEnd event.\n   * @type {number}\n   * @default 500.0\n   * @private\n   */\n  this.cameraEventWaitTime = 500.0;\n\n  /**\n   * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional\n   * performance improvements by rendering less geometry and dispatching less terrain requests.\n   * @type {Fog}\n   */\n  this.fog = new Fog();\n\n  this._shadowMapCamera = new Camera(this);\n\n  /**\n   * The shadow map for the scene's light source. When enabled, models, primitives, and the globe may cast and receive shadows.\n   * @type {ShadowMap}\n   */\n  this.shadowMap = new ShadowMap({\n    context: context,\n    lightCamera: this._shadowMapCamera,\n    enabled: defaultValue(options.shadows, false),\n  });\n\n  /**\n   * When <code>false</code>, 3D Tiles will render normally. When <code>true</code>, classified 3D Tile geometry will render normally and\n   * unclassified 3D Tile geometry will render with the color multiplied by {@link Scene#invertClassificationColor}.\n   * @type {boolean}\n   * @default false\n   */\n  this.invertClassification = false;\n\n  /**\n   * The highlight color of unclassified 3D Tile geometry when {@link Scene#invertClassification} is <code>true</code>.\n   * <p>When the color's alpha is less than 1.0, the unclassified portions of the 3D Tiles will not blend correctly with the classified positions of the 3D Tiles.</p>\n   * <p>Also, when the color's alpha is less than 1.0, the WEBGL_depth_texture and EXT_frag_depth WebGL extensions must be supported.</p>\n   * @type {Color}\n   * @default Color.WHITE\n   */\n  this.invertClassificationColor = Color.clone(Color.WHITE);\n\n  this._actualInvertClassificationColor = Color.clone(\n    this._invertClassificationColor\n  );\n  this._invertClassification = new InvertClassification();\n\n  /**\n   * The focal length for use when with cardboard or WebVR.\n   * @type {number}\n   */\n  this.focalLength = undefined;\n\n  /**\n   * The eye separation distance in meters for use with cardboard or WebVR.\n   * @type {number}\n   */\n  this.eyeSeparation = undefined;\n\n  /**\n   * Post processing effects applied to the final render.\n   * @type {PostProcessStageCollection}\n   */\n  this.postProcessStages = new PostProcessStageCollection();\n\n  this._brdfLutGenerator = new BrdfLutGenerator();\n\n  this._performanceDisplay = undefined;\n  this._debugVolume = undefined;\n\n  this._screenSpaceCameraController = new ScreenSpaceCameraController(this);\n  this._cameraUnderground = false;\n  this._mapMode2D = defaultValue(options.mapMode2D, MapMode2D.INFINITE_SCROLL);\n\n  // Keeps track of the state of a frame. FrameState is the state across\n  // the primitives of the scene. This state is for internally keeping track\n  // of celestial and environment effects that need to be updated/rendered in\n  // a certain order as well as updating/tracking framebuffer usage.\n  this._environmentState = {\n    skyBoxCommand: undefined,\n    skyAtmosphereCommand: undefined,\n    sunDrawCommand: undefined,\n    sunComputeCommand: undefined,\n    moonCommand: undefined,\n\n    isSunVisible: false,\n    isMoonVisible: false,\n    isReadyForAtmosphere: false,\n    isSkyAtmosphereVisible: false,\n\n    clearGlobeDepth: false,\n    useDepthPlane: false,\n    renderTranslucentDepthForPick: false,\n\n    originalFramebuffer: undefined,\n    useGlobeDepthFramebuffer: false,\n    useOIT: false,\n    useInvertClassification: false,\n    usePostProcess: false,\n    usePostProcessSelected: false,\n    useWebVR: false,\n  };\n\n  this._useWebVR = false;\n  this._cameraVR = undefined;\n  this._aspectRatioVR = undefined;\n\n  /**\n   * When <code>true</code>, rendering a frame will only occur when needed as determined by changes within the scene.\n   * Enabling improves performance of the application, but requires using {@link Scene#requestRender}\n   * to render a new frame explicitly in this mode. This will be necessary in many cases after making changes\n   * to the scene in other parts of the API.\n   *\n   * @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}\n   * @see Scene#maximumRenderTimeChange\n   * @see Scene#requestRender\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.requestRenderMode = defaultValue(options.requestRenderMode, false);\n  this._renderRequested = true;\n\n  /**\n   * If {@link Scene#requestRenderMode} is <code>true</code>, this value defines the maximum change in\n   * simulation time allowed before a render is requested. Lower values increase the number of frames rendered\n   * and higher values decrease the number of frames rendered. If <code>undefined</code>, changes to\n   * the simulation time will never request a render.\n   * This value impacts the rate of rendering for changes in the scene like lighting, entity property updates,\n   * and animations.\n   *\n   * @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}\n   * @see Scene#requestRenderMode\n   *\n   * @type {number}\n   * @default 0.0\n   */\n  this.maximumRenderTimeChange = defaultValue(\n    options.maximumRenderTimeChange,\n    0.0\n  );\n  this._lastRenderTime = undefined;\n  this._frameRateMonitor = undefined;\n\n  this._removeRequestListenerCallback = RequestScheduler.requestCompletedEvent.addEventListener(\n    requestRenderAfterFrame(this)\n  );\n  this._removeTaskProcessorListenerCallback = TaskProcessor.taskCompletedEvent.addEventListener(\n    requestRenderAfterFrame(this)\n  );\n  this._removeGlobeCallbacks = [];\n  this._removeTerrainProviderReadyListener = undefined;\n\n  const viewport = new BoundingRectangle(\n    0,\n    0,\n    context.drawingBufferWidth,\n    context.drawingBufferHeight\n  );\n  const camera = new Camera(this);\n\n  if (this._logDepthBuffer) {\n    camera.frustum.near = 0.1;\n    camera.frustum.far = 10000000000.0;\n  }\n\n  /**\n   * The camera view for the scene camera flight destination. Used for preloading flight destination tiles.\n   * @type {Camera}\n   * @private\n   */\n  this.preloadFlightCamera = new Camera(this);\n\n  /**\n   * The culling volume for the scene camera flight destination. Used for preloading flight destination tiles.\n   * @type {CullingVolume}\n   * @private\n   */\n  this.preloadFlightCullingVolume = undefined;\n\n  this._picking = new Picking(this);\n  this._defaultView = new View(this, camera, viewport);\n  this._view = this._defaultView;\n\n  this._hdr = undefined;\n  this._hdrDirty = undefined;\n  this.highDynamicRange = false;\n  this.gamma = 2.2;\n\n  /**\n   * The spherical harmonic coefficients for image-based lighting of PBR models.\n   * @type {Cartesian3[]}\n   */\n  this.sphericalHarmonicCoefficients = undefined;\n\n  /**\n   * The url to the KTX2 file containing the specular environment map and convoluted mipmaps for image-based lighting of PBR models.\n   * @type {string}\n   */\n  this.specularEnvironmentMaps = undefined;\n  this._specularEnvironmentMapAtlas = undefined;\n\n  /**\n   * The light source for shading. Defaults to a directional light from the Sun.\n   * @type {Light}\n   */\n  this.light = new SunLight();\n\n  // Give frameState, camera, and screen space camera controller initial state before rendering\n  updateFrameNumber(this, 0.0, JulianDate.now());\n  this.updateFrameState();\n  this.initializeFrame();\n}\n\nfunction updateGlobeListeners(scene, globe) {\n  for (let i = 0; i < scene._removeGlobeCallbacks.length; ++i) {\n    scene._removeGlobeCallbacks[i]();\n  }\n  scene._removeGlobeCallbacks.length = 0;\n\n  const removeGlobeCallbacks = [];\n  if (defined(globe)) {\n    removeGlobeCallbacks.push(\n      globe.imageryLayersUpdatedEvent.addEventListener(\n        requestRenderAfterFrame(scene)\n      )\n    );\n    removeGlobeCallbacks.push(\n      globe.terrainProviderChanged.addEventListener(\n        requestRenderAfterFrame(scene)\n      )\n    );\n  }\n  scene._removeGlobeCallbacks = removeGlobeCallbacks;\n}\n\nObject.defineProperties(Scene.prototype, {\n  /**\n   * Gets the canvas element to which this scene is bound.\n   * @memberof Scene.prototype\n   *\n   * @type {HTMLCanvasElement}\n   * @readonly\n   */\n  canvas: {\n    get: function () {\n      return this._canvas;\n    },\n  },\n\n  /**\n   * The drawingBufferHeight of the underlying GL context.\n   * @memberof Scene.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @see {@link https://www.khronos.org/registry/webgl/specs/1.0/#DOM-WebGLRenderingContext-drawingBufferHeight|drawingBufferHeight}\n   */\n  drawingBufferHeight: {\n    get: function () {\n      return this._context.drawingBufferHeight;\n    },\n  },\n\n  /**\n   * The drawingBufferWidth of the underlying GL context.\n   * @memberof Scene.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @see {@link https://www.khronos.org/registry/webgl/specs/1.0/#DOM-WebGLRenderingContext-drawingBufferWidth|drawingBufferWidth}\n   */\n  drawingBufferWidth: {\n    get: function () {\n      return this._context.drawingBufferWidth;\n    },\n  },\n\n  /**\n   * The maximum aliased line width, in pixels, supported by this WebGL implementation.  It will be at least one.\n   * @memberof Scene.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALIASED_LINE_WIDTH_RANGE</code>.\n   */\n  maximumAliasedLineWidth: {\n    get: function () {\n      return ContextLimits.maximumAliasedLineWidth;\n    },\n  },\n\n  /**\n   * The maximum length in pixels of one edge of a cube map, supported by this WebGL implementation.  It will be at least 16.\n   * @memberof Scene.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>GL_MAX_CUBE_MAP_TEXTURE_SIZE</code>.\n   */\n  maximumCubeMapSize: {\n    get: function () {\n      return ContextLimits.maximumCubeMapSize;\n    },\n  },\n\n  /**\n   * Returns <code>true</code> if the {@link Scene#pickPosition} function is supported.\n   * @memberof Scene.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @see Scene#pickPosition\n   */\n  pickPositionSupported: {\n    get: function () {\n      return this._context.depthTexture;\n    },\n  },\n\n  /**\n   * Returns <code>true</code> if the {@link Scene#sampleHeight} and {@link Scene#sampleHeightMostDetailed} functions are supported.\n   * @memberof Scene.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @see Scene#sampleHeight\n   * @see Scene#sampleHeightMostDetailed\n   */\n  sampleHeightSupported: {\n    get: function () {\n      return this._context.depthTexture;\n    },\n  },\n\n  /**\n   * Returns <code>true</code> if the {@link Scene#clampToHeight} and {@link Scene#clampToHeightMostDetailed} functions are supported.\n   * @memberof Scene.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @see Scene#clampToHeight\n   * @see Scene#clampToHeightMostDetailed\n   */\n  clampToHeightSupported: {\n    get: function () {\n      return this._context.depthTexture;\n    },\n  },\n\n  /**\n   * Returns <code>true</code> if the {@link Scene#invertClassification} is supported.\n   * @memberof Scene.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @see Scene#invertClassification\n   */\n  invertClassificationSupported: {\n    get: function () {\n      return this._context.depthTexture;\n    },\n  },\n\n  /**\n   * Returns <code>true</code> if specular environment maps are supported.\n   * @memberof Scene.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @see Scene#specularEnvironmentMaps\n   */\n  specularEnvironmentMapsSupported: {\n    get: function () {\n      return OctahedralProjectedCubeMap.isSupported(this._context);\n    },\n  },\n\n  /**\n   * Gets or sets the depth-test ellipsoid.\n   * @memberof Scene.prototype\n   *\n   * @type {Globe}\n   */\n  globe: {\n    get: function () {\n      return this._globe;\n    },\n\n    set: function (globe) {\n      this._globe = this._globe && this._globe.destroy();\n      this._globe = globe;\n\n      updateGlobeListeners(this, globe);\n    },\n  },\n\n  /**\n   * Gets the collection of primitives.\n   * @memberof Scene.prototype\n   *\n   * @type {PrimitiveCollection}\n   * @readonly\n   */\n  primitives: {\n    get: function () {\n      return this._primitives;\n    },\n  },\n\n  /**\n   * Gets the collection of ground primitives.\n   * @memberof Scene.prototype\n   *\n   * @type {PrimitiveCollection}\n   * @readonly\n   */\n  groundPrimitives: {\n    get: function () {\n      return this._groundPrimitives;\n    },\n  },\n\n  /**\n   * Gets or sets the camera.\n   * @memberof Scene.prototype\n   *\n   * @type {Camera}\n   * @readonly\n   */\n  camera: {\n    get: function () {\n      return this._view.camera;\n    },\n    set: function (camera) {\n      // For internal use only. Documentation is still @readonly.\n      this._view.camera = camera;\n    },\n  },\n\n  /**\n   * Gets or sets the view.\n   * @memberof Scene.prototype\n   *\n   * @type {View}\n   * @readonly\n   *\n   * @private\n   */\n  view: {\n    get: function () {\n      return this._view;\n    },\n    set: function (view) {\n      // For internal use only. Documentation is still @readonly.\n      this._view = view;\n    },\n  },\n\n  /**\n   * Gets the default view.\n   * @memberof Scene.prototype\n   *\n   * @type {View}\n   * @readonly\n   *\n   * @private\n   */\n  defaultView: {\n    get: function () {\n      return this._defaultView;\n    },\n  },\n\n  /**\n   * Gets picking functions and state\n   * @memberof Scene.prototype\n   *\n   * @type {Picking}\n   * @readonly\n   *\n   * @private\n   */\n  picking: {\n    get: function () {\n      return this._picking;\n    },\n  },\n\n  /**\n   * Gets the controller for camera input handling.\n   * @memberof Scene.prototype\n   *\n   * @type {ScreenSpaceCameraController}\n   * @readonly\n   */\n  screenSpaceCameraController: {\n    get: function () {\n      return this._screenSpaceCameraController;\n    },\n  },\n\n  /**\n   * Get the map projection to use in 2D and Columbus View modes.\n   * @memberof Scene.prototype\n   *\n   * @type {MapProjection}\n   * @readonly\n   *\n   * @default new GeographicProjection()\n   */\n  mapProjection: {\n    get: function () {\n      return this._mapProjection;\n    },\n  },\n\n  /**\n   * Gets the job scheduler\n   * @memberof Scene.prototype\n   * @type {JobScheduler}\n   * @readonly\n   *\n   * @private\n   */\n  jobScheduler: {\n    get: function () {\n      return this._jobScheduler;\n    },\n  },\n\n  /**\n   * Gets state information about the current scene. If called outside of a primitive's <code>update</code>\n   * function, the previous frame's state is returned.\n   * @memberof Scene.prototype\n   *\n   * @type {FrameState}\n   * @readonly\n   *\n   * @private\n   */\n  frameState: {\n    get: function () {\n      return this._frameState;\n    },\n  },\n\n  /**\n   * Gets the environment state.\n   * @memberof Scene.prototype\n   *\n   * @type {EnvironmentState}\n   * @readonly\n   *\n   * @private\n   */\n  environmentState: {\n    get: function () {\n      return this._environmentState;\n    },\n  },\n\n  /**\n   * Gets the collection of tweens taking place in the scene.\n   * @memberof Scene.prototype\n   *\n   * @type {TweenCollection}\n   * @readonly\n   *\n   * @private\n   */\n  tweens: {\n    get: function () {\n      return this._tweens;\n    },\n  },\n\n  /**\n   * Gets the collection of image layers that will be rendered on the globe.\n   * @memberof Scene.prototype\n   *\n   * @type {ImageryLayerCollection}\n   * @readonly\n   */\n  imageryLayers: {\n    get: function () {\n      if (!defined(this.globe)) {\n        return undefined;\n      }\n\n      return this.globe.imageryLayers;\n    },\n  },\n\n  /**\n   * The terrain provider providing surface geometry for the globe.\n   * @memberof Scene.prototype\n   *\n   * @type {TerrainProvider}\n   */\n  terrainProvider: {\n    get: function () {\n      if (!defined(this.globe)) {\n        return undefined;\n      }\n\n      return this.globe.terrainProvider;\n    },\n    set: function (terrainProvider) {\n      // Cancel any in-progress terrain update\n      this._removeTerrainProviderReadyListener =\n        this._removeTerrainProviderReadyListener &&\n        this._removeTerrainProviderReadyListener();\n\n      if (defined(this.globe)) {\n        this.globe.terrainProvider = terrainProvider;\n      }\n    },\n  },\n\n  /**\n   * Gets an event that's raised when the terrain provider is changed\n   * @memberof Scene.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  terrainProviderChanged: {\n    get: function () {\n      if (!defined(this.globe)) {\n        return undefined;\n      }\n\n      return this.globe.terrainProviderChanged;\n    },\n  },\n\n  /**\n   * Gets the event that will be raised before the scene is updated or rendered.  Subscribers to the event\n   * receive the Scene instance as the first parameter and the current time as the second parameter.\n   * @memberof Scene.prototype\n   *\n   * @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}\n   * @see Scene#postUpdate\n   * @see Scene#preRender\n   * @see Scene#postRender\n   *\n   * @type {Event}\n   * @readonly\n   */\n  preUpdate: {\n    get: function () {\n      return this._preUpdate;\n    },\n  },\n\n  /**\n   * Gets the event that will be raised immediately after the scene is updated and before the scene is rendered.\n   * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second\n   * parameter.\n   * @memberof Scene.prototype\n   *\n   * @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}\n   * @see Scene#preUpdate\n   * @see Scene#preRender\n   * @see Scene#postRender\n   *\n   * @type {Event}\n   * @readonly\n   */\n  postUpdate: {\n    get: function () {\n      return this._postUpdate;\n    },\n  },\n\n  /**\n   * Gets the event that will be raised when an error is thrown inside the <code>render</code> function.\n   * The Scene instance and the thrown error are the only two parameters passed to the event handler.\n   * By default, errors are not rethrown after this event is raised, but that can be changed by setting\n   * the <code>rethrowRenderErrors</code> property.\n   * @memberof Scene.prototype\n   *\n   * @type {Event}\n   * @readonly\n   */\n  renderError: {\n    get: function () {\n      return this._renderError;\n    },\n  },\n\n  /**\n   * Gets the event that will be raised after the scene is updated and immediately before the scene is rendered.\n   * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second\n   * parameter.\n   * @memberof Scene.prototype\n   *\n   * @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}\n   * @see Scene#preUpdate\n   * @see Scene#postUpdate\n   * @see Scene#postRender\n   *\n   * @type {Event}\n   * @readonly\n   */\n  preRender: {\n    get: function () {\n      return this._preRender;\n    },\n  },\n\n  /**\n   * Gets the event that will be raised immediately after the scene is rendered.  Subscribers to the event\n   * receive the Scene instance as the first parameter and the current time as the second parameter.\n   * @memberof Scene.prototype\n   *\n   * @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}\n   * @see Scene#preUpdate\n   * @see Scene#postUpdate\n   * @see Scene#postRender\n   *\n   * @type {Event}\n   * @readonly\n   */\n  postRender: {\n    get: function () {\n      return this._postRender;\n    },\n  },\n\n  /**\n   * Gets the simulation time when the scene was last rendered. Returns undefined if the scene has not yet been\n   * rendered.\n   * @memberof Scene.prototype\n   *\n   * @type {JulianDate}\n   * @readonly\n   */\n  lastRenderTime: {\n    get: function () {\n      return this._lastRenderTime;\n    },\n  },\n\n  /**\n   * @memberof Scene.prototype\n   * @private\n   * @readonly\n   */\n  context: {\n    get: function () {\n      return this._context;\n    },\n  },\n\n  /**\n   * This property is for debugging only; it is not for production use.\n   * <p>\n   * When {@link Scene.debugShowFrustums} is <code>true</code>, this contains\n   * properties with statistics about the number of command execute per frustum.\n   * <code>totalCommands</code> is the total number of commands executed, ignoring\n   * overlap. <code>commandsInFrustums</code> is an array with the number of times\n   * commands are executed redundantly, e.g., how many commands overlap two or\n   * three frustums.\n   * </p>\n   *\n   * @memberof Scene.prototype\n   *\n   * @type {object}\n   * @readonly\n   *\n   * @default undefined\n   */\n  debugFrustumStatistics: {\n    get: function () {\n      return this._view.debugFrustumStatistics;\n    },\n  },\n\n  /**\n   * Gets whether or not the scene is optimized for 3D only viewing.\n   * @memberof Scene.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  scene3DOnly: {\n    get: function () {\n      return this._frameState.scene3DOnly;\n    },\n  },\n\n  /**\n   * Gets whether or not the scene has order independent translucency enabled.\n   * Note that this only reflects the original construction option, and there are\n   * other factors that could prevent OIT from functioning on a given system configuration.\n   * @memberof Scene.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  orderIndependentTranslucency: {\n    get: function () {\n      return this._useOIT;\n    },\n  },\n\n  /**\n   * Gets the unique identifier for this scene.\n   * @memberof Scene.prototype\n   * @type {string}\n   * @readonly\n   */\n  id: {\n    get: function () {\n      return this._id;\n    },\n  },\n\n  /**\n   * Gets or sets the current mode of the scene.\n   * @memberof Scene.prototype\n   * @type {SceneMode}\n   * @default {@link SceneMode.SCENE3D}\n   */\n  mode: {\n    get: function () {\n      return this._mode;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (this.scene3DOnly && value !== SceneMode.SCENE3D) {\n        throw new DeveloperError(\n          \"Only SceneMode.SCENE3D is valid when scene3DOnly is true.\"\n        );\n      }\n      //>>includeEnd('debug');\n      if (value === SceneMode.SCENE2D) {\n        this.morphTo2D(0);\n      } else if (value === SceneMode.SCENE3D) {\n        this.morphTo3D(0);\n      } else if (value === SceneMode.COLUMBUS_VIEW) {\n        this.morphToColumbusView(0);\n        //>>includeStart('debug', pragmas.debug);\n      } else {\n        throw new DeveloperError(\n          \"value must be a valid SceneMode enumeration.\"\n        );\n        //>>includeEnd('debug');\n      }\n      this._mode = value;\n    },\n  },\n\n  /**\n   * Gets the number of frustums used in the last frame.\n   * @memberof Scene.prototype\n   * @type {FrustumCommands[]}\n   *\n   * @private\n   */\n  frustumCommandsList: {\n    get: function () {\n      return this._view.frustumCommandsList;\n    },\n  },\n\n  /**\n   * Gets the number of frustums used in the last frame.\n   * @memberof Scene.prototype\n   * @type {number}\n   *\n   * @private\n   */\n  numberOfFrustums: {\n    get: function () {\n      return this._view.frustumCommandsList.length;\n    },\n  },\n\n  /**\n   * When <code>true</code>, splits the scene into two viewports with steroscopic views for the left and right eyes.\n   * Used for cardboard and WebVR.\n   * @memberof Scene.prototype\n   * @type {boolean}\n   * @default false\n   */\n  useWebVR: {\n    get: function () {\n      return this._useWebVR;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (this.camera.frustum instanceof OrthographicFrustum) {\n        throw new DeveloperError(\n          \"VR is unsupported with an orthographic projection.\"\n        );\n      }\n      //>>includeEnd('debug');\n      this._useWebVR = value;\n      if (this._useWebVR) {\n        this._frameState.creditDisplay.container.style.visibility = \"hidden\";\n        this._cameraVR = new Camera(this);\n        if (!defined(this._deviceOrientationCameraController)) {\n          this._deviceOrientationCameraController = new DeviceOrientationCameraController(\n            this\n          );\n        }\n\n        this._aspectRatioVR = this.camera.frustum.aspectRatio;\n      } else {\n        this._frameState.creditDisplay.container.style.visibility = \"visible\";\n        this._cameraVR = undefined;\n        this._deviceOrientationCameraController =\n          this._deviceOrientationCameraController &&\n          !this._deviceOrientationCameraController.isDestroyed() &&\n          this._deviceOrientationCameraController.destroy();\n\n        this.camera.frustum.aspectRatio = this._aspectRatioVR;\n        this.camera.frustum.xOffset = 0.0;\n      }\n    },\n  },\n\n  /**\n   * Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.\n   * @memberof Scene.prototype\n   * @type {MapMode2D}\n   * @readonly\n   */\n  mapMode2D: {\n    get: function () {\n      return this._mapMode2D;\n    },\n  },\n\n  /**\n   * Gets or sets the position of the splitter within the viewport.  Valid values are between 0.0 and 1.0.\n   * @memberof Scene.prototype\n   *\n   * @type {number}\n   */\n  splitPosition: {\n    get: function () {\n      return this._frameState.splitPosition;\n    },\n    set: function (value) {\n      this._frameState.splitPosition = value;\n    },\n  },\n\n  /**\n   * The distance from the camera at which to disable the depth test of billboards, labels and points\n   * to, for example, prevent clipping against terrain. When set to zero, the depth test should always\n   * be applied. When less than zero, the depth test should never be applied. Setting the disableDepthTestDistance\n   * property of a billboard, label or point will override this value.\n   * @memberof Scene.prototype\n   * @type {number}\n   * @default 0.0\n   */\n  minimumDisableDepthTestDistance: {\n    get: function () {\n      return this._minimumDisableDepthTestDistance;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(value) || value < 0.0) {\n        throw new DeveloperError(\n          \"minimumDisableDepthTestDistance must be greater than or equal to 0.0.\"\n        );\n      }\n      //>>includeEnd('debug');\n      this._minimumDisableDepthTestDistance = value;\n    },\n  },\n\n  /**\n   * Whether or not to use a logarithmic depth buffer. Enabling this option will allow for less frustums in the multi-frustum,\n   * increasing performance. This property relies on fragmentDepth being supported.\n   * @memberof Scene.prototype\n   * @type {boolean}\n   */\n  logarithmicDepthBuffer: {\n    get: function () {\n      return this._logDepthBuffer;\n    },\n    set: function (value) {\n      value = this._context.fragmentDepth && value;\n      if (this._logDepthBuffer !== value) {\n        this._logDepthBuffer = value;\n        this._logDepthBufferDirty = true;\n      }\n    },\n  },\n\n  /**\n   * The value used for gamma correction. This is only used when rendering with high dynamic range.\n   * @memberof Scene.prototype\n   * @type {number}\n   * @default 2.2\n   */\n  gamma: {\n    get: function () {\n      return this._context.uniformState.gamma;\n    },\n    set: function (value) {\n      this._context.uniformState.gamma = value;\n    },\n  },\n\n  /**\n   * Whether or not to use high dynamic range rendering.\n   * @memberof Scene.prototype\n   * @type {boolean}\n   * @default false\n   */\n  highDynamicRange: {\n    get: function () {\n      return this._hdr;\n    },\n    set: function (value) {\n      const context = this._context;\n      const hdr =\n        value &&\n        context.depthTexture &&\n        (context.colorBufferFloat || context.colorBufferHalfFloat);\n      this._hdrDirty = hdr !== this._hdr;\n      this._hdr = hdr;\n    },\n  },\n\n  /**\n   * Whether or not high dynamic range rendering is supported.\n   * @memberof Scene.prototype\n   * @type {boolean}\n   * @readonly\n   * @default true\n   */\n  highDynamicRangeSupported: {\n    get: function () {\n      const context = this._context;\n      return (\n        context.depthTexture &&\n        (context.colorBufferFloat || context.colorBufferHalfFloat)\n      );\n    },\n  },\n\n  /**\n   * Whether or not the camera is underneath the globe.\n   * @memberof Scene.prototype\n   * @type {boolean}\n   * @readonly\n   * @default false\n   */\n  cameraUnderground: {\n    get: function () {\n      return this._cameraUnderground;\n    },\n  },\n\n  /**\n   * The sample rate of multisample antialiasing (values greater than 1 enable MSAA).\n   * @memberof Scene.prototype\n   * @type {number}\n   * @default 1\n   */\n  msaaSamples: {\n    get: function () {\n      return this._msaaSamples;\n    },\n    set: function (value) {\n      value = Math.min(value, ContextLimits.maximumSamples);\n      this._msaaSamples = value;\n    },\n  },\n\n  /**\n   * Returns <code>true</code> if the Scene's context supports MSAA.\n   * @memberof Scene.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  msaaSupported: {\n    get: function () {\n      return this._context.msaa;\n    },\n  },\n\n  /**\n   * Ratio between a pixel and a density-independent pixel. Provides a standard unit of\n   * measure for real pixel measurements appropriate to a particular device.\n   *\n   * @memberof Scene.prototype\n   * @type {number}\n   * @default 1.0\n   * @private\n   */\n  pixelRatio: {\n    get: function () {\n      return this._frameState.pixelRatio;\n    },\n    set: function (value) {\n      this._frameState.pixelRatio = value;\n    },\n  },\n\n  /**\n   * @private\n   */\n  opaqueFrustumNearOffset: {\n    get: function () {\n      return 0.9999;\n    },\n  },\n\n  /**\n   * @private\n   */\n  globeHeight: {\n    get: function () {\n      return this._globeHeight;\n    },\n  },\n});\n\n/**\n * Determines if a compressed texture format is supported.\n * @param {string} format The texture format. May be the name of the format or the WebGL extension name, e.g. s3tc or WEBGL_compressed_texture_s3tc.\n * @return {boolean} Whether or not the format is supported.\n */\nScene.prototype.getCompressedTextureFormatSupported = function (format) {\n  const context = this.context;\n  return (\n    ((format === \"WEBGL_compressed_texture_s3tc\" || format === \"s3tc\") &&\n      context.s3tc) ||\n    ((format === \"WEBGL_compressed_texture_pvrtc\" || format === \"pvrtc\") &&\n      context.pvrtc) ||\n    ((format === \"WEBGL_compressed_texture_etc\" || format === \"etc\") &&\n      context.etc) ||\n    ((format === \"WEBGL_compressed_texture_etc1\" || format === \"etc1\") &&\n      context.etc1) ||\n    ((format === \"WEBGL_compressed_texture_astc\" || format === \"astc\") &&\n      context.astc) ||\n    ((format === \"EXT_texture_compression_bptc\" || format === \"bc7\") &&\n      context.bc7)\n  );\n};\n\nfunction updateDerivedCommands(scene, command, shadowsDirty) {\n  const frameState = scene._frameState;\n  const context = scene._context;\n  const oit = scene._view.oit;\n  const lightShadowMaps = frameState.shadowState.lightShadowMaps;\n  const lightShadowsEnabled = frameState.shadowState.lightShadowsEnabled;\n\n  let derivedCommands = command.derivedCommands;\n\n  if (defined(command.pickId)) {\n    derivedCommands.picking = DerivedCommand.createPickDerivedCommand(\n      scene,\n      command,\n      context,\n      derivedCommands.picking\n    );\n  }\n\n  if (!command.pickOnly) {\n    derivedCommands.depth = DerivedCommand.createDepthOnlyDerivedCommand(\n      scene,\n      command,\n      context,\n      derivedCommands.depth\n    );\n  }\n\n  derivedCommands.originalCommand = command;\n\n  if (scene._hdr) {\n    derivedCommands.hdr = DerivedCommand.createHdrCommand(\n      command,\n      context,\n      derivedCommands.hdr\n    );\n    command = derivedCommands.hdr.command;\n    derivedCommands = command.derivedCommands;\n  }\n\n  if (lightShadowsEnabled && command.receiveShadows) {\n    derivedCommands.shadows = ShadowMap.createReceiveDerivedCommand(\n      lightShadowMaps,\n      command,\n      shadowsDirty,\n      context,\n      derivedCommands.shadows\n    );\n  }\n\n  if (command.pass === Pass.TRANSLUCENT && defined(oit) && oit.isSupported()) {\n    if (lightShadowsEnabled && command.receiveShadows) {\n      derivedCommands.oit = defined(derivedCommands.oit)\n        ? derivedCommands.oit\n        : {};\n      derivedCommands.oit.shadows = oit.createDerivedCommands(\n        derivedCommands.shadows.receiveCommand,\n        context,\n        derivedCommands.oit.shadows\n      );\n    } else {\n      derivedCommands.oit = oit.createDerivedCommands(\n        command,\n        context,\n        derivedCommands.oit\n      );\n    }\n  }\n}\n\n/**\n * @private\n */\nScene.prototype.updateDerivedCommands = function (command) {\n  if (!defined(command.derivedCommands)) {\n    // Is not a DrawCommand\n    return;\n  }\n\n  const frameState = this._frameState;\n  const context = this._context;\n\n  // Update derived commands when any shadow maps become dirty\n  let shadowsDirty = false;\n  const lastDirtyTime = frameState.shadowState.lastDirtyTime;\n  if (command.lastDirtyTime !== lastDirtyTime) {\n    command.lastDirtyTime = lastDirtyTime;\n    command.dirty = true;\n    shadowsDirty = true;\n  }\n\n  const useLogDepth = frameState.useLogDepth;\n  const useHdr = this._hdr;\n  const derivedCommands = command.derivedCommands;\n  const hasLogDepthDerivedCommands = defined(derivedCommands.logDepth);\n  const hasHdrCommands = defined(derivedCommands.hdr);\n  const hasDerivedCommands = defined(derivedCommands.originalCommand);\n  const needsLogDepthDerivedCommands =\n    useLogDepth && !hasLogDepthDerivedCommands;\n  const needsHdrCommands = useHdr && !hasHdrCommands;\n  const needsDerivedCommands = (!useLogDepth || !useHdr) && !hasDerivedCommands;\n  command.dirty =\n    command.dirty ||\n    needsLogDepthDerivedCommands ||\n    needsHdrCommands ||\n    needsDerivedCommands;\n\n  if (command.dirty) {\n    command.dirty = false;\n\n    const shadowMaps = frameState.shadowState.shadowMaps;\n    const shadowsEnabled = frameState.shadowState.shadowsEnabled;\n    if (shadowsEnabled && command.castShadows) {\n      derivedCommands.shadows = ShadowMap.createCastDerivedCommand(\n        shadowMaps,\n        command,\n        shadowsDirty,\n        context,\n        derivedCommands.shadows\n      );\n    }\n\n    if (hasLogDepthDerivedCommands || needsLogDepthDerivedCommands) {\n      derivedCommands.logDepth = DerivedCommand.createLogDepthCommand(\n        command,\n        context,\n        derivedCommands.logDepth\n      );\n      updateDerivedCommands(\n        this,\n        derivedCommands.logDepth.command,\n        shadowsDirty\n      );\n    }\n    if (hasDerivedCommands || needsDerivedCommands) {\n      updateDerivedCommands(this, command, shadowsDirty);\n    }\n  }\n};\n\nconst renderTilesetPassState = new Cesium3DTilePassState({\n  pass: Cesium3DTilePass.RENDER,\n});\n\nconst preloadTilesetPassState = new Cesium3DTilePassState({\n  pass: Cesium3DTilePass.PRELOAD,\n});\n\nconst preloadFlightTilesetPassState = new Cesium3DTilePassState({\n  pass: Cesium3DTilePass.PRELOAD_FLIGHT,\n});\n\nconst requestRenderModeDeferCheckPassState = new Cesium3DTilePassState({\n  pass: Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK,\n});\n\nconst scratchOccluderBoundingSphere = new BoundingSphere();\nlet scratchOccluder;\n\nfunction getOccluder(scene) {\n  // TODO: The occluder is the top-level globe. When we add\n  //       support for multiple central bodies, this should be the closest one.\n  const globe = scene.globe;\n  if (\n    scene._mode === SceneMode.SCENE3D &&\n    defined(globe) &&\n    globe.show &&\n    !scene._cameraUnderground &&\n    !scene._globeTranslucencyState.translucent\n  ) {\n    const ellipsoid = globe.ellipsoid;\n    const minimumTerrainHeight = scene.frameState.minimumTerrainHeight;\n    scratchOccluderBoundingSphere.radius =\n      ellipsoid.minimumRadius + minimumTerrainHeight;\n    scratchOccluder = Occluder.fromBoundingSphere(\n      scratchOccluderBoundingSphere,\n      scene.camera.positionWC,\n      scratchOccluder\n    );\n    return scratchOccluder;\n  }\n\n  return undefined;\n}\n\n/**\n * @private\n */\nScene.prototype.clearPasses = function (passes) {\n  passes.render = false;\n  passes.pick = false;\n  passes.depth = false;\n  passes.postProcess = false;\n  passes.offscreen = false;\n};\n\nfunction updateFrameNumber(scene, frameNumber, time) {\n  const frameState = scene._frameState;\n  frameState.frameNumber = frameNumber;\n  frameState.time = JulianDate.clone(time, frameState.time);\n}\n\n/**\n * @private\n */\nScene.prototype.updateFrameState = function () {\n  const camera = this.camera;\n\n  const frameState = this._frameState;\n  frameState.commandList.length = 0;\n  frameState.shadowMaps.length = 0;\n  frameState.brdfLutGenerator = this._brdfLutGenerator;\n  frameState.environmentMap = this.skyBox && this.skyBox._cubeMap;\n  frameState.mode = this._mode;\n  frameState.morphTime = this.morphTime;\n  frameState.mapProjection = this.mapProjection;\n  frameState.camera = camera;\n  frameState.cullingVolume = camera.frustum.computeCullingVolume(\n    camera.positionWC,\n    camera.directionWC,\n    camera.upWC\n  );\n  frameState.occluder = getOccluder(this);\n  frameState.minimumTerrainHeight = 0.0;\n  frameState.minimumDisableDepthTestDistance = this._minimumDisableDepthTestDistance;\n  frameState.invertClassification = this.invertClassification;\n  frameState.useLogDepth =\n    this._logDepthBuffer &&\n    !(\n      this.camera.frustum instanceof OrthographicFrustum ||\n      this.camera.frustum instanceof OrthographicOffCenterFrustum\n    );\n  frameState.light = this.light;\n  frameState.cameraUnderground = this._cameraUnderground;\n  frameState.globeTranslucencyState = this._globeTranslucencyState;\n\n  const { globe } = this;\n  if (defined(globe) && globe._terrainExaggerationChanged) {\n    // Honor a user-set value for the old deprecated globe.terrainExaggeration.\n    // This can be removed when Globe.terrainExaggeration is removed.\n    this.verticalExaggeration = globe._terrainExaggeration;\n    this.verticalExaggerationRelativeHeight =\n      globe._terrainExaggerationRelativeHeight;\n    globe._terrainExaggerationChanged = false;\n  }\n  frameState.verticalExaggeration = this.verticalExaggeration;\n  frameState.verticalExaggerationRelativeHeight = this.verticalExaggerationRelativeHeight;\n\n  if (\n    defined(this._specularEnvironmentMapAtlas) &&\n    this._specularEnvironmentMapAtlas.ready\n  ) {\n    frameState.specularEnvironmentMaps = this._specularEnvironmentMapAtlas.texture;\n    frameState.specularEnvironmentMapsMaximumLOD = this._specularEnvironmentMapAtlas.maximumMipmapLevel;\n  } else {\n    frameState.specularEnvironmentMaps = undefined;\n    frameState.specularEnvironmentMapsMaximumLOD = undefined;\n  }\n\n  frameState.sphericalHarmonicCoefficients = this.sphericalHarmonicCoefficients;\n\n  this._actualInvertClassificationColor = Color.clone(\n    this.invertClassificationColor,\n    this._actualInvertClassificationColor\n  );\n  if (!InvertClassification.isTranslucencySupported(this._context)) {\n    this._actualInvertClassificationColor.alpha = 1.0;\n  }\n\n  frameState.invertClassificationColor = this._actualInvertClassificationColor;\n\n  if (defined(this.globe)) {\n    frameState.maximumScreenSpaceError = this.globe.maximumScreenSpaceError;\n  } else {\n    frameState.maximumScreenSpaceError = 2;\n  }\n\n  this.clearPasses(frameState.passes);\n\n  frameState.tilesetPassState = undefined;\n};\n\n/**\n * @private\n */\nScene.prototype.isVisible = function (command, cullingVolume, occluder) {\n  return (\n    defined(command) &&\n    (!defined(command.boundingVolume) ||\n      !command.cull ||\n      (cullingVolume.computeVisibility(command.boundingVolume) !==\n        Intersect.OUTSIDE &&\n        (!defined(occluder) ||\n          !command.occlude ||\n          !command.boundingVolume.isOccluded(occluder))))\n  );\n};\n\nlet transformFrom2D = new Matrix4(\n  0.0,\n  0.0,\n  1.0,\n  0.0,\n  1.0,\n  0.0,\n  0.0,\n  0.0,\n  0.0,\n  1.0,\n  0.0,\n  0.0,\n  0.0,\n  0.0,\n  0.0,\n  1.0\n);\ntransformFrom2D = Matrix4.inverseTransformation(\n  transformFrom2D,\n  transformFrom2D\n);\n\nfunction debugShowBoundingVolume(command, scene, passState, debugFramebuffer) {\n  // Debug code to draw bounding volume for command.  Not optimized!\n  // Assumes bounding volume is a bounding sphere or box\n  const frameState = scene._frameState;\n  const context = frameState.context;\n  const boundingVolume = command.boundingVolume;\n\n  if (defined(scene._debugVolume)) {\n    scene._debugVolume.destroy();\n  }\n\n  let geometry;\n\n  let center = Cartesian3.clone(boundingVolume.center);\n  if (frameState.mode !== SceneMode.SCENE3D) {\n    center = Matrix4.multiplyByPoint(transformFrom2D, center, center);\n    const projection = frameState.mapProjection;\n    const centerCartographic = projection.unproject(center);\n    center = projection.ellipsoid.cartographicToCartesian(centerCartographic);\n  }\n\n  if (defined(boundingVolume.radius)) {\n    const radius = boundingVolume.radius;\n\n    geometry = GeometryPipeline.toWireframe(\n      EllipsoidGeometry.createGeometry(\n        new EllipsoidGeometry({\n          radii: new Cartesian3(radius, radius, radius),\n          vertexFormat: PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,\n        })\n      )\n    );\n\n    scene._debugVolume = new Primitive({\n      geometryInstances: new GeometryInstance({\n        geometry: geometry,\n        modelMatrix: Matrix4.fromTranslation(center),\n        attributes: {\n          color: new ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 1.0),\n        },\n      }),\n      appearance: new PerInstanceColorAppearance({\n        flat: true,\n        translucent: false,\n      }),\n      asynchronous: false,\n    });\n  } else {\n    const halfAxes = boundingVolume.halfAxes;\n\n    geometry = GeometryPipeline.toWireframe(\n      BoxGeometry.createGeometry(\n        BoxGeometry.fromDimensions({\n          dimensions: new Cartesian3(2.0, 2.0, 2.0),\n          vertexFormat: PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,\n        })\n      )\n    );\n\n    scene._debugVolume = new Primitive({\n      geometryInstances: new GeometryInstance({\n        geometry: geometry,\n        modelMatrix: Matrix4.fromRotationTranslation(\n          halfAxes,\n          center,\n          new Matrix4()\n        ),\n        attributes: {\n          color: new ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 1.0),\n        },\n      }),\n      appearance: new PerInstanceColorAppearance({\n        flat: true,\n        translucent: false,\n      }),\n      asynchronous: false,\n    });\n  }\n\n  const savedCommandList = frameState.commandList;\n  const commandList = (frameState.commandList = []);\n  scene._debugVolume.update(frameState);\n\n  command = commandList[0];\n\n  if (frameState.useLogDepth) {\n    const logDepth = DerivedCommand.createLogDepthCommand(command, context);\n    command = logDepth.command;\n  }\n\n  let framebuffer;\n  if (defined(debugFramebuffer)) {\n    framebuffer = passState.framebuffer;\n    passState.framebuffer = debugFramebuffer;\n  }\n\n  command.execute(context, passState);\n\n  if (defined(framebuffer)) {\n    passState.framebuffer = framebuffer;\n  }\n\n  frameState.commandList = savedCommandList;\n}\n\nfunction executeCommand(command, scene, context, passState, debugFramebuffer) {\n  const frameState = scene._frameState;\n\n  if (defined(scene.debugCommandFilter) && !scene.debugCommandFilter(command)) {\n    return;\n  }\n\n  if (command instanceof ClearCommand) {\n    command.execute(context, passState);\n    return;\n  }\n\n  if (command.debugShowBoundingVolume && defined(command.boundingVolume)) {\n    debugShowBoundingVolume(command, scene, passState, debugFramebuffer);\n  }\n\n  if (frameState.useLogDepth && defined(command.derivedCommands.logDepth)) {\n    command = command.derivedCommands.logDepth.command;\n  }\n\n  const passes = frameState.passes;\n  if (\n    !passes.pick &&\n    !passes.depth &&\n    scene._hdr &&\n    defined(command.derivedCommands) &&\n    defined(command.derivedCommands.hdr)\n  ) {\n    command = command.derivedCommands.hdr.command;\n  }\n\n  if (passes.pick || passes.depth) {\n    if (\n      passes.pick &&\n      !passes.depth &&\n      defined(command.derivedCommands.picking)\n    ) {\n      command = command.derivedCommands.picking.pickCommand;\n      command.execute(context, passState);\n      return;\n    } else if (defined(command.derivedCommands.depth)) {\n      command = command.derivedCommands.depth.depthOnlyCommand;\n      command.execute(context, passState);\n      return;\n    }\n  }\n\n  if (scene.debugShowCommands || scene.debugShowFrustums) {\n    scene._debugInspector.executeDebugShowFrustumsCommand(\n      scene,\n      command,\n      passState\n    );\n    return;\n  }\n\n  if (\n    frameState.shadowState.lightShadowsEnabled &&\n    command.receiveShadows &&\n    defined(command.derivedCommands.shadows)\n  ) {\n    // If the command receives shadows, execute the derived shadows command.\n    // Some commands, such as OIT derived commands, do not have derived shadow commands themselves\n    // and instead shadowing is built-in. In this case execute the command regularly below.\n    command.derivedCommands.shadows.receiveCommand.execute(context, passState);\n  } else {\n    command.execute(context, passState);\n  }\n}\n\nfunction executeIdCommand(command, scene, context, passState) {\n  const frameState = scene._frameState;\n  let derivedCommands = command.derivedCommands;\n  if (!defined(derivedCommands)) {\n    return;\n  }\n\n  if (frameState.useLogDepth && defined(derivedCommands.logDepth)) {\n    command = derivedCommands.logDepth.command;\n  }\n\n  derivedCommands = command.derivedCommands;\n  if (defined(derivedCommands.picking)) {\n    command = derivedCommands.picking.pickCommand;\n    command.execute(context, passState);\n  } else if (defined(derivedCommands.depth)) {\n    command = derivedCommands.depth.depthOnlyCommand;\n    command.execute(context, passState);\n  }\n}\n\nfunction backToFront(a, b, position) {\n  return (\n    b.boundingVolume.distanceSquaredTo(position) -\n    a.boundingVolume.distanceSquaredTo(position)\n  );\n}\n\nfunction frontToBack(a, b, position) {\n  // When distances are equal equal favor sorting b before a. This gives render priority to commands later in the list.\n  return (\n    a.boundingVolume.distanceSquaredTo(position) -\n    b.boundingVolume.distanceSquaredTo(position) +\n    CesiumMath.EPSILON12\n  );\n}\n\nfunction executeTranslucentCommandsBackToFront(\n  scene,\n  executeFunction,\n  passState,\n  commands,\n  invertClassification\n) {\n  const context = scene.context;\n\n  mergeSort(commands, backToFront, scene.camera.positionWC);\n\n  if (defined(invertClassification)) {\n    executeFunction(\n      invertClassification.unclassifiedCommand,\n      scene,\n      context,\n      passState\n    );\n  }\n\n  const length = commands.length;\n  for (let i = 0; i < length; ++i) {\n    executeFunction(commands[i], scene, context, passState);\n  }\n}\n\nfunction executeTranslucentCommandsFrontToBack(\n  scene,\n  executeFunction,\n  passState,\n  commands,\n  invertClassification\n) {\n  const context = scene.context;\n\n  mergeSort(commands, frontToBack, scene.camera.positionWC);\n\n  if (defined(invertClassification)) {\n    executeFunction(\n      invertClassification.unclassifiedCommand,\n      scene,\n      context,\n      passState\n    );\n  }\n\n  const length = commands.length;\n  for (let i = 0; i < length; ++i) {\n    executeFunction(commands[i], scene, context, passState);\n  }\n}\n\nfunction executeVoxelCommands(scene, executeFunction, passState, commands) {\n  const context = scene.context;\n\n  mergeSort(commands, backToFront, scene.camera.positionWC);\n\n  const length = commands.length;\n  for (let i = 0; i < length; ++i) {\n    executeFunction(commands[i], scene, context, passState);\n  }\n}\n\nconst scratchPerspectiveFrustum = new PerspectiveFrustum();\nconst scratchPerspectiveOffCenterFrustum = new PerspectiveOffCenterFrustum();\nconst scratchOrthographicFrustum = new OrthographicFrustum();\nconst scratchOrthographicOffCenterFrustum = new OrthographicOffCenterFrustum();\n\nfunction executeCommands(scene, passState) {\n  const camera = scene.camera;\n  const context = scene.context;\n  const frameState = scene.frameState;\n  const us = context.uniformState;\n\n  us.updateCamera(camera);\n\n  // Create a working frustum from the original camera frustum.\n  let frustum;\n  if (defined(camera.frustum.fov)) {\n    frustum = camera.frustum.clone(scratchPerspectiveFrustum);\n  } else if (defined(camera.frustum.infiniteProjectionMatrix)) {\n    frustum = camera.frustum.clone(scratchPerspectiveOffCenterFrustum);\n  } else if (defined(camera.frustum.width)) {\n    frustum = camera.frustum.clone(scratchOrthographicFrustum);\n  } else {\n    frustum = camera.frustum.clone(scratchOrthographicOffCenterFrustum);\n  }\n\n  // Ideally, we would render the sky box and atmosphere last for\n  // early-z, but we would have to draw it in each frustum\n  frustum.near = camera.frustum.near;\n  frustum.far = camera.frustum.far;\n  us.updateFrustum(frustum);\n  us.updatePass(Pass.ENVIRONMENT);\n\n  const passes = frameState.passes;\n  const picking = passes.pick;\n  const environmentState = scene._environmentState;\n  const view = scene._view;\n  const renderTranslucentDepthForPick =\n    environmentState.renderTranslucentDepthForPick;\n  const useWebVR = environmentState.useWebVR;\n\n  // Do not render environment primitives during a pick pass since they do not generate picking commands.\n  if (!picking) {\n    const skyBoxCommand = environmentState.skyBoxCommand;\n    if (defined(skyBoxCommand)) {\n      executeCommand(skyBoxCommand, scene, context, passState);\n    }\n\n    if (environmentState.isSkyAtmosphereVisible) {\n      executeCommand(\n        environmentState.skyAtmosphereCommand,\n        scene,\n        context,\n        passState\n      );\n    }\n\n    if (environmentState.isSunVisible) {\n      environmentState.sunDrawCommand.execute(context, passState);\n      if (scene.sunBloom && !useWebVR) {\n        let framebuffer;\n        if (environmentState.useGlobeDepthFramebuffer) {\n          framebuffer = view.globeDepth.framebuffer;\n        } else if (environmentState.usePostProcess) {\n          framebuffer = view.sceneFramebuffer.framebuffer;\n        } else {\n          framebuffer = environmentState.originalFramebuffer;\n        }\n        scene._sunPostProcess.execute(context);\n        scene._sunPostProcess.copy(context, framebuffer);\n        passState.framebuffer = framebuffer;\n      }\n    }\n\n    // Moon can be seen through the atmosphere, since the sun is rendered after the atmosphere.\n    if (environmentState.isMoonVisible) {\n      environmentState.moonCommand.execute(context, passState);\n    }\n  }\n\n  // Determine how translucent surfaces will be handled.\n  let executeTranslucentCommands;\n  if (environmentState.useOIT) {\n    if (!defined(scene._executeOITFunction)) {\n      scene._executeOITFunction = function (\n        scene,\n        executeFunction,\n        passState,\n        commands,\n        invertClassification\n      ) {\n        view.globeDepth.prepareColorTextures(context);\n        view.oit.executeCommands(\n          scene,\n          executeFunction,\n          passState,\n          commands,\n          invertClassification\n        );\n      };\n    }\n    executeTranslucentCommands = scene._executeOITFunction;\n  } else if (passes.render) {\n    executeTranslucentCommands = executeTranslucentCommandsBackToFront;\n  } else {\n    executeTranslucentCommands = executeTranslucentCommandsFrontToBack;\n  }\n\n  const frustumCommandsList = view.frustumCommandsList;\n  const numFrustums = frustumCommandsList.length;\n\n  const clearGlobeDepth = environmentState.clearGlobeDepth;\n  const useDepthPlane = environmentState.useDepthPlane;\n  const globeTranslucencyState = scene._globeTranslucencyState;\n  const globeTranslucent = globeTranslucencyState.translucent;\n  const globeTranslucencyFramebuffer = scene._view.globeTranslucencyFramebuffer;\n  const clearDepth = scene._depthClearCommand;\n  const clearStencil = scene._stencilClearCommand;\n  const clearClassificationStencil = scene._classificationStencilClearCommand;\n  const depthPlane = scene._depthPlane;\n  const usePostProcessSelected = environmentState.usePostProcessSelected;\n\n  const height2D = camera.position.z;\n\n  // Execute commands in each frustum in back to front order\n  let j;\n  for (let i = 0; i < numFrustums; ++i) {\n    const index = numFrustums - i - 1;\n    const frustumCommands = frustumCommandsList[index];\n\n    if (scene.mode === SceneMode.SCENE2D) {\n      // To avoid z-fighting in 2D, move the camera to just before the frustum\n      // and scale the frustum depth to be in [1.0, nearToFarDistance2D].\n      camera.position.z = height2D - frustumCommands.near + 1.0;\n      frustum.far = Math.max(1.0, frustumCommands.far - frustumCommands.near);\n      frustum.near = 1.0;\n      us.update(frameState);\n      us.updateFrustum(frustum);\n    } else {\n      // Avoid tearing artifacts between adjacent frustums in the opaque passes\n      frustum.near =\n        index !== 0\n          ? frustumCommands.near * scene.opaqueFrustumNearOffset\n          : frustumCommands.near;\n      frustum.far = frustumCommands.far;\n      us.updateFrustum(frustum);\n    }\n\n    clearDepth.execute(context, passState);\n\n    if (context.stencilBuffer) {\n      clearStencil.execute(context, passState);\n    }\n\n    us.updatePass(Pass.GLOBE);\n    let commands = frustumCommands.commands[Pass.GLOBE];\n    let length = frustumCommands.indices[Pass.GLOBE];\n\n    if (globeTranslucent) {\n      globeTranslucencyState.executeGlobeCommands(\n        frustumCommands,\n        executeCommand,\n        globeTranslucencyFramebuffer,\n        scene,\n        passState\n      );\n    } else {\n      for (j = 0; j < length; ++j) {\n        executeCommand(commands[j], scene, context, passState);\n      }\n    }\n\n    const globeDepth = view.globeDepth;\n    if (defined(globeDepth) && environmentState.useGlobeDepthFramebuffer) {\n      globeDepth.executeCopyDepth(context, passState);\n    }\n\n    // Draw terrain classification\n    if (!environmentState.renderTranslucentDepthForPick) {\n      us.updatePass(Pass.TERRAIN_CLASSIFICATION);\n      commands = frustumCommands.commands[Pass.TERRAIN_CLASSIFICATION];\n      length = frustumCommands.indices[Pass.TERRAIN_CLASSIFICATION];\n\n      if (globeTranslucent) {\n        globeTranslucencyState.executeGlobeClassificationCommands(\n          frustumCommands,\n          executeCommand,\n          globeTranslucencyFramebuffer,\n          scene,\n          passState\n        );\n      } else {\n        for (j = 0; j < length; ++j) {\n          executeCommand(commands[j], scene, context, passState);\n        }\n      }\n    }\n\n    if (clearGlobeDepth) {\n      clearDepth.execute(context, passState);\n      if (useDepthPlane) {\n        depthPlane.execute(context, passState);\n      }\n    }\n\n    if (\n      !environmentState.useInvertClassification ||\n      picking ||\n      environmentState.renderTranslucentDepthForPick\n    ) {\n      // Common/fastest path. Draw 3D Tiles and classification normally.\n\n      // Draw 3D Tiles\n      us.updatePass(Pass.CESIUM_3D_TILE);\n      commands = frustumCommands.commands[Pass.CESIUM_3D_TILE];\n      length = frustumCommands.indices[Pass.CESIUM_3D_TILE];\n      for (j = 0; j < length; ++j) {\n        executeCommand(commands[j], scene, context, passState);\n      }\n\n      if (length > 0) {\n        if (defined(globeDepth) && environmentState.useGlobeDepthFramebuffer) {\n          // When clearGlobeDepth is true, executeUpdateDepth needs\n          // a globe depth texture with resolved stencil bits.\n          globeDepth.prepareColorTextures(context, clearGlobeDepth);\n          globeDepth.executeUpdateDepth(\n            context,\n            passState,\n            clearGlobeDepth,\n            globeDepth.depthStencilTexture\n          );\n        }\n\n        // Draw classifications. Modifies 3D Tiles color.\n        if (!environmentState.renderTranslucentDepthForPick) {\n          us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION);\n          commands =\n            frustumCommands.commands[Pass.CESIUM_3D_TILE_CLASSIFICATION];\n          length = frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION];\n          for (j = 0; j < length; ++j) {\n            executeCommand(commands[j], scene, context, passState);\n          }\n        }\n      }\n    } else {\n      // When the invert classification color is opaque:\n      //    Main FBO (FBO1):                   Main_Color   + Main_DepthStencil\n      //    Invert classification FBO (FBO2) : Invert_Color + Main_DepthStencil\n      //\n      //    1. Clear FBO2 color to vec4(0.0) for each frustum\n      //    2. Draw 3D Tiles to FBO2\n      //    3. Draw classification to FBO2\n      //    4. Fullscreen pass to FBO1, draw Invert_Color when:\n      //           * Main_DepthStencil has the stencil bit set > 0 (classified)\n      //    5. Fullscreen pass to FBO1, draw Invert_Color * czm_invertClassificationColor when:\n      //           * Main_DepthStencil has stencil bit set to 0 (unclassified) and\n      //           * Invert_Color !== vec4(0.0)\n      //\n      // When the invert classification color is translucent:\n      //    Main FBO (FBO1):                  Main_Color         + Main_DepthStencil\n      //    Invert classification FBO (FBO2): Invert_Color       + Invert_DepthStencil\n      //    IsClassified FBO (FBO3):          IsClassified_Color + Invert_DepthStencil\n      //\n      //    1. Clear FBO2 and FBO3 color to vec4(0.0), stencil to 0, and depth to 1.0\n      //    2. Draw 3D Tiles to FBO2\n      //    3. Draw classification to FBO2\n      //    4. Fullscreen pass to FBO3, draw any color when\n      //           * Invert_DepthStencil has the stencil bit set > 0 (classified)\n      //    5. Fullscreen pass to FBO1, draw Invert_Color when:\n      //           * Invert_Color !== vec4(0.0) and\n      //           * IsClassified_Color !== vec4(0.0)\n      //    6. Fullscreen pass to FBO1, draw Invert_Color * czm_invertClassificationColor when:\n      //           * Invert_Color !== vec4(0.0) and\n      //           * IsClassified_Color === vec4(0.0)\n      //\n      // NOTE: Step six when translucent invert color occurs after the TRANSLUCENT pass\n      //\n      scene._invertClassification.clear(context, passState);\n\n      const opaqueClassificationFramebuffer = passState.framebuffer;\n      passState.framebuffer = scene._invertClassification._fbo.framebuffer;\n\n      // Draw normally\n      us.updatePass(Pass.CESIUM_3D_TILE);\n      commands = frustumCommands.commands[Pass.CESIUM_3D_TILE];\n      length = frustumCommands.indices[Pass.CESIUM_3D_TILE];\n      for (j = 0; j < length; ++j) {\n        executeCommand(commands[j], scene, context, passState);\n      }\n\n      if (defined(globeDepth) && environmentState.useGlobeDepthFramebuffer) {\n        scene._invertClassification.prepareTextures(context);\n        globeDepth.executeUpdateDepth(\n          context,\n          passState,\n          clearGlobeDepth,\n          scene._invertClassification._fbo.getDepthStencilTexture()\n        );\n      }\n\n      // Set stencil\n      us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW);\n      commands =\n        frustumCommands.commands[\n          Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW\n        ];\n      length =\n        frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW];\n      for (j = 0; j < length; ++j) {\n        executeCommand(commands[j], scene, context, passState);\n      }\n\n      passState.framebuffer = opaqueClassificationFramebuffer;\n\n      // Fullscreen pass to copy classified fragments\n      scene._invertClassification.executeClassified(context, passState);\n      if (frameState.invertClassificationColor.alpha === 1.0) {\n        // Fullscreen pass to copy unclassified fragments when alpha == 1.0\n        scene._invertClassification.executeUnclassified(context, passState);\n      }\n\n      // Clear stencil set by the classification for the next classification pass\n      if (length > 0 && context.stencilBuffer) {\n        clearClassificationStencil.execute(context, passState);\n      }\n\n      // Draw style over classification.\n      us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION);\n      commands = frustumCommands.commands[Pass.CESIUM_3D_TILE_CLASSIFICATION];\n      length = frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION];\n      for (j = 0; j < length; ++j) {\n        executeCommand(commands[j], scene, context, passState);\n      }\n    }\n\n    if (length > 0 && context.stencilBuffer) {\n      clearStencil.execute(context, passState);\n    }\n\n    us.updatePass(Pass.VOXELS);\n    commands = frustumCommands.commands[Pass.VOXELS];\n    length = frustumCommands.indices[Pass.VOXELS];\n    commands.length = length;\n    executeVoxelCommands(scene, executeCommand, passState, commands);\n\n    us.updatePass(Pass.OPAQUE);\n    commands = frustumCommands.commands[Pass.OPAQUE];\n    length = frustumCommands.indices[Pass.OPAQUE];\n    for (j = 0; j < length; ++j) {\n      executeCommand(commands[j], scene, context, passState);\n    }\n\n    if (index !== 0 && scene.mode !== SceneMode.SCENE2D) {\n      // Do not overlap frustums in the translucent pass to avoid blending artifacts\n      frustum.near = frustumCommands.near;\n      us.updateFrustum(frustum);\n    }\n\n    let invertClassification;\n    if (\n      !picking &&\n      environmentState.useInvertClassification &&\n      frameState.invertClassificationColor.alpha < 1.0\n    ) {\n      // Fullscreen pass to copy unclassified fragments when alpha < 1.0.\n      // Not executed when undefined.\n      invertClassification = scene._invertClassification;\n    }\n\n    us.updatePass(Pass.TRANSLUCENT);\n    commands = frustumCommands.commands[Pass.TRANSLUCENT];\n    commands.length = frustumCommands.indices[Pass.TRANSLUCENT];\n    executeTranslucentCommands(\n      scene,\n      executeCommand,\n      passState,\n      commands,\n      invertClassification\n    );\n\n    // Classification for translucent 3D Tiles\n    const has3DTilesClassificationCommands =\n      frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION] > 0;\n    if (\n      has3DTilesClassificationCommands &&\n      view.translucentTileClassification.isSupported()\n    ) {\n      view.translucentTileClassification.executeTranslucentCommands(\n        scene,\n        executeCommand,\n        passState,\n        commands,\n        globeDepth.depthStencilTexture\n      );\n      view.translucentTileClassification.executeClassificationCommands(\n        scene,\n        executeCommand,\n        passState,\n        frustumCommands\n      );\n    }\n\n    if (\n      context.depthTexture &&\n      scene.useDepthPicking &&\n      (environmentState.useGlobeDepthFramebuffer ||\n        renderTranslucentDepthForPick)\n    ) {\n      // PERFORMANCE_IDEA: Use MRT to avoid the extra copy.\n      const depthStencilTexture = globeDepth.depthStencilTexture;\n      const pickDepth = scene._picking.getPickDepth(scene, index);\n      pickDepth.update(context, depthStencilTexture);\n      pickDepth.executeCopyDepth(context, passState);\n    }\n\n    if (picking || !usePostProcessSelected) {\n      continue;\n    }\n\n    const originalFramebuffer = passState.framebuffer;\n    passState.framebuffer = view.sceneFramebuffer.getIdFramebuffer();\n\n    // reset frustum\n    frustum.near =\n      index !== 0\n        ? frustumCommands.near * scene.opaqueFrustumNearOffset\n        : frustumCommands.near;\n    frustum.far = frustumCommands.far;\n    us.updateFrustum(frustum);\n\n    us.updatePass(Pass.GLOBE);\n    commands = frustumCommands.commands[Pass.GLOBE];\n    length = frustumCommands.indices[Pass.GLOBE];\n\n    if (globeTranslucent) {\n      globeTranslucencyState.executeGlobeCommands(\n        frustumCommands,\n        executeIdCommand,\n        globeTranslucencyFramebuffer,\n        scene,\n        passState\n      );\n    } else {\n      for (j = 0; j < length; ++j) {\n        executeIdCommand(commands[j], scene, context, passState);\n      }\n    }\n\n    if (clearGlobeDepth) {\n      clearDepth.framebuffer = passState.framebuffer;\n      clearDepth.execute(context, passState);\n      clearDepth.framebuffer = undefined;\n    }\n\n    if (clearGlobeDepth && useDepthPlane) {\n      depthPlane.execute(context, passState);\n    }\n\n    us.updatePass(Pass.CESIUM_3D_TILE);\n    commands = frustumCommands.commands[Pass.CESIUM_3D_TILE];\n    length = frustumCommands.indices[Pass.CESIUM_3D_TILE];\n    for (j = 0; j < length; ++j) {\n      executeIdCommand(commands[j], scene, context, passState);\n    }\n\n    us.updatePass(Pass.OPAQUE);\n    commands = frustumCommands.commands[Pass.OPAQUE];\n    length = frustumCommands.indices[Pass.OPAQUE];\n    for (j = 0; j < length; ++j) {\n      executeIdCommand(commands[j], scene, context, passState);\n    }\n\n    us.updatePass(Pass.TRANSLUCENT);\n    commands = frustumCommands.commands[Pass.TRANSLUCENT];\n    length = frustumCommands.indices[Pass.TRANSLUCENT];\n    for (j = 0; j < length; ++j) {\n      executeIdCommand(commands[j], scene, context, passState);\n    }\n\n    passState.framebuffer = originalFramebuffer;\n  }\n}\n\nfunction executeComputeCommands(scene) {\n  const us = scene.context.uniformState;\n  us.updatePass(Pass.COMPUTE);\n\n  const sunComputeCommand = scene._environmentState.sunComputeCommand;\n  if (defined(sunComputeCommand)) {\n    sunComputeCommand.execute(scene._computeEngine);\n  }\n\n  const commandList = scene._computeCommandList;\n  const length = commandList.length;\n  for (let i = 0; i < length; ++i) {\n    commandList[i].execute(scene._computeEngine);\n  }\n}\n\nfunction executeOverlayCommands(scene, passState) {\n  const us = scene.context.uniformState;\n  us.updatePass(Pass.OVERLAY);\n\n  const context = scene.context;\n  const commandList = scene._overlayCommandList;\n  const length = commandList.length;\n  for (let i = 0; i < length; ++i) {\n    commandList[i].execute(context, passState);\n  }\n}\n\nfunction insertShadowCastCommands(scene, commandList, shadowMap) {\n  const shadowVolume = shadowMap.shadowMapCullingVolume;\n  const isPointLight = shadowMap.isPointLight;\n  const passes = shadowMap.passes;\n  const numberOfPasses = passes.length;\n\n  const length = commandList.length;\n  for (let i = 0; i < length; ++i) {\n    const command = commandList[i];\n    scene.updateDerivedCommands(command);\n\n    if (\n      command.castShadows &&\n      (command.pass === Pass.GLOBE ||\n        command.pass === Pass.CESIUM_3D_TILE ||\n        command.pass === Pass.OPAQUE ||\n        command.pass === Pass.TRANSLUCENT)\n    ) {\n      if (scene.isVisible(command, shadowVolume)) {\n        if (isPointLight) {\n          for (let k = 0; k < numberOfPasses; ++k) {\n            passes[k].commandList.push(command);\n          }\n        } else if (numberOfPasses === 1) {\n          passes[0].commandList.push(command);\n        } else {\n          let wasVisible = false;\n          // Loop over cascades from largest to smallest\n          for (let j = numberOfPasses - 1; j >= 0; --j) {\n            const cascadeVolume = passes[j].cullingVolume;\n            if (scene.isVisible(command, cascadeVolume)) {\n              passes[j].commandList.push(command);\n              wasVisible = true;\n            } else if (wasVisible) {\n              // If it was visible in the previous cascade but now isn't\n              // then there is no need to check any more cascades\n              break;\n            }\n          }\n        }\n      }\n    }\n  }\n}\n\nfunction executeShadowMapCastCommands(scene) {\n  const frameState = scene.frameState;\n  const shadowMaps = frameState.shadowState.shadowMaps;\n  const shadowMapLength = shadowMaps.length;\n\n  if (!frameState.shadowState.shadowsEnabled) {\n    return;\n  }\n\n  const context = scene.context;\n  const uniformState = context.uniformState;\n\n  for (let i = 0; i < shadowMapLength; ++i) {\n    const shadowMap = shadowMaps[i];\n    if (shadowMap.outOfView) {\n      continue;\n    }\n\n    // Reset the command lists\n    const passes = shadowMap.passes;\n    const numberOfPasses = passes.length;\n    for (let j = 0; j < numberOfPasses; ++j) {\n      passes[j].commandList.length = 0;\n    }\n\n    // Insert the primitive/model commands into the command lists\n    const sceneCommands = scene.frameState.commandList;\n    insertShadowCastCommands(scene, sceneCommands, shadowMap);\n\n    for (let j = 0; j < numberOfPasses; ++j) {\n      const pass = shadowMap.passes[j];\n      uniformState.updateCamera(pass.camera);\n      shadowMap.updatePass(context, j);\n      const numberOfCommands = pass.commandList.length;\n      for (let k = 0; k < numberOfCommands; ++k) {\n        const command = pass.commandList[k];\n        // Set the correct pass before rendering into the shadow map because some shaders\n        // conditionally render based on whether the pass is translucent or opaque.\n        uniformState.updatePass(command.pass);\n        executeCommand(\n          command.derivedCommands.shadows.castCommands[i],\n          scene,\n          context,\n          pass.passState\n        );\n      }\n    }\n  }\n}\n\nconst scratchEyeTranslation = new Cartesian3();\n\n/**\n * @private\n */\nScene.prototype.updateAndExecuteCommands = function (\n  passState,\n  backgroundColor\n) {\n  const frameState = this._frameState;\n  const mode = frameState.mode;\n  const useWebVR = this._environmentState.useWebVR;\n\n  if (useWebVR) {\n    executeWebVRCommands(this, passState, backgroundColor);\n  } else if (\n    mode !== SceneMode.SCENE2D ||\n    this._mapMode2D === MapMode2D.ROTATE\n  ) {\n    executeCommandsInViewport(true, this, passState, backgroundColor);\n  } else {\n    updateAndClearFramebuffers(this, passState, backgroundColor);\n    execute2DViewportCommands(this, passState);\n  }\n};\n\nfunction executeWebVRCommands(scene, passState, backgroundColor) {\n  const view = scene._view;\n  const camera = view.camera;\n  const environmentState = scene._environmentState;\n  const renderTranslucentDepthForPick =\n    environmentState.renderTranslucentDepthForPick;\n\n  updateAndClearFramebuffers(scene, passState, backgroundColor);\n\n  updateAndRenderPrimitives(scene);\n\n  view.createPotentiallyVisibleSet(scene);\n\n  executeComputeCommands(scene);\n\n  if (!renderTranslucentDepthForPick) {\n    executeShadowMapCastCommands(scene);\n  }\n\n  // Based on Calculating Stereo pairs by Paul Bourke\n  // http://paulbourke.net/stereographics/stereorender/\n  const viewport = passState.viewport;\n  viewport.x = 0;\n  viewport.y = 0;\n  viewport.width = viewport.width * 0.5;\n\n  const savedCamera = Camera.clone(camera, scene._cameraVR);\n  savedCamera.frustum = camera.frustum;\n\n  const near = camera.frustum.near;\n  const fo = near * defaultValue(scene.focalLength, 5.0);\n  const eyeSeparation = defaultValue(scene.eyeSeparation, fo / 30.0);\n  const eyeTranslation = Cartesian3.multiplyByScalar(\n    savedCamera.right,\n    eyeSeparation * 0.5,\n    scratchEyeTranslation\n  );\n\n  camera.frustum.aspectRatio = viewport.width / viewport.height;\n\n  const offset = (0.5 * eyeSeparation * near) / fo;\n\n  Cartesian3.add(savedCamera.position, eyeTranslation, camera.position);\n  camera.frustum.xOffset = offset;\n\n  executeCommands(scene, passState);\n\n  viewport.x = viewport.width;\n\n  Cartesian3.subtract(savedCamera.position, eyeTranslation, camera.position);\n  camera.frustum.xOffset = -offset;\n\n  executeCommands(scene, passState);\n\n  Camera.clone(savedCamera, camera);\n}\n\nconst scratch2DViewportCartographic = new Cartographic(\n  Math.PI,\n  CesiumMath.PI_OVER_TWO\n);\nconst scratch2DViewportMaxCoord = new Cartesian3();\nconst scratch2DViewportSavedPosition = new Cartesian3();\nconst scratch2DViewportTransform = new Matrix4();\nconst scratch2DViewportCameraTransform = new Matrix4();\nconst scratch2DViewportEyePoint = new Cartesian3();\nconst scratch2DViewportWindowCoords = new Cartesian3();\nconst scratch2DViewport = new BoundingRectangle();\n\nfunction execute2DViewportCommands(scene, passState) {\n  const context = scene.context;\n  const frameState = scene.frameState;\n  const camera = scene.camera;\n\n  const originalViewport = passState.viewport;\n  const viewport = BoundingRectangle.clone(originalViewport, scratch2DViewport);\n  passState.viewport = viewport;\n\n  const maxCartographic = scratch2DViewportCartographic;\n  const maxCoord = scratch2DViewportMaxCoord;\n\n  const projection = scene.mapProjection;\n  projection.project(maxCartographic, maxCoord);\n\n  const position = Cartesian3.clone(\n    camera.position,\n    scratch2DViewportSavedPosition\n  );\n  const transform = Matrix4.clone(\n    camera.transform,\n    scratch2DViewportCameraTransform\n  );\n  const frustum = camera.frustum.clone();\n\n  camera._setTransform(Matrix4.IDENTITY);\n\n  const viewportTransformation = Matrix4.computeViewportTransformation(\n    viewport,\n    0.0,\n    1.0,\n    scratch2DViewportTransform\n  );\n  const projectionMatrix = camera.frustum.projectionMatrix;\n\n  const x = camera.positionWC.y;\n  const eyePoint = Cartesian3.fromElements(\n    CesiumMath.sign(x) * maxCoord.x - x,\n    0.0,\n    -camera.positionWC.x,\n    scratch2DViewportEyePoint\n  );\n  const windowCoordinates = Transforms.pointToGLWindowCoordinates(\n    projectionMatrix,\n    viewportTransformation,\n    eyePoint,\n    scratch2DViewportWindowCoords\n  );\n\n  windowCoordinates.x = Math.floor(windowCoordinates.x);\n\n  const viewportX = viewport.x;\n  const viewportWidth = viewport.width;\n\n  if (\n    x === 0.0 ||\n    windowCoordinates.x <= viewportX ||\n    windowCoordinates.x >= viewportX + viewportWidth\n  ) {\n    executeCommandsInViewport(true, scene, passState);\n  } else if (\n    Math.abs(viewportX + viewportWidth * 0.5 - windowCoordinates.x) < 1.0\n  ) {\n    viewport.width = windowCoordinates.x - viewport.x;\n\n    camera.position.x *= CesiumMath.sign(camera.position.x);\n\n    camera.frustum.right = 0.0;\n\n    frameState.cullingVolume = camera.frustum.computeCullingVolume(\n      camera.positionWC,\n      camera.directionWC,\n      camera.upWC\n    );\n    context.uniformState.update(frameState);\n\n    executeCommandsInViewport(true, scene, passState);\n\n    viewport.x = windowCoordinates.x;\n\n    camera.position.x = -camera.position.x;\n\n    camera.frustum.right = -camera.frustum.left;\n    camera.frustum.left = 0.0;\n\n    frameState.cullingVolume = camera.frustum.computeCullingVolume(\n      camera.positionWC,\n      camera.directionWC,\n      camera.upWC\n    );\n    context.uniformState.update(frameState);\n\n    executeCommandsInViewport(false, scene, passState);\n  } else if (windowCoordinates.x > viewportX + viewportWidth * 0.5) {\n    viewport.width = windowCoordinates.x - viewportX;\n\n    const right = camera.frustum.right;\n    camera.frustum.right = maxCoord.x - x;\n\n    frameState.cullingVolume = camera.frustum.computeCullingVolume(\n      camera.positionWC,\n      camera.directionWC,\n      camera.upWC\n    );\n    context.uniformState.update(frameState);\n\n    executeCommandsInViewport(true, scene, passState);\n\n    viewport.x = windowCoordinates.x;\n    viewport.width = viewportX + viewportWidth - windowCoordinates.x;\n\n    camera.position.x = -camera.position.x;\n\n    camera.frustum.left = -camera.frustum.right;\n    camera.frustum.right = right - camera.frustum.right * 2.0;\n\n    frameState.cullingVolume = camera.frustum.computeCullingVolume(\n      camera.positionWC,\n      camera.directionWC,\n      camera.upWC\n    );\n    context.uniformState.update(frameState);\n\n    executeCommandsInViewport(false, scene, passState);\n  } else {\n    viewport.x = windowCoordinates.x;\n    viewport.width = viewportX + viewportWidth - windowCoordinates.x;\n\n    const left = camera.frustum.left;\n    camera.frustum.left = -maxCoord.x - x;\n\n    frameState.cullingVolume = camera.frustum.computeCullingVolume(\n      camera.positionWC,\n      camera.directionWC,\n      camera.upWC\n    );\n    context.uniformState.update(frameState);\n\n    executeCommandsInViewport(true, scene, passState);\n\n    viewport.x = viewportX;\n    viewport.width = windowCoordinates.x - viewportX;\n\n    camera.position.x = -camera.position.x;\n\n    camera.frustum.right = -camera.frustum.left;\n    camera.frustum.left = left - camera.frustum.left * 2.0;\n\n    frameState.cullingVolume = camera.frustum.computeCullingVolume(\n      camera.positionWC,\n      camera.directionWC,\n      camera.upWC\n    );\n    context.uniformState.update(frameState);\n\n    executeCommandsInViewport(false, scene, passState);\n  }\n\n  camera._setTransform(transform);\n  Cartesian3.clone(position, camera.position);\n  camera.frustum = frustum.clone();\n  passState.viewport = originalViewport;\n}\n\nfunction executeCommandsInViewport(\n  firstViewport,\n  scene,\n  passState,\n  backgroundColor\n) {\n  const environmentState = scene._environmentState;\n  const view = scene._view;\n  const renderTranslucentDepthForPick =\n    environmentState.renderTranslucentDepthForPick;\n\n  if (!firstViewport) {\n    scene.frameState.commandList.length = 0;\n  }\n\n  updateAndRenderPrimitives(scene);\n\n  view.createPotentiallyVisibleSet(scene);\n\n  if (firstViewport) {\n    if (defined(backgroundColor)) {\n      updateAndClearFramebuffers(scene, passState, backgroundColor);\n    }\n    executeComputeCommands(scene);\n    if (!renderTranslucentDepthForPick) {\n      executeShadowMapCastCommands(scene);\n    }\n  }\n\n  executeCommands(scene, passState);\n}\n\nconst scratchCullingVolume = new CullingVolume();\n\n/**\n * @private\n */\nScene.prototype.updateEnvironment = function () {\n  const frameState = this._frameState;\n  const view = this._view;\n\n  // Update celestial and terrestrial environment effects.\n  const environmentState = this._environmentState;\n  const renderPass = frameState.passes.render;\n  const offscreenPass = frameState.passes.offscreen;\n  const skyAtmosphere = this.skyAtmosphere;\n  const globe = this.globe;\n  const globeTranslucencyState = this._globeTranslucencyState;\n\n  if (\n    !renderPass ||\n    (this._mode !== SceneMode.SCENE2D &&\n      view.camera.frustum instanceof OrthographicFrustum) ||\n    !globeTranslucencyState.environmentVisible\n  ) {\n    environmentState.skyAtmosphereCommand = undefined;\n    environmentState.skyBoxCommand = undefined;\n    environmentState.sunDrawCommand = undefined;\n    environmentState.sunComputeCommand = undefined;\n    environmentState.moonCommand = undefined;\n  } else {\n    if (defined(skyAtmosphere)) {\n      if (defined(globe)) {\n        skyAtmosphere.setDynamicAtmosphereColor(\n          globe.enableLighting && globe.dynamicAtmosphereLighting,\n          globe.dynamicAtmosphereLightingFromSun\n        );\n        environmentState.isReadyForAtmosphere =\n          environmentState.isReadyForAtmosphere ||\n          !globe.show ||\n          globe._surface._tilesToRender.length > 0;\n      } else {\n        environmentState.isReadyForAtmosphere = true;\n      }\n      environmentState.skyAtmosphereCommand = skyAtmosphere.update(\n        frameState,\n        globe\n      );\n      if (defined(environmentState.skyAtmosphereCommand)) {\n        this.updateDerivedCommands(environmentState.skyAtmosphereCommand);\n      }\n    } else {\n      environmentState.skyAtmosphereCommand = undefined;\n    }\n\n    environmentState.skyBoxCommand = defined(this.skyBox)\n      ? this.skyBox.update(frameState, this._hdr)\n      : undefined;\n    const sunCommands = defined(this.sun)\n      ? this.sun.update(frameState, view.passState, this._hdr)\n      : undefined;\n    environmentState.sunDrawCommand = defined(sunCommands)\n      ? sunCommands.drawCommand\n      : undefined;\n    environmentState.sunComputeCommand = defined(sunCommands)\n      ? sunCommands.computeCommand\n      : undefined;\n    environmentState.moonCommand = defined(this.moon)\n      ? this.moon.update(frameState)\n      : undefined;\n  }\n\n  const clearGlobeDepth = (environmentState.clearGlobeDepth =\n    defined(globe) &&\n    globe.show &&\n    (!globe.depthTestAgainstTerrain || this.mode === SceneMode.SCENE2D));\n  const useDepthPlane = (environmentState.useDepthPlane =\n    clearGlobeDepth &&\n    this.mode === SceneMode.SCENE3D &&\n    globeTranslucencyState.useDepthPlane);\n  if (useDepthPlane) {\n    // Update the depth plane that is rendered in 3D when the primitives are\n    // not depth tested against terrain so primitives on the backface\n    // of the globe are not picked.\n    this._depthPlane.update(frameState);\n  }\n\n  environmentState.renderTranslucentDepthForPick = false;\n  environmentState.useWebVR =\n    this._useWebVR && this.mode !== SceneMode.SCENE2D && !offscreenPass;\n\n  const occluder =\n    frameState.mode === SceneMode.SCENE3D &&\n    !globeTranslucencyState.sunVisibleThroughGlobe\n      ? frameState.occluder\n      : undefined;\n  let cullingVolume = frameState.cullingVolume;\n\n  // get user culling volume minus the far plane.\n  const planes = scratchCullingVolume.planes;\n  for (let k = 0; k < 5; ++k) {\n    planes[k] = cullingVolume.planes[k];\n  }\n  cullingVolume = scratchCullingVolume;\n\n  // Determine visibility of celestial and terrestrial environment effects.\n  environmentState.isSkyAtmosphereVisible =\n    defined(environmentState.skyAtmosphereCommand) &&\n    environmentState.isReadyForAtmosphere;\n  environmentState.isSunVisible = this.isVisible(\n    environmentState.sunDrawCommand,\n    cullingVolume,\n    occluder\n  );\n  environmentState.isMoonVisible = this.isVisible(\n    environmentState.moonCommand,\n    cullingVolume,\n    occluder\n  );\n\n  const envMaps = this.specularEnvironmentMaps;\n  let envMapAtlas = this._specularEnvironmentMapAtlas;\n  if (\n    defined(envMaps) &&\n    (!defined(envMapAtlas) || envMapAtlas.url !== envMaps)\n  ) {\n    envMapAtlas = envMapAtlas && envMapAtlas.destroy();\n    this._specularEnvironmentMapAtlas = new OctahedralProjectedCubeMap(envMaps);\n  } else if (!defined(envMaps) && defined(envMapAtlas)) {\n    envMapAtlas.destroy();\n    this._specularEnvironmentMapAtlas = undefined;\n  }\n\n  if (defined(this._specularEnvironmentMapAtlas)) {\n    this._specularEnvironmentMapAtlas.update(frameState);\n  }\n};\n\nfunction updateDebugFrustumPlanes(scene) {\n  const frameState = scene._frameState;\n  if (scene.debugShowFrustumPlanes !== scene._debugShowFrustumPlanes) {\n    if (scene.debugShowFrustumPlanes) {\n      scene._debugFrustumPlanes = new DebugCameraPrimitive({\n        camera: scene.camera,\n        updateOnChange: false,\n        frustumSplits: frameState.frustumSplits,\n      });\n    } else {\n      scene._debugFrustumPlanes =\n        scene._debugFrustumPlanes && scene._debugFrustumPlanes.destroy();\n    }\n    scene._debugShowFrustumPlanes = scene.debugShowFrustumPlanes;\n  }\n\n  if (defined(scene._debugFrustumPlanes)) {\n    scene._debugFrustumPlanes.update(frameState);\n  }\n}\n\nfunction updateShadowMaps(scene) {\n  const frameState = scene._frameState;\n  const shadowMaps = frameState.shadowMaps;\n  const length = shadowMaps.length;\n\n  const shadowsEnabled =\n    length > 0 && !frameState.passes.pick && scene.mode === SceneMode.SCENE3D;\n  if (shadowsEnabled !== frameState.shadowState.shadowsEnabled) {\n    // Update derived commands when shadowsEnabled changes\n    ++frameState.shadowState.lastDirtyTime;\n    frameState.shadowState.shadowsEnabled = shadowsEnabled;\n  }\n\n  frameState.shadowState.lightShadowsEnabled = false;\n\n  if (!shadowsEnabled) {\n    return;\n  }\n\n  // Check if the shadow maps are different than the shadow maps last frame.\n  // If so, the derived commands need to be updated.\n  for (let j = 0; j < length; ++j) {\n    if (shadowMaps[j] !== frameState.shadowState.shadowMaps[j]) {\n      ++frameState.shadowState.lastDirtyTime;\n      break;\n    }\n  }\n\n  frameState.shadowState.shadowMaps.length = 0;\n  frameState.shadowState.lightShadowMaps.length = 0;\n\n  for (let i = 0; i < length; ++i) {\n    const shadowMap = shadowMaps[i];\n    shadowMap.update(frameState);\n\n    frameState.shadowState.shadowMaps.push(shadowMap);\n\n    if (shadowMap.fromLightSource) {\n      frameState.shadowState.lightShadowMaps.push(shadowMap);\n      frameState.shadowState.lightShadowsEnabled = true;\n    }\n\n    if (shadowMap.dirty) {\n      ++frameState.shadowState.lastDirtyTime;\n      shadowMap.dirty = false;\n    }\n  }\n}\n\nfunction updateAndRenderPrimitives(scene) {\n  const frameState = scene._frameState;\n\n  scene._groundPrimitives.update(frameState);\n  scene._primitives.update(frameState);\n\n  updateDebugFrustumPlanes(scene);\n  updateShadowMaps(scene);\n\n  if (scene._globe) {\n    scene._globe.render(frameState);\n  }\n}\n\nfunction updateAndClearFramebuffers(scene, passState, clearColor) {\n  const context = scene._context;\n  const frameState = scene._frameState;\n  const environmentState = scene._environmentState;\n  const view = scene._view;\n\n  const passes = scene._frameState.passes;\n  const picking = passes.pick;\n  if (defined(view.globeDepth)) {\n    view.globeDepth.picking = picking;\n  }\n  const useWebVR = environmentState.useWebVR;\n\n  // Preserve the reference to the original framebuffer.\n  environmentState.originalFramebuffer = passState.framebuffer;\n\n  // Manage sun bloom post-processing effect.\n  if (defined(scene.sun) && scene.sunBloom !== scene._sunBloom) {\n    if (scene.sunBloom && !useWebVR) {\n      scene._sunPostProcess = new SunPostProcess();\n    } else if (defined(scene._sunPostProcess)) {\n      scene._sunPostProcess = scene._sunPostProcess.destroy();\n    }\n\n    scene._sunBloom = scene.sunBloom;\n  } else if (!defined(scene.sun) && defined(scene._sunPostProcess)) {\n    scene._sunPostProcess = scene._sunPostProcess.destroy();\n    scene._sunBloom = false;\n  }\n\n  // Clear the pass state framebuffer.\n  const clear = scene._clearColorCommand;\n  Color.clone(clearColor, clear.color);\n  clear.execute(context, passState);\n\n  // Update globe depth rendering based on the current context and clear the globe depth framebuffer.\n  // Globe depth is copied for the pick pass to support picking batched geometries in GroundPrimitives.\n  const useGlobeDepthFramebuffer = (environmentState.useGlobeDepthFramebuffer = defined(\n    view.globeDepth\n  ));\n  if (useGlobeDepthFramebuffer) {\n    view.globeDepth.update(\n      context,\n      passState,\n      view.viewport,\n      scene.msaaSamples,\n      scene._hdr,\n      environmentState.clearGlobeDepth\n    );\n    view.globeDepth.clear(context, passState, clearColor);\n  }\n\n  // If supported, configure OIT to use the globe depth framebuffer and clear the OIT framebuffer.\n  const oit = view.oit;\n  const useOIT = (environmentState.useOIT =\n    !picking && defined(oit) && oit.isSupported());\n  if (useOIT) {\n    oit.update(\n      context,\n      passState,\n      view.globeDepth.colorFramebufferManager,\n      scene._hdr,\n      scene.msaaSamples\n    );\n    oit.clear(context, passState, clearColor);\n    environmentState.useOIT = oit.isSupported();\n  }\n\n  const postProcess = scene.postProcessStages;\n  let usePostProcess = (environmentState.usePostProcess =\n    !picking &&\n    (scene._hdr ||\n      postProcess.length > 0 ||\n      postProcess.ambientOcclusion.enabled ||\n      postProcess.fxaa.enabled ||\n      postProcess.bloom.enabled));\n  environmentState.usePostProcessSelected = false;\n  if (usePostProcess) {\n    view.sceneFramebuffer.update(\n      context,\n      view.viewport,\n      scene._hdr,\n      scene.msaaSamples\n    );\n    view.sceneFramebuffer.clear(context, passState, clearColor);\n\n    postProcess.update(context, frameState.useLogDepth, scene._hdr);\n    postProcess.clear(context);\n\n    usePostProcess = environmentState.usePostProcess = postProcess.ready;\n    environmentState.usePostProcessSelected =\n      usePostProcess && postProcess.hasSelected;\n  }\n\n  if (environmentState.isSunVisible && scene.sunBloom && !useWebVR) {\n    passState.framebuffer = scene._sunPostProcess.update(passState);\n    scene._sunPostProcess.clear(context, passState, clearColor);\n  } else if (useGlobeDepthFramebuffer) {\n    passState.framebuffer = view.globeDepth.framebuffer;\n  } else if (usePostProcess) {\n    passState.framebuffer = view.sceneFramebuffer.framebuffer;\n  }\n\n  if (defined(passState.framebuffer)) {\n    clear.execute(context, passState);\n  }\n\n  const useInvertClassification = (environmentState.useInvertClassification =\n    !picking && defined(passState.framebuffer) && scene.invertClassification);\n  if (useInvertClassification) {\n    let depthFramebuffer;\n    if (scene.frameState.invertClassificationColor.alpha === 1.0) {\n      if (environmentState.useGlobeDepthFramebuffer) {\n        depthFramebuffer = view.globeDepth.framebuffer;\n      }\n    }\n\n    if (defined(depthFramebuffer) || context.depthTexture) {\n      scene._invertClassification.previousFramebuffer = depthFramebuffer;\n      scene._invertClassification.update(\n        context,\n        scene.msaaSamples,\n        view.globeDepth.colorFramebufferManager\n      );\n      scene._invertClassification.clear(context, passState);\n\n      if (scene.frameState.invertClassificationColor.alpha < 1.0 && useOIT) {\n        const command = scene._invertClassification.unclassifiedCommand;\n        const derivedCommands = command.derivedCommands;\n        derivedCommands.oit = oit.createDerivedCommands(\n          command,\n          context,\n          derivedCommands.oit\n        );\n      }\n    } else {\n      environmentState.useInvertClassification = false;\n    }\n  }\n\n  if (scene._globeTranslucencyState.translucent) {\n    view.globeTranslucencyFramebuffer.updateAndClear(\n      scene._hdr,\n      view.viewport,\n      context,\n      passState\n    );\n  }\n}\n\n/**\n * @private\n */\nScene.prototype.resolveFramebuffers = function (passState) {\n  const context = this._context;\n  const environmentState = this._environmentState;\n  const view = this._view;\n  const globeDepth = view.globeDepth;\n  if (defined(globeDepth)) {\n    globeDepth.prepareColorTextures(context);\n  }\n\n  const useOIT = environmentState.useOIT;\n  const useGlobeDepthFramebuffer = environmentState.useGlobeDepthFramebuffer;\n  const usePostProcess = environmentState.usePostProcess;\n\n  const defaultFramebuffer = environmentState.originalFramebuffer;\n  const globeFramebuffer = useGlobeDepthFramebuffer\n    ? globeDepth.colorFramebufferManager\n    : undefined;\n  const sceneFramebuffer = view.sceneFramebuffer._colorFramebuffer;\n  const idFramebuffer = view.sceneFramebuffer.idFramebuffer;\n\n  if (useOIT) {\n    passState.framebuffer = usePostProcess\n      ? sceneFramebuffer.framebuffer\n      : defaultFramebuffer;\n    view.oit.execute(context, passState);\n  }\n\n  const translucentTileClassification = view.translucentTileClassification;\n  if (\n    translucentTileClassification.hasTranslucentDepth &&\n    translucentTileClassification.isSupported()\n  ) {\n    translucentTileClassification.execute(this, passState);\n  }\n\n  if (usePostProcess) {\n    view.sceneFramebuffer.prepareColorTextures(context);\n    let inputFramebuffer = sceneFramebuffer;\n    if (useGlobeDepthFramebuffer && !useOIT) {\n      inputFramebuffer = globeFramebuffer;\n    }\n\n    const postProcess = this.postProcessStages;\n    const colorTexture = inputFramebuffer.getColorTexture(0);\n    const idTexture = idFramebuffer.getColorTexture(0);\n    const depthTexture = defaultValue(\n      globeFramebuffer,\n      sceneFramebuffer\n    ).getDepthStencilTexture();\n    postProcess.execute(context, colorTexture, depthTexture, idTexture);\n    postProcess.copy(context, defaultFramebuffer);\n  }\n\n  if (!useOIT && !usePostProcess && useGlobeDepthFramebuffer) {\n    passState.framebuffer = defaultFramebuffer;\n    globeDepth.executeCopyColor(context, passState);\n  }\n};\n\nfunction callAfterRenderFunctions(scene) {\n  // Functions are queued up during primitive update and executed here in case\n  // the function modifies scene state that should remain constant over the frame.\n  const functions = scene._frameState.afterRender;\n  for (let i = 0, length = functions.length; i < length; ++i) {\n    const shouldRequestRender = functions[i]();\n    if (shouldRequestRender) {\n      scene.requestRender();\n    }\n  }\n\n  functions.length = 0;\n}\n\nfunction getGlobeHeight(scene) {\n  const globe = scene._globe;\n  const camera = scene.camera;\n  const cartographic = camera.positionCartographic;\n  if (defined(globe) && globe.show && defined(cartographic)) {\n    return globe.getHeight(cartographic);\n  }\n  return undefined;\n}\n\nfunction isCameraUnderground(scene) {\n  const camera = scene.camera;\n  const mode = scene._mode;\n  const globe = scene.globe;\n  const cameraController = scene._screenSpaceCameraController;\n  const cartographic = camera.positionCartographic;\n\n  if (!defined(cartographic)) {\n    return false;\n  }\n\n  if (!cameraController.onMap() && cartographic.height < 0.0) {\n    // The camera can go off the map while in Columbus View.\n    // Make a best guess as to whether it's underground by checking if its height is less than zero.\n    return true;\n  }\n\n  if (\n    !defined(globe) ||\n    !globe.show ||\n    mode === SceneMode.SCENE2D ||\n    mode === SceneMode.MORPHING\n  ) {\n    return false;\n  }\n\n  const globeHeight = scene._globeHeight;\n  return defined(globeHeight) && cartographic.height < globeHeight;\n}\n\n/**\n * @private\n */\nScene.prototype.initializeFrame = function () {\n  // Destroy released shaders and textures once every 120 frames to avoid thrashing the cache\n  if (this._shaderFrameCount++ === 120) {\n    this._shaderFrameCount = 0;\n    this._context.shaderCache.destroyReleasedShaderPrograms();\n    this._context.textureCache.destroyReleasedTextures();\n  }\n\n  this._tweens.update();\n\n  this._globeHeight = getGlobeHeight(this);\n  this._cameraUnderground = isCameraUnderground(this);\n  this._globeTranslucencyState.update(this);\n\n  this._screenSpaceCameraController.update();\n  if (defined(this._deviceOrientationCameraController)) {\n    this._deviceOrientationCameraController.update();\n  }\n\n  this.camera.update(this._mode);\n  this.camera._updateCameraChanged();\n};\n\nfunction updateDebugShowFramesPerSecond(scene, renderedThisFrame) {\n  if (scene.debugShowFramesPerSecond) {\n    if (!defined(scene._performanceDisplay)) {\n      const performanceContainer = document.createElement(\"div\");\n      performanceContainer.className =\n        \"cesium-performanceDisplay-defaultContainer\";\n      const container = scene._canvas.parentNode;\n      container.appendChild(performanceContainer);\n      const performanceDisplay = new PerformanceDisplay({\n        container: performanceContainer,\n      });\n      scene._performanceDisplay = performanceDisplay;\n      scene._performanceContainer = performanceContainer;\n    }\n\n    scene._performanceDisplay.throttled = scene.requestRenderMode;\n    scene._performanceDisplay.update(renderedThisFrame);\n  } else if (defined(scene._performanceDisplay)) {\n    scene._performanceDisplay =\n      scene._performanceDisplay && scene._performanceDisplay.destroy();\n    scene._performanceContainer.parentNode.removeChild(\n      scene._performanceContainer\n    );\n  }\n}\n\nfunction prePassesUpdate(scene) {\n  scene._jobScheduler.resetBudgets();\n\n  const frameState = scene._frameState;\n  const primitives = scene.primitives;\n  primitives.prePassesUpdate(frameState);\n\n  if (defined(scene.globe)) {\n    scene.globe.update(frameState);\n  }\n\n  scene._picking.update();\n  frameState.creditDisplay.update();\n}\n\nfunction postPassesUpdate(scene) {\n  const frameState = scene._frameState;\n  const primitives = scene.primitives;\n  primitives.postPassesUpdate(frameState);\n\n  RequestScheduler.update();\n}\n\nconst scratchBackgroundColor = new Color();\n\nfunction render(scene) {\n  const frameState = scene._frameState;\n\n  const context = scene.context;\n  const us = context.uniformState;\n\n  const view = scene._defaultView;\n  scene._view = view;\n\n  scene.updateFrameState();\n  frameState.passes.render = true;\n  frameState.passes.postProcess = scene.postProcessStages.hasSelected;\n  frameState.tilesetPassState = renderTilesetPassState;\n\n  let backgroundColor = defaultValue(scene.backgroundColor, Color.BLACK);\n  if (scene._hdr) {\n    backgroundColor = Color.clone(backgroundColor, scratchBackgroundColor);\n    backgroundColor.red = Math.pow(backgroundColor.red, scene.gamma);\n    backgroundColor.green = Math.pow(backgroundColor.green, scene.gamma);\n    backgroundColor.blue = Math.pow(backgroundColor.blue, scene.gamma);\n  }\n  frameState.backgroundColor = backgroundColor;\n\n  scene.fog.update(frameState);\n\n  us.update(frameState);\n\n  const shadowMap = scene.shadowMap;\n  if (defined(shadowMap) && shadowMap.enabled) {\n    if (!defined(scene.light) || scene.light instanceof SunLight) {\n      // Negate the sun direction so that it is from the Sun, not to the Sun\n      Cartesian3.negate(us.sunDirectionWC, scene._shadowMapCamera.direction);\n    } else {\n      Cartesian3.clone(scene.light.direction, scene._shadowMapCamera.direction);\n    }\n    frameState.shadowMaps.push(shadowMap);\n  }\n\n  scene._computeCommandList.length = 0;\n  scene._overlayCommandList.length = 0;\n\n  const viewport = view.viewport;\n  viewport.x = 0;\n  viewport.y = 0;\n  viewport.width = context.drawingBufferWidth;\n  viewport.height = context.drawingBufferHeight;\n\n  const passState = view.passState;\n  passState.framebuffer = undefined;\n  passState.blendingEnabled = undefined;\n  passState.scissorTest = undefined;\n  passState.viewport = BoundingRectangle.clone(viewport, passState.viewport);\n\n  if (defined(scene.globe)) {\n    scene.globe.beginFrame(frameState);\n  }\n\n  scene.updateEnvironment();\n  scene.updateAndExecuteCommands(passState, backgroundColor);\n  scene.resolveFramebuffers(passState);\n\n  passState.framebuffer = undefined;\n  executeOverlayCommands(scene, passState);\n\n  if (defined(scene.globe)) {\n    scene.globe.endFrame(frameState);\n\n    if (!scene.globe.tilesLoaded) {\n      scene._renderRequested = true;\n    }\n  }\n\n  context.endFrame();\n}\n\nfunction tryAndCatchError(scene, functionToExecute) {\n  try {\n    functionToExecute(scene);\n  } catch (error) {\n    scene._renderError.raiseEvent(scene, error);\n\n    if (scene.rethrowRenderErrors) {\n      throw error;\n    }\n  }\n}\n\nfunction updateMostDetailedRayPicks(scene) {\n  return scene._picking.updateMostDetailedRayPicks(scene);\n}\n\n/**\n * Update and render the scene. It is usually not necessary to call this function\n * directly because {@link CesiumWidget} will do it automatically.\n * @param {JulianDate} [time] The simulation time at which to render.\n */\nScene.prototype.render = function (time) {\n  /**\n   *\n   * Pre passes update. Execute any pass invariant code that should run before the passes here.\n   *\n   */\n  this._preUpdate.raiseEvent(this, time);\n\n  const frameState = this._frameState;\n  frameState.newFrame = false;\n\n  if (!defined(time)) {\n    time = JulianDate.now();\n  }\n\n  // Determine if shouldRender\n  const cameraChanged = this._view.checkForCameraUpdates(this);\n  let shouldRender =\n    !this.requestRenderMode ||\n    this._renderRequested ||\n    cameraChanged ||\n    this._logDepthBufferDirty ||\n    this._hdrDirty ||\n    this.mode === SceneMode.MORPHING;\n  if (\n    !shouldRender &&\n    defined(this.maximumRenderTimeChange) &&\n    defined(this._lastRenderTime)\n  ) {\n    const difference = Math.abs(\n      JulianDate.secondsDifference(this._lastRenderTime, time)\n    );\n    shouldRender = shouldRender || difference > this.maximumRenderTimeChange;\n  }\n\n  if (shouldRender) {\n    this._lastRenderTime = JulianDate.clone(time, this._lastRenderTime);\n    this._renderRequested = false;\n    this._logDepthBufferDirty = false;\n    this._hdrDirty = false;\n\n    const frameNumber = CesiumMath.incrementWrap(\n      frameState.frameNumber,\n      15000000.0,\n      1.0\n    );\n    updateFrameNumber(this, frameNumber, time);\n    frameState.newFrame = true;\n  }\n\n  tryAndCatchError(this, prePassesUpdate);\n\n  /**\n   *\n   * Passes update. Add any passes here\n   *\n   */\n  if (this.primitives.show) {\n    tryAndCatchError(this, updateMostDetailedRayPicks);\n    tryAndCatchError(this, updatePreloadPass);\n    tryAndCatchError(this, updatePreloadFlightPass);\n    if (!shouldRender) {\n      tryAndCatchError(this, updateRequestRenderModeDeferCheckPass);\n    }\n  }\n\n  this._postUpdate.raiseEvent(this, time);\n\n  if (shouldRender) {\n    this._preRender.raiseEvent(this, time);\n    frameState.creditDisplay.beginFrame();\n    tryAndCatchError(this, render);\n  }\n\n  /**\n   *\n   * Post passes update. Execute any pass invariant code that should run after the passes here.\n   *\n   */\n  updateDebugShowFramesPerSecond(this, shouldRender);\n  tryAndCatchError(this, postPassesUpdate);\n\n  // Often used to trigger events (so don't want in trycatch) that the user might be subscribed to. Things like the tile load events, promises, etc.\n  // We don't want those events to resolve during the render loop because the events might add new primitives\n  callAfterRenderFunctions(this);\n\n  if (shouldRender) {\n    this._postRender.raiseEvent(this, time);\n    frameState.creditDisplay.endFrame();\n  }\n};\n\n/**\n * Update and render the scene. Always forces a new render frame regardless of whether a render was\n * previously requested.\n * @param {JulianDate} [time] The simulation time at which to render.\n *\n * @private\n */\nScene.prototype.forceRender = function (time) {\n  this._renderRequested = true;\n  this.render(time);\n};\n\n/**\n * Requests a new rendered frame when {@link Scene#requestRenderMode} is set to <code>true</code>.\n * The render rate will not exceed the {@link CesiumWidget#targetFrameRate}.\n *\n * @see Scene#requestRenderMode\n */\nScene.prototype.requestRender = function () {\n  this._renderRequested = true;\n};\n\n/**\n * @private\n */\nScene.prototype.clampLineWidth = function (width) {\n  return Math.max(\n    ContextLimits.minimumAliasedLineWidth,\n    Math.min(width, ContextLimits.maximumAliasedLineWidth)\n  );\n};\n\n/**\n * Returns an object with a `primitive` property that contains the first (top) primitive in the scene\n * at a particular window coordinate or undefined if nothing is at the location. Other properties may\n * potentially be set depending on the type of primitive and may be used to further identify the picked object.\n * <p>\n * When a feature of a 3D Tiles tileset is picked, <code>pick</code> returns a {@link Cesium3DTileFeature} object.\n * </p>\n *\n * @example\n * // On mouse over, color the feature yellow.\n * handler.setInputAction(function(movement) {\n *     const feature = scene.pick(movement.endPosition);\n *     if (feature instanceof Cesium.Cesium3DTileFeature) {\n *         feature.color = Cesium.Color.YELLOW;\n *     }\n * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);\n *\n * @param {Cartesian2} windowPosition Window coordinates to perform picking on.\n * @param {number} [width=3] Width of the pick rectangle.\n * @param {number} [height=3] Height of the pick rectangle.\n * @returns {object} Object containing the picked primitive.\n */\nScene.prototype.pick = function (windowPosition, width, height) {\n  return this._picking.pick(this, windowPosition, width, height);\n};\n\n/**\n * Returns the cartesian position reconstructed from the depth buffer and window position.\n * The returned position is in world coordinates. Used internally by camera functions to\n * prevent conversion to projected 2D coordinates and then back.\n * <p>\n * Set {@link Scene#pickTranslucentDepth} to <code>true</code> to include the depth of\n * translucent primitives; otherwise, this essentially picks through translucent primitives.\n * </p>\n *\n * @private\n *\n * @param {Cartesian2} windowPosition Window coordinates to perform picking on.\n * @param {Cartesian3} [result] The object on which to restore the result.\n * @returns {Cartesian3} The cartesian position in world coordinates.\n *\n * @exception {DeveloperError} Picking from the depth buffer is not supported. Check pickPositionSupported.\n */\nScene.prototype.pickPositionWorldCoordinates = function (\n  windowPosition,\n  result\n) {\n  return this._picking.pickPositionWorldCoordinates(\n    this,\n    windowPosition,\n    result\n  );\n};\n\n/**\n * Returns the cartesian position reconstructed from the depth buffer and window position.\n * <p>\n * The position reconstructed from the depth buffer in 2D may be slightly different from those\n * reconstructed in 3D and Columbus view. This is caused by the difference in the distribution\n * of depth values of perspective and orthographic projection.\n * </p>\n * <p>\n * Set {@link Scene#pickTranslucentDepth} to <code>true</code> to include the depth of\n * translucent primitives; otherwise, this essentially picks through translucent primitives.\n * </p>\n *\n * @param {Cartesian2} windowPosition Window coordinates to perform picking on.\n * @param {Cartesian3} [result] The object on which to restore the result.\n * @returns {Cartesian3} The cartesian position.\n *\n * @exception {DeveloperError} Picking from the depth buffer is not supported. Check pickPositionSupported.\n */\nScene.prototype.pickPosition = function (windowPosition, result) {\n  return this._picking.pickPosition(this, windowPosition, result);\n};\n\n/**\n * Returns a list of objects, each containing a `primitive` property, for all primitives at\n * a particular window coordinate position. Other properties may also be set depending on the\n * type of primitive and may be used to further identify the picked object. The primitives in\n * the list are ordered by their visual order in the scene (front to back).\n *\n * @param {Cartesian2} windowPosition Window coordinates to perform picking on.\n * @param {number} [limit] If supplied, stop drilling after collecting this many picks.\n * @param {number} [width=3] Width of the pick rectangle.\n * @param {number} [height=3] Height of the pick rectangle.\n * @returns {any[]} Array of objects, each containing 1 picked primitives.\n *\n * @exception {DeveloperError} windowPosition is undefined.\n *\n * @example\n * const pickedObjects = scene.drillPick(new Cesium.Cartesian2(100.0, 200.0));\n *\n * @see Scene#pick\n */\nScene.prototype.drillPick = function (windowPosition, limit, width, height) {\n  return this._picking.drillPick(this, windowPosition, limit, width, height);\n};\n\nfunction updatePreloadPass(scene) {\n  const frameState = scene._frameState;\n  preloadTilesetPassState.camera = frameState.camera;\n  preloadTilesetPassState.cullingVolume = frameState.cullingVolume;\n\n  const primitives = scene.primitives;\n  primitives.updateForPass(frameState, preloadTilesetPassState);\n}\n\nfunction updatePreloadFlightPass(scene) {\n  const frameState = scene._frameState;\n  const camera = frameState.camera;\n  if (!camera.canPreloadFlight()) {\n    return;\n  }\n\n  preloadFlightTilesetPassState.camera = scene.preloadFlightCamera;\n  preloadFlightTilesetPassState.cullingVolume =\n    scene.preloadFlightCullingVolume;\n\n  const primitives = scene.primitives;\n  primitives.updateForPass(frameState, preloadFlightTilesetPassState);\n}\n\nfunction updateRequestRenderModeDeferCheckPass(scene) {\n  // Check if any ignored requests are ready to go (to wake rendering up again)\n  scene.primitives.updateForPass(\n    scene._frameState,\n    requestRenderModeDeferCheckPassState\n  );\n}\n\n/**\n * Returns an object containing the first object intersected by the ray and the position of intersection,\n * or <code>undefined</code> if there were no intersections. The intersected object has a <code>primitive</code>\n * property that contains the intersected primitive. Other properties may be set depending on the type of primitive\n * and may be used to further identify the picked object. The ray must be given in world coordinates.\n * <p>\n * This function only picks globe tiles and 3D Tiles that are rendered in the current view. Picks all other\n * primitives regardless of their visibility.\n * </p>\n *\n * @private\n *\n * @param {Ray} ray The ray.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.\n * @param {number} [width=0.1] Width of the intersection volume in meters.\n * @returns {object} An object containing the object and position of the first intersection.\n *\n * @exception {DeveloperError} Ray intersections are only supported in 3D mode.\n */\nScene.prototype.pickFromRay = function (ray, objectsToExclude, width) {\n  return this._picking.pickFromRay(this, ray, objectsToExclude, width);\n};\n\n/**\n * Returns a list of objects, each containing the object intersected by the ray and the position of intersection.\n * The intersected object has a <code>primitive</code> property that contains the intersected primitive. Other\n * properties may also be set depending on the type of primitive and may be used to further identify the picked object.\n * The primitives in the list are ordered by first intersection to last intersection. The ray must be given in\n * world coordinates.\n * <p>\n * This function only picks globe tiles and 3D Tiles that are rendered in the current view. Picks all other\n * primitives regardless of their visibility.\n * </p>\n *\n * @private\n *\n * @param {Ray} ray The ray.\n * @param {number} [limit=Number.MAX_VALUE] If supplied, stop finding intersections after this many intersections.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.\n * @param {number} [width=0.1] Width of the intersection volume in meters.\n * @returns {Object[]} List of objects containing the object and position of each intersection.\n *\n * @exception {DeveloperError} Ray intersections are only supported in 3D mode.\n */\nScene.prototype.drillPickFromRay = function (\n  ray,\n  limit,\n  objectsToExclude,\n  width\n) {\n  return this._picking.drillPickFromRay(\n    this,\n    ray,\n    limit,\n    objectsToExclude,\n    width\n  );\n};\n\n/**\n * Initiates an asynchronous {@link Scene#pickFromRay} request using the maximum level of detail for 3D Tilesets\n * regardless of visibility.\n *\n * @private\n *\n * @param {Ray} ray The ray.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.\n * @param {number} [width=0.1] Width of the intersection volume in meters.\n * @returns {Promise<object>} A promise that resolves to an object containing the object and position of the first intersection.\n *\n * @exception {DeveloperError} Ray intersections are only supported in 3D mode.\n */\nScene.prototype.pickFromRayMostDetailed = function (\n  ray,\n  objectsToExclude,\n  width\n) {\n  return this._picking.pickFromRayMostDetailed(\n    this,\n    ray,\n    objectsToExclude,\n    width\n  );\n};\n\n/**\n * Initiates an asynchronous {@link Scene#drillPickFromRay} request using the maximum level of detail for 3D Tilesets\n * regardless of visibility.\n *\n * @private\n *\n * @param {Ray} ray The ray.\n * @param {number} [limit=Number.MAX_VALUE] If supplied, stop finding intersections after this many intersections.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.\n * @param {number} [width=0.1] Width of the intersection volume in meters.\n * @returns {Promise<Object[]>} A promise that resolves to a list of objects containing the object and position of each intersection.\n *\n * @exception {DeveloperError} Ray intersections are only supported in 3D mode.\n */\nScene.prototype.drillPickFromRayMostDetailed = function (\n  ray,\n  limit,\n  objectsToExclude,\n  width\n) {\n  return this._picking.drillPickFromRayMostDetailed(\n    this,\n    ray,\n    limit,\n    objectsToExclude,\n    width\n  );\n};\n\n/**\n * Returns the height of scene geometry at the given cartographic position or <code>undefined</code> if there was no\n * scene geometry to sample height from. The height of the input position is ignored. May be used to clamp objects to\n * the globe, 3D Tiles, or primitives in the scene.\n * <p>\n * This function only samples height from globe tiles and 3D Tiles that are rendered in the current view. Samples height\n * from all other primitives regardless of their visibility.\n * </p>\n *\n * @param {Cartographic} position The cartographic position to sample height from.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not sample height from.\n * @param {number} [width=0.1] Width of the intersection volume in meters.\n * @returns {number} The height. This may be <code>undefined</code> if there was no scene geometry to sample height from.\n *\n * @example\n * const position = new Cesium.Cartographic(-1.31968, 0.698874);\n * const height = viewer.scene.sampleHeight(position);\n * console.log(height);\n *\n * @see Scene#clampToHeight\n * @see Scene#clampToHeightMostDetailed\n * @see Scene#sampleHeightMostDetailed\n *\n * @exception {DeveloperError} sampleHeight is only supported in 3D mode.\n * @exception {DeveloperError} sampleHeight requires depth texture support. Check sampleHeightSupported.\n */\nScene.prototype.sampleHeight = function (position, objectsToExclude, width) {\n  return this._picking.sampleHeight(this, position, objectsToExclude, width);\n};\n\n/**\n * Clamps the given cartesian position to the scene geometry along the geodetic surface normal. Returns the\n * clamped position or <code>undefined</code> if there was no scene geometry to clamp to. May be used to clamp\n * objects to the globe, 3D Tiles, or primitives in the scene.\n * <p>\n * This function only clamps to globe tiles and 3D Tiles that are rendered in the current view. Clamps to\n * all other primitives regardless of their visibility.\n * </p>\n *\n * @param {Cartesian3} cartesian The cartesian position.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not clamp to.\n * @param {number} [width=0.1] Width of the intersection volume in meters.\n * @param {Cartesian3} [result] An optional object to return the clamped position.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. This may be <code>undefined</code> if there was no scene geometry to clamp to.\n *\n * @example\n * // Clamp an entity to the underlying scene geometry\n * const position = entity.position.getValue(Cesium.JulianDate.now());\n * entity.position = viewer.scene.clampToHeight(position);\n *\n * @see Scene#sampleHeight\n * @see Scene#sampleHeightMostDetailed\n * @see Scene#clampToHeightMostDetailed\n *\n * @exception {DeveloperError} clampToHeight is only supported in 3D mode.\n * @exception {DeveloperError} clampToHeight requires depth texture support. Check clampToHeightSupported.\n */\nScene.prototype.clampToHeight = function (\n  cartesian,\n  objectsToExclude,\n  width,\n  result\n) {\n  return this._picking.clampToHeight(\n    this,\n    cartesian,\n    objectsToExclude,\n    width,\n    result\n  );\n};\n\n/**\n * Initiates an asynchronous {@link Scene#sampleHeight} query for an array of {@link Cartographic} positions\n * using the maximum level of detail for 3D Tilesets in the scene. The height of the input positions is ignored.\n * Returns a promise that is resolved when the query completes. Each point height is modified in place.\n * If a height cannot be determined because no geometry can be sampled at that location, or another error occurs,\n * the height is set to undefined.\n *\n * @param {Cartographic[]} positions The cartographic positions to update with sampled heights.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not sample height from.\n * @param {number} [width=0.1] Width of the intersection volume in meters.\n * @returns {Promise<Cartographic[]>} A promise that resolves to the provided list of positions when the query has completed.\n *\n * @example\n * const positions = [\n *     new Cesium.Cartographic(-1.31968, 0.69887),\n *     new Cesium.Cartographic(-1.10489, 0.83923)\n * ];\n * const promise = viewer.scene.sampleHeightMostDetailed(positions);\n * promise.then(function(updatedPosition) {\n *     // positions[0].height and positions[1].height have been updated.\n *     // updatedPositions is just a reference to positions.\n * }\n *\n * @see Scene#sampleHeight\n *\n * @exception {DeveloperError} sampleHeightMostDetailed is only supported in 3D mode.\n * @exception {DeveloperError} sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.\n */\nScene.prototype.sampleHeightMostDetailed = function (\n  positions,\n  objectsToExclude,\n  width\n) {\n  return this._picking.sampleHeightMostDetailed(\n    this,\n    positions,\n    objectsToExclude,\n    width\n  );\n};\n\n/**\n * Initiates an asynchronous {@link Scene#clampToHeight} query for an array of {@link Cartesian3} positions\n * using the maximum level of detail for 3D Tilesets in the scene. Returns a promise that is resolved when\n * the query completes. Each position is modified in place. If a position cannot be clamped because no geometry\n * can be sampled at that location, or another error occurs, the element in the array is set to undefined.\n *\n * @param {Cartesian3[]} cartesians The cartesian positions to update with clamped positions.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not clamp to.\n * @param {number} [width=0.1] Width of the intersection volume in meters.\n * @returns {Promise<Cartesian3[]>} A promise that resolves to the provided list of positions when the query has completed.\n *\n * @example\n * const cartesians = [\n *     entities[0].position.getValue(Cesium.JulianDate.now()),\n *     entities[1].position.getValue(Cesium.JulianDate.now())\n * ];\n * const promise = viewer.scene.clampToHeightMostDetailed(cartesians);\n * promise.then(function(updatedCartesians) {\n *     entities[0].position = updatedCartesians[0];\n *     entities[1].position = updatedCartesians[1];\n * }\n *\n * @see Scene#clampToHeight\n *\n * @exception {DeveloperError} clampToHeightMostDetailed is only supported in 3D mode.\n * @exception {DeveloperError} clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported.\n */\nScene.prototype.clampToHeightMostDetailed = function (\n  cartesians,\n  objectsToExclude,\n  width\n) {\n  return this._picking.clampToHeightMostDetailed(\n    this,\n    cartesians,\n    objectsToExclude,\n    width\n  );\n};\n\n/**\n * Transforms a position in cartesian coordinates to canvas coordinates.  This is commonly used to place an\n * HTML element at the same screen position as an object in the scene.\n *\n * @param {Cartesian3} position The position in cartesian coordinates.\n * @param {Cartesian2} [result] An optional object to return the input position transformed to canvas coordinates.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.  This may be <code>undefined</code> if the input position is near the center of the ellipsoid.\n *\n * @example\n * // Output the canvas position of longitude/latitude (0, 0) every time the mouse moves.\n * const scene = widget.scene;\n * const ellipsoid = scene.globe.ellipsoid;\n * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);\n * handler.setInputAction(function(movement) {\n *     console.log(scene.cartesianToCanvasCoordinates(position));\n * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);\n */\nScene.prototype.cartesianToCanvasCoordinates = function (position, result) {\n  return SceneTransforms.wgs84ToWindowCoordinates(this, position, result);\n};\n\n/**\n * Instantly completes an active transition.\n */\nScene.prototype.completeMorph = function () {\n  this._transitioner.completeMorph();\n};\n\n/**\n * Asynchronously transitions the scene to 2D.\n * @param {number} [duration=2.0] The amount of time, in seconds, for transition animations to complete.\n */\nScene.prototype.morphTo2D = function (duration) {\n  let ellipsoid;\n  const globe = this.globe;\n  if (defined(globe)) {\n    ellipsoid = globe.ellipsoid;\n  } else {\n    ellipsoid = this.mapProjection.ellipsoid;\n  }\n  duration = defaultValue(duration, 2.0);\n  this._transitioner.morphTo2D(duration, ellipsoid);\n};\n\n/**\n * Asynchronously transitions the scene to Columbus View.\n * @param {number} [duration=2.0] The amount of time, in seconds, for transition animations to complete.\n */\nScene.prototype.morphToColumbusView = function (duration) {\n  let ellipsoid;\n  const globe = this.globe;\n  if (defined(globe)) {\n    ellipsoid = globe.ellipsoid;\n  } else {\n    ellipsoid = this.mapProjection.ellipsoid;\n  }\n  duration = defaultValue(duration, 2.0);\n  this._transitioner.morphToColumbusView(duration, ellipsoid);\n};\n\n/**\n * Asynchronously transitions the scene to 3D.\n * @param {number} [duration=2.0] The amount of time, in seconds, for transition animations to complete.\n */\nScene.prototype.morphTo3D = function (duration) {\n  let ellipsoid;\n  const globe = this.globe;\n  if (defined(globe)) {\n    ellipsoid = globe.ellipsoid;\n  } else {\n    ellipsoid = this.mapProjection.ellipsoid;\n  }\n  duration = defaultValue(duration, 2.0);\n  this._transitioner.morphTo3D(duration, ellipsoid);\n};\n\nfunction setTerrain(scene, terrain) {\n  // Cancel any in-progress terrain update\n  scene._removeTerrainProviderReadyListener =\n    scene._removeTerrainProviderReadyListener &&\n    scene._removeTerrainProviderReadyListener();\n\n  // If the terrain is already loaded, set it immediately\n  if (terrain.ready) {\n    if (defined(scene.globe)) {\n      scene.globe.terrainProvider = terrain.provider;\n    }\n    return;\n  }\n  // Otherwise, set a placeholder\n  scene.globe.terrainProvider = undefined;\n  scene._removeTerrainProviderReadyListener = terrain.readyEvent.addEventListener(\n    (provider) => {\n      if (defined(scene) && defined(scene.globe)) {\n        scene.globe.terrainProvider = provider;\n      }\n\n      scene._removeTerrainProviderReadyListener();\n    }\n  );\n}\n\n/**\n * Update the terrain providing surface geometry for the globe.\n *\n * @param {Terrain} terrain The terrain provider async helper\n * @returns {Terrain} terrain The terrain provider async helper\n *\n * @example\n * // Use Cesium World Terrain\n * scene.setTerrain(Cesium.Terrain.fromWorldTerrain());\n *\n * @example\n * // Use a custom terrain provider\n * const terrain = new Cesium.Terrain(Cesium.CesiumTerrainProvider.fromUrl(\"https://myTestTerrain.com\"));\n * scene.setTerrain(terrain);\n *\n * terrain.errorEvent.addEventListener(error => {\n *   alert(`Encountered an error while creating terrain! ${error}`);\n * });\n */\nScene.prototype.setTerrain = function (terrain) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"terrain\", terrain);\n  //>>includeEnd('debug');\n\n  setTerrain(this, terrain);\n\n  return terrain;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see Scene#destroy\n */\nScene.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * scene = scene && scene.destroy();\n *\n * @see Scene#isDestroyed\n */\nScene.prototype.destroy = function () {\n  this._tweens.removeAll();\n  this._computeEngine = this._computeEngine && this._computeEngine.destroy();\n  this._screenSpaceCameraController =\n    this._screenSpaceCameraController &&\n    this._screenSpaceCameraController.destroy();\n  this._deviceOrientationCameraController =\n    this._deviceOrientationCameraController &&\n    !this._deviceOrientationCameraController.isDestroyed() &&\n    this._deviceOrientationCameraController.destroy();\n  this._primitives = this._primitives && this._primitives.destroy();\n  this._groundPrimitives =\n    this._groundPrimitives && this._groundPrimitives.destroy();\n  this._globe = this._globe && this._globe.destroy();\n  this._removeTerrainProviderReadyListener =\n    this._removeTerrainProviderReadyListener &&\n    this._removeTerrainProviderReadyListener();\n  this.skyBox = this.skyBox && this.skyBox.destroy();\n  this.skyAtmosphere = this.skyAtmosphere && this.skyAtmosphere.destroy();\n  this._debugSphere = this._debugSphere && this._debugSphere.destroy();\n  this.sun = this.sun && this.sun.destroy();\n  this._sunPostProcess = this._sunPostProcess && this._sunPostProcess.destroy();\n  this._depthPlane = this._depthPlane && this._depthPlane.destroy();\n  this._transitioner = this._transitioner && this._transitioner.destroy();\n  this._debugFrustumPlanes =\n    this._debugFrustumPlanes && this._debugFrustumPlanes.destroy();\n  this._brdfLutGenerator =\n    this._brdfLutGenerator && this._brdfLutGenerator.destroy();\n  this._picking = this._picking && this._picking.destroy();\n\n  this._defaultView = this._defaultView && this._defaultView.destroy();\n  this._view = undefined;\n\n  if (this._removeCreditContainer) {\n    this._canvas.parentNode.removeChild(this._creditContainer);\n  }\n\n  this.postProcessStages =\n    this.postProcessStages && this.postProcessStages.destroy();\n\n  this._context = this._context && this._context.destroy();\n  this._frameState.creditDisplay =\n    this._frameState.creditDisplay && this._frameState.creditDisplay.destroy();\n\n  if (defined(this._performanceDisplay)) {\n    this._performanceDisplay =\n      this._performanceDisplay && this._performanceDisplay.destroy();\n    this._performanceContainer.parentNode.removeChild(\n      this._performanceContainer\n    );\n  }\n\n  this._removeRequestListenerCallback();\n  this._removeTaskProcessorListenerCallback();\n  for (let i = 0; i < this._removeGlobeCallbacks.length; ++i) {\n    this._removeGlobeCallbacks[i]();\n  }\n  this._removeGlobeCallbacks.length = 0;\n\n  return destroyObject(this);\n};\nexport default Scene;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float interpolateByDistance(vec4 nearFarScalar, float distance)\\n\\\n{\\n\\\n    float startDistance = nearFarScalar.x;\\n\\\n    float startValue = nearFarScalar.y;\\n\\\n    float endDistance = nearFarScalar.z;\\n\\\n    float endValue = nearFarScalar.w;\\n\\\n    float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);\\n\\\n    return mix(startValue, endValue, t);\\n\\\n}\\n\\\n\\n\\\nvec3 getLightDirection(vec3 positionWC)\\n\\\n{\\n\\\n    float lightEnum = u_radiiAndDynamicAtmosphereColor.z;\\n\\\n    vec3 lightDirection =\\n\\\n        positionWC * float(lightEnum == 0.0) +\\n\\\n        czm_lightDirectionWC * float(lightEnum == 1.0) +\\n\\\n        czm_sunDirectionWC * float(lightEnum == 2.0);\\n\\\n    return normalize(lightDirection);\\n\\\n}\\n\\\n\\n\\\nvoid computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe)\\n\\\n{\\n\\\n    float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z;\\n\\\n\\n\\\n    // Adjustment to the atmosphere radius applied based on the camera height.\\n\\\n    float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0;\\n\\\n    float distanceAdjustMax = czm_ellipsoidRadii.x;\\n\\\n    float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0;\\n\\\n    float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0);\\n\\\n\\n\\\n    // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit \\n\\\n    // for the position on the ellipsoid.\\n\\\n    float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust;\\n\\\n    float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust;\\n\\\n\\n\\\n    // Setup the primary ray: from the camera position to the vertex position.\\n\\\n    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;\\n\\\n    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);\\n\\\n    czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);\\n\\\n\\n\\\n    underTranslucentGlobe = 0.0;\\n\\\n\\n\\\n    // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled.\\n\\\n    #if defined(GLOBE_TRANSLUCENT)\\n\\\n\\n\\\n        // Check for intersection with the inner radius of the atmopshere.\\n\\\n        czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust);\\n\\\n        if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) {\\n\\\n            \\n\\\n            // Compute position on globe.\\n\\\n            vec3 direction = normalize(positionWC);\\n\\\n            czm_ray ellipsoidRay = czm_ray(positionWC, -direction);\\n\\\n            czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii);\\n\\\n            vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start);\\n\\\n\\n\\\n            // Control the color using the camera angle.\\n\\\n            float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth));\\n\\\n\\n\\\n            // Control the opacity using the distance from Earth.\\n\\\n            opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth));\\n\\\n            vec3 horizonColor = vec3(0.1, 0.2, 0.3);\\n\\\n            vec3 nearColor = vec3(0.0);\\n\\\n\\n\\\n            rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity);\\n\\\n            \\n\\\n            // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton.\\n\\\n            underTranslucentGlobe = 1.0;\\n\\\n            return;\\n\\\n        }\\n\\\n    #endif\\n\\\n\\n\\\n    computeScattering(\\n\\\n        primaryRay,\\n\\\n        length(cameraToPositionWC),\\n\\\n        lightDirection,\\n\\\n        atmosphereInnerRadius,\\n\\\n        rayleighColor,\\n\\\n        mieColor,\\n\\\n        opacity\\n\\\n    );\\n\\\n\\n\\\n    // Alter the opacity based on how close the viewer is to the ground.\\n\\\n    // (0.0 = At edge of atmosphere, 1.0 = On ground)\\n\\\n    float cameraHeight = czm_eyeHeight + atmosphereInnerRadius;\\n\\\n    float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;\\n\\\n    opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0);\\n\\\n\\n\\\n    // Alter alpha based on time of day (0.0 = night , 1.0 = day)\\n\\\n    float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;\\n\\\n    opacity *= pow(nightAlpha, 0.5);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 v_outerPositionWC;\\n\\\n\\n\\\nuniform vec3 u_hsbShift;\\n\\\n\\n\\\n#ifndef PER_FRAGMENT_ATMOSPHERE\\n\\\nin vec3 v_mieColor;\\n\\\nin vec3 v_rayleighColor;\\n\\\nin float v_opacity;\\n\\\nin float v_translucent;\\n\\\n#endif\\n\\\n\\n\\\nvoid main (void)\\n\\\n{\\n\\\n    vec3 lightDirection = getLightDirection(v_outerPositionWC);\\n\\\n   \\n\\\n    vec3 mieColor;\\n\\\n    vec3 rayleighColor;\\n\\\n    float opacity;\\n\\\n    float translucent;\\n\\\n\\n\\\n    #ifdef PER_FRAGMENT_ATMOSPHERE\\n\\\n        computeAtmosphereScattering(\\n\\\n            v_outerPositionWC,\\n\\\n            lightDirection,\\n\\\n            rayleighColor,\\n\\\n            mieColor,\\n\\\n            opacity,\\n\\\n            translucent\\n\\\n        );\\n\\\n    #else\\n\\\n        mieColor = v_mieColor;\\n\\\n        rayleighColor = v_rayleighColor;\\n\\\n        opacity = v_opacity;\\n\\\n        translucent = v_translucent;\\n\\\n    #endif\\n\\\n\\n\\\n    vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);\\n\\\n\\n\\\n    #ifndef HDR\\n\\\n        color.rgb = czm_acesTonemapping(color.rgb);\\n\\\n        color.rgb = czm_inverseGamma(color.rgb);\\n\\\n    #endif\\n\\\n\\n\\\n    #ifdef COLOR_CORRECT\\n\\\n        // Convert rgb color to hsb\\n\\\n        vec3 hsb = czm_RGBToHSB(color.rgb);\\n\\\n        // Perform hsb shift\\n\\\n        hsb.x += u_hsbShift.x; // hue\\n\\\n        hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation\\n\\\n        hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness\\n\\\n        // Convert shifted hsb back to rgb\\n\\\n        color.rgb = czm_HSBToRGB(hsb);\\n\\\n    #endif\\n\\\n\\n\\\n    // For the parts of the sky atmosphere that are not behind a translucent globe,\\n\\\n    // we mix in the default opacity so that the sky atmosphere still appears at distance.\\n\\\n    // This is needed because the opacity in the sky atmosphere is initially adjusted based\\n\\\n    // on the camera height.\\n\\\n    if (translucent == 0.0) {\\n\\\n        color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);\\n\\\n    }\\n\\\n\\n\\\n    out_FragColor = color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec4 position;\\n\\\n\\n\\\nout vec3 v_outerPositionWC;\\n\\\n\\n\\\n#ifndef PER_FRAGMENT_ATMOSPHERE\\n\\\nout vec3 v_mieColor;\\n\\\nout vec3 v_rayleighColor;\\n\\\nout float v_opacity;\\n\\\nout float v_translucent;\\n\\\n#endif\\n\\\n\\n\\\nvoid main(void)\\n\\\n{\\n\\\n    vec4 positionWC = czm_model * position;\\n\\\n    vec3 lightDirection = getLightDirection(positionWC.xyz);\\n\\\n\\n\\\n    #ifndef PER_FRAGMENT_ATMOSPHERE\\n\\\n        computeAtmosphereScattering(\\n\\\n            positionWC.xyz,\\n\\\n            lightDirection,\\n\\\n            v_rayleighColor,\\n\\\n            v_mieColor,\\n\\\n            v_opacity,\\n\\\n            v_translucent\\n\\\n        );\\n\\\n    #endif\\n\\\n    \\n\\\n    v_outerPositionWC = positionWC.xyz;\\n\\\n    gl_Position = czm_modelViewProjection * position;\\n\\\n}\\n\\\n\";\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport EllipsoidGeometry from \"../Core/EllipsoidGeometry.js\";\nimport GeometryPipeline from \"../Core/GeometryPipeline.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport AtmosphereCommon from \"../Shaders/AtmosphereCommon.js\";\nimport SkyAtmosphereCommon from \"../Shaders/SkyAtmosphereCommon.js\";\nimport SkyAtmosphereFS from \"../Shaders/SkyAtmosphereFS.js\";\nimport SkyAtmosphereVS from \"../Shaders/SkyAtmosphereVS.js\";\nimport Axis from \"./Axis.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport CullFace from \"./CullFace.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * An atmosphere drawn around the limb of the provided ellipsoid. Based on\n * {@link http://nishitalab.org/user/nis/cdrom/sig93_nis.pdf|Display of The Earth Taking Into Account Atmospheric Scattering}.\n * <p>\n * This is only supported in 3D. Atmosphere is faded out when morphing to 2D or Columbus view.\n * </p>\n *\n * @alias SkyAtmosphere\n * @constructor\n *\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid that the atmosphere is drawn around.\n *\n * @example\n * scene.skyAtmosphere = new Cesium.SkyAtmosphere();\n *\n * @see Scene.skyAtmosphere\n */\nfunction SkyAtmosphere(ellipsoid) {\n  ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n  /**\n   * Determines if the atmosphere is shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = true;\n\n  /**\n   * Compute atmosphere per-fragment instead of per-vertex.\n   * This produces better looking atmosphere with a slight performance penalty.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.perFragmentAtmosphere = false;\n\n  this._ellipsoid = ellipsoid;\n\n  const outerEllipsoidScale = 1.025;\n  const scaleVector = Cartesian3.multiplyByScalar(\n    ellipsoid.radii,\n    outerEllipsoidScale,\n    new Cartesian3()\n  );\n  this._scaleMatrix = Matrix4.fromScale(scaleVector);\n  this._modelMatrix = new Matrix4();\n\n  this._command = new DrawCommand({\n    owner: this,\n    modelMatrix: this._modelMatrix,\n  });\n  this._spSkyFromSpace = undefined;\n  this._spSkyFromAtmosphere = undefined;\n\n  this._flags = undefined;\n\n  /**\n   * The intensity of the light that is used for computing the sky atmosphere color.\n   *\n   * @type {number}\n   * @default 50.0\n   */\n  this.atmosphereLightIntensity = 50.0;\n\n  /**\n   * The Rayleigh scattering coefficient used in the atmospheric scattering equations for the sky atmosphere.\n   *\n   * @type {Cartesian3}\n   * @default Cartesian3(5.5e-6, 13.0e-6, 28.4e-6)\n   */\n  this.atmosphereRayleighCoefficient = new Cartesian3(5.5e-6, 13.0e-6, 28.4e-6);\n\n  /**\n   * The Mie scattering coefficient used in the atmospheric scattering equations for the sky atmosphere.\n   *\n   * @type {Cartesian3}\n   * @default Cartesian3(21e-6, 21e-6, 21e-6)\n   */\n  this.atmosphereMieCoefficient = new Cartesian3(21e-6, 21e-6, 21e-6);\n\n  /**\n   * The Rayleigh scale height used in the atmospheric scattering equations for the sky atmosphere, in meters.\n   *\n   * @type {number}\n   * @default 10000.0\n   */\n  this.atmosphereRayleighScaleHeight = 10000.0;\n\n  /**\n   * The Mie scale height used in the atmospheric scattering equations for the sky atmosphere, in meters.\n   *\n   * @type {number}\n   * @default 3200.0\n   */\n  this.atmosphereMieScaleHeight = 3200.0;\n\n  /**\n   * The anisotropy of the medium to consider for Mie scattering.\n   * <p>\n   * Valid values are between -1.0 and 1.0.\n   * </p>\n   * @type {number}\n   * @default 0.9\n   */\n  this.atmosphereMieAnisotropy = 0.9;\n\n  /**\n   * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).\n   * A hue shift of 1.0 indicates a complete rotation of the hues available.\n   * @type {number}\n   * @default 0.0\n   */\n  this.hueShift = 0.0;\n\n  /**\n   * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).\n   * A saturation shift of -1.0 is monochrome.\n   * @type {number}\n   * @default 0.0\n   */\n  this.saturationShift = 0.0;\n\n  /**\n   * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).\n   * A brightness shift of -1.0 is complete darkness, which will let space show through.\n   * @type {number}\n   * @default 0.0\n   */\n  this.brightnessShift = 0.0;\n\n  this._hueSaturationBrightness = new Cartesian3();\n\n  // outer radius, inner radius, dynamic atmosphere color flag\n  const radiiAndDynamicAtmosphereColor = new Cartesian3();\n\n  radiiAndDynamicAtmosphereColor.x =\n    ellipsoid.maximumRadius * outerEllipsoidScale;\n  radiiAndDynamicAtmosphereColor.y = ellipsoid.maximumRadius;\n\n  // Toggles whether the sun position is used. 0 treats the sun as always directly overhead.\n  radiiAndDynamicAtmosphereColor.z = 0;\n\n  this._radiiAndDynamicAtmosphereColor = radiiAndDynamicAtmosphereColor;\n\n  const that = this;\n\n  this._command.uniformMap = {\n    u_radiiAndDynamicAtmosphereColor: function () {\n      return that._radiiAndDynamicAtmosphereColor;\n    },\n    u_hsbShift: function () {\n      that._hueSaturationBrightness.x = that.hueShift;\n      that._hueSaturationBrightness.y = that.saturationShift;\n      that._hueSaturationBrightness.z = that.brightnessShift;\n      return that._hueSaturationBrightness;\n    },\n    u_atmosphereLightIntensity: function () {\n      return that.atmosphereLightIntensity;\n    },\n    u_atmosphereRayleighCoefficient: function () {\n      return that.atmosphereRayleighCoefficient;\n    },\n    u_atmosphereMieCoefficient: function () {\n      return that.atmosphereMieCoefficient;\n    },\n    u_atmosphereRayleighScaleHeight: function () {\n      return that.atmosphereRayleighScaleHeight;\n    },\n    u_atmosphereMieScaleHeight: function () {\n      return that.atmosphereMieScaleHeight;\n    },\n    u_atmosphereMieAnisotropy: function () {\n      return that.atmosphereMieAnisotropy;\n    },\n  };\n}\n\nObject.defineProperties(SkyAtmosphere.prototype, {\n  /**\n   * Gets the ellipsoid the atmosphere is drawn around.\n   * @memberof SkyAtmosphere.prototype\n   *\n   * @type {Ellipsoid}\n   * @readonly\n   */\n  ellipsoid: {\n    get: function () {\n      return this._ellipsoid;\n    },\n  },\n});\n\n/**\n * @private\n */\nSkyAtmosphere.prototype.setDynamicAtmosphereColor = function (\n  enableLighting,\n  useSunDirection\n) {\n  const lightEnum = enableLighting ? (useSunDirection ? 2.0 : 1.0) : 0.0;\n  this._radiiAndDynamicAtmosphereColor.z = lightEnum;\n};\n\nconst scratchModelMatrix = new Matrix4();\n\n/**\n * @private\n */\nSkyAtmosphere.prototype.update = function (frameState, globe) {\n  if (!this.show) {\n    return undefined;\n  }\n\n  const mode = frameState.mode;\n  if (mode !== SceneMode.SCENE3D && mode !== SceneMode.MORPHING) {\n    return undefined;\n  }\n\n  // The atmosphere is only rendered during the render pass; it is not pickable, it doesn't cast shadows, etc.\n  if (!frameState.passes.render) {\n    return undefined;\n  }\n\n  // Align the ellipsoid geometry so it always faces the same direction as the\n  // camera to reduce artifacts when rendering atmosphere per-vertex\n  const rotationMatrix = Matrix4.fromRotationTranslation(\n    frameState.context.uniformState.inverseViewRotation,\n    Cartesian3.ZERO,\n    scratchModelMatrix\n  );\n  const rotationOffsetMatrix = Matrix4.multiplyTransformation(\n    rotationMatrix,\n    Axis.Y_UP_TO_Z_UP,\n    scratchModelMatrix\n  );\n  const modelMatrix = Matrix4.multiply(\n    this._scaleMatrix,\n    rotationOffsetMatrix,\n    scratchModelMatrix\n  );\n  Matrix4.clone(modelMatrix, this._modelMatrix);\n\n  const context = frameState.context;\n\n  const colorCorrect = hasColorCorrection(this);\n  const translucent = frameState.globeTranslucencyState.translucent;\n  const perFragmentAtmosphere =\n    this.perFragmentAtmosphere || translucent || !defined(globe) || !globe.show;\n\n  const command = this._command;\n\n  if (!defined(command.vertexArray)) {\n    const geometry = EllipsoidGeometry.createGeometry(\n      new EllipsoidGeometry({\n        radii: new Cartesian3(1.0, 1.0, 1.0),\n        slicePartitions: 256,\n        stackPartitions: 256,\n        vertexFormat: VertexFormat.POSITION_ONLY,\n      })\n    );\n    command.vertexArray = VertexArray.fromGeometry({\n      context: context,\n      geometry: geometry,\n      attributeLocations: GeometryPipeline.createAttributeLocations(geometry),\n      bufferUsage: BufferUsage.STATIC_DRAW,\n    });\n    command.renderState = RenderState.fromCache({\n      cull: {\n        enabled: true,\n        face: CullFace.FRONT,\n      },\n      blending: BlendingState.ALPHA_BLEND,\n      depthMask: false,\n    });\n  }\n\n  const flags =\n    colorCorrect | (perFragmentAtmosphere << 2) | (translucent << 3);\n\n  if (flags !== this._flags) {\n    this._flags = flags;\n\n    const defines = [];\n\n    if (colorCorrect) {\n      defines.push(\"COLOR_CORRECT\");\n    }\n\n    if (perFragmentAtmosphere) {\n      defines.push(\"PER_FRAGMENT_ATMOSPHERE\");\n    }\n\n    if (translucent) {\n      defines.push(\"GLOBE_TRANSLUCENT\");\n    }\n\n    const vs = new ShaderSource({\n      defines: defines,\n      sources: [AtmosphereCommon, SkyAtmosphereCommon, SkyAtmosphereVS],\n    });\n\n    const fs = new ShaderSource({\n      defines: defines,\n      sources: [AtmosphereCommon, SkyAtmosphereCommon, SkyAtmosphereFS],\n    });\n\n    this._spSkyAtmosphere = ShaderProgram.fromCache({\n      context: context,\n      vertexShaderSource: vs,\n      fragmentShaderSource: fs,\n    });\n\n    command.shaderProgram = this._spSkyAtmosphere;\n  }\n\n  return command;\n};\n\nfunction hasColorCorrection(skyAtmosphere) {\n  return !(\n    CesiumMath.equalsEpsilon(\n      skyAtmosphere.hueShift,\n      0.0,\n      CesiumMath.EPSILON7\n    ) &&\n    CesiumMath.equalsEpsilon(\n      skyAtmosphere.saturationShift,\n      0.0,\n      CesiumMath.EPSILON7\n    ) &&\n    CesiumMath.equalsEpsilon(\n      skyAtmosphere.brightnessShift,\n      0.0,\n      CesiumMath.EPSILON7\n    )\n  );\n}\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see SkyAtmosphere#destroy\n */\nSkyAtmosphere.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * skyAtmosphere = skyAtmosphere && skyAtmosphere.destroy();\n *\n * @see SkyAtmosphere#isDestroyed\n */\nSkyAtmosphere.prototype.destroy = function () {\n  const command = this._command;\n  command.vertexArray = command.vertexArray && command.vertexArray.destroy();\n  this._spSkyAtmosphere =\n    this._spSkyAtmosphere && this._spSkyAtmosphere.destroy();\n  return destroyObject(this);\n};\nexport default SkyAtmosphere;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform samplerCube u_cubeMap;\\n\\\n\\n\\\nin vec3 v_texCoord;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord));\\n\\\n    out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 position;\\n\\\n\\n\\\nout vec3 v_texCoord;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\\n\\\n    gl_Position = czm_projection * vec4(p, 1.0);\\n\\\n    v_texCoord = position.xyz;\\n\\\n}\\n\\\n\";\n", "import BoxGeometry from \"../Core/BoxGeometry.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GeometryPipeline from \"../Core/GeometryPipeline.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport CubeMap from \"../Renderer/CubeMap.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport loadCubeMap from \"../Renderer/loadCubeMap.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport SkyBoxFS from \"../Shaders/SkyBoxFS.js\";\nimport SkyBoxVS from \"../Shaders/SkyBoxVS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * A sky box around the scene to draw stars.  The sky box is defined using the True Equator Mean Equinox (TEME) axes.\n * <p>\n * This is only supported in 3D.  The sky box is faded out when morphing to 2D or Columbus view.  The size of\n * the sky box must not exceed {@link Scene#maximumCubeMapSize}.\n * </p>\n *\n * @alias SkyBox\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {object} [options.sources] The source URL or <code>Image</code> object for each of the six cube map faces.  See the example below.\n * @param {boolean} [options.show=true] Determines if this primitive will be shown.\n *\n *\n * @example\n * scene.skyBox = new Cesium.SkyBox({\n *   sources : {\n *     positiveX : 'skybox_px.png',\n *     negativeX : 'skybox_nx.png',\n *     positiveY : 'skybox_py.png',\n *     negativeY : 'skybox_ny.png',\n *     positiveZ : 'skybox_pz.png',\n *     negativeZ : 'skybox_nz.png'\n *   }\n * });\n *\n * @see Scene#skyBox\n * @see Transforms.computeTemeToPseudoFixedMatrix\n */\nfunction SkyBox(options) {\n  /**\n   * The sources used to create the cube map faces: an object\n   * with <code>positiveX</code>, <code>negativeX</code>, <code>positiveY</code>,\n   * <code>negativeY</code>, <code>positiveZ</code>, and <code>negativeZ</code> properties.\n   * These can be either URLs or <code>Image</code> objects.\n   *\n   * @type {object}\n   * @default undefined\n   */\n  this.sources = options.sources;\n  this._sources = undefined;\n\n  /**\n   * Determines if the sky box will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  this._command = new DrawCommand({\n    modelMatrix: Matrix4.clone(Matrix4.IDENTITY),\n    owner: this,\n  });\n  this._cubeMap = undefined;\n\n  this._attributeLocations = undefined;\n  this._useHdr = undefined;\n}\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly.  This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {DeveloperError} this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.\n * @exception {DeveloperError} this.sources properties must all be the same type.\n */\nSkyBox.prototype.update = function (frameState, useHdr) {\n  const that = this;\n\n  if (!this.show) {\n    return undefined;\n  }\n\n  if (\n    frameState.mode !== SceneMode.SCENE3D &&\n    frameState.mode !== SceneMode.MORPHING\n  ) {\n    return undefined;\n  }\n\n  // The sky box is only rendered during the render pass; it is not pickable, it doesn't cast shadows, etc.\n  if (!frameState.passes.render) {\n    return undefined;\n  }\n\n  const context = frameState.context;\n\n  if (this._sources !== this.sources) {\n    this._sources = this.sources;\n    const sources = this.sources;\n\n    //>>includeStart('debug', pragmas.debug);\n    if (\n      !defined(sources.positiveX) ||\n      !defined(sources.negativeX) ||\n      !defined(sources.positiveY) ||\n      !defined(sources.negativeY) ||\n      !defined(sources.positiveZ) ||\n      !defined(sources.negativeZ)\n    ) {\n      throw new DeveloperError(\n        \"this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.\"\n      );\n    }\n\n    if (\n      typeof sources.positiveX !== typeof sources.negativeX ||\n      typeof sources.positiveX !== typeof sources.positiveY ||\n      typeof sources.positiveX !== typeof sources.negativeY ||\n      typeof sources.positiveX !== typeof sources.positiveZ ||\n      typeof sources.positiveX !== typeof sources.negativeZ\n    ) {\n      throw new DeveloperError(\n        \"this.sources properties must all be the same type.\"\n      );\n    }\n    //>>includeEnd('debug');\n\n    if (typeof sources.positiveX === \"string\") {\n      // Given urls for cube-map images.  Load them.\n      loadCubeMap(context, this._sources).then(function (cubeMap) {\n        that._cubeMap = that._cubeMap && that._cubeMap.destroy();\n        that._cubeMap = cubeMap;\n      });\n    } else {\n      this._cubeMap = this._cubeMap && this._cubeMap.destroy();\n      this._cubeMap = new CubeMap({\n        context: context,\n        source: sources,\n      });\n    }\n  }\n\n  const command = this._command;\n\n  if (!defined(command.vertexArray)) {\n    command.uniformMap = {\n      u_cubeMap: function () {\n        return that._cubeMap;\n      },\n    };\n\n    const geometry = BoxGeometry.createGeometry(\n      BoxGeometry.fromDimensions({\n        dimensions: new Cartesian3(2.0, 2.0, 2.0),\n        vertexFormat: VertexFormat.POSITION_ONLY,\n      })\n    );\n    const attributeLocations = (this._attributeLocations = GeometryPipeline.createAttributeLocations(\n      geometry\n    ));\n\n    command.vertexArray = VertexArray.fromGeometry({\n      context: context,\n      geometry: geometry,\n      attributeLocations: attributeLocations,\n      bufferUsage: BufferUsage.STATIC_DRAW,\n    });\n\n    command.renderState = RenderState.fromCache({\n      blending: BlendingState.ALPHA_BLEND,\n    });\n  }\n\n  if (!defined(command.shaderProgram) || this._useHdr !== useHdr) {\n    const fs = new ShaderSource({\n      defines: [useHdr ? \"HDR\" : \"\"],\n      sources: [SkyBoxFS],\n    });\n    command.shaderProgram = ShaderProgram.fromCache({\n      context: context,\n      vertexShaderSource: SkyBoxVS,\n      fragmentShaderSource: fs,\n      attributeLocations: this._attributeLocations,\n    });\n    this._useHdr = useHdr;\n  }\n\n  if (!defined(this._cubeMap)) {\n    return undefined;\n  }\n\n  return command;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see SkyBox#destroy\n */\nSkyBox.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * skyBox = skyBox && skyBox.destroy();\n *\n * @see SkyBox#isDestroyed\n */\nSkyBox.prototype.destroy = function () {\n  const command = this._command;\n  command.vertexArray = command.vertexArray && command.vertexArray.destroy();\n  command.shaderProgram =\n    command.shaderProgram && command.shaderProgram.destroy();\n  this._cubeMap = this._cubeMap && this._cubeMap.destroy();\n  return destroyObject(this);\n};\nexport default SkyBox;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D u_texture;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 color = texture(u_texture, v_textureCoordinates);\\n\\\n    out_FragColor = czm_gammaCorrect(color);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform float u_radiusTS;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvec2 rotate(vec2 p, vec2 direction)\\n\\\n{\\n\\\n    return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\\n\\\n}\\n\\\n\\n\\\nvec4 addBurst(vec2 position, vec2 direction, float lengthScalar)\\n\\\n{\\n\\\n    vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\\n\\\n    float radius = length(rotatedPosition) * lengthScalar;\\n\\\n    float burst = 1.0 - smoothstep(0.0, 0.55, radius);\\n\\\n    return vec4(burst);\\n\\\n}\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    float lengthScalar = 2.0 / sqrt(2.0);\\n\\\n    vec2 position = v_textureCoordinates - vec2(0.5);\\n\\\n    float radius = length(position) * lengthScalar;\\n\\\n    float surface = step(radius, u_radiusTS);\\n\\\n    vec4 color = vec4(vec2(1.0), surface + 0.2, surface);\\n\\\n\\n\\\n    float glow = 1.0 - smoothstep(0.0, 0.55, radius);\\n\\\n    color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\\n\\\n\\n\\\n    vec4 burst = vec4(0.0);\\n\\\n\\n\\\n    // The following loop has been manually unrolled for speed, to\\n\\\n    // avoid sin() and cos().\\n\\\n    //\\n\\\n    //for (float i = 0.4; i < 3.2; i += 1.047) {\\n\\\n    //    vec2 direction = vec2(sin(i), cos(i));\\n\\\n    //    burst += 0.4 * addBurst(position, direction, lengthScalar);\\n\\\n    //\\n\\\n    //    direction = vec2(sin(i - 0.08), cos(i - 0.08));\\n\\\n    //    burst += 0.3 * addBurst(position, direction, lengthScalar);\\n\\\n    //}\\n\\\n\\n\\\n    burst += 0.4 * addBurst(position, vec2(0.38942,  0.92106), lengthScalar);  // angle == 0.4\\n\\\n    burst += 0.4 * addBurst(position, vec2(0.99235,  0.12348), lengthScalar);  // angle == 0.4 + 1.047\\n\\\n    burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar);  // angle == 0.4 + 1.047 * 2.0\\n\\\n\\n\\\n    burst += 0.3 * addBurst(position, vec2(0.31457,  0.94924), lengthScalar);  // angle == 0.4 - 0.08\\n\\\n    burst += 0.3 * addBurst(position, vec2(0.97931,  0.20239), lengthScalar);  // angle == 0.4 + 1.047 - 0.08\\n\\\n    burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar);  // angle == 0.4 + 1.047 * 2.0 - 0.08\\n\\\n\\n\\\n    // End of manual loop unrolling.\\n\\\n\\n\\\n    color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\\n\\\n\\n\\\n    out_FragColor = clamp(color, vec4(0.0), vec4(1.0));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec2 direction;\\n\\\n\\n\\\nuniform float u_size;\\n\\\n\\n\\\nout vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main() \\n\\\n{\\n\\\n    vec4 position;\\n\\\n    if (czm_morphTime == 1.0)\\n\\\n    {\\n\\\n        position = vec4(czm_sunPositionWC, 1.0);\\n\\\n    }\\n\\\n    else\\n\\\n    {\\n\\\n        position = vec4(czm_sunPositionColumbusView.zxy, 1.0);\\n\\\n    }\\n\\\n    \\n\\\n    vec4 positionEC = czm_view * position;\\n\\\n    vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\\n\\\n    \\n\\\n    vec2 halfSize = vec2(u_size * 0.5);\\n\\\n    halfSize *= ((direction * 2.0) - 1.0);\\n\\\n    \\n\\\n    gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\\n\\\n    \\n\\\n    v_textureCoordinates = direction;\\n\\\n}\\n\\\n\";\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ComputeCommand from \"../Renderer/ComputeCommand.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport SunFS from \"../Shaders/SunFS.js\";\nimport SunTextureFS from \"../Shaders/SunTextureFS.js\";\nimport SunVS from \"../Shaders/SunVS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport SceneTransforms from \"./SceneTransforms.js\";\n\n/**\n * Draws a sun billboard.\n * <p>This is only supported in 3D and Columbus view.</p>\n *\n * @alias Sun\n * @constructor\n *\n *\n * @example\n * scene.sun = new Cesium.Sun();\n *\n * @see Scene#sun\n */\nfunction Sun() {\n  /**\n   * Determines if the sun will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = true;\n\n  this._drawCommand = new DrawCommand({\n    primitiveType: PrimitiveType.TRIANGLES,\n    boundingVolume: new BoundingSphere(),\n    owner: this,\n  });\n  this._commands = {\n    drawCommand: this._drawCommand,\n    computeCommand: undefined,\n  };\n  this._boundingVolume = new BoundingSphere();\n  this._boundingVolume2D = new BoundingSphere();\n\n  this._texture = undefined;\n  this._drawingBufferWidth = undefined;\n  this._drawingBufferHeight = undefined;\n  this._radiusTS = undefined;\n  this._size = undefined;\n\n  this.glowFactor = 1.0;\n  this._glowFactorDirty = false;\n\n  this._useHdr = undefined;\n\n  const that = this;\n  this._uniformMap = {\n    u_texture: function () {\n      return that._texture;\n    },\n    u_size: function () {\n      return that._size;\n    },\n  };\n}\n\nObject.defineProperties(Sun.prototype, {\n  /**\n   * Gets or sets a number that controls how \"bright\" the Sun's lens flare appears\n   * to be.  Zero shows just the Sun's disc without any flare.\n   * Use larger values for a more pronounced flare around the Sun.\n   *\n   * @memberof Sun.prototype\n   * @type {number}\n   * @default 1.0\n   */\n  glowFactor: {\n    get: function () {\n      return this._glowFactor;\n    },\n    set: function (glowFactor) {\n      glowFactor = Math.max(glowFactor, 0.0);\n      this._glowFactor = glowFactor;\n      this._glowFactorDirty = true;\n    },\n  },\n});\n\nconst scratchPositionWC = new Cartesian2();\nconst scratchLimbWC = new Cartesian2();\nconst scratchPositionEC = new Cartesian4();\nconst scratchCartesian4 = new Cartesian4();\n\n/**\n * @private\n */\nSun.prototype.update = function (frameState, passState, useHdr) {\n  if (!this.show) {\n    return undefined;\n  }\n\n  const mode = frameState.mode;\n  if (mode === SceneMode.SCENE2D || mode === SceneMode.MORPHING) {\n    return undefined;\n  }\n\n  if (!frameState.passes.render) {\n    return undefined;\n  }\n\n  const context = frameState.context;\n  const drawingBufferWidth = passState.viewport.width;\n  const drawingBufferHeight = passState.viewport.height;\n\n  if (\n    !defined(this._texture) ||\n    drawingBufferWidth !== this._drawingBufferWidth ||\n    drawingBufferHeight !== this._drawingBufferHeight ||\n    this._glowFactorDirty ||\n    useHdr !== this._useHdr\n  ) {\n    this._texture = this._texture && this._texture.destroy();\n    this._drawingBufferWidth = drawingBufferWidth;\n    this._drawingBufferHeight = drawingBufferHeight;\n    this._glowFactorDirty = false;\n    this._useHdr = useHdr;\n\n    let size = Math.max(drawingBufferWidth, drawingBufferHeight);\n    size = Math.pow(2.0, Math.ceil(Math.log(size) / Math.log(2.0)) - 2.0);\n\n    // The size computed above can be less than 1.0 if size < 4.0. This will probably\n    // never happen in practice, but does in the tests. Clamp to 1.0 to prevent WebGL\n    // errors in the tests.\n    size = Math.max(1.0, size);\n\n    const pixelDatatype = useHdr\n      ? context.halfFloatingPointTexture\n        ? PixelDatatype.HALF_FLOAT\n        : PixelDatatype.FLOAT\n      : PixelDatatype.UNSIGNED_BYTE;\n    this._texture = new Texture({\n      context: context,\n      width: size,\n      height: size,\n      pixelFormat: PixelFormat.RGBA,\n      pixelDatatype: pixelDatatype,\n    });\n\n    this._glowLengthTS = this._glowFactor * 5.0;\n    this._radiusTS = (1.0 / (1.0 + 2.0 * this._glowLengthTS)) * 0.5;\n\n    const that = this;\n    const uniformMap = {\n      u_radiusTS: function () {\n        return that._radiusTS;\n      },\n    };\n\n    this._commands.computeCommand = new ComputeCommand({\n      fragmentShaderSource: SunTextureFS,\n      outputTexture: this._texture,\n      uniformMap: uniformMap,\n      persists: false,\n      owner: this,\n      postExecute: function () {\n        that._commands.computeCommand = undefined;\n      },\n    });\n  }\n\n  const drawCommand = this._drawCommand;\n\n  if (!defined(drawCommand.vertexArray)) {\n    const attributeLocations = {\n      direction: 0,\n    };\n\n    const directions = new Uint8Array(4 * 2);\n    directions[0] = 0;\n    directions[1] = 0;\n\n    directions[2] = 255;\n    directions[3] = 0.0;\n\n    directions[4] = 255;\n    directions[5] = 255;\n\n    directions[6] = 0.0;\n    directions[7] = 255;\n\n    const vertexBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: directions,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    const attributes = [\n      {\n        index: attributeLocations.direction,\n        vertexBuffer: vertexBuffer,\n        componentsPerAttribute: 2,\n        normalize: true,\n        componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      },\n    ];\n    // Workaround Internet Explorer 11.0.8 lack of TRIANGLE_FAN\n    const indexBuffer = Buffer.createIndexBuffer({\n      context: context,\n      typedArray: new Uint16Array([0, 1, 2, 0, 2, 3]),\n      usage: BufferUsage.STATIC_DRAW,\n      indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n    });\n    drawCommand.vertexArray = new VertexArray({\n      context: context,\n      attributes: attributes,\n      indexBuffer: indexBuffer,\n    });\n\n    drawCommand.shaderProgram = ShaderProgram.fromCache({\n      context: context,\n      vertexShaderSource: SunVS,\n      fragmentShaderSource: SunFS,\n      attributeLocations: attributeLocations,\n    });\n\n    drawCommand.renderState = RenderState.fromCache({\n      blending: BlendingState.ALPHA_BLEND,\n    });\n    drawCommand.uniformMap = this._uniformMap;\n  }\n\n  const sunPosition = context.uniformState.sunPositionWC;\n  const sunPositionCV = context.uniformState.sunPositionColumbusView;\n\n  const boundingVolume = this._boundingVolume;\n  const boundingVolume2D = this._boundingVolume2D;\n\n  Cartesian3.clone(sunPosition, boundingVolume.center);\n  boundingVolume2D.center.x = sunPositionCV.z;\n  boundingVolume2D.center.y = sunPositionCV.x;\n  boundingVolume2D.center.z = sunPositionCV.y;\n\n  boundingVolume.radius =\n    CesiumMath.SOLAR_RADIUS + CesiumMath.SOLAR_RADIUS * this._glowLengthTS;\n  boundingVolume2D.radius = boundingVolume.radius;\n\n  if (mode === SceneMode.SCENE3D) {\n    BoundingSphere.clone(boundingVolume, drawCommand.boundingVolume);\n  } else if (mode === SceneMode.COLUMBUS_VIEW) {\n    BoundingSphere.clone(boundingVolume2D, drawCommand.boundingVolume);\n  }\n\n  const position = SceneTransforms.computeActualWgs84Position(\n    frameState,\n    sunPosition,\n    scratchCartesian4\n  );\n\n  const dist = Cartesian3.magnitude(\n    Cartesian3.subtract(position, frameState.camera.position, scratchCartesian4)\n  );\n  const projMatrix = context.uniformState.projection;\n\n  const positionEC = scratchPositionEC;\n  positionEC.x = 0;\n  positionEC.y = 0;\n  positionEC.z = -dist;\n  positionEC.w = 1;\n\n  const positionCC = Matrix4.multiplyByVector(\n    projMatrix,\n    positionEC,\n    scratchCartesian4\n  );\n  const positionWC = SceneTransforms.clipToGLWindowCoordinates(\n    passState.viewport,\n    positionCC,\n    scratchPositionWC\n  );\n\n  positionEC.x = CesiumMath.SOLAR_RADIUS;\n  const limbCC = Matrix4.multiplyByVector(\n    projMatrix,\n    positionEC,\n    scratchCartesian4\n  );\n  const limbWC = SceneTransforms.clipToGLWindowCoordinates(\n    passState.viewport,\n    limbCC,\n    scratchLimbWC\n  );\n\n  this._size = Cartesian2.magnitude(\n    Cartesian2.subtract(limbWC, positionWC, scratchCartesian4)\n  );\n  this._size = 2.0 * this._size * (1.0 + 2.0 * this._glowLengthTS);\n  this._size = Math.ceil(this._size);\n\n  return this._commands;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see Sun#destroy\n */\nSun.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * sun = sun && sun.destroy();\n *\n *  @see Sun#isDestroyed\n */\nSun.prototype.destroy = function () {\n  const command = this._drawCommand;\n  command.vertexArray = command.vertexArray && command.vertexArray.destroy();\n  command.shaderProgram =\n    command.shaderProgram && command.shaderProgram.destroy();\n\n  this._texture = this._texture && this._texture.destroy();\n\n  return destroyObject(this);\n};\nexport default Sun;\n", "import buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Clock from \"../Core/Clock.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport formatError from \"../Core/formatError.js\";\nimport getElement from \"../DataSources/getElement.js\";\nimport Globe from \"../Scene/Globe.js\";\nimport ImageryLayer from \"../Scene/ImageryLayer.js\";\nimport Moon from \"../Scene/Moon.js\";\nimport Scene from \"../Scene/Scene.js\";\nimport SceneMode from \"../Scene/SceneMode.js\";\nimport ScreenSpaceEventHandler from \"../Core/ScreenSpaceEventHandler.js\";\nimport ShadowMode from \"../Scene/ShadowMode.js\";\nimport SkyAtmosphere from \"../Scene/SkyAtmosphere.js\";\nimport SkyBox from \"../Scene/SkyBox.js\";\nimport Sun from \"../Scene/Sun.js\";\n\nfunction getDefaultSkyBoxUrl(suffix) {\n  return buildModuleUrl(`Assets/Textures/SkyBox/tycho2t3_80_${suffix}.jpg`);\n}\n\nfunction startRenderLoop(widget) {\n  widget._renderLoopRunning = true;\n\n  let lastFrameTime = 0;\n  function render(frameTime) {\n    if (widget.isDestroyed()) {\n      return;\n    }\n\n    if (widget._useDefaultRenderLoop) {\n      try {\n        const targetFrameRate = widget._targetFrameRate;\n        if (!defined(targetFrameRate)) {\n          widget.resize();\n          widget.render();\n          requestAnimationFrame(render);\n        } else {\n          const interval = 1000.0 / targetFrameRate;\n          const delta = frameTime - lastFrameTime;\n\n          if (delta > interval) {\n            widget.resize();\n            widget.render();\n            lastFrameTime = frameTime - (delta % interval);\n          }\n          requestAnimationFrame(render);\n        }\n      } catch (error) {\n        widget._useDefaultRenderLoop = false;\n        widget._renderLoopRunning = false;\n        if (widget._showRenderLoopErrors) {\n          const title =\n            \"An error occurred while rendering.  Rendering has stopped.\";\n          widget.showErrorPanel(title, undefined, error);\n        }\n      }\n    } else {\n      widget._renderLoopRunning = false;\n    }\n  }\n\n  requestAnimationFrame(render);\n}\n\nfunction configurePixelRatio(widget) {\n  let pixelRatio = widget._useBrowserRecommendedResolution\n    ? 1.0\n    : window.devicePixelRatio;\n  pixelRatio *= widget._resolutionScale;\n  if (defined(widget._scene)) {\n    widget._scene.pixelRatio = pixelRatio;\n  }\n\n  return pixelRatio;\n}\n\nfunction configureCanvasSize(widget) {\n  const canvas = widget._canvas;\n  let width = canvas.clientWidth;\n  let height = canvas.clientHeight;\n  const pixelRatio = configurePixelRatio(widget);\n\n  widget._canvasClientWidth = width;\n  widget._canvasClientHeight = height;\n\n  width *= pixelRatio;\n  height *= pixelRatio;\n\n  canvas.width = width;\n  canvas.height = height;\n\n  widget._canRender = width !== 0 && height !== 0;\n  widget._lastDevicePixelRatio = window.devicePixelRatio;\n}\n\nfunction configureCameraFrustum(widget) {\n  const canvas = widget._canvas;\n  const width = canvas.width;\n  const height = canvas.height;\n  if (width !== 0 && height !== 0) {\n    const frustum = widget._scene.camera.frustum;\n    if (defined(frustum.aspectRatio)) {\n      frustum.aspectRatio = width / height;\n    } else {\n      frustum.top = frustum.right * (height / width);\n      frustum.bottom = -frustum.top;\n    }\n  }\n}\n\n/**\n * A widget containing a Cesium scene.\n *\n * @alias CesiumWidget\n * @constructor\n *\n * @param {Element|string} container The DOM element or ID that will contain the widget.\n * @param {object} [options] Object with the following properties:\n * @param {Clock} [options.clock=new Clock()] The clock to use to control current time.\n * @param {ImageryLayer|false} [options.baseLayer=ImageryLayer.fromWorldImagery()] The bottommost imagery layer applied to the globe. If set to <code>false</code>, no imagery provider will be added.\n * @param {TerrainProvider} [options.terrainProvider=new EllipsoidTerrainProvider] The terrain provider.\n * @param {Terrain} [options.terrain] A terrain object which handles asynchronous terrain provider. Can only specify if options.terrainProvider is undefined.\n * @param {SkyBox| false} [options.skyBox] The skybox used to render the stars.  When <code>undefined</code>, the default stars are used. If set to <code>false</code>, no skyBox, Sun, or Moon will be added.\n * @param {SkyAtmosphere | false} [options.skyAtmosphere] Blue sky, and the glow around the Earth's limb.  Set to <code>false</code> to turn it off.\n * @param {SceneMode} [options.sceneMode=SceneMode.SCENE3D] The initial scene mode.\n * @param {boolean} [options.scene3DOnly=false] When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.\n * @param {boolean} [options.orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency.\n * @param {MapProjection} [options.mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes.\n * @param {Globe | false} [options.globe=new Globe(mapProjection.ellipsoid)] The globe to use in the scene.  If set to <code>false</code>, no globe will be added and the sky atmosphere will be hidden by default.\n * @param {boolean} [options.useDefaultRenderLoop=true] True if this widget should control the render loop, false otherwise.\n * @param {boolean} [options.useBrowserRecommendedResolution=true] If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.\n * @param {number} [options.targetFrameRate] The target frame rate when using the default render loop.\n * @param {boolean} [options.showRenderLoopErrors=true] If true, this widget will automatically display an HTML panel to the user containing the error, if a render loop error occurs.\n * @param {ContextOptions} [options.contextOptions] Context and WebGL creation properties passed to {@link Scene}.\n * @param {Element|string} [options.creditContainer] The DOM element or ID that will contain the {@link CreditDisplay}.  If not specified, the credits are added\n *        to the bottom of the widget itself.\n * @param {Element|string} [options.creditViewport] The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}.  If not specified, it will appear over the widget itself.\n * @param {boolean} [options.shadows=false] Determines if shadows are cast by light sources.\n * @param {ShadowMode} [options.terrainShadows=ShadowMode.RECEIVE_ONLY] Determines if the terrain casts or receives shadows from light sources.\n * @param {MapMode2D} [options.mapMode2D=MapMode2D.INFINITE_SCROLL] Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.\n * @param {boolean} [options.blurActiveElementOnCanvasFocus=true] If true, the active element will blur when the viewer's canvas is clicked. Setting this to false is useful for cases when the canvas is clicked only for retrieving position or an entity data without actually meaning to set the canvas to be the active element.\n * @param {boolean} [options.requestRenderMode=false] If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.\n * @param {number} [options.maximumRenderTimeChange=0.0] If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.\n * @param {number} [options.msaaSamples=1] If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Cesium%20Widget.html|Cesium Sandcastle Cesium Widget Demo}\n *\n * @example\n * // For each example, include a link to CesiumWidget.css stylesheet in HTML head,\n * // and in the body, include: <div id=\"cesiumContainer\"></div>\n *\n * // Widget with no terrain and default Bing Maps imagery provider.\n * const widget = new Cesium.CesiumWidget(\"cesiumContainer\");\n *\n * // Widget with ion imagery and Cesium World Terrain.\n * const widget2 = new Cesium.CesiumWidget(\"cesiumContainer\", {\n *     baseLayer: Cesium.ImageryLayer.fromWorldTerrain(),\n *     terrain: Cesium.Terrain.fromWorldTerrain()\n *     skyBox: new Cesium.SkyBox({\n *       sources: {\n *         positiveX: \"stars/TychoSkymapII.t3_08192x04096_80_px.jpg\",\n *         negativeX: \"stars/TychoSkymapII.t3_08192x04096_80_mx.jpg\",\n *         positiveY: \"stars/TychoSkymapII.t3_08192x04096_80_py.jpg\",\n *         negativeY: \"stars/TychoSkymapII.t3_08192x04096_80_my.jpg\",\n *         positiveZ: \"stars/TychoSkymapII.t3_08192x04096_80_pz.jpg\",\n *         negativeZ: \"stars/TychoSkymapII.t3_08192x04096_80_mz.jpg\"\n *       }\n *     }),\n *     // Show Columbus View map with Web Mercator projection\n *     sceneMode: Cesium.SceneMode.COLUMBUS_VIEW,\n *     mapProjection: new Cesium.WebMercatorProjection()\n * });\n */\nfunction CesiumWidget(container, options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(container)) {\n    throw new DeveloperError(\"container is required.\");\n  }\n  //>>includeEnd('debug');\n\n  container = getElement(container);\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //Configure the widget DOM elements\n  const element = document.createElement(\"div\");\n  element.className = \"cesium-widget\";\n  container.appendChild(element);\n\n  const canvas = document.createElement(\"canvas\");\n  const supportsImageRenderingPixelated = FeatureDetection.supportsImageRenderingPixelated();\n  this._supportsImageRenderingPixelated = supportsImageRenderingPixelated;\n  if (supportsImageRenderingPixelated) {\n    canvas.style.imageRendering = FeatureDetection.imageRenderingValue();\n  }\n\n  canvas.oncontextmenu = function () {\n    return false;\n  };\n  canvas.onselectstart = function () {\n    return false;\n  };\n\n  // Interacting with a canvas does not automatically blur the previously focused element.\n  // This leads to unexpected interaction if the last element was an input field.\n  // For example, clicking the mouse wheel could lead to the value in  the field changing\n  // unexpectedly. The solution is to blur whatever has focus as soon as canvas interaction begins.\n  // Although in some cases the active element needs to stay active even after interacting with the canvas,\n  // for example when clicking on it only for getting the data of a clicked position or an entity.\n  // For this case, the `blurActiveElementOnCanvasFocus` can be passed with false to avoid blurring\n  // the active element after interacting with the canvas.\n  function blurActiveElement() {\n    if (canvas !== canvas.ownerDocument.activeElement) {\n      canvas.ownerDocument.activeElement.blur();\n    }\n  }\n\n  const blurActiveElementOnCanvasFocus = defaultValue(\n    options.blurActiveElementOnCanvasFocus,\n    true\n  );\n\n  if (blurActiveElementOnCanvasFocus) {\n    canvas.addEventListener(\"mousedown\", blurActiveElement);\n    canvas.addEventListener(\"pointerdown\", blurActiveElement);\n  }\n\n  element.appendChild(canvas);\n\n  const innerCreditContainer = document.createElement(\"div\");\n  innerCreditContainer.className = \"cesium-widget-credits\";\n\n  const creditContainer = defined(options.creditContainer)\n    ? getElement(options.creditContainer)\n    : element;\n  creditContainer.appendChild(innerCreditContainer);\n\n  const creditViewport = defined(options.creditViewport)\n    ? getElement(options.creditViewport)\n    : element;\n\n  const showRenderLoopErrors = defaultValue(options.showRenderLoopErrors, true);\n\n  const useBrowserRecommendedResolution = defaultValue(\n    options.useBrowserRecommendedResolution,\n    true\n  );\n\n  this._element = element;\n  this._container = container;\n  this._canvas = canvas;\n  this._canvasClientWidth = 0;\n  this._canvasClientHeight = 0;\n  this._lastDevicePixelRatio = 0;\n  this._creditViewport = creditViewport;\n  this._creditContainer = creditContainer;\n  this._innerCreditContainer = innerCreditContainer;\n  this._canRender = false;\n  this._renderLoopRunning = false;\n  this._showRenderLoopErrors = showRenderLoopErrors;\n  this._resolutionScale = 1.0;\n  this._useBrowserRecommendedResolution = useBrowserRecommendedResolution;\n  this._forceResize = false;\n  this._clock = defined(options.clock) ? options.clock : new Clock();\n\n  configureCanvasSize(this);\n\n  try {\n    const scene = new Scene({\n      canvas: canvas,\n      contextOptions: options.contextOptions,\n      creditContainer: innerCreditContainer,\n      creditViewport: creditViewport,\n      mapProjection: options.mapProjection,\n      orderIndependentTranslucency: options.orderIndependentTranslucency,\n      scene3DOnly: defaultValue(options.scene3DOnly, false),\n      shadows: options.shadows,\n      mapMode2D: options.mapMode2D,\n      requestRenderMode: options.requestRenderMode,\n      maximumRenderTimeChange: options.maximumRenderTimeChange,\n      depthPlaneEllipsoidOffset: options.depthPlaneEllipsoidOffset,\n      msaaSamples: options.msaaSamples,\n    });\n    this._scene = scene;\n\n    scene.camera.constrainedAxis = Cartesian3.UNIT_Z;\n\n    configurePixelRatio(this);\n    configureCameraFrustum(this);\n\n    const ellipsoid = defaultValue(\n      scene.mapProjection.ellipsoid,\n      Ellipsoid.WGS84\n    );\n\n    let globe = options.globe;\n    if (!defined(globe)) {\n      globe = new Globe(ellipsoid);\n    }\n    if (globe !== false) {\n      scene.globe = globe;\n      scene.globe.shadows = defaultValue(\n        options.terrainShadows,\n        ShadowMode.RECEIVE_ONLY\n      );\n    }\n\n    let skyBox = options.skyBox;\n    if (!defined(skyBox)) {\n      skyBox = new SkyBox({\n        sources: {\n          positiveX: getDefaultSkyBoxUrl(\"px\"),\n          negativeX: getDefaultSkyBoxUrl(\"mx\"),\n          positiveY: getDefaultSkyBoxUrl(\"py\"),\n          negativeY: getDefaultSkyBoxUrl(\"my\"),\n          positiveZ: getDefaultSkyBoxUrl(\"pz\"),\n          negativeZ: getDefaultSkyBoxUrl(\"mz\"),\n        },\n      });\n    }\n    if (skyBox !== false) {\n      scene.skyBox = skyBox;\n      scene.sun = new Sun();\n      scene.moon = new Moon();\n    }\n\n    // Blue sky, and the glow around the Earth's limb.\n    let skyAtmosphere = options.skyAtmosphere;\n    if (!defined(skyAtmosphere)) {\n      skyAtmosphere = new SkyAtmosphere(ellipsoid);\n      skyAtmosphere.show = options.globe !== false && globe.show;\n    }\n    if (skyAtmosphere !== false) {\n      scene.skyAtmosphere = skyAtmosphere;\n    }\n\n    // Set the base imagery layer\n    let baseLayer = options.baseLayer;\n    if (options.globe !== false && baseLayer !== false) {\n      if (!defined(baseLayer)) {\n        baseLayer = ImageryLayer.fromWorldImagery();\n      }\n      scene.imageryLayers.add(baseLayer);\n    }\n\n    // Set the terrain provider if one is provided.\n    if (defined(options.terrainProvider) && options.globe !== false) {\n      scene.terrainProvider = options.terrainProvider;\n    }\n\n    if (defined(options.terrain) && options.globe !== false) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(options.terrainProvider)) {\n        throw new DeveloperError(\n          \"Specify either options.terrainProvider or options.terrain.\"\n        );\n      }\n      //>>includeEnd('debug')\n\n      scene.setTerrain(options.terrain);\n    }\n\n    this._screenSpaceEventHandler = new ScreenSpaceEventHandler(canvas);\n\n    if (defined(options.sceneMode)) {\n      if (options.sceneMode === SceneMode.SCENE2D) {\n        this._scene.morphTo2D(0);\n      }\n      if (options.sceneMode === SceneMode.COLUMBUS_VIEW) {\n        this._scene.morphToColumbusView(0);\n      }\n    }\n\n    this._useDefaultRenderLoop = undefined;\n    this.useDefaultRenderLoop = defaultValue(\n      options.useDefaultRenderLoop,\n      true\n    );\n\n    this._targetFrameRate = undefined;\n    this.targetFrameRate = options.targetFrameRate;\n\n    const that = this;\n    this._onRenderError = function (scene, error) {\n      that._useDefaultRenderLoop = false;\n      that._renderLoopRunning = false;\n      if (that._showRenderLoopErrors) {\n        const title =\n          \"An error occurred while rendering.  Rendering has stopped.\";\n        that.showErrorPanel(title, undefined, error);\n      }\n    };\n    scene.renderError.addEventListener(this._onRenderError);\n  } catch (error) {\n    if (showRenderLoopErrors) {\n      const title = \"Error constructing CesiumWidget.\";\n      const message =\n        'Visit <a href=\"http://get.webgl.org\">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL.  Consider trying a different web browser or updating your video drivers.  Detailed error information is below:';\n      this.showErrorPanel(title, message, error);\n    }\n    throw error;\n  }\n}\n\nObject.defineProperties(CesiumWidget.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof CesiumWidget.prototype\n   *\n   * @type {Element}\n   * @readonly\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the canvas.\n   * @memberof CesiumWidget.prototype\n   *\n   * @type {HTMLCanvasElement}\n   * @readonly\n   */\n  canvas: {\n    get: function () {\n      return this._canvas;\n    },\n  },\n\n  /**\n   * Gets the credit container.\n   * @memberof CesiumWidget.prototype\n   *\n   * @type {Element}\n   * @readonly\n   */\n  creditContainer: {\n    get: function () {\n      return this._creditContainer;\n    },\n  },\n\n  /**\n   * Gets the credit viewport\n   * @memberof CesiumWidget.prototype\n   *\n   * @type {Element}\n   * @readonly\n   */\n  creditViewport: {\n    get: function () {\n      return this._creditViewport;\n    },\n  },\n\n  /**\n   * Gets the scene.\n   * @memberof CesiumWidget.prototype\n   *\n   * @type {Scene}\n   * @readonly\n   */\n  scene: {\n    get: function () {\n      return this._scene;\n    },\n  },\n\n  /**\n   * Gets the collection of image layers that will be rendered on the globe.\n   * @memberof CesiumWidget.prototype\n   *\n   * @type {ImageryLayerCollection}\n   * @readonly\n   */\n  imageryLayers: {\n    get: function () {\n      return this._scene.imageryLayers;\n    },\n  },\n\n  /**\n   * The terrain provider providing surface geometry for the globe.\n   * @memberof CesiumWidget.prototype\n   *\n   * @type {TerrainProvider}\n   */\n  terrainProvider: {\n    get: function () {\n      return this._scene.terrainProvider;\n    },\n    set: function (terrainProvider) {\n      this._scene.terrainProvider = terrainProvider;\n    },\n  },\n\n  /**\n   * Manages the list of credits to display on screen and in the lightbox.\n   * @memberof CesiumWidget.prototype\n   *\n   * @type {CreditDisplay}\n   */\n  creditDisplay: {\n    get: function () {\n      return this._scene.frameState.creditDisplay;\n    },\n  },\n\n  /**\n   * Gets the camera.\n   * @memberof CesiumWidget.prototype\n   *\n   * @type {Camera}\n   * @readonly\n   */\n  camera: {\n    get: function () {\n      return this._scene.camera;\n    },\n  },\n\n  /**\n   * Gets the clock.\n   * @memberof CesiumWidget.prototype\n   *\n   * @type {Clock}\n   * @readonly\n   */\n  clock: {\n    get: function () {\n      return this._clock;\n    },\n  },\n\n  /**\n   * Gets the screen space event handler.\n   * @memberof CesiumWidget.prototype\n   *\n   * @type {ScreenSpaceEventHandler}\n   * @readonly\n   */\n  screenSpaceEventHandler: {\n    get: function () {\n      return this._screenSpaceEventHandler;\n    },\n  },\n\n  /**\n   * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code>\n   * is true. If undefined, the browser's requestAnimationFrame implementation\n   * determines the frame rate.  If defined, this value must be greater than 0.  A value higher\n   * than the underlying requestAnimationFrame implementation will have no effect.\n   * @memberof CesiumWidget.prototype\n   *\n   * @type {number}\n   */\n  targetFrameRate: {\n    get: function () {\n      return this._targetFrameRate;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (value <= 0) {\n        throw new DeveloperError(\n          \"targetFrameRate must be greater than 0, or undefined.\"\n        );\n      }\n      //>>includeEnd('debug');\n      this._targetFrameRate = value;\n    },\n  },\n\n  /**\n   * Gets or sets whether or not this widget should control the render loop.\n   * If true the widget will use requestAnimationFrame to\n   * perform rendering and resizing of the widget, as well as drive the\n   * simulation clock. If set to false, you must manually call the\n   * <code>resize</code>, <code>render</code> methods as part of a custom\n   * render loop.  If an error occurs during rendering, {@link Scene}'s\n   * <code>renderError</code> event will be raised and this property\n   * will be set to false.  It must be set back to true to continue rendering\n   * after the error.\n   * @memberof CesiumWidget.prototype\n   *\n   * @type {boolean}\n   */\n  useDefaultRenderLoop: {\n    get: function () {\n      return this._useDefaultRenderLoop;\n    },\n    set: function (value) {\n      if (this._useDefaultRenderLoop !== value) {\n        this._useDefaultRenderLoop = value;\n        if (value && !this._renderLoopRunning) {\n          startRenderLoop(this);\n        }\n      }\n    },\n  },\n\n  /**\n   * Gets or sets a scaling factor for rendering resolution.  Values less than 1.0 can improve\n   * performance on less powerful devices while values greater than 1.0 will render at a higher\n   * resolution and then scale down, resulting in improved visual fidelity.\n   * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5\n   * will cause the scene to be rendered at 320x240 and then scaled up while setting\n   * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.\n   * @memberof CesiumWidget.prototype\n   *\n   * @type {number}\n   * @default 1.0\n   */\n  resolutionScale: {\n    get: function () {\n      return this._resolutionScale;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (value <= 0) {\n        throw new DeveloperError(\"resolutionScale must be greater than 0.\");\n      }\n      //>>includeEnd('debug');\n      if (this._resolutionScale !== value) {\n        this._resolutionScale = value;\n        this._forceResize = true;\n      }\n    },\n  },\n\n  /**\n   * Boolean flag indicating if the browser's recommended resolution is used.\n   * If true, the browser's device pixel ratio is ignored and 1.0 is used instead,\n   * effectively rendering based on CSS pixels instead of device pixels. This can improve\n   * performance on less powerful devices that have high pixel density. When false, rendering\n   * will be in device pixels. {@link CesiumWidget#resolutionScale} will still take effect whether\n   * this flag is true or false.\n   * @memberof CesiumWidget.prototype\n   *\n   * @type {boolean}\n   * @default true\n   */\n  useBrowserRecommendedResolution: {\n    get: function () {\n      return this._useBrowserRecommendedResolution;\n    },\n    set: function (value) {\n      if (this._useBrowserRecommendedResolution !== value) {\n        this._useBrowserRecommendedResolution = value;\n        this._forceResize = true;\n      }\n    },\n  },\n});\n\n/**\n * Show an error panel to the user containing a title and a longer error message,\n * which can be dismissed using an OK button.  This panel is displayed automatically\n * when a render loop error occurs, if showRenderLoopErrors was not false when the\n * widget was constructed.\n *\n * @param {string} title The title to be displayed on the error panel.  This string is interpreted as text.\n * @param {string} [message] A helpful, user-facing message to display prior to the detailed error information.  This string is interpreted as HTML.\n * @param {string} [error] The error to be displayed on the error panel.  This string is formatted using {@link formatError} and then displayed as text.\n */\nCesiumWidget.prototype.showErrorPanel = function (title, message, error) {\n  const element = this._element;\n  const overlay = document.createElement(\"div\");\n  overlay.className = \"cesium-widget-errorPanel\";\n\n  const content = document.createElement(\"div\");\n  content.className = \"cesium-widget-errorPanel-content\";\n  overlay.appendChild(content);\n\n  const errorHeader = document.createElement(\"div\");\n  errorHeader.className = \"cesium-widget-errorPanel-header\";\n  errorHeader.appendChild(document.createTextNode(title));\n  content.appendChild(errorHeader);\n\n  const errorPanelScroller = document.createElement(\"div\");\n  errorPanelScroller.className = \"cesium-widget-errorPanel-scroll\";\n  content.appendChild(errorPanelScroller);\n  function resizeCallback() {\n    errorPanelScroller.style.maxHeight = `${Math.max(\n      Math.round(element.clientHeight * 0.9 - 100),\n      30\n    )}px`;\n  }\n  resizeCallback();\n  if (defined(window.addEventListener)) {\n    window.addEventListener(\"resize\", resizeCallback, false);\n  }\n\n  const hasMessage = defined(message);\n  const hasError = defined(error);\n\n  if (hasMessage || hasError) {\n    const errorMessage = document.createElement(\"div\");\n    errorMessage.className = \"cesium-widget-errorPanel-message\";\n    errorPanelScroller.appendChild(errorMessage);\n\n    if (hasError) {\n      let errorDetails = formatError(error);\n      if (!hasMessage) {\n        if (typeof error === \"string\") {\n          error = new Error(error);\n        }\n\n        message = formatError({\n          name: error.name,\n          message: error.message,\n        });\n        errorDetails = error.stack;\n      }\n\n      //IE8 does not have a console object unless the dev tools are open.\n      if (typeof console !== \"undefined\") {\n        console.error(`${title}\\n${message}\\n${errorDetails}`);\n      }\n\n      const errorMessageDetails = document.createElement(\"div\");\n      errorMessageDetails.className =\n        \"cesium-widget-errorPanel-message-details collapsed\";\n\n      const moreDetails = document.createElement(\"span\");\n      moreDetails.className = \"cesium-widget-errorPanel-more-details\";\n      moreDetails.appendChild(document.createTextNode(\"See more...\"));\n      errorMessageDetails.appendChild(moreDetails);\n\n      errorMessageDetails.onclick = function (e) {\n        errorMessageDetails.removeChild(moreDetails);\n        errorMessageDetails.appendChild(document.createTextNode(errorDetails));\n        errorMessageDetails.className =\n          \"cesium-widget-errorPanel-message-details\";\n        content.className = \"cesium-widget-errorPanel-content expanded\";\n        errorMessageDetails.onclick = undefined;\n      };\n\n      errorPanelScroller.appendChild(errorMessageDetails);\n    }\n\n    errorMessage.innerHTML = `<p>${message}</p>`;\n  }\n\n  const buttonPanel = document.createElement(\"div\");\n  buttonPanel.className = \"cesium-widget-errorPanel-buttonPanel\";\n  content.appendChild(buttonPanel);\n\n  const okButton = document.createElement(\"button\");\n  okButton.setAttribute(\"type\", \"button\");\n  okButton.className = \"cesium-button\";\n  okButton.appendChild(document.createTextNode(\"OK\"));\n  okButton.onclick = function () {\n    if (defined(resizeCallback) && defined(window.removeEventListener)) {\n      window.removeEventListener(\"resize\", resizeCallback, false);\n    }\n    element.removeChild(overlay);\n  };\n\n  buttonPanel.appendChild(okButton);\n\n  element.appendChild(overlay);\n};\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nCesiumWidget.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nCesiumWidget.prototype.destroy = function () {\n  if (defined(this._scene)) {\n    this._scene.renderError.removeEventListener(this._onRenderError);\n    this._scene = this._scene.destroy();\n  }\n  this._container.removeChild(this._element);\n  this._creditContainer.removeChild(this._innerCreditContainer);\n  destroyObject(this);\n};\n\n/**\n * Updates the canvas size, camera aspect ratio, and viewport size.\n * This function is called automatically as needed unless\n * <code>useDefaultRenderLoop</code> is set to false.\n */\nCesiumWidget.prototype.resize = function () {\n  const canvas = this._canvas;\n  if (\n    !this._forceResize &&\n    this._canvasClientWidth === canvas.clientWidth &&\n    this._canvasClientHeight === canvas.clientHeight &&\n    this._lastDevicePixelRatio === window.devicePixelRatio\n  ) {\n    return;\n  }\n  this._forceResize = false;\n\n  configureCanvasSize(this);\n  configureCameraFrustum(this);\n\n  this._scene.requestRender();\n};\n\n/**\n * Renders the scene.  This function is called automatically\n * unless <code>useDefaultRenderLoop</code> is set to false;\n */\nCesiumWidget.prototype.render = function () {\n  if (this._canRender) {\n    this._scene.initializeFrame();\n    const currentTime = this._clock.tick();\n    this._scene.render(currentTime);\n  } else {\n    this._clock.tick();\n  }\n};\nexport default CesiumWidget;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D u_noiseTexture;\\n\\\nuniform vec3 u_noiseTextureDimensions;\\n\\\nuniform float u_noiseDetail;\\n\\\nin vec2 v_offset;\\n\\\nin vec3 v_maximumSize;\\n\\\nin vec4 v_color;\\n\\\nin float v_slice;\\n\\\nin float v_brightness;\\n\\\n\\n\\\nfloat wrap(float value, float rangeLength) {\\n\\\n    if(value < 0.0) {\\n\\\n        float absValue = abs(value);\\n\\\n        float modValue = mod(absValue, rangeLength);\\n\\\n        return mod(rangeLength - modValue, rangeLength);\\n\\\n    }\\n\\\n    return mod(value, rangeLength);\\n\\\n}\\n\\\n\\n\\\nvec3 wrapVec(vec3 value, float rangeLength) {\\n\\\n    return vec3(wrap(value.x, rangeLength),\\n\\\n                wrap(value.y, rangeLength),\\n\\\n                wrap(value.z, rangeLength));\\n\\\n}\\n\\\n\\n\\\nvec2 voxelToUV(vec3 voxelIndex) {\\n\\\n    float textureSliceWidth = u_noiseTextureDimensions.x;\\n\\\n    float noiseTextureRows = u_noiseTextureDimensions.y;\\n\\\n    float inverseNoiseTextureRows = u_noiseTextureDimensions.z;\\n\\\n\\n\\\n    float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth;\\n\\\n    vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared,\\n\\\n                                            inverseNoiseTextureRows / textureSliceWidth);\\n\\\n    vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth);\\n\\\n    float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows);\\n\\\n    float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows);\\n\\\n\\n\\\n    float xPixelCoord = wrappedIndex.x + column * textureSliceWidth;\\n\\\n    float yPixelCoord = wrappedIndex.y + row * textureSliceWidth;\\n\\\n    return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions;\\n\\\n}\\n\\\n\\n\\\n// Interpolate a voxel with its neighbor (along the positive X-axis)\\n\\\nvec4 lerpSamplesX(vec3 voxelIndex, float x) {\\n\\\n    vec2 uv0 = voxelToUV(voxelIndex);\\n\\\n    vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0));\\n\\\n    vec4 sample0 = texture(u_noiseTexture, uv0);\\n\\\n    vec4 sample1 = texture(u_noiseTexture, uv1);\\n\\\n    return mix(sample0, sample1, x);\\n\\\n}\\n\\\n\\n\\\nvec4 sampleNoiseTexture(vec3 position) {\\n\\\n    float textureSliceWidth = u_noiseTextureDimensions.x;\\n\\\n    vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0);\\n\\\n    vec3 lerpValue = fract(recenteredPos);\\n\\\n    vec3 voxelIndex = floor(recenteredPos);\\n\\\n\\n\\\n    vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x);\\n\\\n    vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x);\\n\\\n    vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x);\\n\\\n    vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x);\\n\\\n\\n\\\n    vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y);\\n\\\n    vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y);\\n\\\n    return mix(yLerp0, yLerp1, lerpValue.z);\\n\\\n}\\n\\\n\\n\\\n// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0).\\n\\\nbool intersectSphere(vec3 origin, vec3 dir, float slice,\\n\\\n                     out vec3 point, out vec3 normal) {\\n\\\n    float A = dot(dir, dir);\\n\\\n    float B = dot(origin, dir);\\n\\\n    float C = dot(origin, origin) - 0.25;\\n\\\n    float discriminant = (B * B) - (A * C);\\n\\\n    if(discriminant < 0.0) {\\n\\\n        return false;\\n\\\n    }\\n\\\n    float root = sqrt(discriminant);\\n\\\n    float t = (-B - root) / A;\\n\\\n    if(t < 0.0) {\\n\\\n        t = (-B + root) / A;\\n\\\n    }\\n\\\n    point = origin + t * dir;\\n\\\n\\n\\\n    if(slice >= 0.0) {\\n\\\n        point.z = (slice / 2.0) - 0.5;\\n\\\n        if(length(point) > 0.5) {\\n\\\n            return false;\\n\\\n        }\\n\\\n    }\\n\\\n\\n\\\n    normal = normalize(point);\\n\\\n    point -= czm_epsilon2 * normal;\\n\\\n    return true;\\n\\\n}\\n\\\n\\n\\\n// Transforms the ray origin and direction into unit sphere space,\\n\\\n// then transforms the result back into the ellipsoid's space.\\n\\\nbool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice,\\n\\\n                        out vec3 point, out vec3 normal) {\\n\\\n    if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) {\\n\\\n        return false;\\n\\\n    }\\n\\\n\\n\\\n    vec3 o = (origin - center) / scale;\\n\\\n    vec3 d = dir / scale;\\n\\\n    vec3 p, n;\\n\\\n    bool intersected = intersectSphere(o, d, slice, p, n);\\n\\\n    if(intersected) {\\n\\\n        point = (p * scale) + center;\\n\\\n        normal = n;\\n\\\n    }\\n\\\n    return intersected;\\n\\\n}\\n\\\n\\n\\\n// Assume that if phase shift is being called for octave i,\\n\\\n// the frequency is of i - 1. This saves us from doing extra\\n\\\n// division / multiplication operations.\\n\\\nvec2 phaseShift2D(vec2 p, vec2 freq) {\\n\\\n    return (czm_pi / 2.0) * sin(freq.yx * p.yx);\\n\\\n}\\n\\\n\\n\\\nvec2 phaseShift3D(vec3 p, vec2 freq) {\\n\\\n    return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z));\\n\\\n}\\n\\\n\\n\\\n// The cloud texture function derived from Gardner's 1985 paper,\\n\\\n// \\\"Visual Simulation of Clouds.\\\"\\n\\\n// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf\\n\\\nconst float T0    = 0.6;  // contrast of the texture pattern\\n\\\nconst float k     = 0.1;  // computed to produce a maximum value of 1\\n\\\nconst float C0    = 0.8;  // coefficient\\n\\\nconst float FX0   = 0.6;  // frequency X\\n\\\nconst float FY0   = 0.6;  // frequency Y\\n\\\nconst int octaves = 5;\\n\\\n\\n\\\nfloat T(vec3 point) {\\n\\\n    vec2 sum = vec2(0.0);\\n\\\n    float Ci = C0;\\n\\\n    vec2 FXY = vec2(FX0, FY0);\\n\\\n    vec2 PXY = vec2(0.0);\\n\\\n    for(int i = 1; i <= octaves; i++) {\\n\\\n        PXY = phaseShift3D(point, FXY);\\n\\\n        Ci *= 0.707;\\n\\\n        FXY *= 2.0;\\n\\\n        vec2 sinTerm = sin(FXY * point.xy + PXY);\\n\\\n        sum += Ci * sinTerm + vec2(T0);\\n\\\n    }\\n\\\n    return k * sum.x * sum.y;\\n\\\n}\\n\\\n\\n\\\nconst float a = 0.5;  // fraction of surface reflection due to ambient or scattered light,\\n\\\nconst float t = 0.4;  // fraction of texture shading\\n\\\nconst float s = 0.25; // fraction of specular reflection\\n\\\n\\n\\\nfloat I(float Id, float Is, float It) {\\n\\\n    return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a;\\n\\\n}\\n\\\n\\n\\\nconst vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7));\\n\\\n\\n\\\nvec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice,\\n\\\n               float brightness) {\\n\\\n    vec3 cloudPoint, cloudNormal;\\n\\\n    if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice,\\n\\\n                            cloudPoint, cloudNormal)) {\\n\\\n        return vec4(0.0);\\n\\\n    }\\n\\\n\\n\\\n    float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0);  // diffuse reflection\\n\\\n    float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0);   // specular reflection\\n\\\n    float It = T(cloudPoint);                                 // texture function\\n\\\n    float intensity = I(Id, Is, It);\\n\\\n    vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0));\\n\\\n\\n\\\n    vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint);\\n\\\n    float W = noise.x;\\n\\\n    float W2 = noise.y;\\n\\\n    float W3 = noise.z;\\n\\\n\\n\\\n    // The dot product between the cloud's normal and the ray's direction is greatest\\n\\\n    // in the center of the ellipsoid's surface. It decreases towards the edge.\\n\\\n    // Thus, it is used to blur the areas leading to the edges of the ellipsoid,\\n\\\n    // so that no harsh lines appear.\\n\\\n\\n\\\n    // The first (and biggest) layer of worley noise is then subtracted from this.\\n\\\n    // The final result is scaled up so that the base cloud is not too translucent.\\n\\\n    float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0);\\n\\\n    float TR = pow(ndDot, 3.0) - W; // translucency\\n\\\n    TR *= 1.3;\\n\\\n\\n\\\n    // Subtracting the second and third layers of worley noise is more complicated.\\n\\\n    // If these layers of noise were simply subtracted from the current translucency,\\n\\\n    // the shape derived from the first layer of noise would be completely deleted.\\n\\\n    // The erosion of this noise should thus be constricted to the edges of the cloud.\\n\\\n    // However, because the edges of the ellipsoid were already blurred away, mapping\\n\\\n    // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance.\\n\\\n    // The value of (0.5 - ndDot) provides the best compromise.\\n\\\n    float minusDot = 0.5 - ndDot;\\n\\\n\\n\\\n    // Even with the previous calculation, subtracting the second layer of wnoise\\n\\\n    // erode too much of the cloud. The addition of it, however, will detailed\\n\\\n    // volume to the cloud. As long as the noise is only added and not subtracted,\\n\\\n    // the results are aesthetically pleasing.\\n\\\n\\n\\\n    // The minusDot product is mapped in a way that it is larger at the edges of\\n\\\n    // the ellipsoid, so a subtraction and min operation are used instead of\\n\\\n    // an addition and max one.\\n\\\n    TR -= min(minusDot * W2, 0.0);\\n\\\n\\n\\\n    // The third level of worley noise is subtracted from the result, with some\\n\\\n    // modifications. First, a scalar is added to minusDot so that the noise\\n\\\n    // starts affecting the shape farther away from the center of the ellipsoid's\\n\\\n    // surface. Then, it is scaled down so its impact is not too intense.\\n\\\n    TR -= 0.8 * (minusDot + 0.25) * W3;\\n\\\n\\n\\\n    // The texture function's shading does not correlate with the shape of the cloud\\n\\\n    // produced by the layers of noise, so an extra shading scalar is calculated.\\n\\\n    // The darkest areas of the cloud are assigned to be where the noise erodes\\n\\\n    // the cloud the most. This is then interpolated based on the translucency\\n\\\n    // and the diffuse shading term of that point in the cloud.\\n\\\n    float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR);\\n\\\n\\n\\\n    // To avoid values that are too dark, this scalar is increased by a small amount\\n\\\n    // and clamped so it never goes to zero.\\n\\\n    shading = clamp(shading + 0.2, 0.3, 1.0);\\n\\\n\\n\\\n    // Finally, the contrast of the cloud's color is increased.\\n\\\n    vec3 finalColor = mix(vec3(0.5), shading * color, 1.15);\\n\\\n    return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color;\\n\\\n}\\n\\\n\\n\\\nvoid main() {\\n\\\n#ifdef DEBUG_BILLBOARDS\\n\\\n    out_FragColor = vec4(0.0, 0.5, 0.5, 1.0);\\n\\\n#endif\\n\\\n    // To avoid calculations with high values,\\n\\\n    // we raycast from an arbitrarily smaller space.\\n\\\n    vec2 coordinate = v_maximumSize.xy * v_offset;\\n\\\n\\n\\\n    vec3 ellipsoidScale = 0.82 * v_maximumSize;\\n\\\n    vec3 ellipsoidCenter = vec3(0.0);\\n\\\n\\n\\\n    float zOffset = max(ellipsoidScale.z - 10.0, 0.0);\\n\\\n    vec3 eye = vec3(0, 0, -10.0 - zOffset);\\n\\\n    vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye);\\n\\\n    vec3 rayOrigin = eye;\\n\\\n#ifdef DEBUG_ELLIPSOIDS\\n\\\n    vec3 point, normal;\\n\\\n    if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice,\\n\\\n                          point, normal)) {\\n\\\n        out_FragColor = v_brightness * v_color;\\n\\\n    }\\n\\\n#else\\n\\\n#ifndef DEBUG_BILLBOARDS\\n\\\n    vec4 cloud = drawCloud(rayOrigin, rayDir,\\n\\\n                           ellipsoidCenter, ellipsoidScale, v_slice, v_brightness);\\n\\\n    if(cloud.w < 0.01) {\\n\\\n        discard;\\n\\\n    }\\n\\\n    out_FragColor = cloud;\\n\\\n#endif\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef INSTANCED\\n\\\nin vec2 direction;\\n\\\n#endif\\n\\\nin vec4 positionHighAndScaleX;\\n\\\nin vec4 positionLowAndScaleY;\\n\\\nin vec4 packedAttribute0;\\n\\\nin vec4 packedAttribute1;\\n\\\nin vec4 color;\\n\\\n\\n\\\nout vec2 v_offset;\\n\\\nout vec3 v_maximumSize;\\n\\\nout vec4 v_color;\\n\\\nout float v_slice;\\n\\\nout float v_brightness;\\n\\\n\\n\\\nvoid main() {\\n\\\n    // Unpack attributes.\\n\\\n    vec3 positionHigh = positionHighAndScaleX.xyz;\\n\\\n    vec3 positionLow = positionLowAndScaleY.xyz;\\n\\\n    vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w);\\n\\\n\\n\\\n    float show = packedAttribute0.x;\\n\\\n    float brightness = packedAttribute0.y;\\n\\\n    vec2 coordinates = packedAttribute0.wz;\\n\\\n    vec3 maximumSize = packedAttribute1.xyz;\\n\\\n    float slice = packedAttribute1.w;\\n\\\n\\n\\\n#ifdef INSTANCED\\n\\\n    vec2 dir = direction;\\n\\\n#else\\n\\\n    vec2 dir = coordinates;\\n\\\n#endif\\n\\\n\\n\\\n    vec2 offset = dir - vec2(0.5, 0.5);\\n\\\n    vec2 scaledOffset = scale * offset;\\n\\\n    vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\\n\\\n    vec4 positionEC = czm_modelViewRelativeToEye * p;\\n\\\n    positionEC.xy += scaledOffset;\\n\\\n    \\n\\\n    positionEC.xyz *= show;\\n\\\n    gl_Position = czm_projection * positionEC;\\n\\\n\\n\\\n    v_offset = offset;\\n\\\n    v_maximumSize = maximumSize;\\n\\\n    v_color = color;\\n\\\n    v_slice = slice;\\n\\\n    v_brightness = brightness;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec3 u_noiseTextureDimensions;\\n\\\nuniform float u_noiseDetail;\\n\\\nuniform vec3 u_noiseOffset;\\n\\\nin vec2 v_position;\\n\\\n\\n\\\nfloat wrap(float value, float rangeLength) {\\n\\\n    if(value < 0.0) {\\n\\\n        float absValue = abs(value);\\n\\\n        float modValue = mod(absValue, rangeLength);\\n\\\n        return mod(rangeLength - modValue, rangeLength);\\n\\\n    }\\n\\\n    return mod(value, rangeLength);\\n\\\n}\\n\\\n\\n\\\nvec3 wrapVec(vec3 value, float rangeLength) {\\n\\\n    return vec3(wrap(value.x, rangeLength),\\n\\\n                wrap(value.y, rangeLength),\\n\\\n                wrap(value.z, rangeLength));\\n\\\n}\\n\\\n\\n\\\nvec3 random3(vec3 p) {\\n\\\n    float dot1 = dot(p, vec3(127.1, 311.7, 932.8));\\n\\\n    float dot2 = dot(p, vec3(269.5, 183.3, 421.4));\\n\\\n    return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2));\\n\\\n}\\n\\\n\\n\\\n// Frequency corresponds to cell size.\\n\\\n// The higher the frequency, the smaller the cell size.\\n\\\nvec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) {\\n\\\n    float textureSliceWidth = u_noiseTextureDimensions.x;\\n\\\n    vec3 cell = centerCell + offset;\\n\\\n    cell = wrapVec(cell, textureSliceWidth / u_noiseDetail);\\n\\\n    cell += floor(u_noiseOffset / u_noiseDetail);\\n\\\n    vec3 p = offset + random3(cell);\\n\\\n    return p;\\n\\\n}\\n\\\n\\n\\\nfloat worleyNoise(vec3 p, float freq) {\\n\\\n    vec3 centerCell = floor(p * freq);\\n\\\n    vec3 pointInCell = fract(p * freq);\\n\\\n    float shortestDistance = 1000.0;\\n\\\n\\n\\\n    for(float z = -1.0; z <= 1.0; z++) {\\n\\\n        for(float y = -1.0; y <= 1.0; y++) {\\n\\\n            for(float x = -1.0; x <= 1.0; x++) {\\n\\\n                vec3 offset = vec3(x, y, z);\\n\\\n                vec3 point = getWorleyCellPoint(centerCell, offset, freq);\\n\\\n\\n\\\n                float distance = length(pointInCell - point);\\n\\\n                if(distance < shortestDistance) {\\n\\\n                    shortestDistance = distance;\\n\\\n                }\\n\\\n            }\\n\\\n        }\\n\\\n    }\\n\\\n\\n\\\n    return shortestDistance;\\n\\\n}\\n\\\n\\n\\\nconst float MAX_FBM_ITERATIONS = 10.0;\\n\\\n\\n\\\nfloat worleyFBMNoise(vec3 p, float octaves, float scale) {\\n\\\n    float noise = 0.0;\\n\\\n    float freq = 1.0;\\n\\\n    float persistence = 0.625;\\n\\\n    for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) {\\n\\\n        if(i >= octaves) {\\n\\\n            break;\\n\\\n        }\\n\\\n\\n\\\n        noise += worleyNoise(p * scale, freq * scale) * persistence;\\n\\\n        persistence *= 0.5;\\n\\\n        freq *= 2.0;\\n\\\n    }\\n\\\n    return noise;\\n\\\n}\\n\\\n\\n\\\nvoid main() {\\n\\\n    float textureSliceWidth = u_noiseTextureDimensions.x;\\n\\\n    float inverseNoiseTextureRows = u_noiseTextureDimensions.z;\\n\\\n    float x = mod(v_position.x, textureSliceWidth);\\n\\\n    float y = mod(v_position.y, textureSliceWidth);\\n\\\n    float sliceRow = floor(v_position.y / textureSliceWidth);\\n\\\n    float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth;\\n\\\n\\n\\\n    vec3 position = vec3(x, y, z);\\n\\\n    position /= u_noiseDetail;\\n\\\n    float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0);\\n\\\n    float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0);\\n\\\n    float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0);\\n\\\n    out_FragColor = vec4(worley0, worley1, worley2, 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec3 u_noiseTextureDimensions;\\n\\\nin vec2 position;\\n\\\n\\n\\\nout vec2 v_position;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    gl_Position = vec4(position, 0.1, 1.0);\\n\\\n\\n\\\n    float textureSliceWidth = u_noiseTextureDimensions.x;\\n\\\n    float noiseTextureRows = u_noiseTextureDimensions.y;\\n\\\n    float inverseNoiseTextureRows = u_noiseTextureDimensions.z;\\n\\\n    vec2 transformedPos = (position * 0.5) + vec2(0.5);\\n\\\n    transformedPos *= textureSliceWidth;\\n\\\n    transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows;\\n\\\n    transformedPos.y *= noiseTextureRows;\\n\\\n    v_position = transformedPos;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    czm_materialInput materialInput;\\n\\\n    \\n\\\n    materialInput.s = v_textureCoordinates.s;\\n\\\n    materialInput.st = v_textureCoordinates;\\n\\\n    materialInput.str = vec3(v_textureCoordinates, 0.0);\\n\\\n    materialInput.normalEC = vec3(0.0, 0.0, -1.0);\\n\\\n    \\n\\\n    czm_material material = czm_getMaterial(materialInput);\\n\\\n\\n\\\n    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n}\\n\\\n\";\n", "import binarySearch from \"./binarySearch.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport defined from \"./defined.js\";\nimport Rectangle from \"./Rectangle.js\";\n\n/**\n * Reports the availability of tiles in a {@link TilingScheme}.\n *\n * @alias TileAvailability\n * @constructor\n *\n * @param {TilingScheme} tilingScheme The tiling scheme in which to report availability.\n * @param {number} maximumLevel The maximum tile level that is potentially available.\n */\nfunction TileAvailability(tilingScheme, maximumLevel) {\n  this._tilingScheme = tilingScheme;\n  this._maximumLevel = maximumLevel;\n\n  this._rootNodes = [];\n}\n\nconst rectangleScratch = new Rectangle();\n\nfunction findNode(level, x, y, nodes) {\n  const count = nodes.length;\n  for (let i = 0; i < count; ++i) {\n    const node = nodes[i];\n    if (node.x === x && node.y === y && node.level === level) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\n/**\n * Marks a rectangular range of tiles in a particular level as being available.  For best performance,\n * add your ranges in order of increasing level.\n *\n * @param {number} level The level.\n * @param {number} startX The X coordinate of the first available tiles at the level.\n * @param {number} startY The Y coordinate of the first available tiles at the level.\n * @param {number} endX The X coordinate of the last available tiles at the level.\n * @param {number} endY The Y coordinate of the last available tiles at the level.\n */\nTileAvailability.prototype.addAvailableTileRange = function (\n  level,\n  startX,\n  startY,\n  endX,\n  endY\n) {\n  const tilingScheme = this._tilingScheme;\n\n  const rootNodes = this._rootNodes;\n  if (level === 0) {\n    for (let y = startY; y <= endY; ++y) {\n      for (let x = startX; x <= endX; ++x) {\n        if (!findNode(level, x, y, rootNodes)) {\n          rootNodes.push(new QuadtreeNode(tilingScheme, undefined, 0, x, y));\n        }\n      }\n    }\n  }\n\n  tilingScheme.tileXYToRectangle(startX, startY, level, rectangleScratch);\n  const west = rectangleScratch.west;\n  const north = rectangleScratch.north;\n\n  tilingScheme.tileXYToRectangle(endX, endY, level, rectangleScratch);\n  const east = rectangleScratch.east;\n  const south = rectangleScratch.south;\n\n  const rectangleWithLevel = new RectangleWithLevel(\n    level,\n    west,\n    south,\n    east,\n    north\n  );\n\n  for (let i = 0; i < rootNodes.length; ++i) {\n    const rootNode = rootNodes[i];\n    if (rectanglesOverlap(rootNode.extent, rectangleWithLevel)) {\n      putRectangleInQuadtree(this._maximumLevel, rootNode, rectangleWithLevel);\n    }\n  }\n};\n\n/**\n * Determines the level of the most detailed tile covering the position.  This function\n * usually completes in time logarithmic to the number of rectangles added with\n * {@link TileAvailability#addAvailableTileRange}.\n *\n * @param {Cartographic} position The position for which to determine the maximum available level.  The height component is ignored.\n * @return {number} The level of the most detailed tile covering the position.\n * @throws {DeveloperError} If position is outside any tile according to the tiling scheme.\n */\nTileAvailability.prototype.computeMaximumLevelAtPosition = function (position) {\n  // Find the root node that contains this position.\n  let node;\n  for (let nodeIndex = 0; nodeIndex < this._rootNodes.length; ++nodeIndex) {\n    const rootNode = this._rootNodes[nodeIndex];\n    if (rectangleContainsPosition(rootNode.extent, position)) {\n      node = rootNode;\n      break;\n    }\n  }\n\n  if (!defined(node)) {\n    return -1;\n  }\n\n  return findMaxLevelFromNode(undefined, node, position);\n};\n\nconst rectanglesScratch = [];\nconst remainingToCoverByLevelScratch = [];\nconst westScratch = new Rectangle();\nconst eastScratch = new Rectangle();\n\n/**\n * Finds the most detailed level that is available _everywhere_ within a given rectangle.  More detailed\n * tiles may be available in parts of the rectangle, but not the whole thing.  The return value of this\n * function may be safely passed to {@link sampleTerrain} for any position within the rectangle.  This function\n * usually completes in time logarithmic to the number of rectangles added with\n * {@link TileAvailability#addAvailableTileRange}.\n *\n * @param {Rectangle} rectangle The rectangle.\n * @return {number} The best available level for the entire rectangle.\n */\nTileAvailability.prototype.computeBestAvailableLevelOverRectangle = function (\n  rectangle\n) {\n  const rectangles = rectanglesScratch;\n  rectangles.length = 0;\n\n  if (rectangle.east < rectangle.west) {\n    // Rectangle crosses the IDL, make it two rectangles.\n    rectangles.push(\n      Rectangle.fromRadians(\n        -Math.PI,\n        rectangle.south,\n        rectangle.east,\n        rectangle.north,\n        westScratch\n      )\n    );\n    rectangles.push(\n      Rectangle.fromRadians(\n        rectangle.west,\n        rectangle.south,\n        Math.PI,\n        rectangle.north,\n        eastScratch\n      )\n    );\n  } else {\n    rectangles.push(rectangle);\n  }\n\n  const remainingToCoverByLevel = remainingToCoverByLevelScratch;\n  remainingToCoverByLevel.length = 0;\n\n  let i;\n  for (i = 0; i < this._rootNodes.length; ++i) {\n    updateCoverageWithNode(\n      remainingToCoverByLevel,\n      this._rootNodes[i],\n      rectangles\n    );\n  }\n\n  for (i = remainingToCoverByLevel.length - 1; i >= 0; --i) {\n    if (\n      defined(remainingToCoverByLevel[i]) &&\n      remainingToCoverByLevel[i].length === 0\n    ) {\n      return i;\n    }\n  }\n\n  return 0;\n};\n\nconst cartographicScratch = new Cartographic();\n\n/**\n * Determines if a particular tile is available.\n * @param {number} level The tile level to check.\n * @param {number} x The X coordinate of the tile to check.\n * @param {number} y The Y coordinate of the tile to check.\n * @return {boolean} True if the tile is available; otherwise, false.\n */\nTileAvailability.prototype.isTileAvailable = function (level, x, y) {\n  // Get the center of the tile and find the maximum level at that position.\n  // Because availability is by tile, if the level is available at that point, it\n  // is sure to be available for the whole tile.  We assume that if a tile at level n exists,\n  // then all its parent tiles back to level 0 exist too.  This isn't really enforced\n  // anywhere, but Cesium would never load a tile for which this is not true.\n  const rectangle = this._tilingScheme.tileXYToRectangle(\n    x,\n    y,\n    level,\n    rectangleScratch\n  );\n  Rectangle.center(rectangle, cartographicScratch);\n  return this.computeMaximumLevelAtPosition(cartographicScratch) >= level;\n};\n\n/**\n * Computes a bit mask indicating which of a tile's four children exist.\n * If a child's bit is set, a tile is available for that child.  If it is cleared,\n * the tile is not available.  The bit values are as follows:\n * <table>\n *     <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>\n *     <tr><td>0</td><td>1</td><td>Southwest</td></tr>\n *     <tr><td>1</td><td>2</td><td>Southeast</td></tr>\n *     <tr><td>2</td><td>4</td><td>Northwest</td></tr>\n *     <tr><td>3</td><td>8</td><td>Northeast</td></tr>\n * </table>\n *\n * @param {number} level The level of the parent tile.\n * @param {number} x The X coordinate of the parent tile.\n * @param {number} y The Y coordinate of the parent tile.\n * @return {number} The bit mask indicating child availability.\n */\nTileAvailability.prototype.computeChildMaskForTile = function (level, x, y) {\n  const childLevel = level + 1;\n  if (childLevel >= this._maximumLevel) {\n    return 0;\n  }\n\n  let mask = 0;\n\n  mask |= this.isTileAvailable(childLevel, 2 * x, 2 * y + 1) ? 1 : 0;\n  mask |= this.isTileAvailable(childLevel, 2 * x + 1, 2 * y + 1) ? 2 : 0;\n  mask |= this.isTileAvailable(childLevel, 2 * x, 2 * y) ? 4 : 0;\n  mask |= this.isTileAvailable(childLevel, 2 * x + 1, 2 * y) ? 8 : 0;\n\n  return mask;\n};\n\nfunction QuadtreeNode(tilingScheme, parent, level, x, y) {\n  this.tilingScheme = tilingScheme;\n  this.parent = parent;\n  this.level = level;\n  this.x = x;\n  this.y = y;\n  this.extent = tilingScheme.tileXYToRectangle(x, y, level);\n\n  this.rectangles = [];\n  this._sw = undefined;\n  this._se = undefined;\n  this._nw = undefined;\n  this._ne = undefined;\n}\n\nObject.defineProperties(QuadtreeNode.prototype, {\n  nw: {\n    get: function () {\n      if (!this._nw) {\n        this._nw = new QuadtreeNode(\n          this.tilingScheme,\n          this,\n          this.level + 1,\n          this.x * 2,\n          this.y * 2\n        );\n      }\n      return this._nw;\n    },\n  },\n\n  ne: {\n    get: function () {\n      if (!this._ne) {\n        this._ne = new QuadtreeNode(\n          this.tilingScheme,\n          this,\n          this.level + 1,\n          this.x * 2 + 1,\n          this.y * 2\n        );\n      }\n      return this._ne;\n    },\n  },\n\n  sw: {\n    get: function () {\n      if (!this._sw) {\n        this._sw = new QuadtreeNode(\n          this.tilingScheme,\n          this,\n          this.level + 1,\n          this.x * 2,\n          this.y * 2 + 1\n        );\n      }\n      return this._sw;\n    },\n  },\n\n  se: {\n    get: function () {\n      if (!this._se) {\n        this._se = new QuadtreeNode(\n          this.tilingScheme,\n          this,\n          this.level + 1,\n          this.x * 2 + 1,\n          this.y * 2 + 1\n        );\n      }\n      return this._se;\n    },\n  },\n});\n\nfunction RectangleWithLevel(level, west, south, east, north) {\n  this.level = level;\n  this.west = west;\n  this.south = south;\n  this.east = east;\n  this.north = north;\n}\n\nfunction rectanglesOverlap(rectangle1, rectangle2) {\n  const west = Math.max(rectangle1.west, rectangle2.west);\n  const south = Math.max(rectangle1.south, rectangle2.south);\n  const east = Math.min(rectangle1.east, rectangle2.east);\n  const north = Math.min(rectangle1.north, rectangle2.north);\n  return south < north && west < east;\n}\n\nfunction putRectangleInQuadtree(maxDepth, node, rectangle) {\n  while (node.level < maxDepth) {\n    if (rectangleFullyContainsRectangle(node.nw.extent, rectangle)) {\n      node = node.nw;\n    } else if (rectangleFullyContainsRectangle(node.ne.extent, rectangle)) {\n      node = node.ne;\n    } else if (rectangleFullyContainsRectangle(node.sw.extent, rectangle)) {\n      node = node.sw;\n    } else if (rectangleFullyContainsRectangle(node.se.extent, rectangle)) {\n      node = node.se;\n    } else {\n      break;\n    }\n  }\n\n  if (\n    node.rectangles.length === 0 ||\n    node.rectangles[node.rectangles.length - 1].level <= rectangle.level\n  ) {\n    node.rectangles.push(rectangle);\n  } else {\n    // Maintain ordering by level when inserting.\n    let index = binarySearch(\n      node.rectangles,\n      rectangle.level,\n      rectangleLevelComparator\n    );\n    if (index < 0) {\n      index = ~index;\n    }\n    node.rectangles.splice(index, 0, rectangle);\n  }\n}\n\nfunction rectangleLevelComparator(a, b) {\n  return a.level - b;\n}\n\nfunction rectangleFullyContainsRectangle(potentialContainer, rectangleToTest) {\n  return (\n    rectangleToTest.west >= potentialContainer.west &&\n    rectangleToTest.east <= potentialContainer.east &&\n    rectangleToTest.south >= potentialContainer.south &&\n    rectangleToTest.north <= potentialContainer.north\n  );\n}\n\nfunction rectangleContainsPosition(potentialContainer, positionToTest) {\n  return (\n    positionToTest.longitude >= potentialContainer.west &&\n    positionToTest.longitude <= potentialContainer.east &&\n    positionToTest.latitude >= potentialContainer.south &&\n    positionToTest.latitude <= potentialContainer.north\n  );\n}\n\nfunction findMaxLevelFromNode(stopNode, node, position) {\n  let maxLevel = 0;\n\n  // Find the deepest quadtree node containing this point.\n  let found = false;\n  while (!found) {\n    const nw = node._nw && rectangleContainsPosition(node._nw.extent, position);\n    const ne = node._ne && rectangleContainsPosition(node._ne.extent, position);\n    const sw = node._sw && rectangleContainsPosition(node._sw.extent, position);\n    const se = node._se && rectangleContainsPosition(node._se.extent, position);\n\n    // The common scenario is that the point is in only one quadrant and we can simply\n    // iterate down the tree.  But if the point is on a boundary between tiles, it is\n    // in multiple tiles and we need to check all of them, so use recursion.\n    if (nw + ne + sw + se > 1) {\n      if (nw) {\n        maxLevel = Math.max(\n          maxLevel,\n          findMaxLevelFromNode(node, node._nw, position)\n        );\n      }\n      if (ne) {\n        maxLevel = Math.max(\n          maxLevel,\n          findMaxLevelFromNode(node, node._ne, position)\n        );\n      }\n      if (sw) {\n        maxLevel = Math.max(\n          maxLevel,\n          findMaxLevelFromNode(node, node._sw, position)\n        );\n      }\n      if (se) {\n        maxLevel = Math.max(\n          maxLevel,\n          findMaxLevelFromNode(node, node._se, position)\n        );\n      }\n      break;\n    } else if (nw) {\n      node = node._nw;\n    } else if (ne) {\n      node = node._ne;\n    } else if (sw) {\n      node = node._sw;\n    } else if (se) {\n      node = node._se;\n    } else {\n      found = true;\n    }\n  }\n\n  // Work up the tree until we find a rectangle that contains this point.\n  while (node !== stopNode) {\n    const rectangles = node.rectangles;\n\n    // Rectangles are sorted by level, lowest first.\n    for (\n      let i = rectangles.length - 1;\n      i >= 0 && rectangles[i].level > maxLevel;\n      --i\n    ) {\n      const rectangle = rectangles[i];\n      if (rectangleContainsPosition(rectangle, position)) {\n        maxLevel = rectangle.level;\n      }\n    }\n\n    node = node.parent;\n  }\n\n  return maxLevel;\n}\n\nfunction updateCoverageWithNode(\n  remainingToCoverByLevel,\n  node,\n  rectanglesToCover\n) {\n  if (!node) {\n    return;\n  }\n\n  let i;\n  let anyOverlap = false;\n  for (i = 0; i < rectanglesToCover.length; ++i) {\n    anyOverlap =\n      anyOverlap || rectanglesOverlap(node.extent, rectanglesToCover[i]);\n  }\n\n  if (!anyOverlap) {\n    // This node is not applicable to the rectangle(s).\n    return;\n  }\n\n  const rectangles = node.rectangles;\n  for (i = 0; i < rectangles.length; ++i) {\n    const rectangle = rectangles[i];\n\n    if (!remainingToCoverByLevel[rectangle.level]) {\n      remainingToCoverByLevel[rectangle.level] = rectanglesToCover;\n    }\n\n    remainingToCoverByLevel[rectangle.level] = subtractRectangle(\n      remainingToCoverByLevel[rectangle.level],\n      rectangle\n    );\n  }\n\n  // Update with child nodes.\n  updateCoverageWithNode(remainingToCoverByLevel, node._nw, rectanglesToCover);\n  updateCoverageWithNode(remainingToCoverByLevel, node._ne, rectanglesToCover);\n  updateCoverageWithNode(remainingToCoverByLevel, node._sw, rectanglesToCover);\n  updateCoverageWithNode(remainingToCoverByLevel, node._se, rectanglesToCover);\n}\n\nfunction subtractRectangle(rectangleList, rectangleToSubtract) {\n  const result = [];\n  for (let i = 0; i < rectangleList.length; ++i) {\n    const rectangle = rectangleList[i];\n    if (!rectanglesOverlap(rectangle, rectangleToSubtract)) {\n      // Disjoint rectangles.  Original rectangle is unmodified.\n      result.push(rectangle);\n    } else {\n      // rectangleToSubtract partially or completely overlaps rectangle.\n      if (rectangle.west < rectangleToSubtract.west) {\n        result.push(\n          new Rectangle(\n            rectangle.west,\n            rectangle.south,\n            rectangleToSubtract.west,\n            rectangle.north\n          )\n        );\n      }\n      if (rectangle.east > rectangleToSubtract.east) {\n        result.push(\n          new Rectangle(\n            rectangleToSubtract.east,\n            rectangle.south,\n            rectangle.east,\n            rectangle.north\n          )\n        );\n      }\n      if (rectangle.south < rectangleToSubtract.south) {\n        result.push(\n          new Rectangle(\n            Math.max(rectangleToSubtract.west, rectangle.west),\n            rectangle.south,\n            Math.min(rectangleToSubtract.east, rectangle.east),\n            rectangleToSubtract.south\n          )\n        );\n      }\n      if (rectangle.north > rectangleToSubtract.north) {\n        result.push(\n          new Rectangle(\n            Math.max(rectangleToSubtract.west, rectangle.west),\n            rectangleToSubtract.north,\n            Math.min(rectangleToSubtract.east, rectangle.east),\n            rectangle.north\n          )\n        );\n      }\n    }\n  }\n\n  return result;\n}\nexport default TileAvailability;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Check from \"./Check.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Event from \"./Event.js\";\nimport GeographicTilingScheme from \"./GeographicTilingScheme.js\";\nimport HeightmapEncoding from \"./HeightmapEncoding.js\";\nimport HeightmapTerrainData from \"./HeightmapTerrainData.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Request from \"./Request.js\";\nimport RequestState from \"./RequestState.js\";\nimport RequestType from \"./RequestType.js\";\nimport Resource from \"./Resource.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TerrainProvider from \"./TerrainProvider.js\";\nimport TileAvailability from \"./TileAvailability.js\";\nimport TileProviderError from \"./TileProviderError.js\";\nimport WebMercatorTilingScheme from \"./WebMercatorTilingScheme.js\";\n\nconst ALL_CHILDREN = 15;\n\n/**\n * @typedef {Object} ArcGISTiledElevationTerrainProvider.ConstructorOptions\n *\n * Initialization options for the ArcGISTiledElevationTerrainProvider constructor\n *\n * @property {string} [token] The authorization token to use to connect to the service.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If the tilingScheme is specified,\n *                    this parameter is ignored and the tiling scheme's ellipsoid is used instead.\n *                    If neither parameter is specified, the WGS84 ellipsoid is used.\n */\n\n/**\n * Used to track creation details while fetching initial metadata\n *\n * @constructor\n * @private\n *\n * @param {ArcGISTiledElevationTerrainProvider.ConstructorOptions} [options] An object describing initialization options.\n */\nfunction TerrainProviderBuilder(options) {\n  this.ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n  this.credit = undefined;\n  this.tilingScheme = undefined;\n  this.height = undefined;\n  this.width = undefined;\n  this.encoding = undefined;\n  this.lodCount = undefined;\n  this.hasAvailability = false;\n  this.tilesAvailable = undefined;\n  this.tilesAvailabilityLoaded = undefined;\n  this.levelZeroMaximumGeometricError = undefined;\n  this.terrainDataStructure = undefined;\n}\n\n/**\n * Complete ArcGISTiledElevationTerrainProvider creation based on builder values.\n *\n * @private\n *\n * @param {ArcGISTiledElevationTerrainProvider} provider\n */\nTerrainProviderBuilder.prototype.build = function (provider) {\n  provider._credit = this.credit;\n  provider._tilingScheme = this.tilingScheme;\n  provider._height = this.height;\n  provider._width = this.width;\n  provider._encoding = this.encoding;\n  provider._lodCount = this.lodCount;\n  provider._hasAvailability = this.hasAvailability;\n  provider._tilesAvailable = this.tilesAvailable;\n  provider._tilesAvailabilityLoaded = this.tilesAvailabilityLoaded;\n  provider._levelZeroMaximumGeometricError = this.levelZeroMaximumGeometricError;\n  provider._terrainDataStructure = this.terrainDataStructure;\n};\n\nfunction parseMetadataSuccess(terrainProviderBuilder, metadata) {\n  const copyrightText = metadata.copyrightText;\n  if (defined(copyrightText)) {\n    terrainProviderBuilder.credit = new Credit(copyrightText);\n  }\n\n  const spatialReference = metadata.spatialReference;\n  const wkid = defaultValue(spatialReference.latestWkid, spatialReference.wkid);\n  const extent = metadata.extent;\n  const tilingSchemeOptions = {\n    ellipsoid: terrainProviderBuilder.ellipsoid,\n  };\n  if (wkid === 4326) {\n    tilingSchemeOptions.rectangle = Rectangle.fromDegrees(\n      extent.xmin,\n      extent.ymin,\n      extent.xmax,\n      extent.ymax\n    );\n    terrainProviderBuilder.tilingScheme = new GeographicTilingScheme(\n      tilingSchemeOptions\n    );\n  } else if (wkid === 3857) {\n    // Clamp extent to EPSG 3857 bounds\n    const epsg3857Bounds =\n      Math.PI * terrainProviderBuilder.ellipsoid.maximumRadius;\n    if (metadata.extent.xmax > epsg3857Bounds) {\n      metadata.extent.xmax = epsg3857Bounds;\n    }\n    if (metadata.extent.ymax > epsg3857Bounds) {\n      metadata.extent.ymax = epsg3857Bounds;\n    }\n    if (metadata.extent.xmin < -epsg3857Bounds) {\n      metadata.extent.xmin = -epsg3857Bounds;\n    }\n    if (metadata.extent.ymin < -epsg3857Bounds) {\n      metadata.extent.ymin = -epsg3857Bounds;\n    }\n\n    tilingSchemeOptions.rectangleSouthwestInMeters = new Cartesian2(\n      extent.xmin,\n      extent.ymin\n    );\n    tilingSchemeOptions.rectangleNortheastInMeters = new Cartesian2(\n      extent.xmax,\n      extent.ymax\n    );\n    terrainProviderBuilder.tilingScheme = new WebMercatorTilingScheme(\n      tilingSchemeOptions\n    );\n  } else {\n    throw new RuntimeError(\"Invalid spatial reference\");\n  }\n\n  const tileInfo = metadata.tileInfo;\n  if (!defined(tileInfo)) {\n    throw new RuntimeError(\"tileInfo is required\");\n  }\n\n  terrainProviderBuilder.width = tileInfo.rows + 1;\n  terrainProviderBuilder.height = tileInfo.cols + 1;\n  terrainProviderBuilder.encoding =\n    tileInfo.format === \"LERC\"\n      ? HeightmapEncoding.LERC\n      : HeightmapEncoding.NONE;\n  terrainProviderBuilder.lodCount = tileInfo.lods.length - 1;\n\n  const hasAvailability = (terrainProviderBuilder.hasAvailability =\n    metadata.capabilities.indexOf(\"Tilemap\") !== -1);\n  if (hasAvailability) {\n    terrainProviderBuilder.tilesAvailable = new TileAvailability(\n      terrainProviderBuilder.tilingScheme,\n      terrainProviderBuilder.lodCount\n    );\n    terrainProviderBuilder.tilesAvailable.addAvailableTileRange(\n      0,\n      0,\n      0,\n      terrainProviderBuilder.tilingScheme.getNumberOfXTilesAtLevel(0),\n      terrainProviderBuilder.tilingScheme.getNumberOfYTilesAtLevel(0)\n    );\n    terrainProviderBuilder.tilesAvailabilityLoaded = new TileAvailability(\n      terrainProviderBuilder.tilingScheme,\n      terrainProviderBuilder.lodCount\n    );\n  }\n\n  terrainProviderBuilder.levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(\n    terrainProviderBuilder.tilingScheme.ellipsoid,\n    terrainProviderBuilder.width,\n    terrainProviderBuilder.tilingScheme.getNumberOfXTilesAtLevel(0)\n  );\n\n  if (metadata.bandCount > 1) {\n    console.log(\n      \"ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one.\"\n    );\n  }\n\n  if (defined(metadata.minValues) && defined(metadata.maxValues)) {\n    terrainProviderBuilder.terrainDataStructure = {\n      elementMultiplier: 1.0,\n      lowestEncodedHeight: metadata.minValues[0],\n      highestEncodedHeight: metadata.maxValues[0],\n    };\n  } else {\n    terrainProviderBuilder.terrainDataStructure = {\n      elementMultiplier: 1.0,\n    };\n  }\n}\n\nasync function requestMetadata(\n  terrainProviderBuilder,\n  metadataResource,\n  provider\n) {\n  try {\n    const metadata = await metadataResource.fetchJson();\n    parseMetadataSuccess(terrainProviderBuilder, metadata);\n  } catch (error) {\n    const message = `An error occurred while accessing ${metadataResource}.`;\n    TileProviderError.reportError(\n      undefined,\n      provider,\n      defined(provider) ? provider._errorEvent : undefined,\n      message\n    );\n\n    throw error;\n  }\n}\n\n/**\n * <div class=\"notice\">\n * To construct a CesiumTerrainProvider, call {@link ArcGISTiledElevationTerrainProvider.fromUrl}. Do not call the constructor directly.\n * </div>\n *\n * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps\n * retrieved from Elevation Tiles of an an ArcGIS ImageService.\n *\n * @alias ArcGISTiledElevationTerrainProvider\n * @constructor\n *\n * @param {CesiumTerrainProvider.ConstructorOptions} [options] A url or an object describing initialization options\n *\n * @example\n * const terrainProvider = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl(\"https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer\", {\n *   token: \"KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg..\"\n * });\n * viewer.terrainProvider = terrainProvider;\n *\n * @see TerrainProvider\n */\nfunction ArcGISTiledElevationTerrainProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._resource = undefined;\n  this._credit = undefined;\n  this._tilingScheme = undefined;\n  this._levelZeroMaximumGeometricError = undefined;\n  this._maxLevel = undefined;\n  this._terrainDataStructure = undefined;\n  this._width = undefined;\n  this._height = undefined;\n  this._encoding = undefined;\n  this._lodCount = undefined;\n\n  this._hasAvailability = false;\n  this._tilesAvailable = undefined;\n  this._tilesAvailabilityLoaded = undefined;\n  this._availableCache = {};\n\n  this._errorEvent = new Event();\n}\n\nObject.defineProperties(ArcGISTiledElevationTerrainProvider.prototype, {\n  /**\n   * Gets an event that is raised when the terrain provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof ArcGISTiledElevationTerrainProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this terrain provider is active.  Typically this is used to credit\n   * the source of the terrain.\n   * @memberof ArcGISTiledElevationTerrainProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof ArcGISTiledElevationTerrainProvider.prototype\n   * @type {GeographicTilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the provider includes a water mask.  The water mask\n   * indicates which areas of the globe are water rather than land, so they can be rendered\n   * as a reflective surface with animated waves.\n   * @memberof ArcGISTiledElevationTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasWaterMask: {\n    get: function () {\n      return false;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the requested tiles include vertex normals.\n   * @memberof ArcGISTiledElevationTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasVertexNormals: {\n    get: function () {\n      return false;\n    },\n  },\n  /**\n   * Gets an object that can be used to determine availability of terrain from this provider, such as\n   * at points and in rectangles. This property may be undefined if availability\n   * information is not available.\n   * @memberof ArcGISTiledElevationTerrainProvider.prototype\n   * @type {TileAvailability}\n   * @readonly\n   */\n  availability: {\n    get: function () {\n      return this._tilesAvailable;\n    },\n  },\n});\n\n/**\n * Creates a {@link TerrainProvider} that produces terrain geometry by tessellating height maps\n * retrieved from Elevation Tiles of an an ArcGIS ImageService.\n *\n * @param {Resource|String|Promise<Resource>|Promise<String>} url The URL of the ArcGIS ImageServer service.\n * @param {ArcGISTiledElevationTerrainProvider.ConstructorOptions} [options] A url or an object describing initialization options.\n * @returns {Promise<ArcGISTiledElevationTerrainProvider>}\n *\n * @example\n * const terrainProvider = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl(\"https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer\", {\n *   token: \"KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg..\"\n * });\n * viewer.terrainProvider = terrainProvider;\n *\n * @exception {RuntimeError} metadata specifies invalid spatial reference\n * @exception {RuntimeError} metadata does not specify tileInfo\n */\nArcGISTiledElevationTerrainProvider.fromUrl = async function (url, options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"url\", url);\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  url = await Promise.resolve(url);\n  let resource = Resource.createIfNeeded(url);\n  resource.appendForwardSlash();\n  if (defined(options.token)) {\n    resource = resource.getDerivedResource({\n      queryParameters: {\n        token: options.token,\n      },\n    });\n  }\n\n  const metadataResource = resource.getDerivedResource({\n    queryParameters: {\n      f: \"pjson\",\n    },\n  });\n\n  const terrainProviderBuilder = new TerrainProviderBuilder(options);\n  await requestMetadata(terrainProviderBuilder, metadataResource);\n\n  const provider = new ArcGISTiledElevationTerrainProvider(options);\n  terrainProviderBuilder.build(provider);\n  provider._resource = resource;\n\n  return provider;\n};\n\n/**\n * Requests the geometry for a given tile. The result includes terrain\n * data and indicates that all child tiles are available.\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<TerrainData>|undefined} A promise for the requested geometry.  If this method\n *          returns undefined instead of a promise, it is an indication that too many requests are already\n *          pending and the request will be retried later.\n */\nArcGISTiledElevationTerrainProvider.prototype.requestTileGeometry = function (\n  x,\n  y,\n  level,\n  request\n) {\n  const tileResource = this._resource.getDerivedResource({\n    url: `tile/${level}/${y}/${x}`,\n    request: request,\n  });\n\n  const hasAvailability = this._hasAvailability;\n  let availabilityPromise = Promise.resolve(true);\n  let availabilityRequest;\n  if (\n    hasAvailability &&\n    !defined(isTileAvailable(this, level + 1, x * 2, y * 2))\n  ) {\n    // We need to load child availability\n    const availabilityResult = requestAvailability(\n      this,\n      level + 1,\n      x * 2,\n      y * 2\n    );\n\n    availabilityPromise = availabilityResult.promise;\n    availabilityRequest = availabilityResult.request;\n  }\n\n  const promise = tileResource.fetchArrayBuffer();\n  if (!defined(promise) || !defined(availabilityPromise)) {\n    return undefined;\n  }\n\n  const that = this;\n  const tilesAvailable = this._tilesAvailable;\n  return Promise.all([promise, availabilityPromise])\n    .then(function (result) {\n      return new HeightmapTerrainData({\n        buffer: result[0],\n        width: that._width,\n        height: that._height,\n        childTileMask: hasAvailability\n          ? tilesAvailable.computeChildMaskForTile(level, x, y)\n          : ALL_CHILDREN,\n        structure: that._terrainDataStructure,\n        encoding: that._encoding,\n      });\n    })\n    .catch(function (error) {\n      if (\n        defined(availabilityRequest) &&\n        availabilityRequest.state === RequestState.CANCELLED\n      ) {\n        request.cancel();\n\n        // Don't reject the promise till the request is actually cancelled\n        // Otherwise it will think the request failed, but it didn't.\n        return request.deferred.promise.finally(function () {\n          request.state = RequestState.CANCELLED;\n          return Promise.reject(error);\n        });\n      }\n      return Promise.reject(error);\n    });\n};\n\nfunction isTileAvailable(that, level, x, y) {\n  if (!that._hasAvailability) {\n    return undefined;\n  }\n\n  const tilesAvailabilityLoaded = that._tilesAvailabilityLoaded;\n  const tilesAvailable = that._tilesAvailable;\n\n  if (level > that._lodCount) {\n    return false;\n  }\n\n  // Check if tiles are known to be available\n  if (tilesAvailable.isTileAvailable(level, x, y)) {\n    return true;\n  }\n\n  // or to not be available\n  if (tilesAvailabilityLoaded.isTileAvailable(level, x, y)) {\n    return false;\n  }\n\n  return undefined;\n}\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level.\n *\n * @param {number} level The tile level for which to get the maximum geometric error.\n * @returns {number} The maximum geometric error.\n */\nArcGISTiledElevationTerrainProvider.prototype.getLevelMaximumGeometricError = function (\n  level\n) {\n  return this._levelZeroMaximumGeometricError / (1 << level);\n};\n\n/**\n * Determines whether data for a tile is available to be loaded.\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @returns {boolean|undefined} Undefined if not supported, otherwise true or false.\n */\nArcGISTiledElevationTerrainProvider.prototype.getTileDataAvailable = function (\n  x,\n  y,\n  level\n) {\n  if (!this._hasAvailability) {\n    return undefined;\n  }\n\n  const result = isTileAvailable(this, level, x, y);\n  if (defined(result)) {\n    return result;\n  }\n\n  requestAvailability(this, level, x, y);\n\n  return undefined;\n};\n\n/**\n * Makes sure we load availability data for a tile\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @returns {undefined} This provider does not support loading availability.\n */\nArcGISTiledElevationTerrainProvider.prototype.loadTileDataAvailability = function (\n  x,\n  y,\n  level\n) {\n  return undefined;\n};\n\nfunction findRange(origin, width, height, data) {\n  const endCol = width - 1;\n  const endRow = height - 1;\n\n  const value = data[origin.y * width + origin.x];\n  const endingIndices = [];\n  const range = {\n    startX: origin.x,\n    startY: origin.y,\n    endX: 0,\n    endY: 0,\n  };\n\n  const corner = new Cartesian2(origin.x + 1, origin.y + 1);\n  let doneX = false;\n  let doneY = false;\n  while (!(doneX && doneY)) {\n    // We want to use the original value when checking Y,\n    //  so get it before it possibly gets incremented\n    let endX = corner.x;\n\n    // If we no longer move in the Y direction we need to check the corner tile in X pass\n    const endY = doneY ? corner.y + 1 : corner.y;\n\n    // Check X range\n    if (!doneX) {\n      for (let y = origin.y; y < endY; ++y) {\n        if (data[y * width + corner.x] !== value) {\n          doneX = true;\n          break;\n        }\n      }\n\n      if (doneX) {\n        endingIndices.push(new Cartesian2(corner.x, origin.y));\n\n        // Use the last good column so we can continue with Y\n        --corner.x;\n        --endX;\n        range.endX = corner.x;\n      } else if (corner.x === endCol) {\n        range.endX = corner.x;\n        doneX = true;\n      } else {\n        ++corner.x;\n      }\n    }\n\n    // Check Y range - The corner tile is checked here\n    if (!doneY) {\n      const col = corner.y * width;\n      for (let x = origin.x; x <= endX; ++x) {\n        if (data[col + x] !== value) {\n          doneY = true;\n          break;\n        }\n      }\n\n      if (doneY) {\n        endingIndices.push(new Cartesian2(origin.x, corner.y));\n\n        // Use the last good row so we can continue with X\n        --corner.y;\n        range.endY = corner.y;\n      } else if (corner.y === endRow) {\n        range.endY = corner.y;\n        doneY = true;\n      } else {\n        ++corner.y;\n      }\n    }\n  }\n\n  return {\n    endingIndices: endingIndices,\n    range: range,\n    value: value,\n  };\n}\n\nfunction computeAvailability(x, y, width, height, data) {\n  const ranges = [];\n\n  const singleValue = data.every(function (val) {\n    return val === data[0];\n  });\n  if (singleValue) {\n    if (data[0] === 1) {\n      ranges.push({\n        startX: x,\n        startY: y,\n        endX: x + width - 1,\n        endY: y + height - 1,\n      });\n    }\n\n    return ranges;\n  }\n\n  let positions = [new Cartesian2(0, 0)];\n  while (positions.length > 0) {\n    const origin = positions.pop();\n    const result = findRange(origin, width, height, data);\n\n    if (result.value === 1) {\n      // Convert range into the array into global tile coordinates\n      const range = result.range;\n      range.startX += x;\n      range.endX += x;\n      range.startY += y;\n      range.endY += y;\n      ranges.push(range);\n    }\n\n    const endingIndices = result.endingIndices;\n    if (endingIndices.length > 0) {\n      positions = positions.concat(endingIndices);\n    }\n  }\n\n  return ranges;\n}\n\nfunction requestAvailability(that, level, x, y) {\n  if (!that._hasAvailability) {\n    return {};\n  }\n\n  // Fetch 128x128 availability list, so we make the minimum amount of requests\n  const xOffset = Math.floor(x / 128) * 128;\n  const yOffset = Math.floor(y / 128) * 128;\n\n  const dim = Math.min(1 << level, 128);\n  const url = `tilemap/${level}/${yOffset}/${xOffset}/${dim}/${dim}`;\n\n  const availableCache = that._availableCache;\n  if (defined(availableCache[url])) {\n    return availableCache[url];\n  }\n\n  const request = new Request({\n    throttle: false,\n    throttleByServer: true,\n    type: RequestType.TERRAIN,\n  });\n\n  const tilemapResource = that._resource.getDerivedResource({\n    url: url,\n    request: request,\n  });\n\n  let promise = tilemapResource.fetchJson();\n  if (!defined(promise)) {\n    return {};\n  }\n\n  promise = promise.then(function (result) {\n    const available = computeAvailability(\n      xOffset,\n      yOffset,\n      dim,\n      dim,\n      result.data\n    );\n\n    // Mark whole area as having availability loaded\n    that._tilesAvailabilityLoaded.addAvailableTileRange(\n      level,\n      xOffset,\n      yOffset,\n      xOffset + dim,\n      yOffset + dim\n    );\n\n    const tilesAvailable = that._tilesAvailable;\n    for (let i = 0; i < available.length; ++i) {\n      const range = available[i];\n      tilesAvailable.addAvailableTileRange(\n        level,\n        range.startX,\n        range.startY,\n        range.endX,\n        range.endY\n      );\n    }\n\n    // Conveniently return availability of original tile\n    return isTileAvailable(that, level, x, y);\n  });\n\n  availableCache[url] = {\n    promise: promise,\n    request: request,\n  };\n\n  promise = promise.finally(function (result) {\n    delete availableCache[url];\n\n    return result;\n  });\n\n  return {\n    promise: promise,\n    request: request,\n  };\n}\nexport default ArcGISTiledElevationTerrainProvider;\n", "import Check from \"./Check.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Resource from \"./Resource.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\nconst url = \"https://dev.virtualearth.net/REST/v1/Locations\";\n\n/**\n * Provides geocoding through Bing Maps.\n * @alias BingMapsGeocoderService\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {string} options.key A key to use with the Bing Maps geocoding service\n * @param {string} [options.culture] A Bing Maps {@link https://docs.microsoft.com/en-us/bingmaps/rest-services/common-parameters-and-types/supported-culture-codes|Culture Code} to return results in a specific culture and language.\n */\nfunction BingMapsGeocoderService(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const key = options.key;\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(key)) {\n    throw new DeveloperError(\"options.key is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._key = key;\n\n  const queryParameters = {\n    key: key,\n  };\n\n  if (defined(options.culture)) {\n    queryParameters.culture = options.culture;\n  }\n\n  this._resource = new Resource({\n    url: url,\n    queryParameters: queryParameters,\n  });\n\n  this._credit = new Credit(\n    `<img src=\"http:\\/\\/dev.virtualearth.net\\/Branding\\/logo_powered_by.png\"\\/>`,\n    false\n  );\n}\n\nObject.defineProperties(BingMapsGeocoderService.prototype, {\n  /**\n   * The URL endpoint for the Bing geocoder service\n   * @type {string}\n   * @memberof BingMapsGeocoderService.prototype\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return url;\n    },\n  },\n\n  /**\n   * The key for the Bing geocoder service\n   * @type {string}\n   * @memberof BingMapsGeocoderService.prototype\n   * @readonly\n   */\n  key: {\n    get: function () {\n      return this._key;\n    },\n  },\n  /**\n   * Gets the credit to display after a geocode is performed. Typically this is used to credit\n   * the geocoder service.\n   * @memberof BingMapsGeocoderService.prototype\n   * @type {Credit|undefined}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n});\n\n/**\n * @function\n *\n * @param {string} query The query to be sent to the geocoder service\n * @returns {Promise<GeocoderService.Result[]>}\n */\nBingMapsGeocoderService.prototype.geocode = async function (query) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"query\", query);\n  //>>includeEnd('debug');\n\n  const resource = this._resource.getDerivedResource({\n    queryParameters: {\n      query: query,\n    },\n  });\n\n  return resource.fetchJsonp(\"jsonp\").then(function (result) {\n    if (result.resourceSets.length === 0) {\n      return [];\n    }\n\n    const results = result.resourceSets[0].resources;\n\n    return results.map(function (resource) {\n      const bbox = resource.bbox;\n      const south = bbox[0];\n      const west = bbox[1];\n      const north = bbox[2];\n      const east = bbox[3];\n      return {\n        displayName: resource.name,\n        destination: Rectangle.fromDegrees(west, south, east, north),\n      };\n    });\n  });\n};\nexport default BingMapsGeocoderService;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\n\n/**\n * Geocodes queries containing longitude and latitude coordinates and an optional height.\n * Query format: `longitude latitude (height)` with longitude/latitude in degrees and height in meters.\n *\n * @alias CartographicGeocoderService\n * @constructor\n */\nfunction CartographicGeocoderService() {}\n\nObject.defineProperties(CartographicGeocoderService.prototype, {\n  /**\n   * Gets the credit to display after a geocode is performed. Typically this is used to credit\n   * the geocoder service.\n   * @memberof CartographicGeocoderService.prototype\n   * @type {Credit|undefined}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return undefined;\n    },\n  },\n});\n\n/**\n * @function\n *\n * @param {string} query The query to be sent to the geocoder service\n * @returns {Promise<GeocoderService.Result[]>}\n */\nCartographicGeocoderService.prototype.geocode = function (query) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"query\", query);\n  //>>includeEnd('debug');\n\n  const splitQuery = query.match(/[^\\s,\\n]+/g);\n  if (splitQuery.length === 2 || splitQuery.length === 3) {\n    let longitude = +splitQuery[0];\n    let latitude = +splitQuery[1];\n    const height = splitQuery.length === 3 ? +splitQuery[2] : 300.0;\n\n    if (isNaN(longitude) && isNaN(latitude)) {\n      const coordTest = /^(\\d+.?\\d*)([nsew])/i;\n      for (let i = 0; i < splitQuery.length; ++i) {\n        const splitCoord = splitQuery[i].match(coordTest);\n        if (coordTest.test(splitQuery[i]) && splitCoord.length === 3) {\n          if (/^[ns]/i.test(splitCoord[2])) {\n            latitude = /^[n]/i.test(splitCoord[2])\n              ? +splitCoord[1]\n              : -splitCoord[1];\n          } else if (/^[ew]/i.test(splitCoord[2])) {\n            longitude = /^[e]/i.test(splitCoord[2])\n              ? +splitCoord[1]\n              : -splitCoord[1];\n          }\n        }\n      }\n    }\n\n    if (!isNaN(longitude) && !isNaN(latitude) && !isNaN(height)) {\n      const result = {\n        displayName: query,\n        destination: Cartesian3.fromDegrees(longitude, latitude, height),\n      };\n      return Promise.resolve([result]);\n    }\n  }\n  return Promise.resolve([]);\n};\nexport default CartographicGeocoderService;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport HermiteSpline from \"./HermiteSpline.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Spline from \"./Spline.js\";\n\nconst scratchTimeVec = new Cartesian4();\nconst scratchTemp0 = new Cartesian3();\nconst scratchTemp1 = new Cartesian3();\n\nfunction createEvaluateFunction(spline) {\n  const points = spline.points;\n  const times = spline.times;\n\n  if (points.length < 3) {\n    const t0 = times[0];\n    const invSpan = 1.0 / (times[1] - t0);\n\n    const p0 = points[0];\n    const p1 = points[1];\n\n    return function (time, result) {\n      if (!defined(result)) {\n        result = new Cartesian3();\n      }\n      const u = (time - t0) * invSpan;\n      return Cartesian3.lerp(p0, p1, u, result);\n    };\n  }\n\n  return function (time, result) {\n    if (!defined(result)) {\n      result = new Cartesian3();\n    }\n    const i = (spline._lastTimeIndex = spline.findTimeInterval(\n      time,\n      spline._lastTimeIndex\n    ));\n    const u = (time - times[i]) / (times[i + 1] - times[i]);\n\n    const timeVec = scratchTimeVec;\n    timeVec.z = u;\n    timeVec.y = u * u;\n    timeVec.x = timeVec.y * u;\n    timeVec.w = 1.0;\n\n    let p0;\n    let p1;\n    let p2;\n    let p3;\n    let coefs;\n\n    if (i === 0) {\n      p0 = points[0];\n      p1 = points[1];\n      p2 = spline.firstTangent;\n\n      p3 = Cartesian3.subtract(points[2], p0, scratchTemp0);\n      Cartesian3.multiplyByScalar(p3, 0.5, p3);\n\n      coefs = Matrix4.multiplyByVector(\n        HermiteSpline.hermiteCoefficientMatrix,\n        timeVec,\n        timeVec\n      );\n    } else if (i === points.length - 2) {\n      p0 = points[i];\n      p1 = points[i + 1];\n      p3 = spline.lastTangent;\n\n      p2 = Cartesian3.subtract(p1, points[i - 1], scratchTemp0);\n      Cartesian3.multiplyByScalar(p2, 0.5, p2);\n\n      coefs = Matrix4.multiplyByVector(\n        HermiteSpline.hermiteCoefficientMatrix,\n        timeVec,\n        timeVec\n      );\n    } else {\n      p0 = points[i - 1];\n      p1 = points[i];\n      p2 = points[i + 1];\n      p3 = points[i + 2];\n      coefs = Matrix4.multiplyByVector(\n        CatmullRomSpline.catmullRomCoefficientMatrix,\n        timeVec,\n        timeVec\n      );\n    }\n    result = Cartesian3.multiplyByScalar(p0, coefs.x, result);\n    Cartesian3.multiplyByScalar(p1, coefs.y, scratchTemp1);\n    Cartesian3.add(result, scratchTemp1, result);\n    Cartesian3.multiplyByScalar(p2, coefs.z, scratchTemp1);\n    Cartesian3.add(result, scratchTemp1, result);\n    Cartesian3.multiplyByScalar(p3, coefs.w, scratchTemp1);\n    return Cartesian3.add(result, scratchTemp1, result);\n  };\n}\n\nconst firstTangentScratch = new Cartesian3();\nconst lastTangentScratch = new Cartesian3();\n\n/**\n * A Catmull-Rom spline is a cubic spline where the tangent at control points,\n * except the first and last, are computed using the previous and next control points.\n * Catmull-Rom splines are in the class C<sup>1</sup>.\n *\n * @alias CatmullRomSpline\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point.\n *                The values are in no way connected to the clock time. They are the parameterization for the curve.\n * @param {Cartesian3[]} options.points The array of {@link Cartesian3} control points.\n * @param {Cartesian3} [options.firstTangent] The tangent of the curve at the first control point.\n *                     If the tangent is not given, it will be estimated.\n * @param {Cartesian3} [options.lastTangent] The tangent of the curve at the last control point.\n *                     If the tangent is not given, it will be estimated.\n *\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be equal to points.length.\n *\n *\n * @example\n * // spline above the earth from Philadelphia to Los Angeles\n * const spline = new Cesium.CatmullRomSpline({\n *     times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],\n *     points : [\n *         new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),\n *         new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),\n *         new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),\n *         new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),\n *         new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)\n *     ]\n * });\n *\n * const p0 = spline.evaluate(times[i]);         // equal to positions[i]\n * const p1 = spline.evaluate(times[i] + delta); // interpolated value when delta < times[i + 1] - times[i]\n *\n * @see ConstantSpline\n * @see SteppedSpline\n * @see HermiteSpline\n * @see LinearSpline\n * @see QuaternionSpline\n * @see MorphWeightSpline\n */\nfunction CatmullRomSpline(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const points = options.points;\n  const times = options.times;\n  let firstTangent = options.firstTangent;\n  let lastTangent = options.lastTangent;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"points\", points);\n  Check.defined(\"times\", times);\n  Check.typeOf.number.greaterThanOrEquals(\"points.length\", points.length, 2);\n  Check.typeOf.number.equals(\n    \"times.length\",\n    \"points.length\",\n    times.length,\n    points.length\n  );\n  //>>includeEnd('debug');\n\n  if (points.length > 2) {\n    if (!defined(firstTangent)) {\n      firstTangent = firstTangentScratch;\n      Cartesian3.multiplyByScalar(points[1], 2.0, firstTangent);\n      Cartesian3.subtract(firstTangent, points[2], firstTangent);\n      Cartesian3.subtract(firstTangent, points[0], firstTangent);\n      Cartesian3.multiplyByScalar(firstTangent, 0.5, firstTangent);\n    }\n\n    if (!defined(lastTangent)) {\n      const n = points.length - 1;\n      lastTangent = lastTangentScratch;\n      Cartesian3.multiplyByScalar(points[n - 1], 2.0, lastTangent);\n      Cartesian3.subtract(points[n], lastTangent, lastTangent);\n      Cartesian3.add(lastTangent, points[n - 2], lastTangent);\n      Cartesian3.multiplyByScalar(lastTangent, 0.5, lastTangent);\n    }\n  }\n\n  this._times = times;\n  this._points = points;\n  this._firstTangent = Cartesian3.clone(firstTangent);\n  this._lastTangent = Cartesian3.clone(lastTangent);\n\n  this._evaluateFunction = createEvaluateFunction(this);\n  this._lastTimeIndex = 0;\n}\n\nObject.defineProperties(CatmullRomSpline.prototype, {\n  /**\n   * An array of times for the control points.\n   *\n   * @memberof CatmullRomSpline.prototype\n   *\n   * @type {number[]}\n   * @readonly\n   */\n  times: {\n    get: function () {\n      return this._times;\n    },\n  },\n\n  /**\n   * An array of {@link Cartesian3} control points.\n   *\n   * @memberof CatmullRomSpline.prototype\n   *\n   * @type {Cartesian3[]}\n   * @readonly\n   */\n  points: {\n    get: function () {\n      return this._points;\n    },\n  },\n\n  /**\n   * The tangent at the first control point.\n   *\n   * @memberof CatmullRomSpline.prototype\n   *\n   * @type {Cartesian3}\n   * @readonly\n   */\n  firstTangent: {\n    get: function () {\n      return this._firstTangent;\n    },\n  },\n\n  /**\n   * The tangent at the last control point.\n   *\n   * @memberof CatmullRomSpline.prototype\n   *\n   * @type {Cartesian3}\n   * @readonly\n   */\n  lastTangent: {\n    get: function () {\n      return this._lastTangent;\n    },\n  },\n});\n\n/**\n * @private\n */\nCatmullRomSpline.catmullRomCoefficientMatrix = new Matrix4(\n  -0.5,\n  1.0,\n  -0.5,\n  0.0,\n  1.5,\n  -2.5,\n  0.0,\n  1.0,\n  -1.5,\n  2.0,\n  0.5,\n  0.0,\n  0.5,\n  -0.5,\n  0.0,\n  0.0\n);\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n * @function\n *\n * @param {number} time The time.\n * @returns {number} The index for the element at the start of the interval.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n *                             in the array <code>times</code>.\n */\nCatmullRomSpline.prototype.findTimeInterval = Spline.prototype.findTimeInterval;\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, wrapped around to the updated animation.\n */\nCatmullRomSpline.prototype.wrapTime = Spline.prototype.wrapTime;\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, clamped to the animation period.\n */\nCatmullRomSpline.prototype.clampTime = Spline.prototype.clampTime;\n\n/**\n * Evaluates the curve at a given time.\n *\n * @param {number} time The time at which to evaluate the curve.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new instance of the point on the curve at the given time.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n *                             in the array <code>times</code>.\n */\nCatmullRomSpline.prototype.evaluate = function (time, result) {\n  return this._evaluateFunction(time, result);\n};\nexport default CatmullRomSpline;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Contains functions for operating on 2D triangles.\n *\n * @namespace Intersections2D\n */\nconst Intersections2D = {};\n\n/**\n * Splits a 2D triangle at given axis-aligned threshold value and returns the resulting\n * polygon on a given side of the threshold.  The resulting polygon may have 0, 1, 2,\n * 3, or 4 vertices.\n *\n * @param {number} threshold The threshold coordinate value at which to clip the triangle.\n * @param {boolean} keepAbove true to keep the portion of the triangle above the threshold, or false\n *                            to keep the portion below.\n * @param {number} u0 The coordinate of the first vertex in the triangle, in counter-clockwise order.\n * @param {number} u1 The coordinate of the second vertex in the triangle, in counter-clockwise order.\n * @param {number} u2 The coordinate of the third vertex in the triangle, in counter-clockwise order.\n * @param {number[]} [result] The array into which to copy the result.  If this parameter is not supplied,\n *                            a new array is constructed and returned.\n * @returns {number[]} The polygon that results after the clip, specified as a list of\n *                     vertices.  The vertices are specified in counter-clockwise order.\n *                     Each vertex is either an index from the existing list (identified as\n *                     a 0, 1, or 2) or -1 indicating a new vertex not in the original triangle.\n *                     For new vertices, the -1 is followed by three additional numbers: the\n *                     index of each of the two original vertices forming the line segment that\n *                     the new vertex lies on, and the fraction of the distance from the first\n *                     vertex to the second one.\n *\n * @example\n * const result = Cesium.Intersections2D.clipTriangleAtAxisAlignedThreshold(0.5, false, 0.2, 0.6, 0.4);\n * // result === [2, 0, -1, 1, 0, 0.25, -1, 1, 2, 0.5]\n */\nIntersections2D.clipTriangleAtAxisAlignedThreshold = function (\n  threshold,\n  keepAbove,\n  u0,\n  u1,\n  u2,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(threshold)) {\n    throw new DeveloperError(\"threshold is required.\");\n  }\n  if (!defined(keepAbove)) {\n    throw new DeveloperError(\"keepAbove is required.\");\n  }\n  if (!defined(u0)) {\n    throw new DeveloperError(\"u0 is required.\");\n  }\n  if (!defined(u1)) {\n    throw new DeveloperError(\"u1 is required.\");\n  }\n  if (!defined(u2)) {\n    throw new DeveloperError(\"u2 is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(result)) {\n    result = [];\n  } else {\n    result.length = 0;\n  }\n\n  let u0Behind;\n  let u1Behind;\n  let u2Behind;\n  if (keepAbove) {\n    u0Behind = u0 < threshold;\n    u1Behind = u1 < threshold;\n    u2Behind = u2 < threshold;\n  } else {\n    u0Behind = u0 > threshold;\n    u1Behind = u1 > threshold;\n    u2Behind = u2 > threshold;\n  }\n\n  const numBehind = u0Behind + u1Behind + u2Behind;\n\n  let u01Ratio;\n  let u02Ratio;\n  let u12Ratio;\n  let u10Ratio;\n  let u20Ratio;\n  let u21Ratio;\n\n  if (numBehind === 1) {\n    if (u0Behind) {\n      u01Ratio = (threshold - u0) / (u1 - u0);\n      u02Ratio = (threshold - u0) / (u2 - u0);\n\n      result.push(1);\n\n      result.push(2);\n\n      if (u02Ratio !== 1.0) {\n        result.push(-1);\n        result.push(0);\n        result.push(2);\n        result.push(u02Ratio);\n      }\n\n      if (u01Ratio !== 1.0) {\n        result.push(-1);\n        result.push(0);\n        result.push(1);\n        result.push(u01Ratio);\n      }\n    } else if (u1Behind) {\n      u12Ratio = (threshold - u1) / (u2 - u1);\n      u10Ratio = (threshold - u1) / (u0 - u1);\n\n      result.push(2);\n\n      result.push(0);\n\n      if (u10Ratio !== 1.0) {\n        result.push(-1);\n        result.push(1);\n        result.push(0);\n        result.push(u10Ratio);\n      }\n\n      if (u12Ratio !== 1.0) {\n        result.push(-1);\n        result.push(1);\n        result.push(2);\n        result.push(u12Ratio);\n      }\n    } else if (u2Behind) {\n      u20Ratio = (threshold - u2) / (u0 - u2);\n      u21Ratio = (threshold - u2) / (u1 - u2);\n\n      result.push(0);\n\n      result.push(1);\n\n      if (u21Ratio !== 1.0) {\n        result.push(-1);\n        result.push(2);\n        result.push(1);\n        result.push(u21Ratio);\n      }\n\n      if (u20Ratio !== 1.0) {\n        result.push(-1);\n        result.push(2);\n        result.push(0);\n        result.push(u20Ratio);\n      }\n    }\n  } else if (numBehind === 2) {\n    if (!u0Behind && u0 !== threshold) {\n      u10Ratio = (threshold - u1) / (u0 - u1);\n      u20Ratio = (threshold - u2) / (u0 - u2);\n\n      result.push(0);\n\n      result.push(-1);\n      result.push(1);\n      result.push(0);\n      result.push(u10Ratio);\n\n      result.push(-1);\n      result.push(2);\n      result.push(0);\n      result.push(u20Ratio);\n    } else if (!u1Behind && u1 !== threshold) {\n      u21Ratio = (threshold - u2) / (u1 - u2);\n      u01Ratio = (threshold - u0) / (u1 - u0);\n\n      result.push(1);\n\n      result.push(-1);\n      result.push(2);\n      result.push(1);\n      result.push(u21Ratio);\n\n      result.push(-1);\n      result.push(0);\n      result.push(1);\n      result.push(u01Ratio);\n    } else if (!u2Behind && u2 !== threshold) {\n      u02Ratio = (threshold - u0) / (u2 - u0);\n      u12Ratio = (threshold - u1) / (u2 - u1);\n\n      result.push(2);\n\n      result.push(-1);\n      result.push(0);\n      result.push(2);\n      result.push(u02Ratio);\n\n      result.push(-1);\n      result.push(1);\n      result.push(2);\n      result.push(u12Ratio);\n    }\n  } else if (numBehind !== 3) {\n    // Completely in front of threshold\n    result.push(0);\n    result.push(1);\n    result.push(2);\n  }\n  // else Completely behind threshold\n\n  return result;\n};\n\n/**\n * Compute the barycentric coordinates of a 2D position within a 2D triangle.\n *\n * @param {number} x The x coordinate of the position for which to find the barycentric coordinates.\n * @param {number} y The y coordinate of the position for which to find the barycentric coordinates.\n * @param {number} x1 The x coordinate of the triangle's first vertex.\n * @param {number} y1 The y coordinate of the triangle's first vertex.\n * @param {number} x2 The x coordinate of the triangle's second vertex.\n * @param {number} y2 The y coordinate of the triangle's second vertex.\n * @param {number} x3 The x coordinate of the triangle's third vertex.\n * @param {number} y3 The y coordinate of the triangle's third vertex.\n * @param {Cartesian3} [result] The instance into to which to copy the result.  If this parameter\n *                     is undefined, a new instance is created and returned.\n * @returns {Cartesian3} The barycentric coordinates of the position within the triangle.\n *\n * @example\n * const result = Cesium.Intersections2D.computeBarycentricCoordinates(0.0, 0.0, 0.0, 1.0, -1, -0.5, 1, -0.5);\n * // result === new Cesium.Cartesian3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0);\n */\nIntersections2D.computeBarycentricCoordinates = function (\n  x,\n  y,\n  x1,\n  y1,\n  x2,\n  y2,\n  x3,\n  y3,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(x)) {\n    throw new DeveloperError(\"x is required.\");\n  }\n  if (!defined(y)) {\n    throw new DeveloperError(\"y is required.\");\n  }\n  if (!defined(x1)) {\n    throw new DeveloperError(\"x1 is required.\");\n  }\n  if (!defined(y1)) {\n    throw new DeveloperError(\"y1 is required.\");\n  }\n  if (!defined(x2)) {\n    throw new DeveloperError(\"x2 is required.\");\n  }\n  if (!defined(y2)) {\n    throw new DeveloperError(\"y2 is required.\");\n  }\n  if (!defined(x3)) {\n    throw new DeveloperError(\"x3 is required.\");\n  }\n  if (!defined(y3)) {\n    throw new DeveloperError(\"y3 is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const x1mx3 = x1 - x3;\n  const x3mx2 = x3 - x2;\n  const y2my3 = y2 - y3;\n  const y1my3 = y1 - y3;\n  const inverseDeterminant = 1.0 / (y2my3 * x1mx3 + x3mx2 * y1my3);\n  const ymy3 = y - y3;\n  const xmx3 = x - x3;\n  const l1 = (y2my3 * xmx3 + x3mx2 * ymy3) * inverseDeterminant;\n  const l2 = (-y1my3 * xmx3 + x1mx3 * ymy3) * inverseDeterminant;\n  const l3 = 1.0 - l1 - l2;\n\n  if (defined(result)) {\n    result.x = l1;\n    result.y = l2;\n    result.z = l3;\n    return result;\n  }\n  return new Cartesian3(l1, l2, l3);\n};\n\n/**\n * Compute the intersection between 2 line segments\n *\n * @param {number} x00 The x coordinate of the first line's first vertex.\n * @param {number} y00 The y coordinate of the first line's first vertex.\n * @param {number} x01 The x coordinate of the first line's second vertex.\n * @param {number} y01 The y coordinate of the first line's second vertex.\n * @param {number} x10 The x coordinate of the second line's first vertex.\n * @param {number} y10 The y coordinate of the second line's first vertex.\n * @param {number} x11 The x coordinate of the second line's second vertex.\n * @param {number} y11 The y coordinate of the second line's second vertex.\n * @param {Cartesian2} [result] The instance into to which to copy the result. If this parameter\n *                     is undefined, a new instance is created and returned.\n * @returns {Cartesian2} The intersection point, undefined if there is no intersection point or lines are coincident.\n *\n * @example\n * const result = Cesium.Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1);\n * // result === new Cesium.Cartesian2(0.0, 1.0);\n */\nIntersections2D.computeLineSegmentLineSegmentIntersection = function (\n  x00,\n  y00,\n  x01,\n  y01,\n  x10,\n  y10,\n  x11,\n  y11,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"x00\", x00);\n  Check.typeOf.number(\"y00\", y00);\n  Check.typeOf.number(\"x01\", x01);\n  Check.typeOf.number(\"y01\", y01);\n  Check.typeOf.number(\"x10\", x10);\n  Check.typeOf.number(\"y10\", y10);\n  Check.typeOf.number(\"x11\", x11);\n  Check.typeOf.number(\"y11\", y11);\n  //>>includeEnd('debug');\n\n  const numerator1A = (x11 - x10) * (y00 - y10) - (y11 - y10) * (x00 - x10);\n  const numerator1B = (x01 - x00) * (y00 - y10) - (y01 - y00) * (x00 - x10);\n  const denominator1 = (y11 - y10) * (x01 - x00) - (x11 - x10) * (y01 - y00);\n\n  // If denominator = 0, then lines are parallel. If denominator = 0 and both numerators are 0, then coincident\n  if (denominator1 === 0) {\n    return;\n  }\n\n  const ua1 = numerator1A / denominator1;\n  const ub1 = numerator1B / denominator1;\n\n  if (ua1 >= 0 && ua1 <= 1 && ub1 >= 0 && ub1 <= 1) {\n    if (!defined(result)) {\n      result = new Cartesian2();\n    }\n\n    result.x = x00 + ua1 * (x01 - x00);\n    result.y = y00 + ua1 * (y01 - y00);\n\n    return result;\n  }\n};\nexport default Intersections2D;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport Intersections2D from \"./Intersections2D.js\";\nimport CesiumMath from \"./Math.js\";\nimport OrientedBoundingBox from \"./OrientedBoundingBox.js\";\nimport TaskProcessor from \"./TaskProcessor.js\";\nimport TerrainData from \"./TerrainData.js\";\nimport TerrainEncoding from \"./TerrainEncoding.js\";\nimport TerrainMesh from \"./TerrainMesh.js\";\n\n/**\n * Terrain data for a single tile where the terrain data is represented as a quantized mesh.  A quantized\n * mesh consists of three vertex attributes, longitude, latitude, and height.  All attributes are expressed\n * as 16-bit values in the range 0 to 32767.  Longitude and latitude are zero at the southwest corner\n * of the tile and 32767 at the northeast corner.  Height is zero at the minimum height in the tile\n * and 32767 at the maximum height in the tile.\n *\n * @alias QuantizedMeshTerrainData\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Uint16Array} options.quantizedVertices The buffer containing the quantized mesh.\n * @param {Uint16Array|Uint32Array} options.indices The indices specifying how the quantized vertices are linked\n *                      together into triangles.  Each three indices specifies one triangle.\n * @param {number} options.minimumHeight The minimum terrain height within the tile, in meters above the ellipsoid.\n * @param {number} options.maximumHeight The maximum terrain height within the tile, in meters above the ellipsoid.\n * @param {BoundingSphere} options.boundingSphere A sphere bounding all of the vertices in the mesh.\n * @param {OrientedBoundingBox} [options.orientedBoundingBox] An OrientedBoundingBox bounding all of the vertices in the mesh.\n * @param {Cartesian3} options.horizonOcclusionPoint The horizon occlusion point of the mesh.  If this point\n *                      is below the horizon, the entire tile is assumed to be below the horizon as well.\n *                      The point is expressed in ellipsoid-scaled coordinates.\n * @param {number[]} options.westIndices The indices of the vertices on the western edge of the tile.\n * @param {number[]} options.southIndices The indices of the vertices on the southern edge of the tile.\n * @param {number[]} options.eastIndices The indices of the vertices on the eastern edge of the tile.\n * @param {number[]} options.northIndices The indices of the vertices on the northern edge of the tile.\n * @param {number} options.westSkirtHeight The height of the skirt to add on the western edge of the tile.\n * @param {number} options.southSkirtHeight The height of the skirt to add on the southern edge of the tile.\n * @param {number} options.eastSkirtHeight The height of the skirt to add on the eastern edge of the tile.\n * @param {number} options.northSkirtHeight The height of the skirt to add on the northern edge of the tile.\n * @param {number} [options.childTileMask=15] A bit mask indicating which of this tile's four children exist.\n *                 If a child's bit is set, geometry will be requested for that tile as well when it\n *                 is needed.  If the bit is cleared, the child tile is not requested and geometry is\n *                 instead upsampled from the parent.  The bit values are as follows:\n *                 <table>\n *                  <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>\n *                  <tr><td>0</td><td>1</td><td>Southwest</td></tr>\n *                  <tr><td>1</td><td>2</td><td>Southeast</td></tr>\n *                  <tr><td>2</td><td>4</td><td>Northwest</td></tr>\n *                  <tr><td>3</td><td>8</td><td>Northeast</td></tr>\n *                 </table>\n * @param {boolean} [options.createdByUpsampling=false] True if this instance was created by upsampling another instance;\n *                  otherwise, false.\n * @param {Uint8Array} [options.encodedNormals] The buffer containing per vertex normals, encoded using 'oct' encoding\n * @param {Uint8Array} [options.waterMask] The buffer containing the watermask.\n * @param {Credit[]} [options.credits] Array of credits for this tile.\n *\n *\n * @example\n * const data = new Cesium.QuantizedMeshTerrainData({\n *     minimumHeight : -100,\n *     maximumHeight : 2101,\n *     quantizedVertices : new Uint16Array([// order is SW NW SE NE\n *                                          // longitude\n *                                          0, 0, 32767, 32767,\n *                                          // latitude\n *                                          0, 32767, 0, 32767,\n *                                          // heights\n *                                          16384, 0, 32767, 16384]),\n *     indices : new Uint16Array([0, 3, 1,\n *                                0, 2, 3]),\n *     boundingSphere : new Cesium.BoundingSphere(new Cesium.Cartesian3(1.0, 2.0, 3.0), 10000),\n *     orientedBoundingBox : new Cesium.OrientedBoundingBox(new Cesium.Cartesian3(1.0, 2.0, 3.0), Cesium.Matrix3.fromRotationX(Cesium.Math.PI, new Cesium.Matrix3())),\n *     horizonOcclusionPoint : new Cesium.Cartesian3(3.0, 2.0, 1.0),\n *     westIndices : [0, 1],\n *     southIndices : [0, 1],\n *     eastIndices : [2, 3],\n *     northIndices : [1, 3],\n *     westSkirtHeight : 1.0,\n *     southSkirtHeight : 1.0,\n *     eastSkirtHeight : 1.0,\n *     northSkirtHeight : 1.0\n * });\n *\n * @see TerrainData\n * @see HeightmapTerrainData\n * @see GoogleEarthEnterpriseTerrainData\n */\nfunction QuantizedMeshTerrainData(options) {\n  //>>includeStart('debug', pragmas.debug)\n  if (!defined(options) || !defined(options.quantizedVertices)) {\n    throw new DeveloperError(\"options.quantizedVertices is required.\");\n  }\n  if (!defined(options.indices)) {\n    throw new DeveloperError(\"options.indices is required.\");\n  }\n  if (!defined(options.minimumHeight)) {\n    throw new DeveloperError(\"options.minimumHeight is required.\");\n  }\n  if (!defined(options.maximumHeight)) {\n    throw new DeveloperError(\"options.maximumHeight is required.\");\n  }\n  if (!defined(options.maximumHeight)) {\n    throw new DeveloperError(\"options.maximumHeight is required.\");\n  }\n  if (!defined(options.boundingSphere)) {\n    throw new DeveloperError(\"options.boundingSphere is required.\");\n  }\n  if (!defined(options.horizonOcclusionPoint)) {\n    throw new DeveloperError(\"options.horizonOcclusionPoint is required.\");\n  }\n  if (!defined(options.westIndices)) {\n    throw new DeveloperError(\"options.westIndices is required.\");\n  }\n  if (!defined(options.southIndices)) {\n    throw new DeveloperError(\"options.southIndices is required.\");\n  }\n  if (!defined(options.eastIndices)) {\n    throw new DeveloperError(\"options.eastIndices is required.\");\n  }\n  if (!defined(options.northIndices)) {\n    throw new DeveloperError(\"options.northIndices is required.\");\n  }\n  if (!defined(options.westSkirtHeight)) {\n    throw new DeveloperError(\"options.westSkirtHeight is required.\");\n  }\n  if (!defined(options.southSkirtHeight)) {\n    throw new DeveloperError(\"options.southSkirtHeight is required.\");\n  }\n  if (!defined(options.eastSkirtHeight)) {\n    throw new DeveloperError(\"options.eastSkirtHeight is required.\");\n  }\n  if (!defined(options.northSkirtHeight)) {\n    throw new DeveloperError(\"options.northSkirtHeight is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._quantizedVertices = options.quantizedVertices;\n  this._encodedNormals = options.encodedNormals;\n  this._indices = options.indices;\n  this._minimumHeight = options.minimumHeight;\n  this._maximumHeight = options.maximumHeight;\n  this._boundingSphere = options.boundingSphere;\n  this._orientedBoundingBox = options.orientedBoundingBox;\n  this._horizonOcclusionPoint = options.horizonOcclusionPoint;\n  this._credits = options.credits;\n\n  const vertexCount = this._quantizedVertices.length / 3;\n  const uValues = (this._uValues = this._quantizedVertices.subarray(\n    0,\n    vertexCount\n  ));\n  const vValues = (this._vValues = this._quantizedVertices.subarray(\n    vertexCount,\n    2 * vertexCount\n  ));\n  this._heightValues = this._quantizedVertices.subarray(\n    2 * vertexCount,\n    3 * vertexCount\n  );\n\n  // We don't assume that we can count on the edge vertices being sorted by u or v.\n  function sortByV(a, b) {\n    return vValues[a] - vValues[b];\n  }\n\n  function sortByU(a, b) {\n    return uValues[a] - uValues[b];\n  }\n\n  this._westIndices = sortIndicesIfNecessary(\n    options.westIndices,\n    sortByV,\n    vertexCount\n  );\n  this._southIndices = sortIndicesIfNecessary(\n    options.southIndices,\n    sortByU,\n    vertexCount\n  );\n  this._eastIndices = sortIndicesIfNecessary(\n    options.eastIndices,\n    sortByV,\n    vertexCount\n  );\n  this._northIndices = sortIndicesIfNecessary(\n    options.northIndices,\n    sortByU,\n    vertexCount\n  );\n\n  this._westSkirtHeight = options.westSkirtHeight;\n  this._southSkirtHeight = options.southSkirtHeight;\n  this._eastSkirtHeight = options.eastSkirtHeight;\n  this._northSkirtHeight = options.northSkirtHeight;\n\n  this._childTileMask = defaultValue(options.childTileMask, 15);\n\n  this._createdByUpsampling = defaultValue(options.createdByUpsampling, false);\n  this._waterMask = options.waterMask;\n\n  this._mesh = undefined;\n}\n\nObject.defineProperties(QuantizedMeshTerrainData.prototype, {\n  /**\n   * An array of credits for this tile.\n   * @memberof QuantizedMeshTerrainData.prototype\n   * @type {Credit[]}\n   */\n  credits: {\n    get: function () {\n      return this._credits;\n    },\n  },\n  /**\n   * The water mask included in this terrain data, if any.  A water mask is a rectangular\n   * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.\n   * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.\n   * @memberof QuantizedMeshTerrainData.prototype\n   * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement}\n   */\n  waterMask: {\n    get: function () {\n      return this._waterMask;\n    },\n  },\n\n  childTileMask: {\n    get: function () {\n      return this._childTileMask;\n    },\n  },\n\n  canUpsample: {\n    get: function () {\n      return defined(this._mesh);\n    },\n  },\n});\n\nconst arrayScratch = [];\n\nfunction sortIndicesIfNecessary(indices, sortFunction, vertexCount) {\n  arrayScratch.length = indices.length;\n\n  let needsSort = false;\n  for (let i = 0, len = indices.length; i < len; ++i) {\n    arrayScratch[i] = indices[i];\n    needsSort =\n      needsSort || (i > 0 && sortFunction(indices[i - 1], indices[i]) > 0);\n  }\n\n  if (needsSort) {\n    arrayScratch.sort(sortFunction);\n    return IndexDatatype.createTypedArray(vertexCount, arrayScratch);\n  }\n  return indices;\n}\n\nconst createMeshTaskName = \"createVerticesFromQuantizedTerrainMesh\";\nconst createMeshTaskProcessorNoThrottle = new TaskProcessor(createMeshTaskName);\nconst createMeshTaskProcessorThrottle = new TaskProcessor(\n  createMeshTaskName,\n  TerrainData.maximumAsynchronousTasks\n);\n\n/**\n * Creates a {@link TerrainMesh} from this terrain data.\n *\n * @private\n *\n * @param {object} options Object with the following properties:\n * @param {TilingScheme} options.tilingScheme The tiling scheme to which this tile belongs.\n * @param {number} options.x The X coordinate of the tile for which to create the terrain data.\n * @param {number} options.y The Y coordinate of the tile for which to create the terrain data.\n * @param {number} options.level The level of the tile for which to create the terrain data.\n * @param {number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.\n * @param {number} [options.exaggerationRelativeHeight=0.0] The height relative to which terrain is exaggerated.\n * @param {boolean} [options.throttle=true] If true, indicates that this operation will need to be retried if too many asynchronous mesh creations are already in progress.\n * @returns {Promise<TerrainMesh>|undefined} A promise for the terrain mesh, or undefined if too many\n *          asynchronous mesh creations are already in progress and the operation should\n *          be retried later.\n */\nQuantizedMeshTerrainData.prototype.createMesh = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.tilingScheme\", options.tilingScheme);\n  Check.typeOf.number(\"options.x\", options.x);\n  Check.typeOf.number(\"options.y\", options.y);\n  Check.typeOf.number(\"options.level\", options.level);\n  //>>includeEnd('debug');\n\n  const tilingScheme = options.tilingScheme;\n  const x = options.x;\n  const y = options.y;\n  const level = options.level;\n  const exaggeration = defaultValue(options.exaggeration, 1.0);\n  const exaggerationRelativeHeight = defaultValue(\n    options.exaggerationRelativeHeight,\n    0.0\n  );\n  const throttle = defaultValue(options.throttle, true);\n\n  const ellipsoid = tilingScheme.ellipsoid;\n  const rectangle = tilingScheme.tileXYToRectangle(x, y, level);\n\n  const createMeshTaskProcessor = throttle\n    ? createMeshTaskProcessorThrottle\n    : createMeshTaskProcessorNoThrottle;\n\n  const verticesPromise = createMeshTaskProcessor.scheduleTask({\n    minimumHeight: this._minimumHeight,\n    maximumHeight: this._maximumHeight,\n    quantizedVertices: this._quantizedVertices,\n    octEncodedNormals: this._encodedNormals,\n    includeWebMercatorT: true,\n    indices: this._indices,\n    westIndices: this._westIndices,\n    southIndices: this._southIndices,\n    eastIndices: this._eastIndices,\n    northIndices: this._northIndices,\n    westSkirtHeight: this._westSkirtHeight,\n    southSkirtHeight: this._southSkirtHeight,\n    eastSkirtHeight: this._eastSkirtHeight,\n    northSkirtHeight: this._northSkirtHeight,\n    rectangle: rectangle,\n    relativeToCenter: this._boundingSphere.center,\n    ellipsoid: ellipsoid,\n    exaggeration: exaggeration,\n    exaggerationRelativeHeight: exaggerationRelativeHeight,\n  });\n\n  if (!defined(verticesPromise)) {\n    // Postponed\n    return undefined;\n  }\n\n  const that = this;\n  return Promise.resolve(verticesPromise).then(function (result) {\n    const vertexCountWithoutSkirts = that._quantizedVertices.length / 3;\n    const vertexCount =\n      vertexCountWithoutSkirts +\n      that._westIndices.length +\n      that._southIndices.length +\n      that._eastIndices.length +\n      that._northIndices.length;\n    const indicesTypedArray = IndexDatatype.createTypedArray(\n      vertexCount,\n      result.indices\n    );\n\n    const vertices = new Float32Array(result.vertices);\n    const rtc = result.center;\n    const minimumHeight = result.minimumHeight;\n    const maximumHeight = result.maximumHeight;\n    const boundingSphere = that._boundingSphere;\n    const obb = that._orientedBoundingBox;\n    const occludeePointInScaledSpace = defaultValue(\n      Cartesian3.clone(result.occludeePointInScaledSpace),\n      that._horizonOcclusionPoint\n    );\n    const stride = result.vertexStride;\n    const terrainEncoding = TerrainEncoding.clone(result.encoding);\n\n    // Clone complex result objects because the transfer from the web worker\n    // has stripped them down to JSON-style objects.\n    that._mesh = new TerrainMesh(\n      rtc,\n      vertices,\n      indicesTypedArray,\n      result.indexCountWithoutSkirts,\n      vertexCountWithoutSkirts,\n      minimumHeight,\n      maximumHeight,\n      boundingSphere,\n      occludeePointInScaledSpace,\n      stride,\n      obb,\n      terrainEncoding,\n      result.westIndicesSouthToNorth,\n      result.southIndicesEastToWest,\n      result.eastIndicesNorthToSouth,\n      result.northIndicesWestToEast\n    );\n\n    // Free memory received from server after mesh is created.\n    that._quantizedVertices = undefined;\n    that._encodedNormals = undefined;\n    that._indices = undefined;\n\n    that._uValues = undefined;\n    that._vValues = undefined;\n    that._heightValues = undefined;\n\n    that._westIndices = undefined;\n    that._southIndices = undefined;\n    that._eastIndices = undefined;\n    that._northIndices = undefined;\n\n    return that._mesh;\n  });\n};\n\nconst upsampleTaskProcessor = new TaskProcessor(\n  \"upsampleQuantizedTerrainMesh\",\n  TerrainData.maximumAsynchronousTasks\n);\n\n/**\n * Upsamples this terrain data for use by a descendant tile.  The resulting instance will contain a subset of the\n * vertices in this instance, interpolated if necessary.\n *\n * @param {TilingScheme} tilingScheme The tiling scheme of this terrain data.\n * @param {number} thisX The X coordinate of this tile in the tiling scheme.\n * @param {number} thisY The Y coordinate of this tile in the tiling scheme.\n * @param {number} thisLevel The level of this tile in the tiling scheme.\n * @param {number} descendantX The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {number} descendantY The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {number} descendantLevel The level within the tiling scheme of the descendant tile for which we are upsampling.\n * @returns {Promise<QuantizedMeshTerrainData>|undefined} A promise for upsampled heightmap terrain data for the descendant tile,\n *          or undefined if too many asynchronous upsample operations are in progress and the request has been\n *          deferred.\n */\nQuantizedMeshTerrainData.prototype.upsample = function (\n  tilingScheme,\n  thisX,\n  thisY,\n  thisLevel,\n  descendantX,\n  descendantY,\n  descendantLevel\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(tilingScheme)) {\n    throw new DeveloperError(\"tilingScheme is required.\");\n  }\n  if (!defined(thisX)) {\n    throw new DeveloperError(\"thisX is required.\");\n  }\n  if (!defined(thisY)) {\n    throw new DeveloperError(\"thisY is required.\");\n  }\n  if (!defined(thisLevel)) {\n    throw new DeveloperError(\"thisLevel is required.\");\n  }\n  if (!defined(descendantX)) {\n    throw new DeveloperError(\"descendantX is required.\");\n  }\n  if (!defined(descendantY)) {\n    throw new DeveloperError(\"descendantY is required.\");\n  }\n  if (!defined(descendantLevel)) {\n    throw new DeveloperError(\"descendantLevel is required.\");\n  }\n  const levelDifference = descendantLevel - thisLevel;\n  if (levelDifference > 1) {\n    throw new DeveloperError(\n      \"Upsampling through more than one level at a time is not currently supported.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const mesh = this._mesh;\n  if (!defined(this._mesh)) {\n    return undefined;\n  }\n\n  const isEastChild = thisX * 2 !== descendantX;\n  const isNorthChild = thisY * 2 === descendantY;\n\n  const ellipsoid = tilingScheme.ellipsoid;\n  const childRectangle = tilingScheme.tileXYToRectangle(\n    descendantX,\n    descendantY,\n    descendantLevel\n  );\n\n  const upsamplePromise = upsampleTaskProcessor.scheduleTask({\n    vertices: mesh.vertices,\n    vertexCountWithoutSkirts: mesh.vertexCountWithoutSkirts,\n    indices: mesh.indices,\n    indexCountWithoutSkirts: mesh.indexCountWithoutSkirts,\n    encoding: mesh.encoding,\n    minimumHeight: this._minimumHeight,\n    maximumHeight: this._maximumHeight,\n    isEastChild: isEastChild,\n    isNorthChild: isNorthChild,\n    childRectangle: childRectangle,\n    ellipsoid: ellipsoid,\n  });\n\n  if (!defined(upsamplePromise)) {\n    // Postponed\n    return undefined;\n  }\n\n  let shortestSkirt = Math.min(this._westSkirtHeight, this._eastSkirtHeight);\n  shortestSkirt = Math.min(shortestSkirt, this._southSkirtHeight);\n  shortestSkirt = Math.min(shortestSkirt, this._northSkirtHeight);\n\n  const westSkirtHeight = isEastChild\n    ? shortestSkirt * 0.5\n    : this._westSkirtHeight;\n  const southSkirtHeight = isNorthChild\n    ? shortestSkirt * 0.5\n    : this._southSkirtHeight;\n  const eastSkirtHeight = isEastChild\n    ? this._eastSkirtHeight\n    : shortestSkirt * 0.5;\n  const northSkirtHeight = isNorthChild\n    ? this._northSkirtHeight\n    : shortestSkirt * 0.5;\n  const credits = this._credits;\n\n  return Promise.resolve(upsamplePromise).then(function (result) {\n    const quantizedVertices = new Uint16Array(result.vertices);\n    const indicesTypedArray = IndexDatatype.createTypedArray(\n      quantizedVertices.length / 3,\n      result.indices\n    );\n    let encodedNormals;\n    if (defined(result.encodedNormals)) {\n      encodedNormals = new Uint8Array(result.encodedNormals);\n    }\n\n    return new QuantizedMeshTerrainData({\n      quantizedVertices: quantizedVertices,\n      indices: indicesTypedArray,\n      encodedNormals: encodedNormals,\n      minimumHeight: result.minimumHeight,\n      maximumHeight: result.maximumHeight,\n      boundingSphere: BoundingSphere.clone(result.boundingSphere),\n      orientedBoundingBox: OrientedBoundingBox.clone(\n        result.orientedBoundingBox\n      ),\n      horizonOcclusionPoint: Cartesian3.clone(result.horizonOcclusionPoint),\n      westIndices: result.westIndices,\n      southIndices: result.southIndices,\n      eastIndices: result.eastIndices,\n      northIndices: result.northIndices,\n      westSkirtHeight: westSkirtHeight,\n      southSkirtHeight: southSkirtHeight,\n      eastSkirtHeight: eastSkirtHeight,\n      northSkirtHeight: northSkirtHeight,\n      childTileMask: 0,\n      credits: credits,\n      createdByUpsampling: true,\n    });\n  });\n};\n\nconst maxShort = 32767;\nconst barycentricCoordinateScratch = new Cartesian3();\n\n/**\n * Computes the terrain height at a specified longitude and latitude.\n *\n * @param {Rectangle} rectangle The rectangle covered by this terrain data.\n * @param {number} longitude The longitude in radians.\n * @param {number} latitude The latitude in radians.\n * @returns {number} The terrain height at the specified position.  The position is clamped to\n *          the rectangle, so expect incorrect results for positions far outside the rectangle.\n */\nQuantizedMeshTerrainData.prototype.interpolateHeight = function (\n  rectangle,\n  longitude,\n  latitude\n) {\n  let u = CesiumMath.clamp(\n    (longitude - rectangle.west) / rectangle.width,\n    0.0,\n    1.0\n  );\n  u *= maxShort;\n  let v = CesiumMath.clamp(\n    (latitude - rectangle.south) / rectangle.height,\n    0.0,\n    1.0\n  );\n  v *= maxShort;\n\n  if (!defined(this._mesh)) {\n    return interpolateHeight(this, u, v);\n  }\n\n  return interpolateMeshHeight(this, u, v);\n};\n\nfunction pointInBoundingBox(u, v, u0, v0, u1, v1, u2, v2) {\n  const minU = Math.min(u0, u1, u2);\n  const maxU = Math.max(u0, u1, u2);\n  const minV = Math.min(v0, v1, v2);\n  const maxV = Math.max(v0, v1, v2);\n  return u >= minU && u <= maxU && v >= minV && v <= maxV;\n}\n\nconst texCoordScratch0 = new Cartesian2();\nconst texCoordScratch1 = new Cartesian2();\nconst texCoordScratch2 = new Cartesian2();\n\nfunction interpolateMeshHeight(terrainData, u, v) {\n  const mesh = terrainData._mesh;\n  const vertices = mesh.vertices;\n  const encoding = mesh.encoding;\n  const indices = mesh.indices;\n\n  for (let i = 0, len = indices.length; i < len; i += 3) {\n    const i0 = indices[i];\n    const i1 = indices[i + 1];\n    const i2 = indices[i + 2];\n\n    const uv0 = encoding.decodeTextureCoordinates(\n      vertices,\n      i0,\n      texCoordScratch0\n    );\n    const uv1 = encoding.decodeTextureCoordinates(\n      vertices,\n      i1,\n      texCoordScratch1\n    );\n    const uv2 = encoding.decodeTextureCoordinates(\n      vertices,\n      i2,\n      texCoordScratch2\n    );\n\n    if (pointInBoundingBox(u, v, uv0.x, uv0.y, uv1.x, uv1.y, uv2.x, uv2.y)) {\n      const barycentric = Intersections2D.computeBarycentricCoordinates(\n        u,\n        v,\n        uv0.x,\n        uv0.y,\n        uv1.x,\n        uv1.y,\n        uv2.x,\n        uv2.y,\n        barycentricCoordinateScratch\n      );\n      if (\n        barycentric.x >= -1e-15 &&\n        barycentric.y >= -1e-15 &&\n        barycentric.z >= -1e-15\n      ) {\n        const h0 = encoding.decodeHeight(vertices, i0);\n        const h1 = encoding.decodeHeight(vertices, i1);\n        const h2 = encoding.decodeHeight(vertices, i2);\n        return barycentric.x * h0 + barycentric.y * h1 + barycentric.z * h2;\n      }\n    }\n  }\n\n  // Position does not lie in any triangle in this mesh.\n  return undefined;\n}\n\nfunction interpolateHeight(terrainData, u, v) {\n  const uBuffer = terrainData._uValues;\n  const vBuffer = terrainData._vValues;\n  const heightBuffer = terrainData._heightValues;\n\n  const indices = terrainData._indices;\n  for (let i = 0, len = indices.length; i < len; i += 3) {\n    const i0 = indices[i];\n    const i1 = indices[i + 1];\n    const i2 = indices[i + 2];\n\n    const u0 = uBuffer[i0];\n    const u1 = uBuffer[i1];\n    const u2 = uBuffer[i2];\n\n    const v0 = vBuffer[i0];\n    const v1 = vBuffer[i1];\n    const v2 = vBuffer[i2];\n\n    if (pointInBoundingBox(u, v, u0, v0, u1, v1, u2, v2)) {\n      const barycentric = Intersections2D.computeBarycentricCoordinates(\n        u,\n        v,\n        u0,\n        v0,\n        u1,\n        v1,\n        u2,\n        v2,\n        barycentricCoordinateScratch\n      );\n      if (\n        barycentric.x >= -1e-15 &&\n        barycentric.y >= -1e-15 &&\n        barycentric.z >= -1e-15\n      ) {\n        const quantizedHeight =\n          barycentric.x * heightBuffer[i0] +\n          barycentric.y * heightBuffer[i1] +\n          barycentric.z * heightBuffer[i2];\n        return CesiumMath.lerp(\n          terrainData._minimumHeight,\n          terrainData._maximumHeight,\n          quantizedHeight / maxShort\n        );\n      }\n    }\n  }\n\n  // Position does not lie in any triangle in this mesh.\n  return undefined;\n}\n\n/**\n * Determines if a given child tile is available, based on the\n * {@link HeightmapTerrainData.childTileMask}.  The given child tile coordinates are assumed\n * to be one of the four children of this tile.  If non-child tile coordinates are\n * given, the availability of the southeast child tile is returned.\n *\n * @param {number} thisX The tile X coordinate of this (the parent) tile.\n * @param {number} thisY The tile Y coordinate of this (the parent) tile.\n * @param {number} childX The tile X coordinate of the child tile to check for availability.\n * @param {number} childY The tile Y coordinate of the child tile to check for availability.\n * @returns {boolean} True if the child tile is available; otherwise, false.\n */\nQuantizedMeshTerrainData.prototype.isChildAvailable = function (\n  thisX,\n  thisY,\n  childX,\n  childY\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(thisX)) {\n    throw new DeveloperError(\"thisX is required.\");\n  }\n  if (!defined(thisY)) {\n    throw new DeveloperError(\"thisY is required.\");\n  }\n  if (!defined(childX)) {\n    throw new DeveloperError(\"childX is required.\");\n  }\n  if (!defined(childY)) {\n    throw new DeveloperError(\"childY is required.\");\n  }\n  //>>includeEnd('debug');\n\n  let bitNumber = 2; // northwest child\n  if (childX !== thisX * 2) {\n    ++bitNumber; // east child\n  }\n  if (childY !== thisY * 2) {\n    bitNumber -= 2; // south child\n  }\n\n  return (this._childTileMask & (1 << bitNumber)) !== 0;\n};\n\n/**\n * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution\n * terrain data.  If this value is false, the data was obtained from some other source, such\n * as by downloading it from a remote server.  This method should return true for instances\n * returned from a call to {@link HeightmapTerrainData#upsample}.\n *\n * @returns {boolean} True if this instance was created by upsampling; otherwise, false.\n */\nQuantizedMeshTerrainData.prototype.wasCreatedByUpsampling = function () {\n  return this._createdByUpsampling;\n};\nexport default QuantizedMeshTerrainData;\n", "import AttributeCompression from \"./AttributeCompression.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Event from \"./Event.js\";\nimport GeographicTilingScheme from \"./GeographicTilingScheme.js\";\nimport WebMercatorTilingScheme from \"./WebMercatorTilingScheme.js\";\nimport getJsonFromTypedArray from \"./getJsonFromTypedArray.js\";\nimport HeightmapTerrainData from \"./HeightmapTerrainData.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport IonResource from \"./IonResource.js\";\nimport OrientedBoundingBox from \"./OrientedBoundingBox.js\";\nimport QuantizedMeshTerrainData from \"./QuantizedMeshTerrainData.js\";\nimport Request from \"./Request.js\";\nimport RequestType from \"./RequestType.js\";\nimport Resource from \"./Resource.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TerrainProvider from \"./TerrainProvider.js\";\nimport TileAvailability from \"./TileAvailability.js\";\nimport TileProviderError from \"./TileProviderError.js\";\n\nfunction LayerInformation(layer) {\n  this.resource = layer.resource;\n  this.version = layer.version;\n  this.isHeightmap = layer.isHeightmap;\n  this.tileUrlTemplates = layer.tileUrlTemplates;\n  this.availability = layer.availability;\n  this.hasVertexNormals = layer.hasVertexNormals;\n  this.hasWaterMask = layer.hasWaterMask;\n  this.hasMetadata = layer.hasMetadata;\n  this.availabilityLevels = layer.availabilityLevels;\n  this.availabilityTilesLoaded = layer.availabilityTilesLoaded;\n  this.littleEndianExtensionSize = layer.littleEndianExtensionSize;\n  this.availabilityPromiseCache = {};\n}\n\n/**\n * @typedef {Object} CesiumTerrainProvider.ConstructorOptions\n *\n * Initialization options for the CesiumTerrainProvider constructor\n *\n * @property {boolean} [requestVertexNormals=false] Flag that indicates if the client should request additional lighting information from the server, in the form of per vertex normals if available.\n * @property {boolean} [requestWaterMask=false] Flag that indicates if the client should request per tile water masks from the server, if available.\n * @property {boolean} [requestMetadata=true] Flag that indicates if the client should request per tile metadata from the server, if available.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If not specified, the WGS84 ellipsoid is used.\n * @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.\n */\n\n/**\n * Used to track creation details while fetching initial metadata\n *\n * @constructor\n * @private\n *\n * @param {CesiumTerrainProvider.ConstructorOptions} options An object describing initialization options\n */\nfunction TerrainProviderBuilder(options) {\n  this.requestVertexNormals = defaultValue(options.requestVertexNormals, false);\n  this.requestWaterMask = defaultValue(options.requestWaterMask, false);\n  this.requestMetadata = defaultValue(options.requestMetadata, true);\n  this.ellipsoid = options.ellipsoid;\n\n  this.heightmapWidth = 65;\n  this.heightmapStructure = undefined;\n  this.hasWaterMask = false;\n  this.hasMetadata = false;\n  this.hasVertexNormals = false;\n  this.scheme = undefined;\n\n  this.lastResource = undefined;\n  this.layerJsonResource = undefined;\n  this.previousError = undefined;\n  this.availability = undefined;\n  this.tilingScheme = undefined;\n  this.levelZeroMaximumGeometricError = undefined;\n  this.heightmapStructure = undefined;\n  this.layers = [];\n  this.attribution = \"\";\n  this.overallAvailability = [];\n  this.overallMaxZoom = 0;\n  this.tileCredits = [];\n}\n\n/**\n * Complete CesiumTerrainProvider creation based on builder values.\n *\n * @private\n *\n * @param {CesiumTerrainProvider} provider\n */\nTerrainProviderBuilder.prototype.build = function (provider) {\n  provider._heightmapWidth = this.heightmapWidth;\n  provider._scheme = this.scheme;\n\n  // ion resources have a credits property we can use for additional attribution.\n  const credits = defined(this.lastResource.credits)\n    ? this.lastResource.credits\n    : [];\n  provider._tileCredits = credits.concat(this.tileCredits);\n  provider._availability = this.availability;\n  provider._tilingScheme = this.tilingScheme;\n  provider._requestWaterMask = this.requestWaterMask;\n  provider._levelZeroMaximumGeometricError = this.levelZeroMaximumGeometricError;\n  provider._heightmapStructure = this.heightmapStructure;\n  provider._layers = this.layers;\n\n  provider._hasWaterMask = this.hasWaterMask;\n  provider._hasVertexNormals = this.hasVertexNormals;\n  provider._hasMetadata = this.hasMetadata;\n};\n\nasync function parseMetadataSuccess(terrainProviderBuilder, data, provider) {\n  if (!data.format) {\n    const message = \"The tile format is not specified in the layer.json file.\";\n    terrainProviderBuilder.previousError = TileProviderError.reportError(\n      terrainProviderBuilder.previousError,\n      provider,\n      defined(provider) ? provider._errorEvent : undefined,\n      message\n    );\n\n    throw new RuntimeError(message);\n  }\n\n  if (!data.tiles || data.tiles.length === 0) {\n    const message =\n      \"The layer.json file does not specify any tile URL templates.\";\n    terrainProviderBuilder.previousError = TileProviderError.reportError(\n      terrainProviderBuilder.previousError,\n      provider,\n      defined(provider) ? provider._errorEvent : undefined,\n      message\n    );\n\n    throw new RuntimeError(message);\n  }\n\n  let hasVertexNormals = false;\n  let hasWaterMask = false;\n  let hasMetadata = false;\n  let littleEndianExtensionSize = true;\n  let isHeightmap = false;\n  if (data.format === \"heightmap-1.0\") {\n    isHeightmap = true;\n    if (!defined(terrainProviderBuilder.heightmapStructure)) {\n      terrainProviderBuilder.heightmapStructure = {\n        heightScale: 1.0 / 5.0,\n        heightOffset: -1000.0,\n        elementsPerHeight: 1,\n        stride: 1,\n        elementMultiplier: 256.0,\n        isBigEndian: false,\n        lowestEncodedHeight: 0,\n        highestEncodedHeight: 256 * 256 - 1,\n      };\n    }\n    hasWaterMask = true;\n    terrainProviderBuilder.requestWaterMask = true;\n  } else if (data.format.indexOf(\"quantized-mesh-1.\") !== 0) {\n    const message = `The tile format \"${data.format}\" is invalid or not supported.`;\n    terrainProviderBuilder.previousError = TileProviderError.reportError(\n      terrainProviderBuilder.previousError,\n      provider,\n      defined(provider) ? provider._errorEvent : undefined,\n      message\n    );\n\n    throw new RuntimeError(message);\n  }\n\n  const tileUrlTemplates = data.tiles;\n\n  const maxZoom = data.maxzoom;\n  terrainProviderBuilder.overallMaxZoom = Math.max(\n    terrainProviderBuilder.overallMaxZoom,\n    maxZoom\n  );\n\n  // Keeps track of which of the availability containing tiles have been loaded\n  if (!data.projection || data.projection === \"EPSG:4326\") {\n    terrainProviderBuilder.tilingScheme = new GeographicTilingScheme({\n      numberOfLevelZeroTilesX: 2,\n      numberOfLevelZeroTilesY: 1,\n      ellipsoid: terrainProviderBuilder.ellipsoid,\n    });\n  } else if (data.projection === \"EPSG:3857\") {\n    terrainProviderBuilder.tilingScheme = new WebMercatorTilingScheme({\n      numberOfLevelZeroTilesX: 1,\n      numberOfLevelZeroTilesY: 1,\n      ellipsoid: terrainProviderBuilder.ellipsoid,\n    });\n  } else {\n    const message = `The projection \"${data.projection}\" is invalid or not supported.`;\n    terrainProviderBuilder.previousError = TileProviderError.reportError(\n      terrainProviderBuilder.previousError,\n      provider,\n      defined(provider) ? provider._errorEvent : undefined,\n      message\n    );\n\n    throw new RuntimeError(message);\n  }\n\n  terrainProviderBuilder.levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(\n    terrainProviderBuilder.tilingScheme.ellipsoid,\n    terrainProviderBuilder.heightmapWidth,\n    terrainProviderBuilder.tilingScheme.getNumberOfXTilesAtLevel(0)\n  );\n  if (!data.scheme || data.scheme === \"tms\" || data.scheme === \"slippyMap\") {\n    terrainProviderBuilder.scheme = data.scheme;\n  } else {\n    const message = `The scheme \"${data.scheme}\" is invalid or not supported.`;\n    terrainProviderBuilder.previousError = TileProviderError.reportError(\n      terrainProviderBuilder.previousError,\n      provider,\n      defined(provider) ? provider._errorEvent : undefined,\n      message\n    );\n\n    throw new RuntimeError(message);\n  }\n\n  let availabilityTilesLoaded;\n\n  // The vertex normals defined in the 'octvertexnormals' extension is identical to the original\n  // contents of the original 'vertexnormals' extension.  'vertexnormals' extension is now\n  // deprecated, as the extensionLength for this extension was incorrectly using big endian.\n  // We maintain backwards compatibility with the legacy 'vertexnormal' implementation\n  // by setting the _littleEndianExtensionSize to false. Always prefer 'octvertexnormals'\n  // over 'vertexnormals' if both extensions are supported by the server.\n  if (\n    defined(data.extensions) &&\n    data.extensions.indexOf(\"octvertexnormals\") !== -1\n  ) {\n    hasVertexNormals = true;\n  } else if (\n    defined(data.extensions) &&\n    data.extensions.indexOf(\"vertexnormals\") !== -1\n  ) {\n    hasVertexNormals = true;\n    littleEndianExtensionSize = false;\n  }\n  if (defined(data.extensions) && data.extensions.indexOf(\"watermask\") !== -1) {\n    hasWaterMask = true;\n  }\n  if (defined(data.extensions) && data.extensions.indexOf(\"metadata\") !== -1) {\n    hasMetadata = true;\n  }\n\n  const availabilityLevels = data.metadataAvailability;\n  const availableTiles = data.available;\n  let availability;\n  if (defined(availableTiles) && !defined(availabilityLevels)) {\n    availability = new TileAvailability(\n      terrainProviderBuilder.tilingScheme,\n      availableTiles.length\n    );\n    for (let level = 0; level < availableTiles.length; ++level) {\n      const rangesAtLevel = availableTiles[level];\n      const yTiles = terrainProviderBuilder.tilingScheme.getNumberOfYTilesAtLevel(\n        level\n      );\n      if (!defined(terrainProviderBuilder.overallAvailability[level])) {\n        terrainProviderBuilder.overallAvailability[level] = [];\n      }\n\n      for (\n        let rangeIndex = 0;\n        rangeIndex < rangesAtLevel.length;\n        ++rangeIndex\n      ) {\n        const range = rangesAtLevel[rangeIndex];\n        const yStart = yTiles - range.endY - 1;\n        const yEnd = yTiles - range.startY - 1;\n        terrainProviderBuilder.overallAvailability[level].push([\n          range.startX,\n          yStart,\n          range.endX,\n          yEnd,\n        ]);\n        availability.addAvailableTileRange(\n          level,\n          range.startX,\n          yStart,\n          range.endX,\n          yEnd\n        );\n      }\n    }\n  } else if (defined(availabilityLevels)) {\n    availabilityTilesLoaded = new TileAvailability(\n      terrainProviderBuilder.tilingScheme,\n      maxZoom\n    );\n    availability = new TileAvailability(\n      terrainProviderBuilder.tilingScheme,\n      maxZoom\n    );\n    terrainProviderBuilder.overallAvailability[0] = [[0, 0, 1, 0]];\n    availability.addAvailableTileRange(0, 0, 0, 1, 0);\n  }\n\n  terrainProviderBuilder.hasWaterMask =\n    terrainProviderBuilder.hasWaterMask || hasWaterMask;\n  terrainProviderBuilder.hasVertexNormals =\n    terrainProviderBuilder.hasVertexNormals || hasVertexNormals;\n  terrainProviderBuilder.hasMetadata =\n    terrainProviderBuilder.hasMetadata || hasMetadata;\n\n  if (defined(data.attribution)) {\n    if (terrainProviderBuilder.attribution.length > 0) {\n      terrainProviderBuilder.attribution += \" \";\n    }\n    terrainProviderBuilder.attribution += data.attribution;\n  }\n\n  terrainProviderBuilder.layers.push(\n    new LayerInformation({\n      resource: terrainProviderBuilder.lastResource,\n      version: data.version,\n      isHeightmap: isHeightmap,\n      tileUrlTemplates: tileUrlTemplates,\n      availability: availability,\n      hasVertexNormals: hasVertexNormals,\n      hasWaterMask: hasWaterMask,\n      hasMetadata: hasMetadata,\n      availabilityLevels: availabilityLevels,\n      availabilityTilesLoaded: availabilityTilesLoaded,\n      littleEndianExtensionSize: littleEndianExtensionSize,\n    })\n  );\n\n  const parentUrl = data.parentUrl;\n  if (defined(parentUrl)) {\n    if (!defined(availability)) {\n      console.log(\n        \"A layer.json can't have a parentUrl if it does't have an available array.\"\n      );\n      return true;\n    }\n\n    terrainProviderBuilder.lastResource = terrainProviderBuilder.lastResource.getDerivedResource(\n      {\n        url: parentUrl,\n      }\n    );\n    terrainProviderBuilder.lastResource.appendForwardSlash(); // Terrain always expects a directory\n    terrainProviderBuilder.layerJsonResource = terrainProviderBuilder.lastResource.getDerivedResource(\n      {\n        url: \"layer.json\",\n      }\n    );\n    await requestLayerJson(terrainProviderBuilder);\n    return true;\n  }\n\n  return true;\n}\n\nfunction parseMetadataFailure(terrainProviderBuilder, error, provider) {\n  let message = `An error occurred while accessing ${terrainProviderBuilder.layerJsonResource.url}.`;\n  if (defined(error)) {\n    message += `\\n${error.message}`;\n  }\n\n  terrainProviderBuilder.previousError = TileProviderError.reportError(\n    terrainProviderBuilder.previousError,\n    provider,\n    defined(provider) ? provider._errorEvent : undefined,\n    message\n  );\n\n  // If we can retry, do so. Otherwise throw the error.\n  if (terrainProviderBuilder.previousError.retry) {\n    return requestLayerJson(terrainProviderBuilder, provider);\n  }\n\n  throw new RuntimeError(message);\n}\n\nasync function metadataSuccess(terrainProviderBuilder, data, provider) {\n  await parseMetadataSuccess(terrainProviderBuilder, data, provider);\n\n  const length = terrainProviderBuilder.overallAvailability.length;\n  if (length > 0) {\n    const availability = (terrainProviderBuilder.availability = new TileAvailability(\n      terrainProviderBuilder.tilingScheme,\n      terrainProviderBuilder.overallMaxZoom\n    ));\n    for (let level = 0; level < length; ++level) {\n      const levelRanges = terrainProviderBuilder.overallAvailability[level];\n      for (let i = 0; i < levelRanges.length; ++i) {\n        const range = levelRanges[i];\n        availability.addAvailableTileRange(\n          level,\n          range[0],\n          range[1],\n          range[2],\n          range[3]\n        );\n      }\n    }\n  }\n\n  if (terrainProviderBuilder.attribution.length > 0) {\n    const layerJsonCredit = new Credit(terrainProviderBuilder.attribution);\n    terrainProviderBuilder.tileCredits.push(layerJsonCredit);\n  }\n\n  return true;\n}\n\nasync function requestLayerJson(terrainProviderBuilder, provider) {\n  try {\n    const data = await terrainProviderBuilder.layerJsonResource.fetchJson();\n    return metadataSuccess(terrainProviderBuilder, data, provider);\n  } catch (error) {\n    // If the metadata is not found, assume this is a pre-metadata heightmap tileset.\n    if (defined(error) && error.statusCode === 404) {\n      await parseMetadataSuccess(\n        terrainProviderBuilder,\n        {\n          tilejson: \"2.1.0\",\n          format: \"heightmap-1.0\",\n          version: \"1.0.0\",\n          scheme: \"tms\",\n          tiles: [\"{z}/{x}/{y}.terrain?v={version}\"],\n        },\n        provider\n      );\n\n      return true;\n    }\n\n    return parseMetadataFailure(terrainProviderBuilder, error, provider);\n  }\n}\n\n/**\n * <div class=\"notice\">\n * To construct a CesiumTerrainProvider, call {@link CesiumTerrainProvider.fromIonAssetId} or {@link CesiumTerrainProvider.fromUrl}. Do not call the constructor directly.\n * </div>\n *\n * A {@link TerrainProvider} that accesses terrain data in a Cesium terrain format.\n * Terrain formats can be one of the following:\n * <ul>\n * <li> {@link https://github.com/AnalyticalGraphicsInc/quantized-mesh Quantized Mesh} </li>\n * <li> {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/heightmap-1.0 Height Map} </li>\n * </ul>\n *\n * @alias CesiumTerrainProvider\n * @constructor\n *\n * @param {CesiumTerrainProvider.ConstructorOptions} [options] An object describing initialization options\n *\n * @example\n * // Create Arctic DEM terrain with normals.\n * try {\n *   const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n *     terrainProvider: await Cesium.CesiumTerrainProvider.fromIonAssetId(3956, {\n *       requestVertexNormals: true\n *     })\n *   });\n * } catch (error) {\n *   console.log(error);\n * }\n *\n * @see createWorldTerrain\n * @see CesiumTerrainProvider.fromUrl\n * @see CesiumTerrainProvider.fromIonAssetId\n * @see TerrainProvider\n */\nfunction CesiumTerrainProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._heightmapWidth = undefined;\n  this._heightmapStructure = undefined;\n  this._hasWaterMask = false;\n  this._hasVertexNormals = false;\n  this._hasMetadata = false;\n  this._scheme = undefined;\n  this._ellipsoid = options.ellipsoid;\n\n  /**\n   * Boolean flag that indicates if the client should request vertex normals from the server.\n   * @type {boolean}\n   * @default false\n   * @private\n   */\n  this._requestVertexNormals = defaultValue(\n    options.requestVertexNormals,\n    false\n  );\n\n  /**\n   * Boolean flag that indicates if the client should request tile watermasks from the server.\n   * @type {boolean}\n   * @default false\n   * @private\n   */\n  this._requestWaterMask = defaultValue(options.requestWaterMask, false);\n\n  /**\n   * Boolean flag that indicates if the client should request tile metadata from the server.\n   * @type {boolean}\n   * @default true\n   * @private\n   */\n  this._requestMetadata = defaultValue(options.requestMetadata, true);\n\n  this._errorEvent = new Event();\n\n  let credit = options.credit;\n  if (typeof credit === \"string\") {\n    credit = new Credit(credit);\n  }\n  this._credit = credit;\n\n  this._availability = undefined;\n  this._tilingScheme = undefined;\n  this._levelZeroMaximumGeometricError = undefined;\n  this._layers = undefined;\n  this._tileCredits = undefined;\n}\n\n/**\n * When using the Quantized-Mesh format, a tile may be returned that includes additional extensions, such as PerVertexNormals, watermask, etc.\n * This enumeration defines the unique identifiers for each type of extension data that has been appended to the standard mesh data.\n *\n * @namespace QuantizedMeshExtensionIds\n * @see CesiumTerrainProvider\n * @private\n */\nconst QuantizedMeshExtensionIds = {\n  /**\n   * Oct-Encoded Per-Vertex Normals are included as an extension to the tile mesh\n   *\n   * @type {number}\n   * @constant\n   * @default 1\n   */\n  OCT_VERTEX_NORMALS: 1,\n  /**\n   * A watermask is included as an extension to the tile mesh\n   *\n   * @type {number}\n   * @constant\n   * @default 2\n   */\n  WATER_MASK: 2,\n  /**\n   * A json object contain metadata about the tile\n   *\n   * @type {number}\n   * @constant\n   * @default 4\n   */\n  METADATA: 4,\n};\n\nfunction getRequestHeader(extensionsList) {\n  if (!defined(extensionsList) || extensionsList.length === 0) {\n    return {\n      Accept:\n        \"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01\",\n    };\n  }\n  const extensions = extensionsList.join(\"-\");\n  return {\n    Accept: `application/vnd.quantized-mesh;extensions=${extensions},application/octet-stream;q=0.9,*/*;q=0.01`,\n  };\n}\n\nfunction createHeightmapTerrainData(provider, buffer, level, x, y) {\n  const heightBuffer = new Uint16Array(\n    buffer,\n    0,\n    provider._heightmapWidth * provider._heightmapWidth\n  );\n  return new HeightmapTerrainData({\n    buffer: heightBuffer,\n    childTileMask: new Uint8Array(buffer, heightBuffer.byteLength, 1)[0],\n    waterMask: new Uint8Array(\n      buffer,\n      heightBuffer.byteLength + 1,\n      buffer.byteLength - heightBuffer.byteLength - 1\n    ),\n    width: provider._heightmapWidth,\n    height: provider._heightmapWidth,\n    structure: provider._heightmapStructure,\n    credits: provider._tileCredits,\n  });\n}\n\nfunction createQuantizedMeshTerrainData(provider, buffer, level, x, y, layer) {\n  const littleEndianExtensionSize = layer.littleEndianExtensionSize;\n  let pos = 0;\n  const cartesian3Elements = 3;\n  const boundingSphereElements = cartesian3Elements + 1;\n  const cartesian3Length = Float64Array.BYTES_PER_ELEMENT * cartesian3Elements;\n  const boundingSphereLength =\n    Float64Array.BYTES_PER_ELEMENT * boundingSphereElements;\n  const encodedVertexElements = 3;\n  const encodedVertexLength =\n    Uint16Array.BYTES_PER_ELEMENT * encodedVertexElements;\n  const triangleElements = 3;\n  let bytesPerIndex = Uint16Array.BYTES_PER_ELEMENT;\n  let triangleLength = bytesPerIndex * triangleElements;\n\n  const view = new DataView(buffer);\n  const center = new Cartesian3(\n    view.getFloat64(pos, true),\n    view.getFloat64(pos + 8, true),\n    view.getFloat64(pos + 16, true)\n  );\n  pos += cartesian3Length;\n\n  const minimumHeight = view.getFloat32(pos, true);\n  pos += Float32Array.BYTES_PER_ELEMENT;\n  const maximumHeight = view.getFloat32(pos, true);\n  pos += Float32Array.BYTES_PER_ELEMENT;\n\n  const boundingSphere = new BoundingSphere(\n    new Cartesian3(\n      view.getFloat64(pos, true),\n      view.getFloat64(pos + 8, true),\n      view.getFloat64(pos + 16, true)\n    ),\n    view.getFloat64(pos + cartesian3Length, true)\n  );\n  pos += boundingSphereLength;\n\n  const horizonOcclusionPoint = new Cartesian3(\n    view.getFloat64(pos, true),\n    view.getFloat64(pos + 8, true),\n    view.getFloat64(pos + 16, true)\n  );\n  pos += cartesian3Length;\n\n  const vertexCount = view.getUint32(pos, true);\n  pos += Uint32Array.BYTES_PER_ELEMENT;\n  const encodedVertexBuffer = new Uint16Array(buffer, pos, vertexCount * 3);\n  pos += vertexCount * encodedVertexLength;\n\n  if (vertexCount > 64 * 1024) {\n    // More than 64k vertices, so indices are 32-bit.\n    bytesPerIndex = Uint32Array.BYTES_PER_ELEMENT;\n    triangleLength = bytesPerIndex * triangleElements;\n  }\n\n  // Decode the vertex buffer.\n  const uBuffer = encodedVertexBuffer.subarray(0, vertexCount);\n  const vBuffer = encodedVertexBuffer.subarray(vertexCount, 2 * vertexCount);\n  const heightBuffer = encodedVertexBuffer.subarray(\n    vertexCount * 2,\n    3 * vertexCount\n  );\n\n  AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);\n\n  // skip over any additional padding that was added for 2/4 byte alignment\n  if (pos % bytesPerIndex !== 0) {\n    pos += bytesPerIndex - (pos % bytesPerIndex);\n  }\n\n  const triangleCount = view.getUint32(pos, true);\n  pos += Uint32Array.BYTES_PER_ELEMENT;\n  const indices = IndexDatatype.createTypedArrayFromArrayBuffer(\n    vertexCount,\n    buffer,\n    pos,\n    triangleCount * triangleElements\n  );\n  pos += triangleCount * triangleLength;\n\n  // High water mark decoding based on decompressIndices_ in webgl-loader's loader.js.\n  // https://code.google.com/p/webgl-loader/source/browse/trunk/samples/loader.js?r=99#55\n  // Copyright 2012 Google Inc., Apache 2.0 license.\n  let highest = 0;\n  const length = indices.length;\n  for (let i = 0; i < length; ++i) {\n    const code = indices[i];\n    indices[i] = highest - code;\n    if (code === 0) {\n      ++highest;\n    }\n  }\n\n  const westVertexCount = view.getUint32(pos, true);\n  pos += Uint32Array.BYTES_PER_ELEMENT;\n  const westIndices = IndexDatatype.createTypedArrayFromArrayBuffer(\n    vertexCount,\n    buffer,\n    pos,\n    westVertexCount\n  );\n  pos += westVertexCount * bytesPerIndex;\n\n  const southVertexCount = view.getUint32(pos, true);\n  pos += Uint32Array.BYTES_PER_ELEMENT;\n  const southIndices = IndexDatatype.createTypedArrayFromArrayBuffer(\n    vertexCount,\n    buffer,\n    pos,\n    southVertexCount\n  );\n  pos += southVertexCount * bytesPerIndex;\n\n  const eastVertexCount = view.getUint32(pos, true);\n  pos += Uint32Array.BYTES_PER_ELEMENT;\n  const eastIndices = IndexDatatype.createTypedArrayFromArrayBuffer(\n    vertexCount,\n    buffer,\n    pos,\n    eastVertexCount\n  );\n  pos += eastVertexCount * bytesPerIndex;\n\n  const northVertexCount = view.getUint32(pos, true);\n  pos += Uint32Array.BYTES_PER_ELEMENT;\n  const northIndices = IndexDatatype.createTypedArrayFromArrayBuffer(\n    vertexCount,\n    buffer,\n    pos,\n    northVertexCount\n  );\n  pos += northVertexCount * bytesPerIndex;\n\n  let encodedNormalBuffer;\n  let waterMaskBuffer;\n  while (pos < view.byteLength) {\n    const extensionId = view.getUint8(pos, true);\n    pos += Uint8Array.BYTES_PER_ELEMENT;\n    const extensionLength = view.getUint32(pos, littleEndianExtensionSize);\n    pos += Uint32Array.BYTES_PER_ELEMENT;\n\n    if (\n      extensionId === QuantizedMeshExtensionIds.OCT_VERTEX_NORMALS &&\n      provider._requestVertexNormals\n    ) {\n      encodedNormalBuffer = new Uint8Array(buffer, pos, vertexCount * 2);\n    } else if (\n      extensionId === QuantizedMeshExtensionIds.WATER_MASK &&\n      provider._requestWaterMask\n    ) {\n      waterMaskBuffer = new Uint8Array(buffer, pos, extensionLength);\n    } else if (\n      extensionId === QuantizedMeshExtensionIds.METADATA &&\n      provider._requestMetadata\n    ) {\n      const stringLength = view.getUint32(pos, true);\n      if (stringLength > 0) {\n        const metadata = getJsonFromTypedArray(\n          new Uint8Array(buffer),\n          pos + Uint32Array.BYTES_PER_ELEMENT,\n          stringLength\n        );\n        const availableTiles = metadata.available;\n        if (defined(availableTiles)) {\n          for (let offset = 0; offset < availableTiles.length; ++offset) {\n            const availableLevel = level + offset + 1;\n            const rangesAtLevel = availableTiles[offset];\n            const yTiles = provider._tilingScheme.getNumberOfYTilesAtLevel(\n              availableLevel\n            );\n\n            for (\n              let rangeIndex = 0;\n              rangeIndex < rangesAtLevel.length;\n              ++rangeIndex\n            ) {\n              const range = rangesAtLevel[rangeIndex];\n              const yStart = yTiles - range.endY - 1;\n              const yEnd = yTiles - range.startY - 1;\n              provider.availability.addAvailableTileRange(\n                availableLevel,\n                range.startX,\n                yStart,\n                range.endX,\n                yEnd\n              );\n              layer.availability.addAvailableTileRange(\n                availableLevel,\n                range.startX,\n                yStart,\n                range.endX,\n                yEnd\n              );\n            }\n          }\n        }\n      }\n      layer.availabilityTilesLoaded.addAvailableTileRange(level, x, y, x, y);\n    }\n    pos += extensionLength;\n  }\n\n  const skirtHeight = provider.getLevelMaximumGeometricError(level) * 5.0;\n\n  // The skirt is not included in the OBB computation. If this ever\n  // causes any rendering artifacts (cracks), they are expected to be\n  // minor and in the corners of the screen. It's possible that this\n  // might need to be changed - just change to `minimumHeight - skirtHeight`\n  // A similar change might also be needed in `upsampleQuantizedTerrainMesh.js`.\n  const rectangle = provider._tilingScheme.tileXYToRectangle(x, y, level);\n  const orientedBoundingBox = OrientedBoundingBox.fromRectangle(\n    rectangle,\n    minimumHeight,\n    maximumHeight,\n    provider._tilingScheme.ellipsoid\n  );\n\n  return new QuantizedMeshTerrainData({\n    center: center,\n    minimumHeight: minimumHeight,\n    maximumHeight: maximumHeight,\n    boundingSphere: boundingSphere,\n    orientedBoundingBox: orientedBoundingBox,\n    horizonOcclusionPoint: horizonOcclusionPoint,\n    quantizedVertices: encodedVertexBuffer,\n    encodedNormals: encodedNormalBuffer,\n    indices: indices,\n    westIndices: westIndices,\n    southIndices: southIndices,\n    eastIndices: eastIndices,\n    northIndices: northIndices,\n    westSkirtHeight: skirtHeight,\n    southSkirtHeight: skirtHeight,\n    eastSkirtHeight: skirtHeight,\n    northSkirtHeight: skirtHeight,\n    childTileMask: provider.availability.computeChildMaskForTile(level, x, y),\n    waterMask: waterMaskBuffer,\n    credits: provider._tileCredits,\n  });\n}\n\n/**\n * Requests the geometry for a given tile. The result must include terrain data and\n * may optionally include a water mask and an indication of which child tiles are available.\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @param {Request} [request] The request object. Intended for internal use only.\n *\n * @returns {Promise<TerrainData>|undefined} A promise for the requested geometry.  If this method\n *          returns undefined instead of a promise, it is an indication that too many requests are already\n *          pending and the request will be retried later.\n *\n */\nCesiumTerrainProvider.prototype.requestTileGeometry = function (\n  x,\n  y,\n  level,\n  request\n) {\n  const layers = this._layers;\n  let layerToUse;\n  const layerCount = layers.length;\n  let unknownAvailability = false;\n  let availabilityPromise = Promise.resolve();\n\n  if (layerCount === 1) {\n    // Optimized path for single layers\n    layerToUse = layers[0];\n  } else {\n    for (let i = 0; i < layerCount; ++i) {\n      const layer = layers[i];\n      if (\n        !defined(layer.availability) ||\n        layer.availability.isTileAvailable(level, x, y)\n      ) {\n        layerToUse = layer;\n        break;\n      }\n\n      const availabilityUnloaded = checkLayer(\n        this,\n        x,\n        y,\n        level,\n        layer,\n        i === 0\n      );\n      if (availabilityUnloaded.result) {\n        // We can't know yet since the availability is not yet loaded\n        unknownAvailability = true;\n        availabilityPromise = availabilityPromise.then(\n          () => availabilityUnloaded.promise\n        );\n      }\n    }\n  }\n\n  if (!defined(layerToUse) && unknownAvailability) {\n    // Try again when availability data is ready\u2013 Otherwise the tile will be marked as failed and never re-requested\n    return availabilityPromise.then(() => {\n      // handle promise or undefined return\n      return new Promise((resolve) => {\n        // defer execution to the next event loop\n        setTimeout(() => {\n          const promise = this.requestTileGeometry(x, y, level, request);\n          resolve(promise);\n        }, 0); // next tick\n      });\n    });\n  }\n  // call overridden function below\n  return requestTileGeometry(this, x, y, level, layerToUse, request);\n};\n\nfunction requestTileGeometry(provider, x, y, level, layerToUse, request) {\n  if (!defined(layerToUse)) {\n    return Promise.reject(new RuntimeError(\"Terrain tile doesn't exist\"));\n  }\n\n  const urlTemplates = layerToUse.tileUrlTemplates;\n  if (urlTemplates.length === 0) {\n    return undefined;\n  }\n\n  // The TileMapService scheme counts from the bottom left\n  let terrainY;\n  if (!provider._scheme || provider._scheme === \"tms\") {\n    const yTiles = provider._tilingScheme.getNumberOfYTilesAtLevel(level);\n    terrainY = yTiles - y - 1;\n  } else {\n    terrainY = y;\n  }\n\n  const extensionList = [];\n  if (provider._requestVertexNormals && layerToUse.hasVertexNormals) {\n    extensionList.push(\n      layerToUse.littleEndianExtensionSize\n        ? \"octvertexnormals\"\n        : \"vertexnormals\"\n    );\n  }\n  if (provider._requestWaterMask && layerToUse.hasWaterMask) {\n    extensionList.push(\"watermask\");\n  }\n  if (provider._requestMetadata && layerToUse.hasMetadata) {\n    extensionList.push(\"metadata\");\n  }\n\n  let headers;\n  let query;\n  const url = urlTemplates[(x + terrainY + level) % urlTemplates.length];\n\n  const resource = layerToUse.resource;\n  if (\n    defined(resource._ionEndpoint) &&\n    !defined(resource._ionEndpoint.externalType)\n  ) {\n    // ion uses query parameters to request extensions\n    if (extensionList.length !== 0) {\n      query = { extensions: extensionList.join(\"-\") };\n    }\n    headers = getRequestHeader(undefined);\n  } else {\n    //All other terrain servers\n    headers = getRequestHeader(extensionList);\n  }\n\n  const promise = resource\n    .getDerivedResource({\n      url: url,\n      templateValues: {\n        version: layerToUse.version,\n        z: level,\n        x: x,\n        y: terrainY,\n      },\n      queryParameters: query,\n      headers: headers,\n      request: request,\n    })\n    .fetchArrayBuffer();\n\n  if (!defined(promise)) {\n    return undefined;\n  }\n\n  return promise.then(function (buffer) {\n    if (!defined(buffer)) {\n      return Promise.reject(new RuntimeError(\"Mesh buffer doesn't exist.\"));\n    }\n    if (defined(provider._heightmapStructure)) {\n      return createHeightmapTerrainData(provider, buffer, level, x, y);\n    }\n    return createQuantizedMeshTerrainData(\n      provider,\n      buffer,\n      level,\n      x,\n      y,\n      layerToUse\n    );\n  });\n}\n\nObject.defineProperties(CesiumTerrainProvider.prototype, {\n  /**\n   * Gets an event that is raised when the terrain provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof CesiumTerrainProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this terrain provider is active.  Typically this is used to credit\n   * the source of the terrain.\n   * @memberof CesiumTerrainProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof CesiumTerrainProvider.prototype\n   * @type {GeographicTilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the provider includes a water mask.  The water mask\n   * indicates which areas of the globe are water rather than land, so they can be rendered\n   * as a reflective surface with animated waves.\n   * @memberof CesiumTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasWaterMask: {\n    get: function () {\n      return this._hasWaterMask && this._requestWaterMask;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the requested tiles include vertex normals.\n   * @memberof CesiumTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasVertexNormals: {\n    get: function () {\n      // returns true if we can request vertex normals from the server\n      return this._hasVertexNormals && this._requestVertexNormals;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the requested tiles include metadata.\n   * @memberof CesiumTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasMetadata: {\n    get: function () {\n      // returns true if we can request metadata from the server\n      return this._hasMetadata && this._requestMetadata;\n    },\n  },\n\n  /**\n   * Boolean flag that indicates if the client should request vertex normals from the server.\n   * Vertex normals data is appended to the standard tile mesh data only if the client requests the vertex normals and\n   * if the server provides vertex normals.\n   * @memberof CesiumTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  requestVertexNormals: {\n    get: function () {\n      return this._requestVertexNormals;\n    },\n  },\n\n  /**\n   * Boolean flag that indicates if the client should request a watermask from the server.\n   * Watermask data is appended to the standard tile mesh data only if the client requests the watermask and\n   * if the server provides a watermask.\n   * @memberof CesiumTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  requestWaterMask: {\n    get: function () {\n      return this._requestWaterMask;\n    },\n  },\n\n  /**\n   * Boolean flag that indicates if the client should request metadata from the server.\n   * Metadata is appended to the standard tile mesh data only if the client requests the metadata and\n   * if the server provides a metadata.\n   * @memberof CesiumTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  requestMetadata: {\n    get: function () {\n      return this._requestMetadata;\n    },\n  },\n\n  /**\n   * Gets an object that can be used to determine availability of terrain from this provider, such as\n   * at points and in rectangles. This property may be undefined if availability\n   * information is not available. Note that this reflects tiles that are known to be available currently.\n   * Additional tiles may be discovered to be available in the future, e.g. if availability information\n   * exists deeper in the tree rather than it all being discoverable at the root. However, a tile that\n   * is available now will not become unavailable in the future.\n   * @memberof CesiumTerrainProvider.prototype\n   * @type {TileAvailability}\n   * @readonly\n   */\n  availability: {\n    get: function () {\n      return this._availability;\n    },\n  },\n});\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level.\n *\n * @param {number} level The tile level for which to get the maximum geometric error.\n * @returns {number} The maximum geometric error.\n */\nCesiumTerrainProvider.prototype.getLevelMaximumGeometricError = function (\n  level\n) {\n  return this._levelZeroMaximumGeometricError / (1 << level);\n};\n\n/**\n * Creates a {@link TerrainProvider} from a Cesium ion asset ID that accesses terrain data in a Cesium terrain format\n * Terrain formats can be one of the following:\n * <ul>\n * <li> {@link https://github.com/AnalyticalGraphicsInc/quantized-mesh Quantized Mesh} </li>\n * <li> {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/heightmap-1.0 Height Map} </li>\n * </ul>\n *\n * @param {number} assetId The Cesium ion asset id.\n * @param {CesiumTerrainProvider.ConstructorOptions} [options] An object describing initialization options.\n * @returns {Promise<CesiumTerrainProvider>}\n *\n * @example\n * // Create Arctic DEM terrain with normals.\n * try {\n *   const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n *     terrainProvider: await Cesium.CesiumTerrainProvider.fromIonAssetId(3956, {\n *         requestVertexNormals: true\n *     })\n *   });\n * } catch (error) {\n *   console.log(error);\n * }\n *\n * @exception {RuntimeError} layer.json does not specify a format\n * @exception {RuntimeError} layer.json specifies an unknown format\n * @exception {RuntimeError} layer.json specifies an unsupported quantized-mesh version\n * @exception {RuntimeError} layer.json does not specify a tiles property, or specifies an empty array\n * @exception {RuntimeError} layer.json does not specify any tile URL templates\n */\nCesiumTerrainProvider.fromIonAssetId = async function (assetId, options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"assetId\", assetId);\n  //>>includeEnd('debug');\n\n  const resource = await IonResource.fromAssetId(assetId);\n  return CesiumTerrainProvider.fromUrl(resource, options);\n};\n\n/**\n * Creates a {@link TerrainProvider} that accesses terrain data in a Cesium terrain format.\n * Terrain formats can be one of the following:\n * <ul>\n * <li> {@link https://github.com/AnalyticalGraphicsInc/quantized-mesh Quantized Mesh} </li>\n * <li> {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/heightmap-1.0 Height Map} </li>\n * </ul>\n *\n * @param {Resource|String|Promise<Resource>|Promise<String>} url The URL of the Cesium terrain server.\n * @param {CesiumTerrainProvider.ConstructorOptions} [options] An object describing initialization options.\n * @returns {Promise<CesiumTerrainProvider>}\n *\n * @example\n * // Create Arctic DEM terrain with normals.\n * try {\n *   const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n *     terrainProvider: await Cesium.CesiumTerrainProvider.fromUrl(\n *       Cesium.IonResource.fromAssetId(3956), {\n *         requestVertexNormals: true\n *     })\n *   });\n * } catch (error) {\n *   console.log(error);\n * }\n *\n * @exception {RuntimeError} layer.json does not specify a format\n * @exception {RuntimeError} layer.json specifies an unknown format\n * @exception {RuntimeError} layer.json specifies an unsupported quantized-mesh version\n * @exception {RuntimeError} layer.json does not specify a tiles property, or specifies an empty array\n * @exception {RuntimeError} layer.json does not specify any tile URL templates\n */\nCesiumTerrainProvider.fromUrl = async function (url, options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"url\", url);\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  url = await Promise.resolve(url);\n  const resource = Resource.createIfNeeded(url);\n  resource.appendForwardSlash();\n\n  const terrainProviderBuilder = new TerrainProviderBuilder(options);\n  terrainProviderBuilder.lastResource = resource;\n  terrainProviderBuilder.layerJsonResource = terrainProviderBuilder.lastResource.getDerivedResource(\n    {\n      url: \"layer.json\",\n    }\n  );\n\n  await requestLayerJson(terrainProviderBuilder);\n\n  const provider = new CesiumTerrainProvider(options);\n  terrainProviderBuilder.build(provider);\n\n  return provider;\n};\n\n/**\n * Determines whether data for a tile is available to be loaded.\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @returns {boolean|undefined} Undefined if not supported or availability is unknown, otherwise true or false.\n */\nCesiumTerrainProvider.prototype.getTileDataAvailable = function (x, y, level) {\n  if (!defined(this._availability)) {\n    return undefined;\n  }\n  if (level > this._availability._maximumLevel) {\n    return false;\n  }\n\n  if (this._availability.isTileAvailable(level, x, y)) {\n    // If the tile is listed as available, then we are done\n    return true;\n  }\n  if (!this._hasMetadata) {\n    // If we don't have any layers with the metadata extension then we don't have this tile\n    return false;\n  }\n\n  const layers = this._layers;\n  const count = layers.length;\n  for (let i = 0; i < count; ++i) {\n    const layerResult = checkLayer(this, x, y, level, layers[i], i === 0);\n    if (layerResult.result) {\n      // There is a layer that may or may not have the tile\n      return undefined;\n    }\n  }\n\n  return false;\n};\n\n/**\n * Makes sure we load availability data for a tile\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @returns {undefined|Promise<void>} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded\n */\nCesiumTerrainProvider.prototype.loadTileDataAvailability = function (\n  x,\n  y,\n  level\n) {\n  if (\n    !defined(this._availability) ||\n    level > this._availability._maximumLevel ||\n    this._availability.isTileAvailable(level, x, y) ||\n    !this._hasMetadata\n  ) {\n    // We know the tile is either available or not available so nothing to wait on\n    return undefined;\n  }\n\n  const layers = this._layers;\n  const count = layers.length;\n  for (let i = 0; i < count; ++i) {\n    const layerResult = checkLayer(this, x, y, level, layers[i], i === 0);\n    if (defined(layerResult.promise)) {\n      return layerResult.promise;\n    }\n  }\n};\n\nfunction getAvailabilityTile(layer, x, y, level) {\n  if (level === 0) {\n    return;\n  }\n\n  const availabilityLevels = layer.availabilityLevels;\n  const parentLevel =\n    level % availabilityLevels === 0\n      ? level - availabilityLevels\n      : ((level / availabilityLevels) | 0) * availabilityLevels;\n  const divisor = 1 << (level - parentLevel);\n  const parentX = (x / divisor) | 0;\n  const parentY = (y / divisor) | 0;\n\n  return {\n    level: parentLevel,\n    x: parentX,\n    y: parentY,\n  };\n}\n\nfunction checkLayer(provider, x, y, level, layer, topLayer) {\n  if (!defined(layer.availabilityLevels)) {\n    // It's definitely not in this layer\n    return {\n      result: false,\n    };\n  }\n\n  let cacheKey;\n  const deleteFromCache = function () {\n    delete layer.availabilityPromiseCache[cacheKey];\n  };\n  const availabilityTilesLoaded = layer.availabilityTilesLoaded;\n  const availability = layer.availability;\n\n  let tile = getAvailabilityTile(layer, x, y, level);\n  while (defined(tile)) {\n    if (\n      availability.isTileAvailable(tile.level, tile.x, tile.y) &&\n      !availabilityTilesLoaded.isTileAvailable(tile.level, tile.x, tile.y)\n    ) {\n      let requestPromise;\n      if (!topLayer) {\n        cacheKey = `${tile.level}-${tile.x}-${tile.y}`;\n        requestPromise = layer.availabilityPromiseCache[cacheKey];\n        if (!defined(requestPromise)) {\n          // For cutout terrain, if this isn't the top layer the availability tiles\n          //  may never get loaded, so request it here.\n          const request = new Request({\n            throttle: false,\n            throttleByServer: true,\n            type: RequestType.TERRAIN,\n          });\n          requestPromise = requestTileGeometry(\n            provider,\n            tile.x,\n            tile.y,\n            tile.level,\n            layer,\n            request\n          );\n          if (defined(requestPromise)) {\n            layer.availabilityPromiseCache[cacheKey] = requestPromise;\n            requestPromise.then(deleteFromCache);\n          }\n        }\n      }\n\n      // The availability tile is available, but not loaded, so there\n      //  is still a chance that it may become available at some point\n      return {\n        result: true,\n        promise: requestPromise,\n      };\n    }\n\n    tile = getAvailabilityTile(layer, tile.x, tile.y, tile.level);\n  }\n\n  return {\n    result: false,\n  };\n}\n\n// Used for testing\nCesiumTerrainProvider._getAvailabilityTile = getAvailabilityTile;\nexport default CesiumTerrainProvider;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport EllipseGeometry from \"./EllipseGeometry.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\n/**\n * A description of a circle on the ellipsoid. Circle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\n *\n * @alias CircleGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3} options.center The circle's center point in the fixed frame.\n * @param {number} options.radius The radius in meters.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the circle will be on.\n * @param {number} [options.height=0.0] The distance in meters between the circle and the ellipsoid surface.\n * @param {number} [options.granularity=0.02] The angular distance between points on the circle in radians.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {number} [options.extrudedHeight=0.0] The distance in meters between the circle's extruded face and the ellipsoid surface.\n * @param {number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\n *\n * @exception {DeveloperError} radius must be greater than zero.\n * @exception {DeveloperError} granularity must be greater than zero.\n *\n * @see CircleGeometry.createGeometry\n * @see Packable\n *\n * @example\n * // Create a circle.\n * const circle = new Cesium.CircleGeometry({\n *   center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),\n *   radius : 100000.0\n * });\n * const geometry = Cesium.CircleGeometry.createGeometry(circle);\n */\nfunction CircleGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const radius = options.radius;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"radius\", radius);\n  //>>includeEnd('debug');\n\n  const ellipseGeometryOptions = {\n    center: options.center,\n    semiMajorAxis: radius,\n    semiMinorAxis: radius,\n    ellipsoid: options.ellipsoid,\n    height: options.height,\n    extrudedHeight: options.extrudedHeight,\n    granularity: options.granularity,\n    vertexFormat: options.vertexFormat,\n    stRotation: options.stRotation,\n    shadowVolume: options.shadowVolume,\n  };\n  this._ellipseGeometry = new EllipseGeometry(ellipseGeometryOptions);\n  this._workerName = \"createCircleGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nCircleGeometry.packedLength = EllipseGeometry.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CircleGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nCircleGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  //>>includeEnd('debug');\n  return EllipseGeometry.pack(value._ellipseGeometry, array, startingIndex);\n};\n\nconst scratchEllipseGeometry = new EllipseGeometry({\n  center: new Cartesian3(),\n  semiMajorAxis: 1.0,\n  semiMinorAxis: 1.0,\n});\nconst scratchOptions = {\n  center: new Cartesian3(),\n  radius: undefined,\n  ellipsoid: Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),\n  height: undefined,\n  extrudedHeight: undefined,\n  granularity: undefined,\n  vertexFormat: new VertexFormat(),\n  stRotation: undefined,\n  semiMajorAxis: undefined,\n  semiMinorAxis: undefined,\n  shadowVolume: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CircleGeometry} [result] The object into which to store the result.\n * @returns {CircleGeometry} The modified result parameter or a new CircleGeometry instance if one was not provided.\n */\nCircleGeometry.unpack = function (array, startingIndex, result) {\n  const ellipseGeometry = EllipseGeometry.unpack(\n    array,\n    startingIndex,\n    scratchEllipseGeometry\n  );\n  scratchOptions.center = Cartesian3.clone(\n    ellipseGeometry._center,\n    scratchOptions.center\n  );\n  scratchOptions.ellipsoid = Ellipsoid.clone(\n    ellipseGeometry._ellipsoid,\n    scratchOptions.ellipsoid\n  );\n  scratchOptions.height = ellipseGeometry._height;\n  scratchOptions.extrudedHeight = ellipseGeometry._extrudedHeight;\n  scratchOptions.granularity = ellipseGeometry._granularity;\n  scratchOptions.vertexFormat = VertexFormat.clone(\n    ellipseGeometry._vertexFormat,\n    scratchOptions.vertexFormat\n  );\n  scratchOptions.stRotation = ellipseGeometry._stRotation;\n  scratchOptions.shadowVolume = ellipseGeometry._shadowVolume;\n\n  if (!defined(result)) {\n    scratchOptions.radius = ellipseGeometry._semiMajorAxis;\n    return new CircleGeometry(scratchOptions);\n  }\n\n  scratchOptions.semiMajorAxis = ellipseGeometry._semiMajorAxis;\n  scratchOptions.semiMinorAxis = ellipseGeometry._semiMinorAxis;\n  result._ellipseGeometry = new EllipseGeometry(scratchOptions);\n  return result;\n};\n\n/**\n * Computes the geometric representation of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.\n *\n * @param {CircleGeometry} circleGeometry A description of the circle.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCircleGeometry.createGeometry = function (circleGeometry) {\n  return EllipseGeometry.createGeometry(circleGeometry._ellipseGeometry);\n};\n\n/**\n * @private\n */\nCircleGeometry.createShadowVolume = function (\n  circleGeometry,\n  minHeightFunc,\n  maxHeightFunc\n) {\n  const granularity = circleGeometry._ellipseGeometry._granularity;\n  const ellipsoid = circleGeometry._ellipseGeometry._ellipsoid;\n\n  const minHeight = minHeightFunc(granularity, ellipsoid);\n  const maxHeight = maxHeightFunc(granularity, ellipsoid);\n\n  return new CircleGeometry({\n    center: circleGeometry._ellipseGeometry._center,\n    radius: circleGeometry._ellipseGeometry._semiMajorAxis,\n    ellipsoid: ellipsoid,\n    stRotation: circleGeometry._ellipseGeometry._stRotation,\n    granularity: granularity,\n    extrudedHeight: minHeight,\n    height: maxHeight,\n    vertexFormat: VertexFormat.POSITION_ONLY,\n    shadowVolume: true,\n  });\n};\n\nObject.defineProperties(CircleGeometry.prototype, {\n  /**\n   * @private\n   */\n  rectangle: {\n    get: function () {\n      return this._ellipseGeometry.rectangle;\n    },\n  },\n  /**\n   * For remapping texture coordinates when rendering CircleGeometries as GroundPrimitives.\n   * @private\n   */\n  textureCoordinateRotationPoints: {\n    get: function () {\n      return this._ellipseGeometry.textureCoordinateRotationPoints;\n    },\n  },\n});\nexport default CircleGeometry;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport EllipseOutlineGeometry from \"./EllipseOutlineGeometry.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\n\n/**\n * A description of the outline of a circle on the ellipsoid.\n *\n * @alias CircleOutlineGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3} options.center The circle's center point in the fixed frame.\n * @param {number} options.radius The radius in meters.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the circle will be on.\n * @param {number} [options.height=0.0] The distance in meters between the circle and the ellipsoid surface.\n * @param {number} [options.granularity=0.02] The angular distance between points on the circle in radians.\n * @param {number} [options.extrudedHeight=0.0] The distance in meters between the circle's extruded face and the ellipsoid surface.\n * @param {number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom of an extruded circle.\n *\n * @exception {DeveloperError} radius must be greater than zero.\n * @exception {DeveloperError} granularity must be greater than zero.\n *\n * @see CircleOutlineGeometry.createGeometry\n * @see Packable\n *\n * @example\n * // Create a circle.\n * const circle = new Cesium.CircleOutlineGeometry({\n *   center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),\n *   radius : 100000.0\n * });\n * const geometry = Cesium.CircleOutlineGeometry.createGeometry(circle);\n */\nfunction CircleOutlineGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const radius = options.radius;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"radius\", radius);\n  //>>includeEnd('debug');\n\n  const ellipseGeometryOptions = {\n    center: options.center,\n    semiMajorAxis: radius,\n    semiMinorAxis: radius,\n    ellipsoid: options.ellipsoid,\n    height: options.height,\n    extrudedHeight: options.extrudedHeight,\n    granularity: options.granularity,\n    numberOfVerticalLines: options.numberOfVerticalLines,\n  };\n  this._ellipseGeometry = new EllipseOutlineGeometry(ellipseGeometryOptions);\n  this._workerName = \"createCircleOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nCircleOutlineGeometry.packedLength = EllipseOutlineGeometry.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CircleOutlineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nCircleOutlineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  //>>includeEnd('debug');\n  return EllipseOutlineGeometry.pack(\n    value._ellipseGeometry,\n    array,\n    startingIndex\n  );\n};\n\nconst scratchEllipseGeometry = new EllipseOutlineGeometry({\n  center: new Cartesian3(),\n  semiMajorAxis: 1.0,\n  semiMinorAxis: 1.0,\n});\nconst scratchOptions = {\n  center: new Cartesian3(),\n  radius: undefined,\n  ellipsoid: Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),\n  height: undefined,\n  extrudedHeight: undefined,\n  granularity: undefined,\n  numberOfVerticalLines: undefined,\n  semiMajorAxis: undefined,\n  semiMinorAxis: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CircleOutlineGeometry} [result] The object into which to store the result.\n * @returns {CircleOutlineGeometry} The modified result parameter or a new CircleOutlineGeometry instance if one was not provided.\n */\nCircleOutlineGeometry.unpack = function (array, startingIndex, result) {\n  const ellipseGeometry = EllipseOutlineGeometry.unpack(\n    array,\n    startingIndex,\n    scratchEllipseGeometry\n  );\n  scratchOptions.center = Cartesian3.clone(\n    ellipseGeometry._center,\n    scratchOptions.center\n  );\n  scratchOptions.ellipsoid = Ellipsoid.clone(\n    ellipseGeometry._ellipsoid,\n    scratchOptions.ellipsoid\n  );\n  scratchOptions.height = ellipseGeometry._height;\n  scratchOptions.extrudedHeight = ellipseGeometry._extrudedHeight;\n  scratchOptions.granularity = ellipseGeometry._granularity;\n  scratchOptions.numberOfVerticalLines = ellipseGeometry._numberOfVerticalLines;\n\n  if (!defined(result)) {\n    scratchOptions.radius = ellipseGeometry._semiMajorAxis;\n    return new CircleOutlineGeometry(scratchOptions);\n  }\n\n  scratchOptions.semiMajorAxis = ellipseGeometry._semiMajorAxis;\n  scratchOptions.semiMinorAxis = ellipseGeometry._semiMinorAxis;\n  result._ellipseGeometry = new EllipseOutlineGeometry(scratchOptions);\n  return result;\n};\n\n/**\n * Computes the geometric representation of an outline of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.\n *\n * @param {CircleOutlineGeometry} circleGeometry A description of the circle.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCircleOutlineGeometry.createGeometry = function (circleGeometry) {\n  return EllipseOutlineGeometry.createGeometry(circleGeometry._ellipseGeometry);\n};\nexport default CircleOutlineGeometry;\n", "import Check from \"./Check.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Event from \"./Event.js\";\nimport GeographicTilingScheme from \"./GeographicTilingScheme.js\";\nimport HeightmapTerrainData from \"./HeightmapTerrainData.js\";\nimport TerrainProvider from \"./TerrainProvider.js\";\n\n/**\n * @callback CustomHeightmapTerrainProvider.GeometryCallback\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @returns {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|number[]|Promise<Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|number[]>|undefined} An array or a promise to an array of heights in row-major order. If undefined, the globe will render the parent tile.\n */\n\n/**\n * A simple {@link TerrainProvider} that gets height values from a callback function.\n * It can be used for procedurally generated terrain or as a way to load custom\n * heightmap data without creating a subclass of {@link TerrainProvider}.\n *\n * There are some limitations such as no water mask, no vertex normals, and no\n * availability, so a full-fledged {@link TerrainProvider} subclass is better suited\n * for these more sophisticated use cases.\n *\n * @alias CustomHeightmapTerrainProvider\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {CustomHeightmapTerrainProvider.GeometryCallback} options.callback The callback function for requesting tile geometry.\n * @param {number} options.width The number of columns per heightmap tile.\n * @param {number} options.height The number of rows per heightmap tile.\n * @param {TilingScheme} [options.tilingScheme] The tiling scheme specifying how the ellipsoidal\n * surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme}\n * is used.\n * @param {Ellipsoid} [options.ellipsoid] The ellipsoid.  If the tilingScheme is specified,\n * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n * parameter is specified, the WGS84 ellipsoid is used.\n * @param {Credit|string} [options.credit] A credit for the data source, which is displayed on the canvas.\n *\n * @example\n * const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n *   terrainProvider: new Cesium.CustomHeightmapTerrainProvider({\n *     width: 32,\n *     height: 32,\n *     callback: function (x, y, level) {\n *       return new Float32Array(32 * 32); // all zeros\n *     },\n *   }),\n * });\n *\n * @see TerrainProvider\n */\nfunction CustomHeightmapTerrainProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"options.callback\", options.callback);\n  Check.defined(\"options.width\", options.width);\n  Check.defined(\"options.height\", options.height);\n  //>>includeEnd('debug');\n\n  this._callback = options.callback;\n\n  this._tilingScheme = options.tilingScheme;\n  if (!defined(this._tilingScheme)) {\n    this._tilingScheme = new GeographicTilingScheme({\n      ellipsoid: defaultValue(options.ellipsoid, Ellipsoid.WGS84),\n    });\n  }\n\n  this._width = options.width;\n  this._height = options.height;\n  const maxTileDimensions = Math.max(this._width, this._height);\n\n  this._levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(\n    this._tilingScheme.ellipsoid,\n    maxTileDimensions,\n    this._tilingScheme.getNumberOfXTilesAtLevel(0)\n  );\n\n  this._errorEvent = new Event();\n\n  let credit = options.credit;\n  if (typeof credit === \"string\") {\n    credit = new Credit(credit);\n  }\n  this._credit = credit;\n}\n\nObject.defineProperties(CustomHeightmapTerrainProvider.prototype, {\n  /**\n   * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof CustomHeightmapTerrainProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this terrain provider is active. Typically this is used to credit\n   * the source of the terrain.\n   * @memberof CustomHeightmapTerrainProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof CustomHeightmapTerrainProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the provider includes a water mask. The water mask\n   * indicates which areas of the globe are water rather than land, so they can be rendered\n   * as a reflective surface with animated waves.\n   * Water mask is not supported by {@link CustomHeightmapTerrainProvider}, so the return\n   * value will always be false.\n   * @memberof CustomHeightmapTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasWaterMask: {\n    get: function () {\n      return false;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the requested tiles include vertex normals.\n   * Vertex normals are not supported by {@link CustomHeightmapTerrainProvider}, so the return\n   * value will always be false.\n   * @memberof CustomHeightmapTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasVertexNormals: {\n    get: function () {\n      return false;\n    },\n  },\n\n  /**\n   * Gets the number of columns per heightmap tile.\n   * @memberof CustomHeightmapTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  width: {\n    get: function () {\n      return this._width;\n    },\n  },\n\n  /**\n   * Gets the number of rows per heightmap tile.\n   * @memberof CustomHeightmapTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  height: {\n    get: function () {\n      return this._height;\n    },\n  },\n});\n\n/**\n * Requests the geometry for a given tile. The result includes terrain\n * data and indicates that all child tiles are available.\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @param {Request} [request] The request object. Intended for internal use only.\n *\n * @returns {Promise<TerrainData>|undefined} A promise for the requested geometry. If this method\n *          returns undefined instead of a promise, it is an indication that too many requests are already\n *          pending and the request will be retried later.\n */\nCustomHeightmapTerrainProvider.prototype.requestTileGeometry = function (\n  x,\n  y,\n  level,\n  request\n) {\n  const promise = this._callback(x, y, level);\n  if (!defined(promise)) {\n    return undefined;\n  }\n\n  const width = this._width;\n  const height = this._height;\n\n  return Promise.resolve(promise).then(function (heightmapData) {\n    let buffer = heightmapData;\n    if (Array.isArray(buffer)) {\n      // HeightmapTerrainData expects a TypedArray, so convert from number[] to Float64Array\n      buffer = new Float64Array(buffer);\n    }\n\n    return new HeightmapTerrainData({\n      buffer: buffer,\n      width: width,\n      height: height,\n    });\n  });\n};\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level.\n *\n * @param {number} level The tile level for which to get the maximum geometric error.\n * @returns {number} The maximum geometric error.\n */\nCustomHeightmapTerrainProvider.prototype.getLevelMaximumGeometricError = function (\n  level\n) {\n  return this._levelZeroMaximumGeometricError / (1 << level);\n};\n\n/**\n * Determines whether data for a tile is available to be loaded.\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @returns {boolean|undefined} Undefined if not supported, otherwise true or false.\n */\nCustomHeightmapTerrainProvider.prototype.getTileDataAvailable = function (\n  x,\n  y,\n  level\n) {\n  return undefined;\n};\n\n/**\n * Makes sure we load availability data for a tile\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @returns {undefined|Promise<void>} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded\n */\nCustomHeightmapTerrainProvider.prototype.loadTileDataAvailability = function (\n  x,\n  y,\n  level\n) {\n  return undefined;\n};\nexport default CustomHeightmapTerrainProvider;\n", "/**\n * A simple proxy that appends the desired resource as the sole query parameter\n * to the given proxy URL.\n *\n * @alias DefaultProxy\n * @constructor\n * @extends {Proxy}\n *\n * @param {string} proxy The proxy URL that will be used to requests all resources.\n */\nfunction DefaultProxy(proxy) {\n  this.proxy = proxy;\n}\n\n/**\n * Get the final URL to use to request a given resource.\n *\n * @param {string} resource The resource to request.\n * @returns {string} proxied resource\n */\nDefaultProxy.prototype.getURL = function (resource) {\n  const prefix = this.proxy.indexOf(\"?\") === -1 ? \"?\" : \"\";\n  return this.proxy + prefix + encodeURIComponent(resource);\n};\n\nexport default DefaultProxy;\n", "import CesiumMath from \"./Math.js\";\nimport Check from \"./Check.js\";\nimport defined from \"./defined.js\";\n\n/**\n * Array-backed min-max heap implementation of a double-ended priority queue.\n * This data structure allows for efficient removal of minimum and maximum elements.\n *\n * @alias DoubleEndedPriorityQueue\n * @constructor\n * @private\n *\n * @param {object} options Object with the following properties:\n * @param {DoubleEndedPriorityQueue.ComparatorCallback} options.comparator The comparator to use for the queue. If comparator(a, b) is less than 0, a is lower priority than b.\n * @param {number} [options.maximumLength] The maximum length of the queue. If an element is inserted when the queue is at full capacity, the minimum element is removed. By default, the size of the queue is unlimited.\n */\nfunction DoubleEndedPriorityQueue(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options\", options);\n  Check.defined(\"options.comparator\", options.comparator);\n  if (defined(options.maximumLength)) {\n    Check.typeOf.number.greaterThanOrEquals(\n      \"options.maximumLength\",\n      options.maximumLength,\n      0\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._comparator = options.comparator;\n  this._maximumLength = options.maximumLength;\n  this._array = defined(options.maximumLength)\n    ? new Array(options.maximumLength)\n    : [];\n  this._length = 0;\n}\n\nObject.defineProperties(DoubleEndedPriorityQueue.prototype, {\n  /**\n   * Gets the number of elements in the queue.\n   *\n   * @memberof DoubleEndedPriorityQueue.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  length: {\n    get: function () {\n      return this._length;\n    },\n  },\n\n  /**\n   * Gets or sets the maximum number of elements in the queue.\n   * If set to a smaller value than the current length of the queue, the lowest priority elements are removed.\n   * If an element is inserted when the queue is at full capacity, the minimum element is removed.\n   * If set to undefined, the size of the queue is unlimited.\n   *\n   * @memberof DoubleEndedPriorityQueue.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  maximumLength: {\n    get: function () {\n      return this._maximumLength;\n    },\n    set: function (value) {\n      if (defined(value)) {\n        //>>includeStart('debug', pragmas.debug);\n        Check.typeOf.number.greaterThanOrEquals(\"maximumLength\", value, 0);\n        //>>includeEnd('debug');\n\n        // Remove elements until the maximum length is met.\n        while (this._length > value) {\n          this.removeMinimum();\n        }\n\n        // The array size is fixed to the maximum length\n        this._array.length = value;\n      }\n      this._maximumLength = value;\n    },\n  },\n\n  /**\n   * Gets the internal array.\n   *\n   * @memberof DoubleEndedPriorityQueue.prototype\n   *\n   * @type {Array}\n   * @readonly\n   */\n  internalArray: {\n    get: function () {\n      return this._array;\n    },\n  },\n\n  /**\n   * The comparator used by the queue.\n   * If comparator(a, b) is less than 0, a is lower priority than b.\n   *\n   * @memberof DoubleEndedPriorityQueue.prototype\n   *\n   * @type {DoubleEndedPriorityQueue.ComparatorCallback}\n   * @readonly\n   */\n  comparator: {\n    get: function () {\n      return this._comparator;\n    },\n  },\n});\n\n/**\n * Clones the double ended priority queue.\n *\n * @returns {DoubleEndedPriorityQueue} The cloned double ended priority queue.\n */\nDoubleEndedPriorityQueue.prototype.clone = function () {\n  const maximumLength = this._maximumLength;\n  const comparator = this._comparator;\n  const array = this._array;\n  const length = this._length;\n\n  const result = new DoubleEndedPriorityQueue({\n    comparator: comparator,\n    maximumLength: maximumLength,\n  });\n\n  result._length = length;\n  for (let i = 0; i < length; i++) {\n    result._array[i] = array[i];\n  }\n\n  return result;\n};\n\n/**\n * Removes all elements from the queue.\n */\nDoubleEndedPriorityQueue.prototype.reset = function () {\n  this._length = 0;\n\n  // Dereference elements\n  const maximumLength = this._maximumLength;\n  if (defined(maximumLength)) {\n    // Dereference all elements but keep the array the same size\n    for (let i = 0; i < maximumLength; i++) {\n      this._array[i] = undefined;\n    }\n  } else {\n    // Dereference all elements by clearing the array\n    this._array.length = 0;\n  }\n};\n\n/**\n * Resort the queue.\n */\nDoubleEndedPriorityQueue.prototype.resort = function () {\n  const length = this._length;\n\n  // Fix the queue from the top-down\n  for (let i = 0; i < length; i++) {\n    pushUp(this, i);\n  }\n};\n\n/**\n * Inserts an element into the queue.\n * If the queue is at full capacity, the minimum element is removed.\n * The new element is returned (and not added) if it is less than or equal priority to the minimum element.\n *\n * @param {*} element\n * @returns {*|undefined} The minimum element if the queue is at full capacity. Returns undefined if there is no maximum length.\n */\nDoubleEndedPriorityQueue.prototype.insert = function (element) {\n  let removedElement;\n\n  const maximumLength = this._maximumLength;\n  if (defined(maximumLength)) {\n    if (maximumLength === 0) {\n      return undefined;\n    } else if (this._length === maximumLength) {\n      // It's faster to access the minimum directly instead of calling the getter\n      // because it avoids the length === 0 check.\n      const minimumElement = this._array[0];\n      if (this._comparator(element, minimumElement) <= 0.0) {\n        // The element that is being inserted is less than or equal to\n        // the minimum element, so don't insert anything and exit early.\n        return element;\n      }\n      removedElement = this.removeMinimum();\n    }\n  }\n\n  const index = this._length;\n  this._array[index] = element;\n  this._length++;\n  pushUp(this, index);\n\n  return removedElement;\n};\n\n/**\n * Removes the minimum element from the queue and returns it.\n * If the queue is empty, the return value is undefined.\n *\n * @returns {*|undefined} The minimum element, or undefined if the queue is empty.\n */\nDoubleEndedPriorityQueue.prototype.removeMinimum = function () {\n  const length = this._length;\n  if (length === 0) {\n    return undefined;\n  }\n\n  this._length--;\n\n  // The minimum element is always the root\n  const minimumElement = this._array[0];\n\n  if (length >= 2) {\n    this._array[0] = this._array[length - 1];\n    pushDown(this, 0);\n  }\n\n  // Dereference removed element\n  this._array[length - 1] = undefined;\n\n  return minimumElement;\n};\n\n/**\n * Removes the maximum element from the queue and returns it.\n * If the queue is empty, the return value is undefined.\n *\n * @returns {*|undefined} The maximum element, or undefined if the queue is empty.\n */\nDoubleEndedPriorityQueue.prototype.removeMaximum = function () {\n  const length = this._length;\n  if (length === 0) {\n    return undefined;\n  }\n\n  this._length--;\n  let maximumElement;\n\n  // If the root has no children, the maximum is the root.\n  // If the root has one child, the maximum is the child.\n  if (length <= 2) {\n    maximumElement = this._array[length - 1];\n  } else {\n    // Otherwise, the maximum is the larger of the root's two children.\n    const maximumElementIndex = greaterThan(this, 1, 2) ? 1 : 2;\n    maximumElement = this._array[maximumElementIndex];\n\n    // Re-balance the heap\n    this._array[maximumElementIndex] = this._array[length - 1];\n    if (length >= 4) {\n      pushDown(this, maximumElementIndex);\n    }\n  }\n\n  // Dereference removed element\n  this._array[length - 1] = undefined;\n\n  return maximumElement;\n};\n\n/**\n * Gets the minimum element in the queue.\n * If the queue is empty, the result is undefined.\n *\n * @returns {*|undefined} element\n */\n\nDoubleEndedPriorityQueue.prototype.getMinimum = function () {\n  const length = this._length;\n  if (length === 0) {\n    return undefined;\n  }\n\n  // The minimum element is always the root\n  return this._array[0];\n};\n\n/**\n * Gets the maximum element in the queue.\n * If the queue is empty, the result is undefined.\n *\n * @returns {*|undefined} element\n */\nDoubleEndedPriorityQueue.prototype.getMaximum = function () {\n  const length = this._length;\n  if (length === 0) {\n    return undefined;\n  }\n\n  // If the root has no children, the maximum is the root.\n  // If the root has one child, the maximum is the child.\n  if (length <= 2) {\n    return this._array[length - 1];\n  }\n\n  // Otherwise, the maximum is the larger of the root's two children.\n  return this._array[greaterThan(this, 1, 2) ? 1 : 2];\n};\n\n// Helper functions\n\nfunction swap(that, indexA, indexB) {\n  const array = that._array;\n  const temp = array[indexA];\n  array[indexA] = array[indexB];\n  array[indexB] = temp;\n}\n\nfunction lessThan(that, indexA, indexB) {\n  return that._comparator(that._array[indexA], that._array[indexB]) < 0.0;\n}\n\nfunction greaterThan(that, indexA, indexB) {\n  return that._comparator(that._array[indexA], that._array[indexB]) > 0.0;\n}\n\nfunction pushUp(that, index) {\n  if (index === 0) {\n    return;\n  }\n  const onMinLevel = Math.floor(CesiumMath.log2(index + 1)) % 2 === 0;\n  const parentIndex = Math.floor((index - 1) / 2);\n  const lessThanParent = lessThan(that, index, parentIndex);\n\n  // Get the element onto the correct level if it's not already\n  if (lessThanParent !== onMinLevel) {\n    swap(that, index, parentIndex);\n    index = parentIndex;\n  }\n\n  // Swap element with grandparent as long as it:\n  // 1) has a grandparent\n  // 2A) is less than the grandparent when on a min level\n  // 2B) is greater than the grandparent when on a max level\n  while (index >= 3) {\n    const grandparentIndex = Math.floor((index - 3) / 4);\n    if (lessThan(that, index, grandparentIndex) !== lessThanParent) {\n      break;\n    }\n    swap(that, index, grandparentIndex);\n    index = grandparentIndex;\n  }\n}\n\nfunction pushDown(that, index) {\n  const length = that._length;\n  const onMinLevel = Math.floor(CesiumMath.log2(index + 1)) % 2 === 0;\n\n  // Loop as long as there is a left child.\n  let leftChildIndex;\n  while ((leftChildIndex = 2 * index + 1) < length) {\n    // Find the minimum (or maximum) child or grandchild\n    let target = leftChildIndex;\n    const rightChildIndex = leftChildIndex + 1;\n    if (rightChildIndex < length) {\n      if (lessThan(that, rightChildIndex, target) === onMinLevel) {\n        target = rightChildIndex;\n      }\n      const grandChildStart = 2 * leftChildIndex + 1;\n      const grandChildCount = Math.max(\n        Math.min(length - grandChildStart, 4),\n        0\n      );\n      for (let i = 0; i < grandChildCount; i++) {\n        const grandChildIndex = grandChildStart + i;\n        if (lessThan(that, grandChildIndex, target) === onMinLevel) {\n          target = grandChildIndex;\n        }\n      }\n    }\n\n    // Swap the element into the correct spot\n    if (lessThan(that, target, index) === onMinLevel) {\n      swap(that, target, index);\n      if (target !== leftChildIndex && target !== rightChildIndex) {\n        const parentOfGrandchildIndex = Math.floor((target - 1) / 2);\n        if (greaterThan(that, target, parentOfGrandchildIndex) === onMinLevel) {\n          swap(that, target, parentOfGrandchildIndex);\n        }\n      }\n    }\n\n    index = target;\n  }\n}\n\n/**\n * The comparator to use for the queue.\n * @callback DoubleEndedPriorityQueue.ComparatorCallback\n * @param {*} a An element in the queue.\n * @param {*} b An element in the queue.\n * @returns {number} If the result of the comparison is less than 0, a is lower priority than b.\n */\nexport default DoubleEndedPriorityQueue;\n", "/**\n * The type of geocoding to be performed by a {@link GeocoderService}.\n * @enum {number}\n * @see Geocoder\n */\nconst GeocodeType = {\n  /**\n   * Perform a search where the input is considered complete.\n   *\n   * @type {number}\n   * @constant\n   */\n  SEARCH: 0,\n\n  /**\n   * Perform an auto-complete using partial input, typically\n   * reserved for providing possible results as a user is typing.\n   *\n   * @type {number}\n   * @constant\n   */\n  AUTOCOMPLETE: 1,\n};\nexport default Object.freeze(GeocodeType);\n", "import Credit from \"./Credit.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * @typedef {object} GeocoderService.Result\n * @property {string} displayName The display name for a location\n * @property {Rectangle|Cartesian3} destination The bounding box for a location\n * @property {object[]} [attributions]\n */\n\n/**\n * Provides geocoding through an external service. This type describes an interface and\n * is not intended to be used.\n * @alias GeocoderService\n * @constructor\n *\n * @see BingMapsGeocoderService\n * @see PeliasGeocoderService\n * @see OpenCageGeocoderService\n */\nfunction GeocoderService() {\n  DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(GeocoderService.prototype, {\n  /**\n   * Gets the credit to display after a geocode is performed. Typically this is used to credit\n   * the geocoder service.\n   * @memberof GeocoderService.prototype\n   * @type {Credit|undefined}\n   * @readonly\n   */\n  credit: {\n    get: DeveloperError.throwInstantiationError,\n  },\n});\n\n/**\n * Parses credits from the geocoder result attributions, if present.\n * @param {GeocoderService.Result} geocoderResult The geocoder result\n * @returns {Credit[]|undefined} A list of credits if present in the result, otherwise undefined\n */\nGeocoderService.getCreditsFromResult = function (geocoderResult) {\n  if (defined(geocoderResult.attributions)) {\n    return geocoderResult.attributions.map(Credit.getIonCredit);\n  }\n\n  return undefined;\n};\n\n/**\n * @function\n *\n * @param {string} query The query to be sent to the geocoder service\n * @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform.\n * @returns {Promise<GeocoderService.Result[]>}\n */\nGeocoderService.prototype.geocode = DeveloperError.throwInstantiationError;\nexport default GeocoderService;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * Base class for all geometry creation utility classes that can be passed to {@link GeometryInstance}\n * for asynchronous geometry creation.\n *\n * @constructor\n * @class\n * @abstract\n */\nfunction GeometryFactory() {\n  DeveloperError.throwInstantiationError();\n}\n\n/**\n * Returns a geometry.\n *\n * @param {GeometryFactory} geometryFactory A description of the circle.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nGeometryFactory.createGeometry = function (geometryFactory) {\n  DeveloperError.throwInstantiationError();\n};\n\nexport default GeometryFactory;\n", "import * as protobuf from \"protobufjs/dist/minimal/protobuf.js\";\nimport buildModuleUrl from \"./buildModuleUrl.js\";\nimport Check from \"./Check.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport GoogleEarthEnterpriseTileInformation from \"./GoogleEarthEnterpriseTileInformation.js\";\nimport isBitSet from \"./isBitSet.js\";\nimport loadAndExecuteScript from \"./loadAndExecuteScript.js\";\nimport CesiumMath from \"./Math.js\";\nimport Request from \"./Request.js\";\nimport Resource from \"./Resource.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TaskProcessor from \"./TaskProcessor.js\";\n\nfunction stringToBuffer(str) {\n  const len = str.length;\n  const buffer = new ArrayBuffer(len);\n  const ui8 = new Uint8Array(buffer);\n  for (let i = 0; i < len; ++i) {\n    ui8[i] = str.charCodeAt(i);\n  }\n\n  return buffer;\n}\n\n// Decodes packet with a key that has been around since the beginning of Google Earth Enterprise\nconst defaultKey = stringToBuffer(\n  \"\\x45\\xf4\\xbd\\x0b\\x79\\xe2\\x6a\\x45\\x22\\x05\\x92\\x2c\\x17\\xcd\\x06\\x71\\xf8\\x49\\x10\\x46\\x67\\x51\\x00\\x42\\x25\\xc6\\xe8\\x61\\x2c\\x66\\x29\\x08\\xc6\\x34\\xdc\\x6a\\x62\\x25\\x79\\x0a\\x77\\x1d\\x6d\\x69\\xd6\\xf0\\x9c\\x6b\\x93\\xa1\\xbd\\x4e\\x75\\xe0\\x41\\x04\\x5b\\xdf\\x40\\x56\\x0c\\xd9\\xbb\\x72\\x9b\\x81\\x7c\\x10\\x33\\x53\\xee\\x4f\\x6c\\xd4\\x71\\x05\\xb0\\x7b\\xc0\\x7f\\x45\\x03\\x56\\x5a\\xad\\x77\\x55\\x65\\x0b\\x33\\x92\\x2a\\xac\\x19\\x6c\\x35\\x14\\xc5\\x1d\\x30\\x73\\xf8\\x33\\x3e\\x6d\\x46\\x38\\x4a\\xb4\\xdd\\xf0\\x2e\\xdd\\x17\\x75\\x16\\xda\\x8c\\x44\\x74\\x22\\x06\\xfa\\x61\\x22\\x0c\\x33\\x22\\x53\\x6f\\xaf\\x39\\x44\\x0b\\x8c\\x0e\\x39\\xd9\\x39\\x13\\x4c\\xb9\\xbf\\x7f\\xab\\x5c\\x8c\\x50\\x5f\\x9f\\x22\\x75\\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\\x22\\x2e\\x15\\x6a\\xdf\\x49\\x00\\xb9\\xa0\\x77\\x55\\xc6\\xef\\x10\\x6a\\xbf\\x7b\\x47\\x4c\\x7f\\x83\\x17\\x05\\xee\\xdc\\xdc\\x46\\x85\\xa9\\xad\\x53\\x07\\x2b\\x53\\x34\\x06\\x07\\xff\\x14\\x94\\x59\\x19\\x02\\xe4\\x38\\xe8\\x31\\x83\\x4e\\xb9\\x58\\x46\\x6b\\xcb\\x2d\\x23\\x86\\x92\\x70\\x00\\x35\\x88\\x22\\xcf\\x31\\xb2\\x26\\x2f\\xe7\\xc3\\x75\\x2d\\x36\\x2c\\x72\\x74\\xb0\\x23\\x47\\xb7\\xd3\\xd1\\x26\\x16\\x85\\x37\\x72\\xe2\\x00\\x8c\\x44\\xcf\\x10\\xda\\x33\\x2d\\x1a\\xde\\x60\\x86\\x69\\x23\\x69\\x2a\\x7c\\xcd\\x4b\\x51\\x0d\\x95\\x54\\x39\\x77\\x2e\\x29\\xea\\x1b\\xa6\\x50\\xa2\\x6a\\x8f\\x6f\\x50\\x99\\x5c\\x3e\\x54\\xfb\\xef\\x50\\x5b\\x0b\\x07\\x45\\x17\\x89\\x6d\\x28\\x13\\x77\\x37\\x1d\\xdb\\x8e\\x1e\\x4a\\x05\\x66\\x4a\\x6f\\x99\\x20\\xe5\\x70\\xe2\\xb9\\x71\\x7e\\x0c\\x6d\\x49\\x04\\x2d\\x7a\\xfe\\x72\\xc7\\xf2\\x59\\x30\\x8f\\xbb\\x02\\x5d\\x73\\xe5\\xc9\\x20\\xea\\x78\\xec\\x20\\x90\\xf0\\x8a\\x7f\\x42\\x17\\x7c\\x47\\x19\\x60\\xb0\\x16\\xbd\\x26\\xb7\\x71\\xb6\\xc7\\x9f\\x0e\\xd1\\x33\\x82\\x3d\\xd3\\xab\\xee\\x63\\x99\\xc8\\x2b\\x53\\xa0\\x44\\x5c\\x71\\x01\\xc6\\xcc\\x44\\x1f\\x32\\x4f\\x3c\\xca\\xc0\\x29\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\x3e\\xe1\\x65\\xc0\\x70\\xa7\\xcf\\x38\\x69\\xaf\\xf0\\x56\\x6c\\x64\\x49\\x9c\\x27\\xad\\x78\\x74\\x4f\\xc2\\x87\\xde\\x56\\x39\\x00\\xda\\x77\\x0b\\xcb\\x2d\\x1b\\x89\\xfb\\x35\\x4f\\x02\\xf5\\x08\\x51\\x13\\x60\\xc1\\x0a\\x5a\\x47\\x4d\\x26\\x1c\\x33\\x30\\x78\\xda\\xc0\\x9c\\x46\\x47\\xe2\\x5b\\x79\\x60\\x49\\x6e\\x37\\x67\\x53\\x0a\\x3e\\xe9\\xec\\x46\\x39\\xb2\\xf1\\x34\\x0d\\xc6\\x84\\x53\\x75\\x6e\\xe1\\x0c\\x59\\xd9\\x1e\\xde\\x29\\x85\\x10\\x7b\\x49\\x49\\xa5\\x77\\x79\\xbe\\x49\\x56\\x2e\\x36\\xe7\\x0b\\x3a\\xbb\\x4f\\x03\\x62\\x7b\\xd2\\x4d\\x31\\x95\\x2f\\xbd\\x38\\x7b\\xa8\\x4f\\x21\\xe1\\xec\\x46\\x70\\x76\\x95\\x7d\\x29\\x22\\x78\\x88\\x0a\\x90\\xdd\\x9d\\x5c\\xda\\xde\\x19\\x51\\xcf\\xf0\\xfc\\x59\\x52\\x65\\x7c\\x33\\x13\\xdf\\xf3\\x48\\xda\\xbb\\x2a\\x75\\xdb\\x60\\xb2\\x02\\x15\\xd4\\xfc\\x19\\xed\\x1b\\xec\\x7f\\x35\\xa8\\xff\\x28\\x31\\x07\\x2d\\x12\\xc8\\xdc\\x88\\x46\\x7c\\x8a\\x5b\\x22\"\n);\n\n/**\n * <div class=\"notice\">\n * To construct GoogleEarthEnterpriseMetadata, call {@link GoogleEarthEnterpriseMetadata.fromUrl}. Do not call the constructor directly.\n * </div>\n *\n * Provides metadata using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider\n *  and GoogleEarthEnterpriseTerrainProvider to share metadata requests.\n *\n * @alias GoogleEarthEnterpriseMetadata\n * @constructor\n *\n * @see GoogleEarthEnterpriseImageryProvider\n * @see GoogleEarthEnterpriseTerrainProvider\n *\n */\nfunction GoogleEarthEnterpriseMetadata(resourceOrUrl) {\n  /**\n   * True if imagery is available.\n   * @type {boolean}\n   * @default true\n   */\n  this.imageryPresent = true;\n\n  /**\n   * True if imagery is sent as a protocol buffer, false if sent as plain images. If undefined we will try both.\n   * @type {boolean}\n   * @default undefined\n   */\n  this.protoImagery = undefined;\n\n  /**\n   * True if terrain is available.\n   * @type {boolean}\n   * @default true\n   */\n  this.terrainPresent = true;\n\n  /**\n   * Exponent used to compute constant to calculate negative height values.\n   * @type {number}\n   * @default 32\n   */\n  this.negativeAltitudeExponentBias = 32;\n\n  /**\n   * Threshold where any numbers smaller are actually negative values. They are multiplied by -2^negativeAltitudeExponentBias.\n   * @type {number}\n   * @default EPSILON12\n   */\n  this.negativeAltitudeThreshold = CesiumMath.EPSILON12;\n\n  /**\n   * Dictionary of provider id to copyright strings.\n   * @type {object}\n   * @default {}\n   */\n  this.providers = {};\n\n  /**\n   * Key used to decode packets\n   * @type {ArrayBuffer}\n   */\n  this.key = undefined;\n\n  this._resource = undefined;\n  this._quadPacketVersion = 1;\n  this._tileInfo = {};\n  this._subtreePromises = {};\n}\n\nObject.defineProperties(GoogleEarthEnterpriseMetadata.prototype, {\n  /**\n   * Gets the name of the Google Earth Enterprise server.\n   * @memberof GoogleEarthEnterpriseMetadata.prototype\n   * @type {string}\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return this._resource.url;\n    },\n  },\n\n  /**\n   * Gets the proxy used for metadata requests.\n   * @memberof GoogleEarthEnterpriseMetadata.prototype\n   * @type {Proxy}\n   * @readonly\n   */\n  proxy: {\n    get: function () {\n      return this._resource.proxy;\n    },\n  },\n\n  /**\n   * Gets the resource used for metadata requests.\n   * @memberof GoogleEarthEnterpriseMetadata.prototype\n   * @type {Resource}\n   * @readonly\n   */\n  resource: {\n    get: function () {\n      return this._resource;\n    },\n  },\n});\n\n/**\n * Creates a metadata object using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider\n * and GoogleEarthEnterpriseTerrainProvider to share metadata requests.\n *\n * @param {Resource|String} resourceOrUrl The url of the Google Earth Enterprise server hosting the imagery.\n *\n * @returns {Promise<GoogleEarthEnterpriseMetadata>} A promise which resolves to the created GoogleEarthEnterpriseMetadata instance/\n */\nGoogleEarthEnterpriseMetadata.fromUrl = async function (resourceOrUrl) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"resourceOrUrl\", resourceOrUrl);\n  //>>includeEnd('debug');\n  let url = resourceOrUrl;\n\n  if (typeof url !== \"string\" && !(url instanceof Resource)) {\n    //>>includeStart('debug', pragmas.debug);\n    Check.typeOf.string(\"resourceOrUrl.url\", resourceOrUrl.url);\n    //>>includeEnd('debug');\n\n    url = resourceOrUrl.url;\n  }\n\n  const resource = Resource.createIfNeeded(url);\n  resource.appendForwardSlash();\n\n  const metadata = new GoogleEarthEnterpriseMetadata();\n  metadata._resource = resource;\n\n  try {\n    await requestDbRoot(metadata);\n    await metadata.getQuadTreePacket(\"\", metadata._quadPacketVersion);\n  } catch (error) {\n    const message = `An error occurred while accessing ${\n      getMetadataResource(metadata, \"\", 1).url\n    }: ${error}`;\n\n    throw new RuntimeError(message);\n  }\n\n  return metadata;\n};\n\n/**\n * Converts a tiles (x, y, level) position into a quadkey used to request an image\n * from a Google Earth Enterprise server.\n *\n * @param {number} x The tile's x coordinate.\n * @param {number} y The tile's y coordinate.\n * @param {number} level The tile's zoom level.\n *\n * @see GoogleEarthEnterpriseMetadata#quadKeyToTileXY\n */\nGoogleEarthEnterpriseMetadata.tileXYToQuadKey = function (x, y, level) {\n  let quadkey = \"\";\n  for (let i = level; i >= 0; --i) {\n    const bitmask = 1 << i;\n    let digit = 0;\n\n    // Tile Layout\n    // ___ ___\n    //|   |   |\n    //| 3 | 2 |\n    //|-------|\n    //| 0 | 1 |\n    //|___|___|\n    //\n\n    if (!isBitSet(y, bitmask)) {\n      // Top Row\n      digit |= 2;\n      if (!isBitSet(x, bitmask)) {\n        // Right to left\n        digit |= 1;\n      }\n    } else if (isBitSet(x, bitmask)) {\n      // Left to right\n      digit |= 1;\n    }\n\n    quadkey += digit;\n  }\n  return quadkey;\n};\n\n/**\n * Converts a tile's quadkey used to request an image from a Google Earth Enterprise server into the\n * (x, y, level) position.\n *\n * @param {string} quadkey The tile's quad key\n *\n * @see GoogleEarthEnterpriseMetadata#tileXYToQuadKey\n */\nGoogleEarthEnterpriseMetadata.quadKeyToTileXY = function (quadkey) {\n  let x = 0;\n  let y = 0;\n  const level = quadkey.length - 1;\n  for (let i = level; i >= 0; --i) {\n    const bitmask = 1 << i;\n    const digit = +quadkey[level - i];\n\n    if (isBitSet(digit, 2)) {\n      // Top Row\n      if (!isBitSet(digit, 1)) {\n        // // Right to left\n        x |= bitmask;\n      }\n    } else {\n      y |= bitmask;\n      if (isBitSet(digit, 1)) {\n        // Left to right\n        x |= bitmask;\n      }\n    }\n  }\n  return {\n    x: x,\n    y: y,\n    level: level,\n  };\n};\n\nGoogleEarthEnterpriseMetadata.prototype.isValid = function (quadKey) {\n  let info = this.getTileInformationFromQuadKey(quadKey);\n  if (defined(info)) {\n    return info !== null;\n  }\n\n  let valid = true;\n  let q = quadKey;\n  let last;\n  while (q.length > 1) {\n    last = q.substring(q.length - 1);\n    q = q.substring(0, q.length - 1);\n    info = this.getTileInformationFromQuadKey(q);\n    if (defined(info)) {\n      if (!info.hasSubtree() && !info.hasChild(parseInt(last))) {\n        // We have no subtree or child available at some point in this node's ancestry\n        valid = false;\n      }\n\n      break;\n    } else if (info === null) {\n      // Some node in the ancestry was loaded and said there wasn't a subtree\n      valid = false;\n      break;\n    }\n  }\n\n  return valid;\n};\n\nconst taskProcessor = new TaskProcessor(\"decodeGoogleEarthEnterprisePacket\");\n\n/**\n * Retrieves a Google Earth Enterprise quadtree packet.\n *\n * @param {string} [quadKey=''] The quadkey to retrieve the packet for.\n * @param {number} [version=1] The cnode version to be used in the request.\n * @param {Request} [request] The request object. Intended for internal use only.\n *\n * @private\n */\nGoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket = function (\n  quadKey,\n  version,\n  request\n) {\n  version = defaultValue(version, 1);\n  quadKey = defaultValue(quadKey, \"\");\n  const resource = getMetadataResource(this, quadKey, version, request);\n\n  const promise = resource.fetchArrayBuffer();\n\n  if (!defined(promise)) {\n    return undefined; // Throttled\n  }\n\n  const tileInfo = this._tileInfo;\n  const key = this.key;\n  return promise.then(function (metadata) {\n    const decodePromise = taskProcessor.scheduleTask(\n      {\n        buffer: metadata,\n        quadKey: quadKey,\n        type: \"Metadata\",\n        key: key,\n      },\n      [metadata]\n    );\n\n    return decodePromise.then(function (result) {\n      let root;\n      let topLevelKeyLength = -1;\n      if (quadKey !== \"\") {\n        // Root tile has no data except children bits, so put them into the tile info\n        topLevelKeyLength = quadKey.length + 1;\n        const top = result[quadKey];\n        root = tileInfo[quadKey];\n        root._bits |= top._bits;\n\n        delete result[quadKey];\n      }\n\n      // Copy the resulting objects into tileInfo\n      // Make sure we start with shorter quadkeys first, so we know the parents have\n      //  already been processed. Otherwise we can lose ancestorHasTerrain along the way.\n      const keys = Object.keys(result);\n      keys.sort(function (a, b) {\n        return a.length - b.length;\n      });\n      const keysLength = keys.length;\n      for (let i = 0; i < keysLength; ++i) {\n        const key = keys[i];\n        const r = result[key];\n        if (r !== null) {\n          const info = GoogleEarthEnterpriseTileInformation.clone(result[key]);\n          const keyLength = key.length;\n          if (keyLength === topLevelKeyLength) {\n            info.setParent(root);\n          } else if (keyLength > 1) {\n            const parent = tileInfo[key.substring(0, key.length - 1)];\n            info.setParent(parent);\n          }\n          tileInfo[key] = info;\n        } else {\n          tileInfo[key] = null;\n        }\n      }\n    });\n  });\n};\n\n/**\n * Populates the metadata subtree down to the specified tile.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n *\n * @returns {Promise<GoogleEarthEnterpriseTileInformation>} A promise that resolves to the tile info for the requested quad key\n *\n * @private\n */\nGoogleEarthEnterpriseMetadata.prototype.populateSubtree = function (\n  x,\n  y,\n  level,\n  request\n) {\n  const quadkey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);\n  return populateSubtree(this, quadkey, request);\n};\n\nfunction populateSubtree(that, quadKey, request) {\n  const tileInfo = that._tileInfo;\n  let q = quadKey;\n  let t = tileInfo[q];\n  // If we have tileInfo make sure sure it is not a node with a subtree that's not loaded\n  if (defined(t) && (!t.hasSubtree() || t.hasChildren())) {\n    return t;\n  }\n\n  while (t === undefined && q.length > 1) {\n    q = q.substring(0, q.length - 1);\n    t = tileInfo[q];\n  }\n\n  let subtreeRequest;\n  const subtreePromises = that._subtreePromises;\n  let promise = subtreePromises[q];\n  if (defined(promise)) {\n    return promise.then(function () {\n      // Recursively call this in case we need multiple subtree requests\n      subtreeRequest = new Request({\n        throttle: request.throttle,\n        throttleByServer: request.throttleByServer,\n        type: request.type,\n        priorityFunction: request.priorityFunction,\n      });\n      return populateSubtree(that, quadKey, subtreeRequest);\n    });\n  }\n\n  // t is either\n  //   null so one of its parents was a leaf node, so this tile doesn't exist\n  //   exists but doesn't have a subtree to request\n  //   undefined so no parent exists - this shouldn't ever happen once the provider is ready\n  if (!defined(t) || !t.hasSubtree()) {\n    return Promise.reject(\n      new RuntimeError(`Couldn't load metadata for tile ${quadKey}`)\n    );\n  }\n\n  // We need to split up the promise here because when will execute syncronously if getQuadTreePacket\n  //  is already resolved (like in the tests), so subtreePromises will never get cleared out.\n  //  Only the initial request will also remove the promise from subtreePromises.\n  promise = that.getQuadTreePacket(q, t.cnodeVersion, request);\n  if (!defined(promise)) {\n    return undefined;\n  }\n  subtreePromises[q] = promise;\n\n  return promise\n    .then(function () {\n      // Recursively call this in case we need multiple subtree requests\n      subtreeRequest = new Request({\n        throttle: request.throttle,\n        throttleByServer: request.throttleByServer,\n        type: request.type,\n        priorityFunction: request.priorityFunction,\n      });\n      return populateSubtree(that, quadKey, subtreeRequest);\n    })\n    .finally(function () {\n      delete subtreePromises[q];\n    });\n}\n\n/**\n * Gets information about a tile\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @returns {GoogleEarthEnterpriseTileInformation|undefined} Information about the tile or undefined if it isn't loaded.\n *\n * @private\n */\nGoogleEarthEnterpriseMetadata.prototype.getTileInformation = function (\n  x,\n  y,\n  level\n) {\n  const quadkey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);\n  return this._tileInfo[quadkey];\n};\n\n/**\n * Gets information about a tile from a quadKey\n *\n * @param {string} quadkey The quadkey for the tile\n * @returns {GoogleEarthEnterpriseTileInformation|undefined} Information about the tile or undefined if it isn't loaded.\n *\n * @private\n */\nGoogleEarthEnterpriseMetadata.prototype.getTileInformationFromQuadKey = function (\n  quadkey\n) {\n  return this._tileInfo[quadkey];\n};\n\nfunction getMetadataResource(that, quadKey, version, request) {\n  return that._resource.getDerivedResource({\n    url: `flatfile?q2-0${quadKey}-q.${version.toString()}`,\n    request: request,\n  });\n}\n\nlet dbrootParser;\nlet dbrootParserPromise;\nfunction requestDbRoot(that) {\n  const resource = that._resource.getDerivedResource({\n    url: \"dbRoot.v5\",\n    queryParameters: {\n      output: \"proto\",\n    },\n  });\n\n  if (!defined(dbrootParserPromise)) {\n    const url = buildModuleUrl(\"ThirdParty/google-earth-dbroot-parser.js\");\n    const oldValue = window.cesiumGoogleEarthDbRootParser;\n    dbrootParserPromise = loadAndExecuteScript(url).then(function () {\n      dbrootParser = window.cesiumGoogleEarthDbRootParser(protobuf);\n      if (defined(oldValue)) {\n        window.cesiumGoogleEarthDbRootParser = oldValue;\n      } else {\n        delete window.cesiumGoogleEarthDbRootParser;\n      }\n    });\n  }\n\n  return dbrootParserPromise\n    .then(function () {\n      return resource.fetchArrayBuffer();\n    })\n    .then(function (buf) {\n      const encryptedDbRootProto = dbrootParser.EncryptedDbRootProto.decode(\n        new Uint8Array(buf)\n      );\n\n      let byteArray = encryptedDbRootProto.encryptionData;\n      let offset = byteArray.byteOffset;\n      let end = offset + byteArray.byteLength;\n      const key = (that.key = byteArray.buffer.slice(offset, end));\n\n      byteArray = encryptedDbRootProto.dbrootData;\n      offset = byteArray.byteOffset;\n      end = offset + byteArray.byteLength;\n      const dbRootCompressed = byteArray.buffer.slice(offset, end);\n      return taskProcessor.scheduleTask(\n        {\n          buffer: dbRootCompressed,\n          type: \"DbRoot\",\n          key: key,\n        },\n        [dbRootCompressed]\n      );\n    })\n    .then(function (result) {\n      const dbRoot = dbrootParser.DbRootProto.decode(\n        new Uint8Array(result.buffer)\n      );\n      that.imageryPresent = defaultValue(\n        dbRoot.imageryPresent,\n        that.imageryPresent\n      );\n      that.protoImagery = dbRoot.protoImagery;\n      that.terrainPresent = defaultValue(\n        dbRoot.terrainPresent,\n        that.terrainPresent\n      );\n      if (defined(dbRoot.endSnippet) && defined(dbRoot.endSnippet.model)) {\n        const model = dbRoot.endSnippet.model;\n        that.negativeAltitudeExponentBias = defaultValue(\n          model.negativeAltitudeExponentBias,\n          that.negativeAltitudeExponentBias\n        );\n        that.negativeAltitudeThreshold = defaultValue(\n          model.compressedNegativeAltitudeThreshold,\n          that.negativeAltitudeThreshold\n        );\n      }\n      if (defined(dbRoot.databaseVersion)) {\n        that._quadPacketVersion = defaultValue(\n          dbRoot.databaseVersion.quadtreeVersion,\n          that._quadPacketVersion\n        );\n      }\n      const providers = that.providers;\n      const providerInfo = defaultValue(dbRoot.providerInfo, []);\n      const count = providerInfo.length;\n      for (let i = 0; i < count; ++i) {\n        const provider = providerInfo[i];\n        const copyrightString = provider.copyrightString;\n        if (defined(copyrightString)) {\n          providers[provider.providerId] = new Credit(copyrightString.value);\n        }\n      }\n    })\n    .catch(function () {\n      // Just eat the error and use the default values.\n      console.log(`Failed to retrieve ${resource.url}. Using defaults.`);\n      that.key = defaultKey;\n    });\n}\nexport default GoogleEarthEnterpriseMetadata;\n", "/**\n * @private\n */\nfunction isBitSet(bits, mask) {\n  return (bits & mask) !== 0;\n}\nexport default isBitSet;\n", "import defined from \"./defined.js\";\nimport isBitSet from \"./isBitSet.js\";\n\n// Bitmask for checking tile properties\nconst childrenBitmasks = [0x01, 0x02, 0x04, 0x08];\nconst anyChildBitmask = 0x0f;\nconst cacheFlagBitmask = 0x10; // True if there is a child subtree\nconst imageBitmask = 0x40;\nconst terrainBitmask = 0x80;\n\n/**\n * Contains information about each tile from a Google Earth Enterprise server\n *\n * @param {number} bits Bitmask that contains the type of data and available children for each tile.\n * @param {number} cnodeVersion Version of the request for subtree metadata.\n * @param {number} imageryVersion Version of the request for imagery tile.\n * @param {number} terrainVersion Version of the request for terrain tile.\n * @param {number} imageryProvider Id of imagery provider.\n * @param {number} terrainProvider Id of terrain provider.\n *\n * @private\n */\nfunction GoogleEarthEnterpriseTileInformation(\n  bits,\n  cnodeVersion,\n  imageryVersion,\n  terrainVersion,\n  imageryProvider,\n  terrainProvider\n) {\n  this._bits = bits;\n  this.cnodeVersion = cnodeVersion;\n  this.imageryVersion = imageryVersion;\n  this.terrainVersion = terrainVersion;\n  this.imageryProvider = imageryProvider;\n  this.terrainProvider = terrainProvider;\n  this.ancestorHasTerrain = false; // Set it later once we find its parent\n  this.terrainState = undefined;\n}\n\n/**\n * Creates GoogleEarthEnterpriseTileInformation from an object\n *\n * @param {object} info Object to be cloned\n * @param {GoogleEarthEnterpriseTileInformation} [result] The object onto which to store the result.\n * @returns {GoogleEarthEnterpriseTileInformation} The modified result parameter or a new GoogleEarthEnterpriseTileInformation instance if none was provided.\n */\nGoogleEarthEnterpriseTileInformation.clone = function (info, result) {\n  if (!defined(result)) {\n    result = new GoogleEarthEnterpriseTileInformation(\n      info._bits,\n      info.cnodeVersion,\n      info.imageryVersion,\n      info.terrainVersion,\n      info.imageryProvider,\n      info.terrainProvider\n    );\n  } else {\n    result._bits = info._bits;\n    result.cnodeVersion = info.cnodeVersion;\n    result.imageryVersion = info.imageryVersion;\n    result.terrainVersion = info.terrainVersion;\n    result.imageryProvider = info.imageryProvider;\n    result.terrainProvider = info.terrainProvider;\n  }\n  result.ancestorHasTerrain = info.ancestorHasTerrain;\n  result.terrainState = info.terrainState;\n\n  return result;\n};\n\n/**\n * Sets the parent for the tile\n *\n * @param {GoogleEarthEnterpriseTileInformation} parent Parent tile\n */\nGoogleEarthEnterpriseTileInformation.prototype.setParent = function (parent) {\n  this.ancestorHasTerrain = parent.ancestorHasTerrain || this.hasTerrain();\n};\n\n/**\n * Gets whether a subtree is available\n *\n * @returns {boolean} true if subtree is available, false otherwise.\n */\nGoogleEarthEnterpriseTileInformation.prototype.hasSubtree = function () {\n  return isBitSet(this._bits, cacheFlagBitmask);\n};\n\n/**\n * Gets whether imagery is available\n *\n * @returns {boolean} true if imagery is available, false otherwise.\n */\nGoogleEarthEnterpriseTileInformation.prototype.hasImagery = function () {\n  return isBitSet(this._bits, imageBitmask);\n};\n\n/**\n * Gets whether terrain is available\n *\n * @returns {boolean} true if terrain is available, false otherwise.\n */\nGoogleEarthEnterpriseTileInformation.prototype.hasTerrain = function () {\n  return isBitSet(this._bits, terrainBitmask);\n};\n\n/**\n * Gets whether any children are present\n *\n * @returns {boolean} true if any children are available, false otherwise.\n */\nGoogleEarthEnterpriseTileInformation.prototype.hasChildren = function () {\n  return isBitSet(this._bits, anyChildBitmask);\n};\n\n/**\n * Gets whether a specified child is available\n *\n * @param {number} index Index of child tile\n *\n * @returns {boolean} true if child is available, false otherwise\n */\nGoogleEarthEnterpriseTileInformation.prototype.hasChild = function (index) {\n  return isBitSet(this._bits, childrenBitmasks[index]);\n};\n\n/**\n * Gets bitmask containing children\n *\n * @returns {number} Children bitmask\n */\nGoogleEarthEnterpriseTileInformation.prototype.getChildBitmask = function () {\n  return this._bits & anyChildBitmask;\n};\nexport default GoogleEarthEnterpriseTileInformation;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport Intersections2D from \"./Intersections2D.js\";\nimport CesiumMath from \"./Math.js\";\nimport OrientedBoundingBox from \"./OrientedBoundingBox.js\";\nimport QuantizedMeshTerrainData from \"./QuantizedMeshTerrainData.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport TaskProcessor from \"./TaskProcessor.js\";\nimport TerrainData from \"./TerrainData.js\";\nimport TerrainEncoding from \"./TerrainEncoding.js\";\nimport TerrainMesh from \"./TerrainMesh.js\";\n\n/**\n * Terrain data for a single tile from a Google Earth Enterprise server.\n *\n * @alias GoogleEarthEnterpriseTerrainData\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {ArrayBuffer} options.buffer The buffer containing terrain data.\n * @param {number} options.negativeAltitudeExponentBias Multiplier for negative terrain heights that are encoded as very small positive values.\n * @param {number} options.negativeElevationThreshold Threshold for negative values\n * @param {number} [options.childTileMask=15] A bit mask indicating which of this tile's four children exist.\n *                 If a child's bit is set, geometry will be requested for that tile as well when it\n *                 is needed.  If the bit is cleared, the child tile is not requested and geometry is\n *                 instead upsampled from the parent.  The bit values are as follows:\n *                 <table>\n *                  <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>\n *                  <tr><td>0</td><td>1</td><td>Southwest</td></tr>\n *                  <tr><td>1</td><td>2</td><td>Southeast</td></tr>\n *                  <tr><td>2</td><td>4</td><td>Northeast</td></tr>\n *                  <tr><td>3</td><td>8</td><td>Northwest</td></tr>\n *                 </table>\n * @param {boolean} [options.createdByUpsampling=false] True if this instance was created by upsampling another instance;\n *                  otherwise, false.\n * @param {Credit[]} [options.credits] Array of credits for this tile.\n *\n *\n * @example\n * const buffer = ...\n * const childTileMask = ...\n * const terrainData = new Cesium.GoogleEarthEnterpriseTerrainData({\n *   buffer : heightBuffer,\n *   childTileMask : childTileMask\n * });\n *\n * @see TerrainData\n * @see HeightmapTerrainData\n * @see QuantizedMeshTerrainData\n */\nfunction GoogleEarthEnterpriseTerrainData(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.buffer\", options.buffer);\n  Check.typeOf.number(\n    \"options.negativeAltitudeExponentBias\",\n    options.negativeAltitudeExponentBias\n  );\n  Check.typeOf.number(\n    \"options.negativeElevationThreshold\",\n    options.negativeElevationThreshold\n  );\n  //>>includeEnd('debug');\n\n  this._buffer = options.buffer;\n  this._credits = options.credits;\n  this._negativeAltitudeExponentBias = options.negativeAltitudeExponentBias;\n  this._negativeElevationThreshold = options.negativeElevationThreshold;\n\n  // Convert from google layout to layout of other providers\n  // 3 2 -> 2 3\n  // 0 1 -> 0 1\n  const googleChildTileMask = defaultValue(options.childTileMask, 15);\n  let childTileMask = googleChildTileMask & 3; // Bottom row is identical\n  childTileMask |= googleChildTileMask & 4 ? 8 : 0; // NE\n  childTileMask |= googleChildTileMask & 8 ? 4 : 0; // NW\n\n  this._childTileMask = childTileMask;\n\n  this._createdByUpsampling = defaultValue(options.createdByUpsampling, false);\n\n  this._skirtHeight = undefined;\n  this._bufferType = this._buffer.constructor;\n  this._mesh = undefined;\n  this._minimumHeight = undefined;\n  this._maximumHeight = undefined;\n}\n\nObject.defineProperties(GoogleEarthEnterpriseTerrainData.prototype, {\n  /**\n   * An array of credits for this tile\n   * @memberof GoogleEarthEnterpriseTerrainData.prototype\n   * @type {Credit[]}\n   */\n  credits: {\n    get: function () {\n      return this._credits;\n    },\n  },\n  /**\n   * The water mask included in this terrain data, if any.  A water mask is a rectangular\n   * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.\n   * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.\n   * @memberof GoogleEarthEnterpriseTerrainData.prototype\n   * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement}\n   */\n  waterMask: {\n    get: function () {\n      return undefined;\n    },\n  },\n});\n\nconst createMeshTaskName = \"createVerticesFromGoogleEarthEnterpriseBuffer\";\nconst createMeshTaskProcessorNoThrottle = new TaskProcessor(createMeshTaskName);\nconst createMeshTaskProcessorThrottle = new TaskProcessor(\n  createMeshTaskName,\n  TerrainData.maximumAsynchronousTasks\n);\n\nconst nativeRectangleScratch = new Rectangle();\nconst rectangleScratch = new Rectangle();\n\n/**\n * Creates a {@link TerrainMesh} from this terrain data.\n *\n * @private\n *\n * @param {object} options Object with the following properties:\n * @param {TilingScheme} options.tilingScheme The tiling scheme to which this tile belongs.\n * @param {number} options.x The X coordinate of the tile for which to create the terrain data.\n * @param {number} options.y The Y coordinate of the tile for which to create the terrain data.\n * @param {number} options.level The level of the tile for which to create the terrain data.\n * @param {number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.\n * @param {number} [options.exaggerationRelativeHeight=0.0] The height from which terrain is exaggerated.\n * @param {boolean} [options.throttle=true] If true, indicates that this operation will need to be retried if too many asynchronous mesh creations are already in progress.\n * @returns {Promise<TerrainMesh>|undefined} A promise for the terrain mesh, or undefined if too many\n *          asynchronous mesh creations are already in progress and the operation should\n *          be retried later.\n */\nGoogleEarthEnterpriseTerrainData.prototype.createMesh = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.tilingScheme\", options.tilingScheme);\n  Check.typeOf.number(\"options.x\", options.x);\n  Check.typeOf.number(\"options.y\", options.y);\n  Check.typeOf.number(\"options.level\", options.level);\n  //>>includeEnd('debug');\n\n  const tilingScheme = options.tilingScheme;\n  const x = options.x;\n  const y = options.y;\n  const level = options.level;\n  const exaggeration = defaultValue(options.exaggeration, 1.0);\n  const exaggerationRelativeHeight = defaultValue(\n    options.exaggerationRelativeHeight,\n    0.0\n  );\n  const throttle = defaultValue(options.throttle, true);\n\n  const ellipsoid = tilingScheme.ellipsoid;\n  tilingScheme.tileXYToNativeRectangle(x, y, level, nativeRectangleScratch);\n  tilingScheme.tileXYToRectangle(x, y, level, rectangleScratch);\n\n  // Compute the center of the tile for RTC rendering.\n  const center = ellipsoid.cartographicToCartesian(\n    Rectangle.center(rectangleScratch)\n  );\n\n  const levelZeroMaxError = 40075.16; // From Google's Doc\n  const thisLevelMaxError = levelZeroMaxError / (1 << level);\n  this._skirtHeight = Math.min(thisLevelMaxError * 8.0, 1000.0);\n\n  const createMeshTaskProcessor = throttle\n    ? createMeshTaskProcessorThrottle\n    : createMeshTaskProcessorNoThrottle;\n\n  const verticesPromise = createMeshTaskProcessor.scheduleTask({\n    buffer: this._buffer,\n    nativeRectangle: nativeRectangleScratch,\n    rectangle: rectangleScratch,\n    relativeToCenter: center,\n    ellipsoid: ellipsoid,\n    skirtHeight: this._skirtHeight,\n    exaggeration: exaggeration,\n    exaggerationRelativeHeight: exaggerationRelativeHeight,\n    includeWebMercatorT: true,\n    negativeAltitudeExponentBias: this._negativeAltitudeExponentBias,\n    negativeElevationThreshold: this._negativeElevationThreshold,\n  });\n\n  if (!defined(verticesPromise)) {\n    // Postponed\n    return undefined;\n  }\n\n  const that = this;\n  return verticesPromise.then(function (result) {\n    // Clone complex result objects because the transfer from the web worker\n    // has stripped them down to JSON-style objects.\n    that._mesh = new TerrainMesh(\n      center,\n      new Float32Array(result.vertices),\n      new Uint16Array(result.indices),\n      result.indexCountWithoutSkirts,\n      result.vertexCountWithoutSkirts,\n      result.minimumHeight,\n      result.maximumHeight,\n      BoundingSphere.clone(result.boundingSphere3D),\n      Cartesian3.clone(result.occludeePointInScaledSpace),\n      result.numberOfAttributes,\n      OrientedBoundingBox.clone(result.orientedBoundingBox),\n      TerrainEncoding.clone(result.encoding),\n      result.westIndicesSouthToNorth,\n      result.southIndicesEastToWest,\n      result.eastIndicesNorthToSouth,\n      result.northIndicesWestToEast\n    );\n\n    that._minimumHeight = result.minimumHeight;\n    that._maximumHeight = result.maximumHeight;\n\n    // Free memory received from server after mesh is created.\n    that._buffer = undefined;\n    return that._mesh;\n  });\n};\n\n/**\n * Computes the terrain height at a specified longitude and latitude.\n *\n * @param {Rectangle} rectangle The rectangle covered by this terrain data.\n * @param {number} longitude The longitude in radians.\n * @param {number} latitude The latitude in radians.\n * @returns {number} The terrain height at the specified position.  If the position\n *          is outside the rectangle, this method will extrapolate the height, which is likely to be wildly\n *          incorrect for positions far outside the rectangle.\n */\nGoogleEarthEnterpriseTerrainData.prototype.interpolateHeight = function (\n  rectangle,\n  longitude,\n  latitude\n) {\n  const u = CesiumMath.clamp(\n    (longitude - rectangle.west) / rectangle.width,\n    0.0,\n    1.0\n  );\n  const v = CesiumMath.clamp(\n    (latitude - rectangle.south) / rectangle.height,\n    0.0,\n    1.0\n  );\n\n  if (!defined(this._mesh)) {\n    return interpolateHeight(this, u, v, rectangle);\n  }\n\n  return interpolateMeshHeight(this, u, v);\n};\n\nconst upsampleTaskProcessor = new TaskProcessor(\n  \"upsampleQuantizedTerrainMesh\",\n  TerrainData.maximumAsynchronousTasks\n);\n\n/**\n * Upsamples this terrain data for use by a descendant tile.  The resulting instance will contain a subset of the\n * height samples in this instance, interpolated if necessary.\n *\n * @param {TilingScheme} tilingScheme The tiling scheme of this terrain data.\n * @param {number} thisX The X coordinate of this tile in the tiling scheme.\n * @param {number} thisY The Y coordinate of this tile in the tiling scheme.\n * @param {number} thisLevel The level of this tile in the tiling scheme.\n * @param {number} descendantX The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {number} descendantY The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {number} descendantLevel The level within the tiling scheme of the descendant tile for which we are upsampling.\n * @returns {Promise<HeightmapTerrainData>|undefined} A promise for upsampled heightmap terrain data for the descendant tile,\n *          or undefined if too many asynchronous upsample operations are in progress and the request has been\n *          deferred.\n */\nGoogleEarthEnterpriseTerrainData.prototype.upsample = function (\n  tilingScheme,\n  thisX,\n  thisY,\n  thisLevel,\n  descendantX,\n  descendantY,\n  descendantLevel\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"tilingScheme\", tilingScheme);\n  Check.typeOf.number(\"thisX\", thisX);\n  Check.typeOf.number(\"thisY\", thisY);\n  Check.typeOf.number(\"thisLevel\", thisLevel);\n  Check.typeOf.number(\"descendantX\", descendantX);\n  Check.typeOf.number(\"descendantY\", descendantY);\n  Check.typeOf.number(\"descendantLevel\", descendantLevel);\n  const levelDifference = descendantLevel - thisLevel;\n  if (levelDifference > 1) {\n    throw new DeveloperError(\n      \"Upsampling through more than one level at a time is not currently supported.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const mesh = this._mesh;\n  if (!defined(this._mesh)) {\n    return undefined;\n  }\n\n  const isEastChild = thisX * 2 !== descendantX;\n  const isNorthChild = thisY * 2 === descendantY;\n\n  const ellipsoid = tilingScheme.ellipsoid;\n  const childRectangle = tilingScheme.tileXYToRectangle(\n    descendantX,\n    descendantY,\n    descendantLevel\n  );\n\n  const upsamplePromise = upsampleTaskProcessor.scheduleTask({\n    vertices: mesh.vertices,\n    indices: mesh.indices,\n    indexCountWithoutSkirts: mesh.indexCountWithoutSkirts,\n    vertexCountWithoutSkirts: mesh.vertexCountWithoutSkirts,\n    encoding: mesh.encoding,\n    minimumHeight: this._minimumHeight,\n    maximumHeight: this._maximumHeight,\n    isEastChild: isEastChild,\n    isNorthChild: isNorthChild,\n    childRectangle: childRectangle,\n    ellipsoid: ellipsoid,\n  });\n\n  if (!defined(upsamplePromise)) {\n    // Postponed\n    return undefined;\n  }\n\n  const that = this;\n  return upsamplePromise.then(function (result) {\n    const quantizedVertices = new Uint16Array(result.vertices);\n    const indicesTypedArray = IndexDatatype.createTypedArray(\n      quantizedVertices.length / 3,\n      result.indices\n    );\n\n    const skirtHeight = that._skirtHeight;\n\n    // Use QuantizedMeshTerrainData since we have what we need already parsed\n    return new QuantizedMeshTerrainData({\n      quantizedVertices: quantizedVertices,\n      indices: indicesTypedArray,\n      minimumHeight: result.minimumHeight,\n      maximumHeight: result.maximumHeight,\n      boundingSphere: BoundingSphere.clone(result.boundingSphere),\n      orientedBoundingBox: OrientedBoundingBox.clone(\n        result.orientedBoundingBox\n      ),\n      horizonOcclusionPoint: Cartesian3.clone(result.horizonOcclusionPoint),\n      westIndices: result.westIndices,\n      southIndices: result.southIndices,\n      eastIndices: result.eastIndices,\n      northIndices: result.northIndices,\n      westSkirtHeight: skirtHeight,\n      southSkirtHeight: skirtHeight,\n      eastSkirtHeight: skirtHeight,\n      northSkirtHeight: skirtHeight,\n      childTileMask: 0,\n      createdByUpsampling: true,\n      credits: that._credits,\n    });\n  });\n};\n\n/**\n * Determines if a given child tile is available, based on the\n * {@link HeightmapTerrainData.childTileMask}.  The given child tile coordinates are assumed\n * to be one of the four children of this tile.  If non-child tile coordinates are\n * given, the availability of the southeast child tile is returned.\n *\n * @param {number} thisX The tile X coordinate of this (the parent) tile.\n * @param {number} thisY The tile Y coordinate of this (the parent) tile.\n * @param {number} childX The tile X coordinate of the child tile to check for availability.\n * @param {number} childY The tile Y coordinate of the child tile to check for availability.\n * @returns {boolean} True if the child tile is available; otherwise, false.\n */\nGoogleEarthEnterpriseTerrainData.prototype.isChildAvailable = function (\n  thisX,\n  thisY,\n  childX,\n  childY\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"thisX\", thisX);\n  Check.typeOf.number(\"thisY\", thisY);\n  Check.typeOf.number(\"childX\", childX);\n  Check.typeOf.number(\"childY\", childY);\n  //>>includeEnd('debug');\n\n  let bitNumber = 2; // northwest child\n  if (childX !== thisX * 2) {\n    ++bitNumber; // east child\n  }\n  if (childY !== thisY * 2) {\n    bitNumber -= 2; // south child\n  }\n\n  return (this._childTileMask & (1 << bitNumber)) !== 0;\n};\n\n/**\n * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution\n * terrain data.  If this value is false, the data was obtained from some other source, such\n * as by downloading it from a remote server.  This method should return true for instances\n * returned from a call to {@link HeightmapTerrainData#upsample}.\n *\n * @returns {boolean} True if this instance was created by upsampling; otherwise, false.\n */\nGoogleEarthEnterpriseTerrainData.prototype.wasCreatedByUpsampling = function () {\n  return this._createdByUpsampling;\n};\n\nconst texCoordScratch0 = new Cartesian2();\nconst texCoordScratch1 = new Cartesian2();\nconst texCoordScratch2 = new Cartesian2();\nconst barycentricCoordinateScratch = new Cartesian3();\n\nfunction interpolateMeshHeight(terrainData, u, v) {\n  const mesh = terrainData._mesh;\n  const vertices = mesh.vertices;\n  const encoding = mesh.encoding;\n  const indices = mesh.indices;\n\n  for (let i = 0, len = indices.length; i < len; i += 3) {\n    const i0 = indices[i];\n    const i1 = indices[i + 1];\n    const i2 = indices[i + 2];\n\n    const uv0 = encoding.decodeTextureCoordinates(\n      vertices,\n      i0,\n      texCoordScratch0\n    );\n    const uv1 = encoding.decodeTextureCoordinates(\n      vertices,\n      i1,\n      texCoordScratch1\n    );\n    const uv2 = encoding.decodeTextureCoordinates(\n      vertices,\n      i2,\n      texCoordScratch2\n    );\n\n    const barycentric = Intersections2D.computeBarycentricCoordinates(\n      u,\n      v,\n      uv0.x,\n      uv0.y,\n      uv1.x,\n      uv1.y,\n      uv2.x,\n      uv2.y,\n      barycentricCoordinateScratch\n    );\n    if (\n      barycentric.x >= -1e-15 &&\n      barycentric.y >= -1e-15 &&\n      barycentric.z >= -1e-15\n    ) {\n      const h0 = encoding.decodeHeight(vertices, i0);\n      const h1 = encoding.decodeHeight(vertices, i1);\n      const h2 = encoding.decodeHeight(vertices, i2);\n      return barycentric.x * h0 + barycentric.y * h1 + barycentric.z * h2;\n    }\n  }\n\n  // Position does not lie in any triangle in this mesh.\n  return undefined;\n}\n\nconst sizeOfUint16 = Uint16Array.BYTES_PER_ELEMENT;\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\nconst sizeOfInt32 = Int32Array.BYTES_PER_ELEMENT;\nconst sizeOfFloat = Float32Array.BYTES_PER_ELEMENT;\nconst sizeOfDouble = Float64Array.BYTES_PER_ELEMENT;\n\nfunction interpolateHeight(terrainData, u, v, rectangle) {\n  const buffer = terrainData._buffer;\n  let quad = 0; // SW\n  let uStart = 0.0;\n  let vStart = 0.0;\n  if (v > 0.5) {\n    // Upper row\n    if (u > 0.5) {\n      // NE\n      quad = 2;\n      uStart = 0.5;\n    } else {\n      // NW\n      quad = 3;\n    }\n    vStart = 0.5;\n  } else if (u > 0.5) {\n    // SE\n    quad = 1;\n    uStart = 0.5;\n  }\n\n  const dv = new DataView(buffer);\n  let offset = 0;\n  for (let q = 0; q < quad; ++q) {\n    offset += dv.getUint32(offset, true);\n    offset += sizeOfUint32;\n  }\n  offset += sizeOfUint32; // Skip length of quad\n  offset += 2 * sizeOfDouble; // Skip origin\n\n  // Read sizes\n  const xSize = CesiumMath.toRadians(dv.getFloat64(offset, true) * 180.0);\n  offset += sizeOfDouble;\n  const ySize = CesiumMath.toRadians(dv.getFloat64(offset, true) * 180.0);\n  offset += sizeOfDouble;\n\n  // Samples per quad\n  const xScale = rectangle.width / xSize / 2;\n  const yScale = rectangle.height / ySize / 2;\n\n  // Number of points\n  const numPoints = dv.getInt32(offset, true);\n  offset += sizeOfInt32;\n\n  // Number of faces\n  const numIndices = dv.getInt32(offset, true) * 3;\n  offset += sizeOfInt32;\n\n  offset += sizeOfInt32; // Skip Level\n\n  const uBuffer = new Array(numPoints);\n  const vBuffer = new Array(numPoints);\n  const heights = new Array(numPoints);\n  let i;\n  for (i = 0; i < numPoints; ++i) {\n    uBuffer[i] = uStart + dv.getUint8(offset++) * xScale;\n    vBuffer[i] = vStart + dv.getUint8(offset++) * yScale;\n\n    // Height is stored in units of (1/EarthRadius) or (1/6371010.0)\n    heights[i] = dv.getFloat32(offset, true) * 6371010.0;\n    offset += sizeOfFloat;\n  }\n\n  const indices = new Array(numIndices);\n  for (i = 0; i < numIndices; ++i) {\n    indices[i] = dv.getUint16(offset, true);\n    offset += sizeOfUint16;\n  }\n\n  for (i = 0; i < numIndices; i += 3) {\n    const i0 = indices[i];\n    const i1 = indices[i + 1];\n    const i2 = indices[i + 2];\n\n    const u0 = uBuffer[i0];\n    const u1 = uBuffer[i1];\n    const u2 = uBuffer[i2];\n\n    const v0 = vBuffer[i0];\n    const v1 = vBuffer[i1];\n    const v2 = vBuffer[i2];\n\n    const barycentric = Intersections2D.computeBarycentricCoordinates(\n      u,\n      v,\n      u0,\n      v0,\n      u1,\n      v1,\n      u2,\n      v2,\n      barycentricCoordinateScratch\n    );\n    if (\n      barycentric.x >= -1e-15 &&\n      barycentric.y >= -1e-15 &&\n      barycentric.z >= -1e-15\n    ) {\n      return (\n        barycentric.x * heights[i0] +\n        barycentric.y * heights[i1] +\n        barycentric.z * heights[i2]\n      );\n    }\n  }\n\n  // Position does not lie in any triangle in this mesh.\n  return undefined;\n}\nexport default GoogleEarthEnterpriseTerrainData;\n", "import Check from \"./Check.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Event from \"./Event.js\";\nimport GeographicTilingScheme from \"./GeographicTilingScheme.js\";\nimport GoogleEarthEnterpriseMetadata from \"./GoogleEarthEnterpriseMetadata.js\";\nimport GoogleEarthEnterpriseTerrainData from \"./GoogleEarthEnterpriseTerrainData.js\";\nimport HeightmapTerrainData from \"./HeightmapTerrainData.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport CesiumMath from \"./Math.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Request from \"./Request.js\";\nimport RequestState from \"./RequestState.js\";\nimport RequestType from \"./RequestType.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TaskProcessor from \"./TaskProcessor.js\";\n\nconst TerrainState = {\n  UNKNOWN: 0,\n  NONE: 1,\n  SELF: 2,\n  PARENT: 3,\n};\n\nconst julianDateScratch = new JulianDate();\n\nfunction TerrainCache() {\n  this._terrainCache = {};\n  this._lastTidy = JulianDate.now();\n}\n\nTerrainCache.prototype.add = function (quadKey, buffer) {\n  this._terrainCache[quadKey] = {\n    buffer: buffer,\n    timestamp: JulianDate.now(),\n  };\n};\n\nTerrainCache.prototype.get = function (quadKey) {\n  const terrainCache = this._terrainCache;\n  const result = terrainCache[quadKey];\n  if (defined(result)) {\n    delete this._terrainCache[quadKey];\n    return result.buffer;\n  }\n};\n\nTerrainCache.prototype.tidy = function () {\n  JulianDate.now(julianDateScratch);\n  if (JulianDate.secondsDifference(julianDateScratch, this._lastTidy) > 10) {\n    const terrainCache = this._terrainCache;\n    const keys = Object.keys(terrainCache);\n    const count = keys.length;\n    for (let i = 0; i < count; ++i) {\n      const k = keys[i];\n      const e = terrainCache[k];\n      if (JulianDate.secondsDifference(julianDateScratch, e.timestamp) > 10) {\n        delete terrainCache[k];\n      }\n    }\n\n    JulianDate.clone(julianDateScratch, this._lastTidy);\n  }\n};\n\n/**\n * @typedef {Object} GoogleEarthEnterpriseTerrainProvider.ConstructorOptions\n *\n * Initialization options for GoogleEarthEnterpriseTerrainProvider constructor\n *\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If not specified, the WGS84 ellipsoid is used.\n * @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.\n */\n\n/**\n * <div class=\"notice\">\n * To construct a GoogleEarthEnterpriseTerrainProvider, call {@link  GoogleEarthEnterpriseTerrainProvider.fromMetadata}. Do not call the constructor directly.\n * </div>\n *\n * Provides tiled terrain using the Google Earth Enterprise REST API.\n *\n * @alias GoogleEarthEnterpriseTerrainProvider\n * @constructor\n *\n * @param {GoogleEarthEnterpriseTerrainProvider.ConstructorOptions} [options] An object describing initialization options\n *\n * @see GoogleEarthEnterpriseTerrainProvider.fromMetadata\n * @see GoogleEarthEnterpriseMetadata.fromUrl\n * @see GoogleEarthEnterpriseImageryProvider\n * @see CesiumTerrainProvider\n *\n * @example\n * const geeMetadata = await GoogleEarthEnterpriseMetadata.fromUrl(\"http://www.example.com\");\n * const gee = Cesium.GoogleEarthEnterpriseTerrainProvider.fromMetadata(geeMetadata);\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n */\nfunction GoogleEarthEnterpriseTerrainProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._tilingScheme = new GeographicTilingScheme({\n    numberOfLevelZeroTilesX: 2,\n    numberOfLevelZeroTilesY: 2,\n    rectangle: new Rectangle(\n      -CesiumMath.PI,\n      -CesiumMath.PI,\n      CesiumMath.PI,\n      CesiumMath.PI\n    ),\n    ellipsoid: options.ellipsoid,\n  });\n\n  let credit = options.credit;\n  if (typeof credit === \"string\") {\n    credit = new Credit(credit);\n  }\n  this._credit = credit;\n\n  // Pulled from Google's documentation\n  this._levelZeroMaximumGeometricError = 40075.16;\n\n  this._terrainCache = new TerrainCache();\n  this._terrainPromises = {};\n  this._terrainRequests = {};\n\n  this._errorEvent = new Event();\n}\n\nObject.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, {\n  /**\n   * Gets the name of the Google Earth Enterprise server url hosting the imagery.\n   * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return this._metadata.url;\n    },\n  },\n\n  /**\n   * Gets the proxy used by this provider.\n   * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n   * @type {Proxy}\n   * @readonly\n   */\n  proxy: {\n    get: function () {\n      return this._metadata.proxy;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this terrain provider is active.  Typically this is used to credit\n   * the source of the terrain.\n   * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the provider includes a water mask.  The water mask\n   * indicates which areas of the globe are water rather than land, so they can be rendered\n   * as a reflective surface with animated waves.\n   * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasWaterMask: {\n    get: function () {\n      return false;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the requested tiles include vertex normals.\n   * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasVertexNormals: {\n    get: function () {\n      return false;\n    },\n  },\n\n  /**\n   * Gets an object that can be used to determine availability of terrain from this provider, such as\n   * at points and in rectangles. This property may be undefined if availability\n   * information is not available.\n   * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n   * @type {TileAvailability}\n   * @readonly\n   */\n  availability: {\n    get: function () {\n      return undefined;\n    },\n  },\n});\n\n/**\n * Creates a GoogleEarthTerrainProvider from GoogleEarthEnterpriseMetadata\n *\n * @param {GoogleEarthEnterpriseMetadata} metadata A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider.\n * @param {GoogleEarthEnterpriseTerrainProvider.ConstructorOptions} options An object describing initialization options\n * @returns {GoogleEarthEnterpriseTerrainProvider}\n *\n * @see GoogleEarthEnterpriseMetadata.fromUrl\n *\n * @exception {RuntimeError} metadata does not specify terrain\n *\n * @example\n * const geeMetadata = await GoogleEarthEnterpriseMetadata.fromUrl(\"http://www.example.com\");\n * const gee = Cesium.GoogleEarthEnterpriseTerrainProvider.fromMetadata(geeMetadata);\n */\nGoogleEarthEnterpriseTerrainProvider.fromMetadata = function (\n  metadata,\n  options\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"metadata\", metadata);\n  //>>includeEnd('debug');\n\n  if (!metadata.terrainPresent) {\n    throw new RuntimeError(`The server ${metadata.url} doesn't have terrain`);\n  }\n\n  const provider = new GoogleEarthEnterpriseTerrainProvider(options);\n  provider._metadata = metadata;\n\n  return provider;\n};\n\nconst taskProcessor = new TaskProcessor(\"decodeGoogleEarthEnterprisePacket\");\n\n// If the tile has its own terrain, then you can just use its child bitmask. If it was requested using it's parent\n//  then you need to check all of its children to see if they have terrain.\nfunction computeChildMask(quadKey, info, metadata) {\n  let childMask = info.getChildBitmask();\n  if (info.terrainState === TerrainState.PARENT) {\n    childMask = 0;\n    for (let i = 0; i < 4; ++i) {\n      const child = metadata.getTileInformationFromQuadKey(\n        quadKey + i.toString()\n      );\n      if (defined(child) && child.hasTerrain()) {\n        childMask |= 1 << i;\n      }\n    }\n  }\n\n  return childMask;\n}\n\n/**\n * Requests the geometry for a given tile.   The result must include terrain data and\n * may optionally include a water mask and an indication of which child tiles are available.\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<TerrainData>|undefined} A promise for the requested geometry.  If this method\n *          returns undefined instead of a promise, it is an indication that too many requests are already\n *          pending and the request will be retried later.\n */\nGoogleEarthEnterpriseTerrainProvider.prototype.requestTileGeometry = function (\n  x,\n  y,\n  level,\n  request\n) {\n  const quadKey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);\n  const terrainCache = this._terrainCache;\n  const metadata = this._metadata;\n  const info = metadata.getTileInformationFromQuadKey(quadKey);\n\n  // Check if this tile is even possibly available\n  if (!defined(info)) {\n    return Promise.reject(new RuntimeError(\"Terrain tile doesn't exist\"));\n  }\n\n  let terrainState = info.terrainState;\n  if (!defined(terrainState)) {\n    // First time we have tried to load this tile, so set terrain state to UNKNOWN\n    terrainState = info.terrainState = TerrainState.UNKNOWN;\n  }\n\n  // If its in the cache, return it\n  const buffer = terrainCache.get(quadKey);\n  if (defined(buffer)) {\n    const credit = metadata.providers[info.terrainProvider];\n    return Promise.resolve(\n      new GoogleEarthEnterpriseTerrainData({\n        buffer: buffer,\n        childTileMask: computeChildMask(quadKey, info, metadata),\n        credits: defined(credit) ? [credit] : undefined,\n        negativeAltitudeExponentBias: metadata.negativeAltitudeExponentBias,\n        negativeElevationThreshold: metadata.negativeAltitudeThreshold,\n      })\n    );\n  }\n\n  // Clean up the cache\n  terrainCache.tidy();\n\n  // We have a tile, check to see if no ancestors have terrain or that we know for sure it doesn't\n  if (!info.ancestorHasTerrain) {\n    // We haven't reached a level with terrain, so return the ellipsoid\n    return Promise.resolve(\n      new HeightmapTerrainData({\n        buffer: new Uint8Array(16 * 16),\n        width: 16,\n        height: 16,\n      })\n    );\n  } else if (terrainState === TerrainState.NONE) {\n    // Already have info and there isn't any terrain here\n    return Promise.reject(new RuntimeError(\"Terrain tile doesn't exist\"));\n  }\n\n  // Figure out where we are getting the terrain and what version\n  let parentInfo;\n  let q = quadKey;\n  let terrainVersion = -1;\n  switch (terrainState) {\n    case TerrainState.SELF: // We have terrain and have retrieved it before\n      terrainVersion = info.terrainVersion;\n      break;\n    case TerrainState.PARENT: // We have terrain in our parent\n      q = q.substring(0, q.length - 1);\n      parentInfo = metadata.getTileInformationFromQuadKey(q);\n      terrainVersion = parentInfo.terrainVersion;\n      break;\n    case TerrainState.UNKNOWN: // We haven't tried to retrieve terrain yet\n      if (info.hasTerrain()) {\n        terrainVersion = info.terrainVersion; // We should have terrain\n      } else {\n        q = q.substring(0, q.length - 1);\n        parentInfo = metadata.getTileInformationFromQuadKey(q);\n        if (defined(parentInfo) && parentInfo.hasTerrain()) {\n          terrainVersion = parentInfo.terrainVersion; // Try checking in the parent\n        }\n      }\n      break;\n  }\n\n  // We can't figure out where to get the terrain\n  if (terrainVersion < 0) {\n    return Promise.reject(new RuntimeError(\"Terrain tile doesn't exist\"));\n  }\n\n  // Load that terrain\n  const terrainPromises = this._terrainPromises;\n  const terrainRequests = this._terrainRequests;\n  let sharedPromise;\n  let sharedRequest;\n  if (defined(terrainPromises[q])) {\n    // Already being loaded possibly from another child, so return existing promise\n    sharedPromise = terrainPromises[q];\n    sharedRequest = terrainRequests[q];\n  } else {\n    // Create new request for terrain\n    sharedRequest = request;\n    const requestPromise = buildTerrainResource(\n      this,\n      q,\n      terrainVersion,\n      sharedRequest\n    ).fetchArrayBuffer();\n\n    if (!defined(requestPromise)) {\n      return undefined; // Throttled\n    }\n\n    sharedPromise = requestPromise.then(function (terrain) {\n      if (defined(terrain)) {\n        return taskProcessor\n          .scheduleTask(\n            {\n              buffer: terrain,\n              type: \"Terrain\",\n              key: metadata.key,\n            },\n            [terrain]\n          )\n          .then(function (terrainTiles) {\n            // Add requested tile and mark it as SELF\n            const requestedInfo = metadata.getTileInformationFromQuadKey(q);\n            requestedInfo.terrainState = TerrainState.SELF;\n            terrainCache.add(q, terrainTiles[0]);\n            const provider = requestedInfo.terrainProvider;\n\n            // Add children to cache\n            const count = terrainTiles.length - 1;\n            for (let j = 0; j < count; ++j) {\n              const childKey = q + j.toString();\n              const child = metadata.getTileInformationFromQuadKey(childKey);\n              if (defined(child)) {\n                terrainCache.add(childKey, terrainTiles[j + 1]);\n                child.terrainState = TerrainState.PARENT;\n                if (child.terrainProvider === 0) {\n                  child.terrainProvider = provider;\n                }\n              }\n            }\n          });\n      }\n\n      return Promise.reject(new RuntimeError(\"Failed to load terrain.\"));\n    });\n\n    terrainPromises[q] = sharedPromise; // Store promise without delete from terrainPromises\n    terrainRequests[q] = sharedRequest;\n\n    // Set promise so we remove from terrainPromises just one time\n    sharedPromise = sharedPromise.finally(function () {\n      delete terrainPromises[q];\n      delete terrainRequests[q];\n    });\n  }\n\n  return sharedPromise\n    .then(function () {\n      const buffer = terrainCache.get(quadKey);\n      if (defined(buffer)) {\n        const credit = metadata.providers[info.terrainProvider];\n        return new GoogleEarthEnterpriseTerrainData({\n          buffer: buffer,\n          childTileMask: computeChildMask(quadKey, info, metadata),\n          credits: defined(credit) ? [credit] : undefined,\n          negativeAltitudeExponentBias: metadata.negativeAltitudeExponentBias,\n          negativeElevationThreshold: metadata.negativeAltitudeThreshold,\n        });\n      }\n\n      return Promise.reject(new RuntimeError(\"Failed to load terrain.\"));\n    })\n    .catch(function (error) {\n      if (sharedRequest.state === RequestState.CANCELLED) {\n        request.state = sharedRequest.state;\n        return Promise.reject(error);\n      }\n      info.terrainState = TerrainState.NONE;\n      return Promise.reject(error);\n    });\n};\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level.\n *\n * @param {number} level The tile level for which to get the maximum geometric error.\n * @returns {number} The maximum geometric error.\n */\nGoogleEarthEnterpriseTerrainProvider.prototype.getLevelMaximumGeometricError = function (\n  level\n) {\n  return this._levelZeroMaximumGeometricError / (1 << level);\n};\n\n/**\n * Determines whether data for a tile is available to be loaded.\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @returns {boolean|undefined} Undefined if not supported, otherwise true or false.\n */\nGoogleEarthEnterpriseTerrainProvider.prototype.getTileDataAvailable = function (\n  x,\n  y,\n  level\n) {\n  const metadata = this._metadata;\n  let quadKey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);\n\n  const info = metadata.getTileInformation(x, y, level);\n  if (info === null) {\n    return false;\n  }\n\n  if (defined(info)) {\n    if (!info.ancestorHasTerrain) {\n      return true; // We'll just return the ellipsoid\n    }\n\n    const terrainState = info.terrainState;\n    if (terrainState === TerrainState.NONE) {\n      return false; // Terrain is not available\n    }\n\n    if (!defined(terrainState) || terrainState === TerrainState.UNKNOWN) {\n      info.terrainState = TerrainState.UNKNOWN;\n      if (!info.hasTerrain()) {\n        quadKey = quadKey.substring(0, quadKey.length - 1);\n        const parentInfo = metadata.getTileInformationFromQuadKey(quadKey);\n        if (!defined(parentInfo) || !parentInfo.hasTerrain()) {\n          return false;\n        }\n      }\n    }\n\n    return true;\n  }\n\n  if (metadata.isValid(quadKey)) {\n    // We will need this tile, so request metadata and return false for now\n    const request = new Request({\n      throttle: false,\n      throttleByServer: true,\n      type: RequestType.TERRAIN,\n    });\n    metadata.populateSubtree(x, y, level, request);\n  }\n  return false;\n};\n\n/**\n * Makes sure we load availability data for a tile\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @returns {undefined}\n */\nGoogleEarthEnterpriseTerrainProvider.prototype.loadTileDataAvailability = function (\n  x,\n  y,\n  level\n) {\n  return undefined;\n};\n\n//\n// Functions to handle imagery packets\n//\nfunction buildTerrainResource(terrainProvider, quadKey, version, request) {\n  version = defined(version) && version > 0 ? version : 1;\n  return terrainProvider._metadata.resource.getDerivedResource({\n    url: `flatfile?f1c-0${quadKey}-t.${version.toString()}`,\n    request: request,\n  });\n}\nexport default GoogleEarthEnterpriseTerrainProvider;\n", "import Credit from \"./Credit.js\";\nimport Resource from \"./Resource.js\";\n\n/**\n * Default settings for accessing the Google Maps API.\n * <br/>\n * An API key is only required if you are directly using any Google Maps APIs, such as through {@link createGooglePhotorealistic3DTileset}.\n * Follow instructions for managing API keys for the Google Maps Platform at {@link https://developers.google.com/maps/documentation/embed/get-api-key}\n *\n * @see createGooglePhotorealistic3DTileset\n * @see https://developers.google.com/maps/documentation/embed/get-api-key\n *\n * @namespace GoogleMaps\n */\nconst GoogleMaps = {};\n\n/**\n * Gets or sets the default Google Maps API key.\n *\n * @type {undefined|string}\n */\nGoogleMaps.defaultApiKey = undefined;\n\n/**\n * Gets or sets the default Google Map Tiles API endpoint.\n *\n * @type {string|Resource}\n * @default https://tile.googleapis.com/v1/\n */\nGoogleMaps.mapTilesApiEndpoint = new Resource({\n  url: \"https://tile.googleapis.com/v1/\",\n});\n\nGoogleMaps.getDefaultCredit = function () {\n  return new Credit(\n    `<img src=\"https://assets.ion-development.cesium.com/google-credit.png\" alt=\"Google\">`,\n    true\n  );\n};\nexport default GoogleMaps;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * The interface for interpolation algorithms.\n *\n * @interface InterpolationAlgorithm\n *\n * @see LagrangePolynomialApproximation\n * @see LinearApproximation\n * @see HermitePolynomialApproximation\n */\nconst InterpolationAlgorithm = {};\n\n/**\n * Gets the name of this interpolation algorithm.\n * @type {string}\n */\nInterpolationAlgorithm.type = undefined;\n\n/**\n * Given the desired degree, returns the number of data points required for interpolation.\n * @function\n *\n * @param {number} degree The desired degree of interpolation.\n * @returns {number} The number of required data points needed for the desired degree of interpolation.\n */\nInterpolationAlgorithm.getRequiredDataPoints =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Performs zero order interpolation.\n * @function\n *\n * @param {number} x The independent variable for which the dependent variables will be interpolated.\n * @param {number[]} xTable The array of independent variables to use to interpolate.  The values\n * in this array must be in increasing order and the same value must not occur twice in the array.\n * @param {number[]} yTable The array of dependent variables to use to interpolate.  For a set of three\n * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.\n * @param {number} yStride The number of dependent variable values in yTable corresponding to\n * each independent variable value in xTable.\n * @param {number[]} [result] An existing array into which to store the result.\n *\n * @returns {number[]} The array of interpolated values, or the result parameter if one was provided.\n */\nInterpolationAlgorithm.interpolateOrderZero =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Performs higher order interpolation.  Not all interpolators need to support high-order interpolation,\n * if this function remains undefined on implementing objects, interpolateOrderZero will be used instead.\n * @function\n * @param {number} x The independent variable for which the dependent variables will be interpolated.\n * @param {number[]} xTable The array of independent variables to use to interpolate.  The values\n * in this array must be in increasing order and the same value must not occur twice in the array.\n * @param {number[]} yTable The array of dependent variables to use to interpolate.  For a set of three\n * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.\n * @param {number} yStride The number of dependent variable values in yTable corresponding to\n * each independent variable value in xTable.\n * @param {number} inputOrder The number of derivatives supplied for input.\n * @param {number} outputOrder The number of derivatives desired for output.\n * @param {number[]} [result] An existing array into which to store the result.\n * @returns {number[]} The array of interpolated values, or the result parameter if one was provided.\n */\nInterpolationAlgorithm.interpolate = DeveloperError.throwInstantiationError;\nexport default InterpolationAlgorithm;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defined from \"./defined.js\";\nimport GeocodeType from \"./GeocodeType.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Resource from \"./Resource.js\";\n\n/**\n * Provides geocoding via a {@link https://pelias.io/|Pelias} server.\n * @alias PeliasGeocoderService\n * @constructor\n *\n * @param {Resource|string} url The endpoint to the Pelias server.\n *\n * @example\n * // Configure a Viewer to use the Pelias server hosted by https://geocode.earth/\n * const viewer = new Cesium.Viewer('cesiumContainer', {\n *   geocoder: new Cesium.PeliasGeocoderService(new Cesium.Resource({\n *     url: 'https://api.geocode.earth/v1/',\n *       queryParameters: {\n *         api_key: '<Your geocode.earth API key>'\n *     }\n *   }))\n * });\n */\nfunction PeliasGeocoderService(url) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"url\", url);\n  //>>includeEnd('debug');\n\n  this._url = Resource.createIfNeeded(url);\n  this._url.appendForwardSlash();\n}\n\nObject.defineProperties(PeliasGeocoderService.prototype, {\n  /**\n   * The Resource used to access the Pelias endpoint.\n   * @type {Resource}\n   * @memberof PeliasGeocoderService.prototype\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return this._url;\n    },\n  },\n  /**\n   * Gets the credit to display after a geocode is performed. Typically this is used to credit\n   * the geocoder service.\n   * @memberof PeliasGeocoderService.prototype\n   * @type {Credit|undefined}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return undefined;\n    },\n  },\n});\n\n/**\n * @function\n *\n * @param {string} query The query to be sent to the geocoder service\n * @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform.\n * @returns {Promise<GeocoderService.Result[]>}\n */\nPeliasGeocoderService.prototype.geocode = async function (query, type) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"query\", query);\n  //>>includeEnd('debug');\n\n  const resource = this._url.getDerivedResource({\n    url: type === GeocodeType.AUTOCOMPLETE ? \"autocomplete\" : \"search\",\n    queryParameters: {\n      text: query,\n    },\n  });\n\n  return resource.fetchJson().then(function (results) {\n    return results.features.map(function (resultObject) {\n      let destination;\n      const bboxDegrees = resultObject.bbox;\n\n      if (defined(bboxDegrees)) {\n        destination = Rectangle.fromDegrees(\n          bboxDegrees[0],\n          bboxDegrees[1],\n          bboxDegrees[2],\n          bboxDegrees[3]\n        );\n      } else {\n        const lon = resultObject.geometry.coordinates[0];\n        const lat = resultObject.geometry.coordinates[1];\n        destination = Cartesian3.fromDegrees(lon, lat);\n      }\n\n      return {\n        displayName: resultObject.properties.label,\n        destination: destination,\n        attributions: results.attributions,\n      };\n    });\n  });\n};\nexport default PeliasGeocoderService;\n", "import Check from \"./Check.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ion from \"./Ion.js\";\nimport PeliasGeocoderService from \"./PeliasGeocoderService.js\";\nimport Resource from \"./Resource.js\";\n\n/**\n * Provides geocoding through Cesium ion.\n * @alias IonGeocoderService\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Scene} options.scene The scene\n * @param {string} [options.accessToken=Ion.defaultAccessToken] The access token to use.\n * @param {string|Resource} [options.server=Ion.defaultServer] The resource to the Cesium ion API server.\n *\n * @see Ion\n */\nfunction IonGeocoderService(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.scene\", options.scene);\n  //>>includeEnd('debug');\n\n  const accessToken = defaultValue(options.accessToken, Ion.defaultAccessToken);\n  const server = Resource.createIfNeeded(\n    defaultValue(options.server, Ion.defaultServer)\n  );\n  server.appendForwardSlash();\n\n  const defaultTokenCredit = Ion.getDefaultTokenCredit(accessToken);\n  if (defined(defaultTokenCredit)) {\n    options.scene.frameState.creditDisplay.addStaticCredit(\n      Credit.clone(defaultTokenCredit)\n    );\n  }\n\n  const searchEndpoint = server.getDerivedResource({\n    url: \"v1/geocode\",\n  });\n\n  if (defined(accessToken)) {\n    searchEndpoint.appendQueryParameters({ access_token: accessToken });\n  }\n\n  this._accessToken = accessToken;\n  this._server = server;\n  this._pelias = new PeliasGeocoderService(searchEndpoint);\n}\n\nObject.defineProperties(IonGeocoderService.prototype, {\n  /**\n   * Gets the credit to display after a geocode is performed. Typically this is used to credit\n   * the geocoder service.\n   * @memberof IonGeocoderService.prototype\n   * @type {Credit|undefined}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return undefined;\n    },\n  },\n});\n\n/**\n * @function\n *\n * @param {string} query The query to be sent to the geocoder service\n * @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform.\n * @returns {Promise<GeocoderService.Result[]>}\n */\nIonGeocoderService.prototype.geocode = async function (query, geocodeType) {\n  return this._pelias.geocode(query, geocodeType);\n};\nexport default IonGeocoderService;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Defines how geodetic ellipsoid coordinates ({@link Cartographic}) project to a\n * flat map like Cesium's 2D and Columbus View modes.\n *\n * @alias MapProjection\n * @constructor\n * @abstract\n *\n * @see GeographicProjection\n * @see WebMercatorProjection\n */\nfunction MapProjection() {\n  DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(MapProjection.prototype, {\n  /**\n   * Gets the {@link Ellipsoid}.\n   *\n   * @memberof MapProjection.prototype\n   *\n   * @type {Ellipsoid}\n   * @readonly\n   */\n  ellipsoid: {\n    get: DeveloperError.throwInstantiationError,\n  },\n});\n\n/**\n * Projects {@link Cartographic} coordinates, in radians, to projection-specific map coordinates, in meters.\n *\n * @memberof MapProjection\n * @function\n *\n * @param {Cartographic} cartographic The coordinates to project.\n * @param {Cartesian3} [result] An instance into which to copy the result.  If this parameter is\n *        undefined, a new instance is created and returned.\n * @returns {Cartesian3} The projected coordinates.  If the result parameter is not undefined, the\n *          coordinates are copied there and that instance is returned.  Otherwise, a new instance is\n *          created and returned.\n */\nMapProjection.prototype.project = DeveloperError.throwInstantiationError;\n\n/**\n * Unprojects projection-specific map {@link Cartesian3} coordinates, in meters, to {@link Cartographic}\n * coordinates, in radians.\n *\n * @memberof MapProjection\n * @function\n *\n * @param {Cartesian3} cartesian The Cartesian position to unproject with height (z) in meters.\n * @param {Cartographic} [result] An instance into which to copy the result.  If this parameter is\n *        undefined, a new instance is created and returned.\n * @returns {Cartographic} The unprojected coordinates.  If the result parameter is not undefined, the\n *          coordinates are copied there and that instance is returned.  Otherwise, a new instance is\n *          created and returned.\n */\nMapProjection.prototype.unproject = DeveloperError.throwInstantiationError;\nexport default MapProjection;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Spline from \"./Spline.js\";\n\n/**\n * A spline that linearly interpolates over an array of weight values used by morph targets.\n *\n * @alias MorphWeightSpline\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point.\n *                The values are in no way connected to the clock time. They are the parameterization for the curve.\n * @param {number[]} options.weights The array of floating-point control weights given. The weights are ordered such\n *                that all weights for the targets are given in chronological order and order in which they appear in\n *                the glTF from which the morph targets come. This means for 2 targets, weights = [w(0,0), w(0,1), w(1,0), w(1,1) ...]\n *                where i and j in w(i,j) are the time indices and target indices, respectively.\n *\n * @exception {DeveloperError} weights.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be a factor of weights.length.\n *\n *\n * @example\n * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];\n * const weights = [0.0, 1.0, 0.25, 0.75, 0.5, 0.5, 0.75, 0.25, 1.0, 0.0]; //Two targets\n * const spline = new Cesium.WeightSpline({\n *     times : times,\n *     weights : weights\n * });\n *\n * const p0 = spline.evaluate(times[0]);\n *\n * @see ConstantSpline\n * @see SteppedSpline\n * @see LinearSpline\n * @see HermiteSpline\n * @see CatmullRomSpline\n * @see QuaternionSpline\n */\nfunction MorphWeightSpline(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const weights = options.weights;\n  const times = options.times;\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"weights\", weights);\n  Check.defined(\"times\", times);\n  Check.typeOf.number.greaterThanOrEquals(\"weights.length\", weights.length, 3);\n  if (weights.length % times.length !== 0) {\n    throw new DeveloperError(\n      \"times.length must be a factor of weights.length.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this._times = times;\n  this._weights = weights;\n  this._count = weights.length / times.length;\n\n  this._lastTimeIndex = 0;\n}\n\nObject.defineProperties(MorphWeightSpline.prototype, {\n  /**\n   * An array of times for the control weights.\n   *\n   * @memberof WeightSpline.prototype\n   *\n   * @type {number[]}\n   * @readonly\n   */\n  times: {\n    get: function () {\n      return this._times;\n    },\n  },\n\n  /**\n   * An array of floating-point array control weights.\n   *\n   * @memberof WeightSpline.prototype\n   *\n   * @type {number[]}\n   * @readonly\n   */\n  weights: {\n    get: function () {\n      return this._weights;\n    },\n  },\n});\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n * @function\n *\n * @param {number} time The time.\n * @returns {number} The index for the element at the start of the interval.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n *                             in the array <code>times</code>.\n */\nMorphWeightSpline.prototype.findTimeInterval =\n  Spline.prototype.findTimeInterval;\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, wrapped around to the updated animation.\n */\nMorphWeightSpline.prototype.wrapTime = Spline.prototype.wrapTime;\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {number} time The time.\n * @return {number} The time, clamped to the animation period.\n */\nMorphWeightSpline.prototype.clampTime = Spline.prototype.clampTime;\n\n/**\n * Evaluates the curve at a given time.\n *\n * @param {number} time The time at which to evaluate the curve.\n * @param {number[]} [result] The object onto which to store the result.\n * @returns {number[]} The modified result parameter or a new instance of the point on the curve at the given time.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n *                             in the array <code>times</code>.\n */\nMorphWeightSpline.prototype.evaluate = function (time, result) {\n  const weights = this.weights;\n  const times = this.times;\n\n  const i = (this._lastTimeIndex = this.findTimeInterval(\n    time,\n    this._lastTimeIndex\n  ));\n  const u = (time - times[i]) / (times[i + 1] - times[i]);\n\n  if (!defined(result)) {\n    result = new Array(this._count);\n  }\n\n  for (let j = 0; j < this._count; j++) {\n    const index = i * this._count + j;\n    result[j] = weights[index] * (1.0 - u) + weights[index + this._count] * u;\n  }\n\n  return result;\n};\nexport default MorphWeightSpline;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport combine from \"./combine.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Resource from \"./Resource.js\";\n\n/**\n * Provides geocoding via a {@link https://opencagedata.com/|OpenCage} server.\n * @alias OpenCageGeocoderService\n * @constructor\n *\n * @param {Resource|string} url The endpoint to the OpenCage server.\n * @param {string} apiKey The OpenCage API Key.\n * @param {object} [params] An object with the following properties (See https://opencagedata.com/api#forward-opt):\n * @param {number} [params.abbrv] When set to 1 we attempt to abbreviate and shorten the formatted string we return.\n * @param {number} [options.add_request] When set to 1 the various request parameters are added to the response for ease of debugging.\n * @param {string} [options.bounds] Provides the geocoder with a hint to the region that the query resides in.\n * @param {string} [options.countrycode] Restricts the results to the specified country or countries (as defined by the ISO 3166-1 Alpha 2 standard).\n * @param {string} [options.jsonp] Wraps the returned JSON with a function name.\n * @param {string} [options.language] An IETF format language code.\n * @param {number} [options.limit] The maximum number of results we should return.\n * @param {number} [options.min_confidence] An integer from 1-10. Only results with at least this confidence will be returned.\n * @param {number} [options.no_annotations] When set to 1 results will not contain annotations.\n * @param {number} [options.no_dedupe] When set to 1 results will not be deduplicated.\n * @param {number} [options.no_record] When set to 1 the query contents are not logged.\n * @param {number} [options.pretty] When set to 1 results are 'pretty' printed for easier reading. Useful for debugging.\n * @param {string} [options.proximity] Provides the geocoder with a hint to bias results in favour of those closer to the specified location (For example: 41.40139,2.12870).\n *\n * @example\n * // Configure a Viewer to use the OpenCage Geocoder\n * const viewer = new Cesium.Viewer('cesiumContainer', {\n *   geocoder: new Cesium.OpenCageGeocoderService('https://api.opencagedata.com/geocode/v1/', '<API key>')\n * });\n */\nfunction OpenCageGeocoderService(url, apiKey, params) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"url\", url);\n  Check.defined(\"apiKey\", apiKey);\n  if (defined(params)) {\n    Check.typeOf.object(\"params\", params);\n  }\n  //>>includeEnd('debug');\n\n  url = Resource.createIfNeeded(url);\n  url.appendForwardSlash();\n  url.setQueryParameters({ key: apiKey });\n  this._url = url;\n  this._params = defaultValue(params, {});\n  this._credit = new Credit(\n    `Geodata copyright <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors`,\n    false\n  );\n}\n\nObject.defineProperties(OpenCageGeocoderService.prototype, {\n  /**\n   * The Resource used to access the OpenCage endpoint.\n   * @type {Resource}\n   * @memberof OpenCageGeocoderService.prototype\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return this._url;\n    },\n  },\n  /**\n   * Optional params passed to OpenCage in order to customize geocoding\n   * @type {object}\n   * @memberof OpenCageGeocoderService.prototype\n   * @readonly\n   */\n  params: {\n    get: function () {\n      return this._params;\n    },\n  },\n  /**\n   * Gets the credit to display after a geocode is performed. Typically this is used to credit\n   * the geocoder service.\n   * @memberof OpenCageGeocoderService.prototype\n   * @type {Credit|undefined}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n});\n\n/**\n * @function\n *\n * @param {string} query The query to be sent to the geocoder service\n * @returns {Promise<GeocoderService.Result[]>}\n */\nOpenCageGeocoderService.prototype.geocode = async function (query) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"query\", query);\n  //>>includeEnd('debug');\n\n  const resource = this._url.getDerivedResource({\n    url: \"json\",\n    queryParameters: combine(this._params, { q: query }),\n  });\n  return resource.fetchJson().then(function (response) {\n    return response.results.map(function (resultObject) {\n      let destination;\n      const bounds = resultObject.bounds;\n\n      if (defined(bounds)) {\n        destination = Rectangle.fromDegrees(\n          bounds.southwest.lng,\n          bounds.southwest.lat,\n          bounds.northeast.lng,\n          bounds.northeast.lat\n        );\n      } else {\n        const lon = resultObject.geometry.lat;\n        const lat = resultObject.geometry.lng;\n        destination = Cartesian3.fromDegrees(lon, lat);\n      }\n\n      return {\n        displayName: resultObject.formatted,\n        destination: destination,\n      };\n    });\n  });\n};\nexport default OpenCageGeocoderService;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Static interface for types which can store their values as packed\n * elements in an array.  These methods and properties are expected to be\n * defined on a constructor function.\n *\n * @interface Packable\n *\n * @see PackableForInterpolation\n */\nconst Packable = {\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  packedLength: undefined,\n\n  /**\n   * Stores the provided instance into the provided array.\n   * @function\n   *\n   * @param {*} value The value to pack.\n   * @param {number[]} array The array to pack into.\n   * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n   */\n  pack: DeveloperError.throwInstantiationError,\n\n  /**\n   * Retrieves an instance from a packed array.\n   * @function\n   *\n   * @param {number[]} array The packed array.\n   * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n   * @param {object} [result] The object into which to store the result.\n   * @returns {object} The modified result parameter or a new Object instance if one was not provided.\n   */\n  unpack: DeveloperError.throwInstantiationError,\n};\nexport default Packable;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Static interface for {@link Packable} types which are interpolated in a\n * different representation than their packed value.  These methods and\n * properties are expected to be defined on a constructor function.\n *\n * @namespace PackableForInterpolation\n *\n * @see Packable\n */\nconst PackableForInterpolation = {\n  /**\n   * The number of elements used to store the object into an array in its interpolatable form.\n   * @type {number}\n   */\n  packedInterpolationLength: undefined,\n\n  /**\n   * Converts a packed array into a form suitable for interpolation.\n   * @function\n   *\n   * @param {number[]} packedArray The packed array.\n   * @param {number} [startingIndex=0] The index of the first element to be converted.\n   * @param {number} [lastIndex=packedArray.length] The index of the last element to be converted.\n   * @param {number[]} [result] The object into which to store the result.\n   */\n  convertPackedArrayForInterpolation: DeveloperError.throwInstantiationError,\n\n  /**\n   * Retrieves an instance from a packed array converted with {@link PackableForInterpolation.convertPackedArrayForInterpolation}.\n   * @function\n   *\n   * @param {number[]} array The array previously packed for interpolation.\n   * @param {number[]} sourceArray The original packed array.\n   * @param {number} [startingIndex=0] The startingIndex used to convert the array.\n   * @param {number} [lastIndex=packedArray.length] The lastIndex used to convert the array.\n   * @param {object} [result] The object into which to store the result.\n   * @returns {object} The modified result parameter or a new Object instance if one was not provided.\n   */\n  unpackInterpolationResult: DeveloperError.throwInstantiationError,\n};\nexport default PackableForInterpolation;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Base class for proxying requested made by {@link Resource}.\n *\n * @alias Proxy\n * @constructor\n *\n * @see DefaultProxy\n */\nfunction Proxy() {\n  DeveloperError.throwInstantiationError();\n}\n\n/**\n * Get the final URL to use to request a given resource.\n *\n * @param {string} resource The resource to request.\n * @returns {string} proxied resource\n * @function\n */\nProxy.prototype.getURL = DeveloperError.throwInstantiationError;\n\nexport default Proxy;\n", "import ArcType from \"./ArcType.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Color from \"./Color.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolylinePipeline from \"./PolylinePipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\nfunction interpolateColors(p0, p1, color0, color1, minDistance, array, offset) {\n  const numPoints = PolylinePipeline.numberOfPoints(p0, p1, minDistance);\n  let i;\n\n  const r0 = color0.red;\n  const g0 = color0.green;\n  const b0 = color0.blue;\n  const a0 = color0.alpha;\n\n  const r1 = color1.red;\n  const g1 = color1.green;\n  const b1 = color1.blue;\n  const a1 = color1.alpha;\n\n  if (Color.equals(color0, color1)) {\n    for (i = 0; i < numPoints; i++) {\n      array[offset++] = Color.floatToByte(r0);\n      array[offset++] = Color.floatToByte(g0);\n      array[offset++] = Color.floatToByte(b0);\n      array[offset++] = Color.floatToByte(a0);\n    }\n    return offset;\n  }\n\n  const redPerVertex = (r1 - r0) / numPoints;\n  const greenPerVertex = (g1 - g0) / numPoints;\n  const bluePerVertex = (b1 - b0) / numPoints;\n  const alphaPerVertex = (a1 - a0) / numPoints;\n\n  let index = offset;\n  for (i = 0; i < numPoints; i++) {\n    array[index++] = Color.floatToByte(r0 + i * redPerVertex);\n    array[index++] = Color.floatToByte(g0 + i * greenPerVertex);\n    array[index++] = Color.floatToByte(b0 + i * bluePerVertex);\n    array[index++] = Color.floatToByte(a0 + i * alphaPerVertex);\n  }\n\n  return index;\n}\n\n/**\n * A description of a polyline modeled as a line strip; the first two positions define a line segment,\n * and each additional position defines a line segment from the previous position.\n *\n * @alias SimplePolylineGeometry\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of {@link Cartesian3} defining the positions in the polyline as a line strip.\n * @param {Color[]} [options.colors] An Array of {@link Color} defining the per vertex or per segment colors.\n * @param {boolean} [options.colorsPerVertex=false] A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow.\n * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n *\n * @exception {DeveloperError} At least two positions are required.\n * @exception {DeveloperError} colors has an invalid length.\n *\n * @see SimplePolylineGeometry#createGeometry\n *\n * @example\n * // A polyline with two connected line segments\n * const polyline = new Cesium.SimplePolylineGeometry({\n *   positions : Cesium.Cartesian3.fromDegreesArray([\n *     0.0, 0.0,\n *     5.0, 0.0,\n *     5.0, 5.0\n *   ])\n * });\n * const geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline);\n */\nfunction SimplePolylineGeometry(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const positions = options.positions;\n  const colors = options.colors;\n  const colorsPerVertex = defaultValue(options.colorsPerVertex, false);\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(positions) || positions.length < 2) {\n    throw new DeveloperError(\"At least two positions are required.\");\n  }\n  if (\n    defined(colors) &&\n    ((colorsPerVertex && colors.length < positions.length) ||\n      (!colorsPerVertex && colors.length < positions.length - 1))\n  ) {\n    throw new DeveloperError(\"colors has an invalid length.\");\n  }\n  //>>includeEnd('debug');\n\n  this._positions = positions;\n  this._colors = colors;\n  this._colorsPerVertex = colorsPerVertex;\n\n  this._arcType = defaultValue(options.arcType, ArcType.GEODESIC);\n  this._granularity = defaultValue(\n    options.granularity,\n    CesiumMath.RADIANS_PER_DEGREE\n  );\n  this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  this._workerName = \"createSimplePolylineGeometry\";\n\n  let numComponents = 1 + positions.length * Cartesian3.packedLength;\n  numComponents += defined(colors) ? 1 + colors.length * Color.packedLength : 1;\n\n  /**\n   * The number of elements used to pack the object into an array.\n   * @type {number}\n   */\n  this.packedLength = numComponents + Ellipsoid.packedLength + 3;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {SimplePolylineGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nSimplePolylineGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(value)) {\n    throw new DeveloperError(\"value is required\");\n  }\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  let i;\n\n  const positions = value._positions;\n  let length = positions.length;\n  array[startingIndex++] = length;\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    Cartesian3.pack(positions[i], array, startingIndex);\n  }\n\n  const colors = value._colors;\n  length = defined(colors) ? colors.length : 0.0;\n  array[startingIndex++] = length;\n\n  for (i = 0; i < length; ++i, startingIndex += Color.packedLength) {\n    Color.pack(colors[i], array, startingIndex);\n  }\n\n  Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  array[startingIndex++] = value._colorsPerVertex ? 1.0 : 0.0;\n  array[startingIndex++] = value._arcType;\n  array[startingIndex] = value._granularity;\n\n  return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {SimplePolylineGeometry} [result] The object into which to store the result.\n * @returns {SimplePolylineGeometry} The modified result parameter or a new SimplePolylineGeometry instance if one was not provided.\n */\nSimplePolylineGeometry.unpack = function (array, startingIndex, result) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(array)) {\n    throw new DeveloperError(\"array is required\");\n  }\n  //>>includeEnd('debug');\n\n  startingIndex = defaultValue(startingIndex, 0);\n\n  let i;\n\n  let length = array[startingIndex++];\n  const positions = new Array(length);\n\n  for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n    positions[i] = Cartesian3.unpack(array, startingIndex);\n  }\n\n  length = array[startingIndex++];\n  const colors = length > 0 ? new Array(length) : undefined;\n\n  for (i = 0; i < length; ++i, startingIndex += Color.packedLength) {\n    colors[i] = Color.unpack(array, startingIndex);\n  }\n\n  const ellipsoid = Ellipsoid.unpack(array, startingIndex);\n  startingIndex += Ellipsoid.packedLength;\n\n  const colorsPerVertex = array[startingIndex++] === 1.0;\n  const arcType = array[startingIndex++];\n  const granularity = array[startingIndex];\n\n  if (!defined(result)) {\n    return new SimplePolylineGeometry({\n      positions: positions,\n      colors: colors,\n      ellipsoid: ellipsoid,\n      colorsPerVertex: colorsPerVertex,\n      arcType: arcType,\n      granularity: granularity,\n    });\n  }\n\n  result._positions = positions;\n  result._colors = colors;\n  result._ellipsoid = ellipsoid;\n  result._colorsPerVertex = colorsPerVertex;\n  result._arcType = arcType;\n  result._granularity = granularity;\n\n  return result;\n};\n\nconst scratchArray1 = new Array(2);\nconst scratchArray2 = new Array(2);\nconst generateArcOptionsScratch = {\n  positions: scratchArray1,\n  height: scratchArray2,\n  ellipsoid: undefined,\n  minDistance: undefined,\n  granularity: undefined,\n};\n\n/**\n * Computes the geometric representation of a simple polyline, including its vertices, indices, and a bounding sphere.\n *\n * @param {SimplePolylineGeometry} simplePolylineGeometry A description of the polyline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nSimplePolylineGeometry.createGeometry = function (simplePolylineGeometry) {\n  const positions = simplePolylineGeometry._positions;\n  const colors = simplePolylineGeometry._colors;\n  const colorsPerVertex = simplePolylineGeometry._colorsPerVertex;\n  const arcType = simplePolylineGeometry._arcType;\n  const granularity = simplePolylineGeometry._granularity;\n  const ellipsoid = simplePolylineGeometry._ellipsoid;\n\n  const minDistance = CesiumMath.chordLength(\n    granularity,\n    ellipsoid.maximumRadius\n  );\n  const perSegmentColors = defined(colors) && !colorsPerVertex;\n\n  let i;\n  const length = positions.length;\n\n  let positionValues;\n  let numberOfPositions;\n  let colorValues;\n  let color;\n  let offset = 0;\n\n  if (arcType === ArcType.GEODESIC || arcType === ArcType.RHUMB) {\n    let subdivisionSize;\n    let numberOfPointsFunction;\n    let generateArcFunction;\n    if (arcType === ArcType.GEODESIC) {\n      subdivisionSize = CesiumMath.chordLength(\n        granularity,\n        ellipsoid.maximumRadius\n      );\n      numberOfPointsFunction = PolylinePipeline.numberOfPoints;\n      generateArcFunction = PolylinePipeline.generateArc;\n    } else {\n      subdivisionSize = granularity;\n      numberOfPointsFunction = PolylinePipeline.numberOfPointsRhumbLine;\n      generateArcFunction = PolylinePipeline.generateRhumbArc;\n    }\n\n    const heights = PolylinePipeline.extractHeights(positions, ellipsoid);\n\n    const generateArcOptions = generateArcOptionsScratch;\n    if (arcType === ArcType.GEODESIC) {\n      generateArcOptions.minDistance = minDistance;\n    } else {\n      generateArcOptions.granularity = granularity;\n    }\n    generateArcOptions.ellipsoid = ellipsoid;\n\n    if (perSegmentColors) {\n      let positionCount = 0;\n      for (i = 0; i < length - 1; i++) {\n        positionCount +=\n          numberOfPointsFunction(\n            positions[i],\n            positions[i + 1],\n            subdivisionSize\n          ) + 1;\n      }\n\n      positionValues = new Float64Array(positionCount * 3);\n      colorValues = new Uint8Array(positionCount * 4);\n\n      generateArcOptions.positions = scratchArray1;\n      generateArcOptions.height = scratchArray2;\n\n      let ci = 0;\n      for (i = 0; i < length - 1; ++i) {\n        scratchArray1[0] = positions[i];\n        scratchArray1[1] = positions[i + 1];\n\n        scratchArray2[0] = heights[i];\n        scratchArray2[1] = heights[i + 1];\n\n        const pos = generateArcFunction(generateArcOptions);\n\n        if (defined(colors)) {\n          const segLen = pos.length / 3;\n          color = colors[i];\n          for (let k = 0; k < segLen; ++k) {\n            colorValues[ci++] = Color.floatToByte(color.red);\n            colorValues[ci++] = Color.floatToByte(color.green);\n            colorValues[ci++] = Color.floatToByte(color.blue);\n            colorValues[ci++] = Color.floatToByte(color.alpha);\n          }\n        }\n\n        positionValues.set(pos, offset);\n        offset += pos.length;\n      }\n    } else {\n      generateArcOptions.positions = positions;\n      generateArcOptions.height = heights;\n      positionValues = new Float64Array(\n        generateArcFunction(generateArcOptions)\n      );\n\n      if (defined(colors)) {\n        colorValues = new Uint8Array((positionValues.length / 3) * 4);\n\n        for (i = 0; i < length - 1; ++i) {\n          const p0 = positions[i];\n          const p1 = positions[i + 1];\n          const c0 = colors[i];\n          const c1 = colors[i + 1];\n          offset = interpolateColors(\n            p0,\n            p1,\n            c0,\n            c1,\n            minDistance,\n            colorValues,\n            offset\n          );\n        }\n\n        const lastColor = colors[length - 1];\n        colorValues[offset++] = Color.floatToByte(lastColor.red);\n        colorValues[offset++] = Color.floatToByte(lastColor.green);\n        colorValues[offset++] = Color.floatToByte(lastColor.blue);\n        colorValues[offset++] = Color.floatToByte(lastColor.alpha);\n      }\n    }\n  } else {\n    numberOfPositions = perSegmentColors ? length * 2 - 2 : length;\n    positionValues = new Float64Array(numberOfPositions * 3);\n    colorValues = defined(colors)\n      ? new Uint8Array(numberOfPositions * 4)\n      : undefined;\n\n    let positionIndex = 0;\n    let colorIndex = 0;\n\n    for (i = 0; i < length; ++i) {\n      const p = positions[i];\n\n      if (perSegmentColors && i > 0) {\n        Cartesian3.pack(p, positionValues, positionIndex);\n        positionIndex += 3;\n\n        color = colors[i - 1];\n        colorValues[colorIndex++] = Color.floatToByte(color.red);\n        colorValues[colorIndex++] = Color.floatToByte(color.green);\n        colorValues[colorIndex++] = Color.floatToByte(color.blue);\n        colorValues[colorIndex++] = Color.floatToByte(color.alpha);\n      }\n\n      if (perSegmentColors && i === length - 1) {\n        break;\n      }\n\n      Cartesian3.pack(p, positionValues, positionIndex);\n      positionIndex += 3;\n\n      if (defined(colors)) {\n        color = colors[i];\n        colorValues[colorIndex++] = Color.floatToByte(color.red);\n        colorValues[colorIndex++] = Color.floatToByte(color.green);\n        colorValues[colorIndex++] = Color.floatToByte(color.blue);\n        colorValues[colorIndex++] = Color.floatToByte(color.alpha);\n      }\n    }\n  }\n\n  const attributes = new GeometryAttributes();\n  attributes.position = new GeometryAttribute({\n    componentDatatype: ComponentDatatype.DOUBLE,\n    componentsPerAttribute: 3,\n    values: positionValues,\n  });\n\n  if (defined(colors)) {\n    attributes.color = new GeometryAttribute({\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      componentsPerAttribute: 4,\n      values: colorValues,\n      normalize: true,\n    });\n  }\n\n  numberOfPositions = positionValues.length / 3;\n  const numberOfIndices = (numberOfPositions - 1) * 2;\n  const indices = IndexDatatype.createTypedArray(\n    numberOfPositions,\n    numberOfIndices\n  );\n\n  let index = 0;\n  for (i = 0; i < numberOfPositions - 1; ++i) {\n    indices[index++] = i;\n    indices[index++] = i + 1;\n  }\n\n  return new Geometry({\n    attributes: attributes,\n    indices: indices,\n    primitiveType: PrimitiveType.LINES,\n    boundingSphere: BoundingSphere.fromPoints(positions),\n  });\n};\nexport default SimplePolylineGeometry;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport EllipsoidGeometry from \"./EllipsoidGeometry.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\n/**\n * A description of a sphere centered at the origin.\n *\n * @alias SphereGeometry\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {number} [options.radius=1.0] The radius of the sphere.\n * @param {number} [options.stackPartitions=64] The number of times to partition the ellipsoid into stacks.\n * @param {number} [options.slicePartitions=64] The number of times to partition the ellipsoid into radial slices.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @exception {DeveloperError} options.slicePartitions cannot be less than three.\n * @exception {DeveloperError} options.stackPartitions cannot be less than three.\n *\n * @see SphereGeometry#createGeometry\n *\n * @example\n * const sphere = new Cesium.SphereGeometry({\n *   radius : 100.0,\n *   vertexFormat : Cesium.VertexFormat.POSITION_ONLY\n * });\n * const geometry = Cesium.SphereGeometry.createGeometry(sphere);\n */\nfunction SphereGeometry(options) {\n  const radius = defaultValue(options.radius, 1.0);\n  const radii = new Cartesian3(radius, radius, radius);\n  const ellipsoidOptions = {\n    radii: radii,\n    stackPartitions: options.stackPartitions,\n    slicePartitions: options.slicePartitions,\n    vertexFormat: options.vertexFormat,\n  };\n\n  this._ellipsoidGeometry = new EllipsoidGeometry(ellipsoidOptions);\n  this._workerName = \"createSphereGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {number}\n */\nSphereGeometry.packedLength = EllipsoidGeometry.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {SphereGeometry} value The value to pack.\n * @param {number[]} array The array to pack into.\n * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {number[]} The array that was packed into\n */\nSphereGeometry.pack = function (value, array, startingIndex) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"value\", value);\n  //>>includeEnd('debug');\n\n  return EllipsoidGeometry.pack(value._ellipsoidGeometry, array, startingIndex);\n};\n\nconst scratchEllipsoidGeometry = new EllipsoidGeometry();\nconst scratchOptions = {\n  radius: undefined,\n  radii: new Cartesian3(),\n  vertexFormat: new VertexFormat(),\n  stackPartitions: undefined,\n  slicePartitions: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {number[]} array The packed array.\n * @param {number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {SphereGeometry} [result] The object into which to store the result.\n * @returns {SphereGeometry} The modified result parameter or a new SphereGeometry instance if one was not provided.\n */\nSphereGeometry.unpack = function (array, startingIndex, result) {\n  const ellipsoidGeometry = EllipsoidGeometry.unpack(\n    array,\n    startingIndex,\n    scratchEllipsoidGeometry\n  );\n  scratchOptions.vertexFormat = VertexFormat.clone(\n    ellipsoidGeometry._vertexFormat,\n    scratchOptions.vertexFormat\n  );\n  scratchOptions.stackPartitions = ellipsoidGeometry._stackPartitions;\n  scratchOptions.slicePartitions = ellipsoidGeometry._slicePartitions;\n\n  if (!defined(result)) {\n    scratchOptions.radius = ellipsoidGeometry._radii.x;\n    return new SphereGeometry(scratchOptions);\n  }\n\n  Cartesian3.clone(ellipsoidGeometry._radii, scratchOptions.radii);\n  result._ellipsoidGeometry = new EllipsoidGeometry(scratchOptions);\n  return result;\n};\n\n/**\n * Computes the geometric representation of a sphere, including its vertices, indices, and a bounding sphere.\n *\n * @param {SphereGeometry} sphereGeometry A description of the sphere.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nSphereGeometry.createGeometry = function (sphereGeometry) {\n  return EllipsoidGeometry.createGeometry(sphereGeometry._ellipsoidGeometry);\n};\nexport default SphereGeometry;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * A tiling scheme for geometry or imagery on the surface of an ellipsoid.  At level-of-detail zero,\n * the coarsest, least-detailed level, the number of tiles is configurable.\n * At level of detail one, each of the level zero tiles has four children, two in each direction.\n * At level of detail two, each of the level one tiles has four children, two in each direction.\n * This continues for as many levels as are present in the geometry or imagery source.\n *\n * @alias TilingScheme\n * @constructor\n *\n * @see WebMercatorTilingScheme\n * @see GeographicTilingScheme\n */\nfunction TilingScheme(options) {\n  //>>includeStart('debug', pragmas.debug);\n  throw new DeveloperError(\n    \"This type should not be instantiated directly.  Instead, use WebMercatorTilingScheme or GeographicTilingScheme.\"\n  );\n  //>>includeEnd('debug');\n}\n\nObject.defineProperties(TilingScheme.prototype, {\n  /**\n   * Gets the ellipsoid that is tiled by the tiling scheme.\n   * @memberof TilingScheme.prototype\n   * @type {Ellipsoid}\n   */\n  ellipsoid: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the rectangle, in radians, covered by this tiling scheme.\n   * @memberof TilingScheme.prototype\n   * @type {Rectangle}\n   */\n  rectangle: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the map projection used by the tiling scheme.\n   * @memberof TilingScheme.prototype\n   * @type {MapProjection}\n   */\n  projection: {\n    get: DeveloperError.throwInstantiationError,\n  },\n});\n\n/**\n * Gets the total number of tiles in the X direction at a specified level-of-detail.\n * @function\n *\n * @param {number} level The level-of-detail.\n * @returns {number} The number of tiles in the X direction at the given level.\n */\nTilingScheme.prototype.getNumberOfXTilesAtLevel =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Gets the total number of tiles in the Y direction at a specified level-of-detail.\n * @function\n *\n * @param {number} level The level-of-detail.\n * @returns {number} The number of tiles in the Y direction at the given level.\n */\nTilingScheme.prototype.getNumberOfYTilesAtLevel =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Transforms a rectangle specified in geodetic radians to the native coordinate system\n * of this tiling scheme.\n * @function\n *\n * @param {Rectangle} rectangle The rectangle to transform.\n * @param {Rectangle} [result] The instance to which to copy the result, or undefined if a new instance\n *        should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the native rectangle if 'result'\n *          is undefined.\n */\nTilingScheme.prototype.rectangleToNativeRectangle =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates\n * of the tiling scheme.\n * @function\n *\n * @param {number} x The integer x coordinate of the tile.\n * @param {number} y The integer y coordinate of the tile.\n * @param {number} level The tile level-of-detail.  Zero is the least detailed.\n * @param {object} [result] The instance to which to copy the result, or undefined if a new instance\n *        should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the rectangle\n *          if 'result' is undefined.\n */\nTilingScheme.prototype.tileXYToNativeRectangle =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Converts tile x, y coordinates and level to a cartographic rectangle in radians.\n * @function\n *\n * @param {number} x The integer x coordinate of the tile.\n * @param {number} y The integer y coordinate of the tile.\n * @param {number} level The tile level-of-detail.  Zero is the least detailed.\n * @param {object} [result] The instance to which to copy the result, or undefined if a new instance\n *        should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the rectangle\n *          if 'result' is undefined.\n */\nTilingScheme.prototype.tileXYToRectangle =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Calculates the tile x, y coordinates of the tile containing\n * a given cartographic position.\n * @function\n *\n * @param {Cartographic} position The position.\n * @param {number} level The tile level-of-detail.  Zero is the least detailed.\n * @param {Cartesian2} [result] The instance to which to copy the result, or undefined if a new instance\n *        should be created.\n * @returns {Cartesian2} The specified 'result', or a new object containing the tile x, y coordinates\n *          if 'result' is undefined.\n */\nTilingScheme.prototype.positionToTileXY =\n  DeveloperError.throwInstantiationError;\nexport default TilingScheme;\n", "import Check from \"./Check.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Event from \"./Event.js\";\nimport GeographicTilingScheme from \"./GeographicTilingScheme.js\";\nimport getImagePixels from \"./getImagePixels.js\";\nimport HeightmapTerrainData from \"./HeightmapTerrainData.js\";\nimport CesiumMath from \"./Math.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Resource from \"./Resource.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TerrainProvider from \"./TerrainProvider.js\";\nimport TileProviderError from \"./TileProviderError.js\";\n\nfunction DataRectangle(rectangle, maxLevel) {\n  this.rectangle = rectangle;\n  this.maxLevel = maxLevel;\n}\n\n/**\n * @typedef {Object} VRTheWorldTerrainProvider.ConstructorOptions\n *\n * Initialization options for the VRTheWorldTerrainProvider constructor\n *\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If not specified, the WGS84 ellipsoid is used.\n * @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.\n */\n\n/**\n * Used to track creation details while fetching initial metadata\n *\n * @constructor\n * @private\n *\n * @param {VRTheWorldTerrainProvider.ConstructorOptions} options An object describing initialization options\n */\nfunction TerrainProviderBuilder(options) {\n  this.ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n  this.tilingScheme = undefined;\n  this.heightmapWidth = undefined;\n  this.heightmapHeight = undefined;\n  this.levelZeroMaximumGeometricError = undefined;\n  this.rectangles = [];\n}\n\nTerrainProviderBuilder.prototype.build = function (provider) {\n  provider._tilingScheme = this.tilingScheme;\n  provider._heightmapWidth = this.heightmapWidth;\n  provider._heightmapHeight = this.heightmapHeight;\n  provider._levelZeroMaximumGeometricError = this.levelZeroMaximumGeometricError;\n  provider._rectangles = this.rectangles;\n};\n\nfunction metadataSuccess(terrainProviderBuilder, xml) {\n  const srs = xml.getElementsByTagName(\"SRS\")[0].textContent;\n  if (srs === \"EPSG:4326\") {\n    terrainProviderBuilder.tilingScheme = new GeographicTilingScheme({\n      ellipsoid: terrainProviderBuilder.ellipsoid,\n    });\n  } else {\n    throw new RuntimeError(`SRS ${srs} is not supported`);\n  }\n\n  const tileFormat = xml.getElementsByTagName(\"TileFormat\")[0];\n  terrainProviderBuilder.heightmapWidth = parseInt(\n    tileFormat.getAttribute(\"width\"),\n    10\n  );\n  terrainProviderBuilder.heightmapHeight = parseInt(\n    tileFormat.getAttribute(\"height\"),\n    10\n  );\n  terrainProviderBuilder.levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(\n    terrainProviderBuilder.ellipsoid,\n    Math.min(\n      terrainProviderBuilder.heightmapWidth,\n      terrainProviderBuilder.heightmapHeight\n    ),\n    terrainProviderBuilder.tilingScheme.getNumberOfXTilesAtLevel(0)\n  );\n\n  const dataRectangles = xml.getElementsByTagName(\"DataExtent\");\n\n  for (let i = 0; i < dataRectangles.length; ++i) {\n    const dataRectangle = dataRectangles[i];\n\n    const west = CesiumMath.toRadians(\n      parseFloat(dataRectangle.getAttribute(\"minx\"))\n    );\n    const south = CesiumMath.toRadians(\n      parseFloat(dataRectangle.getAttribute(\"miny\"))\n    );\n    const east = CesiumMath.toRadians(\n      parseFloat(dataRectangle.getAttribute(\"maxx\"))\n    );\n    const north = CesiumMath.toRadians(\n      parseFloat(dataRectangle.getAttribute(\"maxy\"))\n    );\n    const maxLevel = parseInt(dataRectangle.getAttribute(\"maxlevel\"), 10);\n\n    terrainProviderBuilder.rectangles.push(\n      new DataRectangle(new Rectangle(west, south, east, north), maxLevel)\n    );\n  }\n}\n\nfunction metadataFailure(resource, error, provider) {\n  let message = `An error occurred while accessing ${resource.url}`;\n\n  if (defined(error) && defined(error.message)) {\n    message = `${message}: ${error.message}`;\n  }\n\n  TileProviderError.reportError(\n    undefined,\n    provider,\n    defined(provider) ? provider._errorEvent : undefined,\n    message\n  );\n\n  throw new RuntimeError(message);\n}\n\nasync function requestMetadata(terrainProviderBuilder, resource, provider) {\n  try {\n    const xml = await resource.fetchXML();\n    metadataSuccess(terrainProviderBuilder, xml);\n  } catch (error) {\n    metadataFailure(resource, error, provider);\n  }\n}\n\n/**\n * <div class=\"notice\">\n * To construct a VRTheWorldTerrainProvider, call {@link VRTheWorldTerrainProvider.fromUrl}. Do not call the constructor directly.\n * </div>\n *\n * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps\n * retrieved from a {@link http://vr-theworld.com/|VT M\u00C4K VR-TheWorld server}.\n *\n * @alias VRTheWorldTerrainProvider\n * @constructor\n *\n * @param {VRTheWorldTerrainProvider.ConstructorOptions} [options] An object describing initialization options.\n *\n * @example\n * const terrainProvider = await Cesium.VRTheWorldTerrainProvider.fromUrl(\n *   \"https://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/\"\n * );\n * viewer.terrainProvider = terrainProvider;\n *\n * @see TerrainProvider\n */\nfunction VRTheWorldTerrainProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._errorEvent = new Event();\n\n  this._terrainDataStructure = {\n    heightScale: 1.0 / 1000.0,\n    heightOffset: -1000.0,\n    elementsPerHeight: 3,\n    stride: 4,\n    elementMultiplier: 256.0,\n    isBigEndian: true,\n    lowestEncodedHeight: 0,\n    highestEncodedHeight: 256 * 256 * 256 - 1,\n  };\n\n  let credit = options.credit;\n  if (typeof credit === \"string\") {\n    credit = new Credit(credit);\n  }\n  this._credit = credit;\n\n  this._tilingScheme = undefined;\n  this._rectangles = [];\n}\n\nObject.defineProperties(VRTheWorldTerrainProvider.prototype, {\n  /**\n   * Gets an event that is raised when the terrain provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof VRTheWorldTerrainProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this terrain provider is active.  Typically this is used to credit\n   * the source of the terrain.\n   * @memberof VRTheWorldTerrainProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof VRTheWorldTerrainProvider.prototype\n   * @type {GeographicTilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the provider includes a water mask.  The water mask\n   * indicates which areas of the globe are water rather than land, so they can be rendered\n   * as a reflective surface with animated waves.\n   * @memberof VRTheWorldTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasWaterMask: {\n    get: function () {\n      return false;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the requested tiles include vertex normals.\n   * @memberof VRTheWorldTerrainProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasVertexNormals: {\n    get: function () {\n      return false;\n    },\n  },\n  /**\n   * Gets an object that can be used to determine availability of terrain from this provider, such as\n   * at points and in rectangles. This property may be undefined if availability\n   * information is not available.\n   * @memberof VRTheWorldTerrainProvider.prototype\n   * @type {TileAvailability}\n   * @readonly\n   */\n  availability: {\n    get: function () {\n      return undefined;\n    },\n  },\n});\n\n/**\n * Creates a {@link TerrainProvider} that produces terrain geometry by tessellating height maps\n * retrieved from a {@link http://vr-theworld.com/|VT M\u00C4K VR-TheWorld server}.\n *\n * @param {Resource|String} url The URL of the VR-TheWorld TileMap.\n * @param {VRTheWorldTerrainProvider.ConstructorOptions} [options] An object describing initialization options.\n * @returns {Promise<VRTheWorldTerrainProvider>}\n *\n * @example\n * const terrainProvider = await Cesium.VRTheWorldTerrainProvider.fromUrl(\n *   \"https://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/\"\n * );\n * viewer.terrainProvider = terrainProvider;\n *\n * @exception {RuntimeError} metadata specifies and unknown SRS\n */\nVRTheWorldTerrainProvider.fromUrl = async function (url, options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"url\", url);\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const terrainProviderBuilder = new TerrainProviderBuilder(options);\n  const resource = Resource.createIfNeeded(url);\n\n  await requestMetadata(terrainProviderBuilder, resource);\n\n  const provider = new VRTheWorldTerrainProvider(options);\n  terrainProviderBuilder.build(provider);\n  provider._resource = resource;\n\n  return provider;\n};\n\n/**\n * Requests the geometry for a given tile. The result includes terrain\n * data and indicates that all child tiles are available.\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<TerrainData>|undefined} A promise for the requested geometry.  If this method\n *          returns undefined instead of a promise, it is an indication that too many requests are already\n *          pending and the request will be retried later.\n */\nVRTheWorldTerrainProvider.prototype.requestTileGeometry = function (\n  x,\n  y,\n  level,\n  request\n) {\n  const yTiles = this._tilingScheme.getNumberOfYTilesAtLevel(level);\n  const resource = this._resource.getDerivedResource({\n    url: `${level}/${x}/${yTiles - y - 1}.tif`,\n    queryParameters: {\n      cesium: true,\n    },\n    request: request,\n  });\n  const promise = resource.fetchImage({\n    preferImageBitmap: true,\n  });\n  if (!defined(promise)) {\n    return undefined;\n  }\n\n  const that = this;\n  return Promise.resolve(promise).then(function (image) {\n    return new HeightmapTerrainData({\n      buffer: getImagePixels(image),\n      width: that._heightmapWidth,\n      height: that._heightmapHeight,\n      childTileMask: getChildMask(that, x, y, level),\n      structure: that._terrainDataStructure,\n    });\n  });\n};\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level.\n *\n * @param {number} level The tile level for which to get the maximum geometric error.\n * @returns {number} The maximum geometric error.\n */\nVRTheWorldTerrainProvider.prototype.getLevelMaximumGeometricError = function (\n  level\n) {\n  return this._levelZeroMaximumGeometricError / (1 << level);\n};\n\nconst rectangleScratch = new Rectangle();\n\nfunction getChildMask(provider, x, y, level) {\n  const tilingScheme = provider._tilingScheme;\n  const rectangles = provider._rectangles;\n  const parentRectangle = tilingScheme.tileXYToRectangle(x, y, level);\n\n  let childMask = 0;\n\n  for (let i = 0; i < rectangles.length && childMask !== 15; ++i) {\n    const rectangle = rectangles[i];\n    if (rectangle.maxLevel <= level) {\n      continue;\n    }\n\n    const testRectangle = rectangle.rectangle;\n\n    const intersection = Rectangle.intersection(\n      testRectangle,\n      parentRectangle,\n      rectangleScratch\n    );\n    if (defined(intersection)) {\n      // Parent tile is inside this rectangle, so at least one child is, too.\n      if (\n        isTileInRectangle(tilingScheme, testRectangle, x * 2, y * 2, level + 1)\n      ) {\n        childMask |= 4; // northwest\n      }\n      if (\n        isTileInRectangle(\n          tilingScheme,\n          testRectangle,\n          x * 2 + 1,\n          y * 2,\n          level + 1\n        )\n      ) {\n        childMask |= 8; // northeast\n      }\n      if (\n        isTileInRectangle(\n          tilingScheme,\n          testRectangle,\n          x * 2,\n          y * 2 + 1,\n          level + 1\n        )\n      ) {\n        childMask |= 1; // southwest\n      }\n      if (\n        isTileInRectangle(\n          tilingScheme,\n          testRectangle,\n          x * 2 + 1,\n          y * 2 + 1,\n          level + 1\n        )\n      ) {\n        childMask |= 2; // southeast\n      }\n    }\n  }\n\n  return childMask;\n}\n\nfunction isTileInRectangle(tilingScheme, rectangle, x, y, level) {\n  const tileRectangle = tilingScheme.tileXYToRectangle(x, y, level);\n  return defined(\n    Rectangle.intersection(tileRectangle, rectangle, rectangleScratch)\n  );\n}\n\n/**\n * Determines whether data for a tile is available to be loaded.\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @returns {boolean|undefined} Undefined if not supported, otherwise true or false.\n */\nVRTheWorldTerrainProvider.prototype.getTileDataAvailable = function (\n  x,\n  y,\n  level\n) {\n  return undefined;\n};\n\n/**\n * Makes sure we load availability data for a tile\n *\n * @param {number} x The X coordinate of the tile for which to request geometry.\n * @param {number} y The Y coordinate of the tile for which to request geometry.\n * @param {number} level The level of the tile for which to request geometry.\n * @returns {undefined|Promise<void>} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded\n */\nVRTheWorldTerrainProvider.prototype.loadTileDataAvailability = function (\n  x,\n  y,\n  level\n) {\n  return undefined;\n};\nexport default VRTheWorldTerrainProvider;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport destroyObject from \"./destroyObject.js\";\nimport Iso8601 from \"./Iso8601.js\";\nimport JulianDate from \"./JulianDate.js\";\n\n/**\n * Synchronizes a video element with a simulation clock.\n *\n * @alias VideoSynchronizer\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Clock} [options.clock] The clock instance used to drive the video.\n * @param {HTMLVideoElement} [options.element] The video element to be synchronized.\n * @param {JulianDate} [options.epoch=Iso8601.MINIMUM_VALUE] The simulation time that marks the start of the video.\n * @param {number} [options.tolerance=1.0] The maximum amount of time, in seconds, that the clock and video can diverge.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Video.html|Video Material Demo}\n */\nfunction VideoSynchronizer(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._clock = undefined;\n  this._element = undefined;\n  this._clockSubscription = undefined;\n  this._seekFunction = undefined;\n  this._lastPlaybackRate = undefined;\n\n  this.clock = options.clock;\n  this.element = options.element;\n\n  /**\n   * Gets or sets the simulation time that marks the start of the video.\n   * @type {JulianDate}\n   * @default Iso8601.MINIMUM_VALUE\n   */\n  this.epoch = defaultValue(options.epoch, Iso8601.MINIMUM_VALUE);\n\n  /**\n   * Gets or sets the amount of time in seconds the video's currentTime\n   * and the clock's currentTime can diverge before a video seek is performed.\n   * Lower values make the synchronization more accurate but video\n   * performance might suffer.  Higher values provide better performance\n   * but at the cost of accuracy.\n   * @type {number}\n   * @default 1.0\n   */\n  this.tolerance = defaultValue(options.tolerance, 1.0);\n\n  this._seeking = false;\n  this._seekFunction = undefined;\n  this._firstTickAfterSeek = false;\n}\n\nObject.defineProperties(VideoSynchronizer.prototype, {\n  /**\n   * Gets or sets the clock used to drive the video element.\n   *\n   * @memberof VideoSynchronizer.prototype\n   * @type {Clock}\n   */\n  clock: {\n    get: function () {\n      return this._clock;\n    },\n    set: function (value) {\n      const oldValue = this._clock;\n\n      if (oldValue === value) {\n        return;\n      }\n\n      if (defined(oldValue)) {\n        this._clockSubscription();\n        this._clockSubscription = undefined;\n      }\n\n      if (defined(value)) {\n        this._clockSubscription = value.onTick.addEventListener(\n          VideoSynchronizer.prototype._onTick,\n          this\n        );\n      }\n\n      this._clock = value;\n    },\n  },\n  /**\n   * Gets or sets the video element to synchronize.\n   *\n   * @memberof VideoSynchronizer.prototype\n   * @type {HTMLVideoElement}\n   */\n  element: {\n    get: function () {\n      return this._element;\n    },\n    set: function (value) {\n      const oldValue = this._element;\n\n      if (oldValue === value) {\n        return;\n      }\n\n      if (defined(oldValue)) {\n        oldValue.removeEventListener(\"seeked\", this._seekFunction, false);\n      }\n\n      if (defined(value)) {\n        this._seeking = false;\n        this._seekFunction = createSeekFunction(this);\n        value.addEventListener(\"seeked\", this._seekFunction, false);\n      }\n\n      this._element = value;\n      this._seeking = false;\n      this._firstTickAfterSeek = false;\n    },\n  },\n});\n\n/**\n * Destroys and resources used by the object.  Once an object is destroyed, it should not be used.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nVideoSynchronizer.prototype.destroy = function () {\n  this.element = undefined;\n  this.clock = undefined;\n  return destroyObject(this);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n */\nVideoSynchronizer.prototype.isDestroyed = function () {\n  return false;\n};\n\nVideoSynchronizer.prototype._trySetPlaybackRate = function (clock) {\n  if (this._lastPlaybackRate === clock.multiplier) {\n    return;\n  }\n\n  const element = this._element;\n  try {\n    element.playbackRate = clock.multiplier;\n  } catch (error) {\n    // Seek manually for unsupported playbackRates.\n    element.playbackRate = 0.0;\n  }\n  this._lastPlaybackRate = clock.multiplier;\n};\n\nVideoSynchronizer.prototype._onTick = function (clock) {\n  const element = this._element;\n  if (!defined(element) || element.readyState < 2) {\n    return;\n  }\n\n  const paused = element.paused;\n  const shouldAnimate = clock.shouldAnimate;\n  if (shouldAnimate === paused) {\n    if (shouldAnimate) {\n      element.play();\n    } else {\n      element.pause();\n    }\n  }\n\n  //We need to avoid constant seeking or the video will\n  //never contain a complete frame for us to render.\n  //So don't do anything if we're seeing or on the first\n  //tick after a seek (the latter of which allows the frame\n  //to actually be rendered.\n  if (this._seeking || this._firstTickAfterSeek) {\n    this._firstTickAfterSeek = false;\n    return;\n  }\n\n  this._trySetPlaybackRate(clock);\n\n  const clockTime = clock.currentTime;\n  const epoch = defaultValue(this.epoch, Iso8601.MINIMUM_VALUE);\n  let videoTime = JulianDate.secondsDifference(clockTime, epoch);\n\n  const duration = element.duration;\n  let desiredTime;\n  const currentTime = element.currentTime;\n  if (element.loop) {\n    videoTime = videoTime % duration;\n    if (videoTime < 0.0) {\n      videoTime = duration - videoTime;\n    }\n    desiredTime = videoTime;\n  } else if (videoTime > duration) {\n    desiredTime = duration;\n  } else if (videoTime < 0.0) {\n    desiredTime = 0.0;\n  } else {\n    desiredTime = videoTime;\n  }\n\n  //If the playing video's time and the scene's clock time\n  //ever drift too far apart, we want to set the video to match\n  const tolerance = shouldAnimate ? defaultValue(this.tolerance, 1.0) : 0.001;\n  if (Math.abs(desiredTime - currentTime) > tolerance) {\n    this._seeking = true;\n    element.currentTime = desiredTime;\n  }\n};\n\nfunction createSeekFunction(that) {\n  return function () {\n    that._seeking = false;\n    that._firstTickAfterSeek = true;\n  };\n}\nexport default VideoSynchronizer;\n", "/**\n * Enum containing Vulkan Constant values by name.\n *\n * These match the constants from the {@link https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-definition|Vulkan 1.2 specification}.\n *\n * @enum {number}\n * @private\n */\nconst VulkanConstants = {\n  VK_FORMAT_UNDEFINED: 0,\n  VK_FORMAT_R4G4_UNORM_PACK8: 1,\n  VK_FORMAT_R4G4B4A4_UNORM_PACK16: 2,\n  VK_FORMAT_B4G4R4A4_UNORM_PACK16: 3,\n  VK_FORMAT_R5G6B5_UNORM_PACK16: 4,\n  VK_FORMAT_B5G6R5_UNORM_PACK16: 5,\n  VK_FORMAT_R5G5B5A1_UNORM_PACK16: 6,\n  VK_FORMAT_B5G5R5A1_UNORM_PACK16: 7,\n  VK_FORMAT_A1R5G5B5_UNORM_PACK16: 8,\n  VK_FORMAT_R8_UNORM: 9,\n  VK_FORMAT_R8_SNORM: 10,\n  VK_FORMAT_R8_USCALED: 11,\n  VK_FORMAT_R8_SSCALED: 12,\n  VK_FORMAT_R8_UINT: 13,\n  VK_FORMAT_R8_SINT: 14,\n  VK_FORMAT_R8_SRGB: 15,\n  VK_FORMAT_R8G8_UNORM: 16,\n  VK_FORMAT_R8G8_SNORM: 17,\n  VK_FORMAT_R8G8_USCALED: 18,\n  VK_FORMAT_R8G8_SSCALED: 19,\n  VK_FORMAT_R8G8_UINT: 20,\n  VK_FORMAT_R8G8_SINT: 21,\n  VK_FORMAT_R8G8_SRGB: 22,\n  VK_FORMAT_R8G8B8_UNORM: 23,\n  VK_FORMAT_R8G8B8_SNORM: 24,\n  VK_FORMAT_R8G8B8_USCALED: 25,\n  VK_FORMAT_R8G8B8_SSCALED: 26,\n  VK_FORMAT_R8G8B8_UINT: 27,\n  VK_FORMAT_R8G8B8_SINT: 28,\n  VK_FORMAT_R8G8B8_SRGB: 29,\n  VK_FORMAT_B8G8R8_UNORM: 30,\n  VK_FORMAT_B8G8R8_SNORM: 31,\n  VK_FORMAT_B8G8R8_USCALED: 32,\n  VK_FORMAT_B8G8R8_SSCALED: 33,\n  VK_FORMAT_B8G8R8_UINT: 34,\n  VK_FORMAT_B8G8R8_SINT: 35,\n  VK_FORMAT_B8G8R8_SRGB: 36,\n  VK_FORMAT_R8G8B8A8_UNORM: 37,\n  VK_FORMAT_R8G8B8A8_SNORM: 38,\n  VK_FORMAT_R8G8B8A8_USCALED: 39,\n  VK_FORMAT_R8G8B8A8_SSCALED: 40,\n  VK_FORMAT_R8G8B8A8_UINT: 41,\n  VK_FORMAT_R8G8B8A8_SINT: 42,\n  VK_FORMAT_R8G8B8A8_SRGB: 43,\n  VK_FORMAT_B8G8R8A8_UNORM: 44,\n  VK_FORMAT_B8G8R8A8_SNORM: 45,\n  VK_FORMAT_B8G8R8A8_USCALED: 46,\n  VK_FORMAT_B8G8R8A8_SSCALED: 47,\n  VK_FORMAT_B8G8R8A8_UINT: 48,\n  VK_FORMAT_B8G8R8A8_SINT: 49,\n  VK_FORMAT_B8G8R8A8_SRGB: 50,\n  VK_FORMAT_A8B8G8R8_UNORM_PACK32: 51,\n  VK_FORMAT_A8B8G8R8_SNORM_PACK32: 52,\n  VK_FORMAT_A8B8G8R8_USCALED_PACK32: 53,\n  VK_FORMAT_A8B8G8R8_SSCALED_PACK32: 54,\n  VK_FORMAT_A8B8G8R8_UINT_PACK32: 55,\n  VK_FORMAT_A8B8G8R8_SINT_PACK32: 56,\n  VK_FORMAT_A8B8G8R8_SRGB_PACK32: 57,\n  VK_FORMAT_A2R10G10B10_UNORM_PACK32: 58,\n  VK_FORMAT_A2R10G10B10_SNORM_PACK32: 59,\n  VK_FORMAT_A2R10G10B10_USCALED_PACK32: 60,\n  VK_FORMAT_A2R10G10B10_SSCALED_PACK32: 61,\n  VK_FORMAT_A2R10G10B10_UINT_PACK32: 62,\n  VK_FORMAT_A2R10G10B10_SINT_PACK32: 63,\n  VK_FORMAT_A2B10G10R10_UNORM_PACK32: 64,\n  VK_FORMAT_A2B10G10R10_SNORM_PACK32: 65,\n  VK_FORMAT_A2B10G10R10_USCALED_PACK32: 66,\n  VK_FORMAT_A2B10G10R10_SSCALED_PACK32: 67,\n  VK_FORMAT_A2B10G10R10_UINT_PACK32: 68,\n  VK_FORMAT_A2B10G10R10_SINT_PACK32: 69,\n  VK_FORMAT_R16_UNORM: 70,\n  VK_FORMAT_R16_SNORM: 71,\n  VK_FORMAT_R16_USCALED: 72,\n  VK_FORMAT_R16_SSCALED: 73,\n  VK_FORMAT_R16_UINT: 74,\n  VK_FORMAT_R16_SINT: 75,\n  VK_FORMAT_R16_SFLOAT: 76,\n  VK_FORMAT_R16G16_UNORM: 77,\n  VK_FORMAT_R16G16_SNORM: 78,\n  VK_FORMAT_R16G16_USCALED: 79,\n  VK_FORMAT_R16G16_SSCALED: 80,\n  VK_FORMAT_R16G16_UINT: 81,\n  VK_FORMAT_R16G16_SINT: 82,\n  VK_FORMAT_R16G16_SFLOAT: 83,\n  VK_FORMAT_R16G16B16_UNORM: 84,\n  VK_FORMAT_R16G16B16_SNORM: 85,\n  VK_FORMAT_R16G16B16_USCALED: 86,\n  VK_FORMAT_R16G16B16_SSCALED: 87,\n  VK_FORMAT_R16G16B16_UINT: 88,\n  VK_FORMAT_R16G16B16_SINT: 89,\n  VK_FORMAT_R16G16B16_SFLOAT: 90,\n  VK_FORMAT_R16G16B16A16_UNORM: 91,\n  VK_FORMAT_R16G16B16A16_SNORM: 92,\n  VK_FORMAT_R16G16B16A16_USCALED: 93,\n  VK_FORMAT_R16G16B16A16_SSCALED: 94,\n  VK_FORMAT_R16G16B16A16_UINT: 95,\n  VK_FORMAT_R16G16B16A16_SINT: 96,\n  VK_FORMAT_R16G16B16A16_SFLOAT: 97,\n  VK_FORMAT_R32_UINT: 98,\n  VK_FORMAT_R32_SINT: 99,\n  VK_FORMAT_R32_SFLOAT: 100,\n  VK_FORMAT_R32G32_UINT: 101,\n  VK_FORMAT_R32G32_SINT: 102,\n  VK_FORMAT_R32G32_SFLOAT: 103,\n  VK_FORMAT_R32G32B32_UINT: 104,\n  VK_FORMAT_R32G32B32_SINT: 105,\n  VK_FORMAT_R32G32B32_SFLOAT: 106,\n  VK_FORMAT_R32G32B32A32_UINT: 107,\n  VK_FORMAT_R32G32B32A32_SINT: 108,\n  VK_FORMAT_R32G32B32A32_SFLOAT: 109,\n  VK_FORMAT_R64_UINT: 110,\n  VK_FORMAT_R64_SINT: 111,\n  VK_FORMAT_R64_SFLOAT: 112,\n  VK_FORMAT_R64G64_UINT: 113,\n  VK_FORMAT_R64G64_SINT: 114,\n  VK_FORMAT_R64G64_SFLOAT: 115,\n  VK_FORMAT_R64G64B64_UINT: 116,\n  VK_FORMAT_R64G64B64_SINT: 117,\n  VK_FORMAT_R64G64B64_SFLOAT: 118,\n  VK_FORMAT_R64G64B64A64_UINT: 119,\n  VK_FORMAT_R64G64B64A64_SINT: 120,\n  VK_FORMAT_R64G64B64A64_SFLOAT: 121,\n  VK_FORMAT_B10G11R11_UFLOAT_PACK32: 122,\n  VK_FORMAT_E5B9G9R9_UFLOAT_PACK32: 123,\n  VK_FORMAT_D16_UNORM: 124,\n  VK_FORMAT_X8_D24_UNORM_PACK32: 125,\n  VK_FORMAT_D32_SFLOAT: 126,\n  VK_FORMAT_S8_UINT: 127,\n  VK_FORMAT_D16_UNORM_S8_UINT: 128,\n  VK_FORMAT_D24_UNORM_S8_UINT: 129,\n  VK_FORMAT_D32_SFLOAT_S8_UINT: 130,\n  VK_FORMAT_BC1_RGB_UNORM_BLOCK: 131,\n  VK_FORMAT_BC1_RGB_SRGB_BLOCK: 132,\n  VK_FORMAT_BC1_RGBA_UNORM_BLOCK: 133,\n  VK_FORMAT_BC1_RGBA_SRGB_BLOCK: 134,\n  VK_FORMAT_BC2_UNORM_BLOCK: 135,\n  VK_FORMAT_BC2_SRGB_BLOCK: 136,\n  VK_FORMAT_BC3_UNORM_BLOCK: 137,\n  VK_FORMAT_BC3_SRGB_BLOCK: 138,\n  VK_FORMAT_BC4_UNORM_BLOCK: 139,\n  VK_FORMAT_BC4_SNORM_BLOCK: 140,\n  VK_FORMAT_BC5_UNORM_BLOCK: 141,\n  VK_FORMAT_BC5_SNORM_BLOCK: 142,\n  VK_FORMAT_BC6H_UFLOAT_BLOCK: 143,\n  VK_FORMAT_BC6H_SFLOAT_BLOCK: 144,\n  VK_FORMAT_BC7_UNORM_BLOCK: 145,\n  VK_FORMAT_BC7_SRGB_BLOCK: 146,\n  VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK: 147,\n  VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK: 148,\n  VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK: 149,\n  VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK: 150,\n  VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK: 151,\n  VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK: 152,\n  VK_FORMAT_EAC_R11_UNORM_BLOCK: 153,\n  VK_FORMAT_EAC_R11_SNORM_BLOCK: 154,\n  VK_FORMAT_EAC_R11G11_UNORM_BLOCK: 155,\n  VK_FORMAT_EAC_R11G11_SNORM_BLOCK: 156,\n  VK_FORMAT_ASTC_4x4_UNORM_BLOCK: 157,\n  VK_FORMAT_ASTC_4x4_SRGB_BLOCK: 158,\n  VK_FORMAT_ASTC_5x4_UNORM_BLOCK: 159,\n  VK_FORMAT_ASTC_5x4_SRGB_BLOCK: 160,\n  VK_FORMAT_ASTC_5x5_UNORM_BLOCK: 161,\n  VK_FORMAT_ASTC_5x5_SRGB_BLOCK: 162,\n  VK_FORMAT_ASTC_6x5_UNORM_BLOCK: 163,\n  VK_FORMAT_ASTC_6x5_SRGB_BLOCK: 164,\n  VK_FORMAT_ASTC_6x6_UNORM_BLOCK: 165,\n  VK_FORMAT_ASTC_6x6_SRGB_BLOCK: 166,\n  VK_FORMAT_ASTC_8x5_UNORM_BLOCK: 167,\n  VK_FORMAT_ASTC_8x5_SRGB_BLOCK: 168,\n  VK_FORMAT_ASTC_8x6_UNORM_BLOCK: 169,\n  VK_FORMAT_ASTC_8x6_SRGB_BLOCK: 170,\n  VK_FORMAT_ASTC_8x8_UNORM_BLOCK: 171,\n  VK_FORMAT_ASTC_8x8_SRGB_BLOCK: 172,\n  VK_FORMAT_ASTC_10x5_UNORM_BLOCK: 173,\n  VK_FORMAT_ASTC_10x5_SRGB_BLOCK: 174,\n  VK_FORMAT_ASTC_10x6_UNORM_BLOCK: 175,\n  VK_FORMAT_ASTC_10x6_SRGB_BLOCK: 176,\n  VK_FORMAT_ASTC_10x8_UNORM_BLOCK: 177,\n  VK_FORMAT_ASTC_10x8_SRGB_BLOCK: 178,\n  VK_FORMAT_ASTC_10x10_UNORM_BLOCK: 179,\n  VK_FORMAT_ASTC_10x10_SRGB_BLOCK: 180,\n  VK_FORMAT_ASTC_12x10_UNORM_BLOCK: 181,\n  VK_FORMAT_ASTC_12x10_SRGB_BLOCK: 182,\n  VK_FORMAT_ASTC_12x12_UNORM_BLOCK: 183,\n  VK_FORMAT_ASTC_12x12_SRGB_BLOCK: 184,\n  VK_FORMAT_G8B8G8R8_422_UNORM: 1000156000,\n  VK_FORMAT_B8G8R8G8_422_UNORM: 1000156001,\n  VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM: 1000156002,\n  VK_FORMAT_G8_B8R8_2PLANE_420_UNORM: 1000156003,\n  VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM: 1000156004,\n  VK_FORMAT_G8_B8R8_2PLANE_422_UNORM: 1000156005,\n  VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM: 1000156006,\n  VK_FORMAT_R10X6_UNORM_PACK16: 1000156007,\n  VK_FORMAT_R10X6G10X6_UNORM_2PACK16: 1000156008,\n  VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16: 1000156009,\n  VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: 1000156010,\n  VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: 1000156011,\n  VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: 1000156012,\n  VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: 1000156013,\n  VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: 1000156014,\n  VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: 1000156015,\n  VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: 1000156016,\n  VK_FORMAT_R12X4_UNORM_PACK16: 1000156017,\n  VK_FORMAT_R12X4G12X4_UNORM_2PACK16: 1000156018,\n  VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16: 1000156019,\n  VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: 1000156020,\n  VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: 1000156021,\n  VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: 1000156022,\n  VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: 1000156023,\n  VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: 1000156024,\n  VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: 1000156025,\n  VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: 1000156026,\n  VK_FORMAT_G16B16G16R16_422_UNORM: 1000156027,\n  VK_FORMAT_B16G16R16G16_422_UNORM: 1000156028,\n  VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM: 1000156029,\n  VK_FORMAT_G16_B16R16_2PLANE_420_UNORM: 1000156030,\n  VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM: 1000156031,\n  VK_FORMAT_G16_B16R16_2PLANE_422_UNORM: 1000156032,\n  VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM: 1000156033,\n  VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG: 1000054000,\n  VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG: 1000054001,\n  VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG: 1000054002,\n  VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG: 1000054003,\n  VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG: 1000054004,\n  VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG: 1000054005,\n  VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG: 1000054006,\n  VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG: 1000054007,\n  VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT: 1000066000,\n  VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT: 1000066001,\n  VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT: 1000066002,\n  VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT: 1000066003,\n  VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT: 1000066004,\n  VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT: 1000066005,\n  VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT: 1000066006,\n  VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT: 1000066007,\n  VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT: 1000066008,\n  VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT: 1000066009,\n  VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT: 1000066010,\n  VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT: 1000066011,\n  VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT: 1000066012,\n  VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT: 1000066013,\n  VK_FORMAT_G8B8G8R8_422_UNORM_KHR: 1000156000,\n  VK_FORMAT_B8G8R8G8_422_UNORM_KHR: 1000156001,\n  VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR: 1000156002,\n  VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR: 1000156003,\n  VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR: 1000156004,\n  VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR: 1000156005,\n  VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR: 1000156006,\n  VK_FORMAT_R10X6_UNORM_PACK16_KHR: 1000156007,\n  VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR: 1000156008,\n  VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR: 1000156009,\n  VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR: 1000156010,\n  VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR: 1000156011,\n  VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR: 1000156012,\n  VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR: 1000156013,\n  VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR: 1000156014,\n  VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR: 1000156015,\n  VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR: 1000156016,\n  VK_FORMAT_R12X4_UNORM_PACK16_KHR: 1000156017,\n  VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR: 1000156018,\n  VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR: 1000156019,\n  VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR: 1000156020,\n  VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR: 1000156021,\n  VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR: 1000156022,\n  VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR: 1000156023,\n  VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR: 1000156024,\n  VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR: 1000156025,\n  VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR: 1000156026,\n  VK_FORMAT_G16B16G16R16_422_UNORM_KHR: 1000156027,\n  VK_FORMAT_B16G16R16G16_422_UNORM_KHR: 1000156028,\n  VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR: 1000156029,\n  VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR: 1000156030,\n  VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR: 1000156031,\n  VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR: 1000156032,\n  VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR: 1000156033,\n};\nexport default Object.freeze(VulkanConstants);\n", "import CesiumTerrainProvider from \"./CesiumTerrainProvider.js\";\nimport defaultValue from \"./defaultValue.js\";\n\n/**\n * Creates a {@link CesiumTerrainProvider} instance for the {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}.\n *\n * @function\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.requestVertexNormals=false] Flag that indicates if the client should request additional lighting information from the server if available.\n * @param {Boolean} [options.requestWaterMask=false] Flag that indicates if the client should request per tile water masks from the server if available.\n * @returns {Promise<CesiumTerrainProvider>} A promise that resolves to the created CesiumTerrainProvider\n *\n * @see Ion\n *\n * @example\n * // Create Cesium World Terrain with default settings\n * try {\n *   const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n *     terrainProvider: await Cesium.createWorldTerrainAsync();\n *   });\n * } catch (error) {\n *   console.log(error);\n * }\n *\n * @example\n * // Create Cesium World Terrain with water and normals.\n * try {\n *   const viewer1 = new Cesium.Viewer(\"cesiumContainer\", {\n *     terrainProvider: await Cesium.createWorldTerrainAsync({\n *       requestWaterMask: true,\n *       requestVertexNormals: true\n *     });\n *   });\n * } catch (error) {\n *   console.log(error);\n * }\n *\n */\nfunction createWorldTerrainAsync(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  return CesiumTerrainProvider.fromIonAssetId(1, {\n    requestVertexNormals: defaultValue(options.requestVertexNormals, false),\n    requestWaterMask: defaultValue(options.requestWaterMask, false),\n  });\n}\nexport default createWorldTerrainAsync;\n", "import Check from \"./Check.js\";\nimport RuntimeError from \"./RuntimeError.js\";\n\nconst compressedMagic = 0x7468dead;\nconst compressedMagicSwap = 0xadde6874;\n\n/**\n * Decodes data that is received from the Google Earth Enterprise server.\n *\n * @param {ArrayBuffer} key The key used during decoding.\n * @param {ArrayBuffer} data The data to be decoded.\n *\n * @private\n */\nfunction decodeGoogleEarthEnterpriseData(key, data) {\n  if (decodeGoogleEarthEnterpriseData.passThroughDataForTesting) {\n    return data;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"key\", key);\n  Check.typeOf.object(\"data\", data);\n  //>>includeEnd('debug');\n\n  const keyLength = key.byteLength;\n  if (keyLength === 0 || keyLength % 4 !== 0) {\n    throw new RuntimeError(\n      \"The length of key must be greater than 0 and a multiple of 4.\"\n    );\n  }\n\n  const dataView = new DataView(data);\n  const magic = dataView.getUint32(0, true);\n  if (magic === compressedMagic || magic === compressedMagicSwap) {\n    // Occasionally packets don't come back encoded, so just return\n    return data;\n  }\n\n  const keyView = new DataView(key);\n\n  let dp = 0;\n  const dpend = data.byteLength;\n  const dpend64 = dpend - (dpend % 8);\n  const kpend = keyLength;\n  let kp;\n  let off = 8;\n\n  // This algorithm is intentionally asymmetric to make it more difficult to\n  // guess. Security through obscurity. :-(\n\n  // while we have a full uint64 (8 bytes) left to do\n  // assumes buffer is 64bit aligned (or processor doesn't care)\n  while (dp < dpend64) {\n    // rotate the key each time through by using the offets 16,0,8,16,0,8,...\n    off = (off + 8) % 24;\n    kp = off;\n\n    // run through one key length xor'ing one uint64 at a time\n    // then drop out to rotate the key for the next bit\n    while (dp < dpend64 && kp < kpend) {\n      dataView.setUint32(\n        dp,\n        dataView.getUint32(dp, true) ^ keyView.getUint32(kp, true),\n        true\n      );\n      dataView.setUint32(\n        dp + 4,\n        dataView.getUint32(dp + 4, true) ^ keyView.getUint32(kp + 4, true),\n        true\n      );\n      dp += 8;\n      kp += 24;\n    }\n  }\n\n  // now the remaining 1 to 7 bytes\n  if (dp < dpend) {\n    if (kp >= kpend) {\n      // rotate the key one last time (if necessary)\n      off = (off + 8) % 24;\n      kp = off;\n    }\n\n    while (dp < dpend) {\n      dataView.setUint8(dp, dataView.getUint8(dp) ^ keyView.getUint8(kp));\n      dp++;\n      kp++;\n    }\n  }\n}\n\ndecodeGoogleEarthEnterpriseData.passThroughDataForTesting = false;\nexport default decodeGoogleEarthEnterpriseData;\n", "/**\n * Constructs an image from a TypedArray of pixel values\n *\n * @param {Uint8Array} typedArray The array of pixel values\n * @param {number} width The width of the image to create\n * @param {number} height The height of the image to create\n * @returns {HTMLCanvasElement} A new canvas containing the constructed image\n *\n * @private\n */\nfunction getImageFromTypedArray(typedArray, width, height) {\n  // Input typedArray is Uint8Array, ImageData needs Uint8ClampedArray\n  // To avoid copying, make a new DataView of the same buffer\n  const dataArray = new Uint8ClampedArray(typedArray.buffer);\n  const imageData = new ImageData(dataArray, width, height);\n\n  const canvas = document.createElement(\"canvas\");\n  canvas.width = width;\n  canvas.height = height;\n  canvas.getContext(\"2d\").putImageData(imageData, 0, 0);\n\n  return canvas;\n}\nexport default getImageFromTypedArray;\n", "import barycentricCoordinates from \"./barycentricCoordinates.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport defined from \"./defined.js\";\n\nconst scratchBarycentricCoords = new Cartesian3();\n\n/**\n * Determines if a point is inside a triangle.\n *\n * @function pointInsideTriangle\n *\n * @param {Cartesian2|Cartesian3} point The point to test.\n * @param {Cartesian2|Cartesian3} p0 The first point of the triangle.\n * @param {Cartesian2|Cartesian3} p1 The second point of the triangle.\n * @param {Cartesian2|Cartesian3} p2 The third point of the triangle.\n * @returns {boolean} <code>true</code> if the point is inside the triangle; otherwise, <code>false</code>.\n *\n * @example\n * // Returns true\n * const p = new Cesium.Cartesian2(0.25, 0.25);\n * const b = Cesium.pointInsideTriangle(p,\n *   new Cesium.Cartesian2(0.0, 0.0),\n *   new Cesium.Cartesian2(1.0, 0.0),\n *   new Cesium.Cartesian2(0.0, 1.0));\n */\nfunction pointInsideTriangle(point, p0, p1, p2) {\n  const coords = barycentricCoordinates(\n    point,\n    p0,\n    p1,\n    p2,\n    scratchBarycentricCoords\n  );\n  if (!defined(coords)) {\n    return false;\n  }\n  return coords.x > 0.0 && coords.y > 0.0 && coords.z > 0;\n}\nexport default pointInsideTriangle;\n", "import WebGLConstants from \"./WebGLConstants.js\";\n\nfunction webGLConstantToGlslType(webGLValue) {\n  switch (webGLValue) {\n    case WebGLConstants.FLOAT:\n      return \"float\";\n    case WebGLConstants.FLOAT_VEC2:\n      return \"vec2\";\n    case WebGLConstants.FLOAT_VEC3:\n      return \"vec3\";\n    case WebGLConstants.FLOAT_VEC4:\n      return \"vec4\";\n    case WebGLConstants.FLOAT_MAT2:\n      return \"mat2\";\n    case WebGLConstants.FLOAT_MAT3:\n      return \"mat3\";\n    case WebGLConstants.FLOAT_MAT4:\n      return \"mat4\";\n    case WebGLConstants.SAMPLER_2D:\n      return \"sampler2D\";\n    case WebGLConstants.BOOL:\n      return \"bool\";\n  }\n}\nexport default webGLConstantToGlslType;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Wraps a function on the provided objects with another function called in the\n * object's context so that the new function is always called immediately\n * before the old one.\n *\n * @private\n */\nfunction wrapFunction(obj, oldFunction, newFunction) {\n  //>>includeStart('debug', pragmas.debug);\n  if (typeof oldFunction !== \"function\") {\n    throw new DeveloperError(\"oldFunction is required to be a function.\");\n  }\n\n  if (typeof newFunction !== \"function\") {\n    throw new DeveloperError(\"oldFunction is required to be a function.\");\n  }\n  //>>includeEnd('debug');\n\n  return function () {\n    newFunction.apply(obj, arguments);\n    oldFunction.apply(obj, arguments);\n  };\n}\nexport default wrapFunction;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport CesiumMath from \"../Core/Math.js\";\n\nconst defaultDimensions = new Cartesian3(1.0, 1.0, 1.0);\n\n/**\n * A ParticleEmitter that emits particles within a box.\n * Particles will be positioned randomly within the box and have initial velocities emanating from the center of the box.\n *\n * @alias BoxEmitter\n * @constructor\n *\n * @param {Cartesian3} dimensions The width, height and depth dimensions of the box.\n */\nfunction BoxEmitter(dimensions) {\n  dimensions = defaultValue(dimensions, defaultDimensions);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"dimensions\", dimensions);\n  Check.typeOf.number.greaterThanOrEquals(\"dimensions.x\", dimensions.x, 0.0);\n  Check.typeOf.number.greaterThanOrEquals(\"dimensions.y\", dimensions.y, 0.0);\n  Check.typeOf.number.greaterThanOrEquals(\"dimensions.z\", dimensions.z, 0.0);\n  //>>includeEnd('debug');\n\n  this._dimensions = Cartesian3.clone(dimensions);\n}\n\nObject.defineProperties(BoxEmitter.prototype, {\n  /**\n   * The width, height and depth dimensions of the box in meters.\n   * @memberof BoxEmitter.prototype\n   * @type {Cartesian3}\n   * @default new Cartesian3(1.0, 1.0, 1.0)\n   */\n  dimensions: {\n    get: function () {\n      return this._dimensions;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"value\", value);\n      Check.typeOf.number.greaterThanOrEquals(\"value.x\", value.x, 0.0);\n      Check.typeOf.number.greaterThanOrEquals(\"value.y\", value.y, 0.0);\n      Check.typeOf.number.greaterThanOrEquals(\"value.z\", value.z, 0.0);\n      //>>includeEnd('debug');\n      Cartesian3.clone(value, this._dimensions);\n    },\n  },\n});\n\nconst scratchHalfDim = new Cartesian3();\n\n/**\n * Initializes the given {Particle} by setting it's position and velocity.\n *\n * @private\n * @param {Particle} particle The particle to initialize.\n */\nBoxEmitter.prototype.emit = function (particle) {\n  const dim = this._dimensions;\n  const halfDim = Cartesian3.multiplyByScalar(dim, 0.5, scratchHalfDim);\n\n  const x = CesiumMath.randomBetween(-halfDim.x, halfDim.x);\n  const y = CesiumMath.randomBetween(-halfDim.y, halfDim.y);\n  const z = CesiumMath.randomBetween(-halfDim.z, halfDim.z);\n\n  particle.position = Cartesian3.fromElements(x, y, z, particle.position);\n  particle.velocity = Cartesian3.normalize(\n    particle.position,\n    particle.velocity\n  );\n};\nexport default BoxEmitter;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * The content of a tile in a {@link Cesium3DTileset}.\n * <p>\n * Derived classes of this interface provide access to individual features in the tile.\n * Access derived objects through {@link Cesium3DTile#content}.\n * </p>\n * <p>\n * This type describes an interface and is not intended to be instantiated directly.\n * </p>\n *\n * @alias Cesium3DTileContent\n * @constructor\n */\nfunction Cesium3DTileContent() {\n  /**\n   * Gets or sets if any feature's property changed.  Used to\n   * optimized applying a style when a feature's property changed.\n   * <p>\n   * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n   * not part of the public Cesium API.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @private\n   */\n  this.featurePropertiesDirty = false;\n}\n\nObject.defineProperties(Cesium3DTileContent.prototype, {\n  /**\n   * Gets the number of features in the tile.\n   *\n   * @memberof Cesium3DTileContent.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  featuresLength: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n\n  /**\n   * Gets the number of points in the tile.\n   * <p>\n   * Only applicable for tiles with Point Cloud content. This is different than {@link Cesium3DTileContent#featuresLength} which\n   * equals the number of groups of points as distinguished by the <code>BATCH_ID</code> feature table semantic.\n   * </p>\n   *\n   * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/PointCloud#batched-points}\n   *\n   * @memberof Cesium3DTileContent.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  pointsLength: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n\n  /**\n   * Gets the number of triangles in the tile.\n   *\n   * @memberof Cesium3DTileContent.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  trianglesLength: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n\n  /**\n   * Gets the tile's geometry memory in bytes.\n   *\n   * @memberof Cesium3DTileContent.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  geometryByteLength: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n\n  /**\n   * Gets the tile's texture memory in bytes.\n   *\n   * @memberof Cesium3DTileContent.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  texturesByteLength: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n\n  /**\n   * Gets the amount of memory used by the batch table textures and any binary\n   * metadata properties not accounted for in geometryByteLength or\n   * texturesByteLength\n   *\n   * @memberof Cesium3DTileContent.prototype\n   *\n   * @type {number}\n   * @readonly\n   */\n  batchTableByteLength: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n\n  /**\n   * Gets the array of {@link Cesium3DTileContent} objects for contents that contain other contents, such as composite tiles. The inner contents may in turn have inner contents, such as a composite tile that contains a composite tile.\n   *\n   * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Composite|Composite specification}\n   *\n   * @memberof Cesium3DTileContent.prototype\n   *\n   * @type {Array}\n   * @readonly\n   */\n  innerContents: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n\n  /**\n   * Returns true when the tile's content is ready to render; otherwise false\n   *\n   * @memberof Cesium3DTileContent.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  ready: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n\n  /**\n   * Gets the tileset for this tile.\n   *\n   * @memberof Cesium3DTileContent.prototype\n   *\n   * @type {Cesium3DTileset}\n   * @readonly\n   */\n  tileset: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n\n  /**\n   * Gets the tile containing this content.\n   *\n   * @memberof Cesium3DTileContent.prototype\n   *\n   * @type {Cesium3DTile}\n   * @readonly\n   */\n  tile: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n\n  /**\n   * Gets the url of the tile's content.\n   * @memberof Cesium3DTileContent.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  url: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n\n  /**\n   * Gets the batch table for this content.\n   * <p>\n   * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n   * not part of the public Cesium API.\n   * </p>\n   *\n   * @type {Cesium3DTileBatchTable}\n   * @readonly\n   *\n   * @private\n   */\n  batchTable: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n\n  /**\n   * Gets the metadata for this content, whether it is available explicitly or via\n   * implicit tiling. If there is no metadata, this property should be undefined.\n   * <p>\n   * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n   * not part of the public Cesium API.\n   * </p>\n   *\n   * @type {ImplicitMetadataView|undefined}\n   *\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  metadata: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n    set: function (value) {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n\n  /**\n   * Gets the group for this content if the content has metadata (3D Tiles 1.1) or\n   * if it uses the <code>3DTILES_metadata</code> extension. If neither are present,\n   * this property should be undefined.\n   * <p>\n   * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n   * not part of the public Cesium API.\n   * </p>\n   *\n   * @type {Cesium3DTileContentGroup|undefined}\n   *\n   * @private\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   */\n  group: {\n    // eslint-disable-next-line getter-return\n    get: function () {\n      DeveloperError.throwInstantiationError();\n    },\n    set: function (value) {\n      DeveloperError.throwInstantiationError();\n    },\n  },\n});\n\n/**\n * Returns whether the feature has this property.\n *\n * @param {number} batchId The batchId for the feature.\n * @param {string} name The case-sensitive name of the property.\n * @returns {boolean} <code>true</code> if the feature has this property; otherwise, <code>false</code>.\n */\nCesium3DTileContent.prototype.hasProperty = function (batchId, name) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Returns the {@link Cesium3DTileFeature} object for the feature with the\n * given <code>batchId</code>.  This object is used to get and modify the\n * feature's properties.\n * <p>\n * Features in a tile are ordered by <code>batchId</code>, an index used to retrieve their metadata from the batch table.\n * </p>\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/BatchTable}.\n *\n * @param {number} batchId The batchId for the feature.\n * @returns {Cesium3DTileFeature} The corresponding {@link Cesium3DTileFeature} object.\n *\n * @exception {DeveloperError} batchId must be between zero and {@link Cesium3DTileContent#featuresLength} - 1.\n */\nCesium3DTileContent.prototype.getFeature = function (batchId) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n     * Called when {@link Cesium3DTileset#debugColorizeTiles} changes.\n     * <p>\n     * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n     * not part of the public Cesium API.\n     * </p>\n     *\n     * @param {boolean} enabled Whether to enable or disable debug settings.\n     * @returns {Cesium3DTileFeature} The corresponding {@link Cesium3DTileFeature} object.\n\n     * @private\n     */\nCesium3DTileContent.prototype.applyDebugSettings = function (enabled, color) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Apply a style to the content\n * <p>\n * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n * not part of the public Cesium API.\n * </p>\n *\n * @param {Cesium3DTileStyle} style The style.\n *\n * @private\n */\nCesium3DTileContent.prototype.applyStyle = function (style) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Called by the tile during tileset traversal to get the draw commands needed to render this content.\n * When the tile's content is in the PROCESSING state, this creates WebGL resources to ultimately\n * move to the READY state.\n * <p>\n * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n * not part of the public Cesium API.\n * </p>\n *\n * @param {Cesium3DTileset} tileset The tileset containing this tile.\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nCesium3DTileContent.prototype.update = function (tileset, frameState) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * <p>\n * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n * not part of the public Cesium API.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see Cesium3DTileContent#destroy\n *\n * @private\n */\nCesium3DTileContent.prototype.isDestroyed = function () {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * <p>\n * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n * not part of the public Cesium API.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * content = content && content.destroy();\n *\n * @see Cesium3DTileContent#isDestroyed\n *\n * @private\n */\nCesium3DTileContent.prototype.destroy = function () {\n  DeveloperError.throwInstantiationError();\n};\nexport default Cesium3DTileContent;\n", "import clone from \"../Core/clone.js\";\nimport defined from \"../Core/defined.js\";\nimport Expression from \"./Expression.js\";\n\n/**\n * An expression for a style applied to a {@link Cesium3DTileset}.\n * <p>\n * Evaluates a conditions expression defined using the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.\n * </p>\n * <p>\n * Implements the {@link StyleExpression} interface.\n * </p>\n *\n * @alias ConditionsExpression\n * @constructor\n *\n * @param {object} [conditionsExpression] The conditions expression defined using the 3D Tiles Styling language.\n * @param {object} [defines] Defines in the style.\n *\n * @example\n * const expression = new Cesium.ConditionsExpression({\n *     conditions : [\n *         ['${Area} > 10, 'color(\"#FF0000\")'],\n *         ['${id} !== \"1\"', 'color(\"#00FF00\")'],\n *         ['true', 'color(\"#FFFFFF\")']\n *     ]\n * });\n * expression.evaluateColor(feature, result); // returns a Cesium.Color object\n */\nfunction ConditionsExpression(conditionsExpression, defines) {\n  this._conditionsExpression = clone(conditionsExpression, true);\n  this._conditions = conditionsExpression.conditions;\n  this._runtimeConditions = undefined;\n\n  setRuntime(this, defines);\n}\n\nObject.defineProperties(ConditionsExpression.prototype, {\n  /**\n   * Gets the conditions expression defined in the 3D Tiles Styling language.\n   *\n   * @memberof ConditionsExpression.prototype\n   *\n   * @type {object}\n   * @readonly\n   *\n   * @default undefined\n   */\n  conditionsExpression: {\n    get: function () {\n      return this._conditionsExpression;\n    },\n  },\n});\n\nfunction Statement(condition, expression) {\n  this.condition = condition;\n  this.expression = expression;\n}\n\nfunction setRuntime(expression, defines) {\n  const runtimeConditions = [];\n  const conditions = expression._conditions;\n  if (!defined(conditions)) {\n    return;\n  }\n  const length = conditions.length;\n  for (let i = 0; i < length; ++i) {\n    const statement = conditions[i];\n    const cond = String(statement[0]);\n    const condExpression = String(statement[1]);\n    runtimeConditions.push(\n      new Statement(\n        new Expression(cond, defines),\n        new Expression(condExpression, defines)\n      )\n    );\n  }\n  expression._runtimeConditions = runtimeConditions;\n}\n\n/**\n * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of\n * the expression in the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}\n * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript\n * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>\n * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,\n * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is\n * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.\n *\n * @param {Cesium3DTileFeature} feature The feature whose properties may be used as variables in the expression.\n * @param {object} [result] The object onto which to store the result.\n * @returns {boolean|number|string|RegExp|Cartesian2|Cartesian3|Cartesian4|Color} The result of evaluating the expression.\n */\nConditionsExpression.prototype.evaluate = function (feature, result) {\n  const conditions = this._runtimeConditions;\n  if (!defined(conditions)) {\n    return undefined;\n  }\n  const length = conditions.length;\n  for (let i = 0; i < length; ++i) {\n    const statement = conditions[i];\n    if (statement.condition.evaluate(feature)) {\n      return statement.expression.evaluate(feature, result);\n    }\n  }\n};\n\n/**\n * Evaluates the result of a Color expression, using the values defined by a feature.\n * <p>\n * This is equivalent to {@link ConditionsExpression#evaluate} but always returns a {@link Color} object.\n * </p>\n * @param {Cesium3DTileFeature} feature The feature whose properties may be used as variables in the expression.\n * @param {Color} [result] The object in which to store the result\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n */\nConditionsExpression.prototype.evaluateColor = function (feature, result) {\n  const conditions = this._runtimeConditions;\n  if (!defined(conditions)) {\n    return undefined;\n  }\n  const length = conditions.length;\n  for (let i = 0; i < length; ++i) {\n    const statement = conditions[i];\n    if (statement.condition.evaluate(feature)) {\n      return statement.expression.evaluateColor(feature, result);\n    }\n  }\n};\n\n/**\n * Gets the shader function for this expression.\n * Returns undefined if the shader function can't be generated from this expression.\n *\n * @param {string} functionSignature Signature of the generated function.\n * @param {object} variableSubstitutionMap Maps variable names to shader variable names.\n * @param {object} shaderState Stores information about the generated shader function, including whether it is translucent.\n * @param {string} returnType The return type of the generated function.\n *\n * @returns {string} The shader function.\n *\n * @private\n */\nConditionsExpression.prototype.getShaderFunction = function (\n  functionSignature,\n  variableSubstitutionMap,\n  shaderState,\n  returnType\n) {\n  const conditions = this._runtimeConditions;\n  if (!defined(conditions) || conditions.length === 0) {\n    return undefined;\n  }\n\n  let shaderFunction = \"\";\n  const length = conditions.length;\n  for (let i = 0; i < length; ++i) {\n    const statement = conditions[i];\n\n    const condition = statement.condition.getShaderExpression(\n      variableSubstitutionMap,\n      shaderState\n    );\n    const expression = statement.expression.getShaderExpression(\n      variableSubstitutionMap,\n      shaderState\n    );\n\n    // Build the if/else chain from the list of conditions\n    shaderFunction +=\n      `    ${i === 0 ? \"if\" : \"else if\"} (${condition})\\n` +\n      `    {\\n` +\n      `        return ${expression};\\n` +\n      `    }\\n`;\n  }\n\n  shaderFunction =\n    `${returnType} ${functionSignature}\\n` +\n    `{\\n${shaderFunction}    return ${returnType}(1.0);\\n` + // Return a default value if no conditions are met\n    `}\\n`;\n\n  return shaderFunction;\n};\n\n/**\n * Gets the variables used by the expression.\n *\n * @returns {string[]} The variables used by the expression.\n *\n * @private\n */\nConditionsExpression.prototype.getVariables = function () {\n  let variables = [];\n\n  const conditions = this._runtimeConditions;\n  if (!defined(conditions) || conditions.length === 0) {\n    return variables;\n  }\n\n  const length = conditions.length;\n  for (let i = 0; i < length; ++i) {\n    const statement = conditions[i];\n    variables.push.apply(variables, statement.condition.getVariables());\n    variables.push.apply(variables, statement.expression.getVariables());\n  }\n\n  // Remove duplicates\n  variables = variables.filter(function (variable, index, variables) {\n    return variables.indexOf(variable) === index;\n  });\n\n  return variables;\n};\n\nexport default ConditionsExpression;\n", "import clone from \"../Core/clone.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Resource from \"../Core/Resource.js\";\nimport ConditionsExpression from \"./ConditionsExpression.js\";\nimport Expression from \"./Expression.js\";\n\n/**\n * A style that is applied to a {@link Cesium3DTileset}.\n * <p>\n * Evaluates an expression defined using the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.\n * </p>\n *\n * @alias Cesium3DTileStyle\n * @constructor\n *\n * @param {object} [style] An object defining a style.\n *\n * @example\n * tileset.style = new Cesium.Cesium3DTileStyle({\n *     color : {\n *         conditions : [\n *             ['${Height} >= 100', 'color(\"purple\", 0.5)'],\n *             ['${Height} >= 50', 'color(\"red\")'],\n *             ['true', 'color(\"blue\")']\n *         ]\n *     },\n *     show : '${Height} > 0',\n *     meta : {\n *         description : '\"Building id ${id} has height ${Height}.\"'\n *     }\n * });\n *\n * @example\n * tileset.style = new Cesium.Cesium3DTileStyle({\n *     color : 'vec4(${Temperature})',\n *     pointSize : '${Temperature} * 2.0'\n * });\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}\n */\nfunction Cesium3DTileStyle(style) {\n  this._style = {};\n  this._ready = false;\n\n  this._show = undefined;\n  this._color = undefined;\n  this._pointSize = undefined;\n  this._pointOutlineColor = undefined;\n  this._pointOutlineWidth = undefined;\n  this._labelColor = undefined;\n  this._labelOutlineColor = undefined;\n  this._labelOutlineWidth = undefined;\n  this._font = undefined;\n  this._labelStyle = undefined;\n  this._labelText = undefined;\n  this._backgroundColor = undefined;\n  this._backgroundPadding = undefined;\n  this._backgroundEnabled = undefined;\n  this._scaleByDistance = undefined;\n  this._translucencyByDistance = undefined;\n  this._distanceDisplayCondition = undefined;\n  this._heightOffset = undefined;\n  this._anchorLineEnabled = undefined;\n  this._anchorLineColor = undefined;\n  this._image = undefined;\n  this._disableDepthTestDistance = undefined;\n  this._horizontalOrigin = undefined;\n  this._verticalOrigin = undefined;\n  this._labelHorizontalOrigin = undefined;\n  this._labelVerticalOrigin = undefined;\n  this._meta = undefined;\n\n  this._colorShaderFunction = undefined;\n  this._showShaderFunction = undefined;\n  this._pointSizeShaderFunction = undefined;\n  this._colorShaderFunctionReady = false;\n  this._showShaderFunctionReady = false;\n  this._pointSizeShaderFunctionReady = false;\n\n  this._colorShaderTranslucent = false;\n\n  setup(this, style);\n}\n\nfunction setup(that, styleJson) {\n  styleJson = defaultValue(clone(styleJson, true), that._style);\n  that._style = styleJson;\n\n  that.show = styleJson.show;\n  that.color = styleJson.color;\n  that.pointSize = styleJson.pointSize;\n  that.pointOutlineColor = styleJson.pointOutlineColor;\n  that.pointOutlineWidth = styleJson.pointOutlineWidth;\n  that.labelColor = styleJson.labelColor;\n  that.labelOutlineColor = styleJson.labelOutlineColor;\n  that.labelOutlineWidth = styleJson.labelOutlineWidth;\n  that.labelStyle = styleJson.labelStyle;\n  that.font = styleJson.font;\n  that.labelText = styleJson.labelText;\n  that.backgroundColor = styleJson.backgroundColor;\n  that.backgroundPadding = styleJson.backgroundPadding;\n  that.backgroundEnabled = styleJson.backgroundEnabled;\n  that.scaleByDistance = styleJson.scaleByDistance;\n  that.translucencyByDistance = styleJson.translucencyByDistance;\n  that.distanceDisplayCondition = styleJson.distanceDisplayCondition;\n  that.heightOffset = styleJson.heightOffset;\n  that.anchorLineEnabled = styleJson.anchorLineEnabled;\n  that.anchorLineColor = styleJson.anchorLineColor;\n  that.image = styleJson.image;\n  that.disableDepthTestDistance = styleJson.disableDepthTestDistance;\n  that.horizontalOrigin = styleJson.horizontalOrigin;\n  that.verticalOrigin = styleJson.verticalOrigin;\n  that.labelHorizontalOrigin = styleJson.labelHorizontalOrigin;\n  that.labelVerticalOrigin = styleJson.labelVerticalOrigin;\n\n  const meta = {};\n  if (defined(styleJson.meta)) {\n    const defines = styleJson.defines;\n    const metaJson = defaultValue(styleJson.meta, defaultValue.EMPTY_OBJECT);\n    for (const property in metaJson) {\n      if (metaJson.hasOwnProperty(property)) {\n        meta[property] = new Expression(metaJson[property], defines);\n      }\n    }\n  }\n\n  that._meta = meta;\n\n  that._ready = true;\n}\n\nfunction getExpression(tileStyle, value) {\n  const defines = defaultValue(tileStyle._style, defaultValue.EMPTY_OBJECT)\n    .defines;\n\n  if (!defined(value)) {\n    return undefined;\n  } else if (typeof value === \"boolean\" || typeof value === \"number\") {\n    return new Expression(String(value));\n  } else if (typeof value === \"string\") {\n    return new Expression(value, defines);\n  } else if (defined(value.conditions)) {\n    return new ConditionsExpression(value, defines);\n  }\n  return value;\n}\n\nfunction getJsonFromExpression(expression) {\n  if (!defined(expression)) {\n    return undefined;\n  } else if (defined(expression.expression)) {\n    return expression.expression;\n  } else if (defined(expression.conditionsExpression)) {\n    return clone(expression.conditionsExpression, true);\n  }\n  return expression;\n}\n\nObject.defineProperties(Cesium3DTileStyle.prototype, {\n  /**\n   * Gets the object defining the style using the\n   * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {object}\n   * @readonly\n   *\n   * @default {}\n   */\n  style: {\n    get: function () {\n      return this._style;\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>show</code> property. Alternatively a boolean, string, or object defining a show style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return or convert to a <code>Boolean</code>.\n   * </p>\n   * <p>\n   * This expression is applicable to all tile formats.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @example\n   * const style = new Cesium3DTileStyle({\n   *     show : '(regExp(\"^Chest\").test(${County})) && (${YearBuilt} >= 1970)'\n   * });\n   * style.show.evaluate(feature); // returns true or false depending on the feature's properties\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override show expression with a custom function\n   * style.show = {\n   *     evaluate : function(feature) {\n   *         return true;\n   *     }\n   * };\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override show expression with a boolean\n   * style.show = true;\n   * };\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override show expression with a string\n   * style.show = '${Height} > 0';\n   * };\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override show expression with a condition\n   * style.show = {\n   *     conditions: [\n   *         ['${height} > 2', 'false'],\n   *         ['true', 'true']\n   *     ];\n   * };\n   */\n  show: {\n    get: function () {\n      return this._show;\n    },\n    set: function (value) {\n      this._show = getExpression(this, value);\n      this._style.show = getJsonFromExpression(this._show);\n      this._showShaderFunctionReady = false;\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>color</code> property. Alternatively a string or object defining a color style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Color</code>.\n   * </p>\n   * <p>\n   * This expression is applicable to all tile formats.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @example\n   * const style = new Cesium3DTileStyle({\n   *     color : '(${Temperature} > 90) ? color(\"red\") : color(\"white\")'\n   * });\n   * style.color.evaluateColor(feature, result); // returns a Cesium.Color object\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override color expression with a custom function\n   * style.color = {\n   *     evaluateColor : function(feature, result) {\n   *         return Cesium.Color.clone(Cesium.Color.WHITE, result);\n   *     }\n   * };\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override color expression with a string\n   * style.color = 'color(\"blue\")';\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override color expression with a condition\n   * style.color = {\n   *     conditions : [\n   *         ['${height} > 2', 'color(\"cyan\")'],\n   *         ['true', 'color(\"blue\")']\n   *     ]\n   * };\n   */\n  color: {\n    get: function () {\n      return this._color;\n    },\n    set: function (value) {\n      this._color = getExpression(this, value);\n      this._style.color = getJsonFromExpression(this._color);\n      this._colorShaderFunctionReady = false;\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>pointSize</code> property. Alternatively a string or object defining a point size style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Number</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile or a Point Cloud tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @example\n   * const style = new Cesium3DTileStyle({\n   *     pointSize : '(${Temperature} > 90) ? 2.0 : 1.0'\n   * });\n   * style.pointSize.evaluate(feature); // returns a Number\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override pointSize expression with a custom function\n   * style.pointSize = {\n   *     evaluate : function(feature) {\n   *         return 1.0;\n   *     }\n   * };\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override pointSize expression with a number\n   * style.pointSize = 1.0;\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override pointSize expression with a string\n   * style.pointSize = '${height} / 10';\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override pointSize expression with a condition\n   * style.pointSize =  {\n   *     conditions : [\n   *         ['${height} > 2', '1.0'],\n   *         ['true', '2.0']\n   *     ]\n   * };\n   */\n  pointSize: {\n    get: function () {\n      return this._pointSize;\n    },\n    set: function (value) {\n      this._pointSize = getExpression(this, value);\n      this._style.pointSize = getJsonFromExpression(this._pointSize);\n      this._pointSizeShaderFunctionReady = false;\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>pointOutlineColor</code> property. Alternatively a string or object defining a color style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Color</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override pointOutlineColor expression with a string\n   * style.pointOutlineColor = 'color(\"blue\")';\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override pointOutlineColor expression with a condition\n   * style.pointOutlineColor = {\n   *     conditions : [\n   *         ['${height} > 2', 'color(\"cyan\")'],\n   *         ['true', 'color(\"blue\")']\n   *     ]\n   * };\n   */\n  pointOutlineColor: {\n    get: function () {\n      return this._pointOutlineColor;\n    },\n    set: function (value) {\n      this._pointOutlineColor = getExpression(this, value);\n      this._style.pointOutlineColor = getJsonFromExpression(\n        this._pointOutlineColor\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>pointOutlineWidth</code> property. Alternatively a string or object defining a number style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Number</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override pointOutlineWidth expression with a string\n   * style.pointOutlineWidth = '5';\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override pointOutlineWidth expression with a condition\n   * style.pointOutlineWidth = {\n   *     conditions : [\n   *         ['${height} > 2', '5'],\n   *         ['true', '0']\n   *     ]\n   * };\n   */\n  pointOutlineWidth: {\n    get: function () {\n      return this._pointOutlineWidth;\n    },\n    set: function (value) {\n      this._pointOutlineWidth = getExpression(this, value);\n      this._style.pointOutlineWidth = getJsonFromExpression(\n        this._pointOutlineWidth\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelColor</code> property. Alternatively a string or object defining a color style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Color</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override labelColor expression with a string\n   * style.labelColor = 'color(\"blue\")';\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override labelColor expression with a condition\n   * style.labelColor = {\n   *     conditions : [\n   *         ['${height} > 2', 'color(\"cyan\")'],\n   *         ['true', 'color(\"blue\")']\n   *     ]\n   * };\n   */\n  labelColor: {\n    get: function () {\n      return this._labelColor;\n    },\n    set: function (value) {\n      this._labelColor = getExpression(this, value);\n      this._style.labelColor = getJsonFromExpression(this._labelColor);\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelOutlineColor</code> property. Alternatively a string or object defining a color style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Color</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override labelOutlineColor expression with a string\n   * style.labelOutlineColor = 'color(\"blue\")';\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override labelOutlineColor expression with a condition\n   * style.labelOutlineColor = {\n   *     conditions : [\n   *         ['${height} > 2', 'color(\"cyan\")'],\n   *         ['true', 'color(\"blue\")']\n   *     ]\n   * };\n   */\n  labelOutlineColor: {\n    get: function () {\n      return this._labelOutlineColor;\n    },\n    set: function (value) {\n      this._labelOutlineColor = getExpression(this, value);\n      this._style.labelOutlineColor = getJsonFromExpression(\n        this._labelOutlineColor\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelOutlineWidth</code> property. Alternatively a string or object defining a number style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Number</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override labelOutlineWidth expression with a string\n   * style.labelOutlineWidth = '5';\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override labelOutlineWidth expression with a condition\n   * style.labelOutlineWidth = {\n   *     conditions : [\n   *         ['${height} > 2', '5'],\n   *         ['true', '0']\n   *     ]\n   * };\n   */\n  labelOutlineWidth: {\n    get: function () {\n      return this._labelOutlineWidth;\n    },\n    set: function (value) {\n      this._labelOutlineWidth = getExpression(this, value);\n      this._style.labelOutlineWidth = getJsonFromExpression(\n        this._labelOutlineWidth\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>font</code> property. Alternatively a string or object defining a string style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>String</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium3DTileStyle({\n   *     font : '(${Temperature} > 90) ? \"30px Helvetica\" : \"24px Helvetica\"'\n   * });\n   * style.font.evaluate(feature); // returns a String\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override font expression with a custom function\n   * style.font = {\n   *     evaluate : function(feature) {\n   *         return '24px Helvetica';\n   *     }\n   * };\n   */\n  font: {\n    get: function () {\n      return this._font;\n    },\n    set: function (value) {\n      this._font = getExpression(this, value);\n      this._style.font = getJsonFromExpression(this._font);\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>label style</code> property. Alternatively a string or object defining a number style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>LabelStyle</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium3DTileStyle({\n   *     labelStyle : `(\\${Temperature} > 90) ? ${LabelStyle.FILL_AND_OUTLINE} : ${LabelStyle.FILL}`\n   * });\n   * style.labelStyle.evaluate(feature); // returns a LabelStyle\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override labelStyle expression with a custom function\n   * style.labelStyle = {\n   *     evaluate : function(feature) {\n   *         return LabelStyle.FILL;\n   *     }\n   * };\n   */\n  labelStyle: {\n    get: function () {\n      return this._labelStyle;\n    },\n    set: function (value) {\n      this._labelStyle = getExpression(this, value);\n      this._style.labelStyle = getJsonFromExpression(this._labelStyle);\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelText</code> property. Alternatively a string or object defining a string style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>String</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium3DTileStyle({\n   *     labelText : '(${Temperature} > 90) ? \">90\" : \"<=90\"'\n   * });\n   * style.labelText.evaluate(feature); // returns a String\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override labelText expression with a custom function\n   * style.labelText = {\n   *     evaluate : function(feature) {\n   *         return 'Example label text';\n   *     }\n   * };\n   */\n  labelText: {\n    get: function () {\n      return this._labelText;\n    },\n    set: function (value) {\n      this._labelText = getExpression(this, value);\n      this._style.labelText = getJsonFromExpression(this._labelText);\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>backgroundColor</code> property. Alternatively a string or object defining a color style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Color</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override backgroundColor expression with a string\n   * style.backgroundColor = 'color(\"blue\")';\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override backgroundColor expression with a condition\n   * style.backgroundColor = {\n   *     conditions : [\n   *         ['${height} > 2', 'color(\"cyan\")'],\n   *         ['true', 'color(\"blue\")']\n   *     ]\n   * };\n   */\n  backgroundColor: {\n    get: function () {\n      return this._backgroundColor;\n    },\n    set: function (value) {\n      this._backgroundColor = getExpression(this, value);\n      this._style.backgroundColor = getJsonFromExpression(\n        this._backgroundColor\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>backgroundPadding</code> property. Alternatively a string or object defining a vec2 style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Cartesian2</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override backgroundPadding expression with a string\n   * style.backgroundPadding = 'vec2(5.0, 7.0)';\n   * style.backgroundPadding.evaluate(feature); // returns a Cartesian2\n   */\n  backgroundPadding: {\n    get: function () {\n      return this._backgroundPadding;\n    },\n    set: function (value) {\n      this._backgroundPadding = getExpression(this, value);\n      this._style.backgroundPadding = getJsonFromExpression(\n        this._backgroundPadding\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>backgroundEnabled</code> property. Alternatively a string or object defining a boolean style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Boolean</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override backgroundEnabled expression with a string\n   * style.backgroundEnabled = 'true';\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override backgroundEnabled expression with a condition\n   * style.backgroundEnabled = {\n   *     conditions : [\n   *         ['${height} > 2', 'true'],\n   *         ['true', 'false']\n   *     ]\n   * };\n   */\n  backgroundEnabled: {\n    get: function () {\n      return this._backgroundEnabled;\n    },\n    set: function (value) {\n      this._backgroundEnabled = getExpression(this, value);\n      this._style.backgroundEnabled = getJsonFromExpression(\n        this._backgroundEnabled\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>scaleByDistance</code> property. Alternatively a string or object defining a vec4 style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Cartesian4</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override scaleByDistance expression with a string\n   * style.scaleByDistance = 'vec4(1.5e2, 2.0, 1.5e7, 0.5)';\n   * style.scaleByDistance.evaluate(feature); // returns a Cartesian4\n   */\n  scaleByDistance: {\n    get: function () {\n      return this._scaleByDistance;\n    },\n    set: function (value) {\n      this._scaleByDistance = getExpression(this, value);\n      this._style.scaleByDistance = getJsonFromExpression(\n        this._scaleByDistance\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>translucencyByDistance</code> property. Alternatively a string or object defining a vec4 style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Cartesian4</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override translucencyByDistance expression with a string\n   * style.translucencyByDistance = 'vec4(1.5e2, 1.0, 1.5e7, 0.2)';\n   * style.translucencyByDistance.evaluate(feature); // returns a Cartesian4\n   */\n  translucencyByDistance: {\n    get: function () {\n      return this._translucencyByDistance;\n    },\n    set: function (value) {\n      this._translucencyByDistance = getExpression(this, value);\n      this._style.translucencyByDistance = getJsonFromExpression(\n        this._translucencyByDistance\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>distanceDisplayCondition</code> property. Alternatively a string or object defining a vec2 style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Cartesian2</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override distanceDisplayCondition expression with a string\n   * style.distanceDisplayCondition = 'vec2(0.0, 5.5e6)';\n   * style.distanceDisplayCondition.evaluate(feature); // returns a Cartesian2\n   */\n  distanceDisplayCondition: {\n    get: function () {\n      return this._distanceDisplayCondition;\n    },\n    set: function (value) {\n      this._distanceDisplayCondition = getExpression(this, value);\n      this._style.distanceDisplayCondition = getJsonFromExpression(\n        this._distanceDisplayCondition\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>heightOffset</code> property. Alternatively a string or object defining a number style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Number</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override heightOffset expression with a string\n   * style.heightOffset = '2.0';\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override heightOffset expression with a condition\n   * style.heightOffset = {\n   *     conditions : [\n   *         ['${height} > 2', '4.0'],\n   *         ['true', '2.0']\n   *     ]\n   * };\n   */\n  heightOffset: {\n    get: function () {\n      return this._heightOffset;\n    },\n    set: function (value) {\n      this._heightOffset = getExpression(this, value);\n      this._style.heightOffset = getJsonFromExpression(this._heightOffset);\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>anchorLineEnabled</code> property. Alternatively a string or object defining a boolean style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Boolean</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override anchorLineEnabled expression with a string\n   * style.anchorLineEnabled = 'true';\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override anchorLineEnabled expression with a condition\n   * style.anchorLineEnabled = {\n   *     conditions : [\n   *         ['${height} > 2', 'true'],\n   *         ['true', 'false']\n   *     ]\n   * };\n   */\n  anchorLineEnabled: {\n    get: function () {\n      return this._anchorLineEnabled;\n    },\n    set: function (value) {\n      this._anchorLineEnabled = getExpression(this, value);\n      this._style.anchorLineEnabled = getJsonFromExpression(\n        this._anchorLineEnabled\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>anchorLineColor</code> property. Alternatively a string or object defining a color style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Color</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override anchorLineColor expression with a string\n   * style.anchorLineColor = 'color(\"blue\")';\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override anchorLineColor expression with a condition\n   * style.anchorLineColor = {\n   *     conditions : [\n   *         ['${height} > 2', 'color(\"cyan\")'],\n   *         ['true', 'color(\"blue\")']\n   *     ]\n   * };\n   */\n  anchorLineColor: {\n    get: function () {\n      return this._anchorLineColor;\n    },\n    set: function (value) {\n      this._anchorLineColor = getExpression(this, value);\n      this._style.anchorLineColor = getJsonFromExpression(\n        this._anchorLineColor\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>image</code> property. Alternatively a string or object defining a string style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>String</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium3DTileStyle({\n   *     image : '(${Temperature} > 90) ? \"/url/to/image1\" : \"/url/to/image2\"'\n   * });\n   * style.image.evaluate(feature); // returns a String\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override image expression with a custom function\n   * style.image = {\n   *     evaluate : function(feature) {\n   *         return '/url/to/image';\n   *     }\n   * };\n   */\n  image: {\n    get: function () {\n      return this._image;\n    },\n    set: function (value) {\n      this._image = getExpression(this, value);\n      this._style.image = getJsonFromExpression(this._image);\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>disableDepthTestDistance</code> property. Alternatively a string or object defining a number style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>Number</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override disableDepthTestDistance expression with a string\n   * style.disableDepthTestDistance = '1000.0';\n   * style.disableDepthTestDistance.evaluate(feature); // returns a Number\n   */\n  disableDepthTestDistance: {\n    get: function () {\n      return this._disableDepthTestDistance;\n    },\n    set: function (value) {\n      this._disableDepthTestDistance = getExpression(this, value);\n      this._style.disableDepthTestDistance = getJsonFromExpression(\n        this._disableDepthTestDistance\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>horizontalOrigin</code> property. Alternatively a string or object defining a number style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>HorizontalOrigin</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium3DTileStyle({\n   *     horizontalOrigin : HorizontalOrigin.LEFT\n   * });\n   * style.horizontalOrigin.evaluate(feature); // returns a HorizontalOrigin\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override horizontalOrigin expression with a custom function\n   * style.horizontalOrigin = {\n   *     evaluate : function(feature) {\n   *         return HorizontalOrigin.CENTER;\n   *     }\n   * };\n   */\n  horizontalOrigin: {\n    get: function () {\n      return this._horizontalOrigin;\n    },\n    set: function (value) {\n      this._horizontalOrigin = getExpression(this, value);\n      this._style.horizontalOrigin = getJsonFromExpression(\n        this._horizontalOrigin\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>verticalOrigin</code> property. Alternatively a string or object defining a number style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>VerticalOrigin</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium3DTileStyle({\n   *     verticalOrigin : VerticalOrigin.TOP\n   * });\n   * style.verticalOrigin.evaluate(feature); // returns a VerticalOrigin\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override verticalOrigin expression with a custom function\n   * style.verticalOrigin = {\n   *     evaluate : function(feature) {\n   *         return VerticalOrigin.CENTER;\n   *     }\n   * };\n   */\n  verticalOrigin: {\n    get: function () {\n      return this._verticalOrigin;\n    },\n    set: function (value) {\n      this._verticalOrigin = getExpression(this, value);\n      this._style.verticalOrigin = getJsonFromExpression(this._verticalOrigin);\n    },\n  },\n\n  /**\n   Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelHorizontalOrigin</code> property. Alternatively a string or object defining a number style can be used.\n    * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n    * <p>\n    * The expression must return a <code>HorizontalOrigin</code>.\n    * </p>\n    * <p>\n    * This expression is only applicable to point features in a Vector tile.\n    * </p>\n    *\n    * @memberof Cesium3DTileStyle.prototype\n    *\n    * @type {StyleExpression}\n    *\n    * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n    *\n    * @example\n    * const style = new Cesium3DTileStyle({\n    *     labelHorizontalOrigin : HorizontalOrigin.LEFT\n    * });\n    * style.labelHorizontalOrigin.evaluate(feature); // returns a HorizontalOrigin\n    *\n    * @example\n    * const style = new Cesium.Cesium3DTileStyle();\n    * // Override labelHorizontalOrigin expression with a custom function\n    * style.labelHorizontalOrigin = {\n    *     evaluate : function(feature) {\n    *         return HorizontalOrigin.CENTER;\n    *     }\n    * };\n    */\n  labelHorizontalOrigin: {\n    get: function () {\n      return this._labelHorizontalOrigin;\n    },\n    set: function (value) {\n      this._labelHorizontalOrigin = getExpression(this, value);\n      this._style.labelHorizontalOrigin = getJsonFromExpression(\n        this._labelHorizontalOrigin\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelVerticalOrigin</code> property. Alternatively a string or object defining a number style can be used.\n   * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n   * <p>\n   * The expression must return a <code>VerticalOrigin</code>.\n   * </p>\n   * <p>\n   * This expression is only applicable to point features in a Vector tile.\n   * </p>\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n   *\n   * @example\n   * const style = new Cesium3DTileStyle({\n   *     labelVerticalOrigin : VerticalOrigin.TOP\n   * });\n   * style.labelVerticalOrigin.evaluate(feature); // returns a VerticalOrigin\n   *\n   * @example\n   * const style = new Cesium.Cesium3DTileStyle();\n   * // Override labelVerticalOrigin expression with a custom function\n   * style.labelVerticalOrigin = {\n   *     evaluate : function(feature) {\n   *         return VerticalOrigin.CENTER;\n   *     }\n   * };\n   */\n  labelVerticalOrigin: {\n    get: function () {\n      return this._labelVerticalOrigin;\n    },\n    set: function (value) {\n      this._labelVerticalOrigin = getExpression(this, value);\n      this._style.labelVerticalOrigin = getJsonFromExpression(\n        this._labelVerticalOrigin\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the object containing application-specific expression that can be explicitly\n   * evaluated, e.g., for display in a UI.\n   *\n   * @memberof Cesium3DTileStyle.prototype\n   *\n   * @type {StyleExpression}\n   *\n   * @example\n   * const style = new Cesium3DTileStyle({\n   *     meta : {\n   *         description : '\"Building id ${id} has height ${Height}.\"'\n   *     }\n   * });\n   * style.meta.description.evaluate(feature); // returns a String with the substituted variables\n   */\n  meta: {\n    get: function () {\n      return this._meta;\n    },\n    set: function (value) {\n      this._meta = value;\n    },\n  },\n});\n\n/**\n * Asynchronously creates a Cesium3DTileStyle from a url.\n *\n * @param {Resource|string} url The url of the style to be loaded.\n *\n * @returns {Promise<Cesium3DTileStyle>} A promise which resolves to the created style\n *\n * @private\n */\nCesium3DTileStyle.fromUrl = function (url) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(url)) {\n    throw new DeveloperError(\"url is required\");\n  }\n  //>>includeEnd('debug');\n\n  const resource = Resource.createIfNeeded(url);\n  return resource.fetchJson(url).then(function (styleJson) {\n    return new Cesium3DTileStyle(styleJson);\n  });\n};\n\n/**\n * Gets the color shader function for this style.\n *\n * @param {string} functionSignature Signature of the generated function.\n * @param {object} variableSubstitutionMap Maps variable names to shader variable names.\n * @param {object} shaderState Stores information about the generated shader function, including whether it is translucent.\n *\n * @returns {string} The shader function.\n *\n * @private\n */\nCesium3DTileStyle.prototype.getColorShaderFunction = function (\n  functionSignature,\n  variableSubstitutionMap,\n  shaderState\n) {\n  if (this._colorShaderFunctionReady) {\n    shaderState.translucent = this._colorShaderTranslucent;\n    // Return the cached result, may be undefined\n    return this._colorShaderFunction;\n  }\n\n  this._colorShaderFunctionReady = true;\n  if (defined(this.color) && defined(this.color.getShaderFunction)) {\n    this._colorShaderFunction = this.color.getShaderFunction(\n      functionSignature,\n      variableSubstitutionMap,\n      shaderState,\n      \"vec4\"\n    );\n  } else {\n    this._colorShaderFunction = undefined;\n  }\n\n  this._colorShaderTranslucent = shaderState.translucent;\n  return this._colorShaderFunction;\n};\n\n/**\n * Gets the show shader function for this style.\n *\n * @param {string} functionSignature Signature of the generated function.\n * @param {object} variableSubstitutionMap Maps variable names to shader variable names.\n * @param {object} shaderState Stores information about the generated shader function, including whether it is translucent.\n *\n * @returns {string} The shader function.\n *\n * @private\n */\nCesium3DTileStyle.prototype.getShowShaderFunction = function (\n  functionSignature,\n  variableSubstitutionMap,\n  shaderState\n) {\n  if (this._showShaderFunctionReady) {\n    // Return the cached result, may be undefined\n    return this._showShaderFunction;\n  }\n\n  this._showShaderFunctionReady = true;\n\n  if (defined(this.show) && defined(this.show.getShaderFunction)) {\n    this._showShaderFunction = this.show.getShaderFunction(\n      functionSignature,\n      variableSubstitutionMap,\n      shaderState,\n      \"bool\"\n    );\n  } else {\n    this._showShaderFunction = undefined;\n  }\n  return this._showShaderFunction;\n};\n\n/**\n * Gets the pointSize shader function for this style.\n *\n * @param {string} functionSignature Signature of the generated function.\n * @param {object} variableSubstitutionMap Maps variable names to shader variable names.\n * @param {object} shaderState Stores information about the generated shader function, including whether it is translucent.\n *\n * @returns {string} The shader function.\n *\n * @private\n */\nCesium3DTileStyle.prototype.getPointSizeShaderFunction = function (\n  functionSignature,\n  variableSubstitutionMap,\n  shaderState\n) {\n  if (this._pointSizeShaderFunctionReady) {\n    // Return the cached result, may be undefined\n    return this._pointSizeShaderFunction;\n  }\n\n  this._pointSizeShaderFunctionReady = true;\n  if (defined(this.pointSize) && defined(this.pointSize.getShaderFunction)) {\n    this._pointSizeShaderFunction = this.pointSize.getShaderFunction(\n      functionSignature,\n      variableSubstitutionMap,\n      shaderState,\n      \"float\"\n    );\n  } else {\n    this._pointSizeShaderFunction = undefined;\n  }\n\n  return this._pointSizeShaderFunction;\n};\n\n/**\n * Gets the variables used by the style.\n *\n * @returns {string[]} The variables used by the style.\n *\n * @private\n */\nCesium3DTileStyle.prototype.getVariables = function () {\n  let variables = [];\n\n  if (defined(this.color) && defined(this.color.getVariables)) {\n    variables.push.apply(variables, this.color.getVariables());\n  }\n\n  if (defined(this.show) && defined(this.show.getVariables)) {\n    variables.push.apply(variables, this.show.getVariables());\n  }\n\n  if (defined(this.pointSize) && defined(this.pointSize.getVariables)) {\n    variables.push.apply(variables, this.pointSize.getVariables());\n  }\n\n  // Remove duplicates\n  variables = variables.filter(function (variable, index, variables) {\n    return variables.indexOf(variable) === index;\n  });\n\n  return variables;\n};\n\nexport default Cesium3DTileStyle;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DoubleEndedPriorityQueue from \"../Core/DoubleEndedPriorityQueue.js\";\n\n/**\n * @alias ImplicitSubtreeCache\n * @constructor\n *\n * @param {object} [options] Object with the following properties\n * @param {number} [options.maximumSubtreeCount=0] The total number of subtrees this cache can store. If adding a new subtree would exceed this limit, the lowest priority subtrees will be removed until there is room, unless the subtree that is going to be removed is the parent of the new subtree, in which case it will not be removed and the new subtree will still be added, exceeding the memory limit.\n *\n * @private\n */\nfunction ImplicitSubtreeCache(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._maximumSubtreeCount = defaultValue(options.maximumSubtreeCount, 0);\n\n  /**\n   * A counter that goes up whenever a subtree is added. Used to sort subtrees by recency.\n   * @type {number}\n   * @private\n   */\n  this._subtreeRequestCounter = 0;\n\n  /**\n   * @type {DoubleEndedPriorityQueue}\n   * @private\n   */\n  this._queue = new DoubleEndedPriorityQueue({\n    comparator: ImplicitSubtreeCache.comparator,\n  });\n}\n\n/**\n * @param {ImplicitSubtree} subtree\n */\nImplicitSubtreeCache.prototype.addSubtree = function (subtree) {\n  const cacheNode = new ImplicitSubtreeCacheNode(\n    subtree,\n    this._subtreeRequestCounter\n  );\n  this._subtreeRequestCounter++;\n  this._queue.insert(cacheNode);\n\n  // Make sure the parent subtree exists in the cache\n  const subtreeCoord = subtree.implicitCoordinates;\n  if (subtreeCoord.level > 0) {\n    const parentCoord = subtreeCoord.getParentSubtreeCoordinates();\n    const parentNode = this.find(parentCoord);\n\n    //>>includeStart('debug', pragmas.debug)\n    if (parentNode === undefined) {\n      throw new DeveloperError(\"parent node needs to exist\");\n    }\n    //>>includeEnd('debug');\n  }\n\n  if (this._maximumSubtreeCount > 0) {\n    while (this._queue.length > this._maximumSubtreeCount) {\n      const lowestPriorityNode = this._queue.getMinimum();\n      if (lowestPriorityNode === cacheNode) {\n        // Don't remove itself\n        break;\n      }\n\n      this._queue.removeMinimum();\n    }\n  }\n};\n\n/**\n * @param {ImplicitTileCoordinates} subtreeCoord\n * @returns {ImplicitSubtree|undefined}\n */\nImplicitSubtreeCache.prototype.find = function (subtreeCoord) {\n  const queue = this._queue;\n  const array = queue.internalArray;\n  const arrayLength = queue.length;\n\n  for (let i = 0; i < arrayLength; i++) {\n    const other = array[i];\n    const otherSubtree = other.subtree;\n    const otherCoord = otherSubtree.implicitCoordinates;\n    if (subtreeCoord.isEqual(otherCoord)) {\n      return other.subtree;\n    }\n  }\n  return undefined;\n};\n\n/**\n * @param {ImplicitSubtreeCacheNode} a\n * @param {ImplicitSubtreeCacheNode} b\n * @returns {number}\n */\nImplicitSubtreeCache.comparator = function (a, b) {\n  const aCoord = a.subtree.implicitCoordinates;\n  const bCoord = b.subtree.implicitCoordinates;\n  if (aCoord.isAncestor(bCoord)) {\n    // Technically this shouldn't happen because the ancestor subtree was supposed to be added to the cache first.\n    return +1.0;\n  } else if (bCoord.isAncestor(aCoord)) {\n    return -1.0;\n  }\n  return a.stamp - b.stamp;\n};\n\n/**\n * @alias ImplicitSubtreeCacheNode\n * @constructor\n *\n * @param {ImplicitSubtree} subtree\n * @param {number} stamp\n *\n * @private\n */\nfunction ImplicitSubtreeCacheNode(subtree, stamp) {\n  this.subtree = subtree;\n  this.stamp = stamp;\n}\n\nexport default ImplicitSubtreeCache;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Check from \"../Core/Check.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\n\n/**\n * A box {@link VoxelShape}.\n *\n * @alias VoxelBoxShape\n * @constructor\n *\n * @see VoxelShape\n * @see VoxelEllipsoidShape\n * @see VoxelCylinderShape\n * @see VoxelShapeType\n *\n * @private\n */\nfunction VoxelBoxShape() {\n  /**\n   * An oriented bounding box containing the bounded shape.\n   * The update function must be called before accessing this value.\n   * @type {OrientedBoundingBox}\n   * @readonly\n   */\n  this.orientedBoundingBox = new OrientedBoundingBox();\n\n  /**\n   * A bounding sphere containing the bounded shape.\n   * The update function must be called before accessing this value.\n   * @type {BoundingSphere}\n   * @readonly\n   */\n  this.boundingSphere = new BoundingSphere();\n\n  /**\n   * A transformation matrix containing the bounded shape.\n   * The update function must be called before accessing this value.\n   * @type {Matrix4}\n   * @readonly\n   */\n  this.boundTransform = new Matrix4();\n\n  /**\n   * A transformation matrix containing the shape, ignoring the bounds.\n   * The update function must be called before accessing this value.\n   * @type {Matrix4}\n   * @readonly\n   */\n  this.shapeTransform = new Matrix4();\n\n  /**\n   * @type {Cartesian3}\n   * @private\n   */\n  this._minBounds = Cartesian3.clone(\n    VoxelBoxShape.DefaultMinBounds,\n    new Cartesian3()\n  );\n\n  /**\n   * @type {Cartesian3}\n   * @private\n   */\n  this._maxBounds = Cartesian3.clone(\n    VoxelBoxShape.DefaultMaxBounds,\n    new Cartesian3()\n  );\n\n  /**\n   * @type {Object<string, any>}\n   * @readonly\n   */\n  this.shaderUniforms = {\n    renderMinBounds: new Cartesian3(),\n    renderMaxBounds: new Cartesian3(),\n    boxUvToShapeUvScale: new Cartesian3(),\n    boxUvToShapeUvTranslate: new Cartesian3(),\n  };\n\n  /**\n   * @type {Object<string, any>}\n   * @readonly\n   */\n  this.shaderDefines = {\n    BOX_INTERSECTION_INDEX: undefined,\n    BOX_HAS_SHAPE_BOUNDS: undefined,\n  };\n\n  /**\n   * The maximum number of intersections against the shape for any ray direction.\n   * @type {number}\n   * @readonly\n   */\n  this.shaderMaximumIntersectionsLength = 0; // not known until update\n}\n\nconst scratchCenter = new Cartesian3();\nconst scratchScale = new Cartesian3();\nconst scratchRotation = new Matrix3();\nconst scratchClipMinBounds = new Cartesian3();\nconst scratchClipMaxBounds = new Cartesian3();\nconst scratchRenderMinBounds = new Cartesian3();\nconst scratchRenderMaxBounds = new Cartesian3();\n\nconst transformLocalToUv = Matrix4.fromRotationTranslation(\n  Matrix3.fromUniformScale(0.5, new Matrix3()),\n  new Cartesian3(0.5, 0.5, 0.5),\n  new Matrix4()\n);\n\n/**\n * Update the shape's state.\n *\n * @param {Matrix4} modelMatrix The model matrix.\n * @param {Cartesian3} minBounds The minimum bounds.\n * @param {Cartesian3} maxBounds The maximum bounds.\n * @param {Cartesian3} [clipMinBounds=VoxelBoxShape.DefaultMinBounds] The minimum clip bounds.\n * @param {Cartesian3} [clipMaxBounds=VoxelBoxShape.DefaultMaxBounds] The maximum clip bounds.\n * @returns {boolean} Whether the shape is visible.\n */\nVoxelBoxShape.prototype.update = function (\n  modelMatrix,\n  minBounds,\n  maxBounds,\n  clipMinBounds,\n  clipMaxBounds\n) {\n  clipMinBounds = defaultValue(clipMinBounds, VoxelBoxShape.DefaultMinBounds);\n  clipMaxBounds = defaultValue(clipMaxBounds, VoxelBoxShape.DefaultMaxBounds);\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"modelMatrix\", modelMatrix);\n  Check.typeOf.object(\"minBounds\", minBounds);\n  Check.typeOf.object(\"maxBounds\", maxBounds);\n  //>>includeEnd('debug');\n\n  const defaultMinBounds = VoxelBoxShape.DefaultMinBounds;\n  const defaultMaxBounds = VoxelBoxShape.DefaultMaxBounds;\n\n  minBounds = this._minBounds = Cartesian3.clamp(\n    minBounds,\n    defaultMinBounds,\n    defaultMaxBounds,\n    this._minBounds\n  );\n\n  maxBounds = this._maxBounds = Cartesian3.clamp(\n    maxBounds,\n    defaultMinBounds,\n    defaultMaxBounds,\n    this._maxBounds\n  );\n\n  clipMinBounds = Cartesian3.clamp(\n    clipMinBounds,\n    defaultMinBounds,\n    defaultMaxBounds,\n    scratchClipMinBounds\n  );\n\n  clipMaxBounds = Cartesian3.clamp(\n    clipMaxBounds,\n    defaultMinBounds,\n    defaultMaxBounds,\n    scratchClipMaxBounds\n  );\n\n  const renderMinBounds = Cartesian3.clamp(\n    minBounds,\n    clipMinBounds,\n    clipMaxBounds,\n    scratchRenderMinBounds\n  );\n\n  const renderMaxBounds = Cartesian3.clamp(\n    maxBounds,\n    clipMinBounds,\n    clipMaxBounds,\n    scratchRenderMaxBounds\n  );\n\n  const scale = Matrix4.getScale(modelMatrix, scratchScale);\n\n  // Box is not visible if:\n  // - any of the min render bounds exceed the max render bounds\n  // - two or more of the min bounds equal the max bounds (line / point)\n  // - any of the min clip bounds exceed the max clip bounds\n  // - scale is 0 for any component (too annoying to reconstruct rotation matrix)\n  if (\n    renderMinBounds.x > renderMaxBounds.x ||\n    renderMinBounds.y > renderMaxBounds.y ||\n    renderMinBounds.z > renderMaxBounds.z ||\n    (renderMinBounds.x === renderMaxBounds.x) +\n      (renderMinBounds.y === renderMaxBounds.y) +\n      (renderMinBounds.z === renderMaxBounds.z) >=\n      2 ||\n    clipMinBounds.x > clipMaxBounds.x ||\n    clipMinBounds.y > clipMaxBounds.y ||\n    clipMinBounds.z > clipMaxBounds.z ||\n    scale.x === 0.0 ||\n    scale.y === 0.0 ||\n    scale.z === 0.0\n  ) {\n    return false;\n  }\n\n  this.shapeTransform = Matrix4.clone(modelMatrix, this.shapeTransform);\n\n  this.orientedBoundingBox = getBoxChunkObb(\n    renderMinBounds,\n    renderMaxBounds,\n    this.shapeTransform,\n    this.orientedBoundingBox\n  );\n\n  // All of the box bounds go from -1 to +1, so the model matrix scale can be\n  // used as the oriented bounding box half axes.\n  this.boundTransform = Matrix4.fromRotationTranslation(\n    this.orientedBoundingBox.halfAxes,\n    this.orientedBoundingBox.center,\n    this.boundTransform\n  );\n\n  this.boundingSphere = BoundingSphere.fromOrientedBoundingBox(\n    this.orientedBoundingBox,\n    this.boundingSphere\n  );\n\n  const { shaderUniforms, shaderDefines } = this;\n\n  // To keep things simple, clear the defines every time\n  for (const key in shaderDefines) {\n    if (shaderDefines.hasOwnProperty(key)) {\n      shaderDefines[key] = undefined;\n    }\n  }\n\n  const hasShapeBounds =\n    !Cartesian3.equals(minBounds, defaultMinBounds) ||\n    !Cartesian3.equals(maxBounds, defaultMaxBounds);\n\n  // Keep track of how many intersections there are going to be.\n  let intersectionCount = 0;\n\n  shaderDefines[\"BOX_INTERSECTION_INDEX\"] = intersectionCount;\n  intersectionCount += 1;\n\n  shaderUniforms.renderMinBounds = Matrix4.multiplyByPoint(\n    transformLocalToUv,\n    renderMinBounds,\n    shaderUniforms.renderMinBounds\n  );\n  shaderUniforms.renderMaxBounds = Matrix4.multiplyByPoint(\n    transformLocalToUv,\n    renderMaxBounds,\n    shaderUniforms.renderMaxBounds\n  );\n\n  if (hasShapeBounds) {\n    shaderDefines[\"BOX_HAS_SHAPE_BOUNDS\"] = true;\n\n    const min = minBounds;\n    const max = maxBounds;\n\n    // Go from UV space to bounded UV space:\n    // delerp(posUv, minBoundsUv, maxBoundsUv)\n    // (posUv - minBoundsUv) / (maxBoundsUv - minBoundsUv)\n    // posUv / (maxBoundsUv - minBoundsUv) - minBoundsUv / (maxBoundsUv - minBoundsUv)\n    // scale = 1.0 / (maxBoundsUv - minBoundsUv)\n    // scale = 1.0 / ((maxBounds * 0.5 + 0.5) - (minBounds * 0.5 + 0.5))\n    // scale = 2.0 / (maxBounds - minBounds)\n    // offset = -minBoundsUv / ((maxBounds * 0.5 + 0.5) - (minBounds * 0.5 + 0.5))\n    // offset = -2.0 * (minBounds * 0.5 + 0.5) / (maxBounds - minBounds)\n    // offset = -scale * (minBounds * 0.5 + 0.5)\n    shaderUniforms.boxUvToShapeUvScale = Cartesian3.fromElements(\n      2.0 / (min.x === max.x ? 1.0 : max.x - min.x),\n      2.0 / (min.y === max.y ? 1.0 : max.y - min.y),\n      2.0 / (min.z === max.z ? 1.0 : max.z - min.z),\n      shaderUniforms.boxUvToShapeUvScale\n    );\n\n    shaderUniforms.boxUvToShapeUvTranslate = Cartesian3.fromElements(\n      -shaderUniforms.boxUvToShapeUvScale.x * (min.x * 0.5 + 0.5),\n      -shaderUniforms.boxUvToShapeUvScale.y * (min.y * 0.5 + 0.5),\n      -shaderUniforms.boxUvToShapeUvScale.z * (min.z * 0.5 + 0.5),\n      shaderUniforms.boxUvToShapeUvTranslate\n    );\n  }\n\n  this.shaderMaximumIntersectionsLength = intersectionCount;\n\n  return true;\n};\n\nconst scratchTileMinBounds = new Cartesian3();\nconst scratchTileMaxBounds = new Cartesian3();\n\n/**\n * Computes an oriented bounding box for a specified tile.\n * The update function must be called before calling this function.\n *\n * @param {number} tileLevel The tile's level.\n * @param {number} tileX The tile's x coordinate.\n * @param {number} tileY The tile's y coordinate.\n * @param {number} tileZ The tile's z coordinate.\n * @param {OrientedBoundingBox} result The oriented bounding box that will be set to enclose the specified tile\n * @returns {OrientedBoundingBox} The oriented bounding box.\n */\nVoxelBoxShape.prototype.computeOrientedBoundingBoxForTile = function (\n  tileLevel,\n  tileX,\n  tileY,\n  tileZ,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"tileLevel\", tileLevel);\n  Check.typeOf.number(\"tileX\", tileX);\n  Check.typeOf.number(\"tileY\", tileY);\n  Check.typeOf.number(\"tileZ\", tileZ);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const minBounds = this._minBounds;\n  const maxBounds = this._maxBounds;\n  const sizeAtLevel = 1.0 / Math.pow(2, tileLevel);\n\n  const tileMinBounds = Cartesian3.fromElements(\n    CesiumMath.lerp(minBounds.x, maxBounds.x, sizeAtLevel * tileX),\n    CesiumMath.lerp(minBounds.y, maxBounds.y, sizeAtLevel * tileY),\n    CesiumMath.lerp(minBounds.z, maxBounds.z, sizeAtLevel * tileZ),\n    scratchTileMinBounds\n  );\n\n  const tileMaxBounds = Cartesian3.fromElements(\n    CesiumMath.lerp(minBounds.x, maxBounds.x, sizeAtLevel * (tileX + 1)),\n    CesiumMath.lerp(minBounds.y, maxBounds.y, sizeAtLevel * (tileY + 1)),\n    CesiumMath.lerp(minBounds.z, maxBounds.z, sizeAtLevel * (tileZ + 1)),\n    scratchTileMaxBounds\n  );\n\n  return getBoxChunkObb(\n    tileMinBounds,\n    tileMaxBounds,\n    this.shapeTransform,\n    result\n  );\n};\n\n/**\n * Computes an approximate step size for raymarching the root tile of a voxel grid.\n * The update function must be called before calling this function.\n *\n * @param {Cartesian3} dimensions The voxel grid dimensions for a tile.\n * @returns {number} The step size.\n */\nVoxelBoxShape.prototype.computeApproximateStepSize = function (dimensions) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"dimensions\", dimensions);\n  //>>includeEnd('debug');\n\n  return 1.0 / Cartesian3.maximumComponent(dimensions);\n};\n\n/**\n * Defines the minimum bounds of the shape. Corresponds to minimum X, Y, Z.\n *\n * @type {Cartesian3}\n * @constant\n * @readonly\n */\nVoxelBoxShape.DefaultMinBounds = Object.freeze(\n  new Cartesian3(-1.0, -1.0, -1.0)\n);\n\n/**\n * Defines the maximum bounds of the shape. Corresponds to maximum X, Y, Z.\n *\n * @type {Cartesian3}\n * @constant\n * @readonly\n */\nVoxelBoxShape.DefaultMaxBounds = Object.freeze(\n  new Cartesian3(+1.0, +1.0, +1.0)\n);\n\n/**\n * Computes an {@link OrientedBoundingBox} for a subregion of the shape.\n *\n * @function\n *\n * @param {Cartesian3} minimumBounds The minimum bounds, in the local coordinates of the shape.\n * @param {Cartesian3} maximumBounds The maximum bounds, in the local coordinates of the shape.\n * @param {Matrix4} matrix The matrix to transform the points.\n * @param {OrientedBoundingBox} result The object onto which to store the result.\n * @returns {OrientedBoundingBox} The oriented bounding box that contains this subregion.\n *\n * @private\n */\nfunction getBoxChunkObb(minimumBounds, maximumBounds, matrix, result) {\n  const defaultMinBounds = VoxelBoxShape.DefaultMinBounds;\n  const defaultMaxBounds = VoxelBoxShape.DefaultMaxBounds;\n\n  const isDefaultBounds =\n    Cartesian3.equals(minimumBounds, defaultMinBounds) &&\n    Cartesian3.equals(maximumBounds, defaultMaxBounds);\n\n  if (isDefaultBounds) {\n    result.center = Matrix4.getTranslation(matrix, result.center);\n    result.halfAxes = Matrix4.getMatrix3(matrix, result.halfAxes);\n  } else {\n    let scale = Matrix4.getScale(matrix, scratchScale);\n    const localCenter = Cartesian3.midpoint(\n      minimumBounds,\n      maximumBounds,\n      scratchCenter\n    );\n    result.center = Matrix4.multiplyByPoint(matrix, localCenter, result.center);\n    scale = Cartesian3.fromElements(\n      scale.x * 0.5 * (maximumBounds.x - minimumBounds.x),\n      scale.y * 0.5 * (maximumBounds.y - minimumBounds.y),\n      scale.z * 0.5 * (maximumBounds.z - minimumBounds.z),\n      scratchScale\n    );\n    const rotation = Matrix4.getRotation(matrix, scratchRotation);\n    result.halfAxes = Matrix3.setScale(rotation, scale, result.halfAxes);\n  }\n\n  return result;\n}\n\nexport default VoxelBoxShape;\n", "import Check from \"../Core/Check.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport defined from \"../Core/defined.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport MetadataTable from \"./MetadataTable.js\";\n\n/**\n * An object representing voxel content for a {@link Cesium3DTilesVoxelProvider}.\n *\n * @alias VoxelContent\n * @constructor\n *\n * @param {Resource} resource The resource for this voxel content. This is used for fetching external buffers as needed.\n *\n * @private\n * @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction VoxelContent(resource) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"resource\", resource);\n  //>>includeEnd('debug');\n\n  this._resource = resource;\n  this._metadataTable = undefined;\n}\n\nObject.defineProperties(VoxelContent.prototype, {\n  /**\n   * The {@link MetadataTable} storing voxel property values.\n   *\n   * @type {MetadataTable}\n   * @readonly\n   * @private\n   */\n  metadataTable: {\n    get: function () {\n      return this._metadataTable;\n    },\n  },\n});\n\n/**\n * Creates an object representing voxel content for a {@link Cesium3DTilesVoxelProvider}.\n *\n * @param {Resource} resource The resource for this voxel content. This is used for fetching external buffers as needed.\n * @param {object} [json] Voxel JSON contents. Mutually exclusive with binary.\n * @param {Uint8Array} [binary] Voxel binary contents. Mutually exclusive with json.\n * @param {MetadataSchema} metadataSchema The metadata schema used by property tables in the voxel content\n * @returns {Promise<VoxelContent>}\n *\n * @exception {DeveloperError} One of json and binary must be defined.\n */\nVoxelContent.fromJson = async function (\n  resource,\n  json,\n  binary,\n  metadataSchema\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"resource\", resource);\n  if (defined(json) === defined(binary)) {\n    throw new DeveloperError(\"One of json and binary must be defined.\");\n  }\n  //>>includeEnd('debug');\n\n  let chunks;\n  if (defined(json)) {\n    chunks = {\n      json: json,\n      binary: undefined,\n    };\n  } else {\n    chunks = parseVoxelChunks(binary);\n  }\n\n  const buffersU8 = await requestBuffers(resource, chunks.json, chunks.binary);\n  const bufferViewsU8 = {};\n  const bufferViewsLength = chunks.json.bufferViews.length;\n  for (let i = 0; i < bufferViewsLength; ++i) {\n    const bufferViewJson = chunks.json.bufferViews[i];\n    const start = bufferViewJson.byteOffset;\n    const end = start + bufferViewJson.byteLength;\n    const buffer = buffersU8[bufferViewJson.buffer];\n    const bufferView = buffer.subarray(start, end);\n    bufferViewsU8[i] = bufferView;\n  }\n\n  const propertyTableIndex = chunks.json.voxelTable;\n  const propertyTableJson = chunks.json.propertyTables[propertyTableIndex];\n\n  const content = new VoxelContent(resource);\n\n  content._metadataTable = new MetadataTable({\n    count: propertyTableJson.count,\n    properties: propertyTableJson.properties,\n    class: metadataSchema.classes[propertyTableJson.class],\n    bufferViews: bufferViewsU8,\n  });\n\n  return content;\n};\n\nfunction requestBuffers(resource, json, binary) {\n  const buffersLength = json.buffers.length;\n  const bufferPromises = new Array(buffersLength);\n  for (let i = 0; i < buffersLength; i++) {\n    const buffer = json.buffers[i];\n    if (defined(buffer.uri)) {\n      const baseResource = resource;\n      const bufferResource = baseResource.getDerivedResource({\n        url: buffer.uri,\n      });\n      bufferPromises[i] = bufferResource\n        .fetchArrayBuffer()\n        .then(function (arrayBuffer) {\n          return new Uint8Array(arrayBuffer);\n        });\n    } else {\n      bufferPromises[i] = Promise.resolve(binary);\n    }\n  }\n\n  return Promise.all(bufferPromises);\n}\n\n/**\n * A helper object for storing the two parts of the binary voxel content\n *\n * @typedef {object} VoxelChunks\n * @property {object} json The json chunk of the binary voxel content\n * @property {Uint8Array} binary The binary chunk of the binary voxel content. This represents the internal buffer.\n * @private\n */\n\n/**\n * Given binary voxel content, split into JSON and binary chunks\n *\n * @param {Uint8Array} binaryView The binary voxel content\n * @returns {VoxelChunks} An object containing the JSON and binary chunks\n * @private\n */\nfunction parseVoxelChunks(binaryView) {\n  // Parse the header\n  const littleEndian = true;\n  const reader = new DataView(binaryView.buffer, binaryView.byteOffset);\n  // Skip to the chunk lengths\n  let byteOffset = 8;\n\n  // Read the bottom 32 bits of the 64-bit byte length. This is ok for now because:\n  // 1) not all browsers have native 64-bit operations\n  // 2) the data is well under 4GB\n  const jsonByteLength = reader.getUint32(byteOffset, littleEndian);\n  byteOffset += 8;\n  const binaryByteLength = reader.getUint32(byteOffset, littleEndian);\n  byteOffset += 8;\n\n  const json = getJsonFromTypedArray(binaryView, byteOffset, jsonByteLength);\n  byteOffset += jsonByteLength;\n  const binary = binaryView.subarray(byteOffset, byteOffset + binaryByteLength);\n\n  return {\n    json: json,\n    binary: binary,\n  };\n}\n\nexport default VoxelContent;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\n\n/**\n * A cylinder {@link VoxelShape}.\n *\n * @alias VoxelCylinderShape\n * @constructor\n *\n * @see VoxelShape\n * @see VoxelBoxShape\n * @see VoxelEllipsoidShape\n * @see VoxelShapeType\n *\n * @private\n */\nfunction VoxelCylinderShape() {\n  /**\n   * An oriented bounding box containing the bounded shape.\n   * The update function must be called before accessing this value.\n   * @type {OrientedBoundingBox}\n   * @readonly\n   */\n  this.orientedBoundingBox = new OrientedBoundingBox();\n\n  /**\n   * A bounding sphere containing the bounded shape.\n   * The update function must be called before accessing this value.\n   * @type {BoundingSphere}\n   * @readonly\n   */\n  this.boundingSphere = new BoundingSphere();\n\n  /**\n   * A transformation matrix containing the bounded shape.\n   * The update function must be called before accessing this value.\n   * @type {Matrix4}\n   * @readonly\n   */\n  this.boundTransform = new Matrix4();\n\n  /**\n   * A transformation matrix containing the shape, ignoring the bounds.\n   * The update function must be called before accessing this value.\n   * @type {Matrix4}\n   * @readonly\n   */\n  this.shapeTransform = new Matrix4();\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._minimumRadius = VoxelCylinderShape.DefaultMinBounds.x;\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._maximumRadius = VoxelCylinderShape.DefaultMaxBounds.x;\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._minimumHeight = VoxelCylinderShape.DefaultMinBounds.y;\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._maximumHeight = VoxelCylinderShape.DefaultMaxBounds.y;\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._minimumAngle = VoxelCylinderShape.DefaultMinBounds.z;\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._maximumAngle = VoxelCylinderShape.DefaultMaxBounds.z;\n\n  /**\n   * @type {Object<string, any>}\n   * @readonly\n   */\n  this.shaderUniforms = {\n    cylinderUvToRenderBoundsScale: new Cartesian3(),\n    cylinderUvToRenderBoundsTranslate: new Cartesian3(),\n    cylinderUvToRenderRadiusMin: 0.0,\n    cylinderRenderAngleMinMax: new Cartesian2(),\n    cylinderUvToShapeUvRadius: new Cartesian2(),\n    cylinderUvToShapeUvHeight: new Cartesian2(),\n    cylinderUvToShapeUvAngle: new Cartesian2(),\n    cylinderShapeUvAngleMinMax: new Cartesian2(),\n    cylinderShapeUvAngleRangeZeroMid: 0.0,\n  };\n\n  /**\n   * @type {Object<string, any>}\n   * @readonly\n   */\n  this.shaderDefines = {\n    CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN: undefined,\n    CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX: undefined,\n    CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT: undefined,\n    CYLINDER_HAS_RENDER_BOUNDS_HEIGHT: undefined,\n    CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT: undefined,\n    CYLINDER_HAS_RENDER_BOUNDS_ANGLE: undefined,\n    CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO: undefined,\n    CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF: undefined,\n    CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF: undefined,\n    CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF: undefined,\n\n    CYLINDER_HAS_SHAPE_BOUNDS_RADIUS: undefined,\n    CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT: undefined,\n    CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT: undefined,\n    CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT: undefined,\n    CYLINDER_HAS_SHAPE_BOUNDS_ANGLE: undefined,\n    CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO: undefined,\n    CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY: undefined,\n    CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY: undefined,\n    CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED: undefined,\n\n    CYLINDER_INTERSECTION_INDEX_RADIUS_MAX: undefined,\n    CYLINDER_INTERSECTION_INDEX_RADIUS_MIN: undefined,\n    CYLINDER_INTERSECTION_INDEX_ANGLE: undefined,\n  };\n\n  /**\n   * The maximum number of intersections against the shape for any ray direction.\n   * @type {number}\n   * @readonly\n   */\n  this.shaderMaximumIntersectionsLength = 0; // not known until update\n}\n\nconst scratchScale = new Cartesian3();\nconst scratchBoundsTranslation = new Cartesian3();\nconst scratchBoundsScale = new Cartesian3();\nconst scratchBoundsScaleMatrix = new Matrix3();\nconst scratchTransformLocalToBounds = new Matrix4();\nconst scratchTransformUvToBounds = new Matrix4();\n\nconst transformUvToLocal = Matrix4.fromRotationTranslation(\n  Matrix3.fromUniformScale(2.0, new Matrix3()),\n  new Cartesian3(-1.0, -1.0, -1.0),\n  new Matrix4()\n);\n\n/**\n * Update the shape's state.\n *\n * @param {Matrix4} modelMatrix The model matrix.\n * @param {Cartesian3} minBounds The minimum bounds.\n * @param {Cartesian3} maxBounds The maximum bounds.\n * @param {Cartesian3} [clipMinBounds=VoxelCylinderShape.DefaultMinBounds] The minimum clip bounds.\n * @param {Cartesian3} [clipMaxBounds=VoxelCylinderShape.DefaultMaxBounds] The maximum clip bounds.\n * @returns {boolean} Whether the shape is visible.\n */\nVoxelCylinderShape.prototype.update = function (\n  modelMatrix,\n  minBounds,\n  maxBounds,\n  clipMinBounds,\n  clipMaxBounds\n) {\n  clipMinBounds = defaultValue(\n    clipMinBounds,\n    VoxelCylinderShape.DefaultMinBounds\n  );\n  clipMaxBounds = defaultValue(\n    clipMaxBounds,\n    VoxelCylinderShape.DefaultMaxBounds\n  );\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"modelMatrix\", modelMatrix);\n  Check.typeOf.object(\"minBounds\", minBounds);\n  Check.typeOf.object(\"maxBounds\", maxBounds);\n  //>>includeEnd('debug');\n\n  const defaultMinRadius = VoxelCylinderShape.DefaultMinBounds.x;\n  const defaultMaxRadius = VoxelCylinderShape.DefaultMaxBounds.x;\n  const defaultMinHeight = VoxelCylinderShape.DefaultMinBounds.y;\n  const defaultMaxHeight = VoxelCylinderShape.DefaultMaxBounds.y;\n  const defaultMinAngle = VoxelCylinderShape.DefaultMinBounds.z;\n  const defaultMaxAngle = VoxelCylinderShape.DefaultMaxBounds.z;\n  const defaultAngleRange = defaultMaxAngle - defaultMinAngle;\n  const defaultAngleRangeHalf = 0.5 * defaultAngleRange;\n\n  const epsilonZeroScale = CesiumMath.EPSILON10;\n  const epsilonAngleDiscontinuity = CesiumMath.EPSILON3; // 0.001 radians = 0.05729578 degrees\n  const epsilonAngle = CesiumMath.EPSILON10;\n\n  // Clamp the radii to the valid range\n  const shapeMinRadius = CesiumMath.clamp(\n    minBounds.x,\n    defaultMinRadius,\n    defaultMaxRadius\n  );\n  const shapeMaxRadius = CesiumMath.clamp(\n    maxBounds.x,\n    defaultMinRadius,\n    defaultMaxRadius\n  );\n  const clipMinRadius = CesiumMath.clamp(\n    clipMinBounds.x,\n    defaultMinRadius,\n    defaultMaxRadius\n  );\n  const clipMaxRadius = CesiumMath.clamp(\n    clipMaxBounds.x,\n    defaultMinRadius,\n    defaultMaxRadius\n  );\n  const renderMinRadius = Math.max(shapeMinRadius, clipMinRadius);\n  const renderMaxRadius = Math.min(shapeMaxRadius, clipMaxRadius);\n\n  // Clamp the heights to the valid range\n  const shapeMinHeight = CesiumMath.clamp(\n    minBounds.y,\n    defaultMinHeight,\n    defaultMaxHeight\n  );\n  const shapeMaxHeight = CesiumMath.clamp(\n    maxBounds.y,\n    defaultMinHeight,\n    defaultMaxHeight\n  );\n  const clipMinHeight = CesiumMath.clamp(\n    clipMinBounds.y,\n    defaultMinHeight,\n    defaultMaxHeight\n  );\n  const clipMaxHeight = CesiumMath.clamp(\n    clipMaxBounds.y,\n    defaultMinHeight,\n    defaultMaxHeight\n  );\n  const renderMinHeight = Math.max(shapeMinHeight, clipMinHeight);\n  const renderMaxHeight = Math.min(shapeMaxHeight, clipMaxHeight);\n\n  // Clamp the angles to the valid range\n  const shapeMinAngle = CesiumMath.negativePiToPi(minBounds.z);\n  const shapeMaxAngle = CesiumMath.negativePiToPi(maxBounds.z);\n  const clipMinAngle = CesiumMath.negativePiToPi(clipMinBounds.z);\n  const clipMaxAngle = CesiumMath.negativePiToPi(clipMaxBounds.z);\n  const renderMinAngle = Math.max(shapeMinAngle, clipMinAngle);\n  const renderMaxAngle = Math.min(shapeMaxAngle, clipMaxAngle);\n\n  const scale = Matrix4.getScale(modelMatrix, scratchScale);\n\n  // Exit early if the shape is not visible.\n  // Note that minAngle may be greater than maxAngle when crossing the 180th meridian.\n\n  // Cylinder is not visible if:\n  // - maxRadius is zero (line)\n  // - minRadius is greater than maxRadius\n  // - minHeight is greater than maxHeight\n  // - scale is 0 for any component (too annoying to reconstruct rotation matrix)\n  if (\n    renderMaxRadius === 0.0 ||\n    renderMinRadius > renderMaxRadius ||\n    renderMinHeight > renderMaxHeight ||\n    CesiumMath.equalsEpsilon(scale.x, 0.0, undefined, epsilonZeroScale) ||\n    CesiumMath.equalsEpsilon(scale.y, 0.0, undefined, epsilonZeroScale) ||\n    CesiumMath.equalsEpsilon(scale.z, 0.0, undefined, epsilonZeroScale)\n  ) {\n    return false;\n  }\n\n  this._minimumRadius = shapeMinRadius; // [0,1]\n  this._maximumRadius = shapeMaxRadius; // [0,1]\n  this._minimumHeight = shapeMinHeight; // [-1,+1]\n  this._maximumHeight = shapeMaxHeight; // [-1,+1]\n  this._minimumAngle = shapeMinAngle; // [-pi,+pi]\n  this._maximumAngle = shapeMaxAngle; // [-pi,+pi]\n\n  this.shapeTransform = Matrix4.clone(modelMatrix, this.shapeTransform);\n\n  this.orientedBoundingBox = getCylinderChunkObb(\n    renderMinRadius,\n    renderMaxRadius,\n    renderMinHeight,\n    renderMaxHeight,\n    renderMinAngle,\n    renderMaxAngle,\n    this.shapeTransform,\n    this.orientedBoundingBox\n  );\n\n  this.boundTransform = Matrix4.fromRotationTranslation(\n    this.orientedBoundingBox.halfAxes,\n    this.orientedBoundingBox.center,\n    this.boundTransform\n  );\n\n  this.boundingSphere = BoundingSphere.fromOrientedBoundingBox(\n    this.orientedBoundingBox,\n    this.boundingSphere\n  );\n\n  const shapeIsDefaultMaxRadius = shapeMaxRadius === defaultMaxRadius;\n  const shapeIsDefaultMinRadius = shapeMinRadius === defaultMinRadius;\n  const shapeIsDefaultRadius =\n    shapeIsDefaultMinRadius && shapeIsDefaultMaxRadius;\n  const shapeIsDefaultHeight =\n    shapeMinHeight === defaultMinHeight && shapeMaxHeight === defaultMaxHeight;\n  const shapeIsAngleReversed = shapeMaxAngle < shapeMinAngle;\n  const shapeAngleRange =\n    shapeMaxAngle - shapeMinAngle + shapeIsAngleReversed * defaultAngleRange;\n  const shapeIsAngleRegular =\n    shapeAngleRange > defaultAngleRangeHalf + epsilonAngle &&\n    shapeAngleRange < defaultAngleRange - epsilonAngle;\n  const shapeIsAngleFlipped =\n    shapeAngleRange > epsilonAngle &&\n    shapeAngleRange < defaultAngleRangeHalf - epsilonAngle;\n  const shapeIsAngleRangeHalf =\n    shapeAngleRange >= defaultAngleRangeHalf - epsilonAngle &&\n    shapeAngleRange <= defaultAngleRangeHalf + epsilonAngle;\n  const shapeIsAngleRangeZero = shapeAngleRange <= epsilonAngle;\n  const shapeHasAngle =\n    shapeIsAngleRegular ||\n    shapeIsAngleFlipped ||\n    shapeIsAngleRangeHalf ||\n    shapeIsAngleRangeZero;\n  const shapeIsMinAngleDiscontinuity = CesiumMath.equalsEpsilon(\n    shapeMinAngle,\n    defaultMinAngle,\n    undefined,\n    epsilonAngleDiscontinuity\n  );\n  const shapeIsMaxAngleDiscontinuity = CesiumMath.equalsEpsilon(\n    shapeMaxAngle,\n    defaultMaxAngle,\n    undefined,\n    epsilonAngleDiscontinuity\n  );\n\n  const renderIsDefaultMaxRadius = renderMaxRadius === defaultMaxRadius;\n  const renderIsDefaultMinRadius = renderMinRadius === defaultMinRadius;\n  const renderIsDefaultHeight =\n    renderMinHeight === defaultMinHeight &&\n    renderMaxHeight === defaultMaxHeight;\n  const renderIsAngleReversed = renderMaxAngle < renderMinAngle;\n  const renderAngleRange =\n    renderMaxAngle - renderMinAngle + renderIsAngleReversed * defaultAngleRange;\n  const renderIsAngleRegular =\n    renderAngleRange > defaultAngleRangeHalf + epsilonAngle &&\n    renderAngleRange < defaultAngleRange - epsilonAngle;\n  const renderIsAngleFlipped =\n    renderAngleRange > epsilonAngle &&\n    renderAngleRange < defaultAngleRangeHalf - epsilonAngle;\n  const renderIsAngleRangeHalf =\n    renderAngleRange >= defaultAngleRangeHalf - epsilonAngle &&\n    renderAngleRange <= defaultAngleRangeHalf + epsilonAngle;\n  const renderIsAngleRangeZero = renderAngleRange <= epsilonAngle;\n  const renderHasAngle =\n    renderIsAngleRegular ||\n    renderIsAngleFlipped ||\n    renderIsAngleRangeHalf ||\n    renderIsAngleRangeZero;\n\n  const shaderUniforms = this.shaderUniforms;\n  const shaderDefines = this.shaderDefines;\n\n  // To keep things simple, clear the defines every time\n  for (const key in shaderDefines) {\n    if (shaderDefines.hasOwnProperty(key)) {\n      shaderDefines[key] = undefined;\n    }\n  }\n\n  // Keep track of how many intersections there are going to be.\n  let intersectionCount = 0;\n\n  shaderDefines[\"CYLINDER_INTERSECTION_INDEX_RADIUS_MAX\"] = intersectionCount;\n  intersectionCount += 1;\n\n  if (!renderIsDefaultMinRadius) {\n    shaderDefines[\"CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN\"] = true;\n    shaderDefines[\"CYLINDER_INTERSECTION_INDEX_RADIUS_MIN\"] = intersectionCount;\n    intersectionCount += 1;\n\n    shaderUniforms.cylinderUvToRenderRadiusMin =\n      renderMaxRadius / renderMinRadius;\n  }\n  if (!renderIsDefaultMaxRadius) {\n    shaderDefines[\"CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX\"] = true;\n  }\n  if (renderMinRadius === renderMaxRadius) {\n    shaderDefines[\"CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT\"] = true;\n  }\n  if (!renderIsDefaultHeight) {\n    shaderDefines[\"CYLINDER_HAS_RENDER_BOUNDS_HEIGHT\"] = true;\n  }\n  if (renderMinHeight === renderMaxHeight) {\n    shaderDefines[\"CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT\"] = true;\n  }\n  if (shapeMinHeight === shapeMaxHeight) {\n    shaderDefines[\"CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT\"] = true;\n  }\n  if (shapeMinRadius === shapeMaxRadius) {\n    shaderDefines[\"CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT\"] = true;\n  }\n  if (!shapeIsDefaultRadius) {\n    shaderDefines[\"CYLINDER_HAS_SHAPE_BOUNDS_RADIUS\"] = true;\n\n    // delerp(radius, minRadius, maxRadius)\n    // (radius - minRadius) / (maxRadius - minRadius)\n    // radius / (maxRadius - minRadius) - minRadius / (maxRadius - minRadius)\n    // scale = 1.0 / (maxRadius - minRadius)\n    // offset = -minRadius / (maxRadius - minRadius)\n    // offset = minRadius / (minRadius - maxRadius)\n    const scale = 1.0 / (shapeMaxRadius - shapeMinRadius);\n    const offset = shapeMinRadius / (shapeMinRadius - shapeMaxRadius);\n    shaderUniforms.cylinderUvToShapeUvRadius = Cartesian2.fromElements(\n      scale,\n      offset,\n      shaderUniforms.cylinderUvToShapeUvRadius\n    );\n  }\n\n  if (!shapeIsDefaultHeight) {\n    shaderDefines[\"CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT\"] = true;\n\n    // delerp(heightUv, minHeightUv, maxHeightUv)\n    // (heightUv - minHeightUv) / (maxHeightUv - minHeightUv)\n    // heightUv / (maxHeightUv - minHeightUv) - minHeightUv / (maxHeightUv - minHeightUv)\n    // scale = 1.0 / (maxHeightUv - minHeightUv)\n    // scale = 1.0 / ((maxHeight * 0.5 + 0.5) - (minHeight * 0.5 + 0.5))\n    // scale = 2.0 / (maxHeight - minHeight)\n    // offset = -minHeightUv / (maxHeightUv - minHeightUv)\n    // offset = -minHeightUv / ((maxHeight * 0.5 + 0.5) - (minHeight * 0.5 + 0.5))\n    // offset = -2.0 * (minHeight * 0.5 + 0.5) / (maxHeight - minHeight)\n    // offset = -(minHeight + 1.0) / (maxHeight - minHeight)\n    // offset = (minHeight + 1.0) / (minHeight - maxHeight)\n    const scale = 2.0 / (shapeMaxHeight - shapeMinHeight);\n    const offset = (shapeMinHeight + 1.0) / (shapeMinHeight - shapeMaxHeight);\n    shaderUniforms.cylinderUvToShapeUvHeight = Cartesian2.fromElements(\n      scale,\n      offset,\n      shaderUniforms.cylinderUvToShapeUvHeight\n    );\n  }\n\n  if (!renderIsDefaultMaxRadius || !renderIsDefaultHeight) {\n    const heightScale = 0.5 * (renderMaxHeight - renderMinHeight);\n    const scaleLocalToBounds = Cartesian3.fromElements(\n      1.0 / renderMaxRadius,\n      1.0 / renderMaxRadius,\n      1.0 / (heightScale === 0.0 ? 1.0 : heightScale),\n      scratchBoundsScale\n    );\n    // -inverse(scale) * translation // affine inverse\n    // -inverse(scale) * 0.5 * (minHeight + maxHeight)\n    const translateLocalToBounds = Cartesian3.fromElements(\n      0.0,\n      0.0,\n      -scaleLocalToBounds.z * 0.5 * (renderMinHeight + renderMaxHeight),\n      scratchBoundsTranslation\n    );\n    const transformLocalToBounds = Matrix4.fromRotationTranslation(\n      Matrix3.fromScale(scaleLocalToBounds, scratchBoundsScaleMatrix),\n      translateLocalToBounds,\n      scratchTransformLocalToBounds\n    );\n    const transformUvToBounds = Matrix4.multiplyTransformation(\n      transformLocalToBounds,\n      transformUvToLocal,\n      scratchTransformUvToBounds\n    );\n    shaderUniforms.cylinderUvToRenderBoundsScale = Matrix4.getScale(\n      transformUvToBounds,\n      shaderUniforms.cylinderUvToRenderBoundsScale\n    );\n    shaderUniforms.cylinderUvToRenderBoundsTranslate = Matrix4.getTranslation(\n      transformUvToBounds,\n      shaderUniforms.cylinderUvToRenderBoundsTranslate\n    );\n  }\n\n  if (shapeIsAngleReversed) {\n    shaderDefines[\"CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED\"] = true;\n  }\n\n  if (renderHasAngle) {\n    shaderDefines[\"CYLINDER_HAS_RENDER_BOUNDS_ANGLE\"] = true;\n    shaderDefines[\"CYLINDER_INTERSECTION_INDEX_ANGLE\"] = intersectionCount;\n\n    if (renderIsAngleRegular) {\n      shaderDefines[\"CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF\"] = true;\n      intersectionCount += 1;\n    } else if (renderIsAngleFlipped) {\n      shaderDefines[\"CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF\"] = true;\n      intersectionCount += 2;\n    } else if (renderIsAngleRangeHalf) {\n      shaderDefines[\"CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF\"] = true;\n      intersectionCount += 1;\n    } else if (renderIsAngleRangeZero) {\n      shaderDefines[\"CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO\"] = true;\n      intersectionCount += 2;\n    }\n\n    shaderUniforms.cylinderRenderAngleMinMax = Cartesian2.fromElements(\n      renderMinAngle,\n      renderMaxAngle,\n      shaderUniforms.cylinderAngleMinMax\n    );\n  }\n\n  if (shapeHasAngle) {\n    shaderDefines[\"CYLINDER_HAS_SHAPE_BOUNDS_ANGLE\"] = true;\n    if (shapeIsAngleRangeZero) {\n      shaderDefines[\"CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO\"] = true;\n    }\n    if (shapeIsMinAngleDiscontinuity) {\n      shaderDefines[\"CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY\"] = true;\n    }\n    if (shapeIsMaxAngleDiscontinuity) {\n      shaderDefines[\"CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY\"] = true;\n    }\n\n    const uvMinAngle = (shapeMinAngle - defaultMinAngle) / defaultAngleRange;\n    const uvMaxAngle = (shapeMaxAngle - defaultMinAngle) / defaultAngleRange;\n    const uvAngleRangeZero = 1.0 - shapeAngleRange / defaultAngleRange;\n\n    shaderUniforms.cylinderShapeUvAngleMinMax = Cartesian2.fromElements(\n      uvMinAngle,\n      uvMaxAngle,\n      shaderUniforms.cylinderShapeUvAngleMinMax\n    );\n    shaderUniforms.cylinderShapeUvAngleRangeZeroMid =\n      (uvMaxAngle + 0.5 * uvAngleRangeZero) % 1.0;\n\n    // delerp(angleUv, uvMinAngle, uvMaxAngle)\n    // (angelUv - uvMinAngle) / (uvMaxAngle - uvMinAngle)\n    // angleUv / (uvMaxAngle - uvMinAngle) - uvMinAngle / (uvMaxAngle - uvMinAngle)\n    // scale = 1.0 / (uvMaxAngle - uvMinAngle)\n    // scale = 1.0 / (((maxAngle - pi) / (2.0 * pi)) - ((minAngle - pi) / (2.0 * pi)))\n    // scale = 2.0 * pi / (maxAngle - minAngle)\n    // offset = -uvMinAngle / (uvMaxAngle - uvMinAngle)\n    // offset = -((minAngle - pi) / (2.0 * pi)) / (((maxAngle - pi) / (2.0 * pi)) - ((minAngle - pi) / (2.0 * pi)))\n    // offset = -(minAngle - pi) / (maxAngle - minAngle)\n    const scale = defaultAngleRange / shapeAngleRange;\n    const offset = -(shapeMinAngle - defaultMinAngle) / shapeAngleRange;\n    shaderUniforms.cylinderUvToShapeUvAngle = Cartesian2.fromElements(\n      scale,\n      offset,\n      shaderUniforms.cylinderUvToShapeUvAngle\n    );\n  }\n\n  this.shaderMaximumIntersectionsLength = intersectionCount;\n\n  return true;\n};\n\n/**\n * Computes an oriented bounding box for a specified tile.\n * The update function must be called before calling this function.\n *\n * @param {number} tileLevel The tile's level.\n * @param {number} tileX The tile's x coordinate.\n * @param {number} tileY The tile's y coordinate.\n * @param {number} tileZ The tile's z coordinate.\n * @param {OrientedBoundingBox} result The oriented bounding box that will be set to enclose the specified tile\n * @returns {OrientedBoundingBox} The oriented bounding box.\n */\nVoxelCylinderShape.prototype.computeOrientedBoundingBoxForTile = function (\n  tileLevel,\n  tileX,\n  tileY,\n  tileZ,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"tileLevel\", tileLevel);\n  Check.typeOf.number(\"tileX\", tileX);\n  Check.typeOf.number(\"tileY\", tileY);\n  Check.typeOf.number(\"tileZ\", tileZ);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const minimumRadius = this._minimumRadius;\n  const maximumRadius = this._maximumRadius;\n  const minimumHeight = this._minimumHeight;\n  const maximumHeight = this._maximumHeight;\n  const minimumAngle = this._minimumAngle;\n  const maximumAngle = this._maximumAngle;\n\n  const sizeAtLevel = 1.0 / Math.pow(2.0, tileLevel);\n\n  const radiusStart = CesiumMath.lerp(\n    minimumRadius,\n    maximumRadius,\n    tileX * sizeAtLevel\n  );\n  const radiusEnd = CesiumMath.lerp(\n    minimumRadius,\n    maximumRadius,\n    (tileX + 1) * sizeAtLevel\n  );\n  const heightStart = CesiumMath.lerp(\n    minimumHeight,\n    maximumHeight,\n    tileY * sizeAtLevel\n  );\n  const heightEnd = CesiumMath.lerp(\n    minimumHeight,\n    maximumHeight,\n    (tileY + 1) * sizeAtLevel\n  );\n  const angleStart = CesiumMath.lerp(\n    minimumAngle,\n    maximumAngle,\n    tileZ * sizeAtLevel\n  );\n  const angleEnd = CesiumMath.lerp(\n    minimumAngle,\n    maximumAngle,\n    (tileZ + 1) * sizeAtLevel\n  );\n\n  return getCylinderChunkObb(\n    radiusStart,\n    radiusEnd,\n    heightStart,\n    heightEnd,\n    angleStart,\n    angleEnd,\n    this.shapeTransform,\n    result\n  );\n};\n\nconst scratchOrientedBoundingBox = new OrientedBoundingBox();\nconst scratchVoxelScale = new Cartesian3();\nconst scratchRootScale = new Cartesian3();\nconst scratchScaleRatio = new Cartesian3();\n\n/**\n * Computes an approximate step size for raymarching the root tile of a voxel grid.\n * The update function must be called before calling this function.\n *\n * @param {Cartesian3} dimensions The voxel grid dimensions for a tile.\n * @returns {number} The step size.\n */\nVoxelCylinderShape.prototype.computeApproximateStepSize = function (\n  dimensions\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"dimensions\", dimensions);\n  //>>includeEnd('debug');\n\n  const shapeTransform = this.shapeTransform;\n  const minRadius = this._minimumRadius;\n  const maxRadius = this._maximumRadius;\n  const minHeight = this._minimumHeight;\n  const maxHeight = this._maximumHeight;\n  const minAngle = this._minimumAngle;\n  const maxAngle = this._maximumAngle;\n\n  const lerpRadius = 1.0 - 1.0 / dimensions.x;\n  const lerpHeight = 1.0 - 1.0 / dimensions.y;\n  const lerpAngle = 1.0 - 1.0 / dimensions.z;\n\n  // Compare the size of an outermost cylinder voxel to the total cylinder\n  const voxelMinimumRadius = CesiumMath.lerp(minRadius, maxRadius, lerpRadius);\n  const voxelMinimumHeight = CesiumMath.lerp(minHeight, maxHeight, lerpHeight);\n  const voxelMinimumAngle = CesiumMath.lerp(minAngle, maxAngle, lerpAngle);\n  const voxelMaximumRadius = maxRadius;\n  const voxelMaximumHeight = maxHeight;\n  const voxelMaximumAngle = maxAngle;\n\n  const voxelObb = getCylinderChunkObb(\n    voxelMinimumRadius,\n    voxelMaximumRadius,\n    voxelMinimumHeight,\n    voxelMaximumHeight,\n    voxelMinimumAngle,\n    voxelMaximumAngle,\n    shapeTransform,\n    scratchOrientedBoundingBox\n  );\n\n  const voxelScale = Matrix3.getScale(voxelObb.halfAxes, scratchVoxelScale);\n  const rootScale = Matrix4.getScale(shapeTransform, scratchRootScale);\n  const scaleRatio = Cartesian3.divideComponents(\n    voxelScale,\n    rootScale,\n    scratchScaleRatio\n  );\n  const stepSize = Cartesian3.minimumComponent(scaleRatio);\n  return stepSize;\n};\n\n/**\n * Defines the minimum bounds of the shape. Corresponds to minimum radius, height, angle.\n *\n * @type {Cartesian3}\n * @constant\n * @readonly\n *\n * @private\n */\nVoxelCylinderShape.DefaultMinBounds = Object.freeze(\n  new Cartesian3(0.0, -1.0, -CesiumMath.PI)\n);\n\n/**\n * Defines the maximum bounds of the shape. Corresponds to maximum radius, height, angle.\n *\n * @type {Cartesian3}\n * @constant\n * @readonly\n *\n * @private\n */\nVoxelCylinderShape.DefaultMaxBounds = Object.freeze(\n  new Cartesian3(1.0, +1.0, +CesiumMath.PI)\n);\n\nconst maxTestAngles = 5;\nconst scratchTestAngles = new Array(maxTestAngles);\nconst scratchTranslation = new Cartesian3();\nconst scratchRotation = new Matrix3();\nconst scratchTranslationMatrix = new Matrix4();\nconst scratchRotationMatrix = new Matrix4();\nconst scratchScaleMatrix = new Matrix4();\nconst scratchMatrix = new Matrix4();\nconst scratchColumn0 = new Cartesian3();\nconst scratchColumn1 = new Cartesian3();\nconst scratchColumn2 = new Cartesian3();\nconst scratchCorners = new Array(8);\nfor (let i = 0; i < 8; i++) {\n  scratchCorners[i] = new Cartesian3();\n}\n\nfunction orthogonal(a, b, epsilon) {\n  return Math.abs(Cartesian4.dot(a, b)) < epsilon;\n}\n\nfunction isValidOrientedBoundingBoxTransformation(matrix) {\n  const column0 = Matrix4.getColumn(matrix, 0, scratchColumn0);\n  const column1 = Matrix4.getColumn(matrix, 1, scratchColumn1);\n  const column2 = Matrix4.getColumn(matrix, 2, scratchColumn2);\n\n  const epsilon = CesiumMath.EPSILON4;\n\n  return (\n    orthogonal(column0, column1, epsilon) &&\n    orthogonal(column1, column2, epsilon)\n  );\n}\n\nfunction computeLooseOrientedBoundingBox(matrix, result) {\n  const corners = scratchCorners;\n  Cartesian3.fromElements(-0.5, -0.5, -0.5, corners[0]);\n  Cartesian3.fromElements(-0.5, -0.5, 0.5, corners[1]);\n  Cartesian3.fromElements(-0.5, 0.5, -0.5, corners[2]);\n  Cartesian3.fromElements(-0.5, 0.5, 0.5, corners[3]);\n  Cartesian3.fromElements(0.5, -0.5, -0.5, corners[4]);\n  Cartesian3.fromElements(0.5, -0.5, 0.5, corners[5]);\n  Cartesian3.fromElements(0.5, 0.5, -0.5, corners[6]);\n  Cartesian3.fromElements(0.5, 0.5, 0.5, corners[7]);\n\n  for (let i = 0; i < 8; ++i) {\n    Matrix4.multiplyByPoint(matrix, corners[i], corners[i]);\n  }\n\n  return OrientedBoundingBox.fromPoints(corners, result);\n}\n\n/**\n * Computes an {@link OrientedBoundingBox} for a subregion of the shape.\n *\n * @function\n *\n * @param {number} radiusStart The radiusStart.\n * @param {number} radiusEnd The radiusEnd.\n * @param {number} heightStart The heightStart.\n * @param {number} heightEnd The heightEnd.\n * @param {number} angleStart The angleStart.\n * @param {number} angleEnd The angleEnd.\n * @param {Matrix4} matrix The matrix to transform the points.\n * @param {OrientedBoundingBox} result The object onto which to store the result.\n * @returns {OrientedBoundingBox} The oriented bounding box that contains this subregion.\n *\n * @private\n */\nfunction getCylinderChunkObb(\n  radiusStart,\n  radiusEnd,\n  heightStart,\n  heightEnd,\n  angleStart,\n  angleEnd,\n  matrix,\n  result\n) {\n  const defaultMinBounds = VoxelCylinderShape.DefaultMinBounds;\n  const defaultMaxBounds = VoxelCylinderShape.DefaultMaxBounds;\n  const defaultMinRadius = defaultMinBounds.x; // 0\n  const defaultMaxRadius = defaultMaxBounds.x; // 1\n  const defaultMinHeight = defaultMinBounds.y; // -1\n  const defaultMaxHeight = defaultMaxBounds.y; // +1\n  const defaultMinAngle = defaultMinBounds.z; // -pi\n  const defaultMaxAngle = defaultMaxBounds.z; // +pi\n\n  // Return early if using the default bounds\n  if (\n    radiusStart === defaultMinRadius &&\n    radiusEnd === defaultMaxRadius &&\n    heightStart === defaultMinHeight &&\n    heightEnd === defaultMaxHeight &&\n    angleStart === defaultMinAngle &&\n    angleEnd === defaultMaxAngle\n  ) {\n    result.center = Matrix4.getTranslation(matrix, result.center);\n    result.halfAxes = Matrix4.getMatrix3(matrix, result.halfAxes);\n    return result;\n  }\n\n  const isAngleReversed = angleEnd < angleStart;\n\n  if (isAngleReversed) {\n    angleEnd += CesiumMath.TWO_PI;\n  }\n\n  const angleRange = angleEnd - angleStart;\n  const angleMid = angleStart + angleRange * 0.5;\n\n  const testAngles = scratchTestAngles;\n  let testAngleCount = 0;\n\n  testAngles[testAngleCount++] = angleStart;\n  testAngles[testAngleCount++] = angleEnd;\n  testAngles[testAngleCount++] = angleMid;\n\n  if (angleRange > CesiumMath.PI) {\n    testAngles[testAngleCount++] = angleMid - CesiumMath.PI_OVER_TWO;\n    testAngles[testAngleCount++] = angleMid + CesiumMath.PI_OVER_TWO;\n  }\n\n  // Find bounding box in shape space relative to angleMid\n  let minX = 1.0;\n  let minY = 1.0;\n  let maxX = -1.0;\n  let maxY = -1.0;\n\n  for (let i = 0; i < testAngleCount; ++i) {\n    const angle = testAngles[i] - angleMid;\n    const cosAngle = Math.cos(angle);\n    const sinAngle = Math.sin(angle);\n    const x1 = cosAngle * radiusStart;\n    const y1 = sinAngle * radiusStart;\n    const x2 = cosAngle * radiusEnd;\n    const y2 = sinAngle * radiusEnd;\n\n    minX = Math.min(minX, x1);\n    minY = Math.min(minY, y1);\n    minX = Math.min(minX, x2);\n    minY = Math.min(minY, y2);\n    maxX = Math.max(maxX, x1);\n    maxY = Math.max(maxY, y1);\n    maxX = Math.max(maxX, x2);\n    maxY = Math.max(maxY, y2);\n  }\n\n  const extentX = maxX - minX;\n  const extentY = maxY - minY;\n  const extentZ = heightEnd - heightStart;\n\n  const centerX = (minX + maxX) * 0.5;\n  const centerY = (minY + maxY) * 0.5;\n  const centerZ = (heightStart + heightEnd) * 0.5;\n\n  const translation = Cartesian3.fromElements(\n    centerX,\n    centerY,\n    centerZ,\n    scratchTranslation\n  );\n\n  const rotation = Matrix3.fromRotationZ(angleMid, scratchRotation);\n\n  const scale = Cartesian3.fromElements(\n    extentX,\n    extentY,\n    extentZ,\n    scratchScale\n  );\n\n  const scaleMatrix = Matrix4.fromScale(scale, scratchScaleMatrix);\n  const rotationMatrix = Matrix4.fromRotation(rotation, scratchRotationMatrix);\n  const translationMatrix = Matrix4.fromTranslation(\n    translation,\n    scratchTranslationMatrix\n  );\n\n  // Shape space matrix = R * T * S\n  const localMatrix = Matrix4.multiplyTransformation(\n    rotationMatrix,\n    Matrix4.multiplyTransformation(\n      translationMatrix,\n      scaleMatrix,\n      scratchMatrix\n    ),\n    scratchMatrix\n  );\n\n  const globalMatrix = Matrix4.multiplyTransformation(\n    matrix,\n    localMatrix,\n    scratchMatrix\n  );\n\n  if (!isValidOrientedBoundingBoxTransformation(globalMatrix)) {\n    return computeLooseOrientedBoundingBox(globalMatrix, result);\n  }\n\n  return OrientedBoundingBox.fromTransformation(globalMatrix, result);\n}\n\nexport default VoxelCylinderShape;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\n\n/**\n * An ellipsoid {@link VoxelShape}.\n *\n * @alias VoxelEllipsoidShape\n * @constructor\n *\n * @see VoxelShape\n * @see VoxelBoxShape\n * @see VoxelCylinderShape\n * @see VoxelShapeType\n *\n * @private\n */\nfunction VoxelEllipsoidShape() {\n  /**\n   * An oriented bounding box containing the bounded shape.\n   * The update function must be called before accessing this value.\n   * @type {OrientedBoundingBox}\n   * @readonly\n   */\n  this.orientedBoundingBox = new OrientedBoundingBox();\n\n  /**\n   * A bounding sphere containing the bounded shape.\n   * The update function must be called before accessing this value.\n   * @type {BoundingSphere}\n   * @readonly\n   */\n  this.boundingSphere = new BoundingSphere();\n\n  /**\n   * A transformation matrix containing the bounded shape.\n   * The update function must be called before accessing this value.\n   * @type {Matrix4}\n   * @readonly\n   */\n  this.boundTransform = new Matrix4();\n\n  /**\n   * A transformation matrix containing the shape, ignoring the bounds.\n   * The update function must be called before accessing this value.\n   * @type {Matrix4}\n   * @readonly\n   */\n  this.shapeTransform = new Matrix4();\n\n  /**\n   * @type {Rectangle}\n   */\n  this._rectangle = new Rectangle();\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._minimumHeight = VoxelEllipsoidShape.DefaultMinBounds.z;\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._maximumHeight = VoxelEllipsoidShape.DefaultMaxBounds.z;\n\n  /**\n   * @type {Ellipsoid}\n   * @private\n   */\n  this._ellipsoid = new Ellipsoid();\n\n  /**\n   * @type {Cartesian3}\n   */\n  this._translation = new Cartesian3();\n\n  /**\n   * @type {Matrix3}\n   */\n  this._rotation = new Matrix3();\n\n  /**\n   * @type {Object<string, any>}\n   * @readonly\n   */\n  this.shaderUniforms = {\n    ellipsoidRadiiUv: new Cartesian3(),\n    ellipsoidInverseRadiiSquaredUv: new Cartesian3(),\n    ellipsoidRenderLongitudeMinMax: new Cartesian2(),\n    ellipsoidShapeUvLongitudeMinMaxMid: new Cartesian3(),\n    ellipsoidUvToShapeUvLongitude: new Cartesian2(),\n    ellipsoidUvToShapeUvLatitude: new Cartesian2(),\n    ellipsoidRenderLatitudeCosSqrHalfMinMax: new Cartesian2(),\n    ellipsoidInverseHeightDifferenceUv: 0.0,\n    ellipseInnerRadiiUv: new Cartesian2(),\n    ellipsoidInverseInnerScaleUv: 0.0,\n    ellipsoidInverseOuterScaleUv: 0.0,\n  };\n\n  /**\n   * @type {Object<string, any>}\n   * @readonly\n   */\n  this.shaderDefines = {\n    ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY: undefined,\n    ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE: undefined,\n    ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO: undefined,\n    ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO: undefined,\n    ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE: undefined,\n    ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN: undefined,\n    ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT: undefined,\n    ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN: undefined,\n    ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT: undefined,\n    ELLIPSOID_IS_SPHERE: undefined,\n    ELLIPSOID_INTERSECTION_INDEX_LONGITUDE: undefined,\n    ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX: undefined,\n    ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN: undefined,\n    ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX: undefined,\n    ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN: undefined,\n  };\n\n  /**\n   * The maximum number of intersections against the shape for any ray direction.\n   * @type {number}\n   * @readonly\n   */\n  this.shaderMaximumIntersectionsLength = 0; // not known until update\n}\n\nconst scratchScale = new Cartesian3();\nconst scratchRotationScale = new Matrix3();\nconst scratchShapeOuterExtent = new Cartesian3();\nconst scratchShapeInnerExtent = new Cartesian3();\nconst scratchRenderOuterExtent = new Cartesian3();\nconst scratchRenderInnerExtent = new Cartesian3();\nconst scratchRenderRectangle = new Rectangle();\n\n/**\n * Update the shape's state.\n *\n * @param {Matrix4} modelMatrix The model matrix.\n * @param {Cartesian3} minBounds The minimum bounds.\n * @param {Cartesian3} maxBounds The maximum bounds.\n * @param {Cartesian3} [clipMinBounds=VoxelEllipsoidShape.DefaultMinBounds] The minimum clip bounds.\n * @param {Cartesian3} [clipMaxBounds=VoxelEllipsoidShape.DefaultMaxBounds] The maximum clip bounds.\n * @returns {boolean} Whether the shape is visible.\n */\nVoxelEllipsoidShape.prototype.update = function (\n  modelMatrix,\n  minBounds,\n  maxBounds,\n  clipMinBounds,\n  clipMaxBounds\n) {\n  clipMinBounds = defaultValue(\n    clipMinBounds,\n    VoxelEllipsoidShape.DefaultMinBounds\n  );\n  clipMaxBounds = defaultValue(\n    clipMaxBounds,\n    VoxelEllipsoidShape.DefaultMaxBounds\n  );\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"modelMatrix\", modelMatrix);\n  Check.typeOf.object(\"minBounds\", minBounds);\n  Check.typeOf.object(\"maxBounds\", maxBounds);\n  //>>includeEnd('debug');\n\n  const defaultMinLongitude = VoxelEllipsoidShape.DefaultMinBounds.x;\n  const defaultMaxLongitude = VoxelEllipsoidShape.DefaultMaxBounds.x;\n  const defaultLongitudeRange = defaultMaxLongitude - defaultMinLongitude;\n  const defaultLongitudeRangeHalf = 0.5 * defaultLongitudeRange;\n  const defaultMinLatitude = VoxelEllipsoidShape.DefaultMinBounds.y;\n  const defaultMaxLatitude = VoxelEllipsoidShape.DefaultMaxBounds.y;\n  const defaultLatitudeRange = defaultMaxLatitude - defaultMinLatitude;\n\n  const epsilonZeroScale = CesiumMath.EPSILON10;\n  const epsilonLongitudeDiscontinuity = CesiumMath.EPSILON3; // 0.001 radians = 0.05729578 degrees\n  const epsilonLongitude = CesiumMath.EPSILON10;\n  const epsilonLatitude = CesiumMath.EPSILON10;\n  const epsilonLatitudeFlat = CesiumMath.EPSILON3; // 0.001 radians = 0.05729578 degrees\n\n  // Clamp the longitude / latitude to the valid range\n  const shapeMinLongitude = CesiumMath.clamp(\n    minBounds.x,\n    defaultMinLongitude,\n    defaultMaxLongitude\n  );\n  const shapeMaxLongitude = CesiumMath.clamp(\n    maxBounds.x,\n    defaultMinLongitude,\n    defaultMaxLongitude\n  );\n  const clipMinLongitude = CesiumMath.clamp(\n    clipMinBounds.x,\n    defaultMinLongitude,\n    defaultMaxLongitude\n  );\n  const clipMaxLongitude = CesiumMath.clamp(\n    clipMaxBounds.x,\n    defaultMinLongitude,\n    defaultMaxLongitude\n  );\n  const renderMinLongitude = Math.max(shapeMinLongitude, clipMinLongitude);\n  const renderMaxLongitude = Math.min(shapeMaxLongitude, clipMaxLongitude);\n\n  const shapeMinLatitude = CesiumMath.clamp(\n    minBounds.y,\n    defaultMinLatitude,\n    defaultMaxLatitude\n  );\n  const shapeMaxLatitude = CesiumMath.clamp(\n    maxBounds.y,\n    defaultMinLatitude,\n    defaultMaxLatitude\n  );\n  const clipMinLatitude = CesiumMath.clamp(\n    clipMinBounds.y,\n    defaultMinLatitude,\n    defaultMaxLatitude\n  );\n  const clipMaxLatitude = CesiumMath.clamp(\n    clipMaxBounds.y,\n    defaultMinLatitude,\n    defaultMaxLatitude\n  );\n\n  const renderMinLatitude = Math.max(shapeMinLatitude, clipMinLatitude);\n  const renderMaxLatitude = Math.min(shapeMaxLatitude, clipMaxLatitude);\n\n  // Don't let the height go below the center of the ellipsoid.\n  const radii = Matrix4.getScale(modelMatrix, scratchScale);\n  const isSphere = radii.x === radii.y && radii.y === radii.z;\n  const minRadius = Cartesian3.minimumComponent(radii);\n  const shapeMinHeight = Math.max(minBounds.z, -minRadius);\n  const shapeMaxHeight = Math.max(maxBounds.z, -minRadius);\n  const clipMinHeight = Math.max(clipMinBounds.z, -minRadius);\n  const clipMaxHeight = Math.max(clipMaxBounds.z, -minRadius);\n  const renderMinHeight = Math.max(shapeMinHeight, clipMinHeight);\n  const renderMaxHeight = Math.min(shapeMaxHeight, clipMaxHeight);\n\n  // Compute the closest and farthest a point can be from the center of the ellipsoid.\n  const shapeInnerExtent = Cartesian3.add(\n    radii,\n    Cartesian3.fromElements(\n      shapeMinHeight,\n      shapeMinHeight,\n      shapeMinHeight,\n      scratchShapeInnerExtent\n    ),\n    scratchShapeInnerExtent\n  );\n  const shapeOuterExtent = Cartesian3.add(\n    radii,\n    Cartesian3.fromElements(\n      shapeMaxHeight,\n      shapeMaxHeight,\n      shapeMaxHeight,\n      scratchShapeOuterExtent\n    ),\n    scratchShapeOuterExtent\n  );\n  const shapeMaxExtent = Cartesian3.maximumComponent(shapeOuterExtent);\n\n  const renderInnerExtent = Cartesian3.add(\n    radii,\n    Cartesian3.fromElements(\n      renderMinHeight,\n      renderMinHeight,\n      renderMinHeight,\n      scratchRenderInnerExtent\n    ),\n    scratchRenderInnerExtent\n  );\n  const renderOuterExtent = Cartesian3.add(\n    radii,\n    Cartesian3.fromElements(\n      renderMaxHeight,\n      renderMaxHeight,\n      renderMaxHeight,\n      scratchRenderOuterExtent\n    ),\n    scratchRenderOuterExtent\n  );\n\n  // Exit early if the shape is not visible.\n  // Note that minLongitude may be greater than maxLongitude when crossing the 180th meridian.\n  if (\n    renderMinLatitude > renderMaxLatitude ||\n    renderMinLatitude === defaultMaxLatitude ||\n    renderMaxLatitude === defaultMinLatitude ||\n    renderMinHeight > renderMaxHeight ||\n    CesiumMath.equalsEpsilon(\n      renderOuterExtent,\n      Cartesian3.ZERO,\n      undefined,\n      epsilonZeroScale\n    )\n  ) {\n    return false;\n  }\n\n  this._rectangle = Rectangle.fromRadians(\n    shapeMinLongitude,\n    shapeMinLatitude,\n    shapeMaxLongitude,\n    shapeMaxLatitude\n  );\n  this._translation = Matrix4.getTranslation(modelMatrix, this._translation);\n  this._rotation = Matrix4.getRotation(modelMatrix, this._rotation);\n  this._ellipsoid = Ellipsoid.fromCartesian3(radii, this._ellipsoid);\n  this._minimumHeight = shapeMinHeight;\n  this._maximumHeight = shapeMaxHeight;\n\n  const renderRectangle = Rectangle.fromRadians(\n    renderMinLongitude,\n    renderMinLatitude,\n    renderMaxLongitude,\n    renderMaxLatitude,\n    scratchRenderRectangle\n  );\n\n  this.orientedBoundingBox = getEllipsoidChunkObb(\n    renderRectangle,\n    renderMinHeight,\n    renderMaxHeight,\n    this._ellipsoid,\n    this._translation,\n    this._rotation,\n    this.orientedBoundingBox\n  );\n\n  this.shapeTransform = Matrix4.fromRotationTranslation(\n    Matrix3.setScale(this._rotation, shapeOuterExtent, scratchRotationScale),\n    this._translation,\n    this.shapeTransform\n  );\n\n  this.boundTransform = Matrix4.fromRotationTranslation(\n    this.orientedBoundingBox.halfAxes,\n    this.orientedBoundingBox.center,\n    this.boundTransform\n  );\n\n  this.boundingSphere = BoundingSphere.fromOrientedBoundingBox(\n    this.orientedBoundingBox,\n    this.boundingSphere\n  );\n\n  // Longitude\n  const renderIsLongitudeReversed = renderMaxLongitude < renderMinLongitude;\n  const renderLongitudeRange =\n    renderMaxLongitude -\n    renderMinLongitude +\n    renderIsLongitudeReversed * defaultLongitudeRange;\n  const renderIsLongitudeRangeZero = renderLongitudeRange <= epsilonLongitude;\n  const renderIsLongitudeRangeUnderHalf =\n    renderLongitudeRange > defaultLongitudeRangeHalf + epsilonLongitude &&\n    renderLongitudeRange < defaultLongitudeRange - epsilonLongitude;\n  const renderIsLongitudeRangeHalf =\n    renderLongitudeRange >= defaultLongitudeRangeHalf - epsilonLongitude &&\n    renderLongitudeRange <= defaultLongitudeRangeHalf + epsilonLongitude;\n  const renderIsLongitudeRangeOverHalf =\n    renderLongitudeRange > epsilonLongitude &&\n    renderLongitudeRange < defaultLongitudeRangeHalf - epsilonLongitude;\n  const renderHasLongitude =\n    renderIsLongitudeRangeZero ||\n    renderIsLongitudeRangeUnderHalf ||\n    renderIsLongitudeRangeHalf ||\n    renderIsLongitudeRangeOverHalf;\n\n  const shapeIsLongitudeReversed = shapeMaxLongitude < shapeMinLongitude;\n  const shapeLongitudeRange =\n    shapeMaxLongitude -\n    shapeMinLongitude +\n    shapeIsLongitudeReversed * defaultLongitudeRange;\n  const shapeIsLongitudeRangeZero = shapeLongitudeRange <= epsilonLongitude;\n  const shapeIsLongitudeRangeUnderHalf =\n    shapeLongitudeRange > defaultLongitudeRangeHalf + epsilonLongitude &&\n    shapeLongitudeRange < defaultLongitudeRange - epsilonLongitude;\n  const shapeIsLongitudeRangeHalf =\n    shapeLongitudeRange >= defaultLongitudeRangeHalf - epsilonLongitude &&\n    shapeLongitudeRange <= defaultLongitudeRangeHalf + epsilonLongitude;\n  const shapeIsLongitudeRangeOverHalf =\n    shapeLongitudeRange > epsilonLongitude &&\n    shapeLongitudeRange < defaultLongitudeRangeHalf - epsilonLongitude;\n  const shapeHasLongitude =\n    shapeIsLongitudeRangeZero ||\n    shapeIsLongitudeRangeUnderHalf ||\n    shapeIsLongitudeRangeHalf ||\n    shapeIsLongitudeRangeOverHalf;\n\n  // Latitude\n  const renderIsLatitudeMaxUnderHalf = renderMaxLatitude < -epsilonLatitudeFlat;\n  const renderIsLatitudeMaxHalf =\n    renderMaxLatitude >= -epsilonLatitudeFlat &&\n    renderMaxLatitude <= +epsilonLatitudeFlat;\n  const renderIsLatitudeMaxOverHalf =\n    renderMaxLatitude > +epsilonLatitudeFlat &&\n    renderMaxLatitude < defaultMaxLatitude - epsilonLatitude;\n  const renderHasLatitudeMax =\n    renderIsLatitudeMaxUnderHalf ||\n    renderIsLatitudeMaxHalf ||\n    renderIsLatitudeMaxOverHalf;\n  const renderIsLatitudeMinUnderHalf =\n    renderMinLatitude > defaultMinLatitude + epsilonLatitude &&\n    renderMinLatitude < -epsilonLatitudeFlat;\n  const renderIsLatitudeMinHalf =\n    renderMinLatitude >= -epsilonLatitudeFlat &&\n    renderMinLatitude <= +epsilonLatitudeFlat;\n  const renderIsLatitudeMinOverHalf = renderMinLatitude > +epsilonLatitudeFlat;\n  const renderHasLatitudeMin =\n    renderIsLatitudeMinUnderHalf ||\n    renderIsLatitudeMinHalf ||\n    renderIsLatitudeMinOverHalf;\n  const renderHasLatitude = renderHasLatitudeMax || renderHasLatitudeMin;\n\n  const shapeLatitudeRange = shapeMaxLatitude - shapeMinLatitude;\n  const shapeIsLatitudeMaxUnderHalf = shapeMaxLatitude < -epsilonLatitudeFlat;\n  const shapeIsLatitudeMaxHalf =\n    shapeMaxLatitude >= -epsilonLatitudeFlat &&\n    shapeMaxLatitude <= +epsilonLatitudeFlat;\n  const shapeIsLatitudeMaxOverHalf =\n    shapeMaxLatitude > +epsilonLatitudeFlat &&\n    shapeMaxLatitude < defaultMaxLatitude - epsilonLatitude;\n  const shapeHasLatitudeMax =\n    shapeIsLatitudeMaxUnderHalf ||\n    shapeIsLatitudeMaxHalf ||\n    shapeIsLatitudeMaxOverHalf;\n  const shapeIsLatitudeMinUnderHalf =\n    shapeMinLatitude > defaultMinLatitude + epsilonLatitude &&\n    shapeMinLatitude < -epsilonLatitudeFlat;\n  const shapeIsLatitudeMinHalf =\n    shapeMinLatitude >= -epsilonLatitudeFlat &&\n    shapeMinLatitude <= +epsilonLatitudeFlat;\n  const shapeIsLatitudeMinOverHalf = shapeMinLatitude > +epsilonLatitudeFlat;\n  const shapeHasLatitudeMin =\n    shapeIsLatitudeMinUnderHalf ||\n    shapeIsLatitudeMinHalf ||\n    shapeIsLatitudeMinOverHalf;\n  const shapeHasLatitude = shapeHasLatitudeMax || shapeHasLatitudeMin;\n\n  // Height\n  const renderHasMinHeight = !Cartesian3.equals(\n    renderInnerExtent,\n    Cartesian3.ZERO\n  );\n  const renderHasMaxHeight = !Cartesian3.equals(\n    renderOuterExtent,\n    Cartesian3.ZERO\n  );\n  const renderHasHeight = renderHasMinHeight || renderHasMaxHeight;\n  const renderHeightRange = renderMaxHeight - renderMinHeight;\n  const shapeHasMinHeight = !Cartesian3.equals(\n    shapeInnerExtent,\n    Cartesian3.ZERO\n  );\n  const shapeHasMaxHeight = !Cartesian3.equals(\n    shapeOuterExtent,\n    Cartesian3.ZERO\n  );\n  const shapeHasHeight = shapeHasMinHeight || shapeHasMaxHeight;\n\n  const shaderUniforms = this.shaderUniforms;\n  const shaderDefines = this.shaderDefines;\n\n  // To keep things simple, clear the defines every time\n  for (const key in shaderDefines) {\n    if (shaderDefines.hasOwnProperty(key)) {\n      shaderDefines[key] = undefined;\n    }\n  }\n\n  // The ellipsoid radii scaled to [0,1]. The max ellipsoid radius will be 1.0 and others will be less.\n  shaderUniforms.ellipsoidRadiiUv = Cartesian3.divideByScalar(\n    shapeOuterExtent,\n    shapeMaxExtent,\n    shaderUniforms.ellipsoidRadiiUv\n  );\n\n  // Used to compute geodetic surface normal.\n  shaderUniforms.ellipsoidInverseRadiiSquaredUv = Cartesian3.divideComponents(\n    Cartesian3.ONE,\n    Cartesian3.multiplyComponents(\n      shaderUniforms.ellipsoidRadiiUv,\n      shaderUniforms.ellipsoidRadiiUv,\n      shaderUniforms.ellipsoidInverseRadiiSquaredUv\n    ),\n    shaderUniforms.ellipsoidInverseRadiiSquaredUv\n  );\n\n  // Keep track of how many intersections there are going to be.\n  let intersectionCount = 0;\n\n  // Intersects an outer ellipsoid for the max height.\n  shaderDefines[\"ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX\"] = intersectionCount;\n  intersectionCount += 1;\n\n  if (renderHasHeight) {\n    if (renderHeightRange === 0.0) {\n      shaderDefines[\"ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT\"] = true;\n    }\n\n    if (renderHasMinHeight) {\n      shaderDefines[\"ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN\"] = true;\n      shaderDefines[\n        \"ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN\"\n      ] = intersectionCount;\n      intersectionCount += 1;\n\n      // The inverse of the percent of space that is taken up by the inner ellipsoid, relative to the shape bounds\n      // 1.0 / (1.0 - thickness) // thickness = percent of space that is between the min and max height.\n      // 1.0 / (1.0 - (shapeMaxHeight - renderMinHeight) / shapeMaxExtent)\n      // shapeMaxExtent / (shapeMaxExtent - (shapeMaxHeight - renderMinHeight))\n      shaderUniforms.ellipsoidInverseInnerScaleUv =\n        shapeMaxExtent / (shapeMaxExtent - (shapeMaxHeight - renderMinHeight));\n    }\n\n    if (renderHasMaxHeight) {\n      shaderDefines[\"ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX\"] = true;\n      shaderUniforms.ellipsoidInverseOuterScaleUv =\n        shapeMaxExtent / (shapeMaxExtent - (shapeMaxHeight - renderMaxHeight));\n    }\n  }\n\n  if (shapeHasHeight) {\n    if (shapeHasMinHeight) {\n      shaderDefines[\"ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN\"] = true;\n\n      // The percent of space that is between the inner and outer ellipsoid.\n      const thickness = (shapeMaxHeight - shapeMinHeight) / shapeMaxExtent;\n      shaderUniforms.ellipsoidInverseHeightDifferenceUv = 1.0 / thickness;\n      shaderUniforms.ellipseInnerRadiiUv = Cartesian2.fromElements(\n        shaderUniforms.ellipsoidRadiiUv.x * (1.0 - thickness),\n        shaderUniforms.ellipsoidRadiiUv.z * (1.0 - thickness),\n        shaderUniforms.ellipseInnerRadiiUv\n      );\n    }\n    if (shapeMinHeight === shapeMaxHeight) {\n      shaderDefines[\"ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT\"] = true;\n    }\n  }\n\n  // Intersects a wedge for the min and max longitude.\n  if (renderHasLongitude) {\n    shaderDefines[\"ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE\"] = true;\n    shaderDefines[\"ELLIPSOID_INTERSECTION_INDEX_LONGITUDE\"] = intersectionCount;\n\n    if (renderIsLongitudeRangeUnderHalf) {\n      shaderDefines[\n        \"ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF\"\n      ] = true;\n      intersectionCount += 1;\n    } else if (renderIsLongitudeRangeOverHalf) {\n      shaderDefines[\n        \"ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF\"\n      ] = true;\n      intersectionCount += 2;\n    } else if (renderIsLongitudeRangeHalf) {\n      shaderDefines[\n        \"ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF\"\n      ] = true;\n      intersectionCount += 1;\n    } else if (renderIsLongitudeRangeZero) {\n      shaderDefines[\n        \"ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO\"\n      ] = true;\n      intersectionCount += 2;\n    }\n\n    shaderUniforms.ellipsoidRenderLongitudeMinMax = Cartesian2.fromElements(\n      renderMinLongitude,\n      renderMaxLongitude,\n      shaderUniforms.ellipsoidRenderLongitudeMinMax\n    );\n  }\n\n  if (shapeHasLongitude) {\n    shaderDefines[\"ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE\"] = true;\n\n    const shapeIsLongitudeReversed = shapeMaxLongitude < shapeMinLongitude;\n\n    if (shapeIsLongitudeReversed) {\n      shaderDefines[\n        \"ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED\"\n      ] = true;\n    }\n\n    // delerp(longitudeUv, minLongitudeUv, maxLongitudeUv)\n    // (longitudeUv - minLongitudeUv) / (maxLongitudeUv - minLongitudeUv)\n    // longitudeUv / (maxLongitudeUv - minLongitudeUv) - minLongitudeUv / (maxLongitudeUv - minLongitudeUv)\n    // scale = 1.0 / (maxLongitudeUv - minLongitudeUv)\n    // scale = 1.0 / (((maxLongitude - pi) / (2.0 * pi)) - ((minLongitude - pi) / (2.0 * pi)))\n    // scale = 2.0 * pi / (maxLongitude - minLongitude)\n    // offset = -minLongitudeUv / (maxLongitudeUv - minLongitudeUv)\n    // offset = -((minLongitude - pi) / (2.0 * pi)) / (((maxLongitude - pi) / (2.0 * pi)) - ((minLongitude - pi) / (2.0 * pi)))\n    // offset = -(minLongitude - pi) / (maxLongitude - minLongitude)\n    const scale = defaultLongitudeRange / shapeLongitudeRange;\n    const offset =\n      -(shapeMinLongitude - defaultMinLongitude) / shapeLongitudeRange;\n    shaderUniforms.ellipsoidUvToShapeUvLongitude = Cartesian2.fromElements(\n      scale,\n      offset,\n      shaderUniforms.ellipsoidUvToShapeUvLongitude\n    );\n  }\n\n  if (renderHasLongitude) {\n    const renderIsMinLongitudeDiscontinuity = CesiumMath.equalsEpsilon(\n      renderMinLongitude,\n      defaultMinLongitude,\n      undefined,\n      epsilonLongitudeDiscontinuity\n    );\n    const renderIsMaxLongitudeDiscontinuity = CesiumMath.equalsEpsilon(\n      renderMaxLongitude,\n      defaultMaxLongitude,\n      undefined,\n      epsilonLongitudeDiscontinuity\n    );\n\n    if (renderIsMinLongitudeDiscontinuity) {\n      shaderDefines[\n        \"ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY\"\n      ] = true;\n    }\n    if (renderIsMaxLongitudeDiscontinuity) {\n      shaderDefines[\n        \"ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY\"\n      ] = true;\n    }\n    const uvShapeMinLongitude =\n      (shapeMinLongitude - defaultMinLongitude) / defaultLongitudeRange;\n    const uvShapeMaxLongitude =\n      (shapeMaxLongitude - defaultMinLongitude) / defaultLongitudeRange;\n\n    const uvRenderMaxLongitude =\n      (renderMaxLongitude - defaultMinLongitude) / defaultLongitudeRange;\n    const uvRenderLongitudeRangeZero =\n      1.0 - renderLongitudeRange / defaultLongitudeRange;\n    const uvRenderLongitudeRangeZeroMid =\n      (uvRenderMaxLongitude + 0.5 * uvRenderLongitudeRangeZero) % 1.0;\n\n    shaderUniforms.ellipsoidShapeUvLongitudeMinMaxMid = Cartesian3.fromElements(\n      uvShapeMinLongitude,\n      uvShapeMaxLongitude,\n      uvRenderLongitudeRangeZeroMid,\n      shaderUniforms.ellipsoidShapeUvLongitudeMinMaxMid\n    );\n  }\n\n  if (renderHasLatitude) {\n    shaderDefines[\"ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE\"] = true;\n\n    // Intersects a cone for min latitude\n    if (renderHasLatitudeMin) {\n      shaderDefines[\"ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN\"] = true;\n      shaderDefines[\n        \"ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN\"\n      ] = intersectionCount;\n\n      if (renderIsLatitudeMinUnderHalf) {\n        shaderDefines[\n          \"ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF\"\n        ] = true;\n        intersectionCount += 1;\n      } else if (renderIsLatitudeMinHalf) {\n        shaderDefines[\n          \"ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF\"\n        ] = true;\n        intersectionCount += 1;\n      } else if (renderIsLatitudeMinOverHalf) {\n        shaderDefines[\n          \"ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF\"\n        ] = true;\n        intersectionCount += 2;\n      }\n    }\n\n    // Intersects a cone for max latitude\n    if (renderHasLatitudeMax) {\n      shaderDefines[\"ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX\"] = true;\n      shaderDefines[\n        \"ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX\"\n      ] = intersectionCount;\n\n      if (renderIsLatitudeMaxUnderHalf) {\n        shaderDefines[\n          \"ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF\"\n        ] = true;\n        intersectionCount += 2;\n      } else if (renderIsLatitudeMaxHalf) {\n        shaderDefines[\n          \"ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF\"\n        ] = true;\n        intersectionCount += 1;\n      } else if (renderIsLatitudeMaxOverHalf) {\n        shaderDefines[\n          \"ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF\"\n        ] = true;\n        intersectionCount += 1;\n      }\n    }\n\n    if (renderMinLatitude === renderMaxLatitude) {\n      shaderDefines[\n        \"ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO\"\n      ] = true;\n    }\n\n    const minCosHalfAngleSqr = Math.pow(\n      Math.cos(CesiumMath.PI_OVER_TWO - Math.abs(renderMinLatitude)),\n      2.0\n    );\n    const maxCosHalfAngleSqr = Math.pow(\n      Math.cos(CesiumMath.PI_OVER_TWO - Math.abs(renderMaxLatitude)),\n      2.0\n    );\n    shaderUniforms.ellipsoidRenderLatitudeCosSqrHalfMinMax = Cartesian2.fromElements(\n      minCosHalfAngleSqr,\n      maxCosHalfAngleSqr,\n      shaderUniforms.ellipsoidRenderLatitudeCosSqrHalfMinMax\n    );\n  }\n\n  if (shapeHasLatitude) {\n    shaderDefines[\"ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE\"] = true;\n\n    if (shapeMinLatitude === shapeMaxLatitude) {\n      shaderDefines[\n        \"ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO\"\n      ] = true;\n    }\n\n    // delerp(latitudeUv, minLatitudeUv, maxLatitudeUv)\n    // (latitudeUv - minLatitudeUv) / (maxLatitudeUv - minLatitudeUv)\n    // latitudeUv / (maxLatitudeUv - minLatitudeUv) - minLatitudeUv / (maxLatitudeUv - minLatitudeUv)\n    // scale = 1.0 / (maxLatitudeUv - minLatitudeUv)\n    // scale = 1.0 / (((maxLatitude - pi) / (2.0 * pi)) - ((minLatitude - pi) / (2.0 * pi)))\n    // scale = 2.0 * pi / (maxLatitude - minLatitude)\n    // offset = -minLatitudeUv / (maxLatitudeUv - minLatitudeUv)\n    // offset = -((minLatitude - -pi) / (2.0 * pi)) / (((maxLatitude - pi) / (2.0 * pi)) - ((minLatitude - pi) / (2.0 * pi)))\n    // offset = -(minLatitude - -pi) / (maxLatitude - minLatitude)\n    // offset = (-pi - minLatitude) / (maxLatitude - minLatitude)\n    const scale = defaultLatitudeRange / shapeLatitudeRange;\n    const offset = (defaultMinLatitude - shapeMinLatitude) / shapeLatitudeRange;\n    shaderUniforms.ellipsoidUvToShapeUvLatitude = Cartesian2.fromElements(\n      scale,\n      offset,\n      shaderUniforms.ellipsoidUvToShapeUvLatitude\n    );\n  }\n\n  if (isSphere) {\n    shaderDefines[\"ELLIPSOID_IS_SPHERE\"] = true;\n  }\n\n  this.shaderMaximumIntersectionsLength = intersectionCount;\n\n  return true;\n};\n\nconst scratchRectangle = new Rectangle();\n\n/**\n * Computes an oriented bounding box for a specified tile.\n * The update function must be called before calling this function.\n *\n * @param {number} tileLevel The tile's level.\n * @param {number} tileX The tile's x coordinate.\n * @param {number} tileY The tile's y coordinate.\n * @param {number} tileZ The tile's z coordinate.\n * @param {OrientedBoundingBox} result The oriented bounding box that will be set to enclose the specified tile\n * @returns {OrientedBoundingBox} The oriented bounding box.\n */\nVoxelEllipsoidShape.prototype.computeOrientedBoundingBoxForTile = function (\n  tileLevel,\n  tileX,\n  tileY,\n  tileZ,\n  result\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"tileLevel\", tileLevel);\n  Check.typeOf.number(\"tileX\", tileX);\n  Check.typeOf.number(\"tileY\", tileY);\n  Check.typeOf.number(\"tileZ\", tileZ);\n  Check.typeOf.object(\"result\", result);\n  //>>includeEnd('debug');\n\n  const sizeAtLevel = 1.0 / Math.pow(2.0, tileLevel);\n  const minLongitudeLerp = tileX * sizeAtLevel;\n  const maxLongitudeLerp = (tileX + 1) * sizeAtLevel;\n  const minLatitudeLerp = tileY * sizeAtLevel;\n  const maxLatitudeLerp = (tileY + 1) * sizeAtLevel;\n  const minHeightLerp = tileZ * sizeAtLevel;\n  const maxHeightLerp = (tileZ + 1) * sizeAtLevel;\n\n  const rectangle = Rectangle.subsection(\n    this._rectangle,\n    minLongitudeLerp,\n    minLatitudeLerp,\n    maxLongitudeLerp,\n    maxLatitudeLerp,\n    scratchRectangle\n  );\n\n  const minHeight = CesiumMath.lerp(\n    this._minimumHeight,\n    this._maximumHeight,\n    minHeightLerp\n  );\n\n  const maxHeight = CesiumMath.lerp(\n    this._minimumHeight,\n    this._maximumHeight,\n    maxHeightLerp\n  );\n\n  return getEllipsoidChunkObb(\n    rectangle,\n    minHeight,\n    maxHeight,\n    this._ellipsoid,\n    this._translation,\n    this._rotation,\n    result\n  );\n};\n\n/**\n * Computes an approximate step size for raymarching the root tile of a voxel grid.\n * The update function must be called before calling this function.\n *\n * @param {Cartesian3} dimensions The voxel grid dimensions for a tile.\n * @returns {number} The step size.\n */\nVoxelEllipsoidShape.prototype.computeApproximateStepSize = function (\n  dimensions\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"dimensions\", dimensions);\n  //>>includeEnd('debug');\n\n  const ellipsoid = this._ellipsoid;\n  const ellipsoidMaximumRadius = ellipsoid.maximumRadius;\n  const minimumHeight = this._minimumHeight;\n  const maximumHeight = this._maximumHeight;\n\n  const shellToEllipsoidRatio =\n    (maximumHeight - minimumHeight) / (ellipsoidMaximumRadius + maximumHeight);\n  const stepSize = (0.5 * shellToEllipsoidRatio) / dimensions.z;\n  return stepSize;\n};\n\n/**\n * Computes an {@link OrientedBoundingBox} for a subregion of the shape.\n *\n * @function\n *\n * @param {Rectangle} rectangle The rectangle.\n * @param {number} minHeight The minimumZ.\n * @param {number} maxHeight The maximumZ.\n * @param {Ellipsoid} ellipsoid The ellipsoid.\n * @param {Cartesian3} translation The translation applied to the shape\n * @param {Matrix3} rotation The rotation applied to the shape\n * @param {OrientedBoundingBox} result The object onto which to store the result.\n * @returns {OrientedBoundingBox} The oriented bounding box that contains this subregion.\n *\n * @private\n */\nfunction getEllipsoidChunkObb(\n  rectangle,\n  minHeight,\n  maxHeight,\n  ellipsoid,\n  translation,\n  rotation,\n  result\n) {\n  result = OrientedBoundingBox.fromRectangle(\n    rectangle,\n    minHeight,\n    maxHeight,\n    ellipsoid,\n    result\n  );\n  result.center = Cartesian3.add(result.center, translation, result.center);\n  result.halfAxes = Matrix3.multiply(\n    result.halfAxes,\n    rotation,\n    result.halfAxes\n  );\n  return result;\n}\n\n/**\n * Defines the minimum bounds of the shape. Corresponds to minimum longitude, latitude, height.\n *\n * @type {Cartesian3}\n * @constant\n * @readonly\n */\nVoxelEllipsoidShape.DefaultMinBounds = Object.freeze(\n  new Cartesian3(-CesiumMath.PI, -CesiumMath.PI_OVER_TWO, -Number.MAX_VALUE)\n);\n\n/**\n * Defines the maximum bounds of the shape. Corresponds to maximum longitude, latitude, height.\n *\n * @type {Cartesian3}\n * @constant\n * @readonly\n */\nVoxelEllipsoidShape.DefaultMaxBounds = Object.freeze(\n  new Cartesian3(+CesiumMath.PI, +CesiumMath.PI_OVER_TWO, +Number.MAX_VALUE)\n);\n\nexport default VoxelEllipsoidShape;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\nimport VoxelBoxShape from \"./VoxelBoxShape.js\";\nimport VoxelCylinderShape from \"./VoxelCylinderShape.js\";\nimport VoxelEllipsoidShape from \"./VoxelEllipsoidShape.js\";\n\n/**\n * An enum of voxel shapes. The shape controls how the voxel grid is mapped to 3D space.\n *\n * @enum {string}\n *\n * @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst VoxelShapeType = {\n  /**\n   * A box shape.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  BOX: \"BOX\",\n  /**\n   * An ellipsoid shape.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  ELLIPSOID: \"ELLIPSOID\",\n  /**\n   * A cylinder shape.\n   *\n   * @type {string}\n   * @constant\n   * @private\n   */\n  CYLINDER: \"CYLINDER\",\n};\n\n/**\n * Gets the minimum bounds.\n * @param {VoxelShapeType} shapeType The voxel shape type.\n * @returns {Cartesian3} The minimum bounds.\n */\nVoxelShapeType.getMinBounds = function (shapeType) {\n  switch (shapeType) {\n    case VoxelShapeType.BOX:\n      return VoxelBoxShape.DefaultMinBounds;\n    case VoxelShapeType.ELLIPSOID:\n      return VoxelEllipsoidShape.DefaultMinBounds;\n    case VoxelShapeType.CYLINDER:\n      return VoxelCylinderShape.DefaultMinBounds;\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(`Invalid shape type ${shapeType}`);\n    //>>includeEnd('debug');\n  }\n};\n\n/**\n * Gets the maximum bounds.\n * @param {VoxelShapeType} shapeType The voxel shape type.\n * @returns {Cartesian3} The maximum bounds.\n */\nVoxelShapeType.getMaxBounds = function (shapeType) {\n  switch (shapeType) {\n    case VoxelShapeType.BOX:\n      return VoxelBoxShape.DefaultMaxBounds;\n    case VoxelShapeType.ELLIPSOID:\n      return VoxelEllipsoidShape.DefaultMaxBounds;\n    case VoxelShapeType.CYLINDER:\n      return VoxelCylinderShape.DefaultMaxBounds;\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(`Invalid shape type ${shapeType}`);\n    //>>includeEnd('debug');\n  }\n};\n\n/**\n * Converts a shape type to a constructor that can be used to create a shape\n * object or get per-shape properties like DefaultMinBounds and\n * DefaultMaxBounds.\n *\n * @param {VoxelShapeType} shapeType The shape type.\n * @returns {Function} The shape's constructor.\n *\n * @private\n */\nVoxelShapeType.getShapeConstructor = function (shapeType) {\n  switch (shapeType) {\n    case VoxelShapeType.BOX:\n      return VoxelBoxShape;\n    case VoxelShapeType.ELLIPSOID:\n      return VoxelEllipsoidShape;\n    case VoxelShapeType.CYLINDER:\n      return VoxelCylinderShape;\n    //>>includeStart('debug', pragmas.debug);\n    default:\n      throw new DeveloperError(`Invalid shape type ${shapeType}`);\n    //>>includeEnd('debug');\n  }\n};\n\nexport default Object.freeze(VoxelShapeType);\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Cesium3DTilesetMetadata from \"./Cesium3DTilesetMetadata.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport ImplicitSubtree from \"./ImplicitSubtree.js\";\nimport ImplicitSubtreeCache from \"./ImplicitSubtreeCache.js\";\nimport ImplicitTileCoordinates from \"./ImplicitTileCoordinates.js\";\nimport ImplicitTileset from \"./ImplicitTileset.js\";\nimport MetadataSemantic from \"./MetadataSemantic.js\";\nimport MetadataType from \"./MetadataType.js\";\nimport preprocess3DTileContent from \"./preprocess3DTileContent.js\";\nimport ResourceCache from \"./ResourceCache.js\";\nimport VoxelBoxShape from \"./VoxelBoxShape.js\";\nimport VoxelContent from \"./VoxelContent.js\";\nimport VoxelCylinderShape from \"./VoxelCylinderShape.js\";\nimport VoxelShapeType from \"./VoxelShapeType.js\";\n\n/**\n * A {@link VoxelProvider} that fetches voxel data from a 3D Tiles tileset.\n * <p>\n * Implements the {@link VoxelProvider} interface.\n * </p>\n * <div class=\"notice\">\n * This object is normally not instantiated directly, use {@link Cesium3DTilesVoxelProvider.fromUrl}.\n * </div>\n *\n * @alias Cesium3DTilesVoxelProvider\n * @constructor\n * @augments VoxelProvider\n *\n * @param {object} options Object with the following properties:\n *\n * @see Cesium3DTilesVoxelProvider.fromUrl\n * @see VoxelProvider\n * @see VoxelPrimitive\n * @see VoxelShapeType\n *\n * @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction Cesium3DTilesVoxelProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /** @inheritdoc */\n  this.shapeTransform = undefined;\n\n  /** @inheritdoc */\n  this.globalTransform = undefined;\n\n  /** @inheritdoc */\n  this.shape = undefined;\n\n  /** @inheritdoc */\n  this.minBounds = undefined;\n\n  /** @inheritdoc */\n  this.maxBounds = undefined;\n\n  /** @inheritdoc */\n  this.dimensions = undefined;\n\n  /** @inheritdoc */\n  this.paddingBefore = undefined;\n\n  /** @inheritdoc */\n  this.paddingAfter = undefined;\n\n  /** @inheritdoc */\n  this.names = undefined;\n\n  /** @inheritdoc */\n  this.types = undefined;\n\n  /** @inheritdoc */\n  this.componentTypes = undefined;\n\n  /** @inheritdoc */\n  this.minimumValues = undefined;\n\n  /** @inheritdoc */\n  this.maximumValues = undefined;\n\n  /** @inheritdoc */\n  this.maximumTileCount = undefined;\n\n  this._implicitTileset = undefined;\n  this._subtreeCache = new ImplicitSubtreeCache();\n}\n\n/**\n * Creates a {@link VoxelProvider} that fetches voxel data from a 3D Tiles tileset.\n *\n * @param {Resource|string} url The URL to a tileset JSON file\n * @returns {Promise<Cesium3DTilesVoxelProvider>} The created provider\n *\n * @exception {RuntimeException} Root must have content\n * @exception {RuntimeException} Root tile content must have 3DTILES_content_voxels extension\n * @exception {RuntimeException} Root tile must have implicit tiling\n * @exception {RuntimeException} Tileset must have a metadata schema\n * @exception {RuntimeException} Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider\n */\nCesium3DTilesVoxelProvider.fromUrl = async function (url) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"url\", url);\n  //>>includeEnd('debug');\n\n  const resource = Resource.createIfNeeded(url);\n  const tilesetJson = await resource.fetchJson();\n\n  validate(tilesetJson);\n\n  const schemaLoader = getMetadataSchemaLoader(tilesetJson, resource);\n  await schemaLoader.load();\n\n  const root = tilesetJson.root;\n  const voxel = root.content.extensions[\"3DTILES_content_voxels\"];\n  const className = voxel.class;\n\n  const metadataJson = hasExtension(tilesetJson, \"3DTILES_metadata\")\n    ? tilesetJson.extensions[\"3DTILES_metadata\"]\n    : tilesetJson;\n\n  const metadataSchema = schemaLoader.schema;\n  const metadata = new Cesium3DTilesetMetadata({\n    metadataJson: metadataJson,\n    schema: metadataSchema,\n  });\n\n  const provider = new Cesium3DTilesVoxelProvider();\n\n  addAttributeInfo(provider, metadata, className);\n\n  const implicitTileset = new ImplicitTileset(resource, root, metadataSchema);\n\n  const {\n    shape,\n    minBounds,\n    maxBounds,\n    shapeTransform,\n    globalTransform,\n  } = getShape(root);\n\n  provider.shape = shape;\n  provider.minBounds = minBounds;\n  provider.maxBounds = maxBounds;\n  provider.dimensions = Cartesian3.unpack(voxel.dimensions);\n  provider.shapeTransform = shapeTransform;\n  provider.globalTransform = globalTransform;\n  provider.maximumTileCount = getTileCount(metadata);\n\n  let paddingBefore;\n  let paddingAfter;\n\n  if (defined(voxel.padding)) {\n    paddingBefore = Cartesian3.unpack(voxel.padding.before);\n    paddingAfter = Cartesian3.unpack(voxel.padding.after);\n  }\n\n  provider.paddingBefore = paddingBefore;\n  provider.paddingAfter = paddingAfter;\n\n  provider._implicitTileset = implicitTileset;\n\n  ResourceCache.unload(schemaLoader);\n\n  return provider;\n};\n\nfunction getTileCount(metadata) {\n  if (!defined(metadata.tileset)) {\n    return undefined;\n  }\n\n  return metadata.tileset.getPropertyBySemantic(\n    MetadataSemantic.TILESET_TILE_COUNT\n  );\n}\n\nfunction validate(tileset) {\n  const root = tileset.root;\n\n  if (!defined(root.content)) {\n    throw new RuntimeError(\"Root must have content\");\n  }\n\n  if (!hasExtension(root.content, \"3DTILES_content_voxels\")) {\n    throw new RuntimeError(\n      \"Root tile content must have 3DTILES_content_voxels extension\"\n    );\n  }\n\n  if (\n    !hasExtension(root, \"3DTILES_implicit_tiling\") &&\n    !defined(root.implicitTiling)\n  ) {\n    throw new RuntimeError(\"Root tile must have implicit tiling\");\n  }\n\n  if (\n    !defined(tileset.schema) &&\n    !defined(tileset.schemaUri) &&\n    !hasExtension(tileset, \"3DTILES_metadata\")\n  ) {\n    throw new RuntimeError(\"Tileset must have a metadata schema\");\n  }\n}\n\nfunction getShape(tile) {\n  const boundingVolume = tile.boundingVolume;\n\n  let tileTransform;\n  if (defined(tile.transform)) {\n    tileTransform = Matrix4.unpack(tile.transform);\n  } else {\n    tileTransform = Matrix4.clone(Matrix4.IDENTITY);\n  }\n\n  if (defined(boundingVolume.box)) {\n    return getBoxShape(boundingVolume.box, tileTransform);\n  } else if (defined(boundingVolume.region)) {\n    return getEllipsoidShape(boundingVolume.region);\n  } else if (hasExtension(boundingVolume, \"3DTILES_bounding_volume_cylinder\")) {\n    return getCylinderShape(\n      boundingVolume.extensions[\"3DTILES_bounding_volume_cylinder\"].cylinder,\n      tileTransform\n    );\n  }\n\n  throw new RuntimeError(\n    \"Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider\"\n  );\n}\n\nfunction getEllipsoidShape(region) {\n  const west = region[0];\n  const south = region[1];\n  const east = region[2];\n  const north = region[3];\n  const minHeight = region[4];\n  const maxHeight = region[5];\n\n  const shapeTransform = Matrix4.fromScale(Ellipsoid.WGS84.radii);\n\n  const minBoundsX = west;\n  const maxBoundsX = east;\n  const minBoundsY = south;\n  const maxBoundsY = north;\n  const minBoundsZ = minHeight;\n  const maxBoundsZ = maxHeight;\n\n  const minBounds = new Cartesian3(minBoundsX, minBoundsY, minBoundsZ);\n  const maxBounds = new Cartesian3(maxBoundsX, maxBoundsY, maxBoundsZ);\n\n  return {\n    shape: VoxelShapeType.ELLIPSOID,\n    minBounds: minBounds,\n    maxBounds: maxBounds,\n    shapeTransform: shapeTransform,\n    globalTransform: Matrix4.clone(Matrix4.IDENTITY),\n  };\n}\n\nfunction getBoxShape(box, tileTransform) {\n  const obb = OrientedBoundingBox.unpack(box);\n  const shapeTransform = Matrix4.fromRotationTranslation(\n    obb.halfAxes,\n    obb.center\n  );\n\n  return {\n    shape: VoxelShapeType.BOX,\n    minBounds: Cartesian3.clone(VoxelBoxShape.DefaultMinBounds),\n    maxBounds: Cartesian3.clone(VoxelBoxShape.DefaultMaxBounds),\n    shapeTransform: shapeTransform,\n    globalTransform: tileTransform,\n  };\n}\n\nfunction getCylinderShape(cylinder, tileTransform) {\n  const obb = OrientedBoundingBox.unpack(cylinder);\n  const shapeTransform = Matrix4.fromRotationTranslation(\n    obb.halfAxes,\n    obb.center\n  );\n\n  return {\n    shape: VoxelShapeType.CYLINDER,\n    minBounds: Cartesian3.clone(VoxelCylinderShape.DefaultMinBounds),\n    maxBounds: Cartesian3.clone(VoxelCylinderShape.DefaultMaxBounds),\n    shapeTransform: shapeTransform,\n    globalTransform: tileTransform,\n  };\n}\n\nfunction getMetadataSchemaLoader(tilesetJson, resource) {\n  const { schemaUri, schema } = tilesetJson;\n  if (!defined(schemaUri)) {\n    return ResourceCache.getSchemaLoader({ schema });\n  }\n  return ResourceCache.getSchemaLoader({\n    resource: resource.getDerivedResource({\n      url: schemaUri,\n    }),\n  });\n}\n\nfunction addAttributeInfo(provider, metadata, className) {\n  const { schema, statistics } = metadata;\n  const classStatistics = statistics?.classes[className];\n  const properties = schema.classes[className].properties;\n\n  const propertyInfo = Object.entries(properties).map(([id, property]) => {\n    const { type, componentType } = property;\n    const min = classStatistics?.properties[id].min;\n    const max = classStatistics?.properties[id].max;\n    const componentCount = MetadataType.getComponentCount(type);\n    const minValue = copyArray(min, componentCount);\n    const maxValue = copyArray(max, componentCount);\n\n    return { id, type, componentType, minValue, maxValue };\n  });\n\n  provider.names = propertyInfo.map((info) => info.id);\n  provider.types = propertyInfo.map((info) => info.type);\n  provider.componentTypes = propertyInfo.map((info) => info.componentType);\n\n  const minimumValues = propertyInfo.map((info) => info.minValue);\n  const maximumValues = propertyInfo.map((info) => info.maxValue);\n  const hasMinimumValues = minimumValues.some(defined);\n\n  provider.minimumValues = hasMinimumValues ? minimumValues : undefined;\n  provider.maximumValues = hasMinimumValues ? maximumValues : undefined;\n}\n\nfunction copyArray(values, length) {\n  // Copy input values into a new array of a specified length.\n  // If the input is not an array, its value will be copied into the first element\n  // of the returned array. If the input is an array shorter than the returned\n  // array, the extra elements in the returned array will be undefined. If the\n  // input is undefined, the return will be undefined.\n  if (!defined(values)) {\n    return;\n  }\n  const valuesArray = Array.isArray(values) ? values : [values];\n  return Array.from({ length }, (v, i) => valuesArray[i]);\n}\n\nasync function getVoxelContent(implicitTileset, tileCoordinates) {\n  const voxelRelative = implicitTileset.contentUriTemplates[0].getDerivedResource(\n    {\n      templateValues: tileCoordinates.getTemplateValues(),\n    }\n  );\n  const voxelResource = implicitTileset.baseResource.getDerivedResource({\n    url: voxelRelative.url,\n  });\n\n  const arrayBuffer = await voxelResource.fetchArrayBuffer();\n  const preprocessed = preprocess3DTileContent(arrayBuffer);\n\n  const voxelContent = await VoxelContent.fromJson(\n    voxelResource,\n    preprocessed.jsonPayload,\n    preprocessed.binaryPayload,\n    implicitTileset.metadataSchema\n  );\n\n  return voxelContent;\n}\n\nasync function getSubtreePromise(provider, subtreeCoord) {\n  const implicitTileset = provider._implicitTileset;\n  const subtreeCache = provider._subtreeCache;\n\n  // First load the subtree to check if the tile is available.\n  // If the subtree has been requested previously it might still be in the cache\n  let subtree = subtreeCache.find(subtreeCoord);\n  if (defined(subtree)) {\n    return subtree;\n  }\n\n  const subtreeRelative = implicitTileset.subtreeUriTemplate.getDerivedResource(\n    {\n      templateValues: subtreeCoord.getTemplateValues(),\n    }\n  );\n  const subtreeResource = implicitTileset.baseResource.getDerivedResource({\n    url: subtreeRelative.url,\n  });\n\n  const arrayBuffer = await subtreeResource.fetchArrayBuffer();\n  // Check one more time if the subtree is in the cache.\n  // This could happen if there are two in-flight tile requests from the same\n  // subtree and one finishes before the other.\n  subtree = subtreeCache.find(subtreeCoord);\n  if (defined(subtree)) {\n    return subtree;\n  }\n\n  const preprocessed = preprocess3DTileContent(arrayBuffer);\n  subtree = await ImplicitSubtree.fromSubtreeJson(\n    subtreeResource,\n    preprocessed.jsonPayload,\n    preprocessed.binaryPayload,\n    implicitTileset,\n    subtreeCoord\n  );\n  subtreeCache.addSubtree(subtree);\n  return subtree;\n}\n\n/** @inheritdoc */\nCesium3DTilesVoxelProvider.prototype.requestData = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const tileLevel = defaultValue(options.tileLevel, 0);\n  const tileX = defaultValue(options.tileX, 0);\n  const tileY = defaultValue(options.tileY, 0);\n  const tileZ = defaultValue(options.tileZ, 0);\n  const keyframe = defaultValue(options.keyframe, 0);\n\n  // 3D Tiles currently doesn't support time-dynamic data.\n  if (keyframe !== 0) {\n    return undefined;\n  }\n\n  // 1. Load the subtree that the tile belongs to (possibly from the subtree cache)\n  // 2. Load the voxel content if available\n\n  const implicitTileset = this._implicitTileset;\n  const names = this.names;\n\n  // Can't use a scratch variable here because the object is used inside the promise chain.\n  const tileCoordinates = new ImplicitTileCoordinates({\n    subdivisionScheme: implicitTileset.subdivisionScheme,\n    subtreeLevels: implicitTileset.subtreeLevels,\n    level: tileLevel,\n    x: tileX,\n    y: tileY,\n    z: tileZ,\n  });\n\n  // Find the coordinates of the parent subtree containing tileCoordinates\n  // If tileCoordinates is a subtree child, use that subtree\n  // If tileCoordinates is a subtree root, use its parent subtree\n  const isSubtreeRoot =\n    tileCoordinates.isSubtreeRoot() && tileCoordinates.level > 0;\n\n  const subtreeCoord = isSubtreeRoot\n    ? tileCoordinates.getParentSubtreeCoordinates()\n    : tileCoordinates.getSubtreeCoordinates();\n\n  const that = this;\n\n  return getSubtreePromise(that, subtreeCoord)\n    .then(function (subtree) {\n      const available = isSubtreeRoot\n        ? subtree.childSubtreeIsAvailableAtCoordinates(tileCoordinates)\n        : subtree.tileIsAvailableAtCoordinates(tileCoordinates);\n\n      if (!available) {\n        return Promise.reject(\"Tile is not available\");\n      }\n\n      return getVoxelContent(implicitTileset, tileCoordinates);\n    })\n    .then(function (voxelContent) {\n      return names.map(function (name) {\n        return voxelContent.metadataTable.getPropertyTypedArray(name);\n      });\n    });\n};\n\nexport default Cesium3DTilesVoxelProvider;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport CesiumMath from \"../Core/Math.js\";\n\n/**\n * A ParticleEmitter that emits particles from a circle.\n * Particles will be positioned within a circle and have initial velocities going along the z vector.\n *\n * @alias CircleEmitter\n * @constructor\n *\n * @param {number} [radius=1.0] The radius of the circle in meters.\n */\nfunction CircleEmitter(radius) {\n  radius = defaultValue(radius, 1.0);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThan(\"radius\", radius, 0.0);\n  //>>includeEnd('debug');\n\n  this._radius = defaultValue(radius, 1.0);\n}\n\nObject.defineProperties(CircleEmitter.prototype, {\n  /**\n   * The radius of the circle in meters.\n   * @memberof CircleEmitter.prototype\n   * @type {number}\n   * @default 1.0\n   */\n  radius: {\n    get: function () {\n      return this._radius;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThan(\"value\", value, 0.0);\n      //>>includeEnd('debug');\n      this._radius = value;\n    },\n  },\n});\n\n/**\n * Initializes the given {@link Particle} by setting it's position and velocity.\n *\n * @private\n * @param {Particle} particle The particle to initialize.\n */\nCircleEmitter.prototype.emit = function (particle) {\n  const theta = CesiumMath.randomBetween(0.0, CesiumMath.TWO_PI);\n  const rad = CesiumMath.randomBetween(0.0, this._radius);\n\n  const x = rad * Math.cos(theta);\n  const y = rad * Math.sin(theta);\n  const z = 0.0;\n\n  particle.position = Cartesian3.fromElements(x, y, z, particle.position);\n  particle.velocity = Cartesian3.clone(Cartesian3.UNIT_Z, particle.velocity);\n};\nexport default CircleEmitter;\n", "/**\n * Specifies the type of the cloud that is added to a {@link CloudCollection} in {@link CloudCollection#add}.\n *\n * @enum {number}\n */\n\nconst CloudType = {\n  /**\n   * Cumulus cloud.\n   *\n   * @type {number}\n   * @constant\n   */\n  CUMULUS: 0,\n};\n\n/**\n * Validates that the provided cloud type is a valid {@link CloudType}\n *\n * @param {CloudType} cloudType The cloud type to validate.\n * @returns {boolean} <code>true</code> if the provided cloud type is a valid value; otherwise, <code>false</code>.\n *\n * @example\n * if (!Cesium.CloudType.validate(cloudType)) {\n *   throw new Cesium.DeveloperError('cloudType must be a valid value.');\n * }\n */\n\nCloudType.validate = function (cloudType) {\n  return cloudType === CloudType.CUMULUS;\n};\n\nexport default Object.freeze(CloudType);\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * <div class=\"notice\">\n * A cloud is created and its initial properties are set by calling {@link CloudCollection#add}.\n * and {@link CloudCollection#remove}. Do not call the constructor directly.\n * </div>\n * A cumulus cloud billboard positioned in the 3D scene, that is created and rendered using a {@link CloudCollection}.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/CumulusCloud.png' width='400' height='300' /><br />\n * Example cumulus clouds\n * </div>\n * @alias CumulusCloud\n *\n * @performance Similar to {@link Billboard}, reading a property, e.g., {@link CumulusCloud#show},\n * takes constant time. Assigning to a property is constant time but results in\n * CPU to GPU traffic when {@link CloudCollection#update} is called.  The per-cloud traffic is\n * the same regardless of how many properties were updated.  If most clouds in a collection need to be\n * updated, it may be more efficient to clear the collection with {@link CloudCollection#removeAll}\n * and add new clouds instead of modifying each one.\n *\n * @see CloudCollection\n * @see CloudCollection#add\n *\n * @internalConstructor\n * @class\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Cloud%20Parameters.html|Cesium Sandcastle Cloud Parameters Demo}\n */\nfunction CumulusCloud(options, cloudCollection) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  this._show = defaultValue(options.show, true);\n\n  this._position = Cartesian3.clone(\n    defaultValue(options.position, Cartesian3.ZERO)\n  );\n\n  if (!defined(options.scale) && defined(options.maximumSize)) {\n    this._maximumSize = Cartesian3.clone(options.maximumSize);\n    this._scale = new Cartesian2(this._maximumSize.x, this._maximumSize.y);\n  } else {\n    this._scale = Cartesian2.clone(\n      defaultValue(options.scale, new Cartesian2(20.0, 12.0))\n    );\n\n    const defaultMaxSize = new Cartesian3(\n      this._scale.x,\n      this._scale.y,\n      Math.min(this._scale.x, this._scale.y) / 1.5\n    );\n    this._maximumSize = Cartesian3.clone(\n      defaultValue(options.maximumSize, defaultMaxSize)\n    );\n  }\n\n  this._slice = defaultValue(options.slice, -1.0);\n  this._color = Color.clone(defaultValue(options.color, Color.WHITE));\n  this._brightness = defaultValue(options.brightness, 1.0);\n  this._cloudCollection = cloudCollection;\n  this._index = -1; // Used by CloudCollection\n}\n\nconst SHOW_INDEX = (CumulusCloud.SHOW_INDEX = 0);\nconst POSITION_INDEX = (CumulusCloud.POSITION_INDEX = 1);\nconst SCALE_INDEX = (CumulusCloud.SCALE_INDEX = 2);\nconst MAXIMUM_SIZE_INDEX = (CumulusCloud.MAXIMUM_SIZE_INDEX = 3);\nconst SLICE_INDEX = (CumulusCloud.SLICE_INDEX = 4);\nconst BRIGHTNESS_INDEX = (CumulusCloud.BRIGHTNESS_INDEX = 5);\nconst COLOR_INDEX = (CumulusCloud.COLOR_INDEX = 6);\nCumulusCloud.NUMBER_OF_PROPERTIES = 7;\n\nfunction makeDirty(cloud, propertyChanged) {\n  const cloudCollection = cloud._cloudCollection;\n  if (defined(cloudCollection)) {\n    cloudCollection._updateCloud(cloud, propertyChanged);\n    cloud._dirty = true;\n  }\n}\n\nObject.defineProperties(CumulusCloud.prototype, {\n  /**\n   * Determines if this cumulus cloud will be shown.  Use this to hide or show a cloud, instead\n   * of removing it and re-adding it to the collection.\n   * @memberof CumulusCloud.prototype\n   * @type {boolean}\n   * @default true\n   */\n  show: {\n    get: function () {\n      return this._show;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.bool(\"value\", value);\n      //>>includeEnd('debug');\n\n      if (this._show !== value) {\n        this._show = value;\n        makeDirty(this, SHOW_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the Cartesian position of this cumulus cloud.\n   * @memberof CumulusCloud.prototype\n   * @type {Cartesian3}\n   */\n  position: {\n    get: function () {\n      return this._position;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug)\n      Check.typeOf.object(\"value\", value);\n      //>>includeEnd('debug');\n\n      const position = this._position;\n      if (!Cartesian3.equals(position, value)) {\n        Cartesian3.clone(value, position);\n        makeDirty(this, POSITION_INDEX);\n      }\n    },\n  },\n\n  /**\n   * <p>Gets or sets the scale of the cumulus cloud billboard in meters.\n   * The <code>scale</code> property will affect the size of the billboard,\n   * but not the cloud's actual appearance.</p>\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'>\n   *   <code>cloud.scale = new Cesium.Cartesian2(12, 8);</code><br/>\n   *   <img src='Images/CumulusCloud.scalex12y8.png' width='250' height='158' />\n   * </td>\n   * <td align='center'>\n   *   <code>cloud.scale = new Cesium.Cartesian2(24, 10);</code><br/>\n   *   <img src='Images/CumulusCloud.scalex24y10.png' width='250' height='158' />\n   * </td>\n   * </tr></table>\n   * </div>\n   *\n   * <p>To modify the cloud's appearance, modify its <code>maximumSize</code>\n   * and <code>slice</code> properties.</p>\n   * @memberof CumulusCloud.prototype\n   * @type {Cartesian2}\n   *\n   * @see CumulusCloud#maximumSize\n   * @see CumulusCloud#slice\n   */\n  scale: {\n    get: function () {\n      return this._scale;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug)\n      Check.typeOf.object(\"value\", value);\n      //>>includeEnd('debug');\n\n      const scale = this._scale;\n      if (!Cartesian2.equals(scale, value)) {\n        Cartesian2.clone(value, scale);\n        makeDirty(this, SCALE_INDEX);\n      }\n    },\n  },\n\n  /**\n   * <p>Gets or sets the maximum size of the cumulus cloud rendered on the billboard.\n   * This defines a maximum ellipsoid volume that the cloud can appear in.\n   * Rather than guaranteeing a specific size, this specifies a boundary for the\n   * cloud to appear in, and changing it can affect the shape of the cloud.</p>\n   * <p>Changing the z-value of <code>maximumSize</code> has the most dramatic effect\n   * on the cloud's appearance because it changes the depth of the cloud, and thus the\n   * positions at which the cloud-shaping texture is sampled.</p>\n   * <div align='center'>\n   * <table border='0' cellpadding='5'>\n   * <tr>\n   *   <td align='center'>\n   *     <code>cloud.maximumSize = new Cesium.Cartesian3(14, 9, 10);</code><br/>\n   *     <img src='Images/CumulusCloud.maximumSizex14y9z10.png' width='250' height='158' />\n   *   </td>\n   *   <td align='center'>\n   *     <code>cloud.maximumSize.x = 25;</code><br/>\n   *     <img src='Images/CumulusCloud.maximumSizex25.png' width='250' height='158' />\n   *   </td>\n   * </tr>\n   * <tr>\n   *   <td align='center'>\n   *     <code>cloud.maximumSize.y = 5;</code><br/>\n   *     <img src='Images/CumulusCloud.maximumSizey5.png' width='250' height='158' />\n   *   </td>\n   *   <td align='center'>\n   *     <code>cloud.maximumSize.z = 17;</code><br/>\n   *     <img src='Images/CumulusCloud.maximumSizez17.png' width='250' height='158' />\n   *   </td>\n   * </tr>\n   * </table>\n   * </div>\n   *\n   * <p>To modify the billboard's actual size, modify the cloud's <code>scale</code> property.</p>\n   * @memberof CumulusCloud.prototype\n   * @type {Cartesian3}\n   *\n   * @see CumulusCloud#scale\n   */\n  maximumSize: {\n    get: function () {\n      return this._maximumSize;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug)\n      Check.typeOf.object(\"value\", value);\n      //>>includeEnd('debug');\n\n      const maximumSize = this._maximumSize;\n      if (!Cartesian3.equals(maximumSize, value)) {\n        Cartesian3.clone(value, maximumSize);\n        makeDirty(this, MAXIMUM_SIZE_INDEX);\n      }\n    },\n  },\n  /**\n   * Sets the color of the cloud\n   * @memberof CumulusCloud.prototype\n   * @type {Color}\n   * @default Color.WHITE\n   */\n  color: {\n    get: function () {\n      return this._color;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug)\n      Check.typeOf.object(\"value\", value);\n      //>>includeEnd('debug');\n\n      const color = this._color;\n      if (!Color.equals(color, value)) {\n        Color.clone(value, color);\n        makeDirty(this, COLOR_INDEX);\n      }\n    },\n  },\n  /**\n   * <p>Gets or sets the \"slice\" of the cloud that is rendered on the billboard, i.e.\n   * the specific cross-section of the cloud chosen for the billboard's appearance.\n   * Given a value between 0 and 1, the slice specifies how deeply into the cloud\n   * to intersect based on its maximum size in the z-direction.</p>\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'><code>cloud.slice = 0.32;</code><br/><img src='Images/CumulusCloud.slice0.32.png' width='250' height='158' /></td>\n   * <td align='center'><code>cloud.slice = 0.5;</code><br/><img src='Images/CumulusCloud.slice0.5.png' width='250' height='158' /></td>\n   * <td align='center'><code>cloud.slice = 0.6;</code><br/><img src='Images/CumulusCloud.slice0.6.png' width='250' height='158' /></td>\n   * </tr></table>\n   * </div>\n   *\n   * <br />\n   * <p>Due to the nature in which this slice is calculated,\n   * values below <code>0.2</code> may result in cross-sections that are too small,\n   * and the edge of the ellipsoid will be visible. Similarly, values above <code>0.7</code>\n   * will cause the cloud to appear smaller. Values outside the range <code>[0.1, 0.9]</code>\n   * should be avoided entirely because they do not produce desirable results.</p>\n   *\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'><code>cloud.slice = 0.08;</code><br/><img src='Images/CumulusCloud.slice0.08.png' width='250' height='158' /></td>\n   * <td align='center'><code>cloud.slice = 0.8;</code><br/><img src='Images/CumulusCloud.slice0.8.png' width='250' height='158' /></td>\n   * </tr></table>\n   * </div>\n   *\n   * <p>If <code>slice</code> is set to a negative number, the cloud will not render a cross-section.\n   * Instead, it will render the outside of the ellipsoid that is visible. For clouds with\n   * small values of `maximumSize.z`, this can produce good-looking results, but for larger\n   * clouds, this can result in a cloud that is undesirably warped to the ellipsoid volume.</p>\n   *\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'>\n   *  <code>cloud.slice = -1.0;<br/>cloud.maximumSize.z = 18;</code><br/>\n   *  <img src='Images/CumulusCloud.slice-1z18.png' width='250' height='158' />\n   * </td>\n   * <td align='center'>\n   *   <code>cloud.slice = -1.0;<br/>cloud.maximumSize.z = 30;</code><br/>\n   *   <img src='Images/CumulusCloud.slice-1z30.png' width='250' height='158' /></td>\n   * </tr></table>\n   * </div>\n   *\n   * @memberof CumulusCloud.prototype\n   * @type {number}\n   * @default -1.0\n   */\n  slice: {\n    get: function () {\n      return this._slice;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug)\n      Check.typeOf.number(\"value\", value);\n      //>>includeEnd('debug');\n\n      const slice = this._slice;\n      if (slice !== value) {\n        this._slice = value;\n        makeDirty(this, SLICE_INDEX);\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the brightness of the cloud. This can be used to give clouds\n   * a darker, grayer appearance.\n   * <br /><br />\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'><code>cloud.brightness = 1.0;</code><br/><img src='Images/CumulusCloud.brightness1.png' width='250' height='158' /></td>\n   * <td align='center'><code>cloud.brightness = 0.6;</code><br/><img src='Images/CumulusCloud.brightness0.6.png' width='250' height='158' /></td>\n   * <td align='center'><code>cloud.brightness = 0.0;</code><br/><img src='Images/CumulusCloud.brightness0.png' width='250' height='158' /></td>\n   * </tr></table>\n   * </div>\n   * @memberof CumulusCloud.prototype\n   * @type {number}\n   * @default 1.0\n   */\n  brightness: {\n    get: function () {\n      return this._brightness;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug)\n      Check.typeOf.number(\"value\", value);\n      //>>includeEnd('debug');\n\n      const brightness = this._brightness;\n      if (brightness !== value) {\n        this._brightness = value;\n        makeDirty(this, BRIGHTNESS_INDEX);\n      }\n    },\n  },\n});\n\nCumulusCloud.prototype._destroy = function () {\n  this._cloudCollection = undefined;\n};\n\nexport default CumulusCloud;\n", "import BlendingState from \"./BlendingState.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ComputeCommand from \"../Renderer/ComputeCommand.js\";\nimport CloudType from \"./CloudType.js\";\nimport CloudCollectionFS from \"../Shaders/CloudCollectionFS.js\";\nimport CloudCollectionVS from \"../Shaders/CloudCollectionVS.js\";\nimport CloudNoiseFS from \"../Shaders/CloudNoiseFS.js\";\nimport CloudNoiseVS from \"../Shaders/CloudNoiseVS.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport CumulusCloud from \"./CumulusCloud.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport EncodedCartesian3 from \"../Core/EncodedCartesian3.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport VertexArrayFacade from \"../Renderer/VertexArrayFacade.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\n\nlet attributeLocations;\nconst scratchTextureDimensions = new Cartesian3();\n\nconst attributeLocationsBatched = {\n  positionHighAndScaleX: 0,\n  positionLowAndScaleY: 1,\n  packedAttribute0: 2, // show, brightness, direction\n  packedAttribute1: 3, // cloudSize, slice\n  color: 4,\n};\n\nconst attributeLocationsInstanced = {\n  direction: 0,\n  positionHighAndScaleX: 1,\n  positionLowAndScaleY: 2,\n  packedAttribute0: 3, // show, brightness\n  packedAttribute1: 4, // cloudSize, slice\n  color: 5,\n};\n\nconst SHOW_INDEX = CumulusCloud.SHOW_INDEX;\nconst POSITION_INDEX = CumulusCloud.POSITION_INDEX;\nconst SCALE_INDEX = CumulusCloud.SCALE_INDEX;\nconst MAXIMUM_SIZE_INDEX = CumulusCloud.MAXIMUM_SIZE_INDEX;\nconst SLICE_INDEX = CumulusCloud.SLICE_INDEX;\nconst BRIGHTNESS_INDEX = CumulusCloud.BRIGHTNESS_INDEX;\nconst NUMBER_OF_PROPERTIES = CumulusCloud.NUMBER_OF_PROPERTIES;\nconst COLOR_INDEX = CumulusCloud.COLOR_INDEX;\n\n/**\n * A renderable collection of clouds in the 3D scene.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/CumulusCloud.png' width='400' height='300' /><br />\n * Example cumulus clouds\n * </div>\n * <br /><br />\n * Clouds are added and removed from the collection using {@link CloudCollection#add}\n * and {@link CloudCollection#remove}.\n * @alias CloudCollection\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {boolean} [options.show=true] Whether to display the clouds.\n * @param {number} [options.noiseDetail=16.0] Desired amount of detail in the noise texture.\n * @param {number} [options.noiseOffset=Cartesian3.ZERO] Desired translation of data in noise texture.\n * @param {boolean} [options.debugBillboards=false] For debugging only. Determines if the billboards are rendered with an opaque color.\n * @param {boolean} [options.debugEllipsoids=false] For debugging only. Determines if the clouds will be rendered as opaque ellipsoids.\n * @see CloudCollection#add\n * @see CloudCollection#remove\n * @see CumulusCloud\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Clouds.html|Cesium Sandcastle Clouds Demo}\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Cloud%20Parameters.html|Cesium Sandcastle Cloud Parameters Demo}\n *\n * @example\n * // Create a cloud collection with two cumulus clouds\n * const clouds = scene.primitives.add(new Cesium.CloudCollection());\n * clouds.add({\n *   position : new Cesium.Cartesian3(1.0, 2.0, 3.0),\n *   maximumSize: new Cesium.Cartesian3(20.0, 12.0, 8.0)\n * });\n * clouds.add({\n *   position : new Cesium.Cartesian3(4.0, 5.0, 6.0),\n *   maximumSize: new Cesium.Cartesian3(15.0, 9.0, 9.0),\n *   slice: 0.5\n * });\n *\n */\nfunction CloudCollection(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._clouds = [];\n  this._cloudsToUpdate = [];\n  this._cloudsToUpdateIndex = 0;\n  this._cloudsRemoved = false;\n  this._createVertexArray = false;\n\n  this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES);\n\n  this._noiseTexture = undefined;\n  this._textureSliceWidth = 128;\n  this._noiseTextureRows = 4;\n\n  /**\n   * <p>\n   * Controls the amount of detail captured in the precomputed noise texture\n   * used to render the cumulus clouds. In order for the texture to be tileable,\n   * this must be a power of two. For best results, set this to be a power of two\n   * between <code>8.0</code> and <code>32.0</code> (inclusive).\n   * </p>\n   *\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'>\n   *   <code>clouds.noiseDetail = 8.0;</code><br/>\n   *   <img src='Images/CloudCollection.noiseDetail8.png' width='250' height='158' />\n   * </td>\n   * <td align='center'>\n   *   <code>clouds.noiseDetail = 32.0;</code><br/>\n   *   <img src='Images/CloudCollection.noiseDetail32.png' width='250' height='158' />\n   * </td>\n   * </tr></table>\n   * </div>\n   *\n   * @type {number}\n   *\n   * @default 16.0\n   */\n  this.noiseDetail = defaultValue(options.noiseDetail, 16.0);\n\n  /**\n   * <p>\n   * Applies a translation to noise texture coordinates to generate different data.\n   * This can be modified if the default noise does not generate good-looking clouds.\n   * </p>\n   *\n   * <div align='center'>\n   * <table border='0' cellpadding='5'><tr>\n   * <td align='center'>\n   *   <code>default</code><br/>\n   *   <img src='Images/CloudCollection.noiseOffsetdefault.png' width='250' height='158' />\n   * </td>\n   * <td align='center'>\n   *   <code>clouds.noiseOffset = new Cesium.Cartesian3(10, 20, 10);</code><br/>\n   *   <img src='Images/CloudCollection.noiseOffsetx10y20z10.png' width='250' height='158' />\n   * </td>\n   * </tr></table>\n   * </div>\n   * @type {Cartesian3}\n   *\n   * @default Cartesian3.ZERO\n   */\n  this.noiseOffset = Cartesian3.clone(\n    defaultValue(options.noiseOffset, Cartesian3.ZERO)\n  );\n\n  this._loading = false;\n  this._ready = false;\n\n  const that = this;\n  this._uniforms = {\n    u_noiseTexture: function () {\n      return that._noiseTexture;\n    },\n    u_noiseTextureDimensions: getNoiseTextureDimensions(that),\n    u_noiseDetail: function () {\n      return that.noiseDetail;\n    },\n  };\n\n  this._vaNoise = undefined;\n  this._spNoise = undefined;\n\n  this._spCreated = false;\n  this._sp = undefined;\n  this._rs = undefined;\n\n  /**\n   * Determines if billboards in this collection will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  this._colorCommands = [];\n\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Renders the billboards with one opaque color for the sake of debugging.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugBillboards = defaultValue(options.debugBillboards, false);\n  this._compiledDebugBillboards = false;\n\n  /**\n   * This property is for debugging only; it is not for production use nor is it optimized.\n   * <p>\n   * Draws the clouds as opaque, monochrome ellipsoids for the sake of debugging.\n   * If <code>debugBillboards</code> is also true, then the ellipsoids will draw on top of the billboards.\n   * </p>\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.debugEllipsoids = defaultValue(options.debugEllipsoids, false);\n  this._compiledDebugEllipsoids = false;\n}\n\n// Wraps useful texture metrics into a single vec3 for less overhead.\nfunction getNoiseTextureDimensions(collection) {\n  return function () {\n    scratchTextureDimensions.x = collection._textureSliceWidth;\n    scratchTextureDimensions.y = collection._noiseTextureRows;\n    scratchTextureDimensions.z = 1.0 / collection._noiseTextureRows;\n    return scratchTextureDimensions;\n  };\n}\n\nObject.defineProperties(CloudCollection.prototype, {\n  /**\n   * Returns the number of clouds in this collection.\n   * @memberof CloudCollection.prototype\n   * @type {number}\n   */\n  length: {\n    get: function () {\n      removeClouds(this);\n      return this._clouds.length;\n    },\n  },\n});\n\nfunction destroyClouds(clouds) {\n  const length = clouds.length;\n  for (let i = 0; i < length; ++i) {\n    if (clouds[i]) {\n      clouds[i]._destroy();\n    }\n  }\n}\n\n/**\n * Creates and adds a cloud with the specified initial properties to the collection.\n * The added cloud is returned so it can be modified or removed from the collection later.\n *\n * @param {object}[options] A template describing the cloud's properties as shown in Example 1.\n * @returns {CumulusCloud} The cloud that was added to the collection.\n *\n * @performance Calling <code>add</code> is expected constant time.  However, the collection's vertex buffer\n * is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead.  For\n * best performance, add as many clouds as possible before calling <code>update</code>.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Example 1:  Add a cumulus cloud, specifying all the default values.\n * const c = clouds.add({\n *   show : true,\n *   position : Cesium.Cartesian3.ZERO,\n *   scale : new Cesium.Cartesian2(20.0, 12.0),\n *   maximumSize: new Cesium.Cartesian3(20.0, 12.0, 12.0),\n *   slice: -1.0,\n *   cloudType : CloudType.CUMULUS\n * });\n *\n * @example\n * // Example 2:  Specify only the cloud's cartographic position.\n * const c = clouds.add({\n *   position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)\n * });\n *\n * @see CloudCollection#remove\n * @see CloudCollection#removeAll\n */\nCloudCollection.prototype.add = function (options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const cloudType = defaultValue(options.cloudType, CloudType.CUMULUS);\n  //>>includeStart('debug', pragmas.debug);\n  if (!CloudType.validate(cloudType)) {\n    throw new DeveloperError(\"invalid cloud type\");\n  }\n  //>>includeEnd('debug');\n\n  let cloud;\n  if (cloudType === CloudType.CUMULUS) {\n    cloud = new CumulusCloud(options, this);\n    cloud._index = this._clouds.length;\n    this._clouds.push(cloud);\n    this._createVertexArray = true;\n  }\n\n  return cloud;\n};\n\n/**\n * Removes a cloud from the collection.\n *\n * @param {CumulusCloud} cloud The cloud to remove.\n * @returns {boolean} <code>true</code> if the cloud was removed; <code>false</code> if the cloud was not found in the collection.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * const c = clouds.add(...);\n * clouds.remove(c);  // Returns true\n *\n * @see CloudCollection#add\n * @see CloudCollection#removeAll\n * @see CumulusCloud#show\n */\nCloudCollection.prototype.remove = function (cloud) {\n  if (this.contains(cloud)) {\n    this._clouds[cloud._index] = undefined; // Removed later in removeClouds()\n    this._cloudsRemoved = true;\n    this._createVertexArray = true;\n    cloud._destroy();\n    return true;\n  }\n\n  return false;\n};\n\n/**\n * Removes all clouds from the collection.\n *\n * @performance <code>O(n)</code>.  It is more efficient to remove all the clouds\n * from a collection and then add new ones than to create a new collection entirely.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * clouds.add(...);\n * clouds.add(...);\n * clouds.removeAll();\n *\n * @see CloudCollection#add\n * @see CloudCollection#remove\n */\nCloudCollection.prototype.removeAll = function () {\n  destroyClouds(this._clouds);\n  this._clouds = [];\n  this._cloudsToUpdate = [];\n  this._cloudsToUpdateIndex = 0;\n  this._cloudsRemoved = false;\n\n  this._createVertexArray = true;\n};\n\nfunction removeClouds(cloudCollection) {\n  if (cloudCollection._cloudsRemoved) {\n    cloudCollection._cloudsRemoved = false;\n\n    const newClouds = [];\n    const clouds = cloudCollection._clouds;\n    const length = clouds.length;\n    for (let i = 0, j = 0; i < length; ++i) {\n      const cloud = clouds[i];\n      if (defined(cloud)) {\n        clouds._index = j++;\n        newClouds.push(cloud);\n      }\n    }\n\n    cloudCollection._clouds = newClouds;\n  }\n}\n\nCloudCollection.prototype._updateCloud = function (cloud, propertyChanged) {\n  if (!cloud._dirty) {\n    this._cloudsToUpdate[this._cloudsToUpdateIndex++] = cloud;\n  }\n\n  ++this._propertiesChanged[propertyChanged];\n};\n\n/**\n * Check whether this collection contains a given cloud.\n *\n * @param {CumulusCloud} [cloud] The cloud to check for.\n * @returns {boolean} true if this collection contains the cloud, false otherwise.\n *\n * @see CloudCollection#get\n */\nCloudCollection.prototype.contains = function (cloud) {\n  return defined(cloud) && cloud._cloudCollection === this;\n};\n\n/**\n * Returns the cloud in the collection at the specified index. Indices are zero-based\n * and increase as clouds are added. Removing a cloud shifts all clouds after\n * it to the left, changing their indices. This function is commonly used with\n * {@link CloudCollection#length} to iterate over all the clouds in the collection.\n *\n * @param {number} index The zero-based index of the cloud.\n * @returns {CumulusCloud} The cloud at the specified index.\n *\n * @performance Expected constant time. If clouds were removed from the collection and\n * {@link CloudCollection#update} was not called, an implicit <code>O(n)</code>\n * operation is performed.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Toggle the show property of every cloud in the collection\n * const len = clouds.length;\n * for (let i = 0; i < len; ++i) {\n *   const c = clouds.get(i);\n *   c.show = !c.show;\n * }\n *\n * @see CloudCollection#length\n */\nCloudCollection.prototype.get = function (index) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number(\"index\", index);\n  //>>includeEnd('debug');\n\n  removeClouds(this);\n  return this._clouds[index];\n};\n\nconst texturePositions = new Float32Array([\n  -1.0,\n  -1.0,\n  1.0,\n  -1.0,\n  1.0,\n  1.0,\n  -1.0,\n  1.0,\n]);\n\nconst textureIndices = new Uint16Array([0, 1, 2, 0, 2, 3]);\n\nfunction createTextureVA(context) {\n  const positionBuffer = Buffer.createVertexBuffer({\n    context: context,\n    typedArray: texturePositions,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n  const indexBuffer = Buffer.createIndexBuffer({\n    context: context,\n    typedArray: textureIndices,\n    usage: BufferUsage.STATIC_DRAW,\n    indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n  });\n\n  const attributes = [\n    {\n      index: 0,\n      vertexBuffer: positionBuffer,\n      componentsPerAttribute: 2,\n      componentDatatype: ComponentDatatype.FLOAT,\n    },\n  ];\n\n  return new VertexArray({\n    context: context,\n    attributes: attributes,\n    indexBuffer: indexBuffer,\n  });\n}\n\nlet getIndexBuffer;\n\nfunction getIndexBufferBatched(context) {\n  const sixteenK = 16 * 1024;\n\n  let indexBuffer = context.cache.cloudCollection_indexBufferBatched;\n  if (defined(indexBuffer)) {\n    return indexBuffer;\n  }\n\n  // Subtract 6 because the last index is reserved for primitive restart.\n  // https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.18\n  const length = sixteenK * 6 - 6;\n  const indices = new Uint16Array(length);\n  for (let i = 0, j = 0; i < length; i += 6, j += 4) {\n    indices[i] = j;\n    indices[i + 1] = j + 1;\n    indices[i + 2] = j + 2;\n\n    indices[i + 3] = j;\n    indices[i + 4] = j + 2;\n    indices[i + 5] = j + 3;\n  }\n\n  indexBuffer = Buffer.createIndexBuffer({\n    context: context,\n    typedArray: indices,\n    usage: BufferUsage.STATIC_DRAW,\n    indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n  });\n  indexBuffer.vertexArrayDestroyable = false;\n  context.cache.cloudCollection_indexBufferBatched = indexBuffer;\n  return indexBuffer;\n}\n\nfunction getIndexBufferInstanced(context) {\n  let indexBuffer = context.cache.cloudCollection_indexBufferInstanced;\n  if (defined(indexBuffer)) {\n    return indexBuffer;\n  }\n\n  indexBuffer = Buffer.createIndexBuffer({\n    context: context,\n    typedArray: new Uint16Array([0, 1, 2, 0, 2, 3]),\n    usage: BufferUsage.STATIC_DRAW,\n    indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n  });\n\n  indexBuffer.vertexArrayDestroyable = false;\n  context.cache.cloudCollection_indexBufferInstanced = indexBuffer;\n  return indexBuffer;\n}\n\nfunction getVertexBufferInstanced(context) {\n  let vertexBuffer = context.cache.cloudCollection_vertexBufferInstanced;\n  if (defined(vertexBuffer)) {\n    return vertexBuffer;\n  }\n\n  vertexBuffer = Buffer.createVertexBuffer({\n    context: context,\n    typedArray: new Float32Array([0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0]),\n    usage: BufferUsage.STATIC_DRAW,\n  });\n\n  vertexBuffer.vertexArrayDestroyable = false;\n  context.cache.cloudCollection_vertexBufferInstanced = vertexBuffer;\n  return vertexBuffer;\n}\n\nfunction createVAF(context, numberOfClouds, instanced) {\n  const attributes = [\n    {\n      index: attributeLocations.positionHighAndScaleX,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      usage: BufferUsage.STATIC_DRAW,\n    },\n    {\n      index: attributeLocations.positionLowAndScaleY,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      usage: BufferUsage.STATIC_DRAW,\n    },\n    {\n      index: attributeLocations.packedAttribute0,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      usage: BufferUsage.STATIC_DRAW,\n    },\n    {\n      index: attributeLocations.packedAttribute1,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.FLOAT,\n      usage: BufferUsage.STATIC_DRAW,\n    },\n    {\n      index: attributeLocations.color,\n      componentsPerAttribute: 4,\n      componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n      normalize: true,\n      usage: BufferUsage.STATIC_DRAW,\n    },\n  ];\n\n  if (instanced) {\n    attributes.push({\n      index: attributeLocations.direction,\n      componentsPerAttribute: 2,\n      componentDatatype: ComponentDatatype.FLOAT,\n      vertexBuffer: getVertexBufferInstanced(context),\n    });\n  }\n\n  const sizeInVertices = instanced ? numberOfClouds : 4 * numberOfClouds;\n  return new VertexArrayFacade(context, attributes, sizeInVertices, instanced);\n}\n\nconst writePositionScratch = new EncodedCartesian3();\n\nfunction writePositionAndScale(cloudCollection, frameState, vafWriters, cloud) {\n  let i;\n  const positionHighWriter =\n    vafWriters[attributeLocations.positionHighAndScaleX];\n  const positionLowWriter = vafWriters[attributeLocations.positionLowAndScaleY];\n  const position = cloud.position;\n\n  EncodedCartesian3.fromCartesian(position, writePositionScratch);\n  const scale = cloud.scale;\n\n  const high = writePositionScratch.high;\n  const low = writePositionScratch.low;\n\n  if (cloudCollection._instanced) {\n    i = cloud._index;\n    positionHighWriter(i, high.x, high.y, high.z, scale.x);\n    positionLowWriter(i, low.x, low.y, low.z, scale.y);\n  } else {\n    i = cloud._index * 4;\n    positionHighWriter(i + 0, high.x, high.y, high.z, scale.x);\n    positionHighWriter(i + 1, high.x, high.y, high.z, scale.x);\n    positionHighWriter(i + 2, high.x, high.y, high.z, scale.x);\n    positionHighWriter(i + 3, high.x, high.y, high.z, scale.x);\n\n    positionLowWriter(i + 0, low.x, low.y, low.z, scale.y);\n    positionLowWriter(i + 1, low.x, low.y, low.z, scale.y);\n    positionLowWriter(i + 2, low.x, low.y, low.z, scale.y);\n    positionLowWriter(i + 3, low.x, low.y, low.z, scale.y);\n  }\n}\n\nfunction writePackedAttribute0(cloudCollection, frameState, vafWriters, cloud) {\n  let i;\n  const writer = vafWriters[attributeLocations.packedAttribute0];\n  const show = cloud.show;\n  const brightness = cloud.brightness;\n\n  if (cloudCollection._instanced) {\n    i = cloud._index;\n    writer(i, show, brightness, 0.0, 0.0);\n  } else {\n    i = cloud._index * 4;\n    writer(i + 0, show, brightness, 0.0, 0.0);\n    writer(i + 1, show, brightness, 1.0, 0.0);\n    writer(i + 2, show, brightness, 1.0, 1.0);\n    writer(i + 3, show, brightness, 0.0, 1.0);\n  }\n}\n\nfunction writePackedAttribute1(cloudCollection, frameState, vafWriters, cloud) {\n  let i;\n  const writer = vafWriters[attributeLocations.packedAttribute1];\n  const maximumSize = cloud.maximumSize;\n  const slice = cloud.slice;\n\n  if (cloudCollection._instanced) {\n    i = cloud._index;\n    writer(i, maximumSize.x, maximumSize.y, maximumSize.z, slice);\n  } else {\n    i = cloud._index * 4;\n    writer(i + 0, maximumSize.x, maximumSize.y, maximumSize.z, slice);\n    writer(i + 1, maximumSize.x, maximumSize.y, maximumSize.z, slice);\n    writer(i + 2, maximumSize.x, maximumSize.y, maximumSize.z, slice);\n    writer(i + 3, maximumSize.x, maximumSize.y, maximumSize.z, slice);\n  }\n}\n\nfunction writeColor(cloudCollection, frameState, vafWriters, cloud) {\n  let i;\n  const writer = vafWriters[attributeLocations.color];\n  const color = cloud.color;\n  const red = Color.floatToByte(color.red);\n  const green = Color.floatToByte(color.green);\n  const blue = Color.floatToByte(color.blue);\n  const alpha = Color.floatToByte(color.alpha);\n\n  if (cloudCollection._instanced) {\n    i = cloud._index;\n    writer(i, red, green, blue, alpha);\n  } else {\n    i = cloud._index * 4;\n    writer(i + 0, red, green, blue, alpha);\n    writer(i + 1, red, green, blue, alpha);\n    writer(i + 2, red, green, blue, alpha);\n    writer(i + 3, red, green, blue, alpha);\n  }\n}\nfunction writeCloud(cloudCollection, frameState, vafWriters, cloud) {\n  writePositionAndScale(cloudCollection, frameState, vafWriters, cloud);\n  writePackedAttribute0(cloudCollection, frameState, vafWriters, cloud);\n  writePackedAttribute1(cloudCollection, frameState, vafWriters, cloud);\n  writeColor(cloudCollection, frameState, vafWriters, cloud);\n}\n\nfunction createNoiseTexture(cloudCollection, frameState, vsSource, fsSource) {\n  const that = cloudCollection;\n\n  const textureSliceWidth = that._textureSliceWidth;\n  const noiseTextureRows = that._noiseTextureRows;\n  //>>includeStart('debug', pragmas.debug);\n  if (\n    textureSliceWidth / noiseTextureRows < 1 ||\n    textureSliceWidth % noiseTextureRows !== 0\n  ) {\n    throw new DeveloperError(\n      \"noiseTextureRows must evenly divide textureSliceWidth\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  const context = frameState.context;\n  that._vaNoise = createTextureVA(context);\n  that._spNoise = ShaderProgram.fromCache({\n    context: context,\n    vertexShaderSource: vsSource,\n    fragmentShaderSource: fsSource,\n    attributeLocations: {\n      position: 0,\n    },\n  });\n\n  const noiseDetail = that.noiseDetail;\n  const noiseOffset = that.noiseOffset;\n\n  that._noiseTexture = new Texture({\n    context: context,\n    width: (textureSliceWidth * textureSliceWidth) / noiseTextureRows,\n    height: textureSliceWidth * noiseTextureRows,\n    pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n    pixelFormat: PixelFormat.RGBA,\n    sampler: new Sampler({\n      wrapS: TextureWrap.REPEAT,\n      wrapT: TextureWrap.REPEAT,\n      minificationFilter: TextureMinificationFilter.NEAREST,\n      magnificationFilter: TextureMagnificationFilter.NEAREST,\n    }),\n  });\n\n  const textureCommand = new ComputeCommand({\n    vertexArray: that._vaNoise,\n    shaderProgram: that._spNoise,\n    outputTexture: that._noiseTexture,\n    uniformMap: {\n      u_noiseTextureDimensions: getNoiseTextureDimensions(that),\n      u_noiseDetail: function () {\n        return noiseDetail;\n      },\n      u_noiseOffset: function () {\n        return noiseOffset;\n      },\n    },\n    persists: false,\n    owner: cloudCollection,\n    postExecute: function (texture) {\n      that._ready = true;\n      that._loading = false;\n    },\n  });\n\n  frameState.commandList.push(textureCommand);\n  that._loading = true;\n}\n\nfunction createVertexArray(cloudCollection, frameState) {\n  const that = cloudCollection;\n  const context = frameState.context;\n  that._createVertexArray = false;\n  that._vaf = that._vaf && that._vaf.destroy();\n\n  const clouds = cloudCollection._clouds;\n  const cloudsLength = clouds.length;\n  if (cloudsLength > 0) {\n    that._vaf = createVAF(context, cloudsLength, that._instanced);\n    const vafWriters = that._vaf.writers;\n\n    let i;\n    // Rewrite entire buffer if clouds were added or removed.\n    for (i = 0; i < cloudsLength; ++i) {\n      const cloud = clouds[i];\n      writeCloud(cloudCollection, frameState, vafWriters, cloud);\n    }\n\n    // Different cloud collections share the same index buffer.\n    that._vaf.commit(getIndexBuffer(context));\n  }\n}\n\nconst scratchWriterArray = [];\n\nfunction updateClouds(cloudCollection, frameState) {\n  const context = frameState.context;\n  const that = cloudCollection;\n  const clouds = that._clouds;\n  const cloudsLength = clouds.length;\n  const cloudsToUpdate = that._cloudsToUpdate;\n  const cloudsToUpdateLength = that._cloudsToUpdateIndex;\n\n  const properties = that._propertiesChanged;\n\n  const writers = scratchWriterArray;\n  writers.length = 0;\n\n  if (properties[POSITION_INDEX] || properties[SCALE_INDEX]) {\n    writers.push(writePositionAndScale);\n  }\n\n  if (properties[SHOW_INDEX] || properties[BRIGHTNESS_INDEX]) {\n    writers.push(writePackedAttribute0);\n  }\n\n  if (properties[MAXIMUM_SIZE_INDEX] || properties[SLICE_INDEX]) {\n    writers.push(writePackedAttribute1);\n  }\n\n  if (properties[COLOR_INDEX]) {\n    writers.push(writeColor);\n  }\n\n  const numWriters = writers.length;\n  const vafWriters = that._vaf.writers;\n\n  let i, c, w;\n  if (cloudsToUpdateLength / cloudsLength > 0.1) {\n    // Like BillboardCollection, if more than 10% of clouds change,\n    // rewrite the entire buffer.\n\n    for (i = 0; i < cloudsToUpdateLength; ++i) {\n      c = cloudsToUpdate[i];\n      c._dirty = false;\n\n      for (w = 0; w < numWriters; ++w) {\n        writers[w](cloudCollection, frameState, vafWriters, c);\n      }\n    }\n\n    that._vaf.commit(getIndexBuffer(context));\n  } else {\n    for (i = 0; i < cloudsToUpdateLength; ++i) {\n      c = cloudsToUpdate[i];\n      c._dirty = false;\n\n      for (w = 0; w < numWriters; ++w) {\n        writers[w](cloudCollection, frameState, vafWriters, c);\n      }\n\n      if (that._instanced) {\n        that._vaf.subCommit(c._index, 1);\n      } else {\n        that._vaf.subCommit(c._index * 4, 4);\n      }\n    }\n    that._vaf.endSubCommits();\n  }\n\n  that._cloudsToUpdateIndex = 0;\n}\n\nfunction createShaderProgram(cloudCollection, frameState, vsSource, fsSource) {\n  const context = frameState.context;\n  const that = cloudCollection;\n  const vs = new ShaderSource({\n    defines: [],\n    sources: [vsSource],\n  });\n\n  if (that._instanced) {\n    vs.defines.push(\"INSTANCED\");\n  }\n\n  const fs = new ShaderSource({\n    defines: [],\n    sources: [fsSource],\n  });\n\n  if (that.debugBillboards) {\n    fs.defines.push(\"DEBUG_BILLBOARDS\");\n  }\n\n  if (that.debugEllipsoids) {\n    fs.defines.push(\"DEBUG_ELLIPSOIDS\");\n  }\n\n  that._sp = ShaderProgram.replaceCache({\n    context: context,\n    shaderProgram: that._sp,\n    vertexShaderSource: vs,\n    fragmentShaderSource: fs,\n    attributeLocations: attributeLocations,\n  });\n\n  that._rs = RenderState.fromCache({\n    depthTest: {\n      enabled: true,\n      func: WebGLConstants.LESS,\n    },\n    depthMask: false,\n    blending: BlendingState.ALPHA_BLEND,\n  });\n\n  that._spCreated = true;\n  that._compiledDebugBillboards = that.debugBillboards;\n  that._compiledDebugEllipsoids = that.debugEllipsoids;\n}\n\nfunction createDrawCommands(cloudCollection, frameState) {\n  const that = cloudCollection;\n  const pass = frameState.passes;\n  const uniforms = that._uniforms;\n  const commandList = frameState.commandList;\n  if (pass.render) {\n    const colorList = that._colorCommands;\n\n    const va = that._vaf.va;\n    const vaLength = va.length;\n    colorList.length = vaLength;\n    for (let i = 0; i < vaLength; i++) {\n      let command = colorList[i];\n      if (!defined(command)) {\n        command = colorList[i] = new DrawCommand();\n      }\n      command.pass = Pass.TRANSLUCENT;\n      command.owner = cloudCollection;\n      command.uniformMap = uniforms;\n      command.count = va[i].indicesCount;\n      command.vertexArray = va[i].va;\n      command.shaderProgram = that._sp;\n      command.renderState = that._rs;\n      if (that._instanced) {\n        command.count = 6;\n        command.instanceCount = that._clouds.length;\n      }\n\n      commandList.push(command);\n    }\n  }\n}\n\n/**\n * @private\n */\nCloudCollection.prototype.update = function (frameState) {\n  removeClouds(this);\n  if (!this.show) {\n    return;\n  }\n\n  const debugging = this.debugBillboards || this.debugEllipsoids;\n  this._ready = debugging ? true : defined(this._noiseTexture);\n\n  if (!this._ready && !this._loading && !debugging) {\n    createNoiseTexture(this, frameState, CloudNoiseVS, CloudNoiseFS);\n  }\n\n  this._instanced = frameState.context.instancedArrays;\n  attributeLocations = this._instanced\n    ? attributeLocationsInstanced\n    : attributeLocationsBatched;\n  getIndexBuffer = this._instanced\n    ? getIndexBufferInstanced\n    : getIndexBufferBatched;\n\n  const clouds = this._clouds;\n  const cloudsLength = clouds.length;\n  const cloudsToUpdate = this._cloudsToUpdate;\n  const cloudsToUpdateLength = this._cloudsToUpdateIndex;\n\n  if (this._createVertexArray) {\n    createVertexArray(this, frameState);\n  } else if (cloudsToUpdateLength > 0) {\n    // Clouds were modified, but none were added or removed.\n    updateClouds(this, frameState);\n  }\n\n  // If the number of total clouds ever shrinks considerably,\n  // truncate cloudsToUpdate so that we free memory that\n  // we are no longer using.\n  if (cloudsToUpdateLength > cloudsLength * 1.5) {\n    cloudsToUpdate.length = cloudsLength;\n  }\n\n  if (\n    !defined(this._vaf) ||\n    !defined(this._vaf.va) ||\n    !this._ready & !debugging\n  ) {\n    return;\n  }\n\n  if (\n    !this._spCreated ||\n    this.debugBillboards !== this._compiledDebugBillboards ||\n    this.debugEllipsoids !== this._compiledDebugEllipsoids\n  ) {\n    createShaderProgram(this, frameState, CloudCollectionVS, CloudCollectionFS);\n  }\n\n  createDrawCommands(this, frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see CloudCollection#destroy\n */\nCloudCollection.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * clouds = clouds && clouds.destroy();\n *\n * @see CloudCollection#isDestroyed\n */\nCloudCollection.prototype.destroy = function () {\n  this._noiseTexture = this._noiseTexture && this._noiseTexture.destroy();\n  this._sp = this._sp && this._sp.destroy();\n  this._vaf = this._vaf && this._vaf.destroy();\n\n  destroyClouds(this._clouds);\n\n  return destroyObject(this);\n};\n\nexport default CloudCollection;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport CesiumMath from \"../Core/Math.js\";\n\nconst defaultAngle = CesiumMath.toRadians(30.0);\n\n/**\n * A ParticleEmitter that emits particles within a cone.\n * Particles will be positioned at the tip of the cone and have initial velocities going towards the base.\n *\n * @alias ConeEmitter\n * @constructor\n *\n * @param {number} [angle=Cesium.Math.toRadians(30.0)] The angle of the cone in radians.\n */\nfunction ConeEmitter(angle) {\n  this._angle = defaultValue(angle, defaultAngle);\n}\n\nObject.defineProperties(ConeEmitter.prototype, {\n  /**\n   * The angle of the cone in radians.\n   * @memberof CircleEmitter.prototype\n   * @type {number}\n   * @default Cesium.Math.toRadians(30.0)\n   */\n  angle: {\n    get: function () {\n      return this._angle;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number(\"value\", value);\n      //>>includeEnd('debug');\n      this._angle = value;\n    },\n  },\n});\n\n/**\n * Initializes the given {Particle} by setting it's position and velocity.\n *\n * @private\n * @param {Particle} particle The particle to initialize\n */\nConeEmitter.prototype.emit = function (particle) {\n  const radius = Math.tan(this._angle);\n\n  // Compute a random point on the cone's base\n  const theta = CesiumMath.randomBetween(0.0, CesiumMath.TWO_PI);\n  const rad = CesiumMath.randomBetween(0.0, radius);\n\n  const x = rad * Math.cos(theta);\n  const y = rad * Math.sin(theta);\n  const z = 1.0;\n\n  particle.velocity = Cartesian3.fromElements(x, y, z, particle.velocity);\n  Cartesian3.normalize(particle.velocity, particle.velocity);\n  particle.position = Cartesian3.clone(Cartesian3.ZERO, particle.position);\n};\nexport default ConeEmitter;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Appearance from \"./Appearance.js\";\n\n/**\n * Visualizes a vertex attribute by displaying it as a color for debugging.\n * <p>\n * Components for well-known unit-length vectors, i.e., <code>normal</code>,\n * <code>tangent</code>, and <code>bitangent</code>, are scaled and biased\n * from [-1.0, 1.0] to (-1.0, 1.0).\n * </p>\n *\n * @alias DebugAppearance\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {string} options.attributeName The name of the attribute to visualize.\n * @param {boolean} [options.perInstanceAttribute=false] Boolean that determines whether this attribute is a per-instance geometry attribute.\n * @param {string} [options.glslDatatype='vec3'] The GLSL datatype of the attribute.  Supported datatypes are <code>float</code>, <code>vec2</code>, <code>vec3</code>, and <code>vec4</code>.\n * @param {string} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.\n * @param {string} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.\n * @param {object} [options.renderState] Optional render state to override the default render state.\n *\n * @exception {DeveloperError} options.glslDatatype must be float, vec2, vec3, or vec4.\n *\n * @example\n * const primitive = new Cesium.Primitive({\n *   geometryInstances : // ...\n *   appearance : new Cesium.DebugAppearance({\n *     attributeName : 'normal'\n *   })\n * });\n */\nfunction DebugAppearance(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const attributeName = options.attributeName;\n  let perInstanceAttribute = options.perInstanceAttribute;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(attributeName)) {\n    throw new DeveloperError(\"options.attributeName is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(perInstanceAttribute)) {\n    perInstanceAttribute = false;\n  }\n\n  let glslDatatype = defaultValue(options.glslDatatype, \"vec3\");\n  const varyingName = `v_${attributeName}`;\n  let getColor;\n\n  // Well-known normalized vector attributes in VertexFormat\n  if (\n    attributeName === \"normal\" ||\n    attributeName === \"tangent\" ||\n    attributeName === \"bitangent\"\n  ) {\n    getColor = `vec4 getColor() { return vec4((${varyingName} + vec3(1.0)) * 0.5, 1.0); }\\n`;\n  } else {\n    // All other attributes, both well-known and custom\n    if (attributeName === \"st\") {\n      glslDatatype = \"vec2\";\n    }\n\n    switch (glslDatatype) {\n      case \"float\":\n        getColor = `vec4 getColor() { return vec4(vec3(${varyingName}), 1.0); }\\n`;\n        break;\n      case \"vec2\":\n        getColor = `vec4 getColor() { return vec4(${varyingName}, 0.0, 1.0); }\\n`;\n        break;\n      case \"vec3\":\n        getColor = `vec4 getColor() { return vec4(${varyingName}, 1.0); }\\n`;\n        break;\n      case \"vec4\":\n        getColor = `vec4 getColor() { return ${varyingName}; }\\n`;\n        break;\n      //>>includeStart('debug', pragmas.debug);\n      default:\n        throw new DeveloperError(\n          \"options.glslDatatype must be float, vec2, vec3, or vec4.\"\n        );\n      //>>includeEnd('debug');\n    }\n  }\n\n  const vs =\n    `${\n      \"in vec3 position3DHigh;\\n\" +\n      \"in vec3 position3DLow;\\n\" +\n      \"in float batchId;\\n\"\n    }${\n      perInstanceAttribute ? \"\" : `in ${glslDatatype} ${attributeName};\\n`\n    }out ${glslDatatype} ${varyingName};\\n` +\n    `void main()\\n` +\n    `{\\n` +\n    `vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\\n${\n      perInstanceAttribute\n        ? `${varyingName} = czm_batchTable_${attributeName}(batchId);\\n`\n        : `${varyingName} = ${attributeName};\\n`\n    }gl_Position = czm_modelViewProjectionRelativeToEye * p;\\n` +\n    `}`;\n  const fs =\n    `in ${glslDatatype} ${varyingName};\\n${getColor}\\n` +\n    `void main()\\n` +\n    `{\\n` +\n    `out_FragColor = getColor();\\n` +\n    `}`;\n\n  /**\n   * This property is part of the {@link Appearance} interface, but is not\n   * used by {@link DebugAppearance} since a fully custom fragment shader is used.\n   *\n   * @type Material\n   *\n   * @default undefined\n   */\n  this.material = undefined;\n\n  /**\n   * When <code>true</code>, the geometry is expected to appear translucent.\n   *\n   * @type {boolean}\n   *\n   * @default false\n   */\n  this.translucent = defaultValue(options.translucent, false);\n\n  this._vertexShaderSource = defaultValue(options.vertexShaderSource, vs);\n  this._fragmentShaderSource = defaultValue(options.fragmentShaderSource, fs);\n  this._renderState = Appearance.getDefaultRenderState(\n    false,\n    false,\n    options.renderState\n  );\n  this._closed = defaultValue(options.closed, false);\n\n  // Non-derived members\n\n  this._attributeName = attributeName;\n  this._glslDatatype = glslDatatype;\n}\n\nObject.defineProperties(DebugAppearance.prototype, {\n  /**\n   * The GLSL source code for the vertex shader.\n   *\n   * @memberof DebugAppearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  vertexShaderSource: {\n    get: function () {\n      return this._vertexShaderSource;\n    },\n  },\n\n  /**\n   * The GLSL source code for the fragment shader.  The full fragment shader\n   * source is built procedurally taking into account the {@link DebugAppearance#material}.\n   * Use {@link DebugAppearance#getFragmentShaderSource} to get the full source.\n   *\n   * @memberof DebugAppearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  fragmentShaderSource: {\n    get: function () {\n      return this._fragmentShaderSource;\n    },\n  },\n\n  /**\n   * The WebGL fixed-function state to use when rendering the geometry.\n   *\n   * @memberof DebugAppearance.prototype\n   *\n   * @type {object}\n   * @readonly\n   */\n  renderState: {\n    get: function () {\n      return this._renderState;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the geometry is expected to be closed.\n   *\n   * @memberof DebugAppearance.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  closed: {\n    get: function () {\n      return this._closed;\n    },\n  },\n\n  /**\n   * The name of the attribute being visualized.\n   *\n   * @memberof DebugAppearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  attributeName: {\n    get: function () {\n      return this._attributeName;\n    },\n  },\n\n  /**\n   * The GLSL datatype of the attribute being visualized.\n   *\n   * @memberof DebugAppearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  glslDatatype: {\n    get: function () {\n      return this._glslDatatype;\n    },\n  },\n});\n\n/**\n * Returns the full GLSL fragment shader source, which for {@link DebugAppearance} is just\n * {@link DebugAppearance#fragmentShaderSource}.\n *\n * @function\n *\n * @returns {string} The full GLSL fragment shader source.\n */\nDebugAppearance.prototype.getFragmentShaderSource =\n  Appearance.prototype.getFragmentShaderSource;\n\n/**\n * Determines if the geometry is translucent based on {@link DebugAppearance#translucent}.\n *\n * @function\n *\n * @returns {boolean} <code>true</code> if the appearance is translucent.\n */\nDebugAppearance.prototype.isTranslucent = Appearance.prototype.isTranslucent;\n\n/**\n * Creates a render state.  This is not the final render state instance; instead,\n * it can contain a subset of render state properties identical to the render state\n * created in the context.\n *\n * @function\n *\n * @returns {object} The render state.\n */\nDebugAppearance.prototype.getRenderState = Appearance.prototype.getRenderState;\nexport default DebugAppearance;\n", "import ArcType from \"../Core/ArcType.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PolylineGeometry from \"../Core/PolylineGeometry.js\";\nimport PolylineColorAppearance from \"./PolylineColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\n\n/**\n * Draws the axes of a reference frame defined by a matrix that transforms to world\n * coordinates, i.e., Earth's WGS84 coordinates.  The most prominent example is\n * a primitives <code>modelMatrix</code>.\n * <p>\n * The X axis is red; Y is green; and Z is blue.\n * </p>\n * <p>\n * This is for debugging only; it is not optimized for production use.\n * </p>\n *\n * @alias DebugModelMatrixPrimitive\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {number} [options.length=10000000.0] The length of the axes in meters.\n * @param {number} [options.width=2.0] The width of the axes in pixels.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize.\n * @param {boolean} [options.show=true] Determines if this primitive will be shown.\n * @param {object} [options.id] A user-defined object to return when the instance is picked with {@link Scene#pick}\n *\n * @example\n * primitives.add(new Cesium.DebugModelMatrixPrimitive({\n *   modelMatrix : primitive.modelMatrix,  // primitive to debug\n *   length : 100000.0,\n *   width : 10.0\n * }));\n */\nfunction DebugModelMatrixPrimitive(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * The length of the axes in meters.\n   *\n   * @type {number}\n   * @default 10000000.0\n   */\n  this.length = defaultValue(options.length, 10000000.0);\n  this._length = undefined;\n\n  /**\n   * The width of the axes in pixels.\n   *\n   * @type {number}\n   * @default 2.0\n   */\n  this.width = defaultValue(options.width, 2.0);\n  this._width = undefined;\n\n  /**\n   * Determines if this primitive will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  /**\n   * The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize.\n   *\n   * @type {Matrix4}\n   * @default {@link Matrix4.IDENTITY}\n   */\n  this.modelMatrix = Matrix4.clone(\n    defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n  );\n  this._modelMatrix = new Matrix4();\n\n  /**\n   * User-defined value returned when the primitive is picked.\n   *\n   * @type {*}\n   * @default undefined\n   *\n   * @see Scene#pick\n   */\n  this.id = options.id;\n  this._id = undefined;\n\n  this._primitive = undefined;\n}\n\n/**\n * @private\n */\nDebugModelMatrixPrimitive.prototype.update = function (frameState) {\n  if (!this.show) {\n    return;\n  }\n\n  if (\n    !defined(this._primitive) ||\n    !Matrix4.equals(this._modelMatrix, this.modelMatrix) ||\n    this._length !== this.length ||\n    this._width !== this.width ||\n    this._id !== this.id\n  ) {\n    this._modelMatrix = Matrix4.clone(this.modelMatrix, this._modelMatrix);\n    this._length = this.length;\n    this._width = this.width;\n    this._id = this.id;\n\n    if (defined(this._primitive)) {\n      this._primitive.destroy();\n    }\n\n    // Workaround projecting (0, 0, 0)\n    if (\n      this.modelMatrix[12] === 0.0 &&\n      this.modelMatrix[13] === 0.0 &&\n      this.modelMatrix[14] === 0.0\n    ) {\n      this.modelMatrix[14] = 0.01;\n    }\n\n    const x = new GeometryInstance({\n      geometry: new PolylineGeometry({\n        positions: [Cartesian3.ZERO, Cartesian3.UNIT_X],\n        width: this.width,\n        vertexFormat: PolylineColorAppearance.VERTEX_FORMAT,\n        colors: [Color.RED, Color.RED],\n        arcType: ArcType.NONE,\n      }),\n      modelMatrix: Matrix4.multiplyByUniformScale(\n        this.modelMatrix,\n        this.length,\n        new Matrix4()\n      ),\n      id: this.id,\n      pickPrimitive: this,\n    });\n    const y = new GeometryInstance({\n      geometry: new PolylineGeometry({\n        positions: [Cartesian3.ZERO, Cartesian3.UNIT_Y],\n        width: this.width,\n        vertexFormat: PolylineColorAppearance.VERTEX_FORMAT,\n        colors: [Color.GREEN, Color.GREEN],\n        arcType: ArcType.NONE,\n      }),\n      modelMatrix: Matrix4.multiplyByUniformScale(\n        this.modelMatrix,\n        this.length,\n        new Matrix4()\n      ),\n      id: this.id,\n      pickPrimitive: this,\n    });\n    const z = new GeometryInstance({\n      geometry: new PolylineGeometry({\n        positions: [Cartesian3.ZERO, Cartesian3.UNIT_Z],\n        width: this.width,\n        vertexFormat: PolylineColorAppearance.VERTEX_FORMAT,\n        colors: [Color.BLUE, Color.BLUE],\n        arcType: ArcType.NONE,\n      }),\n      modelMatrix: Matrix4.multiplyByUniformScale(\n        this.modelMatrix,\n        this.length,\n        new Matrix4()\n      ),\n      id: this.id,\n      pickPrimitive: this,\n    });\n\n    this._primitive = new Primitive({\n      geometryInstances: [x, y, z],\n      appearance: new PolylineColorAppearance(),\n      asynchronous: false,\n    });\n  }\n\n  this._primitive.update(frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see DebugModelMatrixPrimitive#destroy\n */\nDebugModelMatrixPrimitive.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * p = p && p.destroy();\n *\n * @see DebugModelMatrixPrimitive#isDestroyed\n */\nDebugModelMatrixPrimitive.prototype.destroy = function () {\n  this._primitive = this._primitive && this._primitive.destroy();\n  return destroyObject(this);\n};\nexport default DebugModelMatrixPrimitive;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * A light that gets emitted in a single direction from infinitely far away.\n *\n * @param {object} options Object with the following properties:\n * @param {Cartesian3} options.direction The direction in which light gets emitted.\n * @param {Color} [options.color=Color.WHITE] The color of the light.\n * @param {number} [options.intensity=1.0] The intensity of the light.\n *\n * @exception {DeveloperError} options.direction cannot be zero-length\n *\n * @alias DirectionalLight\n * @constructor\n */\nfunction DirectionalLight(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options\", options);\n  Check.typeOf.object(\"options.direction\", options.direction);\n  if (Cartesian3.equals(options.direction, Cartesian3.ZERO)) {\n    throw new DeveloperError(\"options.direction cannot be zero-length\");\n  }\n  //>>includeEnd('debug');\n\n  /**\n   * The direction in which light gets emitted.\n   * @type {Cartesian3}\n   */\n  this.direction = Cartesian3.clone(options.direction);\n\n  /**\n   * The color of the light.\n   * @type {Color}\n   * @default Color.WHITE\n   */\n  this.color = Color.clone(defaultValue(options.color, Color.WHITE));\n\n  /**\n   * The intensity of the light.\n   * @type {number}\n   * @default 1.0\n   */\n  this.intensity = defaultValue(options.intensity, 1.0);\n}\n\nexport default DirectionalLight;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 v_positionMC;\\n\\\nin vec3 v_positionEC;\\n\\\nin vec2 v_st;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    czm_materialInput materialInput;\\n\\\n\\n\\\n    vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\\n\\\n#ifdef FACE_FORWARD\\n\\\n    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\\n\\\n#endif\\n\\\n\\n\\\n    materialInput.s = v_st.s;\\n\\\n    materialInput.st = v_st;\\n\\\n    materialInput.str = vec3(v_st, 0.0);\\n\\\n\\n\\\n    // Convert tangent space material normal to eye space\\n\\\n    materialInput.normalEC = normalEC;\\n\\\n    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\\n\\\n\\n\\\n    // Convert view vector to world space\\n\\\n    vec3 positionToEyeEC = -v_positionEC;\\n\\\n    materialInput.positionToEyeEC = positionToEyeEC;\\n\\\n\\n\\\n    czm_material material = czm_getMaterial(materialInput);\\n\\\n\\n\\\n#ifdef FLAT\\n\\\n    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#else\\n\\\n    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec3 position3DHigh;\\n\\\nin vec3 position3DLow;\\n\\\nin vec2 st;\\n\\\nin float batchId;\\n\\\n\\n\\\nout vec3 v_positionMC;\\n\\\nout vec3 v_positionEC;\\n\\\nout vec2 v_st;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 p = czm_computePosition();\\n\\\n\\n\\\n    v_positionMC = position3DHigh + position3DLow;           // position in model coordinates\\n\\\n    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;     // position in eye coordinates\\n\\\n    v_st = st;\\n\\\n\\n\\\n    gl_Position = czm_modelViewProjectionRelativeToEye * p;\\n\\\n}\\n\\\n\";\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport EllipsoidSurfaceAppearanceFS from \"../Shaders/Appearances/EllipsoidSurfaceAppearanceFS.js\";\nimport EllipsoidSurfaceAppearanceVS from \"../Shaders/Appearances/EllipsoidSurfaceAppearanceVS.js\";\nimport Appearance from \"./Appearance.js\";\nimport Material from \"./Material.js\";\n\n/**\n * An appearance for geometry on the surface of the ellipsoid like {@link PolygonGeometry}\n * and {@link RectangleGeometry}, which supports all materials like {@link MaterialAppearance}\n * with {@link MaterialAppearance.MaterialSupport.ALL}.  However, this appearance requires\n * fewer vertex attributes since the fragment shader can procedurally compute <code>normal</code>,\n * <code>tangent</code>, and <code>bitangent</code>.\n *\n * @alias EllipsoidSurfaceAppearance\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {boolean} [options.flat=false] When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.\n * @param {boolean} [options.faceForward=options.aboveGround] When <code>true</code>, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots.  This is useful when both sides of a geometry should be shaded like {@link WallGeometry}.\n * @param {boolean} [options.translucent=true] When <code>true</code>, the geometry is expected to appear translucent so {@link EllipsoidSurfaceAppearance#renderState} has alpha blending enabled.\n * @param {boolean} [options.aboveGround=false] When <code>true</code>, the geometry is expected to be on the ellipsoid's surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled.\n * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color.\n * @param {string} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.\n * @param {string} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.\n * @param {object} [options.renderState] Optional render state to override the default render state.\n *\n * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n *\n * @example\n * const primitive = new Cesium.Primitive({\n *   geometryInstances : new Cesium.GeometryInstance({\n *     geometry : new Cesium.PolygonGeometry({\n *       vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,\n *       // ...\n *     })\n *   }),\n *   appearance : new Cesium.EllipsoidSurfaceAppearance({\n *     material : Cesium.Material.fromType('Stripe')\n *   })\n * });\n */\nfunction EllipsoidSurfaceAppearance(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const translucent = defaultValue(options.translucent, true);\n  const aboveGround = defaultValue(options.aboveGround, false);\n\n  /**\n   * The material used to determine the fragment color.  Unlike other {@link EllipsoidSurfaceAppearance}\n   * properties, this is not read-only, so an appearance's material can change on the fly.\n   *\n   * @type Material\n   *\n   * @default {@link Material.ColorType}\n   *\n   * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n   */\n  this.material = defined(options.material)\n    ? options.material\n    : Material.fromType(Material.ColorType);\n\n  /**\n   * When <code>true</code>, the geometry is expected to appear translucent.\n   *\n   * @type {boolean}\n   *\n   * @default true\n   */\n  this.translucent = defaultValue(options.translucent, true);\n\n  this._vertexShaderSource = defaultValue(\n    options.vertexShaderSource,\n    EllipsoidSurfaceAppearanceVS\n  );\n  this._fragmentShaderSource = defaultValue(\n    options.fragmentShaderSource,\n    EllipsoidSurfaceAppearanceFS\n  );\n  this._renderState = Appearance.getDefaultRenderState(\n    translucent,\n    !aboveGround,\n    options.renderState\n  );\n  this._closed = false;\n\n  // Non-derived members\n\n  this._flat = defaultValue(options.flat, false);\n  this._faceForward = defaultValue(options.faceForward, aboveGround);\n  this._aboveGround = aboveGround;\n}\n\nObject.defineProperties(EllipsoidSurfaceAppearance.prototype, {\n  /**\n   * The GLSL source code for the vertex shader.\n   *\n   * @memberof EllipsoidSurfaceAppearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  vertexShaderSource: {\n    get: function () {\n      return this._vertexShaderSource;\n    },\n  },\n\n  /**\n   * The GLSL source code for the fragment shader.  The full fragment shader\n   * source is built procedurally taking into account {@link EllipsoidSurfaceAppearance#material},\n   * {@link EllipsoidSurfaceAppearance#flat}, and {@link EllipsoidSurfaceAppearance#faceForward}.\n   * Use {@link EllipsoidSurfaceAppearance#getFragmentShaderSource} to get the full source.\n   *\n   * @memberof EllipsoidSurfaceAppearance.prototype\n   *\n   * @type {string}\n   * @readonly\n   */\n  fragmentShaderSource: {\n    get: function () {\n      return this._fragmentShaderSource;\n    },\n  },\n\n  /**\n   * The WebGL fixed-function state to use when rendering the geometry.\n   * <p>\n   * The render state can be explicitly defined when constructing a {@link EllipsoidSurfaceAppearance}\n   * instance, or it is set implicitly via {@link EllipsoidSurfaceAppearance#translucent}\n   * and {@link EllipsoidSurfaceAppearance#aboveGround}.\n   * </p>\n   *\n   * @memberof EllipsoidSurfaceAppearance.prototype\n   *\n   * @type {object}\n   * @readonly\n   */\n  renderState: {\n    get: function () {\n      return this._renderState;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the geometry is expected to be closed so\n   * {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled.\n   * If the viewer enters the geometry, it will not be visible.\n   *\n   * @memberof EllipsoidSurfaceAppearance.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  closed: {\n    get: function () {\n      return this._closed;\n    },\n  },\n\n  /**\n   * The {@link VertexFormat} that this appearance instance is compatible with.\n   * A geometry can have more vertex attributes and still be compatible - at a\n   * potential performance cost - but it can't have less.\n   *\n   * @memberof EllipsoidSurfaceAppearance.prototype\n   *\n   * @type VertexFormat\n   * @readonly\n   *\n   * @default {@link EllipsoidSurfaceAppearance.VERTEX_FORMAT}\n   */\n  vertexFormat: {\n    get: function () {\n      return EllipsoidSurfaceAppearance.VERTEX_FORMAT;\n    },\n  },\n\n  /**\n   * When <code>true</code>, flat shading is used in the fragment shader,\n   * which means lighting is not taking into account.\n   *\n   * @memberof EllipsoidSurfaceAppearance.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  flat: {\n    get: function () {\n      return this._flat;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the fragment shader flips the surface normal\n   * as needed to ensure that the normal faces the viewer to avoid\n   * dark spots.  This is useful when both sides of a geometry should be\n   * shaded like {@link WallGeometry}.\n   *\n   * @memberof EllipsoidSurfaceAppearance.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default true\n   */\n  faceForward: {\n    get: function () {\n      return this._faceForward;\n    },\n  },\n\n  /**\n   * When <code>true</code>, the geometry is expected to be on the ellipsoid's\n   * surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState}\n   * has backface culling enabled.\n   *\n   *\n   * @memberof EllipsoidSurfaceAppearance.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   *\n   * @default false\n   */\n  aboveGround: {\n    get: function () {\n      return this._aboveGround;\n    },\n  },\n});\n\n/**\n * The {@link VertexFormat} that all {@link EllipsoidSurfaceAppearance} instances\n * are compatible with, which requires only <code>position</code> and <code>st</code>\n * attributes.  Other attributes are procedurally computed in the fragment shader.\n *\n * @type VertexFormat\n *\n * @constant\n */\nEllipsoidSurfaceAppearance.VERTEX_FORMAT = VertexFormat.POSITION_AND_ST;\n\n/**\n * Procedurally creates the full GLSL fragment shader source.  For {@link EllipsoidSurfaceAppearance},\n * this is derived from {@link EllipsoidSurfaceAppearance#fragmentShaderSource}, {@link EllipsoidSurfaceAppearance#flat},\n * and {@link EllipsoidSurfaceAppearance#faceForward}.\n *\n * @function\n *\n * @returns {string} The full GLSL fragment shader source.\n */\nEllipsoidSurfaceAppearance.prototype.getFragmentShaderSource =\n  Appearance.prototype.getFragmentShaderSource;\n\n/**\n * Determines if the geometry is translucent based on {@link EllipsoidSurfaceAppearance#translucent} and {@link Material#isTranslucent}.\n *\n * @function\n *\n * @returns {boolean} <code>true</code> if the appearance is translucent.\n */\nEllipsoidSurfaceAppearance.prototype.isTranslucent =\n  Appearance.prototype.isTranslucent;\n\n/**\n * Creates a render state.  This is not the final render state instance; instead,\n * it can contain a subset of render state properties identical to the render state\n * created in the context.\n *\n * @function\n *\n * @returns {object} The render state.\n */\nEllipsoidSurfaceAppearance.prototype.getRenderState =\n  Appearance.prototype.getRenderState;\nexport default EllipsoidSurfaceAppearance;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport TimeConstants from \"../Core/TimeConstants.js\";\n\n/**\n * Monitors the frame rate (frames per second) in a {@link Scene} and raises an event if the frame rate is\n * lower than a threshold.  Later, if the frame rate returns to the required level, a separate event is raised.\n * To avoid creating multiple FrameRateMonitors for a single {@link Scene}, use {@link FrameRateMonitor.fromScene}\n * instead of constructing an instance explicitly.\n *\n * @alias FrameRateMonitor\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Scene} options.scene The Scene instance for which to monitor performance.\n * @param {number} [options.samplingWindow=5.0] The length of the sliding window over which to compute the average frame rate, in seconds.\n * @param {number} [options.quietPeriod=2.0] The length of time to wait at startup and each time the page becomes visible (i.e. when the user\n *        switches back to the tab) before starting to measure performance, in seconds.\n * @param {number} [options.warmupPeriod=5.0] The length of the warmup period, in seconds.  During the warmup period, a separate\n *        (usually lower) frame rate is required.\n * @param {number} [options.minimumFrameRateDuringWarmup=4] The minimum frames-per-second that are required for acceptable performance during\n *        the warmup period.  If the frame rate averages less than this during any samplingWindow during the warmupPeriod, the\n *        lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any.\n * @param {number} [options.minimumFrameRateAfterWarmup=8] The minimum frames-per-second that are required for acceptable performance after\n *        the end of the warmup period.  If the frame rate averages less than this during any samplingWindow after the warmupPeriod, the\n *        lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any.\n */\nfunction FrameRateMonitor(options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options) || !defined(options.scene)) {\n    throw new DeveloperError(\"options.scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._scene = options.scene;\n\n  /**\n   * Gets or sets the length of the sliding window over which to compute the average frame rate, in seconds.\n   * @type {number}\n   */\n  this.samplingWindow = defaultValue(\n    options.samplingWindow,\n    FrameRateMonitor.defaultSettings.samplingWindow\n  );\n\n  /**\n   * Gets or sets the length of time to wait at startup and each time the page becomes visible (i.e. when the user\n   * switches back to the tab) before starting to measure performance, in seconds.\n   * @type {number}\n   */\n  this.quietPeriod = defaultValue(\n    options.quietPeriod,\n    FrameRateMonitor.defaultSettings.quietPeriod\n  );\n\n  /**\n   * Gets or sets the length of the warmup period, in seconds.  During the warmup period, a separate\n   * (usually lower) frame rate is required.\n   * @type {number}\n   */\n  this.warmupPeriod = defaultValue(\n    options.warmupPeriod,\n    FrameRateMonitor.defaultSettings.warmupPeriod\n  );\n\n  /**\n   * Gets or sets the minimum frames-per-second that are required for acceptable performance during\n   * the warmup period.  If the frame rate averages less than this during any <code>samplingWindow</code> during the <code>warmupPeriod</code>, the\n   * <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any.\n   * @type {number}\n   */\n  this.minimumFrameRateDuringWarmup = defaultValue(\n    options.minimumFrameRateDuringWarmup,\n    FrameRateMonitor.defaultSettings.minimumFrameRateDuringWarmup\n  );\n\n  /**\n   * Gets or sets the minimum frames-per-second that are required for acceptable performance after\n   * the end of the warmup period.  If the frame rate averages less than this during any <code>samplingWindow</code> after the <code>warmupPeriod</code>, the\n   * <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any.\n   * @type {number}\n   */\n  this.minimumFrameRateAfterWarmup = defaultValue(\n    options.minimumFrameRateAfterWarmup,\n    FrameRateMonitor.defaultSettings.minimumFrameRateAfterWarmup\n  );\n\n  this._lowFrameRate = new Event();\n  this._nominalFrameRate = new Event();\n\n  this._frameTimes = [];\n  this._needsQuietPeriod = true;\n  this._quietPeriodEndTime = 0.0;\n  this._warmupPeriodEndTime = 0.0;\n  this._frameRateIsLow = false;\n  this._lastFramesPerSecond = undefined;\n  this._pauseCount = 0;\n\n  const that = this;\n  this._preUpdateRemoveListener = this._scene.preUpdate.addEventListener(\n    function (scene, time) {\n      update(that, time);\n    }\n  );\n\n  this._hiddenPropertyName =\n    document.hidden !== undefined\n      ? \"hidden\"\n      : document.mozHidden !== undefined\n      ? \"mozHidden\"\n      : document.msHidden !== undefined\n      ? \"msHidden\"\n      : document.webkitHidden !== undefined\n      ? \"webkitHidden\"\n      : undefined;\n\n  const visibilityChangeEventName =\n    document.hidden !== undefined\n      ? \"visibilitychange\"\n      : document.mozHidden !== undefined\n      ? \"mozvisibilitychange\"\n      : document.msHidden !== undefined\n      ? \"msvisibilitychange\"\n      : document.webkitHidden !== undefined\n      ? \"webkitvisibilitychange\"\n      : undefined;\n\n  function visibilityChangeListener() {\n    visibilityChanged(that);\n  }\n\n  this._visibilityChangeRemoveListener = undefined;\n  if (defined(visibilityChangeEventName)) {\n    document.addEventListener(\n      visibilityChangeEventName,\n      visibilityChangeListener,\n      false\n    );\n\n    this._visibilityChangeRemoveListener = function () {\n      document.removeEventListener(\n        visibilityChangeEventName,\n        visibilityChangeListener,\n        false\n      );\n    };\n  }\n}\n\n/**\n * The default frame rate monitoring settings.  These settings are used when {@link FrameRateMonitor.fromScene}\n * needs to create a new frame rate monitor, and for any settings that are not passed to the\n * {@link FrameRateMonitor} constructor.\n *\n * @memberof FrameRateMonitor\n * @type {object}\n */\nFrameRateMonitor.defaultSettings = {\n  samplingWindow: 5.0,\n  quietPeriod: 2.0,\n  warmupPeriod: 5.0,\n  minimumFrameRateDuringWarmup: 4,\n  minimumFrameRateAfterWarmup: 8,\n};\n\n/**\n * Gets the {@link FrameRateMonitor} for a given scene.  If the scene does not yet have\n * a {@link FrameRateMonitor}, one is created with the {@link FrameRateMonitor.defaultSettings}.\n *\n * @param {Scene} scene The scene for which to get the {@link FrameRateMonitor}.\n * @returns {FrameRateMonitor} The scene's {@link FrameRateMonitor}.\n */\nFrameRateMonitor.fromScene = function (scene) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (\n    !defined(scene._frameRateMonitor) ||\n    scene._frameRateMonitor.isDestroyed()\n  ) {\n    scene._frameRateMonitor = new FrameRateMonitor({\n      scene: scene,\n    });\n  }\n\n  return scene._frameRateMonitor;\n};\n\nObject.defineProperties(FrameRateMonitor.prototype, {\n  /**\n   * Gets the {@link Scene} instance for which to monitor performance.\n   * @memberof FrameRateMonitor.prototype\n   * @type {Scene}\n   */\n  scene: {\n    get: function () {\n      return this._scene;\n    },\n  },\n\n  /**\n   * Gets the event that is raised when a low frame rate is detected.  The function will be passed\n   * the {@link Scene} instance as its first parameter and the average number of frames per second\n   * over the sampling window as its second parameter.\n   * @memberof FrameRateMonitor.prototype\n   * @type {Event}\n   */\n  lowFrameRate: {\n    get: function () {\n      return this._lowFrameRate;\n    },\n  },\n\n  /**\n   * Gets the event that is raised when the frame rate returns to a normal level after having been low.\n   * The function will be passed the {@link Scene} instance as its first parameter and the average\n   * number of frames per second over the sampling window as its second parameter.\n   * @memberof FrameRateMonitor.prototype\n   * @type {Event}\n   */\n  nominalFrameRate: {\n    get: function () {\n      return this._nominalFrameRate;\n    },\n  },\n\n  /**\n   * Gets the most recently computed average frames-per-second over the last <code>samplingWindow</code>.\n   * This property may be undefined if the frame rate has not been computed.\n   * @memberof FrameRateMonitor.prototype\n   * @type {number}\n   */\n  lastFramesPerSecond: {\n    get: function () {\n      return this._lastFramesPerSecond;\n    },\n  },\n});\n\n/**\n * Pauses monitoring of the frame rate.  To resume monitoring, {@link FrameRateMonitor#unpause}\n * must be called once for each time this function is called.\n * @memberof FrameRateMonitor\n */\nFrameRateMonitor.prototype.pause = function () {\n  ++this._pauseCount;\n  if (this._pauseCount === 1) {\n    this._frameTimes.length = 0;\n    this._lastFramesPerSecond = undefined;\n  }\n};\n\n/**\n * Resumes monitoring of the frame rate.  If {@link FrameRateMonitor#pause} was called\n * multiple times, this function must be called the same number of times in order to\n * actually resume monitoring.\n * @memberof FrameRateMonitor\n */\nFrameRateMonitor.prototype.unpause = function () {\n  --this._pauseCount;\n  if (this._pauseCount <= 0) {\n    this._pauseCount = 0;\n    this._needsQuietPeriod = true;\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @memberof FrameRateMonitor\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see FrameRateMonitor#destroy\n */\nFrameRateMonitor.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Unsubscribes this instance from all events it is listening to.\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @memberof FrameRateMonitor\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see FrameRateMonitor#isDestroyed\n */\nFrameRateMonitor.prototype.destroy = function () {\n  this._preUpdateRemoveListener();\n\n  if (defined(this._visibilityChangeRemoveListener)) {\n    this._visibilityChangeRemoveListener();\n  }\n\n  return destroyObject(this);\n};\n\nfunction update(monitor, time) {\n  if (monitor._pauseCount > 0) {\n    return;\n  }\n\n  const timeStamp = getTimestamp();\n\n  if (monitor._needsQuietPeriod) {\n    monitor._needsQuietPeriod = false;\n    monitor._frameTimes.length = 0;\n    monitor._quietPeriodEndTime =\n      timeStamp + monitor.quietPeriod / TimeConstants.SECONDS_PER_MILLISECOND;\n    monitor._warmupPeriodEndTime =\n      monitor._quietPeriodEndTime +\n      (monitor.warmupPeriod + monitor.samplingWindow) /\n        TimeConstants.SECONDS_PER_MILLISECOND;\n  } else if (timeStamp >= monitor._quietPeriodEndTime) {\n    monitor._frameTimes.push(timeStamp);\n\n    const beginningOfWindow =\n      timeStamp -\n      monitor.samplingWindow / TimeConstants.SECONDS_PER_MILLISECOND;\n\n    if (\n      monitor._frameTimes.length >= 2 &&\n      monitor._frameTimes[0] <= beginningOfWindow\n    ) {\n      while (\n        monitor._frameTimes.length >= 2 &&\n        monitor._frameTimes[1] < beginningOfWindow\n      ) {\n        monitor._frameTimes.shift();\n      }\n\n      const averageTimeBetweenFrames =\n        (timeStamp - monitor._frameTimes[0]) / (monitor._frameTimes.length - 1);\n\n      monitor._lastFramesPerSecond = 1000.0 / averageTimeBetweenFrames;\n\n      const maximumFrameTime =\n        1000.0 /\n        (timeStamp > monitor._warmupPeriodEndTime\n          ? monitor.minimumFrameRateAfterWarmup\n          : monitor.minimumFrameRateDuringWarmup);\n      if (averageTimeBetweenFrames > maximumFrameTime) {\n        if (!monitor._frameRateIsLow) {\n          monitor._frameRateIsLow = true;\n          monitor._needsQuietPeriod = true;\n          monitor.lowFrameRate.raiseEvent(\n            monitor.scene,\n            monitor._lastFramesPerSecond\n          );\n        }\n      } else if (monitor._frameRateIsLow) {\n        monitor._frameRateIsLow = false;\n        monitor._needsQuietPeriod = true;\n        monitor.nominalFrameRate.raiseEvent(\n          monitor.scene,\n          monitor._lastFramesPerSecond\n        );\n      }\n    }\n  }\n}\n\nfunction visibilityChanged(monitor) {\n  if (document[monitor._hiddenPropertyName]) {\n    monitor.pause();\n  } else {\n    monitor.unpause();\n  }\n}\nexport default FrameRateMonitor;\n", "import Check from \"../Core/Check.js\";\nimport Credit from \"../Core/Credit.js\";\nimport decodeGoogleEarthEnterpriseData from \"../Core/decodeGoogleEarthEnterpriseData.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\nimport GoogleEarthEnterpriseMetadata from \"../Core/GoogleEarthEnterpriseMetadata.js\";\nimport loadImageFromTypedArray from \"../Core/loadImageFromTypedArray.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Request from \"../Core/Request.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport * as protobuf from \"protobufjs/dist/minimal/protobuf.js\";\n\n/**\n * @private\n */\nfunction GoogleEarthEnterpriseDiscardPolicy() {\n  this._image = new Image();\n}\n\n/**\n * Determines if the discard policy is ready to process images.\n * @returns {boolean} True if the discard policy is ready to process images; otherwise, false.\n */\nGoogleEarthEnterpriseDiscardPolicy.prototype.isReady = function () {\n  return true;\n};\n\n/**\n * Given a tile image, decide whether to discard that image.\n *\n * @param {HTMLImageElement} image An image to test.\n * @returns {boolean} True if the image should be discarded; otherwise, false.\n */\nGoogleEarthEnterpriseDiscardPolicy.prototype.shouldDiscardImage = function (\n  image\n) {\n  return image === this._image;\n};\n\n/**\n * @typedef {object} GoogleEarthEnterpriseImageryProvider.ConstructorOptions\n *\n * Initialization options for the GoogleEarthEnterpriseImageryProvider constructor\n *\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If not specified, the WGS84 ellipsoid is used.\n * @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile\n *        is invalid and should be discarded. If this value is not specified, a default\n *        is to discard tiles that fail to download.\n * @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.\n */\n\n/**\n * <div class=\"notice\">\n * To construct a GoogleEarthEnterpriseImageryProvider, call {@link GoogleEarthEnterpriseImageryProvider.fromMetadata}. Do not call the constructor directly.\n * </div>\n *\n * Provides tiled imagery using the Google Earth Enterprise REST API.\n *\n * Notes: This provider is for use with the 3D Earth API of Google Earth Enterprise,\n *        {@link GoogleEarthEnterpriseMapsProvider} should be used with 2D Maps API.\n *\n * @alias GoogleEarthEnterpriseImageryProvider\n * @constructor\n *\n * @param {GoogleEarthEnterpriseImageryProvider.ConstructorOptions} [options] Object describing initialization options\n *\n * @see GoogleEarthEnterpriseImageryProvider.fromMetadata\n * @see GoogleEarthEnterpriseTerrainProvider\n * @see ArcGisMapServerImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see OpenStreetMapImageryProvider\n * @see SingleTileImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n * @see UrlTemplateImageryProvider\n *\n *\n * @example\n * const geeMetadata = await GoogleEarthEnterpriseMetadata.fromUrl(\"http://www.example.com\");\n * const gee = Cesium.GoogleEarthEnterpriseImageryProvider.fromMetadata(geeMetadata);\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n */\nfunction GoogleEarthEnterpriseImageryProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  this._defaultAlpha = undefined;\n  this._defaultNightAlpha = undefined;\n  this._defaultDayAlpha = undefined;\n  this._defaultBrightness = undefined;\n  this._defaultContrast = undefined;\n  this._defaultHue = undefined;\n  this._defaultSaturation = undefined;\n  this._defaultGamma = undefined;\n  this._defaultMinificationFilter = undefined;\n  this._defaultMagnificationFilter = undefined;\n\n  this._tileDiscardPolicy = options.tileDiscardPolicy;\n\n  this._tilingScheme = new GeographicTilingScheme({\n    numberOfLevelZeroTilesX: 2,\n    numberOfLevelZeroTilesY: 2,\n    rectangle: new Rectangle(\n      -CesiumMath.PI,\n      -CesiumMath.PI,\n      CesiumMath.PI,\n      CesiumMath.PI\n    ),\n    ellipsoid: options.ellipsoid,\n  });\n\n  let credit = options.credit;\n  if (typeof credit === \"string\") {\n    credit = new Credit(credit);\n  }\n  this._credit = credit;\n\n  this._tileWidth = 256;\n  this._tileHeight = 256;\n  this._maximumLevel = 23;\n\n  // Install the default tile discard policy if none has been supplied.\n  if (!defined(this._tileDiscardPolicy)) {\n    this._tileDiscardPolicy = new GoogleEarthEnterpriseDiscardPolicy();\n  }\n\n  this._errorEvent = new Event();\n}\n\nObject.defineProperties(GoogleEarthEnterpriseImageryProvider.prototype, {\n  /**\n   * Gets the name of the Google Earth Enterprise server url hosting the imagery.\n   * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return this._metadata.url;\n    },\n  },\n\n  /**\n   * Gets the proxy used by this provider.\n   * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n   * @type {Proxy}\n   * @readonly\n   */\n  proxy: {\n    get: function () {\n      return this._metadata.proxy;\n    },\n  },\n\n  /**\n   * Gets the width of each tile, in pixels.\n   * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileWidth: {\n    get: function () {\n      return this._tileWidth;\n    },\n  },\n\n  /**\n   * Gets the height of each tile, in pixels.\n   * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileHeight: {\n    get: function () {\n      return this._tileHeight;\n    },\n  },\n\n  /**\n   * Gets the maximum level-of-detail that can be requested.\n   * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n   * @type {number|undefined}\n   * @readonly\n   */\n  maximumLevel: {\n    get: function () {\n      return this._maximumLevel;\n    },\n  },\n\n  /**\n   * Gets the minimum level-of-detail that can be requested.\n   * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  minimumLevel: {\n    get: function () {\n      return 0;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets the rectangle, in radians, of the imagery provided by this instance.\n   * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n   * @type {Rectangle}\n   * @readonly\n   */\n  rectangle: {\n    get: function () {\n      return this._tilingScheme.rectangle;\n    },\n  },\n\n  /**\n   * Gets the tile discard policy.  If not undefined, the discard policy is responsible\n   * for filtering out \"missing\" tiles via its shouldDiscardImage function.  If this function\n   * returns undefined, no tiles are filtered.\n   * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n   * @type {TileDiscardPolicy}\n   * @readonly\n   */\n  tileDiscardPolicy: {\n    get: function () {\n      return this._tileDiscardPolicy;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this imagery provider is active.  Typically this is used to credit\n   * the source of the imagery.\n   * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._credit;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the images provided by this imagery provider\n   * include an alpha channel.  If this property is false, an alpha channel, if present, will\n   * be ignored.  If this property is true, any images without an alpha channel will be treated\n   * as if their alpha is 1.0 everywhere.  Setting this property to false reduces memory usage\n   * and texture upload time.\n   * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasAlphaChannel: {\n    get: function () {\n      return false;\n    },\n  },\n});\n\n/**\n * Creates a tiled imagery provider using the Google Earth Enterprise REST API.\n * @param {GoogleEarthEnterpriseMetadata} metadata A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseTerrainProvider.\n * @param {GoogleEarthEnterpriseImageryProvider.ConstructorOptions} options Object describing initialization options.\n * @returns {GoogleEarthEnterpriseImageryProvider}\n *\n * @exception {RuntimeError} The metadata url does not have imagery\n *\n * @example\n * const geeMetadata = await GoogleEarthEnterpriseMetadata.fromUrl(\"http://www.example.com\");\n * const gee = Cesium.GoogleEarthEnterpriseImageryProvider.fromMetadata(geeMetadata);\n */\nGoogleEarthEnterpriseImageryProvider.fromMetadata = function (\n  metadata,\n  options\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"metadata\", metadata);\n  //>>includeEnd('debug');\n\n  if (!metadata.imageryPresent) {\n    throw new RuntimeError(`The server ${metadata.url} doesn't have imagery`);\n  }\n\n  const provider = new GoogleEarthEnterpriseImageryProvider(options);\n  provider._metadata = metadata;\n  return provider;\n};\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n */\nGoogleEarthEnterpriseImageryProvider.prototype.getTileCredits = function (\n  x,\n  y,\n  level\n) {\n  const metadata = this._metadata;\n  const info = metadata.getTileInformation(x, y, level);\n  if (defined(info)) {\n    const credit = metadata.providers[info.imageryProvider];\n    if (defined(credit)) {\n      return [credit];\n    }\n  }\n\n  return undefined;\n};\n\n/**\n * Requests the image for a given tile.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n *          undefined if there are too many active requests to the server, and the request should be retried later.\n */\nGoogleEarthEnterpriseImageryProvider.prototype.requestImage = function (\n  x,\n  y,\n  level,\n  request\n) {\n  const invalidImage = this._tileDiscardPolicy._image; // Empty image or undefined depending on discard policy\n  const metadata = this._metadata;\n  const quadKey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);\n  const info = metadata.getTileInformation(x, y, level);\n  if (!defined(info)) {\n    if (metadata.isValid(quadKey)) {\n      const metadataRequest = new Request({\n        throttle: request.throttle,\n        throttleByServer: request.throttleByServer,\n        type: request.type,\n        priorityFunction: request.priorityFunction,\n      });\n      metadata.populateSubtree(x, y, level, metadataRequest);\n      return undefined; // No metadata so return undefined so we can be loaded later\n    }\n    return Promise.resolve(invalidImage); // Image doesn't exist\n  }\n\n  if (!info.hasImagery()) {\n    // Already have info and there isn't any imagery here\n    return Promise.resolve(invalidImage);\n  }\n  const promise = buildImageResource(\n    this,\n    info,\n    x,\n    y,\n    level,\n    request\n  ).fetchArrayBuffer();\n  if (!defined(promise)) {\n    return undefined; // Throttled\n  }\n\n  return promise.then(function (image) {\n    decodeGoogleEarthEnterpriseData(metadata.key, image);\n    let a = new Uint8Array(image);\n    let type;\n\n    const protoImagery = metadata.protoImagery;\n    if (!defined(protoImagery) || !protoImagery) {\n      type = getImageType(a);\n    }\n\n    if (!defined(type) && (!defined(protoImagery) || protoImagery)) {\n      const message = decodeEarthImageryPacket(a);\n      type = message.imageType;\n      a = message.imageData;\n    }\n\n    if (!defined(type) || !defined(a)) {\n      return invalidImage;\n    }\n\n    return loadImageFromTypedArray({\n      uint8Array: a,\n      format: type,\n      flipY: true,\n    });\n  });\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {number} longitude The longitude at which to pick features.\n * @param {number} latitude  The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nGoogleEarthEnterpriseImageryProvider.prototype.pickFeatures = function (\n  x,\n  y,\n  level,\n  longitude,\n  latitude\n) {\n  return undefined;\n};\n\n//\n// Functions to handle imagery packets\n//\nfunction buildImageResource(imageryProvider, info, x, y, level, request) {\n  const quadKey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);\n  let version = info.imageryVersion;\n  version = defined(version) && version > 0 ? version : 1;\n\n  return imageryProvider._metadata.resource.getDerivedResource({\n    url: `flatfile?f1-0${quadKey}-i.${version.toString()}`,\n    request: request,\n  });\n}\n\n// Detects if a Uint8Array is a JPEG or PNG\nfunction getImageType(image) {\n  const jpeg = \"JFIF\";\n  if (\n    image[6] === jpeg.charCodeAt(0) &&\n    image[7] === jpeg.charCodeAt(1) &&\n    image[8] === jpeg.charCodeAt(2) &&\n    image[9] === jpeg.charCodeAt(3)\n  ) {\n    return \"image/jpeg\";\n  }\n\n  const png = \"PNG\";\n  if (\n    image[1] === png.charCodeAt(0) &&\n    image[2] === png.charCodeAt(1) &&\n    image[3] === png.charCodeAt(2)\n  ) {\n    return \"image/png\";\n  }\n\n  return undefined;\n}\n\n// Decodes an Imagery protobuf into the message\n// Partially generated with the help of protobuf.js static generator\nfunction decodeEarthImageryPacket(data) {\n  const reader = protobuf.Reader.create(data);\n  const end = reader.len;\n  const message = {};\n  while (reader.pos < end) {\n    const tag = reader.uint32();\n    let copyrightIds;\n    switch (tag >>> 3) {\n      case 1:\n        message.imageType = reader.uint32();\n        break;\n      case 2:\n        message.imageData = reader.bytes();\n        break;\n      case 3:\n        message.alphaType = reader.uint32();\n        break;\n      case 4:\n        message.imageAlpha = reader.bytes();\n        break;\n      case 5:\n        copyrightIds = message.copyrightIds;\n        if (!defined(copyrightIds)) {\n          copyrightIds = message.copyrightIds = [];\n        }\n        if ((tag & 7) === 2) {\n          const end2 = reader.uint32() + reader.pos;\n          while (reader.pos < end2) {\n            copyrightIds.push(reader.uint32());\n          }\n        } else {\n          copyrightIds.push(reader.uint32());\n        }\n        break;\n      default:\n        reader.skipType(tag & 7);\n        break;\n    }\n  }\n\n  const imageType = message.imageType;\n  if (defined(imageType)) {\n    switch (imageType) {\n      case 0:\n        message.imageType = \"image/jpeg\";\n        break;\n      case 4:\n        message.imageType = \"image/png\";\n        break;\n      default:\n        throw new RuntimeError(\n          \"GoogleEarthEnterpriseImageryProvider: Unsupported image type.\"\n        );\n    }\n  }\n\n  const alphaType = message.alphaType;\n  if (defined(alphaType) && alphaType !== 0) {\n    console.log(\n      \"GoogleEarthEnterpriseImageryProvider: External alpha not supported.\"\n    );\n    delete message.alphaType;\n    delete message.imageAlpha;\n  }\n\n  return message;\n}\nexport default GoogleEarthEnterpriseImageryProvider;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\n\nconst defaultColor = new Color(1.0, 1.0, 1.0, 0.4);\nconst defaultGlowColor = new Color(0.0, 1.0, 0.0, 0.05);\nconst defaultBackgroundColor = new Color(0.0, 0.5, 0.0, 0.2);\n\n/**\n * @typedef {object} GridImageryProvider.ConstructorOptions\n *\n * Initialization options for the GridImageryProvider constructor\n *\n * @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If the tilingScheme is specified,\n *                    this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n *                    parameter is specified, the WGS84 ellipsoid is used.\n * @property {number} [cells=8] The number of grids cells.\n * @property {Color} [color=Color(1.0, 1.0, 1.0, 0.4)] The color to draw grid lines.\n * @property {Color} [glowColor=Color(0.0, 1.0, 0.0, 0.05)] The color to draw glow for grid lines.\n * @property {number} [glowWidth=6] The width of lines used for rendering the line glow effect.\n * @property {Color} [backgroundColor=Color(0.0, 0.5, 0.0, 0.2)] Background fill color.\n * @property {number} [tileWidth=256] The width of the tile for level-of-detail selection purposes.\n * @property {number} [tileHeight=256] The height of the tile for level-of-detail selection purposes.\n * @property {number} [canvasSize=256] The size of the canvas used for rendering.\n */\n\n/**\n * An {@link ImageryProvider} that draws a wireframe grid on every tile with controllable background and glow.\n * May be useful for custom rendering effects or debugging terrain.\n *\n * @alias GridImageryProvider\n * @constructor\n * @param {GridImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n */\nfunction GridImageryProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._defaultAlpha = undefined;\n  this._defaultNightAlpha = undefined;\n  this._defaultDayAlpha = undefined;\n  this._defaultBrightness = undefined;\n  this._defaultContrast = undefined;\n  this._defaultHue = undefined;\n  this._defaultSaturation = undefined;\n  this._defaultGamma = undefined;\n  this._defaultMinificationFilter = undefined;\n  this._defaultMagnificationFilter = undefined;\n\n  this._tilingScheme = defined(options.tilingScheme)\n    ? options.tilingScheme\n    : new GeographicTilingScheme({ ellipsoid: options.ellipsoid });\n  this._cells = defaultValue(options.cells, 8);\n  this._color = defaultValue(options.color, defaultColor);\n  this._glowColor = defaultValue(options.glowColor, defaultGlowColor);\n  this._glowWidth = defaultValue(options.glowWidth, 6);\n  this._backgroundColor = defaultValue(\n    options.backgroundColor,\n    defaultBackgroundColor\n  );\n  this._errorEvent = new Event();\n\n  this._tileWidth = defaultValue(options.tileWidth, 256);\n  this._tileHeight = defaultValue(options.tileHeight, 256);\n\n  // A little larger than tile size so lines are sharper\n  // Note: can't be too much difference otherwise texture blowout\n  this._canvasSize = defaultValue(options.canvasSize, 256);\n\n  // We only need a single canvas since all tiles will be the same\n  this._canvas = this._createGridCanvas();\n}\n\nObject.defineProperties(GridImageryProvider.prototype, {\n  /**\n   * Gets the proxy used by this provider.\n   * @memberof GridImageryProvider.prototype\n   * @type {Proxy}\n   * @readonly\n   */\n  proxy: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Gets the width of each tile, in pixels.\n   * @memberof GridImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileWidth: {\n    get: function () {\n      return this._tileWidth;\n    },\n  },\n\n  /**\n   * Gets the height of each tile, in pixels.\n   * @memberof GridImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileHeight: {\n    get: function () {\n      return this._tileHeight;\n    },\n  },\n\n  /**\n   * Gets the maximum level-of-detail that can be requested.\n   * @memberof GridImageryProvider.prototype\n   * @type {number|undefined}\n   * @readonly\n   */\n  maximumLevel: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Gets the minimum level-of-detail that can be requested.\n   * @memberof GridImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  minimumLevel: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof GridImageryProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets the rectangle, in radians, of the imagery provided by this instance.\n   * @memberof GridImageryProvider.prototype\n   * @type {Rectangle}\n   * @readonly\n   */\n  rectangle: {\n    get: function () {\n      return this._tilingScheme.rectangle;\n    },\n  },\n\n  /**\n   * Gets the tile discard policy.  If not undefined, the discard policy is responsible\n   * for filtering out \"missing\" tiles via its shouldDiscardImage function.  If this function\n   * returns undefined, no tiles are filtered.\n   * @memberof GridImageryProvider.prototype\n   * @type {TileDiscardPolicy}\n   * @readonly\n   */\n  tileDiscardPolicy: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof GridImageryProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this imagery provider is active.  Typically this is used to credit\n   * the source of the imagery.\n   * @memberof GridImageryProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the images provided by this imagery provider\n   * include an alpha channel.  If this property is false, an alpha channel, if present, will\n   * be ignored.  If this property is true, any images without an alpha channel will be treated\n   * as if their alpha is 1.0 everywhere.  When this property is false, memory usage\n   * and texture upload time are reduced.\n   * @memberof GridImageryProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasAlphaChannel: {\n    get: function () {\n      return true;\n    },\n  },\n});\n\n/**\n * Draws a grid of lines into a canvas.\n */\nGridImageryProvider.prototype._drawGrid = function (context) {\n  const minPixel = 0;\n  const maxPixel = this._canvasSize;\n  for (let x = 0; x <= this._cells; ++x) {\n    const nx = x / this._cells;\n    const val = 1 + nx * (maxPixel - 1);\n\n    context.moveTo(val, minPixel);\n    context.lineTo(val, maxPixel);\n    context.moveTo(minPixel, val);\n    context.lineTo(maxPixel, val);\n  }\n  context.stroke();\n};\n\n/**\n * Render a grid into a canvas with background and glow\n */\nGridImageryProvider.prototype._createGridCanvas = function () {\n  const canvas = document.createElement(\"canvas\");\n  canvas.width = this._canvasSize;\n  canvas.height = this._canvasSize;\n  const minPixel = 0;\n  const maxPixel = this._canvasSize;\n\n  const context = canvas.getContext(\"2d\");\n\n  // Fill the background\n  const cssBackgroundColor = this._backgroundColor.toCssColorString();\n  context.fillStyle = cssBackgroundColor;\n  context.fillRect(minPixel, minPixel, maxPixel, maxPixel);\n\n  // Glow for grid lines\n  const cssGlowColor = this._glowColor.toCssColorString();\n  context.strokeStyle = cssGlowColor;\n  // Wide\n  context.lineWidth = this._glowWidth;\n  context.strokeRect(minPixel, minPixel, maxPixel, maxPixel);\n  this._drawGrid(context);\n  // Narrow\n  context.lineWidth = this._glowWidth * 0.5;\n  context.strokeRect(minPixel, minPixel, maxPixel, maxPixel);\n  this._drawGrid(context);\n\n  // Grid lines\n  const cssColor = this._color.toCssColorString();\n  // Border\n  context.strokeStyle = cssColor;\n  context.lineWidth = 2;\n  context.strokeRect(minPixel, minPixel, maxPixel, maxPixel);\n  // Inner\n  context.lineWidth = 1;\n  this._drawGrid(context);\n\n  return canvas;\n};\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n */\nGridImageryProvider.prototype.getTileCredits = function (x, y, level) {\n  return undefined;\n};\n\n/**\n * Requests the image for a given tile.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<HTMLCanvasElement>} The resolved image as a Canvas DOM object.\n */\nGridImageryProvider.prototype.requestImage = function (x, y, level, request) {\n  return Promise.resolve(this._canvas);\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {number} longitude The longitude at which to pick features.\n * @param {number} latitude  The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nGridImageryProvider.prototype.pickFeatures = function (\n  x,\n  y,\n  level,\n  longitude,\n  latitude\n) {\n  return undefined;\n};\nexport default GridImageryProvider;\n", "import Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\n\n/**\n * Decode I3S using web workers.\n *\n * @private\n */\nfunction I3SDecoder() {}\n\n// Maximum concurrency to use when decoding draco models\nI3SDecoder._maxDecodingConcurrency = Math.max(\n  FeatureDetection.hardwareConcurrency - 1,\n  1\n);\n\nI3SDecoder._decodeTaskProcessor = new TaskProcessor(\n  \"decodeI3S\",\n  I3SDecoder._maxDecodingConcurrency\n);\n\nI3SDecoder._promise = undefined;\n\nasync function initializeDecoder() {\n  const result = await I3SDecoder._decodeTaskProcessor.initWebAssemblyModule({\n    wasmBinaryFile: \"ThirdParty/draco_decoder.wasm\",\n  });\n  if (result) {\n    return I3SDecoder._decodeTaskProcessor;\n  }\n\n  throw new RuntimeError(\"I3S decoder could not be initialized.\");\n}\n\n/**\n * Transcodes I3S to glTF in a web worker\n * @param {String} url custom attributes source URL\n * @param {Object} defaultGeometrySchema Schema to use during decoding\n * @param {I3SGeometry} geometryData The draco encoded geometry data\n * @param {Array} [featureData] The draco encoded feature data\n * @returns Promise<undefined|object> Returns a promise which resolves to the glTF result, or undefined if the task cannot be scheduled this frame.\n *\n * @exception {RuntimeError} I3S decoder could not be initialized.\n */\nI3SDecoder.decode = async function (\n  url,\n  defaultGeometrySchema,\n  geometryData,\n  featureData\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"url\", url);\n  Check.defined(\"defaultGeometrySchema\", defaultGeometrySchema);\n  Check.defined(\"geometryData\", geometryData);\n  //>>includeEnd('debug');\n\n  if (!defined(I3SDecoder._promise)) {\n    I3SDecoder._promise = initializeDecoder();\n  }\n\n  return I3SDecoder._promise.then(function (taskProcessor) {\n    // Prepare the data to send to the worker\n    const parentData = geometryData._parent._data;\n    const parentRotationInverseMatrix =\n      geometryData._parent._inverseRotationMatrix;\n\n    let longitude = 0.0;\n    let latitude = 0.0;\n    let height = 0.0;\n\n    if (defined(parentData.obb)) {\n      longitude = parentData.obb.center[0];\n      latitude = parentData.obb.center[1];\n      height = parentData.obb.center[2];\n    } else if (defined(parentData.mbs)) {\n      longitude = parentData.mbs[0];\n      latitude = parentData.mbs[1];\n      height = parentData.mbs[2];\n    }\n\n    const axisFlipRotation = Matrix3.fromRotationX(-CesiumMath.PI_OVER_TWO);\n    const parentRotation = new Matrix3();\n\n    Matrix3.multiply(\n      axisFlipRotation,\n      parentRotationInverseMatrix,\n      parentRotation\n    );\n\n    const cartographicCenter = Cartographic.fromDegrees(\n      longitude,\n      latitude,\n      height\n    );\n\n    const cartesianCenter = Ellipsoid.WGS84.cartographicToCartesian(\n      cartographicCenter\n    );\n\n    const payload = {\n      binaryData: geometryData._data,\n      featureData:\n        defined(featureData) && defined(featureData[0])\n          ? featureData[0].data\n          : undefined,\n      schema: defaultGeometrySchema,\n      bufferInfo: geometryData._geometryBufferInfo,\n      ellipsoidRadiiSquare: Ellipsoid.WGS84.radiiSquared,\n      url: url,\n      geoidDataList: geometryData._dataProvider._geoidDataList,\n      cartographicCenter: cartographicCenter,\n      cartesianCenter: cartesianCenter,\n      parentRotation: parentRotation,\n    };\n\n    return taskProcessor.scheduleTask(payload);\n  });\n};\n\nexport default I3SDecoder;\n", "import defined from \"../Core/defined.js\";\nimport I3SDataProvider from \"./I3SDataProvider.js\";\n\n/**\n * This class implements an I3S Feature.\n * <p>\n * Do not construct this directly, instead access tiles through {@link I3SNode}.\n * </p>\n * @alias I3SFeature\n * @internalConstructor\n */\nfunction I3SFeature(parent, uri) {\n  this._parent = parent;\n  this._dataProvider = parent._dataProvider;\n  this._layer = parent._layer;\n\n  if (defined(this._parent._nodeIndex)) {\n    this._resource = this._parent._layer.resource.getDerivedResource({\n      url: `nodes/${this._parent._data.mesh.attribute.resource}/${uri}`,\n    });\n  } else {\n    this._resource = this._parent.resource.getDerivedResource({ url: uri });\n  }\n}\n\nObject.defineProperties(I3SFeature.prototype, {\n  /**\n   * Gets the resource for the feature\n   * @memberof I3SFeature.prototype\n   * @type {Resource}\n   * @readonly\n   */\n  resource: {\n    get: function () {\n      return this._resource;\n    },\n  },\n  /**\n   * Gets the I3S data for this object.\n   * @memberof I3SFeature.prototype\n   * @type {object}\n   * @readonly\n   */\n  data: {\n    get: function () {\n      return this._data;\n    },\n  },\n});\n\n/**\n * Loads the content.\n * @returns {Promise} A promise that is resolved when the data of the I3S feature is loaded\n * @private\n */\nI3SFeature.prototype.load = async function () {\n  this._data = await I3SDataProvider.loadJson(\n    this._resource,\n    this._dataProvider._traceFetches\n  );\n  return this._data;\n};\n\nexport default I3SFeature;\n", "import defined from \"../Core/defined.js\";\n\n/**\n * This class implements an I3S Field which is custom data attached\n * to nodes\n * @alias I3SField\n * @internalConstructor\n * @privateParam {I3SNode} parent The parent of that geometry\n * @privateParam {object} storageInfo The structure containing the storage info of the field\n */\nfunction I3SField(parent, storageInfo) {\n  this._storageInfo = storageInfo;\n  this._parent = parent;\n  this._dataProvider = parent._dataProvider;\n  const uri = `attributes/${storageInfo.key}/0`;\n\n  if (defined(this._parent._nodeIndex)) {\n    this._resource = this._parent._layer.resource.getDerivedResource({\n      url: `nodes/${this._parent._data.mesh.attribute.resource}/${uri}`,\n    });\n  } else {\n    this._resource = this._parent.resource.getDerivedResource({ url: uri });\n  }\n}\n\nObject.defineProperties(I3SField.prototype, {\n  /**\n   * Gets the resource for the fields\n   * @memberof I3SField.prototype\n   * @type {Resource}\n   * @readonly\n   */\n  resource: {\n    get: function () {\n      return this._resource;\n    },\n  },\n  /**\n   * Gets the header for this field.\n   * @memberof I3SField.prototype\n   * @type {object}\n   * @readonly\n   */\n  header: {\n    get: function () {\n      return this._header;\n    },\n  },\n  /**\n   * Gets the values for this field.\n   * @memberof I3SField.prototype\n   * @type {object}\n   * @readonly\n   */\n  values: {\n    get: function () {\n      return defined(this._values) && defined(this._values.attributeValues)\n        ? this._values.attributeValues\n        : [];\n    },\n  },\n  /**\n   * Gets the name for the field.\n   * @memberof I3SField.prototype\n   * @type {string}\n   * @readonly\n   */\n  name: {\n    get: function () {\n      return this._storageInfo.name;\n    },\n  },\n});\n\nfunction getNumericTypeSize(type) {\n  if (type === \"UInt8\" || type === \"Int8\") {\n    return 1;\n  } else if (type === \"UInt16\" || type === \"Int16\") {\n    return 2;\n  } else if (\n    type === \"UInt32\" ||\n    type === \"Int32\" ||\n    type === \"Oid32\" ||\n    type === \"Float32\"\n  ) {\n    return 4;\n  } else if (type === \"UInt64\" || type === \"Int64\" || type === \"Float64\") {\n    return 8;\n  }\n\n  // Not a numeric type\n  return 0;\n}\n\n/**\n * Loads the content.\n * @returns {Promise<void>} A promise that is resolved when the field data is loaded\n */\nI3SField.prototype.load = function () {\n  const that = this;\n  return this._dataProvider._loadBinary(this._resource).then(function (data) {\n    // Check if we have a 404\n    const dataView = new DataView(data);\n    let success = true;\n    if (dataView.getUint8(0) === \"{\".charCodeAt(0)) {\n      const textContent = new TextDecoder();\n      const str = textContent.decode(data);\n      if (str.includes(\"404\")) {\n        success = false;\n        console.error(`Failed to load: ${that.resource.url}`);\n      }\n    }\n\n    if (success) {\n      that._data = data;\n      let offset = that._parseHeader(dataView);\n\n      const valueSize = getNumericTypeSize(\n        that._storageInfo.attributeValues.valueType\n      );\n      if (valueSize > 0) {\n        // Values will be padded to align the addresses with the data size\n        offset = Math.ceil(offset / valueSize) * valueSize;\n      }\n\n      that._parseBody(dataView, offset);\n    }\n  });\n};\n\n/**\n * @private\n */\nI3SField.prototype._parseValue = function (dataView, type, offset) {\n  let value;\n  if (type === \"UInt8\") {\n    value = dataView.getUint8(offset);\n    offset += 1;\n  } else if (type === \"Int8\") {\n    value = dataView.getInt8(offset);\n    offset += 1;\n  } else if (type === \"UInt16\") {\n    value = dataView.getUint16(offset, true);\n    offset += 2;\n  } else if (type === \"Int16\") {\n    value = dataView.getInt16(offset, true);\n    offset += 2;\n  } else if (type === \"UInt32\") {\n    value = dataView.getUint32(offset, true);\n    offset += 4;\n  } else if (type === \"Oid32\") {\n    value = dataView.getUint32(offset, true);\n    offset += 4;\n  } else if (type === \"Int32\") {\n    value = dataView.getInt32(offset, true);\n    offset += 4;\n  } else if (type === \"UInt64\") {\n    const left = dataView.getUint32(offset, true);\n    const right = dataView.getUint32(offset + 4, true);\n    value = left + Math.pow(2, 32) * right;\n    offset += 8;\n  } else if (type === \"Int64\") {\n    const left = dataView.getUint32(offset, true);\n    const right = dataView.getUint32(offset + 4, true);\n    if (right < Math.pow(2, 31)) {\n      // Positive number\n      value = left + Math.pow(2, 32) * right;\n    } else {\n      // Negative\n      value = left + Math.pow(2, 32) * (right - Math.pow(2, 32));\n    }\n\n    offset += 8;\n  } else if (type === \"Float32\") {\n    value = dataView.getFloat32(offset, true);\n    offset += 4;\n  } else if (type === \"Float64\") {\n    value = dataView.getFloat64(offset, true);\n    offset += 8;\n  } else if (type === \"String\") {\n    value = String.fromCharCode(dataView.getUint8(offset));\n    offset += 1;\n  }\n\n  return {\n    value: value,\n    offset: offset,\n  };\n};\n\n/**\n * @private\n */\nI3SField.prototype._parseHeader = function (dataView) {\n  let offset = 0;\n  this._header = {};\n  for (\n    let itemIndex = 0;\n    itemIndex < this._storageInfo.header.length;\n    itemIndex++\n  ) {\n    const item = this._storageInfo.header[itemIndex];\n    const parsedValue = this._parseValue(dataView, item.valueType, offset);\n    this._header[item.property] = parsedValue.value;\n    offset = parsedValue.offset;\n  }\n  return offset;\n};\n\n/**\n * @private\n */\nI3SField.prototype._parseBody = function (dataView, offset) {\n  this._values = {};\n  for (\n    let itemIndex = 0;\n    itemIndex < this._storageInfo.ordering.length;\n    itemIndex++\n  ) {\n    const item = this._storageInfo.ordering[itemIndex];\n    const desc = this._storageInfo[item];\n    if (defined(desc)) {\n      this._values[item] = [];\n      for (let index = 0; index < this._header.count; ++index) {\n        if (desc.valueType !== \"String\") {\n          const parsedValue = this._parseValue(\n            dataView,\n            desc.valueType,\n            offset\n          );\n          this._values[item].push(parsedValue.value);\n          offset = parsedValue.offset;\n        } else {\n          const stringLen = this._values.attributeByteCounts[index];\n          let stringContent = \"\";\n          for (let cIndex = 0; cIndex < stringLen; ++cIndex) {\n            const curParsedValue = this._parseValue(\n              dataView,\n              desc.valueType,\n              offset\n            );\n            if (curParsedValue.value.charCodeAt(0) !== 0) {\n              stringContent += curParsedValue.value;\n            }\n            offset = curParsedValue.offset;\n          }\n          // We skip the last character of the string since it's a null terminator\n          this._values[item].push(stringContent);\n        }\n      }\n    }\n  }\n};\n\nexport default I3SField;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defined from \"../Core/defined.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\n\n/**\n * This class implements an I3S Geometry. Each I3SGeometry\n * generates an in memory glTF to be used as content for a Cesium3DTile\n * <p>\n * Do not construct this directly, instead access tiles through {@link I3SNode}.\n * </p>\n * @alias I3SGeometry\n * @internalConstructor\n * @privateParam {I3SNode} parent The parent of that geometry\n * @privateParam {string} uri The uri to load the data from\n */\nfunction I3SGeometry(parent, uri) {\n  const dataProvider = parent._dataProvider;\n  const layer = parent._layer;\n\n  let resource;\n\n  if (defined(parent._nodeIndex)) {\n    resource = layer.resource.getDerivedResource({\n      url: `nodes/${parent._data.mesh.geometry.resource}/${uri}`,\n    });\n  } else {\n    resource = parent.resource.getDerivedResource({ url: uri });\n  }\n\n  this._parent = parent;\n  this._dataProvider = dataProvider;\n  this._layer = layer;\n  this._resource = resource;\n\n  this._customAttributes = undefined;\n}\n\nObject.defineProperties(I3SGeometry.prototype, {\n  /**\n   * Gets the resource for the geometry\n   * @memberof I3SGeometry.prototype\n   * @type {Resource}\n   * @readonly\n   */\n  resource: {\n    get: function () {\n      return this._resource;\n    },\n  },\n\n  /**\n   * Gets the I3S data for this object.\n   * @memberof I3SGeometry.prototype\n   * @type {object}\n   * @readonly\n   */\n  data: {\n    get: function () {\n      return this._data;\n    },\n  },\n  /**\n   * Gets the custom attributes of the geometry.\n   * @memberof I3SGeometry.prototype\n   * @type {object}\n   * @readonly\n   */\n  customAttributes: {\n    get: function () {\n      return this._customAttributes;\n    },\n  },\n});\n\n/**\n * Loads the content.\n * @returns {Promise<object>} A promise that is resolved when the geometry data is loaded\n * @private\n */\nI3SGeometry.prototype.load = function () {\n  const that = this;\n  return this._dataProvider._loadBinary(this._resource).then(function (data) {\n    that._data = data;\n    return data;\n  });\n};\n\nconst scratchAb = new Cartesian3();\nconst scratchAp1 = new Cartesian3();\nconst scratchAp2 = new Cartesian3();\nconst scratchCp1 = new Cartesian3();\nconst scratchCp2 = new Cartesian3();\n\nfunction sameSide(p1, p2, a, b) {\n  const ab = Cartesian3.subtract(b, a, scratchAb);\n  const cp1 = Cartesian3.cross(\n    ab,\n    Cartesian3.subtract(p1, a, scratchAp1),\n    scratchCp1\n  );\n  const cp2 = Cartesian3.cross(\n    ab,\n    Cartesian3.subtract(p2, a, scratchAp2),\n    scratchCp2\n  );\n  return Cartesian3.dot(cp1, cp2) >= 0;\n}\n\nconst scratchV0 = new Cartesian3();\nconst scratchV1 = new Cartesian3();\nconst scratchV2 = new Cartesian3();\n\nconst scratchV0V1 = new Cartesian3();\nconst scratchV0V2 = new Cartesian3();\nconst scratchCrossProd = new Cartesian3();\nconst scratchNormal = new Cartesian3();\n\nconst scratchV0p = new Cartesian3();\nconst scratchV1p = new Cartesian3();\nconst scratchV2p = new Cartesian3();\n\n/**\n * Find a triangle touching the point [px, py, pz], then return the vertex closest to the search point\n * @param {number} px The x component of the point to query\n * @param {number} py The y component of the point to query\n * @param {number} pz The z component of the point to query\n * @returns {object} A structure containing the index of the closest point,\n * the squared distance from the queried point to the point that is found,\n * the distance from the queried point to the point that is found,\n * the queried position in local space,\n * the closest position in local space\n */\nI3SGeometry.prototype.getClosestPointIndexOnTriangle = function (px, py, pz) {\n  if (\n    defined(this._customAttributes) &&\n    defined(this._customAttributes.positions)\n  ) {\n    // Convert queried position to local\n    const position = new Cartesian3(px, py, pz);\n\n    position.x -= this._customAttributes.cartesianCenter.x;\n    position.y -= this._customAttributes.cartesianCenter.y;\n    position.z -= this._customAttributes.cartesianCenter.z;\n    Matrix3.multiplyByVector(\n      this._customAttributes.parentRotation,\n      position,\n      position\n    );\n\n    let bestTriDist = Number.MAX_VALUE;\n    let bestTri;\n    let bestDistSq;\n    let bestIndex;\n    let bestPt;\n\n    // Brute force lookup, @TODO: this can be improved with a spatial partitioning search system\n    const positions = this._customAttributes.positions;\n    const indices = this._customAttributes.indices;\n\n    // We may have indexed or non-indexed triangles here\n    let triCount;\n    if (defined(indices)) {\n      triCount = indices.length;\n    } else {\n      triCount = positions.length / 3;\n    }\n\n    for (let triIndex = 0; triIndex < triCount; triIndex++) {\n      let i0, i1, i2;\n      if (defined(indices)) {\n        i0 = indices[triIndex];\n        i1 = indices[triIndex + 1];\n        i2 = indices[triIndex + 2];\n      } else {\n        i0 = triIndex * 3;\n        i1 = triIndex * 3 + 1;\n        i2 = triIndex * 3 + 2;\n      }\n\n      const v0 = Cartesian3.fromElements(\n        positions[i0 * 3],\n        positions[i0 * 3 + 1],\n        positions[i0 * 3 + 2],\n        scratchV0\n      );\n      const v1 = Cartesian3.fromElements(\n        positions[i1 * 3],\n        positions[i1 * 3 + 1],\n        positions[i1 * 3 + 2],\n        scratchV1\n      );\n      const v2 = new Cartesian3(\n        positions[i2 * 3],\n        positions[i2 * 3 + 1],\n        positions[i2 * 3 + 2],\n        scratchV2\n      );\n\n      // Check how the point is positioned relative to the triangle.\n      // This will tell us whether the projection of the point in the triangle's plane lands in the triangle\n      if (\n        !sameSide(position, v0, v1, v2) ||\n        !sameSide(position, v1, v0, v2) ||\n        !sameSide(position, v2, v0, v1)\n      ) {\n        continue;\n      }\n      // Because of precision issues, we can't always reliably tell if the point lands directly on the face, so the most robust way is just to find the closest one\n      const v0v1 = Cartesian3.subtract(v1, v0, scratchV0V1);\n      const v0v2 = Cartesian3.subtract(v2, v0, scratchV0V2);\n      const crossProd = Cartesian3.cross(v0v1, v0v2, scratchCrossProd);\n\n      // Skip \"triangles\" with 3 colinear points\n      if (Cartesian3.magnitude(crossProd) === 0) {\n        continue;\n      }\n      const normal = Cartesian3.normalize(crossProd, scratchNormal);\n\n      const v0p = Cartesian3.subtract(position, v0, scratchV0p);\n      const normalDist = Math.abs(Cartesian3.dot(v0p, normal));\n      if (normalDist < bestTriDist) {\n        bestTriDist = normalDist;\n        bestTri = triIndex;\n\n        // Found a triangle, return the index of the closest point\n        const d0 = Cartesian3.magnitudeSquared(\n          Cartesian3.subtract(position, v0, v0p)\n        );\n        const d1 = Cartesian3.magnitudeSquared(\n          Cartesian3.subtract(position, v1, scratchV1p)\n        );\n        const d2 = Cartesian3.magnitudeSquared(\n          Cartesian3.subtract(position, v2, scratchV2p)\n        );\n        if (d0 < d1 && d0 < d2) {\n          bestIndex = i0;\n          bestPt = v0;\n          bestDistSq = d0;\n        } else if (d1 < d2) {\n          bestIndex = i1;\n          bestPt = v1;\n          bestDistSq = d1;\n        } else {\n          bestIndex = i2;\n          bestPt = v2;\n          bestDistSq = d2;\n        }\n      }\n    }\n\n    if (defined(bestTri)) {\n      return {\n        index: bestIndex,\n        distanceSquared: bestDistSq,\n        distance: Math.sqrt(bestDistSq),\n        queriedPosition: position,\n        closestPosition: Cartesian3.clone(bestPt),\n      };\n    }\n  }\n\n  // No hits found\n  return {\n    index: -1,\n    distanceSquared: Number.Infinity,\n    distance: Number.Infinity,\n  };\n};\n\n/**\n * @private\n */\nI3SGeometry.prototype._generateGltf = function (\n  nodesInScene,\n  nodes,\n  meshes,\n  buffers,\n  bufferViews,\n  accessors\n) {\n  // Get the material definition\n  let gltfMaterial = {\n    pbrMetallicRoughness: {\n      metallicFactor: 0.0,\n    },\n    doubleSided: true,\n    name: \"Material\",\n  };\n\n  let isTextured = false;\n  let materialDefinition;\n  let texturePath = \"\";\n  if (\n    defined(this._parent._data.mesh) &&\n    defined(this._layer._data.materialDefinitions)\n  ) {\n    const materialInfo = this._parent._data.mesh.material;\n    const materialIndex = materialInfo.definition;\n    if (\n      materialIndex >= 0 &&\n      materialIndex < this._layer._data.materialDefinitions.length\n    ) {\n      materialDefinition = this._layer._data.materialDefinitions[materialIndex];\n      gltfMaterial = materialDefinition;\n\n      if (\n        defined(gltfMaterial.pbrMetallicRoughness) &&\n        defined(gltfMaterial.pbrMetallicRoughness.baseColorTexture)\n      ) {\n        isTextured = true;\n        gltfMaterial.pbrMetallicRoughness.baseColorTexture.index = 0;\n\n        // Choose the JPG for the texture\n        let textureName = \"0\";\n\n        if (defined(this._layer._data.textureSetDefinitions)) {\n          for (\n            let defIndex = 0;\n            defIndex < this._layer._data.textureSetDefinitions.length;\n            defIndex++\n          ) {\n            const textureSetDefinition = this._layer._data\n              .textureSetDefinitions[defIndex];\n            for (\n              let formatIndex = 0;\n              formatIndex < textureSetDefinition.formats.length;\n              formatIndex++\n            ) {\n              const textureFormat = textureSetDefinition.formats[formatIndex];\n              if (textureFormat.format === \"jpg\") {\n                textureName = textureFormat.name;\n                break;\n              }\n            }\n          }\n        }\n\n        if (\n          defined(this._parent._data.mesh) &&\n          this._parent._data.mesh.material.resource >= 0\n        ) {\n          texturePath = this._layer.resource.getDerivedResource({\n            url: `nodes/${this._parent._data.mesh.material.resource}/textures/${textureName}`,\n          }).url;\n        }\n      }\n    }\n  } else if (defined(this._parent._data.textureData)) {\n    // No material definition, but if there's a texture reference, we can create a simple material using it (version 1.6 support)\n    isTextured = true;\n    texturePath = this._parent.resource.getDerivedResource({\n      url: `${this._parent._data.textureData[0].href}`,\n    }).url;\n    gltfMaterial.pbrMetallicRoughness.baseColorTexture = { index: 0 };\n  }\n\n  let gltfTextures = [];\n  let gltfImages = [];\n  let gltfSamplers = [];\n\n  if (isTextured) {\n    gltfTextures = [\n      {\n        sampler: 0,\n        source: 0,\n      },\n    ];\n\n    gltfImages = [\n      {\n        uri: texturePath,\n      },\n    ];\n\n    gltfSamplers = [\n      {\n        magFilter: 9729,\n        minFilter: 9986,\n        wrapS: 10497,\n        wrapT: 10497,\n      },\n    ];\n  }\n\n  const gltfData = {\n    scene: 0,\n    scenes: [\n      {\n        nodes: nodesInScene,\n      },\n    ],\n    nodes: nodes,\n    meshes: meshes,\n    buffers: buffers,\n    bufferViews: bufferViews,\n    accessors: accessors,\n    materials: [gltfMaterial],\n    textures: gltfTextures,\n    images: gltfImages,\n    samplers: gltfSamplers,\n    asset: {\n      version: \"2.0\",\n    },\n  };\n\n  return gltfData;\n};\n\nexport default I3SGeometry;\n", "import Cartographic from \"../Core/Cartographic.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport HeadingPitchRoll from \"../Core/HeadingPitchRoll.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Resource from \"../Core/Resource.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport Cesium3DTile from \"./Cesium3DTile.js\";\nimport I3SDataProvider from \"./I3SDataProvider.js\";\nimport I3SDecoder from \"./I3SDecoder.js\";\nimport I3SFeature from \"./I3SFeature.js\";\nimport I3SField from \"./I3SField.js\";\nimport I3SGeometry from \"./I3SGeometry.js\";\n\n/**\n * This class implements an I3S Node. In CesiumJS each I3SNode creates a Cesium3DTile.\n * <p>\n * Do not construct this directly, instead access tiles through {@link I3SLayer}.\n * </p>\n * @alias I3SNode\n * @internalConstructor\n */\nfunction I3SNode(parent, ref, isRoot) {\n  let level;\n  let layer;\n  let nodeIndex;\n  let resource;\n\n  if (isRoot) {\n    level = 0;\n    layer = parent;\n  } else {\n    level = parent._level + 1;\n    layer = parent._layer;\n  }\n\n  if (typeof ref === \"number\") {\n    nodeIndex = ref;\n  } else {\n    resource = parent.resource.getDerivedResource({\n      url: `${ref}/`,\n    });\n  }\n\n  this._parent = parent;\n  this._dataProvider = parent._dataProvider;\n  this._isRoot = isRoot;\n  this._level = level;\n  this._layer = layer;\n  this._nodeIndex = nodeIndex;\n  this._resource = resource;\n  this._isLoading = false;\n\n  this._tile = undefined;\n  this._data = undefined;\n  this._geometryData = [];\n  this._featureData = [];\n  this._fields = {};\n  this._children = [];\n  this._childrenReadyPromise = undefined;\n  this._globalTransform = undefined;\n  this._inverseGlobalTransform = undefined;\n  this._inverseRotationMatrix = undefined;\n}\n\nObject.defineProperties(I3SNode.prototype, {\n  /**\n   * Gets the resource for the node.\n   * @memberof I3SNode.prototype\n   * @type {Resource}\n   * @readonly\n   */\n  resource: {\n    get: function () {\n      return this._resource;\n    },\n  },\n  /**\n   * Gets the parent layer.\n   * @memberof I3SNode.prototype\n   * @type {I3SLayer}\n   * @readonly\n   */\n  layer: {\n    get: function () {\n      return this._layer;\n    },\n  },\n  /**\n   * Gets the parent node.\n   * @memberof I3SNode.prototype\n   * @type {I3SNode|undefined}\n   * @readonly\n   */\n  parent: {\n    get: function () {\n      return this._parent;\n    },\n  },\n  /**\n   * Gets the children nodes.\n   * @memberof I3SNode.prototype\n   * @type {I3SNode[]}\n   * @readonly\n   */\n  children: {\n    get: function () {\n      return this._children;\n    },\n  },\n  /**\n   * Gets the collection of geometries.\n   * @memberof I3SNode.prototype\n   * @type {I3SGeometry[]}\n   * @readonly\n   */\n  geometryData: {\n    get: function () {\n      return this._geometryData;\n    },\n  },\n  /**\n   * Gets the collection of features.\n   * @memberof I3SNode.prototype\n   * @type {I3SFeature[]}\n   * @readonly\n   */\n  featureData: {\n    get: function () {\n      return this._featureData;\n    },\n  },\n  /**\n   * Gets the collection of fields.\n   * @memberof I3SNode.prototype\n   * @type {I3SField[]}\n   * @readonly\n   */\n  fields: {\n    get: function () {\n      return this._fields;\n    },\n  },\n  /**\n   * Gets the Cesium3DTile for this node.\n   * @memberof I3SNode.prototype\n   * @type {Cesium3DTile}\n   * @readonly\n   */\n  tile: {\n    get: function () {\n      return this._tile;\n    },\n  },\n  /**\n   * Gets the I3S data for this object.\n   * @memberof I3SNode.prototype\n   * @type {object}\n   * @readonly\n   */\n  data: {\n    get: function () {\n      return this._data;\n    },\n  },\n});\n\n/**\n * @private\n */\nI3SNode.prototype.load = async function () {\n  const that = this;\n\n  function processData() {\n    if (!that._isRoot) {\n      // Create a new tile\n      const tileDefinition = that._create3DTileDefinition();\n\n      that._tile = new Cesium3DTile(\n        that._layer._tileset,\n        that._dataProvider.resource,\n        tileDefinition,\n        that._parent._tile\n      );\n\n      that._tile._i3sNode = that;\n    }\n  }\n\n  // If we don't have a nodepage index load from json\n  if (!defined(this._nodeIndex)) {\n    const data = await I3SDataProvider.loadJson(\n      this._resource,\n      this._dataProvider._traceFetches\n    );\n    that._data = data;\n    processData();\n    return;\n  }\n\n  const node = await this._layer._getNodeInNodePages(this._nodeIndex);\n  that._data = node;\n  let uri;\n  if (that._isRoot) {\n    uri = \"nodes/root/\";\n  } else if (defined(node.mesh)) {\n    const uriIndex = node.mesh.geometry.resource;\n    uri = `../${uriIndex}/`;\n  }\n  if (defined(uri)) {\n    that._resource = that._parent.resource.getDerivedResource({ url: uri });\n  }\n\n  processData();\n};\n\n/**\n * Loads the node fields.\n * @returns {Promise<void>} A promise that is resolved when the I3S Node fields are loaded\n */\nI3SNode.prototype.loadFields = function () {\n  // Check if we must load fields\n  const fields = this._layer._data.attributeStorageInfo;\n\n  const that = this;\n  function createAndLoadField(fields, index) {\n    const newField = new I3SField(that, fields[index]);\n    that._fields[newField._storageInfo.name] = newField;\n    return newField.load();\n  }\n\n  const promises = [];\n  if (defined(fields)) {\n    for (let i = 0; i < fields.length; i++) {\n      promises.push(createAndLoadField(fields, i));\n    }\n  }\n\n  return Promise.all(promises);\n};\n\n/**\n * Returns the fields for a given picked position\n * @param {Cartesian3} pickedPosition The picked position\n * @returns {object} Object containing field names and their values\n */\nI3SNode.prototype.getFieldsForPickedPosition = function (pickedPosition) {\n  const geometry = this.geometryData[0];\n  if (!defined(geometry.customAttributes.featureIndex)) {\n    return {};\n  }\n\n  const location = geometry.getClosestPointIndexOnTriangle(\n    pickedPosition.x,\n    pickedPosition.y,\n    pickedPosition.z\n  );\n\n  if (\n    location.index === -1 ||\n    location.index > geometry.customAttributes.featureIndex.length\n  ) {\n    return {};\n  }\n\n  const featureIndex = geometry.customAttributes.featureIndex[location.index];\n  return this.getFieldsForFeature(featureIndex);\n};\n\n/**\n * Returns the fields for a given feature\n * @param {number} featureIndex Index of the feature whose attributes we want to get\n * @returns {object} Object containing field names and their values\n */\nI3SNode.prototype.getFieldsForFeature = function (featureIndex) {\n  const featureFields = {};\n  for (const fieldName in this.fields) {\n    if (this.fields.hasOwnProperty(fieldName)) {\n      const field = this.fields[fieldName];\n      if (featureIndex >= 0 && featureIndex < field.values.length) {\n        featureFields[field.name] = field.values[featureIndex];\n      }\n    }\n  }\n  return featureFields;\n};\n\n/**\n * @private\n */\nI3SNode.prototype._loadChildren = function () {\n  const that = this;\n  // If the promise for loading the children was already created, just return it\n  if (defined(this._childrenReadyPromise)) {\n    return this._childrenReadyPromise;\n  }\n\n  const childPromises = [];\n  if (defined(that._data.children)) {\n    for (\n      let childIndex = 0;\n      childIndex < that._data.children.length;\n      childIndex++\n    ) {\n      const child = that._data.children[childIndex];\n      const newChild = new I3SNode(\n        that,\n        defaultValue(child.href, child),\n        false\n      );\n      that._children.push(newChild);\n      childPromises.push(newChild.load());\n    }\n  }\n\n  this._childrenReadyPromise = Promise.all(childPromises).then(function () {\n    for (let i = 0; i < that._children.length; i++) {\n      that._tile.children.push(that._children[i]._tile);\n    }\n  });\n\n  return this._childrenReadyPromise;\n};\n\n/**\n * @private\n */\nI3SNode.prototype._loadGeometryData = function () {\n  const geometryPromises = [];\n\n  // To debug decoding for a specific tile, add a condition\n  // that wraps this if/else to match the tile uri\n  if (defined(this._data.geometryData)) {\n    for (\n      let geomIndex = 0;\n      geomIndex < this._data.geometryData.length;\n      geomIndex++\n    ) {\n      const curGeometryData = new I3SGeometry(\n        this,\n        this._data.geometryData[geomIndex].href\n      );\n      this._geometryData.push(curGeometryData);\n      geometryPromises.push(curGeometryData.load());\n    }\n  } else if (defined(this._data.mesh)) {\n    const geometryDefinition = this._layer._findBestGeometryBuffers(\n      this._data.mesh.geometry.definition,\n      [\"position\", \"uv0\"]\n    );\n\n    const geometryURI = `./geometries/${geometryDefinition.bufferIndex}/`;\n    const newGeometryData = new I3SGeometry(this, geometryURI);\n    newGeometryData._geometryDefinitions = geometryDefinition.definition;\n    newGeometryData._geometryBufferInfo = geometryDefinition.geometryBufferInfo;\n    this._geometryData.push(newGeometryData);\n    geometryPromises.push(newGeometryData.load());\n  }\n\n  return Promise.all(geometryPromises);\n};\n\n/**\n * @private\n */\nI3SNode.prototype._loadFeatureData = function () {\n  const featurePromises = [];\n\n  // To debug decoding for a specific tile, add a condition\n  // that wraps this if/else to match the tile uri\n  if (defined(this._data.featureData)) {\n    for (\n      let featureIndex = 0;\n      featureIndex < this._data.featureData.length;\n      featureIndex++\n    ) {\n      const newFeatureData = new I3SFeature(\n        this,\n        this._data.featureData[featureIndex].href\n      );\n      this._featureData.push(newFeatureData);\n      featurePromises.push(newFeatureData.load());\n    }\n  }\n\n  return Promise.all(featurePromises);\n};\n\n/**\n * @private\n */\nI3SNode.prototype._clearGeometryData = function () {\n  this._geometryData = [];\n};\n\n/**\n * @private\n */\nI3SNode.prototype._create3DTileDefinition = function () {\n  const obb = this._data.obb;\n  const mbs = this._data.mbs;\n\n  if (!defined(obb) && !defined(mbs)) {\n    console.error(\"Failed to load I3S node. Bounding volume is required.\");\n    return undefined;\n  }\n\n  let geoPosition;\n\n  if (defined(obb)) {\n    geoPosition = Cartographic.fromDegrees(\n      obb.center[0],\n      obb.center[1],\n      obb.center[2]\n    );\n  } else {\n    geoPosition = Cartographic.fromDegrees(mbs[0], mbs[1], mbs[2]);\n  }\n\n  // Offset bounding box position if we have a geoid service defined\n  if (defined(this._dataProvider._geoidDataList) && defined(geoPosition)) {\n    for (let i = 0; i < this._dataProvider._geoidDataList.length; i++) {\n      const tile = this._dataProvider._geoidDataList[i];\n      const projectedPos = tile.projection.project(geoPosition);\n      if (\n        projectedPos.x > tile.nativeExtent.west &&\n        projectedPos.x < tile.nativeExtent.east &&\n        projectedPos.y > tile.nativeExtent.south &&\n        projectedPos.y < tile.nativeExtent.north\n      ) {\n        geoPosition.height += sampleGeoid(projectedPos.x, projectedPos.y, tile);\n        break;\n      }\n    }\n  }\n\n  let boundingVolume = {};\n  let position;\n  let span = 0;\n  if (defined(obb)) {\n    boundingVolume = {\n      box: [\n        0,\n        0,\n        0,\n        obb.halfSize[0],\n        0,\n        0,\n        0,\n        obb.halfSize[1],\n        0,\n        0,\n        0,\n        obb.halfSize[2],\n      ],\n    };\n    span = Math.max(\n      Math.max(this._data.obb.halfSize[0], this._data.obb.halfSize[1]),\n      this._data.obb.halfSize[2]\n    );\n    position = Ellipsoid.WGS84.cartographicToCartesian(geoPosition);\n  } else {\n    boundingVolume = {\n      sphere: [0, 0, 0, mbs[3]],\n    };\n    position = Ellipsoid.WGS84.cartographicToCartesian(geoPosition);\n    span = this._data.mbs[3];\n  }\n  span *= 2;\n  // Compute the geometric error\n  let metersPerPixel = Infinity;\n\n  // Get the meters/pixel density required to pop the next LOD\n  if (defined(this._data.lodThreshold)) {\n    if (\n      this._layer._data.nodePages.lodSelectionMetricType ===\n      \"maxScreenThresholdSQ\"\n    ) {\n      const maxScreenThreshold = Math.sqrt(\n        this._data.lodThreshold / (Math.PI * 0.25)\n      );\n      metersPerPixel = span / maxScreenThreshold;\n    } else if (\n      this._layer._data.nodePages.lodSelectionMetricType ===\n      \"maxScreenThreshold\"\n    ) {\n      const maxScreenThreshold = this._data.lodThreshold;\n      metersPerPixel = span / maxScreenThreshold;\n    } else {\n      // Other LOD selection types can only be used for point cloud data\n      console.error(\"Invalid lodSelectionMetricType in Layer\");\n    }\n  } else if (defined(this._data.lodSelection)) {\n    for (\n      let lodIndex = 0;\n      lodIndex < this._data.lodSelection.length;\n      lodIndex++\n    ) {\n      if (\n        this._data.lodSelection[lodIndex].metricType === \"maxScreenThreshold\"\n      ) {\n        metersPerPixel = span / this._data.lodSelection[lodIndex].maxError;\n      }\n    }\n  }\n\n  if (metersPerPixel === Infinity) {\n    metersPerPixel = 100000;\n  }\n\n  // Calculate the length of 16 pixels in order to trigger the screen space error\n  const geometricError = metersPerPixel * 16;\n\n  // Transformations\n  const hpr = new HeadingPitchRoll(0, 0, 0);\n  let orientation = Transforms.headingPitchRollQuaternion(position, hpr);\n\n  if (defined(this._data.obb)) {\n    orientation = new Quaternion(\n      this._data.obb.quaternion[0],\n      this._data.obb.quaternion[1],\n      this._data.obb.quaternion[2],\n      this._data.obb.quaternion[3]\n    );\n  }\n\n  const rotationMatrix = Matrix3.fromQuaternion(orientation);\n  const inverseRotationMatrix = Matrix3.inverse(rotationMatrix, new Matrix3());\n\n  const globalTransform = new Matrix4(\n    rotationMatrix[0],\n    rotationMatrix[1],\n    rotationMatrix[2],\n    0,\n    rotationMatrix[3],\n    rotationMatrix[4],\n    rotationMatrix[5],\n    0,\n    rotationMatrix[6],\n    rotationMatrix[7],\n    rotationMatrix[8],\n    0,\n    position.x,\n    position.y,\n    position.z,\n    1\n  );\n\n  const inverseGlobalTransform = Matrix4.inverse(\n    globalTransform,\n    new Matrix4()\n  );\n\n  const localTransform = Matrix4.clone(globalTransform);\n\n  if (defined(this._parent._globalTransform)) {\n    Matrix4.multiply(\n      globalTransform,\n      this._parent._inverseGlobalTransform,\n      localTransform\n    );\n  }\n\n  this._globalTransform = globalTransform;\n  this._inverseGlobalTransform = inverseGlobalTransform;\n  this._inverseRotationMatrix = inverseRotationMatrix;\n\n  // get children definition\n  const childrenDefinition = [];\n  for (let childIndex = 0; childIndex < this._children.length; childIndex++) {\n    childrenDefinition.push(\n      this._children[childIndex]._create3DTileDefinition()\n    );\n  }\n\n  // Create a tile set\n  const inPlaceTileDefinition = {\n    children: childrenDefinition,\n    refine: \"REPLACE\",\n    boundingVolume: boundingVolume,\n    transform: [\n      localTransform[0],\n      localTransform[4],\n      localTransform[8],\n      localTransform[12],\n      localTransform[1],\n      localTransform[5],\n      localTransform[9],\n      localTransform[13],\n      localTransform[2],\n      localTransform[6],\n      localTransform[10],\n      localTransform[14],\n      localTransform[3],\n      localTransform[7],\n      localTransform[11],\n      localTransform[15],\n    ],\n    content: {\n      uri: defined(this._resource) ? this._resource.url : undefined,\n    },\n    geometricError: geometricError,\n  };\n\n  return inPlaceTileDefinition;\n};\n\n/**\n * @private\n */\nI3SNode.prototype._createContentURL = async function () {\n  let rawGltf = {\n    scene: 0,\n    scenes: [\n      {\n        nodes: [0],\n      },\n    ],\n    nodes: [\n      {\n        name: \"singleNode\",\n      },\n    ],\n    meshes: [],\n    buffers: [],\n    bufferViews: [],\n    accessors: [],\n    materials: [],\n    textures: [],\n    images: [],\n    samplers: [],\n    asset: {\n      version: \"2.0\",\n    },\n  };\n\n  // Load the geometry data\n  const dataPromises = [this._loadGeometryData()];\n  if (this._dataProvider.legacyVersion16) {\n    dataPromises.push(this._loadFeatureData());\n  }\n\n  await Promise.all(dataPromises);\n  // Binary glTF\n  if (defined(this._geometryData) && this._geometryData.length > 0) {\n    const url = this._geometryData[0].resource.url;\n    const geometrySchema = this._layer._data.store.defaultGeometrySchema;\n    const geometryData = this._geometryData[0];\n    const result = await I3SDecoder.decode(\n      url,\n      geometrySchema,\n      geometryData,\n      this._featureData[0]\n    );\n    if (!defined(result)) {\n      // Postponed\n      return;\n    }\n\n    rawGltf = geometryData._generateGltf(\n      result.meshData.nodesInScene,\n      result.meshData.nodes,\n      result.meshData.meshes,\n      result.meshData.buffers,\n      result.meshData.bufferViews,\n      result.meshData.accessors\n    );\n\n    this._geometryData[0]._customAttributes = result.meshData._customAttributes;\n  }\n\n  const binaryGltfData = this._dataProvider._binarizeGltf(rawGltf);\n  const glbDataBlob = new Blob([binaryGltfData], {\n    type: \"application/binary\",\n  });\n  return URL.createObjectURL(glbDataBlob);\n};\n\n// Reimplement Cesium3DTile.prototype.requestContent so that\n// We get a chance to load our own gltf from I3S data\nCesium3DTile.prototype._hookedRequestContent =\n  Cesium3DTile.prototype.requestContent;\n\n/**\n * Requests the tile's content.\n * <p>\n * The request may not be made if the Cesium Request Scheduler can't prioritize it.\n * </p>\n *\n * @return {Promise<Cesium3DTileContent>|undefined} A promise that resolves when the request completes, or undefined if there is no request needed, or the request cannot be scheduled.\n * @private\n */\nCesium3DTile.prototype.requestContent = function () {\n  if (!this.tileset._isI3STileSet) {\n    return this._hookedRequestContent();\n  }\n\n  if (!this._isLoading) {\n    this._isLoading = true;\n    return this._i3sNode\n      ._createContentURL()\n      .then((url) => {\n        if (!defined(url)) {\n          this._isLoading = false;\n          return;\n        }\n\n        this._contentResource = new Resource({ url: url });\n        return this._hookedRequestContent();\n      })\n      .then((content) => {\n        this._isLoading = false;\n        return content;\n      });\n  }\n};\n\nfunction bilinearInterpolate(tx, ty, h00, h10, h01, h11) {\n  const a = h00 * (1 - tx) + h10 * tx;\n  const b = h01 * (1 - tx) + h11 * tx;\n  return a * (1 - ty) + b * ty;\n}\n\nfunction sampleMap(u, v, width, data) {\n  const address = u + v * width;\n  return data[address];\n}\n\nfunction sampleGeoid(sampleX, sampleY, geoidData) {\n  const extent = geoidData.nativeExtent;\n  let x =\n    ((sampleX - extent.west) / (extent.east - extent.west)) *\n    (geoidData.width - 1);\n  let y =\n    ((sampleY - extent.south) / (extent.north - extent.south)) *\n    (geoidData.height - 1);\n  const xi = Math.floor(x);\n  let yi = Math.floor(y);\n\n  x -= xi;\n  y -= yi;\n\n  const xNext = xi < geoidData.width ? xi + 1 : xi;\n  let yNext = yi < geoidData.height ? yi + 1 : yi;\n\n  yi = geoidData.height - 1 - yi;\n  yNext = geoidData.height - 1 - yNext;\n\n  const h00 = sampleMap(xi, yi, geoidData.width, geoidData.buffer);\n  const h10 = sampleMap(xNext, yi, geoidData.width, geoidData.buffer);\n  const h01 = sampleMap(xi, yNext, geoidData.width, geoidData.buffer);\n  const h11 = sampleMap(xNext, yNext, geoidData.width, geoidData.buffer);\n\n  let finalHeight = bilinearInterpolate(x, y, h00, h10, h01, h11);\n  finalHeight = finalHeight * geoidData.scale + geoidData.offset;\n  return finalHeight;\n}\n\nObject.defineProperties(Cesium3DTile.prototype, {\n  /**\n   * Gets the I3S Node for the tile.\n   * @memberof Cesium3DTile.prototype\n   * @type {string}\n   */\n  i3sNode: {\n    get: function () {\n      return this._i3sNode;\n    },\n  },\n});\n\nexport default I3SNode;\n", "import defined from \"../Core/defined.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Cesium3DTileset from \"./Cesium3DTileset.js\";\nimport I3SNode from \"./I3SNode.js\";\n\n/**\n * This class implements an I3S layer. In CesiumJS each I3SLayer creates a Cesium3DTileset.\n * <p>\n * Do not construct this directly, instead access layers through {@link I3SDataProvider}.\n * </p>\n * @alias I3SLayer\n * @internalConstructor\n * @privateParam {I3SDataProvider} dataProvider The i3s data provider\n * @privateParam {object} layerData The layer data that is loaded from the scene layer\n * @privateParam {number} index The index of the layer to be reflected\n */\nfunction I3SLayer(dataProvider, layerData, index) {\n  this._dataProvider = dataProvider;\n\n  if (!defined(layerData.href) && defined(index)) {\n    // assign a default layer\n    layerData.href = `layers/${index}`;\n  }\n\n  const dataProviderUrl = this._dataProvider.resource.getUrlComponent();\n\n  let tilesetUrl = \"\";\n  if (dataProviderUrl.match(/layers\\/\\d/)) {\n    tilesetUrl = `${dataProviderUrl}`.replace(/\\/+$/, \"\");\n  } else {\n    // Add '/' to url if needed + `${layerData.href}` if tilesetUrl not already in ../layers/[id] format\n    tilesetUrl = `${dataProviderUrl}`\n      .replace(/\\/?$/, \"/\")\n      .concat(`${layerData.href}`);\n  }\n\n  this._version = layerData.store.version;\n  const splitVersion = this._version.split(\".\");\n  this._majorVersion = parseInt(splitVersion[0]);\n  this._minorVersion = splitVersion.length > 1 ? parseInt(splitVersion[1]) : 0;\n\n  this._resource = new Resource({ url: tilesetUrl });\n  this._resource.setQueryParameters(\n    this._dataProvider.resource.queryParameters\n  );\n  this._resource.appendForwardSlash();\n  this._data = layerData;\n  this._rootNode = undefined;\n  this._nodePages = {};\n  this._nodePageFetches = {};\n  this._extent = undefined;\n  this._tileset = undefined;\n  this._geometryDefinitions = undefined;\n\n  this._computeGeometryDefinitions(true);\n  this._computeExtent();\n}\n\nObject.defineProperties(I3SLayer.prototype, {\n  /**\n   * Gets the resource for the layer.\n   * @memberof I3SLayer.prototype\n   * @type {Resource}\n   * @readonly\n   */\n  resource: {\n    get: function () {\n      return this._resource;\n    },\n  },\n\n  /**\n   * Gets the root node of this layer.\n   * @memberof I3SLayer.prototype\n   * @type {I3SNode}\n   * @readonly\n   */\n  rootNode: {\n    get: function () {\n      return this._rootNode;\n    },\n  },\n  /**\n   * Gets the Cesium3DTileset for this layer.\n   * @memberof I3SLayer.prototype\n   * @type {Cesium3DTileset|undefined}\n   * @readonly\n   */\n  tileset: {\n    get: function () {\n      return this._tileset;\n    },\n  },\n  /**\n   * Gets the I3S data for this object.\n   * @memberof I3SLayer.prototype\n   * @type {object}\n   * @readonly\n   */\n  data: {\n    get: function () {\n      return this._data;\n    },\n  },\n\n  /**\n   * The version string of the loaded I3S dataset\n   * @memberof I3SLayer.prototype\n   * @type {string}\n   * @readonly\n   */\n  version: {\n    get: function () {\n      return this._version;\n    },\n  },\n\n  /**\n   * The major version number of the loaded I3S dataset\n   * @memberof I3SLayer.prototype\n   * @type {number}\n   * @readonly\n   */\n  majorVersion: {\n    get: function () {\n      return this._majorVersion;\n    },\n  },\n\n  /**\n   * The minor version number of the loaded I3S dataset\n   * @memberof I3SLayer.prototype\n   * @type {number}\n   * @readonly\n   */\n  minorVersion: {\n    get: function () {\n      return this._minorVersion;\n    },\n  },\n\n  /**\n   * When <code>true</code>, when the loaded I3S version is 1.6 or older\n   * @memberof I3SLayer.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  legacyVersion16: {\n    get: function () {\n      if (!defined(this.version)) {\n        return undefined;\n      }\n      if (\n        this.majorVersion < 1 ||\n        (this.majorVersion === 1 && this.minorVersion <= 6)\n      ) {\n        return true;\n      }\n      return false;\n    },\n  },\n});\n\n/**\n * Loads the content, including the root node definition and its children\n * @param {Cesium3DTileset.ConstructorOptions} [cesium3dTilesetOptions] options for Cesium3dTileset constructor\n * @returns {Promise} A promise that is resolved when the layer data is loaded\n * @private\n */\nI3SLayer.prototype.load = async function (cesium3dTilesetOptions) {\n  if (this._data.spatialReference.wkid !== 4326) {\n    throw new RuntimeError(\n      `Unsupported spatial reference: ${this._data.spatialReference.wkid}`\n    );\n  }\n\n  await this._dataProvider.loadGeoidData();\n  await this._loadRootNode(cesium3dTilesetOptions);\n  await this._create3DTileset(cesium3dTilesetOptions);\n\n  this._rootNode._tile = this._tileset._root;\n  this._tileset._root._i3sNode = this._rootNode;\n  if (this.legacyVersion16) {\n    return this._rootNode._loadChildren();\n  }\n};\n\n/**\n * @private\n */\nI3SLayer.prototype._computeGeometryDefinitions = function (useCompression) {\n  // create a table of all geometry buffers based on\n  // the number of attributes and whether they are\n  // compressed or not, sort them by priority\n\n  this._geometryDefinitions = [];\n\n  if (defined(this._data.geometryDefinitions)) {\n    for (\n      let defIndex = 0;\n      defIndex < this._data.geometryDefinitions.length;\n      defIndex++\n    ) {\n      const geometryBuffersInfo = [];\n      const geometryBuffers = this._data.geometryDefinitions[defIndex]\n        .geometryBuffers;\n\n      for (let bufIndex = 0; bufIndex < geometryBuffers.length; bufIndex++) {\n        const geometryBuffer = geometryBuffers[bufIndex];\n        const collectedAttributes = [];\n        let compressed = false;\n\n        if (defined(geometryBuffer.compressedAttributes) && useCompression) {\n          // check if compressed\n          compressed = true;\n          const attributes = geometryBuffer.compressedAttributes.attributes;\n          for (let i = 0; i < attributes.length; i++) {\n            collectedAttributes.push(attributes[i]);\n          }\n        } else {\n          // uncompressed attributes\n          for (const attribute in geometryBuffer) {\n            if (attribute !== \"offset\") {\n              collectedAttributes.push(attribute);\n            }\n          }\n        }\n\n        geometryBuffersInfo.push({\n          compressed: compressed,\n          attributes: collectedAttributes,\n          index: geometryBuffers.indexOf(geometryBuffer),\n        });\n      }\n\n      // rank the buffer info\n      geometryBuffersInfo.sort(function (a, b) {\n        if (a.compressed && !b.compressed) {\n          return -1;\n        } else if (!a.compressed && b.compressed) {\n          return 1;\n        }\n        return a.attributes.length - b.attributes.length;\n      });\n      this._geometryDefinitions.push(geometryBuffersInfo);\n    }\n  }\n};\n\n/**\n * @private\n */\nI3SLayer.prototype._findBestGeometryBuffers = function (\n  definition,\n  attributes\n) {\n  // find the most appropriate geometry definition\n  // based on the required attributes, and by favouring\n  // compression to improve bandwidth requirements\n\n  const geometryDefinition = this._geometryDefinitions[definition];\n\n  if (defined(geometryDefinition)) {\n    for (let index = 0; index < geometryDefinition.length; ++index) {\n      const geometryBufferInfo = geometryDefinition[index];\n      let missed = false;\n      const geometryAttributes = geometryBufferInfo.attributes;\n      for (let attrIndex = 0; attrIndex < attributes.length; attrIndex++) {\n        if (!geometryAttributes.includes(attributes[attrIndex])) {\n          missed = true;\n          break;\n        }\n      }\n      if (!missed) {\n        return {\n          bufferIndex: geometryBufferInfo.index,\n          definition: geometryDefinition,\n          geometryBufferInfo: geometryBufferInfo,\n        };\n      }\n    }\n  }\n\n  return 0;\n};\n\n/**\n * @private\n */\nI3SLayer.prototype._loadRootNode = function (cesium3dTilesetOptions) {\n  if (defined(this._data.nodePages)) {\n    let rootIndex = 0;\n    if (defined(this._data.nodePages.rootIndex)) {\n      rootIndex = this._data.nodePages.rootIndex;\n    }\n    this._rootNode = new I3SNode(this, rootIndex, true);\n  } else {\n    this._rootNode = new I3SNode(this, this._data.store.rootNode, true);\n  }\n\n  return this._rootNode.load(cesium3dTilesetOptions);\n};\n\n/**\n * @private\n */\nI3SLayer.prototype._getNodeInNodePages = function (nodeIndex) {\n  const index = Math.floor(nodeIndex / this._data.nodePages.nodesPerPage);\n  const offsetInPage = nodeIndex % this._data.nodePages.nodesPerPage;\n  return this._loadNodePage(index).then(function (data) {\n    return data.nodes[offsetInPage];\n  });\n};\n\n/**\n * @private\n */\nI3SLayer._fetchJson = function (resource) {\n  return resource.fetchJson();\n};\n\n/**\n * @private\n */\nI3SLayer.prototype._loadNodePage = function (page) {\n  const that = this;\n\n  // If node page was already requested return the same promise\n  if (!defined(this._nodePageFetches[page])) {\n    const nodePageResource = this.resource.getDerivedResource({\n      url: `nodepages/${page}/`,\n    });\n    const fetchPromise = I3SLayer._fetchJson(nodePageResource).then(function (\n      data\n    ) {\n      if (defined(data.error) && data.error.code !== 200) {\n        return Promise.reject(data.error);\n      }\n\n      that._nodePages[page] = data.nodes;\n      return data;\n    });\n\n    this._nodePageFetches[page] = fetchPromise;\n  }\n\n  return this._nodePageFetches[page];\n};\n\n/**\n * @private\n */\nI3SLayer.prototype._computeExtent = function () {\n  if (defined(this._data.fullExtent)) {\n    this._extent = Rectangle.fromDegrees(\n      this._data.fullExtent.xmin,\n      this._data.fullExtent.ymin,\n      this._data.fullExtent.xmax,\n      this._data.fullExtent.ymax\n    );\n  } else if (defined(this._data.store.extent)) {\n    this._extent = Rectangle.fromDegrees(\n      this._data.store.extent[0],\n      this._data.store.extent[1],\n      this._data.store.extent[2],\n      this._data.store.extent[3]\n    );\n  }\n};\n\n/**\n * @private\n */\nI3SLayer.prototype._create3DTileset = async function (cesium3dTilesetOptions) {\n  const inPlaceTileset = {\n    asset: {\n      version: \"1.0\",\n    },\n    geometricError: Number.MAX_VALUE,\n    root: this._rootNode._create3DTileDefinition(),\n  };\n\n  const tilesetBlob = new Blob([JSON.stringify(inPlaceTileset)], {\n    type: \"application/json\",\n  });\n\n  const tilesetUrl = URL.createObjectURL(tilesetBlob);\n  this._tileset = await Cesium3DTileset.fromUrl(\n    tilesetUrl,\n    cesium3dTilesetOptions\n  );\n  this._tileset.show = this._dataProvider.show;\n  this._tileset._isI3STileSet = true;\n  this._tileset.tileUnload.addEventListener(function (tile) {\n    tile._i3sNode._clearGeometryData();\n    URL.revokeObjectURL(tile._contentResource._url);\n    tile._contentResource = tile._i3sNode.resource;\n  });\n\n  this._tileset.tileVisible.addEventListener(function (tile) {\n    if (defined(tile._i3sNode)) {\n      tile._i3sNode._loadChildren();\n    }\n  });\n};\n\nexport default I3SLayer;\n", "/*\n * Esri Contribution: This code implements support for I3S (Indexed 3D Scene Layers), an OGC Community Standard.\n * Co-authored-by: Alexandre Jean-Claude ajeanclaude@spiria.com\n * Co-authored-by: Anthony Mirabeau anthony.mirabeau@presagis.com\n * Co-authored-by: Elizabeth Rudkin elizabeth.rudkin@presagis.com\n * Co-authored-by: Tamrat Belayneh tbelayneh@esri.com\n *\n * The I3S format has been developed by Esri and is shared under an Apache 2.0 license and is maintained @ https://github.com/Esri/i3s-spec.\n * This implementation supports loading, displaying, and querying an I3S layer (supported versions include Esri github I3S versions 1.6, 1.7/1.8 -\n * whose OGC equivalent are I3S Community Standard Version 1.1 & 1.2) in the CesiumJS viewer.\n * It enables the user to access an I3S layer via its URL and load it inside of the CesiumJS viewer.\n *\n * When a scene layer is initialized it accomplishes the following:\n *\n * It processes the 3D Scene Layer resource (https://github.com/Esri/i3s-spec/blob/master/docs/1.8/3DSceneLayer.cmn.md) of an I3S dataset\n * and loads the layers data. It does so by creating a Cesium 3D Tileset for the given i3s layer and loads the root node.\n * When the root node is imported, it creates a Cesium 3D Tile that is parented to the Cesium 3D Tileset\n * and loads all children of the root node:\n *  for each children\n *   Create a place holder 3D tile so that the LOD display can use the nodes' selection criteria (maximumScreenSpaceError) to select the appropriate node\n *   based on the current LOD display & evaluation. If the Cesium 3D tile is visible, it invokes requestContent on it.\n *   At that moment, we intercept the call to requestContent, and we load the geometry in I3S format\n *   That geometry is transcoded on the fly to glTF format and ingested by CesiumJS\n *   When the geometry is loaded, we then load all children of this node as placeholders so that the LOD\n *   can know about them too.\n *\n * About transcoding:\n *\n * We use web workers to transcode I3S geometries into glTF\n * The steps are:\n *\n * Decode geometry attributes (positions, normals, etc..) either from DRACO or Binary format.\n * If requested, when creating an I3SDataProvider the user has the option to specify a tiled elevation terrain provider\n * (geoidTiledTerrainProvider) such as the one shown in the sandcastle example based on ArcGISTiledElevationTerrainProvider, that allows\n * conversion of heights for all vertices & bounding boxes of an I3S layer from (typically) gravity related (Orthometric) heights to Ellipsoidal.\n * This step is essential when fusing data with varying height sources (as is the case when fusing the I3S dataset (gravity related) in the sandcastle examples with the cesium world terrain (ellipsoidal)).\n * We then transform vertex coordinates from LONG/LAT/HEIGHT to Cartesian in local space and\n * scale appropriately if specified in the attribute metadata\n * Crop UVs if UV regions are defined in the attribute metadata\n * Create a glTF document in memory that will be ingested as part of a glb payload\n *\n * About GEOID data:\n *\n * We provide the ability to use GEOID data to convert heights from gravity related (orthometric) height systems to ellipsoidal.\n * We employ a service architecture to get the conversion factor for a given long lat values, leveraging existing implementation based on ArcGISTiledElevationTerrainProvider\n * to avoid requiring bloated look up files. The source Data used in this transcoding service was compiled from https://earth-info.nga.mil/#tab_wgs84-data and is based on\n * EGM2008 Gravity Model. The sandcastle examples show how to set the terrain provider service if required.\n */\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport HeightmapEncoding from \"../Core/HeightmapEncoding.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\nimport I3SLayer from \"./I3SLayer.js\";\nimport Lerc from \"lerc\";\nimport Rectangle from \"../Core/Rectangle.js\";\n\n/**\n * @typedef {Object} I3SDataProvider.ConstructorOptions\n *\n * Initialization options for the I3SDataProvider constructor\n *\n * @property {string} [name] The name of the I3S dataset.\n * @property {boolean} [show=true] Determines if the dataset will be shown.\n * @property {ArcGISTiledElevationTerrainProvider|Promise<ArcGISTiledElevationTerrainProvider>} [geoidTiledTerrainProvider] Tiled elevation provider describing an Earth Gravitational Model. If defined, geometry will be shifted based on the offsets given by this provider. Required to position I3S data sets with gravity-related height at the correct location.\n * @property {boolean} [traceFetches=false] Debug option. When true, log a message whenever an I3S tile is fetched.\n * @property {Cesium3DTileset.ConstructorOptions} [cesium3dTilesetOptions] Object containing options to pass to an internally created {@link Cesium3DTileset}. See {@link Cesium3DTileset} for list of valid properties. All options can be used with the exception of <code>url</code> and <code>show</code> which are overridden by values from I3SDataProvider.\n */\n\n/**\n * An I3SDataProvider is the main public class for I3S support. The url option\n * should return a scene object. Currently supported I3S versions are 1.6 and\n * 1.7/1.8 (OGC I3S 1.2). I3SFeature and I3SNode classes implement the\n * Object Model for I3S entities, with public interfaces.\n *\n * <div class=\"notice\">\n * This object is normally not instantiated directly, use {@link I3SDataProvider.fromUrl}.\n * </div>\n *\n * @alias I3SDataProvider\n * @constructor\n *\n * @param {I3SDataProvider.ConstructorOptions} options An object describing initialization options\n *\n * @see I3SDataProvider.fromUrl\n * @see ArcGISTiledElevationTerrainProvider\n *\n * @example\n * try {\n *   const i3sData = await I3SDataProvider.fromUrl(\n *     \"https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Frankfurt2017_vi3s_18/SceneServer/layers/0\"\n *   );\n *   viewer.scene.primitives.add(i3sData);\n * } catch (error) {\n *   console.log(`There was an error creating the I3S Data Provider: ${error}`);\n * }\n *\n * @example\n * try {\n *   const geoidService = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl(\n *     \"https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/EGM2008/ImageServer\"\n *   );\n *   const i3sData = await I3SDataProvider.fromUrl(\n *     \"https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Frankfurt2017_vi3s_18/SceneServer/layers/0\", {\n *       geoidTiledTerrainProvider: geoidService\n *   });\n *   viewer.scene.primitives.add(i3sData);\n * } catch (error) {\n *   console.log(`There was an error creating the I3S Data Provider: ${error}`);\n * }\n */\nfunction I3SDataProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  // All public configuration is defined as ES5 properties\n  // These are just the \"private\" variables and their defaults.\n  this._name = options.name;\n  this._show = defaultValue(options.show, true);\n  this._geoidTiledTerrainProvider = options.geoidTiledTerrainProvider;\n  this._traceFetches = defaultValue(options.traceFetches, false);\n\n  this._cesium3dTilesetOptions = defaultValue(\n    options.cesium3dTilesetOptions,\n    defaultValue.EMPTY_OBJECT\n  );\n\n  this._layers = [];\n  this._data = undefined;\n  this._extent = undefined;\n  this._geoidDataPromise = undefined;\n  this._geoidDataList = undefined;\n  this._decoderTaskProcessor = undefined;\n  this._taskProcessorReadyPromise = undefined;\n}\n\nObject.defineProperties(I3SDataProvider.prototype, {\n  /**\n   * Gets a human-readable name for this dataset.\n   * @memberof I3SDataProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  name: {\n    get: function () {\n      return this._name;\n    },\n  },\n\n  /**\n   * Determines if the dataset will be shown.\n   * @memberof I3SDataProvider.prototype\n   * @type {boolean}\n   */\n  show: {\n    get: function () {\n      return this._show;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"value\", value);\n      //>>includeEnd('debug');\n\n      this._show = value;\n      for (let i = 0; i < this._layers.length; i++) {\n        if (defined(this._layers[i]._tileset)) {\n          this._layers[i]._tileset.show = this._show;\n        }\n      }\n    },\n  },\n\n  /**\n   * Gets or sets debugging and tracing of I3S fetches.\n   * @memberof I3SDataProvider.prototype\n   * @type {boolean}\n   */\n  traceFetches: {\n    get: function () {\n      return this._traceFetches;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"value\", value);\n      //>>includeEnd('debug');\n\n      this._traceFetches = value;\n    },\n  },\n\n  /**\n   * The terrain provider referencing the GEOID service to be used for orthometric to ellipsoidal conversion.\n   * @memberof I3SDataProvider.prototype\n   * @type {ArcGISTiledElevationTerrainProvider}\n   * @readonly\n   */\n  geoidTiledTerrainProvider: {\n    get: function () {\n      return this._geoidTiledTerrainProvider;\n    },\n  },\n\n  /**\n   * Gets the collection of layers.\n   * @memberof I3SDataProvider.prototype\n   * @type {I3SLayer[]}\n   * @readonly\n   */\n  layers: {\n    get: function () {\n      return this._layers;\n    },\n  },\n\n  /**\n   * Gets the I3S data for this object.\n   * @memberof I3SDataProvider.prototype\n   * @type {object}\n   * @readonly\n   */\n  data: {\n    get: function () {\n      return this._data;\n    },\n  },\n\n  /**\n   * Gets the extent covered by this I3S.\n   * @memberof I3SDataProvider.prototype\n   * @type {Rectangle}\n   * @readonly\n   */\n  extent: {\n    get: function () {\n      return this._extent;\n    },\n  },\n\n  /**\n   * The resource used to fetch the I3S dataset.\n   * @memberof I3SDataProvider.prototype\n   * @type {Resource}\n   * @readonly\n   */\n  resource: {\n    get: function () {\n      return this._resource;\n    },\n  },\n});\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see I3SDataProvider#isDestroyed\n */\nI3SDataProvider.prototype.destroy = function () {\n  for (let i = 0; i < this._layers.length; i++) {\n    if (defined(this._layers[i]._tileset)) {\n      this._layers[i]._tileset.destroy();\n    }\n  }\n\n  return destroyObject(this);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see I3SDataProvider#destroy\n */\nI3SDataProvider.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * @private\n */\nI3SDataProvider.prototype.update = function (frameState) {\n  for (let i = 0; i < this._layers.length; i++) {\n    if (defined(this._layers[i]._tileset)) {\n      this._layers[i]._tileset.update(frameState);\n    }\n  }\n};\n\n/**\n * @private\n */\nI3SDataProvider.prototype.prePassesUpdate = function (frameState) {\n  for (let i = 0; i < this._layers.length; i++) {\n    if (defined(this._layers[i]._tileset)) {\n      this._layers[i]._tileset.prePassesUpdate(frameState);\n    }\n  }\n};\n\n/**\n * @private\n */\nI3SDataProvider.prototype.postPassesUpdate = function (frameState) {\n  for (let i = 0; i < this._layers.length; i++) {\n    if (defined(this._layers[i]._tileset)) {\n      this._layers[i]._tileset.postPassesUpdate(frameState);\n    }\n  }\n};\n\n/**\n * @private\n */\nI3SDataProvider.prototype.updateForPass = function (frameState, passState) {\n  for (let i = 0; i < this._layers.length; i++) {\n    if (defined(this._layers[i]._tileset)) {\n      this._layers[i]._tileset.updateForPass(frameState, passState);\n    }\n  }\n};\n\n/**\n * Creates an I3SDataProvider. Currently supported I3S versions are 1.6 and\n * 1.7/1.8 (OGC I3S 1.2).\n *\n * @param {string|Resource} url The url of the I3S dataset, which should return an I3S scene object\n * @param {I3SDataProvider.ConstructorOptions} options An object describing initialization options\n * @returns {Promise<I3SDataProvider>}\n *\n * @example\n * try {\n *   const i3sData = await I3SDataProvider.fromUrl(\n *     \"https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Frankfurt2017_vi3s_18/SceneServer/layers/0\"\n *   );\n *   viewer.scene.primitives.add(i3sData);\n * } catch (error) {\n *   console.log(`There was an error creating the I3S Data Provider: ${error}`);\n * }\n *\n * @example\n * try {\n *   const geoidService = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl(\n *     \"https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/EGM2008/ImageServer\"\n *   );\n *   const i3sData = await I3SDataProvider.fromUrl(\n *     \"https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Frankfurt2017_vi3s_18/SceneServer/layers/0\", {\n *       geoidTiledTerrainProvider: geoidService\n *   });\n *   viewer.scene.primitives.add(i3sData);\n * } catch (error) {\n *   console.log(`There was an error creating the I3S Data Provider: ${error}`);\n * }\n */\nI3SDataProvider.fromUrl = async function (url, options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"url\", url);\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const resource = Resource.createIfNeeded(url);\n  const data = await I3SDataProvider.loadJson(resource);\n\n  const provider = new I3SDataProvider(options);\n  provider._resource = resource;\n  provider._data = data;\n\n  // Success\n  if (defined(data.layers)) {\n    for (let layerIndex = 0; layerIndex < data.layers.length; layerIndex++) {\n      const newLayer = new I3SLayer(\n        provider,\n        data.layers[layerIndex],\n        layerIndex\n      );\n      provider._layers.push(newLayer);\n    }\n  } else {\n    const newLayer = new I3SLayer(provider, data, data.id);\n    provider._layers.push(newLayer);\n  }\n\n  provider._computeExtent();\n\n  // Start loading all of the tiles\n  const layerPromises = [];\n  for (let i = 0; i < provider._layers.length; i++) {\n    layerPromises.push(\n      provider._layers[i].load(options.cesium3dTilesetOptions)\n    );\n  }\n\n  await Promise.all(layerPromises);\n  return provider;\n};\n\n/**\n * @private\n */\nI3SDataProvider._fetchJson = function (resource) {\n  return resource.fetchJson();\n};\n\n/**\n * @private\n *\n * @param {Resource} resource The JSON resource to request\n * @param {boolean} [trace=false] Log the resource\n * @returns {Promise<object>} The fetched data\n */\nI3SDataProvider.loadJson = async function (resource, trace) {\n  if (trace) {\n    console.log(\"I3S FETCH:\", resource.url);\n  }\n\n  const data = await I3SDataProvider._fetchJson(resource);\n  if (defined(data.error)) {\n    console.error(\"Failed to fetch I3S \", resource.url);\n    if (defined(data.error.message)) {\n      console.error(data.error.message);\n    }\n    if (defined(data.error.details)) {\n      for (let i = 0; i < data.error.details.length; i++) {\n        console.log(data.error.details[i]);\n      }\n    }\n\n    throw new RuntimeError(data.error);\n  }\n\n  return data;\n};\n\n/**\n * @private\n */\nI3SDataProvider.prototype._loadBinary = function (resource) {\n  if (this._traceFetches) {\n    console.log(\"I3S FETCH:\", resource.url);\n  }\n  return resource.fetchArrayBuffer();\n};\n\n/**\n * @private\n */\nI3SDataProvider.prototype._binarizeGltf = function (rawGltf) {\n  const encoder = new TextEncoder();\n  const rawGltfData = encoder.encode(JSON.stringify(rawGltf));\n  const binaryGltfData = new Uint8Array(rawGltfData.byteLength + 20);\n  const binaryGltf = {\n    magic: new Uint8Array(binaryGltfData.buffer, 0, 4),\n    version: new Uint32Array(binaryGltfData.buffer, 4, 1),\n    length: new Uint32Array(binaryGltfData.buffer, 8, 1),\n    chunkLength: new Uint32Array(binaryGltfData.buffer, 12, 1),\n    chunkType: new Uint32Array(binaryGltfData.buffer, 16, 1),\n    chunkData: new Uint8Array(\n      binaryGltfData.buffer,\n      20,\n      rawGltfData.byteLength\n    ),\n  };\n\n  binaryGltf.magic[0] = \"g\".charCodeAt();\n  binaryGltf.magic[1] = \"l\".charCodeAt();\n  binaryGltf.magic[2] = \"T\".charCodeAt();\n  binaryGltf.magic[3] = \"F\".charCodeAt();\n\n  binaryGltf.version[0] = 2;\n  binaryGltf.length[0] = binaryGltfData.byteLength;\n  binaryGltf.chunkLength[0] = rawGltfData.byteLength;\n  binaryGltf.chunkType[0] = 0x4e4f534a; // JSON\n  binaryGltf.chunkData.set(rawGltfData);\n\n  return binaryGltfData;\n};\n\nconst scratchCartesian2 = new Cartesian2();\n\nfunction getCoveredTiles(terrainProvider, extent) {\n  const tilingScheme = terrainProvider.tilingScheme;\n\n  // Sort points into a set of tiles\n  const tileRequests = []; // Result will be an Array as it's easier to work with\n  const tileRequestSet = {}; // A unique set\n\n  const maxLevel = terrainProvider._lodCount;\n\n  const topLeftCorner = Cartographic.fromRadians(extent.west, extent.north);\n  const bottomRightCorner = Cartographic.fromRadians(extent.east, extent.south);\n  const minCornerXY = tilingScheme.positionToTileXY(topLeftCorner, maxLevel);\n  const maxCornerXY = tilingScheme.positionToTileXY(\n    bottomRightCorner,\n    maxLevel\n  );\n\n  // Get all the tiles in between\n  for (let x = minCornerXY.x; x <= maxCornerXY.x; x++) {\n    for (let y = minCornerXY.y; y <= maxCornerXY.y; y++) {\n      const xy = Cartesian2.fromElements(x, y, scratchCartesian2);\n      const key = xy.toString();\n      if (!tileRequestSet.hasOwnProperty(key)) {\n        // When tile is requested for the first time\n        const value = {\n          x: xy.x,\n          y: xy.y,\n          level: maxLevel,\n          tilingScheme: tilingScheme,\n          terrainProvider: terrainProvider,\n          positions: [],\n        };\n        tileRequestSet[key] = value;\n        tileRequests.push(value);\n      }\n    }\n  }\n\n  // Send request for each required tile\n  const tilePromises = [];\n  for (let i = 0; i < tileRequests.length; ++i) {\n    const tileRequest = tileRequests[i];\n    const requestPromise = tileRequest.terrainProvider.requestTileGeometry(\n      tileRequest.x,\n      tileRequest.y,\n      tileRequest.level\n    );\n\n    tilePromises.push(requestPromise);\n  }\n\n  return Promise.all(tilePromises).then(function (heightMapBuffers) {\n    const heightMaps = [];\n    for (let i = 0; i < heightMapBuffers.length; i++) {\n      const options = {\n        tilingScheme: tilingScheme,\n        x: tileRequests[i].x,\n        y: tileRequests[i].y,\n        level: tileRequests[i].level,\n      };\n      const heightMap = heightMapBuffers[i];\n\n      let projectionType = \"Geographic\";\n      if (tilingScheme._projection instanceof WebMercatorProjection) {\n        projectionType = \"WebMercator\";\n      }\n\n      const heightMapData = {\n        projectionType: projectionType,\n        projection: tilingScheme._projection,\n        nativeExtent: tilingScheme.tileXYToNativeRectangle(\n          options.x,\n          options.y,\n          options.level\n        ),\n        height: heightMap._height,\n        width: heightMap._width,\n        scale: heightMap._structure.heightScale,\n        offset: heightMap._structure.heightOffset,\n      };\n\n      if (heightMap._encoding === HeightmapEncoding.LERC) {\n        const result = Lerc.decode(heightMap._buffer);\n        heightMapData.buffer = result.pixels[0];\n      } else {\n        heightMapData.buffer = heightMap._buffer;\n      }\n\n      heightMaps.push(heightMapData);\n    }\n\n    return heightMaps;\n  });\n}\n\nasync function loadGeoidData(provider) {\n  // Load tiles from arcgis\n  const geoidTerrainProvider = provider._geoidTiledTerrainProvider;\n\n  if (!defined(geoidTerrainProvider)) {\n    console.log(\n      \"No Geoid Terrain service provided - no geoid conversion will be performed.\"\n    );\n    return;\n  }\n\n  try {\n    const heightMaps = await getCoveredTiles(\n      geoidTerrainProvider,\n      provider._extent\n    );\n    provider._geoidDataList = heightMaps;\n  } catch (error) {\n    console.log(\n      \"Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.\"\n    );\n  }\n}\n\n/**\n * @private\n */\nI3SDataProvider.prototype.loadGeoidData = async function () {\n  if (defined(this._geoidDataPromise)) {\n    return this._geoidDataPromise;\n  }\n\n  this._geoidDataPromise = loadGeoidData(this);\n  return this._geoidDataPromise;\n};\n\n/**\n * @private\n */\nI3SDataProvider.prototype._computeExtent = function () {\n  let rectangle;\n\n  // Compute the extent from all layers\n  for (let layerIndex = 0; layerIndex < this._layers.length; layerIndex++) {\n    if (defined(this._layers[layerIndex]._extent)) {\n      const layerExtent = this._layers[layerIndex]._extent;\n      if (!defined(rectangle)) {\n        rectangle = Rectangle.clone(layerExtent);\n      } else {\n        Rectangle.union(rectangle, layerExtent, rectangle);\n      }\n    }\n  }\n\n  this._extent = rectangle;\n};\n\nexport default I3SDataProvider;\n", "const LoadState = Object.freeze({\n  UNLOADED: 0, // Has no data and is in dormant state\n  RECEIVING: 1, // Is waiting on data from the provider\n  RECEIVED: 2, // Received data from the provider\n  LOADED: 3, // Processed data from provider\n  FAILED: 4, // Failed to receive data from the provider\n  UNAVAILABLE: 5, // No data available for this tile\n});\n\n/**\n * @alias KeyframeNode\n * @constructor\n *\n * @param {SpatialNode} spatialNode\n * @param {number} keyframe\n *\n * @private\n */\nfunction KeyframeNode(spatialNode, keyframe) {\n  this.spatialNode = spatialNode;\n  this.keyframe = keyframe;\n  this.state = LoadState.UNLOADED;\n  this.metadatas = [];\n  this.megatextureIndex = -1;\n  this.priority = -Number.MAX_VALUE;\n  this.highPriorityFrameNumber = -1;\n}\n\n/**\n * @param {KeyframeNode} a\n * @param {KeyframeNode} b\n */\nKeyframeNode.priorityComparator = function (a, b) {\n  return a.priority - b.priority;\n};\n\n/**\n * @param {KeyframeNode} a\n * @param {KeyframeNode} b\n */\nKeyframeNode.searchComparator = function (a, b) {\n  return a.keyframe - b.keyframe;\n};\n\nKeyframeNode.LoadState = LoadState;\n\nexport default KeyframeNode;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * A light source. This type describes an interface and is not intended to be instantiated directly. Together, <code>color</code> and <code>intensity</code> produce a high-dynamic-range light color. <code>intensity</code> can also be used individually to dim or brighten the light without changing the hue.\n *\n * @alias Light\n * @constructor\n *\n * @see DirectionalLight\n * @see SunLight\n */\nfunction Light() {}\n\nObject.defineProperties(Light.prototype, {\n  /**\n   * The color of the light.\n   * @memberof Light.prototype\n   * @type {Color}\n   */\n  color: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * The intensity controls the strength of the light. <code>intensity</code> has a minimum value of 0.0 and no maximum value.\n   * @memberof Light.prototype\n   * @type {number}\n   */\n  intensity: {\n    get: DeveloperError.throwInstantiationError,\n  },\n});\n\nexport default Light;\n", "import Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Resource from \"../Core/Resource.js\";\nimport UrlTemplateImageryProvider from \"./UrlTemplateImageryProvider.js\";\n\nconst trailingSlashRegex = /\\/$/;\nconst defaultCredit = new Credit(\n  '&copy; <a href=\"https://www.mapbox.com/about/maps/\">Mapbox</a> &copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a> <strong><a href=\"https://www.mapbox.com/map-feedback/\">Improve this map</a></strong>'\n);\n\n/**\n * @typedef {object} MapboxStyleImageryProvider.ConstructorOptions\n *\n * Initialization options for the MapboxStyleImageryProvider constructor\n *\n * @property {Resource|string} [url='https://api.mapbox.com/styles/v1/'] The Mapbox server url.\n * @property {string} [username='mapbox'] The username of the map account.\n * @property {string} styleId The Mapbox Style ID.\n * @property {string} accessToken The public access token for the imagery.\n * @property {number} [tilesize=512] The size of the image tiles.\n * @property {boolean} [scaleFactor] Determines if tiles are rendered at a @2x scale factor.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If not specified, the WGS84 ellipsoid is used.\n * @property {number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider.  Take care when specifying\n *                 this that the number of tiles at the minimum level is small, such as four or less.  A larger number is likely\n *                 to result in rendering problems.\n * @property {number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.\n * @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.\n */\n\n/**\n * Provides tiled imagery hosted by Mapbox.\n *\n * @alias MapboxStyleImageryProvider\n * @constructor\n *\n * @param {MapboxStyleImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @example\n * // Mapbox style provider\n * const mapbox = new Cesium.MapboxStyleImageryProvider({\n *     styleId: 'streets-v11',\n *     accessToken: 'thisIsMyAccessToken'\n * });\n *\n * @see {@link https://docs.mapbox.com/api/maps/#styles}\n * @see {@link https://docs.mapbox.com/api/#access-tokens-and-token-scopes}\n */\nfunction MapboxStyleImageryProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const styleId = options.styleId;\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(styleId)) {\n    throw new DeveloperError(\"options.styleId is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const accessToken = options.accessToken;\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(accessToken)) {\n    throw new DeveloperError(\"options.accessToken is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._defaultAlpha = undefined;\n  this._defaultNightAlpha = undefined;\n  this._defaultDayAlpha = undefined;\n  this._defaultBrightness = undefined;\n  this._defaultContrast = undefined;\n  this._defaultHue = undefined;\n  this._defaultSaturation = undefined;\n  this._defaultGamma = undefined;\n  this._defaultMinificationFilter = undefined;\n  this._defaultMagnificationFilter = undefined;\n\n  const resource = Resource.createIfNeeded(\n    defaultValue(options.url, \"https://api.mapbox.com/styles/v1/\")\n  );\n\n  this._styleId = styleId;\n  this._accessToken = accessToken;\n\n  const tilesize = defaultValue(options.tilesize, 512);\n  this._tilesize = tilesize;\n\n  const username = defaultValue(options.username, \"mapbox\");\n  this._username = username;\n\n  const scaleFactor = defined(options.scaleFactor) ? \"@2x\" : \"\";\n\n  let templateUrl = resource.getUrlComponent();\n  if (!trailingSlashRegex.test(templateUrl)) {\n    templateUrl += \"/\";\n  }\n  templateUrl += `${this._username}/${styleId}/tiles/${this._tilesize}/{z}/{x}/{y}${scaleFactor}`;\n  resource.url = templateUrl;\n\n  resource.setQueryParameters({\n    access_token: accessToken,\n  });\n\n  let credit;\n  if (defined(options.credit)) {\n    credit = options.credit;\n    if (typeof credit === \"string\") {\n      credit = new Credit(credit);\n    }\n  } else {\n    credit = defaultCredit;\n  }\n\n  this._resource = resource;\n  this._imageryProvider = new UrlTemplateImageryProvider({\n    url: resource,\n    credit: credit,\n    ellipsoid: options.ellipsoid,\n    minimumLevel: options.minimumLevel,\n    maximumLevel: options.maximumLevel,\n    rectangle: options.rectangle,\n  });\n}\n\nObject.defineProperties(MapboxStyleImageryProvider.prototype, {\n  /**\n   * Gets the URL of the Mapbox server.\n   * @memberof MapboxStyleImageryProvider.prototype\n   * @type {string}\n   * @readonly\n   */\n  url: {\n    get: function () {\n      return this._imageryProvider.url;\n    },\n  },\n\n  /**\n   * Gets the rectangle, in radians, of the imagery provided by the instance.\n   * @memberof MapboxStyleImageryProvider.prototype\n   * @type {Rectangle}\n   * @readonly\n   */\n  rectangle: {\n    get: function () {\n      return this._imageryProvider.rectangle;\n    },\n  },\n\n  /**\n   * Gets the width of each tile, in pixels.\n   * @memberof MapboxStyleImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileWidth: {\n    get: function () {\n      return this._imageryProvider.tileWidth;\n    },\n  },\n\n  /**\n   * Gets the height of each tile, in pixels.\n   * @memberof MapboxStyleImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileHeight: {\n    get: function () {\n      return this._imageryProvider.tileHeight;\n    },\n  },\n\n  /**\n   * Gets the maximum level-of-detail that can be requested.\n   * @memberof MapboxStyleImageryProvider.prototype\n   * @type {number|undefined}\n   * @readonly\n   */\n  maximumLevel: {\n    get: function () {\n      return this._imageryProvider.maximumLevel;\n    },\n  },\n\n  /**\n   * Gets the minimum level-of-detail that can be requested. Generally,\n   * a minimum level should only be used when the rectangle of the imagery is small\n   * enough that the number of tiles at the minimum level is small.  An imagery\n   * provider with more than a few tiles at the minimum level will lead to\n   * rendering problems.\n   * @memberof MapboxStyleImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  minimumLevel: {\n    get: function () {\n      return this._imageryProvider.minimumLevel;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by the provider.\n   * @memberof MapboxStyleImageryProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._imageryProvider.tilingScheme;\n    },\n  },\n\n  /**\n   * Gets the tile discard policy.  If not undefined, the discard policy is responsible\n   * for filtering out \"missing\" tiles via its shouldDiscardImage function.  If this function\n   * returns undefined, no tiles are filtered.\n   * @memberof MapboxStyleImageryProvider.prototype\n   * @type {TileDiscardPolicy}\n   * @readonly\n   */\n  tileDiscardPolicy: {\n    get: function () {\n      return this._imageryProvider.tileDiscardPolicy;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error..  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof MapboxStyleImageryProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._imageryProvider.errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this imagery provider is active.  Typically this is used to credit\n   * the source of the imagery.\n   * @memberof MapboxStyleImageryProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return this._imageryProvider.credit;\n    },\n  },\n\n  /**\n   * Gets the proxy used by this provider.\n   * @memberof MapboxStyleImageryProvider.prototype\n   * @type {Proxy}\n   * @readonly\n   */\n  proxy: {\n    get: function () {\n      return this._imageryProvider.proxy;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the images provided by this imagery provider\n   * include an alpha channel.  If this property is false, an alpha channel, if present, will\n   * be ignored.  If this property is true, any images without an alpha channel will be treated\n   * as if their alpha is 1.0 everywhere.  When this property is false, memory usage\n   * and texture upload time are reduced.\n   * @memberof MapboxStyleImageryProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasAlphaChannel: {\n    get: function () {\n      return this._imageryProvider.hasAlphaChannel;\n    },\n  },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n */\nMapboxStyleImageryProvider.prototype.getTileCredits = function (x, y, level) {\n  return undefined;\n};\n\n/**\n * Requests the image for a given tile.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n *          undefined if there are too many active requests to the server, and the request should be retried later.\n */\nMapboxStyleImageryProvider.prototype.requestImage = function (\n  x,\n  y,\n  level,\n  request\n) {\n  return this._imageryProvider.requestImage(x, y, level, request);\n};\n\n/**\n * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n * a tile. This function is optional, so it may not exist on all ImageryProviders.\n *\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {number} longitude The longitude at which to pick features.\n * @param {number} latitude  The latitude at which to pick features.\n * @return {Promise<ImageryLayerFeatureInfo[]>|undefined} A promise for the picked features that will resolve when the asynchronous\n *                   picking completes.  The resolved value is an array of {@link ImageryLayerFeatureInfo}\n *                   instances.  The array may be empty if no features are found at the given location.\n *                   It may also be undefined if picking is not supported.\n */\nMapboxStyleImageryProvider.prototype.pickFeatures = function (\n  x,\n  y,\n  level,\n  longitude,\n  latitude\n) {\n  return this._imageryProvider.pickFeatures(x, y, level, longitude, latitude);\n};\n\n// Exposed for tests\nMapboxStyleImageryProvider._defaultCredit = defaultCredit;\nexport default MapboxStyleImageryProvider;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport MetadataComponentType from \"./MetadataComponentType.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\n\n/**\n * @alias Megatexture\n * @constructor\n *\n * @param {Context} context\n * @param {Cartesian3} dimensions\n * @param {number} channelCount\n * @param {MetadataComponentType} componentType\n * @param {number} [textureMemoryByteLength]\n *\n * @private\n */\nfunction Megatexture(\n  context,\n  dimensions,\n  channelCount,\n  componentType,\n  textureMemoryByteLength\n) {\n  // TODO there are a lot of texture packing rules, see https://github.com/CesiumGS/cesium/issues/9572\n  // Unsigned short textures not allowed in webgl 1, so treat as float\n  if (componentType === MetadataComponentType.UNSIGNED_SHORT) {\n    componentType = MetadataComponentType.FLOAT32;\n  }\n\n  const supportsFloatingPointTexture = context.floatingPointTexture;\n  if (\n    componentType === MetadataComponentType.FLOAT32 &&\n    !supportsFloatingPointTexture\n  ) {\n    throw new RuntimeError(\"Floating point texture not supported\");\n  }\n\n  // TODO support more\n  let pixelType;\n  if (\n    componentType === MetadataComponentType.FLOAT32 ||\n    componentType === MetadataComponentType.FLOAT64\n  ) {\n    pixelType = PixelDatatype.FLOAT;\n  } else if (componentType === MetadataComponentType.UINT8) {\n    pixelType = PixelDatatype.UNSIGNED_BYTE;\n  }\n\n  let pixelFormat;\n  if (channelCount === 1) {\n    pixelFormat = context.webgl2 ? PixelFormat.RED : PixelFormat.LUMINANCE;\n  } else if (channelCount === 2) {\n    pixelFormat = context.webgl2 ? PixelFormat.RG : PixelFormat.LUMINANCE_ALPHA;\n  } else if (channelCount === 3) {\n    pixelFormat = PixelFormat.RGB;\n  } else if (channelCount === 4) {\n    pixelFormat = PixelFormat.RGBA;\n  }\n\n  const maximumTextureMemoryByteLength = 512 * 1024 * 1024;\n  const defaultTextureMemoryByteLength = 128 * 1024 * 1024;\n  textureMemoryByteLength = Math.min(\n    defaultValue(textureMemoryByteLength, defaultTextureMemoryByteLength),\n    maximumTextureMemoryByteLength\n  );\n  const maximumTextureDimensionContext = ContextLimits.maximumTextureSize;\n  const componentTypeByteLength = MetadataComponentType.getSizeInBytes(\n    componentType\n  );\n  const texelCount = Math.floor(\n    textureMemoryByteLength / (channelCount * componentTypeByteLength)\n  );\n  const textureDimension = Math.min(\n    maximumTextureDimensionContext,\n    CesiumMath.previousPowerOfTwo(Math.floor(Math.sqrt(texelCount)))\n  );\n\n  const sliceCountPerRegionX = Math.ceil(Math.sqrt(dimensions.x));\n  const sliceCountPerRegionY = Math.ceil(dimensions.z / sliceCountPerRegionX);\n  const voxelCountPerRegionX = sliceCountPerRegionX * dimensions.x;\n  const voxelCountPerRegionY = sliceCountPerRegionY * dimensions.y;\n  const regionCountPerMegatextureX = Math.floor(\n    textureDimension / voxelCountPerRegionX\n  );\n  const regionCountPerMegatextureY = Math.floor(\n    textureDimension / voxelCountPerRegionY\n  );\n\n  if (regionCountPerMegatextureX === 0 || regionCountPerMegatextureY === 0) {\n    throw new RuntimeError(\"Tileset is too large to fit into megatexture\");\n  }\n\n  /**\n   * @type {number}\n   * @readonly\n   */\n  this.channelCount = channelCount;\n\n  /**\n   * @type {MetadataComponentType}\n   * @readonly\n   */\n  this.componentType = componentType;\n\n  /**\n   * @type {Cartesian3}\n   * @readonly\n   */\n  this.voxelCountPerTile = Cartesian3.clone(dimensions, new Cartesian3());\n\n  /**\n   * @type {number}\n   * @readonly\n   */\n  this.maximumTileCount =\n    regionCountPerMegatextureX * regionCountPerMegatextureY;\n\n  /**\n   * @type {Cartesian2}\n   * @readonly\n   */\n  this.regionCountPerMegatexture = new Cartesian2(\n    regionCountPerMegatextureX,\n    regionCountPerMegatextureY\n  );\n\n  /**\n   * @type {Cartesian2}\n   * @readonly\n   */\n  this.voxelCountPerRegion = new Cartesian2(\n    voxelCountPerRegionX,\n    voxelCountPerRegionY\n  );\n\n  /**\n   * @type {Cartesian2}\n   * @readonly\n   */\n  this.sliceCountPerRegion = new Cartesian2(\n    sliceCountPerRegionX,\n    sliceCountPerRegionY\n  );\n\n  /**\n   * @type {Cartesian2}\n   * @readonly\n   */\n  this.voxelSizeUv = new Cartesian2(\n    1.0 / textureDimension,\n    1.0 / textureDimension\n  );\n\n  /**\n   * @type {Cartesian2}\n   * @readonly\n   */\n  this.sliceSizeUv = new Cartesian2(\n    dimensions.x / textureDimension,\n    dimensions.y / textureDimension\n  );\n\n  /**\n   * @type {Cartesian2}\n   * @readonly\n   */\n  this.regionSizeUv = new Cartesian2(\n    voxelCountPerRegionX / textureDimension,\n    voxelCountPerRegionY / textureDimension\n  );\n\n  /**\n   * @type {Texture}\n   * @readonly\n   */\n  this.texture = new Texture({\n    context: context,\n    pixelFormat: pixelFormat,\n    pixelDatatype: pixelType,\n    flipY: false,\n    width: textureDimension,\n    height: textureDimension,\n    sampler: new Sampler({\n      wrapS: TextureWrap.CLAMP_TO_EDGE,\n      wrapT: TextureWrap.CLAMP_TO_EDGE,\n      minificationFilter: TextureMinificationFilter.LINEAR,\n      magnificationFilter: TextureMagnificationFilter.LINEAR,\n    }),\n  });\n\n  const componentDatatype = MetadataComponentType.toComponentDatatype(\n    componentType\n  );\n\n  /**\n   * @type {Array}\n   */\n  this.tileVoxelDataTemp = ComponentDatatype.createTypedArray(\n    componentDatatype,\n    voxelCountPerRegionX * voxelCountPerRegionY * channelCount\n  );\n\n  /**\n   * @type {MegatextureNode[]}\n   * @readonly\n   */\n  this.nodes = new Array(this.maximumTileCount);\n  for (let tileIndex = 0; tileIndex < this.maximumTileCount; tileIndex++) {\n    this.nodes[tileIndex] = new MegatextureNode(tileIndex);\n  }\n  for (let tileIndex = 0; tileIndex < this.maximumTileCount; tileIndex++) {\n    const node = this.nodes[tileIndex];\n    node.previousNode = tileIndex > 0 ? this.nodes[tileIndex - 1] : undefined;\n    node.nextNode =\n      tileIndex < this.maximumTileCount - 1\n        ? this.nodes[tileIndex + 1]\n        : undefined;\n  }\n\n  /**\n   * @type {MegatextureNode}\n   * @readonly\n   */\n  this.occupiedList = undefined;\n\n  /**\n   * @type {MegatextureNode}\n   * @readonly\n   */\n  this.emptyList = this.nodes[0];\n\n  /**\n   * @type {number}\n   * @readonly\n   */\n  this.occupiedCount = 0;\n}\n\n/**\n * @alias MegatextureNode\n * @constructor\n *\n * @param {number} index\n *\n * @private\n */\nfunction MegatextureNode(index) {\n  /**\n   * @type {number}\n   */\n  this.index = index;\n\n  /**\n   * @type {MegatextureNode}\n   */\n  this.nextNode = undefined;\n\n  /**\n   * @type {MegatextureNode}\n   */\n  this.previousNode = undefined;\n}\n\n/**\n * @param {Array} data\n * @returns {number}\n */\nMegatexture.prototype.add = function (data) {\n  if (this.isFull()) {\n    throw new DeveloperError(\"Trying to add when there are no empty spots\");\n  }\n\n  // remove head of empty list\n  const node = this.emptyList;\n  this.emptyList = this.emptyList.nextNode;\n  if (defined(this.emptyList)) {\n    this.emptyList.previousNode = undefined;\n  }\n\n  // make head of occupied list\n  node.nextNode = this.occupiedList;\n  if (defined(node.nextNode)) {\n    node.nextNode.previousNode = node;\n  }\n  this.occupiedList = node;\n\n  const index = node.index;\n  this.writeDataToTexture(index, data);\n\n  this.occupiedCount++;\n  return index;\n};\n\n/**\n * @param {number} index\n */\nMegatexture.prototype.remove = function (index) {\n  if (index < 0 || index >= this.maximumTileCount) {\n    throw new DeveloperError(\"Megatexture index out of bounds\");\n  }\n\n  // remove from list\n  const node = this.nodes[index];\n  if (defined(node.previousNode)) {\n    node.previousNode.nextNode = node.nextNode;\n  }\n  if (defined(node.nextNode)) {\n    node.nextNode.previousNode = node.previousNode;\n  }\n\n  // make head of empty list\n  node.nextNode = this.emptyList;\n  if (defined(node.nextNode)) {\n    node.nextNode.previousNode = node;\n  }\n  node.previousNode = undefined;\n  this.emptyList = node;\n  this.occupiedCount--;\n};\n\n/**\n * @returns {boolean}\n */\nMegatexture.prototype.isFull = function () {\n  return this.emptyList === undefined;\n};\n\n/**\n * @param {number} tileCount\n * @param {Cartesian3} dimensions\n * @param {number} channelCount number of channels in the metadata. Must be 1 to 4.\n * @param {MetadataComponentType} componentType\n * @returns {number}\n */\nMegatexture.getApproximateTextureMemoryByteLength = function (\n  tileCount,\n  dimensions,\n  channelCount,\n  componentType\n) {\n  // TODO there's a lot of code duplicate with Megatexture constructor\n\n  // Unsigned short textures not allowed in webgl 1, so treat as float\n  if (componentType === MetadataComponentType.UNSIGNED_SHORT) {\n    componentType = MetadataComponentType.FLOAT32;\n  }\n\n  const datatypeSizeInBytes = MetadataComponentType.getSizeInBytes(\n    componentType\n  );\n  const voxelCountTotal =\n    tileCount * dimensions.x * dimensions.y * dimensions.z;\n\n  const sliceCountPerRegionX = Math.ceil(Math.sqrt(dimensions.x));\n  const sliceCountPerRegionY = Math.ceil(dimensions.z / sliceCountPerRegionX);\n  const voxelCountPerRegionX = sliceCountPerRegionX * dimensions.x;\n  const voxelCountPerRegionY = sliceCountPerRegionY * dimensions.y;\n\n  // Find the power of two that can fit all tile data, accounting for slices.\n  // There's probably a non-iterative solution for this, but this is good enough for now.\n  let textureDimension = CesiumMath.previousPowerOfTwo(\n    Math.floor(Math.sqrt(voxelCountTotal))\n  );\n  for (;;) {\n    const regionCountX = Math.floor(textureDimension / voxelCountPerRegionX);\n    const regionCountY = Math.floor(textureDimension / voxelCountPerRegionY);\n    const regionCount = regionCountX * regionCountY;\n    if (regionCount >= tileCount) {\n      break;\n    } else {\n      textureDimension *= 2;\n    }\n  }\n\n  const textureMemoryByteLength =\n    textureDimension * textureDimension * channelCount * datatypeSizeInBytes;\n  return textureMemoryByteLength;\n};\n\n/**\n * @param {number} index\n * @param {Float32Array|Uint16Array|Uint8Array} data\n */\nMegatexture.prototype.writeDataToTexture = function (index, data) {\n  // Unsigned short textures not allowed in webgl 1, so treat as float\n  const tileData =\n    data.constructor === Uint16Array ? new Float32Array(data) : data;\n\n  const voxelDimensionsPerTile = this.voxelCountPerTile;\n  const sliceDimensionsPerRegion = this.sliceCountPerRegion;\n  const voxelDimensionsPerRegion = this.voxelCountPerRegion;\n  const channelCount = this.channelCount;\n\n  const tileVoxelData = this.tileVoxelDataTemp;\n  for (let z = 0; z < voxelDimensionsPerTile.z; z++) {\n    const sliceVoxelOffsetX =\n      (z % sliceDimensionsPerRegion.x) * voxelDimensionsPerTile.x;\n    const sliceVoxelOffsetY =\n      Math.floor(z / sliceDimensionsPerRegion.x) * voxelDimensionsPerTile.y;\n    for (let y = 0; y < voxelDimensionsPerTile.y; y++) {\n      for (let x = 0; x < voxelDimensionsPerTile.x; x++) {\n        const readIndex =\n          z * voxelDimensionsPerTile.y * voxelDimensionsPerTile.x +\n          y * voxelDimensionsPerTile.x +\n          x;\n        const writeIndex =\n          (sliceVoxelOffsetY + y) * voxelDimensionsPerRegion.x +\n          (sliceVoxelOffsetX + x);\n        for (let c = 0; c < channelCount; c++) {\n          tileVoxelData[writeIndex * channelCount + c] =\n            tileData[readIndex * channelCount + c];\n        }\n      }\n    }\n  }\n\n  const regionDimensionsPerMegatexture = this.regionCountPerMegatexture;\n  const voxelWidth = voxelDimensionsPerRegion.x;\n  const voxelHeight = voxelDimensionsPerRegion.y;\n  const voxelOffsetX =\n    (index % regionDimensionsPerMegatexture.x) * voxelDimensionsPerRegion.x;\n  const voxelOffsetY =\n    Math.floor(index / regionDimensionsPerMegatexture.x) *\n    voxelDimensionsPerRegion.y;\n\n  const source = {\n    arrayBufferView: tileVoxelData,\n    width: voxelWidth,\n    height: voxelHeight,\n  };\n\n  const copyOptions = {\n    source: source,\n    xOffset: voxelOffsetX,\n    yOffset: voxelOffsetY,\n  };\n\n  this.texture.copyFrom(copyOptions);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see Megatexture#destroy\n */\nMegatexture.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see Megatexture#isDestroyed\n *\n * @example\n * megatexture = megatexture && megatexture.destroy();\n */\nMegatexture.prototype.destroy = function () {\n  this.texture = this.texture && this.texture.destroy();\n  return destroyObject(this);\n};\n\nexport default Megatexture;\n", "/**\n * A {@link TileDiscardPolicy} specifying that tile images should never be discard.\n *\n * @alias NeverTileDiscardPolicy\n * @constructor\n *\n * @see DiscardMissingTileImagePolicy\n */\nfunction NeverTileDiscardPolicy(options) {}\n\n/**\n * Determines if the discard policy is ready to process images.\n * @returns {boolean} True if the discard policy is ready to process images; otherwise, false.\n */\nNeverTileDiscardPolicy.prototype.isReady = function () {\n  return true;\n};\n\n/**\n * Given a tile image, decide whether to discard that image.\n *\n * @param {HTMLImageElement} image An image to test.\n * @returns {boolean} True if the image should be discarded; otherwise, false.\n */\nNeverTileDiscardPolicy.prototype.shouldDiscardImage = function (image) {\n  return false;\n};\nexport default NeverTileDiscardPolicy;\n", "import Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport WebMercatorTilingScheme from \"../Core/WebMercatorTilingScheme.js\";\nimport UrlTemplateImageryProvider from \"./UrlTemplateImageryProvider.js\";\n\nconst defaultCredit = new Credit(\n  \"MapQuest, Open Street Map and contributors, CC-BY-SA\"\n);\n\n/**\n * @typedef {object} OpenStreetMapImageryProvider.ConstructorOptions\n *\n * Initialization options for the OpenStreetMapImageryProvider constructor\n *\n * @property {string} [url='https://tile.openstreetmap.org'] The OpenStreetMap server url.\n * @property {string} [fileExtension='png'] The file extension for images on the server.\n * @property {boolean} [retinaTiles=false] When true, request tiles at the 2x resolution for retina displays.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle of the layer.\n * @property {number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider.\n * @property {number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If not specified, the WGS84 ellipsoid is used.\n * @property {Credit|string} [credit='MapQuest, Open Street Map and contributors, CC-BY-SA'] A credit for the data source, which is displayed on the canvas.\n */\n\n/**\n * An imagery provider that provides tiled imagery hosted by OpenStreetMap\n * or another provider of Slippy tiles.  The default url connects to OpenStreetMap's volunteer-run\n * servers, so you must conform to their\n * {@link http://wiki.openstreetmap.org/wiki/Tile_usage_policy|Tile Usage Policy}.\n *\n * @alias OpenStreetMapImageryProvider\n * @constructor\n * @extends UrlTemplateImageryProvider\n *\n * @param {OpenStreetMapImageryProvider.ConstructorOptions} options Object describing initialization options\n * @exception {DeveloperError} The rectangle and minimumLevel indicate that there are more than four tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see SingleTileImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n * @see UrlTemplateImageryProvider\n *\n * @example\n * const osm = new Cesium.OpenStreetMapImageryProvider({\n *     url : 'https://tile.openstreetmap.org/'\n * });\n *\n * @see {@link http://wiki.openstreetmap.org/wiki/Main_Page|OpenStreetMap Wiki}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n */\nfunction OpenStreetMapImageryProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const resource = Resource.createIfNeeded(\n    defaultValue(options.url, \"https://tile.openstreetmap.org/\")\n  );\n  resource.appendForwardSlash();\n  resource.url += `{z}/{x}/{y}${\n    options.retinaTiles ? \"@2x\" : \"\"\n  }.${defaultValue(options.fileExtension, \"png\")}`;\n\n  const tilingScheme = new WebMercatorTilingScheme({\n    ellipsoid: options.ellipsoid,\n  });\n\n  const tileWidth = 256;\n  const tileHeight = 256;\n\n  const minimumLevel = defaultValue(options.minimumLevel, 0);\n  const maximumLevel = options.maximumLevel;\n\n  const rectangle = defaultValue(options.rectangle, tilingScheme.rectangle);\n\n  // Check the number of tiles at the minimum level.  If it's more than four,\n  // throw an exception, because starting at the higher minimum\n  // level will cause too many tiles to be downloaded and rendered.\n  const swTile = tilingScheme.positionToTileXY(\n    Rectangle.southwest(rectangle),\n    minimumLevel\n  );\n  const neTile = tilingScheme.positionToTileXY(\n    Rectangle.northeast(rectangle),\n    minimumLevel\n  );\n  const tileCount =\n    (Math.abs(neTile.x - swTile.x) + 1) * (Math.abs(neTile.y - swTile.y) + 1);\n  //>>includeStart('debug', pragmas.debug);\n  if (tileCount > 4) {\n    throw new DeveloperError(\n      `The rectangle and minimumLevel indicate that there are ${tileCount} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`\n    );\n  }\n  //>>includeEnd('debug');\n\n  let credit = defaultValue(options.credit, defaultCredit);\n  if (typeof credit === \"string\") {\n    credit = new Credit(credit);\n  }\n\n  UrlTemplateImageryProvider.call(this, {\n    url: resource,\n    credit: credit,\n    tilingScheme: tilingScheme,\n    tileWidth: tileWidth,\n    tileHeight: tileHeight,\n    minimumLevel: minimumLevel,\n    maximumLevel: maximumLevel,\n    rectangle: rectangle,\n  });\n}\n\nif (defined(Object.create)) {\n  OpenStreetMapImageryProvider.prototype = Object.create(\n    UrlTemplateImageryProvider.prototype\n  );\n  OpenStreetMapImageryProvider.prototype.constructor = OpenStreetMapImageryProvider;\n}\n\nexport default OpenStreetMapImageryProvider;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\n\nconst defaultSize = new Cartesian2(1.0, 1.0);\n\n/**\n * A particle emitted by a {@link ParticleSystem}.\n *\n * @alias Particle\n * @constructor\n *\n * @param {object} options An object with the following properties:\n * @param {number} [options.mass=1.0] The mass of the particle in kilograms.\n * @param {Cartesian3} [options.position=Cartesian3.ZERO] The initial position of the particle in world coordinates.\n * @param {Cartesian3} [options.velocity=Cartesian3.ZERO] The velocity vector of the particle in world coordinates.\n * @param {number} [options.life=Number.MAX_VALUE] The life of the particle in seconds.\n * @param {object} [options.image] The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.\n * @param {Color} [options.startColor=Color.WHITE] The color of a particle when it is born.\n * @param {Color} [options.endColor=Color.WHITE] The color of a particle when it dies.\n * @param {number} [options.startScale=1.0] The scale of the particle when it is born.\n * @param {number} [options.endScale=1.0] The scale of the particle when it dies.\n * @param {Cartesian2} [options.imageSize=new Cartesian2(1.0, 1.0)] The dimensions, width by height, to scale the particle image in pixels.\n */\nfunction Particle(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * The mass of the particle in kilograms.\n   * @type {number}\n   * @default 1.0\n   */\n  this.mass = defaultValue(options.mass, 1.0);\n  /**\n   * The positon of the particle in world coordinates.\n   * @type {Cartesian3}\n   * @default Cartesian3.ZERO\n   */\n  this.position = Cartesian3.clone(\n    defaultValue(options.position, Cartesian3.ZERO)\n  );\n  /**\n   * The velocity of the particle in world coordinates.\n   * @type {Cartesian3}\n   * @default Cartesian3.ZERO\n   */\n  this.velocity = Cartesian3.clone(\n    defaultValue(options.velocity, Cartesian3.ZERO)\n  );\n  /**\n   * The life of the particle in seconds.\n   * @type {number}\n   * @default Number.MAX_VALUE\n   */\n  this.life = defaultValue(options.life, Number.MAX_VALUE);\n  /**\n   * The image to use for the particle.\n   * @type {object}\n   * @default undefined\n   */\n  this.image = options.image;\n  /**\n   * The color of the particle when it is born.\n   * @type {Color}\n   * @default Color.WHITE\n   */\n  this.startColor = Color.clone(defaultValue(options.startColor, Color.WHITE));\n  /**\n   * The color of the particle when it dies.\n   * @type {Color}\n   * @default Color.WHITE\n   */\n  this.endColor = Color.clone(defaultValue(options.endColor, Color.WHITE));\n  /**\n   * the scale of the particle when it is born.\n   * @type {number}\n   * @default 1.0\n   */\n  this.startScale = defaultValue(options.startScale, 1.0);\n  /**\n   * The scale of the particle when it dies.\n   * @type {number}\n   * @default 1.0\n   */\n  this.endScale = defaultValue(options.endScale, 1.0);\n  /**\n   * The dimensions, width by height, to scale the particle image in pixels.\n   * @type {Cartesian2}\n   * @default new Cartesian(1.0, 1.0)\n   */\n  this.imageSize = Cartesian2.clone(\n    defaultValue(options.imageSize, defaultSize)\n  );\n\n  this._age = 0.0;\n  this._normalizedAge = 0.0;\n\n  // used by ParticleSystem\n  this._billboard = undefined;\n}\n\nObject.defineProperties(Particle.prototype, {\n  /**\n   * Gets the age of the particle in seconds.\n   * @memberof Particle.prototype\n   * @type {number}\n   */\n  age: {\n    get: function () {\n      return this._age;\n    },\n  },\n  /**\n   * Gets the age normalized to a value in the range [0.0, 1.0].\n   * @memberof Particle.prototype\n   * @type {number}\n   */\n  normalizedAge: {\n    get: function () {\n      return this._normalizedAge;\n    },\n  },\n});\n\nconst deltaScratch = new Cartesian3();\n\n/**\n * @private\n */\nParticle.prototype.update = function (dt, particleUpdateFunction) {\n  // Apply the velocity\n  Cartesian3.multiplyByScalar(this.velocity, dt, deltaScratch);\n  Cartesian3.add(this.position, deltaScratch, this.position);\n\n  // Update any forces.\n  if (defined(particleUpdateFunction)) {\n    particleUpdateFunction(this, dt);\n  }\n\n  // Age the particle\n  this._age += dt;\n\n  // Compute the normalized age.\n  if (this.life === Number.MAX_VALUE) {\n    this._normalizedAge = 0.0;\n  } else {\n    this._normalizedAge = this._age / this.life;\n  }\n\n  // If this particle is older than it's lifespan then die.\n  return this._age <= this.life;\n};\nexport default Particle;\n", "import defaultValue from \"../Core/defaultValue.js\";\n\n/**\n * Represents a burst of {@link Particle}s from a {@link ParticleSystem} at a given time in the systems lifetime.\n *\n * @alias ParticleBurst\n * @constructor\n *\n * @param {object} [options] An object with the following properties:\n * @param {number} [options.time=0.0] The time in seconds after the beginning of the particle system's lifetime that the burst will occur.\n * @param {number} [options.minimum=0.0] The minimum number of particles emmitted in the burst.\n * @param {number} [options.maximum=50.0] The maximum number of particles emitted in the burst.\n */\nfunction ParticleBurst(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * The time in seconds after the beginning of the particle system's lifetime that the burst will occur.\n   * @type {number}\n   * @default 0.0\n   */\n  this.time = defaultValue(options.time, 0.0);\n  /**\n   * The minimum number of particles emitted.\n   * @type {number}\n   * @default 0.0\n   */\n  this.minimum = defaultValue(options.minimum, 0.0);\n  /**\n   * The maximum number of particles emitted.\n   * @type {number}\n   * @default 50.0\n   */\n  this.maximum = defaultValue(options.maximum, 50.0);\n\n  this._complete = false;\n}\n\nObject.defineProperties(ParticleBurst.prototype, {\n  /**\n   * <code>true</code> if the burst has been completed; <code>false</code> otherwise.\n   * @memberof ParticleBurst.prototype\n   * @type {boolean}\n   */\n  complete: {\n    get: function () {\n      return this._complete;\n    },\n  },\n});\nexport default ParticleBurst;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * <p>\n * An object that initializes a {@link Particle} from a {@link ParticleSystem}.\n * </p>\n * <p>\n * This type describes an interface and is not intended to be instantiated directly.\n * </p>\n *\n * @alias ParticleEmitter\n * @constructor\n *\n * @see BoxEmitter\n * @see CircleEmitter\n * @see ConeEmitter\n * @see SphereEmitter\n */\nfunction ParticleEmitter(options) {\n  //>>includeStart('debug', pragmas.debug);\n  throw new DeveloperError(\n    \"This type should not be instantiated directly.  Instead, use BoxEmitter, CircleEmitter, ConeEmitter or SphereEmitter.\"\n  );\n  //>>includeEnd('debug');\n}\n\n/**\n * Initializes the given {Particle} by setting it's position and velocity.\n *\n * @private\n * @param {Particle} The particle to initialize\n */\nParticleEmitter.prototype.emit = function (particle) {\n  DeveloperError.throwInstantiationError();\n};\nexport default ParticleEmitter;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Event from \"../Core/Event.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport BillboardCollection from \"./BillboardCollection.js\";\nimport CircleEmitter from \"./CircleEmitter.js\";\nimport Particle from \"./Particle.js\";\n\nconst defaultImageSize = new Cartesian2(1.0, 1.0);\n\n/**\n * A ParticleSystem manages the updating and display of a collection of particles.\n *\n * @alias ParticleSystem\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {boolean} [options.show=true] Whether to display the particle system.\n * @param {ParticleSystem.updateCallback} [options.updateCallback] The callback function to be called each frame to update a particle.\n * @param {ParticleEmitter} [options.emitter=new CircleEmitter(0.5)] The particle emitter for this system.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the particle system from model to world coordinates.\n * @param {Matrix4} [options.emitterModelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.\n * @param {number} [options.emissionRate=5] The number of particles to emit per second.\n * @param {ParticleBurst[]} [options.bursts] An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.\n * @param {boolean} [options.loop=true] Whether the particle system should loop its bursts when it is complete.\n * @param {number} [options.scale=1.0] Sets the scale to apply to the image of the particle for the duration of its particleLife.\n * @param {number} [options.startScale] The initial scale to apply to the image of the particle at the beginning of its life.\n * @param {number} [options.endScale] The final scale to apply to the image of the particle at the end of its life.\n * @param {Color} [options.color=Color.WHITE] Sets the color of a particle for the duration of its particleLife.\n * @param {Color} [options.startColor] The color of the particle at the beginning of its life.\n * @param {Color} [options.endColor] The color of the particle at the end of its life.\n * @param {object} [options.image] The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.\n * @param {Cartesian2} [options.imageSize=new Cartesian2(1.0, 1.0)] If set, overrides the minimumImageSize and maximumImageSize inputs that scale the particle image's dimensions in pixels.\n * @param {Cartesian2} [options.minimumImageSize] Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.\n * @param {Cartesian2} [options.maximumImageSize] Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.\n * @param {boolean} [options.sizeInMeters] Sets if the size of particles is in meters or pixels. <code>true</code> to size the particles in meters; otherwise, the size is in pixels.\n * @param {number} [options.speed=1.0] If set, overrides the minimumSpeed and maximumSpeed inputs with this value.\n * @param {number} [options.minimumSpeed] Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.\n * @param {number} [options.maximumSpeed] Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.\n * @param {number} [options.lifetime=Number.MAX_VALUE] How long the particle system will emit particles, in seconds.\n * @param {number} [options.particleLife=5.0] If set, overrides the minimumParticleLife and maximumParticleLife inputs with this value.\n * @param {number} [options.minimumParticleLife] Sets the minimum bound in seconds for the possible duration of a particle's life above which a particle's actual life will be randomly chosen.\n * @param {number} [options.maximumParticleLife] Sets the maximum bound in seconds for the possible duration of a particle's life below which a particle's actual life will be randomly chosen.\n * @param {number} [options.mass=1.0] Sets the minimum and maximum mass of particles in kilograms.\n * @param {number} [options.minimumMass] Sets the minimum bound for the mass of a particle in kilograms. A particle's actual mass will be chosen as a random amount above this value.\n * @param {number} [options.maximumMass] Sets the maximum mass of particles in kilograms. A particle's actual mass will be chosen as a random amount below this value.\n * @demo {@link https://cesium.com/learn/cesiumjs-learn/cesiumjs-particle-systems/|Particle Systems Tutorial}\n * @demo {@link https://sandcastle.cesium.com/?src=Particle%20System.html&label=Showcases|Particle Systems Tutorial Demo}\n * @demo {@link https://sandcastle.cesium.com/?src=Particle%20System%20Fireworks.html&label=Showcases|Particle Systems Fireworks Demo}\n */\nfunction ParticleSystem(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * Whether to display the particle system.\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  /**\n   * An array of force callbacks. The callback is passed a {@link Particle} and the difference from the last time\n   * @type {ParticleSystem.updateCallback}\n   * @default undefined\n   */\n  this.updateCallback = options.updateCallback;\n\n  /**\n   * Whether the particle system should loop it's bursts when it is complete.\n   * @type {boolean}\n   * @default true\n   */\n  this.loop = defaultValue(options.loop, true);\n\n  /**\n   * The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.\n   * @type {object}\n   * @default undefined\n   */\n  this.image = defaultValue(options.image, undefined);\n\n  let emitter = options.emitter;\n  if (!defined(emitter)) {\n    emitter = new CircleEmitter(0.5);\n  }\n  this._emitter = emitter;\n\n  this._bursts = options.bursts;\n\n  this._modelMatrix = Matrix4.clone(\n    defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n  );\n  this._emitterModelMatrix = Matrix4.clone(\n    defaultValue(options.emitterModelMatrix, Matrix4.IDENTITY)\n  );\n  this._matrixDirty = true;\n  this._combinedMatrix = new Matrix4();\n\n  this._startColor = Color.clone(\n    defaultValue(options.color, defaultValue(options.startColor, Color.WHITE))\n  );\n  this._endColor = Color.clone(\n    defaultValue(options.color, defaultValue(options.endColor, Color.WHITE))\n  );\n\n  this._startScale = defaultValue(\n    options.scale,\n    defaultValue(options.startScale, 1.0)\n  );\n  this._endScale = defaultValue(\n    options.scale,\n    defaultValue(options.endScale, 1.0)\n  );\n\n  this._emissionRate = defaultValue(options.emissionRate, 5.0);\n\n  this._minimumSpeed = defaultValue(\n    options.speed,\n    defaultValue(options.minimumSpeed, 1.0)\n  );\n  this._maximumSpeed = defaultValue(\n    options.speed,\n    defaultValue(options.maximumSpeed, 1.0)\n  );\n\n  this._minimumParticleLife = defaultValue(\n    options.particleLife,\n    defaultValue(options.minimumParticleLife, 5.0)\n  );\n  this._maximumParticleLife = defaultValue(\n    options.particleLife,\n    defaultValue(options.maximumParticleLife, 5.0)\n  );\n\n  this._minimumMass = defaultValue(\n    options.mass,\n    defaultValue(options.minimumMass, 1.0)\n  );\n  this._maximumMass = defaultValue(\n    options.mass,\n    defaultValue(options.maximumMass, 1.0)\n  );\n\n  this._minimumImageSize = Cartesian2.clone(\n    defaultValue(\n      options.imageSize,\n      defaultValue(options.minimumImageSize, defaultImageSize)\n    )\n  );\n  this._maximumImageSize = Cartesian2.clone(\n    defaultValue(\n      options.imageSize,\n      defaultValue(options.maximumImageSize, defaultImageSize)\n    )\n  );\n\n  this._sizeInMeters = defaultValue(options.sizeInMeters, false);\n\n  this._lifetime = defaultValue(options.lifetime, Number.MAX_VALUE);\n\n  this._billboardCollection = undefined;\n  this._particles = [];\n\n  // An array of available particles that we can reuse instead of allocating new.\n  this._particlePool = [];\n\n  this._previousTime = undefined;\n  this._currentTime = 0.0;\n  this._carryOver = 0.0;\n\n  this._complete = new Event();\n  this._isComplete = false;\n\n  this._updateParticlePool = true;\n  this._particleEstimate = 0;\n}\n\nObject.defineProperties(ParticleSystem.prototype, {\n  /**\n   * The particle emitter for this\n   * @memberof ParticleSystem.prototype\n   * @type {ParticleEmitter}\n   * @default CircleEmitter\n   */\n  emitter: {\n    get: function () {\n      return this._emitter;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"value\", value);\n      //>>includeEnd('debug');\n      this._emitter = value;\n    },\n  },\n  /**\n   * An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.\n   * @memberof ParticleSystem.prototype\n   * @type {ParticleBurst[]}\n   * @default undefined\n   */\n  bursts: {\n    get: function () {\n      return this._bursts;\n    },\n    set: function (value) {\n      this._bursts = value;\n      this._updateParticlePool = true;\n    },\n  },\n  /**\n   * The 4x4 transformation matrix that transforms the particle system from model to world coordinates.\n   * @memberof ParticleSystem.prototype\n   * @type {Matrix4}\n   * @default Matrix4.IDENTITY\n   */\n  modelMatrix: {\n    get: function () {\n      return this._modelMatrix;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"value\", value);\n      //>>includeEnd('debug');\n      this._matrixDirty =\n        this._matrixDirty || !Matrix4.equals(this._modelMatrix, value);\n      Matrix4.clone(value, this._modelMatrix);\n    },\n  },\n  /**\n   * The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.\n   * @memberof ParticleSystem.prototype\n   * @type {Matrix4}\n   * @default Matrix4.IDENTITY\n   */\n  emitterModelMatrix: {\n    get: function () {\n      return this._emitterModelMatrix;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"value\", value);\n      //>>includeEnd('debug');\n      this._matrixDirty =\n        this._matrixDirty || !Matrix4.equals(this._emitterModelMatrix, value);\n      Matrix4.clone(value, this._emitterModelMatrix);\n    },\n  },\n  /**\n   * The color of the particle at the beginning of its life.\n   * @memberof ParticleSystem.prototype\n   * @type {Color}\n   * @default Color.WHITE\n   */\n  startColor: {\n    get: function () {\n      return this._startColor;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"value\", value);\n      //>>includeEnd('debug');\n      Color.clone(value, this._startColor);\n    },\n  },\n  /**\n   * The color of the particle at the end of its life.\n   * @memberof ParticleSystem.prototype\n   * @type {Color}\n   * @default Color.WHITE\n   */\n  endColor: {\n    get: function () {\n      return this._endColor;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"value\", value);\n      //>>includeEnd('debug');\n      Color.clone(value, this._endColor);\n    },\n  },\n  /**\n   * The initial scale to apply to the image of the particle at the beginning of its life.\n   * @memberof ParticleSystem.prototype\n   * @type {number}\n   * @default 1.0\n   */\n  startScale: {\n    get: function () {\n      return this._startScale;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"value\", value, 0.0);\n      //>>includeEnd('debug');\n      this._startScale = value;\n    },\n  },\n  /**\n   * The final scale to apply to the image of the particle at the end of its life.\n   * @memberof ParticleSystem.prototype\n   * @type {number}\n   * @default 1.0\n   */\n  endScale: {\n    get: function () {\n      return this._endScale;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"value\", value, 0.0);\n      //>>includeEnd('debug');\n      this._endScale = value;\n    },\n  },\n  /**\n   * The number of particles to emit per second.\n   * @memberof ParticleSystem.prototype\n   * @type {number}\n   * @default 5\n   */\n  emissionRate: {\n    get: function () {\n      return this._emissionRate;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"value\", value, 0.0);\n      //>>includeEnd('debug');\n      this._emissionRate = value;\n      this._updateParticlePool = true;\n    },\n  },\n  /**\n   * Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.\n   * @memberof ParticleSystem.prototype\n   * @type {number}\n   * @default 1.0\n   */\n  minimumSpeed: {\n    get: function () {\n      return this._minimumSpeed;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"value\", value, 0.0);\n      //>>includeEnd('debug');\n      this._minimumSpeed = value;\n    },\n  },\n  /**\n   * Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.\n   * @memberof ParticleSystem.prototype\n   * @type {number}\n   * @default 1.0\n   */\n  maximumSpeed: {\n    get: function () {\n      return this._maximumSpeed;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"value\", value, 0.0);\n      //>>includeEnd('debug');\n      this._maximumSpeed = value;\n    },\n  },\n  /**\n   * Sets the minimum bound in seconds for the possible duration of a particle's life above which a particle's actual life will be randomly chosen.\n   * @memberof ParticleSystem.prototype\n   * @type {number}\n   * @default 5.0\n   */\n  minimumParticleLife: {\n    get: function () {\n      return this._minimumParticleLife;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"value\", value, 0.0);\n      //>>includeEnd('debug');\n      this._minimumParticleLife = value;\n    },\n  },\n  /**\n   * Sets the maximum bound in seconds for the possible duration of a particle's life below which a particle's actual life will be randomly chosen.\n   * @memberof ParticleSystem.prototype\n   * @type {number}\n   * @default 5.0\n   */\n  maximumParticleLife: {\n    get: function () {\n      return this._maximumParticleLife;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"value\", value, 0.0);\n      //>>includeEnd('debug');\n      this._maximumParticleLife = value;\n      this._updateParticlePool = true;\n    },\n  },\n  /**\n   * Sets the minimum mass of particles in kilograms.\n   * @memberof ParticleSystem.prototype\n   * @type {number}\n   * @default 1.0\n   */\n  minimumMass: {\n    get: function () {\n      return this._minimumMass;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"value\", value, 0.0);\n      //>>includeEnd('debug');\n      this._minimumMass = value;\n    },\n  },\n  /**\n   * Sets the maximum mass of particles in kilograms.\n   * @memberof ParticleSystem.prototype\n   * @type {number}\n   * @default 1.0\n   */\n  maximumMass: {\n    get: function () {\n      return this._maximumMass;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"value\", value, 0.0);\n      //>>includeEnd('debug');\n      this._maximumMass = value;\n    },\n  },\n  /**\n   * Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.\n   * @memberof ParticleSystem.prototype\n   * @type {Cartesian2}\n   * @default new Cartesian2(1.0, 1.0)\n   */\n  minimumImageSize: {\n    get: function () {\n      return this._minimumImageSize;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.object(\"value\", value);\n      Check.typeOf.number.greaterThanOrEquals(\"value.x\", value.x, 0.0);\n      Check.typeOf.number.greaterThanOrEquals(\"value.y\", value.y, 0.0);\n      //>>includeEnd('debug');\n      this._minimumImageSize = value;\n    },\n  },\n  /**\n   * Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.\n   * @memberof ParticleSystem.prototype\n   * @type {Cartesian2}\n   * @default new Cartesian2(1.0, 1.0)\n   */\n  maximumImageSize: {\n    get: function () {\n      return this._maximumImageSize;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.object(\"value\", value);\n      Check.typeOf.number.greaterThanOrEquals(\"value.x\", value.x, 0.0);\n      Check.typeOf.number.greaterThanOrEquals(\"value.y\", value.y, 0.0);\n      //>>includeEnd('debug');\n      this._maximumImageSize = value;\n    },\n  },\n  /**\n   * Gets or sets if the particle size is in meters or pixels. <code>true</code> to size particles in meters; otherwise, the size is in pixels.\n   * @memberof ParticleSystem.prototype\n   * @type {boolean}\n   * @default false\n   */\n  sizeInMeters: {\n    get: function () {\n      return this._sizeInMeters;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.bool(\"value\", value);\n      //>>includeEnd('debug');\n      this._sizeInMeters = value;\n    },\n  },\n  /**\n   * How long the particle system will emit particles, in seconds.\n   * @memberof ParticleSystem.prototype\n   * @type {number}\n   * @default Number.MAX_VALUE\n   */\n  lifetime: {\n    get: function () {\n      return this._lifetime;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThanOrEquals(\"value\", value, 0.0);\n      //>>includeEnd('debug');\n      this._lifetime = value;\n    },\n  },\n  /**\n   * Fires an event when the particle system has reached the end of its lifetime.\n   * @memberof ParticleSystem.prototype\n   * @type {Event}\n   */\n  complete: {\n    get: function () {\n      return this._complete;\n    },\n  },\n  /**\n   * When <code>true</code>, the particle system has reached the end of its lifetime; <code>false</code> otherwise.\n   * @memberof ParticleSystem.prototype\n   * @type {boolean}\n   */\n  isComplete: {\n    get: function () {\n      return this._isComplete;\n    },\n  },\n});\n\nfunction updateParticlePool(system) {\n  const emissionRate = system._emissionRate;\n  const life = system._maximumParticleLife;\n\n  let burstAmount = 0;\n  const bursts = system._bursts;\n  if (defined(bursts)) {\n    const length = bursts.length;\n    for (let i = 0; i < length; ++i) {\n      burstAmount += bursts[i].maximum;\n    }\n  }\n\n  const billboardCollection = system._billboardCollection;\n  const image = system.image;\n\n  const particleEstimate = Math.ceil(emissionRate * life + burstAmount);\n  const particles = system._particles;\n  const particlePool = system._particlePool;\n  const numToAdd = Math.max(\n    particleEstimate - particles.length - particlePool.length,\n    0\n  );\n\n  for (let j = 0; j < numToAdd; ++j) {\n    const particle = new Particle();\n    particle._billboard = billboardCollection.add({\n      image: image,\n      // Make the newly added billboards invisible when updating the particle pool\n      // to prevent the billboards from being displayed when the particles\n      // are not created. The billboard will always be set visible in\n      // updateBillboard function when its corresponding particle update.\n      show: false,\n    });\n    particlePool.push(particle);\n  }\n\n  system._particleEstimate = particleEstimate;\n}\n\nfunction getOrCreateParticle(system) {\n  // Try to reuse an existing particle from the pool.\n  let particle = system._particlePool.pop();\n  if (!defined(particle)) {\n    // Create a new one\n    particle = new Particle();\n  }\n  return particle;\n}\n\nfunction addParticleToPool(system, particle) {\n  system._particlePool.push(particle);\n}\n\nfunction freeParticlePool(system) {\n  const particles = system._particles;\n  const particlePool = system._particlePool;\n  const billboardCollection = system._billboardCollection;\n\n  const numParticles = particles.length;\n  const numInPool = particlePool.length;\n  const estimate = system._particleEstimate;\n\n  const start = numInPool - Math.max(estimate - numParticles - numInPool, 0);\n  for (let i = start; i < numInPool; ++i) {\n    const p = particlePool[i];\n    billboardCollection.remove(p._billboard);\n  }\n  particlePool.length = start;\n}\n\nfunction removeBillboard(particle) {\n  if (defined(particle._billboard)) {\n    particle._billboard.show = false;\n  }\n}\n\nfunction updateBillboard(system, particle) {\n  let billboard = particle._billboard;\n  if (!defined(billboard)) {\n    billboard = particle._billboard = system._billboardCollection.add({\n      image: particle.image,\n    });\n  }\n  billboard.width = particle.imageSize.x;\n  billboard.height = particle.imageSize.y;\n  billboard.position = particle.position;\n  billboard.sizeInMeters = system.sizeInMeters;\n  billboard.show = true;\n\n  // Update the color\n  const r = CesiumMath.lerp(\n    particle.startColor.red,\n    particle.endColor.red,\n    particle.normalizedAge\n  );\n  const g = CesiumMath.lerp(\n    particle.startColor.green,\n    particle.endColor.green,\n    particle.normalizedAge\n  );\n  const b = CesiumMath.lerp(\n    particle.startColor.blue,\n    particle.endColor.blue,\n    particle.normalizedAge\n  );\n  const a = CesiumMath.lerp(\n    particle.startColor.alpha,\n    particle.endColor.alpha,\n    particle.normalizedAge\n  );\n  billboard.color = new Color(r, g, b, a);\n\n  // Update the scale\n  billboard.scale = CesiumMath.lerp(\n    particle.startScale,\n    particle.endScale,\n    particle.normalizedAge\n  );\n}\n\nfunction addParticle(system, particle) {\n  particle.startColor = Color.clone(system._startColor, particle.startColor);\n  particle.endColor = Color.clone(system._endColor, particle.endColor);\n  particle.startScale = system._startScale;\n  particle.endScale = system._endScale;\n  particle.image = system.image;\n  particle.life = CesiumMath.randomBetween(\n    system._minimumParticleLife,\n    system._maximumParticleLife\n  );\n  particle.mass = CesiumMath.randomBetween(\n    system._minimumMass,\n    system._maximumMass\n  );\n  particle.imageSize.x = CesiumMath.randomBetween(\n    system._minimumImageSize.x,\n    system._maximumImageSize.x\n  );\n  particle.imageSize.y = CesiumMath.randomBetween(\n    system._minimumImageSize.y,\n    system._maximumImageSize.y\n  );\n\n  // Reset the normalizedAge and age in case the particle was reused.\n  particle._normalizedAge = 0.0;\n  particle._age = 0.0;\n\n  const speed = CesiumMath.randomBetween(\n    system._minimumSpeed,\n    system._maximumSpeed\n  );\n  Cartesian3.multiplyByScalar(particle.velocity, speed, particle.velocity);\n\n  system._particles.push(particle);\n}\n\nfunction calculateNumberToEmit(system, dt) {\n  // This emitter is finished if it exceeds it's lifetime.\n  if (system._isComplete) {\n    return 0;\n  }\n\n  dt = CesiumMath.mod(dt, system._lifetime);\n\n  // Compute the number of particles to emit based on the emissionRate.\n  const v = dt * system._emissionRate;\n  let numToEmit = Math.floor(v);\n  system._carryOver += v - numToEmit;\n  if (system._carryOver > 1.0) {\n    numToEmit++;\n    system._carryOver -= 1.0;\n  }\n\n  // Apply any bursts\n  if (defined(system.bursts)) {\n    const length = system.bursts.length;\n    for (let i = 0; i < length; i++) {\n      const burst = system.bursts[i];\n      const currentTime = system._currentTime;\n      if (defined(burst) && !burst._complete && currentTime > burst.time) {\n        numToEmit += CesiumMath.randomBetween(burst.minimum, burst.maximum);\n        burst._complete = true;\n      }\n    }\n  }\n\n  return numToEmit;\n}\n\nconst rotatedVelocityScratch = new Cartesian3();\n\n/**\n * @private\n */\nParticleSystem.prototype.update = function (frameState) {\n  if (!this.show) {\n    return;\n  }\n\n  if (!defined(this._billboardCollection)) {\n    this._billboardCollection = new BillboardCollection();\n  }\n\n  if (this._updateParticlePool) {\n    updateParticlePool(this);\n    this._updateParticlePool = false;\n  }\n\n  // Compute the frame time\n  let dt = 0.0;\n  if (this._previousTime) {\n    dt = JulianDate.secondsDifference(frameState.time, this._previousTime);\n  }\n\n  if (dt < 0.0) {\n    dt = 0.0;\n  }\n\n  const particles = this._particles;\n  const emitter = this._emitter;\n  const updateCallback = this.updateCallback;\n\n  let i;\n  let particle;\n\n  // update particles and remove dead particles\n  let length = particles.length;\n  for (i = 0; i < length; ++i) {\n    particle = particles[i];\n    if (!particle.update(dt, updateCallback)) {\n      removeBillboard(particle);\n      // Add the particle back to the pool so it can be reused.\n      addParticleToPool(this, particle);\n      particles[i] = particles[length - 1];\n      --i;\n      --length;\n    } else {\n      updateBillboard(this, particle);\n    }\n  }\n  particles.length = length;\n\n  const numToEmit = calculateNumberToEmit(this, dt);\n\n  if (numToEmit > 0 && defined(emitter)) {\n    // Compute the final model matrix by combining the particle systems model matrix and the emitter matrix.\n    if (this._matrixDirty) {\n      this._combinedMatrix = Matrix4.multiply(\n        this.modelMatrix,\n        this.emitterModelMatrix,\n        this._combinedMatrix\n      );\n      this._matrixDirty = false;\n    }\n\n    const combinedMatrix = this._combinedMatrix;\n\n    for (i = 0; i < numToEmit; i++) {\n      // Create a new particle.\n      particle = getOrCreateParticle(this);\n\n      // Let the emitter initialize the particle.\n      this._emitter.emit(particle);\n\n      //For the velocity we need to add it to the original position and then multiply by point.\n      Cartesian3.add(\n        particle.position,\n        particle.velocity,\n        rotatedVelocityScratch\n      );\n      Matrix4.multiplyByPoint(\n        combinedMatrix,\n        rotatedVelocityScratch,\n        rotatedVelocityScratch\n      );\n\n      // Change the position to be in world coordinates\n      particle.position = Matrix4.multiplyByPoint(\n        combinedMatrix,\n        particle.position,\n        particle.position\n      );\n\n      // Orient the velocity in world space as well.\n      Cartesian3.subtract(\n        rotatedVelocityScratch,\n        particle.position,\n        particle.velocity\n      );\n      Cartesian3.normalize(particle.velocity, particle.velocity);\n\n      // Add the particle to the system.\n      addParticle(this, particle);\n      updateBillboard(this, particle);\n    }\n  }\n\n  this._billboardCollection.update(frameState);\n  this._previousTime = JulianDate.clone(frameState.time, this._previousTime);\n  this._currentTime += dt;\n\n  if (\n    this._lifetime !== Number.MAX_VALUE &&\n    this._currentTime > this._lifetime\n  ) {\n    if (this.loop) {\n      this._currentTime = CesiumMath.mod(this._currentTime, this._lifetime);\n      if (this.bursts) {\n        const burstLength = this.bursts.length;\n        // Reset any bursts\n        for (i = 0; i < burstLength; i++) {\n          this.bursts[i]._complete = false;\n        }\n      }\n    } else {\n      this._isComplete = true;\n      this._complete.raiseEvent(this);\n    }\n  }\n\n  // free particles in the pool and release billboard GPU memory\n  if (frameState.frameNumber % 120 === 0) {\n    freeParticlePool(this);\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see ParticleSystem#destroy\n */\nParticleSystem.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see ParticleSystem#isDestroyed\n */\nParticleSystem.prototype.destroy = function () {\n  this._billboardCollection =\n    this._billboardCollection && this._billboardCollection.destroy();\n  return destroyObject(this);\n};\n\n/**\n * A function used to modify attributes of the particle at each time step. This can include force modifications,\n * color, sizing, etc.\n *\n * @callback ParticleSystem.updateCallback\n *\n * @param {Particle} particle The particle being updated.\n * @param {number} dt The time in seconds since the last update.\n *\n * @example\n * function applyGravity(particle, dt) {\n *    const position = particle.position;\n *    const gravityVector = Cesium.Cartesian3.normalize(position, new Cesium.Cartesian3());\n *    Cesium.Cartesian3.multiplyByScalar(gravityVector, GRAVITATIONAL_CONSTANT * dt, gravityVector);\n *    particle.velocity = Cesium.Cartesian3.add(particle.velocity, gravityVector, particle.velocity);\n * }\n */\nexport default ParticleSystem;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport combine from \"../Core/combine.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport MersenneTwister from \"mersenne-twister\";\nimport BlendingState from \"./BlendingState.js\";\nimport Cesium3DTileBatchTable from \"./Cesium3DTileBatchTable.js\";\nimport DracoLoader from \"./DracoLoader.js\";\nimport getClipAndStyleCode from \"./getClipAndStyleCode.js\";\nimport getClippingFunction from \"./getClippingFunction.js\";\nimport PntsParser from \"./PntsParser.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowMode from \"./ShadowMode.js\";\nimport SplitDirection from \"./SplitDirection.js\";\nimport Splitter from \"./Splitter.js\";\nimport StencilConstants from \"./StencilConstants.js\";\n\nconst DecodingState = {\n  NEEDS_DECODE: 0,\n  DECODING: 1,\n  READY: 2,\n  FAILED: 3,\n};\n\n/**\n * Represents the contents of a\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/PointCloud|Point Cloud}\n * tile. Used internally by {@link TimeDynamicPointCloud}.\n *\n * @alias PointCloud\n * @constructor\n *\n * @see TimeDynamicPointCloud\n *\n * @private\n */\nfunction PointCloud(options) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options\", options);\n  Check.typeOf.object(\"options.arrayBuffer\", options.arrayBuffer);\n  //>>includeEnd('debug');\n\n  // Hold onto the payload until the render resources are created\n  this._parsedContent = undefined;\n\n  this._drawCommand = undefined;\n  this._isTranslucent = false;\n  this._styleTranslucent = false;\n  this._constantColor = Color.clone(Color.DARKGRAY);\n  this._highlightColor = Color.clone(Color.WHITE);\n  this._pointSize = 1.0;\n\n  this._rtcCenter = undefined;\n  this._quantizedVolumeScale = undefined;\n  this._quantizedVolumeOffset = undefined;\n\n  // These values are used to regenerate the shader when the style changes\n  this._styleableShaderAttributes = undefined;\n  this._isQuantized = false;\n  this._isOctEncoded16P = false;\n  this._isRGB565 = false;\n  this._hasColors = false;\n  this._hasNormals = false;\n  this._hasBatchIds = false;\n\n  // Draco\n  this._decodingState = DecodingState.READY;\n  this._dequantizeInShader = true;\n  this._isQuantizedDraco = false;\n  this._isOctEncodedDraco = false;\n  this._quantizedRange = 0.0;\n  this._octEncodedRange = 0.0;\n\n  // Use per-point normals to hide back-facing points.\n  this.backFaceCulling = false;\n  this._backFaceCulling = false;\n\n  // Whether to enable normal shading\n  this.normalShading = true;\n  this._normalShading = true;\n\n  this._opaqueRenderState = undefined;\n  this._translucentRenderState = undefined;\n\n  this._mode = undefined;\n\n  this._ready = false;\n  this._pointsLength = 0;\n  this._geometryByteLength = 0;\n\n  this._vertexShaderLoaded = options.vertexShaderLoaded;\n  this._fragmentShaderLoaded = options.fragmentShaderLoaded;\n  this._uniformMapLoaded = options.uniformMapLoaded;\n  this._batchTableLoaded = options.batchTableLoaded;\n  this._pickIdLoaded = options.pickIdLoaded;\n  this._opaquePass = defaultValue(options.opaquePass, Pass.OPAQUE);\n  this._cull = defaultValue(options.cull, true);\n\n  this.style = undefined;\n  this._style = undefined;\n  this.styleDirty = false;\n\n  this.modelMatrix = Matrix4.clone(Matrix4.IDENTITY);\n  this._modelMatrix = Matrix4.clone(Matrix4.IDENTITY);\n\n  this.time = 0.0; // For styling\n  this.shadows = ShadowMode.ENABLED;\n  this._boundingSphere = undefined;\n\n  this.clippingPlanes = undefined;\n  this.isClipped = false;\n  this.clippingPlanesDirty = false;\n  // If defined, use this matrix to position the clipping planes instead of the modelMatrix.\n  // This is so that when point clouds are part of a tileset they all get clipped relative\n  // to the root tile.\n  this.clippingPlanesOriginMatrix = undefined;\n\n  this.attenuation = false;\n  this._attenuation = false;\n\n  // Options for geometric error based attenuation\n  this.geometricError = 0.0;\n  this.geometricErrorScale = 1.0;\n  this.maximumAttenuation = this._pointSize;\n\n  /**\n   * The {@link SplitDirection} to apply to this point cloud.\n   *\n   * @type {SplitDirection}\n   * @default {@link SplitDirection.NONE}\n   */\n  this.splitDirection = defaultValue(\n    options.splitDirection,\n    SplitDirection.NONE\n  );\n  this._splittingEnabled = false;\n\n  this._error = undefined;\n  initialize(this, options);\n}\n\nObject.defineProperties(PointCloud.prototype, {\n  pointsLength: {\n    get: function () {\n      return this._pointsLength;\n    },\n  },\n\n  geometryByteLength: {\n    get: function () {\n      return this._geometryByteLength;\n    },\n  },\n\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n\n  color: {\n    get: function () {\n      return Color.clone(this._highlightColor);\n    },\n    set: function (value) {\n      this._highlightColor = Color.clone(value, this._highlightColor);\n    },\n  },\n\n  boundingSphere: {\n    get: function () {\n      if (defined(this._drawCommand)) {\n        return this._drawCommand.boundingVolume;\n      }\n      return undefined;\n    },\n    set: function (value) {\n      this._boundingSphere = BoundingSphere.clone(value, this._boundingSphere);\n    },\n  },\n});\n\nfunction initialize(pointCloud, options) {\n  const parsedContent = PntsParser.parse(\n    options.arrayBuffer,\n    options.byteOffset\n  );\n  pointCloud._parsedContent = parsedContent;\n  pointCloud._rtcCenter = parsedContent.rtcCenter;\n  pointCloud._hasNormals = parsedContent.hasNormals;\n  pointCloud._hasColors = parsedContent.hasColors;\n  pointCloud._hasBatchIds = parsedContent.hasBatchIds;\n  pointCloud._isTranslucent = parsedContent.isTranslucent;\n\n  // If points are not batched and there are per-point properties, use the\n  // properties as metadata for styling purposes.\n  if (!parsedContent.hasBatchIds && defined(parsedContent.batchTableBinary)) {\n    parsedContent.styleableProperties = Cesium3DTileBatchTable.getBinaryProperties(\n      parsedContent.pointsLength,\n      parsedContent.batchTableJson,\n      parsedContent.batchTableBinary\n    );\n  }\n\n  if (defined(parsedContent.draco)) {\n    const draco = parsedContent.draco;\n    pointCloud._decodingState = DecodingState.NEEDS_DECODE;\n    draco.dequantizeInShader = pointCloud._dequantizeInShader;\n  }\n\n  const positions = parsedContent.positions;\n  if (defined(positions)) {\n    pointCloud._isQuantized = positions.isQuantized;\n    pointCloud._quantizedVolumeScale = positions.quantizedVolumeScale;\n    pointCloud._quantizedVolumeOffset = positions.quantizedVolumeOffset;\n    pointCloud._quantizedRange = positions.quantizedRange;\n  }\n\n  const normals = parsedContent.normals;\n  if (defined(normals)) {\n    pointCloud._isOctEncoded16P = normals.octEncoded;\n  }\n\n  const colors = parsedContent.colors;\n  if (defined(colors)) {\n    if (defined(colors.constantColor)) {\n      pointCloud._constantColor = Color.clone(\n        colors.constantColor,\n        pointCloud._constantColor\n      );\n\n      // Constant colors are handled as a uniform rather than a vertex\n      // attribute.\n      pointCloud._hasColors = false;\n    }\n    pointCloud._isRGB565 = colors.isRGB565;\n  }\n\n  // PntsParser parses BATCH_ID as _FEATURE_ID_0 for EXT_mesh_features.\n  // These properties aren't used but rename them to BATCH_ID to avoid\n  // confusion when debugging.\n  const batchIds = parsedContent.batchIds;\n  if (defined(parsedContent.batchIds)) {\n    batchIds.name = \"BATCH_ID\";\n    batchIds.semantic = \"BATCH_ID\";\n    batchIds.setIndex = undefined;\n  }\n\n  if (parsedContent.hasBatchIds) {\n    pointCloud._batchTableLoaded(\n      parsedContent.batchLength,\n      parsedContent.batchTableJson,\n      parsedContent.batchTableBinary\n    );\n  }\n\n  pointCloud._pointsLength = parsedContent.pointsLength;\n}\n\nconst scratchMin = new Cartesian3();\nconst scratchMax = new Cartesian3();\nconst scratchPosition = new Cartesian3();\n\n// Use MersenneTwister directly to avoid interfering with CesiumMath.nextRandomNumber()\n// See https://github.com/CesiumGS/cesium/issues/9730\nlet randomNumberGenerator;\nlet randomValues;\n\nfunction getRandomValues(samplesLength) {\n  // Use same random values across all runs\n  if (!defined(randomValues)) {\n    // Use MersenneTwister directly to avoid interfering with CesiumMath.nextRandomNumber()\n    // See https://github.com/CesiumGS/cesium/issues/9730\n    randomNumberGenerator = new MersenneTwister(0);\n    randomValues = new Array(samplesLength);\n    for (let i = 0; i < samplesLength; ++i) {\n      randomValues[i] = randomNumberGenerator.random();\n    }\n  }\n  return randomValues;\n}\n\nfunction computeApproximateBoundingSphereFromPositions(positions) {\n  const maximumSamplesLength = 20;\n  const pointsLength = positions.length / 3;\n  const samplesLength = Math.min(pointsLength, maximumSamplesLength);\n  const randomValues = getRandomValues(maximumSamplesLength);\n  const maxValue = Number.MAX_VALUE;\n  const minValue = -Number.MAX_VALUE;\n  const min = Cartesian3.fromElements(maxValue, maxValue, maxValue, scratchMin);\n  const max = Cartesian3.fromElements(minValue, minValue, minValue, scratchMax);\n  for (let i = 0; i < samplesLength; ++i) {\n    const index = Math.floor(randomValues[i] * pointsLength);\n    const position = Cartesian3.unpack(positions, index * 3, scratchPosition);\n    Cartesian3.minimumByComponent(min, position, min);\n    Cartesian3.maximumByComponent(max, position, max);\n  }\n\n  const boundingSphere = BoundingSphere.fromCornerPoints(min, max);\n  boundingSphere.radius += CesiumMath.EPSILON2; // To avoid radius of zero\n  return boundingSphere;\n}\n\nfunction prepareVertexAttribute(typedArray, name) {\n  // WebGL does not support UNSIGNED_INT, INT, or DOUBLE vertex attributes. Convert these to FLOAT.\n  const componentDatatype = ComponentDatatype.fromTypedArray(typedArray);\n  if (\n    componentDatatype === ComponentDatatype.INT ||\n    componentDatatype === ComponentDatatype.UNSIGNED_INT ||\n    componentDatatype === ComponentDatatype.DOUBLE\n  ) {\n    oneTimeWarning(\n      \"Cast pnts property to floats\",\n      `Point cloud property \"${name}\" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`\n    );\n    return new Float32Array(typedArray);\n  }\n  return typedArray;\n}\n\nconst scratchPointSizeAndTimeAndGeometricErrorAndDepthMultiplier = new Cartesian4();\nconst scratchQuantizedVolumeScaleAndOctEncodedRange = new Cartesian4();\nconst scratchColor = new Color();\n\nconst positionLocation = 0;\nconst colorLocation = 1;\nconst normalLocation = 2;\nconst batchIdLocation = 3;\nconst numberOfAttributes = 4;\n\nconst scratchClippingPlanesMatrix = new Matrix4();\nconst scratchInverseTransposeClippingPlanesMatrix = new Matrix4();\n\nfunction createResources(pointCloud, frameState) {\n  const context = frameState.context;\n  const parsedContent = pointCloud._parsedContent;\n  const pointsLength = pointCloud._pointsLength;\n  const positions = parsedContent.positions;\n  const colors = parsedContent.colors;\n  const normals = parsedContent.normals;\n  const batchIds = parsedContent.batchIds;\n  const styleableProperties = parsedContent.styleableProperties;\n  const hasStyleableProperties = defined(styleableProperties);\n  const isQuantized = pointCloud._isQuantized;\n  const isQuantizedDraco = pointCloud._isQuantizedDraco;\n  const isOctEncoded16P = pointCloud._isOctEncoded16P;\n  const isOctEncodedDraco = pointCloud._isOctEncodedDraco;\n  const quantizedRange = pointCloud._quantizedRange;\n  const octEncodedRange = pointCloud._octEncodedRange;\n  const isRGB565 = pointCloud._isRGB565;\n  const isTranslucent = pointCloud._isTranslucent;\n  const hasColors = pointCloud._hasColors;\n  const hasNormals = pointCloud._hasNormals;\n  const hasBatchIds = pointCloud._hasBatchIds;\n\n  let componentsPerAttribute;\n  let componentDatatype;\n\n  const styleableVertexAttributes = [];\n  const styleableShaderAttributes = {};\n  pointCloud._styleableShaderAttributes = styleableShaderAttributes;\n\n  if (hasStyleableProperties) {\n    let attributeLocation = numberOfAttributes;\n\n    for (const name in styleableProperties) {\n      if (styleableProperties.hasOwnProperty(name)) {\n        const property = styleableProperties[name];\n        const typedArray = prepareVertexAttribute(property.typedArray, name);\n        componentsPerAttribute = property.componentCount;\n        componentDatatype = ComponentDatatype.fromTypedArray(typedArray);\n\n        const vertexBuffer = Buffer.createVertexBuffer({\n          context: context,\n          typedArray: typedArray,\n          usage: BufferUsage.STATIC_DRAW,\n        });\n\n        pointCloud._geometryByteLength += vertexBuffer.sizeInBytes;\n\n        const vertexAttribute = {\n          index: attributeLocation,\n          vertexBuffer: vertexBuffer,\n          componentsPerAttribute: componentsPerAttribute,\n          componentDatatype: componentDatatype,\n          normalize: false,\n          offsetInBytes: 0,\n          strideInBytes: 0,\n        };\n\n        styleableVertexAttributes.push(vertexAttribute);\n        styleableShaderAttributes[name] = {\n          location: attributeLocation,\n          componentCount: componentsPerAttribute,\n        };\n        ++attributeLocation;\n      }\n    }\n  }\n\n  const positionsVertexBuffer = Buffer.createVertexBuffer({\n    context: context,\n    typedArray: positions.typedArray,\n    usage: BufferUsage.STATIC_DRAW,\n  });\n  pointCloud._geometryByteLength += positionsVertexBuffer.sizeInBytes;\n\n  let colorsVertexBuffer;\n  if (hasColors) {\n    colorsVertexBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: colors.typedArray,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    pointCloud._geometryByteLength += colorsVertexBuffer.sizeInBytes;\n  }\n\n  let normalsVertexBuffer;\n  if (hasNormals) {\n    normalsVertexBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: normals.typedArray,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    pointCloud._geometryByteLength += normalsVertexBuffer.sizeInBytes;\n  }\n\n  let batchIdsVertexBuffer;\n  if (hasBatchIds) {\n    batchIds.typedArray = prepareVertexAttribute(\n      batchIds.typedArray,\n      \"batchIds\"\n    );\n    batchIdsVertexBuffer = Buffer.createVertexBuffer({\n      context: context,\n      typedArray: batchIds.typedArray,\n      usage: BufferUsage.STATIC_DRAW,\n    });\n    pointCloud._geometryByteLength += batchIdsVertexBuffer.sizeInBytes;\n  }\n\n  let attributes = [];\n\n  if (isQuantized) {\n    componentDatatype = ComponentDatatype.UNSIGNED_SHORT;\n  } else if (isQuantizedDraco) {\n    componentDatatype =\n      quantizedRange <= 255\n        ? ComponentDatatype.UNSIGNED_BYTE\n        : ComponentDatatype.UNSIGNED_SHORT;\n  } else {\n    componentDatatype = ComponentDatatype.FLOAT;\n  }\n\n  attributes.push({\n    index: positionLocation,\n    vertexBuffer: positionsVertexBuffer,\n    componentsPerAttribute: 3,\n    componentDatatype: componentDatatype,\n    normalize: false,\n    offsetInBytes: 0,\n    strideInBytes: 0,\n  });\n\n  if (pointCloud._cull) {\n    if (isQuantized || isQuantizedDraco) {\n      pointCloud._boundingSphere = BoundingSphere.fromCornerPoints(\n        Cartesian3.ZERO,\n        pointCloud._quantizedVolumeScale\n      );\n    } else {\n      pointCloud._boundingSphere = computeApproximateBoundingSphereFromPositions(\n        positions.typedArray\n      );\n    }\n  }\n\n  if (hasColors) {\n    if (isRGB565) {\n      attributes.push({\n        index: colorLocation,\n        vertexBuffer: colorsVertexBuffer,\n        componentsPerAttribute: 1,\n        componentDatatype: ComponentDatatype.UNSIGNED_SHORT,\n        normalize: false,\n        offsetInBytes: 0,\n        strideInBytes: 0,\n      });\n    } else {\n      const colorComponentsPerAttribute = isTranslucent ? 4 : 3;\n      attributes.push({\n        index: colorLocation,\n        vertexBuffer: colorsVertexBuffer,\n        componentsPerAttribute: colorComponentsPerAttribute,\n        componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n        normalize: true,\n        offsetInBytes: 0,\n        strideInBytes: 0,\n      });\n    }\n  }\n\n  if (hasNormals) {\n    if (isOctEncoded16P) {\n      componentsPerAttribute = 2;\n      componentDatatype = ComponentDatatype.UNSIGNED_BYTE;\n    } else if (isOctEncodedDraco) {\n      componentsPerAttribute = 2;\n      componentDatatype =\n        octEncodedRange <= 255\n          ? ComponentDatatype.UNSIGNED_BYTE\n          : ComponentDatatype.UNSIGNED_SHORT;\n    } else {\n      componentsPerAttribute = 3;\n      componentDatatype = ComponentDatatype.FLOAT;\n    }\n    attributes.push({\n      index: normalLocation,\n      vertexBuffer: normalsVertexBuffer,\n      componentsPerAttribute: componentsPerAttribute,\n      componentDatatype: componentDatatype,\n      normalize: false,\n      offsetInBytes: 0,\n      strideInBytes: 0,\n    });\n  }\n\n  if (hasBatchIds) {\n    attributes.push({\n      index: batchIdLocation,\n      vertexBuffer: batchIdsVertexBuffer,\n      componentsPerAttribute: 1,\n      componentDatatype: ComponentDatatype.fromTypedArray(batchIds.typedArray),\n      normalize: false,\n      offsetInBytes: 0,\n      strideInBytes: 0,\n    });\n  }\n\n  if (hasStyleableProperties) {\n    attributes = attributes.concat(styleableVertexAttributes);\n  }\n\n  const vertexArray = new VertexArray({\n    context: context,\n    attributes: attributes,\n  });\n\n  const opaqueRenderState = {\n    depthTest: {\n      enabled: true,\n    },\n  };\n\n  const translucentRenderState = {\n    depthTest: {\n      enabled: true,\n    },\n    depthMask: false,\n    blending: BlendingState.ALPHA_BLEND,\n  };\n\n  if (pointCloud._opaquePass === Pass.CESIUM_3D_TILE) {\n    opaqueRenderState.stencilTest = StencilConstants.setCesium3DTileBit();\n    opaqueRenderState.stencilMask = StencilConstants.CESIUM_3D_TILE_MASK;\n    translucentRenderState.stencilTest = StencilConstants.setCesium3DTileBit();\n    translucentRenderState.stencilMask = StencilConstants.CESIUM_3D_TILE_MASK;\n  }\n\n  pointCloud._opaqueRenderState = RenderState.fromCache(opaqueRenderState);\n  pointCloud._translucentRenderState = RenderState.fromCache(\n    translucentRenderState\n  );\n\n  pointCloud._drawCommand = new DrawCommand({\n    boundingVolume: new BoundingSphere(),\n    cull: pointCloud._cull,\n    modelMatrix: new Matrix4(),\n    primitiveType: PrimitiveType.POINTS,\n    vertexArray: vertexArray,\n    count: pointsLength,\n    shaderProgram: undefined, // Updated in createShaders\n    uniformMap: undefined, // Updated in createShaders\n    renderState: isTranslucent\n      ? pointCloud._translucentRenderState\n      : pointCloud._opaqueRenderState,\n    pass: isTranslucent ? Pass.TRANSLUCENT : pointCloud._opaquePass,\n    owner: pointCloud,\n    castShadows: false,\n    receiveShadows: false,\n    pickId: pointCloud._pickIdLoaded(),\n  });\n}\n\nfunction createUniformMap(pointCloud, frameState) {\n  const context = frameState.context;\n  const isQuantized = pointCloud._isQuantized;\n  const isQuantizedDraco = pointCloud._isQuantizedDraco;\n  const isOctEncodedDraco = pointCloud._isOctEncodedDraco;\n\n  let uniformMap = {\n    u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier: function () {\n      const scratch = scratchPointSizeAndTimeAndGeometricErrorAndDepthMultiplier;\n      scratch.x = pointCloud._attenuation\n        ? pointCloud.maximumAttenuation\n        : pointCloud._pointSize;\n      scratch.x *= frameState.pixelRatio;\n\n      scratch.y = pointCloud.time;\n\n      if (pointCloud._attenuation) {\n        const frustum = frameState.camera.frustum;\n        let depthMultiplier;\n        // Attenuation is maximumAttenuation in 2D/ortho\n        if (\n          frameState.mode === SceneMode.SCENE2D ||\n          frustum instanceof OrthographicFrustum\n        ) {\n          depthMultiplier = Number.POSITIVE_INFINITY;\n        } else {\n          depthMultiplier =\n            context.drawingBufferHeight /\n            frameState.camera.frustum.sseDenominator;\n        }\n\n        scratch.z = pointCloud.geometricError * pointCloud.geometricErrorScale;\n        scratch.w = depthMultiplier;\n      }\n\n      return scratch;\n    },\n    u_highlightColor: function () {\n      return pointCloud._highlightColor;\n    },\n    u_constantColor: function () {\n      return pointCloud._constantColor;\n    },\n    u_clippingPlanes: function () {\n      const clippingPlanes = pointCloud.clippingPlanes;\n      const isClipped = pointCloud.isClipped;\n      return isClipped ? clippingPlanes.texture : context.defaultTexture;\n    },\n    u_clippingPlanesEdgeStyle: function () {\n      const clippingPlanes = pointCloud.clippingPlanes;\n      if (!defined(clippingPlanes)) {\n        return Color.TRANSPARENT;\n      }\n\n      const style = Color.clone(clippingPlanes.edgeColor, scratchColor);\n      style.alpha = clippingPlanes.edgeWidth;\n      return style;\n    },\n    u_clippingPlanesMatrix: function () {\n      const clippingPlanes = pointCloud.clippingPlanes;\n      if (!defined(clippingPlanes)) {\n        return Matrix4.IDENTITY;\n      }\n\n      const clippingPlanesOriginMatrix = defaultValue(\n        pointCloud.clippingPlanesOriginMatrix,\n        pointCloud._modelMatrix\n      );\n      Matrix4.multiply(\n        context.uniformState.view3D,\n        clippingPlanesOriginMatrix,\n        scratchClippingPlanesMatrix\n      );\n      const transform = Matrix4.multiply(\n        scratchClippingPlanesMatrix,\n        clippingPlanes.modelMatrix,\n        scratchClippingPlanesMatrix\n      );\n\n      return Matrix4.inverseTranspose(\n        transform,\n        scratchInverseTransposeClippingPlanesMatrix\n      );\n    },\n  };\n\n  Splitter.addUniforms(pointCloud, uniformMap);\n\n  if (isQuantized || isQuantizedDraco || isOctEncodedDraco) {\n    uniformMap = combine(uniformMap, {\n      u_quantizedVolumeScaleAndOctEncodedRange: function () {\n        const scratch = scratchQuantizedVolumeScaleAndOctEncodedRange;\n        if (defined(pointCloud._quantizedVolumeScale)) {\n          const scale = Cartesian3.clone(\n            pointCloud._quantizedVolumeScale,\n            scratch\n          );\n          Cartesian3.divideByScalar(scale, pointCloud._quantizedRange, scratch);\n        }\n        scratch.w = pointCloud._octEncodedRange;\n        return scratch;\n      },\n    });\n  }\n\n  if (defined(pointCloud._uniformMapLoaded)) {\n    uniformMap = pointCloud._uniformMapLoaded(uniformMap);\n  }\n\n  pointCloud._drawCommand.uniformMap = uniformMap;\n}\n\nfunction getStyleablePropertyIds(source, propertyIds) {\n  // Get all the property IDs used by this style\n  const regex = /czm_3dtiles_property_(\\d+)/g;\n  let matches = regex.exec(source);\n  while (matches !== null) {\n    const id = parseInt(matches[1]);\n    if (propertyIds.indexOf(id) === -1) {\n      propertyIds.push(id);\n    }\n    matches = regex.exec(source);\n  }\n}\n\nfunction getBuiltinPropertyNames(source, propertyNames) {\n  // Get all the builtin property names used by this style, ignoring the function signature\n  source = source.slice(source.indexOf(\"\\n\"));\n  const regex = /czm_3dtiles_builtin_property_(\\w+)/g;\n  let matches = regex.exec(source);\n  while (matches !== null) {\n    const name = matches[1];\n    if (propertyNames.indexOf(name) === -1) {\n      propertyNames.push(name);\n    }\n    matches = regex.exec(source);\n  }\n}\n\nfunction getVertexAttribute(vertexArray, index) {\n  const numberOfAttributes = vertexArray.numberOfAttributes;\n  for (let i = 0; i < numberOfAttributes; ++i) {\n    const attribute = vertexArray.getAttribute(i);\n    if (attribute.index === index) {\n      return attribute;\n    }\n  }\n}\n\nconst builtinVariableSubstitutionMap = {\n  POSITION: \"czm_3dtiles_builtin_property_POSITION\",\n  POSITION_ABSOLUTE: \"czm_3dtiles_builtin_property_POSITION_ABSOLUTE\",\n  COLOR: \"czm_3dtiles_builtin_property_COLOR\",\n  NORMAL: \"czm_3dtiles_builtin_property_NORMAL\",\n};\n\nfunction createShaders(pointCloud, frameState, style) {\n  let i;\n  let name;\n  let attribute;\n\n  const context = frameState.context;\n  const hasStyle = defined(style);\n  const isQuantized = pointCloud._isQuantized;\n  const isQuantizedDraco = pointCloud._isQuantizedDraco;\n  const isOctEncoded16P = pointCloud._isOctEncoded16P;\n  const isOctEncodedDraco = pointCloud._isOctEncodedDraco;\n  const isRGB565 = pointCloud._isRGB565;\n  const isTranslucent = pointCloud._isTranslucent;\n  const hasColors = pointCloud._hasColors;\n  const hasNormals = pointCloud._hasNormals;\n  const hasBatchIds = pointCloud._hasBatchIds;\n  const backFaceCulling = pointCloud._backFaceCulling;\n  const normalShading = pointCloud._normalShading;\n  const vertexArray = pointCloud._drawCommand.vertexArray;\n  const clippingPlanes = pointCloud.clippingPlanes;\n  const attenuation = pointCloud._attenuation;\n\n  let colorStyleFunction;\n  let showStyleFunction;\n  let pointSizeStyleFunction;\n  let styleTranslucent = isTranslucent;\n\n  const variableSubstitutionMap = clone(builtinVariableSubstitutionMap);\n  const propertyIdToAttributeMap = {};\n  const styleableShaderAttributes = pointCloud._styleableShaderAttributes;\n  for (name in styleableShaderAttributes) {\n    if (styleableShaderAttributes.hasOwnProperty(name)) {\n      attribute = styleableShaderAttributes[name];\n      variableSubstitutionMap[\n        name\n      ] = `czm_3dtiles_property_${attribute.location}`;\n      propertyIdToAttributeMap[attribute.location] = attribute;\n    }\n  }\n\n  if (hasStyle) {\n    const shaderState = {\n      translucent: false,\n    };\n    const parameterList =\n      \"(\" +\n      \"vec3 czm_3dtiles_builtin_property_POSITION, \" +\n      \"vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, \" +\n      \"vec4 czm_3dtiles_builtin_property_COLOR, \" +\n      \"vec3 czm_3dtiles_builtin_property_NORMAL\" +\n      \")\";\n    colorStyleFunction = style.getColorShaderFunction(\n      `getColorFromStyle${parameterList}`,\n      variableSubstitutionMap,\n      shaderState\n    );\n    showStyleFunction = style.getShowShaderFunction(\n      `getShowFromStyle${parameterList}`,\n      variableSubstitutionMap,\n      shaderState\n    );\n    pointSizeStyleFunction = style.getPointSizeShaderFunction(\n      `getPointSizeFromStyle${parameterList}`,\n      variableSubstitutionMap,\n      shaderState\n    );\n    if (defined(colorStyleFunction) && shaderState.translucent) {\n      styleTranslucent = true;\n    }\n  }\n\n  pointCloud._styleTranslucent = styleTranslucent;\n\n  const hasColorStyle = defined(colorStyleFunction);\n  const hasShowStyle = defined(showStyleFunction);\n  const hasPointSizeStyle = defined(pointSizeStyleFunction);\n  const hasClippedContent = pointCloud.isClipped;\n\n  // Get the properties in use by the style\n  const styleablePropertyIds = [];\n  const builtinPropertyNames = [];\n\n  if (hasColorStyle) {\n    getStyleablePropertyIds(colorStyleFunction, styleablePropertyIds);\n    getBuiltinPropertyNames(colorStyleFunction, builtinPropertyNames);\n  }\n  if (hasShowStyle) {\n    getStyleablePropertyIds(showStyleFunction, styleablePropertyIds);\n    getBuiltinPropertyNames(showStyleFunction, builtinPropertyNames);\n  }\n  if (hasPointSizeStyle) {\n    getStyleablePropertyIds(pointSizeStyleFunction, styleablePropertyIds);\n    getBuiltinPropertyNames(pointSizeStyleFunction, builtinPropertyNames);\n  }\n\n  const usesColorSemantic = builtinPropertyNames.indexOf(\"COLOR\") >= 0;\n  const usesNormalSemantic = builtinPropertyNames.indexOf(\"NORMAL\") >= 0;\n\n  if (usesNormalSemantic && !hasNormals) {\n    throw new RuntimeError(\n      \"Style references the NORMAL semantic but the point cloud does not have normals\"\n    );\n  }\n\n  // Disable vertex attributes that aren't used in the style, enable attributes that are\n  for (name in styleableShaderAttributes) {\n    if (styleableShaderAttributes.hasOwnProperty(name)) {\n      attribute = styleableShaderAttributes[name];\n      const enabled = styleablePropertyIds.indexOf(attribute.location) >= 0;\n      const vertexAttribute = getVertexAttribute(\n        vertexArray,\n        attribute.location\n      );\n      vertexAttribute.enabled = enabled;\n    }\n  }\n\n  const usesColors = hasColors && (!hasColorStyle || usesColorSemantic);\n  if (hasColors) {\n    // Disable the color vertex attribute if the color style does not reference the color semantic\n    const colorVertexAttribute = getVertexAttribute(vertexArray, colorLocation);\n    colorVertexAttribute.enabled = usesColors;\n  }\n\n  const usesNormals =\n    hasNormals && (normalShading || backFaceCulling || usesNormalSemantic);\n  if (hasNormals) {\n    // Disable the normal vertex attribute if normals are not used\n    const normalVertexAttribute = getVertexAttribute(\n      vertexArray,\n      normalLocation\n    );\n    normalVertexAttribute.enabled = usesNormals;\n  }\n\n  const attributeLocations = {\n    a_position: positionLocation,\n  };\n  if (usesColors) {\n    attributeLocations.a_color = colorLocation;\n  }\n  if (usesNormals) {\n    attributeLocations.a_normal = normalLocation;\n  }\n  if (hasBatchIds) {\n    attributeLocations.a_batchId = batchIdLocation;\n  }\n\n  let attributeDeclarations = \"\";\n\n  const length = styleablePropertyIds.length;\n  for (i = 0; i < length; ++i) {\n    const propertyId = styleablePropertyIds[i];\n    attribute = propertyIdToAttributeMap[propertyId];\n    const componentCount = attribute.componentCount;\n    const attributeName = `czm_3dtiles_property_${propertyId}`;\n    let attributeType;\n    if (componentCount === 1) {\n      attributeType = \"float\";\n    } else {\n      attributeType = `vec${componentCount}`;\n    }\n\n    attributeDeclarations += `in ${attributeType} ${attributeName}; \\n`;\n    attributeLocations[attributeName] = attribute.location;\n  }\n\n  createUniformMap(pointCloud, frameState);\n\n  let vs =\n    \"in vec3 a_position; \\n\" +\n    \"out vec4 v_color; \\n\" +\n    \"uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; \\n\" +\n    \"uniform vec4 u_constantColor; \\n\" +\n    \"uniform vec4 u_highlightColor; \\n\";\n\n  // The time variable is named differently for compatibility with custom\n  // shaders in Model.\n  vs += \"float u_pointSize; \\n\" + \"float tiles3d_tileset_time; \\n\";\n\n  if (attenuation) {\n    vs += \"float u_geometricError; \\n\" + \"float u_depthMultiplier; \\n\";\n  }\n\n  vs += attributeDeclarations;\n\n  if (usesColors) {\n    if (isTranslucent) {\n      vs += \"in vec4 a_color; \\n\";\n    } else if (isRGB565) {\n      vs +=\n        \"in float a_color; \\n\" +\n        \"const float SHIFT_RIGHT_11 = 1.0 / 2048.0; \\n\" +\n        \"const float SHIFT_RIGHT_5 = 1.0 / 32.0; \\n\" +\n        \"const float SHIFT_LEFT_11 = 2048.0; \\n\" +\n        \"const float SHIFT_LEFT_5 = 32.0; \\n\" +\n        \"const float NORMALIZE_6 = 1.0 / 64.0; \\n\" +\n        \"const float NORMALIZE_5 = 1.0 / 32.0; \\n\";\n    } else {\n      vs += \"in vec3 a_color; \\n\";\n    }\n  }\n  if (usesNormals) {\n    if (isOctEncoded16P || isOctEncodedDraco) {\n      vs += \"in vec2 a_normal; \\n\";\n    } else {\n      vs += \"in vec3 a_normal; \\n\";\n    }\n  }\n\n  if (hasBatchIds) {\n    vs += \"in float a_batchId; \\n\";\n  }\n\n  if (isQuantized || isQuantizedDraco || isOctEncodedDraco) {\n    vs += \"uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; \\n\";\n  }\n\n  if (hasColorStyle) {\n    vs += colorStyleFunction;\n  }\n\n  if (hasShowStyle) {\n    vs += showStyleFunction;\n  }\n\n  if (hasPointSizeStyle) {\n    vs += pointSizeStyleFunction;\n  }\n\n  vs +=\n    \"void main() \\n\" +\n    \"{ \\n\" +\n    \"    u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; \\n\" +\n    \"    tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; \\n\";\n\n  if (attenuation) {\n    vs +=\n      \"    u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; \\n\" +\n      \"    u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; \\n\";\n  }\n\n  if (usesColors) {\n    if (isTranslucent) {\n      vs += \"    vec4 color = a_color; \\n\";\n    } else if (isRGB565) {\n      vs +=\n        \"    float compressed = a_color; \\n\" +\n        \"    float r = floor(compressed * SHIFT_RIGHT_11); \\n\" +\n        \"    compressed -= r * SHIFT_LEFT_11; \\n\" +\n        \"    float g = floor(compressed * SHIFT_RIGHT_5); \\n\" +\n        \"    compressed -= g * SHIFT_LEFT_5; \\n\" +\n        \"    float b = compressed; \\n\" +\n        \"    vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); \\n\" +\n        \"    vec4 color = vec4(rgb, 1.0); \\n\";\n    } else {\n      vs += \"    vec4 color = vec4(a_color, 1.0); \\n\";\n    }\n  } else {\n    vs += \"    vec4 color = u_constantColor; \\n\";\n  }\n\n  if (isQuantized || isQuantizedDraco) {\n    vs +=\n      \"    vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; \\n\";\n  } else {\n    vs += \"    vec3 position = a_position; \\n\";\n  }\n  vs +=\n    \"    vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); \\n\";\n\n  if (usesNormals) {\n    if (isOctEncoded16P) {\n      vs += \"    vec3 normal = czm_octDecode(a_normal); \\n\";\n    } else if (isOctEncodedDraco) {\n      // Draco oct-encoding decodes to zxy order\n      vs +=\n        \"    vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; \\n\";\n    } else {\n      vs += \"    vec3 normal = a_normal; \\n\";\n    }\n    vs += \"    vec3 normalEC = czm_normal * normal; \\n\";\n  } else {\n    vs += \"    vec3 normal = vec3(1.0); \\n\";\n  }\n\n  if (hasColorStyle) {\n    vs +=\n      \"    color = getColorFromStyle(position, position_absolute, color, normal); \\n\";\n  }\n\n  if (hasShowStyle) {\n    vs +=\n      \"    float show = float(getShowFromStyle(position, position_absolute, color, normal)); \\n\";\n  }\n\n  if (hasPointSizeStyle) {\n    vs +=\n      \"    gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; \\n\";\n  } else if (attenuation) {\n    vs +=\n      \"    vec4 positionEC = czm_modelView * vec4(position, 1.0); \\n\" +\n      \"    float depth = -positionEC.z; \\n\" +\n      // compute SSE for this point\n      \"    gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); \\n\";\n  } else {\n    vs += \"    gl_PointSize = u_pointSize; \\n\";\n  }\n\n  vs += \"    color = color * u_highlightColor; \\n\";\n\n  if (usesNormals && normalShading) {\n    vs +=\n      \"    float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); \\n\" +\n      \"    diffuseStrength = max(diffuseStrength, 0.4); \\n\" + // Apply some ambient lighting\n      \"    color.xyz *= diffuseStrength * czm_lightColor; \\n\";\n  }\n\n  vs +=\n    \"    v_color = color; \\n\" +\n    \"    gl_Position = czm_modelViewProjection * vec4(position, 1.0); \\n\";\n\n  if (usesNormals && backFaceCulling) {\n    vs +=\n      \"    float visible = step(-normalEC.z, 0.0); \\n\" +\n      \"    gl_Position *= visible; \\n\" +\n      \"    gl_PointSize *= visible; \\n\";\n  }\n\n  if (hasShowStyle) {\n    vs +=\n      \"    gl_Position.w *= float(show); \\n\" +\n      \"    gl_PointSize *= float(show); \\n\";\n  }\n\n  vs += \"} \\n\";\n\n  let fs = \"in vec4 v_color; \\n\";\n\n  if (hasClippedContent) {\n    fs +=\n      \"uniform highp sampler2D u_clippingPlanes; \\n\" +\n      \"uniform mat4 u_clippingPlanesMatrix; \\n\" +\n      \"uniform vec4 u_clippingPlanesEdgeStyle; \\n\";\n    fs += \"\\n\";\n    fs += getClippingFunction(clippingPlanes, context);\n    fs += \"\\n\";\n  }\n\n  fs +=\n    \"void main() \\n\" +\n    \"{ \\n\" +\n    \"    out_FragColor = czm_gammaCorrect(v_color); \\n\";\n\n  if (hasClippedContent) {\n    fs += getClipAndStyleCode(\n      \"u_clippingPlanes\",\n      \"u_clippingPlanesMatrix\",\n      \"u_clippingPlanesEdgeStyle\"\n    );\n  }\n\n  fs += \"} \\n\";\n\n  if (pointCloud.splitDirection !== SplitDirection.NONE) {\n    fs = Splitter.modifyFragmentShader(fs);\n  }\n\n  if (defined(pointCloud._vertexShaderLoaded)) {\n    vs = pointCloud._vertexShaderLoaded(vs);\n  }\n\n  if (defined(pointCloud._fragmentShaderLoaded)) {\n    fs = pointCloud._fragmentShaderLoaded(fs);\n  }\n\n  const drawCommand = pointCloud._drawCommand;\n  if (defined(drawCommand.shaderProgram)) {\n    // Destroy the old shader\n    drawCommand.shaderProgram.destroy();\n  }\n  drawCommand.shaderProgram = ShaderProgram.fromCache({\n    context: context,\n    vertexShaderSource: vs,\n    fragmentShaderSource: fs,\n    attributeLocations: attributeLocations,\n  });\n\n  try {\n    // Check if the shader compiles correctly. If not there is likely a syntax error with the style.\n    drawCommand.shaderProgram._bind();\n  } catch (error) {\n    // Rephrase the error.\n    throw new RuntimeError(\n      \"Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.\"\n    );\n  }\n}\n\nfunction decodeDraco(pointCloud, context) {\n  if (pointCloud._decodingState === DecodingState.READY) {\n    return false;\n  }\n  if (pointCloud._decodingState === DecodingState.NEEDS_DECODE) {\n    const parsedContent = pointCloud._parsedContent;\n    const draco = parsedContent.draco;\n    const decodePromise = DracoLoader.decodePointCloud(draco, context);\n    if (defined(decodePromise)) {\n      pointCloud._decodingState = DecodingState.DECODING;\n      decodePromise\n        .then(function (result) {\n          pointCloud._decodingState = DecodingState.READY;\n          const decodedPositions = defined(result.POSITION)\n            ? result.POSITION.array\n            : undefined;\n          const decodedRgb = defined(result.RGB) ? result.RGB.array : undefined;\n          const decodedRgba = defined(result.RGBA)\n            ? result.RGBA.array\n            : undefined;\n          const decodedNormals = defined(result.NORMAL)\n            ? result.NORMAL.array\n            : undefined;\n          const decodedBatchIds = defined(result.BATCH_ID)\n            ? result.BATCH_ID.array\n            : undefined;\n          const isQuantizedDraco =\n            defined(decodedPositions) &&\n            defined(result.POSITION.data.quantization);\n          const isOctEncodedDraco =\n            defined(decodedNormals) && defined(result.NORMAL.data.quantization);\n          if (isQuantizedDraco) {\n            // Draco quantization range == quantized volume scale - size in meters of the quantized volume\n            // Internal quantized range is the range of values of the quantized data, e.g. 255 for 8-bit, 1023 for 10-bit, etc\n            const quantization = result.POSITION.data.quantization;\n            const range = quantization.range;\n            pointCloud._quantizedVolumeScale = Cartesian3.fromElements(\n              range,\n              range,\n              range\n            );\n            pointCloud._quantizedVolumeOffset = Cartesian3.unpack(\n              quantization.minValues\n            );\n            pointCloud._quantizedRange =\n              (1 << quantization.quantizationBits) - 1.0;\n            pointCloud._isQuantizedDraco = true;\n          }\n          if (isOctEncodedDraco) {\n            pointCloud._octEncodedRange =\n              (1 << result.NORMAL.data.quantization.quantizationBits) - 1.0;\n            pointCloud._isOctEncodedDraco = true;\n          }\n          let styleableProperties = parsedContent.styleableProperties;\n          const batchTableProperties = draco.batchTableProperties;\n          for (const name in batchTableProperties) {\n            if (batchTableProperties.hasOwnProperty(name)) {\n              const property = result[name];\n              if (!defined(styleableProperties)) {\n                styleableProperties = {};\n              }\n              styleableProperties[name] = {\n                typedArray: property.array,\n                componentCount: property.data.componentsPerAttribute,\n              };\n            }\n          }\n\n          if (defined(decodedPositions)) {\n            parsedContent.positions = {\n              typedArray: decodedPositions,\n            };\n          }\n\n          const decodedColors = defaultValue(decodedRgba, decodedRgb);\n          if (defined(decodedColors)) {\n            parsedContent.colors = {\n              typedArray: decodedColors,\n            };\n          }\n\n          if (defined(decodedNormals)) {\n            parsedContent.normals = {\n              typedArray: decodedNormals,\n            };\n          }\n\n          if (defined(decodedBatchIds)) {\n            parsedContent.batchIds = {\n              typedArray: decodedBatchIds,\n            };\n          }\n\n          parsedContent.styleableProperties = styleableProperties;\n        })\n        .catch(function (error) {\n          pointCloud._decodingState = DecodingState.FAILED;\n          pointCloud._error = error;\n        });\n    }\n  }\n  return true;\n}\n\nconst scratchComputedTranslation = new Cartesian4();\nconst scratchScale = new Cartesian3();\n\nPointCloud.prototype.update = function (frameState) {\n  const context = frameState.context;\n\n  if (defined(this._error)) {\n    const error = this._error;\n    this._error = undefined;\n    throw error;\n  }\n\n  const decoding = decodeDraco(this, context);\n  if (decoding) {\n    return;\n  }\n\n  let shadersDirty = false;\n  let modelMatrixDirty = !Matrix4.equals(this._modelMatrix, this.modelMatrix);\n\n  if (this._mode !== frameState.mode) {\n    this._mode = frameState.mode;\n    modelMatrixDirty = true;\n  }\n\n  if (!defined(this._drawCommand)) {\n    createResources(this, frameState);\n    modelMatrixDirty = true;\n    shadersDirty = true;\n    this._ready = true;\n    this._parsedContent = undefined; // Unload\n  }\n\n  if (modelMatrixDirty) {\n    Matrix4.clone(this.modelMatrix, this._modelMatrix);\n    const modelMatrix = this._drawCommand.modelMatrix;\n    Matrix4.clone(this._modelMatrix, modelMatrix);\n\n    if (defined(this._rtcCenter)) {\n      Matrix4.multiplyByTranslation(modelMatrix, this._rtcCenter, modelMatrix);\n    }\n    if (defined(this._quantizedVolumeOffset)) {\n      Matrix4.multiplyByTranslation(\n        modelMatrix,\n        this._quantizedVolumeOffset,\n        modelMatrix\n      );\n    }\n\n    if (frameState.mode !== SceneMode.SCENE3D) {\n      const projection = frameState.mapProjection;\n      const translation = Matrix4.getColumn(\n        modelMatrix,\n        3,\n        scratchComputedTranslation\n      );\n      if (!Cartesian4.equals(translation, Cartesian4.UNIT_W)) {\n        Transforms.basisTo2D(projection, modelMatrix, modelMatrix);\n      }\n    }\n\n    const boundingSphere = this._drawCommand.boundingVolume;\n    BoundingSphere.clone(this._boundingSphere, boundingSphere);\n\n    if (this._cull) {\n      const center = boundingSphere.center;\n      Matrix4.multiplyByPoint(modelMatrix, center, center);\n      const scale = Matrix4.getScale(modelMatrix, scratchScale);\n      boundingSphere.radius *= Cartesian3.maximumComponent(scale);\n    }\n  }\n\n  if (this.clippingPlanesDirty) {\n    this.clippingPlanesDirty = false;\n    shadersDirty = true;\n  }\n\n  if (this._attenuation !== this.attenuation) {\n    this._attenuation = this.attenuation;\n    shadersDirty = true;\n  }\n\n  if (this.backFaceCulling !== this._backFaceCulling) {\n    this._backFaceCulling = this.backFaceCulling;\n    shadersDirty = true;\n  }\n\n  if (this.normalShading !== this._normalShading) {\n    this._normalShading = this.normalShading;\n    shadersDirty = true;\n  }\n\n  if (this._style !== this.style || this.styleDirty) {\n    this._style = this.style;\n    this.styleDirty = false;\n    shadersDirty = true;\n  }\n\n  const splittingEnabled = this.splitDirection !== SplitDirection.NONE;\n  if (this._splittingEnabled !== splittingEnabled) {\n    this._splittingEnabled = splittingEnabled;\n    shadersDirty = true;\n  }\n\n  if (shadersDirty) {\n    createShaders(this, frameState, this._style);\n  }\n\n  this._drawCommand.castShadows = ShadowMode.castShadows(this.shadows);\n  this._drawCommand.receiveShadows = ShadowMode.receiveShadows(this.shadows);\n\n  // Update the render state\n  const isTranslucent =\n    this._highlightColor.alpha < 1.0 ||\n    this._constantColor.alpha < 1.0 ||\n    this._styleTranslucent;\n  this._drawCommand.renderState = isTranslucent\n    ? this._translucentRenderState\n    : this._opaqueRenderState;\n  this._drawCommand.pass = isTranslucent ? Pass.TRANSLUCENT : this._opaquePass;\n\n  const commandList = frameState.commandList;\n\n  const passes = frameState.passes;\n  if (passes.render || passes.pick) {\n    commandList.push(this._drawCommand);\n  }\n};\n\nPointCloud.prototype.isDestroyed = function () {\n  return false;\n};\n\nPointCloud.prototype.destroy = function () {\n  const command = this._drawCommand;\n  if (defined(command)) {\n    command.vertexArray = command.vertexArray && command.vertexArray.destroy();\n    command.shaderProgram =\n      command.shaderProgram && command.shaderProgram.destroy();\n  }\n  return destroyObject(this);\n};\nexport default PointCloud;\n", "import Check from \"../Core/Check.js\";\n\n/**\n * Gets a GLSL snippet that clips a fragment using the `clip` function from {@link getClippingFunction} and styles it.\n *\n * @param {string} samplerUniformName Name of the uniform for the clipping planes texture sampler.\n * @param {string} matrixUniformName Name of the uniform for the clipping planes matrix.\n * @param {string} styleUniformName Name of the uniform for the clipping planes style, a vec4.\n * @returns {string} A string containing GLSL that clips and styles the current fragment.\n * @private\n */\nfunction getClipAndStyleCode(\n  samplerUniformName,\n  matrixUniformName,\n  styleUniformName\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"samplerUniformName\", samplerUniformName);\n  Check.typeOf.string(\"matrixUniformName\", matrixUniformName);\n  Check.typeOf.string(\"styleUniformName\", styleUniformName);\n  //>>includeEnd('debug');\n\n  const shaderCode =\n    `    float clipDistance = clip(gl_FragCoord, ${samplerUniformName}, ${matrixUniformName}); \\n` +\n    `    vec4 clippingPlanesEdgeColor = vec4(1.0); \\n` +\n    `    clippingPlanesEdgeColor.rgb = ${styleUniformName}.rgb; \\n` +\n    `    float clippingPlanesEdgeWidth = ${styleUniformName}.a; \\n` +\n    `    if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \\n` +\n    `    { \\n` +\n    `        out_FragColor = clippingPlanesEdgeColor;\\n` +\n    `    } \\n`;\n  return shaderCode;\n}\nexport default getClipAndStyleCode;\n", "import ShaderSource from \"../Renderer/ShaderSource.js\";\n\n/**\n * Support for rendering things on only one side of the screen.\n *\n * @private\n */\nconst Splitter = {\n  /**\n   * Given a fragment shader string, returns a modified version of it that\n   * only renders on one side of the screen or the other. Fragments on the\n   * other side are discarded. The screen side is given by a uniform called\n   * `czm_splitDirection`, which can be added by calling\n   * {@link Splitter#addUniforms}, and the split position is given by an\n   * automatic uniform called `czm_splitPosition`.\n   */\n  modifyFragmentShader: function modifyFragmentShader(shader) {\n    shader = ShaderSource.replaceMain(shader, \"czm_splitter_main\");\n    shader +=\n      // czm_splitPosition is not declared because it is an automatic uniform.\n      \"uniform float czm_splitDirection; \\n\" +\n      \"void main() \\n\" +\n      \"{ \\n\" +\n      // Don't split when rendering the shadow map, because it is rendered from\n      // the perspective of a totally different camera.\n      \"#ifndef SHADOW_MAP\\n\" +\n      \"    if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; \\n\" +\n      \"    if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; \\n\" +\n      \"#endif\\n\" +\n      \"    czm_splitter_main(); \\n\" +\n      \"} \\n\";\n\n    return shader;\n  },\n\n  /**\n   * Add `czm_splitDirection` to the given uniform map.\n   *\n   * @param {object} object The object on which the `splitDirection` property may be found.\n   * @param {object} uniformMap The uniform map.\n   */\n  addUniforms: function addUniforms(object, uniformMap) {\n    uniformMap.czm_splitDirection = function () {\n      return object.splitDirection;\n    };\n  },\n};\n\nexport default Splitter;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * Provides general quadtree tiles to be displayed on or near the surface of an ellipsoid.  It is intended to be\n * used with the {@link QuadtreePrimitive}.  This type describes an interface and is not intended to be\n * instantiated directly.\n *\n * @alias QuadtreeTileProvider\n * @constructor\n * @private\n */\nfunction QuadtreeTileProvider() {\n  DeveloperError.throwInstantiationError();\n}\n\n/**\n * Computes the default geometric error for level zero of the quadtree.\n *\n * @memberof QuadtreeTileProvider\n *\n * @param {TilingScheme} tilingScheme The tiling scheme for which to compute the geometric error.\n * @returns {number} The maximum geometric error at level zero, in meters.\n */\nQuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError = function (\n  tilingScheme\n) {\n  return (\n    (tilingScheme.ellipsoid.maximumRadius * 2 * Math.PI * 0.25) /\n    (65 * tilingScheme.getNumberOfXTilesAtLevel(0))\n  );\n};\n\nObject.defineProperties(QuadtreeTileProvider.prototype, {\n  /**\n   * Gets or sets the {@link QuadtreePrimitive} for which this provider is\n   * providing tiles.\n   * @memberof QuadtreeTileProvider.prototype\n   * @type {QuadtreePrimitive}\n   */\n  quadtree: {\n    get: DeveloperError.throwInstantiationError,\n    set: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the tiling scheme used by the provider.\n   * @memberof QuadtreeTileProvider.prototype\n   * @type {TilingScheme}\n   */\n  tilingScheme: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets an event that is raised when the geometry provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof QuadtreeTileProvider.prototype\n   * @type {Event}\n   */\n  errorEvent: {\n    get: DeveloperError.throwInstantiationError,\n  },\n});\n\n/**\n * Called at the beginning of the update cycle, regardless of id a new frame is being rendered, before {@link QuadtreeTileProvider#beginUpdate}\n * @memberof QuadtreeTileProvider\n * @function\n *\n * @param {Context} context The rendering context.\n * @param {FrameState} frameState The frame state.\n */\nQuadtreeTileProvider.prototype.update = DeveloperError.throwInstantiationError;\n\n/**\n * Called at the beginning of the update cycle for each render frame, before {@link QuadtreeTileProvider#showTileThisFrame}\n * or any other functions.\n * @memberof QuadtreeTileProvider\n * @function\n *\n * @param {Context} context The rendering context.\n * @param {FrameState} frameState The frame state.\n * @param {DrawCommand[]} commandList An array of rendering commands.  This method may push\n *        commands into this array.\n */\nQuadtreeTileProvider.prototype.beginUpdate =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Called at the end of the update cycle for each render frame, after {@link QuadtreeTileProvider#showTileThisFrame}\n * and any other functions.\n * @memberof QuadtreeTileProvider\n * @function\n *\n * @param {Context} context The rendering context.\n * @param {FrameState} frameState The frame state.\n * @param {DrawCommand[]} commandList An array of rendering commands.  This method may push\n *        commands into this array.\n */\nQuadtreeTileProvider.prototype.endUpdate =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level, in meters.\n *\n * @see QuadtreeTileProvider#computeDefaultLevelZeroMaximumGeometricError\n *\n * @memberof QuadtreeTileProvider\n * @function\n *\n * @param {number} level The tile level for which to get the maximum geometric error.\n * @returns {number} The maximum geometric error in meters.\n */\nQuadtreeTileProvider.prototype.getLevelMaximumGeometricError =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Loads, or continues loading, a given tile.  This function will continue to be called\n * until {@link QuadtreeTile#state} is no longer {@link QuadtreeTileLoadState#LOADING}.\n *\n * @memberof QuadtreeTileProvider\n * @function\n *\n * @param {Context} context The rendering context.\n * @param {FrameState} frameState The frame state.\n * @param {QuadtreeTile} tile The tile to load.\n */\nQuadtreeTileProvider.prototype.loadTile =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Determines the visibility of a given tile.  The tile may be fully visible, partially visible, or not\n * visible at all.  Tiles that are renderable and are at least partially visible will be shown by a call\n * to {@link QuadtreeTileProvider#showTileThisFrame}.\n *\n * @memberof QuadtreeTileProvider\n *\n * @param {QuadtreeTile} tile The tile instance.\n * @param {FrameState} frameState The state information about the current frame.\n * @param {QuadtreeOccluders} occluders The objects that may occlude this tile.\n *\n * @returns {Visibility} The visibility of the tile.\n */\nQuadtreeTileProvider.prototype.computeTileVisibility =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Shows a specified tile in this frame.  The provider can cause the tile to be shown by adding\n * render commands to the commandList, or use any other method as appropriate.  The tile is not\n * expected to be visible next frame as well, unless this method is call next frame, too.\n *\n * @memberof QuadtreeTileProvider\n * @function\n *\n * @param {QuadtreeTile} tile The tile instance.\n * @param {Context} context The rendering context.\n * @param {FrameState} frameState The state information of the current rendering frame.\n * @param {DrawCommand[]} commandList The list of rendering commands.  This method may add additional commands to this list.\n */\nQuadtreeTileProvider.prototype.showTileThisFrame =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Gets the distance from the camera to the closest point on the tile.  This is used for level-of-detail selection.\n *\n * @memberof QuadtreeTileProvider\n * @function\n *\n * @param {QuadtreeTile} tile The tile instance.\n * @param {FrameState} frameState The state information of the current rendering frame.\n *\n * @returns {number} The distance from the camera to the closest point on the tile, in meters.\n */\nQuadtreeTileProvider.prototype.computeDistanceToTile =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @memberof QuadtreeTileProvider\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see QuadtreeTileProvider#destroy\n */\nQuadtreeTileProvider.prototype.isDestroyed =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @memberof QuadtreeTileProvider\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * provider = provider && provider();\n *\n * @see QuadtreeTileProvider#isDestroyed\n */\nQuadtreeTileProvider.prototype.destroy = DeveloperError.throwInstantiationError;\nexport default QuadtreeTileProvider;\n", "import binarySearch from \"../Core/binarySearch.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport KeyframeNode from \"./KeyframeNode.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\n\n/**\n * @alias SpatialNode\n * @constructor\n *\n * @param {number} level\n * @param {number} x\n * @param {number} y\n * @param {number} z\n * @param {SpatialNode} parent\n * @param {VoxelShape} shape\n * @param {Cartesian3} voxelDimensions\n *\n * @private\n */\nfunction SpatialNode(level, x, y, z, parent, shape, voxelDimensions) {\n  /**\n   * @ignore\n   * @type {SpatialNode[]}\n   */\n  this.children = undefined;\n  this.parent = parent;\n\n  this.level = level;\n  this.x = x;\n  this.y = y;\n  this.z = z;\n\n  /**\n   * @ignore\n   * @type {KeyframeNode[]}\n   */\n  this.keyframeNodes = [];\n  /**\n   * @ignore\n   * @type {KeyframeNode[]}\n   */\n  this.renderableKeyframeNodes = [];\n\n  this.renderableKeyframeNodeLerp = 0.0;\n  /**\n   * @ignore\n   * @type {KeyframeNode}\n   */\n  this.renderableKeyframeNodePrevious = undefined;\n  /**\n   * @ignore\n   * @type {KeyframeNode}\n   */\n  this.renderableKeyframeNodeNext = undefined;\n\n  this.orientedBoundingBox = new OrientedBoundingBox();\n  this.approximateVoxelSize = 0.0;\n  this.screenSpaceError = 0.0;\n  this.visitedFrameNumber = -1;\n\n  this.computeBoundingVolumes(shape, voxelDimensions);\n}\n\nconst scratchObbHalfScale = new Cartesian3();\n\n/**\n * @param {VoxelShape} shape\n * @param {Cartesian3} voxelDimensions\n */\nSpatialNode.prototype.computeBoundingVolumes = function (\n  shape,\n  voxelDimensions\n) {\n  this.orientedBoundingBox = shape.computeOrientedBoundingBoxForTile(\n    this.level,\n    this.x,\n    this.y,\n    this.z,\n    this.orientedBoundingBox\n  );\n\n  const halfScale = Matrix3.getScale(\n    this.orientedBoundingBox.halfAxes,\n    scratchObbHalfScale\n  );\n  const maximumScale = 2.0 * Cartesian3.maximumComponent(halfScale);\n  this.approximateVoxelSize =\n    maximumScale / Cartesian3.minimumComponent(voxelDimensions);\n};\n\n/**\n * @param {VoxelShape} shape The shape of the parent VoxelPrimitive\n * @param {Cartesian3} voxelDimensions\n * @private\n */\nSpatialNode.prototype.constructChildNodes = function (shape, voxelDimensions) {\n  const { level, x, y, z } = this;\n  const xMin = x * 2;\n  const yMin = y * 2;\n  const zMin = z * 2;\n  const yMax = yMin + 1;\n  const xMax = xMin + 1;\n  const zMax = zMin + 1;\n  const childLevel = level + 1;\n\n  const childCoords = [\n    [childLevel, xMin, yMin, zMin],\n    [childLevel, xMax, yMin, zMin],\n    [childLevel, xMin, yMax, zMin],\n    [childLevel, xMax, yMax, zMin],\n    [childLevel, xMin, yMin, zMax],\n    [childLevel, xMax, yMin, zMax],\n    [childLevel, xMin, yMax, zMax],\n    [childLevel, xMax, yMax, zMax],\n  ];\n\n  this.children = childCoords.map(([level, x, y, z]) => {\n    return new SpatialNode(level, x, y, z, this, shape, voxelDimensions);\n  });\n};\n\n/**\n * @param {FrameState} frameState\n * @param {number} visibilityPlaneMask\n * @returns {number} A plane mask as described in {@link CullingVolume#computeVisibilityWithPlaneMask}.\n */\nSpatialNode.prototype.visibility = function (frameState, visibilityPlaneMask) {\n  const obb = this.orientedBoundingBox;\n  const cullingVolume = frameState.cullingVolume;\n  return cullingVolume.computeVisibilityWithPlaneMask(obb, visibilityPlaneMask);\n};\n\n/**\n * @param {Cartesian3} cameraPosition\n * @param {number} screenSpaceErrorMultiplier\n */\nSpatialNode.prototype.computeScreenSpaceError = function (\n  cameraPosition,\n  screenSpaceErrorMultiplier\n) {\n  const obb = this.orientedBoundingBox;\n\n  let distance = Math.sqrt(obb.distanceSquaredTo(cameraPosition));\n  // Avoid divide-by-zero when viewer is inside the tile.\n  distance = Math.max(distance, CesiumMath.EPSILON7);\n  const approximateVoxelSize = this.approximateVoxelSize;\n  const error = screenSpaceErrorMultiplier * (approximateVoxelSize / distance);\n  this.screenSpaceError = error;\n};\n\n// This object imitates a KeyframeNode. Only used for binary search function.\nconst scratchBinarySearchKeyframeNode = {\n  keyframe: 0,\n};\n\n/**\n * Find the index of a given key frame position within an array of KeyframeNodes,\n * or the complement (~) of the index where it would be in the sorted array.\n * @param {number} keyframe\n * @param {KeyframeNode[]} keyframeNodes\n * @returns {number}\n * @private\n */\nfunction findKeyframeIndex(keyframe, keyframeNodes) {\n  scratchBinarySearchKeyframeNode.keyframe = keyframe;\n  return binarySearch(\n    keyframeNodes,\n    scratchBinarySearchKeyframeNode,\n    KeyframeNode.searchComparator\n  );\n}\n\n/**\n * Computes the most suitable keyframes for rendering, balancing between temporal and visual quality.\n *\n * @param {number} keyframeLocation\n */\nSpatialNode.prototype.computeSurroundingRenderableKeyframeNodes = function (\n  keyframeLocation\n) {\n  let spatialNode = this;\n  const startLevel = spatialNode.level;\n\n  const targetKeyframePrev = Math.floor(keyframeLocation);\n  const targetKeyframeNext = Math.ceil(keyframeLocation);\n\n  let bestKeyframeNodePrev;\n  let bestKeyframeNodeNext;\n  let minimumDistancePrev = +Number.MAX_VALUE;\n  let minimumDistanceNext = +Number.MAX_VALUE;\n\n  while (defined(spatialNode)) {\n    const { renderableKeyframeNodes } = spatialNode;\n\n    if (renderableKeyframeNodes.length >= 1) {\n      const indexPrev = getKeyframeIndexPrev(\n        targetKeyframePrev,\n        renderableKeyframeNodes\n      );\n      const keyframeNodePrev = renderableKeyframeNodes[indexPrev];\n\n      const indexNext =\n        targetKeyframeNext === targetKeyframePrev ||\n        targetKeyframePrev < keyframeNodePrev.keyframe\n          ? indexPrev\n          : Math.min(indexPrev + 1, renderableKeyframeNodes.length - 1);\n      const keyframeNodeNext = renderableKeyframeNodes[indexNext];\n\n      const distancePrev = targetKeyframePrev - keyframeNodePrev.keyframe;\n      const weightedDistancePrev = getWeightedKeyframeDistance(\n        startLevel - spatialNode.level,\n        distancePrev\n      );\n      if (weightedDistancePrev < minimumDistancePrev) {\n        minimumDistancePrev = weightedDistancePrev;\n        bestKeyframeNodePrev = keyframeNodePrev;\n      }\n\n      const distanceNext = keyframeNodeNext.keyframe - targetKeyframeNext;\n      const weightedDistanceNext = getWeightedKeyframeDistance(\n        startLevel - spatialNode.level,\n        distanceNext\n      );\n      if (weightedDistanceNext < minimumDistanceNext) {\n        minimumDistanceNext = weightedDistanceNext;\n        bestKeyframeNodeNext = keyframeNodeNext;\n      }\n\n      if (distancePrev === 0 && distanceNext === 0) {\n        // Nothing higher up will be better, so break early.\n        break;\n      }\n    }\n\n    spatialNode = spatialNode.parent;\n  }\n\n  this.renderableKeyframeNodePrevious = bestKeyframeNodePrev;\n  this.renderableKeyframeNodeNext = bestKeyframeNodeNext;\n\n  if (!defined(bestKeyframeNodePrev) || !defined(bestKeyframeNodeNext)) {\n    return;\n  }\n\n  const bestKeyframePrev = bestKeyframeNodePrev.keyframe;\n  const bestKeyframeNext = bestKeyframeNodeNext.keyframe;\n  this.renderableKeyframeNodeLerp =\n    bestKeyframePrev === bestKeyframeNext\n      ? 0.0\n      : CesiumMath.clamp(\n          (keyframeLocation - bestKeyframePrev) /\n            (bestKeyframeNext - bestKeyframePrev),\n          0.0,\n          1.0\n        );\n};\n\nfunction getKeyframeIndexPrev(targetKeyframe, keyframeNodes) {\n  const keyframeIndex = findKeyframeIndex(targetKeyframe, keyframeNodes);\n  return keyframeIndex < 0\n    ? CesiumMath.clamp(~keyframeIndex - 1, 0, keyframeNodes.length - 1)\n    : keyframeIndex;\n}\n\nfunction getWeightedKeyframeDistance(levelDistance, keyframeDistance) {\n  // Balance quality between visual (levelDistance) and temporal (keyframeDistance)\n  const levelWeight = Math.exp(levelDistance * 4.0);\n  // Keyframes on the opposite of the desired direction are deprioritized.\n  const keyframeWeight = keyframeDistance >= 0 ? 1.0 : -200.0;\n  return levelDistance * levelWeight + keyframeDistance * keyframeWeight;\n}\n\n/**\n * @param {number} frameNumber\n * @returns {boolean}\n */\nSpatialNode.prototype.isVisited = function (frameNumber) {\n  return this.visitedFrameNumber === frameNumber;\n};\n\n/**\n * @param {number} keyframe\n */\nSpatialNode.prototype.createKeyframeNode = function (keyframe) {\n  let index = findKeyframeIndex(keyframe, this.keyframeNodes);\n  if (index < 0) {\n    index = ~index; // convert to insertion index\n    const keyframeNode = new KeyframeNode(this, keyframe);\n    this.keyframeNodes.splice(index, 0, keyframeNode);\n  }\n};\n\n/**\n * @param {KeyframeNode} keyframeNode\n * @param {Megatexture[]} megatextures\n */\nSpatialNode.prototype.destroyKeyframeNode = function (\n  keyframeNode,\n  megatextures\n) {\n  const keyframe = keyframeNode.keyframe;\n  const keyframeIndex = findKeyframeIndex(keyframe, this.keyframeNodes);\n  if (keyframeIndex < 0) {\n    throw new DeveloperError(\"Keyframe node does not exist.\");\n  }\n\n  this.keyframeNodes.splice(keyframeIndex, 1);\n\n  if (keyframeNode.megatextureIndex !== -1) {\n    for (let i = 0; i < megatextures.length; i++) {\n      megatextures[i].remove(keyframeNode.megatextureIndex);\n    }\n\n    const renderableKeyframeNodeIndex = findKeyframeIndex(\n      keyframe,\n      this.renderableKeyframeNodes\n    );\n    if (renderableKeyframeNodeIndex < 0) {\n      throw new DeveloperError(\"Renderable keyframe node does not exist.\");\n    }\n\n    this.renderableKeyframeNodes.splice(renderableKeyframeNodeIndex, 1);\n  }\n\n  keyframeNode.spatialNode = undefined;\n  keyframeNode.state = KeyframeNode.LoadState.UNLOADED;\n  keyframeNode.metadatas = {};\n  keyframeNode.megatextureIndex = -1;\n  keyframeNode.priority = -Number.MAX_VALUE;\n  keyframeNode.highPriorityFrameNumber = -1;\n};\n\n/**\n * @param {KeyframeNode} keyframeNode\n * @param {Megatexture[]} megatextures\n */\nSpatialNode.prototype.addKeyframeNodeToMegatextures = function (\n  keyframeNode,\n  megatextures\n) {\n  if (\n    keyframeNode.state !== KeyframeNode.LoadState.RECEIVED ||\n    keyframeNode.megatextureIndex !== -1 ||\n    keyframeNode.metadatas.length !== megatextures.length\n  ) {\n    throw new DeveloperError(\"Keyframe node cannot be added to megatexture\");\n  }\n\n  for (let i = 0; i < megatextures.length; i++) {\n    const megatexture = megatextures[i];\n    keyframeNode.megatextureIndex = megatexture.add(keyframeNode.metadatas[i]);\n    keyframeNode.metadatas[i] = undefined; // data is in megatexture so no need to hold onto it\n  }\n\n  keyframeNode.state = KeyframeNode.LoadState.LOADED;\n\n  const renderableKeyframeNodes = this.renderableKeyframeNodes;\n  let renderableKeyframeNodeIndex = findKeyframeIndex(\n    keyframeNode.keyframe,\n    renderableKeyframeNodes\n  );\n  if (renderableKeyframeNodeIndex >= 0) {\n    throw new DeveloperError(\"Keyframe already renderable\");\n  }\n  renderableKeyframeNodeIndex = ~renderableKeyframeNodeIndex;\n  renderableKeyframeNodes.splice(renderableKeyframeNodeIndex, 0, keyframeNode);\n};\n\n/**\n * @param {number} frameNumber\n * @returns {boolean}\n */\nSpatialNode.prototype.isRenderable = function (frameNumber) {\n  const previousNode = this.renderableKeyframeNodePrevious;\n  const nextNode = this.renderableKeyframeNodeNext;\n  const level = this.level;\n\n  return (\n    defined(previousNode) &&\n    defined(nextNode) &&\n    (previousNode.spatialNode.level === level ||\n      nextNode.spatialNode.level === level) &&\n    this.visitedFrameNumber === frameNumber\n  );\n};\n\nexport default SpatialNode;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport CesiumMath from \"../Core/Math.js\";\n\n/**\n * A ParticleEmitter that emits particles within a sphere.\n * Particles will be positioned randomly within the sphere and have initial velocities emanating from the center of the sphere.\n *\n * @alias SphereEmitter\n * @constructor\n *\n * @param {number} [radius=1.0] The radius of the sphere in meters.\n */\nfunction SphereEmitter(radius) {\n  radius = defaultValue(radius, 1.0);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.number.greaterThan(\"radius\", radius, 0.0);\n  //>>includeEnd('debug');\n\n  this._radius = defaultValue(radius, 1.0);\n}\n\nObject.defineProperties(SphereEmitter.prototype, {\n  /**\n   * The radius of the sphere in meters.\n   * @memberof SphereEmitter.prototype\n   * @type {number}\n   * @default 1.0\n   */\n  radius: {\n    get: function () {\n      return this._radius;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number.greaterThan(\"value\", value, 0.0);\n      //>>includeEnd('debug');\n      this._radius = value;\n    },\n  },\n});\n\n/**\n * Initializes the given {Particle} by setting it's position and velocity.\n *\n * @private\n * @param {Particle} particle The particle to initialize\n */\nSphereEmitter.prototype.emit = function (particle) {\n  const theta = CesiumMath.randomBetween(0.0, CesiumMath.TWO_PI);\n  const phi = CesiumMath.randomBetween(0.0, CesiumMath.PI);\n  const rad = CesiumMath.randomBetween(0.0, this._radius);\n\n  const x = rad * Math.cos(theta) * Math.sin(phi);\n  const y = rad * Math.sin(theta) * Math.sin(phi);\n  const z = rad * Math.cos(phi);\n\n  particle.position = Cartesian3.fromElements(x, y, z, particle.position);\n  particle.velocity = Cartesian3.normalize(\n    particle.position,\n    particle.velocity\n  );\n};\nexport default SphereEmitter;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * An expression for a style applied to a {@link Cesium3DTileset}.\n * <p>\n * Derived classes of this interface evaluate expressions in the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.\n * </p>\n * <p>\n * This type describes an interface and is not intended to be instantiated directly.\n * </p>\n *\n * @alias StyleExpression\n * @constructor\n *\n * @see Expression\n * @see ConditionsExpression\n */\nfunction StyleExpression() {}\n\n/**\n * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of\n * the expression in the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}\n * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript\n * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>\n * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,\n * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is\n * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.\n *\n * @param {Cesium3DTileFeature} feature The feature whose properties may be used as variables in the expression.\n * @param {object} [result] The object onto which to store the result.\n * @returns {boolean|number|string|RegExp|Cartesian2|Cartesian3|Cartesian4|Color} The result of evaluating the expression.\n */\nStyleExpression.prototype.evaluate = function (feature, result) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Evaluates the result of a Color expression, optionally using the provided feature's properties.\n * <p>\n * This is equivalent to {@link StyleExpression#evaluate} but always returns a {@link Color} object.\n * </p>\n *\n * @param {Cesium3DTileFeature} feature The feature whose properties may be used as variables in the expression.\n * @param {Color} [result] The object in which to store the result.\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n */\nStyleExpression.prototype.evaluateColor = function (feature, result) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Gets the shader function for this expression.\n * Returns undefined if the shader function can't be generated from this expression.\n *\n * @param {string} functionSignature Signature of the generated function.\n * @param {object} variableSubstitutionMap Maps variable names to shader variable names.\n * @param {object} shaderState Stores information about the generated shader function, including whether it is translucent.\n * @param {string} returnType The return type of the generated function.\n *\n * @returns {string} The shader function.\n *\n * @private\n */\nStyleExpression.prototype.getShaderFunction = function (\n  functionSignature,\n  variableSubstitutionMap,\n  shaderState,\n  returnType\n) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Gets the variables used by the expression.\n *\n * @returns {string[]} The variables used by the expression.\n *\n * @private\n */\nStyleExpression.prototype.getVariables = function () {\n  DeveloperError.throwInstantiationError();\n};\n\nexport default StyleExpression;\n", "import Check from \"../Core/Check.js\";\nimport Event from \"../Core/Event.js\";\nimport createWorldTerrainAsync from \"../Core/createWorldTerrainAsync.js\";\n\n/**\n * A helper to manage async operations of a terrain provider.\n *\n * @alias Terrain\n * @constructor\n *\n * @see Terrain.fromWorldTerrain\n * @see CesiumTerrainProvider\n * @see VRTheWorldTerrainProvider\n * @see GoogleEarthEnterpriseTerrainProvider\n *\n * @example\n * // Create\n * const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n *   terrain: new Cesium.Terrain(Cesium.CesiumTerrainProvider.fromUrl(\"https://myTestTerrain.com\"));\n * });\n *\n * @example\n * // Handle loading events\n * const terrain = new Cesium.Terrain(Cesium.CesiumTerrainProvider.fromUrl(\"https://myTestTerrain.com\"));\n *\n * scene.setTerrain(terrain);\n *\n * terrain.readyEvent.addEventListener(provider => {\n *   scene.globe.enableLighting = true;\n *\n *   terrain.provider.errorEvent.addEventListener(error => {\n *     alert(`Encountered an error while loading terrain tiles! ${error}`);\n *   });\n * });\n *\n * terrain.errorEvent.addEventListener(error => {\n *   alert(`Encountered an error while creating terrain! ${error}`);\n * });\n *\n * @param {Promise<TerrainProvider>} terrainProviderPromise A promise which resolves to a terrain provider\n */\nfunction Terrain(terrainProviderPromise) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"terrainProviderPromise\", terrainProviderPromise);\n  //>>includeEnd('debug');\n\n  this._ready = false;\n  this._provider = undefined;\n  this._errorEvent = new Event();\n  this._readyEvent = new Event();\n\n  handlePromise(this, terrainProviderPromise);\n}\n\nObject.defineProperties(Terrain.prototype, {\n  /**\n   * Gets an event that is raised when the terrain provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of the thrown error.\n   * @memberof Terrain.prototype\n   * @type {Event<Terrain.ErrorEventCallback>}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the terrain provider has been successfully created. Event listeners\n   * are passed the created instance of {@link TerrainProvider}.\n   * @memberof Terrain.prototype\n   * @type {Event<Terrain.ReadyEventCallback>}\n   * @readonly\n   */\n  readyEvent: {\n    get: function () {\n      return this._readyEvent;\n    },\n  },\n\n  /**\n   * Returns true when the terrain provider has been successfully created. Otherwise, returns false.\n   * @memberof Viewer.prototype\n   *\n   * @type {boolean}\n   * @readonly\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n\n  /**\n   * The terrain provider providing surface geometry to a globe. Do not use until {@link Terrain.readyEvent} is raised.\n   * @memberof Viewer.prototype\n   *\n   * @type {TerrainProvider}\n   * @readonly\n   */\n  provider: {\n    get: function () {\n      return this._provider;\n    },\n  },\n});\n/**\n * Creates a {@link Terrain} instance for {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}.\n *\n * @function\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.requestVertexNormals=false] Flag that indicates if the client should request additional lighting information from the server if available.\n * @param {Boolean} [options.requestWaterMask=false] Flag that indicates if the client should request per tile water masks from the server if available.\n * @returns {Terrain} An asynchronous helper object for a CesiumTerrainProvider\n *\n * @see Ion\n * @see createWorldTerrainAsync\n *\n * @example\n * // Create Cesium World Terrain with default settings\n * const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n *   terrain: Cesium.Terrain.fromWorldTerrain()\n * });\n *\n * @example\n * // Create Cesium World Terrain with water and normals.\n * const viewer1 = new Cesium.Viewer(\"cesiumContainer\", {\n *   terrain: Cesium.Terrain.fromWorldTerrain({\n *      requestWaterMask: true,\n *      requestVertexNormals: true\n *    });\n * });\n *\n * @example\n * // Handle loading events\n * const terrain = Cesium.Terrain.fromWorldTerrain();\n *\n * scene.setTerrain(terrain);\n *\n * terrain.readyEvent.addEventListener(provider => {\n *   scene.globe.enableLighting = true;\n *\n *   terrain.provider.errorEvent.addEventListener(error => {\n *     alert(`Encountered an error while loading terrain tiles! ${error}`);\n *   });\n * });\n *\n * terrain.errorEvent.addEventListener(error => {\n *   alert(`Encountered an error while creating terrain! ${error}`);\n * });\n */\nTerrain.fromWorldTerrain = function (options) {\n  return new Terrain(createWorldTerrainAsync(options));\n};\n\nfunction handleError(errorEvent, error) {\n  if (errorEvent.numberOfListeners > 0) {\n    errorEvent.raiseEvent(error);\n  } else {\n    // Default handler is to log to the console\n    console.error(error);\n  }\n}\n\nasync function handlePromise(instance, promise) {\n  let provider;\n  try {\n    provider = await Promise.resolve(promise);\n    instance._provider = provider;\n    instance._ready = true;\n    instance._readyEvent.raiseEvent(provider);\n  } catch (error) {\n    handleError(instance._errorEvent, error);\n  }\n}\n\nexport default Terrain;\n\n/**\n * A function that is called when an error occurs.\n * @callback Terrain.ErrorEventCallback\n *\n * @this Terrain\n * @param {Error} err An object holding details about the error that occurred.\n */\n\n/**\n * A function that is called when the provider has been created\n * @callback Terrain.ReadyEventCallback\n *\n * @this Terrain\n * @param {TerrainProvider} provider The created terrain provider.\n */\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * Defines a bounding volume for a tile. This type describes an interface\n * and is not intended to be instantiated directly.\n *\n * @alias TileBoundingVolume\n * @constructor\n *\n * @see TileBoundingRegion\n * @see TileBoundingSphere\n * @see TileOrientedBoundingBox\n *\n * @private\n */\nfunction TileBoundingVolume() {}\n\n/**\n * The underlying bounding volume.\n *\n * @type {object}\n * @readonly\n */\nTileBoundingVolume.prototype.boundingVolume = undefined;\n\n/**\n * The underlying bounding sphere.\n *\n * @type {BoundingSphere}\n * @readonly\n */\nTileBoundingVolume.prototype.boundingSphere = undefined;\n\n/**\n * Calculates the distance between the tile and the camera.\n *\n * @param {FrameState} frameState The frame state.\n * @return {number} The distance between the tile and the camera, in meters.\n *                  Returns 0.0 if the camera is inside the tile.\n */\nTileBoundingVolume.prototype.distanceToCamera = function (frameState) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Determines which side of a plane this volume is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire volume is on the side of the plane\n *                      the normal is pointing, {@link Intersect.OUTSIDE} if the entire volume is\n *                      on the opposite side, and {@link Intersect.INTERSECTING} if the volume\n *                      intersects the plane.\n */\nTileBoundingVolume.prototype.intersectPlane = function (plane) {\n  DeveloperError.throwInstantiationError();\n};\n\n/**\n * Creates a debug primitive that shows the outline of the tile bounding\n * volume.\n *\n * @param {Color} color The desired color of the primitive's mesh\n * @return {Primitive}\n */\nTileBoundingVolume.prototype.createDebugVolume = function (color) {\n  DeveloperError.throwInstantiationError();\n};\nexport default TileBoundingVolume;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\n\n/**\n * @typedef {object} TileCoordinatesImageryProvider.ConstructorOptions\n *\n * Initialization options for the TileCoordinatesImageryProvider constructor\n *\n * @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid.  If the tilingScheme is specified,\n *                    this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n *                    parameter is specified, the WGS84 ellipsoid is used.\n * @property {Color} [color=Color.YELLOW] The color to draw the tile box and label.\n * @property {number} [tileWidth=256] The width of the tile for level-of-detail selection purposes.\n * @property {number} [tileHeight=256] The height of the tile for level-of-detail selection purposes.\n */\n\n/**\n * An {@link ImageryProvider} that draws a box around every rendered tile in the tiling scheme, and draws\n * a label inside it indicating the X, Y, Level coordinates of the tile.  This is mostly useful for\n * debugging terrain and imagery rendering problems.\n *\n * @alias TileCoordinatesImageryProvider\n * @constructor\n *\n * @param {TileCoordinatesImageryProvider.ConstructorOptions} [options] Object describing initialization options\n */\nfunction TileCoordinatesImageryProvider(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  this._tilingScheme = defined(options.tilingScheme)\n    ? options.tilingScheme\n    : new GeographicTilingScheme({ ellipsoid: options.ellipsoid });\n  this._color = defaultValue(options.color, Color.YELLOW);\n  this._errorEvent = new Event();\n  this._tileWidth = defaultValue(options.tileWidth, 256);\n  this._tileHeight = defaultValue(options.tileHeight, 256);\n\n  this._defaultAlpha = undefined;\n  this._defaultNightAlpha = undefined;\n  this._defaultDayAlpha = undefined;\n  this._defaultBrightness = undefined;\n  this._defaultContrast = undefined;\n  this._defaultHue = undefined;\n  this._defaultSaturation = undefined;\n  this._defaultGamma = undefined;\n  this._defaultMinificationFilter = undefined;\n  this._defaultMagnificationFilter = undefined;\n}\n\nObject.defineProperties(TileCoordinatesImageryProvider.prototype, {\n  /**\n   * Gets the proxy used by this provider.\n   * @memberof TileCoordinatesImageryProvider.prototype\n   * @type {Proxy}\n   * @readonly\n   */\n  proxy: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Gets the width of each tile, in pixels.\n   * @memberof TileCoordinatesImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileWidth: {\n    get: function () {\n      return this._tileWidth;\n    },\n  },\n\n  /**\n   * Gets the height of each tile, in pixels.\n   * @memberof TileCoordinatesImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  tileHeight: {\n    get: function () {\n      return this._tileHeight;\n    },\n  },\n\n  /**\n   * Gets the maximum level-of-detail that can be requested.\n   * @memberof TileCoordinatesImageryProvider.prototype\n   * @type {number|undefined}\n   * @readonly\n   */\n  maximumLevel: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Gets the minimum level-of-detail that can be requested.\n   * @memberof TileCoordinatesImageryProvider.prototype\n   * @type {number}\n   * @readonly\n   */\n  minimumLevel: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Gets the tiling scheme used by this provider.\n   * @memberof TileCoordinatesImageryProvider.prototype\n   * @type {TilingScheme}\n   * @readonly\n   */\n  tilingScheme: {\n    get: function () {\n      return this._tilingScheme;\n    },\n  },\n\n  /**\n   * Gets the rectangle, in radians, of the imagery provided by this instance.\n   * @memberof TileCoordinatesImageryProvider.prototype\n   * @type {Rectangle}\n   * @readonly\n   */\n  rectangle: {\n    get: function () {\n      return this._tilingScheme.rectangle;\n    },\n  },\n\n  /**\n   * Gets the tile discard policy.  If not undefined, the discard policy is responsible\n   * for filtering out \"missing\" tiles via its shouldDiscardImage function.  If this function\n   * returns undefined, no tiles are filtered.\n   * @memberof TileCoordinatesImageryProvider.prototype\n   * @type {TileDiscardPolicy}\n   * @readonly\n   */\n  tileDiscardPolicy: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Gets an event that is raised when the imagery provider encounters an asynchronous error.  By subscribing\n   * to the event, you will be notified of the error and can potentially recover from it.  Event listeners\n   * are passed an instance of {@link TileProviderError}.\n   * @memberof TileCoordinatesImageryProvider.prototype\n   * @type {Event}\n   * @readonly\n   */\n  errorEvent: {\n    get: function () {\n      return this._errorEvent;\n    },\n  },\n\n  /**\n   * Gets the credit to display when this imagery provider is active.  Typically this is used to credit\n   * the source of the imagery.\n   * @memberof TileCoordinatesImageryProvider.prototype\n   * @type {Credit}\n   * @readonly\n   */\n  credit: {\n    get: function () {\n      return undefined;\n    },\n  },\n\n  /**\n   * Gets a value indicating whether or not the images provided by this imagery provider\n   * include an alpha channel.  If this property is false, an alpha channel, if present, will\n   * be ignored.  If this property is true, any images without an alpha channel will be treated\n   * as if their alpha is 1.0 everywhere.  Setting this property to false reduces memory usage\n   * and texture upload time.\n   * @memberof TileCoordinatesImageryProvider.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  hasAlphaChannel: {\n    get: function () {\n      return true;\n    },\n  },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n */\nTileCoordinatesImageryProvider.prototype.getTileCredits = function (\n  x,\n  y,\n  level\n) {\n  return undefined;\n};\n\n/**\n * Requests the image for a given tile.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise<HTMLCanvasElement>} The resolved image as a Canvas DOM object.\n */\nTileCoordinatesImageryProvider.prototype.requestImage = function (\n  x,\n  y,\n  level,\n  request\n) {\n  const canvas = document.createElement(\"canvas\");\n  canvas.width = 256;\n  canvas.height = 256;\n  const context = canvas.getContext(\"2d\");\n\n  const cssColor = this._color.toCssColorString();\n\n  context.strokeStyle = cssColor;\n  context.lineWidth = 2;\n  context.strokeRect(1, 1, 255, 255);\n\n  context.font = \"bold 25px Arial\";\n  context.textAlign = \"center\";\n  context.fillStyle = cssColor;\n  context.fillText(`L: ${level}`, 124, 86);\n  context.fillText(`X: ${x}`, 124, 136);\n  context.fillText(`Y: ${y}`, 124, 186);\n\n  return Promise.resolve(canvas);\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {number} x The tile X coordinate.\n * @param {number} y The tile Y coordinate.\n * @param {number} level The tile level.\n * @param {number} longitude The longitude at which to pick features.\n * @param {number} latitude  The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nTileCoordinatesImageryProvider.prototype.pickFeatures = function (\n  x,\n  y,\n  level,\n  longitude,\n  latitude\n) {\n  return undefined;\n};\nexport default TileCoordinatesImageryProvider;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * A policy for discarding tile images according to some criteria.  This type describes an\n * interface and is not intended to be instantiated directly.\n *\n * @alias TileDiscardPolicy\n * @constructor\n *\n * @see DiscardMissingTileImagePolicy\n * @see NeverTileDiscardPolicy\n */\nfunction TileDiscardPolicy(options) {\n  DeveloperError.throwInstantiationError();\n}\n\n/**\n * Determines if the discard policy is ready to process images.\n * @function\n *\n * @returns {boolean} True if the discard policy is ready to process images; otherwise, false.\n */\nTileDiscardPolicy.prototype.isReady = DeveloperError.throwInstantiationError;\n\n/**\n * Given a tile image, decide whether to discard that image.\n * @function\n *\n * @param {HTMLImageElement} image An image to test.\n * @returns {boolean} True if the image should be discarded; otherwise, false.\n */\nTileDiscardPolicy.prototype.shouldDiscardImage =\n  DeveloperError.throwInstantiationError;\nexport default TileDiscardPolicy;\n", "/**\n * @private\n */\nconst TileState = {\n  START: 0,\n  LOADING: 1,\n  READY: 2,\n  UPSAMPLED_ONLY: 3,\n};\nexport default Object.freeze(TileState);\n", "import Check from \"../Core/Check.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Event from \"../Core/Event.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Resource from \"../Core/Resource.js\";\nimport ClippingPlaneCollection from \"./ClippingPlaneCollection.js\";\nimport PointCloud from \"./PointCloud.js\";\nimport PointCloudEyeDomeLighting from \"./PointCloudEyeDomeLighting.js\";\nimport PointCloudShading from \"./PointCloudShading.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowMode from \"./ShadowMode.js\";\n\n/**\n * Provides playback of time-dynamic point cloud data.\n * <p>\n * Point cloud frames are prefetched in intervals determined by the average frame load time and the current clock speed.\n * If intermediate frames cannot be loaded in time to meet playback speed, they will be skipped. If frames are sufficiently\n * small or the clock is sufficiently slow then no frames will be skipped.\n * </p>\n *\n * @alias TimeDynamicPointCloud\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Clock} options.clock A {@link Clock} instance that is used when determining the value for the time dimension.\n * @param {TimeIntervalCollection} options.intervals A {@link TimeIntervalCollection} with its data property being an object containing a <code>uri</code> to a 3D Tiles Point Cloud tile and an optional <code>transform</code>.\n * @param {boolean} [options.show=true] Determines if the point cloud will be shown.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] A 4x4 transformation matrix that transforms the point cloud.\n * @param {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the point cloud casts or receives shadows from light sources.\n * @param {number} [options.maximumMemoryUsage=256] The maximum amount of memory in MB that can be used by the point cloud.\n * @param {object} [options.shading] Options for constructing a {@link PointCloudShading} object to control point attenuation and eye dome lighting.\n * @param {Cesium3DTileStyle} [options.style] The style, defined using the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}, applied to each point in the point cloud.\n * @param {ClippingPlaneCollection} [options.clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud.\n */\nfunction TimeDynamicPointCloud(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.clock\", options.clock);\n  Check.typeOf.object(\"options.intervals\", options.intervals);\n  //>>includeEnd('debug');\n\n  /**\n   * Determines if the point cloud will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = defaultValue(options.show, true);\n\n  /**\n   * A 4x4 transformation matrix that transforms the point cloud.\n   *\n   * @type {Matrix4}\n   * @default Matrix4.IDENTITY\n   */\n  this.modelMatrix = Matrix4.clone(\n    defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n  );\n\n  /**\n   * Determines whether the point cloud casts or receives shadows from light sources.\n   * <p>\n   * Enabling shadows has a performance impact. A point cloud that casts shadows must be rendered twice, once from the camera and again from the light's point of view.\n   * </p>\n   * <p>\n   * Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>.\n   * </p>\n   *\n   * @type {ShadowMode}\n   * @default ShadowMode.ENABLED\n   */\n  this.shadows = defaultValue(options.shadows, ShadowMode.ENABLED);\n\n  /**\n   * The maximum amount of GPU memory (in MB) that may be used to cache point cloud frames.\n   * <p>\n   * Frames that are not being loaded or rendered are unloaded to enforce this.\n   * </p>\n   * <p>\n   * If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.\n   * </p>\n   *\n   * @type {number}\n   * @default 256\n   *\n   * @see TimeDynamicPointCloud#totalMemoryUsageInBytes\n   */\n  this.maximumMemoryUsage = defaultValue(options.maximumMemoryUsage, 256);\n\n  /**\n   * Options for controlling point size based on geometric error and eye dome lighting.\n   * @type {PointCloudShading}\n   */\n  this.shading = new PointCloudShading(options.shading);\n\n  /**\n   * The style, defined using the\n   * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language},\n   * applied to each point in the point cloud.\n   * <p>\n   * Assign <code>undefined</code> to remove the style, which will restore the visual\n   * appearance of the point cloud to its default when no style was applied.\n   * </p>\n   *\n   * @type {Cesium3DTileStyle}\n   *\n   * @example\n   * pointCloud.style = new Cesium.Cesium3DTileStyle({\n   *    color : {\n   *        conditions : [\n   *            ['${Classification} === 0', 'color(\"purple\", 0.5)'],\n   *            ['${Classification} === 1', 'color(\"red\")'],\n   *            ['true', '${COLOR}']\n   *        ]\n   *    },\n   *    show : '${Classification} !== 2'\n   * });\n   *\n   * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}\n   */\n  this.style = options.style;\n\n  /**\n   * The event fired to indicate that a frame failed to load. A frame may fail to load if the\n   * request for its uri fails or processing fails due to invalid content.\n   * <p>\n   * If there are no event listeners, error messages will be logged to the console.\n   * </p>\n   * <p>\n   * The error object passed to the listener contains two properties:\n   * <ul>\n   * <li><code>uri</code>: the uri of the failed frame.</li>\n   * <li><code>message</code>: the error message.</li>\n   * </ul>\n   *\n   * @type {Event}\n   * @default new Event()\n   *\n   * @example\n   * pointCloud.frameFailed.addEventListener(function(error) {\n   *     console.log(`An error occurred loading frame: ${error.uri}`);\n   *     console.log(`Error: ${error.message}`);\n   * });\n   */\n  this.frameFailed = new Event();\n\n  /**\n   * The event fired to indicate that a new frame was rendered.\n   * <p>\n   * The time dynamic point cloud {@link TimeDynamicPointCloud} is passed to the event listener.\n   * </p>\n   * @type {Event}\n   * @default new Event()\n   *\n   * @example\n   * pointCloud.frameChanged.addEventListener(function(timeDynamicPointCloud) {\n   *     viewer.camera.viewBoundingSphere(timeDynamicPointCloud.boundingSphere);\n   * });\n   */\n  this.frameChanged = new Event();\n\n  this._clock = options.clock;\n  this._intervals = options.intervals;\n  this._clippingPlanes = undefined;\n  this.clippingPlanes = options.clippingPlanes; // Call setter\n  this._pointCloudEyeDomeLighting = new PointCloudEyeDomeLighting();\n  this._loadTimestamp = undefined;\n  this._clippingPlanesState = 0;\n  this._styleDirty = false;\n  this._pickId = undefined;\n  this._totalMemoryUsageInBytes = 0;\n  this._frames = [];\n  this._previousInterval = undefined;\n  this._nextInterval = undefined;\n  this._lastRenderedFrame = undefined;\n  this._clockMultiplier = 0.0;\n\n  // For calculating average load time of the last N frames\n  this._runningSum = 0.0;\n  this._runningLength = 0;\n  this._runningIndex = 0;\n  this._runningSamples = new Array(5).fill(0.0);\n  this._runningAverage = 0.0;\n}\n\nObject.defineProperties(TimeDynamicPointCloud.prototype, {\n  /**\n   * The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud.\n   *\n   * @memberof TimeDynamicPointCloud.prototype\n   *\n   * @type {ClippingPlaneCollection}\n   */\n  clippingPlanes: {\n    get: function () {\n      return this._clippingPlanes;\n    },\n    set: function (value) {\n      ClippingPlaneCollection.setOwner(value, this, \"_clippingPlanes\");\n    },\n  },\n\n  /**\n   * The total amount of GPU memory in bytes used by the point cloud.\n   *\n   * @memberof TimeDynamicPointCloud.prototype\n   *\n   * @type {number}\n   * @readonly\n   *\n   * @see TimeDynamicPointCloud#maximumMemoryUsage\n   */\n  totalMemoryUsageInBytes: {\n    get: function () {\n      return this._totalMemoryUsageInBytes;\n    },\n  },\n\n  /**\n   * The bounding sphere of the frame being rendered. Returns <code>undefined</code> if no frame is being rendered.\n   *\n   * @memberof TimeDynamicPointCloud.prototype\n   *\n   * @type {BoundingSphere}\n   * @readonly\n   */\n  boundingSphere: {\n    get: function () {\n      if (defined(this._lastRenderedFrame)) {\n        return this._lastRenderedFrame.pointCloud.boundingSphere;\n      }\n      return undefined;\n    },\n  },\n});\n\nfunction getFragmentShaderLoaded(fs) {\n  return `uniform vec4 czm_pickColor;\\n${fs}`;\n}\n\nfunction getUniformMapLoaded(stream) {\n  return function (uniformMap) {\n    return combine(uniformMap, {\n      czm_pickColor: function () {\n        return stream._pickId.color;\n      },\n    });\n  };\n}\n\nfunction getPickIdLoaded() {\n  return \"czm_pickColor\";\n}\n\n/**\n * Marks the point cloud's {@link TimeDynamicPointCloud#style} as dirty, which forces all\n * points to re-evaluate the style in the next frame.\n */\nTimeDynamicPointCloud.prototype.makeStyleDirty = function () {\n  this._styleDirty = true;\n};\n\n/**\n * Exposed for testing.\n *\n * @private\n */\nTimeDynamicPointCloud.prototype._getAverageLoadTime = function () {\n  if (this._runningLength === 0) {\n    // Before any frames have loaded make a best guess about the average load time\n    return 0.05;\n  }\n  return this._runningAverage;\n};\n\nconst scratchDate = new JulianDate();\n\nfunction getClockMultiplier(that) {\n  const clock = that._clock;\n  const isAnimating = clock.canAnimate && clock.shouldAnimate;\n  const multiplier = clock.multiplier;\n  return isAnimating ? multiplier : 0.0;\n}\n\nfunction getIntervalIndex(that, interval) {\n  return that._intervals.indexOf(interval.start);\n}\n\nfunction getNextInterval(that, currentInterval) {\n  const intervals = that._intervals;\n  const clock = that._clock;\n  const multiplier = getClockMultiplier(that);\n\n  if (multiplier === 0.0) {\n    return undefined;\n  }\n\n  const averageLoadTime = that._getAverageLoadTime();\n  const time = JulianDate.addSeconds(\n    clock.currentTime,\n    averageLoadTime * multiplier,\n    scratchDate\n  );\n  let index = intervals.indexOf(time);\n\n  const currentIndex = getIntervalIndex(that, currentInterval);\n  if (index === currentIndex) {\n    if (multiplier >= 0) {\n      ++index;\n    } else {\n      --index;\n    }\n  }\n\n  // Returns undefined if not in range\n  return intervals.get(index);\n}\n\nfunction getCurrentInterval(that) {\n  const intervals = that._intervals;\n  const clock = that._clock;\n  const time = clock.currentTime;\n  const index = intervals.indexOf(time);\n\n  // Returns undefined if not in range\n  return intervals.get(index);\n}\n\nfunction reachedInterval(that, currentInterval, nextInterval) {\n  const multiplier = getClockMultiplier(that);\n  const currentIndex = getIntervalIndex(that, currentInterval);\n  const nextIndex = getIntervalIndex(that, nextInterval);\n\n  if (multiplier >= 0) {\n    return currentIndex >= nextIndex;\n  }\n  return currentIndex <= nextIndex;\n}\n\nfunction handleFrameFailure(that, uri) {\n  return function (error) {\n    const message = defined(error.message) ? error.message : error.toString();\n    if (that.frameFailed.numberOfListeners > 0) {\n      that.frameFailed.raiseEvent({\n        uri: uri,\n        message: message,\n      });\n    } else {\n      console.log(`A frame failed to load: ${uri}`);\n      console.log(`Error: ${message}`);\n    }\n  };\n}\n\nfunction requestFrame(that, interval, frameState) {\n  const index = getIntervalIndex(that, interval);\n  const frames = that._frames;\n  let frame = frames[index];\n  if (!defined(frame)) {\n    const transformArray = interval.data.transform;\n    const transform = defined(transformArray)\n      ? Matrix4.fromArray(transformArray)\n      : undefined;\n    const uri = interval.data.uri;\n    frame = {\n      pointCloud: undefined,\n      transform: transform,\n      timestamp: getTimestamp(),\n      sequential: true,\n      ready: false,\n      touchedFrameNumber: frameState.frameNumber,\n      uri: uri,\n    };\n    frames[index] = frame;\n    Resource.fetchArrayBuffer({\n      url: uri,\n    })\n      .then(function (arrayBuffer) {\n        // PERFORMANCE_IDEA: share a memory pool, render states, shaders, and other resources among all\n        // frames. Each frame just needs an index/offset into the pool.\n        frame.pointCloud = new PointCloud({\n          arrayBuffer: arrayBuffer,\n          cull: true,\n          fragmentShaderLoaded: getFragmentShaderLoaded,\n          uniformMapLoaded: getUniformMapLoaded(that),\n          pickIdLoaded: getPickIdLoaded,\n        });\n      })\n      .catch(handleFrameFailure(that, uri));\n  }\n  return frame;\n}\n\nfunction updateAverageLoadTime(that, loadTime) {\n  that._runningSum += loadTime;\n  that._runningSum -= that._runningSamples[that._runningIndex];\n  that._runningSamples[that._runningIndex] = loadTime;\n  that._runningLength = Math.min(\n    that._runningLength + 1,\n    that._runningSamples.length\n  );\n  that._runningIndex = (that._runningIndex + 1) % that._runningSamples.length;\n  that._runningAverage = that._runningSum / that._runningLength;\n}\n\nfunction prepareFrame(that, frame, updateState, frameState) {\n  if (frame.touchedFrameNumber < frameState.frameNumber - 1) {\n    // If this frame was not loaded in sequential updates then it can't be used it for calculating the average load time.\n    // For example: selecting a frame on the timeline, selecting another frame before the request finishes, then selecting this frame later.\n    frame.sequential = false;\n  }\n\n  const pointCloud = frame.pointCloud;\n\n  if (defined(pointCloud) && !frame.ready) {\n    // Call update to prepare renderer resources. Don't render anything yet.\n    const commandList = frameState.commandList;\n    const lengthBeforeUpdate = commandList.length;\n    renderFrame(that, frame, updateState, frameState);\n\n    if (pointCloud.ready) {\n      // Point cloud became ready this update\n      frame.ready = true;\n      that._totalMemoryUsageInBytes += pointCloud.geometryByteLength;\n      commandList.length = lengthBeforeUpdate; // Don't allow preparing frame to insert commands.\n      if (frame.sequential) {\n        // Update the values used to calculate average load time\n        const loadTime = (getTimestamp() - frame.timestamp) / 1000.0;\n        updateAverageLoadTime(that, loadTime);\n      }\n    }\n  }\n\n  frame.touchedFrameNumber = frameState.frameNumber;\n}\n\nconst scratchModelMatrix = new Matrix4();\n\nfunction getGeometricError(that, pointCloud) {\n  const shading = that.shading;\n  if (defined(shading) && defined(shading.baseResolution)) {\n    return shading.baseResolution;\n  } else if (defined(pointCloud.boundingSphere)) {\n    return CesiumMath.cbrt(\n      pointCloud.boundingSphere.volume() / pointCloud.pointsLength\n    );\n  }\n  return 0.0;\n}\n\nfunction getMaximumAttenuation(that) {\n  const shading = that.shading;\n  if (defined(shading) && defined(shading.maximumAttenuation)) {\n    return shading.maximumAttenuation;\n  }\n\n  // Return a hardcoded maximum attenuation. For a tileset this would instead be the maximum screen space error.\n  return 10.0;\n}\n\nconst defaultShading = new PointCloudShading();\n\nfunction renderFrame(that, frame, updateState, frameState) {\n  const shading = defaultValue(that.shading, defaultShading);\n  const pointCloud = frame.pointCloud;\n  const transform = defaultValue(frame.transform, Matrix4.IDENTITY);\n  pointCloud.modelMatrix = Matrix4.multiplyTransformation(\n    that.modelMatrix,\n    transform,\n    scratchModelMatrix\n  );\n  pointCloud.style = that.style;\n  pointCloud.time = updateState.timeSinceLoad;\n  pointCloud.shadows = that.shadows;\n  pointCloud.clippingPlanes = that._clippingPlanes;\n  pointCloud.isClipped = updateState.isClipped;\n  pointCloud.attenuation = shading.attenuation;\n  pointCloud.backFaceCulling = shading.backFaceCulling;\n  pointCloud.normalShading = shading.normalShading;\n  pointCloud.geometricError = getGeometricError(that, pointCloud);\n  pointCloud.geometricErrorScale = shading.geometricErrorScale;\n  pointCloud.maximumAttenuation = getMaximumAttenuation(that);\n\n  try {\n    pointCloud.update(frameState);\n  } catch (error) {\n    handleFrameFailure(that, frame.uri)(error);\n  }\n\n  frame.touchedFrameNumber = frameState.frameNumber;\n}\n\nfunction loadFrame(that, interval, updateState, frameState) {\n  const frame = requestFrame(that, interval, frameState);\n  prepareFrame(that, frame, updateState, frameState);\n}\n\nfunction getUnloadCondition(frameState) {\n  return function (frame) {\n    // Unload all frames that aren't currently being loaded or rendered\n    return frame.touchedFrameNumber < frameState.frameNumber;\n  };\n}\n\nfunction unloadFrames(that, unloadCondition) {\n  const frames = that._frames;\n  const length = frames.length;\n  for (let i = 0; i < length; ++i) {\n    const frame = frames[i];\n    if (defined(frame)) {\n      if (!defined(unloadCondition) || unloadCondition(frame)) {\n        const pointCloud = frame.pointCloud;\n        if (frame.ready) {\n          that._totalMemoryUsageInBytes -= pointCloud.geometryByteLength;\n        }\n        if (defined(pointCloud)) {\n          pointCloud.destroy();\n        }\n        if (frame === that._lastRenderedFrame) {\n          that._lastRenderedFrame = undefined;\n        }\n        frames[i] = undefined;\n      }\n    }\n  }\n}\n\nfunction getFrame(that, interval) {\n  const index = getIntervalIndex(that, interval);\n  const frame = that._frames[index];\n  if (defined(frame) && frame.ready) {\n    return frame;\n  }\n}\n\nfunction updateInterval(that, interval, frame, updateState, frameState) {\n  if (defined(frame)) {\n    if (frame.ready) {\n      return true;\n    }\n    loadFrame(that, interval, updateState, frameState);\n    return frame.ready;\n  }\n  return false;\n}\n\nfunction getNearestReadyInterval(\n  that,\n  previousInterval,\n  currentInterval,\n  updateState,\n  frameState\n) {\n  let i;\n  let interval;\n  let frame;\n  const intervals = that._intervals;\n  const frames = that._frames;\n  const currentIndex = getIntervalIndex(that, currentInterval);\n  const previousIndex = getIntervalIndex(that, previousInterval);\n\n  if (currentIndex >= previousIndex) {\n    // look backwards\n    for (i = currentIndex; i >= previousIndex; --i) {\n      interval = intervals.get(i);\n      frame = frames[i];\n      if (updateInterval(that, interval, frame, updateState, frameState)) {\n        return interval;\n      }\n    }\n  } else {\n    // look forwards\n    for (i = currentIndex; i <= previousIndex; ++i) {\n      interval = intervals.get(i);\n      frame = frames[i];\n      if (updateInterval(that, interval, frame, updateState, frameState)) {\n        return interval;\n      }\n    }\n  }\n\n  // If no intervals are ready return the previous interval\n  return previousInterval;\n}\n\nfunction setFramesDirty(that, clippingPlanesDirty, styleDirty) {\n  const frames = that._frames;\n  const framesLength = frames.length;\n  for (let i = 0; i < framesLength; ++i) {\n    const frame = frames[i];\n    if (defined(frame) && defined(frame.pointCloud)) {\n      frame.pointCloud.clippingPlanesDirty = clippingPlanesDirty;\n      frame.pointCloud.styleDirty = styleDirty;\n    }\n  }\n}\n\nconst updateState = {\n  timeSinceLoad: 0,\n  isClipped: false,\n  clippingPlanesDirty: false,\n};\n\n/**\n * @private\n */\nTimeDynamicPointCloud.prototype.update = function (frameState) {\n  if (frameState.mode === SceneMode.MORPHING) {\n    return;\n  }\n\n  if (!this.show) {\n    return;\n  }\n\n  if (!defined(this._pickId)) {\n    this._pickId = frameState.context.createPickId({\n      primitive: this,\n    });\n  }\n\n  if (!defined(this._loadTimestamp)) {\n    this._loadTimestamp = JulianDate.clone(frameState.time);\n  }\n\n  // For styling\n  const timeSinceLoad = Math.max(\n    JulianDate.secondsDifference(frameState.time, this._loadTimestamp) * 1000,\n    0.0\n  );\n\n  // Update clipping planes\n  const clippingPlanes = this._clippingPlanes;\n  let clippingPlanesState = 0;\n  let clippingPlanesDirty = false;\n  const isClipped = defined(clippingPlanes) && clippingPlanes.enabled;\n\n  if (isClipped) {\n    clippingPlanes.update(frameState);\n    clippingPlanesState = clippingPlanes.clippingPlanesState;\n  }\n\n  if (this._clippingPlanesState !== clippingPlanesState) {\n    this._clippingPlanesState = clippingPlanesState;\n    clippingPlanesDirty = true;\n  }\n\n  const styleDirty = this._styleDirty;\n  this._styleDirty = false;\n\n  if (clippingPlanesDirty || styleDirty) {\n    setFramesDirty(this, clippingPlanesDirty, styleDirty);\n  }\n\n  updateState.timeSinceLoad = timeSinceLoad;\n  updateState.isClipped = isClipped;\n\n  const shading = this.shading;\n  const eyeDomeLighting = this._pointCloudEyeDomeLighting;\n\n  const commandList = frameState.commandList;\n  const lengthBeforeUpdate = commandList.length;\n\n  let previousInterval = this._previousInterval;\n  let nextInterval = this._nextInterval;\n  const currentInterval = getCurrentInterval(this);\n\n  if (!defined(currentInterval)) {\n    return;\n  }\n\n  let clockMultiplierChanged = false;\n  const clockMultiplier = getClockMultiplier(this);\n  const clockPaused = clockMultiplier === 0;\n  if (clockMultiplier !== this._clockMultiplier) {\n    clockMultiplierChanged = true;\n    this._clockMultiplier = clockMultiplier;\n  }\n\n  if (!defined(previousInterval) || clockPaused) {\n    previousInterval = currentInterval;\n  }\n\n  if (\n    !defined(nextInterval) ||\n    clockMultiplierChanged ||\n    reachedInterval(this, currentInterval, nextInterval)\n  ) {\n    nextInterval = getNextInterval(this, currentInterval);\n  }\n\n  previousInterval = getNearestReadyInterval(\n    this,\n    previousInterval,\n    currentInterval,\n    updateState,\n    frameState\n  );\n  let frame = getFrame(this, previousInterval);\n\n  if (!defined(frame)) {\n    // The frame is not ready to render. This can happen when the simulation starts or when scrubbing the timeline\n    // to a frame that hasn't loaded yet. Just render the last rendered frame in its place until it finishes loading.\n    loadFrame(this, previousInterval, updateState, frameState);\n    frame = this._lastRenderedFrame;\n  }\n\n  if (defined(frame)) {\n    renderFrame(this, frame, updateState, frameState);\n  }\n\n  if (defined(nextInterval)) {\n    // Start loading the next frame\n    loadFrame(this, nextInterval, updateState, frameState);\n  }\n\n  const that = this;\n  if (defined(frame) && !defined(this._lastRenderedFrame)) {\n    frameState.afterRender.push(function () {\n      return true;\n    });\n  }\n\n  if (defined(frame) && frame !== this._lastRenderedFrame) {\n    if (that.frameChanged.numberOfListeners > 0) {\n      frameState.afterRender.push(function () {\n        that.frameChanged.raiseEvent(that);\n        return true;\n      });\n    }\n  }\n\n  this._previousInterval = previousInterval;\n  this._nextInterval = nextInterval;\n  this._lastRenderedFrame = frame;\n\n  const totalMemoryUsageInBytes = this._totalMemoryUsageInBytes;\n  const maximumMemoryUsageInBytes = this.maximumMemoryUsage * 1024 * 1024;\n\n  if (totalMemoryUsageInBytes > maximumMemoryUsageInBytes) {\n    unloadFrames(this, getUnloadCondition(frameState));\n  }\n\n  const lengthAfterUpdate = commandList.length;\n  const addedCommandsLength = lengthAfterUpdate - lengthBeforeUpdate;\n\n  if (\n    defined(shading) &&\n    shading.attenuation &&\n    shading.eyeDomeLighting &&\n    addedCommandsLength > 0\n  ) {\n    eyeDomeLighting.update(\n      frameState,\n      lengthBeforeUpdate,\n      shading,\n      this.boundingSphere\n    );\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see TimeDynamicPointCloud#destroy\n */\nTimeDynamicPointCloud.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * pointCloud = pointCloud && pointCloud.destroy();\n *\n * @see TimeDynamicPointCloud#isDestroyed\n */\nTimeDynamicPointCloud.prototype.destroy = function () {\n  unloadFrames(this);\n  this._clippingPlanes = this._clippingPlanes && this._clippingPlanes.destroy();\n  this._pickId = this._pickId && this._pickId.destroy();\n  return destroyObject(this);\n};\nexport default TimeDynamicPointCloud;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport ViewportQuadFS from \"../Shaders/ViewportQuadFS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport Material from \"./Material.js\";\n\n/**\n * A viewport aligned quad.\n *\n * @alias ViewportQuad\n * @constructor\n *\n * @param {BoundingRectangle} [rectangle] The {@link BoundingRectangle} defining the quad's position within the viewport.\n * @param {Material} [material] The {@link Material} defining the surface appearance of the viewport quad.\n *\n * @example\n * const viewportQuad = new Cesium.ViewportQuad(new Cesium.BoundingRectangle(0, 0, 80, 40));\n * viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 1.0);\n */\nfunction ViewportQuad(rectangle, material) {\n  /**\n   * Determines if the viewport quad primitive will be shown.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.show = true;\n\n  if (!defined(rectangle)) {\n    rectangle = new BoundingRectangle();\n  }\n\n  /**\n   * The BoundingRectangle defining the quad's position within the viewport.\n   *\n   * @type {BoundingRectangle}\n   *\n   * @example\n   * viewportQuad.rectangle = new Cesium.BoundingRectangle(0, 0, 80, 40);\n   */\n  this.rectangle = BoundingRectangle.clone(rectangle);\n\n  if (!defined(material)) {\n    material = Material.fromType(Material.ColorType, {\n      color: new Color(1.0, 1.0, 1.0, 1.0),\n    });\n  }\n\n  /**\n   * The surface appearance of the viewport quad.  This can be one of several built-in {@link Material} objects or a custom material, scripted with\n   * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.\n   * <p>\n   * The default material is <code>Material.ColorType</code>.\n   * </p>\n   *\n   * @type Material\n   *\n   * @example\n   * // 1. Change the color of the default material to yellow\n   * viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);\n   *\n   * // 2. Change material to horizontal stripes\n   * viewportQuad.material = Cesium.Material.fromType(Cesium.Material.StripeType);\n   *\n   * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n   */\n  this.material = material;\n  this._material = undefined;\n\n  this._overlayCommand = undefined;\n  this._rs = undefined;\n}\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly.  This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {DeveloperError} this.material must be defined.\n * @exception {DeveloperError} this.rectangle must be defined.\n */\nViewportQuad.prototype.update = function (frameState) {\n  if (!this.show) {\n    return;\n  }\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(this.material)) {\n    throw new DeveloperError(\"this.material must be defined.\");\n  }\n  if (!defined(this.rectangle)) {\n    throw new DeveloperError(\"this.rectangle must be defined.\");\n  }\n  //>>includeEnd('debug');\n\n  const rs = this._rs;\n  if (!defined(rs) || !BoundingRectangle.equals(rs.viewport, this.rectangle)) {\n    this._rs = RenderState.fromCache({\n      blending: BlendingState.ALPHA_BLEND,\n      viewport: this.rectangle,\n    });\n  }\n\n  const pass = frameState.passes;\n  if (pass.render) {\n    const context = frameState.context;\n\n    if (this._material !== this.material || !defined(this._overlayCommand)) {\n      // Recompile shader when material changes\n      this._material = this.material;\n\n      if (defined(this._overlayCommand)) {\n        this._overlayCommand.shaderProgram.destroy();\n      }\n\n      const fs = new ShaderSource({\n        sources: [this._material.shaderSource, ViewportQuadFS],\n      });\n      this._overlayCommand = context.createViewportQuadCommand(fs, {\n        renderState: this._rs,\n        uniformMap: this._material._uniforms,\n        owner: this,\n      });\n      this._overlayCommand.pass = Pass.OVERLAY;\n    }\n\n    this._material.update(context);\n\n    this._overlayCommand.renderState = this._rs;\n    this._overlayCommand.uniformMap = this._material._uniforms;\n    frameState.commandList.push(this._overlayCommand);\n  }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see ViewportQuad#destroy\n */\nViewportQuad.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * quad = quad && quad.destroy();\n *\n * @see ViewportQuad#isDestroyed\n */\nViewportQuad.prototype.destroy = function () {\n  if (defined(this._overlayCommand)) {\n    this._overlayCommand.shaderProgram =\n      this._overlayCommand.shaderProgram &&\n      this._overlayCommand.shaderProgram.destroy();\n  }\n  return destroyObject(this);\n};\nexport default ViewportQuad;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"// See Intersection.glsl for the definition of intersectScene\\n\\\n// See IntersectionUtils.glsl for the definition of nextIntersection\\n\\\n// See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl\\n\\\n// for the definition of convertUvToShapeUvSpace. The appropriate function is \\n\\\n// selected based on the VoxelPrimitive shape type, and added to the shader in\\n\\\n// Scene/VoxelRenderResources.js.\\n\\\n// See Octree.glsl for the definitions of TraversalData, SampleData,\\n\\\n// traverseOctreeFromBeginning, and traverseOctreeFromExisting\\n\\\n// See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture\\n\\\n\\n\\\n#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops\\n\\\n#define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0\\n\\\n\\n\\\nuniform mat3 u_transformDirectionViewToLocal;\\n\\\nuniform vec3 u_cameraPositionUv;\\n\\\nuniform float u_stepSize;\\n\\\n\\n\\\n#if defined(PICKING)\\n\\\n    uniform vec4 u_pickColor;\\n\\\n#endif\\n\\\n\\n\\\n#if defined(JITTER)\\n\\\nfloat hash(vec2 p)\\n\\\n{\\n\\\n    vec3 p3 = fract(vec3(p.xyx) * 50.0); // magic number = hashscale\\n\\\n    p3 += dot(p3, p3.yzx + 19.19);\\n\\\n    return fract((p3.x + p3.y) * p3.z);\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\nvec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection) {\\n\\\n#if defined(SHAPE_BOX)\\n\\\n    Box voxelBox = constructVoxelBox(sampleData.tileCoords, sampleData.tileUv);\\n\\\n    RayShapeIntersection voxelIntersection = intersectBox(viewRay, voxelBox);\\n\\\n    vec4 entry = shapeIntersection.entry.w >= voxelIntersection.entry.w ? shapeIntersection.entry : voxelIntersection.entry;\\n\\\n    float exit = min(voxelIntersection.exit.w, shapeIntersection.exit.w);\\n\\\n    float dt = (exit - entry.w) * RAY_SCALE;\\n\\\n    return vec4(normalize(entry.xyz), dt);\\n\\\n#else\\n\\\n    float dimAtLevel = pow(2.0, float(sampleData.tileCoords.w));\\n\\\n    return vec4(viewRay.dir, u_stepSize / dimAtLevel);\\n\\\n#endif\\n\\\n}\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    vec4 fragCoord = gl_FragCoord;\\n\\\n    vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1]\\n\\\n    vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz);\\n\\\n    vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); // normalize again just in case\\n\\\n    vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); // normalize again just in case\\n\\\n    vec3 viewPosUv = u_cameraPositionUv;\\n\\\n    #if defined(SHAPE_BOX)\\n\\\n        vec3 dInv = 1.0 / viewDirUv;\\n\\\n        Ray viewRayUv = Ray(viewPosUv, viewDirUv, dInv);\\n\\\n    #else\\n\\\n        Ray viewRayUv = Ray(viewPosUv, viewDirUv);\\n\\\n    #endif\\n\\\n\\n\\\n    Intersections ix;\\n\\\n    RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix);\\n\\\n\\n\\\n    // Exit early if the scene was completely missed.\\n\\\n    if (shapeIntersection.entry.w == NO_HIT) {\\n\\\n        discard;\\n\\\n    }\\n\\\n\\n\\\n    float currT = shapeIntersection.entry.w * RAY_SCALE;\\n\\\n    float endT = shapeIntersection.exit.w;\\n\\\n    vec3 positionUv = viewPosUv + currT * viewDirUv;\\n\\\n    vec3 positionUvShapeSpace = convertUvToShapeUvSpace(positionUv);\\n\\\n\\n\\\n    // Traverse the tree from the start position\\n\\\n    TraversalData traversalData;\\n\\\n    SampleData sampleDatas[SAMPLE_COUNT];\\n\\\n    traverseOctreeFromBeginning(positionUvShapeSpace, traversalData, sampleDatas);\\n\\\n    vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection);\\n\\\n\\n\\\n    #if defined(JITTER)\\n\\\n        float noise = hash(screenCoord); // [0,1]\\n\\\n        currT += noise * step.w;\\n\\\n        positionUv += noise * step.w * viewDirUv;\\n\\\n    #endif\\n\\\n\\n\\\n    FragmentInput fragmentInput;\\n\\\n    #if defined(STATISTICS)\\n\\\n        setStatistics(fragmentInput.metadata.statistics);\\n\\\n    #endif\\n\\\n\\n\\\n    vec4 colorAccum =vec4(0.0);\\n\\\n\\n\\\n    for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) {\\n\\\n        // Read properties from the megatexture based on the traversal state\\n\\\n        Properties properties = accumulatePropertiesFromMegatexture(sampleDatas);\\n\\\n\\n\\\n        // Prepare the custom shader inputs\\n\\\n        copyPropertiesToMetadata(properties, fragmentInput.metadata);\\n\\\n        fragmentInput.voxel.positionUv = positionUv;\\n\\\n        fragmentInput.voxel.positionShapeUv = positionUvShapeSpace;\\n\\\n        fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv;\\n\\\n        fragmentInput.voxel.viewDirUv = viewDirUv;\\n\\\n        fragmentInput.voxel.viewDirWorld = viewDirWorld;\\n\\\n        fragmentInput.voxel.surfaceNormal = step.xyz;\\n\\\n        fragmentInput.voxel.travelDistance = step.w;\\n\\\n\\n\\\n        // Run the custom shader\\n\\\n        czm_modelMaterial materialOutput;\\n\\\n        fragmentMain(fragmentInput, materialOutput);\\n\\\n\\n\\\n        // Sanitize the custom shader output\\n\\\n        vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha);\\n\\\n        color.rgb = max(color.rgb, vec3(0.0));\\n\\\n        color.a = clamp(color.a, 0.0, 1.0);\\n\\\n\\n\\\n        // Pre-multiplied alpha blend\\n\\\n        colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a);\\n\\\n\\n\\\n        // Stop traversing if the alpha has been fully saturated\\n\\\n        if (colorAccum.a > ALPHA_ACCUM_MAX) {\\n\\\n            colorAccum.a = ALPHA_ACCUM_MAX;\\n\\\n            break;\\n\\\n        }\\n\\\n\\n\\\n        if (step.w == 0.0) {\\n\\\n            // Shape is infinitely thin. The ray may have hit the edge of a\\n\\\n            // foreground voxel. Step ahead slightly to check for more voxels\\n\\\n            step.w == 0.00001;\\n\\\n        }\\n\\\n\\n\\\n        // Keep raymarching\\n\\\n        currT += step.w;\\n\\\n        positionUv += step.w * viewDirUv;\\n\\\n\\n\\\n        // Check if there's more intersections.\\n\\\n        if (currT > endT) {\\n\\\n            #if (INTERSECTION_COUNT == 1)\\n\\\n                break;\\n\\\n            #else\\n\\\n                shapeIntersection = nextIntersection(ix);\\n\\\n                if (shapeIntersection.entry.w == NO_HIT) {\\n\\\n                    break;\\n\\\n                } else {\\n\\\n                    // Found another intersection. Resume raymarching there\\n\\\n                    currT = shapeIntersection.entry.w * RAY_SCALE;\\n\\\n                    endT = shapeIntersection.exit.w;\\n\\\n                    positionUv = viewPosUv + currT * viewDirUv;\\n\\\n                }\\n\\\n            #endif\\n\\\n        }\\n\\\n\\n\\\n        // Traverse the tree from the current ray position.\\n\\\n        // This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step.\\n\\\n        positionUvShapeSpace = convertUvToShapeUvSpace(positionUv);\\n\\\n        traverseOctreeFromExisting(positionUvShapeSpace, traversalData, sampleDatas);\\n\\\n        step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection);\\n\\\n    }\\n\\\n\\n\\\n    // Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1]\\n\\\n    colorAccum.a /= ALPHA_ACCUM_MAX;\\n\\\n\\n\\\n    #if defined(PICKING)\\n\\\n        // If alpha is 0.0 there is nothing to pick\\n\\\n        if (colorAccum.a == 0.0) {\\n\\\n            discard;\\n\\\n        }\\n\\\n        out_FragColor = u_pickColor;\\n\\\n    #else\\n\\\n        out_FragColor = colorAccum;\\n\\\n    #endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"in vec2 position;\\n\\\n\\n\\\nuniform vec4 u_ndcSpaceAxisAlignedBoundingBox;\\n\\\n\\n\\\nvoid main() {\\n\\\n    vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy;\\n\\\n    vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw;\\n\\\n    vec2 translation = 0.5 * (aabbMax + aabbMin);\\n\\\n    vec2 scale = 0.5 * (aabbMax - aabbMin);\\n\\\n    gl_Position = vec4(position * scale + translation, 0.0, 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/* Intersection defines\\n\\\n#define INTERSECTION_COUNT ###\\n\\\n*/\\n\\\n\\n\\\n#define NO_HIT (-czm_infinity)\\n\\\n#define INF_HIT (czm_infinity * 0.5)\\n\\\n#define RAY_SHIFT (0.000003163)\\n\\\n#define RAY_SCALE (1.003163)\\n\\\n\\n\\\nstruct Ray {\\n\\\n    vec3 pos;\\n\\\n    vec3 dir;\\n\\\n#if defined(SHAPE_BOX)\\n\\\n    vec3 dInv;\\n\\\n#endif\\n\\\n};\\n\\\n\\n\\\nstruct RayShapeIntersection {\\n\\\n    vec4 entry;\\n\\\n    vec4 exit;\\n\\\n};\\n\\\n\\n\\\nstruct Intersections {\\n\\\n    // Don't access these member variables directly - call the functions instead.\\n\\\n\\n\\\n    // Store an array of ray-surface intersections. Each intersection is composed of:\\n\\\n    //  .xyz for the surface normal at the intersection point\\n\\\n    //  .w for the T value\\n\\\n    // The scale of the normal encodes the shape intersection type:\\n\\\n    //  length(intersection.xyz) = 1: positive shape entry\\n\\\n    //  length(intersection.xyz) = 2: positive shape exit\\n\\\n    //  length(intersection.xyz) = 3: negative shape entry\\n\\\n    //  length(intersection.xyz) = 4: negative shape exit\\n\\\n    // INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections,\\n\\\n    // so we need twice as many to track ray-*surface* intersections\\n\\\n    vec4 intersections[INTERSECTION_COUNT * 2];\\n\\\n\\n\\\n    #if (INTERSECTION_COUNT > 1)\\n\\\n        // Maintain state for future nextIntersection calls\\n\\\n        int index;\\n\\\n        int surroundCount;\\n\\\n        bool surroundIsPositive;\\n\\\n    #endif\\n\\\n};\\n\\\n\\n\\\nRayShapeIntersection getFirstIntersection(in Intersections ix) \\n\\\n{\\n\\\n    return RayShapeIntersection(ix.intersections[0], ix.intersections[1]);\\n\\\n}\\n\\\n\\n\\\nvec4 encodeIntersectionType(vec4 intersection, int index, bool entry)\\n\\\n{\\n\\\n    float scale = float(index > 0) * 2.0 + float(!entry) + 1.0;\\n\\\n    return vec4(intersection.xyz * scale, intersection.w);\\n\\\n}\\n\\\n\\n\\\n// Use defines instead of real functions because WebGL1 cannot access array with non-constant index.\\n\\\n#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t))\\n\\\n#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y)\\n\\\n#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection) (ix).intersections[(index)] = intersection;\\n\\\n#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false)\\n\\\n\\n\\\n#if (INTERSECTION_COUNT > 1)\\n\\\nvoid initializeIntersections(inout Intersections ix) {\\n\\\n    // Sort the intersections from min T to max T with bubble sort.\\n\\\n    // Note: If this sorting function changes, some of the intersection test may\\n\\\n    // need to be updated. Search for \\\"bubble sort\\\" to find those areas.\\n\\\n    const int sortPasses = INTERSECTION_COUNT * 2 - 1;\\n\\\n    for (int n = sortPasses; n > 0; --n) {\\n\\\n        for (int i = 0; i < sortPasses; ++i) {\\n\\\n            // The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot\\n\\\n            // loop with non-constant condition, so it has to break early instead\\n\\\n            if (i >= n) { break; }\\n\\\n\\n\\\n            vec4 intersect0 = ix.intersections[i + 0];\\n\\\n            vec4 intersect1 = ix.intersections[i + 1];\\n\\\n\\n\\\n            bool inOrder = intersect0.w <= intersect1.w;\\n\\\n\\n\\\n            ix.intersections[i + 0] = inOrder ? intersect0 : intersect1;\\n\\\n            ix.intersections[i + 1] = inOrder ? intersect1 : intersect0;\\n\\\n        }\\n\\\n    }\\n\\\n\\n\\\n    // Prepare initial state for nextIntersection\\n\\\n    ix.index = 0;\\n\\\n    ix.surroundCount = 0;\\n\\\n    ix.surroundIsPositive = false;\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\n#if (INTERSECTION_COUNT > 1)\\n\\\nRayShapeIntersection nextIntersection(inout Intersections ix) {\\n\\\n    vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT);\\n\\\n    RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection);\\n\\\n\\n\\\n    const int passCount = INTERSECTION_COUNT * 2;\\n\\\n\\n\\\n    if (ix.index == passCount) {\\n\\\n        return shapeIntersection;\\n\\\n    }\\n\\\n\\n\\\n    for (int i = 0; i < passCount; ++i) {\\n\\\n        // The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot\\n\\\n        // loop with non-constant condition, so it has to continue instead.\\n\\\n        if (i < ix.index) {\\n\\\n            continue;\\n\\\n        }\\n\\\n\\n\\\n        ix.index = i + 1;\\n\\\n\\n\\\n        surfaceIntersection = ix.intersections[i];\\n\\\n        int intersectionType = int(length(surfaceIntersection.xyz) - 0.5);\\n\\\n        bool currShapeIsPositive = intersectionType < 2;\\n\\\n        bool enter = intMod(intersectionType, 2) == 0;\\n\\\n\\n\\\n        ix.surroundCount += enter ? +1 : -1;\\n\\\n        ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive;\\n\\\n\\n\\\n        // entering positive or exiting negative\\n\\\n        if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) {\\n\\\n            shapeIntersection.entry = surfaceIntersection;\\n\\\n        }\\n\\\n\\n\\\n        // exiting positive or entering negative after being inside positive\\n\\\n        bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0;\\n\\\n        bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive;\\n\\\n        if (exitPositive || enterNegativeFromPositive) {\\n\\\n            shapeIntersection.exit = surfaceIntersection;\\n\\\n\\n\\\n            // entry and exit have been found, so the loop can stop\\n\\\n            if (exitPositive) {\\n\\\n                // After exiting positive shape there is nothing left to intersect, so jump to the end index.\\n\\\n                ix.index = passCount;\\n\\\n            }\\n\\\n            break;\\n\\\n        }\\n\\\n    }\\n\\\n\\n\\\n    return shapeIntersection;\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\n// NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"// See IntersectionUtils.glsl for the definitions of Ray, Intersections,\\n\\\n// setIntersectionPair, INF_HIT, NO_HIT\\n\\\n\\n\\\n/* intersectDepth defines (set in Scene/VoxelRenderResources.js)\\n\\\n#define DEPTH_INTERSECTION_INDEX ###\\n\\\n*/\\n\\\n\\n\\\nuniform mat4 u_transformPositionViewToUv;\\n\\\n\\n\\\nvoid intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {\\n\\\n    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));\\n\\\n    if (logDepthOrDepth != 0.0) {\\n\\\n        // Calculate how far the ray must travel before it hits the depth buffer.\\n\\\n        vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);\\n\\\n        eyeCoordinateDepth /= eyeCoordinateDepth.w;\\n\\\n        vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth);\\n\\\n        float t = dot(depthPositionUv - ray.pos, ray.dir);\\n\\\n        setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT));\\n\\\n    } else {\\n\\\n        // There's no depth at this location.\\n\\\n        setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT));\\n\\\n    }\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT,\\n\\\n// NO_HIT, setIntersectionPair\\n\\\n\\n\\\n/* Clipping plane defines (set in Scene/VoxelRenderResources.js)\\n\\\n#define CLIPPING_PLANES_UNION\\n\\\n#define CLIPPING_PLANES_COUNT\\n\\\n#define CLIPPING_PLANES_INTERSECTION_INDEX\\n\\\n*/\\n\\\n\\n\\\nuniform sampler2D u_clippingPlanesTexture;\\n\\\nuniform mat4 u_clippingPlanesMatrix;\\n\\\n\\n\\\n// Plane is in Hessian Normal Form\\n\\\nvec4 intersectPlane(in Ray ray, in vec4 plane) {\\n\\\n    vec3 n = plane.xyz; // normal\\n\\\n    float w = plane.w; // -dot(pointOnPlane, normal)\\n\\\n\\n\\\n    float a = dot(ray.pos, n);\\n\\\n    float b = dot(ray.dir, n);\\n\\\n    float t = -(w + a) / b;\\n\\\n\\n\\\n    return vec4(n, t);\\n\\\n}\\n\\\n\\n\\\nvoid intersectClippingPlanes(in Ray ray, inout Intersections ix) {\\n\\\n    vec4 backSide = vec4(-ray.dir, -INF_HIT);\\n\\\n    vec4 farSide = vec4(ray.dir, +INF_HIT);\\n\\\n    RayShapeIntersection clippingVolume;\\n\\\n\\n\\\n    #if (CLIPPING_PLANES_COUNT == 1)\\n\\\n        // Union and intersection are the same when there's one clipping plane, and the code\\n\\\n        // is more simplified.\\n\\\n        vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix);\\n\\\n        vec4 intersection = intersectPlane(ray, planeUv);\\n\\\n        bool reflects = dot(ray.dir, intersection.xyz) < 0.0;\\n\\\n        clippingVolume.entry = reflects ? backSide : intersection;\\n\\\n        clippingVolume.exit = reflects ? intersection : farSide;\\n\\\n        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);\\n\\\n    #elif defined(CLIPPING_PLANES_UNION)\\n\\\n        vec4 firstTransmission = vec4(ray.dir, +INF_HIT);\\n\\\n        vec4 lastReflection = vec4(-ray.dir, -INF_HIT);\\n\\\n        for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {\\n\\\n            vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);\\n\\\n            vec4 intersection = intersectPlane(ray, planeUv);\\n\\\n            if (dot(ray.dir, planeUv.xyz) > 0.0) {\\n\\\n                firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission;\\n\\\n            } else {\\n\\\n                lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection;\\n\\\n            }\\n\\\n        }\\n\\\n        clippingVolume.entry = backSide;\\n\\\n        clippingVolume.exit = lastReflection;\\n\\\n        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume);\\n\\\n        clippingVolume.entry = firstTransmission;\\n\\\n        clippingVolume.exit = farSide;\\n\\\n        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume);\\n\\\n    #else // intersection\\n\\\n        vec4 lastTransmission = vec4(ray.dir, -INF_HIT);\\n\\\n        vec4 firstReflection = vec4(-ray.dir, +INF_HIT);\\n\\\n        for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {\\n\\\n            vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);\\n\\\n            vec4 intersection = intersectPlane(ray, planeUv);\\n\\\n            if (dot(ray.dir, planeUv.xyz) > 0.0) {\\n\\\n                lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission;\\n\\\n            } else {\\n\\\n                firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection;\\n\\\n            }\\n\\\n        }\\n\\\n        if (lastTransmission.w < firstReflection.w) {\\n\\\n            clippingVolume.entry = lastTransmission;\\n\\\n            clippingVolume.exit = firstReflection;\\n\\\n        } else {\\n\\\n            clippingVolume.entry = vec4(-ray.dir, NO_HIT);\\n\\\n            clippingVolume.exit = vec4(ray.dir, NO_HIT);\\n\\\n        }\\n\\\n        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);\\n\\\n    #endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"// See IntersectionUtils.glsl for the definitions of Ray and NO_HIT\\n\\\n// See convertUvToBox.glsl for the definition of convertShapeUvToUvSpace\\n\\\n\\n\\\n/* Box defines (set in Scene/VoxelBoxShape.js)\\n\\\n#define BOX_INTERSECTION_INDEX ### // always 0\\n\\\n*/\\n\\\n\\n\\\nuniform vec3 u_renderMinBounds;\\n\\\nuniform vec3 u_renderMaxBounds;\\n\\\n\\n\\\nstruct Box {\\n\\\n    vec3 p0;\\n\\\n    vec3 p1;\\n\\\n};\\n\\\n\\n\\\nBox constructVoxelBox(in ivec4 octreeCoords, in vec3 tileUv)\\n\\\n{\\n\\\n    // Find the min/max cornerpoints of the voxel in tile coordinates\\n\\\n    vec3 tileOrigin = vec3(octreeCoords.xyz);\\n\\\n    vec3 numSamples = vec3(u_dimensions);\\n\\\n    vec3 voxelSize = 1.0 / numSamples;\\n\\\n    vec3 coordP0 = floor(tileUv * numSamples) * voxelSize + tileOrigin;\\n\\\n    vec3 coordP1 = coordP0 + voxelSize;\\n\\\n\\n\\\n    // Transform to the UV coordinates of the scaled tileset\\n\\\n    float tileSize = 1.0 / pow(2.0, float(octreeCoords.w));\\n\\\n    vec3 p0 = convertShapeUvToUvSpace(coordP0 * tileSize);\\n\\\n    vec3 p1 = convertShapeUvToUvSpace(coordP1 * tileSize);\\n\\\n\\n\\\n    return Box(p0, p1);\\n\\\n}\\n\\\n\\n\\\nvec3 getBoxNormal(in Box box, in Ray ray, in float t)\\n\\\n{\\n\\\n    vec3 hitPoint = ray.pos + t * ray.dir;\\n\\\n    vec3 lower = step(hitPoint, box.p0);\\n\\\n    vec3 upper = step(box.p1, hitPoint);\\n\\\n    return normalize(upper - lower);\\n\\\n}\\n\\\n\\n\\\n// Find the distances along a ray at which the ray intersects an axis-aligned box\\n\\\n// See https://tavianator.com/2011/ray_box.html\\n\\\nRayShapeIntersection intersectBox(in Ray ray, in Box box)\\n\\\n{\\n\\\n    // Consider the box as the intersection of the space between 3 pairs of parallel planes\\n\\\n    // Compute the distance along the ray to each plane\\n\\\n    vec3 t0 = (box.p0 - ray.pos) * ray.dInv;\\n\\\n    vec3 t1 = (box.p1 - ray.pos) * ray.dInv;\\n\\\n\\n\\\n    // Identify candidate entries/exits based on distance from ray.pos\\n\\\n    vec3 entries = min(t0, t1);\\n\\\n    vec3 exits = max(t0, t1);\\n\\\n\\n\\\n    // The actual box intersection points are the furthest entry and the closest exit\\n\\\n    float entryT = max(max(entries.x, entries.y), entries.z);\\n\\\n    float exitT = min(min(exits.x, exits.y), exits.z);\\n\\\n\\n\\\n    vec3 entryNormal = getBoxNormal(box, ray, entryT - RAY_SHIFT);\\n\\\n    vec3 exitNormal = getBoxNormal(box, ray, exitT + RAY_SHIFT);\\n\\\n\\n\\\n    if (entryT > exitT) {\\n\\\n        entryT = NO_HIT;\\n\\\n        exitT = NO_HIT;\\n\\\n    }\\n\\\n\\n\\\n    return RayShapeIntersection(vec4(entryNormal, entryT), vec4(exitNormal, exitT));\\n\\\n}\\n\\\n\\n\\\nvoid intersectShape(in Ray ray, inout Intersections ix)\\n\\\n{\\n\\\n    RayShapeIntersection intersection = intersectBox(ray, Box(u_renderMinBounds, u_renderMaxBounds));\\n\\\n    setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"// See IntersectionUtils.glsl for the definitions of Ray, setIntersection,\\n\\\n// setIntersectionPair\\n\\\n\\n\\\n/* Cylinder defines (set in Scene/VoxelCylinderShape.js)\\n\\\n#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN\\n\\\n#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX\\n\\\n#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT\\n\\\n#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT\\n\\\n#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT\\n\\\n#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE\\n\\\n#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF\\n\\\n#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF\\n\\\n#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF\\n\\\n#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO\\n\\\n\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED\\n\\\n\\n\\\n#define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX\\n\\\n#define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN\\n\\\n#define CYLINDER_INTERSECTION_INDEX_ANGLE\\n\\\n*/\\n\\\n\\n\\\n// Cylinder uniforms\\n\\\n#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT)\\n\\\n    uniform vec3 u_cylinderUvToRenderBoundsScale;\\n\\\n    uniform vec3 u_cylinderUvToRenderBoundsTranslate;\\n\\\n#endif\\n\\\n#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) && !defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)\\n\\\n    uniform float u_cylinderUvToRenderRadiusMin;\\n\\\n#endif\\n\\\n#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)\\n\\\n    uniform vec2 u_cylinderRenderAngleMinMax;\\n\\\n#endif\\n\\\n\\n\\\nvec4 intersectHalfPlane(Ray ray, float angle) {\\n\\\n    vec2 o = ray.pos.xy;\\n\\\n    vec2 d = ray.dir.xy;\\n\\\n    vec2 planeDirection = vec2(cos(angle), sin(angle));\\n\\\n    vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x);\\n\\\n\\n\\\n    float a = dot(o, planeNormal);\\n\\\n    float b = dot(d, planeNormal);\\n\\\n    float t = -a / b;\\n\\\n\\n\\\n    vec2 p = o + t * d;\\n\\\n    bool outside = dot(p, planeDirection) < 0.0;\\n\\\n    if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT);\\n\\\n\\n\\\n    return vec4(-INF_HIT, t, t, +INF_HIT);\\n\\\n}\\n\\\n\\n\\\n#define POSITIVE_HIT vec2(t, +INF_HIT);\\n\\\n#define NEGATIVE_HIT vec2(-INF_HIT, t);\\n\\\n\\n\\\nvec2 intersectHalfSpace(Ray ray, float angle)\\n\\\n{\\n\\\n    vec2 o = ray.pos.xy;\\n\\\n    vec2 d = ray.dir.xy;\\n\\\n    vec2 n = vec2(sin(angle), -cos(angle));\\n\\\n\\n\\\n    float a = dot(o, n);\\n\\\n    float b = dot(d, n);\\n\\\n    float t = -a / b;\\n\\\n    float s = sign(a);\\n\\\n\\n\\\n    // Half space cuts right through the camera, pick the side to intersect\\n\\\n    if (a == 0.0) {\\n\\\n        if (b >= 0.0) {\\n\\\n            return POSITIVE_HIT;\\n\\\n        } else {\\n\\\n            return NEGATIVE_HIT;\\n\\\n        }\\n\\\n    }\\n\\\n\\n\\\n    if (t >= 0.0 != s >= 0.0) {\\n\\\n        return POSITIVE_HIT;\\n\\\n    } else {\\n\\\n        return NEGATIVE_HIT;\\n\\\n    }\\n\\\n}\\n\\\n\\n\\\nvec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle)\\n\\\n{\\n\\\n    vec2 o = ray.pos.xy;\\n\\\n    vec2 d = ray.dir.xy;\\n\\\n    vec2 n1 = vec2(sin(minAngle), -cos(minAngle));\\n\\\n    vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle));\\n\\\n\\n\\\n    float a1 = dot(o, n1);\\n\\\n    float a2 = dot(o, n2);\\n\\\n    float b1 = dot(d, n1);\\n\\\n    float b2 = dot(d, n2);\\n\\\n\\n\\\n    float t1 = -a1 / b1;\\n\\\n    float t2 = -a2 / b2;\\n\\\n    float s1 = sign(a1);\\n\\\n    float s2 = sign(a2);\\n\\\n\\n\\\n    float tmin = min(t1, t2);\\n\\\n    float tmax = max(t1, t2);\\n\\\n    float smin = tmin == t1 ? s1 : s2;\\n\\\n    float smax = tmin == t1 ? s2 : s1;\\n\\\n\\n\\\n    bool e = tmin >= 0.0;\\n\\\n    bool f = tmax >= 0.0;\\n\\\n    bool g = smin >= 0.0;\\n\\\n    bool h = smax >= 0.0;\\n\\\n\\n\\\n    if (e != g && f == h) return vec2(tmin, tmax);\\n\\\n    else if (e == g && f == h) return vec2(-INF_HIT, tmin);\\n\\\n    else if (e != g && f != h) return vec2(tmax, +INF_HIT);\\n\\\n    else return vec2(NO_HIT);\\n\\\n}\\n\\\n\\n\\\nvec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle)\\n\\\n{\\n\\\n    vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle);\\n\\\n    vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi);\\n\\\n    return vec4(planeIntersectMin, planeIntersectMax);\\n\\\n}\\n\\\n\\n\\\nvec2 intersectUnitCylinder(Ray ray)\\n\\\n{\\n\\\n    vec3 o = ray.pos;\\n\\\n    vec3 d = ray.dir;\\n\\\n\\n\\\n    float a = dot(d.xy, d.xy);\\n\\\n    float b = dot(o.xy, d.xy);\\n\\\n    float c = dot(o.xy, o.xy) - 1.0;\\n\\\n    float det = b * b - a * c;\\n\\\n\\n\\\n    if (det < 0.0) {\\n\\\n        return vec2(NO_HIT);\\n\\\n    }\\n\\\n\\n\\\n    det = sqrt(det);\\n\\\n    float ta = (-b - det) / a;\\n\\\n    float tb = (-b + det) / a;\\n\\\n    float t1 = min(ta, tb);\\n\\\n    float t2 = max(ta, tb);\\n\\\n\\n\\\n    float z1 = o.z + t1 * d.z;\\n\\\n    float z2 = o.z + t2 * d.z;\\n\\\n\\n\\\n    if (abs(z1) >= 1.0)\\n\\\n    {\\n\\\n        float tCap = (sign(z1) - o.z) / d.z;\\n\\\n        t1 = abs(b + a * tCap) < det ? tCap : NO_HIT;\\n\\\n    }\\n\\\n\\n\\\n    if (abs(z2) >= 1.0)\\n\\\n    {\\n\\\n        float tCap = (sign(z2) - o.z) / d.z;\\n\\\n        t2 = abs(b + a * tCap) < det ? tCap : NO_HIT;\\n\\\n    }\\n\\\n\\n\\\n    return vec2(t1, t2);\\n\\\n}\\n\\\n\\n\\\nvec2 intersectUnitCircle(Ray ray) {\\n\\\n    vec3 o = ray.pos;\\n\\\n    vec3 d = ray.dir;\\n\\\n\\n\\\n    float t = -o.z / d.z;\\n\\\n    vec2 zPlanePos = o.xy + d.xy * t;\\n\\\n    float distSqr = dot(zPlanePos, zPlanePos);\\n\\\n\\n\\\n    if (distSqr > 1.0) {\\n\\\n        return vec2(NO_HIT);\\n\\\n    }\\n\\\n\\n\\\n    return vec2(t, t);\\n\\\n}\\n\\\n\\n\\\nvec2 intersectInfiniteUnitCylinder(Ray ray)\\n\\\n{\\n\\\n    vec3 o = ray.pos;\\n\\\n    vec3 d = ray.dir;\\n\\\n\\n\\\n    float a = dot(d.xy, d.xy);\\n\\\n    float b = dot(o.xy, d.xy);\\n\\\n    float c = dot(o.xy, o.xy) - 1.0;\\n\\\n    float det = b * b - a * c;\\n\\\n\\n\\\n    if (det < 0.0) {\\n\\\n        return vec2(NO_HIT);\\n\\\n    }\\n\\\n\\n\\\n    det = sqrt(det);\\n\\\n    float t1 = (-b - det) / a;\\n\\\n    float t2 = (-b + det) / a;\\n\\\n    float tmin = min(t1, t2);\\n\\\n    float tmax = max(t1, t2);\\n\\\n\\n\\\n    return vec2(tmin, tmax);\\n\\\n}\\n\\\n\\n\\\nvoid intersectShape(Ray ray, inout Intersections ix)\\n\\\n{\\n\\\n    #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT)\\n\\\n        ray.pos = ray.pos * u_cylinderUvToRenderBoundsScale + u_cylinderUvToRenderBoundsTranslate;\\n\\\n        ray.dir *= u_cylinderUvToRenderBoundsScale;\\n\\\n    #else\\n\\\n        // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].\\n\\\n        // Direction is scaled as well to be in sync with position.\\n\\\n        ray.pos = ray.pos * 2.0 - 1.0;\\n\\\n        ray.dir *= 2.0;\\n\\\n    #endif\\n\\\n\\n\\\n    #if defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT)\\n\\\n        vec2 outerIntersect = intersectUnitCircle(ray);\\n\\\n    #else\\n\\\n        vec2 outerIntersect = intersectUnitCylinder(ray);\\n\\\n    #endif\\n\\\n\\n\\\n    setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);\\n\\\n\\n\\\n    if (outerIntersect.x == NO_HIT) {\\n\\\n        return;\\n\\\n    }\\n\\\n\\n\\\n    #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)\\n\\\n        // When the cylinder is perfectly thin it's necessary to sandwich the\\n\\\n        // inner cylinder intersection inside the outer cylinder intersection.\\n\\\n\\n\\\n        // Without this special case,\\n\\\n        // [outerMin, outerMax, innerMin, innerMax] will bubble sort to\\n\\\n        // [outerMin, innerMin, outerMax, innerMax] which will cause the back\\n\\\n        // side of the cylinder to be invisible because it will think the ray\\n\\\n        // is still inside the inner (negative) cylinder after exiting the\\n\\\n        // outer (positive) cylinder.\\n\\\n\\n\\\n        // With this special case,\\n\\\n        // [outerMin, innerMin, innerMax, outerMax] will bubble sort to\\n\\\n        // [outerMin, innerMin, innerMax, outerMax] which will work correctly.\\n\\\n\\n\\\n        // Note: If initializeIntersections() changes its sorting function\\n\\\n        // from bubble sort to something else, this code may need to change.\\n\\\n        vec2 innerIntersect = intersectInfiniteUnitCylinder(ray);\\n\\\n        setIntersection(ix, 0, outerIntersect.x, true, true);   // positive, enter\\n\\\n        setIntersection(ix, 1, innerIntersect.x, false, true);  // negative, enter\\n\\\n        setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit\\n\\\n        setIntersection(ix, 3, outerIntersect.y, true, false);  // positive, exit\\n\\\n    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN)\\n\\\n        Ray innerRay = Ray(ray.pos * u_cylinderUvToRenderRadiusMin, ray.dir * u_cylinderUvToRenderRadiusMin);\\n\\\n        vec2 innerIntersect = intersectInfiniteUnitCylinder(innerRay);\\n\\\n        setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect);\\n\\\n    #endif\\n\\\n\\n\\\n    #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF)\\n\\\n        vec2 wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y);\\n\\\n        setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect);\\n\\\n    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF)\\n\\\n        vec4 wedgeIntersect = intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y);\\n\\\n        setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy);\\n\\\n        setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw);\\n\\\n    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF)\\n\\\n        vec2 wedgeIntersect = intersectHalfSpace(ray, u_cylinderRenderAngleMinMax.x);\\n\\\n        setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect);\\n\\\n    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO)\\n\\\n        vec4 wedgeIntersect = intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x);\\n\\\n        setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy);\\n\\\n        setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw);\\n\\\n    #endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"// See IntersectionUtils.glsl for the definitions of Ray, Intersections,\\n\\\n// setIntersection, setIntersectionPair, INF_HIT, NO_HIT\\n\\\n\\n\\\n/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT\\n\\\n#define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE\\n\\\n#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX\\n\\\n#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN\\n\\\n#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX\\n\\\n#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN\\n\\\n*/\\n\\\n\\n\\\n#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE)\\n\\\n    uniform vec2 u_ellipsoidRenderLongitudeMinMax;\\n\\\n#endif\\n\\\n#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF)\\n\\\n    uniform vec2 u_ellipsoidRenderLatitudeCosSqrHalfMinMax;\\n\\\n#endif\\n\\\n#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX)\\n\\\n    uniform float u_ellipsoidInverseOuterScaleUv;\\n\\\n#endif\\n\\\n#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN)\\n\\\n    uniform float u_ellipsoidInverseInnerScaleUv;\\n\\\n#endif\\n\\\n\\n\\\nvec2 intersectZPlane(Ray ray)\\n\\\n{\\n\\\n    float o = ray.pos.z;\\n\\\n    float d = ray.dir.z;\\n\\\n    float t = -o / d;\\n\\\n    float s = sign(o);\\n\\\n\\n\\\n    if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT);\\n\\\n    else return vec2(-INF_HIT, t);\\n\\\n}\\n\\\n\\n\\\nvec4 intersectHalfPlane(Ray ray, float angle) {\\n\\\n    vec2 o = ray.pos.xy;\\n\\\n    vec2 d = ray.dir.xy;\\n\\\n    vec2 planeDirection = vec2(cos(angle), sin(angle));\\n\\\n    vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x);\\n\\\n\\n\\\n    float a = dot(o, planeNormal);\\n\\\n    float b = dot(d, planeNormal);\\n\\\n    float t = -a / b;\\n\\\n\\n\\\n    vec2 p = o + t * d;\\n\\\n    bool outside = dot(p, planeDirection) < 0.0;\\n\\\n    if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT);\\n\\\n\\n\\\n    return vec4(-INF_HIT, t, t, +INF_HIT);\\n\\\n}\\n\\\n\\n\\\nvec2 intersectHalfSpace(Ray ray, float angle)\\n\\\n{\\n\\\n    vec2 o = ray.pos.xy;\\n\\\n    vec2 d = ray.dir.xy;\\n\\\n    vec2 n = vec2(sin(angle), -cos(angle));\\n\\\n\\n\\\n    float a = dot(o, n);\\n\\\n    float b = dot(d, n);\\n\\\n    float t = -a / b;\\n\\\n    float s = sign(a);\\n\\\n\\n\\\n    if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT);\\n\\\n    else return vec2(-INF_HIT, t);\\n\\\n}\\n\\\n\\n\\\nvec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle)\\n\\\n{\\n\\\n    vec2 o = ray.pos.xy;\\n\\\n    vec2 d = ray.dir.xy;\\n\\\n    vec2 n1 = vec2(sin(minAngle), -cos(minAngle));\\n\\\n    vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle));\\n\\\n\\n\\\n    float a1 = dot(o, n1);\\n\\\n    float a2 = dot(o, n2);\\n\\\n    float b1 = dot(d, n1);\\n\\\n    float b2 = dot(d, n2);\\n\\\n\\n\\\n    float t1 = -a1 / b1;\\n\\\n    float t2 = -a2 / b2;\\n\\\n    float s1 = sign(a1);\\n\\\n    float s2 = sign(a2);\\n\\\n\\n\\\n    float tmin = min(t1, t2);\\n\\\n    float tmax = max(t1, t2);\\n\\\n    float smin = tmin == t1 ? s1 : s2;\\n\\\n    float smax = tmin == t1 ? s2 : s1;\\n\\\n\\n\\\n    bool e = tmin >= 0.0;\\n\\\n    bool f = tmax >= 0.0;\\n\\\n    bool g = smin >= 0.0;\\n\\\n    bool h = smax >= 0.0;\\n\\\n\\n\\\n    if (e != g && f == h) return vec2(tmin, tmax);\\n\\\n    else if (e == g && f == h) return vec2(-INF_HIT, tmin);\\n\\\n    else if (e != g && f != h) return vec2(tmax, +INF_HIT);\\n\\\n    else return vec2(NO_HIT);\\n\\\n}\\n\\\n\\n\\\nvec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle)\\n\\\n{\\n\\\n    vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle);\\n\\\n    vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi);\\n\\\n    return vec4(planeIntersectMin, planeIntersectMax);\\n\\\n}\\n\\\n\\n\\\nvec2 intersectUnitSphere(Ray ray)\\n\\\n{\\n\\\n    vec3 o = ray.pos;\\n\\\n    vec3 d = ray.dir;\\n\\\n\\n\\\n    float b = dot(d, o);\\n\\\n    float c = dot(o, o) - 1.0;\\n\\\n    float det = b * b - c;\\n\\\n\\n\\\n    if (det < 0.0) {\\n\\\n        return vec2(NO_HIT);\\n\\\n    }\\n\\\n\\n\\\n    det = sqrt(det);\\n\\\n    float t1 = -b - det;\\n\\\n    float t2 = -b + det;\\n\\\n    float tmin = min(t1, t2);\\n\\\n    float tmax = max(t1, t2);\\n\\\n\\n\\\n    return vec2(tmin, tmax);\\n\\\n}\\n\\\n\\n\\\nvec2 intersectUnitSphereUnnormalizedDirection(Ray ray)\\n\\\n{\\n\\\n    vec3 o = ray.pos;\\n\\\n    vec3 d = ray.dir;\\n\\\n\\n\\\n    float a = dot(d, d);\\n\\\n    float b = dot(d, o);\\n\\\n    float c = dot(o, o) - 1.0;\\n\\\n    float det = b * b - a * c;\\n\\\n\\n\\\n    if (det < 0.0) {\\n\\\n        return vec2(NO_HIT);\\n\\\n    }\\n\\\n\\n\\\n    det = sqrt(det);\\n\\\n    float t1 = (-b - det) / a;\\n\\\n    float t2 = (-b + det) / a;\\n\\\n    float tmin = min(t1, t2);\\n\\\n    float tmax = max(t1, t2);\\n\\\n\\n\\\n    return vec2(tmin, tmax);\\n\\\n}\\n\\\n\\n\\\nvec2 intersectDoubleEndedCone(Ray ray, float cosSqrHalfAngle)\\n\\\n{\\n\\\n    vec3 o = ray.pos;\\n\\\n    vec3 d = ray.dir;\\n\\\n    float a = d.z * d.z - dot(d, d) * cosSqrHalfAngle;\\n\\\n    float b = d.z * o.z - dot(o, d) * cosSqrHalfAngle;\\n\\\n    float c = o.z * o.z - dot(o, o) * cosSqrHalfAngle;\\n\\\n    float det = b * b - a * c;\\n\\\n\\n\\\n    if (det < 0.0) {\\n\\\n        return vec2(NO_HIT);\\n\\\n    }\\n\\\n\\n\\\n    det = sqrt(det);\\n\\\n    float t1 = (-b - det) / a;\\n\\\n    float t2 = (-b + det) / a;\\n\\\n    float tmin = min(t1, t2);\\n\\\n    float tmax = max(t1, t2);\\n\\\n    return vec2(tmin, tmax);\\n\\\n}\\n\\\n\\n\\\nvec4 intersectFlippedCone(Ray ray, float cosSqrHalfAngle) {\\n\\\n    vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);\\n\\\n\\n\\\n    if (intersect.x == NO_HIT) {\\n\\\n        return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT);\\n\\\n    }\\n\\\n\\n\\\n    vec3 o = ray.pos;\\n\\\n    vec3 d = ray.dir;\\n\\\n    float tmin = intersect.x;\\n\\\n    float tmax = intersect.y;\\n\\\n    float zmin = o.z + tmin * d.z;\\n\\\n    float zmax = o.z + tmax * d.z;\\n\\\n\\n\\\n    // One interval\\n\\\n    if (zmin < 0.0 && zmax < 0.0) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT);\\n\\\n    else if (zmin < 0.0) return vec4(-INF_HIT, tmax, NO_HIT, NO_HIT);\\n\\\n    else if (zmax < 0.0) return vec4(tmin, +INF_HIT, NO_HIT, NO_HIT);\\n\\\n    // Two intervals\\n\\\n    else return vec4(-INF_HIT, tmin, tmax, +INF_HIT);\\n\\\n}\\n\\\n\\n\\\nvec2 intersectRegularCone(Ray ray, float cosSqrHalfAngle) {\\n\\\n    vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);\\n\\\n\\n\\\n    if (intersect.x == NO_HIT) {\\n\\\n        return vec2(NO_HIT);\\n\\\n    }\\n\\\n\\n\\\n    vec3 o = ray.pos;\\n\\\n    vec3 d = ray.dir;\\n\\\n    float tmin = intersect.x;\\n\\\n    float tmax = intersect.y;\\n\\\n    float zmin = o.z + tmin * d.z;\\n\\\n    float zmax = o.z + tmax * d.z;\\n\\\n\\n\\\n    if (zmin < 0.0 && zmax < 0.0) return vec2(NO_HIT);\\n\\\n    else if (zmin < 0.0) return vec2(tmax, +INF_HIT);\\n\\\n    else if (zmax < 0.0) return vec2(-INF_HIT, tmin);\\n\\\n    else return vec2(tmin, tmax);\\n\\\n}\\n\\\n\\n\\\nvoid intersectShape(in Ray ray, inout Intersections ix) {\\n\\\n    // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].\\n\\\n    // Direction is scaled as well to be in sync with position.\\n\\\n    ray.pos = ray.pos * 2.0 - 1.0;\\n\\\n    ray.dir *= 2.0;\\n\\\n\\n\\\n    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX)\\n\\\n        Ray outerRay = Ray(ray.pos * u_ellipsoidInverseOuterScaleUv, ray.dir * u_ellipsoidInverseOuterScaleUv);\\n\\\n    #else\\n\\\n        Ray outerRay = ray;\\n\\\n    #endif\\n\\\n\\n\\\n    // Outer ellipsoid\\n\\\n    vec2 outerIntersect = intersectUnitSphereUnnormalizedDirection(outerRay);\\n\\\n    setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect);\\n\\\n\\n\\\n    // Exit early if the outer ellipsoid was missed.\\n\\\n    if (outerIntersect.x == NO_HIT) {\\n\\\n        return;\\n\\\n    }\\n\\\n\\n\\\n    // Inner ellipsoid\\n\\\n    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT)\\n\\\n        // When the ellipsoid is perfectly thin it's necessary to sandwich the\\n\\\n        // inner ellipsoid intersection inside the outer ellipsoid intersection.\\n\\\n\\n\\\n        // Without this special case,\\n\\\n        // [outerMin, outerMax, innerMin, innerMax] will bubble sort to\\n\\\n        // [outerMin, innerMin, outerMax, innerMax] which will cause the back\\n\\\n        // side of the ellipsoid to be invisible because it will think the ray\\n\\\n        // is still inside the inner (negative) ellipsoid after exiting the\\n\\\n        // outer (positive) ellipsoid.\\n\\\n\\n\\\n        // With this special case,\\n\\\n        // [outerMin, innerMin, innerMax, outerMax] will bubble sort to\\n\\\n        // [outerMin, innerMin, innerMax, outerMax] which will work correctly.\\n\\\n\\n\\\n        // Note: If initializeIntersections() changes its sorting function\\n\\\n        // from bubble sort to something else, this code may need to change.\\n\\\n        setIntersection(ix, 0, outerIntersect.x, true, true);   // positive, enter\\n\\\n        setIntersection(ix, 1, outerIntersect.x, false, true);  // negative, enter\\n\\\n        setIntersection(ix, 2, outerIntersect.y, false, false); // negative, exit\\n\\\n        setIntersection(ix, 3, outerIntersect.y, true, false);  // positive, exit\\n\\\n    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN)\\n\\\n        Ray innerRay = Ray(ray.pos * u_ellipsoidInverseInnerScaleUv, ray.dir * u_ellipsoidInverseInnerScaleUv);\\n\\\n        vec2 innerIntersect = intersectUnitSphereUnnormalizedDirection(innerRay);\\n\\\n\\n\\\n        if (innerIntersect == vec2(NO_HIT)) {\\n\\\n            setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect);\\n\\\n        } else {\\n\\\n            // When the ellipsoid is very large and thin it's possible for floating\\n\\\n            // point math to cause the ray to intersect the inner ellipsoid before\\n\\\n            // the outer ellipsoid. To prevent this from happening, clamp innerIntersect\\n\\\n            // to outerIntersect and sandwhich the intersections like described above.\\n\\\n            //\\n\\\n            // In theory a similar fix is needed for cylinders, however it's more\\n\\\n            // complicated to implement because the inner shape is allowed to be\\n\\\n            // intersected first.\\n\\\n            innerIntersect.x = max(innerIntersect.x, outerIntersect.x);\\n\\\n            innerIntersect.y = min(innerIntersect.y, outerIntersect.y);\\n\\\n            setIntersection(ix, 0, outerIntersect.x, true, true);   // positive, enter\\n\\\n            setIntersection(ix, 1, innerIntersect.x, false, true);  // negative, enter\\n\\\n            setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit\\n\\\n            setIntersection(ix, 3, outerIntersect.y, true, false);  // positive, exit\\n\\\n        }\\n\\\n    #endif\\n\\\n\\n\\\n    // Flip the ray because the intersection function expects a cone growing towards +Z.\\n\\\n    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)\\n\\\n        Ray flippedRay = outerRay;\\n\\\n        flippedRay.dir.z *= -1.0;\\n\\\n        flippedRay.pos.z *= -1.0;\\n\\\n    #endif\\n\\\n\\n\\\n    // Bottom cone\\n\\\n    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF)\\n\\\n        vec2 bottomConeIntersection = intersectRegularCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x);\\n\\\n        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);\\n\\\n    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF)\\n\\\n        vec2 bottomConeIntersection = intersectZPlane(flippedRay);\\n\\\n        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);\\n\\\n    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF)\\n\\\n        vec4 bottomConeIntersection = intersectFlippedCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x);\\n\\\n        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersection.xy);\\n\\\n        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersection.zw);\\n\\\n    #endif\\n\\\n\\n\\\n    // Top cone\\n\\\n    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)\\n\\\n        vec4 topConeIntersection = intersectFlippedCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y);\\n\\\n        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersection.xy);\\n\\\n        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersection.zw);\\n\\\n    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF)\\n\\\n        vec2 topConeIntersection = intersectZPlane(ray);\\n\\\n        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);\\n\\\n    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF)\\n\\\n        vec2 topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y);\\n\\\n        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);\\n\\\n    #endif\\n\\\n\\n\\\n    // Wedge\\n\\\n    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)\\n\\\n        vec4 wedgeIntersect = intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x);\\n\\\n        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy);\\n\\\n        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw);\\n\\\n    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF)\\n\\\n        vec2 wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y);\\n\\\n        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);\\n\\\n    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF)\\n\\\n        vec2 wedgeIntersect = intersectHalfSpace(ray, u_ellipsoidRenderLongitudeMinMax.x);\\n\\\n        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);\\n\\\n    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF)\\n\\\n        vec4 wedgeIntersect = intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y);\\n\\\n        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy);\\n\\\n        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw);\\n\\\n    #endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"// Main intersection function for Voxel scenes.\\n\\\n// See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl\\n\\\n// for the definition of intersectShape. The appropriate function is selected\\n\\\n// based on the VoxelPrimitive shape type, and added to the shader in\\n\\\n// Scene/VoxelRenderResources.js.\\n\\\n// See also IntersectClippingPlane.glsl and IntersectDepth.glsl.\\n\\\n// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT,\\n\\\n// getFirstIntersection, initializeIntersections, nextIntersection.\\n\\\n\\n\\\n/* Intersection defines (set in Scene/VoxelRenderResources.js)\\n\\\n#define INTERSECTION_COUNT ###\\n\\\n*/\\n\\\n\\n\\\nRayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) {\\n\\\n    // Do a ray-shape intersection to find the exact starting and ending points.\\n\\\n    intersectShape(ray, ix);\\n\\\n\\n\\\n    // Exit early if the positive shape was completely missed or behind the ray.\\n\\\n    RayShapeIntersection intersection = getFirstIntersection(ix);\\n\\\n    if (intersection.entry.w == NO_HIT) {\\n\\\n        // Positive shape was completely missed - so exit early.\\n\\\n        return intersection;\\n\\\n    }\\n\\\n\\n\\\n    // Clipping planes\\n\\\n    #if defined(CLIPPING_PLANES)\\n\\\n        intersectClippingPlanes(ray, ix);\\n\\\n    #endif\\n\\\n\\n\\\n    // Depth\\n\\\n    #if defined(DEPTH_TEST)\\n\\\n        intersectDepth(screenCoord, ray, ix);\\n\\\n    #endif\\n\\\n\\n\\\n    // Find the first intersection that's in front of the ray\\n\\\n    #if (INTERSECTION_COUNT > 1)\\n\\\n        initializeIntersections(ix);\\n\\\n        for (int i = 0; i < INTERSECTION_COUNT; ++i) {\\n\\\n            intersection = nextIntersection(ix);\\n\\\n            if (intersection.exit.w > 0.0) {\\n\\\n                // Set start to 0.0 when ray is inside the shape.\\n\\\n                intersection.entry.w = max(intersection.entry.w, 0.0);\\n\\\n                break;\\n\\\n            }\\n\\\n        }\\n\\\n    #else\\n\\\n        // Set start to 0.0 when ray is inside the shape.\\n\\\n        intersection.entry.w = max(intersection.entry.w, 0.0);\\n\\\n    #endif\\n\\\n\\n\\\n    return intersection;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/* Box defines (set in Scene/VoxelBoxShape.js)\\n\\\n#define BOX_HAS_SHAPE_BOUNDS\\n\\\n*/\\n\\\n\\n\\\n#if defined(BOX_HAS_SHAPE_BOUNDS)\\n\\\n    uniform vec3 u_boxUvToShapeUvScale;\\n\\\n    uniform vec3 u_boxUvToShapeUvTranslate;\\n\\\n#endif\\n\\\n\\n\\\nvec3 convertUvToShapeUvSpace(in vec3 positionUv) {\\n\\\n#if defined(BOX_HAS_SHAPE_BOUNDS)\\n\\\n    return positionUv * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate;\\n\\\n#else\\n\\\n    return positionUv;\\n\\\n#endif\\n\\\n}\\n\\\n\\n\\\nvec3 convertShapeUvToUvSpace(in vec3 shapeUv) {\\n\\\n#if defined(BOX_HAS_SHAPE_BOUNDS)\\n\\\n    return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale;\\n\\\n#else\\n\\\n    return shapeUv;\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/* Cylinder defines (set in Scene/VoxelCylinderShape.js)\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY\\n\\\n#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED\\n\\\n*/\\n\\\n\\n\\\n#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)\\n\\\n    uniform vec2 u_cylinderUvToShapeUvRadius; // x = scale, y = offset\\n\\\n#endif\\n\\\n#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)\\n\\\n    uniform vec2 u_cylinderUvToShapeUvHeight; // x = scale, y = offset\\n\\\n#endif\\n\\\n#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)\\n\\\n    uniform vec2 u_cylinderUvToShapeUvAngle; // x = scale, y = offset\\n\\\n#endif\\n\\\n#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)\\n\\\n    uniform vec2 u_cylinderShapeUvAngleMinMax;\\n\\\n#endif\\n\\\n#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)\\n\\\n    uniform float u_cylinderShapeUvAngleRangeZeroMid;\\n\\\n#endif\\n\\\n\\n\\\nvec3 convertUvToShapeUvSpace(in vec3 positionUv) {\\n\\\n    vec3 positionLocal = positionUv * 2.0 - 1.0; // [-1,+1]\\n\\\n\\n\\\n    // Compute radius\\n\\\n    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT)\\n\\\n        float radius = 1.0;\\n\\\n    #else\\n\\\n        float radius = length(positionLocal.xy); // [0,1]\\n\\\n        #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)\\n\\\n            radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y; // x = scale, y = offset\\n\\\n        #endif\\n\\\n    #endif\\n\\\n\\n\\\n    // Compute height\\n\\\n    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT)\\n\\\n        float height = 1.0;\\n\\\n    #else\\n\\\n        float height = positionUv.z; // [0,1]\\n\\\n        #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)\\n\\\n            height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y; // x = scale, y = offset\\n\\\n        #endif\\n\\\n    #endif\\n\\\n\\n\\\n    // Compute angle\\n\\\n    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO)\\n\\\n        float angle = 1.0;\\n\\\n    #else\\n\\\n        float angle = (atan(positionLocal.y, positionLocal.x) + czm_pi) / czm_twoPi; // [0,1]\\n\\\n        #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)\\n\\\n            #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)\\n\\\n                // Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative.\\n\\\n                angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid);\\n\\\n            #endif\\n\\\n\\n\\\n            // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.\\n\\\n            #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY)\\n\\\n                angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle;\\n\\\n            #elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)\\n\\\n                angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle;\\n\\\n            #endif\\n\\\n\\n\\\n            angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y; // x = scale, y = offset\\n\\\n        #endif\\n\\\n    #endif\\n\\\n\\n\\\n    return vec3(radius, height, angle);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY\\n\\\n#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY\\n\\\n#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE\\n\\\n#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO\\n\\\n#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED\\n\\\n#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE\\n\\\n#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO\\n\\\n#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN\\n\\\n#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT\\n\\\n#define ELLIPSOID_IS_SPHERE\\n\\\n*/\\n\\\n\\n\\\nuniform vec3 u_ellipsoidRadiiUv; // [0,1]\\n\\\n#if !defined(ELLIPSOID_IS_SPHERE)\\n\\\n    uniform vec3 u_ellipsoidInverseRadiiSquaredUv;\\n\\\n#endif\\n\\\n#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)\\n\\\n    uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid;\\n\\\n#endif\\n\\\n#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)\\n\\\n    uniform vec2 u_ellipsoidUvToShapeUvLongitude; // x = scale, y = offset\\n\\\n#endif\\n\\\n#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)\\n\\\n    uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset\\n\\\n#endif\\n\\\n#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) && !defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT)\\n\\\n    uniform float u_ellipsoidInverseHeightDifferenceUv;\\n\\\n    uniform vec2 u_ellipseInnerRadiiUv; // [0,1]\\n\\\n#endif\\n\\\n\\n\\\n// robust iterative solution without trig functions\\n\\\n// https://github.com/0xfaded/ellipse_demo/issues/1\\n\\\n// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse\\n\\\n// Pro: Good when radii.x ~= radii.y\\n\\\n// Con: Breaks at pos.x ~= 0.0, especially inside the ellipse\\n\\\n// Con: Inaccurate with exterior points and thin ellipses\\n\\\nfloat ellipseDistanceIterative (vec2 pos, vec2 radii) {\\n\\\n    vec2 p = abs(pos);\\n\\\n    vec2 invRadii = 1.0 / radii;\\n\\\n    vec2 a = vec2(1.0, -1.0) * (radii.x * radii.x - radii.y * radii.y) * invRadii;\\n\\\n    vec2 t = vec2(0.70710678118); // sqrt(2) / 2\\n\\\n    vec2 v = radii * t;\\n\\\n\\n\\\n    const int iterations = 3;\\n\\\n    for (int i = 0; i < iterations; ++i) {\\n\\\n        vec2 e = a * pow(t, vec2(3.0));\\n\\\n        vec2 q = normalize(p - e) * length(v - e);\\n\\\n        t = normalize((q + e) * invRadii);\\n\\\n        v = radii * t;\\n\\\n    }\\n\\\n    return length(v * sign(pos) - pos) * sign(p.y - v.y);\\n\\\n}\\n\\\n\\n\\\nvec3 convertUvToShapeUvSpace(in vec3 positionUv) {\\n\\\n    // Compute position and normal.\\n\\\n    // Convert positionUv [0,1] to local space [-1,+1] to \\\"normalized\\\" cartesian space [-a,+a] where a = (radii + height) / (max(radii) + height).\\n\\\n    // A point on the largest ellipsoid axis would be [-1,+1] and everything else would be smaller.\\n\\\n    vec3 positionLocal = positionUv * 2.0 - 1.0;\\n\\\n    #if defined(ELLIPSOID_IS_SPHERE)\\n\\\n        vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv.x;\\n\\\n        vec3 normal = normalize(posEllipsoid);\\n\\\n    #else\\n\\\n        vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv;\\n\\\n        vec3 normal = normalize(posEllipsoid * u_ellipsoidInverseRadiiSquaredUv); // geodetic surface normal\\n\\\n    #endif\\n\\\n\\n\\\n    // Compute longitude\\n\\\n    #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)\\n\\\n        float longitude = 1.0;\\n\\\n    #else\\n\\\n        float longitude = (atan(normal.y, normal.x) + czm_pi) / czm_twoPi;\\n\\\n\\n\\\n        // Correct the angle when max < min\\n\\\n        // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space.\\n\\\n        #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)\\n\\\n            longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z);\\n\\\n        #endif\\n\\\n\\n\\\n        // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.\\n\\\n        #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY)\\n\\\n            longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude;\\n\\\n        #endif\\n\\\n        #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY)\\n\\\n            longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude;\\n\\\n        #endif\\n\\\n\\n\\\n        #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)\\n\\\n            longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y;\\n\\\n        #endif\\n\\\n    #endif\\n\\\n\\n\\\n    // Compute latitude\\n\\\n    #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO)\\n\\\n        float latitude = 1.0;\\n\\\n    #else\\n\\\n        float latitude = (asin(normal.z) + czm_piOverTwo) / czm_pi;\\n\\\n        #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)\\n\\\n            latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y;\\n\\\n        #endif\\n\\\n    #endif\\n\\\n\\n\\\n    // Compute height\\n\\\n    #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT)\\n\\\n        // TODO: This breaks down when minBounds == maxBounds. To fix it, this\\n\\\n        // function would have to know if ray is intersecting the front or back of the shape\\n\\\n        // and set the shape space position to 1 (front) or 0 (back) accordingly.\\n\\\n        float height = 1.0;\\n\\\n    #else\\n\\\n        #if defined(ELLIPSOID_IS_SPHERE)\\n\\\n            #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN)\\n\\\n                float height = (length(posEllipsoid) - u_ellipseInnerRadiiUv.x) * u_ellipsoidInverseHeightDifferenceUv;\\n\\\n            #else\\n\\\n                float height = length(posEllipsoid);\\n\\\n            #endif\\n\\\n        #else\\n\\\n            #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN)\\n\\\n                // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z) (assuming radii.x == radii.y which is true for WGS84).\\n\\\n                // This is an optimization so that math can be done with ellipses instead of ellipsoids.\\n\\\n                vec2 posEllipse = vec2(length(posEllipsoid.xy), posEllipsoid.z);\\n\\\n                float height = ellipseDistanceIterative(posEllipse, u_ellipseInnerRadiiUv) * u_ellipsoidInverseHeightDifferenceUv;\\n\\\n            #else\\n\\\n                // TODO: this is probably not correct\\n\\\n                float height = length(posEllipsoid);\\n\\\n            #endif\\n\\\n        #endif\\n\\\n    #endif\\n\\\n\\n\\\n    return vec3(longitude, latitude, height);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js\\n\\\n#define OCTREE_FLAG_INTERNAL 0\\n\\\n#define OCTREE_FLAG_LEAF 1\\n\\\n#define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2\\n\\\n\\n\\\n#define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops\\n\\\n\\n\\\nuniform sampler2D u_octreeInternalNodeTexture;\\n\\\nuniform vec2 u_octreeInternalNodeTexelSizeUv;\\n\\\nuniform int u_octreeInternalNodeTilesPerRow;\\n\\\n#if (SAMPLE_COUNT > 1)\\n\\\nuniform sampler2D u_octreeLeafNodeTexture;\\n\\\nuniform vec2 u_octreeLeafNodeTexelSizeUv;\\n\\\nuniform int u_octreeLeafNodeTilesPerRow;\\n\\\n#endif\\n\\\n\\n\\\nstruct OctreeNodeData {\\n\\\n    int data;\\n\\\n    int flag;\\n\\\n};\\n\\\n\\n\\\nstruct TraversalData {\\n\\\n    ivec4 octreeCoords;\\n\\\n    int parentOctreeIndex;\\n\\\n};\\n\\\n\\n\\\nstruct SampleData {\\n\\\n    int megatextureIndex;\\n\\\n    ivec4 tileCoords;\\n\\\n    vec3 tileUv;\\n\\\n    #if (SAMPLE_COUNT > 1)\\n\\\n        float weight;\\n\\\n    #endif\\n\\\n};\\n\\\n\\n\\\n// Integer mod: For WebGL1 only\\n\\\nint intMod(in int a, in int b) {\\n\\\n    return a - (b * (a / b));\\n\\\n}\\n\\\nint normU8_toInt(in float value) {\\n\\\n    return int(value * 255.0);\\n\\\n}\\n\\\nint normU8x2_toInt(in vec2 value) {\\n\\\n    return int(value.x * 255.0) + 256 * int(value.y * 255.0);\\n\\\n}\\n\\\nfloat normU8x2_toFloat(in vec2 value) {\\n\\\n    return float(normU8x2_toInt(value)) / 65535.0;\\n\\\n}\\n\\\n\\n\\\nOctreeNodeData getOctreeNodeData(in vec2 octreeUv) {\\n\\\n    vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv);\\n\\\n\\n\\\n    OctreeNodeData data;\\n\\\n    data.data = normU8x2_toInt(texData.xy);\\n\\\n    data.flag = normU8x2_toInt(texData.zw);\\n\\\n    return data;\\n\\\n}\\n\\\n\\n\\\nOctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) {\\n\\\n    int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x;\\n\\\n    int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex;\\n\\\n    int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow;\\n\\\n    vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);\\n\\\n    return getOctreeNodeData(octreeUv);\\n\\\n}\\n\\\n\\n\\\nint getOctreeParentIndex(in int octreeIndex) {\\n\\\n    int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9;\\n\\\n    int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow;\\n\\\n    vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);\\n\\\n    vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv);\\n\\\n    int parentOctreeIndex = normU8x2_toInt(parentData.xy);\\n\\\n    return parentOctreeIndex;\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n* Convert a position in the uv-space of the tileset bounding shape\\n\\\n* into the uv-space of a tile within the tileset\\n\\\n*/\\n\\\nvec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) {\\n\\\n\t// PERFORMANCE_IDEA: use bit-shifting (only in WebGL2)\\n\\\n    float dimAtLevel = pow(2.0, float(octreeCoords.w));\\n\\\n    return shapePosition * dimAtLevel - vec3(octreeCoords.xyz);\\n\\\n}\\n\\\n\\n\\\nvoid getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) {\\n\\\n    sampleData.megatextureIndex = data.data;\\n\\\n    sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT)\\n\\\n        ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)\\n\\\n        : octreeCoords;\\n\\\n}\\n\\\n\\n\\\n#if (SAMPLE_COUNT > 1)\\n\\\nvoid getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) {\\n\\\n    int leafIndex = data.data;\\n\\\n    int leafNodeTexelCount = 2;\\n\\\n    // Adding 0.5 moves to the center of the texel\\n\\\n    float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5;\\n\\\n    float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5;\\n\\\n\\n\\\n    // Get an interpolation weight and a flag to determine whether to read the parent texture\\n\\\n    vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY);\\n\\\n    vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0);\\n\\\n    float lerp = normU8x2_toFloat(leafData0.xy);\\n\\\n    sampleDatas[0].weight = 1.0 - lerp;\\n\\\n    sampleDatas[1].weight = lerp;\\n\\\n    // TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT\\n\\\n    sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1)\\n\\\n        ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)\\n\\\n        : octreeCoords;\\n\\\n    sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1)\\n\\\n        ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)\\n\\\n        : octreeCoords;\\n\\\n\\n\\\n    // Get megatexture indices for both samples\\n\\\n    vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY);\\n\\\n    vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1);\\n\\\n    sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy);\\n\\\n    sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw);\\n\\\n}\\n\\\n#endif\\n\\\n\\n\\\nOctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) {\\n\\\n    float sizeAtLevel = 1.0 / pow(2.0, float(traversalData.octreeCoords.w));\\n\\\n    vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel;\\n\\\n    vec3 end = start + vec3(sizeAtLevel);\\n\\\n    OctreeNodeData childData;\\n\\\n\\n\\\n    for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {\\n\\\n        // Find out which octree child contains the position\\n\\\n        // 0 if before center, 1 if after\\n\\\n        vec3 center = 0.5 * (start + end);\\n\\\n        vec3 childCoord = step(center, shapePosition);\\n\\\n\\n\\\n        // Get octree coords for the next level down\\n\\\n        ivec4 octreeCoords = traversalData.octreeCoords;\\n\\\n        traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1);\\n\\\n\\n\\\n        childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord));\\n\\\n\\n\\\n        if (childData.flag != OCTREE_FLAG_INTERNAL) {\\n\\\n            // leaf tile - stop traversing\\n\\\n            break;\\n\\\n        }\\n\\\n\\n\\\n        // interior tile - keep going deeper\\n\\\n        start = mix(start, center, childCoord);\\n\\\n        end = mix(center, end, childCoord);\\n\\\n        traversalData.parentOctreeIndex = childData.data;\\n\\\n    }\\n\\\n\\n\\\n    return childData;\\n\\\n}\\n\\\n\\n\\\n/**\\n\\\n* Transform a given position to an octree tile coordinate and a position within that tile,\\n\\\n* and find the corresponding megatexture index and texture coordinates\\n\\\n*/\\n\\\nvoid traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) {\\n\\\n    traversalData.octreeCoords = ivec4(0);\\n\\\n    traversalData.parentOctreeIndex = 0;\\n\\\n\\n\\\n    OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0));\\n\\\n    if (nodeData.flag != OCTREE_FLAG_LEAF) {\\n\\\n        nodeData = traverseOctreeDownwards(shapePosition, traversalData);\\n\\\n    }\\n\\\n\\n\\\n    #if (SAMPLE_COUNT == 1)\\n\\\n        getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);\\n\\\n        sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords);\\n\\\n    #else\\n\\\n        getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);\\n\\\n        sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords);\\n\\\n        sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords);\\n\\\n    #endif\\n\\\n}\\n\\\n\\n\\\nbool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) {\\n\\\n    return clamp(v, minVal, maxVal) == v;\\n\\\n}\\n\\\n\\n\\\nbool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) {\\n\\\n    vec3 tileUv = getTileUv(shapePosition, octreeCoords);\\n\\\n\tbool inside = inRange(tileUv, vec3(0.0), vec3(1.0));\\n\\\n\t// Assume (!) the position is always inside the root tile.\\n\\\n\treturn inside || octreeCoords.w == 0;\\n\\\n}\\n\\\n\\n\\\nvoid traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) {\\n\\\n    if (insideTile(shapePosition, traversalData.octreeCoords)) {\\n\\\n        for (int i = 0; i < SAMPLE_COUNT; i++) {\\n\\\n            sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords);\\n\\\n        }\\n\\\n        return;\\n\\\n    }\\n\\\n\\n\\\n    // Go up tree until we find a parent tile containing shapePosition\\n\\\n    for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {\\n\\\n        traversalData.octreeCoords.xyz /= 2;\\n\\\n        traversalData.octreeCoords.w -= 1;\\n\\\n\\n\\\n        if (insideTile(shapePosition, traversalData.octreeCoords)) {\\n\\\n            break;\\n\\\n        }\\n\\\n\\n\\\n        traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex);\\n\\\n    }\\n\\\n\\n\\\n    // Go down tree\\n\\\n    OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData);\\n\\\n\\n\\\n    #if (SAMPLE_COUNT == 1)\\n\\\n        getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);\\n\\\n        sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords);\\n\\\n    #else\\n\\\n        getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);\\n\\\n        sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords);\\n\\\n        sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords);\\n\\\n    #endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"// See Octree.glsl for the definitions of SampleData and intMod\\n\\\n\\n\\\n/* Megatexture defines (set in Scene/VoxelRenderResources.js)\\n\\\n#define SAMPLE_COUNT ###\\n\\\n#define NEAREST_SAMPLING\\n\\\n#define PADDING\\n\\\n*/\\n\\\n\\n\\\nuniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions\\n\\\nuniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions\\n\\\nuniform vec2 u_megatextureVoxelSizeUv;\\n\\\nuniform vec2 u_megatextureSliceSizeUv;\\n\\\nuniform vec2 u_megatextureTileSizeUv;\\n\\\n\\n\\\nuniform ivec3 u_dimensions; // does not include padding\\n\\\n#if defined(PADDING)\\n\\\n    uniform ivec3 u_paddingBefore;\\n\\\n    uniform ivec3 u_paddingAfter;\\n\\\n#endif\\n\\\n\\n\\\n// Integer min, max, clamp: For WebGL1 only\\n\\\nint intMin(int a, int b) {\\n\\\n    return a <= b ? a : b;\\n\\\n}\\n\\\nint intMax(int a, int b) {\\n\\\n    return a >= b ? a : b;\\n\\\n}\\n\\\nint intClamp(int v, int minVal, int maxVal) {\\n\\\n    return intMin(intMax(v, minVal), maxVal);\\n\\\n}\\n\\\n\\n\\\nvec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale)\\n\\\n{\\n\\\n    int indexX = intMod(index, dimensions.x);\\n\\\n    int indexY = index / dimensions.x;\\n\\\n    return vec2(indexX, indexY) * uvScale;\\n\\\n}\\n\\\n\\n\\\n/*\\n\\\n    How is 3D data stored in a 2D megatexture?\\n\\\n\\n\\\n    In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total).\\n\\\n    The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and\\n\\\n    the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1).\\n\\\n    Note that there could be empty space in the megatexture because it's a power of two.\\n\\\n\\n\\\n      0   1   2   3\\n\\\n    +---+---+---+---+\\n\\\n    |   |   |   |   | 3\\n\\\n    +---+---+---+---+\\n\\\n    |   |   |   |   | 2\\n\\\n    +-------+-------+\\n\\\n    |010|110|011|111| 1\\n\\\n    |--- ---|--- ---|\\n\\\n    |000|100|001|101| 0\\n\\\n    +-------+-------+\\n\\\n\\n\\\n    When doing linear interpolation the megatexture needs to be sampled twice: once for\\n\\\n    the Z slice above the voxel coordinate and once for the slice below. The two slices\\n\\\n    are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is\\n\\\n    halfway between two Z slices so the interpolation factor is 0.5. Below is a side view\\n\\\n    of the 3D voxel grid with voxel coordinates on the left side.\\n\\\n\\n\\\n    2 +---+\\n\\\n      |001|\\n\\\n    1 +-z-+\\n\\\n      |000|\\n\\\n    0 +---+\\n\\\n\\n\\\n    When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice.\\n\\\n*/\\n\\\n\\n\\\nProperties getPropertiesFromMegatexture(in SampleData sampleData) {\\n\\\n    vec3 tileUv = clamp(sampleData.tileUv, vec3(0.0), vec3(1.0)); // TODO is the clamp necessary?\\n\\\n    int tileIndex = sampleData.megatextureIndex;\\n\\\n    vec3 voxelCoord = tileUv * vec3(u_dimensions);\\n\\\n    ivec3 voxelDimensions = u_dimensions;\\n\\\n\\n\\\n    #if defined(PADDING)\\n\\\n        voxelDimensions += u_paddingBefore + u_paddingAfter;\\n\\\n        voxelCoord += vec3(u_paddingBefore);\\n\\\n    #endif\\n\\\n\\n\\\n    #if defined(NEAREST_SAMPLING)\\n\\\n        // Round to the center of the nearest voxel\\n\\\n        voxelCoord = floor(voxelCoord) + vec3(0.5);\\n\\\n    #endif\\n\\\n\\n\\\n    // Tile location\\n\\\n    vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv);\\n\\\n\\n\\\n    // Slice location\\n\\\n    float slice = voxelCoord.z - 0.5;\\n\\\n    int sliceIndex = int(floor(slice));\\n\\\n    int sliceIndex0 = intClamp(sliceIndex, 0, voxelDimensions.z - 1);\\n\\\n    vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);\\n\\\n\\n\\\n    // Voxel location\\n\\\n    vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(voxelDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv;\\n\\\n\\n\\\n    // Final location in the megatexture\\n\\\n    vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset;\\n\\\n\\n\\\n    #if defined(NEAREST_SAMPLING)\\n\\\n        return getPropertiesFromMegatextureAtUv(uv0);\\n\\\n    #else\\n\\\n        float sliceLerp = fract(slice);\\n\\\n        int sliceIndex1 = intMin(sliceIndex + 1, voxelDimensions.z - 1);\\n\\\n        vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);\\n\\\n        vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset;\\n\\\n        Properties properties0 = getPropertiesFromMegatextureAtUv(uv0);\\n\\\n        Properties properties1 = getPropertiesFromMegatextureAtUv(uv1);\\n\\\n        return mixProperties(properties0, properties1, sliceLerp);\\n\\\n    #endif\\n\\\n}\\n\\\n\\n\\\n// Convert an array of sample datas to a final weighted properties.\\n\\\nProperties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) {\\n\\\n    #if (SAMPLE_COUNT == 1)\\n\\\n        return getPropertiesFromMegatexture(sampleDatas[0]);\\n\\\n    #else\\n\\\n        // When more than one sample is taken the accumulator needs to start at 0\\n\\\n        Properties properties = clearProperties();\\n\\\n        for (int i = 0; i < SAMPLE_COUNT; ++i) {\\n\\\n            float weight = sampleDatas[i].weight;\\n\\\n\\n\\\n            // Avoid reading the megatexture when the weight is 0 as it can be costly.\\n\\\n            if (weight > 0.0) {\\n\\\n                Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]);\\n\\\n                tempProperties = scaleProperties(tempProperties, weight);\\n\\\n                properties = sumProperties(properties, tempProperties);\\n\\\n            }\\n\\\n        }\\n\\\n        return properties;\\n\\\n    #endif\\n\\\n}\\n\\\n\";\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport combine from \"../Core/combine.js\";\nimport defined from \"../Core/defined.js\";\nimport ShaderBuilder from \"../Renderer/ShaderBuilder.js\";\nimport ShaderDestination from \"../Renderer/ShaderDestination.js\";\nimport VoxelFS from \"../Shaders/Voxels/VoxelFS.js\";\nimport VoxelVS from \"../Shaders/Voxels/VoxelVS.js\";\nimport IntersectionUtils from \"../Shaders/Voxels/IntersectionUtils.js\";\nimport IntersectDepth from \"../Shaders/Voxels/IntersectDepth.js\";\nimport IntersectClippingPlanes from \"../Shaders/Voxels/IntersectClippingPlanes.js\";\nimport IntersectBox from \"../Shaders/Voxels/IntersectBox.js\";\nimport IntersectCylinder from \"../Shaders/Voxels/IntersectCylinder.js\";\nimport IntersectEllipsoid from \"../Shaders/Voxels/IntersectEllipsoid.js\";\nimport Intersection from \"../Shaders/Voxels/Intersection.js\";\nimport convertUvToBox from \"../Shaders/Voxels/convertUvToBox.js\";\nimport convertUvToCylinder from \"../Shaders/Voxels/convertUvToCylinder.js\";\nimport convertUvToEllipsoid from \"../Shaders/Voxels/convertUvToEllipsoid.js\";\nimport Octree from \"../Shaders/Voxels/Octree.js\";\nimport Megatexture from \"../Shaders/Voxels/Megatexture.js\";\n\n/**\n * Set up render resources, including basic shader code, for rendering\n * a Voxel primitive.\n * The shader code generated by this function may be modified in later stages.\n * @constructor\n * @param {VoxelPrimitive} primitive\n *\n * @private\n */\nfunction VoxelRenderResources(primitive) {\n  const shaderBuilder = new ShaderBuilder();\n  /**\n   * An object used to build a shader incrementally. Each pipeline stage\n   * may add lines of shader code to this object.\n   *\n   * @type {ShaderBuilder}\n   * @readonly\n   *\n   * @private\n   */\n  this.shaderBuilder = shaderBuilder;\n\n  // Custom shader uniforms\n  const customShader = primitive._customShader;\n  const uniformMap = combine(primitive._uniformMap, customShader.uniformMap);\n  primitive._uniformMap = uniformMap;\n\n  const customShaderUniforms = customShader.uniforms;\n  for (const uniformName in customShaderUniforms) {\n    if (customShaderUniforms.hasOwnProperty(uniformName)) {\n      const uniform = customShaderUniforms[uniformName];\n      shaderBuilder.addUniform(\n        uniform.type,\n        uniformName,\n        ShaderDestination.FRAGMENT\n      );\n    }\n  }\n  // The reason this uniform is added by shader builder is because some of the\n  // dynamically generated shader code reads from it.\n  shaderBuilder.addUniform(\n    \"sampler2D\",\n    \"u_megatextureTextures[METADATA_COUNT]\",\n    ShaderDestination.FRAGMENT\n  );\n\n  /**\n   * A dictionary mapping uniform name to functions that return the uniform\n   * values.\n   *\n   * @type {Object<string, Function>}\n   */\n  this.uniformMap = uniformMap;\n\n  const clippingPlanes = primitive._clippingPlanes;\n  const clippingPlanesLength =\n    defined(clippingPlanes) && clippingPlanes.enabled\n      ? clippingPlanes.length\n      : 0;\n\n  this.clippingPlanes = clippingPlanes;\n  this.clippingPlanesLength = clippingPlanesLength;\n\n  // Build shader\n  shaderBuilder.addVertexLines([VoxelVS]);\n\n  shaderBuilder.addFragmentLines([\n    customShader.fragmentShaderText,\n    \"#line 0\",\n    Octree,\n    IntersectionUtils,\n    Megatexture,\n  ]);\n\n  if (clippingPlanesLength > 0) {\n    shaderBuilder.addDefine(\n      \"CLIPPING_PLANES\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n    shaderBuilder.addDefine(\n      \"CLIPPING_PLANES_COUNT\",\n      clippingPlanesLength,\n      ShaderDestination.FRAGMENT\n    );\n    if (clippingPlanes.unionClippingRegions) {\n      shaderBuilder.addDefine(\n        \"CLIPPING_PLANES_UNION\",\n        undefined,\n        ShaderDestination.FRAGMENT\n      );\n    }\n    shaderBuilder.addFragmentLines([IntersectClippingPlanes]);\n  }\n  if (primitive._depthTest) {\n    shaderBuilder.addDefine(\n      \"DEPTH_TEST\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n    shaderBuilder.addFragmentLines([IntersectDepth]);\n  }\n\n  const shapeType = primitive._provider.shape;\n  if (shapeType === \"BOX\") {\n    shaderBuilder.addDefine(\"SHAPE_BOX\", undefined, ShaderDestination.FRAGMENT);\n    shaderBuilder.addFragmentLines([\n      convertUvToBox,\n      IntersectBox,\n      Intersection,\n    ]);\n  } else if (shapeType === \"CYLINDER\") {\n    shaderBuilder.addFragmentLines([\n      IntersectCylinder,\n      Intersection,\n      convertUvToCylinder,\n    ]);\n  } else if (shapeType === \"ELLIPSOID\") {\n    shaderBuilder.addFragmentLines([\n      IntersectEllipsoid,\n      Intersection,\n      convertUvToEllipsoid,\n    ]);\n  }\n\n  shaderBuilder.addFragmentLines([VoxelFS]);\n\n  const shape = primitive._shape;\n  const shapeDefines = shape.shaderDefines;\n  for (const key in shapeDefines) {\n    if (shapeDefines.hasOwnProperty(key)) {\n      let value = shapeDefines[key];\n      // if value is undefined, don't define it\n      // if value is true, define it to nothing\n      if (defined(value)) {\n        value = value === true ? undefined : value;\n        shaderBuilder.addDefine(key, value, ShaderDestination.FRAGMENT);\n      }\n    }\n  }\n\n  // Count how many intersections the shader will do.\n  let intersectionCount = shape.shaderMaximumIntersectionsLength;\n  if (clippingPlanesLength > 0) {\n    shaderBuilder.addDefine(\n      \"CLIPPING_PLANES_INTERSECTION_INDEX\",\n      intersectionCount,\n      ShaderDestination.FRAGMENT\n    );\n    if (clippingPlanesLength === 1) {\n      intersectionCount += 1;\n    } else if (clippingPlanes.unionClippingRegions) {\n      intersectionCount += 2;\n    } else {\n      intersectionCount += 1;\n    }\n  }\n  if (primitive._depthTest) {\n    shaderBuilder.addDefine(\n      \"DEPTH_INTERSECTION_INDEX\",\n      intersectionCount,\n      ShaderDestination.FRAGMENT\n    );\n    intersectionCount += 1;\n  }\n  shaderBuilder.addDefine(\n    \"INTERSECTION_COUNT\",\n    intersectionCount,\n    ShaderDestination.FRAGMENT\n  );\n\n  // Additional fragment shader defines\n  if (\n    !Cartesian3.equals(primitive.paddingBefore, Cartesian3.ZERO) ||\n    !Cartesian3.equals(primitive.paddingAfter, Cartesian3.ZERO)\n  ) {\n    shaderBuilder.addDefine(\"PADDING\", undefined, ShaderDestination.FRAGMENT);\n  }\n  // Allow reading from log depth texture, but don't write log depth anywhere.\n  // Note: This needs to be set even if depthTest is off because it affects the\n  // derived command system.\n  if (primitive._useLogDepth) {\n    shaderBuilder.addDefine(\n      \"LOG_DEPTH_READ_ONLY\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n  }\n  if (primitive._jitter) {\n    shaderBuilder.addDefine(\"JITTER\", undefined, ShaderDestination.FRAGMENT);\n  }\n  if (primitive._nearestSampling) {\n    shaderBuilder.addDefine(\n      \"NEAREST_SAMPLING\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n  }\n  const traversal = primitive._traversal;\n  shaderBuilder.addDefine(\n    \"SAMPLE_COUNT\",\n    `${traversal._sampleCount}`,\n    ShaderDestination.FRAGMENT\n  );\n}\n\nexport default VoxelRenderResources;\n", "import defined from \"../Core/defined.js\";\nimport MetadataType from \"./MetadataType.js\";\nimport ShaderDestination from \"../Renderer/ShaderDestination.js\";\n\n/**\n * Update the shader with defines, structs, and functions to handle\n * voxel properties and statistics\n * @function\n *\n * @param {VoxelRenderResources} renderResources\n * @param {VoxelPrimitive} primitive\n *\n * @private\n */\nfunction processVoxelProperties(renderResources, primitive) {\n  const { shaderBuilder } = renderResources;\n\n  const {\n    names,\n    types,\n    componentTypes,\n    minimumValues,\n    maximumValues,\n  } = primitive._provider;\n\n  const attributeLength = types.length;\n  const hasStatistics = defined(minimumValues) && defined(maximumValues);\n\n  shaderBuilder.addDefine(\n    \"METADATA_COUNT\",\n    attributeLength,\n    ShaderDestination.FRAGMENT\n  );\n\n  if (hasStatistics) {\n    shaderBuilder.addDefine(\n      \"STATISTICS\",\n      undefined,\n      ShaderDestination.FRAGMENT\n    );\n  }\n\n  // PropertyStatistics structs\n  for (let i = 0; i < attributeLength; i++) {\n    const name = names[i];\n    const type = types[i];\n    const propertyStatisticsStructId = `PropertyStatistics_${name}`;\n    const propertyStatisticsStructName = `PropertyStatistics_${name}`;\n    shaderBuilder.addStruct(\n      propertyStatisticsStructId,\n      propertyStatisticsStructName,\n      ShaderDestination.FRAGMENT\n    );\n    const glslType = getGlslType(type);\n    shaderBuilder.addStructField(propertyStatisticsStructId, glslType, \"min\");\n    shaderBuilder.addStructField(propertyStatisticsStructId, glslType, \"max\");\n  }\n\n  // Statistics struct\n  const statisticsStructId = \"Statistics\";\n  const statisticsStructName = \"Statistics\";\n  const statisticsFieldName = \"statistics\";\n  shaderBuilder.addStruct(\n    statisticsStructId,\n    statisticsStructName,\n    ShaderDestination.FRAGMENT\n  );\n  for (let i = 0; i < attributeLength; i++) {\n    const name = names[i];\n    const propertyStructName = `PropertyStatistics_${name}`;\n    const propertyFieldName = name;\n    shaderBuilder.addStructField(\n      statisticsStructId,\n      propertyStructName,\n      propertyFieldName\n    );\n  }\n\n  // Metadata struct\n  const metadataStructId = \"Metadata\";\n  const metadataStructName = \"Metadata\";\n  const metadataFieldName = \"metadata\";\n  shaderBuilder.addStruct(\n    metadataStructId,\n    metadataStructName,\n    ShaderDestination.FRAGMENT\n  );\n  shaderBuilder.addStructField(\n    metadataStructId,\n    statisticsStructName,\n    statisticsFieldName\n  );\n  for (let i = 0; i < attributeLength; i++) {\n    const name = names[i];\n    const type = types[i];\n    const glslType = getGlslType(type);\n    shaderBuilder.addStructField(metadataStructId, glslType, name);\n  }\n\n  // VoxelProperty structs\n  for (let i = 0; i < attributeLength; i++) {\n    const name = names[i];\n    const type = types[i];\n    const glslType = getGlslPartialDerivativeType(type);\n    const voxelPropertyStructId = `VoxelProperty_${name}`;\n    const voxelPropertyStructName = `VoxelProperty_${name}`;\n    shaderBuilder.addStruct(\n      voxelPropertyStructId,\n      voxelPropertyStructName,\n      ShaderDestination.FRAGMENT\n    );\n    shaderBuilder.addStructField(\n      voxelPropertyStructId,\n      glslType,\n      \"partialDerivativeLocal\"\n    );\n    shaderBuilder.addStructField(\n      voxelPropertyStructId,\n      glslType,\n      \"partialDerivativeWorld\"\n    );\n    shaderBuilder.addStructField(\n      voxelPropertyStructId,\n      glslType,\n      \"partialDerivativeView\"\n    );\n    shaderBuilder.addStructField(\n      voxelPropertyStructId,\n      glslType,\n      \"partialDerivativeValid\"\n    );\n  }\n\n  // Voxel struct\n  const voxelStructId = \"Voxel\";\n  const voxelStructName = \"Voxel\";\n  const voxelFieldName = \"voxel\";\n  shaderBuilder.addStruct(\n    voxelStructId,\n    voxelStructName,\n    ShaderDestination.FRAGMENT\n  );\n  for (let i = 0; i < attributeLength; i++) {\n    const name = names[i];\n    const voxelPropertyStructName = `VoxelProperty_${name}`;\n    shaderBuilder.addStructField(voxelStructId, voxelPropertyStructName, name);\n  }\n  shaderBuilder.addStructField(voxelStructId, \"vec3\", \"positionEC\");\n  shaderBuilder.addStructField(voxelStructId, \"vec3\", \"positionUv\");\n  shaderBuilder.addStructField(voxelStructId, \"vec3\", \"positionShapeUv\");\n  shaderBuilder.addStructField(voxelStructId, \"vec3\", \"positionUvLocal\");\n  shaderBuilder.addStructField(voxelStructId, \"vec3\", \"viewDirUv\");\n  shaderBuilder.addStructField(voxelStructId, \"vec3\", \"viewDirWorld\");\n  shaderBuilder.addStructField(voxelStructId, \"vec3\", \"surfaceNormal\");\n  shaderBuilder.addStructField(voxelStructId, \"float\", \"travelDistance\");\n\n  // FragmentInput struct\n  const fragmentInputStructId = \"FragmentInput\";\n  const fragmentInputStructName = \"FragmentInput\";\n  shaderBuilder.addStruct(\n    fragmentInputStructId,\n    fragmentInputStructName,\n    ShaderDestination.FRAGMENT\n  );\n  shaderBuilder.addStructField(\n    fragmentInputStructId,\n    metadataStructName,\n    metadataFieldName\n  );\n  shaderBuilder.addStructField(\n    fragmentInputStructId,\n    voxelStructName,\n    voxelFieldName\n  );\n\n  // Properties struct\n  const propertiesStructId = \"Properties\";\n  const propertiesStructName = \"Properties\";\n  const propertiesFieldName = \"properties\";\n  shaderBuilder.addStruct(\n    propertiesStructId,\n    propertiesStructName,\n    ShaderDestination.FRAGMENT\n  );\n  for (let i = 0; i < attributeLength; i++) {\n    const name = names[i];\n    const type = types[i];\n    const glslType = getGlslType(type);\n    shaderBuilder.addStructField(propertiesStructId, glslType, name);\n  }\n\n  // Fragment shader functions\n\n  // clearProperties function\n  {\n    const functionId = \"clearProperties\";\n    shaderBuilder.addFunction(\n      functionId,\n      `${propertiesStructName} clearProperties()`,\n      ShaderDestination.FRAGMENT\n    );\n    shaderBuilder.addFunctionLines(functionId, [\n      `${propertiesStructName} ${propertiesFieldName};`,\n    ]);\n    for (let i = 0; i < attributeLength; i++) {\n      const name = names[i];\n      const type = types[i];\n      const componentType = componentTypes[i];\n      const glslType = getGlslType(type, componentType);\n      shaderBuilder.addFunctionLines(functionId, [\n        `${propertiesFieldName}.${name} = ${glslType}(0.0);`,\n      ]);\n    }\n    shaderBuilder.addFunctionLines(functionId, [\n      `return ${propertiesFieldName};`,\n    ]);\n  }\n\n  // sumProperties function\n  {\n    const functionId = \"sumProperties\";\n    shaderBuilder.addFunction(\n      functionId,\n      `${propertiesStructName} sumProperties(${propertiesStructName} propertiesA, ${propertiesStructName} propertiesB)`,\n      ShaderDestination.FRAGMENT\n    );\n    shaderBuilder.addFunctionLines(functionId, [\n      `${propertiesStructName} ${propertiesFieldName};`,\n    ]);\n    for (let i = 0; i < attributeLength; i++) {\n      const name = names[i];\n      shaderBuilder.addFunctionLines(functionId, [\n        `${propertiesFieldName}.${name} = propertiesA.${name} + propertiesB.${name};`,\n      ]);\n    }\n    shaderBuilder.addFunctionLines(functionId, [\n      `return ${propertiesFieldName};`,\n    ]);\n  }\n\n  // scaleProperties function\n  {\n    const functionId = \"scaleProperties\";\n    shaderBuilder.addFunction(\n      functionId,\n      `${propertiesStructName} scaleProperties(${propertiesStructName} ${propertiesFieldName}, float scale)`,\n      ShaderDestination.FRAGMENT\n    );\n    shaderBuilder.addFunctionLines(functionId, [\n      `${propertiesStructName} scaledProperties = ${propertiesFieldName};`,\n    ]);\n    for (let i = 0; i < attributeLength; i++) {\n      const name = names[i];\n      shaderBuilder.addFunctionLines(functionId, [\n        `scaledProperties.${name} *= scale;`,\n      ]);\n    }\n    shaderBuilder.addFunctionLines(functionId, [`return scaledProperties;`]);\n  }\n\n  // mixProperties\n  {\n    const functionId = \"mixProperties\";\n    shaderBuilder.addFunction(\n      functionId,\n      `${propertiesStructName} mixProperties(${propertiesStructName} propertiesA, ${propertiesStructName} propertiesB, float mixFactor)`,\n      ShaderDestination.FRAGMENT\n    );\n    shaderBuilder.addFunctionLines(functionId, [\n      `${propertiesStructName} ${propertiesFieldName};`,\n    ]);\n    for (let i = 0; i < attributeLength; i++) {\n      const name = names[i];\n      shaderBuilder.addFunctionLines(functionId, [\n        `${propertiesFieldName}.${name} = mix(propertiesA.${name}, propertiesB.${name}, mixFactor);`,\n      ]);\n    }\n    shaderBuilder.addFunctionLines(functionId, [\n      `return ${propertiesFieldName};`,\n    ]);\n  }\n\n  // copyPropertiesToMetadata\n  {\n    const functionId = \"copyPropertiesToMetadata\";\n    shaderBuilder.addFunction(\n      functionId,\n      `void copyPropertiesToMetadata(in ${propertiesStructName} ${propertiesFieldName}, inout ${metadataStructName} ${metadataFieldName})`,\n      ShaderDestination.FRAGMENT\n    );\n    for (let i = 0; i < attributeLength; i++) {\n      const name = names[i];\n      shaderBuilder.addFunctionLines(functionId, [\n        `${metadataFieldName}.${name} = ${propertiesFieldName}.${name};`,\n      ]);\n    }\n  }\n\n  // setStatistics function\n  if (hasStatistics) {\n    const functionId = \"setStatistics\";\n    shaderBuilder.addFunction(\n      functionId,\n      `void setStatistics(inout ${statisticsStructName} ${statisticsFieldName})`,\n      ShaderDestination.FRAGMENT\n    );\n    for (let i = 0; i < attributeLength; i++) {\n      const name = names[i];\n      const type = types[i];\n      const componentCount = MetadataType.getComponentCount(type);\n      for (let j = 0; j < componentCount; j++) {\n        const glslField = getGlslField(type, j);\n        const minimumValue = minimumValues[i][j];\n        const maximumValue = maximumValues[i][j];\n        shaderBuilder.addFunctionLines(functionId, [\n          `${statisticsFieldName}.${name}.min${glslField} = ${getGlslNumberAsFloat(\n            minimumValue\n          )};`,\n          `${statisticsFieldName}.${name}.max${glslField} = ${getGlslNumberAsFloat(\n            maximumValue\n          )};`,\n        ]);\n      }\n    }\n  }\n\n  // getPropertiesFromMegatextureAtUv\n  {\n    const functionId = \"getPropertiesFromMegatextureAtUv\";\n    shaderBuilder.addFunction(\n      functionId,\n      `${propertiesStructName} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,\n      ShaderDestination.FRAGMENT\n    );\n    shaderBuilder.addFunctionLines(functionId, [\n      `${propertiesStructName} ${propertiesFieldName};`,\n    ]);\n    for (let i = 0; i < attributeLength; i++) {\n      const name = names[i];\n      const type = types[i];\n      const componentType = componentTypes[i];\n      const glslTextureSwizzle = getGlslTextureSwizzle(type, componentType);\n      shaderBuilder.addFunctionLines(functionId, [\n        `properties.${name} = texture(u_megatextureTextures[${i}], texcoord)${glslTextureSwizzle};`,\n      ]);\n    }\n    shaderBuilder.addFunctionLines(functionId, [\n      `return ${propertiesFieldName};`,\n    ]);\n  }\n}\n\n/**\n * Converts a {@link MetadataType} to a GLSL type.\n *\n * @function\n *\n * @param {MetadataType} type The {@link MetadataType}.\n * @returns {string} The GLSL type.\n *\n * @private\n */\nfunction getGlslType(type) {\n  if (type === MetadataType.SCALAR) {\n    return \"float\";\n  } else if (type === MetadataType.VEC2) {\n    return \"vec2\";\n  } else if (type === MetadataType.VEC3) {\n    return \"vec3\";\n  } else if (type === MetadataType.VEC4) {\n    return \"vec4\";\n  }\n}\n\n/**\n * Gets the GLSL swizzle when reading data from a texture.\n *\n * @function\n *\n * @param {MetadataType} type The {@link MetadataType}.\n * @returns {string} The GLSL swizzle.\n *\n * @private\n */\nfunction getGlslTextureSwizzle(type) {\n  if (type === MetadataType.SCALAR) {\n    return \".r\";\n  } else if (type === MetadataType.VEC2) {\n    return \".ra\";\n  } else if (type === MetadataType.VEC3) {\n    return \".rgb\";\n  } else if (type === MetadataType.VEC4) {\n    return \"\";\n  }\n}\n\n/**\n * Gets the GLSL type of the partial derivative of {@link MetadataType}.\n *\n * @function\n *\n * @param {MetadataType} type The {@link MetadataType}.\n * @returns {string} The GLSL type.\n *\n * @private\n */\nfunction getGlslPartialDerivativeType(type) {\n  if (type === MetadataType.SCALAR) {\n    return \"vec3\";\n  } else if (type === MetadataType.VEC2) {\n    return \"mat2\";\n  } else if (type === MetadataType.VEC3) {\n    return \"mat3\";\n  } else if (type === MetadataType.VEC4) {\n    return \"mat4\";\n  }\n}\n\n/**\n * GLSL needs to have `.0` at the end of whole number floats or else it's\n * treated like an integer.\n *\n * @function\n *\n * @param {number} number The number to convert.\n * @returns {string} The number as floating point in GLSL.\n *\n * @private\n */\nfunction getGlslNumberAsFloat(number) {\n  let numberString = number.toString();\n  if (numberString.indexOf(\".\") === -1) {\n    numberString = `${number}.0`;\n  }\n  return numberString;\n}\n\n/**\n * Gets the GLSL field\n *\n * @function\n *\n * @param {MetadataType} type\n * @param {number} index\n * @returns {string}\n *\n * @private\n */\nfunction getGlslField(type, index) {\n  if (type === MetadataType.SCALAR) {\n    return \"\";\n  }\n  return `[${index}]`;\n}\n\nexport default processVoxelProperties;\n", "import defined from \"../Core/defined.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport CullFace from \"./CullFace.js\";\nimport getClippingFunction from \"./getClippingFunction.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderDestination from \"../Renderer/ShaderDestination.js\";\nimport VoxelRenderResources from \"./VoxelRenderResources.js\";\nimport processVoxelProperties from \"./processVoxelProperties.js\";\n\n/**\n * @function\n *\n * @param {VoxelPrimitive} primitive\n * @param {Context} context\n *\n * @private\n */\nfunction buildVoxelDrawCommands(primitive, context) {\n  const renderResources = new VoxelRenderResources(primitive);\n\n  processVoxelProperties(renderResources, primitive);\n\n  const {\n    shaderBuilder,\n    clippingPlanes,\n    clippingPlanesLength,\n  } = renderResources;\n\n  if (clippingPlanesLength > 0) {\n    // Extract the getClippingPlane function from the getClippingFunction string.\n    // This is a bit of a hack.\n    const functionId = \"getClippingPlane\";\n    const entireFunction = getClippingFunction(clippingPlanes, context);\n    const functionSignatureBegin = 0;\n    const functionSignatureEnd = entireFunction.indexOf(\")\") + 1;\n    const functionBodyBegin =\n      entireFunction.indexOf(\"{\", functionSignatureEnd) + 1;\n    const functionBodyEnd = entireFunction.indexOf(\"}\", functionBodyBegin);\n    const functionSignature = entireFunction.slice(\n      functionSignatureBegin,\n      functionSignatureEnd\n    );\n    const functionBody = entireFunction.slice(\n      functionBodyBegin,\n      functionBodyEnd\n    );\n    shaderBuilder.addFunction(\n      functionId,\n      functionSignature,\n      ShaderDestination.FRAGMENT\n    );\n    shaderBuilder.addFunctionLines(functionId, [functionBody]);\n  }\n\n  // Compile shaders\n  const shaderBuilderPick = shaderBuilder.clone();\n  shaderBuilderPick.addDefine(\"PICKING\", undefined, ShaderDestination.FRAGMENT);\n  const shaderProgram = shaderBuilder.buildShaderProgram(context);\n  const shaderProgramPick = shaderBuilderPick.buildShaderProgram(context);\n  const renderState = RenderState.fromCache({\n    cull: {\n      enabled: true,\n      face: CullFace.BACK,\n    },\n    depthTest: {\n      enabled: false,\n    },\n    depthMask: false,\n    // internally the shader does premultiplied alpha, so it makes sense to blend that way too\n    blending: BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,\n  });\n\n  // Create the draw commands\n  const viewportQuadVertexArray = context.getViewportQuadVertexArray();\n  const depthTest = primitive._depthTest;\n  const drawCommand = new DrawCommand({\n    vertexArray: viewportQuadVertexArray,\n    primitiveType: PrimitiveType.TRIANGLES,\n    renderState: renderState,\n    shaderProgram: shaderProgram,\n    uniformMap: renderResources.uniformMap,\n    modelMatrix: primitive._compoundModelMatrix,\n    pass: Pass.VOXELS,\n    executeInClosestFrustum: true,\n    owner: this,\n    cull: depthTest, // don't cull or occlude if depth testing is off\n    occlude: depthTest, // don't cull or occlude if depth testing is off\n  });\n\n  // Create the pick draw command\n  const drawCommandPick = DrawCommand.shallowClone(\n    drawCommand,\n    new DrawCommand()\n  );\n  drawCommandPick.shaderProgram = shaderProgramPick;\n  drawCommandPick.pickOnly = true;\n\n  // Delete the old shader programs\n  if (defined(primitive._drawCommand)) {\n    const command = primitive._drawCommand;\n    command.shaderProgram =\n      command.shaderProgram && command.shaderProgram.destroy();\n  }\n  if (defined(primitive._drawCommandPick)) {\n    const command = primitive._drawCommandPick;\n    command.shaderProgram =\n      command.shaderProgram && command.shaderProgram.destroy();\n  }\n\n  primitive._drawCommand = drawCommand;\n  primitive._drawCommandPick = drawCommandPick;\n}\n\nexport default buildVoxelDrawCommands;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport CullingVolume from \"../Core/CullingVolume.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DoubleEndedPriorityQueue from \"../Core/DoubleEndedPriorityQueue.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport KeyframeNode from \"./KeyframeNode.js\";\nimport MetadataType from \"./MetadataType.js\";\nimport Megatexture from \"./Megatexture.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport SpatialNode from \"./SpatialNode.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\n\n/**\n * Handles tileset traversal, tile requests, and GPU resources. Intended to be\n * private and paired with a {@link VoxelPrimitive}, which has a user-facing API.\n *\n * @alias VoxelTraversal\n * @constructor\n *\n * @param {VoxelPrimitive} primitive\n * @param {Context} context\n * @param {Cartesian3} dimensions\n * @param {MetadataType[]} types\n * @param {MetadataComponentType[]} componentTypes\n * @param {number} keyframeCount\n * @param {number} [maximumTextureMemoryByteLength]\n *\n * @private\n */\nfunction VoxelTraversal(\n  primitive,\n  context,\n  dimensions,\n  types,\n  componentTypes,\n  keyframeCount,\n  maximumTextureMemoryByteLength\n) {\n  /**\n   * TODO: maybe this shouldn't be stored or passed into update function?\n   * @type {VoxelPrimitive}\n   * @private\n   */\n  this._primitive = primitive;\n\n  const length = types.length;\n\n  /**\n   * @type {Megatexture[]}\n   * @readonly\n   */\n  this.megatextures = new Array(length);\n\n  // TODO make sure to split the maximumTextureMemoryByteLength across all the megatextures\n  for (let i = 0; i < length; i++) {\n    const type = types[i];\n    const componentCount = MetadataType.getComponentCount(type);\n    const componentType = componentTypes[i];\n\n    this.megatextures[i] = new Megatexture(\n      context,\n      dimensions,\n      componentCount,\n      componentType,\n      maximumTextureMemoryByteLength\n    );\n  }\n\n  const maximumTileCount = this.megatextures[0].maximumTileCount;\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._simultaneousRequestCount = 0;\n\n  /**\n   * @type {boolean}\n   * @private\n   */\n  this._debugPrint = false;\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._frameNumber = 0;\n\n  const shape = primitive._shape;\n\n  /**\n   * @type {SpatialNode}\n   * @readonly\n   */\n  this.rootNode = new SpatialNode(0, 0, 0, 0, undefined, shape, dimensions);\n\n  /**\n   * @type {DoubleEndedPriorityQueue}\n   * @private\n   */\n  this._priorityQueue = new DoubleEndedPriorityQueue({\n    maximumLength: maximumTileCount,\n    comparator: KeyframeNode.priorityComparator,\n  });\n\n  /**\n   * @type {KeyframeNode[]}\n   * @private\n   */\n  this._highPriorityKeyframeNodes = new Array(maximumTileCount);\n\n  /**\n   * @type {KeyframeNode[]}\n   * @private\n   */\n  this._keyframeNodesInMegatexture = new Array(maximumTileCount);\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._keyframeCount = keyframeCount;\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._sampleCount = undefined;\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._keyframeLocation = 0;\n\n  /**\n   * @type {number[]}\n   * @private\n   */\n  this._binaryTreeKeyframeWeighting = new Array(keyframeCount);\n\n  const binaryTreeKeyframeWeighting = this._binaryTreeKeyframeWeighting;\n  binaryTreeKeyframeWeighting[0] = 0;\n  binaryTreeKeyframeWeighting[keyframeCount - 1] = 0;\n  binaryTreeWeightingRecursive(\n    binaryTreeKeyframeWeighting,\n    1,\n    keyframeCount - 2,\n    0\n  );\n\n  const internalNodeTexelCount = 9;\n  const internalNodeTextureDimensionX = 2048;\n  const internalNodeTilesPerRow = Math.floor(\n    internalNodeTextureDimensionX / internalNodeTexelCount\n  );\n  const internalNodeTextureDimensionY = Math.ceil(\n    maximumTileCount / internalNodeTilesPerRow\n  );\n\n  /**\n   * @type {Texture}\n   * @readonly\n   */\n  this.internalNodeTexture = new Texture({\n    context: context,\n    pixelFormat: PixelFormat.RGBA,\n    pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n    flipY: false,\n    width: internalNodeTextureDimensionX,\n    height: internalNodeTextureDimensionY,\n    sampler: new Sampler({\n      minificationFilter: TextureMinificationFilter.NEAREST,\n      magnificationFilter: TextureMagnificationFilter.NEAREST,\n    }),\n  });\n\n  /**\n   * @type {number}\n   * @readonly\n   */\n  this.internalNodeTilesPerRow = internalNodeTilesPerRow;\n\n  /**\n   * @type {Cartesian2}\n   * @readonly\n   */\n  this.internalNodeTexelSizeUv = new Cartesian2(\n    1.0 / internalNodeTextureDimensionX,\n    1.0 / internalNodeTextureDimensionY\n  );\n\n  /**\n   * Only generated when there are two or more samples.\n   * @type {Texture}\n   * @readonly\n   */\n  this.leafNodeTexture = undefined;\n\n  /**\n   * Only generated when there are two or more samples.\n   * @type {number}\n   * @readonly\n   */\n  this.leafNodeTilesPerRow = undefined;\n\n  /**\n   * Only generated when there are two or more samples.\n   * @type {Cartesian2}\n   * @readonly\n   */\n  this.leafNodeTexelSizeUv = new Cartesian2();\n}\n\nfunction binaryTreeWeightingRecursive(arr, start, end, depth) {\n  if (start > end) {\n    return;\n  }\n  const mid = Math.floor((start + end) / 2);\n  arr[mid] = depth;\n  binaryTreeWeightingRecursive(arr, start, mid - 1, depth + 1);\n  binaryTreeWeightingRecursive(arr, mid + 1, end, depth + 1);\n}\n\nVoxelTraversal.simultaneousRequestCountMaximum = 50;\n\n/**\n * @param {FrameState} frameState\n * @param {number} keyframeLocation\n * @param {boolean} recomputeBoundingVolumes\n * @param {boolean} pauseUpdate\n */\nVoxelTraversal.prototype.update = function (\n  frameState,\n  keyframeLocation,\n  recomputeBoundingVolumes,\n  pauseUpdate\n) {\n  const primitive = this._primitive;\n  const context = frameState.context;\n  const maximumTileCount = this.megatextures[0].maximumTileCount;\n  const keyframeCount = this._keyframeCount;\n\n  const levelBlendFactor = primitive._levelBlendFactor;\n  const hasLevelBlendFactor = levelBlendFactor > 0.0;\n  const hasKeyframes = keyframeCount > 1;\n  const sampleCount = (hasLevelBlendFactor ? 2 : 1) * (hasKeyframes ? 2 : 1);\n  this._sampleCount = sampleCount;\n\n  const useLeafNodes = sampleCount >= 2;\n  if (useLeafNodes && !defined(this.leafNodeTexture)) {\n    const leafNodeTexelCount = 2;\n    const leafNodeTextureDimensionX = 1024;\n    const leafNodeTilesPerRow = Math.floor(\n      leafNodeTextureDimensionX / leafNodeTexelCount\n    );\n    const leafNodeTextureDimensionY = Math.ceil(\n      maximumTileCount / leafNodeTilesPerRow\n    );\n\n    this.leafNodeTexture = new Texture({\n      context: context,\n      pixelFormat: PixelFormat.RGBA,\n      pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n      flipY: false,\n      width: leafNodeTextureDimensionX,\n      height: leafNodeTextureDimensionY,\n      sampler: new Sampler({\n        minificationFilter: TextureMinificationFilter.NEAREST,\n        magnificationFilter: TextureMagnificationFilter.NEAREST,\n      }),\n    });\n    this.leafNodeTexelSizeUv = Cartesian2.fromElements(\n      1.0 / leafNodeTextureDimensionX,\n      1.0 / leafNodeTextureDimensionY,\n      this.leafNodeTexelSizeUv\n    );\n    this.leafNodeTilesPerRow = leafNodeTilesPerRow;\n  } else if (!useLeafNodes && defined(this.leafNodeTexture)) {\n    this.leafNodeTexture = this.leafNodeTexture.destroy();\n  }\n\n  this._keyframeLocation = CesiumMath.clamp(\n    keyframeLocation,\n    0.0,\n    keyframeCount - 1\n  );\n\n  if (recomputeBoundingVolumes) {\n    recomputeBoundingVolumesRecursive(this, this.rootNode);\n  }\n\n  if (pauseUpdate) {\n    return;\n  }\n\n  this._frameNumber = frameState.frameNumber;\n  const timestamp0 = getTimestamp();\n  loadAndUnload(this, frameState);\n  const timestamp1 = getTimestamp();\n  generateOctree(this, sampleCount, levelBlendFactor);\n  const timestamp2 = getTimestamp();\n\n  if (this._debugPrint) {\n    const loadAndUnloadTimeMs = timestamp1 - timestamp0;\n    const generateOctreeTimeMs = timestamp2 - timestamp1;\n    const totalTimeMs = timestamp2 - timestamp0;\n    printDebugInformation(\n      this,\n      loadAndUnloadTimeMs,\n      generateOctreeTimeMs,\n      totalTimeMs\n    );\n  }\n};\n\n/**\n * Check if a node is renderable.\n * @param {SpatialNode} tile\n * @returns {boolean}\n */\nVoxelTraversal.prototype.isRenderable = function (tile) {\n  return tile.isRenderable(this._frameNumber);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see VoxelTraversal#destroy\n */\nVoxelTraversal.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see VoxelTraversal#isDestroyed\n *\n * @example\n * voxelTraversal = voxelTraversal && voxelTraversal.destroy();\n */\nVoxelTraversal.prototype.destroy = function () {\n  const megatextures = this.megatextures;\n  const megatextureLength = megatextures.length;\n  for (let i = 0; i < megatextureLength; i++) {\n    megatextures[i] = megatextures[i] && megatextures[i].destroy();\n  }\n\n  this.internalNodeTexture =\n    this.internalNodeTexture && this.internalNodeTexture.destroy();\n\n  this.leafNodeTexture = this.leafNodeTexture && this.leafNodeTexture.destroy();\n\n  return destroyObject(this);\n};\n\n/**\n * @function\n *\n * @param {VoxelTraversal} that\n * @param {SpatialNode} node\n *\n * @private\n */\nfunction recomputeBoundingVolumesRecursive(that, node) {\n  const primitive = that._primitive;\n  const shape = primitive._shape;\n  const dimensions = primitive._provider.dimensions;\n  node.computeBoundingVolumes(shape, dimensions);\n  if (defined(node.children)) {\n    for (let i = 0; i < 8; i++) {\n      const child = node.children[i];\n      recomputeBoundingVolumesRecursive(that, child);\n    }\n  }\n}\n\n/**\n * @function\n *\n * @param {VoxelTraversal} that\n * @param {KeyframeNode} keyframeNode\n *\n * @private\n */\nfunction requestData(that, keyframeNode) {\n  if (\n    that._simultaneousRequestCount >=\n    VoxelTraversal.simultaneousRequestCountMaximum\n  ) {\n    return;\n  }\n\n  const primitive = that._primitive;\n  const provider = primitive._provider;\n\n  function postRequestSuccess(result) {\n    that._simultaneousRequestCount--;\n    const length = primitive._provider.types.length;\n\n    if (!defined(result)) {\n      keyframeNode.state = KeyframeNode.LoadState.UNAVAILABLE;\n    } else if (result === KeyframeNode.LoadState.FAILED) {\n      keyframeNode.state = KeyframeNode.LoadState.FAILED;\n    } else if (!Array.isArray(result) || result.length !== length) {\n      // TODO should this throw runtime error?\n      keyframeNode.state = KeyframeNode.LoadState.FAILED;\n    } else {\n      const megatextures = that.megatextures;\n      for (let i = 0; i < length; i++) {\n        const { voxelCountPerTile, channelCount } = megatextures[i];\n        const { x, y, z } = voxelCountPerTile;\n        const tileVoxelCount = x * y * z;\n\n        const data = result[i];\n        const expectedLength = tileVoxelCount * channelCount;\n        if (data.length === expectedLength) {\n          keyframeNode.metadatas[i] = data;\n          // State is received only when all metadata requests have been received\n          keyframeNode.state = KeyframeNode.LoadState.RECEIVED;\n        } else {\n          keyframeNode.state = KeyframeNode.LoadState.FAILED;\n          break;\n        }\n      }\n    }\n  }\n\n  function postRequestFailure() {\n    that._simultaneousRequestCount--;\n    keyframeNode.state = KeyframeNode.LoadState.FAILED;\n  }\n\n  const { keyframe, spatialNode } = keyframeNode;\n  const promise = provider.requestData({\n    tileLevel: spatialNode.level,\n    tileX: spatialNode.x,\n    tileY: spatialNode.y,\n    tileZ: spatialNode.z,\n    keyframe: keyframe,\n  });\n\n  if (defined(promise)) {\n    that._simultaneousRequestCount++;\n    keyframeNode.state = KeyframeNode.LoadState.RECEIVING;\n    promise.then(postRequestSuccess).catch(postRequestFailure);\n  } else {\n    keyframeNode.state = KeyframeNode.LoadState.FAILED;\n  }\n}\n\n/**\n * @function\n *\n * @param {number} x\n * @returns {number}\n *\n * @private\n */\nfunction mapInfiniteRangeToZeroOne(x) {\n  return x / (1.0 + x);\n}\n\n/**\n * @function\n *\n * @param {VoxelTraversal} that\n * @param {FrameState} frameState\n *\n * @private\n */\nfunction loadAndUnload(that, frameState) {\n  const frameNumber = that._frameNumber;\n  const primitive = that._primitive;\n  const shape = primitive._shape;\n  const { dimensions } = primitive;\n  const targetScreenSpaceError = primitive.screenSpaceError;\n  const priorityQueue = that._priorityQueue;\n  const keyframeLocation = that._keyframeLocation;\n  const keyframeCount = that._keyframeCount;\n  const rootNode = that.rootNode;\n\n  const { camera, context, pixelRatio } = frameState;\n  const { positionWC, frustum } = camera;\n  const screenHeight = context.drawingBufferHeight / pixelRatio;\n  const screenSpaceErrorMultiplier = screenHeight / frustum.sseDenominator;\n\n  function keyframePriority(previousKeyframe, keyframe, nextKeyframe) {\n    const keyframeDifference = Math.min(\n      Math.abs(keyframe - previousKeyframe),\n      Math.abs(keyframe - nextKeyframe)\n    );\n    const maxKeyframeDifference = Math.max(\n      previousKeyframe,\n      keyframeCount - nextKeyframe - 1,\n      1\n    );\n    const keyframeFactor = Math.pow(\n      1.0 - keyframeDifference / maxKeyframeDifference,\n      4.0\n    );\n    const binaryTreeFactor = Math.exp(\n      -that._binaryTreeKeyframeWeighting[keyframe]\n    );\n    return CesiumMath.lerp(\n      binaryTreeFactor,\n      keyframeFactor,\n      0.15 + 0.85 * keyframeFactor\n    );\n  }\n\n  /**\n   * @ignore\n   * @param {SpatialNode} spatialNode\n   * @param {number} visibilityPlaneMask\n   */\n  function addToQueueRecursive(spatialNode, visibilityPlaneMask) {\n    spatialNode.computeScreenSpaceError(positionWC, screenSpaceErrorMultiplier);\n\n    visibilityPlaneMask = spatialNode.visibility(\n      frameState,\n      visibilityPlaneMask\n    );\n    if (visibilityPlaneMask === CullingVolume.MASK_OUTSIDE) {\n      return;\n    }\n    spatialNode.visitedFrameNumber = frameNumber;\n\n    const previousKeyframe = CesiumMath.clamp(\n      Math.floor(keyframeLocation),\n      0,\n      keyframeCount - 2\n    );\n    const nextKeyframe = previousKeyframe + 1;\n\n    // Create keyframe nodes at the playhead.\n    // If they already exist, nothing will be created.\n    if (keyframeCount === 1) {\n      spatialNode.createKeyframeNode(0);\n    } else if (spatialNode.keyframeNodes.length !== keyframeCount) {\n      for (let k = 0; k < keyframeCount; k++) {\n        spatialNode.createKeyframeNode(k);\n      }\n    }\n    const ssePriority = mapInfiniteRangeToZeroOne(spatialNode.screenSpaceError);\n\n    let hasLoadedKeyframe = false;\n    const keyframeNodes = spatialNode.keyframeNodes;\n    for (let i = 0; i < keyframeNodes.length; i++) {\n      const keyframeNode = keyframeNodes[i];\n\n      keyframeNode.priority =\n        10.0 * ssePriority +\n        keyframePriority(previousKeyframe, keyframeNode.keyframe, nextKeyframe);\n\n      if (\n        keyframeNode.state !== KeyframeNode.LoadState.UNAVAILABLE &&\n        keyframeNode.state !== KeyframeNode.LoadState.FAILED &&\n        keyframeNode.priority !== -Number.MAX_VALUE\n      ) {\n        priorityQueue.insert(keyframeNode);\n      }\n      if (keyframeNode.state === KeyframeNode.LoadState.LOADED) {\n        hasLoadedKeyframe = true;\n      }\n    }\n\n    const meetsScreenSpaceError =\n      spatialNode.screenSpaceError < targetScreenSpaceError;\n    if (meetsScreenSpaceError || !hasLoadedKeyframe) {\n      // Free up memory\n      spatialNode.children = undefined;\n      return;\n    }\n\n    if (!defined(spatialNode.children)) {\n      spatialNode.constructChildNodes(shape, dimensions);\n    }\n    for (let childIndex = 0; childIndex < 8; childIndex++) {\n      const child = spatialNode.children[childIndex];\n      addToQueueRecursive(child, visibilityPlaneMask);\n    }\n  }\n\n  priorityQueue.reset();\n  addToQueueRecursive(rootNode, CullingVolume.MASK_INDETERMINATE);\n\n  const highPriorityKeyframeNodes = that._highPriorityKeyframeNodes;\n  let highPriorityKeyframeNodeCount = 0;\n  let highPriorityKeyframeNode;\n  while (priorityQueue.length > 0) {\n    highPriorityKeyframeNode = priorityQueue.removeMaximum();\n    highPriorityKeyframeNode.highPriorityFrameNumber = frameNumber;\n    highPriorityKeyframeNodes[\n      highPriorityKeyframeNodeCount\n    ] = highPriorityKeyframeNode;\n    highPriorityKeyframeNodeCount++;\n  }\n\n  const keyframeNodesInMegatexture = that._keyframeNodesInMegatexture;\n  // TODO: some of the megatexture state should be stored once, not duplicate for each megatexture\n  const megatexture = that.megatextures[0];\n  const keyframeNodesInMegatextureCount = megatexture.occupiedCount;\n  keyframeNodesInMegatexture.length = keyframeNodesInMegatextureCount;\n  keyframeNodesInMegatexture.sort(function (a, b) {\n    if (a.highPriorityFrameNumber === b.highPriorityFrameNumber) {\n      return b.priority - a.priority;\n    }\n    return b.highPriorityFrameNumber - a.highPriorityFrameNumber;\n  });\n\n  let destroyedCount = 0;\n  let addedCount = 0;\n\n  for (\n    let highPriorityKeyframeNodeIndex = 0;\n    highPriorityKeyframeNodeIndex < highPriorityKeyframeNodeCount;\n    highPriorityKeyframeNodeIndex++\n  ) {\n    highPriorityKeyframeNode =\n      highPriorityKeyframeNodes[highPriorityKeyframeNodeIndex];\n\n    if (\n      highPriorityKeyframeNode.state === KeyframeNode.LoadState.LOADED ||\n      highPriorityKeyframeNode.spatialNode === undefined\n    ) {\n      // Already loaded, so nothing to do.\n      // Or destroyed when adding a higher priority node\n      continue;\n    }\n    if (highPriorityKeyframeNode.state === KeyframeNode.LoadState.UNLOADED) {\n      requestData(that, highPriorityKeyframeNode);\n    }\n    if (highPriorityKeyframeNode.state === KeyframeNode.LoadState.RECEIVED) {\n      let addNodeIndex = 0;\n      if (megatexture.isFull()) {\n        // If the megatexture is full, try removing a discardable node with the lowest priority.\n        addNodeIndex = keyframeNodesInMegatextureCount - 1 - destroyedCount;\n        destroyedCount++;\n\n        const discardNode = keyframeNodesInMegatexture[addNodeIndex];\n        discardNode.spatialNode.destroyKeyframeNode(\n          discardNode,\n          that.megatextures\n        );\n      } else {\n        addNodeIndex = keyframeNodesInMegatextureCount + addedCount;\n        addedCount++;\n      }\n      highPriorityKeyframeNode.spatialNode.addKeyframeNodeToMegatextures(\n        highPriorityKeyframeNode,\n        that.megatextures\n      );\n      keyframeNodesInMegatexture[addNodeIndex] = highPriorityKeyframeNode;\n    }\n  }\n}\n\n/**\n * @function\n *\n * @param {VoxelTraversal} that\n *\n * @private\n */\nfunction printDebugInformation(\n  that,\n  loadAndUnloadTimeMs,\n  generateOctreeTimeMs,\n  totalTimeMs\n) {\n  const keyframeCount = that._keyframeCount;\n  const rootNode = that.rootNode;\n\n  const loadStateCount = Object.keys(KeyframeNode.LoadState).length;\n  const loadStatesByKeyframe = new Array(loadStateCount);\n  const loadStateByCount = new Array(loadStateCount);\n  let nodeCountTotal = 0;\n\n  for (\n    let loadStateIndex = 0;\n    loadStateIndex < loadStateCount;\n    loadStateIndex++\n  ) {\n    const keyframeArray = new Array(keyframeCount);\n    loadStatesByKeyframe[loadStateIndex] = keyframeArray;\n    for (let i = 0; i < keyframeCount; i++) {\n      keyframeArray[i] = 0;\n    }\n    loadStateByCount[loadStateIndex] = 0;\n  }\n\n  /**\n   * @ignore\n   * @param {SpatialNode} node\n   */\n  function traverseRecursive(node) {\n    const keyframeNodes = node.keyframeNodes;\n    for (\n      let keyframeIndex = 0;\n      keyframeIndex < keyframeNodes.length;\n      keyframeIndex++\n    ) {\n      const keyframeNode = keyframeNodes[keyframeIndex];\n      const keyframe = keyframeNode.keyframe;\n      const state = keyframeNode.state;\n      loadStatesByKeyframe[state][keyframe] += 1;\n      loadStateByCount[state] += 1;\n      nodeCountTotal++;\n    }\n\n    if (defined(node.children)) {\n      for (let childIndex = 0; childIndex < 8; childIndex++) {\n        const child = node.children[childIndex];\n        traverseRecursive(child);\n      }\n    }\n  }\n  traverseRecursive(rootNode);\n\n  const loadedKeyframeStatistics = `KEYFRAMES: ${\n    loadStatesByKeyframe[KeyframeNode.LoadState.LOADED]\n  }`;\n  const loadStateStatistics =\n    `UNLOADED: ${loadStateByCount[KeyframeNode.LoadState.UNLOADED]} | ` +\n    `RECEIVING: ${loadStateByCount[KeyframeNode.LoadState.RECEIVING]} | ` +\n    `RECEIVED: ${loadStateByCount[KeyframeNode.LoadState.RECEIVED]} | ` +\n    `LOADED: ${loadStateByCount[KeyframeNode.LoadState.LOADED]} | ` +\n    `FAILED: ${loadStateByCount[KeyframeNode.LoadState.FAILED]} | ` +\n    `UNAVAILABLE: ${loadStateByCount[KeyframeNode.LoadState.UNAVAILABLE]} | ` +\n    `TOTAL: ${nodeCountTotal}`;\n\n  const loadAndUnloadTimeMsRounded =\n    Math.round(loadAndUnloadTimeMs * 100) / 100;\n  const generateOctreeTimeMsRounded =\n    Math.round(generateOctreeTimeMs * 100) / 100;\n  const totalTimeMsRounded = Math.round(totalTimeMs * 100) / 100;\n\n  const timerStatistics =\n    `LOAD: ${loadAndUnloadTimeMsRounded} | ` +\n    `OCT: ${generateOctreeTimeMsRounded} | ` +\n    `ALL: ${totalTimeMsRounded}`;\n\n  console.log(\n    `${loadedKeyframeStatistics} || ${loadStateStatistics} || ${timerStatistics}`\n  );\n}\n\n// GPU Octree Layout\n// (shown as binary tree instead of octree for demonstration purposes)\n//\n// Tree representation:\n//           0\n//          / \\\n//         /   \\\n//        /     \\\n//       1       3\n//      / \\     / \\\n//     L0  2   L3 L4\n//        / \\\n//       L1 L2\n//\n//\n// Array representation:\n// L = leaf index\n// * = index to parent node\n// index:   0_______  1________  2________  3_________\n// array:  [*0, 1, 3, *0, L0, 2, *1 L1, L2, *0, L3, L4]\n//\n// The array is generated from a depth-first traversal. The end result could be an unbalanced tree,\n// so the parent index is stored at each node to make it possible to traverse upwards.\n\nconst GpuOctreeFlag = {\n  // Data is an octree index.\n  INTERNAL: 0,\n  // Data is a leaf node.\n  LEAF: 1,\n  // When leaf data is packed in the octree and there's a node that is forced to\n  // render but has no data of its own (such as when its siblings are renderable but it\n  // is not), signal that it's using its parent's data.\n  PACKED_LEAF_FROM_PARENT: 2,\n};\n\n/**\n * @function\n *\n * @param {VoxelTraversal} that\n * @param {FrameState} frameState\n * @param {number} sampleCount\n * @param {number} levelBlendFactor\n * @private\n */\nfunction generateOctree(that, sampleCount, levelBlendFactor) {\n  const targetSse = that._primitive._screenSpaceError;\n  const keyframeLocation = that._keyframeLocation;\n  const frameNumber = that._frameNumber;\n  const useLeafNodes = sampleCount >= 2;\n\n  let internalNodeCount = 0;\n  let leafNodeCount = 0;\n  const internalNodeOctreeData = [];\n  const leafNodeOctreeData = [];\n\n  /**\n   * @ignore\n   * @param {SpatialNode} node\n   * @param {number} childOctreeIndex\n   * @param {number} childEntryIndex\n   * @param {number} parentOctreeIndex\n   * @param {number} parentEntryIndex\n   */\n  function buildOctree(\n    node,\n    childOctreeIndex,\n    childEntryIndex,\n    parentOctreeIndex,\n    parentEntryIndex\n  ) {\n    let hasRenderableChildren = false;\n    if (defined(node.children)) {\n      for (let c = 0; c < 8; c++) {\n        const childNode = node.children[c];\n        childNode.computeSurroundingRenderableKeyframeNodes(keyframeLocation);\n        if (childNode.isRenderable(frameNumber)) {\n          hasRenderableChildren = true;\n        }\n      }\n    }\n\n    if (hasRenderableChildren) {\n      // Point the parent and child octree indexes at each other\n      internalNodeOctreeData[parentEntryIndex] =\n        (GpuOctreeFlag.INTERNAL << 16) | childOctreeIndex;\n      internalNodeOctreeData[childEntryIndex] = parentOctreeIndex;\n      internalNodeCount++;\n\n      // Recurse over children\n      parentOctreeIndex = childOctreeIndex;\n      parentEntryIndex = parentOctreeIndex * 9 + 1;\n      for (let cc = 0; cc < 8; cc++) {\n        const child = node.children[cc];\n        childOctreeIndex = internalNodeCount;\n        childEntryIndex = childOctreeIndex * 9 + 0;\n        buildOctree(\n          child,\n          childOctreeIndex,\n          childEntryIndex,\n          parentOctreeIndex,\n          parentEntryIndex + cc\n        );\n      }\n    } else {\n      // Store the leaf node information instead\n      // Recursion stops here because there are no renderable children\n      if (useLeafNodes) {\n        const baseIdx = leafNodeCount * 5;\n        const keyframeNode = node.renderableKeyframeNodePrevious;\n        const levelDifference = node.level - keyframeNode.spatialNode.level;\n\n        const parentNode = keyframeNode.spatialNode.parent;\n        const parentKeyframeNode = defined(parentNode)\n          ? parentNode.renderableKeyframeNodePrevious\n          : keyframeNode;\n\n        const lodLerp = getLodLerp(node, targetSse, levelBlendFactor);\n        const levelDifferenceChild = levelDifference;\n        const levelDifferenceParent = 1;\n        const megatextureIndexChild = keyframeNode.megatextureIndex;\n        const megatextureIndexParent = parentKeyframeNode.megatextureIndex;\n\n        leafNodeOctreeData[baseIdx + 0] = lodLerp;\n        leafNodeOctreeData[baseIdx + 1] = levelDifferenceChild;\n        leafNodeOctreeData[baseIdx + 2] = levelDifferenceParent;\n        leafNodeOctreeData[baseIdx + 3] = megatextureIndexChild;\n        leafNodeOctreeData[baseIdx + 4] = megatextureIndexParent;\n\n        internalNodeOctreeData[parentEntryIndex] =\n          (GpuOctreeFlag.LEAF << 16) | leafNodeCount;\n      } else {\n        const keyframeNode = node.renderableKeyframeNodePrevious;\n        const levelDifference = node.level - keyframeNode.spatialNode.level;\n        const flag =\n          levelDifference === 0\n            ? GpuOctreeFlag.LEAF\n            : GpuOctreeFlag.PACKED_LEAF_FROM_PARENT;\n        internalNodeOctreeData[parentEntryIndex] =\n          (flag << 16) | keyframeNode.megatextureIndex;\n      }\n      leafNodeCount++;\n    }\n  }\n\n  const rootNode = that.rootNode;\n  rootNode.computeSurroundingRenderableKeyframeNodes(keyframeLocation);\n  if (rootNode.isRenderable(frameNumber)) {\n    buildOctree(rootNode, 0, 0, 0, 0);\n  }\n\n  copyToInternalNodeTexture(\n    internalNodeOctreeData,\n    9,\n    that.internalNodeTilesPerRow,\n    that.internalNodeTexture\n  );\n  if (useLeafNodes) {\n    copyToLeafNodeTexture(\n      leafNodeOctreeData,\n      2,\n      that.leafNodeTilesPerRow,\n      that.leafNodeTexture\n    );\n  }\n}\n\n/**\n * Compute an interpolation factor between a node and its parent\n * @param {SpatialNode} node\n * @param {number} targetSse\n * @param {number} levelBlendFactor\n * @returns {number}\n * @private\n */\nfunction getLodLerp(node, targetSse, levelBlendFactor) {\n  if (node.parent === undefined) {\n    return 0.0;\n  }\n  const sse = node.screenSpaceError;\n  const parentSse = node.parent.screenSpaceError;\n  const lodLerp = (targetSse - sse) / (parentSse - sse);\n  const blended = (lodLerp + levelBlendFactor - 1.0) / levelBlendFactor;\n\n  return CesiumMath.clamp(blended, 0.0, 1.0);\n}\n\n/**\n *\n * @param {number[]} data\n * @param {number} texelsPerTile\n * @param {number} tilesPerRow\n * @param {Texture} texture\n * @private\n */\nfunction copyToInternalNodeTexture(data, texelsPerTile, tilesPerRow, texture) {\n  const channelCount = PixelFormat.componentsLength(texture.pixelFormat);\n  const tileCount = Math.ceil(data.length / texelsPerTile);\n  const copyWidth = Math.max(\n    1,\n    texelsPerTile * Math.min(tileCount, tilesPerRow)\n  );\n  const copyHeight = Math.max(1, Math.ceil(tileCount / tilesPerRow));\n\n  const textureData = new Uint8Array(copyWidth * copyHeight * channelCount);\n  for (let i = 0; i < data.length; i++) {\n    const val = data[i];\n    const startIndex = i * channelCount;\n    for (let j = 0; j < channelCount; j++) {\n      textureData[startIndex + j] = (val >>> (j * 8)) & 0xff;\n    }\n  }\n\n  const source = {\n    arrayBufferView: textureData,\n    width: copyWidth,\n    height: copyHeight,\n  };\n\n  const copyOptions = {\n    source: source,\n    xOffset: 0,\n    yOffset: 0,\n  };\n\n  texture.copyFrom(copyOptions);\n}\n\n/**\n *\n * @param {number[]} data\n * @param {number} texelsPerTile\n * @param {number} tilesPerRow\n * @param {Texture} texture\n * @private\n */\nfunction copyToLeafNodeTexture(data, texelsPerTile, tilesPerRow, texture) {\n  const channelCount = PixelFormat.componentsLength(texture.pixelFormat);\n  const datasPerTile = 5;\n  const tileCount = Math.ceil(data.length / datasPerTile);\n  const copyWidth = Math.max(\n    1,\n    texelsPerTile * Math.min(tileCount, tilesPerRow)\n  );\n  const copyHeight = Math.max(1, Math.ceil(tileCount / tilesPerRow));\n\n  const textureData = new Uint8Array(copyWidth * copyHeight * channelCount);\n  for (let tileIndex = 0; tileIndex < tileCount; tileIndex++) {\n    const timeLerp = data[tileIndex * datasPerTile + 0];\n    const previousKeyframeLevelsAbove = data[tileIndex * datasPerTile + 1];\n    const nextKeyframeLevelsAbove = data[tileIndex * datasPerTile + 2];\n    const previousKeyframeMegatextureIndex = data[tileIndex * datasPerTile + 3];\n    const nextKeyframeMegatextureIndex = data[tileIndex * datasPerTile + 4];\n\n    const timeLerpCompressed = CesiumMath.clamp(\n      Math.floor(65536 * timeLerp),\n      0,\n      65535\n    );\n    textureData[tileIndex * 8 + 0] = (timeLerpCompressed >>> 0) & 0xff;\n    textureData[tileIndex * 8 + 1] = (timeLerpCompressed >>> 8) & 0xff;\n    textureData[tileIndex * 8 + 2] = previousKeyframeLevelsAbove & 0xff;\n    textureData[tileIndex * 8 + 3] = nextKeyframeLevelsAbove & 0xff;\n    textureData[tileIndex * 8 + 4] =\n      (previousKeyframeMegatextureIndex >>> 0) & 0xff;\n    textureData[tileIndex * 8 + 5] =\n      (previousKeyframeMegatextureIndex >>> 8) & 0xff;\n    textureData[tileIndex * 8 + 6] =\n      (nextKeyframeMegatextureIndex >>> 0) & 0xff;\n    textureData[tileIndex * 8 + 7] =\n      (nextKeyframeMegatextureIndex >>> 8) & 0xff;\n  }\n\n  const source = {\n    arrayBufferView: textureData,\n    width: copyWidth,\n    height: copyHeight,\n  };\n\n  const copyOptions = {\n    source: source,\n    xOffset: 0,\n    yOffset: 0,\n  };\n\n  texture.copyFrom(copyOptions);\n}\n\n/**\n * @param {number} tileCount\n * @param {Cartesian3} dimensions\n * @param {MetadataType[]} types\n * @param {MetadataComponentType[]} componentTypes\n */\nVoxelTraversal.getApproximateTextureMemoryByteLength = function (\n  tileCount,\n  dimensions,\n  types,\n  componentTypes\n) {\n  let textureMemoryByteLength = 0;\n\n  const length = types.length;\n  for (let i = 0; i < length; i++) {\n    const type = types[i];\n    const componentType = componentTypes[i];\n    const componentCount = MetadataType.getComponentCount(type);\n\n    textureMemoryByteLength += Megatexture.getApproximateTextureMemoryByteLength(\n      tileCount,\n      dimensions,\n      componentCount,\n      componentType\n    );\n  }\n\n  return textureMemoryByteLength;\n};\n\nexport default VoxelTraversal;\n", "/**\n * An enum of the basic GLSL uniform types. These can be used with\n * {@link CustomShader} to declare user-defined uniforms.\n *\n * @enum {string}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst UniformType = {\n  /**\n   * A single floating point value.\n   *\n   * @type {string}\n   * @constant\n   */\n  FLOAT: \"float\",\n  /**\n   * A vector of 2 floating point values.\n   *\n   * @type {string}\n   * @constant\n   */\n  VEC2: \"vec2\",\n  /**\n   * A vector of 3 floating point values.\n   *\n   * @type {string}\n   * @constant\n   */\n  VEC3: \"vec3\",\n  /**\n   * A vector of 4 floating point values.\n   *\n   * @type {string}\n   * @constant\n   */\n  VEC4: \"vec4\",\n  /**\n   * A single integer value\n   *\n   * @type {string}\n   * @constant\n   */\n  INT: \"int\",\n  /**\n   * A vector of 2 integer values.\n   *\n   * @type {string}\n   * @constant\n   */\n  INT_VEC2: \"ivec2\",\n  /**\n   * A vector of 3 integer values.\n   *\n   * @type {string}\n   * @constant\n   */\n  INT_VEC3: \"ivec3\",\n  /**\n   * A vector of 4 integer values.\n   *\n   * @type {string}\n   * @constant\n   */\n  INT_VEC4: \"ivec4\",\n  /**\n   * A single boolean value.\n   *\n   * @type {string}\n   * @constant\n   */\n  BOOL: \"bool\",\n  /**\n   * A vector of 2 boolean values.\n   *\n   * @type {string}\n   * @constant\n   */\n  BOOL_VEC2: \"bvec2\",\n  /**\n   * A vector of 3 boolean values.\n   *\n   * @type {string}\n   * @constant\n   */\n  BOOL_VEC3: \"bvec3\",\n  /**\n   * A vector of 4 boolean values.\n   *\n   * @type {string}\n   * @constant\n   */\n  BOOL_VEC4: \"bvec4\",\n  /**\n   * A 2x2 matrix of floating point values.\n   *\n   * @type {string}\n   * @constant\n   */\n  MAT2: \"mat2\",\n  /**\n   * A 3x3 matrix of floating point values.\n   *\n   * @type {string}\n   * @constant\n   */\n  MAT3: \"mat3\",\n  /**\n   * A 3x3 matrix of floating point values.\n   *\n   * @type {string}\n   * @constant\n   */\n  MAT4: \"mat4\",\n  /**\n   * A 2D sampled texture.\n   * @type {string}\n   * @constant\n   */\n  SAMPLER_2D: \"sampler2D\",\n  SAMPLER_CUBE: \"samplerCube\",\n};\n\nexport default Object.freeze(UniformType);\n", "import defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport getImageFromTypedArray from \"../../Core/getImageFromTypedArray.js\";\nimport CesiumMath from \"../../Core/Math.js\";\nimport resizeImageToNextPowerOfTwo from \"../../Core/resizeImageToNextPowerOfTwo.js\";\nimport PixelDatatype from \"../../Renderer/PixelDatatype.js\";\nimport Texture from \"../../Renderer/Texture.js\";\nimport TextureMinificationFilter from \"../../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../../Renderer/TextureWrap.js\";\n\n/**\n * An object to manage loading textures\n *\n * @alias TextureManager\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction TextureManager() {\n  this._defaultTexture = undefined;\n  this._textures = {};\n  this._loadedImages = [];\n\n  // Keep track of the last time update() was called to avoid\n  // calling update() twice.\n  this._lastUpdatedFrame = -1;\n}\n\n/**\n * Get one of the loaded textures\n * @param {string} textureId The unique ID of the texture loaded by {@link TextureManager#loadTexture2D}\n * @return {Texture} The texture or <code>undefined</code> if no texture exists\n */\nTextureManager.prototype.getTexture = function (textureId) {\n  return this._textures[textureId];\n};\n\nfunction fetchTexture2D(textureManager, textureId, textureUniform) {\n  textureUniform.resource\n    .fetchImage()\n    .then(function (image) {\n      textureManager._loadedImages.push({\n        id: textureId,\n        image: image,\n        textureUniform: textureUniform,\n      });\n    })\n    .catch(function () {\n      const texture = textureManager._textures[textureId];\n      if (defined(texture) && texture !== textureManager._defaultTexture) {\n        texture.destroy();\n      }\n\n      textureManager._textures[textureId] = textureManager._defaultTexture;\n    });\n}\n\n/**\n * Load a texture 2D asynchronously. Note that {@link TextureManager#update}\n * must be called in the render loop to finish processing the textures.\n *\n * @param {string} textureId A unique ID to identify this texture.\n * @param {TextureUniform} textureUniform A description of the texture\n *\n * @private\n */\nTextureManager.prototype.loadTexture2D = function (textureId, textureUniform) {\n  if (defined(textureUniform.typedArray)) {\n    this._loadedImages.push({\n      id: textureId,\n      textureUniform: textureUniform,\n    });\n  } else {\n    fetchTexture2D(this, textureId, textureUniform);\n  }\n};\n\nfunction createTexture(textureManager, loadedImage, context) {\n  const { id, textureUniform, image } = loadedImage;\n\n  // If the context is WebGL1, and the sampler needs mipmaps or repeating\n  // boundary conditions, the image may need to be resized first\n  const texture = context.webgl2\n    ? getTextureAndMips(textureUniform, image, context)\n    : getWebGL1Texture(textureUniform, image, context);\n\n  // Destroy the old texture once the new one is loaded for more seamless\n  // transitions between values\n  const oldTexture = textureManager._textures[id];\n  if (defined(oldTexture) && oldTexture !== context.defaultTexture) {\n    oldTexture.destroy();\n  }\n  textureManager._textures[id] = texture;\n}\n\nfunction getTextureAndMips(textureUniform, image, context) {\n  const { typedArray, sampler } = textureUniform;\n\n  const texture = defined(typedArray)\n    ? getTextureFromTypedArray(textureUniform, context)\n    : new Texture({ context, source: image, sampler });\n\n  if (samplerRequiresMipmap(sampler)) {\n    texture.generateMipmap();\n  }\n\n  return texture;\n}\n\nfunction getWebGL1Texture(textureUniform, image, context) {\n  const { typedArray, sampler } = textureUniform;\n\n  // WebGL1 requires power-of-two texture dimensions for mipmapping and REPEAT wrap modes\n  const needMipmap = samplerRequiresMipmap(sampler);\n\n  const samplerRepeats =\n    sampler.wrapS === TextureWrap.REPEAT ||\n    sampler.wrapS === TextureWrap.MIRRORED_REPEAT ||\n    sampler.wrapT === TextureWrap.REPEAT ||\n    sampler.wrapT === TextureWrap.MIRRORED_REPEAT;\n\n  const { width, height } = defined(typedArray) ? textureUniform : image;\n  const isPowerOfTwo = [width, height].every(CesiumMath.isPowerOfTwo);\n  const requiresResize = (needMipmap || samplerRepeats) && !isPowerOfTwo;\n\n  if (!requiresResize) {\n    return getTextureAndMips(textureUniform, image, context);\n  } else if (!defined(typedArray)) {\n    const resizedImage = resizeImageToNextPowerOfTwo(image);\n    return getTextureAndMips(textureUniform, resizedImage, context);\n  } else if (textureUniform.pixelDatatype === PixelDatatype.UNSIGNED_BYTE) {\n    const imageFromArray = getImageFromTypedArray(typedArray, width, height);\n    const resizedImage = resizeImageToNextPowerOfTwo(imageFromArray);\n    return getTextureAndMips({ sampler }, resizedImage, context);\n  }\n\n  // typedArray is non-power-of-two but can't be resized. Warn and return raw texture (no mipmaps)\n  if (needMipmap) {\n    console.warn(\n      \"Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly.\"\n    );\n  } else if (samplerRepeats) {\n    console.warn(\n      \"Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly.\"\n    );\n  }\n  return getTextureFromTypedArray(textureUniform, context);\n}\n\nfunction samplerRequiresMipmap(sampler) {\n  return [\n    TextureMinificationFilter.NEAREST_MIPMAP_NEAREST,\n    TextureMinificationFilter.NEAREST_MIPMAP_LINEAR,\n    TextureMinificationFilter.LINEAR_MIPMAP_NEAREST,\n    TextureMinificationFilter.LINEAR_MIPMAP_LINEAR,\n  ].includes(sampler.minificationFilter);\n}\n\nfunction getTextureFromTypedArray(textureUniform, context) {\n  const {\n    pixelFormat,\n    pixelDatatype,\n    width,\n    height,\n    typedArray: arrayBufferView,\n    sampler,\n  } = textureUniform;\n\n  return new Texture({\n    context,\n    pixelFormat,\n    pixelDatatype,\n    source: { arrayBufferView, width, height },\n    sampler,\n    flipY: false,\n  });\n}\n\nTextureManager.prototype.update = function (frameState) {\n  // update only needs to be called once a frame.\n  if (frameState.frameNumber === this._lastUpdatedFrame) {\n    return;\n  }\n  this._lastUpdatedFrame = frameState.frameNumber;\n\n  const context = frameState.context;\n  this._defaultTexture = context.defaultTexture;\n\n  // If any images were loaded since the last frame, create Textures\n  // for them and store in the uniform dictionary\n  const loadedImages = this._loadedImages;\n  for (let i = 0; i < loadedImages.length; i++) {\n    const loadedImage = loadedImages[i];\n    createTexture(this, loadedImage, context);\n  }\n  loadedImages.length = 0;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see TextureManager#destroy\n * @private\n */\nTextureManager.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * textureManager = textureManager && textureManager.destroy();\n *\n * @see TextureManager#isDestroyed\n * @private\n */\nTextureManager.prototype.destroy = function () {\n  const textures = this._textures;\n  for (const texture in textures) {\n    if (textures.hasOwnProperty(texture)) {\n      const instance = textures[texture];\n      if (instance !== this._defaultTexture) {\n        instance.destroy();\n      }\n    }\n  }\n  return destroyObject(this);\n};\n\nexport default TextureManager;\n", "import Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport CustomShaderMode from \"./CustomShaderMode.js\";\nimport UniformType from \"./UniformType.js\";\nimport TextureManager from \"./TextureManager.js\";\nimport CustomShaderTranslucencyMode from \"./CustomShaderTranslucencyMode.js\";\n\n/**\n * An object describing a uniform, its type, and an initial value\n *\n * @typedef {object} UniformSpecifier\n * @property {UniformType} type The Glsl type of the uniform.\n * @property {boolean|number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4|TextureUniform} value The initial value of the uniform\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n\n/**\n * A set of variables parsed from the user-defined shader code. These can be\n * used for optimizations when generating the overall shader. Though they are\n * represented as JS objects, the intended use is like a set, so only the\n * existence of keys matter. The values will always be <code>true</code> if\n * defined. This data structure is used because:\n * <ul>\n *   <li>We cannot yet use ES6 Set objects</li>\n *   <li>Using a dictionary automatically de-duplicates variable names</li>\n *   <li>Queries such as <code>variableSet.hasOwnProperty(\"position\")</code> are straightforward</li>\n * </ul>\n * @typedef {Object<string, boolean>} VariableSet\n * @private\n */\n\n/**\n * Variable sets parsed from the user-defined vertex shader text.\n * @typedef {object} VertexVariableSets\n * @property {VariableSet} attributeSet A set of all unique attributes used in the vertex shader via the <code>vsInput.attributes</code> struct.\n * @property {VariableSet} featureIdSet A set of all unique feature ID sets used in the vertex shader via the <code>vsInput.featureIds</code> struct.\n * @property {VariableSet} metadataSet A set of all unique metadata properties used in the vertex shader via the <code>vsInput.metadata</code> struct.\n * @private\n */\n\n/**\n * Variable sets parsed from the user-defined fragment shader text.\n * @typedef {object} FragmentVariableSets\n * @property {VariableSet} attributeSet A set of all unique attributes used in the fragment shader via the <code>fsInput.attributes</code> struct\n * @property {VariableSet} featureIdSet A set of all unique feature ID sets used in the fragment shader via the <code>fsInput.featureIds</code> struct.\n * @property {VariableSet} metadataSet A set of all unique metadata properties used in the fragment shader via the <code>fsInput.metadata</code> struct.\n * @property {VariableSet} materialSet A set of all material variables such as diffuse, specular or alpha that are used in the fragment shader via the <code>material</code> struct.\n * @private\n */\n\n/**\n * A user defined GLSL shader used with {@link Model} as well\n * as {@link Cesium3DTileset}.\n * <p>\n * If texture uniforms are used, additional resource management must be done:\n * </p>\n * <ul>\n *   <li>\n *      The <code>update</code> function must be called each frame. When a\n *      custom shader is passed to a {@link Model} or a\n *      {@link Cesium3DTileset}, this step is handled automaticaly\n *   </li>\n *   <li>\n *      {@link CustomShader#destroy} must be called when the custom shader is\n *      no longer needed to clean up GPU resources properly. The application\n *      is responsible for calling this method.\n *   </li>\n * </ul>\n * <p>\n * See the {@link https://github.com/CesiumGS/cesium/tree/main/Documentation/CustomShaderGuide|Custom Shader Guide} for more detailed documentation.\n * </p>\n *\n * @param {object} options An object with the following options\n * @param {CustomShaderMode} [options.mode=CustomShaderMode.MODIFY_MATERIAL] The custom shader mode, which determines how the custom shader code is inserted into the fragment shader.\n * @param {LightingModel} [options.lightingModel] The lighting model (e.g. PBR or unlit). If present, this overrides the default lighting for the model.\n * @param {CustomShaderTranslucencyMode} [options.translucencyMode=CustomShaderTranslucencyMode.INHERIT] The translucency mode, which determines how the custom shader will be applied. If the value is CustomShaderTransulcencyMode.OPAQUE or CustomShaderTransulcencyMode.TRANSLUCENT, the custom shader will override settings from the model's material. If the value is CustomShaderTransulcencyMode.INHERIT, the custom shader will render as either opaque or translucent depending on the primitive's material settings.\n * @param {Object<string, UniformSpecifier>} [options.uniforms] A dictionary for user-defined uniforms. The key is the uniform name that will appear in the GLSL code. The value is an object that describes the uniform type and initial value\n * @param {Object<string, VaryingType>} [options.varyings] A dictionary for declaring additional GLSL varyings used in the shader. The key is the varying name that will appear in the GLSL code. The value is the data type of the varying. For each varying, the declaration will be added to the top of the shader automatically. The caller is responsible for assigning a value in the vertex shader and using the value in the fragment shader.\n * @param {string} [options.vertexShaderText] The custom vertex shader as a string of GLSL code. It must include a GLSL function called vertexMain. See the example for the expected signature. If not specified, the custom vertex shader step will be skipped in the computed vertex shader.\n * @param {string} [options.fragmentShaderText] The custom fragment shader as a string of GLSL code. It must include a GLSL function called fragmentMain. See the example for the expected signature. If not specified, the custom fragment shader step will be skipped in the computed fragment shader.\n *\n * @alias CustomShader\n * @constructor\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const customShader = new CustomShader({\n *   uniforms: {\n *     u_colorIndex: {\n *       type: Cesium.UniformType.FLOAT,\n *       value: 1.0\n *     },\n *     u_normalMap: {\n *       type: Cesium.UniformType.SAMPLER_2D,\n *       value: new Cesium.TextureUniform({\n *         url: \"http://example.com/normal.png\"\n *       })\n *     }\n *   },\n *   varyings: {\n *     v_selectedColor: Cesium.VaryingType.VEC3\n *   },\n *   vertexShaderText: `\n *   void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) {\n *     v_selectedColor = mix(vsInput.attributes.color_0, vsInput.attributes.color_1, u_colorIndex);\n *     vsOutput.positionMC += 0.1 * vsInput.attributes.normal;\n *   }\n *   `,\n *   fragmentShaderText: `\n *   void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {\n *     material.normal = texture(u_normalMap, fsInput.attributes.texCoord_0);\n *     material.diffuse = v_selectedColor;\n *   }\n *   `\n * });\n */\nfunction CustomShader(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * A value determining how the custom shader interacts with the overall\n   * fragment shader. This is used by {@link CustomShaderPipelineStage}\n   *\n   * @type {CustomShaderMode}\n   * @readonly\n   */\n  this.mode = defaultValue(options.mode, CustomShaderMode.MODIFY_MATERIAL);\n  /**\n   * The lighting model to use when using the custom shader.\n   * This is used by {@link CustomShaderPipelineStage}\n   *\n   * @type {LightingModel}\n   * @readonly\n   */\n  this.lightingModel = options.lightingModel;\n  /**\n   * Additional uniforms as declared by the user.\n   *\n   * @type {Object<string, UniformSpecifier>}\n   * @readonly\n   */\n  this.uniforms = defaultValue(options.uniforms, defaultValue.EMPTY_OBJECT);\n  /**\n   * Additional varyings as declared by the user.\n   * This is used by {@link CustomShaderPipelineStage}\n   *\n   * @type {Object<string, VaryingType>}\n   * @readonly\n   */\n  this.varyings = defaultValue(options.varyings, defaultValue.EMPTY_OBJECT);\n  /**\n   * The user-defined GLSL code for the vertex shader\n   *\n   * @type {string}\n   * @readonly\n   */\n  this.vertexShaderText = options.vertexShaderText;\n  /**\n   * The user-defined GLSL code for the fragment shader\n   *\n   * @type {string}\n   * @readonly\n   */\n  this.fragmentShaderText = options.fragmentShaderText;\n\n  /**\n   * The translucency mode, which determines how the custom shader will be applied. If the value is\n   * CustomShaderTransulcencyMode.OPAQUE or CustomShaderTransulcencyMode.TRANSLUCENT, the custom shader\n   * will override settings from the model's material. If the value isCustomShaderTransulcencyMode.INHERIT,\n   * the custom shader will render as either opaque or translucent depending on the primitive's material settings.\n   *\n   * @type {CustomShaderTranslucencyMode}\n   * @default CustomShaderTranslucencyMode.INHERIT\n   * @readonly\n   */\n  this.translucencyMode = defaultValue(\n    options.translucencyMode,\n    CustomShaderTranslucencyMode.INHERIT\n  );\n\n  /**\n   * texture uniforms require some asynchronous processing. This is delegated\n   * to a texture manager.\n   *\n   * @type {TextureManager}\n   * @readonly\n   * @private\n   */\n  this._textureManager = new TextureManager();\n  /**\n   * The default texture (from the {@link Context}) to use while textures\n   * are loading\n   *\n   * @type {Texture}\n   * @readonly\n   * @private\n   */\n  this._defaultTexture = undefined;\n  /**\n   * The map of uniform names to a function that returns a value. This map\n   * is combined with the overall uniform map used by the {@link DrawCommand}\n   *\n   * @type {Object<string, Function>}\n   * @readonly\n   * @private\n   */\n  this.uniformMap = buildUniformMap(this);\n\n  /**\n   * A collection of variables used in <code>vertexShaderText</code>. This\n   * is used only for optimizations in {@link CustomShaderPipelineStage}.\n   * @type {VertexVariableSets}\n   * @private\n   */\n  this.usedVariablesVertex = {\n    attributeSet: {},\n    featureIdSet: {},\n    metadataSet: {},\n  };\n  /**\n   * A collection of variables used in <code>fragmentShaderText</code>. This\n   * is used only for optimizations in {@link CustomShaderPipelineStage}.\n   * @type {FragmentVariableSets}\n   * @private\n   */\n  this.usedVariablesFragment = {\n    attributeSet: {},\n    featureIdSet: {},\n    metadataSet: {},\n    materialSet: {},\n  };\n\n  findUsedVariables(this);\n  validateBuiltinVariables(this);\n}\n\nfunction buildUniformMap(customShader) {\n  const uniforms = customShader.uniforms;\n  const uniformMap = {};\n  for (const uniformName in uniforms) {\n    if (uniforms.hasOwnProperty(uniformName)) {\n      const uniform = uniforms[uniformName];\n      const type = uniform.type;\n      //>>includeStart('debug', pragmas.debug);\n      if (type === UniformType.SAMPLER_CUBE) {\n        throw new DeveloperError(\n          \"CustomShader does not support samplerCube uniforms\"\n        );\n      }\n      //>>includeEnd('debug');\n\n      if (type === UniformType.SAMPLER_2D) {\n        customShader._textureManager.loadTexture2D(uniformName, uniform.value);\n        uniformMap[uniformName] = createUniformTexture2DFunction(\n          customShader,\n          uniformName\n        );\n      } else {\n        uniformMap[uniformName] = createUniformFunction(\n          customShader,\n          uniformName\n        );\n      }\n    }\n  }\n  return uniformMap;\n}\n\nfunction createUniformTexture2DFunction(customShader, uniformName) {\n  return function () {\n    return defaultValue(\n      customShader._textureManager.getTexture(uniformName),\n      customShader._defaultTexture\n    );\n  };\n}\n\nfunction createUniformFunction(customShader, uniformName) {\n  return function () {\n    return customShader.uniforms[uniformName].value;\n  };\n}\n\nfunction getVariables(shaderText, regex, outputSet) {\n  let match;\n  while ((match = regex.exec(shaderText)) !== null) {\n    const variableName = match[1];\n\n    // Using a dictionary like a set. The value doesn't\n    // matter, as this will only be used for queries such as\n    // if (set.hasOwnProperty(variableName)) { ... }\n    outputSet[variableName] = true;\n  }\n}\n\nfunction findUsedVariables(customShader) {\n  const attributeRegex = /[vf]sInput\\.attributes\\.(\\w+)/g;\n  const featureIdRegex = /[vf]sInput\\.featureIds\\.(\\w+)/g;\n  const metadataRegex = /[vf]sInput\\.metadata.(\\w+)/g;\n  let attributeSet;\n\n  const vertexShaderText = customShader.vertexShaderText;\n  if (defined(vertexShaderText)) {\n    attributeSet = customShader.usedVariablesVertex.attributeSet;\n    getVariables(vertexShaderText, attributeRegex, attributeSet);\n\n    attributeSet = customShader.usedVariablesVertex.featureIdSet;\n    getVariables(vertexShaderText, featureIdRegex, attributeSet);\n\n    attributeSet = customShader.usedVariablesVertex.metadataSet;\n    getVariables(vertexShaderText, metadataRegex, attributeSet);\n  }\n\n  const fragmentShaderText = customShader.fragmentShaderText;\n  if (defined(fragmentShaderText)) {\n    attributeSet = customShader.usedVariablesFragment.attributeSet;\n    getVariables(fragmentShaderText, attributeRegex, attributeSet);\n\n    attributeSet = customShader.usedVariablesFragment.featureIdSet;\n    getVariables(fragmentShaderText, featureIdRegex, attributeSet);\n\n    attributeSet = customShader.usedVariablesFragment.metadataSet;\n    getVariables(fragmentShaderText, metadataRegex, attributeSet);\n\n    const materialRegex = /material\\.(\\w+)/g;\n    const materialSet = customShader.usedVariablesFragment.materialSet;\n    getVariables(fragmentShaderText, materialRegex, materialSet);\n  }\n}\n\nfunction expandCoordinateAbbreviations(variableName) {\n  const modelCoordinatesRegex = /^.*MC$/;\n  const worldCoordinatesRegex = /^.*WC$/;\n  const eyeCoordinatesRegex = /^.*EC$/;\n\n  if (modelCoordinatesRegex.test(variableName)) {\n    return `${variableName} (model coordinates)`;\n  }\n\n  if (worldCoordinatesRegex.test(variableName)) {\n    return `${variableName} (Cartesian world coordinates)`;\n  }\n\n  if (eyeCoordinatesRegex.test(variableName)) {\n    return `${variableName} (eye coordinates)`;\n  }\n\n  return variableName;\n}\n\nfunction validateVariableUsage(\n  variableSet,\n  incorrectVariable,\n  correctVariable,\n  vertexOrFragment\n) {\n  if (variableSet.hasOwnProperty(incorrectVariable)) {\n    const message = `${expandCoordinateAbbreviations(\n      incorrectVariable\n    )} is not available in the ${vertexOrFragment} shader. Did you mean ${expandCoordinateAbbreviations(\n      correctVariable\n    )} instead?`;\n    throw new DeveloperError(message);\n  }\n}\n\nfunction validateBuiltinVariables(customShader) {\n  const attributesVS = customShader.usedVariablesVertex.attributeSet;\n\n  // names without MC/WC/EC are ambiguous\n  validateVariableUsage(attributesVS, \"position\", \"positionMC\", \"vertex\");\n  validateVariableUsage(attributesVS, \"normal\", \"normalMC\", \"vertex\");\n  validateVariableUsage(attributesVS, \"tangent\", \"tangentMC\", \"vertex\");\n  validateVariableUsage(attributesVS, \"bitangent\", \"bitangentMC\", \"vertex\");\n\n  // world and eye coordinate positions are only available in the fragment shader.\n  validateVariableUsage(attributesVS, \"positionWC\", \"positionMC\", \"vertex\");\n  validateVariableUsage(attributesVS, \"positionEC\", \"positionMC\", \"vertex\");\n\n  // normal, tangent and bitangent are in model coordinates in the vertex shader\n  validateVariableUsage(attributesVS, \"normalEC\", \"normalMC\", \"vertex\");\n  validateVariableUsage(attributesVS, \"tangentEC\", \"tangentMC\", \"vertex\");\n  validateVariableUsage(attributesVS, \"bitangentEC\", \"bitangentMC\", \"vertex\");\n\n  const attributesFS = customShader.usedVariablesFragment.attributeSet;\n\n  // names without MC/WC/EC are ambiguous\n  validateVariableUsage(attributesFS, \"position\", \"positionEC\", \"fragment\");\n  validateVariableUsage(attributesFS, \"normal\", \"normalEC\", \"fragment\");\n  validateVariableUsage(attributesFS, \"tangent\", \"tangentEC\", \"fragment\");\n  validateVariableUsage(attributesFS, \"bitangent\", \"bitangentEC\", \"fragment\");\n\n  // normal, tangent, and bitangent are in eye coordinates in the fragment\n  // shader.\n  validateVariableUsage(attributesFS, \"normalMC\", \"normalEC\", \"fragment\");\n  validateVariableUsage(attributesFS, \"tangentMC\", \"tangentEC\", \"fragment\");\n  validateVariableUsage(attributesFS, \"bitangentMC\", \"bitangentEC\", \"fragment\");\n}\n\n/**\n * Update the value of a uniform declared in the shader\n * @param {string} uniformName The GLSL name of the uniform. This must match one of the uniforms declared in the constructor\n * @param {boolean|number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4|string|Resource|TextureUniform} value The new value of the uniform.\n */\nCustomShader.prototype.setUniform = function (uniformName, value) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"uniformName\", uniformName);\n  Check.defined(\"value\", value);\n  if (!defined(this.uniforms[uniformName])) {\n    throw new DeveloperError(\n      `Uniform ${uniformName} must be declared in the CustomShader constructor.`\n    );\n  }\n  //>>includeEnd('debug');\n  const uniform = this.uniforms[uniformName];\n  if (uniform.type === UniformType.SAMPLER_2D) {\n    // Textures are loaded asynchronously\n    this._textureManager.loadTexture2D(uniformName, value);\n  } else if (defined(value.clone)) {\n    // clone Cartesian and Matrix types.\n    uniform.value = value.clone(uniform.value);\n  } else {\n    uniform.value = value;\n  }\n};\n\nCustomShader.prototype.update = function (frameState) {\n  this._defaultTexture = frameState.context.defaultTexture;\n  this._textureManager.update(frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} True if this object was destroyed; otherwise, false.\n *\n * @see CustomShader#destroy\n * @private\n */\nCustomShader.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * customShader = customShader && customShader.destroy();\n *\n * @see CustomShader#isDestroyed\n * @private\n */\nCustomShader.prototype.destroy = function () {\n  this._textureManager = this._textureManager && this._textureManager.destroy();\n  destroyObject(this);\n};\n\nexport default CustomShader;\n", "import buildVoxelDrawCommands from \"./buildVoxelDrawCommands.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Event from \"../Core/Event.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport ClippingPlaneCollection from \"./ClippingPlaneCollection.js\";\nimport Material from \"./Material.js\";\nimport MetadataComponentType from \"./MetadataComponentType.js\";\nimport MetadataType from \"./MetadataType.js\";\nimport PolylineCollection from \"./PolylineCollection.js\";\nimport VoxelShapeType from \"./VoxelShapeType.js\";\nimport VoxelTraversal from \"./VoxelTraversal.js\";\nimport CustomShader from \"./Model/CustomShader.js\";\n\n/**\n * A primitive that renders voxel data from a {@link VoxelProvider}.\n *\n * @alias VoxelPrimitive\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {VoxelProvider} [options.provider] The voxel provider that supplies the primitive with tile data.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The model matrix used to transform the primitive.\n * @param {CustomShader} [options.customShader] The custom shader used to style the primitive.\n * @param {Clock} [options.clock] The clock used to control time dynamic behavior.\n *\n * @see VoxelProvider\n * @see Cesium3DTilesVoxelProvider\n * @see VoxelShapeType\n *\n * @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction VoxelPrimitive(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * @type {boolean}\n   * @private\n   */\n  this._ready = false;\n\n  /**\n   * @type {VoxelProvider}\n   * @private\n   */\n  this._provider = defaultValue(\n    options.provider,\n    VoxelPrimitive.DefaultProvider\n  );\n\n  /**\n   * This member is not created until the provider and shape are ready.\n   *\n   * @type {VoxelTraversal}\n   * @private\n   */\n  this._traversal = undefined;\n\n  /**\n   * This member is not created until the provider is ready.\n   *\n   * @type {VoxelShape}\n   * @private\n   */\n  this._shape = undefined;\n\n  /**\n   * @type {boolean}\n   * @private\n   */\n  this._shapeVisible = false;\n\n  /**\n   * This member is not created until the provider is ready.\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this._paddingBefore = new Cartesian3();\n\n  /**\n   * This member is not created until the provider is ready.\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this._paddingAfter = new Cartesian3();\n\n  /**\n   * This member is not known until the provider is ready.\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this._minBounds = new Cartesian3();\n\n  /**\n   * Used to detect if the shape is dirty.\n   * This member is not known until the provider is ready.\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this._minBoundsOld = new Cartesian3();\n\n  /**\n   * This member is not known until the provider is ready.\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this._maxBounds = new Cartesian3();\n\n  /**\n   * Used to detect if the shape is dirty.\n   * This member is not known until the provider is ready.\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this._maxBoundsOld = new Cartesian3();\n\n  /**\n   * Minimum bounds with vertical exaggeration applied\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this._exaggeratedMinBounds = new Cartesian3();\n\n  /**\n   * Used to detect if the shape is dirty.\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this._exaggeratedMinBoundsOld = new Cartesian3();\n\n  /**\n   * Maximum bounds with vertical exaggeration applied\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this._exaggeratedMaxBounds = new Cartesian3();\n\n  /**\n   * Used to detect if the shape is dirty.\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this._exaggeratedMaxBoundsOld = new Cartesian3();\n\n  /**\n   * This member is not known until the provider is ready.\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this._minClippingBounds = new Cartesian3();\n\n  /**\n   * Used to detect if the clipping is dirty.\n   * This member is not known until the provider is ready.\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this._minClippingBoundsOld = new Cartesian3();\n\n  /**\n   * This member is not known until the provider is ready.\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this._maxClippingBounds = new Cartesian3();\n\n  /**\n   * Used to detect if the clipping is dirty.\n   * This member is not known until the provider is ready.\n   *\n   * @type {Cartesian3}\n   * @private\n   */\n  this._maxClippingBoundsOld = new Cartesian3();\n\n  /**\n   * Clipping planes on the primitive\n   *\n   * @type {ClippingPlaneCollection}\n   * @private\n   */\n  this._clippingPlanes = undefined;\n\n  /**\n   * Keeps track of when the clipping planes change\n   *\n   * @type {number}\n   * @private\n   */\n  this._clippingPlanesState = 0;\n\n  /**\n   * Keeps track of when the clipping planes are enabled / disabled\n   *\n   * @type {boolean}\n   * @private\n   */\n  this._clippingPlanesEnabled = false;\n\n  /**\n   * The primitive's model matrix.\n   *\n   * @type {Matrix4}\n   * @private\n   */\n  this._modelMatrix = Matrix4.clone(\n    defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n  );\n\n  /**\n   * The primitive's model matrix multiplied by the provider's model matrix.\n   * This member is not known until the provider is ready.\n   *\n   * @type {Matrix4}\n   * @private\n   */\n  this._compoundModelMatrix = new Matrix4();\n\n  /**\n   * Used to detect if the shape is dirty.\n   * This member is not known until the provider is ready.\n   *\n   * @type {Matrix4}\n   * @private\n   */\n  this._compoundModelMatrixOld = new Matrix4();\n\n  /**\n   * @type {CustomShader}\n   * @private\n   */\n  this._customShader = defaultValue(\n    options.customShader,\n    VoxelPrimitive.DefaultCustomShader\n  );\n\n  /**\n   * @type {Event}\n   * @private\n   */\n  this._customShaderCompilationEvent = new Event();\n\n  /**\n   * @type {boolean}\n   * @private\n   */\n  this._shaderDirty = true;\n\n  /**\n   * @type {DrawCommand}\n   * @private\n   */\n  this._drawCommand = undefined;\n\n  /**\n   * @type {DrawCommand}\n   * @private\n   */\n  this._drawCommandPick = undefined;\n\n  /**\n   * @type {object}\n   * @private\n   */\n  this._pickId = undefined;\n\n  /**\n   * @type {Clock}\n   * @private\n   */\n  this._clock = options.clock;\n\n  // Transforms and other values that are computed when the shape changes\n\n  /**\n   * @type {Matrix4}\n   * @private\n   */\n  this._transformPositionWorldToUv = new Matrix4();\n\n  /**\n   * @type {Matrix4}\n   * @private\n   */\n  this._transformPositionUvToWorld = new Matrix4();\n\n  /**\n   * @type {Matrix3}\n   * @private\n   */\n  this._transformDirectionWorldToLocal = new Matrix3();\n\n  /**\n   * @type {Matrix3}\n   * @private\n   */\n  this._transformNormalLocalToWorld = new Matrix3();\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._stepSizeUv = 1.0;\n\n  // Rendering\n  /**\n   * @type {boolean}\n   * @private\n   */\n  this._jitter = true;\n\n  /**\n   * @type {boolean}\n   * @private\n   */\n  this._nearestSampling = false;\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._levelBlendFactor = 0.0;\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._stepSizeMultiplier = 1.0;\n\n  /**\n   * @type {boolean}\n   * @private\n   */\n  this._depthTest = true;\n\n  /**\n   * @type {boolean}\n   * @private\n   */\n  this._useLogDepth = undefined;\n\n  /**\n   * @type {number}\n   * @private\n   */\n  this._screenSpaceError = 4.0; // in pixels\n\n  // Debug / statistics\n  /**\n   * @type {PolylineCollection}\n   * @private\n   */\n  this._debugPolylines = new PolylineCollection();\n\n  /**\n   * @type {boolean}\n   * @private\n   */\n  this._debugDraw = false;\n\n  /**\n   * @type {boolean}\n   * @private\n   */\n  this._disableRender = false;\n\n  /**\n   * @type {boolean}\n   * @private\n   */\n  this._disableUpdate = false;\n\n  /**\n   * @type {Object<string, any>}\n   * @private\n   */\n  this._uniforms = {\n    octreeInternalNodeTexture: undefined,\n    octreeInternalNodeTilesPerRow: 0,\n    octreeInternalNodeTexelSizeUv: new Cartesian2(),\n    octreeLeafNodeTexture: undefined,\n    octreeLeafNodeTilesPerRow: 0,\n    octreeLeafNodeTexelSizeUv: new Cartesian2(),\n    megatextureTextures: [],\n    megatextureSliceDimensions: new Cartesian2(),\n    megatextureTileDimensions: new Cartesian2(),\n    megatextureVoxelSizeUv: new Cartesian2(),\n    megatextureSliceSizeUv: new Cartesian2(),\n    megatextureTileSizeUv: new Cartesian2(),\n    dimensions: new Cartesian3(),\n    paddingBefore: new Cartesian3(),\n    paddingAfter: new Cartesian3(),\n    transformPositionViewToUv: new Matrix4(),\n    transformPositionUvToView: new Matrix4(),\n    transformDirectionViewToLocal: new Matrix3(),\n    transformNormalLocalToWorld: new Matrix3(),\n    cameraPositionUv: new Cartesian3(),\n    ndcSpaceAxisAlignedBoundingBox: new Cartesian4(),\n    clippingPlanesTexture: undefined,\n    clippingPlanesMatrix: new Matrix4(),\n    stepSize: 0,\n    pickColor: new Color(),\n  };\n\n  /**\n   * Shape specific shader defines from the previous shape update. Used to detect if the shader needs to be rebuilt.\n   * @type {Object<string, any>}\n   * @private\n   */\n  this._shapeDefinesOld = {};\n\n  /**\n   * Map uniform names to functions that return the uniform values.\n   * @type {Object<string, function():any>}\n   * @private\n   */\n  this._uniformMap = {};\n\n  const uniforms = this._uniforms;\n  const uniformMap = this._uniformMap;\n  for (const key in uniforms) {\n    if (uniforms.hasOwnProperty(key)) {\n      const name = `u_${key}`;\n      uniformMap[name] = function () {\n        return uniforms[key];\n      };\n    }\n  }\n\n  // If the provider fails to initialize the primitive will fail too.\n  const provider = this._provider;\n  initialize(this, provider);\n}\n\nfunction initialize(primitive, provider) {\n  // Set the bounds\n  const {\n    shape: shapeType,\n    minBounds = VoxelShapeType.getMinBounds(shapeType),\n    maxBounds = VoxelShapeType.getMaxBounds(shapeType),\n  } = provider;\n\n  primitive.minBounds = minBounds;\n  primitive.maxBounds = maxBounds;\n  primitive.minClippingBounds = VoxelShapeType.getMinBounds(shapeType);\n  primitive.maxClippingBounds = VoxelShapeType.getMaxBounds(shapeType);\n\n  checkTransformAndBounds(primitive, provider);\n\n  // Create the shape object, and update it so it is valid for VoxelTraversal\n  const ShapeConstructor = VoxelShapeType.getShapeConstructor(shapeType);\n  primitive._shape = new ShapeConstructor();\n  updateVerticalExaggeration(primitive);\n  primitive._shapeVisible = updateShapeAndTransforms(\n    primitive,\n    primitive._shape,\n    provider\n  );\n}\n\nObject.defineProperties(VoxelPrimitive.prototype, {\n  /**\n   * Gets a value indicating whether or not the primitive is ready for use.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {boolean}\n   * @readonly\n   */\n  ready: {\n    get: function () {\n      return this._ready;\n    },\n  },\n\n  /**\n   * Gets the {@link VoxelProvider} associated with this primitive.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {VoxelProvider}\n   * @readonly\n   */\n  provider: {\n    get: function () {\n      return this._provider;\n    },\n  },\n\n  /**\n   * Gets the bounding sphere.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {BoundingSphere}\n   * @readonly\n   */\n  boundingSphere: {\n    get: function () {\n      return this._shape.boundingSphere;\n    },\n  },\n\n  /**\n   * Gets the oriented bounding box.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {OrientedBoundingBox}\n   * @readonly\n   */\n  orientedBoundingBox: {\n    get: function () {\n      return this.shape.orientedBoundingBox;\n    },\n  },\n\n  /**\n   * Gets the model matrix.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {Matrix4}\n   * @readonly\n   */\n  modelMatrix: {\n    get: function () {\n      return this._modelMatrix;\n    },\n    set: function (modelMatrix) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.object(\"modelMatrix\", modelMatrix);\n      //>>includeEnd('debug');\n\n      this._modelMatrix = Matrix4.clone(modelMatrix, this._modelMatrix);\n    },\n  },\n\n  /**\n   * Gets the shape type.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {VoxelShapeType}\n   * @readonly\n   */\n  shape: {\n    get: function () {\n      return this._provider.shape;\n    },\n  },\n\n  /**\n   * Gets the voxel dimensions.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {Cartesian3}\n   * @readonly\n   */\n  dimensions: {\n    get: function () {\n      return this._provider.dimensions;\n    },\n  },\n\n  /**\n   * Gets the minimum value per channel of the voxel data.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {number[][]}\n   * @readonly\n   */\n  minimumValues: {\n    get: function () {\n      return this._provider.minimumValues;\n    },\n  },\n\n  /**\n   * Gets the maximum value per channel of the voxel data.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {number[][]}\n   * @readonly\n   */\n  maximumValues: {\n    get: function () {\n      return this._provider.maximumValues;\n    },\n  },\n\n  /**\n   * Gets or sets whether or not this primitive should be displayed.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {boolean}\n   */\n  show: {\n    get: function () {\n      return !this._disableRender;\n    },\n    set: function (show) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.bool(\"show\", show);\n      //>>includeEnd('debug');\n\n      this._disableRender = !show;\n    },\n  },\n\n  /**\n   * Gets or sets whether or not the primitive should update when the view changes.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {boolean}\n   */\n  disableUpdate: {\n    get: function () {\n      return this._disableUpdate;\n    },\n    set: function (disableUpdate) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.bool(\"disableUpdate\", disableUpdate);\n      //>>includeEnd('debug');\n\n      this._disableUpdate = disableUpdate;\n    },\n  },\n\n  /**\n   * Gets or sets whether or not to render debug visualizations.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {boolean}\n   */\n  debugDraw: {\n    get: function () {\n      return this._debugDraw;\n    },\n    set: function (debugDraw) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.bool(\"debugDraw\", debugDraw);\n      //>>includeEnd('debug');\n\n      this._debugDraw = debugDraw;\n    },\n  },\n\n  /**\n   * Gets or sets whether or not to test against depth when rendering.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {boolean}\n   */\n  depthTest: {\n    get: function () {\n      return this._depthTest;\n    },\n    set: function (depthTest) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.bool(\"depthTest\", depthTest);\n      //>>includeEnd('debug');\n\n      if (this._depthTest !== depthTest) {\n        this._depthTest = depthTest;\n        this._shaderDirty = true;\n      }\n    },\n  },\n\n  /**\n   * Gets or sets whether or not to jitter the view ray during the raymarch.\n   * This reduces stair-step artifacts but introduces noise.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {boolean}\n   */\n  jitter: {\n    get: function () {\n      return this._jitter;\n    },\n    set: function (jitter) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.bool(\"jitter\", jitter);\n      //>>includeEnd('debug');\n\n      if (this._jitter !== jitter) {\n        this._jitter = jitter;\n        this._shaderDirty = true;\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the nearest sampling.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {boolean}\n   */\n  nearestSampling: {\n    get: function () {\n      return this._nearestSampling;\n    },\n    set: function (nearestSampling) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.bool(\"nearestSampling\", nearestSampling);\n      //>>includeEnd('debug');\n\n      if (this._nearestSampling !== nearestSampling) {\n        this._nearestSampling = nearestSampling;\n        this._shaderDirty = true;\n      }\n    },\n  },\n\n  /**\n   * Controls how quickly to blend between different levels of the tree.\n   * 0.0 means an instantaneous pop.\n   * 1.0 means a full linear blend.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {number}\n   * @private\n   */\n  levelBlendFactor: {\n    get: function () {\n      return this._levelBlendFactor;\n    },\n    set: function (levelBlendFactor) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number(\"levelBlendFactor\", levelBlendFactor);\n      //>>includeEnd('debug');\n\n      this._levelBlendFactor = CesiumMath.clamp(levelBlendFactor, 0.0, 1.0);\n    },\n  },\n\n  /**\n   * Gets or sets the screen space error in pixels. If the screen space size\n   * of a voxel is greater than the screen space error, the tile is subdivided.\n   * Lower screen space error corresponds with higher detail rendering, but could\n   * result in worse performance and higher memory consumption.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {number}\n   */\n  screenSpaceError: {\n    get: function () {\n      return this._screenSpaceError;\n    },\n    set: function (screenSpaceError) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number(\"screenSpaceError\", screenSpaceError);\n      //>>includeEnd('debug');\n\n      this._screenSpaceError = screenSpaceError;\n    },\n  },\n\n  /**\n   * Gets or sets the step size multiplier used during raymarching.\n   * The lower the value, the higher the rendering quality, but\n   * also the worse the performance.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {number}\n   */\n  stepSize: {\n    get: function () {\n      return this._stepSizeMultiplier;\n    },\n    set: function (stepSize) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.typeOf.number(\"stepSize\", stepSize);\n      //>>includeEnd('debug');\n\n      this._stepSizeMultiplier = stepSize;\n    },\n  },\n\n  /**\n   * Gets or sets the minimum bounds in the shape's local coordinate system.\n   * Voxel data is stretched or squashed to fit the bounds.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {Cartesian3}\n   */\n  minBounds: {\n    get: function () {\n      return this._minBounds;\n    },\n    set: function (minBounds) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"minBounds\", minBounds);\n      //>>includeEnd('debug');\n\n      this._minBounds = Cartesian3.clone(minBounds, this._minBounds);\n    },\n  },\n\n  /**\n   * Gets or sets the maximum bounds in the shape's local coordinate system.\n   * Voxel data is stretched or squashed to fit the bounds.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {Cartesian3}\n   */\n  maxBounds: {\n    get: function () {\n      return this._maxBounds;\n    },\n    set: function (maxBounds) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"maxBounds\", maxBounds);\n      //>>includeEnd('debug');\n\n      this._maxBounds = Cartesian3.clone(maxBounds, this._maxBounds);\n    },\n  },\n\n  /**\n   * Gets or sets the minimum clipping location in the shape's local coordinate system.\n   * Any voxel content outside the range is clipped.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {Cartesian3}\n   */\n  minClippingBounds: {\n    get: function () {\n      return this._minClippingBounds;\n    },\n    set: function (minClippingBounds) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"minClippingBounds\", minClippingBounds);\n      //>>includeEnd('debug');\n\n      this._minClippingBounds = Cartesian3.clone(\n        minClippingBounds,\n        this._minClippingBounds\n      );\n    },\n  },\n\n  /**\n   * Gets or sets the maximum clipping location in the shape's local coordinate system.\n   * Any voxel content outside the range is clipped.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {Cartesian3}\n   */\n  maxClippingBounds: {\n    get: function () {\n      return this._maxClippingBounds;\n    },\n    set: function (maxClippingBounds) {\n      //>>includeStart('debug', pragmas.debug);\n      Check.defined(\"maxClippingBounds\", maxClippingBounds);\n      //>>includeEnd('debug');\n\n      this._maxClippingBounds = Cartesian3.clone(\n        maxClippingBounds,\n        this._maxClippingBounds\n      );\n    },\n  },\n\n  /**\n   * The {@link ClippingPlaneCollection} used to selectively disable rendering the primitive.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {ClippingPlaneCollection}\n   */\n  clippingPlanes: {\n    get: function () {\n      return this._clippingPlanes;\n    },\n    set: function (clippingPlanes) {\n      // Don't need to check if undefined, it's handled in the setOwner function\n      ClippingPlaneCollection.setOwner(clippingPlanes, this, \"_clippingPlanes\");\n    },\n  },\n\n  /**\n   * Gets or sets the custom shader. If undefined, {@link VoxelPrimitive.DefaultCustomShader} is set.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {CustomShader}\n   */\n  customShader: {\n    get: function () {\n      return this._customShader;\n    },\n    set: function (customShader) {\n      if (this._customShader !== customShader) {\n        // Delete old custom shader entries from the uniform map\n        const uniformMap = this._uniformMap;\n        const oldCustomShader = this._customShader;\n        const oldCustomShaderUniformMap = oldCustomShader.uniformMap;\n        for (const uniformName in oldCustomShaderUniformMap) {\n          if (oldCustomShaderUniformMap.hasOwnProperty(uniformName)) {\n            // If the custom shader was set but the voxel shader was never\n            // built, the custom shader uniforms wouldn't have been added to\n            // the uniform map. But it doesn't matter because the delete\n            // operator ignores if the key doesn't exist.\n            delete uniformMap[uniformName];\n          }\n        }\n\n        if (!defined(customShader)) {\n          this._customShader = VoxelPrimitive.DefaultCustomShader;\n        } else {\n          this._customShader = customShader;\n        }\n        this._shaderDirty = true;\n      }\n    },\n  },\n\n  /**\n   * Gets an event that is raised whenever a custom shader is compiled.\n   *\n   * @memberof VoxelPrimitive.prototype\n   * @type {Event}\n   * @readonly\n   */\n  customShaderCompilationEvent: {\n    get: function () {\n      return this._customShaderCompilationEvent;\n    },\n  },\n});\n\nconst scratchDimensions = new Cartesian3();\nconst scratchIntersect = new Cartesian4();\nconst scratchNdcAabb = new Cartesian4();\nconst scratchScale = new Cartesian3();\nconst scratchLocalScale = new Cartesian3();\nconst scratchRotation = new Matrix3();\nconst scratchRotationAndLocalScale = new Matrix3();\nconst scratchTransformPositionWorldToLocal = new Matrix4();\nconst scratchTransformPositionLocalToWorld = new Matrix4();\nconst scratchTransformPositionLocalToProjection = new Matrix4();\n\nconst transformPositionLocalToUv = Matrix4.fromRotationTranslation(\n  Matrix3.fromUniformScale(0.5, new Matrix3()),\n  new Cartesian3(0.5, 0.5, 0.5),\n  new Matrix4()\n);\nconst transformPositionUvToLocal = Matrix4.fromRotationTranslation(\n  Matrix3.fromUniformScale(2.0, new Matrix3()),\n  new Cartesian3(-1.0, -1.0, -1.0),\n  new Matrix4()\n);\n\n/**\n * Updates the voxel primitive.\n *\n * @param {FrameState} frameState\n * @private\n */\nVoxelPrimitive.prototype.update = function (frameState) {\n  const provider = this._provider;\n\n  // Update the custom shader in case it has texture uniforms.\n  this._customShader.update(frameState);\n\n  // Initialize from the ready provider. This only happens once.\n  const context = frameState.context;\n  if (!this._ready) {\n    initFromProvider(this, provider, context);\n    // Set the primitive as ready after the first frame render since the user might set up events subscribed to\n    // the post render event, and the primitive may not be ready for those past the first frame.\n    frameState.afterRender.push(() => {\n      this._ready = true;\n      return true;\n    });\n\n    // Don't render until the next frame after ready is set to true\n    return;\n  }\n\n  updateVerticalExaggeration(this, frameState);\n\n  // Check if the shape is dirty before updating it. This needs to happen every\n  // frame because the member variables can be modified externally via the\n  // getters.\n  const shapeDirty = checkTransformAndBounds(this, provider);\n  const shape = this._shape;\n  if (shapeDirty) {\n    this._shapeVisible = updateShapeAndTransforms(this, shape, provider);\n    if (checkShapeDefines(this, shape)) {\n      this._shaderDirty = true;\n    }\n  }\n  if (!this._shapeVisible) {\n    return;\n  }\n\n  // Update the traversal and prepare for rendering.\n  const keyframeLocation = getKeyframeLocation(\n    provider.timeIntervalCollection,\n    this._clock\n  );\n\n  const traversal = this._traversal;\n  const sampleCountOld = traversal._sampleCount;\n\n  traversal.update(\n    frameState,\n    keyframeLocation,\n    shapeDirty, // recomputeBoundingVolumes\n    this._disableUpdate // pauseUpdate\n  );\n\n  if (sampleCountOld !== traversal._sampleCount) {\n    this._shaderDirty = true;\n  }\n\n  if (!traversal.isRenderable(traversal.rootNode)) {\n    return;\n  }\n\n  if (this._debugDraw) {\n    // Debug draw bounding boxes and other things. Must go after traversal update\n    // because that's what updates the tile bounding boxes.\n    debugDraw(this, frameState);\n  }\n\n  if (this._disableRender) {\n    return;\n  }\n\n  // Check if log depth changed\n  if (this._useLogDepth !== frameState.useLogDepth) {\n    this._useLogDepth = frameState.useLogDepth;\n    this._shaderDirty = true;\n  }\n\n  // Check if clipping planes changed\n  const clippingPlanesChanged = updateClippingPlanes(this, frameState);\n  if (clippingPlanesChanged) {\n    this._shaderDirty = true;\n  }\n\n  const leafNodeTexture = traversal.leafNodeTexture;\n  const uniforms = this._uniforms;\n  if (defined(leafNodeTexture)) {\n    uniforms.octreeLeafNodeTexture = traversal.leafNodeTexture;\n    uniforms.octreeLeafNodeTexelSizeUv = Cartesian2.clone(\n      traversal.leafNodeTexelSizeUv,\n      uniforms.octreeLeafNodeTexelSizeUv\n    );\n    uniforms.octreeLeafNodeTilesPerRow = traversal.leafNodeTilesPerRow;\n  }\n\n  // Rebuild shaders\n  if (this._shaderDirty) {\n    buildVoxelDrawCommands(this, context);\n    this._shaderDirty = false;\n  }\n\n  // Calculate the NDC-space AABB to \"scissor\" the fullscreen quad\n  const transformPositionWorldToProjection =\n    context.uniformState.viewProjection;\n  const orientedBoundingBox = shape.orientedBoundingBox;\n  const ndcAabb = orientedBoundingBoxToNdcAabb(\n    orientedBoundingBox,\n    transformPositionWorldToProjection,\n    scratchNdcAabb\n  );\n\n  // If the object is offscreen, don't render it.\n  const offscreen =\n    ndcAabb.x === +1.0 ||\n    ndcAabb.y === +1.0 ||\n    ndcAabb.z === -1.0 ||\n    ndcAabb.w === -1.0;\n  if (offscreen) {\n    return;\n  }\n\n  // Prepare to render: update uniforms that can change every frame\n  // Using a uniform instead of going through RenderState's scissor because the viewport is not accessible here, and the scissor command needs pixel coordinates.\n  uniforms.ndcSpaceAxisAlignedBoundingBox = Cartesian4.clone(\n    ndcAabb,\n    uniforms.ndcSpaceAxisAlignedBoundingBox\n  );\n  const transformPositionViewToWorld = context.uniformState.inverseView;\n  uniforms.transformPositionViewToUv = Matrix4.multiplyTransformation(\n    this._transformPositionWorldToUv,\n    transformPositionViewToWorld,\n    uniforms.transformPositionViewToUv\n  );\n  const transformPositionWorldToView = context.uniformState.view;\n  uniforms.transformPositionUvToView = Matrix4.multiplyTransformation(\n    transformPositionWorldToView,\n    this._transformPositionUvToWorld,\n    uniforms.transformPositionUvToView\n  );\n  const transformDirectionViewToWorld =\n    context.uniformState.inverseViewRotation;\n  uniforms.transformDirectionViewToLocal = Matrix3.multiply(\n    this._transformDirectionWorldToLocal,\n    transformDirectionViewToWorld,\n    uniforms.transformDirectionViewToLocal\n  );\n  uniforms.transformNormalLocalToWorld = Matrix3.clone(\n    this._transformNormalLocalToWorld,\n    uniforms.transformNormalLocalToWorld\n  );\n  const cameraPositionWorld = frameState.camera.positionWC;\n  uniforms.cameraPositionUv = Matrix4.multiplyByPoint(\n    this._transformPositionWorldToUv,\n    cameraPositionWorld,\n    uniforms.cameraPositionUv\n  );\n  uniforms.stepSize = this._stepSizeUv * this._stepSizeMultiplier;\n\n  // Render the primitive\n  const command = frameState.passes.pick\n    ? this._drawCommandPick\n    : this._drawCommand;\n  command.boundingVolume = shape.boundingSphere;\n  frameState.commandList.push(command);\n};\n\n/**\n * Update the exaggerated bounds of a primitive to account for vertical exaggeration\n * Currently only applies to Ellipsoid shape type\n * @param {VoxelPrimitive} primitive\n * @param {FrameState} [frameState]\n * @private\n */\nfunction updateVerticalExaggeration(primitive, frameState) {\n  primitive._exaggeratedMinBounds = Cartesian3.clone(\n    primitive._minBounds,\n    primitive._exaggeratedMinBounds\n  );\n  primitive._exaggeratedMaxBounds = Cartesian3.clone(\n    primitive._maxBounds,\n    primitive._exaggeratedMaxBounds\n  );\n  if (defined(frameState) && primitive.shape === VoxelShapeType.ELLIPSOID) {\n    const relativeHeight = frameState.verticalExaggerationRelativeHeight;\n    const exaggeration = frameState.verticalExaggeration;\n    primitive._exaggeratedMinBounds.z =\n      (primitive._minBounds.z - relativeHeight) * exaggeration + relativeHeight;\n    primitive._exaggeratedMaxBounds.z =\n      (primitive._maxBounds.z - relativeHeight) * exaggeration + relativeHeight;\n  }\n}\n\n/**\n * Initialize primitive properties that are derived from the voxel provider\n * @param {VoxelPrimitive} primitive\n * @param {VoxelProvider} provider\n * @param {Context} context\n * @private\n */\nfunction initFromProvider(primitive, provider, context) {\n  const uniforms = primitive._uniforms;\n\n  primitive._pickId = context.createPickId({ primitive });\n  uniforms.pickColor = Color.clone(primitive._pickId.color, uniforms.pickColor);\n\n  const { shaderDefines, shaderUniforms: shapeUniforms } = primitive._shape;\n  primitive._shapeDefinesOld = clone(shaderDefines, true);\n\n  // Add shape uniforms to the uniform map\n  const uniformMap = primitive._uniformMap;\n  for (const key in shapeUniforms) {\n    if (shapeUniforms.hasOwnProperty(key)) {\n      const name = `u_${key}`;\n\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(uniformMap[name])) {\n        oneTimeWarning(\n          `VoxelPrimitive: Uniform name \"${name}\" is already defined`\n        );\n      }\n      //>>includeEnd('debug');\n\n      uniformMap[name] = function () {\n        return shapeUniforms[key];\n      };\n    }\n  }\n\n  // Set uniforms that come from the provider.\n  // Note that minBounds and maxBounds can be set dynamically, so their uniforms aren't set here.\n  uniforms.dimensions = Cartesian3.clone(\n    provider.dimensions,\n    uniforms.dimensions\n  );\n  primitive._paddingBefore = Cartesian3.clone(\n    defaultValue(provider.paddingBefore, Cartesian3.ZERO),\n    primitive._paddingBefore\n  );\n  uniforms.paddingBefore = Cartesian3.clone(\n    primitive._paddingBefore,\n    uniforms.paddingBefore\n  );\n  primitive._paddingAfter = Cartesian3.clone(\n    defaultValue(provider.paddingAfter, Cartesian3.ZERO),\n    primitive._paddingBefore\n  );\n  uniforms.paddingAfter = Cartesian3.clone(\n    primitive._paddingAfter,\n    uniforms.paddingAfter\n  );\n\n  // Create the VoxelTraversal, and set related uniforms\n  primitive._traversal = setupTraversal(primitive, provider, context);\n  setTraversalUniforms(primitive._traversal, uniforms);\n}\n\n/**\n * Track changes in provider transform and primitive bounds\n * @param {VoxelPrimitive} primitive\n * @param {VoxelProvider} provider\n * @returns {boolean} Whether any of the transform or bounds changed\n * @private\n */\nfunction checkTransformAndBounds(primitive, provider) {\n  const shapeTransform = defaultValue(\n    provider.shapeTransform,\n    Matrix4.IDENTITY\n  );\n  const globalTransform = defaultValue(\n    provider.globalTransform,\n    Matrix4.IDENTITY\n  );\n\n  // Compound model matrix = global transform * model matrix * shape transform\n  Matrix4.multiplyTransformation(\n    globalTransform,\n    primitive._modelMatrix,\n    primitive._compoundModelMatrix\n  );\n  Matrix4.multiplyTransformation(\n    primitive._compoundModelMatrix,\n    shapeTransform,\n    primitive._compoundModelMatrix\n  );\n  const numChanges =\n    updateBound(primitive, \"_compoundModelMatrix\", \"_compoundModelMatrixOld\") +\n    updateBound(primitive, \"_minBounds\", \"_minBoundsOld\") +\n    updateBound(primitive, \"_maxBounds\", \"_maxBoundsOld\") +\n    updateBound(\n      primitive,\n      \"_exaggeratedMinBounds\",\n      \"_exaggeratedMinBoundsOld\"\n    ) +\n    updateBound(\n      primitive,\n      \"_exaggeratedMaxBounds\",\n      \"_exaggeratedMaxBoundsOld\"\n    ) +\n    updateBound(primitive, \"_minClippingBounds\", \"_minClippingBoundsOld\") +\n    updateBound(primitive, \"_maxClippingBounds\", \"_maxClippingBoundsOld\");\n  return numChanges > 0;\n}\n\n/**\n * Compare old and new values of a bound and update the old if it is different.\n * @param {VoxelPrimitive} primitive The primitive with bounds properties\n * @param {string} newBoundKey A key pointing to a bounds property of type Cartesian3 or Matrix4\n * @param {string} oldBoundKey A key pointing to a bounds property of the same type as the property at newBoundKey\n * @returns {number} 1 if the bound value changed, 0 otherwise\n *\n * @private\n */\nfunction updateBound(primitive, newBoundKey, oldBoundKey) {\n  const newBound = primitive[newBoundKey];\n  const oldBound = primitive[oldBoundKey];\n\n  const changed = !newBound.equals(oldBound);\n  if (changed) {\n    newBound.clone(oldBound);\n  }\n  return changed ? 1 : 0;\n}\n\n/**\n * Update the shape and related transforms\n * @param {VoxelPrimitive} primitive\n * @param {VoxelShape} shape\n * @param {VoxelProvider} provider\n * @returns {boolean} True if the shape is visible\n * @private\n */\nfunction updateShapeAndTransforms(primitive, shape, provider) {\n  const visible = shape.update(\n    primitive._compoundModelMatrix,\n    primitive._exaggeratedMinBounds,\n    primitive._exaggeratedMaxBounds,\n    primitive.minClippingBounds,\n    primitive.maxClippingBounds\n  );\n  if (!visible) {\n    return false;\n  }\n\n  const transformPositionLocalToWorld = shape.shapeTransform;\n  const transformPositionWorldToLocal = Matrix4.inverse(\n    transformPositionLocalToWorld,\n    scratchTransformPositionWorldToLocal\n  );\n  const rotation = Matrix4.getRotation(\n    transformPositionLocalToWorld,\n    scratchRotation\n  );\n  // Note that inverse(rotation) is the same as transpose(rotation)\n  const scale = Matrix4.getScale(transformPositionLocalToWorld, scratchScale);\n  const maximumScaleComponent = Cartesian3.maximumComponent(scale);\n  const localScale = Cartesian3.divideByScalar(\n    scale,\n    maximumScaleComponent,\n    scratchLocalScale\n  );\n  const rotationAndLocalScale = Matrix3.multiplyByScale(\n    rotation,\n    localScale,\n    scratchRotationAndLocalScale\n  );\n\n  // Set member variables when the shape is dirty\n  const dimensions = provider.dimensions;\n  primitive._stepSizeUv = shape.computeApproximateStepSize(dimensions);\n  primitive._transformPositionWorldToUv = Matrix4.multiplyTransformation(\n    transformPositionLocalToUv,\n    transformPositionWorldToLocal,\n    primitive._transformPositionWorldToUv\n  );\n  primitive._transformPositionUvToWorld = Matrix4.multiplyTransformation(\n    transformPositionLocalToWorld,\n    transformPositionUvToLocal,\n    primitive._transformPositionUvToWorld\n  );\n  primitive._transformDirectionWorldToLocal = Matrix4.getMatrix3(\n    transformPositionWorldToLocal,\n    primitive._transformDirectionWorldToLocal\n  );\n  primitive._transformNormalLocalToWorld = Matrix3.inverseTranspose(\n    rotationAndLocalScale,\n    primitive._transformNormalLocalToWorld\n  );\n\n  return true;\n}\n\n/**\n * Set up a VoxelTraversal based on dimensions and types from the primitive and provider\n * @param {VoxelPrimitive} primitive\n * @param {VoxelProvider} provider\n * @param {Context} context\n * @returns {VoxelTraversal}\n * @private\n */\nfunction setupTraversal(primitive, provider, context) {\n  const dimensions = Cartesian3.clone(provider.dimensions, scratchDimensions);\n  Cartesian3.add(dimensions, primitive._paddingBefore, dimensions);\n  Cartesian3.add(dimensions, primitive._paddingAfter, dimensions);\n\n  // It's ok for memory byte length to be undefined.\n  // The system will choose a default memory size.\n  const maximumTileCount = provider.maximumTileCount;\n  const maximumTextureMemoryByteLength = defined(maximumTileCount)\n    ? VoxelTraversal.getApproximateTextureMemoryByteLength(\n        maximumTileCount,\n        dimensions,\n        provider.types,\n        provider.componentTypes\n      )\n    : undefined;\n\n  const keyframeCount = defaultValue(provider.keyframeCount, 1);\n\n  return new VoxelTraversal(\n    primitive,\n    context,\n    dimensions,\n    provider.types,\n    provider.componentTypes,\n    keyframeCount,\n    maximumTextureMemoryByteLength\n  );\n}\n\n/**\n * Set uniforms that come from the traversal.\n * @param {VoxelTraversal} traversal\n * @param {object} uniforms\n * @private\n */\nfunction setTraversalUniforms(traversal, uniforms) {\n  uniforms.octreeInternalNodeTexture = traversal.internalNodeTexture;\n  uniforms.octreeInternalNodeTexelSizeUv = Cartesian2.clone(\n    traversal.internalNodeTexelSizeUv,\n    uniforms.octreeInternalNodeTexelSizeUv\n  );\n  uniforms.octreeInternalNodeTilesPerRow = traversal.internalNodeTilesPerRow;\n\n  const megatextures = traversal.megatextures;\n  const megatexture = megatextures[0];\n  const megatextureLength = megatextures.length;\n  uniforms.megatextureTextures = new Array(megatextureLength);\n  for (let i = 0; i < megatextureLength; i++) {\n    uniforms.megatextureTextures[i] = megatextures[i].texture;\n  }\n\n  uniforms.megatextureSliceDimensions = Cartesian2.clone(\n    megatexture.sliceCountPerRegion,\n    uniforms.megatextureSliceDimensions\n  );\n  uniforms.megatextureTileDimensions = Cartesian2.clone(\n    megatexture.regionCountPerMegatexture,\n    uniforms.megatextureTileDimensions\n  );\n  uniforms.megatextureVoxelSizeUv = Cartesian2.clone(\n    megatexture.voxelSizeUv,\n    uniforms.megatextureVoxelSizeUv\n  );\n  uniforms.megatextureSliceSizeUv = Cartesian2.clone(\n    megatexture.sliceSizeUv,\n    uniforms.megatextureSliceSizeUv\n  );\n  uniforms.megatextureTileSizeUv = Cartesian2.clone(\n    megatexture.regionSizeUv,\n    uniforms.megatextureTileSizeUv\n  );\n}\n\n/**\n * Track changes in shape-related shader defines\n * @param {VoxelPrimitive} primitive\n * @param {VoxelShape} shape\n * @returns {boolean} True if any of the shape defines changed, requiring a shader rebuild\n * @private\n */\nfunction checkShapeDefines(primitive, shape) {\n  const shapeDefines = shape.shaderDefines;\n  const shapeDefinesChanged = Object.keys(shapeDefines).some(\n    (key) => shapeDefines[key] !== primitive._shapeDefinesOld[key]\n  );\n  if (shapeDefinesChanged) {\n    primitive._shapeDefinesOld = clone(shapeDefines, true);\n  }\n  return shapeDefinesChanged;\n}\n\n/**\n * Find the keyframe location to render at. Doesn't need to be a whole number.\n * @param {TimeIntervalCollection} timeIntervalCollection\n * @param {Clock} clock\n * @returns {number}\n *\n * @private\n */\nfunction getKeyframeLocation(timeIntervalCollection, clock) {\n  if (!defined(timeIntervalCollection) || !defined(clock)) {\n    return 0.0;\n  }\n  let date = clock.currentTime;\n  let timeInterval;\n  let timeIntervalIndex = timeIntervalCollection.indexOf(date);\n  if (timeIntervalIndex >= 0) {\n    timeInterval = timeIntervalCollection.get(timeIntervalIndex);\n  } else {\n    // Date fell outside the range\n    timeIntervalIndex = ~timeIntervalIndex;\n    if (timeIntervalIndex === timeIntervalCollection.length) {\n      // Date past range\n      timeIntervalIndex = timeIntervalCollection.length - 1;\n      timeInterval = timeIntervalCollection.get(timeIntervalIndex);\n      date = timeInterval.stop;\n    } else {\n      // Date before range\n      timeInterval = timeIntervalCollection.get(timeIntervalIndex);\n      date = timeInterval.start;\n    }\n  }\n  // De-lerp between the start and end of the interval\n  const totalSeconds = JulianDate.secondsDifference(\n    timeInterval.stop,\n    timeInterval.start\n  );\n  const secondsDifferenceStart = JulianDate.secondsDifference(\n    date,\n    timeInterval.start\n  );\n  const t = secondsDifferenceStart / totalSeconds;\n\n  return timeIntervalIndex + t;\n}\n\n/**\n * Update the clipping planes state and associated uniforms\n *\n * @param {VoxelPrimitive} primitive\n * @param {FrameState} frameState\n * @returns {boolean} Whether the clipping planes changed, requiring a shader rebuild\n * @private\n */\nfunction updateClippingPlanes(primitive, frameState) {\n  const clippingPlanes = primitive.clippingPlanes;\n  if (!defined(clippingPlanes)) {\n    return false;\n  }\n\n  clippingPlanes.update(frameState);\n\n  const { clippingPlanesState, enabled } = clippingPlanes;\n\n  if (enabled) {\n    const uniforms = primitive._uniforms;\n    uniforms.clippingPlanesTexture = clippingPlanes.texture;\n\n    // Compute the clipping plane's transformation to uv space and then take the inverse\n    // transpose to properly transform the hessian normal form of the plane.\n\n    // transpose(inverse(worldToUv * clippingPlaneLocalToWorld))\n    // transpose(inverse(clippingPlaneLocalToWorld) * inverse(worldToUv))\n    // transpose(inverse(clippingPlaneLocalToWorld) * uvToWorld)\n\n    uniforms.clippingPlanesMatrix = Matrix4.transpose(\n      Matrix4.multiplyTransformation(\n        Matrix4.inverse(\n          clippingPlanes.modelMatrix,\n          uniforms.clippingPlanesMatrix\n        ),\n        primitive._transformPositionUvToWorld,\n        uniforms.clippingPlanesMatrix\n      ),\n      uniforms.clippingPlanesMatrix\n    );\n  }\n\n  if (\n    primitive._clippingPlanesState === clippingPlanesState &&\n    primitive._clippingPlanesEnabled === enabled\n  ) {\n    return false;\n  }\n  primitive._clippingPlanesState = clippingPlanesState;\n  primitive._clippingPlanesEnabled = enabled;\n\n  return true;\n}\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see VoxelPrimitive#destroy\n */\nVoxelPrimitive.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object.  Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.  Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see VoxelPrimitive#isDestroyed\n *\n * @example\n * voxelPrimitive = voxelPrimitive && voxelPrimitive.destroy();\n */\nVoxelPrimitive.prototype.destroy = function () {\n  const drawCommand = this._drawCommand;\n  if (defined(drawCommand)) {\n    drawCommand.shaderProgram =\n      drawCommand.shaderProgram && drawCommand.shaderProgram.destroy();\n  }\n  const drawCommandPick = this._drawCommandPick;\n  if (defined(drawCommandPick)) {\n    drawCommandPick.shaderProgram =\n      drawCommandPick.shaderProgram && drawCommandPick.shaderProgram.destroy();\n  }\n\n  this._pickId = this._pickId && this._pickId.destroy();\n  this._traversal = this._traversal && this._traversal.destroy();\n  this._clippingPlanes = this._clippingPlanes && this._clippingPlanes.destroy();\n\n  return destroyObject(this);\n};\n\nconst corners = new Array(\n  new Cartesian4(-1.0, -1.0, -1.0, 1.0),\n  new Cartesian4(+1.0, -1.0, -1.0, 1.0),\n  new Cartesian4(-1.0, +1.0, -1.0, 1.0),\n  new Cartesian4(+1.0, +1.0, -1.0, 1.0),\n  new Cartesian4(-1.0, -1.0, +1.0, 1.0),\n  new Cartesian4(+1.0, -1.0, +1.0, 1.0),\n  new Cartesian4(-1.0, +1.0, +1.0, 1.0),\n  new Cartesian4(+1.0, +1.0, +1.0, 1.0)\n);\nconst vertexNeighborIndices = new Array(\n  1,\n  2,\n  4,\n  0,\n  3,\n  5,\n  0,\n  3,\n  6,\n  1,\n  2,\n  7,\n  0,\n  5,\n  6,\n  1,\n  4,\n  7,\n  2,\n  4,\n  7,\n  3,\n  5,\n  6\n);\n\nconst scratchCornersClipSpace = new Array(\n  new Cartesian4(),\n  new Cartesian4(),\n  new Cartesian4(),\n  new Cartesian4(),\n  new Cartesian4(),\n  new Cartesian4(),\n  new Cartesian4(),\n  new Cartesian4()\n);\n\n/**\n * Projects all 8 corners of the oriented bounding box to NDC space and finds the\n * resulting NDC axis aligned bounding box. To avoid projecting a vertex that is\n * behind the near plane, it uses the intersection point of each of the vertex's\n * edges against the near plane as part of the AABB calculation. This is done in\n * clip space prior to perspective division.\n *\n * @function\n *\n * @param {OrientedBoundingBox} orientedBoundingBox\n * @param {Matrix4} worldToProjection\n * @param {Cartesian4} result\n * @returns {Cartesian4}\n *\n * @private\n */\nfunction orientedBoundingBoxToNdcAabb(\n  orientedBoundingBox,\n  worldToProjection,\n  result\n) {\n  const transformPositionLocalToWorld = Matrix4.fromRotationTranslation(\n    orientedBoundingBox.halfAxes,\n    orientedBoundingBox.center,\n    scratchTransformPositionLocalToWorld\n  );\n  const transformPositionLocalToProjection = Matrix4.multiply(\n    worldToProjection,\n    transformPositionLocalToWorld,\n    scratchTransformPositionLocalToProjection\n  );\n\n  let ndcMinX = +Number.MAX_VALUE;\n  let ndcMaxX = -Number.MAX_VALUE;\n  let ndcMinY = +Number.MAX_VALUE;\n  let ndcMaxY = -Number.MAX_VALUE;\n  let cornerIndex;\n\n  // Convert all points to clip space\n  const cornersClipSpace = scratchCornersClipSpace;\n  const cornersLength = corners.length;\n  for (cornerIndex = 0; cornerIndex < cornersLength; cornerIndex++) {\n    Matrix4.multiplyByVector(\n      transformPositionLocalToProjection,\n      corners[cornerIndex],\n      cornersClipSpace[cornerIndex]\n    );\n  }\n\n  for (cornerIndex = 0; cornerIndex < cornersLength; cornerIndex++) {\n    const position = cornersClipSpace[cornerIndex];\n    if (position.z >= -position.w) {\n      // Position is past near plane, so there's no need to clip.\n      const ndcX = position.x / position.w;\n      const ndcY = position.y / position.w;\n      ndcMinX = Math.min(ndcMinX, ndcX);\n      ndcMaxX = Math.max(ndcMaxX, ndcX);\n      ndcMinY = Math.min(ndcMinY, ndcY);\n      ndcMaxY = Math.max(ndcMaxY, ndcY);\n    } else {\n      for (let neighborIndex = 0; neighborIndex < 3; neighborIndex++) {\n        const neighborVertexIndex =\n          vertexNeighborIndices[cornerIndex * 3 + neighborIndex];\n        const neighborPosition = cornersClipSpace[neighborVertexIndex];\n        if (neighborPosition.z >= -neighborPosition.w) {\n          // Position is behind the near plane and neighbor is after, so get intersection point on the near plane.\n          const distanceToPlaneFromPosition = position.z + position.w;\n          const distanceToPlaneFromNeighbor =\n            neighborPosition.z + neighborPosition.w;\n          const t =\n            distanceToPlaneFromPosition /\n            (distanceToPlaneFromPosition - distanceToPlaneFromNeighbor);\n\n          const intersect = Cartesian4.lerp(\n            position,\n            neighborPosition,\n            t,\n            scratchIntersect\n          );\n          const intersectNdcX = intersect.x / intersect.w;\n          const intersectNdcY = intersect.y / intersect.w;\n          ndcMinX = Math.min(ndcMinX, intersectNdcX);\n          ndcMaxX = Math.max(ndcMaxX, intersectNdcX);\n          ndcMinY = Math.min(ndcMinY, intersectNdcY);\n          ndcMaxY = Math.max(ndcMaxY, intersectNdcY);\n        }\n      }\n    }\n  }\n\n  // Clamp the NDC values to -1 to +1 range even if they extend much further.\n  ndcMinX = CesiumMath.clamp(ndcMinX, -1.0, +1.0);\n  ndcMinY = CesiumMath.clamp(ndcMinY, -1.0, +1.0);\n  ndcMaxX = CesiumMath.clamp(ndcMaxX, -1.0, +1.0);\n  ndcMaxY = CesiumMath.clamp(ndcMaxY, -1.0, +1.0);\n  result = Cartesian4.fromElements(ndcMinX, ndcMinY, ndcMaxX, ndcMaxY, result);\n\n  return result;\n}\n\nconst polylineAxisDistance = 30000000.0;\nconst polylineXAxis = new Cartesian3(polylineAxisDistance, 0.0, 0.0);\nconst polylineYAxis = new Cartesian3(0.0, polylineAxisDistance, 0.0);\nconst polylineZAxis = new Cartesian3(0.0, 0.0, polylineAxisDistance);\n\n/**\n * Draws the tile bounding boxes and axes.\n *\n * @function\n *\n * @param {VoxelPrimitive} that\n * @param {FrameState} frameState\n *\n * @private\n */\nfunction debugDraw(that, frameState) {\n  const traversal = that._traversal;\n  const polylines = that._debugPolylines;\n  polylines.removeAll();\n\n  function makePolylineLineSegment(startPos, endPos, color, thickness) {\n    polylines.add({\n      positions: [startPos, endPos],\n      width: thickness,\n      material: Material.fromType(\"Color\", {\n        color: color,\n      }),\n    });\n  }\n\n  function makePolylineBox(orientedBoundingBox, color, thickness) {\n    // Normally would want to use a scratch variable to store the corners, but\n    // polylines don't clone the positions.\n    const corners = orientedBoundingBox.computeCorners();\n    makePolylineLineSegment(corners[0], corners[1], color, thickness);\n    makePolylineLineSegment(corners[2], corners[3], color, thickness);\n    makePolylineLineSegment(corners[4], corners[5], color, thickness);\n    makePolylineLineSegment(corners[6], corners[7], color, thickness);\n    makePolylineLineSegment(corners[0], corners[2], color, thickness);\n    makePolylineLineSegment(corners[4], corners[6], color, thickness);\n    makePolylineLineSegment(corners[1], corners[3], color, thickness);\n    makePolylineLineSegment(corners[5], corners[7], color, thickness);\n    makePolylineLineSegment(corners[0], corners[4], color, thickness);\n    makePolylineLineSegment(corners[2], corners[6], color, thickness);\n    makePolylineLineSegment(corners[1], corners[5], color, thickness);\n    makePolylineLineSegment(corners[3], corners[7], color, thickness);\n  }\n\n  function drawTile(tile) {\n    if (!traversal.isRenderable(tile)) {\n      return;\n    }\n\n    const level = tile.level;\n    const startThickness = 5.0;\n    const thickness = Math.max(1.0, startThickness / Math.pow(2.0, level));\n    const colors = [Color.RED, Color.LIME, Color.BLUE];\n    const color = colors[level % 3];\n\n    makePolylineBox(tile.orientedBoundingBox, color, thickness);\n\n    if (defined(tile.children)) {\n      for (let i = 0; i < 8; i++) {\n        drawTile(tile.children[i]);\n      }\n    }\n  }\n\n  makePolylineBox(that._shape.orientedBoundingBox, Color.WHITE, 5.0);\n\n  drawTile(traversal.rootNode);\n\n  const axisThickness = 10.0;\n  makePolylineLineSegment(\n    Cartesian3.ZERO,\n    polylineXAxis,\n    Color.RED,\n    axisThickness\n  );\n  makePolylineLineSegment(\n    Cartesian3.ZERO,\n    polylineYAxis,\n    Color.LIME,\n    axisThickness\n  );\n  makePolylineLineSegment(\n    Cartesian3.ZERO,\n    polylineZAxis,\n    Color.BLUE,\n    axisThickness\n  );\n\n  polylines.update(frameState);\n}\n\n/**\n * The default custom shader used by the primitive.\n *\n * @type {CustomShader}\n * @constant\n * @readonly\n *\n * @private\n */\nVoxelPrimitive.DefaultCustomShader = new CustomShader({\n  fragmentShaderText: `void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)\n{\n    material.diffuse = vec3(1.0);\n    material.alpha = 1.0;\n}`,\n});\n\nfunction DefaultVoxelProvider() {\n  this.ready = true;\n  this.shape = VoxelShapeType.BOX;\n  this.dimensions = new Cartesian3(1, 1, 1);\n  this.names = [\"data\"];\n  this.types = [MetadataType.SCALAR];\n  this.componentTypes = [MetadataComponentType.FLOAT32];\n  this.maximumTileCount = 1;\n}\n\nDefaultVoxelProvider.prototype.requestData = function (options) {\n  const tileLevel = defined(options) ? defaultValue(options.tileLevel, 0) : 0;\n  if (tileLevel >= 1) {\n    return undefined;\n  }\n\n  return Promise.resolve([new Float32Array(1)]);\n};\n\nVoxelPrimitive.DefaultProvider = new DefaultVoxelProvider();\n\nexport default VoxelPrimitive;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * Provides voxel data. Intended to be used with {@link VoxelPrimitive}.\n * This type describes an interface and is not intended to be instantiated directly.\n *\n * @alias VoxelProvider\n * @constructor\n *\n * @see Cesium3DTilesVoxelProvider\n * @see VoxelPrimitive\n * @see VoxelShapeType\n *\n * @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction VoxelProvider() {\n  DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(VoxelProvider.prototype, {\n  /**\n   * A transform from local space to global space. If undefined, the identity matrix will be used instead.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {Matrix4|undefined}\n   * @readonly\n   */\n  globalTransform: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * A transform from shape space to local space. If undefined, the identity matrix will be used instead.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {Matrix4|undefined}\n   * @readonly\n   */\n  shapeTransform: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the {@link VoxelShapeType}\n   * This should not be called before {@link VoxelProvider#ready} returns true.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {VoxelShapeType}\n   * @readonly\n   */\n  shape: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the minimum bounds.\n   * If undefined, the shape's default minimum bounds will be used instead.\n   * This should not be called before {@link VoxelProvider#ready} returns true.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {Cartesian3|undefined}\n   * @readonly\n   */\n  minBounds: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the maximum bounds.\n   * If undefined, the shape's default maximum bounds will be used instead.\n   * This should not be called before {@link VoxelProvider#ready} returns true.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {Cartesian3|undefined}\n   * @readonly\n   */\n  maxBounds: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the number of voxels per dimension of a tile. This is the same for all tiles in the dataset.\n   * This should not be called before {@link VoxelProvider#ready} returns true.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {Cartesian3}\n   * @readonly\n   */\n  dimensions: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the number of padding voxels before the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage.\n   * This should not be called before {@link VoxelProvider#ready} returns true.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {Cartesian3|undefined}\n   * @readonly\n   */\n  paddingBefore: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the number of padding voxels after the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage.\n   * This should not be called before {@link VoxelProvider#ready} returns true.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {Cartesian3|undefined}\n   * @readonly\n   */\n  paddingAfter: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the metadata names.\n   * This should not be called before {@link VoxelProvider#ready} returns true.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {string[]}\n   * @readonly\n   */\n  names: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the metadata types.\n   * This should not be called before {@link VoxelProvider#ready} returns true.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {MetadataType[]}\n   * @readonly\n   */\n  types: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the metadata component types.\n   * This should not be called before {@link VoxelProvider#ready} returns true.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {MetadataComponentType[]}\n   * @readonly\n   */\n  componentTypes: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the metadata minimum values.\n   * This should not be called before {@link VoxelProvider#ready} returns true.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {number[][]|undefined}\n   * @readonly\n   */\n  minimumValues: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the metadata maximum values.\n   * This should not be called before {@link VoxelProvider#ready} returns true.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {number[][]|undefined}\n   * @readonly\n   */\n  maximumValues: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * The maximum number of tiles that exist for this provider. This value is used as a hint to the voxel renderer to allocate an appropriate amount of GPU memory. If this value is not known it can be undefined.\n   * This should not be called before {@link VoxelProvider#ready} returns true.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {number|undefined}\n   * @readonly\n   */\n  maximumTileCount: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the number of keyframes in the dataset.\n   * This should not be called before {@link VoxelProvider#ready} returns true.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {number}\n   * @readonly\n   * @private\n   */\n  keyframeCount: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * Gets the {@link TimeIntervalCollection} for the dataset, or undefined if it doesn't have timestamps.\n   * This should not be called before {@link VoxelProvider#ready} returns true.\n   *\n   * @memberof VoxelProvider.prototype\n   * @type {TimeIntervalCollection}\n   * @readonly\n   * @private\n   */\n  timeIntervalCollection: {\n    get: DeveloperError.throwInstantiationError,\n  },\n});\n\n/**\n * Requests the data for a given tile. The data is a flattened 3D array ordered by X, then Y, then Z.\n * This function should not be called before {@link VoxelProvider#ready} returns true.\n * @function\n *\n * @param {object} [options] Object with the following properties:\n * @param {number} [options.tileLevel=0] The tile's level.\n * @param {number} [options.tileX=0] The tile's X coordinate.\n * @param {number} [options.tileY=0] The tile's Y coordinate.\n * @param {number} [options.tileZ=0] The tile's Z coordinate.\n * @privateparam {number} [options.keyframe=0] The requested keyframe.\n * @returns {Promise<Array[]>|undefined} A promise to an array of typed arrays containing the requested voxel data or undefined if there was a problem loading the data.\n */\nVoxelProvider.prototype.requestData = DeveloperError.throwInstantiationError;\n\nexport default VoxelProvider;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * Controls per-shape behavior for culling and rendering voxel grids.\n * This type describes an interface and is not intended to be instantiated directly.\n *\n * @alias VoxelShape\n * @constructor\n *\n * @see VoxelBoxShape\n * @see VoxelEllipsoidShape\n * @see VoxelCylinderShape\n * @see VoxelShapeType\n *\n * @private\n */\nfunction VoxelShape() {\n  DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(VoxelShape.prototype, {\n  /**\n   * An oriented bounding box containing the bounded shape.\n   * The update function must be called before accessing this value.\n   *\n   * @memberof VoxelShape.prototype\n   * @type {OrientedBoundingBox}\n   * @readonly\n   */\n  orientedBoundingBox: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * A bounding sphere containing the bounded shape.\n   * The update function must be called before accessing this value.\n   *\n   * @memberof VoxelShape.prototype\n   * @type {BoundingSphere}\n   * @readonly\n   */\n  boundingSphere: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * A transformation matrix containing the bounded shape.\n   * The update function must be called before accessing this value.\n   *\n   * @memberof VoxelShape.prototype\n   * @type {Matrix4}\n   * @readonly\n   */\n  boundTransform: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * A transformation matrix containing the shape, ignoring the bounds.\n   * The update function must be called before accessing this value.\n   *\n   * @memberof VoxelShape.prototype\n   * @type {Matrix4}\n   * @readonly\n   */\n  shapeTransform: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * @type {Object<string, any>}\n   * @readonly\n   */\n  shaderUniforms: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * @type {Object<string, any>}\n   * @readonly\n   */\n  shaderDefines: {\n    get: DeveloperError.throwInstantiationError,\n  },\n\n  /**\n   * The maximum number of intersections against the shape for any ray direction.\n   * @type {number}\n   * @readonly\n   */\n  shaderMaximumIntersectionsLength: {\n    get: DeveloperError.throwInstantiationError,\n  },\n});\n\n/**\n * Update the shape's state.\n *\n * @param {Matrix4} modelMatrix The model matrix.\n * @param {Cartesian3} minBounds The minimum bounds.\n * @param {Cartesian3} maxBounds The maximum bounds.\n * @returns {boolean} Whether the shape is visible.\n */\nVoxelShape.prototype.update = DeveloperError.throwInstantiationError;\n\n/**\n * Computes an oriented bounding box for a specified tile.\n * The update function must be called before calling this function.\n *\n * @param {number} tileLevel The tile's level.\n * @param {number} tileX The tile's x coordinate.\n * @param {number} tileY The tile's y coordinate.\n * @param {number} tileZ The tile's z coordinate.\n * @param {OrientedBoundingBox} result The oriented bounding box that will be set to enclose the specified tile.\n * @returns {OrientedBoundingBox} The oriented bounding box.\n */\nVoxelShape.prototype.computeOrientedBoundingBoxForTile =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Computes an approximate step size for raymarching the root tile of a voxel grid.\n * The update function must be called before calling this function.\n *\n * @param {Cartesian3} voxelDimensions The voxel grid dimensions for a tile.\n * @returns {number} The step size.\n */\nVoxelShape.prototype.computeApproximateStepSize =\n  DeveloperError.throwInstantiationError;\n\n/**\n * Defines the minimum bounds of the shape. The meaning can vary per-shape.\n *\n * @type {Cartesian3}\n * @constant\n * @readonly\n *\n * @private\n */\nVoxelShape.DefaultMinBounds = DeveloperError.throwInstantiationError;\n\n/**\n * Defines the maximum bounds of the shape. The meaning can vary per-shape.\n *\n * @type {Cartesian3}\n * @constant\n * @readonly\n *\n * @private\n */\nVoxelShape.DefaultMaxBounds = DeveloperError.throwInstantiationError;\n\nexport default VoxelShape;\n", "import defined from \"../Core/defined.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport sampleTerrainMostDetailed from \"../Core/sampleTerrainMostDetailed.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * Computes the final camera location to view a rectangle adjusted for the current terrain.\n * If the terrain does not support availability, the height above the ellipsoid is used.\n *\n * @param {Rectangle} rectangle The rectangle being zoomed to.\n * @param {Scene} scene The scene being used.\n *\n * @returns {Promise<Cartographic>} The optimal location to place the camera so that the entire rectangle is in view.\n *\n * @private\n */\nasync function computeFlyToLocationForRectangle(rectangle, scene) {\n  const terrainProvider = scene.terrainProvider;\n  const mapProjection = scene.mapProjection;\n  const ellipsoid = mapProjection.ellipsoid;\n\n  let positionWithoutTerrain;\n  const tmp = scene.camera.getRectangleCameraCoordinates(rectangle);\n  if (scene.mode === SceneMode.SCENE3D) {\n    positionWithoutTerrain = ellipsoid.cartesianToCartographic(tmp);\n  } else {\n    positionWithoutTerrain = mapProjection.unproject(tmp);\n  }\n\n  if (!defined(terrainProvider)) {\n    return positionWithoutTerrain;\n  }\n\n  const availability = terrainProvider.availability;\n\n  if (!defined(availability) || scene.mode === SceneMode.SCENE2D) {\n    return positionWithoutTerrain;\n  }\n\n  const cartographics = [\n    Rectangle.center(rectangle),\n    Rectangle.southeast(rectangle),\n    Rectangle.southwest(rectangle),\n    Rectangle.northeast(rectangle),\n    Rectangle.northwest(rectangle),\n  ];\n\n  const positionsOnTerrain = await computeFlyToLocationForRectangle._sampleTerrainMostDetailed(\n    terrainProvider,\n    cartographics\n  );\n\n  let heightFound = false;\n  const maxHeight = positionsOnTerrain.reduce(function (currentMax, item) {\n    if (!defined(item.height)) {\n      return currentMax;\n    }\n    heightFound = true;\n    return Math.max(item.height, currentMax);\n  }, -Number.MAX_VALUE);\n\n  const finalPosition = positionWithoutTerrain;\n  if (heightFound) {\n    finalPosition.height += maxHeight;\n  }\n\n  return finalPosition;\n}\n\n//Exposed for testing.\ncomputeFlyToLocationForRectangle._sampleTerrainMostDetailed = sampleTerrainMostDetailed;\nexport default computeFlyToLocationForRectangle;\n", "import Cartesian4 from \"../Core/Cartesian4.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport mergeSort from \"../Core/mergeSort.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport Material from \"./Material.js\";\n\nconst scratchColor = new Color();\nconst scratchColorAbove = new Color();\nconst scratchColorBelow = new Color();\nconst scratchColorBlend = new Color();\nconst scratchPackedFloat = new Cartesian4();\nconst scratchColorBytes = new Uint8Array(4);\n\nfunction lerpEntryColor(height, entryBefore, entryAfter, result) {\n  const lerpFactor =\n    entryBefore.height === entryAfter.height\n      ? 0.0\n      : (height - entryBefore.height) /\n        (entryAfter.height - entryBefore.height);\n  return Color.lerp(entryBefore.color, entryAfter.color, lerpFactor, result);\n}\n\nfunction createNewEntry(height, color) {\n  return {\n    height: height,\n    color: Color.clone(color),\n  };\n}\n\nfunction removeDuplicates(entries) {\n  // This function expects entries to be sorted from lowest to highest.\n\n  // Remove entries that have the same height as before and after.\n  entries = entries.filter(function (entry, index, array) {\n    const hasPrev = index > 0;\n    const hasNext = index < array.length - 1;\n\n    const sameHeightAsPrev = hasPrev\n      ? entry.height === array[index - 1].height\n      : true;\n    const sameHeightAsNext = hasNext\n      ? entry.height === array[index + 1].height\n      : true;\n\n    const keep = !sameHeightAsPrev || !sameHeightAsNext;\n    return keep;\n  });\n\n  // Remove entries that have the same color as before and after.\n  entries = entries.filter(function (entry, index, array) {\n    const hasPrev = index > 0;\n    const hasNext = index < array.length - 1;\n\n    const sameColorAsPrev = hasPrev\n      ? Color.equals(entry.color, array[index - 1].color)\n      : false;\n    const sameColorAsNext = hasNext\n      ? Color.equals(entry.color, array[index + 1].color)\n      : false;\n\n    const keep = !sameColorAsPrev || !sameColorAsNext;\n    return keep;\n  });\n\n  // Also remove entries that have the same height AND color as the entry before.\n  entries = entries.filter(function (entry, index, array) {\n    const hasPrev = index > 0;\n\n    const sameColorAsPrev = hasPrev\n      ? Color.equals(entry.color, array[index - 1].color)\n      : false;\n\n    const sameHeightAsPrev = hasPrev\n      ? entry.height === array[index - 1].height\n      : true;\n\n    const keep = !sameColorAsPrev || !sameHeightAsPrev;\n    return keep;\n  });\n\n  return entries;\n}\n\nfunction preprocess(layers) {\n  let i, j;\n\n  const layeredEntries = [];\n\n  const layersLength = layers.length;\n  for (i = 0; i < layersLength; i++) {\n    const layer = layers[i];\n    const entriesOrig = layer.entries;\n    const entriesLength = entriesOrig.length;\n\n    //>>includeStart('debug', pragmas.debug);\n    if (!Array.isArray(entriesOrig) || entriesLength === 0) {\n      throw new DeveloperError(\"entries must be an array with size > 0.\");\n    }\n    //>>includeEnd('debug');\n\n    let entries = [];\n\n    for (j = 0; j < entriesLength; j++) {\n      const entryOrig = entriesOrig[j];\n\n      //>>includeStart('debug', pragmas.debug);\n      if (!defined(entryOrig.height)) {\n        throw new DeveloperError(\"entry requires a height.\");\n      }\n      if (!defined(entryOrig.color)) {\n        throw new DeveloperError(\"entry requires a color.\");\n      }\n      //>>includeEnd('debug');\n\n      const height = CesiumMath.clamp(\n        entryOrig.height,\n        createElevationBandMaterial._minimumHeight,\n        createElevationBandMaterial._maximumHeight\n      );\n\n      // premultiplied alpha\n      const color = Color.clone(entryOrig.color, scratchColor);\n      color.red *= color.alpha;\n      color.green *= color.alpha;\n      color.blue *= color.alpha;\n\n      entries.push(createNewEntry(height, color));\n    }\n\n    let sortedAscending = true;\n    let sortedDescending = true;\n    for (j = 0; j < entriesLength - 1; j++) {\n      const currEntry = entries[j + 0];\n      const nextEntry = entries[j + 1];\n\n      sortedAscending = sortedAscending && currEntry.height <= nextEntry.height;\n      sortedDescending =\n        sortedDescending && currEntry.height >= nextEntry.height;\n    }\n\n    // When the array is fully descending, reverse it.\n    if (sortedDescending) {\n      entries = entries.reverse();\n    } else if (!sortedAscending) {\n      // Stable sort from lowest to greatest height.\n      mergeSort(entries, function (a, b) {\n        return CesiumMath.sign(a.height - b.height);\n      });\n    }\n\n    let extendDownwards = defaultValue(layer.extendDownwards, false);\n    let extendUpwards = defaultValue(layer.extendUpwards, false);\n\n    // Interpret a single entry to extend all the way up and down.\n    if (entries.length === 1 && !extendDownwards && !extendUpwards) {\n      extendDownwards = true;\n      extendUpwards = true;\n    }\n\n    if (extendDownwards) {\n      entries.splice(\n        0,\n        0,\n        createNewEntry(\n          createElevationBandMaterial._minimumHeight,\n          entries[0].color\n        )\n      );\n    }\n    if (extendUpwards) {\n      entries.splice(\n        entries.length,\n        0,\n        createNewEntry(\n          createElevationBandMaterial._maximumHeight,\n          entries[entries.length - 1].color\n        )\n      );\n    }\n\n    entries = removeDuplicates(entries);\n\n    layeredEntries.push(entries);\n  }\n\n  return layeredEntries;\n}\n\nfunction createLayeredEntries(layers) {\n  // clean up the input data and check for errors\n  const layeredEntries = preprocess(layers);\n\n  let entriesAccumNext = [];\n  let entriesAccumCurr = [];\n  let i;\n\n  function addEntry(height, color) {\n    entriesAccumNext.push(createNewEntry(height, color));\n  }\n  function addBlendEntry(height, a, b) {\n    let result = Color.multiplyByScalar(b, 1.0 - a.alpha, scratchColorBlend);\n    result = Color.add(result, a, result);\n    addEntry(height, result);\n  }\n\n  // alpha blend new layers on top of old ones\n  const layerLength = layeredEntries.length;\n  for (i = 0; i < layerLength; i++) {\n    const entries = layeredEntries[i];\n    let idx = 0;\n    let accumIdx = 0;\n\n    // swap the arrays\n    entriesAccumCurr = entriesAccumNext;\n    entriesAccumNext = [];\n\n    const entriesLength = entries.length;\n    const entriesAccumLength = entriesAccumCurr.length;\n    while (idx < entriesLength || accumIdx < entriesAccumLength) {\n      const entry = idx < entriesLength ? entries[idx] : undefined;\n      const prevEntry = idx > 0 ? entries[idx - 1] : undefined;\n      const nextEntry = idx < entriesLength - 1 ? entries[idx + 1] : undefined;\n\n      const entryAccum =\n        accumIdx < entriesAccumLength ? entriesAccumCurr[accumIdx] : undefined;\n      const prevEntryAccum =\n        accumIdx > 0 ? entriesAccumCurr[accumIdx - 1] : undefined;\n      const nextEntryAccum =\n        accumIdx < entriesAccumLength - 1\n          ? entriesAccumCurr[accumIdx + 1]\n          : undefined;\n\n      if (\n        defined(entry) &&\n        defined(entryAccum) &&\n        entry.height === entryAccum.height\n      ) {\n        // New entry directly on top of accum entry\n        const isSplitAccum =\n          defined(nextEntryAccum) &&\n          entryAccum.height === nextEntryAccum.height;\n        const isStartAccum = !defined(prevEntryAccum);\n        const isEndAccum = !defined(nextEntryAccum);\n\n        const isSplit = defined(nextEntry) && entry.height === nextEntry.height;\n        const isStart = !defined(prevEntry);\n        const isEnd = !defined(nextEntry);\n\n        if (isSplitAccum) {\n          if (isSplit) {\n            addBlendEntry(entry.height, entry.color, entryAccum.color);\n            addBlendEntry(entry.height, nextEntry.color, nextEntryAccum.color);\n          } else if (isStart) {\n            addEntry(entry.height, entryAccum.color);\n            addBlendEntry(entry.height, entry.color, nextEntryAccum.color);\n          } else if (isEnd) {\n            addBlendEntry(entry.height, entry.color, entryAccum.color);\n            addEntry(entry.height, nextEntryAccum.color);\n          } else {\n            addBlendEntry(entry.height, entry.color, entryAccum.color);\n            addBlendEntry(entry.height, entry.color, nextEntryAccum.color);\n          }\n        } else if (isStartAccum) {\n          if (isSplit) {\n            addEntry(entry.height, entry.color);\n            addBlendEntry(entry.height, nextEntry.color, entryAccum.color);\n          } else if (isEnd) {\n            addEntry(entry.height, entry.color);\n            addEntry(entry.height, entryAccum.color);\n          } else if (isStart) {\n            addBlendEntry(entry.height, entry.color, entryAccum.color);\n          } else {\n            addEntry(entry.height, entry.color);\n            addBlendEntry(entry.height, entry.color, entryAccum.color);\n          }\n        } else if (isEndAccum) {\n          if (isSplit) {\n            addBlendEntry(entry.height, entry.color, entryAccum.color);\n            addEntry(entry.height, nextEntry.color);\n          } else if (isStart) {\n            addEntry(entry.height, entryAccum.color);\n            addEntry(entry.height, entry.color);\n          } else if (isEnd) {\n            addBlendEntry(entry.height, entry.color, entryAccum.color);\n          } else {\n            addBlendEntry(entry.height, entry.color, entryAccum.color);\n            addEntry(entry.height, entry.color);\n          }\n        } else {\n          // eslint-disable-next-line no-lonely-if\n          if (isSplit) {\n            addBlendEntry(entry.height, entry.color, entryAccum.color);\n            addBlendEntry(entry.height, nextEntry.color, entryAccum.color);\n          } else if (isStart) {\n            addEntry(entry.height, entryAccum.color);\n            addBlendEntry(entry.height, entry.color, entryAccum.color);\n          } else if (isEnd) {\n            addBlendEntry(entry.height, entry.color, entryAccum.color);\n            addEntry(entry.height, entryAccum.color);\n          } else {\n            addBlendEntry(entry.height, entry.color, entryAccum.color);\n          }\n        }\n        idx += isSplit ? 2 : 1;\n        accumIdx += isSplitAccum ? 2 : 1;\n      } else if (\n        defined(entry) &&\n        defined(entryAccum) &&\n        defined(prevEntryAccum) &&\n        entry.height < entryAccum.height\n      ) {\n        // New entry between two accum entries\n        const colorBelow = lerpEntryColor(\n          entry.height,\n          prevEntryAccum,\n          entryAccum,\n          scratchColorBelow\n        );\n\n        if (!defined(prevEntry)) {\n          addEntry(entry.height, colorBelow);\n          addBlendEntry(entry.height, entry.color, colorBelow);\n        } else if (!defined(nextEntry)) {\n          addBlendEntry(entry.height, entry.color, colorBelow);\n          addEntry(entry.height, colorBelow);\n        } else {\n          addBlendEntry(entry.height, entry.color, colorBelow);\n        }\n        idx++;\n      } else if (\n        defined(entryAccum) &&\n        defined(entry) &&\n        defined(prevEntry) &&\n        entryAccum.height < entry.height\n      ) {\n        // Accum entry between two new entries\n        const colorAbove = lerpEntryColor(\n          entryAccum.height,\n          prevEntry,\n          entry,\n          scratchColorAbove\n        );\n\n        if (!defined(prevEntryAccum)) {\n          addEntry(entryAccum.height, colorAbove);\n          addBlendEntry(entryAccum.height, colorAbove, entryAccum.color);\n        } else if (!defined(nextEntryAccum)) {\n          addBlendEntry(entryAccum.height, colorAbove, entryAccum.color);\n          addEntry(entryAccum.height, colorAbove);\n        } else {\n          addBlendEntry(entryAccum.height, colorAbove, entryAccum.color);\n        }\n        accumIdx++;\n      } else if (\n        defined(entry) &&\n        (!defined(entryAccum) || entry.height < entryAccum.height)\n      ) {\n        // New entry completely before or completely after accum entries\n        if (\n          defined(entryAccum) &&\n          !defined(prevEntryAccum) &&\n          !defined(nextEntry)\n        ) {\n          // Insert blank gap between last entry and first accum entry\n          addEntry(entry.height, entry.color);\n          addEntry(entry.height, createElevationBandMaterial._emptyColor);\n          addEntry(entryAccum.height, createElevationBandMaterial._emptyColor);\n        } else if (\n          !defined(entryAccum) &&\n          defined(prevEntryAccum) &&\n          !defined(prevEntry)\n        ) {\n          // Insert blank gap between last accum entry and first entry\n          addEntry(\n            prevEntryAccum.height,\n            createElevationBandMaterial._emptyColor\n          );\n          addEntry(entry.height, createElevationBandMaterial._emptyColor);\n          addEntry(entry.height, entry.color);\n        } else {\n          addEntry(entry.height, entry.color);\n        }\n        idx++;\n      } else if (\n        defined(entryAccum) &&\n        (!defined(entry) || entryAccum.height < entry.height)\n      ) {\n        // Accum entry completely before or completely after new entries\n        addEntry(entryAccum.height, entryAccum.color);\n        accumIdx++;\n      }\n    }\n  }\n\n  // one final cleanup pass in case duplicate colors show up in the final result\n  const allEntries = removeDuplicates(entriesAccumNext);\n  return allEntries;\n}\n\n/**\n * @typedef createElevationBandMaterialEntry\n *\n * @property {number} height The height.\n * @property {Color} color The color at this height.\n */\n/**\n * @typedef createElevationBandMaterialBand\n *\n * @property {createElevationBandMaterialEntry[]} entries A list of elevation entries. They will automatically be sorted from lowest to highest. If there is only one entry and <code>extendsDownards</code> and <code>extendUpwards</code> are both <code>false</code>, they will both be set to <code>true</code>.\n * @property {boolean} [extendDownwards=false] If <code>true</code>, the band's minimum elevation color will extend infinitely downwards.\n * @property {boolean} [extendUpwards=false] If <code>true</code>, the band's maximum elevation color will extend infinitely upwards.\n */\n\n/**\n * Creates a {@link Material} that combines multiple layers of color/gradient bands and maps them to terrain heights.\n *\n * The shader does a binary search over all the heights to find out which colors are above and below a given height, and\n * interpolates between them for the final color. This material supports hundreds of entries relatively cheaply.\n *\n * @function createElevationBandMaterial\n *\n * @param {object} options Object with the following properties:\n * @param {Scene} options.scene The scene where the visualization is taking place.\n * @param {createElevationBandMaterialBand[]} options.layers A list of bands ordered from lowest to highest precedence.\n * @returns {Material} A new {@link Material} instance.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Elevation%20Band%20Material.html|Cesium Sandcastle Elevation Band Demo}\n *\n * @example\n * scene.globe.material = Cesium.createElevationBandMaterial({\n *     scene : scene,\n *     layers : [{\n *         entries : [{\n *             height : 4200.0,\n *             color : new Cesium.Color(0.0, 0.0, 0.0, 1.0)\n *         }, {\n *             height : 8848.0,\n *             color : new Cesium.Color(1.0, 1.0, 1.0, 1.0)\n *         }],\n *         extendDownwards : true,\n *         extendUpwards : true,\n *     }, {\n *         entries : [{\n *             height : 7000.0,\n *             color : new Cesium.Color(1.0, 0.0, 0.0, 0.5)\n *         }, {\n *             height : 7100.0,\n *             color : new Cesium.Color(1.0, 0.0, 0.0, 0.5)\n *         }]\n *     }]\n * });\n */\nfunction createElevationBandMaterial(options) {\n  const { scene, layers } = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"options.scene\", scene);\n  Check.defined(\"options.layers\", layers);\n  Check.typeOf.number.greaterThan(\"options.layers.length\", layers.length, 0);\n  //>>includeEnd('debug');\n\n  const { context } = scene;\n  const entries = createLayeredEntries(layers);\n  const entriesLength = entries.length;\n\n  let heightTexBuffer;\n  let heightTexDatatype;\n  let heightTexFormat;\n\n  const isPackedHeight = !createElevationBandMaterial._useFloatTexture(context);\n  if (isPackedHeight) {\n    heightTexDatatype = PixelDatatype.UNSIGNED_BYTE;\n    heightTexFormat = PixelFormat.RGBA;\n    heightTexBuffer = new Uint8Array(entriesLength * 4);\n    for (let i = 0; i < entriesLength; i++) {\n      Cartesian4.packFloat(entries[i].height, scratchPackedFloat);\n      Cartesian4.pack(scratchPackedFloat, heightTexBuffer, i * 4);\n    }\n  } else {\n    heightTexDatatype = PixelDatatype.FLOAT;\n    heightTexFormat = context.webgl2 ? PixelFormat.RED : PixelFormat.LUMINANCE;\n    heightTexBuffer = new Float32Array(entriesLength);\n    for (let i = 0; i < entriesLength; i++) {\n      heightTexBuffer[i] = entries[i].height;\n    }\n  }\n\n  const heightsTex = Texture.create({\n    context: context,\n    pixelFormat: heightTexFormat,\n    pixelDatatype: heightTexDatatype,\n    source: {\n      arrayBufferView: heightTexBuffer,\n      width: entriesLength,\n      height: 1,\n    },\n    sampler: new Sampler({\n      wrapS: TextureWrap.CLAMP_TO_EDGE,\n      wrapT: TextureWrap.CLAMP_TO_EDGE,\n      minificationFilter: TextureMinificationFilter.NEAREST,\n      magnificationFilter: TextureMagnificationFilter.NEAREST,\n    }),\n  });\n\n  const colorsArray = new Uint8Array(entriesLength * 4);\n  for (let i = 0; i < entriesLength; i++) {\n    const color = entries[i].color;\n    color.toBytes(scratchColorBytes);\n    colorsArray[i * 4 + 0] = scratchColorBytes[0];\n    colorsArray[i * 4 + 1] = scratchColorBytes[1];\n    colorsArray[i * 4 + 2] = scratchColorBytes[2];\n    colorsArray[i * 4 + 3] = scratchColorBytes[3];\n  }\n\n  const colorsTex = Texture.create({\n    context: context,\n    pixelFormat: PixelFormat.RGBA,\n    pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n    source: {\n      arrayBufferView: colorsArray,\n      width: entriesLength,\n      height: 1,\n    },\n    sampler: new Sampler({\n      wrapS: TextureWrap.CLAMP_TO_EDGE,\n      wrapT: TextureWrap.CLAMP_TO_EDGE,\n      minificationFilter: TextureMinificationFilter.LINEAR,\n      magnificationFilter: TextureMagnificationFilter.LINEAR,\n    }),\n  });\n\n  return Material.fromType(\"ElevationBand\", {\n    heights: heightsTex,\n    colors: colorsTex,\n  });\n}\n\n/**\n * Function for checking if the context will allow floating point textures for heights.\n *\n * @param {Context} context The {@link Context}.\n * @returns {boolean} <code>true</code> if floating point textures can be used for heights.\n * @private\n */\ncreateElevationBandMaterial._useFloatTexture = function (context) {\n  return context.floatingPointTexture;\n};\n\n/**\n * This is the height that gets stored in the texture when using extendUpwards.\n * There's nothing special about it, it's just a really big number.\n * @private\n */\ncreateElevationBandMaterial._maximumHeight = +5906376425472;\n\n/**\n * This is the height that gets stored in the texture when using extendDownwards.\n * There's nothing special about it, it's just a really big number.\n * @private\n */\ncreateElevationBandMaterial._minimumHeight = -5906376425472;\n\n/**\n * Color used to create empty space in the color texture\n * @private\n */\ncreateElevationBandMaterial._emptyColor = new Color(0.0, 0.0, 0.0, 0.0);\n\nexport default createElevationBandMaterial;\n", "import Cesium3DTileset from \"./Cesium3DTileset.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport IonResource from \"../Core/IonResource.js\";\nimport GoogleMaps from \"../Core/GoogleMaps.js\";\nimport Resource from \"../Core/Resource.js\";\n\n/**\n * Creates a {@link Cesium3DTileset} instance for the Google Photorealistic 3D Tiles tileset.\n *\n * @function\n *\n * @param {string} [key=GoogleMaps.defaultApiKey] Your API key to access Google Photorealistic 3D Tiles. See {@link https://developers.google.com/maps/documentation/javascript/get-api-key} for instructions on how to create your own key.\n * @param {Cesium3DTileset.ConstructorOptions} [options] An object describing initialization options.\n * @returns {Promise<Cesium3DTileset>}\n *\n * @see GoogleMaps\n *\n * @example\n * const viewer = new Cesium.Viewer(\"cesiumContainer\");\n *\n * try {\n *   const tileset = await Cesium.createGooglePhotorealistic3DTileset();\n *   viewer.scene.primitives.add(tileset));\n * } catch (error) {\n *   console.log(`Error creating tileset: ${error}`);\n * }\n *\n * @example\n * // Use your own Google Maps API key\n * Cesium.GoogleMaps.defaultApiKey = \"your-api-key\";\n *\n * const viewer = new Cesium.Viewer(\"cesiumContainer\");\n *\n * try {\n *   const tileset = await Cesium.createGooglePhotorealistic3DTileset();\n *   viewer.scene.primitives.add(tileset));\n * } catch (error) {\n *   console.log(`Error creating tileset: ${error}`);\n * }\n */\nasync function createGooglePhotorealistic3DTileset(key, options) {\n  options = defaultValue(options, {});\n  options.cacheBytes = defaultValue(options.cacheBytes, 1536 * 1024 * 1024);\n  options.maximumCacheOverflowBytes = defaultValue(\n    options.maximumCacheOverflowBytes,\n    1024 * 1024 * 1024\n  );\n\n  key = defaultValue(key, GoogleMaps.defaultApiKey);\n  if (!defined(key)) {\n    return requestCachedIonTileset(options);\n  }\n\n  let credits;\n  const credit = GoogleMaps.getDefaultCredit();\n  if (defined(credit)) {\n    credits = [credit];\n  }\n\n  const resource = new Resource({\n    url: `${GoogleMaps.mapTilesApiEndpoint}3dtiles/root.json`,\n    queryParameters: {\n      key: key,\n    },\n    credits: credits,\n  });\n\n  return Cesium3DTileset.fromUrl(resource, options);\n}\n\nconst metadataCache = {};\nasync function requestCachedIonTileset(options) {\n  const ionAssetId = 2275207;\n  const cacheKey = ionAssetId;\n\n  let promise = metadataCache[cacheKey];\n  if (!defined(promise)) {\n    promise = IonResource.fromAssetId(ionAssetId);\n    metadataCache[cacheKey] = promise;\n  }\n\n  const resource = await promise;\n  return Cesium3DTileset.fromUrl(resource, options);\n}\n\nexport default createGooglePhotorealistic3DTileset;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Cesium3DTileset from \"./Cesium3DTileset.js\";\nimport Cesium3DTileStyle from \"./Cesium3DTileStyle.js\";\n\n/**\n * Creates a {@link Cesium3DTileset} instance for the\n * {@link https://cesium.com/content/cesium-osm-buildings/|Cesium OSM Buildings}\n * tileset.\n *\n * @function\n *\n * @param {object} [options] Construction options. Any options allowed by the {@link Cesium3DTileset} constructor\n *        may be specified here. In addition to those, the following properties are supported:\n * @param {Color} [options.defaultColor=Color.WHITE] The default color to use for buildings\n *        that do not have a color. This parameter is ignored if <code>options.style</code> is specified.\n * @param {Cesium3DTileStyle} [options.style] The style to use with the tileset. If not\n *        specified, a default style is used which gives each building or building part a\n *        color inferred from its OpenStreetMap <code>tags</code>. If no color can be inferred,\n *        <code>options.defaultColor</code> is used.\n * @param {boolean} [options.enableShowOutline=true] If true, enable rendering outlines. This can be set to false to avoid the additional processing of geometry at load time.\n * @param {boolean} [options.showOutline=true] Whether to show outlines around buildings. When true,\n *        outlines are displayed. When false, outlines are not displayed.\n * @returns {Promise<Cesium3DTileset>}\n *\n * @see Ion\n *\n * @example\n * // Create Cesium OSM Buildings with default styling\n * const viewer = new Cesium.Viewer(\"cesiumContainer\");\n * try {\n *   const tileset = await Cesium.createOsmBuildingsAsync();\n *   viewer.scene.primitives.add(tileset));\n * } catch (error) {\n *   console.log(`Error creating tileset: ${error}`);\n * }\n *\n * @example\n * // Create Cesium OSM Buildings with a custom style highlighting\n * // schools and hospitals.\n * const viewer = new Cesium.Viewer(\"cesiumContainer\");\n * try {\n *   const tileset = await Cesium.createOsmBuildingsAsync({\n *     style: new Cesium.Cesium3DTileStyle({\n *       color: {\n *         conditions: [\n *           [\"${feature['building']} === 'hospital'\", \"color('#0000FF')\"],\n *           [\"${feature['building']} === 'school'\", \"color('#00FF00')\"],\n *           [true, \"color('#ffffff')\"]\n *         ]\n *       }\n *     })\n *   });\n *   viewer.scene.primitives.add(tileset));\n * } catch (error) {\n *   console.log(`Error creating tileset: ${error}`);\n * }\n */\nasync function createOsmBuildingsAsync(options) {\n  const tileset = await Cesium3DTileset.fromIonAssetId(96188, options);\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  let style = options.style;\n\n  if (!defined(style)) {\n    const color = defaultValue(\n      options.defaultColor,\n      Color.WHITE\n    ).toCssColorString();\n    style = new Cesium3DTileStyle({\n      color: `Boolean(\\${feature['cesium#color']}) ? color(\\${feature['cesium#color']}) : ${color}`,\n    });\n  }\n\n  tileset.style = style;\n\n  return tileset;\n}\n\nexport default createOsmBuildingsAsync;\n", "import ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GeometryPipeline from \"../Core/GeometryPipeline.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\n\n/**\n * Creates a {@link Primitive} to visualize well-known vector vertex attributes:\n * <code>normal</code>, <code>tangent</code>, and <code>bitangent</code>.  Normal\n * is red; tangent is green; and bitangent is blue.  If an attribute is not\n * present, it is not drawn.\n *\n * @function\n *\n * @param {object} options Object with the following properties:\n * @param {Geometry} options.geometry The <code>Geometry</code> instance with the attribute.\n * @param {number} [options.length=10000.0] The length of each line segment in meters.  This can be negative to point the vector in the opposite direction.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The model matrix that transforms to transform the geometry from model to world coordinates.\n * @returns {Primitive} A new <code>Primitive</code> instance with geometry for the vectors.\n *\n * @example\n * scene.primitives.add(Cesium.createTangentSpaceDebugPrimitive({\n *    geometry : instance.geometry,\n *    length : 100000.0,\n *    modelMatrix : instance.modelMatrix\n * }));\n */\nfunction createTangentSpaceDebugPrimitive(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  const instances = [];\n  let geometry = options.geometry;\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(geometry)) {\n    throw new DeveloperError(\"options.geometry is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (!defined(geometry.attributes) || !defined(geometry.primitiveType)) {\n    // to create the debug lines, we need the computed attributes.\n    // compute them if they are undefined.\n    geometry = geometry.constructor.createGeometry(geometry);\n  }\n\n  const attributes = geometry.attributes;\n  const modelMatrix = Matrix4.clone(\n    defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n  );\n  const length = defaultValue(options.length, 10000.0);\n\n  if (defined(attributes.normal)) {\n    instances.push(\n      new GeometryInstance({\n        geometry: GeometryPipeline.createLineSegmentsForVectors(\n          geometry,\n          \"normal\",\n          length\n        ),\n        attributes: {\n          color: new ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 1.0),\n        },\n        modelMatrix: modelMatrix,\n      })\n    );\n  }\n\n  if (defined(attributes.tangent)) {\n    instances.push(\n      new GeometryInstance({\n        geometry: GeometryPipeline.createLineSegmentsForVectors(\n          geometry,\n          \"tangent\",\n          length\n        ),\n        attributes: {\n          color: new ColorGeometryInstanceAttribute(0.0, 1.0, 0.0, 1.0),\n        },\n        modelMatrix: modelMatrix,\n      })\n    );\n  }\n\n  if (defined(attributes.bitangent)) {\n    instances.push(\n      new GeometryInstance({\n        geometry: GeometryPipeline.createLineSegmentsForVectors(\n          geometry,\n          \"bitangent\",\n          length\n        ),\n        attributes: {\n          color: new ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 1.0),\n        },\n        modelMatrix: modelMatrix,\n      })\n    );\n  }\n\n  if (instances.length > 0) {\n    return new Primitive({\n      asynchronous: false,\n      geometryInstances: instances,\n      appearance: new PerInstanceColorAppearance({\n        flat: true,\n        translucent: false,\n      }),\n    });\n  }\n\n  return undefined;\n}\nexport default createTangentSpaceDebugPrimitive;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D u_depthTexture;\\n\\\n\\n\\\nin vec2 v_textureCoordinates;\\n\\\n\\n\\\nvoid main()\\n\\\n{\\n\\\n    float z_window = czm_unpackDepth(texture(u_depthTexture, v_textureCoordinates));\\n\\\n    z_window = czm_reverseLogDepth(z_window);\\n\\\n    float n_range = czm_depthRange.near;\\n\\\n    float f_range = czm_depthRange.far;\\n\\\n    float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\\n\\\n    float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\\n\\\n    out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\\n\\\n}\\n\\\n\";\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Resource from \"../../Core/Resource.js\";\nimport PixelFormat from \"../../Core/PixelFormat.js\";\nimport PixelDatatype from \"../../Renderer/PixelDatatype.js\";\nimport Sampler from \"../../Renderer/Sampler.js\";\nimport TextureWrap from \"../../Renderer/TextureWrap.js\";\n\n/**\n * A simple struct that serves as a value of a <code>sampler2D</code>-valued\n * uniform. This is used with {@link CustomShader} and {@link TextureManager}\n *\n * @param {object} options An object with the following properties:\n * @param {Uint8Array} [options.typedArray] A typed array storing the contents of a texture. Values are stored in row-major order. Since WebGL uses a y-up convention for textures, rows are listed from bottom to top.\n * @param {number} [options.width] The width of the image. Required when options.typedArray is present\n * @param {number} [options.height] The height of the image. Required when options.typedArray is present.\n * @param {string|Resource} [options.url] A URL string or resource pointing to a texture image.\n * @param {boolean} [options.repeat=true] When defined, the texture sampler will be set to wrap in both directions\n * @param {PixelFormat} [options.pixelFormat=PixelFormat.RGBA] When options.typedArray is defined, this is used to determine the pixel format of the texture\n * @param {PixelDatatype} [options.pixelDatatype=PixelDatatype.UNSIGNED_BYTE] When options.typedArray is defined, this is the data type of pixel values in the typed array.\n * @param {TextureMinificationFilter} [options.minificationFilter=TextureMinificationFilter.LINEAR] The minification filter of the texture sampler.\n * @param {TextureMagnificationFilter} [options.magnificationFilter=TextureMagnificationFilter.LINEAR] The magnification filter of the texture sampler.\n * @param {number} [options.maximumAnisotropy=1.0] The maximum anisotropy of the texture sampler\n *\n * @alias TextureUniform\n * @constructor\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction TextureUniform(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n  //>>includeStart('debug', pragmas.debug);\n  const hasTypedArray = defined(options.typedArray);\n  const hasUrl = defined(options.url);\n  if (hasTypedArray === hasUrl) {\n    throw new DeveloperError(\n      \"exactly one of options.typedArray, options.url must be defined\"\n    );\n  }\n  if (hasTypedArray && (!defined(options.width) || !defined(options.height))) {\n    throw new DeveloperError(\n      \"options.width and options.height are required when options.typedArray is defined\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  this.typedArray = options.typedArray;\n  this.width = options.width;\n  this.height = options.height;\n  this.pixelFormat = defaultValue(options.pixelFormat, PixelFormat.RGBA);\n  this.pixelDatatype = defaultValue(\n    options.pixelDatatype,\n    PixelDatatype.UNSIGNED_BYTE\n  );\n\n  let resource = options.url;\n  if (typeof resource === \"string\") {\n    resource = Resource.createIfNeeded(resource);\n  }\n  this.resource = resource;\n\n  const repeat = defaultValue(options.repeat, true);\n  const wrap = repeat ? TextureWrap.REPEAT : TextureWrap.CLAMP_TO_EDGE;\n  this.sampler = new Sampler({\n    wrapS: wrap,\n    wrapT: wrap,\n    minificationFilter: options.minificationFilter,\n    magnificationFilter: options.magnificationFilter,\n    maximumAnisotropy: options.maximumAnisotropy,\n  });\n}\n\nexport default TextureUniform;\n", "/**\n * An enum for the GLSL varying types. These can be used for declaring varyings\n * in {@link CustomShader}\n *\n * @enum {string}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst VaryingType = {\n  /**\n   * A single floating point value.\n   *\n   * @type {string}\n   * @constant\n   */\n  FLOAT: \"float\",\n  /**\n   * A vector of 2 floating point values.\n   *\n   * @type {string}\n   * @constant\n   */\n  VEC2: \"vec2\",\n  /**\n   * A vector of 3 floating point values.\n   *\n   * @type {string}\n   * @constant\n   */\n  VEC3: \"vec3\",\n  /**\n   * A vector of 4 floating point values.\n   *\n   * @type {string}\n   * @constant\n   */\n  VEC4: \"vec4\",\n  /**\n   * A 2x2 matrix of floating point values.\n   *\n   * @type {string}\n   * @constant\n   */\n  MAT2: \"mat2\",\n  /**\n   * A 3x3 matrix of floating point values.\n   *\n   * @type {string}\n   * @constant\n   */\n  MAT3: \"mat2\",\n  /**\n   * A 3x3 matrix of floating point values.\n   *\n   * @type {string}\n   * @constant\n   */\n  MAT4: \"mat4\",\n};\n\nexport default Object.freeze(VaryingType);\n", "import formatError from \"../Core/formatError.js\";\n\n/**\n * Creates an adapter function to allow a calculation function to operate as a Web Worker,\n * paired with TaskProcessor, to receive tasks and return results.\n *\n * @function createTaskProcessorWorker\n *\n * @param {createTaskProcessorWorker.WorkerFunction} workerFunction The calculation function,\n *        which takes parameters and returns a result.\n * @returns {createTaskProcessorWorker.TaskProcessorWorkerFunction} A function that adapts the\n *          calculation function to work as a Web Worker onmessage listener with TaskProcessor.\n *\n *\n * @example\n * function doCalculation(parameters, transferableObjects) {\n *   // calculate some result using the inputs in parameters\n *   return result;\n * }\n *\n * return Cesium.createTaskProcessorWorker(doCalculation);\n * // the resulting function is compatible with TaskProcessor\n *\n * @see TaskProcessor\n * @see {@link http://www.w3.org/TR/workers/|Web Workers}\n * @see {@link http://www.w3.org/TR/html5/common-dom-interfaces.html#transferable-objects|Transferable objects}\n */\nfunction createTaskProcessorWorker(workerFunction) {\n  async function onMessageHandler({ data }) {\n    const transferableObjects = [];\n    const responseMessage = {\n      id: data.id,\n      result: undefined,\n      error: undefined,\n    };\n\n    self.CESIUM_BASE_URL = data.baseUrl;\n\n    try {\n      const result = await workerFunction(data.parameters, transferableObjects);\n      responseMessage.result = result;\n    } catch (error) {\n      if (error instanceof Error) {\n        responseMessage.error = {\n          name: error.name,\n          message: error.message,\n          stack: error.stack,\n        };\n      } else {\n        responseMessage.error = error;\n      }\n    }\n\n    if (!data.canTransferArrayBuffer) {\n      transferableObjects.length = 0;\n    }\n\n    try {\n      postMessage(responseMessage, transferableObjects);\n    } catch (error) {\n      // something went wrong trying to post the message, post a simpler\n      // error that we can be sure will be cloneable\n      responseMessage.result = undefined;\n      responseMessage.error = `postMessage failed with error: ${formatError(\n        error\n      )}\\n  with responseMessage: ${JSON.stringify(responseMessage)}`;\n      postMessage(responseMessage);\n    }\n  }\n\n  function onMessageErrorHandler(event) {\n    postMessage({\n      id: event.data?.id,\n      error: `postMessage failed with error: ${JSON.stringify(event)}`,\n    });\n  }\n\n  self.onmessage = onMessageHandler;\n  self.onmessageerror = onMessageErrorHandler;\n  return self;\n}\n\n/**\n * A function that performs a calculation in a Web Worker.\n * @callback createTaskProcessorWorker.WorkerFunction\n *\n * @param {object} parameters Parameters to the calculation.\n * @param {Array} transferableObjects An array that should be filled with references to objects inside\n *        the result that should be transferred back to the main document instead of copied.\n * @returns {object} The result of the calculation.\n *\n * @example\n * function calculate(parameters, transferableObjects) {\n *   // perform whatever calculation is necessary.\n *   const typedArray = new Float32Array(0);\n *\n *   // typed arrays are transferable\n *   transferableObjects.push(typedArray)\n *\n *   return {\n *      typedArray : typedArray\n *   };\n * }\n */\n\n/**\n * A Web Worker message event handler function that handles the interaction with TaskProcessor,\n * specifically, task ID management and posting a response message containing the result.\n * @callback createTaskProcessorWorker.TaskProcessorWorkerFunction\n *\n * @param {object} event The onmessage event object.\n */\nexport default createTaskProcessorWorker;\n", "globalThis.CESIUM_VERSION = \"1.113\";\nexport { default as AutomaticUniforms } from './Source/Renderer/AutomaticUniforms.js';\nexport { default as Buffer } from './Source/Renderer/Buffer.js';\nexport { default as BufferUsage } from './Source/Renderer/BufferUsage.js';\nexport { default as ClearCommand } from './Source/Renderer/ClearCommand.js';\nexport { default as ComputeCommand } from './Source/Renderer/ComputeCommand.js';\nexport { default as ComputeEngine } from './Source/Renderer/ComputeEngine.js';\nexport { default as Context } from './Source/Renderer/Context.js';\nexport { default as ContextLimits } from './Source/Renderer/ContextLimits.js';\nexport { default as CubeMap } from './Source/Renderer/CubeMap.js';\nexport { default as CubeMapFace } from './Source/Renderer/CubeMapFace.js';\nexport { default as DrawCommand } from './Source/Renderer/DrawCommand.js';\nexport { default as Framebuffer } from './Source/Renderer/Framebuffer.js';\nexport { default as FramebufferManager } from './Source/Renderer/FramebufferManager.js';\nexport { default as MipmapHint } from './Source/Renderer/MipmapHint.js';\nexport { default as MultisampleFramebuffer } from './Source/Renderer/MultisampleFramebuffer.js';\nexport { default as Pass } from './Source/Renderer/Pass.js';\nexport { default as PassState } from './Source/Renderer/PassState.js';\nexport { default as PixelDatatype } from './Source/Renderer/PixelDatatype.js';\nexport { default as RenderState } from './Source/Renderer/RenderState.js';\nexport { default as Renderbuffer } from './Source/Renderer/Renderbuffer.js';\nexport { default as RenderbufferFormat } from './Source/Renderer/RenderbufferFormat.js';\nexport { default as Sampler } from './Source/Renderer/Sampler.js';\nexport { default as ShaderBuilder } from './Source/Renderer/ShaderBuilder.js';\nexport { default as ShaderCache } from './Source/Renderer/ShaderCache.js';\nexport { default as ShaderDestination } from './Source/Renderer/ShaderDestination.js';\nexport { default as ShaderFunction } from './Source/Renderer/ShaderFunction.js';\nexport { default as ShaderProgram } from './Source/Renderer/ShaderProgram.js';\nexport { default as ShaderSource } from './Source/Renderer/ShaderSource.js';\nexport { default as ShaderStruct } from './Source/Renderer/ShaderStruct.js';\nexport { default as Texture } from './Source/Renderer/Texture.js';\nexport { default as TextureCache } from './Source/Renderer/TextureCache.js';\nexport { default as TextureMagnificationFilter } from './Source/Renderer/TextureMagnificationFilter.js';\nexport { default as TextureMinificationFilter } from './Source/Renderer/TextureMinificationFilter.js';\nexport { default as TextureWrap } from './Source/Renderer/TextureWrap.js';\nexport { default as UniformState } from './Source/Renderer/UniformState.js';\nexport { default as VertexArray } from './Source/Renderer/VertexArray.js';\nexport { default as VertexArrayFacade } from './Source/Renderer/VertexArrayFacade.js';\nexport { default as createUniform } from './Source/Renderer/createUniform.js';\nexport { default as createUniformArray } from './Source/Renderer/createUniformArray.js';\nexport { default as demodernizeShader } from './Source/Renderer/demodernizeShader.js';\nexport { default as freezeRenderState } from './Source/Renderer/freezeRenderState.js';\nexport { default as loadCubeMap } from './Source/Renderer/loadCubeMap.js';\nexport { default as BillboardGraphics } from './Source/DataSources/BillboardGraphics.js';\nexport { default as BillboardVisualizer } from './Source/DataSources/BillboardVisualizer.js';\nexport { default as BoundingSphereState } from './Source/DataSources/BoundingSphereState.js';\nexport { default as BoxGeometryUpdater } from './Source/DataSources/BoxGeometryUpdater.js';\nexport { default as BoxGraphics } from './Source/DataSources/BoxGraphics.js';\nexport { default as CallbackProperty } from './Source/DataSources/CallbackProperty.js';\nexport { default as Cesium3DTilesetGraphics } from './Source/DataSources/Cesium3DTilesetGraphics.js';\nexport { default as Cesium3DTilesetVisualizer } from './Source/DataSources/Cesium3DTilesetVisualizer.js';\nexport { default as CheckerboardMaterialProperty } from './Source/DataSources/CheckerboardMaterialProperty.js';\nexport { default as ColorMaterialProperty } from './Source/DataSources/ColorMaterialProperty.js';\nexport { default as CompositeEntityCollection } from './Source/DataSources/CompositeEntityCollection.js';\nexport { default as CompositeMaterialProperty } from './Source/DataSources/CompositeMaterialProperty.js';\nexport { default as CompositePositionProperty } from './Source/DataSources/CompositePositionProperty.js';\nexport { default as CompositeProperty } from './Source/DataSources/CompositeProperty.js';\nexport { default as ConstantPositionProperty } from './Source/DataSources/ConstantPositionProperty.js';\nexport { default as ConstantProperty } from './Source/DataSources/ConstantProperty.js';\nexport { default as CorridorGeometryUpdater } from './Source/DataSources/CorridorGeometryUpdater.js';\nexport { default as CorridorGraphics } from './Source/DataSources/CorridorGraphics.js';\nexport { default as CustomDataSource } from './Source/DataSources/CustomDataSource.js';\nexport { default as CylinderGeometryUpdater } from './Source/DataSources/CylinderGeometryUpdater.js';\nexport { default as CylinderGraphics } from './Source/DataSources/CylinderGraphics.js';\nexport { default as CzmlDataSource } from './Source/DataSources/CzmlDataSource.js';\nexport { default as DataSource } from './Source/DataSources/DataSource.js';\nexport { default as DataSourceClock } from './Source/DataSources/DataSourceClock.js';\nexport { default as DataSourceCollection } from './Source/DataSources/DataSourceCollection.js';\nexport { default as DataSourceDisplay } from './Source/DataSources/DataSourceDisplay.js';\nexport { default as DynamicGeometryBatch } from './Source/DataSources/DynamicGeometryBatch.js';\nexport { default as DynamicGeometryUpdater } from './Source/DataSources/DynamicGeometryUpdater.js';\nexport { default as EllipseGeometryUpdater } from './Source/DataSources/EllipseGeometryUpdater.js';\nexport { default as EllipseGraphics } from './Source/DataSources/EllipseGraphics.js';\nexport { default as EllipsoidGeometryUpdater } from './Source/DataSources/EllipsoidGeometryUpdater.js';\nexport { default as EllipsoidGraphics } from './Source/DataSources/EllipsoidGraphics.js';\nexport { default as Entity } from './Source/DataSources/Entity.js';\nexport { default as EntityCluster } from './Source/DataSources/EntityCluster.js';\nexport { default as EntityCollection } from './Source/DataSources/EntityCollection.js';\nexport { default as EntityView } from './Source/DataSources/EntityView.js';\nexport { default as GeoJsonDataSource } from './Source/DataSources/GeoJsonDataSource.js';\nexport { default as GeometryUpdater } from './Source/DataSources/GeometryUpdater.js';\nexport { default as GeometryVisualizer } from './Source/DataSources/GeometryVisualizer.js';\nexport { default as GpxDataSource } from './Source/DataSources/GpxDataSource.js';\nexport { default as GridMaterialProperty } from './Source/DataSources/GridMaterialProperty.js';\nexport { default as GroundGeometryUpdater } from './Source/DataSources/GroundGeometryUpdater.js';\nexport { default as ImageMaterialProperty } from './Source/DataSources/ImageMaterialProperty.js';\nexport { default as KmlCamera } from './Source/DataSources/KmlCamera.js';\nexport { default as KmlDataSource } from './Source/DataSources/KmlDataSource.js';\nexport { default as KmlLookAt } from './Source/DataSources/KmlLookAt.js';\nexport { default as KmlTour } from './Source/DataSources/KmlTour.js';\nexport { default as KmlTourFlyTo } from './Source/DataSources/KmlTourFlyTo.js';\nexport { default as KmlTourWait } from './Source/DataSources/KmlTourWait.js';\nexport { default as LabelGraphics } from './Source/DataSources/LabelGraphics.js';\nexport { default as LabelVisualizer } from './Source/DataSources/LabelVisualizer.js';\nexport { default as MaterialProperty } from './Source/DataSources/MaterialProperty.js';\nexport { default as ModelGraphics } from './Source/DataSources/ModelGraphics.js';\nexport { default as ModelVisualizer } from './Source/DataSources/ModelVisualizer.js';\nexport { default as NodeTransformationProperty } from './Source/DataSources/NodeTransformationProperty.js';\nexport { default as PathGraphics } from './Source/DataSources/PathGraphics.js';\nexport { default as PathVisualizer } from './Source/DataSources/PathVisualizer.js';\nexport { default as PlaneGeometryUpdater } from './Source/DataSources/PlaneGeometryUpdater.js';\nexport { default as PlaneGraphics } from './Source/DataSources/PlaneGraphics.js';\nexport { default as PointGraphics } from './Source/DataSources/PointGraphics.js';\nexport { default as PointVisualizer } from './Source/DataSources/PointVisualizer.js';\nexport { default as PolygonGeometryUpdater } from './Source/DataSources/PolygonGeometryUpdater.js';\nexport { default as PolygonGraphics } from './Source/DataSources/PolygonGraphics.js';\nexport { default as PolylineArrowMaterialProperty } from './Source/DataSources/PolylineArrowMaterialProperty.js';\nexport { default as PolylineDashMaterialProperty } from './Source/DataSources/PolylineDashMaterialProperty.js';\nexport { default as PolylineGeometryUpdater } from './Source/DataSources/PolylineGeometryUpdater.js';\nexport { default as PolylineGlowMaterialProperty } from './Source/DataSources/PolylineGlowMaterialProperty.js';\nexport { default as PolylineGraphics } from './Source/DataSources/PolylineGraphics.js';\nexport { default as PolylineOutlineMaterialProperty } from './Source/DataSources/PolylineOutlineMaterialProperty.js';\nexport { default as PolylineVisualizer } from './Source/DataSources/PolylineVisualizer.js';\nexport { default as PolylineVolumeGeometryUpdater } from './Source/DataSources/PolylineVolumeGeometryUpdater.js';\nexport { default as PolylineVolumeGraphics } from './Source/DataSources/PolylineVolumeGraphics.js';\nexport { default as PositionProperty } from './Source/DataSources/PositionProperty.js';\nexport { default as PositionPropertyArray } from './Source/DataSources/PositionPropertyArray.js';\nexport { default as Property } from './Source/DataSources/Property.js';\nexport { default as PropertyArray } from './Source/DataSources/PropertyArray.js';\nexport { default as PropertyBag } from './Source/DataSources/PropertyBag.js';\nexport { default as RectangleGeometryUpdater } from './Source/DataSources/RectangleGeometryUpdater.js';\nexport { default as RectangleGraphics } from './Source/DataSources/RectangleGraphics.js';\nexport { default as ReferenceProperty } from './Source/DataSources/ReferenceProperty.js';\nexport { default as Rotation } from './Source/DataSources/Rotation.js';\nexport { default as SampledPositionProperty } from './Source/DataSources/SampledPositionProperty.js';\nexport { default as SampledProperty } from './Source/DataSources/SampledProperty.js';\nexport { default as ScaledPositionProperty } from './Source/DataSources/ScaledPositionProperty.js';\nexport { default as StaticGeometryColorBatch } from './Source/DataSources/StaticGeometryColorBatch.js';\nexport { default as StaticGeometryPerMaterialBatch } from './Source/DataSources/StaticGeometryPerMaterialBatch.js';\nexport { default as StaticGroundGeometryColorBatch } from './Source/DataSources/StaticGroundGeometryColorBatch.js';\nexport { default as StaticGroundGeometryPerMaterialBatch } from './Source/DataSources/StaticGroundGeometryPerMaterialBatch.js';\nexport { default as StaticGroundPolylinePerMaterialBatch } from './Source/DataSources/StaticGroundPolylinePerMaterialBatch.js';\nexport { default as StaticOutlineGeometryBatch } from './Source/DataSources/StaticOutlineGeometryBatch.js';\nexport { default as StripeMaterialProperty } from './Source/DataSources/StripeMaterialProperty.js';\nexport { default as StripeOrientation } from './Source/DataSources/StripeOrientation.js';\nexport { default as TerrainOffsetProperty } from './Source/DataSources/TerrainOffsetProperty.js';\nexport { default as TimeIntervalCollectionPositionProperty } from './Source/DataSources/TimeIntervalCollectionPositionProperty.js';\nexport { default as TimeIntervalCollectionProperty } from './Source/DataSources/TimeIntervalCollectionProperty.js';\nexport { default as VelocityOrientationProperty } from './Source/DataSources/VelocityOrientationProperty.js';\nexport { default as VelocityVectorProperty } from './Source/DataSources/VelocityVectorProperty.js';\nexport { default as Visualizer } from './Source/DataSources/Visualizer.js';\nexport { default as WallGeometryUpdater } from './Source/DataSources/WallGeometryUpdater.js';\nexport { default as WallGraphics } from './Source/DataSources/WallGraphics.js';\nexport { default as createMaterialPropertyDescriptor } from './Source/DataSources/createMaterialPropertyDescriptor.js';\nexport { default as createPropertyDescriptor } from './Source/DataSources/createPropertyDescriptor.js';\nexport { default as createRawPropertyDescriptor } from './Source/DataSources/createRawPropertyDescriptor.js';\nexport { default as exportKml } from './Source/DataSources/exportKml.js';\nexport { default as getElement } from './Source/DataSources/getElement.js';\nexport { default as heightReferenceOnEntityPropertyChanged } from './Source/DataSources/heightReferenceOnEntityPropertyChanged.js';\nexport { default as CesiumWidget } from './Source/Widget/CesiumWidget.js';\nexport { default as _shadersAdjustTranslucentFS } from './Source/Shaders/AdjustTranslucentFS.js';\nexport { default as _shadersAtmosphereCommon } from './Source/Shaders/AtmosphereCommon.js';\nexport { default as _shadersBillboardCollectionFS } from './Source/Shaders/BillboardCollectionFS.js';\nexport { default as _shadersBillboardCollectionVS } from './Source/Shaders/BillboardCollectionVS.js';\nexport { default as _shadersBrdfLutGeneratorFS } from './Source/Shaders/BrdfLutGeneratorFS.js';\nexport { default as _shadersCloudCollectionFS } from './Source/Shaders/CloudCollectionFS.js';\nexport { default as _shadersCloudCollectionVS } from './Source/Shaders/CloudCollectionVS.js';\nexport { default as _shadersCloudNoiseFS } from './Source/Shaders/CloudNoiseFS.js';\nexport { default as _shadersCloudNoiseVS } from './Source/Shaders/CloudNoiseVS.js';\nexport { default as _shadersCompareAndPackTranslucentDepth } from './Source/Shaders/CompareAndPackTranslucentDepth.js';\nexport { default as _shadersCompositeOITFS } from './Source/Shaders/CompositeOITFS.js';\nexport { default as _shadersDepthPlaneFS } from './Source/Shaders/DepthPlaneFS.js';\nexport { default as _shadersDepthPlaneVS } from './Source/Shaders/DepthPlaneVS.js';\nexport { default as _shadersEllipsoidFS } from './Source/Shaders/EllipsoidFS.js';\nexport { default as _shadersEllipsoidVS } from './Source/Shaders/EllipsoidVS.js';\nexport { default as _shadersFXAA3_11 } from './Source/Shaders/FXAA3_11.js';\nexport { default as _shadersGlobeFS } from './Source/Shaders/GlobeFS.js';\nexport { default as _shadersGlobeVS } from './Source/Shaders/GlobeVS.js';\nexport { default as _shadersGroundAtmosphere } from './Source/Shaders/GroundAtmosphere.js';\nexport { default as _shadersOctahedralProjectionAtlasFS } from './Source/Shaders/OctahedralProjectionAtlasFS.js';\nexport { default as _shadersOctahedralProjectionFS } from './Source/Shaders/OctahedralProjectionFS.js';\nexport { default as _shadersOctahedralProjectionVS } from './Source/Shaders/OctahedralProjectionVS.js';\nexport { default as _shadersPointPrimitiveCollectionFS } from './Source/Shaders/PointPrimitiveCollectionFS.js';\nexport { default as _shadersPointPrimitiveCollectionVS } from './Source/Shaders/PointPrimitiveCollectionVS.js';\nexport { default as _shadersPolylineCommon } from './Source/Shaders/PolylineCommon.js';\nexport { default as _shadersPolylineFS } from './Source/Shaders/PolylineFS.js';\nexport { default as _shadersPolylineShadowVolumeFS } from './Source/Shaders/PolylineShadowVolumeFS.js';\nexport { default as _shadersPolylineShadowVolumeMorphFS } from './Source/Shaders/PolylineShadowVolumeMorphFS.js';\nexport { default as _shadersPolylineShadowVolumeMorphVS } from './Source/Shaders/PolylineShadowVolumeMorphVS.js';\nexport { default as _shadersPolylineShadowVolumeVS } from './Source/Shaders/PolylineShadowVolumeVS.js';\nexport { default as _shadersPolylineVS } from './Source/Shaders/PolylineVS.js';\nexport { default as _shadersReprojectWebMercatorFS } from './Source/Shaders/ReprojectWebMercatorFS.js';\nexport { default as _shadersReprojectWebMercatorVS } from './Source/Shaders/ReprojectWebMercatorVS.js';\nexport { default as _shadersShadowVolumeAppearanceFS } from './Source/Shaders/ShadowVolumeAppearanceFS.js';\nexport { default as _shadersShadowVolumeAppearanceVS } from './Source/Shaders/ShadowVolumeAppearanceVS.js';\nexport { default as _shadersShadowVolumeFS } from './Source/Shaders/ShadowVolumeFS.js';\nexport { default as _shadersSkyAtmosphereCommon } from './Source/Shaders/SkyAtmosphereCommon.js';\nexport { default as _shadersSkyAtmosphereFS } from './Source/Shaders/SkyAtmosphereFS.js';\nexport { default as _shadersSkyAtmosphereVS } from './Source/Shaders/SkyAtmosphereVS.js';\nexport { default as _shadersSkyBoxFS } from './Source/Shaders/SkyBoxFS.js';\nexport { default as _shadersSkyBoxVS } from './Source/Shaders/SkyBoxVS.js';\nexport { default as _shadersSunFS } from './Source/Shaders/SunFS.js';\nexport { default as _shadersSunTextureFS } from './Source/Shaders/SunTextureFS.js';\nexport { default as _shadersSunVS } from './Source/Shaders/SunVS.js';\nexport { default as _shadersVector3DTileClampedPolylinesFS } from './Source/Shaders/Vector3DTileClampedPolylinesFS.js';\nexport { default as _shadersVector3DTileClampedPolylinesVS } from './Source/Shaders/Vector3DTileClampedPolylinesVS.js';\nexport { default as _shadersVector3DTilePolylinesVS } from './Source/Shaders/Vector3DTilePolylinesVS.js';\nexport { default as _shadersVectorTileVS } from './Source/Shaders/VectorTileVS.js';\nexport { default as _shadersViewportQuadFS } from './Source/Shaders/ViewportQuadFS.js';\nexport { default as _shadersViewportQuadVS } from './Source/Shaders/ViewportQuadVS.js';\nexport { default as ApproximateTerrainHeights } from './Source/Core/ApproximateTerrainHeights.js';\nexport { default as ArcGISTiledElevationTerrainProvider } from './Source/Core/ArcGISTiledElevationTerrainProvider.js';\nexport { default as ArcType } from './Source/Core/ArcType.js';\nexport { default as ArticulationStageType } from './Source/Core/ArticulationStageType.js';\nexport { default as AssociativeArray } from './Source/Core/AssociativeArray.js';\nexport { default as AttributeCompression } from './Source/Core/AttributeCompression.js';\nexport { default as AxisAlignedBoundingBox } from './Source/Core/AxisAlignedBoundingBox.js';\nexport { default as BingMapsGeocoderService } from './Source/Core/BingMapsGeocoderService.js';\nexport { default as BoundingRectangle } from './Source/Core/BoundingRectangle.js';\nexport { default as BoundingSphere } from './Source/Core/BoundingSphere.js';\nexport { default as BoxGeometry } from './Source/Core/BoxGeometry.js';\nexport { default as BoxOutlineGeometry } from './Source/Core/BoxOutlineGeometry.js';\nexport { default as Cartesian2 } from './Source/Core/Cartesian2.js';\nexport { default as Cartesian3 } from './Source/Core/Cartesian3.js';\nexport { default as Cartesian4 } from './Source/Core/Cartesian4.js';\nexport { default as Cartographic } from './Source/Core/Cartographic.js';\nexport { default as CartographicGeocoderService } from './Source/Core/CartographicGeocoderService.js';\nexport { default as CatmullRomSpline } from './Source/Core/CatmullRomSpline.js';\nexport { default as CesiumTerrainProvider } from './Source/Core/CesiumTerrainProvider.js';\nexport { default as Check } from './Source/Core/Check.js';\nexport { default as CircleGeometry } from './Source/Core/CircleGeometry.js';\nexport { default as CircleOutlineGeometry } from './Source/Core/CircleOutlineGeometry.js';\nexport { default as Clock } from './Source/Core/Clock.js';\nexport { default as ClockRange } from './Source/Core/ClockRange.js';\nexport { default as ClockStep } from './Source/Core/ClockStep.js';\nexport { default as Color } from './Source/Core/Color.js';\nexport { default as ColorGeometryInstanceAttribute } from './Source/Core/ColorGeometryInstanceAttribute.js';\nexport { default as ComponentDatatype } from './Source/Core/ComponentDatatype.js';\nexport { default as CompressedTextureBuffer } from './Source/Core/CompressedTextureBuffer.js';\nexport { default as ConstantSpline } from './Source/Core/ConstantSpline.js';\nexport { default as CoplanarPolygonGeometry } from './Source/Core/CoplanarPolygonGeometry.js';\nexport { default as CoplanarPolygonGeometryLibrary } from './Source/Core/CoplanarPolygonGeometryLibrary.js';\nexport { default as CoplanarPolygonOutlineGeometry } from './Source/Core/CoplanarPolygonOutlineGeometry.js';\nexport { default as CornerType } from './Source/Core/CornerType.js';\nexport { default as CorridorGeometry } from './Source/Core/CorridorGeometry.js';\nexport { default as CorridorGeometryLibrary } from './Source/Core/CorridorGeometryLibrary.js';\nexport { default as CorridorOutlineGeometry } from './Source/Core/CorridorOutlineGeometry.js';\nexport { default as Credit } from './Source/Core/Credit.js';\nexport { default as CubicRealPolynomial } from './Source/Core/CubicRealPolynomial.js';\nexport { default as CullingVolume } from './Source/Core/CullingVolume.js';\nexport { default as CustomHeightmapTerrainProvider } from './Source/Core/CustomHeightmapTerrainProvider.js';\nexport { default as CylinderGeometry } from './Source/Core/CylinderGeometry.js';\nexport { default as CylinderGeometryLibrary } from './Source/Core/CylinderGeometryLibrary.js';\nexport { default as CylinderOutlineGeometry } from './Source/Core/CylinderOutlineGeometry.js';\nexport { default as DefaultProxy } from './Source/Core/DefaultProxy.js';\nexport { default as DeveloperError } from './Source/Core/DeveloperError.js';\nexport { default as DistanceDisplayCondition } from './Source/Core/DistanceDisplayCondition.js';\nexport { default as DistanceDisplayConditionGeometryInstanceAttribute } from './Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js';\nexport { default as DoubleEndedPriorityQueue } from './Source/Core/DoubleEndedPriorityQueue.js';\nexport { default as DoublyLinkedList } from './Source/Core/DoublyLinkedList.js';\nexport { default as EarthOrientationParameters } from './Source/Core/EarthOrientationParameters.js';\nexport { default as EarthOrientationParametersSample } from './Source/Core/EarthOrientationParametersSample.js';\nexport { default as EasingFunction } from './Source/Core/EasingFunction.js';\nexport { default as EllipseGeometry } from './Source/Core/EllipseGeometry.js';\nexport { default as EllipseGeometryLibrary } from './Source/Core/EllipseGeometryLibrary.js';\nexport { default as EllipseOutlineGeometry } from './Source/Core/EllipseOutlineGeometry.js';\nexport { default as Ellipsoid } from './Source/Core/Ellipsoid.js';\nexport { default as EllipsoidGeodesic } from './Source/Core/EllipsoidGeodesic.js';\nexport { default as EllipsoidGeometry } from './Source/Core/EllipsoidGeometry.js';\nexport { default as EllipsoidOutlineGeometry } from './Source/Core/EllipsoidOutlineGeometry.js';\nexport { default as EllipsoidRhumbLine } from './Source/Core/EllipsoidRhumbLine.js';\nexport { default as EllipsoidTangentPlane } from './Source/Core/EllipsoidTangentPlane.js';\nexport { default as EllipsoidTerrainProvider } from './Source/Core/EllipsoidTerrainProvider.js';\nexport { default as EllipsoidalOccluder } from './Source/Core/EllipsoidalOccluder.js';\nexport { default as EncodedCartesian3 } from './Source/Core/EncodedCartesian3.js';\nexport { default as Event } from './Source/Core/Event.js';\nexport { default as EventHelper } from './Source/Core/EventHelper.js';\nexport { default as ExtrapolationType } from './Source/Core/ExtrapolationType.js';\nexport { default as FeatureDetection } from './Source/Core/FeatureDetection.js';\nexport { default as FrustumGeometry } from './Source/Core/FrustumGeometry.js';\nexport { default as FrustumOutlineGeometry } from './Source/Core/FrustumOutlineGeometry.js';\nexport { default as Fullscreen } from './Source/Core/Fullscreen.js';\nexport { default as GeocodeType } from './Source/Core/GeocodeType.js';\nexport { default as GeocoderService } from './Source/Core/GeocoderService.js';\nexport { default as GeographicProjection } from './Source/Core/GeographicProjection.js';\nexport { default as GeographicTilingScheme } from './Source/Core/GeographicTilingScheme.js';\nexport { default as Geometry } from './Source/Core/Geometry.js';\nexport { default as GeometryAttribute } from './Source/Core/GeometryAttribute.js';\nexport { default as GeometryAttributes } from './Source/Core/GeometryAttributes.js';\nexport { default as GeometryFactory } from './Source/Core/GeometryFactory.js';\nexport { default as GeometryInstance } from './Source/Core/GeometryInstance.js';\nexport { default as GeometryInstanceAttribute } from './Source/Core/GeometryInstanceAttribute.js';\nexport { default as GeometryOffsetAttribute } from './Source/Core/GeometryOffsetAttribute.js';\nexport { default as GeometryPipeline } from './Source/Core/GeometryPipeline.js';\nexport { default as GeometryType } from './Source/Core/GeometryType.js';\nexport { default as GoogleEarthEnterpriseMetadata } from './Source/Core/GoogleEarthEnterpriseMetadata.js';\nexport { default as GoogleEarthEnterpriseTerrainData } from './Source/Core/GoogleEarthEnterpriseTerrainData.js';\nexport { default as GoogleEarthEnterpriseTerrainProvider } from './Source/Core/GoogleEarthEnterpriseTerrainProvider.js';\nexport { default as GoogleEarthEnterpriseTileInformation } from './Source/Core/GoogleEarthEnterpriseTileInformation.js';\nexport { default as GoogleMaps } from './Source/Core/GoogleMaps.js';\nexport { default as GregorianDate } from './Source/Core/GregorianDate.js';\nexport { default as GroundPolylineGeometry } from './Source/Core/GroundPolylineGeometry.js';\nexport { default as HeadingPitchRange } from './Source/Core/HeadingPitchRange.js';\nexport { default as HeadingPitchRoll } from './Source/Core/HeadingPitchRoll.js';\nexport { default as Heap } from './Source/Core/Heap.js';\nexport { default as HeightmapEncoding } from './Source/Core/HeightmapEncoding.js';\nexport { default as HeightmapTerrainData } from './Source/Core/HeightmapTerrainData.js';\nexport { default as HeightmapTessellator } from './Source/Core/HeightmapTessellator.js';\nexport { default as HermitePolynomialApproximation } from './Source/Core/HermitePolynomialApproximation.js';\nexport { default as HermiteSpline } from './Source/Core/HermiteSpline.js';\nexport { default as HilbertOrder } from './Source/Core/HilbertOrder.js';\nexport { default as Iau2000Orientation } from './Source/Core/Iau2000Orientation.js';\nexport { default as Iau2006XysData } from './Source/Core/Iau2006XysData.js';\nexport { default as Iau2006XysSample } from './Source/Core/Iau2006XysSample.js';\nexport { default as IauOrientationAxes } from './Source/Core/IauOrientationAxes.js';\nexport { default as IauOrientationParameters } from './Source/Core/IauOrientationParameters.js';\nexport { default as IndexDatatype } from './Source/Core/IndexDatatype.js';\nexport { default as InterpolationAlgorithm } from './Source/Core/InterpolationAlgorithm.js';\nexport { default as InterpolationType } from './Source/Core/InterpolationType.js';\nexport { default as Intersect } from './Source/Core/Intersect.js';\nexport { default as IntersectionTests } from './Source/Core/IntersectionTests.js';\nexport { default as Intersections2D } from './Source/Core/Intersections2D.js';\nexport { default as Interval } from './Source/Core/Interval.js';\nexport { default as Ion } from './Source/Core/Ion.js';\nexport { default as IonGeocoderService } from './Source/Core/IonGeocoderService.js';\nexport { default as IonResource } from './Source/Core/IonResource.js';\nexport { default as Iso8601 } from './Source/Core/Iso8601.js';\nexport { default as JulianDate } from './Source/Core/JulianDate.js';\nexport { default as KTX2Transcoder } from './Source/Core/KTX2Transcoder.js';\nexport { default as KeyboardEventModifier } from './Source/Core/KeyboardEventModifier.js';\nexport { default as LagrangePolynomialApproximation } from './Source/Core/LagrangePolynomialApproximation.js';\nexport { default as LeapSecond } from './Source/Core/LeapSecond.js';\nexport { default as LinearApproximation } from './Source/Core/LinearApproximation.js';\nexport { default as LinearSpline } from './Source/Core/LinearSpline.js';\nexport { default as ManagedArray } from './Source/Core/ManagedArray.js';\nexport { default as MapProjection } from './Source/Core/MapProjection.js';\nexport { default as Math } from './Source/Core/Math.js';\nexport { default as Matrix2 } from './Source/Core/Matrix2.js';\nexport { default as Matrix3 } from './Source/Core/Matrix3.js';\nexport { default as Matrix4 } from './Source/Core/Matrix4.js';\nexport { default as MorphWeightSpline } from './Source/Core/MorphWeightSpline.js';\nexport { default as MortonOrder } from './Source/Core/MortonOrder.js';\nexport { default as NearFarScalar } from './Source/Core/NearFarScalar.js';\nexport { default as Occluder } from './Source/Core/Occluder.js';\nexport { default as OffsetGeometryInstanceAttribute } from './Source/Core/OffsetGeometryInstanceAttribute.js';\nexport { default as OpenCageGeocoderService } from './Source/Core/OpenCageGeocoderService.js';\nexport { default as OrientedBoundingBox } from './Source/Core/OrientedBoundingBox.js';\nexport { default as OrthographicFrustum } from './Source/Core/OrthographicFrustum.js';\nexport { default as OrthographicOffCenterFrustum } from './Source/Core/OrthographicOffCenterFrustum.js';\nexport { default as Packable } from './Source/Core/Packable.js';\nexport { default as PackableForInterpolation } from './Source/Core/PackableForInterpolation.js';\nexport { default as PeliasGeocoderService } from './Source/Core/PeliasGeocoderService.js';\nexport { default as PerspectiveFrustum } from './Source/Core/PerspectiveFrustum.js';\nexport { default as PerspectiveOffCenterFrustum } from './Source/Core/PerspectiveOffCenterFrustum.js';\nexport { default as PinBuilder } from './Source/Core/PinBuilder.js';\nexport { default as PixelFormat } from './Source/Core/PixelFormat.js';\nexport { default as Plane } from './Source/Core/Plane.js';\nexport { default as PlaneGeometry } from './Source/Core/PlaneGeometry.js';\nexport { default as PlaneOutlineGeometry } from './Source/Core/PlaneOutlineGeometry.js';\nexport { default as PolygonGeometry } from './Source/Core/PolygonGeometry.js';\nexport { default as PolygonGeometryLibrary } from './Source/Core/PolygonGeometryLibrary.js';\nexport { default as PolygonHierarchy } from './Source/Core/PolygonHierarchy.js';\nexport { default as PolygonOutlineGeometry } from './Source/Core/PolygonOutlineGeometry.js';\nexport { default as PolygonPipeline } from './Source/Core/PolygonPipeline.js';\nexport { default as PolylineGeometry } from './Source/Core/PolylineGeometry.js';\nexport { default as PolylinePipeline } from './Source/Core/PolylinePipeline.js';\nexport { default as PolylineVolumeGeometry } from './Source/Core/PolylineVolumeGeometry.js';\nexport { default as PolylineVolumeGeometryLibrary } from './Source/Core/PolylineVolumeGeometryLibrary.js';\nexport { default as PolylineVolumeOutlineGeometry } from './Source/Core/PolylineVolumeOutlineGeometry.js';\nexport { default as PrimitiveType } from './Source/Core/PrimitiveType.js';\nexport { default as Proxy } from './Source/Core/Proxy.js';\nexport { default as QuadraticRealPolynomial } from './Source/Core/QuadraticRealPolynomial.js';\nexport { default as QuantizedMeshTerrainData } from './Source/Core/QuantizedMeshTerrainData.js';\nexport { default as QuarticRealPolynomial } from './Source/Core/QuarticRealPolynomial.js';\nexport { default as Quaternion } from './Source/Core/Quaternion.js';\nexport { default as QuaternionSpline } from './Source/Core/QuaternionSpline.js';\nexport { default as Queue } from './Source/Core/Queue.js';\nexport { default as Ray } from './Source/Core/Ray.js';\nexport { default as Rectangle } from './Source/Core/Rectangle.js';\nexport { default as RectangleCollisionChecker } from './Source/Core/RectangleCollisionChecker.js';\nexport { default as RectangleGeometry } from './Source/Core/RectangleGeometry.js';\nexport { default as RectangleGeometryLibrary } from './Source/Core/RectangleGeometryLibrary.js';\nexport { default as RectangleOutlineGeometry } from './Source/Core/RectangleOutlineGeometry.js';\nexport { default as ReferenceFrame } from './Source/Core/ReferenceFrame.js';\nexport { default as Request } from './Source/Core/Request.js';\nexport { default as RequestErrorEvent } from './Source/Core/RequestErrorEvent.js';\nexport { default as RequestScheduler } from './Source/Core/RequestScheduler.js';\nexport { default as RequestState } from './Source/Core/RequestState.js';\nexport { default as RequestType } from './Source/Core/RequestType.js';\nexport { default as Resource } from './Source/Core/Resource.js';\nexport { default as RuntimeError } from './Source/Core/RuntimeError.js';\nexport { default as S2Cell } from './Source/Core/S2Cell.js';\nexport { default as ScreenSpaceEventHandler } from './Source/Core/ScreenSpaceEventHandler.js';\nexport { default as ScreenSpaceEventType } from './Source/Core/ScreenSpaceEventType.js';\nexport { default as ShowGeometryInstanceAttribute } from './Source/Core/ShowGeometryInstanceAttribute.js';\nexport { default as Simon1994PlanetaryPositions } from './Source/Core/Simon1994PlanetaryPositions.js';\nexport { default as SimplePolylineGeometry } from './Source/Core/SimplePolylineGeometry.js';\nexport { default as SphereGeometry } from './Source/Core/SphereGeometry.js';\nexport { default as SphereOutlineGeometry } from './Source/Core/SphereOutlineGeometry.js';\nexport { default as Spherical } from './Source/Core/Spherical.js';\nexport { default as Spline } from './Source/Core/Spline.js';\nexport { default as SteppedSpline } from './Source/Core/SteppedSpline.js';\nexport { default as Stereographic } from './Source/Core/Stereographic.js';\nexport { default as TaskProcessor } from './Source/Core/TaskProcessor.js';\nexport { default as TerrainData } from './Source/Core/TerrainData.js';\nexport { default as TerrainEncoding } from './Source/Core/TerrainEncoding.js';\nexport { default as TerrainMesh } from './Source/Core/TerrainMesh.js';\nexport { default as TerrainProvider } from './Source/Core/TerrainProvider.js';\nexport { default as TerrainQuantization } from './Source/Core/TerrainQuantization.js';\nexport { default as TileAvailability } from './Source/Core/TileAvailability.js';\nexport { default as TileEdge } from './Source/Core/TileEdge.js';\nexport { default as TileProviderError } from './Source/Core/TileProviderError.js';\nexport { default as TilingScheme } from './Source/Core/TilingScheme.js';\nexport { default as TimeConstants } from './Source/Core/TimeConstants.js';\nexport { default as TimeInterval } from './Source/Core/TimeInterval.js';\nexport { default as TimeIntervalCollection } from './Source/Core/TimeIntervalCollection.js';\nexport { default as TimeStandard } from './Source/Core/TimeStandard.js';\nexport { default as Tipsify } from './Source/Core/Tipsify.js';\nexport { default as Transforms } from './Source/Core/Transforms.js';\nexport { default as TranslationRotationScale } from './Source/Core/TranslationRotationScale.js';\nexport { default as TridiagonalSystemSolver } from './Source/Core/TridiagonalSystemSolver.js';\nexport { default as TrustedServers } from './Source/Core/TrustedServers.js';\nexport { default as VRTheWorldTerrainProvider } from './Source/Core/VRTheWorldTerrainProvider.js';\nexport { default as VertexFormat } from './Source/Core/VertexFormat.js';\nexport { default as VerticalExaggeration } from './Source/Core/VerticalExaggeration.js';\nexport { default as VideoSynchronizer } from './Source/Core/VideoSynchronizer.js';\nexport { default as Visibility } from './Source/Core/Visibility.js';\nexport { default as VulkanConstants } from './Source/Core/VulkanConstants.js';\nexport { default as WallGeometry } from './Source/Core/WallGeometry.js';\nexport { default as WallGeometryLibrary } from './Source/Core/WallGeometryLibrary.js';\nexport { default as WallOutlineGeometry } from './Source/Core/WallOutlineGeometry.js';\nexport { default as WebGLConstants } from './Source/Core/WebGLConstants.js';\nexport { default as WebMercatorProjection } from './Source/Core/WebMercatorProjection.js';\nexport { default as WebMercatorTilingScheme } from './Source/Core/WebMercatorTilingScheme.js';\nexport { default as WindingOrder } from './Source/Core/WindingOrder.js';\nexport { default as WireframeIndexGenerator } from './Source/Core/WireframeIndexGenerator.js';\nexport { default as appendForwardSlash } from './Source/Core/appendForwardSlash.js';\nexport { default as arrayRemoveDuplicates } from './Source/Core/arrayRemoveDuplicates.js';\nexport { default as barycentricCoordinates } from './Source/Core/barycentricCoordinates.js';\nexport { default as binarySearch } from './Source/Core/binarySearch.js';\nexport { default as buildModuleUrl } from './Source/Core/buildModuleUrl.js';\nexport { default as clone } from './Source/Core/clone.js';\nexport { default as combine } from './Source/Core/combine.js';\nexport { default as createGuid } from './Source/Core/createGuid.js';\nexport { default as createWorldTerrainAsync } from './Source/Core/createWorldTerrainAsync.js';\nexport { default as decodeGoogleEarthEnterpriseData } from './Source/Core/decodeGoogleEarthEnterpriseData.js';\nexport { default as decodeVectorPolylinePositions } from './Source/Core/decodeVectorPolylinePositions.js';\nexport { default as defaultValue } from './Source/Core/defaultValue.js';\nexport { default as defer } from './Source/Core/defer.js';\nexport { default as defined } from './Source/Core/defined.js';\nexport { default as deprecationWarning } from './Source/Core/deprecationWarning.js';\nexport { default as destroyObject } from './Source/Core/destroyObject.js';\nexport { default as formatError } from './Source/Core/formatError.js';\nexport { default as getAbsoluteUri } from './Source/Core/getAbsoluteUri.js';\nexport { default as getBaseUri } from './Source/Core/getBaseUri.js';\nexport { default as getExtensionFromUri } from './Source/Core/getExtensionFromUri.js';\nexport { default as getFilenameFromUri } from './Source/Core/getFilenameFromUri.js';\nexport { default as getImageFromTypedArray } from './Source/Core/getImageFromTypedArray.js';\nexport { default as getImagePixels } from './Source/Core/getImagePixels.js';\nexport { default as getJsonFromTypedArray } from './Source/Core/getJsonFromTypedArray.js';\nexport { default as getMagic } from './Source/Core/getMagic.js';\nexport { default as getStringFromTypedArray } from './Source/Core/getStringFromTypedArray.js';\nexport { default as getTimestamp } from './Source/Core/getTimestamp.js';\nexport { default as isBitSet } from './Source/Core/isBitSet.js';\nexport { default as isBlobUri } from './Source/Core/isBlobUri.js';\nexport { default as isCrossOriginUrl } from './Source/Core/isCrossOriginUrl.js';\nexport { default as isDataUri } from './Source/Core/isDataUri.js';\nexport { default as isLeapYear } from './Source/Core/isLeapYear.js';\nexport { default as loadAndExecuteScript } from './Source/Core/loadAndExecuteScript.js';\nexport { default as loadImageFromTypedArray } from './Source/Core/loadImageFromTypedArray.js';\nexport { default as loadKTX2 } from './Source/Core/loadKTX2.js';\nexport { default as mergeSort } from './Source/Core/mergeSort.js';\nexport { default as objectToQuery } from './Source/Core/objectToQuery.js';\nexport { default as oneTimeWarning } from './Source/Core/oneTimeWarning.js';\nexport { default as parseResponseHeaders } from './Source/Core/parseResponseHeaders.js';\nexport { default as pointInsideTriangle } from './Source/Core/pointInsideTriangle.js';\nexport { default as queryToObject } from './Source/Core/queryToObject.js';\nexport { default as resizeImageToNextPowerOfTwo } from './Source/Core/resizeImageToNextPowerOfTwo.js';\nexport { default as sampleTerrain } from './Source/Core/sampleTerrain.js';\nexport { default as sampleTerrainMostDetailed } from './Source/Core/sampleTerrainMostDetailed.js';\nexport { default as scaleToGeodeticSurface } from './Source/Core/scaleToGeodeticSurface.js';\nexport { default as subdivideArray } from './Source/Core/subdivideArray.js';\nexport { default as webGLConstantToGlslType } from './Source/Core/webGLConstantToGlslType.js';\nexport { default as wrapFunction } from './Source/Core/wrapFunction.js';\nexport { default as writeTextToCanvas } from './Source/Core/writeTextToCanvas.js';\nexport { default as AlphaMode } from './Source/Scene/AlphaMode.js';\nexport { default as Appearance } from './Source/Scene/Appearance.js';\nexport { default as ArcGisBaseMapType } from './Source/Scene/ArcGisBaseMapType.js';\nexport { default as ArcGisMapServerImageryProvider } from './Source/Scene/ArcGisMapServerImageryProvider.js';\nexport { default as ArcGisMapService } from './Source/Scene/ArcGisMapService.js';\nexport { default as AttributeType } from './Source/Scene/AttributeType.js';\nexport { default as AutoExposure } from './Source/Scene/AutoExposure.js';\nexport { default as Axis } from './Source/Scene/Axis.js';\nexport { default as B3dmParser } from './Source/Scene/B3dmParser.js';\nexport { default as BatchTable } from './Source/Scene/BatchTable.js';\nexport { default as BatchTableHierarchy } from './Source/Scene/BatchTableHierarchy.js';\nexport { default as BatchTexture } from './Source/Scene/BatchTexture.js';\nexport { default as Billboard } from './Source/Scene/Billboard.js';\nexport { default as BillboardCollection } from './Source/Scene/BillboardCollection.js';\nexport { default as BingMapsImageryProvider } from './Source/Scene/BingMapsImageryProvider.js';\nexport { default as BingMapsStyle } from './Source/Scene/BingMapsStyle.js';\nexport { default as BlendEquation } from './Source/Scene/BlendEquation.js';\nexport { default as BlendFunction } from './Source/Scene/BlendFunction.js';\nexport { default as BlendOption } from './Source/Scene/BlendOption.js';\nexport { default as BlendingState } from './Source/Scene/BlendingState.js';\nexport { default as BoundingVolumeSemantics } from './Source/Scene/BoundingVolumeSemantics.js';\nexport { default as BoxEmitter } from './Source/Scene/BoxEmitter.js';\nexport { default as BrdfLutGenerator } from './Source/Scene/BrdfLutGenerator.js';\nexport { default as BufferLoader } from './Source/Scene/BufferLoader.js';\nexport { default as Camera } from './Source/Scene/Camera.js';\nexport { default as CameraEventAggregator } from './Source/Scene/CameraEventAggregator.js';\nexport { default as CameraEventType } from './Source/Scene/CameraEventType.js';\nexport { default as CameraFlightPath } from './Source/Scene/CameraFlightPath.js';\nexport { default as Cesium3DContentGroup } from './Source/Scene/Cesium3DContentGroup.js';\nexport { default as Cesium3DTile } from './Source/Scene/Cesium3DTile.js';\nexport { default as Cesium3DTileBatchTable } from './Source/Scene/Cesium3DTileBatchTable.js';\nexport { default as Cesium3DTileColorBlendMode } from './Source/Scene/Cesium3DTileColorBlendMode.js';\nexport { default as Cesium3DTileContent } from './Source/Scene/Cesium3DTileContent.js';\nexport { default as Cesium3DTileContentFactory } from './Source/Scene/Cesium3DTileContentFactory.js';\nexport { default as Cesium3DTileContentState } from './Source/Scene/Cesium3DTileContentState.js';\nexport { default as Cesium3DTileContentType } from './Source/Scene/Cesium3DTileContentType.js';\nexport { default as Cesium3DTileFeature } from './Source/Scene/Cesium3DTileFeature.js';\nexport { default as Cesium3DTileFeatureTable } from './Source/Scene/Cesium3DTileFeatureTable.js';\nexport { default as Cesium3DTileOptimizationHint } from './Source/Scene/Cesium3DTileOptimizationHint.js';\nexport { default as Cesium3DTileOptimizations } from './Source/Scene/Cesium3DTileOptimizations.js';\nexport { default as Cesium3DTilePass } from './Source/Scene/Cesium3DTilePass.js';\nexport { default as Cesium3DTilePassState } from './Source/Scene/Cesium3DTilePassState.js';\nexport { default as Cesium3DTilePointFeature } from './Source/Scene/Cesium3DTilePointFeature.js';\nexport { default as Cesium3DTileRefine } from './Source/Scene/Cesium3DTileRefine.js';\nexport { default as Cesium3DTileStyle } from './Source/Scene/Cesium3DTileStyle.js';\nexport { default as Cesium3DTileStyleEngine } from './Source/Scene/Cesium3DTileStyleEngine.js';\nexport { default as Cesium3DTilesVoxelProvider } from './Source/Scene/Cesium3DTilesVoxelProvider.js';\nexport { default as Cesium3DTileset } from './Source/Scene/Cesium3DTileset.js';\nexport { default as Cesium3DTilesetBaseTraversal } from './Source/Scene/Cesium3DTilesetBaseTraversal.js';\nexport { default as Cesium3DTilesetCache } from './Source/Scene/Cesium3DTilesetCache.js';\nexport { default as Cesium3DTilesetHeatmap } from './Source/Scene/Cesium3DTilesetHeatmap.js';\nexport { default as Cesium3DTilesetMetadata } from './Source/Scene/Cesium3DTilesetMetadata.js';\nexport { default as Cesium3DTilesetMostDetailedTraversal } from './Source/Scene/Cesium3DTilesetMostDetailedTraversal.js';\nexport { default as Cesium3DTilesetSkipTraversal } from './Source/Scene/Cesium3DTilesetSkipTraversal.js';\nexport { default as Cesium3DTilesetStatistics } from './Source/Scene/Cesium3DTilesetStatistics.js';\nexport { default as Cesium3DTilesetTraversal } from './Source/Scene/Cesium3DTilesetTraversal.js';\nexport { default as CircleEmitter } from './Source/Scene/CircleEmitter.js';\nexport { default as ClassificationPrimitive } from './Source/Scene/ClassificationPrimitive.js';\nexport { default as ClassificationType } from './Source/Scene/ClassificationType.js';\nexport { default as ClippingPlane } from './Source/Scene/ClippingPlane.js';\nexport { default as ClippingPlaneCollection } from './Source/Scene/ClippingPlaneCollection.js';\nexport { default as CloudCollection } from './Source/Scene/CloudCollection.js';\nexport { default as CloudType } from './Source/Scene/CloudType.js';\nexport { default as ColorBlendMode } from './Source/Scene/ColorBlendMode.js';\nexport { default as Composite3DTileContent } from './Source/Scene/Composite3DTileContent.js';\nexport { default as ConditionsExpression } from './Source/Scene/ConditionsExpression.js';\nexport { default as ConeEmitter } from './Source/Scene/ConeEmitter.js';\nexport { default as ContentMetadata } from './Source/Scene/ContentMetadata.js';\nexport { default as CreditDisplay } from './Source/Scene/CreditDisplay.js';\nexport { default as CullFace } from './Source/Scene/CullFace.js';\nexport { default as CumulusCloud } from './Source/Scene/CumulusCloud.js';\nexport { default as DebugAppearance } from './Source/Scene/DebugAppearance.js';\nexport { default as DebugCameraPrimitive } from './Source/Scene/DebugCameraPrimitive.js';\nexport { default as DebugInspector } from './Source/Scene/DebugInspector.js';\nexport { default as DebugModelMatrixPrimitive } from './Source/Scene/DebugModelMatrixPrimitive.js';\nexport { default as DepthFunction } from './Source/Scene/DepthFunction.js';\nexport { default as DepthPlane } from './Source/Scene/DepthPlane.js';\nexport { default as DerivedCommand } from './Source/Scene/DerivedCommand.js';\nexport { default as DeviceOrientationCameraController } from './Source/Scene/DeviceOrientationCameraController.js';\nexport { default as DirectionalLight } from './Source/Scene/DirectionalLight.js';\nexport { default as DiscardEmptyTileImagePolicy } from './Source/Scene/DiscardEmptyTileImagePolicy.js';\nexport { default as DiscardMissingTileImagePolicy } from './Source/Scene/DiscardMissingTileImagePolicy.js';\nexport { default as DracoLoader } from './Source/Scene/DracoLoader.js';\nexport { default as EllipsoidPrimitive } from './Source/Scene/EllipsoidPrimitive.js';\nexport { default as EllipsoidSurfaceAppearance } from './Source/Scene/EllipsoidSurfaceAppearance.js';\nexport { default as Empty3DTileContent } from './Source/Scene/Empty3DTileContent.js';\nexport { default as Expression } from './Source/Scene/Expression.js';\nexport { default as ExpressionNodeType } from './Source/Scene/ExpressionNodeType.js';\nexport { default as Fog } from './Source/Scene/Fog.js';\nexport { default as FrameRateMonitor } from './Source/Scene/FrameRateMonitor.js';\nexport { default as FrameState } from './Source/Scene/FrameState.js';\nexport { default as FrustumCommands } from './Source/Scene/FrustumCommands.js';\nexport { default as Geometry3DTileContent } from './Source/Scene/Geometry3DTileContent.js';\nexport { default as GetFeatureInfoFormat } from './Source/Scene/GetFeatureInfoFormat.js';\nexport { default as Globe } from './Source/Scene/Globe.js';\nexport { default as GlobeDepth } from './Source/Scene/GlobeDepth.js';\nexport { default as GlobeSurfaceShaderSet } from './Source/Scene/GlobeSurfaceShaderSet.js';\nexport { default as GlobeSurfaceTile } from './Source/Scene/GlobeSurfaceTile.js';\nexport { default as GlobeSurfaceTileProvider } from './Source/Scene/GlobeSurfaceTileProvider.js';\nexport { default as GlobeTranslucency } from './Source/Scene/GlobeTranslucency.js';\nexport { default as GlobeTranslucencyFramebuffer } from './Source/Scene/GlobeTranslucencyFramebuffer.js';\nexport { default as GlobeTranslucencyState } from './Source/Scene/GlobeTranslucencyState.js';\nexport { default as GltfBufferViewLoader } from './Source/Scene/GltfBufferViewLoader.js';\nexport { default as GltfDracoLoader } from './Source/Scene/GltfDracoLoader.js';\nexport { default as GltfImageLoader } from './Source/Scene/GltfImageLoader.js';\nexport { default as GltfIndexBufferLoader } from './Source/Scene/GltfIndexBufferLoader.js';\nexport { default as GltfJsonLoader } from './Source/Scene/GltfJsonLoader.js';\nexport { default as GltfLoader } from './Source/Scene/GltfLoader.js';\nexport { default as GltfLoaderUtil } from './Source/Scene/GltfLoaderUtil.js';\nexport { default as GltfStructuralMetadataLoader } from './Source/Scene/GltfStructuralMetadataLoader.js';\nexport { default as GltfTextureLoader } from './Source/Scene/GltfTextureLoader.js';\nexport { default as GltfVertexBufferLoader } from './Source/Scene/GltfVertexBufferLoader.js';\nexport { default as GoogleEarthEnterpriseImageryProvider } from './Source/Scene/GoogleEarthEnterpriseImageryProvider.js';\nexport { default as GoogleEarthEnterpriseMapsProvider } from './Source/Scene/GoogleEarthEnterpriseMapsProvider.js';\nexport { default as GridImageryProvider } from './Source/Scene/GridImageryProvider.js';\nexport { default as GroundPolylinePrimitive } from './Source/Scene/GroundPolylinePrimitive.js';\nexport { default as GroundPrimitive } from './Source/Scene/GroundPrimitive.js';\nexport { default as GroupMetadata } from './Source/Scene/GroupMetadata.js';\nexport { default as HeightReference } from './Source/Scene/HeightReference.js';\nexport { default as HorizontalOrigin } from './Source/Scene/HorizontalOrigin.js';\nexport { default as I3SDataProvider } from './Source/Scene/I3SDataProvider.js';\nexport { default as I3SDecoder } from './Source/Scene/I3SDecoder.js';\nexport { default as I3SFeature } from './Source/Scene/I3SFeature.js';\nexport { default as I3SField } from './Source/Scene/I3SField.js';\nexport { default as I3SGeometry } from './Source/Scene/I3SGeometry.js';\nexport { default as I3SLayer } from './Source/Scene/I3SLayer.js';\nexport { default as I3SNode } from './Source/Scene/I3SNode.js';\nexport { default as I3dmParser } from './Source/Scene/I3dmParser.js';\nexport { default as ImageBasedLighting } from './Source/Scene/ImageBasedLighting.js';\nexport { default as Imagery } from './Source/Scene/Imagery.js';\nexport { default as ImageryLayer } from './Source/Scene/ImageryLayer.js';\nexport { default as ImageryLayerCollection } from './Source/Scene/ImageryLayerCollection.js';\nexport { default as ImageryLayerFeatureInfo } from './Source/Scene/ImageryLayerFeatureInfo.js';\nexport { default as ImageryProvider } from './Source/Scene/ImageryProvider.js';\nexport { default as ImageryState } from './Source/Scene/ImageryState.js';\nexport { default as Implicit3DTileContent } from './Source/Scene/Implicit3DTileContent.js';\nexport { default as ImplicitAvailabilityBitstream } from './Source/Scene/ImplicitAvailabilityBitstream.js';\nexport { default as ImplicitMetadataView } from './Source/Scene/ImplicitMetadataView.js';\nexport { default as ImplicitSubdivisionScheme } from './Source/Scene/ImplicitSubdivisionScheme.js';\nexport { default as ImplicitSubtree } from './Source/Scene/ImplicitSubtree.js';\nexport { default as ImplicitSubtreeCache } from './Source/Scene/ImplicitSubtreeCache.js';\nexport { default as ImplicitSubtreeMetadata } from './Source/Scene/ImplicitSubtreeMetadata.js';\nexport { default as ImplicitTileCoordinates } from './Source/Scene/ImplicitTileCoordinates.js';\nexport { default as ImplicitTileset } from './Source/Scene/ImplicitTileset.js';\nexport { default as InstanceAttributeSemantic } from './Source/Scene/InstanceAttributeSemantic.js';\nexport { default as InvertClassification } from './Source/Scene/InvertClassification.js';\nexport { default as IonImageryProvider } from './Source/Scene/IonImageryProvider.js';\nexport { default as IonWorldImageryStyle } from './Source/Scene/IonWorldImageryStyle.js';\nexport { default as JobScheduler } from './Source/Scene/JobScheduler.js';\nexport { default as JobType } from './Source/Scene/JobType.js';\nexport { default as JsonMetadataTable } from './Source/Scene/JsonMetadataTable.js';\nexport { default as KeyframeNode } from './Source/Scene/KeyframeNode.js';\nexport { default as Label } from './Source/Scene/Label.js';\nexport { default as LabelCollection } from './Source/Scene/LabelCollection.js';\nexport { default as LabelStyle } from './Source/Scene/LabelStyle.js';\nexport { default as Light } from './Source/Scene/Light.js';\nexport { default as MapMode2D } from './Source/Scene/MapMode2D.js';\nexport { default as MapboxImageryProvider } from './Source/Scene/MapboxImageryProvider.js';\nexport { default as MapboxStyleImageryProvider } from './Source/Scene/MapboxStyleImageryProvider.js';\nexport { default as Material } from './Source/Scene/Material.js';\nexport { default as MaterialAppearance } from './Source/Scene/MaterialAppearance.js';\nexport { default as Megatexture } from './Source/Scene/Megatexture.js';\nexport { default as MetadataClass } from './Source/Scene/MetadataClass.js';\nexport { default as MetadataClassProperty } from './Source/Scene/MetadataClassProperty.js';\nexport { default as MetadataComponentType } from './Source/Scene/MetadataComponentType.js';\nexport { default as MetadataEntity } from './Source/Scene/MetadataEntity.js';\nexport { default as MetadataEnum } from './Source/Scene/MetadataEnum.js';\nexport { default as MetadataEnumValue } from './Source/Scene/MetadataEnumValue.js';\nexport { default as MetadataSchema } from './Source/Scene/MetadataSchema.js';\nexport { default as MetadataSchemaLoader } from './Source/Scene/MetadataSchemaLoader.js';\nexport { default as MetadataSemantic } from './Source/Scene/MetadataSemantic.js';\nexport { default as MetadataTable } from './Source/Scene/MetadataTable.js';\nexport { default as MetadataTableProperty } from './Source/Scene/MetadataTableProperty.js';\nexport { default as MetadataType } from './Source/Scene/MetadataType.js';\nexport { default as ModelAnimationLoop } from './Source/Scene/ModelAnimationLoop.js';\nexport { default as ModelAnimationState } from './Source/Scene/ModelAnimationState.js';\nexport { default as ModelComponents } from './Source/Scene/ModelComponents.js';\nexport { default as Moon } from './Source/Scene/Moon.js';\nexport { default as Multiple3DTileContent } from './Source/Scene/Multiple3DTileContent.js';\nexport { default as NeverTileDiscardPolicy } from './Source/Scene/NeverTileDiscardPolicy.js';\nexport { default as OIT } from './Source/Scene/OIT.js';\nexport { default as OctahedralProjectedCubeMap } from './Source/Scene/OctahedralProjectedCubeMap.js';\nexport { default as OpenStreetMapImageryProvider } from './Source/Scene/OpenStreetMapImageryProvider.js';\nexport { default as OrderedGroundPrimitiveCollection } from './Source/Scene/OrderedGroundPrimitiveCollection.js';\nexport { default as Particle } from './Source/Scene/Particle.js';\nexport { default as ParticleBurst } from './Source/Scene/ParticleBurst.js';\nexport { default as ParticleEmitter } from './Source/Scene/ParticleEmitter.js';\nexport { default as ParticleSystem } from './Source/Scene/ParticleSystem.js';\nexport { default as PerInstanceColorAppearance } from './Source/Scene/PerInstanceColorAppearance.js';\nexport { default as PerformanceDisplay } from './Source/Scene/PerformanceDisplay.js';\nexport { default as PickDepth } from './Source/Scene/PickDepth.js';\nexport { default as PickDepthFramebuffer } from './Source/Scene/PickDepthFramebuffer.js';\nexport { default as PickFramebuffer } from './Source/Scene/PickFramebuffer.js';\nexport { default as Picking } from './Source/Scene/Picking.js';\nexport { default as PntsParser } from './Source/Scene/PntsParser.js';\nexport { default as PointCloud } from './Source/Scene/PointCloud.js';\nexport { default as PointCloudEyeDomeLighting } from './Source/Scene/PointCloudEyeDomeLighting.js';\nexport { default as PointCloudShading } from './Source/Scene/PointCloudShading.js';\nexport { default as PointPrimitive } from './Source/Scene/PointPrimitive.js';\nexport { default as PointPrimitiveCollection } from './Source/Scene/PointPrimitiveCollection.js';\nexport { default as Polyline } from './Source/Scene/Polyline.js';\nexport { default as PolylineCollection } from './Source/Scene/PolylineCollection.js';\nexport { default as PolylineColorAppearance } from './Source/Scene/PolylineColorAppearance.js';\nexport { default as PolylineMaterialAppearance } from './Source/Scene/PolylineMaterialAppearance.js';\nexport { default as PostProcessStage } from './Source/Scene/PostProcessStage.js';\nexport { default as PostProcessStageCollection } from './Source/Scene/PostProcessStageCollection.js';\nexport { default as PostProcessStageComposite } from './Source/Scene/PostProcessStageComposite.js';\nexport { default as PostProcessStageLibrary } from './Source/Scene/PostProcessStageLibrary.js';\nexport { default as PostProcessStageSampleMode } from './Source/Scene/PostProcessStageSampleMode.js';\nexport { default as PostProcessStageTextureCache } from './Source/Scene/PostProcessStageTextureCache.js';\nexport { default as Primitive } from './Source/Scene/Primitive.js';\nexport { default as PrimitiveCollection } from './Source/Scene/PrimitiveCollection.js';\nexport { default as PrimitiveLoadPlan } from './Source/Scene/PrimitiveLoadPlan.js';\nexport { default as PrimitivePipeline } from './Source/Scene/PrimitivePipeline.js';\nexport { default as PrimitiveState } from './Source/Scene/PrimitiveState.js';\nexport { default as PropertyAttribute } from './Source/Scene/PropertyAttribute.js';\nexport { default as PropertyAttributeProperty } from './Source/Scene/PropertyAttributeProperty.js';\nexport { default as PropertyTable } from './Source/Scene/PropertyTable.js';\nexport { default as PropertyTexture } from './Source/Scene/PropertyTexture.js';\nexport { default as PropertyTextureProperty } from './Source/Scene/PropertyTextureProperty.js';\nexport { default as QuadtreeOccluders } from './Source/Scene/QuadtreeOccluders.js';\nexport { default as QuadtreePrimitive } from './Source/Scene/QuadtreePrimitive.js';\nexport { default as QuadtreeTile } from './Source/Scene/QuadtreeTile.js';\nexport { default as QuadtreeTileLoadState } from './Source/Scene/QuadtreeTileLoadState.js';\nexport { default as QuadtreeTileProvider } from './Source/Scene/QuadtreeTileProvider.js';\nexport { default as ResourceCache } from './Source/Scene/ResourceCache.js';\nexport { default as ResourceCacheKey } from './Source/Scene/ResourceCacheKey.js';\nexport { default as ResourceCacheStatistics } from './Source/Scene/ResourceCacheStatistics.js';\nexport { default as ResourceLoader } from './Source/Scene/ResourceLoader.js';\nexport { default as ResourceLoaderState } from './Source/Scene/ResourceLoaderState.js';\nexport { default as SDFSettings } from './Source/Scene/SDFSettings.js';\nexport { default as Scene } from './Source/Scene/Scene.js';\nexport { default as SceneFramebuffer } from './Source/Scene/SceneFramebuffer.js';\nexport { default as SceneMode } from './Source/Scene/SceneMode.js';\nexport { default as SceneTransforms } from './Source/Scene/SceneTransforms.js';\nexport { default as SceneTransitioner } from './Source/Scene/SceneTransitioner.js';\nexport { default as ScreenSpaceCameraController } from './Source/Scene/ScreenSpaceCameraController.js';\nexport { default as ShadowMap } from './Source/Scene/ShadowMap.js';\nexport { default as ShadowMapShader } from './Source/Scene/ShadowMapShader.js';\nexport { default as ShadowMode } from './Source/Scene/ShadowMode.js';\nexport { default as ShadowVolumeAppearance } from './Source/Scene/ShadowVolumeAppearance.js';\nexport { default as SingleTileImageryProvider } from './Source/Scene/SingleTileImageryProvider.js';\nexport { default as SkyAtmosphere } from './Source/Scene/SkyAtmosphere.js';\nexport { default as SkyBox } from './Source/Scene/SkyBox.js';\nexport { default as SpatialNode } from './Source/Scene/SpatialNode.js';\nexport { default as SphereEmitter } from './Source/Scene/SphereEmitter.js';\nexport { default as SplitDirection } from './Source/Scene/SplitDirection.js';\nexport { default as Splitter } from './Source/Scene/Splitter.js';\nexport { default as StencilConstants } from './Source/Scene/StencilConstants.js';\nexport { default as StencilFunction } from './Source/Scene/StencilFunction.js';\nexport { default as StencilOperation } from './Source/Scene/StencilOperation.js';\nexport { default as StructuralMetadata } from './Source/Scene/StructuralMetadata.js';\nexport { default as StyleExpression } from './Source/Scene/StyleExpression.js';\nexport { default as Sun } from './Source/Scene/Sun.js';\nexport { default as SunLight } from './Source/Scene/SunLight.js';\nexport { default as SunPostProcess } from './Source/Scene/SunPostProcess.js';\nexport { default as SupportedImageFormats } from './Source/Scene/SupportedImageFormats.js';\nexport { default as Terrain } from './Source/Scene/Terrain.js';\nexport { default as TerrainFillMesh } from './Source/Scene/TerrainFillMesh.js';\nexport { default as TerrainState } from './Source/Scene/TerrainState.js';\nexport { default as TextureAtlas } from './Source/Scene/TextureAtlas.js';\nexport { default as TileBoundingRegion } from './Source/Scene/TileBoundingRegion.js';\nexport { default as TileBoundingS2Cell } from './Source/Scene/TileBoundingS2Cell.js';\nexport { default as TileBoundingSphere } from './Source/Scene/TileBoundingSphere.js';\nexport { default as TileBoundingVolume } from './Source/Scene/TileBoundingVolume.js';\nexport { default as TileCoordinatesImageryProvider } from './Source/Scene/TileCoordinatesImageryProvider.js';\nexport { default as TileDiscardPolicy } from './Source/Scene/TileDiscardPolicy.js';\nexport { default as TileImagery } from './Source/Scene/TileImagery.js';\nexport { default as TileMapServiceImageryProvider } from './Source/Scene/TileMapServiceImageryProvider.js';\nexport { default as TileMetadata } from './Source/Scene/TileMetadata.js';\nexport { default as TileOrientedBoundingBox } from './Source/Scene/TileOrientedBoundingBox.js';\nexport { default as TileReplacementQueue } from './Source/Scene/TileReplacementQueue.js';\nexport { default as TileSelectionResult } from './Source/Scene/TileSelectionResult.js';\nexport { default as TileState } from './Source/Scene/TileState.js';\nexport { default as Tileset3DTileContent } from './Source/Scene/Tileset3DTileContent.js';\nexport { default as TilesetMetadata } from './Source/Scene/TilesetMetadata.js';\nexport { default as TimeDynamicImagery } from './Source/Scene/TimeDynamicImagery.js';\nexport { default as TimeDynamicPointCloud } from './Source/Scene/TimeDynamicPointCloud.js';\nexport { default as Tonemapper } from './Source/Scene/Tonemapper.js';\nexport { default as TranslucentTileClassification } from './Source/Scene/TranslucentTileClassification.js';\nexport { default as TweenCollection } from './Source/Scene/TweenCollection.js';\nexport { default as UrlTemplateImageryProvider } from './Source/Scene/UrlTemplateImageryProvider.js';\nexport { default as Vector3DTileBatch } from './Source/Scene/Vector3DTileBatch.js';\nexport { default as Vector3DTileClampedPolylines } from './Source/Scene/Vector3DTileClampedPolylines.js';\nexport { default as Vector3DTileContent } from './Source/Scene/Vector3DTileContent.js';\nexport { default as Vector3DTileGeometry } from './Source/Scene/Vector3DTileGeometry.js';\nexport { default as Vector3DTilePoints } from './Source/Scene/Vector3DTilePoints.js';\nexport { default as Vector3DTilePolygons } from './Source/Scene/Vector3DTilePolygons.js';\nexport { default as Vector3DTilePolylines } from './Source/Scene/Vector3DTilePolylines.js';\nexport { default as Vector3DTilePrimitive } from './Source/Scene/Vector3DTilePrimitive.js';\nexport { default as VertexAttributeSemantic } from './Source/Scene/VertexAttributeSemantic.js';\nexport { default as VerticalOrigin } from './Source/Scene/VerticalOrigin.js';\nexport { default as View } from './Source/Scene/View.js';\nexport { default as ViewportQuad } from './Source/Scene/ViewportQuad.js';\nexport { default as VoxelBoxShape } from './Source/Scene/VoxelBoxShape.js';\nexport { default as VoxelContent } from './Source/Scene/VoxelContent.js';\nexport { default as VoxelCylinderShape } from './Source/Scene/VoxelCylinderShape.js';\nexport { default as VoxelEllipsoidShape } from './Source/Scene/VoxelEllipsoidShape.js';\nexport { default as VoxelPrimitive } from './Source/Scene/VoxelPrimitive.js';\nexport { default as VoxelProvider } from './Source/Scene/VoxelProvider.js';\nexport { default as VoxelRenderResources } from './Source/Scene/VoxelRenderResources.js';\nexport { default as VoxelShape } from './Source/Scene/VoxelShape.js';\nexport { default as VoxelShapeType } from './Source/Scene/VoxelShapeType.js';\nexport { default as VoxelTraversal } from './Source/Scene/VoxelTraversal.js';\nexport { default as WebMapServiceImageryProvider } from './Source/Scene/WebMapServiceImageryProvider.js';\nexport { default as WebMapTileServiceImageryProvider } from './Source/Scene/WebMapTileServiceImageryProvider.js';\nexport { default as buildVoxelDrawCommands } from './Source/Scene/buildVoxelDrawCommands.js';\nexport { default as computeFlyToLocationForRectangle } from './Source/Scene/computeFlyToLocationForRectangle.js';\nexport { default as createBillboardPointCallback } from './Source/Scene/createBillboardPointCallback.js';\nexport { default as createElevationBandMaterial } from './Source/Scene/createElevationBandMaterial.js';\nexport { default as createGooglePhotorealistic3DTileset } from './Source/Scene/createGooglePhotorealistic3DTileset.js';\nexport { default as createOsmBuildingsAsync } from './Source/Scene/createOsmBuildingsAsync.js';\nexport { default as createTangentSpaceDebugPrimitive } from './Source/Scene/createTangentSpaceDebugPrimitive.js';\nexport { default as createWorldImageryAsync } from './Source/Scene/createWorldImageryAsync.js';\nexport { default as findContentMetadata } from './Source/Scene/findContentMetadata.js';\nexport { default as findGroupMetadata } from './Source/Scene/findGroupMetadata.js';\nexport { default as findTileMetadata } from './Source/Scene/findTileMetadata.js';\nexport { default as getBinaryAccessor } from './Source/Scene/getBinaryAccessor.js';\nexport { default as getClipAndStyleCode } from './Source/Scene/getClipAndStyleCode.js';\nexport { default as getClippingFunction } from './Source/Scene/getClippingFunction.js';\nexport { default as hasExtension } from './Source/Scene/hasExtension.js';\nexport { default as parseBatchTable } from './Source/Scene/parseBatchTable.js';\nexport { default as parseFeatureMetadataLegacy } from './Source/Scene/parseFeatureMetadataLegacy.js';\nexport { default as parseStructuralMetadata } from './Source/Scene/parseStructuralMetadata.js';\nexport { default as preprocess3DTileContent } from './Source/Scene/preprocess3DTileContent.js';\nexport { default as processVoxelProperties } from './Source/Scene/processVoxelProperties.js';\nexport { default as _shadersAllMaterialAppearanceFS } from './Source/Shaders/Appearances/AllMaterialAppearanceFS.js';\nexport { default as _shadersAllMaterialAppearanceVS } from './Source/Shaders/Appearances/AllMaterialAppearanceVS.js';\nexport { default as _shadersBasicMaterialAppearanceFS } from './Source/Shaders/Appearances/BasicMaterialAppearanceFS.js';\nexport { default as _shadersBasicMaterialAppearanceVS } from './Source/Shaders/Appearances/BasicMaterialAppearanceVS.js';\nexport { default as _shadersEllipsoidSurfaceAppearanceFS } from './Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.js';\nexport { default as _shadersEllipsoidSurfaceAppearanceVS } from './Source/Shaders/Appearances/EllipsoidSurfaceAppearanceVS.js';\nexport { default as _shadersPerInstanceColorAppearanceFS } from './Source/Shaders/Appearances/PerInstanceColorAppearanceFS.js';\nexport { default as _shadersPerInstanceColorAppearanceVS } from './Source/Shaders/Appearances/PerInstanceColorAppearanceVS.js';\nexport { default as _shadersPerInstanceFlatColorAppearanceFS } from './Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js';\nexport { default as _shadersPerInstanceFlatColorAppearanceVS } from './Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.js';\nexport { default as _shadersPolylineColorAppearanceVS } from './Source/Shaders/Appearances/PolylineColorAppearanceVS.js';\nexport { default as _shadersPolylineMaterialAppearanceVS } from './Source/Shaders/Appearances/PolylineMaterialAppearanceVS.js';\nexport { default as _shadersTexturedMaterialAppearanceFS } from './Source/Shaders/Appearances/TexturedMaterialAppearanceFS.js';\nexport { default as _shadersTexturedMaterialAppearanceVS } from './Source/Shaders/Appearances/TexturedMaterialAppearanceVS.js';\nexport { default as _shadersCzmBuiltins } from './Source/Shaders/Builtin/CzmBuiltins.js';\nexport { default as _shadersAspectRampMaterial } from './Source/Shaders/Materials/AspectRampMaterial.js';\nexport { default as _shadersBumpMapMaterial } from './Source/Shaders/Materials/BumpMapMaterial.js';\nexport { default as _shadersCheckerboardMaterial } from './Source/Shaders/Materials/CheckerboardMaterial.js';\nexport { default as _shadersDotMaterial } from './Source/Shaders/Materials/DotMaterial.js';\nexport { default as _shadersElevationBandMaterial } from './Source/Shaders/Materials/ElevationBandMaterial.js';\nexport { default as _shadersElevationContourMaterial } from './Source/Shaders/Materials/ElevationContourMaterial.js';\nexport { default as _shadersElevationRampMaterial } from './Source/Shaders/Materials/ElevationRampMaterial.js';\nexport { default as _shadersFadeMaterial } from './Source/Shaders/Materials/FadeMaterial.js';\nexport { default as _shadersGridMaterial } from './Source/Shaders/Materials/GridMaterial.js';\nexport { default as _shadersNormalMapMaterial } from './Source/Shaders/Materials/NormalMapMaterial.js';\nexport { default as _shadersPolylineArrowMaterial } from './Source/Shaders/Materials/PolylineArrowMaterial.js';\nexport { default as _shadersPolylineDashMaterial } from './Source/Shaders/Materials/PolylineDashMaterial.js';\nexport { default as _shadersPolylineGlowMaterial } from './Source/Shaders/Materials/PolylineGlowMaterial.js';\nexport { default as _shadersPolylineOutlineMaterial } from './Source/Shaders/Materials/PolylineOutlineMaterial.js';\nexport { default as _shadersRimLightingMaterial } from './Source/Shaders/Materials/RimLightingMaterial.js';\nexport { default as _shadersSlopeRampMaterial } from './Source/Shaders/Materials/SlopeRampMaterial.js';\nexport { default as _shadersStripeMaterial } from './Source/Shaders/Materials/StripeMaterial.js';\nexport { default as _shadersWater } from './Source/Shaders/Materials/Water.js';\nexport { default as _shadersCPUStylingStageFS } from './Source/Shaders/Model/CPUStylingStageFS.js';\nexport { default as _shadersCPUStylingStageVS } from './Source/Shaders/Model/CPUStylingStageVS.js';\nexport { default as _shadersCustomShaderStageFS } from './Source/Shaders/Model/CustomShaderStageFS.js';\nexport { default as _shadersCustomShaderStageVS } from './Source/Shaders/Model/CustomShaderStageVS.js';\nexport { default as _shadersFeatureIdStageFS } from './Source/Shaders/Model/FeatureIdStageFS.js';\nexport { default as _shadersFeatureIdStageVS } from './Source/Shaders/Model/FeatureIdStageVS.js';\nexport { default as _shadersGeometryStageFS } from './Source/Shaders/Model/GeometryStageFS.js';\nexport { default as _shadersGeometryStageVS } from './Source/Shaders/Model/GeometryStageVS.js';\nexport { default as _shadersImageBasedLightingStageFS } from './Source/Shaders/Model/ImageBasedLightingStageFS.js';\nexport { default as _shadersInstancingStageCommon } from './Source/Shaders/Model/InstancingStageCommon.js';\nexport { default as _shadersInstancingStageVS } from './Source/Shaders/Model/InstancingStageVS.js';\nexport { default as _shadersLegacyInstancingStageVS } from './Source/Shaders/Model/LegacyInstancingStageVS.js';\nexport { default as _shadersLightingStageFS } from './Source/Shaders/Model/LightingStageFS.js';\nexport { default as _shadersMaterialStageFS } from './Source/Shaders/Model/MaterialStageFS.js';\nexport { default as _shadersMetadataStageFS } from './Source/Shaders/Model/MetadataStageFS.js';\nexport { default as _shadersMetadataStageVS } from './Source/Shaders/Model/MetadataStageVS.js';\nexport { default as _shadersModelClippingPlanesStageFS } from './Source/Shaders/Model/ModelClippingPlanesStageFS.js';\nexport { default as _shadersModelColorStageFS } from './Source/Shaders/Model/ModelColorStageFS.js';\nexport { default as _shadersModelFS } from './Source/Shaders/Model/ModelFS.js';\nexport { default as _shadersModelSilhouetteStageFS } from './Source/Shaders/Model/ModelSilhouetteStageFS.js';\nexport { default as _shadersModelSilhouetteStageVS } from './Source/Shaders/Model/ModelSilhouetteStageVS.js';\nexport { default as _shadersModelSplitterStageFS } from './Source/Shaders/Model/ModelSplitterStageFS.js';\nexport { default as _shadersModelVS } from './Source/Shaders/Model/ModelVS.js';\nexport { default as _shadersMorphTargetsStageVS } from './Source/Shaders/Model/MorphTargetsStageVS.js';\nexport { default as _shadersPointCloudStylingStageVS } from './Source/Shaders/Model/PointCloudStylingStageVS.js';\nexport { default as _shadersPrimitiveOutlineStageFS } from './Source/Shaders/Model/PrimitiveOutlineStageFS.js';\nexport { default as _shadersPrimitiveOutlineStageVS } from './Source/Shaders/Model/PrimitiveOutlineStageVS.js';\nexport { default as _shadersSelectedFeatureIdStageCommon } from './Source/Shaders/Model/SelectedFeatureIdStageCommon.js';\nexport { default as _shadersSkinningStageVS } from './Source/Shaders/Model/SkinningStageVS.js';\nexport { default as _shadersVerticalExaggerationStageVS } from './Source/Shaders/Model/VerticalExaggerationStageVS.js';\nexport { default as _shadersAcesTonemappingStage } from './Source/Shaders/PostProcessStages/AcesTonemappingStage.js';\nexport { default as _shadersAdditiveBlend } from './Source/Shaders/PostProcessStages/AdditiveBlend.js';\nexport { default as _shadersAmbientOcclusionGenerate } from './Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js';\nexport { default as _shadersAmbientOcclusionModulate } from './Source/Shaders/PostProcessStages/AmbientOcclusionModulate.js';\nexport { default as _shadersBlackAndWhite } from './Source/Shaders/PostProcessStages/BlackAndWhite.js';\nexport { default as _shadersBloomComposite } from './Source/Shaders/PostProcessStages/BloomComposite.js';\nexport { default as _shadersBrightPass } from './Source/Shaders/PostProcessStages/BrightPass.js';\nexport { default as _shadersBrightness } from './Source/Shaders/PostProcessStages/Brightness.js';\nexport { default as _shadersCompositeTranslucentClassification } from './Source/Shaders/PostProcessStages/CompositeTranslucentClassification.js';\nexport { default as _shadersContrastBias } from './Source/Shaders/PostProcessStages/ContrastBias.js';\nexport { default as _shadersDepthOfField } from './Source/Shaders/PostProcessStages/DepthOfField.js';\nexport { default as _shadersDepthView } from './Source/Shaders/PostProcessStages/DepthView.js';\nexport { default as _shadersDepthViewPacked } from './Source/Shaders/PostProcessStages/DepthViewPacked.js';\nexport { default as _shadersEdgeDetection } from './Source/Shaders/PostProcessStages/EdgeDetection.js';\nexport { default as _shadersFXAA } from './Source/Shaders/PostProcessStages/FXAA.js';\nexport { default as _shadersFilmicTonemapping } from './Source/Shaders/PostProcessStages/FilmicTonemapping.js';\nexport { default as _shadersGaussianBlur1D } from './Source/Shaders/PostProcessStages/GaussianBlur1D.js';\nexport { default as _shadersLensFlare } from './Source/Shaders/PostProcessStages/LensFlare.js';\nexport { default as _shadersModifiedReinhardTonemapping } from './Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.js';\nexport { default as _shadersNightVision } from './Source/Shaders/PostProcessStages/NightVision.js';\nexport { default as _shadersPassThrough } from './Source/Shaders/PostProcessStages/PassThrough.js';\nexport { default as _shadersPassThroughDepth } from './Source/Shaders/PostProcessStages/PassThroughDepth.js';\nexport { default as _shadersPointCloudEyeDomeLighting } from './Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.js';\nexport { default as _shadersReinhardTonemapping } from './Source/Shaders/PostProcessStages/ReinhardTonemapping.js';\nexport { default as _shadersSilhouette } from './Source/Shaders/PostProcessStages/Silhouette.js';\nexport { default as _shadersIntersectBox } from './Source/Shaders/Voxels/IntersectBox.js';\nexport { default as _shadersIntersectClippingPlanes } from './Source/Shaders/Voxels/IntersectClippingPlanes.js';\nexport { default as _shadersIntersectCylinder } from './Source/Shaders/Voxels/IntersectCylinder.js';\nexport { default as _shadersIntersectDepth } from './Source/Shaders/Voxels/IntersectDepth.js';\nexport { default as _shadersIntersectEllipsoid } from './Source/Shaders/Voxels/IntersectEllipsoid.js';\nexport { default as _shadersIntersection } from './Source/Shaders/Voxels/Intersection.js';\nexport { default as _shadersIntersectionUtils } from './Source/Shaders/Voxels/IntersectionUtils.js';\nexport { default as _shadersMegatexture } from './Source/Shaders/Voxels/Megatexture.js';\nexport { default as _shadersOctree } from './Source/Shaders/Voxels/Octree.js';\nexport { default as _shadersVoxelFS } from './Source/Shaders/Voxels/VoxelFS.js';\nexport { default as _shadersVoxelVS } from './Source/Shaders/Voxels/VoxelVS.js';\nexport { default as _shadersconvertUvToBox } from './Source/Shaders/Voxels/convertUvToBox.js';\nexport { default as _shadersconvertUvToCylinder } from './Source/Shaders/Voxels/convertUvToCylinder.js';\nexport { default as _shadersconvertUvToEllipsoid } from './Source/Shaders/Voxels/convertUvToEllipsoid.js';\nexport { default as ForEach } from './Source/Scene/GltfPipeline/ForEach.js';\nexport { default as addBuffer } from './Source/Scene/GltfPipeline/addBuffer.js';\nexport { default as addDefaults } from './Source/Scene/GltfPipeline/addDefaults.js';\nexport { default as addExtensionsRequired } from './Source/Scene/GltfPipeline/addExtensionsRequired.js';\nexport { default as addExtensionsUsed } from './Source/Scene/GltfPipeline/addExtensionsUsed.js';\nexport { default as addPipelineExtras } from './Source/Scene/GltfPipeline/addPipelineExtras.js';\nexport { default as addToArray } from './Source/Scene/GltfPipeline/addToArray.js';\nexport { default as findAccessorMinMax } from './Source/Scene/GltfPipeline/findAccessorMinMax.js';\nexport { default as forEachTextureInMaterial } from './Source/Scene/GltfPipeline/forEachTextureInMaterial.js';\nexport { default as getAccessorByteStride } from './Source/Scene/GltfPipeline/getAccessorByteStride.js';\nexport { default as getComponentReader } from './Source/Scene/GltfPipeline/getComponentReader.js';\nexport { default as moveTechniqueRenderStates } from './Source/Scene/GltfPipeline/moveTechniqueRenderStates.js';\nexport { default as moveTechniquesToExtension } from './Source/Scene/GltfPipeline/moveTechniquesToExtension.js';\nexport { default as numberOfComponentsForType } from './Source/Scene/GltfPipeline/numberOfComponentsForType.js';\nexport { default as parseGlb } from './Source/Scene/GltfPipeline/parseGlb.js';\nexport { default as readAccessorPacked } from './Source/Scene/GltfPipeline/readAccessorPacked.js';\nexport { default as removeExtension } from './Source/Scene/GltfPipeline/removeExtension.js';\nexport { default as removeExtensionsRequired } from './Source/Scene/GltfPipeline/removeExtensionsRequired.js';\nexport { default as removeExtensionsUsed } from './Source/Scene/GltfPipeline/removeExtensionsUsed.js';\nexport { default as removePipelineExtras } from './Source/Scene/GltfPipeline/removePipelineExtras.js';\nexport { default as removeUnusedElements } from './Source/Scene/GltfPipeline/removeUnusedElements.js';\nexport { default as updateAccessorComponentTypes } from './Source/Scene/GltfPipeline/updateAccessorComponentTypes.js';\nexport { default as updateVersion } from './Source/Scene/GltfPipeline/updateVersion.js';\nexport { default as usesExtension } from './Source/Scene/GltfPipeline/usesExtension.js';\nexport { default as AlphaPipelineStage } from './Source/Scene/Model/AlphaPipelineStage.js';\nexport { default as B3dmLoader } from './Source/Scene/Model/B3dmLoader.js';\nexport { default as BatchTexturePipelineStage } from './Source/Scene/Model/BatchTexturePipelineStage.js';\nexport { default as CPUStylingPipelineStage } from './Source/Scene/Model/CPUStylingPipelineStage.js';\nexport { default as ClassificationModelDrawCommand } from './Source/Scene/Model/ClassificationModelDrawCommand.js';\nexport { default as ClassificationPipelineStage } from './Source/Scene/Model/ClassificationPipelineStage.js';\nexport { default as CustomShader } from './Source/Scene/Model/CustomShader.js';\nexport { default as CustomShaderMode } from './Source/Scene/Model/CustomShaderMode.js';\nexport { default as CustomShaderPipelineStage } from './Source/Scene/Model/CustomShaderPipelineStage.js';\nexport { default as CustomShaderTranslucencyMode } from './Source/Scene/Model/CustomShaderTranslucencyMode.js';\nexport { default as DequantizationPipelineStage } from './Source/Scene/Model/DequantizationPipelineStage.js';\nexport { default as FeatureIdPipelineStage } from './Source/Scene/Model/FeatureIdPipelineStage.js';\nexport { default as GeoJsonLoader } from './Source/Scene/Model/GeoJsonLoader.js';\nexport { default as GeometryPipelineStage } from './Source/Scene/Model/GeometryPipelineStage.js';\nexport { default as I3dmLoader } from './Source/Scene/Model/I3dmLoader.js';\nexport { default as ImageBasedLightingPipelineStage } from './Source/Scene/Model/ImageBasedLightingPipelineStage.js';\nexport { default as InstancingPipelineStage } from './Source/Scene/Model/InstancingPipelineStage.js';\nexport { default as LightingModel } from './Source/Scene/Model/LightingModel.js';\nexport { default as LightingPipelineStage } from './Source/Scene/Model/LightingPipelineStage.js';\nexport { default as MaterialPipelineStage } from './Source/Scene/Model/MaterialPipelineStage.js';\nexport { default as MetadataPipelineStage } from './Source/Scene/Model/MetadataPipelineStage.js';\nexport { default as Model } from './Source/Scene/Model/Model.js';\nexport { default as Model3DTileContent } from './Source/Scene/Model/Model3DTileContent.js';\nexport { default as ModelAlphaOptions } from './Source/Scene/Model/ModelAlphaOptions.js';\nexport { default as ModelAnimation } from './Source/Scene/Model/ModelAnimation.js';\nexport { default as ModelAnimationChannel } from './Source/Scene/Model/ModelAnimationChannel.js';\nexport { default as ModelAnimationCollection } from './Source/Scene/Model/ModelAnimationCollection.js';\nexport { default as ModelArticulation } from './Source/Scene/Model/ModelArticulation.js';\nexport { default as ModelArticulationStage } from './Source/Scene/Model/ModelArticulationStage.js';\nexport { default as ModelClippingPlanesPipelineStage } from './Source/Scene/Model/ModelClippingPlanesPipelineStage.js';\nexport { default as ModelColorPipelineStage } from './Source/Scene/Model/ModelColorPipelineStage.js';\nexport { default as ModelDrawCommand } from './Source/Scene/Model/ModelDrawCommand.js';\nexport { default as ModelFeature } from './Source/Scene/Model/ModelFeature.js';\nexport { default as ModelFeatureTable } from './Source/Scene/Model/ModelFeatureTable.js';\nexport { default as ModelLightingOptions } from './Source/Scene/Model/ModelLightingOptions.js';\nexport { default as ModelMatrixUpdateStage } from './Source/Scene/Model/ModelMatrixUpdateStage.js';\nexport { default as ModelNode } from './Source/Scene/Model/ModelNode.js';\nexport { default as ModelRenderResources } from './Source/Scene/Model/ModelRenderResources.js';\nexport { default as ModelRuntimeNode } from './Source/Scene/Model/ModelRuntimeNode.js';\nexport { default as ModelRuntimePrimitive } from './Source/Scene/Model/ModelRuntimePrimitive.js';\nexport { default as ModelSceneGraph } from './Source/Scene/Model/ModelSceneGraph.js';\nexport { default as ModelSilhouettePipelineStage } from './Source/Scene/Model/ModelSilhouettePipelineStage.js';\nexport { default as ModelSkin } from './Source/Scene/Model/ModelSkin.js';\nexport { default as ModelSplitterPipelineStage } from './Source/Scene/Model/ModelSplitterPipelineStage.js';\nexport { default as ModelStatistics } from './Source/Scene/Model/ModelStatistics.js';\nexport { default as ModelType } from './Source/Scene/Model/ModelType.js';\nexport { default as ModelUtility } from './Source/Scene/Model/ModelUtility.js';\nexport { default as MorphTargetsPipelineStage } from './Source/Scene/Model/MorphTargetsPipelineStage.js';\nexport { default as NodeRenderResources } from './Source/Scene/Model/NodeRenderResources.js';\nexport { default as NodeStatisticsPipelineStage } from './Source/Scene/Model/NodeStatisticsPipelineStage.js';\nexport { default as PickingPipelineStage } from './Source/Scene/Model/PickingPipelineStage.js';\nexport { default as PntsLoader } from './Source/Scene/Model/PntsLoader.js';\nexport { default as PointCloudStylingPipelineStage } from './Source/Scene/Model/PointCloudStylingPipelineStage.js';\nexport { default as PrimitiveOutlineGenerator } from './Source/Scene/Model/PrimitiveOutlineGenerator.js';\nexport { default as PrimitiveOutlinePipelineStage } from './Source/Scene/Model/PrimitiveOutlinePipelineStage.js';\nexport { default as PrimitiveRenderResources } from './Source/Scene/Model/PrimitiveRenderResources.js';\nexport { default as PrimitiveStatisticsPipelineStage } from './Source/Scene/Model/PrimitiveStatisticsPipelineStage.js';\nexport { default as SceneMode2DPipelineStage } from './Source/Scene/Model/SceneMode2DPipelineStage.js';\nexport { default as SelectedFeatureIdPipelineStage } from './Source/Scene/Model/SelectedFeatureIdPipelineStage.js';\nexport { default as SkinningPipelineStage } from './Source/Scene/Model/SkinningPipelineStage.js';\nexport { default as StyleCommandsNeeded } from './Source/Scene/Model/StyleCommandsNeeded.js';\nexport { default as TextureManager } from './Source/Scene/Model/TextureManager.js';\nexport { default as TextureUniform } from './Source/Scene/Model/TextureUniform.js';\nexport { default as TilesetPipelineStage } from './Source/Scene/Model/TilesetPipelineStage.js';\nexport { default as UniformType } from './Source/Scene/Model/UniformType.js';\nexport { default as VaryingType } from './Source/Scene/Model/VaryingType.js';\nexport { default as VerticalExaggerationPipelineStage } from './Source/Scene/Model/VerticalExaggerationPipelineStage.js';\nexport { default as WireframePipelineStage } from './Source/Scene/Model/WireframePipelineStage.js';\nexport { default as buildDrawCommand } from './Source/Scene/Model/buildDrawCommand.js';\nexport { default as _shadersdegreesPerRadian } from './Source/Shaders/Builtin/Constants/degreesPerRadian.js';\nexport { default as _shadersdepthRange } from './Source/Shaders/Builtin/Constants/depthRange.js';\nexport { default as _shadersepsilon1 } from './Source/Shaders/Builtin/Constants/epsilon1.js';\nexport { default as _shadersepsilon2 } from './Source/Shaders/Builtin/Constants/epsilon2.js';\nexport { default as _shadersepsilon3 } from './Source/Shaders/Builtin/Constants/epsilon3.js';\nexport { default as _shadersepsilon4 } from './Source/Shaders/Builtin/Constants/epsilon4.js';\nexport { default as _shadersepsilon5 } from './Source/Shaders/Builtin/Constants/epsilon5.js';\nexport { default as _shadersepsilon6 } from './Source/Shaders/Builtin/Constants/epsilon6.js';\nexport { default as _shadersepsilon7 } from './Source/Shaders/Builtin/Constants/epsilon7.js';\nexport { default as _shadersinfinity } from './Source/Shaders/Builtin/Constants/infinity.js';\nexport { default as _shadersoneOverPi } from './Source/Shaders/Builtin/Constants/oneOverPi.js';\nexport { default as _shadersoneOverTwoPi } from './Source/Shaders/Builtin/Constants/oneOverTwoPi.js';\nexport { default as _shaderspassCesium3DTile } from './Source/Shaders/Builtin/Constants/passCesium3DTile.js';\nexport { default as _shaderspassCesium3DTileClassification } from './Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js';\nexport { default as _shaderspassCesium3DTileClassificationIgnoreShow } from './Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js';\nexport { default as _shaderspassClassification } from './Source/Shaders/Builtin/Constants/passClassification.js';\nexport { default as _shaderspassCompute } from './Source/Shaders/Builtin/Constants/passCompute.js';\nexport { default as _shaderspassEnvironment } from './Source/Shaders/Builtin/Constants/passEnvironment.js';\nexport { default as _shaderspassGlobe } from './Source/Shaders/Builtin/Constants/passGlobe.js';\nexport { default as _shaderspassOpaque } from './Source/Shaders/Builtin/Constants/passOpaque.js';\nexport { default as _shaderspassOverlay } from './Source/Shaders/Builtin/Constants/passOverlay.js';\nexport { default as _shaderspassTerrainClassification } from './Source/Shaders/Builtin/Constants/passTerrainClassification.js';\nexport { default as _shaderspassTranslucent } from './Source/Shaders/Builtin/Constants/passTranslucent.js';\nexport { default as _shaderspassVoxels } from './Source/Shaders/Builtin/Constants/passVoxels.js';\nexport { default as _shaderspi } from './Source/Shaders/Builtin/Constants/pi.js';\nexport { default as _shaderspiOverFour } from './Source/Shaders/Builtin/Constants/piOverFour.js';\nexport { default as _shaderspiOverSix } from './Source/Shaders/Builtin/Constants/piOverSix.js';\nexport { default as _shaderspiOverThree } from './Source/Shaders/Builtin/Constants/piOverThree.js';\nexport { default as _shaderspiOverTwo } from './Source/Shaders/Builtin/Constants/piOverTwo.js';\nexport { default as _shadersradiansPerDegree } from './Source/Shaders/Builtin/Constants/radiansPerDegree.js';\nexport { default as _shaderssceneMode2D } from './Source/Shaders/Builtin/Constants/sceneMode2D.js';\nexport { default as _shaderssceneMode3D } from './Source/Shaders/Builtin/Constants/sceneMode3D.js';\nexport { default as _shaderssceneModeColumbusView } from './Source/Shaders/Builtin/Constants/sceneModeColumbusView.js';\nexport { default as _shaderssceneModeMorphing } from './Source/Shaders/Builtin/Constants/sceneModeMorphing.js';\nexport { default as _shaderssolarRadius } from './Source/Shaders/Builtin/Constants/solarRadius.js';\nexport { default as _shadersthreePiOver2 } from './Source/Shaders/Builtin/Constants/threePiOver2.js';\nexport { default as _shaderstwoPi } from './Source/Shaders/Builtin/Constants/twoPi.js';\nexport { default as _shaderswebMercatorMaxLatitude } from './Source/Shaders/Builtin/Constants/webMercatorMaxLatitude.js';\nexport { default as _shadersdepthRangeStruct } from './Source/Shaders/Builtin/Structs/depthRangeStruct.js';\nexport { default as _shadersmaterial } from './Source/Shaders/Builtin/Structs/material.js';\nexport { default as _shadersmaterialInput } from './Source/Shaders/Builtin/Structs/materialInput.js';\nexport { default as _shadersmodelMaterial } from './Source/Shaders/Builtin/Structs/modelMaterial.js';\nexport { default as _shadersmodelVertexOutput } from './Source/Shaders/Builtin/Structs/modelVertexOutput.js';\nexport { default as _shaderspbrParameters } from './Source/Shaders/Builtin/Structs/pbrParameters.js';\nexport { default as _shadersray } from './Source/Shaders/Builtin/Structs/ray.js';\nexport { default as _shadersraySegment } from './Source/Shaders/Builtin/Structs/raySegment.js';\nexport { default as _shadersshadowParameters } from './Source/Shaders/Builtin/Structs/shadowParameters.js';\nexport { default as _shadersHSBToRGB } from './Source/Shaders/Builtin/Functions/HSBToRGB.js';\nexport { default as _shadersHSLToRGB } from './Source/Shaders/Builtin/Functions/HSLToRGB.js';\nexport { default as _shadersRGBToHSB } from './Source/Shaders/Builtin/Functions/RGBToHSB.js';\nexport { default as _shadersRGBToHSL } from './Source/Shaders/Builtin/Functions/RGBToHSL.js';\nexport { default as _shadersRGBToXYZ } from './Source/Shaders/Builtin/Functions/RGBToXYZ.js';\nexport { default as _shadersXYZToRGB } from './Source/Shaders/Builtin/Functions/XYZToRGB.js';\nexport { default as _shadersacesTonemapping } from './Source/Shaders/Builtin/Functions/acesTonemapping.js';\nexport { default as _shadersalphaWeight } from './Source/Shaders/Builtin/Functions/alphaWeight.js';\nexport { default as _shadersantialias } from './Source/Shaders/Builtin/Functions/antialias.js';\nexport { default as _shadersapproximateSphericalCoordinates } from './Source/Shaders/Builtin/Functions/approximateSphericalCoordinates.js';\nexport { default as _shadersbackFacing } from './Source/Shaders/Builtin/Functions/backFacing.js';\nexport { default as _shadersbranchFreeTernary } from './Source/Shaders/Builtin/Functions/branchFreeTernary.js';\nexport { default as _shaderscascadeColor } from './Source/Shaders/Builtin/Functions/cascadeColor.js';\nexport { default as _shaderscascadeDistance } from './Source/Shaders/Builtin/Functions/cascadeDistance.js';\nexport { default as _shaderscascadeMatrix } from './Source/Shaders/Builtin/Functions/cascadeMatrix.js';\nexport { default as _shaderscascadeWeights } from './Source/Shaders/Builtin/Functions/cascadeWeights.js';\nexport { default as _shaderscolumbusViewMorph } from './Source/Shaders/Builtin/Functions/columbusViewMorph.js';\nexport { default as _shaderscomputePosition } from './Source/Shaders/Builtin/Functions/computePosition.js';\nexport { default as _shaderscosineAndSine } from './Source/Shaders/Builtin/Functions/cosineAndSine.js';\nexport { default as _shadersdecompressTextureCoordinates } from './Source/Shaders/Builtin/Functions/decompressTextureCoordinates.js';\nexport { default as _shadersdefaultPbrMaterial } from './Source/Shaders/Builtin/Functions/defaultPbrMaterial.js';\nexport { default as _shadersdepthClamp } from './Source/Shaders/Builtin/Functions/depthClamp.js';\nexport { default as _shaderseastNorthUpToEyeCoordinates } from './Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.js';\nexport { default as _shadersellipsoidContainsPoint } from './Source/Shaders/Builtin/Functions/ellipsoidContainsPoint.js';\nexport { default as _shadersellipsoidWgs84TextureCoordinates } from './Source/Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates.js';\nexport { default as _shadersequalsEpsilon } from './Source/Shaders/Builtin/Functions/equalsEpsilon.js';\nexport { default as _shaderseyeOffset } from './Source/Shaders/Builtin/Functions/eyeOffset.js';\nexport { default as _shaderseyeToWindowCoordinates } from './Source/Shaders/Builtin/Functions/eyeToWindowCoordinates.js';\nexport { default as _shadersfastApproximateAtan } from './Source/Shaders/Builtin/Functions/fastApproximateAtan.js';\nexport { default as _shadersfog } from './Source/Shaders/Builtin/Functions/fog.js';\nexport { default as _shadersgammaCorrect } from './Source/Shaders/Builtin/Functions/gammaCorrect.js';\nexport { default as _shadersgeodeticSurfaceNormal } from './Source/Shaders/Builtin/Functions/geodeticSurfaceNormal.js';\nexport { default as _shadersgetDefaultMaterial } from './Source/Shaders/Builtin/Functions/getDefaultMaterial.js';\nexport { default as _shadersgetLambertDiffuse } from './Source/Shaders/Builtin/Functions/getLambertDiffuse.js';\nexport { default as _shadersgetSpecular } from './Source/Shaders/Builtin/Functions/getSpecular.js';\nexport { default as _shadersgetWaterNoise } from './Source/Shaders/Builtin/Functions/getWaterNoise.js';\nexport { default as _shadershue } from './Source/Shaders/Builtin/Functions/hue.js';\nexport { default as _shadersinverseGamma } from './Source/Shaders/Builtin/Functions/inverseGamma.js';\nexport { default as _shadersisEmpty } from './Source/Shaders/Builtin/Functions/isEmpty.js';\nexport { default as _shadersisFull } from './Source/Shaders/Builtin/Functions/isFull.js';\nexport { default as _shaderslatitudeToWebMercatorFraction } from './Source/Shaders/Builtin/Functions/latitudeToWebMercatorFraction.js';\nexport { default as _shaderslineDistance } from './Source/Shaders/Builtin/Functions/lineDistance.js';\nexport { default as _shaderslinearToSrgb } from './Source/Shaders/Builtin/Functions/linearToSrgb.js';\nexport { default as _shadersluminance } from './Source/Shaders/Builtin/Functions/luminance.js';\nexport { default as _shadersmetersPerPixel } from './Source/Shaders/Builtin/Functions/metersPerPixel.js';\nexport { default as _shadersmodelToWindowCoordinates } from './Source/Shaders/Builtin/Functions/modelToWindowCoordinates.js';\nexport { default as _shadersmultiplyWithColorBalance } from './Source/Shaders/Builtin/Functions/multiplyWithColorBalance.js';\nexport { default as _shadersnearFarScalar } from './Source/Shaders/Builtin/Functions/nearFarScalar.js';\nexport { default as _shadersoctDecode } from './Source/Shaders/Builtin/Functions/octDecode.js';\nexport { default as _shaderspackDepth } from './Source/Shaders/Builtin/Functions/packDepth.js';\nexport { default as _shaderspbrLighting } from './Source/Shaders/Builtin/Functions/pbrLighting.js';\nexport { default as _shaderspbrMetallicRoughnessMaterial } from './Source/Shaders/Builtin/Functions/pbrMetallicRoughnessMaterial.js';\nexport { default as _shaderspbrSpecularGlossinessMaterial } from './Source/Shaders/Builtin/Functions/pbrSpecularGlossinessMaterial.js';\nexport { default as _shadersphong } from './Source/Shaders/Builtin/Functions/phong.js';\nexport { default as _shadersplaneDistance } from './Source/Shaders/Builtin/Functions/planeDistance.js';\nexport { default as _shaderspointAlongRay } from './Source/Shaders/Builtin/Functions/pointAlongRay.js';\nexport { default as _shadersrayEllipsoidIntersectionInterval } from './Source/Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval.js';\nexport { default as _shadersraySphereIntersectionInterval } from './Source/Shaders/Builtin/Functions/raySphereIntersectionInterval.js';\nexport { default as _shadersreadDepth } from './Source/Shaders/Builtin/Functions/readDepth.js';\nexport { default as _shadersreadNonPerspective } from './Source/Shaders/Builtin/Functions/readNonPerspective.js';\nexport { default as _shadersreverseLogDepth } from './Source/Shaders/Builtin/Functions/reverseLogDepth.js';\nexport { default as _shadersround } from './Source/Shaders/Builtin/Functions/round.js';\nexport { default as _shaderssampleOctahedralProjection } from './Source/Shaders/Builtin/Functions/sampleOctahedralProjection.js';\nexport { default as _shaderssaturation } from './Source/Shaders/Builtin/Functions/saturation.js';\nexport { default as _shadersshadowDepthCompare } from './Source/Shaders/Builtin/Functions/shadowDepthCompare.js';\nexport { default as _shadersshadowVisibility } from './Source/Shaders/Builtin/Functions/shadowVisibility.js';\nexport { default as _shaderssignNotZero } from './Source/Shaders/Builtin/Functions/signNotZero.js';\nexport { default as _shaderssphericalHarmonics } from './Source/Shaders/Builtin/Functions/sphericalHarmonics.js';\nexport { default as _shaderssrgbToLinear } from './Source/Shaders/Builtin/Functions/srgbToLinear.js';\nexport { default as _shaderstangentToEyeSpaceMatrix } from './Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.js';\nexport { default as _shaderstextureCube } from './Source/Shaders/Builtin/Functions/textureCube.js';\nexport { default as _shaderstransformPlane } from './Source/Shaders/Builtin/Functions/transformPlane.js';\nexport { default as _shaderstranslateRelativeToEye } from './Source/Shaders/Builtin/Functions/translateRelativeToEye.js';\nexport { default as _shaderstranslucentPhong } from './Source/Shaders/Builtin/Functions/translucentPhong.js';\nexport { default as _shaderstranspose } from './Source/Shaders/Builtin/Functions/transpose.js';\nexport { default as _shadersunpackDepth } from './Source/Shaders/Builtin/Functions/unpackDepth.js';\nexport { default as _shadersunpackFloat } from './Source/Shaders/Builtin/Functions/unpackFloat.js';\nexport { default as _shadersunpackUint } from './Source/Shaders/Builtin/Functions/unpackUint.js';\nexport { default as _shadersvalueTransform } from './Source/Shaders/Builtin/Functions/valueTransform.js';\nexport { default as _shadersvertexLogDepth } from './Source/Shaders/Builtin/Functions/vertexLogDepth.js';\nexport { default as _shaderswindowToEyeCoordinates } from './Source/Shaders/Builtin/Functions/windowToEyeCoordinates.js';\nexport { default as _shaderswriteDepthClamp } from './Source/Shaders/Builtin/Functions/writeDepthClamp.js';\nexport { default as _shaderswriteLogDepth } from './Source/Shaders/Builtin/Functions/writeLogDepth.js';\nexport { default as _shaderswriteNonPerspective } from './Source/Shaders/Builtin/Functions/writeNonPerspective.js';\nexport { default as createTaskProcessorWorker } from './Source/Workers/createTaskProcessorWorker.js';\n", "var oldValue;\nif (typeof ko !== 'undefined') {\n    oldValue = ko;\n}\n\n(function(){\n/*!\n * Knockout JavaScript library v3.5.1\n * (c) The Knockout.js team - http://knockoutjs.com/\n * License: MIT (http://www.opensource.org/licenses/mit-license.php)\n */\n\n(function() {(function(n){var A=this||(0,eval)(\"this\"),w=A.document,R=A.navigator,v=A.jQuery,H=A.JSON;v||\"undefined\"===typeof jQuery||(v=jQuery);(function(n){n(A.ko={})})(function(S,T){function K(a,c){return null===a||typeof a in W?a===c:!1}function X(b,c){var d;return function(){d||(d=a.a.setTimeout(function(){d=n;b()},c))}}function Y(b,c){var d;return function(){clearTimeout(d);\nd=a.a.setTimeout(b,c)}}function Z(a,c){c&&\"change\"!==c?\"beforeChange\"===c?this.pc(a):this.gb(a,c):this.qc(a)}function aa(a,c){null!==c&&c.s&&c.s()}function ba(a,c){var d=this.qd,e=d[r];e.ra||(this.Qb&&this.mb[c]?(d.uc(c,a,this.mb[c]),this.mb[c]=null,--this.Qb):e.I[c]||d.uc(c,a,e.J?{da:a}:d.$c(a)),a.Ja&&a.gd())}var a=\"undefined\"!==typeof S?S:{};a.b=function(b,c){for(var d=b.split(\".\"),e=a,f=0;f<d.length-1;f++)e=e[d[f]];e[d[d.length-1]]=c};a.L=function(a,c,d){a[c]=d};a.version=\"3.5.1\";a.b(\"version\",\na.version);a.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1};a.a=function(){function b(a,b){for(var c in a)f.call(a,c)&&b(c,a[c])}function c(a,b){if(b)for(var c in b)f.call(b,c)&&(a[c]=b[c]);return a}function d(a,b){a.__proto__=b;return a}function e(b,c,d,e){var l=b[c].match(q)||[];a.a.D(d.match(q),function(b){a.a.Na(l,b,e)});b[c]=l.join(\" \")}var f=Object.prototype.hasOwnProperty,g={__proto__:[]}instanceof Array,h=\"function\"===typeof Symbol,m={},k={};m[R&&/Firefox\\/2/i.test(R.userAgent)?\n\"KeyboardEvent\":\"UIEvents\"]=[\"keyup\",\"keydown\",\"keypress\"];m.MouseEvents=\"click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave\".split(\" \");b(m,function(a,b){if(b.length)for(var c=0,d=b.length;c<d;c++)k[b[c]]=a});var l={propertychange:!0},p=w&&function(){for(var a=3,b=w.createElement(\"div\"),c=b.getElementsByTagName(\"i\");b.innerHTML=\"\\x3c!--[if gt IE \"+ ++a+\"]><i></i><![endif]--\\x3e\",c[0];);return 4<a?a:n}(),q=/\\S+/g,t;return{Jc:[\"authenticity_token\",/^__RequestVerificationToken(_.*)?$/],\nD:function(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c,a[d],d,a)},A:\"function\"==typeof Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b)}:function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},Lb:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(b.call(c,a[d],d,a))return a[d];return n},Pa:function(b,c){var d=a.a.A(b,c);0<d?b.splice(d,1):0===d&&b.shift()},wc:function(b){var c=[];b&&a.a.D(b,function(b){0>a.a.A(c,b)&&c.push(b)});return c},Mb:function(a,\nb,c){var d=[];if(a)for(var e=0,l=a.length;e<l;e++)d.push(b.call(c,a[e],e));return d},jb:function(a,b,c){var d=[];if(a)for(var e=0,l=a.length;e<l;e++)b.call(c,a[e],e)&&d.push(a[e]);return d},Nb:function(a,b){if(b instanceof Array)a.push.apply(a,b);else for(var c=0,d=b.length;c<d;c++)a.push(b[c]);return a},Na:function(b,c,d){var e=a.a.A(a.a.bc(b),c);0>e?d&&b.push(c):d||b.splice(e,1)},Ba:g,extend:c,setPrototypeOf:d,Ab:g?d:c,P:b,Ga:function(a,b,c){if(!a)return a;var d={},e;for(e in a)f.call(a,e)&&(d[e]=\nb.call(c,a[e],e,a));return d},Tb:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},Yb:function(b){b=a.a.la(b);for(var c=(b[0]&&b[0].ownerDocument||w).createElement(\"div\"),d=0,e=b.length;d<e;d++)c.appendChild(a.oa(b[d]));return c},Ca:function(b,c){for(var d=0,e=b.length,l=[];d<e;d++){var k=b[d].cloneNode(!0);l.push(c?a.oa(k):k)}return l},va:function(b,c){a.a.Tb(b);if(c)for(var d=0,e=c.length;d<e;d++)b.appendChild(c[d])},Xc:function(b,c){var d=b.nodeType?[b]:b;if(0<d.length){for(var e=d[0],\nl=e.parentNode,k=0,f=c.length;k<f;k++)l.insertBefore(c[k],e);k=0;for(f=d.length;k<f;k++)a.removeNode(d[k])}},Ua:function(a,b){if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.splice(0,1);for(;1<a.length&&a[a.length-1].parentNode!==b;)a.length--;if(1<a.length){var c=a[0],d=a[a.length-1];for(a.length=0;c!==d;)a.push(c),c=c.nextSibling;a.push(d)}}return a},Zc:function(a,b){7>p?a.setAttribute(\"selected\",b):a.selected=b},Db:function(a){return null===a||a===n?\"\":a.trim?\na.trim():a.toString().replace(/^[\\s\\xa0]+|[\\s\\xa0]+$/g,\"\")},Ud:function(a,b){a=a||\"\";return b.length>a.length?!1:a.substring(0,b.length)===b},vd:function(a,b){if(a===b)return!0;if(11===a.nodeType)return!1;if(b.contains)return b.contains(1!==a.nodeType?a.parentNode:a);if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&16);for(;a&&a!=b;)a=a.parentNode;return!!a},Sb:function(b){return a.a.vd(b,b.ownerDocument.documentElement)},kd:function(b){return!!a.a.Lb(b,a.a.Sb)},R:function(a){return a&&\na.tagName&&a.tagName.toLowerCase()},Ac:function(b){return a.onError?function(){try{return b.apply(this,arguments)}catch(c){throw a.onError&&a.onError(c),c;}}:b},setTimeout:function(b,c){return setTimeout(a.a.Ac(b),c)},Gc:function(b){setTimeout(function(){a.onError&&a.onError(b);throw b;},0)},B:function(b,c,d){var e=a.a.Ac(d);d=l[c];if(a.options.useOnlyNativeEvents||d||!v)if(d||\"function\"!=typeof b.addEventListener)if(\"undefined\"!=typeof b.attachEvent){var k=function(a){e.call(b,a)},f=\"on\"+c;b.attachEvent(f,\nk);a.a.K.za(b,function(){b.detachEvent(f,k)})}else throw Error(\"Browser doesn't support addEventListener or attachEvent\");else b.addEventListener(c,e,!1);else t||(t=\"function\"==typeof v(b).on?\"on\":\"bind\"),v(b)[t](c,e)},Fb:function(b,c){if(!b||!b.nodeType)throw Error(\"element must be a DOM node when calling triggerEvent\");var d;\"input\"===a.a.R(b)&&b.type&&\"click\"==c.toLowerCase()?(d=b.type,d=\"checkbox\"==d||\"radio\"==d):d=!1;if(a.options.useOnlyNativeEvents||!v||d)if(\"function\"==typeof w.createEvent)if(\"function\"==\ntypeof b.dispatchEvent)d=w.createEvent(k[c]||\"HTMLEvents\"),d.initEvent(c,!0,!0,A,0,0,0,0,0,!1,!1,!1,!1,0,b),b.dispatchEvent(d);else throw Error(\"The supplied element doesn't support dispatchEvent\");else if(d&&b.click)b.click();else if(\"undefined\"!=typeof b.fireEvent)b.fireEvent(\"on\"+c);else throw Error(\"Browser doesn't support triggering events\");else v(b).trigger(c)},f:function(b){return a.O(b)?b():b},bc:function(b){return a.O(b)?b.v():b},Eb:function(b,c,d){var l;c&&(\"object\"===typeof b.classList?\n(l=b.classList[d?\"add\":\"remove\"],a.a.D(c.match(q),function(a){l.call(b.classList,a)})):\"string\"===typeof b.className.baseVal?e(b.className,\"baseVal\",c,d):e(b,\"className\",c,d))},Bb:function(b,c){var d=a.a.f(c);if(null===d||d===n)d=\"\";var e=a.h.firstChild(b);!e||3!=e.nodeType||a.h.nextSibling(e)?a.h.va(b,[b.ownerDocument.createTextNode(d)]):e.data=d;a.a.Ad(b)},Yc:function(a,b){a.name=b;if(7>=p)try{var c=a.name.replace(/[&<>'\"]/g,function(a){return\"&#\"+a.charCodeAt(0)+\";\"});a.mergeAttributes(w.createElement(\"<input name='\"+\nc+\"'/>\"),!1)}catch(d){}},Ad:function(a){9<=p&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},wd:function(a){if(p){var b=a.style.width;a.style.width=0;a.style.width=b}},Pd:function(b,c){b=a.a.f(b);c=a.a.f(c);for(var d=[],e=b;e<=c;e++)d.push(e);return d},la:function(a){for(var b=[],c=0,d=a.length;c<d;c++)b.push(a[c]);return b},Da:function(a){return h?Symbol(a):a},Zd:6===p,$d:7===p,W:p,Lc:function(b,c){for(var d=a.a.la(b.getElementsByTagName(\"input\")).concat(a.a.la(b.getElementsByTagName(\"textarea\"))),\ne=\"string\"==typeof c?function(a){return a.name===c}:function(a){return c.test(a.name)},l=[],k=d.length-1;0<=k;k--)e(d[k])&&l.push(d[k]);return l},Nd:function(b){return\"string\"==typeof b&&(b=a.a.Db(b))?H&&H.parse?H.parse(b):(new Function(\"return \"+b))():null},hc:function(b,c,d){if(!H||!H.stringify)throw Error(\"Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js\");\nreturn H.stringify(a.a.f(b),c,d)},Od:function(c,d,e){e=e||{};var l=e.params||{},k=e.includeFields||this.Jc,f=c;if(\"object\"==typeof c&&\"form\"===a.a.R(c))for(var f=c.action,h=k.length-1;0<=h;h--)for(var g=a.a.Lc(c,k[h]),m=g.length-1;0<=m;m--)l[g[m].name]=g[m].value;d=a.a.f(d);var p=w.createElement(\"form\");p.style.display=\"none\";p.action=f;p.method=\"post\";for(var q in d)c=w.createElement(\"input\"),c.type=\"hidden\",c.name=q,c.value=a.a.hc(a.a.f(d[q])),p.appendChild(c);b(l,function(a,b){var c=w.createElement(\"input\");\nc.type=\"hidden\";c.name=a;c.value=b;p.appendChild(c)});w.body.appendChild(p);e.submitter?e.submitter(p):p.submit();setTimeout(function(){p.parentNode.removeChild(p)},0)}}}();a.b(\"utils\",a.a);a.b(\"utils.arrayForEach\",a.a.D);a.b(\"utils.arrayFirst\",a.a.Lb);a.b(\"utils.arrayFilter\",a.a.jb);a.b(\"utils.arrayGetDistinctValues\",a.a.wc);a.b(\"utils.arrayIndexOf\",a.a.A);a.b(\"utils.arrayMap\",a.a.Mb);a.b(\"utils.arrayPushAll\",a.a.Nb);a.b(\"utils.arrayRemoveItem\",a.a.Pa);a.b(\"utils.cloneNodes\",a.a.Ca);a.b(\"utils.createSymbolOrString\",\na.a.Da);a.b(\"utils.extend\",a.a.extend);a.b(\"utils.fieldsIncludedWithJsonPost\",a.a.Jc);a.b(\"utils.getFormFields\",a.a.Lc);a.b(\"utils.objectMap\",a.a.Ga);a.b(\"utils.peekObservable\",a.a.bc);a.b(\"utils.postJson\",a.a.Od);a.b(\"utils.parseJson\",a.a.Nd);a.b(\"utils.registerEventHandler\",a.a.B);a.b(\"utils.stringifyJson\",a.a.hc);a.b(\"utils.range\",a.a.Pd);a.b(\"utils.toggleDomNodeCssClass\",a.a.Eb);a.b(\"utils.triggerEvent\",a.a.Fb);a.b(\"utils.unwrapObservable\",a.a.f);a.b(\"utils.objectForEach\",a.a.P);a.b(\"utils.addOrRemoveItem\",\na.a.Na);a.b(\"utils.setTextContent\",a.a.Bb);a.b(\"unwrap\",a.a.f);Function.prototype.bind||(Function.prototype.bind=function(a){var c=this;if(1===arguments.length)return function(){return c.apply(a,arguments)};var d=Array.prototype.slice.call(arguments,1);return function(){var e=d.slice(0);e.push.apply(e,arguments);return c.apply(a,e)}});a.a.g=new function(){var b=0,c=\"__ko__\"+(new Date).getTime(),d={},e,f;a.a.W?(e=function(a,e){var f=a[c];if(!f||\"null\"===f||!d[f]){if(!e)return n;f=a[c]=\"ko\"+b++;d[f]=\n{}}return d[f]},f=function(a){var b=a[c];return b?(delete d[b],a[c]=null,!0):!1}):(e=function(a,b){var d=a[c];!d&&b&&(d=a[c]={});return d},f=function(a){return a[c]?(delete a[c],!0):!1});return{get:function(a,b){var c=e(a,!1);return c&&c[b]},set:function(a,b,c){(a=e(a,c!==n))&&(a[b]=c)},Ub:function(a,b,c){a=e(a,!0);return a[b]||(a[b]=c)},clear:f,Z:function(){return b++ +c}}};a.b(\"utils.domData\",a.a.g);a.b(\"utils.domData.clear\",a.a.g.clear);a.a.K=new function(){function b(b,c){var d=a.a.g.get(b,e);\nd===n&&c&&(d=[],a.a.g.set(b,e,d));return d}function c(c){var e=b(c,!1);if(e)for(var e=e.slice(0),k=0;k<e.length;k++)e[k](c);a.a.g.clear(c);a.a.K.cleanExternalData(c);g[c.nodeType]&&d(c.childNodes,!0)}function d(b,d){for(var e=[],l,f=0;f<b.length;f++)if(!d||8===b[f].nodeType)if(c(e[e.length]=l=b[f]),b[f]!==l)for(;f--&&-1==a.a.A(e,b[f]););}var e=a.a.g.Z(),f={1:!0,8:!0,9:!0},g={1:!0,9:!0};return{za:function(a,c){if(\"function\"!=typeof c)throw Error(\"Callback must be a function\");b(a,!0).push(c)},yb:function(c,\nd){var f=b(c,!1);f&&(a.a.Pa(f,d),0==f.length&&a.a.g.set(c,e,n))},oa:function(b){a.u.G(function(){f[b.nodeType]&&(c(b),g[b.nodeType]&&d(b.getElementsByTagName(\"*\")))});return b},removeNode:function(b){a.oa(b);b.parentNode&&b.parentNode.removeChild(b)},cleanExternalData:function(a){v&&\"function\"==typeof v.cleanData&&v.cleanData([a])}}};a.oa=a.a.K.oa;a.removeNode=a.a.K.removeNode;a.b(\"cleanNode\",a.oa);a.b(\"removeNode\",a.removeNode);a.b(\"utils.domNodeDisposal\",a.a.K);a.b(\"utils.domNodeDisposal.addDisposeCallback\",\na.a.K.za);a.b(\"utils.domNodeDisposal.removeDisposeCallback\",a.a.K.yb);(function(){var b=[0,\"\",\"\"],c=[1,\"<table>\",\"</table>\"],d=[3,\"<table><tbody><tr>\",\"</tr></tbody></table>\"],e=[1,\"<select multiple='multiple'>\",\"</select>\"],f={thead:c,tbody:c,tfoot:c,tr:[2,\"<table><tbody>\",\"</tbody></table>\"],td:d,th:d,option:e,optgroup:e},g=8>=a.a.W;a.a.ua=function(c,d){var e;if(v)if(v.parseHTML)e=v.parseHTML(c,d)||[];else{if((e=v.clean([c],d))&&e[0]){for(var l=e[0];l.parentNode&&11!==l.parentNode.nodeType;)l=l.parentNode;\nl.parentNode&&l.parentNode.removeChild(l)}}else{(e=d)||(e=w);var l=e.parentWindow||e.defaultView||A,p=a.a.Db(c).toLowerCase(),q=e.createElement(\"div\"),t;t=(p=p.match(/^(?:\\x3c!--.*?--\\x3e\\s*?)*?<([a-z]+)[\\s>]/))&&f[p[1]]||b;p=t[0];t=\"ignored<div>\"+t[1]+c+t[2]+\"</div>\";\"function\"==typeof l.innerShiv?q.appendChild(l.innerShiv(t)):(g&&e.body.appendChild(q),q.innerHTML=t,g&&q.parentNode.removeChild(q));for(;p--;)q=q.lastChild;e=a.a.la(q.lastChild.childNodes)}return e};a.a.Md=function(b,c){var d=a.a.ua(b,\nc);return d.length&&d[0].parentElement||a.a.Yb(d)};a.a.fc=function(b,c){a.a.Tb(b);c=a.a.f(c);if(null!==c&&c!==n)if(\"string\"!=typeof c&&(c=c.toString()),v)v(b).html(c);else for(var d=a.a.ua(c,b.ownerDocument),e=0;e<d.length;e++)b.appendChild(d[e])}})();a.b(\"utils.parseHtmlFragment\",a.a.ua);a.b(\"utils.setHtml\",a.a.fc);a.aa=function(){function b(c,e){if(c)if(8==c.nodeType){var f=a.aa.Uc(c.nodeValue);null!=f&&e.push({ud:c,Kd:f})}else if(1==c.nodeType)for(var f=0,g=c.childNodes,h=g.length;f<h;f++)b(g[f],\ne)}var c={};return{Xb:function(a){if(\"function\"!=typeof a)throw Error(\"You can only pass a function to ko.memoization.memoize()\");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);c[b]=a;return\"\\x3c!--[ko_memo:\"+b+\"]--\\x3e\"},bd:function(a,b){var f=c[a];if(f===n)throw Error(\"Couldn't find any memo with ID \"+a+\". Perhaps it's already been unmemoized.\");try{return f.apply(null,b||[]),!0}finally{delete c[a]}},cd:function(c,e){var f=\n[];b(c,f);for(var g=0,h=f.length;g<h;g++){var m=f[g].ud,k=[m];e&&a.a.Nb(k,e);a.aa.bd(f[g].Kd,k);m.nodeValue=\"\";m.parentNode&&m.parentNode.removeChild(m)}},Uc:function(a){return(a=a.match(/^\\[ko_memo\\:(.*?)\\]$/))?a[1]:null}}}();a.b(\"memoization\",a.aa);a.b(\"memoization.memoize\",a.aa.Xb);a.b(\"memoization.unmemoize\",a.aa.bd);a.b(\"memoization.parseMemoText\",a.aa.Uc);a.b(\"memoization.unmemoizeDomNodeAndDescendants\",a.aa.cd);a.na=function(){function b(){if(f)for(var b=f,c=0,d;h<f;)if(d=e[h++]){if(h>b){if(5E3<=\n++c){h=f;a.a.Gc(Error(\"'Too much recursion' after processing \"+c+\" task groups.\"));break}b=f}try{d()}catch(p){a.a.Gc(p)}}}function c(){b();h=f=e.length=0}var d,e=[],f=0,g=1,h=0;A.MutationObserver?d=function(a){var b=w.createElement(\"div\");(new MutationObserver(a)).observe(b,{attributes:!0});return function(){b.classList.toggle(\"foo\")}}(c):d=w&&\"onreadystatechange\"in w.createElement(\"script\")?function(a){var b=w.createElement(\"script\");b.onreadystatechange=function(){b.onreadystatechange=null;w.documentElement.removeChild(b);\nb=null;a()};w.documentElement.appendChild(b)}:function(a){setTimeout(a,0)};return{scheduler:d,zb:function(b){f||a.na.scheduler(c);e[f++]=b;return g++},cancel:function(a){a=a-(g-f);a>=h&&a<f&&(e[a]=null)},resetForTesting:function(){var a=f-h;h=f=e.length=0;return a},Sd:b}}();a.b(\"tasks\",a.na);a.b(\"tasks.schedule\",a.na.zb);a.b(\"tasks.runEarly\",a.na.Sd);a.Ta={throttle:function(b,c){b.throttleEvaluation=c;var d=null;return a.$({read:b,write:function(e){clearTimeout(d);d=a.a.setTimeout(function(){b(e)},\nc)}})},rateLimit:function(a,c){var d,e,f;\"number\"==typeof c?d=c:(d=c.timeout,e=c.method);a.Hb=!1;f=\"function\"==typeof e?e:\"notifyWhenChangesStop\"==e?Y:X;a.ub(function(a){return f(a,d,c)})},deferred:function(b,c){if(!0!==c)throw Error(\"The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.\");b.Hb||(b.Hb=!0,b.ub(function(c){var e,f=!1;return function(){if(!f){a.na.cancel(e);e=a.na.zb(c);try{f=!0,b.notifySubscribers(n,\"dirty\")}finally{f=\n!1}}}}))},notify:function(a,c){a.equalityComparer=\"always\"==c?null:K}};var W={undefined:1,\"boolean\":1,number:1,string:1};a.b(\"extenders\",a.Ta);a.ic=function(b,c,d){this.da=b;this.lc=c;this.mc=d;this.Ib=!1;this.fb=this.Jb=null;a.L(this,\"dispose\",this.s);a.L(this,\"disposeWhenNodeIsRemoved\",this.l)};a.ic.prototype.s=function(){this.Ib||(this.fb&&a.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)};a.ic.prototype.l=function(b){this.Jb=b;a.a.K.za(b,this.fb=this.s.bind(this))};\na.T=function(){a.a.Ab(this,D);D.qb(this)};var D={qb:function(a){a.U={change:[]};a.sc=1},subscribe:function(b,c,d){var e=this;d=d||\"change\";var f=new a.ic(e,c?b.bind(c):b,function(){a.a.Pa(e.U[d],f);e.hb&&e.hb(d)});e.Qa&&e.Qa(d);e.U[d]||(e.U[d]=[]);e.U[d].push(f);return f},notifySubscribers:function(b,c){c=c||\"change\";\"change\"===c&&this.Gb();if(this.Wa(c)){var d=\"change\"===c&&this.ed||this.U[c].slice(0);try{a.u.xc();for(var e=0,f;f=d[e];++e)f.Ib||f.lc(b)}finally{a.u.end()}}},ob:function(){return this.sc},\nDd:function(a){return this.ob()!==a},Gb:function(){++this.sc},ub:function(b){var c=this,d=a.O(c),e,f,g,h,m;c.gb||(c.gb=c.notifySubscribers,c.notifySubscribers=Z);var k=b(function(){c.Ja=!1;d&&h===c&&(h=c.nc?c.nc():c());var a=f||m&&c.sb(g,h);m=f=e=!1;a&&c.gb(g=h)});c.qc=function(a,b){b&&c.Ja||(m=!b);c.ed=c.U.change.slice(0);c.Ja=e=!0;h=a;k()};c.pc=function(a){e||(g=a,c.gb(a,\"beforeChange\"))};c.rc=function(){m=!0};c.gd=function(){c.sb(g,c.v(!0))&&(f=!0)}},Wa:function(a){return this.U[a]&&this.U[a].length},\nBd:function(b){if(b)return this.U[b]&&this.U[b].length||0;var c=0;a.a.P(this.U,function(a,b){\"dirty\"!==a&&(c+=b.length)});return c},sb:function(a,c){return!this.equalityComparer||!this.equalityComparer(a,c)},toString:function(){return\"[object Object]\"},extend:function(b){var c=this;b&&a.a.P(b,function(b,e){var f=a.Ta[b];\"function\"==typeof f&&(c=f(c,e)||c)});return c}};a.L(D,\"init\",D.qb);a.L(D,\"subscribe\",D.subscribe);a.L(D,\"extend\",D.extend);a.L(D,\"getSubscriptionsCount\",D.Bd);a.a.Ba&&a.a.setPrototypeOf(D,\nFunction.prototype);a.T.fn=D;a.Qc=function(a){return null!=a&&\"function\"==typeof a.subscribe&&\"function\"==typeof a.notifySubscribers};a.b(\"subscribable\",a.T);a.b(\"isSubscribable\",a.Qc);a.S=a.u=function(){function b(a){d.push(e);e=a}function c(){e=d.pop()}var d=[],e,f=0;return{xc:b,end:c,cc:function(b){if(e){if(!a.Qc(b))throw Error(\"Only subscribable things can act as dependencies\");e.od.call(e.pd,b,b.fd||(b.fd=++f))}},G:function(a,d,e){try{return b(),a.apply(d,e||[])}finally{c()}},qa:function(){if(e)return e.o.qa()},\nVa:function(){if(e)return e.o.Va()},Ya:function(){if(e)return e.Ya},o:function(){if(e)return e.o}}}();a.b(\"computedContext\",a.S);a.b(\"computedContext.getDependenciesCount\",a.S.qa);a.b(\"computedContext.getDependencies\",a.S.Va);a.b(\"computedContext.isInitial\",a.S.Ya);a.b(\"computedContext.registerDependency\",a.S.cc);a.b(\"ignoreDependencies\",a.Yd=a.u.G);var I=a.a.Da(\"_latestValue\");a.ta=function(b){function c(){if(0<arguments.length)return c.sb(c[I],arguments[0])&&(c.ya(),c[I]=arguments[0],c.xa()),this;\na.u.cc(c);return c[I]}c[I]=b;a.a.Ba||a.a.extend(c,a.T.fn);a.T.fn.qb(c);a.a.Ab(c,F);a.options.deferUpdates&&a.Ta.deferred(c,!0);return c};var F={equalityComparer:K,v:function(){return this[I]},xa:function(){this.notifySubscribers(this[I],\"spectate\");this.notifySubscribers(this[I])},ya:function(){this.notifySubscribers(this[I],\"beforeChange\")}};a.a.Ba&&a.a.setPrototypeOf(F,a.T.fn);var G=a.ta.Ma=\"__ko_proto__\";F[G]=a.ta;a.O=function(b){if((b=\"function\"==typeof b&&b[G])&&b!==F[G]&&b!==a.o.fn[G])throw Error(\"Invalid object that looks like an observable; possibly from another Knockout instance\");\nreturn!!b};a.Za=function(b){return\"function\"==typeof b&&(b[G]===F[G]||b[G]===a.o.fn[G]&&b.Nc)};a.b(\"observable\",a.ta);a.b(\"isObservable\",a.O);a.b(\"isWriteableObservable\",a.Za);a.b(\"isWritableObservable\",a.Za);a.b(\"observable.fn\",F);a.L(F,\"peek\",F.v);a.L(F,\"valueHasMutated\",F.xa);a.L(F,\"valueWillMutate\",F.ya);a.Ha=function(b){b=b||[];if(\"object\"!=typeof b||!(\"length\"in b))throw Error(\"The argument passed when initializing an observable array must be an array, or null, or undefined.\");b=a.ta(b);a.a.Ab(b,\na.Ha.fn);return b.extend({trackArrayChanges:!0})};a.Ha.fn={remove:function(b){for(var c=this.v(),d=[],e=\"function\"!=typeof b||a.O(b)?function(a){return a===b}:b,f=0;f<c.length;f++){var g=c[f];if(e(g)){0===d.length&&this.ya();if(c[f]!==g)throw Error(\"Array modified during remove; cannot remove item\");d.push(g);c.splice(f,1);f--}}d.length&&this.xa();return d},removeAll:function(b){if(b===n){var c=this.v(),d=c.slice(0);this.ya();c.splice(0,c.length);this.xa();return d}return b?this.remove(function(c){return 0<=\na.a.A(b,c)}):[]},destroy:function(b){var c=this.v(),d=\"function\"!=typeof b||a.O(b)?function(a){return a===b}:b;this.ya();for(var e=c.length-1;0<=e;e--){var f=c[e];d(f)&&(f._destroy=!0)}this.xa()},destroyAll:function(b){return b===n?this.destroy(function(){return!0}):b?this.destroy(function(c){return 0<=a.a.A(b,c)}):[]},indexOf:function(b){var c=this();return a.a.A(c,b)},replace:function(a,c){var d=this.indexOf(a);0<=d&&(this.ya(),this.v()[d]=c,this.xa())},sorted:function(a){var c=this().slice(0);\nreturn a?c.sort(a):c.sort()},reversed:function(){return this().slice(0).reverse()}};a.a.Ba&&a.a.setPrototypeOf(a.Ha.fn,a.ta.fn);a.a.D(\"pop push reverse shift sort splice unshift\".split(\" \"),function(b){a.Ha.fn[b]=function(){var a=this.v();this.ya();this.zc(a,b,arguments);var d=a[b].apply(a,arguments);this.xa();return d===a?this:d}});a.a.D([\"slice\"],function(b){a.Ha.fn[b]=function(){var a=this();return a[b].apply(a,arguments)}});a.Pc=function(b){return a.O(b)&&\"function\"==typeof b.remove&&\"function\"==\ntypeof b.push};a.b(\"observableArray\",a.Ha);a.b(\"isObservableArray\",a.Pc);a.Ta.trackArrayChanges=function(b,c){function d(){function c(){if(m){var d=[].concat(b.v()||[]),e;if(b.Wa(\"arrayChange\")){if(!f||1<m)f=a.a.Pb(k,d,b.Ob);e=f}k=d;f=null;m=0;e&&e.length&&b.notifySubscribers(e,\"arrayChange\")}}e?c():(e=!0,h=b.subscribe(function(){++m},null,\"spectate\"),k=[].concat(b.v()||[]),f=null,g=b.subscribe(c))}b.Ob={};c&&\"object\"==typeof c&&a.a.extend(b.Ob,c);b.Ob.sparse=!0;if(!b.zc){var e=!1,f=null,g,h,m=0,\nk,l=b.Qa,p=b.hb;b.Qa=function(a){l&&l.call(b,a);\"arrayChange\"===a&&d()};b.hb=function(a){p&&p.call(b,a);\"arrayChange\"!==a||b.Wa(\"arrayChange\")||(g&&g.s(),h&&h.s(),h=g=null,e=!1,k=n)};b.zc=function(b,c,d){function l(a,b,c){return k[k.length]={status:a,value:b,index:c}}if(e&&!m){var k=[],p=b.length,g=d.length,h=0;switch(c){case \"push\":h=p;case \"unshift\":for(c=0;c<g;c++)l(\"added\",d[c],h+c);break;case \"pop\":h=p-1;case \"shift\":p&&l(\"deleted\",b[h],h);break;case \"splice\":c=Math.min(Math.max(0,0>d[0]?p+d[0]:\nd[0]),p);for(var p=1===g?p:Math.min(c+(d[1]||0),p),g=c+g-2,h=Math.max(p,g),U=[],L=[],n=2;c<h;++c,++n)c<p&&L.push(l(\"deleted\",b[c],c)),c<g&&U.push(l(\"added\",d[n],c));a.a.Kc(L,U);break;default:return}f=k}}}};var r=a.a.Da(\"_state\");a.o=a.$=function(b,c,d){function e(){if(0<arguments.length){if(\"function\"===typeof f)f.apply(g.nb,arguments);else throw Error(\"Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.\");return this}g.ra||\na.u.cc(e);(g.ka||g.J&&e.Xa())&&e.ha();return g.X}\"object\"===typeof b?d=b:(d=d||{},b&&(d.read=b));if(\"function\"!=typeof d.read)throw Error(\"Pass a function that returns the value of the ko.computed\");var f=d.write,g={X:n,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:d.read,nb:c||d.owner,l:d.disposeWhenNodeIsRemoved||d.l||null,Sa:d.disposeWhen||d.Sa,Rb:null,I:{},V:0,Ic:null};e[r]=g;e.Nc=\"function\"===typeof f;a.a.Ba||a.a.extend(e,a.T.fn);a.T.fn.qb(e);a.a.Ab(e,C);d.pure?(g.wb=!0,g.J=!0,a.a.extend(e,da)):\nd.deferEvaluation&&a.a.extend(e,ea);a.options.deferUpdates&&a.Ta.deferred(e,!0);g.l&&(g.jc=!0,g.l.nodeType||(g.l=null));g.J||d.deferEvaluation||e.ha();g.l&&e.ja()&&a.a.K.za(g.l,g.Rb=function(){e.s()});return e};var C={equalityComparer:K,qa:function(){return this[r].V},Va:function(){var b=[];a.a.P(this[r].I,function(a,d){b[d.Ka]=d.da});return b},Vb:function(b){if(!this[r].V)return!1;var c=this.Va();return-1!==a.a.A(c,b)?!0:!!a.a.Lb(c,function(a){return a.Vb&&a.Vb(b)})},uc:function(a,c,d){if(this[r].wb&&\nc===this)throw Error(\"A 'pure' computed must not be called recursively\");this[r].I[a]=d;d.Ka=this[r].V++;d.La=c.ob()},Xa:function(){var a,c,d=this[r].I;for(a in d)if(Object.prototype.hasOwnProperty.call(d,a)&&(c=d[a],this.Ia&&c.da.Ja||c.da.Dd(c.La)))return!0},Jd:function(){this.Ia&&!this[r].rb&&this.Ia(!1)},ja:function(){var a=this[r];return a.ka||0<a.V},Rd:function(){this.Ja?this[r].ka&&(this[r].sa=!0):this.Hc()},$c:function(a){if(a.Hb){var c=a.subscribe(this.Jd,this,\"dirty\"),d=a.subscribe(this.Rd,\nthis);return{da:a,s:function(){c.s();d.s()}}}return a.subscribe(this.Hc,this)},Hc:function(){var b=this,c=b.throttleEvaluation;c&&0<=c?(clearTimeout(this[r].Ic),this[r].Ic=a.a.setTimeout(function(){b.ha(!0)},c)):b.Ia?b.Ia(!0):b.ha(!0)},ha:function(b){var c=this[r],d=c.Sa,e=!1;if(!c.rb&&!c.ra){if(c.l&&!a.a.Sb(c.l)||d&&d()){if(!c.jc){this.s();return}}else c.jc=!1;c.rb=!0;try{e=this.zd(b)}finally{c.rb=!1}return e}},zd:function(b){var c=this[r],d=!1,e=c.wb?n:!c.V,d={qd:this,mb:c.I,Qb:c.V};a.u.xc({pd:d,\nod:ba,o:this,Ya:e});c.I={};c.V=0;var f=this.yd(c,d);c.V?d=this.sb(c.X,f):(this.s(),d=!0);d&&(c.J?this.Gb():this.notifySubscribers(c.X,\"beforeChange\"),c.X=f,this.notifySubscribers(c.X,\"spectate\"),!c.J&&b&&this.notifySubscribers(c.X),this.rc&&this.rc());e&&this.notifySubscribers(c.X,\"awake\");return d},yd:function(b,c){try{var d=b.Wc;return b.nb?d.call(b.nb):d()}finally{a.u.end(),c.Qb&&!b.J&&a.a.P(c.mb,aa),b.sa=b.ka=!1}},v:function(a){var c=this[r];(c.ka&&(a||!c.V)||c.J&&this.Xa())&&this.ha();return c.X},\nub:function(b){a.T.fn.ub.call(this,b);this.nc=function(){this[r].J||(this[r].sa?this.ha():this[r].ka=!1);return this[r].X};this.Ia=function(a){this.pc(this[r].X);this[r].ka=!0;a&&(this[r].sa=!0);this.qc(this,!a)}},s:function(){var b=this[r];!b.J&&b.I&&a.a.P(b.I,function(a,b){b.s&&b.s()});b.l&&b.Rb&&a.a.K.yb(b.l,b.Rb);b.I=n;b.V=0;b.ra=!0;b.sa=!1;b.ka=!1;b.J=!1;b.l=n;b.Sa=n;b.Wc=n;this.Nc||(b.nb=n)}},da={Qa:function(b){var c=this,d=c[r];if(!d.ra&&d.J&&\"change\"==b){d.J=!1;if(d.sa||c.Xa())d.I=null,d.V=\n0,c.ha()&&c.Gb();else{var e=[];a.a.P(d.I,function(a,b){e[b.Ka]=a});a.a.D(e,function(a,b){var e=d.I[a],m=c.$c(e.da);m.Ka=b;m.La=e.La;d.I[a]=m});c.Xa()&&c.ha()&&c.Gb()}d.ra||c.notifySubscribers(d.X,\"awake\")}},hb:function(b){var c=this[r];c.ra||\"change\"!=b||this.Wa(\"change\")||(a.a.P(c.I,function(a,b){b.s&&(c.I[a]={da:b.da,Ka:b.Ka,La:b.La},b.s())}),c.J=!0,this.notifySubscribers(n,\"asleep\"))},ob:function(){var b=this[r];b.J&&(b.sa||this.Xa())&&this.ha();return a.T.fn.ob.call(this)}},ea={Qa:function(a){\"change\"!=\na&&\"beforeChange\"!=a||this.v()}};a.a.Ba&&a.a.setPrototypeOf(C,a.T.fn);var N=a.ta.Ma;C[N]=a.o;a.Oc=function(a){return\"function\"==typeof a&&a[N]===C[N]};a.Fd=function(b){return a.Oc(b)&&b[r]&&b[r].wb};a.b(\"computed\",a.o);a.b(\"dependentObservable\",a.o);a.b(\"isComputed\",a.Oc);a.b(\"isPureComputed\",a.Fd);a.b(\"computed.fn\",C);a.L(C,\"peek\",C.v);a.L(C,\"dispose\",C.s);a.L(C,\"isActive\",C.ja);a.L(C,\"getDependenciesCount\",C.qa);a.L(C,\"getDependencies\",C.Va);a.xb=function(b,c){if(\"function\"===typeof b)return a.o(b,\nc,{pure:!0});b=a.a.extend({},b);b.pure=!0;return a.o(b,c)};a.b(\"pureComputed\",a.xb);(function(){function b(a,f,g){g=g||new d;a=f(a);if(\"object\"!=typeof a||null===a||a===n||a instanceof RegExp||a instanceof Date||a instanceof String||a instanceof Number||a instanceof Boolean)return a;var h=a instanceof Array?[]:{};g.save(a,h);c(a,function(c){var d=f(a[c]);switch(typeof d){case \"boolean\":case \"number\":case \"string\":case \"function\":h[c]=d;break;case \"object\":case \"undefined\":var l=g.get(d);h[c]=l!==\nn?l:b(d,f,g)}});return h}function c(a,b){if(a instanceof Array){for(var c=0;c<a.length;c++)b(c);\"function\"==typeof a.toJSON&&b(\"toJSON\")}else for(c in a)b(c)}function d(){this.keys=[];this.values=[]}a.ad=function(c){if(0==arguments.length)throw Error(\"When calling ko.toJS, pass the object you want to convert.\");return b(c,function(b){for(var c=0;a.O(b)&&10>c;c++)b=b();return b})};a.toJSON=function(b,c,d){b=a.ad(b);return a.a.hc(b,c,d)};d.prototype={constructor:d,save:function(b,c){var d=a.a.A(this.keys,\nb);0<=d?this.values[d]=c:(this.keys.push(b),this.values.push(c))},get:function(b){b=a.a.A(this.keys,b);return 0<=b?this.values[b]:n}}})();a.b(\"toJS\",a.ad);a.b(\"toJSON\",a.toJSON);a.Wd=function(b,c,d){function e(c){var e=a.xb(b,d).extend({ma:\"always\"}),h=e.subscribe(function(a){a&&(h.s(),c(a))});e.notifySubscribers(e.v());return h}return\"function\"!==typeof Promise||c?e(c.bind(d)):new Promise(e)};a.b(\"when\",a.Wd);(function(){a.w={M:function(b){switch(a.a.R(b)){case \"option\":return!0===b.__ko__hasDomDataOptionValue__?\na.a.g.get(b,a.c.options.$b):7>=a.a.W?b.getAttributeNode(\"value\")&&b.getAttributeNode(\"value\").specified?b.value:b.text:b.value;case \"select\":return 0<=b.selectedIndex?a.w.M(b.options[b.selectedIndex]):n;default:return b.value}},cb:function(b,c,d){switch(a.a.R(b)){case \"option\":\"string\"===typeof c?(a.a.g.set(b,a.c.options.$b,n),\"__ko__hasDomDataOptionValue__\"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=c):(a.a.g.set(b,a.c.options.$b,c),b.__ko__hasDomDataOptionValue__=!0,b.value=\"number\"===\ntypeof c?c:\"\");break;case \"select\":if(\"\"===c||null===c)c=n;for(var e=-1,f=0,g=b.options.length,h;f<g;++f)if(h=a.w.M(b.options[f]),h==c||\"\"===h&&c===n){e=f;break}if(d||0<=e||c===n&&1<b.size)b.selectedIndex=e,6===a.a.W&&a.a.setTimeout(function(){b.selectedIndex=e},0);break;default:if(null===c||c===n)c=\"\";b.value=c}}}})();a.b(\"selectExtensions\",a.w);a.b(\"selectExtensions.readValue\",a.w.M);a.b(\"selectExtensions.writeValue\",a.w.cb);a.m=function(){function b(b){b=a.a.Db(b);123===b.charCodeAt(0)&&(b=b.slice(1,\n-1));b+=\"\\n,\";var c=[],d=b.match(e),p,q=[],h=0;if(1<d.length){for(var x=0,B;B=d[x];++x){var u=B.charCodeAt(0);if(44===u){if(0>=h){c.push(p&&q.length?{key:p,value:q.join(\"\")}:{unknown:p||q.join(\"\")});p=h=0;q=[];continue}}else if(58===u){if(!h&&!p&&1===q.length){p=q.pop();continue}}else if(47===u&&1<B.length&&(47===B.charCodeAt(1)||42===B.charCodeAt(1)))continue;else 47===u&&x&&1<B.length?(u=d[x-1].match(f))&&!g[u[0]]&&(b=b.substr(b.indexOf(B)+1),d=b.match(e),x=-1,B=\"/\"):40===u||123===u||91===u?++h:\n41===u||125===u||93===u?--h:p||q.length||34!==u&&39!==u||(B=B.slice(1,-1));q.push(B)}if(0<h)throw Error(\"Unbalanced parentheses, braces, or brackets\");}return c}var c=[\"true\",\"false\",\"null\",\"undefined\"],d=/^(?:[$_a-z][$\\w]*|(.+)(\\.\\s*[$_a-z][$\\w]*|\\[.+\\]))$/i,e=RegExp(\"\\\"(?:\\\\\\\\.|[^\\\"])*\\\"|'(?:\\\\\\\\.|[^'])*'|`(?:\\\\\\\\.|[^`])*`|/\\\\*(?:[^*]|\\\\*+[^*/])*\\\\*+/|//.*\\n|/(?:\\\\\\\\.|[^/])+/w*|[^\\\\s:,/][^,\\\"'`{}()/:[\\\\]]*[^\\\\s,\\\"'`{}()/:[\\\\]]|[^\\\\s]\",\"g\"),f=/[\\])\"'A-Za-z0-9_$]+$/,g={\"in\":1,\"return\":1,\"typeof\":1},\nh={};return{Ra:[],wa:h,ac:b,vb:function(e,f){function l(b,e){var f;if(!x){var k=a.getBindingHandler(b);if(k&&k.preprocess&&!(e=k.preprocess(e,b,l)))return;if(k=h[b])f=e,0<=a.a.A(c,f)?f=!1:(k=f.match(d),f=null===k?!1:k[1]?\"Object(\"+k[1]+\")\"+k[2]:f),k=f;k&&q.push(\"'\"+(\"string\"==typeof h[b]?h[b]:b)+\"':function(_z){\"+f+\"=_z}\")}g&&(e=\"function(){return \"+e+\" }\");p.push(\"'\"+b+\"':\"+e)}f=f||{};var p=[],q=[],g=f.valueAccessors,x=f.bindingParams,B=\"string\"===typeof e?b(e):e;a.a.D(B,function(a){l(a.key||a.unknown,\na.value)});q.length&&l(\"_ko_property_writers\",\"{\"+q.join(\",\")+\" }\");return p.join(\",\")},Id:function(a,b){for(var c=0;c<a.length;c++)if(a[c].key==b)return!0;return!1},eb:function(b,c,d,e,f){if(b&&a.O(b))!a.Za(b)||f&&b.v()===e||b(e);else if((b=c.get(\"_ko_property_writers\"))&&b[d])b[d](e)}}}();a.b(\"expressionRewriting\",a.m);a.b(\"expressionRewriting.bindingRewriteValidators\",a.m.Ra);a.b(\"expressionRewriting.parseObjectLiteral\",a.m.ac);a.b(\"expressionRewriting.preProcessBindings\",a.m.vb);a.b(\"expressionRewriting._twoWayBindings\",\na.m.wa);a.b(\"jsonExpressionRewriting\",a.m);a.b(\"jsonExpressionRewriting.insertPropertyAccessorsIntoJson\",a.m.vb);(function(){function b(a){return 8==a.nodeType&&g.test(f?a.text:a.nodeValue)}function c(a){return 8==a.nodeType&&h.test(f?a.text:a.nodeValue)}function d(d,e){for(var f=d,h=1,g=[];f=f.nextSibling;){if(c(f)&&(a.a.g.set(f,k,!0),h--,0===h))return g;g.push(f);b(f)&&h++}if(!e)throw Error(\"Cannot find closing comment tag to match: \"+d.nodeValue);return null}function e(a,b){var c=d(a,b);return c?\n0<c.length?c[c.length-1].nextSibling:a.nextSibling:null}var f=w&&\"\\x3c!--test--\\x3e\"===w.createComment(\"test\").text,g=f?/^\\x3c!--\\s*ko(?:\\s+([\\s\\S]+))?\\s*--\\x3e$/:/^\\s*ko(?:\\s+([\\s\\S]+))?\\s*$/,h=f?/^\\x3c!--\\s*\\/ko\\s*--\\x3e$/:/^\\s*\\/ko\\s*$/,m={ul:!0,ol:!0},k=\"__ko_matchedEndComment__\";a.h={ea:{},childNodes:function(a){return b(a)?d(a):a.childNodes},Ea:function(c){if(b(c)){c=a.h.childNodes(c);for(var d=0,e=c.length;d<e;d++)a.removeNode(c[d])}else a.a.Tb(c)},va:function(c,d){if(b(c)){a.h.Ea(c);for(var e=\nc.nextSibling,f=0,k=d.length;f<k;f++)e.parentNode.insertBefore(d[f],e)}else a.a.va(c,d)},Vc:function(a,c){var d;b(a)?(d=a.nextSibling,a=a.parentNode):d=a.firstChild;d?c!==d&&a.insertBefore(c,d):a.appendChild(c)},Wb:function(c,d,e){e?(e=e.nextSibling,b(c)&&(c=c.parentNode),e?d!==e&&c.insertBefore(d,e):c.appendChild(d)):a.h.Vc(c,d)},firstChild:function(a){if(b(a))return!a.nextSibling||c(a.nextSibling)?null:a.nextSibling;if(a.firstChild&&c(a.firstChild))throw Error(\"Found invalid end comment, as the first child of \"+\na);return a.firstChild},nextSibling:function(d){b(d)&&(d=e(d));if(d.nextSibling&&c(d.nextSibling)){var f=d.nextSibling;if(c(f)&&!a.a.g.get(f,k))throw Error(\"Found end comment without a matching opening comment, as child of \"+d);return null}return d.nextSibling},Cd:b,Vd:function(a){return(a=(f?a.text:a.nodeValue).match(g))?a[1]:null},Sc:function(d){if(m[a.a.R(d)]){var f=d.firstChild;if(f){do if(1===f.nodeType){var k;k=f.firstChild;var h=null;if(k){do if(h)h.push(k);else if(b(k)){var g=e(k,!0);g?k=\ng:h=[k]}else c(k)&&(h=[k]);while(k=k.nextSibling)}if(k=h)for(h=f.nextSibling,g=0;g<k.length;g++)h?d.insertBefore(k[g],h):d.appendChild(k[g])}while(f=f.nextSibling)}}}}})();a.b(\"virtualElements\",a.h);a.b(\"virtualElements.allowedBindings\",a.h.ea);a.b(\"virtualElements.emptyNode\",a.h.Ea);a.b(\"virtualElements.insertAfter\",a.h.Wb);a.b(\"virtualElements.prepend\",a.h.Vc);a.b(\"virtualElements.setDomNodeChildren\",a.h.va);(function(){a.ga=function(){this.nd={}};a.a.extend(a.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return null!=\nb.getAttribute(\"data-bind\")||a.j.getComponentNameForNode(b);case 8:return a.h.Cd(b);default:return!1}},getBindings:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b):null;return a.j.tc(d,b,c,!1)},getBindingAccessors:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b,{valueAccessors:!0}):null;return a.j.tc(d,b,c,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute(\"data-bind\");case 8:return a.h.Vd(b);default:return null}},\nparseBindingsString:function(b,c,d,e){try{var f=this.nd,g=b+(e&&e.valueAccessors||\"\"),h;if(!(h=f[g])){var m,k=\"with($context){with($data||{}){return{\"+a.m.vb(b,e)+\"}}}\";m=new Function(\"$context\",\"$element\",k);h=f[g]=m}return h(c,d)}catch(l){throw l.message=\"Unable to parse bindings.\\nBindings value: \"+b+\"\\nMessage: \"+l.message,l;}}});a.ga.instance=new a.ga})();a.b(\"bindingProvider\",a.ga);(function(){function b(b){var c=(b=a.a.g.get(b,z))&&b.N;c&&(b.N=null,c.Tc())}function c(c,d,e){this.node=c;this.yc=\nd;this.kb=[];this.H=!1;d.N||a.a.K.za(c,b);e&&e.N&&(e.N.kb.push(c),this.Kb=e)}function d(a){return function(){return a}}function e(a){return a()}function f(b){return a.a.Ga(a.u.G(b),function(a,c){return function(){return b()[c]}})}function g(b,c,e){return\"function\"===typeof b?f(b.bind(null,c,e)):a.a.Ga(b,d)}function h(a,b){return f(this.getBindings.bind(this,a,b))}function m(b,c){var d=a.h.firstChild(c);if(d){var e,f=a.ga.instance,l=f.preprocessNode;if(l){for(;e=d;)d=a.h.nextSibling(e),l.call(f,e);\nd=a.h.firstChild(c)}for(;e=d;)d=a.h.nextSibling(e),k(b,e)}a.i.ma(c,a.i.H)}function k(b,c){var d=b,e=1===c.nodeType;e&&a.h.Sc(c);if(e||a.ga.instance.nodeHasBindings(c))d=p(c,null,b).bindingContextForDescendants;d&&!u[a.a.R(c)]&&m(d,c)}function l(b){var c=[],d={},e=[];a.a.P(b,function ca(f){if(!d[f]){var k=a.getBindingHandler(f);k&&(k.after&&(e.push(f),a.a.D(k.after,function(c){if(b[c]){if(-1!==a.a.A(e,c))throw Error(\"Cannot combine the following bindings, because they have a cyclic dependency: \"+e.join(\", \"));\nca(c)}}),e.length--),c.push({key:f,Mc:k}));d[f]=!0}});return c}function p(b,c,d){var f=a.a.g.Ub(b,z,{}),k=f.hd;if(!c){if(k)throw Error(\"You cannot apply bindings multiple times to the same element.\");f.hd=!0}k||(f.context=d);f.Zb||(f.Zb={});var g;if(c&&\"function\"!==typeof c)g=c;else{var p=a.ga.instance,q=p.getBindingAccessors||h,m=a.$(function(){if(g=c?c(d,b):q.call(p,b,d)){if(d[t])d[t]();if(d[B])d[B]()}return g},null,{l:b});g&&m.ja()||(m=null)}var x=d,u;if(g){var J=function(){return a.a.Ga(m?m():\ng,e)},r=m?function(a){return function(){return e(m()[a])}}:function(a){return g[a]};J.get=function(a){return g[a]&&e(r(a))};J.has=function(a){return a in g};a.i.H in g&&a.i.subscribe(b,a.i.H,function(){var c=(0,g[a.i.H])();if(c){var d=a.h.childNodes(b);d.length&&c(d,a.Ec(d[0]))}});a.i.pa in g&&(x=a.i.Cb(b,d),a.i.subscribe(b,a.i.pa,function(){var c=(0,g[a.i.pa])();c&&a.h.firstChild(b)&&c(b)}));f=l(g);a.a.D(f,function(c){var d=c.Mc.init,e=c.Mc.update,f=c.key;if(8===b.nodeType&&!a.h.ea[f])throw Error(\"The binding '\"+\nf+\"' cannot be used with virtual elements\");try{\"function\"==typeof d&&a.u.G(function(){var a=d(b,r(f),J,x.$data,x);if(a&&a.controlsDescendantBindings){if(u!==n)throw Error(\"Multiple bindings (\"+u+\" and \"+f+\") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.\");u=f}}),\"function\"==typeof e&&a.$(function(){e(b,r(f),J,x.$data,x)},null,{l:b})}catch(k){throw k.message='Unable to process binding \"'+f+\": \"+g[f]+'\"\\nMessage: '+k.message,\nk;}})}f=u===n;return{shouldBindDescendants:f,bindingContextForDescendants:f&&x}}function q(b,c){return b&&b instanceof a.fa?b:new a.fa(b,n,n,c)}var t=a.a.Da(\"_subscribable\"),x=a.a.Da(\"_ancestorBindingInfo\"),B=a.a.Da(\"_dataDependency\");a.c={};var u={script:!0,textarea:!0,template:!0};a.getBindingHandler=function(b){return a.c[b]};var J={};a.fa=function(b,c,d,e,f){function k(){var b=p?h():h,f=a.a.f(b);c?(a.a.extend(l,c),x in c&&(l[x]=c[x])):(l.$parents=[],l.$root=f,l.ko=a);l[t]=q;g?f=l.$data:(l.$rawData=\nb,l.$data=f);d&&(l[d]=f);e&&e(l,c,f);if(c&&c[t]&&!a.S.o().Vb(c[t]))c[t]();m&&(l[B]=m);return l.$data}var l=this,g=b===J,h=g?n:b,p=\"function\"==typeof h&&!a.O(h),q,m=f&&f.dataDependency;f&&f.exportDependencies?k():(q=a.xb(k),q.v(),q.ja()?q.equalityComparer=null:l[t]=n)};a.fa.prototype.createChildContext=function(b,c,d,e){!e&&c&&\"object\"==typeof c&&(e=c,c=e.as,d=e.extend);if(c&&e&&e.noChildContext){var f=\"function\"==typeof b&&!a.O(b);return new a.fa(J,this,null,function(a){d&&d(a);a[c]=f?b():b},e)}return new a.fa(b,\nthis,c,function(a,b){a.$parentContext=b;a.$parent=b.$data;a.$parents=(b.$parents||[]).slice(0);a.$parents.unshift(a.$parent);d&&d(a)},e)};a.fa.prototype.extend=function(b,c){return new a.fa(J,this,null,function(c){a.a.extend(c,\"function\"==typeof b?b(c):b)},c)};var z=a.a.g.Z();c.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)};c.prototype.sd=function(b){a.a.Pa(this.kb,b);!this.kb.length&&this.H&&this.Cc()};c.prototype.Cc=function(){this.H=!0;this.yc.N&&!this.kb.length&&(this.yc.N=\nnull,a.a.K.yb(this.node,b),a.i.ma(this.node,a.i.pa),this.Tc())};a.i={H:\"childrenComplete\",pa:\"descendantsComplete\",subscribe:function(b,c,d,e,f){var k=a.a.g.Ub(b,z,{});k.Fa||(k.Fa=new a.T);f&&f.notifyImmediately&&k.Zb[c]&&a.u.G(d,e,[b]);return k.Fa.subscribe(d,e,c)},ma:function(b,c){var d=a.a.g.get(b,z);if(d&&(d.Zb[c]=!0,d.Fa&&d.Fa.notifySubscribers(b,c),c==a.i.H))if(d.N)d.N.Cc();else if(d.N===n&&d.Fa&&d.Fa.Wa(a.i.pa))throw Error(\"descendantsComplete event not supported for bindings on this node\");\n},Cb:function(b,d){var e=a.a.g.Ub(b,z,{});e.N||(e.N=new c(b,e,d[x]));return d[x]==e?d:d.extend(function(a){a[x]=e})}};a.Td=function(b){return(b=a.a.g.get(b,z))&&b.context};a.ib=function(b,c,d){1===b.nodeType&&a.h.Sc(b);return p(b,c,q(d))};a.ld=function(b,c,d){d=q(d);return a.ib(b,g(c,d,b),d)};a.Oa=function(a,b){1!==b.nodeType&&8!==b.nodeType||m(q(a),b)};a.vc=function(a,b,c){!v&&A.jQuery&&(v=A.jQuery);if(2>arguments.length){if(b=w.body,!b)throw Error(\"ko.applyBindings: could not find document.body; has the document been loaded?\");\n}else if(!b||1!==b.nodeType&&8!==b.nodeType)throw Error(\"ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node\");k(q(a,c),b)};a.Dc=function(b){return!b||1!==b.nodeType&&8!==b.nodeType?n:a.Td(b)};a.Ec=function(b){return(b=a.Dc(b))?b.$data:n};a.b(\"bindingHandlers\",a.c);a.b(\"bindingEvent\",a.i);a.b(\"bindingEvent.subscribe\",a.i.subscribe);a.b(\"bindingEvent.startPossiblyAsyncContentBinding\",a.i.Cb);a.b(\"applyBindings\",a.vc);a.b(\"applyBindingsToDescendants\",a.Oa);\na.b(\"applyBindingAccessorsToNode\",a.ib);a.b(\"applyBindingsToNode\",a.ld);a.b(\"contextFor\",a.Dc);a.b(\"dataFor\",a.Ec)})();(function(b){function c(c,e){var k=Object.prototype.hasOwnProperty.call(f,c)?f[c]:b,l;k?k.subscribe(e):(k=f[c]=new a.T,k.subscribe(e),d(c,function(b,d){var e=!(!d||!d.synchronous);g[c]={definition:b,Gd:e};delete f[c];l||e?k.notifySubscribers(b):a.na.zb(function(){k.notifySubscribers(b)})}),l=!0)}function d(a,b){e(\"getConfig\",[a],function(c){c?e(\"loadComponent\",[a,c],function(a){b(a,\nc)}):b(null,null)})}function e(c,d,f,l){l||(l=a.j.loaders.slice(0));var g=l.shift();if(g){var q=g[c];if(q){var t=!1;if(q.apply(g,d.concat(function(a){t?f(null):null!==a?f(a):e(c,d,f,l)}))!==b&&(t=!0,!g.suppressLoaderExceptions))throw Error(\"Component loaders must supply values by invoking the callback, not by returning values synchronously.\");}else e(c,d,f,l)}else f(null)}var f={},g={};a.j={get:function(d,e){var f=Object.prototype.hasOwnProperty.call(g,d)?g[d]:b;f?f.Gd?a.u.G(function(){e(f.definition)}):\na.na.zb(function(){e(f.definition)}):c(d,e)},Bc:function(a){delete g[a]},oc:e};a.j.loaders=[];a.b(\"components\",a.j);a.b(\"components.get\",a.j.get);a.b(\"components.clearCachedDefinition\",a.j.Bc)})();(function(){function b(b,c,d,e){function g(){0===--B&&e(h)}var h={},B=2,u=d.template;d=d.viewModel;u?f(c,u,function(c){a.j.oc(\"loadTemplate\",[b,c],function(a){h.template=a;g()})}):g();d?f(c,d,function(c){a.j.oc(\"loadViewModel\",[b,c],function(a){h[m]=a;g()})}):g()}function c(a,b,d){if(\"function\"===typeof b)d(function(a){return new b(a)});\nelse if(\"function\"===typeof b[m])d(b[m]);else if(\"instance\"in b){var e=b.instance;d(function(){return e})}else\"viewModel\"in b?c(a,b.viewModel,d):a(\"Unknown viewModel value: \"+b)}function d(b){switch(a.a.R(b)){case \"script\":return a.a.ua(b.text);case \"textarea\":return a.a.ua(b.value);case \"template\":if(e(b.content))return a.a.Ca(b.content.childNodes)}return a.a.Ca(b.childNodes)}function e(a){return A.DocumentFragment?a instanceof DocumentFragment:a&&11===a.nodeType}function f(a,b,c){\"string\"===typeof b.require?\nT||A.require?(T||A.require)([b.require],function(a){a&&\"object\"===typeof a&&a.Xd&&a[\"default\"]&&(a=a[\"default\"]);c(a)}):a(\"Uses require, but no AMD loader is present\"):c(b)}function g(a){return function(b){throw Error(\"Component '\"+a+\"': \"+b);}}var h={};a.j.register=function(b,c){if(!c)throw Error(\"Invalid configuration for \"+b);if(a.j.tb(b))throw Error(\"Component \"+b+\" is already registered\");h[b]=c};a.j.tb=function(a){return Object.prototype.hasOwnProperty.call(h,a)};a.j.unregister=function(b){delete h[b];\na.j.Bc(b)};a.j.Fc={getConfig:function(b,c){c(a.j.tb(b)?h[b]:null)},loadComponent:function(a,c,d){var e=g(a);f(e,c,function(c){b(a,e,c,d)})},loadTemplate:function(b,c,f){b=g(b);if(\"string\"===typeof c)f(a.a.ua(c));else if(c instanceof Array)f(c);else if(e(c))f(a.a.la(c.childNodes));else if(c.element)if(c=c.element,A.HTMLElement?c instanceof HTMLElement:c&&c.tagName&&1===c.nodeType)f(d(c));else if(\"string\"===typeof c){var h=w.getElementById(c);h?f(d(h)):b(\"Cannot find element with ID \"+c)}else b(\"Unknown element type: \"+\nc);else b(\"Unknown template value: \"+c)},loadViewModel:function(a,b,d){c(g(a),b,d)}};var m=\"createViewModel\";a.b(\"components.register\",a.j.register);a.b(\"components.isRegistered\",a.j.tb);a.b(\"components.unregister\",a.j.unregister);a.b(\"components.defaultLoader\",a.j.Fc);a.j.loaders.push(a.j.Fc);a.j.dd=h})();(function(){function b(b,e){var f=b.getAttribute(\"params\");if(f){var f=c.parseBindingsString(f,e,b,{valueAccessors:!0,bindingParams:!0}),f=a.a.Ga(f,function(c){return a.o(c,null,{l:b})}),g=a.a.Ga(f,\nfunction(c){var e=c.v();return c.ja()?a.o({read:function(){return a.a.f(c())},write:a.Za(e)&&function(a){c()(a)},l:b}):e});Object.prototype.hasOwnProperty.call(g,\"$raw\")||(g.$raw=f);return g}return{$raw:{}}}a.j.getComponentNameForNode=function(b){var c=a.a.R(b);if(a.j.tb(c)&&(-1!=c.indexOf(\"-\")||\"[object HTMLUnknownElement]\"==\"\"+b||8>=a.a.W&&b.tagName===c))return c};a.j.tc=function(c,e,f,g){if(1===e.nodeType){var h=a.j.getComponentNameForNode(e);if(h){c=c||{};if(c.component)throw Error('Cannot use the \"component\" binding on a custom element matching a component');\nvar m={name:h,params:b(e,f)};c.component=g?function(){return m}:m}}return c};var c=new a.ga;9>a.a.W&&(a.j.register=function(a){return function(b){return a.apply(this,arguments)}}(a.j.register),w.createDocumentFragment=function(b){return function(){var c=b(),f=a.j.dd,g;for(g in f);return c}}(w.createDocumentFragment))})();(function(){function b(b,c,d){c=c.template;if(!c)throw Error(\"Component '\"+b+\"' has no template\");b=a.a.Ca(c);a.h.va(d,b)}function c(a,b,c){var d=a.createViewModel;return d?d.call(a,\nb,c):b}var d=0;a.c.component={init:function(e,f,g,h,m){function k(){var a=l&&l.dispose;\"function\"===typeof a&&a.call(l);q&&q.s();p=l=q=null}var l,p,q,t=a.a.la(a.h.childNodes(e));a.h.Ea(e);a.a.K.za(e,k);a.o(function(){var g=a.a.f(f()),h,u;\"string\"===typeof g?h=g:(h=a.a.f(g.name),u=a.a.f(g.params));if(!h)throw Error(\"No component name specified\");var n=a.i.Cb(e,m),z=p=++d;a.j.get(h,function(d){if(p===z){k();if(!d)throw Error(\"Unknown component '\"+h+\"'\");b(h,d,e);var f=c(d,u,{element:e,templateNodes:t});\nd=n.createChildContext(f,{extend:function(a){a.$component=f;a.$componentTemplateNodes=t}});f&&f.koDescendantsComplete&&(q=a.i.subscribe(e,a.i.pa,f.koDescendantsComplete,f));l=f;a.Oa(d,e)}})},null,{l:e});return{controlsDescendantBindings:!0}}};a.h.ea.component=!0})();var V={\"class\":\"className\",\"for\":\"htmlFor\"};a.c.attr={update:function(b,c){var d=a.a.f(c())||{};a.a.P(d,function(c,d){d=a.a.f(d);var g=c.indexOf(\":\"),g=\"lookupNamespaceURI\"in b&&0<g&&b.lookupNamespaceURI(c.substr(0,g)),h=!1===d||null===\nd||d===n;h?g?b.removeAttributeNS(g,c):b.removeAttribute(c):d=d.toString();8>=a.a.W&&c in V?(c=V[c],h?b.removeAttribute(c):b[c]=d):h||(g?b.setAttributeNS(g,c,d):b.setAttribute(c,d));\"name\"===c&&a.a.Yc(b,h?\"\":d)})}};(function(){a.c.checked={after:[\"value\",\"attr\"],init:function(b,c,d){function e(){var e=b.checked,f=g();if(!a.S.Ya()&&(e||!m&&!a.S.qa())){var k=a.u.G(c);if(l){var q=p?k.v():k,z=t;t=f;z!==f?e&&(a.a.Na(q,f,!0),a.a.Na(q,z,!1)):a.a.Na(q,f,e);p&&a.Za(k)&&k(q)}else h&&(f===n?f=e:e||(f=n)),a.m.eb(k,\nd,\"checked\",f,!0)}}function f(){var d=a.a.f(c()),e=g();l?(b.checked=0<=a.a.A(d,e),t=e):b.checked=h&&e===n?!!d:g()===d}var g=a.xb(function(){if(d.has(\"checkedValue\"))return a.a.f(d.get(\"checkedValue\"));if(q)return d.has(\"value\")?a.a.f(d.get(\"value\")):b.value}),h=\"checkbox\"==b.type,m=\"radio\"==b.type;if(h||m){var k=c(),l=h&&a.a.f(k)instanceof Array,p=!(l&&k.push&&k.splice),q=m||l,t=l?g():n;m&&!b.name&&a.c.uniqueName.init(b,function(){return!0});a.o(e,null,{l:b});a.a.B(b,\"click\",e);a.o(f,null,{l:b});\nk=n}}};a.m.wa.checked=!0;a.c.checkedValue={update:function(b,c){b.value=a.a.f(c())}}})();a.c[\"class\"]={update:function(b,c){var d=a.a.Db(a.a.f(c()));a.a.Eb(b,b.__ko__cssValue,!1);b.__ko__cssValue=d;a.a.Eb(b,d,!0)}};a.c.css={update:function(b,c){var d=a.a.f(c());null!==d&&\"object\"==typeof d?a.a.P(d,function(c,d){d=a.a.f(d);a.a.Eb(b,c,d)}):a.c[\"class\"].update(b,c)}};a.c.enable={update:function(b,c){var d=a.a.f(c());d&&b.disabled?b.removeAttribute(\"disabled\"):d||b.disabled||(b.disabled=!0)}};a.c.disable=\n{update:function(b,c){a.c.enable.update(b,function(){return!a.a.f(c())})}};a.c.event={init:function(b,c,d,e,f){var g=c()||{};a.a.P(g,function(g){\"string\"==typeof g&&a.a.B(b,g,function(b){var k,l=c()[g];if(l){try{var p=a.a.la(arguments);e=f.$data;p.unshift(e);k=l.apply(e,p)}finally{!0!==k&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}!1===d.get(g+\"Bubble\")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.c.foreach={Rc:function(b){return function(){var c=b(),d=a.a.bc(c);\nif(!d||\"number\"==typeof d.length)return{foreach:c,templateEngine:a.ba.Ma};a.a.f(c);return{foreach:d.data,as:d.as,noChildContext:d.noChildContext,includeDestroyed:d.includeDestroyed,afterAdd:d.afterAdd,beforeRemove:d.beforeRemove,afterRender:d.afterRender,beforeMove:d.beforeMove,afterMove:d.afterMove,templateEngine:a.ba.Ma}}},init:function(b,c){return a.c.template.init(b,a.c.foreach.Rc(c))},update:function(b,c,d,e,f){return a.c.template.update(b,a.c.foreach.Rc(c),d,e,f)}};a.m.Ra.foreach=!1;a.h.ea.foreach=\n!0;a.c.hasfocus={init:function(b,c,d){function e(e){b.__ko_hasfocusUpdating=!0;var f=b.ownerDocument;if(\"activeElement\"in f){var g;try{g=f.activeElement}catch(l){g=f.body}e=g===b}f=c();a.m.eb(f,d,\"hasfocus\",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var f=e.bind(null,!0),g=e.bind(null,!1);a.a.B(b,\"focus\",f);a.a.B(b,\"focusin\",f);a.a.B(b,\"blur\",g);a.a.B(b,\"focusout\",g);b.__ko_hasfocusLastValue=!1},update:function(b,c){var d=!!a.a.f(c());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===\nd||(d?b.focus():b.blur(),!d&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),a.u.G(a.a.Fb,null,[b,d?\"focusin\":\"focusout\"]))}};a.m.wa.hasfocus=!0;a.c.hasFocus=a.c.hasfocus;a.m.wa.hasFocus=\"hasfocus\";a.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.fc(b,c())}};(function(){function b(b,d,e){a.c[b]={init:function(b,c,h,m,k){var l,p,q={},t,x,n;if(d){m=h.get(\"as\");var u=h.get(\"noChildContext\");n=!(m&&u);q={as:m,noChildContext:u,exportDependencies:n}}x=(t=\n\"render\"==h.get(\"completeOn\"))||h.has(a.i.pa);a.o(function(){var h=a.a.f(c()),m=!e!==!h,u=!p,r;if(n||m!==l){x&&(k=a.i.Cb(b,k));if(m){if(!d||n)q.dataDependency=a.S.o();r=d?k.createChildContext(\"function\"==typeof h?h:c,q):a.S.qa()?k.extend(null,q):k}u&&a.S.qa()&&(p=a.a.Ca(a.h.childNodes(b),!0));m?(u||a.h.va(b,a.a.Ca(p)),a.Oa(r,b)):(a.h.Ea(b),t||a.i.ma(b,a.i.H));l=m}},null,{l:b});return{controlsDescendantBindings:!0}}};a.m.Ra[b]=!1;a.h.ea[b]=!0}b(\"if\");b(\"ifnot\",!1,!0);b(\"with\",!0)})();a.c.let={init:function(b,\nc,d,e,f){c=f.extend(c);a.Oa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.let=!0;var Q={};a.c.options={init:function(b){if(\"select\"!==a.a.R(b))throw Error(\"options binding applies only to SELECT elements\");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,c,d){function e(){return a.a.jb(b.options,function(a){return a.selected})}function f(a,b,c){var d=typeof b;return\"function\"==d?b(a):\"string\"==d?a[b]:c}function g(c,d){if(x&&l)a.i.ma(b,a.i.H);else if(t.length){var e=\n0<=a.a.A(t,a.w.M(d[0]));a.a.Zc(d[0],e);x&&!e&&a.u.G(a.a.Fb,null,[b,\"change\"])}}var h=b.multiple,m=0!=b.length&&h?b.scrollTop:null,k=a.a.f(c()),l=d.get(\"valueAllowUnset\")&&d.has(\"value\"),p=d.get(\"optionsIncludeDestroyed\");c={};var q,t=[];l||(h?t=a.a.Mb(e(),a.w.M):0<=b.selectedIndex&&t.push(a.w.M(b.options[b.selectedIndex])));k&&(\"undefined\"==typeof k.length&&(k=[k]),q=a.a.jb(k,function(b){return p||b===n||null===b||!a.a.f(b._destroy)}),d.has(\"optionsCaption\")&&(k=a.a.f(d.get(\"optionsCaption\")),null!==\nk&&k!==n&&q.unshift(Q)));var x=!1;c.beforeRemove=function(a){b.removeChild(a)};k=g;d.has(\"optionsAfterRender\")&&\"function\"==typeof d.get(\"optionsAfterRender\")&&(k=function(b,c){g(0,c);a.u.G(d.get(\"optionsAfterRender\"),null,[c[0],b!==Q?b:n])});a.a.ec(b,q,function(c,e,g){g.length&&(t=!l&&g[0].selected?[a.w.M(g[0])]:[],x=!0);e=b.ownerDocument.createElement(\"option\");c===Q?(a.a.Bb(e,d.get(\"optionsCaption\")),a.w.cb(e,n)):(g=f(c,d.get(\"optionsValue\"),c),a.w.cb(e,a.a.f(g)),c=f(c,d.get(\"optionsText\"),g),\na.a.Bb(e,c));return[e]},c,k);if(!l){var B;h?B=t.length&&e().length<t.length:B=t.length&&0<=b.selectedIndex?a.w.M(b.options[b.selectedIndex])!==t[0]:t.length||0<=b.selectedIndex;B&&a.u.G(a.a.Fb,null,[b,\"change\"])}(l||a.S.Ya())&&a.i.ma(b,a.i.H);a.a.wd(b);m&&20<Math.abs(m-b.scrollTop)&&(b.scrollTop=m)}};a.c.options.$b=a.a.g.Z();a.c.selectedOptions={init:function(b,c,d){function e(){var e=c(),f=[];a.a.D(b.getElementsByTagName(\"option\"),function(b){b.selected&&f.push(a.w.M(b))});a.m.eb(e,d,\"selectedOptions\",\nf)}function f(){var d=a.a.f(c()),e=b.scrollTop;d&&\"number\"==typeof d.length&&a.a.D(b.getElementsByTagName(\"option\"),function(b){var c=0<=a.a.A(d,a.w.M(b));b.selected!=c&&a.a.Zc(b,c)});b.scrollTop=e}if(\"select\"!=a.a.R(b))throw Error(\"selectedOptions binding applies only to SELECT elements\");var g;a.i.subscribe(b,a.i.H,function(){g?e():(a.a.B(b,\"change\",e),g=a.o(f,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}};a.m.wa.selectedOptions=!0;a.c.style={update:function(b,c){var d=a.a.f(c()||\n{});a.a.P(d,function(c,d){d=a.a.f(d);if(null===d||d===n||!1===d)d=\"\";if(v)v(b).css(c,d);else if(/^--/.test(c))b.style.setProperty(c,d);else{c=c.replace(/-(\\w)/g,function(a,b){return b.toUpperCase()});var g=b.style[c];b.style[c]=d;d===g||b.style[c]!=g||isNaN(d)||(b.style[c]=d+\"px\")}})}};a.c.submit={init:function(b,c,d,e,f){if(\"function\"!=typeof c())throw Error(\"The value for a submit binding must be a function\");a.a.B(b,\"submit\",function(a){var d,e=c();try{d=e.call(f.$data,b)}finally{!0!==d&&(a.preventDefault?\na.preventDefault():a.returnValue=!1)}})}};a.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Bb(b,c())}};a.h.ea.text=!0;(function(){if(A&&A.navigator){var b=function(a){if(a)return parseFloat(a[1])},c=A.navigator.userAgent,d,e,f,g,h;(d=A.opera&&A.opera.version&&parseInt(A.opera.version()))||(h=b(c.match(/Edge\\/([^ ]+)$/)))||b(c.match(/Chrome\\/([^ ]+)/))||(e=b(c.match(/Version\\/([^ ]+) Safari/)))||(f=b(c.match(/Firefox\\/([^ ]+)/)))||(g=a.a.W||b(c.match(/MSIE ([^ ]+)/)))||\n(g=b(c.match(/rv:([^ )]+)/)))}if(8<=g&&10>g)var m=a.a.g.Z(),k=a.a.g.Z(),l=function(b){var c=this.activeElement;(c=c&&a.a.g.get(c,k))&&c(b)},p=function(b,c){var d=b.ownerDocument;a.a.g.get(d,m)||(a.a.g.set(d,m,!0),a.a.B(d,\"selectionchange\",l));a.a.g.set(b,k,c)};a.c.textInput={init:function(b,c,k){function l(c,d){a.a.B(b,c,d)}function m(){var d=a.a.f(c());if(null===d||d===n)d=\"\";L!==n&&d===L?a.a.setTimeout(m,4):b.value!==d&&(y=!0,b.value=d,y=!1,v=b.value)}function r(){w||(L=b.value,w=a.a.setTimeout(z,\n4))}function z(){clearTimeout(w);L=w=n;var d=b.value;v!==d&&(v=d,a.m.eb(c(),k,\"textInput\",d))}var v=b.value,w,L,A=9==a.a.W?r:z,y=!1;g&&l(\"keypress\",z);11>g&&l(\"propertychange\",function(a){y||\"value\"!==a.propertyName||A(a)});8==g&&(l(\"keyup\",z),l(\"keydown\",z));p&&(p(b,A),l(\"dragend\",r));(!g||9<=g)&&l(\"input\",A);5>e&&\"textarea\"===a.a.R(b)?(l(\"keydown\",r),l(\"paste\",r),l(\"cut\",r)):11>d?l(\"keydown\",r):4>f?(l(\"DOMAutoComplete\",z),l(\"dragdrop\",z),l(\"drop\",z)):h&&\"number\"===b.type&&l(\"keydown\",r);l(\"change\",\nz);l(\"blur\",z);a.o(m,null,{l:b})}};a.m.wa.textInput=!0;a.c.textinput={preprocess:function(a,b,c){c(\"textInput\",a)}}})();a.c.uniqueName={init:function(b,c){if(c()){var d=\"ko_unique_\"+ ++a.c.uniqueName.rd;a.a.Yc(b,d)}}};a.c.uniqueName.rd=0;a.c.using={init:function(b,c,d,e,f){var g;d.has(\"as\")&&(g={as:d.get(\"as\"),noChildContext:d.get(\"noChildContext\")});c=f.createChildContext(c,g);a.Oa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.using=!0;a.c.value={init:function(b,c,d){var e=a.a.R(b),f=\"input\"==\ne;if(!f||\"checkbox\"!=b.type&&\"radio\"!=b.type){var g=[],h=d.get(\"valueUpdate\"),m=!1,k=null;h&&(\"string\"==typeof h?g=[h]:g=a.a.wc(h),a.a.Pa(g,\"change\"));var l=function(){k=null;m=!1;var e=c(),f=a.w.M(b);a.m.eb(e,d,\"value\",f)};!a.a.W||!f||\"text\"!=b.type||\"off\"==b.autocomplete||b.form&&\"off\"==b.form.autocomplete||-1!=a.a.A(g,\"propertychange\")||(a.a.B(b,\"propertychange\",function(){m=!0}),a.a.B(b,\"focus\",function(){m=!1}),a.a.B(b,\"blur\",function(){m&&l()}));a.a.D(g,function(c){var d=l;a.a.Ud(c,\"after\")&&\n(d=function(){k=a.w.M(b);a.a.setTimeout(l,0)},c=c.substring(5));a.a.B(b,c,d)});var p;p=f&&\"file\"==b.type?function(){var d=a.a.f(c());null===d||d===n||\"\"===d?b.value=\"\":a.u.G(l)}:function(){var f=a.a.f(c()),g=a.w.M(b);if(null!==k&&f===k)a.a.setTimeout(p,0);else if(f!==g||g===n)\"select\"===e?(g=d.get(\"valueAllowUnset\"),a.w.cb(b,f,g),g||f===a.w.M(b)||a.u.G(l)):a.w.cb(b,f)};if(\"select\"===e){var q;a.i.subscribe(b,a.i.H,function(){q?d.get(\"valueAllowUnset\")?p():l():(a.a.B(b,\"change\",l),q=a.o(p,null,{l:b}))},\nnull,{notifyImmediately:!0})}else a.a.B(b,\"change\",l),a.o(p,null,{l:b})}else a.ib(b,{checkedValue:c})},update:function(){}};a.m.wa.value=!0;a.c.visible={update:function(b,c){var d=a.a.f(c()),e=\"none\"!=b.style.display;d&&!e?b.style.display=\"\":!d&&e&&(b.style.display=\"none\")}};a.c.hidden={update:function(b,c){a.c.visible.update(b,function(){return!a.a.f(c())})}};(function(b){a.c[b]={init:function(c,d,e,f,g){return a.c.event.init.call(this,c,function(){var a={};a[b]=d();return a},e,f,g)}}})(\"click\");\na.ca=function(){};a.ca.prototype.renderTemplateSource=function(){throw Error(\"Override renderTemplateSource\");};a.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error(\"Override createJavaScriptEvaluatorBlock\");};a.ca.prototype.makeTemplateSource=function(b,c){if(\"string\"==typeof b){c=c||w;var d=c.getElementById(b);if(!d)throw Error(\"Cannot find template with ID \"+b);return new a.C.F(d)}if(1==b.nodeType||8==b.nodeType)return new a.C.ia(b);throw Error(\"Unknown template type: \"+b);};a.ca.prototype.renderTemplate=\nfunction(a,c,d,e){a=this.makeTemplateSource(a,e);return this.renderTemplateSource(a,c,d,e)};a.ca.prototype.isTemplateRewritten=function(a,c){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,c).data(\"isRewritten\")};a.ca.prototype.rewriteTemplate=function(a,c,d){a=this.makeTemplateSource(a,d);c=c(a.text());a.text(c);a.data(\"isRewritten\",!0)};a.b(\"templateEngine\",a.ca);a.kc=function(){function b(b,c,d,h){b=a.m.ac(b);for(var m=a.m.Ra,k=0;k<b.length;k++){var l=b[k].key;if(Object.prototype.hasOwnProperty.call(m,\nl)){var p=m[l];if(\"function\"===typeof p){if(l=p(b[k].value))throw Error(l);}else if(!p)throw Error(\"This template engine does not support the '\"+l+\"' binding within its templates\");}}d=\"ko.__tr_ambtns(function($context,$element){return(function(){return{ \"+a.m.vb(b,{valueAccessors:!0})+\" } })()},'\"+d.toLowerCase()+\"')\";return h.createJavaScriptEvaluatorBlock(d)+c}var c=/(<([a-z]+\\d*)(?:\\s+(?!data-bind\\s*=\\s*)[a-z0-9\\-]+(?:=(?:\\\"[^\\\"]*\\\"|\\'[^\\']*\\'|[^>]*))?)*\\s+)data-bind\\s*=\\s*([\"'])([\\s\\S]*?)\\3/gi,\nd=/\\x3c!--\\s*ko\\b\\s*([\\s\\S]*?)\\s*--\\x3e/g;return{xd:function(b,c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.kc.Ld(b,c)},d)},Ld:function(a,f){return a.replace(c,function(a,c,d,e,l){return b(l,c,d,f)}).replace(d,function(a,c){return b(c,\"\\x3c!-- ko --\\x3e\",\"#comment\",f)})},md:function(b,c){return a.aa.Xb(function(d,h){var m=d.nextSibling;m&&m.nodeName.toLowerCase()===c&&a.ib(m,b,h)})}}}();a.b(\"__tr_ambtns\",a.kc.md);(function(){a.C={};a.C.F=function(b){if(this.F=b){var c=\na.a.R(b);this.ab=\"script\"===c?1:\"textarea\"===c?2:\"template\"==c&&b.content&&11===b.content.nodeType?3:4}};a.C.F.prototype.text=function(){var b=1===this.ab?\"text\":2===this.ab?\"value\":\"innerHTML\";if(0==arguments.length)return this.F[b];var c=arguments[0];\"innerHTML\"===b?a.a.fc(this.F,c):this.F[b]=c};var b=a.a.g.Z()+\"_\";a.C.F.prototype.data=function(c){if(1===arguments.length)return a.a.g.get(this.F,b+c);a.a.g.set(this.F,b+c,arguments[1])};var c=a.a.g.Z();a.C.F.prototype.nodes=function(){var b=this.F;\nif(0==arguments.length){var e=a.a.g.get(b,c)||{},f=e.lb||(3===this.ab?b.content:4===this.ab?b:n);if(!f||e.jd){var g=this.text();g&&g!==e.bb&&(f=a.a.Md(g,b.ownerDocument),a.a.g.set(b,c,{lb:f,bb:g,jd:!0}))}return f}e=arguments[0];this.ab!==n&&this.text(\"\");a.a.g.set(b,c,{lb:e})};a.C.ia=function(a){this.F=a};a.C.ia.prototype=new a.C.F;a.C.ia.prototype.constructor=a.C.ia;a.C.ia.prototype.text=function(){if(0==arguments.length){var b=a.a.g.get(this.F,c)||{};b.bb===n&&b.lb&&(b.bb=b.lb.innerHTML);return b.bb}a.a.g.set(this.F,\nc,{bb:arguments[0]})};a.b(\"templateSources\",a.C);a.b(\"templateSources.domElement\",a.C.F);a.b(\"templateSources.anonymousTemplate\",a.C.ia)})();(function(){function b(b,c,d){var e;for(c=a.h.nextSibling(c);b&&(e=b)!==c;)b=a.h.nextSibling(e),d(e,b)}function c(c,d){if(c.length){var e=c[0],f=c[c.length-1],g=e.parentNode,h=a.ga.instance,m=h.preprocessNode;if(m){b(e,f,function(a,b){var c=a.previousSibling,d=m.call(h,a);d&&(a===e&&(e=d[0]||b),a===f&&(f=d[d.length-1]||c))});c.length=0;if(!e)return;e===f?c.push(e):\n(c.push(e,f),a.a.Ua(c,g))}b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.vc(d,b)});b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.aa.cd(b,[d])});a.a.Ua(c,g)}}function d(a){return a.nodeType?a:0<a.length?a[0]:null}function e(b,e,f,h,m){m=m||{};var n=(b&&d(b)||f||{}).ownerDocument,B=m.templateEngine||g;a.kc.xd(f,B,n);f=B.renderTemplate(f,h,m,n);if(\"number\"!=typeof f.length||0<f.length&&\"number\"!=typeof f[0].nodeType)throw Error(\"Template engine must return an array of DOM nodes\");n=!1;switch(e){case \"replaceChildren\":a.h.va(b,\nf);n=!0;break;case \"replaceNode\":a.a.Xc(b,f);n=!0;break;case \"ignoreTargetNode\":break;default:throw Error(\"Unknown renderMode: \"+e);}n&&(c(f,h),m.afterRender&&a.u.G(m.afterRender,null,[f,h[m.as||\"$data\"]]),\"replaceChildren\"==e&&a.i.ma(b,a.i.H));return f}function f(b,c,d){return a.O(b)?b():\"function\"===typeof b?b(c,d):b}var g;a.gc=function(b){if(b!=n&&!(b instanceof a.ca))throw Error(\"templateEngine must inherit from ko.templateEngine\");g=b};a.dc=function(b,c,h,m,t){h=h||{};if((h.templateEngine||g)==\nn)throw Error(\"Set a template engine before calling renderTemplate\");t=t||\"replaceChildren\";if(m){var x=d(m);return a.$(function(){var g=c&&c instanceof a.fa?c:new a.fa(c,null,null,null,{exportDependencies:!0}),n=f(b,g.$data,g),g=e(m,t,n,g,h);\"replaceNode\"==t&&(m=g,x=d(m))},null,{Sa:function(){return!x||!a.a.Sb(x)},l:x&&\"replaceNode\"==t?x.parentNode:x})}return a.aa.Xb(function(d){a.dc(b,c,h,d,\"replaceNode\")})};a.Qd=function(b,d,g,h,m){function x(b,c){a.u.G(a.a.ec,null,[h,b,u,g,r,c]);a.i.ma(h,a.i.H)}\nfunction r(a,b){c(b,v);g.afterRender&&g.afterRender(b,a);v=null}function u(a,c){v=m.createChildContext(a,{as:z,noChildContext:g.noChildContext,extend:function(a){a.$index=c;z&&(a[z+\"Index\"]=c)}});var d=f(b,a,v);return e(h,\"ignoreTargetNode\",d,v,g)}var v,z=g.as,w=!1===g.includeDestroyed||a.options.foreachHidesDestroyed&&!g.includeDestroyed;if(w||g.beforeRemove||!a.Pc(d))return a.$(function(){var b=a.a.f(d)||[];\"undefined\"==typeof b.length&&(b=[b]);w&&(b=a.a.jb(b,function(b){return b===n||null===b||\n!a.a.f(b._destroy)}));x(b)},null,{l:h});x(d.v());var A=d.subscribe(function(a){x(d(),a)},null,\"arrayChange\");A.l(h);return A};var h=a.a.g.Z(),m=a.a.g.Z();a.c.template={init:function(b,c){var d=a.a.f(c());if(\"string\"==typeof d||\"name\"in d)a.h.Ea(b);else if(\"nodes\"in d){d=d.nodes||[];if(a.O(d))throw Error('The \"nodes\" option must be a plain, non-observable array.');var e=d[0]&&d[0].parentNode;e&&a.a.g.get(e,m)||(e=a.a.Yb(d),a.a.g.set(e,m,!0));(new a.C.ia(b)).nodes(e)}else if(d=a.h.childNodes(b),0<d.length)e=\na.a.Yb(d),(new a.C.ia(b)).nodes(e);else throw Error(\"Anonymous template defined, but no template content was provided\");return{controlsDescendantBindings:!0}},update:function(b,c,d,e,f){var g=c();c=a.a.f(g);d=!0;e=null;\"string\"==typeof c?c={}:(g=\"name\"in c?c.name:b,\"if\"in c&&(d=a.a.f(c[\"if\"])),d&&\"ifnot\"in c&&(d=!a.a.f(c.ifnot)),d&&!g&&(d=!1));\"foreach\"in c?e=a.Qd(g,d&&c.foreach||[],c,b,f):d?(d=f,\"data\"in c&&(d=f.createChildContext(c.data,{as:c.as,noChildContext:c.noChildContext,exportDependencies:!0})),\ne=a.dc(g,d,c,b)):a.h.Ea(b);f=e;(c=a.a.g.get(b,h))&&\"function\"==typeof c.s&&c.s();a.a.g.set(b,h,!f||f.ja&&!f.ja()?n:f)}};a.m.Ra.template=function(b){b=a.m.ac(b);return 1==b.length&&b[0].unknown||a.m.Id(b,\"name\")?null:\"This template engine does not support anonymous templates nested within its templates\"};a.h.ea.template=!0})();a.b(\"setTemplateEngine\",a.gc);a.b(\"renderTemplate\",a.dc);a.a.Kc=function(a,c,d){if(a.length&&c.length){var e,f,g,h,m;for(e=f=0;(!d||e<d)&&(h=a[f]);++f){for(g=0;m=c[g];++g)if(h.value===\nm.value){h.moved=m.index;m.moved=h.index;c.splice(g,1);e=g=0;break}e+=g}}};a.a.Pb=function(){function b(b,d,e,f,g){var h=Math.min,m=Math.max,k=[],l,p=b.length,q,n=d.length,r=n-p||1,v=p+n+1,u,w,z;for(l=0;l<=p;l++)for(w=u,k.push(u=[]),z=h(n,l+r),q=m(0,l-1);q<=z;q++)u[q]=q?l?b[l-1]===d[q-1]?w[q-1]:h(w[q]||v,u[q-1]||v)+1:q+1:l+1;h=[];m=[];r=[];l=p;for(q=n;l||q;)n=k[l][q]-1,q&&n===k[l][q-1]?m.push(h[h.length]={status:e,value:d[--q],index:q}):l&&n===k[l-1][q]?r.push(h[h.length]={status:f,value:b[--l],index:l}):\n(--q,--l,g.sparse||h.push({status:\"retained\",value:d[q]}));a.a.Kc(r,m,!g.dontLimitMoves&&10*p);return h.reverse()}return function(a,d,e){e=\"boolean\"===typeof e?{dontLimitMoves:e}:e||{};a=a||[];d=d||[];return a.length<d.length?b(a,d,\"added\",\"deleted\",e):b(d,a,\"deleted\",\"added\",e)}}();a.b(\"utils.compareArrays\",a.a.Pb);(function(){function b(b,c,d,h,m){var k=[],l=a.$(function(){var l=c(d,m,a.a.Ua(k,b))||[];0<k.length&&(a.a.Xc(k,l),h&&a.u.G(h,null,[d,l,m]));k.length=0;a.a.Nb(k,l)},null,{l:b,Sa:function(){return!a.a.kd(k)}});\nreturn{Y:k,$:l.ja()?l:n}}var c=a.a.g.Z(),d=a.a.g.Z();a.a.ec=function(e,f,g,h,m,k){function l(b){y={Aa:b,pb:a.ta(w++)};v.push(y);r||F.push(y)}function p(b){y=t[b];w!==y.pb.v()&&D.push(y);y.pb(w++);a.a.Ua(y.Y,e);v.push(y)}function q(b,c){if(b)for(var d=0,e=c.length;d<e;d++)a.a.D(c[d].Y,function(a){b(a,d,c[d].Aa)})}f=f||[];\"undefined\"==typeof f.length&&(f=[f]);h=h||{};var t=a.a.g.get(e,c),r=!t,v=[],u=0,w=0,z=[],A=[],C=[],D=[],F=[],y,I=0;if(r)a.a.D(f,l);else{if(!k||t&&t._countWaitingForRemove){var E=\na.a.Mb(t,function(a){return a.Aa});k=a.a.Pb(E,f,{dontLimitMoves:h.dontLimitMoves,sparse:!0})}for(var E=0,G,H,K;G=k[E];E++)switch(H=G.moved,K=G.index,G.status){case \"deleted\":for(;u<K;)p(u++);H===n&&(y=t[u],y.$&&(y.$.s(),y.$=n),a.a.Ua(y.Y,e).length&&(h.beforeRemove&&(v.push(y),I++,y.Aa===d?y=null:C.push(y)),y&&z.push.apply(z,y.Y)));u++;break;case \"added\":for(;w<K;)p(u++);H!==n?(A.push(v.length),p(H)):l(G.value)}for(;w<f.length;)p(u++);v._countWaitingForRemove=I}a.a.g.set(e,c,v);q(h.beforeMove,D);a.a.D(z,\nh.beforeRemove?a.oa:a.removeNode);var M,O,P;try{P=e.ownerDocument.activeElement}catch(N){}if(A.length)for(;(E=A.shift())!=n;){y=v[E];for(M=n;E;)if((O=v[--E].Y)&&O.length){M=O[O.length-1];break}for(f=0;u=y.Y[f];M=u,f++)a.h.Wb(e,u,M)}for(E=0;y=v[E];E++){y.Y||a.a.extend(y,b(e,g,y.Aa,m,y.pb));for(f=0;u=y.Y[f];M=u,f++)a.h.Wb(e,u,M);!y.Ed&&m&&(m(y.Aa,y.Y,y.pb),y.Ed=!0,M=y.Y[y.Y.length-1])}P&&e.ownerDocument.activeElement!=P&&P.focus();q(h.beforeRemove,C);for(E=0;E<C.length;++E)C[E].Aa=d;q(h.afterMove,D);\nq(h.afterAdd,F)}})();a.b(\"utils.setDomNodeChildrenFromArrayMapping\",a.a.ec);a.ba=function(){this.allowTemplateRewriting=!1};a.ba.prototype=new a.ca;a.ba.prototype.constructor=a.ba;a.ba.prototype.renderTemplateSource=function(b,c,d,e){if(c=(9>a.a.W?0:b.nodes)?b.nodes():null)return a.a.la(c.cloneNode(!0).childNodes);b=b.text();return a.a.ua(b,e)};a.ba.Ma=new a.ba;a.gc(a.ba.Ma);a.b(\"nativeTemplateEngine\",a.ba);(function(){a.$a=function(){var a=this.Hd=function(){if(!v||!v.tmpl)return 0;try{if(0<=v.tmpl.tag.tmpl.open.toString().indexOf(\"__\"))return 2}catch(a){}return 1}();\nthis.renderTemplateSource=function(b,e,f,g){g=g||w;f=f||{};if(2>a)throw Error(\"Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.\");var h=b.data(\"precompiled\");h||(h=b.text()||\"\",h=v.template(null,\"{{ko_with $item.koBindingContext}}\"+h+\"{{/ko_with}}\"),b.data(\"precompiled\",h));b=[e.$data];e=v.extend({koBindingContext:e},f.templateOptions);e=v.tmpl(h,b,e);e.appendTo(g.createElement(\"div\"));v.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return\"{{ko_code ((function() { return \"+\na+\" })()) }}\"};this.addTemplate=function(a,b){w.write(\"<script type='text/html' id='\"+a+\"'>\"+b+\"\\x3c/script>\")};0<a&&(v.tmpl.tag.ko_code={open:\"__.push($1 || '');\"},v.tmpl.tag.ko_with={open:\"with($1) {\",close:\"} \"})};a.$a.prototype=new a.ca;a.$a.prototype.constructor=a.$a;var b=new a.$a;0<b.Hd&&a.gc(b);a.b(\"jqueryTmplTemplateEngine\",a.$a)})()})})();})();\n\n})();\n\n// Avoid polluting the global scope.\nvar knockout = ko;\nif (typeof window !== 'undefined') {\n    ko = window.ko;\n    if (typeof oldValue !== 'undefined') {\n        window.ko = oldValue;\n    } else {\n        delete window.ko;\n    }\n} else {\n    ko = global.ko;\n    if (typeof oldValue !== 'undefined') {\n        global.ko = oldValue;\n    } else {\n        delete global.ko;\n    }\n}\n\nexport default knockout;\n", "/**\n * @license\n * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5\n * Copyright (c) Steve Sanderson\n * MIT license\n */\n\n    var OBSERVABLES_PROPERTY = '__knockoutObservables';\n    var SUBSCRIBABLE_PROPERTY = '__knockoutSubscribable';\n\n    // Model tracking\n    // --------------\n    //\n    // This is the central feature of Knockout-ES5. We augment model objects by converting properties\n    // into ES5 getter/setter pairs that read/write an underlying Knockout observable. This means you can\n    // use plain JavaScript syntax to read/write the property while still getting the full benefits of\n    // Knockout's automatic dependency detection and notification triggering.\n    //\n    // For comparison, here's Knockout ES3-compatible syntax:\n    //\n    //     var firstNameLength = myModel.user().firstName().length; // Read\n    //     myModel.user().firstName('Bert'); // Write\n    //\n    // ... versus Knockout-ES5 syntax:\n    //\n    //     var firstNameLength = myModel.user.firstName.length; // Read\n    //     myModel.user.firstName = 'Bert'; // Write\n\n    // `ko.track(model)` converts each property on the given model object into a getter/setter pair that\n    // wraps a Knockout observable. Optionally specify an array of property names to wrap; otherwise we\n    // wrap all properties. If any of the properties are already observables, we replace them with\n    // ES5 getter/setter pairs that wrap your original observable instances. In the case of readonly\n    // ko.computed properties, we simply do not define a setter (so attempted writes will be ignored,\n    // which is how ES5 readonly properties normally behave).\n    //\n    // By design, this does *not* recursively walk child object properties, because making literally\n    // everything everywhere independently observable is usually unhelpful. When you do want to track\n    // child object properties independently, define your own class for those child objects and put\n    // a separate ko.track call into its constructor --- this gives you far more control.\n    function track(obj, propertyNames) {\n        if (!obj /*|| typeof obj !== 'object'*/) {\n            throw new Error('When calling ko.track, you must pass an object as the first parameter.');\n        }\n\n        var ko = this,\n            allObservablesForObject = getAllObservablesForObject(obj, true);\n        propertyNames = propertyNames || Object.getOwnPropertyNames(obj);\n\n        propertyNames.forEach(function(propertyName) {\n            // Skip storage properties\n            if (propertyName === OBSERVABLES_PROPERTY || propertyName === SUBSCRIBABLE_PROPERTY) {\n                return;\n            }\n            // Skip properties that are already tracked\n            if (propertyName in allObservablesForObject) {\n                return;\n            }\n\n            var origValue = obj[propertyName],\n                isArray = origValue instanceof Array,\n                observable = ko.isObservable(origValue) ? origValue\n                                              : isArray ? ko.observableArray(origValue)\n                                                        : ko.observable(origValue);\n\n            Object.defineProperty(obj, propertyName, {\n                configurable: true,\n                enumerable: true,\n                get: observable,\n                set: ko.isWriteableObservable(observable) ? observable : undefined\n            });\n\n            allObservablesForObject[propertyName] = observable;\n\n            if (isArray) {\n                notifyWhenPresentOrFutureArrayValuesMutate(ko, observable);\n            }\n        });\n\n        return obj;\n    }\n\n    // Gets or creates the hidden internal key-value collection of observables corresponding to\n    // properties on the model object.\n    function getAllObservablesForObject(obj, createIfNotDefined) {\n        var result = obj[OBSERVABLES_PROPERTY];\n        if (!result && createIfNotDefined) {\n            result = {};\n            Object.defineProperty(obj, OBSERVABLES_PROPERTY, {\n                value : result\n            });\n        }\n        return result;\n    }\n\n    // Computed properties\n    // -------------------\n    //\n    // The preceding code is already sufficient to upgrade ko.computed model properties to ES5\n    // getter/setter pairs (or in the case of readonly ko.computed properties, just a getter).\n    // These then behave like a regular property with a getter function, except they are smarter:\n    // your evaluator is only invoked when one of its dependencies changes. The result is cached\n    // and used for all evaluations until the next time a dependency changes).\n    //\n    // However, instead of forcing developers to declare a ko.computed property explicitly, it's\n    // nice to offer a utility function that declares a computed getter directly.\n\n    // Implements `ko.defineProperty`\n    function defineComputedProperty(obj, propertyName, evaluatorOrOptions) {\n        var ko = this,\n            computedOptions = { owner: obj, deferEvaluation: true };\n\n        if (typeof evaluatorOrOptions === 'function') {\n            computedOptions.read = evaluatorOrOptions;\n        } else {\n            if ('value' in evaluatorOrOptions) {\n                throw new Error('For ko.defineProperty, you must not specify a \"value\" for the property. You must provide a \"get\" function.');\n            }\n\n            if (typeof evaluatorOrOptions.get !== 'function') {\n                throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called \"get\".');\n            }\n\n            computedOptions.read = evaluatorOrOptions.get;\n            computedOptions.write = evaluatorOrOptions.set;\n        }\n\n        obj[propertyName] = ko.computed(computedOptions);\n        track.call(ko, obj, [propertyName]);\n        return obj;\n    }\n\n    // Array handling\n    // --------------\n    //\n    // Arrays are special, because unlike other property types, they have standard mutator functions\n    // (`push`/`pop`/`splice`/etc.) and it's desirable to trigger a change notification whenever one of\n    // those mutator functions is invoked.\n    //\n    // Traditionally, Knockout handles this by putting special versions of `push`/`pop`/etc. on observable\n    // arrays that mutate the underlying array and then trigger a notification. That approach doesn't\n    // work for Knockout-ES5 because properties now return the underlying arrays, so the mutator runs\n    // in the context of the underlying array, not any particular observable:\n    //\n    //     // Operates on the underlying array value\n    //     myModel.someCollection.push('New value');\n    //\n    // To solve this, Knockout-ES5 detects array values, and modifies them as follows:\n    //  1. Associates a hidden subscribable with each array instance that it encounters\n    //  2. Intercepts standard mutators (`push`/`pop`/etc.) and makes them trigger the subscribable\n    // Then, for model properties whose values are arrays, the property's underlying observable\n    // subscribes to the array subscribable, so it can trigger a change notification after mutation.\n\n    // Given an observable that underlies a model property, watch for any array value that might\n    // be assigned as the property value, and hook into its change events\n    function notifyWhenPresentOrFutureArrayValuesMutate(ko, observable) {\n        var watchingArraySubscription = null;\n        ko.computed(function () {\n            // Unsubscribe to any earlier array instance\n            if (watchingArraySubscription) {\n                watchingArraySubscription.dispose();\n                watchingArraySubscription = null;\n            }\n\n            // Subscribe to the new array instance\n            var newArrayInstance = observable();\n            if (newArrayInstance instanceof Array) {\n                watchingArraySubscription = startWatchingArrayInstance(ko, observable, newArrayInstance);\n            }\n        });\n    }\n\n    // Listens for array mutations, and when they happen, cause the observable to fire notifications.\n    // This is used to make model properties of type array fire notifications when the array changes.\n    // Returns a subscribable that can later be disposed.\n    function startWatchingArrayInstance(ko, observable, arrayInstance) {\n        var subscribable = getSubscribableForArray(ko, arrayInstance);\n        return subscribable.subscribe(observable);\n    }\n\n    // Gets or creates a subscribable that fires after each array mutation\n    function getSubscribableForArray(ko, arrayInstance) {\n        var subscribable = arrayInstance[SUBSCRIBABLE_PROPERTY];\n        if (!subscribable) {\n            subscribable = new ko.subscribable();\n            Object.defineProperty(arrayInstance, SUBSCRIBABLE_PROPERTY, {\n                value : subscribable\n            });\n\n            var notificationPauseSignal = {};\n            wrapStandardArrayMutators(arrayInstance, subscribable, notificationPauseSignal);\n            addKnockoutArrayMutators(ko, arrayInstance, subscribable, notificationPauseSignal);\n        }\n\n        return subscribable;\n    }\n\n    // After each array mutation, fires a notification on the given subscribable\n    function wrapStandardArrayMutators(arrayInstance, subscribable, notificationPauseSignal) {\n        ['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'].forEach(function(fnName) {\n            var origMutator = arrayInstance[fnName];\n            arrayInstance[fnName] = function() {\n                var result = origMutator.apply(this, arguments);\n                if (notificationPauseSignal.pause !== true) {\n                    subscribable.notifySubscribers(this);\n                }\n                return result;\n            };\n        });\n    }\n\n    // Adds Knockout's additional array mutation functions to the array\n    function addKnockoutArrayMutators(ko, arrayInstance, subscribable, notificationPauseSignal) {\n        ['remove', 'removeAll', 'destroy', 'destroyAll', 'replace'].forEach(function(fnName) {\n            // Make it a non-enumerable property for consistency with standard Array functions\n            Object.defineProperty(arrayInstance, fnName, {\n                enumerable: false,\n                value: function() {\n                    var result;\n\n                    // These additional array mutators are built using the underlying push/pop/etc.\n                    // mutators, which are wrapped to trigger notifications. But we don't want to\n                    // trigger multiple notifications, so pause the push/pop/etc. wrappers and\n                    // delivery only one notification at the end of the process.\n                    notificationPauseSignal.pause = true;\n                    try {\n                        // Creates a temporary observableArray that can perform the operation.\n                        result = ko.observableArray.fn[fnName].apply(ko.observableArray(arrayInstance), arguments);\n                    }\n                    finally {\n                        notificationPauseSignal.pause = false;\n                    }\n                    subscribable.notifySubscribers(arrayInstance);\n                    return result;\n                }\n            });\n        });\n    }\n\n    // Static utility functions\n    // ------------------------\n    //\n    // Since Knockout-ES5 sets up properties that return values, not observables, you can't\n    // trivially subscribe to the underlying observables (e.g., `someProperty.subscribe(...)`),\n    // or tell them that object values have mutated, etc. To handle this, we set up some\n    // extra utility functions that can return or work with the underlying observables.\n\n    // Returns the underlying observable associated with a model property (or `null` if the\n    // model or property doesn't exist, or isn't associated with an observable). This means\n    // you can subscribe to the property, e.g.:\n    //\n    //     ko.getObservable(model, 'propertyName')\n    //       .subscribe(function(newValue) { ... });\n    function getObservable(obj, propertyName) {\n        if (!obj /*|| typeof obj !== 'object'*/) {\n            return null;\n        }\n\n        var allObservablesForObject = getAllObservablesForObject(obj, false);\n        return (allObservablesForObject && allObservablesForObject[propertyName]) || null;\n    }\n\n    // Causes a property's associated observable to fire a change notification. Useful when\n    // the property value is a complex object and you've modified a child property.\n    function valueHasMutated(obj, propertyName) {\n        var observable = getObservable(obj, propertyName);\n\n        if (observable) {\n            observable.valueHasMutated();\n        }\n    }\n\n    // Extends a Knockout instance with Knockout-ES5 functionality\n    function attachToKo(ko) {\n        ko.track = track;\n        ko.getObservable = getObservable;\n        ko.valueHasMutated = valueHasMutated;\n        ko.defineProperty = defineComputedProperty;\n    }\n\n    export default {\n        attachToKo : attachToKo\n    };\n", "const svgNS = \"http://www.w3.org/2000/svg\";\nconst svgClassName = \"cesium-svgPath-svg\";\n\n/**\n * A Knockout binding handler that creates a DOM element for a single SVG path.\n * This binding handler will be registered as cesiumSvgPath.\n *\n * <p>\n * The parameter to this binding is an object with the following properties:\n * </p>\n *\n * <ul>\n * <li>path: The SVG path as a string.</li>\n * <li>width: The width of the SVG path with no transformations applied.</li>\n * <li>height: The height of the SVG path with no transformations applied.</li>\n * <li>css: Optional. A string containing additional CSS classes to apply to the SVG. 'cesium-svgPath-svg' is always applied.</li>\n * </ul>\n *\n * @namespace SvgPathBindingHandler\n *\n * @example\n * // Create an SVG as a child of a div\n * <div data-bind=\"cesiumSvgPath: { path: 'M 100 100 L 300 100 L 200 300 z', width: 28, height: 28 }\"></div>\n *\n * // parameters can be observable from the view model\n * <div data-bind=\"cesiumSvgPath: { path: currentPath, width: currentWidth, height: currentHeight }\"></div>\n *\n * // or the whole object can be observable from the view model\n * <div data-bind=\"cesiumSvgPath: svgPathOptions\"></div>\n */\nconst SvgPathBindingHandler = {\n  /**\n   * @function\n   */\n  register: function (knockout) {\n    knockout.bindingHandlers.cesiumSvgPath = {\n      init: function (element, valueAccessor) {\n        const svg = document.createElementNS(svgNS, \"svg:svg\");\n        svg.setAttribute(\"class\", svgClassName);\n\n        const pathElement = document.createElementNS(svgNS, \"path\");\n        svg.appendChild(pathElement);\n\n        knockout.virtualElements.setDomNodeChildren(element, [svg]);\n\n        knockout.computed({\n          read: function () {\n            const value = knockout.unwrap(valueAccessor());\n\n            pathElement.setAttribute(\"d\", knockout.unwrap(value.path));\n\n            const pathWidth = knockout.unwrap(value.width);\n            const pathHeight = knockout.unwrap(value.height);\n\n            svg.setAttribute(\"width\", pathWidth);\n            svg.setAttribute(\"height\", pathHeight);\n            svg.setAttribute(\"viewBox\", `0 0 ${pathWidth} ${pathHeight}`);\n\n            if (value.css) {\n              svg.setAttribute(\n                \"class\",\n                `${svgClassName} ${knockout.unwrap(value.css)}`\n              );\n            }\n          },\n          disposeWhenNodeIsRemoved: element,\n        });\n\n        return {\n          controlsDescendantBindings: true,\n        };\n      },\n    };\n\n    knockout.virtualElements.allowedBindings.cesiumSvgPath = true;\n  },\n};\nexport default SvgPathBindingHandler;\n", "import knockout from './knockout-3.5.1.js';\nimport knockout_es5 from './knockout-es5.js';\nimport SvgPathBindingHandler from '../SvgPathBindingHandler.js';\n\n// install the Knockout-ES5 plugin\nknockout_es5.attachToKo(knockout);\n\n// Register all Cesium binding handlers\nSvgPathBindingHandler.register(knockout);\n\nexport default knockout;\n", "import {\n  Clock,\n  defined,\n  destroyObject,\n  EventHelper,\n  JulianDate,\n} from \"@cesium/engine\";\nimport knockout from \"./ThirdParty/knockout.js\";\n\n/**\n * A view model which exposes a {@link Clock} for user interfaces.\n * @alias ClockViewModel\n * @constructor\n *\n * @param {Clock} [clock] The clock object wrapped by this view model, if undefined a new instance will be created.\n *\n * @see Clock\n */\nfunction ClockViewModel(clock) {\n  if (!defined(clock)) {\n    clock = new Clock();\n  }\n  this._clock = clock;\n\n  this._eventHelper = new EventHelper();\n  this._eventHelper.add(clock.onTick, this.synchronize, this);\n\n  /**\n   * Gets the current system time.\n   * This property is observable.\n   * @type {JulianDate}\n   */\n  this.systemTime = knockout.observable(JulianDate.now());\n  this.systemTime.equalityComparer = JulianDate.equals;\n\n  /**\n   * Gets or sets the start time of the clock.\n   * See {@link Clock#startTime}.\n   * This property is observable.\n   * @type {JulianDate}\n   */\n  this.startTime = knockout.observable(clock.startTime);\n  this.startTime.equalityComparer = JulianDate.equals;\n  this.startTime.subscribe(function (value) {\n    clock.startTime = value;\n    this.synchronize();\n  }, this);\n\n  /**\n   * Gets or sets the stop time of the clock.\n   * See {@link Clock#stopTime}.\n   * This property is observable.\n   * @type {JulianDate}\n   */\n  this.stopTime = knockout.observable(clock.stopTime);\n  this.stopTime.equalityComparer = JulianDate.equals;\n  this.stopTime.subscribe(function (value) {\n    clock.stopTime = value;\n    this.synchronize();\n  }, this);\n\n  /**\n   * Gets or sets the current time.\n   * See {@link Clock#currentTime}.\n   * This property is observable.\n   * @type {JulianDate}\n   */\n  this.currentTime = knockout.observable(clock.currentTime);\n  this.currentTime.equalityComparer = JulianDate.equals;\n  this.currentTime.subscribe(function (value) {\n    clock.currentTime = value;\n    this.synchronize();\n  }, this);\n\n  /**\n   * Gets or sets the clock multiplier.\n   * See {@link Clock#multiplier}.\n   * This property is observable.\n   * @type {number}\n   */\n  this.multiplier = knockout.observable(clock.multiplier);\n  this.multiplier.subscribe(function (value) {\n    clock.multiplier = value;\n    this.synchronize();\n  }, this);\n\n  /**\n   * Gets or sets the clock step setting.\n   * See {@link Clock#clockStep}.\n   * This property is observable.\n   * @type {ClockStep}\n   */\n  this.clockStep = knockout.observable(clock.clockStep);\n  this.clockStep.subscribe(function (value) {\n    clock.clockStep = value;\n    this.synchronize();\n  }, this);\n\n  /**\n   * Gets or sets the clock range setting.\n   * See {@link Clock#clockRange}.\n   * This property is observable.\n   * @type {ClockRange}\n   */\n  this.clockRange = knockout.observable(clock.clockRange);\n  this.clockRange.subscribe(function (value) {\n    clock.clockRange = value;\n    this.synchronize();\n  }, this);\n\n  /**\n   * Gets or sets whether the clock can animate.\n   * See {@link Clock#canAnimate}.\n   * This property is observable.\n   * @type {boolean}\n   */\n  this.canAnimate = knockout.observable(clock.canAnimate);\n  this.canAnimate.subscribe(function (value) {\n    clock.canAnimate = value;\n    this.synchronize();\n  }, this);\n\n  /**\n   * Gets or sets whether the clock should animate.\n   * See {@link Clock#shouldAnimate}.\n   * This property is observable.\n   * @type {boolean}\n   */\n  this.shouldAnimate = knockout.observable(clock.shouldAnimate);\n  this.shouldAnimate.subscribe(function (value) {\n    clock.shouldAnimate = value;\n    this.synchronize();\n  }, this);\n\n  knockout.track(this, [\n    \"systemTime\",\n    \"startTime\",\n    \"stopTime\",\n    \"currentTime\",\n    \"multiplier\",\n    \"clockStep\",\n    \"clockRange\",\n    \"canAnimate\",\n    \"shouldAnimate\",\n  ]);\n}\n\nObject.defineProperties(ClockViewModel.prototype, {\n  /**\n   * Gets the underlying Clock.\n   * @memberof ClockViewModel.prototype\n   * @type {Clock}\n   */\n  clock: {\n    get: function () {\n      return this._clock;\n    },\n  },\n});\n\n/**\n * Updates the view model with the contents of the underlying clock.\n * Can be called to force an update of the viewModel if the underlying\n * clock has changed and <code>Clock.tick</code> has not yet been called.\n */\nClockViewModel.prototype.synchronize = function () {\n  const clock = this._clock;\n\n  this.systemTime = JulianDate.now();\n  this.startTime = clock.startTime;\n  this.stopTime = clock.stopTime;\n  this.currentTime = clock.currentTime;\n  this.multiplier = clock.multiplier;\n  this.clockStep = clock.clockStep;\n  this.clockRange = clock.clockRange;\n  this.canAnimate = clock.canAnimate;\n  this.shouldAnimate = clock.shouldAnimate;\n};\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nClockViewModel.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the view model.  Should be called to\n * properly clean up the view model when it is no longer needed.\n */\nClockViewModel.prototype.destroy = function () {\n  this._eventHelper.removeAll();\n\n  destroyObject(this);\n};\nexport default ClockViewModel;\n", "import { DeveloperError } from \"@cesium/engine\";\n\n/**\n * A Command is a function with an extra <code>canExecute</code> observable property to determine\n * whether the command can be executed.  When executed, a Command function will check the\n * value of <code>canExecute</code> and throw if false.\n *\n * This type describes an interface and is not intended to be instantiated directly.\n * See {@link createCommand} to create a command from a function.\n *\n * @alias Command\n * @constructor\n */\nfunction Command() {\n  /**\n   * Gets whether this command can currently be executed.  This property is observable.\n   * @type {boolean}\n   * @default undefined\n   */\n  this.canExecute = undefined;\n\n  /**\n   * Gets an event which is raised before the command executes, the event\n   * is raised with an object containing two properties: a <code>cancel</code> property,\n   * which if set to false by the listener will prevent the command from being executed, and\n   * an <code>args</code> property, which is the array of arguments being passed to the command.\n   * @type {Event}\n   * @default undefined\n   */\n  this.beforeExecute = undefined;\n\n  /**\n   * Gets an event which is raised after the command executes, the event\n   * is raised with the return value of the command as its only parameter.\n   * @type {Event}\n   * @default undefined\n   */\n  this.afterExecute = undefined;\n\n  DeveloperError.throwInstantiationError();\n}\nexport default Command;\n", "import { Check, defaultValue, defined } from \"@cesium/engine\";\n\n/**\n * A static class with helper functions used by CesiumInspector, Cesium3DTilesInspector, and VoxelInspector\n * @private\n */\nconst InspectorShared = {};\n\n/**\n * Creates a checkbox component\n * @param {string} labelText The text to display in the checkbox label\n * @param {string} checkedBinding The name of the variable used for checked binding\n * @param {string} [enableBinding] The name of the variable used for enable binding\n * @return {Element}\n */\nInspectorShared.createCheckbox = function (\n  labelText,\n  checkedBinding,\n  enableBinding\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"labelText\", labelText);\n  Check.typeOf.string(\"checkedBinding\", checkedBinding);\n  //>>includeEnd('debug');\n  const checkboxContainer = document.createElement(\"div\");\n  const checkboxLabel = document.createElement(\"label\");\n  const checkboxInput = document.createElement(\"input\");\n  checkboxInput.type = \"checkbox\";\n\n  let binding = `checked: ${checkedBinding}`;\n  if (defined(enableBinding)) {\n    binding += `, enable: ${enableBinding}`;\n  }\n  checkboxInput.setAttribute(\"data-bind\", binding);\n  checkboxLabel.appendChild(checkboxInput);\n  checkboxLabel.appendChild(document.createTextNode(labelText));\n  checkboxContainer.appendChild(checkboxLabel);\n  return checkboxContainer;\n};\n\n/**\n * Creates a section element\n * @param {Element} panel The parent element\n * @param {string} headerText The text to display at the top of the section\n * @param {string} sectionVisibleBinding The name of the variable used for visible binding\n * @param {string} toggleSectionVisibilityBinding The name of the function used to toggle visibility\n * @return {Element}\n */\nInspectorShared.createSection = function (\n  panel,\n  headerText,\n  sectionVisibleBinding,\n  toggleSectionVisibilityBinding\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"panel\", panel);\n  Check.typeOf.string(\"headerText\", headerText);\n  Check.typeOf.string(\"sectionVisibleBinding\", sectionVisibleBinding);\n  Check.typeOf.string(\n    \"toggleSectionVisibilityBinding\",\n    toggleSectionVisibilityBinding\n  );\n  //>>includeEnd('debug');\n  const section = document.createElement(\"div\");\n  section.className = \"cesium-cesiumInspector-section\";\n  section.setAttribute(\n    \"data-bind\",\n    `css: { \"cesium-cesiumInspector-section-collapsed\": !${sectionVisibleBinding} }`\n  );\n  panel.appendChild(section);\n\n  const sectionHeader = document.createElement(\"h3\");\n  sectionHeader.className = \"cesium-cesiumInspector-sectionHeader\";\n  sectionHeader.appendChild(document.createTextNode(headerText));\n  sectionHeader.setAttribute(\n    \"data-bind\",\n    `click: ${toggleSectionVisibilityBinding}`\n  );\n  section.appendChild(sectionHeader);\n\n  const sectionContent = document.createElement(\"div\");\n  sectionContent.className = \"cesium-cesiumInspector-sectionContent\";\n  section.appendChild(sectionContent);\n  return sectionContent;\n};\n\n/**\n * Creates a range input\n * @param {string} rangeText The text to display\n * @param {string} sliderValueBinding The name of the variable used for slider value binding\n * @param {number} min The minimum value\n * @param {number} max The maximum value\n * @param {number} [step] The step size. Defaults to \"any\".\n * @param {string} [inputValueBinding] The name of the variable used for input value binding\n * @return {Element}\n */\nInspectorShared.createRangeInput = function (\n  rangeText,\n  sliderValueBinding,\n  min,\n  max,\n  step,\n  inputValueBinding\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"rangeText\", rangeText);\n  Check.typeOf.string(\"sliderValueBinding\", sliderValueBinding);\n  Check.typeOf.number(\"min\", min);\n  Check.typeOf.number(\"max\", max);\n  //>>includeEnd('debug');\n\n  inputValueBinding = defaultValue(inputValueBinding, sliderValueBinding);\n  const input = document.createElement(\"input\");\n  input.setAttribute(\"data-bind\", `value: ${inputValueBinding}`);\n  input.type = \"number\";\n\n  const slider = document.createElement(\"input\");\n  slider.type = \"range\";\n  slider.min = min;\n  slider.max = max;\n  slider.step = defaultValue(step, \"any\");\n  slider.setAttribute(\n    \"data-bind\",\n    `valueUpdate: \"input\", value: ${sliderValueBinding}`\n  );\n\n  const wrapper = document.createElement(\"div\");\n  wrapper.appendChild(slider);\n\n  const container = document.createElement(\"div\");\n  container.className = \"cesium-cesiumInspector-slider\";\n  container.appendChild(document.createTextNode(rangeText));\n  container.appendChild(input);\n  container.appendChild(wrapper);\n\n  return container;\n};\n\n/**\n * Creates a button component\n * @param {string} buttonText The button text\n * @param {string} clickedBinding The name of the variable used for clicked binding\n * @param {string} [activeBinding] The name of the variable used for active binding\n * @return {Element}\n */\nInspectorShared.createButton = function (\n  buttonText,\n  clickedBinding,\n  activeBinding\n) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.string(\"buttonText\", buttonText);\n  Check.typeOf.string(\"clickedBinding\", clickedBinding);\n  //>>includeEnd('debug');\n\n  const button = document.createElement(\"button\");\n  button.type = \"button\";\n  button.textContent = buttonText;\n  button.className = \"cesium-cesiumInspector-pickButton\";\n  let binding = `click: ${clickedBinding}`;\n  if (defined(activeBinding)) {\n    binding += `, css: {\"cesium-cesiumInspector-pickButtonHighlight\" : ${activeBinding}}`;\n  }\n  button.setAttribute(\"data-bind\", binding);\n\n  return button;\n};\n\nexport default InspectorShared;\n", "import { defaultValue, defined, DeveloperError } from \"@cesium/engine\";\nimport knockout from \"./ThirdParty/knockout.js\";\n\n/**\n * A view model which exposes the properties of a toggle button.\n * @alias ToggleButtonViewModel\n * @constructor\n *\n * @param {Command} command The command which will be executed when the button is toggled.\n * @param {object} [options] Object with the following properties:\n * @param {boolean} [options.toggled=false] A boolean indicating whether the button should be initially toggled.\n * @param {string} [options.tooltip=''] A string containing the button's tooltip.\n */\nfunction ToggleButtonViewModel(command, options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(command)) {\n    throw new DeveloperError(\"command is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._command = command;\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  /**\n   * Gets or sets whether the button is currently toggled.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.toggled = defaultValue(options.toggled, false);\n\n  /**\n   * Gets or sets the button's tooltip.  This property is observable.\n   * @type {string}\n   * @default ''\n   */\n  this.tooltip = defaultValue(options.tooltip, \"\");\n\n  knockout.track(this, [\"toggled\", \"tooltip\"]);\n}\n\nObject.defineProperties(ToggleButtonViewModel.prototype, {\n  /**\n   * Gets the command which will be executed when the button is toggled.\n   * @memberof ToggleButtonViewModel.prototype\n   * @type {Command}\n   */\n  command: {\n    get: function () {\n      return this._command;\n    },\n  },\n});\nexport default ToggleButtonViewModel;\n", "import { defaultValue, defined, DeveloperError, Event } from \"@cesium/engine\";\nimport knockout from \"./ThirdParty/knockout.js\";\n\n/**\n * Create a Command from a given function, for use with ViewModels.\n *\n * A Command is a function with an extra <code>canExecute</code> observable property to determine\n * whether the command can be executed.  When executed, a Command function will check the\n * value of <code>canExecute</code> and throw if false.  It also provides events for when\n * a command has been or is about to be executed.\n *\n * @function\n *\n * @param {Function} func The function to execute.\n * @param {boolean} [canExecute=true] A boolean indicating whether the function can currently be executed.\n */\nfunction createCommand(func, canExecute) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(func)) {\n    throw new DeveloperError(\"func is required.\");\n  }\n  //>>includeEnd('debug');\n\n  canExecute = defaultValue(canExecute, true);\n\n  const beforeExecute = new Event();\n  const afterExecute = new Event();\n\n  function command() {\n    //>>includeStart('debug', pragmas.debug);\n    if (!command.canExecute) {\n      throw new DeveloperError(\"Cannot execute command, canExecute is false.\");\n    }\n    //>>includeEnd('debug');\n\n    const commandInfo = {\n      args: arguments,\n      cancel: false,\n    };\n\n    let result;\n    beforeExecute.raiseEvent(commandInfo);\n    if (!commandInfo.cancel) {\n      result = func.apply(null, arguments);\n      afterExecute.raiseEvent(result);\n    }\n    return result;\n  }\n\n  command.canExecute = canExecute;\n  knockout.track(command, [\"canExecute\"]);\n\n  Object.defineProperties(command, {\n    beforeExecute: {\n      value: beforeExecute,\n    },\n    afterExecute: {\n      value: afterExecute,\n    },\n  });\n\n  return command;\n}\nexport default createCommand;\n", "import knockout from \"./ThirdParty/knockout.js\";\n\n/**\n * Subscribe to a Knockout observable ES5 property, and immediately fire\n * the callback with the current value of the property.\n *\n * @private\n *\n * @function subscribeAndEvaluate\n *\n * @param {object} owner The object containing the observable property.\n * @param {string} observablePropertyName The name of the observable property.\n * @param {Function} callback The callback function.\n * @param {object} [target] The value of this in the callback function.\n * @param {string} [event='change'] The name of the event to receive notification for.\n * @returns The subscription object from Knockout which can be used to dispose the subscription later.\n */\nfunction subscribeAndEvaluate(\n  owner,\n  observablePropertyName,\n  callback,\n  target,\n  event\n) {\n  callback.call(target, owner[observablePropertyName]);\n  return knockout\n    .getObservable(owner, observablePropertyName)\n    .subscribe(callback, target, event);\n}\nexport default subscribeAndEvaluate;\n", "import {\n  Color,\n  defined,\n  destroyObject,\n  DeveloperError,\n  getElement,\n} from \"@cesium/engine\";\nimport subscribeAndEvaluate from \"../subscribeAndEvaluate.js\";\n\nconst svgNS = \"http://www.w3.org/2000/svg\";\nconst xlinkNS = \"http://www.w3.org/1999/xlink\";\n\nlet widgetForDrag;\n\nconst gradientEnabledColor0 = Color.fromCssColorString(\n  \"rgba(247,250,255,0.384)\"\n);\nconst gradientEnabledColor1 = Color.fromCssColorString(\n  \"rgba(143,191,255,0.216)\"\n);\nconst gradientEnabledColor2 = Color.fromCssColorString(\n  \"rgba(153,197,255,0.098)\"\n);\nconst gradientEnabledColor3 = Color.fromCssColorString(\n  \"rgba(255,255,255,0.086)\"\n);\n\nconst gradientDisabledColor0 = Color.fromCssColorString(\n  \"rgba(255,255,255,0.267)\"\n);\nconst gradientDisabledColor1 = Color.fromCssColorString(\"rgba(255,255,255,0)\");\n\nconst gradientKnobColor = Color.fromCssColorString(\"rgba(66,67,68,0.3)\");\nconst gradientPointerColor = Color.fromCssColorString(\"rgba(0,0,0,0.5)\");\n\nfunction getElementColor(element) {\n  return Color.fromCssColorString(\n    window.getComputedStyle(element).getPropertyValue(\"color\")\n  );\n}\n\nconst svgIconsById = {\n  animation_pathReset: {\n    tagName: \"path\",\n    transform: \"translate(16,16) scale(0.85) translate(-16,-16)\",\n    d:\n      \"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z\",\n  },\n  animation_pathPause: {\n    tagName: \"path\",\n    transform: \"translate(16,16) scale(0.85) translate(-16,-16)\",\n    d: \"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z\",\n  },\n  animation_pathPlay: {\n    tagName: \"path\",\n    transform: \"translate(16,16) scale(0.85) translate(-16,-16)\",\n    d: \"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z\",\n  },\n  animation_pathPlayReverse: {\n    tagName: \"path\",\n    transform: \"translate(16,16) scale(-0.85,0.85) translate(-16,-16)\",\n    d: \"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z\",\n  },\n  animation_pathLoop: {\n    tagName: \"path\",\n    transform: \"translate(16,16) scale(0.85) translate(-16,-16)\",\n    d:\n      \"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z\",\n  },\n  animation_pathClock: {\n    tagName: \"path\",\n    transform: \"translate(16,16) scale(0.85) translate(-16,-15.5)\",\n    d:\n      \"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z\",\n  },\n  animation_pathWingButton: {\n    tagName: \"path\",\n    d:\n      \"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z\",\n  },\n  animation_pathPointer: {\n    tagName: \"path\",\n    d: \"M-15,-65,-15,-55,15,-55,15,-65,0,-95z\",\n  },\n  animation_pathSwooshFX: {\n    tagName: \"path\",\n    d:\n      \"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z\",\n  },\n};\n\n//Dynamically builds an SVG element from a JSON object.\nfunction svgFromObject(obj) {\n  const ele = document.createElementNS(svgNS, obj.tagName);\n  for (const field in obj) {\n    if (obj.hasOwnProperty(field) && field !== \"tagName\") {\n      if (field === \"children\") {\n        const len = obj.children.length;\n        for (let i = 0; i < len; ++i) {\n          ele.appendChild(svgFromObject(obj.children[i]));\n        }\n      } else if (field.indexOf(\"xlink:\") === 0) {\n        ele.setAttributeNS(xlinkNS, field.substring(6), obj[field]);\n      } else if (field === \"textContent\") {\n        ele.textContent = obj[field];\n      } else {\n        ele.setAttribute(field, obj[field]);\n      }\n    }\n  }\n  return ele;\n}\n\nfunction svgText(x, y, msg) {\n  const text = document.createElementNS(svgNS, \"text\");\n  text.setAttribute(\"x\", x);\n  text.setAttribute(\"y\", y);\n  text.setAttribute(\"class\", \"cesium-animation-svgText\");\n\n  const tspan = document.createElementNS(svgNS, \"tspan\");\n  tspan.textContent = msg;\n  text.appendChild(tspan);\n  return text;\n}\n\nfunction setShuttleRingPointer(shuttleRingPointer, knobOuter, angle) {\n  shuttleRingPointer.setAttribute(\n    \"transform\",\n    `translate(100,100) rotate(${angle})`\n  );\n  knobOuter.setAttribute(\"transform\", `rotate(${angle})`);\n}\n\nconst makeColorStringScratch = new Color();\nfunction makeColorString(background, gradient) {\n  const gradientAlpha = gradient.alpha;\n  const backgroundAlpha = 1.0 - gradientAlpha;\n  makeColorStringScratch.red =\n    background.red * backgroundAlpha + gradient.red * gradientAlpha;\n  makeColorStringScratch.green =\n    background.green * backgroundAlpha + gradient.green * gradientAlpha;\n  makeColorStringScratch.blue =\n    background.blue * backgroundAlpha + gradient.blue * gradientAlpha;\n  return makeColorStringScratch.toCssColorString();\n}\n\nfunction rectButton(x, y, path) {\n  const iconInfo = svgIconsById[path];\n\n  const button = {\n    tagName: \"g\",\n    class: \"cesium-animation-rectButton\",\n    transform: `translate(${x},${y})`,\n    children: [\n      {\n        tagName: \"rect\",\n        class: \"cesium-animation-buttonGlow\",\n        width: 32,\n        height: 32,\n        rx: 2,\n        ry: 2,\n      },\n      {\n        tagName: \"rect\",\n        class: \"cesium-animation-buttonMain\",\n        width: 32,\n        height: 32,\n        rx: 4,\n        ry: 4,\n      },\n      {\n        class: \"cesium-animation-buttonPath\",\n        id: path,\n        tagName: iconInfo.tagName,\n        transform: iconInfo.transform,\n        d: iconInfo.d,\n      },\n      {\n        tagName: \"title\",\n        textContent: \"\",\n      },\n    ],\n  };\n  return svgFromObject(button);\n}\n\nfunction wingButton(x, y, path) {\n  const buttonIconInfo = svgIconsById[path];\n  const wingIconInfo = svgIconsById[\"animation_pathWingButton\"];\n\n  const button = {\n    tagName: \"g\",\n    class: \"cesium-animation-rectButton\",\n    transform: `translate(${x},${y})`,\n    children: [\n      {\n        class: \"cesium-animation-buttonGlow\",\n        id: \"animation_pathWingButton\",\n        tagName: wingIconInfo.tagName,\n        d: wingIconInfo.d,\n      },\n      {\n        class: \"cesium-animation-buttonMain\",\n        id: \"animation_pathWingButton\",\n        tagName: wingIconInfo.tagName,\n        d: wingIconInfo.d,\n      },\n      {\n        class: \"cesium-animation-buttonPath\",\n        id: path,\n        tagName: buttonIconInfo.tagName,\n        transform: buttonIconInfo.transform,\n        d: buttonIconInfo.d,\n      },\n      {\n        tagName: \"title\",\n        textContent: \"\",\n      },\n    ],\n  };\n  return svgFromObject(button);\n}\n\nfunction setShuttleRingFromMouseOrTouch(widget, e) {\n  const viewModel = widget._viewModel;\n  const shuttleRingDragging = viewModel.shuttleRingDragging;\n\n  if (shuttleRingDragging && widgetForDrag !== widget) {\n    return;\n  }\n\n  if (\n    e.type === \"mousedown\" ||\n    (shuttleRingDragging && e.type === \"mousemove\") ||\n    (e.type === \"touchstart\" && e.touches.length === 1) ||\n    (shuttleRingDragging && e.type === \"touchmove\" && e.touches.length === 1)\n  ) {\n    const centerX = widget._centerX;\n    const centerY = widget._centerY;\n    const svg = widget._svgNode;\n    const rect = svg.getBoundingClientRect();\n    let clientX;\n    let clientY;\n    if (e.type === \"touchstart\" || e.type === \"touchmove\") {\n      clientX = e.touches[0].clientX;\n      clientY = e.touches[0].clientY;\n    } else {\n      clientX = e.clientX;\n      clientY = e.clientY;\n    }\n\n    if (\n      !shuttleRingDragging &&\n      (clientX > rect.right ||\n        clientX < rect.left ||\n        clientY < rect.top ||\n        clientY > rect.bottom)\n    ) {\n      return;\n    }\n\n    const pointerRect = widget._shuttleRingPointer.getBoundingClientRect();\n\n    const x = clientX - centerX - rect.left;\n    const y = clientY - centerY - rect.top;\n\n    let angle = (Math.atan2(y, x) * 180) / Math.PI + 90;\n    if (angle > 180) {\n      angle -= 360;\n    }\n    const shuttleRingAngle = viewModel.shuttleRingAngle;\n    if (\n      shuttleRingDragging ||\n      (clientX < pointerRect.right &&\n        clientX > pointerRect.left &&\n        clientY > pointerRect.top &&\n        clientY < pointerRect.bottom)\n    ) {\n      widgetForDrag = widget;\n      viewModel.shuttleRingDragging = true;\n      viewModel.shuttleRingAngle = angle;\n    } else if (angle < shuttleRingAngle) {\n      viewModel.slower();\n    } else if (angle > shuttleRingAngle) {\n      viewModel.faster();\n    }\n    e.preventDefault();\n  } else {\n    if (widget === widgetForDrag) {\n      widgetForDrag = undefined;\n    }\n    viewModel.shuttleRingDragging = false;\n  }\n}\n\n//This is a private class for treating an SVG element like a button.\n//If we ever need a general purpose SVG button, we can make this generic.\nfunction SvgButton(svgElement, viewModel) {\n  this._viewModel = viewModel;\n  this.svgElement = svgElement;\n  this._enabled = undefined;\n  this._toggled = undefined;\n\n  const that = this;\n  this._clickFunction = function () {\n    const command = that._viewModel.command;\n    if (command.canExecute) {\n      command();\n    }\n  };\n\n  svgElement.addEventListener(\"click\", this._clickFunction, true);\n\n  //TODO: Since the animation widget uses SVG and has no HTML backing,\n  //we need to wire everything up manually.  Knockout can supposedly\n  //bind to SVG, so we we figure that out we can modify our SVG\n  //to include the binding information directly.\n\n  this._subscriptions = [\n    //\n    subscribeAndEvaluate(viewModel, \"toggled\", this.setToggled, this), //\n    subscribeAndEvaluate(viewModel, \"tooltip\", this.setTooltip, this), //\n    subscribeAndEvaluate(\n      viewModel.command,\n      \"canExecute\",\n      this.setEnabled,\n      this\n    ),\n  ];\n}\n\nSvgButton.prototype.destroy = function () {\n  this.svgElement.removeEventListener(\"click\", this._clickFunction, true);\n  const subscriptions = this._subscriptions;\n  for (let i = 0, len = subscriptions.length; i < len; i++) {\n    subscriptions[i].dispose();\n  }\n  destroyObject(this);\n};\n\nSvgButton.prototype.isDestroyed = function () {\n  return false;\n};\n\nSvgButton.prototype.setEnabled = function (enabled) {\n  if (this._enabled !== enabled) {\n    this._enabled = enabled;\n\n    if (!enabled) {\n      this.svgElement.setAttribute(\"class\", \"cesium-animation-buttonDisabled\");\n      return;\n    }\n\n    if (this._toggled) {\n      this.svgElement.setAttribute(\n        \"class\",\n        \"cesium-animation-rectButton cesium-animation-buttonToggled\"\n      );\n      return;\n    }\n\n    this.svgElement.setAttribute(\"class\", \"cesium-animation-rectButton\");\n  }\n};\n\nSvgButton.prototype.setToggled = function (toggled) {\n  if (this._toggled !== toggled) {\n    this._toggled = toggled;\n\n    if (this._enabled) {\n      if (toggled) {\n        this.svgElement.setAttribute(\n          \"class\",\n          \"cesium-animation-rectButton cesium-animation-buttonToggled\"\n        );\n      } else {\n        this.svgElement.setAttribute(\"class\", \"cesium-animation-rectButton\");\n      }\n    }\n  }\n};\n\nSvgButton.prototype.setTooltip = function (tooltip) {\n  this.svgElement.getElementsByTagName(\"title\")[0].textContent = tooltip;\n};\n\n/**\n * <span style=\"display: block; text-align: center;\">\n * <img src=\"Images/AnimationWidget.png\" width=\"211\" height=\"142\" alt=\"\" />\n * <br />Animation widget\n * </span>\n * <br /><br />\n * The Animation widget provides buttons for play, pause, and reverse, along with the\n * current time and date, surrounded by a \"shuttle ring\" for controlling the speed of animation.\n * <br /><br />\n * The \"shuttle ring\" concept is borrowed from video editing, where typically a\n * \"jog wheel\" can be rotated to move past individual animation frames very slowly, and\n * a surrounding shuttle ring can be twisted to control direction and speed of fast playback.\n * Cesium typically treats time as continuous (not broken into pre-defined animation frames),\n * so this widget offers no jog wheel.  Instead, the shuttle ring is capable of both fast and\n * very slow playback.  Click and drag the shuttle ring pointer itself (shown above in green),\n * or click in the rest of the ring area to nudge the pointer to the next preset speed in that direction.\n * <br /><br />\n * The Animation widget also provides a \"realtime\" button (in the upper-left) that keeps\n * animation time in sync with the end user's system clock, typically displaying\n * \"today\" or \"right now.\"  This mode is not available in {@link ClockRange.CLAMPED} or\n * {@link ClockRange.LOOP_STOP} mode if the current time is outside of {@link Clock}'s startTime and endTime.\n *\n * @alias Animation\n * @constructor\n *\n * @param {Element|string} container The DOM element or ID that will contain the widget.\n * @param {AnimationViewModel} viewModel The view model used by this widget.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n *\n *\n * @example\n * // In HTML head, include a link to Animation.css stylesheet,\n * // and in the body, include: <div id=\"animationContainer\"></div>\n *\n * const clock = new Cesium.Clock();\n * const clockViewModel = new Cesium.ClockViewModel(clock);\n * const viewModel = new Cesium.AnimationViewModel(clockViewModel);\n * const widget = new Cesium.Animation('animationContainer', viewModel);\n *\n * function tick() {\n *     clock.tick();\n *     requestAnimationFrame(tick);\n * }\n * requestAnimationFrame(tick);\n *\n * @see AnimationViewModel\n * @see Clock\n */\nfunction Animation(container, viewModel) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(container)) {\n    throw new DeveloperError(\"container is required.\");\n  }\n  if (!defined(viewModel)) {\n    throw new DeveloperError(\"viewModel is required.\");\n  }\n  //>>includeEnd('debug');\n\n  container = getElement(container);\n  this._viewModel = viewModel;\n  this._container = container;\n  this._centerX = 0;\n  this._centerY = 0;\n  this._defsElement = undefined;\n  this._svgNode = undefined;\n  this._topG = undefined;\n  this._lastHeight = undefined;\n  this._lastWidth = undefined;\n\n  const ownerDocument = container.ownerDocument;\n\n  // Firefox requires SVG references to be included directly, not imported from external CSS.\n  // Also, CSS minifiers get confused by this being in an external CSS file.\n  const cssStyle = document.createElement(\"style\");\n  cssStyle.textContent =\n    \".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }\\\n.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }\\\n.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }\\\n.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }\\\n.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }\\\n.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }\\\n.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }\\\n.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }\\\n.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }\\\n.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }\\\n.cesium-animation-knobInner { fill: url(#animation_knobInner); }\";\n\n  ownerDocument.head.insertBefore(cssStyle, ownerDocument.head.childNodes[0]);\n\n  const themeEle = document.createElement(\"div\");\n  themeEle.className = \"cesium-animation-theme\";\n  themeEle.innerHTML =\n    '<div class=\"cesium-animation-themeNormal\"></div>\\\n<div class=\"cesium-animation-themeHover\"></div>\\\n<div class=\"cesium-animation-themeSelect\"></div>\\\n<div class=\"cesium-animation-themeDisabled\"></div>\\\n<div class=\"cesium-animation-themeKnob\"></div>\\\n<div class=\"cesium-animation-themePointer\"></div>\\\n<div class=\"cesium-animation-themeSwoosh\"></div>\\\n<div class=\"cesium-animation-themeSwooshHover\"></div>';\n\n  this._theme = themeEle;\n  this._themeNormal = themeEle.childNodes[0];\n  this._themeHover = themeEle.childNodes[1];\n  this._themeSelect = themeEle.childNodes[2];\n  this._themeDisabled = themeEle.childNodes[3];\n  this._themeKnob = themeEle.childNodes[4];\n  this._themePointer = themeEle.childNodes[5];\n  this._themeSwoosh = themeEle.childNodes[6];\n  this._themeSwooshHover = themeEle.childNodes[7];\n\n  const svg = document.createElementNS(svgNS, \"svg:svg\");\n  this._svgNode = svg;\n\n  // Define the XLink namespace that SVG uses\n  svg.setAttributeNS(\"http://www.w3.org/2000/xmlns/\", \"xmlns:xlink\", xlinkNS);\n\n  const topG = document.createElementNS(svgNS, \"g\");\n  this._topG = topG;\n\n  this._realtimeSVG = new SvgButton(\n    wingButton(3, 4, \"animation_pathClock\"),\n    viewModel.playRealtimeViewModel\n  );\n  this._playReverseSVG = new SvgButton(\n    rectButton(44, 99, \"animation_pathPlayReverse\"),\n    viewModel.playReverseViewModel\n  );\n  this._playForwardSVG = new SvgButton(\n    rectButton(124, 99, \"animation_pathPlay\"),\n    viewModel.playForwardViewModel\n  );\n  this._pauseSVG = new SvgButton(\n    rectButton(84, 99, \"animation_pathPause\"),\n    viewModel.pauseViewModel\n  );\n\n  const buttonsG = document.createElementNS(svgNS, \"g\");\n  buttonsG.appendChild(this._realtimeSVG.svgElement);\n  buttonsG.appendChild(this._playReverseSVG.svgElement);\n  buttonsG.appendChild(this._playForwardSVG.svgElement);\n  buttonsG.appendChild(this._pauseSVG.svgElement);\n\n  const shuttleRingBackPanel = svgFromObject({\n    tagName: \"circle\",\n    class: \"cesium-animation-shuttleRingBack\",\n    cx: 100,\n    cy: 100,\n    r: 99,\n  });\n  this._shuttleRingBackPanel = shuttleRingBackPanel;\n\n  const swooshIconInfo = svgIconsById[\"animation_pathSwooshFX\"];\n  const shuttleRingPointerIconInfo = svgIconsById[\"animation_pathPointer\"];\n\n  const shuttleRingSwooshG = svgFromObject({\n    tagName: \"g\",\n    class: \"cesium-animation-shuttleRingSwoosh\",\n    children: [\n      {\n        tagName: swooshIconInfo.tagName,\n        transform: \"translate(100,97) scale(-1,1)\",\n        id: \"animation_pathSwooshFX\",\n        d: swooshIconInfo.d,\n      },\n      {\n        tagName: swooshIconInfo.tagName,\n        transform: \"translate(100,97)\",\n        id: \"animation_pathSwooshFX\",\n        d: swooshIconInfo.d,\n      },\n      {\n        tagName: \"line\",\n        x1: 100,\n        y1: 8,\n        x2: 100,\n        y2: 22,\n      },\n    ],\n  });\n  this._shuttleRingSwooshG = shuttleRingSwooshG;\n\n  this._shuttleRingPointer = svgFromObject({\n    class: \"cesium-animation-shuttleRingPointer\",\n    id: \"animation_pathPointer\",\n    tagName: shuttleRingPointerIconInfo.tagName,\n    d: shuttleRingPointerIconInfo.d,\n  });\n\n  const knobG = svgFromObject({\n    tagName: \"g\",\n    transform: \"translate(100,100)\",\n  });\n\n  this._knobOuter = svgFromObject({\n    tagName: \"circle\",\n    class: \"cesium-animation-knobOuter\",\n    cx: 0,\n    cy: 0,\n    r: 71,\n  });\n\n  const knobInnerAndShieldSize = 61;\n\n  const knobInner = svgFromObject({\n    tagName: \"circle\",\n    class: \"cesium-animation-knobInner\",\n    cx: 0,\n    cy: 0,\n    r: knobInnerAndShieldSize,\n  });\n\n  this._knobDate = svgText(0, -24, \"\");\n  this._knobTime = svgText(0, -7, \"\");\n  this._knobStatus = svgText(0, -41, \"\");\n\n  // widget shield catches clicks on the knob itself (even while DOM elements underneath are changing).\n  const knobShield = svgFromObject({\n    tagName: \"circle\",\n    class: \"cesium-animation-blank\",\n    cx: 0,\n    cy: 0,\n    r: knobInnerAndShieldSize,\n  });\n\n  const shuttleRingBackG = document.createElementNS(svgNS, \"g\");\n  shuttleRingBackG.setAttribute(\"class\", \"cesium-animation-shuttleRingG\");\n\n  container.appendChild(themeEle);\n  topG.appendChild(shuttleRingBackG);\n  topG.appendChild(knobG);\n  topG.appendChild(buttonsG);\n\n  shuttleRingBackG.appendChild(shuttleRingBackPanel);\n  shuttleRingBackG.appendChild(shuttleRingSwooshG);\n  shuttleRingBackG.appendChild(this._shuttleRingPointer);\n\n  knobG.appendChild(this._knobOuter);\n  knobG.appendChild(knobInner);\n  knobG.appendChild(this._knobDate);\n  knobG.appendChild(this._knobTime);\n  knobG.appendChild(this._knobStatus);\n  knobG.appendChild(knobShield);\n\n  svg.appendChild(topG);\n  container.appendChild(svg);\n\n  const that = this;\n  function mouseCallback(e) {\n    setShuttleRingFromMouseOrTouch(that, e);\n  }\n  this._mouseCallback = mouseCallback;\n\n  shuttleRingBackPanel.addEventListener(\"mousedown\", mouseCallback, true);\n  shuttleRingBackPanel.addEventListener(\"touchstart\", mouseCallback, true);\n  shuttleRingSwooshG.addEventListener(\"mousedown\", mouseCallback, true);\n  shuttleRingSwooshG.addEventListener(\"touchstart\", mouseCallback, true);\n  ownerDocument.addEventListener(\"mousemove\", mouseCallback, true);\n  ownerDocument.addEventListener(\"touchmove\", mouseCallback, true);\n  ownerDocument.addEventListener(\"mouseup\", mouseCallback, true);\n  ownerDocument.addEventListener(\"touchend\", mouseCallback, true);\n  ownerDocument.addEventListener(\"touchcancel\", mouseCallback, true);\n  this._shuttleRingPointer.addEventListener(\"mousedown\", mouseCallback, true);\n  this._shuttleRingPointer.addEventListener(\"touchstart\", mouseCallback, true);\n  this._knobOuter.addEventListener(\"mousedown\", mouseCallback, true);\n  this._knobOuter.addEventListener(\"touchstart\", mouseCallback, true);\n\n  //TODO: Since the animation widget uses SVG and has no HTML backing,\n  //we need to wire everything up manually.  Knockout can supposedly\n  //bind to SVG, so we we figure that out we can modify our SVG\n  //to include the binding information directly.\n\n  const timeNode = this._knobTime.childNodes[0];\n  const dateNode = this._knobDate.childNodes[0];\n  const statusNode = this._knobStatus.childNodes[0];\n  let isPaused;\n  this._subscriptions = [\n    //\n    subscribeAndEvaluate(viewModel.pauseViewModel, \"toggled\", function (value) {\n      if (isPaused !== value) {\n        isPaused = value;\n        if (isPaused) {\n          that._shuttleRingPointer.setAttribute(\n            \"class\",\n            \"cesium-animation-shuttleRingPausePointer\"\n          );\n        } else {\n          that._shuttleRingPointer.setAttribute(\n            \"class\",\n            \"cesium-animation-shuttleRingPointer\"\n          );\n        }\n      }\n    }),\n\n    subscribeAndEvaluate(viewModel, \"shuttleRingAngle\", function (value) {\n      setShuttleRingPointer(that._shuttleRingPointer, that._knobOuter, value);\n    }),\n\n    subscribeAndEvaluate(viewModel, \"dateLabel\", function (value) {\n      if (dateNode.textContent !== value) {\n        dateNode.textContent = value;\n      }\n    }),\n\n    subscribeAndEvaluate(viewModel, \"timeLabel\", function (value) {\n      if (timeNode.textContent !== value) {\n        timeNode.textContent = value;\n      }\n    }),\n\n    subscribeAndEvaluate(viewModel, \"multiplierLabel\", function (value) {\n      if (statusNode.textContent !== value) {\n        statusNode.textContent = value;\n      }\n    }),\n  ];\n\n  this.applyThemeChanges();\n  this.resize();\n}\n\nObject.defineProperties(Animation.prototype, {\n  /**\n   * Gets the parent container.\n   *\n   * @memberof Animation.prototype\n   * @type {Element}\n   * @readonly\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the view model.\n   *\n   * @memberof Animation.prototype\n   * @type {AnimationViewModel}\n   * @readonly\n   */\n  viewModel: {\n    get: function () {\n      return this._viewModel;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nAnimation.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the animation widget.  Should be called if permanently\n * removing the widget from layout.\n */\nAnimation.prototype.destroy = function () {\n  if (defined(this._observer)) {\n    this._observer.disconnect();\n    this._observer = undefined;\n  }\n\n  const doc = this._container.ownerDocument;\n\n  const mouseCallback = this._mouseCallback;\n  this._shuttleRingBackPanel.removeEventListener(\n    \"mousedown\",\n    mouseCallback,\n    true\n  );\n  this._shuttleRingBackPanel.removeEventListener(\n    \"touchstart\",\n    mouseCallback,\n    true\n  );\n  this._shuttleRingSwooshG.removeEventListener(\n    \"mousedown\",\n    mouseCallback,\n    true\n  );\n  this._shuttleRingSwooshG.removeEventListener(\n    \"touchstart\",\n    mouseCallback,\n    true\n  );\n  doc.removeEventListener(\"mousemove\", mouseCallback, true);\n  doc.removeEventListener(\"touchmove\", mouseCallback, true);\n  doc.removeEventListener(\"mouseup\", mouseCallback, true);\n  doc.removeEventListener(\"touchend\", mouseCallback, true);\n  doc.removeEventListener(\"touchcancel\", mouseCallback, true);\n  this._shuttleRingPointer.removeEventListener(\n    \"mousedown\",\n    mouseCallback,\n    true\n  );\n  this._shuttleRingPointer.removeEventListener(\n    \"touchstart\",\n    mouseCallback,\n    true\n  );\n  this._knobOuter.removeEventListener(\"mousedown\", mouseCallback, true);\n  this._knobOuter.removeEventListener(\"touchstart\", mouseCallback, true);\n\n  this._container.removeChild(this._svgNode);\n  this._container.removeChild(this._theme);\n  this._realtimeSVG.destroy();\n  this._playReverseSVG.destroy();\n  this._playForwardSVG.destroy();\n  this._pauseSVG.destroy();\n\n  const subscriptions = this._subscriptions;\n  for (let i = 0, len = subscriptions.length; i < len; i++) {\n    subscriptions[i].dispose();\n  }\n\n  return destroyObject(this);\n};\n\n/**\n * Resizes the widget to match the container size.\n * This function should be called whenever the container size is changed.\n */\nAnimation.prototype.resize = function () {\n  const parentWidth = this._container.clientWidth;\n  const parentHeight = this._container.clientHeight;\n  if (parentWidth === this._lastWidth && parentHeight === this._lastHeight) {\n    return;\n  }\n\n  const svg = this._svgNode;\n\n  //The width and height as the SVG was originally drawn.\n  const baseWidth = 200;\n  const baseHeight = 132;\n\n  let width = parentWidth;\n  let height = parentHeight;\n\n  if (parentWidth === 0 && parentHeight === 0) {\n    width = baseWidth;\n    height = baseHeight;\n  } else if (parentWidth === 0) {\n    height = parentHeight;\n    width = baseWidth * (parentHeight / baseHeight);\n  } else if (parentHeight === 0) {\n    width = parentWidth;\n    height = baseHeight * (parentWidth / baseWidth);\n  }\n\n  const scaleX = width / baseWidth;\n  const scaleY = height / baseHeight;\n\n  svg.style.cssText = `width: ${width}px; height: ${height}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`;\n  svg.setAttribute(\"width\", width);\n  svg.setAttribute(\"height\", height);\n  svg.setAttribute(\"viewBox\", `0 0 ${width} ${height}`);\n\n  this._topG.setAttribute(\"transform\", `scale(${scaleX},${scaleY})`);\n\n  this._centerX = Math.max(1, 100.0 * scaleX);\n  this._centerY = Math.max(1, 100.0 * scaleY);\n\n  this._lastHeight = parentWidth;\n  this._lastWidth = parentHeight;\n};\n\n/**\n * Updates the widget to reflect any modified CSS rules for theming.\n *\n * @example\n * //Switch to the cesium-lighter theme.\n * document.body.className = 'cesium-lighter';\n * animation.applyThemeChanges();\n */\nAnimation.prototype.applyThemeChanges = function () {\n  // Since we rely on computed styles for themeing, we can't actually\n  // do anything if the container has not yet been added to the DOM.\n  // Set up an observer to be notified when it is added and apply\n  // the changes at that time.\n\n  const doc = this._container.ownerDocument;\n\n  if (!doc.body.contains(this._container)) {\n    if (defined(this._observer)) {\n      //Already listening.\n      return;\n    }\n    const that = this;\n    that._observer = new MutationObserver(function () {\n      if (doc.body.contains(that._container)) {\n        that._observer.disconnect();\n        that._observer = undefined;\n        that.applyThemeChanges();\n      }\n    });\n    that._observer.observe(doc, { childList: true, subtree: true });\n    return;\n  }\n\n  const buttonNormalBackColor = getElementColor(this._themeNormal);\n  const buttonHoverBackColor = getElementColor(this._themeHover);\n  const buttonToggledBackColor = getElementColor(this._themeSelect);\n  const buttonDisabledBackColor = getElementColor(this._themeDisabled);\n  const knobBackColor = getElementColor(this._themeKnob);\n  const pointerColor = getElementColor(this._themePointer);\n  const swooshColor = getElementColor(this._themeSwoosh);\n  const swooshHoverColor = getElementColor(this._themeSwooshHover);\n\n  const defsElement = svgFromObject({\n    tagName: \"defs\",\n    children: [\n      {\n        id: \"animation_buttonNormal\",\n        tagName: \"linearGradient\",\n        x1: \"50%\",\n        y1: \"0%\",\n        x2: \"50%\",\n        y2: \"100%\",\n        children: [\n          //add a 'stop-opacity' field to make translucent.\n          {\n            tagName: \"stop\",\n            offset: \"0%\",\n            \"stop-color\": makeColorString(\n              buttonNormalBackColor,\n              gradientEnabledColor0\n            ),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"12%\",\n            \"stop-color\": makeColorString(\n              buttonNormalBackColor,\n              gradientEnabledColor1\n            ),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"46%\",\n            \"stop-color\": makeColorString(\n              buttonNormalBackColor,\n              gradientEnabledColor2\n            ),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"81%\",\n            \"stop-color\": makeColorString(\n              buttonNormalBackColor,\n              gradientEnabledColor3\n            ),\n          },\n        ],\n      },\n      {\n        id: \"animation_buttonHovered\",\n        tagName: \"linearGradient\",\n        x1: \"50%\",\n        y1: \"0%\",\n        x2: \"50%\",\n        y2: \"100%\",\n        children: [\n          {\n            tagName: \"stop\",\n            offset: \"0%\",\n            \"stop-color\": makeColorString(\n              buttonHoverBackColor,\n              gradientEnabledColor0\n            ),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"12%\",\n            \"stop-color\": makeColorString(\n              buttonHoverBackColor,\n              gradientEnabledColor1\n            ),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"46%\",\n            \"stop-color\": makeColorString(\n              buttonHoverBackColor,\n              gradientEnabledColor2\n            ),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"81%\",\n            \"stop-color\": makeColorString(\n              buttonHoverBackColor,\n              gradientEnabledColor3\n            ),\n          },\n        ],\n      },\n      {\n        id: \"animation_buttonToggled\",\n        tagName: \"linearGradient\",\n        x1: \"50%\",\n        y1: \"0%\",\n        x2: \"50%\",\n        y2: \"100%\",\n        children: [\n          {\n            tagName: \"stop\",\n            offset: \"0%\",\n            \"stop-color\": makeColorString(\n              buttonToggledBackColor,\n              gradientEnabledColor0\n            ),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"12%\",\n            \"stop-color\": makeColorString(\n              buttonToggledBackColor,\n              gradientEnabledColor1\n            ),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"46%\",\n            \"stop-color\": makeColorString(\n              buttonToggledBackColor,\n              gradientEnabledColor2\n            ),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"81%\",\n            \"stop-color\": makeColorString(\n              buttonToggledBackColor,\n              gradientEnabledColor3\n            ),\n          },\n        ],\n      },\n      {\n        id: \"animation_buttonDisabled\",\n        tagName: \"linearGradient\",\n        x1: \"50%\",\n        y1: \"0%\",\n        x2: \"50%\",\n        y2: \"100%\",\n        children: [\n          {\n            tagName: \"stop\",\n            offset: \"0%\",\n            \"stop-color\": makeColorString(\n              buttonDisabledBackColor,\n              gradientDisabledColor0\n            ),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"75%\",\n            \"stop-color\": makeColorString(\n              buttonDisabledBackColor,\n              gradientDisabledColor1\n            ),\n          },\n        ],\n      },\n      {\n        id: \"animation_blurred\",\n        tagName: \"filter\",\n        width: \"200%\",\n        height: \"200%\",\n        x: \"-50%\",\n        y: \"-50%\",\n        children: [\n          {\n            tagName: \"feGaussianBlur\",\n            stdDeviation: 4,\n            in: \"SourceGraphic\",\n          },\n        ],\n      },\n      {\n        id: \"animation_shuttleRingSwooshGradient\",\n        tagName: \"linearGradient\",\n        x1: \"50%\",\n        y1: \"0%\",\n        x2: \"50%\",\n        y2: \"100%\",\n        children: [\n          {\n            tagName: \"stop\",\n            offset: \"0%\",\n            \"stop-opacity\": 0.2,\n            \"stop-color\": swooshColor.toCssColorString(),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"85%\",\n            \"stop-opacity\": 0.85,\n            \"stop-color\": swooshColor.toCssColorString(),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"95%\",\n            \"stop-opacity\": 0.05,\n            \"stop-color\": swooshColor.toCssColorString(),\n          },\n        ],\n      },\n      {\n        id: \"animation_shuttleRingSwooshHovered\",\n        tagName: \"linearGradient\",\n        x1: \"50%\",\n        y1: \"0%\",\n        x2: \"50%\",\n        y2: \"100%\",\n        children: [\n          {\n            tagName: \"stop\",\n            offset: \"0%\",\n            \"stop-opacity\": 0.2,\n            \"stop-color\": swooshHoverColor.toCssColorString(),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"85%\",\n            \"stop-opacity\": 0.85,\n            \"stop-color\": swooshHoverColor.toCssColorString(),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"95%\",\n            \"stop-opacity\": 0.05,\n            \"stop-color\": swooshHoverColor.toCssColorString(),\n          },\n        ],\n      },\n      {\n        id: \"animation_shuttleRingPointerGradient\",\n        tagName: \"linearGradient\",\n        x1: \"0%\",\n        y1: \"50%\",\n        x2: \"100%\",\n        y2: \"50%\",\n        children: [\n          {\n            tagName: \"stop\",\n            offset: \"0%\",\n            \"stop-color\": pointerColor.toCssColorString(),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"40%\",\n            \"stop-color\": pointerColor.toCssColorString(),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"60%\",\n            \"stop-color\": makeColorString(pointerColor, gradientPointerColor),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"100%\",\n            \"stop-color\": makeColorString(pointerColor, gradientPointerColor),\n          },\n        ],\n      },\n      {\n        id: \"animation_shuttleRingPointerPaused\",\n        tagName: \"linearGradient\",\n        x1: \"0%\",\n        y1: \"50%\",\n        x2: \"100%\",\n        y2: \"50%\",\n        children: [\n          {\n            tagName: \"stop\",\n            offset: \"0%\",\n            \"stop-color\": \"#CCC\",\n          },\n          {\n            tagName: \"stop\",\n            offset: \"40%\",\n            \"stop-color\": \"#CCC\",\n          },\n          {\n            tagName: \"stop\",\n            offset: \"60%\",\n            \"stop-color\": \"#555\",\n          },\n          {\n            tagName: \"stop\",\n            offset: \"100%\",\n            \"stop-color\": \"#555\",\n          },\n        ],\n      },\n      {\n        id: \"animation_knobOuter\",\n        tagName: \"linearGradient\",\n        x1: \"20%\",\n        y1: \"0%\",\n        x2: \"90%\",\n        y2: \"100%\",\n        children: [\n          {\n            tagName: \"stop\",\n            offset: \"5%\",\n            \"stop-color\": makeColorString(knobBackColor, gradientEnabledColor0),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"60%\",\n            \"stop-color\": makeColorString(knobBackColor, gradientKnobColor),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"85%\",\n            \"stop-color\": makeColorString(knobBackColor, gradientEnabledColor1),\n          },\n        ],\n      },\n      {\n        id: \"animation_knobInner\",\n        tagName: \"linearGradient\",\n        x1: \"20%\",\n        y1: \"0%\",\n        x2: \"90%\",\n        y2: \"100%\",\n        children: [\n          {\n            tagName: \"stop\",\n            offset: \"5%\",\n            \"stop-color\": makeColorString(knobBackColor, gradientKnobColor),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"60%\",\n            \"stop-color\": makeColorString(knobBackColor, gradientEnabledColor0),\n          },\n          {\n            tagName: \"stop\",\n            offset: \"85%\",\n            \"stop-color\": makeColorString(knobBackColor, gradientEnabledColor3),\n          },\n        ],\n      },\n    ],\n  });\n\n  if (!defined(this._defsElement)) {\n    this._svgNode.appendChild(defsElement);\n  } else {\n    this._svgNode.replaceChild(defsElement, this._defsElement);\n  }\n  this._defsElement = defsElement;\n};\nexport default Animation;\n", "import {\n  binarySearch,\n  ClockRange,\n  ClockStep,\n  defined,\n  DeveloperError,\n  JulianDate,\n} from \"@cesium/engine\";\n\nimport knockout from \"../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\nimport ToggleButtonViewModel from \"../ToggleButtonViewModel.js\";\n\nconst monthNames = [\n  \"Jan\",\n  \"Feb\",\n  \"Mar\",\n  \"Apr\",\n  \"May\",\n  \"Jun\",\n  \"Jul\",\n  \"Aug\",\n  \"Sep\",\n  \"Oct\",\n  \"Nov\",\n  \"Dec\",\n];\nconst realtimeShuttleRingAngle = 15;\nconst maxShuttleRingAngle = 105;\n\nfunction numberComparator(left, right) {\n  return left - right;\n}\n\nfunction getTypicalMultiplierIndex(multiplier, shuttleRingTicks) {\n  const index = binarySearch(shuttleRingTicks, multiplier, numberComparator);\n  return index < 0 ? ~index : index;\n}\n\nfunction angleToMultiplier(angle, shuttleRingTicks) {\n  //Use a linear scale for -1 to 1 between -15 < angle < 15 degrees\n  if (Math.abs(angle) <= realtimeShuttleRingAngle) {\n    return angle / realtimeShuttleRingAngle;\n  }\n\n  const minp = realtimeShuttleRingAngle;\n  const maxp = maxShuttleRingAngle;\n  let maxv;\n  const minv = 0;\n  let scale;\n  if (angle > 0) {\n    maxv = Math.log(shuttleRingTicks[shuttleRingTicks.length - 1]);\n    scale = (maxv - minv) / (maxp - minp);\n    return Math.exp(minv + scale * (angle - minp));\n  }\n\n  maxv = Math.log(-shuttleRingTicks[0]);\n  scale = (maxv - minv) / (maxp - minp);\n  return -Math.exp(minv + scale * (Math.abs(angle) - minp));\n}\n\nfunction multiplierToAngle(multiplier, shuttleRingTicks, clockViewModel) {\n  if (clockViewModel.clockStep === ClockStep.SYSTEM_CLOCK) {\n    return realtimeShuttleRingAngle;\n  }\n\n  if (Math.abs(multiplier) <= 1) {\n    return multiplier * realtimeShuttleRingAngle;\n  }\n\n  const fastedMultipler = shuttleRingTicks[shuttleRingTicks.length - 1];\n  if (multiplier > fastedMultipler) {\n    multiplier = fastedMultipler;\n  } else if (multiplier < -fastedMultipler) {\n    multiplier = -fastedMultipler;\n  }\n\n  const minp = realtimeShuttleRingAngle;\n  const maxp = maxShuttleRingAngle;\n  let maxv;\n  const minv = 0;\n  let scale;\n\n  if (multiplier > 0) {\n    maxv = Math.log(fastedMultipler);\n    scale = (maxv - minv) / (maxp - minp);\n    return (Math.log(multiplier) - minv) / scale + minp;\n  }\n\n  maxv = Math.log(-shuttleRingTicks[0]);\n  scale = (maxv - minv) / (maxp - minp);\n  return -((Math.log(Math.abs(multiplier)) - minv) / scale + minp);\n}\n\n/**\n * The view model for the {@link Animation} widget.\n * @alias AnimationViewModel\n * @constructor\n *\n * @param {ClockViewModel} clockViewModel The ClockViewModel instance to use.\n *\n * @see Animation\n */\nfunction AnimationViewModel(clockViewModel) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(clockViewModel)) {\n    throw new DeveloperError(\"clockViewModel is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const that = this;\n  this._clockViewModel = clockViewModel;\n  this._allShuttleRingTicks = [];\n  this._dateFormatter = AnimationViewModel.defaultDateFormatter;\n  this._timeFormatter = AnimationViewModel.defaultTimeFormatter;\n\n  /**\n   * Gets or sets whether the shuttle ring is currently being dragged.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.shuttleRingDragging = false;\n\n  /**\n   * Gets or sets whether dragging the shuttle ring should cause the multiplier\n   * to snap to the defined tick values rather than interpolating between them.\n   * This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.snapToTicks = false;\n\n  knockout.track(this, [\n    \"_allShuttleRingTicks\",\n    \"_dateFormatter\",\n    \"_timeFormatter\",\n    \"shuttleRingDragging\",\n    \"snapToTicks\",\n  ]);\n\n  this._sortedFilteredPositiveTicks = [];\n\n  this.setShuttleRingTicks(AnimationViewModel.defaultTicks);\n\n  /**\n   * Gets the string representation of the current time.  This property is observable.\n   * @type {string}\n   */\n  this.timeLabel = undefined;\n  knockout.defineProperty(this, \"timeLabel\", function () {\n    return that._timeFormatter(that._clockViewModel.currentTime, that);\n  });\n\n  /**\n   * Gets the string representation of the current date.  This property is observable.\n   * @type {string}\n   */\n  this.dateLabel = undefined;\n  knockout.defineProperty(this, \"dateLabel\", function () {\n    return that._dateFormatter(that._clockViewModel.currentTime, that);\n  });\n\n  /**\n   * Gets the string representation of the current multiplier.  This property is observable.\n   * @type {string}\n   */\n  this.multiplierLabel = undefined;\n  knockout.defineProperty(this, \"multiplierLabel\", function () {\n    const clockViewModel = that._clockViewModel;\n    if (clockViewModel.clockStep === ClockStep.SYSTEM_CLOCK) {\n      return \"Today\";\n    }\n\n    const multiplier = clockViewModel.multiplier;\n\n    //If it's a whole number, just return it.\n    if (multiplier % 1 === 0) {\n      return `${multiplier.toFixed(0)}x`;\n    }\n\n    //Convert to decimal string and remove any trailing zeroes\n    return `${multiplier.toFixed(3).replace(/0{0,3}$/, \"\")}x`;\n  });\n\n  /**\n   * Gets or sets the current shuttle ring angle.  This property is observable.\n   * @type {number}\n   */\n  this.shuttleRingAngle = undefined;\n  knockout.defineProperty(this, \"shuttleRingAngle\", {\n    get: function () {\n      return multiplierToAngle(\n        clockViewModel.multiplier,\n        that._allShuttleRingTicks,\n        clockViewModel\n      );\n    },\n    set: function (angle) {\n      angle = Math.max(\n        Math.min(angle, maxShuttleRingAngle),\n        -maxShuttleRingAngle\n      );\n      const ticks = that._allShuttleRingTicks;\n\n      const clockViewModel = that._clockViewModel;\n      clockViewModel.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n\n      //If we are at the max angle, simply return the max value in either direction.\n      if (Math.abs(angle) === maxShuttleRingAngle) {\n        clockViewModel.multiplier =\n          angle > 0 ? ticks[ticks.length - 1] : ticks[0];\n        return;\n      }\n\n      let multiplier = angleToMultiplier(angle, ticks);\n      if (that.snapToTicks) {\n        multiplier = ticks[getTypicalMultiplierIndex(multiplier, ticks)];\n      } else if (multiplier !== 0) {\n        const positiveMultiplier = Math.abs(multiplier);\n\n        if (positiveMultiplier > 100) {\n          const numDigits = positiveMultiplier.toFixed(0).length - 2;\n          const divisor = Math.pow(10, numDigits);\n          multiplier = (Math.round(multiplier / divisor) * divisor) | 0;\n        } else if (positiveMultiplier > realtimeShuttleRingAngle) {\n          multiplier = Math.round(multiplier);\n        } else if (positiveMultiplier > 1) {\n          multiplier = +multiplier.toFixed(1);\n        } else if (positiveMultiplier > 0) {\n          multiplier = +multiplier.toFixed(2);\n        }\n      }\n      clockViewModel.multiplier = multiplier;\n    },\n  });\n\n  this._canAnimate = undefined;\n  knockout.defineProperty(this, \"_canAnimate\", function () {\n    const clockViewModel = that._clockViewModel;\n    const clockRange = clockViewModel.clockRange;\n\n    if (that.shuttleRingDragging || clockRange === ClockRange.UNBOUNDED) {\n      return true;\n    }\n\n    const multiplier = clockViewModel.multiplier;\n    const currentTime = clockViewModel.currentTime;\n    const startTime = clockViewModel.startTime;\n\n    let result = false;\n    if (clockRange === ClockRange.LOOP_STOP) {\n      result =\n        JulianDate.greaterThan(currentTime, startTime) ||\n        (currentTime.equals(startTime) && multiplier > 0);\n    } else {\n      const stopTime = clockViewModel.stopTime;\n      result =\n        (JulianDate.greaterThan(currentTime, startTime) &&\n          JulianDate.lessThan(currentTime, stopTime)) || //\n        (currentTime.equals(startTime) && multiplier > 0) || //\n        (currentTime.equals(stopTime) && multiplier < 0);\n    }\n\n    if (!result) {\n      clockViewModel.shouldAnimate = false;\n    }\n    return result;\n  });\n\n  this._isSystemTimeAvailable = undefined;\n  knockout.defineProperty(this, \"_isSystemTimeAvailable\", function () {\n    const clockViewModel = that._clockViewModel;\n    const clockRange = clockViewModel.clockRange;\n    if (clockRange === ClockRange.UNBOUNDED) {\n      return true;\n    }\n\n    const systemTime = clockViewModel.systemTime;\n    return (\n      JulianDate.greaterThanOrEquals(systemTime, clockViewModel.startTime) &&\n      JulianDate.lessThanOrEquals(systemTime, clockViewModel.stopTime)\n    );\n  });\n\n  this._isAnimating = undefined;\n  knockout.defineProperty(this, \"_isAnimating\", function () {\n    return (\n      that._clockViewModel.shouldAnimate &&\n      (that._canAnimate || that.shuttleRingDragging)\n    );\n  });\n\n  const pauseCommand = createCommand(function () {\n    const clockViewModel = that._clockViewModel;\n    if (clockViewModel.shouldAnimate) {\n      clockViewModel.shouldAnimate = false;\n    } else if (that._canAnimate) {\n      clockViewModel.shouldAnimate = true;\n    }\n  });\n\n  this._pauseViewModel = new ToggleButtonViewModel(pauseCommand, {\n    toggled: knockout.computed(function () {\n      return !that._isAnimating;\n    }),\n    tooltip: \"Pause\",\n  });\n\n  const playReverseCommand = createCommand(function () {\n    const clockViewModel = that._clockViewModel;\n    const multiplier = clockViewModel.multiplier;\n    if (multiplier > 0) {\n      clockViewModel.multiplier = -multiplier;\n    }\n    clockViewModel.shouldAnimate = true;\n  });\n\n  this._playReverseViewModel = new ToggleButtonViewModel(playReverseCommand, {\n    toggled: knockout.computed(function () {\n      return that._isAnimating && clockViewModel.multiplier < 0;\n    }),\n    tooltip: \"Play Reverse\",\n  });\n\n  const playForwardCommand = createCommand(function () {\n    const clockViewModel = that._clockViewModel;\n    const multiplier = clockViewModel.multiplier;\n    if (multiplier < 0) {\n      clockViewModel.multiplier = -multiplier;\n    }\n    clockViewModel.shouldAnimate = true;\n  });\n\n  this._playForwardViewModel = new ToggleButtonViewModel(playForwardCommand, {\n    toggled: knockout.computed(function () {\n      return (\n        that._isAnimating &&\n        clockViewModel.multiplier > 0 &&\n        clockViewModel.clockStep !== ClockStep.SYSTEM_CLOCK\n      );\n    }),\n    tooltip: \"Play Forward\",\n  });\n\n  const playRealtimeCommand = createCommand(function () {\n    that._clockViewModel.clockStep = ClockStep.SYSTEM_CLOCK;\n  }, knockout.getObservable(this, \"_isSystemTimeAvailable\"));\n\n  this._playRealtimeViewModel = new ToggleButtonViewModel(playRealtimeCommand, {\n    toggled: knockout.computed(function () {\n      return clockViewModel.clockStep === ClockStep.SYSTEM_CLOCK;\n    }),\n    tooltip: knockout.computed(function () {\n      return that._isSystemTimeAvailable\n        ? \"Today (real-time)\"\n        : \"Current time not in range\";\n    }),\n  });\n\n  this._slower = createCommand(function () {\n    const clockViewModel = that._clockViewModel;\n    const shuttleRingTicks = that._allShuttleRingTicks;\n    const multiplier = clockViewModel.multiplier;\n    const index = getTypicalMultiplierIndex(multiplier, shuttleRingTicks) - 1;\n    if (index >= 0) {\n      clockViewModel.multiplier = shuttleRingTicks[index];\n    }\n  });\n\n  this._faster = createCommand(function () {\n    const clockViewModel = that._clockViewModel;\n    const shuttleRingTicks = that._allShuttleRingTicks;\n    const multiplier = clockViewModel.multiplier;\n    const index = getTypicalMultiplierIndex(multiplier, shuttleRingTicks) + 1;\n    if (index < shuttleRingTicks.length) {\n      clockViewModel.multiplier = shuttleRingTicks[index];\n    }\n  });\n}\n\n/**\n * Gets or sets the default date formatter used by new instances.\n *\n * @member\n * @type {AnimationViewModel.DateFormatter}\n */\nAnimationViewModel.defaultDateFormatter = function (date, viewModel) {\n  const gregorianDate = JulianDate.toGregorianDate(date);\n  return `${monthNames[gregorianDate.month - 1]} ${gregorianDate.day} ${\n    gregorianDate.year\n  }`;\n};\n\n/**\n * Gets or sets the default array of known clock multipliers associated with new instances of the shuttle ring.\n * @type {number[]}\n */\nAnimationViewModel.defaultTicks = [\n  //\n  0.001,\n  0.002,\n  0.005,\n  0.01,\n  0.02,\n  0.05,\n  0.1,\n  0.25,\n  0.5,\n  1.0,\n  2.0,\n  5.0,\n  10.0, //\n  15.0,\n  30.0,\n  60.0,\n  120.0,\n  300.0,\n  600.0,\n  900.0,\n  1800.0,\n  3600.0,\n  7200.0,\n  14400.0, //\n  21600.0,\n  43200.0,\n  86400.0,\n  172800.0,\n  345600.0,\n  604800.0,\n];\n\n/**\n * Gets or sets the default time formatter used by new instances.\n *\n * @member\n * @type {AnimationViewModel.TimeFormatter}\n */\nAnimationViewModel.defaultTimeFormatter = function (date, viewModel) {\n  const gregorianDate = JulianDate.toGregorianDate(date);\n  const millisecond = Math.round(gregorianDate.millisecond);\n  if (Math.abs(viewModel._clockViewModel.multiplier) < 1) {\n    return `${gregorianDate.hour\n      .toString()\n      .padStart(2, \"0\")}:${gregorianDate.minute\n      .toString()\n      .padStart(2, \"0\")}:${gregorianDate.second\n      .toString()\n      .padStart(2, \"0\")}.${millisecond.toString().padStart(3, \"0\")}`;\n  }\n  return `${gregorianDate.hour\n    .toString()\n    .padStart(2, \"0\")}:${gregorianDate.minute\n    .toString()\n    .padStart(2, \"0\")}:${gregorianDate.second.toString().padStart(2, \"0\")} UTC`;\n};\n\n/**\n * Gets a copy of the array of positive known clock multipliers to associate with the shuttle ring.\n *\n * @returns {number[]} The array of known clock multipliers associated with the shuttle ring.\n */\nAnimationViewModel.prototype.getShuttleRingTicks = function () {\n  return this._sortedFilteredPositiveTicks.slice(0);\n};\n\n/**\n * Sets the array of positive known clock multipliers to associate with the shuttle ring.\n * These values will have negative equivalents created for them and sets both the minimum\n * and maximum range of values for the shuttle ring as well as the values that are snapped\n * to when a single click is made.  The values need not be in order, as they will be sorted\n * automatically, and duplicate values will be removed.\n *\n * @param {number[]} positiveTicks The list of known positive clock multipliers to associate with the shuttle ring.\n */\nAnimationViewModel.prototype.setShuttleRingTicks = function (positiveTicks) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(positiveTicks)) {\n    throw new DeveloperError(\"positiveTicks is required.\");\n  }\n  //>>includeEnd('debug');\n\n  let i;\n  let len;\n  let tick;\n\n  const hash = {};\n  const sortedFilteredPositiveTicks = this._sortedFilteredPositiveTicks;\n  sortedFilteredPositiveTicks.length = 0;\n  for (i = 0, len = positiveTicks.length; i < len; ++i) {\n    tick = positiveTicks[i];\n    //filter duplicates\n    if (!hash.hasOwnProperty(tick)) {\n      hash[tick] = true;\n      sortedFilteredPositiveTicks.push(tick);\n    }\n  }\n  sortedFilteredPositiveTicks.sort(numberComparator);\n\n  const allTicks = [];\n  for (len = sortedFilteredPositiveTicks.length, i = len - 1; i >= 0; --i) {\n    tick = sortedFilteredPositiveTicks[i];\n    if (tick !== 0) {\n      allTicks.push(-tick);\n    }\n  }\n  Array.prototype.push.apply(allTicks, sortedFilteredPositiveTicks);\n\n  this._allShuttleRingTicks = allTicks;\n};\n\nObject.defineProperties(AnimationViewModel.prototype, {\n  /**\n   * Gets a command that decreases the speed of animation.\n   * @memberof AnimationViewModel.prototype\n   * @type {Command}\n   */\n  slower: {\n    get: function () {\n      return this._slower;\n    },\n  },\n\n  /**\n   * Gets a command that increases the speed of animation.\n   * @memberof AnimationViewModel.prototype\n   * @type {Command}\n   */\n  faster: {\n    get: function () {\n      return this._faster;\n    },\n  },\n\n  /**\n   * Gets the clock view model.\n   * @memberof AnimationViewModel.prototype\n   *\n   * @type {ClockViewModel}\n   */\n  clockViewModel: {\n    get: function () {\n      return this._clockViewModel;\n    },\n  },\n\n  /**\n   * Gets the pause toggle button view model.\n   * @memberof AnimationViewModel.prototype\n   *\n   * @type {ToggleButtonViewModel}\n   */\n  pauseViewModel: {\n    get: function () {\n      return this._pauseViewModel;\n    },\n  },\n\n  /**\n   * Gets the reverse toggle button view model.\n   * @memberof AnimationViewModel.prototype\n   *\n   * @type {ToggleButtonViewModel}\n   */\n  playReverseViewModel: {\n    get: function () {\n      return this._playReverseViewModel;\n    },\n  },\n\n  /**\n   * Gets the play toggle button view model.\n   * @memberof AnimationViewModel.prototype\n   *\n   * @type {ToggleButtonViewModel}\n   */\n  playForwardViewModel: {\n    get: function () {\n      return this._playForwardViewModel;\n    },\n  },\n\n  /**\n   * Gets the realtime toggle button view model.\n   * @memberof AnimationViewModel.prototype\n   *\n   * @type {ToggleButtonViewModel}\n   */\n  playRealtimeViewModel: {\n    get: function () {\n      return this._playRealtimeViewModel;\n    },\n  },\n\n  /**\n   * Gets or sets the function which formats a date for display.\n   * @memberof AnimationViewModel.prototype\n   *\n   * @type {AnimationViewModel.DateFormatter}\n   * @default AnimationViewModel.defaultDateFormatter\n   */\n  dateFormatter: {\n    //TODO:@exception {DeveloperError} dateFormatter must be a function.\n    get: function () {\n      return this._dateFormatter;\n    },\n    set: function (dateFormatter) {\n      //>>includeStart('debug', pragmas.debug);\n      if (typeof dateFormatter !== \"function\") {\n        throw new DeveloperError(\"dateFormatter must be a function\");\n      }\n      //>>includeEnd('debug');\n\n      this._dateFormatter = dateFormatter;\n    },\n  },\n\n  /**\n   * Gets or sets the function which formats a time for display.\n   * @memberof AnimationViewModel.prototype\n   *\n   * @type {AnimationViewModel.TimeFormatter}\n   * @default AnimationViewModel.defaultTimeFormatter\n   */\n  timeFormatter: {\n    //TODO:@exception {DeveloperError} timeFormatter must be a function.\n    get: function () {\n      return this._timeFormatter;\n    },\n    set: function (timeFormatter) {\n      //>>includeStart('debug', pragmas.debug);\n      if (typeof timeFormatter !== \"function\") {\n        throw new DeveloperError(\"timeFormatter must be a function\");\n      }\n      //>>includeEnd('debug');\n\n      this._timeFormatter = timeFormatter;\n    },\n  },\n});\n\n//Currently exposed for tests.\nAnimationViewModel._maxShuttleRingAngle = maxShuttleRingAngle;\nAnimationViewModel._realtimeShuttleRingAngle = realtimeShuttleRingAngle;\n\n/**\n * A function that formats a date for display.\n * @callback AnimationViewModel.DateFormatter\n *\n * @param {JulianDate} date The date to be formatted\n * @param {AnimationViewModel} viewModel The AnimationViewModel instance requesting formatting.\n * @returns {string} The string representation of the calendar date portion of the provided date.\n */\n\n/**\n * A function that formats a time for display.\n * @callback AnimationViewModel.TimeFormatter\n *\n * @param {JulianDate} date The date to be formatted\n * @param {AnimationViewModel} viewModel The AnimationViewModel instance requesting formatting.\n * @returns {string} The string representation of the time portion of the provided date.\n */\nexport default AnimationViewModel;\n", "import {\n  Cartesian3,\n  defined,\n  destroyObject,\n  DebugModelMatrixPrimitive,\n  DeveloperError,\n  PerformanceDisplay,\n  Ray,\n  Rectangle,\n  ScreenSpaceEventHandler,\n  ScreenSpaceEventType,\n  TileCoordinatesImageryProvider,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\nfunction frustumStatisticsToString(statistics) {\n  let str;\n  if (defined(statistics)) {\n    str = \"Command Statistics\";\n    const com = statistics.commandsInFrustums;\n    for (const n in com) {\n      if (com.hasOwnProperty(n)) {\n        let num = parseInt(n, 10);\n        let s;\n        if (num === 7) {\n          s = \"1, 2 and 3\";\n        } else {\n          const f = [];\n          for (let i = 2; i >= 0; i--) {\n            const p = Math.pow(2, i);\n            if (num >= p) {\n              f.push(i + 1);\n              num -= p;\n            }\n          }\n          s = f.reverse().join(\" and \");\n        }\n        str += `<br>&nbsp;&nbsp;&nbsp;&nbsp;${com[n]} in frustum ${s}`;\n      }\n    }\n    str += `<br>Total: ${statistics.totalCommands}`;\n  }\n\n  return str;\n}\n\nfunction boundDepthFrustum(lower, upper, proposed) {\n  let bounded = Math.min(proposed, upper);\n  bounded = Math.max(bounded, lower);\n  return bounded;\n}\n\nconst scratchPickRay = new Ray();\nconst scratchPickCartesian = new Cartesian3();\n\n/**\n * The view model for {@link CesiumInspector}.\n * @alias CesiumInspectorViewModel\n * @constructor\n *\n * @param {Scene} scene The scene instance to use.\n * @param {Element} performanceContainer The instance to use for performance container.\n */\nfunction CesiumInspectorViewModel(scene, performanceContainer) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required\");\n  }\n\n  if (!defined(performanceContainer)) {\n    throw new DeveloperError(\"performanceContainer is required\");\n  }\n  //>>includeEnd('debug');\n\n  const that = this;\n  const canvas = scene.canvas;\n  const eventHandler = new ScreenSpaceEventHandler(canvas);\n  this._eventHandler = eventHandler;\n  this._scene = scene;\n  this._canvas = canvas;\n  this._primitive = undefined;\n  this._tile = undefined;\n  this._modelMatrixPrimitive = undefined;\n  this._performanceDisplay = undefined;\n  this._performanceContainer = performanceContainer;\n\n  const globe = this._scene.globe;\n  globe.depthTestAgainstTerrain = true;\n\n  /**\n   * Gets or sets the show frustums state.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.frustums = false;\n\n  /**\n   * Gets or sets the show frustum planes state.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.frustumPlanes = false;\n\n  /**\n   * Gets or sets the show performance display state.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.performance = false;\n\n  /**\n   * Gets or sets the shader cache text.  This property is observable.\n   * @type {string}\n   * @default ''\n   */\n  this.shaderCacheText = \"\";\n\n  /**\n   * Gets or sets the show primitive bounding sphere state.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.primitiveBoundingSphere = false;\n\n  /**\n   * Gets or sets the show primitive reference frame state.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.primitiveReferenceFrame = false;\n\n  /**\n   * Gets or sets the filter primitive state.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.filterPrimitive = false;\n\n  /**\n   * Gets or sets the show tile bounding sphere state.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.tileBoundingSphere = false;\n\n  /**\n   * Gets or sets the filter tile state.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.filterTile = false;\n\n  /**\n   * Gets or sets the show wireframe state.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.wireframe = false;\n\n  /**\n   * Gets or sets the index of the depth frustum to display.  This property is observable.\n   * @type {number}\n   * @default 1\n   */\n  this.depthFrustum = 1;\n  this._numberOfFrustums = 1;\n\n  /**\n   * Gets or sets the suspend updates state.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.suspendUpdates = false;\n\n  /**\n   * Gets or sets the show tile coordinates state.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.tileCoordinates = false;\n\n  /**\n   * Gets or sets the frustum statistic text.  This property is observable.\n   * @type {string}\n   * @default ''\n   */\n  this.frustumStatisticText = false;\n\n  /**\n   * Gets or sets the selected tile information text.  This property is observable.\n   * @type {string}\n   * @default ''\n   */\n  this.tileText = \"\";\n\n  /**\n   * Gets if a primitive has been selected.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.hasPickedPrimitive = false;\n\n  /**\n   * Gets if a tile has been selected.  This property is observable\n   * @type {boolean}\n   * @default false\n   */\n  this.hasPickedTile = false;\n\n  /**\n   * Gets if the picking primitive command is active.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.pickPrimitiveActive = false;\n\n  /**\n   * Gets if the picking tile command is active.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.pickTileActive = false;\n\n  /**\n   * Gets or sets if the cesium inspector drop down is visible.  This property is observable.\n   * @type {boolean}\n   * @default true\n   */\n  this.dropDownVisible = true;\n\n  /**\n   * Gets or sets if the general section is visible.  This property is observable.\n   * @type {boolean}\n   * @default true\n   */\n  this.generalVisible = true;\n\n  /**\n   * Gets or sets if the primitive section is visible.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.primitivesVisible = false;\n\n  /**\n   * Gets or sets if the terrain section is visible.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.terrainVisible = false;\n\n  /**\n   * Gets or sets the index of the depth frustum text.  This property is observable.\n   * @type {string}\n   * @default ''\n   */\n  this.depthFrustumText = \"\";\n\n  knockout.track(this, [\n    \"frustums\",\n    \"frustumPlanes\",\n    \"performance\",\n    \"shaderCacheText\",\n    \"primitiveBoundingSphere\",\n    \"primitiveReferenceFrame\",\n    \"filterPrimitive\",\n    \"tileBoundingSphere\",\n    \"filterTile\",\n    \"wireframe\",\n    \"depthFrustum\",\n    \"suspendUpdates\",\n    \"tileCoordinates\",\n    \"frustumStatisticText\",\n    \"tileText\",\n    \"hasPickedPrimitive\",\n    \"hasPickedTile\",\n    \"pickPrimitiveActive\",\n    \"pickTileActive\",\n    \"dropDownVisible\",\n    \"generalVisible\",\n    \"primitivesVisible\",\n    \"terrainVisible\",\n    \"depthFrustumText\",\n  ]);\n\n  this._toggleDropDown = createCommand(function () {\n    that.dropDownVisible = !that.dropDownVisible;\n  });\n\n  this._toggleGeneral = createCommand(function () {\n    that.generalVisible = !that.generalVisible;\n  });\n\n  this._togglePrimitives = createCommand(function () {\n    that.primitivesVisible = !that.primitivesVisible;\n  });\n\n  this._toggleTerrain = createCommand(function () {\n    that.terrainVisible = !that.terrainVisible;\n  });\n\n  this._frustumsSubscription = knockout\n    .getObservable(this, \"frustums\")\n    .subscribe(function (val) {\n      that._scene.debugShowFrustums = val;\n      that._scene.requestRender();\n    });\n\n  this._frustumPlanesSubscription = knockout\n    .getObservable(this, \"frustumPlanes\")\n    .subscribe(function (val) {\n      that._scene.debugShowFrustumPlanes = val;\n      that._scene.requestRender();\n    });\n\n  this._performanceSubscription = knockout\n    .getObservable(this, \"performance\")\n    .subscribe(function (val) {\n      if (val) {\n        that._performanceDisplay = new PerformanceDisplay({\n          container: that._performanceContainer,\n        });\n      } else {\n        that._performanceContainer.innerHTML = \"\";\n      }\n    });\n\n  this._showPrimitiveBoundingSphere = createCommand(function () {\n    that._primitive.debugShowBoundingVolume = that.primitiveBoundingSphere;\n    that._scene.requestRender();\n    return true;\n  });\n\n  this._primitiveBoundingSphereSubscription = knockout\n    .getObservable(this, \"primitiveBoundingSphere\")\n    .subscribe(function () {\n      that._showPrimitiveBoundingSphere();\n    });\n\n  this._showPrimitiveReferenceFrame = createCommand(function () {\n    if (that.primitiveReferenceFrame) {\n      const modelMatrix = that._primitive.modelMatrix;\n      that._modelMatrixPrimitive = new DebugModelMatrixPrimitive({\n        modelMatrix: modelMatrix,\n      });\n      that._scene.primitives.add(that._modelMatrixPrimitive);\n    } else if (defined(that._modelMatrixPrimitive)) {\n      that._scene.primitives.remove(that._modelMatrixPrimitive);\n      that._modelMatrixPrimitive = undefined;\n    }\n    that._scene.requestRender();\n    return true;\n  });\n\n  this._primitiveReferenceFrameSubscription = knockout\n    .getObservable(this, \"primitiveReferenceFrame\")\n    .subscribe(function () {\n      that._showPrimitiveReferenceFrame();\n    });\n\n  this._doFilterPrimitive = createCommand(function () {\n    if (that.filterPrimitive) {\n      that._scene.debugCommandFilter = function (command) {\n        if (\n          defined(that._modelMatrixPrimitive) &&\n          command.owner === that._modelMatrixPrimitive._primitive\n        ) {\n          return true;\n        } else if (defined(that._primitive)) {\n          return (\n            command.owner === that._primitive ||\n            command.owner === that._primitive._billboardCollection ||\n            command.owner.primitive === that._primitive\n          );\n        }\n        return false;\n      };\n    } else {\n      that._scene.debugCommandFilter = undefined;\n    }\n    return true;\n  });\n\n  this._filterPrimitiveSubscription = knockout\n    .getObservable(this, \"filterPrimitive\")\n    .subscribe(function () {\n      that._doFilterPrimitive();\n      that._scene.requestRender();\n    });\n\n  this._wireframeSubscription = knockout\n    .getObservable(this, \"wireframe\")\n    .subscribe(function (val) {\n      globe._surface.tileProvider._debug.wireframe = val;\n      that._scene.requestRender();\n    });\n\n  this._depthFrustumSubscription = knockout\n    .getObservable(this, \"depthFrustum\")\n    .subscribe(function (val) {\n      that._scene.debugShowDepthFrustum = val;\n      that._scene.requestRender();\n    });\n\n  this._incrementDepthFrustum = createCommand(function () {\n    const next = that.depthFrustum + 1;\n    that.depthFrustum = boundDepthFrustum(1, that._numberOfFrustums, next);\n    that._scene.requestRender();\n    return true;\n  });\n\n  this._decrementDepthFrustum = createCommand(function () {\n    const next = that.depthFrustum - 1;\n    that.depthFrustum = boundDepthFrustum(1, that._numberOfFrustums, next);\n    that._scene.requestRender();\n    return true;\n  });\n\n  this._suspendUpdatesSubscription = knockout\n    .getObservable(this, \"suspendUpdates\")\n    .subscribe(function (val) {\n      globe._surface._debug.suspendLodUpdate = val;\n      if (!val) {\n        that.filterTile = false;\n      }\n    });\n\n  let tileBoundariesLayer;\n  this._showTileCoordinates = createCommand(function () {\n    if (that.tileCoordinates && !defined(tileBoundariesLayer)) {\n      tileBoundariesLayer = scene.imageryLayers.addImageryProvider(\n        new TileCoordinatesImageryProvider({\n          tilingScheme: scene.terrainProvider.tilingScheme,\n        })\n      );\n    } else if (!that.tileCoordinates && defined(tileBoundariesLayer)) {\n      scene.imageryLayers.remove(tileBoundariesLayer);\n      tileBoundariesLayer = undefined;\n    }\n    return true;\n  });\n\n  this._tileCoordinatesSubscription = knockout\n    .getObservable(this, \"tileCoordinates\")\n    .subscribe(function () {\n      that._showTileCoordinates();\n      that._scene.requestRender();\n    });\n\n  this._tileBoundingSphereSubscription = knockout\n    .getObservable(this, \"tileBoundingSphere\")\n    .subscribe(function () {\n      that._showTileBoundingSphere();\n      that._scene.requestRender();\n    });\n\n  this._showTileBoundingSphere = createCommand(function () {\n    if (that.tileBoundingSphere) {\n      globe._surface.tileProvider._debug.boundingSphereTile = that._tile;\n    } else {\n      globe._surface.tileProvider._debug.boundingSphereTile = undefined;\n    }\n    that._scene.requestRender();\n    return true;\n  });\n\n  this._doFilterTile = createCommand(function () {\n    if (!that.filterTile) {\n      that.suspendUpdates = false;\n    } else {\n      that.suspendUpdates = true;\n\n      globe._surface._tilesToRender = [];\n\n      if (defined(that._tile) && that._tile.renderable) {\n        globe._surface._tilesToRender.push(that._tile);\n      }\n    }\n    return true;\n  });\n\n  this._filterTileSubscription = knockout\n    .getObservable(this, \"filterTile\")\n    .subscribe(function () {\n      that.doFilterTile();\n      that._scene.requestRender();\n    });\n\n  function pickPrimitive(e) {\n    const newPick = that._scene.pick({\n      x: e.position.x,\n      y: e.position.y,\n    });\n    if (defined(newPick)) {\n      that.primitive = defined(newPick.collection)\n        ? newPick.collection\n        : newPick.primitive;\n    }\n\n    that._scene.requestRender();\n    that.pickPrimitiveActive = false;\n  }\n\n  this._pickPrimitive = createCommand(function () {\n    that.pickPrimitiveActive = !that.pickPrimitiveActive;\n  });\n\n  this._pickPrimitiveActiveSubscription = knockout\n    .getObservable(this, \"pickPrimitiveActive\")\n    .subscribe(function (val) {\n      if (val) {\n        eventHandler.setInputAction(\n          pickPrimitive,\n          ScreenSpaceEventType.LEFT_CLICK\n        );\n      } else {\n        eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK);\n      }\n    });\n\n  function selectTile(e) {\n    let selectedTile;\n    const ellipsoid = globe.ellipsoid;\n\n    const ray = that._scene.camera.getPickRay(e.position, scratchPickRay);\n    const cartesian = globe.pick(ray, that._scene, scratchPickCartesian);\n\n    if (defined(cartesian)) {\n      const cartographic = ellipsoid.cartesianToCartographic(cartesian);\n      const tilesRendered =\n        globe._surface.tileProvider._tilesToRenderByTextureCount;\n      for (\n        let textureCount = 0;\n        !selectedTile && textureCount < tilesRendered.length;\n        ++textureCount\n      ) {\n        const tilesRenderedByTextureCount = tilesRendered[textureCount];\n        if (!defined(tilesRenderedByTextureCount)) {\n          continue;\n        }\n\n        for (\n          let tileIndex = 0;\n          !selectedTile && tileIndex < tilesRenderedByTextureCount.length;\n          ++tileIndex\n        ) {\n          const tile = tilesRenderedByTextureCount[tileIndex];\n          if (Rectangle.contains(tile.rectangle, cartographic)) {\n            selectedTile = tile;\n          }\n        }\n      }\n    }\n\n    that.tile = selectedTile;\n\n    that.pickTileActive = false;\n  }\n\n  this._pickTile = createCommand(function () {\n    that.pickTileActive = !that.pickTileActive;\n  });\n\n  this._pickTileActiveSubscription = knockout\n    .getObservable(this, \"pickTileActive\")\n    .subscribe(function (val) {\n      if (val) {\n        eventHandler.setInputAction(\n          selectTile,\n          ScreenSpaceEventType.LEFT_CLICK\n        );\n      } else {\n        eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK);\n      }\n    });\n\n  this._removePostRenderEvent = scene.postRender.addEventListener(function () {\n    that._update();\n  });\n}\n\nObject.defineProperties(CesiumInspectorViewModel.prototype, {\n  /**\n   * Gets the scene to control.\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Scene}\n   */\n  scene: {\n    get: function () {\n      return this._scene;\n    },\n  },\n\n  /**\n   * Gets the container of the PerformanceDisplay\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Element}\n   */\n  performanceContainer: {\n    get: function () {\n      return this._performanceContainer;\n    },\n  },\n\n  /**\n   * Gets the command to toggle the visibility of the drop down.\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  toggleDropDown: {\n    get: function () {\n      return this._toggleDropDown;\n    },\n  },\n\n  /**\n   * Gets the command to toggle the visibility of a BoundingSphere for a primitive\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  showPrimitiveBoundingSphere: {\n    get: function () {\n      return this._showPrimitiveBoundingSphere;\n    },\n  },\n\n  /**\n   * Gets the command to toggle the visibility of a {@link DebugModelMatrixPrimitive} for the model matrix of a primitive\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  showPrimitiveReferenceFrame: {\n    get: function () {\n      return this._showPrimitiveReferenceFrame;\n    },\n  },\n\n  /**\n   * Gets the command to toggle a filter that renders only a selected primitive\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  doFilterPrimitive: {\n    get: function () {\n      return this._doFilterPrimitive;\n    },\n  },\n\n  /**\n   * Gets the command to increment the depth frustum index to be shown\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  incrementDepthFrustum: {\n    get: function () {\n      return this._incrementDepthFrustum;\n    },\n  },\n\n  /**\n   * Gets the command to decrement the depth frustum index to be shown\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  decrementDepthFrustum: {\n    get: function () {\n      return this._decrementDepthFrustum;\n    },\n  },\n\n  /**\n   * Gets the command to toggle the visibility of tile coordinates\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  showTileCoordinates: {\n    get: function () {\n      return this._showTileCoordinates;\n    },\n  },\n\n  /**\n   * Gets the command to toggle the visibility of a BoundingSphere for a selected tile\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  showTileBoundingSphere: {\n    get: function () {\n      return this._showTileBoundingSphere;\n    },\n  },\n\n  /**\n   * Gets the command to toggle a filter that renders only a selected tile\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  doFilterTile: {\n    get: function () {\n      return this._doFilterTile;\n    },\n  },\n\n  /**\n   * Gets the command to expand and collapse the general section\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  toggleGeneral: {\n    get: function () {\n      return this._toggleGeneral;\n    },\n  },\n\n  /**\n   * Gets the command to expand and collapse the primitives section\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  togglePrimitives: {\n    get: function () {\n      return this._togglePrimitives;\n    },\n  },\n\n  /**\n   * Gets the command to expand and collapse the terrain section\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  toggleTerrain: {\n    get: function () {\n      return this._toggleTerrain;\n    },\n  },\n\n  /**\n   * Gets the command to pick a primitive\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  pickPrimitive: {\n    get: function () {\n      return this._pickPrimitive;\n    },\n  },\n\n  /**\n   * Gets the command to pick a tile\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  pickTile: {\n    get: function () {\n      return this._pickTile;\n    },\n  },\n\n  /**\n   * Gets the command to pick a tile\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  selectParent: {\n    get: function () {\n      const that = this;\n      return createCommand(function () {\n        that.tile = that.tile.parent;\n      });\n    },\n  },\n\n  /**\n   * Gets the command to pick a tile\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  selectNW: {\n    get: function () {\n      const that = this;\n      return createCommand(function () {\n        that.tile = that.tile.northwestChild;\n      });\n    },\n  },\n\n  /**\n   * Gets the command to pick a tile\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  selectNE: {\n    get: function () {\n      const that = this;\n      return createCommand(function () {\n        that.tile = that.tile.northeastChild;\n      });\n    },\n  },\n\n  /**\n   * Gets the command to pick a tile\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  selectSW: {\n    get: function () {\n      const that = this;\n      return createCommand(function () {\n        that.tile = that.tile.southwestChild;\n      });\n    },\n  },\n\n  /**\n   * Gets the command to pick a tile\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  selectSE: {\n    get: function () {\n      const that = this;\n      return createCommand(function () {\n        that.tile = that.tile.southeastChild;\n      });\n    },\n  },\n\n  /**\n   * Gets or sets the current selected primitive\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  primitive: {\n    get: function () {\n      return this._primitive;\n    },\n    set: function (newPrimitive) {\n      const oldPrimitive = this._primitive;\n      if (newPrimitive !== oldPrimitive) {\n        this.hasPickedPrimitive = true;\n        if (defined(oldPrimitive)) {\n          oldPrimitive.debugShowBoundingVolume = false;\n        }\n        this._scene.debugCommandFilter = undefined;\n        if (defined(this._modelMatrixPrimitive)) {\n          this._scene.primitives.remove(this._modelMatrixPrimitive);\n          this._modelMatrixPrimitive = undefined;\n        }\n        this._primitive = newPrimitive;\n        newPrimitive.show = false;\n        setTimeout(function () {\n          newPrimitive.show = true;\n        }, 50);\n        this.showPrimitiveBoundingSphere();\n        this.showPrimitiveReferenceFrame();\n        this.doFilterPrimitive();\n      }\n    },\n  },\n\n  /**\n   * Gets or sets the current selected tile\n   * @memberof CesiumInspectorViewModel.prototype\n   *\n   * @type {Command}\n   */\n  tile: {\n    get: function () {\n      return this._tile;\n    },\n    set: function (newTile) {\n      if (defined(newTile)) {\n        this.hasPickedTile = true;\n        const oldTile = this._tile;\n        if (newTile !== oldTile) {\n          this.tileText = `L: ${newTile.level} X: ${newTile.x} Y: ${newTile.y}`;\n          this.tileText += `<br>SW corner: ${newTile.rectangle.west}, ${newTile.rectangle.south}`;\n          this.tileText += `<br>NE corner: ${newTile.rectangle.east}, ${newTile.rectangle.north}`;\n          const data = newTile.data;\n          if (defined(data) && defined(data.tileBoundingRegion)) {\n            this.tileText += `<br>Min: ${data.tileBoundingRegion.minimumHeight} Max: ${data.tileBoundingRegion.maximumHeight}`;\n          } else {\n            this.tileText += \"<br>(Tile is not loaded)\";\n          }\n        }\n        this._tile = newTile;\n        this.showTileBoundingSphere();\n        this.doFilterTile();\n      } else {\n        this.hasPickedTile = false;\n        this._tile = undefined;\n      }\n    },\n  },\n});\n\n/**\n * Updates the view model\n * @private\n */\nCesiumInspectorViewModel.prototype._update = function () {\n  if (this.frustums) {\n    this.frustumStatisticText = frustumStatisticsToString(\n      this._scene.debugFrustumStatistics\n    );\n  }\n\n  // Determine the number of frustums being used.\n  const numberOfFrustums = this._scene.numberOfFrustums;\n  this._numberOfFrustums = numberOfFrustums;\n  // Bound the frustum to be displayed.\n  this.depthFrustum = boundDepthFrustum(1, numberOfFrustums, this.depthFrustum);\n  // Update the displayed text.\n  this.depthFrustumText = `${this.depthFrustum} of ${numberOfFrustums}`;\n\n  if (this.performance) {\n    this._performanceDisplay.update();\n  }\n  if (this.primitiveReferenceFrame) {\n    this._modelMatrixPrimitive.modelMatrix = this._primitive.modelMatrix;\n  }\n\n  this.shaderCacheText = `Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`;\n};\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nCesiumInspectorViewModel.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nCesiumInspectorViewModel.prototype.destroy = function () {\n  this._eventHandler.destroy();\n  this._removePostRenderEvent();\n  this._frustumsSubscription.dispose();\n  this._frustumPlanesSubscription.dispose();\n  this._performanceSubscription.dispose();\n  this._primitiveBoundingSphereSubscription.dispose();\n  this._primitiveReferenceFrameSubscription.dispose();\n  this._filterPrimitiveSubscription.dispose();\n  this._wireframeSubscription.dispose();\n  this._depthFrustumSubscription.dispose();\n  this._suspendUpdatesSubscription.dispose();\n  this._tileCoordinatesSubscription.dispose();\n  this._tileBoundingSphereSubscription.dispose();\n  this._filterTileSubscription.dispose();\n  this._pickPrimitiveActiveSubscription.dispose();\n  this._pickTileActiveSubscription.dispose();\n  return destroyObject(this);\n};\nexport default CesiumInspectorViewModel;\n", "import {\n  defined,\n  destroyObject,\n  DeveloperError,\n  getElement,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport InspectorShared from \"../InspectorShared.js\";\nimport CesiumInspectorViewModel from \"./CesiumInspectorViewModel.js\";\n\n/**\n * Inspector widget to aid in debugging\n *\n * @alias CesiumInspector\n * @constructor\n *\n * @param {Element|string} container The DOM element or ID that will contain the widget.\n * @param {Scene} scene The Scene instance to use.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Cesium%20Inspector.html|Cesium Sandcastle Cesium Inspector Demo}\n */\nfunction CesiumInspector(container, scene) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(container)) {\n    throw new DeveloperError(\"container is required.\");\n  }\n\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  container = getElement(container);\n\n  const performanceContainer = document.createElement(\"div\");\n\n  const viewModel = new CesiumInspectorViewModel(scene, performanceContainer);\n  this._viewModel = viewModel;\n  this._container = container;\n\n  const element = document.createElement(\"div\");\n  this._element = element;\n  const text = document.createElement(\"div\");\n  text.textContent = \"Cesium Inspector\";\n  text.className = \"cesium-cesiumInspector-button\";\n  text.setAttribute(\"data-bind\", \"click: toggleDropDown\");\n  element.appendChild(text);\n  element.className = \"cesium-cesiumInspector\";\n  element.setAttribute(\n    \"data-bind\",\n    'css: { \"cesium-cesiumInspector-visible\" : dropDownVisible, \"cesium-cesiumInspector-hidden\" : !dropDownVisible }'\n  );\n  container.appendChild(this._element);\n\n  const panel = document.createElement(\"div\");\n  panel.className = \"cesium-cesiumInspector-dropDown\";\n  element.appendChild(panel);\n\n  const createSection = InspectorShared.createSection;\n  const createCheckbox = InspectorShared.createCheckbox;\n\n  // General\n  const generalSection = createSection(\n    panel,\n    \"General\",\n    \"generalVisible\",\n    \"toggleGeneral\"\n  );\n\n  const debugShowFrustums = createCheckbox(\"Show Frustums\", \"frustums\");\n  const frustumStatistics = document.createElement(\"div\");\n  frustumStatistics.className = \"cesium-cesiumInspector-frustumStatistics\";\n  frustumStatistics.setAttribute(\n    \"data-bind\",\n    \"visible: frustums, html: frustumStatisticText\"\n  );\n  debugShowFrustums.appendChild(frustumStatistics);\n  generalSection.appendChild(debugShowFrustums);\n\n  generalSection.appendChild(\n    createCheckbox(\"Show Frustum Planes\", \"frustumPlanes\")\n  );\n  generalSection.appendChild(\n    createCheckbox(\"Performance Display\", \"performance\")\n  );\n\n  performanceContainer.className = \"cesium-cesiumInspector-performanceDisplay\";\n  generalSection.appendChild(performanceContainer);\n\n  const shaderCacheDisplay = document.createElement(\"div\");\n  shaderCacheDisplay.className = \"cesium-cesiumInspector-shaderCache\";\n  shaderCacheDisplay.setAttribute(\"data-bind\", \"html: shaderCacheText\");\n  generalSection.appendChild(shaderCacheDisplay);\n\n  const depthFrustum = document.createElement(\"div\");\n  generalSection.appendChild(depthFrustum);\n\n  // Use a span with HTML binding so that we can indent with non-breaking spaces.\n  const gLabel = document.createElement(\"span\");\n  gLabel.setAttribute(\n    \"data-bind\",\n    'html: \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:\"'\n  );\n  depthFrustum.appendChild(gLabel);\n\n  const gText = document.createElement(\"span\");\n  gText.setAttribute(\"data-bind\", \"text: depthFrustumText\");\n  depthFrustum.appendChild(gText);\n\n  const gMinusButton = document.createElement(\"input\");\n  gMinusButton.type = \"button\";\n  gMinusButton.value = \"-\";\n  gMinusButton.className = \"cesium-cesiumInspector-pickButton\";\n  gMinusButton.setAttribute(\"data-bind\", \"click: decrementDepthFrustum\");\n  depthFrustum.appendChild(gMinusButton);\n\n  const gPlusButton = document.createElement(\"input\");\n  gPlusButton.type = \"button\";\n  gPlusButton.value = \"+\";\n  gPlusButton.className = \"cesium-cesiumInspector-pickButton\";\n  gPlusButton.setAttribute(\"data-bind\", \"click: incrementDepthFrustum\");\n  depthFrustum.appendChild(gPlusButton);\n\n  // Primitives\n  const primSection = createSection(\n    panel,\n    \"Primitives\",\n    \"primitivesVisible\",\n    \"togglePrimitives\"\n  );\n  const pickPrimRequired = document.createElement(\"div\");\n  pickPrimRequired.className = \"cesium-cesiumInspector-pickSection\";\n  primSection.appendChild(pickPrimRequired);\n\n  const pickPrimitiveButton = document.createElement(\"input\");\n  pickPrimitiveButton.type = \"button\";\n  pickPrimitiveButton.value = \"Pick a primitive\";\n  pickPrimitiveButton.className = \"cesium-cesiumInspector-pickButton\";\n  pickPrimitiveButton.setAttribute(\n    \"data-bind\",\n    'css: {\"cesium-cesiumInspector-pickButtonHighlight\" : pickPrimitiveActive}, click: pickPrimitive'\n  );\n  let buttonWrap = document.createElement(\"div\");\n  buttonWrap.className = \"cesium-cesiumInspector-center\";\n  buttonWrap.appendChild(pickPrimitiveButton);\n  pickPrimRequired.appendChild(buttonWrap);\n\n  pickPrimRequired.appendChild(\n    createCheckbox(\n      \"Show bounding sphere\",\n      \"primitiveBoundingSphere\",\n      \"hasPickedPrimitive\"\n    )\n  );\n  pickPrimRequired.appendChild(\n    createCheckbox(\n      \"Show reference frame\",\n      \"primitiveReferenceFrame\",\n      \"hasPickedPrimitive\"\n    )\n  );\n\n  this._primitiveOnly = createCheckbox(\n    \"Show only selected\",\n    \"filterPrimitive\",\n    \"hasPickedPrimitive\"\n  );\n  pickPrimRequired.appendChild(this._primitiveOnly);\n\n  // Terrain\n  const terrainSection = createSection(\n    panel,\n    \"Terrain\",\n    \"terrainVisible\",\n    \"toggleTerrain\"\n  );\n  const pickTileRequired = document.createElement(\"div\");\n  pickTileRequired.className = \"cesium-cesiumInspector-pickSection\";\n  terrainSection.appendChild(pickTileRequired);\n  const pickTileButton = document.createElement(\"input\");\n  pickTileButton.type = \"button\";\n  pickTileButton.value = \"Pick a tile\";\n  pickTileButton.className = \"cesium-cesiumInspector-pickButton\";\n  pickTileButton.setAttribute(\n    \"data-bind\",\n    'css: {\"cesium-cesiumInspector-pickButtonHighlight\" : pickTileActive}, click: pickTile'\n  );\n  buttonWrap = document.createElement(\"div\");\n  buttonWrap.appendChild(pickTileButton);\n  buttonWrap.className = \"cesium-cesiumInspector-center\";\n  pickTileRequired.appendChild(buttonWrap);\n  const tileInfo = document.createElement(\"div\");\n  pickTileRequired.appendChild(tileInfo);\n  const parentTile = document.createElement(\"input\");\n  parentTile.type = \"button\";\n  parentTile.value = \"Parent\";\n  parentTile.className = \"cesium-cesiumInspector-pickButton\";\n  parentTile.setAttribute(\"data-bind\", \"click: selectParent\");\n  const nwTile = document.createElement(\"input\");\n  nwTile.type = \"button\";\n  nwTile.value = \"NW\";\n  nwTile.className = \"cesium-cesiumInspector-pickButton\";\n  nwTile.setAttribute(\"data-bind\", \"click: selectNW\");\n  const neTile = document.createElement(\"input\");\n  neTile.type = \"button\";\n  neTile.value = \"NE\";\n  neTile.className = \"cesium-cesiumInspector-pickButton\";\n  neTile.setAttribute(\"data-bind\", \"click: selectNE\");\n  const swTile = document.createElement(\"input\");\n  swTile.type = \"button\";\n  swTile.value = \"SW\";\n  swTile.className = \"cesium-cesiumInspector-pickButton\";\n  swTile.setAttribute(\"data-bind\", \"click: selectSW\");\n  const seTile = document.createElement(\"input\");\n  seTile.type = \"button\";\n  seTile.value = \"SE\";\n  seTile.className = \"cesium-cesiumInspector-pickButton\";\n  seTile.setAttribute(\"data-bind\", \"click: selectSE\");\n\n  const tileText = document.createElement(\"div\");\n  tileText.className = \"cesium-cesiumInspector-tileText\";\n  tileInfo.className = \"cesium-cesiumInspector-frustumStatistics\";\n  tileInfo.appendChild(tileText);\n  tileInfo.setAttribute(\"data-bind\", \"visible: hasPickedTile\");\n  tileText.setAttribute(\"data-bind\", \"html: tileText\");\n\n  const relativeText = document.createElement(\"div\");\n  relativeText.className = \"cesium-cesiumInspector-relativeText\";\n  relativeText.textContent = \"Select relative:\";\n  tileInfo.appendChild(relativeText);\n\n  const table = document.createElement(\"table\");\n  const tr1 = document.createElement(\"tr\");\n  const tr2 = document.createElement(\"tr\");\n  const td1 = document.createElement(\"td\");\n  td1.appendChild(parentTile);\n  const td2 = document.createElement(\"td\");\n  td2.appendChild(nwTile);\n  const td3 = document.createElement(\"td\");\n  td3.appendChild(neTile);\n  tr1.appendChild(td1);\n  tr1.appendChild(td2);\n  tr1.appendChild(td3);\n  const td4 = document.createElement(\"td\");\n  const td5 = document.createElement(\"td\");\n  td5.appendChild(swTile);\n  const td6 = document.createElement(\"td\");\n  td6.appendChild(seTile);\n  tr2.appendChild(td4);\n  tr2.appendChild(td5);\n  tr2.appendChild(td6);\n  table.appendChild(tr1);\n  table.appendChild(tr2);\n\n  tileInfo.appendChild(table);\n\n  pickTileRequired.appendChild(\n    createCheckbox(\n      \"Show bounding volume\",\n      \"tileBoundingSphere\",\n      \"hasPickedTile\"\n    )\n  );\n  pickTileRequired.appendChild(\n    createCheckbox(\"Show only selected\", \"filterTile\", \"hasPickedTile\")\n  );\n\n  terrainSection.appendChild(createCheckbox(\"Wireframe\", \"wireframe\"));\n  terrainSection.appendChild(\n    createCheckbox(\"Suspend LOD update\", \"suspendUpdates\")\n  );\n  terrainSection.appendChild(\n    createCheckbox(\"Show tile coordinates\", \"tileCoordinates\")\n  );\n\n  knockout.applyBindings(viewModel, this._element);\n}\n\nObject.defineProperties(CesiumInspector.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof CesiumInspector.prototype\n   *\n   * @type {Element}\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the view model.\n   * @memberof CesiumInspector.prototype\n   *\n   * @type {CesiumInspectorViewModel}\n   */\n  viewModel: {\n    get: function () {\n      return this._viewModel;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nCesiumInspector.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nCesiumInspector.prototype.destroy = function () {\n  knockout.cleanNode(this._element);\n  this._container.removeChild(this._element);\n  this.viewModel.destroy();\n\n  return destroyObject(this);\n};\nexport default CesiumInspector;\n", "import {\n  Check,\n  Color,\n  defined,\n  destroyObject,\n  Cesium3DTileColorBlendMode,\n  Cesium3DTileFeature,\n  Cesium3DTilePass,\n  Cesium3DTileset,\n  Cesium3DTileStyle,\n  PerformanceDisplay,\n  ResourceCache,\n  ScreenSpaceEventHandler,\n  ScreenSpaceEventType,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\n\nfunction getPickTileset(viewModel) {\n  return function (e) {\n    const pick = viewModel._scene.pick(e.position);\n    if (defined(pick) && pick.primitive instanceof Cesium3DTileset) {\n      viewModel.tileset = pick.primitive;\n    }\n    viewModel.pickActive = false;\n  };\n}\n\nfunction selectTilesetOnHover(viewModel, value) {\n  if (value) {\n    viewModel._eventHandler.setInputAction(function (e) {\n      const pick = viewModel._scene.pick(e.endPosition);\n      if (defined(pick) && pick.primitive instanceof Cesium3DTileset) {\n        viewModel.tileset = pick.primitive;\n      }\n    }, ScreenSpaceEventType.MOUSE_MOVE);\n  } else {\n    viewModel._eventHandler.removeInputAction(ScreenSpaceEventType.MOUSE_MOVE);\n\n    // Restore hover-over selection to its current value\n    // eslint-disable-next-line no-self-assign\n    viewModel.picking = viewModel.picking;\n  }\n}\n\nconst stringOptions = {\n  maximumFractionDigits: 3,\n};\n\nfunction formatMemoryString(memorySizeInBytes) {\n  const memoryInMegabytes = memorySizeInBytes / 1048576;\n  if (memoryInMegabytes < 1.0) {\n    return memoryInMegabytes.toLocaleString(undefined, stringOptions);\n  }\n  return Math.round(memoryInMegabytes).toLocaleString();\n}\n\nfunction getStatistics(tileset, isPick) {\n  if (!defined(tileset)) {\n    return \"\";\n  }\n\n  const statistics = isPick\n    ? tileset._statisticsPerPass[Cesium3DTilePass.PICK]\n    : tileset._statisticsPerPass[Cesium3DTilePass.RENDER];\n\n  // Since the pick pass uses a smaller frustum around the pixel of interest,\n  // the statistics will be different than the normal render pass.\n  let s = '<ul class=\"cesium-cesiumInspector-statistics\">';\n  s +=\n    // --- Rendering statistics\n    `<li><strong>Visited: </strong>${statistics.visited.toLocaleString()}</li>` +\n    // Number of commands returned is likely to be higher than the number of tiles selected\n    // because of tiles that create multiple commands.\n    `<li><strong>Selected: </strong>${statistics.selected.toLocaleString()}</li>` +\n    // Number of commands executed is likely to be higher because of commands overlapping\n    // multiple frustums.\n    `<li><strong>Commands: </strong>${statistics.numberOfCommands.toLocaleString()}</li>`;\n  s += \"</ul>\";\n  if (!isPick) {\n    s += '<ul class=\"cesium-cesiumInspector-statistics\">';\n    s +=\n      // --- Cache/loading statistics\n      `<li><strong>Requests: </strong>${statistics.numberOfPendingRequests.toLocaleString()}</li>` +\n      `<li><strong>Attempted: </strong>${statistics.numberOfAttemptedRequests.toLocaleString()}</li>` +\n      `<li><strong>Processing: </strong>${statistics.numberOfTilesProcessing.toLocaleString()}</li>` +\n      `<li><strong>Content Ready: </strong>${statistics.numberOfTilesWithContentReady.toLocaleString()}</li>` +\n      // Total number of tiles includes tiles without content, so \"Ready\" may never reach\n      // \"Total.\"  Total also will increase when a tile with a tileset JSON content is loaded.\n      `<li><strong>Total: </strong>${statistics.numberOfTilesTotal.toLocaleString()}</li>`;\n    s += \"</ul>\";\n    s += '<ul class=\"cesium-cesiumInspector-statistics\">';\n    s +=\n      // --- Features statistics\n      `<li><strong>Features Selected: </strong>${statistics.numberOfFeaturesSelected.toLocaleString()}</li>` +\n      `<li><strong>Features Loaded: </strong>${statistics.numberOfFeaturesLoaded.toLocaleString()}</li>` +\n      `<li><strong>Points Selected: </strong>${statistics.numberOfPointsSelected.toLocaleString()}</li>` +\n      `<li><strong>Points Loaded: </strong>${statistics.numberOfPointsLoaded.toLocaleString()}</li>` +\n      `<li><strong>Triangles Selected: </strong>${statistics.numberOfTrianglesSelected.toLocaleString()}</li>`;\n    s += \"</ul>\";\n    s += '<ul class=\"cesium-cesiumInspector-statistics\">';\n    s +=\n      // --- Styling statistics\n      `<li><strong>Tiles styled: </strong>${statistics.numberOfTilesStyled.toLocaleString()}</li>` +\n      `<li><strong>Features styled: </strong>${statistics.numberOfFeaturesStyled.toLocaleString()}</li>`;\n    s += \"</ul>\";\n    s += '<ul class=\"cesium-cesiumInspector-statistics\">';\n    s +=\n      // --- Optimization statistics\n      `<li><strong>Children Union Culled: </strong>${statistics.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`;\n    s += \"</ul>\";\n    s += '<ul class=\"cesium-cesiumInspector-statistics\">';\n    s +=\n      // --- Memory statistics\n      `<li><strong>Geometry Memory (MB): </strong>${formatMemoryString(\n        statistics.geometryByteLength\n      )}</li>` +\n      `<li><strong>Texture Memory (MB): </strong>${formatMemoryString(\n        statistics.texturesByteLength\n      )}</li>` +\n      `<li><strong>Batch Table Memory (MB): </strong>${formatMemoryString(\n        statistics.batchTableByteLength\n      )}</li>`;\n    s += \"</ul>\";\n  }\n  return s;\n}\n\nfunction getResourceCacheStatistics() {\n  const statistics = ResourceCache.statistics;\n\n  return `\n  <ul class=\"cesium-cesiumInspector-statistics\">\n    <li><strong>Geometry Memory (MB): </strong>${formatMemoryString(\n      statistics.geometryByteLength\n    )}</li>\n    <li><strong>Texture Memory (MB): </strong>${formatMemoryString(\n      statistics.texturesByteLength\n    )}</li>\n  </ul>\n  `;\n}\n\nconst colorBlendModes = [\n  {\n    text: \"Highlight\",\n    value: Cesium3DTileColorBlendMode.HIGHLIGHT,\n  },\n  {\n    text: \"Replace\",\n    value: Cesium3DTileColorBlendMode.REPLACE,\n  },\n  {\n    text: \"Mix\",\n    value: Cesium3DTileColorBlendMode.MIX,\n  },\n];\n\nconst highlightColor = new Color(1.0, 1.0, 0.0, 0.4);\nconst scratchColor = new Color();\nconst oldColor = new Color();\n\n/**\n * The view model for {@link Cesium3DTilesInspector}.\n * @alias Cesium3DTilesInspectorViewModel\n * @constructor\n *\n * @param {Scene} scene The scene instance to use.\n * @param {HTMLElement} performanceContainer The container for the performance display\n */\nfunction Cesium3DTilesInspectorViewModel(scene, performanceContainer) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"scene\", scene);\n  Check.typeOf.object(\"performanceContainer\", performanceContainer);\n  //>>includeEnd('debug');\n\n  const that = this;\n  const canvas = scene.canvas;\n  this._eventHandler = new ScreenSpaceEventHandler(canvas);\n  this._scene = scene;\n  this._performanceContainer = performanceContainer;\n  this._canvas = canvas;\n\n  this._performanceDisplay = new PerformanceDisplay({\n    container: performanceContainer,\n  });\n\n  this._statisticsText = \"\";\n  this._pickStatisticsText = \"\";\n  this._resourceCacheStatisticsText = \"\";\n  this._editorError = \"\";\n\n  /**\n   * Gets or sets the flag to enable performance display.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.performance = false;\n\n  /**\n   * Gets or sets the flag to show statistics.  This property is observable.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.showStatistics = true;\n\n  /**\n   * Gets or sets the flag to show pick statistics.  This property is observable.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.showPickStatistics = true;\n\n  /**\n   * Gets or sets the flag to show resource cache statistics. This property is\n   * observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.showResourceCacheStatistics = false;\n\n  /**\n   * Gets or sets the flag to show the inspector.  This property is observable.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.inspectorVisible = true;\n\n  /**\n   * Gets or sets the flag to show the tileset section.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.tilesetVisible = false;\n\n  /**\n   * Gets or sets the flag to show the display section.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.displayVisible = false;\n\n  /**\n   * Gets or sets the flag to show the update section.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.updateVisible = false;\n\n  /**\n   * Gets or sets the flag to show the logging section.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.loggingVisible = false;\n\n  /**\n   * Gets or sets the flag to show the style section.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.styleVisible = false;\n\n  /**\n   * Gets or sets the flag to show the tile info section.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.tileDebugLabelsVisible = false;\n\n  /**\n   * Gets or sets the flag to show the optimization info section. This property is observable.\n   *\n   * @type {boolean}\n   * @default false;\n   */\n  this.optimizationVisible = false;\n\n  /**\n   * Gets or sets the JSON for the tileset style.  This property is observable.\n   *\n   * @type {string}\n   * @default '{}'\n   */\n  this.styleString = \"{}\";\n\n  /**\n   * Gets or sets the JSON for the tileset enableDebugWireframe attribute.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.hasEnabledWireframe = false;\n\n  this._tileset = undefined;\n  this._feature = undefined;\n  this._tile = undefined;\n\n  knockout.track(this, [\n    \"performance\",\n    \"inspectorVisible\",\n    \"_statisticsText\",\n    \"_pickStatisticsText\",\n    \"_resourceCacheStatisticsText\",\n    \"_editorError\",\n    \"showPickStatistics\",\n    \"showStatistics\",\n    \"showResourceCacheStatistics\",\n    \"tilesetVisible\",\n    \"displayVisible\",\n    \"updateVisible\",\n    \"loggingVisible\",\n    \"styleVisible\",\n    \"optimizationVisible\",\n    \"tileDebugLabelsVisible\",\n    \"styleString\",\n    \"_feature\",\n    \"_tile\",\n    \"_tileset\",\n    \"hasEnabledWireframe\",\n  ]);\n\n  this._properties = knockout.observable({});\n  /**\n   * Gets the names of the properties in the tileset.  This property is observable.\n   * @type {string[]}\n   * @readonly\n   */\n  this.properties = [];\n  knockout.defineProperty(this, \"properties\", function () {\n    const names = [];\n    const properties = that._properties();\n    for (const prop in properties) {\n      if (properties.hasOwnProperty(prop)) {\n        names.push(prop);\n      }\n    }\n    return names;\n  });\n\n  const dynamicScreenSpaceError = knockout.observable();\n  knockout.defineProperty(this, \"dynamicScreenSpaceError\", {\n    get: function () {\n      return dynamicScreenSpaceError();\n    },\n    set: function (value) {\n      dynamicScreenSpaceError(value);\n      if (defined(that._tileset)) {\n        that._tileset.dynamicScreenSpaceError = value;\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag to enable dynamic screen space error.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.dynamicScreenSpaceError = false;\n\n  const colorBlendMode = knockout.observable();\n  knockout.defineProperty(this, \"colorBlendMode\", {\n    get: function () {\n      return colorBlendMode();\n    },\n    set: function (value) {\n      colorBlendMode(value);\n      if (defined(that._tileset)) {\n        that._tileset.colorBlendMode = value;\n        that._scene.requestRender();\n      }\n    },\n  });\n  /**\n   * Gets or sets the color blend mode.  This property is observable.\n   *\n   * @type {Cesium3DTileColorBlendMode}\n   * @default Cesium3DTileColorBlendMode.HIGHLIGHT\n   */\n  this.colorBlendMode = Cesium3DTileColorBlendMode.HIGHLIGHT;\n\n  const showOnlyPickedTileDebugLabel = knockout.observable();\n  const picking = knockout.observable();\n  knockout.defineProperty(this, \"picking\", {\n    get: function () {\n      return picking();\n    },\n    set: function (value) {\n      picking(value);\n      if (value) {\n        that._eventHandler.setInputAction(function (e) {\n          const picked = scene.pick(e.endPosition);\n          if (picked instanceof Cesium3DTileFeature) {\n            // Picked a feature\n            that.feature = picked;\n            that.tile = picked.content.tile;\n          } else if (defined(picked) && defined(picked.content)) {\n            // Picked a tile\n            that.feature = undefined;\n            that.tile = picked.content.tile;\n          } else {\n            // Picked nothing\n            that.feature = undefined;\n            that.tile = undefined;\n          }\n          if (!defined(that._tileset)) {\n            return;\n          }\n          if (\n            showOnlyPickedTileDebugLabel &&\n            defined(picked) &&\n            defined(picked.content)\n          ) {\n            let position;\n            if (scene.pickPositionSupported) {\n              position = scene.pickPosition(e.endPosition);\n              if (defined(position)) {\n                that._tileset.debugPickPosition = position;\n              }\n            }\n            that._tileset.debugPickedTile = picked.content.tile;\n          } else {\n            that._tileset.debugPickedTile = undefined;\n          }\n          that._scene.requestRender();\n        }, ScreenSpaceEventType.MOUSE_MOVE);\n      } else {\n        that.feature = undefined;\n        that.tile = undefined;\n        that._eventHandler.removeInputAction(ScreenSpaceEventType.MOUSE_MOVE);\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag to enable picking.  This property is observable.\n   *\n   * @type {boolean}\n   * @default true\n   */\n  this.picking = true;\n\n  const colorize = knockout.observable();\n  knockout.defineProperty(this, \"colorize\", {\n    get: function () {\n      return colorize();\n    },\n    set: function (value) {\n      colorize(value);\n      if (defined(that._tileset)) {\n        that._tileset.debugColorizeTiles = value;\n        that._scene.requestRender();\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag to colorize tiles.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.colorize = false;\n\n  const wireframe = knockout.observable();\n  knockout.defineProperty(this, \"wireframe\", {\n    get: function () {\n      return wireframe();\n    },\n    set: function (value) {\n      wireframe(value);\n      if (defined(that._tileset)) {\n        that._tileset.debugWireframe = value;\n        that._scene.requestRender();\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag to draw with wireframe.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.wireframe = false;\n\n  const showBoundingVolumes = knockout.observable();\n  knockout.defineProperty(this, \"showBoundingVolumes\", {\n    get: function () {\n      return showBoundingVolumes();\n    },\n    set: function (value) {\n      showBoundingVolumes(value);\n      if (defined(that._tileset)) {\n        that._tileset.debugShowBoundingVolume = value;\n        that._scene.requestRender();\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag to show bounding volumes.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.showBoundingVolumes = false;\n\n  const showContentBoundingVolumes = knockout.observable();\n  knockout.defineProperty(this, \"showContentBoundingVolumes\", {\n    get: function () {\n      return showContentBoundingVolumes();\n    },\n    set: function (value) {\n      showContentBoundingVolumes(value);\n      if (defined(that._tileset)) {\n        that._tileset.debugShowContentBoundingVolume = value;\n        that._scene.requestRender();\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag to show content volumes.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.showContentBoundingVolumes = false;\n\n  const showRequestVolumes = knockout.observable();\n  knockout.defineProperty(this, \"showRequestVolumes\", {\n    get: function () {\n      return showRequestVolumes();\n    },\n    set: function (value) {\n      showRequestVolumes(value);\n      if (defined(that._tileset)) {\n        that._tileset.debugShowViewerRequestVolume = value;\n        that._scene.requestRender();\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag to show request volumes.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.showRequestVolumes = false;\n\n  const freezeFrame = knockout.observable();\n  knockout.defineProperty(this, \"freezeFrame\", {\n    get: function () {\n      return freezeFrame();\n    },\n    set: function (value) {\n      freezeFrame(value);\n      if (defined(that._tileset)) {\n        that._tileset.debugFreezeFrame = value;\n        that._scene.debugShowFrustumPlanes = value;\n        that._scene.requestRender();\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag to suspend updates.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.freezeFrame = false;\n\n  knockout.defineProperty(this, \"showOnlyPickedTileDebugLabel\", {\n    get: function () {\n      return showOnlyPickedTileDebugLabel();\n    },\n    set: function (value) {\n      showOnlyPickedTileDebugLabel(value);\n      if (defined(that._tileset)) {\n        that._tileset.debugPickedTileLabelOnly = value;\n        that._scene.requestRender();\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag to show debug labels only for the currently picked tile.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.showOnlyPickedTileDebugLabel = false;\n\n  const showGeometricError = knockout.observable();\n  knockout.defineProperty(this, \"showGeometricError\", {\n    get: function () {\n      return showGeometricError();\n    },\n    set: function (value) {\n      showGeometricError(value);\n      if (defined(that._tileset)) {\n        that._tileset.debugShowGeometricError = value;\n        that._scene.requestRender();\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag to show tile geometric error.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.showGeometricError = false;\n\n  const showRenderingStatistics = knockout.observable();\n  knockout.defineProperty(this, \"showRenderingStatistics\", {\n    get: function () {\n      return showRenderingStatistics();\n    },\n    set: function (value) {\n      showRenderingStatistics(value);\n      if (defined(that._tileset)) {\n        that._tileset.debugShowRenderingStatistics = value;\n        that._scene.requestRender();\n      }\n    },\n  });\n  /**\n   * Displays the number of commands, points, triangles and features used per tile.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.showRenderingStatistics = false;\n\n  const showMemoryUsage = knockout.observable();\n  knockout.defineProperty(this, \"showMemoryUsage\", {\n    get: function () {\n      return showMemoryUsage();\n    },\n    set: function (value) {\n      showMemoryUsage(value);\n      if (defined(that._tileset)) {\n        that._tileset.debugShowMemoryUsage = value;\n        that._scene.requestRender();\n      }\n    },\n  });\n  /**\n   * Displays the memory used per tile.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.showMemoryUsage = false;\n\n  const showUrl = knockout.observable();\n  knockout.defineProperty(this, \"showUrl\", {\n    get: function () {\n      return showUrl();\n    },\n    set: function (value) {\n      showUrl(value);\n      if (defined(that._tileset)) {\n        that._tileset.debugShowUrl = value;\n        that._scene.requestRender();\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag to show the tile url.  This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.showUrl = false;\n\n  const maximumScreenSpaceError = knockout.observable();\n  knockout.defineProperty(this, \"maximumScreenSpaceError\", {\n    get: function () {\n      return maximumScreenSpaceError();\n    },\n    set: function (value) {\n      value = Number(value);\n      if (!isNaN(value)) {\n        maximumScreenSpaceError(value);\n        if (defined(that._tileset)) {\n          that._tileset.maximumScreenSpaceError = value;\n        }\n      }\n    },\n  });\n  /**\n   * Gets or sets the maximum screen space error.  This property is observable.\n   *\n   * @type {number}\n   * @default 16\n   */\n  this.maximumScreenSpaceError = 16;\n\n  const dynamicScreenSpaceErrorDensity = knockout.observable();\n  knockout.defineProperty(this, \"dynamicScreenSpaceErrorDensity\", {\n    get: function () {\n      return dynamicScreenSpaceErrorDensity();\n    },\n    set: function (value) {\n      value = Number(value);\n      if (!isNaN(value)) {\n        dynamicScreenSpaceErrorDensity(value);\n        if (defined(that._tileset)) {\n          that._tileset.dynamicScreenSpaceErrorDensity = value;\n        }\n      }\n    },\n  });\n  /**\n   * Gets or sets the dynamic screen space error density.  This property is observable.\n   *\n   * @type {number}\n   * @default 0.00278\n   */\n  this.dynamicScreenSpaceErrorDensity = 0.00278;\n\n  /**\n   * Gets or sets the dynamic screen space error density slider value.\n   * This allows the slider to be exponential because values tend to be closer to 0 than 1.\n   * This property is observable.\n   *\n   * @type {number}\n   * @default 0.00278\n   */\n  this.dynamicScreenSpaceErrorDensitySliderValue = undefined;\n  knockout.defineProperty(this, \"dynamicScreenSpaceErrorDensitySliderValue\", {\n    get: function () {\n      return Math.pow(dynamicScreenSpaceErrorDensity(), 1 / 6);\n    },\n    set: function (value) {\n      dynamicScreenSpaceErrorDensity(Math.pow(value, 6));\n    },\n  });\n\n  const dynamicScreenSpaceErrorFactor = knockout.observable();\n  knockout.defineProperty(this, \"dynamicScreenSpaceErrorFactor\", {\n    get: function () {\n      return dynamicScreenSpaceErrorFactor();\n    },\n    set: function (value) {\n      value = Number(value);\n      if (!isNaN(value)) {\n        dynamicScreenSpaceErrorFactor(value);\n        if (defined(that._tileset)) {\n          that._tileset.dynamicScreenSpaceErrorFactor = value;\n        }\n      }\n    },\n  });\n  /**\n   * Gets or sets the dynamic screen space error factor.  This property is observable.\n   *\n   * @type {number}\n   * @default 4.0\n   */\n  this.dynamicScreenSpaceErrorFactor = 4.0;\n\n  const pickTileset = getPickTileset(this);\n  const pickActive = knockout.observable();\n  knockout.defineProperty(this, \"pickActive\", {\n    get: function () {\n      return pickActive();\n    },\n    set: function (value) {\n      pickActive(value);\n      if (value) {\n        that._eventHandler.setInputAction(\n          pickTileset,\n          ScreenSpaceEventType.LEFT_CLICK\n        );\n      } else {\n        that._eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK);\n      }\n    },\n  });\n\n  const pointCloudShading = knockout.observable();\n  knockout.defineProperty(this, \"pointCloudShading\", {\n    get: function () {\n      return pointCloudShading();\n    },\n    set: function (value) {\n      pointCloudShading(value);\n      if (defined(that._tileset)) {\n        that._tileset.pointCloudShading.attenuation = value;\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag to enable point cloud shading. This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.pointCloudShading = false;\n\n  const geometricErrorScale = knockout.observable();\n  knockout.defineProperty(this, \"geometricErrorScale\", {\n    get: function () {\n      return geometricErrorScale();\n    },\n    set: function (value) {\n      value = Number(value);\n      if (!isNaN(value)) {\n        geometricErrorScale(value);\n        if (defined(that._tileset)) {\n          that._tileset.pointCloudShading.geometricErrorScale = value;\n        }\n      }\n    },\n  });\n  /**\n   * Gets or sets the geometric error scale.  This property is observable.\n   *\n   * @type {number}\n   * @default 1.0\n   */\n  this.geometricErrorScale = 1.0;\n\n  const maximumAttenuation = knockout.observable();\n  knockout.defineProperty(this, \"maximumAttenuation\", {\n    get: function () {\n      return maximumAttenuation();\n    },\n    set: function (value) {\n      value = Number(value);\n      if (!isNaN(value)) {\n        maximumAttenuation(value);\n        if (defined(that._tileset)) {\n          that._tileset.pointCloudShading.maximumAttenuation =\n            value === 0 ? undefined : value;\n        }\n      }\n    },\n  });\n  /**\n   * Gets or sets the maximum attenuation.  This property is observable.\n   *\n   * @type {number}\n   * @default 0\n   */\n  this.maximumAttenuation = 0;\n\n  const baseResolution = knockout.observable();\n  knockout.defineProperty(this, \"baseResolution\", {\n    get: function () {\n      return baseResolution();\n    },\n    set: function (value) {\n      value = Number(value);\n      if (!isNaN(value)) {\n        baseResolution(value);\n        if (defined(that._tileset)) {\n          that._tileset.pointCloudShading.baseResolution =\n            value === 0 ? undefined : value;\n        }\n      }\n    },\n  });\n  /**\n   * Gets or sets the base resolution.  This property is observable.\n   *\n   * @type {number}\n   * @default 0\n   */\n  this.baseResolution = 0;\n\n  const eyeDomeLighting = knockout.observable();\n  knockout.defineProperty(this, \"eyeDomeLighting\", {\n    get: function () {\n      return eyeDomeLighting();\n    },\n    set: function (value) {\n      eyeDomeLighting(value);\n      if (defined(that._tileset)) {\n        that._tileset.pointCloudShading.eyeDomeLighting = value;\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag to enable eye dome lighting. This property is observable.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.eyeDomeLighting = false;\n\n  const eyeDomeLightingStrength = knockout.observable();\n  knockout.defineProperty(this, \"eyeDomeLightingStrength\", {\n    get: function () {\n      return eyeDomeLightingStrength();\n    },\n    set: function (value) {\n      value = Number(value);\n      if (!isNaN(value)) {\n        eyeDomeLightingStrength(value);\n        if (defined(that._tileset)) {\n          that._tileset.pointCloudShading.eyeDomeLightingStrength = value;\n        }\n      }\n    },\n  });\n  /**\n   * Gets or sets the eye dome lighting strength.  This property is observable.\n   *\n   * @type {number}\n   * @default 1.0\n   */\n  this.eyeDomeLightingStrength = 1.0;\n\n  const eyeDomeLightingRadius = knockout.observable();\n  knockout.defineProperty(this, \"eyeDomeLightingRadius\", {\n    get: function () {\n      return eyeDomeLightingRadius();\n    },\n    set: function (value) {\n      value = Number(value);\n      if (!isNaN(value)) {\n        eyeDomeLightingRadius(value);\n        if (defined(that._tileset)) {\n          that._tileset.pointCloudShading.eyeDomeLightingRadius = value;\n        }\n      }\n    },\n  });\n  /**\n   * Gets or sets the eye dome lighting radius.  This property is observable.\n   *\n   * @type {number}\n   * @default 1.0\n   */\n  this.eyeDomeLightingRadius = 1.0;\n\n  /**\n   * Gets or sets the pick state\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.pickActive = false;\n\n  const skipLevelOfDetail = knockout.observable();\n  knockout.defineProperty(this, \"skipLevelOfDetail\", {\n    get: function () {\n      return skipLevelOfDetail();\n    },\n    set: function (value) {\n      skipLevelOfDetail(value);\n      if (defined(that._tileset)) {\n        that._tileset.skipLevelOfDetail = value;\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag to determine if level of detail skipping should be applied during the traversal.\n   * This property is observable.\n   * @type {boolean}\n   * @default true\n   */\n  this.skipLevelOfDetail = true;\n\n  const skipScreenSpaceErrorFactor = knockout.observable();\n  knockout.defineProperty(this, \"skipScreenSpaceErrorFactor\", {\n    get: function () {\n      return skipScreenSpaceErrorFactor();\n    },\n    set: function (value) {\n      value = Number(value);\n      if (!isNaN(value)) {\n        skipScreenSpaceErrorFactor(value);\n        if (defined(that._tileset)) {\n          that._tileset.skipScreenSpaceErrorFactor = value;\n        }\n      }\n    },\n  });\n  /**\n   * Gets or sets the multiplier defining the minimum screen space error to skip. This property is observable.\n   * @type {number}\n   * @default 16\n   */\n  this.skipScreenSpaceErrorFactor = 16;\n\n  const baseScreenSpaceError = knockout.observable();\n  knockout.defineProperty(this, \"baseScreenSpaceError\", {\n    get: function () {\n      return baseScreenSpaceError();\n    },\n    set: function (value) {\n      value = Number(value);\n      if (!isNaN(value)) {\n        baseScreenSpaceError(value);\n        if (defined(that._tileset)) {\n          that._tileset.baseScreenSpaceError = value;\n        }\n      }\n    },\n  });\n  /**\n   * Gets or sets the screen space error that must be reached before skipping levels of detail. This property is observable.\n   * @type {number}\n   * @default 1024\n   */\n  this.baseScreenSpaceError = 1024;\n\n  const skipLevels = knockout.observable();\n  knockout.defineProperty(this, \"skipLevels\", {\n    get: function () {\n      return skipLevels();\n    },\n    set: function (value) {\n      value = Number(value);\n      if (!isNaN(value)) {\n        skipLevels(value);\n        if (defined(that._tileset)) {\n          that._tileset.skipLevels = value;\n        }\n      }\n    },\n  });\n  /**\n   * Gets or sets the constant defining the minimum number of levels to skip when loading tiles. This property is observable.\n   * @type {number}\n   * @default 1\n   */\n  this.skipLevels = 1;\n\n  const immediatelyLoadDesiredLevelOfDetail = knockout.observable();\n  knockout.defineProperty(this, \"immediatelyLoadDesiredLevelOfDetail\", {\n    get: function () {\n      return immediatelyLoadDesiredLevelOfDetail();\n    },\n    set: function (value) {\n      immediatelyLoadDesiredLevelOfDetail(value);\n      if (defined(that._tileset)) {\n        that._tileset.immediatelyLoadDesiredLevelOfDetail = value;\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag which, when true, only tiles that meet the maximum screen space error will ever be downloaded.\n   * This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.immediatelyLoadDesiredLevelOfDetail = false;\n\n  const loadSiblings = knockout.observable();\n  knockout.defineProperty(this, \"loadSiblings\", {\n    get: function () {\n      return loadSiblings();\n    },\n    set: function (value) {\n      loadSiblings(value);\n      if (defined(that._tileset)) {\n        that._tileset.loadSiblings = value;\n      }\n    },\n  });\n  /**\n   * Gets or sets the flag which determines whether siblings of visible tiles are always downloaded during traversal.\n   * This property is observable\n   * @type {boolean}\n   * @default false\n   */\n  this.loadSiblings = false;\n\n  this._style = undefined;\n  this._shouldStyle = false;\n  this._definedProperties = [\n    \"properties\",\n    \"dynamicScreenSpaceError\",\n    \"colorBlendMode\",\n    \"picking\",\n    \"colorize\",\n    \"wireframe\",\n    \"showBoundingVolumes\",\n    \"showContentBoundingVolumes\",\n    \"showRequestVolumes\",\n    \"freezeFrame\",\n    \"maximumScreenSpaceError\",\n    \"dynamicScreenSpaceErrorDensity\",\n    \"baseScreenSpaceError\",\n    \"skipScreenSpaceErrorFactor\",\n    \"skipLevelOfDetail\",\n    \"skipLevels\",\n    \"immediatelyLoadDesiredLevelOfDetail\",\n    \"loadSiblings\",\n    \"dynamicScreenSpaceErrorDensitySliderValue\",\n    \"dynamicScreenSpaceErrorFactor\",\n    \"pickActive\",\n    \"showOnlyPickedTileDebugLabel\",\n    \"showGeometricError\",\n    \"showRenderingStatistics\",\n    \"showMemoryUsage\",\n    \"showUrl\",\n    \"pointCloudShading\",\n    \"geometricErrorScale\",\n    \"maximumAttenuation\",\n    \"baseResolution\",\n    \"eyeDomeLighting\",\n    \"eyeDomeLightingStrength\",\n    \"eyeDomeLightingRadius\",\n  ];\n  this._removePostRenderEvent = scene.postRender.addEventListener(function () {\n    that._update();\n  });\n\n  if (!defined(this._tileset)) {\n    selectTilesetOnHover(this, true);\n  }\n}\n\nObject.defineProperties(Cesium3DTilesInspectorViewModel.prototype, {\n  /**\n   * Gets the scene\n   * @memberof Cesium3DTilesInspectorViewModel.prototype\n   * @type {Scene}\n   * @readonly\n   */\n  scene: {\n    get: function () {\n      return this._scene;\n    },\n  },\n  /**\n   * Gets the performance container\n   * @memberof Cesium3DTilesInspectorViewModel.prototype\n   * @type {HTMLElement}\n   * @readonly\n   */\n  performanceContainer: {\n    get: function () {\n      return this._performanceContainer;\n    },\n  },\n\n  /**\n   * Gets the statistics text.  This property is observable.\n   * @memberof Cesium3DTilesInspectorViewModel.prototype\n   * @type {string}\n   * @readonly\n   */\n  statisticsText: {\n    get: function () {\n      return this._statisticsText;\n    },\n  },\n  /**\n   * Gets the pick statistics text.  This property is observable.\n   * @memberof Cesium3DTilesInspectorViewModel.prototype\n   * @type {string}\n   * @readonly\n   */\n  pickStatisticsText: {\n    get: function () {\n      return this._pickStatisticsText;\n    },\n  },\n\n  /**\n   * Gets the resource cache statistics text. This property is observable.\n   * @memberof Cesium3DTilesInspectorViewModel.prototype\n   * @type {string}\n   * @readonly\n   */\n  resourceCacheStatisticsText: {\n    get: function () {\n      return this._resourceCacheStatisticsText;\n    },\n  },\n\n  /**\n   * Gets the available blend modes\n   * @memberof Cesium3DTilesInspectorViewModel.prototype\n   * @type {Object[]}\n   * @readonly\n   */\n  colorBlendModes: {\n    get: function () {\n      return colorBlendModes;\n    },\n  },\n\n  /**\n   * Gets the editor error message\n   * @memberof Cesium3DTilesInspectorViewModel.prototype\n   * @type {string}\n   * @readonly\n   */\n  editorError: {\n    get: function () {\n      return this._editorError;\n    },\n  },\n\n  /**\n   * Gets or sets the tileset of the view model.\n   * @memberof Cesium3DTilesInspectorViewModel.prototype\n   * @type {Cesium3DTileset}\n   */\n  tileset: {\n    get: function () {\n      return this._tileset;\n    },\n    set: function (tileset) {\n      this._tileset = tileset;\n      this._style = undefined;\n      this.styleString = \"{}\";\n      this.feature = undefined;\n      this.tile = undefined;\n\n      if (defined(tileset)) {\n        this._properties(tileset.properties);\n\n        // update tileset with existing settings\n        const settings = [\n          \"colorize\",\n          \"wireframe\",\n          \"showBoundingVolumes\",\n          \"showContentBoundingVolumes\",\n          \"showRequestVolumes\",\n          \"freezeFrame\",\n          \"showOnlyPickedTileDebugLabel\",\n          \"showGeometricError\",\n          \"showRenderingStatistics\",\n          \"showMemoryUsage\",\n          \"showUrl\",\n        ];\n        const length = settings.length;\n        for (let i = 0; i < length; ++i) {\n          const setting = settings[i];\n          //eslint-disable-next-line no-self-assign\n          this[setting] = this[setting];\n        }\n\n        // update view model with existing tileset settings\n        this.maximumScreenSpaceError = tileset.maximumScreenSpaceError;\n        this.dynamicScreenSpaceError = tileset.dynamicScreenSpaceError;\n        this.dynamicScreenSpaceErrorDensity =\n          tileset.dynamicScreenSpaceErrorDensity;\n        this.dynamicScreenSpaceErrorFactor =\n          tileset.dynamicScreenSpaceErrorFactor;\n        this.colorBlendMode = tileset.colorBlendMode;\n        this.skipLevelOfDetail = tileset.skipLevelOfDetail;\n        this.skipScreenSpaceErrorFactor = tileset.skipScreenSpaceErrorFactor;\n        this.baseScreenSpaceError = tileset.baseScreenSpaceError;\n        this.skipLevels = tileset.skipLevels;\n        this.immediatelyLoadDesiredLevelOfDetail =\n          tileset.immediatelyLoadDesiredLevelOfDetail;\n        this.loadSiblings = tileset.loadSiblings;\n        this.hasEnabledWireframe = tileset._enableDebugWireframe;\n\n        const pointCloudShading = tileset.pointCloudShading;\n        this.pointCloudShading = pointCloudShading.attenuation;\n        this.geometricErrorScale = pointCloudShading.geometricErrorScale;\n        this.maximumAttenuation = pointCloudShading.maximumAttenuation\n          ? pointCloudShading.maximumAttenuation\n          : 0.0;\n        this.baseResolution = pointCloudShading.baseResolution\n          ? pointCloudShading.baseResolution\n          : 0.0;\n        this.eyeDomeLighting = pointCloudShading.eyeDomeLighting;\n        this.eyeDomeLightingStrength =\n          pointCloudShading.eyeDomeLightingStrength;\n        this.eyeDomeLightingRadius = pointCloudShading.eyeDomeLightingRadius;\n\n        this._scene.requestRender();\n      } else {\n        this._properties({});\n      }\n\n      this._statisticsText = getStatistics(tileset, false);\n      this._pickStatisticsText = getStatistics(tileset, true);\n      this._resourceCacheStatisticsText = getResourceCacheStatistics();\n      selectTilesetOnHover(this, false);\n    },\n  },\n\n  /**\n   * Gets the current feature of the view model.\n   * @memberof Cesium3DTilesInspectorViewModel.prototype\n   * @type {Cesium3DTileFeature}\n   */\n  feature: {\n    get: function () {\n      return this._feature;\n    },\n    set: function (feature) {\n      if (this._feature === feature) {\n        return;\n      }\n      const currentFeature = this._feature;\n      if (defined(currentFeature) && !currentFeature.content.isDestroyed()) {\n        // Restore original color to feature that is no longer selected\n        if (!this.colorize && defined(this._style)) {\n          currentFeature.color = defined(this._style.color)\n            ? this._style.color.evaluateColor(currentFeature, scratchColor)\n            : Color.WHITE;\n        } else {\n          currentFeature.color = oldColor;\n        }\n        this._scene.requestRender();\n      }\n      if (defined(feature)) {\n        // Highlight new feature\n        Color.clone(feature.color, oldColor);\n        feature.color = highlightColor;\n        this._scene.requestRender();\n      }\n      this._feature = feature;\n    },\n  },\n\n  /**\n   * Gets the current tile of the view model\n   * @memberof Cesium3DTilesInspectorViewModel.prototype\n   * @type {Cesium3DTile}\n   */\n  tile: {\n    get: function () {\n      return this._tile;\n    },\n    set: function (tile) {\n      if (this._tile === tile) {\n        return;\n      }\n      const currentTile = this._tile;\n\n      if (\n        defined(currentTile) &&\n        !currentTile.isDestroyed() &&\n        !hasFeatures(currentTile.content)\n      ) {\n        // Restore original color to tile that is no longer selected\n        currentTile.color = oldColor;\n        this._scene.requestRender();\n      }\n\n      if (defined(tile) && !hasFeatures(tile.content)) {\n        // Highlight new tile\n        Color.clone(tile.color, oldColor);\n        tile.color = highlightColor;\n        this._scene.requestRender();\n      }\n      this._tile = tile;\n    },\n  },\n});\n\nfunction hasFeatures(content) {\n  if (!defined(content)) {\n    return false;\n  }\n\n  if (content.featuresLength > 0) {\n    return true;\n  }\n  const innerContents = content.innerContents;\n  if (defined(innerContents)) {\n    const length = innerContents.length;\n    for (let i = 0; i < length; ++i) {\n      if (!hasFeatures(innerContents[i])) {\n        return false;\n      }\n    }\n    return true;\n  }\n  return false;\n}\n\n/**\n * Toggles the pick tileset mode\n */\nCesium3DTilesInspectorViewModel.prototype.togglePickTileset = function () {\n  this.pickActive = !this.pickActive;\n};\n\n/**\n * Toggles the inspector visibility\n */\nCesium3DTilesInspectorViewModel.prototype.toggleInspector = function () {\n  this.inspectorVisible = !this.inspectorVisible;\n};\n\n/**\n * Toggles the visibility of the tileset section\n */\nCesium3DTilesInspectorViewModel.prototype.toggleTileset = function () {\n  this.tilesetVisible = !this.tilesetVisible;\n};\n\n/**\n * Toggles the visibility of the display section\n */\nCesium3DTilesInspectorViewModel.prototype.toggleDisplay = function () {\n  this.displayVisible = !this.displayVisible;\n};\n\n/**\n * Toggles the visibility of the update section\n */\nCesium3DTilesInspectorViewModel.prototype.toggleUpdate = function () {\n  this.updateVisible = !this.updateVisible;\n};\n\n/**\n * Toggles the visibility of the logging section\n */\nCesium3DTilesInspectorViewModel.prototype.toggleLogging = function () {\n  this.loggingVisible = !this.loggingVisible;\n};\n\n/**\n * Toggles the visibility of the style section\n */\nCesium3DTilesInspectorViewModel.prototype.toggleStyle = function () {\n  this.styleVisible = !this.styleVisible;\n};\n\n/**\n * Toggles the visibility of the tile Debug Info section\n */\nCesium3DTilesInspectorViewModel.prototype.toggleTileDebugLabels = function () {\n  this.tileDebugLabelsVisible = !this.tileDebugLabelsVisible;\n};\n\n/**\n * Toggles the visibility of the optimization section\n */\nCesium3DTilesInspectorViewModel.prototype.toggleOptimization = function () {\n  this.optimizationVisible = !this.optimizationVisible;\n};\n\n/**\n * Trims tile cache\n */\nCesium3DTilesInspectorViewModel.prototype.trimTilesCache = function () {\n  if (defined(this._tileset)) {\n    this._tileset.trimLoadedTiles();\n  }\n};\n\n/**\n * Compiles the style in the style editor.\n */\nCesium3DTilesInspectorViewModel.prototype.compileStyle = function () {\n  const tileset = this._tileset;\n  if (!defined(tileset) || this.styleString === JSON.stringify(tileset.style)) {\n    return;\n  }\n  this._editorError = \"\";\n  try {\n    if (this.styleString.length === 0) {\n      this.styleString = \"{}\";\n    }\n    this._style = new Cesium3DTileStyle(JSON.parse(this.styleString));\n    this._shouldStyle = true;\n    this._scene.requestRender();\n  } catch (err) {\n    this._editorError = err.toString();\n  }\n\n  // set feature again so pick coloring is set\n  this.feature = this._feature;\n  this.tile = this._tile;\n};\n\n/**\n * Handles key press events on the style editor.\n */\nCesium3DTilesInspectorViewModel.prototype.styleEditorKeyPress = function (\n  sender,\n  event\n) {\n  if (event.keyCode === 9) {\n    //tab\n    event.preventDefault();\n    const textArea = event.target;\n    const start = textArea.selectionStart;\n    const end = textArea.selectionEnd;\n    let newEnd = end;\n    const selected = textArea.value.slice(start, end);\n    const lines = selected.split(\"\\n\");\n    const length = lines.length;\n    let i;\n    if (!event.shiftKey) {\n      for (i = 0; i < length; ++i) {\n        lines[i] = `  ${lines[i]}`;\n        newEnd += 2;\n      }\n    } else {\n      for (i = 0; i < length; ++i) {\n        if (lines[i][0] === \" \") {\n          if (lines[i][1] === \" \") {\n            lines[i] = lines[i].substr(2);\n            newEnd -= 2;\n          } else {\n            lines[i] = lines[i].substr(1);\n            newEnd -= 1;\n          }\n        }\n      }\n    }\n    const newText = lines.join(\"\\n\");\n    textArea.value =\n      textArea.value.slice(0, start) + newText + textArea.value.slice(end);\n    textArea.selectionStart = start !== end ? start : newEnd;\n    textArea.selectionEnd = newEnd;\n  } else if (event.ctrlKey && (event.keyCode === 10 || event.keyCode === 13)) {\n    //ctrl + enter\n    this.compileStyle();\n  }\n  return true;\n};\n\n/**\n * Updates the values of view model\n * @private\n */\nCesium3DTilesInspectorViewModel.prototype._update = function () {\n  const tileset = this._tileset;\n\n  if (this.performance) {\n    this._performanceDisplay.update();\n  }\n\n  if (defined(tileset)) {\n    if (tileset.isDestroyed()) {\n      this.tile = undefined;\n      this.feature = undefined;\n      this.tileset = undefined;\n      return;\n    }\n\n    const style = tileset.style;\n    if (this._style !== tileset.style) {\n      if (this._shouldStyle) {\n        tileset.style = this._style;\n        this._shouldStyle = false;\n      } else {\n        this._style = style;\n        this.styleString = JSON.stringify(style.style, null, \"  \");\n      }\n    }\n  }\n  if (this.showStatistics) {\n    this._statisticsText = getStatistics(tileset, false);\n    this._pickStatisticsText = getStatistics(tileset, true);\n    this._resourceCacheStatisticsText = getResourceCacheStatistics();\n  }\n};\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nCesium3DTilesInspectorViewModel.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nCesium3DTilesInspectorViewModel.prototype.destroy = function () {\n  this._eventHandler.destroy();\n  this._removePostRenderEvent();\n\n  const that = this;\n  this._definedProperties.forEach(function (property) {\n    knockout.getObservable(that, property).dispose();\n  });\n\n  return destroyObject(this);\n};\n\n/**\n * Generates an HTML string of the statistics\n *\n * @function\n * @param {Cesium3DTileset} tileset The tileset\n * @param {boolean} isPick Whether this is getting the statistics for the pick pass\n * @returns {string} The formatted statistics\n */\nCesium3DTilesInspectorViewModel.getStatistics = getStatistics;\nexport default Cesium3DTilesInspectorViewModel;\n", "import { Check, destroyObject, getElement } from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport InspectorShared from \"../InspectorShared.js\";\nimport Cesium3DTilesInspectorViewModel from \"./Cesium3DTilesInspectorViewModel.js\";\n\n/**\n * Inspector widget to aid in debugging 3D Tiles\n *\n * @alias Cesium3DTilesInspector\n * @constructor\n *\n * @param {Element|string} container The DOM element or ID that will contain the widget.\n * @param {Scene} scene the Scene instance to use.\n */\nfunction Cesium3DTilesInspector(container, scene) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"container\", container);\n  Check.typeOf.object(\"scene\", scene);\n  //>>includeEnd('debug');\n\n  container = getElement(container);\n  const element = document.createElement(\"div\");\n  const performanceContainer = document.createElement(\"div\");\n  performanceContainer.setAttribute(\"data-bind\", \"visible: performance\");\n  const viewModel = new Cesium3DTilesInspectorViewModel(\n    scene,\n    performanceContainer\n  );\n\n  this._viewModel = viewModel;\n  this._container = container;\n  this._element = element;\n\n  const text = document.createElement(\"div\");\n  text.textContent = \"3D Tiles Inspector\";\n  text.className = \"cesium-cesiumInspector-button\";\n  text.setAttribute(\"data-bind\", \"click: toggleInspector\");\n  element.appendChild(text);\n  element.className = \"cesium-cesiumInspector cesium-3DTilesInspector\";\n  element.setAttribute(\n    \"data-bind\",\n    'css: { \"cesium-cesiumInspector-visible\" : inspectorVisible, \"cesium-cesiumInspector-hidden\" : !inspectorVisible}'\n  );\n  container.appendChild(element);\n\n  const panel = document.createElement(\"div\");\n  panel.className = \"cesium-cesiumInspector-dropDown\";\n  element.appendChild(panel);\n\n  const createSection = InspectorShared.createSection;\n  const createCheckbox = InspectorShared.createCheckbox;\n  const createRangeInput = InspectorShared.createRangeInput;\n  const createButton = InspectorShared.createButton;\n\n  const tilesetPanelContents = createSection(\n    panel,\n    \"Tileset\",\n    \"tilesetVisible\",\n    \"toggleTileset\"\n  );\n  const displayPanelContents = createSection(\n    panel,\n    \"Display\",\n    \"displayVisible\",\n    \"toggleDisplay\"\n  );\n  const updatePanelContents = createSection(\n    panel,\n    \"Update\",\n    \"updateVisible\",\n    \"toggleUpdate\"\n  );\n  const loggingPanelContents = createSection(\n    panel,\n    \"Logging\",\n    \"loggingVisible\",\n    \"toggleLogging\"\n  );\n  const tileDebugLabelsPanelContents = createSection(\n    panel,\n    \"Tile Debug Labels\",\n    \"tileDebugLabelsVisible\",\n    \"toggleTileDebugLabels\"\n  );\n  const stylePanelContents = createSection(\n    panel,\n    \"Style\",\n    \"styleVisible\",\n    \"toggleStyle\"\n  );\n  const optimizationPanelContents = createSection(\n    panel,\n    \"Optimization\",\n    \"optimizationVisible\",\n    \"toggleOptimization\"\n  );\n\n  const properties = document.createElement(\"div\");\n  properties.className = \"field-group\";\n  const propertiesLabel = document.createElement(\"label\");\n  propertiesLabel.className = \"field-label\";\n  propertiesLabel.appendChild(document.createTextNode(\"Properties: \"));\n  const propertiesField = document.createElement(\"div\");\n  propertiesField.setAttribute(\"data-bind\", \"text: properties\");\n  properties.appendChild(propertiesLabel);\n  properties.appendChild(propertiesField);\n  tilesetPanelContents.appendChild(properties);\n  tilesetPanelContents.appendChild(\n    createButton(\"Pick Tileset\", \"togglePickTileset\", \"pickActive\")\n  );\n  tilesetPanelContents.appendChild(\n    createButton(\"Trim Tiles Cache\", \"trimTilesCache\")\n  );\n  tilesetPanelContents.appendChild(createCheckbox(\"Enable Picking\", \"picking\"));\n\n  displayPanelContents.appendChild(createCheckbox(\"Colorize\", \"colorize\"));\n  const wireframeCheckbox = displayPanelContents.appendChild(\n    createCheckbox(\n      \"Wireframe\",\n      \"wireframe\",\n      \"_tileset === undefined || hasEnabledWireframe\"\n    )\n  );\n\n  // Create warning text when the Wireframe checkbox is disabled\n  const warningText = document.createElement(\"p\");\n  warningText.setAttribute(\n    \"data-bind\",\n    \"visible: _tileset !== undefined && !hasEnabledWireframe\"\n  );\n  warningText.setAttribute(\n    \"class\",\n    \"cesium-3DTilesInspector-disabledElementsInfo\"\n  );\n  warningText.innerText =\n    \"Set enableDebugWireframe to true in the tileset constructor to enable this option.\";\n  wireframeCheckbox.appendChild(warningText);\n\n  displayPanelContents.appendChild(\n    createCheckbox(\"Bounding Volumes\", \"showBoundingVolumes\")\n  );\n  displayPanelContents.appendChild(\n    createCheckbox(\"Content Volumes\", \"showContentBoundingVolumes\")\n  );\n  displayPanelContents.appendChild(\n    createCheckbox(\"Request Volumes\", \"showRequestVolumes\")\n  );\n\n  displayPanelContents.appendChild(\n    createCheckbox(\"Point Cloud Shading\", \"pointCloudShading\")\n  );\n  const pointCloudShadingContainer = document.createElement(\"div\");\n  pointCloudShadingContainer.setAttribute(\n    \"data-bind\",\n    \"visible: pointCloudShading\"\n  );\n  pointCloudShadingContainer.appendChild(\n    createRangeInput(\"Geometric Error Scale\", \"geometricErrorScale\", 0, 2, 0.01)\n  );\n  pointCloudShadingContainer.appendChild(\n    createRangeInput(\"Maximum Attenuation\", \"maximumAttenuation\", 0, 32, 1)\n  );\n  pointCloudShadingContainer.appendChild(\n    createRangeInput(\"Base Resolution\", \"baseResolution\", 0, 1, 0.01)\n  );\n  pointCloudShadingContainer.appendChild(\n    createCheckbox(\"Eye Dome Lighting (EDL)\", \"eyeDomeLighting\")\n  );\n  displayPanelContents.appendChild(pointCloudShadingContainer);\n\n  const edlContainer = document.createElement(\"div\");\n  edlContainer.setAttribute(\"data-bind\", \"visible: eyeDomeLighting\");\n  edlContainer.appendChild(\n    createRangeInput(\"EDL Strength\", \"eyeDomeLightingStrength\", 0, 2.0, 0.1)\n  );\n  edlContainer.appendChild(\n    createRangeInput(\"EDL Radius\", \"eyeDomeLightingRadius\", 0, 4.0, 0.1)\n  );\n  pointCloudShadingContainer.appendChild(edlContainer);\n\n  updatePanelContents.appendChild(\n    createCheckbox(\"Freeze Frame\", \"freezeFrame\")\n  );\n  updatePanelContents.appendChild(\n    createCheckbox(\"Dynamic Screen Space Error\", \"dynamicScreenSpaceError\")\n  );\n  const sseContainer = document.createElement(\"div\");\n  sseContainer.appendChild(\n    createRangeInput(\n      \"Maximum Screen Space Error\",\n      \"maximumScreenSpaceError\",\n      0,\n      128,\n      1\n    )\n  );\n  updatePanelContents.appendChild(sseContainer);\n  const dynamicScreenSpaceErrorContainer = document.createElement(\"div\");\n  dynamicScreenSpaceErrorContainer.setAttribute(\n    \"data-bind\",\n    \"visible: dynamicScreenSpaceError\"\n  );\n  dynamicScreenSpaceErrorContainer.appendChild(\n    createRangeInput(\n      \"Screen Space Error Density\",\n      \"dynamicScreenSpaceErrorDensitySliderValue\",\n      0,\n      1,\n      0.005,\n      \"dynamicScreenSpaceErrorDensity\"\n    )\n  );\n  dynamicScreenSpaceErrorContainer.appendChild(\n    createRangeInput(\n      \"Screen Space Error Factor\",\n      \"dynamicScreenSpaceErrorFactor\",\n      1,\n      10,\n      0.1\n    )\n  );\n  updatePanelContents.appendChild(dynamicScreenSpaceErrorContainer);\n\n  loggingPanelContents.appendChild(\n    createCheckbox(\"Performance\", \"performance\")\n  );\n  loggingPanelContents.appendChild(performanceContainer);\n  loggingPanelContents.appendChild(\n    createCheckbox(\"Statistics\", \"showStatistics\")\n  );\n  const statistics = document.createElement(\"div\");\n  statistics.className = \"cesium-3dTilesInspector-statistics\";\n  statistics.setAttribute(\n    \"data-bind\",\n    \"html: statisticsText, visible: showStatistics\"\n  );\n  loggingPanelContents.appendChild(statistics);\n  loggingPanelContents.appendChild(\n    createCheckbox(\"Pick Statistics\", \"showPickStatistics\")\n  );\n  const pickStatistics = document.createElement(\"div\");\n  pickStatistics.className = \"cesium-3dTilesInspector-statistics\";\n  pickStatistics.setAttribute(\n    \"data-bind\",\n    \"html: pickStatisticsText, visible: showPickStatistics\"\n  );\n  loggingPanelContents.appendChild(pickStatistics);\n  loggingPanelContents.appendChild(\n    createCheckbox(\"Resource Cache Statistics\", \"showResourceCacheStatistics\")\n  );\n  const resourceCacheStatistics = document.createElement(\"div\");\n  resourceCacheStatistics.className = \"cesium-3dTilesInspector-statistics\";\n  resourceCacheStatistics.setAttribute(\n    \"data-bind\",\n    \"html: resourceCacheStatisticsText, visible: showResourceCacheStatistics\"\n  );\n  loggingPanelContents.appendChild(resourceCacheStatistics);\n\n  const stylePanelEditor = document.createElement(\"div\");\n  stylePanelContents.appendChild(stylePanelEditor);\n  stylePanelEditor.appendChild(document.createTextNode(\"Color Blend Mode: \"));\n  const blendDropdown = document.createElement(\"select\");\n  blendDropdown.setAttribute(\n    \"data-bind\",\n    \"options: colorBlendModes, \" +\n      'optionsText: \"text\", ' +\n      'optionsValue: \"value\", ' +\n      \"value: colorBlendMode\"\n  );\n  stylePanelEditor.appendChild(blendDropdown);\n  const styleEditor = document.createElement(\"textarea\");\n  styleEditor.setAttribute(\n    \"data-bind\",\n    \"textInput: styleString, event: { keydown: styleEditorKeyPress }\"\n  );\n  stylePanelEditor.className = \"cesium-cesiumInspector-styleEditor\";\n  stylePanelEditor.appendChild(styleEditor);\n  const closeStylesBtn = createButton(\"Compile (Ctrl+Enter)\", \"compileStyle\");\n  stylePanelEditor.appendChild(closeStylesBtn);\n  const errorBox = document.createElement(\"div\");\n  errorBox.className = \"cesium-cesiumInspector-error\";\n  errorBox.setAttribute(\"data-bind\", \"text: editorError\");\n  stylePanelEditor.appendChild(errorBox);\n\n  tileDebugLabelsPanelContents.appendChild(\n    createCheckbox(\"Show Picked Only\", \"showOnlyPickedTileDebugLabel\")\n  );\n  tileDebugLabelsPanelContents.appendChild(\n    createCheckbox(\"Geometric Error\", \"showGeometricError\")\n  );\n  tileDebugLabelsPanelContents.appendChild(\n    createCheckbox(\"Rendering Statistics\", \"showRenderingStatistics\")\n  );\n  tileDebugLabelsPanelContents.appendChild(\n    createCheckbox(\"Memory Usage (MB)\", \"showMemoryUsage\")\n  );\n  tileDebugLabelsPanelContents.appendChild(createCheckbox(\"Url\", \"showUrl\"));\n\n  optimizationPanelContents.appendChild(\n    createCheckbox(\"Skip Tile LODs\", \"skipLevelOfDetail\")\n  );\n  const skipScreenSpaceErrorFactorContainer = document.createElement(\"div\");\n  skipScreenSpaceErrorFactorContainer.appendChild(\n    createRangeInput(\"Skip SSE Factor\", \"skipScreenSpaceErrorFactor\", 1, 50, 1)\n  );\n  optimizationPanelContents.appendChild(skipScreenSpaceErrorFactorContainer);\n  const baseScreenSpaceError = document.createElement(\"div\");\n  baseScreenSpaceError.appendChild(\n    createRangeInput(\n      \"SSE before skipping LOD\",\n      \"baseScreenSpaceError\",\n      0,\n      4096,\n      1\n    )\n  );\n  optimizationPanelContents.appendChild(baseScreenSpaceError);\n  const skipLevelsContainer = document.createElement(\"div\");\n  skipLevelsContainer.appendChild(\n    createRangeInput(\"Min. levels to skip\", \"skipLevels\", 0, 10, 1)\n  );\n  optimizationPanelContents.appendChild(skipLevelsContainer);\n  optimizationPanelContents.appendChild(\n    createCheckbox(\n      \"Load only tiles that meet the max SSE.\",\n      \"immediatelyLoadDesiredLevelOfDetail\"\n    )\n  );\n  optimizationPanelContents.appendChild(\n    createCheckbox(\"Load siblings of visible tiles\", \"loadSiblings\")\n  );\n\n  knockout.applyBindings(viewModel, element);\n}\n\nObject.defineProperties(Cesium3DTilesInspector.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof Cesium3DTilesInspector.prototype\n   *\n   * @type {Element}\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the view model.\n   * @memberof Cesium3DTilesInspector.prototype\n   *\n   * @type {Cesium3DTilesInspectorViewModel}\n   */\n  viewModel: {\n    get: function () {\n      return this._viewModel;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nCesium3DTilesInspector.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nCesium3DTilesInspector.prototype.destroy = function () {\n  knockout.cleanNode(this._element);\n  this._container.removeChild(this._element);\n  this.viewModel.destroy();\n\n  return destroyObject(this);\n};\n\nexport default Cesium3DTilesInspector;\n", "import {\n  defaultValue,\n  defined,\n  DeveloperError,\n  EllipsoidTerrainProvider,\n  ImageryLayer,\n  Terrain,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n/**\n * The view model for {@link BaseLayerPicker}.\n * @alias BaseLayerPickerViewModel\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Globe} options.globe The Globe to use.\n * @param {ProviderViewModel[]} [options.imageryProviderViewModels=[]] The array of ProviderViewModel instances to use for imagery.\n * @param {ProviderViewModel} [options.selectedImageryProviderViewModel] The view model for the current base imagery layer, if not supplied the first available imagery layer is used.\n * @param {ProviderViewModel[]} [options.terrainProviderViewModels=[]] The array of ProviderViewModel instances to use for terrain.\n * @param {ProviderViewModel} [options.selectedTerrainProviderViewModel] The view model for the current base terrain layer, if not supplied the first available terrain layer is used.\n *\n * @exception {DeveloperError} imageryProviderViewModels must be an array.\n * @exception {DeveloperError} terrainProviderViewModels must be an array.\n */\nfunction BaseLayerPickerViewModel(options) {\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const globe = options.globe;\n  const imageryProviderViewModels = defaultValue(\n    options.imageryProviderViewModels,\n    []\n  );\n  const terrainProviderViewModels = defaultValue(\n    options.terrainProviderViewModels,\n    []\n  );\n\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(globe)) {\n    throw new DeveloperError(\"globe is required\");\n  }\n  //>>includeEnd('debug');\n\n  this._globe = globe;\n\n  /**\n   * Gets or sets an array of ProviderViewModel instances available for imagery selection.\n   * This property is observable.\n   * @type {ProviderViewModel[]}\n   */\n  this.imageryProviderViewModels = imageryProviderViewModels.slice(0);\n\n  /**\n   * Gets or sets an array of ProviderViewModel instances available for terrain selection.\n   * This property is observable.\n   * @type {ProviderViewModel[]}\n   */\n  this.terrainProviderViewModels = terrainProviderViewModels.slice(0);\n\n  /**\n   * Gets or sets whether the imagery selection drop-down is currently visible.\n   * @type {boolean}\n   * @default false\n   */\n  this.dropDownVisible = false;\n\n  knockout.track(this, [\n    \"imageryProviderViewModels\",\n    \"terrainProviderViewModels\",\n    \"dropDownVisible\",\n  ]);\n\n  const imageryObservable = knockout.getObservable(\n    this,\n    \"imageryProviderViewModels\"\n  );\n  const imageryProviders = knockout.pureComputed(function () {\n    const providers = imageryObservable();\n    const categories = {};\n    let i;\n    for (i = 0; i < providers.length; i++) {\n      const provider = providers[i];\n      const category = provider.category;\n      if (defined(categories[category])) {\n        categories[category].push(provider);\n      } else {\n        categories[category] = [provider];\n      }\n    }\n    const allCategoryNames = Object.keys(categories);\n\n    const result = [];\n    for (i = 0; i < allCategoryNames.length; i++) {\n      const name = allCategoryNames[i];\n      result.push({\n        name: name,\n        providers: categories[name],\n      });\n    }\n    return result;\n  });\n  this._imageryProviders = imageryProviders;\n\n  const terrainObservable = knockout.getObservable(\n    this,\n    \"terrainProviderViewModels\"\n  );\n  const terrainProviders = knockout.pureComputed(function () {\n    const providers = terrainObservable();\n    const categories = {};\n    let i;\n    for (i = 0; i < providers.length; i++) {\n      const provider = providers[i];\n      const category = provider.category;\n      if (defined(categories[category])) {\n        categories[category].push(provider);\n      } else {\n        categories[category] = [provider];\n      }\n    }\n    const allCategoryNames = Object.keys(categories);\n\n    const result = [];\n    for (i = 0; i < allCategoryNames.length; i++) {\n      const name = allCategoryNames[i];\n      result.push({\n        name: name,\n        providers: categories[name],\n      });\n    }\n    return result;\n  });\n  this._terrainProviders = terrainProviders;\n\n  /**\n   * Gets the button tooltip.  This property is observable.\n   * @type {string}\n   */\n  this.buttonTooltip = undefined;\n  knockout.defineProperty(this, \"buttonTooltip\", function () {\n    const selectedImagery = this.selectedImagery;\n    const selectedTerrain = this.selectedTerrain;\n\n    const imageryTip = defined(selectedImagery)\n      ? selectedImagery.name\n      : undefined;\n    const terrainTip = defined(selectedTerrain)\n      ? selectedTerrain.name\n      : undefined;\n\n    if (defined(imageryTip) && defined(terrainTip)) {\n      return `${imageryTip}\\n${terrainTip}`;\n    } else if (defined(imageryTip)) {\n      return imageryTip;\n    }\n    return terrainTip;\n  });\n\n  /**\n   * Gets the button background image.  This property is observable.\n   * @type {string}\n   */\n  this.buttonImageUrl = undefined;\n  knockout.defineProperty(this, \"buttonImageUrl\", function () {\n    const selectedImagery = this.selectedImagery;\n    if (defined(selectedImagery)) {\n      return selectedImagery.iconUrl;\n    }\n  });\n\n  /**\n   * Gets or sets the currently selected imagery.  This property is observable.\n   * @type {ProviderViewModel}\n   * @default undefined\n   */\n  this.selectedImagery = undefined;\n  const selectedImageryViewModel = knockout.observable();\n\n  this._currentImageryLayers = [];\n  knockout.defineProperty(this, \"selectedImagery\", {\n    get: function () {\n      return selectedImageryViewModel();\n    },\n    set: function (value) {\n      if (selectedImageryViewModel() === value) {\n        this.dropDownVisible = false;\n        return;\n      }\n\n      let i;\n      const currentImageryLayers = this._currentImageryLayers;\n      const currentImageryLayersLength = currentImageryLayers.length;\n      const imageryLayers = this._globe.imageryLayers;\n      let hadExistingBaseLayer = false;\n      for (i = 0; i < currentImageryLayersLength; i++) {\n        const layersLength = imageryLayers.length;\n        for (let x = 0; x < layersLength; x++) {\n          const layer = imageryLayers.get(x);\n          if (layer === currentImageryLayers[i]) {\n            imageryLayers.remove(layer);\n            hadExistingBaseLayer = true;\n            break;\n          }\n        }\n      }\n\n      if (defined(value)) {\n        const newProviders = value.creationCommand();\n        if (Array.isArray(newProviders)) {\n          const newProvidersLength = newProviders.length;\n          this._currentImageryLayers = [];\n          for (i = newProvidersLength - 1; i >= 0; i--) {\n            const layer = ImageryLayer.fromProviderAsync(newProviders[i]);\n            imageryLayers.add(layer, 0);\n            this._currentImageryLayers.push(layer);\n          }\n        } else {\n          this._currentImageryLayers = [];\n          const layer = ImageryLayer.fromProviderAsync(newProviders);\n          layer.name = value.name;\n          if (hadExistingBaseLayer) {\n            imageryLayers.add(layer, 0);\n          } else {\n            const baseLayer = imageryLayers.get(0);\n            if (defined(baseLayer)) {\n              imageryLayers.remove(baseLayer);\n            }\n            imageryLayers.add(layer, 0);\n          }\n          this._currentImageryLayers.push(layer);\n        }\n      }\n      selectedImageryViewModel(value);\n      this.dropDownVisible = false;\n    },\n  });\n\n  /**\n   * Gets or sets the currently selected terrain.  This property is observable.\n   * @type {ProviderViewModel}\n   * @default undefined\n   */\n  this.selectedTerrain = undefined;\n  const selectedTerrainViewModel = knockout.observable();\n\n  knockout.defineProperty(this, \"selectedTerrain\", {\n    get: function () {\n      return selectedTerrainViewModel();\n    },\n    set: function (value) {\n      if (selectedTerrainViewModel() === value) {\n        this.dropDownVisible = false;\n        return;\n      }\n\n      let newProvider;\n      if (defined(value)) {\n        newProvider = value.creationCommand();\n      }\n\n      // If this is not a promise, we must set this synchronously to avoid overriding depthTestAgainstTerrain\n      // See https://github.com/CesiumGS/cesium/issues/6991\n      if (defined(newProvider) && !defined(newProvider.then)) {\n        this._globe.depthTestAgainstTerrain = !(\n          newProvider instanceof EllipsoidTerrainProvider\n        );\n        this._globe.terrainProvider = newProvider;\n      } else if (defined(newProvider)) {\n        let cancelUpdate = false;\n        const removeCancelListener = this._globe.terrainProviderChanged.addEventListener(\n          () => {\n            cancelUpdate = true;\n            removeCancelListener();\n          }\n        );\n\n        const terrain = new Terrain(newProvider);\n        const removeEventListener = terrain.readyEvent.addEventListener(\n          (terrainProvider) => {\n            if (cancelUpdate) {\n              // Early return in case something has changed outside of the picker.\n              return;\n            }\n\n            this._globe.depthTestAgainstTerrain = !(\n              terrainProvider instanceof EllipsoidTerrainProvider\n            );\n            this._globe.terrainProvider = terrainProvider;\n            removeEventListener();\n          }\n        );\n      }\n\n      selectedTerrainViewModel(value);\n      this.dropDownVisible = false;\n    },\n  });\n\n  const that = this;\n  this._toggleDropDown = createCommand(function () {\n    that.dropDownVisible = !that.dropDownVisible;\n  });\n\n  this.selectedImagery = defaultValue(\n    options.selectedImageryProviderViewModel,\n    imageryProviderViewModels[0]\n  );\n  this.selectedTerrain = defaultValue(\n    options.selectedTerrainProviderViewModel,\n    terrainProviderViewModels[0]\n  );\n}\n\nObject.defineProperties(BaseLayerPickerViewModel.prototype, {\n  /**\n   * Gets the command to toggle the visibility of the drop down.\n   * @memberof BaseLayerPickerViewModel.prototype\n   *\n   * @type {Command}\n   */\n  toggleDropDown: {\n    get: function () {\n      return this._toggleDropDown;\n    },\n  },\n\n  /**\n   * Gets the globe.\n   * @memberof BaseLayerPickerViewModel.prototype\n   *\n   * @type {Globe}\n   */\n  globe: {\n    get: function () {\n      return this._globe;\n    },\n  },\n});\nexport default BaseLayerPickerViewModel;\n", "import {\n  defined,\n  destroyObject,\n  DeveloperError,\n  FeatureDetection,\n  getElement,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport BaseLayerPickerViewModel from \"./BaseLayerPickerViewModel.js\";\n\n/**\n * <span style=\"display: block; text-align: center;\">\n * <img src=\"Images/BaseLayerPicker.png\" width=\"264\" alt=\"BaseLayerPicker\" />\n * <br />BaseLayerPicker with its drop-panel open.\n * </span>\n * <br /><br />\n * The BaseLayerPicker is a single button widget that displays a panel of available imagery and\n * terrain providers.  When imagery is selected, the corresponding imagery layer is created and inserted\n * as the base layer of the imagery collection; removing the existing base.  When terrain is selected,\n * it replaces the current terrain provider.  Each item in the available providers list contains a name,\n * a representative icon, and a tooltip to display more information when hovered. The list is initially\n * empty, and must be configured before use, as illustrated in the below example.\n * <br /><br />\n * By default, the BaseLayerPicker uses a default list of example providers for demonstration purposes.\n * Notably some of these providers, such as <a href=\"https://developers.arcgis.com\" target=\"_blank\">Esri ArcGIS</a> and <a href=\"https://docs.stadiamaps.com/ target=\"_blank\">Stadia Maps</a>, have seperate terms of service and require authentication for production use.\n *\n * @alias BaseLayerPicker\n * @constructor\n *\n * @param {Element|string} container The parent HTML container node or ID for this widget.\n * @param {object} options Object with the following properties:\n * @param {Globe} options.globe The Globe to use.\n * @param {ProviderViewModel[]} [options.imageryProviderViewModels=[]] The array of ProviderViewModel instances to use for imagery.\n * @param {ProviderViewModel} [options.selectedImageryProviderViewModel] The view model for the current base imagery layer, if not supplied the first available imagery layer is used.\n * @param {ProviderViewModel[]} [options.terrainProviderViewModels=[]] The array of ProviderViewModel instances to use for terrain.\n * @param {ProviderViewModel} [options.selectedTerrainProviderViewModel] The view model for the current base terrain layer, if not supplied the first available terrain layer is used.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n *\n *\n * @example\n * // In HTML head, include a link to the BaseLayerPicker.css stylesheet,\n * // and in the body, include: <div id=\"baseLayerPickerContainer\"\n * //   style=\"position:absolute;top:24px;right:24px;width:38px;height:38px;\"></div>\n *\n * //Create the list of available providers we would like the user to select from.\n * //This example uses 3, OpenStreetMap, The Black Marble, and a single, non-streaming world image.\n * const imageryViewModels = [];\n * imageryViewModels.push(new Cesium.ProviderViewModel({\n *      name: \"Open\\u00adStreet\\u00adMap\",\n *      iconUrl: Cesium.buildModuleUrl(\"Widgets/Images/ImageryProviders/openStreetMap.png\"),\n *      tooltip: \"OpenStreetMap (OSM) is a collaborative project to create a free editable \\\n * map of the world.\\nhttp://www.openstreetmap.org\",\n *      creationFunction: function() {\n *          return new Cesium.OpenStreetMapImageryProvider({\n *              url: \"https://tile.openstreetmap.org/\"\n *          });\n *      }\n *  }));\n *\n *  imageryViewModels.push(new Cesium.ProviderViewModel({\n *      name: \"Earth at Night\",\n *      iconUrl: Cesium.buildModuleUrl(\"Widgets/Images/ImageryProviders/blackMarble.png\"),\n *      tooltip: \"The lights of cities and villages trace the outlines of civilization \\\n * in this global view of the Earth at night as seen by NASA/NOAA's Suomi NPP satellite.\",\n *      creationFunction: function() {\n *          return Cesium.IonImageryProvider.fromAssetId(3812);\n *      }\n *  }));\n *\n *  imageryViewModels.push(new Cesium.ProviderViewModel({\n *      name: \"Natural Earth\\u00a0II\",\n *      iconUrl: Cesium.buildModuleUrl(\"Widgets/Images/ImageryProviders/naturalEarthII.png\"),\n *      tooltip: \"Natural Earth II, darkened for contrast.\\nhttp://www.naturalearthdata.com/\",\n *      creationFunction: function() {\n *          return Cesium.TileMapServiceImageryProvider.fromUrl(\n *              Cesium.buildModuleUrl(\"Assets/Textures/NaturalEarthII\")\n *          );\n *      }\n *  }));\n *\n * //Create a CesiumWidget without imagery, if you haven't already done so.\n * const cesiumWidget = new Cesium.CesiumWidget(\"cesiumContainer\", { baseLayer: false });\n *\n * //Finally, create the baseLayerPicker widget using our view models.\n * const layers = cesiumWidget.imageryLayers;\n * const baseLayerPicker = new Cesium.BaseLayerPicker(\"baseLayerPickerContainer\", {\n *     globe: cesiumWidget.scene.globe,\n *     imageryProviderViewModels: imageryViewModels\n * });\n *\n * @see TerrainProvider\n * @see ImageryProvider\n * @see ImageryLayerCollection\n */\nfunction BaseLayerPicker(container, options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(container)) {\n    throw new DeveloperError(\"container is required.\");\n  }\n  //>>includeEnd('debug');\n\n  container = getElement(container);\n\n  const viewModel = new BaseLayerPickerViewModel(options);\n\n  const element = document.createElement(\"button\");\n  element.type = \"button\";\n  element.className = \"cesium-button cesium-toolbar-button\";\n  element.setAttribute(\n    \"data-bind\",\n    \"\\\nattr: { title: buttonTooltip },\\\nclick: toggleDropDown\"\n  );\n  container.appendChild(element);\n\n  const imgElement = document.createElement(\"img\");\n  imgElement.setAttribute(\"draggable\", \"false\");\n  imgElement.className = \"cesium-baseLayerPicker-selected\";\n  imgElement.setAttribute(\n    \"data-bind\",\n    \"\\\nattr: { src: buttonImageUrl }, visible: !!buttonImageUrl\"\n  );\n  element.appendChild(imgElement);\n\n  const dropPanel = document.createElement(\"div\");\n  dropPanel.className = \"cesium-baseLayerPicker-dropDown\";\n  dropPanel.setAttribute(\n    \"data-bind\",\n    '\\\ncss: { \"cesium-baseLayerPicker-dropDown-visible\" : dropDownVisible }'\n  );\n  container.appendChild(dropPanel);\n\n  const imageryTitle = document.createElement(\"div\");\n  imageryTitle.className = \"cesium-baseLayerPicker-sectionTitle\";\n  imageryTitle.setAttribute(\n    \"data-bind\",\n    \"visible: imageryProviderViewModels.length > 0\"\n  );\n  imageryTitle.innerHTML = \"Imagery\";\n  dropPanel.appendChild(imageryTitle);\n\n  const imagerySection = document.createElement(\"div\");\n  imagerySection.className = \"cesium-baseLayerPicker-section\";\n  imagerySection.setAttribute(\"data-bind\", \"foreach: _imageryProviders\");\n  dropPanel.appendChild(imagerySection);\n\n  const imageryCategories = document.createElement(\"div\");\n  imageryCategories.className = \"cesium-baseLayerPicker-category\";\n  imagerySection.appendChild(imageryCategories);\n\n  const categoryTitle = document.createElement(\"div\");\n  categoryTitle.className = \"cesium-baseLayerPicker-categoryTitle\";\n  categoryTitle.setAttribute(\"data-bind\", \"text: name\");\n  imageryCategories.appendChild(categoryTitle);\n\n  const imageryChoices = document.createElement(\"div\");\n  imageryChoices.className = \"cesium-baseLayerPicker-choices\";\n  imageryChoices.setAttribute(\"data-bind\", \"foreach: providers\");\n  imageryCategories.appendChild(imageryChoices);\n\n  const imageryProvider = document.createElement(\"div\");\n  imageryProvider.className = \"cesium-baseLayerPicker-item\";\n  imageryProvider.setAttribute(\n    \"data-bind\",\n    '\\\ncss: { \"cesium-baseLayerPicker-selectedItem\" : $data === $parents[1].selectedImagery },\\\nattr: { title: tooltip },\\\nvisible: creationCommand.canExecute,\\\nclick: function($data) { $parents[1].selectedImagery = $data; }'\n  );\n  imageryChoices.appendChild(imageryProvider);\n\n  const providerIcon = document.createElement(\"img\");\n  providerIcon.className = \"cesium-baseLayerPicker-itemIcon\";\n  providerIcon.setAttribute(\"data-bind\", \"attr: { src: iconUrl }\");\n  providerIcon.setAttribute(\"draggable\", \"false\");\n  imageryProvider.appendChild(providerIcon);\n\n  const providerLabel = document.createElement(\"div\");\n  providerLabel.className = \"cesium-baseLayerPicker-itemLabel\";\n  providerLabel.setAttribute(\"data-bind\", \"text: name\");\n  imageryProvider.appendChild(providerLabel);\n\n  const terrainTitle = document.createElement(\"div\");\n  terrainTitle.className = \"cesium-baseLayerPicker-sectionTitle\";\n  terrainTitle.setAttribute(\n    \"data-bind\",\n    \"visible: terrainProviderViewModels.length > 0\"\n  );\n  terrainTitle.innerHTML = \"Terrain\";\n  dropPanel.appendChild(terrainTitle);\n\n  const terrainSection = document.createElement(\"div\");\n  terrainSection.className = \"cesium-baseLayerPicker-section\";\n  terrainSection.setAttribute(\"data-bind\", \"foreach: _terrainProviders\");\n  dropPanel.appendChild(terrainSection);\n\n  const terrainCategories = document.createElement(\"div\");\n  terrainCategories.className = \"cesium-baseLayerPicker-category\";\n  terrainSection.appendChild(terrainCategories);\n\n  const terrainCategoryTitle = document.createElement(\"div\");\n  terrainCategoryTitle.className = \"cesium-baseLayerPicker-categoryTitle\";\n  terrainCategoryTitle.setAttribute(\"data-bind\", \"text: name\");\n  terrainCategories.appendChild(terrainCategoryTitle);\n\n  const terrainChoices = document.createElement(\"div\");\n  terrainChoices.className = \"cesium-baseLayerPicker-choices\";\n  terrainChoices.setAttribute(\"data-bind\", \"foreach: providers\");\n  terrainCategories.appendChild(terrainChoices);\n\n  const terrainProvider = document.createElement(\"div\");\n  terrainProvider.className = \"cesium-baseLayerPicker-item\";\n  terrainProvider.setAttribute(\n    \"data-bind\",\n    '\\\ncss: { \"cesium-baseLayerPicker-selectedItem\" : $data === $parents[1].selectedTerrain },\\\nattr: { title: tooltip },\\\nvisible: creationCommand.canExecute,\\\nclick: function($data) { $parents[1].selectedTerrain = $data; }'\n  );\n  terrainChoices.appendChild(terrainProvider);\n\n  const terrainProviderIcon = document.createElement(\"img\");\n  terrainProviderIcon.className = \"cesium-baseLayerPicker-itemIcon\";\n  terrainProviderIcon.setAttribute(\"data-bind\", \"attr: { src: iconUrl }\");\n  terrainProviderIcon.setAttribute(\"draggable\", \"false\");\n  terrainProvider.appendChild(terrainProviderIcon);\n\n  const terrainProviderLabel = document.createElement(\"div\");\n  terrainProviderLabel.className = \"cesium-baseLayerPicker-itemLabel\";\n  terrainProviderLabel.setAttribute(\"data-bind\", \"text: name\");\n  terrainProvider.appendChild(terrainProviderLabel);\n\n  knockout.applyBindings(viewModel, element);\n  knockout.applyBindings(viewModel, dropPanel);\n\n  this._viewModel = viewModel;\n  this._container = container;\n  this._element = element;\n  this._dropPanel = dropPanel;\n\n  this._closeDropDown = function (e) {\n    if (!(element.contains(e.target) || dropPanel.contains(e.target))) {\n      viewModel.dropDownVisible = false;\n    }\n  };\n\n  if (FeatureDetection.supportsPointerEvents()) {\n    document.addEventListener(\"pointerdown\", this._closeDropDown, true);\n  } else {\n    document.addEventListener(\"mousedown\", this._closeDropDown, true);\n    document.addEventListener(\"touchstart\", this._closeDropDown, true);\n  }\n}\n\nObject.defineProperties(BaseLayerPicker.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof BaseLayerPicker.prototype\n   *\n   * @type {Element}\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the view model.\n   * @memberof BaseLayerPicker.prototype\n   *\n   * @type {BaseLayerPickerViewModel}\n   */\n  viewModel: {\n    get: function () {\n      return this._viewModel;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nBaseLayerPicker.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nBaseLayerPicker.prototype.destroy = function () {\n  if (FeatureDetection.supportsPointerEvents()) {\n    document.removeEventListener(\"pointerdown\", this._closeDropDown, true);\n  } else {\n    document.removeEventListener(\"mousedown\", this._closeDropDown, true);\n    document.removeEventListener(\"touchstart\", this._closeDropDown, true);\n  }\n\n  knockout.cleanNode(this._element);\n  knockout.cleanNode(this._dropPanel);\n  this._container.removeChild(this._element);\n  this._container.removeChild(this._dropPanel);\n  return destroyObject(this);\n};\nexport default BaseLayerPicker;\n", "import { defaultValue, defined, DeveloperError } from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n/**\n * A view model that represents each item in the {@link BaseLayerPicker}.\n *\n * @alias ProviderViewModel\n * @constructor\n *\n * @param {object} options The object containing all parameters.\n * @param {string} options.name The name of the layer.\n * @param {string} options.tooltip The tooltip to show when the item is moused over.\n * @param {string} options.iconUrl An icon representing the layer.\n * @param {string} [options.category] A category for the layer.\n * @param {ProviderViewModel.CreationFunction|Command} options.creationFunction A function or Command\n *        that creates one or more providers which will be added to the globe when this item is selected.\n *\n * @see BaseLayerPicker\n * @see ImageryProvider\n * @see TerrainProvider\n */\nfunction ProviderViewModel(options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options.name)) {\n    throw new DeveloperError(\"options.name is required.\");\n  }\n  if (!defined(options.tooltip)) {\n    throw new DeveloperError(\"options.tooltip is required.\");\n  }\n  if (!defined(options.iconUrl)) {\n    throw new DeveloperError(\"options.iconUrl is required.\");\n  }\n  if (typeof options.creationFunction !== \"function\") {\n    throw new DeveloperError(\"options.creationFunction is required.\");\n  }\n  //>>includeEnd('debug');\n\n  let creationCommand = options.creationFunction;\n  if (!defined(creationCommand.canExecute)) {\n    creationCommand = createCommand(creationCommand);\n  }\n\n  this._creationCommand = creationCommand;\n\n  /**\n   * Gets the display name.  This property is observable.\n   * @type {string}\n   */\n  this.name = options.name;\n\n  /**\n   * Gets the tooltip.  This property is observable.\n   * @type {string}\n   */\n  this.tooltip = options.tooltip;\n\n  /**\n   * Gets the icon.  This property is observable.\n   * @type {string}\n   */\n  this.iconUrl = options.iconUrl;\n\n  this._category = defaultValue(options.category, \"\");\n\n  knockout.track(this, [\"name\", \"tooltip\", \"iconUrl\"]);\n}\n\nObject.defineProperties(ProviderViewModel.prototype, {\n  /**\n   * Gets the Command that creates one or more providers which will be added to\n   * the globe when this item is selected.\n   * @memberof ProviderViewModel.prototype\n   * @memberof ProviderViewModel.prototype\n   * @type {Command}\n   * @readonly\n   */\n  creationCommand: {\n    get: function () {\n      return this._creationCommand;\n    },\n  },\n\n  /**\n   * Gets the category\n   * @type {string}\n   * @memberof ProviderViewModel.prototype\n   * @readonly\n   */\n  category: {\n    get: function () {\n      return this._category;\n    },\n  },\n});\n\n/**\n * A function which creates one or more providers.\n * @callback ProviderViewModel.CreationFunction\n * @returns {ImageryProvider|TerrainProvider|ImageryProvider[]|TerrainProvider[]|Promise<TerrainProvider>|Promise<ImageryProvider>|Promise<TerrainProvider[]>|Promise<ImageryProvider[]>}\n *          The ImageryProvider or TerrainProvider, or array of providers, to be added\n *          to the globe.\n */\nexport default ProviderViewModel;\n", "import {\n  ArcGisMapServerImageryProvider,\n  buildModuleUrl,\n  createWorldImageryAsync,\n  IonImageryProvider,\n  IonWorldImageryStyle,\n  OpenStreetMapImageryProvider,\n  TileMapServiceImageryProvider,\n  ArcGisBaseMapType,\n} from \"@cesium/engine\";\nimport ProviderViewModel from \"./ProviderViewModel.js\";\n\n/**\n * @private\n */\nfunction createDefaultImageryProviderViewModels() {\n  const providerViewModels = [];\n  const useRetinaTiles = devicePixelRatio >= 2.0;\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"Bing Maps Aerial\",\n      iconUrl: buildModuleUrl(\"Widgets/Images/ImageryProviders/bingAerial.png\"),\n      tooltip: \"Bing Maps aerial imagery, provided by Cesium ion\",\n      category: \"Cesium ion\",\n      creationFunction: function () {\n        return createWorldImageryAsync({\n          style: IonWorldImageryStyle.AERIAL,\n        });\n      },\n    })\n  );\n\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"Bing Maps Aerial with Labels\",\n      iconUrl: buildModuleUrl(\n        \"Widgets/Images/ImageryProviders/bingAerialLabels.png\"\n      ),\n      tooltip: \"Bing Maps aerial imagery with labels, provided by Cesium ion\",\n      category: \"Cesium ion\",\n      creationFunction: function () {\n        return createWorldImageryAsync({\n          style: IonWorldImageryStyle.AERIAL_WITH_LABELS,\n        });\n      },\n    })\n  );\n\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"Bing Maps Roads\",\n      iconUrl: buildModuleUrl(\"Widgets/Images/ImageryProviders/bingRoads.png\"),\n      tooltip: \"Bing Maps standard road maps, provided by Cesium ion\",\n      category: \"Cesium ion\",\n      creationFunction: function () {\n        return createWorldImageryAsync({\n          style: IonWorldImageryStyle.ROAD,\n        });\n      },\n    })\n  );\n\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"ArcGIS World Imagery\",\n      iconUrl: buildModuleUrl(\n        \"Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png\"\n      ),\n      tooltip:\n        \"\\\nArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower \\\nresolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) \\\nfor the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m \\\nresolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. \\\nIn addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the \\\nGIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). \\\nFor more information on this map, including the terms of use, visit us online at \\n\\\nhttps://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9\",\n      category: \"Other\",\n      creationFunction: function () {\n        return ArcGisMapServerImageryProvider.fromBasemapType(\n          ArcGisBaseMapType.SATELLITE,\n          {\n            enablePickFeatures: false,\n          }\n        );\n      },\n    })\n  );\n\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"ArcGIS World Hillshade\",\n      iconUrl: buildModuleUrl(\n        \"Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png\"\n      ),\n      tooltip:\n        \"\\\nArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, \\\nlandcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. \\\nThe basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available \\\ndown to ~1:9k. For more information on this map, including the terms of use, visit us online at \\n\\\nhttps://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d\",\n      category: \"Other\",\n      creationFunction: function () {\n        return ArcGisMapServerImageryProvider.fromBasemapType(\n          ArcGisBaseMapType.HILLSHADE,\n          {\n            enablePickFeatures: false,\n          }\n        );\n      },\n    })\n  );\n\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"Esri World Ocean\",\n      iconUrl: buildModuleUrl(\n        \"Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png\"\n      ),\n      tooltip:\n        \"\\\nArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data.  \\\nThe base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. \\\nThe map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, \\\nNational Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. \\\nThe base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. \\\nCoverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. \\\nFor more information on this map, including our terms of use, visit us online at \\n\\\nhttps://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500\",\n      category: \"Other\",\n      creationFunction: function () {\n        return ArcGisMapServerImageryProvider.fromBasemapType(\n          ArcGisBaseMapType.OCEANS,\n          {\n            enablePickFeatures: false,\n          }\n        );\n      },\n    })\n  );\n\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"Open\\u00adStreet\\u00adMap\",\n      iconUrl: buildModuleUrl(\n        \"Widgets/Images/ImageryProviders/openStreetMap.png\"\n      ),\n      tooltip:\n        \"OpenStreetMap (OSM) is a collaborative project to create a free editable map \\\nof the world.\\nhttp://www.openstreetmap.org\",\n      category: \"Other\",\n      creationFunction: function () {\n        return new OpenStreetMapImageryProvider({\n          url: \"https://tile.openstreetmap.org/\",\n        });\n      },\n    })\n  );\n\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"Stadia x Stamen Watercolor\",\n      iconUrl: buildModuleUrl(\n        \"Widgets/Images/ImageryProviders/stamenWatercolor.png\"\n      ),\n      tooltip:\n        \"Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\\nhttps://docs.stadiamaps.com/map-styles/stamen-watercolor/\",\n      category: \"Other\",\n      creationFunction: function () {\n        return new OpenStreetMapImageryProvider({\n          url: \"https://tiles.stadiamaps.com/tiles/stamen_watercolor/\",\n          fileExtension: \"jpg\",\n          credit: `&copy; <a href=\"https://stamen.com/\" target=\"_blank\">Stamen Design</a>\n           &copy; <a href=\"https://www.stadiamaps.com/\" target=\"_blank\">Stadia Maps</a>\n           &copy; <a href=\"https://openmaptiles.org/\" target=\"_blank\">OpenMapTiles</a>\n           &copy; <a href=\"https://www.openstreetmap.org/about/\" target=\"_blank\">OpenStreetMap contributors</a>`,\n        });\n      },\n    })\n  );\n\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"Stadia x Stamen Toner\",\n      iconUrl: buildModuleUrl(\n        \"Widgets/Images/ImageryProviders/stamenToner.png\"\n      ),\n      tooltip:\n        \"Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays.\\nhttps://docs.stadiamaps.com/map-styles/stamen-toner/\",\n      category: \"Other\",\n      creationFunction: function () {\n        return new OpenStreetMapImageryProvider({\n          url: \"https://tiles.stadiamaps.com/tiles/stamen_toner/\",\n          retinaTiles: useRetinaTiles,\n          credit: `&copy; <a href=\"https://stamen.com/\" target=\"_blank\">Stamen Design</a>\n            &copy; <a href=\"https://www.stadiamaps.com/\" target=\"_blank\">Stadia Maps</a>\n            &copy; <a href=\"https://openmaptiles.org/\" target=\"_blank\">OpenMapTiles</a>\n            &copy; <a href=\"https://www.openstreetmap.org/about/\" target=\"_blank\">OpenStreetMap contributors</a>`,\n        });\n      },\n    })\n  );\n\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"Stadia Alidade Smooth\",\n      iconUrl: buildModuleUrl(\n        \"Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png\"\n      ),\n      tooltip:\n        \"Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine.\\nhttps://docs.stadiamaps.com/map-styles/alidade-smooth/\",\n      category: \"Other\",\n      creationFunction: function () {\n        return new OpenStreetMapImageryProvider({\n          url: \"https://tiles.stadiamaps.com/tiles/alidade_smooth/\",\n          retinaTiles: useRetinaTiles,\n          credit: `&copy; <a href=\"https://www.stadiamaps.com/\" target=\"_blank\">Stadia Maps</a>\n            &copy; <a href=\"https://openmaptiles.org/\" target=\"_blank\">OpenMapTiles</a>\n            &copy; <a href=\"https://www.openstreetmap.org/about/\" target=\"_blank\">OpenStreetMap contributors</a>`,\n        });\n      },\n    })\n  );\n\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"Stadia Alidade Smooth Dark\",\n      iconUrl: buildModuleUrl(\n        \"Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png\"\n      ),\n      tooltip:\n        \"Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine.\\nhttps://docs.stadiamaps.com/map-styles/alidade-smooth-dark/\",\n      category: \"Other\",\n      creationFunction: function () {\n        return new OpenStreetMapImageryProvider({\n          url: \"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/\",\n          retinaTiles: useRetinaTiles,\n          credit: `&copy; <a href=\"https://www.stadiamaps.com/\" target=\"_blank\">Stadia Maps</a>\n            &copy; <a href=\"https://openmaptiles.org/\" target=\"_blank\">OpenMapTiles</a>\n            &copy; <a href=\"https://www.openstreetmap.org/about/\" target=\"_blank\">OpenStreetMap contributors</a>`,\n        });\n      },\n    })\n  );\n\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"Sentinel-2\",\n      iconUrl: buildModuleUrl(\"Widgets/Images/ImageryProviders/sentinel-2.png\"),\n      tooltip:\n        \"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).\",\n      category: \"Cesium ion\",\n      creationFunction: function () {\n        return IonImageryProvider.fromAssetId(3954);\n      },\n    })\n  );\n\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"Blue Marble\",\n      iconUrl: buildModuleUrl(\"Widgets/Images/ImageryProviders/blueMarble.png\"),\n      tooltip: \"Blue Marble Next Generation July, 2004 imagery from NASA.\",\n      category: \"Cesium ion\",\n      creationFunction: function () {\n        return IonImageryProvider.fromAssetId(3845);\n      },\n    })\n  );\n\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"Earth at night\",\n      iconUrl: buildModuleUrl(\n        \"Widgets/Images/ImageryProviders/earthAtNight.png\"\n      ),\n      tooltip:\n        \"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.\",\n      category: \"Cesium ion\",\n      creationFunction: function () {\n        return IonImageryProvider.fromAssetId(3812);\n      },\n    })\n  );\n\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"Natural Earth\\u00a0II\",\n      iconUrl: buildModuleUrl(\n        \"Widgets/Images/ImageryProviders/naturalEarthII.png\"\n      ),\n      tooltip:\n        \"Natural Earth II, darkened for contrast.\\nhttp://www.naturalearthdata.com/\",\n      category: \"Cesium ion\",\n      creationFunction: function () {\n        return TileMapServiceImageryProvider.fromUrl(\n          buildModuleUrl(\"Assets/Textures/NaturalEarthII\")\n        );\n      },\n    })\n  );\n\n  return providerViewModels;\n}\nexport default createDefaultImageryProviderViewModels;\n", "import {\n  buildModuleUrl,\n  createWorldTerrainAsync,\n  EllipsoidTerrainProvider,\n} from \"@cesium/engine\";\nimport ProviderViewModel from \"./ProviderViewModel.js\";\n\n/**\n * @private\n */\nfunction createDefaultTerrainProviderViewModels() {\n  const providerViewModels = [];\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"WGS84 Ellipsoid\",\n      iconUrl: buildModuleUrl(\"Widgets/Images/TerrainProviders/Ellipsoid.png\"),\n      tooltip: \"WGS84 standard ellipsoid, also known as EPSG:4326\",\n      category: \"Cesium ion\",\n      creationFunction: function () {\n        return new EllipsoidTerrainProvider();\n      },\n    })\n  );\n\n  providerViewModels.push(\n    new ProviderViewModel({\n      name: \"Cesium World Terrain\",\n      iconUrl: buildModuleUrl(\n        \"Widgets/Images/TerrainProviders/CesiumWorldTerrain.png\"\n      ),\n      tooltip:\n        \"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion\",\n      category: \"Cesium ion\",\n      creationFunction: function () {\n        return createWorldTerrainAsync({\n          requestWaterMask: true,\n          requestVertexNormals: true,\n        });\n      },\n    })\n  );\n\n  return providerViewModels;\n}\nexport default createDefaultTerrainProviderViewModels;\n", "import {\n  defaultValue,\n  defined,\n  destroyObject,\n  DeveloperError,\n  Fullscreen,\n  getElement,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n/**\n * The view model for {@link FullscreenButton}.\n * @alias FullscreenButtonViewModel\n * @constructor\n *\n * @param {Element|string} [fullscreenElement=document.body] The element or id to be placed into fullscreen mode.\n * @param {Element|string} [container] The DOM element or ID that will contain the widget.\n */\nfunction FullscreenButtonViewModel(fullscreenElement, container) {\n  if (!defined(container)) {\n    container = document.body;\n  }\n\n  container = getElement(container);\n\n  const that = this;\n\n  const tmpIsFullscreen = knockout.observable(Fullscreen.fullscreen);\n  const tmpIsEnabled = knockout.observable(Fullscreen.enabled);\n  const ownerDocument = container.ownerDocument;\n\n  /**\n   * Gets whether or not fullscreen mode is active.  This property is observable.\n   *\n   * @type {boolean}\n   */\n  this.isFullscreen = undefined;\n  knockout.defineProperty(this, \"isFullscreen\", {\n    get: function () {\n      return tmpIsFullscreen();\n    },\n  });\n\n  /**\n   * Gets or sets whether or not fullscreen functionality should be enabled.  This property is observable.\n   *\n   * @type {boolean}\n   * @see Fullscreen.enabled\n   */\n  this.isFullscreenEnabled = undefined;\n  knockout.defineProperty(this, \"isFullscreenEnabled\", {\n    get: function () {\n      return tmpIsEnabled();\n    },\n    set: function (value) {\n      tmpIsEnabled(value && Fullscreen.enabled);\n    },\n  });\n\n  /**\n   * Gets the tooltip.  This property is observable.\n   *\n   * @type {string}\n   */\n  this.tooltip = undefined;\n  knockout.defineProperty(this, \"tooltip\", function () {\n    if (!this.isFullscreenEnabled) {\n      return \"Full screen unavailable\";\n    }\n    return tmpIsFullscreen() ? \"Exit full screen\" : \"Full screen\";\n  });\n\n  this._command = createCommand(function () {\n    if (Fullscreen.fullscreen) {\n      Fullscreen.exitFullscreen();\n    } else {\n      Fullscreen.requestFullscreen(that._fullscreenElement);\n    }\n  }, knockout.getObservable(this, \"isFullscreenEnabled\"));\n\n  this._fullscreenElement = defaultValue(\n    getElement(fullscreenElement),\n    ownerDocument.body\n  );\n\n  this._callback = function () {\n    tmpIsFullscreen(Fullscreen.fullscreen);\n  };\n  ownerDocument.addEventListener(Fullscreen.changeEventName, this._callback);\n}\n\nObject.defineProperties(FullscreenButtonViewModel.prototype, {\n  /**\n   * Gets or sets the HTML element to place into fullscreen mode when the\n   * corresponding button is pressed.\n   * @memberof FullscreenButtonViewModel.prototype\n   *\n   * @type {Element}\n   */\n  fullscreenElement: {\n    //TODO:@exception {DeveloperError} value must be a valid HTML Element.\n    get: function () {\n      return this._fullscreenElement;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!(value instanceof Element)) {\n        throw new DeveloperError(\"value must be a valid Element.\");\n      }\n      //>>includeEnd('debug');\n\n      this._fullscreenElement = value;\n    },\n  },\n\n  /**\n   * Gets the Command to toggle fullscreen mode.\n   * @memberof FullscreenButtonViewModel.prototype\n   *\n   * @type {Command}\n   */\n  command: {\n    get: function () {\n      return this._command;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nFullscreenButtonViewModel.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the view model.  Should be called to\n * properly clean up the view model when it is no longer needed.\n */\nFullscreenButtonViewModel.prototype.destroy = function () {\n  document.removeEventListener(Fullscreen.changeEventName, this._callback);\n  destroyObject(this);\n};\nexport default FullscreenButtonViewModel;\n", "import {\n  defined,\n  destroyObject,\n  DeveloperError,\n  getElement,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport FullscreenButtonViewModel from \"./FullscreenButtonViewModel.js\";\n\nconst enterFullScreenPath =\n  \"M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z\";\nconst exitFullScreenPath =\n  \"M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z\";\n\n/**\n * A single button widget for toggling fullscreen mode.\n *\n * @alias FullscreenButton\n * @constructor\n *\n * @param {Element|string} container The DOM element or ID that will contain the widget.\n * @param {Element|string} [fullscreenElement=document.body] The element or id to be placed into fullscreen mode.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n *\n * @see Fullscreen\n */\nfunction FullscreenButton(container, fullscreenElement) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(container)) {\n    throw new DeveloperError(\"container is required.\");\n  }\n  //>>includeEnd('debug');\n\n  container = getElement(container);\n\n  const viewModel = new FullscreenButtonViewModel(fullscreenElement, container);\n\n  viewModel._exitFullScreenPath = exitFullScreenPath;\n  viewModel._enterFullScreenPath = enterFullScreenPath;\n\n  const element = document.createElement(\"button\");\n  element.type = \"button\";\n  element.className = \"cesium-button cesium-fullscreenButton\";\n  element.setAttribute(\n    \"data-bind\",\n    \"\\\nattr: { title: tooltip },\\\nclick: command,\\\nenable: isFullscreenEnabled,\\\ncesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }\"\n  );\n\n  container.appendChild(element);\n\n  knockout.applyBindings(viewModel, element);\n\n  this._container = container;\n  this._viewModel = viewModel;\n  this._element = element;\n}\n\nObject.defineProperties(FullscreenButton.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof FullscreenButton.prototype\n   *\n   * @type {Element}\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the view model.\n   * @memberof FullscreenButton.prototype\n   *\n   * @type {FullscreenButtonViewModel}\n   */\n  viewModel: {\n    get: function () {\n      return this._viewModel;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nFullscreenButton.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nFullscreenButton.prototype.destroy = function () {\n  this._viewModel.destroy();\n\n  knockout.cleanNode(this._element);\n  this._container.removeChild(this._element);\n\n  return destroyObject(this);\n};\nexport default FullscreenButton;\n", "import {\n  computeFlyToLocationForRectangle,\n  defaultValue,\n  defined,\n  DeveloperError,\n  destroyObject,\n  Event,\n  GeocoderService,\n  GeocodeType,\n  getElement,\n  IonGeocoderService,\n  Math as CesiumMath,\n  Matrix4,\n  Rectangle,\n  sampleTerrainMostDetailed,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n// The height we use if geocoding to a specific point instead of an rectangle.\nconst DEFAULT_HEIGHT = 1000;\n\n/**\n * The view model for the {@link Geocoder} widget.\n * @alias GeocoderViewModel\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Scene} options.scene The Scene instance to use.\n * @param {GeocoderService[]} [options.geocoderServices] Geocoder services to use for geocoding queries.\n *        If more than one are supplied, suggestions will be gathered for the geocoders that support it,\n *        and if no suggestion is selected the result from the first geocoder service wil be used.\n * @param {number} [options.flightDuration] The duration of the camera flight to an entered location, in seconds.\n * @param {Geocoder.DestinationFoundFunction} [options.destinationFound=GeocoderViewModel.flyToDestination] A callback function that is called after a successful geocode.  If not supplied, the default behavior is to fly the camera to the result destination.\n */\nfunction GeocoderViewModel(options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options) || !defined(options.scene)) {\n    throw new DeveloperError(\"options.scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  if (defined(options.geocoderServices)) {\n    this._geocoderServices = options.geocoderServices;\n  } else {\n    this._geocoderServices = [new IonGeocoderService({ scene: options.scene })];\n  }\n\n  this._viewContainer = options.container;\n  this._scene = options.scene;\n  this._flightDuration = options.flightDuration;\n  this._searchText = \"\";\n  this._isSearchInProgress = false;\n  this._wasGeocodeCancelled = false;\n  this._previousCredits = [];\n  this._complete = new Event();\n  this._suggestions = [];\n  this._selectedSuggestion = undefined;\n  this._showSuggestions = true;\n\n  this._handleArrowDown = handleArrowDown;\n  this._handleArrowUp = handleArrowUp;\n\n  const that = this;\n\n  this._suggestionsVisible = knockout.pureComputed(function () {\n    const suggestions = knockout.getObservable(that, \"_suggestions\");\n    const suggestionsNotEmpty = suggestions().length > 0;\n    const showSuggestions = knockout.getObservable(that, \"_showSuggestions\")();\n    return suggestionsNotEmpty && showSuggestions;\n  });\n\n  this._searchCommand = createCommand(function (geocodeType) {\n    geocodeType = defaultValue(geocodeType, GeocodeType.SEARCH);\n    that._focusTextbox = false;\n    if (defined(that._selectedSuggestion)) {\n      that.activateSuggestion(that._selectedSuggestion);\n      return false;\n    }\n    that.hideSuggestions();\n    if (that.isSearchInProgress) {\n      cancelGeocode(that);\n    } else {\n      return geocode(that, that._geocoderServices, geocodeType);\n    }\n  });\n\n  this.deselectSuggestion = function () {\n    that._selectedSuggestion = undefined;\n  };\n\n  this.handleKeyDown = function (data, event) {\n    const downKey =\n      event.key === \"ArrowDown\" || event.key === \"Down\" || event.keyCode === 40;\n    const upKey =\n      event.key === \"ArrowUp\" || event.key === \"Up\" || event.keyCode === 38;\n    if (downKey || upKey) {\n      event.preventDefault();\n    }\n\n    return true;\n  };\n\n  this.handleKeyUp = function (data, event) {\n    const downKey =\n      event.key === \"ArrowDown\" || event.key === \"Down\" || event.keyCode === 40;\n    const upKey =\n      event.key === \"ArrowUp\" || event.key === \"Up\" || event.keyCode === 38;\n    const enterKey = event.key === \"Enter\" || event.keyCode === 13;\n    if (upKey) {\n      handleArrowUp(that);\n    } else if (downKey) {\n      handleArrowDown(that);\n    } else if (enterKey) {\n      that._searchCommand();\n    }\n    return true;\n  };\n\n  this.activateSuggestion = function (data) {\n    that.hideSuggestions();\n    that._searchText = data.displayName;\n    const destination = data.destination;\n    clearSuggestions(that);\n    that.destinationFound(that, destination);\n  };\n\n  this.hideSuggestions = function () {\n    that._showSuggestions = false;\n    that._selectedSuggestion = undefined;\n  };\n\n  this.showSuggestions = function () {\n    that._showSuggestions = true;\n  };\n\n  this.handleMouseover = function (data, event) {\n    if (data !== that._selectedSuggestion) {\n      that._selectedSuggestion = data;\n    }\n  };\n\n  /**\n   * Gets or sets a value indicating if this instance should always show its text input field.\n   *\n   * @type {boolean}\n   * @default false\n   */\n  this.keepExpanded = false;\n\n  /**\n   * True if the geocoder should query as the user types to autocomplete\n   * @type {boolean}\n   * @default true\n   */\n  this.autoComplete = defaultValue(options.autocomplete, true);\n\n  /**\n   * Gets and sets the command called when a geocode destination is found\n   * @type {Geocoder.DestinationFoundFunction}\n   */\n  this.destinationFound = defaultValue(\n    options.destinationFound,\n    GeocoderViewModel.flyToDestination\n  );\n\n  this._focusTextbox = false;\n\n  knockout.track(this, [\n    \"_searchText\",\n    \"_isSearchInProgress\",\n    \"keepExpanded\",\n    \"_suggestions\",\n    \"_selectedSuggestion\",\n    \"_showSuggestions\",\n    \"_focusTextbox\",\n  ]);\n\n  const searchTextObservable = knockout.getObservable(this, \"_searchText\");\n  searchTextObservable.extend({ rateLimit: { timeout: 500 } });\n  this._suggestionSubscription = searchTextObservable.subscribe(function () {\n    GeocoderViewModel._updateSearchSuggestions(that);\n  });\n  /**\n   * Gets a value indicating whether a search is currently in progress.  This property is observable.\n   *\n   * @type {boolean}\n   */\n  this.isSearchInProgress = undefined;\n  knockout.defineProperty(this, \"isSearchInProgress\", {\n    get: function () {\n      return this._isSearchInProgress;\n    },\n  });\n\n  /**\n   * Gets or sets the text to search for.  The text can be an address, or longitude, latitude,\n   * and optional height, where longitude and latitude are in degrees and height is in meters.\n   *\n   * @type {string}\n   */\n  this.searchText = undefined;\n  knockout.defineProperty(this, \"searchText\", {\n    get: function () {\n      if (this.isSearchInProgress) {\n        return \"Searching...\";\n      }\n\n      return this._searchText;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (typeof value !== \"string\") {\n        throw new DeveloperError(\"value must be a valid string.\");\n      }\n      //>>includeEnd('debug');\n      this._searchText = value;\n    },\n  });\n\n  /**\n   * Gets or sets the the duration of the camera flight in seconds.\n   * A value of zero causes the camera to instantly switch to the geocoding location.\n   * The duration will be computed based on the distance when undefined.\n   *\n   * @type {number|undefined}\n   * @default undefined\n   */\n  this.flightDuration = undefined;\n  knockout.defineProperty(this, \"flightDuration\", {\n    get: function () {\n      return this._flightDuration;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value) && value < 0) {\n        throw new DeveloperError(\"value must be positive.\");\n      }\n      //>>includeEnd('debug');\n\n      this._flightDuration = value;\n    },\n  });\n}\n\nObject.defineProperties(GeocoderViewModel.prototype, {\n  /**\n   * Gets the event triggered on flight completion.\n   * @memberof GeocoderViewModel.prototype\n   *\n   * @type {Event}\n   */\n  complete: {\n    get: function () {\n      return this._complete;\n    },\n  },\n\n  /**\n   * Gets the scene to control.\n   * @memberof GeocoderViewModel.prototype\n   *\n   * @type {Scene}\n   */\n  scene: {\n    get: function () {\n      return this._scene;\n    },\n  },\n\n  /**\n   * Gets the Command that is executed when the button is clicked.\n   * @memberof GeocoderViewModel.prototype\n   *\n   * @type {Command}\n   */\n  search: {\n    get: function () {\n      return this._searchCommand;\n    },\n  },\n\n  /**\n   * Gets the currently selected geocoder search suggestion\n   * @memberof GeocoderViewModel.prototype\n   *\n   * @type {object}\n   */\n  selectedSuggestion: {\n    get: function () {\n      return this._selectedSuggestion;\n    },\n  },\n\n  /**\n   * Gets the list of geocoder search suggestions\n   * @memberof GeocoderViewModel.prototype\n   *\n   * @type {Object[]}\n   */\n  suggestions: {\n    get: function () {\n      return this._suggestions;\n    },\n  },\n});\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nGeocoderViewModel.prototype.destroy = function () {\n  this._suggestionSubscription.dispose();\n};\n\nfunction handleArrowUp(viewModel) {\n  if (viewModel._suggestions.length === 0) {\n    return;\n  }\n  const currentIndex = viewModel._suggestions.indexOf(\n    viewModel._selectedSuggestion\n  );\n  if (currentIndex === -1 || currentIndex === 0) {\n    viewModel._selectedSuggestion = undefined;\n    return;\n  }\n  const next = currentIndex - 1;\n  viewModel._selectedSuggestion = viewModel._suggestions[next];\n  GeocoderViewModel._adjustSuggestionsScroll(viewModel, next);\n}\n\nfunction handleArrowDown(viewModel) {\n  if (viewModel._suggestions.length === 0) {\n    return;\n  }\n  const numberOfSuggestions = viewModel._suggestions.length;\n  const currentIndex = viewModel._suggestions.indexOf(\n    viewModel._selectedSuggestion\n  );\n  const next = (currentIndex + 1) % numberOfSuggestions;\n  viewModel._selectedSuggestion = viewModel._suggestions[next];\n\n  GeocoderViewModel._adjustSuggestionsScroll(viewModel, next);\n}\n\nfunction computeFlyToLocationForCartographic(cartographic, terrainProvider) {\n  const availability = defined(terrainProvider)\n    ? terrainProvider.availability\n    : undefined;\n\n  if (!defined(availability)) {\n    cartographic.height += DEFAULT_HEIGHT;\n    return Promise.resolve(cartographic);\n  }\n\n  return sampleTerrainMostDetailed(terrainProvider, [cartographic]).then(\n    function (positionOnTerrain) {\n      cartographic = positionOnTerrain[0];\n      cartographic.height += DEFAULT_HEIGHT;\n      return cartographic;\n    }\n  );\n}\n\nfunction flyToDestination(viewModel, destination) {\n  const scene = viewModel._scene;\n  const mapProjection = scene.mapProjection;\n  const ellipsoid = mapProjection.ellipsoid;\n\n  const camera = scene.camera;\n  const terrainProvider = scene.terrainProvider;\n  let finalDestination = destination;\n\n  let promise;\n  if (destination instanceof Rectangle) {\n    // Some geocoders return a Rectangle of zero width/height, treat it like a point instead.\n    if (\n      CesiumMath.equalsEpsilon(\n        destination.south,\n        destination.north,\n        CesiumMath.EPSILON7\n      ) &&\n      CesiumMath.equalsEpsilon(\n        destination.east,\n        destination.west,\n        CesiumMath.EPSILON7\n      )\n    ) {\n      // destination is now a Cartographic\n      destination = Rectangle.center(destination);\n    } else {\n      promise = computeFlyToLocationForRectangle(destination, scene);\n    }\n  } else {\n    // destination is a Cartesian3\n    destination = ellipsoid.cartesianToCartographic(destination);\n  }\n\n  if (!defined(promise)) {\n    promise = computeFlyToLocationForCartographic(destination, terrainProvider);\n  }\n\n  return promise\n    .then(function (result) {\n      finalDestination = ellipsoid.cartographicToCartesian(result);\n    })\n    .finally(function () {\n      // Whether terrain querying succeeded or not, fly to the destination.\n      camera.flyTo({\n        destination: finalDestination,\n        complete: function () {\n          viewModel._complete.raiseEvent();\n        },\n        duration: viewModel._flightDuration,\n        endTransform: Matrix4.IDENTITY,\n      });\n    });\n}\n\nasync function attemptGeocode(geocoderService, query, geocodeType) {\n  try {\n    const result = await geocoderService.geocode(query, geocodeType);\n    return {\n      state: \"fulfilled\",\n      value: result,\n      credits: geocoderService.credit,\n    };\n  } catch (error) {\n    return { state: \"rejected\", reason: error };\n  }\n}\n\nasync function geocode(viewModel, geocoderServices, geocodeType) {\n  const query = viewModel._searchText;\n\n  if (hasOnlyWhitespace(query)) {\n    viewModel.showSuggestions();\n    return;\n  }\n\n  viewModel._isSearchInProgress = true;\n  viewModel._wasGeocodeCancelled = false;\n\n  let i;\n  let result;\n  for (i = 0; i < geocoderServices.length; i++) {\n    if (viewModel._wasGeocodeCancelled) {\n      return;\n    }\n\n    result = await attemptGeocode(geocoderServices[i], query, geocodeType);\n    if (\n      defined(result) &&\n      result.state === \"fulfilled\" &&\n      result.value.length > 0\n    ) {\n      break;\n    }\n  }\n\n  if (viewModel._wasGeocodeCancelled) {\n    return;\n  }\n\n  viewModel._isSearchInProgress = false;\n  clearCredits(viewModel);\n\n  const geocoderResults = result.value;\n  if (\n    result.state === \"fulfilled\" &&\n    defined(geocoderResults) &&\n    geocoderResults.length > 0\n  ) {\n    viewModel._searchText = geocoderResults[0].displayName;\n    viewModel.destinationFound(viewModel, geocoderResults[0].destination);\n    const credits = updateCredits(\n      viewModel,\n      GeocoderService.getCreditsFromResult(geocoderResults[0])\n    );\n    // If the result does not contain any credits, default to the service credit.\n    if (!defined(credits)) {\n      updateCredit(viewModel, geocoderServices[i].credit);\n    }\n    return;\n  }\n\n  viewModel._searchText = `${query} (not found)`;\n}\n\nfunction updateCredit(viewModel, credit) {\n  if (\n    defined(credit) &&\n    !viewModel._scene.isDestroyed() &&\n    !viewModel._scene.frameState.creditDisplay.isDestroyed()\n  ) {\n    viewModel._scene.frameState.creditDisplay.addStaticCredit(credit);\n    viewModel._previousCredits.push(credit);\n  }\n}\n\nfunction updateCredits(viewModel, credits) {\n  if (defined(credits)) {\n    credits.forEach((credit) => updateCredit(viewModel, credit));\n  }\n\n  return credits;\n}\n\nfunction clearCredits(viewModel) {\n  if (\n    !viewModel._scene.isDestroyed() &&\n    !viewModel._scene.frameState.creditDisplay.isDestroyed()\n  ) {\n    viewModel._previousCredits.forEach((credit) => {\n      viewModel._scene.frameState.creditDisplay.removeStaticCredit(credit);\n    });\n  }\n\n  viewModel._previousCredits.length = 0;\n}\n\nfunction adjustSuggestionsScroll(viewModel, focusedItemIndex) {\n  const container = getElement(viewModel._viewContainer);\n  const searchResults = container.getElementsByClassName(\"search-results\")[0];\n  const listItems = container.getElementsByTagName(\"li\");\n  const element = listItems[focusedItemIndex];\n\n  if (focusedItemIndex === 0) {\n    searchResults.scrollTop = 0;\n    return;\n  }\n\n  const offsetTop = element.offsetTop;\n  if (offsetTop + element.clientHeight > searchResults.clientHeight) {\n    searchResults.scrollTop = offsetTop + element.clientHeight;\n  } else if (offsetTop < searchResults.scrollTop) {\n    searchResults.scrollTop = offsetTop;\n  }\n}\n\nfunction cancelGeocode(viewModel) {\n  if (viewModel._isSearchInProgress) {\n    viewModel._isSearchInProgress = false;\n    viewModel._wasGeocodeCancelled = true;\n  }\n}\n\nfunction hasOnlyWhitespace(string) {\n  return /^\\s*$/.test(string);\n}\n\nfunction clearSuggestions(viewModel) {\n  knockout.getObservable(viewModel, \"_suggestions\").removeAll();\n}\n\nasync function updateSearchSuggestions(viewModel) {\n  if (!viewModel.autoComplete) {\n    return;\n  }\n\n  const query = viewModel._searchText;\n\n  clearSuggestions(viewModel);\n  clearCredits(viewModel);\n\n  if (hasOnlyWhitespace(query)) {\n    return;\n  }\n\n  for (const service of viewModel._geocoderServices) {\n    const newResults = await service.geocode(query, GeocodeType.AUTOCOMPLETE);\n    viewModel._suggestions = viewModel._suggestions.concat(newResults);\n    if (newResults.length > 0) {\n      let useDefaultCredit = true;\n      newResults.forEach((result) => {\n        const credits = GeocoderService.getCreditsFromResult(result);\n        useDefaultCredit = useDefaultCredit && !defined(credits);\n        updateCredits(viewModel, credits);\n      });\n\n      // Use the service credit if there were no attributions in the results\n      if (useDefaultCredit) {\n        updateCredit(viewModel, service.credit);\n      }\n    }\n\n    if (viewModel._suggestions.length >= 5) {\n      return;\n    }\n  }\n}\n\n/**\n * A function to fly to the destination found by a successful geocode.\n * @type {Geocoder.DestinationFoundFunction}\n */\nGeocoderViewModel.flyToDestination = flyToDestination;\n\n//exposed for testing\nGeocoderViewModel._updateSearchSuggestions = updateSearchSuggestions;\nGeocoderViewModel._adjustSuggestionsScroll = adjustSuggestionsScroll;\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nGeocoderViewModel.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nGeocoderViewModel.prototype.destroy = function () {\n  clearCredits(this);\n  return destroyObject(this);\n};\nexport default GeocoderViewModel;\n", "import {\n  defined,\n  destroyObject,\n  DeveloperError,\n  FeatureDetection,\n  getElement,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport GeocoderViewModel from \"./GeocoderViewModel.js\";\n\nconst startSearchPath =\n  \"M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z\";\nconst stopSearchPath =\n  \"M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z\";\n\n/**\n * A widget for finding addresses and landmarks, and flying the camera to them.  Geocoding is\n * performed using {@link https://cesium.com/cesium-ion/|Cesium ion}.\n *\n * @alias Geocoder\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Element|string} options.container The DOM element or ID that will contain the widget.\n * @param {Scene} options.scene The Scene instance to use.\n * @param {GeocoderService[]} [options.geocoderServices] The geocoder services to be used\n * @param {boolean} [options.autoComplete = true] True if the geocoder should query as the user types to autocomplete\n * @param {number} [options.flightDuration=1.5] The duration of the camera flight to an entered location, in seconds.\n * @param {Geocoder.DestinationFoundFunction} [options.destinationFound=GeocoderViewModel.flyToDestination] A callback function that is called after a successful geocode.  If not supplied, the default behavior is to fly the camera to the result destination.\n */\nfunction Geocoder(options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options) || !defined(options.container)) {\n    throw new DeveloperError(\"options.container is required.\");\n  }\n  if (!defined(options.scene)) {\n    throw new DeveloperError(\"options.scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const container = getElement(options.container);\n  const viewModel = new GeocoderViewModel(options);\n\n  viewModel._startSearchPath = startSearchPath;\n  viewModel._stopSearchPath = stopSearchPath;\n\n  const form = document.createElement(\"form\");\n  form.setAttribute(\"data-bind\", \"submit: search\");\n\n  const textBox = document.createElement(\"input\");\n  textBox.type = \"search\";\n  textBox.className = \"cesium-geocoder-input\";\n  textBox.setAttribute(\"placeholder\", \"Enter an address or landmark...\");\n  textBox.setAttribute(\n    \"data-bind\",\n    '\\\ntextInput: searchText,\\\ndisable: isSearchInProgress,\\\nevent: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },\\\ncss: { \"cesium-geocoder-input-wide\" : keepExpanded || searchText.length > 0 },\\\nhasFocus: _focusTextbox'\n  );\n\n  this._onTextBoxFocus = function () {\n    // as of 2016-10-19, setTimeout is required to ensure that the\n    // text is focused on Safari 10\n    setTimeout(function () {\n      textBox.select();\n    }, 0);\n  };\n\n  textBox.addEventListener(\"focus\", this._onTextBoxFocus, false);\n  form.appendChild(textBox);\n  this._textBox = textBox;\n\n  const searchButton = document.createElement(\"span\");\n  searchButton.className = \"cesium-geocoder-searchButton\";\n  searchButton.setAttribute(\n    \"data-bind\",\n    \"\\\nclick: search,\\\ncesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }\"\n  );\n  form.appendChild(searchButton);\n\n  container.appendChild(form);\n\n  const searchSuggestionsContainer = document.createElement(\"div\");\n  searchSuggestionsContainer.className = \"search-results\";\n  searchSuggestionsContainer.setAttribute(\n    \"data-bind\",\n    \"visible: _suggestionsVisible\"\n  );\n\n  const suggestionsList = document.createElement(\"ul\");\n  suggestionsList.setAttribute(\"data-bind\", \"foreach: _suggestions\");\n  const suggestions = document.createElement(\"li\");\n  suggestionsList.appendChild(suggestions);\n  suggestions.setAttribute(\n    \"data-bind\",\n    \"text: $data.displayName, \\\nclick: $parent.activateSuggestion, \\\nevent: { mouseover: $parent.handleMouseover}, \\\ncss: { active: $data === $parent._selectedSuggestion }\"\n  );\n\n  searchSuggestionsContainer.appendChild(suggestionsList);\n  container.appendChild(searchSuggestionsContainer);\n\n  knockout.applyBindings(viewModel, form);\n  knockout.applyBindings(viewModel, searchSuggestionsContainer);\n\n  this._container = container;\n  this._searchSuggestionsContainer = searchSuggestionsContainer;\n  this._viewModel = viewModel;\n  this._form = form;\n\n  this._onInputBegin = function (e) {\n    // e.target will not be correct if we are inside of the Shadow DOM\n    // and contains will always fail. To retrieve the correct target,\n    // we need to access the first element of the composedPath.\n    // This allows us to use shadow DOM if it exists and fall\n    // back to legacy behavior if its not being used.\n\n    let target = e.target;\n    if (typeof e.composedPath === \"function\") {\n      target = e.composedPath()[0];\n    }\n\n    if (!container.contains(target)) {\n      viewModel._focusTextbox = false;\n      viewModel.hideSuggestions();\n    }\n  };\n\n  this._onInputEnd = function (e) {\n    viewModel._focusTextbox = true;\n    viewModel.showSuggestions();\n  };\n\n  //We subscribe to both begin and end events in order to give the text box\n  //focus no matter where on the widget is clicked.\n\n  if (FeatureDetection.supportsPointerEvents()) {\n    document.addEventListener(\"pointerdown\", this._onInputBegin, true);\n    container.addEventListener(\"pointerup\", this._onInputEnd, true);\n    container.addEventListener(\"pointercancel\", this._onInputEnd, true);\n  } else {\n    document.addEventListener(\"mousedown\", this._onInputBegin, true);\n    container.addEventListener(\"mouseup\", this._onInputEnd, true);\n    document.addEventListener(\"touchstart\", this._onInputBegin, true);\n    container.addEventListener(\"touchend\", this._onInputEnd, true);\n    container.addEventListener(\"touchcancel\", this._onInputEnd, true);\n  }\n}\n\nObject.defineProperties(Geocoder.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof Geocoder.prototype\n   *\n   * @type {Element}\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the parent container.\n   * @memberof Geocoder.prototype\n   *\n   * @type {Element}\n   */\n  searchSuggestionsContainer: {\n    get: function () {\n      return this._searchSuggestionsContainer;\n    },\n  },\n\n  /**\n   * Gets the view model.\n   * @memberof Geocoder.prototype\n   *\n   * @type {GeocoderViewModel}\n   */\n  viewModel: {\n    get: function () {\n      return this._viewModel;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nGeocoder.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nGeocoder.prototype.destroy = function () {\n  const container = this._container;\n  if (FeatureDetection.supportsPointerEvents()) {\n    document.removeEventListener(\"pointerdown\", this._onInputBegin, true);\n    container.removeEventListener(\"pointerup\", this._onInputEnd, true);\n  } else {\n    document.removeEventListener(\"mousedown\", this._onInputBegin, true);\n    container.removeEventListener(\"mouseup\", this._onInputEnd, true);\n    document.removeEventListener(\"touchstart\", this._onInputBegin, true);\n    container.removeEventListener(\"touchend\", this._onInputEnd, true);\n  }\n  this._viewModel.destroy();\n  knockout.cleanNode(this._form);\n  knockout.cleanNode(this._searchSuggestionsContainer);\n  container.removeChild(this._form);\n  container.removeChild(this._searchSuggestionsContainer);\n  this._textBox.removeEventListener(\"focus\", this._onTextBoxFocus, false);\n\n  return destroyObject(this);\n};\n\n/**\n * A function that handles the result of a successful geocode.\n * @callback Geocoder.DestinationFoundFunction\n * @param {GeocoderViewModel} viewModel The view model.\n * @param {Cartesian3|Rectangle} destination The destination result of the geocode.\n */\nexport default Geocoder;\n", "import { defined, DeveloperError } from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n/**\n * The view model for {@link HomeButton}.\n * @alias HomeButtonViewModel\n * @constructor\n *\n * @param {Scene} scene The scene instance to use.\n * @param {number} [duration] The duration of the camera flight in seconds.\n */\nfunction HomeButtonViewModel(scene, duration) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._scene = scene;\n  this._duration = duration;\n\n  const that = this;\n  this._command = createCommand(function () {\n    that._scene.camera.flyHome(that._duration);\n  });\n\n  /**\n   * Gets or sets the tooltip.  This property is observable.\n   *\n   * @type {string}\n   */\n  this.tooltip = \"View Home\";\n\n  knockout.track(this, [\"tooltip\"]);\n}\n\nObject.defineProperties(HomeButtonViewModel.prototype, {\n  /**\n   * Gets the scene to control.\n   * @memberof HomeButtonViewModel.prototype\n   *\n   * @type {Scene}\n   */\n  scene: {\n    get: function () {\n      return this._scene;\n    },\n  },\n\n  /**\n   * Gets the Command that is executed when the button is clicked.\n   * @memberof HomeButtonViewModel.prototype\n   *\n   * @type {Command}\n   */\n  command: {\n    get: function () {\n      return this._command;\n    },\n  },\n\n  /**\n   * Gets or sets the the duration of the camera flight in seconds.\n   * A value of zero causes the camera to instantly switch to home view.\n   * The duration will be computed based on the distance when undefined.\n   * @memberof HomeButtonViewModel.prototype\n   *\n   * @type {number|undefined}\n   */\n  duration: {\n    get: function () {\n      return this._duration;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (defined(value) && value < 0) {\n        throw new DeveloperError(\"value must be positive.\");\n      }\n      //>>includeEnd('debug');\n\n      this._duration = value;\n    },\n  },\n});\nexport default HomeButtonViewModel;\n", "import {\n  defined,\n  destroyObject,\n  DeveloperError,\n  getElement,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport HomeButtonViewModel from \"./HomeButtonViewModel.js\";\n\n/**\n * A single button widget for returning to the default camera view of the current scene.\n *\n * @alias HomeButton\n * @constructor\n *\n * @param {Element|string} container The DOM element or ID that will contain the widget.\n * @param {Scene} scene The Scene instance to use.\n * @param {number} [duration] The time, in seconds, it takes to complete the camera flight home.\n */\nfunction HomeButton(container, scene, duration) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(container)) {\n    throw new DeveloperError(\"container is required.\");\n  }\n  //>>includeEnd('debug');\n\n  container = getElement(container);\n\n  const viewModel = new HomeButtonViewModel(scene, duration);\n\n  viewModel._svgPath =\n    \"M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z\";\n\n  const element = document.createElement(\"button\");\n  element.type = \"button\";\n  element.className = \"cesium-button cesium-toolbar-button cesium-home-button\";\n  element.setAttribute(\n    \"data-bind\",\n    \"\\\nattr: { title: tooltip },\\\nclick: command,\\\ncesiumSvgPath: { path: _svgPath, width: 28, height: 28 }\"\n  );\n\n  container.appendChild(element);\n\n  knockout.applyBindings(viewModel, element);\n\n  this._container = container;\n  this._viewModel = viewModel;\n  this._element = element;\n}\n\nObject.defineProperties(HomeButton.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof HomeButton.prototype\n   *\n   * @type {Element}\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the view model.\n   * @memberof HomeButton.prototype\n   *\n   * @type {HomeButtonViewModel}\n   */\n  viewModel: {\n    get: function () {\n      return this._viewModel;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nHomeButton.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nHomeButton.prototype.destroy = function () {\n  knockout.cleanNode(this._element);\n  this._container.removeChild(this._element);\n\n  return destroyObject(this);\n};\nexport default HomeButton;\n", "import { defined, Event } from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\n\nconst cameraEnabledPath =\n  \"M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z\";\nconst cameraDisabledPath =\n  \"M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z\";\n\n/**\n * The view model for {@link InfoBox}.\n * @alias InfoBoxViewModel\n * @constructor\n */\nfunction InfoBoxViewModel() {\n  this._cameraClicked = new Event();\n  this._closeClicked = new Event();\n\n  /**\n   * Gets or sets the maximum height of the info box in pixels.  This property is observable.\n   * @type {number}\n   */\n  this.maxHeight = 500;\n\n  /**\n   * Gets or sets whether the camera tracking icon is enabled.\n   * @type {boolean}\n   */\n  this.enableCamera = false;\n\n  /**\n   * Gets or sets the status of current camera tracking of the selected object.\n   * @type {boolean}\n   */\n  this.isCameraTracking = false;\n\n  /**\n   * Gets or sets the visibility of the info box.\n   * @type {boolean}\n   */\n  this.showInfo = false;\n\n  /**\n   * Gets or sets the title text in the info box.\n   * @type {string}\n   */\n  this.titleText = \"\";\n\n  /**\n   * Gets or sets the description HTML for the info box.\n   * @type {string}\n   */\n  this.description = \"\";\n\n  knockout.track(this, [\n    \"showInfo\",\n    \"titleText\",\n    \"description\",\n    \"maxHeight\",\n    \"enableCamera\",\n    \"isCameraTracking\",\n  ]);\n\n  this._loadingIndicatorHtml =\n    '<div class=\"cesium-infoBox-loadingContainer\"><span class=\"cesium-infoBox-loading\"></span></div>';\n\n  /**\n   * Gets the SVG path of the camera icon, which can change to be \"crossed out\" or not.\n   * @type {string}\n   */\n  this.cameraIconPath = undefined;\n  knockout.defineProperty(this, \"cameraIconPath\", {\n    get: function () {\n      return !this.enableCamera || this.isCameraTracking\n        ? cameraDisabledPath\n        : cameraEnabledPath;\n    },\n  });\n\n  knockout.defineProperty(this, \"_bodyless\", {\n    get: function () {\n      return !defined(this.description) || this.description.length === 0;\n    },\n  });\n}\n\n/**\n * Gets the maximum height of sections within the info box, minus an offset, in CSS-ready form.\n * @param {number} offset The offset in pixels.\n * @returns {string}\n */\nInfoBoxViewModel.prototype.maxHeightOffset = function (offset) {\n  return `${this.maxHeight - offset}px`;\n};\n\nObject.defineProperties(InfoBoxViewModel.prototype, {\n  /**\n   * Gets an {@link Event} that is fired when the user clicks the camera icon.\n   * @memberof InfoBoxViewModel.prototype\n   * @type {Event}\n   */\n  cameraClicked: {\n    get: function () {\n      return this._cameraClicked;\n    },\n  },\n  /**\n   * Gets an {@link Event} that is fired when the user closes the info box.\n   * @memberof InfoBoxViewModel.prototype\n   * @type {Event}\n   */\n  closeClicked: {\n    get: function () {\n      return this._closeClicked;\n    },\n  },\n});\nexport default InfoBoxViewModel;\n", "import {\n  buildModuleUrl,\n  Check,\n  Color,\n  defined,\n  destroyObject,\n  getElement,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport subscribeAndEvaluate from \"../subscribeAndEvaluate.js\";\nimport InfoBoxViewModel from \"./InfoBoxViewModel.js\";\n\n/**\n * A widget for displaying information or a description.\n *\n * @alias InfoBox\n * @constructor\n *\n * @param {Element|string} container The DOM element or ID that will contain the widget.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n */\nfunction InfoBox(container) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"container\", container);\n  //>>includeEnd('debug')\n\n  container = getElement(container);\n\n  const infoElement = document.createElement(\"div\");\n  infoElement.className = \"cesium-infoBox\";\n  infoElement.setAttribute(\n    \"data-bind\",\n    '\\\ncss: { \"cesium-infoBox-visible\" : showInfo, \"cesium-infoBox-bodyless\" : _bodyless }'\n  );\n  container.appendChild(infoElement);\n\n  const titleElement = document.createElement(\"div\");\n  titleElement.className = \"cesium-infoBox-title\";\n  titleElement.setAttribute(\"data-bind\", \"text: titleText\");\n  infoElement.appendChild(titleElement);\n\n  const cameraElement = document.createElement(\"button\");\n  cameraElement.type = \"button\";\n  cameraElement.className = \"cesium-button cesium-infoBox-camera\";\n  cameraElement.setAttribute(\n    \"data-bind\",\n    '\\\nattr: { title: \"Focus camera on object\" },\\\nclick: function () { cameraClicked.raiseEvent(this); },\\\nenable: enableCamera,\\\ncesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'\n  );\n  infoElement.appendChild(cameraElement);\n\n  const closeElement = document.createElement(\"button\");\n  closeElement.type = \"button\";\n  closeElement.className = \"cesium-infoBox-close\";\n  closeElement.setAttribute(\n    \"data-bind\",\n    \"\\\nclick: function () { closeClicked.raiseEvent(this); }\"\n  );\n  closeElement.innerHTML = \"&times;\";\n  infoElement.appendChild(closeElement);\n\n  const frame = document.createElement(\"iframe\");\n  frame.className = \"cesium-infoBox-iframe\";\n  frame.setAttribute(\"sandbox\", \"allow-same-origin allow-popups allow-forms\"); //allow-pointer-lock allow-scripts allow-top-navigation\n  frame.setAttribute(\n    \"data-bind\",\n    \"style : { maxHeight : maxHeightOffset(40) }\"\n  );\n  frame.setAttribute(\"allowfullscreen\", true);\n  infoElement.appendChild(frame);\n\n  const viewModel = new InfoBoxViewModel();\n  knockout.applyBindings(viewModel, infoElement);\n\n  this._container = container;\n  this._element = infoElement;\n  this._frame = frame;\n  this._viewModel = viewModel;\n  this._descriptionSubscription = undefined;\n\n  const that = this;\n  //We can't actually add anything into the frame until the load event is fired\n  frame.addEventListener(\"load\", function () {\n    const frameDocument = frame.contentDocument;\n\n    //We inject default css into the content iframe,\n    //end users can remove it or add their own via the exposed frame property.\n    const cssLink = frameDocument.createElement(\"link\");\n    cssLink.href = buildModuleUrl(\"Widgets/InfoBox/InfoBoxDescription.css\");\n    cssLink.rel = \"stylesheet\";\n    cssLink.type = \"text/css\";\n\n    //div to use for description content.\n    const frameContent = frameDocument.createElement(\"div\");\n    frameContent.className = \"cesium-infoBox-description\";\n\n    frameDocument.head.appendChild(cssLink);\n    frameDocument.body.appendChild(frameContent);\n\n    //We manually subscribe to the description event rather than through a binding for two reasons.\n    //1. It's an easy way to ensure order of operation so that we can adjust the height.\n    //2. Knockout does not bind to elements inside of an iFrame, so we would have to apply a second binding\n    //   model anyway.\n    that._descriptionSubscription = subscribeAndEvaluate(\n      viewModel,\n      \"description\",\n      function (value) {\n        // Set the frame to small height, force vertical scroll bar to appear, and text to wrap accordingly.\n        frame.style.height = \"5px\";\n        frameContent.innerHTML = value;\n\n        //If the snippet is a single element, then use its background\n        //color for the body of the InfoBox. This makes the padding match\n        //the content and produces much nicer results.\n        let background = null;\n        const firstElementChild = frameContent.firstElementChild;\n        if (\n          firstElementChild !== null &&\n          frameContent.childNodes.length === 1\n        ) {\n          const style = window.getComputedStyle(firstElementChild);\n          if (style !== null) {\n            const backgroundColor = style[\"background-color\"];\n            const color = Color.fromCssColorString(backgroundColor);\n            if (defined(color) && color.alpha !== 0) {\n              background = style[\"background-color\"];\n            }\n          }\n        }\n        infoElement.style[\"background-color\"] = background;\n\n        // Measure and set the new custom height, based on text wrapped above.\n        const height = frameContent.getBoundingClientRect().height;\n        frame.style.height = `${height}px`;\n      }\n    );\n  });\n\n  //Chrome does not send the load event unless we explicitly set a src\n  frame.setAttribute(\"src\", \"about:blank\");\n}\n\nObject.defineProperties(InfoBox.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof InfoBox.prototype\n   *\n   * @type {Element}\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the view model.\n   * @memberof InfoBox.prototype\n   *\n   * @type {InfoBoxViewModel}\n   */\n  viewModel: {\n    get: function () {\n      return this._viewModel;\n    },\n  },\n\n  /**\n   * Gets the iframe used to display the description.\n   * @memberof InfoBox.prototype\n   *\n   * @type {HTMLIFrameElement}\n   */\n  frame: {\n    get: function () {\n      return this._frame;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nInfoBox.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nInfoBox.prototype.destroy = function () {\n  const container = this._container;\n  knockout.cleanNode(this._element);\n  container.removeChild(this._element);\n\n  if (defined(this._descriptionSubscription)) {\n    this._descriptionSubscription.dispose();\n  }\n\n  return destroyObject(this);\n};\nexport default InfoBox;\n", "import knockout from \"../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n/**\n * The view model for {@link NavigationHelpButton}.\n * @alias NavigationHelpButtonViewModel\n * @constructor\n */\nfunction NavigationHelpButtonViewModel() {\n  /**\n   * Gets or sets whether the instructions are currently shown.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.showInstructions = false;\n\n  const that = this;\n  this._command = createCommand(function () {\n    that.showInstructions = !that.showInstructions;\n  });\n  this._showClick = createCommand(function () {\n    that._touch = false;\n  });\n  this._showTouch = createCommand(function () {\n    that._touch = true;\n  });\n\n  this._touch = false;\n\n  /**\n   * Gets or sets the tooltip.  This property is observable.\n   *\n   * @type {string}\n   */\n  this.tooltip = \"Navigation Instructions\";\n\n  knockout.track(this, [\"tooltip\", \"showInstructions\", \"_touch\"]);\n}\n\nObject.defineProperties(NavigationHelpButtonViewModel.prototype, {\n  /**\n   * Gets the Command that is executed when the button is clicked.\n   * @memberof NavigationHelpButtonViewModel.prototype\n   *\n   * @type {Command}\n   */\n  command: {\n    get: function () {\n      return this._command;\n    },\n  },\n\n  /**\n   * Gets the Command that is executed when the mouse instructions should be shown.\n   * @memberof NavigationHelpButtonViewModel.prototype\n   *\n   * @type {Command}\n   */\n  showClick: {\n    get: function () {\n      return this._showClick;\n    },\n  },\n\n  /**\n   * Gets the Command that is executed when the touch instructions should be shown.\n   * @memberof NavigationHelpButtonViewModel.prototype\n   *\n   * @type {Command}\n   */\n  showTouch: {\n    get: function () {\n      return this._showTouch;\n    },\n  },\n});\nexport default NavigationHelpButtonViewModel;\n", "import {\n  buildModuleUrl,\n  defaultValue,\n  defined,\n  destroyObject,\n  DeveloperError,\n  FeatureDetection,\n  getElement,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport NavigationHelpButtonViewModel from \"./NavigationHelpButtonViewModel.js\";\n\n/**\n * <p>The NavigationHelpButton is a single button widget for displaying instructions for\n * navigating the globe with the mouse.</p><p style=\"clear: both;\"></p><br/>\n *\n * @alias NavigationHelpButton\n * @constructor\n *\n * @param {object} options Object with the following properties:\n * @param {Element|string} options.container The DOM element or ID that will contain the widget.\n * @param {boolean} [options.instructionsInitiallyVisible=false] True if the navigation instructions should initially be visible; otherwise, false.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n *\n * @example\n * // In HTML head, include a link to the NavigationHelpButton.css stylesheet,\n * // and in the body, include: <div id=\"navigationHelpButtonContainer\"></div>\n *\n * const navigationHelpButton = new Cesium.NavigationHelpButton({\n *     container : 'navigationHelpButtonContainer'\n * });\n */\nfunction NavigationHelpButton(options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options) || !defined(options.container)) {\n    throw new DeveloperError(\"options.container is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const container = getElement(options.container);\n\n  const viewModel = new NavigationHelpButtonViewModel();\n\n  const showInsructionsDefault = defaultValue(\n    options.instructionsInitiallyVisible,\n    false\n  );\n  viewModel.showInstructions = showInsructionsDefault;\n\n  viewModel._svgPath =\n    \"M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z\";\n\n  const wrapper = document.createElement(\"span\");\n  wrapper.className = \"cesium-navigationHelpButton-wrapper\";\n  container.appendChild(wrapper);\n\n  const button = document.createElement(\"button\");\n  button.type = \"button\";\n  button.className =\n    \"cesium-button cesium-toolbar-button cesium-navigation-help-button\";\n  button.setAttribute(\n    \"data-bind\",\n    \"\\\nattr: { title: tooltip },\\\nclick: command,\\\ncesiumSvgPath: { path: _svgPath, width: 32, height: 32 }\"\n  );\n  wrapper.appendChild(button);\n\n  const instructionContainer = document.createElement(\"div\");\n  instructionContainer.className = \"cesium-navigation-help\";\n  instructionContainer.setAttribute(\n    \"data-bind\",\n    'css: { \"cesium-navigation-help-visible\" : showInstructions}'\n  );\n  wrapper.appendChild(instructionContainer);\n\n  const mouseButton = document.createElement(\"button\");\n  mouseButton.type = \"button\";\n  mouseButton.className =\n    \"cesium-navigation-button cesium-navigation-button-left\";\n  mouseButton.setAttribute(\n    \"data-bind\",\n    'click: showClick, css: {\"cesium-navigation-button-selected\": !_touch, \"cesium-navigation-button-unselected\": _touch}'\n  );\n  const mouseIcon = document.createElement(\"img\");\n  mouseIcon.src = buildModuleUrl(\"Widgets/Images/NavigationHelp/Mouse.svg\");\n  mouseIcon.className = \"cesium-navigation-button-icon\";\n  mouseIcon.style.width = \"25px\";\n  mouseIcon.style.height = \"25px\";\n  mouseButton.appendChild(mouseIcon);\n  mouseButton.appendChild(document.createTextNode(\"Mouse\"));\n\n  const touchButton = document.createElement(\"button\");\n  touchButton.type = \"button\";\n  touchButton.className =\n    \"cesium-navigation-button cesium-navigation-button-right\";\n  touchButton.setAttribute(\n    \"data-bind\",\n    'click: showTouch, css: {\"cesium-navigation-button-selected\": _touch, \"cesium-navigation-button-unselected\": !_touch}'\n  );\n  const touchIcon = document.createElement(\"img\");\n  touchIcon.src = buildModuleUrl(\"Widgets/Images/NavigationHelp/Touch.svg\");\n  touchIcon.className = \"cesium-navigation-button-icon\";\n  touchIcon.style.width = \"25px\";\n  touchIcon.style.height = \"25px\";\n  touchButton.appendChild(touchIcon);\n  touchButton.appendChild(document.createTextNode(\"Touch\"));\n\n  instructionContainer.appendChild(mouseButton);\n  instructionContainer.appendChild(touchButton);\n\n  const clickInstructions = document.createElement(\"div\");\n  clickInstructions.className =\n    \"cesium-click-navigation-help cesium-navigation-help-instructions\";\n  clickInstructions.setAttribute(\n    \"data-bind\",\n    'css: { \"cesium-click-navigation-help-visible\" : !_touch}'\n  );\n  clickInstructions.innerHTML = `\\\n            <table>\\\n                <tr>\\\n                    <td><img src=\"${buildModuleUrl(\n                      \"Widgets/Images/NavigationHelp/MouseLeft.svg\"\n                    )}\" width=\"48\" height=\"48\" /></td>\\\n                    <td>\\\n                        <div class=\"cesium-navigation-help-pan\">Pan view</div>\\\n                        <div class=\"cesium-navigation-help-details\">Left click + drag</div>\\\n                    </td>\\\n                </tr>\\\n                <tr>\\\n                    <td><img src=\"${buildModuleUrl(\n                      \"Widgets/Images/NavigationHelp/MouseRight.svg\"\n                    )}\" width=\"48\" height=\"48\" /></td>\\\n                    <td>\\\n                        <div class=\"cesium-navigation-help-zoom\">Zoom view</div>\\\n                        <div class=\"cesium-navigation-help-details\">Right click + drag, or</div>\\\n                        <div class=\"cesium-navigation-help-details\">Mouse wheel scroll</div>\\\n                    </td>\\\n                </tr>\\\n                <tr>\\\n                    <td><img src=\"${buildModuleUrl(\n                      \"Widgets/Images/NavigationHelp/MouseMiddle.svg\"\n                    )}\" width=\"48\" height=\"48\" /></td>\\\n                    <td>\\\n                        <div class=\"cesium-navigation-help-rotate\">Rotate view</div>\\\n                        <div class=\"cesium-navigation-help-details\">Middle click + drag, or</div>\\\n                        <div class=\"cesium-navigation-help-details\">CTRL + Left/Right click + drag</div>\\\n                    </td>\\\n                </tr>\\\n            </table>`;\n\n  instructionContainer.appendChild(clickInstructions);\n\n  const touchInstructions = document.createElement(\"div\");\n  touchInstructions.className =\n    \"cesium-touch-navigation-help cesium-navigation-help-instructions\";\n  touchInstructions.setAttribute(\n    \"data-bind\",\n    'css: { \"cesium-touch-navigation-help-visible\" : _touch}'\n  );\n  touchInstructions.innerHTML = `\\\n            <table>\\\n                <tr>\\\n                    <td><img src=\"${buildModuleUrl(\n                      \"Widgets/Images/NavigationHelp/TouchDrag.svg\"\n                    )}\" width=\"70\" height=\"48\" /></td>\\\n                    <td>\\\n                        <div class=\"cesium-navigation-help-pan\">Pan view</div>\\\n                        <div class=\"cesium-navigation-help-details\">One finger drag</div>\\\n                    </td>\\\n                </tr>\\\n                <tr>\\\n                    <td><img src=\"${buildModuleUrl(\n                      \"Widgets/Images/NavigationHelp/TouchZoom.svg\"\n                    )}\" width=\"70\" height=\"48\" /></td>\\\n                    <td>\\\n                        <div class=\"cesium-navigation-help-zoom\">Zoom view</div>\\\n                        <div class=\"cesium-navigation-help-details\">Two finger pinch</div>\\\n                    </td>\\\n                </tr>\\\n                <tr>\\\n                    <td><img src=\"${buildModuleUrl(\n                      \"Widgets/Images/NavigationHelp/TouchTilt.svg\"\n                    )}\" width=\"70\" height=\"48\" /></td>\\\n                    <td>\\\n                        <div class=\"cesium-navigation-help-rotate\">Tilt view</div>\\\n                        <div class=\"cesium-navigation-help-details\">Two finger drag, same direction</div>\\\n                    </td>\\\n                </tr>\\\n                <tr>\\\n                    <td><img src=\"${buildModuleUrl(\n                      \"Widgets/Images/NavigationHelp/TouchRotate.svg\"\n                    )}\" width=\"70\" height=\"48\" /></td>\\\n                    <td>\\\n                        <div class=\"cesium-navigation-help-tilt\">Rotate view</div>\\\n                        <div class=\"cesium-navigation-help-details\">Two finger drag, opposite direction</div>\\\n                    </td>\\\n                </tr>\\\n            </table>`;\n\n  instructionContainer.appendChild(touchInstructions);\n\n  knockout.applyBindings(viewModel, wrapper);\n\n  this._container = container;\n  this._viewModel = viewModel;\n  this._wrapper = wrapper;\n\n  this._closeInstructions = function (e) {\n    if (!wrapper.contains(e.target)) {\n      viewModel.showInstructions = false;\n    }\n  };\n\n  if (FeatureDetection.supportsPointerEvents()) {\n    document.addEventListener(\"pointerdown\", this._closeInstructions, true);\n  } else {\n    document.addEventListener(\"mousedown\", this._closeInstructions, true);\n    document.addEventListener(\"touchstart\", this._closeInstructions, true);\n  }\n}\n\nObject.defineProperties(NavigationHelpButton.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof NavigationHelpButton.prototype\n   *\n   * @type {Element}\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the view model.\n   * @memberof NavigationHelpButton.prototype\n   *\n   * @type {NavigationHelpButtonViewModel}\n   */\n  viewModel: {\n    get: function () {\n      return this._viewModel;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nNavigationHelpButton.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nNavigationHelpButton.prototype.destroy = function () {\n  if (FeatureDetection.supportsPointerEvents()) {\n    document.removeEventListener(\"pointerdown\", this._closeInstructions, true);\n  } else {\n    document.removeEventListener(\"mousedown\", this._closeInstructions, true);\n    document.removeEventListener(\"touchstart\", this._closeInstructions, true);\n  }\n\n  knockout.cleanNode(this._wrapper);\n  this._container.removeChild(this._wrapper);\n\n  return destroyObject(this);\n};\nexport default NavigationHelpButton;\n", "import {\n  defaultValue,\n  defined,\n  destroyObject,\n  DeveloperError,\n  FrameRateMonitor,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n/**\n * The view model for {@link PerformanceWatchdog}.\n *\n * @alias PerformanceWatchdogViewModel\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Scene} options.scene The Scene instance for which to monitor performance.\n * @param {string} [options.lowFrameRateMessage='This application appears to be performing poorly on your system.  Please try using a different web browser or updating your video drivers.'] The\n *        message to display when a low frame rate is detected.  The message is interpeted as HTML, so make sure\n *        it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.\n */\nfunction PerformanceWatchdogViewModel(options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options) || !defined(options.scene)) {\n    throw new DeveloperError(\"options.scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._scene = options.scene;\n\n  /**\n   * Gets or sets the message to display when a low frame rate is detected.  This string will be interpreted as HTML.\n   * @type {string}\n   */\n  this.lowFrameRateMessage = defaultValue(\n    options.lowFrameRateMessage,\n    \"This application appears to be performing poorly on your system.  Please try using a different web browser or updating your video drivers.\"\n  );\n\n  /**\n   * Gets or sets a value indicating whether the low frame rate message has previously been dismissed by the user.  If it has\n   * been dismissed, the message will not be redisplayed, no matter the frame rate.\n   * @type {boolean}\n   */\n  this.lowFrameRateMessageDismissed = false;\n\n  /**\n   * Gets or sets a value indicating whether the low frame rate message is currently being displayed.\n   * @type {boolean}\n   */\n  this.showingLowFrameRateMessage = false;\n\n  knockout.track(this, [\n    \"lowFrameRateMessage\",\n    \"lowFrameRateMessageDismissed\",\n    \"showingLowFrameRateMessage\",\n  ]);\n\n  const that = this;\n  this._dismissMessage = createCommand(function () {\n    that.showingLowFrameRateMessage = false;\n    that.lowFrameRateMessageDismissed = true;\n  });\n\n  const monitor = FrameRateMonitor.fromScene(options.scene);\n\n  this._unsubscribeLowFrameRate = monitor.lowFrameRate.addEventListener(\n    function () {\n      if (!that.lowFrameRateMessageDismissed) {\n        that.showingLowFrameRateMessage = true;\n      }\n    }\n  );\n\n  this._unsubscribeNominalFrameRate = monitor.nominalFrameRate.addEventListener(\n    function () {\n      that.showingLowFrameRateMessage = false;\n    }\n  );\n}\n\nObject.defineProperties(PerformanceWatchdogViewModel.prototype, {\n  /**\n   * Gets the {@link Scene} instance for which to monitor performance.\n   * @memberof PerformanceWatchdogViewModel.prototype\n   * @type {Scene}\n   */\n  scene: {\n    get: function () {\n      return this._scene;\n    },\n  },\n\n  /**\n   * Gets a command that dismisses the low frame rate message.  Once it is dismissed, the message\n   * will not be redisplayed.\n   * @memberof PerformanceWatchdogViewModel.prototype\n   * @type {Command}\n   */\n  dismissMessage: {\n    get: function () {\n      return this._dismissMessage;\n    },\n  },\n});\n\nPerformanceWatchdogViewModel.prototype.destroy = function () {\n  this._unsubscribeLowFrameRate();\n  this._unsubscribeNominalFrameRate();\n\n  return destroyObject(this);\n};\nexport default PerformanceWatchdogViewModel;\n", "import {\n  defined,\n  destroyObject,\n  DeveloperError,\n  getElement,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport PerformanceWatchdogViewModel from \"./PerformanceWatchdogViewModel.js\";\n\n/**\n * Monitors performance of the application and displays a message if poor performance is detected.\n *\n * @alias PerformanceWatchdog\n * @constructor\n *\n * @param {object} [options] Object with the following properties:\n * @param {Element|string} options.container The DOM element or ID that will contain the widget.\n * @param {Scene} options.scene The {@link Scene} for which to monitor performance.\n * @param {string} [options.lowFrameRateMessage='This application appears to be performing poorly on your system.  Please try using a different web browser or updating your video drivers.'] The\n *        message to display when a low frame rate is detected.  The message is interpeted as HTML, so make sure\n *        it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.\n */\nfunction PerformanceWatchdog(options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(options) || !defined(options.container)) {\n    throw new DeveloperError(\"options.container is required.\");\n  }\n  if (!defined(options.scene)) {\n    throw new DeveloperError(\"options.scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const container = getElement(options.container);\n\n  const viewModel = new PerformanceWatchdogViewModel(options);\n\n  const element = document.createElement(\"div\");\n  element.className = \"cesium-performance-watchdog-message-area\";\n  element.setAttribute(\"data-bind\", \"visible: showingLowFrameRateMessage\");\n\n  const dismissButton = document.createElement(\"button\");\n  dismissButton.setAttribute(\"type\", \"button\");\n  dismissButton.className = \"cesium-performance-watchdog-message-dismiss\";\n  dismissButton.innerHTML = \"&times;\";\n  dismissButton.setAttribute(\"data-bind\", \"click: dismissMessage\");\n  element.appendChild(dismissButton);\n\n  const message = document.createElement(\"div\");\n  message.className = \"cesium-performance-watchdog-message\";\n  message.setAttribute(\"data-bind\", \"html: lowFrameRateMessage\");\n  element.appendChild(message);\n\n  container.appendChild(element);\n\n  knockout.applyBindings(viewModel, element);\n\n  this._container = container;\n  this._viewModel = viewModel;\n  this._element = element;\n}\n\nObject.defineProperties(PerformanceWatchdog.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof PerformanceWatchdog.prototype\n   *\n   * @type {Element}\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the view model.\n   * @memberof PerformanceWatchdog.prototype\n   *\n   * @type {PerformanceWatchdogViewModel}\n   */\n  viewModel: {\n    get: function () {\n      return this._viewModel;\n    },\n  },\n});\n\n/**\n * @memberof PerformanceWatchdog\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nPerformanceWatchdog.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n * @memberof PerformanceWatchdog\n */\nPerformanceWatchdog.prototype.destroy = function () {\n  this._viewModel.destroy();\n  knockout.cleanNode(this._element);\n  this._container.removeChild(this._element);\n\n  return destroyObject(this);\n};\nexport default PerformanceWatchdog;\n", "import {\n  defined,\n  destroyObject,\n  DeveloperError,\n  EventHelper,\n  OrthographicFrustum,\n  SceneMode,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n/**\n * The view model for {@link ProjectionPicker}.\n * @alias ProjectionPickerViewModel\n * @constructor\n *\n * @param {Scene} scene The Scene to switch projections.\n */\nfunction ProjectionPickerViewModel(scene) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._scene = scene;\n  this._orthographic = scene.camera.frustum instanceof OrthographicFrustum;\n  this._flightInProgress = false;\n\n  /**\n   * Gets or sets whether the button drop-down is currently visible.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.dropDownVisible = false;\n\n  /**\n   * Gets or sets the perspective projection tooltip.  This property is observable.\n   * @type {string}\n   * @default 'Perspective Projection'\n   */\n  this.tooltipPerspective = \"Perspective Projection\";\n\n  /**\n   * Gets or sets the orthographic projection tooltip.  This property is observable.\n   * @type {string}\n   * @default 'Orthographic Projection'\n   */\n  this.tooltipOrthographic = \"Orthographic Projection\";\n\n  /**\n   * Gets the currently active tooltip.  This property is observable.\n   * @type {string}\n   */\n  this.selectedTooltip = undefined;\n\n  /**\n   * Gets or sets the current SceneMode.  This property is observable.\n   * @type {SceneMode}\n   */\n  this.sceneMode = scene.mode;\n\n  knockout.track(this, [\n    \"_orthographic\",\n    \"_flightInProgress\",\n    \"sceneMode\",\n    \"dropDownVisible\",\n    \"tooltipPerspective\",\n    \"tooltipOrthographic\",\n  ]);\n\n  const that = this;\n  knockout.defineProperty(this, \"selectedTooltip\", function () {\n    if (that._orthographic) {\n      return that.tooltipOrthographic;\n    }\n    return that.tooltipPerspective;\n  });\n\n  this._toggleDropDown = createCommand(function () {\n    if (that.sceneMode === SceneMode.SCENE2D || that._flightInProgress) {\n      return;\n    }\n\n    that.dropDownVisible = !that.dropDownVisible;\n  });\n\n  this._eventHelper = new EventHelper();\n  this._eventHelper.add(scene.morphComplete, function (\n    transitioner,\n    oldMode,\n    newMode,\n    isMorphing\n  ) {\n    that.sceneMode = newMode;\n    that._orthographic =\n      newMode === SceneMode.SCENE2D ||\n      that._scene.camera.frustum instanceof OrthographicFrustum;\n  });\n  this._eventHelper.add(scene.preRender, function () {\n    that._flightInProgress = defined(scene.camera._currentFlight);\n  });\n\n  this._switchToPerspective = createCommand(function () {\n    if (that.sceneMode === SceneMode.SCENE2D) {\n      return;\n    }\n\n    that._scene.camera.switchToPerspectiveFrustum();\n    that._orthographic = false;\n    that.dropDownVisible = false;\n  });\n\n  this._switchToOrthographic = createCommand(function () {\n    if (that.sceneMode === SceneMode.SCENE2D) {\n      return;\n    }\n\n    that._scene.camera.switchToOrthographicFrustum();\n    that._orthographic = true;\n    that.dropDownVisible = false;\n  });\n\n  //Used by knockout\n  this._sceneMode = SceneMode;\n}\n\nObject.defineProperties(ProjectionPickerViewModel.prototype, {\n  /**\n   * Gets the scene\n   * @memberof ProjectionPickerViewModel.prototype\n   * @type {Scene}\n   */\n  scene: {\n    get: function () {\n      return this._scene;\n    },\n  },\n\n  /**\n   * Gets the command to toggle the drop down box.\n   * @memberof ProjectionPickerViewModel.prototype\n   *\n   * @type {Command}\n   */\n  toggleDropDown: {\n    get: function () {\n      return this._toggleDropDown;\n    },\n  },\n\n  /**\n   * Gets the command to switch to a perspective projection.\n   * @memberof ProjectionPickerViewModel.prototype\n   *\n   * @type {Command}\n   */\n  switchToPerspective: {\n    get: function () {\n      return this._switchToPerspective;\n    },\n  },\n\n  /**\n   * Gets the command to switch to orthographic projection.\n   * @memberof ProjectionPickerViewModel.prototype\n   *\n   * @type {Command}\n   */\n  switchToOrthographic: {\n    get: function () {\n      return this._switchToOrthographic;\n    },\n  },\n\n  /**\n   * Gets whether the scene is currently using an orthographic projection.\n   * @memberof ProjectionPickerViewModel.prototype\n   *\n   * @type {Command}\n   */\n  isOrthographicProjection: {\n    get: function () {\n      return this._orthographic;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nProjectionPickerViewModel.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the view model.\n */\nProjectionPickerViewModel.prototype.destroy = function () {\n  this._eventHelper.removeAll();\n  destroyObject(this);\n};\nexport default ProjectionPickerViewModel;\n", "import {\n  defined,\n  destroyObject,\n  DeveloperError,\n  FeatureDetection,\n  getElement,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport ProjectionPickerViewModel from \"./ProjectionPickerViewModel.js\";\n\nconst perspectivePath =\n  \"M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z\";\nconst orthographicPath =\n  \"m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z\";\n\n/**\n * The ProjectionPicker is a single button widget for switching between perspective and orthographic projections.\n *\n * @alias ProjectionPicker\n * @constructor\n *\n * @param {Element|string} container The DOM element or ID that will contain the widget.\n * @param {Scene} scene The Scene instance to use.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n *\n * @example\n * // In HTML head, include a link to the ProjectionPicker.css stylesheet,\n * // and in the body, include: <div id=\"projectionPickerContainer\"></div>\n * // Note: This code assumes you already have a Scene instance.\n *\n * const projectionPicker = new Cesium.ProjectionPicker('projectionPickerContainer', scene);\n */\nfunction ProjectionPicker(container, scene) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(container)) {\n    throw new DeveloperError(\"container is required.\");\n  }\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  container = getElement(container);\n\n  const viewModel = new ProjectionPickerViewModel(scene);\n\n  viewModel._perspectivePath = perspectivePath;\n  viewModel._orthographicPath = orthographicPath;\n\n  const wrapper = document.createElement(\"span\");\n  wrapper.className = \"cesium-projectionPicker-wrapper cesium-toolbar-button\";\n  container.appendChild(wrapper);\n\n  const button = document.createElement(\"button\");\n  button.type = \"button\";\n  button.className = \"cesium-button cesium-toolbar-button\";\n  button.setAttribute(\n    \"data-bind\",\n    '\\\ncss: { \"cesium-projectionPicker-buttonPerspective\": !_orthographic,\\\n       \"cesium-projectionPicker-buttonOrthographic\": _orthographic,\\\n       \"cesium-button-disabled\" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, \\\n       \"cesium-projectionPicker-selected\": dropDownVisible },\\\nattr: { title: selectedTooltip },\\\nclick: toggleDropDown'\n  );\n  button.innerHTML =\n    '\\\n<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: \"cesium-projectionPicker-iconPerspective\" } --><!-- /ko -->\\\n<!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: \"cesium-projectionPicker-iconOrthographic\" } --><!-- /ko -->';\n  wrapper.appendChild(button);\n\n  const perspectiveButton = document.createElement(\"button\");\n  perspectiveButton.type = \"button\";\n  perspectiveButton.className =\n    \"cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon\";\n  perspectiveButton.setAttribute(\n    \"data-bind\",\n    '\\\ncss: { \"cesium-projectionPicker-visible\" : (dropDownVisible && _orthographic),\\\n       \"cesium-projectionPicker-none\" : !_orthographic,\\\n       \"cesium-projectionPicker-hidden\" : !dropDownVisible },\\\nattr: { title: tooltipPerspective },\\\nclick: switchToPerspective,\\\ncesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'\n  );\n  wrapper.appendChild(perspectiveButton);\n\n  const orthographicButton = document.createElement(\"button\");\n  orthographicButton.type = \"button\";\n  orthographicButton.className =\n    \"cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon\";\n  orthographicButton.setAttribute(\n    \"data-bind\",\n    '\\\ncss: { \"cesium-projectionPicker-visible\" : (dropDownVisible && !_orthographic),\\\n       \"cesium-projectionPicker-none\" : _orthographic,\\\n       \"cesium-projectionPicker-hidden\" : !dropDownVisible},\\\nattr: { title: tooltipOrthographic },\\\nclick: switchToOrthographic,\\\ncesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'\n  );\n  wrapper.appendChild(orthographicButton);\n\n  knockout.applyBindings(viewModel, wrapper);\n\n  this._viewModel = viewModel;\n  this._container = container;\n  this._wrapper = wrapper;\n\n  this._closeDropDown = function (e) {\n    if (!wrapper.contains(e.target)) {\n      viewModel.dropDownVisible = false;\n    }\n  };\n  if (FeatureDetection.supportsPointerEvents()) {\n    document.addEventListener(\"pointerdown\", this._closeDropDown, true);\n  } else {\n    document.addEventListener(\"mousedown\", this._closeDropDown, true);\n    document.addEventListener(\"touchstart\", this._closeDropDown, true);\n  }\n}\n\nObject.defineProperties(ProjectionPicker.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof ProjectionPicker.prototype\n   *\n   * @type {Element}\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the view model.\n   * @memberof ProjectionPicker.prototype\n   *\n   * @type {ProjectionPickerViewModel}\n   */\n  viewModel: {\n    get: function () {\n      return this._viewModel;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nProjectionPicker.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nProjectionPicker.prototype.destroy = function () {\n  this._viewModel.destroy();\n\n  if (FeatureDetection.supportsPointerEvents()) {\n    document.removeEventListener(\"pointerdown\", this._closeDropDown, true);\n  } else {\n    document.removeEventListener(\"mousedown\", this._closeDropDown, true);\n    document.removeEventListener(\"touchstart\", this._closeDropDown, true);\n  }\n\n  knockout.cleanNode(this._wrapper);\n  this._container.removeChild(this._wrapper);\n\n  return destroyObject(this);\n};\nexport default ProjectionPicker;\n", "import {\n  defaultValue,\n  defined,\n  destroyObject,\n  DeveloperError,\n  EventHelper,\n  SceneMode,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n/**\n * The view model for {@link SceneModePicker}.\n * @alias SceneModePickerViewModel\n * @constructor\n *\n * @param {Scene} scene The Scene to morph\n * @param {number} [duration=2.0] The duration of scene morph animations, in seconds\n */\nfunction SceneModePickerViewModel(scene, duration) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  this._scene = scene;\n\n  const that = this;\n\n  const morphStart = function (transitioner, oldMode, newMode, isMorphing) {\n    that.sceneMode = newMode;\n    that.dropDownVisible = false;\n  };\n\n  this._eventHelper = new EventHelper();\n  this._eventHelper.add(scene.morphStart, morphStart);\n\n  this._duration = defaultValue(duration, 2.0);\n\n  /**\n   * Gets or sets the current SceneMode.  This property is observable.\n   * @type {SceneMode}\n   */\n  this.sceneMode = scene.mode;\n\n  /**\n   * Gets or sets whether the button drop-down is currently visible.  This property is observable.\n   * @type {boolean}\n   * @default false\n   */\n  this.dropDownVisible = false;\n\n  /**\n   * Gets or sets the 2D tooltip.  This property is observable.\n   * @type {string}\n   * @default '2D'\n   */\n  this.tooltip2D = \"2D\";\n\n  /**\n   * Gets or sets the 3D tooltip.  This property is observable.\n   * @type {string}\n   * @default '3D'\n   */\n  this.tooltip3D = \"3D\";\n\n  /**\n   * Gets or sets the Columbus View tooltip.  This property is observable.\n   * @type {string}\n   * @default 'Columbus View'\n   */\n  this.tooltipColumbusView = \"Columbus View\";\n\n  knockout.track(this, [\n    \"sceneMode\",\n    \"dropDownVisible\",\n    \"tooltip2D\",\n    \"tooltip3D\",\n    \"tooltipColumbusView\",\n  ]);\n\n  /**\n   * Gets the currently active tooltip.  This property is observable.\n   * @type {string}\n   */\n  this.selectedTooltip = undefined;\n  knockout.defineProperty(this, \"selectedTooltip\", function () {\n    const mode = that.sceneMode;\n    if (mode === SceneMode.SCENE2D) {\n      return that.tooltip2D;\n    }\n    if (mode === SceneMode.SCENE3D) {\n      return that.tooltip3D;\n    }\n    return that.tooltipColumbusView;\n  });\n\n  this._toggleDropDown = createCommand(function () {\n    that.dropDownVisible = !that.dropDownVisible;\n  });\n\n  this._morphTo2D = createCommand(function () {\n    scene.morphTo2D(that._duration);\n  });\n\n  this._morphTo3D = createCommand(function () {\n    scene.morphTo3D(that._duration);\n  });\n\n  this._morphToColumbusView = createCommand(function () {\n    scene.morphToColumbusView(that._duration);\n  });\n\n  //Used by knockout\n  this._sceneMode = SceneMode;\n}\n\nObject.defineProperties(SceneModePickerViewModel.prototype, {\n  /**\n   * Gets the scene\n   * @memberof SceneModePickerViewModel.prototype\n   * @type {Scene}\n   */\n  scene: {\n    get: function () {\n      return this._scene;\n    },\n  },\n\n  /**\n   * Gets or sets the the duration of scene mode transition animations in seconds.\n   * A value of zero causes the scene to instantly change modes.\n   * @memberof SceneModePickerViewModel.prototype\n   * @type {number}\n   */\n  duration: {\n    get: function () {\n      return this._duration;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (value < 0.0) {\n        throw new DeveloperError(\"duration value must be positive.\");\n      }\n      //>>includeEnd('debug');\n\n      this._duration = value;\n    },\n  },\n\n  /**\n   * Gets the command to toggle the drop down box.\n   * @memberof SceneModePickerViewModel.prototype\n   *\n   * @type {Command}\n   */\n  toggleDropDown: {\n    get: function () {\n      return this._toggleDropDown;\n    },\n  },\n\n  /**\n   * Gets the command to morph to 2D.\n   * @memberof SceneModePickerViewModel.prototype\n   *\n   * @type {Command}\n   */\n  morphTo2D: {\n    get: function () {\n      return this._morphTo2D;\n    },\n  },\n\n  /**\n   * Gets the command to morph to 3D.\n   * @memberof SceneModePickerViewModel.prototype\n   *\n   * @type {Command}\n   */\n  morphTo3D: {\n    get: function () {\n      return this._morphTo3D;\n    },\n  },\n\n  /**\n   * Gets the command to morph to Columbus View.\n   * @memberof SceneModePickerViewModel.prototype\n   *\n   * @type {Command}\n   */\n  morphToColumbusView: {\n    get: function () {\n      return this._morphToColumbusView;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nSceneModePickerViewModel.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the view model.\n */\nSceneModePickerViewModel.prototype.destroy = function () {\n  this._eventHelper.removeAll();\n\n  destroyObject(this);\n};\nexport default SceneModePickerViewModel;\n", "import {\n  defined,\n  destroyObject,\n  DeveloperError,\n  FeatureDetection,\n  getElement,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport SceneModePickerViewModel from \"./SceneModePickerViewModel.js\";\n\nconst globePath =\n  \"m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 \\\n        -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 \\\n        -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 \\\n        11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z \\\n        M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 \\\n        5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 \\\n        -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z\";\nconst flatMapPath =\n  \"m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z\";\nconst columbusViewPath =\n  \"m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z\";\n\n/**\n * <img src=\"Images/sceneModePicker.png\" style=\"float: left; margin-right: 10px;\" width=\"44\" height=\"116\" />\n * <p>The SceneModePicker is a single button widget for switching between scene modes;\n * shown to the left in its expanded state. Programatic switching of scene modes will\n * be automatically reflected in the widget as long as the specified Scene\n * is used to perform the change.</p><p style=\"clear: both;\"></p><br/>\n *\n * @alias SceneModePicker\n * @constructor\n *\n * @param {Element|string} container The DOM element or ID that will contain the widget.\n * @param {Scene} scene The Scene instance to use.\n * @param {number} [duration=2.0] The time, in seconds, it takes for the scene to transition.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n *\n * @example\n * // In HTML head, include a link to the SceneModePicker.css stylesheet,\n * // and in the body, include: <div id=\"sceneModePickerContainer\"></div>\n * // Note: This code assumes you already have a Scene instance.\n *\n * const sceneModePicker = new Cesium.SceneModePicker('sceneModePickerContainer', scene);\n */\nfunction SceneModePicker(container, scene, duration) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(container)) {\n    throw new DeveloperError(\"container is required.\");\n  }\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  container = getElement(container);\n\n  const viewModel = new SceneModePickerViewModel(scene, duration);\n\n  viewModel._globePath = globePath;\n  viewModel._flatMapPath = flatMapPath;\n  viewModel._columbusViewPath = columbusViewPath;\n\n  const wrapper = document.createElement(\"span\");\n  wrapper.className = \"cesium-sceneModePicker-wrapper cesium-toolbar-button\";\n  container.appendChild(wrapper);\n\n  const button = document.createElement(\"button\");\n  button.type = \"button\";\n  button.className = \"cesium-button cesium-toolbar-button\";\n  button.setAttribute(\n    \"data-bind\",\n    '\\\ncss: { \"cesium-sceneModePicker-button2D\": sceneMode === _sceneMode.SCENE2D,\\\n       \"cesium-sceneModePicker-button3D\": sceneMode === _sceneMode.SCENE3D,\\\n       \"cesium-sceneModePicker-buttonColumbusView\": sceneMode === _sceneMode.COLUMBUS_VIEW,\\\n       \"cesium-sceneModePicker-selected\": dropDownVisible },\\\nattr: { title: selectedTooltip },\\\nclick: toggleDropDown'\n  );\n  button.innerHTML =\n    '\\\n<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: \"cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D\" } --><!-- /ko -->\\\n<!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: \"cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D\" } --><!-- /ko -->\\\n<!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: \"cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView\" } --><!-- /ko -->';\n  wrapper.appendChild(button);\n\n  const morphTo3DButton = document.createElement(\"button\");\n  morphTo3DButton.type = \"button\";\n  morphTo3DButton.className =\n    \"cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon\";\n  morphTo3DButton.setAttribute(\n    \"data-bind\",\n    '\\\ncss: { \"cesium-sceneModePicker-visible\" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)),\\\n       \"cesium-sceneModePicker-none\" : sceneMode === _sceneMode.SCENE3D,\\\n       \"cesium-sceneModePicker-hidden\" : !dropDownVisible },\\\nattr: { title: tooltip3D },\\\nclick: morphTo3D,\\\ncesiumSvgPath: { path: _globePath, width: 64, height: 64 }'\n  );\n  wrapper.appendChild(morphTo3DButton);\n\n  const morphTo2DButton = document.createElement(\"button\");\n  morphTo2DButton.type = \"button\";\n  morphTo2DButton.className =\n    \"cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon\";\n  morphTo2DButton.setAttribute(\n    \"data-bind\",\n    '\\\ncss: { \"cesium-sceneModePicker-visible\" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)),\\\n       \"cesium-sceneModePicker-none\" : sceneMode === _sceneMode.SCENE2D,\\\n       \"cesium-sceneModePicker-hidden\" : !dropDownVisible },\\\nattr: { title: tooltip2D },\\\nclick: morphTo2D,\\\ncesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'\n  );\n  wrapper.appendChild(morphTo2DButton);\n\n  const morphToCVButton = document.createElement(\"button\");\n  morphToCVButton.type = \"button\";\n  morphToCVButton.className =\n    \"cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon\";\n  morphToCVButton.setAttribute(\n    \"data-bind\",\n    '\\\ncss: { \"cesium-sceneModePicker-visible\" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)),\\\n       \"cesium-sceneModePicker-none\" : sceneMode === _sceneMode.COLUMBUS_VIEW,\\\n       \"cesium-sceneModePicker-hidden\" : !dropDownVisible},\\\nattr: { title: tooltipColumbusView },\\\nclick: morphToColumbusView,\\\ncesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'\n  );\n  wrapper.appendChild(morphToCVButton);\n\n  knockout.applyBindings(viewModel, wrapper);\n\n  this._viewModel = viewModel;\n  this._container = container;\n  this._wrapper = wrapper;\n\n  this._closeDropDown = function (e) {\n    if (!wrapper.contains(e.target)) {\n      viewModel.dropDownVisible = false;\n    }\n  };\n  if (FeatureDetection.supportsPointerEvents()) {\n    document.addEventListener(\"pointerdown\", this._closeDropDown, true);\n  } else {\n    document.addEventListener(\"mousedown\", this._closeDropDown, true);\n    document.addEventListener(\"touchstart\", this._closeDropDown, true);\n  }\n}\n\nObject.defineProperties(SceneModePicker.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof SceneModePicker.prototype\n   *\n   * @type {Element}\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the view model.\n   * @memberof SceneModePicker.prototype\n   *\n   * @type {SceneModePickerViewModel}\n   */\n  viewModel: {\n    get: function () {\n      return this._viewModel;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nSceneModePicker.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nSceneModePicker.prototype.destroy = function () {\n  this._viewModel.destroy();\n\n  if (FeatureDetection.supportsPointerEvents()) {\n    document.removeEventListener(\"pointerdown\", this._closeDropDown, true);\n  } else {\n    document.removeEventListener(\"mousedown\", this._closeDropDown, true);\n    document.removeEventListener(\"touchstart\", this._closeDropDown, true);\n  }\n\n  knockout.cleanNode(this._wrapper);\n  this._container.removeChild(this._wrapper);\n\n  return destroyObject(this);\n};\nexport default SceneModePicker;\n", "import {\n  Cartesian2,\n  defaultValue,\n  defined,\n  DeveloperError,\n  EasingFunction,\n  SceneTransforms,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\n\nconst screenSpacePos = new Cartesian2();\nconst offScreen = \"-1000px\";\n\n/**\n * The view model for {@link SelectionIndicator}.\n * @alias SelectionIndicatorViewModel\n * @constructor\n *\n * @param {Scene} scene The scene instance to use for screen-space coordinate conversion.\n * @param {Element} selectionIndicatorElement The element containing all elements that make up the selection indicator.\n * @param {Element} container The DOM element that contains the widget.\n */\nfunction SelectionIndicatorViewModel(\n  scene,\n  selectionIndicatorElement,\n  container\n) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n\n  if (!defined(selectionIndicatorElement)) {\n    throw new DeveloperError(\"selectionIndicatorElement is required.\");\n  }\n\n  if (!defined(container)) {\n    throw new DeveloperError(\"container is required.\");\n  }\n  //>>includeEnd('debug')\n\n  this._scene = scene;\n  this._screenPositionX = offScreen;\n  this._screenPositionY = offScreen;\n  this._tweens = scene.tweens;\n  this._container = defaultValue(container, document.body);\n  this._selectionIndicatorElement = selectionIndicatorElement;\n  this._scale = 1;\n\n  /**\n   * Gets or sets the world position of the object for which to display the selection indicator.\n   * @type {Cartesian3}\n   */\n  this.position = undefined;\n\n  /**\n   * Gets or sets the visibility of the selection indicator.\n   * @type {boolean}\n   */\n  this.showSelection = false;\n\n  knockout.track(this, [\n    \"position\",\n    \"_screenPositionX\",\n    \"_screenPositionY\",\n    \"_scale\",\n    \"showSelection\",\n  ]);\n\n  /**\n   * Gets the visibility of the position indicator.  This can be false even if an\n   * object is selected, when the selected object has no position.\n   * @type {boolean}\n   */\n  this.isVisible = undefined;\n  knockout.defineProperty(this, \"isVisible\", {\n    get: function () {\n      return this.showSelection && defined(this.position);\n    },\n  });\n\n  knockout.defineProperty(this, \"_transform\", {\n    get: function () {\n      return `scale(${this._scale})`;\n    },\n  });\n\n  /**\n   * Gets or sets the function for converting the world position of the object to the screen space position.\n   *\n   * @member\n   * @type {SelectionIndicatorViewModel.ComputeScreenSpacePosition}\n   * @default SceneTransforms.wgs84ToWindowCoordinates\n   *\n   * @example\n   * selectionIndicatorViewModel.computeScreenSpacePosition = function(position, result) {\n   *     return Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position, result);\n   * };\n   */\n  this.computeScreenSpacePosition = function (position, result) {\n    return SceneTransforms.wgs84ToWindowCoordinates(scene, position, result);\n  };\n}\n\n/**\n * Updates the view of the selection indicator to match the position and content properties of the view model.\n * This function should be called as part of the render loop.\n */\nSelectionIndicatorViewModel.prototype.update = function () {\n  if (this.showSelection && defined(this.position)) {\n    const screenPosition = this.computeScreenSpacePosition(\n      this.position,\n      screenSpacePos\n    );\n    if (!defined(screenPosition)) {\n      this._screenPositionX = offScreen;\n      this._screenPositionY = offScreen;\n    } else {\n      const container = this._container;\n      const containerWidth = container.parentNode.clientWidth;\n      const containerHeight = container.parentNode.clientHeight;\n      const indicatorSize = this._selectionIndicatorElement.clientWidth;\n      const halfSize = indicatorSize * 0.5;\n\n      screenPosition.x =\n        Math.min(\n          Math.max(screenPosition.x, -indicatorSize),\n          containerWidth + indicatorSize\n        ) - halfSize;\n      screenPosition.y =\n        Math.min(\n          Math.max(screenPosition.y, -indicatorSize),\n          containerHeight + indicatorSize\n        ) - halfSize;\n\n      this._screenPositionX = `${Math.floor(screenPosition.x + 0.25)}px`;\n      this._screenPositionY = `${Math.floor(screenPosition.y + 0.25)}px`;\n    }\n  }\n};\n\n/**\n * Animate the indicator to draw attention to the selection.\n */\nSelectionIndicatorViewModel.prototype.animateAppear = function () {\n  this._tweens.addProperty({\n    object: this,\n    property: \"_scale\",\n    startValue: 2,\n    stopValue: 1,\n    duration: 0.8,\n    easingFunction: EasingFunction.EXPONENTIAL_OUT,\n  });\n};\n\n/**\n * Animate the indicator to release the selection.\n */\nSelectionIndicatorViewModel.prototype.animateDepart = function () {\n  this._tweens.addProperty({\n    object: this,\n    property: \"_scale\",\n    startValue: this._scale,\n    stopValue: 1.5,\n    duration: 0.8,\n    easingFunction: EasingFunction.EXPONENTIAL_OUT,\n  });\n};\n\nObject.defineProperties(SelectionIndicatorViewModel.prototype, {\n  /**\n   * Gets the HTML element containing the selection indicator.\n   * @memberof SelectionIndicatorViewModel.prototype\n   *\n   * @type {Element}\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the HTML element that holds the selection indicator.\n   * @memberof SelectionIndicatorViewModel.prototype\n   *\n   * @type {Element}\n   */\n  selectionIndicatorElement: {\n    get: function () {\n      return this._selectionIndicatorElement;\n    },\n  },\n\n  /**\n   * Gets the scene being used.\n   * @memberof SelectionIndicatorViewModel.prototype\n   *\n   * @type {Scene}\n   */\n  scene: {\n    get: function () {\n      return this._scene;\n    },\n  },\n});\n\n/**\n * A function that converts the world position of an object to a screen space position.\n * @callback SelectionIndicatorViewModel.ComputeScreenSpacePosition\n * @param {Cartesian3} position The position in WGS84 (world) coordinates.\n * @param {Cartesian2} result An object to return the input position transformed to window coordinates.\n * @returns {Cartesian2} The modified result parameter.\n */\nexport default SelectionIndicatorViewModel;\n", "import {\n  defined,\n  destroyObject,\n  DeveloperError,\n  getElement,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport SelectionIndicatorViewModel from \"./SelectionIndicatorViewModel.js\";\n\n/**\n * A widget for displaying an indicator on a selected object.\n *\n * @alias SelectionIndicator\n * @constructor\n *\n * @param {Element|string} container The DOM element or ID that will contain the widget.\n * @param {Scene} scene The Scene instance to use.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n */\nfunction SelectionIndicator(container, scene) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(container)) {\n    throw new DeveloperError(\"container is required.\");\n  }\n  //>>includeEnd('debug')\n\n  container = getElement(container);\n\n  this._container = container;\n\n  const el = document.createElement(\"div\");\n  el.className = \"cesium-selection-wrapper\";\n  el.setAttribute(\n    \"data-bind\",\n    '\\\nstyle: { \"top\" : _screenPositionY, \"left\" : _screenPositionX },\\\ncss: { \"cesium-selection-wrapper-visible\" : isVisible }'\n  );\n  container.appendChild(el);\n  this._element = el;\n\n  const svgNS = \"http://www.w3.org/2000/svg\";\n  const path =\n    \"M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z\";\n\n  const svg = document.createElementNS(svgNS, \"svg:svg\");\n  svg.setAttribute(\"width\", 160);\n  svg.setAttribute(\"height\", 160);\n  svg.setAttribute(\"viewBox\", \"0 0 160 160\");\n\n  const group = document.createElementNS(svgNS, \"g\");\n  group.setAttribute(\"transform\", \"translate(80,80)\");\n  svg.appendChild(group);\n\n  const pathElement = document.createElementNS(svgNS, \"path\");\n  pathElement.setAttribute(\"data-bind\", \"attr: { transform: _transform }\");\n  pathElement.setAttribute(\"d\", path);\n  group.appendChild(pathElement);\n\n  el.appendChild(svg);\n\n  const viewModel = new SelectionIndicatorViewModel(\n    scene,\n    this._element,\n    this._container\n  );\n  this._viewModel = viewModel;\n\n  knockout.applyBindings(this._viewModel, this._element);\n}\n\nObject.defineProperties(SelectionIndicator.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof SelectionIndicator.prototype\n   *\n   * @type {Element}\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the view model.\n   * @memberof SelectionIndicator.prototype\n   *\n   * @type {SelectionIndicatorViewModel}\n   */\n  viewModel: {\n    get: function () {\n      return this._viewModel;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nSelectionIndicator.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nSelectionIndicator.prototype.destroy = function () {\n  const container = this._container;\n  knockout.cleanNode(this._element);\n  container.removeChild(this._element);\n  return destroyObject(this);\n};\nexport default SelectionIndicator;\n", "import { defaultValue, JulianDate } from \"@cesium/engine\";\n\n/**\n * @private\n */\nfunction TimelineHighlightRange(color, heightInPx, base) {\n  this._color = color;\n  this._height = heightInPx;\n  this._base = defaultValue(base, 0);\n}\n\nTimelineHighlightRange.prototype.getHeight = function () {\n  return this._height;\n};\n\nTimelineHighlightRange.prototype.getBase = function () {\n  return this._base;\n};\n\nTimelineHighlightRange.prototype.getStartTime = function () {\n  return this._start;\n};\n\nTimelineHighlightRange.prototype.getStopTime = function () {\n  return this._stop;\n};\n\nTimelineHighlightRange.prototype.setRange = function (start, stop) {\n  this._start = start;\n  this._stop = stop;\n};\n\nTimelineHighlightRange.prototype.render = function (renderState) {\n  let range = \"\";\n  if (this._start && this._stop && this._color) {\n    const highlightStart = JulianDate.secondsDifference(\n      this._start,\n      renderState.epochJulian\n    );\n    let highlightLeft = Math.round(\n      renderState.timeBarWidth * renderState.getAlpha(highlightStart)\n    );\n    const highlightStop = JulianDate.secondsDifference(\n      this._stop,\n      renderState.epochJulian\n    );\n    let highlightWidth =\n      Math.round(\n        renderState.timeBarWidth * renderState.getAlpha(highlightStop)\n      ) - highlightLeft;\n    if (highlightLeft < 0) {\n      highlightWidth += highlightLeft;\n      highlightLeft = 0;\n    }\n    if (highlightLeft + highlightWidth > renderState.timeBarWidth) {\n      highlightWidth = renderState.timeBarWidth - highlightLeft;\n    }\n    if (highlightWidth > 0) {\n      range = `<span class=\"cesium-timeline-highlight\" style=\"left: ${highlightLeft.toString()}px; width: ${highlightWidth.toString()}px; bottom: ${this._base.toString()}px; height: ${\n        this._height\n      }px; background-color: ${this._color};\"></span>`;\n    }\n  }\n  return range;\n};\nexport default TimelineHighlightRange;\n", "import { Color, defined, JulianDate } from \"@cesium/engine\";\n\n/**\n * @private\n */\nfunction TimelineTrack(interval, pixelHeight, color, backgroundColor) {\n  this.interval = interval;\n  this.height = pixelHeight;\n  this.color = color || new Color(0.5, 0.5, 0.5, 1.0);\n  this.backgroundColor = backgroundColor || new Color(0.0, 0.0, 0.0, 0.0);\n}\n\nTimelineTrack.prototype.render = function (context, renderState) {\n  const startInterval = this.interval.start;\n  const stopInterval = this.interval.stop;\n\n  const spanStart = renderState.startJulian;\n  const spanStop = JulianDate.addSeconds(\n    renderState.startJulian,\n    renderState.duration,\n    new JulianDate()\n  );\n\n  if (\n    JulianDate.lessThan(startInterval, spanStart) &&\n    JulianDate.greaterThan(stopInterval, spanStop)\n  ) {\n    //The track takes up the entire visible span.\n    context.fillStyle = this.color.toCssColorString();\n    context.fillRect(0, renderState.y, renderState.timeBarWidth, this.height);\n  } else if (\n    JulianDate.lessThanOrEquals(startInterval, spanStop) &&\n    JulianDate.greaterThanOrEquals(stopInterval, spanStart)\n  ) {\n    //The track only takes up some of the visible span, compute that span.\n    let x;\n    let start, stop;\n    for (x = 0; x < renderState.timeBarWidth; ++x) {\n      const currentTime = JulianDate.addSeconds(\n        renderState.startJulian,\n        (x / renderState.timeBarWidth) * renderState.duration,\n        new JulianDate()\n      );\n      if (\n        !defined(start) &&\n        JulianDate.greaterThanOrEquals(currentTime, startInterval)\n      ) {\n        start = x;\n      } else if (\n        !defined(stop) &&\n        JulianDate.greaterThanOrEquals(currentTime, stopInterval)\n      ) {\n        stop = x;\n      }\n    }\n\n    context.fillStyle = this.backgroundColor.toCssColorString();\n    context.fillRect(0, renderState.y, renderState.timeBarWidth, this.height);\n\n    if (defined(start)) {\n      if (!defined(stop)) {\n        stop = renderState.timeBarWidth;\n      }\n      context.fillStyle = this.color.toCssColorString();\n      context.fillRect(\n        start,\n        renderState.y,\n        Math.max(stop - start, 1),\n        this.height\n      );\n    }\n  }\n};\nexport default TimelineTrack;\n", "import {\n  ClockRange,\n  defined,\n  destroyObject,\n  DeveloperError,\n  getElement,\n  JulianDate,\n} from \"@cesium/engine\";\nimport TimelineHighlightRange from \"./TimelineHighlightRange.js\";\nimport TimelineTrack from \"./TimelineTrack.js\";\n\nlet timelineWheelDelta = 1e12;\n\nconst timelineMouseMode = {\n  none: 0,\n  scrub: 1,\n  slide: 2,\n  zoom: 3,\n  touchOnly: 4,\n};\nconst timelineTouchMode = {\n  none: 0,\n  scrub: 1,\n  slideZoom: 2,\n  singleTap: 3,\n  ignore: 4,\n};\n\nconst timelineTicScales = [\n  0.001,\n  0.002,\n  0.005,\n  0.01,\n  0.02,\n  0.05,\n  0.1,\n  0.25,\n  0.5,\n  1.0,\n  2.0,\n  5.0,\n  10.0,\n  15.0,\n  30.0,\n  60.0, // 1min\n  120.0, // 2min\n  300.0, // 5min\n  600.0, // 10min\n  900.0, // 15min\n  1800.0, // 30min\n  3600.0, // 1hr\n  7200.0, // 2hr\n  14400.0, // 4hr\n  21600.0, // 6hr\n  43200.0, // 12hr\n  86400.0, // 24hr\n  172800.0, // 2days\n  345600.0, // 4days\n  604800.0, // 7days\n  1296000.0, // 15days\n  2592000.0, // 30days\n  5184000.0, // 60days\n  7776000.0, // 90days\n  15552000.0, // 180days\n  31536000.0, // 365days\n  63072000.0, // 2years\n  126144000.0, // 4years\n  157680000.0, // 5years\n  315360000.0, // 10years\n  630720000.0, // 20years\n  1261440000.0, // 40years\n  1576800000.0, // 50years\n  3153600000.0, // 100years\n  6307200000.0, // 200years\n  12614400000.0, // 400years\n  15768000000.0, // 500years\n  31536000000.0, // 1000years\n];\n\nconst timelineMonthNames = [\n  \"Jan\",\n  \"Feb\",\n  \"Mar\",\n  \"Apr\",\n  \"May\",\n  \"Jun\",\n  \"Jul\",\n  \"Aug\",\n  \"Sep\",\n  \"Oct\",\n  \"Nov\",\n  \"Dec\",\n];\n\n/**\n * The Timeline is a widget for displaying and controlling the current scene time.\n * @alias Timeline\n * @constructor\n *\n * @param {Element} container The parent HTML container node for this widget.\n * @param {Clock} clock The clock to use.\n */\nfunction Timeline(container, clock) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(container)) {\n    throw new DeveloperError(\"container is required.\");\n  }\n  if (!defined(clock)) {\n    throw new DeveloperError(\"clock is required.\");\n  }\n  //>>includeEnd('debug');\n\n  container = getElement(container);\n\n  const ownerDocument = container.ownerDocument;\n\n  /**\n   * Gets the parent container.\n   * @type {Element}\n   */\n  this.container = container;\n\n  const topDiv = ownerDocument.createElement(\"div\");\n  topDiv.className = \"cesium-timeline-main\";\n  container.appendChild(topDiv);\n  this._topDiv = topDiv;\n\n  this._endJulian = undefined;\n  this._epochJulian = undefined;\n  this._lastXPos = undefined;\n  this._scrubElement = undefined;\n  this._startJulian = undefined;\n  this._timeBarSecondsSpan = undefined;\n  this._clock = clock;\n  this._scrubJulian = clock.currentTime;\n  this._mainTicSpan = -1;\n  this._mouseMode = timelineMouseMode.none;\n  this._touchMode = timelineTouchMode.none;\n  this._touchState = {\n    centerX: 0,\n    spanX: 0,\n  };\n  this._mouseX = 0;\n  this._timelineDrag = 0;\n  this._timelineDragLocation = undefined;\n  this._lastHeight = undefined;\n  this._lastWidth = undefined;\n\n  this._topDiv.innerHTML =\n    '<div class=\"cesium-timeline-bar\"></div><div class=\"cesium-timeline-trackContainer\">' +\n    '<canvas class=\"cesium-timeline-tracks\" width=\"10\" height=\"1\">' +\n    '</canvas></div><div class=\"cesium-timeline-needle\"></div><span class=\"cesium-timeline-ruler\"></span>';\n  this._timeBarEle = this._topDiv.childNodes[0];\n  this._trackContainer = this._topDiv.childNodes[1];\n  this._trackListEle = this._topDiv.childNodes[1].childNodes[0];\n  this._needleEle = this._topDiv.childNodes[2];\n  this._rulerEle = this._topDiv.childNodes[3];\n  this._context = this._trackListEle.getContext(\"2d\");\n\n  this._trackList = [];\n  this._highlightRanges = [];\n\n  this.zoomTo(clock.startTime, clock.stopTime);\n\n  this._onMouseDown = createMouseDownCallback(this);\n  this._onMouseUp = createMouseUpCallback(this);\n  this._onMouseMove = createMouseMoveCallback(this);\n  this._onMouseWheel = createMouseWheelCallback(this);\n  this._onTouchStart = createTouchStartCallback(this);\n  this._onTouchMove = createTouchMoveCallback(this);\n  this._onTouchEnd = createTouchEndCallback(this);\n\n  const timeBarEle = this._timeBarEle;\n  ownerDocument.addEventListener(\"mouseup\", this._onMouseUp, false);\n  ownerDocument.addEventListener(\"mousemove\", this._onMouseMove, false);\n  timeBarEle.addEventListener(\"mousedown\", this._onMouseDown, false);\n  timeBarEle.addEventListener(\"DOMMouseScroll\", this._onMouseWheel, false); // Mozilla mouse wheel\n  timeBarEle.addEventListener(\"mousewheel\", this._onMouseWheel, false);\n  timeBarEle.addEventListener(\"touchstart\", this._onTouchStart, false);\n  timeBarEle.addEventListener(\"touchmove\", this._onTouchMove, false);\n  timeBarEle.addEventListener(\"touchend\", this._onTouchEnd, false);\n  timeBarEle.addEventListener(\"touchcancel\", this._onTouchEnd, false);\n\n  this._topDiv.oncontextmenu = function () {\n    return false;\n  };\n\n  clock.onTick.addEventListener(this.updateFromClock, this);\n  this.updateFromClock();\n}\n\n/**\n * @private\n */\nTimeline.prototype.addEventListener = function (type, listener, useCapture) {\n  this._topDiv.addEventListener(type, listener, useCapture);\n};\n\n/**\n * @private\n */\nTimeline.prototype.removeEventListener = function (type, listener, useCapture) {\n  this._topDiv.removeEventListener(type, listener, useCapture);\n};\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nTimeline.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nTimeline.prototype.destroy = function () {\n  this._clock.onTick.removeEventListener(this.updateFromClock, this);\n\n  const doc = this.container.ownerDocument;\n  doc.removeEventListener(\"mouseup\", this._onMouseUp, false);\n  doc.removeEventListener(\"mousemove\", this._onMouseMove, false);\n\n  const timeBarEle = this._timeBarEle;\n  timeBarEle.removeEventListener(\"mousedown\", this._onMouseDown, false);\n  timeBarEle.removeEventListener(\"DOMMouseScroll\", this._onMouseWheel, false); // Mozilla mouse wheel\n  timeBarEle.removeEventListener(\"mousewheel\", this._onMouseWheel, false);\n  timeBarEle.removeEventListener(\"touchstart\", this._onTouchStart, false);\n  timeBarEle.removeEventListener(\"touchmove\", this._onTouchMove, false);\n  timeBarEle.removeEventListener(\"touchend\", this._onTouchEnd, false);\n  timeBarEle.removeEventListener(\"touchcancel\", this._onTouchEnd, false);\n  this.container.removeChild(this._topDiv);\n  destroyObject(this);\n};\n\n/**\n * @private\n */\nTimeline.prototype.addHighlightRange = function (color, heightInPx, base) {\n  const newHighlightRange = new TimelineHighlightRange(color, heightInPx, base);\n  this._highlightRanges.push(newHighlightRange);\n  this.resize();\n  return newHighlightRange;\n};\n\n/**\n * @private\n */\nTimeline.prototype.addTrack = function (\n  interval,\n  heightInPx,\n  color,\n  backgroundColor\n) {\n  const newTrack = new TimelineTrack(\n    interval,\n    heightInPx,\n    color,\n    backgroundColor\n  );\n  this._trackList.push(newTrack);\n  this._lastHeight = undefined;\n  this.resize();\n  return newTrack;\n};\n\n/**\n * Sets the view to the provided times.\n *\n * @param {JulianDate} startTime The start time.\n * @param {JulianDate} stopTime The stop time.\n */\nTimeline.prototype.zoomTo = function (startTime, stopTime) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(startTime)) {\n    throw new DeveloperError(\"startTime is required.\");\n  }\n  if (!defined(stopTime)) {\n    throw new DeveloperError(\"stopTime is required\");\n  }\n  if (JulianDate.lessThanOrEquals(stopTime, startTime)) {\n    throw new DeveloperError(\"Start time must come before end time.\");\n  }\n  //>>includeEnd('debug');\n\n  this._startJulian = startTime;\n  this._endJulian = stopTime;\n  this._timeBarSecondsSpan = JulianDate.secondsDifference(stopTime, startTime);\n\n  // If clock is not unbounded, clamp timeline range to clock.\n  if (this._clock && this._clock.clockRange !== ClockRange.UNBOUNDED) {\n    const clockStart = this._clock.startTime;\n    const clockEnd = this._clock.stopTime;\n    const clockSpan = JulianDate.secondsDifference(clockEnd, clockStart);\n    const startOffset = JulianDate.secondsDifference(\n      clockStart,\n      this._startJulian\n    );\n    const endOffset = JulianDate.secondsDifference(clockEnd, this._endJulian);\n\n    if (this._timeBarSecondsSpan >= clockSpan) {\n      // if new duration longer than clock range duration, clamp to full range.\n      this._timeBarSecondsSpan = clockSpan;\n      this._startJulian = this._clock.startTime;\n      this._endJulian = this._clock.stopTime;\n    } else if (startOffset > 0) {\n      // if timeline start is before clock start, shift right\n      this._endJulian = JulianDate.addSeconds(\n        this._endJulian,\n        startOffset,\n        new JulianDate()\n      );\n      this._startJulian = clockStart;\n      this._timeBarSecondsSpan = JulianDate.secondsDifference(\n        this._endJulian,\n        this._startJulian\n      );\n    } else if (endOffset < 0) {\n      // if timeline end is after clock end, shift left\n      this._startJulian = JulianDate.addSeconds(\n        this._startJulian,\n        endOffset,\n        new JulianDate()\n      );\n      this._endJulian = clockEnd;\n      this._timeBarSecondsSpan = JulianDate.secondsDifference(\n        this._endJulian,\n        this._startJulian\n      );\n    }\n  }\n\n  this._makeTics();\n\n  const evt = document.createEvent(\"Event\");\n  evt.initEvent(\"setzoom\", true, true);\n  evt.startJulian = this._startJulian;\n  evt.endJulian = this._endJulian;\n  evt.epochJulian = this._epochJulian;\n  evt.totalSpan = this._timeBarSecondsSpan;\n  evt.mainTicSpan = this._mainTicSpan;\n  this._topDiv.dispatchEvent(evt);\n};\n\n/**\n * @private\n */\nTimeline.prototype.zoomFrom = function (amount) {\n  let centerSec = JulianDate.secondsDifference(\n    this._scrubJulian,\n    this._startJulian\n  );\n  if (amount > 1 || centerSec < 0 || centerSec > this._timeBarSecondsSpan) {\n    centerSec = this._timeBarSecondsSpan * 0.5;\n  } else {\n    centerSec += centerSec - this._timeBarSecondsSpan * 0.5;\n  }\n  const centerSecFlip = this._timeBarSecondsSpan - centerSec;\n  this.zoomTo(\n    JulianDate.addSeconds(\n      this._startJulian,\n      centerSec - centerSec * amount,\n      new JulianDate()\n    ),\n    JulianDate.addSeconds(\n      this._endJulian,\n      centerSecFlip * amount - centerSecFlip,\n      new JulianDate()\n    )\n  );\n};\n\nfunction twoDigits(num) {\n  return num < 10 ? `0${num.toString()}` : num.toString();\n}\n\n/**\n * @private\n */\nTimeline.prototype.makeLabel = function (time) {\n  const gregorian = JulianDate.toGregorianDate(time);\n  const millisecond = gregorian.millisecond;\n  let millisecondString = \" UTC\";\n  if (millisecond > 0 && this._timeBarSecondsSpan < 3600) {\n    millisecondString = Math.floor(millisecond).toString();\n    while (millisecondString.length < 3) {\n      millisecondString = `0${millisecondString}`;\n    }\n    millisecondString = `.${millisecondString}`;\n  }\n\n  return `${timelineMonthNames[gregorian.month - 1]} ${gregorian.day} ${\n    gregorian.year\n  } ${twoDigits(gregorian.hour)}:${twoDigits(gregorian.minute)}:${twoDigits(\n    gregorian.second\n  )}${millisecondString}`;\n};\n\n/**\n * @private\n */\nTimeline.prototype.smallestTicInPixels = 7.0;\n\n/**\n * @private\n */\nTimeline.prototype._makeTics = function () {\n  const timeBar = this._timeBarEle;\n\n  const seconds = JulianDate.secondsDifference(\n    this._scrubJulian,\n    this._startJulian\n  );\n  const xPos = Math.round(\n    (seconds * this._topDiv.clientWidth) / this._timeBarSecondsSpan\n  );\n  const scrubX = xPos - 8;\n  let tic;\n  const widget = this;\n\n  this._needleEle.style.left = `${xPos.toString()}px`;\n\n  let tics = \"\";\n\n  const minimumDuration = 0.01;\n  const maximumDuration = 31536000000.0; // ~1000 years\n  const epsilon = 1e-10;\n\n  // If time step size is known, enter it here...\n  let minSize = 0;\n\n  let duration = this._timeBarSecondsSpan;\n  if (duration < minimumDuration) {\n    duration = minimumDuration;\n    this._timeBarSecondsSpan = minimumDuration;\n    this._endJulian = JulianDate.addSeconds(\n      this._startJulian,\n      minimumDuration,\n      new JulianDate()\n    );\n  } else if (duration > maximumDuration) {\n    duration = maximumDuration;\n    this._timeBarSecondsSpan = maximumDuration;\n    this._endJulian = JulianDate.addSeconds(\n      this._startJulian,\n      maximumDuration,\n      new JulianDate()\n    );\n  }\n\n  let timeBarWidth = this._timeBarEle.clientWidth;\n  if (timeBarWidth < 10) {\n    timeBarWidth = 10;\n  }\n  const startJulian = this._startJulian;\n\n  // epsilonTime: a small fraction of one pixel width of the timeline, measured in seconds.\n  const epsilonTime = Math.min((duration / timeBarWidth) * 1e-5, 0.4);\n\n  // epochJulian: a nearby time to be considered \"zero seconds\", should be a round-ish number by human standards.\n  let epochJulian;\n  const gregorianDate = JulianDate.toGregorianDate(startJulian);\n  if (duration > 315360000) {\n    // 3650+ days visible, epoch is start of the first visible century.\n    epochJulian = JulianDate.fromDate(\n      new Date(Date.UTC(Math.floor(gregorianDate.year / 100) * 100, 0))\n    );\n  } else if (duration > 31536000) {\n    // 365+ days visible, epoch is start of the first visible decade.\n    epochJulian = JulianDate.fromDate(\n      new Date(Date.UTC(Math.floor(gregorianDate.year / 10) * 10, 0))\n    );\n  } else if (duration > 86400) {\n    // 1+ day(s) visible, epoch is start of the year.\n    epochJulian = JulianDate.fromDate(\n      new Date(Date.UTC(gregorianDate.year, 0))\n    );\n  } else {\n    // Less than a day on timeline, epoch is midnight of the visible day.\n    epochJulian = JulianDate.fromDate(\n      new Date(\n        Date.UTC(gregorianDate.year, gregorianDate.month, gregorianDate.day)\n      )\n    );\n  }\n\n  // startTime: Seconds offset of the left side of the timeline from epochJulian.\n  const startTime = JulianDate.secondsDifference(\n    this._startJulian,\n    JulianDate.addSeconds(epochJulian, epsilonTime, new JulianDate())\n  );\n  // endTime: Seconds offset of the right side of the timeline from epochJulian.\n  let endTime = startTime + duration;\n  this._epochJulian = epochJulian;\n\n  function getStartTic(ticScale) {\n    return Math.floor(startTime / ticScale) * ticScale;\n  }\n\n  function getNextTic(tic, ticScale) {\n    return Math.ceil(tic / ticScale + 0.5) * ticScale;\n  }\n\n  function getAlpha(time) {\n    return (time - startTime) / duration;\n  }\n\n  function remainder(x, y) {\n    //return x % y;\n    return x - y * Math.round(x / y);\n  }\n\n  // Width in pixels of a typical label, plus padding\n  this._rulerEle.innerHTML = this.makeLabel(\n    JulianDate.addSeconds(this._endJulian, -minimumDuration, new JulianDate())\n  );\n  let sampleWidth = this._rulerEle.offsetWidth + 20;\n  if (sampleWidth < 30) {\n    // Workaround an apparent IE bug with measuring the width after going full-screen from inside an iframe.\n    sampleWidth = 180;\n  }\n\n  const origMinSize = minSize;\n  minSize -= epsilon;\n\n  const renderState = {\n    startTime: startTime,\n    startJulian: startJulian,\n    epochJulian: epochJulian,\n    duration: duration,\n    timeBarWidth: timeBarWidth,\n    getAlpha: getAlpha,\n  };\n  this._highlightRanges.forEach(function (highlightRange) {\n    tics += highlightRange.render(renderState);\n  });\n\n  // Calculate tic mark label spacing in the TimeBar.\n  let mainTic = 0.0,\n    subTic = 0.0,\n    tinyTic = 0.0;\n  // Ideal labeled tic as percentage of zoom interval\n  let idealTic = sampleWidth / timeBarWidth;\n  if (idealTic > 1.0) {\n    // Clamp to width of window, for thin windows.\n    idealTic = 1.0;\n  }\n  // Ideal labeled tic size in seconds\n  idealTic *= this._timeBarSecondsSpan;\n  let ticIndex = -1,\n    smallestIndex = -1;\n\n  const ticScaleLen = timelineTicScales.length;\n  let i;\n  for (i = 0; i < ticScaleLen; ++i) {\n    const sc = timelineTicScales[i];\n    ++ticIndex;\n    mainTic = sc;\n    // Find acceptable main tic size not smaller than ideal size.\n    if (sc > idealTic && sc > minSize) {\n      break;\n    }\n    if (\n      smallestIndex < 0 &&\n      timeBarWidth * (sc / this._timeBarSecondsSpan) >= this.smallestTicInPixels\n    ) {\n      smallestIndex = ticIndex;\n    }\n  }\n  if (ticIndex > 0) {\n    while (ticIndex > 0) {\n      // Compute sub-tic size that evenly divides main tic.\n      --ticIndex;\n      if (Math.abs(remainder(mainTic, timelineTicScales[ticIndex])) < 0.00001) {\n        if (timelineTicScales[ticIndex] >= minSize) {\n          subTic = timelineTicScales[ticIndex];\n        }\n        break;\n      }\n    }\n\n    if (smallestIndex >= 0) {\n      while (smallestIndex < ticIndex) {\n        // Compute tiny tic size that evenly divides sub-tic.\n        if (\n          Math.abs(remainder(subTic, timelineTicScales[smallestIndex])) <\n            0.00001 &&\n          timelineTicScales[smallestIndex] >= minSize\n        ) {\n          tinyTic = timelineTicScales[smallestIndex];\n          break;\n        }\n        ++smallestIndex;\n      }\n    }\n  }\n\n  minSize = origMinSize;\n  if (\n    minSize > epsilon &&\n    tinyTic < 0.00001 &&\n    Math.abs(minSize - mainTic) > epsilon\n  ) {\n    tinyTic = minSize;\n    if (minSize <= mainTic + epsilon) {\n      subTic = 0.0;\n    }\n  }\n\n  let lastTextLeft = -999999,\n    textWidth;\n  if (timeBarWidth * (tinyTic / this._timeBarSecondsSpan) >= 3.0) {\n    for (\n      tic = getStartTic(tinyTic);\n      tic <= endTime;\n      tic = getNextTic(tic, tinyTic)\n    ) {\n      tics += `<span class=\"cesium-timeline-ticTiny\" style=\"left: ${Math.round(\n        timeBarWidth * getAlpha(tic)\n      ).toString()}px;\"></span>`;\n    }\n  }\n  if (timeBarWidth * (subTic / this._timeBarSecondsSpan) >= 3.0) {\n    for (\n      tic = getStartTic(subTic);\n      tic <= endTime;\n      tic = getNextTic(tic, subTic)\n    ) {\n      tics += `<span class=\"cesium-timeline-ticSub\" style=\"left: ${Math.round(\n        timeBarWidth * getAlpha(tic)\n      ).toString()}px;\"></span>`;\n    }\n  }\n  if (timeBarWidth * (mainTic / this._timeBarSecondsSpan) >= 2.0) {\n    this._mainTicSpan = mainTic;\n    endTime += mainTic;\n    tic = getStartTic(mainTic);\n    const leapSecond = JulianDate.computeTaiMinusUtc(epochJulian);\n    while (tic <= endTime) {\n      let ticTime = JulianDate.addSeconds(\n        startJulian,\n        tic - startTime,\n        new JulianDate()\n      );\n      if (mainTic > 2.1) {\n        const ticLeap = JulianDate.computeTaiMinusUtc(ticTime);\n        if (Math.abs(ticLeap - leapSecond) > 0.1) {\n          tic += ticLeap - leapSecond;\n          ticTime = JulianDate.addSeconds(\n            startJulian,\n            tic - startTime,\n            new JulianDate()\n          );\n        }\n      }\n      const ticLeft = Math.round(timeBarWidth * getAlpha(tic));\n      const ticLabel = this.makeLabel(ticTime);\n      this._rulerEle.innerHTML = ticLabel;\n      textWidth = this._rulerEle.offsetWidth;\n      if (textWidth < 10) {\n        // IE iframe fullscreen sampleWidth workaround, continued.\n        textWidth = sampleWidth;\n      }\n      const labelLeft = ticLeft - (textWidth / 2 - 1);\n      if (labelLeft > lastTextLeft) {\n        lastTextLeft = labelLeft + textWidth + 5;\n        tics +=\n          `<span class=\"cesium-timeline-ticMain\" style=\"left: ${ticLeft.toString()}px;\"></span>` +\n          `<span class=\"cesium-timeline-ticLabel\" style=\"left: ${labelLeft.toString()}px;\">${ticLabel}</span>`;\n      } else {\n        tics += `<span class=\"cesium-timeline-ticSub\" style=\"left: ${ticLeft.toString()}px;\"></span>`;\n      }\n      tic = getNextTic(tic, mainTic);\n    }\n  } else {\n    this._mainTicSpan = -1;\n  }\n\n  tics += `<span class=\"cesium-timeline-icon16\" style=\"left:${scrubX}px;bottom:0;background-position: 0 0;\"></span>`;\n  timeBar.innerHTML = tics;\n  this._scrubElement = timeBar.lastChild;\n\n  // Clear track canvas.\n  this._context.clearRect(\n    0,\n    0,\n    this._trackListEle.width,\n    this._trackListEle.height\n  );\n\n  renderState.y = 0;\n  this._trackList.forEach(function (track) {\n    track.render(widget._context, renderState);\n    renderState.y += track.height;\n  });\n};\n\n/**\n * @private\n */\nTimeline.prototype.updateFromClock = function () {\n  this._scrubJulian = this._clock.currentTime;\n  const scrubElement = this._scrubElement;\n  if (defined(this._scrubElement)) {\n    const seconds = JulianDate.secondsDifference(\n      this._scrubJulian,\n      this._startJulian\n    );\n    const xPos = Math.round(\n      (seconds * this._topDiv.clientWidth) / this._timeBarSecondsSpan\n    );\n\n    if (this._lastXPos !== xPos) {\n      this._lastXPos = xPos;\n\n      scrubElement.style.left = `${xPos - 8}px`;\n      this._needleEle.style.left = `${xPos}px`;\n    }\n  }\n  if (defined(this._timelineDragLocation)) {\n    this._setTimeBarTime(\n      this._timelineDragLocation,\n      (this._timelineDragLocation * this._timeBarSecondsSpan) /\n        this._topDiv.clientWidth\n    );\n    this.zoomTo(\n      JulianDate.addSeconds(\n        this._startJulian,\n        this._timelineDrag,\n        new JulianDate()\n      ),\n      JulianDate.addSeconds(\n        this._endJulian,\n        this._timelineDrag,\n        new JulianDate()\n      )\n    );\n  }\n};\n\n/**\n * @private\n */\nTimeline.prototype._setTimeBarTime = function (xPos, seconds) {\n  xPos = Math.round(xPos);\n  this._scrubJulian = JulianDate.addSeconds(\n    this._startJulian,\n    seconds,\n    new JulianDate()\n  );\n  if (this._scrubElement) {\n    const scrubX = xPos - 8;\n    this._scrubElement.style.left = `${scrubX.toString()}px`;\n    this._needleEle.style.left = `${xPos.toString()}px`;\n  }\n\n  const evt = document.createEvent(\"Event\");\n  evt.initEvent(\"settime\", true, true);\n  evt.clientX = xPos;\n  evt.timeSeconds = seconds;\n  evt.timeJulian = this._scrubJulian;\n  evt.clock = this._clock;\n  this._topDiv.dispatchEvent(evt);\n};\n\nfunction createMouseDownCallback(timeline) {\n  return function (e) {\n    if (timeline._mouseMode !== timelineMouseMode.touchOnly) {\n      if (e.button === 0) {\n        timeline._mouseMode = timelineMouseMode.scrub;\n        if (timeline._scrubElement) {\n          timeline._scrubElement.style.backgroundPosition = \"-16px 0\";\n        }\n        timeline._onMouseMove(e);\n      } else {\n        timeline._mouseX = e.clientX;\n        if (e.button === 2) {\n          timeline._mouseMode = timelineMouseMode.zoom;\n        } else {\n          timeline._mouseMode = timelineMouseMode.slide;\n        }\n      }\n    }\n    e.preventDefault();\n  };\n}\n\nfunction createMouseUpCallback(timeline) {\n  return function (e) {\n    timeline._mouseMode = timelineMouseMode.none;\n    if (timeline._scrubElement) {\n      timeline._scrubElement.style.backgroundPosition = \"0 0\";\n    }\n    timeline._timelineDrag = 0;\n    timeline._timelineDragLocation = undefined;\n  };\n}\n\nfunction createMouseMoveCallback(timeline) {\n  return function (e) {\n    let dx;\n    if (timeline._mouseMode === timelineMouseMode.scrub) {\n      e.preventDefault();\n      const x = e.clientX - timeline._topDiv.getBoundingClientRect().left;\n\n      if (x < 0) {\n        timeline._timelineDragLocation = 0;\n        timeline._timelineDrag = -0.01 * timeline._timeBarSecondsSpan;\n      } else if (x > timeline._topDiv.clientWidth) {\n        timeline._timelineDragLocation = timeline._topDiv.clientWidth;\n        timeline._timelineDrag = 0.01 * timeline._timeBarSecondsSpan;\n      } else {\n        timeline._timelineDragLocation = undefined;\n        timeline._setTimeBarTime(\n          x,\n          (x * timeline._timeBarSecondsSpan) / timeline._topDiv.clientWidth\n        );\n      }\n    } else if (timeline._mouseMode === timelineMouseMode.slide) {\n      dx = timeline._mouseX - e.clientX;\n      timeline._mouseX = e.clientX;\n      if (dx !== 0) {\n        const dsec =\n          (dx * timeline._timeBarSecondsSpan) / timeline._topDiv.clientWidth;\n        timeline.zoomTo(\n          JulianDate.addSeconds(timeline._startJulian, dsec, new JulianDate()),\n          JulianDate.addSeconds(timeline._endJulian, dsec, new JulianDate())\n        );\n      }\n    } else if (timeline._mouseMode === timelineMouseMode.zoom) {\n      dx = timeline._mouseX - e.clientX;\n      timeline._mouseX = e.clientX;\n      if (dx !== 0) {\n        timeline.zoomFrom(Math.pow(1.01, dx));\n      }\n    }\n  };\n}\n\nfunction createMouseWheelCallback(timeline) {\n  return function (e) {\n    let dy = e.wheelDeltaY || e.wheelDelta || -e.detail;\n    timelineWheelDelta = Math.max(\n      Math.min(Math.abs(dy), timelineWheelDelta),\n      1\n    );\n    dy /= timelineWheelDelta;\n    timeline.zoomFrom(Math.pow(1.05, -dy));\n  };\n}\n\nfunction createTouchStartCallback(timeline) {\n  return function (e) {\n    const len = e.touches.length;\n    let seconds, xPos;\n    const leftX = timeline._topDiv.getBoundingClientRect().left;\n    e.preventDefault();\n    timeline._mouseMode = timelineMouseMode.touchOnly;\n    if (len === 1) {\n      seconds = JulianDate.secondsDifference(\n        timeline._scrubJulian,\n        timeline._startJulian\n      );\n      xPos = Math.round(\n        (seconds * timeline._topDiv.clientWidth) /\n          timeline._timeBarSecondsSpan +\n          leftX\n      );\n      if (Math.abs(e.touches[0].clientX - xPos) < 50) {\n        timeline._touchMode = timelineTouchMode.scrub;\n        if (timeline._scrubElement) {\n          timeline._scrubElement.style.backgroundPosition =\n            len === 1 ? \"-16px 0\" : \"0 0\";\n        }\n      } else {\n        timeline._touchMode = timelineTouchMode.singleTap;\n        timeline._touchState.centerX = e.touches[0].clientX - leftX;\n      }\n    } else if (len === 2) {\n      timeline._touchMode = timelineTouchMode.slideZoom;\n      timeline._touchState.centerX =\n        (e.touches[0].clientX + e.touches[1].clientX) * 0.5 - leftX;\n      timeline._touchState.spanX = Math.abs(\n        e.touches[0].clientX - e.touches[1].clientX\n      );\n    } else {\n      timeline._touchMode = timelineTouchMode.ignore;\n    }\n  };\n}\n\nfunction createTouchEndCallback(timeline) {\n  return function (e) {\n    const len = e.touches.length,\n      leftX = timeline._topDiv.getBoundingClientRect().left;\n    if (timeline._touchMode === timelineTouchMode.singleTap) {\n      timeline._touchMode = timelineTouchMode.scrub;\n      timeline._onTouchMove(e);\n    } else if (timeline._touchMode === timelineTouchMode.scrub) {\n      timeline._onTouchMove(e);\n    }\n    timeline._mouseMode = timelineMouseMode.touchOnly;\n    if (len !== 1) {\n      timeline._touchMode =\n        len > 0 ? timelineTouchMode.ignore : timelineTouchMode.none;\n    } else if (timeline._touchMode === timelineTouchMode.slideZoom) {\n      timeline._touchState.centerX = e.touches[0].clientX - leftX;\n    }\n    if (timeline._scrubElement) {\n      timeline._scrubElement.style.backgroundPosition = \"0 0\";\n    }\n  };\n}\n\nfunction createTouchMoveCallback(timeline) {\n  return function (e) {\n    let dx,\n      x,\n      len,\n      newCenter,\n      newSpan,\n      newStartTime,\n      zoom = 1;\n    const leftX = timeline._topDiv.getBoundingClientRect().left;\n    if (timeline._touchMode === timelineTouchMode.singleTap) {\n      timeline._touchMode = timelineTouchMode.slideZoom;\n    }\n    timeline._mouseMode = timelineMouseMode.touchOnly;\n    if (timeline._touchMode === timelineTouchMode.scrub) {\n      e.preventDefault();\n      if (e.changedTouches.length === 1) {\n        x = e.changedTouches[0].clientX - leftX;\n        if (x >= 0 && x <= timeline._topDiv.clientWidth) {\n          timeline._setTimeBarTime(\n            x,\n            (x * timeline._timeBarSecondsSpan) / timeline._topDiv.clientWidth\n          );\n        }\n      }\n    } else if (timeline._touchMode === timelineTouchMode.slideZoom) {\n      len = e.touches.length;\n      if (len === 2) {\n        newCenter = (e.touches[0].clientX + e.touches[1].clientX) * 0.5 - leftX;\n        newSpan = Math.abs(e.touches[0].clientX - e.touches[1].clientX);\n      } else if (len === 1) {\n        newCenter = e.touches[0].clientX - leftX;\n        newSpan = 0;\n      }\n\n      if (defined(newCenter)) {\n        if (newSpan > 0 && timeline._touchState.spanX > 0) {\n          // Zoom and slide\n          zoom = timeline._touchState.spanX / newSpan;\n          newStartTime = JulianDate.addSeconds(\n            timeline._startJulian,\n            (timeline._touchState.centerX * timeline._timeBarSecondsSpan -\n              newCenter * timeline._timeBarSecondsSpan * zoom) /\n              timeline._topDiv.clientWidth,\n            new JulianDate()\n          );\n        } else {\n          // Slide to newCenter\n          dx = timeline._touchState.centerX - newCenter;\n          newStartTime = JulianDate.addSeconds(\n            timeline._startJulian,\n            (dx * timeline._timeBarSecondsSpan) / timeline._topDiv.clientWidth,\n            new JulianDate()\n          );\n        }\n\n        timeline.zoomTo(\n          newStartTime,\n          JulianDate.addSeconds(\n            newStartTime,\n            timeline._timeBarSecondsSpan * zoom,\n            new JulianDate()\n          )\n        );\n        timeline._touchState.centerX = newCenter;\n        timeline._touchState.spanX = newSpan;\n      }\n    }\n  };\n}\n\n/**\n * Resizes the widget to match the container size.\n */\nTimeline.prototype.resize = function () {\n  const width = this.container.clientWidth;\n  const height = this.container.clientHeight;\n\n  if (width === this._lastWidth && height === this._lastHeight) {\n    return;\n  }\n\n  this._trackContainer.style.height = `${height}px`;\n\n  let trackListHeight = 1;\n  this._trackList.forEach(function (track) {\n    trackListHeight += track.height;\n  });\n  this._trackListEle.style.height = `${trackListHeight.toString()}px`;\n  this._trackListEle.width = this._trackListEle.clientWidth;\n  this._trackListEle.height = trackListHeight;\n  this._makeTics();\n\n  this._lastXPos = undefined;\n  this._lastWidth = width;\n  this._lastHeight = height;\n};\nexport default Timeline;\n", "import {\n  defaultValue,\n  defined,\n  destroyObject,\n  DeveloperError,\n  EventHelper,\n  Fullscreen,\n  getElement,\n  OrthographicFrustum,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport NoSleep from \"nosleep.js\";\nimport createCommand from \"../createCommand.js\";\n\nfunction lockScreen(orientation) {\n  let locked = false;\n  const screen = window.screen;\n  if (defined(screen)) {\n    if (defined(screen.lockOrientation)) {\n      locked = screen.lockOrientation(orientation);\n    } else if (defined(screen.mozLockOrientation)) {\n      locked = screen.mozLockOrientation(orientation);\n    } else if (defined(screen.msLockOrientation)) {\n      locked = screen.msLockOrientation(orientation);\n    } else if (defined(screen.orientation && screen.orientation.lock)) {\n      locked = screen.orientation.lock(orientation);\n    }\n  }\n  return locked;\n}\n\nfunction unlockScreen() {\n  const screen = window.screen;\n  if (defined(screen)) {\n    if (defined(screen.unlockOrientation)) {\n      screen.unlockOrientation();\n    } else if (defined(screen.mozUnlockOrientation)) {\n      screen.mozUnlockOrientation();\n    } else if (defined(screen.msUnlockOrientation)) {\n      screen.msUnlockOrientation();\n    } else if (defined(screen.orientation && screen.orientation.unlock)) {\n      screen.orientation.unlock();\n    }\n  }\n}\n\nfunction toggleVR(viewModel, scene, isVRMode, isOrthographic) {\n  if (isOrthographic()) {\n    return;\n  }\n\n  if (isVRMode()) {\n    scene.useWebVR = false;\n    if (viewModel._locked) {\n      unlockScreen();\n      viewModel._locked = false;\n    }\n    viewModel._noSleep.disable();\n    Fullscreen.exitFullscreen();\n    isVRMode(false);\n  } else {\n    if (!Fullscreen.fullscreen) {\n      Fullscreen.requestFullscreen(viewModel._vrElement);\n    }\n    viewModel._noSleep.enable();\n    if (!viewModel._locked) {\n      viewModel._locked = lockScreen(\"landscape\");\n    }\n    scene.useWebVR = true;\n    isVRMode(true);\n  }\n}\n\n/**\n * The view model for {@link VRButton}.\n * @alias VRButtonViewModel\n * @constructor\n *\n * @param {Scene} scene The scene.\n * @param {Element|string} [vrElement=document.body] The element or id to be placed into VR mode.\n */\nfunction VRButtonViewModel(scene, vrElement) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const that = this;\n\n  const isEnabled = knockout.observable(Fullscreen.enabled);\n  const isVRMode = knockout.observable(false);\n\n  /**\n   * Gets whether or not VR mode is active.\n   *\n   * @type {boolean}\n   */\n  this.isVRMode = undefined;\n  knockout.defineProperty(this, \"isVRMode\", {\n    get: function () {\n      return isVRMode();\n    },\n  });\n\n  /**\n   * Gets or sets whether or not VR functionality should be enabled.\n   *\n   * @type {boolean}\n   * @see Fullscreen.enabled\n   */\n  this.isVREnabled = undefined;\n  knockout.defineProperty(this, \"isVREnabled\", {\n    get: function () {\n      return isEnabled();\n    },\n    set: function (value) {\n      isEnabled(value && Fullscreen.enabled);\n    },\n  });\n\n  /**\n   * Gets the tooltip.  This property is observable.\n   *\n   * @type {string}\n   */\n  this.tooltip = undefined;\n  knockout.defineProperty(this, \"tooltip\", function () {\n    if (!isEnabled()) {\n      return \"VR mode is unavailable\";\n    }\n    return isVRMode() ? \"Exit VR mode\" : \"Enter VR mode\";\n  });\n\n  const isOrthographic = knockout.observable(false);\n\n  this._isOrthographic = undefined;\n  knockout.defineProperty(this, \"_isOrthographic\", {\n    get: function () {\n      return isOrthographic();\n    },\n  });\n\n  this._eventHelper = new EventHelper();\n  this._eventHelper.add(scene.preRender, function () {\n    isOrthographic(scene.camera.frustum instanceof OrthographicFrustum);\n  });\n\n  this._locked = false;\n  this._noSleep = new NoSleep();\n\n  this._command = createCommand(function () {\n    toggleVR(that, scene, isVRMode, isOrthographic);\n  }, knockout.getObservable(this, \"isVREnabled\"));\n\n  this._vrElement = defaultValue(getElement(vrElement), document.body);\n\n  this._callback = function () {\n    if (!Fullscreen.fullscreen && isVRMode()) {\n      scene.useWebVR = false;\n      if (that._locked) {\n        unlockScreen();\n        that._locked = false;\n      }\n      that._noSleep.disable();\n      isVRMode(false);\n    }\n  };\n  document.addEventListener(Fullscreen.changeEventName, this._callback);\n}\n\nObject.defineProperties(VRButtonViewModel.prototype, {\n  /**\n   * Gets or sets the HTML element to place into VR mode when the\n   * corresponding button is pressed.\n   * @memberof VRButtonViewModel.prototype\n   *\n   * @type {Element}\n   */\n  vrElement: {\n    //TODO:@exception {DeveloperError} value must be a valid HTML Element.\n    get: function () {\n      return this._vrElement;\n    },\n    set: function (value) {\n      //>>includeStart('debug', pragmas.debug);\n      if (!(value instanceof Element)) {\n        throw new DeveloperError(\"value must be a valid Element.\");\n      }\n      //>>includeEnd('debug');\n\n      this._vrElement = value;\n    },\n  },\n\n  /**\n   * Gets the Command to toggle VR mode.\n   * @memberof VRButtonViewModel.prototype\n   *\n   * @type {Command}\n   */\n  command: {\n    get: function () {\n      return this._command;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nVRButtonViewModel.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the view model.  Should be called to\n * properly clean up the view model when it is no longer needed.\n */\nVRButtonViewModel.prototype.destroy = function () {\n  this._eventHelper.removeAll();\n  document.removeEventListener(Fullscreen.changeEventName, this._callback);\n  destroyObject(this);\n};\nexport default VRButtonViewModel;\n", "import {\n  defined,\n  destroyObject,\n  DeveloperError,\n  getElement,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport VRButtonViewModel from \"./VRButtonViewModel.js\";\n\nconst enterVRPath =\n  \"M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z\";\nconst exitVRPath =\n  \"M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z\";\n\n/**\n * A single button widget for toggling vr mode.\n *\n * @alias VRButton\n * @constructor\n *\n * @param {Element|string} container The DOM element or ID that will contain the widget.\n * @param {Scene} scene The scene.\n * @param {Element|string} [vrElement=document.body] The element or id to be placed into vr mode.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n */\nfunction VRButton(container, scene, vrElement) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(container)) {\n    throw new DeveloperError(\"container is required.\");\n  }\n  if (!defined(scene)) {\n    throw new DeveloperError(\"scene is required.\");\n  }\n  //>>includeEnd('debug');\n\n  container = getElement(container);\n\n  const viewModel = new VRButtonViewModel(scene, vrElement);\n\n  viewModel._exitVRPath = exitVRPath;\n  viewModel._enterVRPath = enterVRPath;\n\n  const element = document.createElement(\"button\");\n  element.type = \"button\";\n  element.className = \"cesium-button cesium-vrButton\";\n  element.setAttribute(\n    \"data-bind\",\n    '\\\ncss: { \"cesium-button-disabled\" : _isOrthographic }, \\\nattr: { title: tooltip },\\\nclick: command,\\\nenable: isVREnabled,\\\ncesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'\n  );\n\n  container.appendChild(element);\n\n  knockout.applyBindings(viewModel, element);\n\n  this._container = container;\n  this._viewModel = viewModel;\n  this._element = element;\n}\n\nObject.defineProperties(VRButton.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof VRButton.prototype\n   *\n   * @type {Element}\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the view model.\n   * @memberof VRButton.prototype\n   *\n   * @type {VRButtonViewModel}\n   */\n  viewModel: {\n    get: function () {\n      return this._viewModel;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nVRButton.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nVRButton.prototype.destroy = function () {\n  this._viewModel.destroy();\n\n  knockout.cleanNode(this._element);\n  this._container.removeChild(this._element);\n\n  return destroyObject(this);\n};\nexport default VRButton;\n", "import {\n  BoundingSphere,\n  BoundingSphereState,\n  Cartesian3,\n  Cartographic,\n  CesiumWidget,\n  Cesium3DTileFeature,\n  Cesium3DTileset,\n  Clock,\n  computeFlyToLocationForRectangle,\n  ConstantPositionProperty,\n  DataSourceCollection,\n  DataSourceDisplay,\n  defaultValue,\n  defined,\n  destroyObject,\n  DeveloperError,\n  Entity,\n  EntityView,\n  Event,\n  EventHelper,\n  getElement,\n  HeadingPitchRange,\n  ImageryLayer,\n  JulianDate,\n  Math as CesiumMath,\n  Matrix4,\n  Property,\n  SceneMode,\n  ScreenSpaceEventType,\n  TimeDynamicPointCloud,\n  VoxelPrimitive,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport Animation from \"../Animation/Animation.js\";\nimport AnimationViewModel from \"../Animation/AnimationViewModel.js\";\nimport BaseLayerPicker from \"../BaseLayerPicker/BaseLayerPicker.js\";\nimport createDefaultImageryProviderViewModels from \"../BaseLayerPicker/createDefaultImageryProviderViewModels.js\";\nimport createDefaultTerrainProviderViewModels from \"../BaseLayerPicker/createDefaultTerrainProviderViewModels.js\";\nimport ClockViewModel from \"../ClockViewModel.js\";\nimport FullscreenButton from \"../FullscreenButton/FullscreenButton.js\";\nimport Geocoder from \"../Geocoder/Geocoder.js\";\nimport HomeButton from \"../HomeButton/HomeButton.js\";\nimport InfoBox from \"../InfoBox/InfoBox.js\";\nimport NavigationHelpButton from \"../NavigationHelpButton/NavigationHelpButton.js\";\nimport ProjectionPicker from \"../ProjectionPicker/ProjectionPicker.js\";\nimport SceneModePicker from \"../SceneModePicker/SceneModePicker.js\";\nimport SelectionIndicator from \"../SelectionIndicator/SelectionIndicator.js\";\nimport subscribeAndEvaluate from \"../subscribeAndEvaluate.js\";\nimport Timeline from \"../Timeline/Timeline.js\";\nimport VRButton from \"../VRButton/VRButton.js\";\n\nconst boundingSphereScratch = new BoundingSphere();\n\nfunction onTimelineScrubfunction(e) {\n  const clock = e.clock;\n  clock.currentTime = e.timeJulian;\n  clock.shouldAnimate = false;\n}\n\nfunction getCesium3DTileFeatureDescription(feature) {\n  const propertyIds = feature.getPropertyIds();\n\n  let html = \"\";\n  propertyIds.forEach(function (propertyId) {\n    const value = feature.getProperty(propertyId);\n    if (defined(value)) {\n      html += `<tr><th>${propertyId}</th><td>${value}</td></tr>`;\n    }\n  });\n\n  if (html.length > 0) {\n    html = `<table class=\"cesium-infoBox-defaultTable\"><tbody>${html}</tbody></table>`;\n  }\n\n  return html;\n}\n\nfunction getCesium3DTileFeatureName(feature) {\n  // We need to iterate all property IDs to find potential\n  // candidates, but since we prefer some property IDs\n  // over others, we store them in an indexed array\n  // and then use the first defined element in the array\n  // as the preferred choice.\n\n  let i;\n  const possibleIds = [];\n  const propertyIds = feature.getPropertyIds();\n  for (i = 0; i < propertyIds.length; i++) {\n    const propertyId = propertyIds[i];\n    if (/^name$/i.test(propertyId)) {\n      possibleIds[0] = feature.getProperty(propertyId);\n    } else if (/name/i.test(propertyId)) {\n      possibleIds[1] = feature.getProperty(propertyId);\n    } else if (/^title$/i.test(propertyId)) {\n      possibleIds[2] = feature.getProperty(propertyId);\n    } else if (/^(id|identifier)$/i.test(propertyId)) {\n      possibleIds[3] = feature.getProperty(propertyId);\n    } else if (/element/i.test(propertyId)) {\n      possibleIds[4] = feature.getProperty(propertyId);\n    } else if (/(id|identifier)$/i.test(propertyId)) {\n      possibleIds[5] = feature.getProperty(propertyId);\n    }\n  }\n\n  const length = possibleIds.length;\n  for (i = 0; i < length; i++) {\n    const item = possibleIds[i];\n    if (defined(item) && item !== \"\") {\n      return item;\n    }\n  }\n  return \"Unnamed Feature\";\n}\n\nfunction pickEntity(viewer, e) {\n  const picked = viewer.scene.pick(e.position);\n  if (defined(picked)) {\n    const id = defaultValue(picked.id, picked.primitive.id);\n    if (id instanceof Entity) {\n      return id;\n    }\n\n    if (picked instanceof Cesium3DTileFeature) {\n      return new Entity({\n        name: getCesium3DTileFeatureName(picked),\n        description: getCesium3DTileFeatureDescription(picked),\n        feature: picked,\n      });\n    }\n  }\n\n  // No regular entity picked.  Try picking features from imagery layers.\n  if (defined(viewer.scene.globe)) {\n    return pickImageryLayerFeature(viewer, e.position);\n  }\n}\n\nconst scratchStopTime = new JulianDate();\n\nfunction trackDataSourceClock(timeline, clock, dataSource) {\n  if (defined(dataSource)) {\n    const dataSourceClock = dataSource.clock;\n    if (defined(dataSourceClock)) {\n      dataSourceClock.getValue(clock);\n      if (defined(timeline)) {\n        const startTime = dataSourceClock.startTime;\n        let stopTime = dataSourceClock.stopTime;\n        // When the start and stop times are equal, set the timeline to the shortest interval\n        // starting at the start time. This prevents an invalid timeline configuration.\n        if (JulianDate.equals(startTime, stopTime)) {\n          stopTime = JulianDate.addSeconds(\n            startTime,\n            CesiumMath.EPSILON2,\n            scratchStopTime\n          );\n        }\n        timeline.updateFromClock();\n        timeline.zoomTo(startTime, stopTime);\n      }\n    }\n  }\n}\n\nconst cartesian3Scratch = new Cartesian3();\n\nfunction pickImageryLayerFeature(viewer, windowPosition) {\n  const scene = viewer.scene;\n  const pickRay = scene.camera.getPickRay(windowPosition);\n  const imageryLayerFeaturePromise = scene.imageryLayers.pickImageryLayerFeatures(\n    pickRay,\n    scene\n  );\n  if (!defined(imageryLayerFeaturePromise)) {\n    return;\n  }\n\n  // Imagery layer feature picking is asynchronous, so put up a message while loading.\n  const loadingMessage = new Entity({\n    id: \"Loading...\",\n    description: \"Loading feature information...\",\n  });\n\n  imageryLayerFeaturePromise.then(\n    function (features) {\n      // Has this async pick been superseded by a later one?\n      if (viewer.selectedEntity !== loadingMessage) {\n        return;\n      }\n\n      if (!defined(features) || features.length === 0) {\n        viewer.selectedEntity = createNoFeaturesEntity();\n        return;\n      }\n\n      // Select the first feature.\n      const feature = features[0];\n\n      const entity = new Entity({\n        id: feature.name,\n        description: feature.description,\n      });\n\n      if (defined(feature.position)) {\n        const ecfPosition = viewer.scene.globe.ellipsoid.cartographicToCartesian(\n          feature.position,\n          cartesian3Scratch\n        );\n        entity.position = new ConstantPositionProperty(ecfPosition);\n      }\n\n      viewer.selectedEntity = entity;\n    },\n    function () {\n      // Has this async pick been superseded by a later one?\n      if (viewer.selectedEntity !== loadingMessage) {\n        return;\n      }\n      viewer.selectedEntity = createNoFeaturesEntity();\n    }\n  );\n\n  return loadingMessage;\n}\n\nfunction createNoFeaturesEntity() {\n  return new Entity({\n    id: \"None\",\n    description: \"No features found.\",\n  });\n}\n\nfunction enableVRUI(viewer, enabled) {\n  const geocoder = viewer._geocoder;\n  const homeButton = viewer._homeButton;\n  const sceneModePicker = viewer._sceneModePicker;\n  const projectionPicker = viewer._projectionPicker;\n  const baseLayerPicker = viewer._baseLayerPicker;\n  const animation = viewer._animation;\n  const timeline = viewer._timeline;\n  const fullscreenButton = viewer._fullscreenButton;\n  const infoBox = viewer._infoBox;\n  const selectionIndicator = viewer._selectionIndicator;\n\n  const visibility = enabled ? \"hidden\" : \"visible\";\n\n  if (defined(geocoder)) {\n    geocoder.container.style.visibility = visibility;\n  }\n  if (defined(homeButton)) {\n    homeButton.container.style.visibility = visibility;\n  }\n  if (defined(sceneModePicker)) {\n    sceneModePicker.container.style.visibility = visibility;\n  }\n  if (defined(projectionPicker)) {\n    projectionPicker.container.style.visibility = visibility;\n  }\n  if (defined(baseLayerPicker)) {\n    baseLayerPicker.container.style.visibility = visibility;\n  }\n  if (defined(animation)) {\n    animation.container.style.visibility = visibility;\n  }\n  if (defined(timeline)) {\n    timeline.container.style.visibility = visibility;\n  }\n  if (\n    defined(fullscreenButton) &&\n    fullscreenButton.viewModel.isFullscreenEnabled\n  ) {\n    fullscreenButton.container.style.visibility = visibility;\n  }\n  if (defined(infoBox)) {\n    infoBox.container.style.visibility = visibility;\n  }\n  if (defined(selectionIndicator)) {\n    selectionIndicator.container.style.visibility = visibility;\n  }\n\n  if (viewer._container) {\n    const right =\n      enabled || !defined(fullscreenButton)\n        ? 0\n        : fullscreenButton.container.clientWidth;\n    viewer._vrButton.container.style.right = `${right}px`;\n\n    viewer.forceResize();\n  }\n}\n\n/**\n * @typedef {object} Viewer.ConstructorOptions\n *\n * Initialization options for the Viewer constructor\n *\n * @property {boolean} [animation=true] If set to false, the Animation widget will not be created.\n * @property {boolean} [baseLayerPicker=true] If set to false, the BaseLayerPicker widget will not be created.\n * @property {boolean} [fullscreenButton=true] If set to false, the FullscreenButton widget will not be created.\n * @property {boolean} [vrButton=false] If set to true, the VRButton widget will be created.\n * @property {boolean|GeocoderService[]} [geocoder=true] If set to false, the Geocoder widget will not be created.\n * @property {boolean} [homeButton=true] If set to false, the HomeButton widget will not be created.\n * @property {boolean} [infoBox=true] If set to false, the InfoBox widget will not be created.\n * @property {boolean} [sceneModePicker=true] If set to false, the SceneModePicker widget will not be created.\n * @property {boolean} [selectionIndicator=true] If set to false, the SelectionIndicator widget will not be created.\n * @property {boolean} [timeline=true] If set to false, the Timeline widget will not be created.\n * @property {boolean} [navigationHelpButton=true] If set to false, the navigation help button will not be created.\n * @property {boolean} [navigationInstructionsInitiallyVisible=true] True if the navigation instructions should initially be visible, or false if the should not be shown until the user explicitly clicks the button.\n * @property {boolean} [scene3DOnly=false] When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.\n * @property {boolean} [shouldAnimate=false] <code>true</code> if the clock should attempt to advance simulation time by default, <code>false</code> otherwise.  This option takes precedence over setting {@link Viewer#clockViewModel}.\n * @property {ClockViewModel} [clockViewModel=new ClockViewModel(clock)] The clock view model to use to control current time.\n * @property {ProviderViewModel} [selectedImageryProviderViewModel] The view model for the current base imagery layer, if not supplied the first available base layer is used.  This value is only valid if `baseLayerPicker` is set to true.\n * @property {ProviderViewModel[]} [imageryProviderViewModels=createDefaultImageryProviderViewModels()] The array of ProviderViewModels to be selectable from the BaseLayerPicker.  This value is only valid if `baseLayerPicker` is set to true.\n * @property {ProviderViewModel} [selectedTerrainProviderViewModel] The view model for the current base terrain layer, if not supplied the first available base layer is used.  This value is only valid if `baseLayerPicker` is set to true.\n * @property {ProviderViewModel[]} [terrainProviderViewModels=createDefaultTerrainProviderViewModels()] The array of ProviderViewModels to be selectable from the BaseLayerPicker.  This value is only valid if `baseLayerPicker` is set to true.\n * @property {ImageryLayer|false} [baseLayer=ImageryLayer.fromWorldImagery()] The bottommost imagery layer applied to the globe. If set to <code>false</code>, no imagery provider will be added. This value is only valid if `baseLayerPicker` is set to false.\n * @property {TerrainProvider} [terrainProvider=new EllipsoidTerrainProvider()] The terrain provider to use\n * @property {Terrain} [terrain] A terrain object which handles asynchronous terrain provider. Can only specify if options.terrainProvider is undefined.\n * @property {SkyBox|false} [skyBox] The skybox used to render the stars.  When <code>undefined</code>, the default stars are used. If set to <code>false</code>, no skyBox, Sun, or Moon will be added.\n * @property {SkyAtmosphere|false} [skyAtmosphere] Blue sky, and the glow around the Earth's limb.  Set to <code>false</code> to turn it off.\n * @property {Element|string} [fullscreenElement=document.body] The element or id to be placed into fullscreen mode when the full screen button is pressed.\n * @property {boolean} [useDefaultRenderLoop=true] True if this widget should control the render loop, false otherwise.\n * @property {number} [targetFrameRate] The target frame rate when using the default render loop.\n * @property {boolean} [showRenderLoopErrors=true] If true, this widget will automatically display an HTML panel to the user containing the error, if a render loop error occurs.\n * @property {boolean} [useBrowserRecommendedResolution=true] If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.\n * @property {boolean} [automaticallyTrackDataSourceClocks=true] If true, this widget will automatically track the clock settings of newly added DataSources, updating if the DataSource's clock changes.  Set this to false if you want to configure the clock independently.\n * @property {ContextOptions} [contextOptions] Context and WebGL creation properties passed to {@link Scene}.\n * @property {SceneMode} [sceneMode=SceneMode.SCENE3D] The initial scene mode.\n * @property {MapProjection} [mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes.\n * @property {Globe|false} [globe=new Globe(mapProjection.ellipsoid)] The globe to use in the scene.  If set to <code>false</code>, no globe will be added and the sky atmosphere will be hidden by default.\n * @property {boolean} [orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency.\n * @property {Element|string} [creditContainer] The DOM element or ID that will contain the {@link CreditDisplay}.  If not specified, the credits are added to the bottom of the widget itself.\n * @property {Element|string} [creditViewport] The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}.  If not specified, it will appear over the widget itself.\n * @property {DataSourceCollection} [dataSources=new DataSourceCollection()] The collection of data sources visualized by the widget.  If this parameter is provided,\n *                               the instance is assumed to be owned by the caller and will not be destroyed when the viewer is destroyed.\n * @property {boolean} [shadows=false] Determines if shadows are cast by light sources.\n * @property {ShadowMode} [terrainShadows=ShadowMode.RECEIVE_ONLY] Determines if the terrain casts or receives shadows from light sources.\n * @property {MapMode2D} [mapMode2D=MapMode2D.INFINITE_SCROLL] Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.\n * @property {boolean} [projectionPicker=false] If set to true, the ProjectionPicker widget will be created.\n * @property {boolean} [blurActiveElementOnCanvasFocus=true] If true, the active element will blur when the viewer's canvas is clicked. Setting this to false is useful for cases when the canvas is clicked only for retrieving position or an entity data without actually meaning to set the canvas to be the active element.\n * @property {boolean} [requestRenderMode=false] If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling reduces the CPU/GPU usage of your application and uses less battery on mobile, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.\n * @property {number} [maximumRenderTimeChange=0.0] If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.\n * @property {number} [depthPlaneEllipsoidOffset=0.0] Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation.\n * @property {number} [msaaSamples=1] If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.\n */\n\n/**\n * A base widget for building applications.  It composites all of the standard Cesium widgets into one reusable package.\n * The widget can always be extended by using mixins, which add functionality useful for a variety of applications.\n *\n * @alias Viewer\n * @constructor\n *\n * @param {Element|string} container The DOM element or ID that will contain the widget.\n * @param {Viewer.ConstructorOptions} [options] Object describing initialization options\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n * @exception {DeveloperError} options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget, specify options.baseLayer instead.\n * @exception {DeveloperError} options.selectedTerrainProviderViewModel is not available when not using the BaseLayerPicker widget, specify options.terrainProvider instead.\n *\n * @see Animation\n * @see BaseLayerPicker\n * @see CesiumWidget\n * @see FullscreenButton\n * @see HomeButton\n * @see SceneModePicker\n * @see Timeline\n * @see viewerDragDropMixin\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Hello%20World.html|Cesium Sandcastle Hello World Demo}\n *\n * @example\n * // Initialize the viewer widget with several custom options and mixins.\n * try {\n *   const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n *     // Start in Columbus Viewer\n *     sceneMode: Cesium.SceneMode.COLUMBUS_VIEW,\n *     // Use Cesium World Terrain\n *     terrain: Cesium.Terrain.fromWorldTerrain(),\n *     // Hide the base layer picker\n *     baseLayerPicker: false,\n *     // Use OpenStreetMaps\n *     baseLayer: new Cesium.ImageryLayer(new Cesium.OpenStreetMapImageryProvider({\n *       url: \"https://tile.openstreetmap.org/\"\n *     })),\n *     skyBox: new Cesium.SkyBox({\n *       sources: {\n *         positiveX: \"stars/TychoSkymapII.t3_08192x04096_80_px.jpg\",\n *         negativeX: \"stars/TychoSkymapII.t3_08192x04096_80_mx.jpg\",\n *         positiveY: \"stars/TychoSkymapII.t3_08192x04096_80_py.jpg\",\n *         negativeY: \"stars/TychoSkymapII.t3_08192x04096_80_my.jpg\",\n *         positiveZ: \"stars/TychoSkymapII.t3_08192x04096_80_pz.jpg\",\n *         negativeZ: \"stars/TychoSkymapII.t3_08192x04096_80_mz.jpg\"\n *       }\n *     }),\n *     // Show Columbus View map with Web Mercator projection\n *     mapProjection: new Cesium.WebMercatorProjection()\n *   });\n * } catch (error) {\n *   console.log(error);\n * }\n *\n * // Add basic drag and drop functionality\n * viewer.extend(Cesium.viewerDragDropMixin);\n *\n * // Show a pop-up alert if we encounter an error when processing a dropped file\n * viewer.dropError.addEventListener(function(dropHandler, name, error) {\n *   console.log(error);\n *   window.alert(error);\n * });\n */\nfunction Viewer(container, options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(container)) {\n    throw new DeveloperError(\"container is required.\");\n  }\n  //>>includeEnd('debug');\n\n  container = getElement(container);\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const createBaseLayerPicker =\n    (!defined(options.globe) || options.globe !== false) &&\n    (!defined(options.baseLayerPicker) || options.baseLayerPicker !== false);\n\n  //>>includeStart('debug', pragmas.debug);\n  // If not using BaseLayerPicker, selectedImageryProviderViewModel is an invalid option\n  if (\n    !createBaseLayerPicker &&\n    defined(options.selectedImageryProviderViewModel)\n  ) {\n    throw new DeveloperError(\n      \"options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget. \\\nEither specify options.baseLayer instead or set options.baseLayerPicker to true.\"\n    );\n  }\n\n  // If not using BaseLayerPicker, selectedTerrainProviderViewModel is an invalid option\n  if (\n    !createBaseLayerPicker &&\n    defined(options.selectedTerrainProviderViewModel)\n  ) {\n    throw new DeveloperError(\n      \"options.selectedTerrainProviderViewModel is not available when not using the BaseLayerPicker widget. \\\nEither specify options.terrainProvider instead or set options.baseLayerPicker to true.\"\n    );\n  }\n  //>>includeEnd('debug')\n\n  const that = this;\n\n  const viewerContainer = document.createElement(\"div\");\n  viewerContainer.className = \"cesium-viewer\";\n  container.appendChild(viewerContainer);\n\n  // Cesium widget container\n  const cesiumWidgetContainer = document.createElement(\"div\");\n  cesiumWidgetContainer.className = \"cesium-viewer-cesiumWidgetContainer\";\n  viewerContainer.appendChild(cesiumWidgetContainer);\n\n  // Bottom container\n  const bottomContainer = document.createElement(\"div\");\n  bottomContainer.className = \"cesium-viewer-bottom\";\n\n  viewerContainer.appendChild(bottomContainer);\n\n  const scene3DOnly = defaultValue(options.scene3DOnly, false);\n\n  let clock;\n  let clockViewModel;\n  let destroyClockViewModel = false;\n  if (defined(options.clockViewModel)) {\n    clockViewModel = options.clockViewModel;\n    clock = clockViewModel.clock;\n  } else {\n    clock = new Clock();\n    clockViewModel = new ClockViewModel(clock);\n    destroyClockViewModel = true;\n  }\n\n  if (defined(options.shouldAnimate)) {\n    clock.shouldAnimate = options.shouldAnimate;\n  }\n\n  // Cesium widget\n  const cesiumWidget = new CesiumWidget(cesiumWidgetContainer, {\n    baseLayer:\n      createBaseLayerPicker ||\n      defined(options.baseLayer) ||\n      defined(options.imageryProvider)\n        ? false\n        : undefined,\n    clock: clock,\n    skyBox: options.skyBox,\n    skyAtmosphere: options.skyAtmosphere,\n    sceneMode: options.sceneMode,\n    mapProjection: options.mapProjection,\n    globe: options.globe,\n    orderIndependentTranslucency: options.orderIndependentTranslucency,\n    contextOptions: options.contextOptions,\n    useDefaultRenderLoop: options.useDefaultRenderLoop,\n    targetFrameRate: options.targetFrameRate,\n    showRenderLoopErrors: options.showRenderLoopErrors,\n    useBrowserRecommendedResolution: options.useBrowserRecommendedResolution,\n    creditContainer: defined(options.creditContainer)\n      ? options.creditContainer\n      : bottomContainer,\n    creditViewport: options.creditViewport,\n    scene3DOnly: scene3DOnly,\n    shadows: options.shadows,\n    terrainShadows: options.terrainShadows,\n    mapMode2D: options.mapMode2D,\n    blurActiveElementOnCanvasFocus: options.blurActiveElementOnCanvasFocus,\n    requestRenderMode: options.requestRenderMode,\n    maximumRenderTimeChange: options.maximumRenderTimeChange,\n    depthPlaneEllipsoidOffset: options.depthPlaneEllipsoidOffset,\n    msaaSamples: options.msaaSamples,\n  });\n\n  let dataSourceCollection = options.dataSources;\n  let destroyDataSourceCollection = false;\n  if (!defined(dataSourceCollection)) {\n    dataSourceCollection = new DataSourceCollection();\n    destroyDataSourceCollection = true;\n  }\n\n  const scene = cesiumWidget.scene;\n\n  const dataSourceDisplay = new DataSourceDisplay({\n    scene: scene,\n    dataSourceCollection: dataSourceCollection,\n  });\n\n  const eventHelper = new EventHelper();\n\n  eventHelper.add(clock.onTick, Viewer.prototype._onTick, this);\n  eventHelper.add(scene.morphStart, Viewer.prototype._clearTrackedObject, this);\n\n  // Selection Indicator\n  let selectionIndicator;\n  if (\n    !defined(options.selectionIndicator) ||\n    options.selectionIndicator !== false\n  ) {\n    const selectionIndicatorContainer = document.createElement(\"div\");\n    selectionIndicatorContainer.className =\n      \"cesium-viewer-selectionIndicatorContainer\";\n    viewerContainer.appendChild(selectionIndicatorContainer);\n    selectionIndicator = new SelectionIndicator(\n      selectionIndicatorContainer,\n      scene\n    );\n  }\n\n  // Info Box\n  let infoBox;\n  if (!defined(options.infoBox) || options.infoBox !== false) {\n    const infoBoxContainer = document.createElement(\"div\");\n    infoBoxContainer.className = \"cesium-viewer-infoBoxContainer\";\n    viewerContainer.appendChild(infoBoxContainer);\n    infoBox = new InfoBox(infoBoxContainer);\n\n    const infoBoxViewModel = infoBox.viewModel;\n    eventHelper.add(\n      infoBoxViewModel.cameraClicked,\n      Viewer.prototype._onInfoBoxCameraClicked,\n      this\n    );\n    eventHelper.add(\n      infoBoxViewModel.closeClicked,\n      Viewer.prototype._onInfoBoxClockClicked,\n      this\n    );\n  }\n\n  // Main Toolbar\n  const toolbar = document.createElement(\"div\");\n  toolbar.className = \"cesium-viewer-toolbar\";\n  viewerContainer.appendChild(toolbar);\n\n  // Geocoder\n  let geocoder;\n  if (!defined(options.geocoder) || options.geocoder !== false) {\n    const geocoderContainer = document.createElement(\"div\");\n    geocoderContainer.className = \"cesium-viewer-geocoderContainer\";\n    toolbar.appendChild(geocoderContainer);\n    let geocoderService;\n    if (defined(options.geocoder) && typeof options.geocoder !== \"boolean\") {\n      geocoderService = Array.isArray(options.geocoder)\n        ? options.geocoder\n        : [options.geocoder];\n    }\n    geocoder = new Geocoder({\n      container: geocoderContainer,\n      geocoderServices: geocoderService,\n      scene: scene,\n    });\n    // Subscribe to search so that we can clear the trackedEntity when it is clicked.\n    eventHelper.add(\n      geocoder.viewModel.search.beforeExecute,\n      Viewer.prototype._clearObjects,\n      this\n    );\n  }\n\n  // HomeButton\n  let homeButton;\n  if (!defined(options.homeButton) || options.homeButton !== false) {\n    homeButton = new HomeButton(toolbar, scene);\n    if (defined(geocoder)) {\n      eventHelper.add(homeButton.viewModel.command.afterExecute, function () {\n        const viewModel = geocoder.viewModel;\n        viewModel.searchText = \"\";\n        if (viewModel.isSearchInProgress) {\n          viewModel.search();\n        }\n      });\n    }\n    // Subscribe to the home button beforeExecute event so that we can clear the trackedEntity.\n    eventHelper.add(\n      homeButton.viewModel.command.beforeExecute,\n      Viewer.prototype._clearTrackedObject,\n      this\n    );\n  }\n\n  // SceneModePicker\n  // By default, we silently disable the scene mode picker if scene3DOnly is true,\n  // but if sceneModePicker is explicitly set to true, throw an error.\n  //>>includeStart('debug', pragmas.debug);\n  if (options.sceneModePicker === true && scene3DOnly) {\n    throw new DeveloperError(\n      \"options.sceneModePicker is not available when options.scene3DOnly is set to true.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  let sceneModePicker;\n  if (\n    !scene3DOnly &&\n    (!defined(options.sceneModePicker) || options.sceneModePicker !== false)\n  ) {\n    sceneModePicker = new SceneModePicker(toolbar, scene);\n  }\n\n  let projectionPicker;\n  if (options.projectionPicker) {\n    projectionPicker = new ProjectionPicker(toolbar, scene);\n  }\n\n  // BaseLayerPicker\n  let baseLayerPicker;\n  let baseLayerPickerDropDown;\n  if (createBaseLayerPicker) {\n    const imageryProviderViewModels = defaultValue(\n      options.imageryProviderViewModels,\n      createDefaultImageryProviderViewModels()\n    );\n    const terrainProviderViewModels = defaultValue(\n      options.terrainProviderViewModels,\n      createDefaultTerrainProviderViewModels()\n    );\n\n    baseLayerPicker = new BaseLayerPicker(toolbar, {\n      globe: scene.globe,\n      imageryProviderViewModels: imageryProviderViewModels,\n      selectedImageryProviderViewModel:\n        options.selectedImageryProviderViewModel,\n      terrainProviderViewModels: terrainProviderViewModels,\n      selectedTerrainProviderViewModel:\n        options.selectedTerrainProviderViewModel,\n    });\n\n    //Grab the dropdown for resize code.\n    const elements = toolbar.getElementsByClassName(\n      \"cesium-baseLayerPicker-dropDown\"\n    );\n    baseLayerPickerDropDown = elements[0];\n  }\n\n  // These need to be set after the BaseLayerPicker is created in order to take effect\n  if (defined(options.baseLayer) && options.baseLayer !== false) {\n    if (createBaseLayerPicker) {\n      baseLayerPicker.viewModel.selectedImagery = undefined;\n    }\n    scene.imageryLayers.removeAll();\n    scene.imageryLayers.add(options.baseLayer);\n  }\n\n  if (defined(options.terrainProvider)) {\n    if (createBaseLayerPicker) {\n      baseLayerPicker.viewModel.selectedTerrain = undefined;\n    }\n    scene.terrainProvider = options.terrainProvider;\n  }\n\n  if (defined(options.terrain)) {\n    //>>includeStart('debug', pragmas.debug);\n    if (defined(options.terrainProvider)) {\n      throw new DeveloperError(\n        \"Specify either options.terrainProvider or options.terrain.\"\n      );\n    }\n    //>>includeEnd('debug')\n\n    if (createBaseLayerPicker) {\n      baseLayerPicker.viewModel.selectedTerrain = undefined;\n      // Required as this is otherwise set by the baseLayerPicker\n      scene.globe.depthTestAgainstTerrain = true;\n    }\n\n    scene.setTerrain(options.terrain);\n  }\n\n  // Navigation Help Button\n  let navigationHelpButton;\n  if (\n    !defined(options.navigationHelpButton) ||\n    options.navigationHelpButton !== false\n  ) {\n    let showNavHelp = true;\n    try {\n      //window.localStorage is null if disabled in Firefox or undefined in browsers with implementation\n      if (defined(window.localStorage)) {\n        const hasSeenNavHelp = window.localStorage.getItem(\n          \"cesium-hasSeenNavHelp\"\n        );\n        if (defined(hasSeenNavHelp) && Boolean(hasSeenNavHelp)) {\n          showNavHelp = false;\n        } else {\n          window.localStorage.setItem(\"cesium-hasSeenNavHelp\", \"true\");\n        }\n      }\n    } catch (e) {\n      //Accessing window.localStorage throws if disabled in Chrome\n      //window.localStorage.setItem throws if in Safari private browsing mode or in any browser if we are over quota.\n    }\n    navigationHelpButton = new NavigationHelpButton({\n      container: toolbar,\n      instructionsInitiallyVisible: defaultValue(\n        options.navigationInstructionsInitiallyVisible,\n        showNavHelp\n      ),\n    });\n  }\n\n  // Animation\n  let animation;\n  if (!defined(options.animation) || options.animation !== false) {\n    const animationContainer = document.createElement(\"div\");\n    animationContainer.className = \"cesium-viewer-animationContainer\";\n    viewerContainer.appendChild(animationContainer);\n    animation = new Animation(\n      animationContainer,\n      new AnimationViewModel(clockViewModel)\n    );\n  }\n\n  // Timeline\n  let timeline;\n  if (!defined(options.timeline) || options.timeline !== false) {\n    const timelineContainer = document.createElement(\"div\");\n    timelineContainer.className = \"cesium-viewer-timelineContainer\";\n    viewerContainer.appendChild(timelineContainer);\n    timeline = new Timeline(timelineContainer, clock);\n    timeline.addEventListener(\"settime\", onTimelineScrubfunction, false);\n    timeline.zoomTo(clock.startTime, clock.stopTime);\n  }\n\n  // Fullscreen\n  let fullscreenButton;\n  let fullscreenSubscription;\n  let fullscreenContainer;\n  if (\n    !defined(options.fullscreenButton) ||\n    options.fullscreenButton !== false\n  ) {\n    fullscreenContainer = document.createElement(\"div\");\n    fullscreenContainer.className = \"cesium-viewer-fullscreenContainer\";\n    viewerContainer.appendChild(fullscreenContainer);\n    fullscreenButton = new FullscreenButton(\n      fullscreenContainer,\n      options.fullscreenElement\n    );\n\n    //Subscribe to fullscreenButton.viewModel.isFullscreenEnabled so\n    //that we can hide/show the button as well as size the timeline.\n    fullscreenSubscription = subscribeAndEvaluate(\n      fullscreenButton.viewModel,\n      \"isFullscreenEnabled\",\n      function (isFullscreenEnabled) {\n        fullscreenContainer.style.display = isFullscreenEnabled\n          ? \"block\"\n          : \"none\";\n        if (defined(timeline)) {\n          timeline.container.style.right = `${fullscreenContainer.clientWidth}px`;\n          timeline.resize();\n        }\n      }\n    );\n  }\n\n  // VR\n  let vrButton;\n  let vrSubscription;\n  let vrModeSubscription;\n  if (options.vrButton) {\n    const vrContainer = document.createElement(\"div\");\n    vrContainer.className = \"cesium-viewer-vrContainer\";\n    viewerContainer.appendChild(vrContainer);\n    vrButton = new VRButton(vrContainer, scene, options.fullScreenElement);\n\n    vrSubscription = subscribeAndEvaluate(\n      vrButton.viewModel,\n      \"isVREnabled\",\n      function (isVREnabled) {\n        vrContainer.style.display = isVREnabled ? \"block\" : \"none\";\n        if (defined(fullscreenButton)) {\n          vrContainer.style.right = `${fullscreenContainer.clientWidth}px`;\n        }\n        if (defined(timeline)) {\n          timeline.container.style.right = `${vrContainer.clientWidth}px`;\n          timeline.resize();\n        }\n      }\n    );\n\n    vrModeSubscription = subscribeAndEvaluate(\n      vrButton.viewModel,\n      \"isVRMode\",\n      function (isVRMode) {\n        enableVRUI(that, isVRMode);\n      }\n    );\n  }\n\n  //Assign all properties to this instance.  No \"this\" assignments should\n  //take place above this line.\n  this._baseLayerPickerDropDown = baseLayerPickerDropDown;\n  this._fullscreenSubscription = fullscreenSubscription;\n  this._vrSubscription = vrSubscription;\n  this._vrModeSubscription = vrModeSubscription;\n  this._dataSourceChangedListeners = {};\n  this._automaticallyTrackDataSourceClocks = defaultValue(\n    options.automaticallyTrackDataSourceClocks,\n    true\n  );\n  this._container = container;\n  this._bottomContainer = bottomContainer;\n  this._element = viewerContainer;\n  this._cesiumWidget = cesiumWidget;\n  this._selectionIndicator = selectionIndicator;\n  this._infoBox = infoBox;\n  this._dataSourceCollection = dataSourceCollection;\n  this._destroyDataSourceCollection = destroyDataSourceCollection;\n  this._dataSourceDisplay = dataSourceDisplay;\n  this._clockViewModel = clockViewModel;\n  this._destroyClockViewModel = destroyClockViewModel;\n  this._toolbar = toolbar;\n  this._homeButton = homeButton;\n  this._sceneModePicker = sceneModePicker;\n  this._projectionPicker = projectionPicker;\n  this._baseLayerPicker = baseLayerPicker;\n  this._navigationHelpButton = navigationHelpButton;\n  this._animation = animation;\n  this._timeline = timeline;\n  this._fullscreenButton = fullscreenButton;\n  this._vrButton = vrButton;\n  this._geocoder = geocoder;\n  this._eventHelper = eventHelper;\n  this._lastWidth = 0;\n  this._lastHeight = 0;\n  this._allowDataSourcesToSuspendAnimation = true;\n  this._entityView = undefined;\n  this._enableInfoOrSelection = defined(infoBox) || defined(selectionIndicator);\n  this._clockTrackedDataSource = undefined;\n  this._trackedEntity = undefined;\n  this._needTrackedEntityUpdate = false;\n  this._selectedEntity = undefined;\n  this._zoomIsFlight = false;\n  this._zoomTarget = undefined;\n  this._zoomPromise = undefined;\n  this._zoomOptions = undefined;\n  this._selectedEntityChanged = new Event();\n  this._trackedEntityChanged = new Event();\n\n  knockout.track(this, [\n    \"_trackedEntity\",\n    \"_selectedEntity\",\n    \"_clockTrackedDataSource\",\n  ]);\n\n  //Listen to data source events in order to track clock changes.\n  eventHelper.add(\n    dataSourceCollection.dataSourceAdded,\n    Viewer.prototype._onDataSourceAdded,\n    this\n  );\n  eventHelper.add(\n    dataSourceCollection.dataSourceRemoved,\n    Viewer.prototype._onDataSourceRemoved,\n    this\n  );\n\n  // Prior to each render, check if anything needs to be resized.\n  eventHelper.add(scene.postUpdate, Viewer.prototype.resize, this);\n  eventHelper.add(scene.postRender, Viewer.prototype._postRender, this);\n\n  // We need to subscribe to the data sources and collections so that we can clear the\n  // tracked object when it is removed from the scene.\n  // Subscribe to current data sources\n  const dataSourceLength = dataSourceCollection.length;\n  for (let i = 0; i < dataSourceLength; i++) {\n    this._dataSourceAdded(dataSourceCollection, dataSourceCollection.get(i));\n  }\n  this._dataSourceAdded(undefined, dataSourceDisplay.defaultDataSource);\n\n  // Hook up events so that we can subscribe to future sources.\n  eventHelper.add(\n    dataSourceCollection.dataSourceAdded,\n    Viewer.prototype._dataSourceAdded,\n    this\n  );\n  eventHelper.add(\n    dataSourceCollection.dataSourceRemoved,\n    Viewer.prototype._dataSourceRemoved,\n    this\n  );\n\n  // Subscribe to left clicks and zoom to the picked object.\n  function pickAndTrackObject(e) {\n    const entity = pickEntity(that, e);\n    if (defined(entity)) {\n      //Only track the entity if it has a valid position at the current time.\n      if (\n        Property.getValueOrUndefined(entity.position, that.clock.currentTime)\n      ) {\n        that.trackedEntity = entity;\n      } else {\n        that.zoomTo(entity);\n      }\n    } else if (defined(that.trackedEntity)) {\n      that.trackedEntity = undefined;\n    }\n  }\n\n  function pickAndSelectObject(e) {\n    that.selectedEntity = pickEntity(that, e);\n  }\n\n  cesiumWidget.screenSpaceEventHandler.setInputAction(\n    pickAndSelectObject,\n    ScreenSpaceEventType.LEFT_CLICK\n  );\n  cesiumWidget.screenSpaceEventHandler.setInputAction(\n    pickAndTrackObject,\n    ScreenSpaceEventType.LEFT_DOUBLE_CLICK\n  );\n}\n\nObject.defineProperties(Viewer.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof Viewer.prototype\n   * @type {Element}\n   * @readonly\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Manages the list of credits to display on screen and in the lightbox.\n   * @memberof Viewer.prototype\n   *\n   * @type {CreditDisplay}\n   */\n  creditDisplay: {\n    get: function () {\n      return this._cesiumWidget.creditDisplay;\n    },\n  },\n\n  /**\n   * Gets the DOM element for the area at the bottom of the window containing the\n   * {@link CreditDisplay} and potentially other things.\n   * @memberof Viewer.prototype\n   * @type {Element}\n   * @readonly\n   */\n  bottomContainer: {\n    get: function () {\n      return this._bottomContainer;\n    },\n  },\n\n  /**\n   * Gets the CesiumWidget.\n   * @memberof Viewer.prototype\n   * @type {CesiumWidget}\n   * @readonly\n   */\n  cesiumWidget: {\n    get: function () {\n      return this._cesiumWidget;\n    },\n  },\n\n  /**\n   * Gets the selection indicator.\n   * @memberof Viewer.prototype\n   * @type {SelectionIndicator}\n   * @readonly\n   */\n  selectionIndicator: {\n    get: function () {\n      return this._selectionIndicator;\n    },\n  },\n\n  /**\n   * Gets the info box.\n   * @memberof Viewer.prototype\n   * @type {InfoBox}\n   * @readonly\n   */\n  infoBox: {\n    get: function () {\n      return this._infoBox;\n    },\n  },\n\n  /**\n   * Gets the Geocoder.\n   * @memberof Viewer.prototype\n   * @type {Geocoder}\n   * @readonly\n   */\n  geocoder: {\n    get: function () {\n      return this._geocoder;\n    },\n  },\n\n  /**\n   * Gets the HomeButton.\n   * @memberof Viewer.prototype\n   * @type {HomeButton}\n   * @readonly\n   */\n  homeButton: {\n    get: function () {\n      return this._homeButton;\n    },\n  },\n\n  /**\n   * Gets the SceneModePicker.\n   * @memberof Viewer.prototype\n   * @type {SceneModePicker}\n   * @readonly\n   */\n  sceneModePicker: {\n    get: function () {\n      return this._sceneModePicker;\n    },\n  },\n\n  /**\n   * Gets the ProjectionPicker.\n   * @memberof Viewer.prototype\n   * @type {ProjectionPicker}\n   * @readonly\n   */\n  projectionPicker: {\n    get: function () {\n      return this._projectionPicker;\n    },\n  },\n\n  /**\n   * Gets the BaseLayerPicker.\n   * @memberof Viewer.prototype\n   * @type {BaseLayerPicker}\n   * @readonly\n   */\n  baseLayerPicker: {\n    get: function () {\n      return this._baseLayerPicker;\n    },\n  },\n\n  /**\n   * Gets the NavigationHelpButton.\n   * @memberof Viewer.prototype\n   * @type {NavigationHelpButton}\n   * @readonly\n   */\n  navigationHelpButton: {\n    get: function () {\n      return this._navigationHelpButton;\n    },\n  },\n\n  /**\n   * Gets the Animation widget.\n   * @memberof Viewer.prototype\n   * @type {Animation}\n   * @readonly\n   */\n  animation: {\n    get: function () {\n      return this._animation;\n    },\n  },\n\n  /**\n   * Gets the Timeline widget.\n   * @memberof Viewer.prototype\n   * @type {Timeline}\n   * @readonly\n   */\n  timeline: {\n    get: function () {\n      return this._timeline;\n    },\n  },\n\n  /**\n   * Gets the FullscreenButton.\n   * @memberof Viewer.prototype\n   * @type {FullscreenButton}\n   * @readonly\n   */\n  fullscreenButton: {\n    get: function () {\n      return this._fullscreenButton;\n    },\n  },\n\n  /**\n   * Gets the VRButton.\n   * @memberof Viewer.prototype\n   * @type {VRButton}\n   * @readonly\n   */\n  vrButton: {\n    get: function () {\n      return this._vrButton;\n    },\n  },\n\n  /**\n   * Gets the display used for {@link DataSource} visualization.\n   * @memberof Viewer.prototype\n   * @type {DataSourceDisplay}\n   * @readonly\n   */\n  dataSourceDisplay: {\n    get: function () {\n      return this._dataSourceDisplay;\n    },\n  },\n\n  /**\n   * Gets the collection of entities not tied to a particular data source.\n   * This is a shortcut to [dataSourceDisplay.defaultDataSource.entities]{@link Viewer#dataSourceDisplay}.\n   * @memberof Viewer.prototype\n   * @type {EntityCollection}\n   * @readonly\n   */\n  entities: {\n    get: function () {\n      return this._dataSourceDisplay.defaultDataSource.entities;\n    },\n  },\n\n  /**\n   * Gets the set of {@link DataSource} instances to be visualized.\n   * @memberof Viewer.prototype\n   * @type {DataSourceCollection}\n   * @readonly\n   */\n  dataSources: {\n    get: function () {\n      return this._dataSourceCollection;\n    },\n  },\n\n  /**\n   * Gets the canvas.\n   * @memberof Viewer.prototype\n   * @type {HTMLCanvasElement}\n   * @readonly\n   */\n  canvas: {\n    get: function () {\n      return this._cesiumWidget.canvas;\n    },\n  },\n\n  /**\n   * Gets the scene.\n   * @memberof Viewer.prototype\n   * @type {Scene}\n   * @readonly\n   */\n  scene: {\n    get: function () {\n      return this._cesiumWidget.scene;\n    },\n  },\n\n  /**\n   * Determines if shadows are cast by light sources.\n   * @memberof Viewer.prototype\n   * @type {boolean}\n   */\n  shadows: {\n    get: function () {\n      return this.scene.shadowMap.enabled;\n    },\n    set: function (value) {\n      this.scene.shadowMap.enabled = value;\n    },\n  },\n\n  /**\n   * Determines if the terrain casts or shadows from light sources.\n   * @memberof Viewer.prototype\n   * @type {ShadowMode}\n   */\n  terrainShadows: {\n    get: function () {\n      return this.scene.globe.shadows;\n    },\n    set: function (value) {\n      this.scene.globe.shadows = value;\n    },\n  },\n\n  /**\n   * Get the scene's shadow map\n   * @memberof Viewer.prototype\n   * @type {ShadowMap}\n   * @readonly\n   */\n  shadowMap: {\n    get: function () {\n      return this.scene.shadowMap;\n    },\n  },\n\n  /**\n   * Gets the collection of image layers that will be rendered on the globe.\n   * @memberof Viewer.prototype\n   *\n   * @type {ImageryLayerCollection}\n   * @readonly\n   */\n  imageryLayers: {\n    get: function () {\n      return this.scene.imageryLayers;\n    },\n  },\n\n  /**\n   * The terrain provider providing surface geometry for the globe.\n   * @memberof Viewer.prototype\n   *\n   * @type {TerrainProvider}\n   */\n  terrainProvider: {\n    get: function () {\n      return this.scene.terrainProvider;\n    },\n    set: function (terrainProvider) {\n      this.scene.terrainProvider = terrainProvider;\n    },\n  },\n\n  /**\n   * Gets the camera.\n   * @memberof Viewer.prototype\n   *\n   * @type {Camera}\n   * @readonly\n   */\n  camera: {\n    get: function () {\n      return this.scene.camera;\n    },\n  },\n\n  /**\n   * Gets the post-process stages.\n   * @memberof Viewer.prototype\n   *\n   * @type {PostProcessStageCollection}\n   * @readonly\n   */\n  postProcessStages: {\n    get: function () {\n      return this.scene.postProcessStages;\n    },\n  },\n\n  /**\n   * Gets the clock.\n   * @memberof Viewer.prototype\n   * @type {Clock}\n   * @readonly\n   */\n  clock: {\n    get: function () {\n      return this._clockViewModel.clock;\n    },\n  },\n\n  /**\n   * Gets the clock view model.\n   * @memberof Viewer.prototype\n   * @type {ClockViewModel}\n   * @readonly\n   */\n  clockViewModel: {\n    get: function () {\n      return this._clockViewModel;\n    },\n  },\n\n  /**\n   * Gets the screen space event handler.\n   * @memberof Viewer.prototype\n   * @type {ScreenSpaceEventHandler}\n   * @readonly\n   */\n  screenSpaceEventHandler: {\n    get: function () {\n      return this._cesiumWidget.screenSpaceEventHandler;\n    },\n  },\n\n  /**\n   * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code>\n   * is true. If undefined, the browser's requestAnimationFrame implementation\n   * determines the frame rate.  If defined, this value must be greater than 0.  A value higher\n   * than the underlying requestAnimationFrame implementation will have no effect.\n   * @memberof Viewer.prototype\n   *\n   * @type {number}\n   */\n  targetFrameRate: {\n    get: function () {\n      return this._cesiumWidget.targetFrameRate;\n    },\n    set: function (value) {\n      this._cesiumWidget.targetFrameRate = value;\n    },\n  },\n\n  /**\n   * Gets or sets whether or not this widget should control the render loop.\n   * If true the widget will use requestAnimationFrame to\n   * perform rendering and resizing of the widget, as well as drive the\n   * simulation clock. If set to false, you must manually call the\n   * <code>resize</code>, <code>render</code> methods\n   * as part of a custom render loop.  If an error occurs during rendering, {@link Scene}'s\n   * <code>renderError</code> event will be raised and this property\n   * will be set to false.  It must be set back to true to continue rendering\n   * after the error.\n   * @memberof Viewer.prototype\n   *\n   * @type {boolean}\n   */\n  useDefaultRenderLoop: {\n    get: function () {\n      return this._cesiumWidget.useDefaultRenderLoop;\n    },\n    set: function (value) {\n      this._cesiumWidget.useDefaultRenderLoop = value;\n    },\n  },\n\n  /**\n   * Gets or sets a scaling factor for rendering resolution.  Values less than 1.0 can improve\n   * performance on less powerful devices while values greater than 1.0 will render at a higher\n   * resolution and then scale down, resulting in improved visual fidelity.\n   * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5\n   * will cause the scene to be rendered at 320x240 and then scaled up while setting\n   * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.\n   * @memberof Viewer.prototype\n   *\n   * @type {number}\n   * @default 1.0\n   */\n  resolutionScale: {\n    get: function () {\n      return this._cesiumWidget.resolutionScale;\n    },\n    set: function (value) {\n      this._cesiumWidget.resolutionScale = value;\n    },\n  },\n\n  /**\n   * Boolean flag indicating if the browser's recommended resolution is used.\n   * If true, the browser's device pixel ratio is ignored and 1.0 is used instead,\n   * effectively rendering based on CSS pixels instead of device pixels. This can improve\n   * performance on less powerful devices that have high pixel density. When false, rendering\n   * will be in device pixels. {@link Viewer#resolutionScale} will still take effect whether\n   * this flag is true or false.\n   * @memberof Viewer.prototype\n   *\n   * @type {boolean}\n   * @default true\n   */\n  useBrowserRecommendedResolution: {\n    get: function () {\n      return this._cesiumWidget.useBrowserRecommendedResolution;\n    },\n    set: function (value) {\n      this._cesiumWidget.useBrowserRecommendedResolution = value;\n    },\n  },\n\n  /**\n   * Gets or sets whether or not data sources can temporarily pause\n   * animation in order to avoid showing an incomplete picture to the user.\n   * For example, if asynchronous primitives are being processed in the\n   * background, the clock will not advance until the geometry is ready.\n   *\n   * @memberof Viewer.prototype\n   *\n   * @type {boolean}\n   */\n  allowDataSourcesToSuspendAnimation: {\n    get: function () {\n      return this._allowDataSourcesToSuspendAnimation;\n    },\n    set: function (value) {\n      this._allowDataSourcesToSuspendAnimation = value;\n    },\n  },\n\n  /**\n   * Gets or sets the Entity instance currently being tracked by the camera.\n   * @memberof Viewer.prototype\n   * @type {Entity | undefined}\n   */\n  trackedEntity: {\n    get: function () {\n      return this._trackedEntity;\n    },\n    set: function (value) {\n      if (this._trackedEntity !== value) {\n        this._trackedEntity = value;\n\n        //Cancel any pending zoom\n        cancelZoom(this);\n\n        const scene = this.scene;\n        const sceneMode = scene.mode;\n\n        //Stop tracking\n        if (!defined(value) || !defined(value.position)) {\n          this._needTrackedEntityUpdate = false;\n          if (\n            sceneMode === SceneMode.COLUMBUS_VIEW ||\n            sceneMode === SceneMode.SCENE2D\n          ) {\n            scene.screenSpaceCameraController.enableTranslate = true;\n          }\n\n          if (\n            sceneMode === SceneMode.COLUMBUS_VIEW ||\n            sceneMode === SceneMode.SCENE3D\n          ) {\n            scene.screenSpaceCameraController.enableTilt = true;\n          }\n\n          this._entityView = undefined;\n          this.camera.lookAtTransform(Matrix4.IDENTITY);\n        } else {\n          //We can't start tracking immediately, so we set a flag and start tracking\n          //when the bounding sphere is ready (most likely next frame).\n          this._needTrackedEntityUpdate = true;\n        }\n\n        this._trackedEntityChanged.raiseEvent(value);\n        this.scene.requestRender();\n      }\n    },\n  },\n  /**\n   * Gets or sets the object instance for which to display a selection indicator.\n   *\n   * If a user interactively picks a Cesium3DTilesFeature instance, then this property\n   * will contain a transient Entity instance with a property named \"feature\" that is\n   * the instance that was picked.\n   * @memberof Viewer.prototype\n   * @type {Entity | undefined}\n   */\n  selectedEntity: {\n    get: function () {\n      return this._selectedEntity;\n    },\n    set: function (value) {\n      if (this._selectedEntity !== value) {\n        this._selectedEntity = value;\n        const selectionIndicatorViewModel = defined(this._selectionIndicator)\n          ? this._selectionIndicator.viewModel\n          : undefined;\n        if (defined(value)) {\n          if (defined(selectionIndicatorViewModel)) {\n            selectionIndicatorViewModel.animateAppear();\n          }\n        } else if (defined(selectionIndicatorViewModel)) {\n          // Leave the info text in place here, it is needed during the exit animation.\n          selectionIndicatorViewModel.animateDepart();\n        }\n        this._selectedEntityChanged.raiseEvent(value);\n      }\n    },\n  },\n  /**\n   * Gets the event that is raised when the selected entity changes.\n   * @memberof Viewer.prototype\n   * @type {Event}\n   * @readonly\n   */\n  selectedEntityChanged: {\n    get: function () {\n      return this._selectedEntityChanged;\n    },\n  },\n  /**\n   * Gets the event that is raised when the tracked entity changes.\n   * @memberof Viewer.prototype\n   * @type {Event}\n   * @readonly\n   */\n  trackedEntityChanged: {\n    get: function () {\n      return this._trackedEntityChanged;\n    },\n  },\n  /**\n   * Gets or sets the data source to track with the viewer's clock.\n   * @memberof Viewer.prototype\n   * @type {DataSource}\n   */\n  clockTrackedDataSource: {\n    get: function () {\n      return this._clockTrackedDataSource;\n    },\n    set: function (value) {\n      if (this._clockTrackedDataSource !== value) {\n        this._clockTrackedDataSource = value;\n        trackDataSourceClock(this._timeline, this.clock, value);\n      }\n    },\n  },\n});\n\n/**\n * Extends the base viewer functionality with the provided mixin.\n * A mixin may add additional properties, functions, or other behavior\n * to the provided viewer instance.\n *\n * @param {Viewer.ViewerMixin} mixin The Viewer mixin to add to this instance.\n * @param {object} [options] The options object to be passed to the mixin function.\n *\n * @see viewerDragDropMixin\n */\nViewer.prototype.extend = function (mixin, options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(mixin)) {\n    throw new DeveloperError(\"mixin is required.\");\n  }\n  //>>includeEnd('debug')\n\n  mixin(this, options);\n};\n\n/**\n * Resizes the widget to match the container size.\n * This function is called automatically as needed unless\n * <code>useDefaultRenderLoop</code> is set to false.\n */\nViewer.prototype.resize = function () {\n  const cesiumWidget = this._cesiumWidget;\n  const container = this._container;\n  const width = container.clientWidth;\n  const height = container.clientHeight;\n  const animationExists = defined(this._animation);\n  const timelineExists = defined(this._timeline);\n\n  cesiumWidget.resize();\n\n  if (width === this._lastWidth && height === this._lastHeight) {\n    return;\n  }\n\n  const panelMaxHeight = height - 125;\n  const baseLayerPickerDropDown = this._baseLayerPickerDropDown;\n\n  if (defined(baseLayerPickerDropDown)) {\n    baseLayerPickerDropDown.style.maxHeight = `${panelMaxHeight}px`;\n  }\n\n  if (defined(this._geocoder)) {\n    const geocoderSuggestions = this._geocoder.searchSuggestionsContainer;\n    geocoderSuggestions.style.maxHeight = `${panelMaxHeight}px`;\n  }\n\n  if (defined(this._infoBox)) {\n    this._infoBox.viewModel.maxHeight = panelMaxHeight;\n  }\n\n  const timeline = this._timeline;\n  let animationContainer;\n  let animationWidth = 0;\n  let creditLeft = 0;\n  let creditBottom = 0;\n\n  if (\n    animationExists &&\n    window.getComputedStyle(this._animation.container).visibility !== \"hidden\"\n  ) {\n    const lastWidth = this._lastWidth;\n    animationContainer = this._animation.container;\n    if (width > 900) {\n      animationWidth = 169;\n      if (lastWidth <= 900) {\n        animationContainer.style.width = \"169px\";\n        animationContainer.style.height = \"112px\";\n        this._animation.resize();\n      }\n    } else if (width >= 600) {\n      animationWidth = 136;\n      if (lastWidth < 600 || lastWidth > 900) {\n        animationContainer.style.width = \"136px\";\n        animationContainer.style.height = \"90px\";\n        this._animation.resize();\n      }\n    } else {\n      animationWidth = 106;\n      if (lastWidth > 600 || lastWidth === 0) {\n        animationContainer.style.width = \"106px\";\n        animationContainer.style.height = \"70px\";\n        this._animation.resize();\n      }\n    }\n    creditLeft = animationWidth + 5;\n  }\n\n  if (\n    timelineExists &&\n    window.getComputedStyle(this._timeline.container).visibility !== \"hidden\"\n  ) {\n    const fullscreenButton = this._fullscreenButton;\n    const vrButton = this._vrButton;\n    const timelineContainer = timeline.container;\n    const timelineStyle = timelineContainer.style;\n\n    creditBottom = timelineContainer.clientHeight + 3;\n    timelineStyle.left = `${animationWidth}px`;\n\n    let pixels = 0;\n    if (defined(fullscreenButton)) {\n      pixels += fullscreenButton.container.clientWidth;\n    }\n    if (defined(vrButton)) {\n      pixels += vrButton.container.clientWidth;\n    }\n\n    timelineStyle.right = `${pixels}px`;\n    timeline.resize();\n  }\n\n  this._bottomContainer.style.left = `${creditLeft}px`;\n  this._bottomContainer.style.bottom = `${creditBottom}px`;\n\n  this._lastWidth = width;\n  this._lastHeight = height;\n};\n\n/**\n * This forces the widget to re-think its layout, including\n * widget sizes and credit placement.\n */\nViewer.prototype.forceResize = function () {\n  this._lastWidth = 0;\n  this.resize();\n};\n\n/**\n * Renders the scene.  This function is called automatically\n * unless <code>useDefaultRenderLoop</code> is set to false;\n */\nViewer.prototype.render = function () {\n  this._cesiumWidget.render();\n};\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nViewer.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nViewer.prototype.destroy = function () {\n  let i;\n\n  this.screenSpaceEventHandler.removeInputAction(\n    ScreenSpaceEventType.LEFT_CLICK\n  );\n  this.screenSpaceEventHandler.removeInputAction(\n    ScreenSpaceEventType.LEFT_DOUBLE_CLICK\n  );\n\n  // Unsubscribe from data sources\n  const dataSources = this.dataSources;\n  const dataSourceLength = dataSources.length;\n  for (i = 0; i < dataSourceLength; i++) {\n    this._dataSourceRemoved(dataSources, dataSources.get(i));\n  }\n  this._dataSourceRemoved(undefined, this._dataSourceDisplay.defaultDataSource);\n\n  this._container.removeChild(this._element);\n  this._element.removeChild(this._toolbar);\n\n  this._eventHelper.removeAll();\n\n  if (defined(this._geocoder)) {\n    this._geocoder = this._geocoder.destroy();\n  }\n\n  if (defined(this._homeButton)) {\n    this._homeButton = this._homeButton.destroy();\n  }\n\n  if (defined(this._sceneModePicker)) {\n    this._sceneModePicker = this._sceneModePicker.destroy();\n  }\n\n  if (defined(this._projectionPicker)) {\n    this._projectionPicker = this._projectionPicker.destroy();\n  }\n\n  if (defined(this._baseLayerPicker)) {\n    this._baseLayerPicker = this._baseLayerPicker.destroy();\n  }\n\n  if (defined(this._animation)) {\n    this._element.removeChild(this._animation.container);\n    this._animation = this._animation.destroy();\n  }\n\n  if (defined(this._timeline)) {\n    this._timeline.removeEventListener(\n      \"settime\",\n      onTimelineScrubfunction,\n      false\n    );\n    this._element.removeChild(this._timeline.container);\n    this._timeline = this._timeline.destroy();\n  }\n\n  if (defined(this._fullscreenButton)) {\n    this._fullscreenSubscription.dispose();\n    this._element.removeChild(this._fullscreenButton.container);\n    this._fullscreenButton = this._fullscreenButton.destroy();\n  }\n\n  if (defined(this._vrButton)) {\n    this._vrSubscription.dispose();\n    this._vrModeSubscription.dispose();\n    this._element.removeChild(this._vrButton.container);\n    this._vrButton = this._vrButton.destroy();\n  }\n\n  if (defined(this._infoBox)) {\n    this._element.removeChild(this._infoBox.container);\n    this._infoBox = this._infoBox.destroy();\n  }\n\n  if (defined(this._selectionIndicator)) {\n    this._element.removeChild(this._selectionIndicator.container);\n    this._selectionIndicator = this._selectionIndicator.destroy();\n  }\n\n  if (this._destroyClockViewModel) {\n    this._clockViewModel = this._clockViewModel.destroy();\n  }\n  this._dataSourceDisplay = this._dataSourceDisplay.destroy();\n  this._cesiumWidget = this._cesiumWidget.destroy();\n\n  if (this._destroyDataSourceCollection) {\n    this._dataSourceCollection = this._dataSourceCollection.destroy();\n  }\n\n  return destroyObject(this);\n};\n\n/**\n * @private\n */\nViewer.prototype._dataSourceAdded = function (\n  dataSourceCollection,\n  dataSource\n) {\n  const entityCollection = dataSource.entities;\n  entityCollection.collectionChanged.addEventListener(\n    Viewer.prototype._onEntityCollectionChanged,\n    this\n  );\n};\n\n/**\n * @private\n */\nViewer.prototype._dataSourceRemoved = function (\n  dataSourceCollection,\n  dataSource\n) {\n  const entityCollection = dataSource.entities;\n  entityCollection.collectionChanged.removeEventListener(\n    Viewer.prototype._onEntityCollectionChanged,\n    this\n  );\n\n  if (defined(this.trackedEntity)) {\n    if (\n      entityCollection.getById(this.trackedEntity.id) === this.trackedEntity\n    ) {\n      this.trackedEntity = undefined;\n    }\n  }\n\n  if (defined(this.selectedEntity)) {\n    if (\n      entityCollection.getById(this.selectedEntity.id) === this.selectedEntity\n    ) {\n      this.selectedEntity = undefined;\n    }\n  }\n};\n\n/**\n * @private\n */\nViewer.prototype._onTick = function (clock) {\n  const time = clock.currentTime;\n\n  const isUpdated = this._dataSourceDisplay.update(time);\n  if (this._allowDataSourcesToSuspendAnimation) {\n    this._clockViewModel.canAnimate = isUpdated;\n  }\n\n  const entityView = this._entityView;\n  if (defined(entityView)) {\n    const trackedEntity = this._trackedEntity;\n    const trackedState = this._dataSourceDisplay.getBoundingSphere(\n      trackedEntity,\n      false,\n      boundingSphereScratch\n    );\n    if (trackedState === BoundingSphereState.DONE) {\n      entityView.update(time, boundingSphereScratch);\n    }\n  }\n\n  let position;\n  let enableCamera = false;\n  const selectedEntity = this.selectedEntity;\n  const showSelection = defined(selectedEntity) && this._enableInfoOrSelection;\n\n  if (\n    showSelection &&\n    selectedEntity.isShowing &&\n    selectedEntity.isAvailable(time)\n  ) {\n    const state = this._dataSourceDisplay.getBoundingSphere(\n      selectedEntity,\n      true,\n      boundingSphereScratch\n    );\n    if (state !== BoundingSphereState.FAILED) {\n      position = boundingSphereScratch.center;\n    } else if (defined(selectedEntity.position)) {\n      position = selectedEntity.position.getValue(time, position);\n    }\n    enableCamera = defined(position);\n  }\n\n  const selectionIndicatorViewModel = defined(this._selectionIndicator)\n    ? this._selectionIndicator.viewModel\n    : undefined;\n  if (defined(selectionIndicatorViewModel)) {\n    selectionIndicatorViewModel.position = Cartesian3.clone(\n      position,\n      selectionIndicatorViewModel.position\n    );\n    selectionIndicatorViewModel.showSelection = showSelection && enableCamera;\n    selectionIndicatorViewModel.update();\n  }\n\n  const infoBoxViewModel = defined(this._infoBox)\n    ? this._infoBox.viewModel\n    : undefined;\n  if (defined(infoBoxViewModel)) {\n    infoBoxViewModel.showInfo = showSelection;\n    infoBoxViewModel.enableCamera = enableCamera;\n    infoBoxViewModel.isCameraTracking =\n      this.trackedEntity === this.selectedEntity;\n\n    if (showSelection) {\n      infoBoxViewModel.titleText = defaultValue(\n        selectedEntity.name,\n        selectedEntity.id\n      );\n      infoBoxViewModel.description = Property.getValueOrDefault(\n        selectedEntity.description,\n        time,\n        \"\"\n      );\n    } else {\n      infoBoxViewModel.titleText = \"\";\n      infoBoxViewModel.description = \"\";\n    }\n  }\n};\n\n/**\n * @private\n */\nViewer.prototype._onEntityCollectionChanged = function (\n  collection,\n  added,\n  removed\n) {\n  const length = removed.length;\n  for (let i = 0; i < length; i++) {\n    const removedObject = removed[i];\n    if (this.trackedEntity === removedObject) {\n      this.trackedEntity = undefined;\n    }\n    if (this.selectedEntity === removedObject) {\n      this.selectedEntity = undefined;\n    }\n  }\n};\n\n/**\n * @private\n */\nViewer.prototype._onInfoBoxCameraClicked = function (infoBoxViewModel) {\n  if (\n    infoBoxViewModel.isCameraTracking &&\n    this.trackedEntity === this.selectedEntity\n  ) {\n    this.trackedEntity = undefined;\n  } else {\n    const selectedEntity = this.selectedEntity;\n    const position = selectedEntity.position;\n    if (defined(position)) {\n      this.trackedEntity = this.selectedEntity;\n    } else {\n      this.zoomTo(this.selectedEntity);\n    }\n  }\n};\n\n/**\n * @private\n */\nViewer.prototype._clearTrackedObject = function () {\n  this.trackedEntity = undefined;\n};\n\n/**\n * @private\n */\nViewer.prototype._onInfoBoxClockClicked = function (infoBoxViewModel) {\n  this.selectedEntity = undefined;\n};\n\n/**\n * @private\n */\nViewer.prototype._clearObjects = function () {\n  this.trackedEntity = undefined;\n  this.selectedEntity = undefined;\n};\n\n/**\n * @private\n */\nViewer.prototype._onDataSourceChanged = function (dataSource) {\n  if (this.clockTrackedDataSource === dataSource) {\n    trackDataSourceClock(this.timeline, this.clock, dataSource);\n  }\n};\n\n/**\n * @private\n */\nViewer.prototype._onDataSourceAdded = function (\n  dataSourceCollection,\n  dataSource\n) {\n  if (this._automaticallyTrackDataSourceClocks) {\n    this.clockTrackedDataSource = dataSource;\n  }\n  const id = dataSource.entities.id;\n  const removalFunc = this._eventHelper.add(\n    dataSource.changedEvent,\n    Viewer.prototype._onDataSourceChanged,\n    this\n  );\n  this._dataSourceChangedListeners[id] = removalFunc;\n};\n\n/**\n * @private\n */\nViewer.prototype._onDataSourceRemoved = function (\n  dataSourceCollection,\n  dataSource\n) {\n  const resetClock = this.clockTrackedDataSource === dataSource;\n  const id = dataSource.entities.id;\n  this._dataSourceChangedListeners[id]();\n  this._dataSourceChangedListeners[id] = undefined;\n  if (resetClock) {\n    const numDataSources = dataSourceCollection.length;\n    if (this._automaticallyTrackDataSourceClocks && numDataSources > 0) {\n      this.clockTrackedDataSource = dataSourceCollection.get(\n        numDataSources - 1\n      );\n    } else {\n      this.clockTrackedDataSource = undefined;\n    }\n  }\n};\n\n/**\n * Asynchronously sets the camera to view the provided entity, entities, or data source.\n * If the data source is still in the process of loading or the visualization is otherwise still loading,\n * this method waits for the data to be ready before performing the zoom.\n *\n * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.\n * The heading and the pitch angles are defined in the local east-north-up reference frame.\n * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch\n * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is\n * zero, a range will be computed such that the whole bounding sphere is visible.</p>\n *\n * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the\n * target will be the range. The heading will be determined from the offset. If the heading cannot be\n * determined from the offset, the heading will be north.</p>\n *\n * @param {Entity|Entity[]|EntityCollection|DataSource|ImageryLayer|Cesium3DTileset|TimeDynamicPointCloud|Promise<Entity|Entity[]|EntityCollection|DataSource|ImageryLayer|Cesium3DTileset|TimeDynamicPointCloud|VoxelPrimitive>} target The entity, array of entities, entity collection, data source, Cesium3DTileset, point cloud, or imagery layer to view. You can also pass a promise that resolves to one of the previously mentioned types.\n * @param {HeadingPitchRange} [offset] The offset from the center of the entity in the local east-north-up reference frame.\n * @returns {Promise<boolean>} A Promise that resolves to true if the zoom was successful or false if the target is not currently visualized in the scene or the zoom was cancelled.\n */\nViewer.prototype.zoomTo = function (target, offset) {\n  const options = {\n    offset: offset,\n  };\n  return zoomToOrFly(this, target, options, false);\n};\n\n/**\n * Flies the camera to the provided entity, entities, or data source.\n * If the data source is still in the process of loading or the visualization is otherwise still loading,\n * this method waits for the data to be ready before performing the flight.\n *\n * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.\n * The heading and the pitch angles are defined in the local east-north-up reference frame.\n * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch\n * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is\n * zero, a range will be computed such that the whole bounding sphere is visible.</p>\n *\n * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the\n * target will be the range. The heading will be determined from the offset. If the heading cannot be\n * determined from the offset, the heading will be north.</p>\n *\n * @param {Entity|Entity[]|EntityCollection|DataSource|ImageryLayer|Cesium3DTileset|TimeDynamicPointCloud|Promise<Entity|Entity[]|EntityCollection|DataSource|ImageryLayer|Cesium3DTileset|TimeDynamicPointCloud|VoxelPrimitive>} target The entity, array of entities, entity collection, data source, Cesium3DTileset, point cloud, or imagery layer to view. You can also pass a promise that resolves to one of the previously mentioned types.\n * @param {object} [options] Object with the following properties:\n * @param {number} [options.duration=3.0] The duration of the flight in seconds.\n * @param {number} [options.maximumHeight] The maximum height at the peak of the flight.\n * @param {HeadingPitchRange} [options.offset] The offset from the target in the local east-north-up reference frame centered at the target.\n * @returns {Promise<boolean>} A Promise that resolves to true if the flight was successful or false if the target is not currently visualized in the scene or the flight was cancelled. //TODO: Cleanup entity mentions\n */\nViewer.prototype.flyTo = function (target, options) {\n  return zoomToOrFly(this, target, options, true);\n};\n\nfunction zoomToOrFly(that, zoomTarget, options, isFlight) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(zoomTarget)) {\n    throw new DeveloperError(\"zoomTarget is required.\");\n  }\n  //>>includeEnd('debug');\n\n  cancelZoom(that);\n\n  //We can't actually perform the zoom until all visualization is ready and\n  //bounding spheres have been computed.  Therefore we create and return\n  //a deferred which will be resolved as part of the post-render step in the\n  //frame that actually performs the zoom.\n  const zoomPromise = new Promise((resolve) => {\n    that._completeZoom = function (value) {\n      resolve(value);\n    };\n  });\n  that._zoomPromise = zoomPromise;\n  that._zoomIsFlight = isFlight;\n  that._zoomOptions = options;\n\n  Promise.resolve(zoomTarget).then(function (zoomTarget) {\n    //Only perform the zoom if it wasn't cancelled before the promise resolved.\n    if (that._zoomPromise !== zoomPromise) {\n      return;\n    }\n\n    //If the zoom target is a rectangular imagery in an ImageLayer\n    if (zoomTarget instanceof ImageryLayer) {\n      let rectanglePromise;\n\n      if (defined(zoomTarget.imageryProvider)) {\n        rectanglePromise = Promise.resolve(zoomTarget.getImageryRectangle());\n      } else {\n        rectanglePromise = new Promise((resolve) => {\n          const removeListener = zoomTarget.readyEvent.addEventListener(() => {\n            removeListener();\n            resolve(zoomTarget.getImageryRectangle());\n          });\n        });\n      }\n      rectanglePromise\n        .then(function (rectangle) {\n          return computeFlyToLocationForRectangle(rectangle, that.scene);\n        })\n        .then(function (position) {\n          //Only perform the zoom if it wasn't cancelled before the promise was resolved\n          if (that._zoomPromise === zoomPromise) {\n            that._zoomTarget = position;\n          }\n        });\n      return;\n    }\n\n    if (\n      zoomTarget instanceof Cesium3DTileset ||\n      zoomTarget instanceof TimeDynamicPointCloud ||\n      zoomTarget instanceof VoxelPrimitive\n    ) {\n      that._zoomTarget = zoomTarget;\n      return;\n    }\n\n    //If the zoom target is a data source, and it's in the middle of loading, wait for it to finish loading.\n    if (zoomTarget.isLoading && defined(zoomTarget.loadingEvent)) {\n      const removeEvent = zoomTarget.loadingEvent.addEventListener(function () {\n        removeEvent();\n\n        //Only perform the zoom if it wasn't cancelled before the data source finished.\n        if (that._zoomPromise === zoomPromise) {\n          that._zoomTarget = zoomTarget.entities.values.slice(0);\n        }\n      });\n      return;\n    }\n\n    //Zoom target is already an array, just copy it and return.\n    if (Array.isArray(zoomTarget)) {\n      that._zoomTarget = zoomTarget.slice(0);\n      return;\n    }\n\n    //If zoomTarget is an EntityCollection, this will retrieve the array\n    zoomTarget = defaultValue(zoomTarget.values, zoomTarget);\n\n    //If zoomTarget is a DataSource, this will retrieve the array.\n    if (defined(zoomTarget.entities)) {\n      zoomTarget = zoomTarget.entities.values;\n    }\n\n    //Zoom target is already an array, just copy it and return.\n    if (Array.isArray(zoomTarget)) {\n      that._zoomTarget = zoomTarget.slice(0);\n    } else {\n      //Single entity\n      that._zoomTarget = [zoomTarget];\n    }\n  });\n\n  that.scene.requestRender();\n  return zoomPromise;\n}\n\nfunction clearZoom(viewer) {\n  viewer._zoomPromise = undefined;\n  viewer._zoomTarget = undefined;\n  viewer._zoomOptions = undefined;\n}\n\nfunction cancelZoom(viewer) {\n  const zoomPromise = viewer._zoomPromise;\n  if (defined(zoomPromise)) {\n    clearZoom(viewer);\n    viewer._completeZoom(false);\n  }\n}\n\n/**\n * @private\n */\nViewer.prototype._postRender = function () {\n  updateZoomTarget(this);\n  updateTrackedEntity(this);\n};\n\nfunction updateZoomTarget(viewer) {\n  const target = viewer._zoomTarget;\n  if (!defined(target) || viewer.scene.mode === SceneMode.MORPHING) {\n    return;\n  }\n\n  const scene = viewer.scene;\n  const camera = scene.camera;\n  const zoomOptions = defaultValue(viewer._zoomOptions, {});\n  let options;\n  function zoomToBoundingSphere(boundingSphere) {\n    // If offset was originally undefined then give it base value instead of empty object\n    if (!defined(zoomOptions.offset)) {\n      zoomOptions.offset = new HeadingPitchRange(\n        0.0,\n        -0.5,\n        boundingSphere.radius\n      );\n    }\n\n    options = {\n      offset: zoomOptions.offset,\n      duration: zoomOptions.duration,\n      maximumHeight: zoomOptions.maximumHeight,\n      complete: function () {\n        viewer._completeZoom(true);\n      },\n      cancel: function () {\n        viewer._completeZoom(false);\n      },\n    };\n\n    if (viewer._zoomIsFlight) {\n      camera.flyToBoundingSphere(target.boundingSphere, options);\n    } else {\n      camera.viewBoundingSphere(boundingSphere, zoomOptions.offset);\n      camera.lookAtTransform(Matrix4.IDENTITY);\n\n      // Finish the promise\n      viewer._completeZoom(true);\n    }\n\n    clearZoom(viewer);\n  }\n\n  if (target instanceof TimeDynamicPointCloud) {\n    if (defined(target.boundingSphere)) {\n      zoomToBoundingSphere(target.boundingSphere);\n      return;\n    }\n\n    // Otherwise, the first \"frame\" needs to have been rendered\n    const removeEventListener = target.frameChanged.addEventListener(function (\n      timeDynamicPointCloud\n    ) {\n      zoomToBoundingSphere(timeDynamicPointCloud.boundingSphere);\n      removeEventListener();\n    });\n    return;\n  }\n\n  if (target instanceof Cesium3DTileset || target instanceof VoxelPrimitive) {\n    zoomToBoundingSphere(target.boundingSphere);\n    return;\n  }\n\n  // If zoomTarget was an ImageryLayer\n  if (target instanceof Cartographic) {\n    options = {\n      destination: scene.mapProjection.ellipsoid.cartographicToCartesian(\n        target\n      ),\n      duration: zoomOptions.duration,\n      maximumHeight: zoomOptions.maximumHeight,\n      complete: function () {\n        viewer._completeZoom(true);\n      },\n      cancel: function () {\n        viewer._completeZoom(false);\n      },\n    };\n\n    if (viewer._zoomIsFlight) {\n      camera.flyTo(options);\n    } else {\n      camera.setView(options);\n      viewer._completeZoom(true);\n    }\n    clearZoom(viewer);\n    return;\n  }\n\n  const entities = target;\n\n  const boundingSpheres = [];\n  for (let i = 0, len = entities.length; i < len; i++) {\n    const state = viewer._dataSourceDisplay.getBoundingSphere(\n      entities[i],\n      false,\n      boundingSphereScratch\n    );\n\n    if (state === BoundingSphereState.PENDING) {\n      return;\n    } else if (state !== BoundingSphereState.FAILED) {\n      boundingSpheres.push(BoundingSphere.clone(boundingSphereScratch));\n    }\n  }\n\n  if (boundingSpheres.length === 0) {\n    cancelZoom(viewer);\n    return;\n  }\n\n  // Stop tracking the current entity.\n  viewer.trackedEntity = undefined;\n\n  const boundingSphere = BoundingSphere.fromBoundingSpheres(boundingSpheres);\n\n  if (!viewer._zoomIsFlight) {\n    camera.viewBoundingSphere(boundingSphere, zoomOptions.offset);\n    camera.lookAtTransform(Matrix4.IDENTITY);\n    clearZoom(viewer);\n    viewer._completeZoom(true);\n  } else {\n    clearZoom(viewer);\n    camera.flyToBoundingSphere(boundingSphere, {\n      duration: zoomOptions.duration,\n      maximumHeight: zoomOptions.maximumHeight,\n      complete: function () {\n        viewer._completeZoom(true);\n      },\n      cancel: function () {\n        viewer._completeZoom(false);\n      },\n      offset: zoomOptions.offset,\n    });\n  }\n}\n\nfunction updateTrackedEntity(viewer) {\n  if (!viewer._needTrackedEntityUpdate) {\n    return;\n  }\n\n  const trackedEntity = viewer._trackedEntity;\n  const currentTime = viewer.clock.currentTime;\n\n  //Verify we have a current position at this time. This is only triggered if a position\n  //has become undefined after trackedEntity is set but before the boundingSphere has been\n  //computed. In this case, we will track the entity once it comes back into existence.\n  const currentPosition = Property.getValueOrUndefined(\n    trackedEntity.position,\n    currentTime\n  );\n\n  if (!defined(currentPosition)) {\n    return;\n  }\n\n  const scene = viewer.scene;\n\n  const state = viewer._dataSourceDisplay.getBoundingSphere(\n    trackedEntity,\n    false,\n    boundingSphereScratch\n  );\n  if (state === BoundingSphereState.PENDING) {\n    return;\n  }\n\n  const sceneMode = scene.mode;\n  if (\n    sceneMode === SceneMode.COLUMBUS_VIEW ||\n    sceneMode === SceneMode.SCENE2D\n  ) {\n    scene.screenSpaceCameraController.enableTranslate = false;\n  }\n\n  if (\n    sceneMode === SceneMode.COLUMBUS_VIEW ||\n    sceneMode === SceneMode.SCENE3D\n  ) {\n    scene.screenSpaceCameraController.enableTilt = false;\n  }\n\n  const bs =\n    state !== BoundingSphereState.FAILED ? boundingSphereScratch : undefined;\n  viewer._entityView = new EntityView(\n    trackedEntity,\n    scene,\n    scene.mapProjection.ellipsoid\n  );\n  viewer._entityView.update(currentTime, bs);\n  viewer._needTrackedEntityUpdate = false;\n}\n\n/**\n * A function that augments a Viewer instance with additional functionality.\n * @callback Viewer.ViewerMixin\n * @param {Viewer} viewer The viewer instance.\n * @param {object} options Options object to be passed to the mixin function.\n *\n * @see Viewer#extend\n */\nexport default Viewer;\n", "import { Check } from \"@cesium/engine\";\nimport Cesium3DTilesInspector from \"../Cesium3DTilesInspector/Cesium3DTilesInspector.js\";\n\n/**\n * A mixin which adds the {@link Cesium3DTilesInspector} widget to the {@link Viewer} widget.\n * Rather than being called directly, this function is normally passed as\n * a parameter to {@link Viewer#extend}, as shown in the example below.\n * @function\n *\n * @param {Viewer} viewer The viewer instance.\n *\n * @example\n * const viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin);\n */\nfunction viewerCesium3DTilesInspectorMixin(viewer) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"viewer\", viewer);\n  //>>includeEnd('debug');\n\n  const container = document.createElement(\"div\");\n  container.className = \"cesium-viewer-cesium3DTilesInspectorContainer\";\n  viewer.container.appendChild(container);\n  const cesium3DTilesInspector = new Cesium3DTilesInspector(\n    container,\n    viewer.scene\n  );\n\n  Object.defineProperties(viewer, {\n    cesium3DTilesInspector: {\n      get: function () {\n        return cesium3DTilesInspector;\n      },\n    },\n  });\n}\nexport default viewerCesium3DTilesInspectorMixin;\n", "import { defined, DeveloperError } from \"@cesium/engine\";\nimport CesiumInspector from \"../CesiumInspector/CesiumInspector.js\";\n\n/**\n * A mixin which adds the CesiumInspector widget to the Viewer widget.\n * Rather than being called directly, this function is normally passed as\n * a parameter to {@link Viewer#extend}, as shown in the example below.\n * @function\n *\n * @param {Viewer} viewer The viewer instance.\n *\n * @exception {DeveloperError} viewer is required.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Cesium%20Inspector.html|Cesium Sandcastle Cesium Inspector Demo}\n *\n * @example\n * const viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.extend(Cesium.viewerCesiumInspectorMixin);\n */\nfunction viewerCesiumInspectorMixin(viewer) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(viewer)) {\n    throw new DeveloperError(\"viewer is required.\");\n  }\n  //>>includeEnd('debug');\n\n  const cesiumInspectorContainer = document.createElement(\"div\");\n  cesiumInspectorContainer.className = \"cesium-viewer-cesiumInspectorContainer\";\n  viewer.container.appendChild(cesiumInspectorContainer);\n  const cesiumInspector = new CesiumInspector(\n    cesiumInspectorContainer,\n    viewer.scene\n  );\n\n  Object.defineProperties(viewer, {\n    cesiumInspector: {\n      get: function () {\n        return cesiumInspector;\n      },\n    },\n  });\n}\nexport default viewerCesiumInspectorMixin;\n", "import {\n  CzmlDataSource,\n  defaultValue,\n  defined,\n  DeveloperError,\n  Event,\n  GeoJsonDataSource,\n  getElement,\n  GpxDataSource,\n  KmlDataSource,\n  wrapFunction,\n} from \"@cesium/engine\";\n/**\n * A mixin which adds default drag and drop support for CZML files to the Viewer widget.\n * Rather than being called directly, this function is normally passed as\n * a parameter to {@link Viewer#extend}, as shown in the example below.\n * @function viewerDragDropMixin\n\n * @param {Viewer} viewer The viewer instance.\n * @param {object} [options] Object with the following properties:\n * @param {Element|string} [options.dropTarget=viewer.container] The DOM element which will serve as the drop target.\n * @param {boolean} [options.clearOnDrop=true] When true, dropping files will clear all existing data sources first, when false, new data sources will be loaded after the existing ones.\n * @param {boolean} [options.flyToOnDrop=true] When true, dropping files will fly to the data source once it is loaded.\n * @param {boolean} [options.clampToGround=true] When true, datasources are clamped to the ground.\n * @param {Proxy} [options.proxy] The proxy to be used for KML network links.\n *\n * @exception {DeveloperError} Element with id <options.dropTarget> does not exist in the document.\n * @exception {DeveloperError} dropTarget is already defined by another mixin.\n * @exception {DeveloperError} dropEnabled is already defined by another mixin.\n * @exception {DeveloperError} dropError is already defined by another mixin.\n * @exception {DeveloperError} clearOnDrop is already defined by another mixin.\n *\n * @example\n * // Add basic drag and drop support and pop up an alert window on error.\n * const viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.extend(Cesium.viewerDragDropMixin);\n * viewer.dropError.addEventListener(function(viewerArg, source, error) {\n *     window.alert('Error processing ' + source + ':' + error);\n * });\n */\nfunction viewerDragDropMixin(viewer, options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(viewer)) {\n    throw new DeveloperError(\"viewer is required.\");\n  }\n  if (viewer.hasOwnProperty(\"dropTarget\")) {\n    throw new DeveloperError(\"dropTarget is already defined by another mixin.\");\n  }\n  if (viewer.hasOwnProperty(\"dropEnabled\")) {\n    throw new DeveloperError(\n      \"dropEnabled is already defined by another mixin.\"\n    );\n  }\n  if (viewer.hasOwnProperty(\"dropError\")) {\n    throw new DeveloperError(\"dropError is already defined by another mixin.\");\n  }\n  if (viewer.hasOwnProperty(\"clearOnDrop\")) {\n    throw new DeveloperError(\n      \"clearOnDrop is already defined by another mixin.\"\n    );\n  }\n  if (viewer.hasOwnProperty(\"flyToOnDrop\")) {\n    throw new DeveloperError(\n      \"flyToOnDrop is already defined by another mixin.\"\n    );\n  }\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  //Local variables to be closed over by defineProperties.\n  let dropEnabled = true;\n  let flyToOnDrop = defaultValue(options.flyToOnDrop, true);\n  const dropError = new Event();\n  let clearOnDrop = defaultValue(options.clearOnDrop, true);\n  let dropTarget = defaultValue(options.dropTarget, viewer.container);\n  let clampToGround = defaultValue(options.clampToGround, true);\n  let proxy = options.proxy;\n\n  dropTarget = getElement(dropTarget);\n\n  Object.defineProperties(viewer, {\n    /**\n     * Gets or sets the element to serve as the drop target.\n     * @memberof viewerDragDropMixin.prototype\n     * @type {Element}\n     */\n    dropTarget: {\n      //TODO See https://github.com/CesiumGS/cesium/issues/832\n      get: function () {\n        return dropTarget;\n      },\n      set: function (value) {\n        //>>includeStart('debug', pragmas.debug);\n        if (!defined(value)) {\n          throw new DeveloperError(\"value is required.\");\n        }\n        //>>includeEnd('debug');\n\n        unsubscribe(dropTarget, handleDrop);\n        dropTarget = value;\n        subscribe(dropTarget, handleDrop);\n      },\n    },\n\n    /**\n     * Gets or sets a value indicating if drag and drop support is enabled.\n     * @memberof viewerDragDropMixin.prototype\n     * @type {Element}\n     */\n    dropEnabled: {\n      get: function () {\n        return dropEnabled;\n      },\n      set: function (value) {\n        if (value !== dropEnabled) {\n          if (value) {\n            subscribe(dropTarget, handleDrop);\n          } else {\n            unsubscribe(dropTarget, handleDrop);\n          }\n          dropEnabled = value;\n        }\n      },\n    },\n\n    /**\n     * Gets the event that will be raised when an error is encountered during drop processing.\n     * @memberof viewerDragDropMixin.prototype\n     * @type {Event}\n     */\n    dropError: {\n      get: function () {\n        return dropError;\n      },\n    },\n\n    /**\n     * Gets or sets a value indicating if existing data sources should be cleared before adding the newly dropped sources.\n     * @memberof viewerDragDropMixin.prototype\n     * @type {boolean}\n     */\n    clearOnDrop: {\n      get: function () {\n        return clearOnDrop;\n      },\n      set: function (value) {\n        clearOnDrop = value;\n      },\n    },\n\n    /**\n     * Gets or sets a value indicating if the camera should fly to the data source after it is loaded.\n     * @memberof viewerDragDropMixin.prototype\n     * @type {boolean}\n     */\n    flyToOnDrop: {\n      get: function () {\n        return flyToOnDrop;\n      },\n      set: function (value) {\n        flyToOnDrop = value;\n      },\n    },\n\n    /**\n     * Gets or sets the proxy to be used for KML.\n     * @memberof viewerDragDropMixin.prototype\n     * @type {Proxy}\n     */\n    proxy: {\n      get: function () {\n        return proxy;\n      },\n      set: function (value) {\n        proxy = value;\n      },\n    },\n\n    /**\n     * Gets or sets a value indicating if the datasources should be clamped to the ground\n     * @memberof viewerDragDropMixin.prototype\n     * @type {boolean}\n     */\n    clampToGround: {\n      get: function () {\n        return clampToGround;\n      },\n      set: function (value) {\n        clampToGround = value;\n      },\n    },\n  });\n\n  function handleDrop(event) {\n    stop(event);\n\n    if (clearOnDrop) {\n      viewer.entities.removeAll();\n      viewer.dataSources.removeAll();\n    }\n\n    const files = event.dataTransfer.files;\n    const length = files.length;\n    for (let i = 0; i < length; i++) {\n      const file = files[i];\n      const reader = new FileReader();\n      reader.onload = createOnLoadCallback(viewer, file, proxy, clampToGround);\n      reader.onerror = createDropErrorCallback(viewer, file);\n      reader.readAsText(file);\n    }\n  }\n\n  //Enable drop by default;\n  subscribe(dropTarget, handleDrop);\n\n  //Wrap the destroy function to make sure all events are unsubscribed from\n  viewer.destroy = wrapFunction(viewer, viewer.destroy, function () {\n    viewer.dropEnabled = false;\n  });\n\n  //Specs need access to handleDrop\n  viewer._handleDrop = handleDrop;\n}\n\nfunction stop(event) {\n  event.stopPropagation();\n  event.preventDefault();\n}\n\nfunction unsubscribe(dropTarget, handleDrop) {\n  const currentTarget = dropTarget;\n  if (defined(currentTarget)) {\n    currentTarget.removeEventListener(\"drop\", handleDrop, false);\n    currentTarget.removeEventListener(\"dragenter\", stop, false);\n    currentTarget.removeEventListener(\"dragover\", stop, false);\n    currentTarget.removeEventListener(\"dragexit\", stop, false);\n  }\n}\n\nfunction subscribe(dropTarget, handleDrop) {\n  dropTarget.addEventListener(\"drop\", handleDrop, false);\n  dropTarget.addEventListener(\"dragenter\", stop, false);\n  dropTarget.addEventListener(\"dragover\", stop, false);\n  dropTarget.addEventListener(\"dragexit\", stop, false);\n}\n\nfunction createOnLoadCallback(viewer, file, proxy, clampToGround) {\n  const scene = viewer.scene;\n  return function (evt) {\n    const fileName = file.name;\n    try {\n      let loadPromise;\n\n      if (/\\.czml$/i.test(fileName)) {\n        loadPromise = CzmlDataSource.load(JSON.parse(evt.target.result), {\n          sourceUri: fileName,\n        });\n      } else if (\n        /\\.geojson$/i.test(fileName) ||\n        /\\.json$/i.test(fileName) ||\n        /\\.topojson$/i.test(fileName)\n      ) {\n        loadPromise = GeoJsonDataSource.load(JSON.parse(evt.target.result), {\n          sourceUri: fileName,\n          clampToGround: clampToGround,\n        });\n      } else if (/\\.(kml|kmz)$/i.test(fileName)) {\n        loadPromise = KmlDataSource.load(file, {\n          sourceUri: fileName,\n          proxy: proxy,\n          camera: scene.camera,\n          canvas: scene.canvas,\n          clampToGround: clampToGround,\n          screenOverlayContainer: viewer.container,\n        });\n      } else if (/\\.gpx$/i.test(fileName)) {\n        loadPromise = GpxDataSource.load(file, {\n          sourceUri: fileName,\n          proxy: proxy,\n        });\n      } else {\n        viewer.dropError.raiseEvent(\n          viewer,\n          fileName,\n          `Unrecognized file: ${fileName}`\n        );\n        return;\n      }\n\n      if (defined(loadPromise)) {\n        viewer.dataSources\n          .add(loadPromise)\n          .then(function (dataSource) {\n            if (viewer.flyToOnDrop) {\n              viewer.flyTo(dataSource);\n            }\n          })\n          .catch(function (error) {\n            viewer.dropError.raiseEvent(viewer, fileName, error);\n          });\n      }\n    } catch (error) {\n      viewer.dropError.raiseEvent(viewer, fileName, error);\n    }\n  };\n}\n\nfunction createDropErrorCallback(viewer, file) {\n  return function (evt) {\n    viewer.dropError.raiseEvent(viewer, file.name, evt.target.error);\n  };\n}\nexport default viewerDragDropMixin;\n", "import { defaultValue, defined, DeveloperError } from \"@cesium/engine\";\nimport PerformanceWatchdog from \"../PerformanceWatchdog/PerformanceWatchdog.js\";\n\n/**\n * A mixin which adds the {@link PerformanceWatchdog} widget to the {@link Viewer} widget.\n * Rather than being called directly, this function is normally passed as\n * a parameter to {@link Viewer#extend}, as shown in the example below.\n * @function\n *\n * @param {Viewer} viewer The viewer instance.\n * @param {object} [options] An object with properties.\n * @param {string} [options.lowFrameRateMessage='This application appears to be performing poorly on your system.  Please try using a different web browser or updating your video drivers.'] The\n *        message to display when a low frame rate is detected.  The message is interpeted as HTML, so make sure\n *        it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.\n *\n * @exception {DeveloperError} viewer is required.\n *\n * @example\n * const viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.extend(Cesium.viewerPerformanceWatchdogMixin, {\n *     lowFrameRateMessage : 'Why is this going so <em>slowly</em>?'\n * });\n */\nfunction viewerPerformanceWatchdogMixin(viewer, options) {\n  //>>includeStart('debug', pragmas.debug);\n  if (!defined(viewer)) {\n    throw new DeveloperError(\"viewer is required.\");\n  }\n  //>>includeEnd('debug');\n\n  options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n  const performanceWatchdog = new PerformanceWatchdog({\n    scene: viewer.scene,\n    container: viewer.bottomContainer,\n    lowFrameRateMessage: options.lowFrameRateMessage,\n  });\n\n  Object.defineProperties(viewer, {\n    performanceWatchdog: {\n      get: function () {\n        return performanceWatchdog;\n      },\n    },\n  });\n}\nexport default viewerPerformanceWatchdogMixin;\n", "import {\n  Cartesian3,\n  Check,\n  defined,\n  destroyObject,\n  HeadingPitchRoll,\n  Matrix3,\n  Matrix4,\n  CustomShader,\n  VoxelShapeType,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\n\nfunction formatShaderString(str) {\n  // This function:\n  // A) removes whitespace lines at the beginning of the string\n  // B) removes unnecessary spaces from the beginning of each line\n\n  const lines = str.split(\"\\n\");\n  let firstLineIdx;\n  for (firstLineIdx = 0; firstLineIdx < lines.length; firstLineIdx++) {\n    if (lines[firstLineIdx].match(/\\S/)) {\n      // Found the first line that's not entirely whitespace\n      break;\n    }\n  }\n  if (firstLineIdx === lines.length) {\n    // All lines are empty\n    return \"\";\n  }\n\n  let finalStr = \"\";\n  const pattern = /^\\s*/;\n  const firstLine = lines[firstLineIdx];\n  const spacesInFrontOfFirstLine = firstLine.match(pattern)[0].length;\n  for (let i = firstLineIdx; i < lines.length; i++) {\n    let line = lines[i];\n    const spacesInFront = line.match(pattern)[0].length;\n    if (spacesInFront >= spacesInFrontOfFirstLine) {\n      line = line.slice(spacesInFrontOfFirstLine);\n    }\n    finalStr += `${line}\\n`;\n  }\n  return finalStr;\n}\n\n/**\n * The view model for {@link VoxelInspector}.\n * @alias VoxelInspectorViewModel\n * @constructor\n *\n * @param {Scene} scene The scene instance to use.\n */\nfunction VoxelInspectorViewModel(scene) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"scene\", scene);\n  //>>includeEnd('debug');\n\n  this._scene = scene;\n  this._voxelPrimitive = undefined;\n  this._customShaderCompilationRemoveCallback = undefined;\n\n  this._definedProperties = [];\n  this._getPrimitiveFunctions = [];\n  this._modelMatrixReady = false;\n\n  const that = this;\n  function addProperty(options) {\n    const { name, initialValue } = options;\n\n    that._definedProperties.push(name);\n\n    let setPrimitiveFunction = options.setPrimitiveFunction;\n    if (setPrimitiveFunction === true) {\n      setPrimitiveFunction = function (value) {\n        that._voxelPrimitive[name] = value;\n      };\n    }\n\n    let getPrimitiveFunction = options.getPrimitiveFunction;\n    if (getPrimitiveFunction === true) {\n      getPrimitiveFunction = function () {\n        that[name] = that._voxelPrimitive[name];\n      };\n    }\n    if (defined(getPrimitiveFunction)) {\n      that._getPrimitiveFunctions.push(getPrimitiveFunction);\n    }\n\n    const knock = knockout.observable();\n    knockout.defineProperty(that, name, {\n      get: function () {\n        return knock();\n      },\n      set: function (value) {\n        // Convert input values to the correct type\n        if (typeof initialValue === \"number\" && typeof value === \"string\") {\n          value = Number(value);\n          if (isNaN(value)) {\n            value = initialValue;\n          }\n        }\n        if (typeof initialValue === \"boolean\" && typeof value === \"number\") {\n          value = value === 1 ? true : false;\n        }\n        knock(value);\n        if (defined(setPrimitiveFunction) && defined(that._voxelPrimitive)) {\n          setPrimitiveFunction(value);\n          scene.requestRender();\n        }\n      },\n    });\n\n    that[name] = initialValue;\n\n    return knock;\n  }\n\n  function getBoundSetter(boundKey, component) {\n    return function (value) {\n      const bound = that._voxelPrimitive[boundKey].clone();\n      bound[component] = value;\n      that._voxelPrimitive[boundKey] = bound;\n    };\n  }\n\n  addProperty({\n    name: \"inspectorVisible\",\n    initialValue: true,\n  });\n\n  addProperty({\n    name: \"displayVisible\",\n    initialValue: false,\n  });\n\n  addProperty({\n    name: \"transformVisible\",\n    initialValue: false,\n  });\n\n  addProperty({\n    name: \"boundsVisible\",\n    initialValue: false,\n  });\n\n  addProperty({\n    name: \"clippingVisible\",\n    initialValue: false,\n  });\n\n  addProperty({\n    name: \"shaderVisible\",\n    initialValue: false,\n  });\n\n  addProperty({\n    name: \"shaderString\",\n    initialValue: \"\",\n    getPrimitiveFunction: function () {\n      const shaderString = that._voxelPrimitive.customShader.fragmentShaderText;\n      that.shaderString = formatShaderString(shaderString);\n    },\n  });\n  addProperty({\n    name: \"shaderCompilationMessage\",\n    initialValue: \"\",\n  });\n  addProperty({\n    name: \"shaderCompilationSuccess\",\n    initialValue: true,\n  });\n  addProperty({\n    name: \"depthTest\",\n    initialValue: false,\n    setPrimitiveFunction: true,\n    getPrimitiveFunction: true,\n  });\n  addProperty({\n    name: \"show\",\n    initialValue: true,\n    setPrimitiveFunction: true,\n    getPrimitiveFunction: true,\n  });\n  addProperty({\n    name: \"disableUpdate\",\n    initialValue: false,\n    setPrimitiveFunction: true,\n    getPrimitiveFunction: true,\n  });\n  addProperty({\n    name: \"debugDraw\",\n    initialValue: false,\n    setPrimitiveFunction: true,\n    getPrimitiveFunction: true,\n  });\n  addProperty({\n    name: \"jitter\",\n    initialValue: true,\n    setPrimitiveFunction: true,\n    getPrimitiveFunction: true,\n  });\n  addProperty({\n    name: \"nearestSampling\",\n    initialValue: true,\n    setPrimitiveFunction: true,\n    getPrimitiveFunction: true,\n  });\n  addProperty({\n    name: \"screenSpaceError\",\n    initialValue: 4.0,\n    setPrimitiveFunction: true,\n    getPrimitiveFunction: true,\n  });\n  addProperty({\n    name: \"stepSize\",\n    initialValue: 1.0,\n    setPrimitiveFunction: true,\n    getPrimitiveFunction: true,\n  });\n  addProperty({\n    name: \"shapeIsBox\",\n    getPrimitiveFunction: function () {\n      const shapeType = that._voxelPrimitive.shape;\n      that.shapeIsBox = shapeType === VoxelShapeType.BOX;\n    },\n  });\n  addProperty({\n    name: \"shapeIsEllipsoid\",\n    getPrimitiveFunction: function () {\n      const shapeType = that._voxelPrimitive.shape;\n      that.shapeIsEllipsoid = shapeType === VoxelShapeType.ELLIPSOID;\n    },\n  });\n  addProperty({\n    name: \"shapeIsCylinder\",\n    getPrimitiveFunction: function () {\n      const shapeType = that._voxelPrimitive.shape;\n      that.shapeIsCylinder = shapeType === VoxelShapeType.CYLINDER;\n    },\n  });\n  addProperty({\n    name: \"boundsBoxMaxX\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxBounds\", \"x\"),\n    getPrimitiveFunction: function () {\n      that.boundsBoxMaxX = that._voxelPrimitive.maxBounds.x;\n    },\n  });\n  addProperty({\n    name: \"boundsBoxMinX\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minBounds\", \"x\"),\n    getPrimitiveFunction: function () {\n      that.boundsBoxMinX = that._voxelPrimitive.minBounds.x;\n    },\n  });\n  addProperty({\n    name: \"boundsBoxMaxY\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxBounds\", \"y\"),\n    getPrimitiveFunction: function () {\n      that.boundsBoxMaxY = that._voxelPrimitive.maxBounds.y;\n    },\n  });\n  addProperty({\n    name: \"boundsBoxMinY\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minBounds\", \"y\"),\n    getPrimitiveFunction: function () {\n      that.boundsBoxMinY = that._voxelPrimitive.minBounds.y;\n    },\n  });\n  addProperty({\n    name: \"boundsBoxMaxZ\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxBounds\", \"z\"),\n    getPrimitiveFunction: function () {\n      that.boundsBoxMaxZ = that._voxelPrimitive.maxBounds.z;\n    },\n  });\n  addProperty({\n    name: \"boundsBoxMinZ\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minBounds\", \"z\"),\n    getPrimitiveFunction: function () {\n      that.boundsBoxMinZ = that._voxelPrimitive.minBounds.z;\n    },\n  });\n  addProperty({\n    name: \"boundsEllipsoidMaxLongitude\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxBounds\", \"x\"),\n    getPrimitiveFunction: function () {\n      that.boundsEllipsoidMaxLongitude = that._voxelPrimitive.maxBounds.x;\n    },\n  });\n  addProperty({\n    name: \"boundsEllipsoidMinLongitude\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minBounds\", \"x\"),\n    getPrimitiveFunction: function () {\n      that.boundsEllipsoidMinLongitude = that._voxelPrimitive.minBounds.x;\n    },\n  });\n  addProperty({\n    name: \"boundsEllipsoidMaxLatitude\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxBounds\", \"y\"),\n    getPrimitiveFunction: function () {\n      that.boundsEllipsoidMaxLatitude = that._voxelPrimitive.maxBounds.y;\n    },\n  });\n  addProperty({\n    name: \"boundsEllipsoidMinLatitude\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minBounds\", \"y\"),\n    getPrimitiveFunction: function () {\n      that.boundsEllipsoidMinLatitude = that._voxelPrimitive.minBounds.y;\n    },\n  });\n  addProperty({\n    name: \"boundsEllipsoidMaxHeight\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxBounds\", \"z\"),\n    getPrimitiveFunction: function () {\n      that.boundsEllipsoidMaxHeight = that._voxelPrimitive.maxBounds.z;\n    },\n  });\n  addProperty({\n    name: \"boundsEllipsoidMinHeight\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minBounds\", \"z\"),\n    getPrimitiveFunction: function () {\n      that.boundsEllipsoidMinHeight = that._voxelPrimitive.minBounds.z;\n    },\n  });\n  addProperty({\n    name: \"boundsCylinderMaxRadius\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxBounds\", \"x\"),\n    getPrimitiveFunction: function () {\n      that.boundsCylinderMaxRadius = that._voxelPrimitive.maxBounds.x;\n    },\n  });\n  addProperty({\n    name: \"boundsCylinderMinRadius\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minBounds\", \"x\"),\n    getPrimitiveFunction: function () {\n      that.boundsCylinderMinRadius = that._voxelPrimitive.minBounds.x;\n    },\n  });\n  addProperty({\n    name: \"boundsCylinderMaxHeight\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxBounds\", \"y\"),\n    getPrimitiveFunction: function () {\n      that.boundsCylinderMaxHeight = that._voxelPrimitive.maxBounds.y;\n    },\n  });\n  addProperty({\n    name: \"boundsCylinderMinHeight\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minBounds\", \"y\"),\n    getPrimitiveFunction: function () {\n      that.boundsCylinderMinHeight = that._voxelPrimitive.minBounds.y;\n    },\n  });\n  addProperty({\n    name: \"boundsCylinderMaxAngle\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxBounds\", \"z\"),\n    getPrimitiveFunction: function () {\n      that.boundsCylinderMaxAngle = that._voxelPrimitive.maxBounds.z;\n    },\n  });\n  addProperty({\n    name: \"boundsCylinderMinAngle\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minBounds\", \"z\"),\n    getPrimitiveFunction: function () {\n      that.boundsCylinderMinAngle = that._voxelPrimitive.minBounds.z;\n    },\n  });\n  addProperty({\n    name: \"clippingBoxMaxX\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxClippingBounds\", \"x\"),\n    getPrimitiveFunction: function () {\n      that.clippingBoxMaxX = that._voxelPrimitive.maxClippingBounds.x;\n    },\n  });\n  addProperty({\n    name: \"clippingBoxMinX\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minClippingBounds\", \"x\"),\n    getPrimitiveFunction: function () {\n      that.clippingBoxMinX = that._voxelPrimitive.minClippingBounds.x;\n    },\n  });\n  addProperty({\n    name: \"clippingBoxMaxY\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxClippingBounds\", \"y\"),\n    getPrimitiveFunction: function () {\n      that.clippingBoxMaxY = that._voxelPrimitive.maxClippingBounds.y;\n    },\n  });\n  addProperty({\n    name: \"clippingBoxMinY\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minClippingBounds\", \"y\"),\n    getPrimitiveFunction: function () {\n      that.clippingBoxMinY = that._voxelPrimitive.minClippingBounds.y;\n    },\n  });\n  addProperty({\n    name: \"clippingBoxMaxZ\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxClippingBounds\", \"z\"),\n    getPrimitiveFunction: function () {\n      that.clippingBoxMaxZ = that._voxelPrimitive.maxClippingBounds.z;\n    },\n  });\n  addProperty({\n    name: \"clippingBoxMinZ\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minClippingBounds\", \"z\"),\n    getPrimitiveFunction: function () {\n      that.clippingBoxMinZ = that._voxelPrimitive.minClippingBounds.z;\n    },\n  });\n  addProperty({\n    name: \"clippingEllipsoidMaxLongitude\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxClippingBounds\", \"x\"),\n    getPrimitiveFunction: function () {\n      that.clippingEllipsoidMaxLongitude =\n        that._voxelPrimitive.maxClippingBounds.x;\n    },\n  });\n  addProperty({\n    name: \"clippingEllipsoidMinLongitude\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minClippingBounds\", \"x\"),\n    getPrimitiveFunction: function () {\n      that.clippingEllipsoidMinLongitude =\n        that._voxelPrimitive.minClippingBounds.x;\n    },\n  });\n  addProperty({\n    name: \"clippingEllipsoidMaxLatitude\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxClippingBounds\", \"y\"),\n    getPrimitiveFunction: function () {\n      that.clippingEllipsoidMaxLatitude =\n        that._voxelPrimitive.maxClippingBounds.y;\n    },\n  });\n  addProperty({\n    name: \"clippingEllipsoidMinLatitude\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minClippingBounds\", \"y\"),\n    getPrimitiveFunction: function () {\n      that.clippingEllipsoidMinLatitude =\n        that._voxelPrimitive.minClippingBounds.y;\n    },\n  });\n  addProperty({\n    name: \"clippingEllipsoidMaxHeight\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxClippingBounds\", \"z\"),\n    getPrimitiveFunction: function () {\n      that.clippingEllipsoidMaxHeight =\n        that._voxelPrimitive.maxClippingBounds.z;\n    },\n  });\n  addProperty({\n    name: \"clippingEllipsoidMinHeight\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minClippingBounds\", \"z\"),\n    getPrimitiveFunction: function () {\n      that.clippingEllipsoidMinHeight =\n        that._voxelPrimitive.minClippingBounds.z;\n    },\n  });\n  addProperty({\n    name: \"clippingCylinderMaxRadius\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxClippingBounds\", \"x\"),\n    getPrimitiveFunction: function () {\n      that.clippingCylinderMaxRadius = that._voxelPrimitive.maxClippingBounds.x;\n    },\n  });\n  addProperty({\n    name: \"clippingCylinderMinRadius\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minClippingBounds\", \"x\"),\n    getPrimitiveFunction: function () {\n      that.clippingCylinderMinRadius = that._voxelPrimitive.minClippingBounds.x;\n    },\n  });\n  addProperty({\n    name: \"clippingCylinderMaxHeight\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxClippingBounds\", \"y\"),\n    getPrimitiveFunction: function () {\n      that.clippingCylinderMaxHeight = that._voxelPrimitive.maxClippingBounds.y;\n    },\n  });\n  addProperty({\n    name: \"clippingCylinderMinHeight\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minClippingBounds\", \"y\"),\n    getPrimitiveFunction: function () {\n      that.clippingCylinderMinHeight = that._voxelPrimitive.minClippingBounds.y;\n    },\n  });\n  addProperty({\n    name: \"clippingCylinderMaxAngle\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"maxClippingBounds\", \"z\"),\n    getPrimitiveFunction: function () {\n      that.clippingCylinderMaxAngle = that._voxelPrimitive.maxClippingBounds.z;\n    },\n  });\n  addProperty({\n    name: \"clippingCylinderMinAngle\",\n    initialValue: 0.0,\n    setPrimitiveFunction: getBoundSetter(\"minClippingBounds\", \"z\"),\n    getPrimitiveFunction: function () {\n      that.clippingCylinderMinAngle = that._voxelPrimitive.minClippingBounds.z;\n    },\n  });\n\n  addProperty({\n    name: \"translationX\",\n    initialValue: 0.0,\n    setPrimitiveFunction: function () {\n      if (that._modelMatrixReady) {\n        setModelMatrix(that);\n      }\n    },\n    getPrimitiveFunction: function () {\n      that.translationX = Matrix4.getTranslation(\n        that._voxelPrimitive.modelMatrix,\n        new Cartesian3()\n      ).x;\n    },\n  });\n  addProperty({\n    name: \"translationY\",\n    initialValue: 0.0,\n    setPrimitiveFunction: function () {\n      if (that._modelMatrixReady) {\n        setModelMatrix(that);\n      }\n    },\n    getPrimitiveFunction: function () {\n      that.translationY = Matrix4.getTranslation(\n        that._voxelPrimitive.modelMatrix,\n        new Cartesian3()\n      ).y;\n    },\n  });\n  addProperty({\n    name: \"translationZ\",\n    initialValue: 0.0,\n    setPrimitiveFunction: function () {\n      if (that._modelMatrixReady) {\n        setModelMatrix(that);\n      }\n    },\n    getPrimitiveFunction: function () {\n      that.translationZ = Matrix4.getTranslation(\n        that._voxelPrimitive.modelMatrix,\n        new Cartesian3()\n      ).z;\n    },\n  });\n\n  addProperty({\n    name: \"scaleX\",\n    initialValue: 1.0,\n    setPrimitiveFunction: function () {\n      if (that._modelMatrixReady) {\n        setModelMatrix(that);\n      }\n    },\n    getPrimitiveFunction: function () {\n      that.scaleX = Matrix4.getScale(\n        that._voxelPrimitive.modelMatrix,\n        new Cartesian3()\n      ).x;\n    },\n  });\n  addProperty({\n    name: \"scaleY\",\n    initialValue: 1.0,\n    setPrimitiveFunction: function () {\n      if (that._modelMatrixReady) {\n        setModelMatrix(that);\n      }\n    },\n    getPrimitiveFunction: function () {\n      that.scaleY = Matrix4.getScale(\n        that._voxelPrimitive.modelMatrix,\n        new Cartesian3()\n      ).y;\n    },\n  });\n  addProperty({\n    name: \"scaleZ\",\n    initialValue: 1.0,\n    setPrimitiveFunction: function () {\n      if (that._modelMatrixReady) {\n        setModelMatrix(that);\n      }\n    },\n    getPrimitiveFunction: function () {\n      that.scaleZ = Matrix4.getScale(\n        that._voxelPrimitive.modelMatrix,\n        new Cartesian3()\n      ).z;\n    },\n  });\n\n  addProperty({\n    name: \"angleX\",\n    initialValue: 0.0,\n    setPrimitiveFunction: function () {\n      if (that._modelMatrixReady) {\n        setModelMatrix(that);\n      }\n    },\n  });\n\n  addProperty({\n    name: \"angleY\",\n    initialValue: 0.0,\n    setPrimitiveFunction: function () {\n      if (that._modelMatrixReady) {\n        setModelMatrix(that);\n      }\n    },\n  });\n\n  addProperty({\n    name: \"angleZ\",\n    initialValue: 0.0,\n    setPrimitiveFunction: function () {\n      if (that._modelMatrixReady) {\n        setModelMatrix(that);\n      }\n    },\n  });\n}\n\nconst scratchTranslation = new Cartesian3();\nconst scratchScale = new Cartesian3();\nconst scratchHeadingPitchRoll = new HeadingPitchRoll();\nconst scratchRotation = new Matrix3();\n\nfunction setModelMatrix(viewModel) {\n  const translation = Cartesian3.fromElements(\n    viewModel.translationX,\n    viewModel.translationY,\n    viewModel.translationZ,\n    scratchTranslation\n  );\n  const scale = Cartesian3.fromElements(\n    viewModel.scaleX,\n    viewModel.scaleY,\n    viewModel.scaleZ,\n    scratchScale\n  );\n  const hpr = scratchHeadingPitchRoll;\n  hpr.heading = viewModel.angleX;\n  hpr.pitch = viewModel.angleY;\n  hpr.roll = viewModel.angleZ;\n  const rotation = Matrix3.fromHeadingPitchRoll(hpr, scratchRotation);\n  const rotationScale = Matrix3.multiplyByScale(rotation, scale, rotation);\n  viewModel._voxelPrimitive.modelMatrix = Matrix4.fromRotationTranslation(\n    rotationScale,\n    translation,\n    viewModel._voxelPrimitive.modelMatrix\n  );\n}\n\nObject.defineProperties(VoxelInspectorViewModel.prototype, {\n  /**\n   * Gets the scene\n   * @memberof VoxelInspectorViewModel.prototype\n   * @type {Scene}\n   * @readonly\n   */\n  scene: {\n    get: function () {\n      return this._scene;\n    },\n  },\n\n  /**\n   * Gets or sets the primitive of the view model.\n   * @memberof VoxelInspectorViewModel.prototype\n   * @type {VoxelPrimitive}\n   */\n  voxelPrimitive: {\n    get: function () {\n      return this._voxelPrimitive;\n    },\n    set: function (voxelPrimitive) {\n      if (defined(this._customShaderCompilationRemoveCallback)) {\n        this._customShaderCompilationRemoveCallback();\n      }\n\n      // Update properties from the new primitive\n      if (defined(voxelPrimitive)) {\n        this._voxelPrimitive = voxelPrimitive;\n\n        const that = this;\n        that._customShaderCompilationRemoveCallback = that._voxelPrimitive.customShaderCompilationEvent.addEventListener(\n          function (error) {\n            const shaderString =\n              that._voxelPrimitive.customShader.fragmentShaderText;\n            that.shaderString = formatShaderString(shaderString);\n\n            if (!defined(error)) {\n              that.shaderCompilationMessage = \"Shader compiled successfully!\";\n              that.shaderCompilationSuccess = true;\n            } else {\n              that.shaderCompilationMessage = error.message;\n              that.shaderCompilationSuccess = false;\n            }\n          }\n        );\n        that._modelMatrixReady = false;\n        for (let i = 0; i < that._getPrimitiveFunctions.length; i++) {\n          that._getPrimitiveFunctions[i]();\n        }\n        that._modelMatrixReady = true;\n        setModelMatrix(that);\n      }\n    },\n  },\n});\n\n/**\n * Toggles the inspector visibility\n */\nVoxelInspectorViewModel.prototype.toggleInspector = function () {\n  this.inspectorVisible = !this.inspectorVisible;\n};\n\n/**\n * Toggles the visibility of the display section\n */\nVoxelInspectorViewModel.prototype.toggleDisplay = function () {\n  this.displayVisible = !this.displayVisible;\n};\n\n/**\n * Toggles the visibility of the transform section\n */\nVoxelInspectorViewModel.prototype.toggleTransform = function () {\n  this.transformVisible = !this.transformVisible;\n};\n\n/**\n * Toggles the visibility of the bounds section\n */\nVoxelInspectorViewModel.prototype.toggleBounds = function () {\n  this.boundsVisible = !this.boundsVisible;\n};\n\n/**\n * Toggles the visibility of the clipping section\n */\nVoxelInspectorViewModel.prototype.toggleClipping = function () {\n  this.clippingVisible = !this.clippingVisible;\n};\n\n/**\n * Toggles the visibility of the shader section\n */\nVoxelInspectorViewModel.prototype.toggleShader = function () {\n  this.shaderVisible = !this.shaderVisible;\n};\n\n/**\n * Compiles the shader in the shader editor.\n */\nVoxelInspectorViewModel.prototype.compileShader = function () {\n  if (defined(this._voxelPrimitive)) {\n    // It's assumed that the same uniforms are going to be used regardless of edits.\n    this._voxelPrimitive.customShader = new CustomShader({\n      fragmentShaderText: this.shaderString,\n      uniforms: this._voxelPrimitive.customShader.uniforms,\n    });\n  }\n};\n\n/**\n * Handles key press events on the shader editor.\n */\nVoxelInspectorViewModel.prototype.shaderEditorKeyPress = function (\n  sender,\n  event\n) {\n  if (event.keyCode === 9) {\n    //tab\n    event.preventDefault();\n    const textArea = event.target;\n    const start = textArea.selectionStart;\n    const end = textArea.selectionEnd;\n    let newEnd = end;\n    const selected = textArea.value.slice(start, end);\n    const lines = selected.split(\"\\n\");\n    const length = lines.length;\n    let i;\n    if (!event.shiftKey) {\n      for (i = 0; i < length; ++i) {\n        lines[i] = `  ${lines[i]}`;\n        newEnd += 2;\n      }\n    } else {\n      for (i = 0; i < length; ++i) {\n        if (lines[i][0] === \" \") {\n          if (lines[i][1] === \" \") {\n            lines[i] = lines[i].substr(2);\n            newEnd -= 2;\n          } else {\n            lines[i] = lines[i].substr(1);\n            newEnd -= 1;\n          }\n        }\n      }\n    }\n    const newText = lines.join(\"\\n\");\n    textArea.value =\n      textArea.value.slice(0, start) + newText + textArea.value.slice(end);\n    textArea.selectionStart = start !== end ? start : newEnd;\n    textArea.selectionEnd = newEnd;\n  } else if (event.ctrlKey && (event.keyCode === 10 || event.keyCode === 13)) {\n    //ctrl + enter\n    this.compileShader();\n  }\n  return true;\n};\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nVoxelInspectorViewModel.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nVoxelInspectorViewModel.prototype.destroy = function () {\n  const that = this;\n  this._definedProperties.forEach(function (property) {\n    knockout.getObservable(that, property).dispose();\n  });\n\n  return destroyObject(this);\n};\n\nexport default VoxelInspectorViewModel;\n", "import {\n  Cartesian3,\n  Math as CesiumMath,\n  Check,\n  destroyObject,\n  Ellipsoid,\n  getElement,\n  VoxelShapeType,\n} from \"@cesium/engine\";\nimport knockout from \"../ThirdParty/knockout.js\";\nimport InspectorShared from \"../InspectorShared.js\";\nimport VoxelInspectorViewModel from \"./VoxelInspectorViewModel.js\";\n\n/**\n * Inspector widget to aid in debugging voxels\n *\n * @alias VoxelInspector\n * @constructor\n *\n * @param {Element|string} container The DOM element or ID that will contain the widget.\n * @param {Scene} scene the Scene instance to use.\n */\nfunction VoxelInspector(container, scene) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.defined(\"container\", container);\n  Check.typeOf.object(\"scene\", scene);\n  //>>includeEnd('debug');\n\n  container = getElement(container);\n  const element = document.createElement(\"div\");\n  const viewModel = new VoxelInspectorViewModel(scene);\n\n  this._viewModel = viewModel;\n  this._container = container;\n  this._element = element;\n\n  const text = document.createElement(\"div\");\n  text.textContent = \"Voxel Inspector\";\n  text.className = \"cesium-cesiumInspector-button\";\n  text.setAttribute(\"data-bind\", \"click: toggleInspector\");\n  element.appendChild(text);\n  element.className = \"cesium-cesiumInspector cesium-VoxelInspector\";\n  element.setAttribute(\n    \"data-bind\",\n    'css: { \"cesium-cesiumInspector-visible\" : inspectorVisible, \"cesium-cesiumInspector-hidden\" : !inspectorVisible}'\n  );\n  container.appendChild(element);\n\n  const panel = document.createElement(\"div\");\n  panel.className = \"cesium-cesiumInspector-dropDown\";\n  element.appendChild(panel);\n\n  const createSection = InspectorShared.createSection;\n  const createCheckbox = InspectorShared.createCheckbox;\n  const createRangeInput = InspectorShared.createRangeInput;\n  const createButton = InspectorShared.createButton;\n\n  const displayPanelContents = createSection(\n    panel,\n    \"Display\",\n    \"displayVisible\",\n    \"toggleDisplay\"\n  );\n\n  const transformPanelContents = createSection(\n    panel,\n    \"Transform\",\n    \"transformVisible\",\n    \"toggleTransform\"\n  );\n\n  const boundsPanelContents = createSection(\n    panel,\n    \"Bounds\",\n    \"boundsVisible\",\n    \"toggleBounds\"\n  );\n\n  const clippingPanelContents = createSection(\n    panel,\n    \"Clipping\",\n    \"clippingVisible\",\n    \"toggleClipping\"\n  );\n\n  const shaderPanelContents = createSection(\n    panel,\n    \"Shader\",\n    \"shaderVisible\",\n    \"toggleShader\"\n  );\n\n  // Display\n  displayPanelContents.appendChild(createCheckbox(\"Depth Test\", \"depthTest\"));\n  displayPanelContents.appendChild(createCheckbox(\"Show\", \"show\"));\n  displayPanelContents.appendChild(\n    createCheckbox(\"Disable Update\", \"disableUpdate\")\n  );\n  displayPanelContents.appendChild(createCheckbox(\"Debug Draw\", \"debugDraw\"));\n  displayPanelContents.appendChild(createCheckbox(\"Jitter\", \"jitter\"));\n  displayPanelContents.appendChild(\n    createCheckbox(\"Nearest Sampling\", \"nearestSampling\")\n  );\n\n  displayPanelContents.appendChild(\n    createRangeInput(\"Screen Space Error\", \"screenSpaceError\", 0, 128)\n  );\n\n  displayPanelContents.appendChild(\n    createRangeInput(\"Step Size\", \"stepSize\", 0.0, 2.0)\n  );\n\n  // Transform\n  const maxTrans = 10.0;\n  const maxScale = 10.0;\n  const maxAngle = CesiumMath.PI;\n\n  transformPanelContents.appendChild(\n    createRangeInput(\"Translation X\", \"translationX\", -maxTrans, +maxTrans)\n  );\n  transformPanelContents.appendChild(\n    createRangeInput(\"Translation Y\", \"translationY\", -maxTrans, +maxTrans)\n  );\n  transformPanelContents.appendChild(\n    createRangeInput(\"Translation Z\", \"translationZ\", -maxTrans, +maxTrans)\n  );\n  transformPanelContents.appendChild(\n    createRangeInput(\"Scale X\", \"scaleX\", 0, +maxScale)\n  );\n  transformPanelContents.appendChild(\n    createRangeInput(\"Scale Y\", \"scaleY\", 0, +maxScale)\n  );\n  transformPanelContents.appendChild(\n    createRangeInput(\"Scale Z\", \"scaleZ\", 0, +maxScale)\n  );\n  transformPanelContents.appendChild(\n    createRangeInput(\"Heading\", \"angleX\", -maxAngle, +maxAngle)\n  );\n  transformPanelContents.appendChild(\n    createRangeInput(\"Pitch\", \"angleY\", -maxAngle, +maxAngle)\n  );\n  transformPanelContents.appendChild(\n    createRangeInput(\"Roll\", \"angleZ\", -maxAngle, +maxAngle)\n  );\n\n  // Bounds\n  const boxMinBounds = VoxelShapeType.getMinBounds(VoxelShapeType.BOX);\n  const boxMaxBounds = VoxelShapeType.getMaxBounds(VoxelShapeType.BOX);\n\n  const ellipsoidMinBounds = Cartesian3.fromElements(\n    VoxelShapeType.getMinBounds(VoxelShapeType.ELLIPSOID).x,\n    VoxelShapeType.getMinBounds(VoxelShapeType.ELLIPSOID).y,\n    -Ellipsoid.WGS84.maximumRadius,\n    new Cartesian3()\n  );\n  const ellipsoidMaxBounds = Cartesian3.fromElements(\n    VoxelShapeType.getMaxBounds(VoxelShapeType.ELLIPSOID).x,\n    VoxelShapeType.getMaxBounds(VoxelShapeType.ELLIPSOID).y,\n    +10000000.0,\n    new Cartesian3()\n  );\n\n  const cylinderMinBounds = VoxelShapeType.getMinBounds(\n    VoxelShapeType.CYLINDER\n  );\n  const cylinderMaxBounds = VoxelShapeType.getMaxBounds(\n    VoxelShapeType.CYLINDER\n  );\n\n  makeCoordinateRange(\n    \"Max X\",\n    \"Min X\",\n    \"Max Y\",\n    \"Min Y\",\n    \"Max Z\",\n    \"Min Z\",\n    \"boundsBoxMaxX\",\n    \"boundsBoxMinX\",\n    \"boundsBoxMaxY\",\n    \"boundsBoxMinY\",\n    \"boundsBoxMaxZ\",\n    \"boundsBoxMinZ\",\n    boxMinBounds,\n    boxMaxBounds,\n    \"shapeIsBox\",\n    boundsPanelContents\n  );\n\n  makeCoordinateRange(\n    \"Max Longitude\",\n    \"Min Longitude\",\n    \"Max Latitude\",\n    \"Min Latitude\",\n    \"Max Height\",\n    \"Min Height\",\n    \"boundsEllipsoidMaxLongitude\",\n    \"boundsEllipsoidMinLongitude\",\n    \"boundsEllipsoidMaxLatitude\",\n    \"boundsEllipsoidMinLatitude\",\n    \"boundsEllipsoidMaxHeight\",\n    \"boundsEllipsoidMinHeight\",\n    ellipsoidMinBounds,\n    ellipsoidMaxBounds,\n    \"shapeIsEllipsoid\",\n    boundsPanelContents\n  );\n\n  makeCoordinateRange(\n    \"Max Radius\",\n    \"Min Radius\",\n    \"Max Height\",\n    \"Min Height\",\n    \"Max Angle\",\n    \"Min Angle\",\n    \"boundsCylinderMaxRadius\",\n    \"boundsCylinderMinRadius\",\n    \"boundsCylinderMaxHeight\",\n    \"boundsCylinderMinHeight\",\n    \"boundsCylinderMaxAngle\",\n    \"boundsCylinderMinAngle\",\n    cylinderMinBounds,\n    cylinderMaxBounds,\n    \"shapeIsCylinder\",\n    boundsPanelContents\n  );\n\n  // Clipping\n  makeCoordinateRange(\n    \"Max X\",\n    \"Min X\",\n    \"Max Y\",\n    \"Min Y\",\n    \"Max Z\",\n    \"Min Z\",\n    \"clippingBoxMaxX\",\n    \"clippingBoxMinX\",\n    \"clippingBoxMaxY\",\n    \"clippingBoxMinY\",\n    \"clippingBoxMaxZ\",\n    \"clippingBoxMinZ\",\n    boxMinBounds,\n    boxMaxBounds,\n    \"shapeIsBox\",\n    clippingPanelContents\n  );\n\n  makeCoordinateRange(\n    \"Max Longitude\",\n    \"Min Longitude\",\n    \"Max Latitude\",\n    \"Min Latitude\",\n    \"Max Height\",\n    \"Min Height\",\n    \"clippingEllipsoidMaxLongitude\",\n    \"clippingEllipsoidMinLongitude\",\n    \"clippingEllipsoidMaxLatitude\",\n    \"clippingEllipsoidMinLatitude\",\n    \"clippingEllipsoidMaxHeight\",\n    \"clippingEllipsoidMinHeight\",\n    ellipsoidMinBounds,\n    ellipsoidMaxBounds,\n    \"shapeIsEllipsoid\",\n    clippingPanelContents\n  );\n\n  makeCoordinateRange(\n    \"Max Radius\",\n    \"Min Radius\",\n    \"Max Height\",\n    \"Min Height\",\n    \"Max Angle\",\n    \"Min Angle\",\n    \"clippingCylinderMaxRadius\",\n    \"clippingCylinderMinRadius\",\n    \"clippingCylinderMaxHeight\",\n    \"clippingCylinderMinHeight\",\n    \"clippingCylinderMaxAngle\",\n    \"clippingCylinderMinAngle\",\n    cylinderMinBounds,\n    cylinderMaxBounds,\n    \"shapeIsCylinder\",\n    clippingPanelContents\n  );\n\n  // Shader\n  const shaderPanelEditor = document.createElement(\"div\");\n  shaderPanelContents.appendChild(shaderPanelEditor);\n\n  const shaderEditor = document.createElement(\"textarea\");\n  shaderEditor.setAttribute(\n    \"data-bind\",\n    \"textInput: shaderString, event: { keydown: shaderEditorKeyPress }\"\n  );\n  shaderPanelEditor.className = \"cesium-cesiumInspector-styleEditor\";\n  shaderPanelEditor.appendChild(shaderEditor);\n  const compileShaderButton = createButton(\n    \"Compile (Ctrl+Enter)\",\n    \"compileShader\"\n  );\n  shaderPanelEditor.appendChild(compileShaderButton);\n\n  const compilationText = document.createElement(\"label\");\n  compilationText.style.display = \"block\";\n  compilationText.setAttribute(\n    \"data-bind\",\n    \"text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}\"\n  );\n  shaderPanelEditor.appendChild(compilationText);\n\n  knockout.applyBindings(viewModel, element);\n}\n\nObject.defineProperties(VoxelInspector.prototype, {\n  /**\n   * Gets the parent container.\n   * @memberof VoxelInspector.prototype\n   *\n   * @type {Element}\n   */\n  container: {\n    get: function () {\n      return this._container;\n    },\n  },\n\n  /**\n   * Gets the view model.\n   * @memberof VoxelInspector.prototype\n   *\n   * @type {VoxelInspectorViewModel}\n   */\n  viewModel: {\n    get: function () {\n      return this._viewModel;\n    },\n  },\n});\n\n/**\n * @returns {boolean} true if the object has been destroyed, false otherwise.\n */\nVoxelInspector.prototype.isDestroyed = function () {\n  return false;\n};\n\n/**\n * Destroys the widget.  Should be called if permanently\n * removing the widget from layout.\n */\nVoxelInspector.prototype.destroy = function () {\n  knockout.cleanNode(this._element);\n  this._container.removeChild(this._element);\n  this.viewModel.destroy();\n\n  return destroyObject(this);\n};\n\nfunction makeCoordinateRange(\n  maxXTitle,\n  minXTitle,\n  maxYTitle,\n  minYTitle,\n  maxZTitle,\n  minZTitle,\n  maxXVar,\n  minXVar,\n  maxYVar,\n  minYVar,\n  maxZVar,\n  minZVar,\n  defaultMinBounds,\n  defaultMaxBounds,\n  allowedShape,\n  parentContainer\n) {\n  const createRangeInput = InspectorShared.createRangeInput;\n\n  const min = defaultMinBounds;\n  const max = defaultMaxBounds;\n  const boundsElement = parentContainer.appendChild(\n    document.createElement(\"div\")\n  );\n  boundsElement.setAttribute(\"data-bind\", `if: ${allowedShape}`);\n  boundsElement.appendChild(createRangeInput(maxXTitle, maxXVar, min.x, max.x));\n  boundsElement.appendChild(createRangeInput(minXTitle, minXVar, min.x, max.x));\n  boundsElement.appendChild(createRangeInput(maxYTitle, maxYVar, min.y, max.y));\n  boundsElement.appendChild(createRangeInput(minYTitle, minYVar, min.y, max.y));\n  boundsElement.appendChild(createRangeInput(maxZTitle, maxZVar, min.z, max.z));\n  boundsElement.appendChild(createRangeInput(minZTitle, minZVar, min.z, max.z));\n}\n\nexport default VoxelInspector;\n", "import { Check } from \"@cesium/engine\";\nimport VoxelInspector from \"../VoxelInspector/VoxelInspector.js\";\n\n/**\n * A mixin which adds the {@link VoxelInspector} widget to the {@link Viewer} widget.\n * Rather than being called directly, this function is normally passed as\n * a parameter to {@link Viewer#extend}, as shown in the example below.\n * @function\n *\n * @param {Viewer} viewer The viewer instance.\n *\n * @example\n * var viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.extend(Cesium.viewerVoxelInspectorMixin);\n */\nfunction viewerVoxelInspectorMixin(viewer) {\n  //>>includeStart('debug', pragmas.debug);\n  Check.typeOf.object(\"viewer\", viewer);\n  //>>includeEnd('debug');\n\n  const container = document.createElement(\"div\");\n  container.className = \"cesium-viewer-voxelInspectorContainer\";\n  viewer.container.appendChild(container);\n  const voxelInspector = new VoxelInspector(container, viewer.scene);\n\n  Object.defineProperties(viewer, {\n    voxelInspector: {\n      get: function () {\n        return voxelInspector;\n      },\n    },\n  });\n}\nexport default viewerVoxelInspectorMixin;\n", "globalThis.CESIUM_VERSION = \"1.113\";\nexport { default as ClockViewModel } from './Source/ClockViewModel.js';\nexport { default as Command } from './Source/Command.js';\nexport { default as InspectorShared } from './Source/InspectorShared.js';\nexport { default as SvgPathBindingHandler } from './Source/SvgPathBindingHandler.js';\nexport { default as ToggleButtonViewModel } from './Source/ToggleButtonViewModel.js';\nexport { default as createCommand } from './Source/createCommand.js';\nexport { default as subscribeAndEvaluate } from './Source/subscribeAndEvaluate.js';\nexport { default as Animation } from './Source/Animation/Animation.js';\nexport { default as AnimationViewModel } from './Source/Animation/AnimationViewModel.js';\nexport { default as CesiumInspector } from './Source/CesiumInspector/CesiumInspector.js';\nexport { default as CesiumInspectorViewModel } from './Source/CesiumInspector/CesiumInspectorViewModel.js';\nexport { default as Cesium3DTilesInspector } from './Source/Cesium3DTilesInspector/Cesium3DTilesInspector.js';\nexport { default as Cesium3DTilesInspectorViewModel } from './Source/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js';\nexport { default as BaseLayerPicker } from './Source/BaseLayerPicker/BaseLayerPicker.js';\nexport { default as BaseLayerPickerViewModel } from './Source/BaseLayerPicker/BaseLayerPickerViewModel.js';\nexport { default as ProviderViewModel } from './Source/BaseLayerPicker/ProviderViewModel.js';\nexport { default as createDefaultImageryProviderViewModels } from './Source/BaseLayerPicker/createDefaultImageryProviderViewModels.js';\nexport { default as createDefaultTerrainProviderViewModels } from './Source/BaseLayerPicker/createDefaultTerrainProviderViewModels.js';\nexport { default as FullscreenButton } from './Source/FullscreenButton/FullscreenButton.js';\nexport { default as FullscreenButtonViewModel } from './Source/FullscreenButton/FullscreenButtonViewModel.js';\nexport { default as Geocoder } from './Source/Geocoder/Geocoder.js';\nexport { default as GeocoderViewModel } from './Source/Geocoder/GeocoderViewModel.js';\nexport { default as HomeButton } from './Source/HomeButton/HomeButton.js';\nexport { default as HomeButtonViewModel } from './Source/HomeButton/HomeButtonViewModel.js';\nexport { default as InfoBox } from './Source/InfoBox/InfoBox.js';\nexport { default as InfoBoxViewModel } from './Source/InfoBox/InfoBoxViewModel.js';\nexport { default as NavigationHelpButton } from './Source/NavigationHelpButton/NavigationHelpButton.js';\nexport { default as NavigationHelpButtonViewModel } from './Source/NavigationHelpButton/NavigationHelpButtonViewModel.js';\nexport { default as PerformanceWatchdog } from './Source/PerformanceWatchdog/PerformanceWatchdog.js';\nexport { default as PerformanceWatchdogViewModel } from './Source/PerformanceWatchdog/PerformanceWatchdogViewModel.js';\nexport { default as ProjectionPicker } from './Source/ProjectionPicker/ProjectionPicker.js';\nexport { default as ProjectionPickerViewModel } from './Source/ProjectionPicker/ProjectionPickerViewModel.js';\nexport { default as SceneModePicker } from './Source/SceneModePicker/SceneModePicker.js';\nexport { default as SceneModePickerViewModel } from './Source/SceneModePicker/SceneModePickerViewModel.js';\nexport { default as SelectionIndicator } from './Source/SelectionIndicator/SelectionIndicator.js';\nexport { default as SelectionIndicatorViewModel } from './Source/SelectionIndicator/SelectionIndicatorViewModel.js';\nexport { default as knockout_3_5_1 } from './Source/ThirdParty/knockout-3.5.1.js';\nexport { default as knockout_es5 } from './Source/ThirdParty/knockout-es5.js';\nexport { default as knockout } from './Source/ThirdParty/knockout.js';\nexport { default as Timeline } from './Source/Timeline/Timeline.js';\nexport { default as TimelineHighlightRange } from './Source/Timeline/TimelineHighlightRange.js';\nexport { default as TimelineTrack } from './Source/Timeline/TimelineTrack.js';\nexport { default as VRButton } from './Source/VRButton/VRButton.js';\nexport { default as VRButtonViewModel } from './Source/VRButton/VRButtonViewModel.js';\nexport { default as Viewer } from './Source/Viewer/Viewer.js';\nexport { default as viewerCesium3DTilesInspectorMixin } from './Source/Viewer/viewerCesium3DTilesInspectorMixin.js';\nexport { default as viewerCesiumInspectorMixin } from './Source/Viewer/viewerCesiumInspectorMixin.js';\nexport { default as viewerDragDropMixin } from './Source/Viewer/viewerDragDropMixin.js';\nexport { default as viewerPerformanceWatchdogMixin } from './Source/Viewer/viewerPerformanceWatchdogMixin.js';\nexport { default as viewerVoxelInspectorMixin } from './Source/Viewer/viewerVoxelInspectorMixin.js';\nexport { default as VoxelInspector } from './Source/VoxelInspector/VoxelInspector.js';\nexport { default as VoxelInspectorViewModel } from './Source/VoxelInspector/VoxelInspectorViewModel.js';\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,0DAAAA,UAAAC,SAAA;AAkEA,QAAIC,mBAAkB,SAAS,MAAM;AACpC,UAAI,QAAQ,QAAW;AACtB,gBAAO,oBAAI,KAAK,GAAE,QAAQ;AAAA,MAC3B;AAGA,WAAK,IAAI;AACT,WAAK,IAAI;AACT,WAAK,WAAW;AAChB,WAAK,aAAa;AAClB,WAAK,aAAa;AAElB,WAAK,KAAK,IAAI,MAAM,KAAK,CAAC;AAC1B,WAAK,MAAI,KAAK,IAAE;AAEhB,UAAI,KAAK,eAAe,OAAO;AAC9B,aAAK,cAAc,MAAM,KAAK,MAAM;AAAA,MACrC,OACK;AACJ,aAAK,UAAU,IAAI;AAAA,MACpB;AAAA,IACD;AAIA,IAAAA,iBAAgB,UAAU,YAAY,SAAS,GAAG;AACjD,WAAK,GAAG,CAAC,IAAI,MAAM;AACnB,WAAK,KAAK,MAAI,GAAG,KAAK,MAAI,KAAK,GAAG,KAAK,OAAO;AAC7C,YAAI,IAAI,KAAK,GAAG,KAAK,MAAI,CAAC,IAAK,KAAK,GAAG,KAAK,MAAI,CAAC,MAAM;AACvD,aAAK,GAAG,KAAK,GAAG,OAAS,IAAI,gBAAgB,MAAM,cAAe,OAAO,IAAI,SAAc,aACzF,KAAK;AAKP,aAAK,GAAG,KAAK,GAAG,OAAO;AAAA,MAExB;AAAA,IACD;AAMA,IAAAA,iBAAgB,UAAU,gBAAgB,SAAS,UAAU,YAAY;AACxE,UAAI,GAAG,GAAG;AACV,WAAK,UAAU,QAAQ;AACvB,UAAE;AAAG,UAAE;AACP,UAAK,KAAK,IAAE,aAAa,KAAK,IAAI;AAClC,aAAO,GAAG,KAAK;AACd,YAAI,IAAI,KAAK,GAAG,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ACA,UACA,UACA,WACA,UACA,QACA,QACA,OACA,YACA,WACA,QACA,YACA,MACA,aACA,OACA,WACA,OACA,UACA,OACA,OACA,MACA,MACA,WACA,MACA,YACA,cACA,UACA,QACA,UACA,QACA,MACA,MACA,MACA,MACA,MACA,MACA,QACA,UACA,UACA,MACA,QACA,KACA,OACA,SACA,OACA,OACA,SACA,UACA,MACA,QACA,OACA,QACA,WACA,QACA,YACA,SACA,OACA,QACA,MACA,YACA,UACA,UACA,KACA,WACA,OACA,YACA,KACA,MACA,MACA,QACA,KACA,QACA,WACA,UACA,UACA,SACA,UACA,UACA,QACA,UACA,UACA,SACA,OACA,WACA,OACA,SACA,SACA,MACA,YACA,YACA,SACA,MACA,SACA,QACA,MACA,SACA,MACA,KACA,MACA,OACA,SACA,KArHyB,CAAD;AAyHnB,QAAM+D,QAAM/D,OAAO,CACxB,OACA,KACA,YACA,eACA,gBACA,gBACA,iBACA,oBACA,UACA,YACA,QACA,QACA,WACA,UACA,QACA,KACA,SACA,YACA,SACA,SACA,QACA,kBACA,UACA,QACA,YACA,SACA,QACA,WACA,WACA,YACA,kBACA,QACA,QACA,SACA,UACA,UACA,QACA,YACA,SACA,QACA,SACA,QACA,OA3CwB,CAAD;AA8ClB,QAAMgE,aAAahE,OAAO,CAC/B,WACA,iBACA,uBACA,eACA,oBACA,qBACA,qBACA,kBACA,gBACA,WACA,WACA,WACA,WACA,WACA,kBACA,WACA,WACA,eACA,gBACA,YACA,gBACA,sBACA,eACA,UACA,cAzB+B,CAAD;AAgCzB,QAAMiE,gBAAgBjE,OAAO,CAClC,WACA,iBACA,UACA,WACA,aACA,oBACA,kBACA,iBACA,iBACA,iBACA,SACA,aACA,QACA,gBACA,aACA,WACA,iBACA,UACA,OACA,cACA,WACA,KAtBkC,CAAD;AAyB5B,QAAMkE,WAASlE,OAAO,CAC3B,QACA,YACA,UACA,WACA,SACA,UACA,MACA,cACA,iBACA,MACA,MACA,SACA,WACA,YACA,SACA,QACA,MACA,UACA,SACA,UACA,QACA,QACA,WACA,UACA,OACA,SACA,OACA,UACA,cACA,aA9B2B,CAAD;AAmCrB,QAAMmE,mBAAmBnE,OAAO,CACrC,WACA,eACA,cACA,YACA,aACA,WACA,WACA,UACA,UACA,SACA,aACA,cACA,kBACA,eACA,MAfqC,CAAD;AAkB/B,QAAMoE,OAAOpE,OAAO,CAAC,OAAD,CAAD;ACrRnB,QAAM8D,OAAO9D,OAAO,CACzB,UACA,UACA,SACA,OACA,kBACA,gBACA,wBACA,YACA,cACA,WACA,UACA,WACA,eACA,eACA,WACA,QACA,SACA,SACA,SACA,QACA,WACA,YACA,gBACA,UACA,eACA,YACA,YACA,WACA,OACA,YACA,2BACA,yBACA,YACA,aACA,WACA,gBACA,QACA,OACA,WACA,UACA,UACA,QACA,QACA,YACA,MACA,aACA,aACA,SACA,QACA,SACA,QACA,QACA,WACA,QACA,OACA,OACA,aACA,SACA,UACA,OACA,aACA,YACA,SACA,QACA,SACA,WACA,cACA,UACA,QACA,WACA,WACA,eACA,eACA,UACA,WACA,WACA,cACA,YACA,OACA,YACA,OACA,YACA,QACA,QACA,WACA,cACA,SACA,YACA,SACA,QACA,SACA,QACA,WACA,SACA,OACA,UACA,QACA,SACA,WACA,YACA,SACA,aACA,QACA,UACA,UACA,SACA,SACA,SACA,MA7GyB,CAAD;AAgHnB,QAAM+D,MAAM/D,OAAO,CACxB,iBACA,cACA,YACA,sBACA,UACA,iBACA,iBACA,WACA,iBACA,kBACA,SACA,QACA,MACA,SACA,QACA,iBACA,aACA,aACA,SACA,uBACA,+BACA,iBACA,mBACA,MACA,MACA,KACA,MACA,MACA,mBACA,aACA,WACA,WACA,OACA,YACA,aACA,OACA,QACA,gBACA,aACA,UACA,eACA,eACA,iBACA,eACA,aACA,oBACA,gBACA,cACA,gBACA,eACA,MACA,MACA,MACA,MACA,cACA,YACA,iBACA,qBACA,UACA,QACA,MACA,mBACA,MACA,OACA,KACA,MACA,MACA,MACA,MACA,WACA,aACA,cACA,YACA,QACA,gBACA,kBACA,gBACA,oBACA,kBACA,SACA,cACA,cACA,gBACA,gBACA,eACA,eACA,oBACA,aACA,OACA,QACA,SACA,UACA,QACA,OACA,QACA,cACA,UACA,YACA,WACA,SACA,UACA,eACA,UACA,YACA,eACA,QACA,cACA,uBACA,oBACA,gBACA,UACA,iBACA,uBACA,kBACA,KACA,MACA,MACA,UACA,QACA,QACA,eACA,aACA,WACA,UACA,UACA,SACA,QACA,mBACA,oBACA,oBACA,gBACA,eACA,gBACA,eACA,cACA,gBACA,oBACA,qBACA,kBACA,mBACA,qBACA,kBACA,UACA,gBACA,SACA,gBACA,kBACA,YACA,WACA,WACA,aACA,oBACA,eACA,mBACA,kBACA,cACA,QACA,MACA,MACA,WACA,UACA,WACA,cACA,WACA,cACA,iBACA,iBACA,SACA,gBACA,QACA,gBACA,oBACA,oBACA,KACA,MACA,MACA,SACA,KACA,MACA,MACA,KACA,YAtLwB,CAAD;AAyLlB,QAAMkE,SAASlE,OAAO,CAC3B,UACA,eACA,SACA,YACA,SACA,gBACA,eACA,cACA,cACA,SACA,OACA,WACA,gBACA,YACA,SACA,SACA,UACA,QACA,MACA,WACA,UACA,iBACA,UACA,UACA,kBACA,aACA,YACA,eACA,WACA,WACA,iBACA,YACA,YACA,QACA,YACA,YACA,cACA,WACA,UACA,UACA,eACA,iBACA,wBACA,aACA,aACA,cACA,YACA,kBACA,kBACA,aACA,WACA,SACA,OArD2B,CAAD;AAwDrB,QAAMqE,MAAMrE,OAAO,CACxB,cACA,UACA,eACA,aACA,aALwB,CAAD;AChWlB,QAAMsE,gBAAgBrE,KAAK,2BAAD;AAC1B,QAAMsE,WAAWtE,KAAK,uBAAD;AACrB,QAAMuE,cAAcvE,KAAK,eAAD;AACxB,QAAMwE,YAAYxE,KAAK,4BAAD;AACtB,QAAMyE,YAAYzE,KAAK,gBAAD;AACtB,QAAM0E,iBAAiB1E;MAC5B;;IADgC;AAG3B,QAAM2E,oBAAoB3E,KAAK,uBAAD;AAC9B,QAAM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BAAoB,YAAY;AAClC,QAAI,UAAU;AACd,WAAO,GAAG,aAAa,WAAW;AAAA,EACpC,OAAO;AACL,QAAI,UAAU,SAAS;AACvB,WAAO,IAAI,GAAG,cAAc,YAAY,WAAW;AACnD,WAAO,IAAI,GAAG,cAAc,aAAa,WAAW;AACpD,WAAO,IAAI,GAAG,cAAc,aAAa,WAAW;AACpD,WAAO,IAAI,GAAG,cAAc,YAAY,WAAW;AAAA,EACrD;AACF;AAEA,SAAS,eACP,qBACA,YACA,yBACA,YACA,WACA;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEA,SAAS,yBACP,qBACA,YACAH,SACA,YACA,aACA,yBACA;AACA,MAAI;AACJ,MAAI,WAAW,SAAS,kBAAU,SAAS;AACzC,qBAAiB,oBAAoB;AACrC,wB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A;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEA,SAAS,WAAW,QAAQ,QAAQ,kBAAkB,WAAW;AAC/D,QAAM,UAAU,OAAO;AACvB,MAA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IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEA,SAAS,gBAAgB,QAAQ,YAAY;AAC3C,QAAM,UAAU,OAAO;AACvB,MAAI,gBAAQ,OAAO,GAAG;AACpB,QAA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c;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;A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ACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA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A;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA;AAAA,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kBACA,kBACA,cACA,iBACA;AACA,QAAM,mBAAmB,wBAAgB;AAEzC,QAAMC,OAAM;AACZ,QAAMC,OAAM;AACZ,QAAM,gBAAgB,gBAAgB;AAAA,IACpC,SAAS,cAAc,KAAK;AAAA,EAC9B;AACA,gBAAc,aAAa,aAAa,OAAO,YAAY,EAAE;AAC7D,gBAAc,YAAY,iBAAiB,WAAW,SAASD,KAAI,GAAGC,KAAI,CAAC,CAAC;AAC5E,gBAAc,YAAY,iBAAiB,WAAW,SAASD,KAAI,GAAGC,KAAI,CAAC,CAAC;AAC5E,gBAAc,YAAY,iBAAiB,WAAW,SAASD,KAAI,GAAGC,KAAI,CAAC,CAAC;AAC5E,gBAAc,YAAY,iBAAiB,WAAW,SAASD,KAAI,GAAGC,KAAI,CAAC,CAAC;AAC5E,gBAAc,YAAY,iBAAiB,WAAW,SAASD,KAAI,GAAGC,KAAI,CAAC,CAAC;AAC5E,gBAAc,YAAY,iBAAiB,WAAW,SAASD,KAAI,GAAGC,KAAI,CAAC,CAAC;AAC9E;AAEA,IAAO,yBAAQ;;;ACxXf,SAAS,0BAA0B,QAAQ;AAEzC,gBAAM,OAAO,OAAO,UAAU,MAAM;AAGpC,QAAM,YAAY,SAAS,cAAc,KAAK;AAC9C,YAAU,YAAY;AACtB,SAAO,UAAU,YAAY,SAAS;AACtC,QAAM,iBAAiB,IAAI,uBAAe,WAAW,OAAO,KAAK;AAEjE,SAAO,iBAAiB,QAAQ;AAAA,IAC9B,gBAAgB;AAAA,MACd,KAAK,WAAY;AACf,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF,CAAC;AACH;AACA,IAAO,oCAAQ;;;ACjCf,WAAW,iBAAiB;;;AprCArB,IAAMC,WAAU;",
  "names": ["exports", "module", "MersenneTwister", "a", "exports", "module", "length", "exports", "module", "length", "exports", "module", "exports", "module", "url", "length", "_part", "string", "v", "removeAll", "_URI", "punycode", "q", "p", "entries", "setPrototypeOf", "isFrozen", "getPrototypeOf", "getOwnPropertyDescriptor", "Object", "freeze", "seal", "create", "apply", "construct", "Reflect", "x", "fun", "thisValue", "args", "Func", "arrayForEach", "unapply", "Array", "prototype", "forEach", "arrayPop", "pop", "arrayPush", "push", "stringToLowerCase", "String", "toLowerCase", "stringToString", "toString", "stringMatch", "match", "stringReplace", "replace", "stringIndexOf", "indexOf", "stringTrim", "trim", "regExpTest", "RegExp", "test", "typeErrorCreate", "unconstruct", "TypeError", "func", "thisArg", "addToSet", "set", "array", "transformCaseFunc", "l", "length", "element", "lcElement", "clone", "object", "newObject", "property", "value", "undefined", "lookupGetter", "prop", "desc", "get", "fallbackValue", "console", "warn", "html", "svg", "svgFilters", "svgDisallowed", "mathMl", "mathMlDisallowed", "text", "xml", "MUSTACHE_EXPR", "ERB_EXPR", "TMPLIT_EXPR", "DATA_ATTR", "ARIA_ATTR", "IS_ALLOWED_URI", "IS_SCRIPT_OR_DATA", "ATTR_WHITESPACE", "DOCTYPE_NAME", "getGlobal", "window", "_createTrustedTypesPolicy", "trustedTypes", "purifyHostElement", "createPolicy", "suffix", "ATTR_NAME", "hasAttribute", "getAttribute", "policyName", "createHTML", "createScriptURL", "scriptUrl", "_", "createDOMPurify", "DOMPurify", "root", "version", "VERSION", "removed", "document", "nodeType", "isSupported", "originalDocument", "currentScript", "DocumentFragment", "HTMLTemplateElement", "Node", "Element", "NodeFilter", "NamedNodeMap", "MozNamedAttrMap", "HTMLFormElement", "DOMParser", "ElementPrototype", "cloneNode", "getNextSibling", "getChildNodes", "getParentNode", "template", "createElement", "content", "ownerDocument", "trustedTypesPolicy", "emptyHTML", "implementation", "createNodeIterator", "createDocumentFragment", "getElementsByTagName", "importNode", "hooks", "createHTMLDocument", "EXPRESSIONS", "ALLOWED_TAGS", "DEFAULT_ALLOWED_TAGS", "TAGS", "ALLOWED_ATTR", "DEFAULT_ALLOWED_ATTR", "ATTRS", "CUSTOM_ELEMENT_HANDLING", "tagNameCheck", "writable", "configurable", "enumerable", "attributeNameCheck", "allowCustomizedBuiltInElements", "FORBID_TAGS", "FORBID_ATTR", "ALLOW_ARIA_ATTR", "ALLOW_DATA_ATTR", "ALLOW_UNKNOWN_PROTOCOLS", "ALLOW_SELF_CLOSE_IN_ATTR", "SAFE_FOR_TEMPLATES", "WHOLE_DOCUMENT", "SET_CONFIG", "FORCE_BODY", "RETURN_DOM", "RETURN_DOM_FRAGMENT", "RETURN_TRUSTED_TYPE", "SANITIZE_DOM", "SANITIZE_NAMED_PROPS", "SANITIZE_NAMED_PROPS_PREFIX", "KEEP_CONTENT", "IN_PLACE", "USE_PROFILES", "FORBID_CONTENTS", "DEFAULT_FORBID_CONTENTS", "DATA_URI_TAGS", "DEFAULT_DATA_URI_TAGS", "URI_SAFE_ATTRIBUTES", "DEFAULT_URI_SAFE_ATTRIBUTES", "MATHML_NAMESPACE", "SVG_NAMESPACE", "HTML_NAMESPACE", "NAMESPACE", "IS_EMPTY_INPUT", "ALLOWED_NAMESPACES", "DEFAULT_ALLOWED_NAMESPACES", "PARSER_MEDIA_TYPE", "SUPPORTED_PARSER_MEDIA_TYPES", "DEFAULT_PARSER_MEDIA_TYPE", "CONFIG", "formElement", "isRegexOrFunction", "testValue", "Function", "_parseConfig", "cfg", "ADD_URI_SAFE_ATTR", "ADD_DATA_URI_TAGS", "ALLOWED_URI_REGEXP", "ADD_TAGS", "ADD_ATTR", "table", "tbody", "TRUSTED_TYPES_POLICY", "MATHML_TEXT_INTEGRATION_POINTS", "HTML_INTEGRATION_POINTS", "COMMON_SVG_AND_HTML_ELEMENTS", "ALL_SVG_TAGS", "ALL_MATHML_TAGS", "_checkValidNamespace", "parent", "tagName", "namespaceURI", "parentTagName", "Boolean", "_forceRemove", "node", "parentNode", "removeChild", "remove", "_removeAttribute", "name", "attribute", "getAttributeNode", "from", "removeAttribute", "setAttribute", "_initDocument", "dirty", "doc", "leadingWhitespace", "matches", "dirtyPayload", "parseFromString", "documentElement", "createDocument", "innerHTML", "body", "insertBefore", "createTextNode", "childNodes", "call", "_createNodeIterator", "SHOW_ELEMENT", "SHOW_COMMENT", "SHOW_TEXT", "_isClobbered", "elm", "nodeName", "textContent", "attributes", "hasChildNodes", "_isNode", "_executeHook", "entryPoint", "currentNode", "data", "hook", "_sanitizeElements", "allowedTags", "firstElementChild", "_isBasicCustomElement", "childCount", "i", "expr", "_isValidAttribute", "lcTag", "lcName", "_sanitizeAttributes", "hookEvent", "attrName", "attrValue", "keepAttr", "allowedAttributes", "attr", "forceKeepAttr", "getAttributeType", "setAttributeNS", "_sanitizeShadowDOM", "fragment", "shadowNode", "shadowIterator", "nextNode", "sanitize", "importedNode", "returnNode", "appendChild", "firstChild", "nodeIterator", "shadowroot", "shadowrootmode", "serializedHTML", "outerHTML", "doctype", "setConfig", "clearConfig", "isValidAttribute", "tag", "addHook", "hookFunction", "removeHook", "removeHooks", "removeAllHooks", "exports", "module", "indices", "mode", "table", "exports", "module", "MeshoptDecoder", "instance", "workers", "createWorker", "url", "mode", "resolve", "exports", "module", "indices", "exports", "module", "MeshoptDecoder", "exports", "module", "v", "a", "exports", "module", "GraphemeSplitter", "exports", "module", "earcut", "stop", "a", "q1", "q2", "sign", "a2", "Node", "exports", "module", "global", "swap", "tmp", "a", "RBush", "contains", "load", "clear", "remove", "exports", "module", "global", "transform", "feature", "o", "bbox", "transformPoint", "a", "arcs", "polygon", "fragmentByEnd", "fragmentByStart", "object", "merge", "neighbors", "polygons", "i", "n", "exports", "exports", "remove", "exports", "HtmlTag", "exports", "url", "urlObj", "remainingAvailableLength", "end", "exports", "url", "exports", "exports", "AnchorTagBuilder", "exports", "resolve", "step", "v", "a", "mod", "d", "b", "__assign", "AbstractMatch", "offset", "exports", "exports", "exports", "url", "UrlMatch", "url", "exports", "exports", "EmailMatch", "exports", "exports", "HashtagMatch", "exports", "exports", "MentionMatch", "exports", "exports", "PhoneMatch", "exports", "stateMachine", "char", "exports", "char", "exports", "CurrentTag", "Autolinker", "autolinker", "offset", "a", "exports", "exports", "exports", "exports", "module", "protobuf", "require", "module", "exports", "offset", "resolve", "params", "length", "i", "sign", "pool", "size", "c1", "c2", "configure", "Reader", "create_array", "create", "buffer", "self", "err", "hash", "Buffer", "merge", "get", "Writer", "exports", "module", "parse", "offset", "Lerc2Decode", "a", "Lerc", "exports", "module", "A", "e", "B", "g", "PointCloudEyeDomeLighting_default", "VERSION", "Megatexture_default", "a", "mod", "length", "min", "max", "MersenneTwister", "cartesian", "length", "min", "max", "a", "offset", "cartesian", "length", "min", "max", "distanceScratch", "lerpScratch", "mostOrthogonalAxisScratch", "offset", "length", "cartesian", "rotAxis", "offset", "length", "translation", "direction", "a", "cartesian", "scaleScratch1", "scaleScratch2", "scratchColumn", "scaleScratch3", "scaleScratch4", "scaleScratch5", "scratchTransposeMatrix", "offset", "v", "length", "Buffer", "length", "tmp", "resolve", "cartesian", "offset", "cartesian", "length", "min", "max", "distanceScratch", "lerpScratch", "angleBetweenScratch", "angleBetweenScratch2", "mostOrthogonalAxisScratch", "offset", "cartesian", "cartesian", "cartographic", "cartesian", "cartographic", "length", "cartesianToCartographicN", "cartesianToCartographicP", "cartesianToCartographicH", "a", "a2", "c2", "cartographic", "cartesian", "cartographic", "length", "length", "mod", "length", "clear", "length", "cartesian", "scaleScratch1", "scaleScratch2", "scratchColumn", "scaleScratch3", "scaleScratch4", "scaleScratch5", "offset", "location", "v", "length", "v", "initialize", "attributeLocations", "translation", "numberOfAttributes", "location", "length", "uniformMap", "validate", "uniformMap", "length", "offset", "lerpScratch", "dot", "cartesian", "q1", "q2", "sign", "offset", "offset", "a", "tmp", "import_urijs", "url", "resolve", "Uri", "import_urijs", "Uri", "import_urijs", "Uri", "url", "url", "resolve", "import_urijs", "a", "length", "a", "length", "a", "Uri", "url", "length", "import_urijs", "url", "Uri", "defaultValue", "url", "merge", "Uri", "q1", "q2", "retryCallback", "dataUriRegex", "parser", "URL", "url", "compareLeapSecondDates", "factor", "a", "url", "dateTT", "sign", "scratchHPRQuaternion", "transform", "a", "tmp", "normal", "cartographic", "projectedPosition", "translation", "import_urijs", "resolve", "array", "URL", "url", "Uri", "config", "taskProcessor", "faces", "faces", "preMultiplyAlpha", "flipY", "skipColorSpaceConversion", "length", "define", "attributeLocations", "length", "cartesian", "normal", "distance", "transform", "inverseTranspose", "length", "direction", "distance", "update", "direction", "distance", "u", "v", "mode", "u", "cartographic", "index", "length", "attributeLocations", "indices", "mode", "offset", "wrapFunction", "length", "clear", "uniformMap", "length", "length", "location", "length", "offset", "oldValue", "oldValue", "oldValue", "length", "stop", "defaultProjection", "length", "tmp", "u", "v", "normal", "transform", "cartesian", "distance", "direction", "cartographic", "min", "max", "indices", "length", "diffScratch", "min", "max", "scratchMin", "scratchMax", "scratchOptions", "indices", "length", "stop", "offset", "length", "updateFunctions", "tmp", "createUniform", "scratchMatrix", "distance", "length", "normal", "a", "a", "a2", "c2", "a", "a2", "a3", "c2", "c3", "direction", "direction", "normal", "u", "v", "v0", "v1", "a", "q2", "addWithCancellationCheck", "c4", "c3", "c2", "c1", "length", "u1", "u2", "normal", "cartesian", "v", "length", "tmp", "scratchCartesian3", "length", "v1", "v2", "v3", "u1", "u2", "scratchScale", "scratchPlaneNormal", "scratchPlane", "normal", "cartesian", "offset", "u", "v", "direction", "translation", "scratchBoundingSphere", "scratchCartographic", "cartographic", "length", "offset", "uniformMap", "v1", "v2", "v3", "u", "v", "offset", "scratchCartesian1", "scratchCartesian2", "scratchCartesian3", "v0", "v1", "v2", "indices", "vertices", "deadEnd", "maximumIndexPlusOne", "cacheSize", "oneRing", "s", "index", "indices", "length", "scratchCartesian3", "offset", "normalScratch", "scratchCartesian2", "sign", "u1", "v1", "v1Scratch", "v2Scratch", "normalize", "v0", "v2", "v3", "direction", "c2", "a", "cartographic", "cartesian", "length", "offset", "attributeLocations", "normalize", "indices", "length", "scratchGetAttributeCartesian4", "indices", "attributeLocations", "offset", "scratchBoundingSphere", "cartographic", "debugShowBoundingVolume", "factor", "offsetScratch", "points2DScratch", "textureCoordinateRotationPoints", "rectangleCenterScratch", "centerCartesian", "cartographic", "createRenderStates", "modifyForEncodedNormals", "createShaderProgram", "attributeLocations", "length", "uniformMap", "createCommands", "debugShowBoundingVolume", "updateAndQueueCommands", "frameState", "appearance", "length", "cartographic", "boundingVolumeIndex", "updateAndQueueRenderCommand", "debugShowBoundingVolume", "updateAndQueuePickCommand", "updateAndQueueCommands", "textureCoordinateRotationPoints", "frameState", "geometry", "length", "v0", "v1", "ellipsoidGeodesic", "a", "a2", "a3", "u1", "u2", "distance", "distance", "scratchCart1", "scratchCart2", "computeProperties", "cartographic", "cartesian", "c1", "dot", "normal", "projectedPosition", "offset", "offsetScratch", "rightScratch", "encodeScratch", "indices", "swap", "defaultVertexShaderSource", "defaultFragmentShaderSource", "createShaderProgram", "attributeLocations", "createCommands", "length", "uniformMap", "debugShowBoundingVolume", "updateAndQueueCommands", "frameState", "defaultColor", "icrfToFixed", "defaultScale", "defaultRotation", "translation", "createConstantProperty", "a", "length", "oldValue", "matrix3Scratch", "positionScratch", "oldValue", "normal", "oldValue", "offsetScratch", "positionScratch", "DOMPurify", "url", "v1", "v2", "createVertexArray", "length", "uniformMap", "import_urijs", "Uri", "defaultTokenCredit", "length", "length", "a", "min", "max", "length", "offset", "createTexture", "statistics", "length", "length", "initialize", "getBinaryProperties", "countBinaryPropertyMemory", "scratchColor", "length", "feature", "getBinaryProperty", "setBinaryProperty", "checkBatchId", "getGlslComputeSt", "uniformMap", "name", "jsep", "feature", "variables", "scratchColor", "log2", "length", "Node", "a", "length", "createVertexArray", "attributeLocations", "getStencilDepthRenderState", "pickRenderState", "createRenderStates", "modifiedModelViewScratch", "rtcScratch", "uniformMap", "indices", "offset", "subarray", "a", "createColorCommands", "createPickCommands", "feature", "scratchColor", "DEFAULT_COLOR_VALUE", "DEFAULT_SHOW_VALUE", "offset", "length", "scratchColor", "packedBuffer", "initialize", "sizeOfUint32", "cartographic", "offset", "u", "v", "max", "min", "offset", "offset", "length", "min", "max", "offset", "table", "length", "componentCount", "baseResource", "baseResource", "loadResources", "baseResource", "handleError", "ktx2Regex", "baseResource", "loadFromBufferView", "handleError", "length", "indices", "defaultMaterial", "sizeOfUint32", "length", "min", "max", "defaultValue", "value", "length", "indices", "extension", "length", "length", "offset", "a", "scratchMatrix3", "length", "baseResource", "loadFromUri", "handleError", "Primitive", "Node", "Material", "defaultScale", "transform", "offset", "baseResource", "loadResources", "createTexture", "samplerRequiresMipmap", "baseResource", "loadFromDraco", "loadFromBufferView", "handleError", "baseResource", "hasDracoCompression", "baseResource", "hasDracoCompression", "a", "length", "littleEndian", "baseResource", "statistics", "length", "scratchCenter", "baseResource", "Cesium3DTile", "normal", "distance", "length", "normal", "scratchPlane", "transform", "offset", "offset", "length", "reformatChannels", "length", "baseResource", "loadResources", "initialize", "original", "c1", "a2", "c2", "a", "hash", "indices", "Attribute", "Indices", "FeatureIdAttribute", "FeatureIdTexture", "FeatureIdImplicitRange", "MorphTarget", "Primitive", "Instances", "Skin", "Node", "AnimatedPropertyType", "AnimationSampler", "AnimationTarget", "AnimationChannel", "Animation", "ArticulationStage", "Articulation", "Asset", "Scene", "Components", "MetallicRoughness", "SpecularGlossiness", "Material", "baseResource", "loadPrimitiveOutline", "handleError", "loadResources", "length", "indices", "getDefault", "min", "max", "scratchCenter", "unloadTextures", "createCommands", "attributeLocations", "PointCloudEyeDomeLighting_default", "PointCloudEyeDomeLighting_default", "scratchViewport", "scratchCartesian4", "mode", "cartographic", "sizeOfUint32", "FeatureIdAttribute", "baseResource", "loadPrimitiveOutline", "handleError", "length", "parse", "feature", "scratchCartesian", "cartographic", "indices", "sizeOfUint32", "Attribute", "FeatureIdAttribute", "Instances", "baseResource", "loadPrimitiveOutline", "handleError", "createStructuralMetadata", "positionScratch", "buffer", "length", "length", "u", "u", "u", "q1", "AnimatedPropertyType", "initialize", "length", "initialize", "length", "length", "fract", "StyleCommandsNeeded", "initialize", "scratchColor", "feature", "initialize", "getStencilDepthRenderState", "colorRenderState", "pickRenderState", "length", "command", "createPickCommands", "initialize", "deriveTranslucentCommand", "debugShowBoundingVolume", "uniformMap", "getLastSelectionDepth", "indices", "uniformMap", "uniformMap", "cartesian", "initialize", "length", "transform", "textureResolutionScratch", "uniformMap", "uniformMap", "transform", "transformScratch", "positionScratch", "translation", "projectedPosition", "offset", "createVertexBuffer", "attributeString", "statistics", "length", "transform", "initialize", "length", "uniformMap", "indices", "uniformMap", "offset", "statistics", "declareStructsAndFunctions", "uniformMap", "offset", "uniformMap", "offset", "uniformMap", "length", "processAttribute", "uniformMap", "Material", "MetallicRoughness", "SpecularGlossiness", "processTexture", "uniformMap", "weights", "uniformMap", "uniformMap", "uniformMap", "getGeometricError", "uniformMap", "statistics", "length", "indices", "uniformMap", "scratchProjectedMin", "scratchProjectedMax", "scratchPosition", "length", "projectedPosition", "uniformMap", "length", "uniformMap", "length", "indices", "mode", "initialize", "length", "uniformMap", "initialize", "translation", "transform", "length", "debugShowBoundingVolume", "length", "import_mersenne_twister", "sizeOfUint32", "Components", "Scene", "Node", "Primitive", "Attribute", "Quantization", "FeatureIdAttribute", "Material", "MetallicRoughness", "transcodeComponentType", "randomNumberGenerator", "MersenneTwister", "scratchMin", "scratchMax", "scratchPosition", "randomValues", "min", "max", "length", "handleError", "length", "scratchPosition", "scratchCartographic", "scratchBoundingSphere", "positionWC", "distance", "baseResource", "scratchColor", "statistics", "makeModelOptions", "scratchCartographic", "scratchPosition", "mode", "index", "scratchCartesian3", "positionWC", "image", "SHOW_INDEX", "POSITION_INDEX", "PIXEL_OFFSET_INDEX", "EYE_OFFSET_INDEX", "HORIZONTAL_ORIGIN_INDEX", "VERTICAL_ORIGIN_INDEX", "SCALE_INDEX", "IMAGE_INDEX_INDEX", "COLOR_INDEX", "ROTATION_INDEX", "ALIGNED_AXIS_INDEX", "SCALE_BY_DISTANCE_INDEX", "TRANSLUCENCY_BY_DISTANCE_INDEX", "PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX", "DISABLE_DEPTH_DISTANCE", "SDF_INDEX", "length", "getIndexBuffer", "indices", "scratchCartesian2", "mode", "offset", "createVertexArray", "length", "scratchCartographic", "offset", "feature", "length", "length", "rtlChars", "GraphemeSplitter", "rebindAllGlyphs", "bitmapSDF", "repositionAllGlyphs", "distance", "cartoScratch", "length", "offset", "xzPlane", "c1", "NUMBER_OF_PROPERTIES", "POSITION_INDEX", "SHOW_INDEX", "DISTANCE_DISPLAY_CONDITION", "makeDirty", "length", "SHOW_INDEX", "WIDTH_INDEX", "POSITION_INDEX", "MATERIAL_INDEX", "POSITION_SIZE_INDEX", "DISTANCE_DISPLAY_CONDITION", "NUMBER_OF_PROPERTIES", "attributeLocations", "createBatchTable", "updateMode", "length", "debugShowBoundingVolume", "offset", "currentId", "uniformMap", "indices", "mode", "scratchUniformArray", "direction", "scratchCartographic", "packBuffer", "offset", "createVerticesTaskProcessor", "scratchPosition", "length", "clearStyle", "feature", "scratchColor", "scratchColor2", "scratchColor3", "scratchColor4", "scratchColor5", "scratchColor6", "packBuffer", "offset", "unpackBuffer", "length", "createVerticesTaskProcessor", "scratchColor", "createPrimitive", "indices", "packedBuffer", "finishPrimitive", "packBuffer", "offset", "createVerticesTaskProcessor", "attributeLocations", "createVertexArray", "indices", "modifiedModelViewScratch", "rtcScratch", "createUniformMap", "createRenderStates", "createShaders", "queueCommands", "uniformMap", "length", "clearStyle", "feature", "scratchColor", "DEFAULT_COLOR_VALUE", "DEFAULT_SHOW_VALUE", "min", "max", "packBuffer", "offset", "createVerticesTaskProcessor", "attributeLocations", "createVertexArray", "finishVertexArray", "indices", "modifiedModelViewScratch", "rtcScratch", "createUniformMap", "getRenderState", "createRenderStates", "createShaders", "queueCommands", "uniformMap", "length", "clearStyle", "feature", "scratchColor", "DEFAULT_COLOR_VALUE", "DEFAULT_SHOW_VALUE", "initialize", "scratchBVCartographic", "u", "v", "cartographic", "initialize", "createColorChangedCallback", "getBatchIds", "sizeOfUint32", "indices", "createFeatures", "url", "length", "statistics", "url", "length", "v0", "v1", "earcut", "indices", "v2", "max", "c1", "c2", "scaleToSurface", "boundingRectangleScratch", "positionScratch", "corners", "indices", "length", "scratchRectangle", "scratchOptions", "cartesian3Scratch2", "cartesian3Scratch3", "cartographicScratch", "scratchXAxis", "scratchYAxis", "scratchZAxis", "min", "v", "offset", "length", "distance", "distanceScratch", "scratchCartographic0", "scratchCartographic1", "scratchCartographic2", "c1", "swap", "scratchCartographic", "cartographic", "polygon", "i", "a", "polygons", "positions", "indices", "p1Scratch", "p2Scratch", "length", "flatPositions", "indices", "newOptions", "scratchOptions", "distance", "sScratch", "dScratch", "cos", "sin", "scratchOptions", "indices", "offset", "length", "scratchOptions", "scratchW", "scratchCartesian", "a", "u", "v", "baseResource", "scratchCartesian", "distance", "factor", "screenSpaceError", "now", "getContentBoundingVolume", "scratchMatrix", "scratchScale", "scratchHalfAxes", "scratchCenter", "scratchRectangle", "transform", "passOptions", "updateClippingPlanes", "length", "length", "statistics", "load", "length", "statistics", "length", "baseResource", "v", "a", "a", "visitTile", "add", "traversal", "selectDesiredTile", "updateAndPushChildren", "loadTile", "anyChildrenVisible", "canTraverse", "visitTile", "traversal", "executeTraversal", "selectDesiredTile", "updateAndPushChildren", "loadTile", "anyChildrenVisible", "canTraverse", "visitTile", "PointCloudEyeDomeLighting_default", "statistics", "url", "makeTile", "baseResource", "scratchCartographic", "scratchMatrix", "scratchCenter", "scratchPosition", "direction", "a", "scratchCartesian", "normal", "passOptions", "scratchStack", "update", "modelMatrixScratch", "defaultRepeat", "stop", "entityOptionsScratch", "oldValue", "length", "stop", "scratchJulianDate", "epoch", "length", "scratchCartesian1", "scratchCartesian2", "scratchCartesian3", "scratchCartesian4", "scratchCartesian5", "scratchCartesian6", "scratchCartesian7", "scratchCartesian8", "scratchCartesian9", "subdivideHeights", "translation", "centerScratch", "length", "v0", "v1", "scratch1", "scratch2", "quaterion", "rotMatrix", "computeRoundCorner", "length", "scratchForwardProjection", "scratchBackwardProjection", "normal", "corners", "cartesian1", "cartesian2", "cartesian3", "cartesian4", "cartesian5", "cartesian6", "scratch1", "scratch2", "scaleToSurface", "normal", "combine", "corners", "length", "indices", "a", "v0", "v1", "v2", "scratchCartesian1", "scratchCartesian2", "scratchCartographic", "min", "max", "direction", "scratchEllipsoid", "scratchVertexFormat", "scratchOptions", "cartesian1", "cartesian2", "cartesian3", "scaleToSurface", "combine", "corners", "length", "indices", "computePositionsExtruded", "v0", "v1", "scratchEllipsoid", "scratchOptions", "oldValue", "scratchColor", "defaultOffset", "offsetScratch", "scratchRectangle", "scratchCartesian", "positionScratch", "direction", "SHOW_INDEX", "POSITION_INDEX", "COLOR_INDEX", "SCALE_BY_DISTANCE_INDEX", "TRANSLUCENCY_BY_DISTANCE_INDEX", "DISTANCE_DISPLAY_CONDITION_INDEX", "makeDirty", "tempCartesian3", "scratchCartesian4", "positionWC", "SHOW_INDEX", "POSITION_INDEX", "COLOR_INDEX", "OUTLINE_COLOR_INDEX", "OUTLINE_WIDTH_INDEX", "PIXEL_SIZE_INDEX", "SCALE_BY_DISTANCE_INDEX", "TRANSLUCENCY_BY_DISTANCE_INDEX", "DISTANCE_DISPLAY_CONDITION_INDEX", "DISABLE_DEPTH_DISTANCE_INDEX", "NUMBER_OF_PROPERTIES", "attributeLocations", "length", "createVAF", "writePositionScratch", "LEFT_SHIFT16", "LEFT_SHIFT8", "writeCompressedAttrib0", "writeCompressedAttrib1", "writeScaleByDistance", "recomputeActualPositions", "updateMode", "mode", "updateBoundingVolume", "scratchWriterArray", "createVertexArray", "x", "y", "swap", "tmp", "length", "factor", "indices", "length", "normalScratch", "positionScratch", "length", "scratchVertexFormat", "scratchOptions", "normal", "normalScale", "indices", "radiusScratch", "length", "scratchOptions", "indices", "defaultOffset", "offsetScratch", "positionScratch", "scratchColor", "import_urijs", "Uri", "length", "tmp", "length", "cartesian3", "import_urijs", "defaultColor", "defaultColor", "defaultColor", "defaultColor", "defaultOutlineColor", "length", "length", "length", "oldValue", "epoch", "length", "stop", "epoch", "defaultEvenColor", "defaultOddColor", "defaultOffset", "defaultRepeat", "normalize", "oldValue", "oldValue", "positionScratch", "rotationScratch", "scratchCartesian", "scratchCartographic", "length", "cartesian", "Uri", "epoch", "polygon", "clear", "czml", "getIndex", "length", "length", "scratchCartesian1", "scratchCartesian2", "scratchCartesian3", "scratchNormal", "length", "normal", "scratchCartesian1", "scratchCartesian2", "scratchCartesian3", "scratchCartesian4", "quaternionScratch", "scratchNormal", "scratchCartographic", "normal", "length", "indices", "topBoundingSphere", "bottomBoundingSphere", "computeRectangle", "scratchCenter", "scratchEllipsoid", "scratchVertexFormat", "scratchOptions", "scratchCartesian1", "boundingSphereCenter", "computeEllipse", "length", "indices", "topBoundingSphere", "bottomBoundingSphere", "computeExtrudedEllipse", "scratchCenter", "scratchEllipsoid", "scratchOptions", "scratchColor", "defaultOffset", "offsetScratch", "scratchRectangle", "scratchPosition", "scratchNormal", "scratchTangent", "scratchBitangent", "defaultRadii", "cos", "sin", "scratchRadii", "scratchInnerRadii", "scratchVertexFormat", "scratchOptions", "indices", "offset", "normal", "length", "defaultMaterial", "defaultOffset", "offsetScratch", "scratchColor", "offset", "scratchVertexFormat", "scratchOptions", "indices", "min", "max", "indices", "positionScratch", "scratchColor", "scratchAxis", "scratchScale", "scratchRotation", "scratchRotationScale", "transform", "normal", "distance", "translation", "scratchPosition", "scratchNormal", "scratchTangent", "scratchBitangent", "centerScratch", "quaternionScratch", "textureMatrixScratch", "polygon", "normal", "indices", "length", "flatPositions", "newOptions", "scratchEllipsoid", "scratchVertexFormat", "scratchOptions", "sign", "scratchCartographic", "scratchCartesian", "cartesian", "scratchProjectPointOntoPlaneRay", "scratchProjectPointOntoPlaneCartesian3", "v", "length", "carto1", "scratchPosition", "scratchNormal", "scratchTangent", "scratchBitangent", "p1Scratch", "p2Scratch", "tangentMatrixScratch", "flatPositions", "length", "normal", "startCartographicScratch", "endCartographicScratch", "ellipsoidGeodesic", "computeRectangle", "swap", "interpolatedCartographicScratch", "idlCross", "polygon", "indices", "newOptions", "scratchEllipsoid", "scratchVertexFormat", "scratchCartesian0", "scratchCartesian1", "direction", "cartographic", "textureCoordinateRotationPoints", "createGeometryFromPositions", "length", "indices", "createGeometryFromPositionsExtruded", "corners", "scratchEllipsoid", "dummyOptions", "newOptions", "scratchColor", "defaultOffset", "offsetScratch", "scratchRectangle", "length", "a", "polygon", "computeAttributes", "length", "indices", "offset", "v0", "v1", "v2", "scratchEllipsoid", "scratchVertexFormat", "scratchOptions", "computeAttributes", "indices", "offset", "length", "scratchEllipsoid", "scratchOptions", "brScratch", "scratchColor", "positionScratch", "normalScratch", "tangentScratch", "bitangentScratch", "rectangleScratch", "stScratch", "bottomBoundingSphere", "topBoundingSphere", "length", "normal", "constructRectangle", "indices", "addWallPositions", "scratchVertexFormat", "constructExtrudedRectangle", "corners", "nwScratch", "computeRectangle", "scratchRectangle", "scratchEllipsoid", "scratchOptions", "quaternionScratch", "centerScratch", "points2DScratch", "rotation2DScratch", "rectangleCenterScratch", "textureCoordinateRotationPoints", "scratchColor", "defaultOffset", "offsetScratch", "scratchRectangle", "scratchCarto", "colorScratch", "distanceDisplayConditionScratch", "defaultDistanceDisplayCondition", "defaultOffset", "offsetScratch", "oldValue", "unsubscribe", "length", "offset", "distanceDisplayConditionScratch", "defaultDistanceDisplayCondition", "defaultOffset", "offsetScratch", "Batch", "oldValue", "unsubscribe", "colorScratch", "length", "offset", "RBush", "a", "colorScratch", "distanceDisplayConditionScratch", "defaultDistanceDisplayCondition", "Batch", "oldValue", "unsubscribe", "length", "distanceDisplayConditionScratch", "defaultDistanceDisplayCondition", "Batch", "oldValue", "unsubscribe", "length", "colorScratch", "distanceDisplayConditionScratch", "defaultDistanceDisplayCondition", "defaultOffset", "offsetScratch", "Batch", "oldValue", "unsubscribe", "length", "offset", "c1", "scratchCartographic1", "scratchCartographic2", "length", "v0", "v1", "offset", "scratchBitangent", "scratchTangent", "scratchNormal", "length", "scratchEllipsoid", "scratchVertexFormat", "scratchOptions", "min", "max", "newOptions", "normal", "indices", "scratchCartesian3Position1", "scratchCartesian3Position2", "length", "scratchEllipsoid", "scratchOptions", "min", "max", "newOptions", "indices", "scratchColor", "oldValue", "length", "tmp", "defaultScale", "defaultOutlineColor", "defaultOutlineWidth", "defaultBackgroundColor", "defaultBackgroundPadding", "defaultPixelOffset", "defaultEyeOffset", "defaultHeightReference", "defaultHorizontalOrigin", "defaultVerticalOrigin", "positionScratch", "eyeOffsetScratch", "pixelOffsetScratch", "translucencyByDistanceScratch", "pixelOffsetScaleByDistanceScratch", "scaleByDistanceScratch", "distanceDisplayConditionScratch", "EntityData", "returnPrimitive", "updateClamping", "tilingScheme", "scratchCartesian2", "defaultScale", "defaultShadows", "defaultHeightReference", "defaultColor", "modelMatrixScratch", "scratchColor", "scratchCartesian", "scratchPosition", "scratchCartographic", "result", "scratchTimeInterval", "EntityData", "stop", "tmp", "length", "u", "defaultColor", "defaultOutlineColor", "defaultOutlineWidth", "colorScratch", "positionScratch", "outlineColorScratch", "scaleByDistanceScratch", "translucencyByDistanceScratch", "distanceDisplayConditionScratch", "EntityData", "returnPrimitive", "updateClamping", "length", "scratchEllipsoid", "scratchVertexFormat", "scratchOptions", "scratchCartesian3", "scratchPosition", "index", "remove", "c1", "direction", "indices", "defaultZIndex", "scratchColor", "defaultMaterial", "defaultShow", "defaultShadows", "defaultDistanceDisplayCondition", "defaultClassificationType", "oldValue", "DynamicGeometryUpdater", "scratchColor", "distanceDisplayConditionScratch", "defaultDistanceDisplayCondition", "Batch", "oldValue", "unsubscribe", "length", "emptyArray", "length", "getBoundingSphereArrayScratch", "getBoundingSphereBoundingSphereScratch", "tmp", "length", "getBoundingSphereArrayScratch", "getBoundingSphereBoundingSphereScratch", "tmp", "mode", "cartesian", "direction", "transform", "offset", "scratchCartesian", "factor", "url", "colorScratch", "defaultFill", "geoJsonObjectTypes", "processPoint", "processPolygon", "geometryTypes", "feature", "polygon", "clear", "length", "load", "crsFunction", "Autolinker", "resolve", "length", "processDescription", "tmp", "stop", "load", "import_autolinker", "import_urijs", "length", "a", "v", "c2", "strm", "MAX_BITS", "Z_OK", "Z_STREAM_END", "Z_NEED_DICT", "Z_STREAM_ERROR", "Z_DATA_ERROR", "Z_BUF_ERROR", "Z_NO_FLUSH", "Z_FINISH", "v", "u", "hn", "a", "c", "mode", "get", "STORED", "table", "z", "PRESET_DICT", "Z_DEFLATED", "length", "ZStream", "offset", "length", "a2", "a", "tmp", "hash", "table", "c2", "length", "u", "offset", "decrypt", "encrypt", "getRandomValues", "length", "createKeys", "offset", "createKeys", "Inflate", "codec", "Deflate", "config", "Deflate", "Inflate", "config", "url", "resolve", "createCodec", "config", "workerData", "resolve", "codecConstructor", "options", "webWorker", "scripts", "codec", "offset", "config", "offset", "length", "resolve", "offset", "length", "resolve", "resolve", "endOfDirectoryView", "offset", "options", "config", "offset", "codec", "createCodec", "length", "resolve", "getOptionValue", "offset", "getMaximumCompressedSize", "resolve", "fileEntry", "setUint32", "getDataView", "config", "codec", "createCodec", "length", "zip64", "Group", "v", "a", "v0", "v1", "Sequence", "Tween", "tmp", "remove", "update", "self", "self", "parser", "autolinker", "Autolinker", "BILLBOARD_SIZE", "BILLBOARD_NEAR_DISTANCE", "BILLBOARD_NEAR_RATIO", "BILLBOARD_FAR_DISTANCE", "BILLBOARD_FAR_RATIO", "namespaces", "processDocument", "readBlobAsText", "Uri", "queryStringAttribute", "length", "queryNumericAttribute", "queryFirstNode", "queryNodes", "queryNumericValue", "queryStringValue", "tmp", "createDefaultBillboard", "polygon", "createDefaultLabel", "textColor", "processPoint", "processPolygon", "stop", "interpolate", "geometryTypes", "scratchDiv", "processDescription", "processFeature", "scratchCartographic", "scratchCartesian2", "scratchCartesian3", "centerCartesian", "load", "now", "document", "remove", "i", "BILLBOARD_SIZE", "resolve", "url", "createPoint", "createLineString", "createPolygon", "scratchCartesian3", "scratchCartographic", "scratchJulianDate", "location", "cartesian3Scratch", "translation", "scaleMatrix", "u", "v", "scratchPosition", "offset", "addAttribute", "cartesian3Scratch", "matrix4Scratch", "cos", "sin", "sqrt", "v", "u", "isEdge", "indices", "indices", "offset", "length", "tilingScheme", "textureResolutionScratch", "scratchCartographic", "getPosition", "mode", "indices", "v0", "v1", "v2", "transform", "createResources", "failure", "doRequest", "tilingScheme", "defaultTokenCredit", "defaultAccessToken", "failure", "offset", "properties", "ktx2Regex", "url", "defaultTokenCredit", "url", "feature", "ImageryProviderBuilder", "metadataSuccess", "metadataFailure", "requestMetadata", "url", "rectangleScratch", "buildImageResource", "intersectionScratch", "buildImageResource", "doRequest", "url", "rectangleScratch", "cartographicScratch", "cartographic", "url", "tilingScheme", "ImageryProviderBuilder", "metadataSuccess", "metadataFailure", "requestMetadata", "url", "tilingScheme", "url", "feature", "url", "requestImage", "url", "options", "tilingScheme", "tilingScheme", "failure", "doRequest", "length", "indices", "handleError", "cartographicScratch", "centerCartographicScratch", "normalScratch", "u", "v", "scratchCenter", "indices", "cartographic", "normal", "normal2", "vertexIndex", "targetUv", "a", "length", "pushCommand", "boundingSphereScratch", "rectangleCenterScratch", "distance", "modifiedModelViewScratch", "rtcScratch", "cornerPositionsScratch", "computeOccludeePoint", "min", "max", "scratchClippingPlanesMatrix", "uniformMap", "transform", "indices", "pickFeatures", "feature", "tilingScheme", "remove", "tilingScheme", "cartographic", "length", "max", "updateHeights", "centerScratch", "a", "visitTile", "distance", "scratchCartographic", "scratchPosition", "scratchArray", "mode", "a", "scratchArray", "mode", "length", "cartoScratch", "cartographic", "cartesian", "TdtMinusTai", "J2000d", "c3", "rotMtx", "attributeLocations", "url", "rotationScratch", "translationScratch", "scratchCommandList", "translation", "sort", "length", "scratchCartesian3", "tempVec", "tempScratch", "dot", "distance", "u", "length", "offset", "update", "getPlanesRight", "getPlanesNearCenter", "direction", "normal", "distance", "update", "direction", "distance", "scratchCart2", "factor", "update", "dot", "scratchCartographic", "mode", "transform", "updateFunctions", "distance", "scratchCartographic", "scratchCartesian3Projection", "scratchCartesian3", "cartographic", "projectedPosition", "scratchCartesian", "mode", "direction", "transform", "cartesian", "dot", "offset", "rotMatrix", "ellipsoidGeodesic", "scratchDirection", "scratchToCenter", "proj", "updateCV", "normalScratch", "centerScratch", "normal", "import_urijs", "container", "pool", "defaultCredit", "Uri", "scratchVertexFormat", "offset", "normal", "negativeX", "indices", "PERSPECTIVE", "ORTHOGRAPHIC", "scratchPackPerspective", "scratchPackOrthographic", "scratchPackQuaternion", "scratchPackorigin", "offset", "indices", "scratchRight", "scratchRotation", "scratchColor", "length", "frustumSplits", "direction", "scratchCartesian1", "scratchCartesian2", "scratchCartesian3", "scratchCartesian4", "scratchCartesian5", "attributeLocations", "length", "scratchMatrix3", "rotate", "direction", "a", "length", "scratchPositionNormal", "dot", "length", "requiresManualDepthTest", "define", "getDepthOnlyShaderProgram", "getPickShaderProgram", "attributeLocations", "uniformMap", "derivedCommandNames", "derivedCommandPacks", "length", "indices", "updateCopyCommands", "clear", "destroyFramebuffers", "destroyResources", "updateFramebuffers", "uniformMap", "getTranslucentRenderState", "getTranslucentShaderProgram", "attributeLocations", "colorRenderState", "destroyResources", "createResources", "colorScratch", "max", "length", "destroyResources", "length", "createRenderStates", "createRenderState", "destroyFramebuffer", "length", "faces", "createFramebuffer", "scratchViewport", "frustumCornersNDC", "scratchMatrix", "scratchFrustumCorners", "scratchScale", "applyDebugSettings", "translation", "scratchSplits", "scratchMin", "scratchMax", "distance", "direction", "min", "max", "scratchRight", "scratchUp", "scratchTranslation", "scratchCartesian1", "scratchCartesian2", "scratchBoundingSphere", "scratchCenter", "dot", "destroyTextures", "destroyFramebuffers", "updateTextures", "updateFramebuffers", "updateResources", "uniformMap", "executeCommand", "length", "a", "length", "direction", "frustumSplits", "transform", "scratchRectangle", "scratchPosition", "scratchRight", "scratchUp", "resolve", "direction", "length", "distance", "scratchCartographic", "cartographic", "cartesian", "destroyFramebuffers", "length", "createUniformMap", "createCommands", "currentValue", "uniformMap", "createUniformMap", "mode", "length", "feature", "offset", "length", "isSelectedTextureDirty", "length", "createFramebuffers", "releaseResources", "updateFramebuffers", "length", "random", "getPosition", "length", "direction", "update", "updateCV", "camera", "stop", "getKey", "update", "Tween", "delay", "update", "length", "now", "length", "scratchPositionNormal", "scratchCameraPosition", "scratchCenter", "scratchCartesian", "distance", "mode", "direction", "zoom2D", "scratchDepthIntersection", "scratchRayIntersection", "cartographic", "scratchSurfaceNormal", "normal", "pickPosition", "transform", "dot", "zoom3D", "scratchCartographic", "scratchRadii", "scratchEllipsoid", "scratchNormal", "length", "attributeLocations", "a", "length", "Scene", "updateDerivedCommands", "a", "length", "scratchPerspectiveFrustum", "scratchPerspectiveOffCenterFrustum", "scratchOrthographicFrustum", "scratchOrthographicOffCenterFrustum", "executeCommands", "renderTranslucentDepthForPick", "scene", "passState", "useDepthPlane", "mode", "offset", "transform", "scratchCullingVolume", "clear", "cartographic", "cartesian", "scratchModelMatrix", "mode", "attributeLocations", "scratchCartesian4", "mode", "uniformMap", "attributeLocations", "directions", "positionCC", "positionWC", "render", "supportsImageRenderingPixelated", "scene", "tilingScheme", "rectangleScratch", "findNode", "westScratch", "cartographicScratch", "a", "requestMetadata", "url", "resource", "scratchTimeVec", "createEvaluateFunction", "u", "u1", "u2", "a", "arrayScratch", "indices", "createMeshTaskName", "createMeshTaskProcessorNoThrottle", "createMeshTaskProcessorThrottle", "tilingScheme", "maxShort", "u", "v", "interpolateHeight", "interpolateMeshHeight", "v0", "u1", "v1", "u2", "v2", "TerrainProviderBuilder", "parseMetadataSuccess", "metadataSuccess", "length", "indices", "offset", "resolve", "requestTileGeometry", "url", "scratchOptions", "scratchEllipseGeometry", "scratchOptions", "length", "swap", "url", "a", "key", "oldValue", "offset", "createMeshTaskName", "createMeshTaskProcessorNoThrottle", "createMeshTaskProcessorThrottle", "rectangleScratch", "tilingScheme", "u", "v", "interpolateHeight", "interpolateMeshHeight", "upsampleTaskProcessor", "texCoordScratch0", "texCoordScratch1", "texCoordScratch2", "barycentricCoordinateScratch", "indices", "sizeOfUint32", "offset", "u1", "u2", "v0", "v1", "v2", "TerrainState", "julianDateScratch", "taskProcessor", "buffer", "url", "defaultTokenCredit", "weights", "u", "url", "Proxy", "interpolateColors", "offset", "length", "scratchArray2", "generateArcOptionsScratch", "c1", "indices", "scratchEllipsoidGeometry", "scratchOptions", "TerrainProviderBuilder", "metadataSuccess", "metadataFailure", "requestMetadata", "url", "rectangleScratch", "tilingScheme", "oldValue", "epoch", "length", "feature", "variables", "url", "variables", "a", "scratchCenter", "scratchScale", "scratchRotation", "min", "max", "baseResource", "littleEndian", "scratchScale", "scale", "offset", "scratchOrientedBoundingBox", "scratchTranslation", "scratchRotation", "scratchRotationMatrix", "scratchMatrix", "scratchColumn2", "scratchCorners", "a", "corners", "translation", "scaleMatrix", "scratchScale", "scratchRotationScale", "shapeIsLongitudeReversed", "offset", "scratchRectangle", "translation", "url", "statistics", "min", "max", "length", "v", "SHOW_INDEX", "POSITION_INDEX", "SCALE_INDEX", "COLOR_INDEX", "makeDirty", "attributeLocations", "attributeLocationsBatched", "attributeLocationsInstanced", "SHOW_INDEX", "POSITION_INDEX", "SCALE_INDEX", "MAXIMUM_SIZE_INDEX", "SLICE_INDEX", "BRIGHTNESS_INDEX", "NUMBER_OF_PROPERTIES", "COLOR_INDEX", "length", "getIndexBuffer", "getIndexBufferBatched", "indices", "getIndexBufferInstanced", "getVertexBufferInstanced", "createVAF", "writePositionScratch", "createVertexArray", "scratchWriterArray", "createShaderProgram", "update", "protobuf", "buildImageResource", "a", "defaultColor", "defaultBackgroundColor", "url", "taskProcessor", "offset", "a", "scratchV0", "scratchV1", "scratchV2", "scratchNormal", "indices", "v0", "v1", "v2", "normal", "processData", "fields", "location", "url", "a", "u", "v", "a", "url", "scratchCartesian2", "tilingScheme", "Lerc", "a", "trailingSlashRegex", "defaultCredit", "defaultCredit", "tilingScheme", "length", "a", "v", "import_mersenne_twister", "uniformMap", "initialize", "scratchMin", "scratchMax", "scratchPosition", "randomNumberGenerator", "randomValues", "getRandomValues", "MersenneTwister", "min", "max", "scratchColor", "scratchClippingPlanesMatrix", "scratchInverseTransposeClippingPlanesMatrix", "createResources", "createUniformMap", "uniformMap", "transform", "getBuiltinPropertyNames", "numberOfAttributes", "builtinVariableSubstitutionMap", "createShaders", "parameterList", "attributeLocations", "length", "decodeDraco", "scratchComputedTranslation", "scratchScale", "translation", "tilingScheme", "level", "x", "y", "z", "distance", "feature", "handlePromise", "handleError", "PointCloudEyeDomeLighting_default", "uniformMap", "scratchDate", "transform", "updateState", "scratchModelMatrix", "getGeometricError", "length", "Megatexture_default", "uniformMap", "Megatexture_default", "traversal", "length", "positionWC", "a", "createTexture", "uniformMap", "uniformMap", "initialize", "updateVerticalExaggeration", "debugDraw", "screenSpaceError", "scratchDimensions", "scratchScale", "scratchRotation", "traversal", "updateClippingPlanes", "corners", "tmp", "scratchColor", "scratchColorBytes", "removeDuplicates", "a", "length", "v", "n", "a", "b", "c", "d", "e", "l", "k", "f", "h", "g", "m", "p", "q", "u", "x", "J", "r", "w", "A", "F", "D", "C", "I", "G", "H", "K", "N", "ko", "knockout", "min", "max", "step", "createCommand", "svgNS", "Animation", "clockViewModel", "hash", "statistics", "scratchPickRay", "scratchPickCartesian", "cartesian", "cartographic", "table", "stringOptions", "formatMemoryString", "statistics", "highlightColor", "scratchColor", "length", "feature", "statistics", "cartographic", "updateCredits", "offset", "mode", "svgNS", "stop", "stop", "tic", "track", "NoSleep", "boundingSphereScratch", "feature", "length", "cartesian3Scratch", "offset", "resolve", "zoomTarget", "boundingSphere", "length", "scratchTranslation", "scratchScale", "scratchRotation", "translation", "length", "min", "max", "VERSION"]
}
